From: Cris Di Sclafani
Date: Fri, 31 Jul 2020 09:05:45 +0000 (+0200)
Subject: Built motion from commit (unavailable).|2.5.0
X-Git-Url: http://repos.xcallymotion.com/base//%22angular-material.themes.css/%22?a=commitdiff_plain;h=61e7e3706ecfdd7b4f8befa891e18b2477d08d3b;p=motion2.git
Built motion from commit (unavailable).|2.5.0
---
diff --git a/apidoc/api_project.js b/apidoc/api_project.js
index b96b623..3325b40 100644
--- a/apidoc/api_project.js
+++ b/apidoc/api_project.js
@@ -1 +1 @@
-define({
"name": "xCALLY Motion API",
"version": "2.5.0",
"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-07-31T08:13:22.617Z",
"url": "http://apidocjs.com",
"version": "0.19.0"
}
});
+define({
"name": "xCALLY Motion API",
"version": "2.5.0",
"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-07-31T08:59:04.367Z",
"url": "http://apidocjs.com",
"version": "0.19.0"
}
});
diff --git a/apidoc/api_project.json b/apidoc/api_project.json
index c4b6731..02cec89 100644
--- a/apidoc/api_project.json
+++ b/apidoc/api_project.json
@@ -1 +1 @@
-{
"name": "xCALLY Motion API",
"version": "2.5.0",
"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-07-31T08:13:22.617Z",
"url": "http://apidocjs.com",
"version": "0.19.0"
}
}
+{
"name": "xCALLY Motion API",
"version": "2.5.0",
"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-07-31T08:59:04.367Z",
"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 c8fc7bb..c941ec1 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 _0xf11a=['bot','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','VIRTUAL','getDataValue','action','STRING','contactManager','integration','motionbar','jscripty','browser'];(function(_0x520d75,_0x5aeb6c){var _0x12cdf8=function(_0x2f3244){while(--_0x2f3244){_0x520d75['push'](_0x520d75['shift']());}};_0x12cdf8(++_0x5aeb6c);}(_0xf11a,0xf5));var _0xaf11=function(_0x261e29,_0x10fffd){_0x261e29=_0x261e29-0x0;var _0x25ef43=_0xf11a[_0x261e29];return _0x25ef43;};'use strict';var Sequelize=require(_0xaf11('0x0'));module['exports']={'name':{'type':Sequelize[_0xaf11('0x1')],'get':function(_0xa00930){return this[_0xaf11('0x2')](_0xaf11('0x3'));}},'action':{'type':Sequelize[_0xaf11('0x4')],'allowNull':![],'validate':{'isIn':{'args':[[_0xaf11('0x5'),_0xaf11('0x6'),_0xaf11('0x7'),_0xaf11('0x8'),'urlForward',_0xaf11('0x9'),_0xaf11('0xa'),'script']],'msg':_0xaf11('0xb')}},'comment':_0xaf11('0xb')},'data1':{'type':Sequelize[_0xaf11('0x4')](0x1000),'comment':_0xaf11('0xc')},'data2':{'type':Sequelize[_0xaf11('0x4')](0x1000),'comment':_0xaf11('0xd')},'data3':{'type':Sequelize[_0xaf11('0x4')](0x1000),'comment':'motionbar[NULL,NULL,WinAppArguments]'},'data4':{'type':Sequelize[_0xaf11('0x4')](0x1000)},'data5':{'type':Sequelize[_0xaf11('0x4')](0x1000)},'data6':{'type':Sequelize[_0xaf11('0x4')]},'data7':{'type':Sequelize[_0xaf11('0xe')]}};
\ No newline at end of file
+var _0x1e39=['browser','Allowed\x20values:\x20contactManager,\x20integration,\x20motionbar,\x20jscripty,\x20urlForward,\x20browser,\x20bot,\x20script','STRING','contactManager[ListId],\x20integration[intName(zendesk)],\x20motionbar[Popup(0),URL(1),WinApp(2)],\x20urlForward[GET,POST],\x20browser[TemplateId(0),URL(1)]','integration[AccountId],\x20motionbar[TemplateId,URL,WinAppPath],\x20urlForward[URL]','motionbar[NULL,NULL,WinAppArguments]','TEXT','sequelize','VIRTUAL','getDataValue','action','contactManager','integration','urlForward'];(function(_0xbc3542,_0x4de021){var _0x1c88ff=function(_0x1d1fb4){while(--_0x1d1fb4){_0xbc3542['push'](_0xbc3542['shift']());}};_0x1c88ff(++_0x4de021);}(_0x1e39,0x13b));var _0x91e3=function(_0x46361e,_0x243aaf){_0x46361e=_0x46361e-0x0;var _0x14e302=_0x1e39[_0x46361e];return _0x14e302;};'use strict';var Sequelize=require(_0x91e3('0x0'));module['exports']={'name':{'type':Sequelize[_0x91e3('0x1')],'get':function(_0x27f664){return this[_0x91e3('0x2')](_0x91e3('0x3'));}},'action':{'type':Sequelize['STRING'],'allowNull':![],'validate':{'isIn':{'args':[[_0x91e3('0x4'),_0x91e3('0x5'),'motionbar','jscripty',_0x91e3('0x6'),_0x91e3('0x7'),'bot','script']],'msg':_0x91e3('0x8')}},'comment':'Allowed\x20values:\x20contactManager,\x20integration,\x20motionbar,\x20jscripty,\x20urlForward,\x20browser,\x20bot,\x20script'},'data1':{'type':Sequelize[_0x91e3('0x9')](0x1000),'comment':_0x91e3('0xa')},'data2':{'type':Sequelize[_0x91e3('0x9')](0x1000),'comment':_0x91e3('0xb')},'data3':{'type':Sequelize['STRING'](0x1000),'comment':_0x91e3('0xc')},'data4':{'type':Sequelize[_0x91e3('0x9')](0x1000)},'data5':{'type':Sequelize[_0x91e3('0x9')](0x1000)},'data6':{'type':Sequelize[_0x91e3('0x9')]},'data7':{'type':Sequelize[_0x91e3('0xd')]}};
\ No newline at end of file
diff --git a/server/api/action/action.controller.js b/server/api/action/action.controller.js
index 15e637d..5f5c627 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 _0x2432=['eml-format','zip-dir','fast-json-patch','request-promise','moment','to-csv','ejs','lodash','squel','crypto','jsforce','desk.js','querystring','papaparse','../../components/auth/service','../../config/license/hardware','../../config/logger','api','../../config/utils','sendStatus','status','json','offset','Content-Range','reject','save','update','then','end','error','stack','name','body','Action','find','destroy','params','html-pdf'];(function(_0x415725,_0x198b60){var _0x43d584=function(_0x2906b8){while(--_0x2906b8){_0x415725['push'](_0x415725['shift']());}};_0x43d584(++_0x198b60);}(_0x2432,0x12f));var _0x2243=function(_0x16f8f0,_0x40d02f){_0x16f8f0=_0x16f8f0-0x0;var _0x242b30=_0x2432[_0x16f8f0];return _0x242b30;};'use strict';var pdf=require(_0x2243('0x0'));var emlformat=require(_0x2243('0x1'));var rimraf=require('rimraf');var zipdir=require(_0x2243('0x2'));var jsonpatch=require(_0x2243('0x3'));var rp=require(_0x2243('0x4'));var moment=require(_0x2243('0x5'));var BPromise=require('bluebird');var Mustache=require('mustache');var util=require('util');var path=require('path');var sox=require('sox');var csv=require(_0x2243('0x6'));var ejs=require(_0x2243('0x7'));var fs=require('fs');var _=require(_0x2243('0x8'));var squel=require(_0x2243('0x9'));var crypto=require(_0x2243('0xa'));var jsforce=require(_0x2243('0xb'));var deskjs=require(_0x2243('0xc'));var toCsv=require(_0x2243('0x6'));var querystring=require(_0x2243('0xd'));var Papa=require(_0x2243('0xe'));var Redis=require('ioredis');var authService=require(_0x2243('0xf'));var qs=require('../../components/parsers/qs');var as=require('../../components/parsers/advancedSearch');var hardwareService=require(_0x2243('0x10'));var logger=require(_0x2243('0x11'))(_0x2243('0x12'));var utils=require(_0x2243('0x13'));var config=require('../../config/environment');var db=require('../../mysqldb')['db'];function respondWithStatusCode(_0x32eaa8,_0x101967){_0x101967=_0x101967||0xcc;return function(_0x5ca33f){if(_0x5ca33f){return _0x32eaa8[_0x2243('0x14')](_0x101967);}return _0x32eaa8[_0x2243('0x15')](_0x101967)['end']();};}function respondWithResult(_0x25e2fb,_0x4afff6){_0x4afff6=_0x4afff6||0xc8;return function(_0x1f6c6d){if(_0x1f6c6d){return _0x25e2fb[_0x2243('0x15')](_0x4afff6)[_0x2243('0x16')](_0x1f6c6d);}};}function respondWithFilteredResult(_0x547c60,_0x241d5f){return function(_0x1ff049){if(_0x1ff049){var _0x5a8d11=_0x1ff049['count'],_0x23c801=_0x241d5f[_0x2243('0x17')],_0x4316fe=_0x241d5f[_0x2243('0x17')]+_0x241d5f['limit'],_0x125066;if(_0x4316fe>=_0x5a8d11){_0x4316fe=_0x5a8d11;_0x125066=0xc8;}else{_0x125066=0xce;}_0x547c60[_0x2243('0x15')](_0x125066);return _0x547c60['set'](_0x2243('0x18'),_0x23c801+'-'+_0x4316fe+'/'+_0x5a8d11)[_0x2243('0x16')](_0x1ff049);}return null;};}function patchUpdates(_0x2ffbae){return function(_0x1560ce){try{jsonpatch['apply'](_0x1560ce,_0x2ffbae,!![]);}catch(_0x2a7593){return BPromise[_0x2243('0x19')](_0x2a7593);}return _0x1560ce[_0x2243('0x1a')]();};}function saveUpdates(_0x5bb9b2,_0x372e92){return function(_0x8f7539){if(_0x8f7539){return _0x8f7539[_0x2243('0x1b')](_0x5bb9b2)[_0x2243('0x1c')](function(_0x36f8ec){return _0x36f8ec;});}return null;};}function removeEntity(_0x5c25fc,_0x4c1956){return function(_0x5a44e1){if(_0x5a44e1){return _0x5a44e1['destroy']()['then'](function(){_0x5c25fc[_0x2243('0x15')](0xcc)[_0x2243('0x1d')]();});}};}function handleEntityNotFound(_0xcc6b02,_0x418f40){return function(_0x29048a){if(!_0x29048a){_0xcc6b02[_0x2243('0x14')](0x194);}return _0x29048a;};}function handleError(_0x3c4054,_0x1a8282){_0x1a8282=_0x1a8282||0x1f4;return function(_0x5e89a7){logger[_0x2243('0x1e')](_0x5e89a7[_0x2243('0x1f')]);if(_0x5e89a7[_0x2243('0x20')]){delete _0x5e89a7['name'];}_0x3c4054[_0x2243('0x15')](_0x1a8282)['send'](_0x5e89a7);};}exports['update']=function(_0x1a052e,_0x369e61){if(_0x1a052e['body']['id']){delete _0x1a052e[_0x2243('0x21')]['id'];}return db[_0x2243('0x22')][_0x2243('0x23')]({'where':{'id':_0x1a052e['params']['id']}})['then'](handleEntityNotFound(_0x369e61,null))['then'](saveUpdates(_0x1a052e[_0x2243('0x21')],null))[_0x2243('0x1c')](respondWithResult(_0x369e61,null))['catch'](handleError(_0x369e61,null));};exports[_0x2243('0x24')]=function(_0x39fb88,_0x218911){return db[_0x2243('0x22')][_0x2243('0x23')]({'where':{'id':_0x39fb88[_0x2243('0x25')]['id']}})[_0x2243('0x1c')](handleEntityNotFound(_0x218911,null))['then'](removeEntity(_0x218911,null))['catch'](handleError(_0x218911,null));};
\ No newline at end of file
+var _0x1424=['end','json','count','offset','set','Content-Range','apply','save','update','then','destroy','error','stack','name','send','Action','find','params','catch','eml-format','rimraf','zip-dir','fast-json-patch','bluebird','mustache','path','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','../../mysqldb','sendStatus','status'];(function(_0x939b34,_0x52dd91){var _0x2a62fd=function(_0x2ae6fb){while(--_0x2ae6fb){_0x939b34['push'](_0x939b34['shift']());}};_0x2a62fd(++_0x52dd91);}(_0x1424,0xf4));var _0x4142=function(_0x561a34,_0x3c02c6){_0x561a34=_0x561a34-0x0;var _0x29bd3f=_0x1424[_0x561a34];return _0x29bd3f;};'use strict';var pdf=require('html-pdf');var emlformat=require(_0x4142('0x0'));var rimraf=require(_0x4142('0x1'));var zipdir=require(_0x4142('0x2'));var jsonpatch=require(_0x4142('0x3'));var rp=require('request-promise');var moment=require('moment');var BPromise=require(_0x4142('0x4'));var Mustache=require(_0x4142('0x5'));var util=require('util');var path=require(_0x4142('0x6'));var sox=require(_0x4142('0x7'));var csv=require(_0x4142('0x8'));var ejs=require(_0x4142('0x9'));var fs=require('fs');var _=require(_0x4142('0xa'));var squel=require(_0x4142('0xb'));var crypto=require(_0x4142('0xc'));var jsforce=require('jsforce');var deskjs=require(_0x4142('0xd'));var toCsv=require(_0x4142('0x8'));var querystring=require(_0x4142('0xe'));var Papa=require(_0x4142('0xf'));var Redis=require(_0x4142('0x10'));var authService=require(_0x4142('0x11'));var qs=require(_0x4142('0x12'));var as=require(_0x4142('0x13'));var hardwareService=require(_0x4142('0x14'));var logger=require(_0x4142('0x15'))(_0x4142('0x16'));var utils=require('../../config/utils');var config=require('../../config/environment');var db=require(_0x4142('0x17'))['db'];function respondWithStatusCode(_0xbc1a23,_0x5d9dc2){_0x5d9dc2=_0x5d9dc2||0xcc;return function(_0x1cccd4){if(_0x1cccd4){return _0xbc1a23[_0x4142('0x18')](_0x5d9dc2);}return _0xbc1a23[_0x4142('0x19')](_0x5d9dc2)[_0x4142('0x1a')]();};}function respondWithResult(_0x5ae5cd,_0x11efd3){_0x11efd3=_0x11efd3||0xc8;return function(_0x3659cd){if(_0x3659cd){return _0x5ae5cd[_0x4142('0x19')](_0x11efd3)[_0x4142('0x1b')](_0x3659cd);}};}function respondWithFilteredResult(_0x4670b8,_0x8417e4){return function(_0xdaddab){if(_0xdaddab){var _0x563174=_0xdaddab[_0x4142('0x1c')],_0x391276=_0x8417e4[_0x4142('0x1d')],_0x128edb=_0x8417e4['offset']+_0x8417e4['limit'],_0x4e3629;if(_0x128edb>=_0x563174){_0x128edb=_0x563174;_0x4e3629=0xc8;}else{_0x4e3629=0xce;}_0x4670b8['status'](_0x4e3629);return _0x4670b8[_0x4142('0x1e')](_0x4142('0x1f'),_0x391276+'-'+_0x128edb+'/'+_0x563174)[_0x4142('0x1b')](_0xdaddab);}return null;};}function patchUpdates(_0xb16b36){return function(_0x48fcd9){try{jsonpatch[_0x4142('0x20')](_0x48fcd9,_0xb16b36,!![]);}catch(_0x50e128){return BPromise['reject'](_0x50e128);}return _0x48fcd9[_0x4142('0x21')]();};}function saveUpdates(_0x3a935f,_0x325ed0){return function(_0x1a08da){if(_0x1a08da){return _0x1a08da[_0x4142('0x22')](_0x3a935f)[_0x4142('0x23')](function(_0x1d6d97){return _0x1d6d97;});}return null;};}function removeEntity(_0x2ef67b,_0x552670){return function(_0x4bd4d0){if(_0x4bd4d0){return _0x4bd4d0[_0x4142('0x24')]()[_0x4142('0x23')](function(){_0x2ef67b[_0x4142('0x19')](0xcc)[_0x4142('0x1a')]();});}};}function handleEntityNotFound(_0x3a7e6d,_0x344e70){return function(_0x1aa020){if(!_0x1aa020){_0x3a7e6d['sendStatus'](0x194);}return _0x1aa020;};}function handleError(_0x54fd86,_0x117c53){_0x117c53=_0x117c53||0x1f4;return function(_0x34619d){logger[_0x4142('0x25')](_0x34619d[_0x4142('0x26')]);if(_0x34619d[_0x4142('0x27')]){delete _0x34619d[_0x4142('0x27')];}_0x54fd86[_0x4142('0x19')](_0x117c53)[_0x4142('0x28')](_0x34619d);};}exports[_0x4142('0x22')]=function(_0xa6b388,_0x2bfdba){if(_0xa6b388['body']['id']){delete _0xa6b388['body']['id'];}return db[_0x4142('0x29')][_0x4142('0x2a')]({'where':{'id':_0xa6b388[_0x4142('0x2b')]['id']}})[_0x4142('0x23')](handleEntityNotFound(_0x2bfdba,null))[_0x4142('0x23')](saveUpdates(_0xa6b388['body'],null))[_0x4142('0x23')](respondWithResult(_0x2bfdba,null))[_0x4142('0x2c')](handleError(_0x2bfdba,null));};exports['destroy']=function(_0x147987,_0x1c6beb){return db[_0x4142('0x29')][_0x4142('0x2a')]({'where':{'id':_0x147987[_0x4142('0x2b')]['id']}})[_0x4142('0x23')](handleEntityNotFound(_0x1c6beb,null))[_0x4142('0x23')](removeEntity(_0x1c6beb,null))[_0x4142('0x2c')](handleError(_0x1c6beb,null));};
\ No newline at end of file
diff --git a/server/api/action/action.model.js b/server/api/action/action.model.js
index dcae958..8778fa6 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 _0x2e8b=['define','Action','tools_actions','util','../../config/logger','moment','request-promise','path','rimraf','./action.attributes','exports'];(function(_0x1aba25,_0x1faed1){var _0x47d997=function(_0x4f9e11){while(--_0x4f9e11){_0x1aba25['push'](_0x1aba25['shift']());}};_0x47d997(++_0x1faed1);}(_0x2e8b,0x1bb));var _0xb2e8=function(_0x2d711e,_0x53a0a3){_0x2d711e=_0x2d711e-0x0;var _0x49e68c=_0x2e8b[_0x2d711e];return _0x49e68c;};'use strict';var _=require('lodash');var util=require(_0xb2e8('0x0'));var logger=require(_0xb2e8('0x1'))('api');var moment=require(_0xb2e8('0x2'));var BPromise=require('bluebird');var rp=require(_0xb2e8('0x3'));var fs=require('fs');var path=require(_0xb2e8('0x4'));var rimraf=require(_0xb2e8('0x5'));var config=require('../../config/environment');var attributes=require(_0xb2e8('0x6'));module[_0xb2e8('0x7')]=function(_0x123fe4,_0x4fe281){return _0x123fe4[_0xb2e8('0x8')](_0xb2e8('0x9'),attributes,{'tableName':_0xb2e8('0xa'),'paranoid':![],'indexes':[],'timestamps':!![]});};
\ No newline at end of file
+var _0x08ca=['moment','bluebird','../../config/environment','./action.attributes','exports','Action','lodash','util','../../config/logger'];(function(_0x48afdb,_0x51bfdd){var _0x2946b8=function(_0x5a0720){while(--_0x5a0720){_0x48afdb['push'](_0x48afdb['shift']());}};_0x2946b8(++_0x51bfdd);}(_0x08ca,0x16e));var _0xa08c=function(_0x21048b,_0x42cc37){_0x21048b=_0x21048b-0x0;var _0x3d9a39=_0x08ca[_0x21048b];return _0x3d9a39;};'use strict';var _=require(_0xa08c('0x0'));var util=require(_0xa08c('0x1'));var logger=require(_0xa08c('0x2'))('api');var moment=require(_0xa08c('0x3'));var BPromise=require(_0xa08c('0x4'));var rp=require('request-promise');var fs=require('fs');var path=require('path');var rimraf=require('rimraf');var config=require(_0xa08c('0x5'));var attributes=require(_0xa08c('0x6'));module[_0xa08c('0x7')]=function(_0x6b4b98,_0x3284f5){return _0x6b4b98['define'](_0xa08c('0x8'),attributes,{'tableName':'tools_actions','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 fe50248..ace7ba9 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 _0xa9e0=['http','info','Action,\x20%s,\x20%s','request\x20sent','debug','Action,\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(_0x434120,_0x1e6d30){var _0x1fb719=function(_0x3d392d){while(--_0x3d392d){_0x434120['push'](_0x434120['shift']());}};_0x1fb719(++_0x1e6d30);}(_0xa9e0,0x123));var _0x0a9e=function(_0x5447fd,_0x52a6b5){_0x5447fd=_0x5447fd-0x0;var _0x15b28a=_0xa9e0[_0x5447fd];return _0x15b28a;};'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 _0xcb91=['stringify','error','code','message','catch','moment','bluebird','randomstring','ioredis','../../config/utils','../../config/logger','../../config/environment','jayson/promise','http','request','info','Action,\x20%s,\x20%s','request\x20sent','debug','Action,\x20%s,\x20%s,\x20%s'];(function(_0x4d06d3,_0x4fbd90){var _0x3bb95b=function(_0x1f9970){while(--_0x1f9970){_0x4d06d3['push'](_0x4d06d3['shift']());}};_0x3bb95b(++_0x4fbd90);}(_0xcb91,0x1a9));var _0x1cb9=function(_0x38ce4c,_0xfdbe8c){_0x38ce4c=_0x38ce4c-0x0;var _0x5d4544=_0xcb91[_0x38ce4c];return _0x5d4544;};'use strict';var _=require('lodash');var util=require('util');var moment=require(_0x1cb9('0x0'));var BPromise=require(_0x1cb9('0x1'));var rs=require(_0x1cb9('0x2'));var fs=require('fs');var Redis=require(_0x1cb9('0x3'));var db=require('../../mysqldb')['db'];var utils=require(_0x1cb9('0x4'));var logger=require(_0x1cb9('0x5'))('rpc');var config=require(_0x1cb9('0x6'));var jayson=require(_0x1cb9('0x7'));var client=jayson['client'][_0x1cb9('0x8')]({'port':0x232a});function respondWithRpcPromise(_0x3f7deb,_0x4ffe20,_0x38737d){return new BPromise(function(_0x12567c,_0x59d1be){return client[_0x1cb9('0x9')](_0x3f7deb,_0x38737d)['then'](function(_0x567139){logger[_0x1cb9('0xa')](_0x1cb9('0xb'),_0x4ffe20,_0x1cb9('0xc'));logger[_0x1cb9('0xd')](_0x1cb9('0xe'),_0x4ffe20,'request\x20sent',JSON[_0x1cb9('0xf')](_0x567139));if(_0x567139[_0x1cb9('0x10')]){if(_0x567139[_0x1cb9('0x10')][_0x1cb9('0x11')]===0x1f4){logger[_0x1cb9('0x10')]('Action,\x20%s,\x20%s',_0x4ffe20,_0x567139['error']['message']);return _0x59d1be(_0x567139[_0x1cb9('0x10')][_0x1cb9('0x12')]);}logger[_0x1cb9('0x10')](_0x1cb9('0xb'),_0x4ffe20,_0x567139['error'][_0x1cb9('0x12')]);return _0x12567c(_0x567139[_0x1cb9('0x10')][_0x1cb9('0x12')]);}else{logger[_0x1cb9('0xa')](_0x1cb9('0xb'),_0x4ffe20,'request\x20sent');_0x12567c(_0x567139['result'][_0x1cb9('0x12')]);}})[_0x1cb9('0x13')](function(_0x3904b7){logger[_0x1cb9('0x10')](_0x1cb9('0xb'),_0x4ffe20,_0x3904b7);_0x59d1be(_0x3904b7);});});}
\ No newline at end of file
diff --git a/server/api/action/index.js b/server/api/action/index.js
index db2518f..d46059a 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 _0x2787=['../../config/environment','./action.controller','put','isAuthenticated','update','delete','destroy','util','connect-timeout','express','Router','../../components/auth/service'];(function(_0x2bbacf,_0x111845){var _0x65ed98=function(_0x386880){while(--_0x386880){_0x2bbacf['push'](_0x2bbacf['shift']());}};_0x65ed98(++_0x111845);}(_0x2787,0xaf));var _0x7278=function(_0x2f5ac5,_0x1ee939){_0x2f5ac5=_0x2f5ac5-0x0;var _0x37c9a8=_0x2787[_0x2f5ac5];return _0x37c9a8;};'use strict';var multer=require('multer');var util=require(_0x7278('0x0'));var path=require('path');var timeout=require(_0x7278('0x1'));var express=require(_0x7278('0x2'));var router=express[_0x7278('0x3')]();var auth=require(_0x7278('0x4'));var interaction=require('../../components/interaction/service');var config=require(_0x7278('0x5'));var controller=require(_0x7278('0x6'));router[_0x7278('0x7')]('/:id',auth[_0x7278('0x8')](),controller[_0x7278('0x9')]);router[_0x7278('0xa')]('/:id',auth[_0x7278('0x8')](),controller[_0x7278('0xb')]);module['exports']=router;
\ No newline at end of file
+var _0x00f1=['../../config/environment','put','/:id','isAuthenticated','update','delete','exports','multer','util','path','connect-timeout','express','Router','../../components/interaction/service'];(function(_0x411978,_0x3d4377){var _0x11c799=function(_0x19713b){while(--_0x19713b){_0x411978['push'](_0x411978['shift']());}};_0x11c799(++_0x3d4377);}(_0x00f1,0xcb));var _0x100f=function(_0x14add3,_0x13ce8d){_0x14add3=_0x14add3-0x0;var _0x4a174f=_0x00f1[_0x14add3];return _0x4a174f;};'use strict';var multer=require(_0x100f('0x0'));var util=require(_0x100f('0x1'));var path=require(_0x100f('0x2'));var timeout=require(_0x100f('0x3'));var express=require(_0x100f('0x4'));var router=express[_0x100f('0x5')]();var auth=require('../../components/auth/service');var interaction=require(_0x100f('0x6'));var config=require(_0x100f('0x7'));var controller=require('./action.controller');router[_0x100f('0x8')](_0x100f('0x9'),auth[_0x100f('0xa')](),controller[_0x100f('0xb')]);router[_0x100f('0xc')]('/:id',auth[_0x100f('0xa')](),controller['destroy']);module[_0x100f('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 98b9e3d..230f2ed 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 _0x43d6=['TEXT','sequelize','exports','STRING'];(function(_0x186591,_0x41385c){var _0x54d42d=function(_0x50e4f9){while(--_0x50e4f9){_0x186591['push'](_0x186591['shift']());}};_0x54d42d(++_0x41385c);}(_0x43d6,0x189));var _0x643d=function(_0x128787,_0x3d7b3a){_0x128787=_0x128787-0x0;var _0x1d6ea5=_0x43d6[_0x128787];return _0x1d6ea5;};'use strict';var Sequelize=require(_0x643d('0x0'));module[_0x643d('0x1')]={'name':{'type':Sequelize[_0x643d('0x2')],'allowNull':![]},'description':{'type':Sequelize[_0x643d('0x2')]},'parent':{'type':Sequelize['STRING']},'table':{'type':Sequelize[_0x643d('0x2')]},'conditions':{'type':Sequelize['TEXT']},'joins':{'type':Sequelize[_0x643d('0x3')]}};
\ No newline at end of file
+var _0xdf8d=['exports','STRING','sequelize'];(function(_0x141ae5,_0x54c911){var _0x163f94=function(_0x10190b){while(--_0x10190b){_0x141ae5['push'](_0x141ae5['shift']());}};_0x163f94(++_0x54c911);}(_0xdf8d,0x83));var _0xddf8=function(_0x3c22e0,_0x1dc6ea){_0x3c22e0=_0x3c22e0-0x0;var _0x215811=_0xdf8d[_0x3c22e0];return _0x215811;};'use strict';var Sequelize=require(_0xddf8('0x0'));module[_0xddf8('0x1')]={'name':{'type':Sequelize['STRING'],'allowNull':![]},'description':{'type':Sequelize['STRING']},'parent':{'type':Sequelize['STRING']},'table':{'type':Sequelize[_0xddf8('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 db3f406..6546790 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 _0x1be5=['ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/logger','api','../../config/utils','../../mysqldb','sendStatus','status','count','offset','limit','Content-Range','json','reject','save','update','destroy','then','get','CustomReports','UserProfileResource','end','error','name','send','map','AnalyticCustomReport','rawAttributes','fieldName','type','key','model','query','keys','filters','intersection','fields','attributes','nolimit','order','sort','where','filter','merge','VIRTUAL','options','includeAll','include','catch','params','length','find','create','body','user','Unable\x20to\x20retrieve\x20the\x20current\x20user','role','Reports','UserProfileSection','userProfileId','preview','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)','HOUR(%s)','UNIX_TIMESTAMP(%s)','includes','IS\x20NULL','IS\x20NOT\x20NULL','IS\x20EMPTY','IS\x20NOT\x20EMPTY','rules','operator','group','field','condition','value','getFields','ValidationErrorItem','Please\x20insert\x20at\x20least\x20one\x20field','select','from','table','MetricId','function','replace','format','orderBy','alias','joins','foreignKey','foreignTable','parentKey','conditions','parse','clone','debug','Limited\x20Query:','toString','sequelize','QueryTypes','SELECT','join','right_join','COUNT(DISTINCT\x20%s)','DATE(%s)','ROUND(%s)','AnalyticMetric','findAll','keyBy','metric','groupBy','%s.%s\x20=\x20%s.%s','No\x20available\x20data','web','fullPath','randomstring','generate','output','csv','custom','AnalyticExtractedReport','endDate','startDate','info','child_process','fork','../../components/export/','../../files/reports','savename','COUNT(*)','run','runReport','left_join','Sequelize','DESC','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','bluebird','mustache','util','sox','ejs','lodash','crypto','jsforce','papaparse'];(function(_0x464251,_0x41951f){var _0x47b041=function(_0x425376){while(--_0x425376){_0x464251['push'](_0x464251['shift']());}};_0x47b041(++_0x41951f);}(_0x1be5,0x91));var _0x51be=function(_0x1b8071,_0x2785b5){_0x1b8071=_0x1b8071-0x0;var _0xfab0da=_0x1be5[_0x1b8071];return _0xfab0da;};'use strict';var pdf=require('html-pdf');var emlformat=require(_0x51be('0x0'));var rimraf=require(_0x51be('0x1'));var zipdir=require(_0x51be('0x2'));var jsonpatch=require(_0x51be('0x3'));var rp=require(_0x51be('0x4'));var moment=require('moment');var BPromise=require(_0x51be('0x5'));var Mustache=require(_0x51be('0x6'));var util=require(_0x51be('0x7'));var path=require('path');var sox=require(_0x51be('0x8'));var csv=require('to-csv');var ejs=require(_0x51be('0x9'));var fs=require('fs');var _=require(_0x51be('0xa'));var squel=require('squel');var crypto=require(_0x51be('0xb'));var jsforce=require(_0x51be('0xc'));var deskjs=require('desk.js');var toCsv=require('to-csv');var querystring=require('querystring');var Papa=require(_0x51be('0xd'));var Redis=require(_0x51be('0xe'));var authService=require(_0x51be('0xf'));var qs=require(_0x51be('0x10'));var as=require(_0x51be('0x11'));var hardwareService=require('../../config/license/hardware');var logger=require(_0x51be('0x12'))(_0x51be('0x13'));var utils=require(_0x51be('0x14'));var config=require('../../config/environment');var db=require(_0x51be('0x15'))['db'];function respondWithStatusCode(_0x1a7a2c,_0x323273){_0x323273=_0x323273||0xcc;return function(_0x54260c){if(_0x54260c){return _0x1a7a2c[_0x51be('0x16')](_0x323273);}return _0x1a7a2c[_0x51be('0x17')](_0x323273)['end']();};}function respondWithResult(_0x3ca4ab,_0x40b876){_0x40b876=_0x40b876||0xc8;return function(_0x1d3946){if(_0x1d3946){return _0x3ca4ab[_0x51be('0x17')](_0x40b876)['json'](_0x1d3946);}};}function respondWithFilteredResult(_0x5113d8,_0x2db114){return function(_0x21d6b0){if(_0x21d6b0){var _0x573fc5=_0x21d6b0[_0x51be('0x18')],_0xe5debf=_0x2db114[_0x51be('0x19')],_0xba81d2=_0x2db114[_0x51be('0x19')]+_0x2db114[_0x51be('0x1a')],_0x3b7113;if(_0xba81d2>=_0x573fc5){_0xba81d2=_0x573fc5;_0x3b7113=0xc8;}else{_0x3b7113=0xce;}_0x5113d8[_0x51be('0x17')](_0x3b7113);return _0x5113d8['set'](_0x51be('0x1b'),_0xe5debf+'-'+_0xba81d2+'/'+_0x573fc5)[_0x51be('0x1c')](_0x21d6b0);}return null;};}function patchUpdates(_0x1330d3){return function(_0x567da2){try{jsonpatch['apply'](_0x567da2,_0x1330d3,!![]);}catch(_0x1cbb9c){return BPromise[_0x51be('0x1d')](_0x1cbb9c);}return _0x567da2[_0x51be('0x1e')]();};}function saveUpdates(_0x47acf6,_0x15fdc4){return function(_0x1606fc){if(_0x1606fc){return _0x1606fc[_0x51be('0x1f')](_0x47acf6)['then'](function(_0x22b5f9){return _0x22b5f9;});}return null;};}function removeEntity(_0x391559,_0x848039){return function(_0x48f5e2){if(_0x48f5e2){return _0x48f5e2[_0x51be('0x20')]()[_0x51be('0x21')](function(){var _0x23af17=_0x48f5e2[_0x51be('0x22')]({'plain':!![]});var _0x11a069=_0x51be('0x23');return db[_0x51be('0x24')][_0x51be('0x20')]({'where':{'type':_0x11a069,'resourceId':_0x23af17['id']}})[_0x51be('0x21')](function(){return _0x48f5e2;});})[_0x51be('0x21')](function(){_0x391559[_0x51be('0x17')](0xcc)[_0x51be('0x25')]();});}};}function handleEntityNotFound(_0x48f464,_0x3d993e){return function(_0x1a4987){if(!_0x1a4987){_0x48f464[_0x51be('0x16')](0x194);}return _0x1a4987;};}function handleError(_0x1589d6,_0x54725d){_0x54725d=_0x54725d||0x1f4;return function(_0x510aa4){logger[_0x51be('0x26')](_0x510aa4['stack']);if(_0x510aa4[_0x51be('0x27')]){delete _0x510aa4[_0x51be('0x27')];}_0x1589d6[_0x51be('0x17')](_0x54725d)[_0x51be('0x28')](_0x510aa4);};}exports['index']=function(_0x442986,_0x6891d3){var _0x32cc15={},_0x3493c1={},_0x34f324={'count':0x0,'rows':[]};var _0x19548c=_[_0x51be('0x29')](db[_0x51be('0x2a')][_0x51be('0x2b')],function(_0x4e8f45){return{'name':_0x4e8f45[_0x51be('0x2c')],'type':_0x4e8f45[_0x51be('0x2d')][_0x51be('0x2e')]};});_0x3493c1[_0x51be('0x2f')]=_[_0x51be('0x29')](_0x19548c,_0x51be('0x27'));_0x3493c1[_0x51be('0x30')]=_[_0x51be('0x31')](_0x442986[_0x51be('0x30')]);_0x3493c1[_0x51be('0x32')]=_[_0x51be('0x33')](_0x3493c1[_0x51be('0x2f')],_0x3493c1['query']);_0x32cc15['attributes']=_[_0x51be('0x33')](_0x3493c1['model'],qs[_0x51be('0x34')](_0x442986[_0x51be('0x30')][_0x51be('0x34')]));_0x32cc15['attributes']=_0x32cc15[_0x51be('0x35')]['length']?_0x32cc15[_0x51be('0x35')]:_0x3493c1['model'];if(!_0x442986[_0x51be('0x30')]['hasOwnProperty'](_0x51be('0x36'))){_0x32cc15[_0x51be('0x1a')]=qs['limit'](_0x442986[_0x51be('0x30')][_0x51be('0x1a')]);_0x32cc15['offset']=qs[_0x51be('0x19')](_0x442986[_0x51be('0x30')]['offset']);}_0x32cc15[_0x51be('0x37')]=qs[_0x51be('0x38')](_0x442986[_0x51be('0x30')]['sort']);_0x32cc15[_0x51be('0x39')]=qs[_0x51be('0x32')](_['pick'](_0x442986[_0x51be('0x30')],_0x3493c1[_0x51be('0x32')]));if(_0x442986[_0x51be('0x30')][_0x51be('0x3a')]){_0x32cc15[_0x51be('0x39')]=_[_0x51be('0x3b')](_0x32cc15['where'],{'$or':_[_0x51be('0x29')](_0x19548c,function(_0x575ebd){if(_0x575ebd['type']!==_0x51be('0x3c')){var _0x20ae34={};_0x20ae34[_0x575ebd[_0x51be('0x27')]]={'$like':'%'+_0x442986['query'][_0x51be('0x3a')]+'%'};return _0x20ae34;}})});}_0x32cc15=_[_0x51be('0x3b')]({},_0x32cc15,_0x442986[_0x51be('0x3d')]);var _0x409a1b={'where':_0x32cc15[_0x51be('0x39')]};return db[_0x51be('0x2a')]['count'](_0x409a1b)[_0x51be('0x21')](function(_0x47a240){_0x34f324[_0x51be('0x18')]=_0x47a240;if(_0x442986[_0x51be('0x30')][_0x51be('0x3e')]){_0x32cc15[_0x51be('0x3f')]=[{'all':!![]}];}return db[_0x51be('0x2a')]['findAll'](_0x32cc15);})['then'](function(_0x47687d){_0x34f324['rows']=_0x47687d;return _0x34f324;})[_0x51be('0x21')](respondWithFilteredResult(_0x6891d3,_0x32cc15))[_0x51be('0x40')](handleError(_0x6891d3,null));};exports['show']=function(_0x376ddb,_0x51dacc){var _0x5dae46={'raw':![],'where':{'id':_0x376ddb[_0x51be('0x41')]['id']}},_0x1b6d2a={};_0x1b6d2a[_0x51be('0x2f')]=_[_0x51be('0x31')](db[_0x51be('0x2a')][_0x51be('0x2b')]);_0x1b6d2a[_0x51be('0x30')]=_['keys'](_0x376ddb[_0x51be('0x30')]);_0x1b6d2a[_0x51be('0x32')]=_[_0x51be('0x33')](_0x1b6d2a['model'],_0x1b6d2a[_0x51be('0x30')]);_0x5dae46[_0x51be('0x35')]=_[_0x51be('0x33')](_0x1b6d2a['model'],qs[_0x51be('0x34')](_0x376ddb[_0x51be('0x30')]['fields']));_0x5dae46[_0x51be('0x35')]=_0x5dae46[_0x51be('0x35')][_0x51be('0x42')]?_0x5dae46[_0x51be('0x35')]:_0x1b6d2a['model'];if(_0x376ddb[_0x51be('0x30')][_0x51be('0x3e')]){_0x5dae46[_0x51be('0x3f')]=[{'all':!![]}];}_0x5dae46=_[_0x51be('0x3b')]({},_0x5dae46,_0x376ddb['options']);return db[_0x51be('0x2a')][_0x51be('0x43')](_0x5dae46)[_0x51be('0x21')](handleEntityNotFound(_0x51dacc,null))[_0x51be('0x21')](respondWithResult(_0x51dacc,null))[_0x51be('0x40')](handleError(_0x51dacc,null));};exports[_0x51be('0x44')]=function(_0x2bb5dd,_0x355a43){return db['AnalyticCustomReport']['create'](_0x2bb5dd[_0x51be('0x45')],{})[_0x51be('0x21')](function(_0x247073){var _0xbfb3ac=_0x2bb5dd[_0x51be('0x46')]['get']({'plain':!![]});if(!_0xbfb3ac)throw new Error(_0x51be('0x47'));if(_0xbfb3ac[_0x51be('0x48')]===_0x51be('0x46')){var _0x23ad0d=_0x247073[_0x51be('0x22')]({'plain':!![]});var _0x551fe7=_0x51be('0x49');return db[_0x51be('0x4a')][_0x51be('0x43')]({'where':{'name':_0x551fe7,'userProfileId':_0xbfb3ac[_0x51be('0x4b')]},'raw':!![]})[_0x51be('0x21')](function(_0x43d4e1){if(_0x43d4e1&&_0x43d4e1['autoAssociation']===0x0){return db[_0x51be('0x24')]['create']({'name':_0x23ad0d[_0x51be('0x27')],'resourceId':_0x23ad0d['id'],'type':_0x51be('0x23'),'sectionId':_0x43d4e1['id']},{})[_0x51be('0x21')](function(){return _0x247073;});}else{return _0x247073;}})[_0x51be('0x40')](function(_0x59af0e){logger[_0x51be('0x26')]('Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s',_0x59af0e);throw _0x59af0e;});}return _0x247073;})[_0x51be('0x21')](respondWithResult(_0x355a43,0xc9))['catch'](handleError(_0x355a43,null));};exports['update']=function(_0x168975,_0x49bd51){if(_0x168975[_0x51be('0x45')]['id']){delete _0x168975[_0x51be('0x45')]['id'];}return db['AnalyticCustomReport'][_0x51be('0x43')]({'where':{'id':_0x168975[_0x51be('0x41')]['id']}})['then'](handleEntityNotFound(_0x49bd51,null))[_0x51be('0x21')](saveUpdates(_0x168975[_0x51be('0x45')],null))['then'](respondWithResult(_0x49bd51,null))['catch'](handleError(_0x49bd51,null));};exports[_0x51be('0x20')]=function(_0x277a8d,_0xb0dd62){return db['AnalyticCustomReport'][_0x51be('0x43')]({'where':{'id':_0x277a8d[_0x51be('0x41')]['id']}})[_0x51be('0x21')](handleEntityNotFound(_0xb0dd62,null))[_0x51be('0x21')](removeEntity(_0xb0dd62,null))[_0x51be('0x40')](handleError(_0xb0dd62,null));};exports[_0x51be('0x4c')]=function(_0x2424bd,_0x4de390){var _0x59d102=0xa;var _0x38f296=['join','left_join','right_join',_0x51be('0x4d')];var _0x5a8678={'SUM':_0x51be('0x4e'),'COUNT':_0x51be('0x4f'),'COUNT DISTINCT':'COUNT(DISTINCT\x20%s)','MAX':_0x51be('0x50'),'MIN':_0x51be('0x51'),'AVG':_0x51be('0x52'),'GROUP_CONCAT':_0x51be('0x53'),'GROUP_CONCAT ASC':_0x51be('0x54'),'GROUP_CONCAT DESC':_0x51be('0x55')};var _0x4e4f70={'SEC_TO_TIME':_0x51be('0x56'),'DATE':'DATE(%s)','HOUR':_0x51be('0x57'),'ROUND':'ROUND(%s)','UNIX_TIMESTAMP':_0x51be('0x58')};var _0x1fcad6=function(_0x3a3fe8){return!_[_0x51be('0x59')]([_0x51be('0x5a'),_0x51be('0x5b'),_0x51be('0x5c'),_0x51be('0x5d')],_0x3a3fe8);};var _0x21758d=function(_0x467615){if(!_0x467615||!_0x467615[_0x51be('0x5e')]['length']){return'';}for(var _0x5c804a='(',_0x123898=0x0;_0x123898<_0x467615['rules']['length'];_0x123898+=0x1){_0x123898>0x0&&(_0x5c804a+='\x20'+_0x467615[_0x51be('0x5f')]+'\x20');_0x5c804a+=_0x467615[_0x51be('0x5e')][_0x123898][_0x51be('0x60')]?_0x21758d(_0x467615[_0x51be('0x5e')][_0x123898]['group']):_0x467615[_0x51be('0x5e')][_0x123898][_0x51be('0x61')]+'\x20'+_0x467615[_0x51be('0x5e')][_0x123898]['condition']+(_0x1fcad6(_0x467615[_0x51be('0x5e')][_0x123898][_0x51be('0x62')])?'\x20'+_0x467615['rules'][_0x123898][_0x51be('0x63')]:'');}return _0x5c804a+')';};var _0x2a413b={'where':{'id':_0x2424bd[_0x51be('0x41')]['id']}},_0x5b7a1b,_0x1cf89e,_0x405fa0,_0x52bd48,_0x278074;_0x2a413b=_['merge']({},_0x2a413b,_0x2424bd['options']);return db[_0x51be('0x2a')][_0x51be('0x43')](_0x2a413b)[_0x51be('0x21')](function(_0x52d949){if(_0x52d949){_0x5b7a1b=_0x52d949;return _0x52d949[_0x51be('0x64')]();}return null;})['then'](function(_0x1d278f){if(_0x1d278f){if(!_0x1d278f[_0x51be('0x42')]){throw new db['Sequelize'][(_0x51be('0x65'))](_0x51be('0x66'),0x193);}_0x1cf89e=_0x1d278f;return db['AnalyticMetric']['findAll']({'raw':!![]});}return null;})[_0x51be('0x21')](function(_0x33e985){if(_0x33e985){_0x405fa0=_['keyBy'](_0x33e985,'id');var _0x27c4d7;var _0x7e3357=squel[_0x51be('0x67')]();_0x7e3357[_0x51be('0x68')](_0x5b7a1b[_0x51be('0x69')]);for(var _0x358b02=0x0;_0x358b02<_0x1cf89e[_0x51be('0x42')];_0x358b02+=0x1){_0x27c4d7=_0x1cf89e[_0x358b02][_0x51be('0x6a')]?_0x405fa0[_0x1cf89e[_0x358b02][_0x51be('0x6a')]]['metric']:_0x1cf89e[_0x358b02]['field'];_0x27c4d7=_0x1cf89e[_0x358b02][_0x51be('0x6b')]?_[_0x51be('0x6c')](_0x5a8678[_0x1cf89e[_0x358b02]['function']],'%s',_0x27c4d7):_0x27c4d7;_0x27c4d7=_0x1cf89e[_0x358b02]['format']?_[_0x51be('0x6c')](_0x4e4f70[_0x1cf89e[_0x358b02][_0x51be('0x6d')]],'%s',_0x27c4d7):_0x27c4d7;if(_0x1cf89e[_0x358b02]['groupBy']){_0x7e3357[_0x51be('0x60')](_0x27c4d7);}_0x1cf89e[_0x358b02][_0x51be('0x6e')]&&_0x7e3357['order'](_0x27c4d7,_0x1cf89e[_0x358b02][_0x51be('0x6e')]==='DESC'?![]:!![]);_0x7e3357['field'](_0x27c4d7,_0x1cf89e[_0x358b02][_0x51be('0x6f')]||_0x27c4d7);}if(_0x5b7a1b[_0x51be('0x70')]){_0x5b7a1b[_0x51be('0x70')]=JSON['parse'](_0x5b7a1b['joins']);for(var _0x123a40=0x0;_0x123a40<_0x5b7a1b[_0x51be('0x70')][_0x51be('0x42')];_0x123a40+=0x1){if(_0x5b7a1b[_0x51be('0x70')][_0x123a40][_0x51be('0x2d')]&&_[_0x51be('0x59')](_0x38f296,_0x5b7a1b[_0x51be('0x70')][_0x123a40][_0x51be('0x2d')])&&_0x5b7a1b[_0x51be('0x70')][_0x123a40]['parentKey']&&_0x5b7a1b[_0x51be('0x70')][_0x123a40]['foreignTable']&&_0x5b7a1b['joins'][_0x123a40][_0x51be('0x71')]){_0x7e3357[_0x5b7a1b['joins'][_0x123a40][_0x51be('0x2d')]](_0x5b7a1b[_0x51be('0x70')][_0x123a40][_0x51be('0x72')],null,util['format']('%s.%s\x20=\x20%s.%s',_0x5b7a1b['table'],_0x5b7a1b['joins'][_0x123a40][_0x51be('0x73')],_0x5b7a1b[_0x51be('0x70')][_0x123a40][_0x51be('0x72')],_0x5b7a1b['joins'][_0x123a40][_0x51be('0x71')]));}}}if(_0x5b7a1b[_0x51be('0x74')]){_0x5b7a1b[_0x51be('0x74')]=JSON[_0x51be('0x75')](_0x5b7a1b[_0x51be('0x74')]);_0x7e3357['where'](_0x21758d(_0x5b7a1b[_0x51be('0x74')][_0x51be('0x60')]));}_0x278074=_0x7e3357[_0x51be('0x76')]();_0x7e3357[_0x51be('0x1a')](_0x59d102);_0x7e3357[_0x51be('0x19')](0x0);logger[_0x51be('0x77')](_0x51be('0x78'),_0x7e3357[_0x51be('0x79')]());return db[_0x51be('0x7a')]['query'](_0x7e3357['toString'](),{'type':db[_0x51be('0x7a')][_0x51be('0x7b')][_0x51be('0x7c')]});}})[_0x51be('0x21')](respondWithResult(_0x4de390,null))[_0x51be('0x40')](handleError(_0x4de390,null));};function runReport(_0x13bfb0,_0x12534d,_0x1bae6d){var _0x11d04b=_0x12534d[_0x51be('0x27')];var _0x20203a=0xa;var _0x2ace89=[_0x51be('0x7d'),'left_join',_0x51be('0x7e'),_0x51be('0x4d')];var _0x5b27dc={'SUM':'SUM(%s)','COUNT':_0x51be('0x4f'),'COUNT DISTINCT':_0x51be('0x7f'),'MAX':'MAX(%s)','MIN':_0x51be('0x51'),'AVG':'AVG(%s)','GROUP_CONCAT':_0x51be('0x53'),'GROUP_CONCAT ASC':_0x51be('0x54'),'GROUP_CONCAT DESC':'GROUP_CONCAT(%s\x20ORDER\x20BY\x20%s\x20DESC)'};var _0x1a401f={'SEC_TO_TIME':'SEC_TO_TIME(%s)','DATE':_0x51be('0x80'),'HOUR':_0x51be('0x57'),'ROUND':_0x51be('0x81'),'UNIX_TIMESTAMP':'UNIX_TIMESTAMP(%s)'};var _0x2c80e2=function(_0x297da9){return!_[_0x51be('0x59')]([_0x51be('0x5a'),_0x51be('0x5b'),_0x51be('0x5c'),_0x51be('0x5d')],_0x297da9);};var _0x3869d1=function(_0x299533){if(!_0x299533||!_0x299533[_0x51be('0x5e')][_0x51be('0x42')]){return'';}for(var _0x351aaa='(',_0x3335e0=0x0;_0x3335e0<_0x299533['rules'][_0x51be('0x42')];_0x3335e0+=0x1){_0x3335e0>0x0&&(_0x351aaa+='\x20'+_0x299533[_0x51be('0x5f')]+'\x20');_0x351aaa+=_0x299533[_0x51be('0x5e')][_0x3335e0]['group']?_0x3869d1(_0x299533[_0x51be('0x5e')][_0x3335e0][_0x51be('0x60')]):_0x299533[_0x51be('0x5e')][_0x3335e0]['field']+'\x20'+_0x299533['rules'][_0x3335e0]['condition']+(_0x2c80e2(_0x299533[_0x51be('0x5e')][_0x3335e0][_0x51be('0x62')])?'\x20'+_0x299533[_0x51be('0x5e')][_0x3335e0][_0x51be('0x63')]:'');}return _0x351aaa+')';};var _0xf47228={'where':{'id':_0x13bfb0['id']}},_0x2fd0f5,_0x407e83,_0x19b7a9,_0x4ddda9,_0x4fae8d;_0xf47228=_[_0x51be('0x3b')]({},_0xf47228,_0x1bae6d);return db['AnalyticCustomReport']['find'](_0xf47228)[_0x51be('0x21')](function(_0x266ab7){if(_0x266ab7){_0x2fd0f5=_0x266ab7;return _0x266ab7[_0x51be('0x64')]();}return null;})['then'](function(_0x20a526){if(_0x20a526){if(!_0x20a526[_0x51be('0x42')]){throw new db['Sequelize'][(_0x51be('0x65'))](_0x51be('0x66'),0x193);}_0x407e83=_0x20a526;return db[_0x51be('0x82')][_0x51be('0x83')]({'raw':!![]});}return null;})[_0x51be('0x21')](function(_0x2a060e){if(_0x2a060e){_0x19b7a9=_[_0x51be('0x84')](_0x2a060e,'id');var _0x3cf883;var _0x337342=squel[_0x51be('0x67')]();_0x337342[_0x51be('0x68')](_0x2fd0f5[_0x51be('0x69')]);for(var _0x4bf69e=0x0;_0x4bf69e<_0x407e83[_0x51be('0x42')];_0x4bf69e+=0x1){_0x3cf883=_0x407e83[_0x4bf69e][_0x51be('0x6a')]?_0x19b7a9[_0x407e83[_0x4bf69e][_0x51be('0x6a')]][_0x51be('0x85')]:_0x407e83[_0x4bf69e][_0x51be('0x61')];_0x3cf883=_0x407e83[_0x4bf69e][_0x51be('0x6b')]?_['replace'](_0x5b27dc[_0x407e83[_0x4bf69e][_0x51be('0x6b')]],'%s',_0x3cf883):_0x3cf883;_0x3cf883=_0x407e83[_0x4bf69e][_0x51be('0x6d')]?_['replace'](_0x1a401f[_0x407e83[_0x4bf69e][_0x51be('0x6d')]],'%s',_0x3cf883):_0x3cf883;if(_0x407e83[_0x4bf69e][_0x51be('0x86')]){_0x337342[_0x51be('0x60')](_0x3cf883);}_0x407e83[_0x4bf69e][_0x51be('0x6e')]&&_0x337342[_0x51be('0x37')](_0x3cf883,_0x407e83[_0x4bf69e][_0x51be('0x6e')]==='DESC'?![]:!![]);_0x337342['field'](_0x3cf883,_0x407e83[_0x4bf69e]['alias']||_0x3cf883);}if(_0x2fd0f5[_0x51be('0x70')]){_0x2fd0f5[_0x51be('0x70')]=JSON['parse'](_0x2fd0f5[_0x51be('0x70')]);for(var _0x27cc96=0x0;_0x27cc96<_0x2fd0f5[_0x51be('0x70')][_0x51be('0x42')];_0x27cc96+=0x1){if(_0x2fd0f5[_0x51be('0x70')][_0x27cc96][_0x51be('0x2d')]&&_[_0x51be('0x59')](_0x2ace89,_0x2fd0f5[_0x51be('0x70')][_0x27cc96][_0x51be('0x2d')])&&_0x2fd0f5['joins'][_0x27cc96]['parentKey']&&_0x2fd0f5[_0x51be('0x70')][_0x27cc96][_0x51be('0x72')]&&_0x2fd0f5[_0x51be('0x70')][_0x27cc96][_0x51be('0x71')]){_0x337342[_0x2fd0f5[_0x51be('0x70')][_0x27cc96][_0x51be('0x2d')]](_0x2fd0f5['joins'][_0x27cc96][_0x51be('0x72')],null,util[_0x51be('0x6d')](_0x51be('0x87'),_0x2fd0f5[_0x51be('0x69')],_0x2fd0f5[_0x51be('0x70')][_0x27cc96][_0x51be('0x73')],_0x2fd0f5[_0x51be('0x70')][_0x27cc96][_0x51be('0x72')],_0x2fd0f5[_0x51be('0x70')][_0x27cc96][_0x51be('0x71')]));}}}if(_0x2fd0f5['conditions']){_0x2fd0f5['conditions']=JSON['parse'](_0x2fd0f5['conditions']);_0x337342[_0x51be('0x39')](_0x3869d1(_0x2fd0f5[_0x51be('0x74')]['group']));}_0x4fae8d=_0x337342[_0x51be('0x76')]();_0x337342['limit'](_0x20203a);_0x337342['offset'](0x0);logger[_0x51be('0x77')]('Limited\x20Query:',_0x337342[_0x51be('0x79')]());return db['sequelize']['query'](_0x337342[_0x51be('0x79')](),{'type':db[_0x51be('0x7a')][_0x51be('0x7b')]['SELECT']});}})[_0x51be('0x21')](function(_0xe897c8){if(!_0xe897c8[_0x51be('0x42')]){throw new db['Sequelize'][(_0x51be('0x65'))](_0x51be('0x88'),0xcc);}if(_0x12534d['output']===_0x51be('0x89')){return null;}var _0x421d62=_['merge'](_0x12534d,{'name':_0x12534d[_0x51be('0x8a')]||_0x12534d[_0x51be('0x27')]||_0x2fd0f5['name'],'basename':_0x11d04b,'savename':util[_0x51be('0x6d')]('%s-%s.%s',_0x12534d[_0x51be('0x27')]||_0x2fd0f5['name'],require(_0x51be('0x8b'))[_0x51be('0x8c')](0x4),_0x12534d[_0x51be('0x8d')]||_0x51be('0x8e')),'reportId':_0x2fd0f5['id'],'reportType':_0x51be('0x8f')});return db[_0x51be('0x90')][_0x51be('0x44')](_0x421d62,{'raw':!![]});})[_0x51be('0x21')](function(_0x2e1cee){if(_0x2fd0f5['table']==='cdr'){_0x4fae8d[_0x51be('0x39')](_0x2fd0f5['table']+'.calldate\x20BETWEEN\x20?\x20AND\x20?',_0x12534d['startDate'],_0x12534d[_0x51be('0x91')]);}else{_0x4fae8d[_0x51be('0x39')](_0x2fd0f5[_0x51be('0x69')]+'.createdAt\x20BETWEEN\x20?\x20AND\x20?',_0x12534d[_0x51be('0x92')],_0x12534d[_0x51be('0x91')]);}if(_0x2e1cee){logger[_0x51be('0x93')]('Run\x20Query:',_0x4fae8d['toString']());require(_0x51be('0x94'))[_0x51be('0x95')](path[_0x51be('0x7d')](__dirname,_0x51be('0x96'),_0x2e1cee[_0x51be('0x8d')]),[_0x2e1cee['id'],_0x4fae8d[_0x51be('0x79')](),path[_0x51be('0x7d')](__dirname,_0x51be('0x97'),_0x2e1cee[_0x51be('0x98')]),_0x11d04b]);return _0x2e1cee;}else{var _0x46ace3=squel[_0x51be('0x67')]();_0x46ace3['from']('('+_0x4fae8d[_0x51be('0x79')]()+')','countTable');_0x46ace3[_0x51be('0x61')](_0x51be('0x99'),'count');_0x4fae8d[_0x51be('0x1a')](_0x12534d['limit']||_0x20203a);_0x4fae8d[_0x51be('0x19')](_0x12534d['offset']||0x0);return db['sequelize']['query'](_0x46ace3[_0x51be('0x79')](),{'type':db[_0x51be('0x7a')][_0x51be('0x7b')][_0x51be('0x7c')]})[_0x51be('0x21')](function(_0x8e4a8f){if(!_0x8e4a8f['length']){_0x4ddda9=0x0;}else{_0x4ddda9=_0x8e4a8f[0x0][_0x51be('0x18')]||0x0;}return db[_0x51be('0x7a')][_0x51be('0x30')](_0x4fae8d['toString'](),{'type':db[_0x51be('0x7a')][_0x51be('0x7b')]['SELECT']});})[_0x51be('0x21')](function(_0x196a50){return{'rows':_0x196a50||[],'count':_0x4ddda9};});}});}exports[_0x51be('0x9a')]=function(_0x28185b,_0x348755){return runReport(_0x28185b[_0x51be('0x41')],_0x28185b[_0x51be('0x30')],_0x28185b[_0x51be('0x3d')])[_0x51be('0x21')](respondWithResult(_0x348755,null))['catch'](handleError(_0x348755,null));};exports[_0x51be('0x9b')]=runReport;exports[_0x51be('0x30')]=function(_0x21fa8e,_0x1c5020){var _0x5ab3d3=0xa;var _0x2876cc=['join',_0x51be('0x9c'),_0x51be('0x7e'),_0x51be('0x4d')];var _0x16a30e={'SUM':_0x51be('0x4e'),'COUNT':_0x51be('0x4f'),'COUNT DISTINCT':'COUNT(DISTINCT\x20%s)','MAX':_0x51be('0x50'),'MIN':_0x51be('0x51'),'AVG':_0x51be('0x52'),'GROUP_CONCAT':_0x51be('0x53'),'GROUP_CONCAT ASC':_0x51be('0x54'),'GROUP_CONCAT DESC':_0x51be('0x55')};var _0x210be1={'SEC_TO_TIME':'SEC_TO_TIME(%s)','DATE':'DATE(%s)','HOUR':_0x51be('0x57'),'ROUND':_0x51be('0x81'),'UNIX_TIMESTAMP':_0x51be('0x58')};var _0x33ccee=function(_0xaa27e4){return!_[_0x51be('0x59')]([_0x51be('0x5a'),_0x51be('0x5b'),_0x51be('0x5c'),_0x51be('0x5d')],_0xaa27e4);};var _0x3cd475=function(_0x574317){if(!_0x574317||!_0x574317[_0x51be('0x5e')]['length']){return'';}for(var _0x577aab='(',_0x10336e=0x0;_0x10336e<_0x574317[_0x51be('0x5e')][_0x51be('0x42')];_0x10336e+=0x1){_0x10336e>0x0&&(_0x577aab+='\x20'+_0x574317['operator']+'\x20');_0x577aab+=_0x574317[_0x51be('0x5e')][_0x10336e][_0x51be('0x60')]?_0x3cd475(_0x574317[_0x51be('0x5e')][_0x10336e][_0x51be('0x60')]):_0x574317[_0x51be('0x5e')][_0x10336e][_0x51be('0x61')]+'\x20'+_0x574317['rules'][_0x10336e][_0x51be('0x62')]+(_0x33ccee(_0x574317[_0x51be('0x5e')][_0x10336e]['condition'])?'\x20'+_0x574317[_0x51be('0x5e')][_0x10336e][_0x51be('0x63')]:'');}return _0x577aab+')';};var _0x5140d1={'where':{'id':_0x21fa8e[_0x51be('0x41')]['id']}},_0x4d0e91,_0x20f499,_0x116a57,_0x521c55,_0x5e9f7f;_0x5140d1=_[_0x51be('0x3b')]({},_0x5140d1,_0x21fa8e[_0x51be('0x3d')]);return db[_0x51be('0x2a')]['find'](_0x5140d1)['then'](function(_0x4fb628){if(_0x4fb628){_0x4d0e91=_0x4fb628;return _0x4fb628[_0x51be('0x64')]();}return null;})[_0x51be('0x21')](function(_0x4cd8be){if(_0x4cd8be){if(!_0x4cd8be[_0x51be('0x42')]){throw new db[(_0x51be('0x9d'))]['ValidationErrorItem'](_0x51be('0x66'),0x193);}_0x20f499=_0x4cd8be;return db['AnalyticMetric']['findAll']({'raw':!![]});}return null;})[_0x51be('0x21')](function(_0x121655){if(_0x121655){_0x116a57=_[_0x51be('0x84')](_0x121655,'id');var _0x18a013;var _0x44d5f1=squel[_0x51be('0x67')]();_0x44d5f1[_0x51be('0x68')](_0x4d0e91[_0x51be('0x69')]);for(var _0x3674a0=0x0;_0x3674a0<_0x20f499[_0x51be('0x42')];_0x3674a0+=0x1){_0x18a013=_0x20f499[_0x3674a0]['MetricId']?_0x116a57[_0x20f499[_0x3674a0]['MetricId']]['metric']:_0x20f499[_0x3674a0][_0x51be('0x61')];_0x18a013=_0x20f499[_0x3674a0]['function']?_[_0x51be('0x6c')](_0x16a30e[_0x20f499[_0x3674a0][_0x51be('0x6b')]],'%s',_0x18a013):_0x18a013;_0x18a013=_0x20f499[_0x3674a0]['format']?_[_0x51be('0x6c')](_0x210be1[_0x20f499[_0x3674a0]['format']],'%s',_0x18a013):_0x18a013;if(_0x20f499[_0x3674a0]['groupBy']){_0x44d5f1[_0x51be('0x60')](_0x18a013);}_0x20f499[_0x3674a0]['orderBy']&&_0x44d5f1['order'](_0x18a013,_0x20f499[_0x3674a0][_0x51be('0x6e')]===_0x51be('0x9e')?![]:!![]);_0x44d5f1[_0x51be('0x61')](_0x18a013,_0x20f499[_0x3674a0][_0x51be('0x6f')]||_0x18a013);}if(_0x4d0e91['joins']){_0x4d0e91[_0x51be('0x70')]=JSON[_0x51be('0x75')](_0x4d0e91[_0x51be('0x70')]);for(var _0x191bd9=0x0;_0x191bd9<_0x4d0e91[_0x51be('0x70')][_0x51be('0x42')];_0x191bd9+=0x1){if(_0x4d0e91[_0x51be('0x70')][_0x191bd9]['type']&&_[_0x51be('0x59')](_0x2876cc,_0x4d0e91[_0x51be('0x70')][_0x191bd9][_0x51be('0x2d')])&&_0x4d0e91[_0x51be('0x70')][_0x191bd9][_0x51be('0x73')]&&_0x4d0e91[_0x51be('0x70')][_0x191bd9][_0x51be('0x72')]&&_0x4d0e91['joins'][_0x191bd9][_0x51be('0x71')]){_0x44d5f1[_0x4d0e91[_0x51be('0x70')][_0x191bd9][_0x51be('0x2d')]](_0x4d0e91['joins'][_0x191bd9][_0x51be('0x72')],null,util['format']('%s.%s\x20=\x20%s.%s',_0x4d0e91[_0x51be('0x69')],_0x4d0e91[_0x51be('0x70')][_0x191bd9][_0x51be('0x73')],_0x4d0e91[_0x51be('0x70')][_0x191bd9]['foreignTable'],_0x4d0e91[_0x51be('0x70')][_0x191bd9]['foreignKey']));}}}if(_0x4d0e91[_0x51be('0x74')]){_0x4d0e91['conditions']=JSON[_0x51be('0x75')](_0x4d0e91['conditions']);_0x44d5f1[_0x51be('0x39')](_0x3cd475(_0x4d0e91[_0x51be('0x74')]['group']));}_0x5e9f7f=_0x44d5f1[_0x51be('0x76')]();_0x44d5f1[_0x51be('0x1a')](_0x5ab3d3);_0x44d5f1[_0x51be('0x19')](0x0);logger[_0x51be('0x77')](_0x51be('0x78'),_0x44d5f1[_0x51be('0x79')]());return db[_0x51be('0x7a')][_0x51be('0x30')](_0x44d5f1[_0x51be('0x79')](),{'type':db[_0x51be('0x7a')][_0x51be('0x7b')][_0x51be('0x7c')]});}})[_0x51be('0x21')](function(){return{'sql':_0x5e9f7f[_0x51be('0x79')]()};})[_0x51be('0x21')](respondWithResult(_0x1c5020,null))[_0x51be('0x40')](handleError(_0x1c5020,null));};
\ No newline at end of file
+var _0xaa48=['csv','custom','AnalyticExtractedReport','cdr','startDate','endDate','info','Run\x20Query:','child_process','../../components/export/','../../files/reports','countTable','COUNT(*)','SELECT','run','runReport','GROUP_CONCAT(%s\x20ORDER\x20BY\x20%s\x20DESC)','IS\x20NULL','html-pdf','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','moment','bluebird','mustache','util','path','sox','to-csv','ejs','lodash','squel','crypto','jsforce','desk.js','querystring','papaparse','../../components/auth/service','../../components/parsers/qs','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/environment','../../mysqldb','sendStatus','status','json','offset','limit','Content-Range','reject','update','then','destroy','UserProfileResource','end','error','name','send','index','map','rawAttributes','fieldName','type','key','model','query','filters','intersection','fields','length','attributes','order','sort','where','pick','filter','options','count','includeAll','include','AnalyticCustomReport','findAll','rows','catch','show','params','keys','merge','find','create','user','get','UserProfileSection','CustomReports','body','preview','cross_join','SUM(%s)','COUNT(DISTINCT\x20%s)','MIN(%s)','AVG(%s)','SEC_TO_TIME(%s)','HOUR(%s)','ROUND(%s)','UNIX_TIMESTAMP(%s)','IS\x20NOT\x20NULL','IS\x20EMPTY','rules','group','field','condition','value','getFields','Sequelize','ValidationErrorItem','Please\x20insert\x20at\x20least\x20one\x20field','AnalyticMetric','keyBy','select','from','MetricId','metric','function','replace','format','orderBy','DESC','alias','joins','parse','includes','parentKey','foreignTable','foreignKey','%s.%s\x20=\x20%s.%s','table','conditions','clone','debug','toString','sequelize','QueryTypes','join','right_join','COUNT(%s)','MAX(%s)','GROUP_CONCAT(%s)','GROUP_CONCAT(%s\x20ORDER\x20BY\x20%s\x20ASC)','DATE(%s)','IS\x20NOT\x20EMPTY','operator','groupBy','Limited\x20Query:','No\x20available\x20data','output','web','fullPath','%s-%s.%s','randomstring','generate'];(function(_0x58adb6,_0x3001d8){var _0x436e13=function(_0x1095dd){while(--_0x1095dd){_0x58adb6['push'](_0x58adb6['shift']());}};_0x436e13(++_0x3001d8);}(_0xaa48,0x15a));var _0x8aa4=function(_0x5b6b18,_0x22464e){_0x5b6b18=_0x5b6b18-0x0;var _0x19d8e1=_0xaa48[_0x5b6b18];return _0x19d8e1;};'use strict';var pdf=require(_0x8aa4('0x0'));var emlformat=require(_0x8aa4('0x1'));var rimraf=require(_0x8aa4('0x2'));var zipdir=require(_0x8aa4('0x3'));var jsonpatch=require(_0x8aa4('0x4'));var rp=require(_0x8aa4('0x5'));var moment=require(_0x8aa4('0x6'));var BPromise=require(_0x8aa4('0x7'));var Mustache=require(_0x8aa4('0x8'));var util=require(_0x8aa4('0x9'));var path=require(_0x8aa4('0xa'));var sox=require(_0x8aa4('0xb'));var csv=require(_0x8aa4('0xc'));var ejs=require(_0x8aa4('0xd'));var fs=require('fs');var _=require(_0x8aa4('0xe'));var squel=require(_0x8aa4('0xf'));var crypto=require(_0x8aa4('0x10'));var jsforce=require(_0x8aa4('0x11'));var deskjs=require(_0x8aa4('0x12'));var toCsv=require('to-csv');var querystring=require(_0x8aa4('0x13'));var Papa=require(_0x8aa4('0x14'));var Redis=require('ioredis');var authService=require(_0x8aa4('0x15'));var qs=require(_0x8aa4('0x16'));var as=require('../../components/parsers/advancedSearch');var hardwareService=require(_0x8aa4('0x17'));var logger=require(_0x8aa4('0x18'))(_0x8aa4('0x19'));var utils=require(_0x8aa4('0x1a'));var config=require(_0x8aa4('0x1b'));var db=require(_0x8aa4('0x1c'))['db'];function respondWithStatusCode(_0x824014,_0x3dc274){_0x3dc274=_0x3dc274||0xcc;return function(_0x1dc057){if(_0x1dc057){return _0x824014[_0x8aa4('0x1d')](_0x3dc274);}return _0x824014['status'](_0x3dc274)['end']();};}function respondWithResult(_0x3143f7,_0x455a80){_0x455a80=_0x455a80||0xc8;return function(_0xb8ce80){if(_0xb8ce80){return _0x3143f7[_0x8aa4('0x1e')](_0x455a80)[_0x8aa4('0x1f')](_0xb8ce80);}};}function respondWithFilteredResult(_0x406f0e,_0x2b3f62){return function(_0x356df1){if(_0x356df1){var _0x1ae822=_0x356df1['count'],_0xce8df5=_0x2b3f62[_0x8aa4('0x20')],_0x5cca31=_0x2b3f62[_0x8aa4('0x20')]+_0x2b3f62[_0x8aa4('0x21')],_0x5abc5a;if(_0x5cca31>=_0x1ae822){_0x5cca31=_0x1ae822;_0x5abc5a=0xc8;}else{_0x5abc5a=0xce;}_0x406f0e[_0x8aa4('0x1e')](_0x5abc5a);return _0x406f0e['set'](_0x8aa4('0x22'),_0xce8df5+'-'+_0x5cca31+'/'+_0x1ae822)[_0x8aa4('0x1f')](_0x356df1);}return null;};}function patchUpdates(_0x59d3a2){return function(_0x3d6353){try{jsonpatch['apply'](_0x3d6353,_0x59d3a2,!![]);}catch(_0x5e8a77){return BPromise[_0x8aa4('0x23')](_0x5e8a77);}return _0x3d6353['save']();};}function saveUpdates(_0x324d59,_0x2df294){return function(_0x521b69){if(_0x521b69){return _0x521b69[_0x8aa4('0x24')](_0x324d59)[_0x8aa4('0x25')](function(_0x4c45c9){return _0x4c45c9;});}return null;};}function removeEntity(_0x1a514e,_0x2859d1){return function(_0x1c8676){if(_0x1c8676){return _0x1c8676[_0x8aa4('0x26')]()[_0x8aa4('0x25')](function(){var _0x4ecaec=_0x1c8676['get']({'plain':!![]});var _0x4c429f='CustomReports';return db[_0x8aa4('0x27')]['destroy']({'where':{'type':_0x4c429f,'resourceId':_0x4ecaec['id']}})[_0x8aa4('0x25')](function(){return _0x1c8676;});})[_0x8aa4('0x25')](function(){_0x1a514e[_0x8aa4('0x1e')](0xcc)[_0x8aa4('0x28')]();});}};}function handleEntityNotFound(_0x5b8165,_0x513cb9){return function(_0x30f7d1){if(!_0x30f7d1){_0x5b8165['sendStatus'](0x194);}return _0x30f7d1;};}function handleError(_0x286601,_0x4145ed){_0x4145ed=_0x4145ed||0x1f4;return function(_0x556f5c){logger[_0x8aa4('0x29')](_0x556f5c['stack']);if(_0x556f5c[_0x8aa4('0x2a')]){delete _0x556f5c['name'];}_0x286601[_0x8aa4('0x1e')](_0x4145ed)[_0x8aa4('0x2b')](_0x556f5c);};}exports[_0x8aa4('0x2c')]=function(_0xf88a0e,_0x169ca3){var _0x4ba8b8={},_0x5d4894={},_0x5f1028={'count':0x0,'rows':[]};var _0x2aec56=_[_0x8aa4('0x2d')](db['AnalyticCustomReport'][_0x8aa4('0x2e')],function(_0x1f452e){return{'name':_0x1f452e[_0x8aa4('0x2f')],'type':_0x1f452e[_0x8aa4('0x30')][_0x8aa4('0x31')]};});_0x5d4894[_0x8aa4('0x32')]=_['map'](_0x2aec56,_0x8aa4('0x2a'));_0x5d4894['query']=_['keys'](_0xf88a0e[_0x8aa4('0x33')]);_0x5d4894[_0x8aa4('0x34')]=_[_0x8aa4('0x35')](_0x5d4894[_0x8aa4('0x32')],_0x5d4894[_0x8aa4('0x33')]);_0x4ba8b8['attributes']=_[_0x8aa4('0x35')](_0x5d4894[_0x8aa4('0x32')],qs[_0x8aa4('0x36')](_0xf88a0e['query']['fields']));_0x4ba8b8['attributes']=_0x4ba8b8['attributes'][_0x8aa4('0x37')]?_0x4ba8b8[_0x8aa4('0x38')]:_0x5d4894[_0x8aa4('0x32')];if(!_0xf88a0e[_0x8aa4('0x33')]['hasOwnProperty']('nolimit')){_0x4ba8b8[_0x8aa4('0x21')]=qs[_0x8aa4('0x21')](_0xf88a0e[_0x8aa4('0x33')][_0x8aa4('0x21')]);_0x4ba8b8[_0x8aa4('0x20')]=qs['offset'](_0xf88a0e['query'][_0x8aa4('0x20')]);}_0x4ba8b8[_0x8aa4('0x39')]=qs[_0x8aa4('0x3a')](_0xf88a0e['query'][_0x8aa4('0x3a')]);_0x4ba8b8[_0x8aa4('0x3b')]=qs['filters'](_[_0x8aa4('0x3c')](_0xf88a0e[_0x8aa4('0x33')],_0x5d4894[_0x8aa4('0x34')]));if(_0xf88a0e['query'][_0x8aa4('0x3d')]){_0x4ba8b8['where']=_['merge'](_0x4ba8b8[_0x8aa4('0x3b')],{'$or':_['map'](_0x2aec56,function(_0x36b960){if(_0x36b960[_0x8aa4('0x30')]!=='VIRTUAL'){var _0x230b7b={};_0x230b7b[_0x36b960[_0x8aa4('0x2a')]]={'$like':'%'+_0xf88a0e[_0x8aa4('0x33')][_0x8aa4('0x3d')]+'%'};return _0x230b7b;}})});}_0x4ba8b8=_['merge']({},_0x4ba8b8,_0xf88a0e[_0x8aa4('0x3e')]);var _0xca05c8={'where':_0x4ba8b8[_0x8aa4('0x3b')]};return db['AnalyticCustomReport'][_0x8aa4('0x3f')](_0xca05c8)[_0x8aa4('0x25')](function(_0x5013a2){_0x5f1028[_0x8aa4('0x3f')]=_0x5013a2;if(_0xf88a0e['query'][_0x8aa4('0x40')]){_0x4ba8b8[_0x8aa4('0x41')]=[{'all':!![]}];}return db[_0x8aa4('0x42')][_0x8aa4('0x43')](_0x4ba8b8);})[_0x8aa4('0x25')](function(_0x424100){_0x5f1028[_0x8aa4('0x44')]=_0x424100;return _0x5f1028;})[_0x8aa4('0x25')](respondWithFilteredResult(_0x169ca3,_0x4ba8b8))[_0x8aa4('0x45')](handleError(_0x169ca3,null));};exports[_0x8aa4('0x46')]=function(_0x87d3e,_0x228e64){var _0x234325={'raw':![],'where':{'id':_0x87d3e[_0x8aa4('0x47')]['id']}},_0x521ebe={};_0x521ebe[_0x8aa4('0x32')]=_[_0x8aa4('0x48')](db[_0x8aa4('0x42')][_0x8aa4('0x2e')]);_0x521ebe[_0x8aa4('0x33')]=_[_0x8aa4('0x48')](_0x87d3e['query']);_0x521ebe[_0x8aa4('0x34')]=_[_0x8aa4('0x35')](_0x521ebe[_0x8aa4('0x32')],_0x521ebe['query']);_0x234325['attributes']=_['intersection'](_0x521ebe[_0x8aa4('0x32')],qs['fields'](_0x87d3e[_0x8aa4('0x33')][_0x8aa4('0x36')]));_0x234325[_0x8aa4('0x38')]=_0x234325[_0x8aa4('0x38')][_0x8aa4('0x37')]?_0x234325[_0x8aa4('0x38')]:_0x521ebe[_0x8aa4('0x32')];if(_0x87d3e['query'][_0x8aa4('0x40')]){_0x234325[_0x8aa4('0x41')]=[{'all':!![]}];}_0x234325=_[_0x8aa4('0x49')]({},_0x234325,_0x87d3e[_0x8aa4('0x3e')]);return db[_0x8aa4('0x42')][_0x8aa4('0x4a')](_0x234325)['then'](handleEntityNotFound(_0x228e64,null))[_0x8aa4('0x25')](respondWithResult(_0x228e64,null))[_0x8aa4('0x45')](handleError(_0x228e64,null));};exports['create']=function(_0x436ad7,_0x50eed7){return db[_0x8aa4('0x42')][_0x8aa4('0x4b')](_0x436ad7['body'],{})[_0x8aa4('0x25')](function(_0x370725){var _0x4d193b=_0x436ad7[_0x8aa4('0x4c')][_0x8aa4('0x4d')]({'plain':!![]});if(!_0x4d193b)throw new Error('Unable\x20to\x20retrieve\x20the\x20current\x20user');if(_0x4d193b['role']===_0x8aa4('0x4c')){var _0x2c7958=_0x370725[_0x8aa4('0x4d')]({'plain':!![]});var _0x3fcc7a='Reports';return db[_0x8aa4('0x4e')]['find']({'where':{'name':_0x3fcc7a,'userProfileId':_0x4d193b['userProfileId']},'raw':!![]})[_0x8aa4('0x25')](function(_0x25fd01){if(_0x25fd01&&_0x25fd01['autoAssociation']===0x0){return db[_0x8aa4('0x27')][_0x8aa4('0x4b')]({'name':_0x2c7958['name'],'resourceId':_0x2c7958['id'],'type':_0x8aa4('0x4f'),'sectionId':_0x25fd01['id']},{})[_0x8aa4('0x25')](function(){return _0x370725;});}else{return _0x370725;}})[_0x8aa4('0x45')](function(_0x221685){logger['error']('Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s',_0x221685);throw _0x221685;});}return _0x370725;})[_0x8aa4('0x25')](respondWithResult(_0x50eed7,0xc9))[_0x8aa4('0x45')](handleError(_0x50eed7,null));};exports[_0x8aa4('0x24')]=function(_0x3aff5e,_0x19e3ae){if(_0x3aff5e[_0x8aa4('0x50')]['id']){delete _0x3aff5e[_0x8aa4('0x50')]['id'];}return db[_0x8aa4('0x42')][_0x8aa4('0x4a')]({'where':{'id':_0x3aff5e['params']['id']}})[_0x8aa4('0x25')](handleEntityNotFound(_0x19e3ae,null))[_0x8aa4('0x25')](saveUpdates(_0x3aff5e[_0x8aa4('0x50')],null))['then'](respondWithResult(_0x19e3ae,null))[_0x8aa4('0x45')](handleError(_0x19e3ae,null));};exports[_0x8aa4('0x26')]=function(_0xa021a5,_0x5b0f26){return db['AnalyticCustomReport'][_0x8aa4('0x4a')]({'where':{'id':_0xa021a5[_0x8aa4('0x47')]['id']}})['then'](handleEntityNotFound(_0x5b0f26,null))[_0x8aa4('0x25')](removeEntity(_0x5b0f26,null))[_0x8aa4('0x45')](handleError(_0x5b0f26,null));};exports[_0x8aa4('0x51')]=function(_0x17241a,_0x5d3f01){var _0x3cae59=0xa;var _0x12b2b1=['join','left_join','right_join',_0x8aa4('0x52')];var _0x33d63b={'SUM':_0x8aa4('0x53'),'COUNT':'COUNT(%s)','COUNT DISTINCT':_0x8aa4('0x54'),'MAX':'MAX(%s)','MIN':_0x8aa4('0x55'),'AVG':_0x8aa4('0x56'),'GROUP_CONCAT':'GROUP_CONCAT(%s)','GROUP_CONCAT ASC':'GROUP_CONCAT(%s\x20ORDER\x20BY\x20%s\x20ASC)','GROUP_CONCAT DESC':'GROUP_CONCAT(%s\x20ORDER\x20BY\x20%s\x20DESC)'};var _0x41d996={'SEC_TO_TIME':_0x8aa4('0x57'),'DATE':'DATE(%s)','HOUR':_0x8aa4('0x58'),'ROUND':_0x8aa4('0x59'),'UNIX_TIMESTAMP':_0x8aa4('0x5a')};var _0x5e8127=function(_0x8f1194){return!_['includes'](['IS\x20NULL',_0x8aa4('0x5b'),_0x8aa4('0x5c'),'IS\x20NOT\x20EMPTY'],_0x8f1194);};var _0x509b18=function(_0x129c79){if(!_0x129c79||!_0x129c79[_0x8aa4('0x5d')]['length']){return'';}for(var _0x36cd33='(',_0x4571e6=0x0;_0x4571e6<_0x129c79[_0x8aa4('0x5d')][_0x8aa4('0x37')];_0x4571e6+=0x1){_0x4571e6>0x0&&(_0x36cd33+='\x20'+_0x129c79['operator']+'\x20');_0x36cd33+=_0x129c79['rules'][_0x4571e6][_0x8aa4('0x5e')]?_0x509b18(_0x129c79[_0x8aa4('0x5d')][_0x4571e6][_0x8aa4('0x5e')]):_0x129c79[_0x8aa4('0x5d')][_0x4571e6][_0x8aa4('0x5f')]+'\x20'+_0x129c79[_0x8aa4('0x5d')][_0x4571e6][_0x8aa4('0x60')]+(_0x5e8127(_0x129c79['rules'][_0x4571e6][_0x8aa4('0x60')])?'\x20'+_0x129c79[_0x8aa4('0x5d')][_0x4571e6][_0x8aa4('0x61')]:'');}return _0x36cd33+')';};var _0x3ccc30={'where':{'id':_0x17241a['params']['id']}},_0x19458c,_0x304487,_0x1d2cff,_0x5f1d6c,_0x3915a5;_0x3ccc30=_[_0x8aa4('0x49')]({},_0x3ccc30,_0x17241a[_0x8aa4('0x3e')]);return db[_0x8aa4('0x42')][_0x8aa4('0x4a')](_0x3ccc30)[_0x8aa4('0x25')](function(_0x290f1d){if(_0x290f1d){_0x19458c=_0x290f1d;return _0x290f1d[_0x8aa4('0x62')]();}return null;})[_0x8aa4('0x25')](function(_0xee41db){if(_0xee41db){if(!_0xee41db[_0x8aa4('0x37')]){throw new db[(_0x8aa4('0x63'))][(_0x8aa4('0x64'))](_0x8aa4('0x65'),0x193);}_0x304487=_0xee41db;return db[_0x8aa4('0x66')]['findAll']({'raw':!![]});}return null;})['then'](function(_0x64ffa){if(_0x64ffa){_0x1d2cff=_[_0x8aa4('0x67')](_0x64ffa,'id');var _0x3db063;var _0x2e0a5f=squel[_0x8aa4('0x68')]();_0x2e0a5f[_0x8aa4('0x69')](_0x19458c['table']);for(var _0x47fa80=0x0;_0x47fa80<_0x304487[_0x8aa4('0x37')];_0x47fa80+=0x1){_0x3db063=_0x304487[_0x47fa80][_0x8aa4('0x6a')]?_0x1d2cff[_0x304487[_0x47fa80][_0x8aa4('0x6a')]][_0x8aa4('0x6b')]:_0x304487[_0x47fa80][_0x8aa4('0x5f')];_0x3db063=_0x304487[_0x47fa80][_0x8aa4('0x6c')]?_[_0x8aa4('0x6d')](_0x33d63b[_0x304487[_0x47fa80][_0x8aa4('0x6c')]],'%s',_0x3db063):_0x3db063;_0x3db063=_0x304487[_0x47fa80][_0x8aa4('0x6e')]?_[_0x8aa4('0x6d')](_0x41d996[_0x304487[_0x47fa80][_0x8aa4('0x6e')]],'%s',_0x3db063):_0x3db063;if(_0x304487[_0x47fa80]['groupBy']){_0x2e0a5f['group'](_0x3db063);}_0x304487[_0x47fa80][_0x8aa4('0x6f')]&&_0x2e0a5f[_0x8aa4('0x39')](_0x3db063,_0x304487[_0x47fa80][_0x8aa4('0x6f')]===_0x8aa4('0x70')?![]:!![]);_0x2e0a5f['field'](_0x3db063,_0x304487[_0x47fa80][_0x8aa4('0x71')]||_0x3db063);}if(_0x19458c[_0x8aa4('0x72')]){_0x19458c['joins']=JSON[_0x8aa4('0x73')](_0x19458c[_0x8aa4('0x72')]);for(var _0x3efebd=0x0;_0x3efebd<_0x19458c[_0x8aa4('0x72')]['length'];_0x3efebd+=0x1){if(_0x19458c[_0x8aa4('0x72')][_0x3efebd]['type']&&_[_0x8aa4('0x74')](_0x12b2b1,_0x19458c[_0x8aa4('0x72')][_0x3efebd]['type'])&&_0x19458c['joins'][_0x3efebd][_0x8aa4('0x75')]&&_0x19458c[_0x8aa4('0x72')][_0x3efebd][_0x8aa4('0x76')]&&_0x19458c[_0x8aa4('0x72')][_0x3efebd][_0x8aa4('0x77')]){_0x2e0a5f[_0x19458c['joins'][_0x3efebd][_0x8aa4('0x30')]](_0x19458c[_0x8aa4('0x72')][_0x3efebd]['foreignTable'],null,util[_0x8aa4('0x6e')](_0x8aa4('0x78'),_0x19458c[_0x8aa4('0x79')],_0x19458c[_0x8aa4('0x72')][_0x3efebd][_0x8aa4('0x75')],_0x19458c[_0x8aa4('0x72')][_0x3efebd]['foreignTable'],_0x19458c['joins'][_0x3efebd]['foreignKey']));}}}if(_0x19458c['conditions']){_0x19458c[_0x8aa4('0x7a')]=JSON[_0x8aa4('0x73')](_0x19458c[_0x8aa4('0x7a')]);_0x2e0a5f[_0x8aa4('0x3b')](_0x509b18(_0x19458c['conditions'][_0x8aa4('0x5e')]));}_0x3915a5=_0x2e0a5f[_0x8aa4('0x7b')]();_0x2e0a5f[_0x8aa4('0x21')](_0x3cae59);_0x2e0a5f[_0x8aa4('0x20')](0x0);logger[_0x8aa4('0x7c')]('Limited\x20Query:',_0x2e0a5f[_0x8aa4('0x7d')]());return db[_0x8aa4('0x7e')][_0x8aa4('0x33')](_0x2e0a5f[_0x8aa4('0x7d')](),{'type':db[_0x8aa4('0x7e')][_0x8aa4('0x7f')]['SELECT']});}})['then'](respondWithResult(_0x5d3f01,null))[_0x8aa4('0x45')](handleError(_0x5d3f01,null));};function runReport(_0x9869d6,_0x5acd05,_0x315a80){var _0x127fed=_0x5acd05['name'];var _0x58c511=0xa;var _0x389e79=[_0x8aa4('0x80'),'left_join',_0x8aa4('0x81'),'cross_join'];var _0x239b3f={'SUM':'SUM(%s)','COUNT':_0x8aa4('0x82'),'COUNT DISTINCT':_0x8aa4('0x54'),'MAX':_0x8aa4('0x83'),'MIN':_0x8aa4('0x55'),'AVG':_0x8aa4('0x56'),'GROUP_CONCAT':_0x8aa4('0x84'),'GROUP_CONCAT ASC':_0x8aa4('0x85'),'GROUP_CONCAT DESC':'GROUP_CONCAT(%s\x20ORDER\x20BY\x20%s\x20DESC)'};var _0x14be98={'SEC_TO_TIME':_0x8aa4('0x57'),'DATE':_0x8aa4('0x86'),'HOUR':_0x8aa4('0x58'),'ROUND':'ROUND(%s)','UNIX_TIMESTAMP':_0x8aa4('0x5a')};var _0x47bb69=function(_0x3c07b3){return!_[_0x8aa4('0x74')](['IS\x20NULL','IS\x20NOT\x20NULL',_0x8aa4('0x5c'),_0x8aa4('0x87')],_0x3c07b3);};var _0x5b38dc=function(_0x57ca6b){if(!_0x57ca6b||!_0x57ca6b[_0x8aa4('0x5d')][_0x8aa4('0x37')]){return'';}for(var _0x1ef0cf='(',_0x3c3073=0x0;_0x3c3073<_0x57ca6b['rules'][_0x8aa4('0x37')];_0x3c3073+=0x1){_0x3c3073>0x0&&(_0x1ef0cf+='\x20'+_0x57ca6b[_0x8aa4('0x88')]+'\x20');_0x1ef0cf+=_0x57ca6b[_0x8aa4('0x5d')][_0x3c3073][_0x8aa4('0x5e')]?_0x5b38dc(_0x57ca6b[_0x8aa4('0x5d')][_0x3c3073][_0x8aa4('0x5e')]):_0x57ca6b[_0x8aa4('0x5d')][_0x3c3073][_0x8aa4('0x5f')]+'\x20'+_0x57ca6b['rules'][_0x3c3073][_0x8aa4('0x60')]+(_0x47bb69(_0x57ca6b[_0x8aa4('0x5d')][_0x3c3073][_0x8aa4('0x60')])?'\x20'+_0x57ca6b[_0x8aa4('0x5d')][_0x3c3073][_0x8aa4('0x61')]:'');}return _0x1ef0cf+')';};var _0x349960={'where':{'id':_0x9869d6['id']}},_0x5754de,_0x269f03,_0x50d59e,_0x2813e5,_0x34cb5b;_0x349960=_[_0x8aa4('0x49')]({},_0x349960,_0x315a80);return db['AnalyticCustomReport'][_0x8aa4('0x4a')](_0x349960)[_0x8aa4('0x25')](function(_0x1bba48){if(_0x1bba48){_0x5754de=_0x1bba48;return _0x1bba48[_0x8aa4('0x62')]();}return null;})[_0x8aa4('0x25')](function(_0x264f97){if(_0x264f97){if(!_0x264f97[_0x8aa4('0x37')]){throw new db[(_0x8aa4('0x63'))][(_0x8aa4('0x64'))](_0x8aa4('0x65'),0x193);}_0x269f03=_0x264f97;return db[_0x8aa4('0x66')][_0x8aa4('0x43')]({'raw':!![]});}return null;})[_0x8aa4('0x25')](function(_0x1ab8a4){if(_0x1ab8a4){_0x50d59e=_[_0x8aa4('0x67')](_0x1ab8a4,'id');var _0x478ffa;var _0x59f702=squel['select']();_0x59f702[_0x8aa4('0x69')](_0x5754de[_0x8aa4('0x79')]);for(var _0x2406ab=0x0;_0x2406ab<_0x269f03[_0x8aa4('0x37')];_0x2406ab+=0x1){_0x478ffa=_0x269f03[_0x2406ab][_0x8aa4('0x6a')]?_0x50d59e[_0x269f03[_0x2406ab]['MetricId']][_0x8aa4('0x6b')]:_0x269f03[_0x2406ab][_0x8aa4('0x5f')];_0x478ffa=_0x269f03[_0x2406ab][_0x8aa4('0x6c')]?_[_0x8aa4('0x6d')](_0x239b3f[_0x269f03[_0x2406ab]['function']],'%s',_0x478ffa):_0x478ffa;_0x478ffa=_0x269f03[_0x2406ab][_0x8aa4('0x6e')]?_['replace'](_0x14be98[_0x269f03[_0x2406ab][_0x8aa4('0x6e')]],'%s',_0x478ffa):_0x478ffa;if(_0x269f03[_0x2406ab][_0x8aa4('0x89')]){_0x59f702[_0x8aa4('0x5e')](_0x478ffa);}_0x269f03[_0x2406ab][_0x8aa4('0x6f')]&&_0x59f702[_0x8aa4('0x39')](_0x478ffa,_0x269f03[_0x2406ab][_0x8aa4('0x6f')]===_0x8aa4('0x70')?![]:!![]);_0x59f702[_0x8aa4('0x5f')](_0x478ffa,_0x269f03[_0x2406ab][_0x8aa4('0x71')]||_0x478ffa);}if(_0x5754de[_0x8aa4('0x72')]){_0x5754de[_0x8aa4('0x72')]=JSON[_0x8aa4('0x73')](_0x5754de[_0x8aa4('0x72')]);for(var _0x5767ca=0x0;_0x5767ca<_0x5754de['joins'][_0x8aa4('0x37')];_0x5767ca+=0x1){if(_0x5754de[_0x8aa4('0x72')][_0x5767ca][_0x8aa4('0x30')]&&_['includes'](_0x389e79,_0x5754de['joins'][_0x5767ca][_0x8aa4('0x30')])&&_0x5754de['joins'][_0x5767ca][_0x8aa4('0x75')]&&_0x5754de[_0x8aa4('0x72')][_0x5767ca]['foreignTable']&&_0x5754de[_0x8aa4('0x72')][_0x5767ca][_0x8aa4('0x77')]){_0x59f702[_0x5754de[_0x8aa4('0x72')][_0x5767ca][_0x8aa4('0x30')]](_0x5754de['joins'][_0x5767ca]['foreignTable'],null,util[_0x8aa4('0x6e')](_0x8aa4('0x78'),_0x5754de[_0x8aa4('0x79')],_0x5754de['joins'][_0x5767ca]['parentKey'],_0x5754de[_0x8aa4('0x72')][_0x5767ca][_0x8aa4('0x76')],_0x5754de[_0x8aa4('0x72')][_0x5767ca][_0x8aa4('0x77')]));}}}if(_0x5754de['conditions']){_0x5754de['conditions']=JSON[_0x8aa4('0x73')](_0x5754de[_0x8aa4('0x7a')]);_0x59f702[_0x8aa4('0x3b')](_0x5b38dc(_0x5754de[_0x8aa4('0x7a')][_0x8aa4('0x5e')]));}_0x34cb5b=_0x59f702['clone']();_0x59f702[_0x8aa4('0x21')](_0x58c511);_0x59f702['offset'](0x0);logger[_0x8aa4('0x7c')](_0x8aa4('0x8a'),_0x59f702[_0x8aa4('0x7d')]());return db[_0x8aa4('0x7e')]['query'](_0x59f702[_0x8aa4('0x7d')](),{'type':db[_0x8aa4('0x7e')][_0x8aa4('0x7f')]['SELECT']});}})[_0x8aa4('0x25')](function(_0x3be8d2){if(!_0x3be8d2['length']){throw new db[(_0x8aa4('0x63'))][(_0x8aa4('0x64'))](_0x8aa4('0x8b'),0xcc);}if(_0x5acd05[_0x8aa4('0x8c')]===_0x8aa4('0x8d')){return null;}var _0x5a92d0=_['merge'](_0x5acd05,{'name':_0x5acd05[_0x8aa4('0x8e')]||_0x5acd05[_0x8aa4('0x2a')]||_0x5754de[_0x8aa4('0x2a')],'basename':_0x127fed,'savename':util[_0x8aa4('0x6e')](_0x8aa4('0x8f'),_0x5acd05[_0x8aa4('0x2a')]||_0x5754de['name'],require(_0x8aa4('0x90'))[_0x8aa4('0x91')](0x4),_0x5acd05[_0x8aa4('0x8c')]||_0x8aa4('0x92')),'reportId':_0x5754de['id'],'reportType':_0x8aa4('0x93')});return db[_0x8aa4('0x94')][_0x8aa4('0x4b')](_0x5a92d0,{'raw':!![]});})[_0x8aa4('0x25')](function(_0x256162){if(_0x5754de['table']===_0x8aa4('0x95')){_0x34cb5b['where'](_0x5754de[_0x8aa4('0x79')]+'.calldate\x20BETWEEN\x20?\x20AND\x20?',_0x5acd05['startDate'],_0x5acd05['endDate']);}else{_0x34cb5b[_0x8aa4('0x3b')](_0x5754de[_0x8aa4('0x79')]+'.createdAt\x20BETWEEN\x20?\x20AND\x20?',_0x5acd05[_0x8aa4('0x96')],_0x5acd05[_0x8aa4('0x97')]);}if(_0x256162){logger[_0x8aa4('0x98')](_0x8aa4('0x99'),_0x34cb5b[_0x8aa4('0x7d')]());require(_0x8aa4('0x9a'))['fork'](path[_0x8aa4('0x80')](__dirname,_0x8aa4('0x9b'),_0x256162[_0x8aa4('0x8c')]),[_0x256162['id'],_0x34cb5b[_0x8aa4('0x7d')](),path[_0x8aa4('0x80')](__dirname,_0x8aa4('0x9c'),_0x256162['savename']),_0x127fed]);return _0x256162;}else{var _0xd951e6=squel[_0x8aa4('0x68')]();_0xd951e6[_0x8aa4('0x69')]('('+_0x34cb5b[_0x8aa4('0x7d')]()+')',_0x8aa4('0x9d'));_0xd951e6['field'](_0x8aa4('0x9e'),_0x8aa4('0x3f'));_0x34cb5b[_0x8aa4('0x21')](_0x5acd05['limit']||_0x58c511);_0x34cb5b[_0x8aa4('0x20')](_0x5acd05[_0x8aa4('0x20')]||0x0);return db[_0x8aa4('0x7e')][_0x8aa4('0x33')](_0xd951e6[_0x8aa4('0x7d')](),{'type':db['sequelize'][_0x8aa4('0x7f')][_0x8aa4('0x9f')]})[_0x8aa4('0x25')](function(_0x494d53){if(!_0x494d53[_0x8aa4('0x37')]){_0x2813e5=0x0;}else{_0x2813e5=_0x494d53[0x0][_0x8aa4('0x3f')]||0x0;}return db[_0x8aa4('0x7e')][_0x8aa4('0x33')](_0x34cb5b[_0x8aa4('0x7d')](),{'type':db[_0x8aa4('0x7e')]['QueryTypes'][_0x8aa4('0x9f')]});})[_0x8aa4('0x25')](function(_0x390f62){return{'rows':_0x390f62||[],'count':_0x2813e5};});}});}exports[_0x8aa4('0xa0')]=function(_0xd1e67,_0x1d2e46){return runReport(_0xd1e67[_0x8aa4('0x47')],_0xd1e67['query'],_0xd1e67['options'])[_0x8aa4('0x25')](respondWithResult(_0x1d2e46,null))[_0x8aa4('0x45')](handleError(_0x1d2e46,null));};exports[_0x8aa4('0xa1')]=runReport;exports[_0x8aa4('0x33')]=function(_0x493a0f,_0x326118){var _0x47335e=0xa;var _0x33ac54=[_0x8aa4('0x80'),'left_join',_0x8aa4('0x81'),_0x8aa4('0x52')];var _0x20d365={'SUM':_0x8aa4('0x53'),'COUNT':_0x8aa4('0x82'),'COUNT DISTINCT':_0x8aa4('0x54'),'MAX':_0x8aa4('0x83'),'MIN':_0x8aa4('0x55'),'AVG':_0x8aa4('0x56'),'GROUP_CONCAT':'GROUP_CONCAT(%s)','GROUP_CONCAT ASC':'GROUP_CONCAT(%s\x20ORDER\x20BY\x20%s\x20ASC)','GROUP_CONCAT DESC':_0x8aa4('0xa2')};var _0x4a2532={'SEC_TO_TIME':'SEC_TO_TIME(%s)','DATE':_0x8aa4('0x86'),'HOUR':'HOUR(%s)','ROUND':_0x8aa4('0x59'),'UNIX_TIMESTAMP':_0x8aa4('0x5a')};var _0x5c5f3d=function(_0x4d5a7f){return!_[_0x8aa4('0x74')]([_0x8aa4('0xa3'),_0x8aa4('0x5b'),_0x8aa4('0x5c'),_0x8aa4('0x87')],_0x4d5a7f);};var _0x22b5b4=function(_0x3bb364){if(!_0x3bb364||!_0x3bb364[_0x8aa4('0x5d')]['length']){return'';}for(var _0x56523c='(',_0x4efd3b=0x0;_0x4efd3b<_0x3bb364[_0x8aa4('0x5d')]['length'];_0x4efd3b+=0x1){_0x4efd3b>0x0&&(_0x56523c+='\x20'+_0x3bb364['operator']+'\x20');_0x56523c+=_0x3bb364['rules'][_0x4efd3b][_0x8aa4('0x5e')]?_0x22b5b4(_0x3bb364[_0x8aa4('0x5d')][_0x4efd3b][_0x8aa4('0x5e')]):_0x3bb364[_0x8aa4('0x5d')][_0x4efd3b][_0x8aa4('0x5f')]+'\x20'+_0x3bb364[_0x8aa4('0x5d')][_0x4efd3b][_0x8aa4('0x60')]+(_0x5c5f3d(_0x3bb364[_0x8aa4('0x5d')][_0x4efd3b][_0x8aa4('0x60')])?'\x20'+_0x3bb364['rules'][_0x4efd3b][_0x8aa4('0x61')]:'');}return _0x56523c+')';};var _0x7a68e3={'where':{'id':_0x493a0f[_0x8aa4('0x47')]['id']}},_0x120f7b,_0x3fbb98,_0x5caf6c,_0x36eef9,_0x2f42c5;_0x7a68e3=_[_0x8aa4('0x49')]({},_0x7a68e3,_0x493a0f[_0x8aa4('0x3e')]);return db['AnalyticCustomReport'][_0x8aa4('0x4a')](_0x7a68e3)[_0x8aa4('0x25')](function(_0x164fcf){if(_0x164fcf){_0x120f7b=_0x164fcf;return _0x164fcf[_0x8aa4('0x62')]();}return null;})[_0x8aa4('0x25')](function(_0x5e9d95){if(_0x5e9d95){if(!_0x5e9d95['length']){throw new db[(_0x8aa4('0x63'))]['ValidationErrorItem'](_0x8aa4('0x65'),0x193);}_0x3fbb98=_0x5e9d95;return db['AnalyticMetric'][_0x8aa4('0x43')]({'raw':!![]});}return null;})[_0x8aa4('0x25')](function(_0x18d930){if(_0x18d930){_0x5caf6c=_[_0x8aa4('0x67')](_0x18d930,'id');var _0x24488c;var _0x495ea9=squel[_0x8aa4('0x68')]();_0x495ea9[_0x8aa4('0x69')](_0x120f7b[_0x8aa4('0x79')]);for(var _0x4ee755=0x0;_0x4ee755<_0x3fbb98[_0x8aa4('0x37')];_0x4ee755+=0x1){_0x24488c=_0x3fbb98[_0x4ee755]['MetricId']?_0x5caf6c[_0x3fbb98[_0x4ee755][_0x8aa4('0x6a')]][_0x8aa4('0x6b')]:_0x3fbb98[_0x4ee755]['field'];_0x24488c=_0x3fbb98[_0x4ee755][_0x8aa4('0x6c')]?_[_0x8aa4('0x6d')](_0x20d365[_0x3fbb98[_0x4ee755]['function']],'%s',_0x24488c):_0x24488c;_0x24488c=_0x3fbb98[_0x4ee755]['format']?_[_0x8aa4('0x6d')](_0x4a2532[_0x3fbb98[_0x4ee755][_0x8aa4('0x6e')]],'%s',_0x24488c):_0x24488c;if(_0x3fbb98[_0x4ee755][_0x8aa4('0x89')]){_0x495ea9[_0x8aa4('0x5e')](_0x24488c);}_0x3fbb98[_0x4ee755][_0x8aa4('0x6f')]&&_0x495ea9[_0x8aa4('0x39')](_0x24488c,_0x3fbb98[_0x4ee755][_0x8aa4('0x6f')]===_0x8aa4('0x70')?![]:!![]);_0x495ea9[_0x8aa4('0x5f')](_0x24488c,_0x3fbb98[_0x4ee755][_0x8aa4('0x71')]||_0x24488c);}if(_0x120f7b['joins']){_0x120f7b['joins']=JSON[_0x8aa4('0x73')](_0x120f7b[_0x8aa4('0x72')]);for(var _0xfa2cb4=0x0;_0xfa2cb4<_0x120f7b[_0x8aa4('0x72')][_0x8aa4('0x37')];_0xfa2cb4+=0x1){if(_0x120f7b[_0x8aa4('0x72')][_0xfa2cb4]['type']&&_['includes'](_0x33ac54,_0x120f7b['joins'][_0xfa2cb4]['type'])&&_0x120f7b[_0x8aa4('0x72')][_0xfa2cb4]['parentKey']&&_0x120f7b['joins'][_0xfa2cb4][_0x8aa4('0x76')]&&_0x120f7b[_0x8aa4('0x72')][_0xfa2cb4]['foreignKey']){_0x495ea9[_0x120f7b[_0x8aa4('0x72')][_0xfa2cb4][_0x8aa4('0x30')]](_0x120f7b['joins'][_0xfa2cb4][_0x8aa4('0x76')],null,util[_0x8aa4('0x6e')](_0x8aa4('0x78'),_0x120f7b[_0x8aa4('0x79')],_0x120f7b[_0x8aa4('0x72')][_0xfa2cb4][_0x8aa4('0x75')],_0x120f7b['joins'][_0xfa2cb4][_0x8aa4('0x76')],_0x120f7b[_0x8aa4('0x72')][_0xfa2cb4][_0x8aa4('0x77')]));}}}if(_0x120f7b[_0x8aa4('0x7a')]){_0x120f7b[_0x8aa4('0x7a')]=JSON['parse'](_0x120f7b[_0x8aa4('0x7a')]);_0x495ea9[_0x8aa4('0x3b')](_0x22b5b4(_0x120f7b['conditions'][_0x8aa4('0x5e')]));}_0x2f42c5=_0x495ea9[_0x8aa4('0x7b')]();_0x495ea9[_0x8aa4('0x21')](_0x47335e);_0x495ea9['offset'](0x0);logger[_0x8aa4('0x7c')](_0x8aa4('0x8a'),_0x495ea9[_0x8aa4('0x7d')]());return db[_0x8aa4('0x7e')]['query'](_0x495ea9[_0x8aa4('0x7d')](),{'type':db[_0x8aa4('0x7e')][_0x8aa4('0x7f')]['SELECT']});}})[_0x8aa4('0x25')](function(){return{'sql':_0x2f42c5[_0x8aa4('0x7d')]()};})['then'](respondWithResult(_0x326118,null))[_0x8aa4('0x45')](handleError(_0x326118,null));};
\ No newline at end of file
diff --git a/server/api/analyticCustomReport/analyticCustomReport.model.js b/server/api/analyticCustomReport/analyticCustomReport.model.js
index df117f6..3c91512 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 _0x41b5=['../../config/logger','api','moment','bluebird','request-promise','path','rimraf','../../config/environment','./analyticCustomReport.attributes','exports','define','AnalyticCustomReport','lodash','util'];(function(_0x131750,_0x3a5094){var _0x4e5ade=function(_0x240344){while(--_0x240344){_0x131750['push'](_0x131750['shift']());}};_0x4e5ade(++_0x3a5094);}(_0x41b5,0x124));var _0x541b=function(_0xcd69e3,_0xe3fcf4){_0xcd69e3=_0xcd69e3-0x0;var _0xce16a6=_0x41b5[_0xcd69e3];return _0xce16a6;};'use strict';var _=require(_0x541b('0x0'));var util=require(_0x541b('0x1'));var logger=require(_0x541b('0x2'))(_0x541b('0x3'));var moment=require(_0x541b('0x4'));var BPromise=require(_0x541b('0x5'));var rp=require(_0x541b('0x6'));var fs=require('fs');var path=require(_0x541b('0x7'));var rimraf=require(_0x541b('0x8'));var config=require(_0x541b('0x9'));var attributes=require(_0x541b('0xa'));module[_0x541b('0xb')]=function(_0x4764cf,_0x2e481b){return _0x4764cf[_0x541b('0xc')](_0x541b('0xd'),attributes,{'tableName':'analytics_custom_reports','paranoid':!![],'indexes':[],'timestamps':!![]});};
\ No newline at end of file
+var _0x3679=['bluebird','request-promise','path','rimraf','../../config/environment','./analyticCustomReport.attributes','exports','define','lodash','../../config/logger','api','moment'];(function(_0x128787,_0x3626b6){var _0x23500f=function(_0xc29527){while(--_0xc29527){_0x128787['push'](_0x128787['shift']());}};_0x23500f(++_0x3626b6);}(_0x3679,0x98));var _0x9367=function(_0x566359,_0xc9a4b9){_0x566359=_0x566359-0x0;var _0x3142b4=_0x3679[_0x566359];return _0x3142b4;};'use strict';var _=require(_0x9367('0x0'));var util=require('util');var logger=require(_0x9367('0x1'))(_0x9367('0x2'));var moment=require(_0x9367('0x3'));var BPromise=require(_0x9367('0x4'));var rp=require(_0x9367('0x5'));var fs=require('fs');var path=require(_0x9367('0x6'));var rimraf=require(_0x9367('0x7'));var config=require(_0x9367('0x8'));var attributes=require(_0x9367('0x9'));module[_0x9367('0xa')]=function(_0x8737e4,_0x17f811){return _0x8737e4[_0x9367('0xb')]('AnalyticCustomReport',attributes,{'tableName':'analytics_custom_reports','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 654613e..888f551 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 _0x1b24=['then','info','AnalyticCustomReport,\x20%s,\x20%s','request\x20sent','debug','stringify','error','code','message','result','catch','util','moment','ioredis','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','client','http'];(function(_0x17d9e3,_0x1f969c){var _0x14192d=function(_0x159745){while(--_0x159745){_0x17d9e3['push'](_0x17d9e3['shift']());}};_0x14192d(++_0x1f969c);}(_0x1b24,0x15b));var _0x41b2=function(_0x99b024,_0x258e03){_0x99b024=_0x99b024-0x0;var _0x9ae348=_0x1b24[_0x99b024];return _0x9ae348;};'use strict';var _=require('lodash');var util=require(_0x41b2('0x0'));var moment=require(_0x41b2('0x1'));var BPromise=require('bluebird');var rs=require('randomstring');var fs=require('fs');var Redis=require(_0x41b2('0x2'));var db=require('../../mysqldb')['db'];var utils=require(_0x41b2('0x3'));var logger=require(_0x41b2('0x4'))(_0x41b2('0x5'));var config=require(_0x41b2('0x6'));var jayson=require(_0x41b2('0x7'));var client=jayson[_0x41b2('0x8')][_0x41b2('0x9')]({'port':0x232a});function respondWithRpcPromise(_0x2a5be4,_0x3f76d9,_0x5d00a2){return new BPromise(function(_0x48bf19,_0x4840c8){return client['request'](_0x2a5be4,_0x5d00a2)[_0x41b2('0xa')](function(_0x1bef2d){logger[_0x41b2('0xb')](_0x41b2('0xc'),_0x3f76d9,_0x41b2('0xd'));logger[_0x41b2('0xe')]('AnalyticCustomReport,\x20%s,\x20%s,\x20%s',_0x3f76d9,_0x41b2('0xd'),JSON[_0x41b2('0xf')](_0x1bef2d));if(_0x1bef2d[_0x41b2('0x10')]){if(_0x1bef2d[_0x41b2('0x10')][_0x41b2('0x11')]===0x1f4){logger[_0x41b2('0x10')](_0x41b2('0xc'),_0x3f76d9,_0x1bef2d[_0x41b2('0x10')][_0x41b2('0x12')]);return _0x4840c8(_0x1bef2d[_0x41b2('0x10')][_0x41b2('0x12')]);}logger[_0x41b2('0x10')]('AnalyticCustomReport,\x20%s,\x20%s',_0x3f76d9,_0x1bef2d[_0x41b2('0x10')]['message']);return _0x48bf19(_0x1bef2d[_0x41b2('0x10')][_0x41b2('0x12')]);}else{logger['info'](_0x41b2('0xc'),_0x3f76d9,_0x41b2('0xd'));_0x48bf19(_0x1bef2d[_0x41b2('0x13')]['message']);}})[_0x41b2('0x14')](function(_0x260a85){logger[_0x41b2('0x10')](_0x41b2('0xc'),_0x3f76d9,_0x260a85);_0x4840c8(_0x260a85);});});}
\ No newline at end of file
+var _0xab28=['info','result','catch','lodash','util','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','http','request','then','AnalyticCustomReport,\x20%s,\x20%s','debug','AnalyticCustomReport,\x20%s,\x20%s,\x20%s','request\x20sent','stringify','error','code','message'];(function(_0x59f0ff,_0x2b9d67){var _0x28e782=function(_0x437e09){while(--_0x437e09){_0x59f0ff['push'](_0x59f0ff['shift']());}};_0x28e782(++_0x2b9d67);}(_0xab28,0x193));var _0x8ab2=function(_0x2faaba,_0x3f2b50){_0x2faaba=_0x2faaba-0x0;var _0x7099d9=_0xab28[_0x2faaba];return _0x7099d9;};'use strict';var _=require(_0x8ab2('0x0'));var util=require(_0x8ab2('0x1'));var moment=require(_0x8ab2('0x2'));var BPromise=require(_0x8ab2('0x3'));var rs=require(_0x8ab2('0x4'));var fs=require('fs');var Redis=require(_0x8ab2('0x5'));var db=require(_0x8ab2('0x6'))['db'];var utils=require(_0x8ab2('0x7'));var logger=require(_0x8ab2('0x8'))(_0x8ab2('0x9'));var config=require(_0x8ab2('0xa'));var jayson=require('jayson/promise');var client=jayson['client'][_0x8ab2('0xb')]({'port':0x232a});function respondWithRpcPromise(_0x152fc1,_0x4ec9c6,_0x30abde){return new BPromise(function(_0x2e4672,_0x4b667e){return client[_0x8ab2('0xc')](_0x152fc1,_0x30abde)[_0x8ab2('0xd')](function(_0x19260c){logger['info'](_0x8ab2('0xe'),_0x4ec9c6,'request\x20sent');logger[_0x8ab2('0xf')](_0x8ab2('0x10'),_0x4ec9c6,_0x8ab2('0x11'),JSON[_0x8ab2('0x12')](_0x19260c));if(_0x19260c[_0x8ab2('0x13')]){if(_0x19260c['error'][_0x8ab2('0x14')]===0x1f4){logger[_0x8ab2('0x13')](_0x8ab2('0xe'),_0x4ec9c6,_0x19260c[_0x8ab2('0x13')][_0x8ab2('0x15')]);return _0x4b667e(_0x19260c['error']['message']);}logger[_0x8ab2('0x13')](_0x8ab2('0xe'),_0x4ec9c6,_0x19260c[_0x8ab2('0x13')]['message']);return _0x2e4672(_0x19260c[_0x8ab2('0x13')][_0x8ab2('0x15')]);}else{logger[_0x8ab2('0x16')](_0x8ab2('0xe'),_0x4ec9c6,_0x8ab2('0x11'));_0x2e4672(_0x19260c[_0x8ab2('0x17')][_0x8ab2('0x15')]);}})[_0x8ab2('0x18')](function(_0x408842){logger[_0x8ab2('0x13')]('AnalyticCustomReport,\x20%s,\x20%s',_0x4ec9c6,_0x408842);_0x4b667e(_0x408842);});});}
\ No newline at end of file
diff --git a/server/api/analyticCustomReport/index.js b/server/api/analyticCustomReport/index.js
index dfccebb..ab80aa8 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 _0x4190=['destroy','exports','multer','util','path','connect-timeout','Router','../../components/interaction/service','../../config/environment','get','isAuthenticated','index','/:id','show','preview','/:id/run','run','query','create','put','update','delete'];(function(_0x501510,_0x61caa9){var _0x1e6ee5=function(_0x32845b){while(--_0x32845b){_0x501510['push'](_0x501510['shift']());}};_0x1e6ee5(++_0x61caa9);}(_0x4190,0xb2));var _0x0419=function(_0x4a352c,_0x1844ac){_0x4a352c=_0x4a352c-0x0;var _0x488000=_0x4190[_0x4a352c];return _0x488000;};'use strict';var multer=require(_0x0419('0x0'));var util=require(_0x0419('0x1'));var path=require(_0x0419('0x2'));var timeout=require(_0x0419('0x3'));var express=require('express');var router=express[_0x0419('0x4')]();var auth=require('../../components/auth/service');var interaction=require(_0x0419('0x5'));var config=require(_0x0419('0x6'));var controller=require('./analyticCustomReport.controller');router[_0x0419('0x7')]('/',auth[_0x0419('0x8')](),controller[_0x0419('0x9')]);router[_0x0419('0x7')](_0x0419('0xa'),auth[_0x0419('0x8')](),controller[_0x0419('0xb')]);router['get']('/:id/preview',auth['isAuthenticated'](),controller[_0x0419('0xc')]);router['get'](_0x0419('0xd'),auth['isAuthenticated'](),controller[_0x0419('0xe')]);router[_0x0419('0x7')]('/:id/query',auth['isAuthenticated'](),controller[_0x0419('0xf')]);router['post']('/',auth[_0x0419('0x8')](),controller[_0x0419('0x10')]);router[_0x0419('0x11')](_0x0419('0xa'),auth['isAuthenticated'](),controller[_0x0419('0x12')]);router[_0x0419('0x13')]('/:id',auth[_0x0419('0x8')](),controller[_0x0419('0x14')]);module[_0x0419('0x15')]=router;
\ No newline at end of file
+var _0xcbae=['put','update','/:id','destroy','exports','util','connect-timeout','express','Router','../../components/auth/service','../../components/interaction/service','../../config/environment','get','isAuthenticated','index','show','/:id/preview','preview','/:id/run','run','/:id/query','query','post','create'];(function(_0x3bf93e,_0x307b6f){var _0x4e6875=function(_0x3b875a){while(--_0x3b875a){_0x3bf93e['push'](_0x3bf93e['shift']());}};_0x4e6875(++_0x307b6f);}(_0xcbae,0xf5));var _0xecba=function(_0x1d6b3a,_0x50b0f9){_0x1d6b3a=_0x1d6b3a-0x0;var _0x5daa0c=_0xcbae[_0x1d6b3a];return _0x5daa0c;};'use strict';var multer=require('multer');var util=require(_0xecba('0x0'));var path=require('path');var timeout=require(_0xecba('0x1'));var express=require(_0xecba('0x2'));var router=express[_0xecba('0x3')]();var auth=require(_0xecba('0x4'));var interaction=require(_0xecba('0x5'));var config=require(_0xecba('0x6'));var controller=require('./analyticCustomReport.controller');router[_0xecba('0x7')]('/',auth[_0xecba('0x8')](),controller[_0xecba('0x9')]);router['get']('/:id',auth[_0xecba('0x8')](),controller[_0xecba('0xa')]);router['get'](_0xecba('0xb'),auth[_0xecba('0x8')](),controller[_0xecba('0xc')]);router[_0xecba('0x7')](_0xecba('0xd'),auth[_0xecba('0x8')](),controller[_0xecba('0xe')]);router[_0xecba('0x7')](_0xecba('0xf'),auth['isAuthenticated'](),controller[_0xecba('0x10')]);router[_0xecba('0x11')]('/',auth[_0xecba('0x8')](),controller[_0xecba('0x12')]);router[_0xecba('0x13')]('/:id',auth[_0xecba('0x8')](),controller[_0xecba('0x14')]);router['delete'](_0xecba('0x15'),auth[_0xecba('0x8')](),controller[_0xecba('0x16')]);module[_0xecba('0x17')]=router;
\ No newline at end of file
diff --git a/server/api/analyticDefaultReport/analyticDefaultReport.attributes.js b/server/api/analyticDefaultReport/analyticDefaultReport.attributes.js
index 5510f2d..9566588 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 _0x3fed=['STRING','TEXT','sequelize','exports'];(function(_0x42bdad,_0x12836c){var _0x122626=function(_0x2eb29c){while(--_0x2eb29c){_0x42bdad['push'](_0x42bdad['shift']());}};_0x122626(++_0x12836c);}(_0x3fed,0x192));var _0xd3fe=function(_0x7d4a20,_0x1600b8){_0x7d4a20=_0x7d4a20-0x0;var _0x323789=_0x3fed[_0x7d4a20];return _0x323789;};'use strict';var Sequelize=require(_0xd3fe('0x0'));module[_0xd3fe('0x1')]={'name':{'type':Sequelize[_0xd3fe('0x2')],'allowNull':![]},'description':{'type':Sequelize['STRING']},'parent':{'type':Sequelize['STRING']},'table':{'type':Sequelize[_0xd3fe('0x2')]},'conditions':{'type':Sequelize[_0xd3fe('0x3')]},'joins':{'type':Sequelize[_0xd3fe('0x3')]}};
\ No newline at end of file
+var _0xd7a4=['exports','STRING','TEXT','sequelize'];(function(_0x438988,_0x2a86cf){var _0x1ce59f=function(_0x26f36a){while(--_0x26f36a){_0x438988['push'](_0x438988['shift']());}};_0x1ce59f(++_0x2a86cf);}(_0xd7a4,0x19f));var _0x4d7a=function(_0x43c7d1,_0x2d0e47){_0x43c7d1=_0x43c7d1-0x0;var _0x3712cc=_0xd7a4[_0x43c7d1];return _0x3712cc;};'use strict';var Sequelize=require(_0x4d7a('0x0'));module[_0x4d7a('0x1')]={'name':{'type':Sequelize['STRING'],'allowNull':![]},'description':{'type':Sequelize[_0x4d7a('0x2')]},'parent':{'type':Sequelize[_0x4d7a('0x2')]},'table':{'type':Sequelize[_0x4d7a('0x2')]},'conditions':{'type':Sequelize[_0x4d7a('0x3')]},'joins':{'type':Sequelize[_0x4d7a('0x3')]}};
\ No newline at end of file
diff --git a/server/api/analyticDefaultReport/analyticDefaultReport.controller.js b/server/api/analyticDefaultReport/analyticDefaultReport.controller.js
index 4a7042b..931db32 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 _0x239d=['DESC','joins','parentKey','foreignTable','foreignKey','conditions','parse','debug','toString','sequelize','QueryTypes','SELECT','left_join','DATE(%s)','UNIX_TIMESTAMP(%s)','IS\x20EMPTY','ValidationErrorItem','alias','%s.%s\x20=\x20%s.%s','clone','No\x20available\x20data','output','web','%s-%s.%s','randomstring','csv','AnalyticExtractedReport','cdr','startDate','endDate','info','Run\x20Query:','child_process','fork','../../files/reports','run','runReport','value','select','html-pdf','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','moment','bluebird','mustache','util','path','sox','ejs','lodash','squel','crypto','jsforce','desk.js','querystring','papaparse','../../components/auth/service','../../components/parsers/qs','../../config/license/hardware','../../config/logger','api','../../config/utils','end','status','json','count','offset','limit','Content-Range','apply','reject','save','then','destroy','get','UserProfileResource','sendStatus','error','stack','name','AnalyticDefaultReport','fieldName','type','model','query','keys','filters','intersection','attributes','fields','length','hasOwnProperty','order','sort','pick','filter','where','merge','map','options','includeAll','include','findAll','rows','catch','show','params','rawAttributes','find','create','user','role','Reports','UserProfileSection','userProfileId','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','body','join','right_join','cross_join','SUM(%s)','COUNT(%s)','COUNT(DISTINCT\x20%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)','HOUR(%s)','ROUND(%s)','includes','IS\x20NULL','IS\x20NOT\x20NULL','IS\x20NOT\x20EMPTY','rules','operator','group','field','condition','getFields','Sequelize','Please\x20insert\x20at\x20least\x20one\x20field','AnalyticMetric','keyBy','from','table','MetricId','metric','function','replace','format','groupBy','orderBy'];(function(_0xb93278,_0x59c02f){var _0x1cca3b=function(_0x19b895){while(--_0x19b895){_0xb93278['push'](_0xb93278['shift']());}};_0x1cca3b(++_0x59c02f);}(_0x239d,0x163));var _0xd239=function(_0x102094,_0x4c948f){_0x102094=_0x102094-0x0;var _0x3563cb=_0x239d[_0x102094];return _0x3563cb;};'use strict';var pdf=require(_0xd239('0x0'));var emlformat=require(_0xd239('0x1'));var rimraf=require(_0xd239('0x2'));var zipdir=require(_0xd239('0x3'));var jsonpatch=require(_0xd239('0x4'));var rp=require(_0xd239('0x5'));var moment=require(_0xd239('0x6'));var BPromise=require(_0xd239('0x7'));var Mustache=require(_0xd239('0x8'));var util=require(_0xd239('0x9'));var path=require(_0xd239('0xa'));var sox=require(_0xd239('0xb'));var csv=require('to-csv');var ejs=require(_0xd239('0xc'));var fs=require('fs');var _=require(_0xd239('0xd'));var squel=require(_0xd239('0xe'));var crypto=require(_0xd239('0xf'));var jsforce=require(_0xd239('0x10'));var deskjs=require(_0xd239('0x11'));var toCsv=require('to-csv');var querystring=require(_0xd239('0x12'));var Papa=require(_0xd239('0x13'));var Redis=require('ioredis');var authService=require(_0xd239('0x14'));var qs=require(_0xd239('0x15'));var as=require('../../components/parsers/advancedSearch');var hardwareService=require(_0xd239('0x16'));var logger=require(_0xd239('0x17'))(_0xd239('0x18'));var utils=require(_0xd239('0x19'));var config=require('../../config/environment');var db=require('../../mysqldb')['db'];function respondWithStatusCode(_0x2c22d0,_0x3a1cf){_0x3a1cf=_0x3a1cf||0xcc;return function(_0x283bf9){if(_0x283bf9){return _0x2c22d0['sendStatus'](_0x3a1cf);}return _0x2c22d0['status'](_0x3a1cf)[_0xd239('0x1a')]();};}function respondWithResult(_0x18ac79,_0x47cb85){_0x47cb85=_0x47cb85||0xc8;return function(_0x17ec3a){if(_0x17ec3a){return _0x18ac79[_0xd239('0x1b')](_0x47cb85)[_0xd239('0x1c')](_0x17ec3a);}};}function respondWithFilteredResult(_0x147bec,_0x316f43){return function(_0x26d691){if(_0x26d691){var _0x38808a=_0x26d691[_0xd239('0x1d')],_0x43f79f=_0x316f43[_0xd239('0x1e')],_0x2c612d=_0x316f43['offset']+_0x316f43[_0xd239('0x1f')],_0x344283;if(_0x2c612d>=_0x38808a){_0x2c612d=_0x38808a;_0x344283=0xc8;}else{_0x344283=0xce;}_0x147bec[_0xd239('0x1b')](_0x344283);return _0x147bec['set'](_0xd239('0x20'),_0x43f79f+'-'+_0x2c612d+'/'+_0x38808a)[_0xd239('0x1c')](_0x26d691);}return null;};}function patchUpdates(_0x10d8f1){return function(_0x5afd02){try{jsonpatch[_0xd239('0x21')](_0x5afd02,_0x10d8f1,!![]);}catch(_0xcccdd9){return BPromise[_0xd239('0x22')](_0xcccdd9);}return _0x5afd02[_0xd239('0x23')]();};}function saveUpdates(_0x25c17b,_0x55c3cf){return function(_0x56cce1){if(_0x56cce1){return _0x56cce1['update'](_0x25c17b)[_0xd239('0x24')](function(_0x4de8c4){return _0x4de8c4;});}return null;};}function removeEntity(_0x222a55,_0x1ae769){return function(_0xc7e9b){if(_0xc7e9b){return _0xc7e9b[_0xd239('0x25')]()[_0xd239('0x24')](function(){var _0x4d84d9=_0xc7e9b[_0xd239('0x26')]({'plain':!![]});var _0x3f3224='DefaultReports';return db[_0xd239('0x27')][_0xd239('0x25')]({'where':{'type':_0x3f3224,'resourceId':_0x4d84d9['id']}})[_0xd239('0x24')](function(){return _0xc7e9b;});})['then'](function(){_0x222a55[_0xd239('0x1b')](0xcc)[_0xd239('0x1a')]();});}};}function handleEntityNotFound(_0x4925ae,_0x52d3cc){return function(_0xd9d551){if(!_0xd9d551){_0x4925ae[_0xd239('0x28')](0x194);}return _0xd9d551;};}function handleError(_0x2f3c0a,_0x2a2439){_0x2a2439=_0x2a2439||0x1f4;return function(_0x3e574f){logger[_0xd239('0x29')](_0x3e574f[_0xd239('0x2a')]);if(_0x3e574f[_0xd239('0x2b')]){delete _0x3e574f[_0xd239('0x2b')];}_0x2f3c0a[_0xd239('0x1b')](_0x2a2439)['send'](_0x3e574f);};}exports['index']=function(_0x360692,_0xf4557c){var _0x3d3738={},_0xb52f48={},_0x449ba0={'count':0x0,'rows':[]};var _0xf5a7a6=_['map'](db[_0xd239('0x2c')]['rawAttributes'],function(_0x3e4ea0){return{'name':_0x3e4ea0[_0xd239('0x2d')],'type':_0x3e4ea0[_0xd239('0x2e')]['key']};});_0xb52f48[_0xd239('0x2f')]=_['map'](_0xf5a7a6,_0xd239('0x2b'));_0xb52f48[_0xd239('0x30')]=_[_0xd239('0x31')](_0x360692[_0xd239('0x30')]);_0xb52f48[_0xd239('0x32')]=_[_0xd239('0x33')](_0xb52f48[_0xd239('0x2f')],_0xb52f48[_0xd239('0x30')]);_0x3d3738[_0xd239('0x34')]=_[_0xd239('0x33')](_0xb52f48[_0xd239('0x2f')],qs[_0xd239('0x35')](_0x360692[_0xd239('0x30')][_0xd239('0x35')]));_0x3d3738[_0xd239('0x34')]=_0x3d3738[_0xd239('0x34')][_0xd239('0x36')]?_0x3d3738[_0xd239('0x34')]:_0xb52f48[_0xd239('0x2f')];if(!_0x360692[_0xd239('0x30')][_0xd239('0x37')]('nolimit')){_0x3d3738['limit']=qs[_0xd239('0x1f')](_0x360692[_0xd239('0x30')]['limit']);_0x3d3738[_0xd239('0x1e')]=qs[_0xd239('0x1e')](_0x360692[_0xd239('0x30')][_0xd239('0x1e')]);}_0x3d3738[_0xd239('0x38')]=qs[_0xd239('0x39')](_0x360692['query'][_0xd239('0x39')]);_0x3d3738['where']=qs[_0xd239('0x32')](_[_0xd239('0x3a')](_0x360692[_0xd239('0x30')],_0xb52f48['filters']));if(_0x360692[_0xd239('0x30')][_0xd239('0x3b')]){_0x3d3738[_0xd239('0x3c')]=_[_0xd239('0x3d')](_0x3d3738[_0xd239('0x3c')],{'$or':_[_0xd239('0x3e')](_0xf5a7a6,function(_0x9476af){if(_0x9476af[_0xd239('0x2e')]!=='VIRTUAL'){var _0x54b89f={};_0x54b89f[_0x9476af[_0xd239('0x2b')]]={'$like':'%'+_0x360692[_0xd239('0x30')][_0xd239('0x3b')]+'%'};return _0x54b89f;}})});}_0x3d3738=_[_0xd239('0x3d')]({},_0x3d3738,_0x360692[_0xd239('0x3f')]);var _0x5eb7cb={'where':_0x3d3738[_0xd239('0x3c')]};return db[_0xd239('0x2c')][_0xd239('0x1d')](_0x5eb7cb)[_0xd239('0x24')](function(_0x57ff13){_0x449ba0[_0xd239('0x1d')]=_0x57ff13;if(_0x360692[_0xd239('0x30')][_0xd239('0x40')]){_0x3d3738[_0xd239('0x41')]=[{'all':!![]}];}return db[_0xd239('0x2c')][_0xd239('0x42')](_0x3d3738);})[_0xd239('0x24')](function(_0x4b807e){_0x449ba0[_0xd239('0x43')]=_0x4b807e;return _0x449ba0;})[_0xd239('0x24')](respondWithFilteredResult(_0xf4557c,_0x3d3738))[_0xd239('0x44')](handleError(_0xf4557c,null));};exports[_0xd239('0x45')]=function(_0x40abb7,_0x15a01d){var _0x51dc49={'raw':!![],'where':{'id':_0x40abb7[_0xd239('0x46')]['id']}},_0x129bda={};_0x129bda['model']=_[_0xd239('0x31')](db['AnalyticDefaultReport'][_0xd239('0x47')]);_0x129bda['query']=_[_0xd239('0x31')](_0x40abb7[_0xd239('0x30')]);_0x129bda[_0xd239('0x32')]=_['intersection'](_0x129bda[_0xd239('0x2f')],_0x129bda[_0xd239('0x30')]);_0x51dc49[_0xd239('0x34')]=_['intersection'](_0x129bda[_0xd239('0x2f')],qs[_0xd239('0x35')](_0x40abb7[_0xd239('0x30')][_0xd239('0x35')]));_0x51dc49[_0xd239('0x34')]=_0x51dc49[_0xd239('0x34')][_0xd239('0x36')]?_0x51dc49[_0xd239('0x34')]:_0x129bda['model'];if(_0x40abb7[_0xd239('0x30')][_0xd239('0x40')]){_0x51dc49[_0xd239('0x41')]=[{'all':!![]}];}_0x51dc49=_[_0xd239('0x3d')]({},_0x51dc49,_0x40abb7[_0xd239('0x3f')]);return db[_0xd239('0x2c')][_0xd239('0x48')](_0x51dc49)['then'](handleEntityNotFound(_0x15a01d,null))[_0xd239('0x24')](respondWithResult(_0x15a01d,null))[_0xd239('0x44')](handleError(_0x15a01d,null));};exports[_0xd239('0x49')]=function(_0x14cdbd,_0x17cd7a){return db[_0xd239('0x2c')][_0xd239('0x49')](_0x14cdbd['body'],{})[_0xd239('0x24')](function(_0x97f880){var _0x3cfcac=_0x14cdbd[_0xd239('0x4a')][_0xd239('0x26')]({'plain':!![]});if(!_0x3cfcac)throw new Error('Unable\x20to\x20retrieve\x20the\x20current\x20user');if(_0x3cfcac[_0xd239('0x4b')]===_0xd239('0x4a')){var _0x2fbafe=_0x97f880[_0xd239('0x26')]({'plain':!![]});var _0x5822c8=_0xd239('0x4c');return db[_0xd239('0x4d')][_0xd239('0x48')]({'where':{'name':_0x5822c8,'userProfileId':_0x3cfcac[_0xd239('0x4e')]},'raw':!![]})[_0xd239('0x24')](function(_0x5cc80f){if(_0x5cc80f&&_0x5cc80f['autoAssociation']===0x0){return db[_0xd239('0x27')][_0xd239('0x49')]({'name':_0x2fbafe[_0xd239('0x2b')],'resourceId':_0x2fbafe['id'],'type':'DefaultReports','sectionId':_0x5cc80f['id']},{})[_0xd239('0x24')](function(){return _0x97f880;});}else{return _0x97f880;}})[_0xd239('0x44')](function(_0x120b74){logger[_0xd239('0x29')](_0xd239('0x4f'),_0x120b74);throw _0x120b74;});}return _0x97f880;})[_0xd239('0x24')](respondWithResult(_0x17cd7a,0xc9))[_0xd239('0x44')](handleError(_0x17cd7a,null));};exports['update']=function(_0x30b023,_0x2dbc7a){if(_0x30b023[_0xd239('0x50')]['id']){delete _0x30b023[_0xd239('0x50')]['id'];}return db[_0xd239('0x2c')][_0xd239('0x48')]({'where':{'id':_0x30b023[_0xd239('0x46')]['id']}})[_0xd239('0x24')](handleEntityNotFound(_0x2dbc7a,null))[_0xd239('0x24')](saveUpdates(_0x30b023[_0xd239('0x50')],null))['then'](respondWithResult(_0x2dbc7a,null))[_0xd239('0x44')](handleError(_0x2dbc7a,null));};exports[_0xd239('0x25')]=function(_0x3c223c,_0x245891){return db[_0xd239('0x2c')][_0xd239('0x48')]({'where':{'id':_0x3c223c[_0xd239('0x46')]['id']}})[_0xd239('0x24')](handleEntityNotFound(_0x245891,null))['then'](removeEntity(_0x245891,null))[_0xd239('0x44')](handleError(_0x245891,null));};exports['preview']=function(_0xdd4764,_0x3f9d03){var _0x2f312b=0xa;var _0xb96f9c=[_0xd239('0x51'),'left_join',_0xd239('0x52'),_0xd239('0x53')];var _0x1d1a81={'SUM':_0xd239('0x54'),'COUNT':_0xd239('0x55'),'COUNT DISTINCT':_0xd239('0x56'),'MAX':_0xd239('0x57'),'MIN':_0xd239('0x58'),'AVG':_0xd239('0x59'),'GROUP_CONCAT':_0xd239('0x5a'),'GROUP_CONCAT ASC':_0xd239('0x5b'),'GROUP_CONCAT DESC':_0xd239('0x5c')};var _0x43cb67={'SEC_TO_TIME':_0xd239('0x5d'),'DATE':'DATE(%s)','HOUR':_0xd239('0x5e'),'ROUND':_0xd239('0x5f'),'UNIX_TIMESTAMP':'UNIX_TIMESTAMP(%s)'};var _0x2fcfaf=function(_0x2aa8da){return!_[_0xd239('0x60')]([_0xd239('0x61'),_0xd239('0x62'),'IS\x20EMPTY',_0xd239('0x63')],_0x2aa8da);};var _0x35c841=function(_0x3b1465){if(!_0x3b1465||!_0x3b1465[_0xd239('0x64')][_0xd239('0x36')]){return'';}for(var _0x580981='(',_0x5583e5=0x0;_0x5583e5<_0x3b1465[_0xd239('0x64')]['length'];_0x5583e5+=0x1){_0x5583e5>0x0&&(_0x580981+='\x20'+_0x3b1465[_0xd239('0x65')]+'\x20');_0x580981+=_0x3b1465[_0xd239('0x64')][_0x5583e5][_0xd239('0x66')]?_0x35c841(_0x3b1465[_0xd239('0x64')][_0x5583e5]['group']):_0x3b1465[_0xd239('0x64')][_0x5583e5][_0xd239('0x67')]+'\x20'+_0x3b1465['rules'][_0x5583e5][_0xd239('0x68')]+(_0x2fcfaf(_0x3b1465['rules'][_0x5583e5][_0xd239('0x68')])?'\x20'+_0x3b1465[_0xd239('0x64')][_0x5583e5]['value']:'');}return _0x580981+')';};var _0x2afa91={'where':{'id':_0xdd4764[_0xd239('0x46')]['id']}},_0x3a2156,_0x14d05f,_0x5a9c9e,_0x1dd1cc,_0xcabd3a;_0x2afa91=_[_0xd239('0x3d')]({},_0x2afa91,_0xdd4764[_0xd239('0x3f')]);return db[_0xd239('0x2c')][_0xd239('0x48')](_0x2afa91)[_0xd239('0x24')](function(_0x3a7668){if(_0x3a7668){_0x3a2156=_0x3a7668;return _0x3a7668[_0xd239('0x69')]();}return null;})[_0xd239('0x24')](function(_0x558e77){if(_0x558e77){if(!_0x558e77['length']){throw new db[(_0xd239('0x6a'))]['ValidationErrorItem'](_0xd239('0x6b'),0x193);}_0x14d05f=_0x558e77;return db[_0xd239('0x6c')][_0xd239('0x42')]({'raw':!![]});}return null;})[_0xd239('0x24')](function(_0x1cabe5){if(_0x1cabe5){_0x5a9c9e=_[_0xd239('0x6d')](_0x1cabe5,'id');var _0x142aff;var _0x55f3ad=squel['select']();_0x55f3ad[_0xd239('0x6e')](_0x3a2156[_0xd239('0x6f')]);for(var _0x3d92f2=0x0;_0x3d92f2<_0x14d05f[_0xd239('0x36')];_0x3d92f2+=0x1){_0x142aff=_0x14d05f[_0x3d92f2][_0xd239('0x70')]?_0x5a9c9e[_0x14d05f[_0x3d92f2][_0xd239('0x70')]][_0xd239('0x71')]:_0x14d05f[_0x3d92f2]['field'];_0x142aff=_0x14d05f[_0x3d92f2][_0xd239('0x72')]?_[_0xd239('0x73')](_0x1d1a81[_0x14d05f[_0x3d92f2]['function']],'%s',_0x142aff):_0x142aff;_0x142aff=_0x14d05f[_0x3d92f2][_0xd239('0x74')]?_[_0xd239('0x73')](_0x43cb67[_0x14d05f[_0x3d92f2]['format']],'%s',_0x142aff):_0x142aff;if(_0x14d05f[_0x3d92f2][_0xd239('0x75')]){_0x55f3ad['group'](_0x142aff);}_0x14d05f[_0x3d92f2]['orderBy']&&_0x55f3ad[_0xd239('0x38')](_0x142aff,_0x14d05f[_0x3d92f2][_0xd239('0x76')]===_0xd239('0x77')?![]:!![]);_0x55f3ad['field'](_0x142aff,_0x14d05f[_0x3d92f2]['alias']||_0x142aff);}if(_0x3a2156[_0xd239('0x78')]){_0x3a2156[_0xd239('0x78')]=JSON['parse'](_0x3a2156[_0xd239('0x78')]);for(var _0x5de8b1=0x0;_0x5de8b1<_0x3a2156[_0xd239('0x78')]['length'];_0x5de8b1+=0x1){if(_0x3a2156[_0xd239('0x78')][_0x5de8b1][_0xd239('0x2e')]&&_[_0xd239('0x60')](_0xb96f9c,_0x3a2156[_0xd239('0x78')][_0x5de8b1][_0xd239('0x2e')])&&_0x3a2156[_0xd239('0x78')][_0x5de8b1][_0xd239('0x79')]&&_0x3a2156[_0xd239('0x78')][_0x5de8b1][_0xd239('0x7a')]&&_0x3a2156[_0xd239('0x78')][_0x5de8b1][_0xd239('0x7b')]){_0x55f3ad[_0x3a2156[_0xd239('0x78')][_0x5de8b1]['type']](_0x3a2156[_0xd239('0x78')][_0x5de8b1][_0xd239('0x7a')],null,util['format']('%s.%s\x20=\x20%s.%s',_0x3a2156[_0xd239('0x6f')],_0x3a2156[_0xd239('0x78')][_0x5de8b1][_0xd239('0x79')],_0x3a2156[_0xd239('0x78')][_0x5de8b1][_0xd239('0x7a')],_0x3a2156[_0xd239('0x78')][_0x5de8b1][_0xd239('0x7b')]));}}}if(_0x3a2156[_0xd239('0x7c')]){_0x3a2156['conditions']=JSON[_0xd239('0x7d')](_0x3a2156[_0xd239('0x7c')]);_0x55f3ad['where'](_0x35c841(_0x3a2156[_0xd239('0x7c')]['group']));}_0xcabd3a=_0x55f3ad['clone']();_0x55f3ad[_0xd239('0x1f')](_0x2f312b);_0x55f3ad[_0xd239('0x1e')](0x0);logger[_0xd239('0x7e')]('Limited\x20Query:',_0x55f3ad[_0xd239('0x7f')]());return db[_0xd239('0x80')][_0xd239('0x30')](_0x55f3ad['toString'](),{'type':db[_0xd239('0x80')][_0xd239('0x81')][_0xd239('0x82')]});}})[_0xd239('0x24')](respondWithResult(_0x3f9d03,null))['catch'](handleError(_0x3f9d03,null));};function runReport(_0xf6b3fb,_0x298e72,_0x641d96){var _0x1e76ab=_0x298e72[_0xd239('0x2b')];var _0x3865c7=0xa;var _0xa3aa99=[_0xd239('0x51'),_0xd239('0x83'),_0xd239('0x52'),_0xd239('0x53')];var _0x46e869={'SUM':_0xd239('0x54'),'COUNT':_0xd239('0x55'),'COUNT DISTINCT':'COUNT(DISTINCT\x20%s)','MAX':_0xd239('0x57'),'MIN':'MIN(%s)','AVG':_0xd239('0x59'),'GROUP_CONCAT':'GROUP_CONCAT(%s)','GROUP_CONCAT ASC':_0xd239('0x5b'),'GROUP_CONCAT DESC':'GROUP_CONCAT(%s\x20ORDER\x20BY\x20%s\x20DESC)'};var _0x1d16db={'SEC_TO_TIME':'SEC_TO_TIME(%s)','DATE':_0xd239('0x84'),'HOUR':_0xd239('0x5e'),'ROUND':'ROUND(%s)','UNIX_TIMESTAMP':_0xd239('0x85')};var _0x950ad7=function(_0x44762f){return!_[_0xd239('0x60')]([_0xd239('0x61'),'IS\x20NOT\x20NULL',_0xd239('0x86'),_0xd239('0x63')],_0x44762f);};var _0x5a8a86=function(_0x55724e){if(!_0x55724e||!_0x55724e[_0xd239('0x64')]['length']){return'';}for(var _0xce2248='(',_0x30cf1c=0x0;_0x30cf1c<_0x55724e[_0xd239('0x64')][_0xd239('0x36')];_0x30cf1c+=0x1){_0x30cf1c>0x0&&(_0xce2248+='\x20'+_0x55724e[_0xd239('0x65')]+'\x20');_0xce2248+=_0x55724e['rules'][_0x30cf1c][_0xd239('0x66')]?_0x5a8a86(_0x55724e[_0xd239('0x64')][_0x30cf1c][_0xd239('0x66')]):_0x55724e[_0xd239('0x64')][_0x30cf1c][_0xd239('0x67')]+'\x20'+_0x55724e[_0xd239('0x64')][_0x30cf1c][_0xd239('0x68')]+(_0x950ad7(_0x55724e['rules'][_0x30cf1c][_0xd239('0x68')])?'\x20'+_0x55724e[_0xd239('0x64')][_0x30cf1c]['value']:'');}return _0xce2248+')';};var _0x58bc91={'where':{'id':_0xf6b3fb['id']}},_0x16d25f,_0x497fd3,_0x7eccea,_0x198c26,_0x55fa9d;_0x58bc91=_[_0xd239('0x3d')]({},_0x58bc91,_0x641d96);return db[_0xd239('0x2c')][_0xd239('0x48')](_0x58bc91)[_0xd239('0x24')](function(_0x4d2754){if(_0x4d2754){_0x16d25f=_0x4d2754;return _0x4d2754['getFields']();}return null;})[_0xd239('0x24')](function(_0xd59165){if(_0xd59165){if(!_0xd59165['length']){throw new db['Sequelize'][(_0xd239('0x87'))]('Please\x20insert\x20at\x20least\x20one\x20field',0x193);}_0x497fd3=_0xd59165;return db[_0xd239('0x6c')][_0xd239('0x42')]({'raw':!![]});}return null;})[_0xd239('0x24')](function(_0x579c35){if(_0x579c35){_0x7eccea=_[_0xd239('0x6d')](_0x579c35,'id');var _0x294961;var _0x34c0c1=squel['select']();_0x34c0c1[_0xd239('0x6e')](_0x16d25f['table']);for(var _0x405b88=0x0;_0x405b88<_0x497fd3[_0xd239('0x36')];_0x405b88+=0x1){_0x294961=_0x497fd3[_0x405b88]['MetricId']?_0x7eccea[_0x497fd3[_0x405b88][_0xd239('0x70')]]['metric']:_0x497fd3[_0x405b88][_0xd239('0x67')];_0x294961=_0x497fd3[_0x405b88][_0xd239('0x72')]?_[_0xd239('0x73')](_0x46e869[_0x497fd3[_0x405b88][_0xd239('0x72')]],'%s',_0x294961):_0x294961;_0x294961=_0x497fd3[_0x405b88][_0xd239('0x74')]?_['replace'](_0x1d16db[_0x497fd3[_0x405b88]['format']],'%s',_0x294961):_0x294961;if(_0x497fd3[_0x405b88][_0xd239('0x75')]){_0x34c0c1['group'](_0x294961);}_0x497fd3[_0x405b88][_0xd239('0x76')]&&_0x34c0c1[_0xd239('0x38')](_0x294961,_0x497fd3[_0x405b88][_0xd239('0x76')]==='DESC'?![]:!![]);_0x34c0c1[_0xd239('0x67')](_0x294961,_0x497fd3[_0x405b88][_0xd239('0x88')]||_0x294961);}if(_0x16d25f[_0xd239('0x78')]){_0x16d25f[_0xd239('0x78')]=JSON[_0xd239('0x7d')](_0x16d25f['joins']);for(var _0x2b9a35=0x0;_0x2b9a35<_0x16d25f[_0xd239('0x78')]['length'];_0x2b9a35+=0x1){if(_0x16d25f[_0xd239('0x78')][_0x2b9a35][_0xd239('0x2e')]&&_[_0xd239('0x60')](_0xa3aa99,_0x16d25f[_0xd239('0x78')][_0x2b9a35]['type'])&&_0x16d25f[_0xd239('0x78')][_0x2b9a35][_0xd239('0x79')]&&_0x16d25f['joins'][_0x2b9a35][_0xd239('0x7a')]&&_0x16d25f[_0xd239('0x78')][_0x2b9a35][_0xd239('0x7b')]){_0x34c0c1[_0x16d25f[_0xd239('0x78')][_0x2b9a35]['type']](_0x16d25f[_0xd239('0x78')][_0x2b9a35][_0xd239('0x7a')],null,util['format'](_0xd239('0x89'),_0x16d25f[_0xd239('0x6f')],_0x16d25f[_0xd239('0x78')][_0x2b9a35][_0xd239('0x79')],_0x16d25f[_0xd239('0x78')][_0x2b9a35][_0xd239('0x7a')],_0x16d25f[_0xd239('0x78')][_0x2b9a35][_0xd239('0x7b')]));}}}if(_0x16d25f['conditions']){_0x16d25f['conditions']=JSON['parse'](_0x16d25f[_0xd239('0x7c')]);_0x34c0c1[_0xd239('0x3c')](_0x5a8a86(_0x16d25f['conditions'][_0xd239('0x66')]));}_0x55fa9d=_0x34c0c1[_0xd239('0x8a')]();_0x34c0c1[_0xd239('0x1f')](_0x3865c7);_0x34c0c1[_0xd239('0x1e')](0x0);logger[_0xd239('0x7e')]('Limited\x20Query:',_0x34c0c1[_0xd239('0x7f')]());return db[_0xd239('0x80')][_0xd239('0x30')](_0x34c0c1['toString'](),{'type':db[_0xd239('0x80')][_0xd239('0x81')][_0xd239('0x82')]});}})[_0xd239('0x24')](function(_0x57de40){if(!_0x57de40[_0xd239('0x36')]){throw new db[(_0xd239('0x6a'))][(_0xd239('0x87'))](_0xd239('0x8b'),0xcc);}if(_0x298e72[_0xd239('0x8c')]===_0xd239('0x8d')){return null;}var _0xb60a7f=_['merge'](_0x298e72,{'name':_0x298e72['fullPath']||_0x298e72[_0xd239('0x2b')]||_0x16d25f['name'],'basename':_0x1e76ab,'savename':util['format'](_0xd239('0x8e'),_0x298e72[_0xd239('0x2b')]||_0x16d25f[_0xd239('0x2b')],require(_0xd239('0x8f'))['generate'](0x4),_0x298e72[_0xd239('0x8c')]||_0xd239('0x90')),'reportId':_0x16d25f['id'],'reportType':'default'});return db[_0xd239('0x91')]['create'](_0xb60a7f,{'raw':!![]});})['then'](function(_0x3f76df){if(_0x16d25f[_0xd239('0x6f')]===_0xd239('0x92')){_0x55fa9d[_0xd239('0x3c')](_0x16d25f[_0xd239('0x6f')]+'.calldate\x20BETWEEN\x20?\x20AND\x20?',_0x298e72[_0xd239('0x93')],_0x298e72[_0xd239('0x94')]);}else{_0x55fa9d[_0xd239('0x3c')](_0x16d25f['table']+'.createdAt\x20BETWEEN\x20?\x20AND\x20?',_0x298e72[_0xd239('0x93')],_0x298e72[_0xd239('0x94')]);}if(_0x3f76df){logger[_0xd239('0x95')](_0xd239('0x96'),_0x55fa9d[_0xd239('0x7f')]());require(_0xd239('0x97'))[_0xd239('0x98')](path[_0xd239('0x51')](__dirname,'../../components/export/',_0x3f76df[_0xd239('0x8c')]),[_0x3f76df['id'],_0x55fa9d[_0xd239('0x7f')](),path[_0xd239('0x51')](__dirname,_0xd239('0x99'),_0x3f76df['savename']),_0x1e76ab]);return _0x3f76df;}else{var _0x471a44=squel['select']();_0x471a44[_0xd239('0x6e')]('('+_0x55fa9d[_0xd239('0x7f')]()+')','countTable');_0x471a44[_0xd239('0x67')]('COUNT(*)',_0xd239('0x1d'));_0x55fa9d[_0xd239('0x1f')](_0x298e72['limit']||_0x3865c7);_0x55fa9d[_0xd239('0x1e')](_0x298e72['offset']||0x0);return db[_0xd239('0x80')]['query'](_0x471a44[_0xd239('0x7f')](),{'type':db[_0xd239('0x80')]['QueryTypes'][_0xd239('0x82')]})[_0xd239('0x24')](function(_0x3fa919){if(!_0x3fa919[_0xd239('0x36')]){_0x198c26=0x0;}else{_0x198c26=_0x3fa919[0x0][_0xd239('0x1d')]||0x0;}return db[_0xd239('0x80')]['query'](_0x55fa9d[_0xd239('0x7f')](),{'type':db[_0xd239('0x80')]['QueryTypes'][_0xd239('0x82')]});})[_0xd239('0x24')](function(_0x2aaafb){return{'rows':_0x2aaafb||[],'count':_0x198c26};});}});}exports[_0xd239('0x9a')]=function(_0x5b85b9,_0x4af812){return runReport(_0x5b85b9[_0xd239('0x46')],_0x5b85b9[_0xd239('0x30')],_0x5b85b9[_0xd239('0x3f')])['then'](respondWithResult(_0x4af812,null))[_0xd239('0x44')](handleError(_0x4af812,null));};exports[_0xd239('0x9b')]=runReport;exports[_0xd239('0x30')]=function(_0x1add22,_0x5c8462){var _0x5b67c4=0xa;var _0x4f47ff=[_0xd239('0x51'),_0xd239('0x83'),_0xd239('0x52'),_0xd239('0x53')];var _0x1fbe76={'SUM':'SUM(%s)','COUNT':_0xd239('0x55'),'COUNT DISTINCT':_0xd239('0x56'),'MAX':_0xd239('0x57'),'MIN':_0xd239('0x58'),'AVG':_0xd239('0x59'),'GROUP_CONCAT':_0xd239('0x5a'),'GROUP_CONCAT ASC':_0xd239('0x5b'),'GROUP_CONCAT DESC':_0xd239('0x5c')};var _0x217b05={'SEC_TO_TIME':_0xd239('0x5d'),'DATE':_0xd239('0x84'),'HOUR':_0xd239('0x5e'),'ROUND':_0xd239('0x5f'),'UNIX_TIMESTAMP':'UNIX_TIMESTAMP(%s)'};var _0x1ea2a7=function(_0x4eb2bb){return!_[_0xd239('0x60')]([_0xd239('0x61'),'IS\x20NOT\x20NULL','IS\x20EMPTY',_0xd239('0x63')],_0x4eb2bb);};var _0x434dd1=function(_0x34adfc){if(!_0x34adfc||!_0x34adfc[_0xd239('0x64')]['length']){return'';}for(var _0x26d692='(',_0x27bf53=0x0;_0x27bf53<_0x34adfc['rules'][_0xd239('0x36')];_0x27bf53+=0x1){_0x27bf53>0x0&&(_0x26d692+='\x20'+_0x34adfc[_0xd239('0x65')]+'\x20');_0x26d692+=_0x34adfc['rules'][_0x27bf53]['group']?_0x434dd1(_0x34adfc[_0xd239('0x64')][_0x27bf53][_0xd239('0x66')]):_0x34adfc[_0xd239('0x64')][_0x27bf53][_0xd239('0x67')]+'\x20'+_0x34adfc['rules'][_0x27bf53][_0xd239('0x68')]+(_0x1ea2a7(_0x34adfc[_0xd239('0x64')][_0x27bf53][_0xd239('0x68')])?'\x20'+_0x34adfc[_0xd239('0x64')][_0x27bf53][_0xd239('0x9c')]:'');}return _0x26d692+')';};var _0x44f211={'where':{'id':_0x1add22[_0xd239('0x46')]['id']}},_0x9f55e4,_0x6fec37,_0x4ed3de,_0x5769d8,_0x50bd9e;_0x44f211=_[_0xd239('0x3d')]({},_0x44f211,_0x1add22[_0xd239('0x3f')]);return db[_0xd239('0x2c')]['find'](_0x44f211)[_0xd239('0x24')](function(_0x43f33c){if(_0x43f33c){_0x9f55e4=_0x43f33c;return _0x43f33c[_0xd239('0x69')]();}return null;})[_0xd239('0x24')](function(_0x580fb7){if(_0x580fb7){if(!_0x580fb7[_0xd239('0x36')]){throw new db[(_0xd239('0x6a'))]['ValidationErrorItem'](_0xd239('0x6b'),0x193);}_0x6fec37=_0x580fb7;return db[_0xd239('0x6c')][_0xd239('0x42')]({'raw':!![]});}return null;})[_0xd239('0x24')](function(_0x2ae004){if(_0x2ae004){_0x4ed3de=_['keyBy'](_0x2ae004,'id');var _0x1f434f;var _0x507a98=squel[_0xd239('0x9d')]();_0x507a98[_0xd239('0x6e')](_0x9f55e4[_0xd239('0x6f')]);for(var _0x251c17=0x0;_0x251c17<_0x6fec37['length'];_0x251c17+=0x1){_0x1f434f=_0x6fec37[_0x251c17][_0xd239('0x70')]?_0x4ed3de[_0x6fec37[_0x251c17]['MetricId']][_0xd239('0x71')]:_0x6fec37[_0x251c17]['field'];_0x1f434f=_0x6fec37[_0x251c17][_0xd239('0x72')]?_[_0xd239('0x73')](_0x1fbe76[_0x6fec37[_0x251c17][_0xd239('0x72')]],'%s',_0x1f434f):_0x1f434f;_0x1f434f=_0x6fec37[_0x251c17]['format']?_['replace'](_0x217b05[_0x6fec37[_0x251c17]['format']],'%s',_0x1f434f):_0x1f434f;if(_0x6fec37[_0x251c17][_0xd239('0x75')]){_0x507a98[_0xd239('0x66')](_0x1f434f);}_0x6fec37[_0x251c17][_0xd239('0x76')]&&_0x507a98['order'](_0x1f434f,_0x6fec37[_0x251c17][_0xd239('0x76')]===_0xd239('0x77')?![]:!![]);_0x507a98[_0xd239('0x67')](_0x1f434f,_0x6fec37[_0x251c17]['alias']||_0x1f434f);}if(_0x9f55e4[_0xd239('0x78')]){_0x9f55e4[_0xd239('0x78')]=JSON['parse'](_0x9f55e4[_0xd239('0x78')]);for(var _0x47758d=0x0;_0x47758d<_0x9f55e4['joins']['length'];_0x47758d+=0x1){if(_0x9f55e4[_0xd239('0x78')][_0x47758d][_0xd239('0x2e')]&&_[_0xd239('0x60')](_0x4f47ff,_0x9f55e4[_0xd239('0x78')][_0x47758d][_0xd239('0x2e')])&&_0x9f55e4[_0xd239('0x78')][_0x47758d]['parentKey']&&_0x9f55e4[_0xd239('0x78')][_0x47758d][_0xd239('0x7a')]&&_0x9f55e4[_0xd239('0x78')][_0x47758d][_0xd239('0x7b')]){_0x507a98[_0x9f55e4[_0xd239('0x78')][_0x47758d][_0xd239('0x2e')]](_0x9f55e4[_0xd239('0x78')][_0x47758d][_0xd239('0x7a')],null,util[_0xd239('0x74')]('%s.%s\x20=\x20%s.%s',_0x9f55e4[_0xd239('0x6f')],_0x9f55e4['joins'][_0x47758d][_0xd239('0x79')],_0x9f55e4['joins'][_0x47758d][_0xd239('0x7a')],_0x9f55e4[_0xd239('0x78')][_0x47758d][_0xd239('0x7b')]));}}}if(_0x9f55e4[_0xd239('0x7c')]){_0x9f55e4[_0xd239('0x7c')]=JSON[_0xd239('0x7d')](_0x9f55e4[_0xd239('0x7c')]);_0x507a98[_0xd239('0x3c')](_0x434dd1(_0x9f55e4[_0xd239('0x7c')]['group']));}_0x50bd9e=_0x507a98[_0xd239('0x8a')]();_0x507a98['limit'](_0x5b67c4);_0x507a98[_0xd239('0x1e')](0x0);logger['debug']('Limited\x20Query:',_0x507a98[_0xd239('0x7f')]());return db[_0xd239('0x80')]['query'](_0x507a98[_0xd239('0x7f')](),{'type':db['sequelize']['QueryTypes'][_0xd239('0x82')]});}})['then'](function(){return{'sql':_0x50bd9e[_0xd239('0x7f')]()};})[_0xd239('0x24')](respondWithResult(_0x5c8462,null))[_0xd239('0x44')](handleError(_0x5c8462,null));};
\ No newline at end of file
+var _0x2544=['eml-format','rimraf','zip-dir','fast-json-patch','moment','bluebird','path','to-csv','ejs','lodash','squel','crypto','jsforce','desk.js','querystring','papaparse','ioredis','../../components/auth/service','../../config/utils','../../config/environment','../../mysqldb','sendStatus','status','count','offset','limit','Content-Range','json','apply','reject','save','update','then','destroy','get','DefaultReports','UserProfileResource','end','error','stack','name','index','AnalyticDefaultReport','rawAttributes','fieldName','key','model','map','query','keys','filters','intersection','attributes','fields','length','hasOwnProperty','nolimit','order','sort','pick','filter','where','type','VIRTUAL','merge','options','includeAll','include','findAll','rows','catch','params','create','user','Unable\x20to\x20retrieve\x20the\x20current\x20user','Reports','UserProfileSection','find','autoAssociation','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','body','preview','join','left_join','right_join','cross_join','SUM(%s)','COUNT(%s)','COUNT(DISTINCT\x20%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)','ROUND(%s)','UNIX_TIMESTAMP(%s)','includes','IS\x20NULL','IS\x20NOT\x20NULL','IS\x20EMPTY','rules','operator','group','field','value','getFields','Sequelize','ValidationErrorItem','AnalyticMetric','keyBy','from','table','MetricId','function','replace','format','orderBy','DESC','alias','joins','parse','parentKey','foreignKey','foreignTable','conditions','debug','sequelize','toString','QueryTypes','SELECT','MAX(%s)','IS\x20NOT\x20EMPTY','condition','Please\x20insert\x20at\x20least\x20one\x20field','metric','groupBy','%s.%s\x20=\x20%s.%s','clone','Limited\x20Query:','No\x20available\x20data','web','fullPath','randomstring','generate','output','csv','cdr','endDate','.createdAt\x20BETWEEN\x20?\x20AND\x20?','startDate','info','Run\x20Query:','child_process','fork','../../components/export/','../../files/reports','savename','select','countTable','run','runReport'];(function(_0x2714ec,_0x36daa4){var _0x2608e5=function(_0x408468){while(--_0x408468){_0x2714ec['push'](_0x2714ec['shift']());}};_0x2608e5(++_0x36daa4);}(_0x2544,0x1ec));var _0x4254=function(_0x5bab1e,_0x22a4fe){_0x5bab1e=_0x5bab1e-0x0;var _0x247d24=_0x2544[_0x5bab1e];return _0x247d24;};'use strict';var pdf=require('html-pdf');var emlformat=require(_0x4254('0x0'));var rimraf=require(_0x4254('0x1'));var zipdir=require(_0x4254('0x2'));var jsonpatch=require(_0x4254('0x3'));var rp=require('request-promise');var moment=require(_0x4254('0x4'));var BPromise=require(_0x4254('0x5'));var Mustache=require('mustache');var util=require('util');var path=require(_0x4254('0x6'));var sox=require('sox');var csv=require(_0x4254('0x7'));var ejs=require(_0x4254('0x8'));var fs=require('fs');var _=require(_0x4254('0x9'));var squel=require(_0x4254('0xa'));var crypto=require(_0x4254('0xb'));var jsforce=require(_0x4254('0xc'));var deskjs=require(_0x4254('0xd'));var toCsv=require(_0x4254('0x7'));var querystring=require(_0x4254('0xe'));var Papa=require(_0x4254('0xf'));var Redis=require(_0x4254('0x10'));var authService=require(_0x4254('0x11'));var qs=require('../../components/parsers/qs');var as=require('../../components/parsers/advancedSearch');var hardwareService=require('../../config/license/hardware');var logger=require('../../config/logger')('api');var utils=require(_0x4254('0x12'));var config=require(_0x4254('0x13'));var db=require(_0x4254('0x14'))['db'];function respondWithStatusCode(_0x3ba6d2,_0x3ce95b){_0x3ce95b=_0x3ce95b||0xcc;return function(_0x52285a){if(_0x52285a){return _0x3ba6d2[_0x4254('0x15')](_0x3ce95b);}return _0x3ba6d2[_0x4254('0x16')](_0x3ce95b)['end']();};}function respondWithResult(_0x385e95,_0x164fd7){_0x164fd7=_0x164fd7||0xc8;return function(_0x48536e){if(_0x48536e){return _0x385e95[_0x4254('0x16')](_0x164fd7)['json'](_0x48536e);}};}function respondWithFilteredResult(_0x2f3d40,_0x5322c3){return function(_0x405664){if(_0x405664){var _0x47b816=_0x405664[_0x4254('0x17')],_0x466b84=_0x5322c3[_0x4254('0x18')],_0x56def8=_0x5322c3[_0x4254('0x18')]+_0x5322c3[_0x4254('0x19')],_0x4f3da2;if(_0x56def8>=_0x47b816){_0x56def8=_0x47b816;_0x4f3da2=0xc8;}else{_0x4f3da2=0xce;}_0x2f3d40[_0x4254('0x16')](_0x4f3da2);return _0x2f3d40['set'](_0x4254('0x1a'),_0x466b84+'-'+_0x56def8+'/'+_0x47b816)[_0x4254('0x1b')](_0x405664);}return null;};}function patchUpdates(_0x3075ce){return function(_0x5eb3d3){try{jsonpatch[_0x4254('0x1c')](_0x5eb3d3,_0x3075ce,!![]);}catch(_0x421a7a){return BPromise[_0x4254('0x1d')](_0x421a7a);}return _0x5eb3d3[_0x4254('0x1e')]();};}function saveUpdates(_0x554c2c,_0x5902e3){return function(_0x1c567b){if(_0x1c567b){return _0x1c567b[_0x4254('0x1f')](_0x554c2c)[_0x4254('0x20')](function(_0x412045){return _0x412045;});}return null;};}function removeEntity(_0xf3b761,_0x44e6a8){return function(_0x324bed){if(_0x324bed){return _0x324bed[_0x4254('0x21')]()['then'](function(){var _0x14c877=_0x324bed[_0x4254('0x22')]({'plain':!![]});var _0x57b862=_0x4254('0x23');return db[_0x4254('0x24')]['destroy']({'where':{'type':_0x57b862,'resourceId':_0x14c877['id']}})[_0x4254('0x20')](function(){return _0x324bed;});})[_0x4254('0x20')](function(){_0xf3b761[_0x4254('0x16')](0xcc)[_0x4254('0x25')]();});}};}function handleEntityNotFound(_0x102028,_0x29180a){return function(_0x45e6b8){if(!_0x45e6b8){_0x102028[_0x4254('0x15')](0x194);}return _0x45e6b8;};}function handleError(_0x545f70,_0x49fc90){_0x49fc90=_0x49fc90||0x1f4;return function(_0x2426be){logger[_0x4254('0x26')](_0x2426be[_0x4254('0x27')]);if(_0x2426be[_0x4254('0x28')]){delete _0x2426be[_0x4254('0x28')];}_0x545f70[_0x4254('0x16')](_0x49fc90)['send'](_0x2426be);};}exports[_0x4254('0x29')]=function(_0x1600cf,_0x14d55a){var _0x41f705={},_0x5d2fd0={},_0x3ba70c={'count':0x0,'rows':[]};var _0x4f3f41=_['map'](db[_0x4254('0x2a')][_0x4254('0x2b')],function(_0xca7803){return{'name':_0xca7803[_0x4254('0x2c')],'type':_0xca7803['type'][_0x4254('0x2d')]};});_0x5d2fd0[_0x4254('0x2e')]=_[_0x4254('0x2f')](_0x4f3f41,_0x4254('0x28'));_0x5d2fd0[_0x4254('0x30')]=_[_0x4254('0x31')](_0x1600cf[_0x4254('0x30')]);_0x5d2fd0[_0x4254('0x32')]=_[_0x4254('0x33')](_0x5d2fd0[_0x4254('0x2e')],_0x5d2fd0[_0x4254('0x30')]);_0x41f705[_0x4254('0x34')]=_[_0x4254('0x33')](_0x5d2fd0[_0x4254('0x2e')],qs[_0x4254('0x35')](_0x1600cf[_0x4254('0x30')][_0x4254('0x35')]));_0x41f705[_0x4254('0x34')]=_0x41f705[_0x4254('0x34')][_0x4254('0x36')]?_0x41f705[_0x4254('0x34')]:_0x5d2fd0[_0x4254('0x2e')];if(!_0x1600cf[_0x4254('0x30')][_0x4254('0x37')](_0x4254('0x38'))){_0x41f705[_0x4254('0x19')]=qs[_0x4254('0x19')](_0x1600cf[_0x4254('0x30')][_0x4254('0x19')]);_0x41f705[_0x4254('0x18')]=qs[_0x4254('0x18')](_0x1600cf[_0x4254('0x30')][_0x4254('0x18')]);}_0x41f705[_0x4254('0x39')]=qs[_0x4254('0x3a')](_0x1600cf[_0x4254('0x30')][_0x4254('0x3a')]);_0x41f705['where']=qs[_0x4254('0x32')](_[_0x4254('0x3b')](_0x1600cf['query'],_0x5d2fd0[_0x4254('0x32')]));if(_0x1600cf['query'][_0x4254('0x3c')]){_0x41f705[_0x4254('0x3d')]=_['merge'](_0x41f705[_0x4254('0x3d')],{'$or':_['map'](_0x4f3f41,function(_0x1330ea){if(_0x1330ea[_0x4254('0x3e')]!==_0x4254('0x3f')){var _0x3ac097={};_0x3ac097[_0x1330ea[_0x4254('0x28')]]={'$like':'%'+_0x1600cf['query'][_0x4254('0x3c')]+'%'};return _0x3ac097;}})});}_0x41f705=_[_0x4254('0x40')]({},_0x41f705,_0x1600cf[_0x4254('0x41')]);var _0xc6e36b={'where':_0x41f705[_0x4254('0x3d')]};return db['AnalyticDefaultReport'][_0x4254('0x17')](_0xc6e36b)['then'](function(_0x2e1e4a){_0x3ba70c['count']=_0x2e1e4a;if(_0x1600cf['query'][_0x4254('0x42')]){_0x41f705[_0x4254('0x43')]=[{'all':!![]}];}return db[_0x4254('0x2a')][_0x4254('0x44')](_0x41f705);})['then'](function(_0xa86c6b){_0x3ba70c[_0x4254('0x45')]=_0xa86c6b;return _0x3ba70c;})[_0x4254('0x20')](respondWithFilteredResult(_0x14d55a,_0x41f705))[_0x4254('0x46')](handleError(_0x14d55a,null));};exports['show']=function(_0x415f00,_0x59116f){var _0x4709b6={'raw':!![],'where':{'id':_0x415f00[_0x4254('0x47')]['id']}},_0x182ba5={};_0x182ba5[_0x4254('0x2e')]=_['keys'](db[_0x4254('0x2a')][_0x4254('0x2b')]);_0x182ba5[_0x4254('0x30')]=_[_0x4254('0x31')](_0x415f00[_0x4254('0x30')]);_0x182ba5[_0x4254('0x32')]=_[_0x4254('0x33')](_0x182ba5[_0x4254('0x2e')],_0x182ba5[_0x4254('0x30')]);_0x4709b6[_0x4254('0x34')]=_['intersection'](_0x182ba5['model'],qs[_0x4254('0x35')](_0x415f00[_0x4254('0x30')][_0x4254('0x35')]));_0x4709b6[_0x4254('0x34')]=_0x4709b6['attributes'][_0x4254('0x36')]?_0x4709b6[_0x4254('0x34')]:_0x182ba5[_0x4254('0x2e')];if(_0x415f00['query'][_0x4254('0x42')]){_0x4709b6[_0x4254('0x43')]=[{'all':!![]}];}_0x4709b6=_[_0x4254('0x40')]({},_0x4709b6,_0x415f00[_0x4254('0x41')]);return db[_0x4254('0x2a')]['find'](_0x4709b6)['then'](handleEntityNotFound(_0x59116f,null))[_0x4254('0x20')](respondWithResult(_0x59116f,null))[_0x4254('0x46')](handleError(_0x59116f,null));};exports['create']=function(_0x1a878a,_0x1b6865){return db[_0x4254('0x2a')][_0x4254('0x48')](_0x1a878a['body'],{})[_0x4254('0x20')](function(_0x2cc095){var _0x84836f=_0x1a878a[_0x4254('0x49')][_0x4254('0x22')]({'plain':!![]});if(!_0x84836f)throw new Error(_0x4254('0x4a'));if(_0x84836f['role']===_0x4254('0x49')){var _0x5abab3=_0x2cc095[_0x4254('0x22')]({'plain':!![]});var _0xc2a60c=_0x4254('0x4b');return db[_0x4254('0x4c')][_0x4254('0x4d')]({'where':{'name':_0xc2a60c,'userProfileId':_0x84836f['userProfileId']},'raw':!![]})['then'](function(_0xa35aff){if(_0xa35aff&&_0xa35aff[_0x4254('0x4e')]===0x0){return db[_0x4254('0x24')][_0x4254('0x48')]({'name':_0x5abab3[_0x4254('0x28')],'resourceId':_0x5abab3['id'],'type':'DefaultReports','sectionId':_0xa35aff['id']},{})[_0x4254('0x20')](function(){return _0x2cc095;});}else{return _0x2cc095;}})[_0x4254('0x46')](function(_0x1d8c43){logger[_0x4254('0x26')](_0x4254('0x4f'),_0x1d8c43);throw _0x1d8c43;});}return _0x2cc095;})[_0x4254('0x20')](respondWithResult(_0x1b6865,0xc9))[_0x4254('0x46')](handleError(_0x1b6865,null));};exports[_0x4254('0x1f')]=function(_0xe37cbb,_0x45803b){if(_0xe37cbb[_0x4254('0x50')]['id']){delete _0xe37cbb[_0x4254('0x50')]['id'];}return db['AnalyticDefaultReport'][_0x4254('0x4d')]({'where':{'id':_0xe37cbb['params']['id']}})[_0x4254('0x20')](handleEntityNotFound(_0x45803b,null))['then'](saveUpdates(_0xe37cbb[_0x4254('0x50')],null))[_0x4254('0x20')](respondWithResult(_0x45803b,null))[_0x4254('0x46')](handleError(_0x45803b,null));};exports[_0x4254('0x21')]=function(_0xe6d1a9,_0x4fe95f){return db[_0x4254('0x2a')]['find']({'where':{'id':_0xe6d1a9[_0x4254('0x47')]['id']}})[_0x4254('0x20')](handleEntityNotFound(_0x4fe95f,null))[_0x4254('0x20')](removeEntity(_0x4fe95f,null))['catch'](handleError(_0x4fe95f,null));};exports[_0x4254('0x51')]=function(_0x292836,_0x3c6ec7){var _0x2e434e=0xa;var _0x58b63f=[_0x4254('0x52'),_0x4254('0x53'),_0x4254('0x54'),_0x4254('0x55')];var _0x23869f={'SUM':_0x4254('0x56'),'COUNT':_0x4254('0x57'),'COUNT DISTINCT':_0x4254('0x58'),'MAX':'MAX(%s)','MIN':_0x4254('0x59'),'AVG':_0x4254('0x5a'),'GROUP_CONCAT':_0x4254('0x5b'),'GROUP_CONCAT ASC':_0x4254('0x5c'),'GROUP_CONCAT DESC':_0x4254('0x5d')};var _0x491877={'SEC_TO_TIME':_0x4254('0x5e'),'DATE':_0x4254('0x5f'),'HOUR':_0x4254('0x60'),'ROUND':_0x4254('0x61'),'UNIX_TIMESTAMP':_0x4254('0x62')};var _0x583be8=function(_0x4de594){return!_[_0x4254('0x63')]([_0x4254('0x64'),_0x4254('0x65'),_0x4254('0x66'),'IS\x20NOT\x20EMPTY'],_0x4de594);};var _0x1261e1=function(_0x5df5cc){if(!_0x5df5cc||!_0x5df5cc[_0x4254('0x67')]['length']){return'';}for(var _0x3fc1fb='(',_0x1e1c45=0x0;_0x1e1c45<_0x5df5cc[_0x4254('0x67')][_0x4254('0x36')];_0x1e1c45+=0x1){_0x1e1c45>0x0&&(_0x3fc1fb+='\x20'+_0x5df5cc[_0x4254('0x68')]+'\x20');_0x3fc1fb+=_0x5df5cc[_0x4254('0x67')][_0x1e1c45][_0x4254('0x69')]?_0x1261e1(_0x5df5cc[_0x4254('0x67')][_0x1e1c45][_0x4254('0x69')]):_0x5df5cc[_0x4254('0x67')][_0x1e1c45][_0x4254('0x6a')]+'\x20'+_0x5df5cc[_0x4254('0x67')][_0x1e1c45]['condition']+(_0x583be8(_0x5df5cc[_0x4254('0x67')][_0x1e1c45]['condition'])?'\x20'+_0x5df5cc[_0x4254('0x67')][_0x1e1c45][_0x4254('0x6b')]:'');}return _0x3fc1fb+')';};var _0x30c8cf={'where':{'id':_0x292836[_0x4254('0x47')]['id']}},_0x125490,_0x2039e0,_0x720c82,_0x5cdfe2,_0x5a660e;_0x30c8cf=_['merge']({},_0x30c8cf,_0x292836[_0x4254('0x41')]);return db[_0x4254('0x2a')][_0x4254('0x4d')](_0x30c8cf)['then'](function(_0x52af7f){if(_0x52af7f){_0x125490=_0x52af7f;return _0x52af7f[_0x4254('0x6c')]();}return null;})[_0x4254('0x20')](function(_0x186412){if(_0x186412){if(!_0x186412['length']){throw new db[(_0x4254('0x6d'))][(_0x4254('0x6e'))]('Please\x20insert\x20at\x20least\x20one\x20field',0x193);}_0x2039e0=_0x186412;return db[_0x4254('0x6f')][_0x4254('0x44')]({'raw':!![]});}return null;})[_0x4254('0x20')](function(_0x2bd957){if(_0x2bd957){_0x720c82=_[_0x4254('0x70')](_0x2bd957,'id');var _0x218474;var _0x2b6486=squel['select']();_0x2b6486[_0x4254('0x71')](_0x125490[_0x4254('0x72')]);for(var _0x266ad7=0x0;_0x266ad7<_0x2039e0[_0x4254('0x36')];_0x266ad7+=0x1){_0x218474=_0x2039e0[_0x266ad7][_0x4254('0x73')]?_0x720c82[_0x2039e0[_0x266ad7]['MetricId']]['metric']:_0x2039e0[_0x266ad7][_0x4254('0x6a')];_0x218474=_0x2039e0[_0x266ad7][_0x4254('0x74')]?_[_0x4254('0x75')](_0x23869f[_0x2039e0[_0x266ad7][_0x4254('0x74')]],'%s',_0x218474):_0x218474;_0x218474=_0x2039e0[_0x266ad7][_0x4254('0x76')]?_[_0x4254('0x75')](_0x491877[_0x2039e0[_0x266ad7][_0x4254('0x76')]],'%s',_0x218474):_0x218474;if(_0x2039e0[_0x266ad7]['groupBy']){_0x2b6486[_0x4254('0x69')](_0x218474);}_0x2039e0[_0x266ad7][_0x4254('0x77')]&&_0x2b6486[_0x4254('0x39')](_0x218474,_0x2039e0[_0x266ad7][_0x4254('0x77')]===_0x4254('0x78')?![]:!![]);_0x2b6486[_0x4254('0x6a')](_0x218474,_0x2039e0[_0x266ad7][_0x4254('0x79')]||_0x218474);}if(_0x125490[_0x4254('0x7a')]){_0x125490[_0x4254('0x7a')]=JSON[_0x4254('0x7b')](_0x125490['joins']);for(var _0x4be58e=0x0;_0x4be58e<_0x125490['joins'][_0x4254('0x36')];_0x4be58e+=0x1){if(_0x125490['joins'][_0x4be58e][_0x4254('0x3e')]&&_['includes'](_0x58b63f,_0x125490[_0x4254('0x7a')][_0x4be58e][_0x4254('0x3e')])&&_0x125490[_0x4254('0x7a')][_0x4be58e][_0x4254('0x7c')]&&_0x125490['joins'][_0x4be58e]['foreignTable']&&_0x125490[_0x4254('0x7a')][_0x4be58e][_0x4254('0x7d')]){_0x2b6486[_0x125490[_0x4254('0x7a')][_0x4be58e][_0x4254('0x3e')]](_0x125490['joins'][_0x4be58e][_0x4254('0x7e')],null,util[_0x4254('0x76')]('%s.%s\x20=\x20%s.%s',_0x125490[_0x4254('0x72')],_0x125490['joins'][_0x4be58e][_0x4254('0x7c')],_0x125490[_0x4254('0x7a')][_0x4be58e][_0x4254('0x7e')],_0x125490[_0x4254('0x7a')][_0x4be58e][_0x4254('0x7d')]));}}}if(_0x125490[_0x4254('0x7f')]){_0x125490['conditions']=JSON[_0x4254('0x7b')](_0x125490['conditions']);_0x2b6486[_0x4254('0x3d')](_0x1261e1(_0x125490[_0x4254('0x7f')]['group']));}_0x5a660e=_0x2b6486['clone']();_0x2b6486['limit'](_0x2e434e);_0x2b6486[_0x4254('0x18')](0x0);logger[_0x4254('0x80')]('Limited\x20Query:',_0x2b6486['toString']());return db[_0x4254('0x81')]['query'](_0x2b6486[_0x4254('0x82')](),{'type':db['sequelize'][_0x4254('0x83')][_0x4254('0x84')]});}})[_0x4254('0x20')](respondWithResult(_0x3c6ec7,null))[_0x4254('0x46')](handleError(_0x3c6ec7,null));};function runReport(_0x4a0f07,_0xdbaeef,_0x192a1f){var _0x34e279=_0xdbaeef[_0x4254('0x28')];var _0x5ebfba=0xa;var _0x48a478=[_0x4254('0x52'),_0x4254('0x53'),_0x4254('0x54'),_0x4254('0x55')];var _0x48449e={'SUM':_0x4254('0x56'),'COUNT':'COUNT(%s)','COUNT DISTINCT':'COUNT(DISTINCT\x20%s)','MAX':_0x4254('0x85'),'MIN':_0x4254('0x59'),'AVG':_0x4254('0x5a'),'GROUP_CONCAT':'GROUP_CONCAT(%s)','GROUP_CONCAT ASC':'GROUP_CONCAT(%s\x20ORDER\x20BY\x20%s\x20ASC)','GROUP_CONCAT DESC':_0x4254('0x5d')};var _0x1f2c5={'SEC_TO_TIME':_0x4254('0x5e'),'DATE':_0x4254('0x5f'),'HOUR':_0x4254('0x60'),'ROUND':'ROUND(%s)','UNIX_TIMESTAMP':_0x4254('0x62')};var _0xa3e33f=function(_0x22eef8){return!_['includes']([_0x4254('0x64'),_0x4254('0x65'),'IS\x20EMPTY',_0x4254('0x86')],_0x22eef8);};var _0x4a6d77=function(_0x4cf686){if(!_0x4cf686||!_0x4cf686['rules'][_0x4254('0x36')]){return'';}for(var _0x4a23aa='(',_0x134c3e=0x0;_0x134c3e<_0x4cf686['rules'][_0x4254('0x36')];_0x134c3e+=0x1){_0x134c3e>0x0&&(_0x4a23aa+='\x20'+_0x4cf686[_0x4254('0x68')]+'\x20');_0x4a23aa+=_0x4cf686[_0x4254('0x67')][_0x134c3e][_0x4254('0x69')]?_0x4a6d77(_0x4cf686['rules'][_0x134c3e][_0x4254('0x69')]):_0x4cf686['rules'][_0x134c3e][_0x4254('0x6a')]+'\x20'+_0x4cf686[_0x4254('0x67')][_0x134c3e][_0x4254('0x87')]+(_0xa3e33f(_0x4cf686[_0x4254('0x67')][_0x134c3e][_0x4254('0x87')])?'\x20'+_0x4cf686['rules'][_0x134c3e][_0x4254('0x6b')]:'');}return _0x4a23aa+')';};var _0x1eb1ac={'where':{'id':_0x4a0f07['id']}},_0x3b6743,_0x3e0730,_0x4a0107,_0x1fbb6b,_0x32a790;_0x1eb1ac=_['merge']({},_0x1eb1ac,_0x192a1f);return db[_0x4254('0x2a')][_0x4254('0x4d')](_0x1eb1ac)['then'](function(_0x1403a6){if(_0x1403a6){_0x3b6743=_0x1403a6;return _0x1403a6['getFields']();}return null;})[_0x4254('0x20')](function(_0x24d686){if(_0x24d686){if(!_0x24d686[_0x4254('0x36')]){throw new db['Sequelize'][(_0x4254('0x6e'))](_0x4254('0x88'),0x193);}_0x3e0730=_0x24d686;return db[_0x4254('0x6f')][_0x4254('0x44')]({'raw':!![]});}return null;})['then'](function(_0x434db3){if(_0x434db3){_0x4a0107=_[_0x4254('0x70')](_0x434db3,'id');var _0x2960a1;var _0x8d9e99=squel['select']();_0x8d9e99[_0x4254('0x71')](_0x3b6743[_0x4254('0x72')]);for(var _0xa22f3e=0x0;_0xa22f3e<_0x3e0730['length'];_0xa22f3e+=0x1){_0x2960a1=_0x3e0730[_0xa22f3e][_0x4254('0x73')]?_0x4a0107[_0x3e0730[_0xa22f3e][_0x4254('0x73')]][_0x4254('0x89')]:_0x3e0730[_0xa22f3e][_0x4254('0x6a')];_0x2960a1=_0x3e0730[_0xa22f3e][_0x4254('0x74')]?_[_0x4254('0x75')](_0x48449e[_0x3e0730[_0xa22f3e][_0x4254('0x74')]],'%s',_0x2960a1):_0x2960a1;_0x2960a1=_0x3e0730[_0xa22f3e][_0x4254('0x76')]?_['replace'](_0x1f2c5[_0x3e0730[_0xa22f3e]['format']],'%s',_0x2960a1):_0x2960a1;if(_0x3e0730[_0xa22f3e][_0x4254('0x8a')]){_0x8d9e99['group'](_0x2960a1);}_0x3e0730[_0xa22f3e][_0x4254('0x77')]&&_0x8d9e99[_0x4254('0x39')](_0x2960a1,_0x3e0730[_0xa22f3e]['orderBy']===_0x4254('0x78')?![]:!![]);_0x8d9e99[_0x4254('0x6a')](_0x2960a1,_0x3e0730[_0xa22f3e][_0x4254('0x79')]||_0x2960a1);}if(_0x3b6743[_0x4254('0x7a')]){_0x3b6743[_0x4254('0x7a')]=JSON[_0x4254('0x7b')](_0x3b6743[_0x4254('0x7a')]);for(var _0x22b153=0x0;_0x22b153<_0x3b6743[_0x4254('0x7a')]['length'];_0x22b153+=0x1){if(_0x3b6743[_0x4254('0x7a')][_0x22b153][_0x4254('0x3e')]&&_[_0x4254('0x63')](_0x48a478,_0x3b6743['joins'][_0x22b153][_0x4254('0x3e')])&&_0x3b6743[_0x4254('0x7a')][_0x22b153][_0x4254('0x7c')]&&_0x3b6743[_0x4254('0x7a')][_0x22b153][_0x4254('0x7e')]&&_0x3b6743['joins'][_0x22b153]['foreignKey']){_0x8d9e99[_0x3b6743[_0x4254('0x7a')][_0x22b153][_0x4254('0x3e')]](_0x3b6743[_0x4254('0x7a')][_0x22b153][_0x4254('0x7e')],null,util[_0x4254('0x76')](_0x4254('0x8b'),_0x3b6743[_0x4254('0x72')],_0x3b6743['joins'][_0x22b153][_0x4254('0x7c')],_0x3b6743['joins'][_0x22b153]['foreignTable'],_0x3b6743['joins'][_0x22b153][_0x4254('0x7d')]));}}}if(_0x3b6743[_0x4254('0x7f')]){_0x3b6743['conditions']=JSON[_0x4254('0x7b')](_0x3b6743[_0x4254('0x7f')]);_0x8d9e99[_0x4254('0x3d')](_0x4a6d77(_0x3b6743[_0x4254('0x7f')][_0x4254('0x69')]));}_0x32a790=_0x8d9e99[_0x4254('0x8c')]();_0x8d9e99[_0x4254('0x19')](_0x5ebfba);_0x8d9e99[_0x4254('0x18')](0x0);logger[_0x4254('0x80')](_0x4254('0x8d'),_0x8d9e99[_0x4254('0x82')]());return db[_0x4254('0x81')]['query'](_0x8d9e99['toString'](),{'type':db['sequelize'][_0x4254('0x83')][_0x4254('0x84')]});}})[_0x4254('0x20')](function(_0x37f047){if(!_0x37f047[_0x4254('0x36')]){throw new db['Sequelize'][(_0x4254('0x6e'))](_0x4254('0x8e'),0xcc);}if(_0xdbaeef['output']===_0x4254('0x8f')){return null;}var _0x4e1808=_[_0x4254('0x40')](_0xdbaeef,{'name':_0xdbaeef[_0x4254('0x90')]||_0xdbaeef[_0x4254('0x28')]||_0x3b6743[_0x4254('0x28')],'basename':_0x34e279,'savename':util[_0x4254('0x76')]('%s-%s.%s',_0xdbaeef[_0x4254('0x28')]||_0x3b6743[_0x4254('0x28')],require(_0x4254('0x91'))[_0x4254('0x92')](0x4),_0xdbaeef[_0x4254('0x93')]||_0x4254('0x94')),'reportId':_0x3b6743['id'],'reportType':'default'});return db['AnalyticExtractedReport']['create'](_0x4e1808,{'raw':!![]});})[_0x4254('0x20')](function(_0x1a7039){if(_0x3b6743[_0x4254('0x72')]===_0x4254('0x95')){_0x32a790[_0x4254('0x3d')](_0x3b6743['table']+'.calldate\x20BETWEEN\x20?\x20AND\x20?',_0xdbaeef['startDate'],_0xdbaeef[_0x4254('0x96')]);}else{_0x32a790[_0x4254('0x3d')](_0x3b6743[_0x4254('0x72')]+_0x4254('0x97'),_0xdbaeef[_0x4254('0x98')],_0xdbaeef[_0x4254('0x96')]);}if(_0x1a7039){logger[_0x4254('0x99')](_0x4254('0x9a'),_0x32a790['toString']());require(_0x4254('0x9b'))[_0x4254('0x9c')](path[_0x4254('0x52')](__dirname,_0x4254('0x9d'),_0x1a7039[_0x4254('0x93')]),[_0x1a7039['id'],_0x32a790[_0x4254('0x82')](),path[_0x4254('0x52')](__dirname,_0x4254('0x9e'),_0x1a7039[_0x4254('0x9f')]),_0x34e279]);return _0x1a7039;}else{var _0x4ce011=squel[_0x4254('0xa0')]();_0x4ce011[_0x4254('0x71')]('('+_0x32a790[_0x4254('0x82')]()+')',_0x4254('0xa1'));_0x4ce011[_0x4254('0x6a')]('COUNT(*)',_0x4254('0x17'));_0x32a790['limit'](_0xdbaeef[_0x4254('0x19')]||_0x5ebfba);_0x32a790[_0x4254('0x18')](_0xdbaeef[_0x4254('0x18')]||0x0);return db[_0x4254('0x81')][_0x4254('0x30')](_0x4ce011['toString'](),{'type':db['sequelize'][_0x4254('0x83')][_0x4254('0x84')]})[_0x4254('0x20')](function(_0x32d219){if(!_0x32d219[_0x4254('0x36')]){_0x1fbb6b=0x0;}else{_0x1fbb6b=_0x32d219[0x0]['count']||0x0;}return db[_0x4254('0x81')][_0x4254('0x30')](_0x32a790[_0x4254('0x82')](),{'type':db[_0x4254('0x81')][_0x4254('0x83')][_0x4254('0x84')]});})[_0x4254('0x20')](function(_0x59be00){return{'rows':_0x59be00||[],'count':_0x1fbb6b};});}});}exports[_0x4254('0xa2')]=function(_0x2c1612,_0x799fe1){return runReport(_0x2c1612[_0x4254('0x47')],_0x2c1612[_0x4254('0x30')],_0x2c1612[_0x4254('0x41')])[_0x4254('0x20')](respondWithResult(_0x799fe1,null))[_0x4254('0x46')](handleError(_0x799fe1,null));};exports[_0x4254('0xa3')]=runReport;exports[_0x4254('0x30')]=function(_0x5700aa,_0x1a327c){var _0x5e174d=0xa;var _0xd8634c=[_0x4254('0x52'),'left_join',_0x4254('0x54'),_0x4254('0x55')];var _0x354b1d={'SUM':'SUM(%s)','COUNT':'COUNT(%s)','COUNT DISTINCT':'COUNT(DISTINCT\x20%s)','MAX':_0x4254('0x85'),'MIN':_0x4254('0x59'),'AVG':_0x4254('0x5a'),'GROUP_CONCAT':'GROUP_CONCAT(%s)','GROUP_CONCAT ASC':_0x4254('0x5c'),'GROUP_CONCAT DESC':_0x4254('0x5d')};var _0x1a1a33={'SEC_TO_TIME':_0x4254('0x5e'),'DATE':'DATE(%s)','HOUR':_0x4254('0x60'),'ROUND':'ROUND(%s)','UNIX_TIMESTAMP':_0x4254('0x62')};var _0x546e38=function(_0x4efbdb){return!_['includes']([_0x4254('0x64'),_0x4254('0x65'),_0x4254('0x66'),'IS\x20NOT\x20EMPTY'],_0x4efbdb);};var _0x28c5e6=function(_0x5937e7){if(!_0x5937e7||!_0x5937e7[_0x4254('0x67')]['length']){return'';}for(var _0x4c5ca5='(',_0x126282=0x0;_0x126282<_0x5937e7[_0x4254('0x67')][_0x4254('0x36')];_0x126282+=0x1){_0x126282>0x0&&(_0x4c5ca5+='\x20'+_0x5937e7['operator']+'\x20');_0x4c5ca5+=_0x5937e7[_0x4254('0x67')][_0x126282][_0x4254('0x69')]?_0x28c5e6(_0x5937e7['rules'][_0x126282]['group']):_0x5937e7[_0x4254('0x67')][_0x126282]['field']+'\x20'+_0x5937e7[_0x4254('0x67')][_0x126282][_0x4254('0x87')]+(_0x546e38(_0x5937e7[_0x4254('0x67')][_0x126282]['condition'])?'\x20'+_0x5937e7[_0x4254('0x67')][_0x126282][_0x4254('0x6b')]:'');}return _0x4c5ca5+')';};var _0x47359e={'where':{'id':_0x5700aa[_0x4254('0x47')]['id']}},_0x4e2cae,_0x518ceb,_0x228d06,_0x33ec05,_0x1329a5;_0x47359e=_[_0x4254('0x40')]({},_0x47359e,_0x5700aa['options']);return db[_0x4254('0x2a')][_0x4254('0x4d')](_0x47359e)[_0x4254('0x20')](function(_0x1c423b){if(_0x1c423b){_0x4e2cae=_0x1c423b;return _0x1c423b[_0x4254('0x6c')]();}return null;})[_0x4254('0x20')](function(_0x242dcd){if(_0x242dcd){if(!_0x242dcd['length']){throw new db[(_0x4254('0x6d'))]['ValidationErrorItem'](_0x4254('0x88'),0x193);}_0x518ceb=_0x242dcd;return db[_0x4254('0x6f')][_0x4254('0x44')]({'raw':!![]});}return null;})[_0x4254('0x20')](function(_0x2735d7){if(_0x2735d7){_0x228d06=_[_0x4254('0x70')](_0x2735d7,'id');var _0x53a792;var _0xbf2f2e=squel[_0x4254('0xa0')]();_0xbf2f2e[_0x4254('0x71')](_0x4e2cae['table']);for(var _0x1a40e3=0x0;_0x1a40e3<_0x518ceb[_0x4254('0x36')];_0x1a40e3+=0x1){_0x53a792=_0x518ceb[_0x1a40e3][_0x4254('0x73')]?_0x228d06[_0x518ceb[_0x1a40e3][_0x4254('0x73')]]['metric']:_0x518ceb[_0x1a40e3][_0x4254('0x6a')];_0x53a792=_0x518ceb[_0x1a40e3]['function']?_['replace'](_0x354b1d[_0x518ceb[_0x1a40e3]['function']],'%s',_0x53a792):_0x53a792;_0x53a792=_0x518ceb[_0x1a40e3]['format']?_[_0x4254('0x75')](_0x1a1a33[_0x518ceb[_0x1a40e3][_0x4254('0x76')]],'%s',_0x53a792):_0x53a792;if(_0x518ceb[_0x1a40e3][_0x4254('0x8a')]){_0xbf2f2e[_0x4254('0x69')](_0x53a792);}_0x518ceb[_0x1a40e3][_0x4254('0x77')]&&_0xbf2f2e['order'](_0x53a792,_0x518ceb[_0x1a40e3][_0x4254('0x77')]===_0x4254('0x78')?![]:!![]);_0xbf2f2e[_0x4254('0x6a')](_0x53a792,_0x518ceb[_0x1a40e3][_0x4254('0x79')]||_0x53a792);}if(_0x4e2cae['joins']){_0x4e2cae[_0x4254('0x7a')]=JSON[_0x4254('0x7b')](_0x4e2cae[_0x4254('0x7a')]);for(var _0x5e5794=0x0;_0x5e5794<_0x4e2cae[_0x4254('0x7a')][_0x4254('0x36')];_0x5e5794+=0x1){if(_0x4e2cae[_0x4254('0x7a')][_0x5e5794]['type']&&_['includes'](_0xd8634c,_0x4e2cae['joins'][_0x5e5794][_0x4254('0x3e')])&&_0x4e2cae['joins'][_0x5e5794][_0x4254('0x7c')]&&_0x4e2cae['joins'][_0x5e5794][_0x4254('0x7e')]&&_0x4e2cae[_0x4254('0x7a')][_0x5e5794]['foreignKey']){_0xbf2f2e[_0x4e2cae[_0x4254('0x7a')][_0x5e5794][_0x4254('0x3e')]](_0x4e2cae[_0x4254('0x7a')][_0x5e5794][_0x4254('0x7e')],null,util[_0x4254('0x76')](_0x4254('0x8b'),_0x4e2cae[_0x4254('0x72')],_0x4e2cae['joins'][_0x5e5794][_0x4254('0x7c')],_0x4e2cae[_0x4254('0x7a')][_0x5e5794][_0x4254('0x7e')],_0x4e2cae['joins'][_0x5e5794]['foreignKey']));}}}if(_0x4e2cae[_0x4254('0x7f')]){_0x4e2cae['conditions']=JSON['parse'](_0x4e2cae[_0x4254('0x7f')]);_0xbf2f2e['where'](_0x28c5e6(_0x4e2cae['conditions']['group']));}_0x1329a5=_0xbf2f2e[_0x4254('0x8c')]();_0xbf2f2e['limit'](_0x5e174d);_0xbf2f2e[_0x4254('0x18')](0x0);logger[_0x4254('0x80')](_0x4254('0x8d'),_0xbf2f2e[_0x4254('0x82')]());return db['sequelize']['query'](_0xbf2f2e[_0x4254('0x82')](),{'type':db['sequelize'][_0x4254('0x83')]['SELECT']});}})[_0x4254('0x20')](function(){return{'sql':_0x1329a5[_0x4254('0x82')]()};})[_0x4254('0x20')](respondWithResult(_0x1a327c,null))[_0x4254('0x46')](handleError(_0x1a327c,null));};
\ No newline at end of file
diff --git a/server/api/analyticDefaultReport/analyticDefaultReport.model.js b/server/api/analyticDefaultReport/analyticDefaultReport.model.js
index 5728aca..7f75288 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 _0xd594=['request-promise','rimraf','../../config/environment','./analyticDefaultReport.attributes','define','AnalyticDefaultReport','lodash','util','../../config/logger','moment','bluebird'];(function(_0x325398,_0x5caf8b){var _0x43df61=function(_0x390349){while(--_0x390349){_0x325398['push'](_0x325398['shift']());}};_0x43df61(++_0x5caf8b);}(_0xd594,0xab));var _0x4d59=function(_0xf3cd4e,_0x6abb0){_0xf3cd4e=_0xf3cd4e-0x0;var _0x4a4b2f=_0xd594[_0xf3cd4e];return _0x4a4b2f;};'use strict';var _=require(_0x4d59('0x0'));var util=require(_0x4d59('0x1'));var logger=require(_0x4d59('0x2'))('api');var moment=require(_0x4d59('0x3'));var BPromise=require(_0x4d59('0x4'));var rp=require(_0x4d59('0x5'));var fs=require('fs');var path=require('path');var rimraf=require(_0x4d59('0x6'));var config=require(_0x4d59('0x7'));var attributes=require(_0x4d59('0x8'));module['exports']=function(_0x449634,_0x20433b){return _0x449634[_0x4d59('0x9')](_0x4d59('0xa'),attributes,{'tableName':'analytics_default_reports','paranoid':![],'indexes':[],'timestamps':!![]});};
\ No newline at end of file
+var _0x34f8=['AnalyticDefaultReport','lodash','util','api','moment','bluebird','path','rimraf','../../config/environment','./analyticDefaultReport.attributes','define'];(function(_0x465a0c,_0x19d4d5){var _0x1e202e=function(_0x27bd8a){while(--_0x27bd8a){_0x465a0c['push'](_0x465a0c['shift']());}};_0x1e202e(++_0x19d4d5);}(_0x34f8,0xbc));var _0x834f=function(_0x1593d4,_0xbe2cc3){_0x1593d4=_0x1593d4-0x0;var _0x17eee6=_0x34f8[_0x1593d4];return _0x17eee6;};'use strict';var _=require(_0x834f('0x0'));var util=require(_0x834f('0x1'));var logger=require('../../config/logger')(_0x834f('0x2'));var moment=require(_0x834f('0x3'));var BPromise=require(_0x834f('0x4'));var rp=require('request-promise');var fs=require('fs');var path=require(_0x834f('0x5'));var rimraf=require(_0x834f('0x6'));var config=require(_0x834f('0x7'));var attributes=require(_0x834f('0x8'));module['exports']=function(_0x197f0f,_0x3b9639){return _0x197f0f[_0x834f('0x9')](_0x834f('0xa'),attributes,{'tableName':'analytics_default_reports','paranoid':![],'indexes':[],'timestamps':!![]});};
\ No newline at end of file
diff --git a/server/api/analyticDefaultReport/analyticDefaultReport.rpc.js b/server/api/analyticDefaultReport/analyticDefaultReport.rpc.js
index 1240a98..9220867 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 _0x0db9=['code','message','catch','lodash','randomstring','ioredis','../../config/utils','rpc','../../config/environment','client','http','request','then','info','AnalyticDefaultReport,\x20%s,\x20%s','request\x20sent','debug','AnalyticDefaultReport,\x20%s,\x20%s,\x20%s','stringify','error'];(function(_0x5883b7,_0x289033){var _0x1169ab=function(_0x1e6674){while(--_0x1e6674){_0x5883b7['push'](_0x5883b7['shift']());}};_0x1169ab(++_0x289033);}(_0x0db9,0xa3));var _0x90db=function(_0x1b02bb,_0x3d9fde){_0x1b02bb=_0x1b02bb-0x0;var _0x131245=_0x0db9[_0x1b02bb];return _0x131245;};'use strict';var _=require(_0x90db('0x0'));var util=require('util');var moment=require('moment');var BPromise=require('bluebird');var rs=require(_0x90db('0x1'));var fs=require('fs');var Redis=require(_0x90db('0x2'));var db=require('../../mysqldb')['db'];var utils=require(_0x90db('0x3'));var logger=require('../../config/logger')(_0x90db('0x4'));var config=require(_0x90db('0x5'));var jayson=require('jayson/promise');var client=jayson[_0x90db('0x6')][_0x90db('0x7')]({'port':0x232a});function respondWithRpcPromise(_0x476491,_0xee21f8,_0x915ca){return new BPromise(function(_0x9b6d0d,_0x4b0c1d){return client[_0x90db('0x8')](_0x476491,_0x915ca)[_0x90db('0x9')](function(_0x39512e){logger[_0x90db('0xa')](_0x90db('0xb'),_0xee21f8,_0x90db('0xc'));logger[_0x90db('0xd')](_0x90db('0xe'),_0xee21f8,_0x90db('0xc'),JSON[_0x90db('0xf')](_0x39512e));if(_0x39512e[_0x90db('0x10')]){if(_0x39512e['error'][_0x90db('0x11')]===0x1f4){logger[_0x90db('0x10')](_0x90db('0xb'),_0xee21f8,_0x39512e[_0x90db('0x10')][_0x90db('0x12')]);return _0x4b0c1d(_0x39512e[_0x90db('0x10')][_0x90db('0x12')]);}logger[_0x90db('0x10')](_0x90db('0xb'),_0xee21f8,_0x39512e[_0x90db('0x10')][_0x90db('0x12')]);return _0x9b6d0d(_0x39512e[_0x90db('0x10')][_0x90db('0x12')]);}else{logger[_0x90db('0xa')]('AnalyticDefaultReport,\x20%s,\x20%s',_0xee21f8,_0x90db('0xc'));_0x9b6d0d(_0x39512e['result'][_0x90db('0x12')]);}})[_0x90db('0x13')](function(_0x3de860){logger[_0x90db('0x10')](_0x90db('0xb'),_0xee21f8,_0x3de860);_0x4b0c1d(_0x3de860);});});}
\ No newline at end of file
+var _0xa9e0=['http','info','AnalyticDefaultReport,\x20%s,\x20%s','request\x20sent','debug','AnalyticDefaultReport,\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(_0x610713,_0x27c846){var _0x2cf7c3=function(_0x25b3c5){while(--_0x25b3c5){_0x610713['push'](_0x610713['shift']());}};_0x2cf7c3(++_0x27c846);}(_0xa9e0,0x123));var _0x0a9e=function(_0x29b609,_0x19d388){_0x29b609=_0x29b609-0x0;var _0x54c952=_0xa9e0[_0x29b609];return _0x54c952;};'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/analyticDefaultReport/index.js b/server/api/analyticDefaultReport/index.js
index e57141b..a27ec74 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 _0x6b90=['multer','util','path','connect-timeout','express','../../components/auth/service','../../components/interaction/service','../../config/environment','./analyticDefaultReport.controller','isAuthenticated','index','get','/:id','show','/:id/preview','preview','/:id/query','query','post','create','put','delete','destroy','exports'];(function(_0x5d92d2,_0x399d73){var _0x5e6d11=function(_0x5029a2){while(--_0x5029a2){_0x5d92d2['push'](_0x5d92d2['shift']());}};_0x5e6d11(++_0x399d73);}(_0x6b90,0xf0));var _0x06b9=function(_0x5c9f2d,_0xeee094){_0x5c9f2d=_0x5c9f2d-0x0;var _0x4007f0=_0x6b90[_0x5c9f2d];return _0x4007f0;};'use strict';var multer=require(_0x06b9('0x0'));var util=require(_0x06b9('0x1'));var path=require(_0x06b9('0x2'));var timeout=require(_0x06b9('0x3'));var express=require(_0x06b9('0x4'));var router=express['Router']();var auth=require(_0x06b9('0x5'));var interaction=require(_0x06b9('0x6'));var config=require(_0x06b9('0x7'));var controller=require(_0x06b9('0x8'));router['get']('/',auth[_0x06b9('0x9')](),controller[_0x06b9('0xa')]);router[_0x06b9('0xb')](_0x06b9('0xc'),auth[_0x06b9('0x9')](),controller[_0x06b9('0xd')]);router[_0x06b9('0xb')](_0x06b9('0xe'),auth[_0x06b9('0x9')](),controller[_0x06b9('0xf')]);router[_0x06b9('0xb')]('/:id/run',auth[_0x06b9('0x9')](),controller['run']);router[_0x06b9('0xb')](_0x06b9('0x10'),auth['isAuthenticated'](),controller[_0x06b9('0x11')]);router[_0x06b9('0x12')]('/',auth[_0x06b9('0x9')](),controller[_0x06b9('0x13')]);router[_0x06b9('0x14')](_0x06b9('0xc'),auth['isAuthenticated'](),controller['update']);router[_0x06b9('0x15')](_0x06b9('0xc'),auth[_0x06b9('0x9')](),controller[_0x06b9('0x16')]);module[_0x06b9('0x17')]=router;
\ No newline at end of file
+var _0xb793=['show','/:id/run','run','/:id/query','post','create','update','delete','destroy','multer','util','connect-timeout','express','Router','../../components/interaction/service','../../config/environment','./analyticDefaultReport.controller','get','index','/:id','isAuthenticated'];(function(_0x321bb2,_0x202794){var _0x9c12ed=function(_0x263dd3){while(--_0x263dd3){_0x321bb2['push'](_0x321bb2['shift']());}};_0x9c12ed(++_0x202794);}(_0xb793,0x72));var _0x3b79=function(_0x2523cd,_0x4b86df){_0x2523cd=_0x2523cd-0x0;var _0x702a0a=_0xb793[_0x2523cd];return _0x702a0a;};'use strict';var multer=require(_0x3b79('0x0'));var util=require(_0x3b79('0x1'));var path=require('path');var timeout=require(_0x3b79('0x2'));var express=require(_0x3b79('0x3'));var router=express[_0x3b79('0x4')]();var auth=require('../../components/auth/service');var interaction=require(_0x3b79('0x5'));var config=require(_0x3b79('0x6'));var controller=require(_0x3b79('0x7'));router[_0x3b79('0x8')]('/',auth['isAuthenticated'](),controller[_0x3b79('0x9')]);router[_0x3b79('0x8')](_0x3b79('0xa'),auth[_0x3b79('0xb')](),controller[_0x3b79('0xc')]);router[_0x3b79('0x8')]('/:id/preview',auth['isAuthenticated'](),controller['preview']);router['get'](_0x3b79('0xd'),auth['isAuthenticated'](),controller[_0x3b79('0xe')]);router[_0x3b79('0x8')](_0x3b79('0xf'),auth['isAuthenticated'](),controller['query']);router[_0x3b79('0x10')]('/',auth[_0x3b79('0xb')](),controller[_0x3b79('0x11')]);router['put'](_0x3b79('0xa'),auth[_0x3b79('0xb')](),controller[_0x3b79('0x12')]);router[_0x3b79('0x13')](_0x3b79('0xa'),auth['isAuthenticated'](),controller[_0x3b79('0x14')]);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 6de639f..0598ad7 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 _0x4559=['manual','UNSIGNED','sequelize','moment','STRING','ENUM','csv','pdf','xlsx','DATE','Loading'];(function(_0x111494,_0x1d73da){var _0x1d0d8b=function(_0x344935){while(--_0x344935){_0x111494['push'](_0x111494['shift']());}};_0x1d0d8b(++_0x1d73da);}(_0x4559,0x9c));var _0x9455=function(_0x3072ee,_0x40b136){_0x3072ee=_0x3072ee-0x0;var _0x47041d=_0x4559[_0x3072ee];return _0x47041d;};'use strict';var Sequelize=require(_0x9455('0x0'));var moment=require(_0x9455('0x1'));module['exports']={'name':{'type':Sequelize['STRING'],'allowNull':![]},'basename':{'type':Sequelize[_0x9455('0x2')],'allowNull':![]},'output':{'type':Sequelize[_0x9455('0x3')](_0x9455('0x4'),_0x9455('0x5'),_0x9455('0x6')),'allowNull':![],'defaultValue':_0x9455('0x4')},'savename':{'type':Sequelize['STRING'],'allowNull':![]},'startDate':{'type':Sequelize[_0x9455('0x7')]},'endDate':{'type':Sequelize[_0x9455('0x7')]},'status':{'type':Sequelize['STRING'],'defaultValue':_0x9455('0x8')},'type':{'type':Sequelize['ENUM'](_0x9455('0x9'),'scheduled'),'allowNull':![],'defaultValue':'manual'},'reportId':{'type':Sequelize['INTEGER'](0xb)[_0x9455('0xa')]},'reportType':{'type':Sequelize[_0x9455('0x2')]}};
\ No newline at end of file
+var _0x3f57=['pdf','DATE','Loading','manual','scheduled','INTEGER','sequelize','moment','exports','STRING','ENUM','csv'];(function(_0xbb3b35,_0x26a7f5){var _0x512d06=function(_0x812115){while(--_0x812115){_0xbb3b35['push'](_0xbb3b35['shift']());}};_0x512d06(++_0x26a7f5);}(_0x3f57,0x1da));var _0x73f5=function(_0x27d244,_0x4c1830){_0x27d244=_0x27d244-0x0;var _0x45fdc7=_0x3f57[_0x27d244];return _0x45fdc7;};'use strict';var Sequelize=require(_0x73f5('0x0'));var moment=require(_0x73f5('0x1'));module[_0x73f5('0x2')]={'name':{'type':Sequelize[_0x73f5('0x3')],'allowNull':![]},'basename':{'type':Sequelize[_0x73f5('0x3')],'allowNull':![]},'output':{'type':Sequelize[_0x73f5('0x4')](_0x73f5('0x5'),_0x73f5('0x6'),'xlsx'),'allowNull':![],'defaultValue':'csv'},'savename':{'type':Sequelize[_0x73f5('0x3')],'allowNull':![]},'startDate':{'type':Sequelize[_0x73f5('0x7')]},'endDate':{'type':Sequelize[_0x73f5('0x7')]},'status':{'type':Sequelize[_0x73f5('0x3')],'defaultValue':_0x73f5('0x8')},'type':{'type':Sequelize[_0x73f5('0x4')](_0x73f5('0x9'),_0x73f5('0xa')),'allowNull':![],'defaultValue':_0x73f5('0x9')},'reportId':{'type':Sequelize[_0x73f5('0xb')](0xb)['UNSIGNED']},'reportType':{'type':Sequelize[_0x73f5('0x3')]}};
\ No newline at end of file
diff --git a/server/api/analyticExtractedReport/analyticExtractedReport.controller.js b/server/api/analyticExtractedReport/analyticExtractedReport.controller.js
index 74cbd0b..49dc359 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 _0xe7c0=['download','format','%s.%s','toLowerCase','eml-format','rimraf','fast-json-patch','request-promise','moment','bluebird','mustache','util','sox','to-csv','ejs','lodash','squel','jsforce','papaparse','../../components/auth/service','../../components/parsers/advancedSearch','../../config/logger','api','../../config/utils','../../config/environment','../../mysqldb','sendStatus','end','json','count','limit','status','set','Content-Range','apply','reject','save','then','destroy','UserProfileResource','name','map','rawAttributes','fieldName','type','key','query','keys','filters','model','attributes','fields','hasOwnProperty','nolimit','offset','order','sort','where','pick','merge','VIRTUAL','options','includeAll','AnalyticExtractedReport','findAll','rows','catch','show','params','intersection','length','find','create','body','user','get','Unable\x20to\x20retrieve\x20the\x20current\x20user','role','ExtractedReports','userProfileId','autoAssociation','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','update','basename','output','existsSync','root','server/files/reports','savename','Sequelize','Report\x20not\x20found\x20or\x20empty','exists'];(function(_0xf283b6,_0x331311){var _0x16ed9d=function(_0x72a349){while(--_0x72a349){_0xf283b6['push'](_0xf283b6['shift']());}};_0x16ed9d(++_0x331311);}(_0xe7c0,0x118));var _0x0e7c=function(_0x37bed5,_0x4fcea4){_0x37bed5=_0x37bed5-0x0;var _0xfd86c3=_0xe7c0[_0x37bed5];return _0xfd86c3;};'use strict';var pdf=require('html-pdf');var emlformat=require(_0x0e7c('0x0'));var rimraf=require(_0x0e7c('0x1'));var zipdir=require('zip-dir');var jsonpatch=require(_0x0e7c('0x2'));var rp=require(_0x0e7c('0x3'));var moment=require(_0x0e7c('0x4'));var BPromise=require(_0x0e7c('0x5'));var Mustache=require(_0x0e7c('0x6'));var util=require(_0x0e7c('0x7'));var path=require('path');var sox=require(_0x0e7c('0x8'));var csv=require(_0x0e7c('0x9'));var ejs=require(_0x0e7c('0xa'));var fs=require('fs');var _=require(_0x0e7c('0xb'));var squel=require(_0x0e7c('0xc'));var crypto=require('crypto');var jsforce=require(_0x0e7c('0xd'));var deskjs=require('desk.js');var toCsv=require(_0x0e7c('0x9'));var querystring=require('querystring');var Papa=require(_0x0e7c('0xe'));var Redis=require('ioredis');var authService=require(_0x0e7c('0xf'));var qs=require('../../components/parsers/qs');var as=require(_0x0e7c('0x10'));var hardwareService=require('../../config/license/hardware');var logger=require(_0x0e7c('0x11'))(_0x0e7c('0x12'));var utils=require(_0x0e7c('0x13'));var config=require(_0x0e7c('0x14'));var db=require(_0x0e7c('0x15'))['db'];function respondWithStatusCode(_0x58e3b0,_0x3a6cde){_0x3a6cde=_0x3a6cde||0xcc;return function(_0xe0b498){if(_0xe0b498){return _0x58e3b0[_0x0e7c('0x16')](_0x3a6cde);}return _0x58e3b0['status'](_0x3a6cde)[_0x0e7c('0x17')]();};}function respondWithResult(_0x41c034,_0x2983fb){_0x2983fb=_0x2983fb||0xc8;return function(_0x151781){if(_0x151781){return _0x41c034['status'](_0x2983fb)[_0x0e7c('0x18')](_0x151781);}};}function respondWithFilteredResult(_0x3f105b,_0x14caad){return function(_0x542224){if(_0x542224){var _0x1ab378=_0x542224[_0x0e7c('0x19')],_0x32c89d=_0x14caad['offset'],_0x456233=_0x14caad['offset']+_0x14caad[_0x0e7c('0x1a')],_0x5ab80b;if(_0x456233>=_0x1ab378){_0x456233=_0x1ab378;_0x5ab80b=0xc8;}else{_0x5ab80b=0xce;}_0x3f105b[_0x0e7c('0x1b')](_0x5ab80b);return _0x3f105b[_0x0e7c('0x1c')](_0x0e7c('0x1d'),_0x32c89d+'-'+_0x456233+'/'+_0x1ab378)[_0x0e7c('0x18')](_0x542224);}return null;};}function patchUpdates(_0x597576){return function(_0x29812b){try{jsonpatch[_0x0e7c('0x1e')](_0x29812b,_0x597576,!![]);}catch(_0x5af07a){return BPromise[_0x0e7c('0x1f')](_0x5af07a);}return _0x29812b[_0x0e7c('0x20')]();};}function saveUpdates(_0x28cbc5,_0x2ccd73){return function(_0x58907c){if(_0x58907c){return _0x58907c['update'](_0x28cbc5)[_0x0e7c('0x21')](function(_0x351135){return _0x351135;});}return null;};}function removeEntity(_0x5b56e8,_0x51de0d){return function(_0x2167a1){if(_0x2167a1){return _0x2167a1[_0x0e7c('0x22')]()[_0x0e7c('0x21')](function(){var _0x34eab2=_0x2167a1['get']({'plain':!![]});var _0x20b228='ExtractedReports';return db[_0x0e7c('0x23')][_0x0e7c('0x22')]({'where':{'type':_0x20b228,'resourceId':_0x34eab2['id']}})[_0x0e7c('0x21')](function(){return _0x2167a1;});})[_0x0e7c('0x21')](function(){_0x5b56e8[_0x0e7c('0x1b')](0xcc)['end']();});}};}function handleEntityNotFound(_0x217613,_0x3a25f6){return function(_0x4719cd){if(!_0x4719cd){_0x217613[_0x0e7c('0x16')](0x194);}return _0x4719cd;};}function handleError(_0x191263,_0x358fe8){_0x358fe8=_0x358fe8||0x1f4;return function(_0x286fe0){logger['error'](_0x286fe0['stack']);if(_0x286fe0[_0x0e7c('0x24')]){delete _0x286fe0[_0x0e7c('0x24')];}_0x191263[_0x0e7c('0x1b')](_0x358fe8)['send'](_0x286fe0);};}exports['index']=function(_0x280f21,_0x31c170){var _0x4a9eca={},_0x131fd3={},_0x2e78f7={'count':0x0,'rows':[]};var _0x32c84e=_[_0x0e7c('0x25')](db['AnalyticExtractedReport'][_0x0e7c('0x26')],function(_0x5556c1){return{'name':_0x5556c1[_0x0e7c('0x27')],'type':_0x5556c1[_0x0e7c('0x28')][_0x0e7c('0x29')]};});_0x131fd3['model']=_[_0x0e7c('0x25')](_0x32c84e,'name');_0x131fd3[_0x0e7c('0x2a')]=_[_0x0e7c('0x2b')](_0x280f21[_0x0e7c('0x2a')]);_0x131fd3[_0x0e7c('0x2c')]=_['intersection'](_0x131fd3[_0x0e7c('0x2d')],_0x131fd3[_0x0e7c('0x2a')]);_0x4a9eca[_0x0e7c('0x2e')]=_['intersection'](_0x131fd3[_0x0e7c('0x2d')],qs[_0x0e7c('0x2f')](_0x280f21[_0x0e7c('0x2a')][_0x0e7c('0x2f')]));_0x4a9eca['attributes']=_0x4a9eca[_0x0e7c('0x2e')]['length']?_0x4a9eca[_0x0e7c('0x2e')]:_0x131fd3[_0x0e7c('0x2d')];if(!_0x280f21['query'][_0x0e7c('0x30')](_0x0e7c('0x31'))){_0x4a9eca['limit']=qs[_0x0e7c('0x1a')](_0x280f21[_0x0e7c('0x2a')][_0x0e7c('0x1a')]);_0x4a9eca[_0x0e7c('0x32')]=qs[_0x0e7c('0x32')](_0x280f21['query'][_0x0e7c('0x32')]);}_0x4a9eca[_0x0e7c('0x33')]=qs[_0x0e7c('0x34')](_0x280f21[_0x0e7c('0x2a')][_0x0e7c('0x34')]);_0x4a9eca[_0x0e7c('0x35')]=qs[_0x0e7c('0x2c')](_[_0x0e7c('0x36')](_0x280f21[_0x0e7c('0x2a')],_0x131fd3['filters']));if(_0x280f21[_0x0e7c('0x2a')]['filter']){_0x4a9eca[_0x0e7c('0x35')]=_[_0x0e7c('0x37')](_0x4a9eca[_0x0e7c('0x35')],{'$or':_[_0x0e7c('0x25')](_0x32c84e,function(_0x40a2f1){if(_0x40a2f1[_0x0e7c('0x28')]!==_0x0e7c('0x38')){var _0x4f138f={};_0x4f138f[_0x40a2f1[_0x0e7c('0x24')]]={'$like':'%'+_0x280f21['query']['filter']+'%'};return _0x4f138f;}})});}_0x4a9eca=_[_0x0e7c('0x37')]({},_0x4a9eca,_0x280f21[_0x0e7c('0x39')]);var _0x281f67={'where':_0x4a9eca[_0x0e7c('0x35')]};return db['AnalyticExtractedReport'][_0x0e7c('0x19')](_0x281f67)['then'](function(_0x1d08d2){_0x2e78f7[_0x0e7c('0x19')]=_0x1d08d2;if(_0x280f21['query'][_0x0e7c('0x3a')]){_0x4a9eca['include']=[{'all':!![]}];}return db[_0x0e7c('0x3b')][_0x0e7c('0x3c')](_0x4a9eca);})[_0x0e7c('0x21')](function(_0x50fc70){_0x2e78f7[_0x0e7c('0x3d')]=_0x50fc70;return _0x2e78f7;})['then'](respondWithFilteredResult(_0x31c170,_0x4a9eca))[_0x0e7c('0x3e')](handleError(_0x31c170,null));};exports[_0x0e7c('0x3f')]=function(_0x4a953d,_0x4e3a2c){var _0x5c0b26={'raw':!![],'where':{'id':_0x4a953d[_0x0e7c('0x40')]['id']}},_0x234d3d={};_0x234d3d[_0x0e7c('0x2d')]=_[_0x0e7c('0x2b')](db['AnalyticExtractedReport']['rawAttributes']);_0x234d3d['query']=_[_0x0e7c('0x2b')](_0x4a953d[_0x0e7c('0x2a')]);_0x234d3d[_0x0e7c('0x2c')]=_[_0x0e7c('0x41')](_0x234d3d[_0x0e7c('0x2d')],_0x234d3d[_0x0e7c('0x2a')]);_0x5c0b26[_0x0e7c('0x2e')]=_['intersection'](_0x234d3d[_0x0e7c('0x2d')],qs['fields'](_0x4a953d[_0x0e7c('0x2a')][_0x0e7c('0x2f')]));_0x5c0b26[_0x0e7c('0x2e')]=_0x5c0b26[_0x0e7c('0x2e')][_0x0e7c('0x42')]?_0x5c0b26[_0x0e7c('0x2e')]:_0x234d3d[_0x0e7c('0x2d')];if(_0x4a953d[_0x0e7c('0x2a')][_0x0e7c('0x3a')]){_0x5c0b26['include']=[{'all':!![]}];}_0x5c0b26=_[_0x0e7c('0x37')]({},_0x5c0b26,_0x4a953d[_0x0e7c('0x39')]);return db[_0x0e7c('0x3b')][_0x0e7c('0x43')](_0x5c0b26)['then'](handleEntityNotFound(_0x4e3a2c,null))[_0x0e7c('0x21')](respondWithResult(_0x4e3a2c,null))[_0x0e7c('0x3e')](handleError(_0x4e3a2c,null));};exports[_0x0e7c('0x44')]=function(_0xe17f63,_0x864897){return db[_0x0e7c('0x3b')][_0x0e7c('0x44')](_0xe17f63[_0x0e7c('0x45')],{})['then'](function(_0x2d687d){var _0x224aea=_0xe17f63[_0x0e7c('0x46')][_0x0e7c('0x47')]({'plain':!![]});if(!_0x224aea)throw new Error(_0x0e7c('0x48'));if(_0x224aea[_0x0e7c('0x49')]===_0x0e7c('0x46')){var _0x5168ce=_0x2d687d[_0x0e7c('0x47')]({'plain':!![]});var _0x584dc5=_0x0e7c('0x4a');return db['UserProfileSection'][_0x0e7c('0x43')]({'where':{'name':_0x584dc5,'userProfileId':_0x224aea[_0x0e7c('0x4b')]},'raw':!![]})[_0x0e7c('0x21')](function(_0x43d80c){if(_0x43d80c&&_0x43d80c[_0x0e7c('0x4c')]===0x0){return db[_0x0e7c('0x23')][_0x0e7c('0x44')]({'name':_0x5168ce['name'],'resourceId':_0x5168ce['id'],'type':_0x43d80c[_0x0e7c('0x24')],'sectionId':_0x43d80c['id']},{})[_0x0e7c('0x21')](function(){return _0x2d687d;});}else{return _0x2d687d;}})[_0x0e7c('0x3e')](function(_0x3a53a9){logger['error'](_0x0e7c('0x4d'),_0x3a53a9);throw _0x3a53a9;});}return _0x2d687d;})[_0x0e7c('0x21')](respondWithResult(_0x864897,0xc9))[_0x0e7c('0x3e')](handleError(_0x864897,null));};exports[_0x0e7c('0x4e')]=function(_0x3e4c58,_0x208495){if(_0x3e4c58['body']['id']){delete _0x3e4c58['body']['id'];}return db[_0x0e7c('0x3b')][_0x0e7c('0x43')]({'where':{'id':_0x3e4c58[_0x0e7c('0x40')]['id']}})[_0x0e7c('0x21')](handleEntityNotFound(_0x208495,null))[_0x0e7c('0x21')](saveUpdates(_0x3e4c58[_0x0e7c('0x45')],null))[_0x0e7c('0x21')](respondWithResult(_0x208495,null))[_0x0e7c('0x3e')](handleError(_0x208495,null));};exports['destroy']=function(_0xfb4737,_0x11420d){return db[_0x0e7c('0x3b')][_0x0e7c('0x43')]({'where':{'id':_0xfb4737[_0x0e7c('0x40')]['id']}})[_0x0e7c('0x21')](handleEntityNotFound(_0x11420d,null))[_0x0e7c('0x21')](removeEntity(_0x11420d,null))[_0x0e7c('0x3e')](handleError(_0x11420d,null));};exports['download']=function(_0x1212f0,_0x1f8466,_0xc3f0b3){return db[_0x0e7c('0x3b')][_0x0e7c('0x43')]({'where':{'id':_0x1212f0[_0x0e7c('0x40')]['id']},'attributes':[_0x0e7c('0x24'),_0x0e7c('0x4f'),'savename',_0x0e7c('0x50')],'raw':!![]})[_0x0e7c('0x21')](handleEntityNotFound(_0x1f8466,null))[_0x0e7c('0x21')](function(_0x8dc86f){if(_0x8dc86f){if(!fs[_0x0e7c('0x51')](path['join'](config[_0x0e7c('0x52')],_0x0e7c('0x53'),_0x8dc86f[_0x0e7c('0x54')]))){throw new db[(_0x0e7c('0x55'))]['ValidationError'](_0x0e7c('0x56'));}if(_0x1212f0[_0x0e7c('0x2a')][_0x0e7c('0x57')]){return _0x1f8466['sendStatus'](0xc8);}return _0x1f8466[_0x0e7c('0x58')](path['join'](config[_0x0e7c('0x52')],'server/files/reports',_0x8dc86f['savename']),util[_0x0e7c('0x59')](_0x0e7c('0x5a'),_0x8dc86f[_0x0e7c('0x4f')]||_0x8dc86f[_0x0e7c('0x24')],_0x8dc86f['output'][_0x0e7c('0x5b')]()));}})[_0x0e7c('0x3e')](handleError(_0x1f8466,null));};
\ No newline at end of file
+var _0x5877=['../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/environment','../../mysqldb','sendStatus','status','end','json','offset','limit','set','Content-Range','apply','reject','save','update','then','get','ExtractedReports','UserProfileResource','destroy','error','stack','name','send','map','rawAttributes','type','key','query','keys','filters','intersection','model','fields','attributes','length','nolimit','order','sort','filter','merge','where','VIRTUAL','options','count','includeAll','include','AnalyticExtractedReport','findAll','catch','show','params','find','create','user','UserProfileSection','userProfileId','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','body','download','basename','savename','output','existsSync','join','server/files/reports','Sequelize','ValidationError','Report\x20not\x20found\x20or\x20empty','exists','root','%s.%s','toLowerCase','html-pdf','eml-format','rimraf','fast-json-patch','moment','bluebird','mustache','util','path','sox','to-csv','ejs','lodash','desk.js','querystring','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch'];(function(_0x3dd15e,_0x1f0015){var _0x231fd0=function(_0x4f680a){while(--_0x4f680a){_0x3dd15e['push'](_0x3dd15e['shift']());}};_0x231fd0(++_0x1f0015);}(_0x5877,0x169));var _0x7587=function(_0x2dafbe,_0x5d04de){_0x2dafbe=_0x2dafbe-0x0;var _0x58a45a=_0x5877[_0x2dafbe];return _0x58a45a;};'use strict';var pdf=require(_0x7587('0x0'));var emlformat=require(_0x7587('0x1'));var rimraf=require(_0x7587('0x2'));var zipdir=require('zip-dir');var jsonpatch=require(_0x7587('0x3'));var rp=require('request-promise');var moment=require(_0x7587('0x4'));var BPromise=require(_0x7587('0x5'));var Mustache=require(_0x7587('0x6'));var util=require(_0x7587('0x7'));var path=require(_0x7587('0x8'));var sox=require(_0x7587('0x9'));var csv=require(_0x7587('0xa'));var ejs=require(_0x7587('0xb'));var fs=require('fs');var _=require(_0x7587('0xc'));var squel=require('squel');var crypto=require('crypto');var jsforce=require('jsforce');var deskjs=require(_0x7587('0xd'));var toCsv=require('to-csv');var querystring=require(_0x7587('0xe'));var Papa=require('papaparse');var Redis=require(_0x7587('0xf'));var authService=require(_0x7587('0x10'));var qs=require(_0x7587('0x11'));var as=require(_0x7587('0x12'));var hardwareService=require(_0x7587('0x13'));var logger=require(_0x7587('0x14'))(_0x7587('0x15'));var utils=require(_0x7587('0x16'));var config=require(_0x7587('0x17'));var db=require(_0x7587('0x18'))['db'];function respondWithStatusCode(_0x45d2db,_0x5e3ead){_0x5e3ead=_0x5e3ead||0xcc;return function(_0x48f513){if(_0x48f513){return _0x45d2db[_0x7587('0x19')](_0x5e3ead);}return _0x45d2db[_0x7587('0x1a')](_0x5e3ead)[_0x7587('0x1b')]();};}function respondWithResult(_0x2ac15e,_0x103040){_0x103040=_0x103040||0xc8;return function(_0x432273){if(_0x432273){return _0x2ac15e[_0x7587('0x1a')](_0x103040)[_0x7587('0x1c')](_0x432273);}};}function respondWithFilteredResult(_0x1a3d2e,_0x27432d){return function(_0xb841b2){if(_0xb841b2){var _0x5eb90c=_0xb841b2['count'],_0xcf713=_0x27432d[_0x7587('0x1d')],_0xfe3aa6=_0x27432d[_0x7587('0x1d')]+_0x27432d[_0x7587('0x1e')],_0x9d01e9;if(_0xfe3aa6>=_0x5eb90c){_0xfe3aa6=_0x5eb90c;_0x9d01e9=0xc8;}else{_0x9d01e9=0xce;}_0x1a3d2e[_0x7587('0x1a')](_0x9d01e9);return _0x1a3d2e[_0x7587('0x1f')](_0x7587('0x20'),_0xcf713+'-'+_0xfe3aa6+'/'+_0x5eb90c)[_0x7587('0x1c')](_0xb841b2);}return null;};}function patchUpdates(_0x129370){return function(_0x4238af){try{jsonpatch[_0x7587('0x21')](_0x4238af,_0x129370,!![]);}catch(_0x5e7da4){return BPromise[_0x7587('0x22')](_0x5e7da4);}return _0x4238af[_0x7587('0x23')]();};}function saveUpdates(_0x573890,_0x492746){return function(_0x1562fa){if(_0x1562fa){return _0x1562fa[_0x7587('0x24')](_0x573890)[_0x7587('0x25')](function(_0x3610ff){return _0x3610ff;});}return null;};}function removeEntity(_0x2b88b8,_0x1a06c9){return function(_0x100868){if(_0x100868){return _0x100868['destroy']()[_0x7587('0x25')](function(){var _0x457857=_0x100868[_0x7587('0x26')]({'plain':!![]});var _0x18bf49=_0x7587('0x27');return db[_0x7587('0x28')][_0x7587('0x29')]({'where':{'type':_0x18bf49,'resourceId':_0x457857['id']}})['then'](function(){return _0x100868;});})[_0x7587('0x25')](function(){_0x2b88b8[_0x7587('0x1a')](0xcc)['end']();});}};}function handleEntityNotFound(_0x469adf,_0x49e7f9){return function(_0x2211cf){if(!_0x2211cf){_0x469adf['sendStatus'](0x194);}return _0x2211cf;};}function handleError(_0x3a15fd,_0x5ca64c){_0x5ca64c=_0x5ca64c||0x1f4;return function(_0xb07d2c){logger[_0x7587('0x2a')](_0xb07d2c[_0x7587('0x2b')]);if(_0xb07d2c['name']){delete _0xb07d2c[_0x7587('0x2c')];}_0x3a15fd['status'](_0x5ca64c)[_0x7587('0x2d')](_0xb07d2c);};}exports['index']=function(_0x4e5251,_0x2ff0a3){var _0x26cf99={},_0x5455c7={},_0x5eb1d1={'count':0x0,'rows':[]};var _0x57791b=_[_0x7587('0x2e')](db['AnalyticExtractedReport'][_0x7587('0x2f')],function(_0x3275a9){return{'name':_0x3275a9['fieldName'],'type':_0x3275a9[_0x7587('0x30')][_0x7587('0x31')]};});_0x5455c7['model']=_[_0x7587('0x2e')](_0x57791b,_0x7587('0x2c'));_0x5455c7[_0x7587('0x32')]=_[_0x7587('0x33')](_0x4e5251[_0x7587('0x32')]);_0x5455c7[_0x7587('0x34')]=_['intersection'](_0x5455c7['model'],_0x5455c7[_0x7587('0x32')]);_0x26cf99['attributes']=_[_0x7587('0x35')](_0x5455c7[_0x7587('0x36')],qs[_0x7587('0x37')](_0x4e5251[_0x7587('0x32')][_0x7587('0x37')]));_0x26cf99[_0x7587('0x38')]=_0x26cf99[_0x7587('0x38')][_0x7587('0x39')]?_0x26cf99[_0x7587('0x38')]:_0x5455c7[_0x7587('0x36')];if(!_0x4e5251[_0x7587('0x32')]['hasOwnProperty'](_0x7587('0x3a'))){_0x26cf99[_0x7587('0x1e')]=qs[_0x7587('0x1e')](_0x4e5251[_0x7587('0x32')]['limit']);_0x26cf99['offset']=qs['offset'](_0x4e5251['query'][_0x7587('0x1d')]);}_0x26cf99[_0x7587('0x3b')]=qs[_0x7587('0x3c')](_0x4e5251[_0x7587('0x32')][_0x7587('0x3c')]);_0x26cf99['where']=qs[_0x7587('0x34')](_['pick'](_0x4e5251[_0x7587('0x32')],_0x5455c7[_0x7587('0x34')]));if(_0x4e5251[_0x7587('0x32')][_0x7587('0x3d')]){_0x26cf99['where']=_[_0x7587('0x3e')](_0x26cf99[_0x7587('0x3f')],{'$or':_['map'](_0x57791b,function(_0x224b9f){if(_0x224b9f[_0x7587('0x30')]!==_0x7587('0x40')){var _0x3e48be={};_0x3e48be[_0x224b9f[_0x7587('0x2c')]]={'$like':'%'+_0x4e5251[_0x7587('0x32')][_0x7587('0x3d')]+'%'};return _0x3e48be;}})});}_0x26cf99=_['merge']({},_0x26cf99,_0x4e5251[_0x7587('0x41')]);var _0x2da91a={'where':_0x26cf99[_0x7587('0x3f')]};return db['AnalyticExtractedReport'][_0x7587('0x42')](_0x2da91a)['then'](function(_0x499a03){_0x5eb1d1['count']=_0x499a03;if(_0x4e5251['query'][_0x7587('0x43')]){_0x26cf99[_0x7587('0x44')]=[{'all':!![]}];}return db[_0x7587('0x45')][_0x7587('0x46')](_0x26cf99);})[_0x7587('0x25')](function(_0x30dd7c){_0x5eb1d1['rows']=_0x30dd7c;return _0x5eb1d1;})[_0x7587('0x25')](respondWithFilteredResult(_0x2ff0a3,_0x26cf99))[_0x7587('0x47')](handleError(_0x2ff0a3,null));};exports[_0x7587('0x48')]=function(_0x2c1ee8,_0x40e6c1){var _0x99e0b6={'raw':!![],'where':{'id':_0x2c1ee8[_0x7587('0x49')]['id']}},_0xdaa060={};_0xdaa060['model']=_[_0x7587('0x33')](db[_0x7587('0x45')]['rawAttributes']);_0xdaa060[_0x7587('0x32')]=_[_0x7587('0x33')](_0x2c1ee8[_0x7587('0x32')]);_0xdaa060['filters']=_['intersection'](_0xdaa060[_0x7587('0x36')],_0xdaa060[_0x7587('0x32')]);_0x99e0b6[_0x7587('0x38')]=_[_0x7587('0x35')](_0xdaa060[_0x7587('0x36')],qs[_0x7587('0x37')](_0x2c1ee8[_0x7587('0x32')][_0x7587('0x37')]));_0x99e0b6[_0x7587('0x38')]=_0x99e0b6[_0x7587('0x38')][_0x7587('0x39')]?_0x99e0b6[_0x7587('0x38')]:_0xdaa060[_0x7587('0x36')];if(_0x2c1ee8[_0x7587('0x32')][_0x7587('0x43')]){_0x99e0b6[_0x7587('0x44')]=[{'all':!![]}];}_0x99e0b6=_[_0x7587('0x3e')]({},_0x99e0b6,_0x2c1ee8[_0x7587('0x41')]);return db[_0x7587('0x45')][_0x7587('0x4a')](_0x99e0b6)[_0x7587('0x25')](handleEntityNotFound(_0x40e6c1,null))['then'](respondWithResult(_0x40e6c1,null))[_0x7587('0x47')](handleError(_0x40e6c1,null));};exports[_0x7587('0x4b')]=function(_0x2a9b52,_0xfec560){return db[_0x7587('0x45')][_0x7587('0x4b')](_0x2a9b52['body'],{})[_0x7587('0x25')](function(_0x314fea){var _0x596699=_0x2a9b52[_0x7587('0x4c')]['get']({'plain':!![]});if(!_0x596699)throw new Error('Unable\x20to\x20retrieve\x20the\x20current\x20user');if(_0x596699['role']==='user'){var _0x77829a=_0x314fea[_0x7587('0x26')]({'plain':!![]});var _0x364bf5='ExtractedReports';return db[_0x7587('0x4d')][_0x7587('0x4a')]({'where':{'name':_0x364bf5,'userProfileId':_0x596699[_0x7587('0x4e')]},'raw':!![]})[_0x7587('0x25')](function(_0x2e4cf3){if(_0x2e4cf3&&_0x2e4cf3['autoAssociation']===0x0){return db['UserProfileResource'][_0x7587('0x4b')]({'name':_0x77829a[_0x7587('0x2c')],'resourceId':_0x77829a['id'],'type':_0x2e4cf3[_0x7587('0x2c')],'sectionId':_0x2e4cf3['id']},{})[_0x7587('0x25')](function(){return _0x314fea;});}else{return _0x314fea;}})[_0x7587('0x47')](function(_0x1fca04){logger[_0x7587('0x2a')](_0x7587('0x4f'),_0x1fca04);throw _0x1fca04;});}return _0x314fea;})[_0x7587('0x25')](respondWithResult(_0xfec560,0xc9))[_0x7587('0x47')](handleError(_0xfec560,null));};exports[_0x7587('0x24')]=function(_0xf98600,_0x2dab41){if(_0xf98600[_0x7587('0x50')]['id']){delete _0xf98600['body']['id'];}return db['AnalyticExtractedReport'][_0x7587('0x4a')]({'where':{'id':_0xf98600[_0x7587('0x49')]['id']}})[_0x7587('0x25')](handleEntityNotFound(_0x2dab41,null))[_0x7587('0x25')](saveUpdates(_0xf98600[_0x7587('0x50')],null))[_0x7587('0x25')](respondWithResult(_0x2dab41,null))[_0x7587('0x47')](handleError(_0x2dab41,null));};exports[_0x7587('0x29')]=function(_0x2f523d,_0xf1ec8a){return db[_0x7587('0x45')][_0x7587('0x4a')]({'where':{'id':_0x2f523d[_0x7587('0x49')]['id']}})[_0x7587('0x25')](handleEntityNotFound(_0xf1ec8a,null))['then'](removeEntity(_0xf1ec8a,null))[_0x7587('0x47')](handleError(_0xf1ec8a,null));};exports[_0x7587('0x51')]=function(_0x15b940,_0x3253ac,_0x3067f1){return db[_0x7587('0x45')][_0x7587('0x4a')]({'where':{'id':_0x15b940[_0x7587('0x49')]['id']},'attributes':[_0x7587('0x2c'),_0x7587('0x52'),_0x7587('0x53'),_0x7587('0x54')],'raw':!![]})[_0x7587('0x25')](handleEntityNotFound(_0x3253ac,null))[_0x7587('0x25')](function(_0x469766){if(_0x469766){if(!fs[_0x7587('0x55')](path[_0x7587('0x56')](config['root'],_0x7587('0x57'),_0x469766[_0x7587('0x53')]))){throw new db[(_0x7587('0x58'))][(_0x7587('0x59'))](_0x7587('0x5a'));}if(_0x15b940['query'][_0x7587('0x5b')]){return _0x3253ac[_0x7587('0x19')](0xc8);}return _0x3253ac[_0x7587('0x51')](path[_0x7587('0x56')](config[_0x7587('0x5c')],'server/files/reports',_0x469766[_0x7587('0x53')]),util['format'](_0x7587('0x5d'),_0x469766['basename']||_0x469766[_0x7587('0x2c')],_0x469766[_0x7587('0x54')][_0x7587('0x5e')]()));}})[_0x7587('0x47')](handleError(_0x3253ac,null));};
\ No newline at end of file
diff --git a/server/api/analyticExtractedReport/analyticExtractedReport.model.js b/server/api/analyticExtractedReport/analyticExtractedReport.model.js
index fc853d1..6246184 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 _0x3ec9=['request-promise','../../config/environment','./analyticExtractedReport.attributes','exports','define','analytics_extracted_reports','lodash','../../config/logger','api','bluebird'];(function(_0x549dfa,_0x2105d5){var _0x59d95b=function(_0x11a475){while(--_0x11a475){_0x549dfa['push'](_0x549dfa['shift']());}};_0x59d95b(++_0x2105d5);}(_0x3ec9,0x150));var _0x93ec=function(_0x3dd15e,_0x1f0015){_0x3dd15e=_0x3dd15e-0x0;var _0x231fd0=_0x3ec9[_0x3dd15e];return _0x231fd0;};'use strict';var _=require(_0x93ec('0x0'));var util=require('util');var logger=require(_0x93ec('0x1'))(_0x93ec('0x2'));var moment=require('moment');var BPromise=require(_0x93ec('0x3'));var rp=require(_0x93ec('0x4'));var fs=require('fs');var path=require('path');var rimraf=require('rimraf');var config=require(_0x93ec('0x5'));var attributes=require(_0x93ec('0x6'));module[_0x93ec('0x7')]=function(_0x45e0f6,_0x4621b8){return _0x45e0f6[_0x93ec('0x8')]('AnalyticExtractedReport',attributes,{'tableName':_0x93ec('0x9'),'paranoid':![],'indexes':[],'timestamps':!![]});};
\ No newline at end of file
+var _0xd509=['rimraf','./analyticExtractedReport.attributes','exports','define','lodash','../../config/logger','api','moment','bluebird','request-promise','path'];(function(_0x233ec0,_0x5ed1be){var _0x31ee7f=function(_0x49a7a7){while(--_0x49a7a7){_0x233ec0['push'](_0x233ec0['shift']());}};_0x31ee7f(++_0x5ed1be);}(_0xd509,0x1d2));var _0x9d50=function(_0x3dd15e,_0x1f0015){_0x3dd15e=_0x3dd15e-0x0;var _0x231fd0=_0xd509[_0x3dd15e];return _0x231fd0;};'use strict';var _=require(_0x9d50('0x0'));var util=require('util');var logger=require(_0x9d50('0x1'))(_0x9d50('0x2'));var moment=require(_0x9d50('0x3'));var BPromise=require(_0x9d50('0x4'));var rp=require(_0x9d50('0x5'));var fs=require('fs');var path=require(_0x9d50('0x6'));var rimraf=require(_0x9d50('0x7'));var config=require('../../config/environment');var attributes=require(_0x9d50('0x8'));module[_0x9d50('0x9')]=function(_0x6d08c4,_0x35e0bb){return _0x6d08c4[_0x9d50('0xa')]('AnalyticExtractedReport',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 aaf10ce..4885869 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 _0x5907=['randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','jayson/promise','client','then','AnalyticExtractedReport,\x20%s,\x20%s','request\x20sent','debug','AnalyticExtractedReport,\x20%s,\x20%s,\x20%s','stringify','error','code','message','result','lodash','util','moment'];(function(_0x14add3,_0x13ce8d){var _0x4a174f=function(_0x2b3ed7){while(--_0x2b3ed7){_0x14add3['push'](_0x14add3['shift']());}};_0x4a174f(++_0x13ce8d);}(_0x5907,0x18d));var _0x7590=function(_0x3cea61,_0x420a68){_0x3cea61=_0x3cea61-0x0;var _0x5ebd22=_0x5907[_0x3cea61];return _0x5ebd22;};'use strict';var _=require(_0x7590('0x0'));var util=require(_0x7590('0x1'));var moment=require(_0x7590('0x2'));var BPromise=require('bluebird');var rs=require(_0x7590('0x3'));var fs=require('fs');var Redis=require(_0x7590('0x4'));var db=require(_0x7590('0x5'))['db'];var utils=require(_0x7590('0x6'));var logger=require(_0x7590('0x7'))('rpc');var config=require('../../config/environment');var jayson=require(_0x7590('0x8'));var client=jayson[_0x7590('0x9')]['http']({'port':0x232a});function respondWithRpcPromise(_0x4c6dbf,_0x3d23be,_0x24b2bf){return new BPromise(function(_0x33dc9e,_0x55646f){return client['request'](_0x4c6dbf,_0x24b2bf)[_0x7590('0xa')](function(_0x408f77){logger['info'](_0x7590('0xb'),_0x3d23be,_0x7590('0xc'));logger[_0x7590('0xd')](_0x7590('0xe'),_0x3d23be,_0x7590('0xc'),JSON[_0x7590('0xf')](_0x408f77));if(_0x408f77[_0x7590('0x10')]){if(_0x408f77[_0x7590('0x10')][_0x7590('0x11')]===0x1f4){logger[_0x7590('0x10')](_0x7590('0xb'),_0x3d23be,_0x408f77['error'][_0x7590('0x12')]);return _0x55646f(_0x408f77[_0x7590('0x10')][_0x7590('0x12')]);}logger[_0x7590('0x10')]('AnalyticExtractedReport,\x20%s,\x20%s',_0x3d23be,_0x408f77[_0x7590('0x10')][_0x7590('0x12')]);return _0x33dc9e(_0x408f77[_0x7590('0x10')][_0x7590('0x12')]);}else{logger['info'](_0x7590('0xb'),_0x3d23be,_0x7590('0xc'));_0x33dc9e(_0x408f77[_0x7590('0x13')][_0x7590('0x12')]);}})['catch'](function(_0x43ddc0){logger[_0x7590('0x10')](_0x7590('0xb'),_0x3d23be,_0x43ddc0);_0x55646f(_0x43ddc0);});});}
\ No newline at end of file
+var _0x5c3c=['lodash','util','moment','bluebird','randomstring','ioredis','../../config/utils','../../config/environment','jayson/promise','client','http','request','info','AnalyticExtractedReport,\x20%s,\x20%s','request\x20sent','AnalyticExtractedReport,\x20%s,\x20%s,\x20%s','error','code','message','catch'];(function(_0x3bf6f3,_0xd0ec2a){var _0x26ab22=function(_0x1b457b){while(--_0x1b457b){_0x3bf6f3['push'](_0x3bf6f3['shift']());}};_0x26ab22(++_0xd0ec2a);}(_0x5c3c,0x140));var _0xc5c3=function(_0x39d544,_0x35c14f){_0x39d544=_0x39d544-0x0;var _0x5a5ff2=_0x5c3c[_0x39d544];return _0x5a5ff2;};'use strict';var _=require(_0xc5c3('0x0'));var util=require(_0xc5c3('0x1'));var moment=require(_0xc5c3('0x2'));var BPromise=require(_0xc5c3('0x3'));var rs=require(_0xc5c3('0x4'));var fs=require('fs');var Redis=require(_0xc5c3('0x5'));var db=require('../../mysqldb')['db'];var utils=require(_0xc5c3('0x6'));var logger=require('../../config/logger')('rpc');var config=require(_0xc5c3('0x7'));var jayson=require(_0xc5c3('0x8'));var client=jayson[_0xc5c3('0x9')][_0xc5c3('0xa')]({'port':0x232a});function respondWithRpcPromise(_0x3548cf,_0x2a485,_0x4c3c49){return new BPromise(function(_0x484e9e,_0xfdd7d7){return client[_0xc5c3('0xb')](_0x3548cf,_0x4c3c49)['then'](function(_0x2acb35){logger[_0xc5c3('0xc')](_0xc5c3('0xd'),_0x2a485,_0xc5c3('0xe'));logger['debug'](_0xc5c3('0xf'),_0x2a485,_0xc5c3('0xe'),JSON['stringify'](_0x2acb35));if(_0x2acb35[_0xc5c3('0x10')]){if(_0x2acb35['error'][_0xc5c3('0x11')]===0x1f4){logger['error'](_0xc5c3('0xd'),_0x2a485,_0x2acb35['error'][_0xc5c3('0x12')]);return _0xfdd7d7(_0x2acb35[_0xc5c3('0x10')][_0xc5c3('0x12')]);}logger[_0xc5c3('0x10')](_0xc5c3('0xd'),_0x2a485,_0x2acb35[_0xc5c3('0x10')][_0xc5c3('0x12')]);return _0x484e9e(_0x2acb35[_0xc5c3('0x10')][_0xc5c3('0x12')]);}else{logger[_0xc5c3('0xc')](_0xc5c3('0xd'),_0x2a485,_0xc5c3('0xe'));_0x484e9e(_0x2acb35['result'][_0xc5c3('0x12')]);}})[_0xc5c3('0x13')](function(_0x284925){logger[_0xc5c3('0x10')]('AnalyticExtractedReport,\x20%s,\x20%s',_0x2a485,_0x284925);_0xfdd7d7(_0x284925);});});}
\ No newline at end of file
diff --git a/server/api/analyticExtractedReport/index.js b/server/api/analyticExtractedReport/index.js
index a000c0a..46172fb 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 _0xac9b=['../../config/environment','get','isAuthenticated','index','/:id/download','download','post','create','put','/:id','update','exports','util','path','connect-timeout','Router','../../components/auth/service','../../components/interaction/service'];(function(_0x126491,_0x266c72){var _0x463472=function(_0x478850){while(--_0x478850){_0x126491['push'](_0x126491['shift']());}};_0x463472(++_0x266c72);}(_0xac9b,0xf6));var _0xbac9=function(_0x3747ae,_0x408e61){_0x3747ae=_0x3747ae-0x0;var _0x339035=_0xac9b[_0x3747ae];return _0x339035;};'use strict';var multer=require('multer');var util=require(_0xbac9('0x0'));var path=require(_0xbac9('0x1'));var timeout=require(_0xbac9('0x2'));var express=require('express');var router=express[_0xbac9('0x3')]();var auth=require(_0xbac9('0x4'));var interaction=require(_0xbac9('0x5'));var config=require(_0xbac9('0x6'));var controller=require('./analyticExtractedReport.controller');router[_0xbac9('0x7')]('/',auth[_0xbac9('0x8')](),controller[_0xbac9('0x9')]);router[_0xbac9('0x7')]('/:id',auth[_0xbac9('0x8')](),controller['show']);router['get'](_0xbac9('0xa'),auth[_0xbac9('0x8')](),controller[_0xbac9('0xb')]);router[_0xbac9('0xc')]('/',auth[_0xbac9('0x8')](),controller[_0xbac9('0xd')]);router[_0xbac9('0xe')](_0xbac9('0xf'),auth['isAuthenticated'](),controller[_0xbac9('0x10')]);router['delete'](_0xbac9('0xf'),auth[_0xbac9('0x8')](),controller['destroy']);module[_0xbac9('0x11')]=router;
\ No newline at end of file
+var _0xd5d8=['util','path','connect-timeout','express','Router','../../components/auth/service','../../config/environment','./analyticExtractedReport.controller','isAuthenticated','/:id','/:id/download','download','post','create','put','update','delete','destroy','exports','multer'];(function(_0x4df278,_0x5c5f72){var _0x4a9abb=function(_0x14abc0){while(--_0x14abc0){_0x4df278['push'](_0x4df278['shift']());}};_0x4a9abb(++_0x5c5f72);}(_0xd5d8,0x1a3));var _0x8d5d=function(_0x34a0d8,_0x2df614){_0x34a0d8=_0x34a0d8-0x0;var _0x2b5d50=_0xd5d8[_0x34a0d8];return _0x2b5d50;};'use strict';var multer=require(_0x8d5d('0x0'));var util=require(_0x8d5d('0x1'));var path=require(_0x8d5d('0x2'));var timeout=require(_0x8d5d('0x3'));var express=require(_0x8d5d('0x4'));var router=express[_0x8d5d('0x5')]();var auth=require(_0x8d5d('0x6'));var interaction=require('../../components/interaction/service');var config=require(_0x8d5d('0x7'));var controller=require(_0x8d5d('0x8'));router['get']('/',auth[_0x8d5d('0x9')](),controller['index']);router['get'](_0x8d5d('0xa'),auth['isAuthenticated'](),controller['show']);router['get'](_0x8d5d('0xb'),auth[_0x8d5d('0x9')](),controller[_0x8d5d('0xc')]);router[_0x8d5d('0xd')]('/',auth['isAuthenticated'](),controller[_0x8d5d('0xe')]);router[_0x8d5d('0xf')](_0x8d5d('0xa'),auth[_0x8d5d('0x9')](),controller[_0x8d5d('0x10')]);router[_0x8d5d('0x11')]('/:id',auth['isAuthenticated'](),controller[_0x8d5d('0x12')]);module[_0x8d5d('0x13')]=router;
\ No newline at end of file
diff --git a/server/api/analyticFieldReport/analyticFieldReport.attributes.js b/server/api/analyticFieldReport/analyticFieldReport.attributes.js
index 3adeb1d..e5bafb6 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 _0x814b=['TEXT','STRING','BOOLEAN','sequelize','exports'];(function(_0x5deda9,_0xb06c05){var _0x453001=function(_0x35d17e){while(--_0x35d17e){_0x5deda9['push'](_0x5deda9['shift']());}};_0x453001(++_0xb06c05);}(_0x814b,0x1a2));var _0xb814=function(_0x580cf8,_0x26751e){_0x580cf8=_0x580cf8-0x0;var _0xcc9a9e=_0x814b[_0x580cf8];return _0xcc9a9e;};'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
+var _0x7217=['STRING','BOOLEAN','sequelize','TEXT'];(function(_0x8908df,_0x51133f){var _0x3600ea=function(_0x7417c7){while(--_0x7417c7){_0x8908df['push'](_0x8908df['shift']());}};_0x3600ea(++_0x51133f);}(_0x7217,0x19e));var _0x7721=function(_0x5b78e8,_0x55096b){_0x5b78e8=_0x5b78e8-0x0;var _0xf2c321=_0x7217[_0x5b78e8];return _0xf2c321;};'use strict';var Sequelize=require(_0x7721('0x0'));module['exports']={'field':{'type':Sequelize[_0x7721('0x1')]},'alias':{'type':Sequelize[_0x7721('0x2')]},'function':{'type':Sequelize[_0x7721('0x2')]},'format':{'type':Sequelize[_0x7721('0x2')]},'groupBy':{'type':Sequelize[_0x7721('0x3')],'defaultValue':![]},'orderBy':{'type':Sequelize['STRING']},'custom':{'type':Sequelize['BOOLEAN'],'defaultValue':![]}};
\ No newline at end of file
diff --git a/server/api/analyticFieldReport/analyticFieldReport.controller.js b/server/api/analyticFieldReport/analyticFieldReport.controller.js
index 40642ae..ad38d25 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 _0xde1a=['params','find','catch','create','bulkCreate','body','ids','addFields','findOne','sequelize','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','moment','bluebird','mustache','path','sox','to-csv','ejs','lodash','squel','jsforce','desk.js','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','error','stack','name','index','AnalyticFieldReport','rawAttributes','type','key','query','keys','filters','intersection','model','attributes','fields','length','hasOwnProperty','nolimit','order','sort','where','pick','filter','map','merge','options','include','findAll','rows','show'];(function(_0xbce261,_0x5bf87e){var _0x23848f=function(_0x582169){while(--_0x582169){_0xbce261['push'](_0xbce261['shift']());}};_0x23848f(++_0x5bf87e);}(_0xde1a,0xfd));var _0xade1=function(_0x17d0f3,_0x5b1297){_0x17d0f3=_0x17d0f3-0x0;var _0x7a5d6b=_0xde1a[_0x17d0f3];return _0x7a5d6b;};'use strict';var pdf=require('html-pdf');var emlformat=require(_0xade1('0x0'));var rimraf=require(_0xade1('0x1'));var zipdir=require(_0xade1('0x2'));var jsonpatch=require(_0xade1('0x3'));var rp=require(_0xade1('0x4'));var moment=require(_0xade1('0x5'));var BPromise=require(_0xade1('0x6'));var Mustache=require(_0xade1('0x7'));var util=require('util');var path=require(_0xade1('0x8'));var sox=require(_0xade1('0x9'));var csv=require(_0xade1('0xa'));var ejs=require(_0xade1('0xb'));var fs=require('fs');var _=require(_0xade1('0xc'));var squel=require(_0xade1('0xd'));var crypto=require('crypto');var jsforce=require(_0xade1('0xe'));var deskjs=require(_0xade1('0xf'));var toCsv=require(_0xade1('0xa'));var querystring=require(_0xade1('0x10'));var Papa=require(_0xade1('0x11'));var Redis=require(_0xade1('0x12'));var authService=require(_0xade1('0x13'));var qs=require(_0xade1('0x14'));var as=require('../../components/parsers/advancedSearch');var hardwareService=require(_0xade1('0x15'));var logger=require(_0xade1('0x16'))('api');var utils=require(_0xade1('0x17'));var config=require(_0xade1('0x18'));var db=require(_0xade1('0x19'))['db'];function respondWithStatusCode(_0x5e1bb1,_0x34ef60){_0x34ef60=_0x34ef60||0xcc;return function(_0x10f67f){if(_0x10f67f){return _0x5e1bb1[_0xade1('0x1a')](_0x34ef60);}return _0x5e1bb1[_0xade1('0x1b')](_0x34ef60)[_0xade1('0x1c')]();};}function respondWithResult(_0x1630da,_0x525f90){_0x525f90=_0x525f90||0xc8;return function(_0x1431d7){if(_0x1431d7){return _0x1630da[_0xade1('0x1b')](_0x525f90)[_0xade1('0x1d')](_0x1431d7);}};}function respondWithFilteredResult(_0x10773d,_0x1c9717){return function(_0x5bd472){if(_0x5bd472){var _0x44c001=_0x5bd472[_0xade1('0x1e')],_0x4623a1=_0x1c9717['offset'],_0x290566=_0x1c9717[_0xade1('0x1f')]+_0x1c9717[_0xade1('0x20')],_0x232e06;if(_0x290566>=_0x44c001){_0x290566=_0x44c001;_0x232e06=0xc8;}else{_0x232e06=0xce;}_0x10773d[_0xade1('0x1b')](_0x232e06);return _0x10773d[_0xade1('0x21')](_0xade1('0x22'),_0x4623a1+'-'+_0x290566+'/'+_0x44c001)[_0xade1('0x1d')](_0x5bd472);}return null;};}function patchUpdates(_0x39a360){return function(_0x43f559){try{jsonpatch[_0xade1('0x23')](_0x43f559,_0x39a360,!![]);}catch(_0x2c3acc){return BPromise[_0xade1('0x24')](_0x2c3acc);}return _0x43f559[_0xade1('0x25')]();};}function saveUpdates(_0x55ddd3,_0x5c6624){return function(_0xdbecaf){if(_0xdbecaf){return _0xdbecaf[_0xade1('0x26')](_0x55ddd3)[_0xade1('0x27')](function(_0x156a00){return _0x156a00;});}return null;};}function removeEntity(_0xd017f7,_0x1efe83){return function(_0x2da7a5){if(_0x2da7a5){return _0x2da7a5[_0xade1('0x28')]()[_0xade1('0x27')](function(){_0xd017f7[_0xade1('0x1b')](0xcc)[_0xade1('0x1c')]();});}};}function handleEntityNotFound(_0x4ab3ac,_0x6260d3){return function(_0x5c2837){if(!_0x5c2837){_0x4ab3ac[_0xade1('0x1a')](0x194);}return _0x5c2837;};}function handleError(_0x517334,_0x14eec9){_0x14eec9=_0x14eec9||0x1f4;return function(_0x385e8b){logger[_0xade1('0x29')](_0x385e8b[_0xade1('0x2a')]);if(_0x385e8b[_0xade1('0x2b')]){delete _0x385e8b[_0xade1('0x2b')];}_0x517334[_0xade1('0x1b')](_0x14eec9)['send'](_0x385e8b);};}exports[_0xade1('0x2c')]=function(_0x33776e,_0x4bf5cd){var _0x582e5b={},_0x38dd9f={},_0x1a1d17={'count':0x0,'rows':[]};var _0x59d64b=_['map'](db[_0xade1('0x2d')][_0xade1('0x2e')],function(_0x88c182){return{'name':_0x88c182['fieldName'],'type':_0x88c182[_0xade1('0x2f')][_0xade1('0x30')]};});_0x38dd9f['model']=_['map'](_0x59d64b,'name');_0x38dd9f[_0xade1('0x31')]=_[_0xade1('0x32')](_0x33776e[_0xade1('0x31')]);_0x38dd9f[_0xade1('0x33')]=_[_0xade1('0x34')](_0x38dd9f[_0xade1('0x35')],_0x38dd9f[_0xade1('0x31')]);_0x582e5b[_0xade1('0x36')]=_[_0xade1('0x34')](_0x38dd9f['model'],qs[_0xade1('0x37')](_0x33776e[_0xade1('0x31')][_0xade1('0x37')]));_0x582e5b['attributes']=_0x582e5b[_0xade1('0x36')][_0xade1('0x38')]?_0x582e5b[_0xade1('0x36')]:_0x38dd9f['model'];if(!_0x33776e[_0xade1('0x31')][_0xade1('0x39')](_0xade1('0x3a'))){_0x582e5b[_0xade1('0x20')]=qs[_0xade1('0x20')](_0x33776e['query'][_0xade1('0x20')]);_0x582e5b[_0xade1('0x1f')]=qs[_0xade1('0x1f')](_0x33776e['query'][_0xade1('0x1f')]);}_0x582e5b[_0xade1('0x3b')]=qs[_0xade1('0x3c')](_0x33776e[_0xade1('0x31')][_0xade1('0x3c')]);_0x582e5b[_0xade1('0x3d')]=qs[_0xade1('0x33')](_[_0xade1('0x3e')](_0x33776e[_0xade1('0x31')],_0x38dd9f[_0xade1('0x33')]));if(_0x33776e[_0xade1('0x31')][_0xade1('0x3f')]){_0x582e5b['where']=_['merge'](_0x582e5b[_0xade1('0x3d')],{'$or':_[_0xade1('0x40')](_0x59d64b,function(_0x2ba6b1){if(_0x2ba6b1[_0xade1('0x2f')]!=='VIRTUAL'){var _0x243ed5={};_0x243ed5[_0x2ba6b1['name']]={'$like':'%'+_0x33776e['query'][_0xade1('0x3f')]+'%'};return _0x243ed5;}})});}_0x582e5b=_[_0xade1('0x41')]({},_0x582e5b,_0x33776e[_0xade1('0x42')]);var _0x5eb6b0={'where':_0x582e5b[_0xade1('0x3d')]};return db['AnalyticFieldReport'][_0xade1('0x1e')](_0x5eb6b0)[_0xade1('0x27')](function(_0x3167f1){_0x1a1d17[_0xade1('0x1e')]=_0x3167f1;if(_0x33776e['query']['includeAll']){_0x582e5b[_0xade1('0x43')]=[{'all':!![]}];}return db[_0xade1('0x2d')][_0xade1('0x44')](_0x582e5b);})[_0xade1('0x27')](function(_0x19c103){_0x1a1d17[_0xade1('0x45')]=_0x19c103;return _0x1a1d17;})['then'](respondWithFilteredResult(_0x4bf5cd,_0x582e5b))['catch'](handleError(_0x4bf5cd,null));};exports[_0xade1('0x46')]=function(_0x1ad8c5,_0x165997){var _0x455ca0={'raw':![],'where':{'id':_0x1ad8c5[_0xade1('0x47')]['id']}},_0x414b61={};_0x414b61[_0xade1('0x35')]=_[_0xade1('0x32')](db[_0xade1('0x2d')][_0xade1('0x2e')]);_0x414b61[_0xade1('0x31')]=_[_0xade1('0x32')](_0x1ad8c5[_0xade1('0x31')]);_0x414b61[_0xade1('0x33')]=_[_0xade1('0x34')](_0x414b61[_0xade1('0x35')],_0x414b61['query']);_0x455ca0[_0xade1('0x36')]=_['intersection'](_0x414b61[_0xade1('0x35')],qs[_0xade1('0x37')](_0x1ad8c5[_0xade1('0x31')]['fields']));_0x455ca0['attributes']=_0x455ca0[_0xade1('0x36')][_0xade1('0x38')]?_0x455ca0['attributes']:_0x414b61[_0xade1('0x35')];if(_0x1ad8c5[_0xade1('0x31')]['includeAll']){_0x455ca0[_0xade1('0x43')]=[{'all':!![]}];}_0x455ca0=_[_0xade1('0x41')]({},_0x455ca0,_0x1ad8c5[_0xade1('0x42')]);return db['AnalyticFieldReport'][_0xade1('0x48')](_0x455ca0)['then'](handleEntityNotFound(_0x165997,null))[_0xade1('0x27')](respondWithResult(_0x165997,null))[_0xade1('0x49')](handleError(_0x165997,null));};exports[_0xade1('0x4a')]=function(_0x3b09bc,_0x1f9f26){return db[_0xade1('0x2d')][_0xade1('0x4a')](_0x3b09bc['body'],{})[_0xade1('0x27')](respondWithResult(_0x1f9f26,0xc9))[_0xade1('0x49')](handleError(_0x1f9f26,null));};exports['bulkCreate']=function(_0x47db5b,_0x15cf1e){return db[_0xade1('0x2d')][_0xade1('0x4b')](_0x47db5b[_0xade1('0x4c')],{'raw':![],'individualHooks':!![]})[_0xade1('0x27')](respondWithResult(_0x15cf1e,0xc9))[_0xade1('0x49')](handleError(_0x15cf1e,null));};exports[_0xade1('0x26')]=function(_0x21ff2a,_0xaf7357){if(_0x21ff2a['body']['id']){delete _0x21ff2a['body']['id'];}return db[_0xade1('0x2d')][_0xade1('0x48')]({'where':{'id':_0x21ff2a[_0xade1('0x47')]['id']}})[_0xade1('0x27')](handleEntityNotFound(_0xaf7357,null))[_0xade1('0x27')](saveUpdates(_0x21ff2a['body'],null))['then'](respondWithResult(_0xaf7357,null))[_0xade1('0x49')](handleError(_0xaf7357,null));};exports[_0xade1('0x28')]=function(_0x7c71d9,_0x43861f){return db['AnalyticFieldReport'][_0xade1('0x48')]({'where':{'id':_0x7c71d9[_0xade1('0x47')]['id']}})[_0xade1('0x27')](handleEntityNotFound(_0x43861f,null))[_0xade1('0x27')](removeEntity(_0x43861f,null))['catch'](handleError(_0x43861f,null));};exports['bulkDestroy']=function(_0x5d506b,_0x4a15f4){return db['AnalyticFieldReport']['destroy']({'where':{'id':_0x5d506b[_0xade1('0x31')][_0xade1('0x4d')]||[]},'raw':![],'individualHooks':!![]})['then'](respondWithResult(_0x4a15f4,0xcc))['catch'](handleError(_0x4a15f4,null));};exports[_0xade1('0x4e')]=function(_0x486f7a,_0x195573,_0x175d36){return db['AnalyticCustomReport'][_0xade1('0x4f')]({'where':{'id':_0x486f7a[_0xade1('0x47')]['id']}})[_0xade1('0x27')](handleEntityNotFound(_0x195573,null))['then'](function(_0x4d2586){if(_0x4d2586){return db[_0xade1('0x50')]['transaction'](function(_0x363751){return db[_0xade1('0x2d')][_0xade1('0x28')]({'where':{'CustomReportId':_0x486f7a[_0xade1('0x47')]['id']},'transaction':_0x363751})[_0xade1('0x27')](function(_0x2b03da){var _0x1e835e=_['map'](_0x486f7a[_0xade1('0x4c')],function(_0x21bce2){delete _0x21bce2['id'];_0x21bce2['CustomReportId']=_0x486f7a['params']['id'];return _0x21bce2;});return db[_0xade1('0x2d')][_0xade1('0x4b')](_0x1e835e,{'transaction':_0x363751});});})[_0xade1('0x27')](function(){return db['AnalyticFieldReport'][_0xade1('0x44')]({'where':{'CustomReportId':_0x486f7a[_0xade1('0x47')]['id']}});});}})[_0xade1('0x27')](respondWithResult(_0x195573,null))[_0xade1('0x49')](handleError(_0x195573,null));};
\ No newline at end of file
+var _0xa064=['sort','where','pick','filter','VIRTUAL','merge','includeAll','findAll','rows','catch','show','params','keys','include','options','find','create','body','bulkCreate','bulkDestroy','findOne','sequelize','html-pdf','eml-format','rimraf','zip-dir','fast-json-patch','bluebird','util','path','to-csv','ejs','squel','crypto','querystring','papaparse','ioredis','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/environment','sendStatus','status','json','count','offset','set','Content-Range','apply','reject','save','update','then','destroy','end','name','send','map','AnalyticFieldReport','rawAttributes','fieldName','type','key','query','filters','intersection','model','attributes','fields','length','nolimit','limit','order'];(function(_0x5e64f5,_0x1d69c1){var _0x121424=function(_0xaa9c26){while(--_0xaa9c26){_0x5e64f5['push'](_0x5e64f5['shift']());}};_0x121424(++_0x1d69c1);}(_0xa064,0x192));var _0x4a06=function(_0x5da01c,_0x53bf77){_0x5da01c=_0x5da01c-0x0;var _0x1216c2=_0xa064[_0x5da01c];return _0x1216c2;};'use strict';var pdf=require(_0x4a06('0x0'));var emlformat=require(_0x4a06('0x1'));var rimraf=require(_0x4a06('0x2'));var zipdir=require(_0x4a06('0x3'));var jsonpatch=require(_0x4a06('0x4'));var rp=require('request-promise');var moment=require('moment');var BPromise=require(_0x4a06('0x5'));var Mustache=require('mustache');var util=require(_0x4a06('0x6'));var path=require(_0x4a06('0x7'));var sox=require('sox');var csv=require(_0x4a06('0x8'));var ejs=require(_0x4a06('0x9'));var fs=require('fs');var _=require('lodash');var squel=require(_0x4a06('0xa'));var crypto=require(_0x4a06('0xb'));var jsforce=require('jsforce');var deskjs=require('desk.js');var toCsv=require(_0x4a06('0x8'));var querystring=require(_0x4a06('0xc'));var Papa=require(_0x4a06('0xd'));var Redis=require(_0x4a06('0xe'));var authService=require('../../components/auth/service');var qs=require(_0x4a06('0xf'));var as=require(_0x4a06('0x10'));var hardwareService=require(_0x4a06('0x11'));var logger=require(_0x4a06('0x12'))(_0x4a06('0x13'));var utils=require(_0x4a06('0x14'));var config=require(_0x4a06('0x15'));var db=require('../../mysqldb')['db'];function respondWithStatusCode(_0x610aa7,_0x52818e){_0x52818e=_0x52818e||0xcc;return function(_0x16d686){if(_0x16d686){return _0x610aa7[_0x4a06('0x16')](_0x52818e);}return _0x610aa7[_0x4a06('0x17')](_0x52818e)['end']();};}function respondWithResult(_0xeb7556,_0xdbc234){_0xdbc234=_0xdbc234||0xc8;return function(_0xf9b166){if(_0xf9b166){return _0xeb7556['status'](_0xdbc234)[_0x4a06('0x18')](_0xf9b166);}};}function respondWithFilteredResult(_0x45adf2,_0x292770){return function(_0x51643c){if(_0x51643c){var _0x221a80=_0x51643c[_0x4a06('0x19')],_0x29e99b=_0x292770['offset'],_0xa2655c=_0x292770[_0x4a06('0x1a')]+_0x292770['limit'],_0x3574e9;if(_0xa2655c>=_0x221a80){_0xa2655c=_0x221a80;_0x3574e9=0xc8;}else{_0x3574e9=0xce;}_0x45adf2[_0x4a06('0x17')](_0x3574e9);return _0x45adf2[_0x4a06('0x1b')](_0x4a06('0x1c'),_0x29e99b+'-'+_0xa2655c+'/'+_0x221a80)[_0x4a06('0x18')](_0x51643c);}return null;};}function patchUpdates(_0x28b067){return function(_0x46d266){try{jsonpatch[_0x4a06('0x1d')](_0x46d266,_0x28b067,!![]);}catch(_0x39c640){return BPromise[_0x4a06('0x1e')](_0x39c640);}return _0x46d266[_0x4a06('0x1f')]();};}function saveUpdates(_0x4a53e0,_0x98df26){return function(_0x3933e6){if(_0x3933e6){return _0x3933e6[_0x4a06('0x20')](_0x4a53e0)[_0x4a06('0x21')](function(_0x379061){return _0x379061;});}return null;};}function removeEntity(_0x2822d6,_0x20f9f4){return function(_0x156af7){if(_0x156af7){return _0x156af7[_0x4a06('0x22')]()[_0x4a06('0x21')](function(){_0x2822d6[_0x4a06('0x17')](0xcc)[_0x4a06('0x23')]();});}};}function handleEntityNotFound(_0x38c823,_0x5ebd7c){return function(_0x501ee9){if(!_0x501ee9){_0x38c823[_0x4a06('0x16')](0x194);}return _0x501ee9;};}function handleError(_0x2ad64a,_0x272544){_0x272544=_0x272544||0x1f4;return function(_0x166f02){logger['error'](_0x166f02['stack']);if(_0x166f02[_0x4a06('0x24')]){delete _0x166f02[_0x4a06('0x24')];}_0x2ad64a['status'](_0x272544)[_0x4a06('0x25')](_0x166f02);};}exports['index']=function(_0xf5cb0,_0xa48043){var _0x524225={},_0x1a47be={},_0x16bc1b={'count':0x0,'rows':[]};var _0x1be810=_[_0x4a06('0x26')](db[_0x4a06('0x27')][_0x4a06('0x28')],function(_0x5ee187){return{'name':_0x5ee187[_0x4a06('0x29')],'type':_0x5ee187[_0x4a06('0x2a')][_0x4a06('0x2b')]};});_0x1a47be['model']=_[_0x4a06('0x26')](_0x1be810,_0x4a06('0x24'));_0x1a47be[_0x4a06('0x2c')]=_['keys'](_0xf5cb0['query']);_0x1a47be[_0x4a06('0x2d')]=_[_0x4a06('0x2e')](_0x1a47be[_0x4a06('0x2f')],_0x1a47be[_0x4a06('0x2c')]);_0x524225[_0x4a06('0x30')]=_[_0x4a06('0x2e')](_0x1a47be[_0x4a06('0x2f')],qs[_0x4a06('0x31')](_0xf5cb0['query'][_0x4a06('0x31')]));_0x524225[_0x4a06('0x30')]=_0x524225[_0x4a06('0x30')][_0x4a06('0x32')]?_0x524225[_0x4a06('0x30')]:_0x1a47be['model'];if(!_0xf5cb0[_0x4a06('0x2c')]['hasOwnProperty'](_0x4a06('0x33'))){_0x524225[_0x4a06('0x34')]=qs['limit'](_0xf5cb0[_0x4a06('0x2c')][_0x4a06('0x34')]);_0x524225[_0x4a06('0x1a')]=qs[_0x4a06('0x1a')](_0xf5cb0[_0x4a06('0x2c')]['offset']);}_0x524225[_0x4a06('0x35')]=qs['sort'](_0xf5cb0[_0x4a06('0x2c')][_0x4a06('0x36')]);_0x524225[_0x4a06('0x37')]=qs['filters'](_[_0x4a06('0x38')](_0xf5cb0[_0x4a06('0x2c')],_0x1a47be[_0x4a06('0x2d')]));if(_0xf5cb0[_0x4a06('0x2c')][_0x4a06('0x39')]){_0x524225[_0x4a06('0x37')]=_['merge'](_0x524225[_0x4a06('0x37')],{'$or':_['map'](_0x1be810,function(_0x207c94){if(_0x207c94[_0x4a06('0x2a')]!==_0x4a06('0x3a')){var _0x4e98ce={};_0x4e98ce[_0x207c94[_0x4a06('0x24')]]={'$like':'%'+_0xf5cb0['query'][_0x4a06('0x39')]+'%'};return _0x4e98ce;}})});}_0x524225=_[_0x4a06('0x3b')]({},_0x524225,_0xf5cb0['options']);var _0x218bf9={'where':_0x524225[_0x4a06('0x37')]};return db[_0x4a06('0x27')][_0x4a06('0x19')](_0x218bf9)[_0x4a06('0x21')](function(_0x305382){_0x16bc1b[_0x4a06('0x19')]=_0x305382;if(_0xf5cb0[_0x4a06('0x2c')][_0x4a06('0x3c')]){_0x524225['include']=[{'all':!![]}];}return db['AnalyticFieldReport'][_0x4a06('0x3d')](_0x524225);})[_0x4a06('0x21')](function(_0xedab1){_0x16bc1b[_0x4a06('0x3e')]=_0xedab1;return _0x16bc1b;})[_0x4a06('0x21')](respondWithFilteredResult(_0xa48043,_0x524225))[_0x4a06('0x3f')](handleError(_0xa48043,null));};exports[_0x4a06('0x40')]=function(_0x554856,_0x49ee96){var _0x465938={'raw':![],'where':{'id':_0x554856[_0x4a06('0x41')]['id']}},_0x3301be={};_0x3301be[_0x4a06('0x2f')]=_[_0x4a06('0x42')](db['AnalyticFieldReport'][_0x4a06('0x28')]);_0x3301be['query']=_[_0x4a06('0x42')](_0x554856[_0x4a06('0x2c')]);_0x3301be[_0x4a06('0x2d')]=_[_0x4a06('0x2e')](_0x3301be['model'],_0x3301be[_0x4a06('0x2c')]);_0x465938[_0x4a06('0x30')]=_[_0x4a06('0x2e')](_0x3301be['model'],qs[_0x4a06('0x31')](_0x554856[_0x4a06('0x2c')][_0x4a06('0x31')]));_0x465938['attributes']=_0x465938[_0x4a06('0x30')][_0x4a06('0x32')]?_0x465938[_0x4a06('0x30')]:_0x3301be[_0x4a06('0x2f')];if(_0x554856[_0x4a06('0x2c')][_0x4a06('0x3c')]){_0x465938[_0x4a06('0x43')]=[{'all':!![]}];}_0x465938=_[_0x4a06('0x3b')]({},_0x465938,_0x554856[_0x4a06('0x44')]);return db[_0x4a06('0x27')][_0x4a06('0x45')](_0x465938)[_0x4a06('0x21')](handleEntityNotFound(_0x49ee96,null))[_0x4a06('0x21')](respondWithResult(_0x49ee96,null))['catch'](handleError(_0x49ee96,null));};exports[_0x4a06('0x46')]=function(_0x4f52c0,_0x3ddf88){return db[_0x4a06('0x27')][_0x4a06('0x46')](_0x4f52c0[_0x4a06('0x47')],{})[_0x4a06('0x21')](respondWithResult(_0x3ddf88,0xc9))['catch'](handleError(_0x3ddf88,null));};exports[_0x4a06('0x48')]=function(_0x1f4fad,_0x24cdf8){return db['AnalyticFieldReport'][_0x4a06('0x48')](_0x1f4fad[_0x4a06('0x47')],{'raw':![],'individualHooks':!![]})[_0x4a06('0x21')](respondWithResult(_0x24cdf8,0xc9))['catch'](handleError(_0x24cdf8,null));};exports[_0x4a06('0x20')]=function(_0x2824ed,_0x131caa){if(_0x2824ed[_0x4a06('0x47')]['id']){delete _0x2824ed[_0x4a06('0x47')]['id'];}return db[_0x4a06('0x27')]['find']({'where':{'id':_0x2824ed[_0x4a06('0x41')]['id']}})[_0x4a06('0x21')](handleEntityNotFound(_0x131caa,null))[_0x4a06('0x21')](saveUpdates(_0x2824ed[_0x4a06('0x47')],null))[_0x4a06('0x21')](respondWithResult(_0x131caa,null))[_0x4a06('0x3f')](handleError(_0x131caa,null));};exports['destroy']=function(_0xcfa915,_0x5c7951){return db['AnalyticFieldReport'][_0x4a06('0x45')]({'where':{'id':_0xcfa915[_0x4a06('0x41')]['id']}})[_0x4a06('0x21')](handleEntityNotFound(_0x5c7951,null))[_0x4a06('0x21')](removeEntity(_0x5c7951,null))[_0x4a06('0x3f')](handleError(_0x5c7951,null));};exports[_0x4a06('0x49')]=function(_0x4b8fd3,_0x391930){return db[_0x4a06('0x27')]['destroy']({'where':{'id':_0x4b8fd3[_0x4a06('0x2c')]['ids']||[]},'raw':![],'individualHooks':!![]})['then'](respondWithResult(_0x391930,0xcc))[_0x4a06('0x3f')](handleError(_0x391930,null));};exports['addFields']=function(_0x2d45fe,_0x24c759,_0x1746cc){return db['AnalyticCustomReport'][_0x4a06('0x4a')]({'where':{'id':_0x2d45fe[_0x4a06('0x41')]['id']}})[_0x4a06('0x21')](handleEntityNotFound(_0x24c759,null))['then'](function(_0x5d9be6){if(_0x5d9be6){return db[_0x4a06('0x4b')]['transaction'](function(_0x40a24a){return db[_0x4a06('0x27')][_0x4a06('0x22')]({'where':{'CustomReportId':_0x2d45fe[_0x4a06('0x41')]['id']},'transaction':_0x40a24a})[_0x4a06('0x21')](function(_0x26b65d){var _0x378fd6=_[_0x4a06('0x26')](_0x2d45fe[_0x4a06('0x47')],function(_0x4276ed){delete _0x4276ed['id'];_0x4276ed['CustomReportId']=_0x2d45fe[_0x4a06('0x41')]['id'];return _0x4276ed;});return db[_0x4a06('0x27')]['bulkCreate'](_0x378fd6,{'transaction':_0x40a24a});});})[_0x4a06('0x21')](function(){return db[_0x4a06('0x27')][_0x4a06('0x3d')]({'where':{'CustomReportId':_0x2d45fe[_0x4a06('0x41')]['id']}});});}})[_0x4a06('0x21')](respondWithResult(_0x24c759,null))['catch'](handleError(_0x24c759,null));};
\ No newline at end of file
diff --git a/server/api/analyticFieldReport/analyticFieldReport.model.js b/server/api/analyticFieldReport/analyticFieldReport.model.js
index 3b27b1a..c7ddee4 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 _0x309c=['exports','define','AnalyticFieldReport','analytics_report_fields','util','api','bluebird','request-promise','path','rimraf','../../config/environment','./analyticFieldReport.attributes'];(function(_0x56e333,_0x3b4e72){var _0x3196c7=function(_0x56f83c){while(--_0x56f83c){_0x56e333['push'](_0x56e333['shift']());}};_0x3196c7(++_0x3b4e72);}(_0x309c,0x1f0));var _0xc309=function(_0x1670dd,_0x46d3c0){_0x1670dd=_0x1670dd-0x0;var _0x4bd80d=_0x309c[_0x1670dd];return _0x4bd80d;};'use strict';var _=require('lodash');var util=require(_0xc309('0x0'));var logger=require('../../config/logger')(_0xc309('0x1'));var moment=require('moment');var BPromise=require(_0xc309('0x2'));var rp=require(_0xc309('0x3'));var fs=require('fs');var path=require(_0xc309('0x4'));var rimraf=require(_0xc309('0x5'));var config=require(_0xc309('0x6'));var attributes=require(_0xc309('0x7'));module[_0xc309('0x8')]=function(_0x2a4a51,_0x284165){return _0x2a4a51[_0xc309('0x9')](_0xc309('0xa'),attributes,{'tableName':_0xc309('0xb'),'paranoid':![],'indexes':[],'timestamps':!![]});};
\ No newline at end of file
+var _0x70c0=['analytics_report_fields','util','../../config/logger','request-promise','rimraf','exports','AnalyticFieldReport'];(function(_0x20a584,_0xe384a5){var _0x4b41a8=function(_0x2127c6){while(--_0x2127c6){_0x20a584['push'](_0x20a584['shift']());}};_0x4b41a8(++_0xe384a5);}(_0x70c0,0xd3));var _0x070c=function(_0x1eb2d3,_0x120337){_0x1eb2d3=_0x1eb2d3-0x0;var _0x23d40f=_0x70c0[_0x1eb2d3];return _0x23d40f;};'use strict';var _=require('lodash');var util=require(_0x070c('0x0'));var logger=require(_0x070c('0x1'))('api');var moment=require('moment');var BPromise=require('bluebird');var rp=require(_0x070c('0x2'));var fs=require('fs');var path=require('path');var rimraf=require(_0x070c('0x3'));var config=require('../../config/environment');var attributes=require('./analyticFieldReport.attributes');module[_0x070c('0x4')]=function(_0x28ef2e,_0x420b33){return _0x28ef2e['define'](_0x070c('0x5'),attributes,{'tableName':_0x070c('0x6'),'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 b258b41..ad4cc6f 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 _0x1b2e=['AnalyticFieldReport,\x20%s,\x20%s','request\x20sent','debug','AnalyticFieldReport,\x20%s,\x20%s,\x20%s','stringify','error','code','message','catch','lodash','util','moment','bluebird','randomstring','../../config/utils','../../config/logger','jayson/promise','client','http','request','then','info'];(function(_0x257ab3,_0x268b68){var _0x45d8d9=function(_0x5333cd){while(--_0x5333cd){_0x257ab3['push'](_0x257ab3['shift']());}};_0x45d8d9(++_0x268b68);}(_0x1b2e,0x127));var _0xe1b2=function(_0x185b15,_0x49eeda){_0x185b15=_0x185b15-0x0;var _0x224d9d=_0x1b2e[_0x185b15];return _0x224d9d;};'use strict';var _=require(_0xe1b2('0x0'));var util=require(_0xe1b2('0x1'));var moment=require(_0xe1b2('0x2'));var BPromise=require(_0xe1b2('0x3'));var rs=require(_0xe1b2('0x4'));var fs=require('fs');var Redis=require('ioredis');var db=require('../../mysqldb')['db'];var utils=require(_0xe1b2('0x5'));var logger=require(_0xe1b2('0x6'))('rpc');var config=require('../../config/environment');var jayson=require(_0xe1b2('0x7'));var client=jayson[_0xe1b2('0x8')][_0xe1b2('0x9')]({'port':0x232a});function respondWithRpcPromise(_0x425fc3,_0x1f8783,_0x32454f){return new BPromise(function(_0x1146eb,_0x1ae581){return client[_0xe1b2('0xa')](_0x425fc3,_0x32454f)[_0xe1b2('0xb')](function(_0x456ae2){logger[_0xe1b2('0xc')](_0xe1b2('0xd'),_0x1f8783,_0xe1b2('0xe'));logger[_0xe1b2('0xf')](_0xe1b2('0x10'),_0x1f8783,_0xe1b2('0xe'),JSON[_0xe1b2('0x11')](_0x456ae2));if(_0x456ae2[_0xe1b2('0x12')]){if(_0x456ae2[_0xe1b2('0x12')][_0xe1b2('0x13')]===0x1f4){logger['error'](_0xe1b2('0xd'),_0x1f8783,_0x456ae2[_0xe1b2('0x12')][_0xe1b2('0x14')]);return _0x1ae581(_0x456ae2['error'][_0xe1b2('0x14')]);}logger[_0xe1b2('0x12')](_0xe1b2('0xd'),_0x1f8783,_0x456ae2['error'][_0xe1b2('0x14')]);return _0x1146eb(_0x456ae2[_0xe1b2('0x12')][_0xe1b2('0x14')]);}else{logger[_0xe1b2('0xc')](_0xe1b2('0xd'),_0x1f8783,_0xe1b2('0xe'));_0x1146eb(_0x456ae2['result'][_0xe1b2('0x14')]);}})[_0xe1b2('0x15')](function(_0x11bffb){logger['error'](_0xe1b2('0xd'),_0x1f8783,_0x11bffb);_0x1ae581(_0x11bffb);});});}
\ No newline at end of file
+var _0x44fe=['rpc','../../config/environment','jayson/promise','client','request','info','request\x20sent','debug','AnalyticFieldReport,\x20%s,\x20%s,\x20%s','stringify','error','code','AnalyticFieldReport,\x20%s,\x20%s','message','result','catch','lodash','util','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger'];(function(_0x9b3efc,_0x577a0d){var _0x200f05=function(_0x15ad7c){while(--_0x15ad7c){_0x9b3efc['push'](_0x9b3efc['shift']());}};_0x200f05(++_0x577a0d);}(_0x44fe,0x10a));var _0xe44f=function(_0x16fd4a,_0x573084){_0x16fd4a=_0x16fd4a-0x0;var _0x36defc=_0x44fe[_0x16fd4a];return _0x36defc;};'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(_0xe44f('0xb'));var client=jayson[_0xe44f('0xc')]['http']({'port':0x232a});function respondWithRpcPromise(_0x254411,_0x1b7ef1,_0x547169){return new BPromise(function(_0x4809fd,_0x3e2407){return client[_0xe44f('0xd')](_0x254411,_0x547169)['then'](function(_0x4e5fd5){logger[_0xe44f('0xe')]('AnalyticFieldReport,\x20%s,\x20%s',_0x1b7ef1,_0xe44f('0xf'));logger[_0xe44f('0x10')](_0xe44f('0x11'),_0x1b7ef1,_0xe44f('0xf'),JSON[_0xe44f('0x12')](_0x4e5fd5));if(_0x4e5fd5[_0xe44f('0x13')]){if(_0x4e5fd5[_0xe44f('0x13')][_0xe44f('0x14')]===0x1f4){logger[_0xe44f('0x13')](_0xe44f('0x15'),_0x1b7ef1,_0x4e5fd5[_0xe44f('0x13')][_0xe44f('0x16')]);return _0x3e2407(_0x4e5fd5[_0xe44f('0x13')][_0xe44f('0x16')]);}logger[_0xe44f('0x13')](_0xe44f('0x15'),_0x1b7ef1,_0x4e5fd5[_0xe44f('0x13')][_0xe44f('0x16')]);return _0x4809fd(_0x4e5fd5[_0xe44f('0x13')][_0xe44f('0x16')]);}else{logger[_0xe44f('0xe')](_0xe44f('0x15'),_0x1b7ef1,'request\x20sent');_0x4809fd(_0x4e5fd5[_0xe44f('0x17')][_0xe44f('0x16')]);}})[_0xe44f('0x18')](function(_0x51220b){logger['error'](_0xe44f('0x15'),_0x1b7ef1,_0x51220b);_0x3e2407(_0x51220b);});});}
\ No newline at end of file
diff --git a/server/api/analyticFieldReport/index.js b/server/api/analyticFieldReport/index.js
index 4f7f7e1..4c747ba 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 _0x5fc3=['get','isAuthenticated','/:id','show','post','create','/create_many','/:id/create_many','addFields','put','update','delete','destroy','exports','multer','util','connect-timeout','express','Router','../../components/auth/service','../../components/interaction/service','./analyticFieldReport.controller'];(function(_0x1e4bbb,_0x11ccde){var _0x9aec35=function(_0xd2b20){while(--_0xd2b20){_0x1e4bbb['push'](_0x1e4bbb['shift']());}};_0x9aec35(++_0x11ccde);}(_0x5fc3,0xa8));var _0x35fc=function(_0x6173fc,_0x32aadf){_0x6173fc=_0x6173fc-0x0;var _0x965fbe=_0x5fc3[_0x6173fc];return _0x965fbe;};'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('0xc')](_0x35fc('0xe'),auth[_0x35fc('0x9')](),controller['bulkCreate']);router[_0x35fc('0xc')](_0x35fc('0xf'),auth['isAuthenticated'](),controller[_0x35fc('0x10')]);router[_0x35fc('0x11')]('/:id',auth[_0x35fc('0x9')](),controller[_0x35fc('0x12')]);router['delete']('/destroy_many',auth[_0x35fc('0x9')](),controller['bulkDestroy']);router[_0x35fc('0x13')](_0x35fc('0xa'),auth[_0x35fc('0x9')](),controller[_0x35fc('0x14')]);module[_0x35fc('0x15')]=router;
\ No newline at end of file
+var _0x9957=['../../config/environment','get','isAuthenticated','index','/:id','post','/create_many','bulkCreate','/:id/create_many','put','update','delete','/destroy_many','bulkDestroy','exports','multer','util','path','connect-timeout','Router','../../components/auth/service','../../components/interaction/service'];(function(_0x5f3f88,_0x562baf){var _0xd08119=function(_0x42dbf7){while(--_0x42dbf7){_0x5f3f88['push'](_0x5f3f88['shift']());}};_0xd08119(++_0x562baf);}(_0x9957,0x93));var _0x7995=function(_0x4cf98e,_0xba4b79){_0x4cf98e=_0x4cf98e-0x0;var _0x1623ac=_0x9957[_0x4cf98e];return _0x1623ac;};'use strict';var multer=require(_0x7995('0x0'));var util=require(_0x7995('0x1'));var path=require(_0x7995('0x2'));var timeout=require(_0x7995('0x3'));var express=require('express');var router=express[_0x7995('0x4')]();var auth=require(_0x7995('0x5'));var interaction=require(_0x7995('0x6'));var config=require(_0x7995('0x7'));var controller=require('./analyticFieldReport.controller');router[_0x7995('0x8')]('/',auth[_0x7995('0x9')](),controller[_0x7995('0xa')]);router[_0x7995('0x8')](_0x7995('0xb'),auth[_0x7995('0x9')](),controller['show']);router[_0x7995('0xc')]('/',auth[_0x7995('0x9')](),controller['create']);router[_0x7995('0xc')](_0x7995('0xd'),auth[_0x7995('0x9')](),controller[_0x7995('0xe')]);router[_0x7995('0xc')](_0x7995('0xf'),auth[_0x7995('0x9')](),controller['addFields']);router[_0x7995('0x10')](_0x7995('0xb'),auth['isAuthenticated'](),controller[_0x7995('0x11')]);router[_0x7995('0x12')](_0x7995('0x13'),auth[_0x7995('0x9')](),controller[_0x7995('0x14')]);router[_0x7995('0x12')](_0x7995('0xb'),auth['isAuthenticated'](),controller['destroy']);module[_0x7995('0x15')]=router;
\ No newline at end of file
diff --git a/server/api/analyticMetric/analyticMetric.attributes.js b/server/api/analyticMetric/analyticMetric.attributes.js
index 0ff245d..1b88736 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 _0xcd31=['TEXT','exports','STRING','name'];(function(_0x3dd15e,_0x1f0015){var _0x231fd0=function(_0x4f680a){while(--_0x4f680a){_0x3dd15e['push'](_0x3dd15e['shift']());}};_0x231fd0(++_0x1f0015);}(_0xcd31,0x15d));var _0x1cd3=function(_0x46b979,_0x3f0e9a){_0x46b979=_0x46b979-0x0;var _0x355217=_0xcd31[_0x46b979];return _0x355217;};'use strict';var Sequelize=require('sequelize');module[_0x1cd3('0x0')]={'name':{'type':Sequelize[_0x1cd3('0x1')],'allowNull':![],'unique':_0x1cd3('0x2')},'table':{'type':Sequelize['STRING']},'metric':{'type':Sequelize[_0x1cd3('0x3')]},'description':{'type':Sequelize[_0x1cd3('0x1')]}};
\ No newline at end of file
+var _0xc30f=['TEXT','sequelize','exports','STRING','name'];(function(_0x39a292,_0x5de91f){var _0x894739=function(_0x1bb621){while(--_0x1bb621){_0x39a292['push'](_0x39a292['shift']());}};_0x894739(++_0x5de91f);}(_0xc30f,0x97));var _0xfc30=function(_0x2236dc,_0x43c7f9){_0x2236dc=_0x2236dc-0x0;var _0x20583f=_0xc30f[_0x2236dc];return _0x20583f;};'use strict';var Sequelize=require(_0xfc30('0x0'));module[_0xfc30('0x1')]={'name':{'type':Sequelize[_0xfc30('0x2')],'allowNull':![],'unique':_0xfc30('0x3')},'table':{'type':Sequelize['STRING']},'metric':{'type':Sequelize[_0xfc30('0x4')]},'description':{'type':Sequelize[_0xfc30('0x2')]}};
\ No newline at end of file
diff --git a/server/api/analyticMetric/analyticMetric.controller.js b/server/api/analyticMetric/analyticMetric.controller.js
index edd0769..05bb099 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 _0x3a76=['user','UserProfileSection','userProfileId','catch','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','html-pdf','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','../../config/license/hardware','../../config/logger','api','../../config/environment','../../mysqldb','sendStatus','status','end','json','count','offset','Content-Range','apply','reject','save','update','then','destroy','get','Metrics','UserProfileResource','error','stack','name','send','index','map','AnalyticMetric','rawAttributes','fieldName','type','model','query','keys','filters','intersection','attributes','fields','hasOwnProperty','nolimit','limit','order','sort','filter','merge','VIRTUAL','options','where','includeAll','rows','params','length','include','find','create','body','Unable\x20to\x20retrieve\x20the\x20current\x20user'];(function(_0x19610b,_0x579b83){var _0x3abe75=function(_0x44bd6d){while(--_0x44bd6d){_0x19610b['push'](_0x19610b['shift']());}};_0x3abe75(++_0x579b83);}(_0x3a76,0xfb));var _0x63a7=function(_0x1abd1c,_0x311b1f){_0x1abd1c=_0x1abd1c-0x0;var _0x5827f0=_0x3a76[_0x1abd1c];return _0x5827f0;};'use strict';var pdf=require(_0x63a7('0x0'));var emlformat=require('eml-format');var rimraf=require('rimraf');var zipdir=require('zip-dir');var jsonpatch=require(_0x63a7('0x1'));var rp=require(_0x63a7('0x2'));var moment=require(_0x63a7('0x3'));var BPromise=require(_0x63a7('0x4'));var Mustache=require(_0x63a7('0x5'));var util=require(_0x63a7('0x6'));var path=require(_0x63a7('0x7'));var sox=require(_0x63a7('0x8'));var csv=require('to-csv');var ejs=require(_0x63a7('0x9'));var fs=require('fs');var _=require('lodash');var squel=require(_0x63a7('0xa'));var crypto=require(_0x63a7('0xb'));var jsforce=require(_0x63a7('0xc'));var deskjs=require(_0x63a7('0xd'));var toCsv=require(_0x63a7('0xe'));var querystring=require(_0x63a7('0xf'));var Papa=require(_0x63a7('0x10'));var Redis=require(_0x63a7('0x11'));var authService=require(_0x63a7('0x12'));var qs=require(_0x63a7('0x13'));var as=require('../../components/parsers/advancedSearch');var hardwareService=require(_0x63a7('0x14'));var logger=require(_0x63a7('0x15'))(_0x63a7('0x16'));var utils=require('../../config/utils');var config=require(_0x63a7('0x17'));var db=require(_0x63a7('0x18'))['db'];function respondWithStatusCode(_0x1bd74d,_0x204ba4){_0x204ba4=_0x204ba4||0xcc;return function(_0x4ec1ff){if(_0x4ec1ff){return _0x1bd74d[_0x63a7('0x19')](_0x204ba4);}return _0x1bd74d[_0x63a7('0x1a')](_0x204ba4)[_0x63a7('0x1b')]();};}function respondWithResult(_0x57986f,_0x37b79f){_0x37b79f=_0x37b79f||0xc8;return function(_0x26f71e){if(_0x26f71e){return _0x57986f[_0x63a7('0x1a')](_0x37b79f)[_0x63a7('0x1c')](_0x26f71e);}};}function respondWithFilteredResult(_0x2d1804,_0x44c077){return function(_0x582239){if(_0x582239){var _0xf69312=_0x582239[_0x63a7('0x1d')],_0x2fbb93=_0x44c077[_0x63a7('0x1e')],_0x4d57b2=_0x44c077['offset']+_0x44c077['limit'],_0x5a1e91;if(_0x4d57b2>=_0xf69312){_0x4d57b2=_0xf69312;_0x5a1e91=0xc8;}else{_0x5a1e91=0xce;}_0x2d1804[_0x63a7('0x1a')](_0x5a1e91);return _0x2d1804['set'](_0x63a7('0x1f'),_0x2fbb93+'-'+_0x4d57b2+'/'+_0xf69312)[_0x63a7('0x1c')](_0x582239);}return null;};}function patchUpdates(_0x3395e2){return function(_0x499fd2){try{jsonpatch[_0x63a7('0x20')](_0x499fd2,_0x3395e2,!![]);}catch(_0x4dd603){return BPromise[_0x63a7('0x21')](_0x4dd603);}return _0x499fd2[_0x63a7('0x22')]();};}function saveUpdates(_0x5cc987,_0x451ca3){return function(_0xdf7b39){if(_0xdf7b39){return _0xdf7b39[_0x63a7('0x23')](_0x5cc987)[_0x63a7('0x24')](function(_0x3fbb37){return _0x3fbb37;});}return null;};}function removeEntity(_0x4193a7,_0x355a8a){return function(_0x3e54ff){if(_0x3e54ff){return _0x3e54ff[_0x63a7('0x25')]()['then'](function(){var _0x35e732=_0x3e54ff[_0x63a7('0x26')]({'plain':!![]});var _0x53d893=_0x63a7('0x27');return db[_0x63a7('0x28')][_0x63a7('0x25')]({'where':{'type':_0x53d893,'resourceId':_0x35e732['id']}})['then'](function(){return _0x3e54ff;});})['then'](function(){_0x4193a7[_0x63a7('0x1a')](0xcc)[_0x63a7('0x1b')]();});}};}function handleEntityNotFound(_0xc919d3,_0x3b1012){return function(_0xe582ca){if(!_0xe582ca){_0xc919d3['sendStatus'](0x194);}return _0xe582ca;};}function handleError(_0x6143e5,_0x23d477){_0x23d477=_0x23d477||0x1f4;return function(_0x1c5960){logger[_0x63a7('0x29')](_0x1c5960[_0x63a7('0x2a')]);if(_0x1c5960['name']){delete _0x1c5960[_0x63a7('0x2b')];}_0x6143e5[_0x63a7('0x1a')](_0x23d477)[_0x63a7('0x2c')](_0x1c5960);};}exports[_0x63a7('0x2d')]=function(_0x31d842,_0x5495b9){var _0x3d8c30={},_0x4af72a={},_0x1e8818={'count':0x0,'rows':[]};var _0x1791b4=_[_0x63a7('0x2e')](db[_0x63a7('0x2f')][_0x63a7('0x30')],function(_0x56dea9){return{'name':_0x56dea9[_0x63a7('0x31')],'type':_0x56dea9[_0x63a7('0x32')]['key']};});_0x4af72a[_0x63a7('0x33')]=_[_0x63a7('0x2e')](_0x1791b4,_0x63a7('0x2b'));_0x4af72a[_0x63a7('0x34')]=_[_0x63a7('0x35')](_0x31d842['query']);_0x4af72a[_0x63a7('0x36')]=_[_0x63a7('0x37')](_0x4af72a[_0x63a7('0x33')],_0x4af72a[_0x63a7('0x34')]);_0x3d8c30[_0x63a7('0x38')]=_[_0x63a7('0x37')](_0x4af72a[_0x63a7('0x33')],qs[_0x63a7('0x39')](_0x31d842['query'][_0x63a7('0x39')]));_0x3d8c30['attributes']=_0x3d8c30[_0x63a7('0x38')]['length']?_0x3d8c30['attributes']:_0x4af72a['model'];if(!_0x31d842[_0x63a7('0x34')][_0x63a7('0x3a')](_0x63a7('0x3b'))){_0x3d8c30[_0x63a7('0x3c')]=qs['limit'](_0x31d842[_0x63a7('0x34')]['limit']);_0x3d8c30[_0x63a7('0x1e')]=qs['offset'](_0x31d842[_0x63a7('0x34')][_0x63a7('0x1e')]);}_0x3d8c30[_0x63a7('0x3d')]=qs[_0x63a7('0x3e')](_0x31d842[_0x63a7('0x34')][_0x63a7('0x3e')]);_0x3d8c30['where']=qs[_0x63a7('0x36')](_['pick'](_0x31d842[_0x63a7('0x34')],_0x4af72a[_0x63a7('0x36')]));if(_0x31d842[_0x63a7('0x34')][_0x63a7('0x3f')]){_0x3d8c30['where']=_[_0x63a7('0x40')](_0x3d8c30['where'],{'$or':_[_0x63a7('0x2e')](_0x1791b4,function(_0xf82278){if(_0xf82278[_0x63a7('0x32')]!==_0x63a7('0x41')){var _0x3e940e={};_0x3e940e[_0xf82278[_0x63a7('0x2b')]]={'$like':'%'+_0x31d842[_0x63a7('0x34')][_0x63a7('0x3f')]+'%'};return _0x3e940e;}})});}_0x3d8c30=_[_0x63a7('0x40')]({},_0x3d8c30,_0x31d842[_0x63a7('0x42')]);var _0x15bc8c={'where':_0x3d8c30[_0x63a7('0x43')]};return db[_0x63a7('0x2f')]['count'](_0x15bc8c)['then'](function(_0x13e558){_0x1e8818['count']=_0x13e558;if(_0x31d842[_0x63a7('0x34')][_0x63a7('0x44')]){_0x3d8c30['include']=[{'all':!![]}];}return db[_0x63a7('0x2f')]['findAll'](_0x3d8c30);})[_0x63a7('0x24')](function(_0x3c28d8){_0x1e8818[_0x63a7('0x45')]=_0x3c28d8;return _0x1e8818;})[_0x63a7('0x24')](respondWithFilteredResult(_0x5495b9,_0x3d8c30))['catch'](handleError(_0x5495b9,null));};exports['show']=function(_0x142539,_0x2b2d5e){var _0x5ba606={'raw':!![],'where':{'id':_0x142539[_0x63a7('0x46')]['id']}},_0x598680={};_0x598680['model']=_[_0x63a7('0x35')](db['AnalyticMetric'][_0x63a7('0x30')]);_0x598680['query']=_['keys'](_0x142539[_0x63a7('0x34')]);_0x598680[_0x63a7('0x36')]=_[_0x63a7('0x37')](_0x598680[_0x63a7('0x33')],_0x598680[_0x63a7('0x34')]);_0x5ba606[_0x63a7('0x38')]=_[_0x63a7('0x37')](_0x598680[_0x63a7('0x33')],qs[_0x63a7('0x39')](_0x142539[_0x63a7('0x34')]['fields']));_0x5ba606[_0x63a7('0x38')]=_0x5ba606['attributes'][_0x63a7('0x47')]?_0x5ba606['attributes']:_0x598680[_0x63a7('0x33')];if(_0x142539[_0x63a7('0x34')][_0x63a7('0x44')]){_0x5ba606[_0x63a7('0x48')]=[{'all':!![]}];}_0x5ba606=_['merge']({},_0x5ba606,_0x142539[_0x63a7('0x42')]);return db[_0x63a7('0x2f')][_0x63a7('0x49')](_0x5ba606)[_0x63a7('0x24')](handleEntityNotFound(_0x2b2d5e,null))['then'](respondWithResult(_0x2b2d5e,null))['catch'](handleError(_0x2b2d5e,null));};exports[_0x63a7('0x4a')]=function(_0x54aed3,_0x1e5b64){return db[_0x63a7('0x2f')][_0x63a7('0x4a')](_0x54aed3[_0x63a7('0x4b')],{})[_0x63a7('0x24')](function(_0x47e0e4){var _0x16aef3=_0x54aed3['user'][_0x63a7('0x26')]({'plain':!![]});if(!_0x16aef3)throw new Error(_0x63a7('0x4c'));if(_0x16aef3['role']===_0x63a7('0x4d')){var _0x245d41=_0x47e0e4[_0x63a7('0x26')]({'plain':!![]});var _0x351512=_0x63a7('0x27');return db[_0x63a7('0x4e')][_0x63a7('0x49')]({'where':{'name':_0x351512,'userProfileId':_0x16aef3[_0x63a7('0x4f')]},'raw':!![]})[_0x63a7('0x24')](function(_0x524e19){if(_0x524e19&&_0x524e19['autoAssociation']===0x0){return db[_0x63a7('0x28')][_0x63a7('0x4a')]({'name':_0x245d41[_0x63a7('0x2b')],'resourceId':_0x245d41['id'],'type':_0x524e19[_0x63a7('0x2b')],'sectionId':_0x524e19['id']},{})['then'](function(){return _0x47e0e4;});}else{return _0x47e0e4;}})[_0x63a7('0x50')](function(_0x5731d3){logger[_0x63a7('0x29')](_0x63a7('0x51'),_0x5731d3);throw _0x5731d3;});}return _0x47e0e4;})[_0x63a7('0x24')](respondWithResult(_0x1e5b64,0xc9))[_0x63a7('0x50')](handleError(_0x1e5b64,null));};exports[_0x63a7('0x23')]=function(_0x77c790,_0x53f56c){if(_0x77c790['body']['id']){delete _0x77c790['body']['id'];}return db[_0x63a7('0x2f')][_0x63a7('0x49')]({'where':{'id':_0x77c790[_0x63a7('0x46')]['id']}})[_0x63a7('0x24')](handleEntityNotFound(_0x53f56c,null))[_0x63a7('0x24')](saveUpdates(_0x77c790['body'],null))[_0x63a7('0x24')](respondWithResult(_0x53f56c,null))[_0x63a7('0x50')](handleError(_0x53f56c,null));};exports[_0x63a7('0x25')]=function(_0x48a089,_0x5beb5a){return db[_0x63a7('0x2f')][_0x63a7('0x49')]({'where':{'id':_0x48a089[_0x63a7('0x46')]['id']}})[_0x63a7('0x24')](handleEntityNotFound(_0x5beb5a,null))[_0x63a7('0x24')](removeEntity(_0x5beb5a,null))[_0x63a7('0x50')](handleError(_0x5beb5a,null));};
\ No newline at end of file
+var _0xd5fb=['userProfileId','autoAssociation','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','html-pdf','eml-format','fast-json-patch','moment','bluebird','mustache','util','path','squel','jsforce','desk.js','to-csv','querystring','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/environment','../../mysqldb','sendStatus','status','end','json','count','offset','limit','set','reject','save','update','destroy','then','get','UserProfileResource','error','stack','name','send','map','AnalyticMetric','rawAttributes','fieldName','key','query','keys','model','attributes','intersection','fields','length','hasOwnProperty','order','sort','where','filters','pick','merge','type','VIRTUAL','filter','options','includeAll','include','findAll','catch','params','create','body','user','role','Metrics','UserProfileSection','find'];(function(_0x2415ad,_0x1cc8b8){var _0x2b3c93=function(_0x3f3b99){while(--_0x3f3b99){_0x2415ad['push'](_0x2415ad['shift']());}};_0x2b3c93(++_0x1cc8b8);}(_0xd5fb,0x1e3));var _0xbd5f=function(_0x21eef2,_0x1480ea){_0x21eef2=_0x21eef2-0x0;var _0x32f106=_0xd5fb[_0x21eef2];return _0x32f106;};'use strict';var pdf=require(_0xbd5f('0x0'));var emlformat=require(_0xbd5f('0x1'));var rimraf=require('rimraf');var zipdir=require('zip-dir');var jsonpatch=require(_0xbd5f('0x2'));var rp=require('request-promise');var moment=require(_0xbd5f('0x3'));var BPromise=require(_0xbd5f('0x4'));var Mustache=require(_0xbd5f('0x5'));var util=require(_0xbd5f('0x6'));var path=require(_0xbd5f('0x7'));var sox=require('sox');var csv=require('to-csv');var ejs=require('ejs');var fs=require('fs');var _=require('lodash');var squel=require(_0xbd5f('0x8'));var crypto=require('crypto');var jsforce=require(_0xbd5f('0x9'));var deskjs=require(_0xbd5f('0xa'));var toCsv=require(_0xbd5f('0xb'));var querystring=require(_0xbd5f('0xc'));var Papa=require('papaparse');var Redis=require(_0xbd5f('0xd'));var authService=require(_0xbd5f('0xe'));var qs=require(_0xbd5f('0xf'));var as=require(_0xbd5f('0x10'));var hardwareService=require(_0xbd5f('0x11'));var logger=require(_0xbd5f('0x12'))(_0xbd5f('0x13'));var utils=require(_0xbd5f('0x14'));var config=require(_0xbd5f('0x15'));var db=require(_0xbd5f('0x16'))['db'];function respondWithStatusCode(_0x4fd64b,_0x190f7e){_0x190f7e=_0x190f7e||0xcc;return function(_0x42907a){if(_0x42907a){return _0x4fd64b[_0xbd5f('0x17')](_0x190f7e);}return _0x4fd64b[_0xbd5f('0x18')](_0x190f7e)[_0xbd5f('0x19')]();};}function respondWithResult(_0x145f0e,_0x368f55){_0x368f55=_0x368f55||0xc8;return function(_0x14ad10){if(_0x14ad10){return _0x145f0e['status'](_0x368f55)[_0xbd5f('0x1a')](_0x14ad10);}};}function respondWithFilteredResult(_0x1af089,_0x13e2a4){return function(_0x1de143){if(_0x1de143){var _0x46a0e0=_0x1de143[_0xbd5f('0x1b')],_0x2dd65d=_0x13e2a4[_0xbd5f('0x1c')],_0x5aaf05=_0x13e2a4[_0xbd5f('0x1c')]+_0x13e2a4[_0xbd5f('0x1d')],_0x535f12;if(_0x5aaf05>=_0x46a0e0){_0x5aaf05=_0x46a0e0;_0x535f12=0xc8;}else{_0x535f12=0xce;}_0x1af089['status'](_0x535f12);return _0x1af089[_0xbd5f('0x1e')]('Content-Range',_0x2dd65d+'-'+_0x5aaf05+'/'+_0x46a0e0)['json'](_0x1de143);}return null;};}function patchUpdates(_0x13579d){return function(_0x16fec5){try{jsonpatch['apply'](_0x16fec5,_0x13579d,!![]);}catch(_0x34afba){return BPromise[_0xbd5f('0x1f')](_0x34afba);}return _0x16fec5[_0xbd5f('0x20')]();};}function saveUpdates(_0x38e2a6,_0x59e884){return function(_0x30e643){if(_0x30e643){return _0x30e643[_0xbd5f('0x21')](_0x38e2a6)['then'](function(_0x4cbc14){return _0x4cbc14;});}return null;};}function removeEntity(_0x598dde,_0x4dfec1){return function(_0xc167c3){if(_0xc167c3){return _0xc167c3[_0xbd5f('0x22')]()[_0xbd5f('0x23')](function(){var _0x54e125=_0xc167c3[_0xbd5f('0x24')]({'plain':!![]});var _0x4c961a='Metrics';return db[_0xbd5f('0x25')]['destroy']({'where':{'type':_0x4c961a,'resourceId':_0x54e125['id']}})[_0xbd5f('0x23')](function(){return _0xc167c3;});})[_0xbd5f('0x23')](function(){_0x598dde[_0xbd5f('0x18')](0xcc)[_0xbd5f('0x19')]();});}};}function handleEntityNotFound(_0x12dbe,_0x3012a1){return function(_0x25db52){if(!_0x25db52){_0x12dbe[_0xbd5f('0x17')](0x194);}return _0x25db52;};}function handleError(_0x3ca9e6,_0x41a5e2){_0x41a5e2=_0x41a5e2||0x1f4;return function(_0x1997f5){logger[_0xbd5f('0x26')](_0x1997f5[_0xbd5f('0x27')]);if(_0x1997f5[_0xbd5f('0x28')]){delete _0x1997f5['name'];}_0x3ca9e6[_0xbd5f('0x18')](_0x41a5e2)[_0xbd5f('0x29')](_0x1997f5);};}exports['index']=function(_0x524137,_0x170d75){var _0x35e533={},_0x470a52={},_0x49eaa2={'count':0x0,'rows':[]};var _0x90e6cd=_[_0xbd5f('0x2a')](db[_0xbd5f('0x2b')][_0xbd5f('0x2c')],function(_0x56d96b){return{'name':_0x56d96b[_0xbd5f('0x2d')],'type':_0x56d96b['type'][_0xbd5f('0x2e')]};});_0x470a52['model']=_[_0xbd5f('0x2a')](_0x90e6cd,_0xbd5f('0x28'));_0x470a52[_0xbd5f('0x2f')]=_[_0xbd5f('0x30')](_0x524137[_0xbd5f('0x2f')]);_0x470a52['filters']=_['intersection'](_0x470a52[_0xbd5f('0x31')],_0x470a52[_0xbd5f('0x2f')]);_0x35e533[_0xbd5f('0x32')]=_[_0xbd5f('0x33')](_0x470a52['model'],qs['fields'](_0x524137['query'][_0xbd5f('0x34')]));_0x35e533[_0xbd5f('0x32')]=_0x35e533['attributes'][_0xbd5f('0x35')]?_0x35e533[_0xbd5f('0x32')]:_0x470a52[_0xbd5f('0x31')];if(!_0x524137[_0xbd5f('0x2f')][_0xbd5f('0x36')]('nolimit')){_0x35e533[_0xbd5f('0x1d')]=qs[_0xbd5f('0x1d')](_0x524137[_0xbd5f('0x2f')][_0xbd5f('0x1d')]);_0x35e533['offset']=qs[_0xbd5f('0x1c')](_0x524137[_0xbd5f('0x2f')]['offset']);}_0x35e533[_0xbd5f('0x37')]=qs[_0xbd5f('0x38')](_0x524137['query'][_0xbd5f('0x38')]);_0x35e533[_0xbd5f('0x39')]=qs[_0xbd5f('0x3a')](_[_0xbd5f('0x3b')](_0x524137[_0xbd5f('0x2f')],_0x470a52['filters']));if(_0x524137[_0xbd5f('0x2f')]['filter']){_0x35e533[_0xbd5f('0x39')]=_[_0xbd5f('0x3c')](_0x35e533[_0xbd5f('0x39')],{'$or':_[_0xbd5f('0x2a')](_0x90e6cd,function(_0x4f6633){if(_0x4f6633[_0xbd5f('0x3d')]!==_0xbd5f('0x3e')){var _0x445cef={};_0x445cef[_0x4f6633[_0xbd5f('0x28')]]={'$like':'%'+_0x524137[_0xbd5f('0x2f')][_0xbd5f('0x3f')]+'%'};return _0x445cef;}})});}_0x35e533=_[_0xbd5f('0x3c')]({},_0x35e533,_0x524137[_0xbd5f('0x40')]);var _0x8a6c04={'where':_0x35e533[_0xbd5f('0x39')]};return db[_0xbd5f('0x2b')][_0xbd5f('0x1b')](_0x8a6c04)['then'](function(_0x4379ee){_0x49eaa2[_0xbd5f('0x1b')]=_0x4379ee;if(_0x524137[_0xbd5f('0x2f')][_0xbd5f('0x41')]){_0x35e533[_0xbd5f('0x42')]=[{'all':!![]}];}return db[_0xbd5f('0x2b')][_0xbd5f('0x43')](_0x35e533);})['then'](function(_0x356ef9){_0x49eaa2['rows']=_0x356ef9;return _0x49eaa2;})[_0xbd5f('0x23')](respondWithFilteredResult(_0x170d75,_0x35e533))[_0xbd5f('0x44')](handleError(_0x170d75,null));};exports['show']=function(_0x2a00e1,_0x377772){var _0x170fa2={'raw':!![],'where':{'id':_0x2a00e1[_0xbd5f('0x45')]['id']}},_0xc82c08={};_0xc82c08[_0xbd5f('0x31')]=_['keys'](db[_0xbd5f('0x2b')][_0xbd5f('0x2c')]);_0xc82c08[_0xbd5f('0x2f')]=_[_0xbd5f('0x30')](_0x2a00e1['query']);_0xc82c08['filters']=_[_0xbd5f('0x33')](_0xc82c08['model'],_0xc82c08['query']);_0x170fa2[_0xbd5f('0x32')]=_['intersection'](_0xc82c08[_0xbd5f('0x31')],qs[_0xbd5f('0x34')](_0x2a00e1['query'][_0xbd5f('0x34')]));_0x170fa2[_0xbd5f('0x32')]=_0x170fa2['attributes'][_0xbd5f('0x35')]?_0x170fa2['attributes']:_0xc82c08[_0xbd5f('0x31')];if(_0x2a00e1[_0xbd5f('0x2f')][_0xbd5f('0x41')]){_0x170fa2[_0xbd5f('0x42')]=[{'all':!![]}];}_0x170fa2=_[_0xbd5f('0x3c')]({},_0x170fa2,_0x2a00e1[_0xbd5f('0x40')]);return db[_0xbd5f('0x2b')]['find'](_0x170fa2)[_0xbd5f('0x23')](handleEntityNotFound(_0x377772,null))['then'](respondWithResult(_0x377772,null))[_0xbd5f('0x44')](handleError(_0x377772,null));};exports[_0xbd5f('0x46')]=function(_0x97a87f,_0xe540b0){return db[_0xbd5f('0x2b')][_0xbd5f('0x46')](_0x97a87f[_0xbd5f('0x47')],{})['then'](function(_0x212ec0){var _0x23502e=_0x97a87f[_0xbd5f('0x48')][_0xbd5f('0x24')]({'plain':!![]});if(!_0x23502e)throw new Error('Unable\x20to\x20retrieve\x20the\x20current\x20user');if(_0x23502e[_0xbd5f('0x49')]==='user'){var _0x23c3ca=_0x212ec0[_0xbd5f('0x24')]({'plain':!![]});var _0x7401c5=_0xbd5f('0x4a');return db[_0xbd5f('0x4b')][_0xbd5f('0x4c')]({'where':{'name':_0x7401c5,'userProfileId':_0x23502e[_0xbd5f('0x4d')]},'raw':!![]})['then'](function(_0x1504a8){if(_0x1504a8&&_0x1504a8[_0xbd5f('0x4e')]===0x0){return db[_0xbd5f('0x25')]['create']({'name':_0x23c3ca[_0xbd5f('0x28')],'resourceId':_0x23c3ca['id'],'type':_0x1504a8[_0xbd5f('0x28')],'sectionId':_0x1504a8['id']},{})[_0xbd5f('0x23')](function(){return _0x212ec0;});}else{return _0x212ec0;}})['catch'](function(_0x513ef9){logger[_0xbd5f('0x26')](_0xbd5f('0x4f'),_0x513ef9);throw _0x513ef9;});}return _0x212ec0;})[_0xbd5f('0x23')](respondWithResult(_0xe540b0,0xc9))[_0xbd5f('0x44')](handleError(_0xe540b0,null));};exports[_0xbd5f('0x21')]=function(_0x2f3241,_0x21e3e7){if(_0x2f3241[_0xbd5f('0x47')]['id']){delete _0x2f3241[_0xbd5f('0x47')]['id'];}return db[_0xbd5f('0x2b')][_0xbd5f('0x4c')]({'where':{'id':_0x2f3241['params']['id']}})[_0xbd5f('0x23')](handleEntityNotFound(_0x21e3e7,null))['then'](saveUpdates(_0x2f3241['body'],null))['then'](respondWithResult(_0x21e3e7,null))[_0xbd5f('0x44')](handleError(_0x21e3e7,null));};exports[_0xbd5f('0x22')]=function(_0x114b01,_0x27855e){return db[_0xbd5f('0x2b')][_0xbd5f('0x4c')]({'where':{'id':_0x114b01[_0xbd5f('0x45')]['id']}})[_0xbd5f('0x23')](handleEntityNotFound(_0x27855e,null))['then'](removeEntity(_0x27855e,null))[_0xbd5f('0x44')](handleError(_0x27855e,null));};
\ No newline at end of file
diff --git a/server/api/analyticMetric/analyticMetric.model.js b/server/api/analyticMetric/analyticMetric.model.js
index 3e320bd..c246f59 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 _0x393f=['api','bluebird','../../config/environment','./analyticMetric.attributes','define','AnalyticMetric','analytics_metrics','../../config/logger'];(function(_0x320a4d,_0x3f517e){var _0x8185b9=function(_0x3c2494){while(--_0x3c2494){_0x320a4d['push'](_0x320a4d['shift']());}};_0x8185b9(++_0x3f517e);}(_0x393f,0x11f));var _0xf393=function(_0x527a99,_0x3765c3){_0x527a99=_0x527a99-0x0;var _0x1d88a0=_0x393f[_0x527a99];return _0x1d88a0;};'use strict';var _=require('lodash');var util=require('util');var logger=require(_0xf393('0x0'))(_0xf393('0x1'));var moment=require('moment');var BPromise=require(_0xf393('0x2'));var rp=require('request-promise');var fs=require('fs');var path=require('path');var rimraf=require('rimraf');var config=require(_0xf393('0x3'));var attributes=require(_0xf393('0x4'));module['exports']=function(_0x3d6800,_0x577ac7){return _0x3d6800[_0xf393('0x5')](_0xf393('0x6'),attributes,{'tableName':_0xf393('0x7'),'paranoid':![],'indexes':[],'timestamps':!![]});};
\ No newline at end of file
+var _0x7288=['request-promise','path','rimraf','../../config/environment','./analyticMetric.attributes','exports','define','AnalyticMetric','analytics_metrics','lodash','util','../../config/logger'];(function(_0x14add3,_0x13ce8d){var _0x4a174f=function(_0x2b3ed7){while(--_0x2b3ed7){_0x14add3['push'](_0x14add3['shift']());}};_0x4a174f(++_0x13ce8d);}(_0x7288,0x105));var _0x8728=function(_0x246358,_0x5f5a4a){_0x246358=_0x246358-0x0;var _0x229541=_0x7288[_0x246358];return _0x229541;};'use strict';var _=require(_0x8728('0x0'));var util=require(_0x8728('0x1'));var logger=require(_0x8728('0x2'))('api');var moment=require('moment');var BPromise=require('bluebird');var rp=require(_0x8728('0x3'));var fs=require('fs');var path=require(_0x8728('0x4'));var rimraf=require(_0x8728('0x5'));var config=require(_0x8728('0x6'));var attributes=require(_0x8728('0x7'));module[_0x8728('0x8')]=function(_0x28b5bd,_0xefcd12){return _0x28b5bd[_0x8728('0x9')](_0x8728('0xa'),attributes,{'tableName':_0x8728('0xb'),'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 1f0ce90..afd5e4a 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 _0x32e7=['AnalyticMetric,\x20%s,\x20%s','message','catch','lodash','util','moment','bluebird','randomstring','ioredis','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','client','http','request','then','info','request\x20sent','debug','AnalyticMetric,\x20%s,\x20%s,\x20%s','error','code'];(function(_0x5567cd,_0x35ca37){var _0x559621=function(_0x133b94){while(--_0x133b94){_0x5567cd['push'](_0x5567cd['shift']());}};_0x559621(++_0x35ca37);}(_0x32e7,0xab));var _0x732e=function(_0x4627b8,_0x209fcc){_0x4627b8=_0x4627b8-0x0;var _0x4382ad=_0x32e7[_0x4627b8];return _0x4382ad;};'use strict';var _=require(_0x732e('0x0'));var util=require(_0x732e('0x1'));var moment=require(_0x732e('0x2'));var BPromise=require(_0x732e('0x3'));var rs=require(_0x732e('0x4'));var fs=require('fs');var Redis=require(_0x732e('0x5'));var db=require('../../mysqldb')['db'];var utils=require(_0x732e('0x6'));var logger=require(_0x732e('0x7'))(_0x732e('0x8'));var config=require(_0x732e('0x9'));var jayson=require(_0x732e('0xa'));var client=jayson[_0x732e('0xb')][_0x732e('0xc')]({'port':0x232a});function respondWithRpcPromise(_0x4e7839,_0x101816,_0x3d0357){return new BPromise(function(_0x38bbc0,_0x3b6d80){return client[_0x732e('0xd')](_0x4e7839,_0x3d0357)[_0x732e('0xe')](function(_0x2fb069){logger[_0x732e('0xf')]('AnalyticMetric,\x20%s,\x20%s',_0x101816,_0x732e('0x10'));logger[_0x732e('0x11')](_0x732e('0x12'),_0x101816,_0x732e('0x10'),JSON['stringify'](_0x2fb069));if(_0x2fb069[_0x732e('0x13')]){if(_0x2fb069[_0x732e('0x13')][_0x732e('0x14')]===0x1f4){logger['error'](_0x732e('0x15'),_0x101816,_0x2fb069[_0x732e('0x13')][_0x732e('0x16')]);return _0x3b6d80(_0x2fb069[_0x732e('0x13')][_0x732e('0x16')]);}logger[_0x732e('0x13')](_0x732e('0x15'),_0x101816,_0x2fb069[_0x732e('0x13')][_0x732e('0x16')]);return _0x38bbc0(_0x2fb069[_0x732e('0x13')]['message']);}else{logger['info'](_0x732e('0x15'),_0x101816,'request\x20sent');_0x38bbc0(_0x2fb069['result'][_0x732e('0x16')]);}})[_0x732e('0x17')](function(_0x47a234){logger[_0x732e('0x13')]('AnalyticMetric,\x20%s,\x20%s',_0x101816,_0x47a234);_0x3b6d80(_0x47a234);});});}
\ No newline at end of file
+var _0xfb2d=['code','message','result','catch','lodash','moment','bluebird','randomstring','../../mysqldb','../../config/utils','../../config/logger','jayson/promise','http','request','then','AnalyticMetric,\x20%s,\x20%s','request\x20sent','debug','AnalyticMetric,\x20%s,\x20%s,\x20%s','error'];(function(_0x4b4865,_0xb43449){var _0x190dc2=function(_0x2b41f7){while(--_0x2b41f7){_0x4b4865['push'](_0x4b4865['shift']());}};_0x190dc2(++_0xb43449);}(_0xfb2d,0xe0));var _0xdfb2=function(_0x474bc0,_0x26989c){_0x474bc0=_0x474bc0-0x0;var _0x4b24cf=_0xfb2d[_0x474bc0];return _0x4b24cf;};'use strict';var _=require(_0xdfb2('0x0'));var util=require('util');var moment=require(_0xdfb2('0x1'));var BPromise=require(_0xdfb2('0x2'));var rs=require(_0xdfb2('0x3'));var fs=require('fs');var Redis=require('ioredis');var db=require(_0xdfb2('0x4'))['db'];var utils=require(_0xdfb2('0x5'));var logger=require(_0xdfb2('0x6'))('rpc');var config=require('../../config/environment');var jayson=require(_0xdfb2('0x7'));var client=jayson['client'][_0xdfb2('0x8')]({'port':0x232a});function respondWithRpcPromise(_0x3f55ef,_0x1cb480,_0x183872){return new BPromise(function(_0x16672d,_0x2cc759){return client[_0xdfb2('0x9')](_0x3f55ef,_0x183872)[_0xdfb2('0xa')](function(_0x333298){logger['info'](_0xdfb2('0xb'),_0x1cb480,_0xdfb2('0xc'));logger[_0xdfb2('0xd')](_0xdfb2('0xe'),_0x1cb480,_0xdfb2('0xc'),JSON['stringify'](_0x333298));if(_0x333298[_0xdfb2('0xf')]){if(_0x333298['error'][_0xdfb2('0x10')]===0x1f4){logger[_0xdfb2('0xf')](_0xdfb2('0xb'),_0x1cb480,_0x333298[_0xdfb2('0xf')][_0xdfb2('0x11')]);return _0x2cc759(_0x333298[_0xdfb2('0xf')][_0xdfb2('0x11')]);}logger[_0xdfb2('0xf')](_0xdfb2('0xb'),_0x1cb480,_0x333298[_0xdfb2('0xf')][_0xdfb2('0x11')]);return _0x16672d(_0x333298[_0xdfb2('0xf')]['message']);}else{logger['info'](_0xdfb2('0xb'),_0x1cb480,_0xdfb2('0xc'));_0x16672d(_0x333298[_0xdfb2('0x12')][_0xdfb2('0x11')]);}})[_0xdfb2('0x13')](function(_0x4a3edf){logger[_0xdfb2('0xf')]('AnalyticMetric,\x20%s,\x20%s',_0x1cb480,_0x4a3edf);_0x2cc759(_0x4a3edf);});});}
\ No newline at end of file
diff --git a/server/api/analyticMetric/index.js b/server/api/analyticMetric/index.js
index 11c542b..c06f93c 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 _0x6d38=['path','connect-timeout','../../components/auth/service','../../config/environment','./analyticMetric.controller','get','index','/:id','isAuthenticated','create','put','update','delete','destroy','exports','util'];(function(_0x244dd4,_0x3d158f){var _0x465198=function(_0x56ca1c){while(--_0x56ca1c){_0x244dd4['push'](_0x244dd4['shift']());}};_0x465198(++_0x3d158f);}(_0x6d38,0x1ef));var _0x86d3=function(_0x278e3c,_0x1c9cfd){_0x278e3c=_0x278e3c-0x0;var _0x3e2d9b=_0x6d38[_0x278e3c];return _0x3e2d9b;};'use strict';var multer=require('multer');var util=require(_0x86d3('0x0'));var path=require(_0x86d3('0x1'));var timeout=require(_0x86d3('0x2'));var express=require('express');var router=express['Router']();var auth=require(_0x86d3('0x3'));var interaction=require('../../components/interaction/service');var config=require(_0x86d3('0x4'));var controller=require(_0x86d3('0x5'));router[_0x86d3('0x6')]('/',auth['isAuthenticated'](),controller[_0x86d3('0x7')]);router[_0x86d3('0x6')](_0x86d3('0x8'),auth[_0x86d3('0x9')](),controller['show']);router['post']('/',auth[_0x86d3('0x9')](),controller[_0x86d3('0xa')]);router[_0x86d3('0xb')]('/:id',auth['isAuthenticated'](),controller[_0x86d3('0xc')]);router[_0x86d3('0xd')]('/:id',auth['isAuthenticated'](),controller[_0x86d3('0xe')]);module[_0x86d3('0xf')]=router;
\ No newline at end of file
+var _0x1261=['util','path','connect-timeout','express','Router','../../components/auth/service','../../components/interaction/service','../../config/environment','./analyticMetric.controller','get','/:id','show','post','isAuthenticated','create','put','update','delete'];(function(_0x40911a,_0x55ec99){var _0x27e8e3=function(_0x2ba910){while(--_0x2ba910){_0x40911a['push'](_0x40911a['shift']());}};_0x27e8e3(++_0x55ec99);}(_0x1261,0x144));var _0x1126=function(_0x1d326a,_0x89b53){_0x1d326a=_0x1d326a-0x0;var _0x5804d5=_0x1261[_0x1d326a];return _0x5804d5;};'use strict';var multer=require('multer');var util=require(_0x1126('0x0'));var path=require(_0x1126('0x1'));var timeout=require(_0x1126('0x2'));var express=require(_0x1126('0x3'));var router=express[_0x1126('0x4')]();var auth=require(_0x1126('0x5'));var interaction=require(_0x1126('0x6'));var config=require(_0x1126('0x7'));var controller=require(_0x1126('0x8'));router[_0x1126('0x9')]('/',auth['isAuthenticated'](),controller['index']);router[_0x1126('0x9')](_0x1126('0xa'),auth['isAuthenticated'](),controller[_0x1126('0xb')]);router[_0x1126('0xc')]('/',auth[_0x1126('0xd')](),controller[_0x1126('0xe')]);router[_0x1126('0xf')]('/:id',auth[_0x1126('0xd')](),controller[_0x1126('0x10')]);router[_0x1126('0x11')]('/:id',auth[_0x1126('0xd')](),controller['destroy']);module['exports']=router;
\ No newline at end of file
diff --git a/server/api/analyticTreeReport/analyticTreeReport.attributes.js b/server/api/analyticTreeReport/analyticTreeReport.attributes.js
index 93babb5..95f89d6 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 _0x3327=['TEXT'];(function(_0x407711,_0x2c01f7){var _0x34df6f=function(_0x34cab5){while(--_0x34cab5){_0x407711['push'](_0x407711['shift']());}};_0x34df6f(++_0x2c01f7);}(_0x3327,0x164));var _0x7332=function(_0x31c5d7,_0x22b387){_0x31c5d7=_0x31c5d7-0x0;var _0x45ee5d=_0x3327[_0x31c5d7];return _0x45ee5d;};'use strict';var Sequelize=require('sequelize');module['exports']={'tree':{'type':Sequelize[_0x7332('0x0')],'allowNull':![]}};
\ No newline at end of file
+var _0x4775=['sequelize','exports','TEXT'];(function(_0x310938,_0x3dcc27){var _0x5856a2=function(_0x3c5d31){while(--_0x3c5d31){_0x310938['push'](_0x310938['shift']());}};_0x5856a2(++_0x3dcc27);}(_0x4775,0x84));var _0x5477=function(_0x525af9,_0x4edd23){_0x525af9=_0x525af9-0x0;var _0x129fbf=_0x4775[_0x525af9];return _0x129fbf;};'use strict';var Sequelize=require(_0x5477('0x0'));module[_0x5477('0x1')]={'tree':{'type':Sequelize[_0x5477('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 463a64f..ca308e6 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 _0xe5b5=['request-promise','moment','bluebird','mustache','util','path','sox','to-csv','ejs','lodash','squel','crypto','jsforce','desk.js','querystring','papaparse','ioredis','../../components/parsers/qs','../../config/license/hardware','../../config/logger','api','../../config/utils','sendStatus','status','end','json','offset','limit','Content-Range','apply','save','update','then','destroy','stack','name','send','index','map','AnalyticTreeReport','rawAttributes','fieldName','type','key','query','keys','filters','model','attributes','intersection','fields','length','hasOwnProperty','nolimit','order','sort','where','filter','merge','VIRTUAL','options','count','include','rows','catch','show','params','includeAll','create','body','find','html-pdf','eml-format','rimraf','zip-dir','fast-json-patch'];(function(_0x18bdb5,_0xb01193){var _0x3f1d72=function(_0x391aa8){while(--_0x391aa8){_0x18bdb5['push'](_0x18bdb5['shift']());}};_0x3f1d72(++_0xb01193);}(_0xe5b5,0x12b));var _0x5e5b=function(_0x372515,_0xdd11f){_0x372515=_0x372515-0x0;var _0xa3bf4e=_0xe5b5[_0x372515];return _0xa3bf4e;};'use strict';var pdf=require(_0x5e5b('0x0'));var emlformat=require(_0x5e5b('0x1'));var rimraf=require(_0x5e5b('0x2'));var zipdir=require(_0x5e5b('0x3'));var jsonpatch=require(_0x5e5b('0x4'));var rp=require(_0x5e5b('0x5'));var moment=require(_0x5e5b('0x6'));var BPromise=require(_0x5e5b('0x7'));var Mustache=require(_0x5e5b('0x8'));var util=require(_0x5e5b('0x9'));var path=require(_0x5e5b('0xa'));var sox=require(_0x5e5b('0xb'));var csv=require(_0x5e5b('0xc'));var ejs=require(_0x5e5b('0xd'));var fs=require('fs');var _=require(_0x5e5b('0xe'));var squel=require(_0x5e5b('0xf'));var crypto=require(_0x5e5b('0x10'));var jsforce=require(_0x5e5b('0x11'));var deskjs=require(_0x5e5b('0x12'));var toCsv=require(_0x5e5b('0xc'));var querystring=require(_0x5e5b('0x13'));var Papa=require(_0x5e5b('0x14'));var Redis=require(_0x5e5b('0x15'));var authService=require('../../components/auth/service');var qs=require(_0x5e5b('0x16'));var as=require('../../components/parsers/advancedSearch');var hardwareService=require(_0x5e5b('0x17'));var logger=require(_0x5e5b('0x18'))(_0x5e5b('0x19'));var utils=require(_0x5e5b('0x1a'));var config=require('../../config/environment');var db=require('../../mysqldb')['db'];function respondWithStatusCode(_0x5ebf65,_0x310f71){_0x310f71=_0x310f71||0xcc;return function(_0x18434e){if(_0x18434e){return _0x5ebf65[_0x5e5b('0x1b')](_0x310f71);}return _0x5ebf65[_0x5e5b('0x1c')](_0x310f71)[_0x5e5b('0x1d')]();};}function respondWithResult(_0x1e3483,_0x2e331d){_0x2e331d=_0x2e331d||0xc8;return function(_0x49edd0){if(_0x49edd0){return _0x1e3483[_0x5e5b('0x1c')](_0x2e331d)[_0x5e5b('0x1e')](_0x49edd0);}};}function respondWithFilteredResult(_0x4ff37b,_0x227417){return function(_0x578c14){if(_0x578c14){var _0x4e9509=_0x578c14['count'],_0x13a1cb=_0x227417[_0x5e5b('0x1f')],_0x444435=_0x227417['offset']+_0x227417[_0x5e5b('0x20')],_0xaf9ace;if(_0x444435>=_0x4e9509){_0x444435=_0x4e9509;_0xaf9ace=0xc8;}else{_0xaf9ace=0xce;}_0x4ff37b[_0x5e5b('0x1c')](_0xaf9ace);return _0x4ff37b['set'](_0x5e5b('0x21'),_0x13a1cb+'-'+_0x444435+'/'+_0x4e9509)[_0x5e5b('0x1e')](_0x578c14);}return null;};}function patchUpdates(_0x2281c8){return function(_0x538074){try{jsonpatch[_0x5e5b('0x22')](_0x538074,_0x2281c8,!![]);}catch(_0x3f1103){return BPromise['reject'](_0x3f1103);}return _0x538074[_0x5e5b('0x23')]();};}function saveUpdates(_0x1aa0c2,_0x3c488e){return function(_0x2d8252){if(_0x2d8252){return _0x2d8252[_0x5e5b('0x24')](_0x1aa0c2)[_0x5e5b('0x25')](function(_0x93df5c){return _0x93df5c;});}return null;};}function removeEntity(_0x37552c,_0x4a78e3){return function(_0x512e46){if(_0x512e46){return _0x512e46[_0x5e5b('0x26')]()[_0x5e5b('0x25')](function(){_0x37552c[_0x5e5b('0x1c')](0xcc)[_0x5e5b('0x1d')]();});}};}function handleEntityNotFound(_0x2e38ed,_0x28cd95){return function(_0x135c6c){if(!_0x135c6c){_0x2e38ed[_0x5e5b('0x1b')](0x194);}return _0x135c6c;};}function handleError(_0x161599,_0x26bc02){_0x26bc02=_0x26bc02||0x1f4;return function(_0x1788fd){logger['error'](_0x1788fd[_0x5e5b('0x27')]);if(_0x1788fd[_0x5e5b('0x28')]){delete _0x1788fd[_0x5e5b('0x28')];}_0x161599['status'](_0x26bc02)[_0x5e5b('0x29')](_0x1788fd);};}exports[_0x5e5b('0x2a')]=function(_0x5ee866,_0x13ff91){var _0x21c74b={},_0x39ce16={},_0x36b595={'count':0x0,'rows':[]};var _0x31af09=_[_0x5e5b('0x2b')](db[_0x5e5b('0x2c')][_0x5e5b('0x2d')],function(_0x3f6b25){return{'name':_0x3f6b25[_0x5e5b('0x2e')],'type':_0x3f6b25[_0x5e5b('0x2f')][_0x5e5b('0x30')]};});_0x39ce16['model']=_['map'](_0x31af09,_0x5e5b('0x28'));_0x39ce16[_0x5e5b('0x31')]=_[_0x5e5b('0x32')](_0x5ee866[_0x5e5b('0x31')]);_0x39ce16[_0x5e5b('0x33')]=_['intersection'](_0x39ce16[_0x5e5b('0x34')],_0x39ce16['query']);_0x21c74b[_0x5e5b('0x35')]=_[_0x5e5b('0x36')](_0x39ce16[_0x5e5b('0x34')],qs[_0x5e5b('0x37')](_0x5ee866['query'][_0x5e5b('0x37')]));_0x21c74b[_0x5e5b('0x35')]=_0x21c74b['attributes'][_0x5e5b('0x38')]?_0x21c74b[_0x5e5b('0x35')]:_0x39ce16[_0x5e5b('0x34')];if(!_0x5ee866[_0x5e5b('0x31')][_0x5e5b('0x39')](_0x5e5b('0x3a'))){_0x21c74b[_0x5e5b('0x20')]=qs[_0x5e5b('0x20')](_0x5ee866['query'][_0x5e5b('0x20')]);_0x21c74b[_0x5e5b('0x1f')]=qs[_0x5e5b('0x1f')](_0x5ee866[_0x5e5b('0x31')][_0x5e5b('0x1f')]);}_0x21c74b[_0x5e5b('0x3b')]=qs['sort'](_0x5ee866['query'][_0x5e5b('0x3c')]);_0x21c74b[_0x5e5b('0x3d')]=qs[_0x5e5b('0x33')](_['pick'](_0x5ee866[_0x5e5b('0x31')],_0x39ce16[_0x5e5b('0x33')]));if(_0x5ee866[_0x5e5b('0x31')][_0x5e5b('0x3e')]){_0x21c74b['where']=_[_0x5e5b('0x3f')](_0x21c74b[_0x5e5b('0x3d')],{'$or':_['map'](_0x31af09,function(_0x5ad9a6){if(_0x5ad9a6[_0x5e5b('0x2f')]!==_0x5e5b('0x40')){var _0xee3e6f={};_0xee3e6f[_0x5ad9a6['name']]={'$like':'%'+_0x5ee866[_0x5e5b('0x31')]['filter']+'%'};return _0xee3e6f;}})});}_0x21c74b=_['merge']({},_0x21c74b,_0x5ee866[_0x5e5b('0x41')]);var _0x2bcfaa={'where':_0x21c74b[_0x5e5b('0x3d')]};return db[_0x5e5b('0x2c')][_0x5e5b('0x42')](_0x2bcfaa)[_0x5e5b('0x25')](function(_0x2c1eb1){_0x36b595[_0x5e5b('0x42')]=_0x2c1eb1;if(_0x5ee866[_0x5e5b('0x31')]['includeAll']){_0x21c74b[_0x5e5b('0x43')]=[{'all':!![]}];}return db[_0x5e5b('0x2c')]['findAll'](_0x21c74b);})[_0x5e5b('0x25')](function(_0x4b54b0){_0x36b595[_0x5e5b('0x44')]=_0x4b54b0;return _0x36b595;})[_0x5e5b('0x25')](respondWithFilteredResult(_0x13ff91,_0x21c74b))[_0x5e5b('0x45')](handleError(_0x13ff91,null));};exports[_0x5e5b('0x46')]=function(_0x1659d5,_0xbe8b1d){var _0x371550={'raw':!![],'where':{'id':_0x1659d5[_0x5e5b('0x47')]['id']}},_0x24d81f={};_0x24d81f[_0x5e5b('0x34')]=_[_0x5e5b('0x32')](db['AnalyticTreeReport'][_0x5e5b('0x2d')]);_0x24d81f[_0x5e5b('0x31')]=_[_0x5e5b('0x32')](_0x1659d5['query']);_0x24d81f[_0x5e5b('0x33')]=_[_0x5e5b('0x36')](_0x24d81f['model'],_0x24d81f[_0x5e5b('0x31')]);_0x371550[_0x5e5b('0x35')]=_['intersection'](_0x24d81f[_0x5e5b('0x34')],qs['fields'](_0x1659d5['query']['fields']));_0x371550[_0x5e5b('0x35')]=_0x371550['attributes'][_0x5e5b('0x38')]?_0x371550['attributes']:_0x24d81f[_0x5e5b('0x34')];if(_0x1659d5[_0x5e5b('0x31')][_0x5e5b('0x48')]){_0x371550[_0x5e5b('0x43')]=[{'all':!![]}];}_0x371550=_[_0x5e5b('0x3f')]({},_0x371550,_0x1659d5[_0x5e5b('0x41')]);return db[_0x5e5b('0x2c')]['find'](_0x371550)['then'](handleEntityNotFound(_0xbe8b1d,null))[_0x5e5b('0x25')](respondWithResult(_0xbe8b1d,null))['catch'](handleError(_0xbe8b1d,null));};exports['create']=function(_0x4e83eb,_0x249922){return db['AnalyticTreeReport'][_0x5e5b('0x49')](_0x4e83eb[_0x5e5b('0x4a')],{})[_0x5e5b('0x25')](respondWithResult(_0x249922,0xc9))[_0x5e5b('0x45')](handleError(_0x249922,null));};exports[_0x5e5b('0x24')]=function(_0x192445,_0x4fd265){if(_0x192445[_0x5e5b('0x4a')]['id']){delete _0x192445[_0x5e5b('0x4a')]['id'];}return db['AnalyticTreeReport'][_0x5e5b('0x4b')]({'where':{'id':_0x192445['params']['id']}})[_0x5e5b('0x25')](handleEntityNotFound(_0x4fd265,null))[_0x5e5b('0x25')](saveUpdates(_0x192445[_0x5e5b('0x4a')],null))[_0x5e5b('0x25')](respondWithResult(_0x4fd265,null))['catch'](handleError(_0x4fd265,null));};exports[_0x5e5b('0x26')]=function(_0x1c4efe,_0x4f4ea3){return db[_0x5e5b('0x2c')][_0x5e5b('0x4b')]({'where':{'id':_0x1c4efe[_0x5e5b('0x47')]['id']}})[_0x5e5b('0x25')](handleEntityNotFound(_0x4f4ea3,null))[_0x5e5b('0x25')](removeEntity(_0x4f4ea3,null))[_0x5e5b('0x45')](handleError(_0x4f4ea3,null));};
\ No newline at end of file
+var _0xdd4f=['intersection','attributes','fields','hasOwnProperty','nolimit','order','sort','where','pick','filter','merge','VIRTUAL','count','includeAll','include','findAll','rows','catch','show','params','length','create','body','find','html-pdf','fast-json-patch','request-promise','bluebird','mustache','util','sox','to-csv','ejs','lodash','squel','jsforce','querystring','papaparse','../../components/auth/service','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/environment','../../mysqldb','sendStatus','end','status','offset','limit','set','Content-Range','json','reject','save','update','then','destroy','error','stack','name','send','index','AnalyticTreeReport','rawAttributes','fieldName','type','model','map','query','keys','filters'];(function(_0x503e90,_0x11dd3a){var _0x8d2356=function(_0x4c44a5){while(--_0x4c44a5){_0x503e90['push'](_0x503e90['shift']());}};_0x8d2356(++_0x11dd3a);}(_0xdd4f,0x1ce));var _0xfdd4=function(_0x373371,_0x822e7f){_0x373371=_0x373371-0x0;var _0x4fc510=_0xdd4f[_0x373371];return _0x4fc510;};'use strict';var pdf=require(_0xfdd4('0x0'));var emlformat=require('eml-format');var rimraf=require('rimraf');var zipdir=require('zip-dir');var jsonpatch=require(_0xfdd4('0x1'));var rp=require(_0xfdd4('0x2'));var moment=require('moment');var BPromise=require(_0xfdd4('0x3'));var Mustache=require(_0xfdd4('0x4'));var util=require(_0xfdd4('0x5'));var path=require('path');var sox=require(_0xfdd4('0x6'));var csv=require(_0xfdd4('0x7'));var ejs=require(_0xfdd4('0x8'));var fs=require('fs');var _=require(_0xfdd4('0x9'));var squel=require(_0xfdd4('0xa'));var crypto=require('crypto');var jsforce=require(_0xfdd4('0xb'));var deskjs=require('desk.js');var toCsv=require(_0xfdd4('0x7'));var querystring=require(_0xfdd4('0xc'));var Papa=require(_0xfdd4('0xd'));var Redis=require('ioredis');var authService=require(_0xfdd4('0xe'));var qs=require('../../components/parsers/qs');var as=require(_0xfdd4('0xf'));var hardwareService=require(_0xfdd4('0x10'));var logger=require(_0xfdd4('0x11'))(_0xfdd4('0x12'));var utils=require(_0xfdd4('0x13'));var config=require(_0xfdd4('0x14'));var db=require(_0xfdd4('0x15'))['db'];function respondWithStatusCode(_0x1c71c4,_0x3f07f1){_0x3f07f1=_0x3f07f1||0xcc;return function(_0x4565e6){if(_0x4565e6){return _0x1c71c4[_0xfdd4('0x16')](_0x3f07f1);}return _0x1c71c4['status'](_0x3f07f1)[_0xfdd4('0x17')]();};}function respondWithResult(_0xd7dbf,_0x227099){_0x227099=_0x227099||0xc8;return function(_0x57b21f){if(_0x57b21f){return _0xd7dbf[_0xfdd4('0x18')](_0x227099)['json'](_0x57b21f);}};}function respondWithFilteredResult(_0x467824,_0x42c3a8){return function(_0x2f34ec){if(_0x2f34ec){var _0x431255=_0x2f34ec['count'],_0x37b05f=_0x42c3a8[_0xfdd4('0x19')],_0x52cf2c=_0x42c3a8[_0xfdd4('0x19')]+_0x42c3a8[_0xfdd4('0x1a')],_0x47ed1d;if(_0x52cf2c>=_0x431255){_0x52cf2c=_0x431255;_0x47ed1d=0xc8;}else{_0x47ed1d=0xce;}_0x467824[_0xfdd4('0x18')](_0x47ed1d);return _0x467824[_0xfdd4('0x1b')](_0xfdd4('0x1c'),_0x37b05f+'-'+_0x52cf2c+'/'+_0x431255)[_0xfdd4('0x1d')](_0x2f34ec);}return null;};}function patchUpdates(_0x2ffd5f){return function(_0x32e00d){try{jsonpatch['apply'](_0x32e00d,_0x2ffd5f,!![]);}catch(_0x1e5d91){return BPromise[_0xfdd4('0x1e')](_0x1e5d91);}return _0x32e00d[_0xfdd4('0x1f')]();};}function saveUpdates(_0x36e611,_0x1454f1){return function(_0x29cc8d){if(_0x29cc8d){return _0x29cc8d[_0xfdd4('0x20')](_0x36e611)[_0xfdd4('0x21')](function(_0x523a7d){return _0x523a7d;});}return null;};}function removeEntity(_0x2147e6,_0x17302b){return function(_0x2a24e8){if(_0x2a24e8){return _0x2a24e8[_0xfdd4('0x22')]()[_0xfdd4('0x21')](function(){_0x2147e6[_0xfdd4('0x18')](0xcc)[_0xfdd4('0x17')]();});}};}function handleEntityNotFound(_0x277ec1,_0x538b00){return function(_0x1e14da){if(!_0x1e14da){_0x277ec1[_0xfdd4('0x16')](0x194);}return _0x1e14da;};}function handleError(_0x4397a3,_0x53d35a){_0x53d35a=_0x53d35a||0x1f4;return function(_0x58fe0d){logger[_0xfdd4('0x23')](_0x58fe0d[_0xfdd4('0x24')]);if(_0x58fe0d[_0xfdd4('0x25')]){delete _0x58fe0d[_0xfdd4('0x25')];}_0x4397a3['status'](_0x53d35a)[_0xfdd4('0x26')](_0x58fe0d);};}exports[_0xfdd4('0x27')]=function(_0x3cd2c9,_0x31e053){var _0x3c6728={},_0x192471={},_0x453a48={'count':0x0,'rows':[]};var _0x37b7a2=_['map'](db[_0xfdd4('0x28')][_0xfdd4('0x29')],function(_0x385a68){return{'name':_0x385a68[_0xfdd4('0x2a')],'type':_0x385a68[_0xfdd4('0x2b')]['key']};});_0x192471[_0xfdd4('0x2c')]=_[_0xfdd4('0x2d')](_0x37b7a2,_0xfdd4('0x25'));_0x192471[_0xfdd4('0x2e')]=_[_0xfdd4('0x2f')](_0x3cd2c9['query']);_0x192471[_0xfdd4('0x30')]=_[_0xfdd4('0x31')](_0x192471[_0xfdd4('0x2c')],_0x192471['query']);_0x3c6728[_0xfdd4('0x32')]=_['intersection'](_0x192471[_0xfdd4('0x2c')],qs[_0xfdd4('0x33')](_0x3cd2c9['query']['fields']));_0x3c6728[_0xfdd4('0x32')]=_0x3c6728[_0xfdd4('0x32')]['length']?_0x3c6728['attributes']:_0x192471[_0xfdd4('0x2c')];if(!_0x3cd2c9[_0xfdd4('0x2e')][_0xfdd4('0x34')](_0xfdd4('0x35'))){_0x3c6728[_0xfdd4('0x1a')]=qs[_0xfdd4('0x1a')](_0x3cd2c9[_0xfdd4('0x2e')][_0xfdd4('0x1a')]);_0x3c6728[_0xfdd4('0x19')]=qs[_0xfdd4('0x19')](_0x3cd2c9[_0xfdd4('0x2e')][_0xfdd4('0x19')]);}_0x3c6728[_0xfdd4('0x36')]=qs[_0xfdd4('0x37')](_0x3cd2c9[_0xfdd4('0x2e')][_0xfdd4('0x37')]);_0x3c6728[_0xfdd4('0x38')]=qs[_0xfdd4('0x30')](_[_0xfdd4('0x39')](_0x3cd2c9[_0xfdd4('0x2e')],_0x192471[_0xfdd4('0x30')]));if(_0x3cd2c9[_0xfdd4('0x2e')][_0xfdd4('0x3a')]){_0x3c6728[_0xfdd4('0x38')]=_[_0xfdd4('0x3b')](_0x3c6728[_0xfdd4('0x38')],{'$or':_['map'](_0x37b7a2,function(_0x2b6c87){if(_0x2b6c87[_0xfdd4('0x2b')]!==_0xfdd4('0x3c')){var _0x439389={};_0x439389[_0x2b6c87[_0xfdd4('0x25')]]={'$like':'%'+_0x3cd2c9[_0xfdd4('0x2e')]['filter']+'%'};return _0x439389;}})});}_0x3c6728=_[_0xfdd4('0x3b')]({},_0x3c6728,_0x3cd2c9['options']);var _0xeca9d={'where':_0x3c6728[_0xfdd4('0x38')]};return db[_0xfdd4('0x28')][_0xfdd4('0x3d')](_0xeca9d)['then'](function(_0x1c6f43){_0x453a48[_0xfdd4('0x3d')]=_0x1c6f43;if(_0x3cd2c9[_0xfdd4('0x2e')][_0xfdd4('0x3e')]){_0x3c6728[_0xfdd4('0x3f')]=[{'all':!![]}];}return db[_0xfdd4('0x28')][_0xfdd4('0x40')](_0x3c6728);})[_0xfdd4('0x21')](function(_0xe65944){_0x453a48[_0xfdd4('0x41')]=_0xe65944;return _0x453a48;})['then'](respondWithFilteredResult(_0x31e053,_0x3c6728))[_0xfdd4('0x42')](handleError(_0x31e053,null));};exports[_0xfdd4('0x43')]=function(_0x210a15,_0x67a1e3){var _0x5173db={'raw':!![],'where':{'id':_0x210a15[_0xfdd4('0x44')]['id']}},_0x3e2bda={};_0x3e2bda[_0xfdd4('0x2c')]=_[_0xfdd4('0x2f')](db[_0xfdd4('0x28')]['rawAttributes']);_0x3e2bda[_0xfdd4('0x2e')]=_[_0xfdd4('0x2f')](_0x210a15[_0xfdd4('0x2e')]);_0x3e2bda[_0xfdd4('0x30')]=_[_0xfdd4('0x31')](_0x3e2bda[_0xfdd4('0x2c')],_0x3e2bda[_0xfdd4('0x2e')]);_0x5173db['attributes']=_[_0xfdd4('0x31')](_0x3e2bda['model'],qs[_0xfdd4('0x33')](_0x210a15[_0xfdd4('0x2e')][_0xfdd4('0x33')]));_0x5173db[_0xfdd4('0x32')]=_0x5173db['attributes'][_0xfdd4('0x45')]?_0x5173db[_0xfdd4('0x32')]:_0x3e2bda['model'];if(_0x210a15[_0xfdd4('0x2e')][_0xfdd4('0x3e')]){_0x5173db['include']=[{'all':!![]}];}_0x5173db=_[_0xfdd4('0x3b')]({},_0x5173db,_0x210a15['options']);return db['AnalyticTreeReport']['find'](_0x5173db)[_0xfdd4('0x21')](handleEntityNotFound(_0x67a1e3,null))[_0xfdd4('0x21')](respondWithResult(_0x67a1e3,null))[_0xfdd4('0x42')](handleError(_0x67a1e3,null));};exports['create']=function(_0x393029,_0x169d72){return db['AnalyticTreeReport'][_0xfdd4('0x46')](_0x393029[_0xfdd4('0x47')],{})[_0xfdd4('0x21')](respondWithResult(_0x169d72,0xc9))[_0xfdd4('0x42')](handleError(_0x169d72,null));};exports[_0xfdd4('0x20')]=function(_0x3817fe,_0x2578eb){if(_0x3817fe[_0xfdd4('0x47')]['id']){delete _0x3817fe[_0xfdd4('0x47')]['id'];}return db[_0xfdd4('0x28')][_0xfdd4('0x48')]({'where':{'id':_0x3817fe[_0xfdd4('0x44')]['id']}})[_0xfdd4('0x21')](handleEntityNotFound(_0x2578eb,null))[_0xfdd4('0x21')](saveUpdates(_0x3817fe['body'],null))['then'](respondWithResult(_0x2578eb,null))[_0xfdd4('0x42')](handleError(_0x2578eb,null));};exports[_0xfdd4('0x22')]=function(_0x1296e6,_0x1932ef){return db['AnalyticTreeReport'][_0xfdd4('0x48')]({'where':{'id':_0x1296e6[_0xfdd4('0x44')]['id']}})['then'](handleEntityNotFound(_0x1932ef,null))['then'](removeEntity(_0x1932ef,null))['catch'](handleError(_0x1932ef,null));};
\ No newline at end of file
diff --git a/server/api/analyticTreeReport/analyticTreeReport.model.js b/server/api/analyticTreeReport/analyticTreeReport.model.js
index d9d09c4..b82e2ee 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 _0xc00b=['moment','request-promise','path','rimraf','../../config/environment','exports','AnalyticTreeReport','analytics_report_trees','lodash'];(function(_0x187718,_0x427383){var _0x29ddf4=function(_0x2ec62a){while(--_0x2ec62a){_0x187718['push'](_0x187718['shift']());}};_0x29ddf4(++_0x427383);}(_0xc00b,0x1e5));var _0xbc00=function(_0x1249f4,_0x27226c){_0x1249f4=_0x1249f4-0x0;var _0x47c8a9=_0xc00b[_0x1249f4];return _0x47c8a9;};'use strict';var _=require(_0xbc00('0x0'));var util=require('util');var logger=require('../../config/logger')('api');var moment=require(_0xbc00('0x1'));var BPromise=require('bluebird');var rp=require(_0xbc00('0x2'));var fs=require('fs');var path=require(_0xbc00('0x3'));var rimraf=require(_0xbc00('0x4'));var config=require(_0xbc00('0x5'));var attributes=require('./analyticTreeReport.attributes');module[_0xbc00('0x6')]=function(_0x5b47bf,_0x1cc85f){return _0x5b47bf['define'](_0xbc00('0x7'),attributes,{'tableName':_0xbc00('0x8'),'paranoid':![],'indexes':[],'timestamps':!![]});};
\ No newline at end of file
+var _0x58e6=['lodash','util','bluebird','path','rimraf','../../config/environment','./analyticTreeReport.attributes','exports','analytics_report_trees'];(function(_0x12475c,_0x4e6424){var _0x3434e9=function(_0x2a1a40){while(--_0x2a1a40){_0x12475c['push'](_0x12475c['shift']());}};_0x3434e9(++_0x4e6424);}(_0x58e6,0x1c2));var _0x658e=function(_0x193257,_0xbef52c){_0x193257=_0x193257-0x0;var _0x19a4bd=_0x58e6[_0x193257];return _0x19a4bd;};'use strict';var _=require(_0x658e('0x0'));var util=require(_0x658e('0x1'));var logger=require('../../config/logger')('api');var moment=require('moment');var BPromise=require(_0x658e('0x2'));var rp=require('request-promise');var fs=require('fs');var path=require(_0x658e('0x3'));var rimraf=require(_0x658e('0x4'));var config=require(_0x658e('0x5'));var attributes=require(_0x658e('0x6'));module[_0x658e('0x7')]=function(_0x2add44,_0x3251b8){return _0x2add44['define']('AnalyticTreeReport',attributes,{'tableName':_0x658e('0x8'),'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 737a29d..f6eb830 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 _0x2bf5=['ioredis','../../config/utils','../../config/environment','jayson/promise','http','request','then','info','request\x20sent','error','code','message','AnalyticTreeReport,\x20%s,\x20%s','lodash','moment','bluebird','randomstring'];(function(_0x57966a,_0x477964){var _0x191765=function(_0x106a01){while(--_0x106a01){_0x57966a['push'](_0x57966a['shift']());}};_0x191765(++_0x477964);}(_0x2bf5,0x172));var _0x52bf=function(_0x38c694,_0x5bb595){_0x38c694=_0x38c694-0x0;var _0x3901e4=_0x2bf5[_0x38c694];return _0x3901e4;};'use strict';var _=require(_0x52bf('0x0'));var util=require('util');var moment=require(_0x52bf('0x1'));var BPromise=require(_0x52bf('0x2'));var rs=require(_0x52bf('0x3'));var fs=require('fs');var Redis=require(_0x52bf('0x4'));var db=require('../../mysqldb')['db'];var utils=require(_0x52bf('0x5'));var logger=require('../../config/logger')('rpc');var config=require(_0x52bf('0x6'));var jayson=require(_0x52bf('0x7'));var client=jayson['client'][_0x52bf('0x8')]({'port':0x232a});function respondWithRpcPromise(_0x511540,_0x551618,_0x145bbb){return new BPromise(function(_0x46f931,_0x56fccf){return client[_0x52bf('0x9')](_0x511540,_0x145bbb)[_0x52bf('0xa')](function(_0x4263e6){logger[_0x52bf('0xb')]('AnalyticTreeReport,\x20%s,\x20%s',_0x551618,_0x52bf('0xc'));logger['debug']('AnalyticTreeReport,\x20%s,\x20%s,\x20%s',_0x551618,'request\x20sent',JSON['stringify'](_0x4263e6));if(_0x4263e6[_0x52bf('0xd')]){if(_0x4263e6[_0x52bf('0xd')][_0x52bf('0xe')]===0x1f4){logger[_0x52bf('0xd')]('AnalyticTreeReport,\x20%s,\x20%s',_0x551618,_0x4263e6[_0x52bf('0xd')][_0x52bf('0xf')]);return _0x56fccf(_0x4263e6[_0x52bf('0xd')][_0x52bf('0xf')]);}logger[_0x52bf('0xd')](_0x52bf('0x10'),_0x551618,_0x4263e6[_0x52bf('0xd')][_0x52bf('0xf')]);return _0x46f931(_0x4263e6[_0x52bf('0xd')]['message']);}else{logger[_0x52bf('0xb')](_0x52bf('0x10'),_0x551618,_0x52bf('0xc'));_0x46f931(_0x4263e6['result']['message']);}})['catch'](function(_0x39f1bd){logger[_0x52bf('0xd')]('AnalyticTreeReport,\x20%s,\x20%s',_0x551618,_0x39f1bd);_0x56fccf(_0x39f1bd);});});}
\ No newline at end of file
+var _0xc4db=['error','code','message','util','moment','bluebird','randomstring','ioredis','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','http','then','info','AnalyticTreeReport,\x20%s,\x20%s','request\x20sent','AnalyticTreeReport,\x20%s,\x20%s,\x20%s'];(function(_0x404eed,_0x5390c5){var _0xd45887=function(_0x1ee42b){while(--_0x1ee42b){_0x404eed['push'](_0x404eed['shift']());}};_0xd45887(++_0x5390c5);}(_0xc4db,0x75));var _0xbc4d=function(_0x1ef8c2,_0x53bd14){_0x1ef8c2=_0x1ef8c2-0x0;var _0x394a67=_0xc4db[_0x1ef8c2];return _0x394a67;};'use strict';var _=require('lodash');var util=require(_0xbc4d('0x0'));var moment=require(_0xbc4d('0x1'));var BPromise=require(_0xbc4d('0x2'));var rs=require(_0xbc4d('0x3'));var fs=require('fs');var Redis=require(_0xbc4d('0x4'));var db=require('../../mysqldb')['db'];var utils=require(_0xbc4d('0x5'));var logger=require(_0xbc4d('0x6'))(_0xbc4d('0x7'));var config=require(_0xbc4d('0x8'));var jayson=require(_0xbc4d('0x9'));var client=jayson['client'][_0xbc4d('0xa')]({'port':0x232a});function respondWithRpcPromise(_0xefdb99,_0x2c082c,_0x2d70c0){return new BPromise(function(_0x478267,_0x5dc561){return client['request'](_0xefdb99,_0x2d70c0)[_0xbc4d('0xb')](function(_0x3c0243){logger[_0xbc4d('0xc')](_0xbc4d('0xd'),_0x2c082c,_0xbc4d('0xe'));logger['debug'](_0xbc4d('0xf'),_0x2c082c,'request\x20sent',JSON['stringify'](_0x3c0243));if(_0x3c0243[_0xbc4d('0x10')]){if(_0x3c0243[_0xbc4d('0x10')][_0xbc4d('0x11')]===0x1f4){logger['error'](_0xbc4d('0xd'),_0x2c082c,_0x3c0243[_0xbc4d('0x10')][_0xbc4d('0x12')]);return _0x5dc561(_0x3c0243[_0xbc4d('0x10')][_0xbc4d('0x12')]);}logger[_0xbc4d('0x10')](_0xbc4d('0xd'),_0x2c082c,_0x3c0243['error'][_0xbc4d('0x12')]);return _0x478267(_0x3c0243['error'][_0xbc4d('0x12')]);}else{logger[_0xbc4d('0xc')](_0xbc4d('0xd'),_0x2c082c,_0xbc4d('0xe'));_0x478267(_0x3c0243['result']['message']);}})['catch'](function(_0x36e115){logger[_0xbc4d('0x10')]('AnalyticTreeReport,\x20%s,\x20%s',_0x2c082c,_0x36e115);_0x5dc561(_0x36e115);});});}
\ No newline at end of file
diff --git a/server/api/analyticTreeReport/index.js b/server/api/analyticTreeReport/index.js
index b371209..c2b8136 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 _0xc5ce=['/:id','destroy','util','connect-timeout','../../components/auth/service','../../components/interaction/service','./analyticTreeReport.controller','isAuthenticated','show','post','put','update','delete'];(function(_0x1a87b3,_0x45ba68){var _0x37e84d=function(_0x39f49e){while(--_0x39f49e){_0x1a87b3['push'](_0x1a87b3['shift']());}};_0x37e84d(++_0x45ba68);}(_0xc5ce,0x84));var _0xec5c=function(_0x3511d3,_0x4107ae){_0x3511d3=_0x3511d3-0x0;var _0x5d6321=_0xc5ce[_0x3511d3];return _0x5d6321;};'use strict';var multer=require('multer');var util=require(_0xec5c('0x0'));var path=require('path');var timeout=require(_0xec5c('0x1'));var express=require('express');var router=express['Router']();var auth=require(_0xec5c('0x2'));var interaction=require(_0xec5c('0x3'));var config=require('../../config/environment');var controller=require(_0xec5c('0x4'));router['get']('/',auth[_0xec5c('0x5')](),controller['index']);router['get']('/:id',auth['isAuthenticated'](),controller[_0xec5c('0x6')]);router[_0xec5c('0x7')]('/',auth['isAuthenticated'](),controller['create']);router[_0xec5c('0x8')]('/:id',auth[_0xec5c('0x5')](),controller[_0xec5c('0x9')]);router[_0xec5c('0xa')](_0xec5c('0xb'),auth[_0xec5c('0x5')](),controller[_0xec5c('0xc')]);module['exports']=router;
\ No newline at end of file
+var _0x6ed0=['util','path','connect-timeout','express','Router','../../components/auth/service','./analyticTreeReport.controller','get','isAuthenticated','index','/:id','post','create','delete','destroy','exports','multer'];(function(_0x321bb2,_0x202794){var _0x9c12ed=function(_0x263dd3){while(--_0x263dd3){_0x321bb2['push'](_0x321bb2['shift']());}};_0x9c12ed(++_0x202794);}(_0x6ed0,0x1db));var _0x06ed=function(_0x368ef3,_0x2f4c04){_0x368ef3=_0x368ef3-0x0;var _0x274dc7=_0x6ed0[_0x368ef3];return _0x274dc7;};'use strict';var multer=require(_0x06ed('0x0'));var util=require(_0x06ed('0x1'));var path=require(_0x06ed('0x2'));var timeout=require(_0x06ed('0x3'));var express=require(_0x06ed('0x4'));var router=express[_0x06ed('0x5')]();var auth=require(_0x06ed('0x6'));var interaction=require('../../components/interaction/service');var config=require('../../config/environment');var controller=require(_0x06ed('0x7'));router[_0x06ed('0x8')]('/',auth[_0x06ed('0x9')](),controller[_0x06ed('0xa')]);router[_0x06ed('0x8')](_0x06ed('0xb'),auth[_0x06ed('0x9')](),controller['show']);router[_0x06ed('0xc')]('/',auth['isAuthenticated'](),controller[_0x06ed('0xd')]);router['put'](_0x06ed('0xb'),auth[_0x06ed('0x9')](),controller['update']);router[_0x06ed('0xe')]('/:id',auth[_0x06ed('0x9')](),controller[_0x06ed('0xf')]);module[_0x06ed('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 cb1d8d3..2c68ef5 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 _0x189c=['sequelize','STRING'];(function(_0x3dd15e,_0x1f0015){var _0x231fd0=function(_0x4f680a){while(--_0x4f680a){_0x3dd15e['push'](_0x3dd15e['shift']());}};_0x231fd0(++_0x1f0015);}(_0x189c,0x1da));var _0xc189=function(_0x197758,_0x988e49){_0x197758=_0x197758-0x0;var _0x384c0b=_0x189c[_0x197758];return _0x384c0b;};'use strict';var Sequelize=require(_0xc189('0x0'));module['exports']={'name':{'type':Sequelize['STRING']},'basename':{'type':Sequelize[_0xc189('0x1')]},'type':{'type':Sequelize[_0xc189('0x1')]}};
\ No newline at end of file
+var _0xbb97=['STRING','sequelize','exports'];(function(_0x43a6cd,_0x503d1a){var _0x5acb36=function(_0x2dd95e){while(--_0x2dd95e){_0x43a6cd['push'](_0x43a6cd['shift']());}};_0x5acb36(++_0x503d1a);}(_0xbb97,0xb2));var _0x7bb9=function(_0x48103d,_0x230b49){_0x48103d=_0x48103d-0x0;var _0x4f99ca=_0xbb97[_0x48103d];return _0x4f99ca;};'use strict';var Sequelize=require(_0x7bb9('0x0'));module[_0x7bb9('0x1')]={'name':{'type':Sequelize[_0x7bb9('0x2')]},'basename':{'type':Sequelize[_0x7bb9('0x2')]},'type':{'type':Sequelize[_0x7bb9('0x2')]}};
\ No newline at end of file
diff --git a/server/api/attachment/attachment.controller.js b/server/api/attachment/attachment.controller.js
index 1e43a79..667fc8a 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 _0x0f41=['mustache','util','path','sox','to-csv','lodash','squel','crypto','jsforce','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/advancedSearch','../../config/license/hardware','api','../../config/utils','../../config/environment','../../mysqldb','status','end','json','count','offset','limit','set','Content-Range','reject','save','then','destroy','error','name','send','map','Attachment','rawAttributes','fieldName','key','query','filters','intersection','attributes','model','fields','length','hasOwnProperty','order','sort','pick','filter','where','merge','type','include','findAll','rows','show','params','keys','includeAll','find','clone','get','omit','updatedAt','body','createdAt','create','catch','file','basename','filename','mimetype','findOne','join','root','server/files/attachments/','html-pdf','eml-format','rimraf','zip-dir','fast-json-patch','moment','bluebird'];(function(_0x1e7ad9,_0x14c620){var _0xcbef80=function(_0x457d18){while(--_0x457d18){_0x1e7ad9['push'](_0x1e7ad9['shift']());}};_0xcbef80(++_0x14c620);}(_0x0f41,0xa3));var _0x10f4=function(_0x109874,_0x125a13){_0x109874=_0x109874-0x0;var _0x34d588=_0x0f41[_0x109874];return _0x34d588;};'use strict';var pdf=require(_0x10f4('0x0'));var emlformat=require(_0x10f4('0x1'));var rimraf=require(_0x10f4('0x2'));var zipdir=require(_0x10f4('0x3'));var jsonpatch=require(_0x10f4('0x4'));var rp=require('request-promise');var moment=require(_0x10f4('0x5'));var BPromise=require(_0x10f4('0x6'));var Mustache=require(_0x10f4('0x7'));var util=require(_0x10f4('0x8'));var path=require(_0x10f4('0x9'));var sox=require(_0x10f4('0xa'));var csv=require(_0x10f4('0xb'));var ejs=require('ejs');var fs=require('fs');var _=require(_0x10f4('0xc'));var squel=require(_0x10f4('0xd'));var crypto=require(_0x10f4('0xe'));var jsforce=require(_0x10f4('0xf'));var deskjs=require('desk.js');var toCsv=require(_0x10f4('0xb'));var querystring=require(_0x10f4('0x10'));var Papa=require(_0x10f4('0x11'));var Redis=require(_0x10f4('0x12'));var authService=require(_0x10f4('0x13'));var qs=require('../../components/parsers/qs');var as=require(_0x10f4('0x14'));var hardwareService=require(_0x10f4('0x15'));var logger=require('../../config/logger')(_0x10f4('0x16'));var utils=require(_0x10f4('0x17'));var config=require(_0x10f4('0x18'));var db=require(_0x10f4('0x19'))['db'];function respondWithStatusCode(_0x5c8c92,_0x187995){_0x187995=_0x187995||0xcc;return function(_0xfc2a31){if(_0xfc2a31){return _0x5c8c92['sendStatus'](_0x187995);}return _0x5c8c92[_0x10f4('0x1a')](_0x187995)[_0x10f4('0x1b')]();};}function respondWithResult(_0x3fa92a,_0x217c46){_0x217c46=_0x217c46||0xc8;return function(_0x5d33de){if(_0x5d33de){return _0x3fa92a[_0x10f4('0x1a')](_0x217c46)[_0x10f4('0x1c')](_0x5d33de);}};}function respondWithFilteredResult(_0x4876ec,_0x6c4a0){return function(_0x4ccaf8){if(_0x4ccaf8){var _0x52e4c9=_0x4ccaf8[_0x10f4('0x1d')],_0xd57239=_0x6c4a0[_0x10f4('0x1e')],_0x53c5dd=_0x6c4a0[_0x10f4('0x1e')]+_0x6c4a0[_0x10f4('0x1f')],_0x48cd2a;if(_0x53c5dd>=_0x52e4c9){_0x53c5dd=_0x52e4c9;_0x48cd2a=0xc8;}else{_0x48cd2a=0xce;}_0x4876ec[_0x10f4('0x1a')](_0x48cd2a);return _0x4876ec[_0x10f4('0x20')](_0x10f4('0x21'),_0xd57239+'-'+_0x53c5dd+'/'+_0x52e4c9)[_0x10f4('0x1c')](_0x4ccaf8);}return null;};}function patchUpdates(_0x34e8ec){return function(_0x52ef0d){try{jsonpatch['apply'](_0x52ef0d,_0x34e8ec,!![]);}catch(_0x296f16){return BPromise[_0x10f4('0x22')](_0x296f16);}return _0x52ef0d[_0x10f4('0x23')]();};}function saveUpdates(_0x42c8a8,_0x596a16){return function(_0x1094ce){if(_0x1094ce){return _0x1094ce['update'](_0x42c8a8)[_0x10f4('0x24')](function(_0x3b520a){return _0x3b520a;});}return null;};}function removeEntity(_0xdcaf4b,_0x3c72f9){return function(_0xd4c298){if(_0xd4c298){return _0xd4c298[_0x10f4('0x25')]()['then'](function(){_0xdcaf4b['status'](0xcc)[_0x10f4('0x1b')]();});}};}function handleEntityNotFound(_0x47c64f,_0x2436a4){return function(_0x24d91a){if(!_0x24d91a){_0x47c64f['sendStatus'](0x194);}return _0x24d91a;};}function handleError(_0x4d3131,_0x325b19){_0x325b19=_0x325b19||0x1f4;return function(_0x266fe8){logger[_0x10f4('0x26')](_0x266fe8['stack']);if(_0x266fe8[_0x10f4('0x27')]){delete _0x266fe8[_0x10f4('0x27')];}_0x4d3131[_0x10f4('0x1a')](_0x325b19)[_0x10f4('0x28')](_0x266fe8);};}exports['index']=function(_0x2789eb,_0x56ba57){var _0x1e48eb={},_0x5a9102={},_0x3c6a67={'count':0x0,'rows':[]};var _0x500f53=_[_0x10f4('0x29')](db[_0x10f4('0x2a')][_0x10f4('0x2b')],function(_0x1f6e0c){return{'name':_0x1f6e0c[_0x10f4('0x2c')],'type':_0x1f6e0c['type'][_0x10f4('0x2d')]};});_0x5a9102['model']=_[_0x10f4('0x29')](_0x500f53,'name');_0x5a9102[_0x10f4('0x2e')]=_['keys'](_0x2789eb[_0x10f4('0x2e')]);_0x5a9102[_0x10f4('0x2f')]=_[_0x10f4('0x30')](_0x5a9102['model'],_0x5a9102[_0x10f4('0x2e')]);_0x1e48eb[_0x10f4('0x31')]=_[_0x10f4('0x30')](_0x5a9102[_0x10f4('0x32')],qs['fields'](_0x2789eb['query'][_0x10f4('0x33')]));_0x1e48eb[_0x10f4('0x31')]=_0x1e48eb['attributes'][_0x10f4('0x34')]?_0x1e48eb['attributes']:_0x5a9102[_0x10f4('0x32')];if(!_0x2789eb[_0x10f4('0x2e')][_0x10f4('0x35')]('nolimit')){_0x1e48eb[_0x10f4('0x1f')]=qs[_0x10f4('0x1f')](_0x2789eb['query'][_0x10f4('0x1f')]);_0x1e48eb[_0x10f4('0x1e')]=qs[_0x10f4('0x1e')](_0x2789eb['query'][_0x10f4('0x1e')]);}_0x1e48eb[_0x10f4('0x36')]=qs[_0x10f4('0x37')](_0x2789eb['query'][_0x10f4('0x37')]);_0x1e48eb['where']=qs[_0x10f4('0x2f')](_[_0x10f4('0x38')](_0x2789eb['query'],_0x5a9102['filters']));if(_0x2789eb[_0x10f4('0x2e')][_0x10f4('0x39')]){_0x1e48eb[_0x10f4('0x3a')]=_[_0x10f4('0x3b')](_0x1e48eb[_0x10f4('0x3a')],{'$or':_[_0x10f4('0x29')](_0x500f53,function(_0x3e0192){if(_0x3e0192[_0x10f4('0x3c')]!=='VIRTUAL'){var _0x3afbcf={};_0x3afbcf[_0x3e0192['name']]={'$like':'%'+_0x2789eb[_0x10f4('0x2e')]['filter']+'%'};return _0x3afbcf;}})});}_0x1e48eb=_[_0x10f4('0x3b')]({},_0x1e48eb,_0x2789eb['options']);var _0x168575={'where':_0x1e48eb['where']};return db[_0x10f4('0x2a')][_0x10f4('0x1d')](_0x168575)[_0x10f4('0x24')](function(_0x10237a){_0x3c6a67[_0x10f4('0x1d')]=_0x10237a;if(_0x2789eb[_0x10f4('0x2e')]['includeAll']){_0x1e48eb[_0x10f4('0x3d')]=[{'all':!![]}];}return db[_0x10f4('0x2a')][_0x10f4('0x3e')](_0x1e48eb);})[_0x10f4('0x24')](function(_0x4c203f){_0x3c6a67[_0x10f4('0x3f')]=_0x4c203f;return _0x3c6a67;})[_0x10f4('0x24')](respondWithFilteredResult(_0x56ba57,_0x1e48eb))['catch'](handleError(_0x56ba57,null));};exports[_0x10f4('0x40')]=function(_0x479a6b,_0xbd258d){var _0x1fc93c={'raw':!![],'where':{'id':_0x479a6b[_0x10f4('0x41')]['id']}},_0x15d4ac={};_0x15d4ac['model']=_[_0x10f4('0x42')](db[_0x10f4('0x2a')]['rawAttributes']);_0x15d4ac[_0x10f4('0x2e')]=_[_0x10f4('0x42')](_0x479a6b[_0x10f4('0x2e')]);_0x15d4ac[_0x10f4('0x2f')]=_[_0x10f4('0x30')](_0x15d4ac[_0x10f4('0x32')],_0x15d4ac[_0x10f4('0x2e')]);_0x1fc93c[_0x10f4('0x31')]=_[_0x10f4('0x30')](_0x15d4ac[_0x10f4('0x32')],qs['fields'](_0x479a6b[_0x10f4('0x2e')][_0x10f4('0x33')]));_0x1fc93c[_0x10f4('0x31')]=_0x1fc93c['attributes']['length']?_0x1fc93c[_0x10f4('0x31')]:_0x15d4ac['model'];if(_0x479a6b[_0x10f4('0x2e')][_0x10f4('0x43')]){_0x1fc93c['include']=[{'all':!![]}];}_0x1fc93c=_[_0x10f4('0x3b')]({},_0x1fc93c,_0x479a6b['options']);return db[_0x10f4('0x2a')][_0x10f4('0x44')](_0x1fc93c)['then'](handleEntityNotFound(_0xbd258d,null))[_0x10f4('0x24')](respondWithResult(_0xbd258d,null))['catch'](handleError(_0xbd258d,null));};exports[_0x10f4('0x45')]=function(_0x3113ef,_0x333d75){var _0x2fcade={'where':{'id':_0x3113ef[_0x10f4('0x41')]['id']}},_0x1e3ec7={};_0x1e3ec7['model']=_['keys'](db[_0x10f4('0x2a')][_0x10f4('0x2b')]);_0x2fcade[_0x10f4('0x31')]=_[_0x10f4('0x30')](_0x1e3ec7[_0x10f4('0x32')],qs[_0x10f4('0x33')](_0x3113ef[_0x10f4('0x2e')][_0x10f4('0x33')]));_0x2fcade[_0x10f4('0x31')]=_0x2fcade['attributes'][_0x10f4('0x34')]?_0x2fcade[_0x10f4('0x31')]:_0x1e3ec7['model'];if(_0x3113ef[_0x10f4('0x2e')][_0x10f4('0x43')]){_0x2fcade[_0x10f4('0x3d')]=[{'all':!![]}];}_0x2fcade=_['merge']({},_0x2fcade,_0x3113ef['options']);return db[_0x10f4('0x2a')][_0x10f4('0x44')](_0x2fcade)[_0x10f4('0x24')](handleEntityNotFound(_0x333d75,null))[_0x10f4('0x24')](function(_0x550fb2){if(_0x550fb2){var _0x1435e1=_0x550fb2[_0x10f4('0x46')]({'plain':!![]});_0x1435e1=qs[_0x10f4('0x47')](_0x1435e1,['id','createdAt',_0x10f4('0x48')]);_0x3113ef['body']=_[_0x10f4('0x47')](_0x3113ef[_0x10f4('0x49')],['id',_0x10f4('0x4a'),_0x10f4('0x48')]);return db[_0x10f4('0x2a')][_0x10f4('0x4b')](_[_0x10f4('0x3b')](_0x1435e1,_0x3113ef[_0x10f4('0x49')]),{'include':_0x3113ef[_0x10f4('0x2e')][_0x10f4('0x43')]?[{'all':!![]}]:undefined});}})[_0x10f4('0x24')](respondWithResult(_0x333d75,0xc9))['catch'](handleError(_0x333d75,null));};exports['update']=function(_0x1ac7ce,_0x60c7f3){if(_0x1ac7ce['body']['id']){delete _0x1ac7ce[_0x10f4('0x49')]['id'];}return db['Attachment'][_0x10f4('0x44')]({'where':{'id':_0x1ac7ce[_0x10f4('0x41')]['id']}})[_0x10f4('0x24')](handleEntityNotFound(_0x60c7f3,null))[_0x10f4('0x24')](saveUpdates(_0x1ac7ce[_0x10f4('0x49')],null))['then'](respondWithResult(_0x60c7f3,null))[_0x10f4('0x4c')](handleError(_0x60c7f3,null));};exports['destroy']=function(_0x3a588d,_0x4ad609){return db['Attachment'][_0x10f4('0x44')]({'where':{'id':_0x3a588d['params']['id']}})['then'](handleEntityNotFound(_0x4ad609,null))['then'](removeEntity(_0x4ad609,null))['catch'](handleError(_0x4ad609,null));};exports[_0x10f4('0x4b')]=function(_0x47fb39,_0x2195b7,_0x5925b7){_0x47fb39['body'][_0x10f4('0x27')]=_0x47fb39[_0x10f4('0x4d')]['originalname'];_0x47fb39[_0x10f4('0x49')][_0x10f4('0x4e')]=_0x47fb39[_0x10f4('0x4d')][_0x10f4('0x4f')];_0x47fb39['body'][_0x10f4('0x3c')]=_0x47fb39['file'][_0x10f4('0x50')];return db[_0x10f4('0x2a')][_0x10f4('0x4b')](_0x47fb39[_0x10f4('0x49')])[_0x10f4('0x24')](respondWithResult(_0x2195b7,0xc9))['catch'](handleError(_0x2195b7,null));};exports['download']=function(_0x4f9a04,_0x383f87,_0x216750){return db[_0x10f4('0x2a')][_0x10f4('0x51')]({'where':{'id':_0x4f9a04[_0x10f4('0x41')]['id']},'raw':!![]})[_0x10f4('0x24')](handleEntityNotFound(_0x383f87,null))[_0x10f4('0x24')](function(_0x3a3457){if(_0x3a3457){return _0x383f87['download'](path[_0x10f4('0x52')](config[_0x10f4('0x53')],_0x10f4('0x54'),_0x3a3457[_0x10f4('0x4e')]));}})[_0x10f4('0x4c')](handleError(_0x383f87,null));};
\ No newline at end of file
+var _0x3cc8=['name','send','index','fieldName','type','key','query','keys','filters','model','attributes','intersection','fields','length','hasOwnProperty','nolimit','limit','sort','where','pick','filter','merge','map','include','Attachment','rows','catch','show','options','clone','params','includeAll','find','get','createdAt','updatedAt','body','update','originalname','basename','file','filename','mimetype','create','download','findOne','join','server/files/attachments/','html-pdf','rimraf','fast-json-patch','request-promise','moment','bluebird','util','path','sox','to-csv','ejs','lodash','crypto','jsforce','desk.js','ioredis','../../components/auth/service','../../components/parsers/qs','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/environment','sendStatus','status','json','count','offset','set','Content-Range','apply','reject','save','then','end','error','stack'];(function(_0x1d9234,_0x183dff){var _0x24eae8=function(_0x3c1fc4){while(--_0x3c1fc4){_0x1d9234['push'](_0x1d9234['shift']());}};_0x24eae8(++_0x183dff);}(_0x3cc8,0x12f));var _0x83cc=function(_0x4cb48d,_0x2a2d41){_0x4cb48d=_0x4cb48d-0x0;var _0x493f4b=_0x3cc8[_0x4cb48d];return _0x493f4b;};'use strict';var pdf=require(_0x83cc('0x0'));var emlformat=require('eml-format');var rimraf=require(_0x83cc('0x1'));var zipdir=require('zip-dir');var jsonpatch=require(_0x83cc('0x2'));var rp=require(_0x83cc('0x3'));var moment=require(_0x83cc('0x4'));var BPromise=require(_0x83cc('0x5'));var Mustache=require('mustache');var util=require(_0x83cc('0x6'));var path=require(_0x83cc('0x7'));var sox=require(_0x83cc('0x8'));var csv=require(_0x83cc('0x9'));var ejs=require(_0x83cc('0xa'));var fs=require('fs');var _=require(_0x83cc('0xb'));var squel=require('squel');var crypto=require(_0x83cc('0xc'));var jsforce=require(_0x83cc('0xd'));var deskjs=require(_0x83cc('0xe'));var toCsv=require('to-csv');var querystring=require('querystring');var Papa=require('papaparse');var Redis=require(_0x83cc('0xf'));var authService=require(_0x83cc('0x10'));var qs=require(_0x83cc('0x11'));var as=require('../../components/parsers/advancedSearch');var hardwareService=require(_0x83cc('0x12'));var logger=require(_0x83cc('0x13'))(_0x83cc('0x14'));var utils=require(_0x83cc('0x15'));var config=require(_0x83cc('0x16'));var db=require('../../mysqldb')['db'];function respondWithStatusCode(_0x59a238,_0x1ba132){_0x1ba132=_0x1ba132||0xcc;return function(_0x598f81){if(_0x598f81){return _0x59a238[_0x83cc('0x17')](_0x1ba132);}return _0x59a238[_0x83cc('0x18')](_0x1ba132)['end']();};}function respondWithResult(_0x18c00a,_0x9c8d26){_0x9c8d26=_0x9c8d26||0xc8;return function(_0x146c81){if(_0x146c81){return _0x18c00a[_0x83cc('0x18')](_0x9c8d26)[_0x83cc('0x19')](_0x146c81);}};}function respondWithFilteredResult(_0x33a3ba,_0x474fba){return function(_0x574e45){if(_0x574e45){var _0x8dc2e3=_0x574e45[_0x83cc('0x1a')],_0x1630f9=_0x474fba[_0x83cc('0x1b')],_0x2a3fa0=_0x474fba[_0x83cc('0x1b')]+_0x474fba['limit'],_0x2c8111;if(_0x2a3fa0>=_0x8dc2e3){_0x2a3fa0=_0x8dc2e3;_0x2c8111=0xc8;}else{_0x2c8111=0xce;}_0x33a3ba[_0x83cc('0x18')](_0x2c8111);return _0x33a3ba[_0x83cc('0x1c')](_0x83cc('0x1d'),_0x1630f9+'-'+_0x2a3fa0+'/'+_0x8dc2e3)[_0x83cc('0x19')](_0x574e45);}return null;};}function patchUpdates(_0x18dab3){return function(_0x1a1bef){try{jsonpatch[_0x83cc('0x1e')](_0x1a1bef,_0x18dab3,!![]);}catch(_0xbaaea){return BPromise[_0x83cc('0x1f')](_0xbaaea);}return _0x1a1bef[_0x83cc('0x20')]();};}function saveUpdates(_0x2c7445,_0x22b173){return function(_0x596c40){if(_0x596c40){return _0x596c40['update'](_0x2c7445)[_0x83cc('0x21')](function(_0xad6736){return _0xad6736;});}return null;};}function removeEntity(_0x1ba4a2,_0x46bcfa){return function(_0x83b37d){if(_0x83b37d){return _0x83b37d['destroy']()[_0x83cc('0x21')](function(){_0x1ba4a2[_0x83cc('0x18')](0xcc)[_0x83cc('0x22')]();});}};}function handleEntityNotFound(_0x130448,_0x39d0b2){return function(_0xb77c9d){if(!_0xb77c9d){_0x130448[_0x83cc('0x17')](0x194);}return _0xb77c9d;};}function handleError(_0x42ae32,_0x5c20c1){_0x5c20c1=_0x5c20c1||0x1f4;return function(_0x3b5b0a){logger[_0x83cc('0x23')](_0x3b5b0a[_0x83cc('0x24')]);if(_0x3b5b0a[_0x83cc('0x25')]){delete _0x3b5b0a[_0x83cc('0x25')];}_0x42ae32[_0x83cc('0x18')](_0x5c20c1)[_0x83cc('0x26')](_0x3b5b0a);};}exports[_0x83cc('0x27')]=function(_0x2e9c70,_0x20bb3c){var _0x24352a={},_0x443036={},_0x57ccdf={'count':0x0,'rows':[]};var _0x1c6d59=_['map'](db['Attachment']['rawAttributes'],function(_0x41a08a){return{'name':_0x41a08a[_0x83cc('0x28')],'type':_0x41a08a[_0x83cc('0x29')][_0x83cc('0x2a')]};});_0x443036['model']=_['map'](_0x1c6d59,_0x83cc('0x25'));_0x443036[_0x83cc('0x2b')]=_[_0x83cc('0x2c')](_0x2e9c70['query']);_0x443036[_0x83cc('0x2d')]=_['intersection'](_0x443036[_0x83cc('0x2e')],_0x443036[_0x83cc('0x2b')]);_0x24352a[_0x83cc('0x2f')]=_[_0x83cc('0x30')](_0x443036[_0x83cc('0x2e')],qs[_0x83cc('0x31')](_0x2e9c70[_0x83cc('0x2b')][_0x83cc('0x31')]));_0x24352a[_0x83cc('0x2f')]=_0x24352a[_0x83cc('0x2f')][_0x83cc('0x32')]?_0x24352a[_0x83cc('0x2f')]:_0x443036[_0x83cc('0x2e')];if(!_0x2e9c70[_0x83cc('0x2b')][_0x83cc('0x33')](_0x83cc('0x34'))){_0x24352a['limit']=qs['limit'](_0x2e9c70[_0x83cc('0x2b')][_0x83cc('0x35')]);_0x24352a[_0x83cc('0x1b')]=qs[_0x83cc('0x1b')](_0x2e9c70[_0x83cc('0x2b')]['offset']);}_0x24352a['order']=qs[_0x83cc('0x36')](_0x2e9c70[_0x83cc('0x2b')][_0x83cc('0x36')]);_0x24352a[_0x83cc('0x37')]=qs[_0x83cc('0x2d')](_[_0x83cc('0x38')](_0x2e9c70[_0x83cc('0x2b')],_0x443036[_0x83cc('0x2d')]));if(_0x2e9c70[_0x83cc('0x2b')][_0x83cc('0x39')]){_0x24352a[_0x83cc('0x37')]=_[_0x83cc('0x3a')](_0x24352a[_0x83cc('0x37')],{'$or':_[_0x83cc('0x3b')](_0x1c6d59,function(_0x23c3ba){if(_0x23c3ba[_0x83cc('0x29')]!=='VIRTUAL'){var _0x803a8e={};_0x803a8e[_0x23c3ba['name']]={'$like':'%'+_0x2e9c70[_0x83cc('0x2b')][_0x83cc('0x39')]+'%'};return _0x803a8e;}})});}_0x24352a=_[_0x83cc('0x3a')]({},_0x24352a,_0x2e9c70['options']);var _0x4769f9={'where':_0x24352a[_0x83cc('0x37')]};return db['Attachment'][_0x83cc('0x1a')](_0x4769f9)[_0x83cc('0x21')](function(_0xaf2b52){_0x57ccdf[_0x83cc('0x1a')]=_0xaf2b52;if(_0x2e9c70[_0x83cc('0x2b')]['includeAll']){_0x24352a[_0x83cc('0x3c')]=[{'all':!![]}];}return db[_0x83cc('0x3d')]['findAll'](_0x24352a);})['then'](function(_0x4ff84f){_0x57ccdf[_0x83cc('0x3e')]=_0x4ff84f;return _0x57ccdf;})[_0x83cc('0x21')](respondWithFilteredResult(_0x20bb3c,_0x24352a))[_0x83cc('0x3f')](handleError(_0x20bb3c,null));};exports[_0x83cc('0x40')]=function(_0x42aac7,_0x859c48){var _0x776f51={'raw':!![],'where':{'id':_0x42aac7['params']['id']}},_0x42a3a6={};_0x42a3a6[_0x83cc('0x2e')]=_[_0x83cc('0x2c')](db[_0x83cc('0x3d')]['rawAttributes']);_0x42a3a6[_0x83cc('0x2b')]=_[_0x83cc('0x2c')](_0x42aac7[_0x83cc('0x2b')]);_0x42a3a6[_0x83cc('0x2d')]=_[_0x83cc('0x30')](_0x42a3a6[_0x83cc('0x2e')],_0x42a3a6[_0x83cc('0x2b')]);_0x776f51[_0x83cc('0x2f')]=_[_0x83cc('0x30')](_0x42a3a6[_0x83cc('0x2e')],qs[_0x83cc('0x31')](_0x42aac7[_0x83cc('0x2b')]['fields']));_0x776f51[_0x83cc('0x2f')]=_0x776f51[_0x83cc('0x2f')][_0x83cc('0x32')]?_0x776f51['attributes']:_0x42a3a6[_0x83cc('0x2e')];if(_0x42aac7[_0x83cc('0x2b')]['includeAll']){_0x776f51[_0x83cc('0x3c')]=[{'all':!![]}];}_0x776f51=_[_0x83cc('0x3a')]({},_0x776f51,_0x42aac7[_0x83cc('0x41')]);return db[_0x83cc('0x3d')]['find'](_0x776f51)['then'](handleEntityNotFound(_0x859c48,null))[_0x83cc('0x21')](respondWithResult(_0x859c48,null))[_0x83cc('0x3f')](handleError(_0x859c48,null));};exports[_0x83cc('0x42')]=function(_0x39542c,_0xbb4039){var _0x5a5269={'where':{'id':_0x39542c[_0x83cc('0x43')]['id']}},_0x127c4b={};_0x127c4b[_0x83cc('0x2e')]=_[_0x83cc('0x2c')](db[_0x83cc('0x3d')]['rawAttributes']);_0x5a5269['attributes']=_[_0x83cc('0x30')](_0x127c4b['model'],qs[_0x83cc('0x31')](_0x39542c[_0x83cc('0x2b')]['fields']));_0x5a5269[_0x83cc('0x2f')]=_0x5a5269[_0x83cc('0x2f')]['length']?_0x5a5269[_0x83cc('0x2f')]:_0x127c4b[_0x83cc('0x2e')];if(_0x39542c['query'][_0x83cc('0x44')]){_0x5a5269[_0x83cc('0x3c')]=[{'all':!![]}];}_0x5a5269=_[_0x83cc('0x3a')]({},_0x5a5269,_0x39542c['options']);return db[_0x83cc('0x3d')][_0x83cc('0x45')](_0x5a5269)[_0x83cc('0x21')](handleEntityNotFound(_0xbb4039,null))['then'](function(_0x118cb8){if(_0x118cb8){var _0x38b6e2=_0x118cb8[_0x83cc('0x46')]({'plain':!![]});_0x38b6e2=qs['omit'](_0x38b6e2,['id',_0x83cc('0x47'),_0x83cc('0x48')]);_0x39542c[_0x83cc('0x49')]=_['omit'](_0x39542c[_0x83cc('0x49')],['id','createdAt','updatedAt']);return db[_0x83cc('0x3d')]['create'](_[_0x83cc('0x3a')](_0x38b6e2,_0x39542c[_0x83cc('0x49')]),{'include':_0x39542c['query']['includeAll']?[{'all':!![]}]:undefined});}})[_0x83cc('0x21')](respondWithResult(_0xbb4039,0xc9))[_0x83cc('0x3f')](handleError(_0xbb4039,null));};exports[_0x83cc('0x4a')]=function(_0x2efff5,_0x53b30c){if(_0x2efff5[_0x83cc('0x49')]['id']){delete _0x2efff5[_0x83cc('0x49')]['id'];}return db[_0x83cc('0x3d')]['find']({'where':{'id':_0x2efff5[_0x83cc('0x43')]['id']}})[_0x83cc('0x21')](handleEntityNotFound(_0x53b30c,null))[_0x83cc('0x21')](saveUpdates(_0x2efff5[_0x83cc('0x49')],null))[_0x83cc('0x21')](respondWithResult(_0x53b30c,null))[_0x83cc('0x3f')](handleError(_0x53b30c,null));};exports['destroy']=function(_0x1945b0,_0x86eb55){return db['Attachment'][_0x83cc('0x45')]({'where':{'id':_0x1945b0[_0x83cc('0x43')]['id']}})[_0x83cc('0x21')](handleEntityNotFound(_0x86eb55,null))['then'](removeEntity(_0x86eb55,null))['catch'](handleError(_0x86eb55,null));};exports['create']=function(_0x32032b,_0x532f86,_0x4fb46c){_0x32032b[_0x83cc('0x49')][_0x83cc('0x25')]=_0x32032b['file'][_0x83cc('0x4b')];_0x32032b[_0x83cc('0x49')][_0x83cc('0x4c')]=_0x32032b[_0x83cc('0x4d')][_0x83cc('0x4e')];_0x32032b[_0x83cc('0x49')]['type']=_0x32032b[_0x83cc('0x4d')][_0x83cc('0x4f')];return db['Attachment'][_0x83cc('0x50')](_0x32032b['body'])[_0x83cc('0x21')](respondWithResult(_0x532f86,0xc9))[_0x83cc('0x3f')](handleError(_0x532f86,null));};exports[_0x83cc('0x51')]=function(_0x595ef2,_0x3ce942,_0x5eed50){return db[_0x83cc('0x3d')][_0x83cc('0x52')]({'where':{'id':_0x595ef2[_0x83cc('0x43')]['id']},'raw':!![]})[_0x83cc('0x21')](handleEntityNotFound(_0x3ce942,null))[_0x83cc('0x21')](function(_0x153ac0){if(_0x153ac0){return _0x3ce942[_0x83cc('0x51')](path[_0x83cc('0x53')](config['root'],_0x83cc('0x54'),_0x153ac0[_0x83cc('0x4c')]));}})['catch'](handleError(_0x3ce942,null));};
\ No newline at end of file
diff --git a/server/api/attachment/attachment.model.js b/server/api/attachment/attachment.model.js
index a87ae5a..b9cbf65 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 _0x01a6=['rimraf','./attachment.attributes','exports','define','lodash','../../config/logger','api','moment','bluebird','request-promise'];(function(_0x4ed9ba,_0x40a1b5){var _0x374fae=function(_0x16afa9){while(--_0x16afa9){_0x4ed9ba['push'](_0x4ed9ba['shift']());}};_0x374fae(++_0x40a1b5);}(_0x01a6,0x162));var _0x601a=function(_0x2eb718,_0x31a5ae){_0x2eb718=_0x2eb718-0x0;var _0x412b8c=_0x01a6[_0x2eb718];return _0x412b8c;};'use strict';var _=require(_0x601a('0x0'));var util=require('util');var logger=require(_0x601a('0x1'))(_0x601a('0x2'));var moment=require(_0x601a('0x3'));var BPromise=require(_0x601a('0x4'));var rp=require(_0x601a('0x5'));var fs=require('fs');var path=require('path');var rimraf=require(_0x601a('0x6'));var config=require('../../config/environment');var attributes=require(_0x601a('0x7'));module[_0x601a('0x8')]=function(_0x30df8c,_0x196c77){return _0x30df8c[_0x601a('0x9')]('Attachment',attributes,{'tableName':'attachments','paranoid':![],'indexes':[],'timestamps':!![]});};
\ No newline at end of file
+var _0x69d3=['../../config/logger','moment','bluebird','rimraf','exports','define','Attachment','attachments','lodash','util'];(function(_0xbd08b4,_0x4790ed){var _0x314f1e=function(_0x161589){while(--_0x161589){_0xbd08b4['push'](_0xbd08b4['shift']());}};_0x314f1e(++_0x4790ed);}(_0x69d3,0xda));var _0x369d=function(_0xbc519a,_0x31ced6){_0xbc519a=_0xbc519a-0x0;var _0x2b0566=_0x69d3[_0xbc519a];return _0x2b0566;};'use strict';var _=require(_0x369d('0x0'));var util=require(_0x369d('0x1'));var logger=require(_0x369d('0x2'))('api');var moment=require(_0x369d('0x3'));var BPromise=require(_0x369d('0x4'));var rp=require('request-promise');var fs=require('fs');var path=require('path');var rimraf=require(_0x369d('0x5'));var config=require('../../config/environment');var attributes=require('./attachment.attributes');module[_0x369d('0x6')]=function(_0x2f2a53,_0x18c9f1){return _0x2f2a53[_0x369d('0x7')](_0x369d('0x8'),attributes,{'tableName':_0x369d('0x9'),'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 84b56ce..dcfc88c 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 _0x79f3=['options','raw','util','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','client','http','request','then','info','Attachment,\x20%s,\x20%s','request\x20sent','debug','Attachment,\x20%s,\x20%s,\x20%s','stringify','error','code','message','result','catch','CreateAttachment'];(function(_0x3dd15e,_0x1f0015){var _0x231fd0=function(_0x4f680a){while(--_0x4f680a){_0x3dd15e['push'](_0x3dd15e['shift']());}};_0x231fd0(++_0x1f0015);}(_0x79f3,0x1b5));var _0x379f=function(_0x28669c,_0x1f62c4){_0x28669c=_0x28669c-0x0;var _0x4a3af6=_0x79f3[_0x28669c];return _0x4a3af6;};'use strict';var _=require('lodash');var util=require(_0x379f('0x0'));var moment=require(_0x379f('0x1'));var BPromise=require(_0x379f('0x2'));var rs=require(_0x379f('0x3'));var fs=require('fs');var Redis=require(_0x379f('0x4'));var db=require(_0x379f('0x5'))['db'];var utils=require(_0x379f('0x6'));var logger=require(_0x379f('0x7'))(_0x379f('0x8'));var config=require(_0x379f('0x9'));var jayson=require(_0x379f('0xa'));var client=jayson[_0x379f('0xb')][_0x379f('0xc')]({'port':0x232a});function respondWithRpcPromise(_0x806c8e,_0x43736b,_0x1af18f){return new BPromise(function(_0x1a3338,_0x2842f8){return client[_0x379f('0xd')](_0x806c8e,_0x1af18f)[_0x379f('0xe')](function(_0x5e93cb){logger[_0x379f('0xf')](_0x379f('0x10'),_0x43736b,_0x379f('0x11'));logger[_0x379f('0x12')](_0x379f('0x13'),_0x43736b,_0x379f('0x11'),JSON[_0x379f('0x14')](_0x5e93cb));if(_0x5e93cb[_0x379f('0x15')]){if(_0x5e93cb['error'][_0x379f('0x16')]===0x1f4){logger[_0x379f('0x15')]('Attachment,\x20%s,\x20%s',_0x43736b,_0x5e93cb[_0x379f('0x15')]['message']);return _0x2842f8(_0x5e93cb[_0x379f('0x15')][_0x379f('0x17')]);}logger[_0x379f('0x15')](_0x379f('0x10'),_0x43736b,_0x5e93cb[_0x379f('0x15')]['message']);return _0x1a3338(_0x5e93cb['error'][_0x379f('0x17')]);}else{logger['info'](_0x379f('0x10'),_0x43736b,_0x379f('0x11'));_0x1a3338(_0x5e93cb[_0x379f('0x18')][_0x379f('0x17')]);}})[_0x379f('0x19')](function(_0x48e696){logger[_0x379f('0x15')](_0x379f('0x10'),_0x43736b,_0x48e696);_0x2842f8(_0x48e696);});});}exports[_0x379f('0x1a')]=function(_0x390c95){var _0x485e77=this;return new Promise(function(_0x562fe3,_0x189f7e){return db['Attachment']['create'](_0x390c95['body'],{'raw':_0x390c95[_0x379f('0x1b')]?_0x390c95[_0x379f('0x1b')][_0x379f('0x1c')]===undefined?!![]:![]:!![]})[_0x379f('0xe')](function(_0x4cd348){logger[_0x379f('0xf')](_0x379f('0x1a'),_0x390c95);logger['debug'](_0x379f('0x1a'),_0x390c95,JSON[_0x379f('0x14')](_0x4cd348));_0x562fe3(_0x4cd348);})[_0x379f('0x19')](function(_0x582a01){logger[_0x379f('0x15')](_0x379f('0x1a'),_0x582a01['message'],_0x390c95);_0x189f7e(_0x485e77[_0x379f('0x15')](0x1f4,_0x582a01['message']));});});};
\ No newline at end of file
+var _0xbfcd=['error','code','Attachment,\x20%s,\x20%s','message','result','catch','CreateAttachment','Attachment','create','body','options','raw','then','debug','lodash','util','moment','randomstring','../../config/utils','../../config/environment','jayson/promise','client','http','request','info','request\x20sent','Attachment,\x20%s,\x20%s,\x20%s','stringify'];(function(_0x11fce5,_0x344852){var _0x27792f=function(_0x2b8861){while(--_0x2b8861){_0x11fce5['push'](_0x11fce5['shift']());}};_0x27792f(++_0x344852);}(_0xbfcd,0xee));var _0xdbfc=function(_0x590141,_0x3cb4cd){_0x590141=_0x590141-0x0;var _0xda5e30=_0xbfcd[_0x590141];return _0xda5e30;};'use strict';var _=require(_0xdbfc('0x0'));var util=require(_0xdbfc('0x1'));var moment=require(_0xdbfc('0x2'));var BPromise=require('bluebird');var rs=require(_0xdbfc('0x3'));var fs=require('fs');var Redis=require('ioredis');var db=require('../../mysqldb')['db'];var utils=require(_0xdbfc('0x4'));var logger=require('../../config/logger')('rpc');var config=require(_0xdbfc('0x5'));var jayson=require(_0xdbfc('0x6'));var client=jayson[_0xdbfc('0x7')][_0xdbfc('0x8')]({'port':0x232a});function respondWithRpcPromise(_0x2f8e73,_0x17e80d,_0xa00a53){return new BPromise(function(_0x58c3b8,_0x3f2e20){return client[_0xdbfc('0x9')](_0x2f8e73,_0xa00a53)['then'](function(_0x2e9150){logger[_0xdbfc('0xa')]('Attachment,\x20%s,\x20%s',_0x17e80d,_0xdbfc('0xb'));logger['debug'](_0xdbfc('0xc'),_0x17e80d,'request\x20sent',JSON[_0xdbfc('0xd')](_0x2e9150));if(_0x2e9150['error']){if(_0x2e9150[_0xdbfc('0xe')][_0xdbfc('0xf')]===0x1f4){logger[_0xdbfc('0xe')](_0xdbfc('0x10'),_0x17e80d,_0x2e9150[_0xdbfc('0xe')][_0xdbfc('0x11')]);return _0x3f2e20(_0x2e9150[_0xdbfc('0xe')][_0xdbfc('0x11')]);}logger['error'](_0xdbfc('0x10'),_0x17e80d,_0x2e9150[_0xdbfc('0xe')][_0xdbfc('0x11')]);return _0x58c3b8(_0x2e9150[_0xdbfc('0xe')]['message']);}else{logger[_0xdbfc('0xa')](_0xdbfc('0x10'),_0x17e80d,_0xdbfc('0xb'));_0x58c3b8(_0x2e9150[_0xdbfc('0x12')][_0xdbfc('0x11')]);}})[_0xdbfc('0x13')](function(_0x20801e){logger[_0xdbfc('0xe')](_0xdbfc('0x10'),_0x17e80d,_0x20801e);_0x3f2e20(_0x20801e);});});}exports[_0xdbfc('0x14')]=function(_0x379766){var _0x42cfa3=this;return new Promise(function(_0x572ceb,_0x109aed){return db[_0xdbfc('0x15')][_0xdbfc('0x16')](_0x379766[_0xdbfc('0x17')],{'raw':_0x379766[_0xdbfc('0x18')]?_0x379766['options'][_0xdbfc('0x19')]===undefined?!![]:![]:!![]})[_0xdbfc('0x1a')](function(_0x1f0fed){logger[_0xdbfc('0xa')]('CreateAttachment',_0x379766);logger[_0xdbfc('0x1b')](_0xdbfc('0x14'),_0x379766,JSON[_0xdbfc('0xd')](_0x1f0fed));_0x572ceb(_0x1f0fed);})[_0xdbfc('0x13')](function(_0xd3bfd9){logger[_0xdbfc('0xe')]('CreateAttachment',_0xd3bfd9['message'],_0x379766);_0x109aed(_0x42cfa3[_0xdbfc('0xe')](0x1f4,_0xd3bfd9[_0xdbfc('0x11')]));});});};
\ No newline at end of file
diff --git a/server/api/attachment/index.js b/server/api/attachment/index.js
index 2469c7e..2a0f89a 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 _0x30d6=['join','root','server/files/attachments/','format','now','originalname','single','file','create','put','update','destroy','multer','util','connect-timeout','Router','../../components/auth/service','../../components/interaction/service','get','isAuthenticated','index','/:id','show','download','post','/:id/clone','clone','diskStorage'];(function(_0x2cc842,_0xd6800d){var _0x24adab=function(_0x41ab67){while(--_0x41ab67){_0x2cc842['push'](_0x2cc842['shift']());}};_0x24adab(++_0xd6800d);}(_0x30d6,0x1b0));var _0x630d=function(_0x197837,_0x439ae2){_0x197837=_0x197837-0x0;var _0x3eed5f=_0x30d6[_0x197837];return _0x3eed5f;};'use strict';var multer=require(_0x630d('0x0'));var util=require(_0x630d('0x1'));var path=require('path');var timeout=require(_0x630d('0x2'));var express=require('express');var router=express[_0x630d('0x3')]();var auth=require(_0x630d('0x4'));var interaction=require(_0x630d('0x5'));var config=require('../../config/environment');var controller=require('./attachment.controller');router[_0x630d('0x6')]('/',auth[_0x630d('0x7')](),controller[_0x630d('0x8')]);router['get'](_0x630d('0x9'),auth[_0x630d('0x7')](),controller[_0x630d('0xa')]);router['get']('/:id/download',auth[_0x630d('0x7')](),controller[_0x630d('0xb')]);router[_0x630d('0xc')](_0x630d('0xd'),auth['isAuthenticated'](),controller[_0x630d('0xe')]);var upload=multer({'storage':multer[_0x630d('0xf')]({'destination':function(_0x2f88fb,_0x2c03da,_0x468797){_0x468797(null,path[_0x630d('0x10')](config[_0x630d('0x11')],_0x630d('0x12')));},'filename':function(_0x7f64d,_0x3c86ef,_0x4e67c4){_0x4e67c4(null,util[_0x630d('0x13')]('%s-%s',Date[_0x630d('0x14')](),_0x3c86ef[_0x630d('0x15')]['replace'](/[+@&\/\\#,+()$~%'":*?<>{}\s\\|]/g,'-')));}})});router[_0x630d('0xc')]('/',upload[_0x630d('0x16')](_0x630d('0x17')),controller[_0x630d('0x18')]);router[_0x630d('0x19')](_0x630d('0x9'),auth[_0x630d('0x7')](),controller[_0x630d('0x1a')]);router['delete'](_0x630d('0x9'),auth['isAuthenticated'](),controller[_0x630d('0x1b')]);module['exports']=router;
\ No newline at end of file
+var _0xeec6=['replace','single','file','update','delete','destroy','exports','multer','connect-timeout','express','Router','../../components/auth/service','../../config/environment','./attachment.controller','isAuthenticated','index','/:id','show','get','download','post','diskStorage','server/files/attachments/','format','%s-%s','now'];(function(_0x2998db,_0x3424f1){var _0x115fea=function(_0x3b493c){while(--_0x3b493c){_0x2998db['push'](_0x2998db['shift']());}};_0x115fea(++_0x3424f1);}(_0xeec6,0x125));var _0x6eec=function(_0xcd5a3d,_0x3c5b33){_0xcd5a3d=_0xcd5a3d-0x0;var _0xd43207=_0xeec6[_0xcd5a3d];return _0xd43207;};'use strict';var multer=require(_0x6eec('0x0'));var util=require('util');var path=require('path');var timeout=require(_0x6eec('0x1'));var express=require(_0x6eec('0x2'));var router=express[_0x6eec('0x3')]();var auth=require(_0x6eec('0x4'));var interaction=require('../../components/interaction/service');var config=require(_0x6eec('0x5'));var controller=require(_0x6eec('0x6'));router['get']('/',auth[_0x6eec('0x7')](),controller[_0x6eec('0x8')]);router['get'](_0x6eec('0x9'),auth[_0x6eec('0x7')](),controller[_0x6eec('0xa')]);router[_0x6eec('0xb')]('/:id/download',auth[_0x6eec('0x7')](),controller[_0x6eec('0xc')]);router[_0x6eec('0xd')]('/:id/clone',auth[_0x6eec('0x7')](),controller['clone']);var upload=multer({'storage':multer[_0x6eec('0xe')]({'destination':function(_0x29b9f4,_0x459eae,_0x4ac329){_0x4ac329(null,path['join'](config['root'],_0x6eec('0xf')));},'filename':function(_0x503277,_0x5917a5,_0x4d5206){_0x4d5206(null,util[_0x6eec('0x10')](_0x6eec('0x11'),Date[_0x6eec('0x12')](),_0x5917a5['originalname'][_0x6eec('0x13')](/[+@&\/\\#,+()$~%'":*?<>{}\s\\|]/g,'-')));}})});router[_0x6eec('0xd')]('/',upload[_0x6eec('0x14')](_0x6eec('0x15')),controller['create']);router['put'](_0x6eec('0x9'),auth[_0x6eec('0x7')](),controller[_0x6eec('0x16')]);router[_0x6eec('0x17')](_0x6eec('0x9'),auth[_0x6eec('0x7')](),controller[_0x6eec('0x18')]);module[_0x6eec('0x19')]=router;
\ No newline at end of file
diff --git a/server/api/authGoogle/authGoogle.controller.js b/server/api/authGoogle/authGoogle.controller.js
index 0dabfeb..cb72b4f 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 _0x80ac=['../../components/auth/service','../../config/utils','authenticate','google','email','callback','clientID','clientSecret','callbackURL','Setting','findOne','allowedLoginAttempts','then','find','map','emails','value','agent','disabled','Incorrect\x20username\x20and/or\x20password.\x20Please\x20retry\x20again\x20or\x20contact\x20the\x20administrator.','blocked','add','clearBlockUser','getLicense','catch','passport','passport-google-oauth20','Strategy','moment','../../mysqldb','../../config/environment'];(function(_0x180cd0,_0x386c6e){var _0x49fc32=function(_0x551c2c){while(--_0x551c2c){_0x180cd0['push'](_0x180cd0['shift']());}};_0x49fc32(++_0x386c6e);}(_0x80ac,0x1ea));var _0xc80a=function(_0x538cac,_0x1d6b39){_0x538cac=_0x538cac-0x0;var _0x4ebc21=_0x80ac[_0x538cac];return _0x4ebc21;};'use strict';var _=require('lodash');var passport=require(_0xc80a('0x0'));var GoogleStrategy=require(_0xc80a('0x1'))[_0xc80a('0x2')];var moment=require(_0xc80a('0x3'));var db=require(_0xc80a('0x4'))['db'];var config=require(_0xc80a('0x5'));var signToken=require(_0xc80a('0x6'))['signToken'];var utils=require(_0xc80a('0x7'));exports['login']=passport[_0xc80a('0x8')](_0xc80a('0x9'),{'failureRedirect':'/login','scope':['profile',_0xc80a('0xa')],'session':![]});exports[_0xc80a('0xb')]=passport[_0xc80a('0x8')](_0xc80a('0x9'),{'failureRedirect':'/login','session':![]});passport['use'](new GoogleStrategy({'clientID':config['google']?config[_0xc80a('0x9')][_0xc80a('0xc')]:'id','clientSecret':config['google']?config[_0xc80a('0x9')][_0xc80a('0xd')]:'secret','callbackURL':config[_0xc80a('0x9')]?config[_0xc80a('0x9')][_0xc80a('0xe')]:''},function(_0x4d265e,_0x51131e,_0xbb830f,_0x6c9a88){var _0x1176c1,_0x414ff6;return db[_0xc80a('0xf')][_0xc80a('0x10')]({'where':{'id':0x1},'attributes':[_0xc80a('0x11'),'blockDuration'],'raw':!![]})[_0xc80a('0x12')](function(_0x5aaeb9){_0x1176c1=_0x5aaeb9;return db['User'][_0xc80a('0x13')]({'where':{'email':_[_0xc80a('0x14')](_0xbb830f[_0xc80a('0x15')],_0xc80a('0x16')),'role':{'$or':['admin','user',_0xc80a('0x17')]}}});})[_0xc80a('0x12')](function(_0x4a255a){_0x414ff6=_0x4a255a;if(_0x414ff6){if(_0x414ff6[_0xc80a('0x18')]){return _0x6c9a88(_0xc80a('0x19'));}else if(_0x1176c1['blockDuration']>0x0){if(_0x414ff6[_0xc80a('0x1a')]){if(moment(_0x414ff6['blockedAt'])[_0xc80a('0x1b')](_0x1176c1['blockDuration'],'minutes')>moment()){return _0x6c9a88(_0xc80a('0x19'));}else{return utils[_0xc80a('0x1c')](_0x414ff6,0x0,![],null)[_0xc80a('0x12')](function(){return utils[_0xc80a('0x1d')](_0x414ff6);})[_0xc80a('0x12')](function(){return _0x6c9a88(null,_0x414ff6);});}}else{return utils[_0xc80a('0x1d')](_0x414ff6)[_0xc80a('0x12')](function(){return _0x6c9a88(null,_0x414ff6);});}}else{return utils[_0xc80a('0x1d')](_0x414ff6)['then'](function(){return _0x6c9a88(null,_0x414ff6);});}}return _0x6c9a88('Incorrect\x20username\x20and/or\x20password.\x20Please\x20retry\x20again\x20or\x20contact\x20the\x20administrator.');})[_0xc80a('0x1e')](function(_0x25f6dc){_0x6c9a88(_0x25f6dc);});}));
\ No newline at end of file
+var _0x5b0c=['email','callback','/login','use','google','clientID','clientSecret','secret','Setting','findOne','allowedLoginAttempts','User','find','emails','value','admin','user','then','disabled','blockDuration','blockedAt','add','minutes','Incorrect\x20username\x20and/or\x20password.\x20Please\x20retry\x20again\x20or\x20contact\x20the\x20administrator.','clearBlockUser','getLicense','catch','lodash','passport','passport-google-oauth20','Strategy','moment','../../config/environment','../../components/auth/service','signToken','../../config/utils','authenticate','profile'];(function(_0x5cfea8,_0x58394b){var _0x5562b7=function(_0x2442f3){while(--_0x2442f3){_0x5cfea8['push'](_0x5cfea8['shift']());}};_0x5562b7(++_0x58394b);}(_0x5b0c,0x171));var _0xc5b0=function(_0x139b63,_0x389ca8){_0x139b63=_0x139b63-0x0;var _0x2493f2=_0x5b0c[_0x139b63];return _0x2493f2;};'use strict';var _=require(_0xc5b0('0x0'));var passport=require(_0xc5b0('0x1'));var GoogleStrategy=require(_0xc5b0('0x2'))[_0xc5b0('0x3')];var moment=require(_0xc5b0('0x4'));var db=require('../../mysqldb')['db'];var config=require(_0xc5b0('0x5'));var signToken=require(_0xc5b0('0x6'))[_0xc5b0('0x7')];var utils=require(_0xc5b0('0x8'));exports['login']=passport[_0xc5b0('0x9')]('google',{'failureRedirect':'/login','scope':[_0xc5b0('0xa'),_0xc5b0('0xb')],'session':![]});exports[_0xc5b0('0xc')]=passport['authenticate']('google',{'failureRedirect':_0xc5b0('0xd'),'session':![]});passport[_0xc5b0('0xe')](new GoogleStrategy({'clientID':config[_0xc5b0('0xf')]?config[_0xc5b0('0xf')][_0xc5b0('0x10')]:'id','clientSecret':config['google']?config[_0xc5b0('0xf')][_0xc5b0('0x11')]:_0xc5b0('0x12'),'callbackURL':config[_0xc5b0('0xf')]?config[_0xc5b0('0xf')]['callbackURL']:''},function(_0x4a0c6e,_0x5ed614,_0x192b78,_0x423598){var _0x2a8fa8,_0x244688;return db[_0xc5b0('0x13')][_0xc5b0('0x14')]({'where':{'id':0x1},'attributes':[_0xc5b0('0x15'),'blockDuration'],'raw':!![]})['then'](function(_0x3351b7){_0x2a8fa8=_0x3351b7;return db[_0xc5b0('0x16')][_0xc5b0('0x17')]({'where':{'email':_['map'](_0x192b78[_0xc5b0('0x18')],_0xc5b0('0x19')),'role':{'$or':[_0xc5b0('0x1a'),_0xc5b0('0x1b'),'agent']}}});})[_0xc5b0('0x1c')](function(_0x9c105c){_0x244688=_0x9c105c;if(_0x244688){if(_0x244688[_0xc5b0('0x1d')]){return _0x423598('Incorrect\x20username\x20and/or\x20password.\x20Please\x20retry\x20again\x20or\x20contact\x20the\x20administrator.');}else if(_0x2a8fa8[_0xc5b0('0x1e')]>0x0){if(_0x244688['blocked']){if(moment(_0x244688[_0xc5b0('0x1f')])[_0xc5b0('0x20')](_0x2a8fa8[_0xc5b0('0x1e')],_0xc5b0('0x21'))>moment()){return _0x423598(_0xc5b0('0x22'));}else{return utils[_0xc5b0('0x23')](_0x244688,0x0,![],null)[_0xc5b0('0x1c')](function(){return utils[_0xc5b0('0x24')](_0x244688);})['then'](function(){return _0x423598(null,_0x244688);});}}else{return utils['getLicense'](_0x244688)[_0xc5b0('0x1c')](function(){return _0x423598(null,_0x244688);});}}else{return utils[_0xc5b0('0x24')](_0x244688)[_0xc5b0('0x1c')](function(){return _0x423598(null,_0x244688);});}}return _0x423598(_0xc5b0('0x22'));})[_0xc5b0('0x25')](function(_0x2d8bec){_0x423598(_0x2d8bec);});}));
\ No newline at end of file
diff --git a/server/api/authGoogle/index.js b/server/api/authGoogle/index.js
index 20f7b5d..66994ad 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 _0x1b73=['setTokenCookie','passport','Router','./authGoogle.controller','../user/user.controller.js','get','/callback','isMiddleware','login'];(function(_0x2a419e,_0x1aef84){var _0x1b6f49=function(_0x500274){while(--_0x500274){_0x2a419e['push'](_0x2a419e['shift']());}};_0x1b6f49(++_0x1aef84);}(_0x1b73,0x1d5));var _0x31b7=function(_0x23bd28,_0x10f589){_0x23bd28=_0x23bd28-0x0;var _0x1569be=_0x1b73[_0x23bd28];return _0x1569be;};'use strict';var express=require('express');var passport=require(_0x31b7('0x0'));var router=express[_0x31b7('0x1')]();var controller=require(_0x31b7('0x2'));var userController=require(_0x31b7('0x3'));var authService=require('../../components/auth/service');router[_0x31b7('0x4')]('/',controller['login']);router[_0x31b7('0x4')](_0x31b7('0x5'),controller['callback'],authService[_0x31b7('0x6')],userController[_0x31b7('0x7')],authService[_0x31b7('0x8')]);module['exports']=router;
\ No newline at end of file
+var _0x68fc=['../../components/auth/service','login','callback','isMiddleware','setTokenCookie','express','passport','Router'];(function(_0x2c6991,_0x4b5775){var _0x4de9fa=function(_0x4ad213){while(--_0x4ad213){_0x2c6991['push'](_0x2c6991['shift']());}};_0x4de9fa(++_0x4b5775);}(_0x68fc,0xa5));var _0xc68f=function(_0x275deb,_0x22c81c){_0x275deb=_0x275deb-0x0;var _0x337e0e=_0x68fc[_0x275deb];return _0x337e0e;};'use strict';var express=require(_0xc68f('0x0'));var passport=require(_0xc68f('0x1'));var router=express[_0xc68f('0x2')]();var controller=require('./authGoogle.controller');var userController=require('../user/user.controller.js');var authService=require(_0xc68f('0x3'));router['get']('/',controller[_0xc68f('0x4')]);router['get']('/callback',controller[_0xc68f('0x5')],authService[_0xc68f('0x6')],userController[_0xc68f('0x4')],authService[_0xc68f('0x7')]);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 3b18360..b53ba3c 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 _0x6688=['headers','/reset/','If\x20you\x20did\x20not\x20request\x20this,\x20please\x20ignore\x20this\x20email\x20and\x20your\x20password\x20will\x20remain\x20unchanged.\x0a','Reset\x20Email\x20sent!','params','token','now','Password\x20reset\x20token\x20is\x20invalid\x20or\x20has\x20expired.','securePassword','status','Password\x20reset!','use','util','passport','passport-local','jayson/promise','lodash','randomstring','moment','../../mysqldb','../../components/auth/service','../../config/utils','http','Setting','findOne','allowedLoginAttempts','blockDuration','password','salt','role','disabled','blocked','admin','user','agent','name','Incorrect\x20username\x20and/or\x20password.\x20Please\x20retry\x20again\x20or\x20contact\x20the\x20administrator.','loginAttempts','blockedAt','add','clearBlockUser','then','minutes','getLicense','catch','MailAccount','find','MailServerOut','Smtp','service','host','port','secure','authentication','auth','pass','format','\x22%s\x22\x20<%s>','email','SendMail','SendMail\x20error:\x20%s.\x20Please\x20contact\x20your\x20Administrator!','error','send','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','authenticate','local','Something\x20went\x20wrong,\x20please\x20try\x20again.','signToken','json','forgot','body','Email\x20parameter\x20is\x20missing','generate','trim','toLowerCase','User','This\x20email\x20is\x20not\x20registered.','The\x20user\x20is\x20blocked.\x20Please\x20contact\x20the\x20administrator.','resetPasswordToken','resetPasswordExpires','save','xCally\x20Motion\x20Password\x20Reset','Please\x20click\x20on\x20the\x20following\x20link,\x20or\x20paste\x20this\x20into\x20your\x20browser\x20to\x20complete\x20the\x20process:\x0a\x0a','http://'];(function(_0x2d876e,_0x1beea5){var _0x2c00c0=function(_0x17ce10){while(--_0x17ce10){_0x2d876e['push'](_0x2d876e['shift']());}};_0x2c00c0(++_0x1beea5);}(_0x6688,0x10e));var _0x8668=function(_0x2f2bf6,_0x17a1eb){_0x2f2bf6=_0x2f2bf6-0x0;var _0x3e08c7=_0x6688[_0x2f2bf6];return _0x3e08c7;};'use strict';var util=require(_0x8668('0x0'));var passport=require(_0x8668('0x1'));var LocalStrategy=require(_0x8668('0x2'))['Strategy'];var jayson=require(_0x8668('0x3'));var _=require(_0x8668('0x4'));var rs=require(_0x8668('0x5'));var moment=require(_0x8668('0x6'));var db=require(_0x8668('0x7'))['db'];var authService=require(_0x8668('0x8'));var utils=require(_0x8668('0x9'));var client=jayson['client'][_0x8668('0xa')]({'port':0x232b});function localAuthenticate(_0x2e1b7b,_0x51c691,_0x1b9518,_0xf3b726){var _0xb4ac50,_0x15e42d;return db[_0x8668('0xb')][_0x8668('0xc')]({'where':{'id':0x1},'attributes':[_0x8668('0xd'),_0x8668('0xe')],'raw':!![]})['then'](function(_0x570b45){_0xb4ac50=_0x570b45;return _0x2e1b7b['findOne']({'attributes':['id','name',_0x8668('0xf'),_0x8668('0x10'),_0x8668('0x11'),_0x8668('0x12'),_0x8668('0x13'),'blockedAt','loginAttempts'],'where':{'name':_0x51c691,'role':{'$or':[_0x8668('0x14'),_0x8668('0x15'),_0x8668('0x16')]}}});})['then'](function(_0x3c8de8){if(!_0x3c8de8||_0x3c8de8&&_0x3c8de8[_0x8668('0x17')]!==_0x51c691){throw new Error(_0x8668('0x18'));}else{_0x15e42d=_0x3c8de8;return _0x15e42d;}})['then'](function(){_0x15e42d['authenticate'](_0x1b9518,function(_0x12c31e,_0x16fe4b){var _0x1095ea=_0x15e42d[_0x8668('0x19')]+0x1;if(_0x12c31e){return _0xf3b726(_0x12c31e);}else if(!_0x16fe4b){if(_0x15e42d['disabled']){return _0xf3b726(null,![],{'message':'Incorrect\x20username\x20and/or\x20password.\x20Please\x20retry\x20again\x20or\x20contact\x20the\x20administrator.'});}else if(_0xb4ac50[_0x8668('0xd')]>0x0){if(_0x15e42d[_0x8668('0x13')]){if(_0xb4ac50[_0x8668('0xe')]>0x0){if(moment(_0x15e42d[_0x8668('0x1a')])[_0x8668('0x1b')](_0xb4ac50[_0x8668('0xe')],'minutes')>moment()){return _0xf3b726(null,![],{'message':_0x8668('0x18')});}else{return utils['clearBlockUser'](_0x15e42d,_0x1095ea,![],null)['then'](function(){return _0xf3b726(null,![],{'message':'Incorrect\x20username\x20and/or\x20password.\x20Please\x20retry\x20again\x20or\x20contact\x20the\x20administrator.'});});}}else{return _0xf3b726(null,![],{'message':'Incorrect\x20username\x20and/or\x20password.\x20Please\x20retry\x20again\x20or\x20contact\x20the\x20administrator.'});}}else{if(_0x1095ea>=_0xb4ac50[_0x8668('0xd')]){return utils[_0x8668('0x1c')](_0x15e42d,0x0,!![],moment())[_0x8668('0x1d')](function(){return _0xf3b726(null,![],{'message':'Incorrect\x20username\x20and/or\x20password.\x20Please\x20retry\x20again\x20or\x20contact\x20the\x20administrator.'});});}else{return utils[_0x8668('0x1c')](_0x15e42d,_0x1095ea,![],null)['then'](function(){return _0xf3b726(null,![],{'message':_0x8668('0x18')});});}}}else{return _0xf3b726(null,![],{'message':_0x8668('0x18')});}}else{if(_0x15e42d[_0x8668('0x12')]){return _0xf3b726(null,![],{'message':'Incorrect\x20username\x20and/or\x20password.\x20Please\x20retry\x20again\x20or\x20contact\x20the\x20administrator.'});}else if(_0xb4ac50[_0x8668('0xd')]>0x0){if(_0x15e42d[_0x8668('0x13')]){if(_0xb4ac50[_0x8668('0xe')]>0x0){if(moment(_0x15e42d['blockedAt'])[_0x8668('0x1b')](_0xb4ac50[_0x8668('0xe')],_0x8668('0x1e'))>moment()){return _0xf3b726(null,![],{'message':_0x8668('0x18')});}else{return utils[_0x8668('0x1c')](_0x15e42d,0x0,![],null)[_0x8668('0x1d')](function(){return utils[_0x8668('0x1f')](_0x15e42d);})[_0x8668('0x1d')](function(){return _0xf3b726(null,_0x15e42d);});}}else{return _0xf3b726(null,![],{'message':'Incorrect\x20username\x20and/or\x20password.\x20Please\x20retry\x20again\x20or\x20contact\x20the\x20administrator.'});}}else{return utils[_0x8668('0x1c')](_0x15e42d,0x0,![],null)[_0x8668('0x1d')](function(){return utils[_0x8668('0x1f')](_0x15e42d);})[_0x8668('0x1d')](function(){return _0xf3b726(null,_0x15e42d);})[_0x8668('0x20')](function(_0x545e07){return _0xf3b726(null,![],_0x545e07);});}}else{if(_0x15e42d[_0x8668('0x13')]){return _0xf3b726(null,![],{'message':_0x8668('0x18')});}else{return utils[_0x8668('0x1f')](_0x15e42d)[_0x8668('0x1d')](function(){return _0xf3b726(null,_0x15e42d);});}}}});})[_0x8668('0x20')](function(_0x5c5c14){return _0xf3b726(null,![],_0x5c5c14);});}function sendServiceMail(_0x51fb3b){return db[_0x8668('0x21')][_0x8668('0x22')]({'where':{'service':!![]},'attributes':['id',_0x8668('0x17'),'email'],'include':[{'model':db[_0x8668('0x23')],'as':_0x8668('0x24')}]})[_0x8668('0x1d')](function(_0x2576bd){if(!_0x2576bd){throw new Error('Unable\x20to\x20find\x20a\x20configured\x20SMTP\x20service!');}var _0x1af385={'tls':{'rejectUnauthorized':![]}};if(_0x2576bd[_0x8668('0x24')][_0x8668('0x25')]){_0x1af385[_0x8668('0x25')]=_0x2576bd['Smtp'][_0x8668('0x25')];}else{_0x1af385[_0x8668('0x26')]=_0x2576bd[_0x8668('0x24')]['host'];_0x1af385[_0x8668('0x27')]=_0x2576bd[_0x8668('0x24')][_0x8668('0x27')];_0x1af385[_0x8668('0x28')]=_0x2576bd['Smtp']['secure'];}if(_0x2576bd[_0x8668('0x24')][_0x8668('0x29')]){_0x1af385[_0x8668('0x2a')]={'user':_0x2576bd[_0x8668('0x24')]['user'],'pass':_0x2576bd[_0x8668('0x24')][_0x8668('0x2b')]};}var _0x1d9546={'account':_0x1af385,'message':_['merge']({'from':util[_0x8668('0x2c')](_0x8668('0x2d'),_0x2576bd[_0x8668('0x17')],_0x2576bd[_0x8668('0x2e')]||_0x2576bd['Smtp'][_0x8668('0x15')])},_0x51fb3b)};return client['request'](_0x8668('0x2f'),_0x1d9546);})[_0x8668('0x1d')](function(_0x5e0ab1){if(_0x5e0ab1['error']){throw new Error(util[_0x8668('0x2c')](_0x8668('0x30'),_0x5e0ab1[_0x8668('0x31')]['message']||JSON['stringify'](_0x5e0ab1[_0x8668('0x31')])));}return!![];});}function handleError(_0x48c14d,_0x2e2c19,_0x38b46e){return _0x48c14d['status'](_0x2e2c19||0x1f4)[_0x8668('0x32')]({'message':_0x38b46e?_0x38b46e['message']||_0x38b46e:''});}function checkPasswordPattern(_0x555747,_0x2b0f31,_0x5dae81){if(_0x5dae81){var _0x3eb689=new RegExp(/(?=.*[a-z])(?=.*[A-Z])(?=.*[0-9])(?=.*[?!@#\$%\^&\*~\-_=+[{\]\}])(?=.{8,})/);if(_0x3eb689[_0x8668('0x33')](_0x2b0f31)){return _0x555747;}else{throw new Error(_0x8668('0x34'));}}else{return _0x555747;}}exports[_0x8668('0x35')]=function(_0x16683d,_0x9b9fe1,_0x5c0f06){passport[_0x8668('0x36')](_0x8668('0x37'),function(_0x1ab02c,_0x116d3e,_0xa26617){var _0x35953e=_0x1ab02c||_0xa26617;if(_0x35953e){return handleError(_0x9b9fe1,0x191,_0x35953e);}if(!_0x116d3e){return handleError(_0x9b9fe1,0x194,{'message':_0x8668('0x38')});}else{var _0x5dc21e={'payload':{'id':_0x116d3e['id'],'role':_0x116d3e['role']},'options':{'expiresIn':0x15180}};return authService[_0x8668('0x39')](_0x5dc21e)[_0x8668('0x1d')](function(_0x5c3c48){_0x9b9fe1[_0x8668('0x3a')]({'id':_0x116d3e['id'],'token':_0x5c3c48,'statusCall':'','isAlreadyLogged':_0x116d3e['online']});});}})(_0x16683d,_0x9b9fe1,_0x5c0f06);};exports[_0x8668('0x3b')]=function(_0x3fc201,_0x21e401,_0x49bb36){if(!_0x3fc201[_0x8668('0x3c')][_0x8668('0x2e')]){return handleError(_0x21e401,0x1f4,{'message':_0x8668('0x3d')});}var _0x557f3e=rs[_0x8668('0x3e')]();_0x3fc201[_0x8668('0x3c')]['email']=_0x3fc201[_0x8668('0x3c')][_0x8668('0x2e')][_0x8668('0x3f')]()[_0x8668('0x40')]();var _0x58d4b3;return db[_0x8668('0xb')][_0x8668('0xc')]({'where':{'id':0x1},'attributes':[_0x8668('0xd'),_0x8668('0xe')],'raw':!![]})[_0x8668('0x1d')](function(_0x2a44bc){_0x58d4b3=_0x2a44bc;return db[_0x8668('0x41')][_0x8668('0x22')]({'where':{'email':_0x3fc201['body'][_0x8668('0x2e')]}});})[_0x8668('0x1d')](function(_0x4db94b){if(!_0x4db94b){throw new Error(_0x8668('0x42'));}if(_0x4db94b[_0x8668('0x12')]){throw new Error('The\x20user\x20is\x20disabled.\x20Please\x20contact\x20the\x20administrator.');}if(_0x4db94b[_0x8668('0x13')]){if(moment(_0x4db94b['blockedAt'])['add'](_0x58d4b3[_0x8668('0xe')],'minutes')>moment()){throw new Error(_0x8668('0x43'));}else{_0x4db94b['blocked']=![];_0x4db94b['blockedAt']=null;}}_0x4db94b[_0x8668('0x44')]=_0x557f3e;_0x4db94b[_0x8668('0x45')]=Date['now']()+0x36ee80;return _0x4db94b[_0x8668('0x46')]();})[_0x8668('0x1d')](function(){return sendServiceMail({'to':_0x3fc201['body'][_0x8668('0x2e')],'subject':_0x8668('0x47'),'text':'You\x20are\x20receiving\x20this\x20because\x20you\x20(or\x20someone\x20else)\x20have\x20requested\x20the\x20reset\x20of\x20the\x20password\x20for\x20your\x20account.\x0a\x0a'+_0x8668('0x48')+_0x8668('0x49')+_0x3fc201[_0x8668('0x4a')][_0x8668('0x26')]+_0x8668('0x4b')+_0x557f3e+'\x0a\x0a'+_0x8668('0x4c')});})[_0x8668('0x1d')](function(){_0x21e401['status'](0xc8)['send']({'message':_0x8668('0x4d')});})[_0x8668('0x20')](function(_0x1b61cf){return handleError(_0x21e401,0x1f4,_0x1b61cf);});};exports['reset']=function(_0x17d979,_0x1b175a,_0x2a6b18){var _0x2ae5c4;return db[_0x8668('0x41')][_0x8668('0x22')]({'where':{'resetPasswordToken':_0x17d979[_0x8668('0x4e')][_0x8668('0x4f')],'resetPasswordExpires':{'$gt':Date[_0x8668('0x50')]()}}})['then'](function(_0x544b37){_0x2ae5c4=_0x544b37;if(!_0x2ae5c4){throw new Error(_0x8668('0x51'));}return db[_0x8668('0xb')][_0x8668('0xc')]({'attributes':['id','securePassword']});})[_0x8668('0x1d')](function(_0xe58779){return checkPasswordPattern(_0xe58779,_0x17d979[_0x8668('0x3c')][_0x8668('0xf')],_0xe58779[_0x8668('0x52')]);})[_0x8668('0x1d')](function(){_0x2ae5c4[_0x8668('0xf')]=_0x17d979[_0x8668('0x3c')]['password'];_0x2ae5c4[_0x8668('0x44')]=null;_0x2ae5c4[_0x8668('0x45')]=null;return _0x2ae5c4['save']();})[_0x8668('0x1d')](function(){_0x1b175a[_0x8668('0x53')](0xc8)[_0x8668('0x32')]({'message':_0x8668('0x54')});})['catch'](function(_0x419af0){return handleError(_0x1b175a,0x1f4,_0x419af0);});};passport[_0x8668('0x55')](new LocalStrategy({'usernameField':_0x8668('0x17'),'passwordField':_0x8668('0xf')},function(_0x8bb1f3,_0x11b416,_0x1b19a6){return localAuthenticate(db['User'],_0x8bb1f3,_0x11b416,_0x1b19a6);}));
\ No newline at end of file
+var _0xadc5=['authenticate','local','signToken','json','forgot','Email\x20parameter\x20is\x20missing','generate','body','trim','toLowerCase','User','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','Please\x20click\x20on\x20the\x20following\x20link,\x20or\x20paste\x20this\x20into\x20your\x20browser\x20to\x20complete\x20the\x20process:\x0a\x0a','/reset/','If\x20you\x20did\x20not\x20request\x20this,\x20please\x20ignore\x20this\x20email\x20and\x20your\x20password\x20will\x20remain\x20unchanged.\x0a','send','Reset\x20Email\x20sent!','params','Password\x20reset\x20token\x20is\x20invalid\x20or\x20has\x20expired.','securePassword','Password\x20reset!','use','passport-local','Strategy','jayson/promise','lodash','../../mysqldb','../../components/auth/service','../../config/utils','client','http','Setting','findOne','allowedLoginAttempts','blockDuration','then','name','password','salt','role','disabled','blocked','blockedAt','admin','user','agent','Incorrect\x20username\x20and/or\x20password.\x20Please\x20retry\x20again\x20or\x20contact\x20the\x20administrator.','loginAttempts','minutes','clearBlockUser','add','getLicense','catch','find','email','MailServerOut','Unable\x20to\x20find\x20a\x20configured\x20SMTP\x20service!','Smtp','service','host','port','secure','authentication','auth','pass','merge','request','SendMail','format','error','message','status','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'];(function(_0x3dd15e,_0x1f0015){var _0x231fd0=function(_0x4f680a){while(--_0x4f680a){_0x3dd15e['push'](_0x3dd15e['shift']());}};_0x231fd0(++_0x1f0015);}(_0xadc5,0x1bd));var _0x5adc=function(_0x37bed0,_0x41bf2f){_0x37bed0=_0x37bed0-0x0;var _0x3a9199=_0xadc5[_0x37bed0];return _0x3a9199;};'use strict';var util=require('util');var passport=require('passport');var LocalStrategy=require(_0x5adc('0x0'))[_0x5adc('0x1')];var jayson=require(_0x5adc('0x2'));var _=require(_0x5adc('0x3'));var rs=require('randomstring');var moment=require('moment');var db=require(_0x5adc('0x4'))['db'];var authService=require(_0x5adc('0x5'));var utils=require(_0x5adc('0x6'));var client=jayson[_0x5adc('0x7')][_0x5adc('0x8')]({'port':0x232b});function localAuthenticate(_0x2deac9,_0x2d8bf0,_0x44182d,_0x467654){var _0xc27950,_0x19b10e;return db[_0x5adc('0x9')][_0x5adc('0xa')]({'where':{'id':0x1},'attributes':[_0x5adc('0xb'),_0x5adc('0xc')],'raw':!![]})[_0x5adc('0xd')](function(_0x166703){_0xc27950=_0x166703;return _0x2deac9[_0x5adc('0xa')]({'attributes':['id',_0x5adc('0xe'),_0x5adc('0xf'),_0x5adc('0x10'),_0x5adc('0x11'),_0x5adc('0x12'),_0x5adc('0x13'),_0x5adc('0x14'),'loginAttempts'],'where':{'name':_0x2d8bf0,'role':{'$or':[_0x5adc('0x15'),_0x5adc('0x16'),_0x5adc('0x17')]}}});})[_0x5adc('0xd')](function(_0x40514f){if(!_0x40514f||_0x40514f&&_0x40514f['name']!==_0x2d8bf0){throw new Error(_0x5adc('0x18'));}else{_0x19b10e=_0x40514f;return _0x19b10e;}})[_0x5adc('0xd')](function(){_0x19b10e['authenticate'](_0x44182d,function(_0x4617d3,_0x440e5e){var _0x14d277=_0x19b10e[_0x5adc('0x19')]+0x1;if(_0x4617d3){return _0x467654(_0x4617d3);}else if(!_0x440e5e){if(_0x19b10e[_0x5adc('0x12')]){return _0x467654(null,![],{'message':_0x5adc('0x18')});}else if(_0xc27950[_0x5adc('0xb')]>0x0){if(_0x19b10e[_0x5adc('0x13')]){if(_0xc27950[_0x5adc('0xc')]>0x0){if(moment(_0x19b10e[_0x5adc('0x14')])['add'](_0xc27950[_0x5adc('0xc')],_0x5adc('0x1a'))>moment()){return _0x467654(null,![],{'message':'Incorrect\x20username\x20and/or\x20password.\x20Please\x20retry\x20again\x20or\x20contact\x20the\x20administrator.'});}else{return utils[_0x5adc('0x1b')](_0x19b10e,_0x14d277,![],null)[_0x5adc('0xd')](function(){return _0x467654(null,![],{'message':_0x5adc('0x18')});});}}else{return _0x467654(null,![],{'message':_0x5adc('0x18')});}}else{if(_0x14d277>=_0xc27950[_0x5adc('0xb')]){return utils['clearBlockUser'](_0x19b10e,0x0,!![],moment())[_0x5adc('0xd')](function(){return _0x467654(null,![],{'message':_0x5adc('0x18')});});}else{return utils['clearBlockUser'](_0x19b10e,_0x14d277,![],null)['then'](function(){return _0x467654(null,![],{'message':_0x5adc('0x18')});});}}}else{return _0x467654(null,![],{'message':_0x5adc('0x18')});}}else{if(_0x19b10e[_0x5adc('0x12')]){return _0x467654(null,![],{'message':_0x5adc('0x18')});}else if(_0xc27950[_0x5adc('0xb')]>0x0){if(_0x19b10e[_0x5adc('0x13')]){if(_0xc27950['blockDuration']>0x0){if(moment(_0x19b10e['blockedAt'])[_0x5adc('0x1c')](_0xc27950[_0x5adc('0xc')],'minutes')>moment()){return _0x467654(null,![],{'message':_0x5adc('0x18')});}else{return utils[_0x5adc('0x1b')](_0x19b10e,0x0,![],null)[_0x5adc('0xd')](function(){return utils['getLicense'](_0x19b10e);})[_0x5adc('0xd')](function(){return _0x467654(null,_0x19b10e);});}}else{return _0x467654(null,![],{'message':'Incorrect\x20username\x20and/or\x20password.\x20Please\x20retry\x20again\x20or\x20contact\x20the\x20administrator.'});}}else{return utils[_0x5adc('0x1b')](_0x19b10e,0x0,![],null)[_0x5adc('0xd')](function(){return utils[_0x5adc('0x1d')](_0x19b10e);})[_0x5adc('0xd')](function(){return _0x467654(null,_0x19b10e);})[_0x5adc('0x1e')](function(_0x13cbbb){return _0x467654(null,![],_0x13cbbb);});}}else{if(_0x19b10e[_0x5adc('0x13')]){return _0x467654(null,![],{'message':_0x5adc('0x18')});}else{return utils[_0x5adc('0x1d')](_0x19b10e)[_0x5adc('0xd')](function(){return _0x467654(null,_0x19b10e);});}}}});})[_0x5adc('0x1e')](function(_0x56d1c1){return _0x467654(null,![],_0x56d1c1);});}function sendServiceMail(_0x3dfa15){return db['MailAccount'][_0x5adc('0x1f')]({'where':{'service':!![]},'attributes':['id','name',_0x5adc('0x20')],'include':[{'model':db[_0x5adc('0x21')],'as':'Smtp'}]})[_0x5adc('0xd')](function(_0x4c543e){if(!_0x4c543e){throw new Error(_0x5adc('0x22'));}var _0x2b5139={'tls':{'rejectUnauthorized':![]}};if(_0x4c543e[_0x5adc('0x23')]['service']){_0x2b5139[_0x5adc('0x24')]=_0x4c543e[_0x5adc('0x23')][_0x5adc('0x24')];}else{_0x2b5139[_0x5adc('0x25')]=_0x4c543e['Smtp'][_0x5adc('0x25')];_0x2b5139[_0x5adc('0x26')]=_0x4c543e['Smtp']['port'];_0x2b5139[_0x5adc('0x27')]=_0x4c543e[_0x5adc('0x23')][_0x5adc('0x27')];}if(_0x4c543e['Smtp'][_0x5adc('0x28')]){_0x2b5139[_0x5adc('0x29')]={'user':_0x4c543e[_0x5adc('0x23')][_0x5adc('0x16')],'pass':_0x4c543e['Smtp'][_0x5adc('0x2a')]};}var _0x1390d0={'account':_0x2b5139,'message':_[_0x5adc('0x2b')]({'from':util['format']('\x22%s\x22\x20<%s>',_0x4c543e[_0x5adc('0xe')],_0x4c543e['email']||_0x4c543e[_0x5adc('0x23')][_0x5adc('0x16')])},_0x3dfa15)};return client[_0x5adc('0x2c')](_0x5adc('0x2d'),_0x1390d0);})['then'](function(_0x375040){if(_0x375040['error']){throw new Error(util[_0x5adc('0x2e')]('SendMail\x20error:\x20%s.\x20Please\x20contact\x20your\x20Administrator!',_0x375040[_0x5adc('0x2f')][_0x5adc('0x30')]||JSON['stringify'](_0x375040[_0x5adc('0x2f')])));}return!![];});}function handleError(_0x101829,_0x20e066,_0x3430de){return _0x101829[_0x5adc('0x31')](_0x20e066||0x1f4)['send']({'message':_0x3430de?_0x3430de[_0x5adc('0x30')]||_0x3430de:''});}function checkPasswordPattern(_0x4b1dd4,_0x14860b,_0x204682){if(_0x204682){var _0x30f1c3=new RegExp(/(?=.*[a-z])(?=.*[A-Z])(?=.*[0-9])(?=.*[?!@#\$%\^&\*~\-_=+[{\]\}])(?=.{8,})/);if(_0x30f1c3[_0x5adc('0x32')](_0x14860b)){return _0x4b1dd4;}else{throw new Error(_0x5adc('0x33'));}}else{return _0x4b1dd4;}}exports[_0x5adc('0x34')]=function(_0x240c1c,_0x608213,_0x35e4d2){passport[_0x5adc('0x35')](_0x5adc('0x36'),function(_0x18761d,_0x2ee237,_0xfabbf1){var _0x1529cb=_0x18761d||_0xfabbf1;if(_0x1529cb){return handleError(_0x608213,0x191,_0x1529cb);}if(!_0x2ee237){return handleError(_0x608213,0x194,{'message':'Something\x20went\x20wrong,\x20please\x20try\x20again.'});}else{var _0xeab923={'payload':{'id':_0x2ee237['id'],'role':_0x2ee237[_0x5adc('0x11')]},'options':{'expiresIn':0x15180}};return authService[_0x5adc('0x37')](_0xeab923)[_0x5adc('0xd')](function(_0x1a3fd2){_0x608213[_0x5adc('0x38')]({'id':_0x2ee237['id'],'token':_0x1a3fd2,'statusCall':'','isAlreadyLogged':_0x2ee237['online']});});}})(_0x240c1c,_0x608213,_0x35e4d2);};exports[_0x5adc('0x39')]=function(_0x16ddc4,_0x626e64,_0x4a9d82){if(!_0x16ddc4['body'][_0x5adc('0x20')]){return handleError(_0x626e64,0x1f4,{'message':_0x5adc('0x3a')});}var _0xea606e=rs[_0x5adc('0x3b')]();_0x16ddc4['body'][_0x5adc('0x20')]=_0x16ddc4[_0x5adc('0x3c')]['email'][_0x5adc('0x3d')]()[_0x5adc('0x3e')]();var _0x54b5b0;return db[_0x5adc('0x9')][_0x5adc('0xa')]({'where':{'id':0x1},'attributes':[_0x5adc('0xb'),_0x5adc('0xc')],'raw':!![]})[_0x5adc('0xd')](function(_0x5e3e24){_0x54b5b0=_0x5e3e24;return db[_0x5adc('0x3f')][_0x5adc('0x1f')]({'where':{'email':_0x16ddc4[_0x5adc('0x3c')]['email']}});})[_0x5adc('0xd')](function(_0x5a07ae){if(!_0x5a07ae){throw new Error(_0x5adc('0x40'));}if(_0x5a07ae['disabled']){throw new Error(_0x5adc('0x41'));}if(_0x5a07ae[_0x5adc('0x13')]){if(moment(_0x5a07ae[_0x5adc('0x14')])[_0x5adc('0x1c')](_0x54b5b0[_0x5adc('0xc')],_0x5adc('0x1a'))>moment()){throw new Error(_0x5adc('0x42'));}else{_0x5a07ae[_0x5adc('0x13')]=![];_0x5a07ae[_0x5adc('0x14')]=null;}}_0x5a07ae[_0x5adc('0x43')]=_0xea606e;_0x5a07ae[_0x5adc('0x44')]=Date[_0x5adc('0x45')]()+0x36ee80;return _0x5a07ae[_0x5adc('0x46')]();})['then'](function(){return sendServiceMail({'to':_0x16ddc4['body'][_0x5adc('0x20')],'subject':_0x5adc('0x47'),'text':_0x5adc('0x48')+_0x5adc('0x49')+'http://'+_0x16ddc4['headers'][_0x5adc('0x25')]+_0x5adc('0x4a')+_0xea606e+'\x0a\x0a'+_0x5adc('0x4b')});})[_0x5adc('0xd')](function(){_0x626e64[_0x5adc('0x31')](0xc8)[_0x5adc('0x4c')]({'message':_0x5adc('0x4d')});})[_0x5adc('0x1e')](function(_0x19807a){return handleError(_0x626e64,0x1f4,_0x19807a);});};exports['reset']=function(_0x50390f,_0x2e958e,_0x1e1bc6){var _0x344c23;return db['User'][_0x5adc('0x1f')]({'where':{'resetPasswordToken':_0x50390f[_0x5adc('0x4e')]['token'],'resetPasswordExpires':{'$gt':Date[_0x5adc('0x45')]()}}})[_0x5adc('0xd')](function(_0x9fb77e){_0x344c23=_0x9fb77e;if(!_0x344c23){throw new Error(_0x5adc('0x4f'));}return db[_0x5adc('0x9')][_0x5adc('0xa')]({'attributes':['id',_0x5adc('0x50')]});})[_0x5adc('0xd')](function(_0x205edc){return checkPasswordPattern(_0x205edc,_0x50390f[_0x5adc('0x3c')][_0x5adc('0xf')],_0x205edc['securePassword']);})[_0x5adc('0xd')](function(){_0x344c23[_0x5adc('0xf')]=_0x50390f[_0x5adc('0x3c')][_0x5adc('0xf')];_0x344c23[_0x5adc('0x43')]=null;_0x344c23[_0x5adc('0x44')]=null;return _0x344c23[_0x5adc('0x46')]();})[_0x5adc('0xd')](function(){_0x2e958e[_0x5adc('0x31')](0xc8)[_0x5adc('0x4c')]({'message':_0x5adc('0x51')});})[_0x5adc('0x1e')](function(_0x412635){return handleError(_0x2e958e,0x1f4,_0x412635);});};passport[_0x5adc('0x52')](new LocalStrategy({'usernameField':_0x5adc('0xe'),'passwordField':_0x5adc('0xf')},function(_0x57d443,_0x1f918e,_0x5b54e4){return localAuthenticate(db[_0x5adc('0x3f')],_0x57d443,_0x1f918e,_0x5b54e4);}));
\ No newline at end of file
diff --git a/server/api/authLocal/index.js b/server/api/authLocal/index.js
index 8ebf465..b6997ca 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 _0x2c42=['post','forgot','/reset/:token','reset','exports','express','Router'];(function(_0x15dcc9,_0x9bd94c){var _0xa56333=function(_0x7d99b1){while(--_0x7d99b1){_0x15dcc9['push'](_0x15dcc9['shift']());}};_0xa56333(++_0x9bd94c);}(_0x2c42,0x139));var _0x22c4=function(_0x3dea84,_0x24c5bc){_0x3dea84=_0x3dea84-0x0;var _0x9776cc=_0x2c42[_0x3dea84];return _0x9776cc;};'use strict';var express=require(_0x22c4('0x0'));var router=express[_0x22c4('0x1')]();var controller=require('./authLocal.controller');router[_0x22c4('0x2')]('/',controller['login']);router[_0x22c4('0x2')]('/forgot',controller[_0x22c4('0x3')]);router[_0x22c4('0x2')](_0x22c4('0x4'),controller[_0x22c4('0x5')]);module[_0x22c4('0x6')]=router;
\ No newline at end of file
+var _0x0fd6=['express','Router','./authLocal.controller','post','login','/forgot','reset','exports'];(function(_0x2f02af,_0x5c6fee){var _0x38c95c=function(_0x3322c7){while(--_0x3322c7){_0x2f02af['push'](_0x2f02af['shift']());}};_0x38c95c(++_0x5c6fee);}(_0x0fd6,0x178));var _0x60fd=function(_0x274b9a,_0x2822c8){_0x274b9a=_0x274b9a-0x0;var _0x2403ba=_0x0fd6[_0x274b9a];return _0x2403ba;};'use strict';var express=require(_0x60fd('0x0'));var router=express[_0x60fd('0x1')]();var controller=require(_0x60fd('0x2'));router[_0x60fd('0x3')]('/',controller[_0x60fd('0x4')]);router[_0x60fd('0x3')](_0x60fd('0x5'),controller['forgot']);router[_0x60fd('0x3')]('/reset/:token',controller[_0x60fd('0x6')]);module[_0x60fd('0x7')]=router;
\ No newline at end of file
diff --git a/server/api/automation/automation.attributes.js b/server/api/automation/automation.attributes.js
index 2782f56..70f2189 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 _0xf887=['INTEGER','sequelize','STRING'];(function(_0x43b43c,_0xf46a13){var _0x153b48=function(_0xd41753){while(--_0xd41753){_0x43b43c['push'](_0x43b43c['shift']());}};_0x153b48(++_0xf46a13);}(_0xf887,0x151));var _0x7f88=function(_0x253d9a,_0x1634fe){_0x253d9a=_0x253d9a-0x0;var _0x41bcf1=_0xf887[_0x253d9a];return _0x41bcf1;};'use strict';var Sequelize=require(_0x7f88('0x0'));module['exports']={'name':{'type':Sequelize[_0x7f88('0x1')],'allowNull':![]},'channel':{'type':Sequelize[_0x7f88('0x1')]},'description':{'type':Sequelize['STRING']},'status':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'timeout':{'type':Sequelize[_0x7f88('0x2')],'defaultValue':0xa}};
\ No newline at end of file
+var _0x465b=['sequelize','exports','STRING','INTEGER'];(function(_0x44cc43,_0x4116b9){var _0x15bd91=function(_0xfc52d8){while(--_0xfc52d8){_0x44cc43['push'](_0x44cc43['shift']());}};_0x15bd91(++_0x4116b9);}(_0x465b,0x1e0));var _0xb465=function(_0x582b0b,_0x163bcb){_0x582b0b=_0x582b0b-0x0;var _0x51d39c=_0x465b[_0x582b0b];return _0x51d39c;};'use strict';var Sequelize=require(_0xb465('0x0'));module[_0xb465('0x1')]={'name':{'type':Sequelize[_0xb465('0x2')],'allowNull':![]},'channel':{'type':Sequelize[_0xb465('0x2')]},'description':{'type':Sequelize['STRING']},'status':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'timeout':{'type':Sequelize[_0xb465('0x3')],'defaultValue':0xa}};
\ No newline at end of file
diff --git a/server/api/automation/automation.controller.js b/server/api/automation/automation.controller.js
index 1a1c060..b2582d9 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 _0xf069=['include','Automation','findAll','rows','catch','show','params','create','update','body','destroy','find','addConditions','ids','omit','getConditions','findOne','Condition','addActions','getActions','Action','filter','nolimit','html-pdf','eml-format','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','api','../../config/utils','../../config/environment','../../mysqldb','sendStatus','status','json','count','offset','limit','set','Content-Range','apply','reject','save','then','end','stack','name','send','index','map','rawAttributes','type','key','query','keys','filters','intersection','model','attributes','fields','length','hasOwnProperty','order','sort','pick','where','VIRTUAL','merge','options','includeAll'];(function(_0x569c87,_0xb14ee6){var _0x3e7c52=function(_0x3436a0){while(--_0x3436a0){_0x569c87['push'](_0x569c87['shift']());}};_0x3e7c52(++_0xb14ee6);}(_0xf069,0x119));var _0x9f06=function(_0x14add3,_0x13ce8d){_0x14add3=_0x14add3-0x0;var _0x4a174f=_0xf069[_0x14add3];return _0x4a174f;};'use strict';var pdf=require(_0x9f06('0x0'));var emlformat=require(_0x9f06('0x1'));var rimraf=require('rimraf');var zipdir=require(_0x9f06('0x2'));var jsonpatch=require(_0x9f06('0x3'));var rp=require(_0x9f06('0x4'));var moment=require(_0x9f06('0x5'));var BPromise=require(_0x9f06('0x6'));var Mustache=require(_0x9f06('0x7'));var util=require(_0x9f06('0x8'));var path=require(_0x9f06('0x9'));var sox=require(_0x9f06('0xa'));var csv=require(_0x9f06('0xb'));var ejs=require(_0x9f06('0xc'));var fs=require('fs');var _=require(_0x9f06('0xd'));var squel=require(_0x9f06('0xe'));var crypto=require('crypto');var jsforce=require(_0x9f06('0xf'));var deskjs=require('desk.js');var toCsv=require('to-csv');var querystring=require('querystring');var Papa=require(_0x9f06('0x10'));var Redis=require(_0x9f06('0x11'));var authService=require(_0x9f06('0x12'));var qs=require(_0x9f06('0x13'));var as=require(_0x9f06('0x14'));var hardwareService=require('../../config/license/hardware');var logger=require('../../config/logger')(_0x9f06('0x15'));var utils=require(_0x9f06('0x16'));var config=require(_0x9f06('0x17'));var db=require(_0x9f06('0x18'))['db'];function respondWithStatusCode(_0x3da02a,_0x5a58d1){_0x5a58d1=_0x5a58d1||0xcc;return function(_0x1984a4){if(_0x1984a4){return _0x3da02a[_0x9f06('0x19')](_0x5a58d1);}return _0x3da02a['status'](_0x5a58d1)['end']();};}function respondWithResult(_0x29e596,_0x4078e2){_0x4078e2=_0x4078e2||0xc8;return function(_0x1c49ed){if(_0x1c49ed){return _0x29e596[_0x9f06('0x1a')](_0x4078e2)[_0x9f06('0x1b')](_0x1c49ed);}};}function respondWithFilteredResult(_0x280b6f,_0x414b8b){return function(_0x3fb4e4){if(_0x3fb4e4){var _0x1eb30e=_0x3fb4e4[_0x9f06('0x1c')],_0x510e99=_0x414b8b[_0x9f06('0x1d')],_0x5bf22b=_0x414b8b['offset']+_0x414b8b[_0x9f06('0x1e')],_0x391873;if(_0x5bf22b>=_0x1eb30e){_0x5bf22b=_0x1eb30e;_0x391873=0xc8;}else{_0x391873=0xce;}_0x280b6f[_0x9f06('0x1a')](_0x391873);return _0x280b6f[_0x9f06('0x1f')](_0x9f06('0x20'),_0x510e99+'-'+_0x5bf22b+'/'+_0x1eb30e)[_0x9f06('0x1b')](_0x3fb4e4);}return null;};}function patchUpdates(_0x21713b){return function(_0x959d7b){try{jsonpatch[_0x9f06('0x21')](_0x959d7b,_0x21713b,!![]);}catch(_0x3b4129){return BPromise[_0x9f06('0x22')](_0x3b4129);}return _0x959d7b[_0x9f06('0x23')]();};}function saveUpdates(_0xb9bd5e,_0x41bca1){return function(_0x256357){if(_0x256357){return _0x256357['update'](_0xb9bd5e)[_0x9f06('0x24')](function(_0x44f6c4){return _0x44f6c4;});}return null;};}function removeEntity(_0x4753c8,_0x107e05){return function(_0x5ec8af){if(_0x5ec8af){return _0x5ec8af['destroy']()[_0x9f06('0x24')](function(){_0x4753c8['status'](0xcc)[_0x9f06('0x25')]();});}};}function handleEntityNotFound(_0xbebeba,_0x36bcaf){return function(_0x47ac4d){if(!_0x47ac4d){_0xbebeba['sendStatus'](0x194);}return _0x47ac4d;};}function handleError(_0x9cbdbd,_0x8f727){_0x8f727=_0x8f727||0x1f4;return function(_0x34837a){logger['error'](_0x34837a[_0x9f06('0x26')]);if(_0x34837a[_0x9f06('0x27')]){delete _0x34837a[_0x9f06('0x27')];}_0x9cbdbd[_0x9f06('0x1a')](_0x8f727)[_0x9f06('0x28')](_0x34837a);};}exports[_0x9f06('0x29')]=function(_0x25b13d,_0x40ec2e){var _0x59cb0e={},_0x410259={},_0x3652c7={'count':0x0,'rows':[]};var _0x1b200d=_[_0x9f06('0x2a')](db['Automation'][_0x9f06('0x2b')],function(_0x22911f){return{'name':_0x22911f['fieldName'],'type':_0x22911f[_0x9f06('0x2c')][_0x9f06('0x2d')]};});_0x410259['model']=_[_0x9f06('0x2a')](_0x1b200d,_0x9f06('0x27'));_0x410259[_0x9f06('0x2e')]=_[_0x9f06('0x2f')](_0x25b13d[_0x9f06('0x2e')]);_0x410259[_0x9f06('0x30')]=_[_0x9f06('0x31')](_0x410259[_0x9f06('0x32')],_0x410259[_0x9f06('0x2e')]);_0x59cb0e[_0x9f06('0x33')]=_[_0x9f06('0x31')](_0x410259[_0x9f06('0x32')],qs[_0x9f06('0x34')](_0x25b13d[_0x9f06('0x2e')][_0x9f06('0x34')]));_0x59cb0e[_0x9f06('0x33')]=_0x59cb0e['attributes'][_0x9f06('0x35')]?_0x59cb0e['attributes']:_0x410259[_0x9f06('0x32')];if(!_0x25b13d[_0x9f06('0x2e')][_0x9f06('0x36')]('nolimit')){_0x59cb0e[_0x9f06('0x1e')]=qs['limit'](_0x25b13d[_0x9f06('0x2e')][_0x9f06('0x1e')]);_0x59cb0e[_0x9f06('0x1d')]=qs[_0x9f06('0x1d')](_0x25b13d['query'][_0x9f06('0x1d')]);}_0x59cb0e[_0x9f06('0x37')]=qs[_0x9f06('0x38')](_0x25b13d[_0x9f06('0x2e')]['sort']);_0x59cb0e['where']=qs[_0x9f06('0x30')](_[_0x9f06('0x39')](_0x25b13d[_0x9f06('0x2e')],_0x410259[_0x9f06('0x30')]));if(_0x25b13d[_0x9f06('0x2e')]['filter']){_0x59cb0e['where']=_['merge'](_0x59cb0e[_0x9f06('0x3a')],{'$or':_[_0x9f06('0x2a')](_0x1b200d,function(_0xa30e2b){if(_0xa30e2b[_0x9f06('0x2c')]!==_0x9f06('0x3b')){var _0x2234f9={};_0x2234f9[_0xa30e2b['name']]={'$like':'%'+_0x25b13d[_0x9f06('0x2e')]['filter']+'%'};return _0x2234f9;}})});}_0x59cb0e=_[_0x9f06('0x3c')]({},_0x59cb0e,_0x25b13d[_0x9f06('0x3d')]);var _0x302d38={'where':_0x59cb0e[_0x9f06('0x3a')]};return db['Automation']['count'](_0x302d38)[_0x9f06('0x24')](function(_0x50e093){_0x3652c7['count']=_0x50e093;if(_0x25b13d['query'][_0x9f06('0x3e')]){_0x59cb0e[_0x9f06('0x3f')]=[{'all':!![]}];}return db[_0x9f06('0x40')][_0x9f06('0x41')](_0x59cb0e);})[_0x9f06('0x24')](function(_0x139796){_0x3652c7[_0x9f06('0x42')]=_0x139796;return _0x3652c7;})[_0x9f06('0x24')](respondWithFilteredResult(_0x40ec2e,_0x59cb0e))[_0x9f06('0x43')](handleError(_0x40ec2e,null));};exports[_0x9f06('0x44')]=function(_0x31e51e,_0x377c17){var _0x3cc0fb={'raw':![],'where':{'id':_0x31e51e[_0x9f06('0x45')]['id']}},_0x4df775={};_0x4df775[_0x9f06('0x32')]=_[_0x9f06('0x2f')](db['Automation'][_0x9f06('0x2b')]);_0x4df775[_0x9f06('0x2e')]=_[_0x9f06('0x2f')](_0x31e51e[_0x9f06('0x2e')]);_0x4df775[_0x9f06('0x30')]=_['intersection'](_0x4df775[_0x9f06('0x32')],_0x4df775[_0x9f06('0x2e')]);_0x3cc0fb[_0x9f06('0x33')]=_['intersection'](_0x4df775[_0x9f06('0x32')],qs[_0x9f06('0x34')](_0x31e51e[_0x9f06('0x2e')]['fields']));_0x3cc0fb['attributes']=_0x3cc0fb[_0x9f06('0x33')][_0x9f06('0x35')]?_0x3cc0fb[_0x9f06('0x33')]:_0x4df775[_0x9f06('0x32')];if(_0x31e51e['query']['includeAll']){_0x3cc0fb[_0x9f06('0x3f')]=[{'all':!![]}];}_0x3cc0fb=_[_0x9f06('0x3c')]({},_0x3cc0fb,_0x31e51e[_0x9f06('0x3d')]);return db[_0x9f06('0x40')]['find'](_0x3cc0fb)[_0x9f06('0x24')](handleEntityNotFound(_0x377c17,null))['then'](respondWithResult(_0x377c17,null))[_0x9f06('0x43')](handleError(_0x377c17,null));};exports['create']=function(_0x561597,_0x115f92){return db['Automation'][_0x9f06('0x46')](_0x561597['body'],{})[_0x9f06('0x24')](respondWithResult(_0x115f92,0xc9))[_0x9f06('0x43')](handleError(_0x115f92,null));};exports[_0x9f06('0x47')]=function(_0x1c2f6a,_0x4e6c66){if(_0x1c2f6a['body']['id']){delete _0x1c2f6a[_0x9f06('0x48')]['id'];}return db['Automation']['find']({'where':{'id':_0x1c2f6a[_0x9f06('0x45')]['id']}})['then'](handleEntityNotFound(_0x4e6c66,null))[_0x9f06('0x24')](saveUpdates(_0x1c2f6a['body'],null))[_0x9f06('0x24')](respondWithResult(_0x4e6c66,null))['catch'](handleError(_0x4e6c66,null));};exports[_0x9f06('0x49')]=function(_0xd7df5d,_0x38ffab){return db['Automation'][_0x9f06('0x4a')]({'where':{'id':_0xd7df5d[_0x9f06('0x45')]['id']}})[_0x9f06('0x24')](handleEntityNotFound(_0x38ffab,null))[_0x9f06('0x24')](removeEntity(_0x38ffab,null))[_0x9f06('0x43')](handleError(_0x38ffab,null));};exports[_0x9f06('0x4b')]=function(_0xbd5f47,_0x1ea73e,_0x2fe6a1){return db['Condition']['find']({'where':{'id':_0xbd5f47[_0x9f06('0x45')]['id']}})[_0x9f06('0x24')](handleEntityNotFound(_0x1ea73e,null))[_0x9f06('0x24')](function(_0xe88159){if(_0xe88159){return _0xe88159[_0x9f06('0x4b')](_0xbd5f47[_0x9f06('0x48')][_0x9f06('0x4c')],_[_0x9f06('0x4d')](_0xbd5f47['body'],[_0x9f06('0x4c'),'id'])||{});}})[_0x9f06('0x24')](respondWithResult(_0x1ea73e,null))[_0x9f06('0x43')](handleError(_0x1ea73e,null));};exports[_0x9f06('0x4e')]=function(_0x1c41c1,_0x3ce5e6,_0x50037f){var _0x381e43={};var _0x3fbc1f={};var _0x2acd40;var _0x129998;return db[_0x9f06('0x40')][_0x9f06('0x4f')]({'where':{'id':_0x1c41c1[_0x9f06('0x45')]['id']}})[_0x9f06('0x24')](handleEntityNotFound(_0x3ce5e6,null))[_0x9f06('0x24')](function(_0x2c3373){if(_0x2c3373){_0x2acd40=_0x2c3373;_0x3fbc1f[_0x9f06('0x32')]=_[_0x9f06('0x2f')](db[_0x9f06('0x50')][_0x9f06('0x2b')]);_0x3fbc1f[_0x9f06('0x2e')]=_[_0x9f06('0x2f')](_0x1c41c1[_0x9f06('0x2e')]);_0x3fbc1f[_0x9f06('0x30')]=_[_0x9f06('0x31')](_0x3fbc1f[_0x9f06('0x32')],_0x3fbc1f[_0x9f06('0x2e')]);_0x381e43[_0x9f06('0x33')]=_['intersection'](_0x3fbc1f[_0x9f06('0x32')],qs[_0x9f06('0x34')](_0x1c41c1[_0x9f06('0x2e')][_0x9f06('0x34')]));_0x381e43[_0x9f06('0x33')]=_0x381e43['attributes']['length']?_0x381e43['attributes']:_0x3fbc1f[_0x9f06('0x32')];_0x381e43[_0x9f06('0x37')]=qs[_0x9f06('0x38')](_0x1c41c1['query'][_0x9f06('0x38')]);_0x381e43['where']=qs[_0x9f06('0x30')](_[_0x9f06('0x39')](_0x1c41c1[_0x9f06('0x2e')],_0x3fbc1f[_0x9f06('0x30')]));if(_0x1c41c1[_0x9f06('0x2e')]['filter']){_0x381e43[_0x9f06('0x3a')]=_[_0x9f06('0x3c')](_0x381e43['where'],{'$or':_[_0x9f06('0x2a')](_0x381e43[_0x9f06('0x33')],function(_0x5221d2){var _0x59f51b={};_0x59f51b[_0x5221d2]={'$like':'%'+_0x1c41c1[_0x9f06('0x2e')]['filter']+'%'};return _0x59f51b;})});}_0x381e43=_[_0x9f06('0x3c')]({},_0x381e43,_0x1c41c1[_0x9f06('0x3d')]);return _0x2acd40['getConditions'](_0x381e43);}})[_0x9f06('0x24')](function(_0x111568){if(_0x111568){_0x129998=_0x111568[_0x9f06('0x35')];if(!_0x1c41c1[_0x9f06('0x2e')][_0x9f06('0x36')]('nolimit')){_0x381e43[_0x9f06('0x1e')]=qs[_0x9f06('0x1e')](_0x1c41c1['query'][_0x9f06('0x1e')]);_0x381e43[_0x9f06('0x1d')]=qs['offset'](_0x1c41c1[_0x9f06('0x2e')]['offset']);}return _0x2acd40[_0x9f06('0x4e')](_0x381e43);}})[_0x9f06('0x24')](function(_0x4aea13){if(_0x4aea13){return _0x4aea13?{'count':_0x129998,'rows':_0x4aea13}:null;}})['then'](respondWithResult(_0x3ce5e6,null))[_0x9f06('0x43')](handleError(_0x3ce5e6,null));};exports['addActions']=function(_0xed031,_0x5cb899,_0x4ce37f){return db['Action'][_0x9f06('0x4a')]({'where':{'id':_0xed031[_0x9f06('0x45')]['id']}})['then'](handleEntityNotFound(_0x5cb899,null))[_0x9f06('0x24')](function(_0x5a1247){if(_0x5a1247){return _0x5a1247[_0x9f06('0x51')](_0xed031[_0x9f06('0x48')][_0x9f06('0x4c')],_[_0x9f06('0x4d')](_0xed031[_0x9f06('0x48')],[_0x9f06('0x4c'),'id'])||{});}})[_0x9f06('0x24')](respondWithResult(_0x5cb899,null))['catch'](handleError(_0x5cb899,null));};exports[_0x9f06('0x52')]=function(_0x5ed09c,_0x7b9dfc,_0x5cf0c1){var _0x3e61c4={};var _0xc438fa={};var _0x551af3;var _0x45a6a2;return db[_0x9f06('0x40')][_0x9f06('0x4f')]({'where':{'id':_0x5ed09c[_0x9f06('0x45')]['id']}})[_0x9f06('0x24')](handleEntityNotFound(_0x7b9dfc,null))['then'](function(_0x2866ac){if(_0x2866ac){_0x551af3=_0x2866ac;_0xc438fa[_0x9f06('0x32')]=_[_0x9f06('0x2f')](db[_0x9f06('0x53')][_0x9f06('0x2b')]);_0xc438fa[_0x9f06('0x2e')]=_[_0x9f06('0x2f')](_0x5ed09c[_0x9f06('0x2e')]);_0xc438fa['filters']=_[_0x9f06('0x31')](_0xc438fa['model'],_0xc438fa[_0x9f06('0x2e')]);_0x3e61c4[_0x9f06('0x33')]=_['intersection'](_0xc438fa['model'],qs[_0x9f06('0x34')](_0x5ed09c[_0x9f06('0x2e')]['fields']));_0x3e61c4['attributes']=_0x3e61c4[_0x9f06('0x33')][_0x9f06('0x35')]?_0x3e61c4[_0x9f06('0x33')]:_0xc438fa[_0x9f06('0x32')];_0x3e61c4[_0x9f06('0x37')]=qs['sort'](_0x5ed09c[_0x9f06('0x2e')][_0x9f06('0x38')]);_0x3e61c4[_0x9f06('0x3a')]=qs[_0x9f06('0x30')](_[_0x9f06('0x39')](_0x5ed09c['query'],_0xc438fa[_0x9f06('0x30')]));if(_0x5ed09c[_0x9f06('0x2e')][_0x9f06('0x54')]){_0x3e61c4['where']=_[_0x9f06('0x3c')](_0x3e61c4['where'],{'$or':_[_0x9f06('0x2a')](_0x3e61c4['attributes'],function(_0xc8dbd7){var _0x103523={};_0x103523[_0xc8dbd7]={'$like':'%'+_0x5ed09c[_0x9f06('0x2e')][_0x9f06('0x54')]+'%'};return _0x103523;})});}_0x3e61c4=_[_0x9f06('0x3c')]({},_0x3e61c4,_0x5ed09c['options']);return _0x551af3['getActions'](_0x3e61c4);}})[_0x9f06('0x24')](function(_0x3f24e8){if(_0x3f24e8){_0x45a6a2=_0x3f24e8[_0x9f06('0x35')];if(!_0x5ed09c[_0x9f06('0x2e')][_0x9f06('0x36')](_0x9f06('0x55'))){_0x3e61c4[_0x9f06('0x1e')]=qs['limit'](_0x5ed09c[_0x9f06('0x2e')]['limit']);_0x3e61c4[_0x9f06('0x1d')]=qs[_0x9f06('0x1d')](_0x5ed09c[_0x9f06('0x2e')][_0x9f06('0x1d')]);}return _0x551af3[_0x9f06('0x52')](_0x3e61c4);}})['then'](function(_0x373835){if(_0x373835){return _0x373835?{'count':_0x45a6a2,'rows':_0x373835}:null;}})[_0x9f06('0x24')](respondWithResult(_0x7b9dfc,null))[_0x9f06('0x43')](handleError(_0x7b9dfc,null));};
\ No newline at end of file
+var _0x84cb=['filter','Automation','include','findAll','catch','show','includeAll','options','find','create','body','params','destroy','addConditions','ids','omit','getConditions','findOne','Condition','order','hasOwnProperty','addActions','Action','getActions','nolimit','html-pdf','eml-format','fast-json-patch','request-promise','mustache','util','path','sox','to-csv','ejs','lodash','squel','desk.js','querystring','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/environment','../../mysqldb','status','end','json','count','offset','set','Content-Range','apply','reject','save','update','then','sendStatus','stack','name','send','index','map','rawAttributes','fieldName','type','key','model','query','keys','filters','intersection','attributes','fields','length','limit','sort','where','pick','merge','VIRTUAL'];(function(_0x2641f9,_0x26715f){var _0x585741=function(_0x2d1462){while(--_0x2d1462){_0x2641f9['push'](_0x2641f9['shift']());}};_0x585741(++_0x26715f);}(_0x84cb,0x169));var _0xb84c=function(_0x221c85,_0x2d9a71){_0x221c85=_0x221c85-0x0;var _0x2ae68c=_0x84cb[_0x221c85];return _0x2ae68c;};'use strict';var pdf=require(_0xb84c('0x0'));var emlformat=require(_0xb84c('0x1'));var rimraf=require('rimraf');var zipdir=require('zip-dir');var jsonpatch=require(_0xb84c('0x2'));var rp=require(_0xb84c('0x3'));var moment=require('moment');var BPromise=require('bluebird');var Mustache=require(_0xb84c('0x4'));var util=require(_0xb84c('0x5'));var path=require(_0xb84c('0x6'));var sox=require(_0xb84c('0x7'));var csv=require(_0xb84c('0x8'));var ejs=require(_0xb84c('0x9'));var fs=require('fs');var _=require(_0xb84c('0xa'));var squel=require(_0xb84c('0xb'));var crypto=require('crypto');var jsforce=require('jsforce');var deskjs=require(_0xb84c('0xc'));var toCsv=require('to-csv');var querystring=require(_0xb84c('0xd'));var Papa=require('papaparse');var Redis=require(_0xb84c('0xe'));var authService=require(_0xb84c('0xf'));var qs=require(_0xb84c('0x10'));var as=require(_0xb84c('0x11'));var hardwareService=require(_0xb84c('0x12'));var logger=require(_0xb84c('0x13'))(_0xb84c('0x14'));var utils=require('../../config/utils');var config=require(_0xb84c('0x15'));var db=require(_0xb84c('0x16'))['db'];function respondWithStatusCode(_0x58ca6f,_0x5dce14){_0x5dce14=_0x5dce14||0xcc;return function(_0x5c6ba2){if(_0x5c6ba2){return _0x58ca6f['sendStatus'](_0x5dce14);}return _0x58ca6f[_0xb84c('0x17')](_0x5dce14)[_0xb84c('0x18')]();};}function respondWithResult(_0x55c1f4,_0x31a9ed){_0x31a9ed=_0x31a9ed||0xc8;return function(_0x364d12){if(_0x364d12){return _0x55c1f4[_0xb84c('0x17')](_0x31a9ed)[_0xb84c('0x19')](_0x364d12);}};}function respondWithFilteredResult(_0x273ed9,_0x52ea8e){return function(_0x14649c){if(_0x14649c){var _0x56b784=_0x14649c[_0xb84c('0x1a')],_0x3d31ea=_0x52ea8e[_0xb84c('0x1b')],_0x3dbf0f=_0x52ea8e[_0xb84c('0x1b')]+_0x52ea8e['limit'],_0x569382;if(_0x3dbf0f>=_0x56b784){_0x3dbf0f=_0x56b784;_0x569382=0xc8;}else{_0x569382=0xce;}_0x273ed9[_0xb84c('0x17')](_0x569382);return _0x273ed9[_0xb84c('0x1c')](_0xb84c('0x1d'),_0x3d31ea+'-'+_0x3dbf0f+'/'+_0x56b784)[_0xb84c('0x19')](_0x14649c);}return null;};}function patchUpdates(_0x2733bb){return function(_0x5da1f7){try{jsonpatch[_0xb84c('0x1e')](_0x5da1f7,_0x2733bb,!![]);}catch(_0x3bd05b){return BPromise[_0xb84c('0x1f')](_0x3bd05b);}return _0x5da1f7[_0xb84c('0x20')]();};}function saveUpdates(_0x1886ef,_0x104d47){return function(_0x2e196b){if(_0x2e196b){return _0x2e196b[_0xb84c('0x21')](_0x1886ef)['then'](function(_0x481b9f){return _0x481b9f;});}return null;};}function removeEntity(_0x3cae44,_0x4b24e0){return function(_0x64e513){if(_0x64e513){return _0x64e513['destroy']()[_0xb84c('0x22')](function(){_0x3cae44[_0xb84c('0x17')](0xcc)[_0xb84c('0x18')]();});}};}function handleEntityNotFound(_0x2c17ef,_0x2af036){return function(_0xbbe792){if(!_0xbbe792){_0x2c17ef[_0xb84c('0x23')](0x194);}return _0xbbe792;};}function handleError(_0x5e60a2,_0x5a79cc){_0x5a79cc=_0x5a79cc||0x1f4;return function(_0x39fea7){logger['error'](_0x39fea7[_0xb84c('0x24')]);if(_0x39fea7['name']){delete _0x39fea7[_0xb84c('0x25')];}_0x5e60a2[_0xb84c('0x17')](_0x5a79cc)[_0xb84c('0x26')](_0x39fea7);};}exports[_0xb84c('0x27')]=function(_0x568ff7,_0x5d9e9a){var _0x4225a2={},_0x4c07f5={},_0x1577f8={'count':0x0,'rows':[]};var _0x1afe40=_[_0xb84c('0x28')](db['Automation'][_0xb84c('0x29')],function(_0x2afbc8){return{'name':_0x2afbc8[_0xb84c('0x2a')],'type':_0x2afbc8[_0xb84c('0x2b')][_0xb84c('0x2c')]};});_0x4c07f5[_0xb84c('0x2d')]=_[_0xb84c('0x28')](_0x1afe40,'name');_0x4c07f5[_0xb84c('0x2e')]=_[_0xb84c('0x2f')](_0x568ff7['query']);_0x4c07f5[_0xb84c('0x30')]=_[_0xb84c('0x31')](_0x4c07f5[_0xb84c('0x2d')],_0x4c07f5['query']);_0x4225a2[_0xb84c('0x32')]=_[_0xb84c('0x31')](_0x4c07f5[_0xb84c('0x2d')],qs[_0xb84c('0x33')](_0x568ff7['query'][_0xb84c('0x33')]));_0x4225a2[_0xb84c('0x32')]=_0x4225a2[_0xb84c('0x32')][_0xb84c('0x34')]?_0x4225a2['attributes']:_0x4c07f5['model'];if(!_0x568ff7[_0xb84c('0x2e')]['hasOwnProperty']('nolimit')){_0x4225a2[_0xb84c('0x35')]=qs[_0xb84c('0x35')](_0x568ff7[_0xb84c('0x2e')][_0xb84c('0x35')]);_0x4225a2['offset']=qs[_0xb84c('0x1b')](_0x568ff7['query'][_0xb84c('0x1b')]);}_0x4225a2['order']=qs[_0xb84c('0x36')](_0x568ff7['query'][_0xb84c('0x36')]);_0x4225a2[_0xb84c('0x37')]=qs[_0xb84c('0x30')](_[_0xb84c('0x38')](_0x568ff7[_0xb84c('0x2e')],_0x4c07f5[_0xb84c('0x30')]));if(_0x568ff7[_0xb84c('0x2e')]['filter']){_0x4225a2[_0xb84c('0x37')]=_[_0xb84c('0x39')](_0x4225a2[_0xb84c('0x37')],{'$or':_['map'](_0x1afe40,function(_0x2d20f2){if(_0x2d20f2[_0xb84c('0x2b')]!==_0xb84c('0x3a')){var _0x1b727a={};_0x1b727a[_0x2d20f2['name']]={'$like':'%'+_0x568ff7[_0xb84c('0x2e')][_0xb84c('0x3b')]+'%'};return _0x1b727a;}})});}_0x4225a2=_[_0xb84c('0x39')]({},_0x4225a2,_0x568ff7['options']);var _0xb085ed={'where':_0x4225a2[_0xb84c('0x37')]};return db[_0xb84c('0x3c')][_0xb84c('0x1a')](_0xb085ed)[_0xb84c('0x22')](function(_0x55393f){_0x1577f8[_0xb84c('0x1a')]=_0x55393f;if(_0x568ff7[_0xb84c('0x2e')]['includeAll']){_0x4225a2[_0xb84c('0x3d')]=[{'all':!![]}];}return db['Automation'][_0xb84c('0x3e')](_0x4225a2);})['then'](function(_0x4cbe3c){_0x1577f8['rows']=_0x4cbe3c;return _0x1577f8;})[_0xb84c('0x22')](respondWithFilteredResult(_0x5d9e9a,_0x4225a2))[_0xb84c('0x3f')](handleError(_0x5d9e9a,null));};exports[_0xb84c('0x40')]=function(_0xb68727,_0x181b93){var _0x1074f4={'raw':![],'where':{'id':_0xb68727['params']['id']}},_0x5563c4={};_0x5563c4['model']=_['keys'](db[_0xb84c('0x3c')][_0xb84c('0x29')]);_0x5563c4[_0xb84c('0x2e')]=_['keys'](_0xb68727['query']);_0x5563c4['filters']=_[_0xb84c('0x31')](_0x5563c4[_0xb84c('0x2d')],_0x5563c4[_0xb84c('0x2e')]);_0x1074f4[_0xb84c('0x32')]=_[_0xb84c('0x31')](_0x5563c4['model'],qs['fields'](_0xb68727[_0xb84c('0x2e')]['fields']));_0x1074f4[_0xb84c('0x32')]=_0x1074f4[_0xb84c('0x32')][_0xb84c('0x34')]?_0x1074f4[_0xb84c('0x32')]:_0x5563c4['model'];if(_0xb68727[_0xb84c('0x2e')][_0xb84c('0x41')]){_0x1074f4[_0xb84c('0x3d')]=[{'all':!![]}];}_0x1074f4=_['merge']({},_0x1074f4,_0xb68727[_0xb84c('0x42')]);return db['Automation'][_0xb84c('0x43')](_0x1074f4)['then'](handleEntityNotFound(_0x181b93,null))[_0xb84c('0x22')](respondWithResult(_0x181b93,null))[_0xb84c('0x3f')](handleError(_0x181b93,null));};exports[_0xb84c('0x44')]=function(_0x465646,_0x4f9d57){return db['Automation']['create'](_0x465646['body'],{})[_0xb84c('0x22')](respondWithResult(_0x4f9d57,0xc9))[_0xb84c('0x3f')](handleError(_0x4f9d57,null));};exports[_0xb84c('0x21')]=function(_0x38a97e,_0x4b48b5){if(_0x38a97e[_0xb84c('0x45')]['id']){delete _0x38a97e[_0xb84c('0x45')]['id'];}return db['Automation'][_0xb84c('0x43')]({'where':{'id':_0x38a97e[_0xb84c('0x46')]['id']}})[_0xb84c('0x22')](handleEntityNotFound(_0x4b48b5,null))[_0xb84c('0x22')](saveUpdates(_0x38a97e[_0xb84c('0x45')],null))['then'](respondWithResult(_0x4b48b5,null))[_0xb84c('0x3f')](handleError(_0x4b48b5,null));};exports[_0xb84c('0x47')]=function(_0xa10952,_0x8a5751){return db[_0xb84c('0x3c')][_0xb84c('0x43')]({'where':{'id':_0xa10952['params']['id']}})['then'](handleEntityNotFound(_0x8a5751,null))['then'](removeEntity(_0x8a5751,null))[_0xb84c('0x3f')](handleError(_0x8a5751,null));};exports[_0xb84c('0x48')]=function(_0x597134,_0x19279a,_0x563a0d){return db['Condition'][_0xb84c('0x43')]({'where':{'id':_0x597134[_0xb84c('0x46')]['id']}})['then'](handleEntityNotFound(_0x19279a,null))[_0xb84c('0x22')](function(_0x4645ed){if(_0x4645ed){return _0x4645ed[_0xb84c('0x48')](_0x597134[_0xb84c('0x45')][_0xb84c('0x49')],_[_0xb84c('0x4a')](_0x597134[_0xb84c('0x45')],[_0xb84c('0x49'),'id'])||{});}})[_0xb84c('0x22')](respondWithResult(_0x19279a,null))[_0xb84c('0x3f')](handleError(_0x19279a,null));};exports[_0xb84c('0x4b')]=function(_0x3a6e07,_0x48a3f0,_0x49e642){var _0x1bc503={};var _0x173623={};var _0x9535bf;var _0x362120;return db[_0xb84c('0x3c')][_0xb84c('0x4c')]({'where':{'id':_0x3a6e07[_0xb84c('0x46')]['id']}})['then'](handleEntityNotFound(_0x48a3f0,null))[_0xb84c('0x22')](function(_0x4b4766){if(_0x4b4766){_0x9535bf=_0x4b4766;_0x173623['model']=_[_0xb84c('0x2f')](db[_0xb84c('0x4d')]['rawAttributes']);_0x173623[_0xb84c('0x2e')]=_[_0xb84c('0x2f')](_0x3a6e07['query']);_0x173623[_0xb84c('0x30')]=_[_0xb84c('0x31')](_0x173623[_0xb84c('0x2d')],_0x173623[_0xb84c('0x2e')]);_0x1bc503[_0xb84c('0x32')]=_['intersection'](_0x173623[_0xb84c('0x2d')],qs[_0xb84c('0x33')](_0x3a6e07[_0xb84c('0x2e')][_0xb84c('0x33')]));_0x1bc503[_0xb84c('0x32')]=_0x1bc503[_0xb84c('0x32')][_0xb84c('0x34')]?_0x1bc503['attributes']:_0x173623[_0xb84c('0x2d')];_0x1bc503[_0xb84c('0x4e')]=qs[_0xb84c('0x36')](_0x3a6e07[_0xb84c('0x2e')]['sort']);_0x1bc503[_0xb84c('0x37')]=qs[_0xb84c('0x30')](_[_0xb84c('0x38')](_0x3a6e07[_0xb84c('0x2e')],_0x173623[_0xb84c('0x30')]));if(_0x3a6e07[_0xb84c('0x2e')][_0xb84c('0x3b')]){_0x1bc503[_0xb84c('0x37')]=_['merge'](_0x1bc503['where'],{'$or':_[_0xb84c('0x28')](_0x1bc503[_0xb84c('0x32')],function(_0x151457){var _0x24acbe={};_0x24acbe[_0x151457]={'$like':'%'+_0x3a6e07[_0xb84c('0x2e')][_0xb84c('0x3b')]+'%'};return _0x24acbe;})});}_0x1bc503=_[_0xb84c('0x39')]({},_0x1bc503,_0x3a6e07[_0xb84c('0x42')]);return _0x9535bf[_0xb84c('0x4b')](_0x1bc503);}})['then'](function(_0x2a6a18){if(_0x2a6a18){_0x362120=_0x2a6a18[_0xb84c('0x34')];if(!_0x3a6e07[_0xb84c('0x2e')][_0xb84c('0x4f')]('nolimit')){_0x1bc503['limit']=qs[_0xb84c('0x35')](_0x3a6e07[_0xb84c('0x2e')][_0xb84c('0x35')]);_0x1bc503[_0xb84c('0x1b')]=qs[_0xb84c('0x1b')](_0x3a6e07[_0xb84c('0x2e')][_0xb84c('0x1b')]);}return _0x9535bf[_0xb84c('0x4b')](_0x1bc503);}})[_0xb84c('0x22')](function(_0x3fdfe4){if(_0x3fdfe4){return _0x3fdfe4?{'count':_0x362120,'rows':_0x3fdfe4}:null;}})['then'](respondWithResult(_0x48a3f0,null))['catch'](handleError(_0x48a3f0,null));};exports[_0xb84c('0x50')]=function(_0x2c97a9,_0x5edd30,_0x19698d){return db[_0xb84c('0x51')][_0xb84c('0x43')]({'where':{'id':_0x2c97a9[_0xb84c('0x46')]['id']}})['then'](handleEntityNotFound(_0x5edd30,null))[_0xb84c('0x22')](function(_0x2fae44){if(_0x2fae44){return _0x2fae44[_0xb84c('0x50')](_0x2c97a9[_0xb84c('0x45')][_0xb84c('0x49')],_['omit'](_0x2c97a9[_0xb84c('0x45')],['ids','id'])||{});}})[_0xb84c('0x22')](respondWithResult(_0x5edd30,null))[_0xb84c('0x3f')](handleError(_0x5edd30,null));};exports[_0xb84c('0x52')]=function(_0x3046a1,_0x194ad0,_0x36eb68){var _0x200fbc={};var _0x8feda8={};var _0x4d6418;var _0x206d33;return db['Automation'][_0xb84c('0x4c')]({'where':{'id':_0x3046a1['params']['id']}})[_0xb84c('0x22')](handleEntityNotFound(_0x194ad0,null))[_0xb84c('0x22')](function(_0x5770f4){if(_0x5770f4){_0x4d6418=_0x5770f4;_0x8feda8[_0xb84c('0x2d')]=_['keys'](db[_0xb84c('0x51')]['rawAttributes']);_0x8feda8[_0xb84c('0x2e')]=_['keys'](_0x3046a1[_0xb84c('0x2e')]);_0x8feda8['filters']=_['intersection'](_0x8feda8[_0xb84c('0x2d')],_0x8feda8[_0xb84c('0x2e')]);_0x200fbc['attributes']=_[_0xb84c('0x31')](_0x8feda8[_0xb84c('0x2d')],qs['fields'](_0x3046a1[_0xb84c('0x2e')]['fields']));_0x200fbc[_0xb84c('0x32')]=_0x200fbc[_0xb84c('0x32')][_0xb84c('0x34')]?_0x200fbc[_0xb84c('0x32')]:_0x8feda8[_0xb84c('0x2d')];_0x200fbc[_0xb84c('0x4e')]=qs[_0xb84c('0x36')](_0x3046a1[_0xb84c('0x2e')][_0xb84c('0x36')]);_0x200fbc[_0xb84c('0x37')]=qs[_0xb84c('0x30')](_[_0xb84c('0x38')](_0x3046a1[_0xb84c('0x2e')],_0x8feda8[_0xb84c('0x30')]));if(_0x3046a1[_0xb84c('0x2e')][_0xb84c('0x3b')]){_0x200fbc[_0xb84c('0x37')]=_['merge'](_0x200fbc['where'],{'$or':_[_0xb84c('0x28')](_0x200fbc[_0xb84c('0x32')],function(_0x4cca55){var _0x5ca0a1={};_0x5ca0a1[_0x4cca55]={'$like':'%'+_0x3046a1[_0xb84c('0x2e')][_0xb84c('0x3b')]+'%'};return _0x5ca0a1;})});}_0x200fbc=_['merge']({},_0x200fbc,_0x3046a1[_0xb84c('0x42')]);return _0x4d6418[_0xb84c('0x52')](_0x200fbc);}})[_0xb84c('0x22')](function(_0x42f57e){if(_0x42f57e){_0x206d33=_0x42f57e[_0xb84c('0x34')];if(!_0x3046a1['query'][_0xb84c('0x4f')](_0xb84c('0x53'))){_0x200fbc[_0xb84c('0x35')]=qs[_0xb84c('0x35')](_0x3046a1['query'][_0xb84c('0x35')]);_0x200fbc[_0xb84c('0x1b')]=qs[_0xb84c('0x1b')](_0x3046a1[_0xb84c('0x2e')][_0xb84c('0x1b')]);}return _0x4d6418[_0xb84c('0x52')](_0x200fbc);}})[_0xb84c('0x22')](function(_0x26f6c1){if(_0x26f6c1){return _0x26f6c1?{'count':_0x206d33,'rows':_0x26f6c1}:null;}})[_0xb84c('0x22')](respondWithResult(_0x194ad0,null))['catch'](handleError(_0x194ad0,null));};
\ No newline at end of file
diff --git a/server/api/automation/automation.model.js b/server/api/automation/automation.model.js
index 3e878f7..59c55f2 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 _0x476e=['../../config/logger','api','moment','bluebird','path','rimraf','../../config/environment','./automation.attributes','define','Automation','tools_automations','lodash','util'];(function(_0x590777,_0x4702b8){var _0x1d27b2=function(_0x5301ce){while(--_0x5301ce){_0x590777['push'](_0x590777['shift']());}};_0x1d27b2(++_0x4702b8);}(_0x476e,0x73));var _0xe476=function(_0x1c1462,_0x594988){_0x1c1462=_0x1c1462-0x0;var _0x4f44fc=_0x476e[_0x1c1462];return _0x4f44fc;};'use strict';var _=require(_0xe476('0x0'));var util=require(_0xe476('0x1'));var logger=require(_0xe476('0x2'))(_0xe476('0x3'));var moment=require(_0xe476('0x4'));var BPromise=require(_0xe476('0x5'));var rp=require('request-promise');var fs=require('fs');var path=require(_0xe476('0x6'));var rimraf=require(_0xe476('0x7'));var config=require(_0xe476('0x8'));var attributes=require(_0xe476('0x9'));module['exports']=function(_0x9ed6cc,_0x35230a){return _0x9ed6cc[_0xe476('0xa')](_0xe476('0xb'),attributes,{'tableName':_0xe476('0xc'),'paranoid':![],'indexes':[],'timestamps':!![]});};
\ No newline at end of file
+var _0xa4ec=['./automation.attributes','exports','tools_automations','lodash','../../config/logger','api','moment','bluebird','request-promise','../../config/environment'];(function(_0x2a6809,_0x44edde){var _0x11c371=function(_0x1a4888){while(--_0x1a4888){_0x2a6809['push'](_0x2a6809['shift']());}};_0x11c371(++_0x44edde);}(_0xa4ec,0x193));var _0xca4e=function(_0x5783f4,_0x4a9e0a){_0x5783f4=_0x5783f4-0x0;var _0x28e380=_0xa4ec[_0x5783f4];return _0x28e380;};'use strict';var _=require(_0xca4e('0x0'));var util=require('util');var logger=require(_0xca4e('0x1'))(_0xca4e('0x2'));var moment=require(_0xca4e('0x3'));var BPromise=require(_0xca4e('0x4'));var rp=require(_0xca4e('0x5'));var fs=require('fs');var path=require('path');var rimraf=require('rimraf');var config=require(_0xca4e('0x6'));var attributes=require(_0xca4e('0x7'));module[_0xca4e('0x8')]=function(_0x5887c7,_0x38a60c){return _0x5887c7['define']('Automation',attributes,{'tableName':_0xca4e('0x9'),'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 ac92ac5..bcab2bb 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 _0xaa9d=['../../config/environment','jayson/promise','client','then','info','request\x20sent','debug','stringify','error','Automation,\x20%s,\x20%s','message','catch','lodash','util','moment','bluebird','randomstring','rpc'];(function(_0x1d04b5,_0x30792c){var _0x161342=function(_0x94ff92){while(--_0x94ff92){_0x1d04b5['push'](_0x1d04b5['shift']());}};_0x161342(++_0x30792c);}(_0xaa9d,0x1aa));var _0xdaa9=function(_0x1e0e9e,_0x15dc99){_0x1e0e9e=_0x1e0e9e-0x0;var _0x23fd28=_0xaa9d[_0x1e0e9e];return _0x23fd28;};'use strict';var _=require(_0xdaa9('0x0'));var util=require(_0xdaa9('0x1'));var moment=require(_0xdaa9('0x2'));var BPromise=require(_0xdaa9('0x3'));var rs=require(_0xdaa9('0x4'));var fs=require('fs');var Redis=require('ioredis');var db=require('../../mysqldb')['db'];var utils=require('../../config/utils');var logger=require('../../config/logger')(_0xdaa9('0x5'));var config=require(_0xdaa9('0x6'));var jayson=require(_0xdaa9('0x7'));var client=jayson[_0xdaa9('0x8')]['http']({'port':0x232a});function respondWithRpcPromise(_0x548aee,_0x1a77bd,_0x389004){return new BPromise(function(_0x394817,_0x194c11){return client['request'](_0x548aee,_0x389004)[_0xdaa9('0x9')](function(_0x5317f8){logger[_0xdaa9('0xa')]('Automation,\x20%s,\x20%s',_0x1a77bd,_0xdaa9('0xb'));logger[_0xdaa9('0xc')]('Automation,\x20%s,\x20%s,\x20%s',_0x1a77bd,_0xdaa9('0xb'),JSON[_0xdaa9('0xd')](_0x5317f8));if(_0x5317f8[_0xdaa9('0xe')]){if(_0x5317f8[_0xdaa9('0xe')]['code']===0x1f4){logger['error'](_0xdaa9('0xf'),_0x1a77bd,_0x5317f8[_0xdaa9('0xe')][_0xdaa9('0x10')]);return _0x194c11(_0x5317f8[_0xdaa9('0xe')][_0xdaa9('0x10')]);}logger[_0xdaa9('0xe')](_0xdaa9('0xf'),_0x1a77bd,_0x5317f8[_0xdaa9('0xe')]['message']);return _0x394817(_0x5317f8['error'][_0xdaa9('0x10')]);}else{logger[_0xdaa9('0xa')](_0xdaa9('0xf'),_0x1a77bd,_0xdaa9('0xb'));_0x394817(_0x5317f8['result']['message']);}})[_0xdaa9('0x11')](function(_0x582447){logger['error']('Automation,\x20%s,\x20%s',_0x1a77bd,_0x582447);_0x194c11(_0x582447);});});}
\ No newline at end of file
+var _0x1401=['util','moment','randomstring','ioredis','../../mysqldb','../../config/logger','rpc','../../config/environment','client','then','info','Automation,\x20%s,\x20%s,\x20%s','error','Automation,\x20%s,\x20%s','message','request\x20sent','result','catch'];(function(_0x31bcbe,_0x4ce65b){var _0x485320=function(_0x1cb6d7){while(--_0x1cb6d7){_0x31bcbe['push'](_0x31bcbe['shift']());}};_0x485320(++_0x4ce65b);}(_0x1401,0x144));var _0x1140=function(_0x4394f7,_0x43ee7b){_0x4394f7=_0x4394f7-0x0;var _0x340a66=_0x1401[_0x4394f7];return _0x340a66;};'use strict';var _=require('lodash');var util=require(_0x1140('0x0'));var moment=require(_0x1140('0x1'));var BPromise=require('bluebird');var rs=require(_0x1140('0x2'));var fs=require('fs');var Redis=require(_0x1140('0x3'));var db=require(_0x1140('0x4'))['db'];var utils=require('../../config/utils');var logger=require(_0x1140('0x5'))(_0x1140('0x6'));var config=require(_0x1140('0x7'));var jayson=require('jayson/promise');var client=jayson[_0x1140('0x8')]['http']({'port':0x232a});function respondWithRpcPromise(_0x508eb2,_0x4b2a65,_0x230ed5){return new BPromise(function(_0x36dcf8,_0x5a87ed){return client['request'](_0x508eb2,_0x230ed5)[_0x1140('0x9')](function(_0x4fc50a){logger[_0x1140('0xa')]('Automation,\x20%s,\x20%s',_0x4b2a65,'request\x20sent');logger['debug'](_0x1140('0xb'),_0x4b2a65,'request\x20sent',JSON['stringify'](_0x4fc50a));if(_0x4fc50a[_0x1140('0xc')]){if(_0x4fc50a[_0x1140('0xc')]['code']===0x1f4){logger[_0x1140('0xc')](_0x1140('0xd'),_0x4b2a65,_0x4fc50a[_0x1140('0xc')][_0x1140('0xe')]);return _0x5a87ed(_0x4fc50a[_0x1140('0xc')]['message']);}logger[_0x1140('0xc')](_0x1140('0xd'),_0x4b2a65,_0x4fc50a['error'][_0x1140('0xe')]);return _0x36dcf8(_0x4fc50a[_0x1140('0xc')]['message']);}else{logger['info'](_0x1140('0xd'),_0x4b2a65,_0x1140('0xf'));_0x36dcf8(_0x4fc50a[_0x1140('0x10')][_0x1140('0xe')]);}})[_0x1140('0x11')](function(_0x43cd7f){logger[_0x1140('0xc')](_0x1140('0xd'),_0x4b2a65,_0x43cd7f);_0x5a87ed(_0x43cd7f);});});}
\ No newline at end of file
diff --git a/server/api/automation/index.js b/server/api/automation/index.js
index d3bf4aa..796c6be 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 _0xa753=['show','/:id/conditions','getConditions','/:id/actions','getActions','create','post','addConditions','update','delete','destroy','exports','multer','util','path','express','Router','../../components/auth/service','../../components/interaction/service','get','isAuthenticated','/:id'];(function(_0x1907dd,_0x36f038){var _0x2aa517=function(_0x145438){while(--_0x145438){_0x1907dd['push'](_0x1907dd['shift']());}};_0x2aa517(++_0x36f038);}(_0xa753,0xa6));var _0x3a75=function(_0x1b77c4,_0x35b9e2){_0x1b77c4=_0x1b77c4-0x0;var _0x9a9894=_0xa753[_0x1b77c4];return _0x9a9894;};'use strict';var multer=require(_0x3a75('0x0'));var util=require(_0x3a75('0x1'));var path=require(_0x3a75('0x2'));var timeout=require('connect-timeout');var express=require(_0x3a75('0x3'));var router=express[_0x3a75('0x4')]();var auth=require(_0x3a75('0x5'));var interaction=require(_0x3a75('0x6'));var config=require('../../config/environment');var controller=require('./automation.controller');router[_0x3a75('0x7')]('/',auth[_0x3a75('0x8')](),controller['index']);router[_0x3a75('0x7')](_0x3a75('0x9'),auth['isAuthenticated'](),controller[_0x3a75('0xa')]);router['get'](_0x3a75('0xb'),auth[_0x3a75('0x8')](),controller[_0x3a75('0xc')]);router[_0x3a75('0x7')](_0x3a75('0xd'),auth[_0x3a75('0x8')](),controller[_0x3a75('0xe')]);router['post']('/',auth[_0x3a75('0x8')](),controller[_0x3a75('0xf')]);router[_0x3a75('0x10')]('/:id/conditions',auth[_0x3a75('0x8')](),controller[_0x3a75('0x11')]);router[_0x3a75('0x10')]('/:id/actions',auth['isAuthenticated'](),controller['addActions']);router['put'](_0x3a75('0x9'),auth['isAuthenticated'](),controller[_0x3a75('0x12')]);router[_0x3a75('0x13')]('/:id',auth[_0x3a75('0x8')](),controller[_0x3a75('0x14')]);module[_0x3a75('0x15')]=router;
\ No newline at end of file
+var _0xcc04=['/:id','show','get','getConditions','post','create','/:id/conditions','addConditions','/:id/actions','addActions','put','update','destroy','exports','multer','util','path','connect-timeout','express','Router','../../components/auth/service','../../components/interaction/service','../../config/environment','./automation.controller','isAuthenticated','index'];(function(_0x2dd9b6,_0x1c016f){var _0x3e9fd8=function(_0x5b18c8){while(--_0x5b18c8){_0x2dd9b6['push'](_0x2dd9b6['shift']());}};_0x3e9fd8(++_0x1c016f);}(_0xcc04,0x1c8));var _0x4cc0=function(_0x1cae00,_0x4589e4){_0x1cae00=_0x1cae00-0x0;var _0x391291=_0xcc04[_0x1cae00];return _0x391291;};'use strict';var multer=require(_0x4cc0('0x0'));var util=require(_0x4cc0('0x1'));var path=require(_0x4cc0('0x2'));var timeout=require(_0x4cc0('0x3'));var express=require(_0x4cc0('0x4'));var router=express[_0x4cc0('0x5')]();var auth=require(_0x4cc0('0x6'));var interaction=require(_0x4cc0('0x7'));var config=require(_0x4cc0('0x8'));var controller=require(_0x4cc0('0x9'));router['get']('/',auth[_0x4cc0('0xa')](),controller[_0x4cc0('0xb')]);router['get'](_0x4cc0('0xc'),auth[_0x4cc0('0xa')](),controller[_0x4cc0('0xd')]);router[_0x4cc0('0xe')]('/:id/conditions',auth[_0x4cc0('0xa')](),controller[_0x4cc0('0xf')]);router[_0x4cc0('0xe')]('/:id/actions',auth[_0x4cc0('0xa')](),controller['getActions']);router[_0x4cc0('0x10')]('/',auth['isAuthenticated'](),controller[_0x4cc0('0x11')]);router[_0x4cc0('0x10')](_0x4cc0('0x12'),auth[_0x4cc0('0xa')](),controller[_0x4cc0('0x13')]);router[_0x4cc0('0x10')](_0x4cc0('0x14'),auth[_0x4cc0('0xa')](),controller[_0x4cc0('0x15')]);router[_0x4cc0('0x16')](_0x4cc0('0xc'),auth[_0x4cc0('0xa')](),controller[_0x4cc0('0x17')]);router['delete'](_0x4cc0('0xc'),auth[_0x4cc0('0xa')](),controller[_0x4cc0('0x18')]);module[_0x4cc0('0x19')]=router;
\ No newline at end of file
diff --git a/server/api/campaign/campaign.attributes.js b/server/api/campaign/campaign.attributes.js
index e35078e..b910c87 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 _0x009e=['#NoSuchNumber\x20Retry\x20(min:1,\x20max:999)','NoSuchNumber\x20Retry\x20Frequency\x20Minutes\x20(min:1,\x20max:99999)','#Drop\x20Retry\x20(min:1,\x20max:999)','#Abandoned\x20Retry\x20(min:1,\x20max:999)','Abandoned\x20Retry\x20Frequency\x20Minutes\x20(min:1,\x20max:99999)','Machine\x20Retry\x20Frequency\x20Minutes\x20(min:1,\x20max:99999)','exports','name','ENUM','ivr','STRING','BOOLEAN','Active/Disactive\x20Campaign','INTEGER','UNSIGNED','Originate\x20Timeout\x20Seconds\x20(min:1,\x20max:999)','#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\x20(min:1,\x20max:999)','NoAnswer\x20Retry\x20Frequency\x20Minutes\x20(min:1,\x20max:99999)','#Global\x20Max\x20Retry\x20(min:1,\x20max:999)','always','never','onlyIfOpen','Active/Disactive\x20AMD','#AMD\x20Initial\x20Silence','#AMD\x20Greeting','#AMD\x20After\x20Greeting\x20Silence','#AMD\x20Total\x20Analysis\x20Time','#AMD\x20Min\x20Word\x20Length','#AMD\x20Maximum\x20Number\x20Of\x20Words','#AMD\x20Silence\x20Threshold\x20(min:0,\x20max:32767)','#AMD\x20Maximum\x20Word\x20Length','DESC','ASC','Random\x20Last\x20Digit\x20(min:1,\x20max:15)','Cut\x20Digit\x20(min:1,\x20max:15)'];(function(_0xaaf2e2,_0x19d28a){var _0x28bc36=function(_0x53bdb5){while(--_0x53bdb5){_0xaaf2e2['push'](_0xaaf2e2['shift']());}};_0x28bc36(++_0x19d28a);}(_0x009e,0x1f4));var _0xe009=function(_0x2b9e49,_0x389cf0){_0x2b9e49=_0x2b9e49-0x0;var _0xf1c81e=_0x009e[_0x2b9e49];return _0xf1c81e;};'use strict';var Sequelize=require('sequelize');module[_0xe009('0x0')]={'name':{'type':Sequelize['STRING'],'unique':_0xe009('0x1'),'allowNull':![],'validate':{'is':/[A-Za-z0-9._\\+*!-]+/,'notEmpty':!![]}},'type':{'type':Sequelize[_0xe009('0x2')](_0xe009('0x3')),'allowNull':![],'defaultValue':_0xe009('0x3')},'description':{'type':Sequelize[_0xe009('0x4')]},'active':{'type':Sequelize[_0xe009('0x5')],'defaultValue':0x0,'comment':_0xe009('0x6')},'limitCalls':{'type':Sequelize[_0xe009('0x7')](0x4)[_0xe009('0x8')],'defaultValue':0x1e,'validate':{'min':0x1,'max':0xc8},'comment':'Max\x20200\x20calls.'},'dialOriginateCallerIdName':{'type':Sequelize['STRING']},'dialOriginateCallerIdNumber':{'type':Sequelize[_0xe009('0x4')]},'dialOriginateTimeout':{'type':Sequelize[_0xe009('0x7')](0x3)[_0xe009('0x8')],'defaultValue':0x1e,'validate':{'min':0x1,'max':0x3e7},'comment':_0xe009('0x9')},'dialCongestionMaxRetry':{'type':Sequelize[_0xe009('0x7')](0x3)[_0xe009('0x8')],'defaultValue':0x3,'validate':{'min':0x1,'max':0x3e7},'comment':_0xe009('0xa')},'dialCongestionRetryFrequency':{'type':Sequelize[_0xe009('0x7')](0x5)['UNSIGNED'],'validate':{'min':0x1,'max':0x1869f},'defaultValue':0x96,'comment':_0xe009('0xb')},'dialBusyMaxRetry':{'type':Sequelize[_0xe009('0x7')](0x3)['UNSIGNED'],'defaultValue':0x3,'validate':{'min':0x1,'max':0x3e7},'comment':_0xe009('0xc')},'dialBusyRetryFrequency':{'type':Sequelize[_0xe009('0x7')](0x5)[_0xe009('0x8')],'validate':{'min':0x1,'max':0x1869f},'defaultValue':0x96,'comment':'Busy\x20Retry\x20Frequency\x20Minutes\x20(min:1,\x20max:99999)'},'dialNoAnswerMaxRetry':{'type':Sequelize[_0xe009('0x7')](0x3)[_0xe009('0x8')],'defaultValue':0x3,'comment':_0xe009('0xd')},'dialNoAnswerRetryFrequency':{'type':Sequelize['INTEGER'](0x5)[_0xe009('0x8')],'validate':{'min':0x1,'max':0x1869f},'defaultValue':0x96,'comment':_0xe009('0xe')},'dialGlobalMaxRetry':{'type':Sequelize['INTEGER'](0x3)[_0xe009('0x8')],'validate':{'min':0x1,'max':0x3e7},'defaultValue':0x4,'comment':_0xe009('0xf')},'dialTimezone':{'type':Sequelize['STRING'],'defaultValue':null},'dialGlobalInterval':{'type':Sequelize[_0xe009('0x4')],'defaultValue':'07:00-22:00,*,*,*'},'dialCheckDuplicateType':{'type':Sequelize[_0xe009('0x2')](_0xe009('0x10'),_0xe009('0x11'),_0xe009('0x12')),'defaultValue':_0xe009('0x10')},'dialAMDActive':{'type':Sequelize[_0xe009('0x5')],'defaultValue':0x0,'comment':_0xe009('0x13')},'dialAMDInitialSilence':{'type':Sequelize[_0xe009('0x7')](0x9)['UNSIGNED'],'defaultValue':0x9c4,'validate':{'min':0x0},'comment':_0xe009('0x14')},'dialAMDGreeting':{'type':Sequelize[_0xe009('0x7')](0x9)['UNSIGNED'],'defaultValue':0x5dc,'validate':{'min':0x0},'comment':_0xe009('0x15')},'dialAMDAfterGreetingSilence':{'type':Sequelize['INTEGER'](0x9)[_0xe009('0x8')],'defaultValue':0x320,'validate':{'min':0x0},'comment':_0xe009('0x16')},'dialAMDTotalAnalysisTime':{'type':Sequelize[_0xe009('0x7')](0x9)[_0xe009('0x8')],'defaultValue':0x1388,'validate':{'min':0x0},'comment':_0xe009('0x17')},'dialAMDMinWordLength':{'type':Sequelize[_0xe009('0x7')](0x9)[_0xe009('0x8')],'defaultValue':0x64,'validate':{'min':0x0},'comment':_0xe009('0x18')},'dialAMDBetweenWordsSilence':{'type':Sequelize[_0xe009('0x7')](0x9)[_0xe009('0x8')],'defaultValue':0x32,'validate':{'min':0x0},'comment':'#AMD\x20Between\x20Words\x20Silence'},'dialAMDMaximumNumberOfWords':{'type':Sequelize['INTEGER'](0x9)[_0xe009('0x8')],'defaultValue':0x3,'validate':{'min':0x0},'comment':_0xe009('0x19')},'dialAMDSilenceThreshold':{'type':Sequelize['INTEGER'](0x5)[_0xe009('0x8')],'validate':{'min':0x0,'max':0x7fff},'defaultValue':0x100,'comment':_0xe009('0x1a')},'dialAMDMaximumWordLength':{'type':Sequelize[_0xe009('0x7')](0x9)[_0xe009('0x8')],'defaultValue':0x1388,'validate':{'min':0x0},'comment':_0xe009('0x1b')},'dialOrderByScheduledAt':{'type':Sequelize[_0xe009('0x2')](_0xe009('0x1c'),_0xe009('0x1d')),'defaultValue':_0xe009('0x1c')},'dialPrefix':{'type':Sequelize['STRING'],'defaultValue':null},'dialRandomLastDigitCallerIdNumber':{'type':Sequelize[_0xe009('0x7')](0x3)[_0xe009('0x8')],'validate':{'min':0x0,'max':0xf},'defaultValue':0x0,'comment':_0xe009('0x1e')},'dialCutDigit':{'type':Sequelize[_0xe009('0x7')](0x3)[_0xe009('0x8')],'validate':{'min':0x0,'max':0xf},'defaultValue':0x0,'comment':_0xe009('0x1f')},'dialNoSuchNumberMaxRetry':{'type':Sequelize[_0xe009('0x7')](0x3)[_0xe009('0x8')],'defaultValue':0x3,'validate':{'min':0x1,'max':0x3e7},'comment':_0xe009('0x20')},'dialNoSuchNumberRetryFrequency':{'type':Sequelize[_0xe009('0x7')](0x5)[_0xe009('0x8')],'validate':{'min':0x1,'max':0x1869f},'defaultValue':0x96,'comment':_0xe009('0x21')},'dialDropMaxRetry':{'type':Sequelize[_0xe009('0x7')](0x3)[_0xe009('0x8')],'defaultValue':0x3,'validate':{'min':0x1,'max':0x3e7},'comment':_0xe009('0x22')},'dialDropRetryFrequency':{'type':Sequelize[_0xe009('0x7')](0x5)[_0xe009('0x8')],'validate':{'min':0x1,'max':0x1869f},'defaultValue':0x96,'comment':'Drop\x20Retry\x20Frequency\x20Minutes\x20(min:1,\x20max:99999)'},'dialAbandonedMaxRetry':{'type':Sequelize[_0xe009('0x7')](0x3)[_0xe009('0x8')],'defaultValue':0x3,'validate':{'min':0x1,'max':0x3e7},'comment':_0xe009('0x23')},'dialAbandonedRetryFrequency':{'type':Sequelize[_0xe009('0x7')](0x5)['UNSIGNED'],'validate':{'min':0x1,'max':0x1869f},'defaultValue':0x96,'comment':_0xe009('0x24')},'dialMachineMaxRetry':{'type':Sequelize[_0xe009('0x7')](0x3)[_0xe009('0x8')],'defaultValue':0x3,'validate':{'min':0x1,'max':0x3e7},'comment':'#Machine\x20Retry\x20(min:1,\x20max:999)'},'dialMachineRetryFrequency':{'type':Sequelize[_0xe009('0x7')](0x5)[_0xe009('0x8')],'validate':{'min':0x1,'max':0x1869f},'defaultValue':0x96,'comment':_0xe009('0x25')},'dialAgentRejectMaxRetry':{'type':Sequelize[_0xe009('0x7')](0x3)[_0xe009('0x8')],'defaultValue':0x3,'validate':{'min':0x1,'max':0x3e7},'comment':'#AgentReject\x20Retry\x20(min:1,\x20max:999)'},'dialAgentRejectRetryFrequency':{'type':Sequelize[_0xe009('0x7')](0x5)[_0xe009('0x8')],'validate':{'min':0x1,'max':0x1869f},'defaultValue':0x96,'comment':'AgentReject\x20Retry\x20Frequency\x20Minutes\x20(min:1,\x20max:99999)'}};
\ No newline at end of file
+var _0x2330=['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\x20Frequency\x20Minutes\x20(min:1,\x20max:99999)','sequelize','name','ENUM','ivr','STRING','BOOLEAN','Active/Disactive\x20Campaign','UNSIGNED','INTEGER','Originate\x20Timeout\x20Seconds\x20(min:1,\x20max:999)','#Congestion\x20Retry\x20(min:1,\x20max:999)','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\x20Between\x20Words\x20Silence','#AMD\x20Silence\x20Threshold\x20(min:0,\x20max:32767)','#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\x20(min:1,\x20max:999)'];(function(_0x1391a8,_0x4e2f7f){var _0x1e3519=function(_0x1ad406){while(--_0x1ad406){_0x1391a8['push'](_0x1391a8['shift']());}};_0x1e3519(++_0x4e2f7f);}(_0x2330,0x1cc));var _0x0233=function(_0x1440ce,_0x136aee){_0x1440ce=_0x1440ce-0x0;var _0x389c35=_0x2330[_0x1440ce];return _0x389c35;};'use strict';var Sequelize=require(_0x0233('0x0'));module['exports']={'name':{'type':Sequelize['STRING'],'unique':_0x0233('0x1'),'allowNull':![],'validate':{'is':/[A-Za-z0-9._\\+*!-]+/,'notEmpty':!![]}},'type':{'type':Sequelize[_0x0233('0x2')](_0x0233('0x3')),'allowNull':![],'defaultValue':_0x0233('0x3')},'description':{'type':Sequelize[_0x0233('0x4')]},'active':{'type':Sequelize[_0x0233('0x5')],'defaultValue':0x0,'comment':_0x0233('0x6')},'limitCalls':{'type':Sequelize['INTEGER'](0x4)[_0x0233('0x7')],'defaultValue':0x1e,'validate':{'min':0x1,'max':0xc8},'comment':'Max\x20200\x20calls.'},'dialOriginateCallerIdName':{'type':Sequelize[_0x0233('0x4')]},'dialOriginateCallerIdNumber':{'type':Sequelize[_0x0233('0x4')]},'dialOriginateTimeout':{'type':Sequelize[_0x0233('0x8')](0x3)['UNSIGNED'],'defaultValue':0x1e,'validate':{'min':0x1,'max':0x3e7},'comment':_0x0233('0x9')},'dialCongestionMaxRetry':{'type':Sequelize[_0x0233('0x8')](0x3)[_0x0233('0x7')],'defaultValue':0x3,'validate':{'min':0x1,'max':0x3e7},'comment':_0x0233('0xa')},'dialCongestionRetryFrequency':{'type':Sequelize[_0x0233('0x8')](0x5)['UNSIGNED'],'validate':{'min':0x1,'max':0x1869f},'defaultValue':0x96,'comment':_0x0233('0xb')},'dialBusyMaxRetry':{'type':Sequelize[_0x0233('0x8')](0x3)[_0x0233('0x7')],'defaultValue':0x3,'validate':{'min':0x1,'max':0x3e7},'comment':_0x0233('0xc')},'dialBusyRetryFrequency':{'type':Sequelize[_0x0233('0x8')](0x5)[_0x0233('0x7')],'validate':{'min':0x1,'max':0x1869f},'defaultValue':0x96,'comment':_0x0233('0xd')},'dialNoAnswerMaxRetry':{'type':Sequelize[_0x0233('0x8')](0x3)[_0x0233('0x7')],'defaultValue':0x3,'comment':_0x0233('0xe')},'dialNoAnswerRetryFrequency':{'type':Sequelize['INTEGER'](0x5)[_0x0233('0x7')],'validate':{'min':0x1,'max':0x1869f},'defaultValue':0x96,'comment':_0x0233('0xf')},'dialGlobalMaxRetry':{'type':Sequelize['INTEGER'](0x3)[_0x0233('0x7')],'validate':{'min':0x1,'max':0x3e7},'defaultValue':0x4,'comment':_0x0233('0x10')},'dialTimezone':{'type':Sequelize['STRING'],'defaultValue':null},'dialGlobalInterval':{'type':Sequelize['STRING'],'defaultValue':_0x0233('0x11')},'dialCheckDuplicateType':{'type':Sequelize['ENUM'](_0x0233('0x12'),'never',_0x0233('0x13')),'defaultValue':_0x0233('0x12')},'dialAMDActive':{'type':Sequelize[_0x0233('0x5')],'defaultValue':0x0,'comment':'Active/Disactive\x20AMD'},'dialAMDInitialSilence':{'type':Sequelize['INTEGER'](0x9)[_0x0233('0x7')],'defaultValue':0x9c4,'validate':{'min':0x0},'comment':_0x0233('0x14')},'dialAMDGreeting':{'type':Sequelize['INTEGER'](0x9)[_0x0233('0x7')],'defaultValue':0x5dc,'validate':{'min':0x0},'comment':_0x0233('0x15')},'dialAMDAfterGreetingSilence':{'type':Sequelize[_0x0233('0x8')](0x9)[_0x0233('0x7')],'defaultValue':0x320,'validate':{'min':0x0},'comment':_0x0233('0x16')},'dialAMDTotalAnalysisTime':{'type':Sequelize[_0x0233('0x8')](0x9)[_0x0233('0x7')],'defaultValue':0x1388,'validate':{'min':0x0},'comment':_0x0233('0x17')},'dialAMDMinWordLength':{'type':Sequelize['INTEGER'](0x9)['UNSIGNED'],'defaultValue':0x64,'validate':{'min':0x0},'comment':'#AMD\x20Min\x20Word\x20Length'},'dialAMDBetweenWordsSilence':{'type':Sequelize[_0x0233('0x8')](0x9)[_0x0233('0x7')],'defaultValue':0x32,'validate':{'min':0x0},'comment':_0x0233('0x18')},'dialAMDMaximumNumberOfWords':{'type':Sequelize['INTEGER'](0x9)['UNSIGNED'],'defaultValue':0x3,'validate':{'min':0x0},'comment':'#AMD\x20Maximum\x20Number\x20Of\x20Words'},'dialAMDSilenceThreshold':{'type':Sequelize['INTEGER'](0x5)[_0x0233('0x7')],'validate':{'min':0x0,'max':0x7fff},'defaultValue':0x100,'comment':_0x0233('0x19')},'dialAMDMaximumWordLength':{'type':Sequelize[_0x0233('0x8')](0x9)['UNSIGNED'],'defaultValue':0x1388,'validate':{'min':0x0},'comment':_0x0233('0x1a')},'dialOrderByScheduledAt':{'type':Sequelize[_0x0233('0x2')](_0x0233('0x1b'),_0x0233('0x1c')),'defaultValue':'DESC'},'dialPrefix':{'type':Sequelize[_0x0233('0x4')],'defaultValue':null},'dialRandomLastDigitCallerIdNumber':{'type':Sequelize[_0x0233('0x8')](0x3)[_0x0233('0x7')],'validate':{'min':0x0,'max':0xf},'defaultValue':0x0,'comment':_0x0233('0x1d')},'dialCutDigit':{'type':Sequelize[_0x0233('0x8')](0x3)[_0x0233('0x7')],'validate':{'min':0x0,'max':0xf},'defaultValue':0x0,'comment':_0x0233('0x1e')},'dialNoSuchNumberMaxRetry':{'type':Sequelize[_0x0233('0x8')](0x3)[_0x0233('0x7')],'defaultValue':0x3,'validate':{'min':0x1,'max':0x3e7},'comment':_0x0233('0x1f')},'dialNoSuchNumberRetryFrequency':{'type':Sequelize[_0x0233('0x8')](0x5)[_0x0233('0x7')],'validate':{'min':0x1,'max':0x1869f},'defaultValue':0x96,'comment':_0x0233('0x20')},'dialDropMaxRetry':{'type':Sequelize[_0x0233('0x8')](0x3)[_0x0233('0x7')],'defaultValue':0x3,'validate':{'min':0x1,'max':0x3e7},'comment':_0x0233('0x21')},'dialDropRetryFrequency':{'type':Sequelize[_0x0233('0x8')](0x5)[_0x0233('0x7')],'validate':{'min':0x1,'max':0x1869f},'defaultValue':0x96,'comment':_0x0233('0x22')},'dialAbandonedMaxRetry':{'type':Sequelize[_0x0233('0x8')](0x3)[_0x0233('0x7')],'defaultValue':0x3,'validate':{'min':0x1,'max':0x3e7},'comment':_0x0233('0x23')},'dialAbandonedRetryFrequency':{'type':Sequelize[_0x0233('0x8')](0x5)[_0x0233('0x7')],'validate':{'min':0x1,'max':0x1869f},'defaultValue':0x96,'comment':_0x0233('0x24')},'dialMachineMaxRetry':{'type':Sequelize[_0x0233('0x8')](0x3)['UNSIGNED'],'defaultValue':0x3,'validate':{'min':0x1,'max':0x3e7},'comment':'#Machine\x20Retry\x20(min:1,\x20max:999)'},'dialMachineRetryFrequency':{'type':Sequelize[_0x0233('0x8')](0x5)[_0x0233('0x7')],'validate':{'min':0x1,'max':0x1869f},'defaultValue':0x96,'comment':'Machine\x20Retry\x20Frequency\x20Minutes\x20(min:1,\x20max:99999)'},'dialAgentRejectMaxRetry':{'type':Sequelize[_0x0233('0x8')](0x3)['UNSIGNED'],'defaultValue':0x3,'validate':{'min':0x1,'max':0x3e7},'comment':'#AgentReject\x20Retry\x20(min:1,\x20max:999)'},'dialAgentRejectRetryFrequency':{'type':Sequelize[_0x0233('0x8')](0x5)[_0x0233('0x7')],'validate':{'min':0x1,'max':0x1869f},'defaultValue':0x96,'comment':_0x0233('0x25')}};
\ No newline at end of file
diff --git a/server/api/campaign/campaign.controller.js b/server/api/campaign/campaign.controller.js
index 1821e1d..5849f9c 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 _0x54ef=['rimraf','fast-json-patch','request-promise','moment','bluebird','mustache','util','path','ejs','lodash','squel','jsforce','to-csv','querystring','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/logger','api','../../config/utils','../../config/environment','sendStatus','status','end','json','count','offset','limit','set','Content-Range','apply','save','update','then','destroy','UserProfileResource','stack','name','send','index','Campaign','rawAttributes','fieldName','type','key','model','map','query','filters','intersection','attributes','length','sort','where','pick','merge','VIRTUAL','filter','options','findAll','rows','show','params','keys','fields','includeAll','find','catch','create','user','get','Unable\x20to\x20retrieve\x20the\x20current\x20user','role','IvrCampaigns','UserProfileSection','userProfileId','autoAssociation','error','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','clone','include','omit','updatedAt','createdAt','body','getHoppers','nolimit','order','CampaignId','getHopperHistories','findOne','CmHopperHistory','hasOwnProperty','getHopperFinals','CmHopperFinal','getHopperBlacks','CmHopperBlack','getLists','addLists','ids','spread','dialCheckDuplicateType','insert','into','fromQuery','scheduledAt','ContactId','ListId','select','phone','field','NOW()','CmListId','toString','from','cm_contacts','deletedAt\x20IS\x20NULL','ListId\x20=\x20?','phone\x20IS\x20NOT\x20NULL','phone\x20NOT\x20IN\x20(?)','COALESCE(calleridnum,\x27\x27)','cm_hopper_final','CampaignId\x20=\x20?','onlyIfOpen','cm_hopper','push','sequelize','all','removeLists','CmHopper','getBlackLists','CmList','addBlackLists','cm_hopper_black','removeBlackLists','html-pdf','eml-format'];(function(_0x3dd15e,_0x1f0015){var _0x231fd0=function(_0x4f680a){while(--_0x4f680a){_0x3dd15e['push'](_0x3dd15e['shift']());}};_0x231fd0(++_0x1f0015);}(_0x54ef,0x112));var _0xf54e=function(_0x2c88a3,_0x270dc7){_0x2c88a3=_0x2c88a3-0x0;var _0xdbba39=_0x54ef[_0x2c88a3];return _0xdbba39;};'use strict';var pdf=require(_0xf54e('0x0'));var emlformat=require(_0xf54e('0x1'));var rimraf=require(_0xf54e('0x2'));var zipdir=require('zip-dir');var jsonpatch=require(_0xf54e('0x3'));var rp=require(_0xf54e('0x4'));var moment=require(_0xf54e('0x5'));var BPromise=require(_0xf54e('0x6'));var Mustache=require(_0xf54e('0x7'));var util=require(_0xf54e('0x8'));var path=require(_0xf54e('0x9'));var sox=require('sox');var csv=require('to-csv');var ejs=require(_0xf54e('0xa'));var fs=require('fs');var _=require(_0xf54e('0xb'));var squel=require(_0xf54e('0xc'));var crypto=require('crypto');var jsforce=require(_0xf54e('0xd'));var deskjs=require('desk.js');var toCsv=require(_0xf54e('0xe'));var querystring=require(_0xf54e('0xf'));var Papa=require('papaparse');var Redis=require(_0xf54e('0x10'));var authService=require(_0xf54e('0x11'));var qs=require(_0xf54e('0x12'));var as=require(_0xf54e('0x13'));var hardwareService=require('../../config/license/hardware');var logger=require(_0xf54e('0x14'))(_0xf54e('0x15'));var utils=require(_0xf54e('0x16'));var config=require(_0xf54e('0x17'));var db=require('../../mysqldb')['db'];function respondWithStatusCode(_0x358c88,_0x4b0ee1){_0x4b0ee1=_0x4b0ee1||0xcc;return function(_0x4bd828){if(_0x4bd828){return _0x358c88[_0xf54e('0x18')](_0x4b0ee1);}return _0x358c88[_0xf54e('0x19')](_0x4b0ee1)[_0xf54e('0x1a')]();};}function respondWithResult(_0x380f26,_0x5644aa){_0x5644aa=_0x5644aa||0xc8;return function(_0x331732){if(_0x331732){return _0x380f26[_0xf54e('0x19')](_0x5644aa)[_0xf54e('0x1b')](_0x331732);}};}function respondWithFilteredResult(_0x15f639,_0x56828e){return function(_0x2366ee){if(_0x2366ee){var _0x389abc=_0x2366ee[_0xf54e('0x1c')],_0x3eb415=_0x56828e[_0xf54e('0x1d')],_0x5c5d00=_0x56828e[_0xf54e('0x1d')]+_0x56828e[_0xf54e('0x1e')],_0x4af633;if(_0x5c5d00>=_0x389abc){_0x5c5d00=_0x389abc;_0x4af633=0xc8;}else{_0x4af633=0xce;}_0x15f639[_0xf54e('0x19')](_0x4af633);return _0x15f639[_0xf54e('0x1f')](_0xf54e('0x20'),_0x3eb415+'-'+_0x5c5d00+'/'+_0x389abc)[_0xf54e('0x1b')](_0x2366ee);}return null;};}function patchUpdates(_0x1dcc04){return function(_0x4689fe){try{jsonpatch[_0xf54e('0x21')](_0x4689fe,_0x1dcc04,!![]);}catch(_0x50fc66){return BPromise['reject'](_0x50fc66);}return _0x4689fe[_0xf54e('0x22')]();};}function saveUpdates(_0x59f338,_0x3e1556){return function(_0x1bfe99){if(_0x1bfe99){return _0x1bfe99[_0xf54e('0x23')](_0x59f338)[_0xf54e('0x24')](function(_0xf64f12){return _0xf64f12;});}return null;};}function removeEntity(_0x3887b0,_0x388aa0){return function(_0x11985e){if(_0x11985e){return _0x11985e[_0xf54e('0x25')]()[_0xf54e('0x24')](function(){var _0x1c58bd=_0x11985e['get']({'plain':!![]});var _0x6f6d29='IvrCampaigns';return db[_0xf54e('0x26')][_0xf54e('0x25')]({'where':{'type':_0x6f6d29,'resourceId':_0x1c58bd['id']}})[_0xf54e('0x24')](function(){return _0x11985e;});})[_0xf54e('0x24')](function(){_0x3887b0[_0xf54e('0x19')](0xcc)[_0xf54e('0x1a')]();});}};}function handleEntityNotFound(_0x1e08d1,_0x43488d){return function(_0x2342a9){if(!_0x2342a9){_0x1e08d1[_0xf54e('0x18')](0x194);}return _0x2342a9;};}function handleError(_0xf6cdd7,_0x39c0ae){_0x39c0ae=_0x39c0ae||0x1f4;return function(_0x2ea001){logger['error'](_0x2ea001[_0xf54e('0x27')]);if(_0x2ea001['name']){delete _0x2ea001[_0xf54e('0x28')];}_0xf6cdd7['status'](_0x39c0ae)[_0xf54e('0x29')](_0x2ea001);};}exports[_0xf54e('0x2a')]=function(_0x21ba00,_0xa13cd0){var _0x25b643={},_0x3993e4={},_0x36f985={'count':0x0,'rows':[]};var _0x54bd8f=_['map'](db[_0xf54e('0x2b')][_0xf54e('0x2c')],function(_0x2ec92e){return{'name':_0x2ec92e[_0xf54e('0x2d')],'type':_0x2ec92e[_0xf54e('0x2e')][_0xf54e('0x2f')]};});_0x3993e4[_0xf54e('0x30')]=_[_0xf54e('0x31')](_0x54bd8f,_0xf54e('0x28'));_0x3993e4[_0xf54e('0x32')]=_['keys'](_0x21ba00['query']);_0x3993e4[_0xf54e('0x33')]=_[_0xf54e('0x34')](_0x3993e4['model'],_0x3993e4[_0xf54e('0x32')]);_0x25b643[_0xf54e('0x35')]=_[_0xf54e('0x34')](_0x3993e4[_0xf54e('0x30')],qs['fields'](_0x21ba00['query']['fields']));_0x25b643[_0xf54e('0x35')]=_0x25b643[_0xf54e('0x35')][_0xf54e('0x36')]?_0x25b643[_0xf54e('0x35')]:_0x3993e4[_0xf54e('0x30')];if(!_0x21ba00[_0xf54e('0x32')]['hasOwnProperty']('nolimit')){_0x25b643['limit']=qs[_0xf54e('0x1e')](_0x21ba00[_0xf54e('0x32')]['limit']);_0x25b643['offset']=qs[_0xf54e('0x1d')](_0x21ba00[_0xf54e('0x32')][_0xf54e('0x1d')]);}_0x25b643['order']=qs[_0xf54e('0x37')](_0x21ba00[_0xf54e('0x32')]['sort']);_0x25b643[_0xf54e('0x38')]=qs[_0xf54e('0x33')](_[_0xf54e('0x39')](_0x21ba00[_0xf54e('0x32')],_0x3993e4[_0xf54e('0x33')]));if(_0x21ba00[_0xf54e('0x32')]['filter']){_0x25b643['where']=_[_0xf54e('0x3a')](_0x25b643[_0xf54e('0x38')],{'$or':_[_0xf54e('0x31')](_0x54bd8f,function(_0x4b1f84){if(_0x4b1f84[_0xf54e('0x2e')]!==_0xf54e('0x3b')){var _0x448054={};_0x448054[_0x4b1f84[_0xf54e('0x28')]]={'$like':'%'+_0x21ba00[_0xf54e('0x32')][_0xf54e('0x3c')]+'%'};return _0x448054;}})});}_0x25b643=_[_0xf54e('0x3a')]({},_0x25b643,_0x21ba00[_0xf54e('0x3d')]);var _0x8b4c={'where':_0x25b643[_0xf54e('0x38')]};return db[_0xf54e('0x2b')][_0xf54e('0x1c')](_0x8b4c)[_0xf54e('0x24')](function(_0x2625fd){_0x36f985[_0xf54e('0x1c')]=_0x2625fd;if(_0x21ba00['query']['includeAll']){_0x25b643['include']=[{'all':!![]}];}return db[_0xf54e('0x2b')][_0xf54e('0x3e')](_0x25b643);})['then'](function(_0x3dae9b){_0x36f985[_0xf54e('0x3f')]=_0x3dae9b;return _0x36f985;})[_0xf54e('0x24')](respondWithFilteredResult(_0xa13cd0,_0x25b643))['catch'](handleError(_0xa13cd0,null));};exports[_0xf54e('0x40')]=function(_0x13d145,_0x1e016e){var _0x794be7={'raw':![],'where':{'id':_0x13d145[_0xf54e('0x41')]['id']}},_0x4b1931={};_0x4b1931[_0xf54e('0x30')]=_[_0xf54e('0x42')](db[_0xf54e('0x2b')]['rawAttributes']);_0x4b1931[_0xf54e('0x32')]=_[_0xf54e('0x42')](_0x13d145[_0xf54e('0x32')]);_0x4b1931[_0xf54e('0x33')]=_[_0xf54e('0x34')](_0x4b1931[_0xf54e('0x30')],_0x4b1931['query']);_0x794be7[_0xf54e('0x35')]=_['intersection'](_0x4b1931[_0xf54e('0x30')],qs['fields'](_0x13d145[_0xf54e('0x32')][_0xf54e('0x43')]));_0x794be7[_0xf54e('0x35')]=_0x794be7['attributes'][_0xf54e('0x36')]?_0x794be7[_0xf54e('0x35')]:_0x4b1931[_0xf54e('0x30')];if(_0x13d145[_0xf54e('0x32')][_0xf54e('0x44')]){_0x794be7['include']=[{'all':!![]}];}_0x794be7=_[_0xf54e('0x3a')]({},_0x794be7,_0x13d145[_0xf54e('0x3d')]);return db[_0xf54e('0x2b')][_0xf54e('0x45')](_0x794be7)['then'](handleEntityNotFound(_0x1e016e,null))[_0xf54e('0x24')](respondWithResult(_0x1e016e,null))[_0xf54e('0x46')](handleError(_0x1e016e,null));};exports['create']=function(_0x22c842,_0xd4d956){return db[_0xf54e('0x2b')][_0xf54e('0x47')](_0x22c842['body'],{})[_0xf54e('0x24')](function(_0x2b645e){var _0x2527f6=_0x22c842[_0xf54e('0x48')][_0xf54e('0x49')]({'plain':!![]});if(!_0x2527f6)throw new Error(_0xf54e('0x4a'));if(_0x2527f6[_0xf54e('0x4b')]===_0xf54e('0x48')){var _0x15bfef=_0x2b645e[_0xf54e('0x49')]({'plain':!![]});var _0xaf9bf0=_0xf54e('0x4c');return db[_0xf54e('0x4d')][_0xf54e('0x45')]({'where':{'name':_0xaf9bf0,'userProfileId':_0x2527f6[_0xf54e('0x4e')]},'raw':!![]})[_0xf54e('0x24')](function(_0x40d8ab){if(_0x40d8ab&&_0x40d8ab[_0xf54e('0x4f')]===0x0){return db[_0xf54e('0x26')][_0xf54e('0x47')]({'name':_0x15bfef['name'],'resourceId':_0x15bfef['id'],'type':_0x40d8ab['name'],'sectionId':_0x40d8ab['id']},{})[_0xf54e('0x24')](function(){return _0x2b645e;});}else{return _0x2b645e;}})[_0xf54e('0x46')](function(_0x45861b){logger[_0xf54e('0x50')](_0xf54e('0x51'),_0x45861b);throw _0x45861b;});}return _0x2b645e;})[_0xf54e('0x24')](respondWithResult(_0xd4d956,0xc9))[_0xf54e('0x46')](handleError(_0xd4d956,null));};exports[_0xf54e('0x52')]=function(_0x89b811,_0xdf63c4){var _0x1df308={'where':{'id':_0x89b811[_0xf54e('0x41')]['id']}},_0x59c313={};_0x59c313[_0xf54e('0x30')]=_[_0xf54e('0x42')](db[_0xf54e('0x2b')][_0xf54e('0x2c')]);_0x1df308[_0xf54e('0x35')]=_[_0xf54e('0x34')](_0x59c313['model'],qs[_0xf54e('0x43')](_0x89b811[_0xf54e('0x32')][_0xf54e('0x43')]));_0x1df308['attributes']=_0x1df308[_0xf54e('0x35')]['length']?_0x1df308[_0xf54e('0x35')]:_0x59c313[_0xf54e('0x30')];if(_0x89b811[_0xf54e('0x32')]['includeAll']){_0x1df308[_0xf54e('0x53')]=[{'all':!![]}];}_0x1df308=_[_0xf54e('0x3a')]({},_0x1df308,_0x89b811[_0xf54e('0x3d')]);return db[_0xf54e('0x2b')][_0xf54e('0x45')](_0x1df308)[_0xf54e('0x24')](handleEntityNotFound(_0xdf63c4,null))[_0xf54e('0x24')](function(_0x55d57f){if(_0x55d57f){var _0x55de5c=_0x55d57f[_0xf54e('0x49')]({'plain':!![]});_0x55de5c=qs[_0xf54e('0x54')](_0x55de5c,['id','createdAt',_0xf54e('0x55')]);_0x89b811['body']=_[_0xf54e('0x54')](_0x89b811['body'],['id',_0xf54e('0x56'),_0xf54e('0x55')]);return db[_0xf54e('0x2b')][_0xf54e('0x47')](_[_0xf54e('0x3a')](_0x55de5c,_0x89b811[_0xf54e('0x57')]),{'include':_0x89b811['query']['includeAll']?[{'all':!![]}]:undefined})[_0xf54e('0x24')](function(_0x2b273d){var _0x493011=_0x89b811['user'][_0xf54e('0x49')]({'plain':!![]});if(!_0x493011)throw new Error('Unable\x20to\x20retrieve\x20the\x20current\x20user');if(_0x493011[_0xf54e('0x4b')]===_0xf54e('0x48')){var _0x47596c=_0x2b273d[_0xf54e('0x49')]({'plain':!![]});var _0x1d7c52=_0xf54e('0x4c');return db[_0xf54e('0x4d')][_0xf54e('0x45')]({'where':{'name':_0x1d7c52,'userProfileId':_0x493011[_0xf54e('0x4e')]},'raw':!![]})[_0xf54e('0x24')](function(_0x1f9dad){if(_0x1f9dad&&_0x1f9dad[_0xf54e('0x4f')]===0x0){return db[_0xf54e('0x26')][_0xf54e('0x47')]({'name':_0x47596c['name'],'resourceId':_0x47596c['id'],'type':_0x1f9dad[_0xf54e('0x28')],'sectionId':_0x1f9dad['id']},{})[_0xf54e('0x24')](function(){return _0x2b273d;});}else{return _0x2b273d;}})[_0xf54e('0x46')](function(_0x11908b){logger[_0xf54e('0x50')]('Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s',_0x11908b);throw _0x11908b;});}return _0x2b273d;});}})[_0xf54e('0x24')](respondWithResult(_0xdf63c4,0xc9))[_0xf54e('0x46')](handleError(_0xdf63c4,null));};exports['update']=function(_0x51ec35,_0x2818cf){if(_0x51ec35['body']['id']){delete _0x51ec35[_0xf54e('0x57')]['id'];}return db[_0xf54e('0x2b')][_0xf54e('0x45')]({'where':{'id':_0x51ec35[_0xf54e('0x41')]['id']}})['then'](handleEntityNotFound(_0x2818cf,null))[_0xf54e('0x24')](saveUpdates(_0x51ec35['body'],null))[_0xf54e('0x24')](respondWithResult(_0x2818cf,null))[_0xf54e('0x46')](handleError(_0x2818cf,null));};exports[_0xf54e('0x25')]=function(_0x5de2f5,_0x2d04db){return db['Campaign'][_0xf54e('0x45')]({'where':{'id':_0x5de2f5[_0xf54e('0x41')]['id']}})['then'](handleEntityNotFound(_0x2d04db,null))[_0xf54e('0x24')](removeEntity(_0x2d04db,null))['catch'](handleError(_0x2d04db,null));};exports[_0xf54e('0x58')]=function(_0x2df028,_0x33acd3,_0x38405c){var _0x21159f={'raw':!![],'where':{}};var _0x54ee29={};var _0x3a9dd7={'count':0x0,'rows':[]};return db[_0xf54e('0x2b')]['findOne']({'where':{'id':_0x2df028[_0xf54e('0x41')]['id']}})[_0xf54e('0x24')](handleEntityNotFound(_0x33acd3,null))['then'](function(_0x8e7a38){if(_0x8e7a38){_0x54ee29[_0xf54e('0x30')]=_[_0xf54e('0x42')](db['CmHopper'][_0xf54e('0x2c')]);_0x54ee29['query']=_[_0xf54e('0x42')](_0x2df028[_0xf54e('0x32')]);_0x54ee29['filters']=_[_0xf54e('0x34')](_0x54ee29[_0xf54e('0x30')],_0x54ee29[_0xf54e('0x32')]);_0x21159f[_0xf54e('0x35')]=_[_0xf54e('0x34')](_0x54ee29[_0xf54e('0x30')],qs[_0xf54e('0x43')](_0x2df028[_0xf54e('0x32')][_0xf54e('0x43')]));_0x21159f[_0xf54e('0x35')]=_0x21159f[_0xf54e('0x35')]['length']?_0x21159f[_0xf54e('0x35')]:_0x54ee29[_0xf54e('0x30')];if(!_0x2df028[_0xf54e('0x32')]['hasOwnProperty'](_0xf54e('0x59'))){_0x21159f[_0xf54e('0x1e')]=qs[_0xf54e('0x1e')](_0x2df028[_0xf54e('0x32')][_0xf54e('0x1e')]);_0x21159f[_0xf54e('0x1d')]=qs[_0xf54e('0x1d')](_0x2df028['query'][_0xf54e('0x1d')]);}_0x21159f[_0xf54e('0x5a')]=qs[_0xf54e('0x37')](_0x2df028['query'][_0xf54e('0x37')]);_0x21159f[_0xf54e('0x38')]=qs[_0xf54e('0x33')](_[_0xf54e('0x39')](_0x2df028['query'],_0x54ee29['filters']));_0x21159f[_0xf54e('0x38')][_0xf54e('0x5b')]=_0x8e7a38['id'];if(_0x2df028[_0xf54e('0x32')][_0xf54e('0x3c')]){_0x21159f[_0xf54e('0x38')]=_[_0xf54e('0x3a')](_0x21159f[_0xf54e('0x38')],{'$or':_[_0xf54e('0x31')](_0x21159f[_0xf54e('0x35')],function(_0x205b47){var _0x4e6f8f={};_0x4e6f8f[_0x205b47]={'$like':'%'+_0x2df028[_0xf54e('0x32')][_0xf54e('0x3c')]+'%'};return _0x4e6f8f;})});}_0x21159f=_[_0xf54e('0x3a')]({},_0x21159f,_0x2df028[_0xf54e('0x3d')]);return db['CmHopper'][_0xf54e('0x1c')]({'where':_0x21159f[_0xf54e('0x38')]})[_0xf54e('0x24')](function(_0x213206){_0x3a9dd7['count']=_0x213206;if(_0x2df028[_0xf54e('0x32')][_0xf54e('0x44')]){_0x21159f[_0xf54e('0x53')]=[{'all':!![]}];}return db['CmHopper']['findAll'](_0x21159f);})[_0xf54e('0x24')](function(_0x1a5a77){_0x3a9dd7[_0xf54e('0x3f')]=_0x1a5a77;return _0x3a9dd7;});}})[_0xf54e('0x24')](respondWithFilteredResult(_0x33acd3,_0x21159f))[_0xf54e('0x46')](handleError(_0x33acd3,null));};exports[_0xf54e('0x5c')]=function(_0x2b42f5,_0x824202,_0x8093bc){var _0x4adf60={'raw':!![],'where':{}};var _0xa5de47={};var _0x3edfa0={'count':0x0,'rows':[]};return db[_0xf54e('0x2b')][_0xf54e('0x5d')]({'where':{'id':_0x2b42f5[_0xf54e('0x41')]['id']}})[_0xf54e('0x24')](handleEntityNotFound(_0x824202,null))[_0xf54e('0x24')](function(_0x9a8f4f){if(_0x9a8f4f){_0xa5de47[_0xf54e('0x30')]=_[_0xf54e('0x42')](db[_0xf54e('0x5e')][_0xf54e('0x2c')]);_0xa5de47['query']=_[_0xf54e('0x42')](_0x2b42f5[_0xf54e('0x32')]);_0xa5de47['filters']=_['intersection'](_0xa5de47[_0xf54e('0x30')],_0xa5de47[_0xf54e('0x32')]);_0x4adf60[_0xf54e('0x35')]=_[_0xf54e('0x34')](_0xa5de47[_0xf54e('0x30')],qs[_0xf54e('0x43')](_0x2b42f5[_0xf54e('0x32')][_0xf54e('0x43')]));_0x4adf60[_0xf54e('0x35')]=_0x4adf60['attributes'][_0xf54e('0x36')]?_0x4adf60[_0xf54e('0x35')]:_0xa5de47[_0xf54e('0x30')];if(!_0x2b42f5['query'][_0xf54e('0x5f')]('nolimit')){_0x4adf60[_0xf54e('0x1e')]=qs['limit'](_0x2b42f5[_0xf54e('0x32')][_0xf54e('0x1e')]);_0x4adf60['offset']=qs['offset'](_0x2b42f5[_0xf54e('0x32')][_0xf54e('0x1d')]);}_0x4adf60[_0xf54e('0x5a')]=qs[_0xf54e('0x37')](_0x2b42f5[_0xf54e('0x32')]['sort']);_0x4adf60['where']=qs[_0xf54e('0x33')](_[_0xf54e('0x39')](_0x2b42f5[_0xf54e('0x32')],_0xa5de47[_0xf54e('0x33')]));_0x4adf60[_0xf54e('0x38')][_0xf54e('0x5b')]=_0x9a8f4f['id'];if(_0x2b42f5[_0xf54e('0x32')][_0xf54e('0x3c')]){_0x4adf60[_0xf54e('0x38')]=_[_0xf54e('0x3a')](_0x4adf60['where'],{'$or':_[_0xf54e('0x31')](_0x4adf60[_0xf54e('0x35')],function(_0x4d4667){var _0x4fd274={};_0x4fd274[_0x4d4667]={'$like':'%'+_0x2b42f5[_0xf54e('0x32')][_0xf54e('0x3c')]+'%'};return _0x4fd274;})});}_0x4adf60=_[_0xf54e('0x3a')]({},_0x4adf60,_0x2b42f5[_0xf54e('0x3d')]);return db[_0xf54e('0x5e')]['count']({'where':_0x4adf60[_0xf54e('0x38')]})[_0xf54e('0x24')](function(_0xd631af){_0x3edfa0[_0xf54e('0x1c')]=_0xd631af;if(_0x2b42f5['query'][_0xf54e('0x44')]){_0x4adf60[_0xf54e('0x53')]=[{'all':!![]}];}return db[_0xf54e('0x5e')][_0xf54e('0x3e')](_0x4adf60);})['then'](function(_0x289946){_0x3edfa0[_0xf54e('0x3f')]=_0x289946;return _0x3edfa0;});}})[_0xf54e('0x24')](respondWithFilteredResult(_0x824202,_0x4adf60))[_0xf54e('0x46')](handleError(_0x824202,null));};exports[_0xf54e('0x60')]=function(_0x4daac7,_0x2cb0cd,_0x536202){var _0x54cb92={'raw':!![],'where':{}};var _0x963253={};var _0x2d3d16={'count':0x0,'rows':[]};return db[_0xf54e('0x2b')][_0xf54e('0x5d')]({'where':{'id':_0x4daac7[_0xf54e('0x41')]['id']}})[_0xf54e('0x24')](handleEntityNotFound(_0x2cb0cd,null))[_0xf54e('0x24')](function(_0x7ad573){if(_0x7ad573){_0x963253[_0xf54e('0x30')]=_['keys'](db[_0xf54e('0x61')][_0xf54e('0x2c')]);_0x963253[_0xf54e('0x32')]=_[_0xf54e('0x42')](_0x4daac7[_0xf54e('0x32')]);_0x963253[_0xf54e('0x33')]=_['intersection'](_0x963253[_0xf54e('0x30')],_0x963253[_0xf54e('0x32')]);_0x54cb92[_0xf54e('0x35')]=_[_0xf54e('0x34')](_0x963253[_0xf54e('0x30')],qs[_0xf54e('0x43')](_0x4daac7['query'][_0xf54e('0x43')]));_0x54cb92[_0xf54e('0x35')]=_0x54cb92[_0xf54e('0x35')][_0xf54e('0x36')]?_0x54cb92['attributes']:_0x963253['model'];if(!_0x4daac7[_0xf54e('0x32')][_0xf54e('0x5f')](_0xf54e('0x59'))){_0x54cb92[_0xf54e('0x1e')]=qs[_0xf54e('0x1e')](_0x4daac7[_0xf54e('0x32')]['limit']);_0x54cb92[_0xf54e('0x1d')]=qs[_0xf54e('0x1d')](_0x4daac7[_0xf54e('0x32')][_0xf54e('0x1d')]);}_0x54cb92[_0xf54e('0x5a')]=qs[_0xf54e('0x37')](_0x4daac7['query'][_0xf54e('0x37')]);_0x54cb92['where']=qs[_0xf54e('0x33')](_['pick'](_0x4daac7[_0xf54e('0x32')],_0x963253[_0xf54e('0x33')]));_0x54cb92[_0xf54e('0x38')][_0xf54e('0x5b')]=_0x7ad573['id'];if(_0x4daac7[_0xf54e('0x32')]['filter']){_0x54cb92[_0xf54e('0x38')]=_[_0xf54e('0x3a')](_0x54cb92['where'],{'$or':_[_0xf54e('0x31')](_0x54cb92[_0xf54e('0x35')],function(_0x42dc85){var _0x3e646d={};_0x3e646d[_0x42dc85]={'$like':'%'+_0x4daac7['query'][_0xf54e('0x3c')]+'%'};return _0x3e646d;})});}_0x54cb92=_[_0xf54e('0x3a')]({},_0x54cb92,_0x4daac7['options']);return db[_0xf54e('0x61')]['count']({'where':_0x54cb92['where']})[_0xf54e('0x24')](function(_0x51910e){_0x2d3d16[_0xf54e('0x1c')]=_0x51910e;if(_0x4daac7[_0xf54e('0x32')][_0xf54e('0x44')]){_0x54cb92[_0xf54e('0x53')]=[{'all':!![]}];}return db[_0xf54e('0x61')]['findAll'](_0x54cb92);})[_0xf54e('0x24')](function(_0x351239){_0x2d3d16[_0xf54e('0x3f')]=_0x351239;return _0x2d3d16;});}})[_0xf54e('0x24')](respondWithFilteredResult(_0x2cb0cd,_0x54cb92))['catch'](handleError(_0x2cb0cd,null));};exports[_0xf54e('0x62')]=function(_0x52d9fa,_0x1da57f,_0x1e6414){var _0x4cfa3f={'raw':!![],'where':{}};var _0x236f93={};var _0xe0a229={'count':0x0,'rows':[]};return db[_0xf54e('0x2b')][_0xf54e('0x5d')]({'where':{'id':_0x52d9fa['params']['id']}})[_0xf54e('0x24')](handleEntityNotFound(_0x1da57f,null))[_0xf54e('0x24')](function(_0x72535e){if(_0x72535e){_0x236f93['model']=_['keys'](db[_0xf54e('0x63')]['rawAttributes']);_0x236f93['query']=_['keys'](_0x52d9fa[_0xf54e('0x32')]);_0x236f93[_0xf54e('0x33')]=_[_0xf54e('0x34')](_0x236f93[_0xf54e('0x30')],_0x236f93[_0xf54e('0x32')]);_0x4cfa3f[_0xf54e('0x35')]=_[_0xf54e('0x34')](_0x236f93[_0xf54e('0x30')],qs[_0xf54e('0x43')](_0x52d9fa['query'][_0xf54e('0x43')]));_0x4cfa3f['attributes']=_0x4cfa3f[_0xf54e('0x35')][_0xf54e('0x36')]?_0x4cfa3f['attributes']:_0x236f93[_0xf54e('0x30')];if(!_0x52d9fa['query'][_0xf54e('0x5f')](_0xf54e('0x59'))){_0x4cfa3f[_0xf54e('0x1e')]=qs[_0xf54e('0x1e')](_0x52d9fa[_0xf54e('0x32')][_0xf54e('0x1e')]);_0x4cfa3f['offset']=qs['offset'](_0x52d9fa['query'][_0xf54e('0x1d')]);}_0x4cfa3f['order']=qs[_0xf54e('0x37')](_0x52d9fa[_0xf54e('0x32')][_0xf54e('0x37')]);_0x4cfa3f[_0xf54e('0x38')]=qs[_0xf54e('0x33')](_['pick'](_0x52d9fa[_0xf54e('0x32')],_0x236f93[_0xf54e('0x33')]));_0x4cfa3f[_0xf54e('0x38')][_0xf54e('0x5b')]=_0x72535e['id'];if(_0x52d9fa[_0xf54e('0x32')][_0xf54e('0x3c')]){_0x4cfa3f['where']=_[_0xf54e('0x3a')](_0x4cfa3f[_0xf54e('0x38')],{'$or':_[_0xf54e('0x31')](_0x4cfa3f[_0xf54e('0x35')],function(_0x1a80ff){var _0x516eeb={};_0x516eeb[_0x1a80ff]={'$like':'%'+_0x52d9fa[_0xf54e('0x32')][_0xf54e('0x3c')]+'%'};return _0x516eeb;})});}_0x4cfa3f=_[_0xf54e('0x3a')]({},_0x4cfa3f,_0x52d9fa[_0xf54e('0x3d')]);return db[_0xf54e('0x63')][_0xf54e('0x1c')]({'where':_0x4cfa3f[_0xf54e('0x38')]})[_0xf54e('0x24')](function(_0x2e42f7){_0xe0a229['count']=_0x2e42f7;if(_0x52d9fa[_0xf54e('0x32')][_0xf54e('0x44')]){_0x4cfa3f['include']=[{'all':!![]}];}return db['CmHopperBlack'][_0xf54e('0x3e')](_0x4cfa3f);})['then'](function(_0x40bf28){_0xe0a229[_0xf54e('0x3f')]=_0x40bf28;return _0xe0a229;});}})[_0xf54e('0x24')](respondWithFilteredResult(_0x1da57f,_0x4cfa3f))[_0xf54e('0x46')](handleError(_0x1da57f,null));};exports['getLists']=function(_0x406140,_0x3c4a66,_0x59fb9a){var _0x90ad88={};var _0x3797bf={};var _0x1ac57a;var _0x458450;return db[_0xf54e('0x2b')][_0xf54e('0x5d')]({'where':{'id':_0x406140[_0xf54e('0x41')]['id']}})[_0xf54e('0x24')](handleEntityNotFound(_0x3c4a66,null))[_0xf54e('0x24')](function(_0x3634bc){if(_0x3634bc){_0x1ac57a=_0x3634bc;_0x3797bf[_0xf54e('0x30')]=_['keys'](db['CmList'][_0xf54e('0x2c')]);_0x3797bf[_0xf54e('0x32')]=_[_0xf54e('0x42')](_0x406140[_0xf54e('0x32')]);_0x3797bf[_0xf54e('0x33')]=_['intersection'](_0x3797bf[_0xf54e('0x30')],_0x3797bf[_0xf54e('0x32')]);_0x90ad88[_0xf54e('0x35')]=_[_0xf54e('0x34')](_0x3797bf['model'],qs[_0xf54e('0x43')](_0x406140[_0xf54e('0x32')][_0xf54e('0x43')]));_0x90ad88[_0xf54e('0x35')]=_0x90ad88[_0xf54e('0x35')][_0xf54e('0x36')]?_0x90ad88[_0xf54e('0x35')]:_0x3797bf[_0xf54e('0x30')];_0x90ad88[_0xf54e('0x5a')]=qs[_0xf54e('0x37')](_0x406140[_0xf54e('0x32')][_0xf54e('0x37')]);_0x90ad88[_0xf54e('0x38')]=qs[_0xf54e('0x33')](_['pick'](_0x406140[_0xf54e('0x32')],_0x3797bf['filters']));if(_0x406140['query'][_0xf54e('0x3c')]){_0x90ad88[_0xf54e('0x38')]=_[_0xf54e('0x3a')](_0x90ad88[_0xf54e('0x38')],{'$or':_[_0xf54e('0x31')](_0x90ad88[_0xf54e('0x35')],function(_0x396f98){var _0x113020={};_0x113020[_0x396f98]={'$like':'%'+_0x406140[_0xf54e('0x32')][_0xf54e('0x3c')]+'%'};return _0x113020;})});}_0x90ad88=_[_0xf54e('0x3a')]({},_0x90ad88,_0x406140[_0xf54e('0x3d')]);return _0x1ac57a[_0xf54e('0x64')](_0x90ad88);}})['then'](function(_0x3ff4a5){if(_0x3ff4a5){_0x458450=_0x3ff4a5[_0xf54e('0x36')];if(!_0x406140[_0xf54e('0x32')][_0xf54e('0x5f')](_0xf54e('0x59'))){_0x90ad88['limit']=qs['limit'](_0x406140[_0xf54e('0x32')][_0xf54e('0x1e')]);_0x90ad88['offset']=qs['offset'](_0x406140[_0xf54e('0x32')]['offset']);}return _0x1ac57a[_0xf54e('0x64')](_0x90ad88);}})[_0xf54e('0x24')](function(_0x6e09bf){if(_0x6e09bf){return _0x6e09bf?{'count':_0x458450,'rows':_0x6e09bf}:null;}})[_0xf54e('0x24')](respondWithResult(_0x3c4a66,null))[_0xf54e('0x46')](handleError(_0x3c4a66,null));};exports[_0xf54e('0x65')]=function(_0x50bff9,_0x39fc7d,_0x2e0cf9){var _0x5cf1e4,_0x3fc819;return db[_0xf54e('0x2b')]['find']({'where':{'id':_0x50bff9[_0xf54e('0x41')]['id']}})[_0xf54e('0x24')](handleEntityNotFound(_0x39fc7d,null))[_0xf54e('0x24')](function(_0x54efa9){if(_0x54efa9){_0x3fc819=_0x54efa9;return _0x54efa9['addLists'](_0x50bff9[_0xf54e('0x57')][_0xf54e('0x66')],_['omit'](_0x50bff9['body'],['ids','id'])||{});}return null;})[_0xf54e('0x67')](function(_0x32b55f){var _0x11fb0c;_0x5cf1e4=_0x32b55f||[];var _0x5072aa=[];if(_0x32b55f){for(var _0x187b1c=0x0;_0x187b1c<_0x32b55f[_0xf54e('0x36')];_0x187b1c+=0x1){var _0x28d019=_0x32b55f[_0x187b1c][_0xf54e('0x49')]({'plain':!![]});_0x3fc819[_0xf54e('0x68')]=_0x50bff9['body']['dialCheckDuplicateType']?_0x50bff9['body']['dialCheckDuplicateType']:_0x3fc819['dialCheckDuplicateType'];switch(_0x3fc819[_0xf54e('0x68')]){case'always':_0x11fb0c=squel[_0xf54e('0x69')]()[_0xf54e('0x6a')]('cm_hopper')[_0xf54e('0x6b')](['phone',_0xf54e('0x6c'),_0xf54e('0x6d'),_0xf54e('0x6e'),_0xf54e('0x5b'),_0xf54e('0x56'),_0xf54e('0x55')],squel[_0xf54e('0x6f')]()['field'](_0xf54e('0x70'),_0xf54e('0x70'))[_0xf54e('0x71')](_0xf54e('0x72'),_0xf54e('0x6c'))['field']('id',_0xf54e('0x6d'))[_0xf54e('0x71')](_0x28d019[_0xf54e('0x73')][_0xf54e('0x74')](),_0xf54e('0x6e'))[_0xf54e('0x71')](_0x50bff9['params']['id']['toString'](),'CampaignId')[_0xf54e('0x71')](_0xf54e('0x72'),_0xf54e('0x56'))[_0xf54e('0x71')](_0xf54e('0x72'),'updatedAt')[_0xf54e('0x75')](_0xf54e('0x76'))['where'](_0xf54e('0x77'))[_0xf54e('0x38')](_0xf54e('0x78'),_0x28d019['CmListId'][_0xf54e('0x74')]())[_0xf54e('0x38')](_0xf54e('0x79'))[_0xf54e('0x38')](_0xf54e('0x7a'),squel[_0xf54e('0x6f')]()[_0xf54e('0x71')](_0xf54e('0x7b'))['from'](_0xf54e('0x7c'))['where'](_0xf54e('0x7d'),_0x50bff9[_0xf54e('0x41')]['id'][_0xf54e('0x74')]()))[_0xf54e('0x38')](_0xf54e('0x7a'),squel[_0xf54e('0x6f')]()[_0xf54e('0x71')]('COALESCE(phone,\x27\x27)')['from']('cm_hopper')[_0xf54e('0x38')]('CampaignId\x20=\x20?',_0x50bff9[_0xf54e('0x41')]['id']['toString']())))[_0xf54e('0x74')]();break;case _0xf54e('0x7e'):_0x11fb0c=squel['insert']()[_0xf54e('0x6a')](_0xf54e('0x7f'))[_0xf54e('0x6b')]([_0xf54e('0x70'),_0xf54e('0x6c'),_0xf54e('0x6d'),_0xf54e('0x6e'),_0xf54e('0x5b'),_0xf54e('0x56'),_0xf54e('0x55')],squel[_0xf54e('0x6f')]()['field'](_0xf54e('0x70'),_0xf54e('0x70'))[_0xf54e('0x71')]('NOW()',_0xf54e('0x6c'))['field']('id',_0xf54e('0x6d'))[_0xf54e('0x71')](_0x28d019[_0xf54e('0x73')][_0xf54e('0x74')](),_0xf54e('0x6e'))[_0xf54e('0x71')](_0x50bff9[_0xf54e('0x41')]['id'][_0xf54e('0x74')](),_0xf54e('0x5b'))[_0xf54e('0x71')](_0xf54e('0x72'),'createdAt')['field']('NOW()',_0xf54e('0x55'))[_0xf54e('0x75')](_0xf54e('0x76'))['where'](_0xf54e('0x77'))[_0xf54e('0x38')]('ListId\x20=\x20?',_0x28d019[_0xf54e('0x73')][_0xf54e('0x74')]())[_0xf54e('0x38')](_0xf54e('0x79'))[_0xf54e('0x38')](_0xf54e('0x7a'),squel[_0xf54e('0x6f')]()['field']('COALESCE(phone,\x27\x27)')[_0xf54e('0x75')](_0xf54e('0x7f'))[_0xf54e('0x38')](_0xf54e('0x7d'),_0x50bff9['params']['id'][_0xf54e('0x74')]())))[_0xf54e('0x74')]();break;default:_0x11fb0c=squel['insert']()[_0xf54e('0x6a')]('cm_hopper')[_0xf54e('0x6b')]([_0xf54e('0x70'),_0xf54e('0x6c'),_0xf54e('0x6d'),'ListId',_0xf54e('0x5b'),'createdAt',_0xf54e('0x55')],squel[_0xf54e('0x6f')]()[_0xf54e('0x71')](_0xf54e('0x70'),'phone')['field'](_0xf54e('0x72'),_0xf54e('0x6c'))[_0xf54e('0x71')]('id','ContactId')[_0xf54e('0x71')](_0x28d019[_0xf54e('0x73')]['toString'](),_0xf54e('0x6e'))[_0xf54e('0x71')](_0x50bff9[_0xf54e('0x41')]['id'][_0xf54e('0x74')](),_0xf54e('0x5b'))[_0xf54e('0x71')]('NOW()',_0xf54e('0x56'))[_0xf54e('0x71')](_0xf54e('0x72'),_0xf54e('0x55'))[_0xf54e('0x75')](_0xf54e('0x76'))[_0xf54e('0x38')](_0xf54e('0x77'))[_0xf54e('0x38')](_0xf54e('0x78'),_0x28d019[_0xf54e('0x73')][_0xf54e('0x74')]())[_0xf54e('0x38')](_0xf54e('0x79')))[_0xf54e('0x74')]();}_0x5072aa[_0xf54e('0x80')](db[_0xf54e('0x81')]['query'](_0x11fb0c));}return BPromise[_0xf54e('0x82')](_0x5072aa);}})[_0xf54e('0x24')](function(){return _0x5cf1e4;})[_0xf54e('0x24')](respondWithResult(_0x39fc7d,null))['catch'](handleError(_0x39fc7d,null));};exports[_0xf54e('0x83')]=function(_0x3b3d45,_0x40aae0,_0x2f90de){return db[_0xf54e('0x2b')]['find']({'where':{'id':_0x3b3d45[_0xf54e('0x41')]['id']}})['then'](handleEntityNotFound(_0x40aae0,null))[_0xf54e('0x24')](function(_0xa70512){if(_0xa70512){return _0xa70512['removeLists'](_0x3b3d45[_0xf54e('0x32')][_0xf54e('0x66')]);}})[_0xf54e('0x24')](function(_0x4026ea){if(_0x4026ea){return db[_0xf54e('0x84')][_0xf54e('0x25')]({'where':{'ListId':_0x3b3d45[_0xf54e('0x32')][_0xf54e('0x66')],'CampaignId':_0x3b3d45[_0xf54e('0x41')]['id']}})['then'](function(){return _0x4026ea;});}})[_0xf54e('0x24')](respondWithStatusCode(_0x40aae0,null))['catch'](handleError(_0x40aae0,null));};exports[_0xf54e('0x85')]=function(_0x380881,_0x54869f,_0x15184a){var _0x54c75b={'raw':!![],'where':{}};var _0x3da876={};var _0x826b2f={'count':0x0,'rows':[]};return db['Campaign'][_0xf54e('0x5d')]({'where':{'id':_0x380881[_0xf54e('0x41')]['id']}})['then'](handleEntityNotFound(_0x54869f,null))['then'](function(_0x526f27){if(_0x526f27){_0x3da876[_0xf54e('0x30')]=_[_0xf54e('0x42')](db[_0xf54e('0x86')][_0xf54e('0x2c')]);_0x3da876[_0xf54e('0x32')]=_[_0xf54e('0x42')](_0x380881[_0xf54e('0x32')]);_0x3da876[_0xf54e('0x33')]=_['intersection'](_0x3da876['model'],_0x3da876[_0xf54e('0x32')]);_0x54c75b[_0xf54e('0x35')]=_[_0xf54e('0x34')](_0x3da876[_0xf54e('0x30')],qs[_0xf54e('0x43')](_0x380881['query'][_0xf54e('0x43')]));_0x54c75b['attributes']=_0x54c75b['attributes'][_0xf54e('0x36')]?_0x54c75b[_0xf54e('0x35')]:_0x3da876[_0xf54e('0x30')];if(!_0x380881[_0xf54e('0x32')][_0xf54e('0x5f')](_0xf54e('0x59'))){_0x54c75b[_0xf54e('0x1e')]=qs['limit'](_0x380881[_0xf54e('0x32')][_0xf54e('0x1e')]);_0x54c75b[_0xf54e('0x1d')]=qs[_0xf54e('0x1d')](_0x380881[_0xf54e('0x32')]['offset']);}_0x54c75b[_0xf54e('0x5a')]=qs[_0xf54e('0x37')](_0x380881[_0xf54e('0x32')][_0xf54e('0x37')]);_0x54c75b[_0xf54e('0x38')]=qs['filters'](_['pick'](_0x380881[_0xf54e('0x32')],_0x3da876[_0xf54e('0x33')]));_0x54c75b[_0xf54e('0x38')]['CampaignId']=_0x526f27['id'];if(_0x380881[_0xf54e('0x32')][_0xf54e('0x3c')]){_0x54c75b[_0xf54e('0x38')]=_[_0xf54e('0x3a')](_0x54c75b['where'],{'$or':_[_0xf54e('0x31')](_0x54c75b[_0xf54e('0x35')],function(_0x3219be){var _0x4b3de5={};_0x4b3de5[_0x3219be]={'$like':'%'+_0x380881[_0xf54e('0x32')][_0xf54e('0x3c')]+'%'};return _0x4b3de5;})});}_0x54c75b=_[_0xf54e('0x3a')]({},_0x54c75b,_0x380881[_0xf54e('0x3d')]);return db[_0xf54e('0x86')][_0xf54e('0x1c')]({'where':_0x54c75b[_0xf54e('0x38')]})[_0xf54e('0x24')](function(_0x51b684){_0x826b2f[_0xf54e('0x1c')]=_0x51b684;if(_0x380881[_0xf54e('0x32')][_0xf54e('0x44')]){_0x54c75b[_0xf54e('0x53')]=[{'all':!![]}];}return db['CmList']['findAll'](_0x54c75b);})['then'](function(_0x4b96cb){_0x826b2f[_0xf54e('0x3f')]=_0x4b96cb;return _0x826b2f;});}})[_0xf54e('0x24')](respondWithFilteredResult(_0x54869f,_0x54c75b))[_0xf54e('0x46')](handleError(_0x54869f,null));};exports['addBlackLists']=function(_0x5a84b8,_0xd82fad,_0x5debcf){var _0x21319b,_0x59f6fc;return db[_0xf54e('0x2b')][_0xf54e('0x45')]({'where':{'id':_0x5a84b8[_0xf54e('0x41')]['id']}})['then'](handleEntityNotFound(_0xd82fad,null))[_0xf54e('0x24')](function(_0x260b7a){if(_0x260b7a){_0x59f6fc=_0x260b7a;return _0x260b7a[_0xf54e('0x87')](_0x5a84b8[_0xf54e('0x57')]['ids'],_[_0xf54e('0x54')](_0x5a84b8[_0xf54e('0x57')],[_0xf54e('0x66'),'id'])||{});}return null;})[_0xf54e('0x67')](function(_0x20947f){var _0x4713cf;_0x21319b=_0x20947f||[];var _0x57f6af=[];if(_0x20947f){for(var _0x31e4c1=0x0;_0x31e4c1<_0x20947f['length'];_0x31e4c1+=0x1){var _0x4d406a=_0x20947f[_0x31e4c1][_0xf54e('0x49')]({'plain':!![]});_0x4713cf=squel['insert']()[_0xf54e('0x6a')](_0xf54e('0x88'))['fromQuery'](['phone',_0xf54e('0x6d'),'ListId',_0xf54e('0x5b'),_0xf54e('0x56'),'updatedAt'],squel[_0xf54e('0x6f')]()['field'](_0xf54e('0x70'),_0xf54e('0x70'))['field']('id',_0xf54e('0x6d'))[_0xf54e('0x71')](_0x4d406a[_0xf54e('0x73')][_0xf54e('0x74')](),_0xf54e('0x6e'))[_0xf54e('0x71')](_0x5a84b8[_0xf54e('0x41')]['id'][_0xf54e('0x74')](),_0xf54e('0x5b'))['field']('NOW()',_0xf54e('0x56'))[_0xf54e('0x71')](_0xf54e('0x72'),_0xf54e('0x55'))['from'](_0xf54e('0x76'))[_0xf54e('0x38')]('deletedAt\x20IS\x20NULL')[_0xf54e('0x38')](_0xf54e('0x78'),_0x4d406a[_0xf54e('0x73')][_0xf54e('0x74')]())[_0xf54e('0x38')](_0xf54e('0x79')))[_0xf54e('0x74')]();_0x57f6af[_0xf54e('0x80')](db[_0xf54e('0x81')][_0xf54e('0x32')](_0x4713cf));}return BPromise[_0xf54e('0x82')](_0x57f6af);}})['then'](function(){return _0x21319b;})['then'](respondWithResult(_0xd82fad,null))[_0xf54e('0x46')](handleError(_0xd82fad,null));};exports[_0xf54e('0x89')]=function(_0x30327d,_0x26a904,_0x20f555){return db[_0xf54e('0x2b')]['find']({'where':{'id':_0x30327d[_0xf54e('0x41')]['id']}})[_0xf54e('0x24')](handleEntityNotFound(_0x26a904,null))['then'](function(_0x410b61){if(_0x410b61){return _0x410b61[_0xf54e('0x89')](_0x30327d[_0xf54e('0x32')][_0xf54e('0x66')]);}})['then'](function(_0x55f815){if(_0x55f815){return db[_0xf54e('0x63')][_0xf54e('0x25')]({'where':{'ListId':_0x30327d[_0xf54e('0x32')][_0xf54e('0x66')],'CampaignId':_0x30327d['params']['id']}})['then'](function(){return _0x55f815;});}})[_0xf54e('0x24')](respondWithStatusCode(_0x26a904,null))[_0xf54e('0x46')](handleError(_0x26a904,null));};
\ No newline at end of file
+var _0x6c76=['../../components/auth/service','../../components/parsers/qs','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/environment','../../mysqldb','sendStatus','status','end','json','count','set','Content-Range','apply','reject','update','then','destroy','get','IvrCampaigns','error','name','send','index','map','rawAttributes','fieldName','key','model','query','keys','intersection','attributes','fields','length','hasOwnProperty','nolimit','limit','offset','order','sort','where','filters','pick','filter','merge','type','options','Campaign','includeAll','include','findAll','rows','catch','show','params','create','user','Unable\x20to\x20retrieve\x20the\x20current\x20user','role','UserProfileSection','find','autoAssociation','UserProfileResource','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','clone','omit','body','updatedAt','userProfileId','getHoppers','findOne','CmHopper','CampaignId','getHopperHistories','CmHopperHistory','getHopperFinals','CmHopperFinal','getHopperBlacks','CmHopperBlack','getLists','addLists','ids','dialCheckDuplicateType','insert','into','cm_hopper','fromQuery','ContactId','createdAt','select','phone','field','NOW()','CmListId','toString','ListId','from','cm_contacts','phone\x20NOT\x20IN\x20(?)','COALESCE(calleridnum,\x27\x27)','cm_hopper_final','CampaignId\x20=\x20?','COALESCE(phone,\x27\x27)','onlyIfOpen','scheduledAt','deletedAt\x20IS\x20NULL','ListId\x20=\x20?','phone\x20IS\x20NOT\x20NULL','push','sequelize','all','removeLists','getBlackLists','CmList','addBlackLists','cm_hopper_black','removeBlackLists','html-pdf','eml-format','rimraf','fast-json-patch','request-promise','mustache','util','sox','to-csv','lodash','jsforce','desk.js','papaparse','ioredis'];(function(_0x5b1c48,_0x128a7f){var _0x5ab9aa=function(_0x20fed6){while(--_0x20fed6){_0x5b1c48['push'](_0x5b1c48['shift']());}};_0x5ab9aa(++_0x128a7f);}(_0x6c76,0x184));var _0x66c7=function(_0x36afc9,_0x330ac6){_0x36afc9=_0x36afc9-0x0;var _0x3c5d2b=_0x6c76[_0x36afc9];return _0x3c5d2b;};'use strict';var pdf=require(_0x66c7('0x0'));var emlformat=require(_0x66c7('0x1'));var rimraf=require(_0x66c7('0x2'));var zipdir=require('zip-dir');var jsonpatch=require(_0x66c7('0x3'));var rp=require(_0x66c7('0x4'));var moment=require('moment');var BPromise=require('bluebird');var Mustache=require(_0x66c7('0x5'));var util=require(_0x66c7('0x6'));var path=require('path');var sox=require(_0x66c7('0x7'));var csv=require(_0x66c7('0x8'));var ejs=require('ejs');var fs=require('fs');var _=require(_0x66c7('0x9'));var squel=require('squel');var crypto=require('crypto');var jsforce=require(_0x66c7('0xa'));var deskjs=require(_0x66c7('0xb'));var toCsv=require(_0x66c7('0x8'));var querystring=require('querystring');var Papa=require(_0x66c7('0xc'));var Redis=require(_0x66c7('0xd'));var authService=require(_0x66c7('0xe'));var qs=require(_0x66c7('0xf'));var as=require('../../components/parsers/advancedSearch');var hardwareService=require(_0x66c7('0x10'));var logger=require(_0x66c7('0x11'))(_0x66c7('0x12'));var utils=require(_0x66c7('0x13'));var config=require(_0x66c7('0x14'));var db=require(_0x66c7('0x15'))['db'];function respondWithStatusCode(_0x174717,_0x5176a3){_0x5176a3=_0x5176a3||0xcc;return function(_0x18c309){if(_0x18c309){return _0x174717[_0x66c7('0x16')](_0x5176a3);}return _0x174717[_0x66c7('0x17')](_0x5176a3)[_0x66c7('0x18')]();};}function respondWithResult(_0x4f6c91,_0x1e91d1){_0x1e91d1=_0x1e91d1||0xc8;return function(_0x618bd7){if(_0x618bd7){return _0x4f6c91[_0x66c7('0x17')](_0x1e91d1)[_0x66c7('0x19')](_0x618bd7);}};}function respondWithFilteredResult(_0x5d44e1,_0x110f6d){return function(_0x4dd902){if(_0x4dd902){var _0x208010=_0x4dd902[_0x66c7('0x1a')],_0x39f951=_0x110f6d['offset'],_0x3c81c0=_0x110f6d['offset']+_0x110f6d['limit'],_0x42e930;if(_0x3c81c0>=_0x208010){_0x3c81c0=_0x208010;_0x42e930=0xc8;}else{_0x42e930=0xce;}_0x5d44e1['status'](_0x42e930);return _0x5d44e1[_0x66c7('0x1b')](_0x66c7('0x1c'),_0x39f951+'-'+_0x3c81c0+'/'+_0x208010)['json'](_0x4dd902);}return null;};}function patchUpdates(_0x524e87){return function(_0x256b0a){try{jsonpatch[_0x66c7('0x1d')](_0x256b0a,_0x524e87,!![]);}catch(_0x4756f7){return BPromise[_0x66c7('0x1e')](_0x4756f7);}return _0x256b0a['save']();};}function saveUpdates(_0x49a3c7,_0x1853b2){return function(_0x237177){if(_0x237177){return _0x237177[_0x66c7('0x1f')](_0x49a3c7)[_0x66c7('0x20')](function(_0x465457){return _0x465457;});}return null;};}function removeEntity(_0x75f118,_0x4804cf){return function(_0x4ddbd2){if(_0x4ddbd2){return _0x4ddbd2[_0x66c7('0x21')]()['then'](function(){var _0x7462f1=_0x4ddbd2[_0x66c7('0x22')]({'plain':!![]});var _0x44bdef=_0x66c7('0x23');return db['UserProfileResource'][_0x66c7('0x21')]({'where':{'type':_0x44bdef,'resourceId':_0x7462f1['id']}})[_0x66c7('0x20')](function(){return _0x4ddbd2;});})['then'](function(){_0x75f118[_0x66c7('0x17')](0xcc)[_0x66c7('0x18')]();});}};}function handleEntityNotFound(_0x2bb86d,_0x2ef6a2){return function(_0x2af0a3){if(!_0x2af0a3){_0x2bb86d['sendStatus'](0x194);}return _0x2af0a3;};}function handleError(_0x5bc4e6,_0x4e514a){_0x4e514a=_0x4e514a||0x1f4;return function(_0x2dd131){logger[_0x66c7('0x24')](_0x2dd131['stack']);if(_0x2dd131[_0x66c7('0x25')]){delete _0x2dd131[_0x66c7('0x25')];}_0x5bc4e6[_0x66c7('0x17')](_0x4e514a)[_0x66c7('0x26')](_0x2dd131);};}exports[_0x66c7('0x27')]=function(_0x27be81,_0x570f0d){var _0xccefb2={},_0x2e2560={},_0xc4b2bf={'count':0x0,'rows':[]};var _0x33be23=_[_0x66c7('0x28')](db['Campaign'][_0x66c7('0x29')],function(_0x4f1a34){return{'name':_0x4f1a34[_0x66c7('0x2a')],'type':_0x4f1a34['type'][_0x66c7('0x2b')]};});_0x2e2560[_0x66c7('0x2c')]=_[_0x66c7('0x28')](_0x33be23,_0x66c7('0x25'));_0x2e2560[_0x66c7('0x2d')]=_[_0x66c7('0x2e')](_0x27be81['query']);_0x2e2560['filters']=_[_0x66c7('0x2f')](_0x2e2560[_0x66c7('0x2c')],_0x2e2560[_0x66c7('0x2d')]);_0xccefb2[_0x66c7('0x30')]=_[_0x66c7('0x2f')](_0x2e2560[_0x66c7('0x2c')],qs[_0x66c7('0x31')](_0x27be81[_0x66c7('0x2d')][_0x66c7('0x31')]));_0xccefb2[_0x66c7('0x30')]=_0xccefb2[_0x66c7('0x30')][_0x66c7('0x32')]?_0xccefb2['attributes']:_0x2e2560['model'];if(!_0x27be81[_0x66c7('0x2d')][_0x66c7('0x33')](_0x66c7('0x34'))){_0xccefb2[_0x66c7('0x35')]=qs[_0x66c7('0x35')](_0x27be81[_0x66c7('0x2d')][_0x66c7('0x35')]);_0xccefb2['offset']=qs[_0x66c7('0x36')](_0x27be81[_0x66c7('0x2d')][_0x66c7('0x36')]);}_0xccefb2[_0x66c7('0x37')]=qs[_0x66c7('0x38')](_0x27be81[_0x66c7('0x2d')][_0x66c7('0x38')]);_0xccefb2[_0x66c7('0x39')]=qs[_0x66c7('0x3a')](_[_0x66c7('0x3b')](_0x27be81[_0x66c7('0x2d')],_0x2e2560['filters']));if(_0x27be81['query'][_0x66c7('0x3c')]){_0xccefb2[_0x66c7('0x39')]=_[_0x66c7('0x3d')](_0xccefb2['where'],{'$or':_['map'](_0x33be23,function(_0x2e31b8){if(_0x2e31b8[_0x66c7('0x3e')]!=='VIRTUAL'){var _0x2d98e4={};_0x2d98e4[_0x2e31b8[_0x66c7('0x25')]]={'$like':'%'+_0x27be81[_0x66c7('0x2d')]['filter']+'%'};return _0x2d98e4;}})});}_0xccefb2=_[_0x66c7('0x3d')]({},_0xccefb2,_0x27be81[_0x66c7('0x3f')]);var _0x9f6ca8={'where':_0xccefb2[_0x66c7('0x39')]};return db[_0x66c7('0x40')][_0x66c7('0x1a')](_0x9f6ca8)[_0x66c7('0x20')](function(_0x279d27){_0xc4b2bf[_0x66c7('0x1a')]=_0x279d27;if(_0x27be81['query'][_0x66c7('0x41')]){_0xccefb2[_0x66c7('0x42')]=[{'all':!![]}];}return db[_0x66c7('0x40')][_0x66c7('0x43')](_0xccefb2);})[_0x66c7('0x20')](function(_0x28983c){_0xc4b2bf[_0x66c7('0x44')]=_0x28983c;return _0xc4b2bf;})[_0x66c7('0x20')](respondWithFilteredResult(_0x570f0d,_0xccefb2))[_0x66c7('0x45')](handleError(_0x570f0d,null));};exports[_0x66c7('0x46')]=function(_0x513317,_0x5bb5fc){var _0x528f5c={'raw':![],'where':{'id':_0x513317[_0x66c7('0x47')]['id']}},_0x209f58={};_0x209f58['model']=_['keys'](db[_0x66c7('0x40')][_0x66c7('0x29')]);_0x209f58[_0x66c7('0x2d')]=_[_0x66c7('0x2e')](_0x513317[_0x66c7('0x2d')]);_0x209f58['filters']=_[_0x66c7('0x2f')](_0x209f58['model'],_0x209f58['query']);_0x528f5c[_0x66c7('0x30')]=_[_0x66c7('0x2f')](_0x209f58[_0x66c7('0x2c')],qs[_0x66c7('0x31')](_0x513317['query']['fields']));_0x528f5c[_0x66c7('0x30')]=_0x528f5c['attributes']['length']?_0x528f5c[_0x66c7('0x30')]:_0x209f58[_0x66c7('0x2c')];if(_0x513317[_0x66c7('0x2d')][_0x66c7('0x41')]){_0x528f5c['include']=[{'all':!![]}];}_0x528f5c=_[_0x66c7('0x3d')]({},_0x528f5c,_0x513317[_0x66c7('0x3f')]);return db[_0x66c7('0x40')]['find'](_0x528f5c)[_0x66c7('0x20')](handleEntityNotFound(_0x5bb5fc,null))[_0x66c7('0x20')](respondWithResult(_0x5bb5fc,null))[_0x66c7('0x45')](handleError(_0x5bb5fc,null));};exports[_0x66c7('0x48')]=function(_0x1b78a6,_0x3b4f34){return db[_0x66c7('0x40')][_0x66c7('0x48')](_0x1b78a6['body'],{})[_0x66c7('0x20')](function(_0x12d377){var _0x23d0eb=_0x1b78a6[_0x66c7('0x49')][_0x66c7('0x22')]({'plain':!![]});if(!_0x23d0eb)throw new Error(_0x66c7('0x4a'));if(_0x23d0eb[_0x66c7('0x4b')]===_0x66c7('0x49')){var _0x1b3dc2=_0x12d377[_0x66c7('0x22')]({'plain':!![]});var _0x9e2346=_0x66c7('0x23');return db[_0x66c7('0x4c')][_0x66c7('0x4d')]({'where':{'name':_0x9e2346,'userProfileId':_0x23d0eb['userProfileId']},'raw':!![]})[_0x66c7('0x20')](function(_0x225fb6){if(_0x225fb6&&_0x225fb6[_0x66c7('0x4e')]===0x0){return db[_0x66c7('0x4f')]['create']({'name':_0x1b3dc2[_0x66c7('0x25')],'resourceId':_0x1b3dc2['id'],'type':_0x225fb6[_0x66c7('0x25')],'sectionId':_0x225fb6['id']},{})['then'](function(){return _0x12d377;});}else{return _0x12d377;}})[_0x66c7('0x45')](function(_0x2affe4){logger[_0x66c7('0x24')](_0x66c7('0x50'),_0x2affe4);throw _0x2affe4;});}return _0x12d377;})[_0x66c7('0x20')](respondWithResult(_0x3b4f34,0xc9))[_0x66c7('0x45')](handleError(_0x3b4f34,null));};exports[_0x66c7('0x51')]=function(_0x5cd4e9,_0x933dd6){var _0x455ab3={'where':{'id':_0x5cd4e9[_0x66c7('0x47')]['id']}},_0x4a619d={};_0x4a619d[_0x66c7('0x2c')]=_[_0x66c7('0x2e')](db['Campaign'][_0x66c7('0x29')]);_0x455ab3[_0x66c7('0x30')]=_[_0x66c7('0x2f')](_0x4a619d[_0x66c7('0x2c')],qs[_0x66c7('0x31')](_0x5cd4e9[_0x66c7('0x2d')][_0x66c7('0x31')]));_0x455ab3[_0x66c7('0x30')]=_0x455ab3['attributes'][_0x66c7('0x32')]?_0x455ab3[_0x66c7('0x30')]:_0x4a619d['model'];if(_0x5cd4e9[_0x66c7('0x2d')][_0x66c7('0x41')]){_0x455ab3[_0x66c7('0x42')]=[{'all':!![]}];}_0x455ab3=_['merge']({},_0x455ab3,_0x5cd4e9['options']);return db[_0x66c7('0x40')]['find'](_0x455ab3)[_0x66c7('0x20')](handleEntityNotFound(_0x933dd6,null))[_0x66c7('0x20')](function(_0x45e5a2){if(_0x45e5a2){var _0x106b1e=_0x45e5a2[_0x66c7('0x22')]({'plain':!![]});_0x106b1e=qs[_0x66c7('0x52')](_0x106b1e,['id','createdAt','updatedAt']);_0x5cd4e9[_0x66c7('0x53')]=_[_0x66c7('0x52')](_0x5cd4e9['body'],['id','createdAt',_0x66c7('0x54')]);return db['Campaign'][_0x66c7('0x48')](_[_0x66c7('0x3d')](_0x106b1e,_0x5cd4e9[_0x66c7('0x53')]),{'include':_0x5cd4e9[_0x66c7('0x2d')]['includeAll']?[{'all':!![]}]:undefined})[_0x66c7('0x20')](function(_0x1dc6e6){var _0x2443cb=_0x5cd4e9[_0x66c7('0x49')][_0x66c7('0x22')]({'plain':!![]});if(!_0x2443cb)throw new Error(_0x66c7('0x4a'));if(_0x2443cb['role']===_0x66c7('0x49')){var _0x39c18e=_0x1dc6e6[_0x66c7('0x22')]({'plain':!![]});var _0x5352ec=_0x66c7('0x23');return db['UserProfileSection'][_0x66c7('0x4d')]({'where':{'name':_0x5352ec,'userProfileId':_0x2443cb[_0x66c7('0x55')]},'raw':!![]})[_0x66c7('0x20')](function(_0x445af1){if(_0x445af1&&_0x445af1[_0x66c7('0x4e')]===0x0){return db[_0x66c7('0x4f')]['create']({'name':_0x39c18e[_0x66c7('0x25')],'resourceId':_0x39c18e['id'],'type':_0x445af1[_0x66c7('0x25')],'sectionId':_0x445af1['id']},{})[_0x66c7('0x20')](function(){return _0x1dc6e6;});}else{return _0x1dc6e6;}})[_0x66c7('0x45')](function(_0x8f9402){logger['error'](_0x66c7('0x50'),_0x8f9402);throw _0x8f9402;});}return _0x1dc6e6;});}})[_0x66c7('0x20')](respondWithResult(_0x933dd6,0xc9))[_0x66c7('0x45')](handleError(_0x933dd6,null));};exports[_0x66c7('0x1f')]=function(_0x433fb5,_0x22ab1d){if(_0x433fb5[_0x66c7('0x53')]['id']){delete _0x433fb5[_0x66c7('0x53')]['id'];}return db[_0x66c7('0x40')][_0x66c7('0x4d')]({'where':{'id':_0x433fb5[_0x66c7('0x47')]['id']}})[_0x66c7('0x20')](handleEntityNotFound(_0x22ab1d,null))['then'](saveUpdates(_0x433fb5[_0x66c7('0x53')],null))[_0x66c7('0x20')](respondWithResult(_0x22ab1d,null))[_0x66c7('0x45')](handleError(_0x22ab1d,null));};exports[_0x66c7('0x21')]=function(_0x1a7e10,_0x419b49){return db[_0x66c7('0x40')]['find']({'where':{'id':_0x1a7e10[_0x66c7('0x47')]['id']}})[_0x66c7('0x20')](handleEntityNotFound(_0x419b49,null))[_0x66c7('0x20')](removeEntity(_0x419b49,null))[_0x66c7('0x45')](handleError(_0x419b49,null));};exports[_0x66c7('0x56')]=function(_0x447398,_0x41bdf3,_0x3e8f4c){var _0xe89d87={'raw':!![],'where':{}};var _0x4069a6={};var _0x21eb0a={'count':0x0,'rows':[]};return db[_0x66c7('0x40')][_0x66c7('0x57')]({'where':{'id':_0x447398[_0x66c7('0x47')]['id']}})[_0x66c7('0x20')](handleEntityNotFound(_0x41bdf3,null))[_0x66c7('0x20')](function(_0x5bca99){if(_0x5bca99){_0x4069a6[_0x66c7('0x2c')]=_[_0x66c7('0x2e')](db[_0x66c7('0x58')][_0x66c7('0x29')]);_0x4069a6[_0x66c7('0x2d')]=_[_0x66c7('0x2e')](_0x447398[_0x66c7('0x2d')]);_0x4069a6[_0x66c7('0x3a')]=_[_0x66c7('0x2f')](_0x4069a6[_0x66c7('0x2c')],_0x4069a6[_0x66c7('0x2d')]);_0xe89d87[_0x66c7('0x30')]=_[_0x66c7('0x2f')](_0x4069a6[_0x66c7('0x2c')],qs[_0x66c7('0x31')](_0x447398[_0x66c7('0x2d')][_0x66c7('0x31')]));_0xe89d87['attributes']=_0xe89d87[_0x66c7('0x30')][_0x66c7('0x32')]?_0xe89d87[_0x66c7('0x30')]:_0x4069a6[_0x66c7('0x2c')];if(!_0x447398[_0x66c7('0x2d')][_0x66c7('0x33')]('nolimit')){_0xe89d87['limit']=qs[_0x66c7('0x35')](_0x447398['query'][_0x66c7('0x35')]);_0xe89d87[_0x66c7('0x36')]=qs[_0x66c7('0x36')](_0x447398[_0x66c7('0x2d')][_0x66c7('0x36')]);}_0xe89d87[_0x66c7('0x37')]=qs[_0x66c7('0x38')](_0x447398[_0x66c7('0x2d')][_0x66c7('0x38')]);_0xe89d87[_0x66c7('0x39')]=qs[_0x66c7('0x3a')](_[_0x66c7('0x3b')](_0x447398['query'],_0x4069a6[_0x66c7('0x3a')]));_0xe89d87[_0x66c7('0x39')][_0x66c7('0x59')]=_0x5bca99['id'];if(_0x447398[_0x66c7('0x2d')]['filter']){_0xe89d87[_0x66c7('0x39')]=_[_0x66c7('0x3d')](_0xe89d87['where'],{'$or':_[_0x66c7('0x28')](_0xe89d87[_0x66c7('0x30')],function(_0x3f25c0){var _0x2fadf8={};_0x2fadf8[_0x3f25c0]={'$like':'%'+_0x447398[_0x66c7('0x2d')][_0x66c7('0x3c')]+'%'};return _0x2fadf8;})});}_0xe89d87=_['merge']({},_0xe89d87,_0x447398['options']);return db[_0x66c7('0x58')]['count']({'where':_0xe89d87['where']})[_0x66c7('0x20')](function(_0xb61ce5){_0x21eb0a[_0x66c7('0x1a')]=_0xb61ce5;if(_0x447398[_0x66c7('0x2d')][_0x66c7('0x41')]){_0xe89d87[_0x66c7('0x42')]=[{'all':!![]}];}return db[_0x66c7('0x58')][_0x66c7('0x43')](_0xe89d87);})['then'](function(_0x3a216e){_0x21eb0a[_0x66c7('0x44')]=_0x3a216e;return _0x21eb0a;});}})[_0x66c7('0x20')](respondWithFilteredResult(_0x41bdf3,_0xe89d87))[_0x66c7('0x45')](handleError(_0x41bdf3,null));};exports[_0x66c7('0x5a')]=function(_0xfe12d6,_0x412525,_0x44a672){var _0x46b54f={'raw':!![],'where':{}};var _0x13a5d1={};var _0x1c6f80={'count':0x0,'rows':[]};return db[_0x66c7('0x40')][_0x66c7('0x57')]({'where':{'id':_0xfe12d6[_0x66c7('0x47')]['id']}})[_0x66c7('0x20')](handleEntityNotFound(_0x412525,null))[_0x66c7('0x20')](function(_0x2b1854){if(_0x2b1854){_0x13a5d1[_0x66c7('0x2c')]=_[_0x66c7('0x2e')](db[_0x66c7('0x5b')][_0x66c7('0x29')]);_0x13a5d1[_0x66c7('0x2d')]=_[_0x66c7('0x2e')](_0xfe12d6[_0x66c7('0x2d')]);_0x13a5d1[_0x66c7('0x3a')]=_[_0x66c7('0x2f')](_0x13a5d1[_0x66c7('0x2c')],_0x13a5d1['query']);_0x46b54f[_0x66c7('0x30')]=_[_0x66c7('0x2f')](_0x13a5d1[_0x66c7('0x2c')],qs['fields'](_0xfe12d6[_0x66c7('0x2d')][_0x66c7('0x31')]));_0x46b54f[_0x66c7('0x30')]=_0x46b54f['attributes'][_0x66c7('0x32')]?_0x46b54f[_0x66c7('0x30')]:_0x13a5d1[_0x66c7('0x2c')];if(!_0xfe12d6['query'][_0x66c7('0x33')](_0x66c7('0x34'))){_0x46b54f[_0x66c7('0x35')]=qs[_0x66c7('0x35')](_0xfe12d6['query'][_0x66c7('0x35')]);_0x46b54f[_0x66c7('0x36')]=qs[_0x66c7('0x36')](_0xfe12d6[_0x66c7('0x2d')]['offset']);}_0x46b54f['order']=qs[_0x66c7('0x38')](_0xfe12d6[_0x66c7('0x2d')][_0x66c7('0x38')]);_0x46b54f[_0x66c7('0x39')]=qs[_0x66c7('0x3a')](_['pick'](_0xfe12d6[_0x66c7('0x2d')],_0x13a5d1[_0x66c7('0x3a')]));_0x46b54f[_0x66c7('0x39')][_0x66c7('0x59')]=_0x2b1854['id'];if(_0xfe12d6[_0x66c7('0x2d')]['filter']){_0x46b54f[_0x66c7('0x39')]=_[_0x66c7('0x3d')](_0x46b54f[_0x66c7('0x39')],{'$or':_[_0x66c7('0x28')](_0x46b54f[_0x66c7('0x30')],function(_0x4310e6){var _0x9b1421={};_0x9b1421[_0x4310e6]={'$like':'%'+_0xfe12d6[_0x66c7('0x2d')]['filter']+'%'};return _0x9b1421;})});}_0x46b54f=_[_0x66c7('0x3d')]({},_0x46b54f,_0xfe12d6[_0x66c7('0x3f')]);return db[_0x66c7('0x5b')]['count']({'where':_0x46b54f[_0x66c7('0x39')]})[_0x66c7('0x20')](function(_0x41ba9a){_0x1c6f80[_0x66c7('0x1a')]=_0x41ba9a;if(_0xfe12d6[_0x66c7('0x2d')][_0x66c7('0x41')]){_0x46b54f[_0x66c7('0x42')]=[{'all':!![]}];}return db[_0x66c7('0x5b')]['findAll'](_0x46b54f);})[_0x66c7('0x20')](function(_0x1b1c6d){_0x1c6f80[_0x66c7('0x44')]=_0x1b1c6d;return _0x1c6f80;});}})[_0x66c7('0x20')](respondWithFilteredResult(_0x412525,_0x46b54f))[_0x66c7('0x45')](handleError(_0x412525,null));};exports[_0x66c7('0x5c')]=function(_0x58f604,_0x475272,_0x446e40){var _0x109d6a={'raw':!![],'where':{}};var _0x223ab1={};var _0x12085a={'count':0x0,'rows':[]};return db[_0x66c7('0x40')][_0x66c7('0x57')]({'where':{'id':_0x58f604[_0x66c7('0x47')]['id']}})['then'](handleEntityNotFound(_0x475272,null))[_0x66c7('0x20')](function(_0xb951d4){if(_0xb951d4){_0x223ab1[_0x66c7('0x2c')]=_['keys'](db[_0x66c7('0x5d')][_0x66c7('0x29')]);_0x223ab1[_0x66c7('0x2d')]=_[_0x66c7('0x2e')](_0x58f604[_0x66c7('0x2d')]);_0x223ab1[_0x66c7('0x3a')]=_[_0x66c7('0x2f')](_0x223ab1['model'],_0x223ab1[_0x66c7('0x2d')]);_0x109d6a['attributes']=_['intersection'](_0x223ab1['model'],qs['fields'](_0x58f604[_0x66c7('0x2d')][_0x66c7('0x31')]));_0x109d6a['attributes']=_0x109d6a['attributes'][_0x66c7('0x32')]?_0x109d6a[_0x66c7('0x30')]:_0x223ab1['model'];if(!_0x58f604['query'][_0x66c7('0x33')]('nolimit')){_0x109d6a['limit']=qs[_0x66c7('0x35')](_0x58f604[_0x66c7('0x2d')]['limit']);_0x109d6a[_0x66c7('0x36')]=qs[_0x66c7('0x36')](_0x58f604[_0x66c7('0x2d')][_0x66c7('0x36')]);}_0x109d6a[_0x66c7('0x37')]=qs[_0x66c7('0x38')](_0x58f604[_0x66c7('0x2d')][_0x66c7('0x38')]);_0x109d6a[_0x66c7('0x39')]=qs['filters'](_[_0x66c7('0x3b')](_0x58f604['query'],_0x223ab1[_0x66c7('0x3a')]));_0x109d6a[_0x66c7('0x39')]['CampaignId']=_0xb951d4['id'];if(_0x58f604[_0x66c7('0x2d')][_0x66c7('0x3c')]){_0x109d6a[_0x66c7('0x39')]=_[_0x66c7('0x3d')](_0x109d6a[_0x66c7('0x39')],{'$or':_['map'](_0x109d6a[_0x66c7('0x30')],function(_0x5c463c){var _0x44df97={};_0x44df97[_0x5c463c]={'$like':'%'+_0x58f604[_0x66c7('0x2d')][_0x66c7('0x3c')]+'%'};return _0x44df97;})});}_0x109d6a=_[_0x66c7('0x3d')]({},_0x109d6a,_0x58f604[_0x66c7('0x3f')]);return db[_0x66c7('0x5d')][_0x66c7('0x1a')]({'where':_0x109d6a['where']})['then'](function(_0x2ed11c){_0x12085a['count']=_0x2ed11c;if(_0x58f604['query']['includeAll']){_0x109d6a[_0x66c7('0x42')]=[{'all':!![]}];}return db['CmHopperFinal'][_0x66c7('0x43')](_0x109d6a);})[_0x66c7('0x20')](function(_0x40d269){_0x12085a['rows']=_0x40d269;return _0x12085a;});}})[_0x66c7('0x20')](respondWithFilteredResult(_0x475272,_0x109d6a))['catch'](handleError(_0x475272,null));};exports[_0x66c7('0x5e')]=function(_0x5ed31b,_0x37fb5a,_0x248b31){var _0xca6817={'raw':!![],'where':{}};var _0x3c8c2b={};var _0x10d0cf={'count':0x0,'rows':[]};return db[_0x66c7('0x40')][_0x66c7('0x57')]({'where':{'id':_0x5ed31b['params']['id']}})[_0x66c7('0x20')](handleEntityNotFound(_0x37fb5a,null))['then'](function(_0x580072){if(_0x580072){_0x3c8c2b[_0x66c7('0x2c')]=_[_0x66c7('0x2e')](db[_0x66c7('0x5f')][_0x66c7('0x29')]);_0x3c8c2b[_0x66c7('0x2d')]=_[_0x66c7('0x2e')](_0x5ed31b[_0x66c7('0x2d')]);_0x3c8c2b[_0x66c7('0x3a')]=_[_0x66c7('0x2f')](_0x3c8c2b[_0x66c7('0x2c')],_0x3c8c2b[_0x66c7('0x2d')]);_0xca6817[_0x66c7('0x30')]=_[_0x66c7('0x2f')](_0x3c8c2b['model'],qs[_0x66c7('0x31')](_0x5ed31b['query'][_0x66c7('0x31')]));_0xca6817[_0x66c7('0x30')]=_0xca6817[_0x66c7('0x30')][_0x66c7('0x32')]?_0xca6817[_0x66c7('0x30')]:_0x3c8c2b[_0x66c7('0x2c')];if(!_0x5ed31b['query']['hasOwnProperty']('nolimit')){_0xca6817['limit']=qs['limit'](_0x5ed31b[_0x66c7('0x2d')][_0x66c7('0x35')]);_0xca6817[_0x66c7('0x36')]=qs[_0x66c7('0x36')](_0x5ed31b['query']['offset']);}_0xca6817[_0x66c7('0x37')]=qs[_0x66c7('0x38')](_0x5ed31b['query'][_0x66c7('0x38')]);_0xca6817[_0x66c7('0x39')]=qs['filters'](_[_0x66c7('0x3b')](_0x5ed31b[_0x66c7('0x2d')],_0x3c8c2b[_0x66c7('0x3a')]));_0xca6817[_0x66c7('0x39')]['CampaignId']=_0x580072['id'];if(_0x5ed31b['query'][_0x66c7('0x3c')]){_0xca6817[_0x66c7('0x39')]=_[_0x66c7('0x3d')](_0xca6817[_0x66c7('0x39')],{'$or':_[_0x66c7('0x28')](_0xca6817[_0x66c7('0x30')],function(_0x30b087){var _0x2ff6f2={};_0x2ff6f2[_0x30b087]={'$like':'%'+_0x5ed31b[_0x66c7('0x2d')][_0x66c7('0x3c')]+'%'};return _0x2ff6f2;})});}_0xca6817=_['merge']({},_0xca6817,_0x5ed31b[_0x66c7('0x3f')]);return db[_0x66c7('0x5f')][_0x66c7('0x1a')]({'where':_0xca6817[_0x66c7('0x39')]})[_0x66c7('0x20')](function(_0x3fb5eb){_0x10d0cf[_0x66c7('0x1a')]=_0x3fb5eb;if(_0x5ed31b[_0x66c7('0x2d')][_0x66c7('0x41')]){_0xca6817[_0x66c7('0x42')]=[{'all':!![]}];}return db['CmHopperBlack'][_0x66c7('0x43')](_0xca6817);})[_0x66c7('0x20')](function(_0x140a3d){_0x10d0cf[_0x66c7('0x44')]=_0x140a3d;return _0x10d0cf;});}})[_0x66c7('0x20')](respondWithFilteredResult(_0x37fb5a,_0xca6817))[_0x66c7('0x45')](handleError(_0x37fb5a,null));};exports[_0x66c7('0x60')]=function(_0x35ab01,_0x5f0f33,_0x18c58a){var _0x2bac63={};var _0x4377f1={};var _0x45720f;var _0x13477f;return db[_0x66c7('0x40')][_0x66c7('0x57')]({'where':{'id':_0x35ab01[_0x66c7('0x47')]['id']}})[_0x66c7('0x20')](handleEntityNotFound(_0x5f0f33,null))[_0x66c7('0x20')](function(_0x3259b1){if(_0x3259b1){_0x45720f=_0x3259b1;_0x4377f1[_0x66c7('0x2c')]=_['keys'](db['CmList'][_0x66c7('0x29')]);_0x4377f1[_0x66c7('0x2d')]=_[_0x66c7('0x2e')](_0x35ab01[_0x66c7('0x2d')]);_0x4377f1[_0x66c7('0x3a')]=_[_0x66c7('0x2f')](_0x4377f1[_0x66c7('0x2c')],_0x4377f1[_0x66c7('0x2d')]);_0x2bac63['attributes']=_[_0x66c7('0x2f')](_0x4377f1[_0x66c7('0x2c')],qs['fields'](_0x35ab01[_0x66c7('0x2d')][_0x66c7('0x31')]));_0x2bac63[_0x66c7('0x30')]=_0x2bac63[_0x66c7('0x30')]['length']?_0x2bac63[_0x66c7('0x30')]:_0x4377f1[_0x66c7('0x2c')];_0x2bac63[_0x66c7('0x37')]=qs[_0x66c7('0x38')](_0x35ab01['query']['sort']);_0x2bac63[_0x66c7('0x39')]=qs[_0x66c7('0x3a')](_[_0x66c7('0x3b')](_0x35ab01[_0x66c7('0x2d')],_0x4377f1[_0x66c7('0x3a')]));if(_0x35ab01[_0x66c7('0x2d')]['filter']){_0x2bac63[_0x66c7('0x39')]=_[_0x66c7('0x3d')](_0x2bac63[_0x66c7('0x39')],{'$or':_[_0x66c7('0x28')](_0x2bac63['attributes'],function(_0x233f72){var _0x4b01ee={};_0x4b01ee[_0x233f72]={'$like':'%'+_0x35ab01[_0x66c7('0x2d')]['filter']+'%'};return _0x4b01ee;})});}_0x2bac63=_['merge']({},_0x2bac63,_0x35ab01[_0x66c7('0x3f')]);return _0x45720f[_0x66c7('0x60')](_0x2bac63);}})['then'](function(_0x533816){if(_0x533816){_0x13477f=_0x533816[_0x66c7('0x32')];if(!_0x35ab01['query'][_0x66c7('0x33')](_0x66c7('0x34'))){_0x2bac63[_0x66c7('0x35')]=qs[_0x66c7('0x35')](_0x35ab01['query'][_0x66c7('0x35')]);_0x2bac63[_0x66c7('0x36')]=qs[_0x66c7('0x36')](_0x35ab01[_0x66c7('0x2d')][_0x66c7('0x36')]);}return _0x45720f['getLists'](_0x2bac63);}})['then'](function(_0x100338){if(_0x100338){return _0x100338?{'count':_0x13477f,'rows':_0x100338}:null;}})[_0x66c7('0x20')](respondWithResult(_0x5f0f33,null))[_0x66c7('0x45')](handleError(_0x5f0f33,null));};exports[_0x66c7('0x61')]=function(_0x3bae47,_0x501a80,_0x290fcc){var _0x3a8821,_0x405cfc;return db[_0x66c7('0x40')][_0x66c7('0x4d')]({'where':{'id':_0x3bae47['params']['id']}})['then'](handleEntityNotFound(_0x501a80,null))[_0x66c7('0x20')](function(_0x328532){if(_0x328532){_0x405cfc=_0x328532;return _0x328532['addLists'](_0x3bae47[_0x66c7('0x53')]['ids'],_[_0x66c7('0x52')](_0x3bae47[_0x66c7('0x53')],[_0x66c7('0x62'),'id'])||{});}return null;})['spread'](function(_0x1354ef){var _0x5013a7;_0x3a8821=_0x1354ef||[];var _0x46c2ff=[];if(_0x1354ef){for(var _0x4dd492=0x0;_0x4dd492<_0x1354ef[_0x66c7('0x32')];_0x4dd492+=0x1){var _0x361fe0=_0x1354ef[_0x4dd492][_0x66c7('0x22')]({'plain':!![]});_0x405cfc[_0x66c7('0x63')]=_0x3bae47['body'][_0x66c7('0x63')]?_0x3bae47[_0x66c7('0x53')]['dialCheckDuplicateType']:_0x405cfc[_0x66c7('0x63')];switch(_0x405cfc[_0x66c7('0x63')]){case'always':_0x5013a7=squel[_0x66c7('0x64')]()[_0x66c7('0x65')](_0x66c7('0x66'))[_0x66c7('0x67')](['phone','scheduledAt',_0x66c7('0x68'),'ListId',_0x66c7('0x59'),_0x66c7('0x69'),'updatedAt'],squel[_0x66c7('0x6a')]()['field'](_0x66c7('0x6b'),_0x66c7('0x6b'))[_0x66c7('0x6c')](_0x66c7('0x6d'),'scheduledAt')[_0x66c7('0x6c')]('id',_0x66c7('0x68'))['field'](_0x361fe0[_0x66c7('0x6e')][_0x66c7('0x6f')](),_0x66c7('0x70'))[_0x66c7('0x6c')](_0x3bae47[_0x66c7('0x47')]['id'][_0x66c7('0x6f')](),_0x66c7('0x59'))[_0x66c7('0x6c')](_0x66c7('0x6d'),_0x66c7('0x69'))[_0x66c7('0x6c')](_0x66c7('0x6d'),_0x66c7('0x54'))[_0x66c7('0x71')](_0x66c7('0x72'))[_0x66c7('0x39')]('deletedAt\x20IS\x20NULL')[_0x66c7('0x39')]('ListId\x20=\x20?',_0x361fe0['CmListId'][_0x66c7('0x6f')]())[_0x66c7('0x39')]('phone\x20IS\x20NOT\x20NULL')[_0x66c7('0x39')](_0x66c7('0x73'),squel[_0x66c7('0x6a')]()[_0x66c7('0x6c')](_0x66c7('0x74'))['from'](_0x66c7('0x75'))[_0x66c7('0x39')](_0x66c7('0x76'),_0x3bae47[_0x66c7('0x47')]['id'][_0x66c7('0x6f')]()))[_0x66c7('0x39')]('phone\x20NOT\x20IN\x20(?)',squel[_0x66c7('0x6a')]()['field'](_0x66c7('0x77'))['from'](_0x66c7('0x66'))[_0x66c7('0x39')](_0x66c7('0x76'),_0x3bae47[_0x66c7('0x47')]['id'][_0x66c7('0x6f')]())))['toString']();break;case _0x66c7('0x78'):_0x5013a7=squel[_0x66c7('0x64')]()[_0x66c7('0x65')]('cm_hopper')[_0x66c7('0x67')](['phone',_0x66c7('0x79'),_0x66c7('0x68'),'ListId',_0x66c7('0x59'),_0x66c7('0x69'),_0x66c7('0x54')],squel['select']()[_0x66c7('0x6c')](_0x66c7('0x6b'),_0x66c7('0x6b'))['field']('NOW()',_0x66c7('0x79'))['field']('id',_0x66c7('0x68'))[_0x66c7('0x6c')](_0x361fe0['CmListId'][_0x66c7('0x6f')](),'ListId')['field'](_0x3bae47[_0x66c7('0x47')]['id'][_0x66c7('0x6f')](),_0x66c7('0x59'))['field'](_0x66c7('0x6d'),_0x66c7('0x69'))[_0x66c7('0x6c')](_0x66c7('0x6d'),_0x66c7('0x54'))['from'](_0x66c7('0x72'))[_0x66c7('0x39')](_0x66c7('0x7a'))['where'](_0x66c7('0x7b'),_0x361fe0['CmListId'][_0x66c7('0x6f')]())[_0x66c7('0x39')](_0x66c7('0x7c'))[_0x66c7('0x39')](_0x66c7('0x73'),squel[_0x66c7('0x6a')]()['field'](_0x66c7('0x77'))[_0x66c7('0x71')]('cm_hopper')[_0x66c7('0x39')](_0x66c7('0x76'),_0x3bae47[_0x66c7('0x47')]['id'][_0x66c7('0x6f')]())))['toString']();break;default:_0x5013a7=squel[_0x66c7('0x64')]()[_0x66c7('0x65')]('cm_hopper')['fromQuery'](['phone',_0x66c7('0x79'),_0x66c7('0x68'),_0x66c7('0x70'),_0x66c7('0x59'),_0x66c7('0x69'),_0x66c7('0x54')],squel['select']()[_0x66c7('0x6c')](_0x66c7('0x6b'),_0x66c7('0x6b'))[_0x66c7('0x6c')](_0x66c7('0x6d'),_0x66c7('0x79'))[_0x66c7('0x6c')]('id','ContactId')[_0x66c7('0x6c')](_0x361fe0['CmListId'][_0x66c7('0x6f')](),_0x66c7('0x70'))['field'](_0x3bae47[_0x66c7('0x47')]['id'][_0x66c7('0x6f')](),_0x66c7('0x59'))['field'](_0x66c7('0x6d'),_0x66c7('0x69'))[_0x66c7('0x6c')](_0x66c7('0x6d'),_0x66c7('0x54'))['from'](_0x66c7('0x72'))[_0x66c7('0x39')](_0x66c7('0x7a'))[_0x66c7('0x39')]('ListId\x20=\x20?',_0x361fe0[_0x66c7('0x6e')][_0x66c7('0x6f')]())[_0x66c7('0x39')]('phone\x20IS\x20NOT\x20NULL'))['toString']();}_0x46c2ff[_0x66c7('0x7d')](db[_0x66c7('0x7e')][_0x66c7('0x2d')](_0x5013a7));}return BPromise[_0x66c7('0x7f')](_0x46c2ff);}})[_0x66c7('0x20')](function(){return _0x3a8821;})[_0x66c7('0x20')](respondWithResult(_0x501a80,null))[_0x66c7('0x45')](handleError(_0x501a80,null));};exports[_0x66c7('0x80')]=function(_0x54785,_0x3b538e,_0x49399d){return db['Campaign'][_0x66c7('0x4d')]({'where':{'id':_0x54785[_0x66c7('0x47')]['id']}})[_0x66c7('0x20')](handleEntityNotFound(_0x3b538e,null))[_0x66c7('0x20')](function(_0x3fb850){if(_0x3fb850){return _0x3fb850[_0x66c7('0x80')](_0x54785[_0x66c7('0x2d')]['ids']);}})['then'](function(_0x181009){if(_0x181009){return db[_0x66c7('0x58')][_0x66c7('0x21')]({'where':{'ListId':_0x54785[_0x66c7('0x2d')][_0x66c7('0x62')],'CampaignId':_0x54785[_0x66c7('0x47')]['id']}})[_0x66c7('0x20')](function(){return _0x181009;});}})['then'](respondWithStatusCode(_0x3b538e,null))[_0x66c7('0x45')](handleError(_0x3b538e,null));};exports[_0x66c7('0x81')]=function(_0x200825,_0xebc457,_0x2dd01b){var _0x166911={'raw':!![],'where':{}};var _0x308efe={};var _0x1ab91c={'count':0x0,'rows':[]};return db[_0x66c7('0x40')]['findOne']({'where':{'id':_0x200825[_0x66c7('0x47')]['id']}})[_0x66c7('0x20')](handleEntityNotFound(_0xebc457,null))['then'](function(_0x426f22){if(_0x426f22){_0x308efe[_0x66c7('0x2c')]=_[_0x66c7('0x2e')](db[_0x66c7('0x82')][_0x66c7('0x29')]);_0x308efe[_0x66c7('0x2d')]=_['keys'](_0x200825[_0x66c7('0x2d')]);_0x308efe['filters']=_[_0x66c7('0x2f')](_0x308efe[_0x66c7('0x2c')],_0x308efe[_0x66c7('0x2d')]);_0x166911[_0x66c7('0x30')]=_[_0x66c7('0x2f')](_0x308efe['model'],qs[_0x66c7('0x31')](_0x200825[_0x66c7('0x2d')][_0x66c7('0x31')]));_0x166911[_0x66c7('0x30')]=_0x166911[_0x66c7('0x30')]['length']?_0x166911[_0x66c7('0x30')]:_0x308efe[_0x66c7('0x2c')];if(!_0x200825[_0x66c7('0x2d')]['hasOwnProperty'](_0x66c7('0x34'))){_0x166911[_0x66c7('0x35')]=qs[_0x66c7('0x35')](_0x200825[_0x66c7('0x2d')][_0x66c7('0x35')]);_0x166911[_0x66c7('0x36')]=qs[_0x66c7('0x36')](_0x200825['query'][_0x66c7('0x36')]);}_0x166911[_0x66c7('0x37')]=qs[_0x66c7('0x38')](_0x200825[_0x66c7('0x2d')][_0x66c7('0x38')]);_0x166911['where']=qs['filters'](_[_0x66c7('0x3b')](_0x200825[_0x66c7('0x2d')],_0x308efe[_0x66c7('0x3a')]));_0x166911['where'][_0x66c7('0x59')]=_0x426f22['id'];if(_0x200825[_0x66c7('0x2d')][_0x66c7('0x3c')]){_0x166911[_0x66c7('0x39')]=_[_0x66c7('0x3d')](_0x166911[_0x66c7('0x39')],{'$or':_[_0x66c7('0x28')](_0x166911['attributes'],function(_0x48e6a4){var _0x27e1d9={};_0x27e1d9[_0x48e6a4]={'$like':'%'+_0x200825[_0x66c7('0x2d')]['filter']+'%'};return _0x27e1d9;})});}_0x166911=_[_0x66c7('0x3d')]({},_0x166911,_0x200825[_0x66c7('0x3f')]);return db[_0x66c7('0x82')][_0x66c7('0x1a')]({'where':_0x166911['where']})[_0x66c7('0x20')](function(_0x34c44c){_0x1ab91c['count']=_0x34c44c;if(_0x200825[_0x66c7('0x2d')][_0x66c7('0x41')]){_0x166911[_0x66c7('0x42')]=[{'all':!![]}];}return db['CmList'][_0x66c7('0x43')](_0x166911);})['then'](function(_0x52de9e){_0x1ab91c[_0x66c7('0x44')]=_0x52de9e;return _0x1ab91c;});}})[_0x66c7('0x20')](respondWithFilteredResult(_0xebc457,_0x166911))[_0x66c7('0x45')](handleError(_0xebc457,null));};exports[_0x66c7('0x83')]=function(_0x3e875e,_0x24eb7f,_0x273c3f){var _0x2987c4,_0x3a3ec7;return db[_0x66c7('0x40')][_0x66c7('0x4d')]({'where':{'id':_0x3e875e[_0x66c7('0x47')]['id']}})[_0x66c7('0x20')](handleEntityNotFound(_0x24eb7f,null))['then'](function(_0x1f1d95){if(_0x1f1d95){_0x3a3ec7=_0x1f1d95;return _0x1f1d95[_0x66c7('0x83')](_0x3e875e[_0x66c7('0x53')][_0x66c7('0x62')],_[_0x66c7('0x52')](_0x3e875e[_0x66c7('0x53')],[_0x66c7('0x62'),'id'])||{});}return null;})['spread'](function(_0x2beba7){var _0x110e58;_0x2987c4=_0x2beba7||[];var _0x2a9750=[];if(_0x2beba7){for(var _0x11f42d=0x0;_0x11f42d<_0x2beba7[_0x66c7('0x32')];_0x11f42d+=0x1){var _0x2aa16a=_0x2beba7[_0x11f42d][_0x66c7('0x22')]({'plain':!![]});_0x110e58=squel[_0x66c7('0x64')]()[_0x66c7('0x65')](_0x66c7('0x84'))[_0x66c7('0x67')](['phone',_0x66c7('0x68'),_0x66c7('0x70'),_0x66c7('0x59'),_0x66c7('0x69'),_0x66c7('0x54')],squel[_0x66c7('0x6a')]()['field'](_0x66c7('0x6b'),'phone')[_0x66c7('0x6c')]('id',_0x66c7('0x68'))[_0x66c7('0x6c')](_0x2aa16a[_0x66c7('0x6e')][_0x66c7('0x6f')](),_0x66c7('0x70'))[_0x66c7('0x6c')](_0x3e875e[_0x66c7('0x47')]['id'][_0x66c7('0x6f')](),_0x66c7('0x59'))[_0x66c7('0x6c')](_0x66c7('0x6d'),_0x66c7('0x69'))[_0x66c7('0x6c')](_0x66c7('0x6d'),'updatedAt')['from'](_0x66c7('0x72'))['where']('deletedAt\x20IS\x20NULL')['where'](_0x66c7('0x7b'),_0x2aa16a['CmListId']['toString']())['where']('phone\x20IS\x20NOT\x20NULL'))['toString']();_0x2a9750[_0x66c7('0x7d')](db[_0x66c7('0x7e')][_0x66c7('0x2d')](_0x110e58));}return BPromise[_0x66c7('0x7f')](_0x2a9750);}})[_0x66c7('0x20')](function(){return _0x2987c4;})[_0x66c7('0x20')](respondWithResult(_0x24eb7f,null))[_0x66c7('0x45')](handleError(_0x24eb7f,null));};exports['removeBlackLists']=function(_0x5ef922,_0x1cc5b7,_0x13f04b){return db[_0x66c7('0x40')][_0x66c7('0x4d')]({'where':{'id':_0x5ef922[_0x66c7('0x47')]['id']}})[_0x66c7('0x20')](handleEntityNotFound(_0x1cc5b7,null))[_0x66c7('0x20')](function(_0x55a4e2){if(_0x55a4e2){return _0x55a4e2[_0x66c7('0x85')](_0x5ef922[_0x66c7('0x2d')][_0x66c7('0x62')]);}})[_0x66c7('0x20')](function(_0x380187){if(_0x380187){return db['CmHopperBlack'][_0x66c7('0x21')]({'where':{'ListId':_0x5ef922[_0x66c7('0x2d')]['ids'],'CampaignId':_0x5ef922[_0x66c7('0x47')]['id']}})[_0x66c7('0x20')](function(){return _0x380187;});}})[_0x66c7('0x20')](respondWithStatusCode(_0x1cc5b7,null))[_0x66c7('0x45')](handleError(_0x1cc5b7,null));};
\ No newline at end of file
diff --git a/server/api/campaign/campaign.model.js b/server/api/campaign/campaign.model.js
index 5cea02c..15eba8e 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 _0x715e=['api','request-promise','path','rimraf','../../config/environment','./campaign.attributes','define','Campaign','lodash','util','../../config/logger'];(function(_0x398299,_0x35be41){var _0xbeac56=function(_0x28b602){while(--_0x28b602){_0x398299['push'](_0x398299['shift']());}};_0xbeac56(++_0x35be41);}(_0x715e,0x131));var _0xe715=function(_0x3d42d8,_0x4cffaa){_0x3d42d8=_0x3d42d8-0x0;var _0x27fc41=_0x715e[_0x3d42d8];return _0x27fc41;};'use strict';var _=require(_0xe715('0x0'));var util=require(_0xe715('0x1'));var logger=require(_0xe715('0x2'))(_0xe715('0x3'));var moment=require('moment');var BPromise=require('bluebird');var rp=require(_0xe715('0x4'));var fs=require('fs');var path=require(_0xe715('0x5'));var rimraf=require(_0xe715('0x6'));var config=require(_0xe715('0x7'));var attributes=require(_0xe715('0x8'));module['exports']=function(_0x5a6418,_0x2b4011){return _0x5a6418[_0xe715('0x9')](_0xe715('0xa'),attributes,{'tableName':'campaigns','paranoid':![],'indexes':[],'timestamps':!![]});};
\ No newline at end of file
+var _0x3bb2=['exports','Campaign','campaigns','util','../../config/logger','moment','bluebird','request-promise','rimraf','./campaign.attributes'];(function(_0x4e51f8,_0x323ff2){var _0x1edd69=function(_0x14730f){while(--_0x14730f){_0x4e51f8['push'](_0x4e51f8['shift']());}};_0x1edd69(++_0x323ff2);}(_0x3bb2,0x1bb));var _0x23bb=function(_0x523191,_0x2a654c){_0x523191=_0x523191-0x0;var _0x30a906=_0x3bb2[_0x523191];return _0x30a906;};'use strict';var _=require('lodash');var util=require(_0x23bb('0x0'));var logger=require(_0x23bb('0x1'))('api');var moment=require(_0x23bb('0x2'));var BPromise=require(_0x23bb('0x3'));var rp=require(_0x23bb('0x4'));var fs=require('fs');var path=require('path');var rimraf=require(_0x23bb('0x5'));var config=require('../../config/environment');var attributes=require(_0x23bb('0x6'));module[_0x23bb('0x7')]=function(_0x588d07,_0x45c16e){return _0x588d07['define'](_0x23bb('0x8'),attributes,{'tableName':_0x23bb('0x9'),'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 bd99fa2..cd72466 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(_0x23b00f,_0x5ed2eb){var _0x284fb6=function(_0x37d54b){while(--_0x37d54b){_0x23b00f['push'](_0x23b00f['shift']());}};_0x284fb6(++_0x5ed2eb);}(_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);});});}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(_0x15d4cb,_0x3abf19){var _0x15c11a=function(_0x89780a){while(--_0x89780a){_0x15d4cb['push'](_0x15d4cb['shift']());}};_0x15c11a(++_0x3abf19);}(_0xa9e0,0x123));var _0x0a9e=function(_0xbca1b1,_0x33f0ce){_0xbca1b1=_0xbca1b1-0x0;var _0x4e1686=_0xa9e0[_0xbca1b1];return _0x4e1686;};'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 ca2c103..31c03e3 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 _0xc7e4=['multer','util','path','Router','../../components/interaction/service','../../config/environment','./campaign.controller','get','isAuthenticated','index','/:id','show','getHoppers','/:id/hopper_histories','getHopperHistories','getHopperFinals','getHopperBlacks','/:id/lists','getLists','/:id/blacklists','getBlackLists','post','clone','addLists','addBlackLists','put','update','delete','destroy','removeLists','removeBlackLists'];(function(_0x504891,_0x43dabb){var _0x511eda=function(_0x25ce87){while(--_0x25ce87){_0x504891['push'](_0x504891['shift']());}};_0x511eda(++_0x43dabb);}(_0xc7e4,0x193));var _0x4c7e=function(_0x29e722,_0x33e8a7){_0x29e722=_0x29e722-0x0;var _0x5231ca=_0xc7e4[_0x29e722];return _0x5231ca;};'use strict';var multer=require(_0x4c7e('0x0'));var util=require(_0x4c7e('0x1'));var path=require(_0x4c7e('0x2'));var timeout=require('connect-timeout');var express=require('express');var router=express[_0x4c7e('0x3')]();var auth=require('../../components/auth/service');var interaction=require(_0x4c7e('0x4'));var config=require(_0x4c7e('0x5'));var controller=require(_0x4c7e('0x6'));router[_0x4c7e('0x7')]('/',auth[_0x4c7e('0x8')](),controller[_0x4c7e('0x9')]);router['get'](_0x4c7e('0xa'),auth['isAuthenticated'](),controller[_0x4c7e('0xb')]);router[_0x4c7e('0x7')]('/:id/hoppers',auth[_0x4c7e('0x8')](),controller[_0x4c7e('0xc')]);router[_0x4c7e('0x7')](_0x4c7e('0xd'),auth[_0x4c7e('0x8')](),controller[_0x4c7e('0xe')]);router[_0x4c7e('0x7')]('/:id/hopper_finals',auth[_0x4c7e('0x8')](),controller[_0x4c7e('0xf')]);router[_0x4c7e('0x7')]('/:id/hopper_black',auth[_0x4c7e('0x8')](),controller[_0x4c7e('0x10')]);router[_0x4c7e('0x7')](_0x4c7e('0x11'),auth['isAuthenticated'](),controller[_0x4c7e('0x12')]);router[_0x4c7e('0x7')](_0x4c7e('0x13'),auth[_0x4c7e('0x8')](),controller[_0x4c7e('0x14')]);router[_0x4c7e('0x15')]('/',auth['isAuthenticated'](),controller['create']);router[_0x4c7e('0x15')]('/:id/clone',auth[_0x4c7e('0x8')](),controller[_0x4c7e('0x16')]);router['post']('/:id/lists',auth[_0x4c7e('0x8')](),controller[_0x4c7e('0x17')]);router[_0x4c7e('0x15')](_0x4c7e('0x13'),auth['isAuthenticated'](),controller[_0x4c7e('0x18')]);router[_0x4c7e('0x19')](_0x4c7e('0xa'),auth[_0x4c7e('0x8')](),controller[_0x4c7e('0x1a')]);router[_0x4c7e('0x1b')]('/:id',auth[_0x4c7e('0x8')](),controller[_0x4c7e('0x1c')]);router[_0x4c7e('0x1b')](_0x4c7e('0x11'),auth['isAuthenticated'](),controller[_0x4c7e('0x1d')]);router['delete'](_0x4c7e('0x13'),auth[_0x4c7e('0x8')](),controller[_0x4c7e('0x1e')]);module['exports']=router;
\ No newline at end of file
+var _0xdb15=['/:id','show','/:id/hoppers','getHoppers','/:id/hopper_histories','getHopperHistories','/:id/hopper_finals','getHopperFinals','/:id/hopper_black','getHopperBlacks','/:id/lists','getLists','/:id/blacklists','create','post','/:id/clone','clone','addLists','addBlackLists','update','delete','destroy','removeLists','exports','util','path','express','Router','../../components/interaction/service','../../config/environment','get','isAuthenticated','index'];(function(_0x3945b9,_0x6ff682){var _0x579f7a=function(_0x3838cd){while(--_0x3838cd){_0x3945b9['push'](_0x3945b9['shift']());}};_0x579f7a(++_0x6ff682);}(_0xdb15,0x141));var _0x5db1=function(_0x57b697,_0x226db7){_0x57b697=_0x57b697-0x0;var _0x4e6c0e=_0xdb15[_0x57b697];return _0x4e6c0e;};'use strict';var multer=require('multer');var util=require(_0x5db1('0x0'));var path=require(_0x5db1('0x1'));var timeout=require('connect-timeout');var express=require(_0x5db1('0x2'));var router=express[_0x5db1('0x3')]();var auth=require('../../components/auth/service');var interaction=require(_0x5db1('0x4'));var config=require(_0x5db1('0x5'));var controller=require('./campaign.controller');router[_0x5db1('0x6')]('/',auth[_0x5db1('0x7')](),controller[_0x5db1('0x8')]);router[_0x5db1('0x6')](_0x5db1('0x9'),auth[_0x5db1('0x7')](),controller[_0x5db1('0xa')]);router[_0x5db1('0x6')](_0x5db1('0xb'),auth[_0x5db1('0x7')](),controller[_0x5db1('0xc')]);router[_0x5db1('0x6')](_0x5db1('0xd'),auth[_0x5db1('0x7')](),controller[_0x5db1('0xe')]);router[_0x5db1('0x6')](_0x5db1('0xf'),auth[_0x5db1('0x7')](),controller[_0x5db1('0x10')]);router[_0x5db1('0x6')](_0x5db1('0x11'),auth['isAuthenticated'](),controller[_0x5db1('0x12')]);router[_0x5db1('0x6')](_0x5db1('0x13'),auth['isAuthenticated'](),controller[_0x5db1('0x14')]);router['get'](_0x5db1('0x15'),auth['isAuthenticated'](),controller['getBlackLists']);router['post']('/',auth['isAuthenticated'](),controller[_0x5db1('0x16')]);router[_0x5db1('0x17')](_0x5db1('0x18'),auth[_0x5db1('0x7')](),controller[_0x5db1('0x19')]);router[_0x5db1('0x17')](_0x5db1('0x13'),auth[_0x5db1('0x7')](),controller[_0x5db1('0x1a')]);router[_0x5db1('0x17')](_0x5db1('0x15'),auth[_0x5db1('0x7')](),controller[_0x5db1('0x1b')]);router['put'](_0x5db1('0x9'),auth[_0x5db1('0x7')](),controller[_0x5db1('0x1c')]);router[_0x5db1('0x1d')](_0x5db1('0x9'),auth['isAuthenticated'](),controller[_0x5db1('0x1e')]);router[_0x5db1('0x1d')](_0x5db1('0x13'),auth[_0x5db1('0x7')](),controller[_0x5db1('0x1f')]);router[_0x5db1('0x1d')](_0x5db1('0x15'),auth[_0x5db1('0x7')](),controller['removeBlackLists']);module[_0x5db1('0x20')]=router;
\ No newline at end of file
diff --git a/server/api/cannedAnswer/cannedAnswer.attributes.js b/server/api/cannedAnswer/cannedAnswer.attributes.js
index 8b144d5..207b448 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 _0x1058=['STRING','key','sequelize','exports'];(function(_0x53fdef,_0x3d77da){var _0x7c13f0=function(_0x5563de){while(--_0x5563de){_0x53fdef['push'](_0x53fdef['shift']());}};_0x7c13f0(++_0x3d77da);}(_0x1058,0x102));var _0x8105=function(_0x2eeb9f,_0x1dad53){_0x2eeb9f=_0x2eeb9f-0x0;var _0x4eae5d=_0x1058[_0x2eeb9f];return _0x4eae5d;};'use strict';var Sequelize=require(_0x8105('0x0'));module[_0x8105('0x1')]={'key':{'type':Sequelize[_0x8105('0x2')],'allowNull':![]},'value':{'type':Sequelize['TEXT'],'allowNull':![]},'description':{'type':Sequelize[_0x8105('0x2')]},'name':{'type':Sequelize['VIRTUAL'],'get':function(){return this['getDataValue'](_0x8105('0x3'));}}};
\ No newline at end of file
+var _0x291d=['sequelize','exports','TEXT','STRING','getDataValue','key'];(function(_0x25f380,_0x405c02){var _0x36ad6b=function(_0x20e0a5){while(--_0x20e0a5){_0x25f380['push'](_0x25f380['shift']());}};_0x36ad6b(++_0x405c02);}(_0x291d,0x144));var _0xd291=function(_0x4709c0,_0x3396c7){_0x4709c0=_0x4709c0-0x0;var _0x13348b=_0x291d[_0x4709c0];return _0x13348b;};'use strict';var Sequelize=require(_0xd291('0x0'));module[_0xd291('0x1')]={'key':{'type':Sequelize['STRING'],'allowNull':![]},'value':{'type':Sequelize[_0xd291('0x2')],'allowNull':![]},'description':{'type':Sequelize[_0xd291('0x3')]},'name':{'type':Sequelize['VIRTUAL'],'get':function(){return this[_0xd291('0x4')](_0xd291('0x5'));}}};
\ No newline at end of file
diff --git a/server/api/cannedAnswer/cannedAnswer.controller.js b/server/api/cannedAnswer/cannedAnswer.controller.js
index 6007244..e8275f5 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 _0xa9e0=['filters','attributes','intersection','fields','length','hasOwnProperty','nolimit','limit','order','sort','pick','filter','where','VIRTUAL','merge','options','includeAll','findAll','rows','catch','show','params','include','find','body','create','MailAccountId','SmsAccountId','OpenchannelAccountId','Sequelize','The\x20inserted\x20key\x20already\x20exists.','user','Unable\x20to\x20retrieve\x20the\x20current\x20user','userProfileId','autoAssociation','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','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','get','CannedAnswers','UserProfileResource','end','error','name','send','index','map','CannedAnswer','rawAttributes','type','key','model','query','keys'];(function(_0x321bb2,_0x202794){var _0x9c12ed=function(_0x263dd3){while(--_0x263dd3){_0x321bb2['push'](_0x321bb2['shift']());}};_0x9c12ed(++_0x202794);}(_0xa9e0,0x123));var _0x0a9e=function(_0x5e3b04,_0xbb6795){_0x5e3b04=_0x5e3b04-0x0;var _0x1fc44d=_0xa9e0[_0x5e3b04];return _0x1fc44d;};'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(){var _0x38e7c4=_0x588269[_0x0a9e('0x21')]({'plain':!![]});var _0x4abc77=_0x0a9e('0x22');return db[_0x0a9e('0x23')][_0x0a9e('0x20')]({'where':{'type':_0x4abc77,'resourceId':_0x38e7c4['id']}})[_0x0a9e('0x1f')](function(){return _0x588269;});})[_0x0a9e('0x1f')](function(){_0x20f109[_0x0a9e('0x15')](0xcc)[_0x0a9e('0x24')]();});}};}function handleEntityNotFound(_0x5ea472,_0x59181e){return function(_0x197ec0){if(!_0x197ec0){_0x5ea472[_0x0a9e('0x14')](0x194);}return _0x197ec0;};}function handleError(_0x40c424,_0x33161b){_0x33161b=_0x33161b||0x1f4;return function(_0x526cf3){logger[_0x0a9e('0x25')](_0x526cf3['stack']);if(_0x526cf3[_0x0a9e('0x26')]){delete _0x526cf3['name'];}_0x40c424[_0x0a9e('0x15')](_0x33161b)[_0x0a9e('0x27')](_0x526cf3);};}exports[_0x0a9e('0x28')]=function(_0x14433c,_0x140511){var _0x1538a4={},_0x11c3b6={},_0x14de77={'count':0x0,'rows':[]};var _0x5a101a=_[_0x0a9e('0x29')](db[_0x0a9e('0x2a')][_0x0a9e('0x2b')],function(_0x2ec755){return{'name':_0x2ec755['fieldName'],'type':_0x2ec755[_0x0a9e('0x2c')][_0x0a9e('0x2d')]};});_0x11c3b6[_0x0a9e('0x2e')]=_[_0x0a9e('0x29')](_0x5a101a,_0x0a9e('0x26'));_0x11c3b6[_0x0a9e('0x2f')]=_[_0x0a9e('0x30')](_0x14433c[_0x0a9e('0x2f')]);_0x11c3b6[_0x0a9e('0x31')]=_['intersection'](_0x11c3b6[_0x0a9e('0x2e')],_0x11c3b6['query']);_0x1538a4[_0x0a9e('0x32')]=_[_0x0a9e('0x33')](_0x11c3b6[_0x0a9e('0x2e')],qs[_0x0a9e('0x34')](_0x14433c[_0x0a9e('0x2f')]['fields']));_0x1538a4[_0x0a9e('0x32')]=_0x1538a4[_0x0a9e('0x32')][_0x0a9e('0x35')]?_0x1538a4[_0x0a9e('0x32')]:_0x11c3b6[_0x0a9e('0x2e')];if(!_0x14433c[_0x0a9e('0x2f')][_0x0a9e('0x36')](_0x0a9e('0x37'))){_0x1538a4['limit']=qs[_0x0a9e('0x38')](_0x14433c['query'][_0x0a9e('0x38')]);_0x1538a4[_0x0a9e('0x18')]=qs[_0x0a9e('0x18')](_0x14433c[_0x0a9e('0x2f')]['offset']);}_0x1538a4[_0x0a9e('0x39')]=qs[_0x0a9e('0x3a')](_0x14433c[_0x0a9e('0x2f')][_0x0a9e('0x3a')]);_0x1538a4['where']=qs['filters'](_[_0x0a9e('0x3b')](_0x14433c['query'],_0x11c3b6[_0x0a9e('0x31')]));if(_0x14433c[_0x0a9e('0x2f')][_0x0a9e('0x3c')]){_0x1538a4[_0x0a9e('0x3d')]=_['merge'](_0x1538a4[_0x0a9e('0x3d')],{'$or':_[_0x0a9e('0x29')](_0x5a101a,function(_0x3cae){if(_0x3cae['type']!==_0x0a9e('0x3e')){var _0x1a180b={};_0x1a180b[_0x3cae[_0x0a9e('0x26')]]={'$like':'%'+_0x14433c['query']['filter']+'%'};return _0x1a180b;}})});}_0x1538a4=_[_0x0a9e('0x3f')]({},_0x1538a4,_0x14433c[_0x0a9e('0x40')]);var _0x5adda1={'where':_0x1538a4[_0x0a9e('0x3d')]};return db[_0x0a9e('0x2a')][_0x0a9e('0x17')](_0x5adda1)[_0x0a9e('0x1f')](function(_0x4b38d9){_0x14de77['count']=_0x4b38d9;if(_0x14433c[_0x0a9e('0x2f')][_0x0a9e('0x41')]){_0x1538a4['include']=[{'all':!![]}];}return db[_0x0a9e('0x2a')][_0x0a9e('0x42')](_0x1538a4);})[_0x0a9e('0x1f')](function(_0x5b4f5e){_0x14de77[_0x0a9e('0x43')]=_0x5b4f5e;return _0x14de77;})[_0x0a9e('0x1f')](respondWithFilteredResult(_0x140511,_0x1538a4))[_0x0a9e('0x44')](handleError(_0x140511,null));};exports[_0x0a9e('0x45')]=function(_0x13cb1f,_0xeaa5e5){var _0x2881b3={'raw':!![],'where':{'id':_0x13cb1f[_0x0a9e('0x46')]['id']}},_0x45a9b8={};_0x45a9b8[_0x0a9e('0x2e')]=_[_0x0a9e('0x30')](db[_0x0a9e('0x2a')][_0x0a9e('0x2b')]);_0x45a9b8[_0x0a9e('0x2f')]=_[_0x0a9e('0x30')](_0x13cb1f['query']);_0x45a9b8['filters']=_[_0x0a9e('0x33')](_0x45a9b8[_0x0a9e('0x2e')],_0x45a9b8[_0x0a9e('0x2f')]);_0x2881b3[_0x0a9e('0x32')]=_[_0x0a9e('0x33')](_0x45a9b8[_0x0a9e('0x2e')],qs[_0x0a9e('0x34')](_0x13cb1f[_0x0a9e('0x2f')][_0x0a9e('0x34')]));_0x2881b3[_0x0a9e('0x32')]=_0x2881b3[_0x0a9e('0x32')][_0x0a9e('0x35')]?_0x2881b3['attributes']:_0x45a9b8[_0x0a9e('0x2e')];if(_0x13cb1f[_0x0a9e('0x2f')][_0x0a9e('0x41')]){_0x2881b3[_0x0a9e('0x47')]=[{'all':!![]}];}_0x2881b3=_[_0x0a9e('0x3f')]({},_0x2881b3,_0x13cb1f[_0x0a9e('0x40')]);return db[_0x0a9e('0x2a')][_0x0a9e('0x48')](_0x2881b3)['then'](handleEntityNotFound(_0xeaa5e5,null))[_0x0a9e('0x1f')](respondWithResult(_0xeaa5e5,null))['catch'](handleError(_0xeaa5e5,null));};exports[_0x0a9e('0x1e')]=function(_0x476688,_0x8d6dd1){if(_0x476688['body']['id']){delete _0x476688[_0x0a9e('0x49')]['id'];}return db[_0x0a9e('0x2a')][_0x0a9e('0x48')]({'where':{'id':_0x476688[_0x0a9e('0x46')]['id']}})[_0x0a9e('0x1f')](handleEntityNotFound(_0x8d6dd1,null))[_0x0a9e('0x1f')](saveUpdates(_0x476688[_0x0a9e('0x49')],null))['then'](respondWithResult(_0x8d6dd1,null))[_0x0a9e('0x44')](handleError(_0x8d6dd1,null));};exports[_0x0a9e('0x20')]=function(_0x1b5e80,_0x16f976){return db[_0x0a9e('0x2a')][_0x0a9e('0x48')]({'where':{'id':_0x1b5e80[_0x0a9e('0x46')]['id']}})[_0x0a9e('0x1f')](handleEntityNotFound(_0x16f976,null))[_0x0a9e('0x1f')](removeEntity(_0x16f976,null))['catch'](handleError(_0x16f976,null));};exports[_0x0a9e('0x4a')]=function(_0x3fe430,_0x4f7240){var _0x4ae14b={'key':_0x3fe430['body'][_0x0a9e('0x2d')]};if(_0x3fe430[_0x0a9e('0x49')][_0x0a9e('0x4b')]){_0x4ae14b[_0x0a9e('0x4b')]=_0x3fe430[_0x0a9e('0x49')][_0x0a9e('0x4b')];}else if(_0x3fe430[_0x0a9e('0x49')][_0x0a9e('0x4c')]){_0x4ae14b['SmsAccountId']=_0x3fe430['body']['SmsAccountId'];}else if(_0x3fe430[_0x0a9e('0x49')][_0x0a9e('0x4d')]){_0x4ae14b[_0x0a9e('0x4d')]=_0x3fe430['body'][_0x0a9e('0x4d')];}else if(_0x3fe430[_0x0a9e('0x49')]['ChatWebsiteId']){_0x4ae14b['ChatWebsiteId']=_0x3fe430[_0x0a9e('0x49')]['ChatWebsiteId'];}return db[_0x0a9e('0x2a')]['find']({'where':_0x4ae14b})[_0x0a9e('0x1f')](function(_0x3c20b2){if(_0x3c20b2){throw new db[(_0x0a9e('0x4e'))]['ValidationError'](_0x0a9e('0x4f'));}return db[_0x0a9e('0x2a')]['create'](_0x3fe430['body']);})[_0x0a9e('0x1f')](function(_0x3aedd0){var _0x49c095=_0x3fe430[_0x0a9e('0x50')]['get']({'plain':!![]});if(!_0x49c095)throw new Error(_0x0a9e('0x51'));if(_0x49c095['role']===_0x0a9e('0x50')){var _0x4a6deb=_0x3aedd0['get']({'plain':!![]});return db['UserProfileSection'][_0x0a9e('0x48')]({'where':{'name':'CannedAnswers','userProfileId':_0x49c095[_0x0a9e('0x52')]},'raw':!![]})[_0x0a9e('0x1f')](function(_0x3cfd00){if(_0x3cfd00&&_0x3cfd00[_0x0a9e('0x53')]===0x0){return db[_0x0a9e('0x23')][_0x0a9e('0x4a')]({'name':_0x4a6deb[_0x0a9e('0x26')],'resourceId':_0x4a6deb['id'],'type':_0x3cfd00[_0x0a9e('0x26')],'sectionId':_0x3cfd00['id']},{})['then'](function(){return _0x3aedd0;});}else{return _0x3aedd0;}})[_0x0a9e('0x44')](function(_0x121cef){logger[_0x0a9e('0x25')](_0x0a9e('0x54'),_0x121cef);throw _0x121cef;});}return _0x3aedd0;})[_0x0a9e('0x1f')](respondWithResult(_0x4f7240,0xc9))[_0x0a9e('0x44')](handleError(_0x4f7240,null));};
\ No newline at end of file
+var _0x34e8=['filters','intersection','attributes','fields','length','order','sort','pick','filter','where','merge','options','include','findAll','catch','show','includeAll','find','body','params','MailAccountId','SmsAccountId','OpenchannelAccountId','ChatWebsiteId','The\x20inserted\x20key\x20already\x20exists.','create','user','Unable\x20to\x20retrieve\x20the\x20current\x20user','role','UserProfileSection','userProfileId','autoAssociation','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','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','status','end','json','count','offset','limit','set','Content-Range','reject','save','update','then','CannedAnswers','destroy','sendStatus','error','stack','name','map','CannedAnswer','rawAttributes','fieldName','type','key','model','keys','query'];(function(_0x50b2bb,_0x3822bf){var _0x26df2e=function(_0x300fce){while(--_0x300fce){_0x50b2bb['push'](_0x50b2bb['shift']());}};_0x26df2e(++_0x3822bf);}(_0x34e8,0x12c));var _0x834e=function(_0x1f6da7,_0x4cab44){_0x1f6da7=_0x1f6da7-0x0;var _0x403e4e=_0x34e8[_0x1f6da7];return _0x403e4e;};'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'];function respondWithStatusCode(_0x538bb3,_0x5e5b6d){_0x5e5b6d=_0x5e5b6d||0xcc;return function(_0x6cd9b9){if(_0x6cd9b9){return _0x538bb3['sendStatus'](_0x5e5b6d);}return _0x538bb3[_0x834e('0x1d')](_0x5e5b6d)[_0x834e('0x1e')]();};}function respondWithResult(_0x28e659,_0x21cc0a){_0x21cc0a=_0x21cc0a||0xc8;return function(_0x50e860){if(_0x50e860){return _0x28e659[_0x834e('0x1d')](_0x21cc0a)[_0x834e('0x1f')](_0x50e860);}};}function respondWithFilteredResult(_0x57274a,_0x316205){return function(_0x4a9cdc){if(_0x4a9cdc){var _0x38a8cd=_0x4a9cdc[_0x834e('0x20')],_0x36d443=_0x316205[_0x834e('0x21')],_0x478afe=_0x316205['offset']+_0x316205[_0x834e('0x22')],_0x43ac41;if(_0x478afe>=_0x38a8cd){_0x478afe=_0x38a8cd;_0x43ac41=0xc8;}else{_0x43ac41=0xce;}_0x57274a[_0x834e('0x1d')](_0x43ac41);return _0x57274a[_0x834e('0x23')](_0x834e('0x24'),_0x36d443+'-'+_0x478afe+'/'+_0x38a8cd)[_0x834e('0x1f')](_0x4a9cdc);}return null;};}function patchUpdates(_0x254677){return function(_0x1dd214){try{jsonpatch['apply'](_0x1dd214,_0x254677,!![]);}catch(_0x2545b4){return BPromise[_0x834e('0x25')](_0x2545b4);}return _0x1dd214[_0x834e('0x26')]();};}function saveUpdates(_0x325a99,_0x4ab05d){return function(_0x45a630){if(_0x45a630){return _0x45a630[_0x834e('0x27')](_0x325a99)['then'](function(_0x1b4bdf){return _0x1b4bdf;});}return null;};}function removeEntity(_0x28d687,_0x8d406e){return function(_0x5c55ca){if(_0x5c55ca){return _0x5c55ca['destroy']()[_0x834e('0x28')](function(){var _0x34563b=_0x5c55ca['get']({'plain':!![]});var _0x25ee1d=_0x834e('0x29');return db['UserProfileResource'][_0x834e('0x2a')]({'where':{'type':_0x25ee1d,'resourceId':_0x34563b['id']}})[_0x834e('0x28')](function(){return _0x5c55ca;});})[_0x834e('0x28')](function(){_0x28d687['status'](0xcc)[_0x834e('0x1e')]();});}};}function handleEntityNotFound(_0x3e310f,_0x5e1cc5){return function(_0x5bef62){if(!_0x5bef62){_0x3e310f[_0x834e('0x2b')](0x194);}return _0x5bef62;};}function handleError(_0x508a1d,_0x2826ec){_0x2826ec=_0x2826ec||0x1f4;return function(_0x3f1b0b){logger[_0x834e('0x2c')](_0x3f1b0b[_0x834e('0x2d')]);if(_0x3f1b0b[_0x834e('0x2e')]){delete _0x3f1b0b[_0x834e('0x2e')];}_0x508a1d['status'](_0x2826ec)['send'](_0x3f1b0b);};}exports['index']=function(_0x58c1d7,_0x2c7a8d){var _0x567cea={},_0x106d6a={},_0x5dacc1={'count':0x0,'rows':[]};var _0xb5bc06=_[_0x834e('0x2f')](db[_0x834e('0x30')][_0x834e('0x31')],function(_0x4551f5){return{'name':_0x4551f5[_0x834e('0x32')],'type':_0x4551f5[_0x834e('0x33')][_0x834e('0x34')]};});_0x106d6a[_0x834e('0x35')]=_['map'](_0xb5bc06,_0x834e('0x2e'));_0x106d6a['query']=_[_0x834e('0x36')](_0x58c1d7[_0x834e('0x37')]);_0x106d6a[_0x834e('0x38')]=_[_0x834e('0x39')](_0x106d6a[_0x834e('0x35')],_0x106d6a[_0x834e('0x37')]);_0x567cea[_0x834e('0x3a')]=_[_0x834e('0x39')](_0x106d6a[_0x834e('0x35')],qs[_0x834e('0x3b')](_0x58c1d7['query'][_0x834e('0x3b')]));_0x567cea[_0x834e('0x3a')]=_0x567cea[_0x834e('0x3a')][_0x834e('0x3c')]?_0x567cea['attributes']:_0x106d6a[_0x834e('0x35')];if(!_0x58c1d7[_0x834e('0x37')]['hasOwnProperty']('nolimit')){_0x567cea['limit']=qs[_0x834e('0x22')](_0x58c1d7[_0x834e('0x37')][_0x834e('0x22')]);_0x567cea[_0x834e('0x21')]=qs[_0x834e('0x21')](_0x58c1d7[_0x834e('0x37')]['offset']);}_0x567cea[_0x834e('0x3d')]=qs['sort'](_0x58c1d7[_0x834e('0x37')][_0x834e('0x3e')]);_0x567cea['where']=qs[_0x834e('0x38')](_[_0x834e('0x3f')](_0x58c1d7['query'],_0x106d6a['filters']));if(_0x58c1d7[_0x834e('0x37')][_0x834e('0x40')]){_0x567cea[_0x834e('0x41')]=_[_0x834e('0x42')](_0x567cea[_0x834e('0x41')],{'$or':_['map'](_0xb5bc06,function(_0x1c5ed6){if(_0x1c5ed6['type']!=='VIRTUAL'){var _0x1b2edf={};_0x1b2edf[_0x1c5ed6['name']]={'$like':'%'+_0x58c1d7[_0x834e('0x37')][_0x834e('0x40')]+'%'};return _0x1b2edf;}})});}_0x567cea=_[_0x834e('0x42')]({},_0x567cea,_0x58c1d7[_0x834e('0x43')]);var _0x2b7933={'where':_0x567cea['where']};return db[_0x834e('0x30')][_0x834e('0x20')](_0x2b7933)[_0x834e('0x28')](function(_0x58c5fb){_0x5dacc1[_0x834e('0x20')]=_0x58c5fb;if(_0x58c1d7[_0x834e('0x37')]['includeAll']){_0x567cea[_0x834e('0x44')]=[{'all':!![]}];}return db['CannedAnswer'][_0x834e('0x45')](_0x567cea);})[_0x834e('0x28')](function(_0x4a18bb){_0x5dacc1['rows']=_0x4a18bb;return _0x5dacc1;})[_0x834e('0x28')](respondWithFilteredResult(_0x2c7a8d,_0x567cea))[_0x834e('0x46')](handleError(_0x2c7a8d,null));};exports[_0x834e('0x47')]=function(_0xbc1571,_0x8ad264){var _0x23feea={'raw':!![],'where':{'id':_0xbc1571['params']['id']}},_0x195204={};_0x195204[_0x834e('0x35')]=_['keys'](db[_0x834e('0x30')]['rawAttributes']);_0x195204[_0x834e('0x37')]=_['keys'](_0xbc1571[_0x834e('0x37')]);_0x195204[_0x834e('0x38')]=_['intersection'](_0x195204[_0x834e('0x35')],_0x195204[_0x834e('0x37')]);_0x23feea[_0x834e('0x3a')]=_[_0x834e('0x39')](_0x195204[_0x834e('0x35')],qs[_0x834e('0x3b')](_0xbc1571[_0x834e('0x37')][_0x834e('0x3b')]));_0x23feea[_0x834e('0x3a')]=_0x23feea[_0x834e('0x3a')]['length']?_0x23feea[_0x834e('0x3a')]:_0x195204[_0x834e('0x35')];if(_0xbc1571['query'][_0x834e('0x48')]){_0x23feea[_0x834e('0x44')]=[{'all':!![]}];}_0x23feea=_[_0x834e('0x42')]({},_0x23feea,_0xbc1571[_0x834e('0x43')]);return db[_0x834e('0x30')][_0x834e('0x49')](_0x23feea)['then'](handleEntityNotFound(_0x8ad264,null))['then'](respondWithResult(_0x8ad264,null))[_0x834e('0x46')](handleError(_0x8ad264,null));};exports[_0x834e('0x27')]=function(_0x30568e,_0x40ff5a){if(_0x30568e[_0x834e('0x4a')]['id']){delete _0x30568e[_0x834e('0x4a')]['id'];}return db[_0x834e('0x30')][_0x834e('0x49')]({'where':{'id':_0x30568e[_0x834e('0x4b')]['id']}})[_0x834e('0x28')](handleEntityNotFound(_0x40ff5a,null))[_0x834e('0x28')](saveUpdates(_0x30568e[_0x834e('0x4a')],null))[_0x834e('0x28')](respondWithResult(_0x40ff5a,null))[_0x834e('0x46')](handleError(_0x40ff5a,null));};exports[_0x834e('0x2a')]=function(_0x1a3855,_0x3df078){return db[_0x834e('0x30')][_0x834e('0x49')]({'where':{'id':_0x1a3855[_0x834e('0x4b')]['id']}})['then'](handleEntityNotFound(_0x3df078,null))[_0x834e('0x28')](removeEntity(_0x3df078,null))[_0x834e('0x46')](handleError(_0x3df078,null));};exports['create']=function(_0x3c00a3,_0x3b0988){var _0x55d491={'key':_0x3c00a3[_0x834e('0x4a')][_0x834e('0x34')]};if(_0x3c00a3[_0x834e('0x4a')][_0x834e('0x4c')]){_0x55d491[_0x834e('0x4c')]=_0x3c00a3[_0x834e('0x4a')][_0x834e('0x4c')];}else if(_0x3c00a3['body'][_0x834e('0x4d')]){_0x55d491[_0x834e('0x4d')]=_0x3c00a3[_0x834e('0x4a')][_0x834e('0x4d')];}else if(_0x3c00a3[_0x834e('0x4a')][_0x834e('0x4e')]){_0x55d491[_0x834e('0x4e')]=_0x3c00a3[_0x834e('0x4a')]['OpenchannelAccountId'];}else if(_0x3c00a3[_0x834e('0x4a')]['ChatWebsiteId']){_0x55d491[_0x834e('0x4f')]=_0x3c00a3['body'][_0x834e('0x4f')];}return db['CannedAnswer']['find']({'where':_0x55d491})[_0x834e('0x28')](function(_0x3e1bee){if(_0x3e1bee){throw new db['Sequelize']['ValidationError'](_0x834e('0x50'));}return db[_0x834e('0x30')][_0x834e('0x51')](_0x3c00a3[_0x834e('0x4a')]);})[_0x834e('0x28')](function(_0x315858){var _0x3d3f2b=_0x3c00a3[_0x834e('0x52')]['get']({'plain':!![]});if(!_0x3d3f2b)throw new Error(_0x834e('0x53'));if(_0x3d3f2b[_0x834e('0x54')]==='user'){var _0x281342=_0x315858['get']({'plain':!![]});return db[_0x834e('0x55')][_0x834e('0x49')]({'where':{'name':'CannedAnswers','userProfileId':_0x3d3f2b[_0x834e('0x56')]},'raw':!![]})[_0x834e('0x28')](function(_0x2de29a){if(_0x2de29a&&_0x2de29a[_0x834e('0x57')]===0x0){return db['UserProfileResource'][_0x834e('0x51')]({'name':_0x281342[_0x834e('0x2e')],'resourceId':_0x281342['id'],'type':_0x2de29a[_0x834e('0x2e')],'sectionId':_0x2de29a['id']},{})['then'](function(){return _0x315858;});}else{return _0x315858;}})[_0x834e('0x46')](function(_0x1fcae9){logger[_0x834e('0x2c')](_0x834e('0x58'),_0x1fcae9);throw _0x1fcae9;});}return _0x315858;})[_0x834e('0x28')](respondWithResult(_0x3b0988,0xc9))[_0x834e('0x46')](handleError(_0x3b0988,null));};
\ No newline at end of file
diff --git a/server/api/cannedAnswer/cannedAnswer.model.js b/server/api/cannedAnswer/cannedAnswer.model.js
index 3890273..b28ca0d 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 _0xe9e8=['lodash','util','api','moment','bluebird','request-promise','path','rimraf','./cannedAnswer.attributes','exports','CannedAnswer','tools_canned_answers','utf8mb4','utf8mb4_unicode_ci'];(function(_0x6942e0,_0x131e6d){var _0xb86490=function(_0x2fd5d7){while(--_0x2fd5d7){_0x6942e0['push'](_0x6942e0['shift']());}};_0xb86490(++_0x131e6d);}(_0xe9e8,0x7e));var _0x8e9e=function(_0x129392,_0x58a353){_0x129392=_0x129392-0x0;var _0x183047=_0xe9e8[_0x129392];return _0x183047;};'use strict';var _=require(_0x8e9e('0x0'));var util=require(_0x8e9e('0x1'));var logger=require('../../config/logger')(_0x8e9e('0x2'));var moment=require(_0x8e9e('0x3'));var BPromise=require(_0x8e9e('0x4'));var rp=require(_0x8e9e('0x5'));var fs=require('fs');var path=require(_0x8e9e('0x6'));var rimraf=require(_0x8e9e('0x7'));var config=require('../../config/environment');var attributes=require(_0x8e9e('0x8'));module[_0x8e9e('0x9')]=function(_0x217e7e,_0xded6f7){return _0x217e7e['define'](_0x8e9e('0xa'),attributes,{'tableName':_0x8e9e('0xb'),'paranoid':![],'indexes':[],'timestamps':!![],'charset':_0x8e9e('0xc'),'collate':_0x8e9e('0xd')});};
\ No newline at end of file
+var _0x117d=['tools_canned_answers','utf8mb4','utf8mb4_unicode_ci','lodash','util','../../config/logger','moment','bluebird','request-promise','path','rimraf','./cannedAnswer.attributes','exports'];(function(_0x244b1a,_0x413208){var _0x2d6037=function(_0x3bfcd3){while(--_0x3bfcd3){_0x244b1a['push'](_0x244b1a['shift']());}};_0x2d6037(++_0x413208);}(_0x117d,0xac));var _0xd117=function(_0x367e5b,_0x5721e4){_0x367e5b=_0x367e5b-0x0;var _0x4b909e=_0x117d[_0x367e5b];return _0x4b909e;};'use strict';var _=require(_0xd117('0x0'));var util=require(_0xd117('0x1'));var logger=require(_0xd117('0x2'))('api');var moment=require(_0xd117('0x3'));var BPromise=require(_0xd117('0x4'));var rp=require(_0xd117('0x5'));var fs=require('fs');var path=require(_0xd117('0x6'));var rimraf=require(_0xd117('0x7'));var config=require('../../config/environment');var attributes=require(_0xd117('0x8'));module[_0xd117('0x9')]=function(_0xa760de,_0x55f7a3){return _0xa760de['define']('CannedAnswer',attributes,{'tableName':_0xd117('0xa'),'paranoid':![],'indexes':[],'timestamps':!![],'charset':_0xd117('0xb'),'collate':_0xd117('0xc')});};
\ No newline at end of file
diff --git a/server/api/cannedAnswer/cannedAnswer.rpc.js b/server/api/cannedAnswer/cannedAnswer.rpc.js
index 0387def..a8123c5 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 _0xe889=['CannedAnswer,\x20%s,\x20%s','request\x20sent','debug','error','code','message','catch','util','moment','randomstring','ioredis','../../mysqldb','../../config/logger','../../config/environment','jayson/promise','http','request','info'];(function(_0x5d80de,_0x2cf15d){var _0x1c7556=function(_0x5bd806){while(--_0x5bd806){_0x5d80de['push'](_0x5d80de['shift']());}};_0x1c7556(++_0x2cf15d);}(_0xe889,0xdf));var _0x9e88=function(_0xf421c,_0x4aa32a){_0xf421c=_0xf421c-0x0;var _0x3150f6=_0xe889[_0xf421c];return _0x3150f6;};'use strict';var _=require('lodash');var util=require(_0x9e88('0x0'));var moment=require(_0x9e88('0x1'));var BPromise=require('bluebird');var rs=require(_0x9e88('0x2'));var fs=require('fs');var Redis=require(_0x9e88('0x3'));var db=require(_0x9e88('0x4'))['db'];var utils=require('../../config/utils');var logger=require(_0x9e88('0x5'))('rpc');var config=require(_0x9e88('0x6'));var jayson=require(_0x9e88('0x7'));var client=jayson['client'][_0x9e88('0x8')]({'port':0x232a});function respondWithRpcPromise(_0x1c3769,_0xb92431,_0x5569ac){return new BPromise(function(_0x3aaf18,_0x5c9e66){return client[_0x9e88('0x9')](_0x1c3769,_0x5569ac)['then'](function(_0x433abf){logger[_0x9e88('0xa')](_0x9e88('0xb'),_0xb92431,_0x9e88('0xc'));logger[_0x9e88('0xd')]('CannedAnswer,\x20%s,\x20%s,\x20%s',_0xb92431,_0x9e88('0xc'),JSON['stringify'](_0x433abf));if(_0x433abf[_0x9e88('0xe')]){if(_0x433abf[_0x9e88('0xe')][_0x9e88('0xf')]===0x1f4){logger['error'](_0x9e88('0xb'),_0xb92431,_0x433abf[_0x9e88('0xe')][_0x9e88('0x10')]);return _0x5c9e66(_0x433abf[_0x9e88('0xe')]['message']);}logger['error'](_0x9e88('0xb'),_0xb92431,_0x433abf[_0x9e88('0xe')][_0x9e88('0x10')]);return _0x3aaf18(_0x433abf['error'][_0x9e88('0x10')]);}else{logger[_0x9e88('0xa')](_0x9e88('0xb'),_0xb92431,_0x9e88('0xc'));_0x3aaf18(_0x433abf['result'][_0x9e88('0x10')]);}})[_0x9e88('0x11')](function(_0x3c86bf){logger[_0x9e88('0xe')](_0x9e88('0xb'),_0xb92431,_0x3c86bf);_0x5c9e66(_0x3c86bf);});});}
\ No newline at end of file
+var _0x13b4=['catch','lodash','util','moment','bluebird','randomstring','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','client','http','request','then','info','CannedAnswer,\x20%s,\x20%s','request\x20sent','debug','CannedAnswer,\x20%s,\x20%s,\x20%s','stringify','error','message','result'];(function(_0x3dd15e,_0x1f0015){var _0x231fd0=function(_0x4f680a){while(--_0x4f680a){_0x3dd15e['push'](_0x3dd15e['shift']());}};_0x231fd0(++_0x1f0015);}(_0x13b4,0x191));var _0x413b=function(_0x14add3,_0x13ce8d){_0x14add3=_0x14add3-0x0;var _0x4a174f=_0x13b4[_0x14add3];return _0x4a174f;};'use strict';var _=require(_0x413b('0x0'));var util=require(_0x413b('0x1'));var moment=require(_0x413b('0x2'));var BPromise=require(_0x413b('0x3'));var rs=require(_0x413b('0x4'));var fs=require('fs');var Redis=require('ioredis');var db=require(_0x413b('0x5'))['db'];var utils=require(_0x413b('0x6'));var logger=require(_0x413b('0x7'))(_0x413b('0x8'));var config=require(_0x413b('0x9'));var jayson=require(_0x413b('0xa'));var client=jayson[_0x413b('0xb')][_0x413b('0xc')]({'port':0x232a});function respondWithRpcPromise(_0x258825,_0x346133,_0x5b3da4){return new BPromise(function(_0x55ab3a,_0x19a369){return client[_0x413b('0xd')](_0x258825,_0x5b3da4)[_0x413b('0xe')](function(_0x30896e){logger[_0x413b('0xf')](_0x413b('0x10'),_0x346133,_0x413b('0x11'));logger[_0x413b('0x12')](_0x413b('0x13'),_0x346133,'request\x20sent',JSON[_0x413b('0x14')](_0x30896e));if(_0x30896e[_0x413b('0x15')]){if(_0x30896e[_0x413b('0x15')]['code']===0x1f4){logger['error']('CannedAnswer,\x20%s,\x20%s',_0x346133,_0x30896e['error'][_0x413b('0x16')]);return _0x19a369(_0x30896e[_0x413b('0x15')][_0x413b('0x16')]);}logger['error']('CannedAnswer,\x20%s,\x20%s',_0x346133,_0x30896e[_0x413b('0x15')]['message']);return _0x55ab3a(_0x30896e[_0x413b('0x15')][_0x413b('0x16')]);}else{logger['info']('CannedAnswer,\x20%s,\x20%s',_0x346133,_0x413b('0x11'));_0x55ab3a(_0x30896e[_0x413b('0x17')][_0x413b('0x16')]);}})[_0x413b('0x18')](function(_0x59a426){logger[_0x413b('0x15')](_0x413b('0x10'),_0x346133,_0x59a426);_0x19a369(_0x59a426);});});}
\ No newline at end of file
diff --git a/server/api/cannedAnswer/index.js b/server/api/cannedAnswer/index.js
index 86b86d5..eedadf1 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 _0xac03=['./cannedAnswer.controller','index','get','/:id','isAuthenticated','show','post','create','delete','destroy','exports','path','express','Router','../../components/auth/service','../../components/interaction/service','../../config/environment'];(function(_0x530346,_0xfdce1c){var _0x21211d=function(_0x1ab3c9){while(--_0x1ab3c9){_0x530346['push'](_0x530346['shift']());}};_0x21211d(++_0xfdce1c);}(_0xac03,0x181));var _0x3ac0=function(_0x3de99a,_0x20140b){_0x3de99a=_0x3de99a-0x0;var _0x3d9667=_0xac03[_0x3de99a];return _0x3d9667;};'use strict';var multer=require('multer');var util=require('util');var path=require(_0x3ac0('0x0'));var timeout=require('connect-timeout');var express=require(_0x3ac0('0x1'));var router=express[_0x3ac0('0x2')]();var auth=require(_0x3ac0('0x3'));var interaction=require(_0x3ac0('0x4'));var config=require(_0x3ac0('0x5'));var controller=require(_0x3ac0('0x6'));router['get']('/',auth['isAuthenticated'](),controller[_0x3ac0('0x7')]);router[_0x3ac0('0x8')](_0x3ac0('0x9'),auth[_0x3ac0('0xa')](),controller[_0x3ac0('0xb')]);router[_0x3ac0('0xc')]('/',auth[_0x3ac0('0xa')](),controller[_0x3ac0('0xd')]);router['put'](_0x3ac0('0x9'),auth[_0x3ac0('0xa')](),controller['update']);router[_0x3ac0('0xe')]('/:id',auth[_0x3ac0('0xa')](),controller[_0x3ac0('0xf')]);module[_0x3ac0('0x10')]=router;
\ No newline at end of file
+var _0xcc0b=['get','index','/:id','isAuthenticated','show','post','create','put','update','delete','destroy','exports','multer','util','connect-timeout','express','Router','../../components/auth/service','../../components/interaction/service','./cannedAnswer.controller'];(function(_0x1c1820,_0x18bb79){var _0x6690e6=function(_0x11ae54){while(--_0x11ae54){_0x1c1820['push'](_0x1c1820['shift']());}};_0x6690e6(++_0x18bb79);}(_0xcc0b,0xc0));var _0xbcc0=function(_0x499001,_0x3f27ae){_0x499001=_0x499001-0x0;var _0x320c65=_0xcc0b[_0x499001];return _0x320c65;};'use strict';var multer=require(_0xbcc0('0x0'));var util=require(_0xbcc0('0x1'));var path=require('path');var timeout=require(_0xbcc0('0x2'));var express=require(_0xbcc0('0x3'));var router=express[_0xbcc0('0x4')]();var auth=require(_0xbcc0('0x5'));var interaction=require(_0xbcc0('0x6'));var config=require('../../config/environment');var controller=require(_0xbcc0('0x7'));router[_0xbcc0('0x8')]('/',auth['isAuthenticated'](),controller[_0xbcc0('0x9')]);router[_0xbcc0('0x8')](_0xbcc0('0xa'),auth[_0xbcc0('0xb')](),controller[_0xbcc0('0xc')]);router[_0xbcc0('0xd')]('/',auth['isAuthenticated'](),controller[_0xbcc0('0xe')]);router[_0xbcc0('0xf')](_0xbcc0('0xa'),auth[_0xbcc0('0xb')](),controller[_0xbcc0('0x10')]);router[_0xbcc0('0x11')](_0xbcc0('0xa'),auth[_0xbcc0('0xb')](),controller[_0xbcc0('0x12')]);module[_0xbcc0('0x13')]=router;
\ No newline at end of file
diff --git a/server/api/cdr/cdr.attributes.js b/server/api/cdr/cdr.attributes.js
index 4819635..2964665 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 _0xf239=['1970-01-01\x2000:00:01','STRING','INTEGER','sequelize','DATE'];(function(_0x54be7c,_0x149e75){var _0x46d170=function(_0x49098e){while(--_0x49098e){_0x54be7c['push'](_0x54be7c['shift']());}};_0x46d170(++_0x149e75);}(_0xf239,0x18e));var _0x9f23=function(_0x5ed051,_0x4f1144){_0x5ed051=_0x5ed051-0x0;var _0x17b687=_0xf239[_0x5ed051];return _0x17b687;};'use strict';var Sequelize=require(_0x9f23('0x0'));module['exports']={'calldate':{'type':Sequelize[_0x9f23('0x1')],'allowNull':![],'defaultValue':_0x9f23('0x2')},'clid':{'type':Sequelize[_0x9f23('0x3')]},'src':{'type':Sequelize[_0x9f23('0x3')]},'dst':{'type':Sequelize[_0x9f23('0x3')]},'dcontext':{'type':Sequelize['STRING']},'channel':{'type':Sequelize['STRING']},'dstchannel':{'type':Sequelize[_0x9f23('0x3')]},'lastapp':{'type':Sequelize[_0x9f23('0x3')]},'lastdata':{'type':Sequelize[_0x9f23('0x3')]},'duration':{'type':Sequelize['INTEGER'],'allowNull':![],'defaultValue':0x0},'billsec':{'type':Sequelize['INTEGER'],'allowNull':![],'defaultValue':0x0},'disposition':{'type':Sequelize['STRING']},'amaflags':{'type':Sequelize[_0x9f23('0x4')],'allowNull':![],'defaultValue':0x0},'accountcode':{'type':Sequelize['STRING']},'userfield':{'type':Sequelize['STRING']},'uniqueid':{'type':Sequelize[_0x9f23('0x3')]},'linkedid':{'type':Sequelize[_0x9f23('0x3')]},'sequence':{'type':Sequelize['STRING']},'peeraccount':{'type':Sequelize[_0x9f23('0x3')]},'type':{'type':Sequelize[_0x9f23('0x3')]},'tag':{'type':Sequelize[_0x9f23('0x3')]}};
\ No newline at end of file
+var _0xd5bd=['1970-01-01\x2000:00:01','STRING','INTEGER','sequelize','exports'];(function(_0x422905,_0x3bce3a){var _0x33dc6c=function(_0x4852c9){while(--_0x4852c9){_0x422905['push'](_0x422905['shift']());}};_0x33dc6c(++_0x3bce3a);}(_0xd5bd,0x1c5));var _0xdd5b=function(_0x58b332,_0x54787d){_0x58b332=_0x58b332-0x0;var _0xb8e97e=_0xd5bd[_0x58b332];return _0xb8e97e;};'use strict';var Sequelize=require(_0xdd5b('0x0'));module[_0xdd5b('0x1')]={'calldate':{'type':Sequelize['DATE'],'allowNull':![],'defaultValue':_0xdd5b('0x2')},'clid':{'type':Sequelize['STRING']},'src':{'type':Sequelize['STRING']},'dst':{'type':Sequelize[_0xdd5b('0x3')]},'dcontext':{'type':Sequelize['STRING']},'channel':{'type':Sequelize['STRING']},'dstchannel':{'type':Sequelize[_0xdd5b('0x3')]},'lastapp':{'type':Sequelize[_0xdd5b('0x3')]},'lastdata':{'type':Sequelize[_0xdd5b('0x3')]},'duration':{'type':Sequelize[_0xdd5b('0x4')],'allowNull':![],'defaultValue':0x0},'billsec':{'type':Sequelize['INTEGER'],'allowNull':![],'defaultValue':0x0},'disposition':{'type':Sequelize[_0xdd5b('0x3')]},'amaflags':{'type':Sequelize[_0xdd5b('0x4')],'allowNull':![],'defaultValue':0x0},'accountcode':{'type':Sequelize['STRING']},'userfield':{'type':Sequelize[_0xdd5b('0x3')]},'uniqueid':{'type':Sequelize['STRING']},'linkedid':{'type':Sequelize[_0xdd5b('0x3')]},'sequence':{'type':Sequelize[_0xdd5b('0x3')]},'peeraccount':{'type':Sequelize['STRING']},'type':{'type':Sequelize[_0xdd5b('0x3')]},'tag':{'type':Sequelize[_0xdd5b('0x3')]}};
\ No newline at end of file
diff --git a/server/api/cdr/cdr.controller.js b/server/api/cdr/cdr.controller.js
index 636b7df..c1f68b2 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 _0x9205=['fieldName','key','query','keys','filters','intersection','model','attributes','fields','length','hasOwnProperty','nolimit','sort','pick','filter','where','merge','type','options','findAll','rows','show','params','includeAll','include','find','catch','create','body','describe','html-pdf','eml-format','request-promise','moment','bluebird','mustache','path','sox','to-csv','ejs','squel','crypto','jsforce','desk.js','querystring','ioredis','../../config/logger','api','../../config/utils','../../config/environment','../../mysqldb','sendStatus','status','json','count','offset','limit','Content-Range','apply','reject','save','update','then','destroy','end','name','send','map','Cdr','rawAttributes'];(function(_0x1f8042,_0x15f697){var _0x242a90=function(_0x5623f0){while(--_0x5623f0){_0x1f8042['push'](_0x1f8042['shift']());}};_0x242a90(++_0x15f697);}(_0x9205,0xf0));var _0x5920=function(_0x534e8e,_0x1ef4d0){_0x534e8e=_0x534e8e-0x0;var _0x5cb465=_0x9205[_0x534e8e];return _0x5cb465;};'use strict';var pdf=require(_0x5920('0x0'));var emlformat=require(_0x5920('0x1'));var rimraf=require('rimraf');var zipdir=require('zip-dir');var jsonpatch=require('fast-json-patch');var rp=require(_0x5920('0x2'));var moment=require(_0x5920('0x3'));var BPromise=require(_0x5920('0x4'));var Mustache=require(_0x5920('0x5'));var util=require('util');var path=require(_0x5920('0x6'));var sox=require(_0x5920('0x7'));var csv=require(_0x5920('0x8'));var ejs=require(_0x5920('0x9'));var fs=require('fs');var _=require('lodash');var squel=require(_0x5920('0xa'));var crypto=require(_0x5920('0xb'));var jsforce=require(_0x5920('0xc'));var deskjs=require(_0x5920('0xd'));var toCsv=require(_0x5920('0x8'));var querystring=require(_0x5920('0xe'));var Papa=require('papaparse');var Redis=require(_0x5920('0xf'));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(_0x5920('0x10'))(_0x5920('0x11'));var utils=require(_0x5920('0x12'));var config=require(_0x5920('0x13'));var db=require(_0x5920('0x14'))['db'];function respondWithStatusCode(_0x28f0fa,_0x31ae0e){_0x31ae0e=_0x31ae0e||0xcc;return function(_0x13207c){if(_0x13207c){return _0x28f0fa[_0x5920('0x15')](_0x31ae0e);}return _0x28f0fa['status'](_0x31ae0e)['end']();};}function respondWithResult(_0x510bb1,_0x562c9a){_0x562c9a=_0x562c9a||0xc8;return function(_0x4d4b27){if(_0x4d4b27){return _0x510bb1[_0x5920('0x16')](_0x562c9a)[_0x5920('0x17')](_0x4d4b27);}};}function respondWithFilteredResult(_0x3a083b,_0x43e3d7){return function(_0x37f198){if(_0x37f198){var _0x169157=_0x37f198[_0x5920('0x18')],_0x578149=_0x43e3d7[_0x5920('0x19')],_0x1b3f55=_0x43e3d7[_0x5920('0x19')]+_0x43e3d7[_0x5920('0x1a')],_0x1eb58f;if(_0x1b3f55>=_0x169157){_0x1b3f55=_0x169157;_0x1eb58f=0xc8;}else{_0x1eb58f=0xce;}_0x3a083b[_0x5920('0x16')](_0x1eb58f);return _0x3a083b['set'](_0x5920('0x1b'),_0x578149+'-'+_0x1b3f55+'/'+_0x169157)[_0x5920('0x17')](_0x37f198);}return null;};}function patchUpdates(_0x394b8b){return function(_0x316456){try{jsonpatch[_0x5920('0x1c')](_0x316456,_0x394b8b,!![]);}catch(_0x44f5c8){return BPromise[_0x5920('0x1d')](_0x44f5c8);}return _0x316456[_0x5920('0x1e')]();};}function saveUpdates(_0x536865,_0x384894){return function(_0x17ab6a){if(_0x17ab6a){return _0x17ab6a[_0x5920('0x1f')](_0x536865)[_0x5920('0x20')](function(_0x22f354){return _0x22f354;});}return null;};}function removeEntity(_0x4148a8,_0x326eb8){return function(_0x4ebe24){if(_0x4ebe24){return _0x4ebe24[_0x5920('0x21')]()[_0x5920('0x20')](function(){_0x4148a8[_0x5920('0x16')](0xcc)[_0x5920('0x22')]();});}};}function handleEntityNotFound(_0x139990,_0x235f6b){return function(_0x59811d){if(!_0x59811d){_0x139990[_0x5920('0x15')](0x194);}return _0x59811d;};}function handleError(_0x21c4c4,_0x5d9587){_0x5d9587=_0x5d9587||0x1f4;return function(_0x58d9e4){logger['error'](_0x58d9e4['stack']);if(_0x58d9e4[_0x5920('0x23')]){delete _0x58d9e4[_0x5920('0x23')];}_0x21c4c4['status'](_0x5d9587)[_0x5920('0x24')](_0x58d9e4);};}exports['index']=function(_0x292b93,_0x1fe106){var _0x18aec4={},_0x788a2a={},_0x52f98d={'count':0x0,'rows':[]};var _0x552f62=_[_0x5920('0x25')](db[_0x5920('0x26')][_0x5920('0x27')],function(_0x2035ba){return{'name':_0x2035ba[_0x5920('0x28')],'type':_0x2035ba['type'][_0x5920('0x29')]};});_0x788a2a['model']=_[_0x5920('0x25')](_0x552f62,'name');_0x788a2a[_0x5920('0x2a')]=_[_0x5920('0x2b')](_0x292b93['query']);_0x788a2a[_0x5920('0x2c')]=_[_0x5920('0x2d')](_0x788a2a[_0x5920('0x2e')],_0x788a2a[_0x5920('0x2a')]);_0x18aec4[_0x5920('0x2f')]=_[_0x5920('0x2d')](_0x788a2a[_0x5920('0x2e')],qs[_0x5920('0x30')](_0x292b93[_0x5920('0x2a')][_0x5920('0x30')]));_0x18aec4[_0x5920('0x2f')]=_0x18aec4[_0x5920('0x2f')][_0x5920('0x31')]?_0x18aec4[_0x5920('0x2f')]:_0x788a2a[_0x5920('0x2e')];if(!_0x292b93[_0x5920('0x2a')][_0x5920('0x32')](_0x5920('0x33'))){_0x18aec4[_0x5920('0x1a')]=qs[_0x5920('0x1a')](_0x292b93['query'][_0x5920('0x1a')]);_0x18aec4[_0x5920('0x19')]=qs[_0x5920('0x19')](_0x292b93[_0x5920('0x2a')][_0x5920('0x19')]);}_0x18aec4['order']=qs[_0x5920('0x34')](_0x292b93[_0x5920('0x2a')][_0x5920('0x34')]);_0x18aec4['where']=qs[_0x5920('0x2c')](_[_0x5920('0x35')](_0x292b93[_0x5920('0x2a')],_0x788a2a[_0x5920('0x2c')]));if(_0x292b93['query'][_0x5920('0x36')]){_0x18aec4[_0x5920('0x37')]=_[_0x5920('0x38')](_0x18aec4[_0x5920('0x37')],{'$or':_[_0x5920('0x25')](_0x552f62,function(_0x25c0c9){if(_0x25c0c9[_0x5920('0x39')]!=='VIRTUAL'){var _0x368ead={};_0x368ead[_0x25c0c9[_0x5920('0x23')]]={'$like':'%'+_0x292b93[_0x5920('0x2a')]['filter']+'%'};return _0x368ead;}})});}_0x18aec4=_[_0x5920('0x38')]({},_0x18aec4,_0x292b93[_0x5920('0x3a')]);var _0x475316={'where':_0x18aec4['where']};return db['Cdr']['count'](_0x475316)[_0x5920('0x20')](function(_0x78a901){_0x52f98d[_0x5920('0x18')]=_0x78a901;if(_0x292b93[_0x5920('0x2a')]['includeAll']){_0x18aec4['include']=[{'all':!![]}];}return db[_0x5920('0x26')][_0x5920('0x3b')](_0x18aec4);})[_0x5920('0x20')](function(_0x57d8df){_0x52f98d[_0x5920('0x3c')]=_0x57d8df;return _0x52f98d;})[_0x5920('0x20')](respondWithFilteredResult(_0x1fe106,_0x18aec4))['catch'](handleError(_0x1fe106,null));};exports[_0x5920('0x3d')]=function(_0x1a641c,_0x825c24){var _0x113f84={'raw':!![],'where':{'id':_0x1a641c[_0x5920('0x3e')]['id']}},_0x598bf2={};_0x598bf2[_0x5920('0x2e')]=_[_0x5920('0x2b')](db[_0x5920('0x26')][_0x5920('0x27')]);_0x598bf2[_0x5920('0x2a')]=_[_0x5920('0x2b')](_0x1a641c[_0x5920('0x2a')]);_0x598bf2[_0x5920('0x2c')]=_[_0x5920('0x2d')](_0x598bf2[_0x5920('0x2e')],_0x598bf2['query']);_0x113f84['attributes']=_['intersection'](_0x598bf2['model'],qs[_0x5920('0x30')](_0x1a641c['query'][_0x5920('0x30')]));_0x113f84[_0x5920('0x2f')]=_0x113f84['attributes'][_0x5920('0x31')]?_0x113f84[_0x5920('0x2f')]:_0x598bf2[_0x5920('0x2e')];if(_0x1a641c[_0x5920('0x2a')][_0x5920('0x3f')]){_0x113f84[_0x5920('0x40')]=[{'all':!![]}];}_0x113f84=_[_0x5920('0x38')]({},_0x113f84,_0x1a641c['options']);return db['Cdr'][_0x5920('0x41')](_0x113f84)[_0x5920('0x20')](handleEntityNotFound(_0x825c24,null))[_0x5920('0x20')](respondWithResult(_0x825c24,null))[_0x5920('0x42')](handleError(_0x825c24,null));};exports[_0x5920('0x43')]=function(_0x4de4ed,_0x290911){return db[_0x5920('0x26')][_0x5920('0x43')](_0x4de4ed[_0x5920('0x44')],{})['then'](respondWithResult(_0x290911,0xc9))[_0x5920('0x42')](handleError(_0x290911,null));};exports[_0x5920('0x1f')]=function(_0x1230ae,_0x583e0f){if(_0x1230ae[_0x5920('0x44')]['id']){delete _0x1230ae[_0x5920('0x44')]['id'];}return db[_0x5920('0x26')]['find']({'where':{'id':_0x1230ae[_0x5920('0x3e')]['id']}})['then'](handleEntityNotFound(_0x583e0f,null))[_0x5920('0x20')](saveUpdates(_0x1230ae['body'],null))['then'](respondWithResult(_0x583e0f,null))[_0x5920('0x42')](handleError(_0x583e0f,null));};exports[_0x5920('0x21')]=function(_0x4aef16,_0x4dd0d3){return db[_0x5920('0x26')]['find']({'where':{'id':_0x4aef16[_0x5920('0x3e')]['id']}})[_0x5920('0x20')](handleEntityNotFound(_0x4dd0d3,null))[_0x5920('0x20')](removeEntity(_0x4dd0d3,null))[_0x5920('0x42')](handleError(_0x4dd0d3,null));};exports[_0x5920('0x45')]=function(_0xa34d3d,_0xbfaab6){return db[_0x5920('0x26')][_0x5920('0x45')]()[_0x5920('0x20')](respondWithResult(_0xbfaab6,null))['catch'](handleError(_0xbfaab6,null));};
\ No newline at end of file
+var _0x2d82=['../../config/environment','../../mysqldb','sendStatus','status','end','offset','limit','set','json','apply','reject','save','update','destroy','error','stack','name','index','map','rawAttributes','fieldName','type','model','query','intersection','attributes','fields','length','hasOwnProperty','nolimit','sort','where','filters','pick','merge','VIRTUAL','options','then','count','include','Cdr','findAll','rows','catch','params','keys','includeAll','create','body','find','describe','html-pdf','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','mustache','util','sox','ejs','lodash','squel','crypto','jsforce','desk.js','to-csv','querystring','ioredis','../../components/parsers/qs','../../config/license/hardware','api','../../config/utils'];(function(_0x2db12b,_0x30ab1d){var _0x20990b=function(_0x589477){while(--_0x589477){_0x2db12b['push'](_0x2db12b['shift']());}};_0x20990b(++_0x30ab1d);}(_0x2d82,0x1a0));var _0x22d8=function(_0x33032e,_0x31411a){_0x33032e=_0x33032e-0x0;var _0x13316b=_0x2d82[_0x33032e];return _0x13316b;};'use strict';var pdf=require(_0x22d8('0x0'));var emlformat=require(_0x22d8('0x1'));var rimraf=require(_0x22d8('0x2'));var zipdir=require(_0x22d8('0x3'));var jsonpatch=require(_0x22d8('0x4'));var rp=require(_0x22d8('0x5'));var moment=require('moment');var BPromise=require('bluebird');var Mustache=require(_0x22d8('0x6'));var util=require(_0x22d8('0x7'));var path=require('path');var sox=require(_0x22d8('0x8'));var csv=require('to-csv');var ejs=require(_0x22d8('0x9'));var fs=require('fs');var _=require(_0x22d8('0xa'));var squel=require(_0x22d8('0xb'));var crypto=require(_0x22d8('0xc'));var jsforce=require(_0x22d8('0xd'));var deskjs=require(_0x22d8('0xe'));var toCsv=require(_0x22d8('0xf'));var querystring=require(_0x22d8('0x10'));var Papa=require('papaparse');var Redis=require(_0x22d8('0x11'));var authService=require('../../components/auth/service');var qs=require(_0x22d8('0x12'));var as=require('../../components/parsers/advancedSearch');var hardwareService=require(_0x22d8('0x13'));var logger=require('../../config/logger')(_0x22d8('0x14'));var utils=require(_0x22d8('0x15'));var config=require(_0x22d8('0x16'));var db=require(_0x22d8('0x17'))['db'];function respondWithStatusCode(_0x3baefc,_0x19d8c2){_0x19d8c2=_0x19d8c2||0xcc;return function(_0x50b9e9){if(_0x50b9e9){return _0x3baefc[_0x22d8('0x18')](_0x19d8c2);}return _0x3baefc[_0x22d8('0x19')](_0x19d8c2)[_0x22d8('0x1a')]();};}function respondWithResult(_0x1c32fa,_0x36db9f){_0x36db9f=_0x36db9f||0xc8;return function(_0x39c9d9){if(_0x39c9d9){return _0x1c32fa[_0x22d8('0x19')](_0x36db9f)['json'](_0x39c9d9);}};}function respondWithFilteredResult(_0x143d3f,_0x23889b){return function(_0x533683){if(_0x533683){var _0x5af526=_0x533683['count'],_0xae6e6c=_0x23889b['offset'],_0x20168c=_0x23889b[_0x22d8('0x1b')]+_0x23889b[_0x22d8('0x1c')],_0x129232;if(_0x20168c>=_0x5af526){_0x20168c=_0x5af526;_0x129232=0xc8;}else{_0x129232=0xce;}_0x143d3f[_0x22d8('0x19')](_0x129232);return _0x143d3f[_0x22d8('0x1d')]('Content-Range',_0xae6e6c+'-'+_0x20168c+'/'+_0x5af526)[_0x22d8('0x1e')](_0x533683);}return null;};}function patchUpdates(_0x3b96fb){return function(_0x478835){try{jsonpatch[_0x22d8('0x1f')](_0x478835,_0x3b96fb,!![]);}catch(_0x1af45d){return BPromise[_0x22d8('0x20')](_0x1af45d);}return _0x478835[_0x22d8('0x21')]();};}function saveUpdates(_0x144b42,_0x4745ad){return function(_0x59810b){if(_0x59810b){return _0x59810b[_0x22d8('0x22')](_0x144b42)['then'](function(_0x5ce83d){return _0x5ce83d;});}return null;};}function removeEntity(_0x1aca6d,_0x59550b){return function(_0x3e6e6f){if(_0x3e6e6f){return _0x3e6e6f[_0x22d8('0x23')]()['then'](function(){_0x1aca6d['status'](0xcc)[_0x22d8('0x1a')]();});}};}function handleEntityNotFound(_0x52ed80,_0x90050a){return function(_0x3d0c81){if(!_0x3d0c81){_0x52ed80[_0x22d8('0x18')](0x194);}return _0x3d0c81;};}function handleError(_0x484d95,_0x2563eb){_0x2563eb=_0x2563eb||0x1f4;return function(_0x5029fa){logger[_0x22d8('0x24')](_0x5029fa[_0x22d8('0x25')]);if(_0x5029fa[_0x22d8('0x26')]){delete _0x5029fa[_0x22d8('0x26')];}_0x484d95[_0x22d8('0x19')](_0x2563eb)['send'](_0x5029fa);};}exports[_0x22d8('0x27')]=function(_0x3f248d,_0x272f1d){var _0x5e2491={},_0x10782b={},_0x2e6e8f={'count':0x0,'rows':[]};var _0x28b89d=_[_0x22d8('0x28')](db['Cdr'][_0x22d8('0x29')],function(_0x6a36d3){return{'name':_0x6a36d3[_0x22d8('0x2a')],'type':_0x6a36d3[_0x22d8('0x2b')]['key']};});_0x10782b[_0x22d8('0x2c')]=_[_0x22d8('0x28')](_0x28b89d,_0x22d8('0x26'));_0x10782b[_0x22d8('0x2d')]=_['keys'](_0x3f248d[_0x22d8('0x2d')]);_0x10782b['filters']=_[_0x22d8('0x2e')](_0x10782b[_0x22d8('0x2c')],_0x10782b[_0x22d8('0x2d')]);_0x5e2491[_0x22d8('0x2f')]=_['intersection'](_0x10782b[_0x22d8('0x2c')],qs[_0x22d8('0x30')](_0x3f248d[_0x22d8('0x2d')][_0x22d8('0x30')]));_0x5e2491[_0x22d8('0x2f')]=_0x5e2491[_0x22d8('0x2f')][_0x22d8('0x31')]?_0x5e2491[_0x22d8('0x2f')]:_0x10782b['model'];if(!_0x3f248d[_0x22d8('0x2d')][_0x22d8('0x32')](_0x22d8('0x33'))){_0x5e2491[_0x22d8('0x1c')]=qs[_0x22d8('0x1c')](_0x3f248d[_0x22d8('0x2d')]['limit']);_0x5e2491[_0x22d8('0x1b')]=qs[_0x22d8('0x1b')](_0x3f248d[_0x22d8('0x2d')][_0x22d8('0x1b')]);}_0x5e2491['order']=qs[_0x22d8('0x34')](_0x3f248d[_0x22d8('0x2d')][_0x22d8('0x34')]);_0x5e2491[_0x22d8('0x35')]=qs[_0x22d8('0x36')](_[_0x22d8('0x37')](_0x3f248d['query'],_0x10782b['filters']));if(_0x3f248d[_0x22d8('0x2d')]['filter']){_0x5e2491[_0x22d8('0x35')]=_[_0x22d8('0x38')](_0x5e2491[_0x22d8('0x35')],{'$or':_[_0x22d8('0x28')](_0x28b89d,function(_0x586e95){if(_0x586e95['type']!==_0x22d8('0x39')){var _0x2b4e0a={};_0x2b4e0a[_0x586e95[_0x22d8('0x26')]]={'$like':'%'+_0x3f248d[_0x22d8('0x2d')]['filter']+'%'};return _0x2b4e0a;}})});}_0x5e2491=_[_0x22d8('0x38')]({},_0x5e2491,_0x3f248d[_0x22d8('0x3a')]);var _0x2a78de={'where':_0x5e2491[_0x22d8('0x35')]};return db['Cdr']['count'](_0x2a78de)[_0x22d8('0x3b')](function(_0x44fe6d){_0x2e6e8f[_0x22d8('0x3c')]=_0x44fe6d;if(_0x3f248d[_0x22d8('0x2d')]['includeAll']){_0x5e2491[_0x22d8('0x3d')]=[{'all':!![]}];}return db[_0x22d8('0x3e')][_0x22d8('0x3f')](_0x5e2491);})[_0x22d8('0x3b')](function(_0x26b8d5){_0x2e6e8f[_0x22d8('0x40')]=_0x26b8d5;return _0x2e6e8f;})[_0x22d8('0x3b')](respondWithFilteredResult(_0x272f1d,_0x5e2491))[_0x22d8('0x41')](handleError(_0x272f1d,null));};exports['show']=function(_0x1caead,_0x5052cf){var _0x469f73={'raw':!![],'where':{'id':_0x1caead[_0x22d8('0x42')]['id']}},_0x311cc4={};_0x311cc4[_0x22d8('0x2c')]=_[_0x22d8('0x43')](db[_0x22d8('0x3e')][_0x22d8('0x29')]);_0x311cc4[_0x22d8('0x2d')]=_[_0x22d8('0x43')](_0x1caead['query']);_0x311cc4[_0x22d8('0x36')]=_[_0x22d8('0x2e')](_0x311cc4[_0x22d8('0x2c')],_0x311cc4[_0x22d8('0x2d')]);_0x469f73[_0x22d8('0x2f')]=_[_0x22d8('0x2e')](_0x311cc4['model'],qs[_0x22d8('0x30')](_0x1caead['query']['fields']));_0x469f73['attributes']=_0x469f73[_0x22d8('0x2f')]['length']?_0x469f73[_0x22d8('0x2f')]:_0x311cc4['model'];if(_0x1caead[_0x22d8('0x2d')][_0x22d8('0x44')]){_0x469f73[_0x22d8('0x3d')]=[{'all':!![]}];}_0x469f73=_[_0x22d8('0x38')]({},_0x469f73,_0x1caead['options']);return db['Cdr']['find'](_0x469f73)[_0x22d8('0x3b')](handleEntityNotFound(_0x5052cf,null))['then'](respondWithResult(_0x5052cf,null))[_0x22d8('0x41')](handleError(_0x5052cf,null));};exports[_0x22d8('0x45')]=function(_0x2b13c7,_0x52a4da){return db['Cdr'][_0x22d8('0x45')](_0x2b13c7[_0x22d8('0x46')],{})[_0x22d8('0x3b')](respondWithResult(_0x52a4da,0xc9))[_0x22d8('0x41')](handleError(_0x52a4da,null));};exports[_0x22d8('0x22')]=function(_0x5085c7,_0x4cebd0){if(_0x5085c7['body']['id']){delete _0x5085c7[_0x22d8('0x46')]['id'];}return db[_0x22d8('0x3e')][_0x22d8('0x47')]({'where':{'id':_0x5085c7[_0x22d8('0x42')]['id']}})[_0x22d8('0x3b')](handleEntityNotFound(_0x4cebd0,null))['then'](saveUpdates(_0x5085c7[_0x22d8('0x46')],null))[_0x22d8('0x3b')](respondWithResult(_0x4cebd0,null))[_0x22d8('0x41')](handleError(_0x4cebd0,null));};exports[_0x22d8('0x23')]=function(_0x44d9db,_0x4d7ce3){return db['Cdr'][_0x22d8('0x47')]({'where':{'id':_0x44d9db['params']['id']}})[_0x22d8('0x3b')](handleEntityNotFound(_0x4d7ce3,null))[_0x22d8('0x3b')](removeEntity(_0x4d7ce3,null))['catch'](handleError(_0x4d7ce3,null));};exports['describe']=function(_0x7972a6,_0x4faea3){return db['Cdr'][_0x22d8('0x48')]()[_0x22d8('0x3b')](respondWithResult(_0x4faea3,null))[_0x22d8('0x41')](handleError(_0x4faea3,null));};
\ No newline at end of file
diff --git a/server/api/cdr/cdr.model.js b/server/api/cdr/cdr.model.js
index 435bf09..9a18f2f 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 _0x0295=['uniqueid','lodash','api','request-promise','path','rimraf','../../config/environment','./cdr.attributes','exports','define','accountcode','calldate','disposition','dst','src'];(function(_0x341c22,_0x210d04){var _0x628407=function(_0x1c657c){while(--_0x1c657c){_0x341c22['push'](_0x341c22['shift']());}};_0x628407(++_0x210d04);}(_0x0295,0x1f0));var _0x5029=function(_0x404c35,_0xedfe89){_0x404c35=_0x404c35-0x0;var _0x28c900=_0x0295[_0x404c35];return _0x28c900;};'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')]('Cdr',attributes,{'tableName':'cdr','paranoid':![],'indexes':[{'name':'accountcode','fields':[_0x5029('0x9')]},{'name':'calldate','fields':[_0x5029('0xa')]},{'name':'disposition','fields':[_0x5029('0xb')]},{'name':'dst','fields':[_0x5029('0xc')]},{'name':_0x5029('0xd'),'fields':[_0x5029('0xd')]},{'name':'uniqueid','fields':[_0x5029('0xe')]}],'timestamps':![]});};
\ No newline at end of file
+var _0x9536=['api','bluebird','path','rimraf','../../config/environment','./cdr.attributes','exports','define','Cdr','cdr','accountcode','calldate','disposition','dst','src','uniqueid','lodash','util','../../config/logger'];(function(_0x5d3d64,_0x4eea8a){var _0x1de48f=function(_0x4f40d9){while(--_0x4f40d9){_0x5d3d64['push'](_0x5d3d64['shift']());}};_0x1de48f(++_0x4eea8a);}(_0x9536,0x179));var _0x6953=function(_0xbc2974,_0xec3342){_0xbc2974=_0xbc2974-0x0;var _0x3a5b4f=_0x9536[_0xbc2974];return _0x3a5b4f;};'use strict';var _=require(_0x6953('0x0'));var util=require(_0x6953('0x1'));var logger=require(_0x6953('0x2'))(_0x6953('0x3'));var moment=require('moment');var BPromise=require(_0x6953('0x4'));var rp=require('request-promise');var fs=require('fs');var path=require(_0x6953('0x5'));var rimraf=require(_0x6953('0x6'));var config=require(_0x6953('0x7'));var attributes=require(_0x6953('0x8'));module[_0x6953('0x9')]=function(_0x494ac2,_0x2b273e){return _0x494ac2[_0x6953('0xa')](_0x6953('0xb'),attributes,{'tableName':_0x6953('0xc'),'paranoid':![],'indexes':[{'name':_0x6953('0xd'),'fields':['accountcode']},{'name':_0x6953('0xe'),'fields':[_0x6953('0xe')]},{'name':_0x6953('0xf'),'fields':['disposition']},{'name':_0x6953('0x10'),'fields':[_0x6953('0x10')]},{'name':_0x6953('0x11'),'fields':[_0x6953('0x11')]},{'name':_0x6953('0x12'),'fields':[_0x6953('0x12')]}],'timestamps':![]});};
\ No newline at end of file
diff --git a/server/api/cdr/cdr.rpc.js b/server/api/cdr/cdr.rpc.js
index d172c31..971695a 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 _0x5590=['rpc','../../config/environment','jayson/promise','request','then','info','Cdr,\x20%s,\x20%s','request\x20sent','debug','Cdr,\x20%s,\x20%s,\x20%s','error','code','message','result','catch','lodash','../../config/utils','../../config/logger'];(function(_0x243004,_0x33a57f){var _0x1f381b=function(_0x40cf04){while(--_0x40cf04){_0x243004['push'](_0x243004['shift']());}};_0x1f381b(++_0x33a57f);}(_0x5590,0x8d));var _0x0559=function(_0x9d0e59,_0x2708e7){_0x9d0e59=_0x9d0e59-0x0;var _0x1dea65=_0x5590[_0x9d0e59];return _0x1dea65;};'use strict';var _=require(_0x0559('0x0'));var util=require('util');var moment=require('moment');var BPromise=require('bluebird');var rs=require('randomstring');var fs=require('fs');var Redis=require('ioredis');var db=require('../../mysqldb')['db'];var utils=require(_0x0559('0x1'));var logger=require(_0x0559('0x2'))(_0x0559('0x3'));var config=require(_0x0559('0x4'));var jayson=require(_0x0559('0x5'));var client=jayson['client']['http']({'port':0x232a});function respondWithRpcPromise(_0x495b0d,_0x52a0ef,_0x547bab){return new BPromise(function(_0x342c1a,_0x26e836){return client[_0x0559('0x6')](_0x495b0d,_0x547bab)[_0x0559('0x7')](function(_0x285bf8){logger[_0x0559('0x8')](_0x0559('0x9'),_0x52a0ef,_0x0559('0xa'));logger[_0x0559('0xb')](_0x0559('0xc'),_0x52a0ef,_0x0559('0xa'),JSON['stringify'](_0x285bf8));if(_0x285bf8[_0x0559('0xd')]){if(_0x285bf8[_0x0559('0xd')][_0x0559('0xe')]===0x1f4){logger[_0x0559('0xd')](_0x0559('0x9'),_0x52a0ef,_0x285bf8[_0x0559('0xd')][_0x0559('0xf')]);return _0x26e836(_0x285bf8[_0x0559('0xd')]['message']);}logger[_0x0559('0xd')](_0x0559('0x9'),_0x52a0ef,_0x285bf8[_0x0559('0xd')][_0x0559('0xf')]);return _0x342c1a(_0x285bf8['error'][_0x0559('0xf')]);}else{logger[_0x0559('0x8')](_0x0559('0x9'),_0x52a0ef,'request\x20sent');_0x342c1a(_0x285bf8[_0x0559('0x10')][_0x0559('0xf')]);}})[_0x0559('0x11')](function(_0xcc6254){logger[_0x0559('0xd')](_0x0559('0x9'),_0x52a0ef,_0xcc6254);_0x26e836(_0xcc6254);});});}
\ No newline at end of file
+var _0x4832=['Cdr,\x20%s,\x20%s','request\x20sent','Cdr,\x20%s,\x20%s,\x20%s','stringify','error','code','message','info','catch','lodash','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','client','http','then'];(function(_0x52e986,_0x2d4e6){var _0xb3740d=function(_0x38fe03){while(--_0x38fe03){_0x52e986['push'](_0x52e986['shift']());}};_0xb3740d(++_0x2d4e6);}(_0x4832,0x14b));var _0x2483=function(_0x28669c,_0x1f62c4){_0x28669c=_0x28669c-0x0;var _0x4a3af6=_0x4832[_0x28669c];return _0x4a3af6;};'use strict';var _=require(_0x2483('0x0'));var util=require('util');var moment=require(_0x2483('0x1'));var BPromise=require(_0x2483('0x2'));var rs=require(_0x2483('0x3'));var fs=require('fs');var Redis=require(_0x2483('0x4'));var db=require(_0x2483('0x5'))['db'];var utils=require(_0x2483('0x6'));var logger=require(_0x2483('0x7'))(_0x2483('0x8'));var config=require(_0x2483('0x9'));var jayson=require(_0x2483('0xa'));var client=jayson[_0x2483('0xb')][_0x2483('0xc')]({'port':0x232a});function respondWithRpcPromise(_0x4a6c15,_0x48ce0c,_0x15cfc9){return new BPromise(function(_0x39297d,_0x45488b){return client['request'](_0x4a6c15,_0x15cfc9)[_0x2483('0xd')](function(_0x1e888b){logger['info'](_0x2483('0xe'),_0x48ce0c,_0x2483('0xf'));logger['debug'](_0x2483('0x10'),_0x48ce0c,_0x2483('0xf'),JSON[_0x2483('0x11')](_0x1e888b));if(_0x1e888b[_0x2483('0x12')]){if(_0x1e888b[_0x2483('0x12')][_0x2483('0x13')]===0x1f4){logger[_0x2483('0x12')](_0x2483('0xe'),_0x48ce0c,_0x1e888b[_0x2483('0x12')][_0x2483('0x14')]);return _0x45488b(_0x1e888b[_0x2483('0x12')]['message']);}logger[_0x2483('0x12')]('Cdr,\x20%s,\x20%s',_0x48ce0c,_0x1e888b[_0x2483('0x12')]['message']);return _0x39297d(_0x1e888b['error'][_0x2483('0x14')]);}else{logger[_0x2483('0x15')]('Cdr,\x20%s,\x20%s',_0x48ce0c,_0x2483('0xf'));_0x39297d(_0x1e888b['result']['message']);}})[_0x2483('0x16')](function(_0x5bef12){logger[_0x2483('0x12')](_0x2483('0xe'),_0x48ce0c,_0x5bef12);_0x45488b(_0x5bef12);});});}
\ No newline at end of file
diff --git a/server/api/cdr/index.js b/server/api/cdr/index.js
index c5552e4..105a970 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 _0xf0e0=['../../components/auth/service','../../components/interaction/service','../../config/environment','./cdr.controller','isAuthenticated','index','get','/describe','describe','show','post','put','/:id','update','delete','exports','multer','path','connect-timeout','express','Router'];(function(_0x1f71d8,_0x278518){var _0x10b045=function(_0x57aea4){while(--_0x57aea4){_0x1f71d8['push'](_0x1f71d8['shift']());}};_0x10b045(++_0x278518);}(_0xf0e0,0x19f));var _0x0f0e=function(_0x17228e,_0x5a05fc){_0x17228e=_0x17228e-0x0;var _0x18e3fc=_0xf0e0[_0x17228e];return _0x18e3fc;};'use strict';var multer=require(_0x0f0e('0x0'));var util=require('util');var path=require(_0x0f0e('0x1'));var timeout=require(_0x0f0e('0x2'));var express=require(_0x0f0e('0x3'));var router=express[_0x0f0e('0x4')]();var auth=require(_0x0f0e('0x5'));var interaction=require(_0x0f0e('0x6'));var config=require(_0x0f0e('0x7'));var controller=require(_0x0f0e('0x8'));router['get']('/',auth[_0x0f0e('0x9')](),controller[_0x0f0e('0xa')]);router[_0x0f0e('0xb')](_0x0f0e('0xc'),auth[_0x0f0e('0x9')](),controller[_0x0f0e('0xd')]);router[_0x0f0e('0xb')]('/:id',auth[_0x0f0e('0x9')](),controller[_0x0f0e('0xe')]);router[_0x0f0e('0xf')]('/',auth[_0x0f0e('0x9')](),controller['create']);router[_0x0f0e('0x10')](_0x0f0e('0x11'),auth[_0x0f0e('0x9')](),controller[_0x0f0e('0x12')]);router[_0x0f0e('0x13')](_0x0f0e('0x11'),auth[_0x0f0e('0x9')](),controller['destroy']);module[_0x0f0e('0x14')]=router;
\ No newline at end of file
+var _0xb65f=['Router','../../components/auth/service','../../components/interaction/service','../../config/environment','get','isAuthenticated','index','describe','/:id','show','post','put','update','multer','util','path','connect-timeout','express'];(function(_0x531db8,_0x52a7ad){var _0x32059b=function(_0x5573cf){while(--_0x5573cf){_0x531db8['push'](_0x531db8['shift']());}};_0x32059b(++_0x52a7ad);}(_0xb65f,0x1ab));var _0xfb65=function(_0x11ebac,_0x476a52){_0x11ebac=_0x11ebac-0x0;var _0x29ae69=_0xb65f[_0x11ebac];return _0x29ae69;};'use strict';var multer=require(_0xfb65('0x0'));var util=require(_0xfb65('0x1'));var path=require(_0xfb65('0x2'));var timeout=require(_0xfb65('0x3'));var express=require(_0xfb65('0x4'));var router=express[_0xfb65('0x5')]();var auth=require(_0xfb65('0x6'));var interaction=require(_0xfb65('0x7'));var config=require(_0xfb65('0x8'));var controller=require('./cdr.controller');router[_0xfb65('0x9')]('/',auth[_0xfb65('0xa')](),controller[_0xfb65('0xb')]);router[_0xfb65('0x9')]('/describe',auth['isAuthenticated'](),controller[_0xfb65('0xc')]);router[_0xfb65('0x9')](_0xfb65('0xd'),auth['isAuthenticated'](),controller[_0xfb65('0xe')]);router[_0xfb65('0xf')]('/',auth[_0xfb65('0xa')](),controller['create']);router[_0xfb65('0x10')](_0xfb65('0xd'),auth[_0xfb65('0xa')](),controller[_0xfb65('0x11')]);router['delete']('/:id',auth[_0xfb65('0xa')](),controller['destroy']);module['exports']=router;
\ No newline at end of file
diff --git a/server/api/chatApplication/chatApplication.attributes.js b/server/api/chatApplication/chatApplication.attributes.js
index c55ae51..977fa42 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 _0xda1e=['*,*,*,*','sequelize','exports','INTEGER','STRING'];(function(_0x5d6e35,_0x4d1ac0){var _0x5d7ada=function(_0x2f7dd3){while(--_0x2f7dd3){_0x5d6e35['push'](_0x5d6e35['shift']());}};_0x5d7ada(++_0x4d1ac0);}(_0xda1e,0x18c));var _0xeda1=function(_0x174a72,_0x46034c){_0x174a72=_0x174a72-0x0;var _0x32cecd=_0xda1e[_0x174a72];return _0x32cecd;};'use strict';var Sequelize=require(_0xeda1('0x0'));module[_0xeda1('0x1')]={'priority':{'type':Sequelize[_0xeda1('0x2')],'allowNull':![]},'app':{'type':Sequelize['STRING'],'allowNull':![],'defaultValue':'noop'},'appdata':{'type':Sequelize['TEXT']()},'description':{'type':Sequelize['STRING']},'interval':{'type':Sequelize[_0xeda1('0x3')],'defaultValue':_0xeda1('0x4')}};
\ No newline at end of file
+var _0x626e=['INTEGER','STRING','TEXT','sequelize'];(function(_0x1cf886,_0xd171f9){var _0x1fc5f1=function(_0xd7997a){while(--_0xd7997a){_0x1cf886['push'](_0x1cf886['shift']());}};_0x1fc5f1(++_0xd171f9);}(_0x626e,0xf3));var _0xe626=function(_0x32007b,_0x16a2f5){_0x32007b=_0x32007b-0x0;var _0x1bd22a=_0x626e[_0x32007b];return _0x1bd22a;};'use strict';var Sequelize=require(_0xe626('0x0'));module['exports']={'priority':{'type':Sequelize[_0xe626('0x1')],'allowNull':![]},'app':{'type':Sequelize[_0xe626('0x2')],'allowNull':![],'defaultValue':'noop'},'appdata':{'type':Sequelize[_0xe626('0x3')]()},'description':{'type':Sequelize['STRING']},'interval':{'type':Sequelize[_0xe626('0x2')],'defaultValue':'*,*,*,*'}};
\ No newline at end of file
diff --git a/server/api/chatApplication/chatApplication.controller.js b/server/api/chatApplication/chatApplication.controller.js
index 2edf188..ab5aaf5 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 _0xc0e4=['papaparse','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/utils','status','json','offset','limit','set','apply','reject','save','update','then','end','sendStatus','error','stack','name','send','params','model','ChatApplication','rawAttributes','query','keys','filters','intersection','attributes','fields','length','merge','options','catch','body','find','destroy','html-pdf','rimraf','zip-dir','fast-json-patch','request-promise','moment','bluebird','mustache','util','path','sox','to-csv','ejs','lodash','crypto','jsforce','desk.js','querystring'];(function(_0x5f09c5,_0x2bfca0){var _0x426ad9=function(_0x18fe5f){while(--_0x18fe5f){_0x5f09c5['push'](_0x5f09c5['shift']());}};_0x426ad9(++_0x2bfca0);}(_0xc0e4,0x99));var _0x4c0e=function(_0x5cb1af,_0x4bdc8c){_0x5cb1af=_0x5cb1af-0x0;var _0x8d7940=_0xc0e4[_0x5cb1af];return _0x8d7940;};'use strict';var pdf=require(_0x4c0e('0x0'));var emlformat=require('eml-format');var rimraf=require(_0x4c0e('0x1'));var zipdir=require(_0x4c0e('0x2'));var jsonpatch=require(_0x4c0e('0x3'));var rp=require(_0x4c0e('0x4'));var moment=require(_0x4c0e('0x5'));var BPromise=require(_0x4c0e('0x6'));var Mustache=require(_0x4c0e('0x7'));var util=require(_0x4c0e('0x8'));var path=require(_0x4c0e('0x9'));var sox=require(_0x4c0e('0xa'));var csv=require(_0x4c0e('0xb'));var ejs=require(_0x4c0e('0xc'));var fs=require('fs');var _=require(_0x4c0e('0xd'));var squel=require('squel');var crypto=require(_0x4c0e('0xe'));var jsforce=require(_0x4c0e('0xf'));var deskjs=require(_0x4c0e('0x10'));var toCsv=require('to-csv');var querystring=require(_0x4c0e('0x11'));var Papa=require(_0x4c0e('0x12'));var Redis=require('ioredis');var authService=require(_0x4c0e('0x13'));var qs=require(_0x4c0e('0x14'));var as=require(_0x4c0e('0x15'));var hardwareService=require(_0x4c0e('0x16'));var logger=require('../../config/logger')('api');var utils=require(_0x4c0e('0x17'));var config=require('../../config/environment');var db=require('../../mysqldb')['db'];function respondWithStatusCode(_0x1262b4,_0x3fb269){_0x3fb269=_0x3fb269||0xcc;return function(_0x161363){if(_0x161363){return _0x1262b4['sendStatus'](_0x3fb269);}return _0x1262b4[_0x4c0e('0x18')](_0x3fb269)['end']();};}function respondWithResult(_0x7d14fc,_0x5a1392){_0x5a1392=_0x5a1392||0xc8;return function(_0x53896f){if(_0x53896f){return _0x7d14fc[_0x4c0e('0x18')](_0x5a1392)[_0x4c0e('0x19')](_0x53896f);}};}function respondWithFilteredResult(_0x53c1f6,_0x345d05){return function(_0x26a5d8){if(_0x26a5d8){var _0x153443=_0x26a5d8['count'],_0x1074d7=_0x345d05[_0x4c0e('0x1a')],_0x53f0cd=_0x345d05[_0x4c0e('0x1a')]+_0x345d05[_0x4c0e('0x1b')],_0x33f534;if(_0x53f0cd>=_0x153443){_0x53f0cd=_0x153443;_0x33f534=0xc8;}else{_0x33f534=0xce;}_0x53c1f6[_0x4c0e('0x18')](_0x33f534);return _0x53c1f6[_0x4c0e('0x1c')]('Content-Range',_0x1074d7+'-'+_0x53f0cd+'/'+_0x153443)[_0x4c0e('0x19')](_0x26a5d8);}return null;};}function patchUpdates(_0x2da647){return function(_0x3041ca){try{jsonpatch[_0x4c0e('0x1d')](_0x3041ca,_0x2da647,!![]);}catch(_0x530ab4){return BPromise[_0x4c0e('0x1e')](_0x530ab4);}return _0x3041ca[_0x4c0e('0x1f')]();};}function saveUpdates(_0x1efc23,_0x238664){return function(_0x240c41){if(_0x240c41){return _0x240c41[_0x4c0e('0x20')](_0x1efc23)[_0x4c0e('0x21')](function(_0x37ca5f){return _0x37ca5f;});}return null;};}function removeEntity(_0x4e5221,_0x38ed27){return function(_0xf1df34){if(_0xf1df34){return _0xf1df34['destroy']()[_0x4c0e('0x21')](function(){_0x4e5221['status'](0xcc)[_0x4c0e('0x22')]();});}};}function handleEntityNotFound(_0x3376b1,_0x517025){return function(_0x235850){if(!_0x235850){_0x3376b1[_0x4c0e('0x23')](0x194);}return _0x235850;};}function handleError(_0x272112,_0x5ecd4d){_0x5ecd4d=_0x5ecd4d||0x1f4;return function(_0x13fb3a){logger[_0x4c0e('0x24')](_0x13fb3a[_0x4c0e('0x25')]);if(_0x13fb3a[_0x4c0e('0x26')]){delete _0x13fb3a['name'];}_0x272112[_0x4c0e('0x18')](_0x5ecd4d)[_0x4c0e('0x27')](_0x13fb3a);};}exports['show']=function(_0x189e73,_0x2dba0f){var _0x3d1305={'raw':!![],'where':{'id':_0x189e73[_0x4c0e('0x28')]['id']}},_0x5e7334={};_0x5e7334[_0x4c0e('0x29')]=_['keys'](db[_0x4c0e('0x2a')][_0x4c0e('0x2b')]);_0x5e7334[_0x4c0e('0x2c')]=_[_0x4c0e('0x2d')](_0x189e73['query']);_0x5e7334[_0x4c0e('0x2e')]=_[_0x4c0e('0x2f')](_0x5e7334[_0x4c0e('0x29')],_0x5e7334['query']);_0x3d1305[_0x4c0e('0x30')]=_[_0x4c0e('0x2f')](_0x5e7334[_0x4c0e('0x29')],qs['fields'](_0x189e73[_0x4c0e('0x2c')][_0x4c0e('0x31')]));_0x3d1305[_0x4c0e('0x30')]=_0x3d1305[_0x4c0e('0x30')][_0x4c0e('0x32')]?_0x3d1305[_0x4c0e('0x30')]:_0x5e7334[_0x4c0e('0x29')];if(_0x189e73[_0x4c0e('0x2c')]['includeAll']){_0x3d1305['include']=[{'all':!![]}];}_0x3d1305=_[_0x4c0e('0x33')]({},_0x3d1305,_0x189e73[_0x4c0e('0x34')]);return db[_0x4c0e('0x2a')]['find'](_0x3d1305)[_0x4c0e('0x21')](handleEntityNotFound(_0x2dba0f,null))['then'](respondWithResult(_0x2dba0f,null))[_0x4c0e('0x35')](handleError(_0x2dba0f,null));};exports[_0x4c0e('0x20')]=function(_0x5dcbee,_0x556b2c){if(_0x5dcbee[_0x4c0e('0x36')]['id']){delete _0x5dcbee['body']['id'];}return db['ChatApplication'][_0x4c0e('0x37')]({'where':{'id':_0x5dcbee[_0x4c0e('0x28')]['id']}})[_0x4c0e('0x21')](handleEntityNotFound(_0x556b2c,null))[_0x4c0e('0x21')](saveUpdates(_0x5dcbee[_0x4c0e('0x36')],null))[_0x4c0e('0x21')](respondWithResult(_0x556b2c,null))[_0x4c0e('0x35')](handleError(_0x556b2c,null));};exports[_0x4c0e('0x38')]=function(_0x1ce58f,_0x40c002){return db['ChatApplication'][_0x4c0e('0x37')]({'where':{'id':_0x1ce58f[_0x4c0e('0x28')]['id']}})[_0x4c0e('0x21')](handleEntityNotFound(_0x40c002,null))[_0x4c0e('0x21')](removeEntity(_0x40c002,null))[_0x4c0e('0x35')](handleError(_0x40c002,null));};
\ No newline at end of file
+var _0x7c65=['params','rimraf','fast-json-patch','request-promise','moment','path','sox','to-csv','lodash','crypto','desk.js','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/environment','../../mysqldb','sendStatus','end','json','count','offset','limit','status','apply','reject','destroy','error','stack','name','send','model','keys','query','filters','intersection','attributes','length','includeAll','include','merge','options','find','then','catch','update','body','ChatApplication'];(function(_0x467ed3,_0x27f1f5){var _0x3bb3d2=function(_0x2c0201){while(--_0x2c0201){_0x467ed3['push'](_0x467ed3['shift']());}};_0x3bb3d2(++_0x27f1f5);}(_0x7c65,0xc9));var _0x57c6=function(_0x43974b,_0x4a90b1){_0x43974b=_0x43974b-0x0;var _0x3ba6ae=_0x7c65[_0x43974b];return _0x3ba6ae;};'use strict';var pdf=require('html-pdf');var emlformat=require('eml-format');var rimraf=require(_0x57c6('0x0'));var zipdir=require('zip-dir');var jsonpatch=require(_0x57c6('0x1'));var rp=require(_0x57c6('0x2'));var moment=require(_0x57c6('0x3'));var BPromise=require('bluebird');var Mustache=require('mustache');var util=require('util');var path=require(_0x57c6('0x4'));var sox=require(_0x57c6('0x5'));var csv=require(_0x57c6('0x6'));var ejs=require('ejs');var fs=require('fs');var _=require(_0x57c6('0x7'));var squel=require('squel');var crypto=require(_0x57c6('0x8'));var jsforce=require('jsforce');var deskjs=require(_0x57c6('0x9'));var toCsv=require(_0x57c6('0x6'));var querystring=require('querystring');var Papa=require('papaparse');var Redis=require('ioredis');var authService=require('../../components/auth/service');var qs=require(_0x57c6('0xa'));var as=require(_0x57c6('0xb'));var hardwareService=require(_0x57c6('0xc'));var logger=require(_0x57c6('0xd'))(_0x57c6('0xe'));var utils=require(_0x57c6('0xf'));var config=require(_0x57c6('0x10'));var db=require(_0x57c6('0x11'))['db'];function respondWithStatusCode(_0x3f9ead,_0x1a3b86){_0x1a3b86=_0x1a3b86||0xcc;return function(_0x238c07){if(_0x238c07){return _0x3f9ead[_0x57c6('0x12')](_0x1a3b86);}return _0x3f9ead['status'](_0x1a3b86)[_0x57c6('0x13')]();};}function respondWithResult(_0x1f8a28,_0x17e8e8){_0x17e8e8=_0x17e8e8||0xc8;return function(_0x561980){if(_0x561980){return _0x1f8a28['status'](_0x17e8e8)[_0x57c6('0x14')](_0x561980);}};}function respondWithFilteredResult(_0x5b5bed,_0x307ac1){return function(_0x246b31){if(_0x246b31){var _0x41c2c6=_0x246b31[_0x57c6('0x15')],_0xac3313=_0x307ac1['offset'],_0x597c53=_0x307ac1[_0x57c6('0x16')]+_0x307ac1[_0x57c6('0x17')],_0x51f42f;if(_0x597c53>=_0x41c2c6){_0x597c53=_0x41c2c6;_0x51f42f=0xc8;}else{_0x51f42f=0xce;}_0x5b5bed[_0x57c6('0x18')](_0x51f42f);return _0x5b5bed['set']('Content-Range',_0xac3313+'-'+_0x597c53+'/'+_0x41c2c6)[_0x57c6('0x14')](_0x246b31);}return null;};}function patchUpdates(_0x3797a1){return function(_0x517191){try{jsonpatch[_0x57c6('0x19')](_0x517191,_0x3797a1,!![]);}catch(_0x131a9a){return BPromise[_0x57c6('0x1a')](_0x131a9a);}return _0x517191['save']();};}function saveUpdates(_0x3dd8ad,_0x3f1148){return function(_0x4fcda1){if(_0x4fcda1){return _0x4fcda1['update'](_0x3dd8ad)['then'](function(_0x50829f){return _0x50829f;});}return null;};}function removeEntity(_0x23def7,_0x28c67d){return function(_0x254734){if(_0x254734){return _0x254734[_0x57c6('0x1b')]()['then'](function(){_0x23def7['status'](0xcc)[_0x57c6('0x13')]();});}};}function handleEntityNotFound(_0x5239d8,_0x57396f){return function(_0x475f96){if(!_0x475f96){_0x5239d8[_0x57c6('0x12')](0x194);}return _0x475f96;};}function handleError(_0x1dcee9,_0x1c015b){_0x1c015b=_0x1c015b||0x1f4;return function(_0x1ad79c){logger[_0x57c6('0x1c')](_0x1ad79c[_0x57c6('0x1d')]);if(_0x1ad79c['name']){delete _0x1ad79c[_0x57c6('0x1e')];}_0x1dcee9[_0x57c6('0x18')](_0x1c015b)[_0x57c6('0x1f')](_0x1ad79c);};}exports['show']=function(_0x3aad5c,_0x334ba1){var _0x405053={'raw':!![],'where':{'id':_0x3aad5c['params']['id']}},_0x261f66={};_0x261f66[_0x57c6('0x20')]=_[_0x57c6('0x21')](db['ChatApplication']['rawAttributes']);_0x261f66['query']=_[_0x57c6('0x21')](_0x3aad5c[_0x57c6('0x22')]);_0x261f66[_0x57c6('0x23')]=_[_0x57c6('0x24')](_0x261f66[_0x57c6('0x20')],_0x261f66['query']);_0x405053['attributes']=_[_0x57c6('0x24')](_0x261f66[_0x57c6('0x20')],qs['fields'](_0x3aad5c[_0x57c6('0x22')]['fields']));_0x405053[_0x57c6('0x25')]=_0x405053['attributes'][_0x57c6('0x26')]?_0x405053[_0x57c6('0x25')]:_0x261f66[_0x57c6('0x20')];if(_0x3aad5c[_0x57c6('0x22')][_0x57c6('0x27')]){_0x405053[_0x57c6('0x28')]=[{'all':!![]}];}_0x405053=_[_0x57c6('0x29')]({},_0x405053,_0x3aad5c[_0x57c6('0x2a')]);return db['ChatApplication'][_0x57c6('0x2b')](_0x405053)[_0x57c6('0x2c')](handleEntityNotFound(_0x334ba1,null))[_0x57c6('0x2c')](respondWithResult(_0x334ba1,null))[_0x57c6('0x2d')](handleError(_0x334ba1,null));};exports[_0x57c6('0x2e')]=function(_0x591089,_0x15ea92){if(_0x591089['body']['id']){delete _0x591089[_0x57c6('0x2f')]['id'];}return db[_0x57c6('0x30')]['find']({'where':{'id':_0x591089[_0x57c6('0x31')]['id']}})['then'](handleEntityNotFound(_0x15ea92,null))[_0x57c6('0x2c')](saveUpdates(_0x591089[_0x57c6('0x2f')],null))[_0x57c6('0x2c')](respondWithResult(_0x15ea92,null))[_0x57c6('0x2d')](handleError(_0x15ea92,null));};exports['destroy']=function(_0x49e41e,_0x1654a0){return db[_0x57c6('0x30')]['find']({'where':{'id':_0x49e41e[_0x57c6('0x31')]['id']}})[_0x57c6('0x2c')](handleEntityNotFound(_0x1654a0,null))['then'](removeEntity(_0x1654a0,null))[_0x57c6('0x2d')](handleError(_0x1654a0,null));};
\ No newline at end of file
diff --git a/server/api/chatApplication/chatApplication.model.js b/server/api/chatApplication/chatApplication.model.js
index a7b5fd9..f946b2d 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 _0xa9e0=['define','ChatApplication','utf8mb4_unicode_ci','lodash','util','../../config/logger','bluebird','path','rimraf','../../config/environment','./chatApplication.attributes','exports'];(function(_0x57b54c,_0x54ce0d){var _0x59cc19=function(_0xa33bc6){while(--_0xa33bc6){_0x57b54c['push'](_0x57b54c['shift']());}};_0x59cc19(++_0x54ce0d);}(_0xa9e0,0x123));var _0x0a9e=function(_0xf71120,_0x25b7f9){_0xf71120=_0xf71120-0x0;var _0xbe2fd3=_0xa9e0[_0xf71120];return _0xbe2fd3;};'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':'chat_applications','paranoid':![],'indexes':[],'timestamps':!![],'charset':'utf8mb4','collate':_0x0a9e('0xb')});};
\ No newline at end of file
+var _0xa9e0=['define','ChatApplication','utf8mb4_unicode_ci','lodash','util','../../config/logger','bluebird','path','rimraf','../../config/environment','./chatApplication.attributes','exports'];(function(_0x59ee6f,_0x450239){var _0x4c0979=function(_0x565e92){while(--_0x565e92){_0x59ee6f['push'](_0x59ee6f['shift']());}};_0x4c0979(++_0x450239);}(_0xa9e0,0x123));var _0x0a9e=function(_0x37c22c,_0x28a70d){_0x37c22c=_0x37c22c-0x0;var _0x119d79=_0xa9e0[_0x37c22c];return _0x119d79;};'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':'chat_applications','paranoid':![],'indexes':[],'timestamps':!![],'charset':'utf8mb4','collate':_0x0a9e('0xb')});};
\ No newline at end of file
diff --git a/server/api/chatApplication/chatApplication.rpc.js b/server/api/chatApplication/chatApplication.rpc.js
index 5281932..66999c5 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 _0xde92=['moment','bluebird','randomstring','ioredis','../../config/utils','rpc','../../config/environment','http','request','then','ChatApplication,\x20%s,\x20%s','debug','ChatApplication,\x20%s,\x20%s,\x20%s','stringify','error','message','info','result','catch','lodash','util'];(function(_0x5ae268,_0x4b3d90){var _0x3fea8b=function(_0x4a0c9c){while(--_0x4a0c9c){_0x5ae268['push'](_0x5ae268['shift']());}};_0x3fea8b(++_0x4b3d90);}(_0xde92,0x67));var _0x2de9=function(_0x555ebb,_0x4b1b68){_0x555ebb=_0x555ebb-0x0;var _0x3c0a4a=_0xde92[_0x555ebb];return _0x3c0a4a;};'use strict';var _=require(_0x2de9('0x0'));var util=require(_0x2de9('0x1'));var moment=require(_0x2de9('0x2'));var BPromise=require(_0x2de9('0x3'));var rs=require(_0x2de9('0x4'));var fs=require('fs');var Redis=require(_0x2de9('0x5'));var db=require('../../mysqldb')['db'];var utils=require(_0x2de9('0x6'));var logger=require('../../config/logger')(_0x2de9('0x7'));var config=require(_0x2de9('0x8'));var jayson=require('jayson/promise');var client=jayson['client'][_0x2de9('0x9')]({'port':0x232a});function respondWithRpcPromise(_0x54c8b1,_0x1e1369,_0x934560){return new BPromise(function(_0x4c1eb3,_0x558b9f){return client[_0x2de9('0xa')](_0x54c8b1,_0x934560)[_0x2de9('0xb')](function(_0x47f9cc){logger['info'](_0x2de9('0xc'),_0x1e1369,'request\x20sent');logger[_0x2de9('0xd')](_0x2de9('0xe'),_0x1e1369,'request\x20sent',JSON[_0x2de9('0xf')](_0x47f9cc));if(_0x47f9cc['error']){if(_0x47f9cc[_0x2de9('0x10')]['code']===0x1f4){logger[_0x2de9('0x10')](_0x2de9('0xc'),_0x1e1369,_0x47f9cc['error'][_0x2de9('0x11')]);return _0x558b9f(_0x47f9cc['error'][_0x2de9('0x11')]);}logger[_0x2de9('0x10')](_0x2de9('0xc'),_0x1e1369,_0x47f9cc[_0x2de9('0x10')][_0x2de9('0x11')]);return _0x4c1eb3(_0x47f9cc['error'][_0x2de9('0x11')]);}else{logger[_0x2de9('0x12')](_0x2de9('0xc'),_0x1e1369,'request\x20sent');_0x4c1eb3(_0x47f9cc[_0x2de9('0x13')]['message']);}})[_0x2de9('0x14')](function(_0x7ff6a3){logger[_0x2de9('0x10')](_0x2de9('0xc'),_0x1e1369,_0x7ff6a3);_0x558b9f(_0x7ff6a3);});});}
\ No newline at end of file
+var _0x916d=['ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','client','request','then','ChatApplication,\x20%s,\x20%s','request\x20sent','debug','ChatApplication,\x20%s,\x20%s,\x20%s','error','code','message','info','result','catch','moment','randomstring'];(function(_0xf13be4,_0x11cf9c){var _0x99969a=function(_0xb55edd){while(--_0xb55edd){_0xf13be4['push'](_0xf13be4['shift']());}};_0x99969a(++_0x11cf9c);}(_0x916d,0x1a0));var _0xd916=function(_0x4062e8,_0x201f8f){_0x4062e8=_0x4062e8-0x0;var _0xe52a68=_0x916d[_0x4062e8];return _0xe52a68;};'use strict';var _=require('lodash');var util=require('util');var moment=require(_0xd916('0x0'));var BPromise=require('bluebird');var rs=require(_0xd916('0x1'));var fs=require('fs');var Redis=require(_0xd916('0x2'));var db=require(_0xd916('0x3'))['db'];var utils=require(_0xd916('0x4'));var logger=require(_0xd916('0x5'))(_0xd916('0x6'));var config=require(_0xd916('0x7'));var jayson=require(_0xd916('0x8'));var client=jayson[_0xd916('0x9')]['http']({'port':0x232a});function respondWithRpcPromise(_0x12a2d0,_0x3a6375,_0x2cf251){return new BPromise(function(_0x2cabb8,_0x514291){return client[_0xd916('0xa')](_0x12a2d0,_0x2cf251)[_0xd916('0xb')](function(_0x32d0ae){logger['info'](_0xd916('0xc'),_0x3a6375,_0xd916('0xd'));logger[_0xd916('0xe')](_0xd916('0xf'),_0x3a6375,'request\x20sent',JSON['stringify'](_0x32d0ae));if(_0x32d0ae[_0xd916('0x10')]){if(_0x32d0ae[_0xd916('0x10')][_0xd916('0x11')]===0x1f4){logger[_0xd916('0x10')](_0xd916('0xc'),_0x3a6375,_0x32d0ae[_0xd916('0x10')]['message']);return _0x514291(_0x32d0ae[_0xd916('0x10')][_0xd916('0x12')]);}logger['error'](_0xd916('0xc'),_0x3a6375,_0x32d0ae['error'][_0xd916('0x12')]);return _0x2cabb8(_0x32d0ae[_0xd916('0x10')][_0xd916('0x12')]);}else{logger[_0xd916('0x13')](_0xd916('0xc'),_0x3a6375,_0xd916('0xd'));_0x2cabb8(_0x32d0ae[_0xd916('0x14')][_0xd916('0x12')]);}})[_0xd916('0x15')](function(_0x9fc5c2){logger[_0xd916('0x10')](_0xd916('0xc'),_0x3a6375,_0x9fc5c2);_0x514291(_0x9fc5c2);});});}
\ No newline at end of file
diff --git a/server/api/chatApplication/index.js b/server/api/chatApplication/index.js
index 93beb57..da1a837 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 _0x22ff=['isAuthenticated','update','delete','destroy','multer','util','path','connect-timeout','express','Router','../../components/auth/service','../../config/environment','./chatApplication.controller','get','/:id'];(function(_0x32682e,_0x4ececf){var _0x1686bc=function(_0x3c1c8d){while(--_0x3c1c8d){_0x32682e['push'](_0x32682e['shift']());}};_0x1686bc(++_0x4ececf);}(_0x22ff,0x16c));var _0xf22f=function(_0x1c3429,_0x11d159){_0x1c3429=_0x1c3429-0x0;var _0x1609bd=_0x22ff[_0x1c3429];return _0x1609bd;};'use strict';var multer=require(_0xf22f('0x0'));var util=require(_0xf22f('0x1'));var path=require(_0xf22f('0x2'));var timeout=require(_0xf22f('0x3'));var express=require(_0xf22f('0x4'));var router=express[_0xf22f('0x5')]();var auth=require(_0xf22f('0x6'));var interaction=require('../../components/interaction/service');var config=require(_0xf22f('0x7'));var controller=require(_0xf22f('0x8'));router[_0xf22f('0x9')]('/:id',auth['isAuthenticated'](),controller['show']);router['put'](_0xf22f('0xa'),auth[_0xf22f('0xb')](),controller[_0xf22f('0xc')]);router[_0xf22f('0xd')](_0xf22f('0xa'),auth['isAuthenticated'](),controller[_0xf22f('0xe')]);module['exports']=router;
\ No newline at end of file
+var _0x89d2=['multer','path','express','../../components/auth/service','../../config/environment','./chatApplication.controller','get','/:id','isAuthenticated','show','put','delete','destroy','exports'];(function(_0x56ef27,_0x4b8894){var _0x457ae3=function(_0x2a0853){while(--_0x2a0853){_0x56ef27['push'](_0x56ef27['shift']());}};_0x457ae3(++_0x4b8894);}(_0x89d2,0x150));var _0x289d=function(_0x55f8b4,_0x43f30d){_0x55f8b4=_0x55f8b4-0x0;var _0x2475f9=_0x89d2[_0x55f8b4];return _0x2475f9;};'use strict';var multer=require(_0x289d('0x0'));var util=require('util');var path=require(_0x289d('0x1'));var timeout=require('connect-timeout');var express=require(_0x289d('0x2'));var router=express['Router']();var auth=require(_0x289d('0x3'));var interaction=require('../../components/interaction/service');var config=require(_0x289d('0x4'));var controller=require(_0x289d('0x5'));router[_0x289d('0x6')](_0x289d('0x7'),auth[_0x289d('0x8')](),controller[_0x289d('0x9')]);router[_0x289d('0xa')](_0x289d('0x7'),auth[_0x289d('0x8')](),controller['update']);router[_0x289d('0xb')](_0x289d('0x7'),auth[_0x289d('0x8')](),controller[_0x289d('0xc')]);module[_0x289d('0xd')]=router;
\ No newline at end of file
diff --git a/server/api/chatGroup/chatGroup.attributes.js b/server/api/chatGroup/chatGroup.attributes.js
index dd21b65..87a95a2 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 _0x8e48=['BOOLEAN','sequelize','exports','STRING'];(function(_0x458140,_0x20964a){var _0x5e4ba1=function(_0x240ca4){while(--_0x240ca4){_0x458140['push'](_0x458140['shift']());}};_0x5e4ba1(++_0x20964a);}(_0x8e48,0x19d));var _0x88e4=function(_0x4cf98e,_0xba4b79){_0x4cf98e=_0x4cf98e-0x0;var _0x1623ac=_0x8e48[_0x4cf98e];return _0x1623ac;};'use strict';var Sequelize=require(_0x88e4('0x0'));module[_0x88e4('0x1')]={'name':{'type':Sequelize[_0x88e4('0x2')],'allowNull':![]},'description':{'type':Sequelize[_0x88e4('0x2')]},'write':{'type':Sequelize[_0x88e4('0x3')],'defaultValue':!![]}};
\ No newline at end of file
+var _0x8ed1=['STRING','BOOLEAN'];(function(_0x1b1c65,_0x23ca6d){var _0x1b86d9=function(_0x1e8559){while(--_0x1e8559){_0x1b1c65['push'](_0x1b1c65['shift']());}};_0x1b86d9(++_0x23ca6d);}(_0x8ed1,0x14c));var _0x18ed=function(_0x577066,_0x44bef7){_0x577066=_0x577066-0x0;var _0xe3f4e1=_0x8ed1[_0x577066];return _0xe3f4e1;};'use strict';var Sequelize=require('sequelize');module['exports']={'name':{'type':Sequelize[_0x18ed('0x0')],'allowNull':![]},'description':{'type':Sequelize[_0x18ed('0x0')]},'write':{'type':Sequelize[_0x18ed('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 d5a7721..83d4bc9 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 _0x375f=['nolimit','removeMembers','find','addMessage','ChatGroupId','ChatInternalMessage','$gte','split','format','getMessages','html-pdf','eml-format','fast-json-patch','moment','bluebird','mustache','util','path','sox','to-csv','ejs','lodash','squel','crypto','querystring','papaparse','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/utils','../../config/environment','../../mysqldb','defaults','redis','localhost','socket.io-emitter','./chatGroup.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~!@#$%^&-_=+[{]}.','request','then','info','ChatGroup,\x20%s,\x20%s','request\x20sent','debug','ChatGroup,\x20%s,\x20%s,\x20%s','stringify','error','code','message','result','catch','sendStatus','status','end','json','count','limit','Content-Range','reject','save','destroy','name','ChatGroup','rawAttributes','fieldName','type','key','map','keys','query','filters','intersection','attributes','model','fields','hasOwnProperty','offset','sort','filter','where','VIRTUAL','merge','includeAll','include','rows','show','params','create','body','update','describe','user','toInteger','addMembers','ids','getMembers','findOne','User','length','order','pick','options'];(function(_0x18f99d,_0x41da14){var _0x36ba2d=function(_0x7071b8){while(--_0x7071b8){_0x18f99d['push'](_0x18f99d['shift']());}};_0x36ba2d(++_0x41da14);}(_0x375f,0x1b6));var _0xf375=function(_0x1ece21,_0x46ec6c){_0x1ece21=_0x1ece21-0x0;var _0x218239=_0x375f[_0x1ece21];return _0x218239;};'use strict';var pdf=require(_0xf375('0x0'));var emlformat=require(_0xf375('0x1'));var rimraf=require('rimraf');var zipdir=require('zip-dir');var jsonpatch=require(_0xf375('0x2'));var rp=require('request-promise');var moment=require(_0xf375('0x3'));var BPromise=require(_0xf375('0x4'));var Mustache=require(_0xf375('0x5'));var util=require(_0xf375('0x6'));var path=require(_0xf375('0x7'));var sox=require(_0xf375('0x8'));var csv=require(_0xf375('0x9'));var ejs=require(_0xf375('0xa'));var fs=require('fs');var _=require(_0xf375('0xb'));var squel=require(_0xf375('0xc'));var crypto=require(_0xf375('0xd'));var jsforce=require('jsforce');var deskjs=require('desk.js');var toCsv=require(_0xf375('0x9'));var querystring=require(_0xf375('0xe'));var Papa=require(_0xf375('0xf'));var Redis=require('ioredis');var authService=require(_0xf375('0x10'));var qs=require(_0xf375('0x11'));var as=require(_0xf375('0x12'));var hardwareService=require('../../config/license/hardware');var logger=require('../../config/logger')('api');var utils=require(_0xf375('0x13'));var config=require(_0xf375('0x14'));var db=require(_0xf375('0x15'))['db'];config['redis']=_[_0xf375('0x16')](config[_0xf375('0x17')],{'host':_0xf375('0x18'),'port':0x18eb});var socket=require(_0xf375('0x19'))(new Redis(config[_0xf375('0x17')]));require(_0xf375('0x1a'))[_0xf375('0x1b')](socket);var jayson=require(_0xf375('0x1c'));var client=jayson[_0xf375('0x1d')][_0xf375('0x1e')]({'port':0x232a});function checkPasswordPattern(_0x4f1d90,_0x525585,_0x9b0c2c){if(_0x9b0c2c){var _0x7ea826=new RegExp(/(?=.*[a-z])(?=.*[A-Z])(?=.*[0-9])(?=.*[?!@#\$%\^&\*~\-_=+[{\]\}])(?=.{8,})/);if(_0x7ea826[_0xf375('0x1f')](_0x525585)){return _0x4f1d90;}else{throw new db['Sequelize']['ValidationError'](_0xf375('0x20'));}}else{return _0x4f1d90;}}function respondWithRpcPromise(_0x9d527a,_0x116f65,_0x49abaf,_0x17208a){return new BPromise(function(_0xce6333,_0x1067fa){var _0x3fb511=_0x17208a||client;return _0x3fb511[_0xf375('0x21')](_0x9d527a,_0x49abaf)[_0xf375('0x22')](function(_0xd2d38a){logger[_0xf375('0x23')](_0xf375('0x24'),_0x116f65,_0xf375('0x25'));logger[_0xf375('0x26')](_0xf375('0x27'),_0x116f65,_0xf375('0x25'),JSON[_0xf375('0x28')](_0xd2d38a));if(_0xd2d38a[_0xf375('0x29')]){if(_0xd2d38a[_0xf375('0x29')][_0xf375('0x2a')]===0x1f4){logger[_0xf375('0x29')]('ChatGroup,\x20%s,\x20%s',_0x116f65,_0xd2d38a[_0xf375('0x29')][_0xf375('0x2b')]);return _0x1067fa(_0xd2d38a['error'][_0xf375('0x2b')]);}logger[_0xf375('0x29')](_0xf375('0x24'),_0x116f65,_0xd2d38a[_0xf375('0x29')][_0xf375('0x2b')]);return _0xce6333(_0xd2d38a[_0xf375('0x29')][_0xf375('0x2b')]);}else{logger['info'](_0xf375('0x24'),_0x116f65,'request\x20sent');_0xce6333(_0xd2d38a[_0xf375('0x2c')][_0xf375('0x2b')]);}})[_0xf375('0x2d')](function(_0x1ae2a8){logger[_0xf375('0x29')](_0xf375('0x24'),_0x116f65,_0x1ae2a8);_0x1067fa(_0x1ae2a8);});});}function respondWithStatusCode(_0x406a22,_0x4bcc9b){_0x4bcc9b=_0x4bcc9b||0xcc;return function(_0x23a845){if(_0x23a845){return _0x406a22[_0xf375('0x2e')](_0x4bcc9b);}return _0x406a22[_0xf375('0x2f')](_0x4bcc9b)[_0xf375('0x30')]();};}function respondWithResult(_0x1ac278,_0x5387e5){_0x5387e5=_0x5387e5||0xc8;return function(_0x176f38){if(_0x176f38){return _0x1ac278[_0xf375('0x2f')](_0x5387e5)[_0xf375('0x31')](_0x176f38);}};}function respondWithFilteredResult(_0x1c0e40,_0x56e255){return function(_0xdbbfda){if(_0xdbbfda){var _0x59db99=_0xdbbfda[_0xf375('0x32')],_0x54193b=_0x56e255['offset'],_0x456f74=_0x56e255['offset']+_0x56e255[_0xf375('0x33')],_0x581fc2;if(_0x456f74>=_0x59db99){_0x456f74=_0x59db99;_0x581fc2=0xc8;}else{_0x581fc2=0xce;}_0x1c0e40[_0xf375('0x2f')](_0x581fc2);return _0x1c0e40['set'](_0xf375('0x34'),_0x54193b+'-'+_0x456f74+'/'+_0x59db99)[_0xf375('0x31')](_0xdbbfda);}return null;};}function patchUpdates(_0x4a9511){return function(_0x1d346b){try{jsonpatch['apply'](_0x1d346b,_0x4a9511,!![]);}catch(_0x36774e){return BPromise[_0xf375('0x35')](_0x36774e);}return _0x1d346b[_0xf375('0x36')]();};}function saveUpdates(_0x3f5e12,_0x164c73){return function(_0xd30498){if(_0xd30498){return _0xd30498['update'](_0x3f5e12)[_0xf375('0x22')](function(_0x5edc06){return _0x5edc06;});}return null;};}function removeEntity(_0x1467ab,_0x5d4f39){return function(_0x50531e){if(_0x50531e){return _0x50531e[_0xf375('0x37')]()[_0xf375('0x22')](function(){_0x1467ab[_0xf375('0x2f')](0xcc)[_0xf375('0x30')]();});}};}function handleEntityNotFound(_0x11ae75,_0x41aea5){return function(_0x246fc7){if(!_0x246fc7){_0x11ae75['sendStatus'](0x194);}return _0x246fc7;};}function handleError(_0x4ec6cf,_0x30f392){_0x30f392=_0x30f392||0x1f4;return function(_0x2b00e4){logger[_0xf375('0x29')](_0x2b00e4['stack']);if(_0x2b00e4[_0xf375('0x38')]){delete _0x2b00e4[_0xf375('0x38')];}_0x4ec6cf[_0xf375('0x2f')](_0x30f392)['send'](_0x2b00e4);};}exports['index']=function(_0x2124c6,_0x2b3b74){var _0x1f69ea={},_0x2d3855={},_0x29ed29={'count':0x0,'rows':[]};var _0x4b7398=_['map'](db[_0xf375('0x39')][_0xf375('0x3a')],function(_0x4e568){return{'name':_0x4e568[_0xf375('0x3b')],'type':_0x4e568[_0xf375('0x3c')][_0xf375('0x3d')]};});_0x2d3855['model']=_[_0xf375('0x3e')](_0x4b7398,_0xf375('0x38'));_0x2d3855['query']=_[_0xf375('0x3f')](_0x2124c6[_0xf375('0x40')]);_0x2d3855[_0xf375('0x41')]=_[_0xf375('0x42')](_0x2d3855['model'],_0x2d3855[_0xf375('0x40')]);_0x1f69ea[_0xf375('0x43')]=_[_0xf375('0x42')](_0x2d3855[_0xf375('0x44')],qs[_0xf375('0x45')](_0x2124c6[_0xf375('0x40')][_0xf375('0x45')]));_0x1f69ea[_0xf375('0x43')]=_0x1f69ea[_0xf375('0x43')]['length']?_0x1f69ea[_0xf375('0x43')]:_0x2d3855[_0xf375('0x44')];if(!_0x2124c6[_0xf375('0x40')][_0xf375('0x46')]('nolimit')){_0x1f69ea[_0xf375('0x33')]=qs[_0xf375('0x33')](_0x2124c6[_0xf375('0x40')]['limit']);_0x1f69ea['offset']=qs[_0xf375('0x47')](_0x2124c6['query'][_0xf375('0x47')]);}_0x1f69ea['order']=qs[_0xf375('0x48')](_0x2124c6[_0xf375('0x40')][_0xf375('0x48')]);_0x1f69ea['where']=qs[_0xf375('0x41')](_['pick'](_0x2124c6[_0xf375('0x40')],_0x2d3855[_0xf375('0x41')]));if(_0x2124c6[_0xf375('0x40')][_0xf375('0x49')]){_0x1f69ea[_0xf375('0x4a')]=_['merge'](_0x1f69ea['where'],{'$or':_[_0xf375('0x3e')](_0x4b7398,function(_0x19742e){if(_0x19742e[_0xf375('0x3c')]!==_0xf375('0x4b')){var _0x3661fb={};_0x3661fb[_0x19742e[_0xf375('0x38')]]={'$like':'%'+_0x2124c6[_0xf375('0x40')][_0xf375('0x49')]+'%'};return _0x3661fb;}})});}_0x1f69ea=_[_0xf375('0x4c')]({},_0x1f69ea,_0x2124c6['options']);var _0x43fb39={'where':_0x1f69ea[_0xf375('0x4a')]};return db['ChatGroup']['count'](_0x43fb39)[_0xf375('0x22')](function(_0x46ef11){_0x29ed29[_0xf375('0x32')]=_0x46ef11;if(_0x2124c6[_0xf375('0x40')][_0xf375('0x4d')]){_0x1f69ea[_0xf375('0x4e')]=[{'all':!![]}];}return db[_0xf375('0x39')]['findAll'](_0x1f69ea);})[_0xf375('0x22')](function(_0x41c8a7){_0x29ed29[_0xf375('0x4f')]=_0x41c8a7;return _0x29ed29;})[_0xf375('0x22')](respondWithFilteredResult(_0x2b3b74,_0x1f69ea))[_0xf375('0x2d')](handleError(_0x2b3b74,null));};exports[_0xf375('0x50')]=function(_0x3307ce,_0x3077c6){var _0x56ef4f={'raw':!![],'where':{'id':_0x3307ce[_0xf375('0x51')]['id']}},_0x436b36={};_0x436b36[_0xf375('0x44')]=_[_0xf375('0x3f')](db[_0xf375('0x39')][_0xf375('0x3a')]);_0x436b36[_0xf375('0x40')]=_[_0xf375('0x3f')](_0x3307ce['query']);_0x436b36[_0xf375('0x41')]=_['intersection'](_0x436b36[_0xf375('0x44')],_0x436b36['query']);_0x56ef4f[_0xf375('0x43')]=_['intersection'](_0x436b36[_0xf375('0x44')],qs[_0xf375('0x45')](_0x3307ce[_0xf375('0x40')][_0xf375('0x45')]));_0x56ef4f[_0xf375('0x43')]=_0x56ef4f[_0xf375('0x43')]['length']?_0x56ef4f[_0xf375('0x43')]:_0x436b36['model'];if(_0x3307ce[_0xf375('0x40')][_0xf375('0x4d')]){_0x56ef4f['include']=[{'all':!![]}];}_0x56ef4f=_['merge']({},_0x56ef4f,_0x3307ce['options']);return db[_0xf375('0x39')]['find'](_0x56ef4f)[_0xf375('0x22')](handleEntityNotFound(_0x3077c6,null))[_0xf375('0x22')](respondWithResult(_0x3077c6,null))[_0xf375('0x2d')](handleError(_0x3077c6,null));};exports[_0xf375('0x52')]=function(_0x57b6d1,_0x2e8ab7){return db['ChatGroup'][_0xf375('0x52')](_0x57b6d1[_0xf375('0x53')],{})['then'](respondWithResult(_0x2e8ab7,0xc9))['catch'](handleError(_0x2e8ab7,null));};exports[_0xf375('0x54')]=function(_0x1fb21d,_0x49730b){if(_0x1fb21d[_0xf375('0x53')]['id']){delete _0x1fb21d[_0xf375('0x53')]['id'];}return db[_0xf375('0x39')]['find']({'where':{'id':_0x1fb21d['params']['id']}})[_0xf375('0x22')](handleEntityNotFound(_0x49730b,null))[_0xf375('0x22')](saveUpdates(_0x1fb21d[_0xf375('0x53')],null))['then'](respondWithResult(_0x49730b,null))[_0xf375('0x2d')](handleError(_0x49730b,null));};exports['destroy']=function(_0x3a041d,_0x27f687){return db['ChatGroup']['find']({'where':{'id':_0x3a041d['params']['id']}})[_0xf375('0x22')](handleEntityNotFound(_0x27f687,null))[_0xf375('0x22')](removeEntity(_0x27f687,null))['catch'](handleError(_0x27f687,null));};exports[_0xf375('0x55')]=function(_0x577879,_0x3ca0e7){return db[_0xf375('0x39')][_0xf375('0x55')]()[_0xf375('0x22')](respondWithResult(_0x3ca0e7,null))[_0xf375('0x2d')](handleError(_0x3ca0e7,null));};exports['getUnread']=function(_0x4b87aa,_0x189f31,_0x4d5ef5){return db['ChatInternalMessage']['count']({'where':{'ChatGroupId':_0x4b87aa['params']['id'],'ToId':_0x4b87aa[_0xf375('0x56')]['id'],'read':![]}})[_0xf375('0x22')](function(_0xe59651){return{'id':_[_0xf375('0x57')](_0x4b87aa[_0xf375('0x51')]['id']),'count':_0xe59651};})[_0xf375('0x22')](respondWithResult(_0x189f31,null))['catch'](handleError(_0x189f31,null));};exports[_0xf375('0x58')]=function(_0x155c88,_0x1a09d,_0x29e9c4){return db[_0xf375('0x39')]['find']({'where':{'id':_0x155c88['params']['id']}})[_0xf375('0x22')](handleEntityNotFound(_0x1a09d,null))[_0xf375('0x22')](function(_0x1c83f1){if(_0x1c83f1){return _0x1c83f1['addMembers'](_0x155c88['body'][_0xf375('0x59')],_['omit'](_0x155c88[_0xf375('0x53')],['ids','id'])||{});}})['then'](respondWithResult(_0x1a09d,null))['catch'](handleError(_0x1a09d,null));};exports[_0xf375('0x5a')]=function(_0x101a18,_0x55d717,_0x1320fc){var _0x1572fe={};var _0x11a57d={};var _0x44d72f;var _0x3dd3d6;return db[_0xf375('0x39')][_0xf375('0x5b')]({'where':{'id':_0x101a18[_0xf375('0x51')]['id']}})['then'](handleEntityNotFound(_0x55d717,null))[_0xf375('0x22')](function(_0x5150cc){if(_0x5150cc){_0x44d72f=_0x5150cc;_0x11a57d[_0xf375('0x44')]=_[_0xf375('0x3f')](db[_0xf375('0x5c')]['rawAttributes']);_0x11a57d[_0xf375('0x40')]=_[_0xf375('0x3f')](_0x101a18[_0xf375('0x40')]);_0x11a57d['filters']=_[_0xf375('0x42')](_0x11a57d['model'],_0x11a57d['query']);_0x1572fe[_0xf375('0x43')]=_['intersection'](_0x11a57d[_0xf375('0x44')],qs['fields'](_0x101a18['query'][_0xf375('0x45')]));_0x1572fe[_0xf375('0x43')]=_0x1572fe['attributes'][_0xf375('0x5d')]?_0x1572fe[_0xf375('0x43')]:_0x11a57d[_0xf375('0x44')];_0x1572fe[_0xf375('0x5e')]=qs[_0xf375('0x48')](_0x101a18[_0xf375('0x40')][_0xf375('0x48')]);_0x1572fe[_0xf375('0x4a')]=qs[_0xf375('0x41')](_[_0xf375('0x5f')](_0x101a18['query'],_0x11a57d['filters']));if(_0x101a18['query'][_0xf375('0x49')]){_0x1572fe[_0xf375('0x4a')]=_[_0xf375('0x4c')](_0x1572fe[_0xf375('0x4a')],{'$or':_['map'](_0x1572fe[_0xf375('0x43')],function(_0xfc5595){var _0x2eff65={};_0x2eff65[_0xfc5595]={'$like':'%'+_0x101a18[_0xf375('0x40')][_0xf375('0x49')]+'%'};return _0x2eff65;})});}_0x1572fe=_[_0xf375('0x4c')]({},_0x1572fe,_0x101a18[_0xf375('0x60')]);return _0x44d72f[_0xf375('0x5a')](_0x1572fe);}})[_0xf375('0x22')](function(_0x24857c){if(_0x24857c){_0x3dd3d6=_0x24857c['length'];if(!_0x101a18[_0xf375('0x40')][_0xf375('0x46')](_0xf375('0x61'))){_0x1572fe[_0xf375('0x33')]=qs[_0xf375('0x33')](_0x101a18['query'][_0xf375('0x33')]);_0x1572fe[_0xf375('0x47')]=qs[_0xf375('0x47')](_0x101a18['query'][_0xf375('0x47')]);}return _0x44d72f[_0xf375('0x5a')](_0x1572fe);}})[_0xf375('0x22')](function(_0x45b776){if(_0x45b776){return _0x45b776?{'count':_0x3dd3d6,'rows':_0x45b776}:null;}})[_0xf375('0x22')](respondWithResult(_0x55d717,null))['catch'](handleError(_0x55d717,null));};exports[_0xf375('0x62')]=function(_0x5881f6,_0x1b4b72,_0x4b6b53){return db[_0xf375('0x39')][_0xf375('0x63')]({'where':{'id':_0x5881f6['params']['id']}})[_0xf375('0x22')](handleEntityNotFound(_0x1b4b72,null))[_0xf375('0x22')](function(_0x182435){if(_0x182435){return _0x182435[_0xf375('0x62')](_0x5881f6[_0xf375('0x40')][_0xf375('0x59')]);}})[_0xf375('0x22')](respondWithStatusCode(_0x1b4b72,null))['catch'](handleError(_0x1b4b72,null));};exports[_0xf375('0x64')]=function(_0x32b6af,_0x58cf8f,_0x21230d){if(_0x32b6af[_0xf375('0x53')]['id']){delete _0x32b6af[_0xf375('0x53')]['id'];}return db[_0xf375('0x39')][_0xf375('0x63')]({'where':{'id':_0x32b6af[_0xf375('0x51')]['id']}})['then'](handleEntityNotFound(_0x58cf8f,null))['then'](function(_0x57e893){if(_0x57e893){_0x32b6af[_0xf375('0x53')][_0xf375('0x65')]=_0x57e893['id'];return db['ChatInternalMessage'][_0xf375('0x52')](_0x32b6af[_0xf375('0x53')]);}})[_0xf375('0x22')](respondWithResult(_0x58cf8f,null))[_0xf375('0x2d')](handleError(_0x58cf8f,null));};exports['getMessages']=function(_0x1e8636,_0x5c6adc,_0x5b4077){var _0x3ff736={};var _0x172ca2={};var _0x418881;var _0x2f202e;return db[_0xf375('0x39')][_0xf375('0x5b')]({'where':{'id':_0x1e8636[_0xf375('0x51')]['id']}})[_0xf375('0x22')](handleEntityNotFound(_0x5c6adc,null))['then'](function(_0xe06120){if(_0xe06120){_0x418881=_0xe06120;_0x172ca2['model']=_[_0xf375('0x3f')](db[_0xf375('0x66')][_0xf375('0x3a')]);_0x172ca2[_0xf375('0x40')]=_[_0xf375('0x3f')](_0x1e8636['query']);_0x172ca2[_0xf375('0x41')]=_['intersection'](_0x172ca2[_0xf375('0x44')],_0x172ca2['query']);_0x3ff736['attributes']=_['intersection'](_0x172ca2[_0xf375('0x44')],qs[_0xf375('0x45')](_0x1e8636[_0xf375('0x40')]['fields']));_0x3ff736[_0xf375('0x43')]=_0x3ff736['attributes'][_0xf375('0x5d')]?_0x3ff736['attributes']:_0x172ca2[_0xf375('0x44')];_0x3ff736[_0xf375('0x5e')]=qs[_0xf375('0x48')](_0x1e8636[_0xf375('0x40')][_0xf375('0x48')]);_0x3ff736[_0xf375('0x4a')]=qs['filters'](_['pick'](_0x1e8636['query'],_0x172ca2[_0xf375('0x41')]));if(_0x1e8636[_0xf375('0x40')][_0xf375('0x49')]){_0x3ff736[_0xf375('0x4a')]=_[_0xf375('0x4c')](_0x3ff736[_0xf375('0x4a')],{'$or':_[_0xf375('0x3e')](_0x3ff736[_0xf375('0x43')],function(_0x59accd){var _0x14b98c={};_0x14b98c[_0x59accd]={'$like':'%'+_0x1e8636[_0xf375('0x40')]['filter']+'%'};return _0x14b98c;})});}if(_0x1e8636[_0xf375('0x40')]['$gte']){var _0xc881d1=_0x1e8636[_0xf375('0x40')][_0xf375('0x67')][_0xf375('0x68')](',');var _0x333ad9={};_0x333ad9[_0xc881d1[0x0]]={'$gte':moment(_0xc881d1[0x1])[_0xf375('0x69')]('YYYY-MM-DD\x20HH:mm:ss')};_0x3ff736['where']=_[_0xf375('0x4c')](_0x3ff736[_0xf375('0x4a')],_0x333ad9);}_0x3ff736=_[_0xf375('0x4c')]({},_0x3ff736,_0x1e8636[_0xf375('0x60')]);return _0x418881[_0xf375('0x6a')](_0x3ff736);}})[_0xf375('0x22')](function(_0x14b0a2){if(_0x14b0a2){_0x2f202e=_0x14b0a2[_0xf375('0x5d')];if(!_0x1e8636[_0xf375('0x40')][_0xf375('0x46')](_0xf375('0x61'))){_0x3ff736[_0xf375('0x33')]=qs[_0xf375('0x33')](_0x1e8636[_0xf375('0x40')][_0xf375('0x33')]);_0x3ff736[_0xf375('0x47')]=qs[_0xf375('0x47')](_0x1e8636[_0xf375('0x40')][_0xf375('0x47')]);}return _0x418881[_0xf375('0x6a')](_0x3ff736);}})[_0xf375('0x22')](function(_0x569ac8){if(_0x569ac8){return _0x569ac8?{'count':_0x2f202e,'rows':_0x569ac8}:null;}})[_0xf375('0x22')](respondWithResult(_0x5c6adc,null))[_0xf375('0x2d')](handleError(_0x5c6adc,null));};
\ No newline at end of file
+var _0xe989=['where','pick','filter','merge','VIRTUAL','options','include','rows','show','params','includeAll','find','create','body','describe','getUnread','ChatInternalMessage','user','toInteger','addMembers','ids','omit','User','intersection','getMembers','hasOwnProperty','removeMembers','ChatGroupId','getMessages','findOne','$gte','split','YYYY-MM-DD\x20HH:mm:ss','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','moment','bluebird','util','sox','to-csv','ejs','lodash','squel','desk.js','querystring','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','api','../../config/environment','../../mysqldb','redis','defaults','socket.io-emitter','./chatGroup.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','info','request\x20sent','ChatGroup,\x20%s,\x20%s,\x20%s','error','code','ChatGroup,\x20%s,\x20%s','message','result','catch','end','status','count','offset','set','Content-Range','json','apply','save','update','destroy','sendStatus','stack','send','map','ChatGroup','rawAttributes','fieldName','name','query','keys','filters','model','attributes','fields','length','nolimit','limit','order','sort'];(function(_0x3b663f,_0x9ad0c9){var _0xfd7f8f=function(_0x3bf790){while(--_0x3bf790){_0x3b663f['push'](_0x3b663f['shift']());}};_0xfd7f8f(++_0x9ad0c9);}(_0xe989,0x15f));var _0x9e98=function(_0x83d0ad,_0x36efe7){_0x83d0ad=_0x83d0ad-0x0;var _0x5077aa=_0xe989[_0x83d0ad];return _0x5077aa;};'use strict';var pdf=require('html-pdf');var emlformat=require(_0x9e98('0x0'));var rimraf=require(_0x9e98('0x1'));var zipdir=require(_0x9e98('0x2'));var jsonpatch=require(_0x9e98('0x3'));var rp=require(_0x9e98('0x4'));var moment=require(_0x9e98('0x5'));var BPromise=require(_0x9e98('0x6'));var Mustache=require('mustache');var util=require(_0x9e98('0x7'));var path=require('path');var sox=require(_0x9e98('0x8'));var csv=require(_0x9e98('0x9'));var ejs=require(_0x9e98('0xa'));var fs=require('fs');var _=require(_0x9e98('0xb'));var squel=require(_0x9e98('0xc'));var crypto=require('crypto');var jsforce=require('jsforce');var deskjs=require(_0x9e98('0xd'));var toCsv=require(_0x9e98('0x9'));var querystring=require(_0x9e98('0xe'));var Papa=require('papaparse');var Redis=require('ioredis');var authService=require('../../components/auth/service');var qs=require(_0x9e98('0xf'));var as=require(_0x9e98('0x10'));var hardwareService=require(_0x9e98('0x11'));var logger=require('../../config/logger')(_0x9e98('0x12'));var utils=require('../../config/utils');var config=require(_0x9e98('0x13'));var db=require(_0x9e98('0x14'))['db'];config[_0x9e98('0x15')]=_[_0x9e98('0x16')](config[_0x9e98('0x15')],{'host':'localhost','port':0x18eb});var socket=require(_0x9e98('0x17'))(new Redis(config[_0x9e98('0x15')]));require(_0x9e98('0x18'))[_0x9e98('0x19')](socket);var jayson=require('jayson/promise');var client=jayson[_0x9e98('0x1a')][_0x9e98('0x1b')]({'port':0x232a});function checkPasswordPattern(_0x45b828,_0x16cc25,_0x214052){if(_0x214052){var _0x2a0ae7=new RegExp(/(?=.*[a-z])(?=.*[A-Z])(?=.*[0-9])(?=.*[?!@#\$%\^&\*~\-_=+[{\]\}])(?=.{8,})/);if(_0x2a0ae7[_0x9e98('0x1c')](_0x16cc25)){return _0x45b828;}else{throw new db[(_0x9e98('0x1d'))][(_0x9e98('0x1e'))](_0x9e98('0x1f'));}}else{return _0x45b828;}}function respondWithRpcPromise(_0x26d8ae,_0x370b0a,_0x320603,_0x1b6ea0){return new BPromise(function(_0x567a05,_0x42cf61){var _0x3440e6=_0x1b6ea0||client;return _0x3440e6[_0x9e98('0x20')](_0x26d8ae,_0x320603)[_0x9e98('0x21')](function(_0x2a1697){logger[_0x9e98('0x22')]('ChatGroup,\x20%s,\x20%s',_0x370b0a,_0x9e98('0x23'));logger['debug'](_0x9e98('0x24'),_0x370b0a,_0x9e98('0x23'),JSON['stringify'](_0x2a1697));if(_0x2a1697[_0x9e98('0x25')]){if(_0x2a1697[_0x9e98('0x25')][_0x9e98('0x26')]===0x1f4){logger[_0x9e98('0x25')](_0x9e98('0x27'),_0x370b0a,_0x2a1697['error'][_0x9e98('0x28')]);return _0x42cf61(_0x2a1697[_0x9e98('0x25')]['message']);}logger[_0x9e98('0x25')](_0x9e98('0x27'),_0x370b0a,_0x2a1697[_0x9e98('0x25')][_0x9e98('0x28')]);return _0x567a05(_0x2a1697['error'][_0x9e98('0x28')]);}else{logger[_0x9e98('0x22')](_0x9e98('0x27'),_0x370b0a,_0x9e98('0x23'));_0x567a05(_0x2a1697[_0x9e98('0x29')][_0x9e98('0x28')]);}})[_0x9e98('0x2a')](function(_0x2ce6ca){logger[_0x9e98('0x25')](_0x9e98('0x27'),_0x370b0a,_0x2ce6ca);_0x42cf61(_0x2ce6ca);});});}function respondWithStatusCode(_0x576bd7,_0x17928a){_0x17928a=_0x17928a||0xcc;return function(_0x12aa6a){if(_0x12aa6a){return _0x576bd7['sendStatus'](_0x17928a);}return _0x576bd7['status'](_0x17928a)[_0x9e98('0x2b')]();};}function respondWithResult(_0x3dcdfa,_0x537d17){_0x537d17=_0x537d17||0xc8;return function(_0x2058cf){if(_0x2058cf){return _0x3dcdfa[_0x9e98('0x2c')](_0x537d17)['json'](_0x2058cf);}};}function respondWithFilteredResult(_0x285594,_0x17661a){return function(_0x19dcc2){if(_0x19dcc2){var _0x403568=_0x19dcc2[_0x9e98('0x2d')],_0x3b55fc=_0x17661a['offset'],_0x5bf9f0=_0x17661a[_0x9e98('0x2e')]+_0x17661a['limit'],_0x49d462;if(_0x5bf9f0>=_0x403568){_0x5bf9f0=_0x403568;_0x49d462=0xc8;}else{_0x49d462=0xce;}_0x285594[_0x9e98('0x2c')](_0x49d462);return _0x285594[_0x9e98('0x2f')](_0x9e98('0x30'),_0x3b55fc+'-'+_0x5bf9f0+'/'+_0x403568)[_0x9e98('0x31')](_0x19dcc2);}return null;};}function patchUpdates(_0x34fbac){return function(_0x524c92){try{jsonpatch[_0x9e98('0x32')](_0x524c92,_0x34fbac,!![]);}catch(_0x48671a){return BPromise['reject'](_0x48671a);}return _0x524c92[_0x9e98('0x33')]();};}function saveUpdates(_0x320206,_0x55c442){return function(_0x109a4b){if(_0x109a4b){return _0x109a4b[_0x9e98('0x34')](_0x320206)[_0x9e98('0x21')](function(_0x16f483){return _0x16f483;});}return null;};}function removeEntity(_0x30a3d6,_0x3debe3){return function(_0x11c918){if(_0x11c918){return _0x11c918[_0x9e98('0x35')]()[_0x9e98('0x21')](function(){_0x30a3d6[_0x9e98('0x2c')](0xcc)[_0x9e98('0x2b')]();});}};}function handleEntityNotFound(_0x2ad703,_0x166d23){return function(_0x1a24a9){if(!_0x1a24a9){_0x2ad703[_0x9e98('0x36')](0x194);}return _0x1a24a9;};}function handleError(_0x3bba16,_0x4ce23e){_0x4ce23e=_0x4ce23e||0x1f4;return function(_0x5b4e4a){logger[_0x9e98('0x25')](_0x5b4e4a[_0x9e98('0x37')]);if(_0x5b4e4a['name']){delete _0x5b4e4a['name'];}_0x3bba16['status'](_0x4ce23e)[_0x9e98('0x38')](_0x5b4e4a);};}exports['index']=function(_0x2faba0,_0x283f12){var _0x32ce9f={},_0x423e26={},_0x4d1e3c={'count':0x0,'rows':[]};var _0x54b2a7=_[_0x9e98('0x39')](db[_0x9e98('0x3a')][_0x9e98('0x3b')],function(_0x19aa04){return{'name':_0x19aa04[_0x9e98('0x3c')],'type':_0x19aa04['type']['key']};});_0x423e26['model']=_['map'](_0x54b2a7,_0x9e98('0x3d'));_0x423e26[_0x9e98('0x3e')]=_[_0x9e98('0x3f')](_0x2faba0[_0x9e98('0x3e')]);_0x423e26[_0x9e98('0x40')]=_['intersection'](_0x423e26[_0x9e98('0x41')],_0x423e26[_0x9e98('0x3e')]);_0x32ce9f[_0x9e98('0x42')]=_['intersection'](_0x423e26[_0x9e98('0x41')],qs[_0x9e98('0x43')](_0x2faba0[_0x9e98('0x3e')][_0x9e98('0x43')]));_0x32ce9f['attributes']=_0x32ce9f['attributes'][_0x9e98('0x44')]?_0x32ce9f['attributes']:_0x423e26['model'];if(!_0x2faba0['query']['hasOwnProperty'](_0x9e98('0x45'))){_0x32ce9f[_0x9e98('0x46')]=qs[_0x9e98('0x46')](_0x2faba0[_0x9e98('0x3e')]['limit']);_0x32ce9f[_0x9e98('0x2e')]=qs[_0x9e98('0x2e')](_0x2faba0['query'][_0x9e98('0x2e')]);}_0x32ce9f[_0x9e98('0x47')]=qs['sort'](_0x2faba0[_0x9e98('0x3e')][_0x9e98('0x48')]);_0x32ce9f[_0x9e98('0x49')]=qs['filters'](_[_0x9e98('0x4a')](_0x2faba0[_0x9e98('0x3e')],_0x423e26[_0x9e98('0x40')]));if(_0x2faba0['query'][_0x9e98('0x4b')]){_0x32ce9f[_0x9e98('0x49')]=_[_0x9e98('0x4c')](_0x32ce9f[_0x9e98('0x49')],{'$or':_['map'](_0x54b2a7,function(_0x4e9cfe){if(_0x4e9cfe['type']!==_0x9e98('0x4d')){var _0x2ee695={};_0x2ee695[_0x4e9cfe[_0x9e98('0x3d')]]={'$like':'%'+_0x2faba0[_0x9e98('0x3e')][_0x9e98('0x4b')]+'%'};return _0x2ee695;}})});}_0x32ce9f=_[_0x9e98('0x4c')]({},_0x32ce9f,_0x2faba0[_0x9e98('0x4e')]);var _0x168459={'where':_0x32ce9f['where']};return db['ChatGroup'][_0x9e98('0x2d')](_0x168459)['then'](function(_0x1a7c9a){_0x4d1e3c[_0x9e98('0x2d')]=_0x1a7c9a;if(_0x2faba0['query']['includeAll']){_0x32ce9f[_0x9e98('0x4f')]=[{'all':!![]}];}return db[_0x9e98('0x3a')]['findAll'](_0x32ce9f);})['then'](function(_0x13d82f){_0x4d1e3c[_0x9e98('0x50')]=_0x13d82f;return _0x4d1e3c;})[_0x9e98('0x21')](respondWithFilteredResult(_0x283f12,_0x32ce9f))['catch'](handleError(_0x283f12,null));};exports[_0x9e98('0x51')]=function(_0x12a313,_0x40b035){var _0x1fecf3={'raw':!![],'where':{'id':_0x12a313[_0x9e98('0x52')]['id']}},_0x30320e={};_0x30320e[_0x9e98('0x41')]=_[_0x9e98('0x3f')](db[_0x9e98('0x3a')][_0x9e98('0x3b')]);_0x30320e['query']=_[_0x9e98('0x3f')](_0x12a313[_0x9e98('0x3e')]);_0x30320e['filters']=_['intersection'](_0x30320e[_0x9e98('0x41')],_0x30320e['query']);_0x1fecf3[_0x9e98('0x42')]=_['intersection'](_0x30320e['model'],qs[_0x9e98('0x43')](_0x12a313[_0x9e98('0x3e')][_0x9e98('0x43')]));_0x1fecf3['attributes']=_0x1fecf3[_0x9e98('0x42')][_0x9e98('0x44')]?_0x1fecf3[_0x9e98('0x42')]:_0x30320e[_0x9e98('0x41')];if(_0x12a313[_0x9e98('0x3e')][_0x9e98('0x53')]){_0x1fecf3['include']=[{'all':!![]}];}_0x1fecf3=_[_0x9e98('0x4c')]({},_0x1fecf3,_0x12a313[_0x9e98('0x4e')]);return db[_0x9e98('0x3a')][_0x9e98('0x54')](_0x1fecf3)['then'](handleEntityNotFound(_0x40b035,null))[_0x9e98('0x21')](respondWithResult(_0x40b035,null))[_0x9e98('0x2a')](handleError(_0x40b035,null));};exports[_0x9e98('0x55')]=function(_0xfd6b5b,_0x1c4900){return db['ChatGroup'][_0x9e98('0x55')](_0xfd6b5b[_0x9e98('0x56')],{})['then'](respondWithResult(_0x1c4900,0xc9))[_0x9e98('0x2a')](handleError(_0x1c4900,null));};exports[_0x9e98('0x34')]=function(_0x92c54d,_0x37ebc7){if(_0x92c54d['body']['id']){delete _0x92c54d[_0x9e98('0x56')]['id'];}return db[_0x9e98('0x3a')][_0x9e98('0x54')]({'where':{'id':_0x92c54d['params']['id']}})[_0x9e98('0x21')](handleEntityNotFound(_0x37ebc7,null))[_0x9e98('0x21')](saveUpdates(_0x92c54d[_0x9e98('0x56')],null))[_0x9e98('0x21')](respondWithResult(_0x37ebc7,null))['catch'](handleError(_0x37ebc7,null));};exports[_0x9e98('0x35')]=function(_0x14e7be,_0x5077b3){return db['ChatGroup']['find']({'where':{'id':_0x14e7be[_0x9e98('0x52')]['id']}})['then'](handleEntityNotFound(_0x5077b3,null))[_0x9e98('0x21')](removeEntity(_0x5077b3,null))[_0x9e98('0x2a')](handleError(_0x5077b3,null));};exports[_0x9e98('0x57')]=function(_0xc5ba5e,_0x1038d0){return db[_0x9e98('0x3a')]['describe']()[_0x9e98('0x21')](respondWithResult(_0x1038d0,null))[_0x9e98('0x2a')](handleError(_0x1038d0,null));};exports[_0x9e98('0x58')]=function(_0x1e3079,_0x1f47b2,_0x101268){return db[_0x9e98('0x59')][_0x9e98('0x2d')]({'where':{'ChatGroupId':_0x1e3079[_0x9e98('0x52')]['id'],'ToId':_0x1e3079[_0x9e98('0x5a')]['id'],'read':![]}})[_0x9e98('0x21')](function(_0x292069){return{'id':_[_0x9e98('0x5b')](_0x1e3079[_0x9e98('0x52')]['id']),'count':_0x292069};})[_0x9e98('0x21')](respondWithResult(_0x1f47b2,null))[_0x9e98('0x2a')](handleError(_0x1f47b2,null));};exports[_0x9e98('0x5c')]=function(_0x18fc9b,_0x4370ed,_0x2bd3b6){return db[_0x9e98('0x3a')][_0x9e98('0x54')]({'where':{'id':_0x18fc9b[_0x9e98('0x52')]['id']}})[_0x9e98('0x21')](handleEntityNotFound(_0x4370ed,null))[_0x9e98('0x21')](function(_0x58e99c){if(_0x58e99c){return _0x58e99c['addMembers'](_0x18fc9b[_0x9e98('0x56')][_0x9e98('0x5d')],_[_0x9e98('0x5e')](_0x18fc9b['body'],[_0x9e98('0x5d'),'id'])||{});}})[_0x9e98('0x21')](respondWithResult(_0x4370ed,null))['catch'](handleError(_0x4370ed,null));};exports['getMembers']=function(_0x18e106,_0x4a32fb,_0x3b99bf){var _0x13c9a0={};var _0x23037f={};var _0x535a0f;var _0x449081;return db[_0x9e98('0x3a')]['findOne']({'where':{'id':_0x18e106[_0x9e98('0x52')]['id']}})['then'](handleEntityNotFound(_0x4a32fb,null))[_0x9e98('0x21')](function(_0x5de96d){if(_0x5de96d){_0x535a0f=_0x5de96d;_0x23037f[_0x9e98('0x41')]=_[_0x9e98('0x3f')](db[_0x9e98('0x5f')][_0x9e98('0x3b')]);_0x23037f[_0x9e98('0x3e')]=_[_0x9e98('0x3f')](_0x18e106['query']);_0x23037f['filters']=_[_0x9e98('0x60')](_0x23037f[_0x9e98('0x41')],_0x23037f[_0x9e98('0x3e')]);_0x13c9a0[_0x9e98('0x42')]=_[_0x9e98('0x60')](_0x23037f[_0x9e98('0x41')],qs['fields'](_0x18e106[_0x9e98('0x3e')]['fields']));_0x13c9a0[_0x9e98('0x42')]=_0x13c9a0[_0x9e98('0x42')][_0x9e98('0x44')]?_0x13c9a0[_0x9e98('0x42')]:_0x23037f[_0x9e98('0x41')];_0x13c9a0[_0x9e98('0x47')]=qs['sort'](_0x18e106['query'][_0x9e98('0x48')]);_0x13c9a0[_0x9e98('0x49')]=qs[_0x9e98('0x40')](_[_0x9e98('0x4a')](_0x18e106['query'],_0x23037f[_0x9e98('0x40')]));if(_0x18e106['query'][_0x9e98('0x4b')]){_0x13c9a0[_0x9e98('0x49')]=_['merge'](_0x13c9a0[_0x9e98('0x49')],{'$or':_[_0x9e98('0x39')](_0x13c9a0[_0x9e98('0x42')],function(_0x36e16e){var _0x4d3e55={};_0x4d3e55[_0x36e16e]={'$like':'%'+_0x18e106[_0x9e98('0x3e')][_0x9e98('0x4b')]+'%'};return _0x4d3e55;})});}_0x13c9a0=_[_0x9e98('0x4c')]({},_0x13c9a0,_0x18e106[_0x9e98('0x4e')]);return _0x535a0f[_0x9e98('0x61')](_0x13c9a0);}})[_0x9e98('0x21')](function(_0x53631f){if(_0x53631f){_0x449081=_0x53631f[_0x9e98('0x44')];if(!_0x18e106[_0x9e98('0x3e')][_0x9e98('0x62')](_0x9e98('0x45'))){_0x13c9a0[_0x9e98('0x46')]=qs['limit'](_0x18e106[_0x9e98('0x3e')][_0x9e98('0x46')]);_0x13c9a0[_0x9e98('0x2e')]=qs['offset'](_0x18e106[_0x9e98('0x3e')][_0x9e98('0x2e')]);}return _0x535a0f['getMembers'](_0x13c9a0);}})['then'](function(_0x508573){if(_0x508573){return _0x508573?{'count':_0x449081,'rows':_0x508573}:null;}})[_0x9e98('0x21')](respondWithResult(_0x4a32fb,null))['catch'](handleError(_0x4a32fb,null));};exports[_0x9e98('0x63')]=function(_0x5dc478,_0x328089,_0x131b5e){return db[_0x9e98('0x3a')]['find']({'where':{'id':_0x5dc478[_0x9e98('0x52')]['id']}})['then'](handleEntityNotFound(_0x328089,null))[_0x9e98('0x21')](function(_0x1a9de6){if(_0x1a9de6){return _0x1a9de6[_0x9e98('0x63')](_0x5dc478[_0x9e98('0x3e')]['ids']);}})[_0x9e98('0x21')](respondWithStatusCode(_0x328089,null))['catch'](handleError(_0x328089,null));};exports['addMessage']=function(_0x11e683,_0x1b77a2,_0xe173bc){if(_0x11e683[_0x9e98('0x56')]['id']){delete _0x11e683['body']['id'];}return db[_0x9e98('0x3a')][_0x9e98('0x54')]({'where':{'id':_0x11e683[_0x9e98('0x52')]['id']}})['then'](handleEntityNotFound(_0x1b77a2,null))[_0x9e98('0x21')](function(_0x2b58d3){if(_0x2b58d3){_0x11e683[_0x9e98('0x56')][_0x9e98('0x64')]=_0x2b58d3['id'];return db[_0x9e98('0x59')]['create'](_0x11e683[_0x9e98('0x56')]);}})['then'](respondWithResult(_0x1b77a2,null))[_0x9e98('0x2a')](handleError(_0x1b77a2,null));};exports[_0x9e98('0x65')]=function(_0x5e7b54,_0x55391c,_0x437b4f){var _0x362c11={};var _0x2da708={};var _0x5b9d56;var _0x5a157d;return db[_0x9e98('0x3a')][_0x9e98('0x66')]({'where':{'id':_0x5e7b54['params']['id']}})['then'](handleEntityNotFound(_0x55391c,null))['then'](function(_0x3372c3){if(_0x3372c3){_0x5b9d56=_0x3372c3;_0x2da708[_0x9e98('0x41')]=_[_0x9e98('0x3f')](db['ChatInternalMessage'][_0x9e98('0x3b')]);_0x2da708[_0x9e98('0x3e')]=_[_0x9e98('0x3f')](_0x5e7b54[_0x9e98('0x3e')]);_0x2da708['filters']=_[_0x9e98('0x60')](_0x2da708[_0x9e98('0x41')],_0x2da708[_0x9e98('0x3e')]);_0x362c11[_0x9e98('0x42')]=_[_0x9e98('0x60')](_0x2da708[_0x9e98('0x41')],qs[_0x9e98('0x43')](_0x5e7b54[_0x9e98('0x3e')][_0x9e98('0x43')]));_0x362c11[_0x9e98('0x42')]=_0x362c11['attributes'][_0x9e98('0x44')]?_0x362c11[_0x9e98('0x42')]:_0x2da708[_0x9e98('0x41')];_0x362c11[_0x9e98('0x47')]=qs[_0x9e98('0x48')](_0x5e7b54[_0x9e98('0x3e')][_0x9e98('0x48')]);_0x362c11['where']=qs[_0x9e98('0x40')](_[_0x9e98('0x4a')](_0x5e7b54[_0x9e98('0x3e')],_0x2da708[_0x9e98('0x40')]));if(_0x5e7b54[_0x9e98('0x3e')]['filter']){_0x362c11[_0x9e98('0x49')]=_['merge'](_0x362c11[_0x9e98('0x49')],{'$or':_[_0x9e98('0x39')](_0x362c11[_0x9e98('0x42')],function(_0x582a8d){var _0x22f60b={};_0x22f60b[_0x582a8d]={'$like':'%'+_0x5e7b54['query'][_0x9e98('0x4b')]+'%'};return _0x22f60b;})});}if(_0x5e7b54[_0x9e98('0x3e')][_0x9e98('0x67')]){var _0x5c4f8c=_0x5e7b54[_0x9e98('0x3e')][_0x9e98('0x67')][_0x9e98('0x68')](',');var _0x113f2d={};_0x113f2d[_0x5c4f8c[0x0]]={'$gte':moment(_0x5c4f8c[0x1])['format'](_0x9e98('0x69'))};_0x362c11[_0x9e98('0x49')]=_[_0x9e98('0x4c')](_0x362c11['where'],_0x113f2d);}_0x362c11=_[_0x9e98('0x4c')]({},_0x362c11,_0x5e7b54[_0x9e98('0x4e')]);return _0x5b9d56[_0x9e98('0x65')](_0x362c11);}})[_0x9e98('0x21')](function(_0x155346){if(_0x155346){_0x5a157d=_0x155346[_0x9e98('0x44')];if(!_0x5e7b54[_0x9e98('0x3e')][_0x9e98('0x62')]('nolimit')){_0x362c11[_0x9e98('0x46')]=qs[_0x9e98('0x46')](_0x5e7b54[_0x9e98('0x3e')]['limit']);_0x362c11['offset']=qs[_0x9e98('0x2e')](_0x5e7b54[_0x9e98('0x3e')][_0x9e98('0x2e')]);}return _0x5b9d56[_0x9e98('0x65')](_0x362c11);}})[_0x9e98('0x21')](function(_0x5cfda8){if(_0x5cfda8){return _0x5cfda8?{'count':_0x5a157d,'rows':_0x5cfda8}:null;}})[_0x9e98('0x21')](respondWithResult(_0x55391c,null))[_0x9e98('0x2a')](handleError(_0x55391c,null));};
\ No newline at end of file
diff --git a/server/api/chatGroup/chatGroup.events.js b/server/api/chatGroup/chatGroup.events.js
index ba98a8a..69f4a61 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(_0xd2fb5a,_0x48e63a){var _0x4dc10a=function(_0x187ad0){while(--_0x187ad0){_0xd2fb5a['push'](_0xd2fb5a['shift']());}};_0x4dc10a(++_0x48e63a);}(_0x5f66,0x1a0));var _0x65f6=function(_0x278e3c,_0x1c9cfd){_0x278e3c=_0x278e3c-0x0;var _0x3e2d9b=_0x5f66[_0x278e3c];return _0x3e2d9b;};'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 _0xb10b=['hasOwnProperty','hook','events','ChatGroup','setMaxListeners','save','remove','emit'];(function(_0x33f349,_0xcbc1be){var _0x5329b3=function(_0x1eabbd){while(--_0x1eabbd){_0x33f349['push'](_0x33f349['shift']());}};_0x5329b3(++_0xcbc1be);}(_0xb10b,0x12a));var _0xbb10=function(_0x1f7fb2,_0x116309){_0x1f7fb2=_0x1f7fb2-0x0;var _0x61fc27=_0xb10b[_0x1f7fb2];return _0x61fc27;};'use strict';var EventEmitter=require(_0xbb10('0x0'));var ChatGroup=require('../../mysqldb')['db'][_0xbb10('0x1')];var ChatGroupEvents=new EventEmitter();ChatGroupEvents[_0xbb10('0x2')](0x0);var events={'afterCreate':_0xbb10('0x3'),'afterUpdate':'update','afterDestroy':_0xbb10('0x4')};function emitEvent(_0x9bbed){return function(_0x460981,_0x22320e,_0x49baf4){ChatGroupEvents[_0xbb10('0x5')](_0x9bbed+':'+_0x460981['id'],_0x460981);ChatGroupEvents['emit'](_0x9bbed,_0x460981);_0x49baf4(null);};}for(var e in events){if(events[_0xbb10('0x6')](e)){var event=events[e];ChatGroup[_0xbb10('0x7')](e,emitEvent(event));}}module['exports']=ChatGroupEvents;
\ No newline at end of file
diff --git a/server/api/chatGroup/chatGroup.model.js b/server/api/chatGroup/chatGroup.model.js
index e9313f5..defbf71 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 _0xff98=['request-promise','rimraf','./chatGroup.attributes','define','ChatGroup','chat_groups','util','../../config/logger','api','moment'];(function(_0x4b7f88,_0x40a1f8){var _0x6cef80=function(_0x366922){while(--_0x366922){_0x4b7f88['push'](_0x4b7f88['shift']());}};_0x6cef80(++_0x40a1f8);}(_0xff98,0x9c));var _0x8ff9=function(_0x33ccbf,_0x30b104){_0x33ccbf=_0x33ccbf-0x0;var _0x118796=_0xff98[_0x33ccbf];return _0x118796;};'use strict';var _=require('lodash');var util=require(_0x8ff9('0x0'));var logger=require(_0x8ff9('0x1'))(_0x8ff9('0x2'));var moment=require(_0x8ff9('0x3'));var BPromise=require('bluebird');var rp=require(_0x8ff9('0x4'));var fs=require('fs');var path=require('path');var rimraf=require(_0x8ff9('0x5'));var config=require('../../config/environment');var attributes=require(_0x8ff9('0x6'));module['exports']=function(_0x7b1d31,_0x2c11a2){return _0x7b1d31[_0x8ff9('0x7')](_0x8ff9('0x8'),attributes,{'tableName':_0x8ff9('0x9'),'paranoid':![],'indexes':[],'timestamps':!![]});};
\ No newline at end of file
+var _0xbe52=['../../config/environment','./chatGroup.attributes','exports','define','ChatGroup','chat_groups','lodash','util','../../config/logger','api','moment','request-promise','path','rimraf'];(function(_0x3d99ce,_0x216db1){var _0x376c13=function(_0x22347d){while(--_0x22347d){_0x3d99ce['push'](_0x3d99ce['shift']());}};_0x376c13(++_0x216db1);}(_0xbe52,0x164));var _0x2be5=function(_0x5a8375,_0x5572fc){_0x5a8375=_0x5a8375-0x0;var _0x20495c=_0xbe52[_0x5a8375];return _0x20495c;};'use strict';var _=require(_0x2be5('0x0'));var util=require(_0x2be5('0x1'));var logger=require(_0x2be5('0x2'))(_0x2be5('0x3'));var moment=require(_0x2be5('0x4'));var BPromise=require('bluebird');var rp=require(_0x2be5('0x5'));var fs=require('fs');var path=require(_0x2be5('0x6'));var rimraf=require(_0x2be5('0x7'));var config=require(_0x2be5('0x8'));var attributes=require(_0x2be5('0x9'));module[_0x2be5('0xa')]=function(_0x39dc18,_0x13fadf){return _0x39dc18[_0x2be5('0xb')](_0x2be5('0xc'),attributes,{'tableName':_0x2be5('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 208d75b..588721e 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 _0xe1a0=['request\x20sent','result','catch','lodash','util','moment','bluebird','randomstring','ioredis','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','redis','defaults','socket.io-emitter','./chatGroup.socket','register','request','then','info','ChatGroup,\x20%s,\x20%s','debug','stringify','error','message'];(function(_0xb1cf84,_0x813740){var _0x4bad2e=function(_0x53e6f2){while(--_0x53e6f2){_0xb1cf84['push'](_0xb1cf84['shift']());}};_0x4bad2e(++_0x813740);}(_0xe1a0,0x111));var _0x0e1a=function(_0x532d78,_0x25b6a8){_0x532d78=_0x532d78-0x0;var _0x5990c4=_0xe1a0[_0x532d78];return _0x5990c4;};'use strict';var _=require(_0x0e1a('0x0'));var util=require(_0x0e1a('0x1'));var moment=require(_0x0e1a('0x2'));var BPromise=require(_0x0e1a('0x3'));var rs=require(_0x0e1a('0x4'));var fs=require('fs');var Redis=require(_0x0e1a('0x5'));var db=require('../../mysqldb')['db'];var utils=require(_0x0e1a('0x6'));var logger=require(_0x0e1a('0x7'))(_0x0e1a('0x8'));var config=require(_0x0e1a('0x9'));var jayson=require(_0x0e1a('0xa'));var client=jayson['client']['http']({'port':0x232a});config[_0x0e1a('0xb')]=_[_0x0e1a('0xc')](config['redis'],{'host':'localhost','port':0x18eb});var socket=require(_0x0e1a('0xd'))(new Redis(config[_0x0e1a('0xb')]));require(_0x0e1a('0xe'))[_0x0e1a('0xf')](socket);function respondWithRpcPromise(_0x49a3c1,_0x63b5a3,_0x314115){return new BPromise(function(_0x16dcce,_0x52a376){return client[_0x0e1a('0x10')](_0x49a3c1,_0x314115)[_0x0e1a('0x11')](function(_0x4110ec){logger[_0x0e1a('0x12')](_0x0e1a('0x13'),_0x63b5a3,'request\x20sent');logger[_0x0e1a('0x14')]('ChatGroup,\x20%s,\x20%s,\x20%s',_0x63b5a3,'request\x20sent',JSON[_0x0e1a('0x15')](_0x4110ec));if(_0x4110ec['error']){if(_0x4110ec[_0x0e1a('0x16')]['code']===0x1f4){logger[_0x0e1a('0x16')]('ChatGroup,\x20%s,\x20%s',_0x63b5a3,_0x4110ec[_0x0e1a('0x16')]['message']);return _0x52a376(_0x4110ec[_0x0e1a('0x16')][_0x0e1a('0x17')]);}logger['error'](_0x0e1a('0x13'),_0x63b5a3,_0x4110ec[_0x0e1a('0x16')][_0x0e1a('0x17')]);return _0x16dcce(_0x4110ec[_0x0e1a('0x16')][_0x0e1a('0x17')]);}else{logger[_0x0e1a('0x12')](_0x0e1a('0x13'),_0x63b5a3,_0x0e1a('0x18'));_0x16dcce(_0x4110ec[_0x0e1a('0x19')]['message']);}})[_0x0e1a('0x1a')](function(_0x22e7f7){logger['error']('ChatGroup,\x20%s,\x20%s',_0x63b5a3,_0x22e7f7);_0x52a376(_0x22e7f7);});});}
\ No newline at end of file
+var _0x448b=['lodash','util','moment','bluebird','randomstring','../../config/utils','jayson/promise','http','defaults','socket.io-emitter','./chatGroup.socket','register','request','info','ChatGroup,\x20%s,\x20%s','request\x20sent','ChatGroup,\x20%s,\x20%s,\x20%s','error','code','message','result','catch'];(function(_0x2f3a34,_0x19a907){var _0x97f5c7=function(_0x573d19){while(--_0x573d19){_0x2f3a34['push'](_0x2f3a34['shift']());}};_0x97f5c7(++_0x19a907);}(_0x448b,0x1ce));var _0xb448=function(_0x4fba68,_0x415703){_0x4fba68=_0x4fba68-0x0;var _0x3e10be=_0x448b[_0x4fba68];return _0x3e10be;};'use strict';var _=require(_0xb448('0x0'));var util=require(_0xb448('0x1'));var moment=require(_0xb448('0x2'));var BPromise=require(_0xb448('0x3'));var rs=require(_0xb448('0x4'));var fs=require('fs');var Redis=require('ioredis');var db=require('../../mysqldb')['db'];var utils=require(_0xb448('0x5'));var logger=require('../../config/logger')('rpc');var config=require('../../config/environment');var jayson=require(_0xb448('0x6'));var client=jayson['client'][_0xb448('0x7')]({'port':0x232a});config['redis']=_[_0xb448('0x8')](config['redis'],{'host':'localhost','port':0x18eb});var socket=require(_0xb448('0x9'))(new Redis(config['redis']));require(_0xb448('0xa'))[_0xb448('0xb')](socket);function respondWithRpcPromise(_0x19fb86,_0x3dfb0b,_0x347e57){return new BPromise(function(_0x7ccdc8,_0x1a2be1){return client[_0xb448('0xc')](_0x19fb86,_0x347e57)['then'](function(_0x404d2b){logger[_0xb448('0xd')](_0xb448('0xe'),_0x3dfb0b,_0xb448('0xf'));logger['debug'](_0xb448('0x10'),_0x3dfb0b,_0xb448('0xf'),JSON['stringify'](_0x404d2b));if(_0x404d2b['error']){if(_0x404d2b[_0xb448('0x11')][_0xb448('0x12')]===0x1f4){logger[_0xb448('0x11')](_0xb448('0xe'),_0x3dfb0b,_0x404d2b['error'][_0xb448('0x13')]);return _0x1a2be1(_0x404d2b[_0xb448('0x11')]['message']);}logger[_0xb448('0x11')]('ChatGroup,\x20%s,\x20%s',_0x3dfb0b,_0x404d2b['error'][_0xb448('0x13')]);return _0x7ccdc8(_0x404d2b[_0xb448('0x11')][_0xb448('0x13')]);}else{logger[_0xb448('0xd')](_0xb448('0xe'),_0x3dfb0b,'request\x20sent');_0x7ccdc8(_0x404d2b[_0xb448('0x14')][_0xb448('0x13')]);}})[_0xb448('0x15')](function(_0x52dc97){logger[_0xb448('0x11')](_0xb448('0xe'),_0x3dfb0b,_0x52dc97);_0x1a2be1(_0x52dc97);});});}
\ No newline at end of file
diff --git a/server/api/chatGroup/chatGroup.socket.js b/server/api/chatGroup/chatGroup.socket.js
index 0d8e2a8..d12f0f5 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 _0xfe7f=['length','./chatGroup.events','remove','update','emit'];(function(_0x49a5e5,_0x2da675){var _0x39a657=function(_0x3d5546){while(--_0x3d5546){_0x49a5e5['push'](_0x49a5e5['shift']());}};_0x39a657(++_0x2da675);}(_0xfe7f,0xf1));var _0xffe7=function(_0x5f4395,_0x2764d7){_0x5f4395=_0x5f4395-0x0;var _0x213856=_0xfe7f[_0x5f4395];return _0x213856;};'use strict';var ChatGroupEvents=require(_0xffe7('0x0'));var events=['save',_0xffe7('0x1'),_0xffe7('0x2')];function createListener(_0xc9ab6d,_0x446098){return function(_0x5279bc){_0x446098[_0xffe7('0x3')](_0xc9ab6d,_0x5279bc);};}function removeListener(_0x39c1fd,_0x59d1d1){return function(){ChatGroupEvents['removeListener'](_0x39c1fd,_0x59d1d1);};}exports['register']=function(_0x56681b){for(var _0xeb3c0f=0x0,_0x3c26eb=events[_0xffe7('0x4')];_0xeb3c0f<_0x3c26eb;_0xeb3c0f++){var _0x3c765b=events[_0xeb3c0f];var _0x175fbf=createListener('chatGroup:'+_0x3c765b,_0x56681b);ChatGroupEvents['on'](_0x3c765b,_0x175fbf);}};
\ No newline at end of file
+var _0x4a19=['remove','emit','register','length','chatGroup:','./chatGroup.events','save'];(function(_0x5c2a56,_0x154cbc){var _0x55ea73=function(_0x5afe14){while(--_0x5afe14){_0x5c2a56['push'](_0x5c2a56['shift']());}};_0x55ea73(++_0x154cbc);}(_0x4a19,0xd0));var _0x94a1=function(_0x1256b8,_0x1bba73){_0x1256b8=_0x1256b8-0x0;var _0x52bc82=_0x4a19[_0x1256b8];return _0x52bc82;};'use strict';var ChatGroupEvents=require(_0x94a1('0x0'));var events=[_0x94a1('0x1'),_0x94a1('0x2'),'update'];function createListener(_0x18c314,_0x1dd617){return function(_0x48c3a3){_0x1dd617[_0x94a1('0x3')](_0x18c314,_0x48c3a3);};}function removeListener(_0x24783a,_0x416890){return function(){ChatGroupEvents['removeListener'](_0x24783a,_0x416890);};}exports[_0x94a1('0x4')]=function(_0x33a7ff){for(var _0x57e7be=0x0,_0x4527ad=events[_0x94a1('0x5')];_0x57e7be<_0x4527ad;_0x57e7be++){var _0x42509c=events[_0x57e7be];var _0x3a3d95=createListener(_0x94a1('0x6')+_0x42509c,_0x33a7ff);ChatGroupEvents['on'](_0x42509c,_0x3a3d95);}};
\ No newline at end of file
diff --git a/server/api/chatGroup/index.js b/server/api/chatGroup/index.js
index 29a52f0..ae5b255 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 _0x391c=['connect-timeout','express','Router','../../components/auth/service','../../components/interaction/service','../../config/environment','./chatGroup.controller','isAuthenticated','index','/describe','describe','get','/:id','getUnread','/:id/members','getMessages','post','create','addMembers','addMessage','update','destroy','delete','multer','util','path'];(function(_0x25bea7,_0x49ab45){var _0x175952=function(_0x56a0b5){while(--_0x56a0b5){_0x25bea7['push'](_0x25bea7['shift']());}};_0x175952(++_0x49ab45);}(_0x391c,0x1b7));var _0xc391=function(_0x52d4ad,_0x25e611){_0x52d4ad=_0x52d4ad-0x0;var _0x34a767=_0x391c[_0x52d4ad];return _0x34a767;};'use strict';var multer=require(_0xc391('0x0'));var util=require(_0xc391('0x1'));var path=require(_0xc391('0x2'));var timeout=require(_0xc391('0x3'));var express=require(_0xc391('0x4'));var router=express[_0xc391('0x5')]();var auth=require(_0xc391('0x6'));var interaction=require(_0xc391('0x7'));var config=require(_0xc391('0x8'));var controller=require(_0xc391('0x9'));router['get']('/',auth[_0xc391('0xa')](),controller[_0xc391('0xb')]);router['get'](_0xc391('0xc'),auth['isAuthenticated'](),controller[_0xc391('0xd')]);router[_0xc391('0xe')](_0xc391('0xf'),auth[_0xc391('0xa')](),controller['show']);router['get']('/:id/unread',auth[_0xc391('0xa')](),controller[_0xc391('0x10')]);router[_0xc391('0xe')](_0xc391('0x11'),auth[_0xc391('0xa')](),controller['getMembers']);router[_0xc391('0xe')]('/:id/messages',auth[_0xc391('0xa')](),controller[_0xc391('0x12')]);router[_0xc391('0x13')]('/',auth[_0xc391('0xa')](),controller[_0xc391('0x14')]);router[_0xc391('0x13')](_0xc391('0x11'),auth[_0xc391('0xa')](),controller[_0xc391('0x15')]);router[_0xc391('0x13')]('/:id/messages',auth[_0xc391('0xa')](),controller[_0xc391('0x16')]);router['put']('/:id',auth[_0xc391('0xa')](),controller[_0xc391('0x17')]);router['delete']('/:id',auth[_0xc391('0xa')](),controller[_0xc391('0x18')]);router[_0xc391('0x19')](_0xc391('0x11'),auth[_0xc391('0xa')](),controller['removeMembers']);module['exports']=router;
\ No newline at end of file
+var _0xe319=['get','isAuthenticated','index','/describe','describe','/:id','show','/:id/unread','getMembers','/:id/messages','getMessages','post','create','addMessage','put','delete','destroy','/:id/members','exports','util','path','express','Router','../../components/auth/service','../../config/environment','./chatGroup.controller'];(function(_0x21ab9a,_0x4662dd){var _0x1afd05=function(_0x47e6e8){while(--_0x47e6e8){_0x21ab9a['push'](_0x21ab9a['shift']());}};_0x1afd05(++_0x4662dd);}(_0xe319,0x117));var _0x9e31=function(_0x12691a,_0x2b26e1){_0x12691a=_0x12691a-0x0;var _0xf72be4=_0xe319[_0x12691a];return _0xf72be4;};'use strict';var multer=require('multer');var util=require(_0x9e31('0x0'));var path=require(_0x9e31('0x1'));var timeout=require('connect-timeout');var express=require(_0x9e31('0x2'));var router=express[_0x9e31('0x3')]();var auth=require(_0x9e31('0x4'));var interaction=require('../../components/interaction/service');var config=require(_0x9e31('0x5'));var controller=require(_0x9e31('0x6'));router[_0x9e31('0x7')]('/',auth[_0x9e31('0x8')](),controller[_0x9e31('0x9')]);router[_0x9e31('0x7')](_0x9e31('0xa'),auth[_0x9e31('0x8')](),controller[_0x9e31('0xb')]);router[_0x9e31('0x7')](_0x9e31('0xc'),auth['isAuthenticated'](),controller[_0x9e31('0xd')]);router[_0x9e31('0x7')](_0x9e31('0xe'),auth[_0x9e31('0x8')](),controller['getUnread']);router[_0x9e31('0x7')]('/:id/members',auth[_0x9e31('0x8')](),controller[_0x9e31('0xf')]);router[_0x9e31('0x7')](_0x9e31('0x10'),auth[_0x9e31('0x8')](),controller[_0x9e31('0x11')]);router[_0x9e31('0x12')]('/',auth[_0x9e31('0x8')](),controller[_0x9e31('0x13')]);router[_0x9e31('0x12')]('/:id/members',auth[_0x9e31('0x8')](),controller['addMembers']);router[_0x9e31('0x12')](_0x9e31('0x10'),auth[_0x9e31('0x8')](),controller[_0x9e31('0x14')]);router[_0x9e31('0x15')](_0x9e31('0xc'),auth['isAuthenticated'](),controller['update']);router[_0x9e31('0x16')]('/:id',auth['isAuthenticated'](),controller[_0x9e31('0x17')]);router['delete'](_0x9e31('0x18'),auth[_0x9e31('0x8')](),controller['removeMembers']);module[_0x9e31('0x19')]=router;
\ No newline at end of file
diff --git a/server/api/chatInteraction/chatInteraction.attributes.js b/server/api/chatInteraction/chatInteraction.attributes.js
index 08ff6ab..042c31e 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 _0x5092=['sequelize','exports','BOOLEAN','INTEGER','ENUM','star','STRING','DATE','TEXT','long'];(function(_0x352061,_0x176667){var _0x2cae8d=function(_0x5e37cb){while(--_0x5e37cb){_0x352061['push'](_0x352061['shift']());}};_0x2cae8d(++_0x176667);}(_0x5092,0x64));var _0x2509=function(_0x5952c2,_0x112bd1){_0x5952c2=_0x5952c2-0x0;var _0x5bb0ee=_0x5092[_0x5952c2];return _0x5bb0ee;};'use strict';var Sequelize=require(_0x2509('0x0'));module[_0x2509('0x1')]={'closed':{'type':Sequelize[_0x2509('0x2')],'defaultValue':![]},'ratingValue':{'type':Sequelize[_0x2509('0x3')]},'ratingType':{'type':Sequelize[_0x2509('0x4')](_0x2509('0x5'),'thumb'),'defaultValue':_0x2509('0x5')},'ratingMessage':{'type':Sequelize['TEXT']},'pathTranscript':{'type':Sequelize['TEXT']},'mailTranscript':{'type':Sequelize[_0x2509('0x6')],'validate':{'isEmail':!![]}},'closedAt':{'type':Sequelize[_0x2509('0x7')]},'disposition':{'type':Sequelize[_0x2509('0x6')]},'note':{'type':Sequelize[_0x2509('0x6')]},'browserName':{'type':Sequelize['STRING']},'browserVersion':{'type':Sequelize['STRING']},'osName':{'type':Sequelize[_0x2509('0x6')]},'osVersion':{'type':Sequelize[_0x2509('0x6')]},'deviceModel':{'type':Sequelize['STRING']},'deviceVendor':{'type':Sequelize[_0x2509('0x6')]},'deviceType':{'type':Sequelize[_0x2509('0x6')]},'referer':{'type':Sequelize[_0x2509('0x8')]},'customerIp':{'type':Sequelize[_0x2509('0x6')]},'formData':{'type':Sequelize[_0x2509('0x8')](_0x2509('0x9'))},'read1stAt':{'type':Sequelize['DATE']},'lastMsgAt':{'type':Sequelize[_0x2509('0x7')]},'lastMsgDirection':{'type':Sequelize[_0x2509('0x4')]('in','out'),'defaultValue':'in','allowNull':![]},'closeReason':{'type':Sequelize[_0x2509('0x6')]},'customerPort':{'type':Sequelize[_0x2509('0x6')]}};
\ No newline at end of file
+var _0x00f0=['BOOLEAN','star','thumb','TEXT','DATE','STRING','long','ENUM','out','exports'];(function(_0x2f1114,_0x4561f1){var _0x2fe856=function(_0x8397f8){while(--_0x8397f8){_0x2f1114['push'](_0x2f1114['shift']());}};_0x2fe856(++_0x4561f1);}(_0x00f0,0x81));var _0x000f=function(_0x32ccfb,_0x1b9af3){_0x32ccfb=_0x32ccfb-0x0;var _0x1ba8d2=_0x00f0[_0x32ccfb];return _0x1ba8d2;};'use strict';var Sequelize=require('sequelize');module[_0x000f('0x0')]={'closed':{'type':Sequelize[_0x000f('0x1')],'defaultValue':![]},'ratingValue':{'type':Sequelize['INTEGER']},'ratingType':{'type':Sequelize['ENUM'](_0x000f('0x2'),_0x000f('0x3')),'defaultValue':_0x000f('0x2')},'ratingMessage':{'type':Sequelize['TEXT']},'pathTranscript':{'type':Sequelize[_0x000f('0x4')]},'mailTranscript':{'type':Sequelize['STRING'],'validate':{'isEmail':!![]}},'closedAt':{'type':Sequelize[_0x000f('0x5')]},'disposition':{'type':Sequelize[_0x000f('0x6')]},'note':{'type':Sequelize['STRING']},'browserName':{'type':Sequelize[_0x000f('0x6')]},'browserVersion':{'type':Sequelize[_0x000f('0x6')]},'osName':{'type':Sequelize[_0x000f('0x6')]},'osVersion':{'type':Sequelize['STRING']},'deviceModel':{'type':Sequelize[_0x000f('0x6')]},'deviceVendor':{'type':Sequelize['STRING']},'deviceType':{'type':Sequelize[_0x000f('0x6')]},'referer':{'type':Sequelize['TEXT']},'customerIp':{'type':Sequelize[_0x000f('0x6')]},'formData':{'type':Sequelize[_0x000f('0x4')](_0x000f('0x7'))},'read1stAt':{'type':Sequelize[_0x000f('0x5')]},'lastMsgAt':{'type':Sequelize[_0x000f('0x5')]},'lastMsgDirection':{'type':Sequelize[_0x000f('0x8')]('in',_0x000f('0x9')),'defaultValue':'in','allowNull':![]},'closeReason':{'type':Sequelize['STRING']},'customerPort':{'type':Sequelize[_0x000f('0x6')]}};
\ No newline at end of file
diff --git a/server/api/chatInteraction/chatInteraction.controller.js b/server/api/chatInteraction/chatInteraction.controller.js
index 4df605e..fc9eff1 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 _0x741c=['GROUP_CONCAT(DISTINCT\x20t.id)','ui.ChatInteractionId\x20IN\x20?','groupBy','ChatInteractionId','push','all','rows','show','params','length','includeAll','options','create','describe','abandon','abandonInteraction,\x20%s,\x20%s,\x20%s','entity\x20not\x20found','ValidationError','Interaction\x20already\x20assigned','closed','disposition','attachmentUpload','file','originalname','filename','mimetype','Attachment','attachmentDownload','findOne','Unauthorized','download','join','server/files/attachments/','close','mailTranscript','root','format','transcript-%s.txt','now','pathTranscript','ChatMessage','Messages','User','CmContact','%s%d','agentAlias','UserId','System','Visitor','agentIdentifier','agent_fullname','[%s]\x20%s:\x20%s\x0a','createdAt','direction','secret','MailServerOut','Smtp','service','host','port','secure','authentication','auth','pass','sendMail','\x22%s\x22\x20<%s>','email','Hi\x20%s,\x20attached\x20you\x20can\x20find\x20your\x20transcript\x20file.\x20\x0a\x0aRegards.\x20\x0a\x0a','addMessage','getMessages','YYYY-MM-DD\x20HH:mm:ss','include','findAll','getMyMessages','includeAgent','alias','setTags','ids','omit','spread','emit','chatInteractionTags:save','removeTags','server','files','tmp','attachments','transcript-%d-%s.zip','firstName','lastName','ChatWebsite','Account','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\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','YYYY-MM-DD','Owner','N.A.','referer','customerPort','tail','basename','existsSync','createReadStream','pipe','createWriteStream','out','renderFile','views','downloadInteraction.html','toFile','transcript-','.pdf','log','unlinkSync','html-pdf','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','mustache','path','sox','to-csv','ejs','lodash','squel','crypto','desk.js','papaparse','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/environment','redis','localhost','socket.io-emitter','./chatInteraction.socket','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~!@#$%^&-_=+[{]}.','request','then','info','ChatInteraction,\x20%s,\x20%s','request\x20sent','debug','ChatInteraction,\x20%s,\x20%s,\x20%s','error','code','message','result','catch','sendStatus','status','json','offset','limit','Content-Range','apply','reject','update','destroy','end','stack','name','send','map','fullname','Tags','TagIds','split','forEach','index','ChatInteraction','type','model','query','keys','filters','intersection','attributes','hasOwnProperty','nolimit','order','sort','pick','select','field','color','tools_tags','u.id','u.fullname','from','user_has_chat_interactions','left_join','users','chat_interactions','cm_contacts','c.id\x20=\x20i.ContactId\x20AND\x20c.deletedAt\x20IS\x20NULL','o.id\x20=\x20i.UserId','chat_websites','a.id\x20=\x20i.ChatWebsiteId','chat_messages','me.ChatInteractionId\x20=\x20i.id','it.ChatInteractionId\x20=\x20i.id','t.id\x20=\x20it.TagId','expr','search','parseSearch','sqlOperator','conditions','find','having','`\x20>\x200','Contact','operator','MATCH\x20(c.firstName,\x20c.lastName,\x20c.phone,\x20c.mobile,\x20c.fax,\x20c.email)\x20AGAINST\x20(?\x20IN\x20BOOLEAN\x20MODE)','getFullTextValue','value','c.firstName\x20LIKE\x20?\x20OR\x20c.lastName\x20LIKE\x20?\x20OR\x20c.email\x20LIKE\x20?','ContactId','buildExpression','start','Tag','union','$substring','CONCAT_WS(\x27\x20\x27,\x20o.name,\x20o.fullname)\x20LIKE\x20?','text','body','some','ChatWebsiteId','i.ChatWebsiteId\x20IN\x20?','concat','parse','$gte','$lte','where','i.createdAt\x20BETWEEN\x20?\x20AND\x20?','\x20IS\x20NULL','\x20=\x20?','read','`unreadMessages`\x20=\x200','isArray','tag','CONCAT(\x27,\x27,\x20`TagIds`,\x20\x27,\x27)\x20LIKE\x20?','filter','replace','i.id\x20LIKE\x20?','MATCH\x20(me.body)\x20AGAINST\x20(?\x20IN\x20BOOLEAN\x20MODE)','group','clone','i.id','SUM(me.read\x20=\x200\x20AND\x20me.direction\x20=\x20\x27in\x27)','isEmpty','t.id\x20IN\x20?','resolve','journey','i.ChatWebsiteId\x20IS\x20NOT\x20NULL','user','getChatWebsites','sequelize','toString','count','keyBy','merge','fields','unreadMessages','Account.key','a.mandatoryDisposition','Account.mandatoryDisposition','c.firstName','c.lastName','Contact.lastName','c.email','c.phone','Contact.phone','c.mobile','Contact.mobile','Contact.fax','o.fullname','Owner.fullname','o.internal'];(function(_0x1f64d7,_0x448041){var _0x5e1320=function(_0x1d300f){while(--_0x1d300f){_0x1f64d7['push'](_0x1f64d7['shift']());}};_0x5e1320(++_0x448041);}(_0x741c,0x196));var _0xc741=function(_0x42cae2,_0x284ef8){_0x42cae2=_0x42cae2-0x0;var _0x5f256f=_0x741c[_0x42cae2];return _0x5f256f;};'use strict';var pdf=require(_0xc741('0x0'));var emlformat=require(_0xc741('0x1'));var rimraf=require(_0xc741('0x2'));var zipdir=require(_0xc741('0x3'));var jsonpatch=require(_0xc741('0x4'));var rp=require(_0xc741('0x5'));var moment=require('moment');var BPromise=require('bluebird');var Mustache=require(_0xc741('0x6'));var util=require('util');var path=require(_0xc741('0x7'));var sox=require(_0xc741('0x8'));var csv=require(_0xc741('0x9'));var ejs=require(_0xc741('0xa'));var fs=require('fs');var _=require(_0xc741('0xb'));var squel=require(_0xc741('0xc'));var crypto=require(_0xc741('0xd'));var jsforce=require('jsforce');var deskjs=require(_0xc741('0xe'));var toCsv=require(_0xc741('0x9'));var querystring=require('querystring');var Papa=require(_0xc741('0xf'));var Redis=require('ioredis');var authService=require('../../components/auth/service');var qs=require(_0xc741('0x10'));var as=require(_0xc741('0x11'));var hardwareService=require(_0xc741('0x12'));var logger=require(_0xc741('0x13'))(_0xc741('0x14'));var utils=require(_0xc741('0x15'));var config=require(_0xc741('0x16'));var db=require('../../mysqldb')['db'];config['redis']=_['defaults'](config[_0xc741('0x17')],{'host':_0xc741('0x18'),'port':0x18eb});var socket=require(_0xc741('0x19'))(new Redis(config[_0xc741('0x17')]));require(_0xc741('0x1a'))['register'](socket);var jayson=require(_0xc741('0x1b'));var client=jayson[_0xc741('0x1c')]['http']({'port':0x232b});var client9004=jayson[_0xc741('0x1c')][_0xc741('0x1d')]({'port':0x232c});function checkPasswordPattern(_0xd92df7,_0x450179,_0x21514e){if(_0x21514e){var _0x5bbe86=new RegExp(/(?=.*[a-z])(?=.*[A-Z])(?=.*[0-9])(?=.*[?!@#\$%\^&\*~\-_=+[{\]\}])(?=.{8,})/);if(_0x5bbe86['test'](_0x450179)){return _0xd92df7;}else{throw new db[(_0xc741('0x1e'))]['ValidationError'](_0xc741('0x1f'));}}else{return _0xd92df7;}}function respondWithRpcPromise(_0x3903c6,_0x575184,_0x552ecf,_0xebabc8){return new BPromise(function(_0x477cc2,_0x11a7fa){var _0x498a5f=_0xebabc8||client;return _0x498a5f[_0xc741('0x20')](_0x3903c6,_0x552ecf)[_0xc741('0x21')](function(_0x475348){logger[_0xc741('0x22')](_0xc741('0x23'),_0x575184,_0xc741('0x24'));logger[_0xc741('0x25')](_0xc741('0x26'),_0x575184,_0xc741('0x24'),JSON['stringify'](_0x475348));if(_0x475348[_0xc741('0x27')]){if(_0x475348['error'][_0xc741('0x28')]===0x1f4){logger['error'](_0xc741('0x23'),_0x575184,_0x475348[_0xc741('0x27')][_0xc741('0x29')]);return _0x11a7fa(_0x475348['error'][_0xc741('0x29')]);}logger['error'](_0xc741('0x23'),_0x575184,_0x475348[_0xc741('0x27')][_0xc741('0x29')]);return _0x477cc2(_0x475348['error']['message']);}else{logger['info'](_0xc741('0x23'),_0x575184,_0xc741('0x24'));_0x477cc2(_0x475348[_0xc741('0x2a')][_0xc741('0x29')]);}})[_0xc741('0x2b')](function(_0x5323db){logger['error'](_0xc741('0x23'),_0x575184,_0x5323db);_0x11a7fa(_0x5323db);});});}function respondWithStatusCode(_0x11c65e,_0x102408){_0x102408=_0x102408||0xcc;return function(_0x328793){if(_0x328793){return _0x11c65e[_0xc741('0x2c')](_0x102408);}return _0x11c65e[_0xc741('0x2d')](_0x102408)['end']();};}function respondWithResult(_0x353729,_0x2e960e){_0x2e960e=_0x2e960e||0xc8;return function(_0x4cd23c){if(_0x4cd23c){return _0x353729[_0xc741('0x2d')](_0x2e960e)[_0xc741('0x2e')](_0x4cd23c);}};}function respondWithFilteredResult(_0x1c2bde,_0x1ce361){return function(_0x3b66ae){if(_0x3b66ae){var _0x3bb9b1=_0x3b66ae['count'],_0x3b3703=_0x1ce361[_0xc741('0x2f')],_0xdcffe=_0x1ce361['offset']+_0x1ce361[_0xc741('0x30')],_0x2f43a2;if(_0xdcffe>=_0x3bb9b1){_0xdcffe=_0x3bb9b1;_0x2f43a2=0xc8;}else{_0x2f43a2=0xce;}_0x1c2bde['status'](_0x2f43a2);return _0x1c2bde['set'](_0xc741('0x31'),_0x3b3703+'-'+_0xdcffe+'/'+_0x3bb9b1)[_0xc741('0x2e')](_0x3b66ae);}return null;};}function patchUpdates(_0x37d434){return function(_0x52fa3b){try{jsonpatch[_0xc741('0x32')](_0x52fa3b,_0x37d434,!![]);}catch(_0x33ee5b){return BPromise[_0xc741('0x33')](_0x33ee5b);}return _0x52fa3b['save']();};}function saveUpdates(_0xfd4633,_0x1c1154){return function(_0x308f01){if(_0x308f01){return _0x308f01[_0xc741('0x34')](_0xfd4633)[_0xc741('0x21')](function(_0x44c91a){return _0x44c91a;});}return null;};}function removeEntity(_0x17f932,_0x5d791e){return function(_0x5edc78){if(_0x5edc78){return _0x5edc78[_0xc741('0x35')]()[_0xc741('0x21')](function(){_0x17f932[_0xc741('0x2d')](0xcc)[_0xc741('0x36')]();});}};}function handleEntityNotFound(_0xf7953e,_0x36463a){return function(_0x5f2685){if(!_0x5f2685){_0xf7953e[_0xc741('0x2c')](0x194);}return _0x5f2685;};}function handleError(_0xc3b406,_0x4f2791){_0x4f2791=_0x4f2791||0x1f4;return function(_0x221744){logger[_0xc741('0x27')](_0x221744[_0xc741('0x37')]);if(_0x221744['name']){delete _0x221744[_0xc741('0x38')];}_0xc3b406[_0xc741('0x2d')](_0x4f2791)[_0xc741('0x39')](_0x221744);};}function getInteractionUsers(_0x39e9fb,_0x168934){return new BPromise(function(_0x823009,_0x177db8){try{if(_0x168934[_0x39e9fb['id']]){_0x39e9fb['Users']=_[_0xc741('0x3a')](_0x168934[_0x39e9fb['id']],function(_0xafe7e7){return{'id':_0xafe7e7['id'],'fullname':_0xafe7e7[_0xc741('0x3b')]};});}}catch(_0x1ae74d){_0x177db8(_0x1ae74d);}_0x823009(_0x39e9fb);});}function getInteractionTags(_0x1e4433,_0x76288a){return new BPromise(function(_0x47fa97,_0x207fcc){try{if(_0x1e4433['TagIds']){_0x1e4433[_0xc741('0x3c')]=[];_0x1e4433[_0xc741('0x3d')][_0xc741('0x3e')](',')[_0xc741('0x3f')](function(_0x4e4fc2){_0x1e4433[_0xc741('0x3c')]['push'](_0x76288a[_0x4e4fc2]);});}delete _0x1e4433[_0xc741('0x3d')];}catch(_0x2fe60a){_0x207fcc(_0x2fe60a);}_0x47fa97(_0x1e4433);});}function updateChatInteraction(_0x3de581,_0x56ace1,_0x58ade7){return new BPromise(function(_0x3686b2,_0x251ea4){return getInteractionUsers(_0x3de581,_0x58ade7)[_0xc741('0x21')](function(_0x3f12ea){return getInteractionTags(_0x3f12ea,_0x56ace1);})[_0xc741('0x21')](function(_0x3bc5ac){_0x3686b2(_0x3bc5ac);})[_0xc741('0x2b')](function(_0x324b53){_0x251ea4(_0x324b53);});});}exports[_0xc741('0x40')]=function(_0x2542aa,_0x3d5a7f){var _0x114e0b={},_0x3a6edf={},_0x24e484={'count':0x0,'rows':[]};var _0x339b5f=_[_0xc741('0x3a')](db[_0xc741('0x41')]['rawAttributes'],function(_0x1cc48c){return{'name':_0x1cc48c['fieldName'],'type':_0x1cc48c[_0xc741('0x42')]['key']};});_0x3a6edf[_0xc741('0x43')]=_[_0xc741('0x3a')](_0x339b5f,'name');_0x3a6edf[_0xc741('0x44')]=_[_0xc741('0x45')](_0x2542aa['query']);_0x3a6edf[_0xc741('0x46')]=_[_0xc741('0x47')](_0x3a6edf[_0xc741('0x43')],_0x3a6edf[_0xc741('0x44')]);_0x114e0b[_0xc741('0x48')]=_[_0xc741('0x47')](_0x3a6edf[_0xc741('0x43')],qs['fields'](_0x2542aa[_0xc741('0x44')]['fields']));_0x114e0b['attributes']=_0x114e0b[_0xc741('0x48')]['length']?_0x114e0b[_0xc741('0x48')]:_0x3a6edf[_0xc741('0x43')];if(!_0x2542aa[_0xc741('0x44')][_0xc741('0x49')](_0xc741('0x4a'))){_0x114e0b[_0xc741('0x30')]=qs[_0xc741('0x30')](_0x2542aa[_0xc741('0x44')][_0xc741('0x30')]);_0x114e0b['offset']=qs['offset'](_0x2542aa[_0xc741('0x44')][_0xc741('0x2f')]);}_0x114e0b[_0xc741('0x4b')]=qs[_0xc741('0x4c')](_0x2542aa['query'][_0xc741('0x4c')]);_0x114e0b['where']=qs[_0xc741('0x46')](_[_0xc741('0x4d')](_0x2542aa[_0xc741('0x44')],_0x3a6edf[_0xc741('0x46')]));var _0x2a390b=[];var _0x469b3c=squel[_0xc741('0x4e')]()[_0xc741('0x4f')]('id')[_0xc741('0x4f')](_0xc741('0x38'))[_0xc741('0x4f')](_0xc741('0x50'))['from'](_0xc741('0x51'));var _0xd4a708=squel[_0xc741('0x4e')]()['field'](_0xc741('0x52'))[_0xc741('0x4f')](_0xc741('0x53'))[_0xc741('0x4f')]('ui.ChatInteractionId')[_0xc741('0x54')](_0xc741('0x55'),'ui')[_0xc741('0x56')](_0xc741('0x57'),'u','u.id\x20=\x20ui.UserId');var _0x30816d=squel['select']()[_0xc741('0x54')](_0xc741('0x58'),'i')[_0xc741('0x56')](_0xc741('0x59'),'c',_0xc741('0x5a'))[_0xc741('0x56')]('users','o',_0xc741('0x5b'))['left_join'](_0xc741('0x5c'),'a',_0xc741('0x5d'))[_0xc741('0x56')](_0xc741('0x5e'),'me',_0xc741('0x5f'))['left_join']('chat_interaction_has_tags','it',_0xc741('0x60'))['left_join'](_0xc741('0x51'),'t',_0xc741('0x61'));var _0x1795bb=squel[_0xc741('0x62')]();var _0x1fec29=[];var _0x347d63=squel[_0xc741('0x62')]();var _0x2e754e;if(_0x2542aa[_0xc741('0x44')][_0xc741('0x63')]){_0x2e754e=as[_0xc741('0x64')](_0x2542aa[_0xc741('0x44')]['search']);var _0x4d3c10=_0x2e754e[_0xc741('0x65')];for(var _0x39f700=0x0;_0x39f700<_0x2e754e[_0xc741('0x66')]['length'];_0x39f700++){var _0x53b2db=_0x2e754e[_0xc741('0x66')][_0x39f700];var _0x5a4f5b='i';var _0x394be8=_[_0xc741('0x67')](_0x339b5f,[_0xc741('0x38'),_0x53b2db[_0xc741('0x4f')]]);if(!_0x394be8){switch(_0x53b2db[_0xc741('0x4f')]){case'unreadMessages':if(_0x53b2db['value']==0x1){_0x30816d[_0xc741('0x68')]('`'+_0x53b2db[_0xc741('0x4f')]+'`\x20=\x200');}else{_0x30816d[_0xc741('0x68')]('`'+_0x53b2db[_0xc741('0x4f')]+_0xc741('0x69'));}break;case _0xc741('0x6a'):if(_0x53b2db[_0xc741('0x6b')]==='$substring'){if(_0x53b2db['value'][_0xc741('0x3e')]('\x20')['length']>0x1){_0x1795bb[_0x4d3c10](_0xc741('0x6c'),qs[_0xc741('0x6d')](_0x53b2db['value']),null);}else{var _0x461370='%'+_0x53b2db[_0xc741('0x6e')]+'%';_0x1795bb[_0x4d3c10](_0xc741('0x6f'),_0x461370,_0x461370,_0x461370);}}else{_0x394be8=_[_0xc741('0x67')](_0x339b5f,[_0xc741('0x38'),_0xc741('0x70')]);_0x53b2db[_0xc741('0x4f')]='ContactId';_0x5dc640=as[_0xc741('0x71')](_0x5a4f5b,_0x394be8[_0xc741('0x42')],_0x53b2db);_0x1795bb[_0x4d3c10](_0x5dc640['text'],_0x5dc640[_0xc741('0x6e')][_0xc741('0x72')],_0x5dc640[_0xc741('0x6e')]['end']);}break;case _0xc741('0x73'):var _0x41f727=_0x53b2db['value'][_0xc741('0x3e')](',')[_0xc741('0x3a')](function(_0xfa0e86){return Number(_0xfa0e86);});_0x41f727[_0xc741('0x3f')](function(_0x58a414){_0x347d63['or']('CONCAT(\x27,\x27,\x20`TagIds`,\x20\x27,\x27)\x20LIKE\x20?','%,'+_0x58a414+',%');});_0x1fec29=_[_0xc741('0x74')](_0x1fec29,_0x41f727);break;case'User':if(_0x53b2db[_0xc741('0x6b')]===_0xc741('0x75')){_0x1795bb[_0x4d3c10](_0xc741('0x76'),'%'+_0x53b2db[_0xc741('0x6e')]+'%',null);}else{_0x394be8=_[_0xc741('0x67')](_0x339b5f,[_0xc741('0x38'),'UserId']);_0x53b2db[_0xc741('0x4f')]='UserId';_0x5dc640=as[_0xc741('0x71')](_0x5a4f5b,_0x394be8[_0xc741('0x42')],_0x53b2db);_0x1795bb[_0x4d3c10](_0x5dc640[_0xc741('0x77')],_0x5dc640[_0xc741('0x6e')]['start'],_0x5dc640[_0xc741('0x6e')][_0xc741('0x36')]);}break;case _0xc741('0x78'):_0x5dc640=as[_0xc741('0x71')]('me',null,_0x53b2db);_0x1795bb[_0x4d3c10](_0x5dc640[_0xc741('0x77')],_0x5dc640[_0xc741('0x6e')][_0xc741('0x72')],_0x5dc640[_0xc741('0x6e')][_0xc741('0x36')]);break;}}else{var _0x5dc640=as['buildExpression'](_0x5a4f5b,_0x394be8[_0xc741('0x42')],_0x53b2db);_0x1795bb[_0x4d3c10](_0x5dc640[_0xc741('0x77')],_0x5dc640[_0xc741('0x6e')][_0xc741('0x72')],_0x5dc640['value'][_0xc741('0x36')]);}}}else{var _0x2804f2=_(_0x2542aa[_0xc741('0x44')])[_0xc741('0x45')]()[_0xc741('0x3a')](function(_0x2cc7b0){return _[_0xc741('0x79')](_0x339b5f,[_0xc741('0x38'),_0x2cc7b0])?_0x2cc7b0:undefined;})['compact']()[_0xc741('0x6e')]();if(!_['isEmpty'](_0x2804f2)){_0x2804f2['forEach'](function(_0x2daa59){if(_0x2daa59===_0xc741('0x7a')){_0x30816d['where'](_0xc741('0x7b'),[][_0xc741('0x7c')](_0x2542aa['query'][_0x2daa59]));}else if(_0x2daa59==='createdAt'){var _0x287df3=JSON[_0xc741('0x7d')](_0x2542aa['query'][_0x2daa59])[_0xc741('0x7e')];var _0x1419dd=JSON[_0xc741('0x7d')](_0x2542aa[_0xc741('0x44')][_0x2daa59])[_0xc741('0x7f')];_0x30816d[_0xc741('0x80')](_0xc741('0x81'),_0x287df3,_0x1419dd);}else{if(_0x2542aa[_0xc741('0x44')][_0x2daa59]==='null'){_0x30816d[_0xc741('0x80')]('i.'+_0x2daa59+_0xc741('0x82'));}else{_0x30816d[_0xc741('0x80')]('i.'+_0x2daa59+_0xc741('0x83'),_0x2542aa['query'][_0x2daa59]);}}});}if(_0x2542aa[_0xc741('0x44')][_0xc741('0x84')]){if(_0x2542aa['query'][_0xc741('0x84')]==0x1){_0x30816d[_0xc741('0x68')](_0xc741('0x85'));}else{_0x30816d[_0xc741('0x68')]('`unreadMessages`\x20>\x200');}}if(_0x2542aa['query']['tag']){_0x1fec29=_[_0xc741('0x86')](_0x2542aa[_0xc741('0x44')][_0xc741('0x87')])?_0x2542aa[_0xc741('0x44')]['tag']:new Array(_0x2542aa[_0xc741('0x44')][_0xc741('0x87')]);_0x1fec29['forEach'](function(_0x4f9256){_0x347d63['or'](_0xc741('0x88'),'%,'+_0x4f9256+',%');});}if(_0x2542aa[_0xc741('0x44')][_0xc741('0x89')]){var _0x5d831a=_0x2542aa[_0xc741('0x44')][_0xc741('0x89')][_0xc741('0x8a')]('\x5c','\x5c\x5c')['replace']('\x27\x27','\x27\x27\x27\x27');if(qs['isNumeric'](_0x5d831a)){_0x1795bb['or'](_0xc741('0x8b'),_0x5d831a+'%');}else{_0x1795bb['or'](_0xc741('0x8c'),qs['getFullTextValue'](_0x5d831a))['or']('CONCAT(c.firstName,\x20\x27\x20\x27,\x20c.lastName)\x20LIKE\x20?',_0x5d831a+'%');}}}_0x30816d[_0xc741('0x80')](_0x1795bb);_0x30816d[_0xc741('0x8d')]('i.id');var _0x230c93={'type':db['Sequelize']['QueryTypes']['SELECT'],'raw':!![]};var _0x416df0=_0x30816d[_0xc741('0x8e')]();_0x416df0[_0xc741('0x4f')](_0xc741('0x8f'));_0x416df0['field'](_0xc741('0x90'),'unreadMessages');if(_0x114e0b[_0xc741('0x4b')]){_0x114e0b['order']['forEach'](function(_0x17024b){_0x30816d[_0xc741('0x4b')]('i.'+_0x17024b[0x0],_0x17024b[0x1]==='DESC'?![]:!![]);});}if(!_[_0xc741('0x91')](_0x1fec29)){_0x30816d[_0xc741('0x68')](_0x347d63);_0x416df0[_0xc741('0x80')](_0xc741('0x92'),_0x1fec29);}BPromise[_0xc741('0x93')]()[_0xc741('0x21')](function(){if(!_0x2e754e){if(_0x2542aa['query'][_0xc741('0x7a')]||_0x2542aa[_0xc741('0x44')][_0xc741('0x94')])return;_0x416df0[_0xc741('0x80')](_0xc741('0x95'));_0x30816d[_0xc741('0x80')](_0xc741('0x95'));return;}return _0x2542aa[_0xc741('0x96')][_0xc741('0x97')]({'attributes':['id'],'raw':!![]})[_0xc741('0x21')](function(_0x39d72a){if(_[_0xc741('0x91')](_0x39d72a)){_0x416df0['where']('i.ChatWebsiteId\x20IS\x20NULL');_0x30816d['where']('i.ChatWebsiteId\x20IS\x20NULL');}else{_0x416df0[_0xc741('0x80')](_0xc741('0x7b'),_[_0xc741('0x3a')](_0x39d72a,'id'));_0x30816d[_0xc741('0x80')](_0xc741('0x7b'),_[_0xc741('0x3a')](_0x39d72a,'id'));}});})[_0xc741('0x21')](function(){db[_0xc741('0x98')][_0xc741('0x44')](_0x416df0[_0xc741('0x99')](),_0x230c93)[_0xc741('0x21')](function(_0x367576){_0x24e484[_0xc741('0x9a')]=_0x367576['length'];if(_0x24e484[_0xc741('0x9a')]===0x0)return[];return db[_0xc741('0x98')][_0xc741('0x44')](_0x469b3c[_0xc741('0x99')](),_0x230c93)[_0xc741('0x21')](function(_0x2458af){_0x2a390b=_[_0xc741('0x9b')](_0x2458af,'id');_0x230c93=_[_0xc741('0x9c')](_0x230c93,{'model':db[_0xc741('0x41')],'mapToModel':!![],'raw':!![],'nest':!![]});if(_0x2542aa[_0xc741('0x44')][_0xc741('0x9d')]){_0x114e0b[_0xc741('0x48')]['forEach'](function(_0x3d755c){_0x30816d[_0xc741('0x4f')]('i.'+_0x3d755c);});}else{_0x30816d[_0xc741('0x4f')]('SUM(me.read\x20=\x200\x20AND\x20me.direction\x20=\x20\x27in\x27)',_0xc741('0x9e'));_0x30816d[_0xc741('0x4f')]('a.key',_0xc741('0x9f'));_0x30816d['field'](_0xc741('0xa0'),_0xc741('0xa1'));_0x30816d[_0xc741('0x4f')]('i.*');_0x30816d[_0xc741('0x4f')](_0xc741('0xa2'),'Contact.firstName');_0x30816d['field'](_0xc741('0xa3'),_0xc741('0xa4'));_0x30816d[_0xc741('0x4f')](_0xc741('0xa5'),'Contact.email');_0x30816d[_0xc741('0x4f')](_0xc741('0xa6'),_0xc741('0xa7'));_0x30816d[_0xc741('0x4f')](_0xc741('0xa8'),_0xc741('0xa9'));_0x30816d[_0xc741('0x4f')]('c.fax',_0xc741('0xaa'));_0x30816d[_0xc741('0x4f')](_0xc741('0xab'),_0xc741('0xac'));_0x30816d[_0xc741('0x4f')](_0xc741('0xad'),'Owner.internal');_0x30816d[_0xc741('0x4f')](_0xc741('0xae'),'TagIds');}_0x30816d['limit'](_0x114e0b[_0xc741('0x30')]);_0x30816d[_0xc741('0x2f')](_0x114e0b['offset']);return db[_0xc741('0x98')][_0xc741('0x44')](_0x30816d[_0xc741('0x99')](),_0x230c93);})[_0xc741('0x21')](function(_0x2d632d){_0xd4a708[_0xc741('0x80')](_0xc741('0xaf'),_[_0xc741('0x3a')](_0x2d632d,'id'));return db[_0xc741('0x98')][_0xc741('0x44')](_0xd4a708[_0xc741('0x99')](),_0x230c93)['then'](function(_0x59889b){var _0x2274fb=_[_0xc741('0xb0')](_0x59889b,_0xc741('0xb1'));var _0x54afc8=[];_0x2d632d[_0xc741('0x3f')](function(_0x5b75a6){_0x54afc8[_0xc741('0xb2')](updateChatInteraction(_0x5b75a6,_0x2a390b,_0x2274fb));});return BPromise[_0xc741('0xb3')](_0x54afc8);});});})['then'](function(_0x5ad6a4){_0x24e484[_0xc741('0xb4')]=_0x5ad6a4;return _0x24e484;})['then'](respondWithFilteredResult(_0x3d5a7f,_0x114e0b));})[_0xc741('0x2b')](handleError(_0x3d5a7f,null));};exports[_0xc741('0xb5')]=function(_0x20cb85,_0x40c624){var _0x2fbebe={'raw':![],'where':{'id':_0x20cb85[_0xc741('0xb6')]['id']}},_0x203023={};_0x203023[_0xc741('0x43')]=_['keys'](db[_0xc741('0x41')]['rawAttributes']);_0x203023[_0xc741('0x44')]=_[_0xc741('0x45')](_0x20cb85[_0xc741('0x44')]);_0x203023[_0xc741('0x46')]=_[_0xc741('0x47')](_0x203023[_0xc741('0x43')],_0x203023[_0xc741('0x44')]);_0x2fbebe[_0xc741('0x48')]=_[_0xc741('0x47')](_0x203023['model'],qs[_0xc741('0x9d')](_0x20cb85[_0xc741('0x44')][_0xc741('0x9d')]));_0x2fbebe['attributes']=_0x2fbebe[_0xc741('0x48')][_0xc741('0xb7')]?_0x2fbebe['attributes']:_0x203023[_0xc741('0x43')];if(_0x20cb85['query'][_0xc741('0xb8')]){_0x2fbebe['include']=[{'all':!![]}];}_0x2fbebe=_[_0xc741('0x9c')]({},_0x2fbebe,_0x20cb85[_0xc741('0xb9')]);return db[_0xc741('0x41')][_0xc741('0x67')](_0x2fbebe)[_0xc741('0x21')](handleEntityNotFound(_0x40c624,null))['then'](respondWithResult(_0x40c624,null))[_0xc741('0x2b')](handleError(_0x40c624,null));};exports[_0xc741('0xba')]=function(_0x15cc07,_0xccf6ae){return db['ChatInteraction'][_0xc741('0xba')](_0x15cc07[_0xc741('0x78')],{})[_0xc741('0x21')](respondWithResult(_0xccf6ae,0xc9))[_0xc741('0x2b')](handleError(_0xccf6ae,null));};exports[_0xc741('0x34')]=function(_0xc47d06,_0xe543e6){if(_0xc47d06[_0xc741('0x78')]['id']){delete _0xc47d06['body']['id'];}return db[_0xc741('0x41')][_0xc741('0x67')]({'where':{'id':_0xc47d06[_0xc741('0xb6')]['id']}})['then'](handleEntityNotFound(_0xe543e6,null))[_0xc741('0x21')](saveUpdates(_0xc47d06[_0xc741('0x78')],null))[_0xc741('0x21')](respondWithResult(_0xe543e6,null))[_0xc741('0x2b')](handleError(_0xe543e6,null));};exports[_0xc741('0x35')]=function(_0x5be24d,_0x1bfa84){return db[_0xc741('0x41')][_0xc741('0x67')]({'where':{'id':_0x5be24d[_0xc741('0xb6')]['id']}})[_0xc741('0x21')](handleEntityNotFound(_0x1bfa84,null))[_0xc741('0x21')](removeEntity(_0x1bfa84,null))[_0xc741('0x2b')](handleError(_0x1bfa84,null));};exports[_0xc741('0xbb')]=function(_0x282119,_0x2cf80f){return db['ChatInteraction'][_0xc741('0xbb')]()[_0xc741('0x21')](respondWithResult(_0x2cf80f,null))[_0xc741('0x2b')](handleError(_0x2cf80f,null));};exports['customUpdate']=function(_0x17b652,_0x20666f){if(_0x17b652['body']['id']){delete _0x17b652[_0xc741('0x78')]['id'];}return db['ChatInteraction']['find']({'where':{'id':_0x17b652[_0xc741('0xb6')]['id']}})['then'](handleEntityNotFound(_0x20666f,null))['then'](saveUpdates(_0x17b652[_0xc741('0x78')],null))[_0xc741('0x21')](respondWithResult(_0x20666f,null))[_0xc741('0x2b')](handleError(_0x20666f,null));};exports[_0xc741('0xbc')]=function(_0x1ae9e4,_0x2a7b75,_0x34d047){if(_0x1ae9e4[_0xc741('0x78')]['id']){delete _0x1ae9e4[_0xc741('0x78')]['id'];}return db[_0xc741('0x41')]['find']({'where':{'id':_0x1ae9e4['params']['id']}})[_0xc741('0x21')](function(_0x2595f1){if(!_0x2595f1){logger[_0xc741('0x27')](_0xc741('0xbd'),'abandon',0x194,_0xc741('0xbe'));_0x2a7b75[_0xc741('0x2c')](0x194);}else{if(_0x2595f1['UserId']){throw new db[(_0xc741('0x1e'))][(_0xc741('0xbf'))](_0xc741('0xc0'));}}return _0x2595f1;})['then'](function(_0xb5ca6d){if(_0xb5ca6d){return _0xb5ca6d[_0xc741('0x34')]({'closed':_0x1ae9e4['body'][_0xc741('0xc1')],'disposition':_0x1ae9e4[_0xc741('0x78')][_0xc741('0xc2')]})[_0xc741('0x21')](function(_0x704712){return _0x704712;});}})['then'](function(_0x3fea06){return respondWithRpcPromise('AbandonInteraction',_0xc741('0xbc'),_0x1ae9e4[_0xc741('0x78')],client9004);})[_0xc741('0x21')](respondWithResult(_0x2a7b75,null))['catch'](handleError(_0x2a7b75,null));};exports[_0xc741('0xc3')]=function(_0xb55927,_0x4b32f8,_0x25f9f7){_0xb55927[_0xc741('0x78')][_0xc741('0x38')]=_0xb55927[_0xc741('0xc4')][_0xc741('0xc5')];_0xb55927[_0xc741('0x78')]['basename']=_0xb55927[_0xc741('0xc4')][_0xc741('0xc6')];_0xb55927[_0xc741('0x78')]['type']=_0xb55927[_0xc741('0xc4')][_0xc741('0xc7')];return db[_0xc741('0xc8')][_0xc741('0xba')](_0xb55927['body'])[_0xc741('0x21')](respondWithResult(_0x4b32f8,0xc9))[_0xc741('0x2b')](handleError(_0x4b32f8,null));};exports[_0xc741('0xc9')]=function(_0x2403dc,_0x4c6268,_0x1c4979){return db[_0xc741('0x41')][_0xc741('0xca')]({'where':{'id':_0x2403dc['params']['id']},'raw':!![]})['then'](handleEntityNotFound(_0x4c6268,null))[_0xc741('0x21')](function(_0x109f99){if(_0x109f99){if(_0x109f99[_0xc741('0xc1')]){return _0x4c6268['status'](0x193)['json']({'status':0x193,'message':_0xc741('0xcb')});}return db[_0xc741('0xc8')][_0xc741('0xca')]({'where':{'id':_0x2403dc[_0xc741('0x44')]['attachId']},'raw':!![]})['then'](handleEntityNotFound(_0x4c6268,null));}})['then'](function(_0x36de0a){if(_0x36de0a){return _0x4c6268[_0xc741('0xcc')](path[_0xc741('0xcd')](config['root'],_0xc741('0xce'),_0x36de0a['basename']));}})['catch'](handleError(_0x4c6268,null));};exports[_0xc741('0xcf')]=function(_0x22abf1,_0x4ccb4b){var _0x24ca24=null;var _0x148265=null;var _0x34a92f=null;var _0x38721f=null;if(_0x22abf1['body']['id']){delete _0x22abf1[_0xc741('0x78')]['id'];}if(_0x22abf1['body'][_0xc741('0xd0')]){_0x38721f=path[_0xc741('0xcd')](config[_0xc741('0xd1')],'server/files/chat/upload/',util[_0xc741('0xd2')](_0xc741('0xd3'),Date[_0xc741('0xd4')]()));_0x22abf1[_0xc741('0x78')][_0xc741('0xd5')]=_0x38721f;}return db['ChatInteraction'][_0xc741('0x67')]({'where':{'id':_0x22abf1[_0xc741('0xb6')]['id']},'include':[{'model':db[_0xc741('0xd6')],'as':_0xc741('0xd7'),'include':[{'model':db['User'],'as':_0xc741('0xd8')}]}]})['then'](handleEntityNotFound(_0x4ccb4b,null))[_0xc741('0x21')](saveUpdates(_0x22abf1['body'],null))[_0xc741('0x21')](function(_0x1e1eb2){if(_0x1e1eb2){_0x24ca24=_0x1e1eb2;return db['ChatWebsite']['find']({'where':{'id':_0x24ca24[_0xc741('0x7a')]}});}})['then'](function(_0x19cd6d){if(_0x19cd6d){_0x34a92f=_0x19cd6d;return db[_0xc741('0xd9')][_0xc741('0x67')]({'where':{'id':_0x24ca24[_0xc741('0x70')]}});}})[_0xc741('0x21')](function(_0x1f0768){if(_0x1f0768){_0x148265=_0x1f0768;if(_0x38721f){var _0xf24942=null;for(var _0x3017e4=0x1;_0x3017e4<_0x24ca24[_0xc741('0xd7')][_0xc741('0xb7')];++_0x3017e4){_0xf24942=_0x24ca24['Messages'][_0x3017e4];var _0x5adc88=_0xf24942['UserId']?util[_0xc741('0xd2')](_0xc741('0xda'),_0x34a92f[_0xc741('0xdb')],_0xf24942[_0xc741('0xdc')]):_0xc741('0xdd');var _0x429a52=_0x22abf1[_0xc741('0x78')]['customer']||util['format'](_0xc741('0xda'),_0xc741('0xde'),_0xf24942[_0xc741('0x70')]);switch(_0x34a92f[_0xc741('0xdf')]){case'website_alias':_0x5adc88=_0xf24942[_0xc741('0xdc')]?util[_0xc741('0xd2')](_0xc741('0xda'),_0x34a92f[_0xc741('0xdb')],_0xf24942[_0xc741('0xdc')]):_0xc741('0xdd');break;case'agent_alias':_0x5adc88=_0xf24942[_0xc741('0xdc')]?_0xf24942['User']['alias']||_0xf24942[_0xc741('0xd8')][_0xc741('0x3b')]:'System';break;case _0xc741('0xe0'):_0x5adc88=_0xf24942['UserId']?_0xf24942['User'][_0xc741('0x3b')]:_0xc741('0xdd');break;default:_0x5adc88=_0xf24942[_0xc741('0xdc')]?util[_0xc741('0xd2')](_0xc741('0xda'),_0x34a92f[_0xc741('0xdb')],_0xf24942[_0xc741('0xdc')]):'System';}var _0x36700d=util[_0xc741('0xd2')](_0xc741('0xe1'),moment(_0xf24942[_0xc741('0xe2')])[_0xc741('0xd2')]('MM/DD/YYYY\x20HH:mm:ss'),_0xf24942[_0xc741('0xe3')]==='in'?_0x429a52:_0x5adc88,_0xf24942['body']);if(!_0xf24942[_0xc741('0xe4')]){fs['appendFileSync'](_0x38721f,_0x36700d);}}return db['MailAccount'][_0xc741('0xca')]({'where':{'service':!![]},'include':[{'model':db[_0xc741('0xe5')],'as':_0xc741('0xe6'),'raw':!![]}]});}}})[_0xc741('0x21')](function(_0x2e0d29){if(_0x2e0d29&&_0x2e0d29[_0xc741('0xe6')]&&_0x22abf1[_0xc741('0x78')]){var _0x35fb70={'tls':{'rejectUnauthorized':![]}};if(_0x2e0d29[_0xc741('0xe6')][_0xc741('0xe7')]){_0x35fb70['service']=_0x2e0d29[_0xc741('0xe6')]['service'];}else{_0x35fb70[_0xc741('0xe8')]=_0x2e0d29[_0xc741('0xe6')][_0xc741('0xe8')];_0x35fb70[_0xc741('0xe9')]=_0x2e0d29[_0xc741('0xe6')][_0xc741('0xe9')];_0x35fb70[_0xc741('0xea')]=_0x2e0d29[_0xc741('0xe6')][_0xc741('0xea')];}if(_0x2e0d29[_0xc741('0xe6')][_0xc741('0xeb')]){_0x35fb70[_0xc741('0xec')]={'user':_0x2e0d29['Smtp']['user'],'pass':_0x2e0d29['Smtp'][_0xc741('0xed')]};}return respondWithRpcPromise('SendMail',_0xc741('0xee'),{'account':_0x35fb70,'message':{'from':util[_0xc741('0xd2')](_0xc741('0xef'),_0x2e0d29[_0xc741('0x38')],_0x2e0d29[_0xc741('0xf0')]||_0x2e0d29[_0xc741('0xe6')]['user']),'to':_0x22abf1[_0xc741('0x78')][_0xc741('0xd0')],'subject':'Mail\x20Transcript','text':util[_0xc741('0xd2')](_0xc741('0xf1'),_0x22abf1[_0xc741('0x78')][_0xc741('0xd0')]),'attachments':[{'path':_0x38721f}]}})['then'](function(){return _0x24ca24;})[_0xc741('0x2b')](function(_0x39ea22){console[_0xc741('0x27')](_0x39ea22);});}else{return _0x24ca24;}})[_0xc741('0x21')](respondWithStatusCode(_0x4ccb4b,0xc8))[_0xc741('0x2b')](handleError(_0x4ccb4b,null));};exports['addMessage']=function(_0x4e6231,_0x3126aa,_0x209989){return db[_0xc741('0xd6')][_0xc741('0x67')]({'where':{'id':_0x4e6231[_0xc741('0xb6')]['id']}})['then'](handleEntityNotFound(_0x3126aa,null))[_0xc741('0x21')](function(_0x440014){if(_0x440014){return _0x440014[_0xc741('0xf2')](_0x4e6231['body']['ids'],_['omit'](_0x4e6231[_0xc741('0x78')],['ids','id'])||{});}})[_0xc741('0x21')](respondWithResult(_0x3126aa,null))[_0xc741('0x2b')](handleError(_0x3126aa,null));};exports[_0xc741('0xf3')]=function(_0x3300f5,_0x3827b9,_0x543bad){var _0x4da913={'raw':![],'where':{}};var _0x18783d={};var _0x5a19dd={'count':0x0,'rows':[]};return db[_0xc741('0x41')][_0xc741('0xca')]({'where':{'id':_0x3300f5['params']['id']}})[_0xc741('0x21')](handleEntityNotFound(_0x3827b9,null))[_0xc741('0x21')](function(_0x1e9cef){if(_0x1e9cef){_0x18783d[_0xc741('0x43')]=_[_0xc741('0x45')](db[_0xc741('0xd6')]['rawAttributes']);_0x18783d[_0xc741('0x44')]=_['keys'](_0x3300f5[_0xc741('0x44')]);_0x18783d['filters']=_[_0xc741('0x47')](_0x18783d['model'],_0x18783d[_0xc741('0x44')]);_0x4da913[_0xc741('0x48')]=_[_0xc741('0x47')](_0x18783d[_0xc741('0x43')],qs[_0xc741('0x9d')](_0x3300f5['query'][_0xc741('0x9d')]));_0x4da913[_0xc741('0x48')]=_0x4da913[_0xc741('0x48')]['length']?_0x4da913[_0xc741('0x48')]:_0x18783d[_0xc741('0x43')];if(!_0x3300f5[_0xc741('0x44')][_0xc741('0x49')](_0xc741('0x4a'))){_0x4da913['limit']=qs[_0xc741('0x30')](_0x3300f5[_0xc741('0x44')][_0xc741('0x30')]);_0x4da913[_0xc741('0x2f')]=qs[_0xc741('0x2f')](_0x3300f5['query'][_0xc741('0x2f')]);}_0x4da913['order']=qs[_0xc741('0x4c')](_0x3300f5[_0xc741('0x44')][_0xc741('0x4c')]);_0x4da913[_0xc741('0x80')]=qs['filters'](_['pick'](_0x3300f5['query'],_0x18783d[_0xc741('0x46')]));_0x4da913[_0xc741('0x80')]['ChatInteractionId']=_0x1e9cef['id'];if(_0x3300f5[_0xc741('0x44')][_0xc741('0x89')]){_0x4da913['where']=_['merge'](_0x4da913[_0xc741('0x80')],{'$or':_[_0xc741('0x3a')](_0x4da913[_0xc741('0x48')],function(_0x175436){var _0x347b3={};_0x347b3[_0x175436]={'$like':'%'+_0x3300f5[_0xc741('0x44')][_0xc741('0x89')]+'%'};return _0x347b3;})});}if(_0x3300f5['query'][_0xc741('0x7e')]){var _0x35eae9=_0x3300f5[_0xc741('0x44')][_0xc741('0x7e')]['split'](',');var _0x1c008b={};_0x1c008b[_0x35eae9[0x0]]={'$gte':moment(_0x35eae9[0x1])['format'](_0xc741('0xf4'))};_0x4da913[_0xc741('0x80')]=_[_0xc741('0x9c')](_0x4da913[_0xc741('0x80')],_0x1c008b);}_0x4da913=_[_0xc741('0x9c')]({},_0x4da913,_0x3300f5[_0xc741('0xb9')]);return db['ChatMessage'][_0xc741('0x9a')]({'where':_0x4da913['where']})[_0xc741('0x21')](function(_0x5dccb2){_0x5a19dd[_0xc741('0x9a')]=_0x5dccb2;if(_0x3300f5[_0xc741('0x44')][_0xc741('0xb8')]){_0x4da913[_0xc741('0xf5')]=[{'all':!![]}];}return db[_0xc741('0xd6')][_0xc741('0xf6')](_0x4da913);})[_0xc741('0x21')](function(_0x5b43c0){_0x5a19dd['rows']=_0x5b43c0;return _0x5a19dd;});}})['then'](respondWithFilteredResult(_0x3827b9,_0x4da913))[_0xc741('0x2b')](handleError(_0x3827b9,null));};exports[_0xc741('0xf7')]=function(_0x3abf8d,_0x34cd5c,_0x51c9fc){var _0x13382b={'where':{}},_0x2ec724={},_0x4bc845={'count':0x0,'rows':[]};return db[_0xc741('0x41')][_0xc741('0xca')]({'where':{'id':_0x3abf8d[_0xc741('0xb6')]['id']}})['then'](handleEntityNotFound(_0x34cd5c,null))[_0xc741('0x21')](function(_0x15333b){if(_0x15333b){_0x2ec724[_0xc741('0x43')]=_[_0xc741('0x45')](db[_0xc741('0xd6')]['rawAttributes']);_0x2ec724[_0xc741('0x44')]=_['keys'](_0x3abf8d['query']);_0x2ec724['filters']=_[_0xc741('0x47')](_0x2ec724[_0xc741('0x43')],_0x2ec724['query']);_0x13382b['attributes']=_[_0xc741('0x47')](_0x2ec724[_0xc741('0x43')],qs['fields'](_0x3abf8d[_0xc741('0x44')][_0xc741('0x9d')]));_0x13382b[_0xc741('0x48')]=_0x13382b[_0xc741('0x48')][_0xc741('0xb7')]?_0x13382b[_0xc741('0x48')]:_0x2ec724[_0xc741('0x43')];if(!_0x3abf8d['query'][_0xc741('0x49')](_0xc741('0x4a'))){_0x13382b[_0xc741('0x30')]=qs[_0xc741('0x30')](_0x3abf8d[_0xc741('0x44')]['limit']);_0x13382b['offset']=qs[_0xc741('0x2f')](_0x3abf8d[_0xc741('0x44')][_0xc741('0x2f')]);}_0x13382b[_0xc741('0x4b')]=qs[_0xc741('0x4c')](_0x3abf8d['query'][_0xc741('0x4c')]);_0x13382b['where']=qs[_0xc741('0x46')](_[_0xc741('0x4d')](_0x3abf8d[_0xc741('0x44')],_0x2ec724[_0xc741('0x46')]));_0x13382b[_0xc741('0x80')][_0xc741('0xb1')]=_0x15333b['id'];if(_0x3abf8d[_0xc741('0x44')][_0xc741('0x89')]){_0x13382b[_0xc741('0x80')]=_[_0xc741('0x9c')](_0x13382b[_0xc741('0x80')],{'$or':_[_0xc741('0x3a')](_0x13382b[_0xc741('0x48')],function(_0x1ded6c){var _0x467aa8={};_0x467aa8[_0x1ded6c]={'$like':'%'+_0x3abf8d[_0xc741('0x44')][_0xc741('0x89')]+'%'};return _0x467aa8;})});}_0x13382b['where']['secret']=![];if(_0x3abf8d[_0xc741('0x44')]['id']){_0x13382b[_0xc741('0x80')]['id']={'$gt':_0x3abf8d[_0xc741('0x44')]['id']};}_0x13382b=_[_0xc741('0x9c')]({},_0x13382b,_0x3abf8d[_0xc741('0xb9')]);return db['ChatMessage'][_0xc741('0x9a')]({'where':_0x13382b['where']})[_0xc741('0x21')](function(_0x4a1bd8){_0x4bc845[_0xc741('0x9a')]=_0x4a1bd8;_0x13382b['include']=[];if(_0x3abf8d[_0xc741('0x44')][_0xc741('0xf8')]){_0x13382b['include'][_0xc741('0xb2')]({'model':db[_0xc741('0xd8')],'as':_0xc741('0xd8'),'attributes':['id',_0xc741('0x3b'),_0xc741('0xf9')]});}if(_0x3abf8d['query'][_0xc741('0xb8')]){_0x13382b[_0xc741('0xf5')]=[{'all':!![]}];}return db[_0xc741('0xd6')][_0xc741('0xf6')](_0x13382b);})[_0xc741('0x21')](function(_0x195e85){_0x4bc845['rows']=_0x195e85;return _0x4bc845;});}})[_0xc741('0x21')](respondWithFilteredResult(_0x34cd5c,_0x13382b))[_0xc741('0x2b')](handleError(_0x34cd5c,null));};exports['addTags']=function(_0x536cb5,_0xe18d8,_0x338cf2){return db[_0xc741('0x41')]['find']({'where':{'id':_0x536cb5[_0xc741('0xb6')]['id']}})[_0xc741('0x21')](handleEntityNotFound(_0xe18d8,null))[_0xc741('0x21')](function(_0x15be51){if(_0x15be51){return _0x15be51[_0xc741('0xfa')](_0x536cb5[_0xc741('0x78')][_0xc741('0xfb')],_[_0xc741('0xfc')](_0x536cb5[_0xc741('0x78')],['ids','id'])||{})[_0xc741('0xfd')](function(){return db[_0xc741('0x73')][_0xc741('0xf6')]({'attributes':['id',_0xc741('0x38'),_0xc741('0x50')],'where':{'id':_0x536cb5[_0xc741('0x78')]['ids']}});})[_0xc741('0x21')](function(_0x31f5ce){socket[_0xc741('0xfe')](_0xc741('0xff'),{'id':Number(_0x536cb5['params']['id']),'tags':_0x31f5ce||[]});return{'id':Number(_0x536cb5[_0xc741('0xb6')]['id']),'tags':_0x31f5ce||[]};});}})['then'](respondWithResult(_0xe18d8,null))[_0xc741('0x2b')](handleError(_0xe18d8,null));};exports[_0xc741('0x100')]=function(_0x1948f0,_0x428423,_0x4309f7){return db[_0xc741('0x41')][_0xc741('0x67')]({'where':{'id':_0x1948f0['params']['id']}})['then'](handleEntityNotFound(_0x428423,null))[_0xc741('0x21')](function(_0x567410){if(_0x567410){return _0x567410['removeTags'](_0x1948f0[_0xc741('0x44')][_0xc741('0xfb')]);}})[_0xc741('0x21')](respondWithStatusCode(_0x428423,null))[_0xc741('0x2b')](handleError(_0x428423,null));};exports[_0xc741('0xcc')]=function(_0x88aefc,_0x11f575){var _0x1f6fef=moment()['unix']()['toString']();var _0x23e8d=path['join'](config['root'],_0xc741('0x101'),_0xc741('0x102'),_0xc741('0x103'));var _0x3c3f9d=path[_0xc741('0xcd')](config[_0xc741('0xd1')],_0xc741('0x101'),_0xc741('0x102'),_0xc741('0x104'));var _0x5440d4=path[_0xc741('0xcd')](_0x23e8d,_0x1f6fef);var _0x492d9d=util[_0xc741('0xd2')](_0xc741('0x105'),_0x88aefc['params']['id'],_0x1f6fef);var _0x86e568=path['join'](_0x23e8d,_0x492d9d);var _0x149207=[];_0x149207[_0xc741('0xb2')]({'model':db[_0xc741('0xd8')],'as':_0xc741('0xd8'),'attributes':['id','fullname'],'raw':!![]});_0x149207[_0xc741('0xb2')]({'model':db[_0xc741('0xd9')],'as':_0xc741('0x6a'),'attributes':['id',_0xc741('0x106'),_0xc741('0x107')],'raw':!![]});if(_0x88aefc[_0xc741('0x44')][_0xc741('0x104')]){_0x149207[_0xc741('0xb2')]({'model':db[_0xc741('0xc8')],'as':_0xc741('0xc8'),'raw':!![]});}var _0x162777=[{'model':db[_0xc741('0xd6')],'as':'Messages','attributes':['id',_0xc741('0x78'),_0xc741('0xe2'),_0xc741('0xe3'),_0xc741('0xe4'),'read'],'include':_0x149207}];_0x162777['push']({'model':db[_0xc741('0x108')],'as':_0xc741('0x109'),'attributes':['id',_0xc741('0x38')]});_0x162777['push']({'model':db['User'],'as':'Owner','attributes':['id','fullname']});return db[_0xc741('0x41')][_0xc741('0x67')]({'where':{'id':_0x88aefc[_0xc741('0xb6')]['id']},'include':_0x162777})[_0xc741('0x21')](handleEntityNotFound(_0x11f575,null))['then'](function(_0x18985e){if(_0x18985e){var _0x394c7c=_0x18985e['get']({'plain':!![]});fs[_0xc741('0x10a')](_0x5440d4);var _0x480a58={'format':'A4','border':'10px','header':{'height':_0xc741('0x10b'),'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[_0xc741('0xd2')](_0xc741('0x10c'),util['format'](_0xc741('0x10d'),'Chat',_0x394c7c['id']),moment()[_0xc741('0xd2')](_0xc741('0x10e'))[_0xc741('0x99')]())}}};var _0x3f3619={'channel':'Chat','account':_0x394c7c['Account'][_0xc741('0x38')],'agent':_0x394c7c['Owner']?_0x394c7c[_0xc741('0x10f')][_0xc741('0x3b')]:_0xc741('0x110'),'createdAt':moment(_0x394c7c[_0xc741('0xe2')])[_0xc741('0xd2')]('YYYY-MM-DD\x20HH:mm:ss')[_0xc741('0x99')](),'closedAt':_0x394c7c[_0xc741('0xc1')]?moment(_0x394c7c['closedAt'])['format']('YYYY-MM-DD\x20HH:mm:ss')[_0xc741('0x99')]():'','disposition':_0x394c7c[_0xc741('0xc2')],'chatInfo':{'browser':_0x394c7c['browserName'],'os':_0x394c7c['osName'],'referer':_0x394c7c[_0xc741('0x111')],'customerIp':_0x394c7c['customerIp'],'customerPort':_0x394c7c[_0xc741('0x112')]?_0x394c7c[_0xc741('0x112')]:_0xc741('0x110')},'messages':_(_0x394c7c[_0xc741('0xd7')])[_0xc741('0x113')]()[_0xc741('0x89')]({'secret':![]})[_0xc741('0x3a')](function(_0xe1f34){if(_0xe1f34[_0xc741('0xc8')]){var _0x14caa4=path['join'](_0x3c3f9d,_0xe1f34[_0xc741('0xc8')][_0xc741('0x114')]);if(fs[_0xc741('0x115')](_0x14caa4)){fs[_0xc741('0x116')](_0x14caa4)[_0xc741('0x117')](fs[_0xc741('0x118')](path[_0xc741('0xcd')](_0x5440d4,_0xe1f34['Attachment'][_0xc741('0x114')])));}}return{'date':moment(_0xe1f34[_0xc741('0xe2')])['format'](_0xc741('0xf4'))[_0xc741('0x99')](),'sender':_0xe1f34[_0xc741('0xe3')]===_0xc741('0x119')?_0xe1f34[_0xc741('0xd8')]?_0xe1f34[_0xc741('0xd8')][_0xc741('0x3b')]:_0xc741('0xdd'):_0xe1f34['Contact'][_0xc741('0x106')]+(_0xe1f34[_0xc741('0x6a')][_0xc741('0x107')]?'\x20'+_0xe1f34[_0xc741('0x6a')][_0xc741('0x107')]:''),'body':_0xe1f34[_0xc741('0xc8')]?_0xe1f34[_0xc741('0xc8')][_0xc741('0x114')]:_0xe1f34[_0xc741('0x78')],'direction':_0xe1f34['direction']===_0xc741('0x119')?'A':'C','secret':_0xe1f34[_0xc741('0xe4')],'read':_0xe1f34[_0xc741('0x84')],'attachment':_0xe1f34[_0xc741('0xc8')]};})[_0xc741('0x6e')]()};return ejs[_0xc741('0x11a')](path[_0xc741('0xcd')](config['root'],_0xc741('0x101'),_0xc741('0x11b'),_0xc741('0x11c')),{'interaction':_0x3f3619})['then'](function(_0x38a180){return new BPromise(function(_0x480f31,_0x2572f1){pdf[_0xc741('0xba')](_0x38a180,_0x480a58)[_0xc741('0x11d')](path['join'](_0x5440d4,_0xc741('0x11e')+_0x394c7c['id']+'-'+_0x1f6fef+_0xc741('0x11f')),function(_0x1b88b7,_0x20734f){if(_0x1b88b7)return _0x2572f1(_0x1b88b7);_0x480f31(_0x20734f);});});})['then'](function(){return new BPromise(function(_0x45bd1e,_0x392774){zipdir(_0x5440d4,{'saveTo':_0x86e568},function(_0x4aeaf8,_0x2613ae){if(_0x4aeaf8)return _0x392774(_0x4aeaf8);return _0x45bd1e(_0x2613ae);});})[_0xc741('0x21')](function(){return new BPromise(function(_0x599312,_0x4076ad){rimraf(_0x5440d4,function(_0x33c1cd){if(_0x33c1cd)_0x4076ad(_0x33c1cd);return _0x599312();});});})[_0xc741('0x21')](function(){return _0x11f575[_0xc741('0xcc')](_0x86e568,_0x492d9d,function(_0x286676){if(_0x286676){console[_0xc741('0x120')]('err',_0x286676);}else{fs[_0xc741('0x121')](_0x86e568);}});});});}else{return _0x11f575[_0xc741('0x2c')](0xc8);}})['catch'](handleError(_0x11f575,null));};
\ No newline at end of file
+var _0x2bd8=['files','tmp','attachments','transcript-%d-%s.zip','firstName','lastName','direction','Account','Owner','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','N.A.','closedAt','disposition','browserName','osName','tail','existsSync','createReadStream','createWriteStream','out','secret','renderFile','toFile','err','unlinkSync','html-pdf','rimraf','zip-dir','fast-json-patch','request-promise','moment','bluebird','mustache','path','sox','to-csv','lodash','squel','crypto','jsforce','../../components/auth/service','../../config/license/hardware','../../config/utils','../../config/environment','redis','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~!@#$%^&-_=+[{]}.','info','ChatInteraction,\x20%s,\x20%s','request\x20sent','debug','ChatInteraction,\x20%s,\x20%s,\x20%s','stringify','error','code','message','result','catch','sendStatus','status','end','count','offset','limit','Content-Range','json','apply','save','update','then','destroy','name','Users','TagIds','Tags','split','forEach','index','ChatInteraction','rawAttributes','type','key','model','map','query','filters','attributes','intersection','fields','hasOwnProperty','order','sort','where','pick','select','field','from','tools_tags','ui.ChatInteractionId','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','chat_websites','chat_messages','me.ChatInteractionId\x20=\x20i.id','chat_interaction_has_tags','expr','search','parseSearch','sqlOperator','conditions','length','find','unreadMessages','value','having','Contact','$substring','MATCH\x20(c.firstName,\x20c.lastName,\x20c.phone,\x20c.mobile,\x20c.fax,\x20c.email)\x20AGAINST\x20(?\x20IN\x20BOOLEAN\x20MODE)','getFullTextValue','c.firstName\x20LIKE\x20?\x20OR\x20c.lastName\x20LIKE\x20?\x20OR\x20c.email\x20LIKE\x20?','ContactId','text','start','Tag','CONCAT(\x27,\x27,\x20`TagIds`,\x20\x27,\x27)\x20LIKE\x20?','User','operator','CONCAT_WS(\x27\x20\x27,\x20o.name,\x20o.fullname)\x20LIKE\x20?','UserId','buildExpression','some','compact','ChatWebsiteId','i.ChatWebsiteId\x20IN\x20?','createdAt','$gte','$lte','null','\x20IS\x20NULL','\x20=\x20?','read','`unreadMessages`\x20=\x200','`unreadMessages`\x20>\x200','tag','isArray','filter','replace','\x27\x27\x27\x27','isNumeric','MATCH\x20(me.body)\x20AGAINST\x20(?\x20IN\x20BOOLEAN\x20MODE)','CONCAT(c.firstName,\x20\x27\x20\x27,\x20c.lastName)\x20LIKE\x20?','QueryTypes','SUM(me.read\x20=\x200\x20AND\x20me.direction\x20=\x20\x27in\x27)','DESC','t.id\x20IN\x20?','journey','i.ChatWebsiteId\x20IS\x20NOT\x20NULL','isEmpty','i.ChatWebsiteId\x20IS\x20NULL','sequelize','toString','merge','a.key','Account.key','Account.mandatoryDisposition','i.*','Contact.firstName','c.email','Contact.email','c.phone','Contact.phone','c.mobile','Contact.mobile','c.fax','Contact.fax','o.fullname','Owner.fullname','o.internal','Owner.internal','GROUP_CONCAT(DISTINCT\x20t.id)','ChatInteractionId','rows','show','params','keys','includeAll','include','options','create','body','describe','abandon','entity\x20not\x20found','Interaction\x20already\x20assigned','closed','AbandonInteraction','file','originalname','filename','mimetype','Attachment','attachmentDownload','findOne','Unauthorized','attachId','join','server/files/attachments/','basename','close','mailTranscript','root','server/files/chat/upload/','format','now','pathTranscript','Messages','ChatWebsite','CmContact','%s%d','agentAlias','System','customer','Visitor','agentIdentifier','alias','fullname','agent_fullname','[%s]\x20%s:\x20%s\x0a','MM/DD/YYYY\x20HH:mm:ss','MailAccount','Smtp','service','host','port','secure','authentication','auth','user','pass','SendMail','sendMail','\x22%s\x22\x20<%s>','email','Mail\x20Transcript','Hi\x20%s,\x20attached\x20you\x20can\x20find\x20your\x20transcript\x20file.\x20\x0a\x0aRegards.\x20\x0a\x0a','addMessage','ChatMessage','omit','nolimit','YYYY-MM-DD\x20HH:mm:ss','findAll','getMyMessages','includeAgent','push','ids','spread','emit','removeTags','server'];(function(_0x2df724,_0x411382){var _0x1b2504=function(_0x1d3cd1){while(--_0x1d3cd1){_0x2df724['push'](_0x2df724['shift']());}};_0x1b2504(++_0x411382);}(_0x2bd8,0x130));var _0x82bd=function(_0x895349,_0x24cc98){_0x895349=_0x895349-0x0;var _0x2bf647=_0x2bd8[_0x895349];return _0x2bf647;};'use strict';var pdf=require(_0x82bd('0x0'));var emlformat=require('eml-format');var rimraf=require(_0x82bd('0x1'));var zipdir=require(_0x82bd('0x2'));var jsonpatch=require(_0x82bd('0x3'));var rp=require(_0x82bd('0x4'));var moment=require(_0x82bd('0x5'));var BPromise=require(_0x82bd('0x6'));var Mustache=require(_0x82bd('0x7'));var util=require('util');var path=require(_0x82bd('0x8'));var sox=require(_0x82bd('0x9'));var csv=require(_0x82bd('0xa'));var ejs=require('ejs');var fs=require('fs');var _=require(_0x82bd('0xb'));var squel=require(_0x82bd('0xc'));var crypto=require(_0x82bd('0xd'));var jsforce=require(_0x82bd('0xe'));var deskjs=require('desk.js');var toCsv=require(_0x82bd('0xa'));var querystring=require('querystring');var Papa=require('papaparse');var Redis=require('ioredis');var authService=require(_0x82bd('0xf'));var qs=require('../../components/parsers/qs');var as=require('../../components/parsers/advancedSearch');var hardwareService=require(_0x82bd('0x10'));var logger=require('../../config/logger')('api');var utils=require(_0x82bd('0x11'));var config=require(_0x82bd('0x12'));var db=require('../../mysqldb')['db'];config[_0x82bd('0x13')]=_['defaults'](config[_0x82bd('0x13')],{'host':'localhost','port':0x18eb});var socket=require(_0x82bd('0x14'))(new Redis(config[_0x82bd('0x13')]));require(_0x82bd('0x15'))[_0x82bd('0x16')](socket);var jayson=require('jayson/promise');var client=jayson[_0x82bd('0x17')][_0x82bd('0x18')]({'port':0x232b});var client9004=jayson['client'][_0x82bd('0x18')]({'port':0x232c});function checkPasswordPattern(_0x4db39d,_0x35dd09,_0x433e7d){if(_0x433e7d){var _0x2c5155=new RegExp(/(?=.*[a-z])(?=.*[A-Z])(?=.*[0-9])(?=.*[?!@#\$%\^&\*~\-_=+[{\]\}])(?=.{8,})/);if(_0x2c5155[_0x82bd('0x19')](_0x35dd09)){return _0x4db39d;}else{throw new db[(_0x82bd('0x1a'))][(_0x82bd('0x1b'))](_0x82bd('0x1c'));}}else{return _0x4db39d;}}function respondWithRpcPromise(_0xb7a986,_0x31a350,_0xf180aa,_0x390107){return new BPromise(function(_0x29b689,_0x1c3779){var _0x253741=_0x390107||client;return _0x253741['request'](_0xb7a986,_0xf180aa)['then'](function(_0x283ce7){logger[_0x82bd('0x1d')](_0x82bd('0x1e'),_0x31a350,_0x82bd('0x1f'));logger[_0x82bd('0x20')](_0x82bd('0x21'),_0x31a350,_0x82bd('0x1f'),JSON[_0x82bd('0x22')](_0x283ce7));if(_0x283ce7[_0x82bd('0x23')]){if(_0x283ce7[_0x82bd('0x23')][_0x82bd('0x24')]===0x1f4){logger[_0x82bd('0x23')](_0x82bd('0x1e'),_0x31a350,_0x283ce7[_0x82bd('0x23')][_0x82bd('0x25')]);return _0x1c3779(_0x283ce7[_0x82bd('0x23')][_0x82bd('0x25')]);}logger[_0x82bd('0x23')](_0x82bd('0x1e'),_0x31a350,_0x283ce7['error']['message']);return _0x29b689(_0x283ce7[_0x82bd('0x23')][_0x82bd('0x25')]);}else{logger[_0x82bd('0x1d')](_0x82bd('0x1e'),_0x31a350,_0x82bd('0x1f'));_0x29b689(_0x283ce7[_0x82bd('0x26')][_0x82bd('0x25')]);}})[_0x82bd('0x27')](function(_0x2f0bb6){logger[_0x82bd('0x23')]('ChatInteraction,\x20%s,\x20%s',_0x31a350,_0x2f0bb6);_0x1c3779(_0x2f0bb6);});});}function respondWithStatusCode(_0x5bd22f,_0x5609b7){_0x5609b7=_0x5609b7||0xcc;return function(_0x5d1015){if(_0x5d1015){return _0x5bd22f[_0x82bd('0x28')](_0x5609b7);}return _0x5bd22f[_0x82bd('0x29')](_0x5609b7)[_0x82bd('0x2a')]();};}function respondWithResult(_0x190bca,_0x363ef9){_0x363ef9=_0x363ef9||0xc8;return function(_0x50585e){if(_0x50585e){return _0x190bca['status'](_0x363ef9)['json'](_0x50585e);}};}function respondWithFilteredResult(_0x1e6866,_0x2a5867){return function(_0x40884f){if(_0x40884f){var _0x580ba8=_0x40884f[_0x82bd('0x2b')],_0x166c46=_0x2a5867[_0x82bd('0x2c')],_0x4f209e=_0x2a5867[_0x82bd('0x2c')]+_0x2a5867[_0x82bd('0x2d')],_0x9cc69b;if(_0x4f209e>=_0x580ba8){_0x4f209e=_0x580ba8;_0x9cc69b=0xc8;}else{_0x9cc69b=0xce;}_0x1e6866[_0x82bd('0x29')](_0x9cc69b);return _0x1e6866['set'](_0x82bd('0x2e'),_0x166c46+'-'+_0x4f209e+'/'+_0x580ba8)[_0x82bd('0x2f')](_0x40884f);}return null;};}function patchUpdates(_0x3a7d07){return function(_0x4a927a){try{jsonpatch[_0x82bd('0x30')](_0x4a927a,_0x3a7d07,!![]);}catch(_0x4c8a9b){return BPromise['reject'](_0x4c8a9b);}return _0x4a927a[_0x82bd('0x31')]();};}function saveUpdates(_0x3eb00d,_0x2cc56){return function(_0x44e1d9){if(_0x44e1d9){return _0x44e1d9[_0x82bd('0x32')](_0x3eb00d)[_0x82bd('0x33')](function(_0x45e473){return _0x45e473;});}return null;};}function removeEntity(_0x4497b9,_0x42dc7f){return function(_0xefc6e4){if(_0xefc6e4){return _0xefc6e4[_0x82bd('0x34')]()[_0x82bd('0x33')](function(){_0x4497b9[_0x82bd('0x29')](0xcc)[_0x82bd('0x2a')]();});}};}function handleEntityNotFound(_0x29fecf,_0x23e305){return function(_0x1097e3){if(!_0x1097e3){_0x29fecf['sendStatus'](0x194);}return _0x1097e3;};}function handleError(_0x59b7ca,_0x59319d){_0x59319d=_0x59319d||0x1f4;return function(_0x3fea10){logger[_0x82bd('0x23')](_0x3fea10['stack']);if(_0x3fea10[_0x82bd('0x35')]){delete _0x3fea10['name'];}_0x59b7ca['status'](_0x59319d)['send'](_0x3fea10);};}function getInteractionUsers(_0x2b7675,_0x293116){return new BPromise(function(_0x28e521,_0x396585){try{if(_0x293116[_0x2b7675['id']]){_0x2b7675[_0x82bd('0x36')]=_['map'](_0x293116[_0x2b7675['id']],function(_0x54e33f){return{'id':_0x54e33f['id'],'fullname':_0x54e33f['fullname']};});}}catch(_0x64bc54){_0x396585(_0x64bc54);}_0x28e521(_0x2b7675);});}function getInteractionTags(_0x5f5489,_0x5d09f7){return new BPromise(function(_0xba38a4,_0x37146d){try{if(_0x5f5489[_0x82bd('0x37')]){_0x5f5489[_0x82bd('0x38')]=[];_0x5f5489[_0x82bd('0x37')][_0x82bd('0x39')](',')[_0x82bd('0x3a')](function(_0x1f27f5){_0x5f5489[_0x82bd('0x38')]['push'](_0x5d09f7[_0x1f27f5]);});}delete _0x5f5489['TagIds'];}catch(_0xe210f4){_0x37146d(_0xe210f4);}_0xba38a4(_0x5f5489);});}function updateChatInteraction(_0x689b3c,_0x5835bf,_0x4f066b){return new BPromise(function(_0x277b7a,_0x18a697){return getInteractionUsers(_0x689b3c,_0x4f066b)['then'](function(_0x121f1f){return getInteractionTags(_0x121f1f,_0x5835bf);})[_0x82bd('0x33')](function(_0x42aa82){_0x277b7a(_0x42aa82);})[_0x82bd('0x27')](function(_0x21a7c7){_0x18a697(_0x21a7c7);});});}exports[_0x82bd('0x3b')]=function(_0x2a18c3,_0x2c429d){var _0x21d7d4={},_0x239d48={},_0x399475={'count':0x0,'rows':[]};var _0x9a2bcc=_['map'](db[_0x82bd('0x3c')][_0x82bd('0x3d')],function(_0x4c09ff){return{'name':_0x4c09ff['fieldName'],'type':_0x4c09ff[_0x82bd('0x3e')][_0x82bd('0x3f')]};});_0x239d48[_0x82bd('0x40')]=_[_0x82bd('0x41')](_0x9a2bcc,_0x82bd('0x35'));_0x239d48['query']=_['keys'](_0x2a18c3[_0x82bd('0x42')]);_0x239d48[_0x82bd('0x43')]=_['intersection'](_0x239d48[_0x82bd('0x40')],_0x239d48['query']);_0x21d7d4[_0x82bd('0x44')]=_[_0x82bd('0x45')](_0x239d48['model'],qs[_0x82bd('0x46')](_0x2a18c3[_0x82bd('0x42')]['fields']));_0x21d7d4['attributes']=_0x21d7d4[_0x82bd('0x44')]['length']?_0x21d7d4[_0x82bd('0x44')]:_0x239d48[_0x82bd('0x40')];if(!_0x2a18c3[_0x82bd('0x42')][_0x82bd('0x47')]('nolimit')){_0x21d7d4['limit']=qs[_0x82bd('0x2d')](_0x2a18c3[_0x82bd('0x42')]['limit']);_0x21d7d4[_0x82bd('0x2c')]=qs[_0x82bd('0x2c')](_0x2a18c3[_0x82bd('0x42')]['offset']);}_0x21d7d4[_0x82bd('0x48')]=qs[_0x82bd('0x49')](_0x2a18c3[_0x82bd('0x42')][_0x82bd('0x49')]);_0x21d7d4[_0x82bd('0x4a')]=qs[_0x82bd('0x43')](_[_0x82bd('0x4b')](_0x2a18c3[_0x82bd('0x42')],_0x239d48[_0x82bd('0x43')]));var _0x1fd682=[];var _0x3dc1f7=squel[_0x82bd('0x4c')]()[_0x82bd('0x4d')]('id')['field'](_0x82bd('0x35'))[_0x82bd('0x4d')]('color')[_0x82bd('0x4e')](_0x82bd('0x4f'));var _0x8dfe63=squel[_0x82bd('0x4c')]()['field']('u.id')[_0x82bd('0x4d')]('u.fullname')['field'](_0x82bd('0x50'))['from']('user_has_chat_interactions','ui')[_0x82bd('0x51')](_0x82bd('0x52'),'u',_0x82bd('0x53'));var _0xcfb5ef=squel[_0x82bd('0x4c')]()[_0x82bd('0x4e')](_0x82bd('0x54'),'i')[_0x82bd('0x51')](_0x82bd('0x55'),'c',_0x82bd('0x56'))[_0x82bd('0x51')](_0x82bd('0x52'),'o',_0x82bd('0x57'))[_0x82bd('0x51')](_0x82bd('0x58'),'a','a.id\x20=\x20i.ChatWebsiteId')[_0x82bd('0x51')](_0x82bd('0x59'),'me',_0x82bd('0x5a'))[_0x82bd('0x51')](_0x82bd('0x5b'),'it','it.ChatInteractionId\x20=\x20i.id')['left_join']('tools_tags','t','t.id\x20=\x20it.TagId');var _0x3b91fb=squel[_0x82bd('0x5c')]();var _0x1a4620=[];var _0x127f8f=squel['expr']();var _0x56c954;if(_0x2a18c3[_0x82bd('0x42')][_0x82bd('0x5d')]){_0x56c954=as[_0x82bd('0x5e')](_0x2a18c3['query'][_0x82bd('0x5d')]);var _0x2252ef=_0x56c954[_0x82bd('0x5f')];for(var _0xe29090=0x0;_0xe29090<_0x56c954[_0x82bd('0x60')][_0x82bd('0x61')];_0xe29090++){var _0x144a47=_0x56c954[_0x82bd('0x60')][_0xe29090];var _0x15f843='i';var _0x20b636=_[_0x82bd('0x62')](_0x9a2bcc,[_0x82bd('0x35'),_0x144a47[_0x82bd('0x4d')]]);if(!_0x20b636){switch(_0x144a47[_0x82bd('0x4d')]){case _0x82bd('0x63'):if(_0x144a47[_0x82bd('0x64')]==0x1){_0xcfb5ef[_0x82bd('0x65')]('`'+_0x144a47[_0x82bd('0x4d')]+'`\x20=\x200');}else{_0xcfb5ef[_0x82bd('0x65')]('`'+_0x144a47['field']+'`\x20>\x200');}break;case _0x82bd('0x66'):if(_0x144a47['operator']===_0x82bd('0x67')){if(_0x144a47[_0x82bd('0x64')][_0x82bd('0x39')]('\x20')[_0x82bd('0x61')]>0x1){_0x3b91fb[_0x2252ef](_0x82bd('0x68'),qs[_0x82bd('0x69')](_0x144a47[_0x82bd('0x64')]),null);}else{var _0x1b2979='%'+_0x144a47[_0x82bd('0x64')]+'%';_0x3b91fb[_0x2252ef](_0x82bd('0x6a'),_0x1b2979,_0x1b2979,_0x1b2979);}}else{_0x20b636=_[_0x82bd('0x62')](_0x9a2bcc,['name','ContactId']);_0x144a47[_0x82bd('0x4d')]=_0x82bd('0x6b');_0x505032=as['buildExpression'](_0x15f843,_0x20b636['type'],_0x144a47);_0x3b91fb[_0x2252ef](_0x505032[_0x82bd('0x6c')],_0x505032[_0x82bd('0x64')][_0x82bd('0x6d')],_0x505032[_0x82bd('0x64')]['end']);}break;case _0x82bd('0x6e'):var _0x5431d1=_0x144a47[_0x82bd('0x64')][_0x82bd('0x39')](',')['map'](function(_0x27d247){return Number(_0x27d247);});_0x5431d1[_0x82bd('0x3a')](function(_0x44636e){_0x127f8f['or'](_0x82bd('0x6f'),'%,'+_0x44636e+',%');});_0x1a4620=_['union'](_0x1a4620,_0x5431d1);break;case _0x82bd('0x70'):if(_0x144a47[_0x82bd('0x71')]===_0x82bd('0x67')){_0x3b91fb[_0x2252ef](_0x82bd('0x72'),'%'+_0x144a47[_0x82bd('0x64')]+'%',null);}else{_0x20b636=_[_0x82bd('0x62')](_0x9a2bcc,[_0x82bd('0x35'),_0x82bd('0x73')]);_0x144a47[_0x82bd('0x4d')]='UserId';_0x505032=as[_0x82bd('0x74')](_0x15f843,_0x20b636['type'],_0x144a47);_0x3b91fb[_0x2252ef](_0x505032['text'],_0x505032[_0x82bd('0x64')][_0x82bd('0x6d')],_0x505032['value'][_0x82bd('0x2a')]);}break;case'body':_0x505032=as[_0x82bd('0x74')]('me',null,_0x144a47);_0x3b91fb[_0x2252ef](_0x505032[_0x82bd('0x6c')],_0x505032['value'][_0x82bd('0x6d')],_0x505032[_0x82bd('0x64')]['end']);break;}}else{var _0x505032=as['buildExpression'](_0x15f843,_0x20b636[_0x82bd('0x3e')],_0x144a47);_0x3b91fb[_0x2252ef](_0x505032[_0x82bd('0x6c')],_0x505032['value'][_0x82bd('0x6d')],_0x505032[_0x82bd('0x64')]['end']);}}}else{var _0x5591af=_(_0x2a18c3[_0x82bd('0x42')])['keys']()['map'](function(_0x308b8e){return _[_0x82bd('0x75')](_0x9a2bcc,[_0x82bd('0x35'),_0x308b8e])?_0x308b8e:undefined;})[_0x82bd('0x76')]()[_0x82bd('0x64')]();if(!_['isEmpty'](_0x5591af)){_0x5591af[_0x82bd('0x3a')](function(_0x5101d0){if(_0x5101d0===_0x82bd('0x77')){_0xcfb5ef['where'](_0x82bd('0x78'),[]['concat'](_0x2a18c3['query'][_0x5101d0]));}else if(_0x5101d0===_0x82bd('0x79')){var _0x26e2a6=JSON['parse'](_0x2a18c3[_0x82bd('0x42')][_0x5101d0])[_0x82bd('0x7a')];var _0x16acb7=JSON['parse'](_0x2a18c3['query'][_0x5101d0])[_0x82bd('0x7b')];_0xcfb5ef[_0x82bd('0x4a')]('i.createdAt\x20BETWEEN\x20?\x20AND\x20?',_0x26e2a6,_0x16acb7);}else{if(_0x2a18c3[_0x82bd('0x42')][_0x5101d0]===_0x82bd('0x7c')){_0xcfb5ef['where']('i.'+_0x5101d0+_0x82bd('0x7d'));}else{_0xcfb5ef[_0x82bd('0x4a')]('i.'+_0x5101d0+_0x82bd('0x7e'),_0x2a18c3[_0x82bd('0x42')][_0x5101d0]);}}});}if(_0x2a18c3[_0x82bd('0x42')][_0x82bd('0x7f')]){if(_0x2a18c3['query'][_0x82bd('0x7f')]==0x1){_0xcfb5ef[_0x82bd('0x65')](_0x82bd('0x80'));}else{_0xcfb5ef['having'](_0x82bd('0x81'));}}if(_0x2a18c3['query'][_0x82bd('0x82')]){_0x1a4620=_[_0x82bd('0x83')](_0x2a18c3[_0x82bd('0x42')][_0x82bd('0x82')])?_0x2a18c3[_0x82bd('0x42')]['tag']:new Array(_0x2a18c3[_0x82bd('0x42')][_0x82bd('0x82')]);_0x1a4620['forEach'](function(_0x2de7a8){_0x127f8f['or'](_0x82bd('0x6f'),'%,'+_0x2de7a8+',%');});}if(_0x2a18c3['query'][_0x82bd('0x84')]){var _0x3d9a3e=_0x2a18c3[_0x82bd('0x42')]['filter']['replace']('\x5c','\x5c\x5c')[_0x82bd('0x85')]('\x27\x27',_0x82bd('0x86'));if(qs[_0x82bd('0x87')](_0x3d9a3e)){_0x3b91fb['or']('i.id\x20LIKE\x20?',_0x3d9a3e+'%');}else{_0x3b91fb['or'](_0x82bd('0x88'),qs[_0x82bd('0x69')](_0x3d9a3e))['or'](_0x82bd('0x89'),_0x3d9a3e+'%');}}}_0xcfb5ef['where'](_0x3b91fb);_0xcfb5ef['group']('i.id');var _0x542daf={'type':db[_0x82bd('0x1a')][_0x82bd('0x8a')]['SELECT'],'raw':!![]};var _0x35d111=_0xcfb5ef['clone']();_0x35d111[_0x82bd('0x4d')]('i.id');_0x35d111[_0x82bd('0x4d')](_0x82bd('0x8b'),_0x82bd('0x63'));if(_0x21d7d4['order']){_0x21d7d4[_0x82bd('0x48')][_0x82bd('0x3a')](function(_0x15119a){_0xcfb5ef[_0x82bd('0x48')]('i.'+_0x15119a[0x0],_0x15119a[0x1]===_0x82bd('0x8c')?![]:!![]);});}if(!_['isEmpty'](_0x1a4620)){_0xcfb5ef[_0x82bd('0x65')](_0x127f8f);_0x35d111[_0x82bd('0x4a')](_0x82bd('0x8d'),_0x1a4620);}BPromise['resolve']()['then'](function(){if(!_0x56c954){if(_0x2a18c3['query'][_0x82bd('0x77')]||_0x2a18c3[_0x82bd('0x42')][_0x82bd('0x8e')])return;_0x35d111[_0x82bd('0x4a')](_0x82bd('0x8f'));_0xcfb5ef['where']('i.ChatWebsiteId\x20IS\x20NOT\x20NULL');return;}return _0x2a18c3['user']['getChatWebsites']({'attributes':['id'],'raw':!![]})[_0x82bd('0x33')](function(_0x519934){if(_[_0x82bd('0x90')](_0x519934)){_0x35d111[_0x82bd('0x4a')](_0x82bd('0x91'));_0xcfb5ef[_0x82bd('0x4a')](_0x82bd('0x91'));}else{_0x35d111['where'](_0x82bd('0x78'),_[_0x82bd('0x41')](_0x519934,'id'));_0xcfb5ef[_0x82bd('0x4a')](_0x82bd('0x78'),_[_0x82bd('0x41')](_0x519934,'id'));}});})[_0x82bd('0x33')](function(){db[_0x82bd('0x92')][_0x82bd('0x42')](_0x35d111[_0x82bd('0x93')](),_0x542daf)[_0x82bd('0x33')](function(_0x31ae4a){_0x399475[_0x82bd('0x2b')]=_0x31ae4a[_0x82bd('0x61')];if(_0x399475['count']===0x0)return[];return db[_0x82bd('0x92')][_0x82bd('0x42')](_0x3dc1f7['toString'](),_0x542daf)['then'](function(_0x5ca4b5){_0x1fd682=_['keyBy'](_0x5ca4b5,'id');_0x542daf=_[_0x82bd('0x94')](_0x542daf,{'model':db[_0x82bd('0x3c')],'mapToModel':!![],'raw':!![],'nest':!![]});if(_0x2a18c3[_0x82bd('0x42')][_0x82bd('0x46')]){_0x21d7d4[_0x82bd('0x44')][_0x82bd('0x3a')](function(_0x17f2aa){_0xcfb5ef[_0x82bd('0x4d')]('i.'+_0x17f2aa);});}else{_0xcfb5ef['field'](_0x82bd('0x8b'),'unreadMessages');_0xcfb5ef[_0x82bd('0x4d')](_0x82bd('0x95'),_0x82bd('0x96'));_0xcfb5ef[_0x82bd('0x4d')]('a.mandatoryDisposition',_0x82bd('0x97'));_0xcfb5ef[_0x82bd('0x4d')](_0x82bd('0x98'));_0xcfb5ef[_0x82bd('0x4d')]('c.firstName',_0x82bd('0x99'));_0xcfb5ef[_0x82bd('0x4d')]('c.lastName','Contact.lastName');_0xcfb5ef['field'](_0x82bd('0x9a'),_0x82bd('0x9b'));_0xcfb5ef[_0x82bd('0x4d')](_0x82bd('0x9c'),_0x82bd('0x9d'));_0xcfb5ef[_0x82bd('0x4d')](_0x82bd('0x9e'),_0x82bd('0x9f'));_0xcfb5ef[_0x82bd('0x4d')](_0x82bd('0xa0'),_0x82bd('0xa1'));_0xcfb5ef[_0x82bd('0x4d')](_0x82bd('0xa2'),_0x82bd('0xa3'));_0xcfb5ef[_0x82bd('0x4d')](_0x82bd('0xa4'),_0x82bd('0xa5'));_0xcfb5ef[_0x82bd('0x4d')](_0x82bd('0xa6'),_0x82bd('0x37'));}_0xcfb5ef[_0x82bd('0x2d')](_0x21d7d4['limit']);_0xcfb5ef['offset'](_0x21d7d4[_0x82bd('0x2c')]);return db[_0x82bd('0x92')][_0x82bd('0x42')](_0xcfb5ef[_0x82bd('0x93')](),_0x542daf);})['then'](function(_0x5d304c){_0x8dfe63[_0x82bd('0x4a')]('ui.ChatInteractionId\x20IN\x20?',_[_0x82bd('0x41')](_0x5d304c,'id'));return db[_0x82bd('0x92')][_0x82bd('0x42')](_0x8dfe63[_0x82bd('0x93')](),_0x542daf)[_0x82bd('0x33')](function(_0x2a10ea){var _0x1570ba=_['groupBy'](_0x2a10ea,_0x82bd('0xa7'));var _0x1f5672=[];_0x5d304c[_0x82bd('0x3a')](function(_0x16299e){_0x1f5672['push'](updateChatInteraction(_0x16299e,_0x1fd682,_0x1570ba));});return BPromise['all'](_0x1f5672);});});})[_0x82bd('0x33')](function(_0x5e8068){_0x399475[_0x82bd('0xa8')]=_0x5e8068;return _0x399475;})[_0x82bd('0x33')](respondWithFilteredResult(_0x2c429d,_0x21d7d4));})[_0x82bd('0x27')](handleError(_0x2c429d,null));};exports[_0x82bd('0xa9')]=function(_0x17c5f5,_0x4930d6){var _0x31da6c={'raw':![],'where':{'id':_0x17c5f5[_0x82bd('0xaa')]['id']}},_0x21a6c8={};_0x21a6c8['model']=_['keys'](db[_0x82bd('0x3c')][_0x82bd('0x3d')]);_0x21a6c8[_0x82bd('0x42')]=_[_0x82bd('0xab')](_0x17c5f5[_0x82bd('0x42')]);_0x21a6c8['filters']=_[_0x82bd('0x45')](_0x21a6c8[_0x82bd('0x40')],_0x21a6c8[_0x82bd('0x42')]);_0x31da6c[_0x82bd('0x44')]=_['intersection'](_0x21a6c8[_0x82bd('0x40')],qs['fields'](_0x17c5f5[_0x82bd('0x42')][_0x82bd('0x46')]));_0x31da6c[_0x82bd('0x44')]=_0x31da6c['attributes']['length']?_0x31da6c['attributes']:_0x21a6c8[_0x82bd('0x40')];if(_0x17c5f5[_0x82bd('0x42')][_0x82bd('0xac')]){_0x31da6c[_0x82bd('0xad')]=[{'all':!![]}];}_0x31da6c=_[_0x82bd('0x94')]({},_0x31da6c,_0x17c5f5[_0x82bd('0xae')]);return db[_0x82bd('0x3c')]['find'](_0x31da6c)[_0x82bd('0x33')](handleEntityNotFound(_0x4930d6,null))[_0x82bd('0x33')](respondWithResult(_0x4930d6,null))[_0x82bd('0x27')](handleError(_0x4930d6,null));};exports[_0x82bd('0xaf')]=function(_0x152dde,_0x2744af){return db[_0x82bd('0x3c')][_0x82bd('0xaf')](_0x152dde[_0x82bd('0xb0')],{})[_0x82bd('0x33')](respondWithResult(_0x2744af,0xc9))['catch'](handleError(_0x2744af,null));};exports[_0x82bd('0x32')]=function(_0xbbec07,_0x32c5ea){if(_0xbbec07[_0x82bd('0xb0')]['id']){delete _0xbbec07['body']['id'];}return db[_0x82bd('0x3c')]['find']({'where':{'id':_0xbbec07[_0x82bd('0xaa')]['id']}})[_0x82bd('0x33')](handleEntityNotFound(_0x32c5ea,null))['then'](saveUpdates(_0xbbec07[_0x82bd('0xb0')],null))[_0x82bd('0x33')](respondWithResult(_0x32c5ea,null))[_0x82bd('0x27')](handleError(_0x32c5ea,null));};exports[_0x82bd('0x34')]=function(_0x53b10a,_0x2599ea){return db[_0x82bd('0x3c')]['find']({'where':{'id':_0x53b10a[_0x82bd('0xaa')]['id']}})[_0x82bd('0x33')](handleEntityNotFound(_0x2599ea,null))[_0x82bd('0x33')](removeEntity(_0x2599ea,null))[_0x82bd('0x27')](handleError(_0x2599ea,null));};exports['describe']=function(_0x2c6d96,_0x534abe){return db[_0x82bd('0x3c')][_0x82bd('0xb1')]()[_0x82bd('0x33')](respondWithResult(_0x534abe,null))[_0x82bd('0x27')](handleError(_0x534abe,null));};exports['customUpdate']=function(_0x1d46b6,_0x503bcd){if(_0x1d46b6[_0x82bd('0xb0')]['id']){delete _0x1d46b6['body']['id'];}return db['ChatInteraction'][_0x82bd('0x62')]({'where':{'id':_0x1d46b6[_0x82bd('0xaa')]['id']}})['then'](handleEntityNotFound(_0x503bcd,null))['then'](saveUpdates(_0x1d46b6['body'],null))[_0x82bd('0x33')](respondWithResult(_0x503bcd,null))['catch'](handleError(_0x503bcd,null));};exports['abandon']=function(_0x11b7dd,_0x4584c8,_0x5726a5){if(_0x11b7dd['body']['id']){delete _0x11b7dd['body']['id'];}return db[_0x82bd('0x3c')]['find']({'where':{'id':_0x11b7dd[_0x82bd('0xaa')]['id']}})[_0x82bd('0x33')](function(_0xafd594){if(!_0xafd594){logger[_0x82bd('0x23')]('abandonInteraction,\x20%s,\x20%s,\x20%s',_0x82bd('0xb2'),0x194,_0x82bd('0xb3'));_0x4584c8['sendStatus'](0x194);}else{if(_0xafd594[_0x82bd('0x73')]){throw new db[(_0x82bd('0x1a'))][(_0x82bd('0x1b'))](_0x82bd('0xb4'));}}return _0xafd594;})[_0x82bd('0x33')](function(_0x4bceda){if(_0x4bceda){return _0x4bceda[_0x82bd('0x32')]({'closed':_0x11b7dd[_0x82bd('0xb0')][_0x82bd('0xb5')],'disposition':_0x11b7dd[_0x82bd('0xb0')]['disposition']})[_0x82bd('0x33')](function(_0x42f058){return _0x42f058;});}})[_0x82bd('0x33')](function(_0x1caf00){return respondWithRpcPromise(_0x82bd('0xb6'),'abandon',_0x11b7dd[_0x82bd('0xb0')],client9004);})[_0x82bd('0x33')](respondWithResult(_0x4584c8,null))[_0x82bd('0x27')](handleError(_0x4584c8,null));};exports['attachmentUpload']=function(_0x4f5408,_0x243cd4,_0x3fa5f5){_0x4f5408['body'][_0x82bd('0x35')]=_0x4f5408[_0x82bd('0xb7')][_0x82bd('0xb8')];_0x4f5408['body']['basename']=_0x4f5408['file'][_0x82bd('0xb9')];_0x4f5408[_0x82bd('0xb0')]['type']=_0x4f5408['file'][_0x82bd('0xba')];return db[_0x82bd('0xbb')]['create'](_0x4f5408['body'])[_0x82bd('0x33')](respondWithResult(_0x243cd4,0xc9))['catch'](handleError(_0x243cd4,null));};exports[_0x82bd('0xbc')]=function(_0x3a348e,_0x39b840,_0x8deea8){return db['ChatInteraction'][_0x82bd('0xbd')]({'where':{'id':_0x3a348e[_0x82bd('0xaa')]['id']},'raw':!![]})[_0x82bd('0x33')](handleEntityNotFound(_0x39b840,null))['then'](function(_0x3488c8){if(_0x3488c8){if(_0x3488c8[_0x82bd('0xb5')]){return _0x39b840['status'](0x193)[_0x82bd('0x2f')]({'status':0x193,'message':_0x82bd('0xbe')});}return db['Attachment'][_0x82bd('0xbd')]({'where':{'id':_0x3a348e[_0x82bd('0x42')][_0x82bd('0xbf')]},'raw':!![]})[_0x82bd('0x33')](handleEntityNotFound(_0x39b840,null));}})[_0x82bd('0x33')](function(_0x36af9c){if(_0x36af9c){return _0x39b840['download'](path[_0x82bd('0xc0')](config['root'],_0x82bd('0xc1'),_0x36af9c[_0x82bd('0xc2')]));}})[_0x82bd('0x27')](handleError(_0x39b840,null));};exports[_0x82bd('0xc3')]=function(_0x305561,_0x2ae635){var _0x132245=null;var _0x31221e=null;var _0x21b426=null;var _0x32bc99=null;if(_0x305561[_0x82bd('0xb0')]['id']){delete _0x305561[_0x82bd('0xb0')]['id'];}if(_0x305561[_0x82bd('0xb0')][_0x82bd('0xc4')]){_0x32bc99=path[_0x82bd('0xc0')](config[_0x82bd('0xc5')],_0x82bd('0xc6'),util[_0x82bd('0xc7')]('transcript-%s.txt',Date[_0x82bd('0xc8')]()));_0x305561[_0x82bd('0xb0')][_0x82bd('0xc9')]=_0x32bc99;}return db[_0x82bd('0x3c')][_0x82bd('0x62')]({'where':{'id':_0x305561[_0x82bd('0xaa')]['id']},'include':[{'model':db['ChatMessage'],'as':_0x82bd('0xca'),'include':[{'model':db[_0x82bd('0x70')],'as':_0x82bd('0x70')}]}]})[_0x82bd('0x33')](handleEntityNotFound(_0x2ae635,null))[_0x82bd('0x33')](saveUpdates(_0x305561[_0x82bd('0xb0')],null))[_0x82bd('0x33')](function(_0x365808){if(_0x365808){_0x132245=_0x365808;return db[_0x82bd('0xcb')][_0x82bd('0x62')]({'where':{'id':_0x132245[_0x82bd('0x77')]}});}})[_0x82bd('0x33')](function(_0x4b06ae){if(_0x4b06ae){_0x21b426=_0x4b06ae;return db[_0x82bd('0xcc')]['find']({'where':{'id':_0x132245[_0x82bd('0x6b')]}});}})[_0x82bd('0x33')](function(_0x5acb66){if(_0x5acb66){_0x31221e=_0x5acb66;if(_0x32bc99){var _0x3e9bd2=null;for(var _0x4497cd=0x1;_0x4497cd<_0x132245[_0x82bd('0xca')][_0x82bd('0x61')];++_0x4497cd){_0x3e9bd2=_0x132245[_0x82bd('0xca')][_0x4497cd];var _0x1fa65b=_0x3e9bd2['UserId']?util['format'](_0x82bd('0xcd'),_0x21b426[_0x82bd('0xce')],_0x3e9bd2[_0x82bd('0x73')]):_0x82bd('0xcf');var _0x41de14=_0x305561[_0x82bd('0xb0')][_0x82bd('0xd0')]||util[_0x82bd('0xc7')](_0x82bd('0xcd'),_0x82bd('0xd1'),_0x3e9bd2[_0x82bd('0x6b')]);switch(_0x21b426[_0x82bd('0xd2')]){case'website_alias':_0x1fa65b=_0x3e9bd2[_0x82bd('0x73')]?util['format'](_0x82bd('0xcd'),_0x21b426[_0x82bd('0xce')],_0x3e9bd2[_0x82bd('0x73')]):_0x82bd('0xcf');break;case'agent_alias':_0x1fa65b=_0x3e9bd2[_0x82bd('0x73')]?_0x3e9bd2[_0x82bd('0x70')][_0x82bd('0xd3')]||_0x3e9bd2['User'][_0x82bd('0xd4')]:_0x82bd('0xcf');break;case _0x82bd('0xd5'):_0x1fa65b=_0x3e9bd2[_0x82bd('0x73')]?_0x3e9bd2[_0x82bd('0x70')][_0x82bd('0xd4')]:_0x82bd('0xcf');break;default:_0x1fa65b=_0x3e9bd2[_0x82bd('0x73')]?util[_0x82bd('0xc7')](_0x82bd('0xcd'),_0x21b426[_0x82bd('0xce')],_0x3e9bd2[_0x82bd('0x73')]):_0x82bd('0xcf');}var _0x27a6d1=util[_0x82bd('0xc7')](_0x82bd('0xd6'),moment(_0x3e9bd2['createdAt'])[_0x82bd('0xc7')](_0x82bd('0xd7')),_0x3e9bd2['direction']==='in'?_0x41de14:_0x1fa65b,_0x3e9bd2[_0x82bd('0xb0')]);if(!_0x3e9bd2['secret']){fs['appendFileSync'](_0x32bc99,_0x27a6d1);}}return db[_0x82bd('0xd8')]['findOne']({'where':{'service':!![]},'include':[{'model':db['MailServerOut'],'as':'Smtp','raw':!![]}]});}}})[_0x82bd('0x33')](function(_0x13ea4c){if(_0x13ea4c&&_0x13ea4c[_0x82bd('0xd9')]&&_0x305561['body']){var _0x4c68cc={'tls':{'rejectUnauthorized':![]}};if(_0x13ea4c[_0x82bd('0xd9')][_0x82bd('0xda')]){_0x4c68cc['service']=_0x13ea4c[_0x82bd('0xd9')]['service'];}else{_0x4c68cc[_0x82bd('0xdb')]=_0x13ea4c[_0x82bd('0xd9')][_0x82bd('0xdb')];_0x4c68cc['port']=_0x13ea4c['Smtp'][_0x82bd('0xdc')];_0x4c68cc[_0x82bd('0xdd')]=_0x13ea4c[_0x82bd('0xd9')]['secure'];}if(_0x13ea4c['Smtp'][_0x82bd('0xde')]){_0x4c68cc[_0x82bd('0xdf')]={'user':_0x13ea4c['Smtp'][_0x82bd('0xe0')],'pass':_0x13ea4c[_0x82bd('0xd9')][_0x82bd('0xe1')]};}return respondWithRpcPromise(_0x82bd('0xe2'),_0x82bd('0xe3'),{'account':_0x4c68cc,'message':{'from':util[_0x82bd('0xc7')](_0x82bd('0xe4'),_0x13ea4c[_0x82bd('0x35')],_0x13ea4c[_0x82bd('0xe5')]||_0x13ea4c[_0x82bd('0xd9')][_0x82bd('0xe0')]),'to':_0x305561[_0x82bd('0xb0')][_0x82bd('0xc4')],'subject':_0x82bd('0xe6'),'text':util['format'](_0x82bd('0xe7'),_0x305561[_0x82bd('0xb0')][_0x82bd('0xc4')]),'attachments':[{'path':_0x32bc99}]}})[_0x82bd('0x33')](function(){return _0x132245;})[_0x82bd('0x27')](function(_0x3901d9){console[_0x82bd('0x23')](_0x3901d9);});}else{return _0x132245;}})['then'](respondWithStatusCode(_0x2ae635,0xc8))['catch'](handleError(_0x2ae635,null));};exports[_0x82bd('0xe8')]=function(_0x2541a8,_0x1f39de,_0x1d2ff9){return db[_0x82bd('0xe9')][_0x82bd('0x62')]({'where':{'id':_0x2541a8[_0x82bd('0xaa')]['id']}})[_0x82bd('0x33')](handleEntityNotFound(_0x1f39de,null))[_0x82bd('0x33')](function(_0x214dfe){if(_0x214dfe){return _0x214dfe[_0x82bd('0xe8')](_0x2541a8[_0x82bd('0xb0')]['ids'],_[_0x82bd('0xea')](_0x2541a8['body'],['ids','id'])||{});}})['then'](respondWithResult(_0x1f39de,null))[_0x82bd('0x27')](handleError(_0x1f39de,null));};exports['getMessages']=function(_0x39ecca,_0x12f18c,_0x52fe38){var _0x29456b={'raw':![],'where':{}};var _0x16bb93={};var _0x438836={'count':0x0,'rows':[]};return db['ChatInteraction'][_0x82bd('0xbd')]({'where':{'id':_0x39ecca[_0x82bd('0xaa')]['id']}})['then'](handleEntityNotFound(_0x12f18c,null))[_0x82bd('0x33')](function(_0x498b48){if(_0x498b48){_0x16bb93[_0x82bd('0x40')]=_[_0x82bd('0xab')](db[_0x82bd('0xe9')][_0x82bd('0x3d')]);_0x16bb93[_0x82bd('0x42')]=_[_0x82bd('0xab')](_0x39ecca[_0x82bd('0x42')]);_0x16bb93['filters']=_[_0x82bd('0x45')](_0x16bb93['model'],_0x16bb93[_0x82bd('0x42')]);_0x29456b[_0x82bd('0x44')]=_['intersection'](_0x16bb93[_0x82bd('0x40')],qs['fields'](_0x39ecca[_0x82bd('0x42')][_0x82bd('0x46')]));_0x29456b[_0x82bd('0x44')]=_0x29456b[_0x82bd('0x44')][_0x82bd('0x61')]?_0x29456b[_0x82bd('0x44')]:_0x16bb93[_0x82bd('0x40')];if(!_0x39ecca[_0x82bd('0x42')][_0x82bd('0x47')](_0x82bd('0xeb'))){_0x29456b[_0x82bd('0x2d')]=qs['limit'](_0x39ecca[_0x82bd('0x42')][_0x82bd('0x2d')]);_0x29456b[_0x82bd('0x2c')]=qs[_0x82bd('0x2c')](_0x39ecca[_0x82bd('0x42')][_0x82bd('0x2c')]);}_0x29456b['order']=qs[_0x82bd('0x49')](_0x39ecca[_0x82bd('0x42')][_0x82bd('0x49')]);_0x29456b[_0x82bd('0x4a')]=qs[_0x82bd('0x43')](_[_0x82bd('0x4b')](_0x39ecca[_0x82bd('0x42')],_0x16bb93[_0x82bd('0x43')]));_0x29456b[_0x82bd('0x4a')][_0x82bd('0xa7')]=_0x498b48['id'];if(_0x39ecca[_0x82bd('0x42')]['filter']){_0x29456b[_0x82bd('0x4a')]=_['merge'](_0x29456b[_0x82bd('0x4a')],{'$or':_[_0x82bd('0x41')](_0x29456b[_0x82bd('0x44')],function(_0x5aab8f){var _0x3d792b={};_0x3d792b[_0x5aab8f]={'$like':'%'+_0x39ecca[_0x82bd('0x42')][_0x82bd('0x84')]+'%'};return _0x3d792b;})});}if(_0x39ecca['query'][_0x82bd('0x7a')]){var _0x13cb83=_0x39ecca[_0x82bd('0x42')][_0x82bd('0x7a')][_0x82bd('0x39')](',');var _0x218cea={};_0x218cea[_0x13cb83[0x0]]={'$gte':moment(_0x13cb83[0x1])[_0x82bd('0xc7')](_0x82bd('0xec'))};_0x29456b[_0x82bd('0x4a')]=_[_0x82bd('0x94')](_0x29456b[_0x82bd('0x4a')],_0x218cea);}_0x29456b=_[_0x82bd('0x94')]({},_0x29456b,_0x39ecca['options']);return db[_0x82bd('0xe9')][_0x82bd('0x2b')]({'where':_0x29456b['where']})[_0x82bd('0x33')](function(_0x393e6b){_0x438836[_0x82bd('0x2b')]=_0x393e6b;if(_0x39ecca[_0x82bd('0x42')][_0x82bd('0xac')]){_0x29456b[_0x82bd('0xad')]=[{'all':!![]}];}return db['ChatMessage'][_0x82bd('0xed')](_0x29456b);})[_0x82bd('0x33')](function(_0x589d31){_0x438836[_0x82bd('0xa8')]=_0x589d31;return _0x438836;});}})[_0x82bd('0x33')](respondWithFilteredResult(_0x12f18c,_0x29456b))[_0x82bd('0x27')](handleError(_0x12f18c,null));};exports[_0x82bd('0xee')]=function(_0x52e55f,_0x345707,_0x4e29f6){var _0x28fae0={'where':{}},_0x492827={},_0x1736f3={'count':0x0,'rows':[]};return db[_0x82bd('0x3c')][_0x82bd('0xbd')]({'where':{'id':_0x52e55f[_0x82bd('0xaa')]['id']}})[_0x82bd('0x33')](handleEntityNotFound(_0x345707,null))[_0x82bd('0x33')](function(_0x107374){if(_0x107374){_0x492827['model']=_[_0x82bd('0xab')](db[_0x82bd('0xe9')][_0x82bd('0x3d')]);_0x492827['query']=_[_0x82bd('0xab')](_0x52e55f[_0x82bd('0x42')]);_0x492827['filters']=_[_0x82bd('0x45')](_0x492827[_0x82bd('0x40')],_0x492827[_0x82bd('0x42')]);_0x28fae0[_0x82bd('0x44')]=_[_0x82bd('0x45')](_0x492827['model'],qs['fields'](_0x52e55f['query'][_0x82bd('0x46')]));_0x28fae0['attributes']=_0x28fae0[_0x82bd('0x44')][_0x82bd('0x61')]?_0x28fae0[_0x82bd('0x44')]:_0x492827['model'];if(!_0x52e55f[_0x82bd('0x42')][_0x82bd('0x47')](_0x82bd('0xeb'))){_0x28fae0[_0x82bd('0x2d')]=qs[_0x82bd('0x2d')](_0x52e55f['query'][_0x82bd('0x2d')]);_0x28fae0[_0x82bd('0x2c')]=qs[_0x82bd('0x2c')](_0x52e55f[_0x82bd('0x42')][_0x82bd('0x2c')]);}_0x28fae0['order']=qs[_0x82bd('0x49')](_0x52e55f[_0x82bd('0x42')][_0x82bd('0x49')]);_0x28fae0['where']=qs[_0x82bd('0x43')](_[_0x82bd('0x4b')](_0x52e55f[_0x82bd('0x42')],_0x492827[_0x82bd('0x43')]));_0x28fae0[_0x82bd('0x4a')][_0x82bd('0xa7')]=_0x107374['id'];if(_0x52e55f['query'][_0x82bd('0x84')]){_0x28fae0[_0x82bd('0x4a')]=_[_0x82bd('0x94')](_0x28fae0[_0x82bd('0x4a')],{'$or':_[_0x82bd('0x41')](_0x28fae0[_0x82bd('0x44')],function(_0x453092){var _0x54b993={};_0x54b993[_0x453092]={'$like':'%'+_0x52e55f[_0x82bd('0x42')][_0x82bd('0x84')]+'%'};return _0x54b993;})});}_0x28fae0['where']['secret']=![];if(_0x52e55f['query']['id']){_0x28fae0[_0x82bd('0x4a')]['id']={'$gt':_0x52e55f[_0x82bd('0x42')]['id']};}_0x28fae0=_[_0x82bd('0x94')]({},_0x28fae0,_0x52e55f[_0x82bd('0xae')]);return db['ChatMessage'][_0x82bd('0x2b')]({'where':_0x28fae0['where']})[_0x82bd('0x33')](function(_0x305cbd){_0x1736f3[_0x82bd('0x2b')]=_0x305cbd;_0x28fae0['include']=[];if(_0x52e55f[_0x82bd('0x42')][_0x82bd('0xef')]){_0x28fae0['include'][_0x82bd('0xf0')]({'model':db[_0x82bd('0x70')],'as':_0x82bd('0x70'),'attributes':['id',_0x82bd('0xd4'),_0x82bd('0xd3')]});}if(_0x52e55f['query'][_0x82bd('0xac')]){_0x28fae0[_0x82bd('0xad')]=[{'all':!![]}];}return db['ChatMessage'][_0x82bd('0xed')](_0x28fae0);})[_0x82bd('0x33')](function(_0x19a379){_0x1736f3[_0x82bd('0xa8')]=_0x19a379;return _0x1736f3;});}})[_0x82bd('0x33')](respondWithFilteredResult(_0x345707,_0x28fae0))[_0x82bd('0x27')](handleError(_0x345707,null));};exports['addTags']=function(_0xb081ae,_0x9903e2,_0x56b691){return db[_0x82bd('0x3c')][_0x82bd('0x62')]({'where':{'id':_0xb081ae[_0x82bd('0xaa')]['id']}})[_0x82bd('0x33')](handleEntityNotFound(_0x9903e2,null))[_0x82bd('0x33')](function(_0x46b569){if(_0x46b569){return _0x46b569['setTags'](_0xb081ae[_0x82bd('0xb0')][_0x82bd('0xf1')],_[_0x82bd('0xea')](_0xb081ae['body'],[_0x82bd('0xf1'),'id'])||{})[_0x82bd('0xf2')](function(){return db['Tag']['findAll']({'attributes':['id',_0x82bd('0x35'),'color'],'where':{'id':_0xb081ae[_0x82bd('0xb0')][_0x82bd('0xf1')]}});})['then'](function(_0x26d5ff){socket[_0x82bd('0xf3')]('chatInteractionTags:save',{'id':Number(_0xb081ae[_0x82bd('0xaa')]['id']),'tags':_0x26d5ff||[]});return{'id':Number(_0xb081ae[_0x82bd('0xaa')]['id']),'tags':_0x26d5ff||[]};});}})[_0x82bd('0x33')](respondWithResult(_0x9903e2,null))['catch'](handleError(_0x9903e2,null));};exports[_0x82bd('0xf4')]=function(_0x130fad,_0x4c7861,_0x53135b){return db[_0x82bd('0x3c')]['find']({'where':{'id':_0x130fad[_0x82bd('0xaa')]['id']}})[_0x82bd('0x33')](handleEntityNotFound(_0x4c7861,null))[_0x82bd('0x33')](function(_0x488faf){if(_0x488faf){return _0x488faf['removeTags'](_0x130fad[_0x82bd('0x42')]['ids']);}})['then'](respondWithStatusCode(_0x4c7861,null))[_0x82bd('0x27')](handleError(_0x4c7861,null));};exports['download']=function(_0x56d036,_0x5cf973){var _0x38d44e=moment()['unix']()[_0x82bd('0x93')]();var _0x27a84b=path[_0x82bd('0xc0')](config[_0x82bd('0xc5')],_0x82bd('0xf5'),_0x82bd('0xf6'),_0x82bd('0xf7'));var _0x3aad63=path[_0x82bd('0xc0')](config['root'],_0x82bd('0xf5'),_0x82bd('0xf6'),_0x82bd('0xf8'));var _0xc107f5=path['join'](_0x27a84b,_0x38d44e);var _0x3a342c=util[_0x82bd('0xc7')](_0x82bd('0xf9'),_0x56d036['params']['id'],_0x38d44e);var _0x5a579f=path[_0x82bd('0xc0')](_0x27a84b,_0x3a342c);var _0x5a4256=[];_0x5a4256[_0x82bd('0xf0')]({'model':db[_0x82bd('0x70')],'as':'User','attributes':['id',_0x82bd('0xd4')],'raw':!![]});_0x5a4256['push']({'model':db[_0x82bd('0xcc')],'as':_0x82bd('0x66'),'attributes':['id',_0x82bd('0xfa'),_0x82bd('0xfb')],'raw':!![]});if(_0x56d036['query'][_0x82bd('0xf8')]){_0x5a4256[_0x82bd('0xf0')]({'model':db[_0x82bd('0xbb')],'as':_0x82bd('0xbb'),'raw':!![]});}var _0x22b578=[{'model':db['ChatMessage'],'as':_0x82bd('0xca'),'attributes':['id',_0x82bd('0xb0'),_0x82bd('0x79'),_0x82bd('0xfc'),'secret',_0x82bd('0x7f')],'include':_0x5a4256}];_0x22b578[_0x82bd('0xf0')]({'model':db['ChatWebsite'],'as':_0x82bd('0xfd'),'attributes':['id',_0x82bd('0x35')]});_0x22b578[_0x82bd('0xf0')]({'model':db['User'],'as':_0x82bd('0xfe'),'attributes':['id',_0x82bd('0xd4')]});return db[_0x82bd('0x3c')]['find']({'where':{'id':_0x56d036[_0x82bd('0xaa')]['id']},'include':_0x22b578})[_0x82bd('0x33')](handleEntityNotFound(_0x5cf973,null))[_0x82bd('0x33')](function(_0x412141){if(_0x412141){var _0x2907d0=_0x412141['get']({'plain':!![]});fs['mkdirSync'](_0xc107f5);var _0x56719e={'format':'A4','border':'10px','header':{'height':'40px','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':_0x82bd('0xff'),'contents':{'default':util['format'](_0x82bd('0x100'),util[_0x82bd('0xc7')](_0x82bd('0x101'),_0x82bd('0x102'),_0x2907d0['id']),moment()[_0x82bd('0xc7')](_0x82bd('0x103'))[_0x82bd('0x93')]())}}};var _0x5a5caa={'channel':'Chat','account':_0x2907d0[_0x82bd('0xfd')][_0x82bd('0x35')],'agent':_0x2907d0[_0x82bd('0xfe')]?_0x2907d0[_0x82bd('0xfe')][_0x82bd('0xd4')]:_0x82bd('0x104'),'createdAt':moment(_0x2907d0[_0x82bd('0x79')])[_0x82bd('0xc7')](_0x82bd('0xec'))[_0x82bd('0x93')](),'closedAt':_0x2907d0['closed']?moment(_0x2907d0[_0x82bd('0x105')])['format'](_0x82bd('0xec'))['toString']():'','disposition':_0x2907d0[_0x82bd('0x106')],'chatInfo':{'browser':_0x2907d0[_0x82bd('0x107')],'os':_0x2907d0[_0x82bd('0x108')],'referer':_0x2907d0['referer'],'customerIp':_0x2907d0['customerIp'],'customerPort':_0x2907d0['customerPort']?_0x2907d0['customerPort']:_0x82bd('0x104')},'messages':_(_0x2907d0[_0x82bd('0xca')])[_0x82bd('0x109')]()[_0x82bd('0x84')]({'secret':![]})[_0x82bd('0x41')](function(_0x4c3016){if(_0x4c3016[_0x82bd('0xbb')]){var _0x5dfdfc=path['join'](_0x3aad63,_0x4c3016['Attachment'][_0x82bd('0xc2')]);if(fs[_0x82bd('0x10a')](_0x5dfdfc)){fs[_0x82bd('0x10b')](_0x5dfdfc)['pipe'](fs[_0x82bd('0x10c')](path[_0x82bd('0xc0')](_0xc107f5,_0x4c3016[_0x82bd('0xbb')][_0x82bd('0xc2')])));}}return{'date':moment(_0x4c3016[_0x82bd('0x79')])['format'](_0x82bd('0xec'))[_0x82bd('0x93')](),'sender':_0x4c3016['direction']==='out'?_0x4c3016['User']?_0x4c3016[_0x82bd('0x70')][_0x82bd('0xd4')]:_0x82bd('0xcf'):_0x4c3016[_0x82bd('0x66')]['firstName']+(_0x4c3016[_0x82bd('0x66')][_0x82bd('0xfb')]?'\x20'+_0x4c3016[_0x82bd('0x66')][_0x82bd('0xfb')]:''),'body':_0x4c3016['Attachment']?_0x4c3016['Attachment']['basename']:_0x4c3016[_0x82bd('0xb0')],'direction':_0x4c3016[_0x82bd('0xfc')]===_0x82bd('0x10d')?'A':'C','secret':_0x4c3016[_0x82bd('0x10e')],'read':_0x4c3016['read'],'attachment':_0x4c3016['Attachment']};})[_0x82bd('0x64')]()};return ejs[_0x82bd('0x10f')](path['join'](config[_0x82bd('0xc5')],_0x82bd('0xf5'),'views','downloadInteraction.html'),{'interaction':_0x5a5caa})[_0x82bd('0x33')](function(_0x31af19){return new BPromise(function(_0x5caf82,_0x42d49b){pdf[_0x82bd('0xaf')](_0x31af19,_0x56719e)[_0x82bd('0x110')](path[_0x82bd('0xc0')](_0xc107f5,'transcript-'+_0x2907d0['id']+'-'+_0x38d44e+'.pdf'),function(_0x420e05,_0x3660b8){if(_0x420e05)return _0x42d49b(_0x420e05);_0x5caf82(_0x3660b8);});});})[_0x82bd('0x33')](function(){return new BPromise(function(_0x1178e9,_0x5a5318){zipdir(_0xc107f5,{'saveTo':_0x5a579f},function(_0x57ad60,_0x5e5d8d){if(_0x57ad60)return _0x5a5318(_0x57ad60);return _0x1178e9(_0x5e5d8d);});})[_0x82bd('0x33')](function(){return new BPromise(function(_0x3c904a,_0x43acba){rimraf(_0xc107f5,function(_0x5c37dd){if(_0x5c37dd)_0x43acba(_0x5c37dd);return _0x3c904a();});});})['then'](function(){return _0x5cf973['download'](_0x5a579f,_0x3a342c,function(_0x518a47){if(_0x518a47){console['log'](_0x82bd('0x111'),_0x518a47);}else{fs[_0x82bd('0x112')](_0x5a579f);}});});});}else{return _0x5cf973[_0x82bd('0x28')](0xc8);}})[_0x82bd('0x27')](handleError(_0x5cf973,null));};
\ No newline at end of file
diff --git a/server/api/chatInteraction/chatInteraction.events.js b/server/api/chatInteraction/chatInteraction.events.js
index 40fc9e9..f728605 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 _0x288a=['../../mysqldb','ChatInteraction','ChatMessage','update','getUsers','then','Users','map','findAll','setDataValue','unreadMessages','catch','hasOwnProperty','exports'];(function(_0x45d55e,_0x2fede3){var _0x29812a=function(_0x3c6830){while(--_0x3c6830){_0x45d55e['push'](_0x45d55e['shift']());}};_0x29812a(++_0x2fede3);}(_0x288a,0x188));var _0xa288=function(_0xdeaa04,_0x6eb96d){_0xdeaa04=_0xdeaa04-0x0;var _0x4522a4=_0x288a[_0xdeaa04];return _0x4522a4;};'use strict';var EventEmitter=require('events');var ChatInteraction=require(_0xa288('0x0'))['db'][_0xa288('0x1')];var ChatMessage=require(_0xa288('0x0'))['db'][_0xa288('0x2')];var ChatInteractionEvents=new EventEmitter();ChatInteractionEvents['setMaxListeners'](0x0);var events={'afterCreate':'save','afterUpdate':_0xa288('0x3'),'afterDestroy':'remove'};function emitEvent(_0x4a05f4){return function(_0x3905cd,_0x101598,_0x4ad8fb){_0x3905cd[_0xa288('0x4')]({'attributes':['id'],'raw':!![]})[_0xa288('0x5')](function(_0x156720){_0x3905cd['setDataValue'](_0xa288('0x6'),_0x156720[_0xa288('0x7')](function(_0x341d34){return{'id':_0x341d34['id']};}));return ChatMessage[_0xa288('0x8')]({'where':{'ChatInteractionId':_0x3905cd['id'],'direction':'in','read':![]},'raw':!![]});})[_0xa288('0x5')](function(_0x3181e6){_0x3905cd[_0xa288('0x9')](_0xa288('0xa'),_0x3181e6['length']);ChatInteractionEvents['emit'](_0x4a05f4+':'+_0x3905cd['id'],_0x3905cd);ChatInteractionEvents['emit'](_0x4a05f4,_0x3905cd);_0x4ad8fb(null);})[_0xa288('0xb')](_0x4ad8fb(null));};}for(var e in events){if(events[_0xa288('0xc')](e)){var event=events[e];ChatInteraction['hook'](e,emitEvent(event));}}module[_0xa288('0xd')]=ChatInteractionEvents;
\ No newline at end of file
+var _0x6691=['save','update','remove','getUsers','then','map','unreadMessages','length','emit','catch','hasOwnProperty','hook','exports','events','../../mysqldb','ChatInteraction','ChatMessage','setMaxListeners'];(function(_0x42cae2,_0x284ef8){var _0x5f256f=function(_0x41abc8){while(--_0x41abc8){_0x42cae2['push'](_0x42cae2['shift']());}};_0x5f256f(++_0x284ef8);}(_0x6691,0x12d));var _0x1669=function(_0x6c993a,_0x5ea3ab){_0x6c993a=_0x6c993a-0x0;var _0x27f547=_0x6691[_0x6c993a];return _0x27f547;};'use strict';var EventEmitter=require(_0x1669('0x0'));var ChatInteraction=require(_0x1669('0x1'))['db'][_0x1669('0x2')];var ChatMessage=require(_0x1669('0x1'))['db'][_0x1669('0x3')];var ChatInteractionEvents=new EventEmitter();ChatInteractionEvents[_0x1669('0x4')](0x0);var events={'afterCreate':_0x1669('0x5'),'afterUpdate':_0x1669('0x6'),'afterDestroy':_0x1669('0x7')};function emitEvent(_0x2ad807){return function(_0x4b41a5,_0x2a81ab,_0x1bf2c8){_0x4b41a5[_0x1669('0x8')]({'attributes':['id'],'raw':!![]})[_0x1669('0x9')](function(_0x55393c){_0x4b41a5['setDataValue']('Users',_0x55393c[_0x1669('0xa')](function(_0x562fe9){return{'id':_0x562fe9['id']};}));return ChatMessage['findAll']({'where':{'ChatInteractionId':_0x4b41a5['id'],'direction':'in','read':![]},'raw':!![]});})['then'](function(_0x56e0ee){_0x4b41a5['setDataValue'](_0x1669('0xb'),_0x56e0ee[_0x1669('0xc')]);ChatInteractionEvents[_0x1669('0xd')](_0x2ad807+':'+_0x4b41a5['id'],_0x4b41a5);ChatInteractionEvents[_0x1669('0xd')](_0x2ad807,_0x4b41a5);_0x1bf2c8(null);})[_0x1669('0xe')](_0x1bf2c8(null));};}for(var e in events){if(events[_0x1669('0xf')](e)){var event=events[e];ChatInteraction[_0x1669('0x10')](e,emitEvent(event));}}module[_0x1669('0x11')]=ChatInteractionEvents;
\ No newline at end of file
diff --git a/server/api/chatInteraction/chatInteraction.model.js b/server/api/chatInteraction/chatInteraction.model.js
index 5f7a122..0b019ca 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 _0x7d82=['../../config/logger','api','moment','request-promise','rimraf','./chatInteraction.attributes','exports','ChatInteraction','chat_interactions','changed','closed','closedAt','format','utf8mb4_unicode_ci','lodash','util'];(function(_0x55c41f,_0x4f15e6){var _0x13723c=function(_0x5462e6){while(--_0x5462e6){_0x55c41f['push'](_0x55c41f['shift']());}};_0x13723c(++_0x4f15e6);}(_0x7d82,0x1ee));var _0x27d8=function(_0xde3ba6,_0x5c6f82){_0xde3ba6=_0xde3ba6-0x0;var _0x33afa3=_0x7d82[_0xde3ba6];return _0x33afa3;};'use strict';var _=require(_0x27d8('0x0'));var util=require(_0x27d8('0x1'));var logger=require(_0x27d8('0x2'))(_0x27d8('0x3'));var moment=require(_0x27d8('0x4'));var BPromise=require('bluebird');var rp=require(_0x27d8('0x5'));var fs=require('fs');var path=require('path');var rimraf=require(_0x27d8('0x6'));var config=require('../../config/environment');var attributes=require(_0x27d8('0x7'));module[_0x27d8('0x8')]=function(_0x2c0261,_0x1f5c95){return _0x2c0261['define'](_0x27d8('0x9'),attributes,{'tableName':_0x27d8('0xa'),'paranoid':![],'indexes':[],'timestamps':!![],'hooks':{'beforeUpdate':function(_0x1515a0,_0x1141fc,_0x5875f1){if(_0x1515a0[_0x27d8('0xb')](_0x27d8('0xc'))){_0x1515a0[_0x27d8('0xd')]=moment()[_0x27d8('0xe')]('YYYY-MM-DD\x20HH:mm:ss');}_0x5875f1(null,_0x1515a0);}},'charset':'utf8mb4','collate':_0x27d8('0xf')});};
\ No newline at end of file
+var _0xdb5f=['./chatInteraction.attributes','exports','define','ChatInteraction','chat_interactions','changed','closed','format','YYYY-MM-DD\x20HH:mm:ss','utf8mb4','lodash','util','../../config/logger','api','moment','bluebird','request-promise','path','../../config/environment'];(function(_0x1978f3,_0x387a40){var _0x25f0ce=function(_0x3ca20a){while(--_0x3ca20a){_0x1978f3['push'](_0x1978f3['shift']());}};_0x25f0ce(++_0x387a40);}(_0xdb5f,0x1e5));var _0xfdb5=function(_0x23f19e,_0x4d583b){_0x23f19e=_0x23f19e-0x0;var _0x2a95d4=_0xdb5f[_0x23f19e];return _0x2a95d4;};'use strict';var _=require(_0xfdb5('0x0'));var util=require(_0xfdb5('0x1'));var logger=require(_0xfdb5('0x2'))(_0xfdb5('0x3'));var moment=require(_0xfdb5('0x4'));var BPromise=require(_0xfdb5('0x5'));var rp=require(_0xfdb5('0x6'));var fs=require('fs');var path=require(_0xfdb5('0x7'));var rimraf=require('rimraf');var config=require(_0xfdb5('0x8'));var attributes=require(_0xfdb5('0x9'));module[_0xfdb5('0xa')]=function(_0x2263fc,_0xb2d603){return _0x2263fc[_0xfdb5('0xb')](_0xfdb5('0xc'),attributes,{'tableName':_0xfdb5('0xd'),'paranoid':![],'indexes':[],'timestamps':!![],'hooks':{'beforeUpdate':function(_0x42c972,_0x5ca781,_0x1eb1e0){if(_0x42c972[_0xfdb5('0xe')](_0xfdb5('0xf'))){_0x42c972['closedAt']=moment()[_0xfdb5('0x10')](_0xfdb5('0x11'));}_0x1eb1e0(null,_0x42c972);}},'charset':_0xfdb5('0x12'),'collate':'utf8mb4_unicode_ci'});};
\ No newline at end of file
diff --git a/server/api/chatInteraction/chatInteraction.rpc.js b/server/api/chatInteraction/chatInteraction.rpc.js
index b7be8ba..3921e16 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 _0x3359=['options','where','attributes','then','AddTagsToChatInteraction','find','addTags','ids','omit','spread','AddTags','lodash','util','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','client','http','redis','defaults','socket.io-emitter','./chatInteraction.socket','register','ChatInteraction,\x20%s,\x20%s','request\x20sent','debug','ChatInteraction,\x20%s,\x20%s,\x20%s','stringify','error','code','message','info','result','catch','UpdateChatInteraction','ChatInteraction','body'];(function(_0x14790,_0x1c5b30){var _0x2be162=function(_0x47bb84){while(--_0x47bb84){_0x14790['push'](_0x14790['shift']());}};_0x2be162(++_0x1c5b30);}(_0x3359,0x16b));var _0x9335=function(_0x41e5ee,_0x5433fd){_0x41e5ee=_0x41e5ee-0x0;var _0x4c9c7b=_0x3359[_0x41e5ee];return _0x4c9c7b;};'use strict';var _=require(_0x9335('0x0'));var util=require(_0x9335('0x1'));var moment=require(_0x9335('0x2'));var BPromise=require(_0x9335('0x3'));var rs=require(_0x9335('0x4'));var fs=require('fs');var Redis=require(_0x9335('0x5'));var db=require(_0x9335('0x6'))['db'];var utils=require(_0x9335('0x7'));var logger=require(_0x9335('0x8'))(_0x9335('0x9'));var config=require(_0x9335('0xa'));var jayson=require(_0x9335('0xb'));var client=jayson[_0x9335('0xc')][_0x9335('0xd')]({'port':0x232a});config[_0x9335('0xe')]=_[_0x9335('0xf')](config[_0x9335('0xe')],{'host':'localhost','port':0x18eb});var socket=require(_0x9335('0x10'))(new Redis(config[_0x9335('0xe')]));require(_0x9335('0x11'))[_0x9335('0x12')](socket);function respondWithRpcPromise(_0x7f533f,_0x22d440,_0x1c7261){return new BPromise(function(_0x55d5c5,_0xd419bb){return client['request'](_0x7f533f,_0x1c7261)['then'](function(_0x50603b){logger['info'](_0x9335('0x13'),_0x22d440,_0x9335('0x14'));logger[_0x9335('0x15')](_0x9335('0x16'),_0x22d440,_0x9335('0x14'),JSON[_0x9335('0x17')](_0x50603b));if(_0x50603b['error']){if(_0x50603b[_0x9335('0x18')][_0x9335('0x19')]===0x1f4){logger[_0x9335('0x18')]('ChatInteraction,\x20%s,\x20%s',_0x22d440,_0x50603b[_0x9335('0x18')][_0x9335('0x1a')]);return _0xd419bb(_0x50603b[_0x9335('0x18')][_0x9335('0x1a')]);}logger[_0x9335('0x18')](_0x9335('0x13'),_0x22d440,_0x50603b[_0x9335('0x18')][_0x9335('0x1a')]);return _0x55d5c5(_0x50603b['error'][_0x9335('0x1a')]);}else{logger[_0x9335('0x1b')](_0x9335('0x13'),_0x22d440,'request\x20sent');_0x55d5c5(_0x50603b[_0x9335('0x1c')][_0x9335('0x1a')]);}})[_0x9335('0x1d')](function(_0x3aa1ea){logger[_0x9335('0x18')](_0x9335('0x13'),_0x22d440,_0x3aa1ea);_0xd419bb(_0x3aa1ea);});});}exports[_0x9335('0x1e')]=function(_0x172640){var _0x2717fe=this;return new Promise(function(_0x437732,_0x5c2fbe){return db[_0x9335('0x1f')]['update'](_0x172640[_0x9335('0x20')],{'raw':_0x172640[_0x9335('0x21')]?_0x172640[_0x9335('0x21')]['raw']===undefined?!![]:![]:!![],'individualHooks':!![],'where':_0x172640['options']?_0x172640[_0x9335('0x21')][_0x9335('0x22')]||null:null,'attributes':_0x172640[_0x9335('0x21')]?_0x172640[_0x9335('0x21')][_0x9335('0x23')]||null:null,'limit':_0x172640[_0x9335('0x21')]?_0x172640['options']['limit']||null:null})[_0x9335('0x24')](function(_0x37da43){logger['info'](_0x9335('0x1e'),_0x172640);logger[_0x9335('0x15')](_0x9335('0x1e'),_0x172640,JSON[_0x9335('0x17')](_0x37da43));_0x437732(_0x37da43);})['catch'](function(_0x1891ee){logger[_0x9335('0x18')](_0x9335('0x1e'),_0x1891ee['message'],_0x172640);_0x5c2fbe(_0x2717fe[_0x9335('0x18')](0x1f4,_0x1891ee[_0x9335('0x1a')]));});});};exports[_0x9335('0x25')]=function(_0x2c1342){return new Promise(function(_0x1c9a7a,_0x3578b9){return db[_0x9335('0x1f')][_0x9335('0x26')]({'where':_0x2c1342[_0x9335('0x21')]?_0x2c1342['options'][_0x9335('0x22')]||null:null})[_0x9335('0x24')](function(_0x569cb9){if(_0x569cb9){return _0x569cb9[_0x9335('0x27')](_0x2c1342[_0x9335('0x20')][_0x9335('0x28')],_[_0x9335('0x29')](_0x2c1342[_0x9335('0x20')],[_0x9335('0x28'),'id'])||{});}})[_0x9335('0x2a')](function(_0x5e994d){logger['info'](_0x9335('0x2b'),_0x2c1342);logger[_0x9335('0x15')](_0x9335('0x2b'),_0x2c1342,JSON['stringify'](_0x5e994d));_0x1c9a7a(_0x5e994d);})[_0x9335('0x1d')](function(_0xc92657){logger[_0x9335('0x18')]('AddTags',_0xc92657['message'],_0x2c1342);_0x3578b9(_this[_0x9335('0x18')](0x1f4,_0xc92657[_0x9335('0x1a')]));});});};
\ No newline at end of file
+var _0x757b=['code','message','UpdateChatInteraction','ChatInteraction','update','body','options','raw','where','attributes','catch','AddTagsToChatInteraction','find','then','addTags','ids','spread','AddTags','lodash','util','moment','bluebird','randomstring','ioredis','../../mysqldb','rpc','jayson/promise','http','redis','defaults','localhost','socket.io-emitter','register','request','info','ChatInteraction,\x20%s,\x20%s','request\x20sent','debug','ChatInteraction,\x20%s,\x20%s,\x20%s','stringify','error'];(function(_0x21a9d9,_0x4d5ac8){var _0x46adce=function(_0xfdd336){while(--_0xfdd336){_0x21a9d9['push'](_0x21a9d9['shift']());}};_0x46adce(++_0x4d5ac8);}(_0x757b,0x15a));var _0xb757=function(_0x3dd15e,_0x1f0015){_0x3dd15e=_0x3dd15e-0x0;var _0x231fd0=_0x757b[_0x3dd15e];return _0x231fd0;};'use strict';var _=require(_0xb757('0x0'));var util=require(_0xb757('0x1'));var moment=require(_0xb757('0x2'));var BPromise=require(_0xb757('0x3'));var rs=require(_0xb757('0x4'));var fs=require('fs');var Redis=require(_0xb757('0x5'));var db=require(_0xb757('0x6'))['db'];var utils=require('../../config/utils');var logger=require('../../config/logger')(_0xb757('0x7'));var config=require('../../config/environment');var jayson=require(_0xb757('0x8'));var client=jayson['client'][_0xb757('0x9')]({'port':0x232a});config[_0xb757('0xa')]=_[_0xb757('0xb')](config['redis'],{'host':_0xb757('0xc'),'port':0x18eb});var socket=require(_0xb757('0xd'))(new Redis(config['redis']));require('./chatInteraction.socket')[_0xb757('0xe')](socket);function respondWithRpcPromise(_0x730ab2,_0x5809dd,_0x490f05){return new BPromise(function(_0x367606,_0x36abfe){return client[_0xb757('0xf')](_0x730ab2,_0x490f05)['then'](function(_0x3467d7){logger[_0xb757('0x10')](_0xb757('0x11'),_0x5809dd,_0xb757('0x12'));logger[_0xb757('0x13')](_0xb757('0x14'),_0x5809dd,_0xb757('0x12'),JSON[_0xb757('0x15')](_0x3467d7));if(_0x3467d7[_0xb757('0x16')]){if(_0x3467d7[_0xb757('0x16')][_0xb757('0x17')]===0x1f4){logger[_0xb757('0x16')](_0xb757('0x11'),_0x5809dd,_0x3467d7[_0xb757('0x16')][_0xb757('0x18')]);return _0x36abfe(_0x3467d7[_0xb757('0x16')][_0xb757('0x18')]);}logger[_0xb757('0x16')](_0xb757('0x11'),_0x5809dd,_0x3467d7[_0xb757('0x16')][_0xb757('0x18')]);return _0x367606(_0x3467d7['error'][_0xb757('0x18')]);}else{logger[_0xb757('0x10')](_0xb757('0x11'),_0x5809dd,_0xb757('0x12'));_0x367606(_0x3467d7['result'][_0xb757('0x18')]);}})['catch'](function(_0x1c834b){logger[_0xb757('0x16')]('ChatInteraction,\x20%s,\x20%s',_0x5809dd,_0x1c834b);_0x36abfe(_0x1c834b);});});}exports[_0xb757('0x19')]=function(_0x18ee12){var _0x21ae0d=this;return new Promise(function(_0x1b9bb9,_0x2c0e74){return db[_0xb757('0x1a')][_0xb757('0x1b')](_0x18ee12[_0xb757('0x1c')],{'raw':_0x18ee12[_0xb757('0x1d')]?_0x18ee12[_0xb757('0x1d')][_0xb757('0x1e')]===undefined?!![]:![]:!![],'individualHooks':!![],'where':_0x18ee12[_0xb757('0x1d')]?_0x18ee12[_0xb757('0x1d')][_0xb757('0x1f')]||null:null,'attributes':_0x18ee12['options']?_0x18ee12['options'][_0xb757('0x20')]||null:null,'limit':_0x18ee12['options']?_0x18ee12[_0xb757('0x1d')]['limit']||null:null})['then'](function(_0x5ec059){logger['info'](_0xb757('0x19'),_0x18ee12);logger[_0xb757('0x13')](_0xb757('0x19'),_0x18ee12,JSON[_0xb757('0x15')](_0x5ec059));_0x1b9bb9(_0x5ec059);})[_0xb757('0x21')](function(_0x41cdc3){logger[_0xb757('0x16')](_0xb757('0x19'),_0x41cdc3[_0xb757('0x18')],_0x18ee12);_0x2c0e74(_0x21ae0d[_0xb757('0x16')](0x1f4,_0x41cdc3[_0xb757('0x18')]));});});};exports[_0xb757('0x22')]=function(_0x4d706d){return new Promise(function(_0x17738a,_0x1c4370){return db[_0xb757('0x1a')][_0xb757('0x23')]({'where':_0x4d706d[_0xb757('0x1d')]?_0x4d706d[_0xb757('0x1d')][_0xb757('0x1f')]||null:null})[_0xb757('0x24')](function(_0x5e9ca7){if(_0x5e9ca7){return _0x5e9ca7[_0xb757('0x25')](_0x4d706d[_0xb757('0x1c')][_0xb757('0x26')],_['omit'](_0x4d706d[_0xb757('0x1c')],[_0xb757('0x26'),'id'])||{});}})[_0xb757('0x27')](function(_0x1eee7e){logger['info'](_0xb757('0x28'),_0x4d706d);logger[_0xb757('0x13')]('AddTags',_0x4d706d,JSON[_0xb757('0x15')](_0x1eee7e));_0x17738a(_0x1eee7e);})[_0xb757('0x21')](function(_0x582f1b){logger['error'](_0xb757('0x28'),_0x582f1b[_0xb757('0x18')],_0x4d706d);_0x1c4370(_this[_0xb757('0x16')](0x1f4,_0x582f1b['message']));});});};
\ No newline at end of file
diff --git a/server/api/chatInteraction/chatInteraction.socket.js b/server/api/chatInteraction/chatInteraction.socket.js
index 21c4624..054b451 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 _0xee30=['register','length','chatInteraction:','./chatInteraction.events','save','remove','update','emit','removeListener'];(function(_0x449c4e,_0x4e3f3f){var _0x1b2c83=function(_0x2a209f){while(--_0x2a209f){_0x449c4e['push'](_0x449c4e['shift']());}};_0x1b2c83(++_0x4e3f3f);}(_0xee30,0x159));var _0x0ee3=function(_0x374ce7,_0x396ba1){_0x374ce7=_0x374ce7-0x0;var _0x44ad78=_0xee30[_0x374ce7];return _0x44ad78;};'use strict';var ChatInteractionEvents=require(_0x0ee3('0x0'));var events=[_0x0ee3('0x1'),_0x0ee3('0x2'),_0x0ee3('0x3')];function createListener(_0x423d03,_0xd54808){return function(_0x4cd8c5){_0xd54808[_0x0ee3('0x4')](_0x423d03,_0x4cd8c5);};}function removeListener(_0x304ab1,_0x37ae04){return function(){ChatInteractionEvents[_0x0ee3('0x5')](_0x304ab1,_0x37ae04);};}exports[_0x0ee3('0x6')]=function(_0xc9dc91){for(var _0x289ea3=0x0,_0x41adbc=events[_0x0ee3('0x7')];_0x289ea3<_0x41adbc;_0x289ea3++){var _0x22a5c7=events[_0x289ea3];var _0x306512=createListener(_0x0ee3('0x8')+_0x22a5c7,_0xc9dc91);ChatInteractionEvents['on'](_0x22a5c7,_0x306512);}};
\ No newline at end of file
+var _0xf114=['length','chatInteraction:','./chatInteraction.events','save','update','removeListener','register'];(function(_0x191650,_0x25452b){var _0x540557=function(_0x37afac){while(--_0x37afac){_0x191650['push'](_0x191650['shift']());}};_0x540557(++_0x25452b);}(_0xf114,0x198));var _0x4f11=function(_0x43def2,_0x155df6){_0x43def2=_0x43def2-0x0;var _0x2ae7d1=_0xf114[_0x43def2];return _0x2ae7d1;};'use strict';var ChatInteractionEvents=require(_0x4f11('0x0'));var events=[_0x4f11('0x1'),'remove',_0x4f11('0x2')];function createListener(_0x4aef7b,_0x1bf028){return function(_0x16be09){_0x1bf028['emit'](_0x4aef7b,_0x16be09);};}function removeListener(_0x3db8d6,_0x22a942){return function(){ChatInteractionEvents[_0x4f11('0x3')](_0x3db8d6,_0x22a942);};}exports[_0x4f11('0x4')]=function(_0x2ac7d7){for(var _0x2e43aa=0x0,_0x1257b6=events[_0x4f11('0x5')];_0x2e43aa<_0x1257b6;_0x2e43aa++){var _0x60fd41=events[_0x2e43aa];var _0x5f3a3c=createListener(_0x4f11('0x6')+_0x60fd41,_0x2ac7d7);ChatInteractionEvents['on'](_0x60fd41,_0x5f3a3c);}};
\ No newline at end of file
diff --git a/server/api/chatInteraction/index.js b/server/api/chatInteraction/index.js
index 2b19117..f967a23 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 _0x1175=['create','diskStorage','root','server/files/attachments/','format','%s-%s','originalname','/:id/attachment_upload','single','file','addMessage','post','tracked','chat','chatinteraction:addtags','addTags','put','chatinteraction:update','update','/:id/custom_update','/:id/close','close','delete','chatinteraction:destroy','destroy','/:id/tags','exports','multer','util','path','connect-timeout','Router','../../components/interaction/service','../../config/environment','./chatInteraction.controller','index','get','/describe','isAuthenticated','describe','/:id','show','/:id/attachment_download','attachmentDownload','/:id/messages','getMessages','isChatInteractionAuthorized','getMyMessages','/:id/download','download'];(function(_0x5e5671,_0x457d56){var _0x3035f8=function(_0x3397e4){while(--_0x3397e4){_0x5e5671['push'](_0x5e5671['shift']());}};_0x3035f8(++_0x457d56);}(_0x1175,0x1dd));var _0x5117=function(_0x1cefe9,_0x3c2de7){_0x1cefe9=_0x1cefe9-0x0;var _0x3ae4f3=_0x1175[_0x1cefe9];return _0x3ae4f3;};'use strict';var multer=require(_0x5117('0x0'));var util=require(_0x5117('0x1'));var path=require(_0x5117('0x2'));var timeout=require(_0x5117('0x3'));var express=require('express');var router=express[_0x5117('0x4')]();var auth=require('../../components/auth/service');var interaction=require(_0x5117('0x5'));var config=require(_0x5117('0x6'));var controller=require(_0x5117('0x7'));router['get']('/',auth['isAuthenticated'](),controller[_0x5117('0x8')]);router[_0x5117('0x9')](_0x5117('0xa'),auth[_0x5117('0xb')](),controller[_0x5117('0xc')]);router['get'](_0x5117('0xd'),auth['isChatInteractionAuthorized'](),controller[_0x5117('0xe')]);router[_0x5117('0x9')](_0x5117('0xf'),auth['isChatInteractionAuthorized'](),controller[_0x5117('0x10')]);router[_0x5117('0x9')](_0x5117('0x11'),auth[_0x5117('0xb')](),controller[_0x5117('0x12')]);router[_0x5117('0x9')]('/:id/my_messages',auth[_0x5117('0x13')](),controller[_0x5117('0x14')]);router['get'](_0x5117('0x15'),auth['isAuthenticated'](),controller[_0x5117('0x16')]);router['post']('/',auth[_0x5117('0xb')](),controller[_0x5117('0x17')]);var upload=multer({'storage':multer[_0x5117('0x18')]({'destination':function(_0x493303,_0x291f15,_0x4cc88d){_0x4cc88d(null,path['join'](config[_0x5117('0x19')],_0x5117('0x1a')));},'filename':function(_0x2f6129,_0x529e93,_0x15816c){_0x15816c(null,util[_0x5117('0x1b')](_0x5117('0x1c'),Date['now'](),_0x529e93[_0x5117('0x1d')]['replace'](/[+@&\/\\#,+()$~%'":*?<>{}\s\\|]/g,'-')));}})});router['post'](_0x5117('0x1e'),upload[_0x5117('0x1f')](_0x5117('0x20')),controller['attachmentUpload']);router['post'](_0x5117('0x11'),auth[_0x5117('0x13')](),controller[_0x5117('0x21')]);router[_0x5117('0x22')]('/:id/tags',auth[_0x5117('0xb')](),interaction[_0x5117('0x23')](_0x5117('0x24'),_0x5117('0x25')),controller[_0x5117('0x26')]);router[_0x5117('0x27')](_0x5117('0xd'),auth[_0x5117('0xb')](),interaction[_0x5117('0x23')](_0x5117('0x24'),_0x5117('0x28')),controller[_0x5117('0x29')]);router[_0x5117('0x27')](_0x5117('0x2a'),controller['customUpdate']);router['put']('/:id/abandon',auth['isChatInteractionAuthorized'](),controller['abandon']);router[_0x5117('0x27')](_0x5117('0x2b'),controller[_0x5117('0x2c')]);router[_0x5117('0x2d')](_0x5117('0xd'),auth[_0x5117('0xb')](),interaction[_0x5117('0x23')](_0x5117('0x24'),_0x5117('0x2e')),controller[_0x5117('0x2f')]);router[_0x5117('0x2d')](_0x5117('0x30'),auth[_0x5117('0xb')](),controller['removeTags']);module[_0x5117('0x31')]=router;
\ No newline at end of file
+var _0xcc44=['originalname','single','file','attachmentUpload','post','addMessage','/:id/tags','tracked','chat','chatinteraction:addtags','addTags','put','chatinteraction:update','update','customUpdate','/:id/abandon','abandon','close','delete','destroy','exports','multer','path','express','Router','../../components/auth/service','../../components/interaction/service','../../config/environment','./chatInteraction.controller','get','isAuthenticated','/describe','describe','/:id','show','/:id/attachment_download','isChatInteractionAuthorized','attachmentDownload','/:id/messages','getMessages','getMyMessages','/:id/download','download','diskStorage','join','server/files/attachments/','%s-%s','now'];(function(_0x915de9,_0xabf9e5){var _0x274129=function(_0x27fd79){while(--_0x27fd79){_0x915de9['push'](_0x915de9['shift']());}};_0x274129(++_0xabf9e5);}(_0xcc44,0x165));var _0x4cc4=function(_0x17d69e,_0x27717d){_0x17d69e=_0x17d69e-0x0;var _0x4b153f=_0xcc44[_0x17d69e];return _0x4b153f;};'use strict';var multer=require(_0x4cc4('0x0'));var util=require('util');var path=require(_0x4cc4('0x1'));var timeout=require('connect-timeout');var express=require(_0x4cc4('0x2'));var router=express[_0x4cc4('0x3')]();var auth=require(_0x4cc4('0x4'));var interaction=require(_0x4cc4('0x5'));var config=require(_0x4cc4('0x6'));var controller=require(_0x4cc4('0x7'));router[_0x4cc4('0x8')]('/',auth[_0x4cc4('0x9')](),controller['index']);router['get'](_0x4cc4('0xa'),auth[_0x4cc4('0x9')](),controller[_0x4cc4('0xb')]);router[_0x4cc4('0x8')](_0x4cc4('0xc'),auth['isChatInteractionAuthorized'](),controller[_0x4cc4('0xd')]);router[_0x4cc4('0x8')](_0x4cc4('0xe'),auth[_0x4cc4('0xf')](),controller[_0x4cc4('0x10')]);router[_0x4cc4('0x8')](_0x4cc4('0x11'),auth[_0x4cc4('0x9')](),controller[_0x4cc4('0x12')]);router[_0x4cc4('0x8')]('/:id/my_messages',auth[_0x4cc4('0xf')](),controller[_0x4cc4('0x13')]);router['get'](_0x4cc4('0x14'),auth[_0x4cc4('0x9')](),controller[_0x4cc4('0x15')]);router['post']('/',auth[_0x4cc4('0x9')](),controller['create']);var upload=multer({'storage':multer[_0x4cc4('0x16')]({'destination':function(_0x1b342f,_0x1c4a10,_0x9847f){_0x9847f(null,path[_0x4cc4('0x17')](config['root'],_0x4cc4('0x18')));},'filename':function(_0x1aa82c,_0x6b9ff4,_0x4f8736){_0x4f8736(null,util['format'](_0x4cc4('0x19'),Date[_0x4cc4('0x1a')](),_0x6b9ff4[_0x4cc4('0x1b')]['replace'](/[+@&\/\\#,+()$~%'":*?<>{}\s\\|]/g,'-')));}})});router['post']('/:id/attachment_upload',upload[_0x4cc4('0x1c')](_0x4cc4('0x1d')),controller[_0x4cc4('0x1e')]);router[_0x4cc4('0x1f')](_0x4cc4('0x11'),auth[_0x4cc4('0xf')](),controller[_0x4cc4('0x20')]);router[_0x4cc4('0x1f')](_0x4cc4('0x21'),auth['isAuthenticated'](),interaction[_0x4cc4('0x22')](_0x4cc4('0x23'),_0x4cc4('0x24')),controller[_0x4cc4('0x25')]);router[_0x4cc4('0x26')]('/:id',auth[_0x4cc4('0x9')](),interaction['tracked'](_0x4cc4('0x23'),_0x4cc4('0x27')),controller[_0x4cc4('0x28')]);router[_0x4cc4('0x26')]('/:id/custom_update',controller[_0x4cc4('0x29')]);router[_0x4cc4('0x26')](_0x4cc4('0x2a'),auth[_0x4cc4('0xf')](),controller[_0x4cc4('0x2b')]);router[_0x4cc4('0x26')]('/:id/close',controller[_0x4cc4('0x2c')]);router[_0x4cc4('0x2d')](_0x4cc4('0xc'),auth[_0x4cc4('0x9')](),interaction['tracked'](_0x4cc4('0x23'),'chatinteraction:destroy'),controller[_0x4cc4('0x2e')]);router[_0x4cc4('0x2d')](_0x4cc4('0x21'),auth['isAuthenticated'](),controller['removeTags']);module[_0x4cc4('0x2f')]=router;
\ No newline at end of file
diff --git a/server/api/chatInternalMessage/chatInternalMessage.attributes.js b/server/api/chatInternalMessage/chatInternalMessage.attributes.js
index 7143212..cb9dd73 100644
--- a/server/api/chatInternalMessage/chatInternalMessage.attributes.js
+++ b/server/api/chatInternalMessage/chatInternalMessage.attributes.js
@@ -15,4 +15,4 @@
// * treaties. The SOFTWARE PRODUCT is licensed, not sold. *
// * *
// *************************************************************************
-var _0xdb28=['medium','INTEGER','sequelize','exports','TEXT'];(function(_0x496761,_0x496786){var _0x1ec7db=function(_0x430a69){while(--_0x430a69){_0x496761['push'](_0x496761['shift']());}};_0x1ec7db(++_0x496786);}(_0xdb28,0x106));var _0x8db2=function(_0x27c202,_0x183475){_0x27c202=_0x27c202-0x0;var _0x57bfc3=_0xdb28[_0x27c202];return _0x57bfc3;};'use strict';var Sequelize=require(_0x8db2('0x0'));module[_0x8db2('0x1')]={'body':{'type':Sequelize[_0x8db2('0x2')](_0x8db2('0x3')),'allowNull':![]},'read':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'ChatInternalMessageId':{'type':Sequelize[_0x8db2('0x4')]}};
\ No newline at end of file
+var _0xda2d=['medium','BOOLEAN','INTEGER','exports','TEXT'];(function(_0x88a454,_0x17f887){var _0x4ab85a=function(_0x12885){while(--_0x12885){_0x88a454['push'](_0x88a454['shift']());}};_0x4ab85a(++_0x17f887);}(_0xda2d,0x102));var _0xdda2=function(_0x413f7a,_0x33b86c){_0x413f7a=_0x413f7a-0x0;var _0x446ad1=_0xda2d[_0x413f7a];return _0x446ad1;};'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 34b3254..1864078 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 _0xa0c8=['html-pdf','eml-format','fast-json-patch','moment','util','path','sox','ejs','lodash','crypto','desk.js','to-csv','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/logger','api','../../config/utils','defaults','redis','localhost','socket.io-emitter','./chatInternalMessage.socket','register','sendStatus','status','json','count','offset','limit','set','Content-Range','save','update','then','destroy','end','error','name','send','index','map','ChatInternalMessage','rawAttributes','fieldName','type','key','model','query','filters','intersection','fields','attributes','length','nolimit','order','sort','where','filter','merge','VIRTUAL','options','includeAll','include','findAll','rows','catch','find','create','body','params','describe','get','messages','lastMessageAt','lastMessage','format','YYYY-MM-DD\x20HH:mm:ss','getUsers','User','admin','user','fullname','role','userpic','internal','lastLoginAt','allowmessenger','showWebBar','VoiceQueue','Unable\x20to\x20retrieve\x20the\x20current\x20user','UserProfileSection','Agents','UserProfileResource','isEmpty','agent','push','createdAt','FromId','ToId','read','-createdAt','all'];(function(_0x14add3,_0x13ce8d){var _0x4a174f=function(_0x2b3ed7){while(--_0x2b3ed7){_0x14add3['push'](_0x14add3['shift']());}};_0x4a174f(++_0x13ce8d);}(_0xa0c8,0x6a));var _0x8a0c=function(_0x531d15,_0x599af5){_0x531d15=_0x531d15-0x0;var _0x271a18=_0xa0c8[_0x531d15];return _0x271a18;};'use strict';var pdf=require(_0x8a0c('0x0'));var emlformat=require(_0x8a0c('0x1'));var rimraf=require('rimraf');var zipdir=require('zip-dir');var jsonpatch=require(_0x8a0c('0x2'));var rp=require('request-promise');var moment=require(_0x8a0c('0x3'));var BPromise=require('bluebird');var Mustache=require('mustache');var util=require(_0x8a0c('0x4'));var path=require(_0x8a0c('0x5'));var sox=require(_0x8a0c('0x6'));var csv=require('to-csv');var ejs=require(_0x8a0c('0x7'));var fs=require('fs');var _=require(_0x8a0c('0x8'));var squel=require('squel');var crypto=require(_0x8a0c('0x9'));var jsforce=require('jsforce');var deskjs=require(_0x8a0c('0xa'));var toCsv=require(_0x8a0c('0xb'));var querystring=require(_0x8a0c('0xc'));var Papa=require(_0x8a0c('0xd'));var Redis=require(_0x8a0c('0xe'));var authService=require(_0x8a0c('0xf'));var qs=require(_0x8a0c('0x10'));var as=require(_0x8a0c('0x11'));var hardwareService=require('../../config/license/hardware');var logger=require(_0x8a0c('0x12'))(_0x8a0c('0x13'));var utils=require(_0x8a0c('0x14'));var config=require('../../config/environment');var db=require('../../mysqldb')['db'];config['redis']=_[_0x8a0c('0x15')](config[_0x8a0c('0x16')],{'host':_0x8a0c('0x17'),'port':0x18eb});var socket=require(_0x8a0c('0x18'))(new Redis(config[_0x8a0c('0x16')]));require(_0x8a0c('0x19'))[_0x8a0c('0x1a')](socket);function respondWithStatusCode(_0xc30572,_0x14551c){_0x14551c=_0x14551c||0xcc;return function(_0x46747e){if(_0x46747e){return _0xc30572[_0x8a0c('0x1b')](_0x14551c);}return _0xc30572['status'](_0x14551c)['end']();};}function respondWithResult(_0x268a4d,_0x208933){_0x208933=_0x208933||0xc8;return function(_0x19435f){if(_0x19435f){return _0x268a4d[_0x8a0c('0x1c')](_0x208933)[_0x8a0c('0x1d')](_0x19435f);}};}function respondWithFilteredResult(_0x565526,_0x8f07a2){return function(_0x28e010){if(_0x28e010){var _0x4fe661=_0x28e010[_0x8a0c('0x1e')],_0x21a134=_0x8f07a2[_0x8a0c('0x1f')],_0x4253a7=_0x8f07a2[_0x8a0c('0x1f')]+_0x8f07a2[_0x8a0c('0x20')],_0x54625a;if(_0x4253a7>=_0x4fe661){_0x4253a7=_0x4fe661;_0x54625a=0xc8;}else{_0x54625a=0xce;}_0x565526[_0x8a0c('0x1c')](_0x54625a);return _0x565526[_0x8a0c('0x21')](_0x8a0c('0x22'),_0x21a134+'-'+_0x4253a7+'/'+_0x4fe661)[_0x8a0c('0x1d')](_0x28e010);}return null;};}function patchUpdates(_0x264317){return function(_0x59606b){try{jsonpatch['apply'](_0x59606b,_0x264317,!![]);}catch(_0x48d737){return BPromise['reject'](_0x48d737);}return _0x59606b[_0x8a0c('0x23')]();};}function saveUpdates(_0x1c717a,_0x4a1f62){return function(_0x474d21){if(_0x474d21){return _0x474d21[_0x8a0c('0x24')](_0x1c717a)[_0x8a0c('0x25')](function(_0x5a3f94){return _0x5a3f94;});}return null;};}function removeEntity(_0x3f6a51,_0x2bc444){return function(_0x5bae48){if(_0x5bae48){return _0x5bae48[_0x8a0c('0x26')]()[_0x8a0c('0x25')](function(){_0x3f6a51[_0x8a0c('0x1c')](0xcc)[_0x8a0c('0x27')]();});}};}function handleEntityNotFound(_0x343a25,_0x19c655){return function(_0x1d01bf){if(!_0x1d01bf){_0x343a25[_0x8a0c('0x1b')](0x194);}return _0x1d01bf;};}function handleError(_0x55e6d0,_0x1cc9ac){_0x1cc9ac=_0x1cc9ac||0x1f4;return function(_0x2f4d21){logger[_0x8a0c('0x28')](_0x2f4d21['stack']);if(_0x2f4d21['name']){delete _0x2f4d21[_0x8a0c('0x29')];}_0x55e6d0[_0x8a0c('0x1c')](_0x1cc9ac)[_0x8a0c('0x2a')](_0x2f4d21);};}exports[_0x8a0c('0x2b')]=function(_0x52c30e,_0xc46390){var _0x3a227f={},_0x284282={},_0xa70457={'count':0x0,'rows':[]};var _0x5325a3=_[_0x8a0c('0x2c')](db[_0x8a0c('0x2d')][_0x8a0c('0x2e')],function(_0x2698d0){return{'name':_0x2698d0[_0x8a0c('0x2f')],'type':_0x2698d0[_0x8a0c('0x30')][_0x8a0c('0x31')]};});_0x284282[_0x8a0c('0x32')]=_[_0x8a0c('0x2c')](_0x5325a3,'name');_0x284282[_0x8a0c('0x33')]=_['keys'](_0x52c30e[_0x8a0c('0x33')]);_0x284282[_0x8a0c('0x34')]=_[_0x8a0c('0x35')](_0x284282[_0x8a0c('0x32')],_0x284282[_0x8a0c('0x33')]);_0x3a227f['attributes']=_['intersection'](_0x284282[_0x8a0c('0x32')],qs['fields'](_0x52c30e[_0x8a0c('0x33')][_0x8a0c('0x36')]));_0x3a227f[_0x8a0c('0x37')]=_0x3a227f[_0x8a0c('0x37')][_0x8a0c('0x38')]?_0x3a227f[_0x8a0c('0x37')]:_0x284282[_0x8a0c('0x32')];if(!_0x52c30e[_0x8a0c('0x33')]['hasOwnProperty'](_0x8a0c('0x39'))){_0x3a227f[_0x8a0c('0x20')]=qs[_0x8a0c('0x20')](_0x52c30e['query'][_0x8a0c('0x20')]);_0x3a227f['offset']=qs[_0x8a0c('0x1f')](_0x52c30e[_0x8a0c('0x33')][_0x8a0c('0x1f')]);}_0x3a227f[_0x8a0c('0x3a')]=qs['sort'](_0x52c30e['query'][_0x8a0c('0x3b')]);_0x3a227f[_0x8a0c('0x3c')]=qs['filters'](_['pick'](_0x52c30e[_0x8a0c('0x33')],_0x284282[_0x8a0c('0x34')]));if(_0x52c30e['query'][_0x8a0c('0x3d')]){_0x3a227f[_0x8a0c('0x3c')]=_[_0x8a0c('0x3e')](_0x3a227f[_0x8a0c('0x3c')],{'$or':_[_0x8a0c('0x2c')](_0x5325a3,function(_0x3cbe2f){if(_0x3cbe2f[_0x8a0c('0x30')]!==_0x8a0c('0x3f')){var _0x2f8175={};_0x2f8175[_0x3cbe2f[_0x8a0c('0x29')]]={'$like':'%'+_0x52c30e[_0x8a0c('0x33')][_0x8a0c('0x3d')]+'%'};return _0x2f8175;}})});}_0x3a227f=_[_0x8a0c('0x3e')]({},_0x3a227f,_0x52c30e[_0x8a0c('0x40')]);var _0x224e2b={'where':_0x3a227f[_0x8a0c('0x3c')]};return db[_0x8a0c('0x2d')][_0x8a0c('0x1e')](_0x224e2b)[_0x8a0c('0x25')](function(_0x1cd1c4){_0xa70457[_0x8a0c('0x1e')]=_0x1cd1c4;if(_0x52c30e['query'][_0x8a0c('0x41')]){_0x3a227f[_0x8a0c('0x42')]=[{'all':!![]}];}return db[_0x8a0c('0x2d')][_0x8a0c('0x43')](_0x3a227f);})[_0x8a0c('0x25')](function(_0x3d8c5d){_0xa70457[_0x8a0c('0x44')]=_0x3d8c5d;return _0xa70457;})[_0x8a0c('0x25')](respondWithFilteredResult(_0xc46390,_0x3a227f))[_0x8a0c('0x45')](handleError(_0xc46390,null));};exports['show']=function(_0x1753e1,_0x496204){var _0x1c9c4f={'raw':!![],'where':{'id':_0x1753e1['params']['id']}},_0xbf1bb3={};_0xbf1bb3[_0x8a0c('0x32')]=_['keys'](db['ChatInternalMessage'][_0x8a0c('0x2e')]);_0xbf1bb3[_0x8a0c('0x33')]=_['keys'](_0x1753e1[_0x8a0c('0x33')]);_0xbf1bb3['filters']=_[_0x8a0c('0x35')](_0xbf1bb3['model'],_0xbf1bb3['query']);_0x1c9c4f[_0x8a0c('0x37')]=_['intersection'](_0xbf1bb3['model'],qs[_0x8a0c('0x36')](_0x1753e1[_0x8a0c('0x33')][_0x8a0c('0x36')]));_0x1c9c4f['attributes']=_0x1c9c4f[_0x8a0c('0x37')][_0x8a0c('0x38')]?_0x1c9c4f['attributes']:_0xbf1bb3['model'];if(_0x1753e1['query']['includeAll']){_0x1c9c4f[_0x8a0c('0x42')]=[{'all':!![]}];}_0x1c9c4f=_[_0x8a0c('0x3e')]({},_0x1c9c4f,_0x1753e1[_0x8a0c('0x40')]);return db[_0x8a0c('0x2d')][_0x8a0c('0x46')](_0x1c9c4f)[_0x8a0c('0x25')](handleEntityNotFound(_0x496204,null))['then'](respondWithResult(_0x496204,null))[_0x8a0c('0x45')](handleError(_0x496204,null));};exports[_0x8a0c('0x47')]=function(_0x3f3b6a,_0x134d32){return db['ChatInternalMessage'][_0x8a0c('0x47')](_0x3f3b6a['body'],{})[_0x8a0c('0x25')](respondWithResult(_0x134d32,0xc9))[_0x8a0c('0x45')](handleError(_0x134d32,null));};exports['update']=function(_0x365340,_0x378146){if(_0x365340[_0x8a0c('0x48')]['id']){delete _0x365340[_0x8a0c('0x48')]['id'];}return db['ChatInternalMessage'][_0x8a0c('0x46')]({'where':{'id':_0x365340[_0x8a0c('0x49')]['id']}})[_0x8a0c('0x25')](handleEntityNotFound(_0x378146,null))['then'](saveUpdates(_0x365340[_0x8a0c('0x48')],null))[_0x8a0c('0x25')](respondWithResult(_0x378146,null))[_0x8a0c('0x45')](handleError(_0x378146,null));};exports[_0x8a0c('0x26')]=function(_0x47d013,_0x32fdc4){return db[_0x8a0c('0x2d')][_0x8a0c('0x46')]({'where':{'id':_0x47d013[_0x8a0c('0x49')]['id']}})[_0x8a0c('0x25')](handleEntityNotFound(_0x32fdc4,null))['then'](removeEntity(_0x32fdc4,null))[_0x8a0c('0x45')](handleError(_0x32fdc4,null));};exports[_0x8a0c('0x4a')]=function(_0x2b237c,_0x26b9ea){return db[_0x8a0c('0x2d')][_0x8a0c('0x4a')]()['then'](respondWithResult(_0x26b9ea,null))['catch'](handleError(_0x26b9ea,null));};function wrapUser(_0x4b5e0b){return function(_0x41bb7d){var _0x219ec7=_0x4b5e0b[_0x8a0c('0x4b')]({'plain':!![]});_0x219ec7[_0x8a0c('0x4c')]=[];if(_0x41bb7d){_0x219ec7[_0x8a0c('0x4d')]=_0x41bb7d['createdAt'];_0x219ec7[_0x8a0c('0x4e')]=_0x41bb7d;}else{_0x219ec7[_0x8a0c('0x4d')]=moment(0x0)[_0x8a0c('0x4f')](_0x8a0c('0x50'));_0x219ec7['lastMessage']={};}return _0x219ec7;};}exports[_0x8a0c('0x51')]=function(_0x366323,_0x7ca66,_0x200878){var _0x378fbf=[];return db[_0x8a0c('0x52')]['findAll']({'where':{'role':['agent',_0x8a0c('0x53'),_0x8a0c('0x54')]},'attributes':['id',_0x8a0c('0x55'),'name',_0x8a0c('0x56'),_0x8a0c('0x57'),_0x8a0c('0x58'),'online',_0x8a0c('0x59'),_0x8a0c('0x5a'),_0x8a0c('0x5b')],'order':qs['sort']('-online'),'include':[{'model':db[_0x8a0c('0x5c')],'as':'VoiceQueues','attributes':['id',_0x8a0c('0x29'),'type'],'through':{'attributes':[]}}]})[_0x8a0c('0x25')](function(_0x401ba8){if(_0x401ba8){var _0x554fd4=_0x366323['user'][_0x8a0c('0x4b')]({'plain':!![]});if(!_0x554fd4)throw new Error(_0x8a0c('0x5d'));if(_0x554fd4[_0x8a0c('0x56')]==='user'){return db[_0x8a0c('0x5e')][_0x8a0c('0x46')]({'where':{'name':_0x8a0c('0x5f'),'userProfileId':_0x554fd4['userProfileId']},'raw':!![]})['then'](function(_0x232b7b){if(_0x232b7b){if(_0x232b7b['autoAssociation']===0x0){return db[_0x8a0c('0x60')][_0x8a0c('0x43')]({'where':{'sectionId':_0x232b7b['id']},'raw':!![]})[_0x8a0c('0x25')](function(_0x4421e2){var _0x2877d7=[];if(_[_0x8a0c('0x61')](_0x4421e2)){_0x2877d7=_[_0x8a0c('0x3d')](_0x401ba8,function(_0x25f67b){if(_0x25f67b[_0x8a0c('0x56')]!==_0x8a0c('0x62')){return _0x25f67b;}});return _0x2877d7;}else{for(var _0xb67d1b=0x0;_0xb67d1b<_0x401ba8['length'];_0xb67d1b++){var _0x9fb041=_0x401ba8[_0xb67d1b];if(_0x9fb041[_0x8a0c('0x56')]===_0x8a0c('0x62')){var _0x3fa7cb=_[_0x8a0c('0x46')](_0x4421e2,function(_0x541277){return _0x541277['resourceId']===_0x9fb041['id'];});if(_0x3fa7cb)_0x2877d7['push'](_0x9fb041);}else{_0x2877d7[_0x8a0c('0x63')](_0x9fb041);}}return _0x2877d7;}});}else{return _0x401ba8;}}else{var _0x2539b9=_['filter'](_0x401ba8,function(_0x7f3983){if(_0x7f3983['role']!==_0x8a0c('0x62')){return _0x7f3983;}});return _0x2539b9;}});}else{return _0x401ba8;}}})[_0x8a0c('0x25')](function(_0x154bc4){var _0x20c629=[];if(_0x154bc4){_0x378fbf=_0x154bc4;for(var _0x495bf1=0x0;_0x495bf1<_0x154bc4[_0x8a0c('0x38')];_0x495bf1+=0x1){_0x378fbf[_0x495bf1][_0x8a0c('0x4c')]=[];_0x20c629[_0x8a0c('0x63')](db['ChatInternalMessage'][_0x8a0c('0x46')]({'where':{'FromId':[_0x366323[_0x8a0c('0x54')]['id'],_0x154bc4[_0x495bf1]['id']],'ToId':[_0x366323[_0x8a0c('0x54')]['id'],_0x154bc4[_0x495bf1]['id']],'ChatGroupId':null},'attributes':['id',_0x8a0c('0x64'),_0x8a0c('0x65'),_0x8a0c('0x66'),_0x8a0c('0x67'),_0x8a0c('0x48')],'order':qs[_0x8a0c('0x3b')](_0x8a0c('0x68')),'limit':0x1,'offset':0x0,'raw':!![]})[_0x8a0c('0x25')](wrapUser(_0x154bc4[_0x495bf1])));}return BPromise[_0x8a0c('0x69')](_0x20c629);}return[];})[_0x8a0c('0x25')](function(_0x20d540){return{'rows':_0x20d540,'count':_0x20d540[_0x8a0c('0x38')]};})['then'](respondWithResult(_0x7ca66,null))[_0x8a0c('0x45')](handleError(_0x7ca66,null));};
\ No newline at end of file
+var _0xb8f0=['UserProfileSection','userProfileId','filter','agent','resourceId','push','FromId','read','-createdAt','all','html-pdf','rimraf','zip-dir','fast-json-patch','moment','bluebird','util','path','sox','to-csv','ejs','lodash','crypto','jsforce','desk.js','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/environment','../../mysqldb','redis','defaults','localhost','socket.io-emitter','register','sendStatus','status','end','count','offset','limit','set','Content-Range','save','update','then','destroy','error','stack','name','send','index','map','ChatInternalMessage','rawAttributes','fieldName','type','query','keys','intersection','attributes','model','length','nolimit','order','sort','where','pick','merge','VIRTUAL','options','include','findAll','rows','catch','show','params','filters','fields','includeAll','find','create','body','describe','messages','lastMessageAt','createdAt','format','YYYY-MM-DD\x20HH:mm:ss','lastMessage','getUsers','fullname','role','internal','online','allowmessenger','showWebBar','-online','VoiceQueue','user','get','Unable\x20to\x20retrieve\x20the\x20current\x20user'];(function(_0x4b7b62,_0x4920a9){var _0x2280df=function(_0x21e1f8){while(--_0x21e1f8){_0x4b7b62['push'](_0x4b7b62['shift']());}};_0x2280df(++_0x4920a9);}(_0xb8f0,0x1b6));var _0x0b8f=function(_0x1dba64,_0x4f2752){_0x1dba64=_0x1dba64-0x0;var _0x3e2db3=_0xb8f0[_0x1dba64];return _0x3e2db3;};'use strict';var pdf=require(_0x0b8f('0x0'));var emlformat=require('eml-format');var rimraf=require(_0x0b8f('0x1'));var zipdir=require(_0x0b8f('0x2'));var jsonpatch=require(_0x0b8f('0x3'));var rp=require('request-promise');var moment=require(_0x0b8f('0x4'));var BPromise=require(_0x0b8f('0x5'));var Mustache=require('mustache');var util=require(_0x0b8f('0x6'));var path=require(_0x0b8f('0x7'));var sox=require(_0x0b8f('0x8'));var csv=require(_0x0b8f('0x9'));var ejs=require(_0x0b8f('0xa'));var fs=require('fs');var _=require(_0x0b8f('0xb'));var squel=require('squel');var crypto=require(_0x0b8f('0xc'));var jsforce=require(_0x0b8f('0xd'));var deskjs=require(_0x0b8f('0xe'));var toCsv=require(_0x0b8f('0x9'));var querystring=require(_0x0b8f('0xf'));var Papa=require(_0x0b8f('0x10'));var Redis=require(_0x0b8f('0x11'));var authService=require(_0x0b8f('0x12'));var qs=require('../../components/parsers/qs');var as=require(_0x0b8f('0x13'));var hardwareService=require(_0x0b8f('0x14'));var logger=require(_0x0b8f('0x15'))(_0x0b8f('0x16'));var utils=require('../../config/utils');var config=require(_0x0b8f('0x17'));var db=require(_0x0b8f('0x18'))['db'];config[_0x0b8f('0x19')]=_[_0x0b8f('0x1a')](config['redis'],{'host':_0x0b8f('0x1b'),'port':0x18eb});var socket=require(_0x0b8f('0x1c'))(new Redis(config['redis']));require('./chatInternalMessage.socket')[_0x0b8f('0x1d')](socket);function respondWithStatusCode(_0x1ac26f,_0x6d2585){_0x6d2585=_0x6d2585||0xcc;return function(_0x36842f){if(_0x36842f){return _0x1ac26f[_0x0b8f('0x1e')](_0x6d2585);}return _0x1ac26f[_0x0b8f('0x1f')](_0x6d2585)[_0x0b8f('0x20')]();};}function respondWithResult(_0x307929,_0x51fed4){_0x51fed4=_0x51fed4||0xc8;return function(_0x39d90b){if(_0x39d90b){return _0x307929[_0x0b8f('0x1f')](_0x51fed4)['json'](_0x39d90b);}};}function respondWithFilteredResult(_0x19ebf3,_0x3767f1){return function(_0x29b083){if(_0x29b083){var _0x4d1838=_0x29b083[_0x0b8f('0x21')],_0x5f302b=_0x3767f1['offset'],_0x37d82c=_0x3767f1[_0x0b8f('0x22')]+_0x3767f1[_0x0b8f('0x23')],_0x45e0fe;if(_0x37d82c>=_0x4d1838){_0x37d82c=_0x4d1838;_0x45e0fe=0xc8;}else{_0x45e0fe=0xce;}_0x19ebf3['status'](_0x45e0fe);return _0x19ebf3[_0x0b8f('0x24')](_0x0b8f('0x25'),_0x5f302b+'-'+_0x37d82c+'/'+_0x4d1838)['json'](_0x29b083);}return null;};}function patchUpdates(_0x41867f){return function(_0x62c06e){try{jsonpatch['apply'](_0x62c06e,_0x41867f,!![]);}catch(_0x40c1ad){return BPromise['reject'](_0x40c1ad);}return _0x62c06e[_0x0b8f('0x26')]();};}function saveUpdates(_0x2a3945,_0x3682da){return function(_0x4b130f){if(_0x4b130f){return _0x4b130f[_0x0b8f('0x27')](_0x2a3945)[_0x0b8f('0x28')](function(_0x551fbd){return _0x551fbd;});}return null;};}function removeEntity(_0x9c71f2,_0x3d4b76){return function(_0x2313ef){if(_0x2313ef){return _0x2313ef[_0x0b8f('0x29')]()[_0x0b8f('0x28')](function(){_0x9c71f2[_0x0b8f('0x1f')](0xcc)[_0x0b8f('0x20')]();});}};}function handleEntityNotFound(_0x23f3d0,_0x3638cf){return function(_0x173eba){if(!_0x173eba){_0x23f3d0[_0x0b8f('0x1e')](0x194);}return _0x173eba;};}function handleError(_0x569c35,_0x39457c){_0x39457c=_0x39457c||0x1f4;return function(_0x446e8c){logger[_0x0b8f('0x2a')](_0x446e8c[_0x0b8f('0x2b')]);if(_0x446e8c[_0x0b8f('0x2c')]){delete _0x446e8c[_0x0b8f('0x2c')];}_0x569c35[_0x0b8f('0x1f')](_0x39457c)[_0x0b8f('0x2d')](_0x446e8c);};}exports[_0x0b8f('0x2e')]=function(_0x3437eb,_0x356e4c){var _0x35096e={},_0x3522a9={},_0x540659={'count':0x0,'rows':[]};var _0x3f9cc3=_[_0x0b8f('0x2f')](db[_0x0b8f('0x30')][_0x0b8f('0x31')],function(_0x37f5bd){return{'name':_0x37f5bd[_0x0b8f('0x32')],'type':_0x37f5bd[_0x0b8f('0x33')]['key']};});_0x3522a9['model']=_[_0x0b8f('0x2f')](_0x3f9cc3,_0x0b8f('0x2c'));_0x3522a9[_0x0b8f('0x34')]=_[_0x0b8f('0x35')](_0x3437eb[_0x0b8f('0x34')]);_0x3522a9['filters']=_[_0x0b8f('0x36')](_0x3522a9['model'],_0x3522a9['query']);_0x35096e[_0x0b8f('0x37')]=_[_0x0b8f('0x36')](_0x3522a9[_0x0b8f('0x38')],qs['fields'](_0x3437eb[_0x0b8f('0x34')]['fields']));_0x35096e[_0x0b8f('0x37')]=_0x35096e[_0x0b8f('0x37')][_0x0b8f('0x39')]?_0x35096e[_0x0b8f('0x37')]:_0x3522a9[_0x0b8f('0x38')];if(!_0x3437eb[_0x0b8f('0x34')]['hasOwnProperty'](_0x0b8f('0x3a'))){_0x35096e[_0x0b8f('0x23')]=qs[_0x0b8f('0x23')](_0x3437eb[_0x0b8f('0x34')][_0x0b8f('0x23')]);_0x35096e[_0x0b8f('0x22')]=qs[_0x0b8f('0x22')](_0x3437eb['query'][_0x0b8f('0x22')]);}_0x35096e[_0x0b8f('0x3b')]=qs[_0x0b8f('0x3c')](_0x3437eb[_0x0b8f('0x34')][_0x0b8f('0x3c')]);_0x35096e[_0x0b8f('0x3d')]=qs['filters'](_[_0x0b8f('0x3e')](_0x3437eb[_0x0b8f('0x34')],_0x3522a9['filters']));if(_0x3437eb['query']['filter']){_0x35096e[_0x0b8f('0x3d')]=_[_0x0b8f('0x3f')](_0x35096e['where'],{'$or':_[_0x0b8f('0x2f')](_0x3f9cc3,function(_0x5e442f){if(_0x5e442f['type']!==_0x0b8f('0x40')){var _0x3ae612={};_0x3ae612[_0x5e442f[_0x0b8f('0x2c')]]={'$like':'%'+_0x3437eb[_0x0b8f('0x34')]['filter']+'%'};return _0x3ae612;}})});}_0x35096e=_[_0x0b8f('0x3f')]({},_0x35096e,_0x3437eb[_0x0b8f('0x41')]);var _0x18652a={'where':_0x35096e[_0x0b8f('0x3d')]};return db[_0x0b8f('0x30')][_0x0b8f('0x21')](_0x18652a)['then'](function(_0x1e22cb){_0x540659[_0x0b8f('0x21')]=_0x1e22cb;if(_0x3437eb[_0x0b8f('0x34')]['includeAll']){_0x35096e[_0x0b8f('0x42')]=[{'all':!![]}];}return db[_0x0b8f('0x30')][_0x0b8f('0x43')](_0x35096e);})[_0x0b8f('0x28')](function(_0x3db2b8){_0x540659[_0x0b8f('0x44')]=_0x3db2b8;return _0x540659;})[_0x0b8f('0x28')](respondWithFilteredResult(_0x356e4c,_0x35096e))[_0x0b8f('0x45')](handleError(_0x356e4c,null));};exports[_0x0b8f('0x46')]=function(_0x8ab316,_0x5ab13c){var _0x333aec={'raw':!![],'where':{'id':_0x8ab316[_0x0b8f('0x47')]['id']}},_0x5b6998={};_0x5b6998[_0x0b8f('0x38')]=_['keys'](db[_0x0b8f('0x30')]['rawAttributes']);_0x5b6998[_0x0b8f('0x34')]=_[_0x0b8f('0x35')](_0x8ab316[_0x0b8f('0x34')]);_0x5b6998[_0x0b8f('0x48')]=_[_0x0b8f('0x36')](_0x5b6998[_0x0b8f('0x38')],_0x5b6998['query']);_0x333aec['attributes']=_[_0x0b8f('0x36')](_0x5b6998[_0x0b8f('0x38')],qs[_0x0b8f('0x49')](_0x8ab316[_0x0b8f('0x34')][_0x0b8f('0x49')]));_0x333aec[_0x0b8f('0x37')]=_0x333aec[_0x0b8f('0x37')]['length']?_0x333aec[_0x0b8f('0x37')]:_0x5b6998[_0x0b8f('0x38')];if(_0x8ab316['query'][_0x0b8f('0x4a')]){_0x333aec[_0x0b8f('0x42')]=[{'all':!![]}];}_0x333aec=_[_0x0b8f('0x3f')]({},_0x333aec,_0x8ab316[_0x0b8f('0x41')]);return db['ChatInternalMessage'][_0x0b8f('0x4b')](_0x333aec)[_0x0b8f('0x28')](handleEntityNotFound(_0x5ab13c,null))[_0x0b8f('0x28')](respondWithResult(_0x5ab13c,null))[_0x0b8f('0x45')](handleError(_0x5ab13c,null));};exports[_0x0b8f('0x4c')]=function(_0x3a3a1a,_0x40d224){return db['ChatInternalMessage'][_0x0b8f('0x4c')](_0x3a3a1a[_0x0b8f('0x4d')],{})[_0x0b8f('0x28')](respondWithResult(_0x40d224,0xc9))[_0x0b8f('0x45')](handleError(_0x40d224,null));};exports[_0x0b8f('0x27')]=function(_0x20ad89,_0x118b49){if(_0x20ad89[_0x0b8f('0x4d')]['id']){delete _0x20ad89[_0x0b8f('0x4d')]['id'];}return db[_0x0b8f('0x30')]['find']({'where':{'id':_0x20ad89['params']['id']}})[_0x0b8f('0x28')](handleEntityNotFound(_0x118b49,null))[_0x0b8f('0x28')](saveUpdates(_0x20ad89[_0x0b8f('0x4d')],null))[_0x0b8f('0x28')](respondWithResult(_0x118b49,null))['catch'](handleError(_0x118b49,null));};exports['destroy']=function(_0x15ff94,_0x5458a1){return db[_0x0b8f('0x30')]['find']({'where':{'id':_0x15ff94[_0x0b8f('0x47')]['id']}})[_0x0b8f('0x28')](handleEntityNotFound(_0x5458a1,null))[_0x0b8f('0x28')](removeEntity(_0x5458a1,null))[_0x0b8f('0x45')](handleError(_0x5458a1,null));};exports[_0x0b8f('0x4e')]=function(_0x17e036,_0x41b414){return db[_0x0b8f('0x30')][_0x0b8f('0x4e')]()[_0x0b8f('0x28')](respondWithResult(_0x41b414,null))[_0x0b8f('0x45')](handleError(_0x41b414,null));};function wrapUser(_0x282296){return function(_0x861a0c){var _0x5c3180=_0x282296['get']({'plain':!![]});_0x5c3180[_0x0b8f('0x4f')]=[];if(_0x861a0c){_0x5c3180[_0x0b8f('0x50')]=_0x861a0c[_0x0b8f('0x51')];_0x5c3180['lastMessage']=_0x861a0c;}else{_0x5c3180[_0x0b8f('0x50')]=moment(0x0)[_0x0b8f('0x52')](_0x0b8f('0x53'));_0x5c3180[_0x0b8f('0x54')]={};}return _0x5c3180;};}exports[_0x0b8f('0x55')]=function(_0x54d2c3,_0x2ea97c,_0x58aaa0){var _0x57da73=[];return db['User'][_0x0b8f('0x43')]({'where':{'role':['agent','admin','user']},'attributes':['id',_0x0b8f('0x56'),_0x0b8f('0x2c'),_0x0b8f('0x57'),'userpic',_0x0b8f('0x58'),_0x0b8f('0x59'),'lastLoginAt',_0x0b8f('0x5a'),_0x0b8f('0x5b')],'order':qs['sort'](_0x0b8f('0x5c')),'include':[{'model':db[_0x0b8f('0x5d')],'as':'VoiceQueues','attributes':['id','name',_0x0b8f('0x33')],'through':{'attributes':[]}}]})['then'](function(_0x368ada){if(_0x368ada){var _0x4c042a=_0x54d2c3[_0x0b8f('0x5e')][_0x0b8f('0x5f')]({'plain':!![]});if(!_0x4c042a)throw new Error(_0x0b8f('0x60'));if(_0x4c042a[_0x0b8f('0x57')]===_0x0b8f('0x5e')){return db[_0x0b8f('0x61')][_0x0b8f('0x4b')]({'where':{'name':'Agents','userProfileId':_0x4c042a[_0x0b8f('0x62')]},'raw':!![]})[_0x0b8f('0x28')](function(_0x275991){if(_0x275991){if(_0x275991['autoAssociation']===0x0){return db['UserProfileResource'][_0x0b8f('0x43')]({'where':{'sectionId':_0x275991['id']},'raw':!![]})['then'](function(_0x2cf339){var _0x5f13dd=[];if(_['isEmpty'](_0x2cf339)){_0x5f13dd=_[_0x0b8f('0x63')](_0x368ada,function(_0x23eab1){if(_0x23eab1['role']!==_0x0b8f('0x64')){return _0x23eab1;}});return _0x5f13dd;}else{for(var _0x33ca97=0x0;_0x33ca97<_0x368ada[_0x0b8f('0x39')];_0x33ca97++){var _0x4c1896=_0x368ada[_0x33ca97];if(_0x4c1896[_0x0b8f('0x57')]==='agent'){var _0x586a34=_[_0x0b8f('0x4b')](_0x2cf339,function(_0x5e98bc){return _0x5e98bc[_0x0b8f('0x65')]===_0x4c1896['id'];});if(_0x586a34)_0x5f13dd['push'](_0x4c1896);}else{_0x5f13dd[_0x0b8f('0x66')](_0x4c1896);}}return _0x5f13dd;}});}else{return _0x368ada;}}else{var _0x48e072=_[_0x0b8f('0x63')](_0x368ada,function(_0xe803ad){if(_0xe803ad[_0x0b8f('0x57')]!==_0x0b8f('0x64')){return _0xe803ad;}});return _0x48e072;}});}else{return _0x368ada;}}})['then'](function(_0xdae336){var _0x14d3af=[];if(_0xdae336){_0x57da73=_0xdae336;for(var _0x3aea93=0x0;_0x3aea93<_0xdae336[_0x0b8f('0x39')];_0x3aea93+=0x1){_0x57da73[_0x3aea93][_0x0b8f('0x4f')]=[];_0x14d3af['push'](db[_0x0b8f('0x30')]['find']({'where':{'FromId':[_0x54d2c3[_0x0b8f('0x5e')]['id'],_0xdae336[_0x3aea93]['id']],'ToId':[_0x54d2c3[_0x0b8f('0x5e')]['id'],_0xdae336[_0x3aea93]['id']],'ChatGroupId':null},'attributes':['id',_0x0b8f('0x51'),_0x0b8f('0x67'),'ToId',_0x0b8f('0x68'),'body'],'order':qs[_0x0b8f('0x3c')](_0x0b8f('0x69')),'limit':0x1,'offset':0x0,'raw':!![]})[_0x0b8f('0x28')](wrapUser(_0xdae336[_0x3aea93])));}return BPromise[_0x0b8f('0x6a')](_0x14d3af);}return[];})[_0x0b8f('0x28')](function(_0x539017){return{'rows':_0x539017,'count':_0x539017[_0x0b8f('0x39')]};})['then'](respondWithResult(_0x2ea97c,null))[_0x0b8f('0x45')](handleError(_0x2ea97c,null));};
\ No newline at end of file
diff --git a/server/api/chatInternalMessage/chatInternalMessage.events.js b/server/api/chatInternalMessage/chatInternalMessage.events.js
index 9858c2b..a1b2ae2 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 _0x430e=['update','remove','emit','hook','exports','../../mysqldb','ChatInternalMessage','save'];(function(_0x49dc40,_0x35df44){var _0x4bc097=function(_0x5868bb){while(--_0x5868bb){_0x49dc40['push'](_0x49dc40['shift']());}};_0x4bc097(++_0x35df44);}(_0x430e,0x105));var _0xe430=function(_0x157a8a,_0x34d072){_0x157a8a=_0x157a8a-0x0;var _0x5bf33f=_0x430e[_0x157a8a];return _0x5bf33f;};'use strict';var EventEmitter=require('events');var ChatInternalMessage=require(_0xe430('0x0'))['db'][_0xe430('0x1')];var ChatInternalMessageEvents=new EventEmitter();ChatInternalMessageEvents['setMaxListeners'](0x0);var events={'afterCreate':_0xe430('0x2'),'afterUpdate':_0xe430('0x3'),'afterDestroy':_0xe430('0x4')};function emitEvent(_0x1a9d61){return function(_0x4a1cd1,_0x3b9e89,_0x24a6cf){ChatInternalMessageEvents[_0xe430('0x5')](_0x1a9d61+':'+_0x4a1cd1['id'],_0x4a1cd1);ChatInternalMessageEvents[_0xe430('0x5')](_0x1a9d61,_0x4a1cd1);_0x24a6cf(null);};}for(var e in events){if(events['hasOwnProperty'](e)){var event=events[e];ChatInternalMessage[_0xe430('0x6')](e,emitEvent(event));}}module[_0xe430('0x7')]=ChatInternalMessageEvents;
\ No newline at end of file
+var _0xcdb1=['update','remove','emit','hasOwnProperty','hook','../../mysqldb','ChatInternalMessage','setMaxListeners','save'];(function(_0x53ba51,_0x2f2321){var _0x2e776e=function(_0x16b5cf){while(--_0x16b5cf){_0x53ba51['push'](_0x53ba51['shift']());}};_0x2e776e(++_0x2f2321);}(_0xcdb1,0x1eb));var _0x1cdb=function(_0x321bb2,_0x202794){_0x321bb2=_0x321bb2-0x0;var _0x9c12ed=_0xcdb1[_0x321bb2];return _0x9c12ed;};'use strict';var EventEmitter=require('events');var ChatInternalMessage=require(_0x1cdb('0x0'))['db'][_0x1cdb('0x1')];var ChatInternalMessageEvents=new EventEmitter();ChatInternalMessageEvents[_0x1cdb('0x2')](0x0);var events={'afterCreate':_0x1cdb('0x3'),'afterUpdate':_0x1cdb('0x4'),'afterDestroy':_0x1cdb('0x5')};function emitEvent(_0x255567){return function(_0x921512,_0x73ee0b,_0x59c279){ChatInternalMessageEvents[_0x1cdb('0x6')](_0x255567+':'+_0x921512['id'],_0x921512);ChatInternalMessageEvents[_0x1cdb('0x6')](_0x255567,_0x921512);_0x59c279(null);};}for(var e in events){if(events[_0x1cdb('0x7')](e)){var event=events[e];ChatInternalMessage[_0x1cdb('0x8')](e,emitEvent(event));}}module['exports']=ChatInternalMessageEvents;
\ No newline at end of file
diff --git a/server/api/chatInternalMessage/chatInternalMessage.model.js b/server/api/chatInternalMessage/chatInternalMessage.model.js
index d3f8dbf..cdf8626 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 _0xa9e0=['define','ChatInternalMessage','utf8mb4_unicode_ci','lodash','util','../../config/logger','bluebird','path','rimraf','../../config/environment','./chatInternalMessage.attributes','exports'];(function(_0x19950b,_0x53d0d7){var _0x3c6b41=function(_0x3924ad){while(--_0x3924ad){_0x19950b['push'](_0x19950b['shift']());}};_0x3c6b41(++_0x53d0d7);}(_0xa9e0,0x123));var _0x0a9e=function(_0x49ca18,_0x5e6d05){_0x49ca18=_0x49ca18-0x0;var _0x145d54=_0xa9e0[_0x49ca18];return _0x145d54;};'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':'chat_internal_messages','paranoid':![],'indexes':[],'timestamps':!![],'charset':'utf8mb4','collate':_0x0a9e('0xb')});};
\ No newline at end of file
+var _0xda3f=['../../config/environment','exports','ChatInternalMessage','chat_internal_messages','utf8mb4','utf8mb4_unicode_ci','util','../../config/logger','request-promise','rimraf'];(function(_0x3955e9,_0x48c85e){var _0xfaebf2=function(_0x4de784){while(--_0x4de784){_0x3955e9['push'](_0x3955e9['shift']());}};_0xfaebf2(++_0x48c85e);}(_0xda3f,0xec));var _0xfda3=function(_0x129321,_0x139186){_0x129321=_0x129321-0x0;var _0x5bd7eb=_0xda3f[_0x129321];return _0x5bd7eb;};'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('./chatInternalMessage.attributes');module[_0xfda3('0x5')]=function(_0x43a010,_0x47e7e2){return _0x43a010['define'](_0xfda3('0x6'),attributes,{'tableName':_0xfda3('0x7'),'paranoid':![],'indexes':[],'timestamps':!![],'charset':_0xfda3('0x8'),'collate':_0xfda3('0x9')});};
\ No newline at end of file
diff --git a/server/api/chatInternalMessage/chatInternalMessage.rpc.js b/server/api/chatInternalMessage/chatInternalMessage.rpc.js
index e3bd507..1d3714f 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 _0xfc42=['../../mysqldb','../../config/utils','rpc','../../config/environment','jayson/promise','client','redis','defaults','localhost','socket.io-emitter','./chatInternalMessage.socket','register','request','then','info','ChatInternalMessage,\x20%s,\x20%s','debug','request\x20sent','stringify','error','code','message','result','lodash','moment','bluebird','randomstring','ioredis'];(function(_0x5811e5,_0x946ee2){var _0x1642da=function(_0x52d73d){while(--_0x52d73d){_0x5811e5['push'](_0x5811e5['shift']());}};_0x1642da(++_0x946ee2);}(_0xfc42,0x87));var _0x2fc4=function(_0x20a584,_0xe384a5){_0x20a584=_0x20a584-0x0;var _0x4b41a8=_0xfc42[_0x20a584];return _0x4b41a8;};'use strict';var _=require(_0x2fc4('0x0'));var util=require('util');var moment=require(_0x2fc4('0x1'));var BPromise=require(_0x2fc4('0x2'));var rs=require(_0x2fc4('0x3'));var fs=require('fs');var Redis=require(_0x2fc4('0x4'));var db=require(_0x2fc4('0x5'))['db'];var utils=require(_0x2fc4('0x6'));var logger=require('../../config/logger')(_0x2fc4('0x7'));var config=require(_0x2fc4('0x8'));var jayson=require(_0x2fc4('0x9'));var client=jayson[_0x2fc4('0xa')]['http']({'port':0x232a});config[_0x2fc4('0xb')]=_[_0x2fc4('0xc')](config[_0x2fc4('0xb')],{'host':_0x2fc4('0xd'),'port':0x18eb});var socket=require(_0x2fc4('0xe'))(new Redis(config[_0x2fc4('0xb')]));require(_0x2fc4('0xf'))[_0x2fc4('0x10')](socket);function respondWithRpcPromise(_0x476e0c,_0x3c7278,_0x15d7fc){return new BPromise(function(_0x3a4fb2,_0x5350c9){return client[_0x2fc4('0x11')](_0x476e0c,_0x15d7fc)[_0x2fc4('0x12')](function(_0x35f1bd){logger[_0x2fc4('0x13')](_0x2fc4('0x14'),_0x3c7278,'request\x20sent');logger[_0x2fc4('0x15')]('ChatInternalMessage,\x20%s,\x20%s,\x20%s',_0x3c7278,_0x2fc4('0x16'),JSON[_0x2fc4('0x17')](_0x35f1bd));if(_0x35f1bd[_0x2fc4('0x18')]){if(_0x35f1bd[_0x2fc4('0x18')][_0x2fc4('0x19')]===0x1f4){logger[_0x2fc4('0x18')](_0x2fc4('0x14'),_0x3c7278,_0x35f1bd[_0x2fc4('0x18')]['message']);return _0x5350c9(_0x35f1bd[_0x2fc4('0x18')][_0x2fc4('0x1a')]);}logger[_0x2fc4('0x18')](_0x2fc4('0x14'),_0x3c7278,_0x35f1bd[_0x2fc4('0x18')]['message']);return _0x3a4fb2(_0x35f1bd[_0x2fc4('0x18')][_0x2fc4('0x1a')]);}else{logger[_0x2fc4('0x13')](_0x2fc4('0x14'),_0x3c7278,_0x2fc4('0x16'));_0x3a4fb2(_0x35f1bd[_0x2fc4('0x1b')][_0x2fc4('0x1a')]);}})['catch'](function(_0x27e6e9){logger['error'](_0x2fc4('0x14'),_0x3c7278,_0x27e6e9);_0x5350c9(_0x27e6e9);});});}
\ No newline at end of file
+var _0x956c=['lodash','util','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/environment','jayson/promise','client','redis','defaults','localhost','socket.io-emitter','./chatInternalMessage.socket','register','request','then','info','ChatInternalMessage,\x20%s,\x20%s','request\x20sent','debug','ChatInternalMessage,\x20%s,\x20%s,\x20%s','stringify','error','code','message','result','catch'];(function(_0xc3ab50,_0x2008de){var _0x2c4630=function(_0x50c77){while(--_0x50c77){_0xc3ab50['push'](_0xc3ab50['shift']());}};_0x2c4630(++_0x2008de);}(_0x956c,0x186));var _0xc956=function(_0x5eaaa7,_0x2589b6){_0x5eaaa7=_0x5eaaa7-0x0;var _0x456115=_0x956c[_0x5eaaa7];return _0x456115;};'use strict';var _=require(_0xc956('0x0'));var util=require(_0xc956('0x1'));var moment=require(_0xc956('0x2'));var BPromise=require(_0xc956('0x3'));var rs=require(_0xc956('0x4'));var fs=require('fs');var Redis=require(_0xc956('0x5'));var db=require(_0xc956('0x6'))['db'];var utils=require(_0xc956('0x7'));var logger=require('../../config/logger')('rpc');var config=require(_0xc956('0x8'));var jayson=require(_0xc956('0x9'));var client=jayson[_0xc956('0xa')]['http']({'port':0x232a});config[_0xc956('0xb')]=_[_0xc956('0xc')](config['redis'],{'host':_0xc956('0xd'),'port':0x18eb});var socket=require(_0xc956('0xe'))(new Redis(config[_0xc956('0xb')]));require(_0xc956('0xf'))[_0xc956('0x10')](socket);function respondWithRpcPromise(_0x3625e0,_0x4a5058,_0x493f6b){return new BPromise(function(_0x40c733,_0x3531f9){return client[_0xc956('0x11')](_0x3625e0,_0x493f6b)[_0xc956('0x12')](function(_0x394fa0){logger[_0xc956('0x13')](_0xc956('0x14'),_0x4a5058,_0xc956('0x15'));logger[_0xc956('0x16')](_0xc956('0x17'),_0x4a5058,_0xc956('0x15'),JSON[_0xc956('0x18')](_0x394fa0));if(_0x394fa0[_0xc956('0x19')]){if(_0x394fa0[_0xc956('0x19')][_0xc956('0x1a')]===0x1f4){logger['error'](_0xc956('0x14'),_0x4a5058,_0x394fa0['error'][_0xc956('0x1b')]);return _0x3531f9(_0x394fa0[_0xc956('0x19')][_0xc956('0x1b')]);}logger['error']('ChatInternalMessage,\x20%s,\x20%s',_0x4a5058,_0x394fa0['error'][_0xc956('0x1b')]);return _0x40c733(_0x394fa0[_0xc956('0x19')]['message']);}else{logger['info'](_0xc956('0x14'),_0x4a5058,_0xc956('0x15'));_0x40c733(_0x394fa0[_0xc956('0x1c')][_0xc956('0x1b')]);}})[_0xc956('0x1d')](function(_0x2edf41){logger[_0xc956('0x19')](_0xc956('0x14'),_0x4a5058,_0x2edf41);_0x3531f9(_0x2edf41);});});}
\ No newline at end of file
diff --git a/server/api/chatInternalMessage/chatInternalMessage.socket.js b/server/api/chatInternalMessage/chatInternalMessage.socket.js
index 5c76aaa..a94ef70 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 _0x76bc=['emit','removeListener','register','length','chatInternalMessage:','./chatInternalMessage.events','save','remove','update'];(function(_0x57ebed,_0xfac0ac){var _0x3a0874=function(_0x271491){while(--_0x271491){_0x57ebed['push'](_0x57ebed['shift']());}};_0x3a0874(++_0xfac0ac);}(_0x76bc,0x17f));var _0xc76b=function(_0x350aeb,_0x3d265a){_0x350aeb=_0x350aeb-0x0;var _0x3c5273=_0x76bc[_0x350aeb];return _0x3c5273;};'use strict';var ChatInternalMessageEvents=require(_0xc76b('0x0'));var events=[_0xc76b('0x1'),_0xc76b('0x2'),_0xc76b('0x3')];function createListener(_0x178974,_0x5a265d){return function(_0x5ce5d4){_0x5a265d[_0xc76b('0x4')](_0x178974,_0x5ce5d4);};}function removeListener(_0x161ef3,_0x3f7b22){return function(){ChatInternalMessageEvents[_0xc76b('0x5')](_0x161ef3,_0x3f7b22);};}exports[_0xc76b('0x6')]=function(_0x239be6){for(var _0x25b111=0x0,_0x2cbe53=events[_0xc76b('0x7')];_0x25b111<_0x2cbe53;_0x25b111++){var _0x1cb174=events[_0x25b111];var _0x235ff3=createListener(_0xc76b('0x8')+_0x1cb174,_0x239be6);ChatInternalMessageEvents['on'](_0x1cb174,_0x235ff3);}};
\ No newline at end of file
+var _0xc3b0=['remove','update','emit','removeListener','register','length','./chatInternalMessage.events','save'];(function(_0x2641f9,_0x26715f){var _0x585741=function(_0x2d1462){while(--_0x2d1462){_0x2641f9['push'](_0x2641f9['shift']());}};_0x585741(++_0x26715f);}(_0xc3b0,0x166));var _0x0c3b=function(_0x5ab072,_0x48306c){_0x5ab072=_0x5ab072-0x0;var _0x38f9d0=_0xc3b0[_0x5ab072];return _0x38f9d0;};'use strict';var ChatInternalMessageEvents=require(_0x0c3b('0x0'));var events=[_0x0c3b('0x1'),_0x0c3b('0x2'),_0x0c3b('0x3')];function createListener(_0x5348c4,_0x5af7d8){return function(_0x2f8bb7){_0x5af7d8[_0x0c3b('0x4')](_0x5348c4,_0x2f8bb7);};}function removeListener(_0x508b38,_0x2b13c6){return function(){ChatInternalMessageEvents[_0x0c3b('0x5')](_0x508b38,_0x2b13c6);};}exports[_0x0c3b('0x6')]=function(_0x5ba7f1){for(var _0x408fd8=0x0,_0x3e2305=events[_0x0c3b('0x7')];_0x408fd8<_0x3e2305;_0x408fd8++){var _0x4e7c4f=events[_0x408fd8];var _0x5c4e3a=createListener('chatInternalMessage:'+_0x4e7c4f,_0x5ba7f1);ChatInternalMessageEvents['on'](_0x4e7c4f,_0x5c4e3a);}};
\ No newline at end of file
diff --git a/server/api/chatInternalMessage/index.js b/server/api/chatInternalMessage/index.js
index 67d9637..23cbec6 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 _0xd8b0=['put','update','delete','destroy','exports','multer','util','Router','../../components/auth/service','../../components/interaction/service','../../config/environment','./chatInternalMessage.controller','index','get','/describe','describe','isAuthenticated','getUsers','/:id','show','post'];(function(_0x1bfa00,_0x1e345b){var _0x2e8492=function(_0x135a12){while(--_0x135a12){_0x1bfa00['push'](_0x1bfa00['shift']());}};_0x2e8492(++_0x1e345b);}(_0xd8b0,0xad));var _0x0d8b=function(_0xa464c9,_0x7c86d8){_0xa464c9=_0xa464c9-0x0;var _0x3d73c4=_0xd8b0[_0xa464c9];return _0x3d73c4;};'use strict';var multer=require(_0x0d8b('0x0'));var util=require(_0x0d8b('0x1'));var path=require('path');var timeout=require('connect-timeout');var express=require('express');var router=express[_0x0d8b('0x2')]();var auth=require(_0x0d8b('0x3'));var interaction=require(_0x0d8b('0x4'));var config=require(_0x0d8b('0x5'));var controller=require(_0x0d8b('0x6'));router['get']('/',auth['isAuthenticated'](),controller[_0x0d8b('0x7')]);router[_0x0d8b('0x8')](_0x0d8b('0x9'),auth['isAuthenticated'](),controller[_0x0d8b('0xa')]);router[_0x0d8b('0x8')]('/users',auth[_0x0d8b('0xb')](),controller[_0x0d8b('0xc')]);router[_0x0d8b('0x8')](_0x0d8b('0xd'),auth[_0x0d8b('0xb')](),controller[_0x0d8b('0xe')]);router[_0x0d8b('0xf')]('/',auth[_0x0d8b('0xb')](),controller['create']);router[_0x0d8b('0x10')]('/:id',controller[_0x0d8b('0x11')]);router[_0x0d8b('0x12')](_0x0d8b('0xd'),auth[_0x0d8b('0xb')](),controller[_0x0d8b('0x13')]);module[_0x0d8b('0x14')]=router;
\ No newline at end of file
+var _0xb7e7=['exports','multer','path','express','../../components/auth/service','../../config/environment','./chatInternalMessage.controller','get','/describe','isAuthenticated','/users','getUsers','/:id','post','create','put','update','delete'];(function(_0x197444,_0x2cc304){var _0xc606f5=function(_0x1c9e02){while(--_0x1c9e02){_0x197444['push'](_0x197444['shift']());}};_0xc606f5(++_0x2cc304);}(_0xb7e7,0x121));var _0x7b7e=function(_0x126558,_0x143c9a){_0x126558=_0x126558-0x0;var _0x1f6d14=_0xb7e7[_0x126558];return _0x1f6d14;};'use strict';var multer=require(_0x7b7e('0x0'));var util=require('util');var path=require(_0x7b7e('0x1'));var timeout=require('connect-timeout');var express=require(_0x7b7e('0x2'));var router=express['Router']();var auth=require(_0x7b7e('0x3'));var interaction=require('../../components/interaction/service');var config=require(_0x7b7e('0x4'));var controller=require(_0x7b7e('0x5'));router[_0x7b7e('0x6')]('/',auth['isAuthenticated'](),controller['index']);router[_0x7b7e('0x6')](_0x7b7e('0x7'),auth[_0x7b7e('0x8')](),controller['describe']);router[_0x7b7e('0x6')](_0x7b7e('0x9'),auth[_0x7b7e('0x8')](),controller[_0x7b7e('0xa')]);router[_0x7b7e('0x6')](_0x7b7e('0xb'),auth[_0x7b7e('0x8')](),controller['show']);router[_0x7b7e('0xc')]('/',auth[_0x7b7e('0x8')](),controller[_0x7b7e('0xd')]);router[_0x7b7e('0xe')](_0x7b7e('0xb'),controller[_0x7b7e('0xf')]);router[_0x7b7e('0x10')](_0x7b7e('0xb'),auth[_0x7b7e('0x8')](),controller['destroy']);module[_0x7b7e('0x11')]=router;
\ No newline at end of file
diff --git a/server/api/chatMessage/chatMessage.attributes.js b/server/api/chatMessage/chatMessage.attributes.js
index 1a04951..68e23b5 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 _0xee7d=['out','DATE','sequelize','medium','BOOLEAN'];(function(_0x4e63dd,_0x588a20){var _0x119e03=function(_0x46867b){while(--_0x46867b){_0x4e63dd['push'](_0x4e63dd['shift']());}};_0x119e03(++_0x588a20);}(_0xee7d,0xa2));var _0xdee7=function(_0x133020,_0x2f76aa){_0x133020=_0x133020-0x0;var _0x3257c9=_0xee7d[_0x133020];return _0x3257c9;};'use strict';var Sequelize=require(_0xdee7('0x0'));module['exports']={'body':{'type':Sequelize['TEXT'](_0xdee7('0x1')),'allowNull':![]},'read':{'type':Sequelize[_0xdee7('0x2')],'defaultValue':![]},'secret':{'type':Sequelize[_0xdee7('0x2')],'defaultValue':![]},'direction':{'type':Sequelize['ENUM']('in','out'),'defaultValue':_0xdee7('0x3'),'allowNull':![]},'readAt':{'type':Sequelize[_0xdee7('0x4')]}};
\ No newline at end of file
+var _0x028c=['ENUM','out','DATE','sequelize','TEXT','medium','BOOLEAN'];(function(_0x43b8d3,_0x4e710c){var _0x445170=function(_0x219e21){while(--_0x219e21){_0x43b8d3['push'](_0x43b8d3['shift']());}};_0x445170(++_0x4e710c);}(_0x028c,0x13e));var _0xc028=function(_0x50c710,_0x504134){_0x50c710=_0x50c710-0x0;var _0x2d5f79=_0x028c[_0x50c710];return _0x2d5f79;};'use strict';var Sequelize=require(_0xc028('0x0'));module['exports']={'body':{'type':Sequelize[_0xc028('0x1')](_0xc028('0x2')),'allowNull':![]},'read':{'type':Sequelize[_0xc028('0x3')],'defaultValue':![]},'secret':{'type':Sequelize[_0xc028('0x3')],'defaultValue':![]},'direction':{'type':Sequelize[_0xc028('0x4')]('in',_0xc028('0x5')),'defaultValue':_0xc028('0x5'),'allowNull':![]},'readAt':{'type':Sequelize[_0xc028('0x6')]}};
\ No newline at end of file
diff --git a/server/api/chatMessage/chatMessage.controller.js b/server/api/chatMessage/chatMessage.controller.js
index 7d22158..6601588 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 _0x8888=['./chatMessage.socket','register','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','ChatMessage,\x20%s,\x20%s','request\x20sent','debug','ChatMessage,\x20%s,\x20%s,\x20%s','stringify','error','code','message','result','sendStatus','status','end','count','offset','json','apply','reject','destroy','stack','name','index','ChatMessage','rawAttributes','fieldName','type','model','map','query','keys','intersection','attributes','fields','hasOwnProperty','nolimit','limit','order','sort','where','pick','filters','merge','VIRTUAL','filter','options','includeAll','findAll','rows','catch','show','params','length','include','find','create','body','update','describe','chat-interactions','accept','chat','readAt','YYYY-MM-DD\x20HH:mm:ss','user','CmContact','Contact','get','ChatInteractionId','UserId','isNil','read1stAt','interaction','[CHATMESSAGE:ACCEPT]\x20id=%s\x20name=%s\x20role=%s\x20interaction=%s\x20body=%s','AcceptMessage','acceptMessage','manual','interface','format','SIP/%s','channel','EventManager','acceptmessage','formData','agent','role','null','RejectMessage','event','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','moment','bluebird','mustache','path','sox','to-csv','ejs','lodash','crypto','jsforce','desk.js','querystring','papaparse','ioredis','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/environment','redis','localhost'];(function(_0xb4cc12,_0x41436e){var _0x8593b5=function(_0x13b840){while(--_0x13b840){_0xb4cc12['push'](_0xb4cc12['shift']());}};_0x8593b5(++_0x41436e);}(_0x8888,0x15c));var _0x8888=function(_0x6fbdbd,_0x1e4070){_0x6fbdbd=_0x6fbdbd-0x0;var _0x4c4890=_0x8888[_0x6fbdbd];return _0x4c4890;};'use strict';var pdf=require('html-pdf');var emlformat=require(_0x8888('0x0'));var rimraf=require(_0x8888('0x1'));var zipdir=require(_0x8888('0x2'));var jsonpatch=require(_0x8888('0x3'));var rp=require(_0x8888('0x4'));var moment=require(_0x8888('0x5'));var BPromise=require(_0x8888('0x6'));var Mustache=require(_0x8888('0x7'));var util=require('util');var path=require(_0x8888('0x8'));var sox=require(_0x8888('0x9'));var csv=require(_0x8888('0xa'));var ejs=require(_0x8888('0xb'));var fs=require('fs');var _=require(_0x8888('0xc'));var squel=require('squel');var crypto=require(_0x8888('0xd'));var jsforce=require(_0x8888('0xe'));var deskjs=require(_0x8888('0xf'));var toCsv=require(_0x8888('0xa'));var querystring=require(_0x8888('0x10'));var Papa=require(_0x8888('0x11'));var Redis=require(_0x8888('0x12'));var authService=require('../../components/auth/service');var qs=require('../../components/parsers/qs');var as=require(_0x8888('0x13'));var hardwareService=require(_0x8888('0x14'));var logger=require(_0x8888('0x15'))(_0x8888('0x16'));var utils=require(_0x8888('0x17'));var config=require(_0x8888('0x18'));var db=require('../../mysqldb')['db'];config[_0x8888('0x19')]=_['defaults'](config[_0x8888('0x19')],{'host':_0x8888('0x1a'),'port':0x18eb});var socket=require('socket.io-emitter')(new Redis(config['redis']));require(_0x8888('0x1b'))[_0x8888('0x1c')](socket);var jayson=require(_0x8888('0x1d'));var client=jayson[_0x8888('0x1e')]['http']({'port':0x232c});var client9002=jayson['client']['http']({'port':0x232a});function checkPasswordPattern(_0x878623,_0x39c650,_0x5723e0){if(_0x5723e0){var _0x4adecf=new RegExp(/(?=.*[a-z])(?=.*[A-Z])(?=.*[0-9])(?=.*[?!@#\$%\^&\*~\-_=+[{\]\}])(?=.{8,})/);if(_0x4adecf[_0x8888('0x1f')](_0x39c650)){return _0x878623;}else{throw new db[(_0x8888('0x20'))][(_0x8888('0x21'))](_0x8888('0x22'));}}else{return _0x878623;}}function respondWithRpcPromise(_0x567b7e,_0x142007,_0x1db525,_0x4fc4e1){return new BPromise(function(_0x54ba59,_0x519fe0){var _0x55b707=_0x4fc4e1||client;return _0x55b707[_0x8888('0x23')](_0x567b7e,_0x1db525)[_0x8888('0x24')](function(_0x174d03){logger[_0x8888('0x25')](_0x8888('0x26'),_0x142007,_0x8888('0x27'));logger[_0x8888('0x28')](_0x8888('0x29'),_0x142007,_0x8888('0x27'),JSON[_0x8888('0x2a')](_0x174d03));if(_0x174d03[_0x8888('0x2b')]){if(_0x174d03[_0x8888('0x2b')][_0x8888('0x2c')]===0x1f4){logger[_0x8888('0x2b')]('ChatMessage,\x20%s,\x20%s',_0x142007,_0x174d03[_0x8888('0x2b')][_0x8888('0x2d')]);return _0x519fe0(_0x174d03[_0x8888('0x2b')]['message']);}logger[_0x8888('0x2b')]('ChatMessage,\x20%s,\x20%s',_0x142007,_0x174d03[_0x8888('0x2b')][_0x8888('0x2d')]);return _0x54ba59(_0x174d03[_0x8888('0x2b')]['message']);}else{logger[_0x8888('0x25')](_0x8888('0x26'),_0x142007,_0x8888('0x27'));_0x54ba59(_0x174d03[_0x8888('0x2e')][_0x8888('0x2d')]);}})['catch'](function(_0x372e58){logger[_0x8888('0x2b')](_0x8888('0x26'),_0x142007,_0x372e58);_0x519fe0(_0x372e58);});});}function respondWithStatusCode(_0x3d05ed,_0xca37fa){_0xca37fa=_0xca37fa||0xcc;return function(_0x1c4c01){if(_0x1c4c01){return _0x3d05ed[_0x8888('0x2f')](_0xca37fa);}return _0x3d05ed[_0x8888('0x30')](_0xca37fa)[_0x8888('0x31')]();};}function respondWithResult(_0x23655b,_0xa21412){_0xa21412=_0xa21412||0xc8;return function(_0x12a5b7){if(_0x12a5b7){return _0x23655b[_0x8888('0x30')](_0xa21412)['json'](_0x12a5b7);}};}function respondWithFilteredResult(_0x204ed1,_0x43291d){return function(_0x1b5deb){if(_0x1b5deb){var _0x151ff1=_0x1b5deb[_0x8888('0x32')],_0x5e2506=_0x43291d[_0x8888('0x33')],_0x5592d4=_0x43291d[_0x8888('0x33')]+_0x43291d['limit'],_0x285be1;if(_0x5592d4>=_0x151ff1){_0x5592d4=_0x151ff1;_0x285be1=0xc8;}else{_0x285be1=0xce;}_0x204ed1['status'](_0x285be1);return _0x204ed1['set']('Content-Range',_0x5e2506+'-'+_0x5592d4+'/'+_0x151ff1)[_0x8888('0x34')](_0x1b5deb);}return null;};}function patchUpdates(_0x370999){return function(_0x53949f){try{jsonpatch[_0x8888('0x35')](_0x53949f,_0x370999,!![]);}catch(_0x3f84ad){return BPromise[_0x8888('0x36')](_0x3f84ad);}return _0x53949f['save']();};}function saveUpdates(_0x250fea,_0x144973){return function(_0x43d56c){if(_0x43d56c){return _0x43d56c['update'](_0x250fea)[_0x8888('0x24')](function(_0x821067){return _0x821067;});}return null;};}function removeEntity(_0xc2a73a,_0x2b2cdd){return function(_0x2d7de9){if(_0x2d7de9){return _0x2d7de9[_0x8888('0x37')]()[_0x8888('0x24')](function(){_0xc2a73a[_0x8888('0x30')](0xcc)[_0x8888('0x31')]();});}};}function handleEntityNotFound(_0x7b185c,_0x54d94e){return function(_0x1e6dc3){if(!_0x1e6dc3){_0x7b185c['sendStatus'](0x194);}return _0x1e6dc3;};}function handleError(_0x287092,_0x43265b){_0x43265b=_0x43265b||0x1f4;return function(_0x342b4c){logger[_0x8888('0x2b')](_0x342b4c[_0x8888('0x38')]);if(_0x342b4c['name']){delete _0x342b4c[_0x8888('0x39')];}_0x287092[_0x8888('0x30')](_0x43265b)['send'](_0x342b4c);};}exports[_0x8888('0x3a')]=function(_0x1faa58,_0xba8585){var _0x2a289d={},_0xa54dfe={},_0x1ca165={'count':0x0,'rows':[]};var _0x429c79=_['map'](db[_0x8888('0x3b')][_0x8888('0x3c')],function(_0x3a57fa){return{'name':_0x3a57fa[_0x8888('0x3d')],'type':_0x3a57fa[_0x8888('0x3e')]['key']};});_0xa54dfe[_0x8888('0x3f')]=_[_0x8888('0x40')](_0x429c79,_0x8888('0x39'));_0xa54dfe[_0x8888('0x41')]=_[_0x8888('0x42')](_0x1faa58['query']);_0xa54dfe['filters']=_[_0x8888('0x43')](_0xa54dfe['model'],_0xa54dfe[_0x8888('0x41')]);_0x2a289d[_0x8888('0x44')]=_[_0x8888('0x43')](_0xa54dfe[_0x8888('0x3f')],qs['fields'](_0x1faa58['query'][_0x8888('0x45')]));_0x2a289d[_0x8888('0x44')]=_0x2a289d[_0x8888('0x44')]['length']?_0x2a289d['attributes']:_0xa54dfe[_0x8888('0x3f')];if(!_0x1faa58[_0x8888('0x41')][_0x8888('0x46')](_0x8888('0x47'))){_0x2a289d[_0x8888('0x48')]=qs[_0x8888('0x48')](_0x1faa58[_0x8888('0x41')]['limit']);_0x2a289d['offset']=qs[_0x8888('0x33')](_0x1faa58[_0x8888('0x41')][_0x8888('0x33')]);}_0x2a289d[_0x8888('0x49')]=qs[_0x8888('0x4a')](_0x1faa58[_0x8888('0x41')]['sort']);_0x2a289d[_0x8888('0x4b')]=qs['filters'](_[_0x8888('0x4c')](_0x1faa58[_0x8888('0x41')],_0xa54dfe[_0x8888('0x4d')]));if(_0x1faa58[_0x8888('0x41')]['filter']){_0x2a289d[_0x8888('0x4b')]=_[_0x8888('0x4e')](_0x2a289d['where'],{'$or':_[_0x8888('0x40')](_0x429c79,function(_0xd743b3){if(_0xd743b3[_0x8888('0x3e')]!==_0x8888('0x4f')){var _0x46598e={};_0x46598e[_0xd743b3[_0x8888('0x39')]]={'$like':'%'+_0x1faa58[_0x8888('0x41')][_0x8888('0x50')]+'%'};return _0x46598e;}})});}_0x2a289d=_['merge']({},_0x2a289d,_0x1faa58[_0x8888('0x51')]);var _0x497d92={'where':_0x2a289d['where']};return db['ChatMessage'][_0x8888('0x32')](_0x497d92)[_0x8888('0x24')](function(_0x115b53){_0x1ca165[_0x8888('0x32')]=_0x115b53;if(_0x1faa58[_0x8888('0x41')][_0x8888('0x52')]){_0x2a289d['include']=[{'all':!![]}];}return db[_0x8888('0x3b')][_0x8888('0x53')](_0x2a289d);})[_0x8888('0x24')](function(_0x407d57){_0x1ca165[_0x8888('0x54')]=_0x407d57;return _0x1ca165;})[_0x8888('0x24')](respondWithFilteredResult(_0xba8585,_0x2a289d))[_0x8888('0x55')](handleError(_0xba8585,null));};exports[_0x8888('0x56')]=function(_0x42b124,_0x2d8380){var _0x21c6ef={'raw':!![],'where':{'id':_0x42b124[_0x8888('0x57')]['id']}},_0x526697={};_0x526697[_0x8888('0x3f')]=_['keys'](db['ChatMessage'][_0x8888('0x3c')]);_0x526697[_0x8888('0x41')]=_[_0x8888('0x42')](_0x42b124[_0x8888('0x41')]);_0x526697[_0x8888('0x4d')]=_[_0x8888('0x43')](_0x526697['model'],_0x526697['query']);_0x21c6ef[_0x8888('0x44')]=_[_0x8888('0x43')](_0x526697[_0x8888('0x3f')],qs[_0x8888('0x45')](_0x42b124['query'][_0x8888('0x45')]));_0x21c6ef[_0x8888('0x44')]=_0x21c6ef['attributes'][_0x8888('0x58')]?_0x21c6ef[_0x8888('0x44')]:_0x526697[_0x8888('0x3f')];if(_0x42b124['query'][_0x8888('0x52')]){_0x21c6ef[_0x8888('0x59')]=[{'all':!![]}];}_0x21c6ef=_[_0x8888('0x4e')]({},_0x21c6ef,_0x42b124['options']);return db[_0x8888('0x3b')][_0x8888('0x5a')](_0x21c6ef)['then'](handleEntityNotFound(_0x2d8380,null))[_0x8888('0x24')](respondWithResult(_0x2d8380,null))[_0x8888('0x55')](handleError(_0x2d8380,null));};exports['create']=function(_0x112215,_0x2babad){return db[_0x8888('0x3b')][_0x8888('0x5b')](_0x112215[_0x8888('0x5c')],{})[_0x8888('0x24')](respondWithResult(_0x2babad,0xc9))[_0x8888('0x55')](handleError(_0x2babad,null));};exports[_0x8888('0x5d')]=function(_0x1bebd0,_0x2f605b){if(_0x1bebd0['body']['id']){delete _0x1bebd0[_0x8888('0x5c')]['id'];}return db['ChatMessage'][_0x8888('0x5a')]({'where':{'id':_0x1bebd0[_0x8888('0x57')]['id']}})[_0x8888('0x24')](handleEntityNotFound(_0x2f605b,null))[_0x8888('0x24')](saveUpdates(_0x1bebd0[_0x8888('0x5c')],null))[_0x8888('0x24')](respondWithResult(_0x2f605b,null))[_0x8888('0x55')](handleError(_0x2f605b,null));};exports[_0x8888('0x37')]=function(_0x363d8f,_0x1d5b9e){return db[_0x8888('0x3b')][_0x8888('0x5a')]({'where':{'id':_0x363d8f[_0x8888('0x57')]['id']}})[_0x8888('0x24')](handleEntityNotFound(_0x1d5b9e,null))[_0x8888('0x24')](removeEntity(_0x1d5b9e,null))['catch'](handleError(_0x1d5b9e,null));};exports[_0x8888('0x5e')]=function(_0x2d2828,_0xf82bce){return db[_0x8888('0x3b')][_0x8888('0x5e')]()[_0x8888('0x24')](respondWithResult(_0xf82bce,null))[_0x8888('0x55')](handleError(_0xf82bce,null));};var interaction_log=require(_0x8888('0x15'))(_0x8888('0x5f'));exports[_0x8888('0x60')]=function(_0x4c3839,_0x22efb7,_0x252f9e){var _0xd4906e={'channel':_0x8888('0x61')};if(_0x4c3839[_0x8888('0x5c')]['id']){delete _0x4c3839[_0x8888('0x5c')]['id'];}_0x4c3839['body']['read']=!![];_0x4c3839[_0x8888('0x5c')][_0x8888('0x62')]=moment()['format'](_0x8888('0x63'));_0x4c3839[_0x8888('0x5c')]['UserId']=_0x4c3839[_0x8888('0x5c')]['UserId']||_0x4c3839[_0x8888('0x64')]['id'];return db[_0x8888('0x3b')][_0x8888('0x5a')]({'where':{'id':_0x4c3839['params']['id'],'UserId':null},'include':[{'model':db[_0x8888('0x65')],'as':_0x8888('0x66')}]})[_0x8888('0x24')](handleEntityNotFound(_0x22efb7,null))[_0x8888('0x24')](saveUpdates(_0x4c3839[_0x8888('0x5c')],null))['then'](function(_0x377a9d){if(_0x377a9d){_0xd4906e[_0x8888('0x2d')]=_0x377a9d[_0x8888('0x67')]({'plain':!![]});return db['ChatInteraction'][_0x8888('0x5a')]({'where':{'id':_0x377a9d[_0x8888('0x68')]}});}return null;})[_0x8888('0x24')](handleEntityNotFound(_0x22efb7,null))[_0x8888('0x24')](function(_0xd10a7e){if(_0xd10a7e){return _0xd10a7e[_0x8888('0x5d')]({'UserId':_0x4c3839['body'][_0x8888('0x69')],'read1stAt':_[_0x8888('0x6a')](_0xd10a7e[_0x8888('0x6b')])?moment()['format'](_0x8888('0x63')):undefined});}return null;})[_0x8888('0x24')](function(_0x24550d){if(_0x24550d){_0xd4906e[_0x8888('0x6c')]=_0x24550d[_0x8888('0x67')]({'plain':!![]});interaction_log[_0x8888('0x25')](_0x8888('0x6d'),_0x4c3839['user']['id'],_0x4c3839[_0x8888('0x64')][_0x8888('0x39')],_0x4c3839['user']['role'],_0xd4906e['interaction']['id'],_0x4c3839['body']?JSON[_0x8888('0x2a')](_0x4c3839['body']):'null');return respondWithRpcPromise(_0x8888('0x6e'),_0x8888('0x6f'),_0xd4906e);}return null;})[_0x8888('0x24')](function(_0x442af1){if(_0x442af1){if(_0x4c3839['body'][_0x8888('0x70')]){_0xd4906e['message'][_0x8888('0x71')]=util[_0x8888('0x72')](_0x8888('0x73'),_0x4c3839[_0x8888('0x64')][_0x8888('0x39')]);_0xd4906e[_0x8888('0x2d')][_0x8888('0x74')]=_0xd4906e[_0x8888('0x74')];_0xd4906e[_0x8888('0x2d')]['event']=_0x8888('0x60');return respondWithRpcPromise(_0x8888('0x75'),'EventManager',{'event':_0x8888('0x76'),'message':_[_0x8888('0x4e')](_0xd4906e[_0x8888('0x2d')],JSON['parse'](_0xd4906e[_0x8888('0x6c')][_0x8888('0x77')]))},client9002)['then'](function(){return _0xd4906e;});}return _0xd4906e;}return null;})[_0x8888('0x24')](respondWithResult(_0x22efb7,null))[_0x8888('0x55')](handleError(_0x22efb7,null));};var interaction_log=require(_0x8888('0x15'))(_0x8888('0x5f'));exports[_0x8888('0x36')]=function(_0x5ed725,_0x2160d6,_0x4f1a8e){var _0x1c04df={'agent':{},'channel':_0x8888('0x61')};if(_0x5ed725[_0x8888('0x5c')]['id']){delete _0x5ed725[_0x8888('0x5c')]['id'];}_0x5ed725[_0x8888('0x5c')][_0x8888('0x69')]=_0x5ed725['body']['UserId']||_0x5ed725['user']['id'];_0x1c04df[_0x8888('0x78')]['id']=_0x5ed725['body'][_0x8888('0x69')];return db['ChatMessage'][_0x8888('0x5a')]({'where':{'id':_0x5ed725[_0x8888('0x57')]['id'],'UserId':null}})['then'](handleEntityNotFound(_0x2160d6,null))[_0x8888('0x24')](function(_0x3a9989){if(_0x3a9989){_0x1c04df[_0x8888('0x2d')]=_0x3a9989[_0x8888('0x67')]({'plain':!![]});return db['ChatInteraction'][_0x8888('0x5a')]({'where':{'id':_0x3a9989['ChatInteractionId']}});}return null;})[_0x8888('0x24')](handleEntityNotFound(_0x2160d6,null))[_0x8888('0x24')](function(_0x2dadf2){if(_0x2dadf2){_0x1c04df[_0x8888('0x6c')]=_0x2dadf2[_0x8888('0x67')]({'plain':!![]});interaction_log[_0x8888('0x25')]('[CHATMESSAGE:REJECT]\x20id=%s\x20name=%s\x20role=%s\x20interaction=%s\x20body=%s',_0x5ed725[_0x8888('0x64')]['id'],_0x5ed725[_0x8888('0x64')]['name'],_0x5ed725[_0x8888('0x64')][_0x8888('0x79')],_0x1c04df[_0x8888('0x6c')]['id'],_0x5ed725[_0x8888('0x5c')]?JSON['stringify'](_0x5ed725['body']):_0x8888('0x7a'));return respondWithRpcPromise(_0x8888('0x7b'),'rejectMessage',_0x1c04df);}return null;})[_0x8888('0x24')](function(_0x35b6e5){if(_0x35b6e5){_0x35b6e5[_0x8888('0x2d')]['interface']=util[_0x8888('0x72')](_0x8888('0x73'),_0x5ed725[_0x8888('0x64')][_0x8888('0x39')]);_0x35b6e5[_0x8888('0x2d')][_0x8888('0x74')]=_0x1c04df[_0x8888('0x74')];_0x35b6e5[_0x8888('0x2d')][_0x8888('0x7c')]='reject';respondWithRpcPromise(_0x8888('0x75'),'EventManager',{'event':'rejectmessage','message':_0x35b6e5['message']},client9002);return _0x1c04df;}return null;})[_0x8888('0x24')](respondWithResult(_0x2160d6,null))['catch'](handleError(_0x2160d6,null));};
\ No newline at end of file
+var _0x0134=['length','create','body','params','describe','chat-interactions','accept','format','UserId','user','find','CmContact','ChatInteraction','ChatInteractionId','read1stAt','YYYY-MM-DD\x20HH:mm:ss','interaction','get','[CHATMESSAGE:ACCEPT]\x20id=%s\x20name=%s\x20role=%s\x20interaction=%s\x20body=%s','role','null','AcceptMessage','acceptMessage','interface','SIP/%s','channel','event','EventManager','acceptmessage','parse','agent','[CHATMESSAGE:REJECT]\x20id=%s\x20name=%s\x20role=%s\x20interaction=%s\x20body=%s','RejectMessage','rejectmessage','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','../../config/license/hardware','../../config/logger','api','../../config/environment','../../mysqldb','redis','defaults','localhost','socket.io-emitter','./chatMessage.socket','register','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','request\x20sent','debug','ChatMessage,\x20%s,\x20%s,\x20%s','stringify','error','code','ChatMessage,\x20%s,\x20%s','message','info','result','catch','sendStatus','end','status','json','count','offset','limit','set','Content-Range','reject','save','update','destroy','stack','name','send','index','map','ChatMessage','rawAttributes','fieldName','type','key','model','query','keys','intersection','attributes','fields','hasOwnProperty','nolimit','order','sort','where','pick','filters','filter','merge','VIRTUAL','options','includeAll','include','findAll','rows','show'];(function(_0x20a584,_0xe384a5){var _0x4b41a8=function(_0x2127c6){while(--_0x2127c6){_0x20a584['push'](_0x20a584['shift']());}};_0x4b41a8(++_0xe384a5);}(_0x0134,0x124));var _0x4013=function(_0x1880f5,_0x18418a){_0x1880f5=_0x1880f5-0x0;var _0x3f0957=_0x0134[_0x1880f5];return _0x3f0957;};'use strict';var pdf=require(_0x4013('0x0'));var emlformat=require(_0x4013('0x1'));var rimraf=require(_0x4013('0x2'));var zipdir=require(_0x4013('0x3'));var jsonpatch=require(_0x4013('0x4'));var rp=require(_0x4013('0x5'));var moment=require(_0x4013('0x6'));var BPromise=require(_0x4013('0x7'));var Mustache=require(_0x4013('0x8'));var util=require(_0x4013('0x9'));var path=require(_0x4013('0xa'));var sox=require(_0x4013('0xb'));var csv=require(_0x4013('0xc'));var ejs=require(_0x4013('0xd'));var fs=require('fs');var _=require(_0x4013('0xe'));var squel=require(_0x4013('0xf'));var crypto=require(_0x4013('0x10'));var jsforce=require('jsforce');var deskjs=require(_0x4013('0x11'));var toCsv=require(_0x4013('0xc'));var querystring=require(_0x4013('0x12'));var Papa=require(_0x4013('0x13'));var Redis=require(_0x4013('0x14'));var authService=require('../../components/auth/service');var qs=require('../../components/parsers/qs');var as=require('../../components/parsers/advancedSearch');var hardwareService=require(_0x4013('0x15'));var logger=require(_0x4013('0x16'))(_0x4013('0x17'));var utils=require('../../config/utils');var config=require(_0x4013('0x18'));var db=require(_0x4013('0x19'))['db'];config[_0x4013('0x1a')]=_[_0x4013('0x1b')](config[_0x4013('0x1a')],{'host':_0x4013('0x1c'),'port':0x18eb});var socket=require(_0x4013('0x1d'))(new Redis(config['redis']));require(_0x4013('0x1e'))[_0x4013('0x1f')](socket);var jayson=require('jayson/promise');var client=jayson[_0x4013('0x20')][_0x4013('0x21')]({'port':0x232c});var client9002=jayson[_0x4013('0x20')][_0x4013('0x21')]({'port':0x232a});function checkPasswordPattern(_0x262366,_0x1c3101,_0x54ef2e){if(_0x54ef2e){var _0x1408e2=new RegExp(/(?=.*[a-z])(?=.*[A-Z])(?=.*[0-9])(?=.*[?!@#\$%\^&\*~\-_=+[{\]\}])(?=.{8,})/);if(_0x1408e2['test'](_0x1c3101)){return _0x262366;}else{throw new db[(_0x4013('0x22'))][(_0x4013('0x23'))](_0x4013('0x24'));}}else{return _0x262366;}}function respondWithRpcPromise(_0x3d77c5,_0x4a9e84,_0x1b8206,_0x2b7fe0){return new BPromise(function(_0x1af723,_0x2a1561){var _0xb1a61a=_0x2b7fe0||client;return _0xb1a61a[_0x4013('0x25')](_0x3d77c5,_0x1b8206)[_0x4013('0x26')](function(_0x41d180){logger['info']('ChatMessage,\x20%s,\x20%s',_0x4a9e84,_0x4013('0x27'));logger[_0x4013('0x28')](_0x4013('0x29'),_0x4a9e84,_0x4013('0x27'),JSON[_0x4013('0x2a')](_0x41d180));if(_0x41d180['error']){if(_0x41d180[_0x4013('0x2b')][_0x4013('0x2c')]===0x1f4){logger[_0x4013('0x2b')](_0x4013('0x2d'),_0x4a9e84,_0x41d180['error'][_0x4013('0x2e')]);return _0x2a1561(_0x41d180[_0x4013('0x2b')]['message']);}logger['error'](_0x4013('0x2d'),_0x4a9e84,_0x41d180[_0x4013('0x2b')][_0x4013('0x2e')]);return _0x1af723(_0x41d180[_0x4013('0x2b')]['message']);}else{logger[_0x4013('0x2f')](_0x4013('0x2d'),_0x4a9e84,_0x4013('0x27'));_0x1af723(_0x41d180[_0x4013('0x30')][_0x4013('0x2e')]);}})[_0x4013('0x31')](function(_0x253993){logger['error']('ChatMessage,\x20%s,\x20%s',_0x4a9e84,_0x253993);_0x2a1561(_0x253993);});});}function respondWithStatusCode(_0x5962ac,_0x53c912){_0x53c912=_0x53c912||0xcc;return function(_0x10787f){if(_0x10787f){return _0x5962ac[_0x4013('0x32')](_0x53c912);}return _0x5962ac['status'](_0x53c912)[_0x4013('0x33')]();};}function respondWithResult(_0x467c95,_0x2221ee){_0x2221ee=_0x2221ee||0xc8;return function(_0xf87e28){if(_0xf87e28){return _0x467c95[_0x4013('0x34')](_0x2221ee)[_0x4013('0x35')](_0xf87e28);}};}function respondWithFilteredResult(_0x3fec74,_0x587987){return function(_0x4c1dbd){if(_0x4c1dbd){var _0xc85ae5=_0x4c1dbd[_0x4013('0x36')],_0x495678=_0x587987[_0x4013('0x37')],_0x1c5ddd=_0x587987[_0x4013('0x37')]+_0x587987[_0x4013('0x38')],_0x306499;if(_0x1c5ddd>=_0xc85ae5){_0x1c5ddd=_0xc85ae5;_0x306499=0xc8;}else{_0x306499=0xce;}_0x3fec74['status'](_0x306499);return _0x3fec74[_0x4013('0x39')](_0x4013('0x3a'),_0x495678+'-'+_0x1c5ddd+'/'+_0xc85ae5)['json'](_0x4c1dbd);}return null;};}function patchUpdates(_0x5832c1){return function(_0x37d942){try{jsonpatch['apply'](_0x37d942,_0x5832c1,!![]);}catch(_0x1e4ec2){return BPromise[_0x4013('0x3b')](_0x1e4ec2);}return _0x37d942[_0x4013('0x3c')]();};}function saveUpdates(_0x479e4e,_0x2dcbf5){return function(_0xa0cbca){if(_0xa0cbca){return _0xa0cbca[_0x4013('0x3d')](_0x479e4e)['then'](function(_0xda6165){return _0xda6165;});}return null;};}function removeEntity(_0x1a22eb,_0x5d7eb2){return function(_0x22499e){if(_0x22499e){return _0x22499e[_0x4013('0x3e')]()[_0x4013('0x26')](function(){_0x1a22eb['status'](0xcc)['end']();});}};}function handleEntityNotFound(_0xb2c473,_0x5c7fe9){return function(_0x414413){if(!_0x414413){_0xb2c473[_0x4013('0x32')](0x194);}return _0x414413;};}function handleError(_0x1b113e,_0x1df1b2){_0x1df1b2=_0x1df1b2||0x1f4;return function(_0x3c3f1d){logger[_0x4013('0x2b')](_0x3c3f1d[_0x4013('0x3f')]);if(_0x3c3f1d[_0x4013('0x40')]){delete _0x3c3f1d[_0x4013('0x40')];}_0x1b113e[_0x4013('0x34')](_0x1df1b2)[_0x4013('0x41')](_0x3c3f1d);};}exports[_0x4013('0x42')]=function(_0x2e0c0f,_0xd82879){var _0x29aba={},_0x3be52d={},_0xfaac48={'count':0x0,'rows':[]};var _0xd32e39=_[_0x4013('0x43')](db[_0x4013('0x44')][_0x4013('0x45')],function(_0x47e9c8){return{'name':_0x47e9c8[_0x4013('0x46')],'type':_0x47e9c8[_0x4013('0x47')][_0x4013('0x48')]};});_0x3be52d[_0x4013('0x49')]=_[_0x4013('0x43')](_0xd32e39,_0x4013('0x40'));_0x3be52d[_0x4013('0x4a')]=_[_0x4013('0x4b')](_0x2e0c0f[_0x4013('0x4a')]);_0x3be52d['filters']=_[_0x4013('0x4c')](_0x3be52d[_0x4013('0x49')],_0x3be52d[_0x4013('0x4a')]);_0x29aba[_0x4013('0x4d')]=_[_0x4013('0x4c')](_0x3be52d[_0x4013('0x49')],qs[_0x4013('0x4e')](_0x2e0c0f[_0x4013('0x4a')][_0x4013('0x4e')]));_0x29aba[_0x4013('0x4d')]=_0x29aba[_0x4013('0x4d')]['length']?_0x29aba[_0x4013('0x4d')]:_0x3be52d[_0x4013('0x49')];if(!_0x2e0c0f['query'][_0x4013('0x4f')](_0x4013('0x50'))){_0x29aba[_0x4013('0x38')]=qs['limit'](_0x2e0c0f[_0x4013('0x4a')][_0x4013('0x38')]);_0x29aba[_0x4013('0x37')]=qs[_0x4013('0x37')](_0x2e0c0f[_0x4013('0x4a')][_0x4013('0x37')]);}_0x29aba[_0x4013('0x51')]=qs[_0x4013('0x52')](_0x2e0c0f[_0x4013('0x4a')][_0x4013('0x52')]);_0x29aba[_0x4013('0x53')]=qs['filters'](_[_0x4013('0x54')](_0x2e0c0f[_0x4013('0x4a')],_0x3be52d[_0x4013('0x55')]));if(_0x2e0c0f[_0x4013('0x4a')][_0x4013('0x56')]){_0x29aba[_0x4013('0x53')]=_[_0x4013('0x57')](_0x29aba['where'],{'$or':_['map'](_0xd32e39,function(_0x2b4b13){if(_0x2b4b13['type']!==_0x4013('0x58')){var _0x558b15={};_0x558b15[_0x2b4b13[_0x4013('0x40')]]={'$like':'%'+_0x2e0c0f[_0x4013('0x4a')]['filter']+'%'};return _0x558b15;}})});}_0x29aba=_['merge']({},_0x29aba,_0x2e0c0f[_0x4013('0x59')]);var _0x4cab2c={'where':_0x29aba[_0x4013('0x53')]};return db['ChatMessage']['count'](_0x4cab2c)['then'](function(_0x33c5a2){_0xfaac48[_0x4013('0x36')]=_0x33c5a2;if(_0x2e0c0f['query'][_0x4013('0x5a')]){_0x29aba[_0x4013('0x5b')]=[{'all':!![]}];}return db['ChatMessage'][_0x4013('0x5c')](_0x29aba);})[_0x4013('0x26')](function(_0x4a9ff5){_0xfaac48[_0x4013('0x5d')]=_0x4a9ff5;return _0xfaac48;})[_0x4013('0x26')](respondWithFilteredResult(_0xd82879,_0x29aba))['catch'](handleError(_0xd82879,null));};exports[_0x4013('0x5e')]=function(_0x42b058,_0x28f267){var _0x381b24={'raw':!![],'where':{'id':_0x42b058['params']['id']}},_0x2a372f={};_0x2a372f[_0x4013('0x49')]=_[_0x4013('0x4b')](db[_0x4013('0x44')][_0x4013('0x45')]);_0x2a372f[_0x4013('0x4a')]=_[_0x4013('0x4b')](_0x42b058[_0x4013('0x4a')]);_0x2a372f[_0x4013('0x55')]=_[_0x4013('0x4c')](_0x2a372f[_0x4013('0x49')],_0x2a372f[_0x4013('0x4a')]);_0x381b24[_0x4013('0x4d')]=_[_0x4013('0x4c')](_0x2a372f[_0x4013('0x49')],qs['fields'](_0x42b058[_0x4013('0x4a')][_0x4013('0x4e')]));_0x381b24[_0x4013('0x4d')]=_0x381b24['attributes'][_0x4013('0x5f')]?_0x381b24[_0x4013('0x4d')]:_0x2a372f['model'];if(_0x42b058[_0x4013('0x4a')][_0x4013('0x5a')]){_0x381b24['include']=[{'all':!![]}];}_0x381b24=_['merge']({},_0x381b24,_0x42b058['options']);return db[_0x4013('0x44')]['find'](_0x381b24)[_0x4013('0x26')](handleEntityNotFound(_0x28f267,null))[_0x4013('0x26')](respondWithResult(_0x28f267,null))[_0x4013('0x31')](handleError(_0x28f267,null));};exports[_0x4013('0x60')]=function(_0x2f6d47,_0x1f36da){return db['ChatMessage'][_0x4013('0x60')](_0x2f6d47[_0x4013('0x61')],{})[_0x4013('0x26')](respondWithResult(_0x1f36da,0xc9))[_0x4013('0x31')](handleError(_0x1f36da,null));};exports['update']=function(_0xf63c8a,_0x653890){if(_0xf63c8a[_0x4013('0x61')]['id']){delete _0xf63c8a[_0x4013('0x61')]['id'];}return db[_0x4013('0x44')]['find']({'where':{'id':_0xf63c8a[_0x4013('0x62')]['id']}})[_0x4013('0x26')](handleEntityNotFound(_0x653890,null))[_0x4013('0x26')](saveUpdates(_0xf63c8a[_0x4013('0x61')],null))[_0x4013('0x26')](respondWithResult(_0x653890,null))[_0x4013('0x31')](handleError(_0x653890,null));};exports[_0x4013('0x3e')]=function(_0x3e2768,_0x41876c){return db[_0x4013('0x44')]['find']({'where':{'id':_0x3e2768[_0x4013('0x62')]['id']}})[_0x4013('0x26')](handleEntityNotFound(_0x41876c,null))['then'](removeEntity(_0x41876c,null))['catch'](handleError(_0x41876c,null));};exports['describe']=function(_0x132dab,_0x54ebc8){return db[_0x4013('0x44')][_0x4013('0x63')]()[_0x4013('0x26')](respondWithResult(_0x54ebc8,null))['catch'](handleError(_0x54ebc8,null));};var interaction_log=require(_0x4013('0x16'))(_0x4013('0x64'));exports[_0x4013('0x65')]=function(_0xa545fb,_0x56de11,_0x3d6428){var _0x12fdfb={'channel':'chat'};if(_0xa545fb['body']['id']){delete _0xa545fb[_0x4013('0x61')]['id'];}_0xa545fb[_0x4013('0x61')]['read']=!![];_0xa545fb[_0x4013('0x61')]['readAt']=moment()[_0x4013('0x66')]('YYYY-MM-DD\x20HH:mm:ss');_0xa545fb[_0x4013('0x61')][_0x4013('0x67')]=_0xa545fb['body'][_0x4013('0x67')]||_0xa545fb[_0x4013('0x68')]['id'];return db['ChatMessage'][_0x4013('0x69')]({'where':{'id':_0xa545fb[_0x4013('0x62')]['id'],'UserId':null},'include':[{'model':db[_0x4013('0x6a')],'as':'Contact'}]})[_0x4013('0x26')](handleEntityNotFound(_0x56de11,null))[_0x4013('0x26')](saveUpdates(_0xa545fb['body'],null))[_0x4013('0x26')](function(_0x1cc315){if(_0x1cc315){_0x12fdfb[_0x4013('0x2e')]=_0x1cc315['get']({'plain':!![]});return db[_0x4013('0x6b')][_0x4013('0x69')]({'where':{'id':_0x1cc315[_0x4013('0x6c')]}});}return null;})[_0x4013('0x26')](handleEntityNotFound(_0x56de11,null))['then'](function(_0x530f46){if(_0x530f46){return _0x530f46[_0x4013('0x3d')]({'UserId':_0xa545fb[_0x4013('0x61')]['UserId'],'read1stAt':_['isNil'](_0x530f46[_0x4013('0x6d')])?moment()[_0x4013('0x66')](_0x4013('0x6e')):undefined});}return null;})[_0x4013('0x26')](function(_0x14deef){if(_0x14deef){_0x12fdfb[_0x4013('0x6f')]=_0x14deef[_0x4013('0x70')]({'plain':!![]});interaction_log[_0x4013('0x2f')](_0x4013('0x71'),_0xa545fb[_0x4013('0x68')]['id'],_0xa545fb['user'][_0x4013('0x40')],_0xa545fb[_0x4013('0x68')][_0x4013('0x72')],_0x12fdfb[_0x4013('0x6f')]['id'],_0xa545fb[_0x4013('0x61')]?JSON[_0x4013('0x2a')](_0xa545fb['body']):_0x4013('0x73'));return respondWithRpcPromise(_0x4013('0x74'),_0x4013('0x75'),_0x12fdfb);}return null;})[_0x4013('0x26')](function(_0x1e4981){if(_0x1e4981){if(_0xa545fb[_0x4013('0x61')]['manual']){_0x12fdfb[_0x4013('0x2e')][_0x4013('0x76')]=util[_0x4013('0x66')](_0x4013('0x77'),_0xa545fb[_0x4013('0x68')][_0x4013('0x40')]);_0x12fdfb['message'][_0x4013('0x78')]=_0x12fdfb['channel'];_0x12fdfb[_0x4013('0x2e')][_0x4013('0x79')]=_0x4013('0x65');return respondWithRpcPromise(_0x4013('0x7a'),_0x4013('0x7a'),{'event':_0x4013('0x7b'),'message':_['merge'](_0x12fdfb[_0x4013('0x2e')],JSON[_0x4013('0x7c')](_0x12fdfb['interaction']['formData']))},client9002)[_0x4013('0x26')](function(){return _0x12fdfb;});}return _0x12fdfb;}return null;})['then'](respondWithResult(_0x56de11,null))[_0x4013('0x31')](handleError(_0x56de11,null));};var interaction_log=require(_0x4013('0x16'))(_0x4013('0x64'));exports['reject']=function(_0x38b874,_0x295c8c,_0x389275){var _0x47a28b={'agent':{},'channel':'chat'};if(_0x38b874[_0x4013('0x61')]['id']){delete _0x38b874[_0x4013('0x61')]['id'];}_0x38b874['body'][_0x4013('0x67')]=_0x38b874[_0x4013('0x61')]['UserId']||_0x38b874[_0x4013('0x68')]['id'];_0x47a28b[_0x4013('0x7d')]['id']=_0x38b874[_0x4013('0x61')][_0x4013('0x67')];return db['ChatMessage']['find']({'where':{'id':_0x38b874[_0x4013('0x62')]['id'],'UserId':null}})[_0x4013('0x26')](handleEntityNotFound(_0x295c8c,null))[_0x4013('0x26')](function(_0x32282e){if(_0x32282e){_0x47a28b['message']=_0x32282e[_0x4013('0x70')]({'plain':!![]});return db['ChatInteraction'][_0x4013('0x69')]({'where':{'id':_0x32282e[_0x4013('0x6c')]}});}return null;})['then'](handleEntityNotFound(_0x295c8c,null))[_0x4013('0x26')](function(_0x29c4d4){if(_0x29c4d4){_0x47a28b['interaction']=_0x29c4d4[_0x4013('0x70')]({'plain':!![]});interaction_log['info'](_0x4013('0x7e'),_0x38b874[_0x4013('0x68')]['id'],_0x38b874['user']['name'],_0x38b874[_0x4013('0x68')][_0x4013('0x72')],_0x47a28b[_0x4013('0x6f')]['id'],_0x38b874['body']?JSON[_0x4013('0x2a')](_0x38b874[_0x4013('0x61')]):_0x4013('0x73'));return respondWithRpcPromise(_0x4013('0x7f'),'rejectMessage',_0x47a28b);}return null;})[_0x4013('0x26')](function(_0x4fc224){if(_0x4fc224){_0x4fc224[_0x4013('0x2e')]['interface']=util['format'](_0x4013('0x77'),_0x38b874[_0x4013('0x68')]['name']);_0x4fc224[_0x4013('0x2e')][_0x4013('0x78')]=_0x47a28b[_0x4013('0x78')];_0x4fc224[_0x4013('0x2e')][_0x4013('0x79')]=_0x4013('0x3b');respondWithRpcPromise(_0x4013('0x7a'),'EventManager',{'event':_0x4013('0x80'),'message':_0x4fc224[_0x4013('0x2e')]},client9002);return _0x47a28b;}return null;})[_0x4013('0x26')](respondWithResult(_0x295c8c,null))[_0x4013('0x31')](handleError(_0x295c8c,null));};
\ No newline at end of file
diff --git a/server/api/chatMessage/chatMessage.events.js b/server/api/chatMessage/chatMessage.events.js
index 01363f2..6be0ada 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 _0x083f=['setMaxListeners','save','update','remove','emit','hasOwnProperty','hook','exports','events','../../mysqldb','ChatMessage'];(function(_0x43c0ba,_0x3ab8fa){var _0x24f72e=function(_0x126ca4){while(--_0x126ca4){_0x43c0ba['push'](_0x43c0ba['shift']());}};_0x24f72e(++_0x3ab8fa);}(_0x083f,0x8c));var _0xf083=function(_0x59ee6f,_0x450239){_0x59ee6f=_0x59ee6f-0x0;var _0x4c0979=_0x083f[_0x59ee6f];return _0x4c0979;};'use strict';var EventEmitter=require(_0xf083('0x0'));var ChatMessage=require(_0xf083('0x1'))['db'][_0xf083('0x2')];var ChatMessageEvents=new EventEmitter();ChatMessageEvents[_0xf083('0x3')](0x0);var events={'afterCreate':_0xf083('0x4'),'afterUpdate':_0xf083('0x5'),'afterDestroy':_0xf083('0x6')};function emitEvent(_0x3d12d0){return function(_0x63154,_0x125011,_0x4fb622){ChatMessageEvents['emit'](_0x3d12d0+':'+_0x63154['id'],_0x63154);ChatMessageEvents[_0xf083('0x7')](_0x3d12d0,_0x63154);_0x4fb622(null);};}for(var e in events){if(events[_0xf083('0x8')](e)){var event=events[e];ChatMessage[_0xf083('0x9')](e,emitEvent(event));}}module[_0xf083('0xa')]=ChatMessageEvents;
\ No newline at end of file
+var _0xb723=['exports','../../mysqldb','ChatMessage','setMaxListeners','save','update','remove','emit','hook'];(function(_0x1174ec,_0x35daa7){var _0x47f1be=function(_0x3451e6){while(--_0x3451e6){_0x1174ec['push'](_0x1174ec['shift']());}};_0x47f1be(++_0x35daa7);}(_0xb723,0xeb));var _0x3b72=function(_0x11f82b,_0x255da7){_0x11f82b=_0x11f82b-0x0;var _0xf6dada=_0xb723[_0x11f82b];return _0xf6dada;};'use strict';var EventEmitter=require('events');var ChatMessage=require(_0x3b72('0x0'))['db'][_0x3b72('0x1')];var ChatMessageEvents=new EventEmitter();ChatMessageEvents[_0x3b72('0x2')](0x0);var events={'afterCreate':_0x3b72('0x3'),'afterUpdate':_0x3b72('0x4'),'afterDestroy':_0x3b72('0x5')};function emitEvent(_0x2f53da){return function(_0xada87f,_0xb5f6a,_0x28e85e){ChatMessageEvents[_0x3b72('0x6')](_0x2f53da+':'+_0xada87f['id'],_0xada87f);ChatMessageEvents[_0x3b72('0x6')](_0x2f53da,_0xada87f);_0x28e85e(null);};}for(var e in events){if(events['hasOwnProperty'](e)){var event=events[e];ChatMessage[_0x3b72('0x7')](e,emitEvent(event));}}module[_0x3b72('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 ea85a9b..224321f 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 _0x3760=['lodash','util','../../config/logger','api','moment','path','../../config/environment','exports','define','chat_messages','fti_chat_messages','body','FULLTEXT','get','direction','toLowerCase','secret','isNil','UserId','ChatInteraction','findOne','ChatInteractionId','then','update','createdAt','catch','error','utf8mb4_unicode_ci'];(function(_0xec9322,_0x2d5b87){var _0x39d576=function(_0x542056){while(--_0x542056){_0xec9322['push'](_0xec9322['shift']());}};_0x39d576(++_0x2d5b87);}(_0x3760,0x1dc));var _0x0376=function(_0x47b58b,_0x41a189){_0x47b58b=_0x47b58b-0x0;var _0x46bebe=_0x3760[_0x47b58b];return _0x46bebe;};'use strict';var _=require(_0x0376('0x0'));var util=require(_0x0376('0x1'));var logger=require(_0x0376('0x2'))(_0x0376('0x3'));var moment=require(_0x0376('0x4'));var BPromise=require('bluebird');var rp=require('request-promise');var fs=require('fs');var path=require(_0x0376('0x5'));var rimraf=require('rimraf');var config=require(_0x0376('0x6'));var attributes=require('./chatMessage.attributes');module[_0x0376('0x7')]=function(_0x2b9d77,_0x2427d8){return _0x2b9d77[_0x0376('0x8')]('ChatMessage',attributes,{'tableName':_0x0376('0x9'),'paranoid':![],'indexes':[{'name':_0x0376('0xa'),'fields':[_0x0376('0xb')],'type':_0x0376('0xc')}],'timestamps':!![],'hooks':{'afterCreate':function(_0x3b871c,_0xc05c7,_0x45adc7){var _0xed5ca=_0x2b9d77['models'];var _0x4902bf=_0x3b871c[_0x0376('0xd')]({'plain':!![]});if(_0x4902bf[_0x0376('0xe')][_0x0376('0xf')]()==='in'||_0x4902bf[_0x0376('0xe')][_0x0376('0xf')]()==='out'&&!_0x4902bf[_0x0376('0x10')]&&!_[_0x0376('0x11')](_0x4902bf[_0x0376('0x12')])){_0xed5ca[_0x0376('0x13')][_0x0376('0x14')]({'where':{'id':_0x4902bf[_0x0376('0x15')]}})[_0x0376('0x16')](function(_0x552829){if(_0x552829){_0x552829[_0x0376('0x17')]({'lastMsgAt':_0x4902bf[_0x0376('0x18')],'lastMsgDirection':_0x4902bf[_0x0376('0xe')][_0x0376('0xf')]()});}})[_0x0376('0x19')](function(_0x14b70c){console[_0x0376('0x1a')](_0x14b70c);});}_0x45adc7();}},'charset':'utf8mb4','collate':_0x0376('0x1b')});};
\ No newline at end of file
+var _0xd028=['error','utf8mb4','utf8mb4_unicode_ci','lodash','util','../../config/logger','api','moment','request-promise','path','rimraf','../../config/environment','./chatMessage.attributes','exports','define','chat_messages','fti_chat_messages','body','models','direction','toLowerCase','secret','UserId','ChatInteractionId','update','createdAt','catch'];(function(_0x4d3106,_0x4ebecb){var _0x2f9f46=function(_0x4f9bf5){while(--_0x4f9bf5){_0x4d3106['push'](_0x4d3106['shift']());}};_0x2f9f46(++_0x4ebecb);}(_0xd028,0x198));var _0x8d02=function(_0x59d692,_0x274b2a){_0x59d692=_0x59d692-0x0;var _0x4458f1=_0xd028[_0x59d692];return _0x4458f1;};'use strict';var _=require(_0x8d02('0x0'));var util=require(_0x8d02('0x1'));var logger=require(_0x8d02('0x2'))(_0x8d02('0x3'));var moment=require(_0x8d02('0x4'));var BPromise=require('bluebird');var rp=require(_0x8d02('0x5'));var fs=require('fs');var path=require(_0x8d02('0x6'));var rimraf=require(_0x8d02('0x7'));var config=require(_0x8d02('0x8'));var attributes=require(_0x8d02('0x9'));module[_0x8d02('0xa')]=function(_0x1631d0,_0x24d5de){return _0x1631d0[_0x8d02('0xb')]('ChatMessage',attributes,{'tableName':_0x8d02('0xc'),'paranoid':![],'indexes':[{'name':_0x8d02('0xd'),'fields':[_0x8d02('0xe')],'type':'FULLTEXT'}],'timestamps':!![],'hooks':{'afterCreate':function(_0x3aa59b,_0x188fdd,_0x40cc77){var _0x145390=_0x1631d0[_0x8d02('0xf')];var _0x554220=_0x3aa59b['get']({'plain':!![]});if(_0x554220[_0x8d02('0x10')]['toLowerCase']()==='in'||_0x554220[_0x8d02('0x10')][_0x8d02('0x11')]()==='out'&&!_0x554220[_0x8d02('0x12')]&&!_['isNil'](_0x554220[_0x8d02('0x13')])){_0x145390['ChatInteraction']['findOne']({'where':{'id':_0x554220[_0x8d02('0x14')]}})['then'](function(_0x277ba8){if(_0x277ba8){_0x277ba8[_0x8d02('0x15')]({'lastMsgAt':_0x554220[_0x8d02('0x16')],'lastMsgDirection':_0x554220[_0x8d02('0x10')]['toLowerCase']()});}})[_0x8d02('0x17')](function(_0x4dec75){console[_0x8d02('0x18')](_0x4dec75);});}_0x40cc77();}},'charset':_0x8d02('0x19'),'collate':_0x8d02('0x1a')});};
\ No newline at end of file
diff --git a/server/api/chatMessage/chatMessage.rpc.js b/server/api/chatMessage/chatMessage.rpc.js
index c989e4d..aa30471 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 _0x382d=['catch','ChatMessage','body','options','raw','CreateChatMessage','lodash','bluebird','randomstring','ioredis','../../mysqldb','../../config/logger','../../config/environment','jayson/promise','client','http','redis','localhost','socket.io-emitter','./chatMessage.socket','register','request','then','info','ChatMessage,\x20%s,\x20%s','debug','request\x20sent','stringify','error','code','message','result'];(function(_0x5504cb,_0x151c75){var _0x32406f=function(_0x2d3352){while(--_0x2d3352){_0x5504cb['push'](_0x5504cb['shift']());}};_0x32406f(++_0x151c75);}(_0x382d,0x66));var _0xd382=function(_0x334be5,_0x583fb1){_0x334be5=_0x334be5-0x0;var _0x205cb5=_0x382d[_0x334be5];return _0x205cb5;};'use strict';var _=require(_0xd382('0x0'));var util=require('util');var moment=require('moment');var BPromise=require(_0xd382('0x1'));var rs=require(_0xd382('0x2'));var fs=require('fs');var Redis=require(_0xd382('0x3'));var db=require(_0xd382('0x4'))['db'];var utils=require('../../config/utils');var logger=require(_0xd382('0x5'))('rpc');var config=require(_0xd382('0x6'));var jayson=require(_0xd382('0x7'));var client=jayson[_0xd382('0x8')][_0xd382('0x9')]({'port':0x232a});config['redis']=_['defaults'](config[_0xd382('0xa')],{'host':_0xd382('0xb'),'port':0x18eb});var socket=require(_0xd382('0xc'))(new Redis(config[_0xd382('0xa')]));require(_0xd382('0xd'))[_0xd382('0xe')](socket);function respondWithRpcPromise(_0x5bdc2c,_0xc9b1bc,_0xb363f){return new BPromise(function(_0x166d11,_0x1cd299){return client[_0xd382('0xf')](_0x5bdc2c,_0xb363f)[_0xd382('0x10')](function(_0x106aee){logger[_0xd382('0x11')](_0xd382('0x12'),_0xc9b1bc,'request\x20sent');logger[_0xd382('0x13')]('ChatMessage,\x20%s,\x20%s,\x20%s',_0xc9b1bc,_0xd382('0x14'),JSON[_0xd382('0x15')](_0x106aee));if(_0x106aee['error']){if(_0x106aee[_0xd382('0x16')][_0xd382('0x17')]===0x1f4){logger['error']('ChatMessage,\x20%s,\x20%s',_0xc9b1bc,_0x106aee['error']['message']);return _0x1cd299(_0x106aee[_0xd382('0x16')]['message']);}logger[_0xd382('0x16')](_0xd382('0x12'),_0xc9b1bc,_0x106aee[_0xd382('0x16')][_0xd382('0x18')]);return _0x166d11(_0x106aee[_0xd382('0x16')]['message']);}else{logger[_0xd382('0x11')](_0xd382('0x12'),_0xc9b1bc,_0xd382('0x14'));_0x166d11(_0x106aee[_0xd382('0x19')][_0xd382('0x18')]);}})[_0xd382('0x1a')](function(_0x1d93a3){logger['error'](_0xd382('0x12'),_0xc9b1bc,_0x1d93a3);_0x1cd299(_0x1d93a3);});});}exports['CreateChatMessage']=function(_0x213f2e){var _0x3bae3c=this;return new Promise(function(_0x20225e,_0x372185){return db[_0xd382('0x1b')]['create'](_0x213f2e[_0xd382('0x1c')],{'raw':_0x213f2e[_0xd382('0x1d')]?_0x213f2e[_0xd382('0x1d')][_0xd382('0x1e')]===undefined?!![]:![]:!![]})[_0xd382('0x10')](function(_0x4cbd2b){logger['info'](_0xd382('0x1f'),_0x213f2e);logger[_0xd382('0x13')](_0xd382('0x1f'),_0x213f2e,JSON['stringify'](_0x4cbd2b));_0x20225e(_0x4cbd2b);})['catch'](function(_0xc1a212){logger[_0xd382('0x16')](_0xd382('0x1f'),_0xc1a212[_0xd382('0x18')],_0x213f2e);_0x372185(_0x3bae3c[_0xd382('0x16')](0x1f4,_0xc1a212[_0xd382('0x18')]));});});};
\ No newline at end of file
+var _0xcbf1=['util','moment','bluebird','ioredis','../../config/utils','rpc','client','redis','localhost','socket.io-emitter','then','info','ChatMessage,\x20%s,\x20%s','request\x20sent','ChatMessage,\x20%s,\x20%s,\x20%s','error','code','message','catch','CreateChatMessage','ChatMessage','create','body','options','raw','debug','lodash'];(function(_0x2e9187,_0x3763f6){var _0x1fc3a8=function(_0xb30d96){while(--_0xb30d96){_0x2e9187['push'](_0x2e9187['shift']());}};_0x1fc3a8(++_0x3763f6);}(_0xcbf1,0xbc));var _0x1cbf=function(_0x3dd15e,_0x1f0015){_0x3dd15e=_0x3dd15e-0x0;var _0x231fd0=_0xcbf1[_0x3dd15e];return _0x231fd0;};'use strict';var _=require(_0x1cbf('0x0'));var util=require(_0x1cbf('0x1'));var moment=require(_0x1cbf('0x2'));var BPromise=require(_0x1cbf('0x3'));var rs=require('randomstring');var fs=require('fs');var Redis=require(_0x1cbf('0x4'));var db=require('../../mysqldb')['db'];var utils=require(_0x1cbf('0x5'));var logger=require('../../config/logger')(_0x1cbf('0x6'));var config=require('../../config/environment');var jayson=require('jayson/promise');var client=jayson[_0x1cbf('0x7')]['http']({'port':0x232a});config['redis']=_['defaults'](config[_0x1cbf('0x8')],{'host':_0x1cbf('0x9'),'port':0x18eb});var socket=require(_0x1cbf('0xa'))(new Redis(config[_0x1cbf('0x8')]));require('./chatMessage.socket')['register'](socket);function respondWithRpcPromise(_0x240ccd,_0x54ace4,_0x3583d2){return new BPromise(function(_0x324f55,_0x27b7f0){return client['request'](_0x240ccd,_0x3583d2)[_0x1cbf('0xb')](function(_0x95542e){logger[_0x1cbf('0xc')](_0x1cbf('0xd'),_0x54ace4,_0x1cbf('0xe'));logger['debug'](_0x1cbf('0xf'),_0x54ace4,_0x1cbf('0xe'),JSON['stringify'](_0x95542e));if(_0x95542e[_0x1cbf('0x10')]){if(_0x95542e[_0x1cbf('0x10')][_0x1cbf('0x11')]===0x1f4){logger[_0x1cbf('0x10')](_0x1cbf('0xd'),_0x54ace4,_0x95542e['error']['message']);return _0x27b7f0(_0x95542e[_0x1cbf('0x10')][_0x1cbf('0x12')]);}logger[_0x1cbf('0x10')]('ChatMessage,\x20%s,\x20%s',_0x54ace4,_0x95542e[_0x1cbf('0x10')]['message']);return _0x324f55(_0x95542e[_0x1cbf('0x10')][_0x1cbf('0x12')]);}else{logger[_0x1cbf('0xc')](_0x1cbf('0xd'),_0x54ace4,'request\x20sent');_0x324f55(_0x95542e['result'][_0x1cbf('0x12')]);}})[_0x1cbf('0x13')](function(_0x4dd30d){logger[_0x1cbf('0x10')](_0x1cbf('0xd'),_0x54ace4,_0x4dd30d);_0x27b7f0(_0x4dd30d);});});}exports[_0x1cbf('0x14')]=function(_0x307c5e){var _0x922c07=this;return new Promise(function(_0x3eac6a,_0x5cf70f){return db[_0x1cbf('0x15')][_0x1cbf('0x16')](_0x307c5e[_0x1cbf('0x17')],{'raw':_0x307c5e[_0x1cbf('0x18')]?_0x307c5e[_0x1cbf('0x18')][_0x1cbf('0x19')]===undefined?!![]:![]:!![]})[_0x1cbf('0xb')](function(_0x3a7924){logger['info'](_0x1cbf('0x14'),_0x307c5e);logger[_0x1cbf('0x1a')](_0x1cbf('0x14'),_0x307c5e,JSON['stringify'](_0x3a7924));_0x3eac6a(_0x3a7924);})[_0x1cbf('0x13')](function(_0x59f5f6){logger[_0x1cbf('0x10')]('CreateChatMessage',_0x59f5f6[_0x1cbf('0x12')],_0x307c5e);_0x5cf70f(_0x922c07['error'](0x1f4,_0x59f5f6[_0x1cbf('0x12')]));});});};
\ No newline at end of file
diff --git a/server/api/chatMessage/chatMessage.socket.js b/server/api/chatMessage/chatMessage.socket.js
index 3520f27..dcf4970 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 _0x71ab=['length','chatMessage:','save','update','emit','removeListener','register'];(function(_0xa3ff31,_0x27ff91){var _0x401b5b=function(_0x52d8cb){while(--_0x52d8cb){_0xa3ff31['push'](_0xa3ff31['shift']());}};_0x401b5b(++_0x27ff91);}(_0x71ab,0x64));var _0xb71a=function(_0x19e35c,_0x29cd1e){_0x19e35c=_0x19e35c-0x0;var _0x3e1fe8=_0x71ab[_0x19e35c];return _0x3e1fe8;};'use strict';var ChatMessageEvents=require('./chatMessage.events');var events=[_0xb71a('0x0'),'remove',_0xb71a('0x1')];function createListener(_0x5bdf89,_0x3e985a){return function(_0x3f0529){_0x3e985a[_0xb71a('0x2')](_0x5bdf89,_0x3f0529);};}function removeListener(_0x4094b2,_0x37ce74){return function(){ChatMessageEvents[_0xb71a('0x3')](_0x4094b2,_0x37ce74);};}exports[_0xb71a('0x4')]=function(_0x38d931){for(var _0x22c072=0x0,_0x35a84e=events[_0xb71a('0x5')];_0x22c072<_0x35a84e;_0x22c072++){var _0x2a4c86=events[_0x22c072];var _0x43ca14=createListener(_0xb71a('0x6')+_0x2a4c86,_0x38d931);ChatMessageEvents['on'](_0x2a4c86,_0x43ca14);}};
\ No newline at end of file
+var _0x187d=['./chatMessage.events','remove','update','emit','removeListener','length','chatMessage:'];(function(_0x447b2b,_0x5bbcc5){var _0x471d98=function(_0x44cc0d){while(--_0x44cc0d){_0x447b2b['push'](_0x447b2b['shift']());}};_0x471d98(++_0x5bbcc5);}(_0x187d,0x93));var _0xd187=function(_0x37c22c,_0x28a70d){_0x37c22c=_0x37c22c-0x0;var _0x119d79=_0x187d[_0x37c22c];return _0x119d79;};'use strict';var ChatMessageEvents=require(_0xd187('0x0'));var events=['save',_0xd187('0x1'),_0xd187('0x2')];function createListener(_0x44d5f6,_0x1cb41f){return function(_0x18498b){_0x1cb41f[_0xd187('0x3')](_0x44d5f6,_0x18498b);};}function removeListener(_0x58622a,_0x28fa0b){return function(){ChatMessageEvents[_0xd187('0x4')](_0x58622a,_0x28fa0b);};}exports['register']=function(_0x1d2533){for(var _0x58ee7=0x0,_0x444a60=events[_0xd187('0x5')];_0x58ee7<_0x444a60;_0x58ee7++){var _0x28ce2f=events[_0x58ee7];var _0x2d6992=createListener(_0xd187('0x6')+_0x28ce2f,_0x1d2533);ChatMessageEvents['on'](_0x28ce2f,_0x2d6992);}};
\ No newline at end of file
diff --git a/server/api/chatMessage/index.js b/server/api/chatMessage/index.js
index 27fca9e..4dea795 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 _0xaab6=['isAuthenticated','index','/describe','describe','/:id','show','post','chatmessage:create','create','put','update','accept','/:id/reject','destroy','exports','multer','util','connect-timeout','express','../../components/auth/service','../../config/environment','./chatMessage.controller','get'];(function(_0x36d04d,_0x469817){var _0x213b48=function(_0x407b54){while(--_0x407b54){_0x36d04d['push'](_0x36d04d['shift']());}};_0x213b48(++_0x469817);}(_0xaab6,0x6b));var _0x6aab=function(_0x4091b5,_0x2a11af){_0x4091b5=_0x4091b5-0x0;var _0x169832=_0xaab6[_0x4091b5];return _0x169832;};'use strict';var multer=require(_0x6aab('0x0'));var util=require(_0x6aab('0x1'));var path=require('path');var timeout=require(_0x6aab('0x2'));var express=require(_0x6aab('0x3'));var router=express['Router']();var auth=require(_0x6aab('0x4'));var interaction=require('../../components/interaction/service');var config=require(_0x6aab('0x5'));var controller=require(_0x6aab('0x6'));router[_0x6aab('0x7')]('/',auth[_0x6aab('0x8')](),controller[_0x6aab('0x9')]);router['get'](_0x6aab('0xa'),auth[_0x6aab('0x8')](),controller[_0x6aab('0xb')]);router[_0x6aab('0x7')](_0x6aab('0xc'),auth[_0x6aab('0x8')](),controller[_0x6aab('0xd')]);router[_0x6aab('0xe')]('/',auth[_0x6aab('0x8')](),interaction['tracked']('chat',_0x6aab('0xf')),controller[_0x6aab('0x10')]);router[_0x6aab('0x11')]('/:id',controller[_0x6aab('0x12')]);router[_0x6aab('0x11')]('/:id/accept',auth[_0x6aab('0x8')](),controller[_0x6aab('0x13')]);router['put'](_0x6aab('0x14'),auth[_0x6aab('0x8')](),controller['reject']);router['delete'](_0x6aab('0xc'),auth['isAuthenticated'](),controller[_0x6aab('0x15')]);module[_0x6aab('0x16')]=router;
\ No newline at end of file
+var _0x05b3=['/:id','tracked','chat','chatmessage:create','create','put','update','/:id/accept','accept','/:id/reject','destroy','exports','multer','util','path','connect-timeout','express','Router','../../components/auth/service','../../components/interaction/service','../../config/environment','./chatMessage.controller','get','isAuthenticated','index'];(function(_0x523542,_0x20539a){var _0x33727e=function(_0x5c7e0f){while(--_0x5c7e0f){_0x523542['push'](_0x523542['shift']());}};_0x33727e(++_0x20539a);}(_0x05b3,0x183));var _0x305b=function(_0x3b0912,_0x39d739){_0x3b0912=_0x3b0912-0x0;var _0xa8f339=_0x05b3[_0x3b0912];return _0xa8f339;};'use strict';var multer=require(_0x305b('0x0'));var util=require(_0x305b('0x1'));var path=require(_0x305b('0x2'));var timeout=require(_0x305b('0x3'));var express=require(_0x305b('0x4'));var router=express[_0x305b('0x5')]();var auth=require(_0x305b('0x6'));var interaction=require(_0x305b('0x7'));var config=require(_0x305b('0x8'));var controller=require(_0x305b('0x9'));router[_0x305b('0xa')]('/',auth[_0x305b('0xb')](),controller[_0x305b('0xc')]);router[_0x305b('0xa')]('/describe',auth[_0x305b('0xb')](),controller['describe']);router[_0x305b('0xa')](_0x305b('0xd'),auth[_0x305b('0xb')](),controller['show']);router['post']('/',auth[_0x305b('0xb')](),interaction[_0x305b('0xe')](_0x305b('0xf'),_0x305b('0x10')),controller[_0x305b('0x11')]);router[_0x305b('0x12')]('/:id',controller[_0x305b('0x13')]);router[_0x305b('0x12')](_0x305b('0x14'),auth[_0x305b('0xb')](),controller[_0x305b('0x15')]);router[_0x305b('0x12')](_0x305b('0x16'),auth['isAuthenticated'](),controller['reject']);router['delete'](_0x305b('0xd'),auth[_0x305b('0xb')](),controller[_0x305b('0x17')]);module[_0x305b('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 e96146c..b525d98 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 _0xad48=['TEXT'];(function(_0x3865bf,_0x267f5d){var _0x2b76c1=function(_0x2b2931){while(--_0x2b2931){_0x3865bf['push'](_0x3865bf['shift']());}};_0x2b76c1(++_0x267f5d);}(_0xad48,0x1ef));var _0x8ad4=function(_0x48053f,_0x5080d7){_0x48053f=_0x48053f-0x0;var _0x5a0ef3=_0xad48[_0x48053f];return _0x5a0ef3;};'use strict';var Sequelize=require('sequelize');module['exports']={'body':{'type':Sequelize[_0x8ad4('0x0')]('medium'),'allowNull':![]}};
\ No newline at end of file
+var _0x42a3=['medium','exports'];(function(_0x25a597,_0xa4ae6d){var _0x2a5eb4=function(_0x3e36cb){while(--_0x3e36cb){_0x25a597['push'](_0x25a597['shift']());}};_0x2a5eb4(++_0xa4ae6d);}(_0x42a3,0x1e3));var _0x342a=function(_0x3ebffe,_0x36e9d4){_0x3ebffe=_0x3ebffe-0x0;var _0x44568b=_0x42a3[_0x3ebffe];return _0x44568b;};'use strict';var Sequelize=require('sequelize');module[_0x342a('0x0')]={'body':{'type':Sequelize['TEXT'](_0x342a('0x1')),'allowNull':![]}};
\ No newline at end of file
diff --git a/server/api/chatOfflineMessage/chatOfflineMessage.controller.js b/server/api/chatOfflineMessage/chatOfflineMessage.controller.js
index 878ae1f..58dac37 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 _0xa66b=['catch','show','params','length','find','create','body','destroy','describe','html-pdf','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','moment','util','path','to-csv','lodash','squel','jsforce','querystring','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','api','../../config/utils','../../config/environment','sendStatus','status','end','offset','limit','Content-Range','json','apply','reject','update','then','error','stack','name','map','ChatOfflineMessage','fieldName','query','keys','filters','intersection','attributes','model','fields','order','sort','where','pick','merge','type','VIRTUAL','filter','count','includeAll','findAll'];(function(_0x4e6b5e,_0x227316){var _0x2532f3=function(_0x1fed23){while(--_0x1fed23){_0x4e6b5e['push'](_0x4e6b5e['shift']());}};_0x2532f3(++_0x227316);}(_0xa66b,0x1d0));var _0xba66=function(_0x2e0763,_0x37e6e4){_0x2e0763=_0x2e0763-0x0;var _0x189643=_0xa66b[_0x2e0763];return _0x189643;};'use strict';var pdf=require(_0xba66('0x0'));var emlformat=require(_0xba66('0x1'));var rimraf=require(_0xba66('0x2'));var zipdir=require(_0xba66('0x3'));var jsonpatch=require(_0xba66('0x4'));var rp=require(_0xba66('0x5'));var moment=require(_0xba66('0x6'));var BPromise=require('bluebird');var Mustache=require('mustache');var util=require(_0xba66('0x7'));var path=require(_0xba66('0x8'));var sox=require('sox');var csv=require(_0xba66('0x9'));var ejs=require('ejs');var fs=require('fs');var _=require(_0xba66('0xa'));var squel=require(_0xba66('0xb'));var crypto=require('crypto');var jsforce=require(_0xba66('0xc'));var deskjs=require('desk.js');var toCsv=require(_0xba66('0x9'));var querystring=require(_0xba66('0xd'));var Papa=require('papaparse');var Redis=require(_0xba66('0xe'));var authService=require(_0xba66('0xf'));var qs=require(_0xba66('0x10'));var as=require(_0xba66('0x11'));var hardwareService=require('../../config/license/hardware');var logger=require('../../config/logger')(_0xba66('0x12'));var utils=require(_0xba66('0x13'));var config=require(_0xba66('0x14'));var db=require('../../mysqldb')['db'];function respondWithStatusCode(_0x1e5fc6,_0x46b456){_0x46b456=_0x46b456||0xcc;return function(_0x45d95f){if(_0x45d95f){return _0x1e5fc6[_0xba66('0x15')](_0x46b456);}return _0x1e5fc6[_0xba66('0x16')](_0x46b456)[_0xba66('0x17')]();};}function respondWithResult(_0x30cbae,_0x1d08c9){_0x1d08c9=_0x1d08c9||0xc8;return function(_0x4d444e){if(_0x4d444e){return _0x30cbae[_0xba66('0x16')](_0x1d08c9)['json'](_0x4d444e);}};}function respondWithFilteredResult(_0x549915,_0x375da4){return function(_0x5067ff){if(_0x5067ff){var _0x2b3757=_0x5067ff['count'],_0x408318=_0x375da4[_0xba66('0x18')],_0x1df5e8=_0x375da4['offset']+_0x375da4[_0xba66('0x19')],_0xff566f;if(_0x1df5e8>=_0x2b3757){_0x1df5e8=_0x2b3757;_0xff566f=0xc8;}else{_0xff566f=0xce;}_0x549915[_0xba66('0x16')](_0xff566f);return _0x549915['set'](_0xba66('0x1a'),_0x408318+'-'+_0x1df5e8+'/'+_0x2b3757)[_0xba66('0x1b')](_0x5067ff);}return null;};}function patchUpdates(_0x179ee2){return function(_0x2e5180){try{jsonpatch[_0xba66('0x1c')](_0x2e5180,_0x179ee2,!![]);}catch(_0x4d8dc5){return BPromise[_0xba66('0x1d')](_0x4d8dc5);}return _0x2e5180['save']();};}function saveUpdates(_0x30b11b,_0x18bdb8){return function(_0x3407d4){if(_0x3407d4){return _0x3407d4[_0xba66('0x1e')](_0x30b11b)[_0xba66('0x1f')](function(_0x429952){return _0x429952;});}return null;};}function removeEntity(_0x551d05,_0x1749b0){return function(_0x1f8cc1){if(_0x1f8cc1){return _0x1f8cc1['destroy']()['then'](function(){_0x551d05[_0xba66('0x16')](0xcc)[_0xba66('0x17')]();});}};}function handleEntityNotFound(_0x53558d,_0x200333){return function(_0x227c48){if(!_0x227c48){_0x53558d[_0xba66('0x15')](0x194);}return _0x227c48;};}function handleError(_0x27bbeb,_0x3eb211){_0x3eb211=_0x3eb211||0x1f4;return function(_0x303d0f){logger[_0xba66('0x20')](_0x303d0f[_0xba66('0x21')]);if(_0x303d0f[_0xba66('0x22')]){delete _0x303d0f[_0xba66('0x22')];}_0x27bbeb['status'](_0x3eb211)['send'](_0x303d0f);};}exports['index']=function(_0x366c88,_0xed2c93){var _0x36303f={},_0x43a9a6={},_0x1bb530={'count':0x0,'rows':[]};var _0x130595=_[_0xba66('0x23')](db[_0xba66('0x24')]['rawAttributes'],function(_0x2a2cd0){return{'name':_0x2a2cd0[_0xba66('0x25')],'type':_0x2a2cd0['type']['key']};});_0x43a9a6['model']=_['map'](_0x130595,'name');_0x43a9a6[_0xba66('0x26')]=_[_0xba66('0x27')](_0x366c88[_0xba66('0x26')]);_0x43a9a6[_0xba66('0x28')]=_[_0xba66('0x29')](_0x43a9a6['model'],_0x43a9a6[_0xba66('0x26')]);_0x36303f[_0xba66('0x2a')]=_[_0xba66('0x29')](_0x43a9a6[_0xba66('0x2b')],qs[_0xba66('0x2c')](_0x366c88[_0xba66('0x26')]['fields']));_0x36303f[_0xba66('0x2a')]=_0x36303f['attributes']['length']?_0x36303f['attributes']:_0x43a9a6[_0xba66('0x2b')];if(!_0x366c88[_0xba66('0x26')]['hasOwnProperty']('nolimit')){_0x36303f[_0xba66('0x19')]=qs['limit'](_0x366c88[_0xba66('0x26')]['limit']);_0x36303f[_0xba66('0x18')]=qs[_0xba66('0x18')](_0x366c88[_0xba66('0x26')][_0xba66('0x18')]);}_0x36303f[_0xba66('0x2d')]=qs[_0xba66('0x2e')](_0x366c88['query'][_0xba66('0x2e')]);_0x36303f[_0xba66('0x2f')]=qs['filters'](_[_0xba66('0x30')](_0x366c88[_0xba66('0x26')],_0x43a9a6[_0xba66('0x28')]));if(_0x366c88[_0xba66('0x26')]['filter']){_0x36303f[_0xba66('0x2f')]=_[_0xba66('0x31')](_0x36303f['where'],{'$or':_[_0xba66('0x23')](_0x130595,function(_0x573a4d){if(_0x573a4d[_0xba66('0x32')]!==_0xba66('0x33')){var _0x4836b2={};_0x4836b2[_0x573a4d['name']]={'$like':'%'+_0x366c88[_0xba66('0x26')][_0xba66('0x34')]+'%'};return _0x4836b2;}})});}_0x36303f=_[_0xba66('0x31')]({},_0x36303f,_0x366c88['options']);var _0x1fa099={'where':_0x36303f[_0xba66('0x2f')]};return db[_0xba66('0x24')][_0xba66('0x35')](_0x1fa099)[_0xba66('0x1f')](function(_0x5ca5ff){_0x1bb530[_0xba66('0x35')]=_0x5ca5ff;if(_0x366c88['query'][_0xba66('0x36')]){_0x36303f['include']=[{'all':!![]}];}return db[_0xba66('0x24')][_0xba66('0x37')](_0x36303f);})[_0xba66('0x1f')](function(_0x56a741){_0x1bb530['rows']=_0x56a741;return _0x1bb530;})[_0xba66('0x1f')](respondWithFilteredResult(_0xed2c93,_0x36303f))[_0xba66('0x38')](handleError(_0xed2c93,null));};exports[_0xba66('0x39')]=function(_0x251026,_0x4cb0eb){var _0x4e23f9={'raw':!![],'where':{'id':_0x251026[_0xba66('0x3a')]['id']}},_0x536797={};_0x536797['model']=_[_0xba66('0x27')](db[_0xba66('0x24')]['rawAttributes']);_0x536797[_0xba66('0x26')]=_[_0xba66('0x27')](_0x251026[_0xba66('0x26')]);_0x536797[_0xba66('0x28')]=_[_0xba66('0x29')](_0x536797[_0xba66('0x2b')],_0x536797['query']);_0x4e23f9[_0xba66('0x2a')]=_['intersection'](_0x536797['model'],qs[_0xba66('0x2c')](_0x251026[_0xba66('0x26')][_0xba66('0x2c')]));_0x4e23f9[_0xba66('0x2a')]=_0x4e23f9['attributes'][_0xba66('0x3b')]?_0x4e23f9['attributes']:_0x536797[_0xba66('0x2b')];if(_0x251026[_0xba66('0x26')][_0xba66('0x36')]){_0x4e23f9['include']=[{'all':!![]}];}_0x4e23f9=_[_0xba66('0x31')]({},_0x4e23f9,_0x251026['options']);return db['ChatOfflineMessage'][_0xba66('0x3c')](_0x4e23f9)[_0xba66('0x1f')](handleEntityNotFound(_0x4cb0eb,null))[_0xba66('0x1f')](respondWithResult(_0x4cb0eb,null))[_0xba66('0x38')](handleError(_0x4cb0eb,null));};exports[_0xba66('0x3d')]=function(_0x352a9e,_0xfef5c1){return db['ChatOfflineMessage'][_0xba66('0x3d')](_0x352a9e[_0xba66('0x3e')],{})[_0xba66('0x1f')](respondWithResult(_0xfef5c1,0xc9))['catch'](handleError(_0xfef5c1,null));};exports[_0xba66('0x1e')]=function(_0x302782,_0x119d43){if(_0x302782[_0xba66('0x3e')]['id']){delete _0x302782[_0xba66('0x3e')]['id'];}return db['ChatOfflineMessage']['find']({'where':{'id':_0x302782[_0xba66('0x3a')]['id']}})[_0xba66('0x1f')](handleEntityNotFound(_0x119d43,null))[_0xba66('0x1f')](saveUpdates(_0x302782[_0xba66('0x3e')],null))[_0xba66('0x1f')](respondWithResult(_0x119d43,null))[_0xba66('0x38')](handleError(_0x119d43,null));};exports[_0xba66('0x3f')]=function(_0x1c5080,_0x2cdf4d){return db[_0xba66('0x24')][_0xba66('0x3c')]({'where':{'id':_0x1c5080[_0xba66('0x3a')]['id']}})[_0xba66('0x1f')](handleEntityNotFound(_0x2cdf4d,null))[_0xba66('0x1f')](removeEntity(_0x2cdf4d,null))['catch'](handleError(_0x2cdf4d,null));};exports['describe']=function(_0x1d5d7c,_0x53849e){return db[_0xba66('0x24')][_0xba66('0x40')]()['then'](respondWithResult(_0x53849e,null))[_0xba66('0x38')](handleError(_0x53849e,null));};
\ No newline at end of file
+var _0x993e=['set','Content-Range','apply','reject','save','then','destroy','end','error','stack','name','send','index','map','rawAttributes','type','key','model','query','keys','filters','intersection','attributes','fields','nolimit','sort','pick','where','merge','VIRTUAL','filter','options','ChatOfflineMessage','includeAll','findAll','catch','params','length','find','create','body','update','describe','rimraf','zip-dir','fast-json-patch','request-promise','moment','bluebird','mustache','util','path','sox','ejs','squel','jsforce','to-csv','querystring','ioredis','../../components/auth/service','../../components/parsers/advancedSearch','../../config/license/hardware','api','../../config/utils','../../config/environment','sendStatus','status','json','count','offset','limit'];(function(_0x3ec5a3,_0x40cac0){var _0x3bc8dc=function(_0x240980){while(--_0x240980){_0x3ec5a3['push'](_0x3ec5a3['shift']());}};_0x3bc8dc(++_0x40cac0);}(_0x993e,0x1d5));var _0xe993=function(_0x122ef9,_0x451d2a){_0x122ef9=_0x122ef9-0x0;var _0x42fba0=_0x993e[_0x122ef9];return _0x42fba0;};'use strict';var pdf=require('html-pdf');var emlformat=require('eml-format');var rimraf=require(_0xe993('0x0'));var zipdir=require(_0xe993('0x1'));var jsonpatch=require(_0xe993('0x2'));var rp=require(_0xe993('0x3'));var moment=require(_0xe993('0x4'));var BPromise=require(_0xe993('0x5'));var Mustache=require(_0xe993('0x6'));var util=require(_0xe993('0x7'));var path=require(_0xe993('0x8'));var sox=require(_0xe993('0x9'));var csv=require('to-csv');var ejs=require(_0xe993('0xa'));var fs=require('fs');var _=require('lodash');var squel=require(_0xe993('0xb'));var crypto=require('crypto');var jsforce=require(_0xe993('0xc'));var deskjs=require('desk.js');var toCsv=require(_0xe993('0xd'));var querystring=require(_0xe993('0xe'));var Papa=require('papaparse');var Redis=require(_0xe993('0xf'));var authService=require(_0xe993('0x10'));var qs=require('../../components/parsers/qs');var as=require(_0xe993('0x11'));var hardwareService=require(_0xe993('0x12'));var logger=require('../../config/logger')(_0xe993('0x13'));var utils=require(_0xe993('0x14'));var config=require(_0xe993('0x15'));var db=require('../../mysqldb')['db'];function respondWithStatusCode(_0x5ac7a3,_0x27c3fc){_0x27c3fc=_0x27c3fc||0xcc;return function(_0x208522){if(_0x208522){return _0x5ac7a3[_0xe993('0x16')](_0x27c3fc);}return _0x5ac7a3[_0xe993('0x17')](_0x27c3fc)['end']();};}function respondWithResult(_0x478d3f,_0x5c07dc){_0x5c07dc=_0x5c07dc||0xc8;return function(_0x3aab92){if(_0x3aab92){return _0x478d3f[_0xe993('0x17')](_0x5c07dc)[_0xe993('0x18')](_0x3aab92);}};}function respondWithFilteredResult(_0x4ea8e0,_0x17a974){return function(_0x1cd682){if(_0x1cd682){var _0x3593df=_0x1cd682[_0xe993('0x19')],_0x4dc2c5=_0x17a974[_0xe993('0x1a')],_0x56f3a7=_0x17a974[_0xe993('0x1a')]+_0x17a974[_0xe993('0x1b')],_0x26fed6;if(_0x56f3a7>=_0x3593df){_0x56f3a7=_0x3593df;_0x26fed6=0xc8;}else{_0x26fed6=0xce;}_0x4ea8e0[_0xe993('0x17')](_0x26fed6);return _0x4ea8e0[_0xe993('0x1c')](_0xe993('0x1d'),_0x4dc2c5+'-'+_0x56f3a7+'/'+_0x3593df)['json'](_0x1cd682);}return null;};}function patchUpdates(_0x577d08){return function(_0xafb96f){try{jsonpatch[_0xe993('0x1e')](_0xafb96f,_0x577d08,!![]);}catch(_0x695d05){return BPromise[_0xe993('0x1f')](_0x695d05);}return _0xafb96f[_0xe993('0x20')]();};}function saveUpdates(_0x272953,_0x2e6234){return function(_0x18946c){if(_0x18946c){return _0x18946c['update'](_0x272953)[_0xe993('0x21')](function(_0x3f2e49){return _0x3f2e49;});}return null;};}function removeEntity(_0x2bb53d,_0x4ffd0c){return function(_0x24a984){if(_0x24a984){return _0x24a984[_0xe993('0x22')]()[_0xe993('0x21')](function(){_0x2bb53d[_0xe993('0x17')](0xcc)[_0xe993('0x23')]();});}};}function handleEntityNotFound(_0x5eec0b,_0x2f8f84){return function(_0x2fb4ad){if(!_0x2fb4ad){_0x5eec0b[_0xe993('0x16')](0x194);}return _0x2fb4ad;};}function handleError(_0x57d360,_0x5ac5ea){_0x5ac5ea=_0x5ac5ea||0x1f4;return function(_0x40d99c){logger[_0xe993('0x24')](_0x40d99c[_0xe993('0x25')]);if(_0x40d99c[_0xe993('0x26')]){delete _0x40d99c[_0xe993('0x26')];}_0x57d360['status'](_0x5ac5ea)[_0xe993('0x27')](_0x40d99c);};}exports[_0xe993('0x28')]=function(_0x41d72c,_0x11ef0e){var _0x7762aa={},_0x43cf01={},_0x3c2b4e={'count':0x0,'rows':[]};var _0x2b5d7a=_[_0xe993('0x29')](db['ChatOfflineMessage'][_0xe993('0x2a')],function(_0x10be2d){return{'name':_0x10be2d['fieldName'],'type':_0x10be2d[_0xe993('0x2b')][_0xe993('0x2c')]};});_0x43cf01[_0xe993('0x2d')]=_['map'](_0x2b5d7a,_0xe993('0x26'));_0x43cf01[_0xe993('0x2e')]=_[_0xe993('0x2f')](_0x41d72c['query']);_0x43cf01[_0xe993('0x30')]=_[_0xe993('0x31')](_0x43cf01[_0xe993('0x2d')],_0x43cf01[_0xe993('0x2e')]);_0x7762aa[_0xe993('0x32')]=_[_0xe993('0x31')](_0x43cf01[_0xe993('0x2d')],qs['fields'](_0x41d72c[_0xe993('0x2e')][_0xe993('0x33')]));_0x7762aa[_0xe993('0x32')]=_0x7762aa['attributes']['length']?_0x7762aa[_0xe993('0x32')]:_0x43cf01[_0xe993('0x2d')];if(!_0x41d72c[_0xe993('0x2e')]['hasOwnProperty'](_0xe993('0x34'))){_0x7762aa['limit']=qs[_0xe993('0x1b')](_0x41d72c[_0xe993('0x2e')][_0xe993('0x1b')]);_0x7762aa['offset']=qs[_0xe993('0x1a')](_0x41d72c[_0xe993('0x2e')][_0xe993('0x1a')]);}_0x7762aa['order']=qs[_0xe993('0x35')](_0x41d72c['query'][_0xe993('0x35')]);_0x7762aa['where']=qs[_0xe993('0x30')](_[_0xe993('0x36')](_0x41d72c[_0xe993('0x2e')],_0x43cf01[_0xe993('0x30')]));if(_0x41d72c[_0xe993('0x2e')]['filter']){_0x7762aa[_0xe993('0x37')]=_[_0xe993('0x38')](_0x7762aa['where'],{'$or':_[_0xe993('0x29')](_0x2b5d7a,function(_0x1fd642){if(_0x1fd642['type']!==_0xe993('0x39')){var _0x2891d9={};_0x2891d9[_0x1fd642[_0xe993('0x26')]]={'$like':'%'+_0x41d72c['query'][_0xe993('0x3a')]+'%'};return _0x2891d9;}})});}_0x7762aa=_[_0xe993('0x38')]({},_0x7762aa,_0x41d72c[_0xe993('0x3b')]);var _0x70ac45={'where':_0x7762aa['where']};return db[_0xe993('0x3c')]['count'](_0x70ac45)[_0xe993('0x21')](function(_0xe443f2){_0x3c2b4e[_0xe993('0x19')]=_0xe443f2;if(_0x41d72c[_0xe993('0x2e')][_0xe993('0x3d')]){_0x7762aa['include']=[{'all':!![]}];}return db[_0xe993('0x3c')][_0xe993('0x3e')](_0x7762aa);})[_0xe993('0x21')](function(_0x22a318){_0x3c2b4e['rows']=_0x22a318;return _0x3c2b4e;})[_0xe993('0x21')](respondWithFilteredResult(_0x11ef0e,_0x7762aa))[_0xe993('0x3f')](handleError(_0x11ef0e,null));};exports['show']=function(_0x4ac80a,_0x31327e){var _0x6b4ffc={'raw':!![],'where':{'id':_0x4ac80a[_0xe993('0x40')]['id']}},_0x52f0e0={};_0x52f0e0[_0xe993('0x2d')]=_[_0xe993('0x2f')](db[_0xe993('0x3c')]['rawAttributes']);_0x52f0e0['query']=_[_0xe993('0x2f')](_0x4ac80a[_0xe993('0x2e')]);_0x52f0e0['filters']=_[_0xe993('0x31')](_0x52f0e0[_0xe993('0x2d')],_0x52f0e0[_0xe993('0x2e')]);_0x6b4ffc['attributes']=_[_0xe993('0x31')](_0x52f0e0['model'],qs[_0xe993('0x33')](_0x4ac80a[_0xe993('0x2e')]['fields']));_0x6b4ffc[_0xe993('0x32')]=_0x6b4ffc[_0xe993('0x32')][_0xe993('0x41')]?_0x6b4ffc[_0xe993('0x32')]:_0x52f0e0['model'];if(_0x4ac80a[_0xe993('0x2e')]['includeAll']){_0x6b4ffc['include']=[{'all':!![]}];}_0x6b4ffc=_['merge']({},_0x6b4ffc,_0x4ac80a['options']);return db[_0xe993('0x3c')][_0xe993('0x42')](_0x6b4ffc)[_0xe993('0x21')](handleEntityNotFound(_0x31327e,null))[_0xe993('0x21')](respondWithResult(_0x31327e,null))[_0xe993('0x3f')](handleError(_0x31327e,null));};exports[_0xe993('0x43')]=function(_0x9783b9,_0x346bf0){return db[_0xe993('0x3c')]['create'](_0x9783b9[_0xe993('0x44')],{})[_0xe993('0x21')](respondWithResult(_0x346bf0,0xc9))['catch'](handleError(_0x346bf0,null));};exports[_0xe993('0x45')]=function(_0x4f7f6f,_0x3613ea){if(_0x4f7f6f[_0xe993('0x44')]['id']){delete _0x4f7f6f[_0xe993('0x44')]['id'];}return db[_0xe993('0x3c')]['find']({'where':{'id':_0x4f7f6f[_0xe993('0x40')]['id']}})[_0xe993('0x21')](handleEntityNotFound(_0x3613ea,null))['then'](saveUpdates(_0x4f7f6f[_0xe993('0x44')],null))['then'](respondWithResult(_0x3613ea,null))[_0xe993('0x3f')](handleError(_0x3613ea,null));};exports[_0xe993('0x22')]=function(_0xa7e269,_0x3d421a){return db[_0xe993('0x3c')][_0xe993('0x42')]({'where':{'id':_0xa7e269[_0xe993('0x40')]['id']}})[_0xe993('0x21')](handleEntityNotFound(_0x3d421a,null))['then'](removeEntity(_0x3d421a,null))['catch'](handleError(_0x3d421a,null));};exports['describe']=function(_0x2f109b,_0x3f39c0){return db[_0xe993('0x3c')][_0xe993('0x46')]()['then'](respondWithResult(_0x3f39c0,null))[_0xe993('0x3f')](handleError(_0x3f39c0,null));};
\ No newline at end of file
diff --git a/server/api/chatOfflineMessage/chatOfflineMessage.model.js b/server/api/chatOfflineMessage/chatOfflineMessage.model.js
index b05e53a..965b17d 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 _0x0e85=['chat_offline_messages','utf8mb4','utf8mb4_unicode_ci','lodash','util','api','moment','rimraf','./chatOfflineMessage.attributes','exports','ChatOfflineMessage'];(function(_0x3d0e56,_0x5f101e){var _0x108e4c=function(_0x54f125){while(--_0x54f125){_0x3d0e56['push'](_0x3d0e56['shift']());}};_0x108e4c(++_0x5f101e);}(_0x0e85,0x7c));var _0x50e8=function(_0x38ced4,_0x24263f){_0x38ced4=_0x38ced4-0x0;var _0x547c07=_0x0e85[_0x38ced4];return _0x547c07;};'use strict';var _=require(_0x50e8('0x0'));var util=require(_0x50e8('0x1'));var logger=require('../../config/logger')(_0x50e8('0x2'));var moment=require(_0x50e8('0x3'));var BPromise=require('bluebird');var rp=require('request-promise');var fs=require('fs');var path=require('path');var rimraf=require(_0x50e8('0x4'));var config=require('../../config/environment');var attributes=require(_0x50e8('0x5'));module[_0x50e8('0x6')]=function(_0xe3151e,_0xfde42){return _0xe3151e['define'](_0x50e8('0x7'),attributes,{'tableName':_0x50e8('0x8'),'paranoid':![],'indexes':[],'timestamps':!![],'charset':_0x50e8('0x9'),'collate':_0x50e8('0xa')});};
\ No newline at end of file
+var _0x5c12=['request-promise','path','rimraf','../../config/environment','./chatOfflineMessage.attributes','define','utf8mb4','utf8mb4_unicode_ci','util','../../config/logger','moment','bluebird'];(function(_0x3dd15e,_0x1f0015){var _0x231fd0=function(_0x4f680a){while(--_0x4f680a){_0x3dd15e['push'](_0x3dd15e['shift']());}};_0x231fd0(++_0x1f0015);}(_0x5c12,0x188));var _0x25c1=function(_0x10f6e8,_0x351db6){_0x10f6e8=_0x10f6e8-0x0;var _0x35bb3c=_0x5c12[_0x10f6e8];return _0x35bb3c;};'use strict';var _=require('lodash');var util=require(_0x25c1('0x0'));var logger=require(_0x25c1('0x1'))('api');var moment=require(_0x25c1('0x2'));var BPromise=require(_0x25c1('0x3'));var rp=require(_0x25c1('0x4'));var fs=require('fs');var path=require(_0x25c1('0x5'));var rimraf=require(_0x25c1('0x6'));var config=require(_0x25c1('0x7'));var attributes=require(_0x25c1('0x8'));module['exports']=function(_0x204287,_0x42ac16){return _0x204287[_0x25c1('0x9')]('ChatOfflineMessage',attributes,{'tableName':'chat_offline_messages','paranoid':![],'indexes':[],'timestamps':!![],'charset':_0x25c1('0xa'),'collate':_0x25c1('0xb')});};
\ No newline at end of file
diff --git a/server/api/chatOfflineMessage/chatOfflineMessage.rpc.js b/server/api/chatOfflineMessage/chatOfflineMessage.rpc.js
index b327090..835ba69 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 _0xe9a0=['code','message','lodash','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/logger','rpc','../../config/environment','jayson/promise','client','http','request','then','info','ChatOfflineMessage,\x20%s,\x20%s','request\x20sent','debug','ChatOfflineMessage,\x20%s,\x20%s,\x20%s','stringify','error'];(function(_0x38172f,_0x1c72a3){var _0x597dc0=function(_0x2d51d3){while(--_0x2d51d3){_0x38172f['push'](_0x38172f['shift']());}};_0x597dc0(++_0x1c72a3);}(_0xe9a0,0x15b));var _0x0e9a=function(_0x1686b8,_0x228040){_0x1686b8=_0x1686b8-0x0;var _0x59a8d6=_0xe9a0[_0x1686b8];return _0x59a8d6;};'use strict';var _=require(_0x0e9a('0x0'));var util=require('util');var moment=require(_0x0e9a('0x1'));var BPromise=require(_0x0e9a('0x2'));var rs=require(_0x0e9a('0x3'));var fs=require('fs');var Redis=require(_0x0e9a('0x4'));var db=require(_0x0e9a('0x5'))['db'];var utils=require('../../config/utils');var logger=require(_0x0e9a('0x6'))(_0x0e9a('0x7'));var config=require(_0x0e9a('0x8'));var jayson=require(_0x0e9a('0x9'));var client=jayson[_0x0e9a('0xa')][_0x0e9a('0xb')]({'port':0x232a});function respondWithRpcPromise(_0x12dfd2,_0x227d28,_0x36f2aa){return new BPromise(function(_0x239670,_0x44c85e){return client[_0x0e9a('0xc')](_0x12dfd2,_0x36f2aa)[_0x0e9a('0xd')](function(_0x480190){logger[_0x0e9a('0xe')](_0x0e9a('0xf'),_0x227d28,_0x0e9a('0x10'));logger[_0x0e9a('0x11')](_0x0e9a('0x12'),_0x227d28,_0x0e9a('0x10'),JSON[_0x0e9a('0x13')](_0x480190));if(_0x480190[_0x0e9a('0x14')]){if(_0x480190[_0x0e9a('0x14')][_0x0e9a('0x15')]===0x1f4){logger[_0x0e9a('0x14')](_0x0e9a('0xf'),_0x227d28,_0x480190[_0x0e9a('0x14')][_0x0e9a('0x16')]);return _0x44c85e(_0x480190[_0x0e9a('0x14')]['message']);}logger[_0x0e9a('0x14')](_0x0e9a('0xf'),_0x227d28,_0x480190[_0x0e9a('0x14')][_0x0e9a('0x16')]);return _0x239670(_0x480190[_0x0e9a('0x14')]['message']);}else{logger['info'](_0x0e9a('0xf'),_0x227d28,_0x0e9a('0x10'));_0x239670(_0x480190['result'][_0x0e9a('0x16')]);}})['catch'](function(_0x3db0ef){logger[_0x0e9a('0x14')]('ChatOfflineMessage,\x20%s,\x20%s',_0x227d28,_0x3db0ef);_0x44c85e(_0x3db0ef);});});}
\ No newline at end of file
+var _0x837c=['info','lodash','util','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','client','ChatOfflineMessage,\x20%s,\x20%s','request\x20sent','ChatOfflineMessage,\x20%s,\x20%s,\x20%s','stringify','error','code','message'];(function(_0x6131cd,_0x4c26a1){var _0x47e916=function(_0x1f2bce){while(--_0x1f2bce){_0x6131cd['push'](_0x6131cd['shift']());}};_0x47e916(++_0x4c26a1);}(_0x837c,0x11e));var _0xc837=function(_0x55701e,_0x25167e){_0x55701e=_0x55701e-0x0;var _0x409cf9=_0x837c[_0x55701e];return _0x409cf9;};'use strict';var _=require(_0xc837('0x0'));var util=require(_0xc837('0x1'));var moment=require('moment');var BPromise=require(_0xc837('0x2'));var rs=require(_0xc837('0x3'));var fs=require('fs');var Redis=require(_0xc837('0x4'));var db=require(_0xc837('0x5'))['db'];var utils=require(_0xc837('0x6'));var logger=require(_0xc837('0x7'))(_0xc837('0x8'));var config=require(_0xc837('0x9'));var jayson=require('jayson/promise');var client=jayson[_0xc837('0xa')]['http']({'port':0x232a});function respondWithRpcPromise(_0x135b06,_0x582d65,_0x8fb3fc){return new BPromise(function(_0xa8309a,_0xbc5774){return client['request'](_0x135b06,_0x8fb3fc)['then'](function(_0x2bc2bd){logger['info'](_0xc837('0xb'),_0x582d65,_0xc837('0xc'));logger['debug'](_0xc837('0xd'),_0x582d65,_0xc837('0xc'),JSON[_0xc837('0xe')](_0x2bc2bd));if(_0x2bc2bd[_0xc837('0xf')]){if(_0x2bc2bd[_0xc837('0xf')][_0xc837('0x10')]===0x1f4){logger[_0xc837('0xf')](_0xc837('0xb'),_0x582d65,_0x2bc2bd[_0xc837('0xf')][_0xc837('0x11')]);return _0xbc5774(_0x2bc2bd[_0xc837('0xf')][_0xc837('0x11')]);}logger[_0xc837('0xf')]('ChatOfflineMessage,\x20%s,\x20%s',_0x582d65,_0x2bc2bd[_0xc837('0xf')][_0xc837('0x11')]);return _0xa8309a(_0x2bc2bd[_0xc837('0xf')][_0xc837('0x11')]);}else{logger[_0xc837('0x12')](_0xc837('0xb'),_0x582d65,'request\x20sent');_0xa8309a(_0x2bc2bd['result'][_0xc837('0x11')]);}})['catch'](function(_0x2e5bce){logger[_0xc837('0xf')](_0xc837('0xb'),_0x582d65,_0x2e5bce);_0xbc5774(_0x2e5bce);});});}
\ No newline at end of file
diff --git a/server/api/chatOfflineMessage/index.js b/server/api/chatOfflineMessage/index.js
index f9e8152..bf4f317 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 _0xbde2=['get','isAuthenticated','index','/describe','describe','show','create','/:id','destroy','multer','path','connect-timeout','express','../../components/auth/service','../../components/interaction/service','../../config/environment','./chatOfflineMessage.controller'];(function(_0x27c7b2,_0x3a3e76){var _0x4a2453=function(_0x5985f7){while(--_0x5985f7){_0x27c7b2['push'](_0x27c7b2['shift']());}};_0x4a2453(++_0x3a3e76);}(_0xbde2,0x119));var _0x2bde=function(_0x1e1a0f,_0x54989b){_0x1e1a0f=_0x1e1a0f-0x0;var _0xadd5f9=_0xbde2[_0x1e1a0f];return _0xadd5f9;};'use strict';var multer=require(_0x2bde('0x0'));var util=require('util');var path=require(_0x2bde('0x1'));var timeout=require(_0x2bde('0x2'));var express=require(_0x2bde('0x3'));var router=express['Router']();var auth=require(_0x2bde('0x4'));var interaction=require(_0x2bde('0x5'));var config=require(_0x2bde('0x6'));var controller=require(_0x2bde('0x7'));router[_0x2bde('0x8')]('/',auth[_0x2bde('0x9')](),controller[_0x2bde('0xa')]);router[_0x2bde('0x8')](_0x2bde('0xb'),auth['isAuthenticated'](),controller[_0x2bde('0xc')]);router[_0x2bde('0x8')]('/:id',auth[_0x2bde('0x9')](),controller[_0x2bde('0xd')]);router['post']('/',auth[_0x2bde('0x9')](),controller[_0x2bde('0xe')]);router['put'](_0x2bde('0xf'),auth[_0x2bde('0x9')](),controller['update']);router['delete']('/:id',auth['isAuthenticated'](),controller[_0x2bde('0x10')]);module['exports']=router;
\ No newline at end of file
+var _0xa822=['show','create','put','delete','/:id','destroy','exports','multer','util','path','connect-timeout','../../components/auth/service','../../components/interaction/service','./chatOfflineMessage.controller','get','/describe','isAuthenticated','describe'];(function(_0x274407,_0x3d748a){var _0x36e818=function(_0x220122){while(--_0x220122){_0x274407['push'](_0x274407['shift']());}};_0x36e818(++_0x3d748a);}(_0xa822,0xdf));var _0x2a82=function(_0x4498a2,_0x143689){_0x4498a2=_0x4498a2-0x0;var _0x411aa8=_0xa822[_0x4498a2];return _0x411aa8;};'use strict';var multer=require(_0x2a82('0x0'));var util=require(_0x2a82('0x1'));var path=require(_0x2a82('0x2'));var timeout=require(_0x2a82('0x3'));var express=require('express');var router=express['Router']();var auth=require(_0x2a82('0x4'));var interaction=require(_0x2a82('0x5'));var config=require('../../config/environment');var controller=require(_0x2a82('0x6'));router[_0x2a82('0x7')]('/',auth['isAuthenticated'](),controller['index']);router[_0x2a82('0x7')](_0x2a82('0x8'),auth[_0x2a82('0x9')](),controller[_0x2a82('0xa')]);router['get']('/:id',auth[_0x2a82('0x9')](),controller[_0x2a82('0xb')]);router['post']('/',auth['isAuthenticated'](),controller[_0x2a82('0xc')]);router[_0x2a82('0xd')]('/:id',auth[_0x2a82('0x9')](),controller['update']);router[_0x2a82('0xe')](_0x2a82('0xf'),auth[_0x2a82('0x9')](),controller[_0x2a82('0x10')]);module[_0x2a82('0x11')]=router;
\ No newline at end of file
diff --git a/server/api/chatProactiveAction/chatProactiveAction.attributes.js b/server/api/chatProactiveAction/chatProactiveAction.attributes.js
index 0cfcead..a545102 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 _0xb8d5=['exports','ENUM','mouseOver','timeout','STRING','sequelize'];(function(_0x8b631b,_0x386724){var _0x3e6832=function(_0x17a132){while(--_0x17a132){_0x8b631b['push'](_0x8b631b['shift']());}};_0x3e6832(++_0x386724);}(_0xb8d5,0x185));var _0x5b8d=function(_0x533774,_0x811cb3){_0x533774=_0x533774-0x0;var _0x5db7da=_0xb8d5[_0x533774];return _0x5db7da;};'use strict';var Sequelize=require(_0x5b8d('0x0'));module[_0x5b8d('0x1')]={'name':{'type':Sequelize['STRING'],'allowNull':![]},'type':{'type':Sequelize[_0x5b8d('0x2')](_0x5b8d('0x3'),_0x5b8d('0x4')),'defaultValue':'mouseOver'},'selector':{'type':Sequelize[_0x5b8d('0x5')]},'timeout':{'type':Sequelize['INTEGER']}};
\ No newline at end of file
+var _0xd1af=['INTEGER','exports','STRING','mouseOver','timeout'];(function(_0x3c5e71,_0xfc0c07){var _0x71b974=function(_0x40c7e7){while(--_0x40c7e7){_0x3c5e71['push'](_0x3c5e71['shift']());}};_0x71b974(++_0xfc0c07);}(_0xd1af,0x1c3));var _0xfd1a=function(_0x49b706,_0xaa79e2){_0x49b706=_0x49b706-0x0;var _0x28d62c=_0xd1af[_0x49b706];return _0x28d62c;};'use strict';var Sequelize=require('sequelize');module[_0xfd1a('0x0')]={'name':{'type':Sequelize[_0xfd1a('0x1')],'allowNull':![]},'type':{'type':Sequelize['ENUM'](_0xfd1a('0x2'),_0xfd1a('0x3')),'defaultValue':_0xfd1a('0x2')},'selector':{'type':Sequelize['STRING']},'timeout':{'type':Sequelize[_0xfd1a('0x4')]}};
\ No newline at end of file
diff --git a/server/api/chatProactiveAction/chatProactiveAction.controller.js b/server/api/chatProactiveAction/chatProactiveAction.controller.js
index c04a7d6..20dbe31 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 _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(_0x59c301,_0x359c50){var _0x3866b9=function(_0x2d380e){while(--_0x2d380e){_0x59c301['push'](_0x59c301['shift']());}};_0x3866b9(++_0x359c50);}(_0xa9e0,0x123));var _0x0a9e=function(_0x45e98e,_0x169b60){_0x45e98e=_0x45e98e-0x0;var _0x374dba=_0xa9e0[_0x45e98e];return _0x374dba;};'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
+var _0x70e0=['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','sendStatus','json','offset','limit','status','set','Content-Range','apply','reject','update','then','destroy','end','stack','send','show','params','model','keys','ChatProactiveAction','rawAttributes','query','filters','intersection','fields','attributes','length','include','options','catch','create','body','find','html-pdf','eml-format','rimraf','request-promise','moment','bluebird'];(function(_0x616d89,_0x45947e){var _0x3fd09c=function(_0x24c03f){while(--_0x24c03f){_0x616d89['push'](_0x616d89['shift']());}};_0x3fd09c(++_0x45947e);}(_0x70e0,0x17b));var _0x070e=function(_0x1604d7,_0x1b0b27){_0x1604d7=_0x1604d7-0x0;var _0x392281=_0x70e0[_0x1604d7];return _0x392281;};'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'];function respondWithStatusCode(_0x1baa12,_0x39d2b9){_0x39d2b9=_0x39d2b9||0xcc;return function(_0x5bf079){if(_0x5bf079){return _0x1baa12[_0x070e('0x16')](_0x39d2b9);}return _0x1baa12['status'](_0x39d2b9)['end']();};}function respondWithResult(_0x24baba,_0x56c7ba){_0x56c7ba=_0x56c7ba||0xc8;return function(_0x4a33d2){if(_0x4a33d2){return _0x24baba['status'](_0x56c7ba)[_0x070e('0x17')](_0x4a33d2);}};}function respondWithFilteredResult(_0x14c3fd,_0x51d14d){return function(_0x5d3a38){if(_0x5d3a38){var _0x373d86=_0x5d3a38['count'],_0xeae1a5=_0x51d14d['offset'],_0x180897=_0x51d14d[_0x070e('0x18')]+_0x51d14d[_0x070e('0x19')],_0x19d9da;if(_0x180897>=_0x373d86){_0x180897=_0x373d86;_0x19d9da=0xc8;}else{_0x19d9da=0xce;}_0x14c3fd[_0x070e('0x1a')](_0x19d9da);return _0x14c3fd[_0x070e('0x1b')](_0x070e('0x1c'),_0xeae1a5+'-'+_0x180897+'/'+_0x373d86)['json'](_0x5d3a38);}return null;};}function patchUpdates(_0x3938b5){return function(_0x168dc6){try{jsonpatch[_0x070e('0x1d')](_0x168dc6,_0x3938b5,!![]);}catch(_0x3ea105){return BPromise[_0x070e('0x1e')](_0x3ea105);}return _0x168dc6['save']();};}function saveUpdates(_0x5b2f48,_0x4e958f){return function(_0x9907cf){if(_0x9907cf){return _0x9907cf[_0x070e('0x1f')](_0x5b2f48)[_0x070e('0x20')](function(_0x4be0d7){return _0x4be0d7;});}return null;};}function removeEntity(_0x5b184,_0x5dc5d2){return function(_0xf8dd5d){if(_0xf8dd5d){return _0xf8dd5d[_0x070e('0x21')]()[_0x070e('0x20')](function(){_0x5b184[_0x070e('0x1a')](0xcc)[_0x070e('0x22')]();});}};}function handleEntityNotFound(_0xa86797,_0xe405e){return function(_0x164cdf){if(!_0x164cdf){_0xa86797['sendStatus'](0x194);}return _0x164cdf;};}function handleError(_0x2f8055,_0x270061){_0x270061=_0x270061||0x1f4;return function(_0x4790eb){logger['error'](_0x4790eb[_0x070e('0x23')]);if(_0x4790eb['name']){delete _0x4790eb['name'];}_0x2f8055[_0x070e('0x1a')](_0x270061)[_0x070e('0x24')](_0x4790eb);};}exports[_0x070e('0x25')]=function(_0x1743cc,_0x4763c6){var _0x497f58={'raw':!![],'where':{'id':_0x1743cc[_0x070e('0x26')]['id']}},_0x374c54={};_0x374c54[_0x070e('0x27')]=_[_0x070e('0x28')](db[_0x070e('0x29')][_0x070e('0x2a')]);_0x374c54[_0x070e('0x2b')]=_[_0x070e('0x28')](_0x1743cc['query']);_0x374c54[_0x070e('0x2c')]=_[_0x070e('0x2d')](_0x374c54[_0x070e('0x27')],_0x374c54['query']);_0x497f58['attributes']=_[_0x070e('0x2d')](_0x374c54[_0x070e('0x27')],qs[_0x070e('0x2e')](_0x1743cc['query'][_0x070e('0x2e')]));_0x497f58[_0x070e('0x2f')]=_0x497f58[_0x070e('0x2f')][_0x070e('0x30')]?_0x497f58['attributes']:_0x374c54['model'];if(_0x1743cc['query']['includeAll']){_0x497f58[_0x070e('0x31')]=[{'all':!![]}];}_0x497f58=_['merge']({},_0x497f58,_0x1743cc[_0x070e('0x32')]);return db[_0x070e('0x29')]['find'](_0x497f58)['then'](handleEntityNotFound(_0x4763c6,null))[_0x070e('0x20')](respondWithResult(_0x4763c6,null))[_0x070e('0x33')](handleError(_0x4763c6,null));};exports['create']=function(_0x546a16,_0x41ade4){return db[_0x070e('0x29')][_0x070e('0x34')](_0x546a16[_0x070e('0x35')],{})[_0x070e('0x20')](respondWithResult(_0x41ade4,0xc9))['catch'](handleError(_0x41ade4,null));};exports['update']=function(_0x24d17d,_0x3011c4){if(_0x24d17d[_0x070e('0x35')]['id']){delete _0x24d17d[_0x070e('0x35')]['id'];}return db[_0x070e('0x29')]['find']({'where':{'id':_0x24d17d[_0x070e('0x26')]['id']}})[_0x070e('0x20')](handleEntityNotFound(_0x3011c4,null))['then'](saveUpdates(_0x24d17d[_0x070e('0x35')],null))[_0x070e('0x20')](respondWithResult(_0x3011c4,null))['catch'](handleError(_0x3011c4,null));};exports['destroy']=function(_0x5ddbe9,_0x363bff){return db[_0x070e('0x29')][_0x070e('0x36')]({'where':{'id':_0x5ddbe9[_0x070e('0x26')]['id']}})[_0x070e('0x20')](handleEntityNotFound(_0x363bff,null))['then'](removeEntity(_0x363bff,null))[_0x070e('0x33')](handleError(_0x363bff,null));};
\ No newline at end of file
diff --git a/server/api/chatProactiveAction/chatProactiveAction.model.js b/server/api/chatProactiveAction/chatProactiveAction.model.js
index 3d28c27..39f96ac 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 _0x58da=['moment','bluebird','request-promise','../../config/environment','./chatProactiveAction.attributes','exports','define','util','../../config/logger'];(function(_0x1193eb,_0x2a1969){var _0x5507f2=function(_0x3bc111){while(--_0x3bc111){_0x1193eb['push'](_0x1193eb['shift']());}};_0x5507f2(++_0x2a1969);}(_0x58da,0x154));var _0xa58d=function(_0x1dc6a7,_0x21058b){_0x1dc6a7=_0x1dc6a7-0x0;var _0x59310a=_0x58da[_0x1dc6a7];return _0x59310a;};'use strict';var _=require('lodash');var util=require(_0xa58d('0x0'));var logger=require(_0xa58d('0x1'))('api');var moment=require(_0xa58d('0x2'));var BPromise=require(_0xa58d('0x3'));var rp=require(_0xa58d('0x4'));var fs=require('fs');var path=require('path');var rimraf=require('rimraf');var config=require(_0xa58d('0x5'));var attributes=require(_0xa58d('0x6'));module[_0xa58d('0x7')]=function(_0x25573a,_0x4a14c2){return _0x25573a[_0xa58d('0x8')]('ChatProactiveAction',attributes,{'tableName':'chat_proactive_actions','paranoid':![],'indexes':[],'timestamps':!![]});};
\ No newline at end of file
+var _0xc17c=['ChatProactiveAction','chat_proactive_actions','lodash','../../config/logger','api','request-promise','path','../../config/environment','./chatProactiveAction.attributes','exports','define'];(function(_0x54cd9f,_0xf07b4e){var _0x1501dd=function(_0x1cece2){while(--_0x1cece2){_0x54cd9f['push'](_0x54cd9f['shift']());}};_0x1501dd(++_0xf07b4e);}(_0xc17c,0xf4));var _0xcc17=function(_0x2b5410,_0x464117){_0x2b5410=_0x2b5410-0x0;var _0x25b768=_0xc17c[_0x2b5410];return _0x25b768;};'use strict';var _=require(_0xcc17('0x0'));var util=require('util');var logger=require(_0xcc17('0x1'))(_0xcc17('0x2'));var moment=require('moment');var BPromise=require('bluebird');var rp=require(_0xcc17('0x3'));var fs=require('fs');var path=require(_0xcc17('0x4'));var rimraf=require('rimraf');var config=require(_0xcc17('0x5'));var attributes=require(_0xcc17('0x6'));module[_0xcc17('0x7')]=function(_0x229feb,_0xfeed91){return _0x229feb[_0xcc17('0x8')](_0xcc17('0x9'),attributes,{'tableName':_0xcc17('0xa'),'paranoid':![],'indexes':[],'timestamps':!![]});};
\ No newline at end of file
diff --git a/server/api/chatProactiveAction/chatProactiveAction.rpc.js b/server/api/chatProactiveAction/chatProactiveAction.rpc.js
index 7601f34..86284e2 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 _0x35dc=['message','result','lodash','util','bluebird','randomstring','../../mysqldb','../../config/utils','../../config/logger','../../config/environment','client','http','request','then','info','ChatProactiveAction,\x20%s,\x20%s','debug','ChatProactiveAction,\x20%s,\x20%s,\x20%s','stringify','error','code'];(function(_0x53cb5f,_0x197f59){var _0x172294=function(_0x136b9b){while(--_0x136b9b){_0x53cb5f['push'](_0x53cb5f['shift']());}};_0x172294(++_0x197f59);}(_0x35dc,0xd4));var _0xc35d=function(_0x20a584,_0xe384a5){_0x20a584=_0x20a584-0x0;var _0x4b41a8=_0x35dc[_0x20a584];return _0x4b41a8;};'use strict';var _=require(_0xc35d('0x0'));var util=require(_0xc35d('0x1'));var moment=require('moment');var BPromise=require(_0xc35d('0x2'));var rs=require(_0xc35d('0x3'));var fs=require('fs');var Redis=require('ioredis');var db=require(_0xc35d('0x4'))['db'];var utils=require(_0xc35d('0x5'));var logger=require(_0xc35d('0x6'))('rpc');var config=require(_0xc35d('0x7'));var jayson=require('jayson/promise');var client=jayson[_0xc35d('0x8')][_0xc35d('0x9')]({'port':0x232a});function respondWithRpcPromise(_0x80977,_0x3283e7,_0x2c7c01){return new BPromise(function(_0x269db1,_0x39a07f){return client[_0xc35d('0xa')](_0x80977,_0x2c7c01)[_0xc35d('0xb')](function(_0x4d9a8e){logger[_0xc35d('0xc')](_0xc35d('0xd'),_0x3283e7,'request\x20sent');logger[_0xc35d('0xe')](_0xc35d('0xf'),_0x3283e7,'request\x20sent',JSON[_0xc35d('0x10')](_0x4d9a8e));if(_0x4d9a8e[_0xc35d('0x11')]){if(_0x4d9a8e[_0xc35d('0x11')][_0xc35d('0x12')]===0x1f4){logger[_0xc35d('0x11')](_0xc35d('0xd'),_0x3283e7,_0x4d9a8e[_0xc35d('0x11')][_0xc35d('0x13')]);return _0x39a07f(_0x4d9a8e[_0xc35d('0x11')][_0xc35d('0x13')]);}logger[_0xc35d('0x11')]('ChatProactiveAction,\x20%s,\x20%s',_0x3283e7,_0x4d9a8e[_0xc35d('0x11')]['message']);return _0x269db1(_0x4d9a8e['error'][_0xc35d('0x13')]);}else{logger[_0xc35d('0xc')](_0xc35d('0xd'),_0x3283e7,'request\x20sent');_0x269db1(_0x4d9a8e[_0xc35d('0x14')][_0xc35d('0x13')]);}})['catch'](function(_0x2da3d6){logger['error'](_0xc35d('0xd'),_0x3283e7,_0x2da3d6);_0x39a07f(_0x2da3d6);});});}
\ No newline at end of file
+var _0x0879=['util','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/environment','jayson/promise','client','request','then','info','ChatProactiveAction,\x20%s,\x20%s','debug','request\x20sent','error','code','message','result','catch','lodash'];(function(_0x4f5a01,_0x590de4){var _0x3c882a=function(_0x260482){while(--_0x260482){_0x4f5a01['push'](_0x4f5a01['shift']());}};_0x3c882a(++_0x590de4);}(_0x0879,0x18e));var _0x9087=function(_0x554344,_0x27f258){_0x554344=_0x554344-0x0;var _0x1b642a=_0x0879[_0x554344];return _0x1b642a;};'use strict';var _=require(_0x9087('0x0'));var util=require(_0x9087('0x1'));var moment=require('moment');var BPromise=require(_0x9087('0x2'));var rs=require(_0x9087('0x3'));var fs=require('fs');var Redis=require(_0x9087('0x4'));var db=require(_0x9087('0x5'))['db'];var utils=require(_0x9087('0x6'));var logger=require('../../config/logger')('rpc');var config=require(_0x9087('0x7'));var jayson=require(_0x9087('0x8'));var client=jayson[_0x9087('0x9')]['http']({'port':0x232a});function respondWithRpcPromise(_0x3791f6,_0x5b23ce,_0x1f259f){return new BPromise(function(_0x27ffc5,_0xc944e8){return client[_0x9087('0xa')](_0x3791f6,_0x1f259f)[_0x9087('0xb')](function(_0x53ebe4){logger[_0x9087('0xc')](_0x9087('0xd'),_0x5b23ce,'request\x20sent');logger[_0x9087('0xe')]('ChatProactiveAction,\x20%s,\x20%s,\x20%s',_0x5b23ce,_0x9087('0xf'),JSON['stringify'](_0x53ebe4));if(_0x53ebe4[_0x9087('0x10')]){if(_0x53ebe4[_0x9087('0x10')][_0x9087('0x11')]===0x1f4){logger[_0x9087('0x10')](_0x9087('0xd'),_0x5b23ce,_0x53ebe4['error'][_0x9087('0x12')]);return _0xc944e8(_0x53ebe4[_0x9087('0x10')][_0x9087('0x12')]);}logger[_0x9087('0x10')]('ChatProactiveAction,\x20%s,\x20%s',_0x5b23ce,_0x53ebe4['error'][_0x9087('0x12')]);return _0x27ffc5(_0x53ebe4[_0x9087('0x10')][_0x9087('0x12')]);}else{logger['info'](_0x9087('0xd'),_0x5b23ce,_0x9087('0xf'));_0x27ffc5(_0x53ebe4[_0x9087('0x13')][_0x9087('0x12')]);}})[_0x9087('0x14')](function(_0x474466){logger['error'](_0x9087('0xd'),_0x5b23ce,_0x474466);_0xc944e8(_0x474466);});});}
\ No newline at end of file
diff --git a/server/api/chatProactiveAction/index.js b/server/api/chatProactiveAction/index.js
index 2638eaf..7643c95 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 _0xa8fb=['../../components/auth/service','../../components/interaction/service','../../config/environment','./chatProactiveAction.controller','get','/:id','isAuthenticated','show','post','put','delete','destroy','exports','multer','connect-timeout','express','Router'];(function(_0xcfc44,_0x179bc1){var _0x307a25=function(_0x2b64de){while(--_0x2b64de){_0xcfc44['push'](_0xcfc44['shift']());}};_0x307a25(++_0x179bc1);}(_0xa8fb,0x172));var _0xba8f=function(_0x59ee6f,_0x450239){_0x59ee6f=_0x59ee6f-0x0;var _0x4c0979=_0xa8fb[_0x59ee6f];return _0x4c0979;};'use strict';var multer=require(_0xba8f('0x0'));var util=require('util');var path=require('path');var timeout=require(_0xba8f('0x1'));var express=require(_0xba8f('0x2'));var router=express[_0xba8f('0x3')]();var auth=require(_0xba8f('0x4'));var interaction=require(_0xba8f('0x5'));var config=require(_0xba8f('0x6'));var controller=require(_0xba8f('0x7'));router[_0xba8f('0x8')](_0xba8f('0x9'),auth[_0xba8f('0xa')](),controller[_0xba8f('0xb')]);router[_0xba8f('0xc')]('/',auth[_0xba8f('0xa')](),controller['create']);router[_0xba8f('0xd')](_0xba8f('0x9'),auth['isAuthenticated'](),controller['update']);router[_0xba8f('0xe')](_0xba8f('0x9'),auth[_0xba8f('0xa')](),controller[_0xba8f('0xf')]);module[_0xba8f('0x10')]=router;
\ No newline at end of file
+var _0x9b08=['Router','../../components/auth/service','../../components/interaction/service','../../config/environment','./chatProactiveAction.controller','get','/:id','show','post','isAuthenticated','create','update','delete','exports','multer','util','express'];(function(_0xefc870,_0x1a024a){var _0x3d6a50=function(_0x6de4a0){while(--_0x6de4a0){_0xefc870['push'](_0xefc870['shift']());}};_0x3d6a50(++_0x1a024a);}(_0x9b08,0x1ea));var _0x89b0=function(_0x4e6ae6,_0x49dba6){_0x4e6ae6=_0x4e6ae6-0x0;var _0x23c108=_0x9b08[_0x4e6ae6];return _0x23c108;};'use strict';var multer=require(_0x89b0('0x0'));var util=require(_0x89b0('0x1'));var path=require('path');var timeout=require('connect-timeout');var express=require(_0x89b0('0x2'));var router=express[_0x89b0('0x3')]();var auth=require(_0x89b0('0x4'));var interaction=require(_0x89b0('0x5'));var config=require(_0x89b0('0x6'));var controller=require(_0x89b0('0x7'));router[_0x89b0('0x8')](_0x89b0('0x9'),auth['isAuthenticated'](),controller[_0x89b0('0xa')]);router[_0x89b0('0xb')]('/',auth[_0x89b0('0xc')](),controller[_0x89b0('0xd')]);router['put'](_0x89b0('0x9'),auth[_0x89b0('0xc')](),controller[_0x89b0('0xe')]);router[_0x89b0('0xf')](_0x89b0('0x9'),auth[_0x89b0('0xc')](),controller['destroy']);module[_0x89b0('0x10')]=router;
\ No newline at end of file
diff --git a/server/api/chatQueue/chatQueue.attributes.js b/server/api/chatQueue/chatQueue.attributes.js
index 2ead3a5..f1596f2 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 _0xec1d=['roundrobin','sequelize','name','STRING','INTEGER','ENUM','beepall'];(function(_0x25eb65,_0x4c5657){var _0x4dbd53=function(_0x82bf15){while(--_0x82bf15){_0x25eb65['push'](_0x25eb65['shift']());}};_0x4dbd53(++_0x4c5657);}(_0xec1d,0x1ac));var _0xdec1=function(_0x5dfca5,_0x25be0c){_0x5dfca5=_0x5dfca5-0x0;var _0x5d5a1d=_0xec1d[_0x5dfca5];return _0x5d5a1d;};'use strict';var Sequelize=require(_0xdec1('0x0'));module['exports']={'name':{'type':Sequelize['STRING'],'unique':_0xdec1('0x1'),'allowNull':![],'validate':{'notEmpty':!![],'is':/^[A-Za-z0-9\.\_]+$/i}},'description':{'type':Sequelize[_0xdec1('0x2')]},'timeout':{'type':Sequelize[_0xdec1('0x3')],'validate':{'min':0x1,'max':0x20c49b}},'strategy':{'type':Sequelize[_0xdec1('0x4')]('rrmemory',_0xdec1('0x5'),_0xdec1('0x6'))}};
\ No newline at end of file
+var _0xa643=['ENUM','rrmemory','beepall','roundrobin','sequelize','exports','name','STRING'];(function(_0x1d7b02,_0x195242){var _0x3375ba=function(_0x3106ae){while(--_0x3106ae){_0x1d7b02['push'](_0x1d7b02['shift']());}};_0x3375ba(++_0x195242);}(_0xa643,0x11c));var _0x3a64=function(_0x29cdc6,_0x26bf93){_0x29cdc6=_0x29cdc6-0x0;var _0x2014ca=_0xa643[_0x29cdc6];return _0x2014ca;};'use strict';var Sequelize=require(_0x3a64('0x0'));module[_0x3a64('0x1')]={'name':{'type':Sequelize['STRING'],'unique':_0x3a64('0x2'),'allowNull':![],'validate':{'notEmpty':!![],'is':/^[A-Za-z0-9\.\_]+$/i}},'description':{'type':Sequelize[_0x3a64('0x3')]},'timeout':{'type':Sequelize['INTEGER'],'validate':{'min':0x1,'max':0x20c49b}},'strategy':{'type':Sequelize[_0x3a64('0x4')](_0x3a64('0x5'),_0x3a64('0x6'),_0x3a64('0x7'))}};
\ No newline at end of file
diff --git a/server/api/chatQueue/chatQueue.controller.js b/server/api/chatQueue/chatQueue.controller.js
index 1ef76b4..80beb09 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 _0x341c=['Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','body','describe','getMembers','findOne','UserChatQueue','ChatQueueId','User','findAndCountAll','agent','chatPause','createdAt','format','%s/%s','SIP','getTeams','Team','addTeams','Agents','voicePause','interface','flatMap','transaction','each','forEach','emit','removeTeams','ids','select','from','team_has_chat_queues','join','ut.TeamId\x20=\x20tq.TeamId','ChatQueueId\x20=\x20?','ut.UserId\x20=\x20?','push','sequelize','SELECT','every','TeamId','includes','union','isEmpty','removeAgents','userChatQueue:remove','addAgents','omit','spread','userChatQueue:save','isArray','getAgents','html-pdf','rimraf','fast-json-patch','request-promise','moment','bluebird','mustache','util','path','sox','ejs','lodash','squel','crypto','jsforce','to-csv','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/environment','../../mysqldb','redis','localhost','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','then','info','ChatQueue,\x20%s,\x20%s','request\x20sent','debug','stringify','error','code','message','catch','sendStatus','status','end','json','count','offset','limit','set','apply','reject','save','update','destroy','ChatQueues','UserProfileResource','name','send','index','map','rawAttributes','fieldName','type','key','model','query','keys','filters','intersection','attributes','fields','hasOwnProperty','nolimit','order','sort','where','pick','filter','merge','options','ChatQueue','includeAll','include','findAll','rows','show','params','length','find','create','user','Unable\x20to\x20retrieve\x20the\x20current\x20user','get','autoAssociation'];(function(_0x2000b6,_0x7f8f){var _0x2c1ea3=function(_0x4dfaf6){while(--_0x4dfaf6){_0x2000b6['push'](_0x2000b6['shift']());}};_0x2c1ea3(++_0x7f8f);}(_0x341c,0xcc));var _0xc341=function(_0x27470d,_0x20ad27){_0x27470d=_0x27470d-0x0;var _0x2cab2b=_0x341c[_0x27470d];return _0x2cab2b;};'use strict';var pdf=require(_0xc341('0x0'));var emlformat=require('eml-format');var rimraf=require(_0xc341('0x1'));var zipdir=require('zip-dir');var jsonpatch=require(_0xc341('0x2'));var rp=require(_0xc341('0x3'));var moment=require(_0xc341('0x4'));var BPromise=require(_0xc341('0x5'));var Mustache=require(_0xc341('0x6'));var util=require(_0xc341('0x7'));var path=require(_0xc341('0x8'));var sox=require(_0xc341('0x9'));var csv=require('to-csv');var ejs=require(_0xc341('0xa'));var fs=require('fs');var _=require(_0xc341('0xb'));var squel=require(_0xc341('0xc'));var crypto=require(_0xc341('0xd'));var jsforce=require(_0xc341('0xe'));var deskjs=require('desk.js');var toCsv=require(_0xc341('0xf'));var querystring=require(_0xc341('0x10'));var Papa=require(_0xc341('0x11'));var Redis=require(_0xc341('0x12'));var authService=require(_0xc341('0x13'));var qs=require(_0xc341('0x14'));var as=require('../../components/parsers/advancedSearch');var hardwareService=require(_0xc341('0x15'));var logger=require(_0xc341('0x16'))(_0xc341('0x17'));var utils=require(_0xc341('0x18'));var config=require(_0xc341('0x19'));var db=require(_0xc341('0x1a'))['db'];config['redis']=_['defaults'](config[_0xc341('0x1b')],{'host':_0xc341('0x1c'),'port':0x18eb});var socket=require(_0xc341('0x1d'))(new Redis(config[_0xc341('0x1b')]));require(_0xc341('0x1e'))['register'](socket);var jayson=require(_0xc341('0x1f'));var client=jayson[_0xc341('0x20')][_0xc341('0x21')]({'port':0x232a});function checkPasswordPattern(_0x158c47,_0x989024,_0x2bd235){if(_0x2bd235){var _0x203a06=new RegExp(/(?=.*[a-z])(?=.*[A-Z])(?=.*[0-9])(?=.*[?!@#\$%\^&\*~\-_=+[{\]\}])(?=.{8,})/);if(_0x203a06[_0xc341('0x22')](_0x989024)){return _0x158c47;}else{throw new db[(_0xc341('0x23'))][(_0xc341('0x24'))](_0xc341('0x25'));}}else{return _0x158c47;}}function respondWithRpcPromise(_0x4d52d1,_0x4a0259,_0x3d8799,_0x19d0bc){return new BPromise(function(_0x2d9f4e,_0x31f1ae){var _0x1017fc=_0x19d0bc||client;return _0x1017fc[_0xc341('0x26')](_0x4d52d1,_0x3d8799)[_0xc341('0x27')](function(_0x41a020){logger[_0xc341('0x28')](_0xc341('0x29'),_0x4a0259,_0xc341('0x2a'));logger[_0xc341('0x2b')]('ChatQueue,\x20%s,\x20%s,\x20%s',_0x4a0259,'request\x20sent',JSON[_0xc341('0x2c')](_0x41a020));if(_0x41a020[_0xc341('0x2d')]){if(_0x41a020[_0xc341('0x2d')][_0xc341('0x2e')]===0x1f4){logger[_0xc341('0x2d')](_0xc341('0x29'),_0x4a0259,_0x41a020['error'][_0xc341('0x2f')]);return _0x31f1ae(_0x41a020[_0xc341('0x2d')][_0xc341('0x2f')]);}logger['error']('ChatQueue,\x20%s,\x20%s',_0x4a0259,_0x41a020[_0xc341('0x2d')]['message']);return _0x2d9f4e(_0x41a020[_0xc341('0x2d')][_0xc341('0x2f')]);}else{logger[_0xc341('0x28')](_0xc341('0x29'),_0x4a0259,_0xc341('0x2a'));_0x2d9f4e(_0x41a020['result'][_0xc341('0x2f')]);}})[_0xc341('0x30')](function(_0x258378){logger[_0xc341('0x2d')](_0xc341('0x29'),_0x4a0259,_0x258378);_0x31f1ae(_0x258378);});});}function respondWithStatusCode(_0x3b6cd2,_0x7c443f){_0x7c443f=_0x7c443f||0xcc;return function(_0x51af9d){if(_0x51af9d){return _0x3b6cd2[_0xc341('0x31')](_0x7c443f);}return _0x3b6cd2[_0xc341('0x32')](_0x7c443f)[_0xc341('0x33')]();};}function respondWithResult(_0x469dd4,_0x3914a9){_0x3914a9=_0x3914a9||0xc8;return function(_0x31ef05){if(_0x31ef05){return _0x469dd4[_0xc341('0x32')](_0x3914a9)[_0xc341('0x34')](_0x31ef05);}};}function respondWithFilteredResult(_0xb810ae,_0x4b838f){return function(_0x2bda80){if(_0x2bda80){var _0x392877=_0x2bda80[_0xc341('0x35')],_0x2bf5fd=_0x4b838f[_0xc341('0x36')],_0x32185a=_0x4b838f[_0xc341('0x36')]+_0x4b838f[_0xc341('0x37')],_0x13c225;if(_0x32185a>=_0x392877){_0x32185a=_0x392877;_0x13c225=0xc8;}else{_0x13c225=0xce;}_0xb810ae[_0xc341('0x32')](_0x13c225);return _0xb810ae[_0xc341('0x38')]('Content-Range',_0x2bf5fd+'-'+_0x32185a+'/'+_0x392877)['json'](_0x2bda80);}return null;};}function patchUpdates(_0x435fbd){return function(_0x5576ab){try{jsonpatch[_0xc341('0x39')](_0x5576ab,_0x435fbd,!![]);}catch(_0x1cc976){return BPromise[_0xc341('0x3a')](_0x1cc976);}return _0x5576ab[_0xc341('0x3b')]();};}function saveUpdates(_0x1a2977,_0xf2e6bc){return function(_0x196258){if(_0x196258){return _0x196258[_0xc341('0x3c')](_0x1a2977)[_0xc341('0x27')](function(_0x5784dd){return _0x5784dd;});}return null;};}function removeEntity(_0x3ae8dd,_0x1a4987){return function(_0x19786a){if(_0x19786a){return _0x19786a[_0xc341('0x3d')]()[_0xc341('0x27')](function(){var _0x59d6eb=_0x19786a['get']({'plain':!![]});var _0x5f402b=_0xc341('0x3e');return db[_0xc341('0x3f')][_0xc341('0x3d')]({'where':{'type':_0x5f402b,'resourceId':_0x59d6eb['id']}})[_0xc341('0x27')](function(){return _0x19786a;});})['then'](function(){_0x3ae8dd['status'](0xcc)[_0xc341('0x33')]();});}};}function handleEntityNotFound(_0x424b6c,_0x3b869a){return function(_0x12752c){if(!_0x12752c){_0x424b6c['sendStatus'](0x194);}return _0x12752c;};}function handleError(_0x5aa51d,_0x3030df){_0x3030df=_0x3030df||0x1f4;return function(_0x4cd018){logger[_0xc341('0x2d')](_0x4cd018['stack']);if(_0x4cd018[_0xc341('0x40')]){delete _0x4cd018[_0xc341('0x40')];}_0x5aa51d[_0xc341('0x32')](_0x3030df)[_0xc341('0x41')](_0x4cd018);};}exports[_0xc341('0x42')]=function(_0x452285,_0x3aac1a){var _0x28a962={},_0x1993e1={},_0x25f464={'count':0x0,'rows':[]};var _0x3c0e93=_[_0xc341('0x43')](db['ChatQueue'][_0xc341('0x44')],function(_0x2aa43c){return{'name':_0x2aa43c[_0xc341('0x45')],'type':_0x2aa43c[_0xc341('0x46')][_0xc341('0x47')]};});_0x1993e1[_0xc341('0x48')]=_[_0xc341('0x43')](_0x3c0e93,_0xc341('0x40'));_0x1993e1[_0xc341('0x49')]=_[_0xc341('0x4a')](_0x452285[_0xc341('0x49')]);_0x1993e1[_0xc341('0x4b')]=_[_0xc341('0x4c')](_0x1993e1['model'],_0x1993e1['query']);_0x28a962[_0xc341('0x4d')]=_[_0xc341('0x4c')](_0x1993e1['model'],qs[_0xc341('0x4e')](_0x452285[_0xc341('0x49')][_0xc341('0x4e')]));_0x28a962['attributes']=_0x28a962[_0xc341('0x4d')]['length']?_0x28a962[_0xc341('0x4d')]:_0x1993e1[_0xc341('0x48')];if(!_0x452285[_0xc341('0x49')][_0xc341('0x4f')](_0xc341('0x50'))){_0x28a962[_0xc341('0x37')]=qs['limit'](_0x452285[_0xc341('0x49')][_0xc341('0x37')]);_0x28a962[_0xc341('0x36')]=qs['offset'](_0x452285[_0xc341('0x49')]['offset']);}_0x28a962[_0xc341('0x51')]=qs[_0xc341('0x52')](_0x452285[_0xc341('0x49')][_0xc341('0x52')]);_0x28a962[_0xc341('0x53')]=qs['filters'](_[_0xc341('0x54')](_0x452285['query'],_0x1993e1['filters']));if(_0x452285[_0xc341('0x49')][_0xc341('0x55')]){_0x28a962['where']=_['merge'](_0x28a962['where'],{'$or':_['map'](_0x3c0e93,function(_0xd5824c){if(_0xd5824c[_0xc341('0x46')]!=='VIRTUAL'){var _0x5cebac={};_0x5cebac[_0xd5824c[_0xc341('0x40')]]={'$like':'%'+_0x452285['query'][_0xc341('0x55')]+'%'};return _0x5cebac;}})});}_0x28a962=_[_0xc341('0x56')]({},_0x28a962,_0x452285[_0xc341('0x57')]);var _0x8a7394={'where':_0x28a962[_0xc341('0x53')]};return db[_0xc341('0x58')][_0xc341('0x35')](_0x8a7394)[_0xc341('0x27')](function(_0x129da7){_0x25f464[_0xc341('0x35')]=_0x129da7;if(_0x452285[_0xc341('0x49')][_0xc341('0x59')]){_0x28a962[_0xc341('0x5a')]=[{'all':!![]}];}return db[_0xc341('0x58')][_0xc341('0x5b')](_0x28a962);})[_0xc341('0x27')](function(_0x3354dc){_0x25f464[_0xc341('0x5c')]=_0x3354dc;return _0x25f464;})[_0xc341('0x27')](respondWithFilteredResult(_0x3aac1a,_0x28a962))[_0xc341('0x30')](handleError(_0x3aac1a,null));};exports[_0xc341('0x5d')]=function(_0x5574dc,_0x475a9c){var _0x2bd737={'raw':!![],'where':{'id':_0x5574dc[_0xc341('0x5e')]['id']}},_0x2f7ba9={};_0x2f7ba9[_0xc341('0x48')]=_[_0xc341('0x4a')](db[_0xc341('0x58')][_0xc341('0x44')]);_0x2f7ba9[_0xc341('0x49')]=_[_0xc341('0x4a')](_0x5574dc['query']);_0x2f7ba9[_0xc341('0x4b')]=_[_0xc341('0x4c')](_0x2f7ba9['model'],_0x2f7ba9['query']);_0x2bd737[_0xc341('0x4d')]=_[_0xc341('0x4c')](_0x2f7ba9[_0xc341('0x48')],qs[_0xc341('0x4e')](_0x5574dc[_0xc341('0x49')][_0xc341('0x4e')]));_0x2bd737[_0xc341('0x4d')]=_0x2bd737[_0xc341('0x4d')][_0xc341('0x5f')]?_0x2bd737[_0xc341('0x4d')]:_0x2f7ba9[_0xc341('0x48')];if(_0x5574dc[_0xc341('0x49')][_0xc341('0x59')]){_0x2bd737[_0xc341('0x5a')]=[{'all':!![]}];}_0x2bd737=_['merge']({},_0x2bd737,_0x5574dc[_0xc341('0x57')]);return db['ChatQueue'][_0xc341('0x60')](_0x2bd737)['then'](handleEntityNotFound(_0x475a9c,null))['then'](respondWithResult(_0x475a9c,null))['catch'](handleError(_0x475a9c,null));};exports[_0xc341('0x61')]=function(_0x55faf4,_0x3d8be0){return db[_0xc341('0x58')][_0xc341('0x61')](_0x55faf4['body'],{})[_0xc341('0x27')](function(_0x56eaef){var _0x24548e=_0x55faf4[_0xc341('0x62')]['get']({'plain':!![]});if(!_0x24548e)throw new Error(_0xc341('0x63'));if(_0x24548e['role']===_0xc341('0x62')){var _0x19bce7=_0x56eaef[_0xc341('0x64')]({'plain':!![]});var _0x3ec783=_0xc341('0x3e');return db['UserProfileSection'][_0xc341('0x60')]({'where':{'name':_0x3ec783,'userProfileId':_0x24548e['userProfileId']},'raw':!![]})[_0xc341('0x27')](function(_0x4c0ce7){if(_0x4c0ce7&&_0x4c0ce7[_0xc341('0x65')]===0x0){return db['UserProfileResource'][_0xc341('0x61')]({'name':_0x19bce7[_0xc341('0x40')],'resourceId':_0x19bce7['id'],'type':_0x4c0ce7['name'],'sectionId':_0x4c0ce7['id']},{})['then'](function(){return _0x56eaef;});}else{return _0x56eaef;}})[_0xc341('0x30')](function(_0x4c06ef){logger[_0xc341('0x2d')](_0xc341('0x66'),_0x4c06ef);throw _0x4c06ef;});}return _0x56eaef;})['then'](respondWithResult(_0x3d8be0,0xc9))[_0xc341('0x30')](handleError(_0x3d8be0,null));};exports[_0xc341('0x3c')]=function(_0x410fab,_0x8b92c2){if(_0x410fab[_0xc341('0x67')]['id']){delete _0x410fab[_0xc341('0x67')]['id'];}return db[_0xc341('0x58')][_0xc341('0x60')]({'where':{'id':_0x410fab[_0xc341('0x5e')]['id']}})[_0xc341('0x27')](handleEntityNotFound(_0x8b92c2,null))['then'](saveUpdates(_0x410fab[_0xc341('0x67')],null))[_0xc341('0x27')](respondWithResult(_0x8b92c2,null))[_0xc341('0x30')](handleError(_0x8b92c2,null));};exports[_0xc341('0x3d')]=function(_0x34a8ac,_0x4b0524){return db[_0xc341('0x58')][_0xc341('0x60')]({'where':{'id':_0x34a8ac[_0xc341('0x5e')]['id']}})[_0xc341('0x27')](handleEntityNotFound(_0x4b0524,null))[_0xc341('0x27')](removeEntity(_0x4b0524,null))['catch'](handleError(_0x4b0524,null));};exports[_0xc341('0x68')]=function(_0x46b9f9,_0x3a382e){return db[_0xc341('0x58')]['describe']()[_0xc341('0x27')](respondWithResult(_0x3a382e,null))[_0xc341('0x30')](handleError(_0x3a382e,null));};exports[_0xc341('0x69')]=function(_0x4a0d78,_0x5ab215,_0x2ee452){var _0x4b5566={'raw':!![],'where':{}},_0x3bae8e={},_0x27f402;return db['ChatQueue'][_0xc341('0x6a')]({'where':{'id':_0x4a0d78['params']['id']}})[_0xc341('0x27')](handleEntityNotFound(_0x5ab215,null))[_0xc341('0x27')](function(_0x44d002){if(_0x44d002){_0x27f402=_0x44d002['get']({'plain':!![]});_0x3bae8e['model']=_[_0xc341('0x4a')](db[_0xc341('0x6b')]['rawAttributes']);_0x3bae8e[_0xc341('0x49')]=_['keys'](_0x4a0d78[_0xc341('0x49')]);_0x3bae8e['filters']=_[_0xc341('0x4c')](_0x3bae8e['model'],_0x3bae8e[_0xc341('0x49')]);_0x4b5566[_0xc341('0x4d')]=_[_0xc341('0x4c')](_0x3bae8e[_0xc341('0x48')],qs[_0xc341('0x4e')](_0x4a0d78['query']['fields']));_0x4b5566['attributes']=_0x4b5566[_0xc341('0x4d')]['length']?_0x4b5566[_0xc341('0x4d')]:_0x3bae8e['model'];if(!_0x4a0d78[_0xc341('0x49')][_0xc341('0x4f')](_0xc341('0x50'))){_0x4b5566[_0xc341('0x37')]=qs[_0xc341('0x37')](_0x4a0d78[_0xc341('0x49')][_0xc341('0x37')]);_0x4b5566['offset']=qs['offset'](_0x4a0d78[_0xc341('0x49')][_0xc341('0x36')]);}_0x4b5566[_0xc341('0x51')]=qs[_0xc341('0x52')](_0x4a0d78[_0xc341('0x49')][_0xc341('0x52')]);_0x4b5566[_0xc341('0x53')]=qs['filters'](_[_0xc341('0x54')](_0x4a0d78[_0xc341('0x49')],_0x3bae8e[_0xc341('0x4b')]));_0x4b5566[_0xc341('0x53')][_0xc341('0x6c')]=_0x44d002['id'];if(_0x4a0d78[_0xc341('0x49')][_0xc341('0x55')]){_0x4b5566['where']=_['merge'](_0x4b5566[_0xc341('0x53')],{'$or':_[_0xc341('0x43')](_0x4b5566['attributes'],function(_0x4a9407){var _0x3314f3={};_0x3314f3[_0x4a9407]={'$like':'%'+_0x4a0d78[_0xc341('0x49')][_0xc341('0x55')]+'%'};return _0x3314f3;})});}_0x4b5566=_[_0xc341('0x56')]({},_0x4b5566,_0x4a0d78[_0xc341('0x57')]);return db[_0xc341('0x6b')]['findAll'](_0x4b5566);}})['then'](function(_0x2e2dc7){if(_0x2e2dc7){return db[_0xc341('0x6d')][_0xc341('0x6e')]({'where':{'id':_[_0xc341('0x43')](_0x2e2dc7,'UserId'),'role':_0xc341('0x6f')},'attributes':['id',_0xc341('0x40'),_0xc341('0x70'),'updatedAt',_0xc341('0x71')]});}})['then'](function(_0xf77e97){if(_0xf77e97){return{'count':_0xf77e97[_0xc341('0x35')],'rows':_['map'](_0xf77e97[_0xc341('0x5c')],function(_0x273fc5){return{'membername':_0x273fc5['name'],'UserId':_0x273fc5['id'],'queue_name':_0x27f402[_0xc341('0x40')],'ChatQueueId':_0x27f402['id'],'interface':util[_0xc341('0x72')](_0xc341('0x73'),_0xc341('0x74'),_0x273fc5[_0xc341('0x40')]),'penalty':0x0,'paused':_0x273fc5[_0xc341('0x70')],'createdAt':_0x273fc5[_0xc341('0x71')],'updatedAt':_0x273fc5['updatedAt']};})};}else{return{'count':0x0,'rows':[]};}})[_0xc341('0x27')](respondWithFilteredResult(_0x5ab215,_0x4b5566))[_0xc341('0x30')](handleError(_0x5ab215,null));};exports[_0xc341('0x75')]=function(_0x4edc5b,_0xcfc613,_0x4ab2b5){var _0x13d1db={};var _0x2bd3f3={};var _0x3e4c62;var _0x4bc622;return db[_0xc341('0x58')][_0xc341('0x6a')]({'where':{'id':_0x4edc5b[_0xc341('0x5e')]['id']}})[_0xc341('0x27')](handleEntityNotFound(_0xcfc613,null))[_0xc341('0x27')](function(_0x31ef9f){if(_0x31ef9f){_0x3e4c62=_0x31ef9f;_0x2bd3f3['model']=_[_0xc341('0x4a')](db[_0xc341('0x76')]['rawAttributes']);_0x2bd3f3['query']=_[_0xc341('0x4a')](_0x4edc5b[_0xc341('0x49')]);_0x2bd3f3[_0xc341('0x4b')]=_[_0xc341('0x4c')](_0x2bd3f3[_0xc341('0x48')],_0x2bd3f3[_0xc341('0x49')]);_0x13d1db[_0xc341('0x4d')]=_['intersection'](_0x2bd3f3[_0xc341('0x48')],qs[_0xc341('0x4e')](_0x4edc5b['query'][_0xc341('0x4e')]));_0x13d1db[_0xc341('0x4d')]=_0x13d1db['attributes'][_0xc341('0x5f')]?_0x13d1db[_0xc341('0x4d')]:_0x2bd3f3[_0xc341('0x48')];_0x13d1db['order']=qs[_0xc341('0x52')](_0x4edc5b['query'][_0xc341('0x52')]);_0x13d1db['where']=qs[_0xc341('0x4b')](_[_0xc341('0x54')](_0x4edc5b[_0xc341('0x49')],_0x2bd3f3[_0xc341('0x4b')]));if(_0x4edc5b[_0xc341('0x49')][_0xc341('0x55')]){_0x13d1db[_0xc341('0x53')]=_[_0xc341('0x56')](_0x13d1db[_0xc341('0x53')],{'$or':_[_0xc341('0x43')](_0x13d1db[_0xc341('0x4d')],function(_0x6684e0){var _0x4c39e6={};_0x4c39e6[_0x6684e0]={'$like':'%'+_0x4edc5b[_0xc341('0x49')][_0xc341('0x55')]+'%'};return _0x4c39e6;})});}_0x13d1db=_[_0xc341('0x56')]({},_0x13d1db,_0x4edc5b[_0xc341('0x57')]);return _0x3e4c62['getTeams'](_0x13d1db);}})['then'](function(_0x41f7c7){if(_0x41f7c7){_0x4bc622=_0x41f7c7[_0xc341('0x5f')];if(!_0x4edc5b['query'][_0xc341('0x4f')](_0xc341('0x50'))){_0x13d1db[_0xc341('0x37')]=qs[_0xc341('0x37')](_0x4edc5b[_0xc341('0x49')][_0xc341('0x37')]);_0x13d1db[_0xc341('0x36')]=qs[_0xc341('0x36')](_0x4edc5b[_0xc341('0x49')][_0xc341('0x36')]);}return _0x3e4c62[_0xc341('0x75')](_0x13d1db);}})[_0xc341('0x27')](function(_0x166b24){if(_0x166b24){return _0x166b24?{'count':_0x4bc622,'rows':_0x166b24}:null;}})[_0xc341('0x27')](respondWithResult(_0xcfc613,null))['catch'](handleError(_0xcfc613,null));};exports[_0xc341('0x77')]=function(_0x49461e,_0x5e53cb,_0x39c764){var _0x139386=_0x49461e[_0xc341('0x67')]['ids'];return db[_0xc341('0x76')][_0xc341('0x5b')]({'where':{'id':_0x139386},'attributes':['id'],'include':[{'model':db['User'],'as':_0xc341('0x78'),'attributes':['id',_0xc341('0x40'),'online',_0xc341('0x79'),_0xc341('0x7a')],'raw':!![]}]})['then'](function(_0x188173){if(_0x188173){var _0xf19b85=_[_0xc341('0x7b')](_0x188173,function(_0x48da05){var _0x4ec3a8=_0x48da05['get']({'plain':!![]});return _0x4ec3a8[_0xc341('0x78')];});return db[_0xc341('0x58')][_0xc341('0x60')]({'where':{'id':_0x49461e[_0xc341('0x5e')]['id']}})[_0xc341('0x27')](function(_0x4cbb8c){return db['sequelize'][_0xc341('0x7c')](function(_0x457793){return _0x4cbb8c['addTeams'](_0x139386,{'transaction':_0x457793})['then'](function(){return BPromise[_0xc341('0x7d')](_0xf19b85,function(_0x427072){return db['UserChatQueue']['findOrCreate']({'where':{'UserId':_0x427072['id'],'ChatQueueId':_0x49461e[_0xc341('0x5e')]['id']},'transaction':_0x457793});});})[_0xc341('0x27')](function(){_0xf19b85[_0xc341('0x7e')](function(_0x1f78ea){socket[_0xc341('0x7f')]('userChatQueue:save',{'UserId':_0x1f78ea['id'],'ChatQueueId':_0x4cbb8c['id']});});});});});}})['then'](respondWithStatusCode(_0x5e53cb,null))[_0xc341('0x30')](handleError(_0x5e53cb,null));};exports[_0xc341('0x80')]=function(_0x15d266,_0x550a8b,_0xb894d5){return db[_0xc341('0x76')]['findAll']({'where':{'id':_0x15d266[_0xc341('0x49')][_0xc341('0x81')]},'attributes':['id'],'include':[{'model':db['User'],'as':'Agents','attributes':['id'],'raw':!![]}]})['then'](handleEntityNotFound(_0x550a8b,null))['then'](function(_0x8315ad){var _0x371302=_[_0xc341('0x43')](_0x8315ad,'id');var _0x3193b1=[];var _0xaae2e4=[];var _0x14be9e=squel[_0xc341('0x82')]();_0x14be9e['field']('tq.TeamId')[_0xc341('0x83')](_0xc341('0x84'),'tq')[_0xc341('0x85')]('user_has_teams','ut',_0xc341('0x86'))['where'](_0xc341('0x87'),_0x15d266[_0xc341('0x5e')]['id']);for(var _0x26af68=0x0;_0x26af68<_0x8315ad['length'];_0x26af68+=0x1){let _0xfdce40=_0x8315ad[_0x26af68];for(var _0x100f1f=0x0;_0x100f1f<_0xfdce40[_0xc341('0x78')][_0xc341('0x5f')];_0x100f1f+=0x1){let _0x15e51a=_0xfdce40[_0xc341('0x78')][_0x100f1f];var _0x1965d5=_0x14be9e['clone']();_0x1965d5[_0xc341('0x53')](_0xc341('0x88'),_0x15e51a['id']);_0xaae2e4[_0xc341('0x89')](db[_0xc341('0x8a')][_0xc341('0x49')](_0x1965d5['toString'](),{'type':db['sequelize']['QueryTypes'][_0xc341('0x8b')]})[_0xc341('0x27')](function(_0x2ae146){if(_0x2ae146['length']===0x1){return _0x15e51a['id'];}else{var _0x59cf4d=_[_0xc341('0x8c')](_[_0xc341('0x43')](_0x2ae146,_0xc341('0x8d')),function(_0x5e502a){return _[_0xc341('0x8e')](_0x371302,_0x5e502a);});if(_0x59cf4d){return _0x15e51a['id'];}}}));}}return BPromise['all'](_0xaae2e4)['then'](function(_0x58f0e9){_0x3193b1=_(_0x3193b1)[_0xc341('0x8f')](_0x58f0e9)['compact']()['value']();return db[_0xc341('0x58')][_0xc341('0x60')]({'where':{'id':_0x15d266['params']['id']}})[_0xc341('0x27')](function(_0x3c0aac){return db[_0xc341('0x8a')][_0xc341('0x7c')](function(_0x54d699){return _0x3c0aac[_0xc341('0x80')](_0x15d266['query'][_0xc341('0x81')],{'transaction':_0x54d699})[_0xc341('0x27')](function(){if(!_[_0xc341('0x90')](_0x3193b1)){return _0x3c0aac[_0xc341('0x91')](_0x3193b1,{'transaction':_0x54d699});}})[_0xc341('0x27')](function(){_0x3193b1[_0xc341('0x7e')](function(_0x66af3d){socket['emit'](_0xc341('0x92'),{'UserId':_0x66af3d,'ChatQueueId':_0x3c0aac['id']});});});});});});})[_0xc341('0x27')](respondWithStatusCode(_0x550a8b,null))[_0xc341('0x30')](handleError(_0x550a8b,null));};exports[_0xc341('0x93')]=function(_0x290122,_0x370788,_0x454743){return db[_0xc341('0x58')][_0xc341('0x60')]({'where':{'id':_0x290122[_0xc341('0x5e')]['id']}})[_0xc341('0x27')](handleEntityNotFound(_0x370788,null))[_0xc341('0x27')](function(_0x8f9f7b){if(_0x8f9f7b){return _0x8f9f7b[_0xc341('0x93')](_0x290122[_0xc341('0x67')][_0xc341('0x81')],_[_0xc341('0x94')](_0x290122[_0xc341('0x67')],[_0xc341('0x81'),'id'])||{})[_0xc341('0x95')](function(_0x5a83bb){for(var _0x28bbd7=0x0;_0x28bbd7<_0x290122[_0xc341('0x67')][_0xc341('0x81')][_0xc341('0x5f')];_0x28bbd7+=0x1){socket[_0xc341('0x7f')](_0xc341('0x96'),{'UserId':_0x290122[_0xc341('0x67')]['ids'][_0x28bbd7],'ChatQueueId':_0x290122['params']['id']});}return _0x5a83bb;});}})['then'](respondWithResult(_0x370788,null))['catch'](handleError(_0x370788,null));};exports[_0xc341('0x91')]=function(_0x275214,_0x2c2cee,_0x49acf5){return db[_0xc341('0x58')][_0xc341('0x60')]({'where':{'id':_0x275214[_0xc341('0x5e')]['id']}})[_0xc341('0x27')](handleEntityNotFound(_0x2c2cee,null))[_0xc341('0x27')](function(_0x416de1){if(_0x416de1){return _0x416de1[_0xc341('0x91')](_0x275214[_0xc341('0x49')][_0xc341('0x81')])['then'](function(){if(_[_0xc341('0x97')](_0x275214[_0xc341('0x49')][_0xc341('0x81')])){for(var _0x51609d=0x0;_0x51609d<_0x275214[_0xc341('0x49')][_0xc341('0x81')][_0xc341('0x5f')];_0x51609d+=0x1){socket[_0xc341('0x7f')](_0xc341('0x92'),{'UserId':Number(_0x275214['query'][_0xc341('0x81')][_0x51609d]),'ChatQueueId':Number(_0x275214[_0xc341('0x5e')]['id'])});}}else{socket[_0xc341('0x7f')](_0xc341('0x92'),{'UserId':Number(_0x275214['query'][_0xc341('0x81')]),'ChatQueueId':Number(_0x275214['params']['id'])});}});}})['then'](respondWithStatusCode(_0x2c2cee,null))['catch'](handleError(_0x2c2cee,null));};exports[_0xc341('0x98')]=function(_0x4e7b2c,_0x249e7d,_0xe7869c){var _0x3f639c={};var _0x41754f={};var _0x47c4ec;var _0x1c3632;return db['ChatQueue'][_0xc341('0x6a')]({'where':{'id':_0x4e7b2c[_0xc341('0x5e')]['id']}})[_0xc341('0x27')](handleEntityNotFound(_0x249e7d,null))[_0xc341('0x27')](function(_0x2ff169){if(_0x2ff169){_0x47c4ec=_0x2ff169;_0x41754f[_0xc341('0x48')]=_[_0xc341('0x4a')](db[_0xc341('0x6d')][_0xc341('0x44')]);_0x41754f[_0xc341('0x49')]=_[_0xc341('0x4a')](_0x4e7b2c[_0xc341('0x49')]);_0x41754f[_0xc341('0x4b')]=_[_0xc341('0x4c')](_0x41754f[_0xc341('0x48')],_0x41754f[_0xc341('0x49')]);_0x3f639c['attributes']=_[_0xc341('0x4c')](_0x41754f[_0xc341('0x48')],qs['fields'](_0x4e7b2c[_0xc341('0x49')][_0xc341('0x4e')]));_0x3f639c[_0xc341('0x4d')]=_0x3f639c[_0xc341('0x4d')]['length']?_0x3f639c[_0xc341('0x4d')]:_0x41754f['model'];_0x3f639c[_0xc341('0x51')]=qs[_0xc341('0x52')](_0x4e7b2c[_0xc341('0x49')][_0xc341('0x52')]);_0x3f639c[_0xc341('0x53')]=qs['filters'](_[_0xc341('0x54')](_0x4e7b2c[_0xc341('0x49')],_0x41754f[_0xc341('0x4b')]));if(_0x4e7b2c[_0xc341('0x49')][_0xc341('0x55')]){_0x3f639c['where']=_[_0xc341('0x56')](_0x3f639c[_0xc341('0x53')],{'$or':_[_0xc341('0x43')](_0x3f639c['attributes'],function(_0x2f7c7f){var _0x582aa1={};_0x582aa1[_0x2f7c7f]={'$like':'%'+_0x4e7b2c['query'][_0xc341('0x55')]+'%'};return _0x582aa1;})});}_0x3f639c=_[_0xc341('0x56')]({},_0x3f639c,_0x4e7b2c[_0xc341('0x57')]);return _0x47c4ec[_0xc341('0x98')](_0x3f639c);}})['then'](function(_0x1b1b67){if(_0x1b1b67){_0x1c3632=_0x1b1b67['length'];if(!_0x4e7b2c[_0xc341('0x49')]['hasOwnProperty'](_0xc341('0x50'))){_0x3f639c['limit']=qs['limit'](_0x4e7b2c['query'][_0xc341('0x37')]);_0x3f639c[_0xc341('0x36')]=qs['offset'](_0x4e7b2c[_0xc341('0x49')][_0xc341('0x36')]);}return _0x47c4ec[_0xc341('0x98')](_0x3f639c);}})[_0xc341('0x27')](function(_0x4ccd80){if(_0x4ccd80){return _0x4ccd80?{'count':_0x1c3632,'rows':_0x4ccd80}:null;}})[_0xc341('0x27')](respondWithResult(_0x249e7d,null))[_0xc341('0x30')](handleError(_0x249e7d,null));};
\ No newline at end of file
+var _0xfd50=['user','Unable\x20to\x20retrieve\x20the\x20current\x20user','role','UserProfileSection','find','userProfileId','autoAssociation','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','body','describe','findOne','UserChatQueue','findAndCountAll','UserId','agent','updatedAt','createdAt','format','%s/%s','SIP','chatPause','getTeams','Team','addTeams','ids','Agents','voicePause','interface','flatMap','sequelize','each','findOrCreate','forEach','emit','removeTeams','User','select','field','tq.TeamId','team_has_chat_queues','join','user_has_teams','ut.TeamId\x20=\x20tq.TeamId','ChatQueueId\x20=\x20?','clone','ut.UserId\x20=\x20?','push','toString','QueryTypes','SELECT','every','TeamId','includes','all','compact','transaction','isEmpty','removeAgents','addAgents','spread','userChatQueue:save','isArray','userChatQueue:remove','getAgents','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','bluebird','mustache','sox','to-csv','ejs','lodash','crypto','jsforce','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/logger','api','../../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','info','ChatQueue,\x20%s,\x20%s','request\x20sent','debug','error','message','result','catch','end','status','json','count','offset','limit','set','apply','reject','save','update','destroy','then','get','ChatQueues','UserProfileResource','sendStatus','stack','name','send','index','map','rawAttributes','fieldName','key','model','query','filters','intersection','attributes','fields','length','hasOwnProperty','nolimit','order','sort','filter','where','type','merge','options','ChatQueue','include','findAll','rows','show','params','keys','create'];(function(_0x49ded9,_0x57c1c9){var _0x445fc6=function(_0x2dbb20){while(--_0x2dbb20){_0x49ded9['push'](_0x49ded9['shift']());}};_0x445fc6(++_0x57c1c9);}(_0xfd50,0x178));var _0x0fd5=function(_0x4c12ec,_0x2e9103){_0x4c12ec=_0x4c12ec-0x0;var _0x3ae42c=_0xfd50[_0x4c12ec];return _0x3ae42c;};'use strict';var pdf=require('html-pdf');var emlformat=require(_0x0fd5('0x0'));var rimraf=require(_0x0fd5('0x1'));var zipdir=require(_0x0fd5('0x2'));var jsonpatch=require(_0x0fd5('0x3'));var rp=require(_0x0fd5('0x4'));var moment=require('moment');var BPromise=require(_0x0fd5('0x5'));var Mustache=require(_0x0fd5('0x6'));var util=require('util');var path=require('path');var sox=require(_0x0fd5('0x7'));var csv=require(_0x0fd5('0x8'));var ejs=require(_0x0fd5('0x9'));var fs=require('fs');var _=require(_0x0fd5('0xa'));var squel=require('squel');var crypto=require(_0x0fd5('0xb'));var jsforce=require(_0x0fd5('0xc'));var deskjs=require('desk.js');var toCsv=require(_0x0fd5('0x8'));var querystring=require(_0x0fd5('0xd'));var Papa=require(_0x0fd5('0xe'));var Redis=require(_0x0fd5('0xf'));var authService=require(_0x0fd5('0x10'));var qs=require(_0x0fd5('0x11'));var as=require(_0x0fd5('0x12'));var hardwareService=require('../../config/license/hardware');var logger=require(_0x0fd5('0x13'))(_0x0fd5('0x14'));var utils=require('../../config/utils');var config=require(_0x0fd5('0x15'));var db=require(_0x0fd5('0x16'))['db'];config[_0x0fd5('0x17')]=_[_0x0fd5('0x18')](config[_0x0fd5('0x17')],{'host':_0x0fd5('0x19'),'port':0x18eb});var socket=require(_0x0fd5('0x1a'))(new Redis(config['redis']));require('./chatQueue.socket')[_0x0fd5('0x1b')](socket);var jayson=require('jayson/promise');var client=jayson[_0x0fd5('0x1c')][_0x0fd5('0x1d')]({'port':0x232a});function checkPasswordPattern(_0xbfa7d1,_0xd8e3f5,_0x200639){if(_0x200639){var _0x5e2911=new RegExp(/(?=.*[a-z])(?=.*[A-Z])(?=.*[0-9])(?=.*[?!@#\$%\^&\*~\-_=+[{\]\}])(?=.{8,})/);if(_0x5e2911[_0x0fd5('0x1e')](_0xd8e3f5)){return _0xbfa7d1;}else{throw new db[(_0x0fd5('0x1f'))][(_0x0fd5('0x20'))](_0x0fd5('0x21'));}}else{return _0xbfa7d1;}}function respondWithRpcPromise(_0xe6e3d2,_0x2e2871,_0x4c3d76,_0x977f7d){return new BPromise(function(_0x8cee,_0x3f1843){var _0x442815=_0x977f7d||client;return _0x442815[_0x0fd5('0x22')](_0xe6e3d2,_0x4c3d76)['then'](function(_0xd6bf91){logger[_0x0fd5('0x23')](_0x0fd5('0x24'),_0x2e2871,_0x0fd5('0x25'));logger[_0x0fd5('0x26')]('ChatQueue,\x20%s,\x20%s,\x20%s',_0x2e2871,_0x0fd5('0x25'),JSON['stringify'](_0xd6bf91));if(_0xd6bf91[_0x0fd5('0x27')]){if(_0xd6bf91[_0x0fd5('0x27')]['code']===0x1f4){logger[_0x0fd5('0x27')](_0x0fd5('0x24'),_0x2e2871,_0xd6bf91[_0x0fd5('0x27')][_0x0fd5('0x28')]);return _0x3f1843(_0xd6bf91['error'][_0x0fd5('0x28')]);}logger[_0x0fd5('0x27')](_0x0fd5('0x24'),_0x2e2871,_0xd6bf91[_0x0fd5('0x27')]['message']);return _0x8cee(_0xd6bf91[_0x0fd5('0x27')][_0x0fd5('0x28')]);}else{logger[_0x0fd5('0x23')](_0x0fd5('0x24'),_0x2e2871,_0x0fd5('0x25'));_0x8cee(_0xd6bf91[_0x0fd5('0x29')][_0x0fd5('0x28')]);}})[_0x0fd5('0x2a')](function(_0x110fab){logger[_0x0fd5('0x27')](_0x0fd5('0x24'),_0x2e2871,_0x110fab);_0x3f1843(_0x110fab);});});}function respondWithStatusCode(_0x2b0991,_0x2596d7){_0x2596d7=_0x2596d7||0xcc;return function(_0x52a6a2){if(_0x52a6a2){return _0x2b0991['sendStatus'](_0x2596d7);}return _0x2b0991['status'](_0x2596d7)[_0x0fd5('0x2b')]();};}function respondWithResult(_0x4547dd,_0x566a98){_0x566a98=_0x566a98||0xc8;return function(_0x46e395){if(_0x46e395){return _0x4547dd[_0x0fd5('0x2c')](_0x566a98)[_0x0fd5('0x2d')](_0x46e395);}};}function respondWithFilteredResult(_0x79a5a,_0x49dfb2){return function(_0x3542d7){if(_0x3542d7){var _0xe9b954=_0x3542d7[_0x0fd5('0x2e')],_0x222dee=_0x49dfb2[_0x0fd5('0x2f')],_0x4cc40b=_0x49dfb2[_0x0fd5('0x2f')]+_0x49dfb2[_0x0fd5('0x30')],_0x3e41d4;if(_0x4cc40b>=_0xe9b954){_0x4cc40b=_0xe9b954;_0x3e41d4=0xc8;}else{_0x3e41d4=0xce;}_0x79a5a['status'](_0x3e41d4);return _0x79a5a[_0x0fd5('0x31')]('Content-Range',_0x222dee+'-'+_0x4cc40b+'/'+_0xe9b954)['json'](_0x3542d7);}return null;};}function patchUpdates(_0x3f6f67){return function(_0x50e03e){try{jsonpatch[_0x0fd5('0x32')](_0x50e03e,_0x3f6f67,!![]);}catch(_0x2d20f2){return BPromise[_0x0fd5('0x33')](_0x2d20f2);}return _0x50e03e[_0x0fd5('0x34')]();};}function saveUpdates(_0x3e8f91,_0x37e028){return function(_0x4081dd){if(_0x4081dd){return _0x4081dd[_0x0fd5('0x35')](_0x3e8f91)['then'](function(_0x11a07d){return _0x11a07d;});}return null;};}function removeEntity(_0x51ced1,_0x1cd73a){return function(_0x24f5a6){if(_0x24f5a6){return _0x24f5a6[_0x0fd5('0x36')]()[_0x0fd5('0x37')](function(){var _0x248d29=_0x24f5a6[_0x0fd5('0x38')]({'plain':!![]});var _0x82a7be=_0x0fd5('0x39');return db[_0x0fd5('0x3a')][_0x0fd5('0x36')]({'where':{'type':_0x82a7be,'resourceId':_0x248d29['id']}})[_0x0fd5('0x37')](function(){return _0x24f5a6;});})[_0x0fd5('0x37')](function(){_0x51ced1['status'](0xcc)['end']();});}};}function handleEntityNotFound(_0x438741,_0x5781fa){return function(_0x4f5444){if(!_0x4f5444){_0x438741[_0x0fd5('0x3b')](0x194);}return _0x4f5444;};}function handleError(_0x3d4bdb,_0xbd1c49){_0xbd1c49=_0xbd1c49||0x1f4;return function(_0x3f184c){logger[_0x0fd5('0x27')](_0x3f184c[_0x0fd5('0x3c')]);if(_0x3f184c[_0x0fd5('0x3d')]){delete _0x3f184c[_0x0fd5('0x3d')];}_0x3d4bdb[_0x0fd5('0x2c')](_0xbd1c49)[_0x0fd5('0x3e')](_0x3f184c);};}exports[_0x0fd5('0x3f')]=function(_0xffd38e,_0x3eb4bc){var _0x2cd18d={},_0x436529={},_0x1ee77a={'count':0x0,'rows':[]};var _0x5aa1ab=_[_0x0fd5('0x40')](db['ChatQueue'][_0x0fd5('0x41')],function(_0x183b7c){return{'name':_0x183b7c[_0x0fd5('0x42')],'type':_0x183b7c['type'][_0x0fd5('0x43')]};});_0x436529[_0x0fd5('0x44')]=_['map'](_0x5aa1ab,_0x0fd5('0x3d'));_0x436529[_0x0fd5('0x45')]=_['keys'](_0xffd38e[_0x0fd5('0x45')]);_0x436529[_0x0fd5('0x46')]=_[_0x0fd5('0x47')](_0x436529[_0x0fd5('0x44')],_0x436529[_0x0fd5('0x45')]);_0x2cd18d[_0x0fd5('0x48')]=_[_0x0fd5('0x47')](_0x436529[_0x0fd5('0x44')],qs[_0x0fd5('0x49')](_0xffd38e[_0x0fd5('0x45')][_0x0fd5('0x49')]));_0x2cd18d[_0x0fd5('0x48')]=_0x2cd18d[_0x0fd5('0x48')][_0x0fd5('0x4a')]?_0x2cd18d[_0x0fd5('0x48')]:_0x436529['model'];if(!_0xffd38e[_0x0fd5('0x45')][_0x0fd5('0x4b')](_0x0fd5('0x4c'))){_0x2cd18d[_0x0fd5('0x30')]=qs[_0x0fd5('0x30')](_0xffd38e[_0x0fd5('0x45')][_0x0fd5('0x30')]);_0x2cd18d[_0x0fd5('0x2f')]=qs['offset'](_0xffd38e[_0x0fd5('0x45')][_0x0fd5('0x2f')]);}_0x2cd18d[_0x0fd5('0x4d')]=qs[_0x0fd5('0x4e')](_0xffd38e[_0x0fd5('0x45')][_0x0fd5('0x4e')]);_0x2cd18d['where']=qs[_0x0fd5('0x46')](_['pick'](_0xffd38e['query'],_0x436529['filters']));if(_0xffd38e[_0x0fd5('0x45')][_0x0fd5('0x4f')]){_0x2cd18d[_0x0fd5('0x50')]=_['merge'](_0x2cd18d[_0x0fd5('0x50')],{'$or':_[_0x0fd5('0x40')](_0x5aa1ab,function(_0x1e6038){if(_0x1e6038[_0x0fd5('0x51')]!=='VIRTUAL'){var _0x121491={};_0x121491[_0x1e6038['name']]={'$like':'%'+_0xffd38e[_0x0fd5('0x45')][_0x0fd5('0x4f')]+'%'};return _0x121491;}})});}_0x2cd18d=_[_0x0fd5('0x52')]({},_0x2cd18d,_0xffd38e[_0x0fd5('0x53')]);var _0x5b2445={'where':_0x2cd18d[_0x0fd5('0x50')]};return db[_0x0fd5('0x54')]['count'](_0x5b2445)[_0x0fd5('0x37')](function(_0x1cd6d6){_0x1ee77a[_0x0fd5('0x2e')]=_0x1cd6d6;if(_0xffd38e[_0x0fd5('0x45')]['includeAll']){_0x2cd18d[_0x0fd5('0x55')]=[{'all':!![]}];}return db['ChatQueue'][_0x0fd5('0x56')](_0x2cd18d);})[_0x0fd5('0x37')](function(_0x226376){_0x1ee77a[_0x0fd5('0x57')]=_0x226376;return _0x1ee77a;})[_0x0fd5('0x37')](respondWithFilteredResult(_0x3eb4bc,_0x2cd18d))[_0x0fd5('0x2a')](handleError(_0x3eb4bc,null));};exports[_0x0fd5('0x58')]=function(_0x223562,_0x31959b){var _0x596063={'raw':!![],'where':{'id':_0x223562[_0x0fd5('0x59')]['id']}},_0x3e7626={};_0x3e7626[_0x0fd5('0x44')]=_[_0x0fd5('0x5a')](db['ChatQueue'][_0x0fd5('0x41')]);_0x3e7626[_0x0fd5('0x45')]=_[_0x0fd5('0x5a')](_0x223562[_0x0fd5('0x45')]);_0x3e7626[_0x0fd5('0x46')]=_[_0x0fd5('0x47')](_0x3e7626[_0x0fd5('0x44')],_0x3e7626[_0x0fd5('0x45')]);_0x596063['attributes']=_[_0x0fd5('0x47')](_0x3e7626[_0x0fd5('0x44')],qs['fields'](_0x223562[_0x0fd5('0x45')][_0x0fd5('0x49')]));_0x596063[_0x0fd5('0x48')]=_0x596063[_0x0fd5('0x48')][_0x0fd5('0x4a')]?_0x596063[_0x0fd5('0x48')]:_0x3e7626['model'];if(_0x223562[_0x0fd5('0x45')]['includeAll']){_0x596063[_0x0fd5('0x55')]=[{'all':!![]}];}_0x596063=_[_0x0fd5('0x52')]({},_0x596063,_0x223562[_0x0fd5('0x53')]);return db['ChatQueue']['find'](_0x596063)[_0x0fd5('0x37')](handleEntityNotFound(_0x31959b,null))['then'](respondWithResult(_0x31959b,null))[_0x0fd5('0x2a')](handleError(_0x31959b,null));};exports['create']=function(_0x3db04d,_0x3118e0){return db['ChatQueue'][_0x0fd5('0x5b')](_0x3db04d['body'],{})[_0x0fd5('0x37')](function(_0x15044d){var _0x5a930f=_0x3db04d[_0x0fd5('0x5c')][_0x0fd5('0x38')]({'plain':!![]});if(!_0x5a930f)throw new Error(_0x0fd5('0x5d'));if(_0x5a930f[_0x0fd5('0x5e')]===_0x0fd5('0x5c')){var _0x4e8120=_0x15044d[_0x0fd5('0x38')]({'plain':!![]});var _0x207613=_0x0fd5('0x39');return db[_0x0fd5('0x5f')][_0x0fd5('0x60')]({'where':{'name':_0x207613,'userProfileId':_0x5a930f[_0x0fd5('0x61')]},'raw':!![]})[_0x0fd5('0x37')](function(_0x43c05f){if(_0x43c05f&&_0x43c05f[_0x0fd5('0x62')]===0x0){return db[_0x0fd5('0x3a')][_0x0fd5('0x5b')]({'name':_0x4e8120[_0x0fd5('0x3d')],'resourceId':_0x4e8120['id'],'type':_0x43c05f[_0x0fd5('0x3d')],'sectionId':_0x43c05f['id']},{})[_0x0fd5('0x37')](function(){return _0x15044d;});}else{return _0x15044d;}})[_0x0fd5('0x2a')](function(_0x4ea5a8){logger[_0x0fd5('0x27')](_0x0fd5('0x63'),_0x4ea5a8);throw _0x4ea5a8;});}return _0x15044d;})[_0x0fd5('0x37')](respondWithResult(_0x3118e0,0xc9))[_0x0fd5('0x2a')](handleError(_0x3118e0,null));};exports[_0x0fd5('0x35')]=function(_0x30c005,_0x79999f){if(_0x30c005[_0x0fd5('0x64')]['id']){delete _0x30c005[_0x0fd5('0x64')]['id'];}return db[_0x0fd5('0x54')][_0x0fd5('0x60')]({'where':{'id':_0x30c005[_0x0fd5('0x59')]['id']}})['then'](handleEntityNotFound(_0x79999f,null))['then'](saveUpdates(_0x30c005[_0x0fd5('0x64')],null))[_0x0fd5('0x37')](respondWithResult(_0x79999f,null))[_0x0fd5('0x2a')](handleError(_0x79999f,null));};exports[_0x0fd5('0x36')]=function(_0x568838,_0x3800b9){return db[_0x0fd5('0x54')][_0x0fd5('0x60')]({'where':{'id':_0x568838[_0x0fd5('0x59')]['id']}})[_0x0fd5('0x37')](handleEntityNotFound(_0x3800b9,null))[_0x0fd5('0x37')](removeEntity(_0x3800b9,null))[_0x0fd5('0x2a')](handleError(_0x3800b9,null));};exports[_0x0fd5('0x65')]=function(_0x6f3208,_0x4efe4d){return db[_0x0fd5('0x54')]['describe']()[_0x0fd5('0x37')](respondWithResult(_0x4efe4d,null))[_0x0fd5('0x2a')](handleError(_0x4efe4d,null));};exports['getMembers']=function(_0x5d811b,_0x287d88,_0x52e142){var _0x5948e0={'raw':!![],'where':{}},_0x34b3d7={},_0x366444;return db[_0x0fd5('0x54')][_0x0fd5('0x66')]({'where':{'id':_0x5d811b[_0x0fd5('0x59')]['id']}})[_0x0fd5('0x37')](handleEntityNotFound(_0x287d88,null))[_0x0fd5('0x37')](function(_0x5a6eb8){if(_0x5a6eb8){_0x366444=_0x5a6eb8[_0x0fd5('0x38')]({'plain':!![]});_0x34b3d7[_0x0fd5('0x44')]=_['keys'](db['UserChatQueue'][_0x0fd5('0x41')]);_0x34b3d7[_0x0fd5('0x45')]=_['keys'](_0x5d811b['query']);_0x34b3d7[_0x0fd5('0x46')]=_[_0x0fd5('0x47')](_0x34b3d7[_0x0fd5('0x44')],_0x34b3d7['query']);_0x5948e0[_0x0fd5('0x48')]=_[_0x0fd5('0x47')](_0x34b3d7[_0x0fd5('0x44')],qs[_0x0fd5('0x49')](_0x5d811b[_0x0fd5('0x45')][_0x0fd5('0x49')]));_0x5948e0[_0x0fd5('0x48')]=_0x5948e0[_0x0fd5('0x48')][_0x0fd5('0x4a')]?_0x5948e0[_0x0fd5('0x48')]:_0x34b3d7[_0x0fd5('0x44')];if(!_0x5d811b[_0x0fd5('0x45')][_0x0fd5('0x4b')](_0x0fd5('0x4c'))){_0x5948e0['limit']=qs[_0x0fd5('0x30')](_0x5d811b[_0x0fd5('0x45')][_0x0fd5('0x30')]);_0x5948e0[_0x0fd5('0x2f')]=qs[_0x0fd5('0x2f')](_0x5d811b[_0x0fd5('0x45')][_0x0fd5('0x2f')]);}_0x5948e0[_0x0fd5('0x4d')]=qs[_0x0fd5('0x4e')](_0x5d811b[_0x0fd5('0x45')]['sort']);_0x5948e0[_0x0fd5('0x50')]=qs[_0x0fd5('0x46')](_['pick'](_0x5d811b[_0x0fd5('0x45')],_0x34b3d7[_0x0fd5('0x46')]));_0x5948e0['where']['ChatQueueId']=_0x5a6eb8['id'];if(_0x5d811b[_0x0fd5('0x45')][_0x0fd5('0x4f')]){_0x5948e0['where']=_[_0x0fd5('0x52')](_0x5948e0['where'],{'$or':_[_0x0fd5('0x40')](_0x5948e0[_0x0fd5('0x48')],function(_0x1eee7b){var _0x2d9257={};_0x2d9257[_0x1eee7b]={'$like':'%'+_0x5d811b[_0x0fd5('0x45')][_0x0fd5('0x4f')]+'%'};return _0x2d9257;})});}_0x5948e0=_[_0x0fd5('0x52')]({},_0x5948e0,_0x5d811b[_0x0fd5('0x53')]);return db[_0x0fd5('0x67')][_0x0fd5('0x56')](_0x5948e0);}})[_0x0fd5('0x37')](function(_0xfce14d){if(_0xfce14d){return db['User'][_0x0fd5('0x68')]({'where':{'id':_[_0x0fd5('0x40')](_0xfce14d,_0x0fd5('0x69')),'role':_0x0fd5('0x6a')},'attributes':['id',_0x0fd5('0x3d'),'chatPause',_0x0fd5('0x6b'),_0x0fd5('0x6c')]});}})['then'](function(_0x41895e){if(_0x41895e){return{'count':_0x41895e[_0x0fd5('0x2e')],'rows':_[_0x0fd5('0x40')](_0x41895e['rows'],function(_0x22cbbb){return{'membername':_0x22cbbb['name'],'UserId':_0x22cbbb['id'],'queue_name':_0x366444[_0x0fd5('0x3d')],'ChatQueueId':_0x366444['id'],'interface':util[_0x0fd5('0x6d')](_0x0fd5('0x6e'),_0x0fd5('0x6f'),_0x22cbbb['name']),'penalty':0x0,'paused':_0x22cbbb[_0x0fd5('0x70')],'createdAt':_0x22cbbb[_0x0fd5('0x6c')],'updatedAt':_0x22cbbb['updatedAt']};})};}else{return{'count':0x0,'rows':[]};}})[_0x0fd5('0x37')](respondWithFilteredResult(_0x287d88,_0x5948e0))[_0x0fd5('0x2a')](handleError(_0x287d88,null));};exports[_0x0fd5('0x71')]=function(_0x2dd216,_0xe60150,_0xb31ae2){var _0x38d1fb={};var _0x1fab55={};var _0x3a2e27;var _0xfe44e1;return db['ChatQueue'][_0x0fd5('0x66')]({'where':{'id':_0x2dd216[_0x0fd5('0x59')]['id']}})['then'](handleEntityNotFound(_0xe60150,null))[_0x0fd5('0x37')](function(_0x5e0bc6){if(_0x5e0bc6){_0x3a2e27=_0x5e0bc6;_0x1fab55['model']=_[_0x0fd5('0x5a')](db[_0x0fd5('0x72')][_0x0fd5('0x41')]);_0x1fab55['query']=_[_0x0fd5('0x5a')](_0x2dd216['query']);_0x1fab55[_0x0fd5('0x46')]=_['intersection'](_0x1fab55[_0x0fd5('0x44')],_0x1fab55[_0x0fd5('0x45')]);_0x38d1fb[_0x0fd5('0x48')]=_['intersection'](_0x1fab55[_0x0fd5('0x44')],qs['fields'](_0x2dd216[_0x0fd5('0x45')][_0x0fd5('0x49')]));_0x38d1fb[_0x0fd5('0x48')]=_0x38d1fb[_0x0fd5('0x48')][_0x0fd5('0x4a')]?_0x38d1fb[_0x0fd5('0x48')]:_0x1fab55['model'];_0x38d1fb['order']=qs[_0x0fd5('0x4e')](_0x2dd216[_0x0fd5('0x45')][_0x0fd5('0x4e')]);_0x38d1fb[_0x0fd5('0x50')]=qs[_0x0fd5('0x46')](_['pick'](_0x2dd216[_0x0fd5('0x45')],_0x1fab55[_0x0fd5('0x46')]));if(_0x2dd216[_0x0fd5('0x45')]['filter']){_0x38d1fb[_0x0fd5('0x50')]=_['merge'](_0x38d1fb[_0x0fd5('0x50')],{'$or':_[_0x0fd5('0x40')](_0x38d1fb[_0x0fd5('0x48')],function(_0x1df3a7){var _0x483422={};_0x483422[_0x1df3a7]={'$like':'%'+_0x2dd216[_0x0fd5('0x45')]['filter']+'%'};return _0x483422;})});}_0x38d1fb=_[_0x0fd5('0x52')]({},_0x38d1fb,_0x2dd216['options']);return _0x3a2e27[_0x0fd5('0x71')](_0x38d1fb);}})['then'](function(_0x5967d1){if(_0x5967d1){_0xfe44e1=_0x5967d1[_0x0fd5('0x4a')];if(!_0x2dd216['query'][_0x0fd5('0x4b')]('nolimit')){_0x38d1fb[_0x0fd5('0x30')]=qs[_0x0fd5('0x30')](_0x2dd216[_0x0fd5('0x45')][_0x0fd5('0x30')]);_0x38d1fb[_0x0fd5('0x2f')]=qs['offset'](_0x2dd216['query'][_0x0fd5('0x2f')]);}return _0x3a2e27[_0x0fd5('0x71')](_0x38d1fb);}})['then'](function(_0x1fa0a9){if(_0x1fa0a9){return _0x1fa0a9?{'count':_0xfe44e1,'rows':_0x1fa0a9}:null;}})[_0x0fd5('0x37')](respondWithResult(_0xe60150,null))[_0x0fd5('0x2a')](handleError(_0xe60150,null));};exports[_0x0fd5('0x73')]=function(_0x2b08a1,_0x5e5969,_0x4253d7){var _0xa5a8c4=_0x2b08a1['body'][_0x0fd5('0x74')];return db['Team']['findAll']({'where':{'id':_0xa5a8c4},'attributes':['id'],'include':[{'model':db['User'],'as':_0x0fd5('0x75'),'attributes':['id','name','online',_0x0fd5('0x76'),_0x0fd5('0x77')],'raw':!![]}]})[_0x0fd5('0x37')](function(_0x2ad89c){if(_0x2ad89c){var _0xe23b80=_[_0x0fd5('0x78')](_0x2ad89c,function(_0x465e51){var _0x53361c=_0x465e51[_0x0fd5('0x38')]({'plain':!![]});return _0x53361c['Agents'];});return db['ChatQueue'][_0x0fd5('0x60')]({'where':{'id':_0x2b08a1[_0x0fd5('0x59')]['id']}})[_0x0fd5('0x37')](function(_0x2be2ff){return db[_0x0fd5('0x79')]['transaction'](function(_0x880347){return _0x2be2ff[_0x0fd5('0x73')](_0xa5a8c4,{'transaction':_0x880347})['then'](function(){return BPromise[_0x0fd5('0x7a')](_0xe23b80,function(_0x11b5a3){return db[_0x0fd5('0x67')][_0x0fd5('0x7b')]({'where':{'UserId':_0x11b5a3['id'],'ChatQueueId':_0x2b08a1['params']['id']},'transaction':_0x880347});});})['then'](function(){_0xe23b80[_0x0fd5('0x7c')](function(_0x51296e){socket[_0x0fd5('0x7d')]('userChatQueue:save',{'UserId':_0x51296e['id'],'ChatQueueId':_0x2be2ff['id']});});});});});}})[_0x0fd5('0x37')](respondWithStatusCode(_0x5e5969,null))[_0x0fd5('0x2a')](handleError(_0x5e5969,null));};exports[_0x0fd5('0x7e')]=function(_0x1c4171,_0x183035,_0x38c228){return db[_0x0fd5('0x72')][_0x0fd5('0x56')]({'where':{'id':_0x1c4171['query'][_0x0fd5('0x74')]},'attributes':['id'],'include':[{'model':db[_0x0fd5('0x7f')],'as':'Agents','attributes':['id'],'raw':!![]}]})[_0x0fd5('0x37')](handleEntityNotFound(_0x183035,null))[_0x0fd5('0x37')](function(_0x2f0ae5){var _0x6a9bd=_[_0x0fd5('0x40')](_0x2f0ae5,'id');var _0x30eead=[];var _0x130fde=[];var _0x4c50c1=squel[_0x0fd5('0x80')]();_0x4c50c1[_0x0fd5('0x81')](_0x0fd5('0x82'))['from'](_0x0fd5('0x83'),'tq')[_0x0fd5('0x84')](_0x0fd5('0x85'),'ut',_0x0fd5('0x86'))[_0x0fd5('0x50')](_0x0fd5('0x87'),_0x1c4171['params']['id']);for(var _0x4b38e1=0x0;_0x4b38e1<_0x2f0ae5[_0x0fd5('0x4a')];_0x4b38e1+=0x1){let _0x12e474=_0x2f0ae5[_0x4b38e1];for(var _0x38883d=0x0;_0x38883d<_0x12e474[_0x0fd5('0x75')][_0x0fd5('0x4a')];_0x38883d+=0x1){let _0x119469=_0x12e474[_0x0fd5('0x75')][_0x38883d];var _0x194a04=_0x4c50c1[_0x0fd5('0x88')]();_0x194a04[_0x0fd5('0x50')](_0x0fd5('0x89'),_0x119469['id']);_0x130fde[_0x0fd5('0x8a')](db[_0x0fd5('0x79')][_0x0fd5('0x45')](_0x194a04[_0x0fd5('0x8b')](),{'type':db[_0x0fd5('0x79')][_0x0fd5('0x8c')][_0x0fd5('0x8d')]})[_0x0fd5('0x37')](function(_0x12098f){if(_0x12098f[_0x0fd5('0x4a')]===0x1){return _0x119469['id'];}else{var _0x3888cf=_[_0x0fd5('0x8e')](_[_0x0fd5('0x40')](_0x12098f,_0x0fd5('0x8f')),function(_0x517fea){return _[_0x0fd5('0x90')](_0x6a9bd,_0x517fea);});if(_0x3888cf){return _0x119469['id'];}}}));}}return BPromise[_0x0fd5('0x91')](_0x130fde)[_0x0fd5('0x37')](function(_0x553abd){_0x30eead=_(_0x30eead)['union'](_0x553abd)[_0x0fd5('0x92')]()['value']();return db[_0x0fd5('0x54')][_0x0fd5('0x60')]({'where':{'id':_0x1c4171[_0x0fd5('0x59')]['id']}})[_0x0fd5('0x37')](function(_0x21a924){return db['sequelize'][_0x0fd5('0x93')](function(_0x379f2c){return _0x21a924[_0x0fd5('0x7e')](_0x1c4171[_0x0fd5('0x45')]['ids'],{'transaction':_0x379f2c})[_0x0fd5('0x37')](function(){if(!_[_0x0fd5('0x94')](_0x30eead)){return _0x21a924[_0x0fd5('0x95')](_0x30eead,{'transaction':_0x379f2c});}})[_0x0fd5('0x37')](function(){_0x30eead[_0x0fd5('0x7c')](function(_0x4c2c0c){socket[_0x0fd5('0x7d')]('userChatQueue:remove',{'UserId':_0x4c2c0c,'ChatQueueId':_0x21a924['id']});});});});});});})['then'](respondWithStatusCode(_0x183035,null))[_0x0fd5('0x2a')](handleError(_0x183035,null));};exports[_0x0fd5('0x96')]=function(_0x1165b3,_0xd32204,_0x12744a){return db[_0x0fd5('0x54')][_0x0fd5('0x60')]({'where':{'id':_0x1165b3[_0x0fd5('0x59')]['id']}})[_0x0fd5('0x37')](handleEntityNotFound(_0xd32204,null))[_0x0fd5('0x37')](function(_0x4d5414){if(_0x4d5414){return _0x4d5414[_0x0fd5('0x96')](_0x1165b3[_0x0fd5('0x64')]['ids'],_['omit'](_0x1165b3['body'],[_0x0fd5('0x74'),'id'])||{})[_0x0fd5('0x97')](function(_0x4559a4){for(var _0x5e87e4=0x0;_0x5e87e4<_0x1165b3['body'][_0x0fd5('0x74')][_0x0fd5('0x4a')];_0x5e87e4+=0x1){socket[_0x0fd5('0x7d')](_0x0fd5('0x98'),{'UserId':_0x1165b3[_0x0fd5('0x64')][_0x0fd5('0x74')][_0x5e87e4],'ChatQueueId':_0x1165b3[_0x0fd5('0x59')]['id']});}return _0x4559a4;});}})['then'](respondWithResult(_0xd32204,null))['catch'](handleError(_0xd32204,null));};exports[_0x0fd5('0x95')]=function(_0x31218e,_0x490917,_0x1fdbca){return db['ChatQueue'][_0x0fd5('0x60')]({'where':{'id':_0x31218e[_0x0fd5('0x59')]['id']}})[_0x0fd5('0x37')](handleEntityNotFound(_0x490917,null))[_0x0fd5('0x37')](function(_0x41db7d){if(_0x41db7d){return _0x41db7d[_0x0fd5('0x95')](_0x31218e['query'][_0x0fd5('0x74')])[_0x0fd5('0x37')](function(){if(_[_0x0fd5('0x99')](_0x31218e['query'][_0x0fd5('0x74')])){for(var _0x5640a1=0x0;_0x5640a1<_0x31218e[_0x0fd5('0x45')][_0x0fd5('0x74')][_0x0fd5('0x4a')];_0x5640a1+=0x1){socket[_0x0fd5('0x7d')](_0x0fd5('0x9a'),{'UserId':Number(_0x31218e[_0x0fd5('0x45')][_0x0fd5('0x74')][_0x5640a1]),'ChatQueueId':Number(_0x31218e['params']['id'])});}}else{socket['emit'](_0x0fd5('0x9a'),{'UserId':Number(_0x31218e[_0x0fd5('0x45')][_0x0fd5('0x74')]),'ChatQueueId':Number(_0x31218e[_0x0fd5('0x59')]['id'])});}});}})['then'](respondWithStatusCode(_0x490917,null))['catch'](handleError(_0x490917,null));};exports[_0x0fd5('0x9b')]=function(_0x3a7af8,_0xea8c46,_0x4e83a3){var _0x244d43={};var _0x111c22={};var _0x499e25;var _0x57e748;return db['ChatQueue'][_0x0fd5('0x66')]({'where':{'id':_0x3a7af8[_0x0fd5('0x59')]['id']}})[_0x0fd5('0x37')](handleEntityNotFound(_0xea8c46,null))[_0x0fd5('0x37')](function(_0x5f3964){if(_0x5f3964){_0x499e25=_0x5f3964;_0x111c22['model']=_[_0x0fd5('0x5a')](db[_0x0fd5('0x7f')][_0x0fd5('0x41')]);_0x111c22[_0x0fd5('0x45')]=_[_0x0fd5('0x5a')](_0x3a7af8['query']);_0x111c22[_0x0fd5('0x46')]=_[_0x0fd5('0x47')](_0x111c22[_0x0fd5('0x44')],_0x111c22['query']);_0x244d43[_0x0fd5('0x48')]=_[_0x0fd5('0x47')](_0x111c22[_0x0fd5('0x44')],qs[_0x0fd5('0x49')](_0x3a7af8[_0x0fd5('0x45')][_0x0fd5('0x49')]));_0x244d43[_0x0fd5('0x48')]=_0x244d43['attributes'][_0x0fd5('0x4a')]?_0x244d43['attributes']:_0x111c22['model'];_0x244d43[_0x0fd5('0x4d')]=qs[_0x0fd5('0x4e')](_0x3a7af8[_0x0fd5('0x45')][_0x0fd5('0x4e')]);_0x244d43[_0x0fd5('0x50')]=qs[_0x0fd5('0x46')](_['pick'](_0x3a7af8[_0x0fd5('0x45')],_0x111c22[_0x0fd5('0x46')]));if(_0x3a7af8[_0x0fd5('0x45')][_0x0fd5('0x4f')]){_0x244d43[_0x0fd5('0x50')]=_[_0x0fd5('0x52')](_0x244d43[_0x0fd5('0x50')],{'$or':_[_0x0fd5('0x40')](_0x244d43['attributes'],function(_0xe70ef8){var _0xce17c6={};_0xce17c6[_0xe70ef8]={'$like':'%'+_0x3a7af8[_0x0fd5('0x45')][_0x0fd5('0x4f')]+'%'};return _0xce17c6;})});}_0x244d43=_[_0x0fd5('0x52')]({},_0x244d43,_0x3a7af8[_0x0fd5('0x53')]);return _0x499e25[_0x0fd5('0x9b')](_0x244d43);}})[_0x0fd5('0x37')](function(_0x42f63c){if(_0x42f63c){_0x57e748=_0x42f63c[_0x0fd5('0x4a')];if(!_0x3a7af8[_0x0fd5('0x45')]['hasOwnProperty'](_0x0fd5('0x4c'))){_0x244d43[_0x0fd5('0x30')]=qs[_0x0fd5('0x30')](_0x3a7af8[_0x0fd5('0x45')][_0x0fd5('0x30')]);_0x244d43[_0x0fd5('0x2f')]=qs[_0x0fd5('0x2f')](_0x3a7af8[_0x0fd5('0x45')][_0x0fd5('0x2f')]);}return _0x499e25['getAgents'](_0x244d43);}})[_0x0fd5('0x37')](function(_0x429cf9){if(_0x429cf9){return _0x429cf9?{'count':_0x57e748,'rows':_0x429cf9}:null;}})[_0x0fd5('0x37')](respondWithResult(_0xea8c46,null))[_0x0fd5('0x2a')](handleError(_0xea8c46,null));};
\ No newline at end of file
diff --git a/server/api/chatQueue/chatQueue.events.js b/server/api/chatQueue/chatQueue.events.js
index 08c1e87..4acf33f 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 _0xb10b=['hasOwnProperty','hook','events','ChatQueue','setMaxListeners','save','remove','emit'];(function(_0x30b251,_0x230b05){var _0x1cbbbd=function(_0x3aa152){while(--_0x3aa152){_0x30b251['push'](_0x30b251['shift']());}};_0x1cbbbd(++_0x230b05);}(_0xb10b,0x12a));var _0xbb10=function(_0x305779,_0x57891f){_0x305779=_0x305779-0x0;var _0x41c696=_0xb10b[_0x305779];return _0x41c696;};'use strict';var EventEmitter=require(_0xbb10('0x0'));var ChatQueue=require('../../mysqldb')['db'][_0xbb10('0x1')];var ChatQueueEvents=new EventEmitter();ChatQueueEvents[_0xbb10('0x2')](0x0);var events={'afterCreate':_0xbb10('0x3'),'afterUpdate':'update','afterDestroy':_0xbb10('0x4')};function emitEvent(_0x9bbed){return function(_0x460981,_0x22320e,_0x49baf4){ChatQueueEvents[_0xbb10('0x5')](_0x9bbed+':'+_0x460981['id'],_0x460981);ChatQueueEvents['emit'](_0x9bbed,_0x460981);_0x49baf4(null);};}for(var e in events){if(events[_0xbb10('0x6')](e)){var event=events[e];ChatQueue[_0xbb10('0x7')](e,emitEvent(event));}}module['exports']=ChatQueueEvents;
\ No newline at end of file
+var _0xb10b=['hasOwnProperty','hook','events','ChatQueue','setMaxListeners','save','remove','emit'];(function(_0x113f34,_0x2725cc){var _0x306811=function(_0x24be92){while(--_0x24be92){_0x113f34['push'](_0x113f34['shift']());}};_0x306811(++_0x2725cc);}(_0xb10b,0x12a));var _0xbb10=function(_0x5bda3b,_0x41160f){_0x5bda3b=_0x5bda3b-0x0;var _0x431bb9=_0xb10b[_0x5bda3b];return _0x431bb9;};'use strict';var EventEmitter=require(_0xbb10('0x0'));var ChatQueue=require('../../mysqldb')['db'][_0xbb10('0x1')];var ChatQueueEvents=new EventEmitter();ChatQueueEvents[_0xbb10('0x2')](0x0);var events={'afterCreate':_0xbb10('0x3'),'afterUpdate':'update','afterDestroy':_0xbb10('0x4')};function emitEvent(_0x9bbed){return function(_0x460981,_0x22320e,_0x49baf4){ChatQueueEvents[_0xbb10('0x5')](_0x9bbed+':'+_0x460981['id'],_0x460981);ChatQueueEvents['emit'](_0x9bbed,_0x460981);_0x49baf4(null);};}for(var e in events){if(events[_0xbb10('0x6')](e)){var event=events[e];ChatQueue[_0xbb10('0x7')](e,emitEvent(event));}}module['exports']=ChatQueueEvents;
\ No newline at end of file
diff --git a/server/api/chatQueue/chatQueue.model.js b/server/api/chatQueue/chatQueue.model.js
index 7d9e684..621d13a 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 _0xaea1=['./chatQueue.attributes','exports','ChatQueue','chat_queues','util','../../config/logger','api','moment','request-promise','path','rimraf','../../config/environment'];(function(_0x106c98,_0x2f6fb6){var _0x1e7302=function(_0x5b0749){while(--_0x5b0749){_0x106c98['push'](_0x106c98['shift']());}};_0x1e7302(++_0x2f6fb6);}(_0xaea1,0x1e4));var _0x1aea=function(_0x432682,_0x253044){_0x432682=_0x432682-0x0;var _0x463d05=_0xaea1[_0x432682];return _0x463d05;};'use strict';var _=require('lodash');var util=require(_0x1aea('0x0'));var logger=require(_0x1aea('0x1'))(_0x1aea('0x2'));var moment=require(_0x1aea('0x3'));var BPromise=require('bluebird');var rp=require(_0x1aea('0x4'));var fs=require('fs');var path=require(_0x1aea('0x5'));var rimraf=require(_0x1aea('0x6'));var config=require(_0x1aea('0x7'));var attributes=require(_0x1aea('0x8'));module[_0x1aea('0x9')]=function(_0x53dbcc,_0x444acc){return _0x53dbcc['define'](_0x1aea('0xa'),attributes,{'tableName':_0x1aea('0xb'),'paranoid':![],'indexes':[],'timestamps':!![]});};
\ No newline at end of file
+var _0xee4e=['path','../../config/environment','./chatQueue.attributes','define','ChatQueue','util','api','moment','bluebird','request-promise'];(function(_0x1477f0,_0x55b555){var _0x5ddb2d=function(_0x1d9bd9){while(--_0x1d9bd9){_0x1477f0['push'](_0x1477f0['shift']());}};_0x5ddb2d(++_0x55b555);}(_0xee4e,0x131));var _0xeee4=function(_0x432682,_0x253044){_0x432682=_0x432682-0x0;var _0x463d05=_0xee4e[_0x432682];return _0x463d05;};'use strict';var _=require('lodash');var util=require(_0xeee4('0x0'));var logger=require('../../config/logger')(_0xeee4('0x1'));var moment=require(_0xeee4('0x2'));var BPromise=require(_0xeee4('0x3'));var rp=require(_0xeee4('0x4'));var fs=require('fs');var path=require(_0xeee4('0x5'));var rimraf=require('rimraf');var config=require(_0xeee4('0x6'));var attributes=require(_0xeee4('0x7'));module['exports']=function(_0x13c291,_0x33ea0b){return _0x13c291[_0xeee4('0x8')](_0xeee4('0x9'),attributes,{'tableName':'chat_queues','paranoid':![],'indexes':[],'timestamps':!![]});};
\ No newline at end of file
diff --git a/server/api/chatQueue/chatQueue.rpc.js b/server/api/chatQueue/chatQueue.rpc.js
index 9adfea7..e8d2579 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 _0x980c=['options','raw','where','limit','include','model','attributes','map','ShowChatQueue','find','lodash','util','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','client','http','redis','defaults','localhost','socket.io-emitter','then','info','request\x20sent','debug','ChatQueue,\x20%s,\x20%s,\x20%s','stringify','error','code','ChatQueue,\x20%s,\x20%s','message','result','catch','GetChatQueue','ChatQueue'];(function(_0x4a3974,_0x2eadb3){var _0x1677d4=function(_0x937972){while(--_0x937972){_0x4a3974['push'](_0x4a3974['shift']());}};_0x1677d4(++_0x2eadb3);}(_0x980c,0x100));var _0xc980=function(_0x2157c0,_0x4bb8aa){_0x2157c0=_0x2157c0-0x0;var _0x48c079=_0x980c[_0x2157c0];return _0x48c079;};'use strict';var _=require(_0xc980('0x0'));var util=require(_0xc980('0x1'));var moment=require(_0xc980('0x2'));var BPromise=require(_0xc980('0x3'));var rs=require(_0xc980('0x4'));var fs=require('fs');var Redis=require(_0xc980('0x5'));var db=require(_0xc980('0x6'))['db'];var utils=require(_0xc980('0x7'));var logger=require(_0xc980('0x8'))(_0xc980('0x9'));var config=require(_0xc980('0xa'));var jayson=require('jayson/promise');var client=jayson[_0xc980('0xb')][_0xc980('0xc')]({'port':0x232a});config[_0xc980('0xd')]=_[_0xc980('0xe')](config[_0xc980('0xd')],{'host':_0xc980('0xf'),'port':0x18eb});var socket=require(_0xc980('0x10'))(new Redis(config['redis']));require('./chatQueue.socket')['register'](socket);function respondWithRpcPromise(_0x7c55a2,_0x49b5fb,_0x121671){return new BPromise(function(_0x199251,_0x1099ef){return client['request'](_0x7c55a2,_0x121671)[_0xc980('0x11')](function(_0x1b14ee){logger[_0xc980('0x12')]('ChatQueue,\x20%s,\x20%s',_0x49b5fb,_0xc980('0x13'));logger[_0xc980('0x14')](_0xc980('0x15'),_0x49b5fb,_0xc980('0x13'),JSON[_0xc980('0x16')](_0x1b14ee));if(_0x1b14ee[_0xc980('0x17')]){if(_0x1b14ee[_0xc980('0x17')][_0xc980('0x18')]===0x1f4){logger[_0xc980('0x17')](_0xc980('0x19'),_0x49b5fb,_0x1b14ee[_0xc980('0x17')][_0xc980('0x1a')]);return _0x1099ef(_0x1b14ee[_0xc980('0x17')]['message']);}logger['error'](_0xc980('0x19'),_0x49b5fb,_0x1b14ee['error']['message']);return _0x199251(_0x1b14ee[_0xc980('0x17')][_0xc980('0x1a')]);}else{logger[_0xc980('0x12')](_0xc980('0x19'),_0x49b5fb,_0xc980('0x13'));_0x199251(_0x1b14ee[_0xc980('0x1b')]['message']);}})[_0xc980('0x1c')](function(_0x4342e3){logger[_0xc980('0x17')]('ChatQueue,\x20%s,\x20%s',_0x49b5fb,_0x4342e3);_0x1099ef(_0x4342e3);});});}exports[_0xc980('0x1d')]=function(_0x365050){var _0x28eb61=this;return new Promise(function(_0x1b26a1,_0x3249db){return db[_0xc980('0x1e')]['findAll']({'raw':_0x365050[_0xc980('0x1f')]?_0x365050[_0xc980('0x1f')][_0xc980('0x20')]===undefined?!![]:![]:!![],'where':_0x365050[_0xc980('0x1f')]?_0x365050[_0xc980('0x1f')][_0xc980('0x21')]||null:null,'attributes':_0x365050[_0xc980('0x1f')]?_0x365050['options']['attributes']||null:null,'limit':_0x365050[_0xc980('0x1f')]?_0x365050[_0xc980('0x1f')][_0xc980('0x22')]||null:null,'include':_0x365050[_0xc980('0x1f')]?_0x365050[_0xc980('0x1f')][_0xc980('0x23')]?_['map'](_0x365050[_0xc980('0x1f')][_0xc980('0x23')],function(_0x8fcc7e){return{'model':db[_0x8fcc7e[_0xc980('0x24')]],'as':_0x8fcc7e['as'],'attributes':_0x8fcc7e[_0xc980('0x25')],'include':_0x8fcc7e[_0xc980('0x23')]?_[_0xc980('0x26')](_0x8fcc7e[_0xc980('0x23')],function(_0x141129){return{'model':db[_0x141129[_0xc980('0x24')]],'as':_0x141129['as'],'attributes':_0x141129[_0xc980('0x25')],'include':_0x141129[_0xc980('0x23')]?_[_0xc980('0x26')](_0x141129['include'],function(_0x4e08f2){return{'model':db[_0x4e08f2[_0xc980('0x24')]],'as':_0x4e08f2['as'],'attributes':_0x4e08f2[_0xc980('0x25')]};}):[]};}):[]};}):[]:[]})['then'](function(_0x4ee9fa){logger['info'](_0xc980('0x1d'),_0x365050);logger[_0xc980('0x14')]('GetChatQueue',_0x365050,JSON[_0xc980('0x16')](_0x4ee9fa));_0x1b26a1(_0x4ee9fa);})['catch'](function(_0x24a485){logger['error'](_0xc980('0x1d'),_0x24a485[_0xc980('0x1a')],_0x365050);_0x3249db(_0x28eb61[_0xc980('0x17')](0x1f4,_0x24a485[_0xc980('0x1a')]));});});};exports[_0xc980('0x27')]=function(_0x1a9d5e){var _0x547ad6=this;return new Promise(function(_0x59b1c0,_0x28983f){return db[_0xc980('0x1e')][_0xc980('0x28')]({'raw':_0x1a9d5e[_0xc980('0x1f')]?_0x1a9d5e[_0xc980('0x1f')][_0xc980('0x20')]===undefined?!![]:![]:!![],'where':_0x1a9d5e[_0xc980('0x1f')]?_0x1a9d5e[_0xc980('0x1f')]['where']||null:null,'attributes':_0x1a9d5e[_0xc980('0x1f')]?_0x1a9d5e['options']['attributes']||null:null,'include':_0x1a9d5e[_0xc980('0x1f')]?_0x1a9d5e[_0xc980('0x1f')][_0xc980('0x23')]?_[_0xc980('0x26')](_0x1a9d5e[_0xc980('0x1f')][_0xc980('0x23')],function(_0x4a4d80){return{'model':db[_0x4a4d80[_0xc980('0x24')]],'as':_0x4a4d80['as'],'attributes':_0x4a4d80['attributes'],'include':_0x4a4d80[_0xc980('0x23')]?_[_0xc980('0x26')](_0x4a4d80[_0xc980('0x23')],function(_0x420faf){return{'model':db[_0x420faf['model']],'as':_0x420faf['as'],'attributes':_0x420faf[_0xc980('0x25')],'include':_0x420faf[_0xc980('0x23')]?_[_0xc980('0x26')](_0x420faf[_0xc980('0x23')],function(_0x1c94d6){return{'model':db[_0x1c94d6[_0xc980('0x24')]],'as':_0x1c94d6['as'],'attributes':_0x1c94d6[_0xc980('0x25')]};}):[]};}):[]};}):[]:[]})[_0xc980('0x11')](function(_0x14ac42){logger[_0xc980('0x12')](_0xc980('0x27'),_0x1a9d5e);logger[_0xc980('0x14')]('ShowChatQueue',_0x1a9d5e,JSON['stringify'](_0x14ac42));_0x59b1c0(_0x14ac42);})['catch'](function(_0x4b7dd8){logger[_0xc980('0x17')](_0xc980('0x27'),_0x4b7dd8[_0xc980('0x1a')],_0x1a9d5e);_0x28983f(_0x547ad6[_0xc980('0x17')](0x1f4,_0x4b7dd8['message']));});});};
\ No newline at end of file
+var _0x3cae=['./chatQueue.socket','register','request','then','info','ChatQueue,\x20%s,\x20%s','ChatQueue,\x20%s,\x20%s,\x20%s','stringify','error','code','message','request\x20sent','catch','ChatQueue','findAll','options','attributes','limit','include','map','model','GetChatQueue','ShowChatQueue','find','raw','where','debug','lodash','util','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/logger','rpc','jayson/promise','http','redis','defaults','localhost','socket.io-emitter'];(function(_0xa3463d,_0x32f8da){var _0x50fd67=function(_0xb984fd){while(--_0xb984fd){_0xa3463d['push'](_0xa3463d['shift']());}};_0x50fd67(++_0x32f8da);}(_0x3cae,0x117));var _0xe3ca=function(_0x1da04e,_0x31024b){_0x1da04e=_0x1da04e-0x0;var _0xdd8c41=_0x3cae[_0x1da04e];return _0xdd8c41;};'use strict';var _=require(_0xe3ca('0x0'));var util=require(_0xe3ca('0x1'));var moment=require(_0xe3ca('0x2'));var BPromise=require(_0xe3ca('0x3'));var rs=require(_0xe3ca('0x4'));var fs=require('fs');var Redis=require(_0xe3ca('0x5'));var db=require(_0xe3ca('0x6'))['db'];var utils=require('../../config/utils');var logger=require(_0xe3ca('0x7'))(_0xe3ca('0x8'));var config=require('../../config/environment');var jayson=require(_0xe3ca('0x9'));var client=jayson['client'][_0xe3ca('0xa')]({'port':0x232a});config[_0xe3ca('0xb')]=_[_0xe3ca('0xc')](config['redis'],{'host':_0xe3ca('0xd'),'port':0x18eb});var socket=require(_0xe3ca('0xe'))(new Redis(config[_0xe3ca('0xb')]));require(_0xe3ca('0xf'))[_0xe3ca('0x10')](socket);function respondWithRpcPromise(_0x1785c5,_0x423bba,_0x57a3d5){return new BPromise(function(_0xca87b3,_0x59394d){return client[_0xe3ca('0x11')](_0x1785c5,_0x57a3d5)[_0xe3ca('0x12')](function(_0x219866){logger[_0xe3ca('0x13')](_0xe3ca('0x14'),_0x423bba,'request\x20sent');logger['debug'](_0xe3ca('0x15'),_0x423bba,'request\x20sent',JSON[_0xe3ca('0x16')](_0x219866));if(_0x219866[_0xe3ca('0x17')]){if(_0x219866['error'][_0xe3ca('0x18')]===0x1f4){logger[_0xe3ca('0x17')](_0xe3ca('0x14'),_0x423bba,_0x219866[_0xe3ca('0x17')][_0xe3ca('0x19')]);return _0x59394d(_0x219866[_0xe3ca('0x17')][_0xe3ca('0x19')]);}logger[_0xe3ca('0x17')]('ChatQueue,\x20%s,\x20%s',_0x423bba,_0x219866['error'][_0xe3ca('0x19')]);return _0xca87b3(_0x219866[_0xe3ca('0x17')][_0xe3ca('0x19')]);}else{logger[_0xe3ca('0x13')](_0xe3ca('0x14'),_0x423bba,_0xe3ca('0x1a'));_0xca87b3(_0x219866['result'][_0xe3ca('0x19')]);}})[_0xe3ca('0x1b')](function(_0x180699){logger['error']('ChatQueue,\x20%s,\x20%s',_0x423bba,_0x180699);_0x59394d(_0x180699);});});}exports['GetChatQueue']=function(_0x21c516){var _0x593fd1=this;return new Promise(function(_0x508317,_0x3b7591){return db[_0xe3ca('0x1c')][_0xe3ca('0x1d')]({'raw':_0x21c516[_0xe3ca('0x1e')]?_0x21c516[_0xe3ca('0x1e')]['raw']===undefined?!![]:![]:!![],'where':_0x21c516[_0xe3ca('0x1e')]?_0x21c516[_0xe3ca('0x1e')]['where']||null:null,'attributes':_0x21c516[_0xe3ca('0x1e')]?_0x21c516[_0xe3ca('0x1e')][_0xe3ca('0x1f')]||null:null,'limit':_0x21c516[_0xe3ca('0x1e')]?_0x21c516[_0xe3ca('0x1e')][_0xe3ca('0x20')]||null:null,'include':_0x21c516[_0xe3ca('0x1e')]?_0x21c516[_0xe3ca('0x1e')][_0xe3ca('0x21')]?_[_0xe3ca('0x22')](_0x21c516[_0xe3ca('0x1e')]['include'],function(_0x16e1d6){return{'model':db[_0x16e1d6['model']],'as':_0x16e1d6['as'],'attributes':_0x16e1d6[_0xe3ca('0x1f')],'include':_0x16e1d6[_0xe3ca('0x21')]?_[_0xe3ca('0x22')](_0x16e1d6[_0xe3ca('0x21')],function(_0x576491){return{'model':db[_0x576491['model']],'as':_0x576491['as'],'attributes':_0x576491[_0xe3ca('0x1f')],'include':_0x576491[_0xe3ca('0x21')]?_[_0xe3ca('0x22')](_0x576491['include'],function(_0x1dbd98){return{'model':db[_0x1dbd98[_0xe3ca('0x23')]],'as':_0x1dbd98['as'],'attributes':_0x1dbd98[_0xe3ca('0x1f')]};}):[]};}):[]};}):[]:[]})[_0xe3ca('0x12')](function(_0x532662){logger['info'](_0xe3ca('0x24'),_0x21c516);logger['debug'](_0xe3ca('0x24'),_0x21c516,JSON['stringify'](_0x532662));_0x508317(_0x532662);})['catch'](function(_0xd5e714){logger[_0xe3ca('0x17')](_0xe3ca('0x24'),_0xd5e714[_0xe3ca('0x19')],_0x21c516);_0x3b7591(_0x593fd1[_0xe3ca('0x17')](0x1f4,_0xd5e714['message']));});});};exports[_0xe3ca('0x25')]=function(_0x50f226){var _0x5b2e69=this;return new Promise(function(_0x5bf12f,_0x1acc28){return db[_0xe3ca('0x1c')][_0xe3ca('0x26')]({'raw':_0x50f226[_0xe3ca('0x1e')]?_0x50f226[_0xe3ca('0x1e')][_0xe3ca('0x27')]===undefined?!![]:![]:!![],'where':_0x50f226[_0xe3ca('0x1e')]?_0x50f226[_0xe3ca('0x1e')][_0xe3ca('0x28')]||null:null,'attributes':_0x50f226[_0xe3ca('0x1e')]?_0x50f226[_0xe3ca('0x1e')]['attributes']||null:null,'include':_0x50f226[_0xe3ca('0x1e')]?_0x50f226[_0xe3ca('0x1e')][_0xe3ca('0x21')]?_[_0xe3ca('0x22')](_0x50f226[_0xe3ca('0x1e')][_0xe3ca('0x21')],function(_0x59413d){return{'model':db[_0x59413d[_0xe3ca('0x23')]],'as':_0x59413d['as'],'attributes':_0x59413d[_0xe3ca('0x1f')],'include':_0x59413d[_0xe3ca('0x21')]?_[_0xe3ca('0x22')](_0x59413d[_0xe3ca('0x21')],function(_0x396a0a){return{'model':db[_0x396a0a[_0xe3ca('0x23')]],'as':_0x396a0a['as'],'attributes':_0x396a0a[_0xe3ca('0x1f')],'include':_0x396a0a[_0xe3ca('0x21')]?_['map'](_0x396a0a[_0xe3ca('0x21')],function(_0x1effdb){return{'model':db[_0x1effdb['model']],'as':_0x1effdb['as'],'attributes':_0x1effdb[_0xe3ca('0x1f')]};}):[]};}):[]};}):[]:[]})[_0xe3ca('0x12')](function(_0x3cf213){logger['info'](_0xe3ca('0x25'),_0x50f226);logger[_0xe3ca('0x29')]('ShowChatQueue',_0x50f226,JSON[_0xe3ca('0x16')](_0x3cf213));_0x5bf12f(_0x3cf213);})['catch'](function(_0x4efb4c){logger[_0xe3ca('0x17')](_0xe3ca('0x25'),_0x4efb4c['message'],_0x50f226);_0x1acc28(_0x5b2e69[_0xe3ca('0x17')](0x1f4,_0x4efb4c[_0xe3ca('0x19')]));});});};
\ No newline at end of file
diff --git a/server/api/chatQueue/chatQueue.socket.js b/server/api/chatQueue/chatQueue.socket.js
index b171258..cbc7765 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(_0x8539ae,_0x24872a){var _0xd453a7=function(_0x882a6f){while(--_0x882a6f){_0x8539ae['push'](_0x8539ae['shift']());}};_0xd453a7(++_0x24872a);}(_0x0b0e,0x187));var _0xe0b0=function(_0x3c0dcc,_0x18c419){_0x3c0dcc=_0x3c0dcc-0x0;var _0x1a224c=_0x0b0e[_0x3c0dcc];return _0x1a224c;};'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 _0xb10b=['emit','removeListener','register','chatQueue:','./chatQueue.events','remove','update'];(function(_0x4b3413,_0x58c416){var _0x3b01ba=function(_0xb25f43){while(--_0xb25f43){_0x4b3413['push'](_0x4b3413['shift']());}};_0x3b01ba(++_0x58c416);}(_0xb10b,0x12a));var _0xbb10=function(_0x241207,_0x39a50c){_0x241207=_0x241207-0x0;var _0x26f4ce=_0xb10b[_0x241207];return _0x26f4ce;};'use strict';var ChatQueueEvents=require(_0xbb10('0x0'));var events=['save',_0xbb10('0x1'),_0xbb10('0x2')];function createListener(_0x1dcb08,_0x4d688c){return function(_0x4541ae){_0x4d688c[_0xbb10('0x3')](_0x1dcb08,_0x4541ae);};}function removeListener(_0x460981,_0x22320e){return function(){ChatQueueEvents[_0xbb10('0x4')](_0x460981,_0x22320e);};}exports[_0xbb10('0x5')]=function(_0x481979){for(var _0x328583=0x0,_0x3cdd53=events['length'];_0x328583<_0x3cdd53;_0x328583++){var _0x1b9e94=events[_0x328583];var _0x3fb675=createListener(_0xbb10('0x6')+_0x1b9e94,_0x481979);ChatQueueEvents['on'](_0x1b9e94,_0x3fb675);}};
\ No newline at end of file
diff --git a/server/api/chatQueue/index.js b/server/api/chatQueue/index.js
index 85f8d50..1f58537 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 _0x570f=['express','../../components/auth/service','../../config/environment','./chatQueue.controller','isAuthenticated','index','get','/describe','describe','/:id','/:id/members','getMembers','/:id/teams','getTeams','/:id/users','getAgents','post','create','addTeams','addAgents','put','update','destroy','delete','removeTeams','removeAgents','multer','util'];(function(_0x5cc51f,_0x22c480){var _0x315a2f=function(_0x4f93bd){while(--_0x4f93bd){_0x5cc51f['push'](_0x5cc51f['shift']());}};_0x315a2f(++_0x22c480);}(_0x570f,0xfa));var _0xf570=function(_0x1ef510,_0x431218){_0x1ef510=_0x1ef510-0x0;var _0x18ed0e=_0x570f[_0x1ef510];return _0x18ed0e;};'use strict';var multer=require(_0xf570('0x0'));var util=require(_0xf570('0x1'));var path=require('path');var timeout=require('connect-timeout');var express=require(_0xf570('0x2'));var router=express['Router']();var auth=require(_0xf570('0x3'));var interaction=require('../../components/interaction/service');var config=require(_0xf570('0x4'));var controller=require(_0xf570('0x5'));router['get']('/',auth[_0xf570('0x6')](),controller[_0xf570('0x7')]);router[_0xf570('0x8')](_0xf570('0x9'),auth['isAuthenticated'](),controller[_0xf570('0xa')]);router['get'](_0xf570('0xb'),auth[_0xf570('0x6')](),controller['show']);router['get'](_0xf570('0xc'),auth[_0xf570('0x6')](),controller[_0xf570('0xd')]);router[_0xf570('0x8')](_0xf570('0xe'),auth[_0xf570('0x6')](),controller[_0xf570('0xf')]);router[_0xf570('0x8')](_0xf570('0x10'),auth[_0xf570('0x6')](),controller[_0xf570('0x11')]);router[_0xf570('0x12')]('/',auth[_0xf570('0x6')](),controller[_0xf570('0x13')]);router[_0xf570('0x12')](_0xf570('0xe'),auth[_0xf570('0x6')](),controller[_0xf570('0x14')]);router['post']('/:id/users',auth[_0xf570('0x6')](),controller[_0xf570('0x15')]);router[_0xf570('0x16')](_0xf570('0xb'),auth[_0xf570('0x6')](),controller[_0xf570('0x17')]);router['delete'](_0xf570('0xb'),auth[_0xf570('0x6')](),controller[_0xf570('0x18')]);router[_0xf570('0x19')](_0xf570('0xe'),auth[_0xf570('0x6')](),controller[_0xf570('0x1a')]);router['delete'](_0xf570('0x10'),auth[_0xf570('0x6')](),controller[_0xf570('0x1b')]);module['exports']=router;
\ No newline at end of file
+var _0x5e52=['../../components/interaction/service','../../config/environment','./chatQueue.controller','get','isAuthenticated','describe','/:id','show','/:id/teams','getTeams','/:id/users','getAgents','post','addAgents','put','update','delete','destroy','removeAgents','exports','multer','util','path','connect-timeout','express','Router'];(function(_0x27833f,_0x3c419e){var _0x5be8a4=function(_0x396974){while(--_0x396974){_0x27833f['push'](_0x27833f['shift']());}};_0x5be8a4(++_0x3c419e);}(_0x5e52,0x7c));var _0x25e5=function(_0x34f99d,_0x17e35f){_0x34f99d=_0x34f99d-0x0;var _0x2d9c27=_0x5e52[_0x34f99d];return _0x2d9c27;};'use strict';var multer=require(_0x25e5('0x0'));var util=require(_0x25e5('0x1'));var path=require(_0x25e5('0x2'));var timeout=require(_0x25e5('0x3'));var express=require(_0x25e5('0x4'));var router=express[_0x25e5('0x5')]();var auth=require('../../components/auth/service');var interaction=require(_0x25e5('0x6'));var config=require(_0x25e5('0x7'));var controller=require(_0x25e5('0x8'));router[_0x25e5('0x9')]('/',auth['isAuthenticated'](),controller['index']);router[_0x25e5('0x9')]('/describe',auth[_0x25e5('0xa')](),controller[_0x25e5('0xb')]);router[_0x25e5('0x9')](_0x25e5('0xc'),auth['isAuthenticated'](),controller[_0x25e5('0xd')]);router[_0x25e5('0x9')]('/:id/members',auth[_0x25e5('0xa')](),controller['getMembers']);router['get'](_0x25e5('0xe'),auth[_0x25e5('0xa')](),controller[_0x25e5('0xf')]);router[_0x25e5('0x9')](_0x25e5('0x10'),auth['isAuthenticated'](),controller[_0x25e5('0x11')]);router[_0x25e5('0x12')]('/',auth[_0x25e5('0xa')](),controller['create']);router[_0x25e5('0x12')]('/:id/teams',auth[_0x25e5('0xa')](),controller['addTeams']);router[_0x25e5('0x12')](_0x25e5('0x10'),auth[_0x25e5('0xa')](),controller[_0x25e5('0x13')]);router[_0x25e5('0x14')](_0x25e5('0xc'),auth[_0x25e5('0xa')](),controller[_0x25e5('0x15')]);router[_0x25e5('0x16')](_0x25e5('0xc'),auth[_0x25e5('0xa')](),controller[_0x25e5('0x17')]);router[_0x25e5('0x16')](_0x25e5('0xe'),auth[_0x25e5('0xa')](),controller['removeTeams']);router['delete'](_0x25e5('0x10'),auth['isAuthenticated'](),controller[_0x25e5('0x18')]);module[_0x25e5('0x19')]=router;
\ No newline at end of file
diff --git a/server/api/chatQueueReport/chatQueueReport.attributes.js b/server/api/chatQueueReport/chatQueueReport.attributes.js
index 03439e9..886410a 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 _0x372d=['DATE','moment','sequelize','STRING'];(function(_0x49a3e4,_0x34776f){var _0x16b974=function(_0x6f5db3){while(--_0x6f5db3){_0x49a3e4['push'](_0x49a3e4['shift']());}};_0x16b974(++_0x34776f);}(_0x372d,0x149));var _0xd372=function(_0x4358fd,_0x16f7e4){_0x4358fd=_0x4358fd-0x0;var _0x348061=_0x372d[_0x4358fd];return _0x348061;};'use strict';var moment=require(_0xd372('0x0'));var Sequelize=require(_0xd372('0x1'));module['exports']={'uniqueid':{'type':Sequelize[_0xd372('0x2')],'allowNull':![]},'from':{'type':Sequelize[_0xd372('0x2')]},'joinAt':{'type':Sequelize[_0xd372('0x3')]},'leaveAt':{'type':Sequelize[_0xd372('0x3')]},'acceptAt':{'type':Sequelize[_0xd372('0x3')]},'exitAt':{'type':Sequelize['DATE']},'reason':{'type':Sequelize[_0xd372('0x2')]}};
\ No newline at end of file
+var _0x90e7=['STRING','DATE','moment'];(function(_0xb0f7c3,_0x4eae95){var _0x28ea68=function(_0x4395a7){while(--_0x4395a7){_0xb0f7c3['push'](_0xb0f7c3['shift']());}};_0x28ea68(++_0x4eae95);}(_0x90e7,0xbc));var _0x790e=function(_0x35d3e7,_0x50f65e){_0x35d3e7=_0x35d3e7-0x0;var _0x4f2ea3=_0x90e7[_0x35d3e7];return _0x4f2ea3;};'use strict';var moment=require(_0x790e('0x0'));var Sequelize=require('sequelize');module['exports']={'uniqueid':{'type':Sequelize[_0x790e('0x1')],'allowNull':![]},'from':{'type':Sequelize['STRING']},'joinAt':{'type':Sequelize['DATE']},'leaveAt':{'type':Sequelize['DATE']},'acceptAt':{'type':Sequelize[_0x790e('0x2')]},'exitAt':{'type':Sequelize[_0x790e('0x2')]},'reason':{'type':Sequelize[_0x790e('0x1')]}};
\ No newline at end of file
diff --git a/server/api/chatQueueReport/chatQueueReport.controller.js b/server/api/chatQueueReport/chatQueueReport.controller.js
index 1b69eb2..0aa2825 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 _0xde90=['sendStatus','status','end','json','count','offset','limit','set','Content-Range','apply','reject','save','update','destroy','then','error','stack','name','index','map','ChatQueueReport','rawAttributes','fieldName','type','model','query','filters','intersection','fields','attributes','length','hasOwnProperty','order','sort','where','filter','merge','VIRTUAL','options','includeAll','rows','keys','include','find','create','body','catch','params','describe','html-pdf','zip-dir','fast-json-patch','request-promise','moment','bluebird','mustache','util','path','sox','to-csv','lodash','squel','crypto','desk.js','querystring','papaparse','ioredis','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/environment'];(function(_0x2dafbe,_0x5d04de){var _0x58a45a=function(_0x50ac96){while(--_0x50ac96){_0x2dafbe['push'](_0x2dafbe['shift']());}};_0x58a45a(++_0x5d04de);}(_0xde90,0x7b));var _0x0de9=function(_0x453583,_0x5ca1e8){_0x453583=_0x453583-0x0;var _0x3e9101=_0xde90[_0x453583];return _0x3e9101;};'use strict';var pdf=require(_0x0de9('0x0'));var emlformat=require('eml-format');var rimraf=require('rimraf');var zipdir=require(_0x0de9('0x1'));var jsonpatch=require(_0x0de9('0x2'));var rp=require(_0x0de9('0x3'));var moment=require(_0x0de9('0x4'));var BPromise=require(_0x0de9('0x5'));var Mustache=require(_0x0de9('0x6'));var util=require(_0x0de9('0x7'));var path=require(_0x0de9('0x8'));var sox=require(_0x0de9('0x9'));var csv=require(_0x0de9('0xa'));var ejs=require('ejs');var fs=require('fs');var _=require(_0x0de9('0xb'));var squel=require(_0x0de9('0xc'));var crypto=require(_0x0de9('0xd'));var jsforce=require('jsforce');var deskjs=require(_0x0de9('0xe'));var toCsv=require('to-csv');var querystring=require(_0x0de9('0xf'));var Papa=require(_0x0de9('0x10'));var Redis=require(_0x0de9('0x11'));var authService=require('../../components/auth/service');var qs=require(_0x0de9('0x12'));var as=require(_0x0de9('0x13'));var hardwareService=require(_0x0de9('0x14'));var logger=require(_0x0de9('0x15'))(_0x0de9('0x16'));var utils=require(_0x0de9('0x17'));var config=require(_0x0de9('0x18'));var db=require('../../mysqldb')['db'];function respondWithStatusCode(_0x9d2ad4,_0x2418f6){_0x2418f6=_0x2418f6||0xcc;return function(_0x402a87){if(_0x402a87){return _0x9d2ad4[_0x0de9('0x19')](_0x2418f6);}return _0x9d2ad4[_0x0de9('0x1a')](_0x2418f6)[_0x0de9('0x1b')]();};}function respondWithResult(_0x3d90ab,_0x2b1f98){_0x2b1f98=_0x2b1f98||0xc8;return function(_0xa21923){if(_0xa21923){return _0x3d90ab[_0x0de9('0x1a')](_0x2b1f98)[_0x0de9('0x1c')](_0xa21923);}};}function respondWithFilteredResult(_0x4039be,_0xd1c5af){return function(_0x1b22c1){if(_0x1b22c1){var _0x594fa1=_0x1b22c1[_0x0de9('0x1d')],_0x3b6785=_0xd1c5af['offset'],_0x3fb478=_0xd1c5af[_0x0de9('0x1e')]+_0xd1c5af[_0x0de9('0x1f')],_0x3865ec;if(_0x3fb478>=_0x594fa1){_0x3fb478=_0x594fa1;_0x3865ec=0xc8;}else{_0x3865ec=0xce;}_0x4039be[_0x0de9('0x1a')](_0x3865ec);return _0x4039be[_0x0de9('0x20')](_0x0de9('0x21'),_0x3b6785+'-'+_0x3fb478+'/'+_0x594fa1)[_0x0de9('0x1c')](_0x1b22c1);}return null;};}function patchUpdates(_0x38f443){return function(_0x15fbe8){try{jsonpatch[_0x0de9('0x22')](_0x15fbe8,_0x38f443,!![]);}catch(_0x27959f){return BPromise[_0x0de9('0x23')](_0x27959f);}return _0x15fbe8[_0x0de9('0x24')]();};}function saveUpdates(_0x216d9b,_0x2113c6){return function(_0x2eecbb){if(_0x2eecbb){return _0x2eecbb[_0x0de9('0x25')](_0x216d9b)['then'](function(_0x137b6d){return _0x137b6d;});}return null;};}function removeEntity(_0x34627a,_0x31d758){return function(_0x5e3380){if(_0x5e3380){return _0x5e3380[_0x0de9('0x26')]()[_0x0de9('0x27')](function(){_0x34627a['status'](0xcc)[_0x0de9('0x1b')]();});}};}function handleEntityNotFound(_0x37666b,_0x3e55b3){return function(_0x5cc746){if(!_0x5cc746){_0x37666b[_0x0de9('0x19')](0x194);}return _0x5cc746;};}function handleError(_0x51a41f,_0x26b16c){_0x26b16c=_0x26b16c||0x1f4;return function(_0x5eb44c){logger[_0x0de9('0x28')](_0x5eb44c[_0x0de9('0x29')]);if(_0x5eb44c[_0x0de9('0x2a')]){delete _0x5eb44c[_0x0de9('0x2a')];}_0x51a41f[_0x0de9('0x1a')](_0x26b16c)['send'](_0x5eb44c);};}exports[_0x0de9('0x2b')]=function(_0x344224,_0x50b2dd){var _0x3bb09e={},_0x156b67={},_0x260255={'count':0x0,'rows':[]};var _0x40b82d=_[_0x0de9('0x2c')](db[_0x0de9('0x2d')][_0x0de9('0x2e')],function(_0x4ce346){return{'name':_0x4ce346[_0x0de9('0x2f')],'type':_0x4ce346[_0x0de9('0x30')]['key']};});_0x156b67[_0x0de9('0x31')]=_['map'](_0x40b82d,_0x0de9('0x2a'));_0x156b67[_0x0de9('0x32')]=_['keys'](_0x344224[_0x0de9('0x32')]);_0x156b67[_0x0de9('0x33')]=_[_0x0de9('0x34')](_0x156b67[_0x0de9('0x31')],_0x156b67[_0x0de9('0x32')]);_0x3bb09e['attributes']=_[_0x0de9('0x34')](_0x156b67['model'],qs[_0x0de9('0x35')](_0x344224['query'][_0x0de9('0x35')]));_0x3bb09e[_0x0de9('0x36')]=_0x3bb09e[_0x0de9('0x36')][_0x0de9('0x37')]?_0x3bb09e[_0x0de9('0x36')]:_0x156b67[_0x0de9('0x31')];if(!_0x344224[_0x0de9('0x32')][_0x0de9('0x38')]('nolimit')){_0x3bb09e[_0x0de9('0x1f')]=qs[_0x0de9('0x1f')](_0x344224['query'][_0x0de9('0x1f')]);_0x3bb09e[_0x0de9('0x1e')]=qs[_0x0de9('0x1e')](_0x344224[_0x0de9('0x32')][_0x0de9('0x1e')]);}_0x3bb09e[_0x0de9('0x39')]=qs['sort'](_0x344224[_0x0de9('0x32')][_0x0de9('0x3a')]);_0x3bb09e[_0x0de9('0x3b')]=qs[_0x0de9('0x33')](_['pick'](_0x344224[_0x0de9('0x32')],_0x156b67['filters']));if(_0x344224['query'][_0x0de9('0x3c')]){_0x3bb09e[_0x0de9('0x3b')]=_[_0x0de9('0x3d')](_0x3bb09e['where'],{'$or':_[_0x0de9('0x2c')](_0x40b82d,function(_0x47ff46){if(_0x47ff46[_0x0de9('0x30')]!==_0x0de9('0x3e')){var _0x47ff32={};_0x47ff32[_0x47ff46[_0x0de9('0x2a')]]={'$like':'%'+_0x344224[_0x0de9('0x32')][_0x0de9('0x3c')]+'%'};return _0x47ff32;}})});}_0x3bb09e=_[_0x0de9('0x3d')]({},_0x3bb09e,_0x344224[_0x0de9('0x3f')]);var _0x185fb1={'where':_0x3bb09e['where']};return db[_0x0de9('0x2d')][_0x0de9('0x1d')](_0x185fb1)[_0x0de9('0x27')](function(_0x427821){_0x260255['count']=_0x427821;if(_0x344224['query'][_0x0de9('0x40')]){_0x3bb09e['include']=[{'all':!![]}];}return db['ChatQueueReport']['findAll'](_0x3bb09e);})['then'](function(_0x302abc){_0x260255[_0x0de9('0x41')]=_0x302abc;return _0x260255;})['then'](respondWithFilteredResult(_0x50b2dd,_0x3bb09e))['catch'](handleError(_0x50b2dd,null));};exports['show']=function(_0x587fa5,_0x44b83a){var _0x1b8be2={'raw':!![],'where':{'id':_0x587fa5['params']['id']}},_0x3503fb={};_0x3503fb[_0x0de9('0x31')]=_[_0x0de9('0x42')](db[_0x0de9('0x2d')]['rawAttributes']);_0x3503fb[_0x0de9('0x32')]=_[_0x0de9('0x42')](_0x587fa5[_0x0de9('0x32')]);_0x3503fb[_0x0de9('0x33')]=_['intersection'](_0x3503fb[_0x0de9('0x31')],_0x3503fb[_0x0de9('0x32')]);_0x1b8be2['attributes']=_['intersection'](_0x3503fb[_0x0de9('0x31')],qs[_0x0de9('0x35')](_0x587fa5[_0x0de9('0x32')][_0x0de9('0x35')]));_0x1b8be2[_0x0de9('0x36')]=_0x1b8be2[_0x0de9('0x36')]['length']?_0x1b8be2['attributes']:_0x3503fb[_0x0de9('0x31')];if(_0x587fa5[_0x0de9('0x32')][_0x0de9('0x40')]){_0x1b8be2[_0x0de9('0x43')]=[{'all':!![]}];}_0x1b8be2=_['merge']({},_0x1b8be2,_0x587fa5['options']);return db[_0x0de9('0x2d')][_0x0de9('0x44')](_0x1b8be2)[_0x0de9('0x27')](handleEntityNotFound(_0x44b83a,null))[_0x0de9('0x27')](respondWithResult(_0x44b83a,null))['catch'](handleError(_0x44b83a,null));};exports[_0x0de9('0x45')]=function(_0x456417,_0x502476){return db[_0x0de9('0x2d')][_0x0de9('0x45')](_0x456417[_0x0de9('0x46')],{})[_0x0de9('0x27')](respondWithResult(_0x502476,0xc9))[_0x0de9('0x47')](handleError(_0x502476,null));};exports['update']=function(_0x438ff4,_0x455391){if(_0x438ff4[_0x0de9('0x46')]['id']){delete _0x438ff4[_0x0de9('0x46')]['id'];}return db[_0x0de9('0x2d')][_0x0de9('0x44')]({'where':{'id':_0x438ff4[_0x0de9('0x48')]['id']}})['then'](handleEntityNotFound(_0x455391,null))[_0x0de9('0x27')](saveUpdates(_0x438ff4[_0x0de9('0x46')],null))[_0x0de9('0x27')](respondWithResult(_0x455391,null))[_0x0de9('0x47')](handleError(_0x455391,null));};exports['destroy']=function(_0x2fdf9f,_0x3c3e51){return db[_0x0de9('0x2d')][_0x0de9('0x44')]({'where':{'id':_0x2fdf9f[_0x0de9('0x48')]['id']}})[_0x0de9('0x27')](handleEntityNotFound(_0x3c3e51,null))['then'](removeEntity(_0x3c3e51,null))[_0x0de9('0x47')](handleError(_0x3c3e51,null));};exports[_0x0de9('0x49')]=function(_0x155791,_0x2bba0d){return db[_0x0de9('0x2d')][_0x0de9('0x49')]()['then'](respondWithResult(_0x2bba0d,null))[_0x0de9('0x47')](handleError(_0x2bba0d,null));};
\ No newline at end of file
+var _0x011f=['../../config/utils','../../config/environment','../../mysqldb','sendStatus','status','end','json','count','offset','set','apply','save','update','destroy','then','error','stack','name','send','index','ChatQueueReport','rawAttributes','fieldName','type','query','keys','filters','intersection','model','attributes','fields','hasOwnProperty','nolimit','limit','order','sort','where','filter','map','VIRTUAL','merge','options','includeAll','include','findAll','rows','catch','show','params','length','find','create','body','describe','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','moment','mustache','util','path','to-csv','ejs','squel','desk.js','papaparse','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api'];(function(_0x1440fd,_0x16653e){var _0x30ca02=function(_0x38f1cd){while(--_0x38f1cd){_0x1440fd['push'](_0x1440fd['shift']());}};_0x30ca02(++_0x16653e);}(_0x011f,0x15a));var _0xf011=function(_0x2c7618,_0x26be9c){_0x2c7618=_0x2c7618-0x0;var _0x5ce3f0=_0x011f[_0x2c7618];return _0x5ce3f0;};'use strict';var pdf=require('html-pdf');var emlformat=require(_0xf011('0x0'));var rimraf=require(_0xf011('0x1'));var zipdir=require(_0xf011('0x2'));var jsonpatch=require(_0xf011('0x3'));var rp=require(_0xf011('0x4'));var moment=require(_0xf011('0x5'));var BPromise=require('bluebird');var Mustache=require(_0xf011('0x6'));var util=require(_0xf011('0x7'));var path=require(_0xf011('0x8'));var sox=require('sox');var csv=require(_0xf011('0x9'));var ejs=require(_0xf011('0xa'));var fs=require('fs');var _=require('lodash');var squel=require(_0xf011('0xb'));var crypto=require('crypto');var jsforce=require('jsforce');var deskjs=require(_0xf011('0xc'));var toCsv=require(_0xf011('0x9'));var querystring=require('querystring');var Papa=require(_0xf011('0xd'));var Redis=require('ioredis');var authService=require('../../components/auth/service');var qs=require(_0xf011('0xe'));var as=require(_0xf011('0xf'));var hardwareService=require(_0xf011('0x10'));var logger=require(_0xf011('0x11'))(_0xf011('0x12'));var utils=require(_0xf011('0x13'));var config=require(_0xf011('0x14'));var db=require(_0xf011('0x15'))['db'];function respondWithStatusCode(_0x334f72,_0x58fd2c){_0x58fd2c=_0x58fd2c||0xcc;return function(_0x5d3896){if(_0x5d3896){return _0x334f72[_0xf011('0x16')](_0x58fd2c);}return _0x334f72[_0xf011('0x17')](_0x58fd2c)[_0xf011('0x18')]();};}function respondWithResult(_0x3a42dd,_0x55a53b){_0x55a53b=_0x55a53b||0xc8;return function(_0x25814d){if(_0x25814d){return _0x3a42dd[_0xf011('0x17')](_0x55a53b)[_0xf011('0x19')](_0x25814d);}};}function respondWithFilteredResult(_0x1bde02,_0x6a44ef){return function(_0x52fddc){if(_0x52fddc){var _0x44ee6a=_0x52fddc[_0xf011('0x1a')],_0x20c241=_0x6a44ef[_0xf011('0x1b')],_0x47710f=_0x6a44ef[_0xf011('0x1b')]+_0x6a44ef['limit'],_0x5bb518;if(_0x47710f>=_0x44ee6a){_0x47710f=_0x44ee6a;_0x5bb518=0xc8;}else{_0x5bb518=0xce;}_0x1bde02['status'](_0x5bb518);return _0x1bde02[_0xf011('0x1c')]('Content-Range',_0x20c241+'-'+_0x47710f+'/'+_0x44ee6a)[_0xf011('0x19')](_0x52fddc);}return null;};}function patchUpdates(_0x9642bf){return function(_0x3a72cc){try{jsonpatch[_0xf011('0x1d')](_0x3a72cc,_0x9642bf,!![]);}catch(_0x4fd8b0){return BPromise['reject'](_0x4fd8b0);}return _0x3a72cc[_0xf011('0x1e')]();};}function saveUpdates(_0x529cc,_0xc6e05e){return function(_0x2aebf8){if(_0x2aebf8){return _0x2aebf8[_0xf011('0x1f')](_0x529cc)['then'](function(_0x4e8a78){return _0x4e8a78;});}return null;};}function removeEntity(_0x19a3c9,_0x2d97af){return function(_0x31c1f6){if(_0x31c1f6){return _0x31c1f6[_0xf011('0x20')]()[_0xf011('0x21')](function(){_0x19a3c9[_0xf011('0x17')](0xcc)['end']();});}};}function handleEntityNotFound(_0x506e2c,_0x13072f){return function(_0x54cdf4){if(!_0x54cdf4){_0x506e2c[_0xf011('0x16')](0x194);}return _0x54cdf4;};}function handleError(_0x30cc4c,_0x37a0f2){_0x37a0f2=_0x37a0f2||0x1f4;return function(_0x131879){logger[_0xf011('0x22')](_0x131879[_0xf011('0x23')]);if(_0x131879[_0xf011('0x24')]){delete _0x131879['name'];}_0x30cc4c[_0xf011('0x17')](_0x37a0f2)[_0xf011('0x25')](_0x131879);};}exports[_0xf011('0x26')]=function(_0x336715,_0x267a5c){var _0x3214fb={},_0x50917c={},_0x41a9fd={'count':0x0,'rows':[]};var _0x4b2333=_['map'](db[_0xf011('0x27')][_0xf011('0x28')],function(_0x5ebf0a){return{'name':_0x5ebf0a[_0xf011('0x29')],'type':_0x5ebf0a[_0xf011('0x2a')]['key']};});_0x50917c['model']=_['map'](_0x4b2333,_0xf011('0x24'));_0x50917c[_0xf011('0x2b')]=_[_0xf011('0x2c')](_0x336715[_0xf011('0x2b')]);_0x50917c[_0xf011('0x2d')]=_[_0xf011('0x2e')](_0x50917c[_0xf011('0x2f')],_0x50917c['query']);_0x3214fb[_0xf011('0x30')]=_[_0xf011('0x2e')](_0x50917c[_0xf011('0x2f')],qs['fields'](_0x336715[_0xf011('0x2b')][_0xf011('0x31')]));_0x3214fb[_0xf011('0x30')]=_0x3214fb[_0xf011('0x30')]['length']?_0x3214fb[_0xf011('0x30')]:_0x50917c[_0xf011('0x2f')];if(!_0x336715[_0xf011('0x2b')][_0xf011('0x32')](_0xf011('0x33'))){_0x3214fb[_0xf011('0x34')]=qs['limit'](_0x336715[_0xf011('0x2b')][_0xf011('0x34')]);_0x3214fb['offset']=qs['offset'](_0x336715[_0xf011('0x2b')][_0xf011('0x1b')]);}_0x3214fb[_0xf011('0x35')]=qs[_0xf011('0x36')](_0x336715[_0xf011('0x2b')][_0xf011('0x36')]);_0x3214fb[_0xf011('0x37')]=qs[_0xf011('0x2d')](_['pick'](_0x336715[_0xf011('0x2b')],_0x50917c[_0xf011('0x2d')]));if(_0x336715[_0xf011('0x2b')][_0xf011('0x38')]){_0x3214fb[_0xf011('0x37')]=_['merge'](_0x3214fb[_0xf011('0x37')],{'$or':_[_0xf011('0x39')](_0x4b2333,function(_0x13b0cf){if(_0x13b0cf['type']!==_0xf011('0x3a')){var _0x4c802c={};_0x4c802c[_0x13b0cf['name']]={'$like':'%'+_0x336715[_0xf011('0x2b')][_0xf011('0x38')]+'%'};return _0x4c802c;}})});}_0x3214fb=_[_0xf011('0x3b')]({},_0x3214fb,_0x336715[_0xf011('0x3c')]);var _0xc83c6f={'where':_0x3214fb[_0xf011('0x37')]};return db[_0xf011('0x27')][_0xf011('0x1a')](_0xc83c6f)[_0xf011('0x21')](function(_0x3f412e){_0x41a9fd[_0xf011('0x1a')]=_0x3f412e;if(_0x336715[_0xf011('0x2b')][_0xf011('0x3d')]){_0x3214fb[_0xf011('0x3e')]=[{'all':!![]}];}return db[_0xf011('0x27')][_0xf011('0x3f')](_0x3214fb);})['then'](function(_0x2d2eb6){_0x41a9fd[_0xf011('0x40')]=_0x2d2eb6;return _0x41a9fd;})[_0xf011('0x21')](respondWithFilteredResult(_0x267a5c,_0x3214fb))[_0xf011('0x41')](handleError(_0x267a5c,null));};exports[_0xf011('0x42')]=function(_0x2354d1,_0x734965){var _0x7df9c2={'raw':!![],'where':{'id':_0x2354d1[_0xf011('0x43')]['id']}},_0x4f29b2={};_0x4f29b2[_0xf011('0x2f')]=_['keys'](db['ChatQueueReport'][_0xf011('0x28')]);_0x4f29b2['query']=_[_0xf011('0x2c')](_0x2354d1[_0xf011('0x2b')]);_0x4f29b2['filters']=_[_0xf011('0x2e')](_0x4f29b2[_0xf011('0x2f')],_0x4f29b2[_0xf011('0x2b')]);_0x7df9c2[_0xf011('0x30')]=_[_0xf011('0x2e')](_0x4f29b2[_0xf011('0x2f')],qs[_0xf011('0x31')](_0x2354d1[_0xf011('0x2b')][_0xf011('0x31')]));_0x7df9c2[_0xf011('0x30')]=_0x7df9c2[_0xf011('0x30')][_0xf011('0x44')]?_0x7df9c2['attributes']:_0x4f29b2[_0xf011('0x2f')];if(_0x2354d1[_0xf011('0x2b')][_0xf011('0x3d')]){_0x7df9c2[_0xf011('0x3e')]=[{'all':!![]}];}_0x7df9c2=_[_0xf011('0x3b')]({},_0x7df9c2,_0x2354d1[_0xf011('0x3c')]);return db['ChatQueueReport'][_0xf011('0x45')](_0x7df9c2)[_0xf011('0x21')](handleEntityNotFound(_0x734965,null))['then'](respondWithResult(_0x734965,null))[_0xf011('0x41')](handleError(_0x734965,null));};exports[_0xf011('0x46')]=function(_0x389d31,_0x28269c){return db[_0xf011('0x27')]['create'](_0x389d31[_0xf011('0x47')],{})[_0xf011('0x21')](respondWithResult(_0x28269c,0xc9))['catch'](handleError(_0x28269c,null));};exports[_0xf011('0x1f')]=function(_0x4d9949,_0xb2a47f){if(_0x4d9949['body']['id']){delete _0x4d9949[_0xf011('0x47')]['id'];}return db['ChatQueueReport']['find']({'where':{'id':_0x4d9949[_0xf011('0x43')]['id']}})[_0xf011('0x21')](handleEntityNotFound(_0xb2a47f,null))[_0xf011('0x21')](saveUpdates(_0x4d9949[_0xf011('0x47')],null))[_0xf011('0x21')](respondWithResult(_0xb2a47f,null))[_0xf011('0x41')](handleError(_0xb2a47f,null));};exports[_0xf011('0x20')]=function(_0x153ae6,_0x9c17a6){return db[_0xf011('0x27')][_0xf011('0x45')]({'where':{'id':_0x153ae6[_0xf011('0x43')]['id']}})[_0xf011('0x21')](handleEntityNotFound(_0x9c17a6,null))['then'](removeEntity(_0x9c17a6,null))[_0xf011('0x41')](handleError(_0x9c17a6,null));};exports[_0xf011('0x48')]=function(_0x5994f7,_0x2ccef6){return db[_0xf011('0x27')][_0xf011('0x48')]()[_0xf011('0x21')](respondWithResult(_0x2ccef6,null))[_0xf011('0x41')](handleError(_0x2ccef6,null));};
\ No newline at end of file
diff --git a/server/api/chatQueueReport/chatQueueReport.model.js b/server/api/chatQueueReport/chatQueueReport.model.js
index 190fbb5..9dc573c 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 _0xd09c=['path','../../config/environment','exports','report_chat_queue','util','../../config/logger','api','request-promise'];(function(_0x17784a,_0x42fe44){var _0x41aded=function(_0x2e7319){while(--_0x2e7319){_0x17784a['push'](_0x17784a['shift']());}};_0x41aded(++_0x42fe44);}(_0xd09c,0x1ac));var _0xcd09=function(_0x3dd15e,_0x1f0015){_0x3dd15e=_0x3dd15e-0x0;var _0x231fd0=_0xd09c[_0x3dd15e];return _0x231fd0;};'use strict';var _=require('lodash');var util=require(_0xcd09('0x0'));var logger=require(_0xcd09('0x1'))(_0xcd09('0x2'));var moment=require('moment');var BPromise=require('bluebird');var rp=require(_0xcd09('0x3'));var fs=require('fs');var path=require(_0xcd09('0x4'));var rimraf=require('rimraf');var config=require(_0xcd09('0x5'));var attributes=require('./chatQueueReport.attributes');module[_0xcd09('0x6')]=function(_0x8006eb,_0x51f9ee){return _0x8006eb['define']('ChatQueueReport',attributes,{'tableName':_0xcd09('0x7'),'paranoid':![],'indexes':[{'name':'uniqueid','fields':['uniqueid']}],'timestamps':!![]});};
\ No newline at end of file
+var _0x299b=['./chatQueueReport.attributes','exports','define','ChatQueueReport','report_chat_queue','uniqueid','lodash','util','../../config/logger','api','path','rimraf','../../config/environment'];(function(_0x1c8cc6,_0x411e5c){var _0x522936=function(_0x38d044){while(--_0x38d044){_0x1c8cc6['push'](_0x1c8cc6['shift']());}};_0x522936(++_0x411e5c);}(_0x299b,0x1c0));var _0xb299=function(_0x283127,_0x54d4d5){_0x283127=_0x283127-0x0;var _0x43da5d=_0x299b[_0x283127];return _0x43da5d;};'use strict';var _=require(_0xb299('0x0'));var util=require(_0xb299('0x1'));var logger=require(_0xb299('0x2'))(_0xb299('0x3'));var moment=require('moment');var BPromise=require('bluebird');var rp=require('request-promise');var fs=require('fs');var path=require(_0xb299('0x4'));var rimraf=require(_0xb299('0x5'));var config=require(_0xb299('0x6'));var attributes=require(_0xb299('0x7'));module[_0xb299('0x8')]=function(_0x4fab49,_0x3dbd50){return _0x4fab49[_0xb299('0x9')](_0xb299('0xa'),attributes,{'tableName':_0xb299('0xb'),'paranoid':![],'indexes':[{'name':_0xb299('0xc'),'fields':[_0xb299('0xc')]}],'timestamps':!![]});};
\ No newline at end of file
diff --git a/server/api/chatQueueReport/chatQueueReport.rpc.js b/server/api/chatQueueReport/chatQueueReport.rpc.js
index 2f40d92..70bca92 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 _0xe785=['raw','debug','UpdateChatQueueReport','update','options','attributes','limit','util','moment','randomstring','../../mysqldb','../../config/logger','rpc','../../config/environment','jayson/promise','http','request','then','info','ChatQueueReport,\x20%s,\x20%s,\x20%s','stringify','error','code','message','ChatQueueReport,\x20%s,\x20%s','request\x20sent','result','catch','CreateChatQueueReport','ChatQueueReport','body'];(function(_0x2e1407,_0x3c99fc){var _0x5e9034=function(_0x241e73){while(--_0x241e73){_0x2e1407['push'](_0x2e1407['shift']());}};_0x5e9034(++_0x3c99fc);}(_0xe785,0x11e));var _0x5e78=function(_0x22205c,_0x473493){_0x22205c=_0x22205c-0x0;var _0x3f5efe=_0xe785[_0x22205c];return _0x3f5efe;};'use strict';var _=require('lodash');var util=require(_0x5e78('0x0'));var moment=require(_0x5e78('0x1'));var BPromise=require('bluebird');var rs=require(_0x5e78('0x2'));var fs=require('fs');var Redis=require('ioredis');var db=require(_0x5e78('0x3'))['db'];var utils=require('../../config/utils');var logger=require(_0x5e78('0x4'))(_0x5e78('0x5'));var config=require(_0x5e78('0x6'));var jayson=require(_0x5e78('0x7'));var client=jayson['client'][_0x5e78('0x8')]({'port':0x232a});function respondWithRpcPromise(_0x395a84,_0xcb3541,_0x4ba16b){return new BPromise(function(_0x1a51d1,_0x4162cc){return client[_0x5e78('0x9')](_0x395a84,_0x4ba16b)[_0x5e78('0xa')](function(_0x2c7979){logger[_0x5e78('0xb')]('ChatQueueReport,\x20%s,\x20%s',_0xcb3541,'request\x20sent');logger['debug'](_0x5e78('0xc'),_0xcb3541,'request\x20sent',JSON[_0x5e78('0xd')](_0x2c7979));if(_0x2c7979[_0x5e78('0xe')]){if(_0x2c7979[_0x5e78('0xe')][_0x5e78('0xf')]===0x1f4){logger['error']('ChatQueueReport,\x20%s,\x20%s',_0xcb3541,_0x2c7979[_0x5e78('0xe')][_0x5e78('0x10')]);return _0x4162cc(_0x2c7979[_0x5e78('0xe')][_0x5e78('0x10')]);}logger[_0x5e78('0xe')](_0x5e78('0x11'),_0xcb3541,_0x2c7979[_0x5e78('0xe')][_0x5e78('0x10')]);return _0x1a51d1(_0x2c7979[_0x5e78('0xe')][_0x5e78('0x10')]);}else{logger[_0x5e78('0xb')]('ChatQueueReport,\x20%s,\x20%s',_0xcb3541,_0x5e78('0x12'));_0x1a51d1(_0x2c7979[_0x5e78('0x13')]['message']);}})[_0x5e78('0x14')](function(_0x2ff65a){logger[_0x5e78('0xe')]('ChatQueueReport,\x20%s,\x20%s',_0xcb3541,_0x2ff65a);_0x4162cc(_0x2ff65a);});});}exports[_0x5e78('0x15')]=function(_0x4daa12){var _0x1da76d=this;return new Promise(function(_0x4f396b,_0x3e9b58){return db[_0x5e78('0x16')]['create'](_0x4daa12[_0x5e78('0x17')],{'raw':_0x4daa12['options']?_0x4daa12['options'][_0x5e78('0x18')]===undefined?!![]:![]:!![]})['then'](function(_0x3f3c11){logger[_0x5e78('0xb')](_0x5e78('0x15'),_0x4daa12);logger[_0x5e78('0x19')](_0x5e78('0x15'),_0x4daa12,JSON[_0x5e78('0xd')](_0x3f3c11));_0x4f396b(_0x3f3c11);})[_0x5e78('0x14')](function(_0x5713b8){logger[_0x5e78('0xe')](_0x5e78('0x15'),_0x5713b8[_0x5e78('0x10')],_0x4daa12);_0x3e9b58(_0x1da76d[_0x5e78('0xe')](0x1f4,_0x5713b8[_0x5e78('0x10')]));});});};exports[_0x5e78('0x1a')]=function(_0x101cf1){var _0x228ee8=this;return new Promise(function(_0x5274ce,_0x4c194b){return db[_0x5e78('0x16')][_0x5e78('0x1b')](_0x101cf1['body'],{'raw':_0x101cf1[_0x5e78('0x1c')]?_0x101cf1[_0x5e78('0x1c')][_0x5e78('0x18')]===undefined?!![]:![]:!![],'individualHooks':!![],'where':_0x101cf1[_0x5e78('0x1c')]?_0x101cf1[_0x5e78('0x1c')]['where']||null:null,'attributes':_0x101cf1[_0x5e78('0x1c')]?_0x101cf1[_0x5e78('0x1c')][_0x5e78('0x1d')]||null:null,'limit':_0x101cf1[_0x5e78('0x1c')]?_0x101cf1[_0x5e78('0x1c')][_0x5e78('0x1e')]||null:null})[_0x5e78('0xa')](function(_0x42bd7e){logger[_0x5e78('0xb')](_0x5e78('0x1a'),_0x101cf1);logger[_0x5e78('0x19')](_0x5e78('0x1a'),_0x101cf1,JSON[_0x5e78('0xd')](_0x42bd7e));_0x5274ce(_0x42bd7e);})[_0x5e78('0x14')](function(_0x353fb5){logger['error'](_0x5e78('0x1a'),_0x353fb5[_0x5e78('0x10')],_0x101cf1);_0x4c194b(_0x228ee8['error'](0x1f4,_0x353fb5[_0x5e78('0x10')]));});});};
\ No newline at end of file
+var _0xb8ee=['raw','catch','UpdateChatQueueReport','where','attributes','lodash','util','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','client','http','request','then','info','ChatQueueReport,\x20%s,\x20%s','debug','ChatQueueReport,\x20%s,\x20%s,\x20%s','request\x20sent','stringify','code','error','message','CreateChatQueueReport','ChatQueueReport','create','body','options'];(function(_0x22f49b,_0x444bd1){var _0x428004=function(_0x2faf38){while(--_0x2faf38){_0x22f49b['push'](_0x22f49b['shift']());}};_0x428004(++_0x444bd1);}(_0xb8ee,0x91));var _0xeb8e=function(_0x57d7f7,_0x335c81){_0x57d7f7=_0x57d7f7-0x0;var _0x1a6800=_0xb8ee[_0x57d7f7];return _0x1a6800;};'use strict';var _=require(_0xeb8e('0x0'));var util=require(_0xeb8e('0x1'));var moment=require(_0xeb8e('0x2'));var BPromise=require(_0xeb8e('0x3'));var rs=require(_0xeb8e('0x4'));var fs=require('fs');var Redis=require(_0xeb8e('0x5'));var db=require(_0xeb8e('0x6'))['db'];var utils=require(_0xeb8e('0x7'));var logger=require(_0xeb8e('0x8'))(_0xeb8e('0x9'));var config=require(_0xeb8e('0xa'));var jayson=require(_0xeb8e('0xb'));var client=jayson[_0xeb8e('0xc')][_0xeb8e('0xd')]({'port':0x232a});function respondWithRpcPromise(_0x5a68e0,_0x268146,_0x25164d){return new BPromise(function(_0x470f46,_0x1f6414){return client[_0xeb8e('0xe')](_0x5a68e0,_0x25164d)[_0xeb8e('0xf')](function(_0x55ab6d){logger[_0xeb8e('0x10')](_0xeb8e('0x11'),_0x268146,'request\x20sent');logger[_0xeb8e('0x12')](_0xeb8e('0x13'),_0x268146,_0xeb8e('0x14'),JSON[_0xeb8e('0x15')](_0x55ab6d));if(_0x55ab6d['error']){if(_0x55ab6d['error'][_0xeb8e('0x16')]===0x1f4){logger['error'](_0xeb8e('0x11'),_0x268146,_0x55ab6d[_0xeb8e('0x17')][_0xeb8e('0x18')]);return _0x1f6414(_0x55ab6d[_0xeb8e('0x17')][_0xeb8e('0x18')]);}logger[_0xeb8e('0x17')](_0xeb8e('0x11'),_0x268146,_0x55ab6d[_0xeb8e('0x17')][_0xeb8e('0x18')]);return _0x470f46(_0x55ab6d[_0xeb8e('0x17')][_0xeb8e('0x18')]);}else{logger[_0xeb8e('0x10')](_0xeb8e('0x11'),_0x268146,_0xeb8e('0x14'));_0x470f46(_0x55ab6d['result'][_0xeb8e('0x18')]);}})['catch'](function(_0x6b2f25){logger[_0xeb8e('0x17')](_0xeb8e('0x11'),_0x268146,_0x6b2f25);_0x1f6414(_0x6b2f25);});});}exports[_0xeb8e('0x19')]=function(_0x4af52a){var _0x84b613=this;return new Promise(function(_0x26a619,_0x1b103a){return db[_0xeb8e('0x1a')][_0xeb8e('0x1b')](_0x4af52a[_0xeb8e('0x1c')],{'raw':_0x4af52a[_0xeb8e('0x1d')]?_0x4af52a[_0xeb8e('0x1d')][_0xeb8e('0x1e')]===undefined?!![]:![]:!![]})[_0xeb8e('0xf')](function(_0x11bcd7){logger[_0xeb8e('0x10')](_0xeb8e('0x19'),_0x4af52a);logger[_0xeb8e('0x12')](_0xeb8e('0x19'),_0x4af52a,JSON[_0xeb8e('0x15')](_0x11bcd7));_0x26a619(_0x11bcd7);})[_0xeb8e('0x1f')](function(_0x4e91d){logger[_0xeb8e('0x17')]('CreateChatQueueReport',_0x4e91d[_0xeb8e('0x18')],_0x4af52a);_0x1b103a(_0x84b613[_0xeb8e('0x17')](0x1f4,_0x4e91d[_0xeb8e('0x18')]));});});};exports[_0xeb8e('0x20')]=function(_0x1a3a19){var _0x471a19=this;return new Promise(function(_0x17bcbe,_0x4fb8bf){return db[_0xeb8e('0x1a')]['update'](_0x1a3a19[_0xeb8e('0x1c')],{'raw':_0x1a3a19['options']?_0x1a3a19[_0xeb8e('0x1d')][_0xeb8e('0x1e')]===undefined?!![]:![]:!![],'individualHooks':!![],'where':_0x1a3a19['options']?_0x1a3a19[_0xeb8e('0x1d')][_0xeb8e('0x21')]||null:null,'attributes':_0x1a3a19[_0xeb8e('0x1d')]?_0x1a3a19[_0xeb8e('0x1d')][_0xeb8e('0x22')]||null:null,'limit':_0x1a3a19[_0xeb8e('0x1d')]?_0x1a3a19[_0xeb8e('0x1d')]['limit']||null:null})[_0xeb8e('0xf')](function(_0x446b62){logger[_0xeb8e('0x10')](_0xeb8e('0x20'),_0x1a3a19);logger['debug'](_0xeb8e('0x20'),_0x1a3a19,JSON['stringify'](_0x446b62));_0x17bcbe(_0x446b62);})[_0xeb8e('0x1f')](function(_0x13ba12){logger[_0xeb8e('0x17')]('UpdateChatQueueReport',_0x13ba12['message'],_0x1a3a19);_0x4fb8bf(_0x471a19[_0xeb8e('0x17')](0x1f4,_0x13ba12[_0xeb8e('0x18')]));});});};
\ No newline at end of file
diff --git a/server/api/chatQueueReport/index.js b/server/api/chatQueueReport/index.js
index 0318398..ee65cb6 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 _0xb6f2=['../../components/interaction/service','../../config/environment','/describe','isAuthenticated','describe','get','/:id','show','post','put','update','destroy','exports','util','path','connect-timeout','express','Router'];(function(_0x335eca,_0x23bee1){var _0x4a9e78=function(_0x5ef1ec){while(--_0x5ef1ec){_0x335eca['push'](_0x335eca['shift']());}};_0x4a9e78(++_0x23bee1);}(_0xb6f2,0x13f));var _0x2b6f=function(_0x2c7618,_0x26be9c){_0x2c7618=_0x2c7618-0x0;var _0x5ce3f0=_0xb6f2[_0x2c7618];return _0x5ce3f0;};'use strict';var multer=require('multer');var util=require(_0x2b6f('0x0'));var path=require(_0x2b6f('0x1'));var timeout=require(_0x2b6f('0x2'));var express=require(_0x2b6f('0x3'));var router=express[_0x2b6f('0x4')]();var auth=require('../../components/auth/service');var interaction=require(_0x2b6f('0x5'));var config=require(_0x2b6f('0x6'));var controller=require('./chatQueueReport.controller');router['get']('/',auth['isAuthenticated'](),controller['index']);router['get'](_0x2b6f('0x7'),auth[_0x2b6f('0x8')](),controller[_0x2b6f('0x9')]);router[_0x2b6f('0xa')](_0x2b6f('0xb'),auth[_0x2b6f('0x8')](),controller[_0x2b6f('0xc')]);router[_0x2b6f('0xd')]('/',auth['isAuthenticated'](),controller['create']);router[_0x2b6f('0xe')](_0x2b6f('0xb'),auth[_0x2b6f('0x8')](),controller[_0x2b6f('0xf')]);router['delete'](_0x2b6f('0xb'),auth[_0x2b6f('0x8')](),controller[_0x2b6f('0x10')]);module[_0x2b6f('0x11')]=router;
\ No newline at end of file
+var _0x5c5d=['create','put','/:id','update','delete','destroy','exports','multer','util','path','express','Router','../../components/interaction/service','../../config/environment','./chatQueueReport.controller','get','isAuthenticated','index','/describe','describe','show'];(function(_0x26eeac,_0x25dc6a){var _0xb58d5f=function(_0x1a0b25){while(--_0x1a0b25){_0x26eeac['push'](_0x26eeac['shift']());}};_0xb58d5f(++_0x25dc6a);}(_0x5c5d,0x142));var _0xd5c5=function(_0x2b10c6,_0x185590){_0x2b10c6=_0x2b10c6-0x0;var _0x3789d2=_0x5c5d[_0x2b10c6];return _0x3789d2;};'use strict';var multer=require(_0xd5c5('0x0'));var util=require(_0xd5c5('0x1'));var path=require(_0xd5c5('0x2'));var timeout=require('connect-timeout');var express=require(_0xd5c5('0x3'));var router=express[_0xd5c5('0x4')]();var auth=require('../../components/auth/service');var interaction=require(_0xd5c5('0x5'));var config=require(_0xd5c5('0x6'));var controller=require(_0xd5c5('0x7'));router[_0xd5c5('0x8')]('/',auth[_0xd5c5('0x9')](),controller[_0xd5c5('0xa')]);router[_0xd5c5('0x8')](_0xd5c5('0xb'),auth[_0xd5c5('0x9')](),controller[_0xd5c5('0xc')]);router['get']('/:id',auth[_0xd5c5('0x9')](),controller[_0xd5c5('0xd')]);router['post']('/',auth['isAuthenticated'](),controller[_0xd5c5('0xe')]);router[_0xd5c5('0xf')](_0xd5c5('0x10'),auth[_0xd5c5('0x9')](),controller[_0xd5c5('0x11')]);router[_0xd5c5('0x12')](_0xd5c5('0x10'),auth['isAuthenticated'](),controller[_0xd5c5('0x13')]);module[_0xd5c5('0x14')]=router;
\ No newline at end of file
diff --git a/server/api/chatTransferReport/chatTransferReport.attributes.js b/server/api/chatTransferReport/chatTransferReport.attributes.js
index 9ba6083..b1dc8a8 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 _0xab13=['account','agent','queue','NOW','moment','sequelize','ENUM'];(function(_0x12111d,_0x5d39ba){var _0x56ae0d=function(_0xc509ca){while(--_0xc509ca){_0x12111d['push'](_0x12111d['shift']());}};_0x56ae0d(++_0x5d39ba);}(_0xab13,0x82));var _0x3ab1=function(_0x54aea3,_0xae7d81){_0x54aea3=_0x54aea3-0x0;var _0x21ae46=_0xab13[_0x54aea3];return _0x21ae46;};'use strict';var moment=require(_0x3ab1('0x0'));var Sequelize=require(_0x3ab1('0x1'));module['exports']={'uniqueid':{'type':Sequelize['STRING'],'allowNull':![]},'type':{'type':Sequelize[_0x3ab1('0x2')](_0x3ab1('0x3'),_0x3ab1('0x4'),_0x3ab1('0x5')),'allowNull':![],'defaultValue':_0x3ab1('0x5')},'transferredAt':{'type':Sequelize['DATE'],'allowNull':![],'defaultValue':Sequelize[_0x3ab1('0x6')]}};
\ No newline at end of file
+var _0x15cc=['DATE','NOW','moment','sequelize','exports','ENUM','account','agent','queue'];(function(_0x3dd15e,_0x1f0015){var _0x231fd0=function(_0x4f680a){while(--_0x4f680a){_0x3dd15e['push'](_0x3dd15e['shift']());}};_0x231fd0(++_0x1f0015);}(_0x15cc,0xd1));var _0xc15c=function(_0x2e067a,_0xab528c){_0x2e067a=_0x2e067a-0x0;var _0xc64976=_0x15cc[_0x2e067a];return _0xc64976;};'use strict';var moment=require(_0xc15c('0x0'));var Sequelize=require(_0xc15c('0x1'));module[_0xc15c('0x2')]={'uniqueid':{'type':Sequelize['STRING'],'allowNull':![]},'type':{'type':Sequelize[_0xc15c('0x3')](_0xc15c('0x4'),_0xc15c('0x5'),_0xc15c('0x6')),'allowNull':![],'defaultValue':_0xc15c('0x6')},'transferredAt':{'type':Sequelize[_0xc15c('0x7')],'allowNull':![],'defaultValue':Sequelize[_0xc15c('0x8')]}};
\ No newline at end of file
diff --git a/server/api/chatTransferReport/chatTransferReport.controller.js b/server/api/chatTransferReport/chatTransferReport.controller.js
index 921896a..87ccb85 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 _0xe900=['rawAttributes','fieldName','type','model','query','keys','filters','attributes','fields','length','hasOwnProperty','order','sort','where','pick','filter','VIRTUAL','merge','options','includeAll','include','rows','catch','show','params','intersection','find','create','body','describe','html-pdf','eml-format','zip-dir','fast-json-patch','request-promise','moment','bluebird','mustache','util','path','sox','lodash','squel','crypto','jsforce','desk.js','to-csv','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','count','offset','limit','set','Content-Range','json','apply','update','then','destroy','error','stack','name','send','index','map','ChatTransferReport'];(function(_0x3117f9,_0x24e115){var _0x86cb7d=function(_0x10c9f4){while(--_0x10c9f4){_0x3117f9['push'](_0x3117f9['shift']());}};_0x86cb7d(++_0x24e115);}(_0xe900,0x156));var _0x0e90=function(_0x37015b,_0x3fbf94){_0x37015b=_0x37015b-0x0;var _0x278a84=_0xe900[_0x37015b];return _0x278a84;};'use strict';var pdf=require(_0x0e90('0x0'));var emlformat=require(_0x0e90('0x1'));var rimraf=require('rimraf');var zipdir=require(_0x0e90('0x2'));var jsonpatch=require(_0x0e90('0x3'));var rp=require(_0x0e90('0x4'));var moment=require(_0x0e90('0x5'));var BPromise=require(_0x0e90('0x6'));var Mustache=require(_0x0e90('0x7'));var util=require(_0x0e90('0x8'));var path=require(_0x0e90('0x9'));var sox=require(_0x0e90('0xa'));var csv=require('to-csv');var ejs=require('ejs');var fs=require('fs');var _=require(_0x0e90('0xb'));var squel=require(_0x0e90('0xc'));var crypto=require(_0x0e90('0xd'));var jsforce=require(_0x0e90('0xe'));var deskjs=require(_0x0e90('0xf'));var toCsv=require(_0x0e90('0x10'));var querystring=require(_0x0e90('0x11'));var Papa=require(_0x0e90('0x12'));var Redis=require('ioredis');var authService=require(_0x0e90('0x13'));var qs=require(_0x0e90('0x14'));var as=require(_0x0e90('0x15'));var hardwareService=require(_0x0e90('0x16'));var logger=require(_0x0e90('0x17'))(_0x0e90('0x18'));var utils=require(_0x0e90('0x19'));var config=require(_0x0e90('0x1a'));var db=require(_0x0e90('0x1b'))['db'];function respondWithStatusCode(_0x200497,_0x3b6069){_0x3b6069=_0x3b6069||0xcc;return function(_0x62b021){if(_0x62b021){return _0x200497[_0x0e90('0x1c')](_0x3b6069);}return _0x200497[_0x0e90('0x1d')](_0x3b6069)[_0x0e90('0x1e')]();};}function respondWithResult(_0x35702c,_0x10798d){_0x10798d=_0x10798d||0xc8;return function(_0x5d9f95){if(_0x5d9f95){return _0x35702c[_0x0e90('0x1d')](_0x10798d)['json'](_0x5d9f95);}};}function respondWithFilteredResult(_0x54e51c,_0x377568){return function(_0x2c8ff9){if(_0x2c8ff9){var _0x8b6485=_0x2c8ff9[_0x0e90('0x1f')],_0x6c67f7=_0x377568[_0x0e90('0x20')],_0x5447c9=_0x377568[_0x0e90('0x20')]+_0x377568[_0x0e90('0x21')],_0x59b784;if(_0x5447c9>=_0x8b6485){_0x5447c9=_0x8b6485;_0x59b784=0xc8;}else{_0x59b784=0xce;}_0x54e51c[_0x0e90('0x1d')](_0x59b784);return _0x54e51c[_0x0e90('0x22')](_0x0e90('0x23'),_0x6c67f7+'-'+_0x5447c9+'/'+_0x8b6485)[_0x0e90('0x24')](_0x2c8ff9);}return null;};}function patchUpdates(_0x32a1a2){return function(_0x961b6a){try{jsonpatch[_0x0e90('0x25')](_0x961b6a,_0x32a1a2,!![]);}catch(_0x9ee4f6){return BPromise['reject'](_0x9ee4f6);}return _0x961b6a['save']();};}function saveUpdates(_0x1709d0,_0x4ba885){return function(_0x2e82d4){if(_0x2e82d4){return _0x2e82d4[_0x0e90('0x26')](_0x1709d0)[_0x0e90('0x27')](function(_0xb0fc3b){return _0xb0fc3b;});}return null;};}function removeEntity(_0x3a9609,_0x12037d){return function(_0x49131f){if(_0x49131f){return _0x49131f[_0x0e90('0x28')]()['then'](function(){_0x3a9609[_0x0e90('0x1d')](0xcc)['end']();});}};}function handleEntityNotFound(_0x3cd101,_0xa34b31){return function(_0x4e1901){if(!_0x4e1901){_0x3cd101['sendStatus'](0x194);}return _0x4e1901;};}function handleError(_0x265e48,_0x43875a){_0x43875a=_0x43875a||0x1f4;return function(_0x2959e3){logger[_0x0e90('0x29')](_0x2959e3[_0x0e90('0x2a')]);if(_0x2959e3[_0x0e90('0x2b')]){delete _0x2959e3[_0x0e90('0x2b')];}_0x265e48[_0x0e90('0x1d')](_0x43875a)[_0x0e90('0x2c')](_0x2959e3);};}exports[_0x0e90('0x2d')]=function(_0x177eeb,_0x8984bd){var _0x10f178={},_0x2174d1={},_0x1794fa={'count':0x0,'rows':[]};var _0x5f3a7e=_[_0x0e90('0x2e')](db[_0x0e90('0x2f')][_0x0e90('0x30')],function(_0x27fe6d){return{'name':_0x27fe6d[_0x0e90('0x31')],'type':_0x27fe6d[_0x0e90('0x32')]['key']};});_0x2174d1[_0x0e90('0x33')]=_[_0x0e90('0x2e')](_0x5f3a7e,_0x0e90('0x2b'));_0x2174d1[_0x0e90('0x34')]=_[_0x0e90('0x35')](_0x177eeb[_0x0e90('0x34')]);_0x2174d1[_0x0e90('0x36')]=_['intersection'](_0x2174d1[_0x0e90('0x33')],_0x2174d1[_0x0e90('0x34')]);_0x10f178[_0x0e90('0x37')]=_['intersection'](_0x2174d1[_0x0e90('0x33')],qs[_0x0e90('0x38')](_0x177eeb[_0x0e90('0x34')]['fields']));_0x10f178[_0x0e90('0x37')]=_0x10f178['attributes'][_0x0e90('0x39')]?_0x10f178[_0x0e90('0x37')]:_0x2174d1[_0x0e90('0x33')];if(!_0x177eeb[_0x0e90('0x34')][_0x0e90('0x3a')]('nolimit')){_0x10f178[_0x0e90('0x21')]=qs[_0x0e90('0x21')](_0x177eeb[_0x0e90('0x34')][_0x0e90('0x21')]);_0x10f178[_0x0e90('0x20')]=qs[_0x0e90('0x20')](_0x177eeb[_0x0e90('0x34')]['offset']);}_0x10f178[_0x0e90('0x3b')]=qs[_0x0e90('0x3c')](_0x177eeb[_0x0e90('0x34')][_0x0e90('0x3c')]);_0x10f178[_0x0e90('0x3d')]=qs['filters'](_[_0x0e90('0x3e')](_0x177eeb[_0x0e90('0x34')],_0x2174d1[_0x0e90('0x36')]));if(_0x177eeb[_0x0e90('0x34')][_0x0e90('0x3f')]){_0x10f178['where']=_['merge'](_0x10f178['where'],{'$or':_[_0x0e90('0x2e')](_0x5f3a7e,function(_0x10e4e9){if(_0x10e4e9['type']!==_0x0e90('0x40')){var _0x430f12={};_0x430f12[_0x10e4e9[_0x0e90('0x2b')]]={'$like':'%'+_0x177eeb[_0x0e90('0x34')][_0x0e90('0x3f')]+'%'};return _0x430f12;}})});}_0x10f178=_[_0x0e90('0x41')]({},_0x10f178,_0x177eeb[_0x0e90('0x42')]);var _0x5955b5={'where':_0x10f178[_0x0e90('0x3d')]};return db['ChatTransferReport'][_0x0e90('0x1f')](_0x5955b5)[_0x0e90('0x27')](function(_0xd55a80){_0x1794fa['count']=_0xd55a80;if(_0x177eeb[_0x0e90('0x34')][_0x0e90('0x43')]){_0x10f178[_0x0e90('0x44')]=[{'all':!![]}];}return db[_0x0e90('0x2f')]['findAll'](_0x10f178);})[_0x0e90('0x27')](function(_0x4d5de6){_0x1794fa[_0x0e90('0x45')]=_0x4d5de6;return _0x1794fa;})[_0x0e90('0x27')](respondWithFilteredResult(_0x8984bd,_0x10f178))[_0x0e90('0x46')](handleError(_0x8984bd,null));};exports[_0x0e90('0x47')]=function(_0x51096f,_0x253741){var _0x5be185={'raw':!![],'where':{'id':_0x51096f[_0x0e90('0x48')]['id']}},_0x5c74a4={};_0x5c74a4[_0x0e90('0x33')]=_[_0x0e90('0x35')](db[_0x0e90('0x2f')][_0x0e90('0x30')]);_0x5c74a4['query']=_['keys'](_0x51096f[_0x0e90('0x34')]);_0x5c74a4[_0x0e90('0x36')]=_[_0x0e90('0x49')](_0x5c74a4['model'],_0x5c74a4['query']);_0x5be185[_0x0e90('0x37')]=_[_0x0e90('0x49')](_0x5c74a4['model'],qs[_0x0e90('0x38')](_0x51096f[_0x0e90('0x34')][_0x0e90('0x38')]));_0x5be185[_0x0e90('0x37')]=_0x5be185['attributes'][_0x0e90('0x39')]?_0x5be185[_0x0e90('0x37')]:_0x5c74a4[_0x0e90('0x33')];if(_0x51096f[_0x0e90('0x34')][_0x0e90('0x43')]){_0x5be185[_0x0e90('0x44')]=[{'all':!![]}];}_0x5be185=_[_0x0e90('0x41')]({},_0x5be185,_0x51096f[_0x0e90('0x42')]);return db[_0x0e90('0x2f')][_0x0e90('0x4a')](_0x5be185)[_0x0e90('0x27')](handleEntityNotFound(_0x253741,null))['then'](respondWithResult(_0x253741,null))[_0x0e90('0x46')](handleError(_0x253741,null));};exports['create']=function(_0x1bcb40,_0x5480bc){return db[_0x0e90('0x2f')][_0x0e90('0x4b')](_0x1bcb40['body'],{})[_0x0e90('0x27')](respondWithResult(_0x5480bc,0xc9))[_0x0e90('0x46')](handleError(_0x5480bc,null));};exports[_0x0e90('0x26')]=function(_0x3a608d,_0x232ee3){if(_0x3a608d[_0x0e90('0x4c')]['id']){delete _0x3a608d['body']['id'];}return db['ChatTransferReport'][_0x0e90('0x4a')]({'where':{'id':_0x3a608d[_0x0e90('0x48')]['id']}})[_0x0e90('0x27')](handleEntityNotFound(_0x232ee3,null))[_0x0e90('0x27')](saveUpdates(_0x3a608d[_0x0e90('0x4c')],null))[_0x0e90('0x27')](respondWithResult(_0x232ee3,null))['catch'](handleError(_0x232ee3,null));};exports['destroy']=function(_0x5372b3,_0x364d9f){return db[_0x0e90('0x2f')][_0x0e90('0x4a')]({'where':{'id':_0x5372b3[_0x0e90('0x48')]['id']}})[_0x0e90('0x27')](handleEntityNotFound(_0x364d9f,null))[_0x0e90('0x27')](removeEntity(_0x364d9f,null))[_0x0e90('0x46')](handleError(_0x364d9f,null));};exports[_0x0e90('0x4d')]=function(_0x10d948,_0x257880){return db[_0x0e90('0x2f')][_0x0e90('0x4d')]()[_0x0e90('0x27')](respondWithResult(_0x257880,null))['catch'](handleError(_0x257880,null));};
\ No newline at end of file
+var _0xd7cb=['fields','hasOwnProperty','nolimit','limit','offset','sort','where','pick','filter','merge','count','includeAll','include','findAll','catch','show','params','rawAttributes','find','create','body','describe','html-pdf','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','moment','bluebird','mustache','util','path','sox','lodash','squel','crypto','jsforce','desk.js','to-csv','querystring','ioredis','../../components/auth/service','../../components/parsers/advancedSearch','../../config/license/hardware','api','../../config/utils','../../config/environment','../../mysqldb','sendStatus','status','json','set','Content-Range','apply','save','update','then','destroy','end','error','stack','name','send','index','map','ChatTransferReport','fieldName','type','key','model','keys','query','filters','intersection','attributes'];(function(_0x32d0b6,_0xf2f122){var _0x50711b=function(_0x41e0e1){while(--_0x41e0e1){_0x32d0b6['push'](_0x32d0b6['shift']());}};_0x50711b(++_0xf2f122);}(_0xd7cb,0x192));var _0xbd7c=function(_0x397e5f,_0x454c8f){_0x397e5f=_0x397e5f-0x0;var _0x5302b8=_0xd7cb[_0x397e5f];return _0x5302b8;};'use strict';var pdf=require(_0xbd7c('0x0'));var emlformat=require(_0xbd7c('0x1'));var rimraf=require(_0xbd7c('0x2'));var zipdir=require(_0xbd7c('0x3'));var jsonpatch=require(_0xbd7c('0x4'));var rp=require(_0xbd7c('0x5'));var moment=require(_0xbd7c('0x6'));var BPromise=require(_0xbd7c('0x7'));var Mustache=require(_0xbd7c('0x8'));var util=require(_0xbd7c('0x9'));var path=require(_0xbd7c('0xa'));var sox=require(_0xbd7c('0xb'));var csv=require('to-csv');var ejs=require('ejs');var fs=require('fs');var _=require(_0xbd7c('0xc'));var squel=require(_0xbd7c('0xd'));var crypto=require(_0xbd7c('0xe'));var jsforce=require(_0xbd7c('0xf'));var deskjs=require(_0xbd7c('0x10'));var toCsv=require(_0xbd7c('0x11'));var querystring=require(_0xbd7c('0x12'));var Papa=require('papaparse');var Redis=require(_0xbd7c('0x13'));var authService=require(_0xbd7c('0x14'));var qs=require('../../components/parsers/qs');var as=require(_0xbd7c('0x15'));var hardwareService=require(_0xbd7c('0x16'));var logger=require('../../config/logger')(_0xbd7c('0x17'));var utils=require(_0xbd7c('0x18'));var config=require(_0xbd7c('0x19'));var db=require(_0xbd7c('0x1a'))['db'];function respondWithStatusCode(_0x2adc72,_0x2d8f4e){_0x2d8f4e=_0x2d8f4e||0xcc;return function(_0x3dc2f2){if(_0x3dc2f2){return _0x2adc72[_0xbd7c('0x1b')](_0x2d8f4e);}return _0x2adc72['status'](_0x2d8f4e)['end']();};}function respondWithResult(_0x594c22,_0x2d4cc3){_0x2d4cc3=_0x2d4cc3||0xc8;return function(_0x1f1abc){if(_0x1f1abc){return _0x594c22[_0xbd7c('0x1c')](_0x2d4cc3)[_0xbd7c('0x1d')](_0x1f1abc);}};}function respondWithFilteredResult(_0x2a2a2c,_0x5c86d1){return function(_0xf52d51){if(_0xf52d51){var _0x4cbe5e=_0xf52d51['count'],_0x3b647b=_0x5c86d1['offset'],_0x376539=_0x5c86d1['offset']+_0x5c86d1['limit'],_0x5a4ca4;if(_0x376539>=_0x4cbe5e){_0x376539=_0x4cbe5e;_0x5a4ca4=0xc8;}else{_0x5a4ca4=0xce;}_0x2a2a2c[_0xbd7c('0x1c')](_0x5a4ca4);return _0x2a2a2c[_0xbd7c('0x1e')](_0xbd7c('0x1f'),_0x3b647b+'-'+_0x376539+'/'+_0x4cbe5e)[_0xbd7c('0x1d')](_0xf52d51);}return null;};}function patchUpdates(_0x54f631){return function(_0x37cdeb){try{jsonpatch[_0xbd7c('0x20')](_0x37cdeb,_0x54f631,!![]);}catch(_0x1839ab){return BPromise['reject'](_0x1839ab);}return _0x37cdeb[_0xbd7c('0x21')]();};}function saveUpdates(_0x54cb8b,_0x2a0718){return function(_0x3b6711){if(_0x3b6711){return _0x3b6711[_0xbd7c('0x22')](_0x54cb8b)[_0xbd7c('0x23')](function(_0x8e7f4f){return _0x8e7f4f;});}return null;};}function removeEntity(_0x198d1b,_0x435ed3){return function(_0x53b3dc){if(_0x53b3dc){return _0x53b3dc[_0xbd7c('0x24')]()[_0xbd7c('0x23')](function(){_0x198d1b[_0xbd7c('0x1c')](0xcc)[_0xbd7c('0x25')]();});}};}function handleEntityNotFound(_0x399aaa,_0x31174c){return function(_0x5137af){if(!_0x5137af){_0x399aaa[_0xbd7c('0x1b')](0x194);}return _0x5137af;};}function handleError(_0x25e4a4,_0xbf4ac8){_0xbf4ac8=_0xbf4ac8||0x1f4;return function(_0x206985){logger[_0xbd7c('0x26')](_0x206985[_0xbd7c('0x27')]);if(_0x206985[_0xbd7c('0x28')]){delete _0x206985['name'];}_0x25e4a4[_0xbd7c('0x1c')](_0xbf4ac8)[_0xbd7c('0x29')](_0x206985);};}exports[_0xbd7c('0x2a')]=function(_0x5e5ce7,_0x50bb24){var _0x3648db={},_0x3cb260={},_0x5421a7={'count':0x0,'rows':[]};var _0x329272=_[_0xbd7c('0x2b')](db[_0xbd7c('0x2c')]['rawAttributes'],function(_0x3d3335){return{'name':_0x3d3335[_0xbd7c('0x2d')],'type':_0x3d3335[_0xbd7c('0x2e')][_0xbd7c('0x2f')]};});_0x3cb260[_0xbd7c('0x30')]=_[_0xbd7c('0x2b')](_0x329272,_0xbd7c('0x28'));_0x3cb260['query']=_[_0xbd7c('0x31')](_0x5e5ce7[_0xbd7c('0x32')]);_0x3cb260[_0xbd7c('0x33')]=_[_0xbd7c('0x34')](_0x3cb260[_0xbd7c('0x30')],_0x3cb260['query']);_0x3648db[_0xbd7c('0x35')]=_[_0xbd7c('0x34')](_0x3cb260['model'],qs['fields'](_0x5e5ce7['query'][_0xbd7c('0x36')]));_0x3648db[_0xbd7c('0x35')]=_0x3648db[_0xbd7c('0x35')]['length']?_0x3648db[_0xbd7c('0x35')]:_0x3cb260[_0xbd7c('0x30')];if(!_0x5e5ce7[_0xbd7c('0x32')][_0xbd7c('0x37')](_0xbd7c('0x38'))){_0x3648db[_0xbd7c('0x39')]=qs[_0xbd7c('0x39')](_0x5e5ce7['query'][_0xbd7c('0x39')]);_0x3648db[_0xbd7c('0x3a')]=qs['offset'](_0x5e5ce7[_0xbd7c('0x32')][_0xbd7c('0x3a')]);}_0x3648db['order']=qs['sort'](_0x5e5ce7[_0xbd7c('0x32')][_0xbd7c('0x3b')]);_0x3648db[_0xbd7c('0x3c')]=qs[_0xbd7c('0x33')](_[_0xbd7c('0x3d')](_0x5e5ce7[_0xbd7c('0x32')],_0x3cb260[_0xbd7c('0x33')]));if(_0x5e5ce7[_0xbd7c('0x32')][_0xbd7c('0x3e')]){_0x3648db[_0xbd7c('0x3c')]=_['merge'](_0x3648db[_0xbd7c('0x3c')],{'$or':_['map'](_0x329272,function(_0x4904db){if(_0x4904db[_0xbd7c('0x2e')]!=='VIRTUAL'){var _0x194d93={};_0x194d93[_0x4904db[_0xbd7c('0x28')]]={'$like':'%'+_0x5e5ce7[_0xbd7c('0x32')][_0xbd7c('0x3e')]+'%'};return _0x194d93;}})});}_0x3648db=_[_0xbd7c('0x3f')]({},_0x3648db,_0x5e5ce7['options']);var _0x20f9aa={'where':_0x3648db[_0xbd7c('0x3c')]};return db['ChatTransferReport'][_0xbd7c('0x40')](_0x20f9aa)['then'](function(_0xc70e53){_0x5421a7['count']=_0xc70e53;if(_0x5e5ce7[_0xbd7c('0x32')][_0xbd7c('0x41')]){_0x3648db[_0xbd7c('0x42')]=[{'all':!![]}];}return db[_0xbd7c('0x2c')][_0xbd7c('0x43')](_0x3648db);})[_0xbd7c('0x23')](function(_0x59b12c){_0x5421a7['rows']=_0x59b12c;return _0x5421a7;})['then'](respondWithFilteredResult(_0x50bb24,_0x3648db))[_0xbd7c('0x44')](handleError(_0x50bb24,null));};exports[_0xbd7c('0x45')]=function(_0x3bd567,_0x5d0f8d){var _0x30516f={'raw':!![],'where':{'id':_0x3bd567[_0xbd7c('0x46')]['id']}},_0x557e3a={};_0x557e3a[_0xbd7c('0x30')]=_['keys'](db[_0xbd7c('0x2c')][_0xbd7c('0x47')]);_0x557e3a[_0xbd7c('0x32')]=_[_0xbd7c('0x31')](_0x3bd567['query']);_0x557e3a[_0xbd7c('0x33')]=_[_0xbd7c('0x34')](_0x557e3a[_0xbd7c('0x30')],_0x557e3a['query']);_0x30516f[_0xbd7c('0x35')]=_['intersection'](_0x557e3a[_0xbd7c('0x30')],qs[_0xbd7c('0x36')](_0x3bd567[_0xbd7c('0x32')][_0xbd7c('0x36')]));_0x30516f[_0xbd7c('0x35')]=_0x30516f[_0xbd7c('0x35')]['length']?_0x30516f[_0xbd7c('0x35')]:_0x557e3a[_0xbd7c('0x30')];if(_0x3bd567['query'][_0xbd7c('0x41')]){_0x30516f[_0xbd7c('0x42')]=[{'all':!![]}];}_0x30516f=_['merge']({},_0x30516f,_0x3bd567['options']);return db[_0xbd7c('0x2c')][_0xbd7c('0x48')](_0x30516f)[_0xbd7c('0x23')](handleEntityNotFound(_0x5d0f8d,null))[_0xbd7c('0x23')](respondWithResult(_0x5d0f8d,null))[_0xbd7c('0x44')](handleError(_0x5d0f8d,null));};exports[_0xbd7c('0x49')]=function(_0xab51c9,_0x15c2da){return db[_0xbd7c('0x2c')][_0xbd7c('0x49')](_0xab51c9['body'],{})[_0xbd7c('0x23')](respondWithResult(_0x15c2da,0xc9))['catch'](handleError(_0x15c2da,null));};exports[_0xbd7c('0x22')]=function(_0x1a1373,_0x3fabe8){if(_0x1a1373[_0xbd7c('0x4a')]['id']){delete _0x1a1373[_0xbd7c('0x4a')]['id'];}return db[_0xbd7c('0x2c')][_0xbd7c('0x48')]({'where':{'id':_0x1a1373[_0xbd7c('0x46')]['id']}})[_0xbd7c('0x23')](handleEntityNotFound(_0x3fabe8,null))['then'](saveUpdates(_0x1a1373['body'],null))['then'](respondWithResult(_0x3fabe8,null))[_0xbd7c('0x44')](handleError(_0x3fabe8,null));};exports[_0xbd7c('0x24')]=function(_0x35df6d,_0x34bfe6){return db['ChatTransferReport'][_0xbd7c('0x48')]({'where':{'id':_0x35df6d[_0xbd7c('0x46')]['id']}})[_0xbd7c('0x23')](handleEntityNotFound(_0x34bfe6,null))[_0xbd7c('0x23')](removeEntity(_0x34bfe6,null))[_0xbd7c('0x44')](handleError(_0x34bfe6,null));};exports[_0xbd7c('0x4b')]=function(_0x4d8be2,_0x4dbf1c){return db['ChatTransferReport'][_0xbd7c('0x4b')]()['then'](respondWithResult(_0x4dbf1c,null))[_0xbd7c('0x44')](handleError(_0x4dbf1c,null));};
\ No newline at end of file
diff --git a/server/api/chatTransferReport/chatTransferReport.model.js b/server/api/chatTransferReport/chatTransferReport.model.js
index d579549..6cb56d3 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 _0x1a56=['report_chat_transfer','uniqueid','lodash','util','../../config/logger','api','moment','bluebird','request-promise','path','rimraf','../../config/environment','define'];(function(_0x31f182,_0x24fd4b){var _0x20edd2=function(_0x5a4d75){while(--_0x5a4d75){_0x31f182['push'](_0x31f182['shift']());}};_0x20edd2(++_0x24fd4b);}(_0x1a56,0x13a));var _0x61a5=function(_0x136a0d,_0x476fe2){_0x136a0d=_0x136a0d-0x0;var _0x212ea5=_0x1a56[_0x136a0d];return _0x212ea5;};'use strict';var _=require(_0x61a5('0x0'));var util=require(_0x61a5('0x1'));var logger=require(_0x61a5('0x2'))(_0x61a5('0x3'));var moment=require(_0x61a5('0x4'));var BPromise=require(_0x61a5('0x5'));var rp=require(_0x61a5('0x6'));var fs=require('fs');var path=require(_0x61a5('0x7'));var rimraf=require(_0x61a5('0x8'));var config=require(_0x61a5('0x9'));var attributes=require('./chatTransferReport.attributes');module['exports']=function(_0x2c27bd,_0x1b3c48){return _0x2c27bd[_0x61a5('0xa')]('ChatTransferReport',attributes,{'tableName':_0x61a5('0xb'),'paranoid':![],'indexes':[{'name':_0x61a5('0xc'),'fields':['uniqueid']}],'timestamps':!![]});};
\ No newline at end of file
+var _0xcdd1=['ChatTransferReport','uniqueid','lodash','util','../../config/logger','api','bluebird','request-promise','path','rimraf','./chatTransferReport.attributes','exports','define'];(function(_0x2235bf,_0x3a06a7){var _0x4c3a64=function(_0x3b3bb6){while(--_0x3b3bb6){_0x2235bf['push'](_0x2235bf['shift']());}};_0x4c3a64(++_0x3a06a7);}(_0xcdd1,0x13a));var _0x1cdd=function(_0xf89c3,_0x351bf1){_0xf89c3=_0xf89c3-0x0;var _0x274fc8=_0xcdd1[_0xf89c3];return _0x274fc8;};'use strict';var _=require(_0x1cdd('0x0'));var util=require(_0x1cdd('0x1'));var logger=require(_0x1cdd('0x2'))(_0x1cdd('0x3'));var moment=require('moment');var BPromise=require(_0x1cdd('0x4'));var rp=require(_0x1cdd('0x5'));var fs=require('fs');var path=require(_0x1cdd('0x6'));var rimraf=require(_0x1cdd('0x7'));var config=require('../../config/environment');var attributes=require(_0x1cdd('0x8'));module[_0x1cdd('0x9')]=function(_0x446477,_0x29a84a){return _0x446477[_0x1cdd('0xa')](_0x1cdd('0xb'),attributes,{'tableName':'report_chat_transfer','paranoid':![],'indexes':[{'name':_0x1cdd('0xc'),'fields':[_0x1cdd('0xc')]}],'timestamps':!![]});};
\ No newline at end of file
diff --git a/server/api/chatTransferReport/chatTransferReport.rpc.js b/server/api/chatTransferReport/chatTransferReport.rpc.js
index 9232be0..77990fb 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 _0x504a=['ChatTransferReport,\x20%s,\x20%s','request\x20sent','ChatTransferReport,\x20%s,\x20%s,\x20%s','stringify','error','code','message','result','catch','lodash','util','moment','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','../../config/environment','client','http','request','info'];(function(_0x68ee8b,_0x3cc6c5){var _0x5148f7=function(_0x5dcbd5){while(--_0x5dcbd5){_0x68ee8b['push'](_0x68ee8b['shift']());}};_0x5148f7(++_0x3cc6c5);}(_0x504a,0x17f));var _0xa504=function(_0x190264,_0x448e6e){_0x190264=_0x190264-0x0;var _0x490b1f=_0x504a[_0x190264];return _0x490b1f;};'use strict';var _=require(_0xa504('0x0'));var util=require(_0xa504('0x1'));var moment=require(_0xa504('0x2'));var BPromise=require('bluebird');var rs=require(_0xa504('0x3'));var fs=require('fs');var Redis=require(_0xa504('0x4'));var db=require(_0xa504('0x5'))['db'];var utils=require(_0xa504('0x6'));var logger=require(_0xa504('0x7'))('rpc');var config=require(_0xa504('0x8'));var jayson=require('jayson/promise');var client=jayson[_0xa504('0x9')][_0xa504('0xa')]({'port':0x232a});function respondWithRpcPromise(_0x113f14,_0x577d34,_0x14b3b2){return new BPromise(function(_0x1a0230,_0x1ececa){return client[_0xa504('0xb')](_0x113f14,_0x14b3b2)['then'](function(_0x5053d8){logger[_0xa504('0xc')](_0xa504('0xd'),_0x577d34,_0xa504('0xe'));logger['debug'](_0xa504('0xf'),_0x577d34,_0xa504('0xe'),JSON[_0xa504('0x10')](_0x5053d8));if(_0x5053d8[_0xa504('0x11')]){if(_0x5053d8[_0xa504('0x11')][_0xa504('0x12')]===0x1f4){logger['error'](_0xa504('0xd'),_0x577d34,_0x5053d8['error'][_0xa504('0x13')]);return _0x1ececa(_0x5053d8['error'][_0xa504('0x13')]);}logger[_0xa504('0x11')]('ChatTransferReport,\x20%s,\x20%s',_0x577d34,_0x5053d8[_0xa504('0x11')][_0xa504('0x13')]);return _0x1a0230(_0x5053d8['error']['message']);}else{logger[_0xa504('0xc')](_0xa504('0xd'),_0x577d34,_0xa504('0xe'));_0x1a0230(_0x5053d8[_0xa504('0x14')][_0xa504('0x13')]);}})[_0xa504('0x15')](function(_0x14aaf4){logger['error'](_0xa504('0xd'),_0x577d34,_0x14aaf4);_0x1ececa(_0x14aaf4);});});}
\ No newline at end of file
+var _0x06e3=['../../config/utils','../../config/logger','jayson/promise','client','http','request','info','ChatTransferReport,\x20%s,\x20%s','request\x20sent','debug','ChatTransferReport,\x20%s,\x20%s,\x20%s','error','message','result','catch','util','moment','bluebird','randomstring','ioredis','../../mysqldb'];(function(_0x1ef90c,_0x23ab1d){var _0x5caeab=function(_0x15a652){while(--_0x15a652){_0x1ef90c['push'](_0x1ef90c['shift']());}};_0x5caeab(++_0x23ab1d);}(_0x06e3,0x1b3));var _0x306e=function(_0x5abd58,_0xbf13b8){_0x5abd58=_0x5abd58-0x0;var _0x32171f=_0x06e3[_0x5abd58];return _0x32171f;};'use strict';var _=require('lodash');var util=require(_0x306e('0x0'));var moment=require(_0x306e('0x1'));var BPromise=require(_0x306e('0x2'));var rs=require(_0x306e('0x3'));var fs=require('fs');var Redis=require(_0x306e('0x4'));var db=require(_0x306e('0x5'))['db'];var utils=require(_0x306e('0x6'));var logger=require(_0x306e('0x7'))('rpc');var config=require('../../config/environment');var jayson=require(_0x306e('0x8'));var client=jayson[_0x306e('0x9')][_0x306e('0xa')]({'port':0x232a});function respondWithRpcPromise(_0x51f70a,_0x25d9ca,_0x1b46c4){return new BPromise(function(_0x19d0cc,_0x5dacf3){return client[_0x306e('0xb')](_0x51f70a,_0x1b46c4)['then'](function(_0x478252){logger[_0x306e('0xc')](_0x306e('0xd'),_0x25d9ca,_0x306e('0xe'));logger[_0x306e('0xf')](_0x306e('0x10'),_0x25d9ca,_0x306e('0xe'),JSON['stringify'](_0x478252));if(_0x478252[_0x306e('0x11')]){if(_0x478252[_0x306e('0x11')]['code']===0x1f4){logger[_0x306e('0x11')](_0x306e('0xd'),_0x25d9ca,_0x478252[_0x306e('0x11')][_0x306e('0x12')]);return _0x5dacf3(_0x478252[_0x306e('0x11')][_0x306e('0x12')]);}logger['error'](_0x306e('0xd'),_0x25d9ca,_0x478252['error'][_0x306e('0x12')]);return _0x19d0cc(_0x478252[_0x306e('0x11')][_0x306e('0x12')]);}else{logger[_0x306e('0xc')]('ChatTransferReport,\x20%s,\x20%s',_0x25d9ca,'request\x20sent');_0x19d0cc(_0x478252[_0x306e('0x13')][_0x306e('0x12')]);}})[_0x306e('0x14')](function(_0x350cc9){logger[_0x306e('0x11')](_0x306e('0xd'),_0x25d9ca,_0x350cc9);_0x5dacf3(_0x350cc9);});});}
\ No newline at end of file
diff --git a/server/api/chatTransferReport/index.js b/server/api/chatTransferReport/index.js
index 8b2e6fb..8fd4dcc 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 _0x5f66=['describe','get','/:id','show','create','put','delete','destroy','util','connect-timeout','express','Router','../../components/auth/service','../../components/interaction/service','./chatTransferReport.controller','isAuthenticated','index'];(function(_0xd09668,_0x1435b2){var _0x68726=function(_0x54a030){while(--_0x54a030){_0xd09668['push'](_0xd09668['shift']());}};_0x68726(++_0x1435b2);}(_0x5f66,0x1a0));var _0x65f6=function(_0x580576,_0x2f107d){_0x580576=_0x580576-0x0;var _0x3f55a0=_0x5f66[_0x580576];return _0x3f55a0;};'use strict';var multer=require('multer');var util=require(_0x65f6('0x0'));var path=require('path');var timeout=require(_0x65f6('0x1'));var express=require(_0x65f6('0x2'));var router=express[_0x65f6('0x3')]();var auth=require(_0x65f6('0x4'));var interaction=require(_0x65f6('0x5'));var config=require('../../config/environment');var controller=require(_0x65f6('0x6'));router['get']('/',auth[_0x65f6('0x7')](),controller[_0x65f6('0x8')]);router['get']('/describe',auth[_0x65f6('0x7')](),controller[_0x65f6('0x9')]);router[_0x65f6('0xa')](_0x65f6('0xb'),auth[_0x65f6('0x7')](),controller[_0x65f6('0xc')]);router['post']('/',auth['isAuthenticated'](),controller[_0x65f6('0xd')]);router[_0x65f6('0xe')](_0x65f6('0xb'),auth[_0x65f6('0x7')](),controller['update']);router[_0x65f6('0xf')]('/:id',auth['isAuthenticated'](),controller[_0x65f6('0x10')]);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(_0x14add3,_0x13ce8d){var _0x4a174f=function(_0x2b3ed7){while(--_0x2b3ed7){_0x14add3['push'](_0x14add3['shift']());}};_0x4a174f(++_0x13ce8d);}(_0xbaf0,0x12a));var _0x0baf=function(_0x14add3,_0x13ce8d){_0x14add3=_0x14add3-0x0;var _0x4a174f=_0xbaf0[_0x14add3];return _0x4a174f;};'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 218002f..bf16812 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 _0xad31=['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','#fafafa','System','Status\x20to\x20put\x20when\x20mandatory\x20disposition\x20is\x20enabled','mandatoryDispositionPauseId','sequelize','randomstring','exports','STRING','address','email','Agent','#9f946a','#ffffff','INTEGER','BOOLEAN','ENUM','rounded','squared','We\x20are\x20here!','Send','Contact\x20us','Do\x20you\x20want\x20to\x20close\x20the\x20interaction?','Form\x20properly\x20submitted','Form\x20submission\x20error','Type\x20a\x20message','Skip','Feedback','stringify','input','name','text','getDataValue','onlineForm','parse','setDataValue','TEXT','textarea','Comments','Leave\x20your\x20comments','offlineForm','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.'];(function(_0x286354,_0x128be5){var _0x30fe4d=function(_0x18ae00){while(--_0x18ae00){_0x286354['push'](_0x286354['shift']());}};_0x30fe4d(++_0x128be5);}(_0xad31,0x1ba));var _0x1ad3=function(_0x2a63d9,_0x3a683a){_0x2a63d9=_0x2a63d9-0x0;var _0xd6254a=_0xad31[_0x2a63d9];return _0xd6254a;};'use strict';var Sequelize=require(_0x1ad3('0x0'));var rs=require(_0x1ad3('0x1'));module[_0x1ad3('0x2')]={'name':{'type':Sequelize[_0x1ad3('0x3')],'allowNull':![]},'address':{'type':Sequelize['STRING'],'allowNull':![],'unique':_0x1ad3('0x4')},'description':{'type':Sequelize[_0x1ad3('0x3')]},'mapKey':{'type':Sequelize['STRING'],'defaultValue':_0x1ad3('0x5')},'mapKeyOffline':{'type':Sequelize[_0x1ad3('0x3')],'defaultValue':'email'},'key':{'type':Sequelize[_0x1ad3('0x3')],'allowNull':![]},'agentAlias':{'type':Sequelize[_0x1ad3('0x3')],'defaultValue':_0x1ad3('0x6')},'customerAlias':{'type':Sequelize[_0x1ad3('0x3')],'defaultValue':'Me'},'color':{'type':Sequelize['STRING'],'allowNull':![],'defaultValue':_0x1ad3('0x7'),'validate':{'notEmpty':!![]}},'color_button':{'type':Sequelize['STRING'],'allowNull':![],'defaultValue':_0x1ad3('0x7'),'validate':{'notEmpty':!![]}},'textColor':{'type':Sequelize[_0x1ad3('0x3')],'allowNull':![],'defaultValue':_0x1ad3('0x8'),'validate':{'notEmpty':!![]}},'fontSize':{'type':Sequelize[_0x1ad3('0x9')],'defaultValue':0xf},'remote':{'type':Sequelize['STRING']},'animation':{'type':Sequelize[_0x1ad3('0xa')],'defaultValue':!![]},'header_shape':{'type':Sequelize[_0x1ad3('0xb')](_0x1ad3('0xc'),_0x1ad3('0xd')),'defaultValue':_0x1ad3('0xc')},'header_online':{'type':Sequelize[_0x1ad3('0x3')],'defaultValue':_0x1ad3('0xe')},'start_chat_button':{'type':Sequelize['STRING'],'defaultValue':'Chat'},'offline_chat_button':{'type':Sequelize[_0x1ad3('0x3')],'defaultValue':_0x1ad3('0xf')},'header_offline':{'type':Sequelize[_0x1ad3('0x3')],'defaultValue':_0x1ad3('0x10')},'download_transcript':{'type':Sequelize[_0x1ad3('0xa')],'defaultValue':!![]},'timeout':{'type':Sequelize['INTEGER'],'defaultValue':0x0},'whiteLabel':{'type':Sequelize['STRING'],'defaultValue':'Powered\x20by\x20xCALLY'},'defaultWhiteLabel':{'type':Sequelize['BOOLEAN'],'defaultValue':!![]},'sitepic':{'type':Sequelize['TEXT']},'closingQuestion':{'type':Sequelize[_0x1ad3('0x3')],'defaultValue':_0x1ad3('0x11')},'formSubmitSuccessMessage':{'type':Sequelize[_0x1ad3('0x3')],'defaultValue':_0x1ad3('0x12')},'formSubmitFailureMessage':{'type':Sequelize[_0x1ad3('0x3')],'defaultValue':_0x1ad3('0x13')},'noteTitle':{'type':Sequelize['STRING'],'defaultValue':'Note'},'placeholderMessage':{'type':Sequelize[_0x1ad3('0x3')],'defaultValue':_0x1ad3('0x14')},'closingMessage':{'type':Sequelize['STRING'],'defaultValue':'Thanks\x20you\x20for\x20your\x20time!'},'closingMessageButton':{'type':Sequelize[_0x1ad3('0x3')],'defaultValue':'Send'},'skipMessageButton':{'type':Sequelize[_0x1ad3('0x3')],'defaultValue':_0x1ad3('0x15')},'conditionAgreement':{'type':Sequelize[_0x1ad3('0xa')],'defaultValue':![]},'enableRating':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'enableFeedback':{'type':Sequelize[_0x1ad3('0xa')],'defaultValue':![]},'enableSendButton':{'type':Sequelize[_0x1ad3('0xa')],'defaultValue':![]},'feedbackTitle':{'type':Sequelize['STRING'],'defaultValue':_0x1ad3('0x16')},'ratingType':{'type':Sequelize[_0x1ad3('0xb')]('star','thumb'),'defaultValue':'star'},'ratingStarsNumber':{'type':Sequelize['INTEGER'],'defaultValue':0x5},'onlineForm':{'type':Sequelize['TEXT'],'defaultValue':function(){return JSON[_0x1ad3('0x17')]({'items':[{'type':_0x1ad3('0x18'),'variable':null,'config':{'placeholder':_0x1ad3('0x19'),'type':_0x1ad3('0x1a'),'required':!![]},'props':{'title':'name','helpText':''}},{'type':'input','props':{'title':_0x1ad3('0x5'),'helpText':''},'config':{'required':!![],'placeholder':_0x1ad3('0x5'),'type':_0x1ad3('0x5')},'variable':null}],'fromKey':0x1});},'get':function(){return this[_0x1ad3('0x1b')](_0x1ad3('0x1c'))?JSON[_0x1ad3('0x1d')](this[_0x1ad3('0x1b')](_0x1ad3('0x1c'))):{};},'set':function(_0x56f47c){return this[_0x1ad3('0x1e')]('onlineForm',JSON['stringify'](_0x56f47c));}},'offlineForm':{'type':Sequelize[_0x1ad3('0x1f')],'defaultValue':function(){return JSON[_0x1ad3('0x17')]({'items':[{'type':'input','props':{'title':_0x1ad3('0x5'),'helpText':''},'config':{'required':!![],'placeholder':_0x1ad3('0x5'),'type':_0x1ad3('0x5')},'variable':null},{'type':_0x1ad3('0x20'),'config':{'placeholder':_0x1ad3('0x21')},'props':{'title':'Comments','helpText':_0x1ad3('0x22')}}],'fromKey':0x0});},'get':function(){return this[_0x1ad3('0x1b')]('offlineForm')?JSON['parse'](this[_0x1ad3('0x1b')](_0x1ad3('0x23'))):{};},'set':function(_0x4be1c6){return this[_0x1ad3('0x1e')](_0x1ad3('0x23'),JSON[_0x1ad3('0x17')](_0x4be1c6));}},'token':{'type':Sequelize[_0x1ad3('0x3')],'defaultValue':function(){return rs['generate']();}},'autoclose':{'type':Sequelize['BOOLEAN'],'defaultValue':!![]},'enableCustomerWriting':{'type':Sequelize[_0x1ad3('0xa')],'defaultValue':![]},'forwardTranscript':{'type':Sequelize[_0x1ad3('0xa')],'defaultValue':![]},'forwardTranscriptMessage':{'type':Sequelize['STRING']},'forwardOffline':{'type':Sequelize[_0x1ad3('0xa')],'defaultValue':![]},'forwardOfflineAddress':{'type':Sequelize['STRING']},'waitingTitle':{'type':Sequelize[_0x1ad3('0x3')],'defaultValue':_0x1ad3('0x24')},'waitingMessage':{'type':Sequelize[_0x1ad3('0x3')],'defaultValue':_0x1ad3('0x25')},'offlineMessageSubject':{'type':Sequelize[_0x1ad3('0x3')],'defaultValue':_0x1ad3('0x26')},'offlineMessageBody':{'type':Sequelize[_0x1ad3('0x3')],'defaultValue':_0x1ad3('0x27')},'enableUnmanagedNote':{'type':Sequelize[_0x1ad3('0xa')],'defaultValue':!![]},'unmanagedMessage':{'type':Sequelize[_0x1ad3('0x3')],'defaultValue':_0x1ad3('0x28')},'skipUnmanaged':{'type':Sequelize[_0x1ad3('0x3')],'defaultValue':_0x1ad3('0x15')},'sendUnmanaged':{'type':Sequelize[_0x1ad3('0x3')],'defaultValue':'Send'},'enableCustomerAttachment':{'type':Sequelize[_0x1ad3('0xa')],'defaultValue':![]},'enableCustomerCheckmarks':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'agentAvatar':{'type':Sequelize['TEXT']},'showAgentAvatar':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'timezone':{'type':Sequelize[_0x1ad3('0x3')]},'notificationTemplate':{'type':Sequelize['TEXT'],'defaultValue':function(){return _0x1ad3('0x29');}},'notificationSound':{'type':Sequelize[_0x1ad3('0xa')],'defaultValue':!![]},'notificationShake':{'type':Sequelize[_0x1ad3('0xa')],'defaultValue':![]},'hideWhenOffline':{'type':Sequelize[_0x1ad3('0xa')],'defaultValue':![]},'agentIdentifier':{'type':Sequelize[_0x1ad3('0x3')],'defaultValue':_0x1ad3('0x2a')},'waitForTheAssignedAgent':{'type':Sequelize[_0x1ad3('0x9')],'validate':{'min':0x1,'max':0x20c49b},'defaultValue':0xa},'alignment':{'type':Sequelize[_0x1ad3('0x3')],'defaultValue':_0x1ad3('0x2b')},'verticalAlignment':{'type':Sequelize[_0x1ad3('0x9')],'defaultValue':0x1e},'messagesAlignment':{'type':Sequelize[_0x1ad3('0x3')],'defaultValue':'alternate'},'defaultTitle':{'type':Sequelize[_0x1ad3('0x3')]},'customerAvatar':{'type':Sequelize[_0x1ad3('0x1f')]},'showCustomerAvatar':{'type':Sequelize[_0x1ad3('0xa')],'defaultValue':![]},'messageFontSize':{'type':Sequelize['INTEGER'],'defaultValue':0xc},'backgroundColor':{'type':Sequelize['STRING'],'allowNull':![],'defaultValue':_0x1ad3('0x2c'),'validate':{'notEmpty':!![]}},'queueTransfer':{'type':Sequelize[_0x1ad3('0xa')],'defaultValue':![]},'queueTransferTimeout':{'type':Sequelize[_0x1ad3('0x9')],'validate':{'min':0x1,'max':0x20c49b},'defaultValue':0x12c},'agentTransfer':{'type':Sequelize[_0x1ad3('0xa')],'defaultValue':![]},'agentTransferTimeout':{'type':Sequelize['INTEGER'],'validate':{'min':0x1,'max':0x20c49b},'defaultValue':0x12c},'systemAlias':{'type':Sequelize[_0x1ad3('0x3')],'defaultValue':_0x1ad3('0x2d')},'systemAvatar':{'type':Sequelize['TEXT']},'mandatoryDispositionPauseId':{'type':Sequelize['INTEGER'],'comment':_0x1ad3('0x2e')},'mandatoryDisposition':{'type':Sequelize[_0x1ad3('0xa')],'defaultValue':![],'comment':'Enabled/disables\x20mandatory\x20dispo\x20on\x20a\x20queue','set':function(_0x1b381b){if(!_0x1b381b)this[_0x1ad3('0x1e')](_0x1ad3('0x2f'),null);this[_0x1ad3('0x1e')]('mandatoryDisposition',_0x1b381b);}}};
\ No newline at end of file
+var _0xfeab=['#9f946a','#ffffff','BOOLEAN','ENUM','squared','rounded','We\x20are\x20here!','Send','Contact\x20us','INTEGER','Powered\x20by\x20xCALLY','TEXT','Form\x20properly\x20submitted','Form\x20submission\x20error','Note','Type\x20a\x20message','Thanks\x20you\x20for\x20your\x20time!','Skip','Feedback','star','thumb','input','name','text','getDataValue','onlineForm','parse','stringify','Comments','Leave\x20your\x20comments','offlineForm','setDataValue','generate','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','alternate','#fafafa','System','Status\x20to\x20put\x20when\x20mandatory\x20disposition\x20is\x20enabled','mandatoryDispositionPauseId','mandatoryDisposition','exports','STRING','address','email'];(function(_0x3f4f3b,_0x2d7be2){var _0xfc6f02=function(_0x226ae2){while(--_0x226ae2){_0x3f4f3b['push'](_0x3f4f3b['shift']());}};_0xfc6f02(++_0x2d7be2);}(_0xfeab,0x184));var _0xbfea=function(_0x5b48be,_0x2edd73){_0x5b48be=_0x5b48be-0x0;var _0x4c586d=_0xfeab[_0x5b48be];return _0x4c586d;};'use strict';var Sequelize=require('sequelize');var rs=require('randomstring');module[_0xbfea('0x0')]={'name':{'type':Sequelize[_0xbfea('0x1')],'allowNull':![]},'address':{'type':Sequelize[_0xbfea('0x1')],'allowNull':![],'unique':_0xbfea('0x2')},'description':{'type':Sequelize['STRING']},'mapKey':{'type':Sequelize[_0xbfea('0x1')],'defaultValue':_0xbfea('0x3')},'mapKeyOffline':{'type':Sequelize[_0xbfea('0x1')],'defaultValue':_0xbfea('0x3')},'key':{'type':Sequelize['STRING'],'allowNull':![]},'agentAlias':{'type':Sequelize[_0xbfea('0x1')],'defaultValue':'Agent'},'customerAlias':{'type':Sequelize[_0xbfea('0x1')],'defaultValue':'Me'},'color':{'type':Sequelize['STRING'],'allowNull':![],'defaultValue':_0xbfea('0x4'),'validate':{'notEmpty':!![]}},'color_button':{'type':Sequelize[_0xbfea('0x1')],'allowNull':![],'defaultValue':_0xbfea('0x4'),'validate':{'notEmpty':!![]}},'textColor':{'type':Sequelize[_0xbfea('0x1')],'allowNull':![],'defaultValue':_0xbfea('0x5'),'validate':{'notEmpty':!![]}},'fontSize':{'type':Sequelize['INTEGER'],'defaultValue':0xf},'remote':{'type':Sequelize['STRING']},'animation':{'type':Sequelize[_0xbfea('0x6')],'defaultValue':!![]},'header_shape':{'type':Sequelize[_0xbfea('0x7')]('rounded',_0xbfea('0x8')),'defaultValue':_0xbfea('0x9')},'header_online':{'type':Sequelize[_0xbfea('0x1')],'defaultValue':_0xbfea('0xa')},'start_chat_button':{'type':Sequelize['STRING'],'defaultValue':'Chat'},'offline_chat_button':{'type':Sequelize[_0xbfea('0x1')],'defaultValue':_0xbfea('0xb')},'header_offline':{'type':Sequelize['STRING'],'defaultValue':_0xbfea('0xc')},'download_transcript':{'type':Sequelize['BOOLEAN'],'defaultValue':!![]},'timeout':{'type':Sequelize[_0xbfea('0xd')],'defaultValue':0x0},'whiteLabel':{'type':Sequelize[_0xbfea('0x1')],'defaultValue':_0xbfea('0xe')},'defaultWhiteLabel':{'type':Sequelize[_0xbfea('0x6')],'defaultValue':!![]},'sitepic':{'type':Sequelize[_0xbfea('0xf')]},'closingQuestion':{'type':Sequelize[_0xbfea('0x1')],'defaultValue':'Do\x20you\x20want\x20to\x20close\x20the\x20interaction?'},'formSubmitSuccessMessage':{'type':Sequelize[_0xbfea('0x1')],'defaultValue':_0xbfea('0x10')},'formSubmitFailureMessage':{'type':Sequelize[_0xbfea('0x1')],'defaultValue':_0xbfea('0x11')},'noteTitle':{'type':Sequelize[_0xbfea('0x1')],'defaultValue':_0xbfea('0x12')},'placeholderMessage':{'type':Sequelize[_0xbfea('0x1')],'defaultValue':_0xbfea('0x13')},'closingMessage':{'type':Sequelize[_0xbfea('0x1')],'defaultValue':_0xbfea('0x14')},'closingMessageButton':{'type':Sequelize[_0xbfea('0x1')],'defaultValue':_0xbfea('0xb')},'skipMessageButton':{'type':Sequelize[_0xbfea('0x1')],'defaultValue':_0xbfea('0x15')},'conditionAgreement':{'type':Sequelize[_0xbfea('0x6')],'defaultValue':![]},'enableRating':{'type':Sequelize[_0xbfea('0x6')],'defaultValue':![]},'enableFeedback':{'type':Sequelize[_0xbfea('0x6')],'defaultValue':![]},'enableSendButton':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'feedbackTitle':{'type':Sequelize['STRING'],'defaultValue':_0xbfea('0x16')},'ratingType':{'type':Sequelize['ENUM'](_0xbfea('0x17'),_0xbfea('0x18')),'defaultValue':_0xbfea('0x17')},'ratingStarsNumber':{'type':Sequelize[_0xbfea('0xd')],'defaultValue':0x5},'onlineForm':{'type':Sequelize[_0xbfea('0xf')],'defaultValue':function(){return JSON['stringify']({'items':[{'type':_0xbfea('0x19'),'variable':null,'config':{'placeholder':_0xbfea('0x1a'),'type':_0xbfea('0x1b'),'required':!![]},'props':{'title':_0xbfea('0x1a'),'helpText':''}},{'type':_0xbfea('0x19'),'props':{'title':'email','helpText':''},'config':{'required':!![],'placeholder':_0xbfea('0x3'),'type':_0xbfea('0x3')},'variable':null}],'fromKey':0x1});},'get':function(){return this[_0xbfea('0x1c')](_0xbfea('0x1d'))?JSON[_0xbfea('0x1e')](this[_0xbfea('0x1c')](_0xbfea('0x1d'))):{};},'set':function(_0x4e7fb8){return this['setDataValue'](_0xbfea('0x1d'),JSON[_0xbfea('0x1f')](_0x4e7fb8));}},'offlineForm':{'type':Sequelize[_0xbfea('0xf')],'defaultValue':function(){return JSON[_0xbfea('0x1f')]({'items':[{'type':_0xbfea('0x19'),'props':{'title':'email','helpText':''},'config':{'required':!![],'placeholder':_0xbfea('0x3'),'type':'email'},'variable':null},{'type':'textarea','config':{'placeholder':_0xbfea('0x20')},'props':{'title':_0xbfea('0x20'),'helpText':_0xbfea('0x21')}}],'fromKey':0x0});},'get':function(){return this[_0xbfea('0x1c')](_0xbfea('0x22'))?JSON['parse'](this[_0xbfea('0x1c')](_0xbfea('0x22'))):{};},'set':function(_0x55cdd0){return this[_0xbfea('0x23')](_0xbfea('0x22'),JSON['stringify'](_0x55cdd0));}},'token':{'type':Sequelize[_0xbfea('0x1')],'defaultValue':function(){return rs[_0xbfea('0x24')]();}},'autoclose':{'type':Sequelize[_0xbfea('0x6')],'defaultValue':!![]},'enableCustomerWriting':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'forwardTranscript':{'type':Sequelize[_0xbfea('0x6')],'defaultValue':![]},'forwardTranscriptMessage':{'type':Sequelize[_0xbfea('0x1')]},'forwardOffline':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'forwardOfflineAddress':{'type':Sequelize[_0xbfea('0x1')]},'waitingTitle':{'type':Sequelize[_0xbfea('0x1')],'defaultValue':'All\x20of\x20our\x20agents\x20are\x20busy\x20at\x20this\x20time.\x20Your\x20chat\x20is\x20very\x20important\x20to\x20us.'},'waitingMessage':{'type':Sequelize[_0xbfea('0x1')],'defaultValue':'Please\x20hold\x20and\x20we\x20will\x20answer\x20your\x20request\x20as\x20soon\x20as\x20possible.'},'offlineMessageSubject':{'type':Sequelize[_0xbfea('0x1')],'defaultValue':_0xbfea('0x25')},'offlineMessageBody':{'type':Sequelize[_0xbfea('0x1')],'defaultValue':_0xbfea('0x26')},'enableUnmanagedNote':{'type':Sequelize[_0xbfea('0x6')],'defaultValue':!![]},'unmanagedMessage':{'type':Sequelize['STRING'],'defaultValue':_0xbfea('0x27')},'skipUnmanaged':{'type':Sequelize[_0xbfea('0x1')],'defaultValue':_0xbfea('0x15')},'sendUnmanaged':{'type':Sequelize[_0xbfea('0x1')],'defaultValue':'Send'},'enableCustomerAttachment':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'enableCustomerCheckmarks':{'type':Sequelize[_0xbfea('0x6')],'defaultValue':![]},'agentAvatar':{'type':Sequelize['TEXT']},'showAgentAvatar':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'timezone':{'type':Sequelize[_0xbfea('0x1')]},'notificationTemplate':{'type':Sequelize['TEXT'],'defaultValue':function(){return _0xbfea('0x28');}},'notificationSound':{'type':Sequelize[_0xbfea('0x6')],'defaultValue':!![]},'notificationShake':{'type':Sequelize[_0xbfea('0x6')],'defaultValue':![]},'hideWhenOffline':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'agentIdentifier':{'type':Sequelize[_0xbfea('0x1')],'defaultValue':_0xbfea('0x29')},'waitForTheAssignedAgent':{'type':Sequelize[_0xbfea('0xd')],'validate':{'min':0x1,'max':0x20c49b},'defaultValue':0xa},'alignment':{'type':Sequelize[_0xbfea('0x1')],'defaultValue':_0xbfea('0x2a')},'verticalAlignment':{'type':Sequelize[_0xbfea('0xd')],'defaultValue':0x1e},'messagesAlignment':{'type':Sequelize[_0xbfea('0x1')],'defaultValue':_0xbfea('0x2b')},'defaultTitle':{'type':Sequelize[_0xbfea('0x1')]},'customerAvatar':{'type':Sequelize[_0xbfea('0xf')]},'showCustomerAvatar':{'type':Sequelize[_0xbfea('0x6')],'defaultValue':![]},'messageFontSize':{'type':Sequelize[_0xbfea('0xd')],'defaultValue':0xc},'backgroundColor':{'type':Sequelize['STRING'],'allowNull':![],'defaultValue':_0xbfea('0x2c'),'validate':{'notEmpty':!![]}},'queueTransfer':{'type':Sequelize[_0xbfea('0x6')],'defaultValue':![]},'queueTransferTimeout':{'type':Sequelize[_0xbfea('0xd')],'validate':{'min':0x1,'max':0x20c49b},'defaultValue':0x12c},'agentTransfer':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'agentTransferTimeout':{'type':Sequelize[_0xbfea('0xd')],'validate':{'min':0x1,'max':0x20c49b},'defaultValue':0x12c},'systemAlias':{'type':Sequelize['STRING'],'defaultValue':_0xbfea('0x2d')},'systemAvatar':{'type':Sequelize[_0xbfea('0xf')]},'mandatoryDispositionPauseId':{'type':Sequelize[_0xbfea('0xd')],'comment':_0xbfea('0x2e')},'mandatoryDisposition':{'type':Sequelize[_0xbfea('0x6')],'defaultValue':![],'comment':'Enabled/disables\x20mandatory\x20dispo\x20on\x20a\x20queue','set':function(_0x576c32){if(!_0x576c32)this[_0xbfea('0x23')](_0xbfea('0x2f'),null);this[_0xbfea('0x23')](_0xbfea('0x30'),_0x576c32);}}};
\ No newline at end of file
diff --git a/server/api/chatWebsite/chatWebsite.controller.js b/server/api/chatWebsite/chatWebsite.controller.js
index 74b335f..7d6071b 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 _0xc7c0=['list','orderBy','asc','contact','customerIp','headers','cf-connecting-ip','x-forwarded-for','first','split','firstName','lastName','x-real-port','browser','version','format','%s\x20%s','unknown','device','%s\x20%s\x20%s','vendor','threadId','ChatInteraction','externalUrl','ContactId','interaction','messageId','push','unmanaged','*,*,*,*','ChatMessage','AttachmentId','UserId','User','agent','startRouting','Start','EventManager','from\x20is\x20mandatory','mapKeyOffline\x20is\x20mandatory,\x20please\x20use\x20one\x20of\x20these:\x20','mapKeyOffline','findOrCreate','spread','server/files/templates/chatOfflineMessage.ejs','utf8','render','toPairs','offlineMessageBody','ChatOfflineMessage','Smtp','service','host','port','secure','authentication','auth','SendMail','sendMail','\x22%s\x22\x20<%s>','offlineMessageSubject','addInteraction','omit','Contact','Owner','fullname','internal','Tag','Tags','color','tag','getSnippet','timezone','iftime\x20%s,%s','interval','iftime\x20%s','[%s][INTERVAL][%s]\x20%s\x20%s\x20(%s)','OFFLINE','No\x20timezone','inspect','Interval','Intervals','getLicense','virtual','increment','chatLicenseExceeded','all','some','server/files/chat/iframe.js','x-real-ip','connection','referer','alignment','verticalAlignment','textColor','addApplications','sequelize','transaction','bulkCreate','findAndCountAll','priority','getApplications','addProactiveActions','chatProactiveAction','getProactiveActions','ChatProactiveAction','getFields','online','offlineForm','onlineForm','items','fromKey','getOfflineMessages','addAgents','emit','userChatWebsite:save','removeAgents','isArray','userChatWebsite:remove','getAgents','html-pdf','eml-format','rimraf','zip-dir','fast-json-patch','mustache','util','ejs','lodash','squel','crypto','jsforce','desk.js','to-csv','querystring','papaparse','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/environment','../../mysqldb','redis','defaults','localhost','socket.io-emitter','./chatWebsite.socket','register','jayson/promise','client','http','test','Sequelize','The\x20password\x20must\x20be\x20at\x20least\x208\x20characters\x20long\x20and\x20have\x201\x20lowercase\x20character,\x201\x20uppercase\x20character,\x201\x20number\x20and\x201\x20special\x20character\x20~!@#$%^&-_=+[{]}.','request','then','info','ChatWebsite,\x20%s,\x20%s','request\x20sent','debug','ChatWebsite,\x20%s,\x20%s,\x20%s','stringify','error','message','result','catch','sendStatus','status','json','count','offset','limit','set','Content-Range','apply','reject','save','update','destroy','get','UserProfileResource','stack','name','send','index','mandatoryDispositionPause','map','ChatWebsite','rawAttributes','fieldName','key','query','keys','filters','intersection','model','attributes','fields','length','hasOwnProperty','nolimit','sort','pick','filter','where','merge','type','options','includeAll','include','findAll','show','params','find','create','body','user','Unable\x20to\x20retrieve\x20the\x20current\x20user','role','ChatWebsites','userProfileId','autoAssociation','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','Pause','describe','addDisposition','ChatWebsiteId','getDispositions','findOne','Disposition','order','rows','removeDispositions','ids','addAnswer','CannedAnswer','getAnswers','removeAnswers','sitepic','file','filename','addAvatar','agentAvatar','addCustomerAvatar','customerAvatar','addSystemAvatar','join','root','../../config/license/util','custom','existsSync','server/files/images/logos/','getAvatar','server/files/images/avatars/default_avatar.png','isNil','server/files/images/avatars/','getCustomerAvatar','server/files/images/avatars/customer_avatar.png','showCustomerAvatar','download','systemAvatar','user-agent-parser','setUA','user-agent','getResult','chat','CmContact','ValidationError','no\x20available\x20attributes','difference','createdAt','updatedAt','CompanyId','ListId','from','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','List','Contacts','DESC','ChatApplication','Applications','account','applications'];(function(_0x4e2394,_0x1cccb8){var _0xfbcb97=function(_0x5e016b){while(--_0x5e016b){_0x4e2394['push'](_0x4e2394['shift']());}};_0xfbcb97(++_0x1cccb8);}(_0xc7c0,0x197));var _0x0c7c=function(_0x1b1071,_0x17800f){_0x1b1071=_0x1b1071-0x0;var _0x263a17=_0xc7c0[_0x1b1071];return _0x263a17;};'use strict';var pdf=require(_0x0c7c('0x0'));var emlformat=require(_0x0c7c('0x1'));var rimraf=require(_0x0c7c('0x2'));var zipdir=require(_0x0c7c('0x3'));var jsonpatch=require(_0x0c7c('0x4'));var rp=require('request-promise');var moment=require('moment');var BPromise=require('bluebird');var Mustache=require(_0x0c7c('0x5'));var util=require(_0x0c7c('0x6'));var path=require('path');var sox=require('sox');var csv=require('to-csv');var ejs=require(_0x0c7c('0x7'));var fs=require('fs');var _=require(_0x0c7c('0x8'));var squel=require(_0x0c7c('0x9'));var crypto=require(_0x0c7c('0xa'));var jsforce=require(_0x0c7c('0xb'));var deskjs=require(_0x0c7c('0xc'));var toCsv=require(_0x0c7c('0xd'));var querystring=require(_0x0c7c('0xe'));var Papa=require(_0x0c7c('0xf'));var Redis=require('ioredis');var authService=require(_0x0c7c('0x10'));var qs=require(_0x0c7c('0x11'));var as=require(_0x0c7c('0x12'));var hardwareService=require(_0x0c7c('0x13'));var logger=require(_0x0c7c('0x14'))(_0x0c7c('0x15'));var utils=require('../../config/utils');var config=require(_0x0c7c('0x16'));var db=require(_0x0c7c('0x17'))['db'];config[_0x0c7c('0x18')]=_[_0x0c7c('0x19')](config['redis'],{'host':_0x0c7c('0x1a'),'port':0x18eb});var socket=require(_0x0c7c('0x1b'))(new Redis(config[_0x0c7c('0x18')]));require(_0x0c7c('0x1c'))[_0x0c7c('0x1d')](socket);var jayson=require(_0x0c7c('0x1e'));var client=jayson['client']['http']({'port':0x232c});var client9002=jayson[_0x0c7c('0x1f')]['http']({'port':0x232a});var client9003=jayson[_0x0c7c('0x1f')][_0x0c7c('0x20')]({'port':0x232b});function checkPasswordPattern(_0x124432,_0x16ee96,_0x413e7c){if(_0x413e7c){var _0x7477ab=new RegExp(/(?=.*[a-z])(?=.*[A-Z])(?=.*[0-9])(?=.*[?!@#\$%\^&\*~\-_=+[{\]\}])(?=.{8,})/);if(_0x7477ab[_0x0c7c('0x21')](_0x16ee96)){return _0x124432;}else{throw new db[(_0x0c7c('0x22'))]['ValidationError'](_0x0c7c('0x23'));}}else{return _0x124432;}}function respondWithRpcPromise(_0x3efad3,_0x108da4,_0x110ed0,_0x8df43d){return new BPromise(function(_0x4cedc9,_0x1e0eac){var _0x19f9d9=_0x8df43d||client;return _0x19f9d9[_0x0c7c('0x24')](_0x3efad3,_0x110ed0)[_0x0c7c('0x25')](function(_0x49e253){logger[_0x0c7c('0x26')](_0x0c7c('0x27'),_0x108da4,_0x0c7c('0x28'));logger[_0x0c7c('0x29')](_0x0c7c('0x2a'),_0x108da4,'request\x20sent',JSON[_0x0c7c('0x2b')](_0x49e253));if(_0x49e253[_0x0c7c('0x2c')]){if(_0x49e253['error']['code']===0x1f4){logger[_0x0c7c('0x2c')](_0x0c7c('0x27'),_0x108da4,_0x49e253['error'][_0x0c7c('0x2d')]);return _0x1e0eac(_0x49e253[_0x0c7c('0x2c')][_0x0c7c('0x2d')]);}logger['error'](_0x0c7c('0x27'),_0x108da4,_0x49e253[_0x0c7c('0x2c')][_0x0c7c('0x2d')]);return _0x4cedc9(_0x49e253[_0x0c7c('0x2c')][_0x0c7c('0x2d')]);}else{logger[_0x0c7c('0x26')](_0x0c7c('0x27'),_0x108da4,_0x0c7c('0x28'));_0x4cedc9(_0x49e253[_0x0c7c('0x2e')][_0x0c7c('0x2d')]);}})[_0x0c7c('0x2f')](function(_0x2e053d){logger[_0x0c7c('0x2c')](_0x0c7c('0x27'),_0x108da4,_0x2e053d);_0x1e0eac(_0x2e053d);});});}function respondWithStatusCode(_0x143660,_0x3f6532){_0x3f6532=_0x3f6532||0xcc;return function(_0x1204d1){if(_0x1204d1){return _0x143660[_0x0c7c('0x30')](_0x3f6532);}return _0x143660['status'](_0x3f6532)['end']();};}function respondWithResult(_0x30d3af,_0x171911){_0x171911=_0x171911||0xc8;return function(_0x18b590){if(_0x18b590){return _0x30d3af[_0x0c7c('0x31')](_0x171911)[_0x0c7c('0x32')](_0x18b590);}};}function respondWithFilteredResult(_0x39e605,_0x203d69){return function(_0x24d92e){if(_0x24d92e){var _0x111140=_0x24d92e[_0x0c7c('0x33')],_0x1eed0d=_0x203d69[_0x0c7c('0x34')],_0x3ff944=_0x203d69[_0x0c7c('0x34')]+_0x203d69[_0x0c7c('0x35')],_0x3859d9;if(_0x3ff944>=_0x111140){_0x3ff944=_0x111140;_0x3859d9=0xc8;}else{_0x3859d9=0xce;}_0x39e605[_0x0c7c('0x31')](_0x3859d9);return _0x39e605[_0x0c7c('0x36')](_0x0c7c('0x37'),_0x1eed0d+'-'+_0x3ff944+'/'+_0x111140)[_0x0c7c('0x32')](_0x24d92e);}return null;};}function patchUpdates(_0x4d28dc){return function(_0x3a47dd){try{jsonpatch[_0x0c7c('0x38')](_0x3a47dd,_0x4d28dc,!![]);}catch(_0x443ead){return BPromise[_0x0c7c('0x39')](_0x443ead);}return _0x3a47dd[_0x0c7c('0x3a')]();};}function saveUpdates(_0x48a16a,_0xa9ef85){return function(_0x35dab7){if(_0x35dab7){return _0x35dab7[_0x0c7c('0x3b')](_0x48a16a)['then'](function(_0x2a5fd6){return _0x2a5fd6;});}return null;};}function removeEntity(_0x46623c,_0xd40819){return function(_0x4e2f5c){if(_0x4e2f5c){return _0x4e2f5c[_0x0c7c('0x3c')]()[_0x0c7c('0x25')](function(){var _0x355500=_0x4e2f5c[_0x0c7c('0x3d')]({'plain':!![]});var _0x5b6355='ChatWebsites';return db[_0x0c7c('0x3e')][_0x0c7c('0x3c')]({'where':{'type':_0x5b6355,'resourceId':_0x355500['id']}})['then'](function(){return _0x4e2f5c;});})[_0x0c7c('0x25')](function(){_0x46623c[_0x0c7c('0x31')](0xcc)['end']();});}};}function handleEntityNotFound(_0x172f26,_0x517396){return function(_0x3c69ad){if(!_0x3c69ad){_0x172f26[_0x0c7c('0x30')](0x194);}return _0x3c69ad;};}function handleError(_0x12c4d2,_0x546c5a){_0x546c5a=_0x546c5a||0x1f4;return function(_0x18ab3e){logger[_0x0c7c('0x2c')](_0x18ab3e[_0x0c7c('0x3f')]);if(_0x18ab3e[_0x0c7c('0x40')]){delete _0x18ab3e[_0x0c7c('0x40')];}_0x12c4d2[_0x0c7c('0x31')](_0x546c5a)[_0x0c7c('0x41')](_0x18ab3e);};}exports[_0x0c7c('0x42')]=function(_0x3181cb,_0xf07ef1){var _0x5ebcec={'include':[{'model':db['Pause'],'as':_0x0c7c('0x43')}]},_0x388f2b={},_0x49b92a={'count':0x0,'rows':[]};var _0x256c17=_[_0x0c7c('0x44')](db[_0x0c7c('0x45')][_0x0c7c('0x46')],function(_0x5ca552){return{'name':_0x5ca552[_0x0c7c('0x47')],'type':_0x5ca552['type'][_0x0c7c('0x48')]};});_0x388f2b['model']=_[_0x0c7c('0x44')](_0x256c17,'name');_0x388f2b[_0x0c7c('0x49')]=_[_0x0c7c('0x4a')](_0x3181cb[_0x0c7c('0x49')]);_0x388f2b[_0x0c7c('0x4b')]=_[_0x0c7c('0x4c')](_0x388f2b[_0x0c7c('0x4d')],_0x388f2b[_0x0c7c('0x49')]);_0x5ebcec[_0x0c7c('0x4e')]=_[_0x0c7c('0x4c')](_0x388f2b['model'],qs[_0x0c7c('0x4f')](_0x3181cb['query'][_0x0c7c('0x4f')]));_0x5ebcec[_0x0c7c('0x4e')]=_0x5ebcec[_0x0c7c('0x4e')][_0x0c7c('0x50')]?_0x5ebcec[_0x0c7c('0x4e')]:_0x388f2b[_0x0c7c('0x4d')];if(!_0x3181cb[_0x0c7c('0x49')][_0x0c7c('0x51')](_0x0c7c('0x52'))){_0x5ebcec[_0x0c7c('0x35')]=qs[_0x0c7c('0x35')](_0x3181cb[_0x0c7c('0x49')][_0x0c7c('0x35')]);_0x5ebcec[_0x0c7c('0x34')]=qs[_0x0c7c('0x34')](_0x3181cb[_0x0c7c('0x49')][_0x0c7c('0x34')]);}_0x5ebcec['order']=qs[_0x0c7c('0x53')](_0x3181cb[_0x0c7c('0x49')][_0x0c7c('0x53')]);_0x5ebcec['where']=qs[_0x0c7c('0x4b')](_[_0x0c7c('0x54')](_0x3181cb[_0x0c7c('0x49')],_0x388f2b[_0x0c7c('0x4b')]));if(_0x3181cb['query'][_0x0c7c('0x55')]){_0x5ebcec[_0x0c7c('0x56')]=_[_0x0c7c('0x57')](_0x5ebcec[_0x0c7c('0x56')],{'$or':_['map'](_0x256c17,function(_0x55234a){if(_0x55234a[_0x0c7c('0x58')]!=='VIRTUAL'){var _0x5a15d7={};_0x5a15d7[_0x55234a[_0x0c7c('0x40')]]={'$like':'%'+_0x3181cb['query'][_0x0c7c('0x55')]+'%'};return _0x5a15d7;}})});}_0x5ebcec=_['merge']({},_0x5ebcec,_0x3181cb[_0x0c7c('0x59')]);var _0x3c27d7={'where':_0x5ebcec['where']};return db['ChatWebsite'][_0x0c7c('0x33')](_0x3c27d7)[_0x0c7c('0x25')](function(_0x546a81){_0x49b92a[_0x0c7c('0x33')]=_0x546a81;if(_0x3181cb[_0x0c7c('0x49')][_0x0c7c('0x5a')]){_0x5ebcec[_0x0c7c('0x5b')]=[{'all':!![]}];}return db['ChatWebsite'][_0x0c7c('0x5c')](_0x5ebcec);})['then'](function(_0x3a75a7){_0x49b92a['rows']=_0x3a75a7;return _0x49b92a;})[_0x0c7c('0x25')](respondWithFilteredResult(_0xf07ef1,_0x5ebcec))['catch'](handleError(_0xf07ef1,null));};exports[_0x0c7c('0x5d')]=function(_0x3bae06,_0x1c4e45){var _0x453e5e={'raw':![],'where':{'id':_0x3bae06[_0x0c7c('0x5e')]['id']},'include':[{'model':db['Pause'],'as':'mandatoryDispositionPause'}]},_0xe51e7c={};_0xe51e7c['model']=_['keys'](db[_0x0c7c('0x45')][_0x0c7c('0x46')]);_0xe51e7c[_0x0c7c('0x49')]=_['keys'](_0x3bae06['query']);_0xe51e7c[_0x0c7c('0x4b')]=_['intersection'](_0xe51e7c[_0x0c7c('0x4d')],_0xe51e7c['query']);_0x453e5e['attributes']=_[_0x0c7c('0x4c')](_0xe51e7c['model'],qs['fields'](_0x3bae06[_0x0c7c('0x49')][_0x0c7c('0x4f')]));_0x453e5e[_0x0c7c('0x4e')]=_0x453e5e[_0x0c7c('0x4e')][_0x0c7c('0x50')]?_0x453e5e[_0x0c7c('0x4e')]:_0xe51e7c[_0x0c7c('0x4d')];if(_0x3bae06[_0x0c7c('0x49')]['includeAll']){_0x453e5e[_0x0c7c('0x5b')]=[{'all':!![]}];}_0x453e5e=_[_0x0c7c('0x57')]({},_0x453e5e,_0x3bae06[_0x0c7c('0x59')]);return db[_0x0c7c('0x45')][_0x0c7c('0x5f')](_0x453e5e)[_0x0c7c('0x25')](handleEntityNotFound(_0x1c4e45,null))[_0x0c7c('0x25')](respondWithResult(_0x1c4e45,null))['catch'](handleError(_0x1c4e45,null));};exports[_0x0c7c('0x60')]=function(_0x35f259,_0x17f8a7){return db[_0x0c7c('0x45')][_0x0c7c('0x60')](_0x35f259[_0x0c7c('0x61')],{})[_0x0c7c('0x25')](function(_0x5e0f91){var _0x3a6c90=_0x35f259[_0x0c7c('0x62')][_0x0c7c('0x3d')]({'plain':!![]});if(!_0x3a6c90)throw new Error(_0x0c7c('0x63'));if(_0x3a6c90[_0x0c7c('0x64')]==='user'){var _0x1e67c3=_0x5e0f91[_0x0c7c('0x3d')]({'plain':!![]});var _0x2d6a7e=_0x0c7c('0x65');return db['UserProfileSection'][_0x0c7c('0x5f')]({'where':{'name':_0x2d6a7e,'userProfileId':_0x3a6c90[_0x0c7c('0x66')]},'raw':!![]})['then'](function(_0x7efd04){if(_0x7efd04&&_0x7efd04[_0x0c7c('0x67')]===0x0){return db[_0x0c7c('0x3e')][_0x0c7c('0x60')]({'name':_0x1e67c3['name'],'resourceId':_0x1e67c3['id'],'type':_0x7efd04['name'],'sectionId':_0x7efd04['id']},{})[_0x0c7c('0x25')](function(){return _0x5e0f91;});}else{return _0x5e0f91;}})[_0x0c7c('0x2f')](function(_0x55d1bc){logger[_0x0c7c('0x2c')](_0x0c7c('0x68'),_0x55d1bc);throw _0x55d1bc;});}return _0x5e0f91;})[_0x0c7c('0x25')](respondWithResult(_0x17f8a7,0xc9))[_0x0c7c('0x2f')](handleError(_0x17f8a7,null));};exports[_0x0c7c('0x3b')]=function(_0x17d9cb,_0x4eadb4){if(_0x17d9cb['body']['id']){delete _0x17d9cb[_0x0c7c('0x61')]['id'];}return db[_0x0c7c('0x45')][_0x0c7c('0x5f')]({'where':{'id':_0x17d9cb[_0x0c7c('0x5e')]['id']},'include':[{'model':db[_0x0c7c('0x69')],'as':'mandatoryDispositionPause'}]})[_0x0c7c('0x25')](handleEntityNotFound(_0x4eadb4,null))['then'](saveUpdates(_0x17d9cb[_0x0c7c('0x61')],null))[_0x0c7c('0x25')](respondWithResult(_0x4eadb4,null))[_0x0c7c('0x2f')](handleError(_0x4eadb4,null));};exports[_0x0c7c('0x3c')]=function(_0x403609,_0x51362a){return db[_0x0c7c('0x45')][_0x0c7c('0x5f')]({'where':{'id':_0x403609[_0x0c7c('0x5e')]['id']}})[_0x0c7c('0x25')](handleEntityNotFound(_0x51362a,null))[_0x0c7c('0x25')](removeEntity(_0x51362a,null))[_0x0c7c('0x2f')](handleError(_0x51362a,null));};exports[_0x0c7c('0x6a')]=function(_0x35d877,_0x3e140d){return db[_0x0c7c('0x45')][_0x0c7c('0x6a')]()['then'](respondWithResult(_0x3e140d,null))['catch'](handleError(_0x3e140d,null));};exports[_0x0c7c('0x6b')]=function(_0x1095dc,_0x34f02c,_0x191b2e){if(_0x1095dc[_0x0c7c('0x61')]['id']){delete _0x1095dc[_0x0c7c('0x61')]['id'];}return db[_0x0c7c('0x45')][_0x0c7c('0x5f')]({'where':{'id':_0x1095dc[_0x0c7c('0x5e')]['id']}})[_0x0c7c('0x25')](handleEntityNotFound(_0x34f02c,null))[_0x0c7c('0x25')](function(_0x3980ae){if(_0x3980ae){_0x1095dc[_0x0c7c('0x61')][_0x0c7c('0x6c')]=_0x3980ae['id'];return db['Disposition'][_0x0c7c('0x60')](_0x1095dc[_0x0c7c('0x61')]);}})[_0x0c7c('0x25')](respondWithResult(_0x34f02c,null))[_0x0c7c('0x2f')](handleError(_0x34f02c,null));};exports[_0x0c7c('0x6d')]=function(_0x136dd3,_0x4709f9,_0x1b62f1){var _0x1742ce={'raw':![],'where':{}};var _0xd8f6df={};var _0x43d9b1={'count':0x0,'rows':[]};return db[_0x0c7c('0x45')][_0x0c7c('0x6e')]({'where':{'id':_0x136dd3[_0x0c7c('0x5e')]['id']}})['then'](handleEntityNotFound(_0x4709f9,null))[_0x0c7c('0x25')](function(_0x1afc52){if(_0x1afc52){_0xd8f6df[_0x0c7c('0x4d')]=_[_0x0c7c('0x4a')](db[_0x0c7c('0x6f')][_0x0c7c('0x46')]);_0xd8f6df[_0x0c7c('0x49')]=_[_0x0c7c('0x4a')](_0x136dd3[_0x0c7c('0x49')]);_0xd8f6df[_0x0c7c('0x4b')]=_[_0x0c7c('0x4c')](_0xd8f6df[_0x0c7c('0x4d')],_0xd8f6df[_0x0c7c('0x49')]);_0x1742ce[_0x0c7c('0x4e')]=_['intersection'](_0xd8f6df[_0x0c7c('0x4d')],qs[_0x0c7c('0x4f')](_0x136dd3['query']['fields']));_0x1742ce['attributes']=_0x1742ce['attributes'][_0x0c7c('0x50')]?_0x1742ce[_0x0c7c('0x4e')]:_0xd8f6df[_0x0c7c('0x4d')];if(!_0x136dd3[_0x0c7c('0x49')][_0x0c7c('0x51')](_0x0c7c('0x52'))){_0x1742ce[_0x0c7c('0x35')]=qs[_0x0c7c('0x35')](_0x136dd3[_0x0c7c('0x49')]['limit']);_0x1742ce[_0x0c7c('0x34')]=qs[_0x0c7c('0x34')](_0x136dd3['query'][_0x0c7c('0x34')]);}_0x1742ce[_0x0c7c('0x70')]=qs[_0x0c7c('0x53')](_0x136dd3[_0x0c7c('0x49')][_0x0c7c('0x53')]);_0x1742ce[_0x0c7c('0x56')]=qs[_0x0c7c('0x4b')](_[_0x0c7c('0x54')](_0x136dd3[_0x0c7c('0x49')],_0xd8f6df[_0x0c7c('0x4b')]));_0x1742ce[_0x0c7c('0x56')][_0x0c7c('0x6c')]=_0x1afc52['id'];if(_0x136dd3['query'][_0x0c7c('0x55')]){_0x1742ce[_0x0c7c('0x56')]=_[_0x0c7c('0x57')](_0x1742ce['where'],{'$or':_[_0x0c7c('0x44')](_0x1742ce[_0x0c7c('0x4e')],function(_0x5debe7){var _0x447b96={};_0x447b96[_0x5debe7]={'$like':'%'+_0x136dd3[_0x0c7c('0x49')][_0x0c7c('0x55')]+'%'};return _0x447b96;})});}_0x1742ce=_[_0x0c7c('0x57')]({},_0x1742ce,_0x136dd3[_0x0c7c('0x59')]);return db['Disposition'][_0x0c7c('0x33')]({'where':_0x1742ce[_0x0c7c('0x56')]})[_0x0c7c('0x25')](function(_0x303b30){_0x43d9b1[_0x0c7c('0x33')]=_0x303b30;if(_0x136dd3[_0x0c7c('0x49')][_0x0c7c('0x5a')]){_0x1742ce[_0x0c7c('0x5b')]=[{'all':!![]}];}return db['Disposition']['findAll'](_0x1742ce);})[_0x0c7c('0x25')](function(_0x2f49f9){_0x43d9b1[_0x0c7c('0x71')]=_0x2f49f9;return _0x43d9b1;});}})[_0x0c7c('0x25')](respondWithFilteredResult(_0x4709f9,_0x1742ce))[_0x0c7c('0x2f')](handleError(_0x4709f9,null));};exports[_0x0c7c('0x72')]=function(_0x3d56b3,_0x3cbb97,_0x585a77){return db[_0x0c7c('0x45')][_0x0c7c('0x5f')]({'where':{'id':_0x3d56b3[_0x0c7c('0x5e')]['id']}})[_0x0c7c('0x25')](handleEntityNotFound(_0x3cbb97,null))[_0x0c7c('0x25')](function(_0x4d2b4a){if(_0x4d2b4a){return _0x4d2b4a[_0x0c7c('0x72')](_0x3d56b3[_0x0c7c('0x49')][_0x0c7c('0x73')]);}})[_0x0c7c('0x25')](respondWithStatusCode(_0x3cbb97,null))[_0x0c7c('0x2f')](handleError(_0x3cbb97,null));};exports[_0x0c7c('0x74')]=function(_0x3ea629,_0x56fe4a,_0x5a456d){if(_0x3ea629[_0x0c7c('0x61')]['id']){delete _0x3ea629[_0x0c7c('0x61')]['id'];}return db[_0x0c7c('0x45')][_0x0c7c('0x5f')]({'where':{'id':_0x3ea629[_0x0c7c('0x5e')]['id']}})[_0x0c7c('0x25')](handleEntityNotFound(_0x56fe4a,null))[_0x0c7c('0x25')](function(_0x59d954){if(_0x59d954){_0x3ea629[_0x0c7c('0x61')][_0x0c7c('0x6c')]=_0x59d954['id'];return db[_0x0c7c('0x75')][_0x0c7c('0x60')](_0x3ea629[_0x0c7c('0x61')]);}})[_0x0c7c('0x25')](respondWithResult(_0x56fe4a,null))['catch'](handleError(_0x56fe4a,null));};exports[_0x0c7c('0x76')]=function(_0x4cb311,_0x2a32d6,_0x4fee88){var _0x2502b6={'raw':![],'where':{}};var _0x9e89a6={};var _0xa58b95={'count':0x0,'rows':[]};return db[_0x0c7c('0x45')][_0x0c7c('0x6e')]({'where':{'id':_0x4cb311['params']['id']}})[_0x0c7c('0x25')](handleEntityNotFound(_0x2a32d6,null))['then'](function(_0x4177d6){if(_0x4177d6){_0x9e89a6[_0x0c7c('0x4d')]=_[_0x0c7c('0x4a')](db['CannedAnswer']['rawAttributes']);_0x9e89a6[_0x0c7c('0x49')]=_[_0x0c7c('0x4a')](_0x4cb311[_0x0c7c('0x49')]);_0x9e89a6[_0x0c7c('0x4b')]=_[_0x0c7c('0x4c')](_0x9e89a6[_0x0c7c('0x4d')],_0x9e89a6[_0x0c7c('0x49')]);_0x2502b6[_0x0c7c('0x4e')]=_['intersection'](_0x9e89a6[_0x0c7c('0x4d')],qs['fields'](_0x4cb311[_0x0c7c('0x49')][_0x0c7c('0x4f')]));_0x2502b6['attributes']=_0x2502b6[_0x0c7c('0x4e')]['length']?_0x2502b6[_0x0c7c('0x4e')]:_0x9e89a6[_0x0c7c('0x4d')];if(!_0x4cb311[_0x0c7c('0x49')][_0x0c7c('0x51')](_0x0c7c('0x52'))){_0x2502b6['limit']=qs[_0x0c7c('0x35')](_0x4cb311['query'][_0x0c7c('0x35')]);_0x2502b6[_0x0c7c('0x34')]=qs['offset'](_0x4cb311[_0x0c7c('0x49')][_0x0c7c('0x34')]);}_0x2502b6[_0x0c7c('0x70')]=qs[_0x0c7c('0x53')](_0x4cb311[_0x0c7c('0x49')][_0x0c7c('0x53')]);_0x2502b6[_0x0c7c('0x56')]=qs[_0x0c7c('0x4b')](_['pick'](_0x4cb311[_0x0c7c('0x49')],_0x9e89a6['filters']));_0x2502b6[_0x0c7c('0x56')][_0x0c7c('0x6c')]=_0x4177d6['id'];if(_0x4cb311[_0x0c7c('0x49')][_0x0c7c('0x55')]){_0x2502b6['where']=_[_0x0c7c('0x57')](_0x2502b6[_0x0c7c('0x56')],{'$or':_['map'](_0x2502b6[_0x0c7c('0x4e')],function(_0x167511){var _0x21e8b5={};_0x21e8b5[_0x167511]={'$like':'%'+_0x4cb311['query'][_0x0c7c('0x55')]+'%'};return _0x21e8b5;})});}_0x2502b6=_[_0x0c7c('0x57')]({},_0x2502b6,_0x4cb311[_0x0c7c('0x59')]);return db[_0x0c7c('0x75')][_0x0c7c('0x33')]({'where':_0x2502b6[_0x0c7c('0x56')]})[_0x0c7c('0x25')](function(_0x36efac){_0xa58b95[_0x0c7c('0x33')]=_0x36efac;if(_0x4cb311['query']['includeAll']){_0x2502b6[_0x0c7c('0x5b')]=[{'all':!![]}];}return db['CannedAnswer'][_0x0c7c('0x5c')](_0x2502b6);})[_0x0c7c('0x25')](function(_0x255b74){_0xa58b95['rows']=_0x255b74;return _0xa58b95;});}})[_0x0c7c('0x25')](respondWithFilteredResult(_0x2a32d6,_0x2502b6))['catch'](handleError(_0x2a32d6,null));};exports[_0x0c7c('0x77')]=function(_0x389ad5,_0x44a6ec,_0x1b6e39){return db[_0x0c7c('0x45')][_0x0c7c('0x5f')]({'where':{'id':_0x389ad5[_0x0c7c('0x5e')]['id']}})['then'](handleEntityNotFound(_0x44a6ec,null))[_0x0c7c('0x25')](function(_0x50e65c){if(_0x50e65c){return _0x50e65c[_0x0c7c('0x77')](_0x389ad5[_0x0c7c('0x49')][_0x0c7c('0x73')]);}})[_0x0c7c('0x25')](respondWithStatusCode(_0x44a6ec,null))['catch'](handleError(_0x44a6ec,null));};exports['addLogo']=function(_0x514213,_0x263981,_0x519b51){_0x514213[_0x0c7c('0x61')][_0x0c7c('0x78')]=_0x514213[_0x0c7c('0x79')][_0x0c7c('0x7a')];return db[_0x0c7c('0x45')]['find']({'where':{'id':_0x514213['params']['id']}})[_0x0c7c('0x25')](handleEntityNotFound(_0x263981,null))['then'](saveUpdates(_0x514213[_0x0c7c('0x61')],null))['then'](respondWithResult(_0x263981,null))[_0x0c7c('0x2f')](handleError(_0x263981,null));};exports[_0x0c7c('0x7b')]=function(_0x5d5d6b,_0xd0052,_0x230d98){_0x5d5d6b[_0x0c7c('0x61')][_0x0c7c('0x7c')]=_0x5d5d6b[_0x0c7c('0x79')][_0x0c7c('0x7a')];return db['ChatWebsite']['find']({'where':{'id':_0x5d5d6b[_0x0c7c('0x5e')]['id']}})[_0x0c7c('0x25')](handleEntityNotFound(_0xd0052,null))[_0x0c7c('0x25')](saveUpdates(_0x5d5d6b[_0x0c7c('0x61')],null))[_0x0c7c('0x25')](respondWithResult(_0xd0052,null))[_0x0c7c('0x2f')](handleError(_0xd0052,null));};exports[_0x0c7c('0x7d')]=function(_0x33fbd8,_0x133e6c,_0x396b47){_0x33fbd8[_0x0c7c('0x61')][_0x0c7c('0x7e')]=_0x33fbd8[_0x0c7c('0x79')][_0x0c7c('0x7a')];return db[_0x0c7c('0x45')][_0x0c7c('0x5f')]({'where':{'id':_0x33fbd8['params']['id']}})[_0x0c7c('0x25')](handleEntityNotFound(_0x133e6c,null))[_0x0c7c('0x25')](saveUpdates(_0x33fbd8[_0x0c7c('0x61')],null))['then'](respondWithResult(_0x133e6c,null))[_0x0c7c('0x2f')](handleError(_0x133e6c,null));};exports[_0x0c7c('0x7f')]=function(_0x13a923,_0x44a5af,_0x5b3095){_0x13a923[_0x0c7c('0x61')]['systemAvatar']=_0x13a923['file'][_0x0c7c('0x7a')];return db[_0x0c7c('0x45')][_0x0c7c('0x5f')]({'where':{'id':_0x13a923[_0x0c7c('0x5e')]['id']}})[_0x0c7c('0x25')](handleEntityNotFound(_0x44a5af,null))[_0x0c7c('0x25')](saveUpdates(_0x13a923[_0x0c7c('0x61')],null))[_0x0c7c('0x25')](respondWithResult(_0x44a5af,null))['catch'](handleError(_0x44a5af,null));};exports['getLogo']=function(_0x345500,_0x45b928,_0x4a7dc9){var _0x442608=path[_0x0c7c('0x80')](config[_0x0c7c('0x81')],'server/files/images/logos/default_logo.png');var _0x2ef170={'where':{'id':_0x345500[_0x0c7c('0x5e')]['id']},'attributes':['id','sitepic'],'raw':!![]};var _0x300668=![];return require(_0x0c7c('0x82'))['getLicense']()[_0x0c7c('0x25')](function(_0x4d2a13){if(_0x4d2a13){_0x300668=_0x4d2a13[_0x0c7c('0x83')];}})[_0x0c7c('0x25')](function(){return db[_0x0c7c('0x45')][_0x0c7c('0x5f')](_0x2ef170);})[_0x0c7c('0x25')](handleEntityNotFound(_0x45b928,null))['then'](function(_0x2f5a39){if(_0x2f5a39){if(!_['isNil'](_0x2f5a39[_0x0c7c('0x78')])){if(fs[_0x0c7c('0x84')](path['join'](config[_0x0c7c('0x81')],_0x0c7c('0x85'),_0x2f5a39[_0x0c7c('0x78')]))&&_0x300668){_0x442608=path[_0x0c7c('0x80')](config[_0x0c7c('0x81')],'server/files/images/logos/',_0x2f5a39[_0x0c7c('0x78')]);}}return _0x45b928['download'](_0x442608);}})['catch'](handleError(_0x45b928,null));};exports[_0x0c7c('0x86')]=function(_0x359f56,_0x3fdbae,_0x4b76d9){var _0x9b70fc=path['join'](config[_0x0c7c('0x81')],_0x0c7c('0x87'));var _0x4a9cca={'where':{'id':_0x359f56[_0x0c7c('0x5e')]['id']},'attributes':['id','agentAvatar'],'raw':!![]};return db[_0x0c7c('0x45')][_0x0c7c('0x5f')](_0x4a9cca)[_0x0c7c('0x25')](handleEntityNotFound(_0x3fdbae,null))[_0x0c7c('0x25')](function(_0x5a5cff){if(_0x5a5cff){if(!_[_0x0c7c('0x88')](_0x5a5cff[_0x0c7c('0x7c')])){if(fs[_0x0c7c('0x84')](path[_0x0c7c('0x80')](config['root'],_0x0c7c('0x89'),_0x5a5cff[_0x0c7c('0x7c')]))){_0x9b70fc=path[_0x0c7c('0x80')](config['root'],_0x0c7c('0x89'),_0x5a5cff[_0x0c7c('0x7c')]);}}return _0x3fdbae['download'](_0x9b70fc);}})['catch'](handleError(_0x3fdbae,null));};exports[_0x0c7c('0x8a')]=function(_0x1758b1,_0x4270c0,_0x593f74){var _0x5ed357=path['join'](config[_0x0c7c('0x81')],_0x0c7c('0x8b'));var _0x26a3bd={'where':{'id':_0x1758b1[_0x0c7c('0x5e')]['id']},'attributes':['id',_0x0c7c('0x7e'),'showCustomerAvatar'],'raw':!![]};return db[_0x0c7c('0x45')]['find'](_0x26a3bd)[_0x0c7c('0x25')](handleEntityNotFound(_0x4270c0,null))[_0x0c7c('0x25')](function(_0x4538b6){if(_0x4538b6){if(!_[_0x0c7c('0x88')](_0x4538b6[_0x0c7c('0x7e')])){if(fs['existsSync'](path[_0x0c7c('0x80')](config[_0x0c7c('0x81')],_0x0c7c('0x89'),_0x4538b6[_0x0c7c('0x7e')]))&&_0x4538b6[_0x0c7c('0x8c')]){_0x5ed357=path['join'](config['root'],'server/files/images/avatars/',_0x4538b6[_0x0c7c('0x7e')]);}}return _0x4270c0[_0x0c7c('0x8d')](_0x5ed357);}})['catch'](handleError(_0x4270c0,null));};exports['getSystemAvatar']=function(_0x14e99f,_0x3b3b6c,_0x45674d){var _0x57bcc5=path['join'](config[_0x0c7c('0x81')],'server/files/images/avatars/system_avatar.png');var _0x5ef3e3={'where':{'id':_0x14e99f['params']['id']},'attributes':['id',_0x0c7c('0x8e')],'raw':!![]};return db[_0x0c7c('0x45')][_0x0c7c('0x5f')](_0x5ef3e3)[_0x0c7c('0x25')](handleEntityNotFound(_0x3b3b6c,null))[_0x0c7c('0x25')](function(_0x3aad88){if(_0x3aad88){if(!_[_0x0c7c('0x88')](_0x3aad88[_0x0c7c('0x8e')])){if(fs[_0x0c7c('0x84')](path[_0x0c7c('0x80')](config[_0x0c7c('0x81')],_0x0c7c('0x89'),_0x3aad88['systemAvatar']))){_0x57bcc5=path[_0x0c7c('0x80')](config[_0x0c7c('0x81')],_0x0c7c('0x89'),_0x3aad88[_0x0c7c('0x8e')]);}}return _0x3b3b6c[_0x0c7c('0x8d')](_0x57bcc5);}})[_0x0c7c('0x2f')](handleError(_0x3b3b6c,null));};exports['notify']=function(_0x38b22c,_0x4152c5,_0x2a9840){var _0x2cd115=require(_0x0c7c('0x8f'));var _0x25321f=new _0x2cd115();var _0x4b66c9=_0x25321f[_0x0c7c('0x90')](_0x38b22c['headers'][_0x0c7c('0x91')])[_0x0c7c('0x92')]();var _0xe1a241={'body':_0x38b22c['body'],'channel':_0x0c7c('0x93')};var _0x563ec6=[];var _0x483de7=[];var _0x5e9614={};var _0x2193f5=![];return db[_0x0c7c('0x94')][_0x0c7c('0x6a')]()[_0x0c7c('0x25')](function(_0x2c55c0){if(!_0x2c55c0){throw new db[(_0x0c7c('0x22'))][(_0x0c7c('0x95'))](_0x0c7c('0x96'));}_0x563ec6=_[_0x0c7c('0x97')](_[_0x0c7c('0x4a')](_0x2c55c0),[_0x0c7c('0x98'),_0x0c7c('0x99')]);_0x483de7=_[_0x0c7c('0x97')](_[_0x0c7c('0x4a')](_0x2c55c0),['createdAt',_0x0c7c('0x99'),_0x0c7c('0x9a'),_0x0c7c('0x9b')]);if(_0x38b22c[_0x0c7c('0x61')]['id']){delete _0x38b22c[_0x0c7c('0x61')]['id'];}if(_['isNil'](_0x38b22c[_0x0c7c('0x61')][_0x0c7c('0x9c')])){throw new db[(_0x0c7c('0x22'))][(_0x0c7c('0x95'))]('from\x20is\x20mandatory');}if(_[_0x0c7c('0x88')](_0x38b22c[_0x0c7c('0x61')][_0x0c7c('0x61')])||_0x38b22c[_0x0c7c('0x61')][_0x0c7c('0x61')]===''){throw new db['Sequelize'][(_0x0c7c('0x95'))](_0x0c7c('0x9d'));}if(_['isNil'](_0x38b22c[_0x0c7c('0x61')]['mapKey'])){throw new db[(_0x0c7c('0x22'))][(_0x0c7c('0x95'))](_0x0c7c('0x9e')+_0x483de7);}if(!_[_0x0c7c('0x9f')](_0x483de7,_0x38b22c[_0x0c7c('0x61')][_0x0c7c('0xa0')])){throw new db[(_0x0c7c('0x22'))][(_0x0c7c('0x95'))](_0x0c7c('0xa1')+_0x483de7);}_0x5e9614[_0x38b22c['body'][_0x0c7c('0xa0')]]=_0x38b22c[_0x0c7c('0x61')][_0x0c7c('0x9c')];})[_0x0c7c('0x25')](function(){return db[_0x0c7c('0x45')][_0x0c7c('0x5f')]({'where':{'id':_0x38b22c['params']['id']},'include':[{'model':db['CmList'],'as':_0x0c7c('0xa2'),'include':[{'model':db[_0x0c7c('0x94')],'as':_0x0c7c('0xa3'),'where':_0x5e9614,'limit':0x1,'order':[['updatedAt',_0x0c7c('0xa4')]]}]},{'model':db[_0x0c7c('0xa5')],'as':_0x0c7c('0xa6')}]});})['then'](handleEntityNotFound(_0x4152c5,null))['then'](function(_0x52dc00){if(_0x52dc00&&_0x52dc00[_0x0c7c('0xa2')]){_0xe1a241[_0x0c7c('0xa7')]=_0x52dc00;_0xe1a241[_0x0c7c('0xa8')]=_0x52dc00[_0x0c7c('0xa6')];_0xe1a241[_0x0c7c('0xa9')]=_0x52dc00['List'];_0xe1a241[_0x0c7c('0xa8')]=_[_0x0c7c('0xaa')](_0xe1a241[_0x0c7c('0xa8')],['priority'],[_0x0c7c('0xab')]);if(_0xe1a241['account'][_0x0c7c('0xa6')]){delete _0xe1a241[_0x0c7c('0xa7')]['Applications'];}if(_0xe1a241[_0x0c7c('0xa7')][_0x0c7c('0xa2')]&&_0xe1a241[_0x0c7c('0xa7')][_0x0c7c('0xa2')][_0x0c7c('0xa3')][_0x0c7c('0x50')]){return _0xe1a241[_0x0c7c('0xa7')][_0x0c7c('0xa2')][_0x0c7c('0xa3')][0x0];}var _0x58f1f2=_[_0x0c7c('0x19')](_0x38b22c[_0x0c7c('0x61')],{'firstName':_0x38b22c[_0x0c7c('0x61')][_0x0c7c('0x9c')],'ListId':_0x52dc00['ListId']});_0x58f1f2[_0x38b22c[_0x0c7c('0x61')][_0x0c7c('0xa0')]]=_0x38b22c[_0x0c7c('0x61')][_0x0c7c('0x9c')];return db[_0x0c7c('0x94')][_0x0c7c('0x60')](_0x58f1f2,{'fields':_0x563ec6,'raw':!![]});}})[_0x0c7c('0x25')](handleEntityNotFound(_0x4152c5,null))[_0x0c7c('0x25')](function(_0x3ee432){_0xe1a241[_0x0c7c('0xac')]=_0x3ee432;var _0x53668a=_0x38b22c[_0x0c7c('0x61')][_0x0c7c('0xad')];if(_0x38b22c[_0x0c7c('0xae')][_0x0c7c('0xaf')]){_0x53668a=_0x38b22c[_0x0c7c('0xae')][_0x0c7c('0xaf')];}else if(_0x38b22c['headers'][_0x0c7c('0xb0')]){_0x53668a=_[_0x0c7c('0xb1')](_0x38b22c[_0x0c7c('0xae')]['x-forwarded-for'][_0x0c7c('0xb2')](','));}if(_0x3ee432){var _0x3b0b51={'ContactId':_0x3ee432['id'],'ChatWebsiteId':_0x38b22c[_0x0c7c('0x5e')]['id'],'from':(_0x3ee432[_0x0c7c('0xb3')]||'')+'\x20'+(_0x3ee432[_0x0c7c('0xb4')]||''),'customerIp':_0x53668a,'customerPort':_0x38b22c['headers'][_0x0c7c('0xb5')]?_0x38b22c[_0x0c7c('0xae')][_0x0c7c('0xb5')]:null,'referer':_0x38b22c['body']['referer'],'browserName':_0x4b66c9[_0x0c7c('0xb6')][_0x0c7c('0x40')]&&_0x4b66c9['browser'][_0x0c7c('0xb7')]?util[_0x0c7c('0xb8')](_0x0c7c('0xb9'),_0x4b66c9['browser'][_0x0c7c('0x40')],_0x4b66c9['browser'][_0x0c7c('0xb7')]):_0x0c7c('0xba'),'browserVersion':_0x4b66c9['browser']['version']||_0x0c7c('0xba'),'osName':util['format'](_0x0c7c('0xb9'),_0x4b66c9['os'][_0x0c7c('0x40')],_0x4b66c9['os']['version']),'osVersion':_0x4b66c9['os'][_0x0c7c('0xb7')],'deviceModel':_0x4b66c9[_0x0c7c('0xbb')][_0x0c7c('0x4d')]&&_0x4b66c9[_0x0c7c('0xbb')]['vendor']?util[_0x0c7c('0xb8')](_0x0c7c('0xbc'),_0x4b66c9['device'][_0x0c7c('0x4d')],_0x4b66c9[_0x0c7c('0xbb')][_0x0c7c('0xbd')],_0x4b66c9[_0x0c7c('0xbb')]['type']):null,'deviceVendor':_0x4b66c9[_0x0c7c('0xbb')][_0x0c7c('0xbd')],'deviceType':_0x4b66c9[_0x0c7c('0xbb')][_0x0c7c('0x58')],'formData':JSON[_0x0c7c('0x2b')](_0x38b22c[_0x0c7c('0x61')])};var _0x12e126={'ChatWebsiteId':_0x38b22c[_0x0c7c('0x5e')]['id'],'closed':![]};if(_0x38b22c['body']['threadId']){_0x12e126[_0x0c7c('0xbe')]=_0x38b22c[_0x0c7c('0x61')]['threadId'];return db[_0x0c7c('0xbf')]['find']({'where':_0x12e126})[_0x0c7c('0x25')](function(_0x3a395b){if(_0x3a395b){return[_0x3a395b,![]];}_0x3b0b51[_0x0c7c('0xbe')]=_0x38b22c['body']['threadId'];_0x3b0b51[_0x0c7c('0xc0')]=_0x38b22c['body'][_0x0c7c('0xc0')];return db[_0x0c7c('0xbf')][_0x0c7c('0x60')](_0x3b0b51)[_0x0c7c('0x25')](function(_0x17832f){return[_0x17832f,!![]];});});}_0x12e126[_0x0c7c('0xc1')]=_0x3ee432['id'];if(_0x38b22c['body'][_0x0c7c('0xc2')]&&_0x38b22c[_0x0c7c('0x61')]['interaction']['id']){_0x12e126['id']=_0x38b22c['body'][_0x0c7c('0xc2')]['id'];return db[_0x0c7c('0xbf')][_0x0c7c('0x5f')]({'where':_0x12e126})[_0x0c7c('0x25')](function(_0x257b35){if(_0x257b35){return[_0x257b35,![]];}return db[_0x0c7c('0xbf')][_0x0c7c('0x60')](_0x3b0b51)[_0x0c7c('0x25')](function(_0x115f19){return[_0x115f19,!![]];});});}return db[_0x0c7c('0xbf')][_0x0c7c('0x60')](_0x3b0b51)[_0x0c7c('0x25')](function(_0x2604de){return[_0x2604de,!![]];});}})['spread'](function(_0x1fe959,_0x1f9404){if(_0x1fe959){_0x2193f5=_0x1f9404;if(!_0x1f9404){var _0x5b8e95={'from':(_0xe1a241[_0x0c7c('0xac')][_0x0c7c('0xb3')]||'')+'\x20'+(_0xe1a241['contact'][_0x0c7c('0xb4')]||'')};if(_0x38b22c[_0x0c7c('0x61')][_0x0c7c('0xbe')]&&_0x38b22c['body']['messageId']&&_0x38b22c[_0x0c7c('0x61')][_0x0c7c('0xbe')]!=_0x38b22c[_0x0c7c('0x61')][_0x0c7c('0xc3')]){_0x5b8e95[_0x0c7c('0xbe')]=_0x38b22c['body'][_0x0c7c('0xc3')];}return _0x1fe959[_0x0c7c('0x3b')](_0x5b8e95);}else{return _0x1fe959;}}})[_0x0c7c('0x25')](function(_0x10b979){_0xe1a241['interaction']=_0x10b979[_0x0c7c('0x3d')]({'plain':!![]});_0xe1a241['interaction']['created']=_0x2193f5;if(_0xe1a241[_0x0c7c('0xc2')]['created']){if(_0xe1a241[_0x0c7c('0xa7')]['autoclose']){_0xe1a241[_0x0c7c('0xa8')][_0x0c7c('0xc4')]({'id':0x0,'priority':_0xe1a241[_0x0c7c('0xa8')][_0x0c7c('0x50')]+0x1,'app':'close','appdata':_0x0c7c('0xc5'),'interval':_0x0c7c('0xc6')});}}return db[_0x0c7c('0xc7')][_0x0c7c('0x60')]({'body':_0x38b22c[_0x0c7c('0x61')][_0x0c7c('0x61')],'ChatWebsiteId':_0x38b22c[_0x0c7c('0x5e')]['id'],'ChatInteractionId':_0x10b979['id'],'direction':'in','ContactId':_0xe1a241[_0x0c7c('0xac')]['id'],'AttachmentId':_0x38b22c['body'][_0x0c7c('0xc8')]});})[_0x0c7c('0x25')](function(_0x4cf387){_0xe1a241[_0x0c7c('0x2d')]=_0x4cf387;if(_0xe1a241[_0x0c7c('0xc2')][_0x0c7c('0xc9')]){return db[_0x0c7c('0xca')][_0x0c7c('0x5f')]({'attributes':['id',_0x0c7c('0x40')],'where':{'id':_0xe1a241[_0x0c7c('0xc2')][_0x0c7c('0xc9')]}})[_0x0c7c('0x25')](function(_0xa2dcad){if(_0xa2dcad){_0xe1a241[_0x0c7c('0xa8')]['unshift']({'id':0x0,'priority':0x0,'app':_0x0c7c('0xcb'),'appdata':_0xa2dcad[_0x0c7c('0x40')]+','+(_0xe1a241[_0x0c7c('0xa7')]['waitForTheAssignedAgent']||0xa),'interval':_0x0c7c('0xc6')});_0xe1a241['forcedOwnership']=!![];}return respondWithRpcPromise('Start',_0x0c7c('0xcc'),_0xe1a241);});}return respondWithRpcPromise(_0x0c7c('0xcd'),_0x0c7c('0xcc'),_0xe1a241);})[_0x0c7c('0x25')](function(_0x3825a4){respondWithRpcPromise(_0x0c7c('0xce'),_0x0c7c('0xce'),{'event':'notify','message':_0x3825a4},client9002);return _0x3825a4;})[_0x0c7c('0x25')](respondWithResult(_0x4152c5,null))[_0x0c7c('0x2f')](handleError(_0x4152c5,null));};exports['offline']=function(_0x4137a5,_0x4ad64a,_0x396324){var _0x29af75,_0xe53ded,_0x516911;var _0x501d2c=[];var _0x4cae6b=[];var _0x216eaa={};return db[_0x0c7c('0x94')]['describe']()[_0x0c7c('0x25')](function(_0x58c6b3){if(!_0x58c6b3){throw new db['Sequelize'][(_0x0c7c('0x95'))](_0x0c7c('0x96'));}_0x4cae6b=_['difference'](_[_0x0c7c('0x4a')](_0x58c6b3),['createdAt','updatedAt']);_0x501d2c=_[_0x0c7c('0x97')](_[_0x0c7c('0x4a')](_0x58c6b3),[_0x0c7c('0x98'),_0x0c7c('0x99'),_0x0c7c('0x9a'),_0x0c7c('0x9b')]);if(_0x4137a5[_0x0c7c('0x61')]['id']){delete _0x4137a5[_0x0c7c('0x61')]['id'];}if(_['isNil'](_0x4137a5[_0x0c7c('0x61')][_0x0c7c('0x9c')])){throw _0x4ad64a[_0x0c7c('0x31')](0x1f4)[_0x0c7c('0x41')](new db[(_0x0c7c('0x22'))][(_0x0c7c('0x95'))](_0x0c7c('0xcf')));}if(_['isNil'](_0x4137a5[_0x0c7c('0x61')][_0x0c7c('0x61')])||_0x4137a5['body'][_0x0c7c('0x61')]===''){throw _0x4ad64a[_0x0c7c('0x31')](0x1f4)[_0x0c7c('0x41')](new db[(_0x0c7c('0x22'))][(_0x0c7c('0x95'))](_0x0c7c('0x9d')));}if(_[_0x0c7c('0x88')](_0x4137a5[_0x0c7c('0x61')]['mapKeyOffline'])){throw _0x4ad64a[_0x0c7c('0x31')](0x1f4)[_0x0c7c('0x41')](new db['Sequelize']['ValidationError'](_0x0c7c('0xd0')+_0x501d2c));}if(!_['includes'](_0x501d2c,_0x4137a5[_0x0c7c('0x61')][_0x0c7c('0xd1')])){throw _0x4ad64a[_0x0c7c('0x31')](0x1f4)[_0x0c7c('0x41')](new db[(_0x0c7c('0x22'))]['ValidationError']('mapKeyOffline\x20invalid,\x20please\x20use\x20one\x20of\x20these:\x20'+_0x501d2c));}_0x216eaa[_0x4137a5[_0x0c7c('0x61')]['mapKeyOffline']]=_0x4137a5['body']['from'];})['then'](function(){return db[_0x0c7c('0x45')][_0x0c7c('0x5f')]({'where':{'id':_0x4137a5[_0x0c7c('0x5e')]['id']},'include':[{'model':db['CmList'],'as':_0x0c7c('0xa2')}]});})['then'](handleEntityNotFound(_0x4ad64a,null))[_0x0c7c('0x25')](function(_0x5e4136){if(_0x5e4136&&_0x5e4136['List']){_0xe53ded=_0x5e4136;var _0x5187b3=_['defaults'](_0x4137a5['body'],{'firstName':_0x4137a5['body'][_0x0c7c('0x9c')],'phone':_0x4137a5[_0x0c7c('0x61')][_0x0c7c('0x9c')],'ListId':_0x5e4136['ListId']});_0x5187b3[_0x4137a5[_0x0c7c('0x61')][_0x0c7c('0xd1')]]=_0x4137a5['body']['from'];return db['CmContact'][_0x0c7c('0xd2')]({'where':_0x216eaa,'defaults':_0x5187b3});}})[_0x0c7c('0xd3')](function(_0x4d8d73){if(_0x4d8d73){_0x516911=_0x4d8d73;var _0x19cb8b=fs['readFileSync'](path[_0x0c7c('0x80')](config[_0x0c7c('0x81')],_0x0c7c('0xd4')),_0x0c7c('0xd5'));var _0x43d7bc=ejs[_0x0c7c('0xd6')](_0x19cb8b,{'body':_[_0x0c7c('0xd7')](_0x4137a5['body'][_0x0c7c('0x61')]),'bodyTitle':_0xe53ded[_0x0c7c('0xd8')]});return db[_0x0c7c('0xd9')][_0x0c7c('0x60')]({'body':_0x43d7bc,'ContactId':_0x4d8d73['id'],'ChatWebsiteId':_0xe53ded['id']});}})[_0x0c7c('0x25')](function(_0x272fa7){if(_0x272fa7){_0x29af75=_0x272fa7;return db['MailAccount'][_0x0c7c('0x6e')]({'where':{'service':!![]},'include':[{'model':db['MailServerOut'],'as':_0x0c7c('0xda'),'raw':!![]}]});}})[_0x0c7c('0x25')](function(_0x513098){if(_0x513098&&_0x513098[_0x0c7c('0xda')]&&_0xe53ded['forwardOfflineAddress']){var _0x3ffd2a={'tls':{'rejectUnauthorized':![]}};if(_0x513098[_0x0c7c('0xda')][_0x0c7c('0xdb')]){_0x3ffd2a['service']=_0x513098[_0x0c7c('0xda')][_0x0c7c('0xdb')];}else{_0x3ffd2a[_0x0c7c('0xdc')]=_0x513098['Smtp']['host'];_0x3ffd2a[_0x0c7c('0xdd')]=_0x513098[_0x0c7c('0xda')][_0x0c7c('0xdd')];_0x3ffd2a[_0x0c7c('0xde')]=_0x513098[_0x0c7c('0xda')]['secure'];}if(_0x513098[_0x0c7c('0xda')][_0x0c7c('0xdf')]){_0x3ffd2a[_0x0c7c('0xe0')]={'user':_0x513098['Smtp'][_0x0c7c('0x62')],'pass':_0x513098['Smtp']['pass']};}return respondWithRpcPromise(_0x0c7c('0xe1'),_0x0c7c('0xe2'),{'account':_0x3ffd2a,'message':{'from':util[_0x0c7c('0xb8')](_0x0c7c('0xe3'),_0x513098[_0x0c7c('0x40')],_0x513098['email']||_0x513098[_0x0c7c('0xda')]['user']),'to':_0xe53ded['forwardOfflineAddress'],'subject':_0xe53ded[_0x0c7c('0xe4')],'text':_0x29af75[_0x0c7c('0x61')]}},client9003)[_0x0c7c('0x25')](function(){return _0x29af75;})[_0x0c7c('0x2f')](function(_0x18b3d2){console[_0x0c7c('0x2c')](_0x18b3d2);});}})['then'](function(){if(_0x29af75){return _0x29af75;}})[_0x0c7c('0x25')](respondWithResult(_0x4ad64a,null))[_0x0c7c('0x2f')](handleError(_0x4ad64a,null));};exports[_0x0c7c('0xe5')]=function(_0x3e510b,_0x25cc50,_0x1eabc5){return db[_0x0c7c('0xbf')][_0x0c7c('0x5f')]({'where':{'id':_0x3e510b[_0x0c7c('0x5e')]['id']}})[_0x0c7c('0x25')](handleEntityNotFound(_0x25cc50,null))['then'](function(_0x206bd3){if(_0x206bd3){return _0x206bd3[_0x0c7c('0xe5')](_0x3e510b[_0x0c7c('0x61')][_0x0c7c('0x73')],_[_0x0c7c('0xe6')](_0x3e510b[_0x0c7c('0x61')],['ids','id'])||{});}})[_0x0c7c('0x25')](respondWithResult(_0x25cc50,null))[_0x0c7c('0x2f')](handleError(_0x25cc50,null));};exports['getInteractions']=function(_0x4edbaa,_0x2d326e,_0x4aee25){var _0x44abd4={'raw':![],'where':{}};var _0x425a3b={};var _0x5e87b2={'count':0x0,'rows':[]};return db['ChatWebsite'][_0x0c7c('0x6e')]({'where':{'id':_0x4edbaa[_0x0c7c('0x5e')]['id']}})[_0x0c7c('0x25')](handleEntityNotFound(_0x2d326e,null))[_0x0c7c('0x25')](function(_0x202a5d){if(_0x202a5d){_0x425a3b[_0x0c7c('0x4d')]=_[_0x0c7c('0x4a')](db['ChatInteraction'][_0x0c7c('0x46')]);_0x425a3b[_0x0c7c('0x49')]=_['keys'](_0x4edbaa[_0x0c7c('0x49')]);_0x425a3b[_0x0c7c('0x4b')]=_[_0x0c7c('0x4c')](_0x425a3b[_0x0c7c('0x4d')],_0x425a3b[_0x0c7c('0x49')]);_0x44abd4[_0x0c7c('0x4e')]=_[_0x0c7c('0x4c')](_0x425a3b['model'],qs[_0x0c7c('0x4f')](_0x4edbaa['query'][_0x0c7c('0x4f')]));_0x44abd4[_0x0c7c('0x4e')]=_0x44abd4['attributes'][_0x0c7c('0x50')]?_0x44abd4[_0x0c7c('0x4e')]:_0x425a3b[_0x0c7c('0x4d')];if(!_0x4edbaa[_0x0c7c('0x49')][_0x0c7c('0x51')](_0x0c7c('0x52'))){_0x44abd4[_0x0c7c('0x35')]=qs[_0x0c7c('0x35')](_0x4edbaa['query'][_0x0c7c('0x35')]);_0x44abd4['offset']=qs[_0x0c7c('0x34')](_0x4edbaa[_0x0c7c('0x49')][_0x0c7c('0x34')]);}_0x44abd4[_0x0c7c('0x70')]=qs['sort'](_0x4edbaa[_0x0c7c('0x49')]['sort']);_0x44abd4[_0x0c7c('0x56')]=qs[_0x0c7c('0x4b')](_['pick'](_0x4edbaa[_0x0c7c('0x49')],_0x425a3b[_0x0c7c('0x4b')]));_0x44abd4[_0x0c7c('0x56')]['ChatWebsiteId']=_0x202a5d['id'];if(_0x4edbaa[_0x0c7c('0x49')]['filter']){_0x44abd4[_0x0c7c('0x56')]=_[_0x0c7c('0x57')](_0x44abd4[_0x0c7c('0x56')],{'$or':_[_0x0c7c('0x44')](_0x44abd4[_0x0c7c('0x4e')],function(_0x24c8f5){var _0x19d226={};_0x19d226[_0x24c8f5]={'$like':'%'+_0x4edbaa[_0x0c7c('0x49')][_0x0c7c('0x55')]+'%'};return _0x19d226;})});}_0x44abd4=_['merge']({},_0x44abd4,_0x4edbaa['options']);return db[_0x0c7c('0xbf')][_0x0c7c('0x33')]({'where':_0x44abd4[_0x0c7c('0x56')]})[_0x0c7c('0x25')](function(_0x3f129e){_0x5e87b2[_0x0c7c('0x33')]=_0x3f129e;if(_0x4edbaa['query']['includeAll']){_0x44abd4['include']=[{'model':db[_0x0c7c('0x94')],'as':_0x0c7c('0xe7'),'required':![]},{'model':db[_0x0c7c('0xca')],'as':_0x0c7c('0xe8'),'attributes':[_0x0c7c('0x40'),_0x0c7c('0xe9'),_0x0c7c('0xea')],'required':![]},{'model':db[_0x0c7c('0xeb')],'as':_0x0c7c('0xec'),'attributes':['id',_0x0c7c('0x40'),_0x0c7c('0xed')],'where':_0x4edbaa[_0x0c7c('0x49')]['tag']?{'id':_0x4edbaa[_0x0c7c('0x49')][_0x0c7c('0xee')]}:undefined,'required':_0x4edbaa[_0x0c7c('0x49')]['tag']?!![]:![]}];}return db[_0x0c7c('0xbf')][_0x0c7c('0x5c')](_0x44abd4);})[_0x0c7c('0x25')](function(_0x17ea62){_0x5e87b2[_0x0c7c('0x71')]=_0x17ea62;return _0x5e87b2;});}})[_0x0c7c('0x25')](respondWithFilteredResult(_0x2d326e,_0x44abd4))[_0x0c7c('0x2f')](handleError(_0x2d326e,null));};function iftimePromise(_0x247d7e,_0x55d491){return respondWithRpcPromise('Command',_0x0c7c('0xef'),{'command':_0x55d491[_0x0c7c('0xf0')]?util[_0x0c7c('0xb8')](_0x0c7c('0xf1'),_0x247d7e[_0x0c7c('0xf2')],_0x55d491[_0x0c7c('0xf0')]):util[_0x0c7c('0xb8')](_0x0c7c('0xf3'),_0x247d7e[_0x0c7c('0xf2')])},client9002)[_0x0c7c('0x25')](function(_0x406e73){var _0x2cd48b=_0x406e73&&_0x406e73['indexOf']('true')>=0x0?!![]:![];logger[_0x0c7c('0x26')](_0x0c7c('0xf4'),_0x55d491['id'],_0x247d7e['id'],_0x247d7e[_0x0c7c('0xf2')],_0x2cd48b?'ONLINE':_0x0c7c('0xf5'),_0x55d491[_0x0c7c('0xf0')]?_0x55d491[_0x0c7c('0xf0')]:_0x0c7c('0xf6'));return _0x2cd48b;})[_0x0c7c('0x2f')](function(_0x577d72){logger[_0x0c7c('0x2c')](_0x0c7c('0xf4'),_0x55d491['id'],_0x247d7e['id'],_0x247d7e[_0x0c7c('0xf2')],util[_0x0c7c('0xf7')](_0x577d72,{'showHidden':![],'depth':null}),_0x55d491['timezone']?_0x55d491[_0x0c7c('0xf0')]:'No\x20timezone');return![];});}exports[_0x0c7c('0xef')]=function(_0x80b61,_0x616ede,_0x16975d){var _0x46f19b=0x0;var _0x1e2378=0x0;var _0x542815=![];var _0x22df46;var _0x4c8e18;return db[_0x0c7c('0x45')][_0x0c7c('0x5f')]({'where':{'id':_0x80b61['params']['id']},'include':[{'model':db[_0x0c7c('0xf8')],'as':_0x0c7c('0xf8'),'include':[{'model':db['Interval'],'as':_0x0c7c('0xf9'),'attributes':['id',_0x0c7c('0xf2')],'raw':!![]}]}]})[_0x0c7c('0x25')](handleEntityNotFound(_0x616ede,null))[_0x0c7c('0x25')](function(_0x457247){if(_0x457247){_0x22df46=_0x457247;return _0x457247['getProactiveActions']({'raw':!![]});}})['then'](function(_0x4df53c){if(_0x22df46){if(_0x4df53c){_0x4c8e18=_0x4df53c;}}return require('../../config/license/util')[_0x0c7c('0xfa')]();})[_0x0c7c('0x25')](function(_0x287b47){if(_0x287b47){_0x1e2378=_0x287b47[_0x0c7c('0xfb')];_0x542815=_0x287b47[_0x0c7c('0x83')];}})['then'](function(){return db['ChatInteraction']['count']({'where':{'closed':![]}});})['then'](function(_0x575333){_0x46f19b=_0x575333;if(_0x1e2378&&_0x575333>_0x1e2378){return db['License'][_0x0c7c('0x6e')]({'where':{'id':0x1}})['then'](function(_0x3d0c21){if(_0x3d0c21){_0x3d0c21[_0x0c7c('0xfc')](_0x0c7c('0xfd'));}});}})[_0x0c7c('0x25')](function(){if(_0x22df46[_0x0c7c('0xf8')]&&_0x22df46[_0x0c7c('0xf8')][_0x0c7c('0xf9')]){var _0x1a6fcc=[];for(var _0x53b6f2=0x0;_0x53b6f2<_0x22df46[_0x0c7c('0xf8')]['Intervals'][_0x0c7c('0x50')];_0x53b6f2++){var _0x30cb43=_0x22df46['Interval'][_0x0c7c('0xf9')][_0x53b6f2]['get']({'plain':!![]});_0x1a6fcc['push'](iftimePromise(_0x30cb43,_0x22df46));}return BPromise[_0x0c7c('0xfe')](_0x1a6fcc)[_0x0c7c('0x25')](function(_0x48d588){return _[_0x0c7c('0xff')](_0x48d588);});}else{return!![];}})[_0x0c7c('0x25')](function(_0x3450c3){var _0xfb3607=fs['readFileSync'](path[_0x0c7c('0x80')](config[_0x0c7c('0x81')],_0x0c7c('0x100')),_0x0c7c('0xd5'));var _0xb257b0={'remote':_0x22df46['remote'],'query':querystring[_0x0c7c('0x2b')](_[_0x0c7c('0x57')](_0x22df46['get']({'plain':!![]}),{'customerIp':_0x80b61[_0x0c7c('0xae')][_0x0c7c('0xb0')]||_0x80b61[_0x0c7c('0xae')][_0x0c7c('0x101')]||_0x80b61[_0x0c7c('0x102')]['remoteAddress']||_0x80b61['ip'],'referer':_0x80b61[_0x0c7c('0xae')][_0x0c7c('0x103')],'openedInteractions':_0x46f19b,'maxInteractions':_0x1e2378,'virtual':_0x542815[_0x0c7c('0xfb')],'online':_0x3450c3,'custom':_0x542815}))['replace'](/'/g,'\x5c\x27')};_0x616ede['send'](ejs[_0x0c7c('0xd6')](Mustache[_0x0c7c('0xd6')](_0xfb3607,_0xb257b0),{'proactiveActions':_0x4c8e18,'alignment':_0x22df46[_0x0c7c('0x104')],'verticalAlignment':_0x22df46[_0x0c7c('0x105')],'div_color':_0x22df46['color'],'text_color':_0x22df46[_0x0c7c('0x106')]}));})[_0x0c7c('0x2f')](handleError(_0x616ede,null));};exports[_0x0c7c('0x107')]=function(_0x12df33,_0x5249f1,_0x151dd2){return db[_0x0c7c('0x45')][_0x0c7c('0x6e')]({'where':{'id':_0x12df33[_0x0c7c('0x5e')]['id']}})['then'](handleEntityNotFound(_0x5249f1,null))[_0x0c7c('0x25')](function(_0x593128){if(_0x593128){return db[_0x0c7c('0x108')][_0x0c7c('0x109')](function(_0x4e2d72){return db['ChatApplication']['destroy']({'where':{'ChatWebsiteId':_0x12df33[_0x0c7c('0x5e')]['id']},'transaction':_0x4e2d72})['then'](function(_0x351057){var _0x468bee=_[_0x0c7c('0x44')](_0x12df33['body'],function(_0xb696b8){_0xb696b8['ChatWebsiteId']=_0x12df33[_0x0c7c('0x5e')]['id'];return _0xb696b8;});return db[_0x0c7c('0xa5')][_0x0c7c('0x10a')](_0x468bee,{'transaction':_0x4e2d72});});})['then'](function(){return db[_0x0c7c('0xa5')][_0x0c7c('0x10b')]({'where':{'ChatWebsiteId':_0x12df33[_0x0c7c('0x5e')]['id']},'order':_0x0c7c('0x10c')});});}})[_0x0c7c('0x25')](respondWithResult(_0x5249f1,null))[_0x0c7c('0x2f')](handleError(_0x5249f1,null));};exports[_0x0c7c('0x10d')]=function(_0x18e941,_0x4186e1,_0x337707){var _0x583728={};var _0x1769e1={};var _0xcc0dbc;var _0x5821b0;return db[_0x0c7c('0x45')][_0x0c7c('0x6e')]({'where':{'id':_0x18e941[_0x0c7c('0x5e')]['id']}})[_0x0c7c('0x25')](handleEntityNotFound(_0x4186e1,null))['then'](function(_0x4ffab2){if(_0x4ffab2){_0xcc0dbc=_0x4ffab2;_0x1769e1[_0x0c7c('0x4d')]=_[_0x0c7c('0x4a')](db[_0x0c7c('0xa5')][_0x0c7c('0x46')]);_0x1769e1['query']=_[_0x0c7c('0x4a')](_0x18e941[_0x0c7c('0x49')]);_0x1769e1['filters']=_[_0x0c7c('0x4c')](_0x1769e1['model'],_0x1769e1[_0x0c7c('0x49')]);_0x583728[_0x0c7c('0x4e')]=_[_0x0c7c('0x4c')](_0x1769e1[_0x0c7c('0x4d')],qs[_0x0c7c('0x4f')](_0x18e941[_0x0c7c('0x49')]['fields']));_0x583728[_0x0c7c('0x4e')]=_0x583728['attributes'][_0x0c7c('0x50')]?_0x583728['attributes']:_0x1769e1[_0x0c7c('0x4d')];_0x583728[_0x0c7c('0x70')]=qs[_0x0c7c('0x53')](_0x18e941[_0x0c7c('0x49')][_0x0c7c('0x53')]);_0x583728[_0x0c7c('0x56')]=qs['filters'](_[_0x0c7c('0x54')](_0x18e941['query'],_0x1769e1[_0x0c7c('0x4b')]));if(_0x18e941[_0x0c7c('0x49')][_0x0c7c('0x55')]){_0x583728['where']=_[_0x0c7c('0x57')](_0x583728[_0x0c7c('0x56')],{'$or':_[_0x0c7c('0x44')](_0x583728[_0x0c7c('0x4e')],function(_0x3d7dde){var _0x5bbb4d={};_0x5bbb4d[_0x3d7dde]={'$like':'%'+_0x18e941[_0x0c7c('0x49')][_0x0c7c('0x55')]+'%'};return _0x5bbb4d;})});}_0x583728=_[_0x0c7c('0x57')]({},_0x583728,_0x18e941[_0x0c7c('0x59')]);return _0xcc0dbc[_0x0c7c('0x10d')](_0x583728);}})['then'](function(_0x1048cb){if(_0x1048cb){_0x5821b0=_0x1048cb[_0x0c7c('0x50')];if(!_0x18e941['query'][_0x0c7c('0x51')](_0x0c7c('0x52'))){_0x583728[_0x0c7c('0x35')]=qs[_0x0c7c('0x35')](_0x18e941[_0x0c7c('0x49')][_0x0c7c('0x35')]);_0x583728[_0x0c7c('0x34')]=qs[_0x0c7c('0x34')](_0x18e941[_0x0c7c('0x49')][_0x0c7c('0x34')]);}return _0xcc0dbc['getApplications'](_0x583728);}})[_0x0c7c('0x25')](function(_0x3112c9){if(_0x3112c9){return _0x3112c9?{'count':_0x5821b0,'rows':_0x3112c9}:null;}})[_0x0c7c('0x25')](respondWithResult(_0x4186e1,null))['catch'](handleError(_0x4186e1,null));};exports[_0x0c7c('0x10e')]=function(_0x5e3d74,_0x30fee9,_0x1f2e86){return db[_0x0c7c('0x10f')][_0x0c7c('0x5f')]({'where':{'id':_0x5e3d74[_0x0c7c('0x5e')]['id']}})[_0x0c7c('0x25')](handleEntityNotFound(_0x30fee9,null))[_0x0c7c('0x25')](function(_0x308f7c){if(_0x308f7c){return _0x308f7c['addProactiveActions'](_0x5e3d74['body']['ids'],_[_0x0c7c('0xe6')](_0x5e3d74[_0x0c7c('0x61')],[_0x0c7c('0x73'),'id'])||{});}})[_0x0c7c('0x25')](respondWithResult(_0x30fee9,null))['catch'](handleError(_0x30fee9,null));};exports[_0x0c7c('0x110')]=function(_0x202a38,_0x15797c,_0x33af17){var _0x26398e={};var _0x26d5e3={};var _0x472c3a;var _0x295d3f;return db[_0x0c7c('0x45')][_0x0c7c('0x6e')]({'where':{'id':_0x202a38[_0x0c7c('0x5e')]['id']}})[_0x0c7c('0x25')](handleEntityNotFound(_0x15797c,null))[_0x0c7c('0x25')](function(_0x44f14e){if(_0x44f14e){_0x472c3a=_0x44f14e;_0x26d5e3['model']=_['keys'](db[_0x0c7c('0x111')][_0x0c7c('0x46')]);_0x26d5e3[_0x0c7c('0x49')]=_['keys'](_0x202a38[_0x0c7c('0x49')]);_0x26d5e3['filters']=_[_0x0c7c('0x4c')](_0x26d5e3[_0x0c7c('0x4d')],_0x26d5e3[_0x0c7c('0x49')]);_0x26398e[_0x0c7c('0x4e')]=_[_0x0c7c('0x4c')](_0x26d5e3['model'],qs['fields'](_0x202a38[_0x0c7c('0x49')][_0x0c7c('0x4f')]));_0x26398e[_0x0c7c('0x4e')]=_0x26398e[_0x0c7c('0x4e')][_0x0c7c('0x50')]?_0x26398e[_0x0c7c('0x4e')]:_0x26d5e3[_0x0c7c('0x4d')];_0x26398e[_0x0c7c('0x70')]=qs['sort'](_0x202a38[_0x0c7c('0x49')]['sort']);_0x26398e[_0x0c7c('0x56')]=qs[_0x0c7c('0x4b')](_[_0x0c7c('0x54')](_0x202a38[_0x0c7c('0x49')],_0x26d5e3[_0x0c7c('0x4b')]));if(_0x202a38[_0x0c7c('0x49')][_0x0c7c('0x55')]){_0x26398e[_0x0c7c('0x56')]=_[_0x0c7c('0x57')](_0x26398e[_0x0c7c('0x56')],{'$or':_[_0x0c7c('0x44')](_0x26398e['attributes'],function(_0x3ae93a){var _0x26b219={};_0x26b219[_0x3ae93a]={'$like':'%'+_0x202a38['query'][_0x0c7c('0x55')]+'%'};return _0x26b219;})});}_0x26398e=_[_0x0c7c('0x57')]({},_0x26398e,_0x202a38[_0x0c7c('0x59')]);return _0x472c3a['getProactiveActions'](_0x26398e);}})[_0x0c7c('0x25')](function(_0x4c5d8d){if(_0x4c5d8d){_0x295d3f=_0x4c5d8d[_0x0c7c('0x50')];if(!_0x202a38[_0x0c7c('0x49')][_0x0c7c('0x51')](_0x0c7c('0x52'))){_0x26398e[_0x0c7c('0x35')]=qs[_0x0c7c('0x35')](_0x202a38[_0x0c7c('0x49')][_0x0c7c('0x35')]);_0x26398e[_0x0c7c('0x34')]=qs['offset'](_0x202a38['query'][_0x0c7c('0x34')]);}return _0x472c3a[_0x0c7c('0x110')](_0x26398e);}})[_0x0c7c('0x25')](function(_0x1e6860){if(_0x1e6860){return _0x1e6860?{'count':_0x295d3f,'rows':_0x1e6860}:null;}})[_0x0c7c('0x25')](respondWithResult(_0x15797c,null))[_0x0c7c('0x2f')](handleError(_0x15797c,null));};exports[_0x0c7c('0x112')]=function(_0x595eaf,_0x469b80,_0x425f75){var _0x20f355=_0x595eaf[_0x0c7c('0x49')][_0x0c7c('0x113')]==='false'?_0x0c7c('0x114'):_0x0c7c('0x115');return db[_0x0c7c('0x45')][_0x0c7c('0x5f')]({'attributes':['id',_0x20f355],'where':{'id':_0x595eaf[_0x0c7c('0x5e')]['id']}})['then'](handleEntityNotFound(_0x469b80,null))[_0x0c7c('0x25')](function(_0x37c56a){if(_0x37c56a){var _0x100ead=_0x37c56a[_0x20f355];var _0x2cf222=_0x100ead&&_0x100ead[_0x0c7c('0x116')]?_0x100ead['items']:[];_0x469b80[_0x0c7c('0x41')]({'fromKey':_[_0x0c7c('0x88')](_0x100ead['fromKey'])?undefined:_0x100ead[_0x0c7c('0x117')],'count':_0x2cf222[_0x0c7c('0x50')],'rows':_0x2cf222});}})['catch'](handleError(_0x469b80,null));};exports[_0x0c7c('0x118')]=function(_0x215611,_0x4ad4b9,_0x3c32af){var _0x81c4be={'raw':![],'where':{}};var _0x5ce3ac={};var _0x2a30b9={'count':0x0,'rows':[]};return db[_0x0c7c('0x45')][_0x0c7c('0x6e')]({'where':{'id':_0x215611[_0x0c7c('0x5e')]['id']}})[_0x0c7c('0x25')](handleEntityNotFound(_0x4ad4b9,null))[_0x0c7c('0x25')](function(_0x42563e){if(_0x42563e){_0x5ce3ac[_0x0c7c('0x4d')]=_[_0x0c7c('0x4a')](db[_0x0c7c('0xd9')][_0x0c7c('0x46')]);_0x5ce3ac[_0x0c7c('0x49')]=_[_0x0c7c('0x4a')](_0x215611[_0x0c7c('0x49')]);_0x5ce3ac[_0x0c7c('0x4b')]=_[_0x0c7c('0x4c')](_0x5ce3ac['model'],_0x5ce3ac[_0x0c7c('0x49')]);_0x81c4be['attributes']=_[_0x0c7c('0x4c')](_0x5ce3ac[_0x0c7c('0x4d')],qs['fields'](_0x215611[_0x0c7c('0x49')]['fields']));_0x81c4be['attributes']=_0x81c4be[_0x0c7c('0x4e')][_0x0c7c('0x50')]?_0x81c4be[_0x0c7c('0x4e')]:_0x5ce3ac[_0x0c7c('0x4d')];if(!_0x215611[_0x0c7c('0x49')][_0x0c7c('0x51')](_0x0c7c('0x52'))){_0x81c4be[_0x0c7c('0x35')]=qs[_0x0c7c('0x35')](_0x215611[_0x0c7c('0x49')][_0x0c7c('0x35')]);_0x81c4be['offset']=qs['offset'](_0x215611[_0x0c7c('0x49')][_0x0c7c('0x34')]);}_0x81c4be[_0x0c7c('0x70')]=qs[_0x0c7c('0x53')](_0x215611['query'][_0x0c7c('0x53')]);_0x81c4be[_0x0c7c('0x56')]=qs[_0x0c7c('0x4b')](_[_0x0c7c('0x54')](_0x215611[_0x0c7c('0x49')],_0x5ce3ac['filters']));_0x81c4be[_0x0c7c('0x56')][_0x0c7c('0x6c')]=_0x42563e['id'];if(_0x215611[_0x0c7c('0x49')][_0x0c7c('0x55')]){_0x81c4be['where']=_[_0x0c7c('0x57')](_0x81c4be[_0x0c7c('0x56')],{'$or':_[_0x0c7c('0x44')](_0x81c4be[_0x0c7c('0x4e')],function(_0x31d0f7){var _0x5e83a0={};_0x5e83a0[_0x31d0f7]={'$like':'%'+_0x215611['query'][_0x0c7c('0x55')]+'%'};return _0x5e83a0;})});}_0x81c4be=_[_0x0c7c('0x57')]({},_0x81c4be,_0x215611['options']);return db[_0x0c7c('0xd9')][_0x0c7c('0x33')]({'where':_0x81c4be['where']})[_0x0c7c('0x25')](function(_0x4bac8f){_0x2a30b9[_0x0c7c('0x33')]=_0x4bac8f;if(_0x215611[_0x0c7c('0x49')][_0x0c7c('0x5a')]){_0x81c4be['include']=[{'all':!![]}];}else{_0x81c4be[_0x0c7c('0x5b')]=[{'model':db[_0x0c7c('0x94')],'as':_0x0c7c('0xe7'),'required':![]}];}return db[_0x0c7c('0xd9')][_0x0c7c('0x5c')](_0x81c4be);})[_0x0c7c('0x25')](function(_0x10e01){_0x2a30b9['rows']=_0x10e01;return _0x2a30b9;});}})[_0x0c7c('0x25')](respondWithFilteredResult(_0x4ad4b9,_0x81c4be))['catch'](handleError(_0x4ad4b9,null));};exports[_0x0c7c('0x119')]=function(_0x1947b5,_0x34a422,_0x4c960b){return db[_0x0c7c('0x45')][_0x0c7c('0x5f')]({'where':{'id':_0x1947b5['params']['id']}})['then'](handleEntityNotFound(_0x34a422,null))['then'](function(_0x382b0f){if(_0x382b0f){return _0x382b0f[_0x0c7c('0x119')](_0x1947b5['body'][_0x0c7c('0x73')],_[_0x0c7c('0xe6')](_0x1947b5[_0x0c7c('0x61')],[_0x0c7c('0x73'),'id'])||{})[_0x0c7c('0xd3')](function(_0x4fd8e4){for(var _0x26650e=0x0;_0x26650e<_0x1947b5[_0x0c7c('0x61')]['ids'][_0x0c7c('0x50')];_0x26650e+=0x1){socket[_0x0c7c('0x11a')](_0x0c7c('0x11b'),{'UserId':_0x1947b5[_0x0c7c('0x61')][_0x0c7c('0x73')][_0x26650e],'ChatWebsiteId':_0x1947b5[_0x0c7c('0x5e')]['id']});}return _0x4fd8e4;});}})['then'](respondWithResult(_0x34a422,null))[_0x0c7c('0x2f')](handleError(_0x34a422,null));};exports[_0x0c7c('0x11c')]=function(_0x15ce76,_0x53f237,_0x21d83b){return db[_0x0c7c('0x45')]['find']({'where':{'id':_0x15ce76[_0x0c7c('0x5e')]['id']}})[_0x0c7c('0x25')](handleEntityNotFound(_0x53f237,null))['then'](function(_0x10cec3){if(_0x10cec3){return _0x10cec3[_0x0c7c('0x11c')](_0x15ce76[_0x0c7c('0x49')][_0x0c7c('0x73')])['then'](function(){if(_[_0x0c7c('0x11d')](_0x15ce76[_0x0c7c('0x49')][_0x0c7c('0x73')])){for(var _0x45bdb1=0x0;_0x45bdb1<_0x15ce76['query'][_0x0c7c('0x73')][_0x0c7c('0x50')];_0x45bdb1+=0x1){socket[_0x0c7c('0x11a')](_0x0c7c('0x11e'),{'UserId':Number(_0x15ce76['query']['ids'][_0x45bdb1]),'ChatWebsiteId':Number(_0x15ce76[_0x0c7c('0x5e')]['id'])});}}else{socket[_0x0c7c('0x11a')](_0x0c7c('0x11e'),{'UserId':Number(_0x15ce76[_0x0c7c('0x49')][_0x0c7c('0x73')]),'ChatWebsiteId':Number(_0x15ce76[_0x0c7c('0x5e')]['id'])});}});}})[_0x0c7c('0x25')](respondWithStatusCode(_0x53f237,null))['catch'](handleError(_0x53f237,null));};exports[_0x0c7c('0x11f')]=function(_0xe1975b,_0x4b0f50,_0x696d1d){var _0x43e6e6={};var _0x2c8d6e={};var _0x2588aa;var _0x5adc96;return db['ChatWebsite']['findOne']({'where':{'id':_0xe1975b[_0x0c7c('0x5e')]['id']}})[_0x0c7c('0x25')](handleEntityNotFound(_0x4b0f50,null))[_0x0c7c('0x25')](function(_0x4943bb){if(_0x4943bb){_0x2588aa=_0x4943bb;_0x2c8d6e[_0x0c7c('0x4d')]=_['keys'](db[_0x0c7c('0xca')][_0x0c7c('0x46')]);_0x2c8d6e['query']=_['keys'](_0xe1975b[_0x0c7c('0x49')]);_0x2c8d6e['filters']=_[_0x0c7c('0x4c')](_0x2c8d6e['model'],_0x2c8d6e[_0x0c7c('0x49')]);_0x43e6e6['attributes']=_[_0x0c7c('0x4c')](_0x2c8d6e[_0x0c7c('0x4d')],qs[_0x0c7c('0x4f')](_0xe1975b[_0x0c7c('0x49')][_0x0c7c('0x4f')]));_0x43e6e6[_0x0c7c('0x4e')]=_0x43e6e6[_0x0c7c('0x4e')]['length']?_0x43e6e6[_0x0c7c('0x4e')]:_0x2c8d6e['model'];_0x43e6e6[_0x0c7c('0x70')]=qs['sort'](_0xe1975b[_0x0c7c('0x49')]['sort']);_0x43e6e6[_0x0c7c('0x56')]=qs[_0x0c7c('0x4b')](_['pick'](_0xe1975b[_0x0c7c('0x49')],_0x2c8d6e[_0x0c7c('0x4b')]));if(_0xe1975b[_0x0c7c('0x49')]['filter']){_0x43e6e6[_0x0c7c('0x56')]=_['merge'](_0x43e6e6[_0x0c7c('0x56')],{'$or':_['map'](_0x43e6e6[_0x0c7c('0x4e')],function(_0x3c752a){var _0x2da3a3={};_0x2da3a3[_0x3c752a]={'$like':'%'+_0xe1975b[_0x0c7c('0x49')][_0x0c7c('0x55')]+'%'};return _0x2da3a3;})});}_0x43e6e6=_[_0x0c7c('0x57')]({},_0x43e6e6,_0xe1975b[_0x0c7c('0x59')]);return _0x2588aa['getAgents'](_0x43e6e6);}})[_0x0c7c('0x25')](function(_0x2a1c07){if(_0x2a1c07){_0x5adc96=_0x2a1c07[_0x0c7c('0x50')];if(!_0xe1975b[_0x0c7c('0x49')][_0x0c7c('0x51')]('nolimit')){_0x43e6e6[_0x0c7c('0x35')]=qs['limit'](_0xe1975b['query']['limit']);_0x43e6e6[_0x0c7c('0x34')]=qs[_0x0c7c('0x34')](_0xe1975b[_0x0c7c('0x49')][_0x0c7c('0x34')]);}return _0x2588aa[_0x0c7c('0x11f')](_0x43e6e6);}})['then'](function(_0x185c8e){if(_0x185c8e){return _0x185c8e?{'count':_0x5adc96,'rows':_0x185c8e}:null;}})[_0x0c7c('0x25')](respondWithResult(_0x4b0f50,null))['catch'](handleError(_0x4b0f50,null));};
\ No newline at end of file
+var _0x8b4b=['showCustomerAvatar','getSystemAvatar','server/files/images/avatars/system_avatar.png','systemAvatar','notify','user-agent-parser','setUA','headers','user-agent','getResult','chat','CmContact','no\x20available\x20attributes','difference','createdAt','updatedAt','CompanyId','ListId','from','from\x20is\x20mandatory','body\x20is\x20mandatory\x20and\x20not\x20empty','includes','mapKey','mapKey\x20invalid,\x20please\x20use\x20one\x20of\x20these:\x20','CmList','List','Contacts','ChatApplication','Applications','account','applications','list','orderBy','asc','contact','customerIp','cf-connecting-ip','x-forwarded-for','first','split','x-real-port','browser','version','format','%s\x20%s','unknown','device','vendor','stringify','threadId','ChatInteraction','externalUrl','interaction','firstName','lastName','messageId','created','push','ChatMessage','AttachmentId','UserId','unshift','agent','waitForTheAssignedAgent','*,*,*,*','Start','startRouting','EventManager','offline','mapKeyOffline','mapKeyOffline\x20is\x20mandatory,\x20please\x20use\x20one\x20of\x20these:\x20','mapKeyOffline\x20invalid,\x20please\x20use\x20one\x20of\x20these:\x20','findOrCreate','spread','readFileSync','utf8','render','toPairs','offlineMessageBody','MailAccount','MailServerOut','Smtp','forwardOfflineAddress','service','host','port','secure','authentication','auth','pass','SendMail','sendMail','\x22%s\x22\x20<%s>','email','offlineMessageSubject','addInteraction','omit','Contact','User','Owner','fullname','internal','Tags','tag','Command','getSnippet','timezone','iftime\x20%s','indexOf','true','[%s][INTERVAL][%s]\x20%s\x20%s\x20(%s)','interval','No\x20timezone','inspect','Interval','Intervals','getProactiveActions','../../config/license/util','virtual','License','increment','chatLicenseExceeded','some','server/files/chat/iframe.js','remote','remoteAddress','referer','alignment','verticalAlignment','color','textColor','sequelize','bulkCreate','getApplications','chatProactiveAction','addProactiveActions','ChatProactiveAction','getFields','offlineForm','onlineForm','items','fromKey','getOfflineMessages','ChatOfflineMessage','include','addAgents','emit','removeAgents','isArray','userChatWebsite:remove','getAgents','html-pdf','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','moment','mustache','path','sox','to-csv','lodash','jsforce','querystring','papaparse','ioredis','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/environment','../../mysqldb','redis','defaults','localhost','./chatWebsite.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','ChatWebsite,\x20%s,\x20%s','request\x20sent','debug','ChatWebsite,\x20%s,\x20%s,\x20%s','error','code','message','info','result','sendStatus','status','json','count','offset','set','Content-Range','reject','save','update','then','destroy','get','UserProfileResource','end','name','send','index','Pause','map','ChatWebsite','rawAttributes','type','model','query','filters','intersection','fields','attributes','hasOwnProperty','nolimit','limit','order','sort','where','pick','filter','VIRTUAL','options','includeAll','findAll','rows','catch','show','mandatoryDispositionPause','keys','length','find','user','Unable\x20to\x20retrieve\x20the\x20current\x20user','role','ChatWebsites','autoAssociation','create','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','body','params','describe','addDisposition','ChatWebsiteId','Disposition','getDispositions','findOne','merge','removeDispositions','getAnswers','CannedAnswer','removeAnswers','ids','addLogo','sitepic','file','filename','agentAvatar','addCustomerAvatar','addSystemAvatar','getLogo','join','getLicense','isNil','existsSync','root','server/files/images/logos/','download','getAvatar','server/files/images/avatars/default_avatar.png','server/files/images/avatars/','getCustomerAvatar','server/files/images/avatars/customer_avatar.png','customerAvatar'];(function(_0x506d83,_0x1899e9){var _0x335e8b=function(_0x4a7044){while(--_0x4a7044){_0x506d83['push'](_0x506d83['shift']());}};_0x335e8b(++_0x1899e9);}(_0x8b4b,0x97));var _0xb8b4=function(_0x2d12c3,_0x25cd87){_0x2d12c3=_0x2d12c3-0x0;var _0x10d916=_0x8b4b[_0x2d12c3];return _0x10d916;};'use strict';var pdf=require(_0xb8b4('0x0'));var emlformat=require(_0xb8b4('0x1'));var rimraf=require(_0xb8b4('0x2'));var zipdir=require(_0xb8b4('0x3'));var jsonpatch=require(_0xb8b4('0x4'));var rp=require(_0xb8b4('0x5'));var moment=require(_0xb8b4('0x6'));var BPromise=require('bluebird');var Mustache=require(_0xb8b4('0x7'));var util=require('util');var path=require(_0xb8b4('0x8'));var sox=require(_0xb8b4('0x9'));var csv=require(_0xb8b4('0xa'));var ejs=require('ejs');var fs=require('fs');var _=require(_0xb8b4('0xb'));var squel=require('squel');var crypto=require('crypto');var jsforce=require(_0xb8b4('0xc'));var deskjs=require('desk.js');var toCsv=require(_0xb8b4('0xa'));var querystring=require(_0xb8b4('0xd'));var Papa=require(_0xb8b4('0xe'));var Redis=require(_0xb8b4('0xf'));var authService=require('../../components/auth/service');var qs=require(_0xb8b4('0x10'));var as=require(_0xb8b4('0x11'));var hardwareService=require(_0xb8b4('0x12'));var logger=require(_0xb8b4('0x13'))(_0xb8b4('0x14'));var utils=require(_0xb8b4('0x15'));var config=require(_0xb8b4('0x16'));var db=require(_0xb8b4('0x17'))['db'];config[_0xb8b4('0x18')]=_[_0xb8b4('0x19')](config[_0xb8b4('0x18')],{'host':_0xb8b4('0x1a'),'port':0x18eb});var socket=require('socket.io-emitter')(new Redis(config[_0xb8b4('0x18')]));require(_0xb8b4('0x1b'))[_0xb8b4('0x1c')](socket);var jayson=require(_0xb8b4('0x1d'));var client=jayson[_0xb8b4('0x1e')][_0xb8b4('0x1f')]({'port':0x232c});var client9002=jayson['client'][_0xb8b4('0x1f')]({'port':0x232a});var client9003=jayson[_0xb8b4('0x1e')][_0xb8b4('0x1f')]({'port':0x232b});function checkPasswordPattern(_0x3485f8,_0x5a51a5,_0x1f83f1){if(_0x1f83f1){var _0xca6d76=new RegExp(/(?=.*[a-z])(?=.*[A-Z])(?=.*[0-9])(?=.*[?!@#\$%\^&\*~\-_=+[{\]\}])(?=.{8,})/);if(_0xca6d76[_0xb8b4('0x20')](_0x5a51a5)){return _0x3485f8;}else{throw new db[(_0xb8b4('0x21'))][(_0xb8b4('0x22'))](_0xb8b4('0x23'));}}else{return _0x3485f8;}}function respondWithRpcPromise(_0x5bd233,_0x1e62a6,_0x3f7dc2,_0x53a8d2){return new BPromise(function(_0x469fed,_0x4ff4bb){var _0x96782f=_0x53a8d2||client;return _0x96782f[_0xb8b4('0x24')](_0x5bd233,_0x3f7dc2)['then'](function(_0x150e26){logger['info'](_0xb8b4('0x25'),_0x1e62a6,_0xb8b4('0x26'));logger[_0xb8b4('0x27')](_0xb8b4('0x28'),_0x1e62a6,_0xb8b4('0x26'),JSON['stringify'](_0x150e26));if(_0x150e26[_0xb8b4('0x29')]){if(_0x150e26['error'][_0xb8b4('0x2a')]===0x1f4){logger[_0xb8b4('0x29')](_0xb8b4('0x25'),_0x1e62a6,_0x150e26[_0xb8b4('0x29')][_0xb8b4('0x2b')]);return _0x4ff4bb(_0x150e26['error'][_0xb8b4('0x2b')]);}logger[_0xb8b4('0x29')]('ChatWebsite,\x20%s,\x20%s',_0x1e62a6,_0x150e26[_0xb8b4('0x29')][_0xb8b4('0x2b')]);return _0x469fed(_0x150e26[_0xb8b4('0x29')]['message']);}else{logger[_0xb8b4('0x2c')]('ChatWebsite,\x20%s,\x20%s',_0x1e62a6,'request\x20sent');_0x469fed(_0x150e26[_0xb8b4('0x2d')][_0xb8b4('0x2b')]);}})['catch'](function(_0x4f6f09){logger[_0xb8b4('0x29')](_0xb8b4('0x25'),_0x1e62a6,_0x4f6f09);_0x4ff4bb(_0x4f6f09);});});}function respondWithStatusCode(_0x533c6c,_0x857eb1){_0x857eb1=_0x857eb1||0xcc;return function(_0x48abea){if(_0x48abea){return _0x533c6c[_0xb8b4('0x2e')](_0x857eb1);}return _0x533c6c[_0xb8b4('0x2f')](_0x857eb1)['end']();};}function respondWithResult(_0x5d611a,_0x3a63a9){_0x3a63a9=_0x3a63a9||0xc8;return function(_0x49e6c1){if(_0x49e6c1){return _0x5d611a[_0xb8b4('0x2f')](_0x3a63a9)[_0xb8b4('0x30')](_0x49e6c1);}};}function respondWithFilteredResult(_0x301444,_0x49d329){return function(_0x48f910){if(_0x48f910){var _0x1de749=_0x48f910[_0xb8b4('0x31')],_0x2c7fb1=_0x49d329['offset'],_0x3d18aa=_0x49d329[_0xb8b4('0x32')]+_0x49d329['limit'],_0x267d40;if(_0x3d18aa>=_0x1de749){_0x3d18aa=_0x1de749;_0x267d40=0xc8;}else{_0x267d40=0xce;}_0x301444[_0xb8b4('0x2f')](_0x267d40);return _0x301444[_0xb8b4('0x33')](_0xb8b4('0x34'),_0x2c7fb1+'-'+_0x3d18aa+'/'+_0x1de749)[_0xb8b4('0x30')](_0x48f910);}return null;};}function patchUpdates(_0x53f5dd){return function(_0x3f9ac6){try{jsonpatch['apply'](_0x3f9ac6,_0x53f5dd,!![]);}catch(_0x38c37c){return BPromise[_0xb8b4('0x35')](_0x38c37c);}return _0x3f9ac6[_0xb8b4('0x36')]();};}function saveUpdates(_0x23f3d0,_0x3ae7bb){return function(_0x15509a){if(_0x15509a){return _0x15509a[_0xb8b4('0x37')](_0x23f3d0)[_0xb8b4('0x38')](function(_0x2bc1db){return _0x2bc1db;});}return null;};}function removeEntity(_0x11d479,_0x2856cf){return function(_0x148cfa){if(_0x148cfa){return _0x148cfa[_0xb8b4('0x39')]()[_0xb8b4('0x38')](function(){var _0x4f2a65=_0x148cfa[_0xb8b4('0x3a')]({'plain':!![]});var _0x4941bc='ChatWebsites';return db[_0xb8b4('0x3b')][_0xb8b4('0x39')]({'where':{'type':_0x4941bc,'resourceId':_0x4f2a65['id']}})[_0xb8b4('0x38')](function(){return _0x148cfa;});})['then'](function(){_0x11d479[_0xb8b4('0x2f')](0xcc)[_0xb8b4('0x3c')]();});}};}function handleEntityNotFound(_0x342d26,_0x2426c1){return function(_0x52784f){if(!_0x52784f){_0x342d26['sendStatus'](0x194);}return _0x52784f;};}function handleError(_0x2126cf,_0x1e71f5){_0x1e71f5=_0x1e71f5||0x1f4;return function(_0x2ac494){logger[_0xb8b4('0x29')](_0x2ac494['stack']);if(_0x2ac494[_0xb8b4('0x3d')]){delete _0x2ac494[_0xb8b4('0x3d')];}_0x2126cf[_0xb8b4('0x2f')](_0x1e71f5)[_0xb8b4('0x3e')](_0x2ac494);};}exports[_0xb8b4('0x3f')]=function(_0x29b2c1,_0x452be0){var _0x53b5c3={'include':[{'model':db[_0xb8b4('0x40')],'as':'mandatoryDispositionPause'}]},_0x26e5f1={},_0x32176d={'count':0x0,'rows':[]};var _0x4935bb=_[_0xb8b4('0x41')](db[_0xb8b4('0x42')][_0xb8b4('0x43')],function(_0x18908f){return{'name':_0x18908f['fieldName'],'type':_0x18908f[_0xb8b4('0x44')]['key']};});_0x26e5f1[_0xb8b4('0x45')]=_[_0xb8b4('0x41')](_0x4935bb,'name');_0x26e5f1['query']=_['keys'](_0x29b2c1[_0xb8b4('0x46')]);_0x26e5f1[_0xb8b4('0x47')]=_['intersection'](_0x26e5f1[_0xb8b4('0x45')],_0x26e5f1[_0xb8b4('0x46')]);_0x53b5c3['attributes']=_[_0xb8b4('0x48')](_0x26e5f1['model'],qs[_0xb8b4('0x49')](_0x29b2c1[_0xb8b4('0x46')]['fields']));_0x53b5c3['attributes']=_0x53b5c3[_0xb8b4('0x4a')]['length']?_0x53b5c3[_0xb8b4('0x4a')]:_0x26e5f1['model'];if(!_0x29b2c1[_0xb8b4('0x46')][_0xb8b4('0x4b')](_0xb8b4('0x4c'))){_0x53b5c3['limit']=qs['limit'](_0x29b2c1[_0xb8b4('0x46')][_0xb8b4('0x4d')]);_0x53b5c3['offset']=qs[_0xb8b4('0x32')](_0x29b2c1['query']['offset']);}_0x53b5c3[_0xb8b4('0x4e')]=qs['sort'](_0x29b2c1[_0xb8b4('0x46')][_0xb8b4('0x4f')]);_0x53b5c3[_0xb8b4('0x50')]=qs['filters'](_[_0xb8b4('0x51')](_0x29b2c1[_0xb8b4('0x46')],_0x26e5f1[_0xb8b4('0x47')]));if(_0x29b2c1[_0xb8b4('0x46')][_0xb8b4('0x52')]){_0x53b5c3[_0xb8b4('0x50')]=_['merge'](_0x53b5c3[_0xb8b4('0x50')],{'$or':_[_0xb8b4('0x41')](_0x4935bb,function(_0x1f4482){if(_0x1f4482[_0xb8b4('0x44')]!==_0xb8b4('0x53')){var _0x1ab9ce={};_0x1ab9ce[_0x1f4482[_0xb8b4('0x3d')]]={'$like':'%'+_0x29b2c1[_0xb8b4('0x46')][_0xb8b4('0x52')]+'%'};return _0x1ab9ce;}})});}_0x53b5c3=_['merge']({},_0x53b5c3,_0x29b2c1[_0xb8b4('0x54')]);var _0xa540c4={'where':_0x53b5c3[_0xb8b4('0x50')]};return db[_0xb8b4('0x42')]['count'](_0xa540c4)[_0xb8b4('0x38')](function(_0x2feb98){_0x32176d[_0xb8b4('0x31')]=_0x2feb98;if(_0x29b2c1[_0xb8b4('0x46')][_0xb8b4('0x55')]){_0x53b5c3['include']=[{'all':!![]}];}return db[_0xb8b4('0x42')][_0xb8b4('0x56')](_0x53b5c3);})['then'](function(_0x29db7a){_0x32176d[_0xb8b4('0x57')]=_0x29db7a;return _0x32176d;})[_0xb8b4('0x38')](respondWithFilteredResult(_0x452be0,_0x53b5c3))[_0xb8b4('0x58')](handleError(_0x452be0,null));};exports[_0xb8b4('0x59')]=function(_0x4d07a5,_0x5b0445){var _0x137e39={'raw':![],'where':{'id':_0x4d07a5['params']['id']},'include':[{'model':db[_0xb8b4('0x40')],'as':_0xb8b4('0x5a')}]},_0x522ee1={};_0x522ee1[_0xb8b4('0x45')]=_['keys'](db[_0xb8b4('0x42')][_0xb8b4('0x43')]);_0x522ee1[_0xb8b4('0x46')]=_[_0xb8b4('0x5b')](_0x4d07a5[_0xb8b4('0x46')]);_0x522ee1[_0xb8b4('0x47')]=_[_0xb8b4('0x48')](_0x522ee1['model'],_0x522ee1[_0xb8b4('0x46')]);_0x137e39[_0xb8b4('0x4a')]=_['intersection'](_0x522ee1[_0xb8b4('0x45')],qs[_0xb8b4('0x49')](_0x4d07a5['query']['fields']));_0x137e39[_0xb8b4('0x4a')]=_0x137e39[_0xb8b4('0x4a')][_0xb8b4('0x5c')]?_0x137e39[_0xb8b4('0x4a')]:_0x522ee1['model'];if(_0x4d07a5['query'][_0xb8b4('0x55')]){_0x137e39['include']=[{'all':!![]}];}_0x137e39=_['merge']({},_0x137e39,_0x4d07a5[_0xb8b4('0x54')]);return db['ChatWebsite'][_0xb8b4('0x5d')](_0x137e39)[_0xb8b4('0x38')](handleEntityNotFound(_0x5b0445,null))[_0xb8b4('0x38')](respondWithResult(_0x5b0445,null))['catch'](handleError(_0x5b0445,null));};exports['create']=function(_0x117dc1,_0x3a6e3d){return db[_0xb8b4('0x42')]['create'](_0x117dc1['body'],{})['then'](function(_0xe090cb){var _0x462f08=_0x117dc1[_0xb8b4('0x5e')][_0xb8b4('0x3a')]({'plain':!![]});if(!_0x462f08)throw new Error(_0xb8b4('0x5f'));if(_0x462f08[_0xb8b4('0x60')]==='user'){var _0x40dc3f=_0xe090cb[_0xb8b4('0x3a')]({'plain':!![]});var _0x385b09=_0xb8b4('0x61');return db['UserProfileSection']['find']({'where':{'name':_0x385b09,'userProfileId':_0x462f08['userProfileId']},'raw':!![]})['then'](function(_0x4efbad){if(_0x4efbad&&_0x4efbad[_0xb8b4('0x62')]===0x0){return db[_0xb8b4('0x3b')][_0xb8b4('0x63')]({'name':_0x40dc3f[_0xb8b4('0x3d')],'resourceId':_0x40dc3f['id'],'type':_0x4efbad[_0xb8b4('0x3d')],'sectionId':_0x4efbad['id']},{})['then'](function(){return _0xe090cb;});}else{return _0xe090cb;}})[_0xb8b4('0x58')](function(_0x1518dd){logger[_0xb8b4('0x29')](_0xb8b4('0x64'),_0x1518dd);throw _0x1518dd;});}return _0xe090cb;})[_0xb8b4('0x38')](respondWithResult(_0x3a6e3d,0xc9))[_0xb8b4('0x58')](handleError(_0x3a6e3d,null));};exports[_0xb8b4('0x37')]=function(_0x562a9a,_0x2f6990){if(_0x562a9a[_0xb8b4('0x65')]['id']){delete _0x562a9a[_0xb8b4('0x65')]['id'];}return db[_0xb8b4('0x42')][_0xb8b4('0x5d')]({'where':{'id':_0x562a9a[_0xb8b4('0x66')]['id']},'include':[{'model':db[_0xb8b4('0x40')],'as':'mandatoryDispositionPause'}]})[_0xb8b4('0x38')](handleEntityNotFound(_0x2f6990,null))[_0xb8b4('0x38')](saveUpdates(_0x562a9a[_0xb8b4('0x65')],null))[_0xb8b4('0x38')](respondWithResult(_0x2f6990,null))[_0xb8b4('0x58')](handleError(_0x2f6990,null));};exports[_0xb8b4('0x39')]=function(_0x15b61f,_0x33ade6){return db[_0xb8b4('0x42')][_0xb8b4('0x5d')]({'where':{'id':_0x15b61f[_0xb8b4('0x66')]['id']}})[_0xb8b4('0x38')](handleEntityNotFound(_0x33ade6,null))[_0xb8b4('0x38')](removeEntity(_0x33ade6,null))['catch'](handleError(_0x33ade6,null));};exports[_0xb8b4('0x67')]=function(_0x5b5d47,_0x940a15){return db[_0xb8b4('0x42')][_0xb8b4('0x67')]()[_0xb8b4('0x38')](respondWithResult(_0x940a15,null))[_0xb8b4('0x58')](handleError(_0x940a15,null));};exports[_0xb8b4('0x68')]=function(_0x401749,_0x30142f,_0x1bf129){if(_0x401749[_0xb8b4('0x65')]['id']){delete _0x401749[_0xb8b4('0x65')]['id'];}return db[_0xb8b4('0x42')]['find']({'where':{'id':_0x401749['params']['id']}})['then'](handleEntityNotFound(_0x30142f,null))[_0xb8b4('0x38')](function(_0x2a51a2){if(_0x2a51a2){_0x401749[_0xb8b4('0x65')][_0xb8b4('0x69')]=_0x2a51a2['id'];return db[_0xb8b4('0x6a')][_0xb8b4('0x63')](_0x401749[_0xb8b4('0x65')]);}})['then'](respondWithResult(_0x30142f,null))[_0xb8b4('0x58')](handleError(_0x30142f,null));};exports[_0xb8b4('0x6b')]=function(_0x3370c3,_0x34273d,_0x3b60a6){var _0x39e1a7={'raw':![],'where':{}};var _0x317f08={};var _0x6d8c92={'count':0x0,'rows':[]};return db[_0xb8b4('0x42')][_0xb8b4('0x6c')]({'where':{'id':_0x3370c3[_0xb8b4('0x66')]['id']}})[_0xb8b4('0x38')](handleEntityNotFound(_0x34273d,null))['then'](function(_0x550622){if(_0x550622){_0x317f08['model']=_[_0xb8b4('0x5b')](db['Disposition'][_0xb8b4('0x43')]);_0x317f08[_0xb8b4('0x46')]=_[_0xb8b4('0x5b')](_0x3370c3[_0xb8b4('0x46')]);_0x317f08[_0xb8b4('0x47')]=_[_0xb8b4('0x48')](_0x317f08[_0xb8b4('0x45')],_0x317f08[_0xb8b4('0x46')]);_0x39e1a7[_0xb8b4('0x4a')]=_['intersection'](_0x317f08[_0xb8b4('0x45')],qs[_0xb8b4('0x49')](_0x3370c3['query']['fields']));_0x39e1a7[_0xb8b4('0x4a')]=_0x39e1a7[_0xb8b4('0x4a')][_0xb8b4('0x5c')]?_0x39e1a7[_0xb8b4('0x4a')]:_0x317f08['model'];if(!_0x3370c3[_0xb8b4('0x46')]['hasOwnProperty'](_0xb8b4('0x4c'))){_0x39e1a7[_0xb8b4('0x4d')]=qs[_0xb8b4('0x4d')](_0x3370c3[_0xb8b4('0x46')][_0xb8b4('0x4d')]);_0x39e1a7[_0xb8b4('0x32')]=qs[_0xb8b4('0x32')](_0x3370c3[_0xb8b4('0x46')][_0xb8b4('0x32')]);}_0x39e1a7[_0xb8b4('0x4e')]=qs['sort'](_0x3370c3[_0xb8b4('0x46')][_0xb8b4('0x4f')]);_0x39e1a7['where']=qs[_0xb8b4('0x47')](_[_0xb8b4('0x51')](_0x3370c3[_0xb8b4('0x46')],_0x317f08[_0xb8b4('0x47')]));_0x39e1a7['where'][_0xb8b4('0x69')]=_0x550622['id'];if(_0x3370c3[_0xb8b4('0x46')][_0xb8b4('0x52')]){_0x39e1a7[_0xb8b4('0x50')]=_[_0xb8b4('0x6d')](_0x39e1a7['where'],{'$or':_[_0xb8b4('0x41')](_0x39e1a7[_0xb8b4('0x4a')],function(_0x2f9c3c){var _0x51863e={};_0x51863e[_0x2f9c3c]={'$like':'%'+_0x3370c3[_0xb8b4('0x46')][_0xb8b4('0x52')]+'%'};return _0x51863e;})});}_0x39e1a7=_['merge']({},_0x39e1a7,_0x3370c3[_0xb8b4('0x54')]);return db[_0xb8b4('0x6a')]['count']({'where':_0x39e1a7[_0xb8b4('0x50')]})[_0xb8b4('0x38')](function(_0x1f43d4){_0x6d8c92[_0xb8b4('0x31')]=_0x1f43d4;if(_0x3370c3['query'][_0xb8b4('0x55')]){_0x39e1a7['include']=[{'all':!![]}];}return db['Disposition']['findAll'](_0x39e1a7);})[_0xb8b4('0x38')](function(_0x489cd7){_0x6d8c92[_0xb8b4('0x57')]=_0x489cd7;return _0x6d8c92;});}})[_0xb8b4('0x38')](respondWithFilteredResult(_0x34273d,_0x39e1a7))[_0xb8b4('0x58')](handleError(_0x34273d,null));};exports['removeDispositions']=function(_0x5ee0f1,_0x23389d,_0x95c0ca){return db[_0xb8b4('0x42')][_0xb8b4('0x5d')]({'where':{'id':_0x5ee0f1['params']['id']}})[_0xb8b4('0x38')](handleEntityNotFound(_0x23389d,null))[_0xb8b4('0x38')](function(_0x15bba2){if(_0x15bba2){return _0x15bba2[_0xb8b4('0x6e')](_0x5ee0f1['query']['ids']);}})[_0xb8b4('0x38')](respondWithStatusCode(_0x23389d,null))[_0xb8b4('0x58')](handleError(_0x23389d,null));};exports['addAnswer']=function(_0x1c4aea,_0x5f013f,_0xd549c5){if(_0x1c4aea[_0xb8b4('0x65')]['id']){delete _0x1c4aea['body']['id'];}return db[_0xb8b4('0x42')][_0xb8b4('0x5d')]({'where':{'id':_0x1c4aea[_0xb8b4('0x66')]['id']}})[_0xb8b4('0x38')](handleEntityNotFound(_0x5f013f,null))[_0xb8b4('0x38')](function(_0x4f7ce6){if(_0x4f7ce6){_0x1c4aea[_0xb8b4('0x65')][_0xb8b4('0x69')]=_0x4f7ce6['id'];return db['CannedAnswer'][_0xb8b4('0x63')](_0x1c4aea[_0xb8b4('0x65')]);}})[_0xb8b4('0x38')](respondWithResult(_0x5f013f,null))['catch'](handleError(_0x5f013f,null));};exports[_0xb8b4('0x6f')]=function(_0x101829,_0x34f0c0,_0xe88422){var _0x5b05d4={'raw':![],'where':{}};var _0x54e544={};var _0x2a2464={'count':0x0,'rows':[]};return db[_0xb8b4('0x42')][_0xb8b4('0x6c')]({'where':{'id':_0x101829[_0xb8b4('0x66')]['id']}})['then'](handleEntityNotFound(_0x34f0c0,null))[_0xb8b4('0x38')](function(_0x12ebdb){if(_0x12ebdb){_0x54e544[_0xb8b4('0x45')]=_[_0xb8b4('0x5b')](db['CannedAnswer'][_0xb8b4('0x43')]);_0x54e544[_0xb8b4('0x46')]=_[_0xb8b4('0x5b')](_0x101829[_0xb8b4('0x46')]);_0x54e544['filters']=_[_0xb8b4('0x48')](_0x54e544[_0xb8b4('0x45')],_0x54e544['query']);_0x5b05d4[_0xb8b4('0x4a')]=_[_0xb8b4('0x48')](_0x54e544[_0xb8b4('0x45')],qs[_0xb8b4('0x49')](_0x101829[_0xb8b4('0x46')][_0xb8b4('0x49')]));_0x5b05d4[_0xb8b4('0x4a')]=_0x5b05d4[_0xb8b4('0x4a')]['length']?_0x5b05d4[_0xb8b4('0x4a')]:_0x54e544[_0xb8b4('0x45')];if(!_0x101829['query']['hasOwnProperty'](_0xb8b4('0x4c'))){_0x5b05d4[_0xb8b4('0x4d')]=qs[_0xb8b4('0x4d')](_0x101829[_0xb8b4('0x46')]['limit']);_0x5b05d4['offset']=qs[_0xb8b4('0x32')](_0x101829[_0xb8b4('0x46')]['offset']);}_0x5b05d4['order']=qs['sort'](_0x101829[_0xb8b4('0x46')][_0xb8b4('0x4f')]);_0x5b05d4[_0xb8b4('0x50')]=qs[_0xb8b4('0x47')](_[_0xb8b4('0x51')](_0x101829[_0xb8b4('0x46')],_0x54e544[_0xb8b4('0x47')]));_0x5b05d4[_0xb8b4('0x50')][_0xb8b4('0x69')]=_0x12ebdb['id'];if(_0x101829['query'][_0xb8b4('0x52')]){_0x5b05d4[_0xb8b4('0x50')]=_['merge'](_0x5b05d4[_0xb8b4('0x50')],{'$or':_['map'](_0x5b05d4[_0xb8b4('0x4a')],function(_0x48ba19){var _0x4c06d6={};_0x4c06d6[_0x48ba19]={'$like':'%'+_0x101829[_0xb8b4('0x46')][_0xb8b4('0x52')]+'%'};return _0x4c06d6;})});}_0x5b05d4=_[_0xb8b4('0x6d')]({},_0x5b05d4,_0x101829[_0xb8b4('0x54')]);return db[_0xb8b4('0x70')][_0xb8b4('0x31')]({'where':_0x5b05d4[_0xb8b4('0x50')]})[_0xb8b4('0x38')](function(_0x2149ef){_0x2a2464[_0xb8b4('0x31')]=_0x2149ef;if(_0x101829['query'][_0xb8b4('0x55')]){_0x5b05d4['include']=[{'all':!![]}];}return db[_0xb8b4('0x70')][_0xb8b4('0x56')](_0x5b05d4);})[_0xb8b4('0x38')](function(_0x2da93b){_0x2a2464[_0xb8b4('0x57')]=_0x2da93b;return _0x2a2464;});}})[_0xb8b4('0x38')](respondWithFilteredResult(_0x34f0c0,_0x5b05d4))[_0xb8b4('0x58')](handleError(_0x34f0c0,null));};exports['removeAnswers']=function(_0x59c078,_0x5905c9,_0x48f65d){return db[_0xb8b4('0x42')][_0xb8b4('0x5d')]({'where':{'id':_0x59c078[_0xb8b4('0x66')]['id']}})[_0xb8b4('0x38')](handleEntityNotFound(_0x5905c9,null))['then'](function(_0x3d0275){if(_0x3d0275){return _0x3d0275[_0xb8b4('0x71')](_0x59c078['query'][_0xb8b4('0x72')]);}})['then'](respondWithStatusCode(_0x5905c9,null))['catch'](handleError(_0x5905c9,null));};exports[_0xb8b4('0x73')]=function(_0x474d24,_0x3f0fee,_0x3c8157){_0x474d24[_0xb8b4('0x65')][_0xb8b4('0x74')]=_0x474d24[_0xb8b4('0x75')][_0xb8b4('0x76')];return db['ChatWebsite'][_0xb8b4('0x5d')]({'where':{'id':_0x474d24[_0xb8b4('0x66')]['id']}})[_0xb8b4('0x38')](handleEntityNotFound(_0x3f0fee,null))[_0xb8b4('0x38')](saveUpdates(_0x474d24[_0xb8b4('0x65')],null))[_0xb8b4('0x38')](respondWithResult(_0x3f0fee,null))['catch'](handleError(_0x3f0fee,null));};exports['addAvatar']=function(_0x5b05e6,_0x73aa41,_0x430024){_0x5b05e6['body'][_0xb8b4('0x77')]=_0x5b05e6[_0xb8b4('0x75')][_0xb8b4('0x76')];return db[_0xb8b4('0x42')][_0xb8b4('0x5d')]({'where':{'id':_0x5b05e6[_0xb8b4('0x66')]['id']}})[_0xb8b4('0x38')](handleEntityNotFound(_0x73aa41,null))[_0xb8b4('0x38')](saveUpdates(_0x5b05e6[_0xb8b4('0x65')],null))[_0xb8b4('0x38')](respondWithResult(_0x73aa41,null))[_0xb8b4('0x58')](handleError(_0x73aa41,null));};exports[_0xb8b4('0x78')]=function(_0x335b94,_0x2e1c8f,_0x209310){_0x335b94[_0xb8b4('0x65')]['customerAvatar']=_0x335b94[_0xb8b4('0x75')][_0xb8b4('0x76')];return db[_0xb8b4('0x42')]['find']({'where':{'id':_0x335b94[_0xb8b4('0x66')]['id']}})[_0xb8b4('0x38')](handleEntityNotFound(_0x2e1c8f,null))[_0xb8b4('0x38')](saveUpdates(_0x335b94[_0xb8b4('0x65')],null))[_0xb8b4('0x38')](respondWithResult(_0x2e1c8f,null))[_0xb8b4('0x58')](handleError(_0x2e1c8f,null));};exports[_0xb8b4('0x79')]=function(_0x3364fe,_0x4ab8b6,_0x3203ce){_0x3364fe[_0xb8b4('0x65')]['systemAvatar']=_0x3364fe[_0xb8b4('0x75')][_0xb8b4('0x76')];return db[_0xb8b4('0x42')][_0xb8b4('0x5d')]({'where':{'id':_0x3364fe[_0xb8b4('0x66')]['id']}})[_0xb8b4('0x38')](handleEntityNotFound(_0x4ab8b6,null))[_0xb8b4('0x38')](saveUpdates(_0x3364fe[_0xb8b4('0x65')],null))[_0xb8b4('0x38')](respondWithResult(_0x4ab8b6,null))[_0xb8b4('0x58')](handleError(_0x4ab8b6,null));};exports[_0xb8b4('0x7a')]=function(_0x55dfe5,_0xd8ae92,_0x36969f){var _0x9c658c=path[_0xb8b4('0x7b')](config['root'],'server/files/images/logos/default_logo.png');var _0x511c7b={'where':{'id':_0x55dfe5[_0xb8b4('0x66')]['id']},'attributes':['id','sitepic'],'raw':!![]};var _0x43ec64=![];return require('../../config/license/util')[_0xb8b4('0x7c')]()[_0xb8b4('0x38')](function(_0x423858){if(_0x423858){_0x43ec64=_0x423858['custom'];}})[_0xb8b4('0x38')](function(){return db[_0xb8b4('0x42')]['find'](_0x511c7b);})['then'](handleEntityNotFound(_0xd8ae92,null))['then'](function(_0x208115){if(_0x208115){if(!_[_0xb8b4('0x7d')](_0x208115[_0xb8b4('0x74')])){if(fs[_0xb8b4('0x7e')](path['join'](config[_0xb8b4('0x7f')],'server/files/images/logos/',_0x208115[_0xb8b4('0x74')]))&&_0x43ec64){_0x9c658c=path[_0xb8b4('0x7b')](config[_0xb8b4('0x7f')],_0xb8b4('0x80'),_0x208115['sitepic']);}}return _0xd8ae92[_0xb8b4('0x81')](_0x9c658c);}})['catch'](handleError(_0xd8ae92,null));};exports[_0xb8b4('0x82')]=function(_0x2a0ef3,_0x217a42,_0x282675){var _0x45b1ce=path[_0xb8b4('0x7b')](config[_0xb8b4('0x7f')],_0xb8b4('0x83'));var _0x24590a={'where':{'id':_0x2a0ef3['params']['id']},'attributes':['id',_0xb8b4('0x77')],'raw':!![]};return db[_0xb8b4('0x42')][_0xb8b4('0x5d')](_0x24590a)['then'](handleEntityNotFound(_0x217a42,null))[_0xb8b4('0x38')](function(_0x548a56){if(_0x548a56){if(!_[_0xb8b4('0x7d')](_0x548a56[_0xb8b4('0x77')])){if(fs[_0xb8b4('0x7e')](path[_0xb8b4('0x7b')](config[_0xb8b4('0x7f')],_0xb8b4('0x84'),_0x548a56[_0xb8b4('0x77')]))){_0x45b1ce=path[_0xb8b4('0x7b')](config['root'],_0xb8b4('0x84'),_0x548a56['agentAvatar']);}}return _0x217a42[_0xb8b4('0x81')](_0x45b1ce);}})[_0xb8b4('0x58')](handleError(_0x217a42,null));};exports[_0xb8b4('0x85')]=function(_0xf403a8,_0x41aaaa,_0x2fa8a7){var _0x1bdc3b=path[_0xb8b4('0x7b')](config[_0xb8b4('0x7f')],_0xb8b4('0x86'));var _0x210ba3={'where':{'id':_0xf403a8[_0xb8b4('0x66')]['id']},'attributes':['id',_0xb8b4('0x87'),'showCustomerAvatar'],'raw':!![]};return db[_0xb8b4('0x42')][_0xb8b4('0x5d')](_0x210ba3)[_0xb8b4('0x38')](handleEntityNotFound(_0x41aaaa,null))['then'](function(_0x152121){if(_0x152121){if(!_[_0xb8b4('0x7d')](_0x152121[_0xb8b4('0x87')])){if(fs[_0xb8b4('0x7e')](path[_0xb8b4('0x7b')](config[_0xb8b4('0x7f')],_0xb8b4('0x84'),_0x152121[_0xb8b4('0x87')]))&&_0x152121[_0xb8b4('0x88')]){_0x1bdc3b=path[_0xb8b4('0x7b')](config[_0xb8b4('0x7f')],_0xb8b4('0x84'),_0x152121[_0xb8b4('0x87')]);}}return _0x41aaaa[_0xb8b4('0x81')](_0x1bdc3b);}})[_0xb8b4('0x58')](handleError(_0x41aaaa,null));};exports[_0xb8b4('0x89')]=function(_0x56062e,_0x97aba,_0x3e3f5b){var _0x3ec752=path[_0xb8b4('0x7b')](config[_0xb8b4('0x7f')],_0xb8b4('0x8a'));var _0x2ee533={'where':{'id':_0x56062e[_0xb8b4('0x66')]['id']},'attributes':['id','systemAvatar'],'raw':!![]};return db['ChatWebsite'][_0xb8b4('0x5d')](_0x2ee533)[_0xb8b4('0x38')](handleEntityNotFound(_0x97aba,null))[_0xb8b4('0x38')](function(_0x19b813){if(_0x19b813){if(!_[_0xb8b4('0x7d')](_0x19b813['systemAvatar'])){if(fs[_0xb8b4('0x7e')](path[_0xb8b4('0x7b')](config[_0xb8b4('0x7f')],_0xb8b4('0x84'),_0x19b813[_0xb8b4('0x8b')]))){_0x3ec752=path[_0xb8b4('0x7b')](config[_0xb8b4('0x7f')],_0xb8b4('0x84'),_0x19b813['systemAvatar']);}}return _0x97aba[_0xb8b4('0x81')](_0x3ec752);}})[_0xb8b4('0x58')](handleError(_0x97aba,null));};exports[_0xb8b4('0x8c')]=function(_0x248165,_0x315ff7,_0x304e80){var _0x11b318=require(_0xb8b4('0x8d'));var _0x2e9def=new _0x11b318();var _0x29c7e5=_0x2e9def[_0xb8b4('0x8e')](_0x248165[_0xb8b4('0x8f')][_0xb8b4('0x90')])[_0xb8b4('0x91')]();var _0x5389dd={'body':_0x248165[_0xb8b4('0x65')],'channel':_0xb8b4('0x92')};var _0x37bad9=[];var _0x2adab9=[];var _0x37079e={};var _0x4941b9=![];return db[_0xb8b4('0x93')]['describe']()['then'](function(_0xcc9c13){if(!_0xcc9c13){throw new db['Sequelize'][(_0xb8b4('0x22'))](_0xb8b4('0x94'));}_0x37bad9=_[_0xb8b4('0x95')](_[_0xb8b4('0x5b')](_0xcc9c13),[_0xb8b4('0x96'),_0xb8b4('0x97')]);_0x2adab9=_[_0xb8b4('0x95')](_[_0xb8b4('0x5b')](_0xcc9c13),[_0xb8b4('0x96'),_0xb8b4('0x97'),_0xb8b4('0x98'),_0xb8b4('0x99')]);if(_0x248165[_0xb8b4('0x65')]['id']){delete _0x248165['body']['id'];}if(_[_0xb8b4('0x7d')](_0x248165['body'][_0xb8b4('0x9a')])){throw new db[(_0xb8b4('0x21'))][(_0xb8b4('0x22'))](_0xb8b4('0x9b'));}if(_[_0xb8b4('0x7d')](_0x248165['body'][_0xb8b4('0x65')])||_0x248165[_0xb8b4('0x65')]['body']===''){throw new db[(_0xb8b4('0x21'))][(_0xb8b4('0x22'))](_0xb8b4('0x9c'));}if(_[_0xb8b4('0x7d')](_0x248165[_0xb8b4('0x65')]['mapKey'])){throw new db[(_0xb8b4('0x21'))][(_0xb8b4('0x22'))]('mapKey\x20is\x20mandatory,\x20please\x20use\x20one\x20of\x20these:\x20'+_0x2adab9);}if(!_[_0xb8b4('0x9d')](_0x2adab9,_0x248165['body'][_0xb8b4('0x9e')])){throw new db[(_0xb8b4('0x21'))]['ValidationError'](_0xb8b4('0x9f')+_0x2adab9);}_0x37079e[_0x248165[_0xb8b4('0x65')][_0xb8b4('0x9e')]]=_0x248165[_0xb8b4('0x65')][_0xb8b4('0x9a')];})[_0xb8b4('0x38')](function(){return db['ChatWebsite'][_0xb8b4('0x5d')]({'where':{'id':_0x248165['params']['id']},'include':[{'model':db[_0xb8b4('0xa0')],'as':_0xb8b4('0xa1'),'include':[{'model':db[_0xb8b4('0x93')],'as':_0xb8b4('0xa2'),'where':_0x37079e,'limit':0x1,'order':[[_0xb8b4('0x97'),'DESC']]}]},{'model':db[_0xb8b4('0xa3')],'as':_0xb8b4('0xa4')}]});})[_0xb8b4('0x38')](handleEntityNotFound(_0x315ff7,null))[_0xb8b4('0x38')](function(_0x397791){if(_0x397791&&_0x397791[_0xb8b4('0xa1')]){_0x5389dd[_0xb8b4('0xa5')]=_0x397791;_0x5389dd[_0xb8b4('0xa6')]=_0x397791['Applications'];_0x5389dd[_0xb8b4('0xa7')]=_0x397791[_0xb8b4('0xa1')];_0x5389dd[_0xb8b4('0xa6')]=_[_0xb8b4('0xa8')](_0x5389dd[_0xb8b4('0xa6')],['priority'],[_0xb8b4('0xa9')]);if(_0x5389dd['account'][_0xb8b4('0xa4')]){delete _0x5389dd[_0xb8b4('0xa5')][_0xb8b4('0xa4')];}if(_0x5389dd['account'][_0xb8b4('0xa1')]&&_0x5389dd[_0xb8b4('0xa5')]['List'][_0xb8b4('0xa2')][_0xb8b4('0x5c')]){return _0x5389dd['account']['List'][_0xb8b4('0xa2')][0x0];}var _0x58140c=_[_0xb8b4('0x19')](_0x248165[_0xb8b4('0x65')],{'firstName':_0x248165[_0xb8b4('0x65')][_0xb8b4('0x9a')],'ListId':_0x397791[_0xb8b4('0x99')]});_0x58140c[_0x248165['body'][_0xb8b4('0x9e')]]=_0x248165['body'][_0xb8b4('0x9a')];return db[_0xb8b4('0x93')][_0xb8b4('0x63')](_0x58140c,{'fields':_0x37bad9,'raw':!![]});}})[_0xb8b4('0x38')](handleEntityNotFound(_0x315ff7,null))['then'](function(_0x1b3bc9){_0x5389dd[_0xb8b4('0xaa')]=_0x1b3bc9;var _0x5c8346=_0x248165[_0xb8b4('0x65')][_0xb8b4('0xab')];if(_0x248165[_0xb8b4('0x8f')][_0xb8b4('0xac')]){_0x5c8346=_0x248165[_0xb8b4('0x8f')][_0xb8b4('0xac')];}else if(_0x248165[_0xb8b4('0x8f')][_0xb8b4('0xad')]){_0x5c8346=_[_0xb8b4('0xae')](_0x248165[_0xb8b4('0x8f')][_0xb8b4('0xad')][_0xb8b4('0xaf')](','));}if(_0x1b3bc9){var _0x71dc3c={'ContactId':_0x1b3bc9['id'],'ChatWebsiteId':_0x248165['params']['id'],'from':(_0x1b3bc9['firstName']||'')+'\x20'+(_0x1b3bc9['lastName']||''),'customerIp':_0x5c8346,'customerPort':_0x248165['headers'][_0xb8b4('0xb0')]?_0x248165[_0xb8b4('0x8f')][_0xb8b4('0xb0')]:null,'referer':_0x248165[_0xb8b4('0x65')]['referer'],'browserName':_0x29c7e5[_0xb8b4('0xb1')][_0xb8b4('0x3d')]&&_0x29c7e5[_0xb8b4('0xb1')][_0xb8b4('0xb2')]?util[_0xb8b4('0xb3')](_0xb8b4('0xb4'),_0x29c7e5[_0xb8b4('0xb1')]['name'],_0x29c7e5[_0xb8b4('0xb1')][_0xb8b4('0xb2')]):'unknown','browserVersion':_0x29c7e5[_0xb8b4('0xb1')][_0xb8b4('0xb2')]||_0xb8b4('0xb5'),'osName':util[_0xb8b4('0xb3')](_0xb8b4('0xb4'),_0x29c7e5['os']['name'],_0x29c7e5['os'][_0xb8b4('0xb2')]),'osVersion':_0x29c7e5['os'][_0xb8b4('0xb2')],'deviceModel':_0x29c7e5['device'][_0xb8b4('0x45')]&&_0x29c7e5[_0xb8b4('0xb6')][_0xb8b4('0xb7')]?util['format']('%s\x20%s\x20%s',_0x29c7e5['device'][_0xb8b4('0x45')],_0x29c7e5[_0xb8b4('0xb6')][_0xb8b4('0xb7')],_0x29c7e5['device']['type']):null,'deviceVendor':_0x29c7e5[_0xb8b4('0xb6')][_0xb8b4('0xb7')],'deviceType':_0x29c7e5[_0xb8b4('0xb6')]['type'],'formData':JSON[_0xb8b4('0xb8')](_0x248165[_0xb8b4('0x65')])};var _0x1f2a88={'ChatWebsiteId':_0x248165[_0xb8b4('0x66')]['id'],'closed':![]};if(_0x248165[_0xb8b4('0x65')]['threadId']){_0x1f2a88[_0xb8b4('0xb9')]=_0x248165[_0xb8b4('0x65')][_0xb8b4('0xb9')];return db[_0xb8b4('0xba')][_0xb8b4('0x5d')]({'where':_0x1f2a88})[_0xb8b4('0x38')](function(_0x5a6058){if(_0x5a6058){return[_0x5a6058,![]];}_0x71dc3c[_0xb8b4('0xb9')]=_0x248165['body'][_0xb8b4('0xb9')];_0x71dc3c[_0xb8b4('0xbb')]=_0x248165[_0xb8b4('0x65')]['externalUrl'];return db[_0xb8b4('0xba')][_0xb8b4('0x63')](_0x71dc3c)[_0xb8b4('0x38')](function(_0x2943e0){return[_0x2943e0,!![]];});});}_0x1f2a88['ContactId']=_0x1b3bc9['id'];if(_0x248165[_0xb8b4('0x65')][_0xb8b4('0xbc')]&&_0x248165[_0xb8b4('0x65')][_0xb8b4('0xbc')]['id']){_0x1f2a88['id']=_0x248165[_0xb8b4('0x65')][_0xb8b4('0xbc')]['id'];return db[_0xb8b4('0xba')]['find']({'where':_0x1f2a88})[_0xb8b4('0x38')](function(_0x148e99){if(_0x148e99){return[_0x148e99,![]];}return db[_0xb8b4('0xba')][_0xb8b4('0x63')](_0x71dc3c)[_0xb8b4('0x38')](function(_0x2b6ca2){return[_0x2b6ca2,!![]];});});}return db[_0xb8b4('0xba')][_0xb8b4('0x63')](_0x71dc3c)[_0xb8b4('0x38')](function(_0x47a767){return[_0x47a767,!![]];});}})['spread'](function(_0x4edd7b,_0x32f876){if(_0x4edd7b){_0x4941b9=_0x32f876;if(!_0x32f876){var _0x10325c={'from':(_0x5389dd[_0xb8b4('0xaa')][_0xb8b4('0xbd')]||'')+'\x20'+(_0x5389dd[_0xb8b4('0xaa')][_0xb8b4('0xbe')]||'')};if(_0x248165[_0xb8b4('0x65')][_0xb8b4('0xb9')]&&_0x248165[_0xb8b4('0x65')][_0xb8b4('0xbf')]&&_0x248165[_0xb8b4('0x65')][_0xb8b4('0xb9')]!=_0x248165['body'][_0xb8b4('0xbf')]){_0x10325c[_0xb8b4('0xb9')]=_0x248165[_0xb8b4('0x65')][_0xb8b4('0xbf')];}return _0x4edd7b[_0xb8b4('0x37')](_0x10325c);}else{return _0x4edd7b;}}})['then'](function(_0xbc1727){_0x5389dd[_0xb8b4('0xbc')]=_0xbc1727[_0xb8b4('0x3a')]({'plain':!![]});_0x5389dd[_0xb8b4('0xbc')][_0xb8b4('0xc0')]=_0x4941b9;if(_0x5389dd[_0xb8b4('0xbc')][_0xb8b4('0xc0')]){if(_0x5389dd[_0xb8b4('0xa5')]['autoclose']){_0x5389dd[_0xb8b4('0xa6')][_0xb8b4('0xc1')]({'id':0x0,'priority':_0x5389dd[_0xb8b4('0xa6')]['length']+0x1,'app':'close','appdata':'unmanaged','interval':'*,*,*,*'});}}return db[_0xb8b4('0xc2')]['create']({'body':_0x248165['body']['body'],'ChatWebsiteId':_0x248165[_0xb8b4('0x66')]['id'],'ChatInteractionId':_0xbc1727['id'],'direction':'in','ContactId':_0x5389dd[_0xb8b4('0xaa')]['id'],'AttachmentId':_0x248165['body'][_0xb8b4('0xc3')]});})['then'](function(_0x4b3de6){_0x5389dd['message']=_0x4b3de6;if(_0x5389dd[_0xb8b4('0xbc')][_0xb8b4('0xc4')]){return db['User']['find']({'attributes':['id','name'],'where':{'id':_0x5389dd[_0xb8b4('0xbc')][_0xb8b4('0xc4')]}})[_0xb8b4('0x38')](function(_0x22eb73){if(_0x22eb73){_0x5389dd[_0xb8b4('0xa6')][_0xb8b4('0xc5')]({'id':0x0,'priority':0x0,'app':_0xb8b4('0xc6'),'appdata':_0x22eb73[_0xb8b4('0x3d')]+','+(_0x5389dd['account'][_0xb8b4('0xc7')]||0xa),'interval':_0xb8b4('0xc8')});_0x5389dd['forcedOwnership']=!![];}return respondWithRpcPromise(_0xb8b4('0xc9'),_0xb8b4('0xca'),_0x5389dd);});}return respondWithRpcPromise(_0xb8b4('0xc9'),'startRouting',_0x5389dd);})[_0xb8b4('0x38')](function(_0x396b83){respondWithRpcPromise(_0xb8b4('0xcb'),'EventManager',{'event':_0xb8b4('0x8c'),'message':_0x396b83},client9002);return _0x396b83;})['then'](respondWithResult(_0x315ff7,null))[_0xb8b4('0x58')](handleError(_0x315ff7,null));};exports[_0xb8b4('0xcc')]=function(_0x5e809c,_0x57ec29,_0x59e3e7){var _0x2709be,_0x38d14f,_0x1f8227;var _0x40d5a1=[];var _0x379546=[];var _0x32c846={};return db[_0xb8b4('0x93')][_0xb8b4('0x67')]()[_0xb8b4('0x38')](function(_0x3d6f8e){if(!_0x3d6f8e){throw new db[(_0xb8b4('0x21'))][(_0xb8b4('0x22'))]('no\x20available\x20attributes');}_0x379546=_[_0xb8b4('0x95')](_[_0xb8b4('0x5b')](_0x3d6f8e),[_0xb8b4('0x96'),_0xb8b4('0x97')]);_0x40d5a1=_[_0xb8b4('0x95')](_['keys'](_0x3d6f8e),[_0xb8b4('0x96'),'updatedAt',_0xb8b4('0x98'),'ListId']);if(_0x5e809c[_0xb8b4('0x65')]['id']){delete _0x5e809c[_0xb8b4('0x65')]['id'];}if(_[_0xb8b4('0x7d')](_0x5e809c['body'][_0xb8b4('0x9a')])){throw _0x57ec29['status'](0x1f4)[_0xb8b4('0x3e')](new db[(_0xb8b4('0x21'))][(_0xb8b4('0x22'))]('from\x20is\x20mandatory'));}if(_['isNil'](_0x5e809c[_0xb8b4('0x65')][_0xb8b4('0x65')])||_0x5e809c[_0xb8b4('0x65')]['body']===''){throw _0x57ec29[_0xb8b4('0x2f')](0x1f4)[_0xb8b4('0x3e')](new db[(_0xb8b4('0x21'))][(_0xb8b4('0x22'))](_0xb8b4('0x9c')));}if(_[_0xb8b4('0x7d')](_0x5e809c[_0xb8b4('0x65')][_0xb8b4('0xcd')])){throw _0x57ec29[_0xb8b4('0x2f')](0x1f4)['send'](new db['Sequelize'][(_0xb8b4('0x22'))](_0xb8b4('0xce')+_0x40d5a1));}if(!_[_0xb8b4('0x9d')](_0x40d5a1,_0x5e809c[_0xb8b4('0x65')][_0xb8b4('0xcd')])){throw _0x57ec29['status'](0x1f4)[_0xb8b4('0x3e')](new db[(_0xb8b4('0x21'))][(_0xb8b4('0x22'))](_0xb8b4('0xcf')+_0x40d5a1));}_0x32c846[_0x5e809c[_0xb8b4('0x65')][_0xb8b4('0xcd')]]=_0x5e809c[_0xb8b4('0x65')][_0xb8b4('0x9a')];})[_0xb8b4('0x38')](function(){return db[_0xb8b4('0x42')][_0xb8b4('0x5d')]({'where':{'id':_0x5e809c[_0xb8b4('0x66')]['id']},'include':[{'model':db[_0xb8b4('0xa0')],'as':_0xb8b4('0xa1')}]});})[_0xb8b4('0x38')](handleEntityNotFound(_0x57ec29,null))['then'](function(_0x2bcb73){if(_0x2bcb73&&_0x2bcb73[_0xb8b4('0xa1')]){_0x38d14f=_0x2bcb73;var _0x988bba=_[_0xb8b4('0x19')](_0x5e809c[_0xb8b4('0x65')],{'firstName':_0x5e809c[_0xb8b4('0x65')][_0xb8b4('0x9a')],'phone':_0x5e809c[_0xb8b4('0x65')][_0xb8b4('0x9a')],'ListId':_0x2bcb73[_0xb8b4('0x99')]});_0x988bba[_0x5e809c[_0xb8b4('0x65')][_0xb8b4('0xcd')]]=_0x5e809c['body'][_0xb8b4('0x9a')];return db[_0xb8b4('0x93')][_0xb8b4('0xd0')]({'where':_0x32c846,'defaults':_0x988bba});}})[_0xb8b4('0xd1')](function(_0x384fb7){if(_0x384fb7){_0x1f8227=_0x384fb7;var _0xd79120=fs[_0xb8b4('0xd2')](path[_0xb8b4('0x7b')](config['root'],'server/files/templates/chatOfflineMessage.ejs'),_0xb8b4('0xd3'));var _0x503abf=ejs[_0xb8b4('0xd4')](_0xd79120,{'body':_[_0xb8b4('0xd5')](_0x5e809c[_0xb8b4('0x65')][_0xb8b4('0x65')]),'bodyTitle':_0x38d14f[_0xb8b4('0xd6')]});return db['ChatOfflineMessage'][_0xb8b4('0x63')]({'body':_0x503abf,'ContactId':_0x384fb7['id'],'ChatWebsiteId':_0x38d14f['id']});}})['then'](function(_0x8e0f4){if(_0x8e0f4){_0x2709be=_0x8e0f4;return db[_0xb8b4('0xd7')][_0xb8b4('0x6c')]({'where':{'service':!![]},'include':[{'model':db[_0xb8b4('0xd8')],'as':_0xb8b4('0xd9'),'raw':!![]}]});}})[_0xb8b4('0x38')](function(_0x132544){if(_0x132544&&_0x132544[_0xb8b4('0xd9')]&&_0x38d14f[_0xb8b4('0xda')]){var _0x4ebce3={'tls':{'rejectUnauthorized':![]}};if(_0x132544[_0xb8b4('0xd9')][_0xb8b4('0xdb')]){_0x4ebce3[_0xb8b4('0xdb')]=_0x132544[_0xb8b4('0xd9')]['service'];}else{_0x4ebce3['host']=_0x132544[_0xb8b4('0xd9')][_0xb8b4('0xdc')];_0x4ebce3[_0xb8b4('0xdd')]=_0x132544['Smtp'][_0xb8b4('0xdd')];_0x4ebce3[_0xb8b4('0xde')]=_0x132544[_0xb8b4('0xd9')]['secure'];}if(_0x132544[_0xb8b4('0xd9')][_0xb8b4('0xdf')]){_0x4ebce3[_0xb8b4('0xe0')]={'user':_0x132544[_0xb8b4('0xd9')][_0xb8b4('0x5e')],'pass':_0x132544[_0xb8b4('0xd9')][_0xb8b4('0xe1')]};}return respondWithRpcPromise(_0xb8b4('0xe2'),_0xb8b4('0xe3'),{'account':_0x4ebce3,'message':{'from':util[_0xb8b4('0xb3')](_0xb8b4('0xe4'),_0x132544[_0xb8b4('0x3d')],_0x132544[_0xb8b4('0xe5')]||_0x132544[_0xb8b4('0xd9')][_0xb8b4('0x5e')]),'to':_0x38d14f['forwardOfflineAddress'],'subject':_0x38d14f[_0xb8b4('0xe6')],'text':_0x2709be[_0xb8b4('0x65')]}},client9003)[_0xb8b4('0x38')](function(){return _0x2709be;})[_0xb8b4('0x58')](function(_0x4e046c){console['error'](_0x4e046c);});}})[_0xb8b4('0x38')](function(){if(_0x2709be){return _0x2709be;}})[_0xb8b4('0x38')](respondWithResult(_0x57ec29,null))[_0xb8b4('0x58')](handleError(_0x57ec29,null));};exports['addInteraction']=function(_0x4d1240,_0xed2c1,_0x9f031e){return db['ChatInteraction'][_0xb8b4('0x5d')]({'where':{'id':_0x4d1240[_0xb8b4('0x66')]['id']}})['then'](handleEntityNotFound(_0xed2c1,null))[_0xb8b4('0x38')](function(_0x5218da){if(_0x5218da){return _0x5218da[_0xb8b4('0xe7')](_0x4d1240[_0xb8b4('0x65')][_0xb8b4('0x72')],_[_0xb8b4('0xe8')](_0x4d1240[_0xb8b4('0x65')],[_0xb8b4('0x72'),'id'])||{});}})[_0xb8b4('0x38')](respondWithResult(_0xed2c1,null))[_0xb8b4('0x58')](handleError(_0xed2c1,null));};exports['getInteractions']=function(_0x39abbf,_0x302037,_0x2ce34b){var _0xa0badb={'raw':![],'where':{}};var _0x397589={};var _0xad4c67={'count':0x0,'rows':[]};return db[_0xb8b4('0x42')][_0xb8b4('0x6c')]({'where':{'id':_0x39abbf['params']['id']}})[_0xb8b4('0x38')](handleEntityNotFound(_0x302037,null))['then'](function(_0x10133f){if(_0x10133f){_0x397589[_0xb8b4('0x45')]=_[_0xb8b4('0x5b')](db[_0xb8b4('0xba')][_0xb8b4('0x43')]);_0x397589[_0xb8b4('0x46')]=_['keys'](_0x39abbf[_0xb8b4('0x46')]);_0x397589['filters']=_[_0xb8b4('0x48')](_0x397589['model'],_0x397589[_0xb8b4('0x46')]);_0xa0badb[_0xb8b4('0x4a')]=_[_0xb8b4('0x48')](_0x397589['model'],qs[_0xb8b4('0x49')](_0x39abbf[_0xb8b4('0x46')][_0xb8b4('0x49')]));_0xa0badb[_0xb8b4('0x4a')]=_0xa0badb[_0xb8b4('0x4a')][_0xb8b4('0x5c')]?_0xa0badb[_0xb8b4('0x4a')]:_0x397589['model'];if(!_0x39abbf[_0xb8b4('0x46')][_0xb8b4('0x4b')]('nolimit')){_0xa0badb[_0xb8b4('0x4d')]=qs[_0xb8b4('0x4d')](_0x39abbf['query']['limit']);_0xa0badb[_0xb8b4('0x32')]=qs[_0xb8b4('0x32')](_0x39abbf[_0xb8b4('0x46')][_0xb8b4('0x32')]);}_0xa0badb[_0xb8b4('0x4e')]=qs[_0xb8b4('0x4f')](_0x39abbf['query'][_0xb8b4('0x4f')]);_0xa0badb[_0xb8b4('0x50')]=qs['filters'](_[_0xb8b4('0x51')](_0x39abbf[_0xb8b4('0x46')],_0x397589['filters']));_0xa0badb[_0xb8b4('0x50')][_0xb8b4('0x69')]=_0x10133f['id'];if(_0x39abbf[_0xb8b4('0x46')]['filter']){_0xa0badb[_0xb8b4('0x50')]=_[_0xb8b4('0x6d')](_0xa0badb[_0xb8b4('0x50')],{'$or':_[_0xb8b4('0x41')](_0xa0badb['attributes'],function(_0x139b57){var _0x3e30a3={};_0x3e30a3[_0x139b57]={'$like':'%'+_0x39abbf['query'][_0xb8b4('0x52')]+'%'};return _0x3e30a3;})});}_0xa0badb=_[_0xb8b4('0x6d')]({},_0xa0badb,_0x39abbf[_0xb8b4('0x54')]);return db['ChatInteraction']['count']({'where':_0xa0badb[_0xb8b4('0x50')]})[_0xb8b4('0x38')](function(_0x7814e8){_0xad4c67[_0xb8b4('0x31')]=_0x7814e8;if(_0x39abbf[_0xb8b4('0x46')][_0xb8b4('0x55')]){_0xa0badb['include']=[{'model':db[_0xb8b4('0x93')],'as':_0xb8b4('0xe9'),'required':![]},{'model':db[_0xb8b4('0xea')],'as':_0xb8b4('0xeb'),'attributes':[_0xb8b4('0x3d'),_0xb8b4('0xec'),_0xb8b4('0xed')],'required':![]},{'model':db['Tag'],'as':_0xb8b4('0xee'),'attributes':['id',_0xb8b4('0x3d'),'color'],'where':_0x39abbf['query']['tag']?{'id':_0x39abbf[_0xb8b4('0x46')][_0xb8b4('0xef')]}:undefined,'required':_0x39abbf[_0xb8b4('0x46')][_0xb8b4('0xef')]?!![]:![]}];}return db[_0xb8b4('0xba')][_0xb8b4('0x56')](_0xa0badb);})[_0xb8b4('0x38')](function(_0x40703f){_0xad4c67[_0xb8b4('0x57')]=_0x40703f;return _0xad4c67;});}})[_0xb8b4('0x38')](respondWithFilteredResult(_0x302037,_0xa0badb))[_0xb8b4('0x58')](handleError(_0x302037,null));};function iftimePromise(_0x499ceb,_0x5bb78f){return respondWithRpcPromise(_0xb8b4('0xf0'),_0xb8b4('0xf1'),{'command':_0x5bb78f[_0xb8b4('0xf2')]?util['format']('iftime\x20%s,%s',_0x499ceb['interval'],_0x5bb78f['timezone']):util[_0xb8b4('0xb3')](_0xb8b4('0xf3'),_0x499ceb['interval'])},client9002)[_0xb8b4('0x38')](function(_0x4bca94){var _0xa9cd10=_0x4bca94&&_0x4bca94[_0xb8b4('0xf4')](_0xb8b4('0xf5'))>=0x0?!![]:![];logger['info'](_0xb8b4('0xf6'),_0x5bb78f['id'],_0x499ceb['id'],_0x499ceb[_0xb8b4('0xf7')],_0xa9cd10?'ONLINE':'OFFLINE',_0x5bb78f[_0xb8b4('0xf2')]?_0x5bb78f[_0xb8b4('0xf2')]:_0xb8b4('0xf8'));return _0xa9cd10;})[_0xb8b4('0x58')](function(_0x26ce7a){logger['error'](_0xb8b4('0xf6'),_0x5bb78f['id'],_0x499ceb['id'],_0x499ceb[_0xb8b4('0xf7')],util[_0xb8b4('0xf9')](_0x26ce7a,{'showHidden':![],'depth':null}),_0x5bb78f['timezone']?_0x5bb78f['timezone']:_0xb8b4('0xf8'));return![];});}exports['getSnippet']=function(_0x53af50,_0x3e9e74,_0x277cd5){var _0x4b5cc7=0x0;var _0x1542ad=0x0;var _0xe1a3d6=![];var _0x1f7550;var _0x24409f;return db[_0xb8b4('0x42')][_0xb8b4('0x5d')]({'where':{'id':_0x53af50[_0xb8b4('0x66')]['id']},'include':[{'model':db['Interval'],'as':_0xb8b4('0xfa'),'include':[{'model':db[_0xb8b4('0xfa')],'as':_0xb8b4('0xfb'),'attributes':['id',_0xb8b4('0xf7')],'raw':!![]}]}]})[_0xb8b4('0x38')](handleEntityNotFound(_0x3e9e74,null))[_0xb8b4('0x38')](function(_0x36c04c){if(_0x36c04c){_0x1f7550=_0x36c04c;return _0x36c04c[_0xb8b4('0xfc')]({'raw':!![]});}})['then'](function(_0x901196){if(_0x1f7550){if(_0x901196){_0x24409f=_0x901196;}}return require(_0xb8b4('0xfd'))[_0xb8b4('0x7c')]();})[_0xb8b4('0x38')](function(_0x598352){if(_0x598352){_0x1542ad=_0x598352[_0xb8b4('0xfe')];_0xe1a3d6=_0x598352['custom'];}})['then'](function(){return db[_0xb8b4('0xba')][_0xb8b4('0x31')]({'where':{'closed':![]}});})[_0xb8b4('0x38')](function(_0x2e4202){_0x4b5cc7=_0x2e4202;if(_0x1542ad&&_0x2e4202>_0x1542ad){return db[_0xb8b4('0xff')][_0xb8b4('0x6c')]({'where':{'id':0x1}})[_0xb8b4('0x38')](function(_0x35dd89){if(_0x35dd89){_0x35dd89[_0xb8b4('0x100')](_0xb8b4('0x101'));}});}})[_0xb8b4('0x38')](function(){if(_0x1f7550[_0xb8b4('0xfa')]&&_0x1f7550['Interval'][_0xb8b4('0xfb')]){var _0x1182c1=[];for(var _0x2c54bb=0x0;_0x2c54bb<_0x1f7550['Interval'][_0xb8b4('0xfb')][_0xb8b4('0x5c')];_0x2c54bb++){var _0x1607f6=_0x1f7550['Interval'][_0xb8b4('0xfb')][_0x2c54bb][_0xb8b4('0x3a')]({'plain':!![]});_0x1182c1[_0xb8b4('0xc1')](iftimePromise(_0x1607f6,_0x1f7550));}return BPromise['all'](_0x1182c1)[_0xb8b4('0x38')](function(_0x396e02){return _[_0xb8b4('0x102')](_0x396e02);});}else{return!![];}})['then'](function(_0x169185){var _0x1dbc08=fs[_0xb8b4('0xd2')](path[_0xb8b4('0x7b')](config[_0xb8b4('0x7f')],_0xb8b4('0x103')),'utf8');var _0x339599={'remote':_0x1f7550[_0xb8b4('0x104')],'query':querystring[_0xb8b4('0xb8')](_['merge'](_0x1f7550[_0xb8b4('0x3a')]({'plain':!![]}),{'customerIp':_0x53af50[_0xb8b4('0x8f')][_0xb8b4('0xad')]||_0x53af50['headers']['x-real-ip']||_0x53af50['connection'][_0xb8b4('0x105')]||_0x53af50['ip'],'referer':_0x53af50[_0xb8b4('0x8f')][_0xb8b4('0x106')],'openedInteractions':_0x4b5cc7,'maxInteractions':_0x1542ad,'virtual':_0xe1a3d6['virtual'],'online':_0x169185,'custom':_0xe1a3d6}))['replace'](/'/g,'\x5c\x27')};_0x3e9e74[_0xb8b4('0x3e')](ejs['render'](Mustache[_0xb8b4('0xd4')](_0x1dbc08,_0x339599),{'proactiveActions':_0x24409f,'alignment':_0x1f7550[_0xb8b4('0x107')],'verticalAlignment':_0x1f7550[_0xb8b4('0x108')],'div_color':_0x1f7550[_0xb8b4('0x109')],'text_color':_0x1f7550[_0xb8b4('0x10a')]}));})[_0xb8b4('0x58')](handleError(_0x3e9e74,null));};exports['addApplications']=function(_0x15d420,_0x4dca1e,_0x44225c){return db[_0xb8b4('0x42')]['findOne']({'where':{'id':_0x15d420[_0xb8b4('0x66')]['id']}})[_0xb8b4('0x38')](handleEntityNotFound(_0x4dca1e,null))[_0xb8b4('0x38')](function(_0x1ffc19){if(_0x1ffc19){return db[_0xb8b4('0x10b')]['transaction'](function(_0x46d26f){return db[_0xb8b4('0xa3')][_0xb8b4('0x39')]({'where':{'ChatWebsiteId':_0x15d420['params']['id']},'transaction':_0x46d26f})['then'](function(_0xce2089){var _0x482704=_[_0xb8b4('0x41')](_0x15d420['body'],function(_0x8a8401){_0x8a8401[_0xb8b4('0x69')]=_0x15d420[_0xb8b4('0x66')]['id'];return _0x8a8401;});return db['ChatApplication'][_0xb8b4('0x10c')](_0x482704,{'transaction':_0x46d26f});});})[_0xb8b4('0x38')](function(){return db[_0xb8b4('0xa3')]['findAndCountAll']({'where':{'ChatWebsiteId':_0x15d420['params']['id']},'order':'priority'});});}})['then'](respondWithResult(_0x4dca1e,null))[_0xb8b4('0x58')](handleError(_0x4dca1e,null));};exports['getApplications']=function(_0x22bb97,_0x455b32,_0x122349){var _0x515498={};var _0x3a5402={};var _0x11e027;var _0x5c3062;return db[_0xb8b4('0x42')][_0xb8b4('0x6c')]({'where':{'id':_0x22bb97[_0xb8b4('0x66')]['id']}})['then'](handleEntityNotFound(_0x455b32,null))['then'](function(_0x65ebb3){if(_0x65ebb3){_0x11e027=_0x65ebb3;_0x3a5402[_0xb8b4('0x45')]=_[_0xb8b4('0x5b')](db['ChatApplication']['rawAttributes']);_0x3a5402[_0xb8b4('0x46')]=_['keys'](_0x22bb97[_0xb8b4('0x46')]);_0x3a5402[_0xb8b4('0x47')]=_[_0xb8b4('0x48')](_0x3a5402[_0xb8b4('0x45')],_0x3a5402[_0xb8b4('0x46')]);_0x515498[_0xb8b4('0x4a')]=_[_0xb8b4('0x48')](_0x3a5402[_0xb8b4('0x45')],qs[_0xb8b4('0x49')](_0x22bb97['query'][_0xb8b4('0x49')]));_0x515498[_0xb8b4('0x4a')]=_0x515498['attributes'][_0xb8b4('0x5c')]?_0x515498[_0xb8b4('0x4a')]:_0x3a5402[_0xb8b4('0x45')];_0x515498[_0xb8b4('0x4e')]=qs['sort'](_0x22bb97[_0xb8b4('0x46')][_0xb8b4('0x4f')]);_0x515498[_0xb8b4('0x50')]=qs[_0xb8b4('0x47')](_['pick'](_0x22bb97[_0xb8b4('0x46')],_0x3a5402[_0xb8b4('0x47')]));if(_0x22bb97[_0xb8b4('0x46')][_0xb8b4('0x52')]){_0x515498['where']=_[_0xb8b4('0x6d')](_0x515498[_0xb8b4('0x50')],{'$or':_['map'](_0x515498[_0xb8b4('0x4a')],function(_0x18091f){var _0x3fb19b={};_0x3fb19b[_0x18091f]={'$like':'%'+_0x22bb97[_0xb8b4('0x46')][_0xb8b4('0x52')]+'%'};return _0x3fb19b;})});}_0x515498=_['merge']({},_0x515498,_0x22bb97['options']);return _0x11e027['getApplications'](_0x515498);}})[_0xb8b4('0x38')](function(_0x4fc0f7){if(_0x4fc0f7){_0x5c3062=_0x4fc0f7['length'];if(!_0x22bb97[_0xb8b4('0x46')][_0xb8b4('0x4b')]('nolimit')){_0x515498['limit']=qs[_0xb8b4('0x4d')](_0x22bb97[_0xb8b4('0x46')][_0xb8b4('0x4d')]);_0x515498['offset']=qs[_0xb8b4('0x32')](_0x22bb97[_0xb8b4('0x46')][_0xb8b4('0x32')]);}return _0x11e027[_0xb8b4('0x10d')](_0x515498);}})['then'](function(_0x18c8b1){if(_0x18c8b1){return _0x18c8b1?{'count':_0x5c3062,'rows':_0x18c8b1}:null;}})[_0xb8b4('0x38')](respondWithResult(_0x455b32,null))[_0xb8b4('0x58')](handleError(_0x455b32,null));};exports['addProactiveActions']=function(_0x87593f,_0x1b1060,_0x5d92cb){return db[_0xb8b4('0x10e')]['find']({'where':{'id':_0x87593f[_0xb8b4('0x66')]['id']}})[_0xb8b4('0x38')](handleEntityNotFound(_0x1b1060,null))[_0xb8b4('0x38')](function(_0x169161){if(_0x169161){return _0x169161[_0xb8b4('0x10f')](_0x87593f[_0xb8b4('0x65')][_0xb8b4('0x72')],_[_0xb8b4('0xe8')](_0x87593f[_0xb8b4('0x65')],['ids','id'])||{});}})[_0xb8b4('0x38')](respondWithResult(_0x1b1060,null))['catch'](handleError(_0x1b1060,null));};exports[_0xb8b4('0xfc')]=function(_0x5df555,_0x46ba71,_0xd3c231){var _0x303eb4={};var _0x2c2bbf={};var _0x4b71cf;var _0x4d3d88;return db['ChatWebsite'][_0xb8b4('0x6c')]({'where':{'id':_0x5df555[_0xb8b4('0x66')]['id']}})['then'](handleEntityNotFound(_0x46ba71,null))[_0xb8b4('0x38')](function(_0x1d5552){if(_0x1d5552){_0x4b71cf=_0x1d5552;_0x2c2bbf[_0xb8b4('0x45')]=_[_0xb8b4('0x5b')](db[_0xb8b4('0x110')][_0xb8b4('0x43')]);_0x2c2bbf[_0xb8b4('0x46')]=_[_0xb8b4('0x5b')](_0x5df555[_0xb8b4('0x46')]);_0x2c2bbf['filters']=_[_0xb8b4('0x48')](_0x2c2bbf[_0xb8b4('0x45')],_0x2c2bbf['query']);_0x303eb4[_0xb8b4('0x4a')]=_[_0xb8b4('0x48')](_0x2c2bbf[_0xb8b4('0x45')],qs['fields'](_0x5df555[_0xb8b4('0x46')][_0xb8b4('0x49')]));_0x303eb4[_0xb8b4('0x4a')]=_0x303eb4[_0xb8b4('0x4a')][_0xb8b4('0x5c')]?_0x303eb4[_0xb8b4('0x4a')]:_0x2c2bbf[_0xb8b4('0x45')];_0x303eb4['order']=qs[_0xb8b4('0x4f')](_0x5df555['query'][_0xb8b4('0x4f')]);_0x303eb4[_0xb8b4('0x50')]=qs[_0xb8b4('0x47')](_[_0xb8b4('0x51')](_0x5df555[_0xb8b4('0x46')],_0x2c2bbf['filters']));if(_0x5df555[_0xb8b4('0x46')][_0xb8b4('0x52')]){_0x303eb4[_0xb8b4('0x50')]=_[_0xb8b4('0x6d')](_0x303eb4['where'],{'$or':_[_0xb8b4('0x41')](_0x303eb4[_0xb8b4('0x4a')],function(_0x227cbc){var _0x317eb7={};_0x317eb7[_0x227cbc]={'$like':'%'+_0x5df555[_0xb8b4('0x46')][_0xb8b4('0x52')]+'%'};return _0x317eb7;})});}_0x303eb4=_[_0xb8b4('0x6d')]({},_0x303eb4,_0x5df555[_0xb8b4('0x54')]);return _0x4b71cf[_0xb8b4('0xfc')](_0x303eb4);}})[_0xb8b4('0x38')](function(_0x1e0013){if(_0x1e0013){_0x4d3d88=_0x1e0013[_0xb8b4('0x5c')];if(!_0x5df555[_0xb8b4('0x46')][_0xb8b4('0x4b')](_0xb8b4('0x4c'))){_0x303eb4['limit']=qs['limit'](_0x5df555['query'][_0xb8b4('0x4d')]);_0x303eb4[_0xb8b4('0x32')]=qs['offset'](_0x5df555[_0xb8b4('0x46')][_0xb8b4('0x32')]);}return _0x4b71cf[_0xb8b4('0xfc')](_0x303eb4);}})[_0xb8b4('0x38')](function(_0x3495d6){if(_0x3495d6){return _0x3495d6?{'count':_0x4d3d88,'rows':_0x3495d6}:null;}})[_0xb8b4('0x38')](respondWithResult(_0x46ba71,null))[_0xb8b4('0x58')](handleError(_0x46ba71,null));};exports[_0xb8b4('0x111')]=function(_0x527a75,_0x638d3b,_0x5aefbe){var _0x560816=_0x527a75[_0xb8b4('0x46')]['online']==='false'?_0xb8b4('0x112'):_0xb8b4('0x113');return db[_0xb8b4('0x42')]['find']({'attributes':['id',_0x560816],'where':{'id':_0x527a75['params']['id']}})[_0xb8b4('0x38')](handleEntityNotFound(_0x638d3b,null))[_0xb8b4('0x38')](function(_0x99265d){if(_0x99265d){var _0x4c8299=_0x99265d[_0x560816];var _0x25e9f8=_0x4c8299&&_0x4c8299[_0xb8b4('0x114')]?_0x4c8299['items']:[];_0x638d3b[_0xb8b4('0x3e')]({'fromKey':_[_0xb8b4('0x7d')](_0x4c8299[_0xb8b4('0x115')])?undefined:_0x4c8299[_0xb8b4('0x115')],'count':_0x25e9f8['length'],'rows':_0x25e9f8});}})[_0xb8b4('0x58')](handleError(_0x638d3b,null));};exports[_0xb8b4('0x116')]=function(_0x5847c5,_0x495c95,_0x33d97d){var _0x52773b={'raw':![],'where':{}};var _0x23afae={};var _0x40be39={'count':0x0,'rows':[]};return db[_0xb8b4('0x42')]['findOne']({'where':{'id':_0x5847c5[_0xb8b4('0x66')]['id']}})[_0xb8b4('0x38')](handleEntityNotFound(_0x495c95,null))[_0xb8b4('0x38')](function(_0x2f796c){if(_0x2f796c){_0x23afae[_0xb8b4('0x45')]=_['keys'](db[_0xb8b4('0x117')][_0xb8b4('0x43')]);_0x23afae[_0xb8b4('0x46')]=_[_0xb8b4('0x5b')](_0x5847c5[_0xb8b4('0x46')]);_0x23afae[_0xb8b4('0x47')]=_['intersection'](_0x23afae[_0xb8b4('0x45')],_0x23afae[_0xb8b4('0x46')]);_0x52773b[_0xb8b4('0x4a')]=_['intersection'](_0x23afae[_0xb8b4('0x45')],qs['fields'](_0x5847c5[_0xb8b4('0x46')][_0xb8b4('0x49')]));_0x52773b['attributes']=_0x52773b['attributes'][_0xb8b4('0x5c')]?_0x52773b[_0xb8b4('0x4a')]:_0x23afae['model'];if(!_0x5847c5[_0xb8b4('0x46')][_0xb8b4('0x4b')](_0xb8b4('0x4c'))){_0x52773b['limit']=qs[_0xb8b4('0x4d')](_0x5847c5['query']['limit']);_0x52773b['offset']=qs['offset'](_0x5847c5['query'][_0xb8b4('0x32')]);}_0x52773b['order']=qs[_0xb8b4('0x4f')](_0x5847c5['query'][_0xb8b4('0x4f')]);_0x52773b[_0xb8b4('0x50')]=qs[_0xb8b4('0x47')](_[_0xb8b4('0x51')](_0x5847c5[_0xb8b4('0x46')],_0x23afae[_0xb8b4('0x47')]));_0x52773b[_0xb8b4('0x50')][_0xb8b4('0x69')]=_0x2f796c['id'];if(_0x5847c5[_0xb8b4('0x46')][_0xb8b4('0x52')]){_0x52773b[_0xb8b4('0x50')]=_['merge'](_0x52773b[_0xb8b4('0x50')],{'$or':_[_0xb8b4('0x41')](_0x52773b[_0xb8b4('0x4a')],function(_0x58780d){var _0x5a9fa6={};_0x5a9fa6[_0x58780d]={'$like':'%'+_0x5847c5['query'][_0xb8b4('0x52')]+'%'};return _0x5a9fa6;})});}_0x52773b=_['merge']({},_0x52773b,_0x5847c5[_0xb8b4('0x54')]);return db['ChatOfflineMessage'][_0xb8b4('0x31')]({'where':_0x52773b[_0xb8b4('0x50')]})[_0xb8b4('0x38')](function(_0x2fd07d){_0x40be39[_0xb8b4('0x31')]=_0x2fd07d;if(_0x5847c5[_0xb8b4('0x46')]['includeAll']){_0x52773b[_0xb8b4('0x118')]=[{'all':!![]}];}else{_0x52773b[_0xb8b4('0x118')]=[{'model':db['CmContact'],'as':_0xb8b4('0xe9'),'required':![]}];}return db[_0xb8b4('0x117')]['findAll'](_0x52773b);})[_0xb8b4('0x38')](function(_0x65db8b){_0x40be39[_0xb8b4('0x57')]=_0x65db8b;return _0x40be39;});}})[_0xb8b4('0x38')](respondWithFilteredResult(_0x495c95,_0x52773b))[_0xb8b4('0x58')](handleError(_0x495c95,null));};exports[_0xb8b4('0x119')]=function(_0x4412ed,_0xe202ca,_0x380528){return db[_0xb8b4('0x42')][_0xb8b4('0x5d')]({'where':{'id':_0x4412ed[_0xb8b4('0x66')]['id']}})[_0xb8b4('0x38')](handleEntityNotFound(_0xe202ca,null))[_0xb8b4('0x38')](function(_0x464d98){if(_0x464d98){return _0x464d98[_0xb8b4('0x119')](_0x4412ed['body']['ids'],_[_0xb8b4('0xe8')](_0x4412ed[_0xb8b4('0x65')],[_0xb8b4('0x72'),'id'])||{})[_0xb8b4('0xd1')](function(_0x8f2917){for(var _0x459d4e=0x0;_0x459d4e<_0x4412ed['body']['ids']['length'];_0x459d4e+=0x1){socket[_0xb8b4('0x11a')]('userChatWebsite:save',{'UserId':_0x4412ed[_0xb8b4('0x65')][_0xb8b4('0x72')][_0x459d4e],'ChatWebsiteId':_0x4412ed[_0xb8b4('0x66')]['id']});}return _0x8f2917;});}})[_0xb8b4('0x38')](respondWithResult(_0xe202ca,null))[_0xb8b4('0x58')](handleError(_0xe202ca,null));};exports[_0xb8b4('0x11b')]=function(_0x21a282,_0x18ba6a,_0x47258d){return db[_0xb8b4('0x42')][_0xb8b4('0x5d')]({'where':{'id':_0x21a282[_0xb8b4('0x66')]['id']}})[_0xb8b4('0x38')](handleEntityNotFound(_0x18ba6a,null))['then'](function(_0x44705f){if(_0x44705f){return _0x44705f[_0xb8b4('0x11b')](_0x21a282[_0xb8b4('0x46')][_0xb8b4('0x72')])[_0xb8b4('0x38')](function(){if(_[_0xb8b4('0x11c')](_0x21a282[_0xb8b4('0x46')][_0xb8b4('0x72')])){for(var _0x20e819=0x0;_0x20e819<_0x21a282[_0xb8b4('0x46')][_0xb8b4('0x72')][_0xb8b4('0x5c')];_0x20e819+=0x1){socket[_0xb8b4('0x11a')]('userChatWebsite:remove',{'UserId':Number(_0x21a282[_0xb8b4('0x46')][_0xb8b4('0x72')][_0x20e819]),'ChatWebsiteId':Number(_0x21a282['params']['id'])});}}else{socket[_0xb8b4('0x11a')](_0xb8b4('0x11d'),{'UserId':Number(_0x21a282['query'][_0xb8b4('0x72')]),'ChatWebsiteId':Number(_0x21a282[_0xb8b4('0x66')]['id'])});}});}})[_0xb8b4('0x38')](respondWithStatusCode(_0x18ba6a,null))[_0xb8b4('0x58')](handleError(_0x18ba6a,null));};exports['getAgents']=function(_0x372392,_0x2289b0,_0x3c1e22){var _0x40a3e2={};var _0x5e98f8={};var _0x4fc798;var _0x576d86;return db['ChatWebsite'][_0xb8b4('0x6c')]({'where':{'id':_0x372392['params']['id']}})[_0xb8b4('0x38')](handleEntityNotFound(_0x2289b0,null))[_0xb8b4('0x38')](function(_0x2b084d){if(_0x2b084d){_0x4fc798=_0x2b084d;_0x5e98f8['model']=_[_0xb8b4('0x5b')](db['User'][_0xb8b4('0x43')]);_0x5e98f8[_0xb8b4('0x46')]=_['keys'](_0x372392[_0xb8b4('0x46')]);_0x5e98f8[_0xb8b4('0x47')]=_['intersection'](_0x5e98f8[_0xb8b4('0x45')],_0x5e98f8['query']);_0x40a3e2['attributes']=_[_0xb8b4('0x48')](_0x5e98f8['model'],qs[_0xb8b4('0x49')](_0x372392['query'][_0xb8b4('0x49')]));_0x40a3e2[_0xb8b4('0x4a')]=_0x40a3e2[_0xb8b4('0x4a')][_0xb8b4('0x5c')]?_0x40a3e2['attributes']:_0x5e98f8['model'];_0x40a3e2[_0xb8b4('0x4e')]=qs['sort'](_0x372392[_0xb8b4('0x46')][_0xb8b4('0x4f')]);_0x40a3e2[_0xb8b4('0x50')]=qs[_0xb8b4('0x47')](_['pick'](_0x372392['query'],_0x5e98f8[_0xb8b4('0x47')]));if(_0x372392[_0xb8b4('0x46')][_0xb8b4('0x52')]){_0x40a3e2['where']=_['merge'](_0x40a3e2[_0xb8b4('0x50')],{'$or':_[_0xb8b4('0x41')](_0x40a3e2[_0xb8b4('0x4a')],function(_0x5e2e05){var _0x4b1f90={};_0x4b1f90[_0x5e2e05]={'$like':'%'+_0x372392[_0xb8b4('0x46')][_0xb8b4('0x52')]+'%'};return _0x4b1f90;})});}_0x40a3e2=_[_0xb8b4('0x6d')]({},_0x40a3e2,_0x372392[_0xb8b4('0x54')]);return _0x4fc798[_0xb8b4('0x11e')](_0x40a3e2);}})[_0xb8b4('0x38')](function(_0x587b6e){if(_0x587b6e){_0x576d86=_0x587b6e[_0xb8b4('0x5c')];if(!_0x372392[_0xb8b4('0x46')][_0xb8b4('0x4b')](_0xb8b4('0x4c'))){_0x40a3e2[_0xb8b4('0x4d')]=qs[_0xb8b4('0x4d')](_0x372392[_0xb8b4('0x46')][_0xb8b4('0x4d')]);_0x40a3e2[_0xb8b4('0x32')]=qs[_0xb8b4('0x32')](_0x372392[_0xb8b4('0x46')][_0xb8b4('0x32')]);}return _0x4fc798['getAgents'](_0x40a3e2);}})['then'](function(_0x17772d){if(_0x17772d){return _0x17772d?{'count':_0x576d86,'rows':_0x17772d}:null;}})[_0xb8b4('0x38')](respondWithResult(_0x2289b0,null))[_0xb8b4('0x58')](handleError(_0x2289b0,null));};
\ No newline at end of file
diff --git a/server/api/chatWebsite/chatWebsite.events.js b/server/api/chatWebsite/chatWebsite.events.js
index 5ad87e9..694915c 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 _0x03ce=['setMaxListeners','update','remove','emit','hasOwnProperty','hook','exports','events','../../mysqldb','ChatWebsite'];(function(_0x2fb089,_0x4c7666){var _0x42f798=function(_0x5d467d){while(--_0x5d467d){_0x2fb089['push'](_0x2fb089['shift']());}};_0x42f798(++_0x4c7666);}(_0x03ce,0x1a1));var _0xe03c=function(_0x19be52,_0x417078){_0x19be52=_0x19be52-0x0;var _0x42dfd2=_0x03ce[_0x19be52];return _0x42dfd2;};'use strict';var EventEmitter=require(_0xe03c('0x0'));var ChatWebsite=require(_0xe03c('0x1'))['db'][_0xe03c('0x2')];var ChatWebsiteEvents=new EventEmitter();ChatWebsiteEvents[_0xe03c('0x3')](0x0);var events={'afterCreate':'save','afterUpdate':_0xe03c('0x4'),'afterDestroy':_0xe03c('0x5')};function emitEvent(_0x326c04){return function(_0x527a32,_0x317708,_0x1917e3){ChatWebsiteEvents[_0xe03c('0x6')](_0x326c04+':'+_0x527a32['id'],_0x527a32);ChatWebsiteEvents[_0xe03c('0x6')](_0x326c04,_0x527a32);_0x1917e3(null);};}for(var e in events){if(events[_0xe03c('0x7')](e)){var event=events[e];ChatWebsite[_0xe03c('0x8')](e,emitEvent(event));}}module[_0xe03c('0x9')]=ChatWebsiteEvents;
\ No newline at end of file
+var _0xd737=['save','update','remove','emit','hasOwnProperty','hook','exports','events','ChatWebsite'];(function(_0x116d94,_0x2e863d){var _0x3bdb66=function(_0x259681){while(--_0x259681){_0x116d94['push'](_0x116d94['shift']());}};_0x3bdb66(++_0x2e863d);}(_0xd737,0x85));var _0x7d73=function(_0x2803ab,_0x1c33f2){_0x2803ab=_0x2803ab-0x0;var _0x3d6e8e=_0xd737[_0x2803ab];return _0x3d6e8e;};'use strict';var EventEmitter=require(_0x7d73('0x0'));var ChatWebsite=require('../../mysqldb')['db'][_0x7d73('0x1')];var ChatWebsiteEvents=new EventEmitter();ChatWebsiteEvents['setMaxListeners'](0x0);var events={'afterCreate':_0x7d73('0x2'),'afterUpdate':_0x7d73('0x3'),'afterDestroy':_0x7d73('0x4')};function emitEvent(_0x5cfa01){return function(_0x5369be,_0x3e19ad,_0x493f54){ChatWebsiteEvents['emit'](_0x5cfa01+':'+_0x5369be['id'],_0x5369be);ChatWebsiteEvents[_0x7d73('0x5')](_0x5cfa01,_0x5369be);_0x493f54(null);};}for(var e in events){if(events[_0x7d73('0x6')](e)){var event=events[e];ChatWebsite[_0x7d73('0x7')](e,emitEvent(event));}}module[_0x7d73('0x8')]=ChatWebsiteEvents;
\ No newline at end of file
diff --git a/server/api/chatWebsite/chatWebsite.model.js b/server/api/chatWebsite/chatWebsite.model.js
index 7c0e32b..43cd3e1 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 _0x4fad=['request-promise','path','rimraf','../../config/environment','./chatWebsite.attributes','exports','ChatWebsite','chat_websites','lodash','util','../../config/logger','moment','bluebird'];(function(_0x3c3eb7,_0x55343d){var _0x108733=function(_0x5bd6f6){while(--_0x5bd6f6){_0x3c3eb7['push'](_0x3c3eb7['shift']());}};_0x108733(++_0x55343d);}(_0x4fad,0xcb));var _0xd4fa=function(_0x594ccb,_0x367958){_0x594ccb=_0x594ccb-0x0;var _0x16620d=_0x4fad[_0x594ccb];return _0x16620d;};'use strict';var _=require(_0xd4fa('0x0'));var util=require(_0xd4fa('0x1'));var logger=require(_0xd4fa('0x2'))('api');var moment=require(_0xd4fa('0x3'));var BPromise=require(_0xd4fa('0x4'));var rp=require(_0xd4fa('0x5'));var fs=require('fs');var path=require(_0xd4fa('0x6'));var rimraf=require(_0xd4fa('0x7'));var config=require(_0xd4fa('0x8'));var attributes=require(_0xd4fa('0x9'));module[_0xd4fa('0xa')]=function(_0x597fbe,_0x2d4e07){return _0x597fbe['define'](_0xd4fa('0xb'),attributes,{'tableName':_0xd4fa('0xc'),'paranoid':![],'indexes':[],'timestamps':!![]});};
\ No newline at end of file
+var _0x5423=['request-promise','path','rimraf','../../config/environment','exports','define','ChatWebsite','lodash','util','api','moment'];(function(_0x5b9039,_0x5b2edb){var _0x21e499=function(_0x20c88d){while(--_0x20c88d){_0x5b9039['push'](_0x5b9039['shift']());}};_0x21e499(++_0x5b2edb);}(_0x5423,0xe3));var _0x3542=function(_0x5dc89f,_0x4411bc){_0x5dc89f=_0x5dc89f-0x0;var _0x5115e4=_0x5423[_0x5dc89f];return _0x5115e4;};'use strict';var _=require(_0x3542('0x0'));var util=require(_0x3542('0x1'));var logger=require('../../config/logger')(_0x3542('0x2'));var moment=require(_0x3542('0x3'));var BPromise=require('bluebird');var rp=require(_0x3542('0x4'));var fs=require('fs');var path=require(_0x3542('0x5'));var rimraf=require(_0x3542('0x6'));var config=require(_0x3542('0x7'));var attributes=require('./chatWebsite.attributes');module[_0x3542('0x8')]=function(_0x2d2ae9,_0x15ee3b){return _0x2d2ae9[_0x3542('0x9')](_0x3542('0xa'),attributes,{'tableName':'chat_websites','paranoid':![],'indexes':[],'timestamps':!![]});};
\ No newline at end of file
diff --git a/server/api/chatWebsite/chatWebsite.rpc.js b/server/api/chatWebsite/chatWebsite.rpc.js
index 2691943..68083dd 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 _0x0295=['redis','socket.io-emitter','./chatWebsite.socket','then','info','request\x20sent','debug','error','code','ChatWebsite,\x20%s,\x20%s','message','result','catch','lodash','bluebird','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','client','http'];(function(_0x4c6669,_0x2c0baa){var _0x367e52=function(_0xa5e96d){while(--_0xa5e96d){_0x4c6669['push'](_0x4c6669['shift']());}};_0x367e52(++_0x2c0baa);}(_0x0295,0x1f0));var _0x5029=function(_0x1559a0,_0x9b8fd7){_0x1559a0=_0x1559a0-0x0;var _0x37e36f=_0x0295[_0x1559a0];return _0x37e36f;};'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});config[_0x5029('0xa')]=_['defaults'](config['redis'],{'host':'localhost','port':0x18eb});var socket=require(_0x5029('0xb'))(new Redis(config['redis']));require(_0x5029('0xc'))['register'](socket);function respondWithRpcPromise(_0x14d4ef,_0x520bc3,_0x222ddb){return new BPromise(function(_0x22cfb4,_0x12834c){return client['request'](_0x14d4ef,_0x222ddb)[_0x5029('0xd')](function(_0xbf61f){logger[_0x5029('0xe')]('ChatWebsite,\x20%s,\x20%s',_0x520bc3,_0x5029('0xf'));logger[_0x5029('0x10')]('ChatWebsite,\x20%s,\x20%s,\x20%s',_0x520bc3,'request\x20sent',JSON['stringify'](_0xbf61f));if(_0xbf61f['error']){if(_0xbf61f[_0x5029('0x11')][_0x5029('0x12')]===0x1f4){logger[_0x5029('0x11')](_0x5029('0x13'),_0x520bc3,_0xbf61f[_0x5029('0x11')][_0x5029('0x14')]);return _0x12834c(_0xbf61f[_0x5029('0x11')][_0x5029('0x14')]);}logger[_0x5029('0x11')](_0x5029('0x13'),_0x520bc3,_0xbf61f[_0x5029('0x11')][_0x5029('0x14')]);return _0x22cfb4(_0xbf61f[_0x5029('0x11')][_0x5029('0x14')]);}else{logger[_0x5029('0xe')]('ChatWebsite,\x20%s,\x20%s',_0x520bc3,_0x5029('0xf'));_0x22cfb4(_0xbf61f[_0x5029('0x15')][_0x5029('0x14')]);}})[_0x5029('0x16')](function(_0x8cea01){logger[_0x5029('0x11')](_0x5029('0x13'),_0x520bc3,_0x8cea01);_0x12834c(_0x8cea01);});});}
\ No newline at end of file
+var _0xfcf0=['ChatWebsite,\x20%s,\x20%s','message','info','catch','lodash','util','bluebird','randomstring','ioredis','../../mysqldb','../../config/logger','rpc','../../config/environment','jayson/promise','client','http','redis','defaults','localhost','socket.io-emitter','register','request','then','request\x20sent','debug','stringify','error','code'];(function(_0x340d17,_0x3d6339){var _0x4a18d1=function(_0x50d179){while(--_0x50d179){_0x340d17['push'](_0x340d17['shift']());}};_0x4a18d1(++_0x3d6339);}(_0xfcf0,0x138));var _0x0fcf=function(_0x5e2cb4,_0x592c64){_0x5e2cb4=_0x5e2cb4-0x0;var _0x282902=_0xfcf0[_0x5e2cb4];return _0x282902;};'use strict';var _=require(_0x0fcf('0x0'));var util=require(_0x0fcf('0x1'));var moment=require('moment');var BPromise=require(_0x0fcf('0x2'));var rs=require(_0x0fcf('0x3'));var fs=require('fs');var Redis=require(_0x0fcf('0x4'));var db=require(_0x0fcf('0x5'))['db'];var utils=require('../../config/utils');var logger=require(_0x0fcf('0x6'))(_0x0fcf('0x7'));var config=require(_0x0fcf('0x8'));var jayson=require(_0x0fcf('0x9'));var client=jayson[_0x0fcf('0xa')][_0x0fcf('0xb')]({'port':0x232a});config[_0x0fcf('0xc')]=_[_0x0fcf('0xd')](config['redis'],{'host':_0x0fcf('0xe'),'port':0x18eb});var socket=require(_0x0fcf('0xf'))(new Redis(config[_0x0fcf('0xc')]));require('./chatWebsite.socket')[_0x0fcf('0x10')](socket);function respondWithRpcPromise(_0x7ac7bd,_0x239e5d,_0x4b3923){return new BPromise(function(_0x369959,_0x5c29ed){return client[_0x0fcf('0x11')](_0x7ac7bd,_0x4b3923)[_0x0fcf('0x12')](function(_0x201a58){logger['info']('ChatWebsite,\x20%s,\x20%s',_0x239e5d,_0x0fcf('0x13'));logger[_0x0fcf('0x14')]('ChatWebsite,\x20%s,\x20%s,\x20%s',_0x239e5d,_0x0fcf('0x13'),JSON[_0x0fcf('0x15')](_0x201a58));if(_0x201a58[_0x0fcf('0x16')]){if(_0x201a58[_0x0fcf('0x16')][_0x0fcf('0x17')]===0x1f4){logger['error'](_0x0fcf('0x18'),_0x239e5d,_0x201a58[_0x0fcf('0x16')][_0x0fcf('0x19')]);return _0x5c29ed(_0x201a58['error'][_0x0fcf('0x19')]);}logger[_0x0fcf('0x16')](_0x0fcf('0x18'),_0x239e5d,_0x201a58[_0x0fcf('0x16')]['message']);return _0x369959(_0x201a58[_0x0fcf('0x16')][_0x0fcf('0x19')]);}else{logger[_0x0fcf('0x1a')](_0x0fcf('0x18'),_0x239e5d,_0x0fcf('0x13'));_0x369959(_0x201a58['result'][_0x0fcf('0x19')]);}})[_0x0fcf('0x1b')](function(_0x5dad87){logger[_0x0fcf('0x16')](_0x0fcf('0x18'),_0x239e5d,_0x5dad87);_0x5c29ed(_0x5dad87);});});}
\ No newline at end of file
diff --git a/server/api/chatWebsite/chatWebsite.socket.js b/server/api/chatWebsite/chatWebsite.socket.js
index d036843..ef07137 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(_0x2a0738,_0x3c0bc5){var _0x159679=function(_0x9c9ec7){while(--_0x9c9ec7){_0x2a0738['push'](_0x2a0738['shift']());}};_0x159679(++_0x3c0bc5);}(_0x5f2f,0x73));var _0xf5f2=function(_0x569c4e,_0x47a62c){_0x569c4e=_0x569c4e-0x0;var _0x5de728=_0x5f2f[_0x569c4e];return _0x5de728;};'use strict';var ChatWebsiteEvents=require(_0xf5f2('0x0'));var events=[_0xf5f2('0x1'),_0xf5f2('0x2'),_0xf5f2('0x3')];function createListener(_0x1172dd,_0x174bc7){return function(_0x3c72ee){_0x174bc7[_0xf5f2('0x4')](_0x1172dd,_0x3c72ee);};}function removeListener(_0x501fbd,_0x4854b6){return function(){ChatWebsiteEvents[_0xf5f2('0x5')](_0x501fbd,_0x4854b6);};}exports[_0xf5f2('0x6')]=function(_0xad7f65){for(var _0x3eebf6=0x0,_0x3133bc=events[_0xf5f2('0x7')];_0x3eebf6<_0x3133bc;_0x3eebf6++){var _0x5907aa=events[_0x3eebf6];var _0x466882=createListener(_0xf5f2('0x8')+_0x5907aa,_0xad7f65);ChatWebsiteEvents['on'](_0x5907aa,_0x466882);}};
\ No newline at end of file
+var _0x5f2f=['remove','update','emit','removeListener','register','length','chatWebsite:','./chatWebsite.events','save'];(function(_0x171e4d,_0x4f2493){var _0x2d2bf4=function(_0x3a74cc){while(--_0x3a74cc){_0x171e4d['push'](_0x171e4d['shift']());}};_0x2d2bf4(++_0x4f2493);}(_0x5f2f,0x73));var _0xf5f2=function(_0x221700,_0x57af01){_0x221700=_0x221700-0x0;var _0x185e8f=_0x5f2f[_0x221700];return _0x185e8f;};'use strict';var ChatWebsiteEvents=require(_0xf5f2('0x0'));var events=[_0xf5f2('0x1'),_0xf5f2('0x2'),_0xf5f2('0x3')];function createListener(_0x1172dd,_0x174bc7){return function(_0x3c72ee){_0x174bc7[_0xf5f2('0x4')](_0x1172dd,_0x3c72ee);};}function removeListener(_0x501fbd,_0x4854b6){return function(){ChatWebsiteEvents[_0xf5f2('0x5')](_0x501fbd,_0x4854b6);};}exports[_0xf5f2('0x6')]=function(_0xad7f65){for(var _0x3eebf6=0x0,_0x3133bc=events[_0xf5f2('0x7')];_0x3eebf6<_0x3133bc;_0x3eebf6++){var _0x5907aa=events[_0x3eebf6];var _0x466882=createListener(_0xf5f2('0x8')+_0x5907aa,_0xad7f65);ChatWebsiteEvents['on'](_0x5907aa,_0x466882);}};
\ No newline at end of file
diff --git a/server/api/chatWebsite/index.js b/server/api/chatWebsite/index.js
index f673a6f..928ab2c 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 _0x0a05=['put','update','delete','destroy','removeDispositions','removeAgents','multer','path','connect-timeout','Router','../../components/auth/service','../../components/interaction/service','../../config/environment','get','isAuthenticated','index','describe','/:id','show','/:id/dispositions','getDispositions','/:id/logo','/:id/avatar','/:id/customer_avatar','getCustomerAvatar','/:id/system_avatar','getSystemAvatar','/:id/interactions','getInteractions','/:id/snippet','getSnippet','/:id/applications','getApplications','/:id/proactive_actions','getFields','/:id/offline_messages','getOfflineMessages','/:id/users','getAgents','post','create','addDisposition','/:id/canned_answers','diskStorage','root','server/files/images/logos/','format','%s-%s','now','originalname','file','server/files/images/avatars/','addAvatar','join','single','addCustomerAvatar','notify','/:id/offline','addInteraction','addApplications','addProactiveActions','addAgents'];(function(_0x2a5884,_0x4626f0){var _0x565212=function(_0x4c82da){while(--_0x4c82da){_0x2a5884['push'](_0x2a5884['shift']());}};_0x565212(++_0x4626f0);}(_0x0a05,0x82));var _0x50a0=function(_0x36284b,_0x2b7436){_0x36284b=_0x36284b-0x0;var _0x23c34a=_0x0a05[_0x36284b];return _0x23c34a;};'use strict';var multer=require(_0x50a0('0x0'));var util=require('util');var path=require(_0x50a0('0x1'));var timeout=require(_0x50a0('0x2'));var express=require('express');var router=express[_0x50a0('0x3')]();var auth=require(_0x50a0('0x4'));var interaction=require(_0x50a0('0x5'));var config=require(_0x50a0('0x6'));var controller=require('./chatWebsite.controller');router[_0x50a0('0x7')]('/',auth[_0x50a0('0x8')](),controller[_0x50a0('0x9')]);router[_0x50a0('0x7')]('/describe',auth['isAuthenticated'](),controller[_0x50a0('0xa')]);router[_0x50a0('0x7')](_0x50a0('0xb'),auth[_0x50a0('0x8')](),controller[_0x50a0('0xc')]);router[_0x50a0('0x7')](_0x50a0('0xd'),auth[_0x50a0('0x8')](),controller[_0x50a0('0xe')]);router[_0x50a0('0x7')]('/:id/canned_answers',auth[_0x50a0('0x8')](),controller['getAnswers']);router[_0x50a0('0x7')](_0x50a0('0xf'),controller['getLogo']);router[_0x50a0('0x7')](_0x50a0('0x10'),controller['getAvatar']);router['get'](_0x50a0('0x11'),controller[_0x50a0('0x12')]);router[_0x50a0('0x7')](_0x50a0('0x13'),controller[_0x50a0('0x14')]);router['get'](_0x50a0('0x15'),auth[_0x50a0('0x8')](),controller[_0x50a0('0x16')]);router[_0x50a0('0x7')](_0x50a0('0x17'),controller[_0x50a0('0x18')]);router[_0x50a0('0x7')](_0x50a0('0x19'),auth['isAuthenticated'](),controller[_0x50a0('0x1a')]);router[_0x50a0('0x7')](_0x50a0('0x1b'),auth[_0x50a0('0x8')](),controller['getProactiveActions']);router[_0x50a0('0x7')]('/:id/fields',controller[_0x50a0('0x1c')]);router[_0x50a0('0x7')](_0x50a0('0x1d'),auth[_0x50a0('0x8')](),controller[_0x50a0('0x1e')]);router['get'](_0x50a0('0x1f'),auth[_0x50a0('0x8')](),controller[_0x50a0('0x20')]);router[_0x50a0('0x21')]('/',auth[_0x50a0('0x8')](),controller[_0x50a0('0x22')]);router[_0x50a0('0x21')]('/:id/dispositions',auth[_0x50a0('0x8')](),controller[_0x50a0('0x23')]);router[_0x50a0('0x21')](_0x50a0('0x24'),auth[_0x50a0('0x8')](),controller['addAnswer']);var upload=multer({'storage':multer[_0x50a0('0x25')]({'destination':function(_0x3309d2,_0x23bc6f,_0x1f38fc){_0x1f38fc(null,path['join'](config[_0x50a0('0x26')],_0x50a0('0x27')));},'filename':function(_0x33b8bd,_0x1ac7f4,_0x169266){_0x169266(null,util[_0x50a0('0x28')](_0x50a0('0x29'),Date[_0x50a0('0x2a')](),_0x1ac7f4[_0x50a0('0x2b')]));}})});router[_0x50a0('0x21')]('/:id/logo',upload['single'](_0x50a0('0x2c')),controller['addLogo']);var upload=multer({'storage':multer['diskStorage']({'destination':function(_0x4795e1,_0x31d2b5,_0x491d92){_0x491d92(null,path['join'](config[_0x50a0('0x26')],_0x50a0('0x2d')));},'filename':function(_0x56d5d9,_0x4dc26e,_0x30962d){_0x30962d(null,util[_0x50a0('0x28')]('%s-%s',Date[_0x50a0('0x2a')](),_0x4dc26e[_0x50a0('0x2b')]));}})});router[_0x50a0('0x21')](_0x50a0('0x10'),upload['single'](_0x50a0('0x2c')),controller[_0x50a0('0x2e')]);var upload=multer({'storage':multer[_0x50a0('0x25')]({'destination':function(_0x4bcea9,_0x537976,_0x46474d){_0x46474d(null,path[_0x50a0('0x2f')](config[_0x50a0('0x26')],_0x50a0('0x2d')));},'filename':function(_0x11ba47,_0x3b7970,_0x42f219){_0x42f219(null,util[_0x50a0('0x28')](_0x50a0('0x29'),Date['now'](),_0x3b7970['originalname']));}})});router[_0x50a0('0x21')](_0x50a0('0x11'),upload[_0x50a0('0x30')](_0x50a0('0x2c')),controller[_0x50a0('0x31')]);var upload=multer({'storage':multer[_0x50a0('0x25')]({'destination':function(_0x165c4b,_0x27e44b,_0x1fcf15){_0x1fcf15(null,path[_0x50a0('0x2f')](config[_0x50a0('0x26')],_0x50a0('0x2d')));},'filename':function(_0x25e70e,_0x54608e,_0x24daac){_0x24daac(null,util[_0x50a0('0x28')](_0x50a0('0x29'),Date[_0x50a0('0x2a')](),_0x54608e['originalname']));}})});router['post'](_0x50a0('0x13'),upload[_0x50a0('0x30')](_0x50a0('0x2c')),controller['addSystemAvatar']);router['post']('/:id/notify',controller[_0x50a0('0x32')]);router['post'](_0x50a0('0x33'),controller['offline']);router[_0x50a0('0x21')](_0x50a0('0x15'),auth['isAuthenticated'](),controller[_0x50a0('0x34')]);router[_0x50a0('0x21')](_0x50a0('0x19'),auth['isAuthenticated'](),controller[_0x50a0('0x35')]);router[_0x50a0('0x21')](_0x50a0('0x1b'),auth[_0x50a0('0x8')](),controller[_0x50a0('0x36')]);router[_0x50a0('0x21')]('/:id/users',auth[_0x50a0('0x8')](),controller[_0x50a0('0x37')]);router[_0x50a0('0x38')]('/:id',auth['isAuthenticated'](),controller[_0x50a0('0x39')]);router[_0x50a0('0x3a')](_0x50a0('0xb'),auth[_0x50a0('0x8')](),controller[_0x50a0('0x3b')]);router['delete'](_0x50a0('0xd'),auth['isAuthenticated'](),controller[_0x50a0('0x3c')]);router['delete'](_0x50a0('0x24'),auth[_0x50a0('0x8')](),controller['removeAnswers']);router[_0x50a0('0x3a')](_0x50a0('0x1f'),auth[_0x50a0('0x8')](),controller[_0x50a0('0x3d')]);module['exports']=router;
\ No newline at end of file
+var _0x00e1=['getAvatar','/:id/customer_avatar','getCustomerAvatar','/:id/system_avatar','getSystemAvatar','getSnippet','getProactiveActions','getFields','getOfflineMessages','getAgents','post','create','diskStorage','join','root','format','%s-%s','now','file','addLogo','originalname','/:id/avatar','single','addAvatar','notify','/:id/offline','offline','addInteraction','/:id/applications','/:id/proactive_actions','addProactiveActions','/:id/users','addAgents','put','/:id','update','destroy','delete','removeDispositions','removeAnswers','removeAgents','exports','multer','util','express','Router','../../components/auth/service','../../components/interaction/service','../../config/environment','./chatWebsite.controller','isAuthenticated','index','get','/describe','describe','show','/:id/dispositions','getDispositions','/:id/canned_answers','getAnswers','/:id/logo','getLogo'];(function(_0x1ec883,_0x41eafe){var _0x2f1387=function(_0x24913f){while(--_0x24913f){_0x1ec883['push'](_0x1ec883['shift']());}};_0x2f1387(++_0x41eafe);}(_0x00e1,0x160));var _0x100e=function(_0x2ec226,_0x1bde56){_0x2ec226=_0x2ec226-0x0;var _0x20f363=_0x00e1[_0x2ec226];return _0x20f363;};'use strict';var multer=require(_0x100e('0x0'));var util=require(_0x100e('0x1'));var path=require('path');var timeout=require('connect-timeout');var express=require(_0x100e('0x2'));var router=express[_0x100e('0x3')]();var auth=require(_0x100e('0x4'));var interaction=require(_0x100e('0x5'));var config=require(_0x100e('0x6'));var controller=require(_0x100e('0x7'));router['get']('/',auth[_0x100e('0x8')](),controller[_0x100e('0x9')]);router[_0x100e('0xa')](_0x100e('0xb'),auth[_0x100e('0x8')](),controller[_0x100e('0xc')]);router[_0x100e('0xa')]('/:id',auth[_0x100e('0x8')](),controller[_0x100e('0xd')]);router[_0x100e('0xa')](_0x100e('0xe'),auth[_0x100e('0x8')](),controller[_0x100e('0xf')]);router[_0x100e('0xa')](_0x100e('0x10'),auth['isAuthenticated'](),controller[_0x100e('0x11')]);router['get'](_0x100e('0x12'),controller[_0x100e('0x13')]);router[_0x100e('0xa')]('/:id/avatar',controller[_0x100e('0x14')]);router[_0x100e('0xa')](_0x100e('0x15'),controller[_0x100e('0x16')]);router[_0x100e('0xa')](_0x100e('0x17'),controller[_0x100e('0x18')]);router[_0x100e('0xa')]('/:id/interactions',auth['isAuthenticated'](),controller['getInteractions']);router[_0x100e('0xa')]('/:id/snippet',controller[_0x100e('0x19')]);router[_0x100e('0xa')]('/:id/applications',auth[_0x100e('0x8')](),controller['getApplications']);router[_0x100e('0xa')]('/:id/proactive_actions',auth[_0x100e('0x8')](),controller[_0x100e('0x1a')]);router[_0x100e('0xa')]('/:id/fields',controller[_0x100e('0x1b')]);router[_0x100e('0xa')]('/:id/offline_messages',auth[_0x100e('0x8')](),controller[_0x100e('0x1c')]);router['get']('/:id/users',auth[_0x100e('0x8')](),controller[_0x100e('0x1d')]);router[_0x100e('0x1e')]('/',auth['isAuthenticated'](),controller[_0x100e('0x1f')]);router[_0x100e('0x1e')]('/:id/dispositions',auth[_0x100e('0x8')](),controller['addDisposition']);router[_0x100e('0x1e')]('/:id/canned_answers',auth[_0x100e('0x8')](),controller['addAnswer']);var upload=multer({'storage':multer[_0x100e('0x20')]({'destination':function(_0x53bd8a,_0xa77932,_0xf3dd6f){_0xf3dd6f(null,path[_0x100e('0x21')](config[_0x100e('0x22')],'server/files/images/logos/'));},'filename':function(_0x147f64,_0x51a1d0,_0x37cf99){_0x37cf99(null,util[_0x100e('0x23')](_0x100e('0x24'),Date[_0x100e('0x25')](),_0x51a1d0['originalname']));}})});router[_0x100e('0x1e')](_0x100e('0x12'),upload['single'](_0x100e('0x26')),controller[_0x100e('0x27')]);var upload=multer({'storage':multer['diskStorage']({'destination':function(_0x22c778,_0x3ef220,_0x5e56e9){_0x5e56e9(null,path[_0x100e('0x21')](config[_0x100e('0x22')],'server/files/images/avatars/'));},'filename':function(_0x4d591a,_0x393f01,_0x3a8400){_0x3a8400(null,util[_0x100e('0x23')]('%s-%s',Date[_0x100e('0x25')](),_0x393f01[_0x100e('0x28')]));}})});router[_0x100e('0x1e')](_0x100e('0x29'),upload[_0x100e('0x2a')]('file'),controller[_0x100e('0x2b')]);var upload=multer({'storage':multer['diskStorage']({'destination':function(_0x5b81b2,_0x524d59,_0x35f2a5){_0x35f2a5(null,path[_0x100e('0x21')](config[_0x100e('0x22')],'server/files/images/avatars/'));},'filename':function(_0x24430d,_0x46ed33,_0x2d6e88){_0x2d6e88(null,util['format'](_0x100e('0x24'),Date[_0x100e('0x25')](),_0x46ed33[_0x100e('0x28')]));}})});router['post']('/:id/customer_avatar',upload['single'](_0x100e('0x26')),controller['addCustomerAvatar']);var upload=multer({'storage':multer['diskStorage']({'destination':function(_0x19667b,_0x1fb479,_0x24d697){_0x24d697(null,path[_0x100e('0x21')](config['root'],'server/files/images/avatars/'));},'filename':function(_0x16e94f,_0x495448,_0x455142){_0x455142(null,util[_0x100e('0x23')](_0x100e('0x24'),Date[_0x100e('0x25')](),_0x495448[_0x100e('0x28')]));}})});router[_0x100e('0x1e')](_0x100e('0x17'),upload[_0x100e('0x2a')](_0x100e('0x26')),controller['addSystemAvatar']);router[_0x100e('0x1e')]('/:id/notify',controller[_0x100e('0x2c')]);router['post'](_0x100e('0x2d'),controller[_0x100e('0x2e')]);router[_0x100e('0x1e')]('/:id/interactions',auth[_0x100e('0x8')](),controller[_0x100e('0x2f')]);router[_0x100e('0x1e')](_0x100e('0x30'),auth[_0x100e('0x8')](),controller['addApplications']);router['post'](_0x100e('0x31'),auth[_0x100e('0x8')](),controller[_0x100e('0x32')]);router[_0x100e('0x1e')](_0x100e('0x33'),auth[_0x100e('0x8')](),controller[_0x100e('0x34')]);router[_0x100e('0x35')](_0x100e('0x36'),auth[_0x100e('0x8')](),controller[_0x100e('0x37')]);router['delete'](_0x100e('0x36'),auth[_0x100e('0x8')](),controller[_0x100e('0x38')]);router[_0x100e('0x39')](_0x100e('0xe'),auth[_0x100e('0x8')](),controller[_0x100e('0x3a')]);router[_0x100e('0x39')](_0x100e('0x10'),auth['isAuthenticated'](),controller[_0x100e('0x3b')]);router[_0x100e('0x39')]('/:id/users',auth[_0x100e('0x8')](),controller[_0x100e('0x3c')]);module[_0x100e('0x3d')]=router;
\ No newline at end of file
diff --git a/server/api/cmCompany/cmCompany.attributes.js b/server/api/cmCompany/cmCompany.attributes.js
index 9ee9223..32e7bf3 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 _0x9f92=['exports','STRING','name'];(function(_0x246f0c,_0x39f734){var _0x30fe50=function(_0x9a975c){while(--_0x9a975c){_0x246f0c['push'](_0x246f0c['shift']());}};_0x30fe50(++_0x39f734);}(_0x9f92,0x1ad));var _0x29f9=function(_0x40cb7a,_0x505484){_0x40cb7a=_0x40cb7a-0x0;var _0x246f9c=_0x9f92[_0x40cb7a];return _0x246f9c;};'use strict';var Sequelize=require('sequelize');module[_0x29f9('0x0')]={'name':{'type':Sequelize[_0x29f9('0x1')],'unique':_0x29f9('0x2'),'allowNull':![],'validate':{'notEmpty':!![]}},'vat':{'type':Sequelize[_0x29f9('0x1')]},'companyId':{'type':Sequelize[_0x29f9('0x1')]},'website':{'type':Sequelize[_0x29f9('0x1')]},'phone':{'type':Sequelize['STRING']},'fax':{'type':Sequelize[_0x29f9('0x1')]},'type':{'type':Sequelize[_0x29f9('0x1')]},'street':{'type':Sequelize[_0x29f9('0x1')]},'postalCode':{'type':Sequelize['STRING']},'city':{'type':Sequelize[_0x29f9('0x1')]},'country':{'type':Sequelize[_0x29f9('0x1')]},'email':{'type':Sequelize['STRING'],'validate':{'isEmail':!![]}},'emailDomain':{'type':Sequelize[_0x29f9('0x1')]},'sStreet':{'type':Sequelize[_0x29f9('0x1')]},'sPostalCode':{'type':Sequelize[_0x29f9('0x1')]},'sCity':{'type':Sequelize[_0x29f9('0x1')]},'sCountry':{'type':Sequelize[_0x29f9('0x1')]},'description':{'type':Sequelize[_0x29f9('0x1')]}};
\ No newline at end of file
+var _0x0a53=['exports','STRING','name'];(function(_0x5882e0,_0x5bc83f){var _0x476e2d=function(_0x5303ad){while(--_0x5303ad){_0x5882e0['push'](_0x5882e0['shift']());}};_0x476e2d(++_0x5bc83f);}(_0x0a53,0x180));var _0x30a5=function(_0x936f18,_0x110725){_0x936f18=_0x936f18-0x0;var _0x36b3b7=_0x0a53[_0x936f18];return _0x36b3b7;};'use strict';var Sequelize=require('sequelize');module[_0x30a5('0x0')]={'name':{'type':Sequelize[_0x30a5('0x1')],'unique':_0x30a5('0x2'),'allowNull':![],'validate':{'notEmpty':!![]}},'vat':{'type':Sequelize[_0x30a5('0x1')]},'companyId':{'type':Sequelize[_0x30a5('0x1')]},'website':{'type':Sequelize[_0x30a5('0x1')]},'phone':{'type':Sequelize[_0x30a5('0x1')]},'fax':{'type':Sequelize[_0x30a5('0x1')]},'type':{'type':Sequelize[_0x30a5('0x1')]},'street':{'type':Sequelize[_0x30a5('0x1')]},'postalCode':{'type':Sequelize['STRING']},'city':{'type':Sequelize[_0x30a5('0x1')]},'country':{'type':Sequelize[_0x30a5('0x1')]},'email':{'type':Sequelize[_0x30a5('0x1')],'validate':{'isEmail':!![]}},'emailDomain':{'type':Sequelize[_0x30a5('0x1')]},'sStreet':{'type':Sequelize[_0x30a5('0x1')]},'sPostalCode':{'type':Sequelize[_0x30a5('0x1')]},'sCity':{'type':Sequelize['STRING']},'sCountry':{'type':Sequelize[_0x30a5('0x1')]},'description':{'type':Sequelize[_0x30a5('0x1')]}};
\ No newline at end of file
diff --git a/server/api/cmCompany/cmCompany.controller.js b/server/api/cmCompany/cmCompany.controller.js
index 4fd97d7..5a2f12d 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 _0x744d=['request-promise','moment','bluebird','mustache','util','path','sox','to-csv','ejs','lodash','crypto','desk.js','querystring','ioredis','../../components/auth/service','../../components/parsers/advancedSearch','../../config/logger','../../config/environment','../../mysqldb','status','end','offset','limit','Content-Range','json','reject','save','update','destroy','then','get','Companies','sendStatus','error','name','index','CmCompany','describe','keys','intersection','model','query','fields','attributes','length','hasOwnProperty','order','sort','where','filters','pick','filter','merge','map','options','count','includeAll','include','rows','catch','rawAttributes','find','create','role','user','UserProfileSection','userProfileId','UserProfileResource','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','body','params','addContacts','ids','omit','getContacts','findOne','CmContact','nolimit','eml-format','rimraf'];(function(_0xff1dd3,_0x40abd2){var _0x57e542=function(_0x302c6b){while(--_0x302c6b){_0xff1dd3['push'](_0xff1dd3['shift']());}};_0x57e542(++_0x40abd2);}(_0x744d,0x18e));var _0xd744=function(_0x3f3f40,_0x4c71f4){_0x3f3f40=_0x3f3f40-0x0;var _0x403b7a=_0x744d[_0x3f3f40];return _0x403b7a;};'use strict';var pdf=require('html-pdf');var emlformat=require(_0xd744('0x0'));var rimraf=require(_0xd744('0x1'));var zipdir=require('zip-dir');var jsonpatch=require('fast-json-patch');var rp=require(_0xd744('0x2'));var moment=require(_0xd744('0x3'));var BPromise=require(_0xd744('0x4'));var Mustache=require(_0xd744('0x5'));var util=require(_0xd744('0x6'));var path=require(_0xd744('0x7'));var sox=require(_0xd744('0x8'));var csv=require(_0xd744('0x9'));var ejs=require(_0xd744('0xa'));var fs=require('fs');var _=require(_0xd744('0xb'));var squel=require('squel');var crypto=require(_0xd744('0xc'));var jsforce=require('jsforce');var deskjs=require(_0xd744('0xd'));var toCsv=require(_0xd744('0x9'));var querystring=require(_0xd744('0xe'));var Papa=require('papaparse');var Redis=require(_0xd744('0xf'));var authService=require(_0xd744('0x10'));var qs=require('../../components/parsers/qs');var as=require(_0xd744('0x11'));var hardwareService=require('../../config/license/hardware');var logger=require(_0xd744('0x12'))('api');var utils=require('../../config/utils');var config=require(_0xd744('0x13'));var db=require(_0xd744('0x14'))['db'];function respondWithStatusCode(_0x4cfb52,_0x5eabee){_0x5eabee=_0x5eabee||0xcc;return function(_0x55b000){if(_0x55b000){return _0x4cfb52['sendStatus'](_0x5eabee);}return _0x4cfb52[_0xd744('0x15')](_0x5eabee)[_0xd744('0x16')]();};}function respondWithResult(_0x297f87,_0x58d06d){_0x58d06d=_0x58d06d||0xc8;return function(_0x1634bb){if(_0x1634bb){return _0x297f87[_0xd744('0x15')](_0x58d06d)['json'](_0x1634bb);}};}function respondWithFilteredResult(_0x15a8a8,_0x2ee2f2){return function(_0x5e6b0d){if(_0x5e6b0d){var _0xa6d00e=_0x5e6b0d['count'],_0x3c5b89=_0x2ee2f2[_0xd744('0x17')],_0x4af3b1=_0x2ee2f2['offset']+_0x2ee2f2[_0xd744('0x18')],_0xe750fc;if(_0x4af3b1>=_0xa6d00e){_0x4af3b1=_0xa6d00e;_0xe750fc=0xc8;}else{_0xe750fc=0xce;}_0x15a8a8[_0xd744('0x15')](_0xe750fc);return _0x15a8a8['set'](_0xd744('0x19'),_0x3c5b89+'-'+_0x4af3b1+'/'+_0xa6d00e)[_0xd744('0x1a')](_0x5e6b0d);}return null;};}function patchUpdates(_0x57ec23){return function(_0x11cbed){try{jsonpatch['apply'](_0x11cbed,_0x57ec23,!![]);}catch(_0xd2cad7){return BPromise[_0xd744('0x1b')](_0xd2cad7);}return _0x11cbed[_0xd744('0x1c')]();};}function saveUpdates(_0x2dbcd3,_0x2286e5){return function(_0x14d746){if(_0x14d746){return _0x14d746[_0xd744('0x1d')](_0x2dbcd3)['then'](function(_0x2b298d){return _0x2b298d;});}return null;};}function removeEntity(_0x26d23d,_0x41a4a2){return function(_0x4d946e){if(_0x4d946e){return _0x4d946e[_0xd744('0x1e')]()[_0xd744('0x1f')](function(){var _0x35628e=_0x4d946e[_0xd744('0x20')]({'plain':!![]});var _0x507a63=_0xd744('0x21');return db['UserProfileResource'][_0xd744('0x1e')]({'where':{'type':_0x507a63,'resourceId':_0x35628e['id']}})[_0xd744('0x1f')](function(){return _0x4d946e;});})[_0xd744('0x1f')](function(){_0x26d23d[_0xd744('0x15')](0xcc)[_0xd744('0x16')]();});}};}function handleEntityNotFound(_0x3ca13f,_0x425d1b){return function(_0x33d6e8){if(!_0x33d6e8){_0x3ca13f[_0xd744('0x22')](0x194);}return _0x33d6e8;};}function handleError(_0x10e590,_0x442582){_0x442582=_0x442582||0x1f4;return function(_0x102079){logger[_0xd744('0x23')](_0x102079['stack']);if(_0x102079[_0xd744('0x24')]){delete _0x102079[_0xd744('0x24')];}_0x10e590[_0xd744('0x15')](_0x442582)['send'](_0x102079);};}exports[_0xd744('0x25')]=function(_0x20114f,_0x181f42){var _0x2e14b0={},_0x1a846f={},_0x2221e0={'count':0x0,'rows':[]};return db[_0xd744('0x26')][_0xd744('0x27')]()['then'](function(_0x29a455){_0x1a846f['model']=_[_0xd744('0x28')](_0x29a455);_0x1a846f['query']=_['keys'](_0x20114f['query']);_0x1a846f['filters']=_[_0xd744('0x29')](_0x1a846f[_0xd744('0x2a')],_0x1a846f[_0xd744('0x2b')]);_0x2e14b0['attributes']=_[_0xd744('0x29')](_0x1a846f['model'],qs[_0xd744('0x2c')](_0x20114f[_0xd744('0x2b')][_0xd744('0x2c')]));_0x2e14b0[_0xd744('0x2d')]=_0x2e14b0[_0xd744('0x2d')][_0xd744('0x2e')]?_0x2e14b0['attributes']:_0x1a846f[_0xd744('0x2a')];if(!_0x20114f[_0xd744('0x2b')][_0xd744('0x2f')]('nolimit')){_0x2e14b0[_0xd744('0x18')]=qs[_0xd744('0x18')](_0x20114f[_0xd744('0x2b')][_0xd744('0x18')]);_0x2e14b0[_0xd744('0x17')]=qs[_0xd744('0x17')](_0x20114f['query'][_0xd744('0x17')]);}_0x2e14b0[_0xd744('0x30')]=qs[_0xd744('0x31')](_0x20114f[_0xd744('0x2b')]['sort']);_0x2e14b0[_0xd744('0x32')]=qs[_0xd744('0x33')](_[_0xd744('0x34')](_0x20114f[_0xd744('0x2b')],_0x1a846f[_0xd744('0x33')]));if(_0x20114f[_0xd744('0x2b')][_0xd744('0x35')]){_0x2e14b0[_0xd744('0x32')]=_[_0xd744('0x36')](_0x2e14b0['where'],{'$or':_[_0xd744('0x37')](_0x2e14b0[_0xd744('0x2d')],function(_0x3abd63){var _0xd6a41e={};_0xd6a41e[_0x3abd63]={'$like':'%'+_0x20114f[_0xd744('0x2b')]['filter']+'%'};return _0xd6a41e;})});}_0x2e14b0=_[_0xd744('0x36')]({},_0x2e14b0,_0x20114f[_0xd744('0x38')]);var _0x2707a9={'where':_0x2e14b0[_0xd744('0x32')]};return db['CmCompany'][_0xd744('0x39')](_0x2707a9)[_0xd744('0x1f')](function(_0x36df51){_0x2221e0[_0xd744('0x39')]=_0x36df51;if(_0x20114f[_0xd744('0x2b')][_0xd744('0x3a')]){_0x2e14b0[_0xd744('0x3b')]=[{'all':!![]}];}return db[_0xd744('0x26')]['findAll'](_0x2e14b0);})['then'](function(_0xc6de10){_0x2221e0[_0xd744('0x3c')]=_0xc6de10;return _0x2221e0;})[_0xd744('0x1f')](respondWithFilteredResult(_0x181f42,_0x2e14b0))[_0xd744('0x3d')](handleError(_0x181f42,null));})[_0xd744('0x3d')](handleError(_0x181f42,null));};exports['show']=function(_0x174b9f,_0x1900cd){var _0x27e525={'raw':![],'where':{'id':_0x174b9f['params']['id']}},_0x3efc21={};_0x3efc21[_0xd744('0x2a')]=_[_0xd744('0x28')](db['CmCompany'][_0xd744('0x3e')]);_0x3efc21[_0xd744('0x2b')]=_[_0xd744('0x28')](_0x174b9f[_0xd744('0x2b')]);_0x3efc21[_0xd744('0x33')]=_[_0xd744('0x29')](_0x3efc21[_0xd744('0x2a')],_0x3efc21[_0xd744('0x2b')]);_0x27e525[_0xd744('0x2d')]=_[_0xd744('0x29')](_0x3efc21[_0xd744('0x2a')],qs[_0xd744('0x2c')](_0x174b9f['query'][_0xd744('0x2c')]));_0x27e525[_0xd744('0x2d')]=_0x27e525[_0xd744('0x2d')][_0xd744('0x2e')]?_0x27e525['attributes']:_0x3efc21[_0xd744('0x2a')];if(_0x174b9f['query'][_0xd744('0x3a')]){_0x27e525[_0xd744('0x3b')]=[{'all':!![]}];}_0x27e525=_[_0xd744('0x36')]({},_0x27e525,_0x174b9f[_0xd744('0x38')]);return db['CmCompany'][_0xd744('0x3f')](_0x27e525)[_0xd744('0x1f')](handleEntityNotFound(_0x1900cd,null))[_0xd744('0x1f')](respondWithResult(_0x1900cd,null))[_0xd744('0x3d')](handleError(_0x1900cd,null));};exports['create']=function(_0xab8a6c,_0x20890c){return db[_0xd744('0x26')][_0xd744('0x40')](_0xab8a6c['body'],{})['then'](function(_0x48c0ad){var _0x4d309c=_0xab8a6c['user'][_0xd744('0x20')]({'plain':!![]});if(!_0x4d309c)throw new Error('Unable\x20to\x20retrieve\x20the\x20current\x20user');if(_0x4d309c[_0xd744('0x41')]===_0xd744('0x42')){var _0x10c63c=_0x48c0ad[_0xd744('0x20')]({'plain':!![]});var _0x150710='Companies';return db[_0xd744('0x43')]['find']({'where':{'name':_0x150710,'userProfileId':_0x4d309c[_0xd744('0x44')]},'raw':!![]})[_0xd744('0x1f')](function(_0x15ae01){if(_0x15ae01&&_0x15ae01['autoAssociation']===0x0){return db[_0xd744('0x45')][_0xd744('0x40')]({'name':_0x10c63c['name'],'resourceId':_0x10c63c['id'],'type':_0x15ae01[_0xd744('0x24')],'sectionId':_0x15ae01['id']},{})[_0xd744('0x1f')](function(){return _0x48c0ad;});}else{return _0x48c0ad;}})[_0xd744('0x3d')](function(_0x42a091){logger['error'](_0xd744('0x46'),_0x42a091);throw _0x42a091;});}return _0x48c0ad;})['then'](respondWithResult(_0x20890c,0xc9))[_0xd744('0x3d')](handleError(_0x20890c,null));};exports[_0xd744('0x1d')]=function(_0x511edb,_0x2f0e30){if(_0x511edb[_0xd744('0x47')]['id']){delete _0x511edb['body']['id'];}return db['CmCompany'][_0xd744('0x3f')]({'where':{'id':_0x511edb[_0xd744('0x48')]['id']}})[_0xd744('0x1f')](handleEntityNotFound(_0x2f0e30,null))['then'](saveUpdates(_0x511edb[_0xd744('0x47')],null))[_0xd744('0x1f')](respondWithResult(_0x2f0e30,null))['catch'](handleError(_0x2f0e30,null));};exports['destroy']=function(_0x48c4c6,_0x70966f){return db['CmCompany'][_0xd744('0x3f')]({'where':{'id':_0x48c4c6[_0xd744('0x48')]['id']}})[_0xd744('0x1f')](handleEntityNotFound(_0x70966f,null))[_0xd744('0x1f')](removeEntity(_0x70966f,null))[_0xd744('0x3d')](handleError(_0x70966f,null));};exports[_0xd744('0x27')]=function(_0x2a6361,_0x57aa68){return db[_0xd744('0x26')][_0xd744('0x27')]()[_0xd744('0x1f')](respondWithResult(_0x57aa68,null))[_0xd744('0x3d')](handleError(_0x57aa68,null));};exports['addContacts']=function(_0x9ad273,_0xa8575e,_0x1b9f11){return db['CmContact'][_0xd744('0x3f')]({'where':{'id':_0x9ad273[_0xd744('0x48')]['id']}})[_0xd744('0x1f')](handleEntityNotFound(_0xa8575e,null))[_0xd744('0x1f')](function(_0x49c075){if(_0x49c075){return _0x49c075[_0xd744('0x49')](_0x9ad273['body'][_0xd744('0x4a')],_[_0xd744('0x4b')](_0x9ad273[_0xd744('0x47')],[_0xd744('0x4a'),'id'])||{});}})[_0xd744('0x1f')](respondWithResult(_0xa8575e,null))[_0xd744('0x3d')](handleError(_0xa8575e,null));};exports[_0xd744('0x4c')]=function(_0x1ece71,_0x4ebd2d,_0x2c6b8e){var _0x1be6a4={};var _0x18c36a={};var _0x150cc4;var _0x127dbd;return db[_0xd744('0x26')][_0xd744('0x4d')]({'where':{'id':_0x1ece71[_0xd744('0x48')]['id']}})[_0xd744('0x1f')](handleEntityNotFound(_0x4ebd2d,null))['then'](function(_0x533278){if(_0x533278){_0x150cc4=_0x533278;_0x18c36a[_0xd744('0x2a')]=_[_0xd744('0x28')](db[_0xd744('0x4e')]['rawAttributes']);_0x18c36a[_0xd744('0x2b')]=_[_0xd744('0x28')](_0x1ece71[_0xd744('0x2b')]);_0x18c36a[_0xd744('0x33')]=_['intersection'](_0x18c36a[_0xd744('0x2a')],_0x18c36a[_0xd744('0x2b')]);_0x1be6a4['attributes']=_[_0xd744('0x29')](_0x18c36a[_0xd744('0x2a')],qs['fields'](_0x1ece71[_0xd744('0x2b')][_0xd744('0x2c')]));_0x1be6a4[_0xd744('0x2d')]=_0x1be6a4['attributes']['length']?_0x1be6a4[_0xd744('0x2d')]:_0x18c36a[_0xd744('0x2a')];_0x1be6a4[_0xd744('0x30')]=qs[_0xd744('0x31')](_0x1ece71[_0xd744('0x2b')][_0xd744('0x31')]);_0x1be6a4[_0xd744('0x32')]=qs[_0xd744('0x33')](_['pick'](_0x1ece71[_0xd744('0x2b')],_0x18c36a['filters']));if(_0x1ece71[_0xd744('0x2b')][_0xd744('0x35')]){_0x1be6a4[_0xd744('0x32')]=_[_0xd744('0x36')](_0x1be6a4['where'],{'$or':_[_0xd744('0x37')](_0x1be6a4[_0xd744('0x2d')],function(_0x3a7c77){var _0x3a391d={};_0x3a391d[_0x3a7c77]={'$like':'%'+_0x1ece71['query'][_0xd744('0x35')]+'%'};return _0x3a391d;})});}_0x1be6a4=_['merge']({},_0x1be6a4,_0x1ece71[_0xd744('0x38')]);return _0x150cc4[_0xd744('0x4c')](_0x1be6a4);}})[_0xd744('0x1f')](function(_0xd0dd2d){if(_0xd0dd2d){_0x127dbd=_0xd0dd2d[_0xd744('0x2e')];if(!_0x1ece71[_0xd744('0x2b')][_0xd744('0x2f')](_0xd744('0x4f'))){_0x1be6a4['limit']=qs[_0xd744('0x18')](_0x1ece71[_0xd744('0x2b')]['limit']);_0x1be6a4[_0xd744('0x17')]=qs[_0xd744('0x17')](_0x1ece71['query']['offset']);}return _0x150cc4['getContacts'](_0x1be6a4);}})['then'](function(_0x24e8bd){if(_0x24e8bd){return _0x24e8bd?{'count':_0x127dbd,'rows':_0x24e8bd}:null;}})[_0xd744('0x1f')](respondWithResult(_0x4ebd2d,null))[_0xd744('0x3d')](handleError(_0x4ebd2d,null));};
\ No newline at end of file
+var _0x9088=['omit','ids','findOne','getContacts','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','moment','bluebird','mustache','util','sox','ejs','lodash','squel','jsforce','desk.js','papaparse','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/logger','api','../../config/environment','../../mysqldb','sendStatus','status','json','count','offset','set','Content-Range','apply','reject','then','destroy','get','UserProfileResource','end','error','stack','name','send','CmCompany','describe','model','query','intersection','attributes','fields','length','hasOwnProperty','nolimit','limit','order','sort','where','pick','filters','map','filter','options','includeAll','rows','catch','params','keys','rawAttributes','include','merge','find','create','body','user','Unable\x20to\x20retrieve\x20the\x20current\x20user','role','Companies','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','update','addContacts','CmContact'];(function(_0x321bb2,_0x202794){var _0x9c12ed=function(_0x263dd3){while(--_0x263dd3){_0x321bb2['push'](_0x321bb2['shift']());}};_0x9c12ed(++_0x202794);}(_0x9088,0xfd));var _0x8908=function(_0xc376bf,_0x416d55){_0xc376bf=_0xc376bf-0x0;var _0x5c7588=_0x9088[_0xc376bf];return _0x5c7588;};'use strict';var pdf=require('html-pdf');var emlformat=require(_0x8908('0x0'));var rimraf=require(_0x8908('0x1'));var zipdir=require(_0x8908('0x2'));var jsonpatch=require(_0x8908('0x3'));var rp=require(_0x8908('0x4'));var moment=require(_0x8908('0x5'));var BPromise=require(_0x8908('0x6'));var Mustache=require(_0x8908('0x7'));var util=require(_0x8908('0x8'));var path=require('path');var sox=require(_0x8908('0x9'));var csv=require('to-csv');var ejs=require(_0x8908('0xa'));var fs=require('fs');var _=require(_0x8908('0xb'));var squel=require(_0x8908('0xc'));var crypto=require('crypto');var jsforce=require(_0x8908('0xd'));var deskjs=require(_0x8908('0xe'));var toCsv=require('to-csv');var querystring=require('querystring');var Papa=require(_0x8908('0xf'));var Redis=require('ioredis');var authService=require(_0x8908('0x10'));var qs=require(_0x8908('0x11'));var as=require(_0x8908('0x12'));var hardwareService=require('../../config/license/hardware');var logger=require(_0x8908('0x13'))(_0x8908('0x14'));var utils=require('../../config/utils');var config=require(_0x8908('0x15'));var db=require(_0x8908('0x16'))['db'];function respondWithStatusCode(_0x3ca43f,_0x2b716d){_0x2b716d=_0x2b716d||0xcc;return function(_0x3acf19){if(_0x3acf19){return _0x3ca43f[_0x8908('0x17')](_0x2b716d);}return _0x3ca43f[_0x8908('0x18')](_0x2b716d)['end']();};}function respondWithResult(_0x202cda,_0x36e3ab){_0x36e3ab=_0x36e3ab||0xc8;return function(_0x1018f4){if(_0x1018f4){return _0x202cda[_0x8908('0x18')](_0x36e3ab)[_0x8908('0x19')](_0x1018f4);}};}function respondWithFilteredResult(_0x27a2e8,_0x5ed5ad){return function(_0x56fbe4){if(_0x56fbe4){var _0x49ede4=_0x56fbe4[_0x8908('0x1a')],_0x2892be=_0x5ed5ad[_0x8908('0x1b')],_0x3d94f6=_0x5ed5ad[_0x8908('0x1b')]+_0x5ed5ad['limit'],_0x80c388;if(_0x3d94f6>=_0x49ede4){_0x3d94f6=_0x49ede4;_0x80c388=0xc8;}else{_0x80c388=0xce;}_0x27a2e8[_0x8908('0x18')](_0x80c388);return _0x27a2e8[_0x8908('0x1c')](_0x8908('0x1d'),_0x2892be+'-'+_0x3d94f6+'/'+_0x49ede4)[_0x8908('0x19')](_0x56fbe4);}return null;};}function patchUpdates(_0x4a6ba3){return function(_0x1b46ff){try{jsonpatch[_0x8908('0x1e')](_0x1b46ff,_0x4a6ba3,!![]);}catch(_0x278dcf){return BPromise[_0x8908('0x1f')](_0x278dcf);}return _0x1b46ff['save']();};}function saveUpdates(_0x17c4f3,_0x3fd543){return function(_0x5e799c){if(_0x5e799c){return _0x5e799c['update'](_0x17c4f3)[_0x8908('0x20')](function(_0x5a3bcf){return _0x5a3bcf;});}return null;};}function removeEntity(_0x357e9f,_0x575f0a){return function(_0x5e7116){if(_0x5e7116){return _0x5e7116[_0x8908('0x21')]()[_0x8908('0x20')](function(){var _0x283bff=_0x5e7116[_0x8908('0x22')]({'plain':!![]});var _0x46a5ea='Companies';return db[_0x8908('0x23')]['destroy']({'where':{'type':_0x46a5ea,'resourceId':_0x283bff['id']}})[_0x8908('0x20')](function(){return _0x5e7116;});})[_0x8908('0x20')](function(){_0x357e9f['status'](0xcc)[_0x8908('0x24')]();});}};}function handleEntityNotFound(_0x12a9fa,_0x3a745d){return function(_0x295042){if(!_0x295042){_0x12a9fa[_0x8908('0x17')](0x194);}return _0x295042;};}function handleError(_0x402746,_0x582d86){_0x582d86=_0x582d86||0x1f4;return function(_0x30afb3){logger[_0x8908('0x25')](_0x30afb3[_0x8908('0x26')]);if(_0x30afb3[_0x8908('0x27')]){delete _0x30afb3[_0x8908('0x27')];}_0x402746[_0x8908('0x18')](_0x582d86)[_0x8908('0x28')](_0x30afb3);};}exports['index']=function(_0x616d41,_0x5d47d0){var _0xf3ccb={},_0x8e261e={},_0x47b3dd={'count':0x0,'rows':[]};return db[_0x8908('0x29')][_0x8908('0x2a')]()[_0x8908('0x20')](function(_0x3a1943){_0x8e261e[_0x8908('0x2b')]=_['keys'](_0x3a1943);_0x8e261e[_0x8908('0x2c')]=_['keys'](_0x616d41['query']);_0x8e261e['filters']=_[_0x8908('0x2d')](_0x8e261e[_0x8908('0x2b')],_0x8e261e['query']);_0xf3ccb[_0x8908('0x2e')]=_[_0x8908('0x2d')](_0x8e261e[_0x8908('0x2b')],qs[_0x8908('0x2f')](_0x616d41[_0x8908('0x2c')][_0x8908('0x2f')]));_0xf3ccb[_0x8908('0x2e')]=_0xf3ccb[_0x8908('0x2e')][_0x8908('0x30')]?_0xf3ccb[_0x8908('0x2e')]:_0x8e261e['model'];if(!_0x616d41[_0x8908('0x2c')][_0x8908('0x31')](_0x8908('0x32'))){_0xf3ccb['limit']=qs[_0x8908('0x33')](_0x616d41[_0x8908('0x2c')][_0x8908('0x33')]);_0xf3ccb[_0x8908('0x1b')]=qs[_0x8908('0x1b')](_0x616d41[_0x8908('0x2c')][_0x8908('0x1b')]);}_0xf3ccb[_0x8908('0x34')]=qs[_0x8908('0x35')](_0x616d41['query'][_0x8908('0x35')]);_0xf3ccb[_0x8908('0x36')]=qs['filters'](_[_0x8908('0x37')](_0x616d41['query'],_0x8e261e[_0x8908('0x38')]));if(_0x616d41[_0x8908('0x2c')]['filter']){_0xf3ccb[_0x8908('0x36')]=_['merge'](_0xf3ccb['where'],{'$or':_[_0x8908('0x39')](_0xf3ccb[_0x8908('0x2e')],function(_0x4c38d6){var _0x4843cb={};_0x4843cb[_0x4c38d6]={'$like':'%'+_0x616d41[_0x8908('0x2c')][_0x8908('0x3a')]+'%'};return _0x4843cb;})});}_0xf3ccb=_['merge']({},_0xf3ccb,_0x616d41[_0x8908('0x3b')]);var _0x3b6396={'where':_0xf3ccb[_0x8908('0x36')]};return db[_0x8908('0x29')][_0x8908('0x1a')](_0x3b6396)['then'](function(_0xc51f1e){_0x47b3dd[_0x8908('0x1a')]=_0xc51f1e;if(_0x616d41[_0x8908('0x2c')][_0x8908('0x3c')]){_0xf3ccb['include']=[{'all':!![]}];}return db[_0x8908('0x29')]['findAll'](_0xf3ccb);})[_0x8908('0x20')](function(_0x3e8f0b){_0x47b3dd[_0x8908('0x3d')]=_0x3e8f0b;return _0x47b3dd;})[_0x8908('0x20')](respondWithFilteredResult(_0x5d47d0,_0xf3ccb))[_0x8908('0x3e')](handleError(_0x5d47d0,null));})[_0x8908('0x3e')](handleError(_0x5d47d0,null));};exports['show']=function(_0x443075,_0x383b60){var _0x13e2a1={'raw':![],'where':{'id':_0x443075[_0x8908('0x3f')]['id']}},_0x4bc183={};_0x4bc183[_0x8908('0x2b')]=_[_0x8908('0x40')](db['CmCompany'][_0x8908('0x41')]);_0x4bc183[_0x8908('0x2c')]=_[_0x8908('0x40')](_0x443075[_0x8908('0x2c')]);_0x4bc183[_0x8908('0x38')]=_['intersection'](_0x4bc183['model'],_0x4bc183[_0x8908('0x2c')]);_0x13e2a1[_0x8908('0x2e')]=_[_0x8908('0x2d')](_0x4bc183[_0x8908('0x2b')],qs[_0x8908('0x2f')](_0x443075['query']['fields']));_0x13e2a1[_0x8908('0x2e')]=_0x13e2a1[_0x8908('0x2e')][_0x8908('0x30')]?_0x13e2a1[_0x8908('0x2e')]:_0x4bc183['model'];if(_0x443075['query'][_0x8908('0x3c')]){_0x13e2a1[_0x8908('0x42')]=[{'all':!![]}];}_0x13e2a1=_[_0x8908('0x43')]({},_0x13e2a1,_0x443075[_0x8908('0x3b')]);return db[_0x8908('0x29')][_0x8908('0x44')](_0x13e2a1)[_0x8908('0x20')](handleEntityNotFound(_0x383b60,null))[_0x8908('0x20')](respondWithResult(_0x383b60,null))[_0x8908('0x3e')](handleError(_0x383b60,null));};exports['create']=function(_0x4784c9,_0x458311){return db[_0x8908('0x29')][_0x8908('0x45')](_0x4784c9[_0x8908('0x46')],{})['then'](function(_0x24147b){var _0xdcacbb=_0x4784c9[_0x8908('0x47')]['get']({'plain':!![]});if(!_0xdcacbb)throw new Error(_0x8908('0x48'));if(_0xdcacbb[_0x8908('0x49')]===_0x8908('0x47')){var _0x4e49b0=_0x24147b[_0x8908('0x22')]({'plain':!![]});var _0x33cdfa=_0x8908('0x4a');return db['UserProfileSection'][_0x8908('0x44')]({'where':{'name':_0x33cdfa,'userProfileId':_0xdcacbb['userProfileId']},'raw':!![]})[_0x8908('0x20')](function(_0x3a224d){if(_0x3a224d&&_0x3a224d['autoAssociation']===0x0){return db[_0x8908('0x23')]['create']({'name':_0x4e49b0['name'],'resourceId':_0x4e49b0['id'],'type':_0x3a224d[_0x8908('0x27')],'sectionId':_0x3a224d['id']},{})[_0x8908('0x20')](function(){return _0x24147b;});}else{return _0x24147b;}})['catch'](function(_0x5213e1){logger[_0x8908('0x25')](_0x8908('0x4b'),_0x5213e1);throw _0x5213e1;});}return _0x24147b;})['then'](respondWithResult(_0x458311,0xc9))[_0x8908('0x3e')](handleError(_0x458311,null));};exports[_0x8908('0x4c')]=function(_0x19809c,_0x4ce74d){if(_0x19809c[_0x8908('0x46')]['id']){delete _0x19809c[_0x8908('0x46')]['id'];}return db[_0x8908('0x29')]['find']({'where':{'id':_0x19809c[_0x8908('0x3f')]['id']}})[_0x8908('0x20')](handleEntityNotFound(_0x4ce74d,null))[_0x8908('0x20')](saveUpdates(_0x19809c[_0x8908('0x46')],null))['then'](respondWithResult(_0x4ce74d,null))[_0x8908('0x3e')](handleError(_0x4ce74d,null));};exports[_0x8908('0x21')]=function(_0x5eb896,_0x2509c5){return db['CmCompany']['find']({'where':{'id':_0x5eb896[_0x8908('0x3f')]['id']}})[_0x8908('0x20')](handleEntityNotFound(_0x2509c5,null))[_0x8908('0x20')](removeEntity(_0x2509c5,null))[_0x8908('0x3e')](handleError(_0x2509c5,null));};exports[_0x8908('0x2a')]=function(_0x11b4a2,_0x513558){return db[_0x8908('0x29')]['describe']()['then'](respondWithResult(_0x513558,null))[_0x8908('0x3e')](handleError(_0x513558,null));};exports[_0x8908('0x4d')]=function(_0x465471,_0x4eff06,_0x532e4d){return db[_0x8908('0x4e')][_0x8908('0x44')]({'where':{'id':_0x465471[_0x8908('0x3f')]['id']}})[_0x8908('0x20')](handleEntityNotFound(_0x4eff06,null))['then'](function(_0x3b5b6c){if(_0x3b5b6c){return _0x3b5b6c[_0x8908('0x4d')](_0x465471[_0x8908('0x46')]['ids'],_[_0x8908('0x4f')](_0x465471[_0x8908('0x46')],[_0x8908('0x50'),'id'])||{});}})[_0x8908('0x20')](respondWithResult(_0x4eff06,null))['catch'](handleError(_0x4eff06,null));};exports['getContacts']=function(_0x3c96bb,_0x4e155d,_0x2c8ad1){var _0x86d8fd={};var _0x425d9d={};var _0x1441bb;var _0x40a083;return db[_0x8908('0x29')][_0x8908('0x51')]({'where':{'id':_0x3c96bb[_0x8908('0x3f')]['id']}})[_0x8908('0x20')](handleEntityNotFound(_0x4e155d,null))[_0x8908('0x20')](function(_0x2c984e){if(_0x2c984e){_0x1441bb=_0x2c984e;_0x425d9d['model']=_['keys'](db[_0x8908('0x4e')]['rawAttributes']);_0x425d9d[_0x8908('0x2c')]=_[_0x8908('0x40')](_0x3c96bb['query']);_0x425d9d[_0x8908('0x38')]=_[_0x8908('0x2d')](_0x425d9d['model'],_0x425d9d[_0x8908('0x2c')]);_0x86d8fd[_0x8908('0x2e')]=_[_0x8908('0x2d')](_0x425d9d[_0x8908('0x2b')],qs[_0x8908('0x2f')](_0x3c96bb[_0x8908('0x2c')][_0x8908('0x2f')]));_0x86d8fd[_0x8908('0x2e')]=_0x86d8fd['attributes'][_0x8908('0x30')]?_0x86d8fd['attributes']:_0x425d9d['model'];_0x86d8fd[_0x8908('0x34')]=qs[_0x8908('0x35')](_0x3c96bb[_0x8908('0x2c')][_0x8908('0x35')]);_0x86d8fd[_0x8908('0x36')]=qs['filters'](_[_0x8908('0x37')](_0x3c96bb[_0x8908('0x2c')],_0x425d9d[_0x8908('0x38')]));if(_0x3c96bb[_0x8908('0x2c')][_0x8908('0x3a')]){_0x86d8fd['where']=_[_0x8908('0x43')](_0x86d8fd[_0x8908('0x36')],{'$or':_['map'](_0x86d8fd[_0x8908('0x2e')],function(_0x1bfb03){var _0x45077f={};_0x45077f[_0x1bfb03]={'$like':'%'+_0x3c96bb[_0x8908('0x2c')][_0x8908('0x3a')]+'%'};return _0x45077f;})});}_0x86d8fd=_[_0x8908('0x43')]({},_0x86d8fd,_0x3c96bb['options']);return _0x1441bb[_0x8908('0x52')](_0x86d8fd);}})[_0x8908('0x20')](function(_0x13b277){if(_0x13b277){_0x40a083=_0x13b277['length'];if(!_0x3c96bb['query'][_0x8908('0x31')](_0x8908('0x32'))){_0x86d8fd[_0x8908('0x33')]=qs[_0x8908('0x33')](_0x3c96bb[_0x8908('0x2c')][_0x8908('0x33')]);_0x86d8fd['offset']=qs[_0x8908('0x1b')](_0x3c96bb['query'][_0x8908('0x1b')]);}return _0x1441bb[_0x8908('0x52')](_0x86d8fd);}})[_0x8908('0x20')](function(_0x35a10a){if(_0x35a10a){return _0x35a10a?{'count':_0x40a083,'rows':_0x35a10a}:null;}})[_0x8908('0x20')](respondWithResult(_0x4e155d,null))[_0x8908('0x3e')](handleError(_0x4e155d,null));};
\ No newline at end of file
diff --git a/server/api/cmCompany/cmCompany.model.js b/server/api/cmCompany/cmCompany.model.js
index a619cfe..0b8b3a9 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 _0x7a59=['../../config/environment','./cmCompany.attributes','exports','define','CmCompany','cm_companies','lodash','api','moment','bluebird','request-promise','path'];(function(_0xae7c2f,_0xf31e04){var _0x5d7001=function(_0x4eeadb){while(--_0x4eeadb){_0xae7c2f['push'](_0xae7c2f['shift']());}};_0x5d7001(++_0xf31e04);}(_0x7a59,0x16e));var _0x97a5=function(_0xcd0918,_0x56bdf9){_0xcd0918=_0xcd0918-0x0;var _0x250704=_0x7a59[_0xcd0918];return _0x250704;};'use strict';var _=require(_0x97a5('0x0'));var util=require('util');var logger=require('../../config/logger')(_0x97a5('0x1'));var moment=require(_0x97a5('0x2'));var BPromise=require(_0x97a5('0x3'));var rp=require(_0x97a5('0x4'));var fs=require('fs');var path=require(_0x97a5('0x5'));var rimraf=require('rimraf');var config=require(_0x97a5('0x6'));var attributes=require(_0x97a5('0x7'));module[_0x97a5('0x8')]=function(_0x48201b,_0x438520){return _0x48201b[_0x97a5('0x9')](_0x97a5('0xa'),attributes,{'tableName':_0x97a5('0xb'),'paranoid':![],'indexes':[],'timestamps':!![]});};
\ No newline at end of file
+var _0x2975=['CmCompany','cm_companies','util','../../config/logger','api','moment','bluebird','request-promise','./cmCompany.attributes','exports','define'];(function(_0x26a67e,_0xe9001c){var _0x40f9ff=function(_0x4ab940){while(--_0x4ab940){_0x26a67e['push'](_0x26a67e['shift']());}};_0x40f9ff(++_0xe9001c);}(_0x2975,0x1c5));var _0x5297=function(_0xec8974,_0x2dac1f){_0xec8974=_0xec8974-0x0;var _0x1f2b93=_0x2975[_0xec8974];return _0x1f2b93;};'use strict';var _=require('lodash');var util=require(_0x5297('0x0'));var logger=require(_0x5297('0x1'))(_0x5297('0x2'));var moment=require(_0x5297('0x3'));var BPromise=require(_0x5297('0x4'));var rp=require(_0x5297('0x5'));var fs=require('fs');var path=require('path');var rimraf=require('rimraf');var config=require('../../config/environment');var attributes=require(_0x5297('0x6'));module[_0x5297('0x7')]=function(_0x11a43d,_0x3da9c6){return _0x11a43d[_0x5297('0x8')](_0x5297('0x9'),attributes,{'tableName':_0x5297('0xa'),'paranoid':![],'indexes':[],'timestamps':!![]});};
\ No newline at end of file
diff --git a/server/api/cmCompany/cmCompany.rpc.js b/server/api/cmCompany/cmCompany.rpc.js
index 19659cd..b5f95d5 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 _0x886e=['rpc','../../config/environment','jayson/promise','client','then','info','CmCompany,\x20%s,\x20%s','CmCompany,\x20%s,\x20%s,\x20%s','request\x20sent','stringify','error','message','result','catch','lodash','util','moment','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger'];(function(_0x5207d3,_0x1b67d4){var _0x36785c=function(_0x11a1d3){while(--_0x11a1d3){_0x5207d3['push'](_0x5207d3['shift']());}};_0x36785c(++_0x1b67d4);}(_0x886e,0x158));var _0xe886=function(_0x519de,_0x11bd17){_0x519de=_0x519de-0x0;var _0x14cf23=_0x886e[_0x519de];return _0x14cf23;};'use strict';var _=require(_0xe886('0x0'));var util=require(_0xe886('0x1'));var moment=require(_0xe886('0x2'));var BPromise=require('bluebird');var rs=require(_0xe886('0x3'));var fs=require('fs');var Redis=require(_0xe886('0x4'));var db=require(_0xe886('0x5'))['db'];var utils=require(_0xe886('0x6'));var logger=require(_0xe886('0x7'))(_0xe886('0x8'));var config=require(_0xe886('0x9'));var jayson=require(_0xe886('0xa'));var client=jayson[_0xe886('0xb')]['http']({'port':0x232a});function respondWithRpcPromise(_0x449781,_0x5b5878,_0x11fcb9){return new BPromise(function(_0x3821c5,_0x15087c){return client['request'](_0x449781,_0x11fcb9)[_0xe886('0xc')](function(_0xd2f2fb){logger[_0xe886('0xd')](_0xe886('0xe'),_0x5b5878,'request\x20sent');logger['debug'](_0xe886('0xf'),_0x5b5878,_0xe886('0x10'),JSON[_0xe886('0x11')](_0xd2f2fb));if(_0xd2f2fb[_0xe886('0x12')]){if(_0xd2f2fb[_0xe886('0x12')]['code']===0x1f4){logger[_0xe886('0x12')](_0xe886('0xe'),_0x5b5878,_0xd2f2fb['error'][_0xe886('0x13')]);return _0x15087c(_0xd2f2fb[_0xe886('0x12')][_0xe886('0x13')]);}logger[_0xe886('0x12')](_0xe886('0xe'),_0x5b5878,_0xd2f2fb[_0xe886('0x12')][_0xe886('0x13')]);return _0x3821c5(_0xd2f2fb[_0xe886('0x12')][_0xe886('0x13')]);}else{logger[_0xe886('0xd')]('CmCompany,\x20%s,\x20%s',_0x5b5878,_0xe886('0x10'));_0x3821c5(_0xd2f2fb[_0xe886('0x14')][_0xe886('0x13')]);}})[_0xe886('0x15')](function(_0x96a6d4){logger[_0xe886('0x12')](_0xe886('0xe'),_0x5b5878,_0x96a6d4);_0x15087c(_0x96a6d4);});});}
\ No newline at end of file
+var _0x0a17=['client','request','then','info','CmCompany,\x20%s,\x20%s','request\x20sent','debug','CmCompany,\x20%s,\x20%s,\x20%s','stringify','error','code','message','catch','util','bluebird','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise'];(function(_0xb9404d,_0xb9c541){var _0x5cfcf7=function(_0x1732d2){while(--_0x1732d2){_0xb9404d['push'](_0xb9404d['shift']());}};_0x5cfcf7(++_0xb9c541);}(_0x0a17,0x65));var _0x70a1=function(_0x1e9c81,_0x3b8ce8){_0x1e9c81=_0x1e9c81-0x0;var _0x47209e=_0x0a17[_0x1e9c81];return _0x47209e;};'use strict';var _=require('lodash');var util=require(_0x70a1('0x0'));var moment=require('moment');var BPromise=require(_0x70a1('0x1'));var rs=require('randomstring');var fs=require('fs');var Redis=require(_0x70a1('0x2'));var db=require(_0x70a1('0x3'))['db'];var utils=require(_0x70a1('0x4'));var logger=require(_0x70a1('0x5'))(_0x70a1('0x6'));var config=require(_0x70a1('0x7'));var jayson=require(_0x70a1('0x8'));var client=jayson[_0x70a1('0x9')]['http']({'port':0x232a});function respondWithRpcPromise(_0x1f4b02,_0x3ea947,_0x3ed99e){return new BPromise(function(_0x40beca,_0x4e2115){return client[_0x70a1('0xa')](_0x1f4b02,_0x3ed99e)[_0x70a1('0xb')](function(_0x30c6b2){logger[_0x70a1('0xc')](_0x70a1('0xd'),_0x3ea947,_0x70a1('0xe'));logger[_0x70a1('0xf')](_0x70a1('0x10'),_0x3ea947,_0x70a1('0xe'),JSON[_0x70a1('0x11')](_0x30c6b2));if(_0x30c6b2[_0x70a1('0x12')]){if(_0x30c6b2[_0x70a1('0x12')][_0x70a1('0x13')]===0x1f4){logger['error']('CmCompany,\x20%s,\x20%s',_0x3ea947,_0x30c6b2[_0x70a1('0x12')][_0x70a1('0x14')]);return _0x4e2115(_0x30c6b2[_0x70a1('0x12')][_0x70a1('0x14')]);}logger[_0x70a1('0x12')]('CmCompany,\x20%s,\x20%s',_0x3ea947,_0x30c6b2[_0x70a1('0x12')][_0x70a1('0x14')]);return _0x40beca(_0x30c6b2[_0x70a1('0x12')][_0x70a1('0x14')]);}else{logger[_0x70a1('0xc')](_0x70a1('0xd'),_0x3ea947,_0x70a1('0xe'));_0x40beca(_0x30c6b2['result'][_0x70a1('0x14')]);}})[_0x70a1('0x15')](function(_0x571448){logger[_0x70a1('0x12')]('CmCompany,\x20%s,\x20%s',_0x3ea947,_0x571448);_0x4e2115(_0x571448);});});}
\ No newline at end of file
diff --git a/server/api/cmCompany/index.js b/server/api/cmCompany/index.js
index cde6c24..597d02a 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 _0x6d38=['destroy','util','path','connect-timeout','../../components/auth/service','../../config/environment','./cmCompany.controller','get','index','/describe','isAuthenticated','/:id','show','getContacts','create','post','put','update','delete'];(function(_0xac9b48,_0x1a05d8){var _0x505527=function(_0x6e9271){while(--_0x6e9271){_0xac9b48['push'](_0xac9b48['shift']());}};_0x505527(++_0x1a05d8);}(_0x6d38,0x1ef));var _0x86d3=function(_0x164eca,_0x555e28){_0x164eca=_0x164eca-0x0;var _0x2ce562=_0x6d38[_0x164eca];return _0x2ce562;};'use strict';var multer=require('multer');var util=require(_0x86d3('0x0'));var path=require(_0x86d3('0x1'));var timeout=require(_0x86d3('0x2'));var express=require('express');var router=express['Router']();var auth=require(_0x86d3('0x3'));var interaction=require('../../components/interaction/service');var config=require(_0x86d3('0x4'));var controller=require(_0x86d3('0x5'));router[_0x86d3('0x6')]('/',auth['isAuthenticated'](),controller[_0x86d3('0x7')]);router[_0x86d3('0x6')](_0x86d3('0x8'),auth[_0x86d3('0x9')](),controller['describe']);router['get'](_0x86d3('0xa'),auth[_0x86d3('0x9')](),controller[_0x86d3('0xb')]);router['get']('/:id/contacts',auth[_0x86d3('0x9')](),controller[_0x86d3('0xc')]);router['post']('/',auth['isAuthenticated'](),controller[_0x86d3('0xd')]);router[_0x86d3('0xe')]('/:id/contacts',auth[_0x86d3('0x9')](),controller['addContacts']);router[_0x86d3('0xf')](_0x86d3('0xa'),auth[_0x86d3('0x9')](),controller[_0x86d3('0x10')]);router[_0x86d3('0x11')](_0x86d3('0xa'),auth[_0x86d3('0x9')](),controller[_0x86d3('0x12')]);module['exports']=router;
\ No newline at end of file
+var _0x627e=['../../components/interaction/service','../../config/environment','index','get','/describe','isAuthenticated','describe','/:id/contacts','create','post','addContacts','put','/:id','delete','exports','multer','util','path','connect-timeout','express','../../components/auth/service'];(function(_0x4a367f,_0x4e05f2){var _0x2bedd5=function(_0x5b5e70){while(--_0x5b5e70){_0x4a367f['push'](_0x4a367f['shift']());}};_0x2bedd5(++_0x4e05f2);}(_0x627e,0x14a));var _0xe627=function(_0x1588dd,_0x2b6e24){_0x1588dd=_0x1588dd-0x0;var _0x5c6d26=_0x627e[_0x1588dd];return _0x5c6d26;};'use strict';var multer=require(_0xe627('0x0'));var util=require(_0xe627('0x1'));var path=require(_0xe627('0x2'));var timeout=require(_0xe627('0x3'));var express=require(_0xe627('0x4'));var router=express['Router']();var auth=require(_0xe627('0x5'));var interaction=require(_0xe627('0x6'));var config=require(_0xe627('0x7'));var controller=require('./cmCompany.controller');router['get']('/',auth['isAuthenticated'](),controller[_0xe627('0x8')]);router[_0xe627('0x9')](_0xe627('0xa'),auth[_0xe627('0xb')](),controller[_0xe627('0xc')]);router[_0xe627('0x9')]('/:id',auth[_0xe627('0xb')](),controller['show']);router['get'](_0xe627('0xd'),auth[_0xe627('0xb')](),controller['getContacts']);router['post']('/',auth[_0xe627('0xb')](),controller[_0xe627('0xe')]);router[_0xe627('0xf')](_0xe627('0xd'),auth[_0xe627('0xb')](),controller[_0xe627('0x10')]);router[_0xe627('0x11')](_0xe627('0x12'),auth[_0xe627('0xb')](),controller['update']);router[_0xe627('0x13')](_0xe627('0x12'),auth[_0xe627('0xb')](),controller['destroy']);module[_0xe627('0x14')]=router;
\ No newline at end of file
diff --git a/server/api/cmContact/cmContact.attributes.js b/server/api/cmContact/cmContact.attributes.js
index e98c51b..3b702c4 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 _0x49b6=['INTEGER','UNSIGNED','sequelize','STRING','TEXT'];(function(_0x45d31c,_0xd0b936){var _0x33c23a=function(_0xe014b0){while(--_0xe014b0){_0x45d31c['push'](_0x45d31c['shift']());}};_0x33c23a(++_0xd0b936);}(_0x49b6,0x11a));var _0x649b=function(_0x5cc450,_0xbc6fa8){_0x5cc450=_0x5cc450-0x0;var _0x781ec6=_0x49b6[_0x5cc450];return _0x781ec6;};'use strict';var _=require('lodash');var Sequelize=require(_0x649b('0x0'));module['exports']={'firstName':{'type':Sequelize[_0x649b('0x1')],'allowNull':![]},'lastName':{'type':Sequelize['STRING']},'street':{'type':Sequelize[_0x649b('0x1')]},'postalCode':{'type':Sequelize[_0x649b('0x1')]},'city':{'type':Sequelize['STRING']},'country':{'type':Sequelize[_0x649b('0x1')]},'dateOfBirth':{'type':Sequelize[_0x649b('0x1')]},'description':{'type':Sequelize[_0x649b('0x2')]},'phone':{'type':Sequelize['STRING']},'mobile':{'type':Sequelize['STRING']},'fax':{'type':Sequelize[_0x649b('0x1')]},'email':{'type':Sequelize[_0x649b('0x1')]},'url':{'type':Sequelize[_0x649b('0x1')]},'facebook':{'type':Sequelize[_0x649b('0x1')]},'fb_data':{'type':Sequelize['STRING']},'twitter':{'type':Sequelize[_0x649b('0x1')]},'skype':{'type':Sequelize[_0x649b('0x1')]},'teams':{'type':Sequelize['STRING']},'viber':{'type':Sequelize[_0x649b('0x1')]},'line':{'type':Sequelize[_0x649b('0x1')]},'wechat':{'type':Sequelize['STRING']},'telegram':{'type':Sequelize['STRING']},'UserId':{'type':Sequelize[_0x649b('0x3')]},'priority':{'type':Sequelize['INTEGER'](0x2)[_0x649b('0x4')],'defaultValue':0x2,'validate':{'min':0x0,'max':0x4}},'scheduledat':{'type':Sequelize['DATE'],'defaultValue':Sequelize['NOW']}};
\ No newline at end of file
+var _0x647b=['NOW','lodash','sequelize','exports','STRING','TEXT','INTEGER','UNSIGNED','DATE'];(function(_0x2ad005,_0x9e4e58){var _0x465d61=function(_0x493152){while(--_0x493152){_0x2ad005['push'](_0x2ad005['shift']());}};_0x465d61(++_0x9e4e58);}(_0x647b,0xd9));var _0xb647=function(_0x618414,_0x1a7a60){_0x618414=_0x618414-0x0;var _0x21c19a=_0x647b[_0x618414];return _0x21c19a;};'use strict';var _=require(_0xb647('0x0'));var Sequelize=require(_0xb647('0x1'));module[_0xb647('0x2')]={'firstName':{'type':Sequelize[_0xb647('0x3')],'allowNull':![]},'lastName':{'type':Sequelize[_0xb647('0x3')]},'street':{'type':Sequelize[_0xb647('0x3')]},'postalCode':{'type':Sequelize[_0xb647('0x3')]},'city':{'type':Sequelize[_0xb647('0x3')]},'country':{'type':Sequelize[_0xb647('0x3')]},'dateOfBirth':{'type':Sequelize[_0xb647('0x3')]},'description':{'type':Sequelize[_0xb647('0x4')]},'phone':{'type':Sequelize['STRING']},'mobile':{'type':Sequelize[_0xb647('0x3')]},'fax':{'type':Sequelize[_0xb647('0x3')]},'email':{'type':Sequelize[_0xb647('0x3')]},'url':{'type':Sequelize['STRING']},'facebook':{'type':Sequelize[_0xb647('0x3')]},'fb_data':{'type':Sequelize[_0xb647('0x3')]},'twitter':{'type':Sequelize[_0xb647('0x3')]},'skype':{'type':Sequelize[_0xb647('0x3')]},'teams':{'type':Sequelize[_0xb647('0x3')]},'viber':{'type':Sequelize[_0xb647('0x3')]},'line':{'type':Sequelize[_0xb647('0x3')]},'wechat':{'type':Sequelize['STRING']},'telegram':{'type':Sequelize['STRING']},'UserId':{'type':Sequelize['INTEGER']},'priority':{'type':Sequelize[_0xb647('0x5')](0x2)[_0xb647('0x6')],'defaultValue':0x2,'validate':{'min':0x0,'max':0x4}},'scheduledat':{'type':Sequelize[_0xb647('0x7')],'defaultValue':Sequelize[_0xb647('0x8')]}};
\ No newline at end of file
diff --git a/server/api/cmContact/cmContact.controller.js b/server/api/cmContact/cmContact.controller.js
index 53d2f81..2264e9b 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 _0xe78a=['c.id\x20LIKE\x20?','c.phone\x20LIKE\x20?','c.mobile\x20LIKE\x20?','c.fax\x20LIKE\x20?','isEmail','c.email\x20LIKE\x20?','c.firstName\x20LIKE\x20?','c.lastName\x20LIKE\x20?','group','c.id','Sequelize','QueryTypes','SELECT','clone','order','isEmpty','having','t.id\x20IN\x20?','resolve','some','user','c.ListId\x20IS\x20NULL','toString','sequelize','keyBy','merge','c.firstName','c.lastName','c.phone','c.mobile','c.fax','c.email','c.ListId','c.deletedAt','GROUP_CONCAT(DISTINCT\x20t.id)','TagIds','Tags','rows','catch','find','params','tags','keys','findAll','displayName','alias','hasOwnProperty','body','mergeWith','info','[CmContact][merge]\x20to\x20%s\x20from\x20%s','CmHopper','CmHopperBlack','[CmContact][merge][destroy][CmHopperBlack],\x20%s','create','ChatInteraction','update','ChatMessage','ChatOfflineMessage','MailMessage','MailInteraction','SmsInteraction','SmsMessage','FaxInteraction','FaxMessage','OpenchannelInteraction','OpenchannelMessage','CmHopperFinal','CmHopperHistory','ReportAgentPreview','VoiceCallReport','ChatQueueReport','JscriptySessionReport','bulkCreate','each','duplicates','$or','findOrCreate','spread','get','ListId','omit','format','cf_%d','$and','pickBy','id\x20=\x20?','toParam','values','phone','getTags','options','setTags','ids','getHoppers','rawAttributes','ContactId','includeAll','include','getHopperFinals','getJscriptySessions','uploadCsv','No\x20ListId\x20specified','binding_keys','binding_values','No\x20association\x20values\x20specified!','socket_timestamp','Incorrect\x20binding\x20parameters\x20passed!','zipObject','No\x20phone\x20column\x20specified','firstName','No\x20firstName\x20column\x20specified','join','server/files/tmp','file','filename','child_process','fork','CompanyId','File\x20uploaded\x20correctly!','pid','upload','createReadStream','path','parse','meta','User','agent','binding','Unable\x20to\x20synchronize\x20socket,\x20no\x20timestamp\x20passed','stringify','exit','error\x20child\x20process','html-pdf','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','moment','bluebird','mustache','util','sox','lodash','squel','crypto','jsforce','desk.js','to-csv','querystring','papaparse','ioredis','../../components/parsers/qs','../../config/logger','api','../../config/utils','../../config/environment','../../mysqldb','redis','defaults','localhost','./cmContact.socket','register','sendStatus','end','status','json','count','offset','limit','set','Content-Range','apply','reject','save','then','destroy','error','name','send','index','CmContact','describe','length','startsWith','cf_','push','CmCustomField','findOne','trimStart','fieldType','type','model','query','filters','intersection','fields','attributes','nolimit','sort','where','pick','field','color','from','tools_tags','cm_contacts','left_join','cm_user_has_contacts','uc.CmContactId\x20=\x20c.id','cm_contact_has_tags','ct.CmContactId\x20=\x20c.id','c.deletedAt\x20IS\x20NULL','expr','search','parseSearch','sqlOperator','conditions','Tag','value','map','forEach','union','and','datetime','DATE','buildExpression','text','filter','isNil','Contact','c.ListId\x20IN\x20?','concat','CONCAT_WS(\x27\x20\x27,\x20c.firstName,\x20c.lastName,\x20c.email)\x20LIKE\x20?','tag','isArray','CONCAT(\x27,\x27,\x20`TagIds`,\x20\x27,\x27)\x20LIKE\x20?','replace','\x27\x27\x27\x27','split','getFullTextValue'];(function(_0x3b3d0e,_0x5d1383){var _0x5dcd49=function(_0x2ee76d){while(--_0x2ee76d){_0x3b3d0e['push'](_0x3b3d0e['shift']());}};_0x5dcd49(++_0x5d1383);}(_0xe78a,0x177));var _0xae78=function(_0x321bb2,_0x202794){_0x321bb2=_0x321bb2-0x0;var _0x9c12ed=_0xe78a[_0x321bb2];return _0x9c12ed;};'use strict';var pdf=require(_0xae78('0x0'));var emlformat=require(_0xae78('0x1'));var rimraf=require(_0xae78('0x2'));var zipdir=require(_0xae78('0x3'));var jsonpatch=require(_0xae78('0x4'));var rp=require(_0xae78('0x5'));var moment=require(_0xae78('0x6'));var BPromise=require(_0xae78('0x7'));var Mustache=require(_0xae78('0x8'));var util=require(_0xae78('0x9'));var path=require('path');var sox=require(_0xae78('0xa'));var csv=require('to-csv');var ejs=require('ejs');var fs=require('fs');var _=require(_0xae78('0xb'));var squel=require(_0xae78('0xc'));var crypto=require(_0xae78('0xd'));var jsforce=require(_0xae78('0xe'));var deskjs=require(_0xae78('0xf'));var toCsv=require(_0xae78('0x10'));var querystring=require(_0xae78('0x11'));var Papa=require(_0xae78('0x12'));var Redis=require(_0xae78('0x13'));var authService=require('../../components/auth/service');var qs=require(_0xae78('0x14'));var as=require('../../components/parsers/advancedSearch');var hardwareService=require('../../config/license/hardware');var logger=require(_0xae78('0x15'))(_0xae78('0x16'));var utils=require(_0xae78('0x17'));var config=require(_0xae78('0x18'));var db=require(_0xae78('0x19'))['db'];config[_0xae78('0x1a')]=_[_0xae78('0x1b')](config['redis'],{'host':_0xae78('0x1c'),'port':0x18eb});var socket=require('socket.io-emitter')(new Redis(config[_0xae78('0x1a')]));require(_0xae78('0x1d'))[_0xae78('0x1e')](socket);function respondWithStatusCode(_0x34d14f,_0x4500af){_0x4500af=_0x4500af||0xcc;return function(_0x5aded0){if(_0x5aded0){return _0x34d14f[_0xae78('0x1f')](_0x4500af);}return _0x34d14f['status'](_0x4500af)[_0xae78('0x20')]();};}function respondWithResult(_0x12ab45,_0x47fe91){_0x47fe91=_0x47fe91||0xc8;return function(_0x4cf344){if(_0x4cf344){return _0x12ab45[_0xae78('0x21')](_0x47fe91)[_0xae78('0x22')](_0x4cf344);}};}function respondWithFilteredResult(_0x27600c,_0x12db47){return function(_0x381b7a){if(_0x381b7a){var _0x289450=_0x381b7a[_0xae78('0x23')],_0x14058b=_0x12db47['offset'],_0x2ea2a3=_0x12db47[_0xae78('0x24')]+_0x12db47[_0xae78('0x25')],_0x4bfa01;if(_0x2ea2a3>=_0x289450){_0x2ea2a3=_0x289450;_0x4bfa01=0xc8;}else{_0x4bfa01=0xce;}_0x27600c[_0xae78('0x21')](_0x4bfa01);return _0x27600c[_0xae78('0x26')](_0xae78('0x27'),_0x14058b+'-'+_0x2ea2a3+'/'+_0x289450)[_0xae78('0x22')](_0x381b7a);}return null;};}function patchUpdates(_0x3b87b4){return function(_0x2024cd){try{jsonpatch[_0xae78('0x28')](_0x2024cd,_0x3b87b4,!![]);}catch(_0xcb837e){return BPromise[_0xae78('0x29')](_0xcb837e);}return _0x2024cd[_0xae78('0x2a')]();};}function saveUpdates(_0x5221fb,_0x56462b){return function(_0x1e5bf5){if(_0x1e5bf5){return _0x1e5bf5['update'](_0x5221fb)[_0xae78('0x2b')](function(_0x349a42){return _0x349a42;});}return null;};}function removeEntity(_0x32a0ef,_0x457021){return function(_0x22cae2){if(_0x22cae2){return _0x22cae2[_0xae78('0x2c')]()[_0xae78('0x2b')](function(){_0x32a0ef['status'](0xcc)['end']();});}};}function handleEntityNotFound(_0x51d639,_0x1cc9e2){return function(_0x51dce1){if(!_0x51dce1){_0x51d639[_0xae78('0x1f')](0x194);}return _0x51dce1;};}function handleError(_0x7f32e5,_0x5b98e1){_0x5b98e1=_0x5b98e1||0x1f4;return function(_0x328a03){logger[_0xae78('0x2d')](_0x328a03['stack']);if(_0x328a03[_0xae78('0x2e')]){delete _0x328a03[_0xae78('0x2e')];}_0x7f32e5[_0xae78('0x21')](_0x5b98e1)[_0xae78('0x2f')](_0x328a03);};}exports[_0xae78('0x30')]=function(_0x57bea4,_0x551074){var _0x13114d={},_0x128a3b={},_0x54b19d={'count':0x0,'rows':[]};return db[_0xae78('0x31')][_0xae78('0x32')]()['then'](function(_0x3b8f3e){var _0x425f23=[];for(var _0x2ca2d5=0x0;_0x2ca2d50x1){_0x4865c0['or']('MATCH\x20(c.firstName,\x20c.lastName,\x20c.phone,\x20c.mobile,\x20c.fax,\x20c.email)\x20AGAINST\x20(?\x20IN\x20BOOLEAN\x20MODE)',qs[_0xae78('0x6c')](_0x5bd895),null);}else{if(qs['isNumeric'](_0x5bd895)){_0x4865c0['or'](_0xae78('0x6d'),_0x5bd895+'%');_0x4865c0['or'](_0xae78('0x6e'),_0x5bd895+'%');_0x4865c0['or'](_0xae78('0x6f'),_0x5bd895+'%');_0x4865c0['or'](_0xae78('0x70'),_0x5bd895+'%');}else if(qs[_0xae78('0x71')](_0x5bd895)){_0x4865c0['or'](_0xae78('0x72'),_0x5bd895+'%');}else{_0x4865c0['or'](_0xae78('0x73'),'%'+_0x5bd895+'%');_0x4865c0['or'](_0xae78('0x74'),'%'+_0x5bd895+'%');_0x4865c0['or']('c.email\x20LIKE\x20?','%'+_0x5bd895+'%');}}}}_0x1717ff['where'](_0x4865c0);_0x1717ff[_0xae78('0x75')](_0xae78('0x76'));var _0x18b80f={'type':db[_0xae78('0x77')][_0xae78('0x78')][_0xae78('0x79')],'raw':!![]};var _0x125858=_0x1717ff[_0xae78('0x7a')]()[_0xae78('0x46')](_0xae78('0x76'));if(_0x13114d[_0xae78('0x7b')]){_0x13114d[_0xae78('0x7b')]['forEach'](function(_0x1a7b56){_0x1717ff['order']('c.'+_0x1a7b56[0x0],_0x1a7b56[0x1]==='DESC'?![]:!![]);});}if(!_[_0xae78('0x7c')](_0x7bd00e)){_0x1717ff[_0xae78('0x7d')](_0x4166df);_0x125858[_0xae78('0x44')](_0xae78('0x7e'),_0x7bd00e);}BPromise[_0xae78('0x7f')]()[_0xae78('0x2b')](function(){if(_0x11cb7e&&!_[_0xae78('0x80')](_0x11cb7e[_0xae78('0x55')],[_0xae78('0x46'),'User'])){return _0x57bea4[_0xae78('0x81')]['getLists']({'attributes':['id'],'raw':!![]})[_0xae78('0x2b')](function(_0x47ed7b){if(_['isEmpty'](_0x47ed7b)){_0x125858[_0xae78('0x44')](_0xae78('0x82'));_0x1717ff[_0xae78('0x44')](_0xae78('0x82'));}else{_0x125858[_0xae78('0x44')](_0xae78('0x63'),_['map'](_0x47ed7b,'id'));_0x1717ff[_0xae78('0x44')](_0xae78('0x63'),_[_0xae78('0x58')](_0x47ed7b,'id'));}});}else{return;}})[_0xae78('0x2b')](function(){db['sequelize'][_0xae78('0x3d')](_0x125858[_0xae78('0x83')](),_0x18b80f)[_0xae78('0x2b')](function(_0xf08541){_0x54b19d[_0xae78('0x23')]=_0xf08541[_0xae78('0x33')];if(_0x54b19d['count']===0x0)return[];return db[_0xae78('0x84')]['query'](_0x343377[_0xae78('0x83')](),_0x18b80f);})[_0xae78('0x2b')](function(_0x2f6c34){_0x631446=_[_0xae78('0x85')](_0x2f6c34,'id');_0x18b80f=_[_0xae78('0x86')](_0x18b80f,{'model':db[_0xae78('0x31')],'mapToModel':!![],'raw':!![],'nest':!![]});if(_0x57bea4[_0xae78('0x3d')][_0xae78('0x40')]){_0x13114d['attributes'][_0xae78('0x59')](function(_0x21578c){_0x1717ff[_0xae78('0x46')]('c.'+_0x21578c);});}else{_0x1717ff[_0xae78('0x46')]('c.id');_0x1717ff[_0xae78('0x46')](_0xae78('0x87'));_0x1717ff['field'](_0xae78('0x88'));_0x1717ff[_0xae78('0x46')](_0xae78('0x89'));_0x1717ff['field'](_0xae78('0x8a'));_0x1717ff['field'](_0xae78('0x8b'));_0x1717ff[_0xae78('0x46')](_0xae78('0x8c'));_0x1717ff[_0xae78('0x46')](_0xae78('0x8d'));_0x1717ff[_0xae78('0x46')](_0xae78('0x8e'));_0x1717ff[_0xae78('0x46')](_0xae78('0x8f'),_0xae78('0x90'));}if(_0x13114d[_0xae78('0x25')])_0x1717ff['limit'](_0x13114d[_0xae78('0x25')]);if(_0x13114d['offset'])_0x1717ff[_0xae78('0x24')](_0x13114d[_0xae78('0x24')]);return db[_0xae78('0x84')][_0xae78('0x3d')](_0x1717ff['toString'](),_0x18b80f);})['then'](function(_0x30a40d){_0x30a40d[_0xae78('0x59')](function(_0x4bec8a){if(_0x4bec8a[_0xae78('0x90')]){_0x4bec8a[_0xae78('0x91')]=[];_0x4bec8a[_0xae78('0x90')]['split'](',')[_0xae78('0x59')](function(_0x24a3b2){_0x4bec8a['Tags'][_0xae78('0x36')](_0x631446[_0x24a3b2]);});}delete _0x4bec8a[_0xae78('0x90')];});_0x54b19d[_0xae78('0x92')]=_0x30a40d;return _0x54b19d;})[_0xae78('0x2b')](respondWithFilteredResult(_0x551074,_0x13114d));});})[_0xae78('0x93')](handleError(_0x551074,null));};exports['destroy']=function(_0x12d064,_0x206633){return db[_0xae78('0x31')][_0xae78('0x94')]({'where':{'id':_0x12d064[_0xae78('0x95')]['id']}})[_0xae78('0x2b')](handleEntityNotFound(_0x206633,null))['then'](removeEntity(_0x206633,null))[_0xae78('0x93')](handleError(_0x206633,null));};exports[_0xae78('0x32')]=function(_0x1ad78f,_0x49e6a9){return db[_0xae78('0x31')][_0xae78('0x32')]()[_0xae78('0x2b')](function(_0x500fdf){delete _0x500fdf[_0xae78('0x96')];for(var _0x245815=0x0;_0x245815=_0x18631b){_0x2aaf9b=_0x18631b;_0x5740c8=0xc8;}else{_0x5740c8=0xce;}_0x401be7[_0x4451('0x1a')](_0x5740c8);return _0x401be7[_0x4451('0x20')](_0x4451('0x21'),_0x5428f4+'-'+_0x2aaf9b+'/'+_0x18631b)['json'](_0x295e55);}return null;};}function patchUpdates(_0x439c06){return function(_0x44f6e7){try{jsonpatch['apply'](_0x44f6e7,_0x439c06,!![]);}catch(_0x37d76c){return BPromise[_0x4451('0x22')](_0x37d76c);}return _0x44f6e7['save']();};}function saveUpdates(_0x2ad2aa,_0x45c562){return function(_0x3862ec){if(_0x3862ec){return _0x3862ec['update'](_0x2ad2aa)[_0x4451('0x23')](function(_0x49bf1b){return _0x49bf1b;});}return null;};}function removeEntity(_0x3a6210,_0x480c3c){return function(_0x449906){if(_0x449906){return _0x449906[_0x4451('0x24')]()[_0x4451('0x23')](function(){_0x3a6210[_0x4451('0x1a')](0xcc)[_0x4451('0x1b')]();});}};}function handleEntityNotFound(_0x5bd112,_0x5cb3eb){return function(_0x2d6691){if(!_0x2d6691){_0x5bd112[_0x4451('0x19')](0x194);}return _0x2d6691;};}function handleError(_0x3f45be,_0x34a0ed){_0x34a0ed=_0x34a0ed||0x1f4;return function(_0x5ae845){logger[_0x4451('0x25')](_0x5ae845['stack']);if(_0x5ae845[_0x4451('0x26')]){delete _0x5ae845[_0x4451('0x26')];}_0x3f45be[_0x4451('0x1a')](_0x34a0ed)[_0x4451('0x27')](_0x5ae845);};}exports[_0x4451('0x28')]=function(_0xaa2217,_0x2c8c2a){var _0x9f33e6={},_0x2177b5={},_0x72312a={'count':0x0,'rows':[]};return db['CmContact'][_0x4451('0x29')]()['then'](function(_0x237255){var _0x235054=[];for(var _0x1dbc5d=0x0;_0x1dbc5d0x1){_0x2058f0['or'](_0x4451('0x65'),qs[_0x4451('0x66')](_0x4fab8d),null);}else{if(qs[_0x4451('0x67')](_0x4fab8d)){_0x2058f0['or'](_0x4451('0x68'),_0x4fab8d+'%');_0x2058f0['or'](_0x4451('0x69'),_0x4fab8d+'%');_0x2058f0['or']('c.mobile\x20LIKE\x20?',_0x4fab8d+'%');_0x2058f0['or'](_0x4451('0x6a'),_0x4fab8d+'%');}else if(qs['isEmail'](_0x4fab8d)){_0x2058f0['or'](_0x4451('0x6b'),_0x4fab8d+'%');}else{_0x2058f0['or']('c.firstName\x20LIKE\x20?','%'+_0x4fab8d+'%');_0x2058f0['or'](_0x4451('0x6c'),'%'+_0x4fab8d+'%');_0x2058f0['or'](_0x4451('0x6b'),'%'+_0x4fab8d+'%');}}}}_0x2c4fb0[_0x4451('0x3d')](_0x2058f0);_0x2c4fb0['group'](_0x4451('0x6d'));var _0x25e12f={'type':db[_0x4451('0x6e')]['QueryTypes'][_0x4451('0x6f')],'raw':!![]};var _0xdc5426=_0x2c4fb0['clone']()[_0x4451('0x40')](_0x4451('0x6d'));if(_0x9f33e6[_0x4451('0x70')]){_0x9f33e6[_0x4451('0x70')]['forEach'](function(_0x562303){_0x2c4fb0[_0x4451('0x70')]('c.'+_0x562303[0x0],_0x562303[0x1]==='DESC'?![]:!![]);});}if(!_[_0x4451('0x5c')](_0x1605bd)){_0x2c4fb0[_0x4451('0x71')](_0x2c634e);_0xdc5426[_0x4451('0x3d')](_0x4451('0x72'),_0x1605bd);}BPromise[_0x4451('0x73')]()[_0x4451('0x23')](function(){if(_0x54c330&&!_[_0x4451('0x74')](_0x54c330[_0x4451('0x4c')],[_0x4451('0x40'),_0x4451('0x75')])){return _0xaa2217[_0x4451('0x76')]['getLists']({'attributes':['id'],'raw':!![]})[_0x4451('0x23')](function(_0x1f1927){if(_[_0x4451('0x5c')](_0x1f1927)){_0xdc5426[_0x4451('0x3d')]('c.ListId\x20IS\x20NULL');_0x2c4fb0['where'](_0x4451('0x77'));}else{_0xdc5426[_0x4451('0x3d')](_0x4451('0x78'),_[_0x4451('0x79')](_0x1f1927,'id'));_0x2c4fb0['where'](_0x4451('0x78'),_['map'](_0x1f1927,'id'));}});}else{return;}})[_0x4451('0x23')](function(){db[_0x4451('0x7a')][_0x4451('0x35')](_0xdc5426['toString'](),_0x25e12f)['then'](function(_0x379933){_0x72312a['count']=_0x379933[_0x4451('0x2b')];if(_0x72312a[_0x4451('0x1d')]===0x0)return[];return db['sequelize'][_0x4451('0x35')](_0x371ea2[_0x4451('0x7b')](),_0x25e12f);})[_0x4451('0x23')](function(_0x5c4688){_0x3cc363=_['keyBy'](_0x5c4688,'id');_0x25e12f=_[_0x4451('0x7c')](_0x25e12f,{'model':db[_0x4451('0x7d')],'mapToModel':!![],'raw':!![],'nest':!![]});if(_0xaa2217[_0x4451('0x35')][_0x4451('0x39')]){_0x9f33e6[_0x4451('0x38')][_0x4451('0x51')](function(_0x2e99a4){_0x2c4fb0[_0x4451('0x40')]('c.'+_0x2e99a4);});}else{_0x2c4fb0[_0x4451('0x40')](_0x4451('0x6d'));_0x2c4fb0[_0x4451('0x40')]('c.firstName');_0x2c4fb0[_0x4451('0x40')](_0x4451('0x7e'));_0x2c4fb0[_0x4451('0x40')]('c.phone');_0x2c4fb0[_0x4451('0x40')]('c.mobile');_0x2c4fb0[_0x4451('0x40')](_0x4451('0x7f'));_0x2c4fb0[_0x4451('0x40')](_0x4451('0x80'));_0x2c4fb0[_0x4451('0x40')](_0x4451('0x81'));_0x2c4fb0[_0x4451('0x40')](_0x4451('0x82'));_0x2c4fb0[_0x4451('0x40')](_0x4451('0x83'),_0x4451('0x84'));}if(_0x9f33e6['limit'])_0x2c4fb0[_0x4451('0x1f')](_0x9f33e6[_0x4451('0x1f')]);if(_0x9f33e6[_0x4451('0x1e')])_0x2c4fb0[_0x4451('0x1e')](_0x9f33e6['offset']);return db[_0x4451('0x7a')][_0x4451('0x35')](_0x2c4fb0[_0x4451('0x7b')](),_0x25e12f);})[_0x4451('0x23')](function(_0x6f9350){_0x6f9350[_0x4451('0x51')](function(_0x12e3de){if(_0x12e3de[_0x4451('0x84')]){_0x12e3de[_0x4451('0x85')]=[];_0x12e3de[_0x4451('0x84')][_0x4451('0x50')](',')[_0x4451('0x51')](function(_0x2b66f0){_0x12e3de[_0x4451('0x85')][_0x4451('0x5a')](_0x3cc363[_0x2b66f0]);});}delete _0x12e3de['TagIds'];});_0x72312a[_0x4451('0x86')]=_0x6f9350;return _0x72312a;})[_0x4451('0x23')](respondWithFilteredResult(_0x2c8c2a,_0x9f33e6));});})[_0x4451('0x87')](handleError(_0x2c8c2a,null));};exports[_0x4451('0x24')]=function(_0x1f54fe,_0x386283){return db[_0x4451('0x7d')][_0x4451('0x4d')]({'where':{'id':_0x1f54fe[_0x4451('0x88')]['id']}})[_0x4451('0x23')](handleEntityNotFound(_0x386283,null))[_0x4451('0x23')](removeEntity(_0x386283,null))['catch'](handleError(_0x386283,null));};exports[_0x4451('0x29')]=function(_0x2630b4,_0x4d424f){return db[_0x4451('0x7d')][_0x4451('0x29')]()[_0x4451('0x23')](function(_0x5f4f1c){delete _0x5f4f1c['tags'];for(var _0x92ac86=0x0;_0x92ac86{}\s\\|]/g,'-');_0xe04a5c(null,util['format'](_0x50e8('0x1d'),path[_0x50e8('0x1e')](_0x4d2318['originalname'],path[_0x50e8('0x1f')](_0x4d2318[_0x50e8('0x1b')])),Date['now'](),path[_0x50e8('0x1f')](_0x4d2318[_0x50e8('0x1b')])));}})});router['post']('/csv',upload['single'](_0x50e8('0x20')),controller[_0x50e8('0x21')]);var upload=multer({'storage':multer[_0x50e8('0x18')]({'destination':function(_0x371a1f,_0xc2f832,_0x13b6e9){_0x13b6e9(null,path['join'](config[_0x50e8('0x22')],_0x50e8('0x1a')));},'filename':function(_0x4b3a09,_0x177201,_0x2bc8d8){_0x177201[_0x50e8('0x1b')]=_0x177201[_0x50e8('0x1b')]['replace'](/[+@&\/\\#,+()$~%'":*?<>{}\s\\|]/g,'-');_0x2bc8d8(null,util[_0x50e8('0x23')]('%s-%s%s',path[_0x50e8('0x1e')](_0x177201[_0x50e8('0x1b')],path[_0x50e8('0x1f')](_0x177201['originalname'])),Date[_0x50e8('0x24')](),path[_0x50e8('0x1f')](_0x177201[_0x50e8('0x1b')])));}})});router[_0x50e8('0x12')](_0x50e8('0x25'),upload[_0x50e8('0x26')](_0x50e8('0x20')),controller['upload']);router[_0x50e8('0x12')](_0x50e8('0x27'),auth['isAuthenticated'](),controller['import']);router[_0x50e8('0x28')](_0x50e8('0x9'),auth[_0x50e8('0x6')](),controller['update']);router['delete'](_0x50e8('0x9'),auth[_0x50e8('0x6')](),controller['destroy']);module[_0x50e8('0x29')]=router;
\ No newline at end of file
+var _0x46ed=['replace','format','basename','extname','now','/csv','file','%s-%s%s','/upload','single','upload','/upload/:id','import','put','delete','destroy','exports','multer','util','connect-timeout','express','Router','../../components/interaction/service','../../config/environment','get','isAuthenticated','index','/describe','describe','/:id','show','/:id/tags','/:id/hoppers','getHoppers','/:id/hopper_histories','getHopperHistories','getHopperFinals','getJscriptySessions','post','/merge','merge','create','bulkCreate','setTags','diskStorage','join','root','server/files/tmp','originalname'];(function(_0x4588c3,_0x5dc4f5){var _0x2c53f0=function(_0x1f8e56){while(--_0x1f8e56){_0x4588c3['push'](_0x4588c3['shift']());}};_0x2c53f0(++_0x5dc4f5);}(_0x46ed,0x168));var _0xd46e=function(_0x178e48,_0x3c9509){_0x178e48=_0x178e48-0x0;var _0x440d7e=_0x46ed[_0x178e48];return _0x440d7e;};'use strict';var multer=require(_0xd46e('0x0'));var util=require(_0xd46e('0x1'));var path=require('path');var timeout=require(_0xd46e('0x2'));var express=require(_0xd46e('0x3'));var router=express[_0xd46e('0x4')]();var auth=require('../../components/auth/service');var interaction=require(_0xd46e('0x5'));var config=require(_0xd46e('0x6'));var controller=require('./cmContact.controller');router[_0xd46e('0x7')]('/',auth[_0xd46e('0x8')](),controller[_0xd46e('0x9')]);router[_0xd46e('0x7')](_0xd46e('0xa'),auth[_0xd46e('0x8')](),controller[_0xd46e('0xb')]);router[_0xd46e('0x7')](_0xd46e('0xc'),auth[_0xd46e('0x8')](),controller[_0xd46e('0xd')]);router['get'](_0xd46e('0xe'),auth[_0xd46e('0x8')](),controller['getTags']);router[_0xd46e('0x7')](_0xd46e('0xf'),auth[_0xd46e('0x8')](),controller[_0xd46e('0x10')]);router[_0xd46e('0x7')](_0xd46e('0x11'),auth['isAuthenticated'](),controller[_0xd46e('0x12')]);router['get']('/:id/hopper_finals',auth[_0xd46e('0x8')](),controller[_0xd46e('0x13')]);router['get']('/:id/jscripty_sessions',auth[_0xd46e('0x8')](),controller[_0xd46e('0x14')]);router[_0xd46e('0x15')](_0xd46e('0x16'),auth['isAuthenticated'](),controller[_0xd46e('0x17')]);router[_0xd46e('0x15')]('/',auth[_0xd46e('0x8')](),controller[_0xd46e('0x18')]);router[_0xd46e('0x15')]('/create_many',auth[_0xd46e('0x8')](),controller[_0xd46e('0x19')]);router[_0xd46e('0x15')]('/:id/tags',auth['isAuthenticated'](),controller[_0xd46e('0x1a')]);var upload=multer({'storage':multer[_0xd46e('0x1b')]({'destination':function(_0x488690,_0x4fd1f2,_0x2d6f2c){_0x2d6f2c(null,path[_0xd46e('0x1c')](config[_0xd46e('0x1d')],_0xd46e('0x1e')));},'filename':function(_0x409010,_0x312d6f,_0x3b5fa4){_0x312d6f[_0xd46e('0x1f')]=_0x312d6f[_0xd46e('0x1f')][_0xd46e('0x20')](/[+@&\/\\#,+()$~%'":*?<>{}\s\\|]/g,'-');_0x3b5fa4(null,util[_0xd46e('0x21')]('%s-%s%s',path[_0xd46e('0x22')](_0x312d6f[_0xd46e('0x1f')],path[_0xd46e('0x23')](_0x312d6f[_0xd46e('0x1f')])),Date[_0xd46e('0x24')](),path[_0xd46e('0x23')](_0x312d6f[_0xd46e('0x1f')])));}})});router[_0xd46e('0x15')](_0xd46e('0x25'),upload['single'](_0xd46e('0x26')),controller['uploadCsv']);var upload=multer({'storage':multer['diskStorage']({'destination':function(_0x371054,_0x2a5271,_0x21135f){_0x21135f(null,path[_0xd46e('0x1c')](config[_0xd46e('0x1d')],_0xd46e('0x1e')));},'filename':function(_0x1740d1,_0x4dab6a,_0x45d789){_0x4dab6a[_0xd46e('0x1f')]=_0x4dab6a[_0xd46e('0x1f')][_0xd46e('0x20')](/[+@&\/\\#,+()$~%'":*?<>{}\s\\|]/g,'-');_0x45d789(null,util[_0xd46e('0x21')](_0xd46e('0x27'),path['basename'](_0x4dab6a[_0xd46e('0x1f')],path[_0xd46e('0x23')](_0x4dab6a[_0xd46e('0x1f')])),Date[_0xd46e('0x24')](),path[_0xd46e('0x23')](_0x4dab6a[_0xd46e('0x1f')])));}})});router[_0xd46e('0x15')](_0xd46e('0x28'),upload[_0xd46e('0x29')](_0xd46e('0x26')),controller[_0xd46e('0x2a')]);router[_0xd46e('0x15')](_0xd46e('0x2b'),auth['isAuthenticated'](),controller[_0xd46e('0x2c')]);router[_0xd46e('0x2d')](_0xd46e('0xc'),auth[_0xd46e('0x8')](),controller['update']);router[_0xd46e('0x2e')](_0xd46e('0xc'),auth['isAuthenticated'](),controller[_0xd46e('0x2f')]);module[_0xd46e('0x30')]=router;
\ No newline at end of file
diff --git a/server/api/cmCustomField/cmCustomField.attributes.js b/server/api/cmCustomField/cmCustomField.attributes.js
index 747a1d7..30330c4 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 _0x808e=['TEXT','long','type','select','parse','values','isArray','BOOLEAN','sequelize','lodash','exports','VIRTUAL','alias','STRING','setDataValue','getDataValue','name'];(function(_0xa464c9,_0x7c86d8){var _0x3d73c4=function(_0x5c2056){while(--_0x5c2056){_0xa464c9['push'](_0xa464c9['shift']());}};_0x3d73c4(++_0x7c86d8);}(_0x808e,0x107));var _0xe808=function(_0x4fc9e6,_0xc51915){_0x4fc9e6=_0x4fc9e6-0x0;var _0x551d28=_0x808e[_0x4fc9e6];return _0x551d28;};'use strict';var Sequelize=require(_0xe808('0x0'));var _=require(_0xe808('0x1'));module[_0xe808('0x2')]={'name':{'type':Sequelize[_0xe808('0x3')],'get':function(_0x3442f7){return this['getDataValue'](_0xe808('0x4'));}},'alias':{'type':Sequelize[_0xe808('0x5')],'allowNull':![],'set':function(_0xb0810f){this[_0xe808('0x6')]('alias',_0xb0810f?_0xb0810f:this[_0xe808('0x7')](_0xe808('0x8')));}},'type':{'type':Sequelize[_0xe808('0x5')],'allowNull':![]},'values':{'type':Sequelize[_0xe808('0x9')](_0xe808('0xa')),'get':function(){if(this[_0xe808('0x7')](_0xe808('0xb'))===_0xe808('0xc')){return JSON[_0xe808('0xd')](this[_0xe808('0x7')](_0xe808('0xe')));}else{return this['getDataValue'](_0xe808('0xe'));}},'set':function(_0x295102){if(Array[_0xe808('0xf')](_0x295102)){this['setDataValue'](_0xe808('0xe'),JSON['stringify'](_0x295102));}else{this[_0xe808('0x6')](_0xe808('0xe'),_0x295102);}}},'required':{'type':Sequelize[_0xe808('0x10')],'defaultValue':![]}};
\ No newline at end of file
+var _0x6123=['setDataValue','getDataValue','alias','STRING','name','TEXT','long','type','select','values'];(function(_0x1deb03,_0xd05ad8){var _0x189fe7=function(_0x321225){while(--_0x321225){_0x1deb03['push'](_0x1deb03['shift']());}};_0x189fe7(++_0xd05ad8);}(_0x6123,0x187));var _0x3612=function(_0x161958,_0x15c347){_0x161958=_0x161958-0x0;var _0x5db905=_0x6123[_0x161958];return _0x5db905;};'use strict';var Sequelize=require('sequelize');var _=require('lodash');module['exports']={'name':{'type':Sequelize['VIRTUAL'],'get':function(_0x1c1aaa){return this[_0x3612('0x0')](_0x3612('0x1'));}},'alias':{'type':Sequelize[_0x3612('0x2')],'allowNull':![],'set':function(_0x4c396f){this['setDataValue'](_0x3612('0x1'),_0x4c396f?_0x4c396f:this[_0x3612('0x0')](_0x3612('0x3')));}},'type':{'type':Sequelize[_0x3612('0x2')],'allowNull':![]},'values':{'type':Sequelize[_0x3612('0x4')](_0x3612('0x5')),'get':function(){if(this[_0x3612('0x0')](_0x3612('0x6'))===_0x3612('0x7')){return JSON['parse'](this[_0x3612('0x0')](_0x3612('0x8')));}else{return this[_0x3612('0x0')](_0x3612('0x8'));}},'set':function(_0x2a9576){if(Array['isArray'](_0x2a9576)){this[_0x3612('0x9')](_0x3612('0x8'),JSON['stringify'](_0x2a9576));}else{this['setDataValue'](_0x3612('0x8'),_0x2a9576);}}},'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 2064162..0e1ee7c 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 _0x7e06=['BOOLEAN','defaultValue','queryInterface','addColumn','cm_contacts','format','cf_%d','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','moment','bluebird','mustache','util','path','sox','to-csv','ejs','lodash','desk.js','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/logger','api','../../config/utils','../../config/environment','status','end','json','count','offset','Content-Range','reject','save','update','then','destroy','sendStatus','error','stack','name','index','map','rawAttributes','fieldName','type','key','query','filters','intersection','model','attributes','fields','length','hasOwnProperty','nolimit','order','sort','where','pick','filter','CmCustomField','include','findAll','params','keys','includeAll','merge','catch','body','find','create','sequelize','transaction','Sequelize','text','TEXT','number','INTEGER','switch'];(function(_0x4733d3,_0x454290){var _0x1b9a44=function(_0x1a93bb){while(--_0x1a93bb){_0x4733d3['push'](_0x4733d3['shift']());}};_0x1b9a44(++_0x454290);}(_0x7e06,0x1b0));var _0x67e0=function(_0x36eafc,_0x23fc6e){_0x36eafc=_0x36eafc-0x0;var _0x412f49=_0x7e06[_0x36eafc];return _0x412f49;};'use strict';var pdf=require('html-pdf');var emlformat=require(_0x67e0('0x0'));var rimraf=require(_0x67e0('0x1'));var zipdir=require(_0x67e0('0x2'));var jsonpatch=require(_0x67e0('0x3'));var rp=require(_0x67e0('0x4'));var moment=require(_0x67e0('0x5'));var BPromise=require(_0x67e0('0x6'));var Mustache=require(_0x67e0('0x7'));var util=require(_0x67e0('0x8'));var path=require(_0x67e0('0x9'));var sox=require(_0x67e0('0xa'));var csv=require(_0x67e0('0xb'));var ejs=require(_0x67e0('0xc'));var fs=require('fs');var _=require(_0x67e0('0xd'));var squel=require('squel');var crypto=require('crypto');var jsforce=require('jsforce');var deskjs=require(_0x67e0('0xe'));var toCsv=require('to-csv');var querystring=require('querystring');var Papa=require(_0x67e0('0xf'));var Redis=require(_0x67e0('0x10'));var authService=require(_0x67e0('0x11'));var qs=require(_0x67e0('0x12'));var as=require(_0x67e0('0x13'));var hardwareService=require('../../config/license/hardware');var logger=require(_0x67e0('0x14'))(_0x67e0('0x15'));var utils=require(_0x67e0('0x16'));var config=require(_0x67e0('0x17'));var db=require('../../mysqldb')['db'];function respondWithStatusCode(_0x50d801,_0x3f563c){_0x3f563c=_0x3f563c||0xcc;return function(_0x303141){if(_0x303141){return _0x50d801['sendStatus'](_0x3f563c);}return _0x50d801[_0x67e0('0x18')](_0x3f563c)[_0x67e0('0x19')]();};}function respondWithResult(_0x236e6a,_0x4aa370){_0x4aa370=_0x4aa370||0xc8;return function(_0x19d4ad){if(_0x19d4ad){return _0x236e6a[_0x67e0('0x18')](_0x4aa370)[_0x67e0('0x1a')](_0x19d4ad);}};}function respondWithFilteredResult(_0x24b203,_0x38c4fd){return function(_0x504489){if(_0x504489){var _0x1e445c=_0x504489[_0x67e0('0x1b')],_0x288b70=_0x38c4fd['offset'],_0x494fce=_0x38c4fd[_0x67e0('0x1c')]+_0x38c4fd['limit'],_0x333912;if(_0x494fce>=_0x1e445c){_0x494fce=_0x1e445c;_0x333912=0xc8;}else{_0x333912=0xce;}_0x24b203[_0x67e0('0x18')](_0x333912);return _0x24b203['set'](_0x67e0('0x1d'),_0x288b70+'-'+_0x494fce+'/'+_0x1e445c)[_0x67e0('0x1a')](_0x504489);}return null;};}function patchUpdates(_0x38896f){return function(_0x5b02e1){try{jsonpatch['apply'](_0x5b02e1,_0x38896f,!![]);}catch(_0x57e156){return BPromise[_0x67e0('0x1e')](_0x57e156);}return _0x5b02e1[_0x67e0('0x1f')]();};}function saveUpdates(_0x3bbb7f,_0x33dda1){return function(_0x6cc5e6){if(_0x6cc5e6){return _0x6cc5e6[_0x67e0('0x20')](_0x3bbb7f)[_0x67e0('0x21')](function(_0x275db6){return _0x275db6;});}return null;};}function removeEntity(_0x31b761,_0x180863){return function(_0x417a6a){if(_0x417a6a){return _0x417a6a[_0x67e0('0x22')]()[_0x67e0('0x21')](function(){_0x31b761[_0x67e0('0x18')](0xcc)['end']();});}};}function handleEntityNotFound(_0x44c7e0,_0x38b04a){return function(_0x24963f){if(!_0x24963f){_0x44c7e0[_0x67e0('0x23')](0x194);}return _0x24963f;};}function handleError(_0x5c1fb8,_0x421840){_0x421840=_0x421840||0x1f4;return function(_0x37c949){logger[_0x67e0('0x24')](_0x37c949[_0x67e0('0x25')]);if(_0x37c949[_0x67e0('0x26')]){delete _0x37c949[_0x67e0('0x26')];}_0x5c1fb8[_0x67e0('0x18')](_0x421840)['send'](_0x37c949);};}exports[_0x67e0('0x27')]=function(_0x10b87c,_0x4e5503){var _0x63b4c0={},_0x333caf={},_0x5c4d69={'count':0x0,'rows':[]};var _0x3e0917=_[_0x67e0('0x28')](db['CmCustomField'][_0x67e0('0x29')],function(_0x5b9793){return{'name':_0x5b9793[_0x67e0('0x2a')],'type':_0x5b9793[_0x67e0('0x2b')][_0x67e0('0x2c')]};});_0x333caf['model']=_['differenceBy'](_[_0x67e0('0x28')](_0x3e0917,_0x67e0('0x26')),[_0x67e0('0x26')]);_0x333caf[_0x67e0('0x2d')]=_['keys'](_0x10b87c[_0x67e0('0x2d')]);_0x333caf[_0x67e0('0x2e')]=_[_0x67e0('0x2f')](_0x333caf[_0x67e0('0x30')],_0x333caf[_0x67e0('0x2d')]);_0x63b4c0[_0x67e0('0x31')]=_[_0x67e0('0x2f')](_0x333caf[_0x67e0('0x30')],qs[_0x67e0('0x32')](_0x10b87c['query'][_0x67e0('0x32')]));_0x63b4c0[_0x67e0('0x31')]=_0x63b4c0[_0x67e0('0x31')][_0x67e0('0x33')]?_0x63b4c0['attributes']:_0x333caf['model'];if(!_0x10b87c[_0x67e0('0x2d')][_0x67e0('0x34')](_0x67e0('0x35'))){_0x63b4c0['limit']=qs['limit'](_0x10b87c[_0x67e0('0x2d')]['limit']);_0x63b4c0[_0x67e0('0x1c')]=qs[_0x67e0('0x1c')](_0x10b87c['query']['offset']);}_0x63b4c0[_0x67e0('0x36')]=qs['sort'](_0x10b87c[_0x67e0('0x2d')][_0x67e0('0x37')]);_0x63b4c0[_0x67e0('0x38')]=qs['filters'](_[_0x67e0('0x39')](_0x10b87c[_0x67e0('0x2d')],_0x333caf[_0x67e0('0x2e')]));if(_0x10b87c[_0x67e0('0x2d')][_0x67e0('0x3a')]){_0x63b4c0['where']=_['merge'](_0x63b4c0[_0x67e0('0x38')],{'$or':_[_0x67e0('0x28')](_0x3e0917,function(_0x3814c6){if(_0x3814c6[_0x67e0('0x2b')]!=='VIRTUAL'){var _0x5cce06={};_0x5cce06[_0x3814c6[_0x67e0('0x26')]]={'$like':'%'+_0x10b87c[_0x67e0('0x2d')][_0x67e0('0x3a')]+'%'};return _0x5cce06;}})});}_0x63b4c0=_['merge']({},_0x63b4c0,_0x10b87c['options']);var _0xa5832a={'where':_0x63b4c0[_0x67e0('0x38')]};return db[_0x67e0('0x3b')]['count'](_0xa5832a)[_0x67e0('0x21')](function(_0x425157){_0x5c4d69[_0x67e0('0x1b')]=_0x425157;if(_0x10b87c[_0x67e0('0x2d')]['includeAll']){_0x63b4c0[_0x67e0('0x3c')]=[{'all':!![]}];}return db['CmCustomField'][_0x67e0('0x3d')](_0x63b4c0);})[_0x67e0('0x21')](function(_0x282e19){_0x5c4d69['rows']=_0x282e19;return _0x5c4d69;})[_0x67e0('0x21')](respondWithFilteredResult(_0x4e5503,_0x63b4c0))['catch'](handleError(_0x4e5503,null));};exports['show']=function(_0x361353,_0x564470){var _0x1b7504={'raw':!![],'where':{'id':_0x361353[_0x67e0('0x3e')]['id']}},_0x4b8de1={};_0x4b8de1[_0x67e0('0x30')]=_[_0x67e0('0x3f')](db['CmCustomField'][_0x67e0('0x29')]);_0x4b8de1[_0x67e0('0x2d')]=_['keys'](_0x361353[_0x67e0('0x2d')]);_0x4b8de1['filters']=_[_0x67e0('0x2f')](_0x4b8de1[_0x67e0('0x30')],_0x4b8de1['query']);_0x1b7504[_0x67e0('0x31')]=_[_0x67e0('0x2f')](_0x4b8de1['model'],qs[_0x67e0('0x32')](_0x361353[_0x67e0('0x2d')][_0x67e0('0x32')]));_0x1b7504[_0x67e0('0x31')]=_0x1b7504[_0x67e0('0x31')][_0x67e0('0x33')]?_0x1b7504['attributes']:_0x4b8de1[_0x67e0('0x30')];if(_0x361353[_0x67e0('0x2d')][_0x67e0('0x40')]){_0x1b7504['include']=[{'all':!![]}];}_0x1b7504=_[_0x67e0('0x41')]({},_0x1b7504,_0x361353['options']);return db[_0x67e0('0x3b')]['find'](_0x1b7504)[_0x67e0('0x21')](handleEntityNotFound(_0x564470,null))[_0x67e0('0x21')](respondWithResult(_0x564470,null))[_0x67e0('0x42')](handleError(_0x564470,null));};exports[_0x67e0('0x20')]=function(_0x5d7b93,_0x28c281){if(_0x5d7b93[_0x67e0('0x43')]['id']){delete _0x5d7b93[_0x67e0('0x43')]['id'];}return db[_0x67e0('0x3b')][_0x67e0('0x44')]({'where':{'id':_0x5d7b93['params']['id']}})[_0x67e0('0x21')](handleEntityNotFound(_0x28c281,null))[_0x67e0('0x21')](saveUpdates(_0x5d7b93[_0x67e0('0x43')],null))[_0x67e0('0x21')](respondWithResult(_0x28c281,null))[_0x67e0('0x42')](handleError(_0x28c281,null));};exports[_0x67e0('0x22')]=function(_0x12be5f,_0x311be4){return db[_0x67e0('0x3b')][_0x67e0('0x44')]({'where':{'id':_0x12be5f[_0x67e0('0x3e')]['id']}})[_0x67e0('0x21')](handleEntityNotFound(_0x311be4,null))['then'](removeEntity(_0x311be4,null))[_0x67e0('0x42')](handleError(_0x311be4,null));};exports[_0x67e0('0x45')]=function(_0x5d716d,_0x4ee1dd){var _0x42beef;return db[_0x67e0('0x46')][_0x67e0('0x47')](function(_0x1304e1){return db['CmCustomField']['create'](_0x5d716d[_0x67e0('0x43')],{'transaction':_0x1304e1})[_0x67e0('0x21')](function(_0x283d5e){_0x42beef=_0x283d5e;var _0x4ad35c={'type':db[_0x67e0('0x48')]['TEXT'],'transaction':_0x1304e1};switch(_0x5d716d[_0x67e0('0x43')][_0x67e0('0x2b')]){case _0x67e0('0x49'):_0x4ad35c[_0x67e0('0x2b')]=db['Sequelize'][_0x67e0('0x4a')];break;case _0x67e0('0x4b'):_0x4ad35c[_0x67e0('0x2b')]=db[_0x67e0('0x48')][_0x67e0('0x4c')];break;case _0x67e0('0x4d'):_0x4ad35c['type']=db['Sequelize'][_0x67e0('0x4e')];_0x4ad35c[_0x67e0('0x4f')]=![];break;default:}return db[_0x67e0('0x46')][_0x67e0('0x50')][_0x67e0('0x51')](_0x67e0('0x52'),util[_0x67e0('0x53')](_0x67e0('0x54'),_0x42beef['id']),_0x4ad35c);})[_0x67e0('0x21')](function(){return _0x42beef;});})[_0x67e0('0x21')](respondWithResult(_0x4ee1dd,0xc9))[_0x67e0('0x42')](handleError(_0x4ee1dd,null));};
\ No newline at end of file
+var _0x6dd2=['type','key','model','differenceBy','keys','query','filters','intersection','attributes','fields','length','nolimit','order','sort','where','pick','filter','merge','VIRTUAL','options','CmCustomField','includeAll','findAll','rows','catch','show','params','include','body','find','create','sequelize','transaction','Sequelize','TEXT','text','number','INTEGER','switch','BOOLEAN','queryInterface','addColumn','cm_contacts','format','cf_%d','eml-format','zip-dir','fast-json-patch','moment','bluebird','mustache','path','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','status','end','json','count','offset','limit','set','Content-Range','apply','reject','save','update','destroy','then','error','stack','name','send','index','map','rawAttributes','fieldName'];(function(_0x5ea9f7,_0x5e42da){var _0x295c11=function(_0x43858e){while(--_0x43858e){_0x5ea9f7['push'](_0x5ea9f7['shift']());}};_0x295c11(++_0x5e42da);}(_0x6dd2,0x13e));var _0x26dd=function(_0x44df89,_0x472b67){_0x44df89=_0x44df89-0x0;var _0x6689c=_0x6dd2[_0x44df89];return _0x6689c;};'use strict';var pdf=require('html-pdf');var emlformat=require(_0x26dd('0x0'));var rimraf=require('rimraf');var zipdir=require(_0x26dd('0x1'));var jsonpatch=require(_0x26dd('0x2'));var rp=require('request-promise');var moment=require(_0x26dd('0x3'));var BPromise=require(_0x26dd('0x4'));var Mustache=require(_0x26dd('0x5'));var util=require('util');var path=require(_0x26dd('0x6'));var sox=require('sox');var csv=require(_0x26dd('0x7'));var ejs=require(_0x26dd('0x8'));var fs=require('fs');var _=require(_0x26dd('0x9'));var squel=require(_0x26dd('0xa'));var crypto=require(_0x26dd('0xb'));var jsforce=require(_0x26dd('0xc'));var deskjs=require(_0x26dd('0xd'));var toCsv=require(_0x26dd('0x7'));var querystring=require(_0x26dd('0xe'));var Papa=require('papaparse');var Redis=require(_0x26dd('0xf'));var authService=require(_0x26dd('0x10'));var qs=require(_0x26dd('0x11'));var as=require(_0x26dd('0x12'));var hardwareService=require(_0x26dd('0x13'));var logger=require(_0x26dd('0x14'))(_0x26dd('0x15'));var utils=require(_0x26dd('0x16'));var config=require('../../config/environment');var db=require(_0x26dd('0x17'))['db'];function respondWithStatusCode(_0x1ff675,_0x2144bb){_0x2144bb=_0x2144bb||0xcc;return function(_0x5ed181){if(_0x5ed181){return _0x1ff675['sendStatus'](_0x2144bb);}return _0x1ff675[_0x26dd('0x18')](_0x2144bb)[_0x26dd('0x19')]();};}function respondWithResult(_0x35b11,_0x32780e){_0x32780e=_0x32780e||0xc8;return function(_0x288006){if(_0x288006){return _0x35b11[_0x26dd('0x18')](_0x32780e)[_0x26dd('0x1a')](_0x288006);}};}function respondWithFilteredResult(_0x389c3b,_0x15eb4e){return function(_0x43ea5c){if(_0x43ea5c){var _0x70abe7=_0x43ea5c[_0x26dd('0x1b')],_0xfe45ca=_0x15eb4e[_0x26dd('0x1c')],_0x4e0500=_0x15eb4e['offset']+_0x15eb4e[_0x26dd('0x1d')],_0x37c1e1;if(_0x4e0500>=_0x70abe7){_0x4e0500=_0x70abe7;_0x37c1e1=0xc8;}else{_0x37c1e1=0xce;}_0x389c3b[_0x26dd('0x18')](_0x37c1e1);return _0x389c3b[_0x26dd('0x1e')](_0x26dd('0x1f'),_0xfe45ca+'-'+_0x4e0500+'/'+_0x70abe7)[_0x26dd('0x1a')](_0x43ea5c);}return null;};}function patchUpdates(_0x305c84){return function(_0xfef766){try{jsonpatch[_0x26dd('0x20')](_0xfef766,_0x305c84,!![]);}catch(_0x1e4f40){return BPromise[_0x26dd('0x21')](_0x1e4f40);}return _0xfef766[_0x26dd('0x22')]();};}function saveUpdates(_0x64279b,_0xbd4555){return function(_0x509e25){if(_0x509e25){return _0x509e25[_0x26dd('0x23')](_0x64279b)['then'](function(_0x516c1f){return _0x516c1f;});}return null;};}function removeEntity(_0x37f991,_0x4f36d5){return function(_0x27f0af){if(_0x27f0af){return _0x27f0af[_0x26dd('0x24')]()[_0x26dd('0x25')](function(){_0x37f991['status'](0xcc)[_0x26dd('0x19')]();});}};}function handleEntityNotFound(_0x276959,_0x17fd42){return function(_0x3aec75){if(!_0x3aec75){_0x276959['sendStatus'](0x194);}return _0x3aec75;};}function handleError(_0x43fd4c,_0x2f2f0b){_0x2f2f0b=_0x2f2f0b||0x1f4;return function(_0x43890c){logger[_0x26dd('0x26')](_0x43890c[_0x26dd('0x27')]);if(_0x43890c[_0x26dd('0x28')]){delete _0x43890c[_0x26dd('0x28')];}_0x43fd4c[_0x26dd('0x18')](_0x2f2f0b)[_0x26dd('0x29')](_0x43890c);};}exports[_0x26dd('0x2a')]=function(_0x256d3c,_0x21eb0e){var _0x2b94cd={},_0x25a26c={},_0x35f775={'count':0x0,'rows':[]};var _0x21efad=_[_0x26dd('0x2b')](db['CmCustomField'][_0x26dd('0x2c')],function(_0x35cb86){return{'name':_0x35cb86[_0x26dd('0x2d')],'type':_0x35cb86[_0x26dd('0x2e')][_0x26dd('0x2f')]};});_0x25a26c[_0x26dd('0x30')]=_[_0x26dd('0x31')](_[_0x26dd('0x2b')](_0x21efad,'name'),[_0x26dd('0x28')]);_0x25a26c['query']=_[_0x26dd('0x32')](_0x256d3c[_0x26dd('0x33')]);_0x25a26c[_0x26dd('0x34')]=_[_0x26dd('0x35')](_0x25a26c[_0x26dd('0x30')],_0x25a26c['query']);_0x2b94cd[_0x26dd('0x36')]=_[_0x26dd('0x35')](_0x25a26c[_0x26dd('0x30')],qs[_0x26dd('0x37')](_0x256d3c[_0x26dd('0x33')][_0x26dd('0x37')]));_0x2b94cd[_0x26dd('0x36')]=_0x2b94cd['attributes'][_0x26dd('0x38')]?_0x2b94cd[_0x26dd('0x36')]:_0x25a26c['model'];if(!_0x256d3c[_0x26dd('0x33')]['hasOwnProperty'](_0x26dd('0x39'))){_0x2b94cd[_0x26dd('0x1d')]=qs['limit'](_0x256d3c[_0x26dd('0x33')][_0x26dd('0x1d')]);_0x2b94cd[_0x26dd('0x1c')]=qs['offset'](_0x256d3c[_0x26dd('0x33')][_0x26dd('0x1c')]);}_0x2b94cd[_0x26dd('0x3a')]=qs[_0x26dd('0x3b')](_0x256d3c[_0x26dd('0x33')][_0x26dd('0x3b')]);_0x2b94cd[_0x26dd('0x3c')]=qs['filters'](_[_0x26dd('0x3d')](_0x256d3c['query'],_0x25a26c['filters']));if(_0x256d3c['query'][_0x26dd('0x3e')]){_0x2b94cd['where']=_[_0x26dd('0x3f')](_0x2b94cd['where'],{'$or':_[_0x26dd('0x2b')](_0x21efad,function(_0x4f33c1){if(_0x4f33c1[_0x26dd('0x2e')]!==_0x26dd('0x40')){var _0x58a8f0={};_0x58a8f0[_0x4f33c1[_0x26dd('0x28')]]={'$like':'%'+_0x256d3c[_0x26dd('0x33')][_0x26dd('0x3e')]+'%'};return _0x58a8f0;}})});}_0x2b94cd=_['merge']({},_0x2b94cd,_0x256d3c[_0x26dd('0x41')]);var _0x23273e={'where':_0x2b94cd[_0x26dd('0x3c')]};return db[_0x26dd('0x42')][_0x26dd('0x1b')](_0x23273e)[_0x26dd('0x25')](function(_0x2992dc){_0x35f775[_0x26dd('0x1b')]=_0x2992dc;if(_0x256d3c[_0x26dd('0x33')][_0x26dd('0x43')]){_0x2b94cd['include']=[{'all':!![]}];}return db[_0x26dd('0x42')][_0x26dd('0x44')](_0x2b94cd);})[_0x26dd('0x25')](function(_0x4e22bb){_0x35f775[_0x26dd('0x45')]=_0x4e22bb;return _0x35f775;})[_0x26dd('0x25')](respondWithFilteredResult(_0x21eb0e,_0x2b94cd))[_0x26dd('0x46')](handleError(_0x21eb0e,null));};exports[_0x26dd('0x47')]=function(_0x3a49b0,_0x3656c7){var _0x358509={'raw':!![],'where':{'id':_0x3a49b0[_0x26dd('0x48')]['id']}},_0x569b9e={};_0x569b9e[_0x26dd('0x30')]=_[_0x26dd('0x32')](db[_0x26dd('0x42')]['rawAttributes']);_0x569b9e[_0x26dd('0x33')]=_[_0x26dd('0x32')](_0x3a49b0[_0x26dd('0x33')]);_0x569b9e[_0x26dd('0x34')]=_[_0x26dd('0x35')](_0x569b9e[_0x26dd('0x30')],_0x569b9e['query']);_0x358509[_0x26dd('0x36')]=_[_0x26dd('0x35')](_0x569b9e[_0x26dd('0x30')],qs[_0x26dd('0x37')](_0x3a49b0['query'][_0x26dd('0x37')]));_0x358509[_0x26dd('0x36')]=_0x358509[_0x26dd('0x36')][_0x26dd('0x38')]?_0x358509[_0x26dd('0x36')]:_0x569b9e[_0x26dd('0x30')];if(_0x3a49b0[_0x26dd('0x33')]['includeAll']){_0x358509[_0x26dd('0x49')]=[{'all':!![]}];}_0x358509=_[_0x26dd('0x3f')]({},_0x358509,_0x3a49b0['options']);return db['CmCustomField']['find'](_0x358509)['then'](handleEntityNotFound(_0x3656c7,null))[_0x26dd('0x25')](respondWithResult(_0x3656c7,null))[_0x26dd('0x46')](handleError(_0x3656c7,null));};exports[_0x26dd('0x23')]=function(_0x1bc2d4,_0x3dfd17){if(_0x1bc2d4[_0x26dd('0x4a')]['id']){delete _0x1bc2d4[_0x26dd('0x4a')]['id'];}return db[_0x26dd('0x42')][_0x26dd('0x4b')]({'where':{'id':_0x1bc2d4[_0x26dd('0x48')]['id']}})[_0x26dd('0x25')](handleEntityNotFound(_0x3dfd17,null))[_0x26dd('0x25')](saveUpdates(_0x1bc2d4[_0x26dd('0x4a')],null))[_0x26dd('0x25')](respondWithResult(_0x3dfd17,null))[_0x26dd('0x46')](handleError(_0x3dfd17,null));};exports[_0x26dd('0x24')]=function(_0x5b200b,_0x39b2ec){return db[_0x26dd('0x42')][_0x26dd('0x4b')]({'where':{'id':_0x5b200b[_0x26dd('0x48')]['id']}})[_0x26dd('0x25')](handleEntityNotFound(_0x39b2ec,null))['then'](removeEntity(_0x39b2ec,null))[_0x26dd('0x46')](handleError(_0x39b2ec,null));};exports[_0x26dd('0x4c')]=function(_0x48b8b2,_0x20fc93){var _0x60fbfd;return db[_0x26dd('0x4d')][_0x26dd('0x4e')](function(_0x2baedf){return db[_0x26dd('0x42')]['create'](_0x48b8b2[_0x26dd('0x4a')],{'transaction':_0x2baedf})[_0x26dd('0x25')](function(_0x4784fa){_0x60fbfd=_0x4784fa;var _0x42ba1f={'type':db[_0x26dd('0x4f')][_0x26dd('0x50')],'transaction':_0x2baedf};switch(_0x48b8b2[_0x26dd('0x4a')]['type']){case _0x26dd('0x51'):_0x42ba1f[_0x26dd('0x2e')]=db[_0x26dd('0x4f')]['TEXT'];break;case _0x26dd('0x52'):_0x42ba1f[_0x26dd('0x2e')]=db['Sequelize'][_0x26dd('0x53')];break;case _0x26dd('0x54'):_0x42ba1f[_0x26dd('0x2e')]=db['Sequelize'][_0x26dd('0x55')];_0x42ba1f['defaultValue']=![];break;default:}return db[_0x26dd('0x4d')][_0x26dd('0x56')][_0x26dd('0x57')](_0x26dd('0x58'),util[_0x26dd('0x59')](_0x26dd('0x5a'),_0x60fbfd['id']),_0x42ba1f);})['then'](function(){return _0x60fbfd;});})[_0x26dd('0x25')](respondWithResult(_0x20fc93,0xc9))[_0x26dd('0x46')](handleError(_0x20fc93,null));};
\ No newline at end of file
diff --git a/server/api/cmCustomField/cmCustomField.model.js b/server/api/cmCustomField/cmCustomField.model.js
index a22fd9a..c873dae 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 _0x9550=['moment','bluebird','request-promise','path','rimraf','../../config/environment','./cmCustomField.attributes','exports','CmCustomField','util','../../config/logger'];(function(_0xb62452,_0x5edd99){var _0x2a9dc9=function(_0x2e61a5){while(--_0x2e61a5){_0xb62452['push'](_0xb62452['shift']());}};_0x2a9dc9(++_0x5edd99);}(_0x9550,0x1cc));var _0x0955=function(_0x4e50b6,_0x4a1013){_0x4e50b6=_0x4e50b6-0x0;var _0x508000=_0x9550[_0x4e50b6];return _0x508000;};'use strict';var _=require('lodash');var util=require(_0x0955('0x0'));var logger=require(_0x0955('0x1'))('api');var moment=require(_0x0955('0x2'));var BPromise=require(_0x0955('0x3'));var rp=require(_0x0955('0x4'));var fs=require('fs');var path=require(_0x0955('0x5'));var rimraf=require(_0x0955('0x6'));var config=require(_0x0955('0x7'));var attributes=require(_0x0955('0x8'));module[_0x0955('0x9')]=function(_0x1c7a1e,_0x2c86a5){return _0x1c7a1e['define'](_0x0955('0xa'),attributes,{'tableName':'cm_custom_fields','paranoid':!![],'indexes':[],'timestamps':!![]});};
\ No newline at end of file
+var _0x47fa=['moment','bluebird','path','rimraf','./cmCustomField.attributes','exports','define','CmCustomField','cm_custom_fields','lodash','util','../../config/logger','api'];(function(_0x1795f8,_0x27fe71){var _0x3bed40=function(_0x1b7ed2){while(--_0x1b7ed2){_0x1795f8['push'](_0x1795f8['shift']());}};_0x3bed40(++_0x27fe71);}(_0x47fa,0xb2));var _0xa47f=function(_0x5b697a,_0x280202){_0x5b697a=_0x5b697a-0x0;var _0x5de43b=_0x47fa[_0x5b697a];return _0x5de43b;};'use strict';var _=require(_0xa47f('0x0'));var util=require(_0xa47f('0x1'));var logger=require(_0xa47f('0x2'))(_0xa47f('0x3'));var moment=require(_0xa47f('0x4'));var BPromise=require(_0xa47f('0x5'));var rp=require('request-promise');var fs=require('fs');var path=require(_0xa47f('0x6'));var rimraf=require(_0xa47f('0x7'));var config=require('../../config/environment');var attributes=require(_0xa47f('0x8'));module[_0xa47f('0x9')]=function(_0x53e598,_0x78ef69){return _0x53e598[_0xa47f('0xa')](_0xa47f('0xb'),attributes,{'tableName':_0xa47f('0xc'),'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 90afac5..4006b50 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 _0x9b67=['code','message','CmCustomField,\x20%s,\x20%s','catch','lodash','util','moment','bluebird','randomstring','../../mysqldb','../../config/utils','../../config/environment','jayson/promise','client','http','request','then','info','request\x20sent','debug','CmCustomField,\x20%s,\x20%s,\x20%s','error'];(function(_0x4bc7ea,_0x5e3b49){var _0x5a2f25=function(_0xd08366){while(--_0xd08366){_0x4bc7ea['push'](_0x4bc7ea['shift']());}};_0x5a2f25(++_0x5e3b49);}(_0x9b67,0xf6));var _0x79b6=function(_0x2f6814,_0x3c7ff7){_0x2f6814=_0x2f6814-0x0;var _0x1e757b=_0x9b67[_0x2f6814];return _0x1e757b;};'use strict';var _=require(_0x79b6('0x0'));var util=require(_0x79b6('0x1'));var moment=require(_0x79b6('0x2'));var BPromise=require(_0x79b6('0x3'));var rs=require(_0x79b6('0x4'));var fs=require('fs');var Redis=require('ioredis');var db=require(_0x79b6('0x5'))['db'];var utils=require(_0x79b6('0x6'));var logger=require('../../config/logger')('rpc');var config=require(_0x79b6('0x7'));var jayson=require(_0x79b6('0x8'));var client=jayson[_0x79b6('0x9')][_0x79b6('0xa')]({'port':0x232a});function respondWithRpcPromise(_0xfa6a05,_0x128543,_0x34adbe){return new BPromise(function(_0x58ae2d,_0x1270a7){return client[_0x79b6('0xb')](_0xfa6a05,_0x34adbe)[_0x79b6('0xc')](function(_0x3d28cd){logger[_0x79b6('0xd')]('CmCustomField,\x20%s,\x20%s',_0x128543,_0x79b6('0xe'));logger[_0x79b6('0xf')](_0x79b6('0x10'),_0x128543,_0x79b6('0xe'),JSON['stringify'](_0x3d28cd));if(_0x3d28cd['error']){if(_0x3d28cd[_0x79b6('0x11')][_0x79b6('0x12')]===0x1f4){logger[_0x79b6('0x11')]('CmCustomField,\x20%s,\x20%s',_0x128543,_0x3d28cd[_0x79b6('0x11')][_0x79b6('0x13')]);return _0x1270a7(_0x3d28cd[_0x79b6('0x11')][_0x79b6('0x13')]);}logger[_0x79b6('0x11')](_0x79b6('0x14'),_0x128543,_0x3d28cd[_0x79b6('0x11')][_0x79b6('0x13')]);return _0x58ae2d(_0x3d28cd[_0x79b6('0x11')][_0x79b6('0x13')]);}else{logger[_0x79b6('0xd')](_0x79b6('0x14'),_0x128543,_0x79b6('0xe'));_0x58ae2d(_0x3d28cd['result'][_0x79b6('0x13')]);}})[_0x79b6('0x15')](function(_0xc36fd3){logger[_0x79b6('0x11')](_0x79b6('0x14'),_0x128543,_0xc36fd3);_0x1270a7(_0xc36fd3);});});}
\ No newline at end of file
+var _0xed1f=['request','then','info','CmCustomField,\x20%s,\x20%s','debug','request\x20sent','stringify','code','error','message','lodash','util','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','client','http'];(function(_0x51198c,_0x123a72){var _0x59e4e3=function(_0x388147){while(--_0x388147){_0x51198c['push'](_0x51198c['shift']());}};_0x59e4e3(++_0x123a72);}(_0xed1f,0x6a));var _0xfed1=function(_0x3fba9f,_0x3b7b9b){_0x3fba9f=_0x3fba9f-0x0;var _0x192cf1=_0xed1f[_0x3fba9f];return _0x192cf1;};'use strict';var _=require(_0xfed1('0x0'));var util=require(_0xfed1('0x1'));var moment=require(_0xfed1('0x2'));var BPromise=require(_0xfed1('0x3'));var rs=require(_0xfed1('0x4'));var fs=require('fs');var Redis=require(_0xfed1('0x5'));var db=require(_0xfed1('0x6'))['db'];var utils=require(_0xfed1('0x7'));var logger=require(_0xfed1('0x8'))(_0xfed1('0x9'));var config=require(_0xfed1('0xa'));var jayson=require(_0xfed1('0xb'));var client=jayson[_0xfed1('0xc')][_0xfed1('0xd')]({'port':0x232a});function respondWithRpcPromise(_0x380e18,_0x612b38,_0x2a6082){return new BPromise(function(_0x2967ef,_0x568d48){return client[_0xfed1('0xe')](_0x380e18,_0x2a6082)[_0xfed1('0xf')](function(_0x48862d){logger[_0xfed1('0x10')](_0xfed1('0x11'),_0x612b38,'request\x20sent');logger[_0xfed1('0x12')]('CmCustomField,\x20%s,\x20%s,\x20%s',_0x612b38,_0xfed1('0x13'),JSON[_0xfed1('0x14')](_0x48862d));if(_0x48862d['error']){if(_0x48862d['error'][_0xfed1('0x15')]===0x1f4){logger[_0xfed1('0x16')]('CmCustomField,\x20%s,\x20%s',_0x612b38,_0x48862d[_0xfed1('0x16')]['message']);return _0x568d48(_0x48862d['error'][_0xfed1('0x17')]);}logger[_0xfed1('0x16')]('CmCustomField,\x20%s,\x20%s',_0x612b38,_0x48862d[_0xfed1('0x16')]['message']);return _0x2967ef(_0x48862d['error'][_0xfed1('0x17')]);}else{logger[_0xfed1('0x10')](_0xfed1('0x11'),_0x612b38,_0xfed1('0x13'));_0x2967ef(_0x48862d['result'][_0xfed1('0x17')]);}})['catch'](function(_0x36ff34){logger[_0xfed1('0x16')]('CmCustomField,\x20%s,\x20%s',_0x612b38,_0x36ff34);_0x568d48(_0x36ff34);});});}
\ No newline at end of file
diff --git a/server/api/cmCustomField/index.js b/server/api/cmCustomField/index.js
index c0aec19..e5a36de 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 _0x5ed0=['path','connect-timeout','express','Router','../../components/auth/service','../../components/interaction/service','../../config/environment','get','/:id','isAuthenticated','show','post','create','delete','destroy','exports','util'];(function(_0xf229a4,_0x393940){var _0x4125a9=function(_0x7140b9){while(--_0x7140b9){_0xf229a4['push'](_0xf229a4['shift']());}};_0x4125a9(++_0x393940);}(_0x5ed0,0xcb));var _0x05ed=function(_0x3b517c,_0x533b4e){_0x3b517c=_0x3b517c-0x0;var _0x5cc760=_0x5ed0[_0x3b517c];return _0x5cc760;};'use strict';var multer=require('multer');var util=require(_0x05ed('0x0'));var path=require(_0x05ed('0x1'));var timeout=require(_0x05ed('0x2'));var express=require(_0x05ed('0x3'));var router=express[_0x05ed('0x4')]();var auth=require(_0x05ed('0x5'));var interaction=require(_0x05ed('0x6'));var config=require(_0x05ed('0x7'));var controller=require('./cmCustomField.controller');router[_0x05ed('0x8')]('/',auth['isAuthenticated'](),controller['index']);router[_0x05ed('0x8')](_0x05ed('0x9'),auth[_0x05ed('0xa')](),controller[_0x05ed('0xb')]);router[_0x05ed('0xc')]('/',auth['isAuthenticated'](),controller[_0x05ed('0xd')]);router['put'](_0x05ed('0x9'),auth[_0x05ed('0xa')](),controller['update']);router[_0x05ed('0xe')](_0x05ed('0x9'),auth['isAuthenticated'](),controller[_0x05ed('0xf')]);module[_0x05ed('0x10')]=router;
\ No newline at end of file
+var _0x2fd0=['Router','../../components/auth/service','./cmCustomField.controller','isAuthenticated','index','get','show','post','put','/:id','update','delete','exports','multer','util','path','connect-timeout','express'];(function(_0xf91841,_0x182ae3){var _0x4b9c44=function(_0x2e216e){while(--_0x2e216e){_0xf91841['push'](_0xf91841['shift']());}};_0x4b9c44(++_0x182ae3);}(_0x2fd0,0x1e1));var _0x02fd=function(_0x7132d2,_0x38ca71){_0x7132d2=_0x7132d2-0x0;var _0x1f2920=_0x2fd0[_0x7132d2];return _0x1f2920;};'use strict';var multer=require(_0x02fd('0x0'));var util=require(_0x02fd('0x1'));var path=require(_0x02fd('0x2'));var timeout=require(_0x02fd('0x3'));var express=require(_0x02fd('0x4'));var router=express[_0x02fd('0x5')]();var auth=require(_0x02fd('0x6'));var interaction=require('../../components/interaction/service');var config=require('../../config/environment');var controller=require(_0x02fd('0x7'));router['get']('/',auth[_0x02fd('0x8')](),controller[_0x02fd('0x9')]);router[_0x02fd('0xa')]('/:id',auth[_0x02fd('0x8')](),controller[_0x02fd('0xb')]);router[_0x02fd('0xc')]('/',auth[_0x02fd('0x8')](),controller['create']);router[_0x02fd('0xd')](_0x02fd('0xe'),auth[_0x02fd('0x8')](),controller[_0x02fd('0xf')]);router[_0x02fd('0x10')](_0x02fd('0xe'),auth[_0x02fd('0x8')](),controller['destroy']);module[_0x02fd('0x11')]=router;
\ No newline at end of file
diff --git a/server/api/cmHopper/cmHopper.attributes.js b/server/api/cmHopper/cmHopper.attributes.js
index d1c2683..7a986b7 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 _0xc7a3=['sequelize','exports','STRING','BOOLEAN','DATE','format','INTEGER','UNSIGNED','contactListQueue'];(function(_0x2ec461,_0x5f588a){var _0x28603d=function(_0x21114b){while(--_0x21114b){_0x2ec461['push'](_0x2ec461['shift']());}};_0x28603d(++_0x5f588a);}(_0xc7a3,0xbd));var _0x3c7a=function(_0x2070ed,_0x39919b){_0x2070ed=_0x2070ed-0x0;var _0x36f34d=_0xc7a3[_0x2070ed];return _0x36f34d;};'use strict';var moment=require('moment');var Sequelize=require(_0x3c7a('0x0'));module[_0x3c7a('0x1')]={'phone':{'type':Sequelize[_0x3c7a('0x2')],'allowNull':![]},'active':{'type':Sequelize[_0x3c7a('0x3')],'defaultValue':![]},'scheduledat':{'type':Sequelize[_0x3c7a('0x4')],'defaultValue':moment()[_0x3c7a('0x5')]('YYYY-MM-DD\x20HH:mm:ss')},'countbusyretry':{'type':Sequelize[_0x3c7a('0x6')],'defaultValue':0x0},'countcongestionretry':{'type':Sequelize[_0x3c7a('0x6')],'defaultValue':0x0},'countnoanswerretry':{'type':Sequelize['INTEGER'],'defaultValue':0x0},'callback':{'type':Sequelize[_0x3c7a('0x3')],'defaultValue':![]},'callbackuniqueid':{'type':Sequelize[_0x3c7a('0x2')],'defaultValue':null},'callbackat':{'type':Sequelize[_0x3c7a('0x4')]},'priority':{'type':Sequelize['INTEGER'](0x2)[_0x3c7a('0x7')],'defaultValue':0x2,'validate':{'min':0x0,'max':0x4}},'recallme':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'ContactId':{'type':Sequelize[_0x3c7a('0x6')],'unique':'contactListQueue'},'ListId':{'type':Sequelize[_0x3c7a('0x6')],'unique':_0x3c7a('0x8')},'UserId':{'type':Sequelize[_0x3c7a('0x6')]},'VoiceQueueId':{'type':Sequelize['INTEGER'],'unique':_0x3c7a('0x8')},'CampaignId':{'type':Sequelize[_0x3c7a('0x6')]},'countnosuchnumberretry':{'type':Sequelize['INTEGER'],'defaultValue':0x0},'countdropretry':{'type':Sequelize[_0x3c7a('0x6')],'defaultValue':0x0},'countabandonedretry':{'type':Sequelize['INTEGER'],'defaultValue':0x0},'countmachineretry':{'type':Sequelize[_0x3c7a('0x6')],'defaultValue':0x0},'countagentrejectretry':{'type':Sequelize['INTEGER'],'defaultValue':0x0}};
\ No newline at end of file
+var _0x44e8=['STRING','BOOLEAN','DATE','format','INTEGER','UNSIGNED','contactListQueue','moment'];(function(_0x1000e3,_0x3fd3f2){var _0xda3798=function(_0x8c2b32){while(--_0x8c2b32){_0x1000e3['push'](_0x1000e3['shift']());}};_0xda3798(++_0x3fd3f2);}(_0x44e8,0xd7));var _0x844e=function(_0x21e741,_0x2f2eef){_0x21e741=_0x21e741-0x0;var _0x26749d=_0x44e8[_0x21e741];return _0x26749d;};'use strict';var moment=require(_0x844e('0x0'));var Sequelize=require('sequelize');module['exports']={'phone':{'type':Sequelize[_0x844e('0x1')],'allowNull':![]},'active':{'type':Sequelize[_0x844e('0x2')],'defaultValue':![]},'scheduledat':{'type':Sequelize[_0x844e('0x3')],'defaultValue':moment()[_0x844e('0x4')]('YYYY-MM-DD\x20HH:mm:ss')},'countbusyretry':{'type':Sequelize[_0x844e('0x5')],'defaultValue':0x0},'countcongestionretry':{'type':Sequelize[_0x844e('0x5')],'defaultValue':0x0},'countnoanswerretry':{'type':Sequelize[_0x844e('0x5')],'defaultValue':0x0},'callback':{'type':Sequelize[_0x844e('0x2')],'defaultValue':![]},'callbackuniqueid':{'type':Sequelize['STRING'],'defaultValue':null},'callbackat':{'type':Sequelize[_0x844e('0x3')]},'priority':{'type':Sequelize[_0x844e('0x5')](0x2)[_0x844e('0x6')],'defaultValue':0x2,'validate':{'min':0x0,'max':0x4}},'recallme':{'type':Sequelize[_0x844e('0x2')],'defaultValue':![]},'ContactId':{'type':Sequelize['INTEGER'],'unique':_0x844e('0x7')},'ListId':{'type':Sequelize[_0x844e('0x5')],'unique':_0x844e('0x7')},'UserId':{'type':Sequelize[_0x844e('0x5')]},'VoiceQueueId':{'type':Sequelize[_0x844e('0x5')],'unique':_0x844e('0x7')},'CampaignId':{'type':Sequelize['INTEGER']},'countnosuchnumberretry':{'type':Sequelize[_0x844e('0x5')],'defaultValue':0x0},'countdropretry':{'type':Sequelize[_0x844e('0x5')],'defaultValue':0x0},'countabandonedretry':{'type':Sequelize[_0x844e('0x5')],'defaultValue':0x0},'countmachineretry':{'type':Sequelize[_0x844e('0x5')],'defaultValue':0x0},'countagentrejectretry':{'type':Sequelize[_0x844e('0x5')],'defaultValue':0x0}};
\ No newline at end of file
diff --git a/server/api/cmHopper/cmHopper.controller.js b/server/api/cmHopper/cmHopper.controller.js
index 28951dc..0c3bcb1 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 _0x45f6=['sendStatus','error','name','send','index','map','fieldName','type','key','model','keys','filters','intersection','query','concat','$and','$or','$gt','$gte','$lt','$lte','$ne','$not','$between','$notBetween','$in','$notIn','$like','$notLike','$notILike','$contained','$any','attributes','fields','hasOwnProperty','nolimit','limit','sort','where','filter','merge','options','CmHopper','includeAll','include','findAll','rows','show','params','length','catch','create','body','find','describe','destroy','VoiceQueueId','CampaignId','dataValues','createdAt','updatedAt','state','statedesc','deleted','user','UserId','format','YYYY-MM-DD\x20HH:mm:ss','calleridnum','phone','campaigntype','queue','ivr','CmContact','ContactId','firstName','lastName','isNil','calleridname','finally','getPreview','getVoiceQueues','outbound','preview','transaction','direction','hopperIds','priority','scheduledAt','dialOrderByScheduledAt','ASC','sequelize','literal','COALESCE(CmHopper.UserId,\x200)\x20ASC','DESC','isEmpty','findOne','scheduledat','LOCK','UPDATE','Contact','CmCompany','Company','CmList','List','VoiceQueue','Queue','dialActive','getOpenContacts','isNumber','CmHopper,\x20%s,\x20%s,\x20%s','entity\x20not\x20found','zip-dir','moment','mustache','util','path','ejs','lodash','squel','crypto','jsforce','to-csv','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/logger','../../mysqldb','status','end','json','count','offset','set','apply','reject','save','update','then'];(function(_0x456052,_0x40f130){var _0x131a86=function(_0x41f77e){while(--_0x41f77e){_0x456052['push'](_0x456052['shift']());}};_0x131a86(++_0x40f130);}(_0x45f6,0xfd));var _0x645f=function(_0x47e549,_0x2e53d6){_0x47e549=_0x47e549-0x0;var _0x251374=_0x45f6[_0x47e549];return _0x251374;};'use strict';var pdf=require('html-pdf');var emlformat=require('eml-format');var rimraf=require('rimraf');var zipdir=require(_0x645f('0x0'));var jsonpatch=require('fast-json-patch');var rp=require('request-promise');var moment=require(_0x645f('0x1'));var BPromise=require('bluebird');var Mustache=require(_0x645f('0x2'));var util=require(_0x645f('0x3'));var path=require(_0x645f('0x4'));var sox=require('sox');var csv=require('to-csv');var ejs=require(_0x645f('0x5'));var fs=require('fs');var _=require(_0x645f('0x6'));var squel=require(_0x645f('0x7'));var crypto=require(_0x645f('0x8'));var jsforce=require(_0x645f('0x9'));var deskjs=require('desk.js');var toCsv=require(_0x645f('0xa'));var querystring=require('querystring');var Papa=require(_0x645f('0xb'));var Redis=require(_0x645f('0xc'));var authService=require(_0x645f('0xd'));var qs=require(_0x645f('0xe'));var as=require(_0x645f('0xf'));var hardwareService=require('../../config/license/hardware');var logger=require(_0x645f('0x10'))('api');var utils=require('../../config/utils');var config=require('../../config/environment');var db=require(_0x645f('0x11'))['db'];function respondWithStatusCode(_0x3ad692,_0x3cf033){_0x3cf033=_0x3cf033||0xcc;return function(_0x4fb700){if(_0x4fb700){return _0x3ad692['sendStatus'](_0x3cf033);}return _0x3ad692[_0x645f('0x12')](_0x3cf033)[_0x645f('0x13')]();};}function respondWithResult(_0x56d067,_0x2cf6f7){_0x2cf6f7=_0x2cf6f7||0xc8;return function(_0x1b74ab){if(_0x1b74ab){return _0x56d067[_0x645f('0x12')](_0x2cf6f7)[_0x645f('0x14')](_0x1b74ab);}};}function respondWithFilteredResult(_0x24d961,_0x2c8e34){return function(_0x442043){if(_0x442043){var _0x3c16c4=_0x442043[_0x645f('0x15')],_0xf64172=_0x2c8e34[_0x645f('0x16')],_0x5a14c1=_0x2c8e34['offset']+_0x2c8e34['limit'],_0x2591c0;if(_0x5a14c1>=_0x3c16c4){_0x5a14c1=_0x3c16c4;_0x2591c0=0xc8;}else{_0x2591c0=0xce;}_0x24d961[_0x645f('0x12')](_0x2591c0);return _0x24d961[_0x645f('0x17')]('Content-Range',_0xf64172+'-'+_0x5a14c1+'/'+_0x3c16c4)[_0x645f('0x14')](_0x442043);}return null;};}function patchUpdates(_0x1533cd){return function(_0x3507e1){try{jsonpatch[_0x645f('0x18')](_0x3507e1,_0x1533cd,!![]);}catch(_0x3cb347){return BPromise[_0x645f('0x19')](_0x3cb347);}return _0x3507e1[_0x645f('0x1a')]();};}function saveUpdates(_0x159a43,_0x1e374c){return function(_0x1cb786){if(_0x1cb786){return _0x1cb786[_0x645f('0x1b')](_0x159a43)[_0x645f('0x1c')](function(_0x1c49a0){return _0x1c49a0;});}return null;};}function removeEntity(_0x3d6c67,_0x3d6a3c){return function(_0x59a695){if(_0x59a695){return _0x59a695['destroy']()[_0x645f('0x1c')](function(){_0x3d6c67[_0x645f('0x12')](0xcc)['end']();});}};}function handleEntityNotFound(_0x1657a8,_0x47984f){return function(_0x4c0f73){if(!_0x4c0f73){_0x1657a8[_0x645f('0x1d')](0x194);}return _0x4c0f73;};}function handleError(_0x43baa8,_0x13bf82){_0x13bf82=_0x13bf82||0x1f4;return function(_0x1e3590){logger[_0x645f('0x1e')](_0x1e3590['stack']);if(_0x1e3590[_0x645f('0x1f')]){delete _0x1e3590[_0x645f('0x1f')];}_0x43baa8[_0x645f('0x12')](_0x13bf82)[_0x645f('0x20')](_0x1e3590);};}exports[_0x645f('0x21')]=function(_0x58b820,_0x1d7cf1){var _0x3ae1a5={},_0x35554e={},_0xb08e8={'count':0x0,'rows':[]};var _0x5e8755=_[_0x645f('0x22')](db['CmHopper']['rawAttributes'],function(_0x18339c){return{'name':_0x18339c[_0x645f('0x23')],'type':_0x18339c[_0x645f('0x24')][_0x645f('0x25')]};});_0x35554e[_0x645f('0x26')]=_[_0x645f('0x22')](_0x5e8755,_0x645f('0x1f'));_0x35554e['query']=_[_0x645f('0x27')](_0x58b820['query']);_0x35554e[_0x645f('0x28')]=_[_0x645f('0x29')](_0x35554e[_0x645f('0x26')],_0x35554e[_0x645f('0x2a')]);_0x35554e[_0x645f('0x28')]=_[_0x645f('0x2b')](_0x35554e[_0x645f('0x28')],[_0x645f('0x2c'),_0x645f('0x2d'),_0x645f('0x2e'),_0x645f('0x2f'),_0x645f('0x30'),_0x645f('0x31'),_0x645f('0x32'),'$eq',_0x645f('0x33'),_0x645f('0x34'),_0x645f('0x35'),_0x645f('0x36'),_0x645f('0x37'),_0x645f('0x38'),_0x645f('0x39'),'$iLike',_0x645f('0x3a'),_0x645f('0x38'),'$overlap','$contains',_0x645f('0x3b'),_0x645f('0x3c')]);_0x3ae1a5[_0x645f('0x3d')]=_[_0x645f('0x29')](_0x35554e['model'],qs[_0x645f('0x3e')](_0x58b820[_0x645f('0x2a')][_0x645f('0x3e')]));_0x3ae1a5['attributes']=_0x3ae1a5['attributes']['length']?_0x3ae1a5['attributes']:_0x35554e[_0x645f('0x26')];if(!_0x58b820[_0x645f('0x2a')][_0x645f('0x3f')](_0x645f('0x40'))){_0x3ae1a5[_0x645f('0x41')]=qs[_0x645f('0x41')](_0x58b820['query'][_0x645f('0x41')]);_0x3ae1a5['offset']=qs[_0x645f('0x16')](_0x58b820[_0x645f('0x2a')][_0x645f('0x16')]);}_0x3ae1a5['order']=qs[_0x645f('0x42')](_0x58b820[_0x645f('0x2a')][_0x645f('0x42')]);_0x3ae1a5[_0x645f('0x43')]=qs[_0x645f('0x28')](_['pick'](_0x58b820[_0x645f('0x2a')],_0x35554e[_0x645f('0x28')]));if(_0x58b820[_0x645f('0x2a')][_0x645f('0x44')]){_0x3ae1a5[_0x645f('0x43')]=_[_0x645f('0x45')](_0x3ae1a5[_0x645f('0x43')],{'$or':_[_0x645f('0x22')](_0x5e8755,function(_0x5467f8){if(_0x5467f8[_0x645f('0x24')]!=='VIRTUAL'){var _0x3a3f02={};_0x3a3f02[_0x5467f8[_0x645f('0x1f')]]={'$like':'%'+_0x58b820[_0x645f('0x2a')][_0x645f('0x44')]+'%'};return _0x3a3f02;}})});}_0x3ae1a5=_[_0x645f('0x45')]({},_0x3ae1a5,_0x58b820[_0x645f('0x46')]);var _0x21abb2={'where':_0x3ae1a5[_0x645f('0x43')]};return db[_0x645f('0x47')]['count'](_0x21abb2)[_0x645f('0x1c')](function(_0x43b994){_0xb08e8[_0x645f('0x15')]=_0x43b994;if(_0x58b820[_0x645f('0x2a')][_0x645f('0x48')]){_0x3ae1a5[_0x645f('0x49')]=[{'all':!![]}];}return db['CmHopper'][_0x645f('0x4a')](_0x3ae1a5);})[_0x645f('0x1c')](function(_0x2892f2){_0xb08e8[_0x645f('0x4b')]=_0x2892f2;return _0xb08e8;})[_0x645f('0x1c')](respondWithFilteredResult(_0x1d7cf1,_0x3ae1a5))['catch'](handleError(_0x1d7cf1,null));};exports[_0x645f('0x4c')]=function(_0x9da852,_0xcaafdf){var _0xcdc5b1={'raw':!![],'where':{'id':_0x9da852[_0x645f('0x4d')]['id']}},_0x420ea4={};_0x420ea4[_0x645f('0x26')]=_[_0x645f('0x27')](db[_0x645f('0x47')]['rawAttributes']);_0x420ea4[_0x645f('0x2a')]=_[_0x645f('0x27')](_0x9da852[_0x645f('0x2a')]);_0x420ea4[_0x645f('0x28')]=_['intersection'](_0x420ea4[_0x645f('0x26')],_0x420ea4[_0x645f('0x2a')]);_0xcdc5b1['attributes']=_[_0x645f('0x29')](_0x420ea4['model'],qs[_0x645f('0x3e')](_0x9da852['query'][_0x645f('0x3e')]));_0xcdc5b1['attributes']=_0xcdc5b1['attributes'][_0x645f('0x4e')]?_0xcdc5b1['attributes']:_0x420ea4[_0x645f('0x26')];if(_0x9da852[_0x645f('0x2a')][_0x645f('0x48')]){_0xcdc5b1[_0x645f('0x49')]=[{'all':!![]}];}_0xcdc5b1=_['merge']({},_0xcdc5b1,_0x9da852['options']);return db[_0x645f('0x47')]['find'](_0xcdc5b1)[_0x645f('0x1c')](handleEntityNotFound(_0xcaafdf,null))[_0x645f('0x1c')](respondWithResult(_0xcaafdf,null))[_0x645f('0x4f')](handleError(_0xcaafdf,null));};exports['create']=function(_0x3b8e97,_0x4d1373){return db['CmHopper'][_0x645f('0x50')](_0x3b8e97[_0x645f('0x51')],{})['then'](respondWithResult(_0x4d1373,0xc9))[_0x645f('0x4f')](handleError(_0x4d1373,null));};exports['update']=function(_0x3ac532,_0x5b9b6e){if(_0x3ac532[_0x645f('0x51')]['id']){delete _0x3ac532['body']['id'];}return db[_0x645f('0x47')][_0x645f('0x52')]({'where':{'id':_0x3ac532[_0x645f('0x4d')]['id']}})[_0x645f('0x1c')](handleEntityNotFound(_0x5b9b6e,null))['then'](saveUpdates(_0x3ac532[_0x645f('0x51')],null))[_0x645f('0x1c')](respondWithResult(_0x5b9b6e,null))['catch'](handleError(_0x5b9b6e,null));};exports[_0x645f('0x53')]=function(_0x423a8b,_0xe0b78f){return db[_0x645f('0x47')][_0x645f('0x53')]()['then'](respondWithResult(_0xe0b78f,null))[_0x645f('0x4f')](handleError(_0xe0b78f,null));};exports[_0x645f('0x54')]=function(_0x11bed3,_0x4cedd6){var _0x263d25;return db[_0x645f('0x47')][_0x645f('0x52')]({'where':{'id':_0x11bed3[_0x645f('0x4d')]['id']}})[_0x645f('0x1c')](handleEntityNotFound(_0x4cedd6,null))[_0x645f('0x1c')](function(_0x2d01b8){if(_0x2d01b8){return _0x2d01b8[_0x645f('0x54')]()[_0x645f('0x1c')](function(_0x4e014f){return _0x4e014f;});}})[_0x645f('0x1c')](function(_0x2f126a){_0x263d25=_0x2f126a;if(_0x2f126a){if(_0x2f126a[_0x645f('0x55')]||_0x2f126a[_0x645f('0x56')]){return db[_0x2f126a['VoiceQueueId']?'VoiceQueue':'Campaign'][_0x645f('0x52')]({'where':{'id':_0x2f126a[_0x645f('0x55')]?_0x2f126a[_0x645f('0x55')]:_0x2f126a[_0x645f('0x56')]},'attributes':['id',_0x645f('0x1f')],'raw':!![]});}}})[_0x645f('0x1c')](function(_0x1b9b75){var _0x153296={};if(_0x1b9b75){_['merge'](_0x153296,_['omit'](_0x263d25[_0x645f('0x57')],[_0x645f('0x58'),_0x645f('0x59'),'id']));_0x153296[_0x645f('0x5a')]=0x15;_0x153296[_0x645f('0x5b')]=_0x645f('0x5c');_0x153296['campaign']=_0x1b9b75[_0x645f('0x1f')];_0x153296['membername']=_0x11bed3[_0x645f('0x5d')][_0x645f('0x1f')];_0x153296[_0x645f('0x5e')]=_0x11bed3[_0x645f('0x5d')]['id'];_0x153296['deleted']=!![];_0x153296['deletedat']=moment()[_0x645f('0x5f')](_0x645f('0x60'));_0x153296[_0x645f('0x61')]=_0x263d25[_0x645f('0x62')];_0x153296[_0x645f('0x63')]=_0x263d25[_0x645f('0x55')]?_0x645f('0x64'):_0x645f('0x65');return db[_0x645f('0x66')][_0x645f('0x52')]({'where':{'id':_0x153296[_0x645f('0x67')]},'attributes':[_0x645f('0x68'),_0x645f('0x69')]})['then'](function(_0x1f59ee){if(!_[_0x645f('0x6a')](_0x4cedd6)&&!_['isNil'](_0x1f59ee[_0x645f('0x68')])){_0x153296['calleridname']=_0x1f59ee[_0x645f('0x68')];if(!_[_0x645f('0x6a')](_0x1f59ee[_0x645f('0x69')])){_0x153296[_0x645f('0x6b')]+='\x20'+_0x1f59ee['lastName'];}}})[_0x645f('0x6c')](function(){return db['CmHopperFinal'][_0x645f('0x50')](_0x153296);});}})[_0x645f('0x1c')](function(){return _0x4cedd6['status'](0xcc)[_0x645f('0x13')]();})['catch'](handleError(_0x4cedd6,null));};exports[_0x645f('0x6d')]=function(_0x3fbd25,_0x19bec2,_0x319e0c){var _0x5a4cfa=[];return db[_0x645f('0x66')][_0x645f('0x53')]()[_0x645f('0x1c')](function(_0x10457d){_0x5a4cfa=_[_0x645f('0x27')](_0x10457d);return _0x3fbd25[_0x645f('0x5d')][_0x645f('0x6e')]({'where':{'type':_0x645f('0x6f'),'dialActive':!![],'dialMethod':_0x645f('0x70')},'attributes':['id','dialOrderByScheduledAt'],'raw':!![]});})[_0x645f('0x1c')](function(_0x2696c5){if(_0x2696c5&&_0x2696c5['length']){return db['sequelize'][_0x645f('0x71')](function(_0xfb15b8){var _0x45a8f3={'active':![],'recallme':![],'scheduledAt':{'$lte':moment()[_0x645f('0x5f')](_0x645f('0x60'))},'VoiceQueueId':{'$in':_['map'](_0x2696c5,'id')},'$or':[{'UserId':null},{'UserId':_0x3fbd25[_0x645f('0x5d')]['id']}]};var _0x59a80f=[];if(_0x3fbd25[_0x645f('0x51')]['direction']&&_0x3fbd25[_0x645f('0x51')][_0x645f('0x72')]==='prev'){if(!_['isEmpty'](_0x3fbd25[_0x645f('0x51')]['hopperIds'])){_0x45a8f3['id']={'$in':_0x3fbd25[_0x645f('0x51')][_0x645f('0x73')]};}_0x59a80f=[[_0x645f('0x74'),'ASC'],[_0x645f('0x75'),_0x2696c5[0x0][_0x645f('0x76')]===_0x645f('0x77')?'DESC':_0x645f('0x77')],db[_0x645f('0x78')][_0x645f('0x79')](_0x645f('0x7a')),['id',_0x645f('0x7b')]];}else{if(!_[_0x645f('0x7c')](_0x3fbd25[_0x645f('0x51')][_0x645f('0x73')])){_0x45a8f3['id']={'$notIn':_0x3fbd25[_0x645f('0x51')][_0x645f('0x73')]};}_0x59a80f=[[_0x645f('0x74'),_0x645f('0x7b')],[_0x645f('0x75'),_0x2696c5[0x0][_0x645f('0x76')]],db[_0x645f('0x78')][_0x645f('0x79')]('COALESCE(CmHopper.UserId,\x200)\x20DESC'),['id','ASC']];}return db['CmHopper'][_0x645f('0x7d')]({'attributes':['id',_0x645f('0x7e')],'where':_0x45a8f3,'order':_0x59a80f,'transaction':_0xfb15b8,'lock':_0xfb15b8[_0x645f('0x7f')][_0x645f('0x80')],'include':[{'model':db[_0x645f('0x66')],'as':_0x645f('0x81'),'attributes':_0x5a4cfa,'include':[{'model':db[_0x645f('0x82')],'as':_0x645f('0x83'),'attributes':['id',_0x645f('0x1f')]}]},{'model':db[_0x645f('0x84')],'as':_0x645f('0x85'),'attributes':['id',_0x645f('0x1f')]},{'model':db[_0x645f('0x86')],'as':_0x645f('0x87'),'attributes':['id',_0x645f('0x1f'),_0x645f('0x88')]}]})[_0x645f('0x1c')](function(_0x449ad3){if(_0x449ad3){return _0x449ad3['update']({'UserId':_0x3fbd25['user']['id']},{'transaction':_0xfb15b8});}});});}})[_0x645f('0x1c')](handleEntityNotFound(_0x19bec2,null))[_0x645f('0x1c')](respondWithResult(_0x19bec2,null))[_0x645f('0x4f')](handleError(_0x19bec2,null));};exports[_0x645f('0x89')]=function(_0x3ed8ff,_0x3a413f,_0x146981){return _0x3ed8ff['user'][_0x645f('0x6e')]({'where':{'type':'outbound','dialActive':!![],'dialMethod':_0x645f('0x70')},'attributes':['id'],'raw':!![]})[_0x645f('0x1c')](function(_0x350896){if(_0x350896&&_0x350896[_0x645f('0x4e')]){return db[_0x645f('0x47')][_0x645f('0x15')]({'where':{'active':![],'recallme':![],'scheduledAt':{'$lte':moment()['format'](_0x645f('0x60'))},'VoiceQueueId':{'$in':_[_0x645f('0x22')](_0x350896,'id')},'$or':[{'UserId':null},{'UserId':_0x3ed8ff[_0x645f('0x5d')]['id']}]}});}return 0x0;})[_0x645f('0x1c')](function(_0x1e7518){if(!_[_0x645f('0x6a')](_0x1e7518)&&_[_0x645f('0x8a')](_0x1e7518)){return _0x3a413f[_0x645f('0x12')](0xc8)[_0x645f('0x14')]({'contacts':_0x1e7518});}else{logger[_0x645f('0x1e')](_0x645f('0x8b'),_0x645f('0x89'),0x194,_0x645f('0x8c'));_0x3a413f[_0x645f('0x1d')](0x194);}})[_0x645f('0x4f')](handleError(_0x3a413f,null));};
\ No newline at end of file
+var _0x16b6=['deleted','campaign','user','UserId','deletedat','format','calleridnum','phone','queue','ivr','CmContact','ContactId','firstName','lastName','isNil','calleridname','finally','getPreview','getVoiceQueues','outbound','dialOrderByScheduledAt','sequelize','YYYY-MM-DD\x20HH:mm:ss','direction','isEmpty','hopperIds','priority','ASC','scheduledAt','DESC','literal','COALESCE(CmHopper.UserId,\x200)\x20ASC','COALESCE(CmHopper.UserId,\x200)\x20DESC','scheduledat','LOCK','UPDATE','Contact','Company','List','Queue','dialActive','preview','isNumber','error','CmHopper,\x20%s,\x20%s,\x20%s','entity\x20not\x20found','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/parsers/qs','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/environment','../../mysqldb','sendStatus','status','end','json','count','offset','limit','set','Content-Range','apply','reject','save','then','destroy','stack','name','send','index','map','rawAttributes','fieldName','key','model','query','keys','filters','$and','$or','$gte','$lte','$ne','$eq','$not','$between','$notBetween','$in','$like','$notLike','$overlap','$contained','$any','attributes','intersection','fields','length','hasOwnProperty','nolimit','sort','where','pick','merge','type','filter','options','CmHopper','includeAll','include','findAll','rows','catch','params','find','create','body','update','describe','VoiceQueueId','VoiceQueue','Campaign','CampaignId','omit','createdAt','updatedAt','state'];(function(_0x462359,_0x4c074){var _0x12bc47=function(_0x3be31e){while(--_0x3be31e){_0x462359['push'](_0x462359['shift']());}};_0x12bc47(++_0x4c074);}(_0x16b6,0x150));var _0x616b=function(_0x4c62a9,_0x50613e){_0x4c62a9=_0x4c62a9-0x0;var _0x5e5524=_0x16b6[_0x4c62a9];return _0x5e5524;};'use strict';var pdf=require('html-pdf');var emlformat=require('eml-format');var rimraf=require(_0x616b('0x0'));var zipdir=require(_0x616b('0x1'));var jsonpatch=require(_0x616b('0x2'));var rp=require(_0x616b('0x3'));var moment=require('moment');var BPromise=require(_0x616b('0x4'));var Mustache=require(_0x616b('0x5'));var util=require(_0x616b('0x6'));var path=require(_0x616b('0x7'));var sox=require(_0x616b('0x8'));var csv=require(_0x616b('0x9'));var ejs=require(_0x616b('0xa'));var fs=require('fs');var _=require('lodash');var squel=require(_0x616b('0xb'));var crypto=require(_0x616b('0xc'));var jsforce=require(_0x616b('0xd'));var deskjs=require(_0x616b('0xe'));var toCsv=require(_0x616b('0x9'));var querystring=require(_0x616b('0xf'));var Papa=require(_0x616b('0x10'));var Redis=require(_0x616b('0x11'));var authService=require('../../components/auth/service');var qs=require(_0x616b('0x12'));var as=require('../../components/parsers/advancedSearch');var hardwareService=require(_0x616b('0x13'));var logger=require(_0x616b('0x14'))(_0x616b('0x15'));var utils=require(_0x616b('0x16'));var config=require(_0x616b('0x17'));var db=require(_0x616b('0x18'))['db'];function respondWithStatusCode(_0x169c86,_0x35a3b8){_0x35a3b8=_0x35a3b8||0xcc;return function(_0x3d7528){if(_0x3d7528){return _0x169c86[_0x616b('0x19')](_0x35a3b8);}return _0x169c86[_0x616b('0x1a')](_0x35a3b8)[_0x616b('0x1b')]();};}function respondWithResult(_0x3e1d57,_0x2cb026){_0x2cb026=_0x2cb026||0xc8;return function(_0x307d29){if(_0x307d29){return _0x3e1d57[_0x616b('0x1a')](_0x2cb026)[_0x616b('0x1c')](_0x307d29);}};}function respondWithFilteredResult(_0x4c75ff,_0x585a5e){return function(_0x3e4fe9){if(_0x3e4fe9){var _0x5a4f5b=_0x3e4fe9[_0x616b('0x1d')],_0xbdc1e1=_0x585a5e[_0x616b('0x1e')],_0x44a882=_0x585a5e[_0x616b('0x1e')]+_0x585a5e[_0x616b('0x1f')],_0x338fb8;if(_0x44a882>=_0x5a4f5b){_0x44a882=_0x5a4f5b;_0x338fb8=0xc8;}else{_0x338fb8=0xce;}_0x4c75ff['status'](_0x338fb8);return _0x4c75ff[_0x616b('0x20')](_0x616b('0x21'),_0xbdc1e1+'-'+_0x44a882+'/'+_0x5a4f5b)['json'](_0x3e4fe9);}return null;};}function patchUpdates(_0x578553){return function(_0x3ae013){try{jsonpatch[_0x616b('0x22')](_0x3ae013,_0x578553,!![]);}catch(_0xb3274f){return BPromise[_0x616b('0x23')](_0xb3274f);}return _0x3ae013[_0x616b('0x24')]();};}function saveUpdates(_0x3f44ec,_0x4c1cd8){return function(_0x34feb){if(_0x34feb){return _0x34feb['update'](_0x3f44ec)[_0x616b('0x25')](function(_0x45f442){return _0x45f442;});}return null;};}function removeEntity(_0x485d02,_0x3176c9){return function(_0xe8a664){if(_0xe8a664){return _0xe8a664[_0x616b('0x26')]()[_0x616b('0x25')](function(){_0x485d02[_0x616b('0x1a')](0xcc)[_0x616b('0x1b')]();});}};}function handleEntityNotFound(_0x2876a7,_0x5d504e){return function(_0x413a2a){if(!_0x413a2a){_0x2876a7[_0x616b('0x19')](0x194);}return _0x413a2a;};}function handleError(_0x24c92e,_0x305361){_0x305361=_0x305361||0x1f4;return function(_0x14f358){logger['error'](_0x14f358[_0x616b('0x27')]);if(_0x14f358[_0x616b('0x28')]){delete _0x14f358[_0x616b('0x28')];}_0x24c92e[_0x616b('0x1a')](_0x305361)[_0x616b('0x29')](_0x14f358);};}exports[_0x616b('0x2a')]=function(_0x54f0ce,_0x1afa22){var _0x287ed4={},_0x44372d={},_0x337295={'count':0x0,'rows':[]};var _0x3d9d40=_[_0x616b('0x2b')](db['CmHopper'][_0x616b('0x2c')],function(_0x44a4ec){return{'name':_0x44a4ec[_0x616b('0x2d')],'type':_0x44a4ec['type'][_0x616b('0x2e')]};});_0x44372d[_0x616b('0x2f')]=_[_0x616b('0x2b')](_0x3d9d40,'name');_0x44372d[_0x616b('0x30')]=_[_0x616b('0x31')](_0x54f0ce[_0x616b('0x30')]);_0x44372d[_0x616b('0x32')]=_['intersection'](_0x44372d[_0x616b('0x2f')],_0x44372d[_0x616b('0x30')]);_0x44372d[_0x616b('0x32')]=_['concat'](_0x44372d['filters'],[_0x616b('0x33'),_0x616b('0x34'),'$gt',_0x616b('0x35'),'$lt',_0x616b('0x36'),_0x616b('0x37'),_0x616b('0x38'),_0x616b('0x39'),_0x616b('0x3a'),_0x616b('0x3b'),_0x616b('0x3c'),'$notIn',_0x616b('0x3d'),_0x616b('0x3e'),'$iLike','$notILike',_0x616b('0x3d'),_0x616b('0x3f'),'$contains',_0x616b('0x40'),_0x616b('0x41')]);_0x287ed4[_0x616b('0x42')]=_[_0x616b('0x43')](_0x44372d[_0x616b('0x2f')],qs[_0x616b('0x44')](_0x54f0ce[_0x616b('0x30')]['fields']));_0x287ed4[_0x616b('0x42')]=_0x287ed4['attributes'][_0x616b('0x45')]?_0x287ed4[_0x616b('0x42')]:_0x44372d['model'];if(!_0x54f0ce[_0x616b('0x30')][_0x616b('0x46')](_0x616b('0x47'))){_0x287ed4[_0x616b('0x1f')]=qs[_0x616b('0x1f')](_0x54f0ce[_0x616b('0x30')][_0x616b('0x1f')]);_0x287ed4[_0x616b('0x1e')]=qs[_0x616b('0x1e')](_0x54f0ce[_0x616b('0x30')][_0x616b('0x1e')]);}_0x287ed4['order']=qs[_0x616b('0x48')](_0x54f0ce[_0x616b('0x30')]['sort']);_0x287ed4[_0x616b('0x49')]=qs['filters'](_[_0x616b('0x4a')](_0x54f0ce[_0x616b('0x30')],_0x44372d[_0x616b('0x32')]));if(_0x54f0ce['query']['filter']){_0x287ed4[_0x616b('0x49')]=_[_0x616b('0x4b')](_0x287ed4[_0x616b('0x49')],{'$or':_[_0x616b('0x2b')](_0x3d9d40,function(_0xb25d8d){if(_0xb25d8d[_0x616b('0x4c')]!=='VIRTUAL'){var _0x1813aa={};_0x1813aa[_0xb25d8d[_0x616b('0x28')]]={'$like':'%'+_0x54f0ce[_0x616b('0x30')][_0x616b('0x4d')]+'%'};return _0x1813aa;}})});}_0x287ed4=_['merge']({},_0x287ed4,_0x54f0ce[_0x616b('0x4e')]);var _0x129387={'where':_0x287ed4['where']};return db[_0x616b('0x4f')][_0x616b('0x1d')](_0x129387)[_0x616b('0x25')](function(_0x41ade5){_0x337295['count']=_0x41ade5;if(_0x54f0ce[_0x616b('0x30')][_0x616b('0x50')]){_0x287ed4[_0x616b('0x51')]=[{'all':!![]}];}return db[_0x616b('0x4f')][_0x616b('0x52')](_0x287ed4);})[_0x616b('0x25')](function(_0xdcd0a4){_0x337295[_0x616b('0x53')]=_0xdcd0a4;return _0x337295;})['then'](respondWithFilteredResult(_0x1afa22,_0x287ed4))[_0x616b('0x54')](handleError(_0x1afa22,null));};exports['show']=function(_0x15c2b8,_0xd33ffb){var _0x1b47b2={'raw':!![],'where':{'id':_0x15c2b8[_0x616b('0x55')]['id']}},_0x3b11ee={};_0x3b11ee[_0x616b('0x2f')]=_['keys'](db['CmHopper'][_0x616b('0x2c')]);_0x3b11ee[_0x616b('0x30')]=_[_0x616b('0x31')](_0x15c2b8['query']);_0x3b11ee['filters']=_[_0x616b('0x43')](_0x3b11ee[_0x616b('0x2f')],_0x3b11ee[_0x616b('0x30')]);_0x1b47b2[_0x616b('0x42')]=_[_0x616b('0x43')](_0x3b11ee['model'],qs[_0x616b('0x44')](_0x15c2b8[_0x616b('0x30')][_0x616b('0x44')]));_0x1b47b2['attributes']=_0x1b47b2['attributes'][_0x616b('0x45')]?_0x1b47b2[_0x616b('0x42')]:_0x3b11ee['model'];if(_0x15c2b8[_0x616b('0x30')][_0x616b('0x50')]){_0x1b47b2[_0x616b('0x51')]=[{'all':!![]}];}_0x1b47b2=_[_0x616b('0x4b')]({},_0x1b47b2,_0x15c2b8['options']);return db[_0x616b('0x4f')][_0x616b('0x56')](_0x1b47b2)[_0x616b('0x25')](handleEntityNotFound(_0xd33ffb,null))[_0x616b('0x25')](respondWithResult(_0xd33ffb,null))['catch'](handleError(_0xd33ffb,null));};exports[_0x616b('0x57')]=function(_0x56280c,_0x51d988){return db[_0x616b('0x4f')]['create'](_0x56280c[_0x616b('0x58')],{})[_0x616b('0x25')](respondWithResult(_0x51d988,0xc9))[_0x616b('0x54')](handleError(_0x51d988,null));};exports[_0x616b('0x59')]=function(_0x1cb3b9,_0x54c290){if(_0x1cb3b9[_0x616b('0x58')]['id']){delete _0x1cb3b9['body']['id'];}return db[_0x616b('0x4f')][_0x616b('0x56')]({'where':{'id':_0x1cb3b9[_0x616b('0x55')]['id']}})[_0x616b('0x25')](handleEntityNotFound(_0x54c290,null))[_0x616b('0x25')](saveUpdates(_0x1cb3b9[_0x616b('0x58')],null))[_0x616b('0x25')](respondWithResult(_0x54c290,null))[_0x616b('0x54')](handleError(_0x54c290,null));};exports['describe']=function(_0x2edcc9,_0x8b6af2){return db[_0x616b('0x4f')][_0x616b('0x5a')]()[_0x616b('0x25')](respondWithResult(_0x8b6af2,null))[_0x616b('0x54')](handleError(_0x8b6af2,null));};exports[_0x616b('0x26')]=function(_0x1f3276,_0x10d1fd){var _0x3e24ba;return db[_0x616b('0x4f')]['find']({'where':{'id':_0x1f3276[_0x616b('0x55')]['id']}})['then'](handleEntityNotFound(_0x10d1fd,null))['then'](function(_0x34f050){if(_0x34f050){return _0x34f050['destroy']()[_0x616b('0x25')](function(_0x19e718){return _0x19e718;});}})[_0x616b('0x25')](function(_0x1becb0){_0x3e24ba=_0x1becb0;if(_0x1becb0){if(_0x1becb0[_0x616b('0x5b')]||_0x1becb0['CampaignId']){return db[_0x1becb0[_0x616b('0x5b')]?_0x616b('0x5c'):_0x616b('0x5d')][_0x616b('0x56')]({'where':{'id':_0x1becb0[_0x616b('0x5b')]?_0x1becb0[_0x616b('0x5b')]:_0x1becb0[_0x616b('0x5e')]},'attributes':['id',_0x616b('0x28')],'raw':!![]});}}})[_0x616b('0x25')](function(_0x157fd3){var _0x52fda7={};if(_0x157fd3){_['merge'](_0x52fda7,_[_0x616b('0x5f')](_0x3e24ba['dataValues'],[_0x616b('0x60'),_0x616b('0x61'),'id']));_0x52fda7[_0x616b('0x62')]=0x15;_0x52fda7['statedesc']=_0x616b('0x63');_0x52fda7[_0x616b('0x64')]=_0x157fd3['name'];_0x52fda7['membername']=_0x1f3276[_0x616b('0x65')]['name'];_0x52fda7[_0x616b('0x66')]=_0x1f3276['user']['id'];_0x52fda7[_0x616b('0x63')]=!![];_0x52fda7[_0x616b('0x67')]=moment()[_0x616b('0x68')]('YYYY-MM-DD\x20HH:mm:ss');_0x52fda7[_0x616b('0x69')]=_0x3e24ba[_0x616b('0x6a')];_0x52fda7['campaigntype']=_0x3e24ba[_0x616b('0x5b')]?_0x616b('0x6b'):_0x616b('0x6c');return db[_0x616b('0x6d')][_0x616b('0x56')]({'where':{'id':_0x52fda7[_0x616b('0x6e')]},'attributes':[_0x616b('0x6f'),_0x616b('0x70')]})[_0x616b('0x25')](function(_0x9b7bb2){if(!_[_0x616b('0x71')](_0x10d1fd)&&!_[_0x616b('0x71')](_0x9b7bb2[_0x616b('0x6f')])){_0x52fda7[_0x616b('0x72')]=_0x9b7bb2[_0x616b('0x6f')];if(!_[_0x616b('0x71')](_0x9b7bb2[_0x616b('0x70')])){_0x52fda7[_0x616b('0x72')]+='\x20'+_0x9b7bb2[_0x616b('0x70')];}}})[_0x616b('0x73')](function(){return db['CmHopperFinal']['create'](_0x52fda7);});}})[_0x616b('0x25')](function(){return _0x10d1fd['status'](0xcc)['end']();})[_0x616b('0x54')](handleError(_0x10d1fd,null));};exports[_0x616b('0x74')]=function(_0x4f910a,_0x158589,_0x567adb){var _0x332715=[];return db[_0x616b('0x6d')][_0x616b('0x5a')]()['then'](function(_0x2bd0fd){_0x332715=_['keys'](_0x2bd0fd);return _0x4f910a[_0x616b('0x65')][_0x616b('0x75')]({'where':{'type':_0x616b('0x76'),'dialActive':!![],'dialMethod':'preview'},'attributes':['id',_0x616b('0x77')],'raw':!![]});})[_0x616b('0x25')](function(_0x576877){if(_0x576877&&_0x576877[_0x616b('0x45')]){return db[_0x616b('0x78')]['transaction'](function(_0x392847){var _0x1780d0={'active':![],'recallme':![],'scheduledAt':{'$lte':moment()[_0x616b('0x68')](_0x616b('0x79'))},'VoiceQueueId':{'$in':_['map'](_0x576877,'id')},'$or':[{'UserId':null},{'UserId':_0x4f910a[_0x616b('0x65')]['id']}]};var _0x80785a=[];if(_0x4f910a[_0x616b('0x58')][_0x616b('0x7a')]&&_0x4f910a['body']['direction']==='prev'){if(!_[_0x616b('0x7b')](_0x4f910a['body'][_0x616b('0x7c')])){_0x1780d0['id']={'$in':_0x4f910a[_0x616b('0x58')][_0x616b('0x7c')]};}_0x80785a=[[_0x616b('0x7d'),_0x616b('0x7e')],[_0x616b('0x7f'),_0x576877[0x0][_0x616b('0x77')]===_0x616b('0x7e')?_0x616b('0x80'):_0x616b('0x7e')],db[_0x616b('0x78')][_0x616b('0x81')](_0x616b('0x82')),['id',_0x616b('0x80')]];}else{if(!_[_0x616b('0x7b')](_0x4f910a['body'][_0x616b('0x7c')])){_0x1780d0['id']={'$notIn':_0x4f910a[_0x616b('0x58')][_0x616b('0x7c')]};}_0x80785a=[[_0x616b('0x7d'),_0x616b('0x80')],['scheduledAt',_0x576877[0x0][_0x616b('0x77')]],db[_0x616b('0x78')]['literal'](_0x616b('0x83')),['id','ASC']];}return db[_0x616b('0x4f')]['findOne']({'attributes':['id',_0x616b('0x84')],'where':_0x1780d0,'order':_0x80785a,'transaction':_0x392847,'lock':_0x392847[_0x616b('0x85')][_0x616b('0x86')],'include':[{'model':db[_0x616b('0x6d')],'as':_0x616b('0x87'),'attributes':_0x332715,'include':[{'model':db['CmCompany'],'as':_0x616b('0x88'),'attributes':['id',_0x616b('0x28')]}]},{'model':db['CmList'],'as':_0x616b('0x89'),'attributes':['id','name']},{'model':db[_0x616b('0x5c')],'as':_0x616b('0x8a'),'attributes':['id',_0x616b('0x28'),_0x616b('0x8b')]}]})[_0x616b('0x25')](function(_0x2eb7ef){if(_0x2eb7ef){return _0x2eb7ef[_0x616b('0x59')]({'UserId':_0x4f910a['user']['id']},{'transaction':_0x392847});}});});}})[_0x616b('0x25')](handleEntityNotFound(_0x158589,null))['then'](respondWithResult(_0x158589,null))['catch'](handleError(_0x158589,null));};exports['getOpenContacts']=function(_0x14adce,_0x1b2eed,_0x3c683c){return _0x14adce[_0x616b('0x65')][_0x616b('0x75')]({'where':{'type':_0x616b('0x76'),'dialActive':!![],'dialMethod':_0x616b('0x8c')},'attributes':['id'],'raw':!![]})[_0x616b('0x25')](function(_0x577cf0){if(_0x577cf0&&_0x577cf0['length']){return db[_0x616b('0x4f')][_0x616b('0x1d')]({'where':{'active':![],'recallme':![],'scheduledAt':{'$lte':moment()[_0x616b('0x68')](_0x616b('0x79'))},'VoiceQueueId':{'$in':_[_0x616b('0x2b')](_0x577cf0,'id')},'$or':[{'UserId':null},{'UserId':_0x14adce['user']['id']}]}});}return 0x0;})[_0x616b('0x25')](function(_0x28bf9c){if(!_[_0x616b('0x71')](_0x28bf9c)&&_[_0x616b('0x8d')](_0x28bf9c)){return _0x1b2eed[_0x616b('0x1a')](0xc8)[_0x616b('0x1c')]({'contacts':_0x28bf9c});}else{logger[_0x616b('0x8e')](_0x616b('0x8f'),'getOpenContacts',0x194,_0x616b('0x90'));_0x1b2eed[_0x616b('0x19')](0x194);}})[_0x616b('0x54')](handleError(_0x1b2eed,null));};
\ No newline at end of file
diff --git a/server/api/cmHopper/cmHopper.model.js b/server/api/cmHopper/cmHopper.model.js
index 6b2a6e5..6d0307e 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 _0x94c4=['cm_hopper','scheduledat','phone','priority','lodash','util','../../config/logger','api','moment','request-promise','rimraf','../../config/environment','./cmHopper.attributes','exports','CmHopper'];(function(_0x2799ec,_0x6328b7){var _0x5cb48a=function(_0x40b5e2){while(--_0x40b5e2){_0x2799ec['push'](_0x2799ec['shift']());}};_0x5cb48a(++_0x6328b7);}(_0x94c4,0x6d));var _0x494c=function(_0x32c798,_0xd2fe15){_0x32c798=_0x32c798-0x0;var _0x429dbf=_0x94c4[_0x32c798];return _0x429dbf;};'use strict';var _=require(_0x494c('0x0'));var util=require(_0x494c('0x1'));var logger=require(_0x494c('0x2'))(_0x494c('0x3'));var moment=require(_0x494c('0x4'));var BPromise=require('bluebird');var rp=require(_0x494c('0x5'));var fs=require('fs');var path=require('path');var rimraf=require(_0x494c('0x6'));var config=require(_0x494c('0x7'));var attributes=require(_0x494c('0x8'));module[_0x494c('0x9')]=function(_0x37ef73,_0x461add){return _0x37ef73['define'](_0x494c('0xa'),attributes,{'tableName':_0x494c('0xb'),'paranoid':![],'indexes':[{'name':_0x494c('0xc'),'fields':[_0x494c('0xc')]},{'name':_0x494c('0xd'),'fields':[_0x494c('0xd')]},{'name':_0x494c('0xe'),'fields':[_0x494c('0xe')]}],'timestamps':!![]});};
\ No newline at end of file
+var _0x7fdf=['exports','cm_hopper','scheduledat','phone','priority','lodash','util','../../config/logger','api','bluebird','request-promise','path','rimraf','../../config/environment','./cmHopper.attributes'];(function(_0x9cd4c3,_0x1c9b2c){var _0x4c9025=function(_0x25b3c6){while(--_0x25b3c6){_0x9cd4c3['push'](_0x9cd4c3['shift']());}};_0x4c9025(++_0x1c9b2c);}(_0x7fdf,0x19a));var _0xf7fd=function(_0x4dcecc,_0x3865b9){_0x4dcecc=_0x4dcecc-0x0;var _0x2aa658=_0x7fdf[_0x4dcecc];return _0x2aa658;};'use strict';var _=require(_0xf7fd('0x0'));var util=require(_0xf7fd('0x1'));var logger=require(_0xf7fd('0x2'))(_0xf7fd('0x3'));var moment=require('moment');var BPromise=require(_0xf7fd('0x4'));var rp=require(_0xf7fd('0x5'));var fs=require('fs');var path=require(_0xf7fd('0x6'));var rimraf=require(_0xf7fd('0x7'));var config=require(_0xf7fd('0x8'));var attributes=require(_0xf7fd('0x9'));module[_0xf7fd('0xa')]=function(_0x41225f,_0x4c8061){return _0x41225f['define']('CmHopper',attributes,{'tableName':_0xf7fd('0xb'),'paranoid':![],'indexes':[{'name':_0xf7fd('0xc'),'fields':['scheduledat']},{'name':_0xf7fd('0xd'),'fields':[_0xf7fd('0xd')]},{'name':_0xf7fd('0xe'),'fields':[_0xf7fd('0xe')]}],'timestamps':!![]});};
\ No newline at end of file
diff --git a/server/api/cmHopper/cmHopper.rpc.js b/server/api/cmHopper/cmHopper.rpc.js
index ae3579c..ed7bd7b 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 _0x7a54=['stringify','error','code','message','request\x20sent','result','catch','CmHopper','findAll','options','raw','where','attributes','include','map','model','then','GetCmHopper','ShowCmHopper','find','CreateCmHopper','create','update','UpdateCmHopper','DestroyCmHopper','destroy','GetContactDialer','CmContact','describe','sequelize','limit','order','LOCK','UPDATE','keys','User','Agent','name','voicePause','length','body','all','MoveContactManagedDialer','transaction','CountReScheduled','COUNT','literal','`scheduledat`\x20>=\x20','format','\x22%s\x22','\x20,\x201,\x20null','contactsRescheduled','GetContactRecallMe','UserId','push','lodash','util','moment','randomstring','ioredis','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','http','info','CmHopper,\x20%s,\x20%s','debug'];(function(_0x20a584,_0xe384a5){var _0x4b41a8=function(_0x2127c6){while(--_0x2127c6){_0x20a584['push'](_0x20a584['shift']());}};_0x4b41a8(++_0xe384a5);}(_0x7a54,0x106));var _0x47a5=function(_0x364059,_0x3df82d){_0x364059=_0x364059-0x0;var _0x5785e7=_0x7a54[_0x364059];return _0x5785e7;};'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')]('CmHopper,\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['GetCmHopper']=function(_0x5247fd){var _0x423a81=this;return new Promise(function(_0xaf70a6,_0x2ce454){return db[_0x47a5('0x15')][_0x47a5('0x16')]({'raw':_0x5247fd[_0x47a5('0x17')]?_0x5247fd[_0x47a5('0x17')][_0x47a5('0x18')]===undefined?!![]:![]:!![],'where':_0x5247fd[_0x47a5('0x17')]?_0x5247fd['options'][_0x47a5('0x19')]||null:null,'attributes':_0x5247fd[_0x47a5('0x17')]?_0x5247fd['options'][_0x47a5('0x1a')]||null:null,'limit':_0x5247fd[_0x47a5('0x17')]?_0x5247fd[_0x47a5('0x17')]['limit']||null:null,'include':_0x5247fd[_0x47a5('0x17')]?_0x5247fd[_0x47a5('0x17')][_0x47a5('0x1b')]?_[_0x47a5('0x1c')](_0x5247fd['options'][_0x47a5('0x1b')],function(_0x385687){return{'model':db[_0x385687['model']],'as':_0x385687['as'],'attributes':_0x385687[_0x47a5('0x1a')],'include':_0x385687[_0x47a5('0x1b')]?_[_0x47a5('0x1c')](_0x385687[_0x47a5('0x1b')],function(_0x3abd6a){return{'model':db[_0x3abd6a['model']],'as':_0x3abd6a['as'],'attributes':_0x3abd6a['attributes'],'include':_0x3abd6a[_0x47a5('0x1b')]?_['map'](_0x3abd6a[_0x47a5('0x1b')],function(_0x5b6c4e){return{'model':db[_0x5b6c4e[_0x47a5('0x1d')]],'as':_0x5b6c4e['as'],'attributes':_0x5b6c4e[_0x47a5('0x1a')]};}):[]};}):[]};}):[]:[]})[_0x47a5('0x1e')](function(_0x1dac65){logger[_0x47a5('0xb')](_0x47a5('0x1f'),_0x5247fd);logger[_0x47a5('0xd')](_0x47a5('0x1f'),_0x5247fd,JSON[_0x47a5('0xe')](_0x1dac65));_0xaf70a6(_0x1dac65);})[_0x47a5('0x14')](function(_0x1127f8){logger[_0x47a5('0xf')](_0x47a5('0x1f'),_0x1127f8['message'],_0x5247fd);_0x2ce454(_0x423a81[_0x47a5('0xf')](0x1f4,_0x1127f8['message']));});});};exports[_0x47a5('0x20')]=function(_0x9ac908){var _0x16901f=this;return new Promise(function(_0x4d6b57,_0x256650){return db[_0x47a5('0x15')][_0x47a5('0x21')]({'raw':_0x9ac908[_0x47a5('0x17')]?_0x9ac908['options']['raw']===undefined?!![]:![]:!![],'where':_0x9ac908[_0x47a5('0x17')]?_0x9ac908[_0x47a5('0x17')]['where']||null:null,'attributes':_0x9ac908['options']?_0x9ac908[_0x47a5('0x17')][_0x47a5('0x1a')]||null:null,'include':_0x9ac908['options']?_0x9ac908[_0x47a5('0x17')]['include']?_[_0x47a5('0x1c')](_0x9ac908[_0x47a5('0x17')]['include'],function(_0x4843c0){return{'model':db[_0x4843c0[_0x47a5('0x1d')]],'as':_0x4843c0['as'],'attributes':_0x4843c0['attributes'],'include':_0x4843c0[_0x47a5('0x1b')]?_[_0x47a5('0x1c')](_0x4843c0[_0x47a5('0x1b')],function(_0x52749b){return{'model':db[_0x52749b[_0x47a5('0x1d')]],'as':_0x52749b['as'],'attributes':_0x52749b['attributes'],'include':_0x52749b['include']?_[_0x47a5('0x1c')](_0x52749b['include'],function(_0x25cce0){return{'model':db[_0x25cce0['model']],'as':_0x25cce0['as'],'attributes':_0x25cce0[_0x47a5('0x1a')]};}):[]};}):[]};}):[]:[]})[_0x47a5('0x1e')](function(_0x38c8d4){logger[_0x47a5('0xb')](_0x47a5('0x20'),_0x9ac908);logger[_0x47a5('0xd')](_0x47a5('0x20'),_0x9ac908,JSON[_0x47a5('0xe')](_0x38c8d4));_0x4d6b57(_0x38c8d4);})[_0x47a5('0x14')](function(_0x4caed5){logger[_0x47a5('0xf')](_0x47a5('0x20'),_0x4caed5['message'],_0x9ac908);_0x256650(_0x16901f[_0x47a5('0xf')](0x1f4,_0x4caed5[_0x47a5('0x11')]));});});};exports[_0x47a5('0x22')]=function(_0x49c4b5){var _0x101f70=this;return new Promise(function(_0x10f660,_0x596097){return db[_0x47a5('0x15')][_0x47a5('0x23')](_0x49c4b5['body'],{'raw':_0x49c4b5['options']?_0x49c4b5['options'][_0x47a5('0x18')]===undefined?!![]:![]:!![]})['then'](function(_0x9b5eaf){logger[_0x47a5('0xb')](_0x47a5('0x22'),_0x49c4b5);logger[_0x47a5('0xd')](_0x47a5('0x22'),_0x49c4b5,JSON[_0x47a5('0xe')](_0x9b5eaf));_0x10f660(_0x9b5eaf);})[_0x47a5('0x14')](function(_0x1f3d01){logger[_0x47a5('0xf')](_0x47a5('0x22'),_0x1f3d01[_0x47a5('0x11')],_0x49c4b5);_0x596097(_0x101f70[_0x47a5('0xf')](0x1f4,_0x1f3d01[_0x47a5('0x11')]));});});};exports['UpdateCmHopper']=function(_0x1fbece){var _0x1c36fa=this;return new Promise(function(_0x331474,_0x23bd8d){return db['CmHopper'][_0x47a5('0x24')](_0x1fbece['body'],{'raw':_0x1fbece['options']?_0x1fbece['options']['raw']===undefined?!![]:![]:!![],'individualHooks':!![],'where':_0x1fbece[_0x47a5('0x17')]?_0x1fbece['options'][_0x47a5('0x19')]||null:null,'attributes':_0x1fbece[_0x47a5('0x17')]?_0x1fbece[_0x47a5('0x17')]['attributes']||null:null,'limit':_0x1fbece[_0x47a5('0x17')]?_0x1fbece[_0x47a5('0x17')]['limit']||null:null})['then'](function(_0xbe21d9){logger['info'](_0x47a5('0x25'),_0x1fbece);logger[_0x47a5('0xd')](_0x47a5('0x25'),_0x1fbece,JSON[_0x47a5('0xe')](_0xbe21d9));_0x331474(_0xbe21d9);})[_0x47a5('0x14')](function(_0xf0edbb){logger[_0x47a5('0xf')](_0x47a5('0x25'),_0xf0edbb[_0x47a5('0x11')],_0x1fbece);_0x23bd8d(_0x1c36fa[_0x47a5('0xf')](0x1f4,_0xf0edbb[_0x47a5('0x11')]));});});};exports[_0x47a5('0x26')]=function(_0xe28d76){var _0x3574d4=this;return new Promise(function(_0x4e5e7,_0x3a2b38){return db['CmHopper'][_0x47a5('0x27')]({'where':_0xe28d76[_0x47a5('0x17')]?_0xe28d76['options']['where']||null:null})[_0x47a5('0x1e')](function(_0x560e4e){logger[_0x47a5('0xb')](_0x47a5('0x26'),_0xe28d76);logger['debug']('DestroyCmHopper',_0xe28d76,JSON[_0x47a5('0xe')](_0x560e4e));_0x4e5e7(_0x560e4e);})['catch'](function(_0x2d147c){logger[_0x47a5('0xf')](_0x47a5('0x26'),_0x2d147c[_0x47a5('0x11')],_0xe28d76);_0x3a2b38(_0x3574d4[_0x47a5('0xf')](0x1f4,_0x2d147c[_0x47a5('0x11')]));});});};exports[_0x47a5('0x28')]=function(_0x53e994){var _0x48a0ef=this;return new Promise(function(_0x2dd1db,_0x411230){return db[_0x47a5('0x29')][_0x47a5('0x2a')]()[_0x47a5('0x1e')](function(_0x2c0c86){return db[_0x47a5('0x2b')]['transaction'](function(_0x45cca5){return db[_0x47a5('0x15')][_0x47a5('0x16')]({'where':_0x53e994['options']?_0x53e994[_0x47a5('0x17')]['where']||null:null,'attributes':_0x53e994[_0x47a5('0x17')]?_0x53e994[_0x47a5('0x17')][_0x47a5('0x1a')]||null:null,'limit':_0x53e994[_0x47a5('0x17')]?_0x53e994['options'][_0x47a5('0x2c')]||null:null,'order':_0x53e994[_0x47a5('0x17')]?_0x53e994[_0x47a5('0x17')][_0x47a5('0x2d')]||null:null,'transaction':_0x45cca5,'lock':_0x45cca5[_0x47a5('0x2e')][_0x47a5('0x2f')],'include':[{'model':db[_0x47a5('0x29')],'as':'Contact','attributes':_[_0x47a5('0x30')](_0x2c0c86)},{'model':db[_0x47a5('0x31')],'as':_0x47a5('0x32'),'attributes':['id',_0x47a5('0x33'),_0x47a5('0x34')]}]})[_0x47a5('0x1e')](function(_0x572233){var _0x1ad6a9=[];for(var _0x245a15=0x0;_0x245a15<_0x572233[_0x47a5('0x35')];_0x245a15+=0x1){_0x1ad6a9['push'](_0x572233[_0x245a15][_0x47a5('0x24')](_0x53e994[_0x47a5('0x36')],{'transaction':_0x45cca5}));}return BPromise[_0x47a5('0x37')](_0x1ad6a9);});})['then'](function(_0x57641e){logger[_0x47a5('0xb')](_0x47a5('0x28'),_0x53e994);logger['debug']('GetContactDialer',_0x53e994,JSON[_0x47a5('0xe')](_0x57641e));_0x2dd1db(_0x57641e);})['catch'](function(_0x16bb8a){logger['error']('GetContactDialer',_0x16bb8a[_0x47a5('0x11')],_0x53e994);_0x411230(_0x48a0ef[_0x47a5('0xf')](0x1f4,_0x16bb8a['message']));});});});};exports[_0x47a5('0x38')]=function(_0x72fe){var _0x4b706a=this;return new Promise(function(_0x5b6127,_0x16b4fd){return db[_0x47a5('0x2b')][_0x47a5('0x39')](function(_0x2931e4){return db['CmHopperFinal'][_0x47a5('0x23')](_0x72fe[_0x47a5('0x36')],{'raw':_0x72fe[_0x47a5('0x17')]?_0x72fe['options'][_0x47a5('0x18')]===undefined?!![]:![]:!![],'transaction':_0x2931e4})['then'](function(){return db[_0x47a5('0x15')][_0x47a5('0x27')]({'where':_0x72fe[_0x47a5('0x17')]?_0x72fe[_0x47a5('0x17')][_0x47a5('0x19')]||null:null,'transaction':_0x2931e4});});})['then'](function(_0x144af9){logger['info']('MoveContactManagedDialer',_0x72fe);logger['debug']('MoveContactManagedDialer',_0x72fe,JSON[_0x47a5('0xe')](_0x144af9));_0x5b6127(_0x144af9);})[_0x47a5('0x14')](function(_0x1e2bb4){logger['error']('MoveContactManagedDialer',_0x1e2bb4[_0x47a5('0x11')],_0x72fe);_0x16b4fd(_0x4b706a[_0x47a5('0xf')](0x1f4,_0x1e2bb4[_0x47a5('0x11')]));});});};exports[_0x47a5('0x3a')]=function(_0xc45e25){var _0x4b5d0c=this;return new Promise(function(_0x3474b7,_0x519e9e){return db[_0x47a5('0x15')][_0x47a5('0x16')]({'raw':_0xc45e25['options']?_0xc45e25[_0x47a5('0x17')][_0x47a5('0x18')]===undefined?!![]:![]:!![],'where':_0xc45e25[_0x47a5('0x17')]?_0xc45e25[_0x47a5('0x17')][_0x47a5('0x19')]||null:null,'attributes':[[db[_0x47a5('0x2b')]['fn'](_0x47a5('0x3b'),db[_0x47a5('0x2b')]['fn']('IF',db['sequelize'][_0x47a5('0x3c')](_0x47a5('0x3d')+util[_0x47a5('0x3e')](_0x47a5('0x3f'),moment()[_0x47a5('0x3e')]('YYYY-MM-DD\x20HH:mm:ss'))+_0x47a5('0x40')))),_0x47a5('0x41')]]})[_0x47a5('0x1e')](function(_0x144aaa){logger[_0x47a5('0xb')](_0x47a5('0x3a'),_0xc45e25);logger[_0x47a5('0xd')](_0x47a5('0x3a'),_0xc45e25,JSON[_0x47a5('0xe')](_0x144aaa));_0x3474b7(_0x144aaa);})[_0x47a5('0x14')](function(_0x1d56f3){logger[_0x47a5('0xf')](_0x47a5('0x3a'),_0x1d56f3[_0x47a5('0x11')],_0xc45e25);_0x519e9e(_0x4b5d0c[_0x47a5('0xf')](0x1f4,_0x1d56f3['message']));});});};exports[_0x47a5('0x42')]=function(_0x284fb8){var _0x30504e=this;return new Promise(function(_0x4b42f3,_0x37ac59){return db[_0x47a5('0x29')][_0x47a5('0x2a')]()[_0x47a5('0x1e')](function(_0x5d9822){return db[_0x47a5('0x2b')]['transaction'](function(_0x2d5ee6){return db['CmHopper'][_0x47a5('0x16')]({'where':_0x284fb8['options']?_0x284fb8[_0x47a5('0x17')][_0x47a5('0x19')]||null:null,'attributes':_0x284fb8[_0x47a5('0x17')]?_0x284fb8['options']['attributes']||null:null,'limit':0x1,'order':_0x284fb8['options']?_0x284fb8[_0x47a5('0x17')][_0x47a5('0x2d')]||null:null,'group':db[_0x47a5('0x15')][_0x47a5('0x43')],'transaction':_0x2d5ee6,'lock':_0x2d5ee6['LOCK'][_0x47a5('0x2f')],'include':_0x284fb8[_0x47a5('0x17')]?_0x284fb8[_0x47a5('0x17')][_0x47a5('0x1b')]?_[_0x47a5('0x1c')](_0x284fb8[_0x47a5('0x17')][_0x47a5('0x1b')],function(_0x39939a){return{'model':db[_0x39939a[_0x47a5('0x1d')]],'as':_0x39939a['as'],'attributes':_0x39939a[_0x47a5('0x1a')],'include':_0x39939a[_0x47a5('0x1b')]?_[_0x47a5('0x1c')](_0x39939a['include'],function(_0x1e3212){return{'model':db[_0x1e3212['model']],'as':_0x1e3212['as'],'attributes':_0x1e3212[_0x47a5('0x1a')],'include':_0x1e3212[_0x47a5('0x1b')]?_[_0x47a5('0x1c')](_0x1e3212[_0x47a5('0x1b')],function(_0x40e584){return{'model':db[_0x40e584[_0x47a5('0x1d')]],'as':_0x40e584['as'],'attributes':_0x40e584[_0x47a5('0x1a')]};}):[]};}):[]};}):[]:[]})[_0x47a5('0x1e')](function(_0x11c1db){var _0x254049=[];for(var _0x1cfb37=0x0;_0x1cfb37<_0x11c1db[_0x47a5('0x35')];_0x1cfb37+=0x1){_0x254049[_0x47a5('0x44')](_0x11c1db[_0x1cfb37][_0x47a5('0x24')](_0x284fb8[_0x47a5('0x36')],{'transaction':_0x2d5ee6}));}return BPromise['all'](_0x254049);});})['then'](function(_0x5ccc89){logger['info'](_0x47a5('0x42'),_0x284fb8);logger[_0x47a5('0xd')]('GetContactRecallMe',_0x284fb8,JSON[_0x47a5('0xe')](_0x5ccc89));_0x4b42f3(_0x5ccc89);})[_0x47a5('0x14')](function(_0x1baa5a){logger[_0x47a5('0xf')](_0x47a5('0x42'),_0x1baa5a[_0x47a5('0x11')],_0x284fb8);_0x37ac59(_0x30504e[_0x47a5('0xf')](0x1f4,_0x1baa5a[_0x47a5('0x11')]));});});});};
\ No newline at end of file
+var _0xb10b=['order','LOCK','UPDATE','Contact','keys','User','Agent','name','voicePause','length','push','CmHopperFinal','MoveContactManagedDialer','CountReScheduled','COUNT','`scheduledat`\x20>=\x20','format','\x22%s\x22','\x20,\x201,\x20null','contactsRescheduled','GetContactRecallMe','all','lodash','moment','bluebird','randomstring','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','http','request','then','info','CmHopper,\x20%s,\x20%s','CmHopper,\x20%s,\x20%s,\x20%s','request\x20sent','stringify','error','message','result','GetCmHopper','CmHopper','findAll','options','raw','where','attributes','include','map','model','debug','catch','ShowCmHopper','CreateCmHopper','create','body','update','limit','UpdateCmHopper','destroy','DestroyCmHopper','GetContactDialer','CmContact','describe','sequelize','transaction'];(function(_0x1facfa,_0x1acf7d){var _0x9ec701=function(_0x115e37){while(--_0x115e37){_0x1facfa['push'](_0x1facfa['shift']());}};_0x9ec701(++_0x1acf7d);}(_0xb10b,0x12a));var _0xbb10=function(_0x290fd8,_0x33829d){_0x290fd8=_0x290fd8-0x0;var _0x1daa07=_0xb10b[_0x290fd8];return _0x1daa07;};'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')]({'raw':_0x378da8['options']?_0x378da8[_0xbb10('0x18')][_0xbb10('0x19')]===undefined?!![]:![]:!![],'where':_0x378da8[_0xbb10('0x18')]?_0x378da8[_0xbb10('0x18')][_0xbb10('0x1a')]||null:null,'attributes':_0x378da8[_0xbb10('0x18')]?_0x378da8['options'][_0xbb10('0x1b')]||null:null,'limit':_0x378da8[_0xbb10('0x18')]?_0x378da8['options']['limit']||null:null,'include':_0x378da8[_0xbb10('0x18')]?_0x378da8[_0xbb10('0x18')][_0xbb10('0x1c')]?_[_0xbb10('0x1d')](_0x378da8[_0xbb10('0x18')][_0xbb10('0x1c')],function(_0x407cb4){return{'model':db[_0x407cb4[_0xbb10('0x1e')]],'as':_0x407cb4['as'],'attributes':_0x407cb4[_0xbb10('0x1b')],'include':_0x407cb4[_0xbb10('0x1c')]?_[_0xbb10('0x1d')](_0x407cb4[_0xbb10('0x1c')],function(_0x537898){return{'model':db[_0x537898['model']],'as':_0x537898['as'],'attributes':_0x537898['attributes'],'include':_0x537898[_0xbb10('0x1c')]?_[_0xbb10('0x1d')](_0x537898[_0xbb10('0x1c')],function(_0x4e25ff){return{'model':db[_0x4e25ff[_0xbb10('0x1e')]],'as':_0x4e25ff['as'],'attributes':_0x4e25ff[_0xbb10('0x1b')]};}):[]};}):[]};}):[]:[]})[_0xbb10('0xc')](function(_0x1d5e95){logger[_0xbb10('0xd')](_0xbb10('0x15'),_0x378da8);logger[_0xbb10('0x1f')]('GetCmHopper',_0x378da8,JSON[_0xbb10('0x11')](_0x1d5e95));_0x575cca(_0x1d5e95);})[_0xbb10('0x20')](function(_0xfc3595){logger[_0xbb10('0x12')](_0xbb10('0x15'),_0xfc3595[_0xbb10('0x13')],_0x378da8);_0x30efc6(_0x1682a4['error'](0x1f4,_0xfc3595[_0xbb10('0x13')]));});});};exports['ShowCmHopper']=function(_0x448d5c){var _0x56f2da=this;return new Promise(function(_0x16ad2a,_0x1dcc9c){return db[_0xbb10('0x16')]['find']({'raw':_0x448d5c['options']?_0x448d5c[_0xbb10('0x18')][_0xbb10('0x19')]===undefined?!![]:![]:!![],'where':_0x448d5c['options']?_0x448d5c[_0xbb10('0x18')][_0xbb10('0x1a')]||null:null,'attributes':_0x448d5c[_0xbb10('0x18')]?_0x448d5c[_0xbb10('0x18')][_0xbb10('0x1b')]||null:null,'include':_0x448d5c[_0xbb10('0x18')]?_0x448d5c[_0xbb10('0x18')]['include']?_[_0xbb10('0x1d')](_0x448d5c[_0xbb10('0x18')][_0xbb10('0x1c')],function(_0x8c1ce6){return{'model':db[_0x8c1ce6[_0xbb10('0x1e')]],'as':_0x8c1ce6['as'],'attributes':_0x8c1ce6[_0xbb10('0x1b')],'include':_0x8c1ce6[_0xbb10('0x1c')]?_[_0xbb10('0x1d')](_0x8c1ce6[_0xbb10('0x1c')],function(_0x56943c){return{'model':db[_0x56943c[_0xbb10('0x1e')]],'as':_0x56943c['as'],'attributes':_0x56943c[_0xbb10('0x1b')],'include':_0x56943c[_0xbb10('0x1c')]?_[_0xbb10('0x1d')](_0x56943c['include'],function(_0x111762){return{'model':db[_0x111762['model']],'as':_0x111762['as'],'attributes':_0x111762['attributes']};}):[]};}):[]};}):[]:[]})[_0xbb10('0xc')](function(_0x40c164){logger[_0xbb10('0xd')](_0xbb10('0x21'),_0x448d5c);logger[_0xbb10('0x1f')](_0xbb10('0x21'),_0x448d5c,JSON['stringify'](_0x40c164));_0x16ad2a(_0x40c164);})[_0xbb10('0x20')](function(_0x25d72f){logger['error']('ShowCmHopper',_0x25d72f['message'],_0x448d5c);_0x1dcc9c(_0x56f2da[_0xbb10('0x12')](0x1f4,_0x25d72f[_0xbb10('0x13')]));});});};exports[_0xbb10('0x22')]=function(_0x4d5a9b){var _0x3c0cd7=this;return new Promise(function(_0x3e8538,_0x4345f3){return db['CmHopper'][_0xbb10('0x23')](_0x4d5a9b[_0xbb10('0x24')],{'raw':_0x4d5a9b[_0xbb10('0x18')]?_0x4d5a9b[_0xbb10('0x18')]['raw']===undefined?!![]:![]:!![]})[_0xbb10('0xc')](function(_0x110eb5){logger['info'](_0xbb10('0x22'),_0x4d5a9b);logger[_0xbb10('0x1f')](_0xbb10('0x22'),_0x4d5a9b,JSON[_0xbb10('0x11')](_0x110eb5));_0x3e8538(_0x110eb5);})[_0xbb10('0x20')](function(_0x185a52){logger['error'](_0xbb10('0x22'),_0x185a52[_0xbb10('0x13')],_0x4d5a9b);_0x4345f3(_0x3c0cd7[_0xbb10('0x12')](0x1f4,_0x185a52[_0xbb10('0x13')]));});});};exports['UpdateCmHopper']=function(_0x3fff6c){var _0x331751=this;return new Promise(function(_0x23dc18,_0x403beb){return db['CmHopper'][_0xbb10('0x25')](_0x3fff6c[_0xbb10('0x24')],{'raw':_0x3fff6c['options']?_0x3fff6c['options'][_0xbb10('0x19')]===undefined?!![]:![]:!![],'individualHooks':!![],'where':_0x3fff6c['options']?_0x3fff6c[_0xbb10('0x18')][_0xbb10('0x1a')]||null:null,'attributes':_0x3fff6c['options']?_0x3fff6c[_0xbb10('0x18')][_0xbb10('0x1b')]||null:null,'limit':_0x3fff6c[_0xbb10('0x18')]?_0x3fff6c['options'][_0xbb10('0x26')]||null:null})[_0xbb10('0xc')](function(_0x3b9fdf){logger[_0xbb10('0xd')](_0xbb10('0x27'),_0x3fff6c);logger[_0xbb10('0x1f')](_0xbb10('0x27'),_0x3fff6c,JSON[_0xbb10('0x11')](_0x3b9fdf));_0x23dc18(_0x3b9fdf);})[_0xbb10('0x20')](function(_0x43b948){logger[_0xbb10('0x12')](_0xbb10('0x27'),_0x43b948['message'],_0x3fff6c);_0x403beb(_0x331751[_0xbb10('0x12')](0x1f4,_0x43b948[_0xbb10('0x13')]));});});};exports['DestroyCmHopper']=function(_0x14e1cb){var _0x2f5027=this;return new Promise(function(_0x1a7df6,_0x5a5226){return db[_0xbb10('0x16')][_0xbb10('0x28')]({'where':_0x14e1cb[_0xbb10('0x18')]?_0x14e1cb['options']['where']||null:null})[_0xbb10('0xc')](function(_0x76a208){logger[_0xbb10('0xd')]('DestroyCmHopper',_0x14e1cb);logger['debug'](_0xbb10('0x29'),_0x14e1cb,JSON[_0xbb10('0x11')](_0x76a208));_0x1a7df6(_0x76a208);})[_0xbb10('0x20')](function(_0xf820fe){logger[_0xbb10('0x12')](_0xbb10('0x29'),_0xf820fe[_0xbb10('0x13')],_0x14e1cb);_0x5a5226(_0x2f5027[_0xbb10('0x12')](0x1f4,_0xf820fe[_0xbb10('0x13')]));});});};exports[_0xbb10('0x2a')]=function(_0x550111){var _0x5eafac=this;return new Promise(function(_0x412e13,_0x467dba){return db[_0xbb10('0x2b')][_0xbb10('0x2c')]()[_0xbb10('0xc')](function(_0x440f9e){return db[_0xbb10('0x2d')][_0xbb10('0x2e')](function(_0x1c0d8f){return db[_0xbb10('0x16')][_0xbb10('0x17')]({'where':_0x550111[_0xbb10('0x18')]?_0x550111[_0xbb10('0x18')][_0xbb10('0x1a')]||null:null,'attributes':_0x550111[_0xbb10('0x18')]?_0x550111['options'][_0xbb10('0x1b')]||null:null,'limit':_0x550111['options']?_0x550111[_0xbb10('0x18')][_0xbb10('0x26')]||null:null,'order':_0x550111[_0xbb10('0x18')]?_0x550111[_0xbb10('0x18')][_0xbb10('0x2f')]||null:null,'transaction':_0x1c0d8f,'lock':_0x1c0d8f[_0xbb10('0x30')][_0xbb10('0x31')],'include':[{'model':db[_0xbb10('0x2b')],'as':_0xbb10('0x32'),'attributes':_[_0xbb10('0x33')](_0x440f9e)},{'model':db[_0xbb10('0x34')],'as':_0xbb10('0x35'),'attributes':['id',_0xbb10('0x36'),_0xbb10('0x37')]}]})[_0xbb10('0xc')](function(_0x5de0cc){var _0x4571b6=[];for(var _0x466eb7=0x0;_0x466eb7<_0x5de0cc[_0xbb10('0x38')];_0x466eb7+=0x1){_0x4571b6[_0xbb10('0x39')](_0x5de0cc[_0x466eb7][_0xbb10('0x25')](_0x550111[_0xbb10('0x24')],{'transaction':_0x1c0d8f}));}return BPromise['all'](_0x4571b6);});})[_0xbb10('0xc')](function(_0x4731ce){logger[_0xbb10('0xd')](_0xbb10('0x2a'),_0x550111);logger[_0xbb10('0x1f')](_0xbb10('0x2a'),_0x550111,JSON[_0xbb10('0x11')](_0x4731ce));_0x412e13(_0x4731ce);})[_0xbb10('0x20')](function(_0x205e01){logger[_0xbb10('0x12')](_0xbb10('0x2a'),_0x205e01[_0xbb10('0x13')],_0x550111);_0x467dba(_0x5eafac[_0xbb10('0x12')](0x1f4,_0x205e01['message']));});});});};exports['MoveContactManagedDialer']=function(_0x16272d){var _0x3e6338=this;return new Promise(function(_0x3d0cb7,_0x8b0a7d){return db['sequelize']['transaction'](function(_0x79411e){return db[_0xbb10('0x3a')][_0xbb10('0x23')](_0x16272d[_0xbb10('0x24')],{'raw':_0x16272d[_0xbb10('0x18')]?_0x16272d[_0xbb10('0x18')][_0xbb10('0x19')]===undefined?!![]:![]:!![],'transaction':_0x79411e})['then'](function(){return db[_0xbb10('0x16')][_0xbb10('0x28')]({'where':_0x16272d['options']?_0x16272d['options']['where']||null:null,'transaction':_0x79411e});});})[_0xbb10('0xc')](function(_0x31c727){logger[_0xbb10('0xd')]('MoveContactManagedDialer',_0x16272d);logger['debug']('MoveContactManagedDialer',_0x16272d,JSON[_0xbb10('0x11')](_0x31c727));_0x3d0cb7(_0x31c727);})[_0xbb10('0x20')](function(_0x45167a){logger['error'](_0xbb10('0x3b'),_0x45167a[_0xbb10('0x13')],_0x16272d);_0x8b0a7d(_0x3e6338['error'](0x1f4,_0x45167a['message']));});});};exports[_0xbb10('0x3c')]=function(_0x308896){var _0xd77753=this;return new Promise(function(_0x237246,_0x54b7c5){return db[_0xbb10('0x16')][_0xbb10('0x17')]({'raw':_0x308896[_0xbb10('0x18')]?_0x308896['options'][_0xbb10('0x19')]===undefined?!![]:![]:!![],'where':_0x308896[_0xbb10('0x18')]?_0x308896[_0xbb10('0x18')]['where']||null:null,'attributes':[[db[_0xbb10('0x2d')]['fn'](_0xbb10('0x3d'),db[_0xbb10('0x2d')]['fn']('IF',db[_0xbb10('0x2d')]['literal'](_0xbb10('0x3e')+util[_0xbb10('0x3f')](_0xbb10('0x40'),moment()[_0xbb10('0x3f')]('YYYY-MM-DD\x20HH:mm:ss'))+_0xbb10('0x41')))),_0xbb10('0x42')]]})[_0xbb10('0xc')](function(_0x2ceb3e){logger[_0xbb10('0xd')](_0xbb10('0x3c'),_0x308896);logger[_0xbb10('0x1f')]('CountReScheduled',_0x308896,JSON['stringify'](_0x2ceb3e));_0x237246(_0x2ceb3e);})['catch'](function(_0xdfbc0b){logger[_0xbb10('0x12')](_0xbb10('0x3c'),_0xdfbc0b['message'],_0x308896);_0x54b7c5(_0xd77753['error'](0x1f4,_0xdfbc0b[_0xbb10('0x13')]));});});};exports[_0xbb10('0x43')]=function(_0xd9e743){var _0x3a9677=this;return new Promise(function(_0x260e06,_0x1ad2ed){return db['CmContact'][_0xbb10('0x2c')]()[_0xbb10('0xc')](function(_0x270fdb){return db[_0xbb10('0x2d')][_0xbb10('0x2e')](function(_0x5bfc68){return db['CmHopper']['findAll']({'where':_0xd9e743[_0xbb10('0x18')]?_0xd9e743[_0xbb10('0x18')][_0xbb10('0x1a')]||null:null,'attributes':_0xd9e743[_0xbb10('0x18')]?_0xd9e743[_0xbb10('0x18')][_0xbb10('0x1b')]||null:null,'limit':0x1,'order':_0xd9e743['options']?_0xd9e743[_0xbb10('0x18')]['order']||null:null,'group':db['CmHopper']['UserId'],'transaction':_0x5bfc68,'lock':_0x5bfc68[_0xbb10('0x30')][_0xbb10('0x31')],'include':_0xd9e743[_0xbb10('0x18')]?_0xd9e743[_0xbb10('0x18')]['include']?_[_0xbb10('0x1d')](_0xd9e743['options']['include'],function(_0x165fe9){return{'model':db[_0x165fe9[_0xbb10('0x1e')]],'as':_0x165fe9['as'],'attributes':_0x165fe9[_0xbb10('0x1b')],'include':_0x165fe9[_0xbb10('0x1c')]?_[_0xbb10('0x1d')](_0x165fe9['include'],function(_0x2d52ea){return{'model':db[_0x2d52ea[_0xbb10('0x1e')]],'as':_0x2d52ea['as'],'attributes':_0x2d52ea[_0xbb10('0x1b')],'include':_0x2d52ea[_0xbb10('0x1c')]?_[_0xbb10('0x1d')](_0x2d52ea[_0xbb10('0x1c')],function(_0x174395){return{'model':db[_0x174395['model']],'as':_0x174395['as'],'attributes':_0x174395[_0xbb10('0x1b')]};}):[]};}):[]};}):[]:[]})[_0xbb10('0xc')](function(_0x30f3ea){var _0x322b41=[];for(var _0x37b20e=0x0;_0x37b20e<_0x30f3ea[_0xbb10('0x38')];_0x37b20e+=0x1){_0x322b41[_0xbb10('0x39')](_0x30f3ea[_0x37b20e][_0xbb10('0x25')](_0xd9e743['body'],{'transaction':_0x5bfc68}));}return BPromise[_0xbb10('0x44')](_0x322b41);});})[_0xbb10('0xc')](function(_0x145baf){logger['info']('GetContactRecallMe',_0xd9e743);logger['debug'](_0xbb10('0x43'),_0xd9e743,JSON['stringify'](_0x145baf));_0x260e06(_0x145baf);})['catch'](function(_0x1701c5){logger[_0xbb10('0x12')](_0xbb10('0x43'),_0x1701c5[_0xbb10('0x13')],_0xd9e743);_0x1ad2ed(_0x3a9677[_0xbb10('0x12')](0x1f4,_0x1701c5[_0xbb10('0x13')]));});});});};
\ No newline at end of file
diff --git a/server/api/cmHopper/index.js b/server/api/cmHopper/index.js
index 49d694c..a9b1e18 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 _0x288a=['isAuthenticated','/describe','/opencontacts','getOpenContacts','/:id','show','post','/preview','getPreview','put','update','delete','destroy','exports','util','path','connect-timeout','express','../../components/interaction/service','./cmHopper.controller','get'];(function(_0x2a0350,_0x249319){var _0x425220=function(_0x1d5f78){while(--_0x1d5f78){_0x2a0350['push'](_0x2a0350['shift']());}};_0x425220(++_0x249319);}(_0x288a,0x188));var _0xa288=function(_0x43458d,_0x4e7111){_0x43458d=_0x43458d-0x0;var _0x2483e2=_0x288a[_0x43458d];return _0x2483e2;};'use strict';var multer=require('multer');var util=require(_0xa288('0x0'));var path=require(_0xa288('0x1'));var timeout=require(_0xa288('0x2'));var express=require(_0xa288('0x3'));var router=express['Router']();var auth=require('../../components/auth/service');var interaction=require(_0xa288('0x4'));var config=require('../../config/environment');var controller=require(_0xa288('0x5'));router[_0xa288('0x6')]('/',auth[_0xa288('0x7')](),controller['index']);router[_0xa288('0x6')](_0xa288('0x8'),auth[_0xa288('0x7')](),controller['describe']);router[_0xa288('0x6')](_0xa288('0x9'),auth[_0xa288('0x7')](),controller[_0xa288('0xa')]);router[_0xa288('0x6')](_0xa288('0xb'),auth[_0xa288('0x7')](),controller[_0xa288('0xc')]);router['post']('/',auth['isAuthenticated'](),controller['create']);router[_0xa288('0xd')](_0xa288('0xe'),auth['isAuthenticated'](),controller[_0xa288('0xf')]);router[_0xa288('0x10')](_0xa288('0xb'),auth[_0xa288('0x7')](),controller[_0xa288('0x11')]);router[_0xa288('0x12')](_0xa288('0xb'),auth[_0xa288('0x7')](),controller[_0xa288('0x13')]);module[_0xa288('0x14')]=router;
\ No newline at end of file
+var _0xd0da=['../../config/environment','isAuthenticated','/describe','describe','get','getOpenContacts','/:id','show','post','create','/preview','getPreview','delete','destroy','exports','multer','util','path','connect-timeout','express','../../components/auth/service','../../components/interaction/service'];(function(_0x51fb42,_0x30b02a){var _0x447a5b=function(_0x16389a){while(--_0x16389a){_0x51fb42['push'](_0x51fb42['shift']());}};_0x447a5b(++_0x30b02a);}(_0xd0da,0x1b1));var _0xad0d=function(_0x38fbc2,_0x641aa1){_0x38fbc2=_0x38fbc2-0x0;var _0x43c7d4=_0xd0da[_0x38fbc2];return _0x43c7d4;};'use strict';var multer=require(_0xad0d('0x0'));var util=require(_0xad0d('0x1'));var path=require(_0xad0d('0x2'));var timeout=require(_0xad0d('0x3'));var express=require(_0xad0d('0x4'));var router=express['Router']();var auth=require(_0xad0d('0x5'));var interaction=require(_0xad0d('0x6'));var config=require(_0xad0d('0x7'));var controller=require('./cmHopper.controller');router['get']('/',auth[_0xad0d('0x8')](),controller['index']);router['get'](_0xad0d('0x9'),auth[_0xad0d('0x8')](),controller[_0xad0d('0xa')]);router[_0xad0d('0xb')]('/opencontacts',auth[_0xad0d('0x8')](),controller[_0xad0d('0xc')]);router[_0xad0d('0xb')](_0xad0d('0xd'),auth[_0xad0d('0x8')](),controller[_0xad0d('0xe')]);router[_0xad0d('0xf')]('/',auth[_0xad0d('0x8')](),controller[_0xad0d('0x10')]);router[_0xad0d('0xf')](_0xad0d('0x11'),auth[_0xad0d('0x8')](),controller[_0xad0d('0x12')]);router['put'](_0xad0d('0xd'),auth[_0xad0d('0x8')](),controller['update']);router[_0xad0d('0x13')](_0xad0d('0xd'),auth['isAuthenticated'](),controller[_0xad0d('0x14')]);module[_0xad0d('0x15')]=router;
\ No newline at end of file
diff --git a/server/api/cmHopperBlack/cmHopperBlack.attributes.js b/server/api/cmHopperBlack/cmHopperBlack.attributes.js
index a7ce939..e5909d5 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 _0xc28e=['contactListQueue','INTEGER','moment','STRING'];(function(_0x2d861b,_0x5c61ff){var _0xef921c=function(_0x132662){while(--_0x132662){_0x2d861b['push'](_0x2d861b['shift']());}};_0xef921c(++_0x5c61ff);}(_0xc28e,0xba));var _0xec28=function(_0x26b8b5,_0xf5c2c1){_0x26b8b5=_0x26b8b5-0x0;var _0x2150a9=_0xc28e[_0x26b8b5];return _0x2150a9;};'use strict';var moment=require(_0xec28('0x0'));var Sequelize=require('sequelize');module['exports']={'phone':{'type':Sequelize[_0xec28('0x1')],'allowNull':![]},'ContactId':{'type':Sequelize['INTEGER'],'unique':_0xec28('0x2')},'ListId':{'type':Sequelize[_0xec28('0x3')],'unique':_0xec28('0x2')},'VoiceQueueId':{'type':Sequelize[_0xec28('0x3')],'unique':_0xec28('0x2')}};
\ No newline at end of file
+var _0xaa68=['moment','exports','STRING','INTEGER','contactListQueue'];(function(_0x2e4aec,_0x478aea){var _0x5daecc=function(_0x4dae93){while(--_0x4dae93){_0x2e4aec['push'](_0x2e4aec['shift']());}};_0x5daecc(++_0x478aea);}(_0xaa68,0x11d));var _0x8aa6=function(_0x415a8d,_0x4e0526){_0x415a8d=_0x415a8d-0x0;var _0x73fc3b=_0xaa68[_0x415a8d];return _0x73fc3b;};'use strict';var moment=require(_0x8aa6('0x0'));var Sequelize=require('sequelize');module[_0x8aa6('0x1')]={'phone':{'type':Sequelize[_0x8aa6('0x2')],'allowNull':![]},'ContactId':{'type':Sequelize[_0x8aa6('0x3')],'unique':_0x8aa6('0x4')},'ListId':{'type':Sequelize[_0x8aa6('0x3')],'unique':_0x8aa6('0x4')},'VoiceQueueId':{'type':Sequelize['INTEGER'],'unique':_0x8aa6('0x4')}};
\ No newline at end of file
diff --git a/server/api/cmHopperBlack/cmHopperBlack.controller.js b/server/api/cmHopperBlack/cmHopperBlack.controller.js
index 75fb26f..bf4d383 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 _0x9c9b=['rawAttributes','fieldName','key','model','query','keys','filters','attributes','fields','length','hasOwnProperty','order','sort','pick','where','merge','type','VIRTUAL','name','filter','options','count','includeAll','include','findAll','rows','catch','show','params','intersection','find','body','destroy','describe','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','bluebird','mustache','to-csv','ejs','lodash','squel','crypto','jsforce','desk.js','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../config/logger','api','../../config/utils','../../config/environment','../../mysqldb','sendStatus','end','status','json','offset','limit','apply','reject','save','update','then','stack','send','index','map','CmHopperBlack'];(function(_0x297fd3,_0x115406){var _0x2af381=function(_0x1dd31b){while(--_0x1dd31b){_0x297fd3['push'](_0x297fd3['shift']());}};_0x2af381(++_0x115406);}(_0x9c9b,0x194));var _0xb9c9=function(_0x602ca7,_0x4975cc){_0x602ca7=_0x602ca7-0x0;var _0xca1e03=_0x9c9b[_0x602ca7];return _0xca1e03;};'use strict';var pdf=require('html-pdf');var emlformat=require(_0xb9c9('0x0'));var rimraf=require(_0xb9c9('0x1'));var zipdir=require(_0xb9c9('0x2'));var jsonpatch=require(_0xb9c9('0x3'));var rp=require(_0xb9c9('0x4'));var moment=require('moment');var BPromise=require(_0xb9c9('0x5'));var Mustache=require(_0xb9c9('0x6'));var util=require('util');var path=require('path');var sox=require('sox');var csv=require(_0xb9c9('0x7'));var ejs=require(_0xb9c9('0x8'));var fs=require('fs');var _=require(_0xb9c9('0x9'));var squel=require(_0xb9c9('0xa'));var crypto=require(_0xb9c9('0xb'));var jsforce=require(_0xb9c9('0xc'));var deskjs=require(_0xb9c9('0xd'));var toCsv=require(_0xb9c9('0x7'));var querystring=require(_0xb9c9('0xe'));var Papa=require(_0xb9c9('0xf'));var Redis=require(_0xb9c9('0x10'));var authService=require(_0xb9c9('0x11'));var qs=require(_0xb9c9('0x12'));var as=require('../../components/parsers/advancedSearch');var hardwareService=require('../../config/license/hardware');var logger=require(_0xb9c9('0x13'))(_0xb9c9('0x14'));var utils=require(_0xb9c9('0x15'));var config=require(_0xb9c9('0x16'));var db=require(_0xb9c9('0x17'))['db'];function respondWithStatusCode(_0x5a2153,_0x4ff664){_0x4ff664=_0x4ff664||0xcc;return function(_0x5ce530){if(_0x5ce530){return _0x5a2153[_0xb9c9('0x18')](_0x4ff664);}return _0x5a2153['status'](_0x4ff664)[_0xb9c9('0x19')]();};}function respondWithResult(_0xc46ca3,_0x4d1566){_0x4d1566=_0x4d1566||0xc8;return function(_0x5e0372){if(_0x5e0372){return _0xc46ca3[_0xb9c9('0x1a')](_0x4d1566)[_0xb9c9('0x1b')](_0x5e0372);}};}function respondWithFilteredResult(_0x40e6a4,_0x54721e){return function(_0x10d8ed){if(_0x10d8ed){var _0x1af04b=_0x10d8ed['count'],_0xf55953=_0x54721e[_0xb9c9('0x1c')],_0xf48fa6=_0x54721e[_0xb9c9('0x1c')]+_0x54721e[_0xb9c9('0x1d')],_0x13abaf;if(_0xf48fa6>=_0x1af04b){_0xf48fa6=_0x1af04b;_0x13abaf=0xc8;}else{_0x13abaf=0xce;}_0x40e6a4['status'](_0x13abaf);return _0x40e6a4['set']('Content-Range',_0xf55953+'-'+_0xf48fa6+'/'+_0x1af04b)['json'](_0x10d8ed);}return null;};}function patchUpdates(_0x9ff31e){return function(_0x5fbeac){try{jsonpatch[_0xb9c9('0x1e')](_0x5fbeac,_0x9ff31e,!![]);}catch(_0x31a410){return BPromise[_0xb9c9('0x1f')](_0x31a410);}return _0x5fbeac[_0xb9c9('0x20')]();};}function saveUpdates(_0x1836b6,_0x2faa66){return function(_0x380a42){if(_0x380a42){return _0x380a42[_0xb9c9('0x21')](_0x1836b6)[_0xb9c9('0x22')](function(_0x130d40){return _0x130d40;});}return null;};}function removeEntity(_0x6849d2,_0x50e227){return function(_0xbdbb51){if(_0xbdbb51){return _0xbdbb51['destroy']()[_0xb9c9('0x22')](function(){_0x6849d2[_0xb9c9('0x1a')](0xcc)[_0xb9c9('0x19')]();});}};}function handleEntityNotFound(_0x292f41,_0x46379d){return function(_0x50e5f0){if(!_0x50e5f0){_0x292f41[_0xb9c9('0x18')](0x194);}return _0x50e5f0;};}function handleError(_0x2d5b58,_0x2150d9){_0x2150d9=_0x2150d9||0x1f4;return function(_0x14c123){logger['error'](_0x14c123[_0xb9c9('0x23')]);if(_0x14c123['name']){delete _0x14c123['name'];}_0x2d5b58['status'](_0x2150d9)[_0xb9c9('0x24')](_0x14c123);};}exports[_0xb9c9('0x25')]=function(_0x2c7628,_0x4e8152){var _0xe3198c={},_0x139b84={},_0xdf8e50={'count':0x0,'rows':[]};var _0x114f79=_[_0xb9c9('0x26')](db[_0xb9c9('0x27')][_0xb9c9('0x28')],function(_0x45f88e){return{'name':_0x45f88e[_0xb9c9('0x29')],'type':_0x45f88e['type'][_0xb9c9('0x2a')]};});_0x139b84[_0xb9c9('0x2b')]=_[_0xb9c9('0x26')](_0x114f79,'name');_0x139b84[_0xb9c9('0x2c')]=_[_0xb9c9('0x2d')](_0x2c7628[_0xb9c9('0x2c')]);_0x139b84[_0xb9c9('0x2e')]=_['intersection'](_0x139b84[_0xb9c9('0x2b')],_0x139b84[_0xb9c9('0x2c')]);_0xe3198c[_0xb9c9('0x2f')]=_['intersection'](_0x139b84[_0xb9c9('0x2b')],qs[_0xb9c9('0x30')](_0x2c7628[_0xb9c9('0x2c')][_0xb9c9('0x30')]));_0xe3198c[_0xb9c9('0x2f')]=_0xe3198c[_0xb9c9('0x2f')][_0xb9c9('0x31')]?_0xe3198c[_0xb9c9('0x2f')]:_0x139b84[_0xb9c9('0x2b')];if(!_0x2c7628[_0xb9c9('0x2c')][_0xb9c9('0x32')]('nolimit')){_0xe3198c[_0xb9c9('0x1d')]=qs['limit'](_0x2c7628[_0xb9c9('0x2c')]['limit']);_0xe3198c[_0xb9c9('0x1c')]=qs[_0xb9c9('0x1c')](_0x2c7628[_0xb9c9('0x2c')][_0xb9c9('0x1c')]);}_0xe3198c[_0xb9c9('0x33')]=qs['sort'](_0x2c7628[_0xb9c9('0x2c')][_0xb9c9('0x34')]);_0xe3198c['where']=qs[_0xb9c9('0x2e')](_[_0xb9c9('0x35')](_0x2c7628[_0xb9c9('0x2c')],_0x139b84[_0xb9c9('0x2e')]));if(_0x2c7628[_0xb9c9('0x2c')]['filter']){_0xe3198c[_0xb9c9('0x36')]=_[_0xb9c9('0x37')](_0xe3198c[_0xb9c9('0x36')],{'$or':_[_0xb9c9('0x26')](_0x114f79,function(_0x448bfc){if(_0x448bfc[_0xb9c9('0x38')]!==_0xb9c9('0x39')){var _0x27e027={};_0x27e027[_0x448bfc[_0xb9c9('0x3a')]]={'$like':'%'+_0x2c7628['query'][_0xb9c9('0x3b')]+'%'};return _0x27e027;}})});}_0xe3198c=_[_0xb9c9('0x37')]({},_0xe3198c,_0x2c7628[_0xb9c9('0x3c')]);var _0x2774da={'where':_0xe3198c['where']};return db[_0xb9c9('0x27')][_0xb9c9('0x3d')](_0x2774da)['then'](function(_0x558222){_0xdf8e50[_0xb9c9('0x3d')]=_0x558222;if(_0x2c7628[_0xb9c9('0x2c')][_0xb9c9('0x3e')]){_0xe3198c[_0xb9c9('0x3f')]=[{'all':!![]}];}return db[_0xb9c9('0x27')][_0xb9c9('0x40')](_0xe3198c);})[_0xb9c9('0x22')](function(_0x5bbab5){_0xdf8e50[_0xb9c9('0x41')]=_0x5bbab5;return _0xdf8e50;})[_0xb9c9('0x22')](respondWithFilteredResult(_0x4e8152,_0xe3198c))[_0xb9c9('0x42')](handleError(_0x4e8152,null));};exports[_0xb9c9('0x43')]=function(_0x21b9a2,_0x22181e){var _0x9e4918={'raw':!![],'where':{'id':_0x21b9a2[_0xb9c9('0x44')]['id']}},_0x3c0c98={};_0x3c0c98[_0xb9c9('0x2b')]=_[_0xb9c9('0x2d')](db[_0xb9c9('0x27')][_0xb9c9('0x28')]);_0x3c0c98['query']=_[_0xb9c9('0x2d')](_0x21b9a2[_0xb9c9('0x2c')]);_0x3c0c98[_0xb9c9('0x2e')]=_['intersection'](_0x3c0c98[_0xb9c9('0x2b')],_0x3c0c98['query']);_0x9e4918[_0xb9c9('0x2f')]=_[_0xb9c9('0x45')](_0x3c0c98['model'],qs[_0xb9c9('0x30')](_0x21b9a2[_0xb9c9('0x2c')][_0xb9c9('0x30')]));_0x9e4918[_0xb9c9('0x2f')]=_0x9e4918[_0xb9c9('0x2f')][_0xb9c9('0x31')]?_0x9e4918['attributes']:_0x3c0c98['model'];if(_0x21b9a2['query'][_0xb9c9('0x3e')]){_0x9e4918[_0xb9c9('0x3f')]=[{'all':!![]}];}_0x9e4918=_['merge']({},_0x9e4918,_0x21b9a2[_0xb9c9('0x3c')]);return db[_0xb9c9('0x27')][_0xb9c9('0x46')](_0x9e4918)[_0xb9c9('0x22')](handleEntityNotFound(_0x22181e,null))[_0xb9c9('0x22')](respondWithResult(_0x22181e,null))[_0xb9c9('0x42')](handleError(_0x22181e,null));};exports[_0xb9c9('0x21')]=function(_0x4f68e7,_0x413717){if(_0x4f68e7[_0xb9c9('0x47')]['id']){delete _0x4f68e7[_0xb9c9('0x47')]['id'];}return db[_0xb9c9('0x27')][_0xb9c9('0x46')]({'where':{'id':_0x4f68e7[_0xb9c9('0x44')]['id']}})[_0xb9c9('0x22')](handleEntityNotFound(_0x413717,null))[_0xb9c9('0x22')](saveUpdates(_0x4f68e7[_0xb9c9('0x47')],null))[_0xb9c9('0x22')](respondWithResult(_0x413717,null))['catch'](handleError(_0x413717,null));};exports[_0xb9c9('0x48')]=function(_0x4cd22e,_0x6d0182){return db[_0xb9c9('0x27')][_0xb9c9('0x46')]({'where':{'id':_0x4cd22e['params']['id']}})['then'](handleEntityNotFound(_0x6d0182,null))['then'](removeEntity(_0x6d0182,null))[_0xb9c9('0x42')](handleError(_0x6d0182,null));};exports['describe']=function(_0x5a2d2a,_0x57dd16){return db['CmHopperBlack'][_0xb9c9('0x49')]()['then'](respondWithResult(_0x57dd16,null))[_0xb9c9('0x42')](handleError(_0x57dd16,null));};
\ No newline at end of file
+var _0x86dc=['status','end','json','count','offset','limit','set','apply','reject','save','update','then','error','name','index','map','rawAttributes','key','model','query','keys','attributes','intersection','length','hasOwnProperty','nolimit','order','sort','where','pick','filters','filter','merge','VIRTUAL','options','include','CmHopperBlack','findAll','rows','catch','fields','includeAll','find','body','params','describe','html-pdf','zip-dir','fast-json-patch','request-promise','moment','mustache','path','to-csv','ejs','lodash','crypto','desk.js','ioredis','../../components/auth/service','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/environment','../../mysqldb','sendStatus'];(function(_0x333928,_0x20e19e){var _0x1ed238=function(_0x2cee2a){while(--_0x2cee2a){_0x333928['push'](_0x333928['shift']());}};_0x1ed238(++_0x20e19e);}(_0x86dc,0x13e));var _0xc86d=function(_0x4a1bec,_0x30a2e5){_0x4a1bec=_0x4a1bec-0x0;var _0x117ecc=_0x86dc[_0x4a1bec];return _0x117ecc;};'use strict';var pdf=require(_0xc86d('0x0'));var emlformat=require('eml-format');var rimraf=require('rimraf');var zipdir=require(_0xc86d('0x1'));var jsonpatch=require(_0xc86d('0x2'));var rp=require(_0xc86d('0x3'));var moment=require(_0xc86d('0x4'));var BPromise=require('bluebird');var Mustache=require(_0xc86d('0x5'));var util=require('util');var path=require(_0xc86d('0x6'));var sox=require('sox');var csv=require(_0xc86d('0x7'));var ejs=require(_0xc86d('0x8'));var fs=require('fs');var _=require(_0xc86d('0x9'));var squel=require('squel');var crypto=require(_0xc86d('0xa'));var jsforce=require('jsforce');var deskjs=require(_0xc86d('0xb'));var toCsv=require(_0xc86d('0x7'));var querystring=require('querystring');var Papa=require('papaparse');var Redis=require(_0xc86d('0xc'));var authService=require(_0xc86d('0xd'));var qs=require('../../components/parsers/qs');var as=require(_0xc86d('0xe'));var hardwareService=require(_0xc86d('0xf'));var logger=require(_0xc86d('0x10'))(_0xc86d('0x11'));var utils=require(_0xc86d('0x12'));var config=require(_0xc86d('0x13'));var db=require(_0xc86d('0x14'))['db'];function respondWithStatusCode(_0x2a5900,_0x299776){_0x299776=_0x299776||0xcc;return function(_0x38abd7){if(_0x38abd7){return _0x2a5900[_0xc86d('0x15')](_0x299776);}return _0x2a5900[_0xc86d('0x16')](_0x299776)[_0xc86d('0x17')]();};}function respondWithResult(_0xccef31,_0x450fb1){_0x450fb1=_0x450fb1||0xc8;return function(_0x2a963c){if(_0x2a963c){return _0xccef31[_0xc86d('0x16')](_0x450fb1)[_0xc86d('0x18')](_0x2a963c);}};}function respondWithFilteredResult(_0x2bc469,_0x24c9c3){return function(_0x199a4a){if(_0x199a4a){var _0x5e58aa=_0x199a4a[_0xc86d('0x19')],_0x4fb8e7=_0x24c9c3[_0xc86d('0x1a')],_0x49af1f=_0x24c9c3[_0xc86d('0x1a')]+_0x24c9c3[_0xc86d('0x1b')],_0x3a253c;if(_0x49af1f>=_0x5e58aa){_0x49af1f=_0x5e58aa;_0x3a253c=0xc8;}else{_0x3a253c=0xce;}_0x2bc469[_0xc86d('0x16')](_0x3a253c);return _0x2bc469[_0xc86d('0x1c')]('Content-Range',_0x4fb8e7+'-'+_0x49af1f+'/'+_0x5e58aa)['json'](_0x199a4a);}return null;};}function patchUpdates(_0x275f57){return function(_0x2dcf09){try{jsonpatch[_0xc86d('0x1d')](_0x2dcf09,_0x275f57,!![]);}catch(_0x56f510){return BPromise[_0xc86d('0x1e')](_0x56f510);}return _0x2dcf09[_0xc86d('0x1f')]();};}function saveUpdates(_0x4f1efc,_0x4eb0e5){return function(_0x330c70){if(_0x330c70){return _0x330c70[_0xc86d('0x20')](_0x4f1efc)['then'](function(_0x34bb85){return _0x34bb85;});}return null;};}function removeEntity(_0x1adaaa,_0x3a4abb){return function(_0x27ebd8){if(_0x27ebd8){return _0x27ebd8['destroy']()[_0xc86d('0x21')](function(){_0x1adaaa[_0xc86d('0x16')](0xcc)[_0xc86d('0x17')]();});}};}function handleEntityNotFound(_0x1bb9ed,_0xbeed40){return function(_0x56278d){if(!_0x56278d){_0x1bb9ed[_0xc86d('0x15')](0x194);}return _0x56278d;};}function handleError(_0x419afa,_0x41de64){_0x41de64=_0x41de64||0x1f4;return function(_0xd59e7b){logger[_0xc86d('0x22')](_0xd59e7b['stack']);if(_0xd59e7b[_0xc86d('0x23')]){delete _0xd59e7b['name'];}_0x419afa['status'](_0x41de64)['send'](_0xd59e7b);};}exports[_0xc86d('0x24')]=function(_0x3948c4,_0x273c5a){var _0x1e29be={},_0xd8b255={},_0x1ad978={'count':0x0,'rows':[]};var _0x2fabc0=_[_0xc86d('0x25')](db['CmHopperBlack'][_0xc86d('0x26')],function(_0x2bce7b){return{'name':_0x2bce7b['fieldName'],'type':_0x2bce7b['type'][_0xc86d('0x27')]};});_0xd8b255[_0xc86d('0x28')]=_[_0xc86d('0x25')](_0x2fabc0,_0xc86d('0x23'));_0xd8b255[_0xc86d('0x29')]=_[_0xc86d('0x2a')](_0x3948c4[_0xc86d('0x29')]);_0xd8b255['filters']=_['intersection'](_0xd8b255[_0xc86d('0x28')],_0xd8b255[_0xc86d('0x29')]);_0x1e29be[_0xc86d('0x2b')]=_[_0xc86d('0x2c')](_0xd8b255[_0xc86d('0x28')],qs['fields'](_0x3948c4[_0xc86d('0x29')]['fields']));_0x1e29be[_0xc86d('0x2b')]=_0x1e29be[_0xc86d('0x2b')][_0xc86d('0x2d')]?_0x1e29be[_0xc86d('0x2b')]:_0xd8b255[_0xc86d('0x28')];if(!_0x3948c4[_0xc86d('0x29')][_0xc86d('0x2e')](_0xc86d('0x2f'))){_0x1e29be[_0xc86d('0x1b')]=qs['limit'](_0x3948c4['query']['limit']);_0x1e29be['offset']=qs['offset'](_0x3948c4['query'][_0xc86d('0x1a')]);}_0x1e29be[_0xc86d('0x30')]=qs[_0xc86d('0x31')](_0x3948c4[_0xc86d('0x29')][_0xc86d('0x31')]);_0x1e29be[_0xc86d('0x32')]=qs['filters'](_[_0xc86d('0x33')](_0x3948c4[_0xc86d('0x29')],_0xd8b255[_0xc86d('0x34')]));if(_0x3948c4[_0xc86d('0x29')][_0xc86d('0x35')]){_0x1e29be[_0xc86d('0x32')]=_[_0xc86d('0x36')](_0x1e29be[_0xc86d('0x32')],{'$or':_[_0xc86d('0x25')](_0x2fabc0,function(_0x2f600f){if(_0x2f600f['type']!==_0xc86d('0x37')){var _0x5b2df9={};_0x5b2df9[_0x2f600f[_0xc86d('0x23')]]={'$like':'%'+_0x3948c4[_0xc86d('0x29')][_0xc86d('0x35')]+'%'};return _0x5b2df9;}})});}_0x1e29be=_['merge']({},_0x1e29be,_0x3948c4[_0xc86d('0x38')]);var _0x3ba673={'where':_0x1e29be[_0xc86d('0x32')]};return db['CmHopperBlack'][_0xc86d('0x19')](_0x3ba673)[_0xc86d('0x21')](function(_0x10c565){_0x1ad978[_0xc86d('0x19')]=_0x10c565;if(_0x3948c4[_0xc86d('0x29')]['includeAll']){_0x1e29be[_0xc86d('0x39')]=[{'all':!![]}];}return db[_0xc86d('0x3a')][_0xc86d('0x3b')](_0x1e29be);})[_0xc86d('0x21')](function(_0x3bd5ce){_0x1ad978[_0xc86d('0x3c')]=_0x3bd5ce;return _0x1ad978;})['then'](respondWithFilteredResult(_0x273c5a,_0x1e29be))[_0xc86d('0x3d')](handleError(_0x273c5a,null));};exports['show']=function(_0x2023b5,_0x23deca){var _0x39bdc7={'raw':!![],'where':{'id':_0x2023b5['params']['id']}},_0x2e5971={};_0x2e5971['model']=_['keys'](db[_0xc86d('0x3a')][_0xc86d('0x26')]);_0x2e5971[_0xc86d('0x29')]=_[_0xc86d('0x2a')](_0x2023b5['query']);_0x2e5971[_0xc86d('0x34')]=_[_0xc86d('0x2c')](_0x2e5971[_0xc86d('0x28')],_0x2e5971[_0xc86d('0x29')]);_0x39bdc7[_0xc86d('0x2b')]=_['intersection'](_0x2e5971[_0xc86d('0x28')],qs[_0xc86d('0x3e')](_0x2023b5[_0xc86d('0x29')][_0xc86d('0x3e')]));_0x39bdc7['attributes']=_0x39bdc7[_0xc86d('0x2b')]['length']?_0x39bdc7['attributes']:_0x2e5971[_0xc86d('0x28')];if(_0x2023b5['query'][_0xc86d('0x3f')]){_0x39bdc7[_0xc86d('0x39')]=[{'all':!![]}];}_0x39bdc7=_[_0xc86d('0x36')]({},_0x39bdc7,_0x2023b5[_0xc86d('0x38')]);return db['CmHopperBlack'][_0xc86d('0x40')](_0x39bdc7)[_0xc86d('0x21')](handleEntityNotFound(_0x23deca,null))[_0xc86d('0x21')](respondWithResult(_0x23deca,null))['catch'](handleError(_0x23deca,null));};exports['update']=function(_0x2e2c3,_0x4b41ec){if(_0x2e2c3[_0xc86d('0x41')]['id']){delete _0x2e2c3[_0xc86d('0x41')]['id'];}return db[_0xc86d('0x3a')]['find']({'where':{'id':_0x2e2c3['params']['id']}})[_0xc86d('0x21')](handleEntityNotFound(_0x4b41ec,null))[_0xc86d('0x21')](saveUpdates(_0x2e2c3[_0xc86d('0x41')],null))['then'](respondWithResult(_0x4b41ec,null))[_0xc86d('0x3d')](handleError(_0x4b41ec,null));};exports['destroy']=function(_0x280298,_0x2e9fc3){return db['CmHopperBlack'][_0xc86d('0x40')]({'where':{'id':_0x280298[_0xc86d('0x42')]['id']}})['then'](handleEntityNotFound(_0x2e9fc3,null))[_0xc86d('0x21')](removeEntity(_0x2e9fc3,null))['catch'](handleError(_0x2e9fc3,null));};exports[_0xc86d('0x43')]=function(_0x44f29,_0x47474a){return db['CmHopperBlack']['describe']()[_0xc86d('0x21')](respondWithResult(_0x47474a,null))[_0xc86d('0x3d')](handleError(_0x47474a,null));};
\ No newline at end of file
diff --git a/server/api/cmHopperBlack/cmHopperBlack.model.js b/server/api/cmHopperBlack/cmHopperBlack.model.js
index 735bdf7..2e11705 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 _0xb4c3=['bluebird','request-promise','path','../../config/environment','exports','cm_hopper_black','lodash','util','api','moment'];(function(_0x293780,_0x1bb34f){var _0x618665=function(_0x4207b2){while(--_0x4207b2){_0x293780['push'](_0x293780['shift']());}};_0x618665(++_0x1bb34f);}(_0xb4c3,0x16e));var _0x3b4c=function(_0x339924,_0x2c8059){_0x339924=_0x339924-0x0;var _0x3f86de=_0xb4c3[_0x339924];return _0x3f86de;};'use strict';var _=require(_0x3b4c('0x0'));var util=require(_0x3b4c('0x1'));var logger=require('../../config/logger')(_0x3b4c('0x2'));var moment=require(_0x3b4c('0x3'));var BPromise=require(_0x3b4c('0x4'));var rp=require(_0x3b4c('0x5'));var fs=require('fs');var path=require(_0x3b4c('0x6'));var rimraf=require('rimraf');var config=require(_0x3b4c('0x7'));var attributes=require('./cmHopperBlack.attributes');module[_0x3b4c('0x8')]=function(_0x350575,_0x90643a){return _0x350575['define']('CmHopperBlack',attributes,{'tableName':_0x3b4c('0x9'),'paranoid':![],'indexes':[],'timestamps':!![]});};
\ No newline at end of file
+var _0xd59c=['api','bluebird','request-promise','path','rimraf','../../config/environment','./cmHopperBlack.attributes','exports','CmHopperBlack','lodash','util','../../config/logger'];(function(_0x1126b6,_0x15b2ca){var _0x33fb44=function(_0xd349a8){while(--_0xd349a8){_0x1126b6['push'](_0x1126b6['shift']());}};_0x33fb44(++_0x15b2ca);}(_0xd59c,0xd5));var _0xcd59=function(_0x55a998,_0x51d195){_0x55a998=_0x55a998-0x0;var _0x94891f=_0xd59c[_0x55a998];return _0x94891f;};'use strict';var _=require(_0xcd59('0x0'));var util=require(_0xcd59('0x1'));var logger=require(_0xcd59('0x2'))(_0xcd59('0x3'));var moment=require('moment');var BPromise=require(_0xcd59('0x4'));var rp=require(_0xcd59('0x5'));var fs=require('fs');var path=require(_0xcd59('0x6'));var rimraf=require(_0xcd59('0x7'));var config=require(_0xcd59('0x8'));var attributes=require(_0xcd59('0x9'));module[_0xcd59('0xa')]=function(_0x35ea1f,_0x3dfd88){return _0x35ea1f['define'](_0xcd59('0xb'),attributes,{'tableName':'cm_hopper_black','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 c2ecb19..cf9601b 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 _0x9121=['client','http','request','then','info','request\x20sent','error','code','CmHopperBlack,\x20%s,\x20%s','message','result','catch','GetCmHopperBlack','CmHopperBlack','findAll','options','raw','where','limit','include','map','attributes','model','debug','UpdateCmHopperBlack','stringify','DestroyCmHopperBlack','destroy','lodash','util','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','rpc','../../config/environment','jayson/promise'];(function(_0x3fd750,_0x120661){var _0x4f15d9=function(_0x3181b8){while(--_0x3181b8){_0x3fd750['push'](_0x3fd750['shift']());}};_0x4f15d9(++_0x120661);}(_0x9121,0x91));var _0x1912=function(_0x164e33,_0x60026){_0x164e33=_0x164e33-0x0;var _0x3b9eb5=_0x9121[_0x164e33];return _0x3b9eb5;};'use strict';var _=require(_0x1912('0x0'));var util=require(_0x1912('0x1'));var moment=require(_0x1912('0x2'));var BPromise=require(_0x1912('0x3'));var rs=require(_0x1912('0x4'));var fs=require('fs');var Redis=require(_0x1912('0x5'));var db=require(_0x1912('0x6'))['db'];var utils=require(_0x1912('0x7'));var logger=require('../../config/logger')(_0x1912('0x8'));var config=require(_0x1912('0x9'));var jayson=require(_0x1912('0xa'));var client=jayson[_0x1912('0xb')][_0x1912('0xc')]({'port':0x232a});function respondWithRpcPromise(_0x8d841c,_0x535ec1,_0x5f39f6){return new BPromise(function(_0x1695d6,_0x2dd968){return client[_0x1912('0xd')](_0x8d841c,_0x5f39f6)[_0x1912('0xe')](function(_0x3fd864){logger[_0x1912('0xf')]('CmHopperBlack,\x20%s,\x20%s',_0x535ec1,_0x1912('0x10'));logger['debug']('CmHopperBlack,\x20%s,\x20%s,\x20%s',_0x535ec1,'request\x20sent',JSON['stringify'](_0x3fd864));if(_0x3fd864[_0x1912('0x11')]){if(_0x3fd864['error'][_0x1912('0x12')]===0x1f4){logger['error'](_0x1912('0x13'),_0x535ec1,_0x3fd864[_0x1912('0x11')][_0x1912('0x14')]);return _0x2dd968(_0x3fd864[_0x1912('0x11')][_0x1912('0x14')]);}logger[_0x1912('0x11')]('CmHopperBlack,\x20%s,\x20%s',_0x535ec1,_0x3fd864['error'][_0x1912('0x14')]);return _0x1695d6(_0x3fd864[_0x1912('0x11')][_0x1912('0x14')]);}else{logger['info'](_0x1912('0x13'),_0x535ec1,_0x1912('0x10'));_0x1695d6(_0x3fd864[_0x1912('0x15')][_0x1912('0x14')]);}})[_0x1912('0x16')](function(_0x5e7b7e){logger[_0x1912('0x11')](_0x1912('0x13'),_0x535ec1,_0x5e7b7e);_0x2dd968(_0x5e7b7e);});});}exports[_0x1912('0x17')]=function(_0x5d9deb){var _0x41cc1b=this;return new Promise(function(_0x16b85d,_0x387ac4){return db[_0x1912('0x18')][_0x1912('0x19')]({'raw':_0x5d9deb[_0x1912('0x1a')]?_0x5d9deb[_0x1912('0x1a')][_0x1912('0x1b')]===undefined?!![]:![]:!![],'where':_0x5d9deb[_0x1912('0x1a')]?_0x5d9deb[_0x1912('0x1a')][_0x1912('0x1c')]||null:null,'attributes':_0x5d9deb[_0x1912('0x1a')]?_0x5d9deb[_0x1912('0x1a')]['attributes']||null:null,'limit':_0x5d9deb[_0x1912('0x1a')]?_0x5d9deb[_0x1912('0x1a')][_0x1912('0x1d')]||null:null,'include':_0x5d9deb[_0x1912('0x1a')]?_0x5d9deb[_0x1912('0x1a')][_0x1912('0x1e')]?_[_0x1912('0x1f')](_0x5d9deb[_0x1912('0x1a')]['include'],function(_0x549e26){return{'model':db[_0x549e26['model']],'as':_0x549e26['as'],'attributes':_0x549e26[_0x1912('0x20')],'include':_0x549e26[_0x1912('0x1e')]?_[_0x1912('0x1f')](_0x549e26[_0x1912('0x1e')],function(_0x2daa50){return{'model':db[_0x2daa50[_0x1912('0x21')]],'as':_0x2daa50['as'],'attributes':_0x2daa50[_0x1912('0x20')],'include':_0x2daa50[_0x1912('0x1e')]?_[_0x1912('0x1f')](_0x2daa50[_0x1912('0x1e')],function(_0x48dc04){return{'model':db[_0x48dc04[_0x1912('0x21')]],'as':_0x48dc04['as'],'attributes':_0x48dc04['attributes']};}):[]};}):[]};}):[]:[]})[_0x1912('0xe')](function(_0x2d9bad){logger[_0x1912('0xf')]('GetCmHopperBlack',_0x5d9deb);logger[_0x1912('0x22')](_0x1912('0x17'),_0x5d9deb,JSON['stringify'](_0x2d9bad));_0x16b85d(_0x2d9bad);})[_0x1912('0x16')](function(_0x7752b4){logger[_0x1912('0x11')](_0x1912('0x17'),_0x7752b4[_0x1912('0x14')],_0x5d9deb);_0x387ac4(_0x41cc1b['error'](0x1f4,_0x7752b4[_0x1912('0x14')]));});});};exports[_0x1912('0x23')]=function(_0x114322){var _0x5287d4=this;return new Promise(function(_0x28f66a,_0x57ae10){return db[_0x1912('0x18')]['update'](_0x114322['body'],{'raw':_0x114322[_0x1912('0x1a')]?_0x114322[_0x1912('0x1a')][_0x1912('0x1b')]===undefined?!![]:![]:!![],'individualHooks':!![],'where':_0x114322[_0x1912('0x1a')]?_0x114322[_0x1912('0x1a')][_0x1912('0x1c')]||null:null,'attributes':_0x114322['options']?_0x114322['options'][_0x1912('0x20')]||null:null,'limit':_0x114322[_0x1912('0x1a')]?_0x114322['options'][_0x1912('0x1d')]||null:null})[_0x1912('0xe')](function(_0x2596f5){logger[_0x1912('0xf')]('UpdateCmHopperBlack',_0x114322);logger[_0x1912('0x22')](_0x1912('0x23'),_0x114322,JSON[_0x1912('0x24')](_0x2596f5));_0x28f66a(_0x2596f5);})[_0x1912('0x16')](function(_0x36f0c1){logger['error'](_0x1912('0x23'),_0x36f0c1['message'],_0x114322);_0x57ae10(_0x5287d4['error'](0x1f4,_0x36f0c1['message']));});});};exports[_0x1912('0x25')]=function(_0x4f4a52){var _0x14363b=this;return new Promise(function(_0x1d8984,_0x45a4b1){return db['CmHopperBlack'][_0x1912('0x26')]({'where':_0x4f4a52[_0x1912('0x1a')]?_0x4f4a52[_0x1912('0x1a')]['where']||null:null})[_0x1912('0xe')](function(_0x5e93a3){logger[_0x1912('0xf')](_0x1912('0x25'),_0x4f4a52);logger['debug'](_0x1912('0x25'),_0x4f4a52,JSON['stringify'](_0x5e93a3));_0x1d8984(_0x5e93a3);})[_0x1912('0x16')](function(_0x10b829){logger[_0x1912('0x11')](_0x1912('0x25'),_0x10b829[_0x1912('0x14')],_0x4f4a52);_0x45a4b1(_0x14363b['error'](0x1f4,_0x10b829[_0x1912('0x14')]));});});};
\ No newline at end of file
+var _0xc916=['model','stringify','UpdateCmHopperBlack','body','where','DestroyCmHopperBlack','destroy','lodash','util','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','rpc','../../config/environment','jayson/promise','client','then','info','CmHopperBlack,\x20%s,\x20%s','request\x20sent','debug','error','code','message','result','catch','GetCmHopperBlack','CmHopperBlack','findAll','options','raw','attributes','include','map'];(function(_0x20a584,_0xe384a5){var _0x4b41a8=function(_0x2127c6){while(--_0x2127c6){_0x20a584['push'](_0x20a584['shift']());}};_0x4b41a8(++_0xe384a5);}(_0xc916,0x12f));var _0x6c91=function(_0x55f8b4,_0x43f30d){_0x55f8b4=_0x55f8b4-0x0;var _0x2475f9=_0xc916[_0x55f8b4];return _0x2475f9;};'use strict';var _=require(_0x6c91('0x0'));var util=require(_0x6c91('0x1'));var moment=require(_0x6c91('0x2'));var BPromise=require(_0x6c91('0x3'));var rs=require(_0x6c91('0x4'));var fs=require('fs');var Redis=require(_0x6c91('0x5'));var db=require(_0x6c91('0x6'))['db'];var utils=require(_0x6c91('0x7'));var logger=require('../../config/logger')(_0x6c91('0x8'));var config=require(_0x6c91('0x9'));var jayson=require(_0x6c91('0xa'));var client=jayson[_0x6c91('0xb')]['http']({'port':0x232a});function respondWithRpcPromise(_0x30c961,_0xb607f5,_0x2693ec){return new BPromise(function(_0x19d2d4,_0x3d402d){return client['request'](_0x30c961,_0x2693ec)[_0x6c91('0xc')](function(_0x4a16f2){logger[_0x6c91('0xd')](_0x6c91('0xe'),_0xb607f5,_0x6c91('0xf'));logger[_0x6c91('0x10')]('CmHopperBlack,\x20%s,\x20%s,\x20%s',_0xb607f5,_0x6c91('0xf'),JSON['stringify'](_0x4a16f2));if(_0x4a16f2[_0x6c91('0x11')]){if(_0x4a16f2['error'][_0x6c91('0x12')]===0x1f4){logger[_0x6c91('0x11')](_0x6c91('0xe'),_0xb607f5,_0x4a16f2['error'][_0x6c91('0x13')]);return _0x3d402d(_0x4a16f2['error'][_0x6c91('0x13')]);}logger[_0x6c91('0x11')](_0x6c91('0xe'),_0xb607f5,_0x4a16f2['error'][_0x6c91('0x13')]);return _0x19d2d4(_0x4a16f2[_0x6c91('0x11')][_0x6c91('0x13')]);}else{logger['info'](_0x6c91('0xe'),_0xb607f5,_0x6c91('0xf'));_0x19d2d4(_0x4a16f2[_0x6c91('0x14')][_0x6c91('0x13')]);}})[_0x6c91('0x15')](function(_0x1c99e2){logger['error'](_0x6c91('0xe'),_0xb607f5,_0x1c99e2);_0x3d402d(_0x1c99e2);});});}exports[_0x6c91('0x16')]=function(_0x5d415a){var _0x3bd6db=this;return new Promise(function(_0x5ac7ed,_0x21fa5a){return db[_0x6c91('0x17')][_0x6c91('0x18')]({'raw':_0x5d415a[_0x6c91('0x19')]?_0x5d415a[_0x6c91('0x19')][_0x6c91('0x1a')]===undefined?!![]:![]:!![],'where':_0x5d415a[_0x6c91('0x19')]?_0x5d415a[_0x6c91('0x19')]['where']||null:null,'attributes':_0x5d415a[_0x6c91('0x19')]?_0x5d415a[_0x6c91('0x19')][_0x6c91('0x1b')]||null:null,'limit':_0x5d415a[_0x6c91('0x19')]?_0x5d415a[_0x6c91('0x19')]['limit']||null:null,'include':_0x5d415a[_0x6c91('0x19')]?_0x5d415a[_0x6c91('0x19')][_0x6c91('0x1c')]?_[_0x6c91('0x1d')](_0x5d415a['options'][_0x6c91('0x1c')],function(_0x4d6438){return{'model':db[_0x4d6438[_0x6c91('0x1e')]],'as':_0x4d6438['as'],'attributes':_0x4d6438[_0x6c91('0x1b')],'include':_0x4d6438[_0x6c91('0x1c')]?_[_0x6c91('0x1d')](_0x4d6438['include'],function(_0x5c6155){return{'model':db[_0x5c6155[_0x6c91('0x1e')]],'as':_0x5c6155['as'],'attributes':_0x5c6155['attributes'],'include':_0x5c6155[_0x6c91('0x1c')]?_[_0x6c91('0x1d')](_0x5c6155[_0x6c91('0x1c')],function(_0x4318e3){return{'model':db[_0x4318e3[_0x6c91('0x1e')]],'as':_0x4318e3['as'],'attributes':_0x4318e3[_0x6c91('0x1b')]};}):[]};}):[]};}):[]:[]})['then'](function(_0x29d33a){logger[_0x6c91('0xd')]('GetCmHopperBlack',_0x5d415a);logger[_0x6c91('0x10')]('GetCmHopperBlack',_0x5d415a,JSON[_0x6c91('0x1f')](_0x29d33a));_0x5ac7ed(_0x29d33a);})[_0x6c91('0x15')](function(_0x1478e9){logger['error'](_0x6c91('0x16'),_0x1478e9['message'],_0x5d415a);_0x21fa5a(_0x3bd6db[_0x6c91('0x11')](0x1f4,_0x1478e9[_0x6c91('0x13')]));});});};exports[_0x6c91('0x20')]=function(_0x51c1a0){var _0x5c6359=this;return new Promise(function(_0x40c92b,_0xa262aa){return db['CmHopperBlack']['update'](_0x51c1a0[_0x6c91('0x21')],{'raw':_0x51c1a0['options']?_0x51c1a0[_0x6c91('0x19')][_0x6c91('0x1a')]===undefined?!![]:![]:!![],'individualHooks':!![],'where':_0x51c1a0[_0x6c91('0x19')]?_0x51c1a0[_0x6c91('0x19')][_0x6c91('0x22')]||null:null,'attributes':_0x51c1a0[_0x6c91('0x19')]?_0x51c1a0['options'][_0x6c91('0x1b')]||null:null,'limit':_0x51c1a0[_0x6c91('0x19')]?_0x51c1a0[_0x6c91('0x19')]['limit']||null:null})['then'](function(_0x5ead7c){logger[_0x6c91('0xd')](_0x6c91('0x20'),_0x51c1a0);logger[_0x6c91('0x10')](_0x6c91('0x20'),_0x51c1a0,JSON[_0x6c91('0x1f')](_0x5ead7c));_0x40c92b(_0x5ead7c);})[_0x6c91('0x15')](function(_0x7cb61){logger['error'](_0x6c91('0x20'),_0x7cb61['message'],_0x51c1a0);_0xa262aa(_0x5c6359[_0x6c91('0x11')](0x1f4,_0x7cb61[_0x6c91('0x13')]));});});};exports[_0x6c91('0x23')]=function(_0x10129d){var _0x2a481f=this;return new Promise(function(_0x4c758c,_0x3f54a7){return db[_0x6c91('0x17')][_0x6c91('0x24')]({'where':_0x10129d[_0x6c91('0x19')]?_0x10129d[_0x6c91('0x19')][_0x6c91('0x22')]||null:null})[_0x6c91('0xc')](function(_0xb3a1a6){logger[_0x6c91('0xd')](_0x6c91('0x23'),_0x10129d);logger['debug'](_0x6c91('0x23'),_0x10129d,JSON['stringify'](_0xb3a1a6));_0x4c758c(_0xb3a1a6);})['catch'](function(_0x5ed516){logger['error'](_0x6c91('0x23'),_0x5ed516[_0x6c91('0x13')],_0x10129d);_0x3f54a7(_0x2a481f[_0x6c91('0x11')](0x1f4,_0x5ed516[_0x6c91('0x13')]));});});};
\ No newline at end of file
diff --git a/server/api/cmHopperBlack/index.js b/server/api/cmHopperBlack/index.js
index a6cd37c..2551541 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 _0xa41a=['../../config/environment','./cmHopperBlack.controller','get','index','describe','isAuthenticated','show','put','/:id','update','delete','exports','multer','util','connect-timeout','express','Router','../../components/auth/service','../../components/interaction/service'];(function(_0x4cb734,_0x574e4a){var _0x3b9d01=function(_0x29a9d3){while(--_0x29a9d3){_0x4cb734['push'](_0x4cb734['shift']());}};_0x3b9d01(++_0x574e4a);}(_0xa41a,0x6b));var _0xaa41=function(_0x49e607,_0x221bb2){_0x49e607=_0x49e607-0x0;var _0xd8c802=_0xa41a[_0x49e607];return _0xd8c802;};'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')]('/describe',auth['isAuthenticated'](),controller[_0xaa41('0xb')]);router[_0xaa41('0x9')]('/:id',auth[_0xaa41('0xc')](),controller[_0xaa41('0xd')]);router[_0xaa41('0xe')](_0xaa41('0xf'),auth[_0xaa41('0xc')](),controller[_0xaa41('0x10')]);router[_0xaa41('0x11')](_0xaa41('0xf'),auth[_0xaa41('0xc')](),controller['destroy']);module[_0xaa41('0x12')]=router;
\ No newline at end of file
+var _0x9957=['../../components/auth/service','../../components/interaction/service','../../config/environment','get','isAuthenticated','index','/describe','/:id','show','put','update','delete','destroy','exports','multer','util','path','connect-timeout','Router'];(function(_0x387777,_0x356171){var _0x3f84c0=function(_0x4d4423){while(--_0x4d4423){_0x387777['push'](_0x387777['shift']());}};_0x3f84c0(++_0x356171);}(_0x9957,0x93));var _0x7995=function(_0x1facfa,_0x1acf7d){_0x1facfa=_0x1facfa-0x0;var _0x9ec701=_0x9957[_0x1facfa];return _0x9ec701;};'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('./cmHopperBlack.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('0xe')](_0x7995('0xc'),auth[_0x7995('0x9')](),controller[_0x7995('0xf')]);router[_0x7995('0x10')](_0x7995('0xc'),auth['isAuthenticated'](),controller[_0x7995('0x11')]);module[_0x7995('0x12')]=router;
\ No newline at end of file
diff --git a/server/api/cmHopperFinal/cmHopperFinal.attributes.js b/server/api/cmHopperFinal/cmHopperFinal.attributes.js
index a5b5f89..df666c0 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 _0x4881=['sequelize','moment','exports','INTEGER','STRING','DATE','getDataValue','setDataValue','followuptime','diff','seconds','dispositionat','BOOLEAN'];(function(_0x174acf,_0x21accc){var _0x554e2f=function(_0x3c4d1f){while(--_0x3c4d1f){_0x174acf['push'](_0x174acf['shift']());}};_0x554e2f(++_0x21accc);}(_0x4881,0x1c7));var _0x1488=function(_0x403cff,_0x1cf463){_0x403cff=_0x403cff-0x0;var _0x5a7c56=_0x4881[_0x403cff];return _0x5a7c56;};'use strict';var Sequelize=require(_0x1488('0x0'));var moment=require(_0x1488('0x1'));module[_0x1488('0x2')]={'state':{'type':Sequelize[_0x1488('0x3')](0x2)},'statedesc':{'type':Sequelize[_0x1488('0x4')]},'scheduledat':{'type':Sequelize['DATE']},'countbusyretry':{'type':Sequelize[_0x1488('0x3')],'defaultValue':0x0},'countcongestionretry':{'type':Sequelize['INTEGER'],'defaultValue':0x0},'countnoanswerretry':{'type':Sequelize['INTEGER'],'defaultValue':0x0},'countglobal':{'type':Sequelize[_0x1488('0x3')],'defaultValue':0x0},'uniqueid':{'type':Sequelize['STRING']},'originatecalleridnum':{'type':Sequelize[_0x1488('0x4')]},'originatecalleridname':{'type':Sequelize['STRING']},'calleridnum':{'type':Sequelize[_0x1488('0x4')]},'calleridname':{'type':Sequelize[_0x1488('0x4')]},'starttime':{'type':Sequelize['DATE']},'responsetime':{'type':Sequelize[_0x1488('0x5')]},'answertime':{'type':Sequelize[_0x1488('0x5')]},'droptime':{'type':Sequelize[_0x1488('0x5')]},'endtime':{'type':Sequelize[_0x1488('0x5')]},'ringtime':{'type':Sequelize[_0x1488('0x3')],'defaultValue':0x0},'holdtime':{'type':Sequelize[_0x1488('0x3')],'defaultValue':0x0},'talktime':{'type':Sequelize[_0x1488('0x3')],'defaultValue':0x0},'followuptime':{'type':Sequelize['INTEGER'],'defaultValue':0x0},'dropreason':{'type':Sequelize[_0x1488('0x4')]},'campaign':{'type':Sequelize[_0x1488('0x4')]},'campaigntype':{'type':Sequelize[_0x1488('0x4')]},'membername':{'type':Sequelize[_0x1488('0x4')]},'reason':{'type':Sequelize[_0x1488('0x4')]},'disposition':{'type':Sequelize[_0x1488('0x4')]},'dispositionat':{'type':Sequelize[_0x1488('0x5')],'set':function(_0xff1d9e){var _0x13eed0=this[_0x1488('0x6')]('endtime');if(_0x13eed0&&_0xff1d9e){this[_0x1488('0x7')](_0x1488('0x8'),moment(_0xff1d9e)[_0x1488('0x9')](moment(_0x13eed0),_0x1488('0xa')));}return this[_0x1488('0x7')](_0x1488('0xb'),_0xff1d9e);}},'amd':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'fax':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'blacklist':{'type':Sequelize[_0x1488('0xc')],'defaultValue':![]},'rescheduled':{'type':Sequelize[_0x1488('0xc')],'defaultValue':![]},'rescheduledat':{'type':Sequelize['DATE']},'callback':{'type':Sequelize[_0x1488('0xc')],'defaultValue':![]},'callbackuniqueid':{'type':Sequelize[_0x1488('0x4')],'defaultValue':null},'callbackat':{'type':Sequelize[_0x1488('0x5')]},'deleted':{'type':Sequelize[_0x1488('0x4')],'defaultValue':null},'deletedat':{'type':Sequelize['DATE']},'recallme':{'type':Sequelize[_0x1488('0xc')],'defaultValue':![]},'agiafterat':{'type':Sequelize[_0x1488('0x5')]},'countnosuchnumberretry':{'type':Sequelize[_0x1488('0x3')],'defaultValue':0x0},'countdropretry':{'type':Sequelize[_0x1488('0x3')],'defaultValue':0x0},'countabandonedretry':{'type':Sequelize[_0x1488('0x3')],'defaultValue':0x0},'countmachineretry':{'type':Sequelize[_0x1488('0x3')],'defaultValue':0x0},'countagentrejectretry':{'type':Sequelize[_0x1488('0x3')],'defaultValue':0x0}};
\ No newline at end of file
+var _0x7be1=['followuptime','diff','seconds','dispositionat','BOOLEAN','sequelize','moment','exports','INTEGER','STRING','DATE','getDataValue','endtime','setDataValue'];(function(_0x138adb,_0x193fee){var _0x1b27f2=function(_0x5e97a2){while(--_0x5e97a2){_0x138adb['push'](_0x138adb['shift']());}};_0x1b27f2(++_0x193fee);}(_0x7be1,0x19b));var _0x17be=function(_0x131e60,_0x5352ce){_0x131e60=_0x131e60-0x0;var _0x4bc497=_0x7be1[_0x131e60];return _0x4bc497;};'use strict';var Sequelize=require(_0x17be('0x0'));var moment=require(_0x17be('0x1'));module[_0x17be('0x2')]={'state':{'type':Sequelize[_0x17be('0x3')](0x2)},'statedesc':{'type':Sequelize[_0x17be('0x4')]},'scheduledat':{'type':Sequelize['DATE']},'countbusyretry':{'type':Sequelize['INTEGER'],'defaultValue':0x0},'countcongestionretry':{'type':Sequelize[_0x17be('0x3')],'defaultValue':0x0},'countnoanswerretry':{'type':Sequelize[_0x17be('0x3')],'defaultValue':0x0},'countglobal':{'type':Sequelize['INTEGER'],'defaultValue':0x0},'uniqueid':{'type':Sequelize[_0x17be('0x4')]},'originatecalleridnum':{'type':Sequelize[_0x17be('0x4')]},'originatecalleridname':{'type':Sequelize[_0x17be('0x4')]},'calleridnum':{'type':Sequelize[_0x17be('0x4')]},'calleridname':{'type':Sequelize['STRING']},'starttime':{'type':Sequelize[_0x17be('0x5')]},'responsetime':{'type':Sequelize[_0x17be('0x5')]},'answertime':{'type':Sequelize[_0x17be('0x5')]},'droptime':{'type':Sequelize[_0x17be('0x5')]},'endtime':{'type':Sequelize[_0x17be('0x5')]},'ringtime':{'type':Sequelize[_0x17be('0x3')],'defaultValue':0x0},'holdtime':{'type':Sequelize[_0x17be('0x3')],'defaultValue':0x0},'talktime':{'type':Sequelize[_0x17be('0x3')],'defaultValue':0x0},'followuptime':{'type':Sequelize[_0x17be('0x3')],'defaultValue':0x0},'dropreason':{'type':Sequelize[_0x17be('0x4')]},'campaign':{'type':Sequelize[_0x17be('0x4')]},'campaigntype':{'type':Sequelize[_0x17be('0x4')]},'membername':{'type':Sequelize['STRING']},'reason':{'type':Sequelize[_0x17be('0x4')]},'disposition':{'type':Sequelize[_0x17be('0x4')]},'dispositionat':{'type':Sequelize[_0x17be('0x5')],'set':function(_0x11f764){var _0x39eada=this[_0x17be('0x6')](_0x17be('0x7'));if(_0x39eada&&_0x11f764){this[_0x17be('0x8')](_0x17be('0x9'),moment(_0x11f764)[_0x17be('0xa')](moment(_0x39eada),_0x17be('0xb')));}return this[_0x17be('0x8')](_0x17be('0xc'),_0x11f764);}},'amd':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'fax':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'blacklist':{'type':Sequelize[_0x17be('0xd')],'defaultValue':![]},'rescheduled':{'type':Sequelize[_0x17be('0xd')],'defaultValue':![]},'rescheduledat':{'type':Sequelize[_0x17be('0x5')]},'callback':{'type':Sequelize[_0x17be('0xd')],'defaultValue':![]},'callbackuniqueid':{'type':Sequelize[_0x17be('0x4')],'defaultValue':null},'callbackat':{'type':Sequelize[_0x17be('0x5')]},'deleted':{'type':Sequelize[_0x17be('0x4')],'defaultValue':null},'deletedat':{'type':Sequelize[_0x17be('0x5')]},'recallme':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'agiafterat':{'type':Sequelize['DATE']},'countnosuchnumberretry':{'type':Sequelize['INTEGER'],'defaultValue':0x0},'countdropretry':{'type':Sequelize[_0x17be('0x3')],'defaultValue':0x0},'countabandonedretry':{'type':Sequelize[_0x17be('0x3')],'defaultValue':0x0},'countmachineretry':{'type':Sequelize[_0x17be('0x3')],'defaultValue':0x0},'countagentrejectretry':{'type':Sequelize[_0x17be('0x3')],'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 4136b76..e27d311 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 _0x4a42=['../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','api','../../config/utils','../../config/environment','../../mysqldb','status','end','json','count','limit','set','Content-Range','apply','reject','save','destroy','error','name','send','map','CmHopperFinal','rawAttributes','fieldName','type','key','keys','query','filters','intersection','model','attributes','fields','hasOwnProperty','offset','order','sort','where','pick','merge','VIRTUAL','filter','then','includeAll','findAll','show','params','length','options','catch','describe','update','body','uniqueid','find','countContactsQueueCampaignHopperFinal','sequelize','literal','`state`\x20=\x200,\x201,\x20null','noSuchContacts','COUNT','`state`\x20=\x203,\x201,\x20null','noAnswerContacts','`state`\x20=\x205,\x201,\x20null','busyContacts','congestionContacts','`state`\x20=\x2010\x20,\x201,\x20null','dropContacts','`state`\x20=\x2011\x20,\x201,\x20null','abandonedContacts','`state`\x20=\x2022,\x201,\x20null','reCallContacts','`state`\x20=\x2019,\x201,\x20null','answeringMachine','countContactsIvrCampaignHopperFinal','`state`\x20=\x208,\x201,\x20null','moveContactsQueueCampaignHopperFinal','VoiceQueue','insert','into','cm_hopper','fromQuery','scheduledAt','ContactId','VoiceQueueId','createdAt','select','field','ANY_VALUE(calleridnum)','phone','NOW()','ANY_VALUE(ContactId)','ANY_VALUE(ListId)','ANY_VALUE(VoiceQueueId)','updatedAt','from','cm_hopper_final','toString','state','calleridnum\x20IS\x20NOT\x20NULL','VoiceQueueId\x20=\x20?','calleridnum\x20NOT\x20IN\x20(?)','state\x20=\x204','group','moveContactsIvrCampaignHopperFinal','Campaign','ListId','CampaignId','CampaignId\x20=\x20?','state\x20=\x20?','checkContactHopper','CmHopper','findOne','html-pdf','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','moment','bluebird','path','sox','crypto','jsforce','desk.js','to-csv','papaparse','../../components/auth/service'];(function(_0x2ba054,_0x4cfa79){var _0x5d2153=function(_0xd698b4){while(--_0xd698b4){_0x2ba054['push'](_0x2ba054['shift']());}};_0x5d2153(++_0x4cfa79);}(_0x4a42,0x72));var _0x24a4=function(_0x47564f,_0x35b778){_0x47564f=_0x47564f-0x0;var _0x1c40f8=_0x4a42[_0x47564f];return _0x1c40f8;};'use strict';var pdf=require(_0x24a4('0x0'));var emlformat=require(_0x24a4('0x1'));var rimraf=require(_0x24a4('0x2'));var zipdir=require(_0x24a4('0x3'));var jsonpatch=require(_0x24a4('0x4'));var rp=require(_0x24a4('0x5'));var moment=require(_0x24a4('0x6'));var BPromise=require(_0x24a4('0x7'));var Mustache=require('mustache');var util=require('util');var path=require(_0x24a4('0x8'));var sox=require(_0x24a4('0x9'));var csv=require('to-csv');var ejs=require('ejs');var fs=require('fs');var _=require('lodash');var squel=require('squel');var crypto=require(_0x24a4('0xa'));var jsforce=require(_0x24a4('0xb'));var deskjs=require(_0x24a4('0xc'));var toCsv=require(_0x24a4('0xd'));var querystring=require('querystring');var Papa=require(_0x24a4('0xe'));var Redis=require('ioredis');var authService=require(_0x24a4('0xf'));var qs=require(_0x24a4('0x10'));var as=require(_0x24a4('0x11'));var hardwareService=require(_0x24a4('0x12'));var logger=require('../../config/logger')(_0x24a4('0x13'));var utils=require(_0x24a4('0x14'));var config=require(_0x24a4('0x15'));var db=require(_0x24a4('0x16'))['db'];function respondWithStatusCode(_0x59925a,_0x18b283){_0x18b283=_0x18b283||0xcc;return function(_0x2feab3){if(_0x2feab3){return _0x59925a['sendStatus'](_0x18b283);}return _0x59925a[_0x24a4('0x17')](_0x18b283)[_0x24a4('0x18')]();};}function respondWithResult(_0x1a50ae,_0x4fd512){_0x4fd512=_0x4fd512||0xc8;return function(_0xe9a404){if(_0xe9a404){return _0x1a50ae['status'](_0x4fd512)[_0x24a4('0x19')](_0xe9a404);}};}function respondWithFilteredResult(_0x3a05aa,_0xf51cf2){return function(_0x5ae9a3){if(_0x5ae9a3){var _0x5c6bc6=_0x5ae9a3[_0x24a4('0x1a')],_0x50fdbf=_0xf51cf2['offset'],_0x5cf83d=_0xf51cf2['offset']+_0xf51cf2[_0x24a4('0x1b')],_0x3e7257;if(_0x5cf83d>=_0x5c6bc6){_0x5cf83d=_0x5c6bc6;_0x3e7257=0xc8;}else{_0x3e7257=0xce;}_0x3a05aa[_0x24a4('0x17')](_0x3e7257);return _0x3a05aa[_0x24a4('0x1c')](_0x24a4('0x1d'),_0x50fdbf+'-'+_0x5cf83d+'/'+_0x5c6bc6)['json'](_0x5ae9a3);}return null;};}function patchUpdates(_0x5795a1){return function(_0x27b97b){try{jsonpatch[_0x24a4('0x1e')](_0x27b97b,_0x5795a1,!![]);}catch(_0x51f702){return BPromise[_0x24a4('0x1f')](_0x51f702);}return _0x27b97b[_0x24a4('0x20')]();};}function saveUpdates(_0x43d766,_0x5e87d0){return function(_0x25dfff){if(_0x25dfff){return _0x25dfff['update'](_0x43d766)['then'](function(_0x5ca9f3){return _0x5ca9f3;});}return null;};}function removeEntity(_0x129aec,_0x533d1d){return function(_0xce3ea4){if(_0xce3ea4){return _0xce3ea4[_0x24a4('0x21')]()['then'](function(){_0x129aec['status'](0xcc)[_0x24a4('0x18')]();});}};}function handleEntityNotFound(_0x38f145,_0x59db8a){return function(_0x19c58c){if(!_0x19c58c){_0x38f145['sendStatus'](0x194);}return _0x19c58c;};}function handleError(_0x466fb2,_0x326b70){_0x326b70=_0x326b70||0x1f4;return function(_0x1a31e3){logger[_0x24a4('0x22')](_0x1a31e3['stack']);if(_0x1a31e3[_0x24a4('0x23')]){delete _0x1a31e3[_0x24a4('0x23')];}_0x466fb2['status'](_0x326b70)[_0x24a4('0x24')](_0x1a31e3);};}exports['index']=function(_0x28013e,_0x3ec540){var _0x3d626e={},_0x322f16={},_0x4785a5={'count':0x0,'rows':[]};var _0xa735b5=_[_0x24a4('0x25')](db[_0x24a4('0x26')][_0x24a4('0x27')],function(_0x57f5b9){return{'name':_0x57f5b9[_0x24a4('0x28')],'type':_0x57f5b9[_0x24a4('0x29')][_0x24a4('0x2a')]};});_0x322f16['model']=_['map'](_0xa735b5,'name');_0x322f16['query']=_[_0x24a4('0x2b')](_0x28013e[_0x24a4('0x2c')]);_0x322f16[_0x24a4('0x2d')]=_[_0x24a4('0x2e')](_0x322f16[_0x24a4('0x2f')],_0x322f16['query']);_0x3d626e[_0x24a4('0x30')]=_['intersection'](_0x322f16[_0x24a4('0x2f')],qs[_0x24a4('0x31')](_0x28013e[_0x24a4('0x2c')][_0x24a4('0x31')]));_0x3d626e[_0x24a4('0x30')]=_0x3d626e[_0x24a4('0x30')]['length']?_0x3d626e[_0x24a4('0x30')]:_0x322f16[_0x24a4('0x2f')];if(!_0x28013e[_0x24a4('0x2c')][_0x24a4('0x32')]('nolimit')){_0x3d626e['limit']=qs[_0x24a4('0x1b')](_0x28013e['query'][_0x24a4('0x1b')]);_0x3d626e[_0x24a4('0x33')]=qs[_0x24a4('0x33')](_0x28013e['query'][_0x24a4('0x33')]);}_0x3d626e[_0x24a4('0x34')]=qs[_0x24a4('0x35')](_0x28013e[_0x24a4('0x2c')][_0x24a4('0x35')]);_0x3d626e[_0x24a4('0x36')]=qs[_0x24a4('0x2d')](_[_0x24a4('0x37')](_0x28013e['query'],_0x322f16[_0x24a4('0x2d')]));if(_0x28013e[_0x24a4('0x2c')]['filter']){_0x3d626e[_0x24a4('0x36')]=_[_0x24a4('0x38')](_0x3d626e[_0x24a4('0x36')],{'$or':_[_0x24a4('0x25')](_0xa735b5,function(_0xdbc617){if(_0xdbc617[_0x24a4('0x29')]!==_0x24a4('0x39')){var _0x409e69={};_0x409e69[_0xdbc617[_0x24a4('0x23')]]={'$like':'%'+_0x28013e[_0x24a4('0x2c')][_0x24a4('0x3a')]+'%'};return _0x409e69;}})});}_0x3d626e=_[_0x24a4('0x38')]({},_0x3d626e,_0x28013e['options']);var _0x17a9f0={'where':_0x3d626e[_0x24a4('0x36')]};return db['CmHopperFinal']['count'](_0x17a9f0)[_0x24a4('0x3b')](function(_0x43cde9){_0x4785a5[_0x24a4('0x1a')]=_0x43cde9;if(_0x28013e['query'][_0x24a4('0x3c')]){_0x3d626e['include']=[{'all':!![]}];}return db[_0x24a4('0x26')][_0x24a4('0x3d')](_0x3d626e);})['then'](function(_0x36cabc){_0x4785a5['rows']=_0x36cabc;return _0x4785a5;})[_0x24a4('0x3b')](respondWithFilteredResult(_0x3ec540,_0x3d626e))['catch'](handleError(_0x3ec540,null));};exports[_0x24a4('0x3e')]=function(_0x4184d3,_0xce3c4a){var _0x531b05={'raw':!![],'where':{'id':_0x4184d3[_0x24a4('0x3f')]['id']}},_0x2ed74c={};_0x2ed74c['model']=_[_0x24a4('0x2b')](db[_0x24a4('0x26')]['rawAttributes']);_0x2ed74c[_0x24a4('0x2c')]=_[_0x24a4('0x2b')](_0x4184d3['query']);_0x2ed74c[_0x24a4('0x2d')]=_[_0x24a4('0x2e')](_0x2ed74c[_0x24a4('0x2f')],_0x2ed74c[_0x24a4('0x2c')]);_0x531b05['attributes']=_[_0x24a4('0x2e')](_0x2ed74c[_0x24a4('0x2f')],qs[_0x24a4('0x31')](_0x4184d3['query'][_0x24a4('0x31')]));_0x531b05[_0x24a4('0x30')]=_0x531b05[_0x24a4('0x30')][_0x24a4('0x40')]?_0x531b05[_0x24a4('0x30')]:_0x2ed74c[_0x24a4('0x2f')];if(_0x4184d3[_0x24a4('0x2c')]['includeAll']){_0x531b05['include']=[{'all':!![]}];}_0x531b05=_[_0x24a4('0x38')]({},_0x531b05,_0x4184d3[_0x24a4('0x41')]);return db[_0x24a4('0x26')]['find'](_0x531b05)[_0x24a4('0x3b')](handleEntityNotFound(_0xce3c4a,null))[_0x24a4('0x3b')](respondWithResult(_0xce3c4a,null))[_0x24a4('0x42')](handleError(_0xce3c4a,null));};exports[_0x24a4('0x43')]=function(_0x158d10,_0x383ff7){return db[_0x24a4('0x26')]['describe']()['then'](respondWithResult(_0x383ff7,null))[_0x24a4('0x42')](handleError(_0x383ff7,null));};exports[_0x24a4('0x44')]=function(_0x4fa064,_0x1d8966){if(_0x4fa064[_0x24a4('0x45')]['uniqueid']){delete _0x4fa064[_0x24a4('0x45')][_0x24a4('0x46')];}return db['CmHopperFinal'][_0x24a4('0x47')]({'where':{'uniqueid':_0x4fa064[_0x24a4('0x3f')]['id']}})[_0x24a4('0x3b')](handleEntityNotFound(_0x1d8966,null))[_0x24a4('0x3b')](saveUpdates(_0x4fa064[_0x24a4('0x45')],null))[_0x24a4('0x3b')](respondWithResult(_0x1d8966,null))[_0x24a4('0x42')](handleError(_0x1d8966,null));};exports[_0x24a4('0x48')]=function(_0xdee713,_0x29e8c8,_0x233f33){return db[_0x24a4('0x26')]['findAll']({'raw':![],'where':{'VoiceQueueId':_0xdee713[_0x24a4('0x3f')]['id']},'attributes':[[db[_0x24a4('0x49')]['fn']('COUNT',db[_0x24a4('0x49')]['fn']('IF',db[_0x24a4('0x49')][_0x24a4('0x4a')](_0x24a4('0x4b')))),_0x24a4('0x4c')],[db[_0x24a4('0x49')]['fn'](_0x24a4('0x4d'),db[_0x24a4('0x49')]['fn']('IF',db['sequelize'][_0x24a4('0x4a')](_0x24a4('0x4e')))),_0x24a4('0x4f')],[db[_0x24a4('0x49')]['fn'](_0x24a4('0x4d'),db[_0x24a4('0x49')]['fn']('IF',db[_0x24a4('0x49')][_0x24a4('0x4a')](_0x24a4('0x50')))),_0x24a4('0x51')],[db[_0x24a4('0x49')]['fn'](_0x24a4('0x4d'),db['sequelize']['fn']('IF',db[_0x24a4('0x49')][_0x24a4('0x4a')]('`state`\x20=\x208,\x201,\x20null'))),_0x24a4('0x52')],[db[_0x24a4('0x49')]['fn'](_0x24a4('0x4d'),db[_0x24a4('0x49')]['fn']('IF',db['sequelize'][_0x24a4('0x4a')](_0x24a4('0x53')))),_0x24a4('0x54')],[db['sequelize']['fn'](_0x24a4('0x4d'),db[_0x24a4('0x49')]['fn']('IF',db['sequelize'][_0x24a4('0x4a')](_0x24a4('0x55')))),_0x24a4('0x56')],[db[_0x24a4('0x49')]['fn'](_0x24a4('0x4d'),db[_0x24a4('0x49')]['fn']('IF',db['sequelize'][_0x24a4('0x4a')](_0x24a4('0x57')))),_0x24a4('0x58')],[db[_0x24a4('0x49')]['fn']('COUNT',db[_0x24a4('0x49')]['fn']('IF',db[_0x24a4('0x49')][_0x24a4('0x4a')](_0x24a4('0x59')))),_0x24a4('0x5a')]]})[_0x24a4('0x3b')](handleEntityNotFound(_0x29e8c8,null))[_0x24a4('0x3b')](respondWithResult(_0x29e8c8,null))[_0x24a4('0x42')](handleError(_0x29e8c8,null));};exports[_0x24a4('0x5b')]=function(_0x59de8a,_0x4c92ee,_0x583773){return db[_0x24a4('0x26')]['findAll']({'raw':![],'where':{'CampaignId':_0x59de8a['params']['id']},'attributes':[[db[_0x24a4('0x49')]['fn'](_0x24a4('0x4d'),db[_0x24a4('0x49')]['fn']('IF',db[_0x24a4('0x49')][_0x24a4('0x4a')](_0x24a4('0x4b')))),_0x24a4('0x4c')],[db[_0x24a4('0x49')]['fn'](_0x24a4('0x4d'),db[_0x24a4('0x49')]['fn']('IF',db['sequelize'][_0x24a4('0x4a')]('`state`\x20=\x203,\x201,\x20null'))),_0x24a4('0x4f')],[db[_0x24a4('0x49')]['fn'](_0x24a4('0x4d'),db['sequelize']['fn']('IF',db[_0x24a4('0x49')][_0x24a4('0x4a')](_0x24a4('0x50')))),_0x24a4('0x51')],[db[_0x24a4('0x49')]['fn'](_0x24a4('0x4d'),db['sequelize']['fn']('IF',db['sequelize'][_0x24a4('0x4a')](_0x24a4('0x5c')))),_0x24a4('0x52')],[db['sequelize']['fn']('COUNT',db[_0x24a4('0x49')]['fn']('IF',db[_0x24a4('0x49')][_0x24a4('0x4a')](_0x24a4('0x53')))),_0x24a4('0x54')],[db[_0x24a4('0x49')]['fn'](_0x24a4('0x4d'),db['sequelize']['fn']('IF',db[_0x24a4('0x49')][_0x24a4('0x4a')](_0x24a4('0x55')))),_0x24a4('0x56')],[db[_0x24a4('0x49')]['fn']('COUNT',db[_0x24a4('0x49')]['fn']('IF',db[_0x24a4('0x49')]['literal'](_0x24a4('0x57')))),'reCallContacts'],[db[_0x24a4('0x49')]['fn'](_0x24a4('0x4d'),db['sequelize']['fn']('IF',db['sequelize']['literal'](_0x24a4('0x59')))),'answeringMachine']]})[_0x24a4('0x3b')](handleEntityNotFound(_0x4c92ee,null))[_0x24a4('0x3b')](respondWithResult(_0x4c92ee,null))[_0x24a4('0x42')](handleError(_0x4c92ee,null));};exports[_0x24a4('0x5d')]=function(_0x42879a,_0xee311c,_0x3c061c){return db[_0x24a4('0x5e')][_0x24a4('0x47')]({'where':{'id':_0x42879a[_0x24a4('0x3f')]['id']}})[_0x24a4('0x3b')](handleEntityNotFound(_0xee311c,null))['then'](function(_0xd1e018){var _0x347ccb;if(_0xd1e018){_0x347ccb=squel[_0x24a4('0x5f')]()[_0x24a4('0x60')](_0x24a4('0x61'))[_0x24a4('0x62')](['phone',_0x24a4('0x63'),_0x24a4('0x64'),'ListId',_0x24a4('0x65'),_0x24a4('0x66'),'updatedAt'],squel[_0x24a4('0x67')]()[_0x24a4('0x68')](_0x24a4('0x69'),_0x24a4('0x6a'))[_0x24a4('0x68')](_0x24a4('0x6b'),'scheduledAt')[_0x24a4('0x68')](_0x24a4('0x6c'),_0x24a4('0x64'))[_0x24a4('0x68')](_0x24a4('0x6d'),'ListId')[_0x24a4('0x68')](_0x24a4('0x6e'),_0x24a4('0x65'))[_0x24a4('0x68')](_0x24a4('0x6b'),_0x24a4('0x66'))[_0x24a4('0x68')](_0x24a4('0x6b'),_0x24a4('0x6f'))[_0x24a4('0x70')](_0x24a4('0x71'))[_0x24a4('0x36')]('VoiceQueueId\x20=\x20?',_0x42879a['params']['id'][_0x24a4('0x72')]())[_0x24a4('0x36')]('state\x20=\x20?',_0x42879a[_0x24a4('0x45')][_0x24a4('0x73')][_0x24a4('0x72')]())['where'](_0x24a4('0x74'))[_0x24a4('0x36')]('calleridnum\x20NOT\x20IN\x20(?)',squel['select']()[_0x24a4('0x68')](_0x24a4('0x6a'))[_0x24a4('0x70')](_0x24a4('0x61'))[_0x24a4('0x36')](_0x24a4('0x75'),_0x42879a[_0x24a4('0x3f')]['id'][_0x24a4('0x72')]()))[_0x24a4('0x36')](_0x24a4('0x76'),squel[_0x24a4('0x67')]()[_0x24a4('0x68')]('calleridnum')['from'](_0x24a4('0x71'))[_0x24a4('0x36')](_0x24a4('0x75'),_0x42879a[_0x24a4('0x3f')]['id'][_0x24a4('0x72')]())[_0x24a4('0x36')](_0x24a4('0x77')))[_0x24a4('0x78')](_0x24a4('0x64')))[_0x24a4('0x72')]();return db[_0x24a4('0x49')][_0x24a4('0x2c')](_0x347ccb);}return[];})['then'](respondWithResult(_0xee311c,null))[_0x24a4('0x42')](handleError(_0xee311c,null));};exports[_0x24a4('0x79')]=function(_0x580e08,_0x5e1556,_0x20d205){return db[_0x24a4('0x7a')]['find']({'where':{'id':_0x580e08['params']['id']}})['then'](handleEntityNotFound(_0x5e1556,null))[_0x24a4('0x3b')](function(_0x2ab03b){var _0x3657aa;if(_0x2ab03b){_0x3657aa=squel[_0x24a4('0x5f')]()[_0x24a4('0x60')](_0x24a4('0x61'))[_0x24a4('0x62')]([_0x24a4('0x6a'),_0x24a4('0x63'),_0x24a4('0x64'),_0x24a4('0x7b'),_0x24a4('0x7c'),_0x24a4('0x66'),_0x24a4('0x6f')],squel['select']()[_0x24a4('0x68')](_0x24a4('0x69'),_0x24a4('0x6a'))['field']('NOW()',_0x24a4('0x63'))['field'](_0x24a4('0x6c'),_0x24a4('0x64'))['field']('ANY_VALUE(ListId)',_0x24a4('0x7b'))[_0x24a4('0x68')]('ANY_VALUE(CampaignId)',_0x24a4('0x7c'))[_0x24a4('0x68')](_0x24a4('0x6b'),_0x24a4('0x66'))[_0x24a4('0x68')](_0x24a4('0x6b'),_0x24a4('0x6f'))['from'](_0x24a4('0x71'))[_0x24a4('0x36')](_0x24a4('0x7d'),_0x580e08['params']['id']['toString']())[_0x24a4('0x36')](_0x24a4('0x7e'),_0x580e08[_0x24a4('0x45')][_0x24a4('0x73')][_0x24a4('0x72')]())['where'](_0x24a4('0x74'))['where'](_0x24a4('0x76'),squel[_0x24a4('0x67')]()[_0x24a4('0x68')]('phone')['from'](_0x24a4('0x61'))['where'](_0x24a4('0x7d'),_0x580e08[_0x24a4('0x3f')]['id'][_0x24a4('0x72')]()))[_0x24a4('0x36')](_0x24a4('0x76'),squel[_0x24a4('0x67')]()[_0x24a4('0x68')]('calleridnum')['from'](_0x24a4('0x71'))[_0x24a4('0x36')](_0x24a4('0x7d'),_0x580e08['params']['id'][_0x24a4('0x72')]())['where']('state\x20=\x204'))[_0x24a4('0x78')]('ContactId'))[_0x24a4('0x72')]();return db[_0x24a4('0x49')][_0x24a4('0x2c')](_0x3657aa);}return[];})['then'](respondWithResult(_0x5e1556,null))[_0x24a4('0x42')](handleError(_0x5e1556,null));};exports[_0x24a4('0x7f')]=function(_0x4d005a,_0x26e421,_0x2bcea1){return db[_0x24a4('0x80')][_0x24a4('0x81')]({'where':{'VoiceQueueId':_0x4d005a[_0x24a4('0x45')][_0x24a4('0x65')],'CampaignId':_0x4d005a[_0x24a4('0x45')]['CampaignId'],'ContactId':_0x4d005a[_0x24a4('0x45')][_0x24a4('0x64')]}})[_0x24a4('0x3b')](handleEntityNotFound(_0x26e421,null))[_0x24a4('0x3b')](function(_0x1a7170){if(_0x1a7170){return _0x1a7170;}return null;})['then'](respondWithResult(_0x26e421,null))[_0x24a4('0x42')](handleError(_0x26e421,null));};
\ No newline at end of file
+var _0x6ce8=['bluebird','mustache','util','ejs','lodash','squel','crypto','jsforce','desk.js','to-csv','papaparse','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','apply','reject','save','update','then','destroy','error','stack','name','send','index','map','CmHopperFinal','rawAttributes','fieldName','type','key','model','query','keys','attributes','intersection','fields','length','hasOwnProperty','order','sort','where','pick','filters','merge','filter','includeAll','include','findAll','rows','catch','show','params','options','find','describe','body','uniqueid','sequelize','COUNT','`state`\x20=\x200,\x201,\x20null','literal','`state`\x20=\x203,\x201,\x20null','`state`\x20=\x205,\x201,\x20null','busyContacts','`state`\x20=\x208,\x201,\x20null','`state`\x20=\x2010\x20,\x201,\x20null','dropContacts','`state`\x20=\x2011\x20,\x201,\x20null','abandonedContacts','reCallContacts','countContactsIvrCampaignHopperFinal','noSuchContacts','congestionContacts','`state`\x20=\x2019,\x201,\x20null','answeringMachine','moveContactsQueueCampaignHopperFinal','VoiceQueue','insert','fromQuery','scheduledAt','ContactId','ListId','VoiceQueueId','createdAt','updatedAt','field','phone','NOW()','ANY_VALUE(ContactId)','ANY_VALUE(VoiceQueueId)','from','cm_hopper_final','toString','state','calleridnum\x20IS\x20NOT\x20NULL','calleridnum\x20NOT\x20IN\x20(?)','cm_hopper','VoiceQueueId\x20=\x20?','select','calleridnum','Campaign','into','CampaignId','CampaignId\x20=\x20?','state\x20=\x20?','state\x20=\x204','checkContactHopper','CmHopper','findOne','eml-format','rimraf','fast-json-patch','request-promise','moment'];(function(_0x7c1337,_0x536b08){var _0x57e56f=function(_0x490acd){while(--_0x490acd){_0x7c1337['push'](_0x7c1337['shift']());}};_0x57e56f(++_0x536b08);}(_0x6ce8,0xfd));var _0x86ce=function(_0x2641f9,_0x26715f){_0x2641f9=_0x2641f9-0x0;var _0x585741=_0x6ce8[_0x2641f9];return _0x585741;};'use strict';var pdf=require('html-pdf');var emlformat=require(_0x86ce('0x0'));var rimraf=require(_0x86ce('0x1'));var zipdir=require('zip-dir');var jsonpatch=require(_0x86ce('0x2'));var rp=require(_0x86ce('0x3'));var moment=require(_0x86ce('0x4'));var BPromise=require(_0x86ce('0x5'));var Mustache=require(_0x86ce('0x6'));var util=require(_0x86ce('0x7'));var path=require('path');var sox=require('sox');var csv=require('to-csv');var ejs=require(_0x86ce('0x8'));var fs=require('fs');var _=require(_0x86ce('0x9'));var squel=require(_0x86ce('0xa'));var crypto=require(_0x86ce('0xb'));var jsforce=require(_0x86ce('0xc'));var deskjs=require(_0x86ce('0xd'));var toCsv=require(_0x86ce('0xe'));var querystring=require('querystring');var Papa=require(_0x86ce('0xf'));var Redis=require(_0x86ce('0x10'));var authService=require(_0x86ce('0x11'));var qs=require(_0x86ce('0x12'));var as=require(_0x86ce('0x13'));var hardwareService=require(_0x86ce('0x14'));var logger=require('../../config/logger')(_0x86ce('0x15'));var utils=require(_0x86ce('0x16'));var config=require(_0x86ce('0x17'));var db=require(_0x86ce('0x18'))['db'];function respondWithStatusCode(_0x1e60b4,_0x10fd79){_0x10fd79=_0x10fd79||0xcc;return function(_0x45f394){if(_0x45f394){return _0x1e60b4[_0x86ce('0x19')](_0x10fd79);}return _0x1e60b4[_0x86ce('0x1a')](_0x10fd79)[_0x86ce('0x1b')]();};}function respondWithResult(_0x735074,_0x1b8d60){_0x1b8d60=_0x1b8d60||0xc8;return function(_0xf6986f){if(_0xf6986f){return _0x735074['status'](_0x1b8d60)[_0x86ce('0x1c')](_0xf6986f);}};}function respondWithFilteredResult(_0x1bdcc7,_0x37f93a){return function(_0x52f9f5){if(_0x52f9f5){var _0x4494bb=_0x52f9f5[_0x86ce('0x1d')],_0x921fcc=_0x37f93a[_0x86ce('0x1e')],_0x18acbe=_0x37f93a[_0x86ce('0x1e')]+_0x37f93a[_0x86ce('0x1f')],_0x55d74c;if(_0x18acbe>=_0x4494bb){_0x18acbe=_0x4494bb;_0x55d74c=0xc8;}else{_0x55d74c=0xce;}_0x1bdcc7[_0x86ce('0x1a')](_0x55d74c);return _0x1bdcc7[_0x86ce('0x20')]('Content-Range',_0x921fcc+'-'+_0x18acbe+'/'+_0x4494bb)[_0x86ce('0x1c')](_0x52f9f5);}return null;};}function patchUpdates(_0x37b41b){return function(_0x3d2948){try{jsonpatch[_0x86ce('0x21')](_0x3d2948,_0x37b41b,!![]);}catch(_0x48f756){return BPromise[_0x86ce('0x22')](_0x48f756);}return _0x3d2948[_0x86ce('0x23')]();};}function saveUpdates(_0x352f0d,_0x3e41da){return function(_0x40ded4){if(_0x40ded4){return _0x40ded4[_0x86ce('0x24')](_0x352f0d)[_0x86ce('0x25')](function(_0x454202){return _0x454202;});}return null;};}function removeEntity(_0x46f6dc,_0x5cd573){return function(_0x31ac01){if(_0x31ac01){return _0x31ac01[_0x86ce('0x26')]()[_0x86ce('0x25')](function(){_0x46f6dc[_0x86ce('0x1a')](0xcc)[_0x86ce('0x1b')]();});}};}function handleEntityNotFound(_0x10d84d,_0x49c126){return function(_0x5fbe2e){if(!_0x5fbe2e){_0x10d84d[_0x86ce('0x19')](0x194);}return _0x5fbe2e;};}function handleError(_0x2d1bca,_0x202ca9){_0x202ca9=_0x202ca9||0x1f4;return function(_0x4163d3){logger[_0x86ce('0x27')](_0x4163d3[_0x86ce('0x28')]);if(_0x4163d3[_0x86ce('0x29')]){delete _0x4163d3[_0x86ce('0x29')];}_0x2d1bca['status'](_0x202ca9)[_0x86ce('0x2a')](_0x4163d3);};}exports[_0x86ce('0x2b')]=function(_0x5e9cc0,_0x51b830){var _0x26c0e9={},_0x1c8653={},_0x33a8c9={'count':0x0,'rows':[]};var _0x223ff5=_[_0x86ce('0x2c')](db[_0x86ce('0x2d')][_0x86ce('0x2e')],function(_0x2ff255){return{'name':_0x2ff255[_0x86ce('0x2f')],'type':_0x2ff255[_0x86ce('0x30')][_0x86ce('0x31')]};});_0x1c8653[_0x86ce('0x32')]=_[_0x86ce('0x2c')](_0x223ff5,'name');_0x1c8653[_0x86ce('0x33')]=_[_0x86ce('0x34')](_0x5e9cc0[_0x86ce('0x33')]);_0x1c8653['filters']=_['intersection'](_0x1c8653[_0x86ce('0x32')],_0x1c8653[_0x86ce('0x33')]);_0x26c0e9[_0x86ce('0x35')]=_[_0x86ce('0x36')](_0x1c8653['model'],qs[_0x86ce('0x37')](_0x5e9cc0[_0x86ce('0x33')]['fields']));_0x26c0e9[_0x86ce('0x35')]=_0x26c0e9[_0x86ce('0x35')][_0x86ce('0x38')]?_0x26c0e9[_0x86ce('0x35')]:_0x1c8653[_0x86ce('0x32')];if(!_0x5e9cc0[_0x86ce('0x33')][_0x86ce('0x39')]('nolimit')){_0x26c0e9[_0x86ce('0x1f')]=qs[_0x86ce('0x1f')](_0x5e9cc0[_0x86ce('0x33')]['limit']);_0x26c0e9['offset']=qs['offset'](_0x5e9cc0[_0x86ce('0x33')][_0x86ce('0x1e')]);}_0x26c0e9[_0x86ce('0x3a')]=qs['sort'](_0x5e9cc0[_0x86ce('0x33')][_0x86ce('0x3b')]);_0x26c0e9[_0x86ce('0x3c')]=qs['filters'](_[_0x86ce('0x3d')](_0x5e9cc0['query'],_0x1c8653[_0x86ce('0x3e')]));if(_0x5e9cc0[_0x86ce('0x33')]['filter']){_0x26c0e9[_0x86ce('0x3c')]=_[_0x86ce('0x3f')](_0x26c0e9[_0x86ce('0x3c')],{'$or':_['map'](_0x223ff5,function(_0x48cd4c){if(_0x48cd4c['type']!=='VIRTUAL'){var _0x5d220e={};_0x5d220e[_0x48cd4c[_0x86ce('0x29')]]={'$like':'%'+_0x5e9cc0[_0x86ce('0x33')][_0x86ce('0x40')]+'%'};return _0x5d220e;}})});}_0x26c0e9=_[_0x86ce('0x3f')]({},_0x26c0e9,_0x5e9cc0['options']);var _0x458702={'where':_0x26c0e9['where']};return db[_0x86ce('0x2d')][_0x86ce('0x1d')](_0x458702)[_0x86ce('0x25')](function(_0x57105a){_0x33a8c9[_0x86ce('0x1d')]=_0x57105a;if(_0x5e9cc0[_0x86ce('0x33')][_0x86ce('0x41')]){_0x26c0e9[_0x86ce('0x42')]=[{'all':!![]}];}return db[_0x86ce('0x2d')][_0x86ce('0x43')](_0x26c0e9);})[_0x86ce('0x25')](function(_0x14ded8){_0x33a8c9[_0x86ce('0x44')]=_0x14ded8;return _0x33a8c9;})[_0x86ce('0x25')](respondWithFilteredResult(_0x51b830,_0x26c0e9))[_0x86ce('0x45')](handleError(_0x51b830,null));};exports[_0x86ce('0x46')]=function(_0x1fd10a,_0x35524b){var _0x1ed92b={'raw':!![],'where':{'id':_0x1fd10a[_0x86ce('0x47')]['id']}},_0x28ea12={};_0x28ea12[_0x86ce('0x32')]=_['keys'](db[_0x86ce('0x2d')][_0x86ce('0x2e')]);_0x28ea12[_0x86ce('0x33')]=_['keys'](_0x1fd10a['query']);_0x28ea12[_0x86ce('0x3e')]=_[_0x86ce('0x36')](_0x28ea12[_0x86ce('0x32')],_0x28ea12[_0x86ce('0x33')]);_0x1ed92b[_0x86ce('0x35')]=_[_0x86ce('0x36')](_0x28ea12[_0x86ce('0x32')],qs[_0x86ce('0x37')](_0x1fd10a[_0x86ce('0x33')][_0x86ce('0x37')]));_0x1ed92b['attributes']=_0x1ed92b['attributes'][_0x86ce('0x38')]?_0x1ed92b[_0x86ce('0x35')]:_0x28ea12[_0x86ce('0x32')];if(_0x1fd10a[_0x86ce('0x33')][_0x86ce('0x41')]){_0x1ed92b['include']=[{'all':!![]}];}_0x1ed92b=_['merge']({},_0x1ed92b,_0x1fd10a[_0x86ce('0x48')]);return db[_0x86ce('0x2d')][_0x86ce('0x49')](_0x1ed92b)[_0x86ce('0x25')](handleEntityNotFound(_0x35524b,null))[_0x86ce('0x25')](respondWithResult(_0x35524b,null))['catch'](handleError(_0x35524b,null));};exports[_0x86ce('0x4a')]=function(_0x5980ae,_0x4f4ecb){return db[_0x86ce('0x2d')]['describe']()['then'](respondWithResult(_0x4f4ecb,null))['catch'](handleError(_0x4f4ecb,null));};exports[_0x86ce('0x24')]=function(_0x127826,_0x1095b6){if(_0x127826[_0x86ce('0x4b')][_0x86ce('0x4c')]){delete _0x127826['body'][_0x86ce('0x4c')];}return db[_0x86ce('0x2d')]['find']({'where':{'uniqueid':_0x127826['params']['id']}})[_0x86ce('0x25')](handleEntityNotFound(_0x1095b6,null))[_0x86ce('0x25')](saveUpdates(_0x127826[_0x86ce('0x4b')],null))['then'](respondWithResult(_0x1095b6,null))['catch'](handleError(_0x1095b6,null));};exports['countContactsQueueCampaignHopperFinal']=function(_0x466864,_0x4faa1a,_0x26c791){return db[_0x86ce('0x2d')][_0x86ce('0x43')]({'raw':![],'where':{'VoiceQueueId':_0x466864['params']['id']},'attributes':[[db[_0x86ce('0x4d')]['fn'](_0x86ce('0x4e'),db[_0x86ce('0x4d')]['fn']('IF',db[_0x86ce('0x4d')]['literal'](_0x86ce('0x4f')))),'noSuchContacts'],[db[_0x86ce('0x4d')]['fn'](_0x86ce('0x4e'),db[_0x86ce('0x4d')]['fn']('IF',db[_0x86ce('0x4d')][_0x86ce('0x50')](_0x86ce('0x51')))),'noAnswerContacts'],[db[_0x86ce('0x4d')]['fn'](_0x86ce('0x4e'),db[_0x86ce('0x4d')]['fn']('IF',db[_0x86ce('0x4d')][_0x86ce('0x50')](_0x86ce('0x52')))),_0x86ce('0x53')],[db['sequelize']['fn'](_0x86ce('0x4e'),db[_0x86ce('0x4d')]['fn']('IF',db['sequelize'][_0x86ce('0x50')](_0x86ce('0x54')))),'congestionContacts'],[db['sequelize']['fn'](_0x86ce('0x4e'),db[_0x86ce('0x4d')]['fn']('IF',db['sequelize'][_0x86ce('0x50')](_0x86ce('0x55')))),_0x86ce('0x56')],[db[_0x86ce('0x4d')]['fn'](_0x86ce('0x4e'),db[_0x86ce('0x4d')]['fn']('IF',db[_0x86ce('0x4d')][_0x86ce('0x50')](_0x86ce('0x57')))),_0x86ce('0x58')],[db['sequelize']['fn'](_0x86ce('0x4e'),db['sequelize']['fn']('IF',db[_0x86ce('0x4d')][_0x86ce('0x50')]('`state`\x20=\x2022,\x201,\x20null'))),_0x86ce('0x59')],[db[_0x86ce('0x4d')]['fn'](_0x86ce('0x4e'),db['sequelize']['fn']('IF',db[_0x86ce('0x4d')][_0x86ce('0x50')]('`state`\x20=\x2019,\x201,\x20null'))),'answeringMachine']]})['then'](handleEntityNotFound(_0x4faa1a,null))['then'](respondWithResult(_0x4faa1a,null))[_0x86ce('0x45')](handleError(_0x4faa1a,null));};exports[_0x86ce('0x5a')]=function(_0x51cafe,_0x17faee,_0x27ecc1){return db[_0x86ce('0x2d')]['findAll']({'raw':![],'where':{'CampaignId':_0x51cafe['params']['id']},'attributes':[[db[_0x86ce('0x4d')]['fn']('COUNT',db[_0x86ce('0x4d')]['fn']('IF',db[_0x86ce('0x4d')][_0x86ce('0x50')](_0x86ce('0x4f')))),_0x86ce('0x5b')],[db['sequelize']['fn']('COUNT',db[_0x86ce('0x4d')]['fn']('IF',db[_0x86ce('0x4d')][_0x86ce('0x50')](_0x86ce('0x51')))),'noAnswerContacts'],[db[_0x86ce('0x4d')]['fn']('COUNT',db['sequelize']['fn']('IF',db[_0x86ce('0x4d')]['literal'](_0x86ce('0x52')))),_0x86ce('0x53')],[db['sequelize']['fn']('COUNT',db[_0x86ce('0x4d')]['fn']('IF',db[_0x86ce('0x4d')]['literal'](_0x86ce('0x54')))),_0x86ce('0x5c')],[db[_0x86ce('0x4d')]['fn'](_0x86ce('0x4e'),db[_0x86ce('0x4d')]['fn']('IF',db[_0x86ce('0x4d')][_0x86ce('0x50')](_0x86ce('0x55')))),'dropContacts'],[db['sequelize']['fn']('COUNT',db[_0x86ce('0x4d')]['fn']('IF',db[_0x86ce('0x4d')][_0x86ce('0x50')]('`state`\x20=\x2011\x20,\x201,\x20null'))),_0x86ce('0x58')],[db[_0x86ce('0x4d')]['fn'](_0x86ce('0x4e'),db[_0x86ce('0x4d')]['fn']('IF',db['sequelize'][_0x86ce('0x50')]('`state`\x20=\x2022,\x201,\x20null'))),_0x86ce('0x59')],[db['sequelize']['fn']('COUNT',db[_0x86ce('0x4d')]['fn']('IF',db[_0x86ce('0x4d')][_0x86ce('0x50')](_0x86ce('0x5d')))),_0x86ce('0x5e')]]})['then'](handleEntityNotFound(_0x17faee,null))['then'](respondWithResult(_0x17faee,null))[_0x86ce('0x45')](handleError(_0x17faee,null));};exports[_0x86ce('0x5f')]=function(_0xe3a8e0,_0x2346a1,_0x436689){return db[_0x86ce('0x60')]['find']({'where':{'id':_0xe3a8e0[_0x86ce('0x47')]['id']}})[_0x86ce('0x25')](handleEntityNotFound(_0x2346a1,null))[_0x86ce('0x25')](function(_0x3d2d2a){var _0x28d475;if(_0x3d2d2a){_0x28d475=squel[_0x86ce('0x61')]()['into']('cm_hopper')[_0x86ce('0x62')](['phone',_0x86ce('0x63'),_0x86ce('0x64'),_0x86ce('0x65'),_0x86ce('0x66'),_0x86ce('0x67'),_0x86ce('0x68')],squel['select']()[_0x86ce('0x69')]('ANY_VALUE(calleridnum)',_0x86ce('0x6a'))['field'](_0x86ce('0x6b'),_0x86ce('0x63'))['field'](_0x86ce('0x6c'),'ContactId')[_0x86ce('0x69')]('ANY_VALUE(ListId)',_0x86ce('0x65'))[_0x86ce('0x69')](_0x86ce('0x6d'),_0x86ce('0x66'))[_0x86ce('0x69')](_0x86ce('0x6b'),_0x86ce('0x67'))['field'](_0x86ce('0x6b'),_0x86ce('0x68'))[_0x86ce('0x6e')](_0x86ce('0x6f'))[_0x86ce('0x3c')]('VoiceQueueId\x20=\x20?',_0xe3a8e0[_0x86ce('0x47')]['id'][_0x86ce('0x70')]())['where']('state\x20=\x20?',_0xe3a8e0[_0x86ce('0x4b')][_0x86ce('0x71')][_0x86ce('0x70')]())[_0x86ce('0x3c')](_0x86ce('0x72'))[_0x86ce('0x3c')](_0x86ce('0x73'),squel['select']()['field'](_0x86ce('0x6a'))[_0x86ce('0x6e')](_0x86ce('0x74'))[_0x86ce('0x3c')](_0x86ce('0x75'),_0xe3a8e0[_0x86ce('0x47')]['id'][_0x86ce('0x70')]()))[_0x86ce('0x3c')](_0x86ce('0x73'),squel[_0x86ce('0x76')]()[_0x86ce('0x69')](_0x86ce('0x77'))['from']('cm_hopper_final')[_0x86ce('0x3c')]('VoiceQueueId\x20=\x20?',_0xe3a8e0[_0x86ce('0x47')]['id']['toString']())[_0x86ce('0x3c')]('state\x20=\x204'))['group'](_0x86ce('0x64')))['toString']();return db[_0x86ce('0x4d')]['query'](_0x28d475);}return[];})[_0x86ce('0x25')](respondWithResult(_0x2346a1,null))[_0x86ce('0x45')](handleError(_0x2346a1,null));};exports['moveContactsIvrCampaignHopperFinal']=function(_0x5827dd,_0x27938b,_0x506eb5){return db[_0x86ce('0x78')][_0x86ce('0x49')]({'where':{'id':_0x5827dd[_0x86ce('0x47')]['id']}})[_0x86ce('0x25')](handleEntityNotFound(_0x27938b,null))[_0x86ce('0x25')](function(_0x188a1f){var _0x3d38aa;if(_0x188a1f){_0x3d38aa=squel[_0x86ce('0x61')]()[_0x86ce('0x79')](_0x86ce('0x74'))['fromQuery'](['phone',_0x86ce('0x63'),_0x86ce('0x64'),_0x86ce('0x65'),'CampaignId',_0x86ce('0x67'),_0x86ce('0x68')],squel[_0x86ce('0x76')]()[_0x86ce('0x69')]('ANY_VALUE(calleridnum)','phone')[_0x86ce('0x69')](_0x86ce('0x6b'),_0x86ce('0x63'))['field']('ANY_VALUE(ContactId)','ContactId')[_0x86ce('0x69')]('ANY_VALUE(ListId)','ListId')[_0x86ce('0x69')]('ANY_VALUE(CampaignId)',_0x86ce('0x7a'))[_0x86ce('0x69')](_0x86ce('0x6b'),_0x86ce('0x67'))[_0x86ce('0x69')](_0x86ce('0x6b'),'updatedAt')[_0x86ce('0x6e')](_0x86ce('0x6f'))[_0x86ce('0x3c')](_0x86ce('0x7b'),_0x5827dd[_0x86ce('0x47')]['id'][_0x86ce('0x70')]())[_0x86ce('0x3c')](_0x86ce('0x7c'),_0x5827dd[_0x86ce('0x4b')]['state'][_0x86ce('0x70')]())['where']('calleridnum\x20IS\x20NOT\x20NULL')[_0x86ce('0x3c')](_0x86ce('0x73'),squel[_0x86ce('0x76')]()[_0x86ce('0x69')](_0x86ce('0x6a'))[_0x86ce('0x6e')](_0x86ce('0x74'))['where']('CampaignId\x20=\x20?',_0x5827dd[_0x86ce('0x47')]['id']['toString']()))[_0x86ce('0x3c')](_0x86ce('0x73'),squel['select']()['field']('calleridnum')['from']('cm_hopper_final')[_0x86ce('0x3c')](_0x86ce('0x7b'),_0x5827dd[_0x86ce('0x47')]['id'][_0x86ce('0x70')]())[_0x86ce('0x3c')](_0x86ce('0x7d')))['group'](_0x86ce('0x64')))[_0x86ce('0x70')]();return db['sequelize'][_0x86ce('0x33')](_0x3d38aa);}return[];})[_0x86ce('0x25')](respondWithResult(_0x27938b,null))[_0x86ce('0x45')](handleError(_0x27938b,null));};exports[_0x86ce('0x7e')]=function(_0x2014a3,_0x3cfcd1,_0x85bcb7){return db[_0x86ce('0x7f')][_0x86ce('0x80')]({'where':{'VoiceQueueId':_0x2014a3[_0x86ce('0x4b')][_0x86ce('0x66')],'CampaignId':_0x2014a3[_0x86ce('0x4b')]['CampaignId'],'ContactId':_0x2014a3[_0x86ce('0x4b')][_0x86ce('0x64')]}})[_0x86ce('0x25')](handleEntityNotFound(_0x3cfcd1,null))['then'](function(_0x2da07a){if(_0x2da07a){return _0x2da07a;}return null;})[_0x86ce('0x25')](respondWithResult(_0x3cfcd1,null))['catch'](handleError(_0x3cfcd1,null));};
\ No newline at end of file
diff --git a/server/api/cmHopperFinal/cmHopperFinal.model.js b/server/api/cmHopperFinal/cmHopperFinal.model.js
index ef1220b..dade631 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 _0x5e16=['../../config/logger','api','moment','bluebird','request-promise','path','rimraf','./cmHopperFinal.attributes','exports','define','CmHopperFinal','cm_hopper_final','calleridnum','uniqueid','lodash'];(function(_0x504c05,_0x2fe006){var _0x31c04a=function(_0x2cfd18){while(--_0x2cfd18){_0x504c05['push'](_0x504c05['shift']());}};_0x31c04a(++_0x2fe006);}(_0x5e16,0x86));var _0x65e1=function(_0x367e5b,_0x5721e4){_0x367e5b=_0x367e5b-0x0;var _0x4b909e=_0x5e16[_0x367e5b];return _0x4b909e;};'use strict';var _=require(_0x65e1('0x0'));var util=require('util');var logger=require(_0x65e1('0x1'))(_0x65e1('0x2'));var moment=require(_0x65e1('0x3'));var BPromise=require(_0x65e1('0x4'));var rp=require(_0x65e1('0x5'));var fs=require('fs');var path=require(_0x65e1('0x6'));var rimraf=require(_0x65e1('0x7'));var config=require('../../config/environment');var attributes=require(_0x65e1('0x8'));module[_0x65e1('0x9')]=function(_0x26a4ab,_0x1bd313){return _0x26a4ab[_0x65e1('0xa')](_0x65e1('0xb'),attributes,{'tableName':_0x65e1('0xc'),'paranoid':![],'indexes':[{'name':'calleridnum','fields':[_0x65e1('0xd')]},{'name':_0x65e1('0xe'),'fields':[_0x65e1('0xe')]}],'timestamps':!![]});};
\ No newline at end of file
+var _0xa8dc=['exports','define','CmHopperFinal','calleridnum','lodash','util','../../config/logger','bluebird','request-promise','path','rimraf','../../config/environment','./cmHopperFinal.attributes'];(function(_0x6b2c5c,_0x3f6949){var _0x18e3ce=function(_0x1a143f){while(--_0x1a143f){_0x6b2c5c['push'](_0x6b2c5c['shift']());}};_0x18e3ce(++_0x3f6949);}(_0xa8dc,0x6c));var _0xca8d=function(_0x2df62f,_0x108081){_0x2df62f=_0x2df62f-0x0;var _0x36c339=_0xa8dc[_0x2df62f];return _0x36c339;};'use strict';var _=require(_0xca8d('0x0'));var util=require(_0xca8d('0x1'));var logger=require(_0xca8d('0x2'))('api');var moment=require('moment');var BPromise=require(_0xca8d('0x3'));var rp=require(_0xca8d('0x4'));var fs=require('fs');var path=require(_0xca8d('0x5'));var rimraf=require(_0xca8d('0x6'));var config=require(_0xca8d('0x7'));var attributes=require(_0xca8d('0x8'));module[_0xca8d('0x9')]=function(_0x5655ea,_0x1169b8){return _0x5655ea[_0xca8d('0xa')](_0xca8d('0xb'),attributes,{'tableName':'cm_hopper_final','paranoid':![],'indexes':[{'name':_0xca8d('0xc'),'fields':[_0xca8d('0xc')]},{'name':'uniqueid','fields':['uniqueid']}],'timestamps':!![]});};
\ No newline at end of file
diff --git a/server/api/cmHopperFinal/cmHopperFinal.rpc.js b/server/api/cmHopperFinal/cmHopperFinal.rpc.js
index a1d6d66..3e58dad 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 _0x1833=['options','raw','then','debug','CreateCmHopperFinal','lodash','util','moment','bluebird','ioredis','../../config/utils','../../config/logger','rpc','jayson/promise','client','http','info','CmHopperFinal,\x20%s,\x20%s','request\x20sent','CmHopperFinal,\x20%s,\x20%s,\x20%s','stringify','error','code','message','result','catch','CmHopperFinal','create','body'];(function(_0x9f1fb1,_0x4c7ade){var _0x45477d=function(_0x2d7b41){while(--_0x2d7b41){_0x9f1fb1['push'](_0x9f1fb1['shift']());}};_0x45477d(++_0x4c7ade);}(_0x1833,0xed));var _0x3183=function(_0x531c55,_0x3f5d48){_0x531c55=_0x531c55-0x0;var _0x2968f9=_0x1833[_0x531c55];return _0x2968f9;};'use strict';var _=require(_0x3183('0x0'));var util=require(_0x3183('0x1'));var moment=require(_0x3183('0x2'));var BPromise=require(_0x3183('0x3'));var rs=require('randomstring');var fs=require('fs');var Redis=require(_0x3183('0x4'));var db=require('../../mysqldb')['db'];var utils=require(_0x3183('0x5'));var logger=require(_0x3183('0x6'))(_0x3183('0x7'));var config=require('../../config/environment');var jayson=require(_0x3183('0x8'));var client=jayson[_0x3183('0x9')][_0x3183('0xa')]({'port':0x232a});function respondWithRpcPromise(_0x2a9bbb,_0x8ced43,_0x29b687){return new BPromise(function(_0x4db73f,_0x234d78){return client['request'](_0x2a9bbb,_0x29b687)['then'](function(_0x483f8b){logger[_0x3183('0xb')](_0x3183('0xc'),_0x8ced43,_0x3183('0xd'));logger['debug'](_0x3183('0xe'),_0x8ced43,_0x3183('0xd'),JSON[_0x3183('0xf')](_0x483f8b));if(_0x483f8b[_0x3183('0x10')]){if(_0x483f8b[_0x3183('0x10')][_0x3183('0x11')]===0x1f4){logger[_0x3183('0x10')](_0x3183('0xc'),_0x8ced43,_0x483f8b[_0x3183('0x10')][_0x3183('0x12')]);return _0x234d78(_0x483f8b[_0x3183('0x10')][_0x3183('0x12')]);}logger[_0x3183('0x10')](_0x3183('0xc'),_0x8ced43,_0x483f8b[_0x3183('0x10')][_0x3183('0x12')]);return _0x4db73f(_0x483f8b[_0x3183('0x10')]['message']);}else{logger[_0x3183('0xb')](_0x3183('0xc'),_0x8ced43,_0x3183('0xd'));_0x4db73f(_0x483f8b[_0x3183('0x13')][_0x3183('0x12')]);}})[_0x3183('0x14')](function(_0x6c1aa3){logger[_0x3183('0x10')](_0x3183('0xc'),_0x8ced43,_0x6c1aa3);_0x234d78(_0x6c1aa3);});});}exports['CreateCmHopperFinal']=function(_0x47122a){var _0xebdb05=this;return new Promise(function(_0x35629d,_0x1c7ecb){return db[_0x3183('0x15')][_0x3183('0x16')](_0x47122a[_0x3183('0x17')],{'raw':_0x47122a[_0x3183('0x18')]?_0x47122a[_0x3183('0x18')][_0x3183('0x19')]===undefined?!![]:![]:!![]})[_0x3183('0x1a')](function(_0xd57b2){logger[_0x3183('0xb')]('CreateCmHopperFinal',_0x47122a);logger[_0x3183('0x1b')](_0x3183('0x1c'),_0x47122a,JSON[_0x3183('0xf')](_0xd57b2));_0x35629d(_0xd57b2);})[_0x3183('0x14')](function(_0x14ae67){logger[_0x3183('0x10')](_0x3183('0x1c'),_0x14ae67[_0x3183('0x12')],_0x47122a);_0x1c7ecb(_0xebdb05[_0x3183('0x10')](0x1f4,_0x14ae67[_0x3183('0x12')]));});});};
\ No newline at end of file
+var _0xc574=['CreateCmHopperFinal','stringify','lodash','util','moment','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','../../config/environment','jayson/promise','client','request','then','CmHopperFinal,\x20%s,\x20%s','request\x20sent','debug','CmHopperFinal,\x20%s,\x20%s,\x20%s','error','code','message','info','result','catch','CmHopperFinal','create','body','options'];(function(_0x6b62a1,_0x1d79cd){var _0x39156e=function(_0x7c6012){while(--_0x7c6012){_0x6b62a1['push'](_0x6b62a1['shift']());}};_0x39156e(++_0x1d79cd);}(_0xc574,0x107));var _0x4c57=function(_0x519d42,_0x4e97c1){_0x519d42=_0x519d42-0x0;var _0x3ac7f4=_0xc574[_0x519d42];return _0x3ac7f4;};'use strict';var _=require(_0x4c57('0x0'));var util=require(_0x4c57('0x1'));var moment=require(_0x4c57('0x2'));var BPromise=require('bluebird');var rs=require(_0x4c57('0x3'));var fs=require('fs');var Redis=require(_0x4c57('0x4'));var db=require(_0x4c57('0x5'))['db'];var utils=require(_0x4c57('0x6'));var logger=require(_0x4c57('0x7'))('rpc');var config=require(_0x4c57('0x8'));var jayson=require(_0x4c57('0x9'));var client=jayson[_0x4c57('0xa')]['http']({'port':0x232a});function respondWithRpcPromise(_0x395da1,_0xed2423,_0x3f227c){return new BPromise(function(_0x17aaa5,_0x2f7668){return client[_0x4c57('0xb')](_0x395da1,_0x3f227c)[_0x4c57('0xc')](function(_0x114a76){logger['info'](_0x4c57('0xd'),_0xed2423,_0x4c57('0xe'));logger[_0x4c57('0xf')](_0x4c57('0x10'),_0xed2423,_0x4c57('0xe'),JSON['stringify'](_0x114a76));if(_0x114a76[_0x4c57('0x11')]){if(_0x114a76[_0x4c57('0x11')][_0x4c57('0x12')]===0x1f4){logger[_0x4c57('0x11')](_0x4c57('0xd'),_0xed2423,_0x114a76[_0x4c57('0x11')][_0x4c57('0x13')]);return _0x2f7668(_0x114a76['error']['message']);}logger['error']('CmHopperFinal,\x20%s,\x20%s',_0xed2423,_0x114a76[_0x4c57('0x11')][_0x4c57('0x13')]);return _0x17aaa5(_0x114a76[_0x4c57('0x11')][_0x4c57('0x13')]);}else{logger[_0x4c57('0x14')](_0x4c57('0xd'),_0xed2423,_0x4c57('0xe'));_0x17aaa5(_0x114a76[_0x4c57('0x15')][_0x4c57('0x13')]);}})[_0x4c57('0x16')](function(_0xe0449a){logger[_0x4c57('0x11')](_0x4c57('0xd'),_0xed2423,_0xe0449a);_0x2f7668(_0xe0449a);});});}exports['CreateCmHopperFinal']=function(_0x19133a){var _0xbfda1a=this;return new Promise(function(_0xa3a9a,_0x5bc65a){return db[_0x4c57('0x17')][_0x4c57('0x18')](_0x19133a[_0x4c57('0x19')],{'raw':_0x19133a[_0x4c57('0x1a')]?_0x19133a[_0x4c57('0x1a')]['raw']===undefined?!![]:![]:!![]})['then'](function(_0x44eb8a){logger[_0x4c57('0x14')](_0x4c57('0x1b'),_0x19133a);logger['debug'](_0x4c57('0x1b'),_0x19133a,JSON[_0x4c57('0x1c')](_0x44eb8a));_0xa3a9a(_0x44eb8a);})[_0x4c57('0x16')](function(_0x3e5647){logger[_0x4c57('0x11')]('CreateCmHopperFinal',_0x3e5647[_0x4c57('0x13')],_0x19133a);_0x5bc65a(_0xbfda1a[_0x4c57('0x11')](0x1f4,_0x3e5647[_0x4c57('0x13')]));});});};
\ No newline at end of file
diff --git a/server/api/cmHopperFinal/index.js b/server/api/cmHopperFinal/index.js
index 52c38f3..6ee6812 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 _0xa809=['Router','./cmHopperFinal.controller','get','isAuthenticated','index','/describe','describe','/:id','/voice/queue/countAttributes/:id','countContactsQueueCampaignHopperFinal','countContactsIvrCampaignHopperFinal','post','/voice/queue/moveContacts/:id','moveContactsQueueCampaignHopperFinal','/voice/campaign/moveContacts/:id','moveContactsIvrCampaignHopperFinal','/checkContactHopper','put','update','exports','multer','util','path','connect-timeout','express'];(function(_0x3d9ad8,_0x31bac7){var _0x57920c=function(_0x394b51){while(--_0x394b51){_0x3d9ad8['push'](_0x3d9ad8['shift']());}};_0x57920c(++_0x31bac7);}(_0xa809,0x172));var _0x9a80=function(_0x335ffa,_0x5ccc2b){_0x335ffa=_0x335ffa-0x0;var _0x5b242d=_0xa809[_0x335ffa];return _0x5b242d;};'use strict';var multer=require(_0x9a80('0x0'));var util=require(_0x9a80('0x1'));var path=require(_0x9a80('0x2'));var timeout=require(_0x9a80('0x3'));var express=require(_0x9a80('0x4'));var router=express[_0x9a80('0x5')]();var auth=require('../../components/auth/service');var interaction=require('../../components/interaction/service');var config=require('../../config/environment');var controller=require(_0x9a80('0x6'));router[_0x9a80('0x7')]('/',auth[_0x9a80('0x8')](),controller[_0x9a80('0x9')]);router[_0x9a80('0x7')](_0x9a80('0xa'),auth[_0x9a80('0x8')](),controller[_0x9a80('0xb')]);router[_0x9a80('0x7')](_0x9a80('0xc'),auth['isAuthenticated'](),controller['show']);router[_0x9a80('0x7')](_0x9a80('0xd'),auth['isAuthenticated'](),controller[_0x9a80('0xe')]);router['get']('/campaign/countAttributes/:id',auth[_0x9a80('0x8')](),controller[_0x9a80('0xf')]);router[_0x9a80('0x10')](_0x9a80('0x11'),auth[_0x9a80('0x8')](),controller[_0x9a80('0x12')]);router[_0x9a80('0x10')](_0x9a80('0x13'),auth[_0x9a80('0x8')](),controller[_0x9a80('0x14')]);router[_0x9a80('0x10')](_0x9a80('0x15'),auth[_0x9a80('0x8')](),controller['checkContactHopper']);router[_0x9a80('0x16')](_0x9a80('0xc'),auth['isAuthenticated'](),controller[_0x9a80('0x17')]);module[_0x9a80('0x18')]=router;
\ No newline at end of file
+var _0x78c1=['/campaign/countAttributes/:id','post','/voice/queue/moveContacts/:id','moveContactsIvrCampaignHopperFinal','/checkContactHopper','checkContactHopper','put','exports','multer','util','path','connect-timeout','express','Router','../../components/auth/service','../../components/interaction/service','../../config/environment','./cmHopperFinal.controller','get','isAuthenticated','index','/describe','describe','/:id','/voice/queue/countAttributes/:id','countContactsQueueCampaignHopperFinal'];(function(_0x252243,_0x4f05e1){var _0x5ae013=function(_0x40b226){while(--_0x40b226){_0x252243['push'](_0x252243['shift']());}};_0x5ae013(++_0x4f05e1);}(_0x78c1,0x140));var _0x178c=function(_0x3e5086,_0x48f4a2){_0x3e5086=_0x3e5086-0x0;var _0xfeb102=_0x78c1[_0x3e5086];return _0xfeb102;};'use strict';var multer=require(_0x178c('0x0'));var util=require(_0x178c('0x1'));var path=require(_0x178c('0x2'));var timeout=require(_0x178c('0x3'));var express=require(_0x178c('0x4'));var router=express[_0x178c('0x5')]();var auth=require(_0x178c('0x6'));var interaction=require(_0x178c('0x7'));var config=require(_0x178c('0x8'));var controller=require(_0x178c('0x9'));router[_0x178c('0xa')]('/',auth[_0x178c('0xb')](),controller[_0x178c('0xc')]);router[_0x178c('0xa')](_0x178c('0xd'),auth[_0x178c('0xb')](),controller[_0x178c('0xe')]);router[_0x178c('0xa')](_0x178c('0xf'),auth[_0x178c('0xb')](),controller['show']);router[_0x178c('0xa')](_0x178c('0x10'),auth[_0x178c('0xb')](),controller[_0x178c('0x11')]);router[_0x178c('0xa')](_0x178c('0x12'),auth[_0x178c('0xb')](),controller['countContactsIvrCampaignHopperFinal']);router[_0x178c('0x13')](_0x178c('0x14'),auth[_0x178c('0xb')](),controller['moveContactsQueueCampaignHopperFinal']);router[_0x178c('0x13')]('/voice/campaign/moveContacts/:id',auth[_0x178c('0xb')](),controller[_0x178c('0x15')]);router['post'](_0x178c('0x16'),auth[_0x178c('0xb')](),controller[_0x178c('0x17')]);router[_0x178c('0x18')](_0x178c('0xf'),auth[_0x178c('0xb')](),controller['update']);module[_0x178c('0x19')]=router;
\ No newline at end of file
diff --git a/server/api/cmHopperHistory/cmHopperHistory.attributes.js b/server/api/cmHopperHistory/cmHopperHistory.attributes.js
index f0fac19..159f6ae 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 _0x248a=['BOOLEAN','sequelize','exports','INTEGER','DATE','STRING'];(function(_0x2d8fc2,_0x1c461d){var _0x3a9e53=function(_0x18941c){while(--_0x18941c){_0x2d8fc2['push'](_0x2d8fc2['shift']());}};_0x3a9e53(++_0x1c461d);}(_0x248a,0x181));var _0xa248=function(_0x25277c,_0x9e0b85){_0x25277c=_0x25277c-0x0;var _0x44b60e=_0x248a[_0x25277c];return _0x44b60e;};'use strict';var Sequelize=require(_0xa248('0x0'));module[_0xa248('0x1')]={'state':{'type':Sequelize[_0xa248('0x2')](0x2)},'statedesc':{'type':Sequelize['STRING']},'scheduledat':{'type':Sequelize[_0xa248('0x3')]},'countbusyretry':{'type':Sequelize['INTEGER'],'defaultValue':0x0},'countcongestionretry':{'type':Sequelize[_0xa248('0x2')],'defaultValue':0x0},'countnoanswerretry':{'type':Sequelize['INTEGER'],'defaultValue':0x0},'countglobal':{'type':Sequelize[_0xa248('0x2')],'defaultValue':0x0},'uniqueid':{'type':Sequelize[_0xa248('0x4')]},'originatecalleridnum':{'type':Sequelize[_0xa248('0x4')]},'originatecalleridname':{'type':Sequelize[_0xa248('0x4')]},'calleridnum':{'type':Sequelize[_0xa248('0x4')]},'calleridname':{'type':Sequelize[_0xa248('0x4')]},'starttime':{'type':Sequelize['DATE']},'responsetime':{'type':Sequelize[_0xa248('0x3')]},'answertime':{'type':Sequelize[_0xa248('0x3')]},'droptime':{'type':Sequelize['DATE']},'endtime':{'type':Sequelize[_0xa248('0x3')]},'ringtime':{'type':Sequelize[_0xa248('0x2')],'defaultValue':0x0},'holdtime':{'type':Sequelize[_0xa248('0x2')],'defaultValue':0x0},'talktime':{'type':Sequelize[_0xa248('0x2')],'defaultValue':0x0},'followuptime':{'type':Sequelize[_0xa248('0x2')],'defaultValue':0x0},'dropreason':{'type':Sequelize[_0xa248('0x4')]},'campaign':{'type':Sequelize[_0xa248('0x4')]},'campaigntype':{'type':Sequelize[_0xa248('0x4')]},'membername':{'type':Sequelize[_0xa248('0x4')]},'reason':{'type':Sequelize['STRING']},'amd':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'fax':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'callback':{'type':Sequelize[_0xa248('0x5')],'defaultValue':![]},'callbackuniqueid':{'type':Sequelize[_0xa248('0x4')],'defaultValue':null},'callbackat':{'type':Sequelize[_0xa248('0x3')]},'recallme':{'type':Sequelize[_0xa248('0x5')],'defaultValue':![]},'editedat':{'type':Sequelize[_0xa248('0x3')]},'edited':{'type':Sequelize[_0xa248('0x5')],'defaultValue':![]},'countnosuchnumberretry':{'type':Sequelize[_0xa248('0x2')],'defaultValue':0x0},'countdropretry':{'type':Sequelize[_0xa248('0x2')],'defaultValue':0x0},'countabandonedretry':{'type':Sequelize[_0xa248('0x2')],'defaultValue':0x0},'countmachineretry':{'type':Sequelize['INTEGER'],'defaultValue':0x0},'countagentrejectretry':{'type':Sequelize[_0xa248('0x2')],'defaultValue':0x0}};
\ No newline at end of file
+var _0xe7fd=['exports','INTEGER','STRING','DATE','BOOLEAN','sequelize'];(function(_0x382056,_0x21ee62){var _0x515a06=function(_0x4a6fd7){while(--_0x4a6fd7){_0x382056['push'](_0x382056['shift']());}};_0x515a06(++_0x21ee62);}(_0xe7fd,0xdd));var _0xde7f=function(_0x46667b,_0x350031){_0x46667b=_0x46667b-0x0;var _0x331eee=_0xe7fd[_0x46667b];return _0x331eee;};'use strict';var Sequelize=require(_0xde7f('0x0'));module[_0xde7f('0x1')]={'state':{'type':Sequelize[_0xde7f('0x2')](0x2)},'statedesc':{'type':Sequelize[_0xde7f('0x3')]},'scheduledat':{'type':Sequelize[_0xde7f('0x4')]},'countbusyretry':{'type':Sequelize[_0xde7f('0x2')],'defaultValue':0x0},'countcongestionretry':{'type':Sequelize[_0xde7f('0x2')],'defaultValue':0x0},'countnoanswerretry':{'type':Sequelize[_0xde7f('0x2')],'defaultValue':0x0},'countglobal':{'type':Sequelize['INTEGER'],'defaultValue':0x0},'uniqueid':{'type':Sequelize[_0xde7f('0x3')]},'originatecalleridnum':{'type':Sequelize['STRING']},'originatecalleridname':{'type':Sequelize[_0xde7f('0x3')]},'calleridnum':{'type':Sequelize['STRING']},'calleridname':{'type':Sequelize['STRING']},'starttime':{'type':Sequelize[_0xde7f('0x4')]},'responsetime':{'type':Sequelize[_0xde7f('0x4')]},'answertime':{'type':Sequelize['DATE']},'droptime':{'type':Sequelize['DATE']},'endtime':{'type':Sequelize[_0xde7f('0x4')]},'ringtime':{'type':Sequelize['INTEGER'],'defaultValue':0x0},'holdtime':{'type':Sequelize[_0xde7f('0x2')],'defaultValue':0x0},'talktime':{'type':Sequelize[_0xde7f('0x2')],'defaultValue':0x0},'followuptime':{'type':Sequelize[_0xde7f('0x2')],'defaultValue':0x0},'dropreason':{'type':Sequelize['STRING']},'campaign':{'type':Sequelize[_0xde7f('0x3')]},'campaigntype':{'type':Sequelize[_0xde7f('0x3')]},'membername':{'type':Sequelize[_0xde7f('0x3')]},'reason':{'type':Sequelize['STRING']},'amd':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'fax':{'type':Sequelize[_0xde7f('0x5')],'defaultValue':![]},'callback':{'type':Sequelize[_0xde7f('0x5')],'defaultValue':![]},'callbackuniqueid':{'type':Sequelize['STRING'],'defaultValue':null},'callbackat':{'type':Sequelize[_0xde7f('0x4')]},'recallme':{'type':Sequelize[_0xde7f('0x5')],'defaultValue':![]},'editedat':{'type':Sequelize['DATE']},'edited':{'type':Sequelize[_0xde7f('0x5')],'defaultValue':![]},'countnosuchnumberretry':{'type':Sequelize['INTEGER'],'defaultValue':0x0},'countdropretry':{'type':Sequelize[_0xde7f('0x2')],'defaultValue':0x0},'countabandonedretry':{'type':Sequelize[_0xde7f('0x2')],'defaultValue':0x0},'countmachineretry':{'type':Sequelize[_0xde7f('0x2')],'defaultValue':0x0},'countagentrejectretry':{'type':Sequelize[_0xde7f('0x2')],'defaultValue':0x0}};
\ No newline at end of file
diff --git a/server/api/cmHopperHistory/cmHopperHistory.controller.js b/server/api/cmHopperHistory/cmHopperHistory.controller.js
index 54db8ef..b2eec2b 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 _0x253c=['zip-dir','fast-json-patch','moment','bluebird','mustache','path','sox','to-csv','crypto','jsforce','desk.js','querystring','papaparse','../../components/auth/service','../../components/parsers/qs','../../config/license/hardware','../../config/logger','api','../../config/environment','../../mysqldb','sendStatus','status','json','offset','limit','set','apply','save','destroy','then','end','error','name','send','index','map','CmHopperHistory','rawAttributes','fieldName','type','query','keys','filters','intersection','attributes','model','fields','sort','where','pick','filter','VIRTUAL','options','count','findAll','rows','catch','params','length','includeAll','merge','create','body','describe','update','uniqueid','find','eml-format'];(function(_0x1507ec,_0x715c90){var _0x35b4db=function(_0x166226){while(--_0x166226){_0x1507ec['push'](_0x1507ec['shift']());}};_0x35b4db(++_0x715c90);}(_0x253c,0xcb));var _0xc253=function(_0x16d24f,_0x4686a5){_0x16d24f=_0x16d24f-0x0;var _0x3beec6=_0x253c[_0x16d24f];return _0x3beec6;};'use strict';var pdf=require('html-pdf');var emlformat=require(_0xc253('0x0'));var rimraf=require('rimraf');var zipdir=require(_0xc253('0x1'));var jsonpatch=require(_0xc253('0x2'));var rp=require('request-promise');var moment=require(_0xc253('0x3'));var BPromise=require(_0xc253('0x4'));var Mustache=require(_0xc253('0x5'));var util=require('util');var path=require(_0xc253('0x6'));var sox=require(_0xc253('0x7'));var csv=require(_0xc253('0x8'));var ejs=require('ejs');var fs=require('fs');var _=require('lodash');var squel=require('squel');var crypto=require(_0xc253('0x9'));var jsforce=require(_0xc253('0xa'));var deskjs=require(_0xc253('0xb'));var toCsv=require('to-csv');var querystring=require(_0xc253('0xc'));var Papa=require(_0xc253('0xd'));var Redis=require('ioredis');var authService=require(_0xc253('0xe'));var qs=require(_0xc253('0xf'));var as=require('../../components/parsers/advancedSearch');var hardwareService=require(_0xc253('0x10'));var logger=require(_0xc253('0x11'))(_0xc253('0x12'));var utils=require('../../config/utils');var config=require(_0xc253('0x13'));var db=require(_0xc253('0x14'))['db'];function respondWithStatusCode(_0xf4719a,_0x38be5d){_0x38be5d=_0x38be5d||0xcc;return function(_0x482862){if(_0x482862){return _0xf4719a[_0xc253('0x15')](_0x38be5d);}return _0xf4719a[_0xc253('0x16')](_0x38be5d)['end']();};}function respondWithResult(_0x52e8e4,_0x58d874){_0x58d874=_0x58d874||0xc8;return function(_0x1a18fc){if(_0x1a18fc){return _0x52e8e4[_0xc253('0x16')](_0x58d874)[_0xc253('0x17')](_0x1a18fc);}};}function respondWithFilteredResult(_0x100b02,_0x3c858d){return function(_0x22e6c8){if(_0x22e6c8){var _0x120a4a=_0x22e6c8['count'],_0x5876c2=_0x3c858d['offset'],_0x3dacfd=_0x3c858d[_0xc253('0x18')]+_0x3c858d[_0xc253('0x19')],_0x25a17a;if(_0x3dacfd>=_0x120a4a){_0x3dacfd=_0x120a4a;_0x25a17a=0xc8;}else{_0x25a17a=0xce;}_0x100b02[_0xc253('0x16')](_0x25a17a);return _0x100b02[_0xc253('0x1a')]('Content-Range',_0x5876c2+'-'+_0x3dacfd+'/'+_0x120a4a)[_0xc253('0x17')](_0x22e6c8);}return null;};}function patchUpdates(_0x333f43){return function(_0xd232e9){try{jsonpatch[_0xc253('0x1b')](_0xd232e9,_0x333f43,!![]);}catch(_0x5b7e8d){return BPromise['reject'](_0x5b7e8d);}return _0xd232e9[_0xc253('0x1c')]();};}function saveUpdates(_0x52cec6,_0x2955cb){return function(_0x5693ab){if(_0x5693ab){return _0x5693ab['update'](_0x52cec6)['then'](function(_0x1a4e92){return _0x1a4e92;});}return null;};}function removeEntity(_0x3e39cc,_0x48ff67){return function(_0x46a32e){if(_0x46a32e){return _0x46a32e[_0xc253('0x1d')]()[_0xc253('0x1e')](function(){_0x3e39cc[_0xc253('0x16')](0xcc)[_0xc253('0x1f')]();});}};}function handleEntityNotFound(_0x5f514f,_0x29934f){return function(_0x2e7b78){if(!_0x2e7b78){_0x5f514f[_0xc253('0x15')](0x194);}return _0x2e7b78;};}function handleError(_0x4d57dc,_0x39a7ed){_0x39a7ed=_0x39a7ed||0x1f4;return function(_0x5a32eb){logger[_0xc253('0x20')](_0x5a32eb['stack']);if(_0x5a32eb[_0xc253('0x21')]){delete _0x5a32eb['name'];}_0x4d57dc['status'](_0x39a7ed)[_0xc253('0x22')](_0x5a32eb);};}exports[_0xc253('0x23')]=function(_0x3e8564,_0x2f334e){var _0x3bc455={},_0x44e18c={},_0x502b15={'count':0x0,'rows':[]};var _0x3bf045=_[_0xc253('0x24')](db[_0xc253('0x25')][_0xc253('0x26')],function(_0x19e4b4){return{'name':_0x19e4b4[_0xc253('0x27')],'type':_0x19e4b4[_0xc253('0x28')]['key']};});_0x44e18c['model']=_[_0xc253('0x24')](_0x3bf045,_0xc253('0x21'));_0x44e18c[_0xc253('0x29')]=_[_0xc253('0x2a')](_0x3e8564['query']);_0x44e18c[_0xc253('0x2b')]=_[_0xc253('0x2c')](_0x44e18c['model'],_0x44e18c['query']);_0x3bc455[_0xc253('0x2d')]=_[_0xc253('0x2c')](_0x44e18c[_0xc253('0x2e')],qs['fields'](_0x3e8564[_0xc253('0x29')][_0xc253('0x2f')]));_0x3bc455[_0xc253('0x2d')]=_0x3bc455[_0xc253('0x2d')]['length']?_0x3bc455[_0xc253('0x2d')]:_0x44e18c[_0xc253('0x2e')];if(!_0x3e8564['query']['hasOwnProperty']('nolimit')){_0x3bc455[_0xc253('0x19')]=qs[_0xc253('0x19')](_0x3e8564['query'][_0xc253('0x19')]);_0x3bc455[_0xc253('0x18')]=qs[_0xc253('0x18')](_0x3e8564[_0xc253('0x29')][_0xc253('0x18')]);}_0x3bc455['order']=qs[_0xc253('0x30')](_0x3e8564[_0xc253('0x29')][_0xc253('0x30')]);_0x3bc455[_0xc253('0x31')]=qs[_0xc253('0x2b')](_[_0xc253('0x32')](_0x3e8564[_0xc253('0x29')],_0x44e18c[_0xc253('0x2b')]));if(_0x3e8564['query'][_0xc253('0x33')]){_0x3bc455[_0xc253('0x31')]=_['merge'](_0x3bc455[_0xc253('0x31')],{'$or':_[_0xc253('0x24')](_0x3bf045,function(_0x14f729){if(_0x14f729[_0xc253('0x28')]!==_0xc253('0x34')){var _0x56c16e={};_0x56c16e[_0x14f729[_0xc253('0x21')]]={'$like':'%'+_0x3e8564[_0xc253('0x29')][_0xc253('0x33')]+'%'};return _0x56c16e;}})});}_0x3bc455=_['merge']({},_0x3bc455,_0x3e8564[_0xc253('0x35')]);var _0x53edd2={'where':_0x3bc455[_0xc253('0x31')]};return db[_0xc253('0x25')]['count'](_0x53edd2)[_0xc253('0x1e')](function(_0xdacfd5){_0x502b15[_0xc253('0x36')]=_0xdacfd5;if(_0x3e8564[_0xc253('0x29')]['includeAll']){_0x3bc455['include']=[{'all':!![]}];}return db[_0xc253('0x25')][_0xc253('0x37')](_0x3bc455);})[_0xc253('0x1e')](function(_0x38efd9){_0x502b15[_0xc253('0x38')]=_0x38efd9;return _0x502b15;})[_0xc253('0x1e')](respondWithFilteredResult(_0x2f334e,_0x3bc455))[_0xc253('0x39')](handleError(_0x2f334e,null));};exports['show']=function(_0x5aff54,_0xd8b9b6){var _0x571297={'raw':!![],'where':{'id':_0x5aff54[_0xc253('0x3a')]['id']}},_0x1266f4={};_0x1266f4['model']=_[_0xc253('0x2a')](db[_0xc253('0x25')]['rawAttributes']);_0x1266f4['query']=_[_0xc253('0x2a')](_0x5aff54['query']);_0x1266f4[_0xc253('0x2b')]=_['intersection'](_0x1266f4['model'],_0x1266f4['query']);_0x571297[_0xc253('0x2d')]=_['intersection'](_0x1266f4[_0xc253('0x2e')],qs['fields'](_0x5aff54[_0xc253('0x29')][_0xc253('0x2f')]));_0x571297[_0xc253('0x2d')]=_0x571297[_0xc253('0x2d')][_0xc253('0x3b')]?_0x571297[_0xc253('0x2d')]:_0x1266f4[_0xc253('0x2e')];if(_0x5aff54[_0xc253('0x29')][_0xc253('0x3c')]){_0x571297['include']=[{'all':!![]}];}_0x571297=_[_0xc253('0x3d')]({},_0x571297,_0x5aff54[_0xc253('0x35')]);return db['CmHopperHistory']['find'](_0x571297)['then'](handleEntityNotFound(_0xd8b9b6,null))[_0xc253('0x1e')](respondWithResult(_0xd8b9b6,null))[_0xc253('0x39')](handleError(_0xd8b9b6,null));};exports[_0xc253('0x3e')]=function(_0x33be71,_0x8d15ec){return db[_0xc253('0x25')]['create'](_0x33be71[_0xc253('0x3f')],{})['then'](respondWithResult(_0x8d15ec,0xc9))['catch'](handleError(_0x8d15ec,null));};exports['describe']=function(_0x13d91a,_0x55cbee){return db['CmHopperHistory'][_0xc253('0x40')]()[_0xc253('0x1e')](respondWithResult(_0x55cbee,null))[_0xc253('0x39')](handleError(_0x55cbee,null));};exports[_0xc253('0x41')]=function(_0x14a442,_0x5db643){if(_0x14a442[_0xc253('0x3f')]['uniqueid']){delete _0x14a442[_0xc253('0x3f')][_0xc253('0x42')];}return db[_0xc253('0x25')][_0xc253('0x43')]({'where':{'uniqueid':_0x14a442['params']['id']}})[_0xc253('0x1e')](handleEntityNotFound(_0x5db643,null))['then'](saveUpdates(_0x14a442[_0xc253('0x3f')],null))[_0xc253('0x1e')](respondWithResult(_0x5db643,null))[_0xc253('0x39')](handleError(_0x5db643,null));};
\ No newline at end of file
+var _0x56a3=['find','create','describe','catch','body','uniqueid','html-pdf','rimraf','zip-dir','fast-json-patch','request-promise','bluebird','mustache','path','sox','to-csv','lodash','squel','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','sendStatus','end','status','count','offset','limit','set','Content-Range','json','apply','reject','save','update','then','destroy','error','stack','name','send','index','map','CmHopperHistory','fieldName','key','model','query','keys','filters','intersection','attributes','fields','order','sort','pick','filter','where','merge','type','includeAll','include','findAll','rows','params','rawAttributes','options'];(function(_0x507363,_0x32960e){var _0x25d10d=function(_0x94e31b){while(--_0x94e31b){_0x507363['push'](_0x507363['shift']());}};_0x25d10d(++_0x32960e);}(_0x56a3,0xed));var _0x356a=function(_0x14add3,_0x13ce8d){_0x14add3=_0x14add3-0x0;var _0x4a174f=_0x56a3[_0x14add3];return _0x4a174f;};'use strict';var pdf=require(_0x356a('0x0'));var emlformat=require('eml-format');var rimraf=require(_0x356a('0x1'));var zipdir=require(_0x356a('0x2'));var jsonpatch=require(_0x356a('0x3'));var rp=require(_0x356a('0x4'));var moment=require('moment');var BPromise=require(_0x356a('0x5'));var Mustache=require(_0x356a('0x6'));var util=require('util');var path=require(_0x356a('0x7'));var sox=require(_0x356a('0x8'));var csv=require(_0x356a('0x9'));var ejs=require('ejs');var fs=require('fs');var _=require(_0x356a('0xa'));var squel=require(_0x356a('0xb'));var crypto=require(_0x356a('0xc'));var jsforce=require(_0x356a('0xd'));var deskjs=require('desk.js');var toCsv=require(_0x356a('0x9'));var querystring=require(_0x356a('0xe'));var Papa=require(_0x356a('0xf'));var Redis=require(_0x356a('0x10'));var authService=require(_0x356a('0x11'));var qs=require(_0x356a('0x12'));var as=require(_0x356a('0x13'));var hardwareService=require(_0x356a('0x14'));var logger=require(_0x356a('0x15'))(_0x356a('0x16'));var utils=require(_0x356a('0x17'));var config=require(_0x356a('0x18'));var db=require(_0x356a('0x19'))['db'];function respondWithStatusCode(_0x246f43,_0x223b81){_0x223b81=_0x223b81||0xcc;return function(_0x4320a8){if(_0x4320a8){return _0x246f43[_0x356a('0x1a')](_0x223b81);}return _0x246f43['status'](_0x223b81)[_0x356a('0x1b')]();};}function respondWithResult(_0xb5ecc3,_0x4bcf15){_0x4bcf15=_0x4bcf15||0xc8;return function(_0x7c72fc){if(_0x7c72fc){return _0xb5ecc3[_0x356a('0x1c')](_0x4bcf15)['json'](_0x7c72fc);}};}function respondWithFilteredResult(_0x2505a0,_0xe52a5b){return function(_0x58866a){if(_0x58866a){var _0x5d665c=_0x58866a[_0x356a('0x1d')],_0x22d342=_0xe52a5b['offset'],_0x5e9302=_0xe52a5b[_0x356a('0x1e')]+_0xe52a5b[_0x356a('0x1f')],_0x21d11c;if(_0x5e9302>=_0x5d665c){_0x5e9302=_0x5d665c;_0x21d11c=0xc8;}else{_0x21d11c=0xce;}_0x2505a0[_0x356a('0x1c')](_0x21d11c);return _0x2505a0[_0x356a('0x20')](_0x356a('0x21'),_0x22d342+'-'+_0x5e9302+'/'+_0x5d665c)[_0x356a('0x22')](_0x58866a);}return null;};}function patchUpdates(_0x481dec){return function(_0x4f1e59){try{jsonpatch[_0x356a('0x23')](_0x4f1e59,_0x481dec,!![]);}catch(_0x331431){return BPromise[_0x356a('0x24')](_0x331431);}return _0x4f1e59[_0x356a('0x25')]();};}function saveUpdates(_0x5a717b,_0x4ec618){return function(_0x3d705b){if(_0x3d705b){return _0x3d705b[_0x356a('0x26')](_0x5a717b)[_0x356a('0x27')](function(_0x10ca5a){return _0x10ca5a;});}return null;};}function removeEntity(_0x249e7b,_0x4c256c){return function(_0x5a5a60){if(_0x5a5a60){return _0x5a5a60[_0x356a('0x28')]()[_0x356a('0x27')](function(){_0x249e7b[_0x356a('0x1c')](0xcc)[_0x356a('0x1b')]();});}};}function handleEntityNotFound(_0xa9b968,_0x3ed742){return function(_0x3b59d6){if(!_0x3b59d6){_0xa9b968['sendStatus'](0x194);}return _0x3b59d6;};}function handleError(_0x4e8f85,_0x5647ef){_0x5647ef=_0x5647ef||0x1f4;return function(_0x550502){logger[_0x356a('0x29')](_0x550502[_0x356a('0x2a')]);if(_0x550502[_0x356a('0x2b')]){delete _0x550502[_0x356a('0x2b')];}_0x4e8f85[_0x356a('0x1c')](_0x5647ef)[_0x356a('0x2c')](_0x550502);};}exports[_0x356a('0x2d')]=function(_0x4263ab,_0x4f074c){var _0x12e97a={},_0x33a9fc={},_0x145083={'count':0x0,'rows':[]};var _0x52063a=_[_0x356a('0x2e')](db[_0x356a('0x2f')]['rawAttributes'],function(_0x1e7f23){return{'name':_0x1e7f23[_0x356a('0x30')],'type':_0x1e7f23['type'][_0x356a('0x31')]};});_0x33a9fc[_0x356a('0x32')]=_[_0x356a('0x2e')](_0x52063a,'name');_0x33a9fc[_0x356a('0x33')]=_[_0x356a('0x34')](_0x4263ab[_0x356a('0x33')]);_0x33a9fc[_0x356a('0x35')]=_[_0x356a('0x36')](_0x33a9fc['model'],_0x33a9fc[_0x356a('0x33')]);_0x12e97a[_0x356a('0x37')]=_['intersection'](_0x33a9fc[_0x356a('0x32')],qs[_0x356a('0x38')](_0x4263ab[_0x356a('0x33')][_0x356a('0x38')]));_0x12e97a[_0x356a('0x37')]=_0x12e97a[_0x356a('0x37')]['length']?_0x12e97a[_0x356a('0x37')]:_0x33a9fc['model'];if(!_0x4263ab['query']['hasOwnProperty']('nolimit')){_0x12e97a[_0x356a('0x1f')]=qs[_0x356a('0x1f')](_0x4263ab[_0x356a('0x33')]['limit']);_0x12e97a[_0x356a('0x1e')]=qs['offset'](_0x4263ab['query'][_0x356a('0x1e')]);}_0x12e97a[_0x356a('0x39')]=qs[_0x356a('0x3a')](_0x4263ab['query'][_0x356a('0x3a')]);_0x12e97a['where']=qs['filters'](_[_0x356a('0x3b')](_0x4263ab[_0x356a('0x33')],_0x33a9fc[_0x356a('0x35')]));if(_0x4263ab[_0x356a('0x33')][_0x356a('0x3c')]){_0x12e97a[_0x356a('0x3d')]=_[_0x356a('0x3e')](_0x12e97a[_0x356a('0x3d')],{'$or':_[_0x356a('0x2e')](_0x52063a,function(_0x131098){if(_0x131098[_0x356a('0x3f')]!=='VIRTUAL'){var _0x57a004={};_0x57a004[_0x131098[_0x356a('0x2b')]]={'$like':'%'+_0x4263ab[_0x356a('0x33')][_0x356a('0x3c')]+'%'};return _0x57a004;}})});}_0x12e97a=_[_0x356a('0x3e')]({},_0x12e97a,_0x4263ab['options']);var _0x4f0f65={'where':_0x12e97a['where']};return db[_0x356a('0x2f')][_0x356a('0x1d')](_0x4f0f65)[_0x356a('0x27')](function(_0x47de2d){_0x145083[_0x356a('0x1d')]=_0x47de2d;if(_0x4263ab['query'][_0x356a('0x40')]){_0x12e97a[_0x356a('0x41')]=[{'all':!![]}];}return db[_0x356a('0x2f')][_0x356a('0x42')](_0x12e97a);})['then'](function(_0x252c6e){_0x145083[_0x356a('0x43')]=_0x252c6e;return _0x145083;})[_0x356a('0x27')](respondWithFilteredResult(_0x4f074c,_0x12e97a))['catch'](handleError(_0x4f074c,null));};exports['show']=function(_0x1fc45a,_0x507a3d){var _0x591948={'raw':!![],'where':{'id':_0x1fc45a[_0x356a('0x44')]['id']}},_0x27cffc={};_0x27cffc[_0x356a('0x32')]=_[_0x356a('0x34')](db[_0x356a('0x2f')][_0x356a('0x45')]);_0x27cffc[_0x356a('0x33')]=_[_0x356a('0x34')](_0x1fc45a[_0x356a('0x33')]);_0x27cffc[_0x356a('0x35')]=_['intersection'](_0x27cffc[_0x356a('0x32')],_0x27cffc['query']);_0x591948[_0x356a('0x37')]=_[_0x356a('0x36')](_0x27cffc[_0x356a('0x32')],qs[_0x356a('0x38')](_0x1fc45a[_0x356a('0x33')][_0x356a('0x38')]));_0x591948['attributes']=_0x591948[_0x356a('0x37')]['length']?_0x591948[_0x356a('0x37')]:_0x27cffc['model'];if(_0x1fc45a[_0x356a('0x33')][_0x356a('0x40')]){_0x591948['include']=[{'all':!![]}];}_0x591948=_[_0x356a('0x3e')]({},_0x591948,_0x1fc45a[_0x356a('0x46')]);return db[_0x356a('0x2f')][_0x356a('0x47')](_0x591948)[_0x356a('0x27')](handleEntityNotFound(_0x507a3d,null))['then'](respondWithResult(_0x507a3d,null))['catch'](handleError(_0x507a3d,null));};exports[_0x356a('0x48')]=function(_0x44c738,_0x28c695){return db[_0x356a('0x2f')]['create'](_0x44c738['body'],{})[_0x356a('0x27')](respondWithResult(_0x28c695,0xc9))['catch'](handleError(_0x28c695,null));};exports['describe']=function(_0x3a3eef,_0x5537d9){return db['CmHopperHistory'][_0x356a('0x49')]()[_0x356a('0x27')](respondWithResult(_0x5537d9,null))[_0x356a('0x4a')](handleError(_0x5537d9,null));};exports[_0x356a('0x26')]=function(_0x422eac,_0x53b489){if(_0x422eac[_0x356a('0x4b')][_0x356a('0x4c')]){delete _0x422eac[_0x356a('0x4b')]['uniqueid'];}return db[_0x356a('0x2f')][_0x356a('0x47')]({'where':{'uniqueid':_0x422eac[_0x356a('0x44')]['id']}})[_0x356a('0x27')](handleEntityNotFound(_0x53b489,null))[_0x356a('0x27')](saveUpdates(_0x422eac[_0x356a('0x4b')],null))[_0x356a('0x27')](respondWithResult(_0x53b489,null))['catch'](handleError(_0x53b489,null));};
\ No newline at end of file
diff --git a/server/api/cmHopperHistory/cmHopperHistory.model.js b/server/api/cmHopperHistory/cmHopperHistory.model.js
index 6715c3b..8edf4ad 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 _0xc08b=['moment','bluebird','../../config/environment','./cmHopperHistory.attributes','exports','define','CmHopperHistory','endtime','uniqueid','lodash','util','../../config/logger'];(function(_0x163e9f,_0x17f56d){var _0x9a6653=function(_0x4d10a0){while(--_0x4d10a0){_0x163e9f['push'](_0x163e9f['shift']());}};_0x9a6653(++_0x17f56d);}(_0xc08b,0x1d1));var _0xbc08=function(_0x1a4b3d,_0x1bc634){_0x1a4b3d=_0x1a4b3d-0x0;var _0x57129e=_0xc08b[_0x1a4b3d];return _0x57129e;};'use strict';var _=require(_0xbc08('0x0'));var util=require(_0xbc08('0x1'));var logger=require(_0xbc08('0x2'))('api');var moment=require(_0xbc08('0x3'));var BPromise=require(_0xbc08('0x4'));var rp=require('request-promise');var fs=require('fs');var path=require('path');var rimraf=require('rimraf');var config=require(_0xbc08('0x5'));var attributes=require(_0xbc08('0x6'));module[_0xbc08('0x7')]=function(_0x44144e,_0x1b672c){return _0x44144e[_0xbc08('0x8')](_0xbc08('0x9'),attributes,{'tableName':'cm_hopper_history','paranoid':![],'indexes':[{'name':_0xbc08('0xa'),'fields':[_0xbc08('0xa')]},{'name':_0xbc08('0xb'),'fields':[_0xbc08('0xb')]}],'timestamps':!![]});};
\ No newline at end of file
+var _0xcefb=['request-promise','path','rimraf','./cmHopperHistory.attributes','exports','CmHopperHistory','uniqueid','lodash','util','../../config/logger','api','moment','bluebird'];(function(_0x20a584,_0xe384a5){var _0x4b41a8=function(_0x2127c6){while(--_0x2127c6){_0x20a584['push'](_0x20a584['shift']());}};_0x4b41a8(++_0xe384a5);}(_0xcefb,0x125));var _0xbcef=function(_0x1a7edf,_0x5c4e04){_0x1a7edf=_0x1a7edf-0x0;var _0x56c1d9=_0xcefb[_0x1a7edf];return _0x56c1d9;};'use strict';var _=require(_0xbcef('0x0'));var util=require(_0xbcef('0x1'));var logger=require(_0xbcef('0x2'))(_0xbcef('0x3'));var moment=require(_0xbcef('0x4'));var BPromise=require(_0xbcef('0x5'));var rp=require(_0xbcef('0x6'));var fs=require('fs');var path=require(_0xbcef('0x7'));var rimraf=require(_0xbcef('0x8'));var config=require('../../config/environment');var attributes=require(_0xbcef('0x9'));module[_0xbcef('0xa')]=function(_0x50f21b,_0x10f083){return _0x50f21b['define'](_0xbcef('0xb'),attributes,{'tableName':'cm_hopper_history','paranoid':![],'indexes':[{'name':'endtime','fields':['endtime']},{'name':_0xbcef('0xc'),'fields':[_0xbcef('0xc')]}],'timestamps':!![]});};
\ No newline at end of file
diff --git a/server/api/cmHopperHistory/cmHopperHistory.rpc.js b/server/api/cmHopperHistory/cmHopperHistory.rpc.js
index dc3e9db..6c14c98 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 _0xd8b0=['options','raw','AvgHandleTime','findAll','where','sequelize','col','predictiveIntervalTotalCalls','COUNT','`state`\x20=\x204,\x201,\x20null','literal','`state`\x20=\x2010,\x201,\x20null','predictiveIntervalDroppedCallsTimeout','`state`\x20=\x2011,\x201,\x20null','AVG','`state`\x20=\x204,\x20`holdtime`,\x20null','predictiveIntervalAvgHoldtime','predictiveIntervalAvgTalktime','GetVoiceQueueHopperHistory','campaign','`state`\x20=\x200,\x201,\x20null','outboundNoSuchCallsDay','outboundNoAnswerCallsDay','outboundAnswerCallsDay','`state`\x20=\x2010\x20,\x201,\x20null','outboundDropCallsDayCallersExit','`state`\x20=\x2012,\x201,\x20null','outboundUnknownCallsDay','`state`\x20=\x2013,\x201,\x20null','outboundBlacklistCallsDay','`state`\x20=\x2014,\x201,\x20null','outboundOriginateFailureCallsDay','`state`\x20=\x2018,\x201,\x20null','outboundRejectCallsDay','`state`\x20=\x2016,\x201,\x20null','outboundAnswerAgiCallsDay','`state`\x20=\x2020,\x201,\x20null','`state`\x20=\x2022\x20or\x20`state`\x20=\x2023,\x201,\x20null','GetCampaignHopperHistory','ivrTotalCallsDays','ivrAnswerCallsDay','lodash','util','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','client','http','request','then','info','CmHopperHistory,\x20%s,\x20%s','request\x20sent','debug','CmHopperHistory,\x20%s,\x20%s,\x20%s','stringify','error','code','message','result','catch','CreateCmHopperHistory','CmHopperHistory','body'];(function(_0x427502,_0x4e6214){var _0x1baeff=function(_0x1491e6){while(--_0x1491e6){_0x427502['push'](_0x427502['shift']());}};_0x1baeff(++_0x4e6214);}(_0xd8b0,0xad));var _0x0d8b=function(_0x122ef9,_0x451d2a){_0x122ef9=_0x122ef9-0x0;var _0x42fba0=_0xd8b0[_0x122ef9];return _0x42fba0;};'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')]['create'](_0x5fecbd[_0x0d8b('0x18')],{'raw':_0x5fecbd[_0x0d8b('0x19')]?_0x5fecbd[_0x0d8b('0x19')][_0x0d8b('0x1a')]===undefined?!![]:![]:!![]})[_0x0d8b('0xa')](function(_0x5b709c){logger[_0x0d8b('0xb')](_0x0d8b('0x16'),_0x5fecbd);logger['debug']('CreateCmHopperHistory',_0x5fecbd,JSON[_0x0d8b('0x10')](_0x5b709c));_0x18dd2d(_0x5b709c);})['catch'](function(_0x56c729){logger['error'](_0x0d8b('0x16'),_0x56c729[_0x0d8b('0x13')],_0x5fecbd);_0x264b39(_0x333674[_0x0d8b('0x11')](0x1f4,_0x56c729[_0x0d8b('0x13')]));});});};exports[_0x0d8b('0x1b')]=function(_0x2c64e2){var _0x30980c=this;return new Promise(function(_0x4562cb,_0x27b695){return db['CmHopperHistory'][_0x0d8b('0x1c')]({'raw':_0x2c64e2[_0x0d8b('0x19')]?_0x2c64e2['options'][_0x0d8b('0x1a')]===undefined?!![]:![]:!![],'where':_0x2c64e2['options']?_0x2c64e2[_0x0d8b('0x19')][_0x0d8b('0x1d')]||null:null,'attributes':[[db[_0x0d8b('0x1e')]['fn']('COUNT',db['sequelize'][_0x0d8b('0x1f')]('id')),_0x0d8b('0x20')],[db['sequelize']['fn'](_0x0d8b('0x21'),db['sequelize']['fn']('IF',db[_0x0d8b('0x1e')]['literal'](_0x0d8b('0x22')))),'predictiveIntervalAnsweredCalls'],[db[_0x0d8b('0x1e')]['fn']('COUNT',db[_0x0d8b('0x1e')]['fn']('IF',db['sequelize'][_0x0d8b('0x23')](_0x0d8b('0x24')))),_0x0d8b('0x25')],[db['sequelize']['fn']('COUNT',db['sequelize']['fn']('IF',db[_0x0d8b('0x1e')]['literal'](_0x0d8b('0x26')))),'predictiveIntervalDroppedCallsCallersExit'],[db['sequelize']['fn'](_0x0d8b('0x27'),db[_0x0d8b('0x1e')]['fn']('IF',db[_0x0d8b('0x1e')][_0x0d8b('0x23')](_0x0d8b('0x28')))),_0x0d8b('0x29')],[db[_0x0d8b('0x1e')]['fn'](_0x0d8b('0x27'),db['sequelize']['fn']('IF',db[_0x0d8b('0x1e')][_0x0d8b('0x23')]('`state`\x20=\x204,\x20`talktime`,\x20null'))),_0x0d8b('0x2a')]]})[_0x0d8b('0xa')](function(_0x18a905){logger['info'](_0x0d8b('0x1b'),_0x2c64e2);logger[_0x0d8b('0xe')](_0x0d8b('0x1b'),_0x2c64e2,JSON[_0x0d8b('0x10')](_0x18a905));_0x4562cb(_0x18a905);})[_0x0d8b('0x15')](function(_0x55d742){logger[_0x0d8b('0x11')](_0x0d8b('0x1b'),_0x55d742['message'],_0x2c64e2);_0x27b695(_0x30980c[_0x0d8b('0x11')](0x1f4,_0x55d742[_0x0d8b('0x13')]));});});};exports[_0x0d8b('0x2b')]=function(_0x974b9b){var _0x373544=this;return new Promise(function(_0x519088,_0x497a71){return db[_0x0d8b('0x17')]['findAll']({'raw':_0x974b9b['options']?_0x974b9b[_0x0d8b('0x19')][_0x0d8b('0x1a')]===undefined?!![]:![]:!![],'where':_0x974b9b[_0x0d8b('0x19')]?_0x974b9b[_0x0d8b('0x19')][_0x0d8b('0x1d')]||null:null,'attributes':[[_0x0d8b('0x2c'),'name'],[db[_0x0d8b('0x1e')]['fn'](_0x0d8b('0x21'),db[_0x0d8b('0x1e')]['fn']('IF',db[_0x0d8b('0x1e')][_0x0d8b('0x23')](_0x0d8b('0x2d')))),_0x0d8b('0x2e')],[db['sequelize']['fn'](_0x0d8b('0x21'),db[_0x0d8b('0x1e')]['fn']('IF',db[_0x0d8b('0x1e')][_0x0d8b('0x23')]('`state`\x20=\x203,\x201,\x20null'))),_0x0d8b('0x2f')],[db['sequelize']['fn'](_0x0d8b('0x21'),db[_0x0d8b('0x1e')]['fn']('IF',db[_0x0d8b('0x1e')][_0x0d8b('0x23')](_0x0d8b('0x22')))),_0x0d8b('0x30')],[db[_0x0d8b('0x1e')]['fn'](_0x0d8b('0x21'),db[_0x0d8b('0x1e')]['fn']('IF',db[_0x0d8b('0x1e')]['literal']('`state`\x20=\x205,\x201,\x20null'))),'outboundBusyCallsDay'],[db['sequelize']['fn']('COUNT',db[_0x0d8b('0x1e')]['fn']('IF',db[_0x0d8b('0x1e')][_0x0d8b('0x23')]('`state`\x20=\x208,\x201,\x20null'))),'outboundCongestionCallsDay'],[db[_0x0d8b('0x1e')]['fn'](_0x0d8b('0x21'),db[_0x0d8b('0x1e')]['fn']('IF',db['sequelize'][_0x0d8b('0x23')](_0x0d8b('0x31')))),'outboundDropCallsDayTimeout'],[db['sequelize']['fn'](_0x0d8b('0x21'),db['sequelize']['fn']('IF',db[_0x0d8b('0x1e')]['literal']('`state`\x20=\x2011\x20,\x201,\x20null'))),_0x0d8b('0x32')],[db[_0x0d8b('0x1e')]['fn']('COUNT',db['sequelize']['fn']('IF',db['sequelize']['literal'](_0x0d8b('0x33')))),_0x0d8b('0x34')],[db[_0x0d8b('0x1e')]['fn']('COUNT',db[_0x0d8b('0x1e')]['fn']('IF',db[_0x0d8b('0x1e')][_0x0d8b('0x23')](_0x0d8b('0x35')))),_0x0d8b('0x36')],[db[_0x0d8b('0x1e')]['fn'](_0x0d8b('0x21'),db[_0x0d8b('0x1e')]['fn']('IF',db[_0x0d8b('0x1e')][_0x0d8b('0x23')](_0x0d8b('0x37')))),_0x0d8b('0x38')],[db[_0x0d8b('0x1e')]['fn'](_0x0d8b('0x21'),db[_0x0d8b('0x1e')]['fn']('IF',db[_0x0d8b('0x1e')][_0x0d8b('0x23')](_0x0d8b('0x39')))),_0x0d8b('0x3a')],[db['sequelize']['fn'](_0x0d8b('0x21'),db['sequelize']['fn']('IF',db['sequelize'][_0x0d8b('0x23')](_0x0d8b('0x3b')))),_0x0d8b('0x3c')],[db[_0x0d8b('0x1e')]['fn']('COUNT',db[_0x0d8b('0x1e')]['fn']('IF',db[_0x0d8b('0x1e')][_0x0d8b('0x23')](_0x0d8b('0x3d')))),_0x0d8b('0x3a')],[db['sequelize']['fn']('COUNT',db['sequelize']['fn']('IF',db['sequelize'][_0x0d8b('0x23')](_0x0d8b('0x3e')))),'outboundReCallsDay']],'group':['campaign']})[_0x0d8b('0xa')](function(_0x3d3cb6){logger['info']('GetVoiceQueueHopperHistory',_0x974b9b);logger[_0x0d8b('0xe')](_0x0d8b('0x2b'),_0x974b9b,JSON[_0x0d8b('0x10')](_0x3d3cb6));_0x519088(_0x3d3cb6);})[_0x0d8b('0x15')](function(_0x2d5519){logger['error'](_0x0d8b('0x2b'),_0x2d5519[_0x0d8b('0x13')],_0x974b9b);_0x497a71(_0x373544['error'](0x1f4,_0x2d5519['message']));});});};exports[_0x0d8b('0x3f')]=function(_0x3f2d95){var _0x546fef=this;return new Promise(function(_0x55a489,_0xb8be3b){return db[_0x0d8b('0x17')][_0x0d8b('0x1c')]({'raw':_0x3f2d95[_0x0d8b('0x19')]?_0x3f2d95['options'][_0x0d8b('0x1a')]===undefined?!![]:![]:!![],'where':_0x3f2d95['options']?_0x3f2d95['options'][_0x0d8b('0x1d')]||null:null,'attributes':[[_0x0d8b('0x2c'),'name'],[db['sequelize']['fn'](_0x0d8b('0x21'),db[_0x0d8b('0x1e')][_0x0d8b('0x1f')]('id')),_0x0d8b('0x40')],[db[_0x0d8b('0x1e')]['fn'](_0x0d8b('0x21'),db[_0x0d8b('0x1e')]['fn']('IF',db[_0x0d8b('0x1e')]['literal'](_0x0d8b('0x22')))),_0x0d8b('0x41')]],'group':[_0x0d8b('0x2c')]})[_0x0d8b('0xa')](function(_0x3fb9ea){logger[_0x0d8b('0xb')](_0x0d8b('0x3f'),_0x3f2d95);logger[_0x0d8b('0xe')](_0x0d8b('0x3f'),_0x3f2d95,JSON['stringify'](_0x3fb9ea));_0x55a489(_0x3fb9ea);})[_0x0d8b('0x15')](function(_0x451940){logger[_0x0d8b('0x11')](_0x0d8b('0x3f'),_0x451940[_0x0d8b('0x13')],_0x3f2d95);_0xb8be3b(_0x546fef['error'](0x1f4,_0x451940[_0x0d8b('0x13')]));});});};
\ No newline at end of file
+var _0x0abf=['`state`\x20=\x208,\x201,\x20null','outboundCongestionCallsDay','`state`\x20=\x2010\x20,\x201,\x20null','`state`\x20=\x2011\x20,\x201,\x20null','outboundDropCallsDayCallersExit','`state`\x20=\x2012,\x201,\x20null','outboundUnknownCallsDay','`state`\x20=\x2013,\x201,\x20null','`state`\x20=\x2014,\x201,\x20null','outboundOriginateFailureCallsDay','`state`\x20=\x2018,\x201,\x20null','outboundRejectCallsDay','`state`\x20=\x2016,\x201,\x20null','outboundAnswerAgiCallsDay','`state`\x20=\x2020,\x201,\x20null','`state`\x20=\x2022\x20or\x20`state`\x20=\x2023,\x201,\x20null','outboundReCallsDay','ivrTotalCallsDays','GetCampaignHopperHistory','lodash','moment','bluebird','../../mysqldb','../../config/logger','rpc','../../config/environment','jayson/promise','client','http','request','info','CmHopperHistory,\x20%s,\x20%s','CmHopperHistory,\x20%s,\x20%s,\x20%s','stringify','error','code','message','request\x20sent','result','catch','CreateCmHopperHistory','CmHopperHistory','create','body','options','raw','then','AvgHandleTime','where','sequelize','COUNT','col','literal','`state`\x20=\x204,\x201,\x20null','predictiveIntervalAnsweredCalls','`state`\x20=\x2010,\x201,\x20null','`state`\x20=\x2011,\x201,\x20null','predictiveIntervalDroppedCallsCallersExit','predictiveIntervalAvgHoldtime','`state`\x20=\x204,\x20`talktime`,\x20null','predictiveIntervalAvgTalktime','debug','campaign','name','`state`\x20=\x200,\x201,\x20null','outboundNoSuchCallsDay','`state`\x20=\x203,\x201,\x20null','outboundNoAnswerCallsDay','outboundAnswerCallsDay','`state`\x20=\x205,\x201,\x20null','outboundBusyCallsDay'];(function(_0x5974d8,_0x2fa04f){var _0x67b362=function(_0x4608d2){while(--_0x4608d2){_0x5974d8['push'](_0x5974d8['shift']());}};_0x67b362(++_0x2fa04f);}(_0x0abf,0xe8));var _0xf0ab=function(_0x1facfa,_0x1acf7d){_0x1facfa=_0x1facfa-0x0;var _0x9ec701=_0x0abf[_0x1facfa];return _0x9ec701;};'use strict';var _=require(_0xf0ab('0x0'));var util=require('util');var moment=require(_0xf0ab('0x1'));var BPromise=require(_0xf0ab('0x2'));var rs=require('randomstring');var fs=require('fs');var Redis=require('ioredis');var db=require(_0xf0ab('0x3'))['db'];var utils=require('../../config/utils');var logger=require(_0xf0ab('0x4'))(_0xf0ab('0x5'));var config=require(_0xf0ab('0x6'));var jayson=require(_0xf0ab('0x7'));var client=jayson[_0xf0ab('0x8')][_0xf0ab('0x9')]({'port':0x232a});function respondWithRpcPromise(_0x233afe,_0x57ff3b,_0x2c4628){return new BPromise(function(_0x3f7e2b,_0x3ca099){return client[_0xf0ab('0xa')](_0x233afe,_0x2c4628)['then'](function(_0x472508){logger[_0xf0ab('0xb')](_0xf0ab('0xc'),_0x57ff3b,'request\x20sent');logger['debug'](_0xf0ab('0xd'),_0x57ff3b,'request\x20sent',JSON[_0xf0ab('0xe')](_0x472508));if(_0x472508[_0xf0ab('0xf')]){if(_0x472508[_0xf0ab('0xf')][_0xf0ab('0x10')]===0x1f4){logger[_0xf0ab('0xf')](_0xf0ab('0xc'),_0x57ff3b,_0x472508[_0xf0ab('0xf')]['message']);return _0x3ca099(_0x472508[_0xf0ab('0xf')][_0xf0ab('0x11')]);}logger[_0xf0ab('0xf')](_0xf0ab('0xc'),_0x57ff3b,_0x472508[_0xf0ab('0xf')][_0xf0ab('0x11')]);return _0x3f7e2b(_0x472508[_0xf0ab('0xf')][_0xf0ab('0x11')]);}else{logger[_0xf0ab('0xb')](_0xf0ab('0xc'),_0x57ff3b,_0xf0ab('0x12'));_0x3f7e2b(_0x472508[_0xf0ab('0x13')][_0xf0ab('0x11')]);}})[_0xf0ab('0x14')](function(_0x230f40){logger['error'](_0xf0ab('0xc'),_0x57ff3b,_0x230f40);_0x3ca099(_0x230f40);});});}exports[_0xf0ab('0x15')]=function(_0x1803f0){var _0x1ffeb5=this;return new Promise(function(_0x776619,_0xb9a33){return db[_0xf0ab('0x16')][_0xf0ab('0x17')](_0x1803f0[_0xf0ab('0x18')],{'raw':_0x1803f0[_0xf0ab('0x19')]?_0x1803f0[_0xf0ab('0x19')][_0xf0ab('0x1a')]===undefined?!![]:![]:!![]})[_0xf0ab('0x1b')](function(_0x22a205){logger[_0xf0ab('0xb')](_0xf0ab('0x15'),_0x1803f0);logger['debug'](_0xf0ab('0x15'),_0x1803f0,JSON[_0xf0ab('0xe')](_0x22a205));_0x776619(_0x22a205);})[_0xf0ab('0x14')](function(_0x11ab3a){logger[_0xf0ab('0xf')](_0xf0ab('0x15'),_0x11ab3a[_0xf0ab('0x11')],_0x1803f0);_0xb9a33(_0x1ffeb5[_0xf0ab('0xf')](0x1f4,_0x11ab3a[_0xf0ab('0x11')]));});});};exports[_0xf0ab('0x1c')]=function(_0x43119f){var _0x5645b2=this;return new Promise(function(_0x585841,_0x4eee21){return db[_0xf0ab('0x16')]['findAll']({'raw':_0x43119f[_0xf0ab('0x19')]?_0x43119f[_0xf0ab('0x19')]['raw']===undefined?!![]:![]:!![],'where':_0x43119f[_0xf0ab('0x19')]?_0x43119f[_0xf0ab('0x19')][_0xf0ab('0x1d')]||null:null,'attributes':[[db[_0xf0ab('0x1e')]['fn'](_0xf0ab('0x1f'),db['sequelize'][_0xf0ab('0x20')]('id')),'predictiveIntervalTotalCalls'],[db['sequelize']['fn'](_0xf0ab('0x1f'),db[_0xf0ab('0x1e')]['fn']('IF',db[_0xf0ab('0x1e')][_0xf0ab('0x21')](_0xf0ab('0x22')))),_0xf0ab('0x23')],[db[_0xf0ab('0x1e')]['fn'](_0xf0ab('0x1f'),db[_0xf0ab('0x1e')]['fn']('IF',db[_0xf0ab('0x1e')][_0xf0ab('0x21')](_0xf0ab('0x24')))),'predictiveIntervalDroppedCallsTimeout'],[db[_0xf0ab('0x1e')]['fn'](_0xf0ab('0x1f'),db['sequelize']['fn']('IF',db['sequelize'][_0xf0ab('0x21')](_0xf0ab('0x25')))),_0xf0ab('0x26')],[db['sequelize']['fn']('AVG',db[_0xf0ab('0x1e')]['fn']('IF',db['sequelize'][_0xf0ab('0x21')]('`state`\x20=\x204,\x20`holdtime`,\x20null'))),_0xf0ab('0x27')],[db[_0xf0ab('0x1e')]['fn']('AVG',db['sequelize']['fn']('IF',db[_0xf0ab('0x1e')][_0xf0ab('0x21')](_0xf0ab('0x28')))),_0xf0ab('0x29')]]})[_0xf0ab('0x1b')](function(_0x36195d){logger[_0xf0ab('0xb')](_0xf0ab('0x1c'),_0x43119f);logger[_0xf0ab('0x2a')](_0xf0ab('0x1c'),_0x43119f,JSON[_0xf0ab('0xe')](_0x36195d));_0x585841(_0x36195d);})[_0xf0ab('0x14')](function(_0x22dcfe){logger[_0xf0ab('0xf')]('AvgHandleTime',_0x22dcfe[_0xf0ab('0x11')],_0x43119f);_0x4eee21(_0x5645b2[_0xf0ab('0xf')](0x1f4,_0x22dcfe[_0xf0ab('0x11')]));});});};exports['GetVoiceQueueHopperHistory']=function(_0x9e38af){var _0xe4d58b=this;return new Promise(function(_0x5d99e7,_0x58bc85){return db[_0xf0ab('0x16')]['findAll']({'raw':_0x9e38af[_0xf0ab('0x19')]?_0x9e38af['options'][_0xf0ab('0x1a')]===undefined?!![]:![]:!![],'where':_0x9e38af[_0xf0ab('0x19')]?_0x9e38af[_0xf0ab('0x19')][_0xf0ab('0x1d')]||null:null,'attributes':[[_0xf0ab('0x2b'),_0xf0ab('0x2c')],[db['sequelize']['fn'](_0xf0ab('0x1f'),db[_0xf0ab('0x1e')]['fn']('IF',db['sequelize'][_0xf0ab('0x21')](_0xf0ab('0x2d')))),_0xf0ab('0x2e')],[db[_0xf0ab('0x1e')]['fn'](_0xf0ab('0x1f'),db[_0xf0ab('0x1e')]['fn']('IF',db[_0xf0ab('0x1e')]['literal'](_0xf0ab('0x2f')))),_0xf0ab('0x30')],[db[_0xf0ab('0x1e')]['fn']('COUNT',db[_0xf0ab('0x1e')]['fn']('IF',db[_0xf0ab('0x1e')][_0xf0ab('0x21')](_0xf0ab('0x22')))),_0xf0ab('0x31')],[db['sequelize']['fn'](_0xf0ab('0x1f'),db[_0xf0ab('0x1e')]['fn']('IF',db[_0xf0ab('0x1e')][_0xf0ab('0x21')](_0xf0ab('0x32')))),_0xf0ab('0x33')],[db[_0xf0ab('0x1e')]['fn'](_0xf0ab('0x1f'),db[_0xf0ab('0x1e')]['fn']('IF',db[_0xf0ab('0x1e')][_0xf0ab('0x21')](_0xf0ab('0x34')))),_0xf0ab('0x35')],[db['sequelize']['fn']('COUNT',db[_0xf0ab('0x1e')]['fn']('IF',db['sequelize'][_0xf0ab('0x21')](_0xf0ab('0x36')))),'outboundDropCallsDayTimeout'],[db[_0xf0ab('0x1e')]['fn'](_0xf0ab('0x1f'),db['sequelize']['fn']('IF',db[_0xf0ab('0x1e')][_0xf0ab('0x21')](_0xf0ab('0x37')))),_0xf0ab('0x38')],[db[_0xf0ab('0x1e')]['fn'](_0xf0ab('0x1f'),db[_0xf0ab('0x1e')]['fn']('IF',db[_0xf0ab('0x1e')][_0xf0ab('0x21')](_0xf0ab('0x39')))),_0xf0ab('0x3a')],[db[_0xf0ab('0x1e')]['fn'](_0xf0ab('0x1f'),db[_0xf0ab('0x1e')]['fn']('IF',db['sequelize']['literal'](_0xf0ab('0x3b')))),'outboundBlacklistCallsDay'],[db['sequelize']['fn']('COUNT',db[_0xf0ab('0x1e')]['fn']('IF',db[_0xf0ab('0x1e')][_0xf0ab('0x21')](_0xf0ab('0x3c')))),_0xf0ab('0x3d')],[db[_0xf0ab('0x1e')]['fn'](_0xf0ab('0x1f'),db[_0xf0ab('0x1e')]['fn']('IF',db[_0xf0ab('0x1e')][_0xf0ab('0x21')](_0xf0ab('0x3e')))),_0xf0ab('0x3f')],[db['sequelize']['fn'](_0xf0ab('0x1f'),db[_0xf0ab('0x1e')]['fn']('IF',db[_0xf0ab('0x1e')][_0xf0ab('0x21')](_0xf0ab('0x40')))),_0xf0ab('0x41')],[db[_0xf0ab('0x1e')]['fn'](_0xf0ab('0x1f'),db['sequelize']['fn']('IF',db['sequelize']['literal'](_0xf0ab('0x42')))),_0xf0ab('0x3f')],[db['sequelize']['fn'](_0xf0ab('0x1f'),db[_0xf0ab('0x1e')]['fn']('IF',db['sequelize'][_0xf0ab('0x21')](_0xf0ab('0x43')))),_0xf0ab('0x44')]],'group':[_0xf0ab('0x2b')]})[_0xf0ab('0x1b')](function(_0x33112b){logger[_0xf0ab('0xb')]('GetVoiceQueueHopperHistory',_0x9e38af);logger[_0xf0ab('0x2a')]('GetVoiceQueueHopperHistory',_0x9e38af,JSON[_0xf0ab('0xe')](_0x33112b));_0x5d99e7(_0x33112b);})['catch'](function(_0x1a402b){logger['error']('GetVoiceQueueHopperHistory',_0x1a402b[_0xf0ab('0x11')],_0x9e38af);_0x58bc85(_0xe4d58b['error'](0x1f4,_0x1a402b[_0xf0ab('0x11')]));});});};exports['GetCampaignHopperHistory']=function(_0x2eff07){var _0x488001=this;return new Promise(function(_0x42331c,_0x2114f0){return db[_0xf0ab('0x16')]['findAll']({'raw':_0x2eff07['options']?_0x2eff07['options'][_0xf0ab('0x1a')]===undefined?!![]:![]:!![],'where':_0x2eff07[_0xf0ab('0x19')]?_0x2eff07['options']['where']||null:null,'attributes':[[_0xf0ab('0x2b'),_0xf0ab('0x2c')],[db[_0xf0ab('0x1e')]['fn'](_0xf0ab('0x1f'),db[_0xf0ab('0x1e')][_0xf0ab('0x20')]('id')),_0xf0ab('0x45')],[db[_0xf0ab('0x1e')]['fn'](_0xf0ab('0x1f'),db[_0xf0ab('0x1e')]['fn']('IF',db[_0xf0ab('0x1e')]['literal'](_0xf0ab('0x22')))),'ivrAnswerCallsDay']],'group':[_0xf0ab('0x2b')]})[_0xf0ab('0x1b')](function(_0x14e4ee){logger[_0xf0ab('0xb')](_0xf0ab('0x46'),_0x2eff07);logger[_0xf0ab('0x2a')](_0xf0ab('0x46'),_0x2eff07,JSON[_0xf0ab('0xe')](_0x14e4ee));_0x42331c(_0x14e4ee);})[_0xf0ab('0x14')](function(_0x180ee6){logger['error'](_0xf0ab('0x46'),_0x180ee6[_0xf0ab('0x11')],_0x2eff07);_0x2114f0(_0x488001[_0xf0ab('0xf')](0x1f4,_0x180ee6[_0xf0ab('0x11')]));});});};
\ No newline at end of file
diff --git a/server/api/cmHopperHistory/index.js b/server/api/cmHopperHistory/index.js
index e092f38..e061ea0 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 _0xc7f8=['describe','show','post','create','put','/:id','update','multer','util','path','connect-timeout','express','../../components/auth/service','../../components/interaction/service','../../config/environment','./cmHopperHistory.controller','get','isAuthenticated','index','/describe'];(function(_0x510a5b,_0x27aac4){var _0x29581c=function(_0xfc62f){while(--_0xfc62f){_0x510a5b['push'](_0x510a5b['shift']());}};_0x29581c(++_0x27aac4);}(_0xc7f8,0xcf));var _0x8c7f=function(_0x3fc15c,_0x3fbfba){_0x3fc15c=_0x3fc15c-0x0;var _0x59daaa=_0xc7f8[_0x3fc15c];return _0x59daaa;};'use strict';var multer=require(_0x8c7f('0x0'));var util=require(_0x8c7f('0x1'));var path=require(_0x8c7f('0x2'));var timeout=require(_0x8c7f('0x3'));var express=require(_0x8c7f('0x4'));var router=express['Router']();var auth=require(_0x8c7f('0x5'));var interaction=require(_0x8c7f('0x6'));var config=require(_0x8c7f('0x7'));var controller=require(_0x8c7f('0x8'));router[_0x8c7f('0x9')]('/',auth[_0x8c7f('0xa')](),controller[_0x8c7f('0xb')]);router['get'](_0x8c7f('0xc'),auth['isAuthenticated'](),controller[_0x8c7f('0xd')]);router[_0x8c7f('0x9')]('/:id',auth[_0x8c7f('0xa')](),controller[_0x8c7f('0xe')]);router[_0x8c7f('0xf')]('/',auth[_0x8c7f('0xa')](),controller[_0x8c7f('0x10')]);router[_0x8c7f('0x11')](_0x8c7f('0x12'),auth[_0x8c7f('0xa')](),controller[_0x8c7f('0x13')]);module['exports']=router;
\ No newline at end of file
+var _0xd7d5=['express','Router','../../components/auth/service','../../config/environment','get','isAuthenticated','index','/describe','describe','/:id','post','create','put','update','exports','multer','util','path','connect-timeout'];(function(_0x363a2b,_0x2c51a2){var _0x2c720e=function(_0x54ec7){while(--_0x54ec7){_0x363a2b['push'](_0x363a2b['shift']());}};_0x2c720e(++_0x2c51a2);}(_0xd7d5,0x1ea));var _0x5d7d=function(_0x52116b,_0x13966d){_0x52116b=_0x52116b-0x0;var _0x3dc0fc=_0xd7d5[_0x52116b];return _0x3dc0fc;};'use strict';var multer=require(_0x5d7d('0x0'));var util=require(_0x5d7d('0x1'));var path=require(_0x5d7d('0x2'));var timeout=require(_0x5d7d('0x3'));var express=require(_0x5d7d('0x4'));var router=express[_0x5d7d('0x5')]();var auth=require(_0x5d7d('0x6'));var interaction=require('../../components/interaction/service');var config=require(_0x5d7d('0x7'));var controller=require('./cmHopperHistory.controller');router[_0x5d7d('0x8')]('/',auth[_0x5d7d('0x9')](),controller[_0x5d7d('0xa')]);router[_0x5d7d('0x8')](_0x5d7d('0xb'),auth[_0x5d7d('0x9')](),controller[_0x5d7d('0xc')]);router[_0x5d7d('0x8')](_0x5d7d('0xd'),auth[_0x5d7d('0x9')](),controller['show']);router[_0x5d7d('0xe')]('/',auth[_0x5d7d('0x9')](),controller[_0x5d7d('0xf')]);router[_0x5d7d('0x10')](_0x5d7d('0xd'),auth[_0x5d7d('0x9')](),controller[_0x5d7d('0x11')]);module[_0x5d7d('0x12')]=router;
\ No newline at end of file
diff --git a/server/api/cmList/cmList.attributes.js b/server/api/cmList/cmList.attributes.js
index 66e9150..072c305 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 _0xb422=['STRING','name','sequelize'];(function(_0xb069a5,_0x232ba9){var _0x1a6133=function(_0x50184e){while(--_0x50184e){_0xb069a5['push'](_0xb069a5['shift']());}};_0x1a6133(++_0x232ba9);}(_0xb422,0xec));var _0x2b42=function(_0x1eff1a,_0x5d05a9){_0x1eff1a=_0x1eff1a-0x0;var _0x478b4b=_0xb422[_0x1eff1a];return _0x478b4b;};'use strict';var Sequelize=require(_0x2b42('0x0'));module['exports']={'name':{'type':Sequelize[_0x2b42('0x1')],'unique':_0x2b42('0x2'),'allowNull':![],'validate':{'notEmpty':!![]}},'description':{'type':Sequelize[_0x2b42('0x1')]},'dialPrefix':{'type':Sequelize[_0x2b42('0x1')]}};
\ No newline at end of file
+var _0x8247=['STRING','name','sequelize','exports'];(function(_0x2fce29,_0x28337b){var _0x1743dd=function(_0x35786a){while(--_0x35786a){_0x2fce29['push'](_0x2fce29['shift']());}};_0x1743dd(++_0x28337b);}(_0x8247,0xce));var _0x7824=function(_0x1f1a97,_0xadfc15){_0x1f1a97=_0x1f1a97-0x0;var _0x29fc6a=_0x8247[_0x1f1a97];return _0x29fc6a;};'use strict';var Sequelize=require(_0x7824('0x0'));module[_0x7824('0x1')]={'name':{'type':Sequelize[_0x7824('0x2')],'unique':_0x7824('0x3'),'allowNull':![],'validate':{'notEmpty':!![]}},'description':{'type':Sequelize[_0x7824('0x2')]},'dialPrefix':{'type':Sequelize['STRING']}};
\ No newline at end of file
diff --git a/server/api/cmList/cmList.controller.js b/server/api/cmList/cmList.controller.js
index 26ec8b1..d29cf52 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 _0xa9e0=['addAgents','spread','removeAgents','emit','userCmList:remove','getAgents','User','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','redis','defaults','localhost','socket.io-emitter','./cmList.socket','register','sendStatus','end','status','json','count','offset','limit','set','Content-Range','apply','reject','update','then','destroy','get','UserProfileResource','error','stack','name','send','index','map','CmList','rawAttributes','fieldName','type','model','query','keys','filters','attributes','intersection','fields','hasOwnProperty','order','sort','pick','filter','where','VIRTUAL','options','includeAll','include','findAll','rows','catch','show','length','merge','find','create','body','user','Unable\x20to\x20retrieve\x20the\x20current\x20user','role','userProfileId','autoAssociation','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','params','describe','addDisposition','ListId','findOne','Disposition','removeDispositions','ids','addContacts','CmContact','tags','isArray','join','push','each','omit','success','errors','message','CmCustomField','CustomFields','concat','format','cf_%d','nolimit','raw','getContacts','isEmpty','now','/tmp/list_%d_%s.csv','setHeader','Content-disposition','attachment;\x20filename=','Content-type','text/csv','addCustomField','sequelize','transaction','addCustomFields','TEXT','text','Sequelize','number','INTEGER','switch','defaultValue','queryInterface','cm_contacts','cf_%s','getCustomFields','findAndCountAll'];(function(_0x11311c,_0x2611b9){var _0x42dce4=function(_0x4710b9){while(--_0x4710b9){_0x11311c['push'](_0x11311c['shift']());}};_0x42dce4(++_0x2611b9);}(_0xa9e0,0x123));var _0x0a9e=function(_0x3e112d,_0x2bb132){_0x3e112d=_0x3e112d-0x0;var _0x531c31=_0xa9e0[_0x3e112d];return _0x531c31;};'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'];config[_0x0a9e('0x14')]=_[_0x0a9e('0x15')](config[_0x0a9e('0x14')],{'host':_0x0a9e('0x16'),'port':0x18eb});var socket=require(_0x0a9e('0x17'))(new Redis(config['redis']));require(_0x0a9e('0x18'))[_0x0a9e('0x19')](socket);function respondWithStatusCode(_0x2b4227,_0x281129){_0x281129=_0x281129||0xcc;return function(_0x44dcfd){if(_0x44dcfd){return _0x2b4227[_0x0a9e('0x1a')](_0x281129);}return _0x2b4227['status'](_0x281129)[_0x0a9e('0x1b')]();};}function respondWithResult(_0x5d0880,_0x1985b6){_0x1985b6=_0x1985b6||0xc8;return function(_0x519dfd){if(_0x519dfd){return _0x5d0880[_0x0a9e('0x1c')](_0x1985b6)[_0x0a9e('0x1d')](_0x519dfd);}};}function respondWithFilteredResult(_0x48f32d,_0x225616){return function(_0x5a0a06){if(_0x5a0a06){var _0x459eb1=_0x5a0a06[_0x0a9e('0x1e')],_0x478723=_0x225616[_0x0a9e('0x1f')],_0x106033=_0x225616[_0x0a9e('0x1f')]+_0x225616[_0x0a9e('0x20')],_0x205fd6;if(_0x106033>=_0x459eb1){_0x106033=_0x459eb1;_0x205fd6=0xc8;}else{_0x205fd6=0xce;}_0x48f32d[_0x0a9e('0x1c')](_0x205fd6);return _0x48f32d[_0x0a9e('0x21')](_0x0a9e('0x22'),_0x478723+'-'+_0x106033+'/'+_0x459eb1)[_0x0a9e('0x1d')](_0x5a0a06);}return null;};}function patchUpdates(_0x4bb1e3){return function(_0x2c3407){try{jsonpatch[_0x0a9e('0x23')](_0x2c3407,_0x4bb1e3,!![]);}catch(_0x53682f){return BPromise[_0x0a9e('0x24')](_0x53682f);}return _0x2c3407['save']();};}function saveUpdates(_0x588269,_0x3a02e1){return function(_0x432e56){if(_0x432e56){return _0x432e56[_0x0a9e('0x25')](_0x588269)[_0x0a9e('0x26')](function(_0x4abc77){return _0x4abc77;});}return null;};}function removeEntity(_0xfb6e48,_0x2fb0e4){return function(_0x3b45bc){if(_0x3b45bc){return _0x3b45bc[_0x0a9e('0x27')]()[_0x0a9e('0x26')](function(){var _0x42ac8f=_0x3b45bc[_0x0a9e('0x28')]({'plain':!![]});var _0x5ea472='Lists';return db[_0x0a9e('0x29')][_0x0a9e('0x27')]({'where':{'type':_0x5ea472,'resourceId':_0x42ac8f['id']}})[_0x0a9e('0x26')](function(){return _0x3b45bc;});})[_0x0a9e('0x26')](function(){_0xfb6e48['status'](0xcc)[_0x0a9e('0x1b')]();});}};}function handleEntityNotFound(_0x479bc4,_0x45a1e7){return function(_0x5bfb33){if(!_0x5bfb33){_0x479bc4[_0x0a9e('0x1a')](0x194);}return _0x5bfb33;};}function handleError(_0x34dc65,_0x25fba9){_0x25fba9=_0x25fba9||0x1f4;return function(_0x14433c){logger[_0x0a9e('0x2a')](_0x14433c[_0x0a9e('0x2b')]);if(_0x14433c[_0x0a9e('0x2c')]){delete _0x14433c[_0x0a9e('0x2c')];}_0x34dc65['status'](_0x25fba9)[_0x0a9e('0x2d')](_0x14433c);};}exports[_0x0a9e('0x2e')]=function(_0x2b1f27,_0x2ec755){var _0x5c877d={},_0x15b200={},_0x40e7a3={'count':0x0,'rows':[]};var _0x1843b2=_[_0x0a9e('0x2f')](db[_0x0a9e('0x30')][_0x0a9e('0x31')],function(_0x296f41){return{'name':_0x296f41[_0x0a9e('0x32')],'type':_0x296f41[_0x0a9e('0x33')]['key']};});_0x15b200[_0x0a9e('0x34')]=_['map'](_0x1843b2,_0x0a9e('0x2c'));_0x15b200[_0x0a9e('0x35')]=_[_0x0a9e('0x36')](_0x2b1f27[_0x0a9e('0x35')]);_0x15b200[_0x0a9e('0x37')]=_['intersection'](_0x15b200[_0x0a9e('0x34')],_0x15b200[_0x0a9e('0x35')]);_0x5c877d[_0x0a9e('0x38')]=_[_0x0a9e('0x39')](_0x15b200[_0x0a9e('0x34')],qs[_0x0a9e('0x3a')](_0x2b1f27[_0x0a9e('0x35')][_0x0a9e('0x3a')]));_0x5c877d['attributes']=_0x5c877d[_0x0a9e('0x38')]['length']?_0x5c877d[_0x0a9e('0x38')]:_0x15b200[_0x0a9e('0x34')];if(!_0x2b1f27[_0x0a9e('0x35')][_0x0a9e('0x3b')]('nolimit')){_0x5c877d[_0x0a9e('0x20')]=qs[_0x0a9e('0x20')](_0x2b1f27[_0x0a9e('0x35')][_0x0a9e('0x20')]);_0x5c877d['offset']=qs['offset'](_0x2b1f27[_0x0a9e('0x35')]['offset']);}_0x5c877d[_0x0a9e('0x3c')]=qs[_0x0a9e('0x3d')](_0x2b1f27[_0x0a9e('0x35')][_0x0a9e('0x3d')]);_0x5c877d['where']=qs[_0x0a9e('0x37')](_[_0x0a9e('0x3e')](_0x2b1f27[_0x0a9e('0x35')],_0x15b200['filters']));if(_0x2b1f27[_0x0a9e('0x35')][_0x0a9e('0x3f')]){_0x5c877d[_0x0a9e('0x40')]=_['merge'](_0x5c877d['where'],{'$or':_[_0x0a9e('0x2f')](_0x1843b2,function(_0x40d766){if(_0x40d766['type']!==_0x0a9e('0x41')){var _0x419125={};_0x419125[_0x40d766[_0x0a9e('0x2c')]]={'$like':'%'+_0x2b1f27[_0x0a9e('0x35')]['filter']+'%'};return _0x419125;}})});}_0x5c877d=_['merge']({},_0x5c877d,_0x2b1f27[_0x0a9e('0x42')]);var _0x45b3d0={'where':_0x5c877d['where']};return db[_0x0a9e('0x30')][_0x0a9e('0x1e')](_0x45b3d0)[_0x0a9e('0x26')](function(_0x5b4f5e){_0x40e7a3[_0x0a9e('0x1e')]=_0x5b4f5e;if(_0x2b1f27[_0x0a9e('0x35')][_0x0a9e('0x43')]){_0x5c877d[_0x0a9e('0x44')]=[{'all':!![]}];}return db[_0x0a9e('0x30')][_0x0a9e('0x45')](_0x5c877d);})[_0x0a9e('0x26')](function(_0x45a9b8){_0x40e7a3[_0x0a9e('0x46')]=_0x45a9b8;return _0x40e7a3;})[_0x0a9e('0x26')](respondWithFilteredResult(_0x2ec755,_0x5c877d))[_0x0a9e('0x47')](handleError(_0x2ec755,null));};exports[_0x0a9e('0x48')]=function(_0x1a7bce,_0x11ca30){var _0x37f6cc={'raw':![],'where':{'id':_0x1a7bce['params']['id']}},_0x4d04c8={};_0x4d04c8[_0x0a9e('0x34')]=_[_0x0a9e('0x36')](db[_0x0a9e('0x30')][_0x0a9e('0x31')]);_0x4d04c8[_0x0a9e('0x35')]=_[_0x0a9e('0x36')](_0x1a7bce[_0x0a9e('0x35')]);_0x4d04c8[_0x0a9e('0x37')]=_[_0x0a9e('0x39')](_0x4d04c8[_0x0a9e('0x34')],_0x4d04c8[_0x0a9e('0x35')]);_0x37f6cc[_0x0a9e('0x38')]=_['intersection'](_0x4d04c8[_0x0a9e('0x34')],qs[_0x0a9e('0x3a')](_0x1a7bce[_0x0a9e('0x35')][_0x0a9e('0x3a')]));_0x37f6cc[_0x0a9e('0x38')]=_0x37f6cc[_0x0a9e('0x38')][_0x0a9e('0x49')]?_0x37f6cc[_0x0a9e('0x38')]:_0x4d04c8['model'];if(_0x1a7bce[_0x0a9e('0x35')]['includeAll']){_0x37f6cc[_0x0a9e('0x44')]=[{'all':!![]}];}_0x37f6cc=_[_0x0a9e('0x4a')]({},_0x37f6cc,_0x1a7bce[_0x0a9e('0x42')]);return db['CmList'][_0x0a9e('0x4b')](_0x37f6cc)[_0x0a9e('0x26')](handleEntityNotFound(_0x11ca30,null))[_0x0a9e('0x26')](respondWithResult(_0x11ca30,null))[_0x0a9e('0x47')](handleError(_0x11ca30,null));};exports[_0x0a9e('0x4c')]=function(_0x37be73,_0x45bf7f){return db['CmList'][_0x0a9e('0x4c')](_0x37be73[_0x0a9e('0x4d')],{})[_0x0a9e('0x26')](function(_0x16f976){var _0x409789=_0x37be73[_0x0a9e('0x4e')][_0x0a9e('0x28')]({'plain':!![]});if(!_0x409789)throw new Error(_0x0a9e('0x4f'));if(_0x409789[_0x0a9e('0x50')]==='user'){var _0xe401a=_0x16f976[_0x0a9e('0x28')]({'plain':!![]});var _0x4f7240='Lists';return db['UserProfileSection'][_0x0a9e('0x4b')]({'where':{'name':_0x4f7240,'userProfileId':_0x409789[_0x0a9e('0x51')]},'raw':!![]})[_0x0a9e('0x26')](function(_0x11545a){if(_0x11545a&&_0x11545a[_0x0a9e('0x52')]===0x0){return db[_0x0a9e('0x29')][_0x0a9e('0x4c')]({'name':_0xe401a[_0x0a9e('0x2c')],'resourceId':_0xe401a['id'],'type':_0x11545a['name'],'sectionId':_0x11545a['id']},{})['then'](function(){return _0x16f976;});}else{return _0x16f976;}})['catch'](function(_0x39d77d){logger[_0x0a9e('0x2a')](_0x0a9e('0x53'),_0x39d77d);throw _0x39d77d;});}return _0x16f976;})['then'](respondWithResult(_0x45bf7f,0xc9))[_0x0a9e('0x47')](handleError(_0x45bf7f,null));};exports[_0x0a9e('0x25')]=function(_0x53d113,_0x5a88da){if(_0x53d113[_0x0a9e('0x4d')]['id']){delete _0x53d113['body']['id'];}return db[_0x0a9e('0x30')]['find']({'where':{'id':_0x53d113[_0x0a9e('0x54')]['id']}})[_0x0a9e('0x26')](handleEntityNotFound(_0x5a88da,null))[_0x0a9e('0x26')](saveUpdates(_0x53d113['body'],null))[_0x0a9e('0x26')](respondWithResult(_0x5a88da,null))[_0x0a9e('0x47')](handleError(_0x5a88da,null));};exports['destroy']=function(_0x50f687,_0x128aa6){return db[_0x0a9e('0x30')]['find']({'where':{'id':_0x50f687[_0x0a9e('0x54')]['id']}})['then'](handleEntityNotFound(_0x128aa6,null))[_0x0a9e('0x26')](removeEntity(_0x128aa6,null))['catch'](handleError(_0x128aa6,null));};exports[_0x0a9e('0x55')]=function(_0x4a6deb,_0x5da27d){return db['CmList'][_0x0a9e('0x55')]()['then'](respondWithResult(_0x5da27d,null))[_0x0a9e('0x47')](handleError(_0x5da27d,null));};exports[_0x0a9e('0x56')]=function(_0x3cfd00,_0x19b4df,_0x232830){if(_0x3cfd00[_0x0a9e('0x4d')]['id']){delete _0x3cfd00[_0x0a9e('0x4d')]['id'];}return db[_0x0a9e('0x30')]['find']({'where':{'id':_0x3cfd00[_0x0a9e('0x54')]['id']}})[_0x0a9e('0x26')](handleEntityNotFound(_0x19b4df,null))[_0x0a9e('0x26')](function(_0x30c491){if(_0x30c491){_0x3cfd00[_0x0a9e('0x4d')][_0x0a9e('0x57')]=_0x30c491['id'];return db['Disposition'][_0x0a9e('0x4c')](_0x3cfd00[_0x0a9e('0x4d')]);}})['then'](respondWithResult(_0x19b4df,null))[_0x0a9e('0x47')](handleError(_0x19b4df,null));};exports['getDispositions']=function(_0x20c668,_0x5ba1f9,_0x4b3c1a){var _0x5674ee={'raw':![],'where':{}};var _0x273cb5={};var _0x49d231={'count':0x0,'rows':[]};return db[_0x0a9e('0x30')][_0x0a9e('0x58')]({'where':{'id':_0x20c668[_0x0a9e('0x54')]['id']}})[_0x0a9e('0x26')](handleEntityNotFound(_0x5ba1f9,null))[_0x0a9e('0x26')](function(_0x26d7db){if(_0x26d7db){_0x273cb5['model']=_[_0x0a9e('0x36')](db['Disposition'][_0x0a9e('0x31')]);_0x273cb5[_0x0a9e('0x35')]=_[_0x0a9e('0x36')](_0x20c668['query']);_0x273cb5[_0x0a9e('0x37')]=_[_0x0a9e('0x39')](_0x273cb5[_0x0a9e('0x34')],_0x273cb5[_0x0a9e('0x35')]);_0x5674ee['attributes']=_[_0x0a9e('0x39')](_0x273cb5[_0x0a9e('0x34')],qs['fields'](_0x20c668[_0x0a9e('0x35')][_0x0a9e('0x3a')]));_0x5674ee[_0x0a9e('0x38')]=_0x5674ee[_0x0a9e('0x38')][_0x0a9e('0x49')]?_0x5674ee['attributes']:_0x273cb5[_0x0a9e('0x34')];if(!_0x20c668[_0x0a9e('0x35')][_0x0a9e('0x3b')]('nolimit')){_0x5674ee[_0x0a9e('0x20')]=qs['limit'](_0x20c668['query'][_0x0a9e('0x20')]);_0x5674ee[_0x0a9e('0x1f')]=qs[_0x0a9e('0x1f')](_0x20c668[_0x0a9e('0x35')][_0x0a9e('0x1f')]);}_0x5674ee[_0x0a9e('0x3c')]=qs[_0x0a9e('0x3d')](_0x20c668[_0x0a9e('0x35')][_0x0a9e('0x3d')]);_0x5674ee[_0x0a9e('0x40')]=qs[_0x0a9e('0x37')](_[_0x0a9e('0x3e')](_0x20c668[_0x0a9e('0x35')],_0x273cb5[_0x0a9e('0x37')]));_0x5674ee[_0x0a9e('0x40')][_0x0a9e('0x57')]=_0x26d7db['id'];if(_0x20c668[_0x0a9e('0x35')][_0x0a9e('0x3f')]){_0x5674ee['where']=_[_0x0a9e('0x4a')](_0x5674ee[_0x0a9e('0x40')],{'$or':_[_0x0a9e('0x2f')](_0x5674ee['attributes'],function(_0x1148a1){var _0x30944e={};_0x30944e[_0x1148a1]={'$like':'%'+_0x20c668['query'][_0x0a9e('0x3f')]+'%'};return _0x30944e;})});}_0x5674ee=_[_0x0a9e('0x4a')]({},_0x5674ee,_0x20c668[_0x0a9e('0x42')]);return db[_0x0a9e('0x59')][_0x0a9e('0x1e')]({'where':_0x5674ee['where']})['then'](function(_0x4a2438){_0x49d231[_0x0a9e('0x1e')]=_0x4a2438;if(_0x20c668[_0x0a9e('0x35')][_0x0a9e('0x43')]){_0x5674ee[_0x0a9e('0x44')]=[{'all':!![]}];}return db[_0x0a9e('0x59')][_0x0a9e('0x45')](_0x5674ee);})[_0x0a9e('0x26')](function(_0x1a0677){_0x49d231['rows']=_0x1a0677;return _0x49d231;});}})[_0x0a9e('0x26')](respondWithFilteredResult(_0x5ba1f9,_0x5674ee))[_0x0a9e('0x47')](handleError(_0x5ba1f9,null));};exports[_0x0a9e('0x5a')]=function(_0x4a4fc7,_0x2bdc44,_0x583b2e){return db[_0x0a9e('0x30')][_0x0a9e('0x4b')]({'where':{'id':_0x4a4fc7['params']['id']}})[_0x0a9e('0x26')](handleEntityNotFound(_0x2bdc44,null))[_0x0a9e('0x26')](function(_0x2cc7a7){if(_0x2cc7a7){return _0x2cc7a7[_0x0a9e('0x5a')](_0x4a4fc7['query'][_0x0a9e('0x5b')]);}})[_0x0a9e('0x26')](respondWithStatusCode(_0x2bdc44,null))[_0x0a9e('0x47')](handleError(_0x2bdc44,null));};exports[_0x0a9e('0x5c')]=function(_0x5b7fc3,_0x109ccb,_0x3d91db){return db[_0x0a9e('0x30')][_0x0a9e('0x4b')]({'where':{'id':_0x5b7fc3['params']['id']}})[_0x0a9e('0x26')](handleEntityNotFound(_0x109ccb,null))[_0x0a9e('0x26')](function(_0x30a4c7){if(_0x30a4c7){var _0xf410e5=[];var _0x332367={'success':[],'errors':[]};return db[_0x0a9e('0x5d')][_0x0a9e('0x55')]()[_0x0a9e('0x26')](function(_0x1a7b03){if(_0x5b7fc3[_0x0a9e('0x4d')][_0x0a9e('0x5e')]&&_[_0x0a9e('0x5f')](_0x5b7fc3[_0x0a9e('0x4d')][_0x0a9e('0x5e')])){if(_0x5b7fc3['body'][_0x0a9e('0x5e')][_0x0a9e('0x49')]){_0x5b7fc3[_0x0a9e('0x4d')]['tags']=_0x5b7fc3[_0x0a9e('0x4d')][_0x0a9e('0x5e')][_0x0a9e('0x60')](';')+';';}else{_0x5b7fc3[_0x0a9e('0x4d')]['tags']=null;}}else{_0x5b7fc3['body'][_0x0a9e('0x5e')]=null;}if(_0x5b7fc3[_0x0a9e('0x4d')]&&_['isArray'](_0x5b7fc3[_0x0a9e('0x4d')])){for(var _0x53a6a1=0x0;_0x53a6a1<_0x5b7fc3[_0x0a9e('0x4d')][_0x0a9e('0x49')];_0x53a6a1+=0x1){_0x5b7fc3['body'][_0x53a6a1][_0x0a9e('0x57')]=_0x5b7fc3[_0x0a9e('0x54')]['id'];_0xf410e5[_0x0a9e('0x61')](_0x5b7fc3[_0x0a9e('0x4d')][_0x53a6a1]);}return BPromise[_0x0a9e('0x62')](_0xf410e5,function(_0x1f42a0){return db[_0x0a9e('0x5d')]['create'](_[_0x0a9e('0x63')](_0x1f42a0,[_0x0a9e('0x5b'),'id'])||{},{'fields':_[_0x0a9e('0x36')](_0x1a7b03),'raw':!![]})[_0x0a9e('0x26')](function(_0x492543){_0x332367[_0x0a9e('0x64')][_0x0a9e('0x61')](_0x492543['dataValues']);})[_0x0a9e('0x47')](function(_0x5b7940){_0x332367[_0x0a9e('0x65')][_0x0a9e('0x61')]({'data':_0x1f42a0,'error':_0x5b7940[_0x0a9e('0x66')]});});})[_0x0a9e('0x26')](function(_0x5af453){return _0x332367;})['catch'](function(_0x353384){return _0x353384;});}else{_0x109ccb[_0x0a9e('0x1c')](0x190)[_0x0a9e('0x1d')]({'message':'Malformed\x20request\x20syntax'});}});}})[_0x0a9e('0x26')](respondWithResult(_0x109ccb,null))[_0x0a9e('0x47')](handleError(_0x109ccb,null));};exports['getContacts']=function(_0x4e46b2,_0xf0a802,_0x56acca){var _0x5ea541;return db['CmList'][_0x0a9e('0x4b')]({'where':{'id':_0x4e46b2[_0x0a9e('0x54')]['id']},'include':[{'model':db[_0x0a9e('0x67')],'as':_0x0a9e('0x68')}]})[_0x0a9e('0x26')](handleEntityNotFound(_0xf0a802,null))[_0x0a9e('0x26')](function(_0x5a8854){if(_0x5a8854){_0x5ea541=_0x5a8854;return db[_0x0a9e('0x5d')]['rawAttributes'];}})[_0x0a9e('0x26')](function(_0x2aabab){if(_0x2aabab){var _0x18ad56={};var _0x4566b0={};_0x4566b0['model']=_[_0x0a9e('0x69')](_[_0x0a9e('0x36')](_0x2aabab),_[_0x0a9e('0x2f')](_0x5ea541['CustomFields'],function(_0xb6e411){return util[_0x0a9e('0x6a')](_0x0a9e('0x6b'),_0xb6e411['id']);}));_0x4566b0[_0x0a9e('0x35')]=_[_0x0a9e('0x36')](_0x4e46b2[_0x0a9e('0x35')]);_0x4566b0[_0x0a9e('0x37')]=_[_0x0a9e('0x39')](_0x4566b0['model'],_0x4566b0[_0x0a9e('0x35')]);_0x18ad56[_0x0a9e('0x38')]=_['intersection'](_0x4566b0[_0x0a9e('0x34')],qs[_0x0a9e('0x3a')](_0x4e46b2[_0x0a9e('0x35')]['fields']));_0x18ad56[_0x0a9e('0x38')]=_0x18ad56['attributes'][_0x0a9e('0x49')]?_0x18ad56[_0x0a9e('0x38')]:_0x4566b0[_0x0a9e('0x34')];if(!_0x4e46b2[_0x0a9e('0x35')][_0x0a9e('0x3b')](_0x0a9e('0x6c'))){_0x18ad56[_0x0a9e('0x20')]=qs[_0x0a9e('0x20')](_0x4e46b2['query'][_0x0a9e('0x20')]);_0x18ad56[_0x0a9e('0x1f')]=qs[_0x0a9e('0x1f')](_0x4e46b2[_0x0a9e('0x35')][_0x0a9e('0x1f')]);}_0x18ad56[_0x0a9e('0x3c')]=qs[_0x0a9e('0x3d')](_0x4e46b2[_0x0a9e('0x35')][_0x0a9e('0x3d')]);_0x18ad56[_0x0a9e('0x40')]=qs[_0x0a9e('0x37')](_[_0x0a9e('0x3e')](_0x4e46b2[_0x0a9e('0x35')],_0x4566b0['filters']));_0x18ad56[_0x0a9e('0x6d')]=!![];if(_0x4e46b2[_0x0a9e('0x35')][_0x0a9e('0x3f')]){_0x18ad56[_0x0a9e('0x40')]=_[_0x0a9e('0x4a')](_0x18ad56['where'],{'$or':_[_0x0a9e('0x2f')](_0x18ad56[_0x0a9e('0x38')],function(_0x5ce99d){var _0x23b447={};_0x23b447[_0x5ce99d]={'$like':'%'+_0x4e46b2['query'][_0x0a9e('0x3f')]+'%'};return _0x23b447;})});}_0x18ad56=_[_0x0a9e('0x4a')]({},_0x18ad56,_0x4e46b2[_0x0a9e('0x42')]);return _0x5ea541[_0x0a9e('0x6e')](_0x18ad56);}})['then'](respondWithResult(_0xf0a802,null))[_0x0a9e('0x47')](handleError(_0xf0a802,null));};exports['getContactsCsv']=function(_0x2ec396,_0x3d0a77,_0x5e5b89){var _0x231c6a;return db[_0x0a9e('0x30')][_0x0a9e('0x4b')]({'where':{'id':_0x2ec396['params']['id']},'include':[{'model':db['CmCustomField'],'as':_0x0a9e('0x68')}]})[_0x0a9e('0x26')](handleEntityNotFound(_0x3d0a77,null))[_0x0a9e('0x26')](function(_0x413190){if(_0x413190){_0x231c6a=_0x413190;return db[_0x0a9e('0x5d')][_0x0a9e('0x31')];}})[_0x0a9e('0x26')](function(_0x3c75b9){if(_0x3c75b9){var _0x3f8124={};var _0x586510={};_0x586510[_0x0a9e('0x34')]=_['concat'](_[_0x0a9e('0x36')](_0x3c75b9),_[_0x0a9e('0x2f')](_0x231c6a[_0x0a9e('0x68')],function(_0x28ce92){return util[_0x0a9e('0x6a')]('cf_%d',_0x28ce92['id']);}));_0x586510[_0x0a9e('0x35')]=_[_0x0a9e('0x36')](_0x2ec396[_0x0a9e('0x35')]);_0x586510[_0x0a9e('0x37')]=_[_0x0a9e('0x39')](_0x586510['model'],_0x586510['query']);_0x3f8124[_0x0a9e('0x38')]=_['intersection'](_0x586510[_0x0a9e('0x34')],qs[_0x0a9e('0x3a')](_0x2ec396[_0x0a9e('0x35')][_0x0a9e('0x3a')]));_0x3f8124[_0x0a9e('0x38')]=_0x3f8124[_0x0a9e('0x38')]['length']?_0x3f8124['attributes']:_0x586510[_0x0a9e('0x34')];if(!_0x2ec396['query'][_0x0a9e('0x3b')]('nolimit')){_0x3f8124[_0x0a9e('0x20')]=qs['limit'](_0x2ec396['query'][_0x0a9e('0x20')]);_0x3f8124[_0x0a9e('0x1f')]=qs['offset'](_0x2ec396[_0x0a9e('0x35')][_0x0a9e('0x1f')]);}_0x3f8124[_0x0a9e('0x3c')]=qs[_0x0a9e('0x3d')](_0x2ec396[_0x0a9e('0x35')]['sort']);_0x3f8124['where']=qs[_0x0a9e('0x37')](_[_0x0a9e('0x3e')](_0x2ec396[_0x0a9e('0x35')],_0x586510[_0x0a9e('0x37')]));_0x3f8124[_0x0a9e('0x6d')]=!![];if(_0x2ec396['query'][_0x0a9e('0x3f')]){_0x3f8124[_0x0a9e('0x40')]=_['merge'](_0x3f8124[_0x0a9e('0x40')],{'$or':_[_0x0a9e('0x2f')](_0x3f8124[_0x0a9e('0x38')],function(_0x2427d5){var _0x23b25b={};_0x23b25b[_0x2427d5]={'$like':'%'+_0x2ec396[_0x0a9e('0x35')][_0x0a9e('0x3f')]+'%'};return _0x23b25b;})});}_0x3f8124=_[_0x0a9e('0x4a')]({},_0x3f8124,_0x2ec396[_0x0a9e('0x42')]);return _0x231c6a[_0x0a9e('0x6e')](_0x3f8124);}})['then'](function(_0x1065a7){if(!_[_0x0a9e('0x6f')](_0x1065a7)){var _0x2ada60=toCsv(_0x1065a7);var _0x1c4232=Date[_0x0a9e('0x70')]();fs['writeFileSync'](util['format'](_0x0a9e('0x71'),_0x231c6a['id'],_0x1c4232),_0x2ada60);_0x3d0a77[_0x0a9e('0x72')](_0x0a9e('0x73'),_0x0a9e('0x74')+util[_0x0a9e('0x6a')]('list_%d_%s.csv',_0x231c6a['id'],_0x1c4232));_0x3d0a77[_0x0a9e('0x72')](_0x0a9e('0x75'),_0x0a9e('0x76'));return _0x3d0a77['download'](util[_0x0a9e('0x6a')]('/tmp/list_%d_%s.csv',_0x231c6a['id'],_0x1c4232));}else{return _0x3d0a77[_0x0a9e('0x1a')](0xcc);}})['catch'](handleError(_0x3d0a77,null));};exports[_0x0a9e('0x77')]=function(_0x42b833,_0xe339b1,_0x5c500c){var _0xc9529d;delete _0x42b833['body']['id'];return db[_0x0a9e('0x30')][_0x0a9e('0x58')]({'where':{'id':_0x42b833[_0x0a9e('0x54')]['id']}})[_0x0a9e('0x26')](handleEntityNotFound(_0xe339b1,null))[_0x0a9e('0x26')](function(_0x1bee04){if(_0x1bee04){return db[_0x0a9e('0x78')][_0x0a9e('0x79')](function(_0x2aaf07){return db[_0x0a9e('0x67')][_0x0a9e('0x4c')](_0x42b833[_0x0a9e('0x4d')],{'transaction':_0x2aaf07})[_0x0a9e('0x26')](function(_0x399def){_0xc9529d=_0x399def;return _0x1bee04[_0x0a9e('0x7a')](_0x399def,{'transaction':_0x2aaf07});})[_0x0a9e('0x26')](function(){var _0x5b93dd={'type':db['Sequelize'][_0x0a9e('0x7b')],'transaction':_0x2aaf07};switch(_0x42b833['body'][_0x0a9e('0x33')]){case _0x0a9e('0x7c'):_0x5b93dd['type']=db[_0x0a9e('0x7d')][_0x0a9e('0x7b')];break;case _0x0a9e('0x7e'):_0x5b93dd[_0x0a9e('0x33')]=db['Sequelize'][_0x0a9e('0x7f')];break;case _0x0a9e('0x80'):_0x5b93dd[_0x0a9e('0x33')]=db[_0x0a9e('0x7d')]['BOOLEAN'];_0x5b93dd[_0x0a9e('0x81')]=![];break;default:}return db[_0x0a9e('0x78')][_0x0a9e('0x82')]['addColumn'](_0x0a9e('0x83'),util[_0x0a9e('0x6a')](_0x0a9e('0x84'),_0xc9529d['id']),_0x5b93dd);})['then'](function(){return _0xc9529d;});});}})[_0x0a9e('0x26')](respondWithResult(_0xe339b1,null))[_0x0a9e('0x47')](handleError(_0xe339b1,null));};exports[_0x0a9e('0x85')]=function(_0x1a7f58,_0x2394d3,_0x555780){var _0x3211d2={};var _0x289e65={};var _0x4795ae;var _0x3bab3e;return db[_0x0a9e('0x30')][_0x0a9e('0x58')]({'where':{'id':_0x1a7f58['params']['id']}})['then'](handleEntityNotFound(_0x2394d3,null))['then'](function(_0x1015aa){if(_0x1015aa){_0x4795ae=_0x1015aa;_0x289e65[_0x0a9e('0x34')]=_['keys'](db[_0x0a9e('0x67')][_0x0a9e('0x31')]);_0x289e65[_0x0a9e('0x35')]=_['keys'](_0x1a7f58[_0x0a9e('0x35')]);_0x289e65[_0x0a9e('0x37')]=_[_0x0a9e('0x39')](_0x289e65[_0x0a9e('0x34')],_0x289e65[_0x0a9e('0x35')]);_0x3211d2[_0x0a9e('0x38')]=_[_0x0a9e('0x39')](_0x289e65[_0x0a9e('0x34')],qs[_0x0a9e('0x3a')](_0x1a7f58['query'][_0x0a9e('0x3a')]));_0x3211d2['attributes']=_0x3211d2[_0x0a9e('0x38')][_0x0a9e('0x49')]?_0x3211d2[_0x0a9e('0x38')]:_0x289e65[_0x0a9e('0x34')];_0x3211d2[_0x0a9e('0x3c')]=qs[_0x0a9e('0x3d')](_0x1a7f58['query'][_0x0a9e('0x3d')]);_0x3211d2[_0x0a9e('0x40')]=qs[_0x0a9e('0x37')](_[_0x0a9e('0x3e')](_0x1a7f58['query'],_0x289e65[_0x0a9e('0x37')]));_0x3211d2[_0x0a9e('0x40')]=_[_0x0a9e('0x4a')](_0x3211d2[_0x0a9e('0x40')],{'$or':[{'ListId':_0x1015aa['id']},{'ListId':null}]});if(_0x1a7f58[_0x0a9e('0x35')][_0x0a9e('0x3f')]){_0x3211d2[_0x0a9e('0x40')]=_[_0x0a9e('0x4a')](_0x3211d2[_0x0a9e('0x40')],{'$or':_[_0x0a9e('0x2f')](_0x3211d2['attributes'],function(_0x2272bc){var _0x88b25f={};_0x88b25f[_0x2272bc]={'$like':'%'+_0x1a7f58[_0x0a9e('0x35')][_0x0a9e('0x3f')]+'%'};return _0x88b25f;})});}_0x3211d2=_[_0x0a9e('0x4a')]({},_0x3211d2,_0x1a7f58[_0x0a9e('0x42')]);return db[_0x0a9e('0x67')][_0x0a9e('0x86')](_0x3211d2);}})['then'](respondWithResult(_0x2394d3,null))[_0x0a9e('0x47')](handleError(_0x2394d3,null));};exports[_0x0a9e('0x87')]=function(_0x1a9ef1,_0x5c65fc,_0x1402c7){return db[_0x0a9e('0x30')][_0x0a9e('0x4b')]({'where':{'id':_0x1a9ef1[_0x0a9e('0x54')]['id']}})[_0x0a9e('0x26')](handleEntityNotFound(_0x5c65fc,null))[_0x0a9e('0x26')](function(_0x424f1b){if(_0x424f1b){return _0x424f1b[_0x0a9e('0x87')](_0x1a9ef1[_0x0a9e('0x4d')][_0x0a9e('0x5b')],_['omit'](_0x1a9ef1[_0x0a9e('0x4d')],[_0x0a9e('0x5b'),'id'])||{})[_0x0a9e('0x88')](function(_0x3db98f){for(var _0x2b624e=0x0;_0x2b624e<_0x1a9ef1[_0x0a9e('0x4d')]['ids'][_0x0a9e('0x49')];_0x2b624e+=0x1){socket['emit']('userCmList:save',{'UserId':_0x1a9ef1['body'][_0x0a9e('0x5b')][_0x2b624e],'CmListId':_0x1a9ef1[_0x0a9e('0x54')]['id']});}return _0x3db98f;});}})[_0x0a9e('0x26')](respondWithResult(_0x5c65fc,null))[_0x0a9e('0x47')](handleError(_0x5c65fc,null));};exports['removeAgents']=function(_0x4156a5,_0x309fa9,_0x3ddbc7){return db[_0x0a9e('0x30')][_0x0a9e('0x4b')]({'where':{'id':_0x4156a5['params']['id']}})['then'](handleEntityNotFound(_0x309fa9,null))[_0x0a9e('0x26')](function(_0x33bcb2){if(_0x33bcb2){return _0x33bcb2[_0x0a9e('0x89')](_0x4156a5['query'][_0x0a9e('0x5b')])[_0x0a9e('0x26')](function(){if(_[_0x0a9e('0x5f')](_0x4156a5['query'][_0x0a9e('0x5b')])){for(var _0x2bf85d=0x0;_0x2bf85d<_0x4156a5[_0x0a9e('0x35')]['ids'][_0x0a9e('0x49')];_0x2bf85d+=0x1){socket[_0x0a9e('0x8a')](_0x0a9e('0x8b'),{'UserId':Number(_0x4156a5['query']['ids'][_0x2bf85d]),'CmListId':Number(_0x4156a5['params']['id'])});}}else{socket[_0x0a9e('0x8a')](_0x0a9e('0x8b'),{'UserId':Number(_0x4156a5[_0x0a9e('0x35')][_0x0a9e('0x5b')]),'CmListId':Number(_0x4156a5['params']['id'])});}});}})[_0x0a9e('0x26')](respondWithStatusCode(_0x309fa9,null))['catch'](handleError(_0x309fa9,null));};exports[_0x0a9e('0x8c')]=function(_0x2ff2ab,_0x242f23,_0x57f673){var _0x33b4b3={};var _0x33a26c={};var _0xb8a476;var _0x580dd6;return db[_0x0a9e('0x30')]['findOne']({'where':{'id':_0x2ff2ab[_0x0a9e('0x54')]['id']}})['then'](handleEntityNotFound(_0x242f23,null))[_0x0a9e('0x26')](function(_0x57b7d4){if(_0x57b7d4){_0xb8a476=_0x57b7d4;_0x33a26c[_0x0a9e('0x34')]=_[_0x0a9e('0x36')](db[_0x0a9e('0x8d')][_0x0a9e('0x31')]);_0x33a26c[_0x0a9e('0x35')]=_[_0x0a9e('0x36')](_0x2ff2ab[_0x0a9e('0x35')]);_0x33a26c['filters']=_[_0x0a9e('0x39')](_0x33a26c[_0x0a9e('0x34')],_0x33a26c['query']);_0x33b4b3[_0x0a9e('0x38')]=_[_0x0a9e('0x39')](_0x33a26c['model'],qs[_0x0a9e('0x3a')](_0x2ff2ab[_0x0a9e('0x35')][_0x0a9e('0x3a')]));_0x33b4b3['attributes']=_0x33b4b3[_0x0a9e('0x38')][_0x0a9e('0x49')]?_0x33b4b3[_0x0a9e('0x38')]:_0x33a26c[_0x0a9e('0x34')];_0x33b4b3[_0x0a9e('0x3c')]=qs[_0x0a9e('0x3d')](_0x2ff2ab[_0x0a9e('0x35')][_0x0a9e('0x3d')]);_0x33b4b3[_0x0a9e('0x40')]=qs[_0x0a9e('0x37')](_['pick'](_0x2ff2ab[_0x0a9e('0x35')],_0x33a26c['filters']));if(_0x2ff2ab[_0x0a9e('0x35')][_0x0a9e('0x3f')]){_0x33b4b3[_0x0a9e('0x40')]=_[_0x0a9e('0x4a')](_0x33b4b3[_0x0a9e('0x40')],{'$or':_[_0x0a9e('0x2f')](_0x33b4b3['attributes'],function(_0x119708){var _0x469035={};_0x469035[_0x119708]={'$like':'%'+_0x2ff2ab[_0x0a9e('0x35')]['filter']+'%'};return _0x469035;})});}_0x33b4b3=_[_0x0a9e('0x4a')]({},_0x33b4b3,_0x2ff2ab[_0x0a9e('0x42')]);return _0xb8a476[_0x0a9e('0x8c')](_0x33b4b3);}})[_0x0a9e('0x26')](function(_0x31e1e0){if(_0x31e1e0){_0x580dd6=_0x31e1e0[_0x0a9e('0x49')];if(!_0x2ff2ab[_0x0a9e('0x35')]['hasOwnProperty'](_0x0a9e('0x6c'))){_0x33b4b3[_0x0a9e('0x20')]=qs[_0x0a9e('0x20')](_0x2ff2ab[_0x0a9e('0x35')][_0x0a9e('0x20')]);_0x33b4b3[_0x0a9e('0x1f')]=qs[_0x0a9e('0x1f')](_0x2ff2ab['query']['offset']);}return _0xb8a476[_0x0a9e('0x8c')](_0x33b4b3);}})[_0x0a9e('0x26')](function(_0x1f4929){if(_0x1f4929){return _0x1f4929?{'count':_0x580dd6,'rows':_0x1f4929}:null;}})[_0x0a9e('0x26')](respondWithResult(_0x242f23,null))[_0x0a9e('0x47')](handleError(_0x242f23,null));};
\ No newline at end of file
+var _0x0713=['cm_contacts','format','getCustomFields','addAgents','spread','emit','userCmList:save','userCmList:remove','getAgents','User','rimraf','zip-dir','fast-json-patch','request-promise','moment','mustache','util','path','sox','to-csv','ejs','lodash','squel','crypto','jsforce','desk.js','querystring','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','api','../../config/utils','../../config/environment','../../mysqldb','redis','localhost','./cmList.socket','sendStatus','status','end','json','count','offset','set','Content-Range','apply','reject','save','update','destroy','then','get','Lists','error','stack','name','send','index','fieldName','key','model','map','keys','query','filters','intersection','attributes','fields','hasOwnProperty','nolimit','limit','order','sort','where','merge','filter','options','CmList','findAll','rows','catch','show','params','length','include','find','create','body','user','role','UserProfileSection','userProfileId','autoAssociation','UserProfileResource','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','describe','Disposition','getDispositions','findOne','ListId','removeDispositions','ids','addContacts','CmContact','tags','isArray','join','push','each','omit','dataValues','errors','message','Malformed\x20request\x20syntax','CmCustomField','CustomFields','rawAttributes','pick','cf_%d','raw','getContacts','now','Content-disposition','attachment;\x20filename=','list_%d_%s.csv','setHeader','Content-type','text/csv','download','/tmp/list_%d_%s.csv','addCustomField','transaction','addCustomFields','Sequelize','type','text','TEXT','number','switch','sequelize','queryInterface','addColumn'];(function(_0x52b23a,_0x373635){var _0x18e060=function(_0x51f5b8){while(--_0x51f5b8){_0x52b23a['push'](_0x52b23a['shift']());}};_0x18e060(++_0x373635);}(_0x0713,0x1ba));var _0x3071=function(_0x3dd15e,_0x1f0015){_0x3dd15e=_0x3dd15e-0x0;var _0x231fd0=_0x0713[_0x3dd15e];return _0x231fd0;};'use strict';var pdf=require('html-pdf');var emlformat=require('eml-format');var rimraf=require(_0x3071('0x0'));var zipdir=require(_0x3071('0x1'));var jsonpatch=require(_0x3071('0x2'));var rp=require(_0x3071('0x3'));var moment=require(_0x3071('0x4'));var BPromise=require('bluebird');var Mustache=require(_0x3071('0x5'));var util=require(_0x3071('0x6'));var path=require(_0x3071('0x7'));var sox=require(_0x3071('0x8'));var csv=require(_0x3071('0x9'));var ejs=require(_0x3071('0xa'));var fs=require('fs');var _=require(_0x3071('0xb'));var squel=require(_0x3071('0xc'));var crypto=require(_0x3071('0xd'));var jsforce=require(_0x3071('0xe'));var deskjs=require(_0x3071('0xf'));var toCsv=require(_0x3071('0x9'));var querystring=require(_0x3071('0x10'));var Papa=require('papaparse');var Redis=require(_0x3071('0x11'));var authService=require(_0x3071('0x12'));var qs=require(_0x3071('0x13'));var as=require(_0x3071('0x14'));var hardwareService=require(_0x3071('0x15'));var logger=require('../../config/logger')(_0x3071('0x16'));var utils=require(_0x3071('0x17'));var config=require(_0x3071('0x18'));var db=require(_0x3071('0x19'))['db'];config[_0x3071('0x1a')]=_['defaults'](config['redis'],{'host':_0x3071('0x1b'),'port':0x18eb});var socket=require('socket.io-emitter')(new Redis(config[_0x3071('0x1a')]));require(_0x3071('0x1c'))['register'](socket);function respondWithStatusCode(_0x104e73,_0x4e1219){_0x4e1219=_0x4e1219||0xcc;return function(_0x2fc15d){if(_0x2fc15d){return _0x104e73[_0x3071('0x1d')](_0x4e1219);}return _0x104e73[_0x3071('0x1e')](_0x4e1219)[_0x3071('0x1f')]();};}function respondWithResult(_0x1caa5d,_0x2a6a4b){_0x2a6a4b=_0x2a6a4b||0xc8;return function(_0x157a47){if(_0x157a47){return _0x1caa5d[_0x3071('0x1e')](_0x2a6a4b)[_0x3071('0x20')](_0x157a47);}};}function respondWithFilteredResult(_0x344ea6,_0x5f3c22){return function(_0x224996){if(_0x224996){var _0x17dbda=_0x224996[_0x3071('0x21')],_0x1068d9=_0x5f3c22[_0x3071('0x22')],_0x108a83=_0x5f3c22[_0x3071('0x22')]+_0x5f3c22['limit'],_0x3acf0e;if(_0x108a83>=_0x17dbda){_0x108a83=_0x17dbda;_0x3acf0e=0xc8;}else{_0x3acf0e=0xce;}_0x344ea6[_0x3071('0x1e')](_0x3acf0e);return _0x344ea6[_0x3071('0x23')](_0x3071('0x24'),_0x1068d9+'-'+_0x108a83+'/'+_0x17dbda)['json'](_0x224996);}return null;};}function patchUpdates(_0xb8f4e3){return function(_0x5cd80d){try{jsonpatch[_0x3071('0x25')](_0x5cd80d,_0xb8f4e3,!![]);}catch(_0x43128c){return BPromise[_0x3071('0x26')](_0x43128c);}return _0x5cd80d[_0x3071('0x27')]();};}function saveUpdates(_0x33090c,_0x34c50e){return function(_0x3c5cef){if(_0x3c5cef){return _0x3c5cef[_0x3071('0x28')](_0x33090c)['then'](function(_0x481a51){return _0x481a51;});}return null;};}function removeEntity(_0x2ce48a,_0xb05b1d){return function(_0x412652){if(_0x412652){return _0x412652[_0x3071('0x29')]()[_0x3071('0x2a')](function(){var _0x44b45f=_0x412652[_0x3071('0x2b')]({'plain':!![]});var _0x1fe727=_0x3071('0x2c');return db['UserProfileResource'][_0x3071('0x29')]({'where':{'type':_0x1fe727,'resourceId':_0x44b45f['id']}})[_0x3071('0x2a')](function(){return _0x412652;});})[_0x3071('0x2a')](function(){_0x2ce48a['status'](0xcc)[_0x3071('0x1f')]();});}};}function handleEntityNotFound(_0x28792d,_0x163604){return function(_0x950fde){if(!_0x950fde){_0x28792d[_0x3071('0x1d')](0x194);}return _0x950fde;};}function handleError(_0x25b96b,_0x177b5f){_0x177b5f=_0x177b5f||0x1f4;return function(_0x3921a1){logger[_0x3071('0x2d')](_0x3921a1[_0x3071('0x2e')]);if(_0x3921a1[_0x3071('0x2f')]){delete _0x3921a1['name'];}_0x25b96b['status'](_0x177b5f)[_0x3071('0x30')](_0x3921a1);};}exports[_0x3071('0x31')]=function(_0x6ddf96,_0x40be95){var _0x3f6d90={},_0x29538c={},_0x32b6b1={'count':0x0,'rows':[]};var _0x1ccc41=_['map'](db['CmList']['rawAttributes'],function(_0x1b0aaf){return{'name':_0x1b0aaf[_0x3071('0x32')],'type':_0x1b0aaf['type'][_0x3071('0x33')]};});_0x29538c[_0x3071('0x34')]=_[_0x3071('0x35')](_0x1ccc41,_0x3071('0x2f'));_0x29538c['query']=_[_0x3071('0x36')](_0x6ddf96[_0x3071('0x37')]);_0x29538c[_0x3071('0x38')]=_[_0x3071('0x39')](_0x29538c[_0x3071('0x34')],_0x29538c[_0x3071('0x37')]);_0x3f6d90[_0x3071('0x3a')]=_[_0x3071('0x39')](_0x29538c['model'],qs[_0x3071('0x3b')](_0x6ddf96['query']['fields']));_0x3f6d90[_0x3071('0x3a')]=_0x3f6d90[_0x3071('0x3a')]['length']?_0x3f6d90[_0x3071('0x3a')]:_0x29538c[_0x3071('0x34')];if(!_0x6ddf96[_0x3071('0x37')][_0x3071('0x3c')](_0x3071('0x3d'))){_0x3f6d90[_0x3071('0x3e')]=qs['limit'](_0x6ddf96[_0x3071('0x37')][_0x3071('0x3e')]);_0x3f6d90['offset']=qs[_0x3071('0x22')](_0x6ddf96['query'][_0x3071('0x22')]);}_0x3f6d90[_0x3071('0x3f')]=qs['sort'](_0x6ddf96['query'][_0x3071('0x40')]);_0x3f6d90[_0x3071('0x41')]=qs[_0x3071('0x38')](_['pick'](_0x6ddf96[_0x3071('0x37')],_0x29538c['filters']));if(_0x6ddf96[_0x3071('0x37')]['filter']){_0x3f6d90[_0x3071('0x41')]=_[_0x3071('0x42')](_0x3f6d90[_0x3071('0x41')],{'$or':_[_0x3071('0x35')](_0x1ccc41,function(_0x30ab68){if(_0x30ab68['type']!=='VIRTUAL'){var _0x4337eb={};_0x4337eb[_0x30ab68[_0x3071('0x2f')]]={'$like':'%'+_0x6ddf96[_0x3071('0x37')][_0x3071('0x43')]+'%'};return _0x4337eb;}})});}_0x3f6d90=_['merge']({},_0x3f6d90,_0x6ddf96[_0x3071('0x44')]);var _0x60549a={'where':_0x3f6d90[_0x3071('0x41')]};return db[_0x3071('0x45')][_0x3071('0x21')](_0x60549a)[_0x3071('0x2a')](function(_0x56a9d8){_0x32b6b1[_0x3071('0x21')]=_0x56a9d8;if(_0x6ddf96['query']['includeAll']){_0x3f6d90['include']=[{'all':!![]}];}return db['CmList'][_0x3071('0x46')](_0x3f6d90);})[_0x3071('0x2a')](function(_0x67b2fb){_0x32b6b1[_0x3071('0x47')]=_0x67b2fb;return _0x32b6b1;})[_0x3071('0x2a')](respondWithFilteredResult(_0x40be95,_0x3f6d90))[_0x3071('0x48')](handleError(_0x40be95,null));};exports[_0x3071('0x49')]=function(_0x2e6c70,_0x56589e){var _0x1e8222={'raw':![],'where':{'id':_0x2e6c70[_0x3071('0x4a')]['id']}},_0x1641d9={};_0x1641d9[_0x3071('0x34')]=_[_0x3071('0x36')](db['CmList']['rawAttributes']);_0x1641d9[_0x3071('0x37')]=_[_0x3071('0x36')](_0x2e6c70[_0x3071('0x37')]);_0x1641d9[_0x3071('0x38')]=_[_0x3071('0x39')](_0x1641d9['model'],_0x1641d9[_0x3071('0x37')]);_0x1e8222['attributes']=_[_0x3071('0x39')](_0x1641d9['model'],qs['fields'](_0x2e6c70[_0x3071('0x37')]['fields']));_0x1e8222[_0x3071('0x3a')]=_0x1e8222['attributes'][_0x3071('0x4b')]?_0x1e8222[_0x3071('0x3a')]:_0x1641d9[_0x3071('0x34')];if(_0x2e6c70[_0x3071('0x37')]['includeAll']){_0x1e8222[_0x3071('0x4c')]=[{'all':!![]}];}_0x1e8222=_['merge']({},_0x1e8222,_0x2e6c70[_0x3071('0x44')]);return db['CmList'][_0x3071('0x4d')](_0x1e8222)[_0x3071('0x2a')](handleEntityNotFound(_0x56589e,null))['then'](respondWithResult(_0x56589e,null))[_0x3071('0x48')](handleError(_0x56589e,null));};exports[_0x3071('0x4e')]=function(_0x224a70,_0x38bcc2){return db[_0x3071('0x45')][_0x3071('0x4e')](_0x224a70[_0x3071('0x4f')],{})['then'](function(_0x2c6e4c){var _0x486b7a=_0x224a70[_0x3071('0x50')][_0x3071('0x2b')]({'plain':!![]});if(!_0x486b7a)throw new Error('Unable\x20to\x20retrieve\x20the\x20current\x20user');if(_0x486b7a[_0x3071('0x51')]===_0x3071('0x50')){var _0x1b832e=_0x2c6e4c[_0x3071('0x2b')]({'plain':!![]});var _0x22aade=_0x3071('0x2c');return db[_0x3071('0x52')][_0x3071('0x4d')]({'where':{'name':_0x22aade,'userProfileId':_0x486b7a[_0x3071('0x53')]},'raw':!![]})[_0x3071('0x2a')](function(_0x4371e7){if(_0x4371e7&&_0x4371e7[_0x3071('0x54')]===0x0){return db[_0x3071('0x55')][_0x3071('0x4e')]({'name':_0x1b832e[_0x3071('0x2f')],'resourceId':_0x1b832e['id'],'type':_0x4371e7[_0x3071('0x2f')],'sectionId':_0x4371e7['id']},{})['then'](function(){return _0x2c6e4c;});}else{return _0x2c6e4c;}})['catch'](function(_0x12536d){logger['error'](_0x3071('0x56'),_0x12536d);throw _0x12536d;});}return _0x2c6e4c;})[_0x3071('0x2a')](respondWithResult(_0x38bcc2,0xc9))[_0x3071('0x48')](handleError(_0x38bcc2,null));};exports['update']=function(_0x1ec428,_0x1ada95){if(_0x1ec428['body']['id']){delete _0x1ec428['body']['id'];}return db[_0x3071('0x45')][_0x3071('0x4d')]({'where':{'id':_0x1ec428[_0x3071('0x4a')]['id']}})[_0x3071('0x2a')](handleEntityNotFound(_0x1ada95,null))['then'](saveUpdates(_0x1ec428[_0x3071('0x4f')],null))[_0x3071('0x2a')](respondWithResult(_0x1ada95,null))[_0x3071('0x48')](handleError(_0x1ada95,null));};exports[_0x3071('0x29')]=function(_0x123323,_0x5206bd){return db[_0x3071('0x45')][_0x3071('0x4d')]({'where':{'id':_0x123323[_0x3071('0x4a')]['id']}})[_0x3071('0x2a')](handleEntityNotFound(_0x5206bd,null))[_0x3071('0x2a')](removeEntity(_0x5206bd,null))[_0x3071('0x48')](handleError(_0x5206bd,null));};exports[_0x3071('0x57')]=function(_0x4bea5d,_0x4d6ed0){return db[_0x3071('0x45')]['describe']()[_0x3071('0x2a')](respondWithResult(_0x4d6ed0,null))[_0x3071('0x48')](handleError(_0x4d6ed0,null));};exports['addDisposition']=function(_0x19dc95,_0x1bf911,_0x4d3886){if(_0x19dc95[_0x3071('0x4f')]['id']){delete _0x19dc95[_0x3071('0x4f')]['id'];}return db[_0x3071('0x45')][_0x3071('0x4d')]({'where':{'id':_0x19dc95[_0x3071('0x4a')]['id']}})['then'](handleEntityNotFound(_0x1bf911,null))[_0x3071('0x2a')](function(_0x313a54){if(_0x313a54){_0x19dc95[_0x3071('0x4f')]['ListId']=_0x313a54['id'];return db[_0x3071('0x58')][_0x3071('0x4e')](_0x19dc95[_0x3071('0x4f')]);}})[_0x3071('0x2a')](respondWithResult(_0x1bf911,null))[_0x3071('0x48')](handleError(_0x1bf911,null));};exports[_0x3071('0x59')]=function(_0xe93f28,_0x2e39ff,_0x3b47e8){var _0x5cb3b3={'raw':![],'where':{}};var _0x5d1316={};var _0x29a58e={'count':0x0,'rows':[]};return db[_0x3071('0x45')][_0x3071('0x5a')]({'where':{'id':_0xe93f28[_0x3071('0x4a')]['id']}})[_0x3071('0x2a')](handleEntityNotFound(_0x2e39ff,null))[_0x3071('0x2a')](function(_0x287974){if(_0x287974){_0x5d1316[_0x3071('0x34')]=_[_0x3071('0x36')](db[_0x3071('0x58')]['rawAttributes']);_0x5d1316[_0x3071('0x37')]=_[_0x3071('0x36')](_0xe93f28[_0x3071('0x37')]);_0x5d1316[_0x3071('0x38')]=_[_0x3071('0x39')](_0x5d1316[_0x3071('0x34')],_0x5d1316[_0x3071('0x37')]);_0x5cb3b3[_0x3071('0x3a')]=_['intersection'](_0x5d1316[_0x3071('0x34')],qs[_0x3071('0x3b')](_0xe93f28['query']['fields']));_0x5cb3b3[_0x3071('0x3a')]=_0x5cb3b3[_0x3071('0x3a')][_0x3071('0x4b')]?_0x5cb3b3[_0x3071('0x3a')]:_0x5d1316['model'];if(!_0xe93f28['query'][_0x3071('0x3c')]('nolimit')){_0x5cb3b3['limit']=qs['limit'](_0xe93f28['query'][_0x3071('0x3e')]);_0x5cb3b3[_0x3071('0x22')]=qs[_0x3071('0x22')](_0xe93f28['query'][_0x3071('0x22')]);}_0x5cb3b3[_0x3071('0x3f')]=qs[_0x3071('0x40')](_0xe93f28[_0x3071('0x37')]['sort']);_0x5cb3b3[_0x3071('0x41')]=qs[_0x3071('0x38')](_['pick'](_0xe93f28[_0x3071('0x37')],_0x5d1316[_0x3071('0x38')]));_0x5cb3b3[_0x3071('0x41')][_0x3071('0x5b')]=_0x287974['id'];if(_0xe93f28[_0x3071('0x37')][_0x3071('0x43')]){_0x5cb3b3[_0x3071('0x41')]=_['merge'](_0x5cb3b3['where'],{'$or':_[_0x3071('0x35')](_0x5cb3b3[_0x3071('0x3a')],function(_0x1456ce){var _0x4bf839={};_0x4bf839[_0x1456ce]={'$like':'%'+_0xe93f28['query'][_0x3071('0x43')]+'%'};return _0x4bf839;})});}_0x5cb3b3=_[_0x3071('0x42')]({},_0x5cb3b3,_0xe93f28[_0x3071('0x44')]);return db[_0x3071('0x58')][_0x3071('0x21')]({'where':_0x5cb3b3[_0x3071('0x41')]})[_0x3071('0x2a')](function(_0x268657){_0x29a58e['count']=_0x268657;if(_0xe93f28[_0x3071('0x37')]['includeAll']){_0x5cb3b3[_0x3071('0x4c')]=[{'all':!![]}];}return db[_0x3071('0x58')][_0x3071('0x46')](_0x5cb3b3);})[_0x3071('0x2a')](function(_0x37cec5){_0x29a58e[_0x3071('0x47')]=_0x37cec5;return _0x29a58e;});}})[_0x3071('0x2a')](respondWithFilteredResult(_0x2e39ff,_0x5cb3b3))[_0x3071('0x48')](handleError(_0x2e39ff,null));};exports['removeDispositions']=function(_0x20dff9,_0x138a94,_0x1da477){return db['CmList'][_0x3071('0x4d')]({'where':{'id':_0x20dff9[_0x3071('0x4a')]['id']}})[_0x3071('0x2a')](handleEntityNotFound(_0x138a94,null))['then'](function(_0x521ee6){if(_0x521ee6){return _0x521ee6[_0x3071('0x5c')](_0x20dff9['query'][_0x3071('0x5d')]);}})[_0x3071('0x2a')](respondWithStatusCode(_0x138a94,null))[_0x3071('0x48')](handleError(_0x138a94,null));};exports[_0x3071('0x5e')]=function(_0x311939,_0x437098,_0x242665){return db['CmList'][_0x3071('0x4d')]({'where':{'id':_0x311939[_0x3071('0x4a')]['id']}})[_0x3071('0x2a')](handleEntityNotFound(_0x437098,null))[_0x3071('0x2a')](function(_0x98d0fb){if(_0x98d0fb){var _0x1fea60=[];var _0x435dcb={'success':[],'errors':[]};return db[_0x3071('0x5f')]['describe']()[_0x3071('0x2a')](function(_0x5ed436){if(_0x311939[_0x3071('0x4f')][_0x3071('0x60')]&&_[_0x3071('0x61')](_0x311939[_0x3071('0x4f')][_0x3071('0x60')])){if(_0x311939[_0x3071('0x4f')][_0x3071('0x60')][_0x3071('0x4b')]){_0x311939[_0x3071('0x4f')][_0x3071('0x60')]=_0x311939['body'][_0x3071('0x60')][_0x3071('0x62')](';')+';';}else{_0x311939['body'][_0x3071('0x60')]=null;}}else{_0x311939[_0x3071('0x4f')][_0x3071('0x60')]=null;}if(_0x311939[_0x3071('0x4f')]&&_[_0x3071('0x61')](_0x311939['body'])){for(var _0x5a7d28=0x0;_0x5a7d28<_0x311939[_0x3071('0x4f')]['length'];_0x5a7d28+=0x1){_0x311939[_0x3071('0x4f')][_0x5a7d28][_0x3071('0x5b')]=_0x311939[_0x3071('0x4a')]['id'];_0x1fea60[_0x3071('0x63')](_0x311939[_0x3071('0x4f')][_0x5a7d28]);}return BPromise[_0x3071('0x64')](_0x1fea60,function(_0x568386){return db[_0x3071('0x5f')][_0x3071('0x4e')](_[_0x3071('0x65')](_0x568386,[_0x3071('0x5d'),'id'])||{},{'fields':_['keys'](_0x5ed436),'raw':!![]})[_0x3071('0x2a')](function(_0x446546){_0x435dcb['success'][_0x3071('0x63')](_0x446546[_0x3071('0x66')]);})[_0x3071('0x48')](function(_0x10bc5b){_0x435dcb[_0x3071('0x67')]['push']({'data':_0x568386,'error':_0x10bc5b[_0x3071('0x68')]});});})['then'](function(_0x34b88b){return _0x435dcb;})[_0x3071('0x48')](function(_0x39060f){return _0x39060f;});}else{_0x437098[_0x3071('0x1e')](0x190)[_0x3071('0x20')]({'message':_0x3071('0x69')});}});}})[_0x3071('0x2a')](respondWithResult(_0x437098,null))[_0x3071('0x48')](handleError(_0x437098,null));};exports['getContacts']=function(_0x2868c2,_0x3efa3c,_0x459653){var _0x4dfb45;return db[_0x3071('0x45')]['find']({'where':{'id':_0x2868c2[_0x3071('0x4a')]['id']},'include':[{'model':db[_0x3071('0x6a')],'as':_0x3071('0x6b')}]})['then'](handleEntityNotFound(_0x3efa3c,null))[_0x3071('0x2a')](function(_0x2ef706){if(_0x2ef706){_0x4dfb45=_0x2ef706;return db[_0x3071('0x5f')][_0x3071('0x6c')];}})[_0x3071('0x2a')](function(_0x2e5f09){if(_0x2e5f09){var _0x12c700={};var _0x2c7749={};_0x2c7749[_0x3071('0x34')]=_['concat'](_[_0x3071('0x36')](_0x2e5f09),_[_0x3071('0x35')](_0x4dfb45[_0x3071('0x6b')],function(_0x5b2830){return util['format']('cf_%d',_0x5b2830['id']);}));_0x2c7749['query']=_['keys'](_0x2868c2[_0x3071('0x37')]);_0x2c7749[_0x3071('0x38')]=_['intersection'](_0x2c7749[_0x3071('0x34')],_0x2c7749[_0x3071('0x37')]);_0x12c700[_0x3071('0x3a')]=_['intersection'](_0x2c7749['model'],qs[_0x3071('0x3b')](_0x2868c2[_0x3071('0x37')][_0x3071('0x3b')]));_0x12c700[_0x3071('0x3a')]=_0x12c700[_0x3071('0x3a')][_0x3071('0x4b')]?_0x12c700[_0x3071('0x3a')]:_0x2c7749['model'];if(!_0x2868c2['query'][_0x3071('0x3c')](_0x3071('0x3d'))){_0x12c700[_0x3071('0x3e')]=qs[_0x3071('0x3e')](_0x2868c2['query'][_0x3071('0x3e')]);_0x12c700[_0x3071('0x22')]=qs[_0x3071('0x22')](_0x2868c2[_0x3071('0x37')][_0x3071('0x22')]);}_0x12c700[_0x3071('0x3f')]=qs[_0x3071('0x40')](_0x2868c2[_0x3071('0x37')]['sort']);_0x12c700[_0x3071('0x41')]=qs[_0x3071('0x38')](_[_0x3071('0x6d')](_0x2868c2[_0x3071('0x37')],_0x2c7749[_0x3071('0x38')]));_0x12c700['raw']=!![];if(_0x2868c2[_0x3071('0x37')]['filter']){_0x12c700['where']=_[_0x3071('0x42')](_0x12c700[_0x3071('0x41')],{'$or':_[_0x3071('0x35')](_0x12c700['attributes'],function(_0x262bca){var _0x1791bc={};_0x1791bc[_0x262bca]={'$like':'%'+_0x2868c2[_0x3071('0x37')][_0x3071('0x43')]+'%'};return _0x1791bc;})});}_0x12c700=_[_0x3071('0x42')]({},_0x12c700,_0x2868c2['options']);return _0x4dfb45['getContacts'](_0x12c700);}})[_0x3071('0x2a')](respondWithResult(_0x3efa3c,null))[_0x3071('0x48')](handleError(_0x3efa3c,null));};exports['getContactsCsv']=function(_0x3ae39b,_0x141122,_0x22e484){var _0x2d559a;return db[_0x3071('0x45')]['find']({'where':{'id':_0x3ae39b[_0x3071('0x4a')]['id']},'include':[{'model':db['CmCustomField'],'as':_0x3071('0x6b')}]})[_0x3071('0x2a')](handleEntityNotFound(_0x141122,null))['then'](function(_0x279525){if(_0x279525){_0x2d559a=_0x279525;return db['CmContact'][_0x3071('0x6c')];}})[_0x3071('0x2a')](function(_0x408ace){if(_0x408ace){var _0x2f36b1={};var _0x5a19b5={};_0x5a19b5[_0x3071('0x34')]=_['concat'](_[_0x3071('0x36')](_0x408ace),_['map'](_0x2d559a[_0x3071('0x6b')],function(_0x3ce867){return util['format'](_0x3071('0x6e'),_0x3ce867['id']);}));_0x5a19b5[_0x3071('0x37')]=_['keys'](_0x3ae39b[_0x3071('0x37')]);_0x5a19b5[_0x3071('0x38')]=_[_0x3071('0x39')](_0x5a19b5[_0x3071('0x34')],_0x5a19b5[_0x3071('0x37')]);_0x2f36b1[_0x3071('0x3a')]=_[_0x3071('0x39')](_0x5a19b5[_0x3071('0x34')],qs[_0x3071('0x3b')](_0x3ae39b[_0x3071('0x37')][_0x3071('0x3b')]));_0x2f36b1[_0x3071('0x3a')]=_0x2f36b1[_0x3071('0x3a')][_0x3071('0x4b')]?_0x2f36b1[_0x3071('0x3a')]:_0x5a19b5['model'];if(!_0x3ae39b[_0x3071('0x37')][_0x3071('0x3c')](_0x3071('0x3d'))){_0x2f36b1[_0x3071('0x3e')]=qs[_0x3071('0x3e')](_0x3ae39b['query']['limit']);_0x2f36b1[_0x3071('0x22')]=qs[_0x3071('0x22')](_0x3ae39b['query'][_0x3071('0x22')]);}_0x2f36b1[_0x3071('0x3f')]=qs['sort'](_0x3ae39b[_0x3071('0x37')][_0x3071('0x40')]);_0x2f36b1[_0x3071('0x41')]=qs[_0x3071('0x38')](_[_0x3071('0x6d')](_0x3ae39b[_0x3071('0x37')],_0x5a19b5[_0x3071('0x38')]));_0x2f36b1[_0x3071('0x6f')]=!![];if(_0x3ae39b[_0x3071('0x37')][_0x3071('0x43')]){_0x2f36b1['where']=_[_0x3071('0x42')](_0x2f36b1['where'],{'$or':_[_0x3071('0x35')](_0x2f36b1[_0x3071('0x3a')],function(_0x46ab46){var _0x3d4d6b={};_0x3d4d6b[_0x46ab46]={'$like':'%'+_0x3ae39b['query']['filter']+'%'};return _0x3d4d6b;})});}_0x2f36b1=_['merge']({},_0x2f36b1,_0x3ae39b[_0x3071('0x44')]);return _0x2d559a[_0x3071('0x70')](_0x2f36b1);}})[_0x3071('0x2a')](function(_0x2e729c){if(!_['isEmpty'](_0x2e729c)){var _0x35aef4=toCsv(_0x2e729c);var _0x7c3473=Date[_0x3071('0x71')]();fs['writeFileSync'](util['format']('/tmp/list_%d_%s.csv',_0x2d559a['id'],_0x7c3473),_0x35aef4);_0x141122['setHeader'](_0x3071('0x72'),_0x3071('0x73')+util['format'](_0x3071('0x74'),_0x2d559a['id'],_0x7c3473));_0x141122[_0x3071('0x75')](_0x3071('0x76'),_0x3071('0x77'));return _0x141122[_0x3071('0x78')](util['format'](_0x3071('0x79'),_0x2d559a['id'],_0x7c3473));}else{return _0x141122[_0x3071('0x1d')](0xcc);}})[_0x3071('0x48')](handleError(_0x141122,null));};exports[_0x3071('0x7a')]=function(_0x56d01a,_0x398590,_0x54d194){var _0x2c5bf0;delete _0x56d01a[_0x3071('0x4f')]['id'];return db[_0x3071('0x45')]['findOne']({'where':{'id':_0x56d01a[_0x3071('0x4a')]['id']}})[_0x3071('0x2a')](handleEntityNotFound(_0x398590,null))[_0x3071('0x2a')](function(_0x1e30be){if(_0x1e30be){return db['sequelize'][_0x3071('0x7b')](function(_0xd89eeb){return db[_0x3071('0x6a')][_0x3071('0x4e')](_0x56d01a[_0x3071('0x4f')],{'transaction':_0xd89eeb})['then'](function(_0x57f202){_0x2c5bf0=_0x57f202;return _0x1e30be[_0x3071('0x7c')](_0x57f202,{'transaction':_0xd89eeb});})[_0x3071('0x2a')](function(){var _0x11c32f={'type':db[_0x3071('0x7d')]['TEXT'],'transaction':_0xd89eeb};switch(_0x56d01a['body'][_0x3071('0x7e')]){case _0x3071('0x7f'):_0x11c32f['type']=db[_0x3071('0x7d')][_0x3071('0x80')];break;case _0x3071('0x81'):_0x11c32f['type']=db['Sequelize']['INTEGER'];break;case _0x3071('0x82'):_0x11c32f[_0x3071('0x7e')]=db[_0x3071('0x7d')]['BOOLEAN'];_0x11c32f['defaultValue']=![];break;default:}return db[_0x3071('0x83')][_0x3071('0x84')][_0x3071('0x85')](_0x3071('0x86'),util[_0x3071('0x87')]('cf_%s',_0x2c5bf0['id']),_0x11c32f);})[_0x3071('0x2a')](function(){return _0x2c5bf0;});});}})['then'](respondWithResult(_0x398590,null))[_0x3071('0x48')](handleError(_0x398590,null));};exports[_0x3071('0x88')]=function(_0x294316,_0xc1632,_0x1817a8){var _0x4e9672={};var _0x64220e={};var _0x1919cc;var _0x17b103;return db[_0x3071('0x45')][_0x3071('0x5a')]({'where':{'id':_0x294316[_0x3071('0x4a')]['id']}})[_0x3071('0x2a')](handleEntityNotFound(_0xc1632,null))[_0x3071('0x2a')](function(_0xc6bc56){if(_0xc6bc56){_0x1919cc=_0xc6bc56;_0x64220e[_0x3071('0x34')]=_[_0x3071('0x36')](db['CmCustomField'][_0x3071('0x6c')]);_0x64220e[_0x3071('0x37')]=_[_0x3071('0x36')](_0x294316[_0x3071('0x37')]);_0x64220e['filters']=_[_0x3071('0x39')](_0x64220e['model'],_0x64220e[_0x3071('0x37')]);_0x4e9672[_0x3071('0x3a')]=_[_0x3071('0x39')](_0x64220e[_0x3071('0x34')],qs[_0x3071('0x3b')](_0x294316[_0x3071('0x37')][_0x3071('0x3b')]));_0x4e9672['attributes']=_0x4e9672[_0x3071('0x3a')]['length']?_0x4e9672['attributes']:_0x64220e[_0x3071('0x34')];_0x4e9672[_0x3071('0x3f')]=qs['sort'](_0x294316[_0x3071('0x37')]['sort']);_0x4e9672[_0x3071('0x41')]=qs[_0x3071('0x38')](_[_0x3071('0x6d')](_0x294316[_0x3071('0x37')],_0x64220e[_0x3071('0x38')]));_0x4e9672[_0x3071('0x41')]=_[_0x3071('0x42')](_0x4e9672[_0x3071('0x41')],{'$or':[{'ListId':_0xc6bc56['id']},{'ListId':null}]});if(_0x294316[_0x3071('0x37')][_0x3071('0x43')]){_0x4e9672[_0x3071('0x41')]=_['merge'](_0x4e9672[_0x3071('0x41')],{'$or':_[_0x3071('0x35')](_0x4e9672[_0x3071('0x3a')],function(_0x5f1c3b){var _0x2f7eee={};_0x2f7eee[_0x5f1c3b]={'$like':'%'+_0x294316['query'][_0x3071('0x43')]+'%'};return _0x2f7eee;})});}_0x4e9672=_[_0x3071('0x42')]({},_0x4e9672,_0x294316[_0x3071('0x44')]);return db[_0x3071('0x6a')]['findAndCountAll'](_0x4e9672);}})['then'](respondWithResult(_0xc1632,null))['catch'](handleError(_0xc1632,null));};exports[_0x3071('0x89')]=function(_0x5da7bc,_0x4d4519,_0x3c617e){return db['CmList'][_0x3071('0x4d')]({'where':{'id':_0x5da7bc[_0x3071('0x4a')]['id']}})[_0x3071('0x2a')](handleEntityNotFound(_0x4d4519,null))['then'](function(_0x16b566){if(_0x16b566){return _0x16b566['addAgents'](_0x5da7bc['body'][_0x3071('0x5d')],_[_0x3071('0x65')](_0x5da7bc[_0x3071('0x4f')],[_0x3071('0x5d'),'id'])||{})[_0x3071('0x8a')](function(_0x38b2c5){for(var _0x3d396d=0x0;_0x3d396d<_0x5da7bc['body'][_0x3071('0x5d')][_0x3071('0x4b')];_0x3d396d+=0x1){socket[_0x3071('0x8b')](_0x3071('0x8c'),{'UserId':_0x5da7bc[_0x3071('0x4f')][_0x3071('0x5d')][_0x3d396d],'CmListId':_0x5da7bc[_0x3071('0x4a')]['id']});}return _0x38b2c5;});}})[_0x3071('0x2a')](respondWithResult(_0x4d4519,null))[_0x3071('0x48')](handleError(_0x4d4519,null));};exports['removeAgents']=function(_0x12765c,_0x149dae,_0x32a43f){return db[_0x3071('0x45')][_0x3071('0x4d')]({'where':{'id':_0x12765c[_0x3071('0x4a')]['id']}})[_0x3071('0x2a')](handleEntityNotFound(_0x149dae,null))['then'](function(_0x2b6fca){if(_0x2b6fca){return _0x2b6fca['removeAgents'](_0x12765c[_0x3071('0x37')][_0x3071('0x5d')])[_0x3071('0x2a')](function(){if(_['isArray'](_0x12765c['query']['ids'])){for(var _0x475047=0x0;_0x475047<_0x12765c[_0x3071('0x37')][_0x3071('0x5d')]['length'];_0x475047+=0x1){socket[_0x3071('0x8b')](_0x3071('0x8d'),{'UserId':Number(_0x12765c[_0x3071('0x37')][_0x3071('0x5d')][_0x475047]),'CmListId':Number(_0x12765c[_0x3071('0x4a')]['id'])});}}else{socket[_0x3071('0x8b')](_0x3071('0x8d'),{'UserId':Number(_0x12765c[_0x3071('0x37')][_0x3071('0x5d')]),'CmListId':Number(_0x12765c['params']['id'])});}});}})[_0x3071('0x2a')](respondWithStatusCode(_0x149dae,null))[_0x3071('0x48')](handleError(_0x149dae,null));};exports[_0x3071('0x8e')]=function(_0x5048ca,_0x34181c,_0x1f9c91){var _0x3cacc1={};var _0x3b5c46={};var _0x3b5619;var _0x1cc091;return db[_0x3071('0x45')][_0x3071('0x5a')]({'where':{'id':_0x5048ca[_0x3071('0x4a')]['id']}})[_0x3071('0x2a')](handleEntityNotFound(_0x34181c,null))[_0x3071('0x2a')](function(_0x1dd796){if(_0x1dd796){_0x3b5619=_0x1dd796;_0x3b5c46['model']=_[_0x3071('0x36')](db[_0x3071('0x8f')]['rawAttributes']);_0x3b5c46['query']=_['keys'](_0x5048ca['query']);_0x3b5c46[_0x3071('0x38')]=_[_0x3071('0x39')](_0x3b5c46['model'],_0x3b5c46[_0x3071('0x37')]);_0x3cacc1[_0x3071('0x3a')]=_[_0x3071('0x39')](_0x3b5c46[_0x3071('0x34')],qs[_0x3071('0x3b')](_0x5048ca[_0x3071('0x37')][_0x3071('0x3b')]));_0x3cacc1[_0x3071('0x3a')]=_0x3cacc1[_0x3071('0x3a')][_0x3071('0x4b')]?_0x3cacc1[_0x3071('0x3a')]:_0x3b5c46[_0x3071('0x34')];_0x3cacc1[_0x3071('0x3f')]=qs['sort'](_0x5048ca[_0x3071('0x37')][_0x3071('0x40')]);_0x3cacc1['where']=qs[_0x3071('0x38')](_[_0x3071('0x6d')](_0x5048ca[_0x3071('0x37')],_0x3b5c46[_0x3071('0x38')]));if(_0x5048ca['query'][_0x3071('0x43')]){_0x3cacc1[_0x3071('0x41')]=_[_0x3071('0x42')](_0x3cacc1[_0x3071('0x41')],{'$or':_['map'](_0x3cacc1['attributes'],function(_0x1afce9){var _0x370797={};_0x370797[_0x1afce9]={'$like':'%'+_0x5048ca[_0x3071('0x37')][_0x3071('0x43')]+'%'};return _0x370797;})});}_0x3cacc1=_[_0x3071('0x42')]({},_0x3cacc1,_0x5048ca[_0x3071('0x44')]);return _0x3b5619[_0x3071('0x8e')](_0x3cacc1);}})[_0x3071('0x2a')](function(_0x4d2992){if(_0x4d2992){_0x1cc091=_0x4d2992[_0x3071('0x4b')];if(!_0x5048ca['query']['hasOwnProperty'](_0x3071('0x3d'))){_0x3cacc1[_0x3071('0x3e')]=qs['limit'](_0x5048ca['query'][_0x3071('0x3e')]);_0x3cacc1[_0x3071('0x22')]=qs[_0x3071('0x22')](_0x5048ca[_0x3071('0x37')]['offset']);}return _0x3b5619[_0x3071('0x8e')](_0x3cacc1);}})[_0x3071('0x2a')](function(_0x2bb0eb){if(_0x2bb0eb){return _0x2bb0eb?{'count':_0x1cc091,'rows':_0x2bb0eb}:null;}})[_0x3071('0x2a')](respondWithResult(_0x34181c,null))[_0x3071('0x48')](handleError(_0x34181c,null));};
\ No newline at end of file
diff --git a/server/api/cmList/cmList.events.js b/server/api/cmList/cmList.events.js
index 3625448..793fbd8 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 _0xf3d1=['update','emit','hasOwnProperty','exports','events','../../mysqldb','CmList','setMaxListeners','save'];(function(_0x5cdd1e,_0x39e196){var _0x5d0f94=function(_0xdd1418){while(--_0xdd1418){_0x5cdd1e['push'](_0x5cdd1e['shift']());}};_0x5d0f94(++_0x39e196);}(_0xf3d1,0x163));var _0x1f3d=function(_0x44ec9c,_0x3fdf61){_0x44ec9c=_0x44ec9c-0x0;var _0x5265e0=_0xf3d1[_0x44ec9c];return _0x5265e0;};'use strict';var EventEmitter=require(_0x1f3d('0x0'));var CmList=require(_0x1f3d('0x1'))['db'][_0x1f3d('0x2')];var CmListEvents=new EventEmitter();CmListEvents[_0x1f3d('0x3')](0x0);var events={'afterCreate':_0x1f3d('0x4'),'afterUpdate':_0x1f3d('0x5'),'afterDestroy':'remove'};function emitEvent(_0x2039f1){return function(_0x3f2e38,_0x407a5f,_0x204c43){CmListEvents[_0x1f3d('0x6')](_0x2039f1+':'+_0x3f2e38['id'],_0x3f2e38);CmListEvents[_0x1f3d('0x6')](_0x2039f1,_0x3f2e38);_0x204c43(null);};}for(var e in events){if(events[_0x1f3d('0x7')](e)){var event=events[e];CmList['hook'](e,emitEvent(event));}}module[_0x1f3d('0x8')]=CmListEvents;
\ No newline at end of file
+var _0x0686=['setMaxListeners','save','emit','hasOwnProperty','hook','exports','events','../../mysqldb'];(function(_0x142d3e,_0x353e86){var _0x493084=function(_0x14aa15){while(--_0x14aa15){_0x142d3e['push'](_0x142d3e['shift']());}};_0x493084(++_0x353e86);}(_0x0686,0xde));var _0x6068=function(_0x45ac2b,_0x3b996e){_0x45ac2b=_0x45ac2b-0x0;var _0x2640a7=_0x0686[_0x45ac2b];return _0x2640a7;};'use strict';var EventEmitter=require(_0x6068('0x0'));var CmList=require(_0x6068('0x1'))['db']['CmList'];var CmListEvents=new EventEmitter();CmListEvents[_0x6068('0x2')](0x0);var events={'afterCreate':_0x6068('0x3'),'afterUpdate':'update','afterDestroy':'remove'};function emitEvent(_0xf03508){return function(_0x82fd02,_0x5097ca,_0xb81ec){CmListEvents[_0x6068('0x4')](_0xf03508+':'+_0x82fd02['id'],_0x82fd02);CmListEvents[_0x6068('0x4')](_0xf03508,_0x82fd02);_0xb81ec(null);};}for(var e in events){if(events[_0x6068('0x5')](e)){var event=events[e];CmList[_0x6068('0x6')](e,emitEvent(event));}}module[_0x6068('0x7')]=CmListEvents;
\ No newline at end of file
diff --git a/server/api/cmList/cmList.model.js b/server/api/cmList/cmList.model.js
index 80fec6e..f6ec588 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 _0xd5b5=['request-promise','path','rimraf','exports','cm_lists','lodash','../../config/logger','api','moment','bluebird'];(function(_0x31295c,_0x2f2b82){var _0x2c150e=function(_0x957f1){while(--_0x957f1){_0x31295c['push'](_0x31295c['shift']());}};_0x2c150e(++_0x2f2b82);}(_0xd5b5,0x1d1));var _0x5d5b=function(_0x5d138c,_0x223355){_0x5d138c=_0x5d138c-0x0;var _0x31b9bf=_0xd5b5[_0x5d138c];return _0x31b9bf;};'use strict';var _=require(_0x5d5b('0x0'));var util=require('util');var logger=require(_0x5d5b('0x1'))(_0x5d5b('0x2'));var moment=require(_0x5d5b('0x3'));var BPromise=require(_0x5d5b('0x4'));var rp=require(_0x5d5b('0x5'));var fs=require('fs');var path=require(_0x5d5b('0x6'));var rimraf=require(_0x5d5b('0x7'));var config=require('../../config/environment');var attributes=require('./cmList.attributes');module[_0x5d5b('0x8')]=function(_0x235d32,_0x3f038c){return _0x235d32['define']('CmList',attributes,{'tableName':_0x5d5b('0x9'),'paranoid':![],'indexes':[],'timestamps':!![]});};
\ No newline at end of file
+var _0x3f8e=['../../config/logger','api','moment','bluebird','path','rimraf','../../config/environment','./cmList.attributes','exports','CmList','cm_lists','lodash'];(function(_0x4336d8,_0x3dc427){var _0x5e8387=function(_0x1d6ac2){while(--_0x1d6ac2){_0x4336d8['push'](_0x4336d8['shift']());}};_0x5e8387(++_0x3dc427);}(_0x3f8e,0x173));var _0xe3f8=function(_0x497c27,_0x527b22){_0x497c27=_0x497c27-0x0;var _0x503cd7=_0x3f8e[_0x497c27];return _0x503cd7;};'use strict';var _=require(_0xe3f8('0x0'));var util=require('util');var logger=require(_0xe3f8('0x1'))(_0xe3f8('0x2'));var moment=require(_0xe3f8('0x3'));var BPromise=require(_0xe3f8('0x4'));var rp=require('request-promise');var fs=require('fs');var path=require(_0xe3f8('0x5'));var rimraf=require(_0xe3f8('0x6'));var config=require(_0xe3f8('0x7'));var attributes=require(_0xe3f8('0x8'));module[_0xe3f8('0x9')]=function(_0x1fcc76,_0x51ad8f){return _0x1fcc76['define'](_0xe3f8('0xa'),attributes,{'tableName':_0xe3f8('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 d6a13e4..e6be480 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 _0x67b1=['register','request','then','info','CmList,\x20%s,\x20%s','debug','CmList,\x20%s,\x20%s,\x20%s','request\x20sent','stringify','error','message','result','catch','util','moment','bluebird','randomstring','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','client','http','redis','defaults','localhost','socket.io-emitter','./cmList.socket'];(function(_0xcc4170,_0x32de91){var _0x1f6058=function(_0x39f595){while(--_0x39f595){_0xcc4170['push'](_0xcc4170['shift']());}};_0x1f6058(++_0x32de91);}(_0x67b1,0xfd));var _0x167b=function(_0x56daff,_0xadca9a){_0x56daff=_0x56daff-0x0;var _0x132c82=_0x67b1[_0x56daff];return _0x132c82;};'use strict';var _=require('lodash');var util=require(_0x167b('0x0'));var moment=require(_0x167b('0x1'));var BPromise=require(_0x167b('0x2'));var rs=require(_0x167b('0x3'));var fs=require('fs');var Redis=require('ioredis');var db=require(_0x167b('0x4'))['db'];var utils=require(_0x167b('0x5'));var logger=require(_0x167b('0x6'))(_0x167b('0x7'));var config=require(_0x167b('0x8'));var jayson=require(_0x167b('0x9'));var client=jayson[_0x167b('0xa')][_0x167b('0xb')]({'port':0x232a});config[_0x167b('0xc')]=_[_0x167b('0xd')](config[_0x167b('0xc')],{'host':_0x167b('0xe'),'port':0x18eb});var socket=require(_0x167b('0xf'))(new Redis(config[_0x167b('0xc')]));require(_0x167b('0x10'))[_0x167b('0x11')](socket);function respondWithRpcPromise(_0x237273,_0x2e9c00,_0x50a920){return new BPromise(function(_0x3caabe,_0x3e2fa3){return client[_0x167b('0x12')](_0x237273,_0x50a920)[_0x167b('0x13')](function(_0x1d3a01){logger[_0x167b('0x14')](_0x167b('0x15'),_0x2e9c00,'request\x20sent');logger[_0x167b('0x16')](_0x167b('0x17'),_0x2e9c00,_0x167b('0x18'),JSON[_0x167b('0x19')](_0x1d3a01));if(_0x1d3a01[_0x167b('0x1a')]){if(_0x1d3a01[_0x167b('0x1a')]['code']===0x1f4){logger['error'](_0x167b('0x15'),_0x2e9c00,_0x1d3a01[_0x167b('0x1a')][_0x167b('0x1b')]);return _0x3e2fa3(_0x1d3a01['error']['message']);}logger[_0x167b('0x1a')](_0x167b('0x15'),_0x2e9c00,_0x1d3a01[_0x167b('0x1a')][_0x167b('0x1b')]);return _0x3caabe(_0x1d3a01[_0x167b('0x1a')][_0x167b('0x1b')]);}else{logger[_0x167b('0x14')]('CmList,\x20%s,\x20%s',_0x2e9c00,_0x167b('0x18'));_0x3caabe(_0x1d3a01[_0x167b('0x1c')]['message']);}})[_0x167b('0x1d')](function(_0x546caa){logger[_0x167b('0x1a')](_0x167b('0x15'),_0x2e9c00,_0x546caa);_0x3e2fa3(_0x546caa);});});}
\ No newline at end of file
+var _0x1290=['ioredis','../../mysqldb','../../config/environment','jayson/promise','http','defaults','redis','socket.io-emitter','./cmList.socket','then','info','CmList,\x20%s,\x20%s','request\x20sent','CmList,\x20%s,\x20%s,\x20%s','stringify','error','code','message','result','catch','lodash','util','moment','bluebird','randomstring'];(function(_0x119a92,_0x241f8a){var _0x13e783=function(_0x289eef){while(--_0x289eef){_0x119a92['push'](_0x119a92['shift']());}};_0x13e783(++_0x241f8a);}(_0x1290,0xc3));var _0x0129=function(_0x1bc392,_0x26695f){_0x1bc392=_0x1bc392-0x0;var _0x14d803=_0x1290[_0x1bc392];return _0x14d803;};'use strict';var _=require(_0x0129('0x0'));var util=require(_0x0129('0x1'));var moment=require(_0x0129('0x2'));var BPromise=require(_0x0129('0x3'));var rs=require(_0x0129('0x4'));var fs=require('fs');var Redis=require(_0x0129('0x5'));var db=require(_0x0129('0x6'))['db'];var utils=require('../../config/utils');var logger=require('../../config/logger')('rpc');var config=require(_0x0129('0x7'));var jayson=require(_0x0129('0x8'));var client=jayson['client'][_0x0129('0x9')]({'port':0x232a});config['redis']=_[_0x0129('0xa')](config[_0x0129('0xb')],{'host':'localhost','port':0x18eb});var socket=require(_0x0129('0xc'))(new Redis(config[_0x0129('0xb')]));require(_0x0129('0xd'))['register'](socket);function respondWithRpcPromise(_0x55eaf1,_0xca756c,_0x242f3c){return new BPromise(function(_0x303e64,_0x175bf1){return client['request'](_0x55eaf1,_0x242f3c)[_0x0129('0xe')](function(_0x56f063){logger[_0x0129('0xf')](_0x0129('0x10'),_0xca756c,_0x0129('0x11'));logger['debug'](_0x0129('0x12'),_0xca756c,'request\x20sent',JSON[_0x0129('0x13')](_0x56f063));if(_0x56f063['error']){if(_0x56f063[_0x0129('0x14')][_0x0129('0x15')]===0x1f4){logger[_0x0129('0x14')](_0x0129('0x10'),_0xca756c,_0x56f063['error'][_0x0129('0x16')]);return _0x175bf1(_0x56f063[_0x0129('0x14')][_0x0129('0x16')]);}logger[_0x0129('0x14')]('CmList,\x20%s,\x20%s',_0xca756c,_0x56f063[_0x0129('0x14')][_0x0129('0x16')]);return _0x303e64(_0x56f063[_0x0129('0x14')][_0x0129('0x16')]);}else{logger[_0x0129('0xf')]('CmList,\x20%s,\x20%s',_0xca756c,_0x0129('0x11'));_0x303e64(_0x56f063[_0x0129('0x17')][_0x0129('0x16')]);}})[_0x0129('0x18')](function(_0x5be1e8){logger[_0x0129('0x14')]('CmList,\x20%s,\x20%s',_0xca756c,_0x5be1e8);_0x175bf1(_0x5be1e8);});});}
\ No newline at end of file
diff --git a/server/api/cmList/cmList.socket.js b/server/api/cmList/cmList.socket.js
index bb346ca..229a1ac 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 _0x84e7=['save','remove','emit','removeListener','register'];(function(_0x15807f,_0x576d8a){var _0x66fab1=function(_0x3f1062){while(--_0x3f1062){_0x15807f['push'](_0x15807f['shift']());}};_0x66fab1(++_0x576d8a);}(_0x84e7,0x122));var _0x784e=function(_0x25fec0,_0x5c91d3){_0x25fec0=_0x25fec0-0x0;var _0x581e4b=_0x84e7[_0x25fec0];return _0x581e4b;};'use strict';var CmListEvents=require('./cmList.events');var events=[_0x784e('0x0'),_0x784e('0x1'),'update'];function createListener(_0x3548d2,_0x2c1d96){return function(_0x50f44d){_0x2c1d96[_0x784e('0x2')](_0x3548d2,_0x50f44d);};}function removeListener(_0x14cee2,_0x205619){return function(){CmListEvents[_0x784e('0x3')](_0x14cee2,_0x205619);};}exports[_0x784e('0x4')]=function(_0x133296){for(var _0x48ed22=0x0,_0x3cbdd1=events['length'];_0x48ed22<_0x3cbdd1;_0x48ed22++){var _0xfaa170=events[_0x48ed22];var _0x24654d=createListener('cmList:'+_0xfaa170,_0x133296);CmListEvents['on'](_0xfaa170,_0x24654d);}};
\ No newline at end of file
+var _0xf4d9=['remove','update','removeListener','cmList:','./cmList.events'];(function(_0x54a761,_0x431fd4){var _0x37d1da=function(_0x5ca617){while(--_0x5ca617){_0x54a761['push'](_0x54a761['shift']());}};_0x37d1da(++_0x431fd4);}(_0xf4d9,0x7c));var _0x9f4d=function(_0x5ac19e,_0x3d632f){_0x5ac19e=_0x5ac19e-0x0;var _0x2a5550=_0xf4d9[_0x5ac19e];return _0x2a5550;};'use strict';var CmListEvents=require(_0x9f4d('0x0'));var events=['save',_0x9f4d('0x1'),_0x9f4d('0x2')];function createListener(_0x35fa60,_0x41bd00){return function(_0x22339e){_0x41bd00['emit'](_0x35fa60,_0x22339e);};}function removeListener(_0x179d90,_0x9ee061){return function(){CmListEvents[_0x9f4d('0x3')](_0x179d90,_0x9ee061);};}exports['register']=function(_0x191f1c){for(var _0x370059=0x0,_0x2d7228=events['length'];_0x370059<_0x2d7228;_0x370059++){var _0x415499=events[_0x370059];var _0x55865b=createListener(_0x9f4d('0x4')+_0x415499,_0x191f1c);CmListEvents['on'](_0x415499,_0x55865b);}};
\ No newline at end of file
diff --git a/server/api/cmList/index.js b/server/api/cmList/index.js
index 467b70f..70271b6 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 _0xa522=['connect-timeout','express','Router','../../components/interaction/service','../../config/environment','./cmList.controller','isAuthenticated','index','get','/describe','describe','/:id','show','/:id/dispositions','/:id/contacts','getContacts','/:id/contacts/csv','getContactsCsv','/:id/fields','getCustomFields','/:id/users','getAgents','post','addDisposition','addCustomField','addAgents','destroy','delete','exports','util'];(function(_0x51b80a,_0x355fe3){var _0x22fdf0=function(_0x152b3e){while(--_0x152b3e){_0x51b80a['push'](_0x51b80a['shift']());}};_0x22fdf0(++_0x355fe3);}(_0xa522,0x185));var _0x2a52=function(_0x57b54c,_0x54ce0d){_0x57b54c=_0x57b54c-0x0;var _0x59cc19=_0xa522[_0x57b54c];return _0x59cc19;};'use strict';var multer=require('multer');var util=require(_0x2a52('0x0'));var path=require('path');var timeout=require(_0x2a52('0x1'));var express=require(_0x2a52('0x2'));var router=express[_0x2a52('0x3')]();var auth=require('../../components/auth/service');var interaction=require(_0x2a52('0x4'));var config=require(_0x2a52('0x5'));var controller=require(_0x2a52('0x6'));router['get']('/',auth[_0x2a52('0x7')](),controller[_0x2a52('0x8')]);router[_0x2a52('0x9')](_0x2a52('0xa'),auth[_0x2a52('0x7')](),controller[_0x2a52('0xb')]);router[_0x2a52('0x9')](_0x2a52('0xc'),auth[_0x2a52('0x7')](),controller[_0x2a52('0xd')]);router[_0x2a52('0x9')](_0x2a52('0xe'),auth['isAuthenticated'](),controller['getDispositions']);router[_0x2a52('0x9')](_0x2a52('0xf'),auth['isAuthenticated'](),controller[_0x2a52('0x10')]);router[_0x2a52('0x9')](_0x2a52('0x11'),auth[_0x2a52('0x7')](),controller[_0x2a52('0x12')]);router[_0x2a52('0x9')](_0x2a52('0x13'),auth[_0x2a52('0x7')](),controller[_0x2a52('0x14')]);router[_0x2a52('0x9')](_0x2a52('0x15'),auth[_0x2a52('0x7')](),controller[_0x2a52('0x16')]);router[_0x2a52('0x17')]('/',auth[_0x2a52('0x7')](),controller['create']);router['post'](_0x2a52('0xe'),auth[_0x2a52('0x7')](),controller[_0x2a52('0x18')]);router[_0x2a52('0x17')]('/:id/contacts',auth['isAuthenticated'](),controller['addContacts']);router[_0x2a52('0x17')](_0x2a52('0x13'),auth[_0x2a52('0x7')](),controller[_0x2a52('0x19')]);router[_0x2a52('0x17')](_0x2a52('0x15'),auth[_0x2a52('0x7')](),controller[_0x2a52('0x1a')]);router['put'](_0x2a52('0xc'),auth[_0x2a52('0x7')](),controller['update']);router['delete']('/:id',auth[_0x2a52('0x7')](),controller[_0x2a52('0x1b')]);router['delete']('/:id/dispositions',auth[_0x2a52('0x7')](),controller['removeDispositions']);router[_0x2a52('0x1c')](_0x2a52('0x15'),auth['isAuthenticated'](),controller['removeAgents']);module[_0x2a52('0x1d')]=router;
\ No newline at end of file
+var _0xc3a3=['index','/describe','isAuthenticated','describe','/:id','show','getDispositions','/:id/contacts','getContacts','/:id/contacts/csv','/:id/fields','getAgents','post','create','/:id/dispositions','addDisposition','addCustomField','/:id/users','addAgents','put','update','delete','destroy','multer','util','path','connect-timeout','express','Router','../../components/auth/service','../../components/interaction/service','./cmList.controller','get'];(function(_0x36514c,_0x219a5d){var _0x18fa87=function(_0x5f5977){while(--_0x5f5977){_0x36514c['push'](_0x36514c['shift']());}};_0x18fa87(++_0x219a5d);}(_0xc3a3,0x11f));var _0x3c3a=function(_0x4e57a2,_0x585b61){_0x4e57a2=_0x4e57a2-0x0;var _0x31d79f=_0xc3a3[_0x4e57a2];return _0x31d79f;};'use strict';var multer=require(_0x3c3a('0x0'));var util=require(_0x3c3a('0x1'));var path=require(_0x3c3a('0x2'));var timeout=require(_0x3c3a('0x3'));var express=require(_0x3c3a('0x4'));var router=express[_0x3c3a('0x5')]();var auth=require(_0x3c3a('0x6'));var interaction=require(_0x3c3a('0x7'));var config=require('../../config/environment');var controller=require(_0x3c3a('0x8'));router[_0x3c3a('0x9')]('/',auth['isAuthenticated'](),controller[_0x3c3a('0xa')]);router['get'](_0x3c3a('0xb'),auth[_0x3c3a('0xc')](),controller[_0x3c3a('0xd')]);router['get'](_0x3c3a('0xe'),auth['isAuthenticated'](),controller[_0x3c3a('0xf')]);router[_0x3c3a('0x9')]('/:id/dispositions',auth[_0x3c3a('0xc')](),controller[_0x3c3a('0x10')]);router[_0x3c3a('0x9')](_0x3c3a('0x11'),auth[_0x3c3a('0xc')](),controller[_0x3c3a('0x12')]);router[_0x3c3a('0x9')](_0x3c3a('0x13'),auth['isAuthenticated'](),controller['getContactsCsv']);router[_0x3c3a('0x9')](_0x3c3a('0x14'),auth[_0x3c3a('0xc')](),controller['getCustomFields']);router['get']('/:id/users',auth[_0x3c3a('0xc')](),controller[_0x3c3a('0x15')]);router[_0x3c3a('0x16')]('/',auth[_0x3c3a('0xc')](),controller[_0x3c3a('0x17')]);router[_0x3c3a('0x16')](_0x3c3a('0x18'),auth['isAuthenticated'](),controller[_0x3c3a('0x19')]);router['post'](_0x3c3a('0x11'),auth[_0x3c3a('0xc')](),controller['addContacts']);router['post'](_0x3c3a('0x14'),auth[_0x3c3a('0xc')](),controller[_0x3c3a('0x1a')]);router[_0x3c3a('0x16')](_0x3c3a('0x1b'),auth[_0x3c3a('0xc')](),controller[_0x3c3a('0x1c')]);router[_0x3c3a('0x1d')](_0x3c3a('0xe'),auth[_0x3c3a('0xc')](),controller[_0x3c3a('0x1e')]);router[_0x3c3a('0x1f')](_0x3c3a('0xe'),auth[_0x3c3a('0xc')](),controller[_0x3c3a('0x20')]);router[_0x3c3a('0x1f')](_0x3c3a('0x18'),auth[_0x3c3a('0xc')](),controller['removeDispositions']);router[_0x3c3a('0x1f')]('/:id/users',auth[_0x3c3a('0xc')](),controller['removeAgents']);module['exports']=router;
\ No newline at end of file
diff --git a/server/api/condition/condition.attributes.js b/server/api/condition/condition.attributes.js
index 6b912c4..faed273 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 _0x9957=['field','STRING','sequelize','exports','VIRTUAL'];(function(_0xb79de2,_0x5b41d9){var _0x256264=function(_0xd6a225){while(--_0xd6a225){_0xb79de2['push'](_0xb79de2['shift']());}};_0x256264(++_0x5b41d9);}(_0x9957,0x93));var _0x7995=function(_0xbca1b1,_0x33f0ce){_0xbca1b1=_0xbca1b1-0x0;var _0x4e1686=_0x9957[_0xbca1b1];return _0x4e1686;};'use strict';var Sequelize=require(_0x7995('0x0'));module[_0x7995('0x1')]={'name':{'type':Sequelize[_0x7995('0x2')],'get':function(_0x10a05d){return this['getDataValue'](_0x7995('0x3'));}},'field':{'type':Sequelize[_0x7995('0x4')],'allowNull':![]},'operator':{'type':Sequelize[_0x7995('0x4')],'allowNull':![]},'value':{'type':Sequelize[_0x7995('0x4')],'allowNull':![]}};
\ No newline at end of file
+var _0x9957=['field','STRING','sequelize','exports','VIRTUAL'];(function(_0x7f0a5,_0x31502){var _0x559f8f=function(_0x3e08a8){while(--_0x3e08a8){_0x7f0a5['push'](_0x7f0a5['shift']());}};_0x559f8f(++_0x31502);}(_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')]={'name':{'type':Sequelize[_0x7995('0x2')],'get':function(_0x10a05d){return this['getDataValue'](_0x7995('0x3'));}},'field':{'type':Sequelize[_0x7995('0x4')],'allowNull':![]},'operator':{'type':Sequelize[_0x7995('0x4')],'allowNull':![]},'value':{'type':Sequelize[_0x7995('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 39cf73a..e0deeca 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 _0x15f4=['mustache','path','to-csv','ejs','lodash','squel','crypto','jsforce','desk.js','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/environment','sendStatus','status','end','count','offset','json','apply','reject','destroy','then','name','send','update','body','Condition','find','params','catch','html-pdf','eml-format','zip-dir','fast-json-patch','request-promise','moment'];(function(_0x22b68a,_0x2bffc3){var _0x1ac67a=function(_0x25f9d5){while(--_0x25f9d5){_0x22b68a['push'](_0x22b68a['shift']());}};_0x1ac67a(++_0x2bffc3);}(_0x15f4,0x127));var _0x415f=function(_0x16b92a,_0x20c5be){_0x16b92a=_0x16b92a-0x0;var _0xff71f0=_0x15f4[_0x16b92a];return _0xff71f0;};'use strict';var pdf=require(_0x415f('0x0'));var emlformat=require(_0x415f('0x1'));var rimraf=require('rimraf');var zipdir=require(_0x415f('0x2'));var jsonpatch=require(_0x415f('0x3'));var rp=require(_0x415f('0x4'));var moment=require(_0x415f('0x5'));var BPromise=require('bluebird');var Mustache=require(_0x415f('0x6'));var util=require('util');var path=require(_0x415f('0x7'));var sox=require('sox');var csv=require(_0x415f('0x8'));var ejs=require(_0x415f('0x9'));var fs=require('fs');var _=require(_0x415f('0xa'));var squel=require(_0x415f('0xb'));var crypto=require(_0x415f('0xc'));var jsforce=require(_0x415f('0xd'));var deskjs=require(_0x415f('0xe'));var toCsv=require('to-csv');var querystring=require(_0x415f('0xf'));var Papa=require(_0x415f('0x10'));var Redis=require(_0x415f('0x11'));var authService=require(_0x415f('0x12'));var qs=require(_0x415f('0x13'));var as=require('../../components/parsers/advancedSearch');var hardwareService=require(_0x415f('0x14'));var logger=require(_0x415f('0x15'))(_0x415f('0x16'));var utils=require(_0x415f('0x17'));var config=require(_0x415f('0x18'));var db=require('../../mysqldb')['db'];function respondWithStatusCode(_0xbe78fb,_0x29e54b){_0x29e54b=_0x29e54b||0xcc;return function(_0xb0b46a){if(_0xb0b46a){return _0xbe78fb[_0x415f('0x19')](_0x29e54b);}return _0xbe78fb[_0x415f('0x1a')](_0x29e54b)[_0x415f('0x1b')]();};}function respondWithResult(_0x388c02,_0x5d14e7){_0x5d14e7=_0x5d14e7||0xc8;return function(_0x59905a){if(_0x59905a){return _0x388c02[_0x415f('0x1a')](_0x5d14e7)['json'](_0x59905a);}};}function respondWithFilteredResult(_0x4e88a4,_0x4e4876){return function(_0x2fd3aa){if(_0x2fd3aa){var _0x265de5=_0x2fd3aa[_0x415f('0x1c')],_0x19c139=_0x4e4876[_0x415f('0x1d')],_0x38a721=_0x4e4876[_0x415f('0x1d')]+_0x4e4876['limit'],_0x22faa9;if(_0x38a721>=_0x265de5){_0x38a721=_0x265de5;_0x22faa9=0xc8;}else{_0x22faa9=0xce;}_0x4e88a4['status'](_0x22faa9);return _0x4e88a4['set']('Content-Range',_0x19c139+'-'+_0x38a721+'/'+_0x265de5)[_0x415f('0x1e')](_0x2fd3aa);}return null;};}function patchUpdates(_0xd12c68){return function(_0x3129d1){try{jsonpatch[_0x415f('0x1f')](_0x3129d1,_0xd12c68,!![]);}catch(_0x22c874){return BPromise[_0x415f('0x20')](_0x22c874);}return _0x3129d1['save']();};}function saveUpdates(_0x3e385c,_0x2b8e0b){return function(_0x3a0725){if(_0x3a0725){return _0x3a0725['update'](_0x3e385c)['then'](function(_0x566841){return _0x566841;});}return null;};}function removeEntity(_0x19b6be,_0x139563){return function(_0x5a219c){if(_0x5a219c){return _0x5a219c[_0x415f('0x21')]()[_0x415f('0x22')](function(){_0x19b6be[_0x415f('0x1a')](0xcc)['end']();});}};}function handleEntityNotFound(_0x2c108b,_0x112017){return function(_0x399c4b){if(!_0x399c4b){_0x2c108b[_0x415f('0x19')](0x194);}return _0x399c4b;};}function handleError(_0x2cbcaf,_0xa980bc){_0xa980bc=_0xa980bc||0x1f4;return function(_0x160bb8){logger['error'](_0x160bb8['stack']);if(_0x160bb8[_0x415f('0x23')]){delete _0x160bb8['name'];}_0x2cbcaf[_0x415f('0x1a')](_0xa980bc)[_0x415f('0x24')](_0x160bb8);};}exports[_0x415f('0x25')]=function(_0x1d0d00,_0x5d7e02){if(_0x1d0d00[_0x415f('0x26')]['id']){delete _0x1d0d00[_0x415f('0x26')]['id'];}return db[_0x415f('0x27')][_0x415f('0x28')]({'where':{'id':_0x1d0d00[_0x415f('0x29')]['id']}})[_0x415f('0x22')](handleEntityNotFound(_0x5d7e02,null))[_0x415f('0x22')](saveUpdates(_0x1d0d00['body'],null))['then'](respondWithResult(_0x5d7e02,null))[_0x415f('0x2a')](handleError(_0x5d7e02,null));};exports[_0x415f('0x21')]=function(_0x33d46e,_0x35c6b0){return db['Condition'][_0x415f('0x28')]({'where':{'id':_0x33d46e[_0x415f('0x29')]['id']}})[_0x415f('0x22')](handleEntityNotFound(_0x35c6b0,null))[_0x415f('0x22')](removeEntity(_0x35c6b0,null))[_0x415f('0x2a')](handleError(_0x35c6b0,null));};
\ No newline at end of file
+var _0x868c=['../../mysqldb','end','status','count','offset','limit','set','Content-Range','json','apply','reject','update','destroy','then','error','stack','name','send','body','Condition','find','params','catch','html-pdf','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','moment','util','path','to-csv','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'];(function(_0x19add0,_0x518f03){var _0x49d6f2=function(_0x3211e4){while(--_0x3211e4){_0x19add0['push'](_0x19add0['shift']());}};_0x49d6f2(++_0x518f03);}(_0x868c,0x16e));var _0xc868=function(_0x3d5f84,_0x569548){_0x3d5f84=_0x3d5f84-0x0;var _0x1981b8=_0x868c[_0x3d5f84];return _0x1981b8;};'use strict';var pdf=require(_0xc868('0x0'));var emlformat=require(_0xc868('0x1'));var rimraf=require(_0xc868('0x2'));var zipdir=require(_0xc868('0x3'));var jsonpatch=require(_0xc868('0x4'));var rp=require(_0xc868('0x5'));var moment=require(_0xc868('0x6'));var BPromise=require('bluebird');var Mustache=require('mustache');var util=require(_0xc868('0x7'));var path=require(_0xc868('0x8'));var sox=require('sox');var csv=require(_0xc868('0x9'));var ejs=require('ejs');var fs=require('fs');var _=require(_0xc868('0xa'));var squel=require(_0xc868('0xb'));var crypto=require(_0xc868('0xc'));var jsforce=require(_0xc868('0xd'));var deskjs=require(_0xc868('0xe'));var toCsv=require(_0xc868('0x9'));var querystring=require(_0xc868('0xf'));var Papa=require(_0xc868('0x10'));var Redis=require(_0xc868('0x11'));var authService=require(_0xc868('0x12'));var qs=require(_0xc868('0x13'));var as=require(_0xc868('0x14'));var hardwareService=require(_0xc868('0x15'));var logger=require(_0xc868('0x16'))(_0xc868('0x17'));var utils=require(_0xc868('0x18'));var config=require(_0xc868('0x19'));var db=require(_0xc868('0x1a'))['db'];function respondWithStatusCode(_0xb246f1,_0x3c48ec){_0x3c48ec=_0x3c48ec||0xcc;return function(_0x130f42){if(_0x130f42){return _0xb246f1['sendStatus'](_0x3c48ec);}return _0xb246f1['status'](_0x3c48ec)[_0xc868('0x1b')]();};}function respondWithResult(_0x25544d,_0x59ca93){_0x59ca93=_0x59ca93||0xc8;return function(_0x2c8387){if(_0x2c8387){return _0x25544d[_0xc868('0x1c')](_0x59ca93)['json'](_0x2c8387);}};}function respondWithFilteredResult(_0x4b70c2,_0xe7b606){return function(_0x461bb9){if(_0x461bb9){var _0x3273f3=_0x461bb9[_0xc868('0x1d')],_0x4dd4b8=_0xe7b606['offset'],_0x25592c=_0xe7b606[_0xc868('0x1e')]+_0xe7b606[_0xc868('0x1f')],_0x3908c3;if(_0x25592c>=_0x3273f3){_0x25592c=_0x3273f3;_0x3908c3=0xc8;}else{_0x3908c3=0xce;}_0x4b70c2[_0xc868('0x1c')](_0x3908c3);return _0x4b70c2[_0xc868('0x20')](_0xc868('0x21'),_0x4dd4b8+'-'+_0x25592c+'/'+_0x3273f3)[_0xc868('0x22')](_0x461bb9);}return null;};}function patchUpdates(_0x4547e7){return function(_0x179055){try{jsonpatch[_0xc868('0x23')](_0x179055,_0x4547e7,!![]);}catch(_0x3abc53){return BPromise[_0xc868('0x24')](_0x3abc53);}return _0x179055['save']();};}function saveUpdates(_0x49af3a,_0x10a459){return function(_0x56769d){if(_0x56769d){return _0x56769d[_0xc868('0x25')](_0x49af3a)['then'](function(_0x54a826){return _0x54a826;});}return null;};}function removeEntity(_0x109e0e,_0x17d40b){return function(_0x317363){if(_0x317363){return _0x317363[_0xc868('0x26')]()[_0xc868('0x27')](function(){_0x109e0e['status'](0xcc)[_0xc868('0x1b')]();});}};}function handleEntityNotFound(_0x4605fa,_0x2a2562){return function(_0x28f994){if(!_0x28f994){_0x4605fa['sendStatus'](0x194);}return _0x28f994;};}function handleError(_0x4dd2d2,_0x4c7a6d){_0x4c7a6d=_0x4c7a6d||0x1f4;return function(_0x5ab381){logger[_0xc868('0x28')](_0x5ab381[_0xc868('0x29')]);if(_0x5ab381[_0xc868('0x2a')]){delete _0x5ab381['name'];}_0x4dd2d2['status'](_0x4c7a6d)[_0xc868('0x2b')](_0x5ab381);};}exports['update']=function(_0x1074a2,_0x36840d){if(_0x1074a2['body']['id']){delete _0x1074a2[_0xc868('0x2c')]['id'];}return db[_0xc868('0x2d')][_0xc868('0x2e')]({'where':{'id':_0x1074a2[_0xc868('0x2f')]['id']}})[_0xc868('0x27')](handleEntityNotFound(_0x36840d,null))[_0xc868('0x27')](saveUpdates(_0x1074a2[_0xc868('0x2c')],null))[_0xc868('0x27')](respondWithResult(_0x36840d,null))['catch'](handleError(_0x36840d,null));};exports['destroy']=function(_0x94c9e,_0x12a00a){return db[_0xc868('0x2d')]['find']({'where':{'id':_0x94c9e[_0xc868('0x2f')]['id']}})[_0xc868('0x27')](handleEntityNotFound(_0x12a00a,null))[_0xc868('0x27')](removeEntity(_0x12a00a,null))[_0xc868('0x30')](handleError(_0x12a00a,null));};
\ No newline at end of file
diff --git a/server/api/condition/condition.model.js b/server/api/condition/condition.model.js
index 7ecdaa7..8a7268b 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 _0xf39a=['path','rimraf','../../config/environment','exports','define','Condition','tools_conditions','lodash','api','moment','bluebird','request-promise'];(function(_0xe119f8,_0x4ddc8b){var _0x5c6060=function(_0x24345b){while(--_0x24345b){_0xe119f8['push'](_0xe119f8['shift']());}};_0x5c6060(++_0x4ddc8b);}(_0xf39a,0x14b));var _0xaf39=function(_0x504e19,_0x10f013){_0x504e19=_0x504e19-0x0;var _0x4de9b1=_0xf39a[_0x504e19];return _0x4de9b1;};'use strict';var _=require(_0xaf39('0x0'));var util=require('util');var logger=require('../../config/logger')(_0xaf39('0x1'));var moment=require(_0xaf39('0x2'));var BPromise=require(_0xaf39('0x3'));var rp=require(_0xaf39('0x4'));var fs=require('fs');var path=require(_0xaf39('0x5'));var rimraf=require(_0xaf39('0x6'));var config=require(_0xaf39('0x7'));var attributes=require('./condition.attributes');module[_0xaf39('0x8')]=function(_0x3887a7,_0x560518){return _0x3887a7[_0xaf39('0x9')](_0xaf39('0xa'),attributes,{'tableName':_0xaf39('0xb'),'paranoid':![],'indexes':[],'timestamps':!![]});};
\ No newline at end of file
+var _0x4113=['exports','define','Condition','lodash','../../config/logger','api','bluebird','path','rimraf','../../config/environment','./condition.attributes'];(function(_0x2ea177,_0x143370){var _0x1749ea=function(_0x5dd584){while(--_0x5dd584){_0x2ea177['push'](_0x2ea177['shift']());}};_0x1749ea(++_0x143370);}(_0x4113,0xa8));var _0x3411=function(_0x5de22a,_0xa2ef91){_0x5de22a=_0x5de22a-0x0;var _0x13469e=_0x4113[_0x5de22a];return _0x13469e;};'use strict';var _=require(_0x3411('0x0'));var util=require('util');var logger=require(_0x3411('0x1'))(_0x3411('0x2'));var moment=require('moment');var BPromise=require(_0x3411('0x3'));var rp=require('request-promise');var fs=require('fs');var path=require(_0x3411('0x4'));var rimraf=require(_0x3411('0x5'));var config=require(_0x3411('0x6'));var attributes=require(_0x3411('0x7'));module[_0x3411('0x8')]=function(_0x5c6d4a,_0x35b15b){return _0x5c6d4a[_0x3411('0x9')](_0x3411('0xa'),attributes,{'tableName':'tools_conditions','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 6a7d715..d2e9455 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 _0x2f9d=['code','message','info','result','lodash','util','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/logger','rpc','../../config/environment','jayson/promise','client','http','request','then','Condition,\x20%s,\x20%s','request\x20sent','debug','Condition,\x20%s,\x20%s,\x20%s','error'];(function(_0x46698a,_0x8de1e4){var _0x356db0=function(_0x19e83c){while(--_0x19e83c){_0x46698a['push'](_0x46698a['shift']());}};_0x356db0(++_0x8de1e4);}(_0x2f9d,0x184));var _0xd2f9=function(_0x5037ab,_0x43209e){_0x5037ab=_0x5037ab-0x0;var _0x512adb=_0x2f9d[_0x5037ab];return _0x512adb;};'use strict';var _=require(_0xd2f9('0x0'));var util=require(_0xd2f9('0x1'));var moment=require(_0xd2f9('0x2'));var BPromise=require(_0xd2f9('0x3'));var rs=require(_0xd2f9('0x4'));var fs=require('fs');var Redis=require(_0xd2f9('0x5'));var db=require(_0xd2f9('0x6'))['db'];var utils=require('../../config/utils');var logger=require(_0xd2f9('0x7'))(_0xd2f9('0x8'));var config=require(_0xd2f9('0x9'));var jayson=require(_0xd2f9('0xa'));var client=jayson[_0xd2f9('0xb')][_0xd2f9('0xc')]({'port':0x232a});function respondWithRpcPromise(_0x3d3519,_0x232ff6,_0x127a12){return new BPromise(function(_0x4423c3,_0x275748){return client[_0xd2f9('0xd')](_0x3d3519,_0x127a12)[_0xd2f9('0xe')](function(_0x4f85a1){logger['info'](_0xd2f9('0xf'),_0x232ff6,_0xd2f9('0x10'));logger[_0xd2f9('0x11')](_0xd2f9('0x12'),_0x232ff6,_0xd2f9('0x10'),JSON['stringify'](_0x4f85a1));if(_0x4f85a1[_0xd2f9('0x13')]){if(_0x4f85a1[_0xd2f9('0x13')][_0xd2f9('0x14')]===0x1f4){logger[_0xd2f9('0x13')](_0xd2f9('0xf'),_0x232ff6,_0x4f85a1[_0xd2f9('0x13')][_0xd2f9('0x15')]);return _0x275748(_0x4f85a1[_0xd2f9('0x13')][_0xd2f9('0x15')]);}logger[_0xd2f9('0x13')](_0xd2f9('0xf'),_0x232ff6,_0x4f85a1[_0xd2f9('0x13')][_0xd2f9('0x15')]);return _0x4423c3(_0x4f85a1['error'][_0xd2f9('0x15')]);}else{logger[_0xd2f9('0x16')](_0xd2f9('0xf'),_0x232ff6,_0xd2f9('0x10'));_0x4423c3(_0x4f85a1[_0xd2f9('0x17')]['message']);}})['catch'](function(_0x3ffa0f){logger['error'](_0xd2f9('0xf'),_0x232ff6,_0x3ffa0f);_0x275748(_0x3ffa0f);});});}
\ No newline at end of file
+var _0x05e4=['rpc','jayson/promise','client','http','then','Condition,\x20%s,\x20%s','request\x20sent','Condition,\x20%s,\x20%s,\x20%s','stringify','error','message','info','util','moment','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger'];(function(_0x3dd15e,_0x1f0015){var _0x231fd0=function(_0x4f680a){while(--_0x4f680a){_0x3dd15e['push'](_0x3dd15e['shift']());}};_0x231fd0(++_0x1f0015);}(_0x05e4,0x1c1));var _0x405e=function(_0x46f1da,_0x31c1be){_0x46f1da=_0x46f1da-0x0;var _0xddba6a=_0x05e4[_0x46f1da];return _0xddba6a;};'use strict';var _=require('lodash');var util=require(_0x405e('0x0'));var moment=require(_0x405e('0x1'));var BPromise=require('bluebird');var rs=require(_0x405e('0x2'));var fs=require('fs');var Redis=require(_0x405e('0x3'));var db=require(_0x405e('0x4'))['db'];var utils=require(_0x405e('0x5'));var logger=require(_0x405e('0x6'))(_0x405e('0x7'));var config=require('../../config/environment');var jayson=require(_0x405e('0x8'));var client=jayson[_0x405e('0x9')][_0x405e('0xa')]({'port':0x232a});function respondWithRpcPromise(_0x5cdc78,_0x4e2cc0,_0x2e4df6){return new BPromise(function(_0x156026,_0x2696e8){return client['request'](_0x5cdc78,_0x2e4df6)[_0x405e('0xb')](function(_0xc26782){logger['info'](_0x405e('0xc'),_0x4e2cc0,_0x405e('0xd'));logger['debug'](_0x405e('0xe'),_0x4e2cc0,_0x405e('0xd'),JSON[_0x405e('0xf')](_0xc26782));if(_0xc26782['error']){if(_0xc26782[_0x405e('0x10')]['code']===0x1f4){logger[_0x405e('0x10')](_0x405e('0xc'),_0x4e2cc0,_0xc26782[_0x405e('0x10')][_0x405e('0x11')]);return _0x2696e8(_0xc26782['error'][_0x405e('0x11')]);}logger[_0x405e('0x10')](_0x405e('0xc'),_0x4e2cc0,_0xc26782[_0x405e('0x10')][_0x405e('0x11')]);return _0x156026(_0xc26782['error'][_0x405e('0x11')]);}else{logger[_0x405e('0x12')](_0x405e('0xc'),_0x4e2cc0,_0x405e('0xd'));_0x156026(_0xc26782['result'][_0x405e('0x11')]);}})['catch'](function(_0x505663){logger[_0x405e('0x10')](_0x405e('0xc'),_0x4e2cc0,_0x505663);_0x2696e8(_0x505663);});});}
\ No newline at end of file
diff --git a/server/api/condition/index.js b/server/api/condition/index.js
index 64f4221..924a769 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 _0xc027=['express','Router','../../components/auth/service','../../components/interaction/service','../../config/environment','./condition.controller','put','/:id','update','delete','destroy','exports','multer','util','path','connect-timeout'];(function(_0x36fafc,_0x22bc85){var _0x43707b=function(_0x5da930){while(--_0x5da930){_0x36fafc['push'](_0x36fafc['shift']());}};_0x43707b(++_0x22bc85);}(_0xc027,0x8c));var _0x7c02=function(_0x26b59c,_0x5c6f81){_0x26b59c=_0x26b59c-0x0;var _0x46f553=_0xc027[_0x26b59c];return _0x46f553;};'use strict';var multer=require(_0x7c02('0x0'));var util=require(_0x7c02('0x1'));var path=require(_0x7c02('0x2'));var timeout=require(_0x7c02('0x3'));var express=require(_0x7c02('0x4'));var router=express[_0x7c02('0x5')]();var auth=require(_0x7c02('0x6'));var interaction=require(_0x7c02('0x7'));var config=require(_0x7c02('0x8'));var controller=require(_0x7c02('0x9'));router[_0x7c02('0xa')](_0x7c02('0xb'),auth['isAuthenticated'](),controller[_0x7c02('0xc')]);router[_0x7c02('0xd')](_0x7c02('0xb'),auth['isAuthenticated'](),controller[_0x7c02('0xe')]);module[_0x7c02('0xf')]=router;
\ No newline at end of file
+var _0x5ffd=['exports','multer','path','connect-timeout','express','Router','../../components/interaction/service','./condition.controller','put','/:id','isAuthenticated','update','delete'];(function(_0x192f5c,_0x63d759){var _0x48b414=function(_0x553038){while(--_0x553038){_0x192f5c['push'](_0x192f5c['shift']());}};_0x48b414(++_0x63d759);}(_0x5ffd,0x16d));var _0xd5ff=function(_0x4bd1c7,_0x28db06){_0x4bd1c7=_0x4bd1c7-0x0;var _0x4267db=_0x5ffd[_0x4bd1c7];return _0x4267db;};'use strict';var multer=require(_0xd5ff('0x0'));var util=require('util');var path=require(_0xd5ff('0x1'));var timeout=require(_0xd5ff('0x2'));var express=require(_0xd5ff('0x3'));var router=express[_0xd5ff('0x4')]();var auth=require('../../components/auth/service');var interaction=require(_0xd5ff('0x5'));var config=require('../../config/environment');var controller=require(_0xd5ff('0x6'));router[_0xd5ff('0x7')](_0xd5ff('0x8'),auth[_0xd5ff('0x9')](),controller[_0xd5ff('0xa')]);router[_0xd5ff('0xb')](_0xd5ff('0x8'),auth[_0xd5ff('0x9')](),controller['destroy']);module[_0xd5ff('0xc')]=router;
\ No newline at end of file
diff --git a/server/api/dashboard/dashboard.attributes.js b/server/api/dashboard/dashboard.attributes.js
index 9e6f600..ce040c9 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 _0x0e50=['sequelize','exports','STRING'];(function(_0x37c582,_0x290a68){var _0xa0a776=function(_0x31c8e0){while(--_0x31c8e0){_0x37c582['push'](_0x37c582['shift']());}};_0xa0a776(++_0x290a68);}(_0x0e50,0x168));var _0x00e5=function(_0x1b6186,_0x1ec7f2){_0x1b6186=_0x1b6186-0x0;var _0x186121=_0x0e50[_0x1b6186];return _0x186121;};'use strict';var Sequelize=require(_0x00e5('0x0'));module[_0x00e5('0x1')]={'name':{'type':Sequelize[_0x00e5('0x2')],'allowNull':![],'unique':'name'},'description':{'type':Sequelize[_0x00e5('0x2')]}};
\ No newline at end of file
+var _0x2bd8=['name','sequelize','STRING'];(function(_0x5e41f9,_0x51903b){var _0x112d90=function(_0x56c928){while(--_0x56c928){_0x5e41f9['push'](_0x5e41f9['shift']());}};_0x112d90(++_0x51903b);}(_0x2bd8,0x130));var _0x82bd=function(_0xc7112d,_0x5e82e4){_0xc7112d=_0xc7112d-0x0;var _0x3a1bc1=_0x2bd8[_0xc7112d];return _0x3a1bc1;};'use strict';var Sequelize=require(_0x82bd('0x0'));module['exports']={'name':{'type':Sequelize[_0x82bd('0x1')],'allowNull':![],'unique':_0x82bd('0x2')},'description':{'type':Sequelize[_0x82bd('0x1')]}};
\ No newline at end of file
diff --git a/server/api/dashboard/dashboard.controller.js b/server/api/dashboard/dashboard.controller.js
index 7969c5e..b88be0c 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 _0x53f7=['user','get','Unable\x20to\x20retrieve\x20the\x20current\x20user','role','UserProfileSection','userProfileId','autoAssociation','UserProfileResource','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','clone','options','omit','createdAt','updatedAt','iframe','attrUrl','attrs','value','https://','custom','attrPath','clock','attrHourFormat','attrTimezone','0.00','attrFontSize','attrMetric','total','multibar-chart','pie-chart','attrSerie1','attrSerie2','attrSerie3','attrVoiceQueues','web-report','attrReport','reportType','attrRefresh','widgetAttributes:\x20%s','stringify','DashboardId','DashboardItem','getItems','findOne','hasOwnProperty','nolimit','html-pdf','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','moment','mustache','util','path','sox','to-csv','ejs','lodash','squel','crypto','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','./dashboard.socket','register','sendStatus','status','end','json','offset','apply','reject','save','update','then','CustomDashboards','destroy','error','stack','name','send','index','Dashboard','rawAttributes','fieldName','type','key','model','keys','query','filters','intersection','attributes','fields','length','limit','order','sort','where','pick','merge','map','VIRTUAL','filter','count','include','rows','show','params','includeAll','find','catch','create','body'];(function(_0x2dafbe,_0x5d04de){var _0x58a45a=function(_0x50ac96){while(--_0x50ac96){_0x2dafbe['push'](_0x2dafbe['shift']());}};_0x58a45a(++_0x5d04de);}(_0x53f7,0x12c));var _0x753f=function(_0x559499,_0x2ecc11){_0x559499=_0x559499-0x0;var _0x476cb7=_0x53f7[_0x559499];return _0x476cb7;};'use strict';var pdf=require(_0x753f('0x0'));var emlformat=require(_0x753f('0x1'));var rimraf=require(_0x753f('0x2'));var zipdir=require(_0x753f('0x3'));var jsonpatch=require(_0x753f('0x4'));var rp=require(_0x753f('0x5'));var moment=require(_0x753f('0x6'));var BPromise=require('bluebird');var Mustache=require(_0x753f('0x7'));var util=require(_0x753f('0x8'));var path=require(_0x753f('0x9'));var sox=require(_0x753f('0xa'));var csv=require(_0x753f('0xb'));var ejs=require(_0x753f('0xc'));var fs=require('fs');var _=require(_0x753f('0xd'));var squel=require(_0x753f('0xe'));var crypto=require(_0x753f('0xf'));var jsforce=require('jsforce');var deskjs=require('desk.js');var toCsv=require('to-csv');var querystring=require(_0x753f('0x10'));var Papa=require(_0x753f('0x11'));var Redis=require(_0x753f('0x12'));var authService=require(_0x753f('0x13'));var qs=require(_0x753f('0x14'));var as=require(_0x753f('0x15'));var hardwareService=require(_0x753f('0x16'));var logger=require(_0x753f('0x17'))(_0x753f('0x18'));var utils=require('../../config/utils');var config=require(_0x753f('0x19'));var db=require('../../mysqldb')['db'];config[_0x753f('0x1a')]=_[_0x753f('0x1b')](config[_0x753f('0x1a')],{'host':_0x753f('0x1c'),'port':0x18eb});var socket=require(_0x753f('0x1d'))(new Redis(config['redis']));require(_0x753f('0x1e'))[_0x753f('0x1f')](socket);function respondWithStatusCode(_0x1048d9,_0x516fbf){_0x516fbf=_0x516fbf||0xcc;return function(_0x77b7e7){if(_0x77b7e7){return _0x1048d9[_0x753f('0x20')](_0x516fbf);}return _0x1048d9[_0x753f('0x21')](_0x516fbf)[_0x753f('0x22')]();};}function respondWithResult(_0x17c22b,_0x20dff1){_0x20dff1=_0x20dff1||0xc8;return function(_0x4f2917){if(_0x4f2917){return _0x17c22b['status'](_0x20dff1)[_0x753f('0x23')](_0x4f2917);}};}function respondWithFilteredResult(_0xd32265,_0x22aca4){return function(_0x3f0c5e){if(_0x3f0c5e){var _0x39e35b=_0x3f0c5e['count'],_0x4d1c44=_0x22aca4['offset'],_0x21aa9b=_0x22aca4[_0x753f('0x24')]+_0x22aca4['limit'],_0x583fa0;if(_0x21aa9b>=_0x39e35b){_0x21aa9b=_0x39e35b;_0x583fa0=0xc8;}else{_0x583fa0=0xce;}_0xd32265[_0x753f('0x21')](_0x583fa0);return _0xd32265['set']('Content-Range',_0x4d1c44+'-'+_0x21aa9b+'/'+_0x39e35b)[_0x753f('0x23')](_0x3f0c5e);}return null;};}function patchUpdates(_0x20c405){return function(_0x593c51){try{jsonpatch[_0x753f('0x25')](_0x593c51,_0x20c405,!![]);}catch(_0x4894e9){return BPromise[_0x753f('0x26')](_0x4894e9);}return _0x593c51[_0x753f('0x27')]();};}function saveUpdates(_0x408e2f,_0x56cf29){return function(_0x50390c){if(_0x50390c){return _0x50390c[_0x753f('0x28')](_0x408e2f)[_0x753f('0x29')](function(_0x47dbb4){return _0x47dbb4;});}return null;};}function removeEntity(_0x5d3621,_0x1bfa6a){return function(_0x16e52c){if(_0x16e52c){return _0x16e52c['destroy']()[_0x753f('0x29')](function(){var _0x30950d=_0x16e52c['get']({'plain':!![]});var _0x48d2a8=_0x753f('0x2a');return db['UserProfileResource'][_0x753f('0x2b')]({'where':{'type':_0x48d2a8,'resourceId':_0x30950d['id']}})[_0x753f('0x29')](function(){return _0x16e52c;});})[_0x753f('0x29')](function(){_0x5d3621['status'](0xcc)['end']();});}};}function handleEntityNotFound(_0x304c79,_0x43ab0e){return function(_0x271267){if(!_0x271267){_0x304c79[_0x753f('0x20')](0x194);}return _0x271267;};}function handleError(_0x3b0dc6,_0x101559){_0x101559=_0x101559||0x1f4;return function(_0x4623ab){logger[_0x753f('0x2c')](_0x4623ab[_0x753f('0x2d')]);if(_0x4623ab[_0x753f('0x2e')]){delete _0x4623ab[_0x753f('0x2e')];}_0x3b0dc6['status'](_0x101559)[_0x753f('0x2f')](_0x4623ab);};}exports[_0x753f('0x30')]=function(_0x424e8a,_0x3eb34d){var _0x25d71a={},_0x1fb17a={},_0x323c91={'count':0x0,'rows':[]};var _0x44913b=_['map'](db[_0x753f('0x31')][_0x753f('0x32')],function(_0x3f417d){return{'name':_0x3f417d[_0x753f('0x33')],'type':_0x3f417d[_0x753f('0x34')][_0x753f('0x35')]};});_0x1fb17a[_0x753f('0x36')]=_['map'](_0x44913b,_0x753f('0x2e'));_0x1fb17a['query']=_[_0x753f('0x37')](_0x424e8a[_0x753f('0x38')]);_0x1fb17a[_0x753f('0x39')]=_[_0x753f('0x3a')](_0x1fb17a[_0x753f('0x36')],_0x1fb17a['query']);_0x25d71a[_0x753f('0x3b')]=_[_0x753f('0x3a')](_0x1fb17a[_0x753f('0x36')],qs[_0x753f('0x3c')](_0x424e8a[_0x753f('0x38')]['fields']));_0x25d71a[_0x753f('0x3b')]=_0x25d71a[_0x753f('0x3b')][_0x753f('0x3d')]?_0x25d71a[_0x753f('0x3b')]:_0x1fb17a[_0x753f('0x36')];if(!_0x424e8a[_0x753f('0x38')]['hasOwnProperty']('nolimit')){_0x25d71a['limit']=qs[_0x753f('0x3e')](_0x424e8a[_0x753f('0x38')][_0x753f('0x3e')]);_0x25d71a[_0x753f('0x24')]=qs['offset'](_0x424e8a['query'][_0x753f('0x24')]);}_0x25d71a[_0x753f('0x3f')]=qs[_0x753f('0x40')](_0x424e8a[_0x753f('0x38')][_0x753f('0x40')]);_0x25d71a[_0x753f('0x41')]=qs[_0x753f('0x39')](_[_0x753f('0x42')](_0x424e8a[_0x753f('0x38')],_0x1fb17a[_0x753f('0x39')]));if(_0x424e8a[_0x753f('0x38')]['filter']){_0x25d71a['where']=_[_0x753f('0x43')](_0x25d71a[_0x753f('0x41')],{'$or':_[_0x753f('0x44')](_0x44913b,function(_0x1ca6f1){if(_0x1ca6f1[_0x753f('0x34')]!==_0x753f('0x45')){var _0x3baa7b={};_0x3baa7b[_0x1ca6f1[_0x753f('0x2e')]]={'$like':'%'+_0x424e8a[_0x753f('0x38')][_0x753f('0x46')]+'%'};return _0x3baa7b;}})});}_0x25d71a=_[_0x753f('0x43')]({},_0x25d71a,_0x424e8a['options']);var _0x94efaa={'where':_0x25d71a[_0x753f('0x41')]};return db[_0x753f('0x31')]['count'](_0x94efaa)[_0x753f('0x29')](function(_0x162dad){_0x323c91[_0x753f('0x47')]=_0x162dad;if(_0x424e8a[_0x753f('0x38')]['includeAll']){_0x25d71a[_0x753f('0x48')]=[{'all':!![]}];}return db['Dashboard']['findAll'](_0x25d71a);})['then'](function(_0x4e4307){_0x323c91[_0x753f('0x49')]=_0x4e4307;return _0x323c91;})[_0x753f('0x29')](respondWithFilteredResult(_0x3eb34d,_0x25d71a))['catch'](handleError(_0x3eb34d,null));};exports[_0x753f('0x4a')]=function(_0x3df422,_0x4fc828){var _0x329e82={'raw':![],'where':{'id':_0x3df422[_0x753f('0x4b')]['id']}},_0x3dc21a={};_0x3dc21a[_0x753f('0x36')]=_[_0x753f('0x37')](db[_0x753f('0x31')][_0x753f('0x32')]);_0x3dc21a[_0x753f('0x38')]=_[_0x753f('0x37')](_0x3df422[_0x753f('0x38')]);_0x3dc21a[_0x753f('0x39')]=_[_0x753f('0x3a')](_0x3dc21a['model'],_0x3dc21a['query']);_0x329e82['attributes']=_[_0x753f('0x3a')](_0x3dc21a[_0x753f('0x36')],qs[_0x753f('0x3c')](_0x3df422[_0x753f('0x38')][_0x753f('0x3c')]));_0x329e82[_0x753f('0x3b')]=_0x329e82[_0x753f('0x3b')][_0x753f('0x3d')]?_0x329e82['attributes']:_0x3dc21a[_0x753f('0x36')];if(_0x3df422[_0x753f('0x38')][_0x753f('0x4c')]){_0x329e82[_0x753f('0x48')]=[{'all':!![]}];}_0x329e82=_[_0x753f('0x43')]({},_0x329e82,_0x3df422['options']);return db['Dashboard'][_0x753f('0x4d')](_0x329e82)[_0x753f('0x29')](handleEntityNotFound(_0x4fc828,null))['then'](respondWithResult(_0x4fc828,null))[_0x753f('0x4e')](handleError(_0x4fc828,null));};exports[_0x753f('0x4f')]=function(_0x5d5921,_0x4f976e){return db[_0x753f('0x31')][_0x753f('0x4f')](_0x5d5921[_0x753f('0x50')],{})[_0x753f('0x29')](function(_0x285481){var _0x2404ea=_0x5d5921[_0x753f('0x51')][_0x753f('0x52')]({'plain':!![]});if(!_0x2404ea)throw new Error(_0x753f('0x53'));if(_0x2404ea[_0x753f('0x54')]==='user'){var _0xd3e6b=_0x285481[_0x753f('0x52')]({'plain':!![]});var _0x30a1a0=_0x753f('0x2a');return db[_0x753f('0x55')]['find']({'where':{'name':_0x30a1a0,'userProfileId':_0x2404ea[_0x753f('0x56')]},'raw':!![]})[_0x753f('0x29')](function(_0x2aad87){if(_0x2aad87&&_0x2aad87[_0x753f('0x57')]===0x0){return db[_0x753f('0x58')]['create']({'name':_0xd3e6b[_0x753f('0x2e')],'resourceId':_0xd3e6b['id'],'type':_0x2aad87[_0x753f('0x2e')],'sectionId':_0x2aad87['id']},{})['then'](function(){return _0x285481;});}else{return _0x285481;}})[_0x753f('0x4e')](function(_0xce4106){logger['error'](_0x753f('0x59'),_0xce4106);throw _0xce4106;});}return _0x285481;})[_0x753f('0x29')](respondWithResult(_0x4f976e,0xc9))['catch'](handleError(_0x4f976e,null));};exports[_0x753f('0x5a')]=function(_0x1ee6f7,_0xcf2ebb){var _0x4e446b={'where':{'id':_0x1ee6f7[_0x753f('0x4b')]['id']}},_0x3b5b55={};_0x3b5b55['model']=_[_0x753f('0x37')](db[_0x753f('0x31')][_0x753f('0x32')]);_0x4e446b['attributes']=_[_0x753f('0x3a')](_0x3b5b55['model'],qs[_0x753f('0x3c')](_0x1ee6f7[_0x753f('0x38')][_0x753f('0x3c')]));_0x4e446b['attributes']=_0x4e446b[_0x753f('0x3b')][_0x753f('0x3d')]?_0x4e446b['attributes']:_0x3b5b55['model'];if(_0x1ee6f7[_0x753f('0x38')][_0x753f('0x4c')]){_0x4e446b['include']=[{'all':!![]}];}_0x4e446b=_[_0x753f('0x43')]({},_0x4e446b,_0x1ee6f7[_0x753f('0x5b')]);return db['Dashboard'][_0x753f('0x4d')](_0x4e446b)['then'](handleEntityNotFound(_0xcf2ebb,null))[_0x753f('0x29')](function(_0x294f6a){if(_0x294f6a){var _0x19bc8b=_0x294f6a[_0x753f('0x52')]({'plain':!![]});_0x19bc8b=qs[_0x753f('0x5c')](_0x19bc8b,['id',_0x753f('0x5d'),_0x753f('0x5e')]);_0x1ee6f7[_0x753f('0x50')]=_[_0x753f('0x5c')](_0x1ee6f7[_0x753f('0x50')],['id','createdAt',_0x753f('0x5e')]);return db[_0x753f('0x31')]['create'](_['merge'](_0x19bc8b,_0x1ee6f7[_0x753f('0x50')]),{'include':_0x1ee6f7['query']['includeAll']?[{'all':!![]}]:undefined})[_0x753f('0x29')](function(_0x4f274a){var _0x2dafca=_0x1ee6f7[_0x753f('0x51')]['get']({'plain':!![]});if(!_0x2dafca)throw new Error('Unable\x20to\x20retrieve\x20the\x20current\x20user');if(_0x2dafca[_0x753f('0x54')]===_0x753f('0x51')){var _0x3525b3=_0x4f274a[_0x753f('0x52')]({'plain':!![]});var _0x5a4c75='CustomDashboards';return db[_0x753f('0x55')][_0x753f('0x4d')]({'where':{'name':_0x5a4c75,'userProfileId':_0x2dafca['userProfileId']},'raw':!![]})[_0x753f('0x29')](function(_0x513903){if(_0x513903&&_0x513903[_0x753f('0x57')]===0x0){return db[_0x753f('0x58')]['create']({'name':_0x3525b3['name'],'resourceId':_0x3525b3['id'],'type':_0x513903[_0x753f('0x2e')],'sectionId':_0x513903['id']},{})['then'](function(){return _0x4f274a;});}else{return _0x4f274a;}})['catch'](function(_0x453078){logger[_0x753f('0x2c')](_0x753f('0x59'),_0x453078);throw _0x453078;});}return _0x4f274a;});}})[_0x753f('0x29')](respondWithResult(_0xcf2ebb,0xc9))[_0x753f('0x4e')](handleError(_0xcf2ebb,null));};exports['update']=function(_0x598221,_0x1e7e15){if(_0x598221[_0x753f('0x50')]['id']){delete _0x598221[_0x753f('0x50')]['id'];}return db[_0x753f('0x31')][_0x753f('0x4d')]({'where':{'id':_0x598221[_0x753f('0x4b')]['id']}})[_0x753f('0x29')](handleEntityNotFound(_0x1e7e15,null))['then'](saveUpdates(_0x598221[_0x753f('0x50')],null))[_0x753f('0x29')](respondWithResult(_0x1e7e15,null))['catch'](handleError(_0x1e7e15,null));};exports[_0x753f('0x2b')]=function(_0x130f21,_0x3ce55d){return db[_0x753f('0x31')]['find']({'where':{'id':_0x130f21['params']['id']}})[_0x753f('0x29')](handleEntityNotFound(_0x3ce55d,null))[_0x753f('0x29')](removeEntity(_0x3ce55d,null))[_0x753f('0x4e')](handleError(_0x3ce55d,null));};function widgetAttributes(_0xc3614){try{switch(_0xc3614[_0x753f('0x34')]){case _0x753f('0x5f'):return[{'name':_0x753f('0x60'),'value':_0xc3614[_0x753f('0x60')]||(_0xc3614['attrs']&&_0xc3614[_0x753f('0x61')][0x0]?_0xc3614[_0x753f('0x61')][0x0][_0x753f('0x62')]:undefined)||_0x753f('0x63')}];case _0x753f('0x64'):return[{'name':'attrPath','value':_0xc3614[_0x753f('0x65')]||(_0xc3614[_0x753f('0x61')]&&_0xc3614['attrs'][0x0]?_0xc3614['attrs'][0x0][_0x753f('0x62')]:undefined)||''}];case _0x753f('0x66'):return[{'name':'attrHourFormat','value':_0xc3614[_0x753f('0x67')]||(_0xc3614[_0x753f('0x61')]&&_0xc3614[_0x753f('0x61')][0x0]?_0xc3614[_0x753f('0x61')][0x0][_0x753f('0x62')]:undefined)||'HH:mm:ss'},{'name':_0x753f('0x68'),'value':_0xc3614[_0x753f('0x68')]||(_0xc3614[_0x753f('0x61')]&&_0xc3614[_0x753f('0x61')][0x1]?_0xc3614['attrs'][0x1][_0x753f('0x62')]:undefined)||_0x753f('0x69')},{'name':_0x753f('0x6a'),'value':_0xc3614[_0x753f('0x6a')]||(_0xc3614[_0x753f('0x61')]&&_0xc3614[_0x753f('0x61')][0x2]?_0xc3614[_0x753f('0x61')][0x2][_0x753f('0x62')]:undefined)||0xc}];case'counter':return[{'name':_0x753f('0x6b'),'value':_0xc3614['attrMetric']||(_0xc3614[_0x753f('0x61')]&&_0xc3614[_0x753f('0x61')][0x0]?_0xc3614[_0x753f('0x61')][0x0]['value']:undefined)||_0x753f('0x6c')},{'name':'attrVoiceQueues','value':_0xc3614['attrVoiceQueues']||(_0xc3614[_0x753f('0x61')]&&_0xc3614[_0x753f('0x61')][0x1]?_0xc3614[_0x753f('0x61')][0x1][_0x753f('0x62')]:undefined)||[]},{'name':_0x753f('0x6a'),'value':_0xc3614[_0x753f('0x6a')]||(_0xc3614[_0x753f('0x61')]&&_0xc3614[_0x753f('0x61')][0x2]?_0xc3614[_0x753f('0x61')][0x2]['value']:undefined)||0x14}];case _0x753f('0x6d'):case _0x753f('0x6e'):return[{'name':_0x753f('0x6f'),'value':_0xc3614[_0x753f('0x6f')]||(_0xc3614[_0x753f('0x61')]&&_0xc3614[_0x753f('0x61')][0x0]?_0xc3614[_0x753f('0x61')][0x0][_0x753f('0x62')]:undefined)||_0x753f('0x6c')},{'name':_0x753f('0x70'),'value':_0xc3614[_0x753f('0x70')]||(_0xc3614[_0x753f('0x61')]&&_0xc3614[_0x753f('0x61')][0x1]?_0xc3614[_0x753f('0x61')][0x1][_0x753f('0x62')]:undefined)||null},{'name':_0x753f('0x71'),'value':_0xc3614[_0x753f('0x71')]||(_0xc3614[_0x753f('0x61')]&&_0xc3614['attrs'][0x2]?_0xc3614['attrs'][0x2][_0x753f('0x62')]:undefined)||null},{'name':_0x753f('0x72'),'value':_0xc3614[_0x753f('0x72')]||(_0xc3614[_0x753f('0x61')]&&_0xc3614[_0x753f('0x61')][0x3]?_0xc3614[_0x753f('0x61')][0x3][_0x753f('0x62')]:undefined)||[]}];case _0x753f('0x73'):return[{'name':_0x753f('0x74'),'type':_0xc3614[_0x753f('0x75')]||(_0xc3614[_0x753f('0x61')]&&_0xc3614[_0x753f('0x61')][0x0]?_0xc3614[_0x753f('0x61')][0x0]['type']:undefined)||null,'value':_0xc3614['attrReport']||(_0xc3614[_0x753f('0x61')]&&_0xc3614['attrs'][0x0]?_0xc3614[_0x753f('0x61')][0x0][_0x753f('0x62')]:undefined)||null},{'name':'attrRefresh','value':_0xc3614[_0x753f('0x76')]||(_0xc3614[_0x753f('0x61')]&&_0xc3614[_0x753f('0x61')][0x1]?_0xc3614['attrs'][0x1][_0x753f('0x62')]:undefined)||0x0}];default:return[];}}catch(_0x381321){logger[_0x753f('0x2c')](_0x753f('0x77'),JSON[_0x753f('0x78')](_0x381321));return[];}}exports['addItem']=function(_0x314338,_0x4a72c5,_0xa165dc){if(_0x314338[_0x753f('0x50')]['id']){delete _0x314338['body']['id'];}return db['Dashboard']['find']({'where':{'id':_0x314338[_0x753f('0x4b')]['id']}})[_0x753f('0x29')](handleEntityNotFound(_0x4a72c5,null))[_0x753f('0x29')](function(_0x25771e){if(_0x25771e){_0x314338['body'][_0x753f('0x79')]=_0x25771e['id'];_0x314338['body'][_0x753f('0x61')]=widgetAttributes(_0x314338[_0x753f('0x50')]);return db[_0x753f('0x7a')]['create'](_0x314338[_0x753f('0x50')]);}})['then'](respondWithResult(_0x4a72c5,null))['catch'](handleError(_0x4a72c5,null));};exports[_0x753f('0x7b')]=function(_0x4fbd01,_0x2eb175,_0x27a4ff){var _0x20889a={};var _0xd5df6e={};var _0x321c9d;var _0x3cdd0b;return db[_0x753f('0x31')][_0x753f('0x7c')]({'where':{'id':_0x4fbd01[_0x753f('0x4b')]['id']}})[_0x753f('0x29')](handleEntityNotFound(_0x2eb175,null))[_0x753f('0x29')](function(_0x38eccc){if(_0x38eccc){_0x321c9d=_0x38eccc;_0xd5df6e[_0x753f('0x36')]=_[_0x753f('0x37')](db[_0x753f('0x7a')][_0x753f('0x32')]);_0xd5df6e['query']=_[_0x753f('0x37')](_0x4fbd01[_0x753f('0x38')]);_0xd5df6e[_0x753f('0x39')]=_[_0x753f('0x3a')](_0xd5df6e[_0x753f('0x36')],_0xd5df6e[_0x753f('0x38')]);_0x20889a['attributes']=_[_0x753f('0x3a')](_0xd5df6e[_0x753f('0x36')],qs['fields'](_0x4fbd01[_0x753f('0x38')]['fields']));_0x20889a[_0x753f('0x3b')]=_0x20889a['attributes']['length']?_0x20889a[_0x753f('0x3b')]:_0xd5df6e[_0x753f('0x36')];_0x20889a[_0x753f('0x3f')]=qs[_0x753f('0x40')](_0x4fbd01[_0x753f('0x38')]['sort']);_0x20889a[_0x753f('0x41')]=qs[_0x753f('0x39')](_[_0x753f('0x42')](_0x4fbd01[_0x753f('0x38')],_0xd5df6e[_0x753f('0x39')]));if(_0x4fbd01[_0x753f('0x38')]['filter']){_0x20889a[_0x753f('0x41')]=_['merge'](_0x20889a[_0x753f('0x41')],{'$or':_[_0x753f('0x44')](_0x20889a[_0x753f('0x3b')],function(_0x5471e5){var _0x3bbed2={};_0x3bbed2[_0x5471e5]={'$like':'%'+_0x4fbd01[_0x753f('0x38')][_0x753f('0x46')]+'%'};return _0x3bbed2;})});}_0x20889a=_[_0x753f('0x43')]({},_0x20889a,_0x4fbd01['options']);return _0x321c9d[_0x753f('0x7b')](_0x20889a);}})[_0x753f('0x29')](function(_0x1354c2){if(_0x1354c2){_0x3cdd0b=_0x1354c2[_0x753f('0x3d')];if(!_0x4fbd01['query'][_0x753f('0x7d')](_0x753f('0x7e'))){_0x20889a[_0x753f('0x3e')]=qs[_0x753f('0x3e')](_0x4fbd01['query'][_0x753f('0x3e')]);_0x20889a[_0x753f('0x24')]=qs[_0x753f('0x24')](_0x4fbd01[_0x753f('0x38')]['offset']);}return _0x321c9d[_0x753f('0x7b')](_0x20889a);}})[_0x753f('0x29')](function(_0x55cd11){if(_0x55cd11){return _0x55cd11?{'count':_0x3cdd0b,'rows':_0x55cd11}:null;}})[_0x753f('0x29')](respondWithResult(_0x2eb175,null))[_0x753f('0x4e')](handleError(_0x2eb175,null));};
\ No newline at end of file
+var _0x24b3=['../../config/logger','api','../../config/utils','../../config/environment','../../mysqldb','redis','localhost','socket.io-emitter','./dashboard.socket','register','sendStatus','end','json','count','offset','limit','status','save','update','then','UserProfileResource','destroy','error','stack','name','index','map','Dashboard','rawAttributes','fieldName','type','model','query','keys','filters','intersection','attributes','fields','length','hasOwnProperty','nolimit','order','sort','filter','where','VIRTUAL','options','includeAll','include','catch','params','merge','find','create','get','Unable\x20to\x20retrieve\x20the\x20current\x20user','role','user','CustomDashboards','UserProfileSection','autoAssociation','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','clone','createdAt','updatedAt','body','omit','userProfileId','iframe','attrUrl','attrs','custom','value','clock','attrHourFormat','HH:mm:ss','attrTimezone','0.00','attrFontSize','counter','attrMetric','attrVoiceQueues','multibar-chart','pie-chart','attrSerie1','total','attrSerie2','attrSerie3','web-report','reportType','attrReport','attrRefresh','widgetAttributes:\x20%s','addItem','DashboardId','DashboardItem','getItems','findOne','html-pdf','eml-format','rimraf','fast-json-patch','mustache','util','sox','squel','crypto','jsforce','papaparse','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware'];(function(_0x582f02,_0x54ad06){var _0x320926=function(_0x2269cc){while(--_0x2269cc){_0x582f02['push'](_0x582f02['shift']());}};_0x320926(++_0x54ad06);}(_0x24b3,0xd3));var _0x324b=function(_0x3eb890,_0x29057e){_0x3eb890=_0x3eb890-0x0;var _0x9729c=_0x24b3[_0x3eb890];return _0x9729c;};'use strict';var pdf=require(_0x324b('0x0'));var emlformat=require(_0x324b('0x1'));var rimraf=require(_0x324b('0x2'));var zipdir=require('zip-dir');var jsonpatch=require(_0x324b('0x3'));var rp=require('request-promise');var moment=require('moment');var BPromise=require('bluebird');var Mustache=require(_0x324b('0x4'));var util=require(_0x324b('0x5'));var path=require('path');var sox=require(_0x324b('0x6'));var csv=require('to-csv');var ejs=require('ejs');var fs=require('fs');var _=require('lodash');var squel=require(_0x324b('0x7'));var crypto=require(_0x324b('0x8'));var jsforce=require(_0x324b('0x9'));var deskjs=require('desk.js');var toCsv=require('to-csv');var querystring=require('querystring');var Papa=require(_0x324b('0xa'));var Redis=require('ioredis');var authService=require(_0x324b('0xb'));var qs=require(_0x324b('0xc'));var as=require(_0x324b('0xd'));var hardwareService=require(_0x324b('0xe'));var logger=require(_0x324b('0xf'))(_0x324b('0x10'));var utils=require(_0x324b('0x11'));var config=require(_0x324b('0x12'));var db=require(_0x324b('0x13'))['db'];config[_0x324b('0x14')]=_['defaults'](config[_0x324b('0x14')],{'host':_0x324b('0x15'),'port':0x18eb});var socket=require(_0x324b('0x16'))(new Redis(config[_0x324b('0x14')]));require(_0x324b('0x17'))[_0x324b('0x18')](socket);function respondWithStatusCode(_0x9746e5,_0x9ebae8){_0x9ebae8=_0x9ebae8||0xcc;return function(_0x4652c7){if(_0x4652c7){return _0x9746e5[_0x324b('0x19')](_0x9ebae8);}return _0x9746e5['status'](_0x9ebae8)[_0x324b('0x1a')]();};}function respondWithResult(_0x4fd4cc,_0x2d65ae){_0x2d65ae=_0x2d65ae||0xc8;return function(_0x30e7c4){if(_0x30e7c4){return _0x4fd4cc['status'](_0x2d65ae)[_0x324b('0x1b')](_0x30e7c4);}};}function respondWithFilteredResult(_0x75251d,_0x2ee628){return function(_0x1f797c){if(_0x1f797c){var _0x209104=_0x1f797c[_0x324b('0x1c')],_0x2def86=_0x2ee628[_0x324b('0x1d')],_0x38a03f=_0x2ee628[_0x324b('0x1d')]+_0x2ee628[_0x324b('0x1e')],_0x30fab4;if(_0x38a03f>=_0x209104){_0x38a03f=_0x209104;_0x30fab4=0xc8;}else{_0x30fab4=0xce;}_0x75251d[_0x324b('0x1f')](_0x30fab4);return _0x75251d['set']('Content-Range',_0x2def86+'-'+_0x38a03f+'/'+_0x209104)[_0x324b('0x1b')](_0x1f797c);}return null;};}function patchUpdates(_0x55f14e){return function(_0xb34f7){try{jsonpatch['apply'](_0xb34f7,_0x55f14e,!![]);}catch(_0x1fb9ed){return BPromise['reject'](_0x1fb9ed);}return _0xb34f7[_0x324b('0x20')]();};}function saveUpdates(_0x397cd3,_0x30091d){return function(_0x534392){if(_0x534392){return _0x534392[_0x324b('0x21')](_0x397cd3)[_0x324b('0x22')](function(_0x2eca97){return _0x2eca97;});}return null;};}function removeEntity(_0x5e27cd,_0x4ad982){return function(_0x1427df){if(_0x1427df){return _0x1427df['destroy']()[_0x324b('0x22')](function(){var _0x4390da=_0x1427df['get']({'plain':!![]});var _0x44798='CustomDashboards';return db[_0x324b('0x23')][_0x324b('0x24')]({'where':{'type':_0x44798,'resourceId':_0x4390da['id']}})[_0x324b('0x22')](function(){return _0x1427df;});})[_0x324b('0x22')](function(){_0x5e27cd[_0x324b('0x1f')](0xcc)[_0x324b('0x1a')]();});}};}function handleEntityNotFound(_0x46f79a,_0x48bb79){return function(_0x1b7587){if(!_0x1b7587){_0x46f79a[_0x324b('0x19')](0x194);}return _0x1b7587;};}function handleError(_0x2be143,_0x3656d0){_0x3656d0=_0x3656d0||0x1f4;return function(_0x4f550e){logger[_0x324b('0x25')](_0x4f550e[_0x324b('0x26')]);if(_0x4f550e['name']){delete _0x4f550e[_0x324b('0x27')];}_0x2be143['status'](_0x3656d0)['send'](_0x4f550e);};}exports[_0x324b('0x28')]=function(_0xfbe94d,_0x1b3dad){var _0x41f577={},_0x5406ae={},_0x37bdba={'count':0x0,'rows':[]};var _0x40d7cc=_[_0x324b('0x29')](db[_0x324b('0x2a')][_0x324b('0x2b')],function(_0x38092b){return{'name':_0x38092b[_0x324b('0x2c')],'type':_0x38092b[_0x324b('0x2d')]['key']};});_0x5406ae[_0x324b('0x2e')]=_['map'](_0x40d7cc,_0x324b('0x27'));_0x5406ae[_0x324b('0x2f')]=_[_0x324b('0x30')](_0xfbe94d[_0x324b('0x2f')]);_0x5406ae[_0x324b('0x31')]=_[_0x324b('0x32')](_0x5406ae['model'],_0x5406ae['query']);_0x41f577[_0x324b('0x33')]=_[_0x324b('0x32')](_0x5406ae[_0x324b('0x2e')],qs[_0x324b('0x34')](_0xfbe94d[_0x324b('0x2f')][_0x324b('0x34')]));_0x41f577['attributes']=_0x41f577[_0x324b('0x33')][_0x324b('0x35')]?_0x41f577[_0x324b('0x33')]:_0x5406ae[_0x324b('0x2e')];if(!_0xfbe94d[_0x324b('0x2f')][_0x324b('0x36')](_0x324b('0x37'))){_0x41f577[_0x324b('0x1e')]=qs[_0x324b('0x1e')](_0xfbe94d[_0x324b('0x2f')][_0x324b('0x1e')]);_0x41f577[_0x324b('0x1d')]=qs['offset'](_0xfbe94d[_0x324b('0x2f')]['offset']);}_0x41f577[_0x324b('0x38')]=qs[_0x324b('0x39')](_0xfbe94d['query'][_0x324b('0x39')]);_0x41f577['where']=qs[_0x324b('0x31')](_['pick'](_0xfbe94d[_0x324b('0x2f')],_0x5406ae[_0x324b('0x31')]));if(_0xfbe94d['query'][_0x324b('0x3a')]){_0x41f577[_0x324b('0x3b')]=_['merge'](_0x41f577['where'],{'$or':_['map'](_0x40d7cc,function(_0x26d1a9){if(_0x26d1a9['type']!==_0x324b('0x3c')){var _0x1d43c0={};_0x1d43c0[_0x26d1a9[_0x324b('0x27')]]={'$like':'%'+_0xfbe94d[_0x324b('0x2f')][_0x324b('0x3a')]+'%'};return _0x1d43c0;}})});}_0x41f577=_['merge']({},_0x41f577,_0xfbe94d[_0x324b('0x3d')]);var _0x1071c4={'where':_0x41f577[_0x324b('0x3b')]};return db['Dashboard'][_0x324b('0x1c')](_0x1071c4)[_0x324b('0x22')](function(_0x1caf9b){_0x37bdba[_0x324b('0x1c')]=_0x1caf9b;if(_0xfbe94d[_0x324b('0x2f')][_0x324b('0x3e')]){_0x41f577[_0x324b('0x3f')]=[{'all':!![]}];}return db[_0x324b('0x2a')]['findAll'](_0x41f577);})[_0x324b('0x22')](function(_0x3bccb2){_0x37bdba['rows']=_0x3bccb2;return _0x37bdba;})[_0x324b('0x22')](respondWithFilteredResult(_0x1b3dad,_0x41f577))[_0x324b('0x40')](handleError(_0x1b3dad,null));};exports['show']=function(_0x35dfaf,_0x4a7767){var _0x1f797a={'raw':![],'where':{'id':_0x35dfaf[_0x324b('0x41')]['id']}},_0x2c9a98={};_0x2c9a98[_0x324b('0x2e')]=_[_0x324b('0x30')](db[_0x324b('0x2a')][_0x324b('0x2b')]);_0x2c9a98[_0x324b('0x2f')]=_['keys'](_0x35dfaf[_0x324b('0x2f')]);_0x2c9a98['filters']=_[_0x324b('0x32')](_0x2c9a98['model'],_0x2c9a98[_0x324b('0x2f')]);_0x1f797a[_0x324b('0x33')]=_['intersection'](_0x2c9a98[_0x324b('0x2e')],qs['fields'](_0x35dfaf['query'][_0x324b('0x34')]));_0x1f797a[_0x324b('0x33')]=_0x1f797a[_0x324b('0x33')][_0x324b('0x35')]?_0x1f797a[_0x324b('0x33')]:_0x2c9a98[_0x324b('0x2e')];if(_0x35dfaf[_0x324b('0x2f')][_0x324b('0x3e')]){_0x1f797a[_0x324b('0x3f')]=[{'all':!![]}];}_0x1f797a=_[_0x324b('0x42')]({},_0x1f797a,_0x35dfaf[_0x324b('0x3d')]);return db[_0x324b('0x2a')][_0x324b('0x43')](_0x1f797a)['then'](handleEntityNotFound(_0x4a7767,null))[_0x324b('0x22')](respondWithResult(_0x4a7767,null))['catch'](handleError(_0x4a7767,null));};exports[_0x324b('0x44')]=function(_0xc0db5c,_0x5556f5){return db[_0x324b('0x2a')]['create'](_0xc0db5c['body'],{})['then'](function(_0x26eb97){var _0x34710a=_0xc0db5c['user'][_0x324b('0x45')]({'plain':!![]});if(!_0x34710a)throw new Error(_0x324b('0x46'));if(_0x34710a[_0x324b('0x47')]===_0x324b('0x48')){var _0x17023b=_0x26eb97[_0x324b('0x45')]({'plain':!![]});var _0x38a735=_0x324b('0x49');return db[_0x324b('0x4a')][_0x324b('0x43')]({'where':{'name':_0x38a735,'userProfileId':_0x34710a['userProfileId']},'raw':!![]})[_0x324b('0x22')](function(_0x238c20){if(_0x238c20&&_0x238c20[_0x324b('0x4b')]===0x0){return db[_0x324b('0x23')][_0x324b('0x44')]({'name':_0x17023b['name'],'resourceId':_0x17023b['id'],'type':_0x238c20['name'],'sectionId':_0x238c20['id']},{})[_0x324b('0x22')](function(){return _0x26eb97;});}else{return _0x26eb97;}})[_0x324b('0x40')](function(_0x23e8af){logger[_0x324b('0x25')](_0x324b('0x4c'),_0x23e8af);throw _0x23e8af;});}return _0x26eb97;})['then'](respondWithResult(_0x5556f5,0xc9))[_0x324b('0x40')](handleError(_0x5556f5,null));};exports[_0x324b('0x4d')]=function(_0x4704b6,_0x1743f5){var _0x4d8ceb={'where':{'id':_0x4704b6[_0x324b('0x41')]['id']}},_0x54bc67={};_0x54bc67[_0x324b('0x2e')]=_[_0x324b('0x30')](db['Dashboard'][_0x324b('0x2b')]);_0x4d8ceb[_0x324b('0x33')]=_['intersection'](_0x54bc67['model'],qs['fields'](_0x4704b6[_0x324b('0x2f')][_0x324b('0x34')]));_0x4d8ceb[_0x324b('0x33')]=_0x4d8ceb[_0x324b('0x33')]['length']?_0x4d8ceb['attributes']:_0x54bc67['model'];if(_0x4704b6[_0x324b('0x2f')][_0x324b('0x3e')]){_0x4d8ceb['include']=[{'all':!![]}];}_0x4d8ceb=_[_0x324b('0x42')]({},_0x4d8ceb,_0x4704b6['options']);return db['Dashboard'][_0x324b('0x43')](_0x4d8ceb)[_0x324b('0x22')](handleEntityNotFound(_0x1743f5,null))['then'](function(_0x365ebc){if(_0x365ebc){var _0x543ed1=_0x365ebc['get']({'plain':!![]});_0x543ed1=qs['omit'](_0x543ed1,['id',_0x324b('0x4e'),_0x324b('0x4f')]);_0x4704b6[_0x324b('0x50')]=_[_0x324b('0x51')](_0x4704b6[_0x324b('0x50')],['id',_0x324b('0x4e'),'updatedAt']);return db['Dashboard'][_0x324b('0x44')](_[_0x324b('0x42')](_0x543ed1,_0x4704b6[_0x324b('0x50')]),{'include':_0x4704b6['query']['includeAll']?[{'all':!![]}]:undefined})['then'](function(_0x2607c6){var _0x189b38=_0x4704b6[_0x324b('0x48')]['get']({'plain':!![]});if(!_0x189b38)throw new Error(_0x324b('0x46'));if(_0x189b38[_0x324b('0x47')]===_0x324b('0x48')){var _0x2e02d3=_0x2607c6['get']({'plain':!![]});var _0x5d57c6=_0x324b('0x49');return db['UserProfileSection'][_0x324b('0x43')]({'where':{'name':_0x5d57c6,'userProfileId':_0x189b38[_0x324b('0x52')]},'raw':!![]})[_0x324b('0x22')](function(_0xed9741){if(_0xed9741&&_0xed9741[_0x324b('0x4b')]===0x0){return db[_0x324b('0x23')]['create']({'name':_0x2e02d3[_0x324b('0x27')],'resourceId':_0x2e02d3['id'],'type':_0xed9741['name'],'sectionId':_0xed9741['id']},{})['then'](function(){return _0x2607c6;});}else{return _0x2607c6;}})[_0x324b('0x40')](function(_0x9348c7){logger['error'](_0x324b('0x4c'),_0x9348c7);throw _0x9348c7;});}return _0x2607c6;});}})[_0x324b('0x22')](respondWithResult(_0x1743f5,0xc9))[_0x324b('0x40')](handleError(_0x1743f5,null));};exports[_0x324b('0x21')]=function(_0xbd53ab,_0x2ef5fe){if(_0xbd53ab['body']['id']){delete _0xbd53ab[_0x324b('0x50')]['id'];}return db[_0x324b('0x2a')][_0x324b('0x43')]({'where':{'id':_0xbd53ab[_0x324b('0x41')]['id']}})[_0x324b('0x22')](handleEntityNotFound(_0x2ef5fe,null))[_0x324b('0x22')](saveUpdates(_0xbd53ab['body'],null))[_0x324b('0x22')](respondWithResult(_0x2ef5fe,null))[_0x324b('0x40')](handleError(_0x2ef5fe,null));};exports[_0x324b('0x24')]=function(_0x13d571,_0x2fc239){return db[_0x324b('0x2a')][_0x324b('0x43')]({'where':{'id':_0x13d571[_0x324b('0x41')]['id']}})[_0x324b('0x22')](handleEntityNotFound(_0x2fc239,null))[_0x324b('0x22')](removeEntity(_0x2fc239,null))[_0x324b('0x40')](handleError(_0x2fc239,null));};function widgetAttributes(_0x2cce0f){try{switch(_0x2cce0f[_0x324b('0x2d')]){case _0x324b('0x53'):return[{'name':_0x324b('0x54'),'value':_0x2cce0f['attrUrl']||(_0x2cce0f[_0x324b('0x55')]&&_0x2cce0f[_0x324b('0x55')][0x0]?_0x2cce0f['attrs'][0x0]['value']:undefined)||'https://'}];case _0x324b('0x56'):return[{'name':'attrPath','value':_0x2cce0f['attrPath']||(_0x2cce0f[_0x324b('0x55')]&&_0x2cce0f[_0x324b('0x55')][0x0]?_0x2cce0f[_0x324b('0x55')][0x0][_0x324b('0x57')]:undefined)||''}];case _0x324b('0x58'):return[{'name':_0x324b('0x59'),'value':_0x2cce0f[_0x324b('0x59')]||(_0x2cce0f['attrs']&&_0x2cce0f['attrs'][0x0]?_0x2cce0f[_0x324b('0x55')][0x0][_0x324b('0x57')]:undefined)||_0x324b('0x5a')},{'name':'attrTimezone','value':_0x2cce0f[_0x324b('0x5b')]||(_0x2cce0f[_0x324b('0x55')]&&_0x2cce0f[_0x324b('0x55')][0x1]?_0x2cce0f[_0x324b('0x55')][0x1][_0x324b('0x57')]:undefined)||_0x324b('0x5c')},{'name':_0x324b('0x5d'),'value':_0x2cce0f[_0x324b('0x5d')]||(_0x2cce0f[_0x324b('0x55')]&&_0x2cce0f[_0x324b('0x55')][0x2]?_0x2cce0f['attrs'][0x2][_0x324b('0x57')]:undefined)||0xc}];case _0x324b('0x5e'):return[{'name':_0x324b('0x5f'),'value':_0x2cce0f[_0x324b('0x5f')]||(_0x2cce0f[_0x324b('0x55')]&&_0x2cce0f[_0x324b('0x55')][0x0]?_0x2cce0f['attrs'][0x0][_0x324b('0x57')]:undefined)||'total'},{'name':_0x324b('0x60'),'value':_0x2cce0f[_0x324b('0x60')]||(_0x2cce0f[_0x324b('0x55')]&&_0x2cce0f['attrs'][0x1]?_0x2cce0f[_0x324b('0x55')][0x1][_0x324b('0x57')]:undefined)||[]},{'name':'attrFontSize','value':_0x2cce0f[_0x324b('0x5d')]||(_0x2cce0f[_0x324b('0x55')]&&_0x2cce0f['attrs'][0x2]?_0x2cce0f[_0x324b('0x55')][0x2][_0x324b('0x57')]:undefined)||0x14}];case _0x324b('0x61'):case _0x324b('0x62'):return[{'name':_0x324b('0x63'),'value':_0x2cce0f['attrSerie1']||(_0x2cce0f[_0x324b('0x55')]&&_0x2cce0f['attrs'][0x0]?_0x2cce0f[_0x324b('0x55')][0x0][_0x324b('0x57')]:undefined)||_0x324b('0x64')},{'name':_0x324b('0x65'),'value':_0x2cce0f[_0x324b('0x65')]||(_0x2cce0f[_0x324b('0x55')]&&_0x2cce0f[_0x324b('0x55')][0x1]?_0x2cce0f[_0x324b('0x55')][0x1]['value']:undefined)||null},{'name':'attrSerie3','value':_0x2cce0f[_0x324b('0x66')]||(_0x2cce0f[_0x324b('0x55')]&&_0x2cce0f[_0x324b('0x55')][0x2]?_0x2cce0f['attrs'][0x2][_0x324b('0x57')]:undefined)||null},{'name':_0x324b('0x60'),'value':_0x2cce0f[_0x324b('0x60')]||(_0x2cce0f[_0x324b('0x55')]&&_0x2cce0f['attrs'][0x3]?_0x2cce0f['attrs'][0x3][_0x324b('0x57')]:undefined)||[]}];case _0x324b('0x67'):return[{'name':'attrReport','type':_0x2cce0f[_0x324b('0x68')]||(_0x2cce0f[_0x324b('0x55')]&&_0x2cce0f[_0x324b('0x55')][0x0]?_0x2cce0f[_0x324b('0x55')][0x0][_0x324b('0x2d')]:undefined)||null,'value':_0x2cce0f[_0x324b('0x69')]||(_0x2cce0f[_0x324b('0x55')]&&_0x2cce0f[_0x324b('0x55')][0x0]?_0x2cce0f[_0x324b('0x55')][0x0][_0x324b('0x57')]:undefined)||null},{'name':_0x324b('0x6a'),'value':_0x2cce0f[_0x324b('0x6a')]||(_0x2cce0f[_0x324b('0x55')]&&_0x2cce0f[_0x324b('0x55')][0x1]?_0x2cce0f[_0x324b('0x55')][0x1][_0x324b('0x57')]:undefined)||0x0}];default:return[];}}catch(_0x3107b5){logger[_0x324b('0x25')](_0x324b('0x6b'),JSON['stringify'](_0x3107b5));return[];}}exports[_0x324b('0x6c')]=function(_0x5bbd06,_0x5a207d,_0x39cbf0){if(_0x5bbd06[_0x324b('0x50')]['id']){delete _0x5bbd06[_0x324b('0x50')]['id'];}return db[_0x324b('0x2a')]['find']({'where':{'id':_0x5bbd06[_0x324b('0x41')]['id']}})['then'](handleEntityNotFound(_0x5a207d,null))['then'](function(_0x1fc94b){if(_0x1fc94b){_0x5bbd06['body'][_0x324b('0x6d')]=_0x1fc94b['id'];_0x5bbd06['body']['attrs']=widgetAttributes(_0x5bbd06['body']);return db[_0x324b('0x6e')]['create'](_0x5bbd06[_0x324b('0x50')]);}})['then'](respondWithResult(_0x5a207d,null))[_0x324b('0x40')](handleError(_0x5a207d,null));};exports[_0x324b('0x6f')]=function(_0x12cb18,_0x507860,_0x1dcc53){var _0x2def44={};var _0x139393={};var _0x5e38ad;var _0x1a3c4a;return db['Dashboard'][_0x324b('0x70')]({'where':{'id':_0x12cb18[_0x324b('0x41')]['id']}})['then'](handleEntityNotFound(_0x507860,null))[_0x324b('0x22')](function(_0x2e2c6e){if(_0x2e2c6e){_0x5e38ad=_0x2e2c6e;_0x139393[_0x324b('0x2e')]=_['keys'](db['DashboardItem'][_0x324b('0x2b')]);_0x139393[_0x324b('0x2f')]=_[_0x324b('0x30')](_0x12cb18[_0x324b('0x2f')]);_0x139393[_0x324b('0x31')]=_[_0x324b('0x32')](_0x139393['model'],_0x139393[_0x324b('0x2f')]);_0x2def44[_0x324b('0x33')]=_[_0x324b('0x32')](_0x139393[_0x324b('0x2e')],qs[_0x324b('0x34')](_0x12cb18['query']['fields']));_0x2def44[_0x324b('0x33')]=_0x2def44[_0x324b('0x33')]['length']?_0x2def44[_0x324b('0x33')]:_0x139393[_0x324b('0x2e')];_0x2def44[_0x324b('0x38')]=qs[_0x324b('0x39')](_0x12cb18[_0x324b('0x2f')]['sort']);_0x2def44[_0x324b('0x3b')]=qs[_0x324b('0x31')](_['pick'](_0x12cb18[_0x324b('0x2f')],_0x139393[_0x324b('0x31')]));if(_0x12cb18['query'][_0x324b('0x3a')]){_0x2def44[_0x324b('0x3b')]=_['merge'](_0x2def44[_0x324b('0x3b')],{'$or':_['map'](_0x2def44[_0x324b('0x33')],function(_0x4d8a39){var _0x10246a={};_0x10246a[_0x4d8a39]={'$like':'%'+_0x12cb18['query']['filter']+'%'};return _0x10246a;})});}_0x2def44=_[_0x324b('0x42')]({},_0x2def44,_0x12cb18[_0x324b('0x3d')]);return _0x5e38ad[_0x324b('0x6f')](_0x2def44);}})[_0x324b('0x22')](function(_0xe0a34e){if(_0xe0a34e){_0x1a3c4a=_0xe0a34e[_0x324b('0x35')];if(!_0x12cb18[_0x324b('0x2f')][_0x324b('0x36')](_0x324b('0x37'))){_0x2def44[_0x324b('0x1e')]=qs[_0x324b('0x1e')](_0x12cb18[_0x324b('0x2f')]['limit']);_0x2def44[_0x324b('0x1d')]=qs[_0x324b('0x1d')](_0x12cb18[_0x324b('0x2f')][_0x324b('0x1d')]);}return _0x5e38ad[_0x324b('0x6f')](_0x2def44);}})[_0x324b('0x22')](function(_0x5a6f43){if(_0x5a6f43){return _0x5a6f43?{'count':_0x1a3c4a,'rows':_0x5a6f43}:null;}})[_0x324b('0x22')](respondWithResult(_0x507860,null))[_0x324b('0x40')](handleError(_0x507860,null));};
\ No newline at end of file
diff --git a/server/api/dashboard/dashboard.events.js b/server/api/dashboard/dashboard.events.js
index 5461c1e..adc6c04 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 _0x3e10=['save','update','emit','hasOwnProperty','exports','Dashboard','setMaxListeners'];(function(_0x13ba18,_0x39041f){var _0x5e292a=function(_0x4f35da){while(--_0x4f35da){_0x13ba18['push'](_0x13ba18['shift']());}};_0x5e292a(++_0x39041f);}(_0x3e10,0x132));var _0x03e1=function(_0xc39293,_0x30a1cb){_0xc39293=_0xc39293-0x0;var _0xafef32=_0x3e10[_0xc39293];return _0xafef32;};'use strict';var EventEmitter=require('events');var Dashboard=require('../../mysqldb')['db'][_0x03e1('0x0')];var DashboardEvents=new EventEmitter();DashboardEvents[_0x03e1('0x1')](0x0);var events={'afterCreate':_0x03e1('0x2'),'afterUpdate':_0x03e1('0x3'),'afterDestroy':'remove'};function emitEvent(_0x35b3f3){return function(_0x2ad40b,_0x309c3d,_0x3a793c){DashboardEvents[_0x03e1('0x4')](_0x35b3f3+':'+_0x2ad40b['id'],_0x2ad40b);DashboardEvents[_0x03e1('0x4')](_0x35b3f3,_0x2ad40b);_0x3a793c(null);};}for(var e in events){if(events[_0x03e1('0x5')](e)){var event=events[e];Dashboard['hook'](e,emitEvent(event));}}module[_0x03e1('0x6')]=DashboardEvents;
\ No newline at end of file
+var _0x8c24=['events','../../mysqldb','Dashboard','setMaxListeners','save','update','remove','emit','hasOwnProperty','hook','exports'];(function(_0x168020,_0x40485d){var _0x526fe3=function(_0x902832){while(--_0x902832){_0x168020['push'](_0x168020['shift']());}};_0x526fe3(++_0x40485d);}(_0x8c24,0x6e));var _0x48c2=function(_0x3d0958,_0x204a7e){_0x3d0958=_0x3d0958-0x0;var _0x1c77f8=_0x8c24[_0x3d0958];return _0x1c77f8;};'use strict';var EventEmitter=require(_0x48c2('0x0'));var Dashboard=require(_0x48c2('0x1'))['db'][_0x48c2('0x2')];var DashboardEvents=new EventEmitter();DashboardEvents[_0x48c2('0x3')](0x0);var events={'afterCreate':_0x48c2('0x4'),'afterUpdate':_0x48c2('0x5'),'afterDestroy':_0x48c2('0x6')};function emitEvent(_0x502823){return function(_0x3f8bbd,_0x3a02cb,_0x22eb2d){DashboardEvents[_0x48c2('0x7')](_0x502823+':'+_0x3f8bbd['id'],_0x3f8bbd);DashboardEvents['emit'](_0x502823,_0x3f8bbd);_0x22eb2d(null);};}for(var e in events){if(events[_0x48c2('0x8')](e)){var event=events[e];Dashboard[_0x48c2('0x9')](e,emitEvent(event));}}module[_0x48c2('0xa')]=DashboardEvents;
\ No newline at end of file
diff --git a/server/api/dashboard/dashboard.model.js b/server/api/dashboard/dashboard.model.js
index 1c78701..b070d08 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 _0xbb28=['dashboards','lodash','util','../../config/logger','moment','bluebird','path','rimraf','../../config/environment','./dashboard.attributes','exports'];(function(_0x48afa0,_0x2190a1){var _0x117597=function(_0x52c536){while(--_0x52c536){_0x48afa0['push'](_0x48afa0['shift']());}};_0x117597(++_0x2190a1);}(_0xbb28,0x140));var _0x8bb2=function(_0x39a390,_0x4b07f1){_0x39a390=_0x39a390-0x0;var _0x525f7d=_0xbb28[_0x39a390];return _0x525f7d;};'use strict';var _=require(_0x8bb2('0x0'));var util=require(_0x8bb2('0x1'));var logger=require(_0x8bb2('0x2'))('api');var moment=require(_0x8bb2('0x3'));var BPromise=require(_0x8bb2('0x4'));var rp=require('request-promise');var fs=require('fs');var path=require(_0x8bb2('0x5'));var rimraf=require(_0x8bb2('0x6'));var config=require(_0x8bb2('0x7'));var attributes=require(_0x8bb2('0x8'));module[_0x8bb2('0x9')]=function(_0x503712,_0x1025e6){return _0x503712['define']('Dashboard',attributes,{'tableName':_0x8bb2('0xa'),'paranoid':![],'indexes':[],'timestamps':!![]});};
\ No newline at end of file
+var _0xf5dd=['define','Dashboard','lodash','../../config/logger','moment','request-promise','path','../../config/environment','exports'];(function(_0x321bb2,_0x202794){var _0x9c12ed=function(_0x263dd3){while(--_0x263dd3){_0x321bb2['push'](_0x321bb2['shift']());}};_0x9c12ed(++_0x202794);}(_0xf5dd,0x6e));var _0xdf5d=function(_0x57b54c,_0x54ce0d){_0x57b54c=_0x57b54c-0x0;var _0x59cc19=_0xf5dd[_0x57b54c];return _0x59cc19;};'use strict';var _=require(_0xdf5d('0x0'));var util=require('util');var logger=require(_0xdf5d('0x1'))('api');var moment=require(_0xdf5d('0x2'));var BPromise=require('bluebird');var rp=require(_0xdf5d('0x3'));var fs=require('fs');var path=require(_0xdf5d('0x4'));var rimraf=require('rimraf');var config=require(_0xdf5d('0x5'));var attributes=require('./dashboard.attributes');module[_0xdf5d('0x6')]=function(_0x5a74fa,_0x30e561){return _0x5a74fa[_0xdf5d('0x7')](_0xdf5d('0x8'),attributes,{'tableName':'dashboards','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 8aff125..9abbd37 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 _0x1375=['socket.io-emitter','./dashboard.socket','then','Dashboard,\x20%s,\x20%s','debug','Dashboard,\x20%s,\x20%s,\x20%s','stringify','error','code','message','info','request\x20sent','catch','lodash','util','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','jayson/promise','client','http','redis','localhost'];(function(_0x5aa3e9,_0x401e7d){var _0x4f1278=function(_0x4a38cc){while(--_0x4a38cc){_0x5aa3e9['push'](_0x5aa3e9['shift']());}};_0x4f1278(++_0x401e7d);}(_0x1375,0xed));var _0x5137=function(_0x25c64b,_0x11623b){_0x25c64b=_0x25c64b-0x0;var _0x4f89fd=_0x1375[_0x25c64b];return _0x4f89fd;};'use strict';var _=require(_0x5137('0x0'));var util=require(_0x5137('0x1'));var moment=require(_0x5137('0x2'));var BPromise=require(_0x5137('0x3'));var rs=require(_0x5137('0x4'));var fs=require('fs');var Redis=require(_0x5137('0x5'));var db=require(_0x5137('0x6'))['db'];var utils=require(_0x5137('0x7'));var logger=require(_0x5137('0x8'))(_0x5137('0x9'));var config=require('../../config/environment');var jayson=require(_0x5137('0xa'));var client=jayson[_0x5137('0xb')][_0x5137('0xc')]({'port':0x232a});config['redis']=_['defaults'](config[_0x5137('0xd')],{'host':_0x5137('0xe'),'port':0x18eb});var socket=require(_0x5137('0xf'))(new Redis(config['redis']));require(_0x5137('0x10'))['register'](socket);function respondWithRpcPromise(_0xb2df0c,_0x3f1832,_0x2a90f4){return new BPromise(function(_0x23677f,_0x4c1f15){return client['request'](_0xb2df0c,_0x2a90f4)[_0x5137('0x11')](function(_0x376883){logger['info'](_0x5137('0x12'),_0x3f1832,'request\x20sent');logger[_0x5137('0x13')](_0x5137('0x14'),_0x3f1832,'request\x20sent',JSON[_0x5137('0x15')](_0x376883));if(_0x376883[_0x5137('0x16')]){if(_0x376883[_0x5137('0x16')][_0x5137('0x17')]===0x1f4){logger['error'](_0x5137('0x12'),_0x3f1832,_0x376883[_0x5137('0x16')][_0x5137('0x18')]);return _0x4c1f15(_0x376883[_0x5137('0x16')][_0x5137('0x18')]);}logger[_0x5137('0x16')]('Dashboard,\x20%s,\x20%s',_0x3f1832,_0x376883[_0x5137('0x16')][_0x5137('0x18')]);return _0x23677f(_0x376883[_0x5137('0x16')][_0x5137('0x18')]);}else{logger[_0x5137('0x19')](_0x5137('0x12'),_0x3f1832,_0x5137('0x1a'));_0x23677f(_0x376883['result'][_0x5137('0x18')]);}})[_0x5137('0x1b')](function(_0x33c3c0){logger[_0x5137('0x16')](_0x5137('0x12'),_0x3f1832,_0x33c3c0);_0x4c1f15(_0x33c3c0);});});}
\ No newline at end of file
+var _0xe42e=['Dashboard,\x20%s,\x20%s','catch','lodash','util','bluebird','randomstring','ioredis','../../mysqldb','../../config/logger','rpc','jayson/promise','http','redis','defaults','localhost','socket.io-emitter','./dashboard.socket','register','request','then','info','request\x20sent','debug','stringify','error','code','message'];(function(_0x33a6f0,_0x294c6b){var _0x375685=function(_0x59d065){while(--_0x59d065){_0x33a6f0['push'](_0x33a6f0['shift']());}};_0x375685(++_0x294c6b);}(_0xe42e,0xbf));var _0xee42=function(_0xf66bf1,_0x53825e){_0xf66bf1=_0xf66bf1-0x0;var _0x402ca6=_0xe42e[_0xf66bf1];return _0x402ca6;};'use strict';var _=require(_0xee42('0x0'));var util=require(_0xee42('0x1'));var moment=require('moment');var BPromise=require(_0xee42('0x2'));var rs=require(_0xee42('0x3'));var fs=require('fs');var Redis=require(_0xee42('0x4'));var db=require(_0xee42('0x5'))['db'];var utils=require('../../config/utils');var logger=require(_0xee42('0x6'))(_0xee42('0x7'));var config=require('../../config/environment');var jayson=require(_0xee42('0x8'));var client=jayson['client'][_0xee42('0x9')]({'port':0x232a});config[_0xee42('0xa')]=_[_0xee42('0xb')](config[_0xee42('0xa')],{'host':_0xee42('0xc'),'port':0x18eb});var socket=require(_0xee42('0xd'))(new Redis(config[_0xee42('0xa')]));require(_0xee42('0xe'))[_0xee42('0xf')](socket);function respondWithRpcPromise(_0x139f91,_0x5ed709,_0x68aa18){return new BPromise(function(_0x43de14,_0x2ba2bd){return client[_0xee42('0x10')](_0x139f91,_0x68aa18)[_0xee42('0x11')](function(_0x926751){logger[_0xee42('0x12')]('Dashboard,\x20%s,\x20%s',_0x5ed709,_0xee42('0x13'));logger[_0xee42('0x14')]('Dashboard,\x20%s,\x20%s,\x20%s',_0x5ed709,_0xee42('0x13'),JSON[_0xee42('0x15')](_0x926751));if(_0x926751[_0xee42('0x16')]){if(_0x926751[_0xee42('0x16')][_0xee42('0x17')]===0x1f4){logger['error']('Dashboard,\x20%s,\x20%s',_0x5ed709,_0x926751[_0xee42('0x16')]['message']);return _0x2ba2bd(_0x926751['error'][_0xee42('0x18')]);}logger[_0xee42('0x16')](_0xee42('0x19'),_0x5ed709,_0x926751[_0xee42('0x16')]['message']);return _0x43de14(_0x926751[_0xee42('0x16')]['message']);}else{logger[_0xee42('0x12')](_0xee42('0x19'),_0x5ed709,_0xee42('0x13'));_0x43de14(_0x926751['result'][_0xee42('0x18')]);}})[_0xee42('0x1a')](function(_0x288274){logger[_0xee42('0x16')](_0xee42('0x19'),_0x5ed709,_0x288274);_0x2ba2bd(_0x288274);});});}
\ No newline at end of file
diff --git a/server/api/dashboard/dashboard.socket.js b/server/api/dashboard/dashboard.socket.js
index eff29d9..94811dd 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 _0xa6e8=['removeListener','register','length','dashboard:','./dashboard.events','save','remove','update','emit'];(function(_0x4c3ece,_0x57053e){var _0x409c1d=function(_0x411a3b){while(--_0x411a3b){_0x4c3ece['push'](_0x4c3ece['shift']());}};_0x409c1d(++_0x57053e);}(_0xa6e8,0x16c));var _0x8a6e=function(_0x2794db,_0x13dc42){_0x2794db=_0x2794db-0x0;var _0x58093e=_0xa6e8[_0x2794db];return _0x58093e;};'use strict';var DashboardEvents=require(_0x8a6e('0x0'));var events=[_0x8a6e('0x1'),_0x8a6e('0x2'),_0x8a6e('0x3')];function createListener(_0x39a586,_0x259a94){return function(_0x503841){_0x259a94[_0x8a6e('0x4')](_0x39a586,_0x503841);};}function removeListener(_0x5d0079,_0x36d61e){return function(){DashboardEvents[_0x8a6e('0x5')](_0x5d0079,_0x36d61e);};}exports[_0x8a6e('0x6')]=function(_0x5d8ca6){for(var _0x549ee7=0x0,_0x57fd83=events[_0x8a6e('0x7')];_0x549ee7<_0x57fd83;_0x549ee7++){var _0x1da200=events[_0x549ee7];var _0x2e1e74=createListener(_0x8a6e('0x8')+_0x1da200,_0x5d8ca6);DashboardEvents['on'](_0x1da200,_0x2e1e74);}};
\ No newline at end of file
+var _0xc13b=['remove','emit','register','save'];(function(_0x1a595a,_0x263824){var _0x33f008=function(_0x1e2f9c){while(--_0x1e2f9c){_0x1a595a['push'](_0x1a595a['shift']());}};_0x33f008(++_0x263824);}(_0xc13b,0xf7));var _0xbc13=function(_0x5bd426,_0x4878e5){_0x5bd426=_0x5bd426-0x0;var _0x23a7eb=_0xc13b[_0x5bd426];return _0x23a7eb;};'use strict';var DashboardEvents=require('./dashboard.events');var events=[_0xbc13('0x0'),_0xbc13('0x1'),'update'];function createListener(_0x358f5b,_0x245686){return function(_0xf46ca7){_0x245686[_0xbc13('0x2')](_0x358f5b,_0xf46ca7);};}function removeListener(_0x5e26b9,_0x539220){return function(){DashboardEvents['removeListener'](_0x5e26b9,_0x539220);};}exports[_0xbc13('0x3')]=function(_0x59f70f){for(var _0x920b29=0x0,_0x4e01bd=events['length'];_0x920b29<_0x4e01bd;_0x920b29++){var _0x41a577=events[_0x920b29];var _0x2ce84e=createListener('dashboard:'+_0x41a577,_0x59f70f);DashboardEvents['on'](_0x41a577,_0x2ce84e);}};
\ No newline at end of file
diff --git a/server/api/dashboard/index.js b/server/api/dashboard/index.js
index 8a99e62..62d7ad1 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 _0xd8b0=['../../components/auth/service','../../components/interaction/service','../../config/environment','./dashboard.controller','index','get','/:id','show','isAuthenticated','getItems','post','create','/:id/clone','addItem','put','update','delete','destroy','exports','multer','util','Router'];(function(_0xf973b7,_0x46699f){var _0x499087=function(_0x45b42f){while(--_0x45b42f){_0xf973b7['push'](_0xf973b7['shift']());}};_0x499087(++_0x46699f);}(_0xd8b0,0xad));var _0x0d8b=function(_0x20a584,_0xe384a5){_0x20a584=_0x20a584-0x0;var _0x4b41a8=_0xd8b0[_0x20a584];return _0x4b41a8;};'use strict';var multer=require(_0x0d8b('0x0'));var util=require(_0x0d8b('0x1'));var path=require('path');var timeout=require('connect-timeout');var express=require('express');var router=express[_0x0d8b('0x2')]();var auth=require(_0x0d8b('0x3'));var interaction=require(_0x0d8b('0x4'));var config=require(_0x0d8b('0x5'));var controller=require(_0x0d8b('0x6'));router['get']('/',auth['isAuthenticated'](),controller[_0x0d8b('0x7')]);router[_0x0d8b('0x8')](_0x0d8b('0x9'),auth['isAuthenticated'](),controller[_0x0d8b('0xa')]);router[_0x0d8b('0x8')]('/:id/items',auth[_0x0d8b('0xb')](),controller[_0x0d8b('0xc')]);router[_0x0d8b('0xd')]('/',auth[_0x0d8b('0xb')](),controller[_0x0d8b('0xe')]);router[_0x0d8b('0xd')](_0x0d8b('0xf'),auth[_0x0d8b('0xb')](),controller['clone']);router[_0x0d8b('0xd')]('/:id/items',auth[_0x0d8b('0xb')](),controller[_0x0d8b('0x10')]);router[_0x0d8b('0x11')](_0x0d8b('0x9'),auth[_0x0d8b('0xb')](),controller[_0x0d8b('0x12')]);router[_0x0d8b('0x13')](_0x0d8b('0x9'),auth[_0x0d8b('0xb')](),controller[_0x0d8b('0x14')]);module[_0x0d8b('0x15')]=router;
\ No newline at end of file
+var _0xe706=['../../components/auth/service','../../components/interaction/service','../../config/environment','./dashboard.controller','get','isAuthenticated','index','/:id','show','/:id/items','getItems','post','create','/:id/clone','clone','addItem','put','update','delete','multer','util','path','express','Router'];(function(_0x118733,_0x2bd820){var _0x4777af=function(_0x52886a){while(--_0x52886a){_0x118733['push'](_0x118733['shift']());}};_0x4777af(++_0x2bd820);}(_0xe706,0xa3));var _0x6e70=function(_0x1d1d09,_0x504d77){_0x1d1d09=_0x1d1d09-0x0;var _0x8827e=_0xe706[_0x1d1d09];return _0x8827e;};'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('0x10')]('/',auth[_0x6e70('0xa')](),controller[_0x6e70('0x11')]);router[_0x6e70('0x10')](_0x6e70('0x12'),auth[_0x6e70('0xa')](),controller[_0x6e70('0x13')]);router['post']('/:id/items',auth[_0x6e70('0xa')](),controller[_0x6e70('0x14')]);router[_0x6e70('0x15')](_0x6e70('0xc'),auth[_0x6e70('0xa')](),controller[_0x6e70('0x16')]);router[_0x6e70('0x17')](_0x6e70('0xc'),auth['isAuthenticated'](),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 6e4d2ae..46affee 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 _0xdfd3=['attrs','stringify','setDataValue','INTEGER','STRING','#2196f3','sequelize','lodash','exports','TEXT','long'];(function(_0x346e6b,_0x1f4479){var _0x15f973=function(_0x576d2e){while(--_0x576d2e){_0x346e6b['push'](_0x346e6b['shift']());}};_0x15f973(++_0x1f4479);}(_0xdfd3,0x13a));var _0x3dfd=function(_0x522453,_0x3f05a3){_0x522453=_0x522453-0x0;var _0x1f9be5=_0xdfd3[_0x522453];return _0x1f9be5;};'use strict';var Sequelize=require(_0x3dfd('0x0'));var squel=require('squel');var _=require(_0x3dfd('0x1'));module[_0x3dfd('0x2')]={'title':{'type':Sequelize['STRING'],'allowNull':![]},'type':{'type':Sequelize['STRING'](0x14),'allowNull':![],'validate':{'len':[0x1,0x14]}},'attrs':{'type':Sequelize[_0x3dfd('0x3')](_0x3dfd('0x4')),'get':function(){try{return JSON['parse'](this['getDataValue'](_0x3dfd('0x5')));}catch(_0x5a3470){return[];}},'set':function(_0x459daa){try{this['setDataValue']('attrs',JSON[_0x3dfd('0x6')](_0x459daa));}catch(_0x2f4d27){this[_0x3dfd('0x7')](_0x3dfd('0x5'),JSON[_0x3dfd('0x6')]([]));}}},'sizeX':{'type':Sequelize['INTEGER'],'allowNull':![],'defaultValue':0x1},'sizeY':{'type':Sequelize['INTEGER'],'allowNull':![],'defaultValue':0x1},'row':{'type':Sequelize[_0x3dfd('0x8')]},'col':{'type':Sequelize[_0x3dfd('0x8')]},'background':{'type':Sequelize[_0x3dfd('0x9')],'allowNull':![],'defaultValue':'#ffffff','validate':{'notEmpty':!![]}},'foreground':{'type':Sequelize['STRING'],'allowNull':![],'defaultValue':_0x3dfd('0xa'),'validate':{'notEmpty':!![]}},'link':{'type':Sequelize[_0x3dfd('0x9')]}};
\ No newline at end of file
+var _0x95bb=['sequelize','squel','lodash','exports','STRING','TEXT','long','parse','getDataValue','attrs','stringify','setDataValue','INTEGER','#ffffff','#2196f3'];(function(_0x3e73f6,_0x4f7f01){var _0x5af991=function(_0x186e5a){while(--_0x186e5a){_0x3e73f6['push'](_0x3e73f6['shift']());}};_0x5af991(++_0x4f7f01);}(_0x95bb,0x78));var _0xb95b=function(_0xc5c1e3,_0x24b696){_0xc5c1e3=_0xc5c1e3-0x0;var _0x479ce9=_0x95bb[_0xc5c1e3];return _0x479ce9;};'use strict';var Sequelize=require(_0xb95b('0x0'));var squel=require(_0xb95b('0x1'));var _=require(_0xb95b('0x2'));module[_0xb95b('0x3')]={'title':{'type':Sequelize[_0xb95b('0x4')],'allowNull':![]},'type':{'type':Sequelize[_0xb95b('0x4')](0x14),'allowNull':![],'validate':{'len':[0x1,0x14]}},'attrs':{'type':Sequelize[_0xb95b('0x5')](_0xb95b('0x6')),'get':function(){try{return JSON[_0xb95b('0x7')](this[_0xb95b('0x8')]('attrs'));}catch(_0x222ddf){return[];}},'set':function(_0x13637f){try{this['setDataValue'](_0xb95b('0x9'),JSON[_0xb95b('0xa')](_0x13637f));}catch(_0x3119f1){this[_0xb95b('0xb')](_0xb95b('0x9'),JSON[_0xb95b('0xa')]([]));}}},'sizeX':{'type':Sequelize[_0xb95b('0xc')],'allowNull':![],'defaultValue':0x1},'sizeY':{'type':Sequelize[_0xb95b('0xc')],'allowNull':![],'defaultValue':0x1},'row':{'type':Sequelize[_0xb95b('0xc')]},'col':{'type':Sequelize['INTEGER']},'background':{'type':Sequelize[_0xb95b('0x4')],'allowNull':![],'defaultValue':_0xb95b('0xd'),'validate':{'notEmpty':!![]}},'foreground':{'type':Sequelize[_0xb95b('0x4')],'allowNull':![],'defaultValue':_0xb95b('0xe'),'validate':{'notEmpty':!![]}},'link':{'type':Sequelize[_0xb95b('0x4')]}};
\ No newline at end of file
diff --git a/server/api/dashboardItem/dashboardItem.controller.js b/server/api/dashboardItem/dashboardItem.controller.js
index 3d3d165..ee82045 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 _0x3e26=['fast-json-patch','bluebird','mustache','util','path','sox','to-csv','ejs','lodash','squel','crypto','desk.js','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/environment','../../mysqldb','redis','localhost','socket.io-emitter','./dashboardItem.socket','register','status','end','count','offset','limit','set','Content-Range','json','apply','reject','save','then','destroy','stack','name','send','show','params','model','keys','DashboardItem','rawAttributes','query','intersection','attributes','fields','length','includeAll','include','merge','options','find','catch','type','iframe','attrUrl','attrs','https://','custom','attrPath','value','clock','attrHourFormat','HH:mm:ss','attrTimezone','0.00','attrFontSize','counter','attrMetric','total','attrVoiceQueues','multibar-chart','attrSerie1','attrSerie2','attrSerie3','attrReport','attrRefresh','error','widgetAttributes:\x20%s','stringify','create','body','update','html-pdf','eml-format','rimraf','zip-dir'];(function(_0x382976,_0x589248){var _0x486a67=function(_0x28f774){while(--_0x28f774){_0x382976['push'](_0x382976['shift']());}};_0x486a67(++_0x589248);}(_0x3e26,0xba));var _0x63e2=function(_0x3f0b0b,_0x200049){_0x3f0b0b=_0x3f0b0b-0x0;var _0x45ef51=_0x3e26[_0x3f0b0b];return _0x45ef51;};'use strict';var pdf=require(_0x63e2('0x0'));var emlformat=require(_0x63e2('0x1'));var rimraf=require(_0x63e2('0x2'));var zipdir=require(_0x63e2('0x3'));var jsonpatch=require(_0x63e2('0x4'));var rp=require('request-promise');var moment=require('moment');var BPromise=require(_0x63e2('0x5'));var Mustache=require(_0x63e2('0x6'));var util=require(_0x63e2('0x7'));var path=require(_0x63e2('0x8'));var sox=require(_0x63e2('0x9'));var csv=require(_0x63e2('0xa'));var ejs=require(_0x63e2('0xb'));var fs=require('fs');var _=require(_0x63e2('0xc'));var squel=require(_0x63e2('0xd'));var crypto=require(_0x63e2('0xe'));var jsforce=require('jsforce');var deskjs=require(_0x63e2('0xf'));var toCsv=require(_0x63e2('0xa'));var querystring=require(_0x63e2('0x10'));var Papa=require(_0x63e2('0x11'));var Redis=require(_0x63e2('0x12'));var authService=require(_0x63e2('0x13'));var qs=require(_0x63e2('0x14'));var as=require('../../components/parsers/advancedSearch');var hardwareService=require(_0x63e2('0x15'));var logger=require(_0x63e2('0x16'))(_0x63e2('0x17'));var utils=require(_0x63e2('0x18'));var config=require(_0x63e2('0x19'));var db=require(_0x63e2('0x1a'))['db'];config[_0x63e2('0x1b')]=_['defaults'](config[_0x63e2('0x1b')],{'host':_0x63e2('0x1c'),'port':0x18eb});var socket=require(_0x63e2('0x1d'))(new Redis(config['redis']));require(_0x63e2('0x1e'))[_0x63e2('0x1f')](socket);function respondWithStatusCode(_0xcf2052,_0x42be69){_0x42be69=_0x42be69||0xcc;return function(_0x1e7294){if(_0x1e7294){return _0xcf2052['sendStatus'](_0x42be69);}return _0xcf2052[_0x63e2('0x20')](_0x42be69)[_0x63e2('0x21')]();};}function respondWithResult(_0x334ecd,_0x3cc08a){_0x3cc08a=_0x3cc08a||0xc8;return function(_0x3ce39a){if(_0x3ce39a){return _0x334ecd[_0x63e2('0x20')](_0x3cc08a)['json'](_0x3ce39a);}};}function respondWithFilteredResult(_0x5ad15f,_0x3fc211){return function(_0x153806){if(_0x153806){var _0x52ca14=_0x153806[_0x63e2('0x22')],_0x105c29=_0x3fc211[_0x63e2('0x23')],_0x1f5b8b=_0x3fc211[_0x63e2('0x23')]+_0x3fc211[_0x63e2('0x24')],_0x2800b6;if(_0x1f5b8b>=_0x52ca14){_0x1f5b8b=_0x52ca14;_0x2800b6=0xc8;}else{_0x2800b6=0xce;}_0x5ad15f[_0x63e2('0x20')](_0x2800b6);return _0x5ad15f[_0x63e2('0x25')](_0x63e2('0x26'),_0x105c29+'-'+_0x1f5b8b+'/'+_0x52ca14)[_0x63e2('0x27')](_0x153806);}return null;};}function patchUpdates(_0x36acad){return function(_0x3adc16){try{jsonpatch[_0x63e2('0x28')](_0x3adc16,_0x36acad,!![]);}catch(_0x67f74a){return BPromise[_0x63e2('0x29')](_0x67f74a);}return _0x3adc16[_0x63e2('0x2a')]();};}function saveUpdates(_0x4ea38b,_0x5b920b){return function(_0x4ca3ae){if(_0x4ca3ae){return _0x4ca3ae['update'](_0x4ea38b)[_0x63e2('0x2b')](function(_0x57bb7d){return _0x57bb7d;});}return null;};}function removeEntity(_0x34eedf,_0x426c17){return function(_0xe5ae41){if(_0xe5ae41){return _0xe5ae41[_0x63e2('0x2c')]()[_0x63e2('0x2b')](function(){_0x34eedf[_0x63e2('0x20')](0xcc)[_0x63e2('0x21')]();});}};}function handleEntityNotFound(_0x975617,_0x69c7aa){return function(_0x35bea8){if(!_0x35bea8){_0x975617['sendStatus'](0x194);}return _0x35bea8;};}function handleError(_0x95b6ee,_0x5e9254){_0x5e9254=_0x5e9254||0x1f4;return function(_0x12f6e3){logger['error'](_0x12f6e3[_0x63e2('0x2d')]);if(_0x12f6e3[_0x63e2('0x2e')]){delete _0x12f6e3['name'];}_0x95b6ee['status'](_0x5e9254)[_0x63e2('0x2f')](_0x12f6e3);};}exports[_0x63e2('0x30')]=function(_0x90fadf,_0x1a8118){var _0x4e4e58={'raw':![],'where':{'id':_0x90fadf[_0x63e2('0x31')]['id']}},_0x330fc7={};_0x330fc7[_0x63e2('0x32')]=_[_0x63e2('0x33')](db[_0x63e2('0x34')][_0x63e2('0x35')]);_0x330fc7[_0x63e2('0x36')]=_[_0x63e2('0x33')](_0x90fadf['query']);_0x330fc7['filters']=_[_0x63e2('0x37')](_0x330fc7['model'],_0x330fc7[_0x63e2('0x36')]);_0x4e4e58[_0x63e2('0x38')]=_[_0x63e2('0x37')](_0x330fc7[_0x63e2('0x32')],qs['fields'](_0x90fadf[_0x63e2('0x36')][_0x63e2('0x39')]));_0x4e4e58[_0x63e2('0x38')]=_0x4e4e58['attributes'][_0x63e2('0x3a')]?_0x4e4e58['attributes']:_0x330fc7[_0x63e2('0x32')];if(_0x90fadf[_0x63e2('0x36')][_0x63e2('0x3b')]){_0x4e4e58[_0x63e2('0x3c')]=[{'all':!![]}];}_0x4e4e58=_[_0x63e2('0x3d')]({},_0x4e4e58,_0x90fadf[_0x63e2('0x3e')]);return db[_0x63e2('0x34')][_0x63e2('0x3f')](_0x4e4e58)[_0x63e2('0x2b')](handleEntityNotFound(_0x1a8118,null))[_0x63e2('0x2b')](respondWithResult(_0x1a8118,null))[_0x63e2('0x40')](handleError(_0x1a8118,null));};exports[_0x63e2('0x2c')]=function(_0x1e5577,_0x2d8a5f){return db[_0x63e2('0x34')][_0x63e2('0x3f')]({'where':{'id':_0x1e5577['params']['id']}})[_0x63e2('0x2b')](handleEntityNotFound(_0x2d8a5f,null))['then'](removeEntity(_0x2d8a5f,null))[_0x63e2('0x40')](handleError(_0x2d8a5f,null));};function widgetAttributes(_0xad56be){try{switch(_0xad56be[_0x63e2('0x41')]){case _0x63e2('0x42'):return[{'name':_0x63e2('0x43'),'value':_0xad56be['attrUrl']||(_0xad56be[_0x63e2('0x44')]&&_0xad56be[_0x63e2('0x44')][0x0]?_0xad56be[_0x63e2('0x44')][0x0]['value']:undefined)||_0x63e2('0x45')}];case _0x63e2('0x46'):return[{'name':_0x63e2('0x47'),'value':_0xad56be[_0x63e2('0x47')]||(_0xad56be['attrs']&&_0xad56be[_0x63e2('0x44')][0x0]?_0xad56be[_0x63e2('0x44')][0x0][_0x63e2('0x48')]:undefined)||''}];case _0x63e2('0x49'):return[{'name':_0x63e2('0x4a'),'value':_0xad56be[_0x63e2('0x4a')]||(_0xad56be[_0x63e2('0x44')]&&_0xad56be[_0x63e2('0x44')][0x0]?_0xad56be['attrs'][0x0]['value']:undefined)||_0x63e2('0x4b')},{'name':_0x63e2('0x4c'),'value':_0xad56be[_0x63e2('0x4c')]||(_0xad56be[_0x63e2('0x44')]&&_0xad56be[_0x63e2('0x44')][0x1]?_0xad56be[_0x63e2('0x44')][0x1][_0x63e2('0x48')]:undefined)||_0x63e2('0x4d')},{'name':_0x63e2('0x4e'),'value':_0xad56be['attrFontSize']||(_0xad56be[_0x63e2('0x44')]&&_0xad56be['attrs'][0x2]?_0xad56be[_0x63e2('0x44')][0x2][_0x63e2('0x48')]:undefined)||0xc}];case _0x63e2('0x4f'):return[{'name':_0x63e2('0x50'),'value':_0xad56be['attrMetric']||(_0xad56be[_0x63e2('0x44')]&&_0xad56be[_0x63e2('0x44')][0x0]?_0xad56be[_0x63e2('0x44')][0x0][_0x63e2('0x48')]:undefined)||_0x63e2('0x51')},{'name':_0x63e2('0x52'),'value':_0xad56be[_0x63e2('0x52')]||(_0xad56be[_0x63e2('0x44')]&&_0xad56be[_0x63e2('0x44')][0x1]?_0xad56be['attrs'][0x1][_0x63e2('0x48')]:undefined)||[]},{'name':_0x63e2('0x4e'),'value':_0xad56be[_0x63e2('0x4e')]||(_0xad56be[_0x63e2('0x44')]&&_0xad56be['attrs'][0x2]?_0xad56be[_0x63e2('0x44')][0x2][_0x63e2('0x48')]:undefined)||0x14}];case _0x63e2('0x53'):case'pie-chart':return[{'name':_0x63e2('0x54'),'value':_0xad56be[_0x63e2('0x54')]||(_0xad56be[_0x63e2('0x44')]&&_0xad56be['attrs'][0x0]?_0xad56be['attrs'][0x0][_0x63e2('0x48')]:undefined)||_0x63e2('0x51')},{'name':_0x63e2('0x55'),'value':_0xad56be[_0x63e2('0x55')]||(_0xad56be[_0x63e2('0x44')]&&_0xad56be[_0x63e2('0x44')][0x1]?_0xad56be[_0x63e2('0x44')][0x1][_0x63e2('0x48')]:undefined)||null},{'name':_0x63e2('0x56'),'value':_0xad56be[_0x63e2('0x56')]||(_0xad56be[_0x63e2('0x44')]&&_0xad56be[_0x63e2('0x44')][0x2]?_0xad56be['attrs'][0x2]['value']:undefined)||null},{'name':_0x63e2('0x52'),'value':_0xad56be[_0x63e2('0x52')]||(_0xad56be[_0x63e2('0x44')]&&_0xad56be[_0x63e2('0x44')][0x3]?_0xad56be['attrs'][0x3][_0x63e2('0x48')]:undefined)||[]}];case'web-report':return[{'name':'attrReport','type':_0xad56be['reportType']||(_0xad56be[_0x63e2('0x44')]&&_0xad56be[_0x63e2('0x44')][0x0]?_0xad56be[_0x63e2('0x44')][0x0][_0x63e2('0x41')]:undefined)||null,'value':_0xad56be[_0x63e2('0x57')]||(_0xad56be[_0x63e2('0x44')]&&_0xad56be[_0x63e2('0x44')][0x0]?_0xad56be[_0x63e2('0x44')][0x0]['value']:undefined)||null},{'name':'attrRefresh','value':_0xad56be[_0x63e2('0x58')]||(_0xad56be[_0x63e2('0x44')]&&_0xad56be['attrs'][0x1]?_0xad56be[_0x63e2('0x44')][0x1]['value']:undefined)||0x0}];default:return[];}}catch(_0x3826b1){logger[_0x63e2('0x59')](_0x63e2('0x5a'),JSON[_0x63e2('0x5b')](_0x3826b1));return[];}}exports[_0x63e2('0x5c')]=function(_0x104783,_0x448ef0){if(_0x104783[_0x63e2('0x5d')]){_0x104783['body'][_0x63e2('0x44')]=widgetAttributes(_0x104783[_0x63e2('0x5d')]);}return db[_0x63e2('0x34')][_0x63e2('0x5c')](_0x104783[_0x63e2('0x5d')],{})[_0x63e2('0x2b')](respondWithResult(_0x448ef0,0xc9))[_0x63e2('0x40')](handleError(_0x448ef0,null));};exports[_0x63e2('0x5e')]=function(_0x4d610a,_0x15a7a0){if(_0x4d610a['body']['id']){delete _0x4d610a[_0x63e2('0x5d')]['id'];}_0x4d610a[_0x63e2('0x5d')][_0x63e2('0x44')]=widgetAttributes(_0x4d610a[_0x63e2('0x5d')]);return db[_0x63e2('0x34')]['find']({'where':{'id':_0x4d610a[_0x63e2('0x31')]['id']}})[_0x63e2('0x2b')](handleEntityNotFound(_0x15a7a0,null))[_0x63e2('0x2b')](saveUpdates(_0x4d610a['body'],null))[_0x63e2('0x2b')](respondWithResult(_0x15a7a0,null))[_0x63e2('0x40')](handleError(_0x15a7a0,null));};
\ No newline at end of file
+var _0x32ab=['querystring','ioredis','../../components/parsers/qs','../../config/license/hardware','../../config/utils','../../config/environment','../../mysqldb','redis','defaults','./dashboardItem.socket','register','status','end','count','offset','set','Content-Range','json','apply','save','update','sendStatus','stack','name','send','show','params','model','keys','DashboardItem','rawAttributes','query','filters','intersection','fields','attributes','length','includeAll','include','merge','find','then','catch','destroy','iframe','attrUrl','attrs','https://','attrPath','value','clock','attrHourFormat','HH:mm:ss','attrTimezone','0.00','attrFontSize','counter','attrMetric','total','attrVoiceQueues','multibar-chart','pie-chart','attrSerie1','attrSerie2','attrSerie3','web-report','attrReport','reportType','type','attrRefresh','error','widgetAttributes:\x20%s','stringify','create','body','html-pdf','eml-format','rimraf','zip-dir','request-promise','moment','bluebird','mustache','util','sox','to-csv','ejs','lodash','crypto'];(function(_0x20a584,_0xe384a5){var _0x4b41a8=function(_0x2127c6){while(--_0x2127c6){_0x20a584['push'](_0x20a584['shift']());}};_0x4b41a8(++_0xe384a5);}(_0x32ab,0x1af));var _0xb32a=function(_0x5d6456,_0x58ecc7){_0x5d6456=_0x5d6456-0x0;var _0x4d66c1=_0x32ab[_0x5d6456];return _0x4d66c1;};'use strict';var pdf=require(_0xb32a('0x0'));var emlformat=require(_0xb32a('0x1'));var rimraf=require(_0xb32a('0x2'));var zipdir=require(_0xb32a('0x3'));var jsonpatch=require('fast-json-patch');var rp=require(_0xb32a('0x4'));var moment=require(_0xb32a('0x5'));var BPromise=require(_0xb32a('0x6'));var Mustache=require(_0xb32a('0x7'));var util=require(_0xb32a('0x8'));var path=require('path');var sox=require(_0xb32a('0x9'));var csv=require(_0xb32a('0xa'));var ejs=require(_0xb32a('0xb'));var fs=require('fs');var _=require(_0xb32a('0xc'));var squel=require('squel');var crypto=require(_0xb32a('0xd'));var jsforce=require('jsforce');var deskjs=require('desk.js');var toCsv=require(_0xb32a('0xa'));var querystring=require(_0xb32a('0xe'));var Papa=require('papaparse');var Redis=require(_0xb32a('0xf'));var authService=require('../../components/auth/service');var qs=require(_0xb32a('0x10'));var as=require('../../components/parsers/advancedSearch');var hardwareService=require(_0xb32a('0x11'));var logger=require('../../config/logger')('api');var utils=require(_0xb32a('0x12'));var config=require(_0xb32a('0x13'));var db=require(_0xb32a('0x14'))['db'];config[_0xb32a('0x15')]=_[_0xb32a('0x16')](config[_0xb32a('0x15')],{'host':'localhost','port':0x18eb});var socket=require('socket.io-emitter')(new Redis(config['redis']));require(_0xb32a('0x17'))[_0xb32a('0x18')](socket);function respondWithStatusCode(_0x41391a,_0x29498){_0x29498=_0x29498||0xcc;return function(_0x229a93){if(_0x229a93){return _0x41391a['sendStatus'](_0x29498);}return _0x41391a[_0xb32a('0x19')](_0x29498)[_0xb32a('0x1a')]();};}function respondWithResult(_0x2a455d,_0x2b8bef){_0x2b8bef=_0x2b8bef||0xc8;return function(_0x32d455){if(_0x32d455){return _0x2a455d[_0xb32a('0x19')](_0x2b8bef)['json'](_0x32d455);}};}function respondWithFilteredResult(_0x11505a,_0x56f2ef){return function(_0x2f0eff){if(_0x2f0eff){var _0x5569b5=_0x2f0eff[_0xb32a('0x1b')],_0x128e37=_0x56f2ef[_0xb32a('0x1c')],_0x463fd7=_0x56f2ef[_0xb32a('0x1c')]+_0x56f2ef['limit'],_0x9e43be;if(_0x463fd7>=_0x5569b5){_0x463fd7=_0x5569b5;_0x9e43be=0xc8;}else{_0x9e43be=0xce;}_0x11505a['status'](_0x9e43be);return _0x11505a[_0xb32a('0x1d')](_0xb32a('0x1e'),_0x128e37+'-'+_0x463fd7+'/'+_0x5569b5)[_0xb32a('0x1f')](_0x2f0eff);}return null;};}function patchUpdates(_0x246317){return function(_0x45453a){try{jsonpatch[_0xb32a('0x20')](_0x45453a,_0x246317,!![]);}catch(_0x2bb035){return BPromise['reject'](_0x2bb035);}return _0x45453a[_0xb32a('0x21')]();};}function saveUpdates(_0x429b0b,_0x40af1f){return function(_0x4da8b5){if(_0x4da8b5){return _0x4da8b5[_0xb32a('0x22')](_0x429b0b)['then'](function(_0x42fff9){return _0x42fff9;});}return null;};}function removeEntity(_0x4b9b5d,_0x15fb49){return function(_0x1fc852){if(_0x1fc852){return _0x1fc852['destroy']()['then'](function(){_0x4b9b5d[_0xb32a('0x19')](0xcc)[_0xb32a('0x1a')]();});}};}function handleEntityNotFound(_0x29df60,_0x24081f){return function(_0x4d67f2){if(!_0x4d67f2){_0x29df60[_0xb32a('0x23')](0x194);}return _0x4d67f2;};}function handleError(_0x2a51f9,_0x2ececf){_0x2ececf=_0x2ececf||0x1f4;return function(_0x5afc59){logger['error'](_0x5afc59[_0xb32a('0x24')]);if(_0x5afc59[_0xb32a('0x25')]){delete _0x5afc59[_0xb32a('0x25')];}_0x2a51f9[_0xb32a('0x19')](_0x2ececf)[_0xb32a('0x26')](_0x5afc59);};}exports[_0xb32a('0x27')]=function(_0xfa31be,_0x339133){var _0x366bd9={'raw':![],'where':{'id':_0xfa31be[_0xb32a('0x28')]['id']}},_0x2e10b9={};_0x2e10b9[_0xb32a('0x29')]=_[_0xb32a('0x2a')](db[_0xb32a('0x2b')][_0xb32a('0x2c')]);_0x2e10b9[_0xb32a('0x2d')]=_['keys'](_0xfa31be['query']);_0x2e10b9[_0xb32a('0x2e')]=_[_0xb32a('0x2f')](_0x2e10b9['model'],_0x2e10b9[_0xb32a('0x2d')]);_0x366bd9['attributes']=_[_0xb32a('0x2f')](_0x2e10b9[_0xb32a('0x29')],qs[_0xb32a('0x30')](_0xfa31be[_0xb32a('0x2d')][_0xb32a('0x30')]));_0x366bd9[_0xb32a('0x31')]=_0x366bd9['attributes'][_0xb32a('0x32')]?_0x366bd9['attributes']:_0x2e10b9[_0xb32a('0x29')];if(_0xfa31be[_0xb32a('0x2d')][_0xb32a('0x33')]){_0x366bd9[_0xb32a('0x34')]=[{'all':!![]}];}_0x366bd9=_[_0xb32a('0x35')]({},_0x366bd9,_0xfa31be['options']);return db[_0xb32a('0x2b')][_0xb32a('0x36')](_0x366bd9)[_0xb32a('0x37')](handleEntityNotFound(_0x339133,null))[_0xb32a('0x37')](respondWithResult(_0x339133,null))[_0xb32a('0x38')](handleError(_0x339133,null));};exports[_0xb32a('0x39')]=function(_0x3d1c5e,_0x25e7d6){return db[_0xb32a('0x2b')][_0xb32a('0x36')]({'where':{'id':_0x3d1c5e['params']['id']}})[_0xb32a('0x37')](handleEntityNotFound(_0x25e7d6,null))[_0xb32a('0x37')](removeEntity(_0x25e7d6,null))[_0xb32a('0x38')](handleError(_0x25e7d6,null));};function widgetAttributes(_0x2977d3){try{switch(_0x2977d3['type']){case _0xb32a('0x3a'):return[{'name':_0xb32a('0x3b'),'value':_0x2977d3[_0xb32a('0x3b')]||(_0x2977d3[_0xb32a('0x3c')]&&_0x2977d3['attrs'][0x0]?_0x2977d3[_0xb32a('0x3c')][0x0]['value']:undefined)||_0xb32a('0x3d')}];case'custom':return[{'name':_0xb32a('0x3e'),'value':_0x2977d3['attrPath']||(_0x2977d3[_0xb32a('0x3c')]&&_0x2977d3[_0xb32a('0x3c')][0x0]?_0x2977d3[_0xb32a('0x3c')][0x0][_0xb32a('0x3f')]:undefined)||''}];case _0xb32a('0x40'):return[{'name':_0xb32a('0x41'),'value':_0x2977d3[_0xb32a('0x41')]||(_0x2977d3['attrs']&&_0x2977d3[_0xb32a('0x3c')][0x0]?_0x2977d3[_0xb32a('0x3c')][0x0][_0xb32a('0x3f')]:undefined)||_0xb32a('0x42')},{'name':_0xb32a('0x43'),'value':_0x2977d3[_0xb32a('0x43')]||(_0x2977d3[_0xb32a('0x3c')]&&_0x2977d3['attrs'][0x1]?_0x2977d3[_0xb32a('0x3c')][0x1][_0xb32a('0x3f')]:undefined)||_0xb32a('0x44')},{'name':_0xb32a('0x45'),'value':_0x2977d3['attrFontSize']||(_0x2977d3[_0xb32a('0x3c')]&&_0x2977d3[_0xb32a('0x3c')][0x2]?_0x2977d3[_0xb32a('0x3c')][0x2]['value']:undefined)||0xc}];case _0xb32a('0x46'):return[{'name':'attrMetric','value':_0x2977d3[_0xb32a('0x47')]||(_0x2977d3[_0xb32a('0x3c')]&&_0x2977d3[_0xb32a('0x3c')][0x0]?_0x2977d3[_0xb32a('0x3c')][0x0][_0xb32a('0x3f')]:undefined)||_0xb32a('0x48')},{'name':_0xb32a('0x49'),'value':_0x2977d3[_0xb32a('0x49')]||(_0x2977d3[_0xb32a('0x3c')]&&_0x2977d3[_0xb32a('0x3c')][0x1]?_0x2977d3[_0xb32a('0x3c')][0x1][_0xb32a('0x3f')]:undefined)||[]},{'name':'attrFontSize','value':_0x2977d3[_0xb32a('0x45')]||(_0x2977d3[_0xb32a('0x3c')]&&_0x2977d3['attrs'][0x2]?_0x2977d3['attrs'][0x2][_0xb32a('0x3f')]:undefined)||0x14}];case _0xb32a('0x4a'):case _0xb32a('0x4b'):return[{'name':_0xb32a('0x4c'),'value':_0x2977d3['attrSerie1']||(_0x2977d3[_0xb32a('0x3c')]&&_0x2977d3[_0xb32a('0x3c')][0x0]?_0x2977d3['attrs'][0x0][_0xb32a('0x3f')]:undefined)||_0xb32a('0x48')},{'name':_0xb32a('0x4d'),'value':_0x2977d3['attrSerie2']||(_0x2977d3[_0xb32a('0x3c')]&&_0x2977d3[_0xb32a('0x3c')][0x1]?_0x2977d3[_0xb32a('0x3c')][0x1][_0xb32a('0x3f')]:undefined)||null},{'name':_0xb32a('0x4e'),'value':_0x2977d3['attrSerie3']||(_0x2977d3['attrs']&&_0x2977d3['attrs'][0x2]?_0x2977d3['attrs'][0x2]['value']:undefined)||null},{'name':_0xb32a('0x49'),'value':_0x2977d3['attrVoiceQueues']||(_0x2977d3[_0xb32a('0x3c')]&&_0x2977d3['attrs'][0x3]?_0x2977d3['attrs'][0x3][_0xb32a('0x3f')]:undefined)||[]}];case _0xb32a('0x4f'):return[{'name':_0xb32a('0x50'),'type':_0x2977d3[_0xb32a('0x51')]||(_0x2977d3[_0xb32a('0x3c')]&&_0x2977d3[_0xb32a('0x3c')][0x0]?_0x2977d3[_0xb32a('0x3c')][0x0][_0xb32a('0x52')]:undefined)||null,'value':_0x2977d3[_0xb32a('0x50')]||(_0x2977d3[_0xb32a('0x3c')]&&_0x2977d3[_0xb32a('0x3c')][0x0]?_0x2977d3[_0xb32a('0x3c')][0x0][_0xb32a('0x3f')]:undefined)||null},{'name':_0xb32a('0x53'),'value':_0x2977d3[_0xb32a('0x53')]||(_0x2977d3['attrs']&&_0x2977d3['attrs'][0x1]?_0x2977d3[_0xb32a('0x3c')][0x1]['value']:undefined)||0x0}];default:return[];}}catch(_0x4c8138){logger[_0xb32a('0x54')](_0xb32a('0x55'),JSON[_0xb32a('0x56')](_0x4c8138));return[];}}exports[_0xb32a('0x57')]=function(_0x1e414c,_0x2ec239){if(_0x1e414c[_0xb32a('0x58')]){_0x1e414c['body'][_0xb32a('0x3c')]=widgetAttributes(_0x1e414c[_0xb32a('0x58')]);}return db[_0xb32a('0x2b')][_0xb32a('0x57')](_0x1e414c[_0xb32a('0x58')],{})['then'](respondWithResult(_0x2ec239,0xc9))[_0xb32a('0x38')](handleError(_0x2ec239,null));};exports['update']=function(_0x2abce9,_0x293499){if(_0x2abce9[_0xb32a('0x58')]['id']){delete _0x2abce9[_0xb32a('0x58')]['id'];}_0x2abce9[_0xb32a('0x58')][_0xb32a('0x3c')]=widgetAttributes(_0x2abce9[_0xb32a('0x58')]);return db[_0xb32a('0x2b')][_0xb32a('0x36')]({'where':{'id':_0x2abce9['params']['id']}})['then'](handleEntityNotFound(_0x293499,null))[_0xb32a('0x37')](saveUpdates(_0x2abce9[_0xb32a('0x58')],null))[_0xb32a('0x37')](respondWithResult(_0x293499,null))[_0xb32a('0x38')](handleError(_0x293499,null));};
\ No newline at end of file
diff --git a/server/api/dashboardItem/dashboardItem.events.js b/server/api/dashboardItem/dashboardItem.events.js
index fd60df3..275af26 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 _0xb410=['../../mysqldb','DashboardItem','update','remove','emit','hasOwnProperty','hook','exports','events'];(function(_0x153088,_0x3aab7c){var _0x48366e=function(_0x56b53c){while(--_0x56b53c){_0x153088['push'](_0x153088['shift']());}};_0x48366e(++_0x3aab7c);}(_0xb410,0x8f));var _0x0b41=function(_0x21a9d9,_0x4d5ac8){_0x21a9d9=_0x21a9d9-0x0;var _0x46adce=_0xb410[_0x21a9d9];return _0x46adce;};'use strict';var EventEmitter=require(_0x0b41('0x0'));var DashboardItem=require(_0x0b41('0x1'))['db'][_0x0b41('0x2')];var DashboardItemEvents=new EventEmitter();DashboardItemEvents['setMaxListeners'](0x0);var events={'afterCreate':'save','afterUpdate':_0x0b41('0x3'),'afterDestroy':_0x0b41('0x4')};function emitEvent(_0xd7bced){return function(_0x3f6fc5,_0x1ffc1f,_0xa5d29b){DashboardItemEvents[_0x0b41('0x5')](_0xd7bced+':'+_0x3f6fc5['id'],_0x3f6fc5);DashboardItemEvents['emit'](_0xd7bced,_0x3f6fc5);_0xa5d29b(null);};}for(var e in events){if(events[_0x0b41('0x6')](e)){var event=events[e];DashboardItem[_0x0b41('0x7')](e,emitEvent(event));}}module[_0x0b41('0x8')]=DashboardItemEvents;
\ No newline at end of file
+var _0xfba8=['remove','hasOwnProperty','hook','exports','events','DashboardItem','update'];(function(_0x208fd7,_0x2bd162){var _0x468845=function(_0x3a2679){while(--_0x3a2679){_0x208fd7['push'](_0x208fd7['shift']());}};_0x468845(++_0x2bd162);}(_0xfba8,0x12a));var _0x8fba=function(_0x4527ec,_0x45e9a6){_0x4527ec=_0x4527ec-0x0;var _0x247771=_0xfba8[_0x4527ec];return _0x247771;};'use strict';var EventEmitter=require(_0x8fba('0x0'));var DashboardItem=require('../../mysqldb')['db'][_0x8fba('0x1')];var DashboardItemEvents=new EventEmitter();DashboardItemEvents['setMaxListeners'](0x0);var events={'afterCreate':'save','afterUpdate':_0x8fba('0x2'),'afterDestroy':_0x8fba('0x3')};function emitEvent(_0x5362db){return function(_0x1b25fe,_0x24470f,_0x5c6acf){DashboardItemEvents['emit'](_0x5362db+':'+_0x1b25fe['id'],_0x1b25fe);DashboardItemEvents['emit'](_0x5362db,_0x1b25fe);_0x5c6acf(null);};}for(var e in events){if(events[_0x8fba('0x4')](e)){var event=events[e];DashboardItem[_0x8fba('0x5')](e,emitEvent(event));}}module[_0x8fba('0x6')]=DashboardItemEvents;
\ No newline at end of file
diff --git a/server/api/dashboardItem/dashboardItem.model.js b/server/api/dashboardItem/dashboardItem.model.js
index a1b8bf4..16f1771 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 _0x304d=['./dashboardItem.attributes','exports','dashboard_items','lodash','util','bluebird','request-promise','path','rimraf','../../config/environment'];(function(_0x4bfab7,_0x1f92fc){var _0x232fd7=function(_0x2fb73c){while(--_0x2fb73c){_0x4bfab7['push'](_0x4bfab7['shift']());}};_0x232fd7(++_0x1f92fc);}(_0x304d,0xe9));var _0xd304=function(_0x14add3,_0x13ce8d){_0x14add3=_0x14add3-0x0;var _0x4a174f=_0x304d[_0x14add3];return _0x4a174f;};'use strict';var _=require(_0xd304('0x0'));var util=require(_0xd304('0x1'));var logger=require('../../config/logger')('api');var moment=require('moment');var BPromise=require(_0xd304('0x2'));var rp=require(_0xd304('0x3'));var fs=require('fs');var path=require(_0xd304('0x4'));var rimraf=require(_0xd304('0x5'));var config=require(_0xd304('0x6'));var attributes=require(_0xd304('0x7'));module[_0xd304('0x8')]=function(_0xbd4ca,_0x41f576){return _0xbd4ca['define']('DashboardItem',attributes,{'tableName':_0xd304('0x9'),'paranoid':![],'indexes':[],'timestamps':!![]});};
\ No newline at end of file
+var _0x54c8=['lodash','util','../../config/logger','api','moment','bluebird','path','rimraf','exports','define'];(function(_0x55511d,_0x2c8711){var _0x3fb91c=function(_0x4a87f2){while(--_0x4a87f2){_0x55511d['push'](_0x55511d['shift']());}};_0x3fb91c(++_0x2c8711);}(_0x54c8,0x1b8));var _0x854c=function(_0x258814,_0x280a0a){_0x258814=_0x258814-0x0;var _0x173dd6=_0x54c8[_0x258814];return _0x173dd6;};'use strict';var _=require(_0x854c('0x0'));var util=require(_0x854c('0x1'));var logger=require(_0x854c('0x2'))(_0x854c('0x3'));var moment=require(_0x854c('0x4'));var BPromise=require(_0x854c('0x5'));var rp=require('request-promise');var fs=require('fs');var path=require(_0x854c('0x6'));var rimraf=require(_0x854c('0x7'));var config=require('../../config/environment');var attributes=require('./dashboardItem.attributes');module[_0x854c('0x8')]=function(_0x48e424,_0x2fe875){return _0x48e424[_0x854c('0x9')]('DashboardItem',attributes,{'tableName':'dashboard_items','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 c72f887..82d782f 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 _0xab44=['debug','DashboardItem,\x20%s,\x20%s,\x20%s','error','code','message','info','lodash','util','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','client','http','redis','./dashboardItem.socket','request','then','DashboardItem,\x20%s,\x20%s','request\x20sent'];(function(_0x4c12ec,_0x2e9103){var _0x3ae42c=function(_0x5a728f){while(--_0x5a728f){_0x4c12ec['push'](_0x4c12ec['shift']());}};_0x3ae42c(++_0x2e9103);}(_0xab44,0x172));var _0x4ab4=function(_0x2b6b24,_0x1048f6){_0x2b6b24=_0x2b6b24-0x0;var _0x1cc68f=_0xab44[_0x2b6b24];return _0x1cc68f;};'use strict';var _=require(_0x4ab4('0x0'));var util=require(_0x4ab4('0x1'));var moment=require(_0x4ab4('0x2'));var BPromise=require(_0x4ab4('0x3'));var rs=require(_0x4ab4('0x4'));var fs=require('fs');var Redis=require(_0x4ab4('0x5'));var db=require(_0x4ab4('0x6'))['db'];var utils=require(_0x4ab4('0x7'));var logger=require(_0x4ab4('0x8'))(_0x4ab4('0x9'));var config=require(_0x4ab4('0xa'));var jayson=require(_0x4ab4('0xb'));var client=jayson[_0x4ab4('0xc')][_0x4ab4('0xd')]({'port':0x232a});config[_0x4ab4('0xe')]=_['defaults'](config[_0x4ab4('0xe')],{'host':'localhost','port':0x18eb});var socket=require('socket.io-emitter')(new Redis(config[_0x4ab4('0xe')]));require(_0x4ab4('0xf'))['register'](socket);function respondWithRpcPromise(_0x33301b,_0x4c70d0,_0x49a2ac){return new BPromise(function(_0x10df74,_0x51d650){return client[_0x4ab4('0x10')](_0x33301b,_0x49a2ac)[_0x4ab4('0x11')](function(_0x1d4239){logger['info'](_0x4ab4('0x12'),_0x4c70d0,_0x4ab4('0x13'));logger[_0x4ab4('0x14')](_0x4ab4('0x15'),_0x4c70d0,_0x4ab4('0x13'),JSON['stringify'](_0x1d4239));if(_0x1d4239[_0x4ab4('0x16')]){if(_0x1d4239[_0x4ab4('0x16')][_0x4ab4('0x17')]===0x1f4){logger[_0x4ab4('0x16')](_0x4ab4('0x12'),_0x4c70d0,_0x1d4239[_0x4ab4('0x16')][_0x4ab4('0x18')]);return _0x51d650(_0x1d4239[_0x4ab4('0x16')][_0x4ab4('0x18')]);}logger[_0x4ab4('0x16')](_0x4ab4('0x12'),_0x4c70d0,_0x1d4239[_0x4ab4('0x16')][_0x4ab4('0x18')]);return _0x10df74(_0x1d4239[_0x4ab4('0x16')][_0x4ab4('0x18')]);}else{logger[_0x4ab4('0x19')](_0x4ab4('0x12'),_0x4c70d0,'request\x20sent');_0x10df74(_0x1d4239['result'][_0x4ab4('0x18')]);}})['catch'](function(_0x5eea0d){logger['error'](_0x4ab4('0x12'),_0x4c70d0,_0x5eea0d);_0x51d650(_0x5eea0d);});});}
\ No newline at end of file
+var _0x5a3c=['client','http','redis','defaults','localhost','socket.io-emitter','./dashboardItem.socket','register','request','then','info','request\x20sent','debug','error','code','DashboardItem,\x20%s,\x20%s','message','result','lodash','util','moment','../../mysqldb','../../config/utils','rpc','../../config/environment','jayson/promise'];(function(_0x3dd15e,_0x1f0015){var _0x231fd0=function(_0x4f680a){while(--_0x4f680a){_0x3dd15e['push'](_0x3dd15e['shift']());}};_0x231fd0(++_0x1f0015);}(_0x5a3c,0xfc));var _0xc5a3=function(_0x4ea69d,_0x290f53){_0x4ea69d=_0x4ea69d-0x0;var _0x5318e0=_0x5a3c[_0x4ea69d];return _0x5318e0;};'use strict';var _=require(_0xc5a3('0x0'));var util=require(_0xc5a3('0x1'));var moment=require(_0xc5a3('0x2'));var BPromise=require('bluebird');var rs=require('randomstring');var fs=require('fs');var Redis=require('ioredis');var db=require(_0xc5a3('0x3'))['db'];var utils=require(_0xc5a3('0x4'));var logger=require('../../config/logger')(_0xc5a3('0x5'));var config=require(_0xc5a3('0x6'));var jayson=require(_0xc5a3('0x7'));var client=jayson[_0xc5a3('0x8')][_0xc5a3('0x9')]({'port':0x232a});config[_0xc5a3('0xa')]=_[_0xc5a3('0xb')](config[_0xc5a3('0xa')],{'host':_0xc5a3('0xc'),'port':0x18eb});var socket=require(_0xc5a3('0xd'))(new Redis(config[_0xc5a3('0xa')]));require(_0xc5a3('0xe'))[_0xc5a3('0xf')](socket);function respondWithRpcPromise(_0x365842,_0x411727,_0x5f1ae6){return new BPromise(function(_0xa0c428,_0x4d2868){return client[_0xc5a3('0x10')](_0x365842,_0x5f1ae6)[_0xc5a3('0x11')](function(_0x284b79){logger[_0xc5a3('0x12')]('DashboardItem,\x20%s,\x20%s',_0x411727,_0xc5a3('0x13'));logger[_0xc5a3('0x14')]('DashboardItem,\x20%s,\x20%s,\x20%s',_0x411727,_0xc5a3('0x13'),JSON['stringify'](_0x284b79));if(_0x284b79[_0xc5a3('0x15')]){if(_0x284b79['error'][_0xc5a3('0x16')]===0x1f4){logger[_0xc5a3('0x15')](_0xc5a3('0x17'),_0x411727,_0x284b79['error']['message']);return _0x4d2868(_0x284b79[_0xc5a3('0x15')]['message']);}logger[_0xc5a3('0x15')]('DashboardItem,\x20%s,\x20%s',_0x411727,_0x284b79[_0xc5a3('0x15')][_0xc5a3('0x18')]);return _0xa0c428(_0x284b79[_0xc5a3('0x15')][_0xc5a3('0x18')]);}else{logger[_0xc5a3('0x12')](_0xc5a3('0x17'),_0x411727,_0xc5a3('0x13'));_0xa0c428(_0x284b79[_0xc5a3('0x19')][_0xc5a3('0x18')]);}})['catch'](function(_0xc805d5){logger[_0xc5a3('0x15')]('DashboardItem,\x20%s,\x20%s',_0x411727,_0xc805d5);_0x4d2868(_0xc805d5);});});}
\ No newline at end of file
diff --git a/server/api/dashboardItem/dashboardItem.socket.js b/server/api/dashboardItem/dashboardItem.socket.js
index 79bc59c..8a5cbf5 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 _0x5fd6=['update','emit','removeListener','register','dashboardItem:','./dashboardItem.events','remove'];(function(_0x246fdb,_0x27132d){var _0x7373dc=function(_0x5378b2){while(--_0x5378b2){_0x246fdb['push'](_0x246fdb['shift']());}};_0x7373dc(++_0x27132d);}(_0x5fd6,0x8a));var _0x65fd=function(_0x18480c,_0x27d440){_0x18480c=_0x18480c-0x0;var _0x164c98=_0x5fd6[_0x18480c];return _0x164c98;};'use strict';var DashboardItemEvents=require(_0x65fd('0x0'));var events=['save',_0x65fd('0x1'),_0x65fd('0x2')];function createListener(_0x4fc723,_0x10fc02){return function(_0x1c2ad0){_0x10fc02[_0x65fd('0x3')](_0x4fc723,_0x1c2ad0);};}function removeListener(_0x38a196,_0x261d06){return function(){DashboardItemEvents[_0x65fd('0x4')](_0x38a196,_0x261d06);};}exports[_0x65fd('0x5')]=function(_0x4b43a6){for(var _0x5a3b6f=0x0,_0x1a5bd4=events['length'];_0x5a3b6f<_0x1a5bd4;_0x5a3b6f++){var _0x534a23=events[_0x5a3b6f];var _0x2eccf9=createListener(_0x65fd('0x6')+_0x534a23,_0x4b43a6);DashboardItemEvents['on'](_0x534a23,_0x2eccf9);}};
\ No newline at end of file
+var _0x6002=['removeListener','length','./dashboardItem.events','save','remove','update','emit'];(function(_0x2070da,_0x45e586){var _0x4f9fe1=function(_0x5b6f2a){while(--_0x5b6f2a){_0x2070da['push'](_0x2070da['shift']());}};_0x4f9fe1(++_0x45e586);}(_0x6002,0xfe));var _0x2600=function(_0x51aa20,_0x59faff){_0x51aa20=_0x51aa20-0x0;var _0x4f75c2=_0x6002[_0x51aa20];return _0x4f75c2;};'use strict';var DashboardItemEvents=require(_0x2600('0x0'));var events=[_0x2600('0x1'),_0x2600('0x2'),_0x2600('0x3')];function createListener(_0x2a3d3a,_0x490fcc){return function(_0x59bd99){_0x490fcc[_0x2600('0x4')](_0x2a3d3a,_0x59bd99);};}function removeListener(_0x1a1e14,_0x428f1e){return function(){DashboardItemEvents[_0x2600('0x5')](_0x1a1e14,_0x428f1e);};}exports['register']=function(_0x549603){for(var _0x24fbb8=0x0,_0x124b73=events[_0x2600('0x6')];_0x24fbb8<_0x124b73;_0x24fbb8++){var _0x347fc2=events[_0x24fbb8];var _0x22de15=createListener('dashboardItem:'+_0x347fc2,_0x549603);DashboardItemEvents['on'](_0x347fc2,_0x22de15);}};
\ No newline at end of file
diff --git a/server/api/dashboardItem/index.js b/server/api/dashboardItem/index.js
index b68223c..dcef677 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 _0x7fbe=['connect-timeout','express','Router','../../components/auth/service','../../components/interaction/service','../../config/environment','./dashboardItem.controller','get','/:id','isAuthenticated','show','post','put','update','destroy','exports','path'];(function(_0x17d9e3,_0x1f969c){var _0x14192d=function(_0x159745){while(--_0x159745){_0x17d9e3['push'](_0x17d9e3['shift']());}};_0x14192d(++_0x1f969c);}(_0x7fbe,0x1ec));var _0xe7fb=function(_0x26e89e,_0xacad9){_0x26e89e=_0x26e89e-0x0;var _0x5bf1d3=_0x7fbe[_0x26e89e];return _0x5bf1d3;};'use strict';var multer=require('multer');var util=require('util');var path=require(_0xe7fb('0x0'));var timeout=require(_0xe7fb('0x1'));var express=require(_0xe7fb('0x2'));var router=express[_0xe7fb('0x3')]();var auth=require(_0xe7fb('0x4'));var interaction=require(_0xe7fb('0x5'));var config=require(_0xe7fb('0x6'));var controller=require(_0xe7fb('0x7'));router[_0xe7fb('0x8')](_0xe7fb('0x9'),auth[_0xe7fb('0xa')](),controller[_0xe7fb('0xb')]);router[_0xe7fb('0xc')]('/',auth[_0xe7fb('0xa')](),controller['create']);router[_0xe7fb('0xd')](_0xe7fb('0x9'),auth[_0xe7fb('0xa')](),controller[_0xe7fb('0xe')]);router['delete']('/:id',auth[_0xe7fb('0xa')](),controller[_0xe7fb('0xf')]);module[_0xe7fb('0x10')]=router;
\ No newline at end of file
+var _0x187d=['delete','destroy','exports','multer','path','connect-timeout','express','Router','../../components/auth/service','../../components/interaction/service','./dashboardItem.controller','get','isAuthenticated','show','post','create','put','/:id'];(function(_0x1aeda2,_0x1217eb){var _0x32dc6d=function(_0x34a460){while(--_0x34a460){_0x1aeda2['push'](_0x1aeda2['shift']());}};_0x32dc6d(++_0x1217eb);}(_0x187d,0x93));var _0xd187=function(_0x42245d,_0x51758f){_0x42245d=_0x42245d-0x0;var _0x4b211a=_0x187d[_0x42245d];return _0x4b211a;};'use strict';var multer=require(_0xd187('0x0'));var util=require('util');var path=require(_0xd187('0x1'));var timeout=require(_0xd187('0x2'));var express=require(_0xd187('0x3'));var router=express[_0xd187('0x4')]();var auth=require(_0xd187('0x5'));var interaction=require(_0xd187('0x6'));var config=require('../../config/environment');var controller=require(_0xd187('0x7'));router[_0xd187('0x8')]('/:id',auth[_0xd187('0x9')](),controller[_0xd187('0xa')]);router[_0xd187('0xb')]('/',auth[_0xd187('0x9')](),controller[_0xd187('0xc')]);router[_0xd187('0xd')](_0xd187('0xe'),auth[_0xd187('0x9')](),controller['update']);router[_0xd187('0xf')](_0xd187('0xe'),auth[_0xd187('0x9')](),controller[_0xd187('0x10')]);module[_0xd187('0x11')]=router;
\ No newline at end of file
diff --git a/server/api/disposition/disposition.attributes.js b/server/api/disposition/disposition.attributes.js
index ececca4..41a2305 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 _0xcc11=['STRING','sequelize','exports'];(function(_0x3dd15e,_0x1f0015){var _0x231fd0=function(_0x4f680a){while(--_0x4f680a){_0x3dd15e['push'](_0x3dd15e['shift']());}};_0x231fd0(++_0x1f0015);}(_0xcc11,0xc1));var _0x1cc1=function(_0x4436f7,_0x5784fc){_0x4436f7=_0x4436f7-0x0;var _0x268052=_0xcc11[_0x4436f7];return _0x268052;};'use strict';var Sequelize=require(_0x1cc1('0x0'));module[_0x1cc1('0x1')]={'name':{'type':Sequelize[_0x1cc1('0x2')],'allowNull':![]}};
\ No newline at end of file
+var _0x2454=['exports','STRING','sequelize'];(function(_0x2340b0,_0x2fff1e){var _0x73fac2=function(_0x13731d){while(--_0x13731d){_0x2340b0['push'](_0x2340b0['shift']());}};_0x73fac2(++_0x2fff1e);}(_0x2454,0x194));var _0x4245=function(_0x4387bf,_0x73e377){_0x4387bf=_0x4387bf-0x0;var _0x4ecb66=_0x2454[_0x4387bf];return _0x4ecb66;};'use strict';var Sequelize=require(_0x4245('0x0'));module[_0x4245('0x1')]={'name':{'type':Sequelize[_0x4245('0x2')],'allowNull':![]}};
\ No newline at end of file
diff --git a/server/api/disposition/disposition.controller.js b/server/api/disposition/disposition.controller.js
index 0b7c9ac..24ce562 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 _0x24ca=['error','stack','name','send','index','Disposition','rawAttributes','type','model','map','keys','query','filters','attributes','intersection','fields','length','hasOwnProperty','nolimit','sort','where','filter','merge','VIRTUAL','findAll','catch','show','params','includeAll','include','options','find','create','body','user','role','get','UserProfileSection','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','html-pdf','rimraf','zip-dir','fast-json-patch','moment','bluebird','mustache','util','path','sox','to-csv','ejs','lodash','squel','crypto','desk.js','querystring','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/environment','sendStatus','end','status','json','count','offset','limit','set','Content-Range','apply','reject','update','then','Dispositions','UserProfileResource','destroy'];(function(_0x1ca429,_0x3d990e){var _0x5914a9=function(_0x51d139){while(--_0x51d139){_0x1ca429['push'](_0x1ca429['shift']());}};_0x5914a9(++_0x3d990e);}(_0x24ca,0x1bc));var _0xa24c=function(_0x48ec91,_0x212edc){_0x48ec91=_0x48ec91-0x0;var _0x22766c=_0x24ca[_0x48ec91];return _0x22766c;};'use strict';var pdf=require(_0xa24c('0x0'));var emlformat=require('eml-format');var rimraf=require(_0xa24c('0x1'));var zipdir=require(_0xa24c('0x2'));var jsonpatch=require(_0xa24c('0x3'));var rp=require('request-promise');var moment=require(_0xa24c('0x4'));var BPromise=require(_0xa24c('0x5'));var Mustache=require(_0xa24c('0x6'));var util=require(_0xa24c('0x7'));var path=require(_0xa24c('0x8'));var sox=require(_0xa24c('0x9'));var csv=require(_0xa24c('0xa'));var ejs=require(_0xa24c('0xb'));var fs=require('fs');var _=require(_0xa24c('0xc'));var squel=require(_0xa24c('0xd'));var crypto=require(_0xa24c('0xe'));var jsforce=require('jsforce');var deskjs=require(_0xa24c('0xf'));var toCsv=require(_0xa24c('0xa'));var querystring=require(_0xa24c('0x10'));var Papa=require('papaparse');var Redis=require(_0xa24c('0x11'));var authService=require(_0xa24c('0x12'));var qs=require(_0xa24c('0x13'));var as=require(_0xa24c('0x14'));var hardwareService=require(_0xa24c('0x15'));var logger=require(_0xa24c('0x16'))(_0xa24c('0x17'));var utils=require(_0xa24c('0x18'));var config=require(_0xa24c('0x19'));var db=require('../../mysqldb')['db'];function respondWithStatusCode(_0x43bcd3,_0x11090c){_0x11090c=_0x11090c||0xcc;return function(_0xcee4fe){if(_0xcee4fe){return _0x43bcd3[_0xa24c('0x1a')](_0x11090c);}return _0x43bcd3['status'](_0x11090c)[_0xa24c('0x1b')]();};}function respondWithResult(_0x3c23fc,_0x26ff28){_0x26ff28=_0x26ff28||0xc8;return function(_0x2fcd8b){if(_0x2fcd8b){return _0x3c23fc[_0xa24c('0x1c')](_0x26ff28)[_0xa24c('0x1d')](_0x2fcd8b);}};}function respondWithFilteredResult(_0x448275,_0x5d4727){return function(_0x47a063){if(_0x47a063){var _0xb80781=_0x47a063[_0xa24c('0x1e')],_0x87aa90=_0x5d4727[_0xa24c('0x1f')],_0x49ce53=_0x5d4727['offset']+_0x5d4727[_0xa24c('0x20')],_0x5babb5;if(_0x49ce53>=_0xb80781){_0x49ce53=_0xb80781;_0x5babb5=0xc8;}else{_0x5babb5=0xce;}_0x448275['status'](_0x5babb5);return _0x448275[_0xa24c('0x21')](_0xa24c('0x22'),_0x87aa90+'-'+_0x49ce53+'/'+_0xb80781)[_0xa24c('0x1d')](_0x47a063);}return null;};}function patchUpdates(_0xefdbd9){return function(_0x4ff97c){try{jsonpatch[_0xa24c('0x23')](_0x4ff97c,_0xefdbd9,!![]);}catch(_0x18b7e0){return BPromise[_0xa24c('0x24')](_0x18b7e0);}return _0x4ff97c['save']();};}function saveUpdates(_0x48a768,_0x506424){return function(_0x4cd77e){if(_0x4cd77e){return _0x4cd77e[_0xa24c('0x25')](_0x48a768)[_0xa24c('0x26')](function(_0x26e9c3){return _0x26e9c3;});}return null;};}function removeEntity(_0x180297,_0x51a275){return function(_0x30ec21){if(_0x30ec21){return _0x30ec21['destroy']()[_0xa24c('0x26')](function(){var _0xb81d97=_0x30ec21['get']({'plain':!![]});var _0x346ee8=_0xa24c('0x27');return db[_0xa24c('0x28')][_0xa24c('0x29')]({'where':{'type':_0x346ee8,'resourceId':_0xb81d97['id']}})[_0xa24c('0x26')](function(){return _0x30ec21;});})['then'](function(){_0x180297[_0xa24c('0x1c')](0xcc)['end']();});}};}function handleEntityNotFound(_0x2365f9,_0x3951ae){return function(_0x294685){if(!_0x294685){_0x2365f9['sendStatus'](0x194);}return _0x294685;};}function handleError(_0x1beb55,_0x31c4d9){_0x31c4d9=_0x31c4d9||0x1f4;return function(_0x14fd5a){logger[_0xa24c('0x2a')](_0x14fd5a[_0xa24c('0x2b')]);if(_0x14fd5a[_0xa24c('0x2c')]){delete _0x14fd5a[_0xa24c('0x2c')];}_0x1beb55['status'](_0x31c4d9)[_0xa24c('0x2d')](_0x14fd5a);};}exports[_0xa24c('0x2e')]=function(_0x152120,_0x12dbdc){var _0x5e491e={},_0x21d2a8={},_0xc96ce7={'count':0x0,'rows':[]};var _0x97c08=_['map'](db[_0xa24c('0x2f')][_0xa24c('0x30')],function(_0x253d83){return{'name':_0x253d83['fieldName'],'type':_0x253d83[_0xa24c('0x31')]['key']};});_0x21d2a8[_0xa24c('0x32')]=_[_0xa24c('0x33')](_0x97c08,_0xa24c('0x2c'));_0x21d2a8['query']=_[_0xa24c('0x34')](_0x152120[_0xa24c('0x35')]);_0x21d2a8[_0xa24c('0x36')]=_['intersection'](_0x21d2a8[_0xa24c('0x32')],_0x21d2a8['query']);_0x5e491e[_0xa24c('0x37')]=_[_0xa24c('0x38')](_0x21d2a8['model'],qs['fields'](_0x152120[_0xa24c('0x35')][_0xa24c('0x39')]));_0x5e491e[_0xa24c('0x37')]=_0x5e491e[_0xa24c('0x37')][_0xa24c('0x3a')]?_0x5e491e[_0xa24c('0x37')]:_0x21d2a8[_0xa24c('0x32')];if(!_0x152120['query'][_0xa24c('0x3b')](_0xa24c('0x3c'))){_0x5e491e[_0xa24c('0x20')]=qs[_0xa24c('0x20')](_0x152120[_0xa24c('0x35')][_0xa24c('0x20')]);_0x5e491e[_0xa24c('0x1f')]=qs[_0xa24c('0x1f')](_0x152120[_0xa24c('0x35')][_0xa24c('0x1f')]);}_0x5e491e['order']=qs[_0xa24c('0x3d')](_0x152120[_0xa24c('0x35')][_0xa24c('0x3d')]);_0x5e491e[_0xa24c('0x3e')]=qs['filters'](_['pick'](_0x152120[_0xa24c('0x35')],_0x21d2a8['filters']));if(_0x152120[_0xa24c('0x35')][_0xa24c('0x3f')]){_0x5e491e[_0xa24c('0x3e')]=_[_0xa24c('0x40')](_0x5e491e[_0xa24c('0x3e')],{'$or':_['map'](_0x97c08,function(_0x532875){if(_0x532875[_0xa24c('0x31')]!==_0xa24c('0x41')){var _0x3603db={};_0x3603db[_0x532875[_0xa24c('0x2c')]]={'$like':'%'+_0x152120[_0xa24c('0x35')][_0xa24c('0x3f')]+'%'};return _0x3603db;}})});}_0x5e491e=_['merge']({},_0x5e491e,_0x152120['options']);var _0x2a9317={'where':_0x5e491e[_0xa24c('0x3e')]};return db[_0xa24c('0x2f')][_0xa24c('0x1e')](_0x2a9317)[_0xa24c('0x26')](function(_0x4c5b7e){_0xc96ce7[_0xa24c('0x1e')]=_0x4c5b7e;if(_0x152120[_0xa24c('0x35')]['includeAll']){_0x5e491e['include']=[{'all':!![]}];}return db[_0xa24c('0x2f')][_0xa24c('0x42')](_0x5e491e);})[_0xa24c('0x26')](function(_0x537849){_0xc96ce7['rows']=_0x537849;return _0xc96ce7;})[_0xa24c('0x26')](respondWithFilteredResult(_0x12dbdc,_0x5e491e))[_0xa24c('0x43')](handleError(_0x12dbdc,null));};exports[_0xa24c('0x44')]=function(_0x3ccc37,_0x3f640e){var _0x1b7faf={'raw':!![],'where':{'id':_0x3ccc37[_0xa24c('0x45')]['id']}},_0x23d1e0={};_0x23d1e0['model']=_['keys'](db[_0xa24c('0x2f')][_0xa24c('0x30')]);_0x23d1e0[_0xa24c('0x35')]=_['keys'](_0x3ccc37[_0xa24c('0x35')]);_0x23d1e0[_0xa24c('0x36')]=_[_0xa24c('0x38')](_0x23d1e0[_0xa24c('0x32')],_0x23d1e0[_0xa24c('0x35')]);_0x1b7faf[_0xa24c('0x37')]=_[_0xa24c('0x38')](_0x23d1e0[_0xa24c('0x32')],qs[_0xa24c('0x39')](_0x3ccc37[_0xa24c('0x35')]['fields']));_0x1b7faf[_0xa24c('0x37')]=_0x1b7faf[_0xa24c('0x37')][_0xa24c('0x3a')]?_0x1b7faf['attributes']:_0x23d1e0[_0xa24c('0x32')];if(_0x3ccc37[_0xa24c('0x35')][_0xa24c('0x46')]){_0x1b7faf[_0xa24c('0x47')]=[{'all':!![]}];}_0x1b7faf=_[_0xa24c('0x40')]({},_0x1b7faf,_0x3ccc37[_0xa24c('0x48')]);return db[_0xa24c('0x2f')][_0xa24c('0x49')](_0x1b7faf)[_0xa24c('0x26')](handleEntityNotFound(_0x3f640e,null))[_0xa24c('0x26')](respondWithResult(_0x3f640e,null))[_0xa24c('0x43')](handleError(_0x3f640e,null));};exports['create']=function(_0x29a84d,_0x96b977){return db[_0xa24c('0x2f')][_0xa24c('0x4a')](_0x29a84d[_0xa24c('0x4b')],{})[_0xa24c('0x26')](function(_0x269779){var _0x2250b9=_0x29a84d[_0xa24c('0x4c')]['get']({'plain':!![]});if(!_0x2250b9)throw new Error('Unable\x20to\x20retrieve\x20the\x20current\x20user');if(_0x2250b9[_0xa24c('0x4d')]==='user'){var _0xc078ef=_0x269779[_0xa24c('0x4e')]({'plain':!![]});var _0x4ec677=_0xa24c('0x27');return db[_0xa24c('0x4f')][_0xa24c('0x49')]({'where':{'name':_0x4ec677,'userProfileId':_0x2250b9['userProfileId']},'raw':!![]})['then'](function(_0x87347c){if(_0x87347c&&_0x87347c['autoAssociation']===0x0){return db[_0xa24c('0x28')][_0xa24c('0x4a')]({'name':_0xc078ef[_0xa24c('0x2c')],'resourceId':_0xc078ef['id'],'type':_0x87347c[_0xa24c('0x2c')],'sectionId':_0x87347c['id']},{})[_0xa24c('0x26')](function(){return _0x269779;});}else{return _0x269779;}})[_0xa24c('0x43')](function(_0x3f3ce6){logger[_0xa24c('0x2a')](_0xa24c('0x50'),_0x3f3ce6);throw _0x3f3ce6;});}return _0x269779;})[_0xa24c('0x26')](respondWithResult(_0x96b977,0xc9))['catch'](handleError(_0x96b977,null));};exports[_0xa24c('0x25')]=function(_0x2759c1,_0x233f8e){if(_0x2759c1['body']['id']){delete _0x2759c1['body']['id'];}return db['Disposition'][_0xa24c('0x49')]({'where':{'id':_0x2759c1['params']['id']}})[_0xa24c('0x26')](handleEntityNotFound(_0x233f8e,null))[_0xa24c('0x26')](saveUpdates(_0x2759c1['body'],null))[_0xa24c('0x26')](respondWithResult(_0x233f8e,null))[_0xa24c('0x43')](handleError(_0x233f8e,null));};exports[_0xa24c('0x29')]=function(_0x25bf7e,_0x162a11){return db[_0xa24c('0x2f')][_0xa24c('0x49')]({'where':{'id':_0x25bf7e[_0xa24c('0x45')]['id']}})['then'](handleEntityNotFound(_0x162a11,null))[_0xa24c('0x26')](removeEntity(_0x162a11,null))['catch'](handleError(_0x162a11,null));};
\ No newline at end of file
+var _0x1cc7=['Disposition','fieldName','type','key','model','query','keys','filters','intersection','attributes','hasOwnProperty','order','sort','pick','filter','merge','options','where','count','include','rows','catch','show','rawAttributes','fields','length','includeAll','find','create','body','Unable\x20to\x20retrieve\x20the\x20current\x20user','user','UserProfileSection','userProfileId','autoAssociation','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','destroy','params','html-pdf','eml-format','rimraf','moment','bluebird','mustache','to-csv','lodash','squel','crypto','jsforce','desk.js','querystring','papaparse','ioredis','../../config/logger','api','../../config/utils','../../mysqldb','sendStatus','end','status','offset','limit','set','Content-Range','reject','save','update','then','get','Dispositions','UserProfileResource','error','stack','name','send','index','map'];(function(_0x23c8b3,_0x2868a8){var _0x199d4f=function(_0x299bad){while(--_0x299bad){_0x23c8b3['push'](_0x23c8b3['shift']());}};_0x199d4f(++_0x2868a8);}(_0x1cc7,0x15a));var _0x71cc=function(_0x117c08,_0x133031){_0x117c08=_0x117c08-0x0;var _0x58eb56=_0x1cc7[_0x117c08];return _0x58eb56;};'use strict';var pdf=require(_0x71cc('0x0'));var emlformat=require(_0x71cc('0x1'));var rimraf=require(_0x71cc('0x2'));var zipdir=require('zip-dir');var jsonpatch=require('fast-json-patch');var rp=require('request-promise');var moment=require(_0x71cc('0x3'));var BPromise=require(_0x71cc('0x4'));var Mustache=require(_0x71cc('0x5'));var util=require('util');var path=require('path');var sox=require('sox');var csv=require(_0x71cc('0x6'));var ejs=require('ejs');var fs=require('fs');var _=require(_0x71cc('0x7'));var squel=require(_0x71cc('0x8'));var crypto=require(_0x71cc('0x9'));var jsforce=require(_0x71cc('0xa'));var deskjs=require(_0x71cc('0xb'));var toCsv=require('to-csv');var querystring=require(_0x71cc('0xc'));var Papa=require(_0x71cc('0xd'));var Redis=require(_0x71cc('0xe'));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(_0x71cc('0xf'))(_0x71cc('0x10'));var utils=require(_0x71cc('0x11'));var config=require('../../config/environment');var db=require(_0x71cc('0x12'))['db'];function respondWithStatusCode(_0x550b3c,_0x1aad83){_0x1aad83=_0x1aad83||0xcc;return function(_0x4f9c5c){if(_0x4f9c5c){return _0x550b3c[_0x71cc('0x13')](_0x1aad83);}return _0x550b3c['status'](_0x1aad83)[_0x71cc('0x14')]();};}function respondWithResult(_0x1f478c,_0x3cee23){_0x3cee23=_0x3cee23||0xc8;return function(_0xd16032){if(_0xd16032){return _0x1f478c[_0x71cc('0x15')](_0x3cee23)['json'](_0xd16032);}};}function respondWithFilteredResult(_0x4495fd,_0x292d0c){return function(_0x3b26d1){if(_0x3b26d1){var _0x14d5ab=_0x3b26d1['count'],_0x3875b8=_0x292d0c[_0x71cc('0x16')],_0x14087c=_0x292d0c[_0x71cc('0x16')]+_0x292d0c[_0x71cc('0x17')],_0x1e359d;if(_0x14087c>=_0x14d5ab){_0x14087c=_0x14d5ab;_0x1e359d=0xc8;}else{_0x1e359d=0xce;}_0x4495fd[_0x71cc('0x15')](_0x1e359d);return _0x4495fd[_0x71cc('0x18')](_0x71cc('0x19'),_0x3875b8+'-'+_0x14087c+'/'+_0x14d5ab)['json'](_0x3b26d1);}return null;};}function patchUpdates(_0x366690){return function(_0x71f927){try{jsonpatch['apply'](_0x71f927,_0x366690,!![]);}catch(_0x550ce7){return BPromise[_0x71cc('0x1a')](_0x550ce7);}return _0x71f927[_0x71cc('0x1b')]();};}function saveUpdates(_0x1612f1,_0x11299c){return function(_0x258d30){if(_0x258d30){return _0x258d30[_0x71cc('0x1c')](_0x1612f1)[_0x71cc('0x1d')](function(_0x18683d){return _0x18683d;});}return null;};}function removeEntity(_0x4cfba0,_0x1442ef){return function(_0x109239){if(_0x109239){return _0x109239['destroy']()[_0x71cc('0x1d')](function(){var _0x20328f=_0x109239[_0x71cc('0x1e')]({'plain':!![]});var _0x1a9b4f=_0x71cc('0x1f');return db[_0x71cc('0x20')]['destroy']({'where':{'type':_0x1a9b4f,'resourceId':_0x20328f['id']}})[_0x71cc('0x1d')](function(){return _0x109239;});})[_0x71cc('0x1d')](function(){_0x4cfba0[_0x71cc('0x15')](0xcc)[_0x71cc('0x14')]();});}};}function handleEntityNotFound(_0x36367b,_0x5fa323){return function(_0x27b933){if(!_0x27b933){_0x36367b[_0x71cc('0x13')](0x194);}return _0x27b933;};}function handleError(_0xbce208,_0x4d4529){_0x4d4529=_0x4d4529||0x1f4;return function(_0x26065a){logger[_0x71cc('0x21')](_0x26065a[_0x71cc('0x22')]);if(_0x26065a[_0x71cc('0x23')]){delete _0x26065a[_0x71cc('0x23')];}_0xbce208[_0x71cc('0x15')](_0x4d4529)[_0x71cc('0x24')](_0x26065a);};}exports[_0x71cc('0x25')]=function(_0x3cc813,_0x1fc046){var _0x30f94d={},_0x35f723={},_0x1d5805={'count':0x0,'rows':[]};var _0x2db9c9=_[_0x71cc('0x26')](db[_0x71cc('0x27')]['rawAttributes'],function(_0x3054ff){return{'name':_0x3054ff[_0x71cc('0x28')],'type':_0x3054ff[_0x71cc('0x29')][_0x71cc('0x2a')]};});_0x35f723[_0x71cc('0x2b')]=_[_0x71cc('0x26')](_0x2db9c9,'name');_0x35f723[_0x71cc('0x2c')]=_[_0x71cc('0x2d')](_0x3cc813[_0x71cc('0x2c')]);_0x35f723[_0x71cc('0x2e')]=_[_0x71cc('0x2f')](_0x35f723[_0x71cc('0x2b')],_0x35f723[_0x71cc('0x2c')]);_0x30f94d['attributes']=_[_0x71cc('0x2f')](_0x35f723['model'],qs['fields'](_0x3cc813[_0x71cc('0x2c')]['fields']));_0x30f94d['attributes']=_0x30f94d[_0x71cc('0x30')]['length']?_0x30f94d[_0x71cc('0x30')]:_0x35f723['model'];if(!_0x3cc813[_0x71cc('0x2c')][_0x71cc('0x31')]('nolimit')){_0x30f94d[_0x71cc('0x17')]=qs[_0x71cc('0x17')](_0x3cc813[_0x71cc('0x2c')][_0x71cc('0x17')]);_0x30f94d[_0x71cc('0x16')]=qs[_0x71cc('0x16')](_0x3cc813[_0x71cc('0x2c')][_0x71cc('0x16')]);}_0x30f94d[_0x71cc('0x32')]=qs[_0x71cc('0x33')](_0x3cc813['query'][_0x71cc('0x33')]);_0x30f94d['where']=qs[_0x71cc('0x2e')](_[_0x71cc('0x34')](_0x3cc813[_0x71cc('0x2c')],_0x35f723[_0x71cc('0x2e')]));if(_0x3cc813[_0x71cc('0x2c')][_0x71cc('0x35')]){_0x30f94d['where']=_[_0x71cc('0x36')](_0x30f94d['where'],{'$or':_[_0x71cc('0x26')](_0x2db9c9,function(_0x3da270){if(_0x3da270[_0x71cc('0x29')]!=='VIRTUAL'){var _0x588748={};_0x588748[_0x3da270['name']]={'$like':'%'+_0x3cc813[_0x71cc('0x2c')][_0x71cc('0x35')]+'%'};return _0x588748;}})});}_0x30f94d=_[_0x71cc('0x36')]({},_0x30f94d,_0x3cc813[_0x71cc('0x37')]);var _0x15798b={'where':_0x30f94d[_0x71cc('0x38')]};return db[_0x71cc('0x27')][_0x71cc('0x39')](_0x15798b)[_0x71cc('0x1d')](function(_0x2c6795){_0x1d5805[_0x71cc('0x39')]=_0x2c6795;if(_0x3cc813[_0x71cc('0x2c')]['includeAll']){_0x30f94d[_0x71cc('0x3a')]=[{'all':!![]}];}return db[_0x71cc('0x27')]['findAll'](_0x30f94d);})['then'](function(_0x463cdd){_0x1d5805[_0x71cc('0x3b')]=_0x463cdd;return _0x1d5805;})['then'](respondWithFilteredResult(_0x1fc046,_0x30f94d))[_0x71cc('0x3c')](handleError(_0x1fc046,null));};exports[_0x71cc('0x3d')]=function(_0x2fbe5e,_0x19d7c8){var _0x21ef21={'raw':!![],'where':{'id':_0x2fbe5e['params']['id']}},_0x5b3a38={};_0x5b3a38['model']=_[_0x71cc('0x2d')](db['Disposition'][_0x71cc('0x3e')]);_0x5b3a38[_0x71cc('0x2c')]=_[_0x71cc('0x2d')](_0x2fbe5e[_0x71cc('0x2c')]);_0x5b3a38[_0x71cc('0x2e')]=_[_0x71cc('0x2f')](_0x5b3a38[_0x71cc('0x2b')],_0x5b3a38[_0x71cc('0x2c')]);_0x21ef21[_0x71cc('0x30')]=_[_0x71cc('0x2f')](_0x5b3a38[_0x71cc('0x2b')],qs[_0x71cc('0x3f')](_0x2fbe5e[_0x71cc('0x2c')]['fields']));_0x21ef21[_0x71cc('0x30')]=_0x21ef21[_0x71cc('0x30')][_0x71cc('0x40')]?_0x21ef21['attributes']:_0x5b3a38[_0x71cc('0x2b')];if(_0x2fbe5e[_0x71cc('0x2c')][_0x71cc('0x41')]){_0x21ef21[_0x71cc('0x3a')]=[{'all':!![]}];}_0x21ef21=_[_0x71cc('0x36')]({},_0x21ef21,_0x2fbe5e[_0x71cc('0x37')]);return db[_0x71cc('0x27')][_0x71cc('0x42')](_0x21ef21)[_0x71cc('0x1d')](handleEntityNotFound(_0x19d7c8,null))[_0x71cc('0x1d')](respondWithResult(_0x19d7c8,null))[_0x71cc('0x3c')](handleError(_0x19d7c8,null));};exports[_0x71cc('0x43')]=function(_0x47cefc,_0x36e7e5){return db[_0x71cc('0x27')][_0x71cc('0x43')](_0x47cefc[_0x71cc('0x44')],{})[_0x71cc('0x1d')](function(_0x273ad1){var _0x430387=_0x47cefc['user'][_0x71cc('0x1e')]({'plain':!![]});if(!_0x430387)throw new Error(_0x71cc('0x45'));if(_0x430387['role']===_0x71cc('0x46')){var _0x41ef8d=_0x273ad1[_0x71cc('0x1e')]({'plain':!![]});var _0xe6b3db=_0x71cc('0x1f');return db[_0x71cc('0x47')][_0x71cc('0x42')]({'where':{'name':_0xe6b3db,'userProfileId':_0x430387[_0x71cc('0x48')]},'raw':!![]})[_0x71cc('0x1d')](function(_0x1647ce){if(_0x1647ce&&_0x1647ce[_0x71cc('0x49')]===0x0){return db['UserProfileResource'][_0x71cc('0x43')]({'name':_0x41ef8d['name'],'resourceId':_0x41ef8d['id'],'type':_0x1647ce[_0x71cc('0x23')],'sectionId':_0x1647ce['id']},{})['then'](function(){return _0x273ad1;});}else{return _0x273ad1;}})[_0x71cc('0x3c')](function(_0x36c71e){logger['error'](_0x71cc('0x4a'),_0x36c71e);throw _0x36c71e;});}return _0x273ad1;})[_0x71cc('0x1d')](respondWithResult(_0x36e7e5,0xc9))['catch'](handleError(_0x36e7e5,null));};exports[_0x71cc('0x1c')]=function(_0x1c311b,_0x459c57){if(_0x1c311b[_0x71cc('0x44')]['id']){delete _0x1c311b[_0x71cc('0x44')]['id'];}return db[_0x71cc('0x27')][_0x71cc('0x42')]({'where':{'id':_0x1c311b['params']['id']}})[_0x71cc('0x1d')](handleEntityNotFound(_0x459c57,null))[_0x71cc('0x1d')](saveUpdates(_0x1c311b['body'],null))['then'](respondWithResult(_0x459c57,null))[_0x71cc('0x3c')](handleError(_0x459c57,null));};exports[_0x71cc('0x4b')]=function(_0x4bd393,_0x7a6dcd){return db[_0x71cc('0x27')][_0x71cc('0x42')]({'where':{'id':_0x4bd393[_0x71cc('0x4c')]['id']}})[_0x71cc('0x1d')](handleEntityNotFound(_0x7a6dcd,null))[_0x71cc('0x1d')](removeEntity(_0x7a6dcd,null))['catch'](handleError(_0x7a6dcd,null));};
\ No newline at end of file
diff --git a/server/api/disposition/disposition.model.js b/server/api/disposition/disposition.model.js
index ea5323b..251b1a6 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 _0x313a=['util','../../config/logger','api','moment','bluebird','path','rimraf','../../config/environment','./disposition.attributes','exports','Disposition','tools_dispositions','name_voice','name','ListId','ChatWebsiteId','MailAccountId','name_fax','FaxAccountId','name_openchannel','OpenchannelAccountId','lodash'];(function(_0x564d53,_0x31ac8a){var _0x1ba891=function(_0x51cad3){while(--_0x51cad3){_0x564d53['push'](_0x564d53['shift']());}};_0x1ba891(++_0x31ac8a);}(_0x313a,0xdb));var _0xa313=function(_0x26da89,_0x264785){_0x26da89=_0x26da89-0x0;var _0xc95b7b=_0x313a[_0x26da89];return _0xc95b7b;};'use strict';var _=require(_0xa313('0x0'));var util=require(_0xa313('0x1'));var logger=require(_0xa313('0x2'))(_0xa313('0x3'));var moment=require(_0xa313('0x4'));var BPromise=require(_0xa313('0x5'));var rp=require('request-promise');var fs=require('fs');var path=require(_0xa313('0x6'));var rimraf=require(_0xa313('0x7'));var config=require(_0xa313('0x8'));var attributes=require(_0xa313('0x9'));module[_0xa313('0xa')]=function(_0x40be51,_0xaf2bde){return _0x40be51['define'](_0xa313('0xb'),attributes,{'tableName':_0xa313('0xc'),'paranoid':![],'indexes':[{'unique':!![],'name':_0xa313('0xd'),'fields':[_0xa313('0xe'),_0xa313('0xf')]},{'unique':!![],'name':'name_chat','fields':[_0xa313('0xe'),_0xa313('0x10')]},{'unique':!![],'name':'name_mail','fields':['name',_0xa313('0x11')]},{'unique':!![],'name':'name_sms','fields':[_0xa313('0xe'),'SmsAccountId']},{'unique':!![],'name':_0xa313('0x12'),'fields':[_0xa313('0xe'),_0xa313('0x13')]},{'unique':!![],'name':_0xa313('0x14'),'fields':[_0xa313('0xe'),_0xa313('0x15')]}],'timestamps':!![]});};
\ No newline at end of file
+var _0x6bea=['util','../../config/logger','api','moment','path','rimraf','./disposition.attributes','exports','tools_dispositions','name_voice','name','ChatWebsiteId','name_mail','MailAccountId','name_sms','SmsAccountId','FaxAccountId','name_openchannel','OpenchannelAccountId','lodash'];(function(_0x3947c9,_0x4d6c97){var _0x2e7871=function(_0x1236cc){while(--_0x1236cc){_0x3947c9['push'](_0x3947c9['shift']());}};_0x2e7871(++_0x4d6c97);}(_0x6bea,0xdb));var _0xa6be=function(_0x2a7d74,_0x3460d6){_0x2a7d74=_0x2a7d74-0x0;var _0xcbe8b8=_0x6bea[_0x2a7d74];return _0xcbe8b8;};'use strict';var _=require(_0xa6be('0x0'));var util=require(_0xa6be('0x1'));var logger=require(_0xa6be('0x2'))(_0xa6be('0x3'));var moment=require(_0xa6be('0x4'));var BPromise=require('bluebird');var rp=require('request-promise');var fs=require('fs');var path=require(_0xa6be('0x5'));var rimraf=require(_0xa6be('0x6'));var config=require('../../config/environment');var attributes=require(_0xa6be('0x7'));module[_0xa6be('0x8')]=function(_0x2098d0,_0x3ee085){return _0x2098d0['define']('Disposition',attributes,{'tableName':_0xa6be('0x9'),'paranoid':![],'indexes':[{'unique':!![],'name':_0xa6be('0xa'),'fields':[_0xa6be('0xb'),'ListId']},{'unique':!![],'name':'name_chat','fields':[_0xa6be('0xb'),_0xa6be('0xc')]},{'unique':!![],'name':_0xa6be('0xd'),'fields':['name',_0xa6be('0xe')]},{'unique':!![],'name':_0xa6be('0xf'),'fields':[_0xa6be('0xb'),_0xa6be('0x10')]},{'unique':!![],'name':'name_fax','fields':[_0xa6be('0xb'),_0xa6be('0x11')]},{'unique':!![],'name':_0xa6be('0x12'),'fields':[_0xa6be('0xb'),_0xa6be('0x13')]}],'timestamps':!![]});};
\ No newline at end of file
diff --git a/server/api/disposition/disposition.rpc.js b/server/api/disposition/disposition.rpc.js
index 78ee6d7..466c388 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 _0xbd1c=['result','catch','lodash','util','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','http','then','Disposition,\x20%s,\x20%s','request\x20sent','debug','Disposition,\x20%s,\x20%s,\x20%s','error','code','message','info'];(function(_0x3dd15e,_0x1f0015){var _0x231fd0=function(_0x4f680a){while(--_0x4f680a){_0x3dd15e['push'](_0x3dd15e['shift']());}};_0x231fd0(++_0x1f0015);}(_0xbd1c,0x191));var _0xcbd1=function(_0x36884e,_0x48008f){_0x36884e=_0x36884e-0x0;var _0x1cc367=_0xbd1c[_0x36884e];return _0x1cc367;};'use strict';var _=require(_0xcbd1('0x0'));var util=require(_0xcbd1('0x1'));var moment=require(_0xcbd1('0x2'));var BPromise=require(_0xcbd1('0x3'));var rs=require(_0xcbd1('0x4'));var fs=require('fs');var Redis=require(_0xcbd1('0x5'));var db=require(_0xcbd1('0x6'))['db'];var utils=require(_0xcbd1('0x7'));var logger=require(_0xcbd1('0x8'))('rpc');var config=require('../../config/environment');var jayson=require('jayson/promise');var client=jayson['client'][_0xcbd1('0x9')]({'port':0x232a});function respondWithRpcPromise(_0x3a3c16,_0x317894,_0x3b7512){return new BPromise(function(_0x2da8d0,_0x57435b){return client['request'](_0x3a3c16,_0x3b7512)[_0xcbd1('0xa')](function(_0x3d0c72){logger['info'](_0xcbd1('0xb'),_0x317894,_0xcbd1('0xc'));logger[_0xcbd1('0xd')](_0xcbd1('0xe'),_0x317894,'request\x20sent',JSON['stringify'](_0x3d0c72));if(_0x3d0c72[_0xcbd1('0xf')]){if(_0x3d0c72[_0xcbd1('0xf')][_0xcbd1('0x10')]===0x1f4){logger[_0xcbd1('0xf')](_0xcbd1('0xb'),_0x317894,_0x3d0c72['error'][_0xcbd1('0x11')]);return _0x57435b(_0x3d0c72[_0xcbd1('0xf')][_0xcbd1('0x11')]);}logger[_0xcbd1('0xf')](_0xcbd1('0xb'),_0x317894,_0x3d0c72[_0xcbd1('0xf')][_0xcbd1('0x11')]);return _0x2da8d0(_0x3d0c72['error'][_0xcbd1('0x11')]);}else{logger[_0xcbd1('0x12')](_0xcbd1('0xb'),_0x317894,'request\x20sent');_0x2da8d0(_0x3d0c72[_0xcbd1('0x13')][_0xcbd1('0x11')]);}})[_0xcbd1('0x14')](function(_0x245f4d){logger[_0xcbd1('0xf')](_0xcbd1('0xb'),_0x317894,_0x245f4d);_0x57435b(_0x245f4d);});});}
\ No newline at end of file
+var _0x4766=['result','catch','lodash','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/logger','rpc','client','http','request','then','info','request\x20sent','debug','stringify','error','code','Disposition,\x20%s,\x20%s','message'];(function(_0x43f881,_0xd6e5a2){var _0x365c14=function(_0x50d386){while(--_0x50d386){_0x43f881['push'](_0x43f881['shift']());}};_0x365c14(++_0xd6e5a2);}(_0x4766,0x1e6));var _0x6476=function(_0x438b1f,_0x3db8cb){_0x438b1f=_0x438b1f-0x0;var _0x2783e0=_0x4766[_0x438b1f];return _0x2783e0;};'use strict';var _=require(_0x6476('0x0'));var util=require('util');var moment=require(_0x6476('0x1'));var BPromise=require(_0x6476('0x2'));var rs=require(_0x6476('0x3'));var fs=require('fs');var Redis=require(_0x6476('0x4'));var db=require(_0x6476('0x5'))['db'];var utils=require('../../config/utils');var logger=require(_0x6476('0x6'))(_0x6476('0x7'));var config=require('../../config/environment');var jayson=require('jayson/promise');var client=jayson[_0x6476('0x8')][_0x6476('0x9')]({'port':0x232a});function respondWithRpcPromise(_0x5af6b7,_0x350923,_0xe87dbb){return new BPromise(function(_0x3958f3,_0x99094a){return client[_0x6476('0xa')](_0x5af6b7,_0xe87dbb)[_0x6476('0xb')](function(_0x1c8244){logger[_0x6476('0xc')]('Disposition,\x20%s,\x20%s',_0x350923,_0x6476('0xd'));logger[_0x6476('0xe')]('Disposition,\x20%s,\x20%s,\x20%s',_0x350923,_0x6476('0xd'),JSON[_0x6476('0xf')](_0x1c8244));if(_0x1c8244[_0x6476('0x10')]){if(_0x1c8244['error'][_0x6476('0x11')]===0x1f4){logger[_0x6476('0x10')](_0x6476('0x12'),_0x350923,_0x1c8244['error']['message']);return _0x99094a(_0x1c8244[_0x6476('0x10')][_0x6476('0x13')]);}logger[_0x6476('0x10')](_0x6476('0x12'),_0x350923,_0x1c8244['error'][_0x6476('0x13')]);return _0x3958f3(_0x1c8244[_0x6476('0x10')][_0x6476('0x13')]);}else{logger['info'](_0x6476('0x12'),_0x350923,'request\x20sent');_0x3958f3(_0x1c8244[_0x6476('0x14')][_0x6476('0x13')]);}})[_0x6476('0x15')](function(_0x4de559){logger[_0x6476('0x10')](_0x6476('0x12'),_0x350923,_0x4de559);_0x99094a(_0x4de559);});});}
\ No newline at end of file
diff --git a/server/api/disposition/index.js b/server/api/disposition/index.js
index d607800..ecc9c19 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 _0x689b=['isAuthenticated','/:id','show','post','create','delete','exports','multer','path','Router','../../components/auth/service','../../components/interaction/service','../../config/environment','./disposition.controller','get'];(function(_0x40ac5e,_0x2de228){var _0x2839d6=function(_0x123d47){while(--_0x123d47){_0x40ac5e['push'](_0x40ac5e['shift']());}};_0x2839d6(++_0x2de228);}(_0x689b,0x142));var _0xb689=function(_0x47967e,_0x67a3d7){_0x47967e=_0x47967e-0x0;var _0x301992=_0x689b[_0x47967e];return _0x301992;};'use strict';var multer=require(_0xb689('0x0'));var util=require('util');var path=require(_0xb689('0x1'));var timeout=require('connect-timeout');var express=require('express');var router=express[_0xb689('0x2')]();var auth=require(_0xb689('0x3'));var interaction=require(_0xb689('0x4'));var config=require(_0xb689('0x5'));var controller=require(_0xb689('0x6'));router[_0xb689('0x7')]('/',auth[_0xb689('0x8')](),controller['index']);router[_0xb689('0x7')](_0xb689('0x9'),auth[_0xb689('0x8')](),controller[_0xb689('0xa')]);router[_0xb689('0xb')]('/',auth[_0xb689('0x8')](),controller[_0xb689('0xc')]);router['put'](_0xb689('0x9'),auth['isAuthenticated'](),controller['update']);router[_0xb689('0xd')]('/:id',auth[_0xb689('0x8')](),controller['destroy']);module[_0xb689('0xe')]=router;
\ No newline at end of file
+var _0xfcbb=['util','path','Router','../../components/auth/service','../../components/interaction/service','../../config/environment','./disposition.controller','index','get','/:id','isAuthenticated','show','post','put','delete','destroy','exports','multer'];(function(_0x17d9e3,_0x1f969c){var _0x14192d=function(_0x159745){while(--_0x159745){_0x17d9e3['push'](_0x17d9e3['shift']());}};_0x14192d(++_0x1f969c);}(_0xfcbb,0x10d));var _0xbfcb=function(_0xdad69f,_0xc37952){_0xdad69f=_0xdad69f-0x0;var _0x3c674a=_0xfcbb[_0xdad69f];return _0x3c674a;};'use strict';var multer=require(_0xbfcb('0x0'));var util=require(_0xbfcb('0x1'));var path=require(_0xbfcb('0x2'));var timeout=require('connect-timeout');var express=require('express');var router=express[_0xbfcb('0x3')]();var auth=require(_0xbfcb('0x4'));var interaction=require(_0xbfcb('0x5'));var config=require(_0xbfcb('0x6'));var controller=require(_0xbfcb('0x7'));router['get']('/',auth['isAuthenticated'](),controller[_0xbfcb('0x8')]);router[_0xbfcb('0x9')](_0xbfcb('0xa'),auth[_0xbfcb('0xb')](),controller[_0xbfcb('0xc')]);router[_0xbfcb('0xd')]('/',auth[_0xbfcb('0xb')](),controller['create']);router[_0xbfcb('0xe')](_0xbfcb('0xa'),auth[_0xbfcb('0xb')](),controller['update']);router[_0xbfcb('0xf')](_0xbfcb('0xa'),auth[_0xbfcb('0xb')](),controller[_0xbfcb('0x10')]);module[_0xbfcb('0x11')]=router;
\ No newline at end of file
diff --git a/server/api/faxAccount/faxAccount.attributes.js b/server/api/faxAccount/faxAccount.attributes.js
index 6566565..0471c77 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 _0x1d21=['yes','localstationid','2400','7200','9600','12000','4800','14400','SIP','IAX','DADHI','TEXT','BOOLEAN','INTEGER','Enabled/disables\x20mandatory\x20dispo\x20on\x20a\x20queue','setDataValue','mandatoryDispositionPauseId','mandatoryDisposition','STRING','ENUM'];(function(_0x11c4b6,_0x572fdb){var _0x2cb405=function(_0xf12cc4){while(--_0xf12cc4){_0x11c4b6['push'](_0x11c4b6['shift']());}};_0x2cb405(++_0x572fdb);}(_0x1d21,0x1a2));var _0x11d2=function(_0x213518,_0x51e022){_0x213518=_0x213518-0x0;var _0x1baf75=_0x1d21[_0x213518];return _0x1baf75;};'use strict';var Sequelize=require('sequelize');module['exports']={'name':{'type':Sequelize[_0x11d2('0x0')],'allowNull':![],'validate':{'notEmpty':!![]}},'description':{'type':Sequelize['STRING']},'ecm':{'type':Sequelize[_0x11d2('0x1')](_0x11d2('0x2'),'no'),'defaultValue':_0x11d2('0x2')},'headerinfo':{'type':Sequelize[_0x11d2('0x0')],'defaultValue':'xCALLY\x20Motion\x20Fax'},'localstationid':{'type':Sequelize[_0x11d2('0x0')],'unique':_0x11d2('0x3')},'minrate':{'type':Sequelize[_0x11d2('0x1')](_0x11d2('0x4'),'4800',_0x11d2('0x5'),_0x11d2('0x6'),_0x11d2('0x7'),'14400'),'defaultValue':'4800'},'maxrate':{'type':Sequelize[_0x11d2('0x1')](_0x11d2('0x4'),_0x11d2('0x8'),'7200','9600',_0x11d2('0x7'),'14400'),'defaultValue':_0x11d2('0x9')},'modem':{'type':Sequelize[_0x11d2('0x0')],'defaultValue':'v17,v27,v29'},'gateway':{'type':Sequelize['STRING'],'defaultValue':'no','validate':{'is':/^(?:yes|no|[0-9]+)$/}},'faxdetect':{'type':Sequelize[_0x11d2('0x0')],'defaultValue':'no','validate':{'is':/^(?:yes|no|t38|cng|[0-9]+)$/}},'t38timeout':{'type':Sequelize['INTEGER'],'defaultValue':0x1388,'validate':{'min':0x3e8}},'tech':{'type':Sequelize[_0x11d2('0x1')](_0x11d2('0xa'),_0x11d2('0xb'),_0x11d2('0xc'),'KHOMP'),'defaultValue':_0x11d2('0xa')},'key':{'type':Sequelize[_0x11d2('0x0')],'allowNull':![]},'notificationTemplate':{'type':Sequelize[_0x11d2('0xd')],'defaultValue':function(){return'Account:\x20{{account.name}} {{#queue}}Queue:\x20{{queue.name}} {{/queue}}From\x20:\x20{{from}}';}},'notificationSound':{'type':Sequelize[_0x11d2('0xe')],'defaultValue':!![]},'notificationShake':{'type':Sequelize[_0x11d2('0xe')],'defaultValue':![]},'waitForTheAssignedAgent':{'type':Sequelize[_0x11d2('0xf')],'validate':{'min':0x1,'max':0x20c49b},'defaultValue':0xa},'queueTransfer':{'type':Sequelize[_0x11d2('0xe')],'defaultValue':![]},'queueTransferTimeout':{'type':Sequelize[_0x11d2('0xf')],'validate':{'min':0x1,'max':0x20c49b},'defaultValue':0x12c},'agentTransfer':{'type':Sequelize[_0x11d2('0xe')],'defaultValue':![]},'agentTransferTimeout':{'type':Sequelize[_0x11d2('0xf')],'validate':{'min':0x1,'max':0x20c49b},'defaultValue':0x12c},'mandatoryDispositionPauseId':{'type':Sequelize[_0x11d2('0xf')],'allowNull':!![],'defaultValue':null,'comment':'Status\x20to\x20put\x20when\x20mandatory\x20disposition\x20is\x20enabled'},'mandatoryDisposition':{'type':Sequelize[_0x11d2('0xe')],'defaultValue':![],'comment':_0x11d2('0x10'),'set':function(_0x2f9c9a){if(!_0x2f9c9a)this[_0x11d2('0x11')](_0x11d2('0x12'),null);this[_0x11d2('0x11')](_0x11d2('0x13'),_0x2f9c9a);}}};
\ No newline at end of file
+var _0xe976=['4800','9600','14400','7200','INTEGER','SIP','IAX','DADHI','KHOMP','TEXT','BOOLEAN','Enabled/disables\x20mandatory\x20dispo\x20on\x20a\x20queue','setDataValue','mandatoryDispositionPauseId','mandatoryDisposition','exports','STRING','yes','xCALLY\x20Motion\x20Fax','localstationid','ENUM','2400'];(function(_0x16c55d,_0x4dcb2e){var _0x141783=function(_0x38877e){while(--_0x38877e){_0x16c55d['push'](_0x16c55d['shift']());}};_0x141783(++_0x4dcb2e);}(_0xe976,0x67));var _0x6e97=function(_0x4ca6a4,_0x5e9694){_0x4ca6a4=_0x4ca6a4-0x0;var _0x120555=_0xe976[_0x4ca6a4];return _0x120555;};'use strict';var Sequelize=require('sequelize');module[_0x6e97('0x0')]={'name':{'type':Sequelize[_0x6e97('0x1')],'allowNull':![],'validate':{'notEmpty':!![]}},'description':{'type':Sequelize[_0x6e97('0x1')]},'ecm':{'type':Sequelize['ENUM'](_0x6e97('0x2'),'no'),'defaultValue':_0x6e97('0x2')},'headerinfo':{'type':Sequelize[_0x6e97('0x1')],'defaultValue':_0x6e97('0x3')},'localstationid':{'type':Sequelize[_0x6e97('0x1')],'unique':_0x6e97('0x4')},'minrate':{'type':Sequelize[_0x6e97('0x5')](_0x6e97('0x6'),_0x6e97('0x7'),'7200',_0x6e97('0x8'),'12000',_0x6e97('0x9')),'defaultValue':_0x6e97('0x7')},'maxrate':{'type':Sequelize[_0x6e97('0x5')](_0x6e97('0x6'),'4800',_0x6e97('0xa'),_0x6e97('0x8'),'12000',_0x6e97('0x9')),'defaultValue':_0x6e97('0x9')},'modem':{'type':Sequelize[_0x6e97('0x1')],'defaultValue':'v17,v27,v29'},'gateway':{'type':Sequelize['STRING'],'defaultValue':'no','validate':{'is':/^(?:yes|no|[0-9]+)$/}},'faxdetect':{'type':Sequelize[_0x6e97('0x1')],'defaultValue':'no','validate':{'is':/^(?:yes|no|t38|cng|[0-9]+)$/}},'t38timeout':{'type':Sequelize[_0x6e97('0xb')],'defaultValue':0x1388,'validate':{'min':0x3e8}},'tech':{'type':Sequelize[_0x6e97('0x5')](_0x6e97('0xc'),_0x6e97('0xd'),_0x6e97('0xe'),_0x6e97('0xf')),'defaultValue':_0x6e97('0xc')},'key':{'type':Sequelize[_0x6e97('0x1')],'allowNull':![]},'notificationTemplate':{'type':Sequelize[_0x6e97('0x10')],'defaultValue':function(){return'Account:\x20{{account.name}} {{#queue}}Queue:\x20{{queue.name}} {{/queue}}From\x20:\x20{{from}}';}},'notificationSound':{'type':Sequelize[_0x6e97('0x11')],'defaultValue':!![]},'notificationShake':{'type':Sequelize[_0x6e97('0x11')],'defaultValue':![]},'waitForTheAssignedAgent':{'type':Sequelize[_0x6e97('0xb')],'validate':{'min':0x1,'max':0x20c49b},'defaultValue':0xa},'queueTransfer':{'type':Sequelize[_0x6e97('0x11')],'defaultValue':![]},'queueTransferTimeout':{'type':Sequelize['INTEGER'],'validate':{'min':0x1,'max':0x20c49b},'defaultValue':0x12c},'agentTransfer':{'type':Sequelize[_0x6e97('0x11')],'defaultValue':![]},'agentTransferTimeout':{'type':Sequelize[_0x6e97('0xb')],'validate':{'min':0x1,'max':0x20c49b},'defaultValue':0x12c},'mandatoryDispositionPauseId':{'type':Sequelize['INTEGER'],'allowNull':!![],'defaultValue':null,'comment':'Status\x20to\x20put\x20when\x20mandatory\x20disposition\x20is\x20enabled'},'mandatoryDisposition':{'type':Sequelize[_0x6e97('0x11')],'defaultValue':![],'comment':_0x6e97('0x12'),'set':function(_0x5067fe){if(!_0x5067fe)this[_0x6e97('0x13')](_0x6e97('0x14'),null);this[_0x6e97('0x13')](_0x6e97('0x15'),_0x5067fe);}}};
\ No newline at end of file
diff --git a/server/api/faxAccount/faxAccount.controller.js b/server/api/faxAccount/faxAccount.controller.js
index b0f3f10..fe3342e 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 _0xaba6=['../../components/auth/service','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','../../config/utils','../../config/environment','../../mysqldb','redis','defaults','localhost','./faxAccount.socket','register','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~!@#$%^&-_=+[{]}.','then','request\x20sent','debug','stringify','code','error','FaxAccount,\x20%s,\x20%s','message','info','result','catch','sendStatus','status','end','count','offset','limit','set','Content-Range','json','apply','reject','update','destroy','get','FaxAccounts','UserProfileResource','stack','name','send','index','Pause','mandatoryDispositionPause','map','FaxAccount','rawAttributes','fieldName','model','query','keys','filters','intersection','attributes','fields','length','nolimit','sort','where','pick','filter','type','VIRTUAL','options','includeAll','include','rows','params','merge','find','create','user','Unable\x20to\x20retrieve\x20the\x20current\x20user','UserProfileSection','userProfileId','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','body','describe','addDisposition','FaxAccountId','Disposition','getDispositions','findOne','hasOwnProperty','removeDispositions','ids','addAnswer','CannedAnswer','getAnswers','order','findAll','removeAnswers','addInteraction','getInteractions','FaxInteraction','CmContact','Contact','User','fullname','internal','Tag','Tags','color','tag','sequelize','transaction','FaxApplication','bulkCreate','findAndCountAll','priority','getApplications','context','from-voip-provider','exten','localstationid','system','description','Fax\x20Extension','appdata','push','Answer','Set','ecm','gateway','faxdetect','headerinfo','maxrate','minrate','modem','t38timeout','FAXOPT(','Wait','/var/opt/motion2/server/files/attachments/fax-${CALLERID(num)}-${CUT(UNIQUEID,.,1)}-${CUT(UNIQUEID,.,2)}-${STRFTIME(,,%C%y%m%d%H%M%S)}-rx.tif,d','VoiceExtension','updateAccountApplications','omit','key','createdAt','updatedAt','ListId','findById','getMessages','FaxMessage','$gte','split','YYYY-MM-DD\x20HH:mm:ss','CmList','List','Contacts','DESC','attachments','join','root','server/files/attachments','CheckAfterSend','from','\x22%s\x22\x20<%s>','fax','out','filename','Contact\x20not\x20found','spread','ContactId','Messages','dataValues','SendFax','isNil','SendFaxRpc,\x20%s','addAgents','emit','userFaxAccount:save','removeAgents','isArray','userFaxAccount:remove','getAgents','eml-format','zip-dir','fast-json-patch','request-promise','moment','mustache','util','path','sox','to-csv','ejs','lodash','squel','crypto','desk.js','querystring','papaparse'];(function(_0x156bbe,_0x5357c8){var _0x34919f=function(_0x3f4f41){while(--_0x3f4f41){_0x156bbe['push'](_0x156bbe['shift']());}};_0x34919f(++_0x5357c8);}(_0xaba6,0xb5));var _0x6aba=function(_0x1dac7a,_0x1828ce){_0x1dac7a=_0x1dac7a-0x0;var _0x4cb363=_0xaba6[_0x1dac7a];return _0x4cb363;};'use strict';var pdf=require('html-pdf');var emlformat=require(_0x6aba('0x0'));var rimraf=require('rimraf');var zipdir=require(_0x6aba('0x1'));var jsonpatch=require(_0x6aba('0x2'));var rp=require(_0x6aba('0x3'));var moment=require(_0x6aba('0x4'));var BPromise=require('bluebird');var Mustache=require(_0x6aba('0x5'));var util=require(_0x6aba('0x6'));var path=require(_0x6aba('0x7'));var sox=require(_0x6aba('0x8'));var csv=require(_0x6aba('0x9'));var ejs=require(_0x6aba('0xa'));var fs=require('fs');var _=require(_0x6aba('0xb'));var squel=require(_0x6aba('0xc'));var crypto=require(_0x6aba('0xd'));var jsforce=require('jsforce');var deskjs=require(_0x6aba('0xe'));var toCsv=require(_0x6aba('0x9'));var querystring=require(_0x6aba('0xf'));var Papa=require(_0x6aba('0x10'));var Redis=require('ioredis');var authService=require(_0x6aba('0x11'));var qs=require('../../components/parsers/qs');var as=require(_0x6aba('0x12'));var hardwareService=require(_0x6aba('0x13'));var logger=require(_0x6aba('0x14'))('api');var utils=require(_0x6aba('0x15'));var config=require(_0x6aba('0x16'));var db=require(_0x6aba('0x17'))['db'];config[_0x6aba('0x18')]=_[_0x6aba('0x19')](config['redis'],{'host':_0x6aba('0x1a'),'port':0x18eb});var socket=require('socket.io-emitter')(new Redis(config[_0x6aba('0x18')]));require(_0x6aba('0x1b'))[_0x6aba('0x1c')](socket);var jayson=require('jayson/promise');var client=jayson[_0x6aba('0x1d')][_0x6aba('0x1e')]({'port':0x232c});var client9002=jayson['client']['http']({'port':0x232a});function checkPasswordPattern(_0x232146,_0x21e439,_0x37c307){if(_0x37c307){var _0x4fb1af=new RegExp(/(?=.*[a-z])(?=.*[A-Z])(?=.*[0-9])(?=.*[?!@#\$%\^&\*~\-_=+[{\]\}])(?=.{8,})/);if(_0x4fb1af[_0x6aba('0x1f')](_0x21e439)){return _0x232146;}else{throw new db[(_0x6aba('0x20'))]['ValidationError'](_0x6aba('0x21'));}}else{return _0x232146;}}function respondWithRpcPromise(_0x372efe,_0x1bfd76,_0x32df9c,_0x16d1a1){return new BPromise(function(_0x10ccd1,_0x27212b){var _0x14c2c6=_0x16d1a1||client;return _0x14c2c6['request'](_0x372efe,_0x32df9c)[_0x6aba('0x22')](function(_0x1f0fb8){logger['info']('FaxAccount,\x20%s,\x20%s',_0x1bfd76,_0x6aba('0x23'));logger[_0x6aba('0x24')]('FaxAccount,\x20%s,\x20%s,\x20%s',_0x1bfd76,_0x6aba('0x23'),JSON[_0x6aba('0x25')](_0x1f0fb8));if(_0x1f0fb8['error']){if(_0x1f0fb8['error'][_0x6aba('0x26')]===0x1f4){logger[_0x6aba('0x27')](_0x6aba('0x28'),_0x1bfd76,_0x1f0fb8[_0x6aba('0x27')][_0x6aba('0x29')]);return _0x27212b(_0x1f0fb8[_0x6aba('0x27')][_0x6aba('0x29')]);}logger[_0x6aba('0x27')](_0x6aba('0x28'),_0x1bfd76,_0x1f0fb8[_0x6aba('0x27')][_0x6aba('0x29')]);return _0x10ccd1(_0x1f0fb8['error'][_0x6aba('0x29')]);}else{logger[_0x6aba('0x2a')](_0x6aba('0x28'),_0x1bfd76,'request\x20sent');_0x10ccd1(_0x1f0fb8[_0x6aba('0x2b')][_0x6aba('0x29')]);}})[_0x6aba('0x2c')](function(_0x59cb71){logger[_0x6aba('0x27')]('FaxAccount,\x20%s,\x20%s',_0x1bfd76,_0x59cb71);_0x27212b(_0x59cb71);});});}function respondWithStatusCode(_0x1e0840,_0x20eb60){_0x20eb60=_0x20eb60||0xcc;return function(_0x2c3dda){if(_0x2c3dda){return _0x1e0840[_0x6aba('0x2d')](_0x20eb60);}return _0x1e0840[_0x6aba('0x2e')](_0x20eb60)[_0x6aba('0x2f')]();};}function respondWithResult(_0x28a725,_0x6998ee){_0x6998ee=_0x6998ee||0xc8;return function(_0x30324d){if(_0x30324d){return _0x28a725[_0x6aba('0x2e')](_0x6998ee)['json'](_0x30324d);}};}function respondWithFilteredResult(_0x72beef,_0xbf3409){return function(_0x50dab3){if(_0x50dab3){var _0x17451a=_0x50dab3[_0x6aba('0x30')],_0x339476=_0xbf3409[_0x6aba('0x31')],_0x371836=_0xbf3409[_0x6aba('0x31')]+_0xbf3409[_0x6aba('0x32')],_0x523bc4;if(_0x371836>=_0x17451a){_0x371836=_0x17451a;_0x523bc4=0xc8;}else{_0x523bc4=0xce;}_0x72beef[_0x6aba('0x2e')](_0x523bc4);return _0x72beef[_0x6aba('0x33')](_0x6aba('0x34'),_0x339476+'-'+_0x371836+'/'+_0x17451a)[_0x6aba('0x35')](_0x50dab3);}return null;};}function patchUpdates(_0x3e0fdf){return function(_0x1626ce){try{jsonpatch[_0x6aba('0x36')](_0x1626ce,_0x3e0fdf,!![]);}catch(_0xcb5591){return BPromise[_0x6aba('0x37')](_0xcb5591);}return _0x1626ce['save']();};}function saveUpdates(_0xb46164,_0x4f29a0){return function(_0x5db596){if(_0x5db596){return _0x5db596[_0x6aba('0x38')](_0xb46164)['then'](function(_0x3bb630){return _0x3bb630;});}return null;};}function removeEntity(_0x4ecc5f,_0x2bec59){return function(_0x5a3a32){if(_0x5a3a32){return _0x5a3a32[_0x6aba('0x39')]()[_0x6aba('0x22')](function(){var _0x3aac80=_0x5a3a32[_0x6aba('0x3a')]({'plain':!![]});var _0x4a7b5b=_0x6aba('0x3b');return db[_0x6aba('0x3c')]['destroy']({'where':{'type':_0x4a7b5b,'resourceId':_0x3aac80['id']}})[_0x6aba('0x22')](function(){return _0x5a3a32;});})['then'](function(){_0x4ecc5f[_0x6aba('0x2e')](0xcc)[_0x6aba('0x2f')]();});}};}function handleEntityNotFound(_0x375436,_0x52458d){return function(_0x228db8){if(!_0x228db8){_0x375436[_0x6aba('0x2d')](0x194);}return _0x228db8;};}function handleError(_0x4d8e54,_0x332dd0){_0x332dd0=_0x332dd0||0x1f4;return function(_0x515daf){logger[_0x6aba('0x27')](_0x515daf[_0x6aba('0x3d')]);if(_0x515daf['name']){delete _0x515daf[_0x6aba('0x3e')];}_0x4d8e54[_0x6aba('0x2e')](_0x332dd0)[_0x6aba('0x3f')](_0x515daf);};}exports[_0x6aba('0x40')]=function(_0x2bef48,_0x178a37){var _0x4399b0={'include':[{'model':db[_0x6aba('0x41')],'as':_0x6aba('0x42')}]},_0x3e782b={},_0x29c060={'count':0x0,'rows':[]};var _0x2f1b46=_[_0x6aba('0x43')](db[_0x6aba('0x44')][_0x6aba('0x45')],function(_0x7bc675){return{'name':_0x7bc675[_0x6aba('0x46')],'type':_0x7bc675['type']['key']};});_0x3e782b[_0x6aba('0x47')]=_['map'](_0x2f1b46,_0x6aba('0x3e'));_0x3e782b[_0x6aba('0x48')]=_[_0x6aba('0x49')](_0x2bef48[_0x6aba('0x48')]);_0x3e782b[_0x6aba('0x4a')]=_[_0x6aba('0x4b')](_0x3e782b[_0x6aba('0x47')],_0x3e782b[_0x6aba('0x48')]);_0x4399b0[_0x6aba('0x4c')]=_[_0x6aba('0x4b')](_0x3e782b[_0x6aba('0x47')],qs[_0x6aba('0x4d')](_0x2bef48[_0x6aba('0x48')][_0x6aba('0x4d')]));_0x4399b0['attributes']=_0x4399b0[_0x6aba('0x4c')][_0x6aba('0x4e')]?_0x4399b0['attributes']:_0x3e782b['model'];if(!_0x2bef48[_0x6aba('0x48')]['hasOwnProperty'](_0x6aba('0x4f'))){_0x4399b0[_0x6aba('0x32')]=qs['limit'](_0x2bef48[_0x6aba('0x48')]['limit']);_0x4399b0[_0x6aba('0x31')]=qs['offset'](_0x2bef48[_0x6aba('0x48')][_0x6aba('0x31')]);}_0x4399b0['order']=qs[_0x6aba('0x50')](_0x2bef48['query'][_0x6aba('0x50')]);_0x4399b0[_0x6aba('0x51')]=qs[_0x6aba('0x4a')](_[_0x6aba('0x52')](_0x2bef48['query'],_0x3e782b['filters']));if(_0x2bef48[_0x6aba('0x48')][_0x6aba('0x53')]){_0x4399b0['where']=_['merge'](_0x4399b0[_0x6aba('0x51')],{'$or':_[_0x6aba('0x43')](_0x2f1b46,function(_0x2c554e){if(_0x2c554e[_0x6aba('0x54')]!==_0x6aba('0x55')){var _0x5940c5={};_0x5940c5[_0x2c554e[_0x6aba('0x3e')]]={'$like':'%'+_0x2bef48[_0x6aba('0x48')][_0x6aba('0x53')]+'%'};return _0x5940c5;}})});}_0x4399b0=_['merge']({},_0x4399b0,_0x2bef48[_0x6aba('0x56')]);var _0x47c4a3={'where':_0x4399b0[_0x6aba('0x51')]};return db[_0x6aba('0x44')][_0x6aba('0x30')](_0x47c4a3)[_0x6aba('0x22')](function(_0x542294){_0x29c060[_0x6aba('0x30')]=_0x542294;if(_0x2bef48[_0x6aba('0x48')][_0x6aba('0x57')]){_0x4399b0[_0x6aba('0x58')]=[{'all':!![]}];}return db[_0x6aba('0x44')]['findAll'](_0x4399b0);})[_0x6aba('0x22')](function(_0x2b0762){_0x29c060[_0x6aba('0x59')]=_0x2b0762;return _0x29c060;})[_0x6aba('0x22')](respondWithFilteredResult(_0x178a37,_0x4399b0))[_0x6aba('0x2c')](handleError(_0x178a37,null));};exports['show']=function(_0x51b632,_0x335ae6){var _0x4ab259={'raw':![],'where':{'id':_0x51b632[_0x6aba('0x5a')]['id']},'include':[{'model':db[_0x6aba('0x41')],'as':_0x6aba('0x42')}]},_0x437b82={};_0x437b82[_0x6aba('0x47')]=_[_0x6aba('0x49')](db[_0x6aba('0x44')]['rawAttributes']);_0x437b82[_0x6aba('0x48')]=_[_0x6aba('0x49')](_0x51b632[_0x6aba('0x48')]);_0x437b82[_0x6aba('0x4a')]=_[_0x6aba('0x4b')](_0x437b82[_0x6aba('0x47')],_0x437b82['query']);_0x4ab259[_0x6aba('0x4c')]=_[_0x6aba('0x4b')](_0x437b82[_0x6aba('0x47')],qs[_0x6aba('0x4d')](_0x51b632[_0x6aba('0x48')][_0x6aba('0x4d')]));_0x4ab259['attributes']=_0x4ab259[_0x6aba('0x4c')]['length']?_0x4ab259[_0x6aba('0x4c')]:_0x437b82[_0x6aba('0x47')];if(_0x51b632[_0x6aba('0x48')][_0x6aba('0x57')]){_0x4ab259[_0x6aba('0x58')]=[{'all':!![]}];}_0x4ab259=_[_0x6aba('0x5b')]({},_0x4ab259,_0x51b632[_0x6aba('0x56')]);return db['FaxAccount'][_0x6aba('0x5c')](_0x4ab259)[_0x6aba('0x22')](handleEntityNotFound(_0x335ae6,null))[_0x6aba('0x22')](respondWithResult(_0x335ae6,null))[_0x6aba('0x2c')](handleError(_0x335ae6,null));};exports[_0x6aba('0x5d')]=function(_0x5e4444,_0x1b3ed6){return db[_0x6aba('0x44')][_0x6aba('0x5d')](_0x5e4444['body'],{})['then'](function(_0x2b264c){var _0x3a06ae=_0x5e4444[_0x6aba('0x5e')][_0x6aba('0x3a')]({'plain':!![]});if(!_0x3a06ae)throw new Error(_0x6aba('0x5f'));if(_0x3a06ae['role']===_0x6aba('0x5e')){var _0x3a3ee2=_0x2b264c[_0x6aba('0x3a')]({'plain':!![]});var _0x450038=_0x6aba('0x3b');return db[_0x6aba('0x60')][_0x6aba('0x5c')]({'where':{'name':_0x450038,'userProfileId':_0x3a06ae[_0x6aba('0x61')]},'raw':!![]})['then'](function(_0x9bba2c){if(_0x9bba2c&&_0x9bba2c['autoAssociation']===0x0){return db[_0x6aba('0x3c')]['create']({'name':_0x3a3ee2[_0x6aba('0x3e')],'resourceId':_0x3a3ee2['id'],'type':_0x9bba2c[_0x6aba('0x3e')],'sectionId':_0x9bba2c['id']},{})[_0x6aba('0x22')](function(){return _0x2b264c;});}else{return _0x2b264c;}})['catch'](function(_0x486873){logger['error'](_0x6aba('0x62'),_0x486873);throw _0x486873;});}return _0x2b264c;})[_0x6aba('0x22')](respondWithResult(_0x1b3ed6,0xc9))[_0x6aba('0x2c')](handleError(_0x1b3ed6,null));};exports[_0x6aba('0x38')]=function(_0x1f82c7,_0x3c0a8c){if(_0x1f82c7[_0x6aba('0x63')]['id']){delete _0x1f82c7[_0x6aba('0x63')]['id'];}return db[_0x6aba('0x44')][_0x6aba('0x5c')]({'where':{'id':_0x1f82c7[_0x6aba('0x5a')]['id']},'include':[{'model':db[_0x6aba('0x41')],'as':_0x6aba('0x42')}]})[_0x6aba('0x22')](handleEntityNotFound(_0x3c0a8c,null))['then'](saveUpdates(_0x1f82c7[_0x6aba('0x63')],null))[_0x6aba('0x22')](respondWithResult(_0x3c0a8c,null))[_0x6aba('0x2c')](handleError(_0x3c0a8c,null));};exports[_0x6aba('0x39')]=function(_0x443f26,_0x2b68f5){return db[_0x6aba('0x44')][_0x6aba('0x5c')]({'where':{'id':_0x443f26[_0x6aba('0x5a')]['id']}})['then'](handleEntityNotFound(_0x2b68f5,null))[_0x6aba('0x22')](removeEntity(_0x2b68f5,null))['catch'](handleError(_0x2b68f5,null));};exports[_0x6aba('0x64')]=function(_0x435f28,_0x2a8713){return db[_0x6aba('0x44')][_0x6aba('0x64')]()[_0x6aba('0x22')](respondWithResult(_0x2a8713,null))[_0x6aba('0x2c')](handleError(_0x2a8713,null));};exports[_0x6aba('0x65')]=function(_0x1f1f6f,_0x163c80,_0x407e97){if(_0x1f1f6f['body']['id']){delete _0x1f1f6f[_0x6aba('0x63')]['id'];}return db[_0x6aba('0x44')][_0x6aba('0x5c')]({'where':{'id':_0x1f1f6f['params']['id']}})[_0x6aba('0x22')](handleEntityNotFound(_0x163c80,null))[_0x6aba('0x22')](function(_0x17c43a){if(_0x17c43a){_0x1f1f6f['body'][_0x6aba('0x66')]=_0x17c43a['id'];return db[_0x6aba('0x67')][_0x6aba('0x5d')](_0x1f1f6f[_0x6aba('0x63')]);}})[_0x6aba('0x22')](respondWithResult(_0x163c80,null))[_0x6aba('0x2c')](handleError(_0x163c80,null));};exports[_0x6aba('0x68')]=function(_0x52723b,_0x1509c6,_0x552783){var _0x1696f1={'raw':![],'where':{}};var _0x447f03={};var _0x3d8074={'count':0x0,'rows':[]};return db[_0x6aba('0x44')][_0x6aba('0x69')]({'where':{'id':_0x52723b[_0x6aba('0x5a')]['id']}})['then'](handleEntityNotFound(_0x1509c6,null))[_0x6aba('0x22')](function(_0x2c4858){if(_0x2c4858){_0x447f03[_0x6aba('0x47')]=_[_0x6aba('0x49')](db[_0x6aba('0x67')][_0x6aba('0x45')]);_0x447f03[_0x6aba('0x48')]=_['keys'](_0x52723b[_0x6aba('0x48')]);_0x447f03['filters']=_[_0x6aba('0x4b')](_0x447f03[_0x6aba('0x47')],_0x447f03['query']);_0x1696f1[_0x6aba('0x4c')]=_[_0x6aba('0x4b')](_0x447f03[_0x6aba('0x47')],qs['fields'](_0x52723b[_0x6aba('0x48')][_0x6aba('0x4d')]));_0x1696f1[_0x6aba('0x4c')]=_0x1696f1[_0x6aba('0x4c')]['length']?_0x1696f1['attributes']:_0x447f03[_0x6aba('0x47')];if(!_0x52723b[_0x6aba('0x48')][_0x6aba('0x6a')]('nolimit')){_0x1696f1[_0x6aba('0x32')]=qs[_0x6aba('0x32')](_0x52723b[_0x6aba('0x48')][_0x6aba('0x32')]);_0x1696f1[_0x6aba('0x31')]=qs[_0x6aba('0x31')](_0x52723b[_0x6aba('0x48')][_0x6aba('0x31')]);}_0x1696f1['order']=qs[_0x6aba('0x50')](_0x52723b[_0x6aba('0x48')][_0x6aba('0x50')]);_0x1696f1[_0x6aba('0x51')]=qs[_0x6aba('0x4a')](_['pick'](_0x52723b[_0x6aba('0x48')],_0x447f03[_0x6aba('0x4a')]));_0x1696f1[_0x6aba('0x51')]['FaxAccountId']=_0x2c4858['id'];if(_0x52723b[_0x6aba('0x48')][_0x6aba('0x53')]){_0x1696f1[_0x6aba('0x51')]=_['merge'](_0x1696f1['where'],{'$or':_['map'](_0x1696f1[_0x6aba('0x4c')],function(_0xe02921){var _0x429da4={};_0x429da4[_0xe02921]={'$like':'%'+_0x52723b[_0x6aba('0x48')][_0x6aba('0x53')]+'%'};return _0x429da4;})});}_0x1696f1=_['merge']({},_0x1696f1,_0x52723b[_0x6aba('0x56')]);return db[_0x6aba('0x67')][_0x6aba('0x30')]({'where':_0x1696f1[_0x6aba('0x51')]})[_0x6aba('0x22')](function(_0x575a70){_0x3d8074[_0x6aba('0x30')]=_0x575a70;if(_0x52723b[_0x6aba('0x48')][_0x6aba('0x57')]){_0x1696f1[_0x6aba('0x58')]=[{'all':!![]}];}return db[_0x6aba('0x67')]['findAll'](_0x1696f1);})[_0x6aba('0x22')](function(_0x5a2efd){_0x3d8074[_0x6aba('0x59')]=_0x5a2efd;return _0x3d8074;});}})[_0x6aba('0x22')](respondWithFilteredResult(_0x1509c6,_0x1696f1))[_0x6aba('0x2c')](handleError(_0x1509c6,null));};exports[_0x6aba('0x6b')]=function(_0x3d97c1,_0x3aa51f,_0x38cfd2){return db[_0x6aba('0x44')]['find']({'where':{'id':_0x3d97c1[_0x6aba('0x5a')]['id']}})[_0x6aba('0x22')](handleEntityNotFound(_0x3aa51f,null))['then'](function(_0x55a4f4){if(_0x55a4f4){return _0x55a4f4[_0x6aba('0x6b')](_0x3d97c1[_0x6aba('0x48')][_0x6aba('0x6c')]);}})[_0x6aba('0x22')](respondWithStatusCode(_0x3aa51f,null))[_0x6aba('0x2c')](handleError(_0x3aa51f,null));};exports[_0x6aba('0x6d')]=function(_0x26881e,_0x1a5d0e,_0x298d06){if(_0x26881e[_0x6aba('0x63')]['id']){delete _0x26881e[_0x6aba('0x63')]['id'];}return db[_0x6aba('0x44')]['find']({'where':{'id':_0x26881e[_0x6aba('0x5a')]['id']}})[_0x6aba('0x22')](handleEntityNotFound(_0x1a5d0e,null))[_0x6aba('0x22')](function(_0x3bf47e){if(_0x3bf47e){_0x26881e[_0x6aba('0x63')]['FaxAccountId']=_0x3bf47e['id'];return db[_0x6aba('0x6e')][_0x6aba('0x5d')](_0x26881e[_0x6aba('0x63')]);}})[_0x6aba('0x22')](respondWithResult(_0x1a5d0e,null))[_0x6aba('0x2c')](handleError(_0x1a5d0e,null));};exports[_0x6aba('0x6f')]=function(_0x49ca21,_0x1fa185,_0x465a47){var _0x1a6614={'raw':![],'where':{}};var _0x30310c={};var _0x1cc93d={'count':0x0,'rows':[]};return db[_0x6aba('0x44')][_0x6aba('0x69')]({'where':{'id':_0x49ca21[_0x6aba('0x5a')]['id']}})['then'](handleEntityNotFound(_0x1fa185,null))[_0x6aba('0x22')](function(_0x3171fe){if(_0x3171fe){_0x30310c[_0x6aba('0x47')]=_['keys'](db[_0x6aba('0x6e')][_0x6aba('0x45')]);_0x30310c[_0x6aba('0x48')]=_[_0x6aba('0x49')](_0x49ca21[_0x6aba('0x48')]);_0x30310c[_0x6aba('0x4a')]=_[_0x6aba('0x4b')](_0x30310c[_0x6aba('0x47')],_0x30310c[_0x6aba('0x48')]);_0x1a6614[_0x6aba('0x4c')]=_[_0x6aba('0x4b')](_0x30310c[_0x6aba('0x47')],qs[_0x6aba('0x4d')](_0x49ca21[_0x6aba('0x48')][_0x6aba('0x4d')]));_0x1a6614[_0x6aba('0x4c')]=_0x1a6614['attributes'][_0x6aba('0x4e')]?_0x1a6614['attributes']:_0x30310c[_0x6aba('0x47')];if(!_0x49ca21['query'][_0x6aba('0x6a')](_0x6aba('0x4f'))){_0x1a6614[_0x6aba('0x32')]=qs[_0x6aba('0x32')](_0x49ca21[_0x6aba('0x48')][_0x6aba('0x32')]);_0x1a6614[_0x6aba('0x31')]=qs[_0x6aba('0x31')](_0x49ca21[_0x6aba('0x48')][_0x6aba('0x31')]);}_0x1a6614[_0x6aba('0x70')]=qs[_0x6aba('0x50')](_0x49ca21['query'][_0x6aba('0x50')]);_0x1a6614['where']=qs[_0x6aba('0x4a')](_[_0x6aba('0x52')](_0x49ca21[_0x6aba('0x48')],_0x30310c[_0x6aba('0x4a')]));_0x1a6614['where']['FaxAccountId']=_0x3171fe['id'];if(_0x49ca21['query'][_0x6aba('0x53')]){_0x1a6614[_0x6aba('0x51')]=_[_0x6aba('0x5b')](_0x1a6614[_0x6aba('0x51')],{'$or':_[_0x6aba('0x43')](_0x1a6614[_0x6aba('0x4c')],function(_0x266ae1){var _0x16665d={};_0x16665d[_0x266ae1]={'$like':'%'+_0x49ca21[_0x6aba('0x48')][_0x6aba('0x53')]+'%'};return _0x16665d;})});}_0x1a6614=_[_0x6aba('0x5b')]({},_0x1a6614,_0x49ca21[_0x6aba('0x56')]);return db[_0x6aba('0x6e')][_0x6aba('0x30')]({'where':_0x1a6614[_0x6aba('0x51')]})[_0x6aba('0x22')](function(_0xeb6715){_0x1cc93d[_0x6aba('0x30')]=_0xeb6715;if(_0x49ca21['query']['includeAll']){_0x1a6614[_0x6aba('0x58')]=[{'all':!![]}];}return db[_0x6aba('0x6e')][_0x6aba('0x71')](_0x1a6614);})[_0x6aba('0x22')](function(_0x434bda){_0x1cc93d['rows']=_0x434bda;return _0x1cc93d;});}})[_0x6aba('0x22')](respondWithFilteredResult(_0x1fa185,_0x1a6614))[_0x6aba('0x2c')](handleError(_0x1fa185,null));};exports[_0x6aba('0x72')]=function(_0x2fea26,_0x1e3214,_0xba28c6){return db['FaxAccount'][_0x6aba('0x5c')]({'where':{'id':_0x2fea26['params']['id']}})[_0x6aba('0x22')](handleEntityNotFound(_0x1e3214,null))[_0x6aba('0x22')](function(_0x27dda5){if(_0x27dda5){return _0x27dda5[_0x6aba('0x72')](_0x2fea26[_0x6aba('0x48')][_0x6aba('0x6c')]);}})[_0x6aba('0x22')](respondWithStatusCode(_0x1e3214,null))[_0x6aba('0x2c')](handleError(_0x1e3214,null));};exports[_0x6aba('0x73')]=function(_0x1cfd68,_0x274017,_0x395425){return db['FaxInteraction']['find']({'where':{'id':_0x1cfd68[_0x6aba('0x5a')]['id']}})[_0x6aba('0x22')](handleEntityNotFound(_0x274017,null))[_0x6aba('0x22')](function(_0x2a81d7){if(_0x2a81d7){return _0x2a81d7[_0x6aba('0x73')](_0x1cfd68['body']['ids'],_['omit'](_0x1cfd68[_0x6aba('0x63')],[_0x6aba('0x6c'),'id'])||{});}})['then'](respondWithResult(_0x274017,null))[_0x6aba('0x2c')](handleError(_0x274017,null));};exports[_0x6aba('0x74')]=function(_0x463079,_0x4f2b07,_0x519e8d){var _0x7afe7a={'raw':![],'where':{}};var _0x78dff7={};var _0x484dd1={'count':0x0,'rows':[]};return db['FaxAccount'][_0x6aba('0x69')]({'where':{'id':_0x463079['params']['id']}})[_0x6aba('0x22')](handleEntityNotFound(_0x4f2b07,null))['then'](function(_0x4a0a63){if(_0x4a0a63){_0x78dff7['model']=_['keys'](db[_0x6aba('0x75')][_0x6aba('0x45')]);_0x78dff7[_0x6aba('0x48')]=_[_0x6aba('0x49')](_0x463079[_0x6aba('0x48')]);_0x78dff7[_0x6aba('0x4a')]=_['intersection'](_0x78dff7[_0x6aba('0x47')],_0x78dff7[_0x6aba('0x48')]);_0x7afe7a[_0x6aba('0x4c')]=_['intersection'](_0x78dff7[_0x6aba('0x47')],qs['fields'](_0x463079['query']['fields']));_0x7afe7a[_0x6aba('0x4c')]=_0x7afe7a[_0x6aba('0x4c')][_0x6aba('0x4e')]?_0x7afe7a[_0x6aba('0x4c')]:_0x78dff7[_0x6aba('0x47')];if(!_0x463079[_0x6aba('0x48')]['hasOwnProperty'](_0x6aba('0x4f'))){_0x7afe7a[_0x6aba('0x32')]=qs[_0x6aba('0x32')](_0x463079[_0x6aba('0x48')][_0x6aba('0x32')]);_0x7afe7a['offset']=qs[_0x6aba('0x31')](_0x463079[_0x6aba('0x48')][_0x6aba('0x31')]);}_0x7afe7a[_0x6aba('0x70')]=qs['sort'](_0x463079[_0x6aba('0x48')]['sort']);_0x7afe7a[_0x6aba('0x51')]=qs[_0x6aba('0x4a')](_[_0x6aba('0x52')](_0x463079['query'],_0x78dff7[_0x6aba('0x4a')]));_0x7afe7a[_0x6aba('0x51')][_0x6aba('0x66')]=_0x4a0a63['id'];if(_0x463079[_0x6aba('0x48')][_0x6aba('0x53')]){_0x7afe7a[_0x6aba('0x51')]=_[_0x6aba('0x5b')](_0x7afe7a[_0x6aba('0x51')],{'$or':_[_0x6aba('0x43')](_0x7afe7a[_0x6aba('0x4c')],function(_0x4f80d0){var _0x4ed1f7={};_0x4ed1f7[_0x4f80d0]={'$like':'%'+_0x463079[_0x6aba('0x48')][_0x6aba('0x53')]+'%'};return _0x4ed1f7;})});}_0x7afe7a=_[_0x6aba('0x5b')]({},_0x7afe7a,_0x463079['options']);return db[_0x6aba('0x75')][_0x6aba('0x30')]({'where':_0x7afe7a[_0x6aba('0x51')]})[_0x6aba('0x22')](function(_0x5d0e87){_0x484dd1['count']=_0x5d0e87;if(_0x463079[_0x6aba('0x48')][_0x6aba('0x57')]){_0x7afe7a[_0x6aba('0x58')]=[{'model':db[_0x6aba('0x76')],'as':_0x6aba('0x77'),'required':![]},{'model':db[_0x6aba('0x78')],'as':'Owner','attributes':[_0x6aba('0x3e'),_0x6aba('0x79'),_0x6aba('0x7a')],'required':![]},{'model':db[_0x6aba('0x7b')],'as':_0x6aba('0x7c'),'attributes':['id',_0x6aba('0x3e'),_0x6aba('0x7d')],'where':_0x463079[_0x6aba('0x48')][_0x6aba('0x7e')]?{'id':_0x463079[_0x6aba('0x48')][_0x6aba('0x7e')]}:undefined,'required':_0x463079['query'][_0x6aba('0x7e')]?!![]:![]}];}return db[_0x6aba('0x75')][_0x6aba('0x71')](_0x7afe7a);})[_0x6aba('0x22')](function(_0x1a3e41){_0x484dd1[_0x6aba('0x59')]=_0x1a3e41;return _0x484dd1;});}})[_0x6aba('0x22')](respondWithFilteredResult(_0x4f2b07,_0x7afe7a))[_0x6aba('0x2c')](handleError(_0x4f2b07,null));};exports['addApplications']=function(_0x58ddcd,_0xa93b24,_0x5ebbed){return db[_0x6aba('0x44')][_0x6aba('0x69')]({'where':{'id':_0x58ddcd[_0x6aba('0x5a')]['id']}})[_0x6aba('0x22')](handleEntityNotFound(_0xa93b24,null))[_0x6aba('0x22')](function(_0x382d25){if(_0x382d25){return db[_0x6aba('0x7f')][_0x6aba('0x80')](function(_0x49542d){return db[_0x6aba('0x81')]['destroy']({'where':{'FaxAccountId':_0x58ddcd[_0x6aba('0x5a')]['id']},'transaction':_0x49542d})[_0x6aba('0x22')](function(_0x3c9e51){var _0x124386=_[_0x6aba('0x43')](_0x58ddcd['body'],function(_0x322598){_0x322598['FaxAccountId']=_0x58ddcd[_0x6aba('0x5a')]['id'];return _0x322598;});return db[_0x6aba('0x81')][_0x6aba('0x82')](_0x124386,{'transaction':_0x49542d});});})[_0x6aba('0x22')](function(){return db['FaxApplication'][_0x6aba('0x83')]({'where':{'FaxAccountId':_0x58ddcd[_0x6aba('0x5a')]['id']},'order':_0x6aba('0x84')});});}})['then'](respondWithResult(_0xa93b24,null))[_0x6aba('0x2c')](handleError(_0xa93b24,null));};exports[_0x6aba('0x85')]=function(_0x150c2a,_0x285580,_0x445aa3){var _0x3bdf00={};var _0x4554db={};var _0x2a3bcb;var _0x50f27b;return db[_0x6aba('0x44')]['findOne']({'where':{'id':_0x150c2a[_0x6aba('0x5a')]['id']}})[_0x6aba('0x22')](handleEntityNotFound(_0x285580,null))[_0x6aba('0x22')](function(_0x26baef){if(_0x26baef){_0x2a3bcb=_0x26baef;_0x4554db['model']=_[_0x6aba('0x49')](db['FaxApplication'][_0x6aba('0x45')]);_0x4554db[_0x6aba('0x48')]=_[_0x6aba('0x49')](_0x150c2a[_0x6aba('0x48')]);_0x4554db['filters']=_['intersection'](_0x4554db['model'],_0x4554db[_0x6aba('0x48')]);_0x3bdf00[_0x6aba('0x4c')]=_[_0x6aba('0x4b')](_0x4554db['model'],qs['fields'](_0x150c2a['query'][_0x6aba('0x4d')]));_0x3bdf00[_0x6aba('0x4c')]=_0x3bdf00[_0x6aba('0x4c')][_0x6aba('0x4e')]?_0x3bdf00[_0x6aba('0x4c')]:_0x4554db[_0x6aba('0x47')];_0x3bdf00['order']=qs[_0x6aba('0x50')](_0x150c2a[_0x6aba('0x48')]['sort']);_0x3bdf00[_0x6aba('0x51')]=qs[_0x6aba('0x4a')](_[_0x6aba('0x52')](_0x150c2a[_0x6aba('0x48')],_0x4554db[_0x6aba('0x4a')]));if(_0x150c2a[_0x6aba('0x48')][_0x6aba('0x53')]){_0x3bdf00[_0x6aba('0x51')]=_['merge'](_0x3bdf00[_0x6aba('0x51')],{'$or':_[_0x6aba('0x43')](_0x3bdf00[_0x6aba('0x4c')],function(_0x31668f){var _0x47c4f5={};_0x47c4f5[_0x31668f]={'$like':'%'+_0x150c2a[_0x6aba('0x48')][_0x6aba('0x53')]+'%'};return _0x47c4f5;})});}_0x3bdf00=_[_0x6aba('0x5b')]({},_0x3bdf00,_0x150c2a[_0x6aba('0x56')]);return _0x2a3bcb[_0x6aba('0x85')](_0x3bdf00);}})[_0x6aba('0x22')](function(_0x47df38){if(_0x47df38){_0x50f27b=_0x47df38[_0x6aba('0x4e')];if(!_0x150c2a['query'][_0x6aba('0x6a')](_0x6aba('0x4f'))){_0x3bdf00['limit']=qs[_0x6aba('0x32')](_0x150c2a[_0x6aba('0x48')]['limit']);_0x3bdf00['offset']=qs[_0x6aba('0x31')](_0x150c2a[_0x6aba('0x48')][_0x6aba('0x31')]);}return _0x2a3bcb[_0x6aba('0x85')](_0x3bdf00);}})[_0x6aba('0x22')](function(_0x34f326){if(_0x34f326){return _0x34f326?{'count':_0x50f27b,'rows':_0x34f326}:null;}})[_0x6aba('0x22')](respondWithResult(_0x285580,null))[_0x6aba('0x2c')](handleError(_0x285580,null));};function Extension(_0x8d2bfa,_0x1074fa,_0x1cb807,_0x552a74){this[_0x6aba('0x86')]=_0x6aba('0x87');this[_0x6aba('0x88')]=_0x8d2bfa[_0x6aba('0x89')];this['app']=_0x552a74;this['type']=_0x6aba('0x8a');this[_0x6aba('0x8b')]=_0x6aba('0x8c');this[_0x6aba('0x66')]=_0x8d2bfa['id'];this[_0x6aba('0x84')]=_0x1074fa;this[_0x6aba('0x8d')]=_0x1cb807;}function createExtensionsReciveFax(_0x415ea7){var _0x28562a=0x1;var _0xce2c6d=[];_0xce2c6d[_0x6aba('0x8e')](new Extension(_0x415ea7,_0x28562a,'',_0x6aba('0x8f')));_0x28562a+=0x1;_0xce2c6d['push'](new Extension(_0x415ea7,_0x28562a,'CDR(type)=inbound-fax',_0x6aba('0x90')));_0x28562a+=0x1;for(var _0x3908f4 in _0x415ea7){if(_0x415ea7[_0x6aba('0x6a')](_0x3908f4)&&(_0x3908f4===_0x6aba('0x91')||_0x3908f4===_0x6aba('0x89')||_0x3908f4===_0x6aba('0x92')||_0x3908f4===_0x6aba('0x93')||_0x3908f4===_0x6aba('0x94')||_0x3908f4===_0x6aba('0x95')||_0x3908f4===_0x6aba('0x96')||_0x3908f4===_0x6aba('0x97')||_0x3908f4===_0x6aba('0x98'))){_0xce2c6d[_0x6aba('0x8e')](new Extension(_0x415ea7,_0x28562a,_0x6aba('0x99')+_0x3908f4+')='+_0x415ea7[_0x3908f4],'Set'));_0x28562a+=0x1;}}_0xce2c6d[_0x6aba('0x8e')](new Extension(_0x415ea7,_0x28562a,'6',_0x6aba('0x9a')));_0x28562a+=0x1;_0xce2c6d[_0x6aba('0x8e')](new Extension(_0x415ea7,_0x28562a,_0x6aba('0x9b'),'ReceiveFax'));_0x28562a=0x0;return _0xce2c6d;}exports['addAccountApplications']=function(_0xd1d2b7,_0xdf9f19,_0x4a0921){var _0x286a2a;return db[_0x6aba('0x7f')][_0x6aba('0x80')](function(_0x138a72){return db[_0x6aba('0x44')][_0x6aba('0x5d')](_0xd1d2b7[_0x6aba('0x63')],{'transaction':_0x138a72})[_0x6aba('0x22')](function(_0x6822d5){_0x286a2a=_0x6822d5[_0x6aba('0x3a')]({'plain':!![]});return db[_0x6aba('0x9c')][_0x6aba('0x82')](createExtensionsReciveFax(_0x286a2a),{'transaction':_0x138a72});});})[_0x6aba('0x22')](function(){return _0x286a2a;})[_0x6aba('0x22')](respondWithResult(_0xdf9f19,null))[_0x6aba('0x2c')](handleError(_0xdf9f19,null));};exports[_0x6aba('0x9d')]=function(_0x2fe8e1,_0x4b60e3,_0x5dcc27){var _0x11a3f6;return db[_0x6aba('0x7f')][_0x6aba('0x80')](function(_0x5938ad){return db[_0x6aba('0x44')][_0x6aba('0x38')](_0x2fe8e1['body'],{'where':{'id':_0x2fe8e1['body']['id']},'transaction':_0x5938ad})[_0x6aba('0x22')](function(_0x1380f8){return db['VoiceExtension'][_0x6aba('0x39')]({'where':{'FaxAccountId':_0x2fe8e1[_0x6aba('0x63')]['id']},'transaction':_0x5938ad})[_0x6aba('0x22')](function(_0x39d190){return db[_0x6aba('0x9c')]['bulkCreate'](createExtensionsReciveFax(_[_0x6aba('0x9e')](_0x2fe8e1[_0x6aba('0x63')],['tech',_0x6aba('0x9f'),_0x6aba('0xa0'),_0x6aba('0xa1'),'TrunkId',_0x6aba('0xa2')])),{'transaction':_0x5938ad});});});})['then'](function(){return db[_0x6aba('0x44')][_0x6aba('0xa3')](_0x2fe8e1[_0x6aba('0x63')]['id']);})[_0x6aba('0x22')](respondWithResult(_0x4b60e3,null))[_0x6aba('0x2c')](handleError(_0x4b60e3,null));};exports[_0x6aba('0xa4')]=function(_0x32e1cc,_0x338524,_0x86bfdb){var _0x1c7e60={'raw':!![],'where':{}};var _0x4bfe80={};var _0x1c91c4={'count':0x0,'rows':[]};return db[_0x6aba('0x44')][_0x6aba('0x69')]({'where':{'id':_0x32e1cc[_0x6aba('0x5a')]['id']}})[_0x6aba('0x22')](handleEntityNotFound(_0x338524,null))[_0x6aba('0x22')](function(_0x427fa4){if(_0x427fa4){_0x4bfe80['model']=_[_0x6aba('0x49')](db[_0x6aba('0xa5')][_0x6aba('0x45')]);_0x4bfe80[_0x6aba('0x48')]=_[_0x6aba('0x49')](_0x32e1cc['query']);_0x4bfe80['filters']=_[_0x6aba('0x4b')](_0x4bfe80[_0x6aba('0x47')],_0x4bfe80[_0x6aba('0x48')]);_0x1c7e60[_0x6aba('0x4c')]=_['intersection'](_0x4bfe80[_0x6aba('0x47')],qs['fields'](_0x32e1cc[_0x6aba('0x48')][_0x6aba('0x4d')]));_0x1c7e60[_0x6aba('0x4c')]=_0x1c7e60[_0x6aba('0x4c')][_0x6aba('0x4e')]?_0x1c7e60['attributes']:_0x4bfe80[_0x6aba('0x47')];if(!_0x32e1cc[_0x6aba('0x48')][_0x6aba('0x6a')]('nolimit')){_0x1c7e60[_0x6aba('0x32')]=qs[_0x6aba('0x32')](_0x32e1cc['query'][_0x6aba('0x32')]);_0x1c7e60[_0x6aba('0x31')]=qs[_0x6aba('0x31')](_0x32e1cc['query'][_0x6aba('0x31')]);}_0x1c7e60[_0x6aba('0x70')]=qs[_0x6aba('0x50')](_0x32e1cc[_0x6aba('0x48')]['sort']);_0x1c7e60['where']=qs[_0x6aba('0x4a')](_[_0x6aba('0x52')](_0x32e1cc[_0x6aba('0x48')],_0x4bfe80[_0x6aba('0x4a')]));_0x1c7e60[_0x6aba('0x51')][_0x6aba('0x66')]=_0x427fa4['id'];if(_0x32e1cc['query'][_0x6aba('0x53')]){_0x1c7e60[_0x6aba('0x51')]=_[_0x6aba('0x5b')](_0x1c7e60['where'],{'$or':_['map'](_0x1c7e60[_0x6aba('0x4c')],function(_0x5bcdb8){var _0x46430d={};_0x46430d[_0x5bcdb8]={'$like':'%'+_0x32e1cc[_0x6aba('0x48')][_0x6aba('0x53')]+'%'};return _0x46430d;})});}if(_0x32e1cc[_0x6aba('0x48')][_0x6aba('0xa6')]){var _0x386b62=_0x32e1cc['query'][_0x6aba('0xa6')][_0x6aba('0xa7')](',');var _0x17459d={};_0x17459d[_0x386b62[0x0]]={'$gte':moment(_0x386b62[0x1])['format'](_0x6aba('0xa8'))};_0x1c7e60['where']=_[_0x6aba('0x5b')](_0x1c7e60[_0x6aba('0x51')],_0x17459d);}_0x1c7e60=_[_0x6aba('0x5b')]({},_0x1c7e60,_0x32e1cc[_0x6aba('0x56')]);return db[_0x6aba('0xa5')][_0x6aba('0x30')]({'where':_0x1c7e60[_0x6aba('0x51')]})['then'](function(_0x4d8e08){_0x1c91c4[_0x6aba('0x30')]=_0x4d8e08;if(_0x32e1cc[_0x6aba('0x48')][_0x6aba('0x57')]){_0x1c7e60[_0x6aba('0x58')]=[{'all':!![]}];}return db[_0x6aba('0xa5')][_0x6aba('0x71')](_0x1c7e60);})[_0x6aba('0x22')](function(_0x546e59){_0x1c91c4[_0x6aba('0x59')]=_0x546e59;return _0x1c91c4;});}})[_0x6aba('0x22')](respondWithFilteredResult(_0x338524,_0x1c7e60))[_0x6aba('0x2c')](handleError(_0x338524,null));};exports[_0x6aba('0x3f')]=function(_0x17d671,_0x7f5621,_0x315e51){var _0x348467,_0x415425={},_0xd89390;if(_0x17d671['body']['to']){_0xd89390=_0x17d671[_0x6aba('0x63')]['to'][0x0];}return db[_0x6aba('0x44')]['find']({'where':{'id':_0x17d671[_0x6aba('0x5a')]['id']},'include':[{'model':db[_0x6aba('0xa9')],'as':_0x6aba('0xaa'),'include':[{'model':db[_0x6aba('0x76')],'as':_0x6aba('0xab'),'where':{'fax':_0xd89390},'limit':0x1,'order':[[_0x6aba('0xa1'),_0x6aba('0xac')]]}]}]})[_0x6aba('0x22')](handleEntityNotFound(_0x7f5621,null))[_0x6aba('0x22')](function(_0x17fc30){_0x348467=_0x17fc30;if(_0x17d671[_0x6aba('0x63')][_0x6aba('0xad')]&&_0x17d671[_0x6aba('0x63')]['attachments'][_0x6aba('0x4e')]){for(var _0x663f81=0x0;_0x663f81<_0x17d671[_0x6aba('0x63')]['attachments']['length'];_0x663f81+=0x1){_0x17d671[_0x6aba('0x63')][_0x6aba('0xad')][_0x663f81]={'filename':_0x17d671[_0x6aba('0x63')][_0x6aba('0xad')][_0x663f81][_0x6aba('0x3e')],'id':_0x17d671[_0x6aba('0x63')]['attachments'][_0x663f81]['id'],'path':path[_0x6aba('0xae')](config[_0x6aba('0xaf')],_0x6aba('0xb0'),_0x17d671['body'][_0x6aba('0xad')][_0x663f81]['basename'])};}}return respondWithRpcPromise(_0x6aba('0xb1'),_0x6aba('0xb1'),{'FaxAccountId':_['isNil'](_0x17d671[_0x6aba('0x5a')]['id'])?undefined:_0x17d671[_0x6aba('0x5a')]['id'],'path':_['isNil'](_0x17d671[_0x6aba('0x63')][_0x6aba('0xad')][0x0][_0x6aba('0x7')])?undefined:_0x17d671['body'][_0x6aba('0xad')][0x0][_0x6aba('0x7')],'fax':_['isNil'](_0x17d671[_0x6aba('0x63')]['to'][0x0])?undefined:_0x17d671[_0x6aba('0x63')]['to'][0x0]},client9002);})[_0x6aba('0x22')](function(){if(_0x348467){if(_['isNil'](_0x17d671[_0x6aba('0x63')][_0x6aba('0xb2')])){_0x17d671['body'][_0x6aba('0xb2')]=util['format'](_0x6aba('0xb3'),_0x348467[_0x6aba('0x3e')],_0x348467[_0x6aba('0xb4')]);}if(_0x348467['List']){if(_0x348467[_0x6aba('0xaa')][_0x6aba('0xab')][_0x6aba('0x4e')]){return _0x348467[_0x6aba('0xaa')][_0x6aba('0xab')][0x0];}else{return db[_0x6aba('0x76')][_0x6aba('0x5d')](_[_0x6aba('0x19')](_0x17d671['body'],{'firstName':_0x17d671[_0x6aba('0x63')]['to'][0x0],'phone':_0x17d671['body']['to'][0x0],'fax':_0x17d671[_0x6aba('0x63')]['to'][0x0],'ListId':_0x348467[_0x6aba('0xa2')]}));}}else{throw new Error('List\x20not\x20found');}}else{throw new Error('Send\x20Fax\x20failed');}})[_0x6aba('0x22')](function(_0x3b1ccd){if(_0x3b1ccd){return db[_0x6aba('0x75')][_0x6aba('0x5c')]({'where':{'ContactId':_0x3b1ccd['id'],'closed':![],'FaxAccountId':_0x348467['id']}})[_0x6aba('0x22')](function(_0x4f52f4){if(_0x4f52f4){return[_0x4f52f4,![]];}return db[_0x6aba('0x75')][_0x6aba('0x5d')]({'UserId':_0x17d671[_0x6aba('0x5e')]['id'],'ContactId':_0x3b1ccd['id'],'FaxAccountId':_0x348467['id'],'fax':_0x17d671[_0x6aba('0x63')]['to'][0x0],'firstMsgDirection':_0x6aba('0xb5'),'Messages':[_[_0x6aba('0x5b')](_0x17d671[_0x6aba('0x63')],{'read':![],'body':_0x17d671[_0x6aba('0x63')][_0x6aba('0xad')][0x0][_0x6aba('0xb6')],'FaxAccountId':_0x348467['id'],'UserId':_0x17d671[_0x6aba('0x5e')]['id'],'ContactId':_0x3b1ccd['id'],'AttachmentId':_0x17d671[_0x6aba('0x63')][_0x6aba('0xad')][0x0]['id']})]},{'include':[{'model':db[_0x6aba('0xa5')],'as':'Messages'}]})['then'](function(_0xbcb05){return[_0xbcb05,!![]];});});}else{throw new Error(_0x6aba('0xb7'));}})[_0x6aba('0xb8')](function(_0x5f2689,_0x3dde4a){if(_0x3dde4a){return _0x5f2689;}return db[_0x6aba('0xa5')][_0x6aba('0x5d')]({'direction':_0x6aba('0xb5'),'read':![],'body':_0x17d671[_0x6aba('0x63')][_0x6aba('0xad')][0x0][_0x6aba('0xb6')],'FaxAccountId':_0x348467['id'],'FaxInteractionId':_0x5f2689['id'],'UserId':_0x17d671[_0x6aba('0x5e')]['id'],'ContactId':_0x5f2689[_0x6aba('0xb9')],'AttachmentId':_0x17d671[_0x6aba('0x63')]['attachments'][0x0]['id']})[_0x6aba('0x22')](function(_0x4f1770){_0x5f2689['dataValues'][_0x6aba('0xba')]=[];_0x5f2689[_0x6aba('0xbb')][_0x6aba('0xba')][_0x6aba('0x8e')](_0x4f1770[_0x6aba('0xbb')]);return _0x5f2689;});})[_0x6aba('0x22')](function(_0x2b3000){respondWithRpcPromise(_0x6aba('0xbc'),'SendFax',{'FaxAccountId':_[_0x6aba('0xbd')](_0x17d671[_0x6aba('0x5a')]['id'])?undefined:_0x17d671[_0x6aba('0x5a')]['id'],'path':_['isNil'](_0x17d671[_0x6aba('0x63')][_0x6aba('0xad')][0x0][_0x6aba('0x7')])?undefined:_0x17d671[_0x6aba('0x63')]['attachments'][0x0][_0x6aba('0x7')],'fax':_[_0x6aba('0xbd')](_0x17d671[_0x6aba('0x63')]['to'][0x0])?undefined:_0x17d671[_0x6aba('0x63')]['to'][0x0],'AttachmentId':_0x17d671[_0x6aba('0x63')][_0x6aba('0xad')][0x0]['id']},client9002)['then'](function(_0x37718e){logger[_0x6aba('0x2a')](_0x6aba('0xbe'),_0x37718e);})[_0x6aba('0x2c')](function(_0x54d017){logger[_0x6aba('0x2a')]('SendFaxRpc,\x20%s',_0x54d017);});return _0x2b3000;})[_0x6aba('0x22')](respondWithResult(_0x7f5621,null))[_0x6aba('0x2c')](handleError(_0x7f5621,null));};exports[_0x6aba('0xbf')]=function(_0x4bd99d,_0x1847bc,_0x4356f9){return db[_0x6aba('0x44')]['find']({'where':{'id':_0x4bd99d['params']['id']}})[_0x6aba('0x22')](handleEntityNotFound(_0x1847bc,null))[_0x6aba('0x22')](function(_0x27709a){if(_0x27709a){return _0x27709a[_0x6aba('0xbf')](_0x4bd99d['body'][_0x6aba('0x6c')],_[_0x6aba('0x9e')](_0x4bd99d[_0x6aba('0x63')],[_0x6aba('0x6c'),'id'])||{})[_0x6aba('0xb8')](function(_0x3121af){for(var _0x2f2c3f=0x0;_0x2f2c3f<_0x4bd99d[_0x6aba('0x63')][_0x6aba('0x6c')][_0x6aba('0x4e')];_0x2f2c3f+=0x1){socket[_0x6aba('0xc0')](_0x6aba('0xc1'),{'UserId':_0x4bd99d[_0x6aba('0x63')][_0x6aba('0x6c')][_0x2f2c3f],'FaxAccountId':_0x4bd99d[_0x6aba('0x5a')]['id']});}return _0x3121af;});}})['then'](respondWithResult(_0x1847bc,null))[_0x6aba('0x2c')](handleError(_0x1847bc,null));};exports['removeAgents']=function(_0x50a616,_0x44cb48,_0x123dd4){return db['FaxAccount']['find']({'where':{'id':_0x50a616['params']['id']}})[_0x6aba('0x22')](handleEntityNotFound(_0x44cb48,null))['then'](function(_0x11cb1f){if(_0x11cb1f){return _0x11cb1f[_0x6aba('0xc2')](_0x50a616[_0x6aba('0x48')][_0x6aba('0x6c')])[_0x6aba('0x22')](function(){if(_[_0x6aba('0xc3')](_0x50a616['query']['ids'])){for(var _0x763b70=0x0;_0x763b70<_0x50a616[_0x6aba('0x48')][_0x6aba('0x6c')][_0x6aba('0x4e')];_0x763b70+=0x1){socket[_0x6aba('0xc0')](_0x6aba('0xc4'),{'UserId':Number(_0x50a616[_0x6aba('0x48')][_0x6aba('0x6c')][_0x763b70]),'FaxAccountId':Number(_0x50a616[_0x6aba('0x5a')]['id'])});}}else{socket[_0x6aba('0xc0')](_0x6aba('0xc4'),{'UserId':Number(_0x50a616[_0x6aba('0x48')][_0x6aba('0x6c')]),'FaxAccountId':Number(_0x50a616['params']['id'])});}});}})[_0x6aba('0x22')](respondWithStatusCode(_0x44cb48,null))[_0x6aba('0x2c')](handleError(_0x44cb48,null));};exports[_0x6aba('0xc5')]=function(_0x46641a,_0x1c9132,_0x219af3){var _0x3aff6d={};var _0x46a960={};var _0x1d446e;var _0xf18e27;return db[_0x6aba('0x44')][_0x6aba('0x69')]({'where':{'id':_0x46641a[_0x6aba('0x5a')]['id']}})['then'](handleEntityNotFound(_0x1c9132,null))[_0x6aba('0x22')](function(_0x5616ef){if(_0x5616ef){_0x1d446e=_0x5616ef;_0x46a960[_0x6aba('0x47')]=_[_0x6aba('0x49')](db[_0x6aba('0x78')]['rawAttributes']);_0x46a960[_0x6aba('0x48')]=_[_0x6aba('0x49')](_0x46641a[_0x6aba('0x48')]);_0x46a960[_0x6aba('0x4a')]=_['intersection'](_0x46a960[_0x6aba('0x47')],_0x46a960[_0x6aba('0x48')]);_0x3aff6d[_0x6aba('0x4c')]=_['intersection'](_0x46a960[_0x6aba('0x47')],qs[_0x6aba('0x4d')](_0x46641a[_0x6aba('0x48')][_0x6aba('0x4d')]));_0x3aff6d[_0x6aba('0x4c')]=_0x3aff6d[_0x6aba('0x4c')][_0x6aba('0x4e')]?_0x3aff6d[_0x6aba('0x4c')]:_0x46a960[_0x6aba('0x47')];_0x3aff6d['order']=qs[_0x6aba('0x50')](_0x46641a['query'][_0x6aba('0x50')]);_0x3aff6d[_0x6aba('0x51')]=qs[_0x6aba('0x4a')](_[_0x6aba('0x52')](_0x46641a['query'],_0x46a960[_0x6aba('0x4a')]));if(_0x46641a[_0x6aba('0x48')][_0x6aba('0x53')]){_0x3aff6d[_0x6aba('0x51')]=_[_0x6aba('0x5b')](_0x3aff6d[_0x6aba('0x51')],{'$or':_[_0x6aba('0x43')](_0x3aff6d[_0x6aba('0x4c')],function(_0x2d8567){var _0x5888bd={};_0x5888bd[_0x2d8567]={'$like':'%'+_0x46641a[_0x6aba('0x48')][_0x6aba('0x53')]+'%'};return _0x5888bd;})});}_0x3aff6d=_[_0x6aba('0x5b')]({},_0x3aff6d,_0x46641a[_0x6aba('0x56')]);return _0x1d446e[_0x6aba('0xc5')](_0x3aff6d);}})[_0x6aba('0x22')](function(_0x23ba12){if(_0x23ba12){_0xf18e27=_0x23ba12[_0x6aba('0x4e')];if(!_0x46641a[_0x6aba('0x48')][_0x6aba('0x6a')](_0x6aba('0x4f'))){_0x3aff6d[_0x6aba('0x32')]=qs[_0x6aba('0x32')](_0x46641a[_0x6aba('0x48')]['limit']);_0x3aff6d[_0x6aba('0x31')]=qs[_0x6aba('0x31')](_0x46641a[_0x6aba('0x48')]['offset']);}return _0x1d446e[_0x6aba('0xc5')](_0x3aff6d);}})['then'](function(_0x5bccbf){if(_0x5bccbf){return _0x5bccbf?{'count':_0xf18e27,'rows':_0x5bccbf}:null;}})[_0x6aba('0x22')](respondWithResult(_0x1c9132,null))[_0x6aba('0x2c')](handleError(_0x1c9132,null));};
\ No newline at end of file
+var _0x8dbd=['error','code','message','sendStatus','status','end','json','count','limit','set','apply','reject','save','destroy','get','FaxAccounts','UserProfileResource','stack','name','send','Pause','map','FaxAccount','rawAttributes','fieldName','type','key','query','keys','intersection','model','fields','attributes','hasOwnProperty','nolimit','offset','order','where','filters','pick','filter','merge','options','includeAll','include','findAll','rows','catch','show','params','mandatoryDispositionPause','length','find','body','user','role','UserProfileSection','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','update','addDisposition','FaxAccountId','Disposition','create','getDispositions','addAnswer','CannedAnswer','getAnswers','sort','removeAnswers','ids','addInteraction','omit','getInteractions','findOne','FaxInteraction','Contact','User','Owner','fullname','internal','Tag','Tags','color','tag','addApplications','sequelize','transaction','FaxApplication','getApplications','context','from-voip-provider','localstationid','description','priority','appdata','push','Answer','CDR(type)=inbound-fax','gateway','faxdetect','headerinfo','maxrate','minrate','modem','t38timeout','FAXOPT(','Set','ReceiveFax','VoiceExtension','bulkCreate','updateAccountApplications','tech','createdAt','updatedAt','TrunkId','findById','FaxMessage','$gte','format','YYYY-MM-DD\x20HH:mm:ss','CmList','List','CmContact','Contacts','DESC','attachments','root','server/files/attachments','basename','CheckAfterSend','isNil','from','\x22%s\x22\x20<%s>','fax','ListId','List\x20not\x20found','out','filename','Messages','spread','ContactId','dataValues','SendFax','SendFaxRpc,\x20%s','addAgents','emit','userFaxAccount:save','userFaxAccount:remove','getAgents','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','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','./faxAccount.socket','register','http','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','FaxAccount,\x20%s,\x20%s','request\x20sent','debug','FaxAccount,\x20%s,\x20%s,\x20%s','stringify'];(function(_0x326492,_0x35210c){var _0x647883=function(_0x20dd53){while(--_0x20dd53){_0x326492['push'](_0x326492['shift']());}};_0x647883(++_0x35210c);}(_0x8dbd,0x159));var _0xd8db=function(_0x209263,_0x247f07){_0x209263=_0x209263-0x0;var _0xa8602e=_0x8dbd[_0x209263];return _0xa8602e;};'use strict';var pdf=require(_0xd8db('0x0'));var emlformat=require(_0xd8db('0x1'));var rimraf=require('rimraf');var zipdir=require(_0xd8db('0x2'));var jsonpatch=require(_0xd8db('0x3'));var rp=require(_0xd8db('0x4'));var moment=require(_0xd8db('0x5'));var BPromise=require(_0xd8db('0x6'));var Mustache=require(_0xd8db('0x7'));var util=require(_0xd8db('0x8'));var path=require(_0xd8db('0x9'));var sox=require(_0xd8db('0xa'));var csv=require(_0xd8db('0xb'));var ejs=require(_0xd8db('0xc'));var fs=require('fs');var _=require(_0xd8db('0xd'));var squel=require(_0xd8db('0xe'));var crypto=require(_0xd8db('0xf'));var jsforce=require(_0xd8db('0x10'));var deskjs=require(_0xd8db('0x11'));var toCsv=require(_0xd8db('0xb'));var querystring=require('querystring');var Papa=require(_0xd8db('0x12'));var Redis=require(_0xd8db('0x13'));var authService=require(_0xd8db('0x14'));var qs=require(_0xd8db('0x15'));var as=require(_0xd8db('0x16'));var hardwareService=require(_0xd8db('0x17'));var logger=require(_0xd8db('0x18'))(_0xd8db('0x19'));var utils=require(_0xd8db('0x1a'));var config=require(_0xd8db('0x1b'));var db=require('../../mysqldb')['db'];config[_0xd8db('0x1c')]=_[_0xd8db('0x1d')](config[_0xd8db('0x1c')],{'host':_0xd8db('0x1e'),'port':0x18eb});var socket=require(_0xd8db('0x1f'))(new Redis(config[_0xd8db('0x1c')]));require(_0xd8db('0x20'))[_0xd8db('0x21')](socket);var jayson=require('jayson/promise');var client=jayson['client'][_0xd8db('0x22')]({'port':0x232c});var client9002=jayson[_0xd8db('0x23')]['http']({'port':0x232a});function checkPasswordPattern(_0x221681,_0x2eeed7,_0x54ad20){if(_0x54ad20){var _0x2241b6=new RegExp(/(?=.*[a-z])(?=.*[A-Z])(?=.*[0-9])(?=.*[?!@#\$%\^&\*~\-_=+[{\]\}])(?=.{8,})/);if(_0x2241b6[_0xd8db('0x24')](_0x2eeed7)){return _0x221681;}else{throw new db[(_0xd8db('0x25'))][(_0xd8db('0x26'))](_0xd8db('0x27'));}}else{return _0x221681;}}function respondWithRpcPromise(_0x190ba4,_0x2d0a0c,_0x3177af,_0x29026e){return new BPromise(function(_0x45d00d,_0x235ffc){var _0x533458=_0x29026e||client;return _0x533458['request'](_0x190ba4,_0x3177af)[_0xd8db('0x28')](function(_0x16f30f){logger[_0xd8db('0x29')](_0xd8db('0x2a'),_0x2d0a0c,_0xd8db('0x2b'));logger[_0xd8db('0x2c')](_0xd8db('0x2d'),_0x2d0a0c,_0xd8db('0x2b'),JSON[_0xd8db('0x2e')](_0x16f30f));if(_0x16f30f[_0xd8db('0x2f')]){if(_0x16f30f[_0xd8db('0x2f')][_0xd8db('0x30')]===0x1f4){logger[_0xd8db('0x2f')]('FaxAccount,\x20%s,\x20%s',_0x2d0a0c,_0x16f30f[_0xd8db('0x2f')][_0xd8db('0x31')]);return _0x235ffc(_0x16f30f[_0xd8db('0x2f')][_0xd8db('0x31')]);}logger[_0xd8db('0x2f')]('FaxAccount,\x20%s,\x20%s',_0x2d0a0c,_0x16f30f['error'][_0xd8db('0x31')]);return _0x45d00d(_0x16f30f[_0xd8db('0x2f')][_0xd8db('0x31')]);}else{logger[_0xd8db('0x29')](_0xd8db('0x2a'),_0x2d0a0c,_0xd8db('0x2b'));_0x45d00d(_0x16f30f['result'][_0xd8db('0x31')]);}})['catch'](function(_0x6aed7f){logger[_0xd8db('0x2f')](_0xd8db('0x2a'),_0x2d0a0c,_0x6aed7f);_0x235ffc(_0x6aed7f);});});}function respondWithStatusCode(_0x530704,_0xd6bbbc){_0xd6bbbc=_0xd6bbbc||0xcc;return function(_0x53bf27){if(_0x53bf27){return _0x530704[_0xd8db('0x32')](_0xd6bbbc);}return _0x530704[_0xd8db('0x33')](_0xd6bbbc)[_0xd8db('0x34')]();};}function respondWithResult(_0x45bfbe,_0x1f0e11){_0x1f0e11=_0x1f0e11||0xc8;return function(_0x4a866f){if(_0x4a866f){return _0x45bfbe[_0xd8db('0x33')](_0x1f0e11)[_0xd8db('0x35')](_0x4a866f);}};}function respondWithFilteredResult(_0x4154b6,_0x3d1553){return function(_0x4f0024){if(_0x4f0024){var _0x55355d=_0x4f0024[_0xd8db('0x36')],_0x1ac8d2=_0x3d1553['offset'],_0x51145e=_0x3d1553['offset']+_0x3d1553[_0xd8db('0x37')],_0x300815;if(_0x51145e>=_0x55355d){_0x51145e=_0x55355d;_0x300815=0xc8;}else{_0x300815=0xce;}_0x4154b6[_0xd8db('0x33')](_0x300815);return _0x4154b6[_0xd8db('0x38')]('Content-Range',_0x1ac8d2+'-'+_0x51145e+'/'+_0x55355d)[_0xd8db('0x35')](_0x4f0024);}return null;};}function patchUpdates(_0x24d28f){return function(_0x58ce6d){try{jsonpatch[_0xd8db('0x39')](_0x58ce6d,_0x24d28f,!![]);}catch(_0x44635c){return BPromise[_0xd8db('0x3a')](_0x44635c);}return _0x58ce6d[_0xd8db('0x3b')]();};}function saveUpdates(_0x203505,_0x341083){return function(_0x30e7ad){if(_0x30e7ad){return _0x30e7ad['update'](_0x203505)[_0xd8db('0x28')](function(_0x2fb3b3){return _0x2fb3b3;});}return null;};}function removeEntity(_0x4b09ce,_0x3423de){return function(_0x5b79ed){if(_0x5b79ed){return _0x5b79ed[_0xd8db('0x3c')]()['then'](function(){var _0x437953=_0x5b79ed[_0xd8db('0x3d')]({'plain':!![]});var _0x109588=_0xd8db('0x3e');return db[_0xd8db('0x3f')][_0xd8db('0x3c')]({'where':{'type':_0x109588,'resourceId':_0x437953['id']}})[_0xd8db('0x28')](function(){return _0x5b79ed;});})['then'](function(){_0x4b09ce['status'](0xcc)['end']();});}};}function handleEntityNotFound(_0x1f8cb4,_0x178f92){return function(_0x1a4ac9){if(!_0x1a4ac9){_0x1f8cb4['sendStatus'](0x194);}return _0x1a4ac9;};}function handleError(_0x488795,_0x36f7c0){_0x36f7c0=_0x36f7c0||0x1f4;return function(_0x8cf86){logger[_0xd8db('0x2f')](_0x8cf86[_0xd8db('0x40')]);if(_0x8cf86[_0xd8db('0x41')]){delete _0x8cf86[_0xd8db('0x41')];}_0x488795[_0xd8db('0x33')](_0x36f7c0)[_0xd8db('0x42')](_0x8cf86);};}exports['index']=function(_0x265010,_0x255c8a){var _0x27fd80={'include':[{'model':db[_0xd8db('0x43')],'as':'mandatoryDispositionPause'}]},_0x28b1a7={},_0x3898b4={'count':0x0,'rows':[]};var _0x525cc6=_[_0xd8db('0x44')](db[_0xd8db('0x45')][_0xd8db('0x46')],function(_0x52ef63){return{'name':_0x52ef63[_0xd8db('0x47')],'type':_0x52ef63[_0xd8db('0x48')][_0xd8db('0x49')]};});_0x28b1a7['model']=_[_0xd8db('0x44')](_0x525cc6,_0xd8db('0x41'));_0x28b1a7[_0xd8db('0x4a')]=_[_0xd8db('0x4b')](_0x265010[_0xd8db('0x4a')]);_0x28b1a7['filters']=_[_0xd8db('0x4c')](_0x28b1a7['model'],_0x28b1a7[_0xd8db('0x4a')]);_0x27fd80['attributes']=_['intersection'](_0x28b1a7[_0xd8db('0x4d')],qs['fields'](_0x265010[_0xd8db('0x4a')][_0xd8db('0x4e')]));_0x27fd80[_0xd8db('0x4f')]=_0x27fd80[_0xd8db('0x4f')]['length']?_0x27fd80[_0xd8db('0x4f')]:_0x28b1a7[_0xd8db('0x4d')];if(!_0x265010[_0xd8db('0x4a')][_0xd8db('0x50')](_0xd8db('0x51'))){_0x27fd80[_0xd8db('0x37')]=qs[_0xd8db('0x37')](_0x265010['query'][_0xd8db('0x37')]);_0x27fd80[_0xd8db('0x52')]=qs['offset'](_0x265010[_0xd8db('0x4a')][_0xd8db('0x52')]);}_0x27fd80[_0xd8db('0x53')]=qs['sort'](_0x265010[_0xd8db('0x4a')]['sort']);_0x27fd80[_0xd8db('0x54')]=qs[_0xd8db('0x55')](_[_0xd8db('0x56')](_0x265010[_0xd8db('0x4a')],_0x28b1a7['filters']));if(_0x265010[_0xd8db('0x4a')][_0xd8db('0x57')]){_0x27fd80[_0xd8db('0x54')]=_[_0xd8db('0x58')](_0x27fd80['where'],{'$or':_[_0xd8db('0x44')](_0x525cc6,function(_0x10f700){if(_0x10f700[_0xd8db('0x48')]!=='VIRTUAL'){var _0x5c0932={};_0x5c0932[_0x10f700[_0xd8db('0x41')]]={'$like':'%'+_0x265010[_0xd8db('0x4a')][_0xd8db('0x57')]+'%'};return _0x5c0932;}})});}_0x27fd80=_['merge']({},_0x27fd80,_0x265010[_0xd8db('0x59')]);var _0x57cd75={'where':_0x27fd80['where']};return db[_0xd8db('0x45')]['count'](_0x57cd75)[_0xd8db('0x28')](function(_0x9f8a56){_0x3898b4[_0xd8db('0x36')]=_0x9f8a56;if(_0x265010[_0xd8db('0x4a')][_0xd8db('0x5a')]){_0x27fd80[_0xd8db('0x5b')]=[{'all':!![]}];}return db[_0xd8db('0x45')][_0xd8db('0x5c')](_0x27fd80);})[_0xd8db('0x28')](function(_0x14bef4){_0x3898b4[_0xd8db('0x5d')]=_0x14bef4;return _0x3898b4;})[_0xd8db('0x28')](respondWithFilteredResult(_0x255c8a,_0x27fd80))[_0xd8db('0x5e')](handleError(_0x255c8a,null));};exports[_0xd8db('0x5f')]=function(_0x34b067,_0x59d356){var _0x3bd177={'raw':![],'where':{'id':_0x34b067[_0xd8db('0x60')]['id']},'include':[{'model':db[_0xd8db('0x43')],'as':_0xd8db('0x61')}]},_0x46d54c={};_0x46d54c[_0xd8db('0x4d')]=_[_0xd8db('0x4b')](db['FaxAccount'][_0xd8db('0x46')]);_0x46d54c[_0xd8db('0x4a')]=_[_0xd8db('0x4b')](_0x34b067[_0xd8db('0x4a')]);_0x46d54c['filters']=_[_0xd8db('0x4c')](_0x46d54c['model'],_0x46d54c[_0xd8db('0x4a')]);_0x3bd177[_0xd8db('0x4f')]=_['intersection'](_0x46d54c[_0xd8db('0x4d')],qs[_0xd8db('0x4e')](_0x34b067[_0xd8db('0x4a')][_0xd8db('0x4e')]));_0x3bd177['attributes']=_0x3bd177[_0xd8db('0x4f')][_0xd8db('0x62')]?_0x3bd177[_0xd8db('0x4f')]:_0x46d54c[_0xd8db('0x4d')];if(_0x34b067[_0xd8db('0x4a')][_0xd8db('0x5a')]){_0x3bd177[_0xd8db('0x5b')]=[{'all':!![]}];}_0x3bd177=_[_0xd8db('0x58')]({},_0x3bd177,_0x34b067[_0xd8db('0x59')]);return db[_0xd8db('0x45')][_0xd8db('0x63')](_0x3bd177)[_0xd8db('0x28')](handleEntityNotFound(_0x59d356,null))[_0xd8db('0x28')](respondWithResult(_0x59d356,null))[_0xd8db('0x5e')](handleError(_0x59d356,null));};exports['create']=function(_0x5b52a8,_0x24ace7){return db[_0xd8db('0x45')]['create'](_0x5b52a8[_0xd8db('0x64')],{})[_0xd8db('0x28')](function(_0x271fb9){var _0x6eb76d=_0x5b52a8[_0xd8db('0x65')][_0xd8db('0x3d')]({'plain':!![]});if(!_0x6eb76d)throw new Error('Unable\x20to\x20retrieve\x20the\x20current\x20user');if(_0x6eb76d[_0xd8db('0x66')]===_0xd8db('0x65')){var _0x9f7ac7=_0x271fb9[_0xd8db('0x3d')]({'plain':!![]});var _0x4d4e9a=_0xd8db('0x3e');return db[_0xd8db('0x67')][_0xd8db('0x63')]({'where':{'name':_0x4d4e9a,'userProfileId':_0x6eb76d['userProfileId']},'raw':!![]})[_0xd8db('0x28')](function(_0x6b25f3){if(_0x6b25f3&&_0x6b25f3['autoAssociation']===0x0){return db[_0xd8db('0x3f')]['create']({'name':_0x9f7ac7[_0xd8db('0x41')],'resourceId':_0x9f7ac7['id'],'type':_0x6b25f3[_0xd8db('0x41')],'sectionId':_0x6b25f3['id']},{})[_0xd8db('0x28')](function(){return _0x271fb9;});}else{return _0x271fb9;}})['catch'](function(_0x746ac7){logger[_0xd8db('0x2f')](_0xd8db('0x68'),_0x746ac7);throw _0x746ac7;});}return _0x271fb9;})[_0xd8db('0x28')](respondWithResult(_0x24ace7,0xc9))[_0xd8db('0x5e')](handleError(_0x24ace7,null));};exports[_0xd8db('0x69')]=function(_0x20eaf3,_0x2b5c3c){if(_0x20eaf3['body']['id']){delete _0x20eaf3[_0xd8db('0x64')]['id'];}return db[_0xd8db('0x45')]['find']({'where':{'id':_0x20eaf3[_0xd8db('0x60')]['id']},'include':[{'model':db['Pause'],'as':'mandatoryDispositionPause'}]})['then'](handleEntityNotFound(_0x2b5c3c,null))['then'](saveUpdates(_0x20eaf3['body'],null))[_0xd8db('0x28')](respondWithResult(_0x2b5c3c,null))[_0xd8db('0x5e')](handleError(_0x2b5c3c,null));};exports[_0xd8db('0x3c')]=function(_0x17569b,_0x1c63e4){return db[_0xd8db('0x45')]['find']({'where':{'id':_0x17569b['params']['id']}})[_0xd8db('0x28')](handleEntityNotFound(_0x1c63e4,null))[_0xd8db('0x28')](removeEntity(_0x1c63e4,null))[_0xd8db('0x5e')](handleError(_0x1c63e4,null));};exports['describe']=function(_0x3405e0,_0x56fc1c){return db[_0xd8db('0x45')]['describe']()['then'](respondWithResult(_0x56fc1c,null))[_0xd8db('0x5e')](handleError(_0x56fc1c,null));};exports[_0xd8db('0x6a')]=function(_0x2b96dd,_0x36bf52,_0x41b552){if(_0x2b96dd['body']['id']){delete _0x2b96dd['body']['id'];}return db[_0xd8db('0x45')][_0xd8db('0x63')]({'where':{'id':_0x2b96dd[_0xd8db('0x60')]['id']}})[_0xd8db('0x28')](handleEntityNotFound(_0x36bf52,null))[_0xd8db('0x28')](function(_0xbbeb78){if(_0xbbeb78){_0x2b96dd['body'][_0xd8db('0x6b')]=_0xbbeb78['id'];return db[_0xd8db('0x6c')][_0xd8db('0x6d')](_0x2b96dd[_0xd8db('0x64')]);}})[_0xd8db('0x28')](respondWithResult(_0x36bf52,null))[_0xd8db('0x5e')](handleError(_0x36bf52,null));};exports[_0xd8db('0x6e')]=function(_0x3da02c,_0x4e318e,_0x515d9d){var _0x5831ce={'raw':![],'where':{}};var _0x207dff={};var _0x575440={'count':0x0,'rows':[]};return db['FaxAccount']['findOne']({'where':{'id':_0x3da02c[_0xd8db('0x60')]['id']}})[_0xd8db('0x28')](handleEntityNotFound(_0x4e318e,null))['then'](function(_0x1d4119){if(_0x1d4119){_0x207dff[_0xd8db('0x4d')]=_[_0xd8db('0x4b')](db[_0xd8db('0x6c')]['rawAttributes']);_0x207dff[_0xd8db('0x4a')]=_[_0xd8db('0x4b')](_0x3da02c['query']);_0x207dff[_0xd8db('0x55')]=_['intersection'](_0x207dff[_0xd8db('0x4d')],_0x207dff[_0xd8db('0x4a')]);_0x5831ce[_0xd8db('0x4f')]=_[_0xd8db('0x4c')](_0x207dff['model'],qs[_0xd8db('0x4e')](_0x3da02c[_0xd8db('0x4a')][_0xd8db('0x4e')]));_0x5831ce[_0xd8db('0x4f')]=_0x5831ce[_0xd8db('0x4f')][_0xd8db('0x62')]?_0x5831ce[_0xd8db('0x4f')]:_0x207dff['model'];if(!_0x3da02c['query'][_0xd8db('0x50')](_0xd8db('0x51'))){_0x5831ce['limit']=qs['limit'](_0x3da02c[_0xd8db('0x4a')]['limit']);_0x5831ce['offset']=qs['offset'](_0x3da02c['query']['offset']);}_0x5831ce['order']=qs['sort'](_0x3da02c[_0xd8db('0x4a')]['sort']);_0x5831ce[_0xd8db('0x54')]=qs[_0xd8db('0x55')](_['pick'](_0x3da02c[_0xd8db('0x4a')],_0x207dff[_0xd8db('0x55')]));_0x5831ce[_0xd8db('0x54')][_0xd8db('0x6b')]=_0x1d4119['id'];if(_0x3da02c['query'][_0xd8db('0x57')]){_0x5831ce[_0xd8db('0x54')]=_[_0xd8db('0x58')](_0x5831ce[_0xd8db('0x54')],{'$or':_[_0xd8db('0x44')](_0x5831ce['attributes'],function(_0x4ddb7d){var _0x5f2897={};_0x5f2897[_0x4ddb7d]={'$like':'%'+_0x3da02c[_0xd8db('0x4a')][_0xd8db('0x57')]+'%'};return _0x5f2897;})});}_0x5831ce=_['merge']({},_0x5831ce,_0x3da02c[_0xd8db('0x59')]);return db[_0xd8db('0x6c')][_0xd8db('0x36')]({'where':_0x5831ce[_0xd8db('0x54')]})[_0xd8db('0x28')](function(_0x3b5bfd){_0x575440[_0xd8db('0x36')]=_0x3b5bfd;if(_0x3da02c['query']['includeAll']){_0x5831ce[_0xd8db('0x5b')]=[{'all':!![]}];}return db['Disposition'][_0xd8db('0x5c')](_0x5831ce);})['then'](function(_0x1e74c2){_0x575440['rows']=_0x1e74c2;return _0x575440;});}})[_0xd8db('0x28')](respondWithFilteredResult(_0x4e318e,_0x5831ce))[_0xd8db('0x5e')](handleError(_0x4e318e,null));};exports['removeDispositions']=function(_0x5d2278,_0xce0e98,_0x111248){return db[_0xd8db('0x45')][_0xd8db('0x63')]({'where':{'id':_0x5d2278[_0xd8db('0x60')]['id']}})[_0xd8db('0x28')](handleEntityNotFound(_0xce0e98,null))[_0xd8db('0x28')](function(_0x136259){if(_0x136259){return _0x136259['removeDispositions'](_0x5d2278[_0xd8db('0x4a')]['ids']);}})[_0xd8db('0x28')](respondWithStatusCode(_0xce0e98,null))['catch'](handleError(_0xce0e98,null));};exports[_0xd8db('0x6f')]=function(_0x78d459,_0x50a041,_0x6cd154){if(_0x78d459[_0xd8db('0x64')]['id']){delete _0x78d459[_0xd8db('0x64')]['id'];}return db['FaxAccount'][_0xd8db('0x63')]({'where':{'id':_0x78d459[_0xd8db('0x60')]['id']}})[_0xd8db('0x28')](handleEntityNotFound(_0x50a041,null))[_0xd8db('0x28')](function(_0x373091){if(_0x373091){_0x78d459[_0xd8db('0x64')]['FaxAccountId']=_0x373091['id'];return db[_0xd8db('0x70')][_0xd8db('0x6d')](_0x78d459[_0xd8db('0x64')]);}})[_0xd8db('0x28')](respondWithResult(_0x50a041,null))['catch'](handleError(_0x50a041,null));};exports[_0xd8db('0x71')]=function(_0x20386c,_0xf3dd39,_0x2b9e87){var _0x34c763={'raw':![],'where':{}};var _0x90e9a9={};var _0x10548e={'count':0x0,'rows':[]};return db[_0xd8db('0x45')]['findOne']({'where':{'id':_0x20386c[_0xd8db('0x60')]['id']}})['then'](handleEntityNotFound(_0xf3dd39,null))[_0xd8db('0x28')](function(_0x57c7a3){if(_0x57c7a3){_0x90e9a9['model']=_['keys'](db['CannedAnswer'][_0xd8db('0x46')]);_0x90e9a9[_0xd8db('0x4a')]=_[_0xd8db('0x4b')](_0x20386c[_0xd8db('0x4a')]);_0x90e9a9[_0xd8db('0x55')]=_[_0xd8db('0x4c')](_0x90e9a9['model'],_0x90e9a9[_0xd8db('0x4a')]);_0x34c763['attributes']=_[_0xd8db('0x4c')](_0x90e9a9[_0xd8db('0x4d')],qs[_0xd8db('0x4e')](_0x20386c[_0xd8db('0x4a')][_0xd8db('0x4e')]));_0x34c763['attributes']=_0x34c763['attributes'][_0xd8db('0x62')]?_0x34c763[_0xd8db('0x4f')]:_0x90e9a9['model'];if(!_0x20386c['query']['hasOwnProperty'](_0xd8db('0x51'))){_0x34c763[_0xd8db('0x37')]=qs[_0xd8db('0x37')](_0x20386c['query']['limit']);_0x34c763[_0xd8db('0x52')]=qs[_0xd8db('0x52')](_0x20386c[_0xd8db('0x4a')][_0xd8db('0x52')]);}_0x34c763['order']=qs[_0xd8db('0x72')](_0x20386c[_0xd8db('0x4a')][_0xd8db('0x72')]);_0x34c763[_0xd8db('0x54')]=qs[_0xd8db('0x55')](_[_0xd8db('0x56')](_0x20386c['query'],_0x90e9a9[_0xd8db('0x55')]));_0x34c763['where']['FaxAccountId']=_0x57c7a3['id'];if(_0x20386c[_0xd8db('0x4a')]['filter']){_0x34c763['where']=_[_0xd8db('0x58')](_0x34c763[_0xd8db('0x54')],{'$or':_['map'](_0x34c763[_0xd8db('0x4f')],function(_0x42cc80){var _0x1dc10f={};_0x1dc10f[_0x42cc80]={'$like':'%'+_0x20386c['query'][_0xd8db('0x57')]+'%'};return _0x1dc10f;})});}_0x34c763=_[_0xd8db('0x58')]({},_0x34c763,_0x20386c[_0xd8db('0x59')]);return db[_0xd8db('0x70')]['count']({'where':_0x34c763['where']})[_0xd8db('0x28')](function(_0x203c96){_0x10548e[_0xd8db('0x36')]=_0x203c96;if(_0x20386c[_0xd8db('0x4a')]['includeAll']){_0x34c763[_0xd8db('0x5b')]=[{'all':!![]}];}return db['CannedAnswer'][_0xd8db('0x5c')](_0x34c763);})[_0xd8db('0x28')](function(_0x15a82f){_0x10548e[_0xd8db('0x5d')]=_0x15a82f;return _0x10548e;});}})['then'](respondWithFilteredResult(_0xf3dd39,_0x34c763))[_0xd8db('0x5e')](handleError(_0xf3dd39,null));};exports[_0xd8db('0x73')]=function(_0x59ab3c,_0x4764f9,_0x208550){return db[_0xd8db('0x45')][_0xd8db('0x63')]({'where':{'id':_0x59ab3c[_0xd8db('0x60')]['id']}})['then'](handleEntityNotFound(_0x4764f9,null))[_0xd8db('0x28')](function(_0x4ed091){if(_0x4ed091){return _0x4ed091[_0xd8db('0x73')](_0x59ab3c[_0xd8db('0x4a')][_0xd8db('0x74')]);}})['then'](respondWithStatusCode(_0x4764f9,null))[_0xd8db('0x5e')](handleError(_0x4764f9,null));};exports[_0xd8db('0x75')]=function(_0x409680,_0x39f6ce,_0xee7fa4){return db['FaxInteraction']['find']({'where':{'id':_0x409680[_0xd8db('0x60')]['id']}})[_0xd8db('0x28')](handleEntityNotFound(_0x39f6ce,null))[_0xd8db('0x28')](function(_0x335c00){if(_0x335c00){return _0x335c00[_0xd8db('0x75')](_0x409680['body'][_0xd8db('0x74')],_[_0xd8db('0x76')](_0x409680['body'],[_0xd8db('0x74'),'id'])||{});}})[_0xd8db('0x28')](respondWithResult(_0x39f6ce,null))[_0xd8db('0x5e')](handleError(_0x39f6ce,null));};exports[_0xd8db('0x77')]=function(_0x3f1012,_0x4de4c2,_0x142e82){var _0x7e7fcc={'raw':![],'where':{}};var _0x426794={};var _0x4a6c7d={'count':0x0,'rows':[]};return db[_0xd8db('0x45')][_0xd8db('0x78')]({'where':{'id':_0x3f1012[_0xd8db('0x60')]['id']}})['then'](handleEntityNotFound(_0x4de4c2,null))['then'](function(_0x35da3f){if(_0x35da3f){_0x426794[_0xd8db('0x4d')]=_[_0xd8db('0x4b')](db[_0xd8db('0x79')][_0xd8db('0x46')]);_0x426794[_0xd8db('0x4a')]=_[_0xd8db('0x4b')](_0x3f1012[_0xd8db('0x4a')]);_0x426794[_0xd8db('0x55')]=_[_0xd8db('0x4c')](_0x426794[_0xd8db('0x4d')],_0x426794[_0xd8db('0x4a')]);_0x7e7fcc['attributes']=_[_0xd8db('0x4c')](_0x426794[_0xd8db('0x4d')],qs['fields'](_0x3f1012[_0xd8db('0x4a')]['fields']));_0x7e7fcc[_0xd8db('0x4f')]=_0x7e7fcc[_0xd8db('0x4f')][_0xd8db('0x62')]?_0x7e7fcc[_0xd8db('0x4f')]:_0x426794[_0xd8db('0x4d')];if(!_0x3f1012[_0xd8db('0x4a')][_0xd8db('0x50')](_0xd8db('0x51'))){_0x7e7fcc[_0xd8db('0x37')]=qs['limit'](_0x3f1012[_0xd8db('0x4a')]['limit']);_0x7e7fcc['offset']=qs[_0xd8db('0x52')](_0x3f1012[_0xd8db('0x4a')]['offset']);}_0x7e7fcc['order']=qs[_0xd8db('0x72')](_0x3f1012[_0xd8db('0x4a')][_0xd8db('0x72')]);_0x7e7fcc[_0xd8db('0x54')]=qs[_0xd8db('0x55')](_['pick'](_0x3f1012['query'],_0x426794[_0xd8db('0x55')]));_0x7e7fcc[_0xd8db('0x54')][_0xd8db('0x6b')]=_0x35da3f['id'];if(_0x3f1012[_0xd8db('0x4a')][_0xd8db('0x57')]){_0x7e7fcc[_0xd8db('0x54')]=_[_0xd8db('0x58')](_0x7e7fcc['where'],{'$or':_['map'](_0x7e7fcc[_0xd8db('0x4f')],function(_0x38bd79){var _0x1b885b={};_0x1b885b[_0x38bd79]={'$like':'%'+_0x3f1012[_0xd8db('0x4a')][_0xd8db('0x57')]+'%'};return _0x1b885b;})});}_0x7e7fcc=_[_0xd8db('0x58')]({},_0x7e7fcc,_0x3f1012[_0xd8db('0x59')]);return db[_0xd8db('0x79')][_0xd8db('0x36')]({'where':_0x7e7fcc['where']})[_0xd8db('0x28')](function(_0x32a9bf){_0x4a6c7d['count']=_0x32a9bf;if(_0x3f1012[_0xd8db('0x4a')][_0xd8db('0x5a')]){_0x7e7fcc['include']=[{'model':db['CmContact'],'as':_0xd8db('0x7a'),'required':![]},{'model':db[_0xd8db('0x7b')],'as':_0xd8db('0x7c'),'attributes':[_0xd8db('0x41'),_0xd8db('0x7d'),_0xd8db('0x7e')],'required':![]},{'model':db[_0xd8db('0x7f')],'as':_0xd8db('0x80'),'attributes':['id',_0xd8db('0x41'),_0xd8db('0x81')],'where':_0x3f1012['query'][_0xd8db('0x82')]?{'id':_0x3f1012[_0xd8db('0x4a')][_0xd8db('0x82')]}:undefined,'required':_0x3f1012['query']['tag']?!![]:![]}];}return db[_0xd8db('0x79')]['findAll'](_0x7e7fcc);})[_0xd8db('0x28')](function(_0x2732da){_0x4a6c7d[_0xd8db('0x5d')]=_0x2732da;return _0x4a6c7d;});}})[_0xd8db('0x28')](respondWithFilteredResult(_0x4de4c2,_0x7e7fcc))[_0xd8db('0x5e')](handleError(_0x4de4c2,null));};exports[_0xd8db('0x83')]=function(_0x3b803c,_0xff1405,_0x4aeb3c){return db[_0xd8db('0x45')][_0xd8db('0x78')]({'where':{'id':_0x3b803c[_0xd8db('0x60')]['id']}})[_0xd8db('0x28')](handleEntityNotFound(_0xff1405,null))[_0xd8db('0x28')](function(_0x3a2019){if(_0x3a2019){return db[_0xd8db('0x84')][_0xd8db('0x85')](function(_0x2f0de3){return db[_0xd8db('0x86')]['destroy']({'where':{'FaxAccountId':_0x3b803c[_0xd8db('0x60')]['id']},'transaction':_0x2f0de3})[_0xd8db('0x28')](function(_0xb06e3a){var _0xdd4156=_[_0xd8db('0x44')](_0x3b803c[_0xd8db('0x64')],function(_0x1c969a){_0x1c969a['FaxAccountId']=_0x3b803c[_0xd8db('0x60')]['id'];return _0x1c969a;});return db['FaxApplication']['bulkCreate'](_0xdd4156,{'transaction':_0x2f0de3});});})[_0xd8db('0x28')](function(){return db[_0xd8db('0x86')]['findAndCountAll']({'where':{'FaxAccountId':_0x3b803c[_0xd8db('0x60')]['id']},'order':'priority'});});}})[_0xd8db('0x28')](respondWithResult(_0xff1405,null))[_0xd8db('0x5e')](handleError(_0xff1405,null));};exports[_0xd8db('0x87')]=function(_0x31e523,_0x15300a,_0x1d3e6c){var _0x35d4a0={};var _0x407378={};var _0x31042a;var _0x6b31c9;return db[_0xd8db('0x45')][_0xd8db('0x78')]({'where':{'id':_0x31e523[_0xd8db('0x60')]['id']}})[_0xd8db('0x28')](handleEntityNotFound(_0x15300a,null))[_0xd8db('0x28')](function(_0x8d5568){if(_0x8d5568){_0x31042a=_0x8d5568;_0x407378[_0xd8db('0x4d')]=_[_0xd8db('0x4b')](db['FaxApplication'][_0xd8db('0x46')]);_0x407378['query']=_['keys'](_0x31e523['query']);_0x407378[_0xd8db('0x55')]=_[_0xd8db('0x4c')](_0x407378[_0xd8db('0x4d')],_0x407378[_0xd8db('0x4a')]);_0x35d4a0['attributes']=_[_0xd8db('0x4c')](_0x407378['model'],qs[_0xd8db('0x4e')](_0x31e523['query']['fields']));_0x35d4a0[_0xd8db('0x4f')]=_0x35d4a0['attributes'][_0xd8db('0x62')]?_0x35d4a0[_0xd8db('0x4f')]:_0x407378[_0xd8db('0x4d')];_0x35d4a0['order']=qs[_0xd8db('0x72')](_0x31e523[_0xd8db('0x4a')][_0xd8db('0x72')]);_0x35d4a0['where']=qs[_0xd8db('0x55')](_[_0xd8db('0x56')](_0x31e523[_0xd8db('0x4a')],_0x407378[_0xd8db('0x55')]));if(_0x31e523[_0xd8db('0x4a')][_0xd8db('0x57')]){_0x35d4a0['where']=_[_0xd8db('0x58')](_0x35d4a0[_0xd8db('0x54')],{'$or':_[_0xd8db('0x44')](_0x35d4a0['attributes'],function(_0x45b3f9){var _0x393de4={};_0x393de4[_0x45b3f9]={'$like':'%'+_0x31e523[_0xd8db('0x4a')][_0xd8db('0x57')]+'%'};return _0x393de4;})});}_0x35d4a0=_[_0xd8db('0x58')]({},_0x35d4a0,_0x31e523[_0xd8db('0x59')]);return _0x31042a[_0xd8db('0x87')](_0x35d4a0);}})[_0xd8db('0x28')](function(_0x2e5ea4){if(_0x2e5ea4){_0x6b31c9=_0x2e5ea4[_0xd8db('0x62')];if(!_0x31e523[_0xd8db('0x4a')]['hasOwnProperty'](_0xd8db('0x51'))){_0x35d4a0['limit']=qs[_0xd8db('0x37')](_0x31e523[_0xd8db('0x4a')]['limit']);_0x35d4a0['offset']=qs[_0xd8db('0x52')](_0x31e523[_0xd8db('0x4a')][_0xd8db('0x52')]);}return _0x31042a[_0xd8db('0x87')](_0x35d4a0);}})[_0xd8db('0x28')](function(_0x46d39d){if(_0x46d39d){return _0x46d39d?{'count':_0x6b31c9,'rows':_0x46d39d}:null;}})['then'](respondWithResult(_0x15300a,null))[_0xd8db('0x5e')](handleError(_0x15300a,null));};function Extension(_0x27fcff,_0x478836,_0x20a8e0,_0x1edf32){this[_0xd8db('0x88')]=_0xd8db('0x89');this['exten']=_0x27fcff[_0xd8db('0x8a')];this['app']=_0x1edf32;this['type']='system';this[_0xd8db('0x8b')]='Fax\x20Extension';this[_0xd8db('0x6b')]=_0x27fcff['id'];this[_0xd8db('0x8c')]=_0x478836;this[_0xd8db('0x8d')]=_0x20a8e0;}function createExtensionsReciveFax(_0x12bf87){var _0x2810b2=0x1;var _0x538737=[];_0x538737[_0xd8db('0x8e')](new Extension(_0x12bf87,_0x2810b2,'',_0xd8db('0x8f')));_0x2810b2+=0x1;_0x538737[_0xd8db('0x8e')](new Extension(_0x12bf87,_0x2810b2,_0xd8db('0x90'),'Set'));_0x2810b2+=0x1;for(var _0x2a4dfd in _0x12bf87){if(_0x12bf87[_0xd8db('0x50')](_0x2a4dfd)&&(_0x2a4dfd==='ecm'||_0x2a4dfd===_0xd8db('0x8a')||_0x2a4dfd===_0xd8db('0x91')||_0x2a4dfd===_0xd8db('0x92')||_0x2a4dfd===_0xd8db('0x93')||_0x2a4dfd===_0xd8db('0x94')||_0x2a4dfd===_0xd8db('0x95')||_0x2a4dfd===_0xd8db('0x96')||_0x2a4dfd===_0xd8db('0x97'))){_0x538737[_0xd8db('0x8e')](new Extension(_0x12bf87,_0x2810b2,_0xd8db('0x98')+_0x2a4dfd+')='+_0x12bf87[_0x2a4dfd],_0xd8db('0x99')));_0x2810b2+=0x1;}}_0x538737[_0xd8db('0x8e')](new Extension(_0x12bf87,_0x2810b2,'6','Wait'));_0x2810b2+=0x1;_0x538737[_0xd8db('0x8e')](new Extension(_0x12bf87,_0x2810b2,'/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',_0xd8db('0x9a')));_0x2810b2=0x0;return _0x538737;}exports['addAccountApplications']=function(_0x58c176,_0xf5179e,_0x1dd72f){var _0x1af6d9;return db['sequelize'][_0xd8db('0x85')](function(_0x4900d6){return db['FaxAccount'][_0xd8db('0x6d')](_0x58c176['body'],{'transaction':_0x4900d6})[_0xd8db('0x28')](function(_0x33a62d){_0x1af6d9=_0x33a62d['get']({'plain':!![]});return db[_0xd8db('0x9b')][_0xd8db('0x9c')](createExtensionsReciveFax(_0x1af6d9),{'transaction':_0x4900d6});});})[_0xd8db('0x28')](function(){return _0x1af6d9;})[_0xd8db('0x28')](respondWithResult(_0xf5179e,null))['catch'](handleError(_0xf5179e,null));};exports[_0xd8db('0x9d')]=function(_0x22881f,_0x4b3350,_0x5eb21f){var _0x50eef7;return db[_0xd8db('0x84')][_0xd8db('0x85')](function(_0x2a31c1){return db['FaxAccount'][_0xd8db('0x69')](_0x22881f['body'],{'where':{'id':_0x22881f[_0xd8db('0x64')]['id']},'transaction':_0x2a31c1})[_0xd8db('0x28')](function(_0xcf6d19){return db[_0xd8db('0x9b')][_0xd8db('0x3c')]({'where':{'FaxAccountId':_0x22881f['body']['id']},'transaction':_0x2a31c1})[_0xd8db('0x28')](function(_0x4b99ac){return db[_0xd8db('0x9b')][_0xd8db('0x9c')](createExtensionsReciveFax(_['omit'](_0x22881f['body'],[_0xd8db('0x9e'),_0xd8db('0x49'),_0xd8db('0x9f'),_0xd8db('0xa0'),_0xd8db('0xa1'),'ListId'])),{'transaction':_0x2a31c1});});});})[_0xd8db('0x28')](function(){return db[_0xd8db('0x45')][_0xd8db('0xa2')](_0x22881f[_0xd8db('0x64')]['id']);})[_0xd8db('0x28')](respondWithResult(_0x4b3350,null))[_0xd8db('0x5e')](handleError(_0x4b3350,null));};exports['getMessages']=function(_0x56d3e4,_0x1553b3,_0x197380){var _0x996e40={'raw':!![],'where':{}};var _0x404087={};var _0x9f85cf={'count':0x0,'rows':[]};return db[_0xd8db('0x45')]['findOne']({'where':{'id':_0x56d3e4[_0xd8db('0x60')]['id']}})[_0xd8db('0x28')](handleEntityNotFound(_0x1553b3,null))['then'](function(_0x4cdb49){if(_0x4cdb49){_0x404087[_0xd8db('0x4d')]=_['keys'](db[_0xd8db('0xa3')]['rawAttributes']);_0x404087[_0xd8db('0x4a')]=_[_0xd8db('0x4b')](_0x56d3e4[_0xd8db('0x4a')]);_0x404087[_0xd8db('0x55')]=_[_0xd8db('0x4c')](_0x404087['model'],_0x404087[_0xd8db('0x4a')]);_0x996e40[_0xd8db('0x4f')]=_[_0xd8db('0x4c')](_0x404087[_0xd8db('0x4d')],qs[_0xd8db('0x4e')](_0x56d3e4[_0xd8db('0x4a')]['fields']));_0x996e40[_0xd8db('0x4f')]=_0x996e40['attributes'][_0xd8db('0x62')]?_0x996e40[_0xd8db('0x4f')]:_0x404087[_0xd8db('0x4d')];if(!_0x56d3e4[_0xd8db('0x4a')][_0xd8db('0x50')]('nolimit')){_0x996e40[_0xd8db('0x37')]=qs['limit'](_0x56d3e4[_0xd8db('0x4a')][_0xd8db('0x37')]);_0x996e40[_0xd8db('0x52')]=qs[_0xd8db('0x52')](_0x56d3e4['query']['offset']);}_0x996e40[_0xd8db('0x53')]=qs['sort'](_0x56d3e4[_0xd8db('0x4a')][_0xd8db('0x72')]);_0x996e40[_0xd8db('0x54')]=qs[_0xd8db('0x55')](_[_0xd8db('0x56')](_0x56d3e4['query'],_0x404087[_0xd8db('0x55')]));_0x996e40['where'][_0xd8db('0x6b')]=_0x4cdb49['id'];if(_0x56d3e4[_0xd8db('0x4a')][_0xd8db('0x57')]){_0x996e40[_0xd8db('0x54')]=_[_0xd8db('0x58')](_0x996e40[_0xd8db('0x54')],{'$or':_[_0xd8db('0x44')](_0x996e40[_0xd8db('0x4f')],function(_0x568758){var _0x6b11be={};_0x6b11be[_0x568758]={'$like':'%'+_0x56d3e4['query'][_0xd8db('0x57')]+'%'};return _0x6b11be;})});}if(_0x56d3e4[_0xd8db('0x4a')][_0xd8db('0xa4')]){var _0x1f5365=_0x56d3e4[_0xd8db('0x4a')][_0xd8db('0xa4')]['split'](',');var _0x15f073={};_0x15f073[_0x1f5365[0x0]]={'$gte':moment(_0x1f5365[0x1])[_0xd8db('0xa5')](_0xd8db('0xa6'))};_0x996e40['where']=_[_0xd8db('0x58')](_0x996e40[_0xd8db('0x54')],_0x15f073);}_0x996e40=_[_0xd8db('0x58')]({},_0x996e40,_0x56d3e4[_0xd8db('0x59')]);return db['FaxMessage'][_0xd8db('0x36')]({'where':_0x996e40[_0xd8db('0x54')]})[_0xd8db('0x28')](function(_0xc489cb){_0x9f85cf[_0xd8db('0x36')]=_0xc489cb;if(_0x56d3e4[_0xd8db('0x4a')][_0xd8db('0x5a')]){_0x996e40[_0xd8db('0x5b')]=[{'all':!![]}];}return db[_0xd8db('0xa3')][_0xd8db('0x5c')](_0x996e40);})['then'](function(_0x4204e7){_0x9f85cf['rows']=_0x4204e7;return _0x9f85cf;});}})[_0xd8db('0x28')](respondWithFilteredResult(_0x1553b3,_0x996e40))[_0xd8db('0x5e')](handleError(_0x1553b3,null));};exports[_0xd8db('0x42')]=function(_0x1b250e,_0x2869e5,_0x17760b){var _0x4077a8,_0x4ec3a8={},_0x262810;if(_0x1b250e[_0xd8db('0x64')]['to']){_0x262810=_0x1b250e[_0xd8db('0x64')]['to'][0x0];}return db[_0xd8db('0x45')][_0xd8db('0x63')]({'where':{'id':_0x1b250e[_0xd8db('0x60')]['id']},'include':[{'model':db[_0xd8db('0xa7')],'as':_0xd8db('0xa8'),'include':[{'model':db[_0xd8db('0xa9')],'as':_0xd8db('0xaa'),'where':{'fax':_0x262810},'limit':0x1,'order':[['updatedAt',_0xd8db('0xab')]]}]}]})[_0xd8db('0x28')](handleEntityNotFound(_0x2869e5,null))[_0xd8db('0x28')](function(_0x493eb6){_0x4077a8=_0x493eb6;if(_0x1b250e['body'][_0xd8db('0xac')]&&_0x1b250e[_0xd8db('0x64')]['attachments'][_0xd8db('0x62')]){for(var _0x1176a3=0x0;_0x1176a3<_0x1b250e[_0xd8db('0x64')][_0xd8db('0xac')][_0xd8db('0x62')];_0x1176a3+=0x1){_0x1b250e[_0xd8db('0x64')][_0xd8db('0xac')][_0x1176a3]={'filename':_0x1b250e[_0xd8db('0x64')][_0xd8db('0xac')][_0x1176a3]['name'],'id':_0x1b250e[_0xd8db('0x64')]['attachments'][_0x1176a3]['id'],'path':path['join'](config[_0xd8db('0xad')],_0xd8db('0xae'),_0x1b250e[_0xd8db('0x64')][_0xd8db('0xac')][_0x1176a3][_0xd8db('0xaf')])};}}return respondWithRpcPromise(_0xd8db('0xb0'),_0xd8db('0xb0'),{'FaxAccountId':_['isNil'](_0x1b250e[_0xd8db('0x60')]['id'])?undefined:_0x1b250e[_0xd8db('0x60')]['id'],'path':_['isNil'](_0x1b250e[_0xd8db('0x64')]['attachments'][0x0][_0xd8db('0x9')])?undefined:_0x1b250e[_0xd8db('0x64')][_0xd8db('0xac')][0x0][_0xd8db('0x9')],'fax':_[_0xd8db('0xb1')](_0x1b250e[_0xd8db('0x64')]['to'][0x0])?undefined:_0x1b250e[_0xd8db('0x64')]['to'][0x0]},client9002);})['then'](function(){if(_0x4077a8){if(_['isNil'](_0x1b250e[_0xd8db('0x64')][_0xd8db('0xb2')])){_0x1b250e[_0xd8db('0x64')][_0xd8db('0xb2')]=util[_0xd8db('0xa5')](_0xd8db('0xb3'),_0x4077a8[_0xd8db('0x41')],_0x4077a8[_0xd8db('0xb4')]);}if(_0x4077a8[_0xd8db('0xa8')]){if(_0x4077a8['List'][_0xd8db('0xaa')]['length']){return _0x4077a8['List'][_0xd8db('0xaa')][0x0];}else{return db['CmContact'][_0xd8db('0x6d')](_[_0xd8db('0x1d')](_0x1b250e[_0xd8db('0x64')],{'firstName':_0x1b250e[_0xd8db('0x64')]['to'][0x0],'phone':_0x1b250e['body']['to'][0x0],'fax':_0x1b250e['body']['to'][0x0],'ListId':_0x4077a8[_0xd8db('0xb5')]}));}}else{throw new Error(_0xd8db('0xb6'));}}else{throw new Error('Send\x20Fax\x20failed');}})[_0xd8db('0x28')](function(_0x424ffc){if(_0x424ffc){return db['FaxInteraction']['find']({'where':{'ContactId':_0x424ffc['id'],'closed':![],'FaxAccountId':_0x4077a8['id']}})[_0xd8db('0x28')](function(_0x2bac9d){if(_0x2bac9d){return[_0x2bac9d,![]];}return db[_0xd8db('0x79')][_0xd8db('0x6d')]({'UserId':_0x1b250e[_0xd8db('0x65')]['id'],'ContactId':_0x424ffc['id'],'FaxAccountId':_0x4077a8['id'],'fax':_0x1b250e[_0xd8db('0x64')]['to'][0x0],'firstMsgDirection':_0xd8db('0xb7'),'Messages':[_[_0xd8db('0x58')](_0x1b250e[_0xd8db('0x64')],{'read':![],'body':_0x1b250e[_0xd8db('0x64')][_0xd8db('0xac')][0x0][_0xd8db('0xb8')],'FaxAccountId':_0x4077a8['id'],'UserId':_0x1b250e[_0xd8db('0x65')]['id'],'ContactId':_0x424ffc['id'],'AttachmentId':_0x1b250e[_0xd8db('0x64')][_0xd8db('0xac')][0x0]['id']})]},{'include':[{'model':db['FaxMessage'],'as':_0xd8db('0xb9')}]})[_0xd8db('0x28')](function(_0x337595){return[_0x337595,!![]];});});}else{throw new Error('Contact\x20not\x20found');}})[_0xd8db('0xba')](function(_0x766214,_0x1e12d8){if(_0x1e12d8){return _0x766214;}return db[_0xd8db('0xa3')][_0xd8db('0x6d')]({'direction':_0xd8db('0xb7'),'read':![],'body':_0x1b250e[_0xd8db('0x64')]['attachments'][0x0][_0xd8db('0xb8')],'FaxAccountId':_0x4077a8['id'],'FaxInteractionId':_0x766214['id'],'UserId':_0x1b250e['user']['id'],'ContactId':_0x766214[_0xd8db('0xbb')],'AttachmentId':_0x1b250e['body'][_0xd8db('0xac')][0x0]['id']})[_0xd8db('0x28')](function(_0x58bbea){_0x766214[_0xd8db('0xbc')]['Messages']=[];_0x766214[_0xd8db('0xbc')][_0xd8db('0xb9')][_0xd8db('0x8e')](_0x58bbea['dataValues']);return _0x766214;});})['then'](function(_0x3329fd){respondWithRpcPromise(_0xd8db('0xbd'),_0xd8db('0xbd'),{'FaxAccountId':_['isNil'](_0x1b250e[_0xd8db('0x60')]['id'])?undefined:_0x1b250e['params']['id'],'path':_[_0xd8db('0xb1')](_0x1b250e[_0xd8db('0x64')][_0xd8db('0xac')][0x0][_0xd8db('0x9')])?undefined:_0x1b250e['body'][_0xd8db('0xac')][0x0][_0xd8db('0x9')],'fax':_[_0xd8db('0xb1')](_0x1b250e[_0xd8db('0x64')]['to'][0x0])?undefined:_0x1b250e[_0xd8db('0x64')]['to'][0x0],'AttachmentId':_0x1b250e[_0xd8db('0x64')][_0xd8db('0xac')][0x0]['id']},client9002)[_0xd8db('0x28')](function(_0x29d92c){logger['info'](_0xd8db('0xbe'),_0x29d92c);})[_0xd8db('0x5e')](function(_0x5cadd7){logger[_0xd8db('0x29')]('SendFaxRpc,\x20%s',_0x5cadd7);});return _0x3329fd;})['then'](respondWithResult(_0x2869e5,null))[_0xd8db('0x5e')](handleError(_0x2869e5,null));};exports[_0xd8db('0xbf')]=function(_0x116eac,_0x4c7071,_0x5289e7){return db[_0xd8db('0x45')]['find']({'where':{'id':_0x116eac[_0xd8db('0x60')]['id']}})[_0xd8db('0x28')](handleEntityNotFound(_0x4c7071,null))['then'](function(_0x353b94){if(_0x353b94){return _0x353b94[_0xd8db('0xbf')](_0x116eac[_0xd8db('0x64')][_0xd8db('0x74')],_['omit'](_0x116eac[_0xd8db('0x64')],['ids','id'])||{})[_0xd8db('0xba')](function(_0x5643e7){for(var _0x1e3b27=0x0;_0x1e3b27<_0x116eac['body']['ids']['length'];_0x1e3b27+=0x1){socket[_0xd8db('0xc0')](_0xd8db('0xc1'),{'UserId':_0x116eac[_0xd8db('0x64')][_0xd8db('0x74')][_0x1e3b27],'FaxAccountId':_0x116eac['params']['id']});}return _0x5643e7;});}})['then'](respondWithResult(_0x4c7071,null))['catch'](handleError(_0x4c7071,null));};exports['removeAgents']=function(_0x4e6ea1,_0x4d8971,_0x497ae1){return db['FaxAccount'][_0xd8db('0x63')]({'where':{'id':_0x4e6ea1[_0xd8db('0x60')]['id']}})[_0xd8db('0x28')](handleEntityNotFound(_0x4d8971,null))[_0xd8db('0x28')](function(_0x45199a){if(_0x45199a){return _0x45199a['removeAgents'](_0x4e6ea1[_0xd8db('0x4a')]['ids'])[_0xd8db('0x28')](function(){if(_['isArray'](_0x4e6ea1['query'][_0xd8db('0x74')])){for(var _0x48e2ab=0x0;_0x48e2ab<_0x4e6ea1[_0xd8db('0x4a')][_0xd8db('0x74')][_0xd8db('0x62')];_0x48e2ab+=0x1){socket[_0xd8db('0xc0')](_0xd8db('0xc2'),{'UserId':Number(_0x4e6ea1[_0xd8db('0x4a')]['ids'][_0x48e2ab]),'FaxAccountId':Number(_0x4e6ea1['params']['id'])});}}else{socket['emit'](_0xd8db('0xc2'),{'UserId':Number(_0x4e6ea1[_0xd8db('0x4a')][_0xd8db('0x74')]),'FaxAccountId':Number(_0x4e6ea1[_0xd8db('0x60')]['id'])});}});}})[_0xd8db('0x28')](respondWithStatusCode(_0x4d8971,null))[_0xd8db('0x5e')](handleError(_0x4d8971,null));};exports[_0xd8db('0xc3')]=function(_0x4ce623,_0x4b5919,_0x3a86a0){var _0x26bd0f={};var _0x260b56={};var _0x414f9c;var _0x411a84;return db['FaxAccount'][_0xd8db('0x78')]({'where':{'id':_0x4ce623[_0xd8db('0x60')]['id']}})[_0xd8db('0x28')](handleEntityNotFound(_0x4b5919,null))[_0xd8db('0x28')](function(_0x272eab){if(_0x272eab){_0x414f9c=_0x272eab;_0x260b56['model']=_[_0xd8db('0x4b')](db[_0xd8db('0x7b')]['rawAttributes']);_0x260b56[_0xd8db('0x4a')]=_['keys'](_0x4ce623[_0xd8db('0x4a')]);_0x260b56[_0xd8db('0x55')]=_[_0xd8db('0x4c')](_0x260b56[_0xd8db('0x4d')],_0x260b56[_0xd8db('0x4a')]);_0x26bd0f[_0xd8db('0x4f')]=_[_0xd8db('0x4c')](_0x260b56['model'],qs[_0xd8db('0x4e')](_0x4ce623[_0xd8db('0x4a')][_0xd8db('0x4e')]));_0x26bd0f[_0xd8db('0x4f')]=_0x26bd0f['attributes'][_0xd8db('0x62')]?_0x26bd0f[_0xd8db('0x4f')]:_0x260b56[_0xd8db('0x4d')];_0x26bd0f['order']=qs[_0xd8db('0x72')](_0x4ce623[_0xd8db('0x4a')][_0xd8db('0x72')]);_0x26bd0f['where']=qs[_0xd8db('0x55')](_['pick'](_0x4ce623[_0xd8db('0x4a')],_0x260b56[_0xd8db('0x55')]));if(_0x4ce623['query'][_0xd8db('0x57')]){_0x26bd0f[_0xd8db('0x54')]=_[_0xd8db('0x58')](_0x26bd0f[_0xd8db('0x54')],{'$or':_[_0xd8db('0x44')](_0x26bd0f['attributes'],function(_0x48292a){var _0x3aead5={};_0x3aead5[_0x48292a]={'$like':'%'+_0x4ce623[_0xd8db('0x4a')][_0xd8db('0x57')]+'%'};return _0x3aead5;})});}_0x26bd0f=_[_0xd8db('0x58')]({},_0x26bd0f,_0x4ce623[_0xd8db('0x59')]);return _0x414f9c['getAgents'](_0x26bd0f);}})['then'](function(_0x215cac){if(_0x215cac){_0x411a84=_0x215cac['length'];if(!_0x4ce623['query'][_0xd8db('0x50')](_0xd8db('0x51'))){_0x26bd0f['limit']=qs[_0xd8db('0x37')](_0x4ce623[_0xd8db('0x4a')]['limit']);_0x26bd0f['offset']=qs[_0xd8db('0x52')](_0x4ce623[_0xd8db('0x4a')]['offset']);}return _0x414f9c[_0xd8db('0xc3')](_0x26bd0f);}})['then'](function(_0x4f3c98){if(_0x4f3c98){return _0x4f3c98?{'count':_0x411a84,'rows':_0x4f3c98}:null;}})['then'](respondWithResult(_0x4b5919,null))['catch'](handleError(_0x4b5919,null));};
\ No newline at end of file
diff --git a/server/api/faxAccount/faxAccount.events.js b/server/api/faxAccount/faxAccount.events.js
index 0441631..b42ee6e 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 _0x3947=['../../mysqldb','FaxAccount','save','update','remove','emit','hasOwnProperty','hook','events'];(function(_0x26793a,_0x49cf51){var _0x575efb=function(_0x2f4db7){while(--_0x2f4db7){_0x26793a['push'](_0x26793a['shift']());}};_0x575efb(++_0x49cf51);}(_0x3947,0xe9));var _0x7394=function(_0x450659,_0x486235){_0x450659=_0x450659-0x0;var _0x2c6c64=_0x3947[_0x450659];return _0x2c6c64;};'use strict';var EventEmitter=require(_0x7394('0x0'));var FaxAccount=require(_0x7394('0x1'))['db'][_0x7394('0x2')];var FaxAccountEvents=new EventEmitter();FaxAccountEvents['setMaxListeners'](0x0);var events={'afterCreate':_0x7394('0x3'),'afterUpdate':_0x7394('0x4'),'afterDestroy':_0x7394('0x5')};function emitEvent(_0x7f3c1d){return function(_0x5c37ce,_0x20fc7e,_0x4a81e0){FaxAccountEvents[_0x7394('0x6')](_0x7f3c1d+':'+_0x5c37ce['id'],_0x5c37ce);FaxAccountEvents[_0x7394('0x6')](_0x7f3c1d,_0x5c37ce);_0x4a81e0(null);};}for(var e in events){if(events[_0x7394('0x7')](e)){var event=events[e];FaxAccount[_0x7394('0x8')](e,emitEvent(event));}}module['exports']=FaxAccountEvents;
\ No newline at end of file
+var _0x4587=['../../mysqldb','setMaxListeners','save','remove','emit','hook','exports'];(function(_0x356127,_0x4873ac){var _0x5d4c75=function(_0x4fe60c){while(--_0x4fe60c){_0x356127['push'](_0x356127['shift']());}};_0x5d4c75(++_0x4873ac);}(_0x4587,0xd2));var _0x7458=function(_0x3dd15e,_0x1f0015){_0x3dd15e=_0x3dd15e-0x0;var _0x231fd0=_0x4587[_0x3dd15e];return _0x231fd0;};'use strict';var EventEmitter=require('events');var FaxAccount=require(_0x7458('0x0'))['db']['FaxAccount'];var FaxAccountEvents=new EventEmitter();FaxAccountEvents[_0x7458('0x1')](0x0);var events={'afterCreate':_0x7458('0x2'),'afterUpdate':'update','afterDestroy':_0x7458('0x3')};function emitEvent(_0x34bfa){return function(_0x51c919,_0x213324,_0x220fc1){FaxAccountEvents[_0x7458('0x4')](_0x34bfa+':'+_0x51c919['id'],_0x51c919);FaxAccountEvents[_0x7458('0x4')](_0x34bfa,_0x51c919);_0x220fc1(null);};}for(var e in events){if(events['hasOwnProperty'](e)){var event=events[e];FaxAccount[_0x7458('0x5')](e,emitEvent(event));}}module[_0x7458('0x6')]=FaxAccountEvents;
\ No newline at end of file
diff --git a/server/api/faxAccount/faxAccount.model.js b/server/api/faxAccount/faxAccount.model.js
index 88c278a..6e28277 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 _0xedec=['lodash','util','api','moment','bluebird','request-promise','path','rimraf','../../config/environment','./faxAccount.attributes','exports','FaxAccount','fax_accounts'];(function(_0x1b0055,_0x38bb71){var _0x13cf94=function(_0x277a1f){while(--_0x277a1f){_0x1b0055['push'](_0x1b0055['shift']());}};_0x13cf94(++_0x38bb71);}(_0xedec,0x12b));var _0xcede=function(_0x25bca6,_0xe415ea){_0x25bca6=_0x25bca6-0x0;var _0x3f8d02=_0xedec[_0x25bca6];return _0x3f8d02;};'use strict';var _=require(_0xcede('0x0'));var util=require(_0xcede('0x1'));var logger=require('../../config/logger')(_0xcede('0x2'));var moment=require(_0xcede('0x3'));var BPromise=require(_0xcede('0x4'));var rp=require(_0xcede('0x5'));var fs=require('fs');var path=require(_0xcede('0x6'));var rimraf=require(_0xcede('0x7'));var config=require(_0xcede('0x8'));var attributes=require(_0xcede('0x9'));module[_0xcede('0xa')]=function(_0x579695,_0x2026c7){return _0x579695['define'](_0xcede('0xb'),attributes,{'tableName':_0xcede('0xc'),'paranoid':![],'indexes':[],'timestamps':!![]});};
\ No newline at end of file
+var _0x0ebe=['../../config/environment','exports','fax_accounts','util','../../config/logger','api','bluebird','request-promise','path','rimraf'];(function(_0x10ffc1,_0x4c35b3){var _0x569df6=function(_0x428bf3){while(--_0x428bf3){_0x10ffc1['push'](_0x10ffc1['shift']());}};_0x569df6(++_0x4c35b3);}(_0x0ebe,0x19d));var _0xe0eb=function(_0x3782a2,_0x58d5d7){_0x3782a2=_0x3782a2-0x0;var _0x45950=_0x0ebe[_0x3782a2];return _0x45950;};'use strict';var _=require('lodash');var util=require(_0xe0eb('0x0'));var logger=require(_0xe0eb('0x1'))(_0xe0eb('0x2'));var moment=require('moment');var BPromise=require(_0xe0eb('0x3'));var rp=require(_0xe0eb('0x4'));var fs=require('fs');var path=require(_0xe0eb('0x5'));var rimraf=require(_0xe0eb('0x6'));var config=require(_0xe0eb('0x7'));var attributes=require('./faxAccount.attributes');module[_0xe0eb('0x8')]=function(_0xf62bdf,_0x490652){return _0xf62bdf['define']('FaxAccount',attributes,{'tableName':_0xe0eb('0x9'),'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 d5f87f4..f6a5b33 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 _0x5430=['User','unshift','agent','Start','startRouting','lodash','util','moment','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','../../config/environment','http','redis','defaults','localhost','socket.io-emitter','./faxAccount.socket','request','info','FaxAccount,\x20%s,\x20%s','request\x20sent','debug','FaxAccount,\x20%s,\x20%s,\x20%s','stringify','error','message','result','GetFaxAccount','FaxAccount','findAll','options','raw','where','attributes','limit','include','map','model','then','catch','NotifyFaxAccount','body','fax','CmContact','describe','Sequelize','ValidationError','no\x20available\x20attributes','difference','keys','updatedAt','createdAt','ListId','isNil','from','from\x20is\x20mandatory','body\x20is\x20mandatory\x20and\x20not\x20empty','mapKey\x20is\x20mandatory,\x20please\x20use\x20one\x20of\x20these:\x20','includes','mapKey','find','CmList','List','Applications','account','applications','list','orderBy','priority','asc','Contacts','create','FaxInteraction','spread','get','autoclose','length','close','*,*,*,*','created','interaction','FaxMessage','UserId'];(function(_0x38a155,_0x2aa026){var _0x269403=function(_0x47263b){while(--_0x47263b){_0x38a155['push'](_0x38a155['shift']());}};_0x269403(++_0x2aa026);}(_0x5430,0x15d));var _0x0543=function(_0x5abe80,_0x3fddc8){_0x5abe80=_0x5abe80-0x0;var _0x45e5c8=_0x5430[_0x5abe80];return _0x45e5c8;};'use strict';var _=require(_0x0543('0x0'));var util=require(_0x0543('0x1'));var moment=require(_0x0543('0x2'));var BPromise=require('bluebird');var rs=require(_0x0543('0x3'));var fs=require('fs');var Redis=require(_0x0543('0x4'));var db=require(_0x0543('0x5'))['db'];var utils=require(_0x0543('0x6'));var logger=require(_0x0543('0x7'))('rpc');var config=require(_0x0543('0x8'));var jayson=require('jayson/promise');var client=jayson['client'][_0x0543('0x9')]({'port':0x232c});config[_0x0543('0xa')]=_[_0x0543('0xb')](config[_0x0543('0xa')],{'host':_0x0543('0xc'),'port':0x18eb});var socket=require(_0x0543('0xd'))(new Redis(config[_0x0543('0xa')]));require(_0x0543('0xe'))['register'](socket);function respondWithRpcPromise(_0x250323,_0xa5a4fd,_0x40320f){return new BPromise(function(_0x2542e2,_0x494774){return client[_0x0543('0xf')](_0x250323,_0x40320f)['then'](function(_0x3ad02f){logger[_0x0543('0x10')](_0x0543('0x11'),_0xa5a4fd,_0x0543('0x12'));logger[_0x0543('0x13')](_0x0543('0x14'),_0xa5a4fd,_0x0543('0x12'),JSON[_0x0543('0x15')](_0x3ad02f));if(_0x3ad02f[_0x0543('0x16')]){if(_0x3ad02f[_0x0543('0x16')]['code']===0x1f4){logger[_0x0543('0x16')](_0x0543('0x11'),_0xa5a4fd,_0x3ad02f['error'][_0x0543('0x17')]);return _0x494774(_0x3ad02f['error'][_0x0543('0x17')]);}logger[_0x0543('0x16')](_0x0543('0x11'),_0xa5a4fd,_0x3ad02f['error'][_0x0543('0x17')]);return _0x2542e2(_0x3ad02f[_0x0543('0x16')][_0x0543('0x17')]);}else{logger[_0x0543('0x10')](_0x0543('0x11'),_0xa5a4fd,'request\x20sent');_0x2542e2(_0x3ad02f[_0x0543('0x18')][_0x0543('0x17')]);}})['catch'](function(_0xb35160){logger[_0x0543('0x16')]('FaxAccount,\x20%s,\x20%s',_0xa5a4fd,_0xb35160);_0x494774(_0xb35160);});});}exports[_0x0543('0x19')]=function(_0x31c6ef){var _0x189565=this;return new Promise(function(_0x5d1fac,_0x4a302e){return db[_0x0543('0x1a')][_0x0543('0x1b')]({'raw':_0x31c6ef['options']?_0x31c6ef[_0x0543('0x1c')][_0x0543('0x1d')]===undefined?!![]:![]:!![],'where':_0x31c6ef[_0x0543('0x1c')]?_0x31c6ef['options'][_0x0543('0x1e')]||null:null,'attributes':_0x31c6ef[_0x0543('0x1c')]?_0x31c6ef[_0x0543('0x1c')][_0x0543('0x1f')]||null:null,'limit':_0x31c6ef['options']?_0x31c6ef['options'][_0x0543('0x20')]||null:null,'include':_0x31c6ef[_0x0543('0x1c')]?_0x31c6ef[_0x0543('0x1c')][_0x0543('0x21')]?_[_0x0543('0x22')](_0x31c6ef[_0x0543('0x1c')][_0x0543('0x21')],function(_0x297cdf){return{'model':db[_0x297cdf[_0x0543('0x23')]],'as':_0x297cdf['as'],'attributes':_0x297cdf[_0x0543('0x1f')],'include':_0x297cdf[_0x0543('0x21')]?_[_0x0543('0x22')](_0x297cdf[_0x0543('0x21')],function(_0x4eac98){return{'model':db[_0x4eac98['model']],'as':_0x4eac98['as'],'attributes':_0x4eac98[_0x0543('0x1f')],'include':_0x4eac98[_0x0543('0x21')]?_[_0x0543('0x22')](_0x4eac98[_0x0543('0x21')],function(_0x14e694){return{'model':db[_0x14e694[_0x0543('0x23')]],'as':_0x14e694['as'],'attributes':_0x14e694[_0x0543('0x1f')]};}):[]};}):[]};}):[]:[]})[_0x0543('0x24')](function(_0x4ed0f6){logger[_0x0543('0x10')](_0x0543('0x19'),_0x31c6ef);logger[_0x0543('0x13')](_0x0543('0x19'),_0x31c6ef,JSON['stringify'](_0x4ed0f6));_0x5d1fac(_0x4ed0f6);})[_0x0543('0x25')](function(_0xb8d228){logger['error']('GetFaxAccount',_0xb8d228[_0x0543('0x17')],_0x31c6ef);_0x4a302e(_0x189565['error'](0x1f4,_0xb8d228['message']));});});};exports[_0x0543('0x26')]=function(_0x37b936,_0x19f722,_0x55e5f5){var _0x532d44=this;return new Promise(function(_0x3e14b3,_0x5ef095){var _0x24c72b={'body':_0x37b936[_0x0543('0x27')],'channel':_0x0543('0x28')};var _0xc05827=[];var _0x728893=[];var _0x1092c0={};return db[_0x0543('0x29')][_0x0543('0x2a')]()[_0x0543('0x24')](function(_0x4ee4de){if(!_0x4ee4de){throw new db[(_0x0543('0x2b'))][(_0x0543('0x2c'))](_0x0543('0x2d'));}_0xc05827=_[_0x0543('0x2e')](_[_0x0543('0x2f')](_0x4ee4de),['createdAt',_0x0543('0x30')]);_0x728893=_['difference'](_[_0x0543('0x2f')](_0x4ee4de),[_0x0543('0x31'),'updatedAt','CompanyId',_0x0543('0x32')]);if(_0x37b936['body']['id']){delete _0x37b936[_0x0543('0x27')]['id'];}if(_[_0x0543('0x33')](_0x37b936[_0x0543('0x27')][_0x0543('0x34')])){throw new db[(_0x0543('0x2b'))][(_0x0543('0x2c'))](_0x0543('0x35'));}if(_['isNil'](_0x37b936[_0x0543('0x27')][_0x0543('0x27')])||_0x37b936[_0x0543('0x27')][_0x0543('0x27')]===''){throw new db[(_0x0543('0x2b'))][(_0x0543('0x2c'))](_0x0543('0x36'));}if(_[_0x0543('0x33')](_0x37b936[_0x0543('0x27')]['mapKey'])){throw new db[(_0x0543('0x2b'))][(_0x0543('0x2c'))](_0x0543('0x37')+_0x728893);}if(!_[_0x0543('0x38')](_0x728893,_0x37b936['body'][_0x0543('0x39')])){throw new db[(_0x0543('0x2b'))][(_0x0543('0x2c'))]('mapKey\x20invalid,\x20please\x20use\x20one\x20of\x20these:\x20'+_0x728893);}_0x1092c0[_0x37b936[_0x0543('0x27')][_0x0543('0x39')]]=_0x37b936['body'][_0x0543('0x34')];})['then'](function(){return db[_0x0543('0x1a')][_0x0543('0x3a')]({'where':{'id':_0x37b936['account']['id']},'include':[{'model':db[_0x0543('0x3b')],'as':_0x0543('0x3c'),'include':[{'model':db[_0x0543('0x29')],'as':'Contacts','where':_0x1092c0,'limit':0x1,'order':[[_0x0543('0x30'),'DESC']]}]},{'model':db['FaxApplication'],'as':_0x0543('0x3d')}]});})[_0x0543('0x24')](function(_0xddfa69){if(_0xddfa69&&_0xddfa69[_0x0543('0x3c')]){var _0x405864=_0xddfa69['get']({'plain':!![]});_0x24c72b[_0x0543('0x3e')]=_0x405864;_0x24c72b[_0x0543('0x3f')]=_0x405864[_0x0543('0x3d')];_0x24c72b[_0x0543('0x40')]=_0x405864['List'];_0x24c72b[_0x0543('0x3f')]=_[_0x0543('0x41')](_0x24c72b[_0x0543('0x3f')],[_0x0543('0x42')],[_0x0543('0x43')]);if(_0x24c72b['account'][_0x0543('0x3d')]){delete _0x24c72b[_0x0543('0x3e')][_0x0543('0x3d')];}if(_0x24c72b[_0x0543('0x3e')][_0x0543('0x3c')]&&_0x24c72b[_0x0543('0x3e')][_0x0543('0x3c')][_0x0543('0x44')]['length']){return _0x24c72b[_0x0543('0x3e')][_0x0543('0x3c')][_0x0543('0x44')][0x0];}var _0xf65471=_[_0x0543('0xb')](_0x37b936[_0x0543('0x27')],{'firstName':_0x37b936[_0x0543('0x27')]['from'],'ListId':_0x405864[_0x0543('0x32')]});_0xf65471[_0x37b936[_0x0543('0x27')][_0x0543('0x39')]]=_0x37b936[_0x0543('0x27')][_0x0543('0x34')];return db[_0x0543('0x29')][_0x0543('0x45')](_0xf65471,{'fields':_0xc05827,'raw':!![]});}})[_0x0543('0x24')](function(_0x3b55b7){_0x24c72b['contact']=_0x3b55b7;if(_0x3b55b7){var _0x37bdf1={'ContactId':_0x3b55b7['id'],'FaxAccountId':_0x37b936['account']['id'],'fax':_0x3b55b7[_0x0543('0x28')]};return db[_0x0543('0x46')][_0x0543('0x3a')]({'where':{'ContactId':_0x3b55b7['id'],'closed':![],'FaxAccountId':_0x37b936[_0x0543('0x3e')]['id']}})[_0x0543('0x24')](function(_0x35f25c){if(_0x35f25c){return[_0x35f25c,![]];}return db[_0x0543('0x46')]['create'](_0x37bdf1)[_0x0543('0x24')](function(_0x41fb57){return[_0x41fb57,!![]];});});}else{throw new Error('Contact\x20not\x20found');}})[_0x0543('0x47')](function(_0x3468d8,_0x5000fc){var _0x31c907=_0x3468d8[_0x0543('0x48')]({'plain':!![]});if(_0x5000fc){if(_0x24c72b['account'][_0x0543('0x49')]){_0x24c72b['applications']['push']({'id':0x0,'priority':_0x24c72b['applications'][_0x0543('0x4a')]+0x1,'app':_0x0543('0x4b'),'appdata':'unmanaged','interval':_0x0543('0x4c')});}_0x31c907[_0x0543('0x4d')]=!![];}else{_0x31c907['created']=![];}_0x24c72b[_0x0543('0x4e')]=_0x31c907;return db[_0x0543('0x4f')][_0x0543('0x45')]({'body':_0x37b936['body']['body'],'FaxAccountId':_0x37b936[_0x0543('0x3e')]['id'],'FaxInteractionId':_0x3468d8['id'],'direction':'in','ContactId':_0x3468d8['ContactId'],'AttachmentId':_0x37b936[_0x0543('0x27')]['AttachmentId']});})[_0x0543('0x24')](function(_0x415125){_0x24c72b[_0x0543('0x17')]=_0x415125;if(_0x24c72b['interaction'][_0x0543('0x50')]){return db[_0x0543('0x51')]['find']({'attributes':['id','name'],'where':{'id':_0x24c72b['interaction'][_0x0543('0x50')]}})[_0x0543('0x24')](function(_0x3c641c){if(_0x3c641c){_0x24c72b['applications'][_0x0543('0x52')]({'id':0x0,'priority':0x0,'app':_0x0543('0x53'),'appdata':_0x3c641c['name']+','+(_0x24c72b['account']['waitForTheAssignedAgent']||0xa),'interval':_0x0543('0x4c')});}return respondWithRpcPromise(_0x0543('0x54'),'startRouting',_0x24c72b);});}return respondWithRpcPromise(_0x0543('0x54'),_0x0543('0x55'),_0x24c72b);})[_0x0543('0x24')](function(_0x50e306){_0x3e14b3(_0x50e306);})['catch'](function(_0x4b936e){_0x5ef095(_0x532d44[_0x0543('0x16')](0x1f4,_0x4b936e[_0x0543('0x17')]));});});};
\ No newline at end of file
+var _0x15ca=['*,*,*,*','created','interaction','FaxMessage','AttachmentId','UserId','User','name','agent','waitForTheAssignedAgent','Start','startRouting','lodash','util','moment','bluebird','randomstring','../../mysqldb','../../config/utils','../../config/logger','../../config/environment','jayson/promise','client','http','redis','defaults','localhost','socket.io-emitter','request','then','info','FaxAccount,\x20%s,\x20%s','request\x20sent','debug','FaxAccount,\x20%s,\x20%s,\x20%s','stringify','error','code','message','result','GetFaxAccount','FaxAccount','findAll','options','where','attributes','limit','include','map','model','NotifyFaxAccount','fax','CmContact','describe','Sequelize','no\x20available\x20attributes','difference','keys','createdAt','updatedAt','ListId','body','isNil','from','ValidationError','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','account','CmList','Contacts','DESC','FaxApplication','List','get','applications','priority','Applications','length','create','contact','find','FaxInteraction','spread','autoclose','push','close'];(function(_0x465a0c,_0x19d4d5){var _0x1e202e=function(_0x27bd8a){while(--_0x27bd8a){_0x465a0c['push'](_0x465a0c['shift']());}};_0x1e202e(++_0x19d4d5);}(_0x15ca,0xbe));var _0xa15c=function(_0x556475,_0x4ffada){_0x556475=_0x556475-0x0;var _0x278e4f=_0x15ca[_0x556475];return _0x278e4f;};'use strict';var _=require(_0xa15c('0x0'));var util=require(_0xa15c('0x1'));var moment=require(_0xa15c('0x2'));var BPromise=require(_0xa15c('0x3'));var rs=require(_0xa15c('0x4'));var fs=require('fs');var Redis=require('ioredis');var db=require(_0xa15c('0x5'))['db'];var utils=require(_0xa15c('0x6'));var logger=require(_0xa15c('0x7'))('rpc');var config=require(_0xa15c('0x8'));var jayson=require(_0xa15c('0x9'));var client=jayson[_0xa15c('0xa')][_0xa15c('0xb')]({'port':0x232c});config[_0xa15c('0xc')]=_[_0xa15c('0xd')](config[_0xa15c('0xc')],{'host':_0xa15c('0xe'),'port':0x18eb});var socket=require(_0xa15c('0xf'))(new Redis(config['redis']));require('./faxAccount.socket')['register'](socket);function respondWithRpcPromise(_0x509855,_0x319cca,_0x16b56f){return new BPromise(function(_0x57661c,_0x3f7c24){return client[_0xa15c('0x10')](_0x509855,_0x16b56f)[_0xa15c('0x11')](function(_0x284f9e){logger[_0xa15c('0x12')](_0xa15c('0x13'),_0x319cca,_0xa15c('0x14'));logger[_0xa15c('0x15')](_0xa15c('0x16'),_0x319cca,_0xa15c('0x14'),JSON[_0xa15c('0x17')](_0x284f9e));if(_0x284f9e['error']){if(_0x284f9e[_0xa15c('0x18')][_0xa15c('0x19')]===0x1f4){logger[_0xa15c('0x18')](_0xa15c('0x13'),_0x319cca,_0x284f9e[_0xa15c('0x18')][_0xa15c('0x1a')]);return _0x3f7c24(_0x284f9e['error'][_0xa15c('0x1a')]);}logger[_0xa15c('0x18')](_0xa15c('0x13'),_0x319cca,_0x284f9e['error']['message']);return _0x57661c(_0x284f9e[_0xa15c('0x18')][_0xa15c('0x1a')]);}else{logger['info']('FaxAccount,\x20%s,\x20%s',_0x319cca,_0xa15c('0x14'));_0x57661c(_0x284f9e[_0xa15c('0x1b')][_0xa15c('0x1a')]);}})['catch'](function(_0x1e2fc1){logger[_0xa15c('0x18')](_0xa15c('0x13'),_0x319cca,_0x1e2fc1);_0x3f7c24(_0x1e2fc1);});});}exports[_0xa15c('0x1c')]=function(_0x28d41f){var _0x474995=this;return new Promise(function(_0x4678f6,_0x521f3b){return db[_0xa15c('0x1d')][_0xa15c('0x1e')]({'raw':_0x28d41f[_0xa15c('0x1f')]?_0x28d41f[_0xa15c('0x1f')]['raw']===undefined?!![]:![]:!![],'where':_0x28d41f[_0xa15c('0x1f')]?_0x28d41f[_0xa15c('0x1f')][_0xa15c('0x20')]||null:null,'attributes':_0x28d41f['options']?_0x28d41f[_0xa15c('0x1f')][_0xa15c('0x21')]||null:null,'limit':_0x28d41f[_0xa15c('0x1f')]?_0x28d41f[_0xa15c('0x1f')][_0xa15c('0x22')]||null:null,'include':_0x28d41f[_0xa15c('0x1f')]?_0x28d41f[_0xa15c('0x1f')]['include']?_['map'](_0x28d41f['options'][_0xa15c('0x23')],function(_0x3bff89){return{'model':db[_0x3bff89['model']],'as':_0x3bff89['as'],'attributes':_0x3bff89[_0xa15c('0x21')],'include':_0x3bff89['include']?_[_0xa15c('0x24')](_0x3bff89[_0xa15c('0x23')],function(_0x285883){return{'model':db[_0x285883[_0xa15c('0x25')]],'as':_0x285883['as'],'attributes':_0x285883['attributes'],'include':_0x285883[_0xa15c('0x23')]?_['map'](_0x285883[_0xa15c('0x23')],function(_0x127a29){return{'model':db[_0x127a29[_0xa15c('0x25')]],'as':_0x127a29['as'],'attributes':_0x127a29['attributes']};}):[]};}):[]};}):[]:[]})[_0xa15c('0x11')](function(_0x175974){logger['info'](_0xa15c('0x1c'),_0x28d41f);logger['debug'](_0xa15c('0x1c'),_0x28d41f,JSON[_0xa15c('0x17')](_0x175974));_0x4678f6(_0x175974);})['catch'](function(_0x43c192){logger[_0xa15c('0x18')](_0xa15c('0x1c'),_0x43c192['message'],_0x28d41f);_0x521f3b(_0x474995[_0xa15c('0x18')](0x1f4,_0x43c192[_0xa15c('0x1a')]));});});};exports[_0xa15c('0x26')]=function(_0x23ac85,_0xb6e12f,_0x191516){var _0x3a2247=this;return new Promise(function(_0xd19bd,_0xf9c396){var _0x46b719={'body':_0x23ac85['body'],'channel':_0xa15c('0x27')};var _0x320ba6=[];var _0x24a47a=[];var _0x440702={};return db[_0xa15c('0x28')][_0xa15c('0x29')]()[_0xa15c('0x11')](function(_0x22e6c6){if(!_0x22e6c6){throw new db[(_0xa15c('0x2a'))]['ValidationError'](_0xa15c('0x2b'));}_0x320ba6=_[_0xa15c('0x2c')](_[_0xa15c('0x2d')](_0x22e6c6),[_0xa15c('0x2e'),_0xa15c('0x2f')]);_0x24a47a=_['difference'](_['keys'](_0x22e6c6),[_0xa15c('0x2e'),_0xa15c('0x2f'),'CompanyId',_0xa15c('0x30')]);if(_0x23ac85[_0xa15c('0x31')]['id']){delete _0x23ac85[_0xa15c('0x31')]['id'];}if(_[_0xa15c('0x32')](_0x23ac85[_0xa15c('0x31')][_0xa15c('0x33')])){throw new db[(_0xa15c('0x2a'))]['ValidationError']('from\x20is\x20mandatory');}if(_[_0xa15c('0x32')](_0x23ac85[_0xa15c('0x31')][_0xa15c('0x31')])||_0x23ac85[_0xa15c('0x31')][_0xa15c('0x31')]===''){throw new db[(_0xa15c('0x2a'))][(_0xa15c('0x34'))](_0xa15c('0x35'));}if(_[_0xa15c('0x32')](_0x23ac85['body'][_0xa15c('0x36')])){throw new db[(_0xa15c('0x2a'))][(_0xa15c('0x34'))](_0xa15c('0x37')+_0x24a47a);}if(!_[_0xa15c('0x38')](_0x24a47a,_0x23ac85[_0xa15c('0x31')]['mapKey'])){throw new db[(_0xa15c('0x2a'))][(_0xa15c('0x34'))](_0xa15c('0x39')+_0x24a47a);}_0x440702[_0x23ac85[_0xa15c('0x31')][_0xa15c('0x36')]]=_0x23ac85[_0xa15c('0x31')][_0xa15c('0x33')];})[_0xa15c('0x11')](function(){return db[_0xa15c('0x1d')]['find']({'where':{'id':_0x23ac85[_0xa15c('0x3a')]['id']},'include':[{'model':db[_0xa15c('0x3b')],'as':'List','include':[{'model':db['CmContact'],'as':_0xa15c('0x3c'),'where':_0x440702,'limit':0x1,'order':[[_0xa15c('0x2f'),_0xa15c('0x3d')]]}]},{'model':db[_0xa15c('0x3e')],'as':'Applications'}]});})[_0xa15c('0x11')](function(_0xc8d469){if(_0xc8d469&&_0xc8d469[_0xa15c('0x3f')]){var _0x6e7ae3=_0xc8d469[_0xa15c('0x40')]({'plain':!![]});_0x46b719[_0xa15c('0x3a')]=_0x6e7ae3;_0x46b719[_0xa15c('0x41')]=_0x6e7ae3['Applications'];_0x46b719['list']=_0x6e7ae3[_0xa15c('0x3f')];_0x46b719[_0xa15c('0x41')]=_['orderBy'](_0x46b719[_0xa15c('0x41')],[_0xa15c('0x42')],['asc']);if(_0x46b719[_0xa15c('0x3a')][_0xa15c('0x43')]){delete _0x46b719[_0xa15c('0x3a')][_0xa15c('0x43')];}if(_0x46b719['account'][_0xa15c('0x3f')]&&_0x46b719['account'][_0xa15c('0x3f')]['Contacts'][_0xa15c('0x44')]){return _0x46b719['account']['List'][_0xa15c('0x3c')][0x0];}var _0x17eb59=_[_0xa15c('0xd')](_0x23ac85[_0xa15c('0x31')],{'firstName':_0x23ac85[_0xa15c('0x31')][_0xa15c('0x33')],'ListId':_0x6e7ae3['ListId']});_0x17eb59[_0x23ac85[_0xa15c('0x31')][_0xa15c('0x36')]]=_0x23ac85[_0xa15c('0x31')][_0xa15c('0x33')];return db[_0xa15c('0x28')][_0xa15c('0x45')](_0x17eb59,{'fields':_0x320ba6,'raw':!![]});}})['then'](function(_0x45254b){_0x46b719[_0xa15c('0x46')]=_0x45254b;if(_0x45254b){var _0x3868b6={'ContactId':_0x45254b['id'],'FaxAccountId':_0x23ac85['account']['id'],'fax':_0x45254b[_0xa15c('0x27')]};return db['FaxInteraction'][_0xa15c('0x47')]({'where':{'ContactId':_0x45254b['id'],'closed':![],'FaxAccountId':_0x23ac85[_0xa15c('0x3a')]['id']}})[_0xa15c('0x11')](function(_0x136d00){if(_0x136d00){return[_0x136d00,![]];}return db[_0xa15c('0x48')][_0xa15c('0x45')](_0x3868b6)[_0xa15c('0x11')](function(_0x126c8a){return[_0x126c8a,!![]];});});}else{throw new Error('Contact\x20not\x20found');}})[_0xa15c('0x49')](function(_0x1dbe6d,_0x3916c5){var _0x4bd039=_0x1dbe6d[_0xa15c('0x40')]({'plain':!![]});if(_0x3916c5){if(_0x46b719[_0xa15c('0x3a')][_0xa15c('0x4a')]){_0x46b719[_0xa15c('0x41')][_0xa15c('0x4b')]({'id':0x0,'priority':_0x46b719['applications'][_0xa15c('0x44')]+0x1,'app':_0xa15c('0x4c'),'appdata':'unmanaged','interval':_0xa15c('0x4d')});}_0x4bd039[_0xa15c('0x4e')]=!![];}else{_0x4bd039[_0xa15c('0x4e')]=![];}_0x46b719[_0xa15c('0x4f')]=_0x4bd039;return db[_0xa15c('0x50')][_0xa15c('0x45')]({'body':_0x23ac85[_0xa15c('0x31')]['body'],'FaxAccountId':_0x23ac85[_0xa15c('0x3a')]['id'],'FaxInteractionId':_0x1dbe6d['id'],'direction':'in','ContactId':_0x1dbe6d['ContactId'],'AttachmentId':_0x23ac85[_0xa15c('0x31')][_0xa15c('0x51')]});})[_0xa15c('0x11')](function(_0x9c5318){_0x46b719['message']=_0x9c5318;if(_0x46b719[_0xa15c('0x4f')][_0xa15c('0x52')]){return db[_0xa15c('0x53')][_0xa15c('0x47')]({'attributes':['id',_0xa15c('0x54')],'where':{'id':_0x46b719[_0xa15c('0x4f')][_0xa15c('0x52')]}})[_0xa15c('0x11')](function(_0x28509f){if(_0x28509f){_0x46b719[_0xa15c('0x41')]['unshift']({'id':0x0,'priority':0x0,'app':_0xa15c('0x55'),'appdata':_0x28509f[_0xa15c('0x54')]+','+(_0x46b719[_0xa15c('0x3a')][_0xa15c('0x56')]||0xa),'interval':_0xa15c('0x4d')});}return respondWithRpcPromise(_0xa15c('0x57'),_0xa15c('0x58'),_0x46b719);});}return respondWithRpcPromise(_0xa15c('0x57'),_0xa15c('0x58'),_0x46b719);})[_0xa15c('0x11')](function(_0x58515a){_0xd19bd(_0x58515a);})['catch'](function(_0x358589){_0xf9c396(_0x3a2247['error'](0x1f4,_0x358589['message']));});});};
\ No newline at end of file
diff --git a/server/api/faxAccount/faxAccount.socket.js b/server/api/faxAccount/faxAccount.socket.js
index df7bd7e..a70f85c 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 _0xdf55=['update','emit','removeListener','register','length','./faxAccount.events','save'];(function(_0x1617a2,_0x4ecc61){var _0x2b738c=function(_0x57c4df){while(--_0x57c4df){_0x1617a2['push'](_0x1617a2['shift']());}};_0x2b738c(++_0x4ecc61);}(_0xdf55,0x83));var _0x5df5=function(_0x13c174,_0xda25fe){_0x13c174=_0x13c174-0x0;var _0x160654=_0xdf55[_0x13c174];return _0x160654;};'use strict';var FaxAccountEvents=require(_0x5df5('0x0'));var events=[_0x5df5('0x1'),'remove',_0x5df5('0x2')];function createListener(_0x1c352c,_0x538c78){return function(_0x3f503b){_0x538c78[_0x5df5('0x3')](_0x1c352c,_0x3f503b);};}function removeListener(_0x381a4c,_0x521007){return function(){FaxAccountEvents[_0x5df5('0x4')](_0x381a4c,_0x521007);};}exports[_0x5df5('0x5')]=function(_0x27ec86){for(var _0x476e21=0x0,_0x9b8756=events[_0x5df5('0x6')];_0x476e21<_0x9b8756;_0x476e21++){var _0x4722a2=events[_0x476e21];var _0x3743f3=createListener('faxAccount:'+_0x4722a2,_0x27ec86);FaxAccountEvents['on'](_0x4722a2,_0x3743f3);}};
\ No newline at end of file
+var _0x9f0e=['save','remove','update','emit','removeListener','register','length','faxAccount:','./faxAccount.events'];(function(_0x1d3052,_0x163c8c){var _0x5896fa=function(_0x4fa472){while(--_0x4fa472){_0x1d3052['push'](_0x1d3052['shift']());}};_0x5896fa(++_0x163c8c);}(_0x9f0e,0x116));var _0xe9f0=function(_0x1cc43b,_0x48851f){_0x1cc43b=_0x1cc43b-0x0;var _0x41e66e=_0x9f0e[_0x1cc43b];return _0x41e66e;};'use strict';var FaxAccountEvents=require(_0xe9f0('0x0'));var events=[_0xe9f0('0x1'),_0xe9f0('0x2'),_0xe9f0('0x3')];function createListener(_0x146ad8,_0x4a1a30){return function(_0x5856dc){_0x4a1a30[_0xe9f0('0x4')](_0x146ad8,_0x5856dc);};}function removeListener(_0x150a03,_0x3c589d){return function(){FaxAccountEvents[_0xe9f0('0x5')](_0x150a03,_0x3c589d);};}exports[_0xe9f0('0x6')]=function(_0x50313d){for(var _0x5b87c1=0x0,_0x3a17b3=events[_0xe9f0('0x7')];_0x5b87c1<_0x3a17b3;_0x5b87c1++){var _0xe64a79=events[_0x5b87c1];var _0x4be6a6=createListener(_0xe9f0('0x8')+_0xe64a79,_0x50313d);FaxAccountEvents['on'](_0xe64a79,_0x4be6a6);}};
\ No newline at end of file
diff --git a/server/api/faxAccount/index.js b/server/api/faxAccount/index.js
index d647d68..9fcf73c 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 _0x5d1f=['index','/describe','describe','/:id','show','/:id/dispositions','getDispositions','/:id/interactions','getInteractions','/:id/applications','getApplications','/:id/messages','getMessages','/:id/users','getAgents','post','create','addDisposition','addAnswer','addInteraction','/addaccountapplications','addAccountApplications','/updateaccountapplications','updateAccountApplications','send','addAgents','put','update','removeDispositions','delete','/:id/canned_answers','removeAnswers','removeAgents','util','path','connect-timeout','Router','../../components/auth/service','../../components/interaction/service','get','isAuthenticated'];(function(_0x31eb67,_0x9bc8c0){var _0x2a8cb8=function(_0xac1c5d){while(--_0xac1c5d){_0x31eb67['push'](_0x31eb67['shift']());}};_0x2a8cb8(++_0x9bc8c0);}(_0x5d1f,0x117));var _0xf5d1=function(_0x6fd490,_0xe0b981){_0x6fd490=_0x6fd490-0x0;var _0x2b4166=_0x5d1f[_0x6fd490];return _0x2b4166;};'use strict';var multer=require('multer');var util=require(_0xf5d1('0x0'));var path=require(_0xf5d1('0x1'));var timeout=require(_0xf5d1('0x2'));var express=require('express');var router=express[_0xf5d1('0x3')]();var auth=require(_0xf5d1('0x4'));var interaction=require(_0xf5d1('0x5'));var config=require('../../config/environment');var controller=require('./faxAccount.controller');router[_0xf5d1('0x6')]('/',auth[_0xf5d1('0x7')](),controller[_0xf5d1('0x8')]);router[_0xf5d1('0x6')](_0xf5d1('0x9'),auth['isAuthenticated'](),controller[_0xf5d1('0xa')]);router[_0xf5d1('0x6')](_0xf5d1('0xb'),auth['isAuthenticated'](),controller[_0xf5d1('0xc')]);router[_0xf5d1('0x6')](_0xf5d1('0xd'),auth[_0xf5d1('0x7')](),controller[_0xf5d1('0xe')]);router[_0xf5d1('0x6')]('/:id/canned_answers',auth[_0xf5d1('0x7')](),controller['getAnswers']);router['get'](_0xf5d1('0xf'),auth[_0xf5d1('0x7')](),controller[_0xf5d1('0x10')]);router[_0xf5d1('0x6')](_0xf5d1('0x11'),auth[_0xf5d1('0x7')](),controller[_0xf5d1('0x12')]);router[_0xf5d1('0x6')](_0xf5d1('0x13'),auth[_0xf5d1('0x7')](),controller[_0xf5d1('0x14')]);router[_0xf5d1('0x6')](_0xf5d1('0x15'),auth['isAuthenticated'](),controller[_0xf5d1('0x16')]);router[_0xf5d1('0x17')]('/',auth[_0xf5d1('0x7')](),controller[_0xf5d1('0x18')]);router[_0xf5d1('0x17')](_0xf5d1('0xd'),auth[_0xf5d1('0x7')](),controller[_0xf5d1('0x19')]);router[_0xf5d1('0x17')]('/:id/canned_answers',auth[_0xf5d1('0x7')](),controller[_0xf5d1('0x1a')]);router[_0xf5d1('0x17')](_0xf5d1('0xf'),auth[_0xf5d1('0x7')](),controller[_0xf5d1('0x1b')]);router[_0xf5d1('0x17')](_0xf5d1('0x11'),auth[_0xf5d1('0x7')](),controller['addApplications']);router['post'](_0xf5d1('0x1c'),auth[_0xf5d1('0x7')](),controller[_0xf5d1('0x1d')]);router['post'](_0xf5d1('0x1e'),auth[_0xf5d1('0x7')](),controller[_0xf5d1('0x1f')]);router[_0xf5d1('0x17')]('/:id/send',auth[_0xf5d1('0x7')](),controller[_0xf5d1('0x20')]);router[_0xf5d1('0x17')](_0xf5d1('0x15'),auth[_0xf5d1('0x7')](),controller[_0xf5d1('0x21')]);router[_0xf5d1('0x22')](_0xf5d1('0xb'),auth['isAuthenticated'](),controller[_0xf5d1('0x23')]);router['delete'](_0xf5d1('0xb'),auth[_0xf5d1('0x7')](),controller['destroy']);router['delete'](_0xf5d1('0xd'),auth[_0xf5d1('0x7')](),controller[_0xf5d1('0x24')]);router[_0xf5d1('0x25')](_0xf5d1('0x26'),auth['isAuthenticated'](),controller[_0xf5d1('0x27')]);router[_0xf5d1('0x25')]('/:id/users',auth[_0xf5d1('0x7')](),controller[_0xf5d1('0x28')]);module['exports']=router;
\ No newline at end of file
+var _0x5842=['path','connect-timeout','Router','../../components/auth/service','../../config/environment','./faxAccount.controller','get','isAuthenticated','index','/describe','describe','show','getDispositions','/:id/canned_answers','/:id/interactions','/:id/applications','getApplications','/:id/messages','getMessages','/:id/users','getAgents','post','create','/:id/dispositions','addDisposition','addAnswer','addInteraction','addApplications','/addaccountapplications','addAccountApplications','updateAccountApplications','/:id/send','send','put','/:id','update','destroy','delete','removeAnswers','removeAgents','exports','multer'];(function(_0x3da047,_0x167b2c){var _0x5040c8=function(_0x5c995a){while(--_0x5c995a){_0x3da047['push'](_0x3da047['shift']());}};_0x5040c8(++_0x167b2c);}(_0x5842,0x1cd));var _0x2584=function(_0x255d5b,_0x4f6f35){_0x255d5b=_0x255d5b-0x0;var _0x3e141a=_0x5842[_0x255d5b];return _0x3e141a;};'use strict';var multer=require(_0x2584('0x0'));var util=require('util');var path=require(_0x2584('0x1'));var timeout=require(_0x2584('0x2'));var express=require('express');var router=express[_0x2584('0x3')]();var auth=require(_0x2584('0x4'));var interaction=require('../../components/interaction/service');var config=require(_0x2584('0x5'));var controller=require(_0x2584('0x6'));router[_0x2584('0x7')]('/',auth[_0x2584('0x8')](),controller[_0x2584('0x9')]);router[_0x2584('0x7')](_0x2584('0xa'),auth['isAuthenticated'](),controller[_0x2584('0xb')]);router['get']('/:id',auth[_0x2584('0x8')](),controller[_0x2584('0xc')]);router[_0x2584('0x7')]('/:id/dispositions',auth[_0x2584('0x8')](),controller[_0x2584('0xd')]);router[_0x2584('0x7')](_0x2584('0xe'),auth[_0x2584('0x8')](),controller['getAnswers']);router['get'](_0x2584('0xf'),auth['isAuthenticated'](),controller['getInteractions']);router['get'](_0x2584('0x10'),auth[_0x2584('0x8')](),controller[_0x2584('0x11')]);router[_0x2584('0x7')](_0x2584('0x12'),auth[_0x2584('0x8')](),controller[_0x2584('0x13')]);router[_0x2584('0x7')](_0x2584('0x14'),auth[_0x2584('0x8')](),controller[_0x2584('0x15')]);router[_0x2584('0x16')]('/',auth[_0x2584('0x8')](),controller[_0x2584('0x17')]);router[_0x2584('0x16')](_0x2584('0x18'),auth['isAuthenticated'](),controller[_0x2584('0x19')]);router[_0x2584('0x16')](_0x2584('0xe'),auth['isAuthenticated'](),controller[_0x2584('0x1a')]);router[_0x2584('0x16')](_0x2584('0xf'),auth[_0x2584('0x8')](),controller[_0x2584('0x1b')]);router[_0x2584('0x16')]('/:id/applications',auth[_0x2584('0x8')](),controller[_0x2584('0x1c')]);router[_0x2584('0x16')](_0x2584('0x1d'),auth['isAuthenticated'](),controller[_0x2584('0x1e')]);router[_0x2584('0x16')]('/updateaccountapplications',auth[_0x2584('0x8')](),controller[_0x2584('0x1f')]);router[_0x2584('0x16')](_0x2584('0x20'),auth[_0x2584('0x8')](),controller[_0x2584('0x21')]);router[_0x2584('0x16')]('/:id/users',auth[_0x2584('0x8')](),controller['addAgents']);router[_0x2584('0x22')](_0x2584('0x23'),auth[_0x2584('0x8')](),controller[_0x2584('0x24')]);router['delete'](_0x2584('0x23'),auth['isAuthenticated'](),controller[_0x2584('0x25')]);router[_0x2584('0x26')]('/:id/dispositions',auth['isAuthenticated'](),controller['removeDispositions']);router[_0x2584('0x26')](_0x2584('0xe'),auth[_0x2584('0x8')](),controller[_0x2584('0x27')]);router['delete']('/:id/users',auth[_0x2584('0x8')](),controller[_0x2584('0x28')]);module[_0x2584('0x29')]=router;
\ No newline at end of file
diff --git a/server/api/faxApplication/faxApplication.attributes.js b/server/api/faxApplication/faxApplication.attributes.js
index 114786e..04c6c4b 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 _0x3e99=['noop','TEXT','*,*,*,*','sequelize','exports','INTEGER','STRING'];(function(_0x420cea,_0x315ab9){var _0x2385f8=function(_0x1bb4e6){while(--_0x1bb4e6){_0x420cea['push'](_0x420cea['shift']());}};_0x2385f8(++_0x315ab9);}(_0x3e99,0x122));var _0x93e9=function(_0x4261b7,_0x10abb5){_0x4261b7=_0x4261b7-0x0;var _0x211952=_0x3e99[_0x4261b7];return _0x211952;};'use strict';var Sequelize=require(_0x93e9('0x0'));module[_0x93e9('0x1')]={'priority':{'type':Sequelize[_0x93e9('0x2')],'allowNull':![]},'app':{'type':Sequelize[_0x93e9('0x3')],'allowNull':![],'defaultValue':_0x93e9('0x4')},'appdata':{'type':Sequelize[_0x93e9('0x5')]()},'description':{'type':Sequelize['STRING']},'interval':{'type':Sequelize['STRING'],'defaultValue':_0x93e9('0x6')}};
\ No newline at end of file
+var _0x9dfc=['sequelize','noop','TEXT','STRING','*,*,*,*'];(function(_0x4c445a,_0x4ee80f){var _0x2f611c=function(_0x4f3699){while(--_0x4f3699){_0x4c445a['push'](_0x4c445a['shift']());}};_0x2f611c(++_0x4ee80f);}(_0x9dfc,0x140));var _0xc9df=function(_0x35e2fa,_0x196e23){_0x35e2fa=_0x35e2fa-0x0;var _0xdfe41b=_0x9dfc[_0x35e2fa];return _0xdfe41b;};'use strict';var Sequelize=require(_0xc9df('0x0'));module['exports']={'priority':{'type':Sequelize['INTEGER'],'allowNull':![]},'app':{'type':Sequelize['STRING'],'allowNull':![],'defaultValue':_0xc9df('0x1')},'appdata':{'type':Sequelize[_0xc9df('0x2')]()},'description':{'type':Sequelize[_0xc9df('0x3')]},'interval':{'type':Sequelize[_0xc9df('0x3')],'defaultValue':_0xc9df('0x4')}};
\ No newline at end of file
diff --git a/server/api/faxApplication/faxApplication.controller.js b/server/api/faxApplication/faxApplication.controller.js
index 02f3992..b6bd1d6 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 _0xaeab=['util','path','sox','to-csv','ejs','squel','crypto','jsforce','desk.js','querystring','papaparse','ioredis','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/environment','../../mysqldb','sendStatus','status','end','json','offset','limit','set','Content-Range','reject','save','update','then','destroy','error','stack','name','index','map','FaxApplication','rawAttributes','fieldName','type','key','model','query','keys','filters','intersection','fields','attributes','length','hasOwnProperty','nolimit','sort','where','pick','filter','merge','VIRTUAL','options','count','includeAll','findAll','rows','show','params','catch','create','body','find','html-pdf','rimraf','fast-json-patch','request-promise','moment','bluebird','mustache'];(function(_0x30171c,_0x3ed577){var _0xe8a0af=function(_0x15ad2c){while(--_0x15ad2c){_0x30171c['push'](_0x30171c['shift']());}};_0xe8a0af(++_0x3ed577);}(_0xaeab,0x91));var _0xbaea=function(_0x2a7301,_0x5a4523){_0x2a7301=_0x2a7301-0x0;var _0x9bcbaa=_0xaeab[_0x2a7301];return _0x9bcbaa;};'use strict';var pdf=require(_0xbaea('0x0'));var emlformat=require('eml-format');var rimraf=require(_0xbaea('0x1'));var zipdir=require('zip-dir');var jsonpatch=require(_0xbaea('0x2'));var rp=require(_0xbaea('0x3'));var moment=require(_0xbaea('0x4'));var BPromise=require(_0xbaea('0x5'));var Mustache=require(_0xbaea('0x6'));var util=require(_0xbaea('0x7'));var path=require(_0xbaea('0x8'));var sox=require(_0xbaea('0x9'));var csv=require(_0xbaea('0xa'));var ejs=require(_0xbaea('0xb'));var fs=require('fs');var _=require('lodash');var squel=require(_0xbaea('0xc'));var crypto=require(_0xbaea('0xd'));var jsforce=require(_0xbaea('0xe'));var deskjs=require(_0xbaea('0xf'));var toCsv=require(_0xbaea('0xa'));var querystring=require(_0xbaea('0x10'));var Papa=require(_0xbaea('0x11'));var Redis=require(_0xbaea('0x12'));var authService=require('../../components/auth/service');var qs=require(_0xbaea('0x13'));var as=require(_0xbaea('0x14'));var hardwareService=require(_0xbaea('0x15'));var logger=require(_0xbaea('0x16'))(_0xbaea('0x17'));var utils=require('../../config/utils');var config=require(_0xbaea('0x18'));var db=require(_0xbaea('0x19'))['db'];function respondWithStatusCode(_0x4c7215,_0x2abac1){_0x2abac1=_0x2abac1||0xcc;return function(_0x3d85f5){if(_0x3d85f5){return _0x4c7215[_0xbaea('0x1a')](_0x2abac1);}return _0x4c7215[_0xbaea('0x1b')](_0x2abac1)[_0xbaea('0x1c')]();};}function respondWithResult(_0x29306b,_0x5599e9){_0x5599e9=_0x5599e9||0xc8;return function(_0x5a3ffd){if(_0x5a3ffd){return _0x29306b[_0xbaea('0x1b')](_0x5599e9)[_0xbaea('0x1d')](_0x5a3ffd);}};}function respondWithFilteredResult(_0xb97eec,_0xcc413c){return function(_0x3c7ee7){if(_0x3c7ee7){var _0x48db73=_0x3c7ee7['count'],_0x51cdae=_0xcc413c[_0xbaea('0x1e')],_0x275526=_0xcc413c[_0xbaea('0x1e')]+_0xcc413c[_0xbaea('0x1f')],_0x18c259;if(_0x275526>=_0x48db73){_0x275526=_0x48db73;_0x18c259=0xc8;}else{_0x18c259=0xce;}_0xb97eec[_0xbaea('0x1b')](_0x18c259);return _0xb97eec[_0xbaea('0x20')](_0xbaea('0x21'),_0x51cdae+'-'+_0x275526+'/'+_0x48db73)['json'](_0x3c7ee7);}return null;};}function patchUpdates(_0x4842f1){return function(_0x56d331){try{jsonpatch['apply'](_0x56d331,_0x4842f1,!![]);}catch(_0x33503d){return BPromise[_0xbaea('0x22')](_0x33503d);}return _0x56d331[_0xbaea('0x23')]();};}function saveUpdates(_0xa2e7e4,_0x1962d9){return function(_0x57adc2){if(_0x57adc2){return _0x57adc2[_0xbaea('0x24')](_0xa2e7e4)[_0xbaea('0x25')](function(_0x5e5e36){return _0x5e5e36;});}return null;};}function removeEntity(_0x1641f0,_0x21ebbc){return function(_0xe4916){if(_0xe4916){return _0xe4916[_0xbaea('0x26')]()[_0xbaea('0x25')](function(){_0x1641f0['status'](0xcc)[_0xbaea('0x1c')]();});}};}function handleEntityNotFound(_0x5a430d,_0x121007){return function(_0x3dc02b){if(!_0x3dc02b){_0x5a430d['sendStatus'](0x194);}return _0x3dc02b;};}function handleError(_0x554458,_0x5c44ba){_0x5c44ba=_0x5c44ba||0x1f4;return function(_0x41e596){logger[_0xbaea('0x27')](_0x41e596[_0xbaea('0x28')]);if(_0x41e596[_0xbaea('0x29')]){delete _0x41e596[_0xbaea('0x29')];}_0x554458[_0xbaea('0x1b')](_0x5c44ba)['send'](_0x41e596);};}exports[_0xbaea('0x2a')]=function(_0xbc9b0d,_0x591d03){var _0x2785bb={},_0x2378f8={},_0x8566e8={'count':0x0,'rows':[]};var _0x35db11=_[_0xbaea('0x2b')](db[_0xbaea('0x2c')][_0xbaea('0x2d')],function(_0x3ad6eb){return{'name':_0x3ad6eb[_0xbaea('0x2e')],'type':_0x3ad6eb[_0xbaea('0x2f')][_0xbaea('0x30')]};});_0x2378f8[_0xbaea('0x31')]=_['map'](_0x35db11,_0xbaea('0x29'));_0x2378f8[_0xbaea('0x32')]=_[_0xbaea('0x33')](_0xbc9b0d[_0xbaea('0x32')]);_0x2378f8[_0xbaea('0x34')]=_[_0xbaea('0x35')](_0x2378f8['model'],_0x2378f8[_0xbaea('0x32')]);_0x2785bb['attributes']=_[_0xbaea('0x35')](_0x2378f8[_0xbaea('0x31')],qs[_0xbaea('0x36')](_0xbc9b0d[_0xbaea('0x32')][_0xbaea('0x36')]));_0x2785bb[_0xbaea('0x37')]=_0x2785bb[_0xbaea('0x37')][_0xbaea('0x38')]?_0x2785bb[_0xbaea('0x37')]:_0x2378f8[_0xbaea('0x31')];if(!_0xbc9b0d[_0xbaea('0x32')][_0xbaea('0x39')](_0xbaea('0x3a'))){_0x2785bb['limit']=qs[_0xbaea('0x1f')](_0xbc9b0d['query'][_0xbaea('0x1f')]);_0x2785bb[_0xbaea('0x1e')]=qs['offset'](_0xbc9b0d[_0xbaea('0x32')][_0xbaea('0x1e')]);}_0x2785bb['order']=qs['sort'](_0xbc9b0d[_0xbaea('0x32')][_0xbaea('0x3b')]);_0x2785bb[_0xbaea('0x3c')]=qs[_0xbaea('0x34')](_[_0xbaea('0x3d')](_0xbc9b0d[_0xbaea('0x32')],_0x2378f8['filters']));if(_0xbc9b0d['query'][_0xbaea('0x3e')]){_0x2785bb[_0xbaea('0x3c')]=_[_0xbaea('0x3f')](_0x2785bb[_0xbaea('0x3c')],{'$or':_[_0xbaea('0x2b')](_0x35db11,function(_0x58f138){if(_0x58f138[_0xbaea('0x2f')]!==_0xbaea('0x40')){var _0x4c7835={};_0x4c7835[_0x58f138['name']]={'$like':'%'+_0xbc9b0d[_0xbaea('0x32')][_0xbaea('0x3e')]+'%'};return _0x4c7835;}})});}_0x2785bb=_[_0xbaea('0x3f')]({},_0x2785bb,_0xbc9b0d[_0xbaea('0x41')]);var _0x5a0b24={'where':_0x2785bb[_0xbaea('0x3c')]};return db[_0xbaea('0x2c')][_0xbaea('0x42')](_0x5a0b24)[_0xbaea('0x25')](function(_0x526928){_0x8566e8[_0xbaea('0x42')]=_0x526928;if(_0xbc9b0d[_0xbaea('0x32')][_0xbaea('0x43')]){_0x2785bb['include']=[{'all':!![]}];}return db[_0xbaea('0x2c')][_0xbaea('0x44')](_0x2785bb);})[_0xbaea('0x25')](function(_0x1937a0){_0x8566e8[_0xbaea('0x45')]=_0x1937a0;return _0x8566e8;})[_0xbaea('0x25')](respondWithFilteredResult(_0x591d03,_0x2785bb))['catch'](handleError(_0x591d03,null));};exports[_0xbaea('0x46')]=function(_0x4ca155,_0x100a5a){var _0x1c513e={'raw':!![],'where':{'id':_0x4ca155[_0xbaea('0x47')]['id']}},_0x4222a1={};_0x4222a1[_0xbaea('0x31')]=_[_0xbaea('0x33')](db[_0xbaea('0x2c')]['rawAttributes']);_0x4222a1[_0xbaea('0x32')]=_[_0xbaea('0x33')](_0x4ca155['query']);_0x4222a1['filters']=_[_0xbaea('0x35')](_0x4222a1[_0xbaea('0x31')],_0x4222a1[_0xbaea('0x32')]);_0x1c513e[_0xbaea('0x37')]=_[_0xbaea('0x35')](_0x4222a1[_0xbaea('0x31')],qs[_0xbaea('0x36')](_0x4ca155[_0xbaea('0x32')][_0xbaea('0x36')]));_0x1c513e[_0xbaea('0x37')]=_0x1c513e[_0xbaea('0x37')][_0xbaea('0x38')]?_0x1c513e[_0xbaea('0x37')]:_0x4222a1[_0xbaea('0x31')];if(_0x4ca155['query'][_0xbaea('0x43')]){_0x1c513e['include']=[{'all':!![]}];}_0x1c513e=_['merge']({},_0x1c513e,_0x4ca155[_0xbaea('0x41')]);return db['FaxApplication']['find'](_0x1c513e)['then'](handleEntityNotFound(_0x100a5a,null))[_0xbaea('0x25')](respondWithResult(_0x100a5a,null))[_0xbaea('0x48')](handleError(_0x100a5a,null));};exports[_0xbaea('0x49')]=function(_0x3096e9,_0x39c2d4){return db[_0xbaea('0x2c')][_0xbaea('0x49')](_0x3096e9[_0xbaea('0x4a')],{})[_0xbaea('0x25')](respondWithResult(_0x39c2d4,0xc9))[_0xbaea('0x48')](handleError(_0x39c2d4,null));};exports[_0xbaea('0x24')]=function(_0x52c096,_0x25e385){if(_0x52c096[_0xbaea('0x4a')]['id']){delete _0x52c096[_0xbaea('0x4a')]['id'];}return db[_0xbaea('0x2c')][_0xbaea('0x4b')]({'where':{'id':_0x52c096[_0xbaea('0x47')]['id']}})['then'](handleEntityNotFound(_0x25e385,null))['then'](saveUpdates(_0x52c096[_0xbaea('0x4a')],null))[_0xbaea('0x25')](respondWithResult(_0x25e385,null))[_0xbaea('0x48')](handleError(_0x25e385,null));};exports[_0xbaea('0x26')]=function(_0x27f3bd,_0x3d1f87){return db[_0xbaea('0x2c')][_0xbaea('0x4b')]({'where':{'id':_0x27f3bd['params']['id']}})[_0xbaea('0x25')](handleEntityNotFound(_0x3d1f87,null))[_0xbaea('0x25')](removeEntity(_0x3d1f87,null))[_0xbaea('0x48')](handleError(_0x3d1f87,null));};
\ No newline at end of file
+var _0xf23b=['includeAll','include','findAll','rows','catch','merge','FaxApplication','find','create','body','params','html-pdf','eml-format','rimraf','zip-dir','fast-json-patch','moment','bluebird','mustache','path','sox','to-csv','ejs','lodash','jsforce','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/environment','status','end','json','count','offset','set','Content-Range','apply','reject','update','destroy','then','sendStatus','error','stack','name','send','index','map','rawAttributes','type','query','keys','filters','intersection','model','attributes','fields','length','hasOwnProperty','nolimit','limit','order','sort','pick','where','VIRTUAL','filter','options'];(function(_0x1f670c,_0xabbdd6){var _0x247991=function(_0x55331e){while(--_0x55331e){_0x1f670c['push'](_0x1f670c['shift']());}};_0x247991(++_0xabbdd6);}(_0xf23b,0x133));var _0xbf23=function(_0x4d521c,_0x32baf3){_0x4d521c=_0x4d521c-0x0;var _0x417317=_0xf23b[_0x4d521c];return _0x417317;};'use strict';var pdf=require(_0xbf23('0x0'));var emlformat=require(_0xbf23('0x1'));var rimraf=require(_0xbf23('0x2'));var zipdir=require(_0xbf23('0x3'));var jsonpatch=require(_0xbf23('0x4'));var rp=require('request-promise');var moment=require(_0xbf23('0x5'));var BPromise=require(_0xbf23('0x6'));var Mustache=require(_0xbf23('0x7'));var util=require('util');var path=require(_0xbf23('0x8'));var sox=require(_0xbf23('0x9'));var csv=require(_0xbf23('0xa'));var ejs=require(_0xbf23('0xb'));var fs=require('fs');var _=require(_0xbf23('0xc'));var squel=require('squel');var crypto=require('crypto');var jsforce=require(_0xbf23('0xd'));var deskjs=require('desk.js');var toCsv=require(_0xbf23('0xa'));var querystring=require(_0xbf23('0xe'));var Papa=require(_0xbf23('0xf'));var Redis=require(_0xbf23('0x10'));var authService=require(_0xbf23('0x11'));var qs=require('../../components/parsers/qs');var as=require(_0xbf23('0x12'));var hardwareService=require(_0xbf23('0x13'));var logger=require(_0xbf23('0x14'))(_0xbf23('0x15'));var utils=require(_0xbf23('0x16'));var config=require(_0xbf23('0x17'));var db=require('../../mysqldb')['db'];function respondWithStatusCode(_0x2d4b94,_0x51e816){_0x51e816=_0x51e816||0xcc;return function(_0xd01a98){if(_0xd01a98){return _0x2d4b94['sendStatus'](_0x51e816);}return _0x2d4b94[_0xbf23('0x18')](_0x51e816)[_0xbf23('0x19')]();};}function respondWithResult(_0x4deb64,_0xb6880){_0xb6880=_0xb6880||0xc8;return function(_0x5a738f){if(_0x5a738f){return _0x4deb64['status'](_0xb6880)[_0xbf23('0x1a')](_0x5a738f);}};}function respondWithFilteredResult(_0x2fcf39,_0x5dd4f9){return function(_0x4cb2a8){if(_0x4cb2a8){var _0x1cc52b=_0x4cb2a8[_0xbf23('0x1b')],_0x581f9a=_0x5dd4f9[_0xbf23('0x1c')],_0x46ef3b=_0x5dd4f9['offset']+_0x5dd4f9['limit'],_0x14e587;if(_0x46ef3b>=_0x1cc52b){_0x46ef3b=_0x1cc52b;_0x14e587=0xc8;}else{_0x14e587=0xce;}_0x2fcf39['status'](_0x14e587);return _0x2fcf39[_0xbf23('0x1d')](_0xbf23('0x1e'),_0x581f9a+'-'+_0x46ef3b+'/'+_0x1cc52b)[_0xbf23('0x1a')](_0x4cb2a8);}return null;};}function patchUpdates(_0xf3c001){return function(_0x53f82c){try{jsonpatch[_0xbf23('0x1f')](_0x53f82c,_0xf3c001,!![]);}catch(_0x1b03b6){return BPromise[_0xbf23('0x20')](_0x1b03b6);}return _0x53f82c['save']();};}function saveUpdates(_0xcd02e6,_0x3b6f7e){return function(_0x2bc340){if(_0x2bc340){return _0x2bc340[_0xbf23('0x21')](_0xcd02e6)['then'](function(_0x2307f8){return _0x2307f8;});}return null;};}function removeEntity(_0x4ea717,_0xc683e8){return function(_0x5858c7){if(_0x5858c7){return _0x5858c7[_0xbf23('0x22')]()[_0xbf23('0x23')](function(){_0x4ea717[_0xbf23('0x18')](0xcc)[_0xbf23('0x19')]();});}};}function handleEntityNotFound(_0x5a4852,_0x5e65c8){return function(_0x5c6e8c){if(!_0x5c6e8c){_0x5a4852[_0xbf23('0x24')](0x194);}return _0x5c6e8c;};}function handleError(_0x1bf039,_0x5195bd){_0x5195bd=_0x5195bd||0x1f4;return function(_0x53fda2){logger[_0xbf23('0x25')](_0x53fda2[_0xbf23('0x26')]);if(_0x53fda2[_0xbf23('0x27')]){delete _0x53fda2[_0xbf23('0x27')];}_0x1bf039[_0xbf23('0x18')](_0x5195bd)[_0xbf23('0x28')](_0x53fda2);};}exports[_0xbf23('0x29')]=function(_0x224fa4,_0x3caf3a){var _0x177070={},_0x16b9ec={},_0x489a2e={'count':0x0,'rows':[]};var _0x5d3f5b=_[_0xbf23('0x2a')](db['FaxApplication'][_0xbf23('0x2b')],function(_0x16189f){return{'name':_0x16189f['fieldName'],'type':_0x16189f[_0xbf23('0x2c')]['key']};});_0x16b9ec['model']=_[_0xbf23('0x2a')](_0x5d3f5b,'name');_0x16b9ec[_0xbf23('0x2d')]=_[_0xbf23('0x2e')](_0x224fa4[_0xbf23('0x2d')]);_0x16b9ec[_0xbf23('0x2f')]=_[_0xbf23('0x30')](_0x16b9ec[_0xbf23('0x31')],_0x16b9ec[_0xbf23('0x2d')]);_0x177070[_0xbf23('0x32')]=_['intersection'](_0x16b9ec[_0xbf23('0x31')],qs[_0xbf23('0x33')](_0x224fa4['query']['fields']));_0x177070[_0xbf23('0x32')]=_0x177070['attributes'][_0xbf23('0x34')]?_0x177070[_0xbf23('0x32')]:_0x16b9ec[_0xbf23('0x31')];if(!_0x224fa4[_0xbf23('0x2d')][_0xbf23('0x35')](_0xbf23('0x36'))){_0x177070['limit']=qs['limit'](_0x224fa4[_0xbf23('0x2d')][_0xbf23('0x37')]);_0x177070['offset']=qs[_0xbf23('0x1c')](_0x224fa4['query']['offset']);}_0x177070[_0xbf23('0x38')]=qs[_0xbf23('0x39')](_0x224fa4[_0xbf23('0x2d')][_0xbf23('0x39')]);_0x177070['where']=qs[_0xbf23('0x2f')](_[_0xbf23('0x3a')](_0x224fa4[_0xbf23('0x2d')],_0x16b9ec[_0xbf23('0x2f')]));if(_0x224fa4[_0xbf23('0x2d')]['filter']){_0x177070['where']=_['merge'](_0x177070[_0xbf23('0x3b')],{'$or':_[_0xbf23('0x2a')](_0x5d3f5b,function(_0x481d8f){if(_0x481d8f['type']!==_0xbf23('0x3c')){var _0x11b3b0={};_0x11b3b0[_0x481d8f['name']]={'$like':'%'+_0x224fa4[_0xbf23('0x2d')][_0xbf23('0x3d')]+'%'};return _0x11b3b0;}})});}_0x177070=_['merge']({},_0x177070,_0x224fa4[_0xbf23('0x3e')]);var _0x132d3c={'where':_0x177070[_0xbf23('0x3b')]};return db['FaxApplication']['count'](_0x132d3c)[_0xbf23('0x23')](function(_0x24c3fb){_0x489a2e[_0xbf23('0x1b')]=_0x24c3fb;if(_0x224fa4[_0xbf23('0x2d')][_0xbf23('0x3f')]){_0x177070[_0xbf23('0x40')]=[{'all':!![]}];}return db['FaxApplication'][_0xbf23('0x41')](_0x177070);})['then'](function(_0xb53f8c){_0x489a2e[_0xbf23('0x42')]=_0xb53f8c;return _0x489a2e;})[_0xbf23('0x23')](respondWithFilteredResult(_0x3caf3a,_0x177070))[_0xbf23('0x43')](handleError(_0x3caf3a,null));};exports['show']=function(_0x4fb1f4,_0x495a74){var _0x5614b3={'raw':!![],'where':{'id':_0x4fb1f4['params']['id']}},_0x416c17={};_0x416c17[_0xbf23('0x31')]=_[_0xbf23('0x2e')](db['FaxApplication'][_0xbf23('0x2b')]);_0x416c17[_0xbf23('0x2d')]=_[_0xbf23('0x2e')](_0x4fb1f4[_0xbf23('0x2d')]);_0x416c17[_0xbf23('0x2f')]=_[_0xbf23('0x30')](_0x416c17['model'],_0x416c17['query']);_0x5614b3[_0xbf23('0x32')]=_[_0xbf23('0x30')](_0x416c17[_0xbf23('0x31')],qs[_0xbf23('0x33')](_0x4fb1f4['query']['fields']));_0x5614b3['attributes']=_0x5614b3[_0xbf23('0x32')][_0xbf23('0x34')]?_0x5614b3[_0xbf23('0x32')]:_0x416c17[_0xbf23('0x31')];if(_0x4fb1f4[_0xbf23('0x2d')][_0xbf23('0x3f')]){_0x5614b3['include']=[{'all':!![]}];}_0x5614b3=_[_0xbf23('0x44')]({},_0x5614b3,_0x4fb1f4['options']);return db[_0xbf23('0x45')][_0xbf23('0x46')](_0x5614b3)[_0xbf23('0x23')](handleEntityNotFound(_0x495a74,null))[_0xbf23('0x23')](respondWithResult(_0x495a74,null))[_0xbf23('0x43')](handleError(_0x495a74,null));};exports[_0xbf23('0x47')]=function(_0x3e24ac,_0x1bb23a){return db['FaxApplication'][_0xbf23('0x47')](_0x3e24ac['body'],{})[_0xbf23('0x23')](respondWithResult(_0x1bb23a,0xc9))[_0xbf23('0x43')](handleError(_0x1bb23a,null));};exports[_0xbf23('0x21')]=function(_0x5dc245,_0x81e0c9){if(_0x5dc245[_0xbf23('0x48')]['id']){delete _0x5dc245[_0xbf23('0x48')]['id'];}return db['FaxApplication'][_0xbf23('0x46')]({'where':{'id':_0x5dc245[_0xbf23('0x49')]['id']}})['then'](handleEntityNotFound(_0x81e0c9,null))['then'](saveUpdates(_0x5dc245[_0xbf23('0x48')],null))[_0xbf23('0x23')](respondWithResult(_0x81e0c9,null))[_0xbf23('0x43')](handleError(_0x81e0c9,null));};exports[_0xbf23('0x22')]=function(_0x11393d,_0x4bdfc0){return db[_0xbf23('0x45')]['find']({'where':{'id':_0x11393d['params']['id']}})[_0xbf23('0x23')](handleEntityNotFound(_0x4bdfc0,null))[_0xbf23('0x23')](removeEntity(_0x4bdfc0,null))[_0xbf23('0x43')](handleError(_0x4bdfc0,null));};
\ No newline at end of file
diff --git a/server/api/faxApplication/faxApplication.model.js b/server/api/faxApplication/faxApplication.model.js
index b9a2589..22b8553 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 _0xa6e4=['exports','define','FaxApplication','fax_applications','utf8mb4','utf8mb4_unicode_ci','lodash','util','api','moment','bluebird','path','rimraf','../../config/environment'];(function(_0x4429e0,_0xee6f1f){var _0x51a5b3=function(_0x16eb11){while(--_0x16eb11){_0x4429e0['push'](_0x4429e0['shift']());}};_0x51a5b3(++_0xee6f1f);}(_0xa6e4,0x19c));var _0x4a6e=function(_0x523ba9,_0x24dddd){_0x523ba9=_0x523ba9-0x0;var _0x4f9c73=_0xa6e4[_0x523ba9];return _0x4f9c73;};'use strict';var _=require(_0x4a6e('0x0'));var util=require(_0x4a6e('0x1'));var logger=require('../../config/logger')(_0x4a6e('0x2'));var moment=require(_0x4a6e('0x3'));var BPromise=require(_0x4a6e('0x4'));var rp=require('request-promise');var fs=require('fs');var path=require(_0x4a6e('0x5'));var rimraf=require(_0x4a6e('0x6'));var config=require(_0x4a6e('0x7'));var attributes=require('./faxApplication.attributes');module[_0x4a6e('0x8')]=function(_0x2e3357,_0x53c78b){return _0x2e3357[_0x4a6e('0x9')](_0x4a6e('0xa'),attributes,{'tableName':_0x4a6e('0xb'),'paranoid':![],'indexes':[],'timestamps':!![],'charset':_0x4a6e('0xc'),'collate':_0x4a6e('0xd')});};
\ No newline at end of file
+var _0x77a2=['rimraf','../../config/environment','define','FaxApplication','util','../../config/logger','moment','path'];(function(_0x3aebd0,_0x1ad8a7){var _0xcda4c0=function(_0x2865c8){while(--_0x2865c8){_0x3aebd0['push'](_0x3aebd0['shift']());}};_0xcda4c0(++_0x1ad8a7);}(_0x77a2,0x74));var _0x277a=function(_0x4e111b,_0x15928e){_0x4e111b=_0x4e111b-0x0;var _0x55c843=_0x77a2[_0x4e111b];return _0x55c843;};'use strict';var _=require('lodash');var util=require(_0x277a('0x0'));var logger=require(_0x277a('0x1'))('api');var moment=require(_0x277a('0x2'));var BPromise=require('bluebird');var rp=require('request-promise');var fs=require('fs');var path=require(_0x277a('0x3'));var rimraf=require(_0x277a('0x4'));var config=require(_0x277a('0x5'));var attributes=require('./faxApplication.attributes');module['exports']=function(_0xb8e98b,_0x4f93ca){return _0xb8e98b[_0x277a('0x6')](_0x277a('0x7'),attributes,{'tableName':'fax_applications','paranoid':![],'indexes':[],'timestamps':!![],'charset':'utf8mb4','collate':'utf8mb4_unicode_ci'});};
\ No newline at end of file
diff --git a/server/api/faxApplication/faxApplication.rpc.js b/server/api/faxApplication/faxApplication.rpc.js
index d38308d..7c07ca7 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 _0x5409=['error','code','message','result','catch','update','body','options','raw','attributes','limit','then','UpdateFaxApplication','debug','lodash','util','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/environment','client','http','request','info','FaxApplication,\x20%s,\x20%s','request\x20sent','FaxApplication,\x20%s,\x20%s,\x20%s','stringify'];(function(_0x11575c,_0xd83565){var _0x4625f6=function(_0x2f48b3){while(--_0x2f48b3){_0x11575c['push'](_0x11575c['shift']());}};_0x4625f6(++_0xd83565);}(_0x5409,0x125));var _0x9540=function(_0xb0765,_0x14a1fc){_0xb0765=_0xb0765-0x0;var _0x3c8ddb=_0x5409[_0xb0765];return _0x3c8ddb;};'use strict';var _=require(_0x9540('0x0'));var util=require(_0x9540('0x1'));var moment=require(_0x9540('0x2'));var BPromise=require(_0x9540('0x3'));var rs=require(_0x9540('0x4'));var fs=require('fs');var Redis=require(_0x9540('0x5'));var db=require(_0x9540('0x6'))['db'];var utils=require(_0x9540('0x7'));var logger=require('../../config/logger')('rpc');var config=require(_0x9540('0x8'));var jayson=require('jayson/promise');var client=jayson[_0x9540('0x9')][_0x9540('0xa')]({'port':0x232a});function respondWithRpcPromise(_0x3bfab6,_0xd92187,_0xb0658d){return new BPromise(function(_0x563512,_0x3cc83c){return client[_0x9540('0xb')](_0x3bfab6,_0xb0658d)['then'](function(_0x4247e6){logger[_0x9540('0xc')](_0x9540('0xd'),_0xd92187,_0x9540('0xe'));logger['debug'](_0x9540('0xf'),_0xd92187,_0x9540('0xe'),JSON[_0x9540('0x10')](_0x4247e6));if(_0x4247e6[_0x9540('0x11')]){if(_0x4247e6[_0x9540('0x11')][_0x9540('0x12')]===0x1f4){logger[_0x9540('0x11')](_0x9540('0xd'),_0xd92187,_0x4247e6['error'][_0x9540('0x13')]);return _0x3cc83c(_0x4247e6[_0x9540('0x11')][_0x9540('0x13')]);}logger[_0x9540('0x11')](_0x9540('0xd'),_0xd92187,_0x4247e6['error'][_0x9540('0x13')]);return _0x563512(_0x4247e6[_0x9540('0x11')]['message']);}else{logger['info'](_0x9540('0xd'),_0xd92187,_0x9540('0xe'));_0x563512(_0x4247e6[_0x9540('0x14')][_0x9540('0x13')]);}})[_0x9540('0x15')](function(_0x3cc70d){logger[_0x9540('0x11')](_0x9540('0xd'),_0xd92187,_0x3cc70d);_0x3cc83c(_0x3cc70d);});});}exports['UpdateFaxApplication']=function(_0x2ce7a9){var _0x403e49=this;return new Promise(function(_0x4fcbee,_0x2bc1c0){return db['FaxApplication'][_0x9540('0x16')](_0x2ce7a9[_0x9540('0x17')],{'raw':_0x2ce7a9['options']?_0x2ce7a9[_0x9540('0x18')][_0x9540('0x19')]===undefined?!![]:![]:!![],'individualHooks':!![],'where':_0x2ce7a9[_0x9540('0x18')]?_0x2ce7a9[_0x9540('0x18')]['where']||null:null,'attributes':_0x2ce7a9['options']?_0x2ce7a9['options'][_0x9540('0x1a')]||null:null,'limit':_0x2ce7a9[_0x9540('0x18')]?_0x2ce7a9[_0x9540('0x18')][_0x9540('0x1b')]||null:null})[_0x9540('0x1c')](function(_0x18c181){logger[_0x9540('0xc')](_0x9540('0x1d'),_0x2ce7a9);logger[_0x9540('0x1e')](_0x9540('0x1d'),_0x2ce7a9,JSON[_0x9540('0x10')](_0x18c181));_0x4fcbee(_0x18c181);})['catch'](function(_0x1a9b79){logger[_0x9540('0x11')](_0x9540('0x1d'),_0x1a9b79[_0x9540('0x13')],_0x2ce7a9);_0x2bc1c0(_0x403e49[_0x9540('0x11')](0x1f4,_0x1a9b79[_0x9540('0x13')]));});});};
\ No newline at end of file
+var _0xe843=['where','attributes','limit','then','lodash','util','randomstring','../../config/logger','rpc','../../config/environment','jayson/promise','http','request','info','FaxApplication,\x20%s,\x20%s','request\x20sent','debug','FaxApplication,\x20%s,\x20%s,\x20%s','stringify','error','message','catch','UpdateFaxApplication','update','body','options'];(function(_0x2d5bcf,_0x5bf682){var _0x32f2e8=function(_0x234c9a){while(--_0x234c9a){_0x2d5bcf['push'](_0x2d5bcf['shift']());}};_0x32f2e8(++_0x5bf682);}(_0xe843,0x170));var _0x3e84=function(_0x122ef9,_0x451d2a){_0x122ef9=_0x122ef9-0x0;var _0x42fba0=_0xe843[_0x122ef9];return _0x42fba0;};'use strict';var _=require(_0x3e84('0x0'));var util=require(_0x3e84('0x1'));var moment=require('moment');var BPromise=require('bluebird');var rs=require(_0x3e84('0x2'));var fs=require('fs');var Redis=require('ioredis');var db=require('../../mysqldb')['db'];var utils=require('../../config/utils');var logger=require(_0x3e84('0x3'))(_0x3e84('0x4'));var config=require(_0x3e84('0x5'));var jayson=require(_0x3e84('0x6'));var client=jayson['client'][_0x3e84('0x7')]({'port':0x232a});function respondWithRpcPromise(_0x5301c3,_0x402394,_0x249733){return new BPromise(function(_0x67e57f,_0x30ee9c){return client[_0x3e84('0x8')](_0x5301c3,_0x249733)['then'](function(_0x1f75ea){logger[_0x3e84('0x9')](_0x3e84('0xa'),_0x402394,_0x3e84('0xb'));logger[_0x3e84('0xc')](_0x3e84('0xd'),_0x402394,_0x3e84('0xb'),JSON[_0x3e84('0xe')](_0x1f75ea));if(_0x1f75ea[_0x3e84('0xf')]){if(_0x1f75ea['error']['code']===0x1f4){logger[_0x3e84('0xf')](_0x3e84('0xa'),_0x402394,_0x1f75ea[_0x3e84('0xf')]['message']);return _0x30ee9c(_0x1f75ea[_0x3e84('0xf')][_0x3e84('0x10')]);}logger[_0x3e84('0xf')](_0x3e84('0xa'),_0x402394,_0x1f75ea[_0x3e84('0xf')]['message']);return _0x67e57f(_0x1f75ea[_0x3e84('0xf')][_0x3e84('0x10')]);}else{logger['info'](_0x3e84('0xa'),_0x402394,_0x3e84('0xb'));_0x67e57f(_0x1f75ea['result'][_0x3e84('0x10')]);}})[_0x3e84('0x11')](function(_0x197772){logger[_0x3e84('0xf')](_0x3e84('0xa'),_0x402394,_0x197772);_0x30ee9c(_0x197772);});});}exports[_0x3e84('0x12')]=function(_0x524a69){var _0x2ec6ae=this;return new Promise(function(_0x39fac1,_0x454e3d){return db['FaxApplication'][_0x3e84('0x13')](_0x524a69[_0x3e84('0x14')],{'raw':_0x524a69['options']?_0x524a69[_0x3e84('0x15')]['raw']===undefined?!![]:![]:!![],'individualHooks':!![],'where':_0x524a69[_0x3e84('0x15')]?_0x524a69[_0x3e84('0x15')][_0x3e84('0x16')]||null:null,'attributes':_0x524a69[_0x3e84('0x15')]?_0x524a69['options'][_0x3e84('0x17')]||null:null,'limit':_0x524a69[_0x3e84('0x15')]?_0x524a69['options'][_0x3e84('0x18')]||null:null})[_0x3e84('0x19')](function(_0x37adf4){logger[_0x3e84('0x9')](_0x3e84('0x12'),_0x524a69);logger[_0x3e84('0xc')]('UpdateFaxApplication',_0x524a69,JSON['stringify'](_0x37adf4));_0x39fac1(_0x37adf4);})[_0x3e84('0x11')](function(_0x55f001){logger['error'](_0x3e84('0x12'),_0x55f001['message'],_0x524a69);_0x454e3d(_0x2ec6ae[_0x3e84('0xf')](0x1f4,_0x55f001[_0x3e84('0x10')]));});});};
\ No newline at end of file
diff --git a/server/api/faxApplication/index.js b/server/api/faxApplication/index.js
index 1e58f38..3081267 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 _0x038b=['update','delete','destroy','exports','util','path','connect-timeout','Router','../../components/interaction/service','../../config/environment','get','isAuthenticated','/:id','show','create','put'];(function(_0x5af18f,_0x1edad6){var _0x46a7a6=function(_0x220401){while(--_0x220401){_0x5af18f['push'](_0x5af18f['shift']());}};_0x46a7a6(++_0x1edad6);}(_0x038b,0x114));var _0xb038=function(_0x3e4192,_0x124bdb){_0x3e4192=_0x3e4192-0x0;var _0x3eb991=_0x038b[_0x3e4192];return _0x3eb991;};'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('./faxApplication.controller');router[_0xb038('0x6')]('/',auth[_0xb038('0x7')](),controller['index']);router['get'](_0xb038('0x8'),auth[_0xb038('0x7')](),controller[_0xb038('0x9')]);router['post']('/',auth['isAuthenticated'](),controller[_0xb038('0xa')]);router[_0xb038('0xb')]('/:id',auth['isAuthenticated'](),controller[_0xb038('0xc')]);router[_0xb038('0xd')]('/:id',auth[_0xb038('0x7')](),controller[_0xb038('0xe')]);module[_0xb038('0xf')]=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(_0x2fbf1d,_0x6ca410){var _0x1c1c28=function(_0x3ac4b6){while(--_0x3ac4b6){_0x2fbf1d['push'](_0x2fbf1d['shift']());}};_0x1c1c28(++_0x6ca410);}(_0x5fc3,0xa8));var _0x35fc=function(_0x5a7d41,_0x4447e2){_0x5a7d41=_0x5a7d41-0x0;var _0x98d8fa=_0x5fc3[_0x5a7d41];return _0x98d8fa;};'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 5fc6288..55ba1de 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 _0xe57a=['DATE','STRING','ENUM','out','BOOLEAN'];(function(_0x3c6b7d,_0x5f0d90){var _0x1d3ed2=function(_0x1a8f35){while(--_0x1a8f35){_0x3c6b7d['push'](_0x3c6b7d['shift']());}};_0x1d3ed2(++_0x5f0d90);}(_0xe57a,0x144));var _0xae57=function(_0xd427e9,_0x154151){_0xd427e9=_0xd427e9-0x0;var _0x223172=_0xe57a[_0xd427e9];return _0x223172;};'use strict';var Sequelize=require('sequelize');module['exports']={'closed':{'type':Sequelize[_0xae57('0x0')],'defaultValue':![]},'closedAt':{'type':Sequelize[_0xae57('0x1')]},'disposition':{'type':Sequelize[_0xae57('0x2')]},'note':{'type':Sequelize[_0xae57('0x2')]},'read1stAt':{'type':Sequelize[_0xae57('0x1')]},'fax':{'type':Sequelize[_0xae57('0x2')]},'firstMsgDirection':{'type':Sequelize[_0xae57('0x3')]('in',_0xae57('0x4')),'defaultValue':'in','allowNull':![]},'lastMsgAt':{'type':Sequelize[_0xae57('0x1')]},'lastMsgDirection':{'type':Sequelize[_0xae57('0x3')]('in','out'),'defaultValue':'in','allowNull':![]}};
\ No newline at end of file
+var _0x1eff=['ENUM','out','BOOLEAN','DATE','STRING'];(function(_0x1abcb5,_0x237039){var _0x51d039=function(_0xe213a9){while(--_0xe213a9){_0x1abcb5['push'](_0x1abcb5['shift']());}};_0x51d039(++_0x237039);}(_0x1eff,0x142));var _0xf1ef=function(_0x467fe3,_0x2c468f){_0x467fe3=_0x467fe3-0x0;var _0x17ae9a=_0x1eff[_0x467fe3];return _0x17ae9a;};'use strict';var Sequelize=require('sequelize');module['exports']={'closed':{'type':Sequelize[_0xf1ef('0x0')],'defaultValue':![]},'closedAt':{'type':Sequelize[_0xf1ef('0x1')]},'disposition':{'type':Sequelize[_0xf1ef('0x2')]},'note':{'type':Sequelize['STRING']},'read1stAt':{'type':Sequelize['DATE']},'fax':{'type':Sequelize[_0xf1ef('0x2')]},'firstMsgDirection':{'type':Sequelize[_0xf1ef('0x3')]('in',_0xf1ef('0x4')),'defaultValue':'in','allowNull':![]},'lastMsgAt':{'type':Sequelize[_0xf1ef('0x1')]},'lastMsgDirection':{'type':Sequelize[_0xf1ef('0x3')]('in',_0xf1ef('0x4')),'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 78019b2..3200d46 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 _0x4087=['rawAttributes','includeAll','include','options','create','update','describe','addMessage','ids','omit','getMessages','FaxMessage','hasOwnProperty','$gte','format','YYYY-MM-DD\x20HH:mm:ss','findAll','addTags','setTags','spread','color','emit','faxInteractionTags:save','removeTags','unix','root','files','server','attachments','transcript-%d-%s.zip','join','Attachment','Messages','basename','existsSync','pipe','download','html-pdf','zip-dir','fast-json-patch','request-promise','moment','bluebird','mustache','util','sox','lodash','squel','crypto','to-csv','querystring','papaparse','ioredis','../../components/parsers/advancedSearch','../../config/utils','../../mysqldb','redis','defaults','./faxInteraction.socket','register','sendStatus','status','end','json','count','offset','limit','Content-Range','apply','reject','save','destroy','then','error','stack','name','send','Users','fullname','Tags','TagIds','split','forEach','catch','index','map','fieldName','type','key','model','query','filters','attributes','intersection','fields','length','nolimit','order','sort','where','pick','select','field','from','tools_tags','u.id','u.fullname','ui.FaxInteractionId','user_has_fax_interactions','left_join','users','u.id\x20=\x20ui.UserId','fax_interactions','cm_contacts','c.id\x20=\x20i.ContactId\x20AND\x20c.deletedAt\x20IS\x20NULL','o.id\x20=\x20i.UserId','a.id\x20=\x20i.FaxAccountId','me.FaxInteractionId\x20=\x20i.id','fax_interaction_has_tags','it.FaxInteractionId\x20=\x20i.id','t.id\x20=\x20it.TagId','expr','search','sqlOperator','conditions','value','having','`\x20=\x200','Contact','operator','$substring','getFullTextValue','c.firstName\x20LIKE\x20?\x20OR\x20c.lastName\x20LIKE\x20?\x20OR\x20c.email\x20LIKE\x20?','ContactId','buildExpression','text','CONCAT(\x27,\x27,\x20`TagIds`,\x20\x27,\x27)\x20LIKE\x20?','union','User','CONCAT_WS(\x27\x20\x27,\x20o.name,\x20o.fullname)\x20LIKE\x20?','find','UserId','body','start','keys','some','compact','isEmpty','FaxAccountId','i.FaxAccountId\x20IN\x20?','createdAt','parse','$lte','null','\x20=\x20?','read','`unreadMessages`\x20=\x200','`unreadMessages`\x20>\x200','tag','isArray','filter','replace','isNumeric','i.fax\x20LIKE\x20?','Sequelize','QueryTypes','SELECT','clone','i.id','SUM(me.read\x20=\x200\x20AND\x20me.direction\x20=\x20\x27in\x27)','t.id\x20IN\x20?','resolve','journey','i.FaxAccountId\x20IS\x20NOT\x20NULL','user','getFaxAccounts','sequelize','toString','merge','unreadMessages','a.key','Account.key','a.mandatoryDisposition','Account.mandatoryDisposition','i.*','c.firstName','c.email','Contact.email','c.phone','Contact.mobile','c.fax','Contact.fax','Owner.fullname','ui.FaxInteractionId\x20IN\x20?','groupBy','FaxInteractionId','push','all','rows','show','params','FaxInteraction'];(function(_0xac99d9,_0x1d6a41){var _0x2c2432=function(_0x2db5b0){while(--_0x2db5b0){_0xac99d9['push'](_0xac99d9['shift']());}};_0x2c2432(++_0x1d6a41);}(_0x4087,0xef));var _0x7408=function(_0x2dafbe,_0x5d04de){_0x2dafbe=_0x2dafbe-0x0;var _0x58a45a=_0x4087[_0x2dafbe];return _0x58a45a;};'use strict';var pdf=require(_0x7408('0x0'));var emlformat=require('eml-format');var rimraf=require('rimraf');var zipdir=require(_0x7408('0x1'));var jsonpatch=require(_0x7408('0x2'));var rp=require(_0x7408('0x3'));var moment=require(_0x7408('0x4'));var BPromise=require(_0x7408('0x5'));var Mustache=require(_0x7408('0x6'));var util=require(_0x7408('0x7'));var path=require('path');var sox=require(_0x7408('0x8'));var csv=require('to-csv');var ejs=require('ejs');var fs=require('fs');var _=require(_0x7408('0x9'));var squel=require(_0x7408('0xa'));var crypto=require(_0x7408('0xb'));var jsforce=require('jsforce');var deskjs=require('desk.js');var toCsv=require(_0x7408('0xc'));var querystring=require(_0x7408('0xd'));var Papa=require(_0x7408('0xe'));var Redis=require(_0x7408('0xf'));var authService=require('../../components/auth/service');var qs=require('../../components/parsers/qs');var as=require(_0x7408('0x10'));var hardwareService=require('../../config/license/hardware');var logger=require('../../config/logger')('api');var utils=require(_0x7408('0x11'));var config=require('../../config/environment');var db=require(_0x7408('0x12'))['db'];config[_0x7408('0x13')]=_[_0x7408('0x14')](config['redis'],{'host':'localhost','port':0x18eb});var socket=require('socket.io-emitter')(new Redis(config[_0x7408('0x13')]));require(_0x7408('0x15'))[_0x7408('0x16')](socket);function respondWithStatusCode(_0x27dabc,_0x23465d){_0x23465d=_0x23465d||0xcc;return function(_0x268c6c){if(_0x268c6c){return _0x27dabc[_0x7408('0x17')](_0x23465d);}return _0x27dabc[_0x7408('0x18')](_0x23465d)[_0x7408('0x19')]();};}function respondWithResult(_0x4e1c4b,_0x12b45f){_0x12b45f=_0x12b45f||0xc8;return function(_0x14eaee){if(_0x14eaee){return _0x4e1c4b[_0x7408('0x18')](_0x12b45f)[_0x7408('0x1a')](_0x14eaee);}};}function respondWithFilteredResult(_0x9187c6,_0x47c8d0){return function(_0x5392ce){if(_0x5392ce){var _0x2ee935=_0x5392ce[_0x7408('0x1b')],_0x87567a=_0x47c8d0['offset'],_0x552e6a=_0x47c8d0[_0x7408('0x1c')]+_0x47c8d0[_0x7408('0x1d')],_0x323ad6;if(_0x552e6a>=_0x2ee935){_0x552e6a=_0x2ee935;_0x323ad6=0xc8;}else{_0x323ad6=0xce;}_0x9187c6[_0x7408('0x18')](_0x323ad6);return _0x9187c6['set'](_0x7408('0x1e'),_0x87567a+'-'+_0x552e6a+'/'+_0x2ee935)['json'](_0x5392ce);}return null;};}function patchUpdates(_0xe027e1){return function(_0x3f734a){try{jsonpatch[_0x7408('0x1f')](_0x3f734a,_0xe027e1,!![]);}catch(_0x198b71){return BPromise[_0x7408('0x20')](_0x198b71);}return _0x3f734a[_0x7408('0x21')]();};}function saveUpdates(_0x53f58f,_0x4a3acc){return function(_0x527342){if(_0x527342){return _0x527342['update'](_0x53f58f)['then'](function(_0x26b474){return _0x26b474;});}return null;};}function removeEntity(_0x49153c,_0x481572){return function(_0x4779bb){if(_0x4779bb){return _0x4779bb[_0x7408('0x22')]()[_0x7408('0x23')](function(){_0x49153c[_0x7408('0x18')](0xcc)[_0x7408('0x19')]();});}};}function handleEntityNotFound(_0x484a1c,_0x1dd4c8){return function(_0x320937){if(!_0x320937){_0x484a1c[_0x7408('0x17')](0x194);}return _0x320937;};}function handleError(_0x283b3a,_0x2eb0d5){_0x2eb0d5=_0x2eb0d5||0x1f4;return function(_0x46e780){logger[_0x7408('0x24')](_0x46e780[_0x7408('0x25')]);if(_0x46e780['name']){delete _0x46e780[_0x7408('0x26')];}_0x283b3a['status'](_0x2eb0d5)[_0x7408('0x27')](_0x46e780);};}function getInteractionUsers(_0x47d185,_0x3cb195){return new BPromise(function(_0x4f1190,_0x3f26e7){try{if(_0x3cb195[_0x47d185['id']]){_0x47d185[_0x7408('0x28')]=_['map'](_0x3cb195[_0x47d185['id']],function(_0x1eb36c){return{'id':_0x1eb36c['id'],'fullname':_0x1eb36c[_0x7408('0x29')]};});}}catch(_0x23739d){_0x3f26e7(_0x23739d);}_0x4f1190(_0x47d185);});}function getInteractionTags(_0x334401,_0x1f07d9){return new BPromise(function(_0x223cb2,_0x391fbc){try{if(_0x334401['TagIds']){_0x334401[_0x7408('0x2a')]=[];_0x334401[_0x7408('0x2b')][_0x7408('0x2c')](',')[_0x7408('0x2d')](function(_0x5385e6){_0x334401[_0x7408('0x2a')]['push'](_0x1f07d9[_0x5385e6]);});}delete _0x334401[_0x7408('0x2b')];}catch(_0x4a59e8){_0x391fbc(_0x4a59e8);}_0x223cb2(_0x334401);});}function updateFaxInteraction(_0x39a41a,_0xc050b3,_0x1f594c){return new BPromise(function(_0x841938,_0x4b65c1){return getInteractionUsers(_0x39a41a,_0x1f594c)[_0x7408('0x23')](function(_0x5d58db){return getInteractionTags(_0x5d58db,_0xc050b3);})[_0x7408('0x23')](function(_0x418f57){_0x841938(_0x418f57);})[_0x7408('0x2e')](function(_0x3c1137){_0x4b65c1(_0x3c1137);});});}exports[_0x7408('0x2f')]=function(_0x18cd8e,_0x23aab8){var _0xdde975={},_0x14b7d9={},_0x1c6c97={'count':0x0,'rows':[]};var _0x9d2abd=_[_0x7408('0x30')](db['FaxInteraction']['rawAttributes'],function(_0x4196b2){return{'name':_0x4196b2[_0x7408('0x31')],'type':_0x4196b2[_0x7408('0x32')][_0x7408('0x33')]};});_0x14b7d9[_0x7408('0x34')]=_['map'](_0x9d2abd,_0x7408('0x26'));_0x14b7d9[_0x7408('0x35')]=_['keys'](_0x18cd8e[_0x7408('0x35')]);_0x14b7d9[_0x7408('0x36')]=_['intersection'](_0x14b7d9[_0x7408('0x34')],_0x14b7d9[_0x7408('0x35')]);_0xdde975[_0x7408('0x37')]=_[_0x7408('0x38')](_0x14b7d9[_0x7408('0x34')],qs['fields'](_0x18cd8e[_0x7408('0x35')][_0x7408('0x39')]));_0xdde975[_0x7408('0x37')]=_0xdde975['attributes'][_0x7408('0x3a')]?_0xdde975[_0x7408('0x37')]:_0x14b7d9[_0x7408('0x34')];if(!_0x18cd8e[_0x7408('0x35')]['hasOwnProperty'](_0x7408('0x3b'))){_0xdde975[_0x7408('0x1d')]=qs['limit'](_0x18cd8e[_0x7408('0x35')][_0x7408('0x1d')]);_0xdde975[_0x7408('0x1c')]=qs[_0x7408('0x1c')](_0x18cd8e[_0x7408('0x35')][_0x7408('0x1c')]);}_0xdde975[_0x7408('0x3c')]=qs['sort'](_0x18cd8e[_0x7408('0x35')][_0x7408('0x3d')]);_0xdde975[_0x7408('0x3e')]=qs[_0x7408('0x36')](_[_0x7408('0x3f')](_0x18cd8e[_0x7408('0x35')],_0x14b7d9['filters']));var _0x280b5a=[];var _0x11486f=squel[_0x7408('0x40')]()['field']('id')[_0x7408('0x41')](_0x7408('0x26'))[_0x7408('0x41')]('color')[_0x7408('0x42')](_0x7408('0x43'));var _0x300248=squel[_0x7408('0x40')]()[_0x7408('0x41')](_0x7408('0x44'))['field'](_0x7408('0x45'))[_0x7408('0x41')](_0x7408('0x46'))[_0x7408('0x42')](_0x7408('0x47'),'ui')[_0x7408('0x48')](_0x7408('0x49'),'u',_0x7408('0x4a'));var _0x2f502e=squel[_0x7408('0x40')]()['from'](_0x7408('0x4b'),'i')['left_join'](_0x7408('0x4c'),'c',_0x7408('0x4d'))[_0x7408('0x48')](_0x7408('0x49'),'o',_0x7408('0x4e'))['left_join']('fax_accounts','a',_0x7408('0x4f'))[_0x7408('0x48')]('fax_messages','me',_0x7408('0x50'))[_0x7408('0x48')](_0x7408('0x51'),'it',_0x7408('0x52'))['left_join'](_0x7408('0x43'),'t',_0x7408('0x53'));var _0x170b47=squel['expr']();var _0x4367eb=[];var _0x52130a=squel[_0x7408('0x54')]();var _0x13f01e;if(_0x18cd8e[_0x7408('0x35')][_0x7408('0x55')]){_0x13f01e=as['parseSearch'](_0x18cd8e[_0x7408('0x35')]['search']);var _0x5eaa4d=_0x13f01e[_0x7408('0x56')];for(var _0x283e8c=0x0;_0x283e8c<_0x13f01e[_0x7408('0x57')]['length'];_0x283e8c++){var _0x3ba41d=_0x13f01e[_0x7408('0x57')][_0x283e8c];var _0x5e27f4='i';var _0x84b2bc=_['find'](_0x9d2abd,[_0x7408('0x26'),_0x3ba41d[_0x7408('0x41')]]);if(!_0x84b2bc){switch(_0x3ba41d['field']){case'unreadMessages':if(_0x3ba41d[_0x7408('0x58')]==0x1){_0x2f502e[_0x7408('0x59')]('`'+_0x3ba41d[_0x7408('0x41')]+_0x7408('0x5a'));}else{_0x2f502e['having']('`'+_0x3ba41d[_0x7408('0x41')]+'`\x20>\x200');}break;case _0x7408('0x5b'):if(_0x3ba41d[_0x7408('0x5c')]===_0x7408('0x5d')){if(_0x3ba41d[_0x7408('0x58')][_0x7408('0x2c')]('\x20')[_0x7408('0x3a')]>0x1){_0x170b47[_0x5eaa4d]('MATCH\x20(c.firstName,\x20c.lastName,\x20c.phone,\x20c.mobile,\x20c.fax,\x20c.email)\x20AGAINST\x20(?\x20IN\x20BOOLEAN\x20MODE)',qs[_0x7408('0x5e')](_0x3ba41d[_0x7408('0x58')]),null);}else{var _0x27b2a6='%'+_0x3ba41d['value']+'%';_0x170b47[_0x5eaa4d](_0x7408('0x5f'),_0x27b2a6,_0x27b2a6,_0x27b2a6);}}else{_0x84b2bc=_['find'](_0x9d2abd,[_0x7408('0x26'),_0x7408('0x60')]);_0x3ba41d[_0x7408('0x41')]=_0x7408('0x60');_0x10e75b=as[_0x7408('0x61')](_0x5e27f4,_0x84b2bc['type'],_0x3ba41d);_0x170b47[_0x5eaa4d](_0x10e75b[_0x7408('0x62')],_0x10e75b[_0x7408('0x58')]['start'],_0x10e75b['value']['end']);}break;case'Tag':var _0x233066=_0x3ba41d[_0x7408('0x58')][_0x7408('0x2c')](',')['map'](function(_0xc5be25){return Number(_0xc5be25);});_0x233066[_0x7408('0x2d')](function(_0x2f971d){_0x52130a['or'](_0x7408('0x63'),'%,'+_0x2f971d+',%');});_0x4367eb=_[_0x7408('0x64')](_0x4367eb,_0x233066);break;case _0x7408('0x65'):if(_0x3ba41d[_0x7408('0x5c')]===_0x7408('0x5d')){_0x170b47[_0x5eaa4d](_0x7408('0x66'),'%'+_0x3ba41d[_0x7408('0x58')]+'%',null);}else{_0x84b2bc=_[_0x7408('0x67')](_0x9d2abd,['name',_0x7408('0x68')]);_0x3ba41d[_0x7408('0x41')]=_0x7408('0x68');_0x10e75b=as[_0x7408('0x61')](_0x5e27f4,_0x84b2bc[_0x7408('0x32')],_0x3ba41d);_0x170b47[_0x5eaa4d](_0x10e75b[_0x7408('0x62')],_0x10e75b[_0x7408('0x58')]['start'],_0x10e75b['value'][_0x7408('0x19')]);}break;case _0x7408('0x69'):_0x10e75b=as[_0x7408('0x61')]('me',null,_0x3ba41d);_0x170b47[_0x5eaa4d](_0x10e75b['text'],_0x10e75b[_0x7408('0x58')][_0x7408('0x6a')],_0x10e75b[_0x7408('0x58')][_0x7408('0x19')]);break;}}else{var _0x10e75b=as[_0x7408('0x61')](_0x5e27f4,_0x84b2bc['type'],_0x3ba41d);_0x170b47[_0x5eaa4d](_0x10e75b['text'],_0x10e75b[_0x7408('0x58')][_0x7408('0x6a')],_0x10e75b[_0x7408('0x58')]['end']);}}}else{var _0x5b9a2c=_(_0x18cd8e[_0x7408('0x35')])[_0x7408('0x6b')]()['map'](function(_0x55ad8a){return _[_0x7408('0x6c')](_0x9d2abd,[_0x7408('0x26'),_0x55ad8a])?_0x55ad8a:undefined;})[_0x7408('0x6d')]()[_0x7408('0x58')]();if(!_[_0x7408('0x6e')](_0x5b9a2c)){_0x5b9a2c[_0x7408('0x2d')](function(_0x2e133a){if(_0x2e133a===_0x7408('0x6f')){_0x2f502e[_0x7408('0x3e')](_0x7408('0x70'),[]['concat'](_0x18cd8e[_0x7408('0x35')][_0x2e133a]));}else if(_0x2e133a===_0x7408('0x71')){var _0x554fe7=JSON[_0x7408('0x72')](_0x18cd8e['query'][_0x2e133a])['$gte'];var _0x514275=JSON['parse'](_0x18cd8e[_0x7408('0x35')][_0x2e133a])[_0x7408('0x73')];_0x2f502e[_0x7408('0x3e')]('i.createdAt\x20BETWEEN\x20?\x20AND\x20?',_0x554fe7,_0x514275);}else{if(_0x18cd8e[_0x7408('0x35')][_0x2e133a]===_0x7408('0x74')){_0x2f502e[_0x7408('0x3e')]('i.'+_0x2e133a+'\x20IS\x20NULL');}else{_0x2f502e['where']('i.'+_0x2e133a+_0x7408('0x75'),_0x18cd8e[_0x7408('0x35')][_0x2e133a]);}}});}if(_0x18cd8e[_0x7408('0x35')][_0x7408('0x76')]){if(_0x18cd8e[_0x7408('0x35')][_0x7408('0x76')]==0x1){_0x2f502e[_0x7408('0x59')](_0x7408('0x77'));}else{_0x2f502e[_0x7408('0x59')](_0x7408('0x78'));}}if(_0x18cd8e[_0x7408('0x35')][_0x7408('0x79')]){_0x4367eb=_[_0x7408('0x7a')](_0x18cd8e['query'][_0x7408('0x79')])?_0x18cd8e['query']['tag']:new Array(_0x18cd8e['query']['tag']);_0x4367eb[_0x7408('0x2d')](function(_0xd81c7f){_0x52130a['or']('CONCAT(\x27,\x27,\x20`TagIds`,\x20\x27,\x27)\x20LIKE\x20?','%,'+_0xd81c7f+',%');});}if(_0x18cd8e[_0x7408('0x35')][_0x7408('0x7b')]){var _0x7e6ea8=_0x18cd8e[_0x7408('0x35')][_0x7408('0x7b')][_0x7408('0x7c')]('\x5c','\x5c\x5c')[_0x7408('0x7c')]('\x27\x27','\x27\x27\x27\x27');if(qs[_0x7408('0x7d')](_0x7e6ea8)){_0x170b47['or']('i.id\x20LIKE\x20?',_0x7e6ea8+'%')['or'](_0x7408('0x7e'),_0x7e6ea8+'%');}_0x170b47['or']('CONCAT(c.firstName,\x20\x27\x20\x27,\x20c.lastName)\x20LIKE\x20?',_0x7e6ea8+'%');}}_0x2f502e[_0x7408('0x3e')](_0x170b47);_0x2f502e['group']('i.id');var _0x389da7={'type':db[_0x7408('0x7f')][_0x7408('0x80')][_0x7408('0x81')],'raw':!![]};var _0x21d864=_0x2f502e[_0x7408('0x82')]();_0x21d864[_0x7408('0x41')](_0x7408('0x83'));_0x21d864[_0x7408('0x41')](_0x7408('0x84'),'unreadMessages');if(_0xdde975[_0x7408('0x3c')]){_0xdde975[_0x7408('0x3c')][_0x7408('0x2d')](function(_0x1dd11a){_0x2f502e[_0x7408('0x3c')]('i.'+_0x1dd11a[0x0],_0x1dd11a[0x1]==='DESC'?![]:!![]);});}if(!_[_0x7408('0x6e')](_0x4367eb)){_0x2f502e['having'](_0x52130a);_0x21d864[_0x7408('0x3e')](_0x7408('0x85'),_0x4367eb);}BPromise[_0x7408('0x86')]()[_0x7408('0x23')](function(){if(!_0x13f01e){if(_0x18cd8e[_0x7408('0x35')]['FaxAccountId']||_0x18cd8e[_0x7408('0x35')][_0x7408('0x87')])return;_0x21d864[_0x7408('0x3e')](_0x7408('0x88'));_0x2f502e[_0x7408('0x3e')](_0x7408('0x88'));return;}return _0x18cd8e[_0x7408('0x89')][_0x7408('0x8a')]({'attributes':['id'],'raw':!![]})[_0x7408('0x23')](function(_0x3e4c20){if(_[_0x7408('0x6e')](_0x3e4c20)){_0x21d864[_0x7408('0x3e')]('i.FaxAccountId\x20IS\x20NULL');_0x2f502e[_0x7408('0x3e')]('i.FaxAccountId\x20IS\x20NULL');}else{_0x21d864[_0x7408('0x3e')](_0x7408('0x70'),_['map'](_0x3e4c20,'id'));_0x2f502e[_0x7408('0x3e')](_0x7408('0x70'),_['map'](_0x3e4c20,'id'));}});})['then'](function(){db[_0x7408('0x8b')][_0x7408('0x35')](_0x21d864[_0x7408('0x8c')](),_0x389da7)[_0x7408('0x23')](function(_0x3a9216){_0x1c6c97['count']=_0x3a9216[_0x7408('0x3a')];if(_0x1c6c97['count']===0x0)return[];return db[_0x7408('0x8b')]['query'](_0x11486f[_0x7408('0x8c')](),_0x389da7)['then'](function(_0x2fdba4){_0x280b5a=_['keyBy'](_0x2fdba4,'id');_0x389da7=_[_0x7408('0x8d')](_0x389da7,{'model':db['FaxInteraction'],'mapToModel':!![],'raw':!![],'nest':!![]});if(_0x18cd8e['query'][_0x7408('0x39')]){_0xdde975[_0x7408('0x37')][_0x7408('0x2d')](function(_0x2efc58){_0x2f502e['field']('i.'+_0x2efc58);});}else{_0x2f502e[_0x7408('0x41')](_0x7408('0x84'),_0x7408('0x8e'));_0x2f502e[_0x7408('0x41')](_0x7408('0x8f'),_0x7408('0x90'));_0x2f502e[_0x7408('0x41')](_0x7408('0x91'),_0x7408('0x92'));_0x2f502e['field'](_0x7408('0x93'));_0x2f502e[_0x7408('0x41')](_0x7408('0x94'),'Contact.firstName');_0x2f502e[_0x7408('0x41')]('c.lastName','Contact.lastName');_0x2f502e[_0x7408('0x41')](_0x7408('0x95'),_0x7408('0x96'));_0x2f502e['field'](_0x7408('0x97'),'Contact.phone');_0x2f502e['field']('c.mobile',_0x7408('0x98'));_0x2f502e['field'](_0x7408('0x99'),_0x7408('0x9a'));_0x2f502e['field']('o.fullname',_0x7408('0x9b'));_0x2f502e[_0x7408('0x41')]('o.internal','Owner.internal');_0x2f502e['field']('GROUP_CONCAT(DISTINCT\x20t.id)',_0x7408('0x2b'));}_0x2f502e[_0x7408('0x1d')](_0xdde975['limit']);_0x2f502e[_0x7408('0x1c')](_0xdde975[_0x7408('0x1c')]);return db[_0x7408('0x8b')][_0x7408('0x35')](_0x2f502e['toString'](),_0x389da7);})[_0x7408('0x23')](function(_0x52b601){_0x300248['where'](_0x7408('0x9c'),_[_0x7408('0x30')](_0x52b601,'id'));return db['sequelize'][_0x7408('0x35')](_0x300248[_0x7408('0x8c')](),_0x389da7)[_0x7408('0x23')](function(_0x1d9fef){var _0x4fd59a=_[_0x7408('0x9d')](_0x1d9fef,_0x7408('0x9e'));var _0x471019=[];_0x52b601[_0x7408('0x2d')](function(_0xd80cae){_0x471019[_0x7408('0x9f')](updateFaxInteraction(_0xd80cae,_0x280b5a,_0x4fd59a));});return BPromise[_0x7408('0xa0')](_0x471019);});});})[_0x7408('0x23')](function(_0x5c5428){_0x1c6c97[_0x7408('0xa1')]=_0x5c5428;return _0x1c6c97;})[_0x7408('0x23')](respondWithFilteredResult(_0x23aab8,_0xdde975));})[_0x7408('0x2e')](handleError(_0x23aab8,null));};exports[_0x7408('0xa2')]=function(_0x363e14,_0x42b57a){var _0x24855a={'raw':![],'where':{'id':_0x363e14[_0x7408('0xa3')]['id']}},_0x181129={};_0x181129[_0x7408('0x34')]=_[_0x7408('0x6b')](db[_0x7408('0xa4')][_0x7408('0xa5')]);_0x181129[_0x7408('0x35')]=_[_0x7408('0x6b')](_0x363e14[_0x7408('0x35')]);_0x181129[_0x7408('0x36')]=_[_0x7408('0x38')](_0x181129[_0x7408('0x34')],_0x181129[_0x7408('0x35')]);_0x24855a[_0x7408('0x37')]=_[_0x7408('0x38')](_0x181129[_0x7408('0x34')],qs[_0x7408('0x39')](_0x363e14[_0x7408('0x35')][_0x7408('0x39')]));_0x24855a[_0x7408('0x37')]=_0x24855a[_0x7408('0x37')][_0x7408('0x3a')]?_0x24855a[_0x7408('0x37')]:_0x181129[_0x7408('0x34')];if(_0x363e14[_0x7408('0x35')][_0x7408('0xa6')]){_0x24855a[_0x7408('0xa7')]=[{'all':!![]}];}_0x24855a=_[_0x7408('0x8d')]({},_0x24855a,_0x363e14[_0x7408('0xa8')]);return db['FaxInteraction'][_0x7408('0x67')](_0x24855a)[_0x7408('0x23')](handleEntityNotFound(_0x42b57a,null))[_0x7408('0x23')](respondWithResult(_0x42b57a,null))['catch'](handleError(_0x42b57a,null));};exports[_0x7408('0xa9')]=function(_0x162549,_0x58f622){return db[_0x7408('0xa4')][_0x7408('0xa9')](_0x162549['body'],{})['then'](respondWithResult(_0x58f622,0xc9))[_0x7408('0x2e')](handleError(_0x58f622,null));};exports[_0x7408('0xaa')]=function(_0x2d8038,_0x57e473){if(_0x2d8038['body']['id']){delete _0x2d8038[_0x7408('0x69')]['id'];}return db['FaxInteraction']['find']({'where':{'id':_0x2d8038['params']['id']}})[_0x7408('0x23')](handleEntityNotFound(_0x57e473,null))[_0x7408('0x23')](saveUpdates(_0x2d8038[_0x7408('0x69')],null))['then'](respondWithResult(_0x57e473,null))['catch'](handleError(_0x57e473,null));};exports[_0x7408('0x22')]=function(_0x8237d2,_0x4c7f64){return db[_0x7408('0xa4')][_0x7408('0x67')]({'where':{'id':_0x8237d2[_0x7408('0xa3')]['id']}})[_0x7408('0x23')](handleEntityNotFound(_0x4c7f64,null))[_0x7408('0x23')](removeEntity(_0x4c7f64,null))[_0x7408('0x2e')](handleError(_0x4c7f64,null));};exports[_0x7408('0xab')]=function(_0x385e12,_0x56b32d){return db[_0x7408('0xa4')][_0x7408('0xab')]()['then'](respondWithResult(_0x56b32d,null))[_0x7408('0x2e')](handleError(_0x56b32d,null));};exports['addMessage']=function(_0x442a98,_0x1f5293,_0x5c06f0){return db['FaxMessage'][_0x7408('0x67')]({'where':{'id':_0x442a98['params']['id']}})['then'](handleEntityNotFound(_0x1f5293,null))['then'](function(_0x5c1532){if(_0x5c1532){return _0x5c1532[_0x7408('0xac')](_0x442a98[_0x7408('0x69')][_0x7408('0xad')],_[_0x7408('0xae')](_0x442a98[_0x7408('0x69')],[_0x7408('0xad'),'id'])||{});}})[_0x7408('0x23')](respondWithResult(_0x1f5293,null))[_0x7408('0x2e')](handleError(_0x1f5293,null));};exports[_0x7408('0xaf')]=function(_0x49deeb,_0xffd3f8,_0x2cd957){var _0x5ad6af={'raw':![],'where':{}};var _0x1e57a6={};var _0x384bc9={'count':0x0,'rows':[]};return db[_0x7408('0xa4')]['findOne']({'where':{'id':_0x49deeb[_0x7408('0xa3')]['id']}})[_0x7408('0x23')](handleEntityNotFound(_0xffd3f8,null))['then'](function(_0x13a12){if(_0x13a12){_0x1e57a6[_0x7408('0x34')]=_[_0x7408('0x6b')](db[_0x7408('0xb0')]['rawAttributes']);_0x1e57a6[_0x7408('0x35')]=_[_0x7408('0x6b')](_0x49deeb[_0x7408('0x35')]);_0x1e57a6[_0x7408('0x36')]=_[_0x7408('0x38')](_0x1e57a6[_0x7408('0x34')],_0x1e57a6[_0x7408('0x35')]);_0x5ad6af[_0x7408('0x37')]=_[_0x7408('0x38')](_0x1e57a6['model'],qs[_0x7408('0x39')](_0x49deeb[_0x7408('0x35')][_0x7408('0x39')]));_0x5ad6af[_0x7408('0x37')]=_0x5ad6af[_0x7408('0x37')][_0x7408('0x3a')]?_0x5ad6af[_0x7408('0x37')]:_0x1e57a6['model'];if(!_0x49deeb[_0x7408('0x35')][_0x7408('0xb1')](_0x7408('0x3b'))){_0x5ad6af[_0x7408('0x1d')]=qs['limit'](_0x49deeb[_0x7408('0x35')][_0x7408('0x1d')]);_0x5ad6af[_0x7408('0x1c')]=qs['offset'](_0x49deeb[_0x7408('0x35')][_0x7408('0x1c')]);}_0x5ad6af[_0x7408('0x3c')]=qs['sort'](_0x49deeb[_0x7408('0x35')][_0x7408('0x3d')]);_0x5ad6af[_0x7408('0x3e')]=qs[_0x7408('0x36')](_['pick'](_0x49deeb[_0x7408('0x35')],_0x1e57a6[_0x7408('0x36')]));_0x5ad6af[_0x7408('0x3e')][_0x7408('0x9e')]=_0x13a12['id'];if(_0x49deeb['query'][_0x7408('0x7b')]){_0x5ad6af['where']=_[_0x7408('0x8d')](_0x5ad6af[_0x7408('0x3e')],{'$or':_[_0x7408('0x30')](_0x5ad6af[_0x7408('0x37')],function(_0xd37750){var _0x4573e4={};_0x4573e4[_0xd37750]={'$like':'%'+_0x49deeb[_0x7408('0x35')][_0x7408('0x7b')]+'%'};return _0x4573e4;})});}if(_0x49deeb[_0x7408('0x35')][_0x7408('0xb2')]){var _0x18639f=_0x49deeb['query']['$gte'][_0x7408('0x2c')](',');var _0x1954a7={};_0x1954a7[_0x18639f[0x0]]={'$gte':moment(_0x18639f[0x1])[_0x7408('0xb3')](_0x7408('0xb4'))};_0x5ad6af[_0x7408('0x3e')]=_['merge'](_0x5ad6af[_0x7408('0x3e')],_0x1954a7);}_0x5ad6af=_[_0x7408('0x8d')]({},_0x5ad6af,_0x49deeb[_0x7408('0xa8')]);return db[_0x7408('0xb0')][_0x7408('0x1b')]({'where':_0x5ad6af['where']})[_0x7408('0x23')](function(_0x211b45){_0x384bc9['count']=_0x211b45;if(_0x49deeb[_0x7408('0x35')][_0x7408('0xa6')]){_0x5ad6af[_0x7408('0xa7')]=[{'all':!![]}];}return db[_0x7408('0xb0')][_0x7408('0xb5')](_0x5ad6af);})[_0x7408('0x23')](function(_0x3d68be){_0x384bc9[_0x7408('0xa1')]=_0x3d68be;return _0x384bc9;});}})[_0x7408('0x23')](respondWithFilteredResult(_0xffd3f8,_0x5ad6af))[_0x7408('0x2e')](handleError(_0xffd3f8,null));};exports[_0x7408('0xb6')]=function(_0x143dc2,_0x91c976,_0x3d76f1){return db[_0x7408('0xa4')][_0x7408('0x67')]({'where':{'id':_0x143dc2[_0x7408('0xa3')]['id']}})[_0x7408('0x23')](handleEntityNotFound(_0x91c976,null))[_0x7408('0x23')](function(_0x2f48da){if(_0x2f48da){return _0x2f48da[_0x7408('0xb7')](_0x143dc2[_0x7408('0x69')][_0x7408('0xad')],_[_0x7408('0xae')](_0x143dc2['body'],[_0x7408('0xad'),'id'])||{})[_0x7408('0xb8')](function(){return db['Tag']['findAll']({'attributes':['id',_0x7408('0x26'),_0x7408('0xb9')],'where':{'id':_0x143dc2[_0x7408('0x69')][_0x7408('0xad')]}});})['then'](function(_0x5b7883){socket[_0x7408('0xba')](_0x7408('0xbb'),{'id':Number(_0x143dc2[_0x7408('0xa3')]['id']),'tags':_0x5b7883||[]});return{'id':Number(_0x143dc2[_0x7408('0xa3')]['id']),'tags':_0x5b7883||[]};});}})[_0x7408('0x23')](respondWithResult(_0x91c976,null))[_0x7408('0x2e')](handleError(_0x91c976,null));};exports[_0x7408('0xbc')]=function(_0x3b7b8d,_0x30165e,_0x53bd12){return db[_0x7408('0xa4')][_0x7408('0x67')]({'where':{'id':_0x3b7b8d[_0x7408('0xa3')]['id']}})[_0x7408('0x23')](handleEntityNotFound(_0x30165e,null))[_0x7408('0x23')](function(_0x5a4b31){if(_0x5a4b31){return _0x5a4b31['removeTags'](_0x3b7b8d[_0x7408('0x35')][_0x7408('0xad')]);}})[_0x7408('0x23')](respondWithStatusCode(_0x30165e,null))['catch'](handleError(_0x30165e,null));};exports['download']=function(_0x1dd3ad,_0x5f4192){var _0x1e9cae=moment()[_0x7408('0xbd')]()[_0x7408('0x8c')]();var _0x33a2ab=path['join'](config[_0x7408('0xbe')],'server',_0x7408('0xbf'),'tmp');var _0x4664fa=path['join'](config[_0x7408('0xbe')],_0x7408('0xc0'),_0x7408('0xbf'),_0x7408('0xc1'));var _0x3e2280=path['join'](_0x33a2ab,_0x1e9cae);var _0x57dffe=util[_0x7408('0xb3')](_0x7408('0xc2'),_0x1dd3ad[_0x7408('0xa3')]['id'],_0x1e9cae);var _0x22dcb6=path[_0x7408('0xc3')](_0x33a2ab,_0x57dffe);var _0x3e5543=[];_0x3e5543[_0x7408('0x9f')]({'model':db[_0x7408('0xc4')],'as':_0x7408('0xc4'),'raw':!![]});var _0x33c65b=[{'model':db['FaxMessage'],'as':'Messages','attributes':['id',_0x7408('0x69'),'createdAt'],'include':_0x3e5543}];return db[_0x7408('0xa4')][_0x7408('0x67')]({'where':{'id':_0x1dd3ad['params']['id']},'include':_0x33c65b})[_0x7408('0x23')](handleEntityNotFound(_0x5f4192,null))[_0x7408('0x23')](function(_0x3e5d03){if(_0x3e5d03&&_0x3e5d03[_0x7408('0xc5')]){var _0x7028df=_0x3e5d03['get']({'plain':!![]});fs['mkdirSync'](_0x3e2280);for(var _0xf548d7=0x0;_0xf548d7<_0x7028df[_0x7408('0xc5')][_0x7408('0x3a')];_0xf548d7++){var _0x5ec21c=_0x7028df[_0x7408('0xc5')][_0xf548d7][_0x7408('0xc4')];if(_0x5ec21c){var _0x591a30=path['join'](_0x4664fa,_0x5ec21c[_0x7408('0xc6')]);if(fs[_0x7408('0xc7')](_0x591a30)){fs['createReadStream'](_0x591a30)[_0x7408('0xc8')](fs['createWriteStream'](path['join'](_0x3e2280,_0x5ec21c[_0x7408('0xc6')])));}}}return BPromise[_0x7408('0x86')]()[_0x7408('0x23')](function(){return new BPromise(function(_0x5c5e66,_0x2fd290){zipdir(_0x3e2280,{'saveTo':_0x22dcb6},function(_0x3e7e99,_0x173ecd){if(_0x3e7e99)return _0x2fd290(_0x3e7e99);return _0x5c5e66(_0x173ecd);});})[_0x7408('0x23')](function(){return new BPromise(function(_0x510ffb,_0x3a3588){rimraf(_0x3e2280,function(_0x5d3774){if(_0x5d3774)_0x3a3588(_0x5d3774);return _0x510ffb();});});})['then'](function(){return _0x5f4192[_0x7408('0xc9')](_0x22dcb6,_0x57dffe,function(_0x336a10){if(_0x336a10){console['log']('err',_0x336a10);}else{fs['unlinkSync'](_0x22dcb6);}});});});}else{return _0x5f4192['sendStatus'](0xc8);}})['catch'](handleError(_0x5f4192,null));};
\ No newline at end of file
+var _0xde2b=['conditions','find','unreadMessages','value','having','Contact','operator','$substring','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','CONCAT(\x27,\x27,\x20`TagIds`,\x20\x27,\x27)\x20LIKE\x20?','union','CONCAT_WS(\x27\x20\x27,\x20o.name,\x20o.fullname)\x20LIKE\x20?','UserId','some','compact','isEmpty','FaxAccountId','i.FaxAccountId\x20IN\x20?','createdAt','parse','$gte','$lte','i.createdAt\x20BETWEEN\x20?\x20AND\x20?','null','\x20IS\x20NULL','read','`unreadMessages`\x20>\x200','tag','filter','\x27\x27\x27\x27','isNumeric','i.id\x20LIKE\x20?','CONCAT(c.firstName,\x20\x27\x20\x27,\x20c.lastName)\x20LIKE\x20?','i.id','Sequelize','QueryTypes','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','i.FaxAccountId\x20IS\x20NULL','toString','sequelize','keyBy','merge','Account.key','a.mandatoryDisposition','Account.mandatoryDisposition','i.*','c.firstName','c.lastName','Contact.lastName','c.email','Contact.email','c.phone','Contact.phone','c.mobile','Contact.mobile','Contact.fax','Owner.fullname','o.internal','GROUP_CONCAT(DISTINCT\x20t.id)','ui.FaxInteractionId\x20IN\x20?','groupBy','FaxInteractionId','rows','show','params','includeAll','options','create','body','describe','FaxMessage','addMessage','ids','getMessages','format','YYYY-MM-DD\x20HH:mm:ss','include','findAll','setTags','spread','emit','removeTags','download','unix','join','root','files','tmp','server','transcript-%d-%s.zip','Attachment','Messages','get','mkdirSync','basename','existsSync','pipe','createWriteStream','log','err','unlinkSync','html-pdf','rimraf','zip-dir','fast-json-patch','moment','bluebird','mustache','util','path','sox','to-csv','ejs','lodash','squel','crypto','desk.js','querystring','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/environment','../../mysqldb','redis','defaults','localhost','socket.io-emitter','./faxInteraction.socket','status','json','count','offset','set','Content-Range','apply','reject','update','end','sendStatus','error','stack','name','send','Users','map','TagIds','Tags','split','forEach','push','then','catch','index','FaxInteraction','fieldName','type','key','keys','query','filters','intersection','attributes','fields','length','model','hasOwnProperty','nolimit','limit','order','sort','where','pick','select','field','color','from','tools_tags','u.id','ui.FaxInteractionId','user_has_fax_interactions','left_join','u.id\x20=\x20ui.UserId','fax_interactions','c.id\x20=\x20i.ContactId\x20AND\x20c.deletedAt\x20IS\x20NULL','users','fax_accounts','fax_messages','me.FaxInteractionId\x20=\x20i.id','t.id\x20=\x20it.TagId','expr','parseSearch','search'];(function(_0x321bb2,_0x202794){var _0x9c12ed=function(_0x263dd3){while(--_0x263dd3){_0x321bb2['push'](_0x321bb2['shift']());}};_0x9c12ed(++_0x202794);}(_0xde2b,0x72));var _0xbde2=function(_0x1d2ed2,_0x32c0d2){_0x1d2ed2=_0x1d2ed2-0x0;var _0x1a9451=_0xde2b[_0x1d2ed2];return _0x1a9451;};'use strict';var pdf=require(_0xbde2('0x0'));var emlformat=require('eml-format');var rimraf=require(_0xbde2('0x1'));var zipdir=require(_0xbde2('0x2'));var jsonpatch=require(_0xbde2('0x3'));var rp=require('request-promise');var moment=require(_0xbde2('0x4'));var BPromise=require(_0xbde2('0x5'));var Mustache=require(_0xbde2('0x6'));var util=require(_0xbde2('0x7'));var path=require(_0xbde2('0x8'));var sox=require(_0xbde2('0x9'));var csv=require(_0xbde2('0xa'));var ejs=require(_0xbde2('0xb'));var fs=require('fs');var _=require(_0xbde2('0xc'));var squel=require(_0xbde2('0xd'));var crypto=require(_0xbde2('0xe'));var jsforce=require('jsforce');var deskjs=require(_0xbde2('0xf'));var toCsv=require(_0xbde2('0xa'));var querystring=require(_0xbde2('0x10'));var Papa=require('papaparse');var Redis=require(_0xbde2('0x11'));var authService=require(_0xbde2('0x12'));var qs=require(_0xbde2('0x13'));var as=require(_0xbde2('0x14'));var hardwareService=require(_0xbde2('0x15'));var logger=require(_0xbde2('0x16'))(_0xbde2('0x17'));var utils=require(_0xbde2('0x18'));var config=require(_0xbde2('0x19'));var db=require(_0xbde2('0x1a'))['db'];config[_0xbde2('0x1b')]=_[_0xbde2('0x1c')](config[_0xbde2('0x1b')],{'host':_0xbde2('0x1d'),'port':0x18eb});var socket=require(_0xbde2('0x1e'))(new Redis(config[_0xbde2('0x1b')]));require(_0xbde2('0x1f'))['register'](socket);function respondWithStatusCode(_0x153c12,_0x550c18){_0x550c18=_0x550c18||0xcc;return function(_0x21c650){if(_0x21c650){return _0x153c12['sendStatus'](_0x550c18);}return _0x153c12[_0xbde2('0x20')](_0x550c18)['end']();};}function respondWithResult(_0x46e88a,_0x40e538){_0x40e538=_0x40e538||0xc8;return function(_0x298503){if(_0x298503){return _0x46e88a[_0xbde2('0x20')](_0x40e538)[_0xbde2('0x21')](_0x298503);}};}function respondWithFilteredResult(_0x2ce862,_0x22cf88){return function(_0x2d47ff){if(_0x2d47ff){var _0x17de7e=_0x2d47ff[_0xbde2('0x22')],_0x4fbe94=_0x22cf88[_0xbde2('0x23')],_0x46eb1d=_0x22cf88[_0xbde2('0x23')]+_0x22cf88['limit'],_0x4e438a;if(_0x46eb1d>=_0x17de7e){_0x46eb1d=_0x17de7e;_0x4e438a=0xc8;}else{_0x4e438a=0xce;}_0x2ce862['status'](_0x4e438a);return _0x2ce862[_0xbde2('0x24')](_0xbde2('0x25'),_0x4fbe94+'-'+_0x46eb1d+'/'+_0x17de7e)['json'](_0x2d47ff);}return null;};}function patchUpdates(_0xe49a44){return function(_0xcc72cb){try{jsonpatch[_0xbde2('0x26')](_0xcc72cb,_0xe49a44,!![]);}catch(_0x4fadc0){return BPromise[_0xbde2('0x27')](_0x4fadc0);}return _0xcc72cb['save']();};}function saveUpdates(_0x510cd5,_0x313cfe){return function(_0x34140a){if(_0x34140a){return _0x34140a[_0xbde2('0x28')](_0x510cd5)['then'](function(_0x54c07d){return _0x54c07d;});}return null;};}function removeEntity(_0x5ed4f9,_0x157498){return function(_0x27cc3e){if(_0x27cc3e){return _0x27cc3e['destroy']()['then'](function(){_0x5ed4f9['status'](0xcc)[_0xbde2('0x29')]();});}};}function handleEntityNotFound(_0x5a62a5,_0x1c16a3){return function(_0x366e4b){if(!_0x366e4b){_0x5a62a5[_0xbde2('0x2a')](0x194);}return _0x366e4b;};}function handleError(_0x53c232,_0x5ed965){_0x5ed965=_0x5ed965||0x1f4;return function(_0x43e3fb){logger[_0xbde2('0x2b')](_0x43e3fb[_0xbde2('0x2c')]);if(_0x43e3fb[_0xbde2('0x2d')]){delete _0x43e3fb[_0xbde2('0x2d')];}_0x53c232[_0xbde2('0x20')](_0x5ed965)[_0xbde2('0x2e')](_0x43e3fb);};}function getInteractionUsers(_0x5cc866,_0x58e697){return new BPromise(function(_0x5222c3,_0x444096){try{if(_0x58e697[_0x5cc866['id']]){_0x5cc866[_0xbde2('0x2f')]=_[_0xbde2('0x30')](_0x58e697[_0x5cc866['id']],function(_0x35df73){return{'id':_0x35df73['id'],'fullname':_0x35df73['fullname']};});}}catch(_0x5dfd0c){_0x444096(_0x5dfd0c);}_0x5222c3(_0x5cc866);});}function getInteractionTags(_0x3df325,_0x54405b){return new BPromise(function(_0x258f50,_0x368f78){try{if(_0x3df325[_0xbde2('0x31')]){_0x3df325[_0xbde2('0x32')]=[];_0x3df325[_0xbde2('0x31')][_0xbde2('0x33')](',')[_0xbde2('0x34')](function(_0x30d829){_0x3df325[_0xbde2('0x32')][_0xbde2('0x35')](_0x54405b[_0x30d829]);});}delete _0x3df325[_0xbde2('0x31')];}catch(_0x23d534){_0x368f78(_0x23d534);}_0x258f50(_0x3df325);});}function updateFaxInteraction(_0x38188c,_0x3a8e1b,_0x3f7b01){return new BPromise(function(_0xe0bd81,_0x185e2f){return getInteractionUsers(_0x38188c,_0x3f7b01)[_0xbde2('0x36')](function(_0x1f3851){return getInteractionTags(_0x1f3851,_0x3a8e1b);})['then'](function(_0x20a173){_0xe0bd81(_0x20a173);})[_0xbde2('0x37')](function(_0x48c2ba){_0x185e2f(_0x48c2ba);});});}exports[_0xbde2('0x38')]=function(_0x592840,_0x397721){var _0x1ac72a={},_0x31016={},_0x35129a={'count':0x0,'rows':[]};var _0x3107f4=_['map'](db[_0xbde2('0x39')]['rawAttributes'],function(_0x117de5){return{'name':_0x117de5[_0xbde2('0x3a')],'type':_0x117de5[_0xbde2('0x3b')][_0xbde2('0x3c')]};});_0x31016['model']=_['map'](_0x3107f4,_0xbde2('0x2d'));_0x31016['query']=_[_0xbde2('0x3d')](_0x592840[_0xbde2('0x3e')]);_0x31016[_0xbde2('0x3f')]=_[_0xbde2('0x40')](_0x31016['model'],_0x31016[_0xbde2('0x3e')]);_0x1ac72a[_0xbde2('0x41')]=_[_0xbde2('0x40')](_0x31016['model'],qs[_0xbde2('0x42')](_0x592840[_0xbde2('0x3e')]['fields']));_0x1ac72a[_0xbde2('0x41')]=_0x1ac72a['attributes'][_0xbde2('0x43')]?_0x1ac72a['attributes']:_0x31016[_0xbde2('0x44')];if(!_0x592840['query'][_0xbde2('0x45')](_0xbde2('0x46'))){_0x1ac72a[_0xbde2('0x47')]=qs[_0xbde2('0x47')](_0x592840[_0xbde2('0x3e')][_0xbde2('0x47')]);_0x1ac72a['offset']=qs[_0xbde2('0x23')](_0x592840[_0xbde2('0x3e')][_0xbde2('0x23')]);}_0x1ac72a[_0xbde2('0x48')]=qs[_0xbde2('0x49')](_0x592840[_0xbde2('0x3e')][_0xbde2('0x49')]);_0x1ac72a[_0xbde2('0x4a')]=qs[_0xbde2('0x3f')](_[_0xbde2('0x4b')](_0x592840[_0xbde2('0x3e')],_0x31016['filters']));var _0x5eb498=[];var _0x49dbc9=squel[_0xbde2('0x4c')]()[_0xbde2('0x4d')]('id')[_0xbde2('0x4d')](_0xbde2('0x2d'))[_0xbde2('0x4d')](_0xbde2('0x4e'))[_0xbde2('0x4f')](_0xbde2('0x50'));var _0x4e526e=squel['select']()[_0xbde2('0x4d')](_0xbde2('0x51'))[_0xbde2('0x4d')]('u.fullname')[_0xbde2('0x4d')](_0xbde2('0x52'))[_0xbde2('0x4f')](_0xbde2('0x53'),'ui')[_0xbde2('0x54')]('users','u',_0xbde2('0x55'));var _0x4e0b0f=squel[_0xbde2('0x4c')]()[_0xbde2('0x4f')](_0xbde2('0x56'),'i')[_0xbde2('0x54')]('cm_contacts','c',_0xbde2('0x57'))[_0xbde2('0x54')](_0xbde2('0x58'),'o','o.id\x20=\x20i.UserId')[_0xbde2('0x54')](_0xbde2('0x59'),'a','a.id\x20=\x20i.FaxAccountId')[_0xbde2('0x54')](_0xbde2('0x5a'),'me',_0xbde2('0x5b'))[_0xbde2('0x54')]('fax_interaction_has_tags','it','it.FaxInteractionId\x20=\x20i.id')[_0xbde2('0x54')](_0xbde2('0x50'),'t',_0xbde2('0x5c'));var _0x2bf9d8=squel[_0xbde2('0x5d')]();var _0x48ae72=[];var _0x4ad713=squel[_0xbde2('0x5d')]();var _0x27bc99;if(_0x592840[_0xbde2('0x3e')]['search']){_0x27bc99=as[_0xbde2('0x5e')](_0x592840[_0xbde2('0x3e')][_0xbde2('0x5f')]);var _0x5d0c1b=_0x27bc99['sqlOperator'];for(var _0x185940=0x0;_0x185940<_0x27bc99[_0xbde2('0x60')][_0xbde2('0x43')];_0x185940++){var _0x13cabc=_0x27bc99[_0xbde2('0x60')][_0x185940];var _0x39daa1='i';var _0x11d8fc=_[_0xbde2('0x61')](_0x3107f4,[_0xbde2('0x2d'),_0x13cabc[_0xbde2('0x4d')]]);if(!_0x11d8fc){switch(_0x13cabc['field']){case _0xbde2('0x62'):if(_0x13cabc[_0xbde2('0x63')]==0x1){_0x4e0b0f[_0xbde2('0x64')]('`'+_0x13cabc['field']+'`\x20=\x200');}else{_0x4e0b0f[_0xbde2('0x64')]('`'+_0x13cabc['field']+'`\x20>\x200');}break;case _0xbde2('0x65'):if(_0x13cabc[_0xbde2('0x66')]===_0xbde2('0x67')){if(_0x13cabc['value'][_0xbde2('0x33')]('\x20')[_0xbde2('0x43')]>0x1){_0x2bf9d8[_0x5d0c1b](_0xbde2('0x68'),qs[_0xbde2('0x69')](_0x13cabc[_0xbde2('0x63')]),null);}else{var _0x7cb80a='%'+_0x13cabc[_0xbde2('0x63')]+'%';_0x2bf9d8[_0x5d0c1b](_0xbde2('0x6a'),_0x7cb80a,_0x7cb80a,_0x7cb80a);}}else{_0x11d8fc=_[_0xbde2('0x61')](_0x3107f4,[_0xbde2('0x2d'),'ContactId']);_0x13cabc['field']=_0xbde2('0x6b');_0x2452d3=as[_0xbde2('0x6c')](_0x39daa1,_0x11d8fc['type'],_0x13cabc);_0x2bf9d8[_0x5d0c1b](_0x2452d3[_0xbde2('0x6d')],_0x2452d3[_0xbde2('0x63')][_0xbde2('0x6e')],_0x2452d3[_0xbde2('0x63')]['end']);}break;case _0xbde2('0x6f'):var _0x5ec7ec=_0x13cabc[_0xbde2('0x63')]['split'](',')['map'](function(_0x1210bd){return Number(_0x1210bd);});_0x5ec7ec[_0xbde2('0x34')](function(_0x2780cc){_0x4ad713['or'](_0xbde2('0x70'),'%,'+_0x2780cc+',%');});_0x48ae72=_[_0xbde2('0x71')](_0x48ae72,_0x5ec7ec);break;case'User':if(_0x13cabc[_0xbde2('0x66')]==='$substring'){_0x2bf9d8[_0x5d0c1b](_0xbde2('0x72'),'%'+_0x13cabc[_0xbde2('0x63')]+'%',null);}else{_0x11d8fc=_['find'](_0x3107f4,[_0xbde2('0x2d'),_0xbde2('0x73')]);_0x13cabc[_0xbde2('0x4d')]=_0xbde2('0x73');_0x2452d3=as[_0xbde2('0x6c')](_0x39daa1,_0x11d8fc[_0xbde2('0x3b')],_0x13cabc);_0x2bf9d8[_0x5d0c1b](_0x2452d3[_0xbde2('0x6d')],_0x2452d3['value'][_0xbde2('0x6e')],_0x2452d3[_0xbde2('0x63')]['end']);}break;case'body':_0x2452d3=as[_0xbde2('0x6c')]('me',null,_0x13cabc);_0x2bf9d8[_0x5d0c1b](_0x2452d3['text'],_0x2452d3[_0xbde2('0x63')][_0xbde2('0x6e')],_0x2452d3[_0xbde2('0x63')][_0xbde2('0x29')]);break;}}else{var _0x2452d3=as['buildExpression'](_0x39daa1,_0x11d8fc[_0xbde2('0x3b')],_0x13cabc);_0x2bf9d8[_0x5d0c1b](_0x2452d3[_0xbde2('0x6d')],_0x2452d3[_0xbde2('0x63')][_0xbde2('0x6e')],_0x2452d3[_0xbde2('0x63')][_0xbde2('0x29')]);}}}else{var _0x360b90=_(_0x592840[_0xbde2('0x3e')])[_0xbde2('0x3d')]()[_0xbde2('0x30')](function(_0x25e7fc){return _[_0xbde2('0x74')](_0x3107f4,[_0xbde2('0x2d'),_0x25e7fc])?_0x25e7fc:undefined;})[_0xbde2('0x75')]()[_0xbde2('0x63')]();if(!_[_0xbde2('0x76')](_0x360b90)){_0x360b90['forEach'](function(_0x55b015){if(_0x55b015===_0xbde2('0x77')){_0x4e0b0f[_0xbde2('0x4a')](_0xbde2('0x78'),[]['concat'](_0x592840['query'][_0x55b015]));}else if(_0x55b015===_0xbde2('0x79')){var _0x343336=JSON[_0xbde2('0x7a')](_0x592840[_0xbde2('0x3e')][_0x55b015])[_0xbde2('0x7b')];var _0x3194bb=JSON[_0xbde2('0x7a')](_0x592840['query'][_0x55b015])[_0xbde2('0x7c')];_0x4e0b0f['where'](_0xbde2('0x7d'),_0x343336,_0x3194bb);}else{if(_0x592840['query'][_0x55b015]===_0xbde2('0x7e')){_0x4e0b0f[_0xbde2('0x4a')]('i.'+_0x55b015+_0xbde2('0x7f'));}else{_0x4e0b0f[_0xbde2('0x4a')]('i.'+_0x55b015+'\x20=\x20?',_0x592840['query'][_0x55b015]);}}});}if(_0x592840[_0xbde2('0x3e')][_0xbde2('0x80')]){if(_0x592840['query'][_0xbde2('0x80')]==0x1){_0x4e0b0f['having']('`unreadMessages`\x20=\x200');}else{_0x4e0b0f['having'](_0xbde2('0x81'));}}if(_0x592840[_0xbde2('0x3e')]['tag']){_0x48ae72=_['isArray'](_0x592840['query'][_0xbde2('0x82')])?_0x592840[_0xbde2('0x3e')][_0xbde2('0x82')]:new Array(_0x592840[_0xbde2('0x3e')][_0xbde2('0x82')]);_0x48ae72[_0xbde2('0x34')](function(_0x256093){_0x4ad713['or'](_0xbde2('0x70'),'%,'+_0x256093+',%');});}if(_0x592840[_0xbde2('0x3e')][_0xbde2('0x83')]){var _0x116800=_0x592840['query'][_0xbde2('0x83')]['replace']('\x5c','\x5c\x5c')['replace']('\x27\x27',_0xbde2('0x84'));if(qs[_0xbde2('0x85')](_0x116800)){_0x2bf9d8['or'](_0xbde2('0x86'),_0x116800+'%')['or']('i.fax\x20LIKE\x20?',_0x116800+'%');}_0x2bf9d8['or'](_0xbde2('0x87'),_0x116800+'%');}}_0x4e0b0f[_0xbde2('0x4a')](_0x2bf9d8);_0x4e0b0f['group'](_0xbde2('0x88'));var _0x3080ea={'type':db[_0xbde2('0x89')][_0xbde2('0x8a')]['SELECT'],'raw':!![]};var _0x51da22=_0x4e0b0f['clone']();_0x51da22[_0xbde2('0x4d')](_0xbde2('0x88'));_0x51da22[_0xbde2('0x4d')](_0xbde2('0x8b'),_0xbde2('0x62'));if(_0x1ac72a[_0xbde2('0x48')]){_0x1ac72a[_0xbde2('0x48')]['forEach'](function(_0x2c72b5){_0x4e0b0f[_0xbde2('0x48')]('i.'+_0x2c72b5[0x0],_0x2c72b5[0x1]===_0xbde2('0x8c')?![]:!![]);});}if(!_[_0xbde2('0x76')](_0x48ae72)){_0x4e0b0f[_0xbde2('0x64')](_0x4ad713);_0x51da22[_0xbde2('0x4a')](_0xbde2('0x8d'),_0x48ae72);}BPromise[_0xbde2('0x8e')]()['then'](function(){if(!_0x27bc99){if(_0x592840[_0xbde2('0x3e')][_0xbde2('0x77')]||_0x592840[_0xbde2('0x3e')][_0xbde2('0x8f')])return;_0x51da22[_0xbde2('0x4a')](_0xbde2('0x90'));_0x4e0b0f[_0xbde2('0x4a')](_0xbde2('0x90'));return;}return _0x592840[_0xbde2('0x91')]['getFaxAccounts']({'attributes':['id'],'raw':!![]})[_0xbde2('0x36')](function(_0x361bbc){if(_[_0xbde2('0x76')](_0x361bbc)){_0x51da22[_0xbde2('0x4a')](_0xbde2('0x92'));_0x4e0b0f[_0xbde2('0x4a')]('i.FaxAccountId\x20IS\x20NULL');}else{_0x51da22[_0xbde2('0x4a')](_0xbde2('0x78'),_[_0xbde2('0x30')](_0x361bbc,'id'));_0x4e0b0f[_0xbde2('0x4a')](_0xbde2('0x78'),_[_0xbde2('0x30')](_0x361bbc,'id'));}});})['then'](function(){db['sequelize'][_0xbde2('0x3e')](_0x51da22[_0xbde2('0x93')](),_0x3080ea)[_0xbde2('0x36')](function(_0x2449f2){_0x35129a[_0xbde2('0x22')]=_0x2449f2[_0xbde2('0x43')];if(_0x35129a[_0xbde2('0x22')]===0x0)return[];return db[_0xbde2('0x94')][_0xbde2('0x3e')](_0x49dbc9[_0xbde2('0x93')](),_0x3080ea)[_0xbde2('0x36')](function(_0x18c29c){_0x5eb498=_[_0xbde2('0x95')](_0x18c29c,'id');_0x3080ea=_[_0xbde2('0x96')](_0x3080ea,{'model':db['FaxInteraction'],'mapToModel':!![],'raw':!![],'nest':!![]});if(_0x592840['query'][_0xbde2('0x42')]){_0x1ac72a['attributes'][_0xbde2('0x34')](function(_0x30cd04){_0x4e0b0f[_0xbde2('0x4d')]('i.'+_0x30cd04);});}else{_0x4e0b0f[_0xbde2('0x4d')]('SUM(me.read\x20=\x200\x20AND\x20me.direction\x20=\x20\x27in\x27)',_0xbde2('0x62'));_0x4e0b0f[_0xbde2('0x4d')]('a.key',_0xbde2('0x97'));_0x4e0b0f['field'](_0xbde2('0x98'),_0xbde2('0x99'));_0x4e0b0f[_0xbde2('0x4d')](_0xbde2('0x9a'));_0x4e0b0f[_0xbde2('0x4d')](_0xbde2('0x9b'),'Contact.firstName');_0x4e0b0f[_0xbde2('0x4d')](_0xbde2('0x9c'),_0xbde2('0x9d'));_0x4e0b0f[_0xbde2('0x4d')](_0xbde2('0x9e'),_0xbde2('0x9f'));_0x4e0b0f[_0xbde2('0x4d')](_0xbde2('0xa0'),_0xbde2('0xa1'));_0x4e0b0f['field'](_0xbde2('0xa2'),_0xbde2('0xa3'));_0x4e0b0f[_0xbde2('0x4d')]('c.fax',_0xbde2('0xa4'));_0x4e0b0f[_0xbde2('0x4d')]('o.fullname',_0xbde2('0xa5'));_0x4e0b0f[_0xbde2('0x4d')](_0xbde2('0xa6'),'Owner.internal');_0x4e0b0f[_0xbde2('0x4d')](_0xbde2('0xa7'),_0xbde2('0x31'));}_0x4e0b0f[_0xbde2('0x47')](_0x1ac72a[_0xbde2('0x47')]);_0x4e0b0f[_0xbde2('0x23')](_0x1ac72a[_0xbde2('0x23')]);return db['sequelize'][_0xbde2('0x3e')](_0x4e0b0f[_0xbde2('0x93')](),_0x3080ea);})[_0xbde2('0x36')](function(_0xcfce62){_0x4e526e['where'](_0xbde2('0xa8'),_[_0xbde2('0x30')](_0xcfce62,'id'));return db[_0xbde2('0x94')]['query'](_0x4e526e[_0xbde2('0x93')](),_0x3080ea)[_0xbde2('0x36')](function(_0xf60aa2){var _0x20fb79=_[_0xbde2('0xa9')](_0xf60aa2,_0xbde2('0xaa'));var _0x52ade6=[];_0xcfce62[_0xbde2('0x34')](function(_0x18be5c){_0x52ade6[_0xbde2('0x35')](updateFaxInteraction(_0x18be5c,_0x5eb498,_0x20fb79));});return BPromise['all'](_0x52ade6);});});})[_0xbde2('0x36')](function(_0xcd3ed1){_0x35129a[_0xbde2('0xab')]=_0xcd3ed1;return _0x35129a;})[_0xbde2('0x36')](respondWithFilteredResult(_0x397721,_0x1ac72a));})[_0xbde2('0x37')](handleError(_0x397721,null));};exports[_0xbde2('0xac')]=function(_0xb4547d,_0x2721fe){var _0x57a909={'raw':![],'where':{'id':_0xb4547d[_0xbde2('0xad')]['id']}},_0x4d95e4={};_0x4d95e4['model']=_[_0xbde2('0x3d')](db[_0xbde2('0x39')]['rawAttributes']);_0x4d95e4[_0xbde2('0x3e')]=_[_0xbde2('0x3d')](_0xb4547d['query']);_0x4d95e4[_0xbde2('0x3f')]=_['intersection'](_0x4d95e4[_0xbde2('0x44')],_0x4d95e4[_0xbde2('0x3e')]);_0x57a909['attributes']=_[_0xbde2('0x40')](_0x4d95e4['model'],qs[_0xbde2('0x42')](_0xb4547d[_0xbde2('0x3e')][_0xbde2('0x42')]));_0x57a909[_0xbde2('0x41')]=_0x57a909['attributes']['length']?_0x57a909[_0xbde2('0x41')]:_0x4d95e4[_0xbde2('0x44')];if(_0xb4547d['query'][_0xbde2('0xae')]){_0x57a909['include']=[{'all':!![]}];}_0x57a909=_[_0xbde2('0x96')]({},_0x57a909,_0xb4547d[_0xbde2('0xaf')]);return db['FaxInteraction'][_0xbde2('0x61')](_0x57a909)[_0xbde2('0x36')](handleEntityNotFound(_0x2721fe,null))[_0xbde2('0x36')](respondWithResult(_0x2721fe,null))[_0xbde2('0x37')](handleError(_0x2721fe,null));};exports[_0xbde2('0xb0')]=function(_0x450923,_0x36b671){return db[_0xbde2('0x39')][_0xbde2('0xb0')](_0x450923[_0xbde2('0xb1')],{})['then'](respondWithResult(_0x36b671,0xc9))[_0xbde2('0x37')](handleError(_0x36b671,null));};exports[_0xbde2('0x28')]=function(_0x4c7dc9,_0x4e29f1){if(_0x4c7dc9[_0xbde2('0xb1')]['id']){delete _0x4c7dc9[_0xbde2('0xb1')]['id'];}return db[_0xbde2('0x39')][_0xbde2('0x61')]({'where':{'id':_0x4c7dc9[_0xbde2('0xad')]['id']}})['then'](handleEntityNotFound(_0x4e29f1,null))[_0xbde2('0x36')](saveUpdates(_0x4c7dc9['body'],null))[_0xbde2('0x36')](respondWithResult(_0x4e29f1,null))['catch'](handleError(_0x4e29f1,null));};exports['destroy']=function(_0x58ac57,_0x49aab2){return db[_0xbde2('0x39')][_0xbde2('0x61')]({'where':{'id':_0x58ac57[_0xbde2('0xad')]['id']}})[_0xbde2('0x36')](handleEntityNotFound(_0x49aab2,null))[_0xbde2('0x36')](removeEntity(_0x49aab2,null))[_0xbde2('0x37')](handleError(_0x49aab2,null));};exports[_0xbde2('0xb2')]=function(_0x5dc6f7,_0x411191){return db['FaxInteraction'][_0xbde2('0xb2')]()[_0xbde2('0x36')](respondWithResult(_0x411191,null))[_0xbde2('0x37')](handleError(_0x411191,null));};exports['addMessage']=function(_0x339a6b,_0x544c1c,_0x122cb0){return db[_0xbde2('0xb3')][_0xbde2('0x61')]({'where':{'id':_0x339a6b[_0xbde2('0xad')]['id']}})[_0xbde2('0x36')](handleEntityNotFound(_0x544c1c,null))[_0xbde2('0x36')](function(_0x1c2181){if(_0x1c2181){return _0x1c2181[_0xbde2('0xb4')](_0x339a6b['body'][_0xbde2('0xb5')],_['omit'](_0x339a6b[_0xbde2('0xb1')],[_0xbde2('0xb5'),'id'])||{});}})[_0xbde2('0x36')](respondWithResult(_0x544c1c,null))[_0xbde2('0x37')](handleError(_0x544c1c,null));};exports[_0xbde2('0xb6')]=function(_0x1537d5,_0x4921f4,_0x1e6cfc){var _0x39afbb={'raw':![],'where':{}};var _0x112ed0={};var _0x170528={'count':0x0,'rows':[]};return db[_0xbde2('0x39')]['findOne']({'where':{'id':_0x1537d5[_0xbde2('0xad')]['id']}})[_0xbde2('0x36')](handleEntityNotFound(_0x4921f4,null))[_0xbde2('0x36')](function(_0x253547){if(_0x253547){_0x112ed0[_0xbde2('0x44')]=_['keys'](db[_0xbde2('0xb3')]['rawAttributes']);_0x112ed0[_0xbde2('0x3e')]=_[_0xbde2('0x3d')](_0x1537d5[_0xbde2('0x3e')]);_0x112ed0['filters']=_[_0xbde2('0x40')](_0x112ed0[_0xbde2('0x44')],_0x112ed0['query']);_0x39afbb[_0xbde2('0x41')]=_[_0xbde2('0x40')](_0x112ed0['model'],qs[_0xbde2('0x42')](_0x1537d5[_0xbde2('0x3e')][_0xbde2('0x42')]));_0x39afbb[_0xbde2('0x41')]=_0x39afbb['attributes'][_0xbde2('0x43')]?_0x39afbb[_0xbde2('0x41')]:_0x112ed0[_0xbde2('0x44')];if(!_0x1537d5[_0xbde2('0x3e')]['hasOwnProperty'](_0xbde2('0x46'))){_0x39afbb[_0xbde2('0x47')]=qs[_0xbde2('0x47')](_0x1537d5[_0xbde2('0x3e')][_0xbde2('0x47')]);_0x39afbb[_0xbde2('0x23')]=qs['offset'](_0x1537d5['query'][_0xbde2('0x23')]);}_0x39afbb[_0xbde2('0x48')]=qs[_0xbde2('0x49')](_0x1537d5[_0xbde2('0x3e')][_0xbde2('0x49')]);_0x39afbb[_0xbde2('0x4a')]=qs['filters'](_['pick'](_0x1537d5[_0xbde2('0x3e')],_0x112ed0[_0xbde2('0x3f')]));_0x39afbb[_0xbde2('0x4a')][_0xbde2('0xaa')]=_0x253547['id'];if(_0x1537d5[_0xbde2('0x3e')][_0xbde2('0x83')]){_0x39afbb[_0xbde2('0x4a')]=_['merge'](_0x39afbb['where'],{'$or':_[_0xbde2('0x30')](_0x39afbb[_0xbde2('0x41')],function(_0x3a49ea){var _0xff43ad={};_0xff43ad[_0x3a49ea]={'$like':'%'+_0x1537d5['query'][_0xbde2('0x83')]+'%'};return _0xff43ad;})});}if(_0x1537d5[_0xbde2('0x3e')][_0xbde2('0x7b')]){var _0x34ea08=_0x1537d5[_0xbde2('0x3e')][_0xbde2('0x7b')][_0xbde2('0x33')](',');var _0xf0e676={};_0xf0e676[_0x34ea08[0x0]]={'$gte':moment(_0x34ea08[0x1])[_0xbde2('0xb7')](_0xbde2('0xb8'))};_0x39afbb[_0xbde2('0x4a')]=_[_0xbde2('0x96')](_0x39afbb[_0xbde2('0x4a')],_0xf0e676);}_0x39afbb=_['merge']({},_0x39afbb,_0x1537d5[_0xbde2('0xaf')]);return db[_0xbde2('0xb3')][_0xbde2('0x22')]({'where':_0x39afbb[_0xbde2('0x4a')]})[_0xbde2('0x36')](function(_0x70e07e){_0x170528[_0xbde2('0x22')]=_0x70e07e;if(_0x1537d5['query'][_0xbde2('0xae')]){_0x39afbb[_0xbde2('0xb9')]=[{'all':!![]}];}return db[_0xbde2('0xb3')][_0xbde2('0xba')](_0x39afbb);})[_0xbde2('0x36')](function(_0x58793d){_0x170528[_0xbde2('0xab')]=_0x58793d;return _0x170528;});}})[_0xbde2('0x36')](respondWithFilteredResult(_0x4921f4,_0x39afbb))[_0xbde2('0x37')](handleError(_0x4921f4,null));};exports['addTags']=function(_0x1efb8b,_0x2cd16f,_0x51bff9){return db[_0xbde2('0x39')][_0xbde2('0x61')]({'where':{'id':_0x1efb8b[_0xbde2('0xad')]['id']}})[_0xbde2('0x36')](handleEntityNotFound(_0x2cd16f,null))[_0xbde2('0x36')](function(_0x4954a3){if(_0x4954a3){return _0x4954a3[_0xbde2('0xbb')](_0x1efb8b[_0xbde2('0xb1')][_0xbde2('0xb5')],_['omit'](_0x1efb8b['body'],['ids','id'])||{})[_0xbde2('0xbc')](function(){return db[_0xbde2('0x6f')][_0xbde2('0xba')]({'attributes':['id','name',_0xbde2('0x4e')],'where':{'id':_0x1efb8b[_0xbde2('0xb1')][_0xbde2('0xb5')]}});})[_0xbde2('0x36')](function(_0x57676e){socket[_0xbde2('0xbd')]('faxInteractionTags:save',{'id':Number(_0x1efb8b[_0xbde2('0xad')]['id']),'tags':_0x57676e||[]});return{'id':Number(_0x1efb8b[_0xbde2('0xad')]['id']),'tags':_0x57676e||[]};});}})[_0xbde2('0x36')](respondWithResult(_0x2cd16f,null))[_0xbde2('0x37')](handleError(_0x2cd16f,null));};exports[_0xbde2('0xbe')]=function(_0x469b71,_0x3f40c0,_0x4fe0ef){return db[_0xbde2('0x39')][_0xbde2('0x61')]({'where':{'id':_0x469b71['params']['id']}})[_0xbde2('0x36')](handleEntityNotFound(_0x3f40c0,null))[_0xbde2('0x36')](function(_0x196d6d){if(_0x196d6d){return _0x196d6d[_0xbde2('0xbe')](_0x469b71['query'][_0xbde2('0xb5')]);}})[_0xbde2('0x36')](respondWithStatusCode(_0x3f40c0,null))[_0xbde2('0x37')](handleError(_0x3f40c0,null));};exports[_0xbde2('0xbf')]=function(_0x3c24e8,_0xfd93da){var _0x46c696=moment()[_0xbde2('0xc0')]()['toString']();var _0x5368ca=path[_0xbde2('0xc1')](config[_0xbde2('0xc2')],'server',_0xbde2('0xc3'),_0xbde2('0xc4'));var _0x4c001d=path[_0xbde2('0xc1')](config[_0xbde2('0xc2')],_0xbde2('0xc5'),_0xbde2('0xc3'),'attachments');var _0x5d5e6c=path['join'](_0x5368ca,_0x46c696);var _0x4d453d=util[_0xbde2('0xb7')](_0xbde2('0xc6'),_0x3c24e8[_0xbde2('0xad')]['id'],_0x46c696);var _0x25193e=path[_0xbde2('0xc1')](_0x5368ca,_0x4d453d);var _0x27fc19=[];_0x27fc19[_0xbde2('0x35')]({'model':db[_0xbde2('0xc7')],'as':_0xbde2('0xc7'),'raw':!![]});var _0x233015=[{'model':db[_0xbde2('0xb3')],'as':_0xbde2('0xc8'),'attributes':['id',_0xbde2('0xb1'),_0xbde2('0x79')],'include':_0x27fc19}];return db[_0xbde2('0x39')][_0xbde2('0x61')]({'where':{'id':_0x3c24e8['params']['id']},'include':_0x233015})[_0xbde2('0x36')](handleEntityNotFound(_0xfd93da,null))['then'](function(_0x220eb0){if(_0x220eb0&&_0x220eb0[_0xbde2('0xc8')]){var _0x6217ae=_0x220eb0[_0xbde2('0xc9')]({'plain':!![]});fs[_0xbde2('0xca')](_0x5d5e6c);for(var _0x358e5a=0x0;_0x358e5a<_0x6217ae[_0xbde2('0xc8')][_0xbde2('0x43')];_0x358e5a++){var _0x3c0bc8=_0x6217ae['Messages'][_0x358e5a][_0xbde2('0xc7')];if(_0x3c0bc8){var _0x41fe07=path['join'](_0x4c001d,_0x3c0bc8[_0xbde2('0xcb')]);if(fs[_0xbde2('0xcc')](_0x41fe07)){fs['createReadStream'](_0x41fe07)[_0xbde2('0xcd')](fs[_0xbde2('0xce')](path['join'](_0x5d5e6c,_0x3c0bc8[_0xbde2('0xcb')])));}}}return BPromise['resolve']()['then'](function(){return new BPromise(function(_0x18fbde,_0x459907){zipdir(_0x5d5e6c,{'saveTo':_0x25193e},function(_0x50bdcc,_0x1c102e){if(_0x50bdcc)return _0x459907(_0x50bdcc);return _0x18fbde(_0x1c102e);});})[_0xbde2('0x36')](function(){return new BPromise(function(_0x120e0d,_0x16d692){rimraf(_0x5d5e6c,function(_0x12203a){if(_0x12203a)_0x16d692(_0x12203a);return _0x120e0d();});});})[_0xbde2('0x36')](function(){return _0xfd93da[_0xbde2('0xbf')](_0x25193e,_0x4d453d,function(_0x181dd0){if(_0x181dd0){console[_0xbde2('0xcf')](_0xbde2('0xd0'),_0x181dd0);}else{fs[_0xbde2('0xd1')](_0x25193e);}});});});}else{return _0xfd93da[_0xbde2('0x2a')](0xc8);}})[_0xbde2('0x37')](handleError(_0xfd93da,null));};
\ No newline at end of file
diff --git a/server/api/faxInteraction/faxInteraction.events.js b/server/api/faxInteraction/faxInteraction.events.js
index 336d5eb..ec5d080 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 _0x7a54=['setDataValue','map','length','catch','hasOwnProperty','hook','exports','events','../../mysqldb','FaxInteraction','FaxMessage','setMaxListeners','update','remove','getUsers'];(function(_0x4cae0c,_0x4b670a){var _0x4ec91a=function(_0x5354f6){while(--_0x5354f6){_0x4cae0c['push'](_0x4cae0c['shift']());}};_0x4ec91a(++_0x4b670a);}(_0x7a54,0x106));var _0x47a5=function(_0x466c7f,_0x45d4cd){_0x466c7f=_0x466c7f-0x0;var _0x2a9870=_0x7a54[_0x466c7f];return _0x2a9870;};'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
+var _0x814b=['then','Users','map','findAll','setDataValue','unreadMessages','length','emit','hasOwnProperty','exports','events','../../mysqldb','FaxInteraction','FaxMessage','setMaxListeners','update','remove'];(function(_0x4a1b94,_0x1472b5){var _0x125a56=function(_0xebea60){while(--_0xebea60){_0x4a1b94['push'](_0x4a1b94['shift']());}};_0x125a56(++_0x1472b5);}(_0x814b,0x1a2));var _0xb814=function(_0x169e53,_0x46be55){_0x169e53=_0x169e53-0x0;var _0x252bb3=_0x814b[_0x169e53];return _0x252bb3;};'use strict';var EventEmitter=require(_0xb814('0x0'));var FaxInteraction=require(_0xb814('0x1'))['db'][_0xb814('0x2')];var FaxMessage=require(_0xb814('0x1'))['db'][_0xb814('0x3')];var FaxInteractionEvents=new EventEmitter();FaxInteractionEvents[_0xb814('0x4')](0x0);var events={'afterCreate':'save','afterUpdate':_0xb814('0x5'),'afterDestroy':_0xb814('0x6')};function emitEvent(_0x258866){return function(_0x4237bc,_0x44931c,_0x322a70){_0x4237bc['getUsers']({'attributes':['id'],'raw':!![]})[_0xb814('0x7')](function(_0x2e6272){_0x4237bc['setDataValue'](_0xb814('0x8'),_0x2e6272[_0xb814('0x9')](function(_0x186d5a){return{'id':_0x186d5a['id']};}));return FaxMessage[_0xb814('0xa')]({'where':{'FaxInteractionId':_0x4237bc['id'],'direction':'in','read':![]},'raw':!![]});})[_0xb814('0x7')](function(_0x21d4a5){_0x4237bc[_0xb814('0xb')](_0xb814('0xc'),_0x21d4a5[_0xb814('0xd')]);FaxInteractionEvents[_0xb814('0xe')](_0x258866+':'+_0x4237bc['id'],_0x4237bc);FaxInteractionEvents[_0xb814('0xe')](_0x258866,_0x4237bc);_0x322a70(null);})['catch'](_0x322a70(null));};}for(var e in events){if(events[_0xb814('0xf')](e)){var event=events[e];FaxInteraction['hook'](e,emitEvent(event));}}module[_0xb814('0x10')]=FaxInteractionEvents;
\ No newline at end of file
diff --git a/server/api/faxInteraction/faxInteraction.model.js b/server/api/faxInteraction/faxInteraction.model.js
index dc8fc62..eefe67e 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 _0x2f3a=['moment','bluebird','request-promise','path','rimraf','./faxInteraction.attributes','exports','define','fax_interactions','changed','closed','closedAt','format','YYYY-MM-DD\x20HH:mm:ss','util','api'];(function(_0x4f7a5a,_0x49806b){var _0x14d48d=function(_0x2238be){while(--_0x2238be){_0x4f7a5a['push'](_0x4f7a5a['shift']());}};_0x14d48d(++_0x49806b);}(_0x2f3a,0x11e));var _0xa2f3=function(_0xf77783,_0x1c93f4){_0xf77783=_0xf77783-0x0;var _0x1fc9cf=_0x2f3a[_0xf77783];return _0x1fc9cf;};'use strict';var _=require('lodash');var util=require(_0xa2f3('0x0'));var logger=require('../../config/logger')(_0xa2f3('0x1'));var moment=require(_0xa2f3('0x2'));var BPromise=require(_0xa2f3('0x3'));var rp=require(_0xa2f3('0x4'));var fs=require('fs');var path=require(_0xa2f3('0x5'));var rimraf=require(_0xa2f3('0x6'));var config=require('../../config/environment');var attributes=require(_0xa2f3('0x7'));module[_0xa2f3('0x8')]=function(_0x14ef37,_0x323589){return _0x14ef37[_0xa2f3('0x9')]('FaxInteraction',attributes,{'tableName':_0xa2f3('0xa'),'paranoid':![],'indexes':[],'timestamps':!![],'hooks':{'beforeUpdate':function(_0x42d93e,_0x46c658,_0x29c536){if(_0x42d93e[_0xa2f3('0xb')](_0xa2f3('0xc'))){_0x42d93e[_0xa2f3('0xd')]=moment()[_0xa2f3('0xe')](_0xa2f3('0xf'));}_0x29c536(null,_0x42d93e);}}});};
\ No newline at end of file
+var _0x8c21=['./faxInteraction.attributes','define','FaxInteraction','changed','closed','closedAt','format','YYYY-MM-DD\x20HH:mm:ss','lodash','util','../../config/logger','moment','path','rimraf'];(function(_0x4f561f,_0x369777){var _0x4b18b1=function(_0x12a7b4){while(--_0x12a7b4){_0x4f561f['push'](_0x4f561f['shift']());}};_0x4b18b1(++_0x369777);}(_0x8c21,0x78));var _0x18c2=function(_0x572ff8,_0x554866){_0x572ff8=_0x572ff8-0x0;var _0x2ecee5=_0x8c21[_0x572ff8];return _0x2ecee5;};'use strict';var _=require(_0x18c2('0x0'));var util=require(_0x18c2('0x1'));var logger=require(_0x18c2('0x2'))('api');var moment=require(_0x18c2('0x3'));var BPromise=require('bluebird');var rp=require('request-promise');var fs=require('fs');var path=require(_0x18c2('0x4'));var rimraf=require(_0x18c2('0x5'));var config=require('../../config/environment');var attributes=require(_0x18c2('0x6'));module['exports']=function(_0x39ad63,_0x209207){return _0x39ad63[_0x18c2('0x7')](_0x18c2('0x8'),attributes,{'tableName':'fax_interactions','paranoid':![],'indexes':[],'timestamps':!![],'hooks':{'beforeUpdate':function(_0x520dcf,_0xe889eb,_0x1ca4df){if(_0x520dcf[_0x18c2('0x9')](_0x18c2('0xa'))){_0x520dcf[_0x18c2('0xb')]=moment()[_0x18c2('0xc')](_0x18c2('0xd'));}_0x1ca4df(null,_0x520dcf);}}});};
\ No newline at end of file
diff --git a/server/api/faxInteraction/faxInteraction.rpc.js b/server/api/faxInteraction/faxInteraction.rpc.js
index 149b2c0..ddefdab 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 _0xd2f4=['omit','ids','spread','AddTags','lodash','util','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','client','http','redis','defaults','./faxInteraction.socket','register','request','info','FaxInteraction,\x20%s,\x20%s','request\x20sent','debug','FaxInteraction,\x20%s,\x20%s,\x20%s','stringify','error','message','catch','UpdateFaxInteraction','FaxInteraction','body','options','where','attributes','limit','AddTagsToFaxInteraction','find','then','addTags'];(function(_0x4d729f,_0x52bf8b){var _0x5ce12a=function(_0x3ae6a6){while(--_0x3ae6a6){_0x4d729f['push'](_0x4d729f['shift']());}};_0x5ce12a(++_0x52bf8b);}(_0xd2f4,0x1b2));var _0x4d2f=function(_0x4ad7ed,_0xc1248e){_0x4ad7ed=_0x4ad7ed-0x0;var _0x2fc3f4=_0xd2f4[_0x4ad7ed];return _0x2fc3f4;};'use strict';var _=require(_0x4d2f('0x0'));var util=require(_0x4d2f('0x1'));var moment=require(_0x4d2f('0x2'));var BPromise=require(_0x4d2f('0x3'));var rs=require(_0x4d2f('0x4'));var fs=require('fs');var Redis=require(_0x4d2f('0x5'));var db=require(_0x4d2f('0x6'))['db'];var utils=require(_0x4d2f('0x7'));var logger=require(_0x4d2f('0x8'))(_0x4d2f('0x9'));var config=require(_0x4d2f('0xa'));var jayson=require(_0x4d2f('0xb'));var client=jayson[_0x4d2f('0xc')][_0x4d2f('0xd')]({'port':0x232a});config[_0x4d2f('0xe')]=_[_0x4d2f('0xf')](config['redis'],{'host':'localhost','port':0x18eb});var socket=require('socket.io-emitter')(new Redis(config[_0x4d2f('0xe')]));require(_0x4d2f('0x10'))[_0x4d2f('0x11')](socket);function respondWithRpcPromise(_0x296967,_0x2ac92c,_0x16abde){return new BPromise(function(_0x426cf7,_0x2ff904){return client[_0x4d2f('0x12')](_0x296967,_0x16abde)['then'](function(_0x6ef242){logger[_0x4d2f('0x13')](_0x4d2f('0x14'),_0x2ac92c,_0x4d2f('0x15'));logger[_0x4d2f('0x16')](_0x4d2f('0x17'),_0x2ac92c,_0x4d2f('0x15'),JSON[_0x4d2f('0x18')](_0x6ef242));if(_0x6ef242['error']){if(_0x6ef242[_0x4d2f('0x19')]['code']===0x1f4){logger[_0x4d2f('0x19')](_0x4d2f('0x14'),_0x2ac92c,_0x6ef242[_0x4d2f('0x19')][_0x4d2f('0x1a')]);return _0x2ff904(_0x6ef242[_0x4d2f('0x19')][_0x4d2f('0x1a')]);}logger[_0x4d2f('0x19')](_0x4d2f('0x14'),_0x2ac92c,_0x6ef242[_0x4d2f('0x19')][_0x4d2f('0x1a')]);return _0x426cf7(_0x6ef242[_0x4d2f('0x19')][_0x4d2f('0x1a')]);}else{logger['info'](_0x4d2f('0x14'),_0x2ac92c,_0x4d2f('0x15'));_0x426cf7(_0x6ef242['result'][_0x4d2f('0x1a')]);}})[_0x4d2f('0x1b')](function(_0x44e9f5){logger[_0x4d2f('0x19')](_0x4d2f('0x14'),_0x2ac92c,_0x44e9f5);_0x2ff904(_0x44e9f5);});});}exports[_0x4d2f('0x1c')]=function(_0x42d172){var _0xf1fd8c=this;return new Promise(function(_0x4d81e4,_0x31b1a4){return db[_0x4d2f('0x1d')]['update'](_0x42d172[_0x4d2f('0x1e')],{'raw':_0x42d172['options']?_0x42d172[_0x4d2f('0x1f')]['raw']===undefined?!![]:![]:!![],'individualHooks':!![],'where':_0x42d172['options']?_0x42d172[_0x4d2f('0x1f')][_0x4d2f('0x20')]||null:null,'attributes':_0x42d172[_0x4d2f('0x1f')]?_0x42d172[_0x4d2f('0x1f')][_0x4d2f('0x21')]||null:null,'limit':_0x42d172[_0x4d2f('0x1f')]?_0x42d172[_0x4d2f('0x1f')][_0x4d2f('0x22')]||null:null})['then'](function(_0x28d5af){logger[_0x4d2f('0x13')](_0x4d2f('0x1c'),_0x42d172);logger['debug'](_0x4d2f('0x1c'),_0x42d172,JSON[_0x4d2f('0x18')](_0x28d5af));_0x4d81e4(_0x28d5af);})['catch'](function(_0x597eee){logger[_0x4d2f('0x19')]('UpdateFaxInteraction',_0x597eee[_0x4d2f('0x1a')],_0x42d172);_0x31b1a4(_0xf1fd8c['error'](0x1f4,_0x597eee['message']));});});};exports[_0x4d2f('0x23')]=function(_0x1dff1b){return new Promise(function(_0xf5911f,_0x2f43fc){return db[_0x4d2f('0x1d')][_0x4d2f('0x24')]({'where':_0x1dff1b[_0x4d2f('0x1f')]?_0x1dff1b[_0x4d2f('0x1f')][_0x4d2f('0x20')]||null:null})[_0x4d2f('0x25')](function(_0x152e5c){if(_0x152e5c){return _0x152e5c[_0x4d2f('0x26')](_0x1dff1b[_0x4d2f('0x1e')]['ids'],_[_0x4d2f('0x27')](_0x1dff1b[_0x4d2f('0x1e')],[_0x4d2f('0x28'),'id'])||{});}})[_0x4d2f('0x29')](function(_0x3ac045){logger['info']('AddTags',_0x1dff1b);logger['debug'](_0x4d2f('0x2a'),_0x1dff1b,JSON['stringify'](_0x3ac045));_0xf5911f(_0x3ac045);})[_0x4d2f('0x1b')](function(_0x3ccfad){logger[_0x4d2f('0x19')](_0x4d2f('0x2a'),_0x3ccfad['message'],_0x1dff1b);_0x2f43fc(_this[_0x4d2f('0x19')](0x1f4,_0x3ccfad[_0x4d2f('0x1a')]));});});};
\ No newline at end of file
+var _0x4b1c=['debug','FaxInteraction,\x20%s,\x20%s,\x20%s','code','error','message','catch','FaxInteraction','update','body','options','raw','where','attributes','limit','UpdateFaxInteraction','stringify','AddTagsToFaxInteraction','find','addTags','ids','omit','AddTags','lodash','util','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','jayson/promise','http','redis','defaults','localhost','./faxInteraction.socket','register','then','info','FaxInteraction,\x20%s,\x20%s','request\x20sent'];(function(_0x3dd15e,_0x1f0015){var _0x231fd0=function(_0x4f680a){while(--_0x4f680a){_0x3dd15e['push'](_0x3dd15e['shift']());}};_0x231fd0(++_0x1f0015);}(_0x4b1c,0xbe));var _0xc4b1=function(_0x3687c9,_0x503796){_0x3687c9=_0x3687c9-0x0;var _0x238b39=_0x4b1c[_0x3687c9];return _0x238b39;};'use strict';var _=require(_0xc4b1('0x0'));var util=require(_0xc4b1('0x1'));var moment=require(_0xc4b1('0x2'));var BPromise=require(_0xc4b1('0x3'));var rs=require(_0xc4b1('0x4'));var fs=require('fs');var Redis=require(_0xc4b1('0x5'));var db=require(_0xc4b1('0x6'))['db'];var utils=require(_0xc4b1('0x7'));var logger=require(_0xc4b1('0x8'))('rpc');var config=require('../../config/environment');var jayson=require(_0xc4b1('0x9'));var client=jayson['client'][_0xc4b1('0xa')]({'port':0x232a});config[_0xc4b1('0xb')]=_[_0xc4b1('0xc')](config[_0xc4b1('0xb')],{'host':_0xc4b1('0xd'),'port':0x18eb});var socket=require('socket.io-emitter')(new Redis(config[_0xc4b1('0xb')]));require(_0xc4b1('0xe'))[_0xc4b1('0xf')](socket);function respondWithRpcPromise(_0x17d002,_0x478be8,_0x4db6f3){return new BPromise(function(_0x4bc19a,_0x1647e4){return client['request'](_0x17d002,_0x4db6f3)[_0xc4b1('0x10')](function(_0x3c4d39){logger[_0xc4b1('0x11')](_0xc4b1('0x12'),_0x478be8,_0xc4b1('0x13'));logger[_0xc4b1('0x14')](_0xc4b1('0x15'),_0x478be8,_0xc4b1('0x13'),JSON['stringify'](_0x3c4d39));if(_0x3c4d39['error']){if(_0x3c4d39['error'][_0xc4b1('0x16')]===0x1f4){logger[_0xc4b1('0x17')](_0xc4b1('0x12'),_0x478be8,_0x3c4d39[_0xc4b1('0x17')][_0xc4b1('0x18')]);return _0x1647e4(_0x3c4d39[_0xc4b1('0x17')][_0xc4b1('0x18')]);}logger[_0xc4b1('0x17')](_0xc4b1('0x12'),_0x478be8,_0x3c4d39[_0xc4b1('0x17')][_0xc4b1('0x18')]);return _0x4bc19a(_0x3c4d39['error'][_0xc4b1('0x18')]);}else{logger[_0xc4b1('0x11')](_0xc4b1('0x12'),_0x478be8,_0xc4b1('0x13'));_0x4bc19a(_0x3c4d39['result'][_0xc4b1('0x18')]);}})[_0xc4b1('0x19')](function(_0x3c3d4b){logger[_0xc4b1('0x17')]('FaxInteraction,\x20%s,\x20%s',_0x478be8,_0x3c3d4b);_0x1647e4(_0x3c3d4b);});});}exports['UpdateFaxInteraction']=function(_0x119538){var _0x5ca9a1=this;return new Promise(function(_0x37ca6a,_0x1fd38c){return db[_0xc4b1('0x1a')][_0xc4b1('0x1b')](_0x119538[_0xc4b1('0x1c')],{'raw':_0x119538[_0xc4b1('0x1d')]?_0x119538['options'][_0xc4b1('0x1e')]===undefined?!![]:![]:!![],'individualHooks':!![],'where':_0x119538[_0xc4b1('0x1d')]?_0x119538[_0xc4b1('0x1d')][_0xc4b1('0x1f')]||null:null,'attributes':_0x119538[_0xc4b1('0x1d')]?_0x119538[_0xc4b1('0x1d')][_0xc4b1('0x20')]||null:null,'limit':_0x119538[_0xc4b1('0x1d')]?_0x119538[_0xc4b1('0x1d')][_0xc4b1('0x21')]||null:null})['then'](function(_0x4d0557){logger[_0xc4b1('0x11')](_0xc4b1('0x22'),_0x119538);logger[_0xc4b1('0x14')]('UpdateFaxInteraction',_0x119538,JSON[_0xc4b1('0x23')](_0x4d0557));_0x37ca6a(_0x4d0557);})[_0xc4b1('0x19')](function(_0x205ef5){logger[_0xc4b1('0x17')]('UpdateFaxInteraction',_0x205ef5[_0xc4b1('0x18')],_0x119538);_0x1fd38c(_0x5ca9a1[_0xc4b1('0x17')](0x1f4,_0x205ef5[_0xc4b1('0x18')]));});});};exports[_0xc4b1('0x24')]=function(_0x5ae3f4){return new Promise(function(_0x359afa,_0x4d704c){return db['FaxInteraction'][_0xc4b1('0x25')]({'where':_0x5ae3f4[_0xc4b1('0x1d')]?_0x5ae3f4[_0xc4b1('0x1d')][_0xc4b1('0x1f')]||null:null})[_0xc4b1('0x10')](function(_0x1cf1c7){if(_0x1cf1c7){return _0x1cf1c7[_0xc4b1('0x26')](_0x5ae3f4[_0xc4b1('0x1c')][_0xc4b1('0x27')],_[_0xc4b1('0x28')](_0x5ae3f4[_0xc4b1('0x1c')],[_0xc4b1('0x27'),'id'])||{});}})['spread'](function(_0x21d04c){logger['info'](_0xc4b1('0x29'),_0x5ae3f4);logger[_0xc4b1('0x14')](_0xc4b1('0x29'),_0x5ae3f4,JSON[_0xc4b1('0x23')](_0x21d04c));_0x359afa(_0x21d04c);})['catch'](function(_0x4446db){logger[_0xc4b1('0x17')](_0xc4b1('0x29'),_0x4446db['message'],_0x5ae3f4);_0x4d704c(_this['error'](0x1f4,_0x4446db[_0xc4b1('0x18')]));});});};
\ No newline at end of file
diff --git a/server/api/faxInteraction/faxInteraction.socket.js b/server/api/faxInteraction/faxInteraction.socket.js
index be74031..fe56b47 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 _0x6cc1=['update','emit','removeListener','register','length','faxInteraction:','./faxInteraction.events','save','remove'];(function(_0x5d5373,_0x10cd97){var _0x360a4a=function(_0x59f281){while(--_0x59f281){_0x5d5373['push'](_0x5d5373['shift']());}};_0x360a4a(++_0x10cd97);}(_0x6cc1,0x126));var _0x16cc=function(_0x3f3f06,_0x581e5b){_0x3f3f06=_0x3f3f06-0x0;var _0x140feb=_0x6cc1[_0x3f3f06];return _0x140feb;};'use strict';var FaxInteractionEvents=require(_0x16cc('0x0'));var events=[_0x16cc('0x1'),_0x16cc('0x2'),_0x16cc('0x3')];function createListener(_0x83b2c7,_0x5c84d9){return function(_0x501d12){_0x5c84d9[_0x16cc('0x4')](_0x83b2c7,_0x501d12);};}function removeListener(_0x401f7a,_0x193851){return function(){FaxInteractionEvents[_0x16cc('0x5')](_0x401f7a,_0x193851);};}exports[_0x16cc('0x6')]=function(_0x28f1c1){for(var _0x52b4f5=0x0,_0x44ed9c=events[_0x16cc('0x7')];_0x52b4f5<_0x44ed9c;_0x52b4f5++){var _0x1c511a=events[_0x52b4f5];var _0x2f3202=createListener(_0x16cc('0x8')+_0x1c511a,_0x28f1c1);FaxInteractionEvents['on'](_0x1c511a,_0x2f3202);}};
\ No newline at end of file
+var _0xe5ea=['length','./faxInteraction.events','remove','emit','removeListener','register'];(function(_0x3bcf23,_0x181f3b){var _0x2cedc4=function(_0x142c84){while(--_0x142c84){_0x3bcf23['push'](_0x3bcf23['shift']());}};_0x2cedc4(++_0x181f3b);}(_0xe5ea,0xfd));var _0xae5e=function(_0x27ede4,_0x171842){_0x27ede4=_0x27ede4-0x0;var _0x30734a=_0xe5ea[_0x27ede4];return _0x30734a;};'use strict';var FaxInteractionEvents=require(_0xae5e('0x0'));var events=['save',_0xae5e('0x1'),'update'];function createListener(_0x27c25b,_0x5511af){return function(_0x207414){_0x5511af[_0xae5e('0x2')](_0x27c25b,_0x207414);};}function removeListener(_0x9d13af,_0x47ea8e){return function(){FaxInteractionEvents[_0xae5e('0x3')](_0x9d13af,_0x47ea8e);};}exports[_0xae5e('0x4')]=function(_0x221dcb){for(var _0x4f76c2=0x0,_0x71dd8f=events[_0xae5e('0x5')];_0x4f76c2<_0x71dd8f;_0x4f76c2++){var _0x4c236f=events[_0x4f76c2];var _0x510fd7=createListener('faxInteraction:'+_0x4c236f,_0x221dcb);FaxInteractionEvents['on'](_0x4c236f,_0x510fd7);}};
\ No newline at end of file
diff --git a/server/api/faxInteraction/index.js b/server/api/faxInteraction/index.js
index 82cf6d2..fd7ac82 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 _0x0fc8=['faxinteraction:update','update','faxinteraction:destroy','delete','removeTags','exports','multer','util','Router','../../components/auth/service','./faxInteraction.controller','isAuthenticated','index','get','/describe','/:id','show','/:id/messages','getMessages','download','post','create','addMessage','/:id/tags','tracked','fax','faxinteraction:addtags','addTags','put'];(function(_0x13d0c2,_0x194e1b){var _0x8bf2e5=function(_0x2fad63){while(--_0x2fad63){_0x13d0c2['push'](_0x13d0c2['shift']());}};_0x8bf2e5(++_0x194e1b);}(_0x0fc8,0x145));var _0x80fc=function(_0x1ba418,_0x13c087){_0x1ba418=_0x1ba418-0x0;var _0x50df30=_0x0fc8[_0x1ba418];return _0x50df30;};'use strict';var multer=require(_0x80fc('0x0'));var util=require(_0x80fc('0x1'));var path=require('path');var timeout=require('connect-timeout');var express=require('express');var router=express[_0x80fc('0x2')]();var auth=require(_0x80fc('0x3'));var interaction=require('../../components/interaction/service');var config=require('../../config/environment');var controller=require(_0x80fc('0x4'));router['get']('/',auth[_0x80fc('0x5')](),controller[_0x80fc('0x6')]);router[_0x80fc('0x7')](_0x80fc('0x8'),auth[_0x80fc('0x5')](),controller['describe']);router[_0x80fc('0x7')](_0x80fc('0x9'),auth['isAuthenticated'](),controller[_0x80fc('0xa')]);router[_0x80fc('0x7')](_0x80fc('0xb'),auth['isAuthenticated'](),controller[_0x80fc('0xc')]);router['get']('/:id/download',auth[_0x80fc('0x5')](),controller[_0x80fc('0xd')]);router[_0x80fc('0xe')]('/',auth[_0x80fc('0x5')](),controller[_0x80fc('0xf')]);router[_0x80fc('0xe')](_0x80fc('0xb'),auth[_0x80fc('0x5')](),controller[_0x80fc('0x10')]);router[_0x80fc('0xe')](_0x80fc('0x11'),auth[_0x80fc('0x5')](),interaction[_0x80fc('0x12')](_0x80fc('0x13'),_0x80fc('0x14')),controller[_0x80fc('0x15')]);router[_0x80fc('0x16')]('/:id',auth[_0x80fc('0x5')](),interaction['tracked'](_0x80fc('0x13'),_0x80fc('0x17')),controller[_0x80fc('0x18')]);router['delete'](_0x80fc('0x9'),auth['isAuthenticated'](),interaction[_0x80fc('0x12')](_0x80fc('0x13'),_0x80fc('0x19')),controller['destroy']);router[_0x80fc('0x1a')]('/:id/tags',auth[_0x80fc('0x5')](),controller[_0x80fc('0x1b')]);module[_0x80fc('0x1c')]=router;
\ No newline at end of file
+var _0xaca4=['multer','util','path','Router','./faxInteraction.controller','get','isAuthenticated','index','/describe','/:id/messages','getMessages','/:id/download','download','post','create','addMessage','/:id/tags','tracked','faxinteraction:addtags','addTags','/:id','fax','faxinteraction:update','faxinteraction:destroy','destroy','delete','exports'];(function(_0x14add3,_0x13ce8d){var _0x4a174f=function(_0x2b3ed7){while(--_0x2b3ed7){_0x14add3['push'](_0x14add3['shift']());}};_0x4a174f(++_0x13ce8d);}(_0xaca4,0xbd));var _0x4aca=function(_0x332aea,_0x390c5f){_0x332aea=_0x332aea-0x0;var _0x1125db=_0xaca4[_0x332aea];return _0x1125db;};'use strict';var multer=require(_0x4aca('0x0'));var util=require(_0x4aca('0x1'));var path=require(_0x4aca('0x2'));var timeout=require('connect-timeout');var express=require('express');var router=express[_0x4aca('0x3')]();var auth=require('../../components/auth/service');var interaction=require('../../components/interaction/service');var config=require('../../config/environment');var controller=require(_0x4aca('0x4'));router[_0x4aca('0x5')]('/',auth[_0x4aca('0x6')](),controller[_0x4aca('0x7')]);router[_0x4aca('0x5')](_0x4aca('0x8'),auth['isAuthenticated'](),controller['describe']);router[_0x4aca('0x5')]('/:id',auth[_0x4aca('0x6')](),controller['show']);router[_0x4aca('0x5')](_0x4aca('0x9'),auth[_0x4aca('0x6')](),controller[_0x4aca('0xa')]);router['get'](_0x4aca('0xb'),auth['isAuthenticated'](),controller[_0x4aca('0xc')]);router[_0x4aca('0xd')]('/',auth[_0x4aca('0x6')](),controller[_0x4aca('0xe')]);router[_0x4aca('0xd')]('/:id/messages',auth[_0x4aca('0x6')](),controller[_0x4aca('0xf')]);router[_0x4aca('0xd')](_0x4aca('0x10'),auth[_0x4aca('0x6')](),interaction[_0x4aca('0x11')]('fax',_0x4aca('0x12')),controller[_0x4aca('0x13')]);router['put'](_0x4aca('0x14'),auth['isAuthenticated'](),interaction[_0x4aca('0x11')](_0x4aca('0x15'),_0x4aca('0x16')),controller['update']);router['delete'](_0x4aca('0x14'),auth['isAuthenticated'](),interaction['tracked'](_0x4aca('0x15'),_0x4aca('0x17')),controller[_0x4aca('0x18')]);router[_0x4aca('0x19')](_0x4aca('0x10'),auth['isAuthenticated'](),controller['removeTags']);module[_0x4aca('0x1a')]=router;
\ No newline at end of file
diff --git a/server/api/faxMessage/faxMessage.attributes.js b/server/api/faxMessage/faxMessage.attributes.js
index 11a4883..3d2282f 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 _0xb189=['medium','BOOLEAN','ENUM','out','sequelize','exports','TEXT'];(function(_0x2c2748,_0x5bf97f){var _0x155ad1=function(_0x24de04){while(--_0x24de04){_0x2c2748['push'](_0x2c2748['shift']());}};_0x155ad1(++_0x5bf97f);}(_0xb189,0x11c));var _0x9b18=function(_0x3f6702,_0x39b080){_0x3f6702=_0x3f6702-0x0;var _0x206bb2=_0xb189[_0x3f6702];return _0x206bb2;};'use strict';var Sequelize=require(_0x9b18('0x0'));module[_0x9b18('0x1')]={'body':{'type':Sequelize[_0x9b18('0x2')](_0x9b18('0x3')),'allowNull':![]},'read':{'type':Sequelize[_0x9b18('0x4')],'defaultValue':![]},'direction':{'type':Sequelize[_0x9b18('0x5')]('in','out'),'defaultValue':_0x9b18('0x6'),'allowNull':![]},'failMessage':{'type':Sequelize[_0x9b18('0x2')],'defaultValue':null},'readAt':{'type':Sequelize['DATE']}};
\ No newline at end of file
+var _0xbf43=['medium','out','DATE','sequelize','exports','TEXT'];(function(_0x362733,_0x46e9fa){var _0x4fccca=function(_0x57289e){while(--_0x57289e){_0x362733['push'](_0x362733['shift']());}};_0x4fccca(++_0x46e9fa);}(_0xbf43,0x10b));var _0x3bf4=function(_0x1805b8,_0x3abba1){_0x1805b8=_0x1805b8-0x0;var _0x2f27c4=_0xbf43[_0x1805b8];return _0x2f27c4;};'use strict';var Sequelize=require(_0x3bf4('0x0'));module[_0x3bf4('0x1')]={'body':{'type':Sequelize[_0x3bf4('0x2')](_0x3bf4('0x3')),'allowNull':![]},'read':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'direction':{'type':Sequelize['ENUM']('in','out'),'defaultValue':_0x3bf4('0x4'),'allowNull':![]},'failMessage':{'type':Sequelize['TEXT'],'defaultValue':null},'readAt':{'type':Sequelize[_0x3bf4('0x5')]}};
\ No newline at end of file
diff --git a/server/api/faxMessage/faxMessage.controller.js b/server/api/faxMessage/faxMessage.controller.js
index 69be3b1..6ff4edc 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 _0xb10b=['read1stAt','interaction','[FAXMESSAGE:ACCEPT]\x20id=%s\x20name=%s\x20role=%s\x20interaction=%s\x20body=%s','role','null','AcceptMessage','manual','interface','channel','EventManager','acceptmessage','fax','agent','FaxInteractionId','[FAXMESSAGE:REJECT]\x20id=%s\x20name=%s\x20role=%s\x20interaction=%s\x20body=%s','RejectMessage','rejectMessage','event','create','Attachment','findOne','AttachmentId','SendFax','FaxAccountId','/var/opt/motion2/server/files/attachments/%s','basename','join','root','server','attachments','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','redis','defaults','localhost','socket.io-emitter','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~!@#$%^&-_=+[{]}.','then','info','FaxMessage,\x20%s,\x20%s','request\x20sent','debug','stringify','code','error','message','result','sendStatus','end','status','json','count','limit','Content-Range','apply','reject','update','stack','name','send','index','FaxMessage','rawAttributes','type','key','model','map','query','keys','filters','intersection','attributes','fields','length','nolimit','offset','order','sort','where','pick','filter','merge','VIRTUAL','options','findAll','rows','catch','show','params','includeAll','include','find','body','destroy','describe','fax-interactions','accept','readAt','format','YYYY-MM-DD\x20HH:mm:ss','UserId','user','CmContact','get','FaxInteraction','isNil'];(function(_0x4417ea,_0x49c37c){var _0x1cfc6f=function(_0x1e7b5a){while(--_0x1e7b5a){_0x4417ea['push'](_0x4417ea['shift']());}};_0x1cfc6f(++_0x49c37c);}(_0xb10b,0x12a));var _0xbb10=function(_0x4a5055,_0x3c97aa){_0x4a5055=_0x4a5055-0x0;var _0x329f81=_0xb10b[_0x4a5055];return _0x329f81;};'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'];config[_0xbb10('0x18')]=_[_0xbb10('0x19')](config[_0xbb10('0x18')],{'host':_0xbb10('0x1a'),'port':0x18eb});var socket=require(_0xbb10('0x1b'))(new Redis(config[_0xbb10('0x18')]));require('./faxMessage.socket')[_0xbb10('0x1c')](socket);var jayson=require(_0xbb10('0x1d'));var client=jayson[_0xbb10('0x1e')][_0xbb10('0x1f')]({'port':0x232c});var client9002=jayson[_0xbb10('0x1e')][_0xbb10('0x1f')]({'port':0x232a});function checkPasswordPattern(_0x24a57b,_0x36b5e8,_0x3e26f4){if(_0x3e26f4){var _0x2b184e=new RegExp(/(?=.*[a-z])(?=.*[A-Z])(?=.*[0-9])(?=.*[?!@#\$%\^&\*~\-_=+[{\]\}])(?=.{8,})/);if(_0x2b184e['test'](_0x36b5e8)){return _0x24a57b;}else{throw new db[(_0xbb10('0x20'))][(_0xbb10('0x21'))](_0xbb10('0x22'));}}else{return _0x24a57b;}}function respondWithRpcPromise(_0x42db98,_0x378da8,_0x1682a4,_0x575cca){return new BPromise(function(_0x30efc6,_0xbf2906){var _0xe1c665=_0x575cca||client;return _0xe1c665['request'](_0x42db98,_0x1682a4)[_0xbb10('0x23')](function(_0x19f48d){logger[_0xbb10('0x24')](_0xbb10('0x25'),_0x378da8,_0xbb10('0x26'));logger[_0xbb10('0x27')]('FaxMessage,\x20%s,\x20%s,\x20%s',_0x378da8,_0xbb10('0x26'),JSON[_0xbb10('0x28')](_0x19f48d));if(_0x19f48d['error']){if(_0x19f48d['error'][_0xbb10('0x29')]===0x1f4){logger[_0xbb10('0x2a')](_0xbb10('0x25'),_0x378da8,_0x19f48d[_0xbb10('0x2a')][_0xbb10('0x2b')]);return _0xbf2906(_0x19f48d[_0xbb10('0x2a')][_0xbb10('0x2b')]);}logger[_0xbb10('0x2a')](_0xbb10('0x25'),_0x378da8,_0x19f48d[_0xbb10('0x2a')][_0xbb10('0x2b')]);return _0x30efc6(_0x19f48d[_0xbb10('0x2a')]['message']);}else{logger['info']('FaxMessage,\x20%s,\x20%s',_0x378da8,_0xbb10('0x26'));_0x30efc6(_0x19f48d[_0xbb10('0x2c')][_0xbb10('0x2b')]);}})['catch'](function(_0x2fdde9){logger[_0xbb10('0x2a')](_0xbb10('0x25'),_0x378da8,_0x2fdde9);_0xbf2906(_0x2fdde9);});});}function respondWithStatusCode(_0x1d5e95,_0x1acce9){_0x1acce9=_0x1acce9||0xcc;return function(_0x20d946){if(_0x20d946){return _0x1d5e95[_0xbb10('0x2d')](_0x1acce9);}return _0x1d5e95['status'](_0x1acce9)[_0xbb10('0x2e')]();};}function respondWithResult(_0x21ac54,_0xfc3595){_0xfc3595=_0xfc3595||0xc8;return function(_0x2e0249){if(_0x2e0249){return _0x21ac54[_0xbb10('0x2f')](_0xfc3595)[_0xbb10('0x30')](_0x2e0249);}};}function respondWithFilteredResult(_0x5d5c80,_0x221624){return function(_0x4ee02e){if(_0x4ee02e){var _0x448d5c=_0x4ee02e[_0xbb10('0x31')],_0x56f2da=_0x221624['offset'],_0x16ad2a=_0x221624['offset']+_0x221624[_0xbb10('0x32')],_0x1dcc9c;if(_0x16ad2a>=_0x448d5c){_0x16ad2a=_0x448d5c;_0x1dcc9c=0xc8;}else{_0x1dcc9c=0xce;}_0x5d5c80[_0xbb10('0x2f')](_0x1dcc9c);return _0x5d5c80['set'](_0xbb10('0x33'),_0x56f2da+'-'+_0x16ad2a+'/'+_0x448d5c)[_0xbb10('0x30')](_0x4ee02e);}return null;};}function patchUpdates(_0x2f653f){return function(_0x1c0b57){try{jsonpatch[_0xbb10('0x34')](_0x1c0b57,_0x2f653f,!![]);}catch(_0x138bc6){return BPromise[_0xbb10('0x35')](_0x138bc6);}return _0x1c0b57['save']();};}function saveUpdates(_0x25acb3,_0x1da9c9){return function(_0x441d15){if(_0x441d15){return _0x441d15[_0xbb10('0x36')](_0x25acb3)[_0xbb10('0x23')](function(_0x9de708){return _0x9de708;});}return null;};}function removeEntity(_0x188cbd,_0x10202c){return function(_0x3c8d7d){if(_0x3c8d7d){return _0x3c8d7d['destroy']()[_0xbb10('0x23')](function(){_0x188cbd[_0xbb10('0x2f')](0xcc)[_0xbb10('0x2e')]();});}};}function handleEntityNotFound(_0x3c3c45,_0x570f5a){return function(_0x111762){if(!_0x111762){_0x3c3c45['sendStatus'](0x194);}return _0x111762;};}function handleError(_0x4e2754,_0x3eb3cc){_0x3eb3cc=_0x3eb3cc||0x1f4;return function(_0x40c164){logger[_0xbb10('0x2a')](_0x40c164[_0xbb10('0x37')]);if(_0x40c164[_0xbb10('0x38')]){delete _0x40c164[_0xbb10('0x38')];}_0x4e2754['status'](_0x3eb3cc)[_0xbb10('0x39')](_0x40c164);};}exports[_0xbb10('0x3a')]=function(_0x52de31,_0x5e3fbd){var _0x5cd55f={},_0x31bee3={},_0x2b0b45={'count':0x0,'rows':[]};var _0x2b658a=_['map'](db[_0xbb10('0x3b')][_0xbb10('0x3c')],function(_0x4345f3){return{'name':_0x4345f3['fieldName'],'type':_0x4345f3[_0xbb10('0x3d')][_0xbb10('0x3e')]};});_0x31bee3[_0xbb10('0x3f')]=_[_0xbb10('0x40')](_0x2b658a,'name');_0x31bee3[_0xbb10('0x41')]=_[_0xbb10('0x42')](_0x52de31['query']);_0x31bee3[_0xbb10('0x43')]=_[_0xbb10('0x44')](_0x31bee3[_0xbb10('0x3f')],_0x31bee3[_0xbb10('0x41')]);_0x5cd55f[_0xbb10('0x45')]=_[_0xbb10('0x44')](_0x31bee3['model'],qs[_0xbb10('0x46')](_0x52de31[_0xbb10('0x41')][_0xbb10('0x46')]));_0x5cd55f[_0xbb10('0x45')]=_0x5cd55f['attributes'][_0xbb10('0x47')]?_0x5cd55f[_0xbb10('0x45')]:_0x31bee3[_0xbb10('0x3f')];if(!_0x52de31[_0xbb10('0x41')]['hasOwnProperty'](_0xbb10('0x48'))){_0x5cd55f[_0xbb10('0x32')]=qs['limit'](_0x52de31['query'][_0xbb10('0x32')]);_0x5cd55f['offset']=qs[_0xbb10('0x49')](_0x52de31[_0xbb10('0x41')]['offset']);}_0x5cd55f[_0xbb10('0x4a')]=qs[_0xbb10('0x4b')](_0x52de31[_0xbb10('0x41')]['sort']);_0x5cd55f[_0xbb10('0x4c')]=qs[_0xbb10('0x43')](_[_0xbb10('0x4d')](_0x52de31[_0xbb10('0x41')],_0x31bee3[_0xbb10('0x43')]));if(_0x52de31[_0xbb10('0x41')][_0xbb10('0x4e')]){_0x5cd55f[_0xbb10('0x4c')]=_[_0xbb10('0x4f')](_0x5cd55f[_0xbb10('0x4c')],{'$or':_[_0xbb10('0x40')](_0x2b658a,function(_0x1eadd2){if(_0x1eadd2['type']!==_0xbb10('0x50')){var _0x41bbf8={};_0x41bbf8[_0x1eadd2['name']]={'$like':'%'+_0x52de31[_0xbb10('0x41')][_0xbb10('0x4e')]+'%'};return _0x41bbf8;}})});}_0x5cd55f=_[_0xbb10('0x4f')]({},_0x5cd55f,_0x52de31[_0xbb10('0x51')]);var _0x41ea91={'where':_0x5cd55f[_0xbb10('0x4c')]};return db[_0xbb10('0x3b')]['count'](_0x41ea91)['then'](function(_0xcb3354){_0x2b0b45[_0xbb10('0x31')]=_0xcb3354;if(_0x52de31[_0xbb10('0x41')]['includeAll']){_0x5cd55f['include']=[{'all':!![]}];}return db[_0xbb10('0x3b')][_0xbb10('0x52')](_0x5cd55f);})[_0xbb10('0x23')](function(_0xf820fe){_0x2b0b45[_0xbb10('0x53')]=_0xf820fe;return _0x2b0b45;})[_0xbb10('0x23')](respondWithFilteredResult(_0x5e3fbd,_0x5cd55f))[_0xbb10('0x54')](handleError(_0x5e3fbd,null));};exports[_0xbb10('0x55')]=function(_0x2626d8,_0x3d7e7e){var _0x550111={'raw':!![],'where':{'id':_0x2626d8[_0xbb10('0x56')]['id']}},_0x5eafac={};_0x5eafac[_0xbb10('0x3f')]=_[_0xbb10('0x42')](db[_0xbb10('0x3b')][_0xbb10('0x3c')]);_0x5eafac[_0xbb10('0x41')]=_[_0xbb10('0x42')](_0x2626d8[_0xbb10('0x41')]);_0x5eafac[_0xbb10('0x43')]=_[_0xbb10('0x44')](_0x5eafac[_0xbb10('0x3f')],_0x5eafac[_0xbb10('0x41')]);_0x550111[_0xbb10('0x45')]=_[_0xbb10('0x44')](_0x5eafac[_0xbb10('0x3f')],qs['fields'](_0x2626d8[_0xbb10('0x41')]['fields']));_0x550111[_0xbb10('0x45')]=_0x550111[_0xbb10('0x45')][_0xbb10('0x47')]?_0x550111[_0xbb10('0x45')]:_0x5eafac[_0xbb10('0x3f')];if(_0x2626d8[_0xbb10('0x41')][_0xbb10('0x57')]){_0x550111[_0xbb10('0x58')]=[{'all':!![]}];}_0x550111=_[_0xbb10('0x4f')]({},_0x550111,_0x2626d8[_0xbb10('0x51')]);return db[_0xbb10('0x3b')][_0xbb10('0x59')](_0x550111)[_0xbb10('0x23')](handleEntityNotFound(_0x3d7e7e,null))[_0xbb10('0x23')](respondWithResult(_0x3d7e7e,null))[_0xbb10('0x54')](handleError(_0x3d7e7e,null));};exports['update']=function(_0x4571b6,_0x466eb7){if(_0x4571b6[_0xbb10('0x5a')]['id']){delete _0x4571b6[_0xbb10('0x5a')]['id'];}return db[_0xbb10('0x3b')][_0xbb10('0x59')]({'where':{'id':_0x4571b6['params']['id']}})[_0xbb10('0x23')](handleEntityNotFound(_0x466eb7,null))[_0xbb10('0x23')](saveUpdates(_0x4571b6[_0xbb10('0x5a')],null))[_0xbb10('0x23')](respondWithResult(_0x466eb7,null))[_0xbb10('0x54')](handleError(_0x466eb7,null));};exports[_0xbb10('0x5b')]=function(_0x175872,_0x12ec18){return db[_0xbb10('0x3b')][_0xbb10('0x59')]({'where':{'id':_0x175872[_0xbb10('0x56')]['id']}})[_0xbb10('0x23')](handleEntityNotFound(_0x12ec18,null))[_0xbb10('0x23')](removeEntity(_0x12ec18,null))['catch'](handleError(_0x12ec18,null));};exports['describe']=function(_0x16272d,_0x3e6338){return db[_0xbb10('0x3b')][_0xbb10('0x5c')]()['then'](respondWithResult(_0x3e6338,null))['catch'](handleError(_0x3e6338,null));};var interaction_log=require(_0xbb10('0x15'))(_0xbb10('0x5d'));exports[_0xbb10('0x5e')]=function(_0x2dd150,_0x412f13,_0x3e9753){var _0x45c0dc={'channel':'fax'};if(_0x2dd150[_0xbb10('0x5a')]['id']){delete _0x2dd150[_0xbb10('0x5a')]['id'];}_0x2dd150['body']['read']=!![];_0x2dd150['body'][_0xbb10('0x5f')]=moment()[_0xbb10('0x60')](_0xbb10('0x61'));_0x2dd150['body']['UserId']=_0x2dd150['body'][_0xbb10('0x62')]||_0x2dd150[_0xbb10('0x63')]['id'];return db[_0xbb10('0x3b')]['find']({'where':{'id':_0x2dd150[_0xbb10('0x56')]['id'],'UserId':null},'include':[{'model':db[_0xbb10('0x64')],'as':'Contact'}]})['then'](handleEntityNotFound(_0x412f13,null))[_0xbb10('0x23')](saveUpdates(_0x2dd150[_0xbb10('0x5a')],null))[_0xbb10('0x23')](function(_0x237246){if(_0x237246){_0x45c0dc['message']=_0x237246[_0xbb10('0x65')]({'plain':!![]});return db[_0xbb10('0x66')][_0xbb10('0x59')]({'where':{'id':_0x237246['FaxInteractionId']}});}return null;})[_0xbb10('0x23')](handleEntityNotFound(_0x412f13,null))[_0xbb10('0x23')](function(_0x3e3617){if(_0x3e3617){return _0x3e3617['update']({'UserId':_0x2dd150[_0xbb10('0x5a')][_0xbb10('0x62')],'read1stAt':_[_0xbb10('0x67')](_0x3e3617[_0xbb10('0x68')])?moment()['format'](_0xbb10('0x61')):undefined});}return null;})[_0xbb10('0x23')](function(_0x108e5b){if(_0x108e5b){_0x45c0dc[_0xbb10('0x69')]=_0x108e5b['get']({'plain':!![]});interaction_log[_0xbb10('0x24')](_0xbb10('0x6a'),_0x2dd150[_0xbb10('0x63')]['id'],_0x2dd150[_0xbb10('0x63')][_0xbb10('0x38')],_0x2dd150[_0xbb10('0x63')][_0xbb10('0x6b')],_0x45c0dc['interaction']['id'],_0x2dd150['body']?JSON['stringify'](_0x2dd150[_0xbb10('0x5a')]):_0xbb10('0x6c'));return respondWithRpcPromise(_0xbb10('0x6d'),'acceptMessage',_0x45c0dc);}return null;})['then'](function(_0x46f462){if(_0x46f462){if(_0x2dd150[_0xbb10('0x5a')][_0xbb10('0x6e')]){_0x45c0dc[_0xbb10('0x2b')][_0xbb10('0x6f')]=util[_0xbb10('0x60')]('SIP/%s',_0x2dd150[_0xbb10('0x63')][_0xbb10('0x38')]);_0x45c0dc[_0xbb10('0x2b')][_0xbb10('0x70')]=_0x45c0dc[_0xbb10('0x70')];_0x45c0dc['message']['event']='accept';return respondWithRpcPromise(_0xbb10('0x71'),_0xbb10('0x71'),{'event':_0xbb10('0x72'),'message':_0x45c0dc[_0xbb10('0x2b')]},client9002)[_0xbb10('0x23')](function(){return _0x45c0dc;});}return _0x45c0dc;}return null;})[_0xbb10('0x23')](respondWithResult(_0x412f13,null))['catch'](handleError(_0x412f13,null));};var interaction_log=require(_0xbb10('0x15'))('fax-interactions');exports['reject']=function(_0x519a54,_0xdf634f,_0x13040d){var _0x23b1d5={'agent':{},'channel':_0xbb10('0x73')};if(_0x519a54['body']['id']){delete _0x519a54[_0xbb10('0x5a')]['id'];}_0x519a54['body']['UserId']=_0x519a54[_0xbb10('0x5a')][_0xbb10('0x62')]||_0x519a54[_0xbb10('0x63')]['id'];_0x23b1d5[_0xbb10('0x74')]['id']=_0x519a54[_0xbb10('0x5a')]['UserId'];return db[_0xbb10('0x3b')][_0xbb10('0x59')]({'where':{'id':_0x519a54[_0xbb10('0x56')]['id'],'UserId':null}})[_0xbb10('0x23')](handleEntityNotFound(_0xdf634f,null))[_0xbb10('0x23')](function(_0x27f42f){if(_0x27f42f){_0x23b1d5[_0xbb10('0x2b')]=_0x27f42f['get']({'plain':!![]});return db[_0xbb10('0x66')][_0xbb10('0x59')]({'where':{'id':_0x27f42f[_0xbb10('0x75')]}});}return null;})[_0xbb10('0x23')](handleEntityNotFound(_0xdf634f,null))[_0xbb10('0x23')](function(_0x172be3){if(_0x172be3){_0x23b1d5[_0xbb10('0x69')]=_0x172be3[_0xbb10('0x65')]({'plain':!![]});interaction_log['info'](_0xbb10('0x76'),_0x519a54[_0xbb10('0x63')]['id'],_0x519a54[_0xbb10('0x63')]['name'],_0x519a54['user']['role'],_0x23b1d5[_0xbb10('0x69')]['id'],_0x519a54['body']?JSON['stringify'](_0x519a54[_0xbb10('0x5a')]):_0xbb10('0x6c'));return respondWithRpcPromise(_0xbb10('0x77'),_0xbb10('0x78'),_0x23b1d5);}return null;})[_0xbb10('0x23')](function(_0x24dca6){if(_0x24dca6){_0x24dca6[_0xbb10('0x2b')][_0xbb10('0x6f')]=util[_0xbb10('0x60')]('SIP/%s',_0x519a54[_0xbb10('0x63')][_0xbb10('0x38')]);_0x24dca6[_0xbb10('0x2b')][_0xbb10('0x70')]=_0x23b1d5['channel'];_0x24dca6['message'][_0xbb10('0x79')]=_0xbb10('0x35');respondWithRpcPromise(_0xbb10('0x71'),_0xbb10('0x71'),{'event':'rejectmessage','message':_0x24dca6[_0xbb10('0x2b')]},client9002);return _0x23b1d5;}return null;})[_0xbb10('0x23')](respondWithResult(_0xdf634f,null))[_0xbb10('0x54')](handleError(_0xdf634f,null));};exports[_0xbb10('0x7a')]=function(_0x35c1e8,_0x517185){var _0x5f0691;return db[_0xbb10('0x3b')][_0xbb10('0x7a')](_0x35c1e8[_0xbb10('0x5a')],{})['then'](function(_0x256b35){_0x5f0691=_0x256b35;return db[_0xbb10('0x64')]['findOne']({'where':{'id':_0x5f0691['ContactId']}});})[_0xbb10('0x23')](function(_0x26d0dd){if(_[_0xbb10('0x67')](_0x26d0dd)){return;}else{_0x5f0691['fax']=_0x26d0dd[_0xbb10('0x73')];return db[_0xbb10('0x7b')][_0xbb10('0x7c')]({'where':{'id':_0x5f0691[_0xbb10('0x7d')]}});}})[_0xbb10('0x23')](function(_0x5de006){return respondWithRpcPromise(_0xbb10('0x7e'),_0xbb10('0x7e'),{'FaxAccountId':_[_0xbb10('0x67')](_0x35c1e8['body'])?undefined:_0x35c1e8[_0xbb10('0x5a')][_0xbb10('0x7f')],'path':_[_0xbb10('0x67')](_0x5de006)?undefined:util[_0xbb10('0x60')](_0xbb10('0x80'),_0x5de006[_0xbb10('0x81')]),'fax':_[_0xbb10('0x67')](_0x5f0691[_0xbb10('0x73')])?undefined:_0x5f0691[_0xbb10('0x73')],'AttachmentId':_0x5f0691[_0xbb10('0x7d')]},client9002);})[_0xbb10('0x23')](respondWithResult(_0x517185,0xc9))[_0xbb10('0x54')](handleError(_0x517185,null));};exports['download']=function(_0x51f106,_0xe1fc51){var _0x3fa344=path[_0xbb10('0x82')](config[_0xbb10('0x83')],_0xbb10('0x84'),'files',_0xbb10('0x85'));return db[_0xbb10('0x3b')][_0xbb10('0x59')]({'where':{'id':_0x51f106[_0xbb10('0x56')]['id']},'include':[{'model':db[_0xbb10('0x7b')],'as':_0xbb10('0x7b')}]})['then'](handleEntityNotFound(_0xe1fc51,null))[_0xbb10('0x23')](function(_0x742e10){if(_0x742e10){return _0xe1fc51['download'](path[_0xbb10('0x82')](_0x3fa344,_0x742e10['Attachment'][_0xbb10('0x81')]));}})[_0xbb10('0x54')](handleError(_0xe1fc51,null));};
\ No newline at end of file
+var _0xb10b=['read1stAt','interaction','[FAXMESSAGE:ACCEPT]\x20id=%s\x20name=%s\x20role=%s\x20interaction=%s\x20body=%s','role','null','AcceptMessage','manual','interface','channel','EventManager','acceptmessage','fax','agent','FaxInteractionId','[FAXMESSAGE:REJECT]\x20id=%s\x20name=%s\x20role=%s\x20interaction=%s\x20body=%s','RejectMessage','rejectMessage','event','create','Attachment','findOne','AttachmentId','SendFax','FaxAccountId','/var/opt/motion2/server/files/attachments/%s','basename','join','root','server','attachments','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','redis','defaults','localhost','socket.io-emitter','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~!@#$%^&-_=+[{]}.','then','info','FaxMessage,\x20%s,\x20%s','request\x20sent','debug','stringify','code','error','message','result','sendStatus','end','status','json','count','limit','Content-Range','apply','reject','update','stack','name','send','index','FaxMessage','rawAttributes','type','key','model','map','query','keys','filters','intersection','attributes','fields','length','nolimit','offset','order','sort','where','pick','filter','merge','VIRTUAL','options','findAll','rows','catch','show','params','includeAll','include','find','body','destroy','describe','fax-interactions','accept','readAt','format','YYYY-MM-DD\x20HH:mm:ss','UserId','user','CmContact','get','FaxInteraction','isNil'];(function(_0x15bc6a,_0x30f8f7){var _0x49c524=function(_0x1665de){while(--_0x1665de){_0x15bc6a['push'](_0x15bc6a['shift']());}};_0x49c524(++_0x30f8f7);}(_0xb10b,0x12a));var _0xbb10=function(_0x265c81,_0x4d539a){_0x265c81=_0x265c81-0x0;var _0x3e63d1=_0xb10b[_0x265c81];return _0x3e63d1;};'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'];config[_0xbb10('0x18')]=_[_0xbb10('0x19')](config[_0xbb10('0x18')],{'host':_0xbb10('0x1a'),'port':0x18eb});var socket=require(_0xbb10('0x1b'))(new Redis(config[_0xbb10('0x18')]));require('./faxMessage.socket')[_0xbb10('0x1c')](socket);var jayson=require(_0xbb10('0x1d'));var client=jayson[_0xbb10('0x1e')][_0xbb10('0x1f')]({'port':0x232c});var client9002=jayson[_0xbb10('0x1e')][_0xbb10('0x1f')]({'port':0x232a});function checkPasswordPattern(_0x24a57b,_0x36b5e8,_0x3e26f4){if(_0x3e26f4){var _0x2b184e=new RegExp(/(?=.*[a-z])(?=.*[A-Z])(?=.*[0-9])(?=.*[?!@#\$%\^&\*~\-_=+[{\]\}])(?=.{8,})/);if(_0x2b184e['test'](_0x36b5e8)){return _0x24a57b;}else{throw new db[(_0xbb10('0x20'))][(_0xbb10('0x21'))](_0xbb10('0x22'));}}else{return _0x24a57b;}}function respondWithRpcPromise(_0x42db98,_0x378da8,_0x1682a4,_0x575cca){return new BPromise(function(_0x30efc6,_0xbf2906){var _0xe1c665=_0x575cca||client;return _0xe1c665['request'](_0x42db98,_0x1682a4)[_0xbb10('0x23')](function(_0x19f48d){logger[_0xbb10('0x24')](_0xbb10('0x25'),_0x378da8,_0xbb10('0x26'));logger[_0xbb10('0x27')]('FaxMessage,\x20%s,\x20%s,\x20%s',_0x378da8,_0xbb10('0x26'),JSON[_0xbb10('0x28')](_0x19f48d));if(_0x19f48d['error']){if(_0x19f48d['error'][_0xbb10('0x29')]===0x1f4){logger[_0xbb10('0x2a')](_0xbb10('0x25'),_0x378da8,_0x19f48d[_0xbb10('0x2a')][_0xbb10('0x2b')]);return _0xbf2906(_0x19f48d[_0xbb10('0x2a')][_0xbb10('0x2b')]);}logger[_0xbb10('0x2a')](_0xbb10('0x25'),_0x378da8,_0x19f48d[_0xbb10('0x2a')][_0xbb10('0x2b')]);return _0x30efc6(_0x19f48d[_0xbb10('0x2a')]['message']);}else{logger['info']('FaxMessage,\x20%s,\x20%s',_0x378da8,_0xbb10('0x26'));_0x30efc6(_0x19f48d[_0xbb10('0x2c')][_0xbb10('0x2b')]);}})['catch'](function(_0x2fdde9){logger[_0xbb10('0x2a')](_0xbb10('0x25'),_0x378da8,_0x2fdde9);_0xbf2906(_0x2fdde9);});});}function respondWithStatusCode(_0x1d5e95,_0x1acce9){_0x1acce9=_0x1acce9||0xcc;return function(_0x20d946){if(_0x20d946){return _0x1d5e95[_0xbb10('0x2d')](_0x1acce9);}return _0x1d5e95['status'](_0x1acce9)[_0xbb10('0x2e')]();};}function respondWithResult(_0x21ac54,_0xfc3595){_0xfc3595=_0xfc3595||0xc8;return function(_0x2e0249){if(_0x2e0249){return _0x21ac54[_0xbb10('0x2f')](_0xfc3595)[_0xbb10('0x30')](_0x2e0249);}};}function respondWithFilteredResult(_0x5d5c80,_0x221624){return function(_0x4ee02e){if(_0x4ee02e){var _0x448d5c=_0x4ee02e[_0xbb10('0x31')],_0x56f2da=_0x221624['offset'],_0x16ad2a=_0x221624['offset']+_0x221624[_0xbb10('0x32')],_0x1dcc9c;if(_0x16ad2a>=_0x448d5c){_0x16ad2a=_0x448d5c;_0x1dcc9c=0xc8;}else{_0x1dcc9c=0xce;}_0x5d5c80[_0xbb10('0x2f')](_0x1dcc9c);return _0x5d5c80['set'](_0xbb10('0x33'),_0x56f2da+'-'+_0x16ad2a+'/'+_0x448d5c)[_0xbb10('0x30')](_0x4ee02e);}return null;};}function patchUpdates(_0x2f653f){return function(_0x1c0b57){try{jsonpatch[_0xbb10('0x34')](_0x1c0b57,_0x2f653f,!![]);}catch(_0x138bc6){return BPromise[_0xbb10('0x35')](_0x138bc6);}return _0x1c0b57['save']();};}function saveUpdates(_0x25acb3,_0x1da9c9){return function(_0x441d15){if(_0x441d15){return _0x441d15[_0xbb10('0x36')](_0x25acb3)[_0xbb10('0x23')](function(_0x9de708){return _0x9de708;});}return null;};}function removeEntity(_0x188cbd,_0x10202c){return function(_0x3c8d7d){if(_0x3c8d7d){return _0x3c8d7d['destroy']()[_0xbb10('0x23')](function(){_0x188cbd[_0xbb10('0x2f')](0xcc)[_0xbb10('0x2e')]();});}};}function handleEntityNotFound(_0x3c3c45,_0x570f5a){return function(_0x111762){if(!_0x111762){_0x3c3c45['sendStatus'](0x194);}return _0x111762;};}function handleError(_0x4e2754,_0x3eb3cc){_0x3eb3cc=_0x3eb3cc||0x1f4;return function(_0x40c164){logger[_0xbb10('0x2a')](_0x40c164[_0xbb10('0x37')]);if(_0x40c164[_0xbb10('0x38')]){delete _0x40c164[_0xbb10('0x38')];}_0x4e2754['status'](_0x3eb3cc)[_0xbb10('0x39')](_0x40c164);};}exports[_0xbb10('0x3a')]=function(_0x52de31,_0x5e3fbd){var _0x5cd55f={},_0x31bee3={},_0x2b0b45={'count':0x0,'rows':[]};var _0x2b658a=_['map'](db[_0xbb10('0x3b')][_0xbb10('0x3c')],function(_0x4345f3){return{'name':_0x4345f3['fieldName'],'type':_0x4345f3[_0xbb10('0x3d')][_0xbb10('0x3e')]};});_0x31bee3[_0xbb10('0x3f')]=_[_0xbb10('0x40')](_0x2b658a,'name');_0x31bee3[_0xbb10('0x41')]=_[_0xbb10('0x42')](_0x52de31['query']);_0x31bee3[_0xbb10('0x43')]=_[_0xbb10('0x44')](_0x31bee3[_0xbb10('0x3f')],_0x31bee3[_0xbb10('0x41')]);_0x5cd55f[_0xbb10('0x45')]=_[_0xbb10('0x44')](_0x31bee3['model'],qs[_0xbb10('0x46')](_0x52de31[_0xbb10('0x41')][_0xbb10('0x46')]));_0x5cd55f[_0xbb10('0x45')]=_0x5cd55f['attributes'][_0xbb10('0x47')]?_0x5cd55f[_0xbb10('0x45')]:_0x31bee3[_0xbb10('0x3f')];if(!_0x52de31[_0xbb10('0x41')]['hasOwnProperty'](_0xbb10('0x48'))){_0x5cd55f[_0xbb10('0x32')]=qs['limit'](_0x52de31['query'][_0xbb10('0x32')]);_0x5cd55f['offset']=qs[_0xbb10('0x49')](_0x52de31[_0xbb10('0x41')]['offset']);}_0x5cd55f[_0xbb10('0x4a')]=qs[_0xbb10('0x4b')](_0x52de31[_0xbb10('0x41')]['sort']);_0x5cd55f[_0xbb10('0x4c')]=qs[_0xbb10('0x43')](_[_0xbb10('0x4d')](_0x52de31[_0xbb10('0x41')],_0x31bee3[_0xbb10('0x43')]));if(_0x52de31[_0xbb10('0x41')][_0xbb10('0x4e')]){_0x5cd55f[_0xbb10('0x4c')]=_[_0xbb10('0x4f')](_0x5cd55f[_0xbb10('0x4c')],{'$or':_[_0xbb10('0x40')](_0x2b658a,function(_0x1eadd2){if(_0x1eadd2['type']!==_0xbb10('0x50')){var _0x41bbf8={};_0x41bbf8[_0x1eadd2['name']]={'$like':'%'+_0x52de31[_0xbb10('0x41')][_0xbb10('0x4e')]+'%'};return _0x41bbf8;}})});}_0x5cd55f=_[_0xbb10('0x4f')]({},_0x5cd55f,_0x52de31[_0xbb10('0x51')]);var _0x41ea91={'where':_0x5cd55f[_0xbb10('0x4c')]};return db[_0xbb10('0x3b')]['count'](_0x41ea91)['then'](function(_0xcb3354){_0x2b0b45[_0xbb10('0x31')]=_0xcb3354;if(_0x52de31[_0xbb10('0x41')]['includeAll']){_0x5cd55f['include']=[{'all':!![]}];}return db[_0xbb10('0x3b')][_0xbb10('0x52')](_0x5cd55f);})[_0xbb10('0x23')](function(_0xf820fe){_0x2b0b45[_0xbb10('0x53')]=_0xf820fe;return _0x2b0b45;})[_0xbb10('0x23')](respondWithFilteredResult(_0x5e3fbd,_0x5cd55f))[_0xbb10('0x54')](handleError(_0x5e3fbd,null));};exports[_0xbb10('0x55')]=function(_0x2626d8,_0x3d7e7e){var _0x550111={'raw':!![],'where':{'id':_0x2626d8[_0xbb10('0x56')]['id']}},_0x5eafac={};_0x5eafac[_0xbb10('0x3f')]=_[_0xbb10('0x42')](db[_0xbb10('0x3b')][_0xbb10('0x3c')]);_0x5eafac[_0xbb10('0x41')]=_[_0xbb10('0x42')](_0x2626d8[_0xbb10('0x41')]);_0x5eafac[_0xbb10('0x43')]=_[_0xbb10('0x44')](_0x5eafac[_0xbb10('0x3f')],_0x5eafac[_0xbb10('0x41')]);_0x550111[_0xbb10('0x45')]=_[_0xbb10('0x44')](_0x5eafac[_0xbb10('0x3f')],qs['fields'](_0x2626d8[_0xbb10('0x41')]['fields']));_0x550111[_0xbb10('0x45')]=_0x550111[_0xbb10('0x45')][_0xbb10('0x47')]?_0x550111[_0xbb10('0x45')]:_0x5eafac[_0xbb10('0x3f')];if(_0x2626d8[_0xbb10('0x41')][_0xbb10('0x57')]){_0x550111[_0xbb10('0x58')]=[{'all':!![]}];}_0x550111=_[_0xbb10('0x4f')]({},_0x550111,_0x2626d8[_0xbb10('0x51')]);return db[_0xbb10('0x3b')][_0xbb10('0x59')](_0x550111)[_0xbb10('0x23')](handleEntityNotFound(_0x3d7e7e,null))[_0xbb10('0x23')](respondWithResult(_0x3d7e7e,null))[_0xbb10('0x54')](handleError(_0x3d7e7e,null));};exports['update']=function(_0x4571b6,_0x466eb7){if(_0x4571b6[_0xbb10('0x5a')]['id']){delete _0x4571b6[_0xbb10('0x5a')]['id'];}return db[_0xbb10('0x3b')][_0xbb10('0x59')]({'where':{'id':_0x4571b6['params']['id']}})[_0xbb10('0x23')](handleEntityNotFound(_0x466eb7,null))[_0xbb10('0x23')](saveUpdates(_0x4571b6[_0xbb10('0x5a')],null))[_0xbb10('0x23')](respondWithResult(_0x466eb7,null))[_0xbb10('0x54')](handleError(_0x466eb7,null));};exports[_0xbb10('0x5b')]=function(_0x175872,_0x12ec18){return db[_0xbb10('0x3b')][_0xbb10('0x59')]({'where':{'id':_0x175872[_0xbb10('0x56')]['id']}})[_0xbb10('0x23')](handleEntityNotFound(_0x12ec18,null))[_0xbb10('0x23')](removeEntity(_0x12ec18,null))['catch'](handleError(_0x12ec18,null));};exports['describe']=function(_0x16272d,_0x3e6338){return db[_0xbb10('0x3b')][_0xbb10('0x5c')]()['then'](respondWithResult(_0x3e6338,null))['catch'](handleError(_0x3e6338,null));};var interaction_log=require(_0xbb10('0x15'))(_0xbb10('0x5d'));exports[_0xbb10('0x5e')]=function(_0x2dd150,_0x412f13,_0x3e9753){var _0x45c0dc={'channel':'fax'};if(_0x2dd150[_0xbb10('0x5a')]['id']){delete _0x2dd150[_0xbb10('0x5a')]['id'];}_0x2dd150['body']['read']=!![];_0x2dd150['body'][_0xbb10('0x5f')]=moment()[_0xbb10('0x60')](_0xbb10('0x61'));_0x2dd150['body']['UserId']=_0x2dd150['body'][_0xbb10('0x62')]||_0x2dd150[_0xbb10('0x63')]['id'];return db[_0xbb10('0x3b')]['find']({'where':{'id':_0x2dd150[_0xbb10('0x56')]['id'],'UserId':null},'include':[{'model':db[_0xbb10('0x64')],'as':'Contact'}]})['then'](handleEntityNotFound(_0x412f13,null))[_0xbb10('0x23')](saveUpdates(_0x2dd150[_0xbb10('0x5a')],null))[_0xbb10('0x23')](function(_0x237246){if(_0x237246){_0x45c0dc['message']=_0x237246[_0xbb10('0x65')]({'plain':!![]});return db[_0xbb10('0x66')][_0xbb10('0x59')]({'where':{'id':_0x237246['FaxInteractionId']}});}return null;})[_0xbb10('0x23')](handleEntityNotFound(_0x412f13,null))[_0xbb10('0x23')](function(_0x3e3617){if(_0x3e3617){return _0x3e3617['update']({'UserId':_0x2dd150[_0xbb10('0x5a')][_0xbb10('0x62')],'read1stAt':_[_0xbb10('0x67')](_0x3e3617[_0xbb10('0x68')])?moment()['format'](_0xbb10('0x61')):undefined});}return null;})[_0xbb10('0x23')](function(_0x108e5b){if(_0x108e5b){_0x45c0dc[_0xbb10('0x69')]=_0x108e5b['get']({'plain':!![]});interaction_log[_0xbb10('0x24')](_0xbb10('0x6a'),_0x2dd150[_0xbb10('0x63')]['id'],_0x2dd150[_0xbb10('0x63')][_0xbb10('0x38')],_0x2dd150[_0xbb10('0x63')][_0xbb10('0x6b')],_0x45c0dc['interaction']['id'],_0x2dd150['body']?JSON['stringify'](_0x2dd150[_0xbb10('0x5a')]):_0xbb10('0x6c'));return respondWithRpcPromise(_0xbb10('0x6d'),'acceptMessage',_0x45c0dc);}return null;})['then'](function(_0x46f462){if(_0x46f462){if(_0x2dd150[_0xbb10('0x5a')][_0xbb10('0x6e')]){_0x45c0dc[_0xbb10('0x2b')][_0xbb10('0x6f')]=util[_0xbb10('0x60')]('SIP/%s',_0x2dd150[_0xbb10('0x63')][_0xbb10('0x38')]);_0x45c0dc[_0xbb10('0x2b')][_0xbb10('0x70')]=_0x45c0dc[_0xbb10('0x70')];_0x45c0dc['message']['event']='accept';return respondWithRpcPromise(_0xbb10('0x71'),_0xbb10('0x71'),{'event':_0xbb10('0x72'),'message':_0x45c0dc[_0xbb10('0x2b')]},client9002)[_0xbb10('0x23')](function(){return _0x45c0dc;});}return _0x45c0dc;}return null;})[_0xbb10('0x23')](respondWithResult(_0x412f13,null))['catch'](handleError(_0x412f13,null));};var interaction_log=require(_0xbb10('0x15'))('fax-interactions');exports['reject']=function(_0x519a54,_0xdf634f,_0x13040d){var _0x23b1d5={'agent':{},'channel':_0xbb10('0x73')};if(_0x519a54['body']['id']){delete _0x519a54[_0xbb10('0x5a')]['id'];}_0x519a54['body']['UserId']=_0x519a54[_0xbb10('0x5a')][_0xbb10('0x62')]||_0x519a54[_0xbb10('0x63')]['id'];_0x23b1d5[_0xbb10('0x74')]['id']=_0x519a54[_0xbb10('0x5a')]['UserId'];return db[_0xbb10('0x3b')][_0xbb10('0x59')]({'where':{'id':_0x519a54[_0xbb10('0x56')]['id'],'UserId':null}})[_0xbb10('0x23')](handleEntityNotFound(_0xdf634f,null))[_0xbb10('0x23')](function(_0x27f42f){if(_0x27f42f){_0x23b1d5[_0xbb10('0x2b')]=_0x27f42f['get']({'plain':!![]});return db[_0xbb10('0x66')][_0xbb10('0x59')]({'where':{'id':_0x27f42f[_0xbb10('0x75')]}});}return null;})[_0xbb10('0x23')](handleEntityNotFound(_0xdf634f,null))[_0xbb10('0x23')](function(_0x172be3){if(_0x172be3){_0x23b1d5[_0xbb10('0x69')]=_0x172be3[_0xbb10('0x65')]({'plain':!![]});interaction_log['info'](_0xbb10('0x76'),_0x519a54[_0xbb10('0x63')]['id'],_0x519a54[_0xbb10('0x63')]['name'],_0x519a54['user']['role'],_0x23b1d5[_0xbb10('0x69')]['id'],_0x519a54['body']?JSON['stringify'](_0x519a54[_0xbb10('0x5a')]):_0xbb10('0x6c'));return respondWithRpcPromise(_0xbb10('0x77'),_0xbb10('0x78'),_0x23b1d5);}return null;})[_0xbb10('0x23')](function(_0x24dca6){if(_0x24dca6){_0x24dca6[_0xbb10('0x2b')][_0xbb10('0x6f')]=util[_0xbb10('0x60')]('SIP/%s',_0x519a54[_0xbb10('0x63')][_0xbb10('0x38')]);_0x24dca6[_0xbb10('0x2b')][_0xbb10('0x70')]=_0x23b1d5['channel'];_0x24dca6['message'][_0xbb10('0x79')]=_0xbb10('0x35');respondWithRpcPromise(_0xbb10('0x71'),_0xbb10('0x71'),{'event':'rejectmessage','message':_0x24dca6[_0xbb10('0x2b')]},client9002);return _0x23b1d5;}return null;})[_0xbb10('0x23')](respondWithResult(_0xdf634f,null))[_0xbb10('0x54')](handleError(_0xdf634f,null));};exports[_0xbb10('0x7a')]=function(_0x35c1e8,_0x517185){var _0x5f0691;return db[_0xbb10('0x3b')][_0xbb10('0x7a')](_0x35c1e8[_0xbb10('0x5a')],{})['then'](function(_0x256b35){_0x5f0691=_0x256b35;return db[_0xbb10('0x64')]['findOne']({'where':{'id':_0x5f0691['ContactId']}});})[_0xbb10('0x23')](function(_0x26d0dd){if(_[_0xbb10('0x67')](_0x26d0dd)){return;}else{_0x5f0691['fax']=_0x26d0dd[_0xbb10('0x73')];return db[_0xbb10('0x7b')][_0xbb10('0x7c')]({'where':{'id':_0x5f0691[_0xbb10('0x7d')]}});}})[_0xbb10('0x23')](function(_0x5de006){return respondWithRpcPromise(_0xbb10('0x7e'),_0xbb10('0x7e'),{'FaxAccountId':_[_0xbb10('0x67')](_0x35c1e8['body'])?undefined:_0x35c1e8[_0xbb10('0x5a')][_0xbb10('0x7f')],'path':_[_0xbb10('0x67')](_0x5de006)?undefined:util[_0xbb10('0x60')](_0xbb10('0x80'),_0x5de006[_0xbb10('0x81')]),'fax':_[_0xbb10('0x67')](_0x5f0691[_0xbb10('0x73')])?undefined:_0x5f0691[_0xbb10('0x73')],'AttachmentId':_0x5f0691[_0xbb10('0x7d')]},client9002);})[_0xbb10('0x23')](respondWithResult(_0x517185,0xc9))[_0xbb10('0x54')](handleError(_0x517185,null));};exports['download']=function(_0x51f106,_0xe1fc51){var _0x3fa344=path[_0xbb10('0x82')](config[_0xbb10('0x83')],_0xbb10('0x84'),'files',_0xbb10('0x85'));return db[_0xbb10('0x3b')][_0xbb10('0x59')]({'where':{'id':_0x51f106[_0xbb10('0x56')]['id']},'include':[{'model':db[_0xbb10('0x7b')],'as':_0xbb10('0x7b')}]})['then'](handleEntityNotFound(_0xe1fc51,null))[_0xbb10('0x23')](function(_0x742e10){if(_0x742e10){return _0xe1fc51['download'](path[_0xbb10('0x82')](_0x3fa344,_0x742e10['Attachment'][_0xbb10('0x81')]));}})[_0xbb10('0x54')](handleError(_0xe1fc51,null));};
\ No newline at end of file
diff --git a/server/api/faxMessage/faxMessage.events.js b/server/api/faxMessage/faxMessage.events.js
index 7537af0..e5a0938 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 _0x7217=['emit','hasOwnProperty','hook','exports','events','FaxMessage','setMaxListeners','save','update','remove'];(function(_0xea98ab,_0x297344){var _0x39058e=function(_0x27524a){while(--_0x27524a){_0xea98ab['push'](_0xea98ab['shift']());}};_0x39058e(++_0x297344);}(_0x7217,0x19e));var _0x7721=function(_0x9df060,_0x253d33){_0x9df060=_0x9df060-0x0;var _0x338dfe=_0x7217[_0x9df060];return _0x338dfe;};'use strict';var EventEmitter=require(_0x7721('0x0'));var FaxMessage=require('../../mysqldb')['db'][_0x7721('0x1')];var FaxMessageEvents=new EventEmitter();FaxMessageEvents[_0x7721('0x2')](0x0);var events={'afterCreate':_0x7721('0x3'),'afterUpdate':_0x7721('0x4'),'afterDestroy':_0x7721('0x5')};function emitEvent(_0x4d6446){return function(_0x5bf160,_0x472a96,_0xce17f9){FaxMessageEvents[_0x7721('0x6')](_0x4d6446+':'+_0x5bf160['id'],_0x5bf160);FaxMessageEvents[_0x7721('0x6')](_0x4d6446,_0x5bf160);_0xce17f9(null);};}for(var e in events){if(events[_0x7721('0x7')](e)){var event=events[e];FaxMessage[_0x7721('0x8')](e,emitEvent(event));}}module[_0x7721('0x9')]=FaxMessageEvents;
\ No newline at end of file
+var _0xe14b=['hasOwnProperty','hook','exports','events','../../mysqldb','save','update','emit'];(function(_0x3bf83f,_0x181cac){var _0x22c4a9=function(_0xb3ff0d){while(--_0xb3ff0d){_0x3bf83f['push'](_0x3bf83f['shift']());}};_0x22c4a9(++_0x181cac);}(_0xe14b,0x93));var _0xbe14=function(_0x1a565b,_0x381c2f){_0x1a565b=_0x1a565b-0x0;var _0x659336=_0xe14b[_0x1a565b];return _0x659336;};'use strict';var EventEmitter=require(_0xbe14('0x0'));var FaxMessage=require(_0xbe14('0x1'))['db']['FaxMessage'];var FaxMessageEvents=new EventEmitter();FaxMessageEvents['setMaxListeners'](0x0);var events={'afterCreate':_0xbe14('0x2'),'afterUpdate':_0xbe14('0x3'),'afterDestroy':'remove'};function emitEvent(_0x7d3665){return function(_0x5ce8fb,_0x496c04,_0x1833e3){FaxMessageEvents[_0xbe14('0x4')](_0x7d3665+':'+_0x5ce8fb['id'],_0x5ce8fb);FaxMessageEvents[_0xbe14('0x4')](_0x7d3665,_0x5ce8fb);_0x1833e3(null);};}for(var e in events){if(events[_0xbe14('0x5')](e)){var event=events[e];FaxMessage[_0xbe14('0x6')](e,emitEvent(event));}}module[_0xbe14('0x7')]=FaxMessageEvents;
\ No newline at end of file
diff --git a/server/api/faxMessage/faxMessage.model.js b/server/api/faxMessage/faxMessage.model.js
index 43c2156..4c9655c 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 _0xe3ff=['fax_messages','body','FULLTEXT','models','get','direction','toLowerCase','out','isNil','UserId','FaxInteraction','findOne','FaxInteractionId','update','createdAt','catch','error','utf8mb4_unicode_ci','lodash','util','moment','bluebird','request-promise','path','rimraf','../../config/environment','./faxMessage.attributes','FaxMessage'];(function(_0x396fa1,_0x57d6e5){var _0x16c294=function(_0x5774fc){while(--_0x5774fc){_0x396fa1['push'](_0x396fa1['shift']());}};_0x16c294(++_0x57d6e5);}(_0xe3ff,0x82));var _0xfe3f=function(_0x9b8fb,_0x57912d){_0x9b8fb=_0x9b8fb-0x0;var _0x9033b1=_0xe3ff[_0x9b8fb];return _0x9033b1;};'use strict';var _=require(_0xfe3f('0x0'));var util=require(_0xfe3f('0x1'));var logger=require('../../config/logger')('api');var moment=require(_0xfe3f('0x2'));var BPromise=require(_0xfe3f('0x3'));var rp=require(_0xfe3f('0x4'));var fs=require('fs');var path=require(_0xfe3f('0x5'));var rimraf=require(_0xfe3f('0x6'));var config=require(_0xfe3f('0x7'));var attributes=require(_0xfe3f('0x8'));module['exports']=function(_0x5e5f15,_0x17b615){return _0x5e5f15['define'](_0xfe3f('0x9'),attributes,{'tableName':_0xfe3f('0xa'),'paranoid':![],'indexes':[{'name':'fti_fax_messages','fields':[_0xfe3f('0xb')],'type':_0xfe3f('0xc')}],'timestamps':!![],'hooks':{'afterCreate':function(_0x11f491,_0x2d6345,_0x48d0d5){var _0x1fcfd1=_0x5e5f15[_0xfe3f('0xd')];var _0x4b2940=_0x11f491[_0xfe3f('0xe')]({'plain':!![]});if(_0x4b2940[_0xfe3f('0xf')][_0xfe3f('0x10')]()==='in'||_0x4b2940[_0xfe3f('0xf')][_0xfe3f('0x10')]()===_0xfe3f('0x11')&&!_0x4b2940['secret']&&!_[_0xfe3f('0x12')](_0x4b2940[_0xfe3f('0x13')])){_0x1fcfd1[_0xfe3f('0x14')][_0xfe3f('0x15')]({'where':{'id':_0x4b2940[_0xfe3f('0x16')]}})['then'](function(_0x4ecba8){if(_0x4ecba8){_0x4ecba8[_0xfe3f('0x17')]({'lastMsgAt':_0x4b2940[_0xfe3f('0x18')],'lastMsgDirection':_0x4b2940['direction'][_0xfe3f('0x10')]()});}})[_0xfe3f('0x19')](function(_0x1c7eab){console[_0xfe3f('0x1a')](_0x1c7eab);});}_0x48d0d5();}},'charset':'utf8mb4','collate':_0xfe3f('0x1b')});};
\ No newline at end of file
+var _0x0955=['../../config/logger','moment','bluebird','path','rimraf','./faxMessage.attributes','exports','define','FaxMessage','fax_messages','fti_fax_messages','body','models','get','direction','toLowerCase','out','secret','isNil','findOne','FaxInteractionId','then','update','createdAt','catch','lodash','util'];(function(_0x38a815,_0x69d49f){var _0x356b5a=function(_0x12ad0b){while(--_0x12ad0b){_0x38a815['push'](_0x38a815['shift']());}};_0x356b5a(++_0x69d49f);}(_0x0955,0x178));var _0x5095=function(_0x243b59,_0x3f9495){_0x243b59=_0x243b59-0x0;var _0x3e1676=_0x0955[_0x243b59];return _0x3e1676;};'use strict';var _=require(_0x5095('0x0'));var util=require(_0x5095('0x1'));var logger=require(_0x5095('0x2'))('api');var moment=require(_0x5095('0x3'));var BPromise=require(_0x5095('0x4'));var rp=require('request-promise');var fs=require('fs');var path=require(_0x5095('0x5'));var rimraf=require(_0x5095('0x6'));var config=require('../../config/environment');var attributes=require(_0x5095('0x7'));module[_0x5095('0x8')]=function(_0x3ff996,_0x297593){return _0x3ff996[_0x5095('0x9')](_0x5095('0xa'),attributes,{'tableName':_0x5095('0xb'),'paranoid':![],'indexes':[{'name':_0x5095('0xc'),'fields':[_0x5095('0xd')],'type':'FULLTEXT'}],'timestamps':!![],'hooks':{'afterCreate':function(_0x5f1831,_0x36135a,_0x40c21f){var _0x6666a3=_0x3ff996[_0x5095('0xe')];var _0x2c28c6=_0x5f1831[_0x5095('0xf')]({'plain':!![]});if(_0x2c28c6[_0x5095('0x10')][_0x5095('0x11')]()==='in'||_0x2c28c6[_0x5095('0x10')][_0x5095('0x11')]()===_0x5095('0x12')&&!_0x2c28c6[_0x5095('0x13')]&&!_[_0x5095('0x14')](_0x2c28c6['UserId'])){_0x6666a3['FaxInteraction'][_0x5095('0x15')]({'where':{'id':_0x2c28c6[_0x5095('0x16')]}})[_0x5095('0x17')](function(_0x52fb4d){if(_0x52fb4d){_0x52fb4d[_0x5095('0x18')]({'lastMsgAt':_0x2c28c6[_0x5095('0x19')],'lastMsgDirection':_0x2c28c6[_0x5095('0x10')]['toLowerCase']()});}})[_0x5095('0x1a')](function(_0x34419e){console['error'](_0x34419e);});}_0x40c21f();}},'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 0403bb5..124393f 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 _0x9b7e=['bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','client','redis','localhost','socket.io-emitter','./faxMessage.socket','register','then','info','FaxMessage,\x20%s,\x20%s','request\x20sent','debug','FaxMessage,\x20%s,\x20%s,\x20%s','stringify','error','code','message','result','CreateFaxMessage','FaxMessage','create','body','options','UpdateFaxMessage','raw','where','attributes','limit','catch','util','moment'];(function(_0x2641f9,_0x26715f){var _0x585741=function(_0x2d1462){while(--_0x2d1462){_0x2641f9['push'](_0x2641f9['shift']());}};_0x585741(++_0x26715f);}(_0x9b7e,0x12e));var _0xe9b7=function(_0x456032,_0x1a799d){_0x456032=_0x456032-0x0;var _0x1a53cd=_0x9b7e[_0x456032];return _0x1a53cd;};'use strict';var _=require('lodash');var util=require(_0xe9b7('0x0'));var moment=require(_0xe9b7('0x1'));var BPromise=require(_0xe9b7('0x2'));var rs=require(_0xe9b7('0x3'));var fs=require('fs');var Redis=require(_0xe9b7('0x4'));var db=require(_0xe9b7('0x5'))['db'];var utils=require(_0xe9b7('0x6'));var logger=require(_0xe9b7('0x7'))(_0xe9b7('0x8'));var config=require(_0xe9b7('0x9'));var jayson=require('jayson/promise');var client=jayson[_0xe9b7('0xa')]['http']({'port':0x232a});config[_0xe9b7('0xb')]=_['defaults'](config[_0xe9b7('0xb')],{'host':_0xe9b7('0xc'),'port':0x18eb});var socket=require(_0xe9b7('0xd'))(new Redis(config[_0xe9b7('0xb')]));require(_0xe9b7('0xe'))[_0xe9b7('0xf')](socket);function respondWithRpcPromise(_0xf4d756,_0x48e31d,_0x138e8d){return new BPromise(function(_0x5e83e1,_0x5d605d){return client['request'](_0xf4d756,_0x138e8d)[_0xe9b7('0x10')](function(_0x360058){logger[_0xe9b7('0x11')](_0xe9b7('0x12'),_0x48e31d,_0xe9b7('0x13'));logger[_0xe9b7('0x14')](_0xe9b7('0x15'),_0x48e31d,_0xe9b7('0x13'),JSON[_0xe9b7('0x16')](_0x360058));if(_0x360058[_0xe9b7('0x17')]){if(_0x360058[_0xe9b7('0x17')][_0xe9b7('0x18')]===0x1f4){logger['error'](_0xe9b7('0x12'),_0x48e31d,_0x360058[_0xe9b7('0x17')][_0xe9b7('0x19')]);return _0x5d605d(_0x360058[_0xe9b7('0x17')][_0xe9b7('0x19')]);}logger[_0xe9b7('0x17')]('FaxMessage,\x20%s,\x20%s',_0x48e31d,_0x360058[_0xe9b7('0x17')][_0xe9b7('0x19')]);return _0x5e83e1(_0x360058[_0xe9b7('0x17')][_0xe9b7('0x19')]);}else{logger[_0xe9b7('0x11')](_0xe9b7('0x12'),_0x48e31d,_0xe9b7('0x13'));_0x5e83e1(_0x360058[_0xe9b7('0x1a')]['message']);}})['catch'](function(_0x150e8e){logger[_0xe9b7('0x17')](_0xe9b7('0x12'),_0x48e31d,_0x150e8e);_0x5d605d(_0x150e8e);});});}exports[_0xe9b7('0x1b')]=function(_0x26c710){var _0x3a3832=this;return new Promise(function(_0x2b84e2,_0xe1d64d){return db[_0xe9b7('0x1c')][_0xe9b7('0x1d')](_0x26c710[_0xe9b7('0x1e')],{'raw':_0x26c710[_0xe9b7('0x1f')]?_0x26c710['options']['raw']===undefined?!![]:![]:!![]})[_0xe9b7('0x10')](function(_0x15c2d5){logger[_0xe9b7('0x11')](_0xe9b7('0x1b'),_0x26c710);logger['debug'](_0xe9b7('0x1b'),_0x26c710,JSON[_0xe9b7('0x16')](_0x15c2d5));_0x2b84e2(_0x15c2d5);})['catch'](function(_0x52bcd0){logger['error'](_0xe9b7('0x1b'),_0x52bcd0[_0xe9b7('0x19')],_0x26c710);_0xe1d64d(_0x3a3832['error'](0x1f4,_0x52bcd0[_0xe9b7('0x19')]));});});};exports[_0xe9b7('0x20')]=function(_0x3d7b22){var _0x4cfd5=this;return new Promise(function(_0x4fb652,_0x34e70e){return db[_0xe9b7('0x1c')]['update'](_0x3d7b22[_0xe9b7('0x1e')],{'raw':_0x3d7b22[_0xe9b7('0x1f')]?_0x3d7b22['options'][_0xe9b7('0x21')]===undefined?!![]:![]:!![],'individualHooks':!![],'where':_0x3d7b22['options']?_0x3d7b22[_0xe9b7('0x1f')][_0xe9b7('0x22')]||null:null,'attributes':_0x3d7b22['options']?_0x3d7b22[_0xe9b7('0x1f')][_0xe9b7('0x23')]||null:null,'limit':_0x3d7b22[_0xe9b7('0x1f')]?_0x3d7b22[_0xe9b7('0x1f')][_0xe9b7('0x24')]||null:null})['then'](function(_0x4b758e){logger[_0xe9b7('0x11')]('UpdateFaxMessage',_0x3d7b22);logger[_0xe9b7('0x14')](_0xe9b7('0x20'),_0x3d7b22,JSON[_0xe9b7('0x16')](_0x4b758e));_0x4fb652(_0x4b758e);})[_0xe9b7('0x25')](function(_0x2488db){logger['error'](_0xe9b7('0x20'),_0x2488db[_0xe9b7('0x19')],_0x3d7b22);_0x34e70e(_0x4cfd5[_0xe9b7('0x17')](0x1f4,_0x2488db[_0xe9b7('0x19')]));});});};
\ No newline at end of file
+var _0x65d9=['client','http','redis','localhost','socket.io-emitter','./faxMessage.socket','register','request','info','FaxMessage,\x20%s,\x20%s','request\x20sent','debug','FaxMessage,\x20%s,\x20%s,\x20%s','stringify','error','code','message','result','catch','CreateFaxMessage','create','body','options','raw','then','UpdateFaxMessage','update','where','attributes','lodash','util','moment','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','../../config/environment'];(function(_0x122ef9,_0x451d2a){var _0x42fba0=function(_0x17c9d3){while(--_0x17c9d3){_0x122ef9['push'](_0x122ef9['shift']());}};_0x42fba0(++_0x451d2a);}(_0x65d9,0x1bf));var _0x965d=function(_0x4add51,_0x462d46){_0x4add51=_0x4add51-0x0;var _0x5d85a7=_0x65d9[_0x4add51];return _0x5d85a7;};'use strict';var _=require(_0x965d('0x0'));var util=require(_0x965d('0x1'));var moment=require(_0x965d('0x2'));var BPromise=require('bluebird');var rs=require(_0x965d('0x3'));var fs=require('fs');var Redis=require(_0x965d('0x4'));var db=require(_0x965d('0x5'))['db'];var utils=require(_0x965d('0x6'));var logger=require(_0x965d('0x7'))('rpc');var config=require(_0x965d('0x8'));var jayson=require('jayson/promise');var client=jayson[_0x965d('0x9')][_0x965d('0xa')]({'port':0x232a});config['redis']=_['defaults'](config[_0x965d('0xb')],{'host':_0x965d('0xc'),'port':0x18eb});var socket=require(_0x965d('0xd'))(new Redis(config[_0x965d('0xb')]));require(_0x965d('0xe'))[_0x965d('0xf')](socket);function respondWithRpcPromise(_0x46d59f,_0x598e10,_0x4bdc10){return new BPromise(function(_0x100851,_0x35f32b){return client[_0x965d('0x10')](_0x46d59f,_0x4bdc10)['then'](function(_0x432ad6){logger[_0x965d('0x11')](_0x965d('0x12'),_0x598e10,_0x965d('0x13'));logger[_0x965d('0x14')](_0x965d('0x15'),_0x598e10,_0x965d('0x13'),JSON[_0x965d('0x16')](_0x432ad6));if(_0x432ad6['error']){if(_0x432ad6[_0x965d('0x17')][_0x965d('0x18')]===0x1f4){logger['error'](_0x965d('0x12'),_0x598e10,_0x432ad6[_0x965d('0x17')][_0x965d('0x19')]);return _0x35f32b(_0x432ad6[_0x965d('0x17')][_0x965d('0x19')]);}logger[_0x965d('0x17')](_0x965d('0x12'),_0x598e10,_0x432ad6[_0x965d('0x17')][_0x965d('0x19')]);return _0x100851(_0x432ad6[_0x965d('0x17')][_0x965d('0x19')]);}else{logger[_0x965d('0x11')](_0x965d('0x12'),_0x598e10,'request\x20sent');_0x100851(_0x432ad6[_0x965d('0x1a')][_0x965d('0x19')]);}})[_0x965d('0x1b')](function(_0xfe637b){logger['error'](_0x965d('0x12'),_0x598e10,_0xfe637b);_0x35f32b(_0xfe637b);});});}exports[_0x965d('0x1c')]=function(_0x594e16){var _0x890189=this;return new Promise(function(_0x68e04,_0x2fed69){return db['FaxMessage'][_0x965d('0x1d')](_0x594e16[_0x965d('0x1e')],{'raw':_0x594e16[_0x965d('0x1f')]?_0x594e16[_0x965d('0x1f')][_0x965d('0x20')]===undefined?!![]:![]:!![]})[_0x965d('0x21')](function(_0x553e00){logger[_0x965d('0x11')](_0x965d('0x1c'),_0x594e16);logger[_0x965d('0x14')](_0x965d('0x1c'),_0x594e16,JSON['stringify'](_0x553e00));_0x68e04(_0x553e00);})[_0x965d('0x1b')](function(_0x37e1b4){logger[_0x965d('0x17')]('CreateFaxMessage',_0x37e1b4[_0x965d('0x19')],_0x594e16);_0x2fed69(_0x890189[_0x965d('0x17')](0x1f4,_0x37e1b4[_0x965d('0x19')]));});});};exports[_0x965d('0x22')]=function(_0x3224d6){var _0x12e75d=this;return new Promise(function(_0x133350,_0x44f673){return db['FaxMessage'][_0x965d('0x23')](_0x3224d6[_0x965d('0x1e')],{'raw':_0x3224d6[_0x965d('0x1f')]?_0x3224d6[_0x965d('0x1f')][_0x965d('0x20')]===undefined?!![]:![]:!![],'individualHooks':!![],'where':_0x3224d6[_0x965d('0x1f')]?_0x3224d6['options'][_0x965d('0x24')]||null:null,'attributes':_0x3224d6['options']?_0x3224d6[_0x965d('0x1f')][_0x965d('0x25')]||null:null,'limit':_0x3224d6[_0x965d('0x1f')]?_0x3224d6['options']['limit']||null:null})[_0x965d('0x21')](function(_0x346901){logger[_0x965d('0x11')]('UpdateFaxMessage',_0x3224d6);logger['debug'](_0x965d('0x22'),_0x3224d6,JSON['stringify'](_0x346901));_0x133350(_0x346901);})[_0x965d('0x1b')](function(_0x1af08b){logger['error'](_0x965d('0x22'),_0x1af08b[_0x965d('0x19')],_0x3224d6);_0x44f673(_0x12e75d['error'](0x1f4,_0x1af08b['message']));});});};
\ No newline at end of file
diff --git a/server/api/faxMessage/faxMessage.socket.js b/server/api/faxMessage/faxMessage.socket.js
index 0d1cf65..6b6b0ec 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 _0xa9e0=['register','length','faxMessage:','./faxMessage.events','save','remove','emit','removeListener'];(function(_0x19950b,_0x53d0d7){var _0x3c6b41=function(_0x3924ad){while(--_0x3924ad){_0x19950b['push'](_0x19950b['shift']());}};_0x3c6b41(++_0x53d0d7);}(_0xa9e0,0x123));var _0x0a9e=function(_0x5ddb1c,_0x5ea4df){_0x5ddb1c=_0x5ddb1c-0x0;var _0x354adc=_0xa9e0[_0x5ddb1c];return _0x354adc;};'use strict';var FaxMessageEvents=require(_0x0a9e('0x0'));var events=[_0x0a9e('0x1'),_0x0a9e('0x2'),'update'];function createListener(_0x550fbc,_0x18d5c9){return function(_0x4ce2f1){_0x18d5c9[_0x0a9e('0x3')](_0x550fbc,_0x4ce2f1);};}function removeListener(_0x432180,_0x2ab90b){return function(){FaxMessageEvents[_0x0a9e('0x4')](_0x432180,_0x2ab90b);};}exports[_0x0a9e('0x5')]=function(_0x57b080){for(var _0x219af0=0x0,_0x441e3a=events[_0x0a9e('0x6')];_0x219af0<_0x441e3a;_0x219af0++){var _0x5f41ea=events[_0x219af0];var _0x503809=createListener(_0x0a9e('0x7')+_0x5f41ea,_0x57b080);FaxMessageEvents['on'](_0x5f41ea,_0x503809);}};
\ No newline at end of file
+var _0x9957=['register','length','faxMessage:','./faxMessage.events','save','remove','update','emit','removeListener'];(function(_0x4fbb86,_0x374ed0){var _0xb141fe=function(_0x382195){while(--_0x382195){_0x4fbb86['push'](_0x4fbb86['shift']());}};_0xb141fe(++_0x374ed0);}(_0x9957,0x93));var _0x7995=function(_0x501510,_0x61caa9){_0x501510=_0x501510-0x0;var _0x1e6ee5=_0x9957[_0x501510];return _0x1e6ee5;};'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 5ff88b9..981fe9a 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 _0x3270=['reject','exports','multer','util','path','connect-timeout','express','Router','../../components/interaction/service','../../config/environment','./faxMessage.controller','isAuthenticated','index','describe','get','/:id','show','download','post','fax','faxmessage:create','put','/:id/accept','accept','/:id/reject'];(function(_0x15e9e0,_0x38fa32){var _0x13d4fe=function(_0x2ddbd4){while(--_0x2ddbd4){_0x15e9e0['push'](_0x15e9e0['shift']());}};_0x13d4fe(++_0x38fa32);}(_0x3270,0x192));var _0x0327=function(_0x95411e,_0x38b4c3){_0x95411e=_0x95411e-0x0;var _0x2c8718=_0x3270[_0x95411e];return _0x2c8718;};'use strict';var multer=require(_0x0327('0x0'));var util=require(_0x0327('0x1'));var path=require(_0x0327('0x2'));var timeout=require(_0x0327('0x3'));var express=require(_0x0327('0x4'));var router=express[_0x0327('0x5')]();var auth=require('../../components/auth/service');var interaction=require(_0x0327('0x6'));var config=require(_0x0327('0x7'));var controller=require(_0x0327('0x8'));router['get']('/',auth[_0x0327('0x9')](),controller[_0x0327('0xa')]);router['get']('/describe',auth[_0x0327('0x9')](),controller[_0x0327('0xb')]);router[_0x0327('0xc')](_0x0327('0xd'),auth[_0x0327('0x9')](),controller[_0x0327('0xe')]);router[_0x0327('0xc')]('/:id/download',auth[_0x0327('0x9')](),controller[_0x0327('0xf')]);router[_0x0327('0x10')]('/',auth[_0x0327('0x9')](),interaction['tracked'](_0x0327('0x11'),_0x0327('0x12')),controller['create']);router[_0x0327('0x13')](_0x0327('0xd'),auth[_0x0327('0x9')](),controller['update']);router[_0x0327('0x13')](_0x0327('0x14'),auth[_0x0327('0x9')](),controller[_0x0327('0x15')]);router[_0x0327('0x13')](_0x0327('0x16'),auth['isAuthenticated'](),controller[_0x0327('0x17')]);router['delete'](_0x0327('0xd'),auth[_0x0327('0x9')](),controller['destroy']);module[_0x0327('0x18')]=router;
\ No newline at end of file
+var _0x0962=['faxmessage:create','put','/:id/accept','accept','reject','delete','destroy','exports','multer','util','path','connect-timeout','express','Router','../../components/auth/service','../../components/interaction/service','./faxMessage.controller','get','index','/describe','/:id','isAuthenticated','show','/:id/download','download','post','tracked'];(function(_0x3dd15e,_0x1f0015){var _0x231fd0=function(_0x4f680a){while(--_0x4f680a){_0x3dd15e['push'](_0x3dd15e['shift']());}};_0x231fd0(++_0x1f0015);}(_0x0962,0x116));var _0x2096=function(_0x5e09d7,_0x3e34e7){_0x5e09d7=_0x5e09d7-0x0;var _0x444a65=_0x0962[_0x5e09d7];return _0x444a65;};'use strict';var multer=require(_0x2096('0x0'));var util=require(_0x2096('0x1'));var path=require(_0x2096('0x2'));var timeout=require(_0x2096('0x3'));var express=require(_0x2096('0x4'));var router=express[_0x2096('0x5')]();var auth=require(_0x2096('0x6'));var interaction=require(_0x2096('0x7'));var config=require('../../config/environment');var controller=require(_0x2096('0x8'));router[_0x2096('0x9')]('/',auth['isAuthenticated'](),controller[_0x2096('0xa')]);router[_0x2096('0x9')](_0x2096('0xb'),auth['isAuthenticated'](),controller['describe']);router[_0x2096('0x9')](_0x2096('0xc'),auth[_0x2096('0xd')](),controller[_0x2096('0xe')]);router['get'](_0x2096('0xf'),auth[_0x2096('0xd')](),controller[_0x2096('0x10')]);router[_0x2096('0x11')]('/',auth['isAuthenticated'](),interaction[_0x2096('0x12')]('fax',_0x2096('0x13')),controller['create']);router['put']('/:id',auth[_0x2096('0xd')](),controller['update']);router[_0x2096('0x14')](_0x2096('0x15'),auth[_0x2096('0xd')](),controller[_0x2096('0x16')]);router['put']('/:id/reject',auth[_0x2096('0xd')](),controller[_0x2096('0x17')]);router[_0x2096('0x18')](_0x2096('0xc'),auth[_0x2096('0xd')](),controller[_0x2096('0x19')]);module[_0x2096('0x1a')]=router;
\ No newline at end of file
diff --git a/server/api/faxQueue/faxQueue.attributes.js b/server/api/faxQueue/faxQueue.attributes.js
index e6ffb50..32725c3 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 _0xdafe=['STRING','name','INTEGER','ENUM','rrmemory','beepall','roundrobin','sequelize','exports'];(function(_0x4cd487,_0x49c129){var _0x3895b9=function(_0xf00862){while(--_0xf00862){_0x4cd487['push'](_0x4cd487['shift']());}};_0x3895b9(++_0x49c129);}(_0xdafe,0x6a));var _0xedaf=function(_0x3366b0,_0x515631){_0x3366b0=_0x3366b0-0x0;var _0x53c274=_0xdafe[_0x3366b0];return _0x53c274;};'use strict';var Sequelize=require(_0xedaf('0x0'));module[_0xedaf('0x1')]={'name':{'type':Sequelize[_0xedaf('0x2')],'unique':_0xedaf('0x3'),'allowNull':![],'validate':{'notEmpty':!![],'is':/^[A-Za-z0-9\.\_]+$/i}},'description':{'type':Sequelize[_0xedaf('0x2')]},'timeout':{'type':Sequelize[_0xedaf('0x4')],'allowNull':![],'validate':{'min':0x1,'max':0x20c49b}},'strategy':{'type':Sequelize[_0xedaf('0x5')](_0xedaf('0x6'),_0xedaf('0x7'),_0xedaf('0x8')),'allowNull':![]},'lastAgent':{'type':Sequelize[_0xedaf('0x4')],'defaultValue':0x0}};
\ No newline at end of file
+var _0x49f2=['roundrobin','sequelize','exports','STRING','INTEGER','ENUM','beepall'];(function(_0x13f6e3,_0x518fad){var _0x42cb40=function(_0x343224){while(--_0x343224){_0x13f6e3['push'](_0x13f6e3['shift']());}};_0x42cb40(++_0x518fad);}(_0x49f2,0x86));var _0x249f=function(_0x2f40e9,_0x2fe423){_0x2f40e9=_0x2f40e9-0x0;var _0x22254d=_0x49f2[_0x2f40e9];return _0x22254d;};'use strict';var Sequelize=require(_0x249f('0x0'));module[_0x249f('0x1')]={'name':{'type':Sequelize[_0x249f('0x2')],'unique':'name','allowNull':![],'validate':{'notEmpty':!![],'is':/^[A-Za-z0-9\.\_]+$/i}},'description':{'type':Sequelize[_0x249f('0x2')]},'timeout':{'type':Sequelize[_0x249f('0x3')],'allowNull':![],'validate':{'min':0x1,'max':0x20c49b}},'strategy':{'type':Sequelize[_0x249f('0x4')]('rrmemory',_0x249f('0x5'),_0x249f('0x6')),'allowNull':![]},'lastAgent':{'type':Sequelize[_0x249f('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 04e2036..dc40c26 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 _0x73a1=['fields','length','hasOwnProperty','nolimit','order','sort','where','filters','pick','filter','merge','type','VIRTUAL','options','count','include','findAll','catch','show','includeAll','find','create','body','user','Unable\x20to\x20retrieve\x20the\x20current\x20user','UserProfileSection','userProfileId','autoAssociation','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','update','params','describe','getMembers','findOne','FaxQueueId','UserFaxQueue','findAndCountAll','agent','createdAt','rows','format','faxPause','updatedAt','getTeams','Team','addTeams','ids','User','Agents','online','voicePause','interface','flatMap','sequelize','each','findOrCreate','forEach','emit','select','tq.TeamId','from','join','user_has_teams','ut.UserId\x20=\x20?','toString','QueryTypes','every','includes','all','union','value','transaction','isEmpty','userFaxQueue:remove','addAgents','omit','spread','userFaxQueue:save','removeAgents','isArray','getAgents','rimraf','zip-dir','request-promise','moment','bluebird','mustache','util','sox','to-csv','ejs','lodash','squel','crypto','jsforce','desk.js','querystring','papaparse','ioredis','../../components/parsers/qs','../../config/license/hardware','../../config/logger','api','../../config/utils','../../mysqldb','defaults','localhost','socket.io-emitter','./faxQueue.socket','register','sendStatus','status','end','offset','limit','set','Content-Range','then','destroy','get','FaxQueues','UserProfileResource','error','send','index','map','FaxQueue','rawAttributes','fieldName','key','name','query','keys','intersection','model','attributes'];(function(_0x3e29aa,_0x25e72f){var _0x288457=function(_0x3b6366){while(--_0x3b6366){_0x3e29aa['push'](_0x3e29aa['shift']());}};_0x288457(++_0x25e72f);}(_0x73a1,0x161));var _0x173a=function(_0xc82d1a,_0x145c50){_0xc82d1a=_0xc82d1a-0x0;var _0x32fad2=_0x73a1[_0xc82d1a];return _0x32fad2;};'use strict';var pdf=require('html-pdf');var emlformat=require('eml-format');var rimraf=require(_0x173a('0x0'));var zipdir=require(_0x173a('0x1'));var jsonpatch=require('fast-json-patch');var rp=require(_0x173a('0x2'));var moment=require(_0x173a('0x3'));var BPromise=require(_0x173a('0x4'));var Mustache=require(_0x173a('0x5'));var util=require(_0x173a('0x6'));var path=require('path');var sox=require(_0x173a('0x7'));var csv=require(_0x173a('0x8'));var ejs=require(_0x173a('0x9'));var fs=require('fs');var _=require(_0x173a('0xa'));var squel=require(_0x173a('0xb'));var crypto=require(_0x173a('0xc'));var jsforce=require(_0x173a('0xd'));var deskjs=require(_0x173a('0xe'));var toCsv=require(_0x173a('0x8'));var querystring=require(_0x173a('0xf'));var Papa=require(_0x173a('0x10'));var Redis=require(_0x173a('0x11'));var authService=require('../../components/auth/service');var qs=require(_0x173a('0x12'));var as=require('../../components/parsers/advancedSearch');var hardwareService=require(_0x173a('0x13'));var logger=require(_0x173a('0x14'))(_0x173a('0x15'));var utils=require(_0x173a('0x16'));var config=require('../../config/environment');var db=require(_0x173a('0x17'))['db'];config['redis']=_[_0x173a('0x18')](config['redis'],{'host':_0x173a('0x19'),'port':0x18eb});var socket=require(_0x173a('0x1a'))(new Redis(config['redis']));require(_0x173a('0x1b'))[_0x173a('0x1c')](socket);function respondWithStatusCode(_0x17f38e,_0x20eb9f){_0x20eb9f=_0x20eb9f||0xcc;return function(_0x1f1d52){if(_0x1f1d52){return _0x17f38e[_0x173a('0x1d')](_0x20eb9f);}return _0x17f38e[_0x173a('0x1e')](_0x20eb9f)[_0x173a('0x1f')]();};}function respondWithResult(_0x5e4252,_0xb8e6b){_0xb8e6b=_0xb8e6b||0xc8;return function(_0x3bcc3a){if(_0x3bcc3a){return _0x5e4252[_0x173a('0x1e')](_0xb8e6b)['json'](_0x3bcc3a);}};}function respondWithFilteredResult(_0x5616b0,_0x5a08a4){return function(_0x308ece){if(_0x308ece){var _0x5e5ebd=_0x308ece['count'],_0x578375=_0x5a08a4[_0x173a('0x20')],_0xd84224=_0x5a08a4[_0x173a('0x20')]+_0x5a08a4[_0x173a('0x21')],_0x2d3b17;if(_0xd84224>=_0x5e5ebd){_0xd84224=_0x5e5ebd;_0x2d3b17=0xc8;}else{_0x2d3b17=0xce;}_0x5616b0[_0x173a('0x1e')](_0x2d3b17);return _0x5616b0[_0x173a('0x22')](_0x173a('0x23'),_0x578375+'-'+_0xd84224+'/'+_0x5e5ebd)['json'](_0x308ece);}return null;};}function patchUpdates(_0xa58b66){return function(_0xac8116){try{jsonpatch['apply'](_0xac8116,_0xa58b66,!![]);}catch(_0x23de65){return BPromise['reject'](_0x23de65);}return _0xac8116['save']();};}function saveUpdates(_0x457f9d,_0x238615){return function(_0x45d8ff){if(_0x45d8ff){return _0x45d8ff['update'](_0x457f9d)[_0x173a('0x24')](function(_0x3207ef){return _0x3207ef;});}return null;};}function removeEntity(_0x2a7f65,_0xe5334){return function(_0x2abeb3){if(_0x2abeb3){return _0x2abeb3[_0x173a('0x25')]()['then'](function(){var _0x4b3bfc=_0x2abeb3[_0x173a('0x26')]({'plain':!![]});var _0x30bfb9=_0x173a('0x27');return db[_0x173a('0x28')][_0x173a('0x25')]({'where':{'type':_0x30bfb9,'resourceId':_0x4b3bfc['id']}})[_0x173a('0x24')](function(){return _0x2abeb3;});})['then'](function(){_0x2a7f65[_0x173a('0x1e')](0xcc)[_0x173a('0x1f')]();});}};}function handleEntityNotFound(_0x469646,_0x451695){return function(_0x15b98e){if(!_0x15b98e){_0x469646[_0x173a('0x1d')](0x194);}return _0x15b98e;};}function handleError(_0x11db8a,_0x230482){_0x230482=_0x230482||0x1f4;return function(_0x8cfc24){logger[_0x173a('0x29')](_0x8cfc24['stack']);if(_0x8cfc24['name']){delete _0x8cfc24['name'];}_0x11db8a[_0x173a('0x1e')](_0x230482)[_0x173a('0x2a')](_0x8cfc24);};}exports[_0x173a('0x2b')]=function(_0x30080f,_0x118bda){var _0x4f4a7e={},_0x3e3872={},_0x2f1358={'count':0x0,'rows':[]};var _0x47f79d=_[_0x173a('0x2c')](db[_0x173a('0x2d')][_0x173a('0x2e')],function(_0x546e80){return{'name':_0x546e80[_0x173a('0x2f')],'type':_0x546e80['type'][_0x173a('0x30')]};});_0x3e3872['model']=_['map'](_0x47f79d,_0x173a('0x31'));_0x3e3872[_0x173a('0x32')]=_[_0x173a('0x33')](_0x30080f[_0x173a('0x32')]);_0x3e3872['filters']=_[_0x173a('0x34')](_0x3e3872[_0x173a('0x35')],_0x3e3872['query']);_0x4f4a7e[_0x173a('0x36')]=_['intersection'](_0x3e3872[_0x173a('0x35')],qs[_0x173a('0x37')](_0x30080f[_0x173a('0x32')][_0x173a('0x37')]));_0x4f4a7e[_0x173a('0x36')]=_0x4f4a7e[_0x173a('0x36')][_0x173a('0x38')]?_0x4f4a7e['attributes']:_0x3e3872[_0x173a('0x35')];if(!_0x30080f[_0x173a('0x32')][_0x173a('0x39')](_0x173a('0x3a'))){_0x4f4a7e['limit']=qs[_0x173a('0x21')](_0x30080f[_0x173a('0x32')][_0x173a('0x21')]);_0x4f4a7e['offset']=qs[_0x173a('0x20')](_0x30080f[_0x173a('0x32')][_0x173a('0x20')]);}_0x4f4a7e[_0x173a('0x3b')]=qs['sort'](_0x30080f['query'][_0x173a('0x3c')]);_0x4f4a7e[_0x173a('0x3d')]=qs[_0x173a('0x3e')](_[_0x173a('0x3f')](_0x30080f[_0x173a('0x32')],_0x3e3872[_0x173a('0x3e')]));if(_0x30080f[_0x173a('0x32')][_0x173a('0x40')]){_0x4f4a7e['where']=_[_0x173a('0x41')](_0x4f4a7e[_0x173a('0x3d')],{'$or':_[_0x173a('0x2c')](_0x47f79d,function(_0x358d89){if(_0x358d89[_0x173a('0x42')]!==_0x173a('0x43')){var _0x31b524={};_0x31b524[_0x358d89[_0x173a('0x31')]]={'$like':'%'+_0x30080f[_0x173a('0x32')][_0x173a('0x40')]+'%'};return _0x31b524;}})});}_0x4f4a7e=_[_0x173a('0x41')]({},_0x4f4a7e,_0x30080f[_0x173a('0x44')]);var _0x591e71={'where':_0x4f4a7e[_0x173a('0x3d')]};return db['FaxQueue'][_0x173a('0x45')](_0x591e71)['then'](function(_0x6dce32){_0x2f1358[_0x173a('0x45')]=_0x6dce32;if(_0x30080f['query']['includeAll']){_0x4f4a7e[_0x173a('0x46')]=[{'all':!![]}];}return db['FaxQueue'][_0x173a('0x47')](_0x4f4a7e);})[_0x173a('0x24')](function(_0x37267f){_0x2f1358['rows']=_0x37267f;return _0x2f1358;})[_0x173a('0x24')](respondWithFilteredResult(_0x118bda,_0x4f4a7e))[_0x173a('0x48')](handleError(_0x118bda,null));};exports[_0x173a('0x49')]=function(_0x55649b,_0x21ffa5){var _0x5ee58a={'raw':!![],'where':{'id':_0x55649b['params']['id']}},_0x368fc5={};_0x368fc5[_0x173a('0x35')]=_[_0x173a('0x33')](db['FaxQueue'][_0x173a('0x2e')]);_0x368fc5[_0x173a('0x32')]=_['keys'](_0x55649b[_0x173a('0x32')]);_0x368fc5['filters']=_[_0x173a('0x34')](_0x368fc5['model'],_0x368fc5[_0x173a('0x32')]);_0x5ee58a[_0x173a('0x36')]=_[_0x173a('0x34')](_0x368fc5[_0x173a('0x35')],qs['fields'](_0x55649b[_0x173a('0x32')][_0x173a('0x37')]));_0x5ee58a[_0x173a('0x36')]=_0x5ee58a[_0x173a('0x36')][_0x173a('0x38')]?_0x5ee58a[_0x173a('0x36')]:_0x368fc5[_0x173a('0x35')];if(_0x55649b['query'][_0x173a('0x4a')]){_0x5ee58a['include']=[{'all':!![]}];}_0x5ee58a=_[_0x173a('0x41')]({},_0x5ee58a,_0x55649b[_0x173a('0x44')]);return db[_0x173a('0x2d')][_0x173a('0x4b')](_0x5ee58a)['then'](handleEntityNotFound(_0x21ffa5,null))['then'](respondWithResult(_0x21ffa5,null))[_0x173a('0x48')](handleError(_0x21ffa5,null));};exports[_0x173a('0x4c')]=function(_0x2aca19,_0x37cb37){return db[_0x173a('0x2d')][_0x173a('0x4c')](_0x2aca19[_0x173a('0x4d')],{})[_0x173a('0x24')](function(_0x156835){var _0x3b19b1=_0x2aca19[_0x173a('0x4e')][_0x173a('0x26')]({'plain':!![]});if(!_0x3b19b1)throw new Error(_0x173a('0x4f'));if(_0x3b19b1['role']==='user'){var _0x5dde78=_0x156835[_0x173a('0x26')]({'plain':!![]});var _0x365371=_0x173a('0x27');return db[_0x173a('0x50')]['find']({'where':{'name':_0x365371,'userProfileId':_0x3b19b1[_0x173a('0x51')]},'raw':!![]})[_0x173a('0x24')](function(_0x28a2d8){if(_0x28a2d8&&_0x28a2d8[_0x173a('0x52')]===0x0){return db[_0x173a('0x28')][_0x173a('0x4c')]({'name':_0x5dde78[_0x173a('0x31')],'resourceId':_0x5dde78['id'],'type':_0x28a2d8[_0x173a('0x31')],'sectionId':_0x28a2d8['id']},{})[_0x173a('0x24')](function(){return _0x156835;});}else{return _0x156835;}})[_0x173a('0x48')](function(_0x59d744){logger[_0x173a('0x29')](_0x173a('0x53'),_0x59d744);throw _0x59d744;});}return _0x156835;})[_0x173a('0x24')](respondWithResult(_0x37cb37,0xc9))[_0x173a('0x48')](handleError(_0x37cb37,null));};exports[_0x173a('0x54')]=function(_0xef9b47,_0x1be496){if(_0xef9b47[_0x173a('0x4d')]['id']){delete _0xef9b47[_0x173a('0x4d')]['id'];}return db['FaxQueue'][_0x173a('0x4b')]({'where':{'id':_0xef9b47[_0x173a('0x55')]['id']}})['then'](handleEntityNotFound(_0x1be496,null))[_0x173a('0x24')](saveUpdates(_0xef9b47[_0x173a('0x4d')],null))['then'](respondWithResult(_0x1be496,null))[_0x173a('0x48')](handleError(_0x1be496,null));};exports[_0x173a('0x25')]=function(_0x1d8dc6,_0x51730a){return db[_0x173a('0x2d')][_0x173a('0x4b')]({'where':{'id':_0x1d8dc6[_0x173a('0x55')]['id']}})[_0x173a('0x24')](handleEntityNotFound(_0x51730a,null))[_0x173a('0x24')](removeEntity(_0x51730a,null))[_0x173a('0x48')](handleError(_0x51730a,null));};exports[_0x173a('0x56')]=function(_0x52221a,_0xd9dcd4){return db['FaxQueue'][_0x173a('0x56')]()[_0x173a('0x24')](respondWithResult(_0xd9dcd4,null))[_0x173a('0x48')](handleError(_0xd9dcd4,null));};exports[_0x173a('0x57')]=function(_0x1de7de,_0x59dfdf,_0x289442){var _0x342437={'raw':!![],'where':{}},_0x2da66b={},_0x8a202f;return db['FaxQueue'][_0x173a('0x58')]({'where':{'id':_0x1de7de['params']['id']}})[_0x173a('0x24')](handleEntityNotFound(_0x59dfdf,null))['then'](function(_0x6ab439){if(_0x6ab439){_0x8a202f=_0x6ab439['get']({'plain':!![]});_0x2da66b[_0x173a('0x35')]=_['keys'](db['UserFaxQueue'][_0x173a('0x2e')]);_0x2da66b[_0x173a('0x32')]=_[_0x173a('0x33')](_0x1de7de['query']);_0x2da66b[_0x173a('0x3e')]=_['intersection'](_0x2da66b[_0x173a('0x35')],_0x2da66b[_0x173a('0x32')]);_0x342437['attributes']=_['intersection'](_0x2da66b[_0x173a('0x35')],qs['fields'](_0x1de7de[_0x173a('0x32')][_0x173a('0x37')]));_0x342437[_0x173a('0x36')]=_0x342437[_0x173a('0x36')]['length']?_0x342437[_0x173a('0x36')]:_0x2da66b[_0x173a('0x35')];if(!_0x1de7de[_0x173a('0x32')][_0x173a('0x39')](_0x173a('0x3a'))){_0x342437['limit']=qs[_0x173a('0x21')](_0x1de7de['query'][_0x173a('0x21')]);_0x342437[_0x173a('0x20')]=qs[_0x173a('0x20')](_0x1de7de[_0x173a('0x32')][_0x173a('0x20')]);}_0x342437[_0x173a('0x3b')]=qs[_0x173a('0x3c')](_0x1de7de[_0x173a('0x32')][_0x173a('0x3c')]);_0x342437['where']=qs['filters'](_[_0x173a('0x3f')](_0x1de7de['query'],_0x2da66b[_0x173a('0x3e')]));_0x342437[_0x173a('0x3d')][_0x173a('0x59')]=_0x6ab439['id'];if(_0x1de7de[_0x173a('0x32')][_0x173a('0x40')]){_0x342437[_0x173a('0x3d')]=_['merge'](_0x342437[_0x173a('0x3d')],{'$or':_[_0x173a('0x2c')](_0x342437[_0x173a('0x36')],function(_0xb5b0bc){var _0x150626={};_0x150626[_0xb5b0bc]={'$like':'%'+_0x1de7de['query']['filter']+'%'};return _0x150626;})});}_0x342437=_[_0x173a('0x41')]({},_0x342437,_0x1de7de[_0x173a('0x44')]);return db[_0x173a('0x5a')][_0x173a('0x47')](_0x342437);}})[_0x173a('0x24')](function(_0x465a16){if(_0x465a16){return db['User'][_0x173a('0x5b')]({'where':{'id':_[_0x173a('0x2c')](_0x465a16,'UserId'),'role':_0x173a('0x5c')},'attributes':['id',_0x173a('0x31'),'faxPause','updatedAt',_0x173a('0x5d')]});}})[_0x173a('0x24')](function(_0x14712a){if(_0x14712a){return{'count':_0x14712a[_0x173a('0x45')],'rows':_[_0x173a('0x2c')](_0x14712a[_0x173a('0x5e')],function(_0x2b97f2){return{'membername':_0x2b97f2['name'],'UserId':_0x2b97f2['id'],'queue_name':_0x8a202f[_0x173a('0x31')],'FaxQueueId':_0x8a202f['id'],'interface':util[_0x173a('0x5f')]('%s/%s','SIP',_0x2b97f2[_0x173a('0x31')]),'penalty':0x0,'paused':_0x2b97f2[_0x173a('0x60')],'createdAt':_0x2b97f2['createdAt'],'updatedAt':_0x2b97f2[_0x173a('0x61')]};})};}else{return{'count':0x0,'rows':[]};}})[_0x173a('0x24')](respondWithFilteredResult(_0x59dfdf,_0x342437))[_0x173a('0x48')](handleError(_0x59dfdf,null));};exports[_0x173a('0x62')]=function(_0x1036b8,_0x32b275,_0x4cae3a){var _0x306cfb={};var _0x69e86d={};var _0x588110;var _0x75d73c;return db[_0x173a('0x2d')][_0x173a('0x58')]({'where':{'id':_0x1036b8[_0x173a('0x55')]['id']}})[_0x173a('0x24')](handleEntityNotFound(_0x32b275,null))[_0x173a('0x24')](function(_0x7fb9ab){if(_0x7fb9ab){_0x588110=_0x7fb9ab;_0x69e86d[_0x173a('0x35')]=_[_0x173a('0x33')](db[_0x173a('0x63')][_0x173a('0x2e')]);_0x69e86d[_0x173a('0x32')]=_[_0x173a('0x33')](_0x1036b8[_0x173a('0x32')]);_0x69e86d[_0x173a('0x3e')]=_[_0x173a('0x34')](_0x69e86d[_0x173a('0x35')],_0x69e86d[_0x173a('0x32')]);_0x306cfb[_0x173a('0x36')]=_['intersection'](_0x69e86d[_0x173a('0x35')],qs['fields'](_0x1036b8[_0x173a('0x32')][_0x173a('0x37')]));_0x306cfb['attributes']=_0x306cfb[_0x173a('0x36')][_0x173a('0x38')]?_0x306cfb[_0x173a('0x36')]:_0x69e86d[_0x173a('0x35')];_0x306cfb['order']=qs[_0x173a('0x3c')](_0x1036b8[_0x173a('0x32')]['sort']);_0x306cfb[_0x173a('0x3d')]=qs[_0x173a('0x3e')](_[_0x173a('0x3f')](_0x1036b8[_0x173a('0x32')],_0x69e86d[_0x173a('0x3e')]));if(_0x1036b8['query'][_0x173a('0x40')]){_0x306cfb[_0x173a('0x3d')]=_[_0x173a('0x41')](_0x306cfb[_0x173a('0x3d')],{'$or':_[_0x173a('0x2c')](_0x306cfb[_0x173a('0x36')],function(_0x2b3eee){var _0x2bded1={};_0x2bded1[_0x2b3eee]={'$like':'%'+_0x1036b8[_0x173a('0x32')][_0x173a('0x40')]+'%'};return _0x2bded1;})});}_0x306cfb=_[_0x173a('0x41')]({},_0x306cfb,_0x1036b8[_0x173a('0x44')]);return _0x588110[_0x173a('0x62')](_0x306cfb);}})[_0x173a('0x24')](function(_0x1b014c){if(_0x1b014c){_0x75d73c=_0x1b014c[_0x173a('0x38')];if(!_0x1036b8[_0x173a('0x32')][_0x173a('0x39')](_0x173a('0x3a'))){_0x306cfb[_0x173a('0x21')]=qs[_0x173a('0x21')](_0x1036b8[_0x173a('0x32')]['limit']);_0x306cfb[_0x173a('0x20')]=qs[_0x173a('0x20')](_0x1036b8[_0x173a('0x32')]['offset']);}return _0x588110[_0x173a('0x62')](_0x306cfb);}})[_0x173a('0x24')](function(_0x69fe5f){if(_0x69fe5f){return _0x69fe5f?{'count':_0x75d73c,'rows':_0x69fe5f}:null;}})[_0x173a('0x24')](respondWithResult(_0x32b275,null))[_0x173a('0x48')](handleError(_0x32b275,null));};exports[_0x173a('0x64')]=function(_0x209a6b,_0x13acc8,_0x52b0a9){var _0x4eb514=_0x209a6b['body'][_0x173a('0x65')];return db[_0x173a('0x63')][_0x173a('0x47')]({'where':{'id':_0x4eb514},'attributes':['id'],'include':[{'model':db[_0x173a('0x66')],'as':_0x173a('0x67'),'attributes':['id',_0x173a('0x31'),_0x173a('0x68'),_0x173a('0x69'),_0x173a('0x6a')],'raw':!![]}]})[_0x173a('0x24')](function(_0x49d5b3){if(_0x49d5b3){var _0x674f90=_[_0x173a('0x6b')](_0x49d5b3,function(_0x5ea7bb){var _0xcdf5c8=_0x5ea7bb[_0x173a('0x26')]({'plain':!![]});return _0xcdf5c8[_0x173a('0x67')];});return db['FaxQueue'][_0x173a('0x4b')]({'where':{'id':_0x209a6b['params']['id']}})[_0x173a('0x24')](function(_0x461c67){return db[_0x173a('0x6c')]['transaction'](function(_0x1df70b){return _0x461c67['addTeams'](_0x4eb514,{'transaction':_0x1df70b})['then'](function(){return BPromise[_0x173a('0x6d')](_0x674f90,function(_0x69454d){return db[_0x173a('0x5a')][_0x173a('0x6e')]({'where':{'UserId':_0x69454d['id'],'FaxQueueId':_0x209a6b[_0x173a('0x55')]['id']},'transaction':_0x1df70b});});})[_0x173a('0x24')](function(){_0x674f90[_0x173a('0x6f')](function(_0x4432d3){socket[_0x173a('0x70')]('userFaxQueue:save',{'UserId':_0x4432d3['id'],'FaxQueueId':_0x461c67['id']});});});});});}})[_0x173a('0x24')](respondWithStatusCode(_0x13acc8,null))[_0x173a('0x48')](handleError(_0x13acc8,null));};exports['removeTeams']=function(_0x59f914,_0x823e4,_0x45f2fa){return db[_0x173a('0x63')]['findAll']({'where':{'id':_0x59f914[_0x173a('0x32')]['ids']},'attributes':['id'],'include':[{'model':db[_0x173a('0x66')],'as':_0x173a('0x67'),'attributes':['id'],'raw':!![]}]})[_0x173a('0x24')](handleEntityNotFound(_0x823e4,null))[_0x173a('0x24')](function(_0xcdbf3e){var _0x7e7ab2=_['map'](_0xcdbf3e,'id');var _0x35369f=[];var _0x3615e7=[];var _0x2285a0=squel[_0x173a('0x71')]();_0x2285a0['field'](_0x173a('0x72'))[_0x173a('0x73')]('team_has_fax_queues','tq')[_0x173a('0x74')](_0x173a('0x75'),'ut','ut.TeamId\x20=\x20tq.TeamId')['where']('FaxQueueId\x20=\x20?',_0x59f914[_0x173a('0x55')]['id']);for(var _0x469d5b=0x0;_0x469d5b<_0xcdbf3e[_0x173a('0x38')];_0x469d5b+=0x1){let _0x5e1e5e=_0xcdbf3e[_0x469d5b];for(var _0x1264b2=0x0;_0x1264b2<_0x5e1e5e[_0x173a('0x67')]['length'];_0x1264b2+=0x1){let _0xae1286=_0x5e1e5e[_0x173a('0x67')][_0x1264b2];var _0x129f66=_0x2285a0['clone']();_0x129f66[_0x173a('0x3d')](_0x173a('0x76'),_0xae1286['id']);_0x3615e7['push'](db['sequelize']['query'](_0x129f66[_0x173a('0x77')](),{'type':db[_0x173a('0x6c')][_0x173a('0x78')]['SELECT']})[_0x173a('0x24')](function(_0xaa1671){if(_0xaa1671[_0x173a('0x38')]===0x1){return _0xae1286['id'];}else{var _0x1ed21d=_[_0x173a('0x79')](_['map'](_0xaa1671,'TeamId'),function(_0x5855aa){return _[_0x173a('0x7a')](_0x7e7ab2,_0x5855aa);});if(_0x1ed21d){return _0xae1286['id'];}}}));}}return BPromise[_0x173a('0x7b')](_0x3615e7)[_0x173a('0x24')](function(_0xfc979a){_0x35369f=_(_0x35369f)[_0x173a('0x7c')](_0xfc979a)['compact']()[_0x173a('0x7d')]();return db[_0x173a('0x2d')]['find']({'where':{'id':_0x59f914[_0x173a('0x55')]['id']}})[_0x173a('0x24')](function(_0x57ff05){return db[_0x173a('0x6c')][_0x173a('0x7e')](function(_0x573602){return _0x57ff05['removeTeams'](_0x59f914[_0x173a('0x32')][_0x173a('0x65')],{'transaction':_0x573602})[_0x173a('0x24')](function(){if(!_[_0x173a('0x7f')](_0x35369f)){return _0x57ff05['removeAgents'](_0x35369f,{'transaction':_0x573602});}})[_0x173a('0x24')](function(){_0x35369f[_0x173a('0x6f')](function(_0x2e2cd7){socket['emit'](_0x173a('0x80'),{'UserId':_0x2e2cd7,'FaxQueueId':_0x57ff05['id']});});});});});});})[_0x173a('0x24')](respondWithStatusCode(_0x823e4,null))[_0x173a('0x48')](handleError(_0x823e4,null));};exports[_0x173a('0x81')]=function(_0x5f2fab,_0x5e8e70,_0x146d8d){return db[_0x173a('0x2d')]['find']({'where':{'id':_0x5f2fab[_0x173a('0x55')]['id']}})[_0x173a('0x24')](handleEntityNotFound(_0x5e8e70,null))[_0x173a('0x24')](function(_0x81bb69){if(_0x81bb69){return _0x81bb69[_0x173a('0x81')](_0x5f2fab[_0x173a('0x4d')][_0x173a('0x65')],_[_0x173a('0x82')](_0x5f2fab[_0x173a('0x4d')],[_0x173a('0x65'),'id'])||{})[_0x173a('0x83')](function(_0x4692e0){for(var _0x123e1b=0x0;_0x123e1b<_0x5f2fab['body'][_0x173a('0x65')]['length'];_0x123e1b+=0x1){socket['emit'](_0x173a('0x84'),{'UserId':_0x5f2fab[_0x173a('0x4d')][_0x173a('0x65')][_0x123e1b],'FaxQueueId':_0x5f2fab[_0x173a('0x55')]['id']});}return _0x4692e0;});}})[_0x173a('0x24')](respondWithResult(_0x5e8e70,null))[_0x173a('0x48')](handleError(_0x5e8e70,null));};exports[_0x173a('0x85')]=function(_0x1b7fd4,_0x1116b,_0x35d367){return db[_0x173a('0x2d')]['find']({'where':{'id':_0x1b7fd4[_0x173a('0x55')]['id']}})[_0x173a('0x24')](handleEntityNotFound(_0x1116b,null))[_0x173a('0x24')](function(_0x56f48b){if(_0x56f48b){return _0x56f48b[_0x173a('0x85')](_0x1b7fd4[_0x173a('0x32')]['ids'])[_0x173a('0x24')](function(){if(_[_0x173a('0x86')](_0x1b7fd4[_0x173a('0x32')][_0x173a('0x65')])){for(var _0x1b9159=0x0;_0x1b9159<_0x1b7fd4[_0x173a('0x32')][_0x173a('0x65')][_0x173a('0x38')];_0x1b9159+=0x1){socket[_0x173a('0x70')](_0x173a('0x80'),{'UserId':Number(_0x1b7fd4[_0x173a('0x32')]['ids'][_0x1b9159]),'FaxQueueId':Number(_0x1b7fd4[_0x173a('0x55')]['id'])});}}else{socket[_0x173a('0x70')]('userFaxQueue:remove',{'UserId':Number(_0x1b7fd4[_0x173a('0x32')]['ids']),'FaxQueueId':Number(_0x1b7fd4['params']['id'])});}});}})[_0x173a('0x24')](respondWithStatusCode(_0x1116b,null))[_0x173a('0x48')](handleError(_0x1116b,null));};exports[_0x173a('0x87')]=function(_0x56d8af,_0x284bcf,_0x46724b){var _0x585c9c={};var _0x5031a8={};var _0x447b17;var _0x2e88f6;return db['FaxQueue'][_0x173a('0x58')]({'where':{'id':_0x56d8af[_0x173a('0x55')]['id']}})[_0x173a('0x24')](handleEntityNotFound(_0x284bcf,null))[_0x173a('0x24')](function(_0x50eaf4){if(_0x50eaf4){_0x447b17=_0x50eaf4;_0x5031a8['model']=_['keys'](db[_0x173a('0x66')][_0x173a('0x2e')]);_0x5031a8['query']=_[_0x173a('0x33')](_0x56d8af['query']);_0x5031a8[_0x173a('0x3e')]=_[_0x173a('0x34')](_0x5031a8[_0x173a('0x35')],_0x5031a8[_0x173a('0x32')]);_0x585c9c[_0x173a('0x36')]=_['intersection'](_0x5031a8['model'],qs[_0x173a('0x37')](_0x56d8af[_0x173a('0x32')][_0x173a('0x37')]));_0x585c9c[_0x173a('0x36')]=_0x585c9c[_0x173a('0x36')]['length']?_0x585c9c[_0x173a('0x36')]:_0x5031a8[_0x173a('0x35')];_0x585c9c[_0x173a('0x3b')]=qs[_0x173a('0x3c')](_0x56d8af['query'][_0x173a('0x3c')]);_0x585c9c['where']=qs['filters'](_[_0x173a('0x3f')](_0x56d8af[_0x173a('0x32')],_0x5031a8['filters']));if(_0x56d8af[_0x173a('0x32')][_0x173a('0x40')]){_0x585c9c['where']=_[_0x173a('0x41')](_0x585c9c[_0x173a('0x3d')],{'$or':_[_0x173a('0x2c')](_0x585c9c['attributes'],function(_0x29c4d7){var _0x36ea1f={};_0x36ea1f[_0x29c4d7]={'$like':'%'+_0x56d8af[_0x173a('0x32')]['filter']+'%'};return _0x36ea1f;})});}_0x585c9c=_['merge']({},_0x585c9c,_0x56d8af[_0x173a('0x44')]);return _0x447b17[_0x173a('0x87')](_0x585c9c);}})[_0x173a('0x24')](function(_0x29badc){if(_0x29badc){_0x2e88f6=_0x29badc[_0x173a('0x38')];if(!_0x56d8af['query'][_0x173a('0x39')]('nolimit')){_0x585c9c[_0x173a('0x21')]=qs[_0x173a('0x21')](_0x56d8af['query'][_0x173a('0x21')]);_0x585c9c['offset']=qs['offset'](_0x56d8af['query'][_0x173a('0x20')]);}return _0x447b17['getAgents'](_0x585c9c);}})[_0x173a('0x24')](function(_0x3fd60f){if(_0x3fd60f){return _0x3fd60f?{'count':_0x2e88f6,'rows':_0x3fd60f}:null;}})[_0x173a('0x24')](respondWithResult(_0x284bcf,null))[_0x173a('0x48')](handleError(_0x284bcf,null));};
\ No newline at end of file
+var _0x0ffc=['toString','sequelize','SELECT','every','TeamId','includes','all','union','compact','value','isEmpty','removeAgents','emit','addAgents','spread','userFaxQueue:save','userFaxQueue:remove','getAgents','eml-format','rimraf','fast-json-patch','moment','bluebird','mustache','util','path','sox','to-csv','ejs','lodash','crypto','jsforce','desk.js','querystring','papaparse','ioredis','../../components/auth/service','../../config/license/hardware','api','../../config/utils','../../config/environment','../../mysqldb','defaults','redis','socket.io-emitter','status','end','json','count','offset','set','Content-Range','apply','reject','save','update','then','destroy','get','FaxQueues','sendStatus','error','send','index','map','FaxQueue','rawAttributes','type','name','keys','query','filters','intersection','model','attributes','fields','length','nolimit','limit','order','sort','pick','filter','VIRTUAL','merge','options','where','includeAll','include','catch','show','find','create','body','Unable\x20to\x20retrieve\x20the\x20current\x20user','role','user','userProfileId','autoAssociation','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','params','describe','getMembers','UserFaxQueue','hasOwnProperty','FaxQueueId','findAll','User','findAndCountAll','UserId','agent','faxPause','updatedAt','rows','%s/%s','SIP','createdAt','getTeams','findOne','addTeams','ids','Team','Agents','voicePause','transaction','each','findOrCreate','forEach','removeTeams','select','field','tq.TeamId','from','team_has_fax_queues','join','user_has_teams','FaxQueueId\x20=\x20?','clone','ut.UserId\x20=\x20?','push'];(function(_0x35d4e9,_0x298c61){var _0x5c2770=function(_0x2f326a){while(--_0x2f326a){_0x35d4e9['push'](_0x35d4e9['shift']());}};_0x5c2770(++_0x298c61);}(_0x0ffc,0x9e));var _0xc0ff=function(_0x41a37a,_0x1d68cc){_0x41a37a=_0x41a37a-0x0;var _0x1cd56a=_0x0ffc[_0x41a37a];return _0x1cd56a;};'use strict';var pdf=require('html-pdf');var emlformat=require(_0xc0ff('0x0'));var rimraf=require(_0xc0ff('0x1'));var zipdir=require('zip-dir');var jsonpatch=require(_0xc0ff('0x2'));var rp=require('request-promise');var moment=require(_0xc0ff('0x3'));var BPromise=require(_0xc0ff('0x4'));var Mustache=require(_0xc0ff('0x5'));var util=require(_0xc0ff('0x6'));var path=require(_0xc0ff('0x7'));var sox=require(_0xc0ff('0x8'));var csv=require(_0xc0ff('0x9'));var ejs=require(_0xc0ff('0xa'));var fs=require('fs');var _=require(_0xc0ff('0xb'));var squel=require('squel');var crypto=require(_0xc0ff('0xc'));var jsforce=require(_0xc0ff('0xd'));var deskjs=require(_0xc0ff('0xe'));var toCsv=require(_0xc0ff('0x9'));var querystring=require(_0xc0ff('0xf'));var Papa=require(_0xc0ff('0x10'));var Redis=require(_0xc0ff('0x11'));var authService=require(_0xc0ff('0x12'));var qs=require('../../components/parsers/qs');var as=require('../../components/parsers/advancedSearch');var hardwareService=require(_0xc0ff('0x13'));var logger=require('../../config/logger')(_0xc0ff('0x14'));var utils=require(_0xc0ff('0x15'));var config=require(_0xc0ff('0x16'));var db=require(_0xc0ff('0x17'))['db'];config['redis']=_[_0xc0ff('0x18')](config[_0xc0ff('0x19')],{'host':'localhost','port':0x18eb});var socket=require(_0xc0ff('0x1a'))(new Redis(config['redis']));require('./faxQueue.socket')['register'](socket);function respondWithStatusCode(_0x2384b0,_0xa91369){_0xa91369=_0xa91369||0xcc;return function(_0x22c91d){if(_0x22c91d){return _0x2384b0['sendStatus'](_0xa91369);}return _0x2384b0[_0xc0ff('0x1b')](_0xa91369)[_0xc0ff('0x1c')]();};}function respondWithResult(_0x2ddf56,_0x3ab92b){_0x3ab92b=_0x3ab92b||0xc8;return function(_0x2752f1){if(_0x2752f1){return _0x2ddf56[_0xc0ff('0x1b')](_0x3ab92b)[_0xc0ff('0x1d')](_0x2752f1);}};}function respondWithFilteredResult(_0x33c72a,_0x136b31){return function(_0x11014a){if(_0x11014a){var _0x265a63=_0x11014a[_0xc0ff('0x1e')],_0x4e8a36=_0x136b31[_0xc0ff('0x1f')],_0x21b852=_0x136b31[_0xc0ff('0x1f')]+_0x136b31['limit'],_0x5939e9;if(_0x21b852>=_0x265a63){_0x21b852=_0x265a63;_0x5939e9=0xc8;}else{_0x5939e9=0xce;}_0x33c72a[_0xc0ff('0x1b')](_0x5939e9);return _0x33c72a[_0xc0ff('0x20')](_0xc0ff('0x21'),_0x4e8a36+'-'+_0x21b852+'/'+_0x265a63)[_0xc0ff('0x1d')](_0x11014a);}return null;};}function patchUpdates(_0x362db7){return function(_0x1fd7ad){try{jsonpatch[_0xc0ff('0x22')](_0x1fd7ad,_0x362db7,!![]);}catch(_0x23b2a0){return BPromise[_0xc0ff('0x23')](_0x23b2a0);}return _0x1fd7ad[_0xc0ff('0x24')]();};}function saveUpdates(_0x153850,_0x219be9){return function(_0xee982d){if(_0xee982d){return _0xee982d[_0xc0ff('0x25')](_0x153850)[_0xc0ff('0x26')](function(_0x26ce8a){return _0x26ce8a;});}return null;};}function removeEntity(_0x5ce43e,_0x4200d4){return function(_0x5ba2c3){if(_0x5ba2c3){return _0x5ba2c3[_0xc0ff('0x27')]()[_0xc0ff('0x26')](function(){var _0x421924=_0x5ba2c3[_0xc0ff('0x28')]({'plain':!![]});var _0x25f8a0=_0xc0ff('0x29');return db['UserProfileResource'][_0xc0ff('0x27')]({'where':{'type':_0x25f8a0,'resourceId':_0x421924['id']}})[_0xc0ff('0x26')](function(){return _0x5ba2c3;});})['then'](function(){_0x5ce43e['status'](0xcc)[_0xc0ff('0x1c')]();});}};}function handleEntityNotFound(_0x1ea3a9,_0x2509ce){return function(_0x1b0fe2){if(!_0x1b0fe2){_0x1ea3a9[_0xc0ff('0x2a')](0x194);}return _0x1b0fe2;};}function handleError(_0xd0115e,_0x3d5699){_0x3d5699=_0x3d5699||0x1f4;return function(_0xed7156){logger[_0xc0ff('0x2b')](_0xed7156['stack']);if(_0xed7156['name']){delete _0xed7156['name'];}_0xd0115e[_0xc0ff('0x1b')](_0x3d5699)[_0xc0ff('0x2c')](_0xed7156);};}exports[_0xc0ff('0x2d')]=function(_0xf60f5a,_0x5c17ff){var _0x773814={},_0x1cd2d4={},_0x327822={'count':0x0,'rows':[]};var _0x22c943=_[_0xc0ff('0x2e')](db[_0xc0ff('0x2f')][_0xc0ff('0x30')],function(_0xb99550){return{'name':_0xb99550['fieldName'],'type':_0xb99550[_0xc0ff('0x31')]['key']};});_0x1cd2d4['model']=_[_0xc0ff('0x2e')](_0x22c943,_0xc0ff('0x32'));_0x1cd2d4['query']=_[_0xc0ff('0x33')](_0xf60f5a[_0xc0ff('0x34')]);_0x1cd2d4[_0xc0ff('0x35')]=_[_0xc0ff('0x36')](_0x1cd2d4[_0xc0ff('0x37')],_0x1cd2d4[_0xc0ff('0x34')]);_0x773814[_0xc0ff('0x38')]=_['intersection'](_0x1cd2d4[_0xc0ff('0x37')],qs[_0xc0ff('0x39')](_0xf60f5a['query'][_0xc0ff('0x39')]));_0x773814[_0xc0ff('0x38')]=_0x773814[_0xc0ff('0x38')][_0xc0ff('0x3a')]?_0x773814[_0xc0ff('0x38')]:_0x1cd2d4['model'];if(!_0xf60f5a['query']['hasOwnProperty'](_0xc0ff('0x3b'))){_0x773814[_0xc0ff('0x3c')]=qs[_0xc0ff('0x3c')](_0xf60f5a[_0xc0ff('0x34')][_0xc0ff('0x3c')]);_0x773814['offset']=qs[_0xc0ff('0x1f')](_0xf60f5a['query']['offset']);}_0x773814[_0xc0ff('0x3d')]=qs[_0xc0ff('0x3e')](_0xf60f5a['query'][_0xc0ff('0x3e')]);_0x773814['where']=qs[_0xc0ff('0x35')](_[_0xc0ff('0x3f')](_0xf60f5a[_0xc0ff('0x34')],_0x1cd2d4[_0xc0ff('0x35')]));if(_0xf60f5a[_0xc0ff('0x34')][_0xc0ff('0x40')]){_0x773814['where']=_['merge'](_0x773814['where'],{'$or':_[_0xc0ff('0x2e')](_0x22c943,function(_0x135014){if(_0x135014[_0xc0ff('0x31')]!==_0xc0ff('0x41')){var _0x39e678={};_0x39e678[_0x135014['name']]={'$like':'%'+_0xf60f5a[_0xc0ff('0x34')][_0xc0ff('0x40')]+'%'};return _0x39e678;}})});}_0x773814=_[_0xc0ff('0x42')]({},_0x773814,_0xf60f5a[_0xc0ff('0x43')]);var _0x294bf3={'where':_0x773814[_0xc0ff('0x44')]};return db[_0xc0ff('0x2f')][_0xc0ff('0x1e')](_0x294bf3)[_0xc0ff('0x26')](function(_0x2e5c8b){_0x327822[_0xc0ff('0x1e')]=_0x2e5c8b;if(_0xf60f5a[_0xc0ff('0x34')][_0xc0ff('0x45')]){_0x773814[_0xc0ff('0x46')]=[{'all':!![]}];}return db[_0xc0ff('0x2f')]['findAll'](_0x773814);})[_0xc0ff('0x26')](function(_0x3e9336){_0x327822['rows']=_0x3e9336;return _0x327822;})[_0xc0ff('0x26')](respondWithFilteredResult(_0x5c17ff,_0x773814))[_0xc0ff('0x47')](handleError(_0x5c17ff,null));};exports[_0xc0ff('0x48')]=function(_0x1bd6a1,_0x3bc88d){var _0x125335={'raw':!![],'where':{'id':_0x1bd6a1['params']['id']}},_0x31e6cb={};_0x31e6cb[_0xc0ff('0x37')]=_[_0xc0ff('0x33')](db[_0xc0ff('0x2f')][_0xc0ff('0x30')]);_0x31e6cb[_0xc0ff('0x34')]=_[_0xc0ff('0x33')](_0x1bd6a1['query']);_0x31e6cb[_0xc0ff('0x35')]=_[_0xc0ff('0x36')](_0x31e6cb[_0xc0ff('0x37')],_0x31e6cb[_0xc0ff('0x34')]);_0x125335[_0xc0ff('0x38')]=_[_0xc0ff('0x36')](_0x31e6cb[_0xc0ff('0x37')],qs[_0xc0ff('0x39')](_0x1bd6a1[_0xc0ff('0x34')][_0xc0ff('0x39')]));_0x125335[_0xc0ff('0x38')]=_0x125335[_0xc0ff('0x38')][_0xc0ff('0x3a')]?_0x125335[_0xc0ff('0x38')]:_0x31e6cb[_0xc0ff('0x37')];if(_0x1bd6a1['query'][_0xc0ff('0x45')]){_0x125335[_0xc0ff('0x46')]=[{'all':!![]}];}_0x125335=_['merge']({},_0x125335,_0x1bd6a1[_0xc0ff('0x43')]);return db[_0xc0ff('0x2f')][_0xc0ff('0x49')](_0x125335)[_0xc0ff('0x26')](handleEntityNotFound(_0x3bc88d,null))[_0xc0ff('0x26')](respondWithResult(_0x3bc88d,null))['catch'](handleError(_0x3bc88d,null));};exports[_0xc0ff('0x4a')]=function(_0xf67716,_0x4cf99e){return db[_0xc0ff('0x2f')]['create'](_0xf67716[_0xc0ff('0x4b')],{})['then'](function(_0x3eca5e){var _0x3d9159=_0xf67716['user'][_0xc0ff('0x28')]({'plain':!![]});if(!_0x3d9159)throw new Error(_0xc0ff('0x4c'));if(_0x3d9159[_0xc0ff('0x4d')]===_0xc0ff('0x4e')){var _0x436ef2=_0x3eca5e['get']({'plain':!![]});var _0x196e46=_0xc0ff('0x29');return db['UserProfileSection'][_0xc0ff('0x49')]({'where':{'name':_0x196e46,'userProfileId':_0x3d9159[_0xc0ff('0x4f')]},'raw':!![]})[_0xc0ff('0x26')](function(_0x49a00f){if(_0x49a00f&&_0x49a00f[_0xc0ff('0x50')]===0x0){return db['UserProfileResource'][_0xc0ff('0x4a')]({'name':_0x436ef2[_0xc0ff('0x32')],'resourceId':_0x436ef2['id'],'type':_0x49a00f[_0xc0ff('0x32')],'sectionId':_0x49a00f['id']},{})[_0xc0ff('0x26')](function(){return _0x3eca5e;});}else{return _0x3eca5e;}})[_0xc0ff('0x47')](function(_0x1a186f){logger[_0xc0ff('0x2b')](_0xc0ff('0x51'),_0x1a186f);throw _0x1a186f;});}return _0x3eca5e;})[_0xc0ff('0x26')](respondWithResult(_0x4cf99e,0xc9))[_0xc0ff('0x47')](handleError(_0x4cf99e,null));};exports[_0xc0ff('0x25')]=function(_0x3b7825,_0x210ffb){if(_0x3b7825[_0xc0ff('0x4b')]['id']){delete _0x3b7825['body']['id'];}return db[_0xc0ff('0x2f')][_0xc0ff('0x49')]({'where':{'id':_0x3b7825[_0xc0ff('0x52')]['id']}})[_0xc0ff('0x26')](handleEntityNotFound(_0x210ffb,null))[_0xc0ff('0x26')](saveUpdates(_0x3b7825['body'],null))[_0xc0ff('0x26')](respondWithResult(_0x210ffb,null))[_0xc0ff('0x47')](handleError(_0x210ffb,null));};exports[_0xc0ff('0x27')]=function(_0x2be1cc,_0x350665){return db[_0xc0ff('0x2f')]['find']({'where':{'id':_0x2be1cc['params']['id']}})[_0xc0ff('0x26')](handleEntityNotFound(_0x350665,null))[_0xc0ff('0x26')](removeEntity(_0x350665,null))[_0xc0ff('0x47')](handleError(_0x350665,null));};exports[_0xc0ff('0x53')]=function(_0x51f38e,_0x27a18d){return db['FaxQueue'][_0xc0ff('0x53')]()[_0xc0ff('0x26')](respondWithResult(_0x27a18d,null))[_0xc0ff('0x47')](handleError(_0x27a18d,null));};exports[_0xc0ff('0x54')]=function(_0x22be6c,_0x568de9,_0x16cfa6){var _0x43c2f7={'raw':!![],'where':{}},_0x2f8122={},_0x2ab795;return db[_0xc0ff('0x2f')]['findOne']({'where':{'id':_0x22be6c[_0xc0ff('0x52')]['id']}})[_0xc0ff('0x26')](handleEntityNotFound(_0x568de9,null))['then'](function(_0x2cda14){if(_0x2cda14){_0x2ab795=_0x2cda14['get']({'plain':!![]});_0x2f8122[_0xc0ff('0x37')]=_[_0xc0ff('0x33')](db[_0xc0ff('0x55')][_0xc0ff('0x30')]);_0x2f8122[_0xc0ff('0x34')]=_[_0xc0ff('0x33')](_0x22be6c[_0xc0ff('0x34')]);_0x2f8122[_0xc0ff('0x35')]=_[_0xc0ff('0x36')](_0x2f8122[_0xc0ff('0x37')],_0x2f8122['query']);_0x43c2f7['attributes']=_[_0xc0ff('0x36')](_0x2f8122['model'],qs[_0xc0ff('0x39')](_0x22be6c[_0xc0ff('0x34')][_0xc0ff('0x39')]));_0x43c2f7[_0xc0ff('0x38')]=_0x43c2f7[_0xc0ff('0x38')][_0xc0ff('0x3a')]?_0x43c2f7[_0xc0ff('0x38')]:_0x2f8122['model'];if(!_0x22be6c['query'][_0xc0ff('0x56')]('nolimit')){_0x43c2f7[_0xc0ff('0x3c')]=qs[_0xc0ff('0x3c')](_0x22be6c['query'][_0xc0ff('0x3c')]);_0x43c2f7[_0xc0ff('0x1f')]=qs['offset'](_0x22be6c[_0xc0ff('0x34')][_0xc0ff('0x1f')]);}_0x43c2f7[_0xc0ff('0x3d')]=qs[_0xc0ff('0x3e')](_0x22be6c[_0xc0ff('0x34')]['sort']);_0x43c2f7['where']=qs[_0xc0ff('0x35')](_[_0xc0ff('0x3f')](_0x22be6c[_0xc0ff('0x34')],_0x2f8122[_0xc0ff('0x35')]));_0x43c2f7[_0xc0ff('0x44')][_0xc0ff('0x57')]=_0x2cda14['id'];if(_0x22be6c[_0xc0ff('0x34')][_0xc0ff('0x40')]){_0x43c2f7[_0xc0ff('0x44')]=_[_0xc0ff('0x42')](_0x43c2f7[_0xc0ff('0x44')],{'$or':_[_0xc0ff('0x2e')](_0x43c2f7['attributes'],function(_0x5261fc){var _0x1ecb4b={};_0x1ecb4b[_0x5261fc]={'$like':'%'+_0x22be6c[_0xc0ff('0x34')]['filter']+'%'};return _0x1ecb4b;})});}_0x43c2f7=_['merge']({},_0x43c2f7,_0x22be6c[_0xc0ff('0x43')]);return db[_0xc0ff('0x55')][_0xc0ff('0x58')](_0x43c2f7);}})[_0xc0ff('0x26')](function(_0x297dbe){if(_0x297dbe){return db[_0xc0ff('0x59')][_0xc0ff('0x5a')]({'where':{'id':_[_0xc0ff('0x2e')](_0x297dbe,_0xc0ff('0x5b')),'role':_0xc0ff('0x5c')},'attributes':['id','name',_0xc0ff('0x5d'),_0xc0ff('0x5e'),'createdAt']});}})[_0xc0ff('0x26')](function(_0x3c78f9){if(_0x3c78f9){return{'count':_0x3c78f9[_0xc0ff('0x1e')],'rows':_[_0xc0ff('0x2e')](_0x3c78f9[_0xc0ff('0x5f')],function(_0x5a359b){return{'membername':_0x5a359b['name'],'UserId':_0x5a359b['id'],'queue_name':_0x2ab795[_0xc0ff('0x32')],'FaxQueueId':_0x2ab795['id'],'interface':util['format'](_0xc0ff('0x60'),_0xc0ff('0x61'),_0x5a359b[_0xc0ff('0x32')]),'penalty':0x0,'paused':_0x5a359b[_0xc0ff('0x5d')],'createdAt':_0x5a359b[_0xc0ff('0x62')],'updatedAt':_0x5a359b['updatedAt']};})};}else{return{'count':0x0,'rows':[]};}})['then'](respondWithFilteredResult(_0x568de9,_0x43c2f7))[_0xc0ff('0x47')](handleError(_0x568de9,null));};exports[_0xc0ff('0x63')]=function(_0x5c3bac,_0x48df87,_0x344a23){var _0x39bd8f={};var _0xfa4855={};var _0x428d01;var _0x25a162;return db[_0xc0ff('0x2f')][_0xc0ff('0x64')]({'where':{'id':_0x5c3bac[_0xc0ff('0x52')]['id']}})[_0xc0ff('0x26')](handleEntityNotFound(_0x48df87,null))[_0xc0ff('0x26')](function(_0x1f799c){if(_0x1f799c){_0x428d01=_0x1f799c;_0xfa4855[_0xc0ff('0x37')]=_[_0xc0ff('0x33')](db['Team'][_0xc0ff('0x30')]);_0xfa4855[_0xc0ff('0x34')]=_[_0xc0ff('0x33')](_0x5c3bac['query']);_0xfa4855[_0xc0ff('0x35')]=_['intersection'](_0xfa4855[_0xc0ff('0x37')],_0xfa4855['query']);_0x39bd8f[_0xc0ff('0x38')]=_[_0xc0ff('0x36')](_0xfa4855[_0xc0ff('0x37')],qs['fields'](_0x5c3bac[_0xc0ff('0x34')][_0xc0ff('0x39')]));_0x39bd8f['attributes']=_0x39bd8f[_0xc0ff('0x38')]['length']?_0x39bd8f[_0xc0ff('0x38')]:_0xfa4855['model'];_0x39bd8f['order']=qs[_0xc0ff('0x3e')](_0x5c3bac[_0xc0ff('0x34')]['sort']);_0x39bd8f[_0xc0ff('0x44')]=qs[_0xc0ff('0x35')](_['pick'](_0x5c3bac[_0xc0ff('0x34')],_0xfa4855['filters']));if(_0x5c3bac[_0xc0ff('0x34')][_0xc0ff('0x40')]){_0x39bd8f['where']=_[_0xc0ff('0x42')](_0x39bd8f['where'],{'$or':_[_0xc0ff('0x2e')](_0x39bd8f['attributes'],function(_0x288ba5){var _0x20da33={};_0x20da33[_0x288ba5]={'$like':'%'+_0x5c3bac[_0xc0ff('0x34')][_0xc0ff('0x40')]+'%'};return _0x20da33;})});}_0x39bd8f=_[_0xc0ff('0x42')]({},_0x39bd8f,_0x5c3bac['options']);return _0x428d01[_0xc0ff('0x63')](_0x39bd8f);}})['then'](function(_0x72d3b0){if(_0x72d3b0){_0x25a162=_0x72d3b0['length'];if(!_0x5c3bac[_0xc0ff('0x34')][_0xc0ff('0x56')](_0xc0ff('0x3b'))){_0x39bd8f[_0xc0ff('0x3c')]=qs[_0xc0ff('0x3c')](_0x5c3bac[_0xc0ff('0x34')][_0xc0ff('0x3c')]);_0x39bd8f[_0xc0ff('0x1f')]=qs[_0xc0ff('0x1f')](_0x5c3bac[_0xc0ff('0x34')][_0xc0ff('0x1f')]);}return _0x428d01[_0xc0ff('0x63')](_0x39bd8f);}})[_0xc0ff('0x26')](function(_0x2f5e67){if(_0x2f5e67){return _0x2f5e67?{'count':_0x25a162,'rows':_0x2f5e67}:null;}})['then'](respondWithResult(_0x48df87,null))[_0xc0ff('0x47')](handleError(_0x48df87,null));};exports[_0xc0ff('0x65')]=function(_0x52e581,_0x2bd936,_0x3804eb){var _0x3f78d6=_0x52e581[_0xc0ff('0x4b')][_0xc0ff('0x66')];return db[_0xc0ff('0x67')]['findAll']({'where':{'id':_0x3f78d6},'attributes':['id'],'include':[{'model':db[_0xc0ff('0x59')],'as':_0xc0ff('0x68'),'attributes':['id',_0xc0ff('0x32'),'online',_0xc0ff('0x69'),'interface'],'raw':!![]}]})[_0xc0ff('0x26')](function(_0x4e302c){if(_0x4e302c){var _0x2ca0cc=_['flatMap'](_0x4e302c,function(_0x238e4a){var _0x4031d9=_0x238e4a['get']({'plain':!![]});return _0x4031d9[_0xc0ff('0x68')];});return db[_0xc0ff('0x2f')][_0xc0ff('0x49')]({'where':{'id':_0x52e581[_0xc0ff('0x52')]['id']}})[_0xc0ff('0x26')](function(_0x3e11e2){return db['sequelize'][_0xc0ff('0x6a')](function(_0x1d39c4){return _0x3e11e2[_0xc0ff('0x65')](_0x3f78d6,{'transaction':_0x1d39c4})[_0xc0ff('0x26')](function(){return BPromise[_0xc0ff('0x6b')](_0x2ca0cc,function(_0x474683){return db[_0xc0ff('0x55')][_0xc0ff('0x6c')]({'where':{'UserId':_0x474683['id'],'FaxQueueId':_0x52e581['params']['id']},'transaction':_0x1d39c4});});})[_0xc0ff('0x26')](function(){_0x2ca0cc[_0xc0ff('0x6d')](function(_0x5dbd4f){socket['emit']('userFaxQueue:save',{'UserId':_0x5dbd4f['id'],'FaxQueueId':_0x3e11e2['id']});});});});});}})[_0xc0ff('0x26')](respondWithStatusCode(_0x2bd936,null))[_0xc0ff('0x47')](handleError(_0x2bd936,null));};exports[_0xc0ff('0x6e')]=function(_0x302850,_0x4e3543,_0x41dfe6){return db[_0xc0ff('0x67')][_0xc0ff('0x58')]({'where':{'id':_0x302850[_0xc0ff('0x34')][_0xc0ff('0x66')]},'attributes':['id'],'include':[{'model':db[_0xc0ff('0x59')],'as':_0xc0ff('0x68'),'attributes':['id'],'raw':!![]}]})[_0xc0ff('0x26')](handleEntityNotFound(_0x4e3543,null))[_0xc0ff('0x26')](function(_0xa7e379){var _0x556546=_['map'](_0xa7e379,'id');var _0x4fa9ca=[];var _0x85ddb7=[];var _0x59d9da=squel[_0xc0ff('0x6f')]();_0x59d9da[_0xc0ff('0x70')](_0xc0ff('0x71'))[_0xc0ff('0x72')](_0xc0ff('0x73'),'tq')[_0xc0ff('0x74')](_0xc0ff('0x75'),'ut','ut.TeamId\x20=\x20tq.TeamId')['where'](_0xc0ff('0x76'),_0x302850['params']['id']);for(var _0x1f1658=0x0;_0x1f1658<_0xa7e379['length'];_0x1f1658+=0x1){let _0x20d27b=_0xa7e379[_0x1f1658];for(var _0x341871=0x0;_0x341871<_0x20d27b[_0xc0ff('0x68')][_0xc0ff('0x3a')];_0x341871+=0x1){let _0x11824c=_0x20d27b[_0xc0ff('0x68')][_0x341871];var _0x1d6e1d=_0x59d9da[_0xc0ff('0x77')]();_0x1d6e1d[_0xc0ff('0x44')](_0xc0ff('0x78'),_0x11824c['id']);_0x85ddb7[_0xc0ff('0x79')](db['sequelize'][_0xc0ff('0x34')](_0x1d6e1d[_0xc0ff('0x7a')](),{'type':db[_0xc0ff('0x7b')]['QueryTypes'][_0xc0ff('0x7c')]})[_0xc0ff('0x26')](function(_0x21a656){if(_0x21a656[_0xc0ff('0x3a')]===0x1){return _0x11824c['id'];}else{var _0x1f20a1=_[_0xc0ff('0x7d')](_[_0xc0ff('0x2e')](_0x21a656,_0xc0ff('0x7e')),function(_0x1a66e9){return _[_0xc0ff('0x7f')](_0x556546,_0x1a66e9);});if(_0x1f20a1){return _0x11824c['id'];}}}));}}return BPromise[_0xc0ff('0x80')](_0x85ddb7)['then'](function(_0x2fad96){_0x4fa9ca=_(_0x4fa9ca)[_0xc0ff('0x81')](_0x2fad96)[_0xc0ff('0x82')]()[_0xc0ff('0x83')]();return db['FaxQueue'][_0xc0ff('0x49')]({'where':{'id':_0x302850['params']['id']}})['then'](function(_0x2a64eb){return db[_0xc0ff('0x7b')][_0xc0ff('0x6a')](function(_0x1665b3){return _0x2a64eb['removeTeams'](_0x302850[_0xc0ff('0x34')]['ids'],{'transaction':_0x1665b3})[_0xc0ff('0x26')](function(){if(!_[_0xc0ff('0x84')](_0x4fa9ca)){return _0x2a64eb[_0xc0ff('0x85')](_0x4fa9ca,{'transaction':_0x1665b3});}})[_0xc0ff('0x26')](function(){_0x4fa9ca['forEach'](function(_0x50616d){socket[_0xc0ff('0x86')]('userFaxQueue:remove',{'UserId':_0x50616d,'FaxQueueId':_0x2a64eb['id']});});});});});});})[_0xc0ff('0x26')](respondWithStatusCode(_0x4e3543,null))[_0xc0ff('0x47')](handleError(_0x4e3543,null));};exports[_0xc0ff('0x87')]=function(_0x331950,_0x2e357c,_0x3c3e43){return db[_0xc0ff('0x2f')][_0xc0ff('0x49')]({'where':{'id':_0x331950[_0xc0ff('0x52')]['id']}})[_0xc0ff('0x26')](handleEntityNotFound(_0x2e357c,null))[_0xc0ff('0x26')](function(_0x1d5b86){if(_0x1d5b86){return _0x1d5b86['addAgents'](_0x331950[_0xc0ff('0x4b')][_0xc0ff('0x66')],_['omit'](_0x331950[_0xc0ff('0x4b')],[_0xc0ff('0x66'),'id'])||{})[_0xc0ff('0x88')](function(_0x5bf4b7){for(var _0x1aaed4=0x0;_0x1aaed4<_0x331950[_0xc0ff('0x4b')][_0xc0ff('0x66')]['length'];_0x1aaed4+=0x1){socket[_0xc0ff('0x86')](_0xc0ff('0x89'),{'UserId':_0x331950[_0xc0ff('0x4b')][_0xc0ff('0x66')][_0x1aaed4],'FaxQueueId':_0x331950['params']['id']});}return _0x5bf4b7;});}})[_0xc0ff('0x26')](respondWithResult(_0x2e357c,null))[_0xc0ff('0x47')](handleError(_0x2e357c,null));};exports[_0xc0ff('0x85')]=function(_0xe309f4,_0x2b36dd,_0x408a51){return db[_0xc0ff('0x2f')][_0xc0ff('0x49')]({'where':{'id':_0xe309f4[_0xc0ff('0x52')]['id']}})[_0xc0ff('0x26')](handleEntityNotFound(_0x2b36dd,null))[_0xc0ff('0x26')](function(_0x1da5c1){if(_0x1da5c1){return _0x1da5c1[_0xc0ff('0x85')](_0xe309f4[_0xc0ff('0x34')][_0xc0ff('0x66')])[_0xc0ff('0x26')](function(){if(_['isArray'](_0xe309f4[_0xc0ff('0x34')]['ids'])){for(var _0x50c780=0x0;_0x50c780<_0xe309f4[_0xc0ff('0x34')][_0xc0ff('0x66')][_0xc0ff('0x3a')];_0x50c780+=0x1){socket[_0xc0ff('0x86')]('userFaxQueue:remove',{'UserId':Number(_0xe309f4[_0xc0ff('0x34')][_0xc0ff('0x66')][_0x50c780]),'FaxQueueId':Number(_0xe309f4[_0xc0ff('0x52')]['id'])});}}else{socket[_0xc0ff('0x86')](_0xc0ff('0x8a'),{'UserId':Number(_0xe309f4[_0xc0ff('0x34')][_0xc0ff('0x66')]),'FaxQueueId':Number(_0xe309f4['params']['id'])});}});}})[_0xc0ff('0x26')](respondWithStatusCode(_0x2b36dd,null))[_0xc0ff('0x47')](handleError(_0x2b36dd,null));};exports[_0xc0ff('0x8b')]=function(_0x27853f,_0x2d3332,_0x28dc94){var _0x45bb15={};var _0x4723ac={};var _0x448a6e;var _0x336ab9;return db[_0xc0ff('0x2f')][_0xc0ff('0x64')]({'where':{'id':_0x27853f[_0xc0ff('0x52')]['id']}})[_0xc0ff('0x26')](handleEntityNotFound(_0x2d3332,null))[_0xc0ff('0x26')](function(_0x2b2cf7){if(_0x2b2cf7){_0x448a6e=_0x2b2cf7;_0x4723ac['model']=_['keys'](db['User'][_0xc0ff('0x30')]);_0x4723ac[_0xc0ff('0x34')]=_[_0xc0ff('0x33')](_0x27853f[_0xc0ff('0x34')]);_0x4723ac[_0xc0ff('0x35')]=_[_0xc0ff('0x36')](_0x4723ac[_0xc0ff('0x37')],_0x4723ac['query']);_0x45bb15[_0xc0ff('0x38')]=_['intersection'](_0x4723ac['model'],qs[_0xc0ff('0x39')](_0x27853f[_0xc0ff('0x34')]['fields']));_0x45bb15['attributes']=_0x45bb15['attributes'][_0xc0ff('0x3a')]?_0x45bb15[_0xc0ff('0x38')]:_0x4723ac[_0xc0ff('0x37')];_0x45bb15['order']=qs[_0xc0ff('0x3e')](_0x27853f[_0xc0ff('0x34')][_0xc0ff('0x3e')]);_0x45bb15[_0xc0ff('0x44')]=qs[_0xc0ff('0x35')](_[_0xc0ff('0x3f')](_0x27853f[_0xc0ff('0x34')],_0x4723ac[_0xc0ff('0x35')]));if(_0x27853f['query'][_0xc0ff('0x40')]){_0x45bb15['where']=_['merge'](_0x45bb15[_0xc0ff('0x44')],{'$or':_['map'](_0x45bb15[_0xc0ff('0x38')],function(_0x3b2fab){var _0x31874a={};_0x31874a[_0x3b2fab]={'$like':'%'+_0x27853f[_0xc0ff('0x34')][_0xc0ff('0x40')]+'%'};return _0x31874a;})});}_0x45bb15=_[_0xc0ff('0x42')]({},_0x45bb15,_0x27853f[_0xc0ff('0x43')]);return _0x448a6e['getAgents'](_0x45bb15);}})[_0xc0ff('0x26')](function(_0x412c0c){if(_0x412c0c){_0x336ab9=_0x412c0c[_0xc0ff('0x3a')];if(!_0x27853f['query']['hasOwnProperty'](_0xc0ff('0x3b'))){_0x45bb15[_0xc0ff('0x3c')]=qs[_0xc0ff('0x3c')](_0x27853f[_0xc0ff('0x34')]['limit']);_0x45bb15[_0xc0ff('0x1f')]=qs[_0xc0ff('0x1f')](_0x27853f[_0xc0ff('0x34')][_0xc0ff('0x1f')]);}return _0x448a6e[_0xc0ff('0x8b')](_0x45bb15);}})[_0xc0ff('0x26')](function(_0xa9fe39){if(_0xa9fe39){return _0xa9fe39?{'count':_0x336ab9,'rows':_0xa9fe39}:null;}})[_0xc0ff('0x26')](respondWithResult(_0x2d3332,null))[_0xc0ff('0x47')](handleError(_0x2d3332,null));};
\ No newline at end of file
diff --git a/server/api/faxQueue/faxQueue.events.js b/server/api/faxQueue/faxQueue.events.js
index 390a153..8320c48 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 _0x71f2=['hook','exports','events','../../mysqldb','FaxQueue','setMaxListeners','update','remove','emit','hasOwnProperty'];(function(_0x13ff34,_0x513f24){var _0x43ca5c=function(_0x168b24){while(--_0x168b24){_0x13ff34['push'](_0x13ff34['shift']());}};_0x43ca5c(++_0x513f24);}(_0x71f2,0x7a));var _0x271f=function(_0xf8203c,_0xcd768f){_0xf8203c=_0xf8203c-0x0;var _0x876d83=_0x71f2[_0xf8203c];return _0x876d83;};'use strict';var EventEmitter=require(_0x271f('0x0'));var FaxQueue=require(_0x271f('0x1'))['db'][_0x271f('0x2')];var FaxQueueEvents=new EventEmitter();FaxQueueEvents[_0x271f('0x3')](0x0);var events={'afterCreate':'save','afterUpdate':_0x271f('0x4'),'afterDestroy':_0x271f('0x5')};function emitEvent(_0x106222){return function(_0x3c6b6f,_0x51e41b,_0x536d44){FaxQueueEvents[_0x271f('0x6')](_0x106222+':'+_0x3c6b6f['id'],_0x3c6b6f);FaxQueueEvents[_0x271f('0x6')](_0x106222,_0x3c6b6f);_0x536d44(null);};}for(var e in events){if(events[_0x271f('0x7')](e)){var event=events[e];FaxQueue[_0x271f('0x8')](e,emitEvent(event));}}module[_0x271f('0x9')]=FaxQueueEvents;
\ No newline at end of file
+var _0xd9f6=['setMaxListeners','save','update','remove','emit','hasOwnProperty','hook','exports','events','../../mysqldb'];(function(_0x16f5e2,_0x471271){var _0x495237=function(_0x5ceef2){while(--_0x5ceef2){_0x16f5e2['push'](_0x16f5e2['shift']());}};_0x495237(++_0x471271);}(_0xd9f6,0xee));var _0x6d9f=function(_0x467904,_0x200a6a){_0x467904=_0x467904-0x0;var _0x4613ec=_0xd9f6[_0x467904];return _0x4613ec;};'use strict';var EventEmitter=require(_0x6d9f('0x0'));var FaxQueue=require(_0x6d9f('0x1'))['db']['FaxQueue'];var FaxQueueEvents=new EventEmitter();FaxQueueEvents[_0x6d9f('0x2')](0x0);var events={'afterCreate':_0x6d9f('0x3'),'afterUpdate':_0x6d9f('0x4'),'afterDestroy':_0x6d9f('0x5')};function emitEvent(_0xa96f96){return function(_0x7cf204,_0xc11ffb,_0x1e315f){FaxQueueEvents[_0x6d9f('0x6')](_0xa96f96+':'+_0x7cf204['id'],_0x7cf204);FaxQueueEvents[_0x6d9f('0x6')](_0xa96f96,_0x7cf204);_0x1e315f(null);};}for(var e in events){if(events[_0x6d9f('0x7')](e)){var event=events[e];FaxQueue[_0x6d9f('0x8')](e,emitEvent(event));}}module[_0x6d9f('0x9')]=FaxQueueEvents;
\ No newline at end of file
diff --git a/server/api/faxQueue/faxQueue.model.js b/server/api/faxQueue/faxQueue.model.js
index 2d50d31..72d9bbb 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 _0x8a9f=['../../config/environment','exports','define','FaxQueue','fax_queues','../../config/logger','api','moment','request-promise'];(function(_0x5499f5,_0x5390f0){var _0x7df527=function(_0x53be66){while(--_0x53be66){_0x5499f5['push'](_0x5499f5['shift']());}};_0x7df527(++_0x5390f0);}(_0x8a9f,0xa7));var _0xf8a9=function(_0x36a0a4,_0x7178d6){_0x36a0a4=_0x36a0a4-0x0;var _0x32d0b6=_0x8a9f[_0x36a0a4];return _0x32d0b6;};'use strict';var _=require('lodash');var util=require('util');var logger=require(_0xf8a9('0x0'))(_0xf8a9('0x1'));var moment=require(_0xf8a9('0x2'));var BPromise=require('bluebird');var rp=require(_0xf8a9('0x3'));var fs=require('fs');var path=require('path');var rimraf=require('rimraf');var config=require(_0xf8a9('0x4'));var attributes=require('./faxQueue.attributes');module[_0xf8a9('0x5')]=function(_0x102bc6,_0xbe662a){return _0x102bc6[_0xf8a9('0x6')](_0xf8a9('0x7'),attributes,{'tableName':_0xf8a9('0x8'),'paranoid':![],'indexes':[],'timestamps':!![]});};
\ No newline at end of file
+var _0x5666=['api','moment','bluebird','path','../../config/environment','./faxQueue.attributes','exports','define','FaxQueue','fax_queues','util','../../config/logger'];(function(_0x58da69,_0x4d73d6){var _0x1e3e9d=function(_0x202b1a){while(--_0x202b1a){_0x58da69['push'](_0x58da69['shift']());}};_0x1e3e9d(++_0x4d73d6);}(_0x5666,0xa6));var _0x6566=function(_0x2c1959,_0x4faa73){_0x2c1959=_0x2c1959-0x0;var _0x1d05b9=_0x5666[_0x2c1959];return _0x1d05b9;};'use strict';var _=require('lodash');var util=require(_0x6566('0x0'));var logger=require(_0x6566('0x1'))(_0x6566('0x2'));var moment=require(_0x6566('0x3'));var BPromise=require(_0x6566('0x4'));var rp=require('request-promise');var fs=require('fs');var path=require(_0x6566('0x5'));var rimraf=require('rimraf');var config=require(_0x6566('0x6'));var attributes=require(_0x6566('0x7'));module[_0x6566('0x8')]=function(_0xdcf41a,_0x3a0d81){return _0xdcf41a[_0x6566('0x9')](_0x6566('0xa'),attributes,{'tableName':_0x6566('0xb'),'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 b9bc0f7..ddd3617 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 _0x4ab5=['defaults','localhost','socket.io-emitter','./faxQueue.socket','register','request','then','info','FaxQueue,\x20%s,\x20%s','request\x20sent','debug','FaxQueue,\x20%s,\x20%s,\x20%s','stringify','error','message','FaxQueue','findAll','options','raw','where','limit','include','map','model','attributes','GetFaxQueue','ShowFaxQueue','lodash','util','moment','bluebird','../../config/logger','../../config/environment','jayson/promise','client','http','redis'];(function(_0x2a146e,_0x1b58d7){var _0xa3bdcf=function(_0x43c26d){while(--_0x43c26d){_0x2a146e['push'](_0x2a146e['shift']());}};_0xa3bdcf(++_0x1b58d7);}(_0x4ab5,0x18d));var _0x54ab=function(_0x4fc476,_0xb7cdfd){_0x4fc476=_0x4fc476-0x0;var _0x2de7d8=_0x4ab5[_0x4fc476];return _0x2de7d8;};'use strict';var _=require(_0x54ab('0x0'));var util=require(_0x54ab('0x1'));var moment=require(_0x54ab('0x2'));var BPromise=require(_0x54ab('0x3'));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(_0x54ab('0x4'))('rpc');var config=require(_0x54ab('0x5'));var jayson=require(_0x54ab('0x6'));var client=jayson[_0x54ab('0x7')][_0x54ab('0x8')]({'port':0x232a});config[_0x54ab('0x9')]=_[_0x54ab('0xa')](config[_0x54ab('0x9')],{'host':_0x54ab('0xb'),'port':0x18eb});var socket=require(_0x54ab('0xc'))(new Redis(config['redis']));require(_0x54ab('0xd'))[_0x54ab('0xe')](socket);function respondWithRpcPromise(_0x4c9e49,_0x354914,_0x52450f){return new BPromise(function(_0x2fa459,_0x199a70){return client[_0x54ab('0xf')](_0x4c9e49,_0x52450f)[_0x54ab('0x10')](function(_0x1739e0){logger[_0x54ab('0x11')](_0x54ab('0x12'),_0x354914,_0x54ab('0x13'));logger[_0x54ab('0x14')](_0x54ab('0x15'),_0x354914,_0x54ab('0x13'),JSON[_0x54ab('0x16')](_0x1739e0));if(_0x1739e0['error']){if(_0x1739e0[_0x54ab('0x17')]['code']===0x1f4){logger[_0x54ab('0x17')](_0x54ab('0x12'),_0x354914,_0x1739e0[_0x54ab('0x17')][_0x54ab('0x18')]);return _0x199a70(_0x1739e0['error']['message']);}logger[_0x54ab('0x17')](_0x54ab('0x12'),_0x354914,_0x1739e0[_0x54ab('0x17')]['message']);return _0x2fa459(_0x1739e0[_0x54ab('0x17')][_0x54ab('0x18')]);}else{logger[_0x54ab('0x11')]('FaxQueue,\x20%s,\x20%s',_0x354914,'request\x20sent');_0x2fa459(_0x1739e0['result'][_0x54ab('0x18')]);}})['catch'](function(_0x490edc){logger[_0x54ab('0x17')](_0x54ab('0x12'),_0x354914,_0x490edc);_0x199a70(_0x490edc);});});}exports['GetFaxQueue']=function(_0x2cb228){var _0x528855=this;return new Promise(function(_0x33ac56,_0x5381c2){return db[_0x54ab('0x19')][_0x54ab('0x1a')]({'raw':_0x2cb228['options']?_0x2cb228[_0x54ab('0x1b')][_0x54ab('0x1c')]===undefined?!![]:![]:!![],'where':_0x2cb228['options']?_0x2cb228[_0x54ab('0x1b')][_0x54ab('0x1d')]||null:null,'attributes':_0x2cb228['options']?_0x2cb228[_0x54ab('0x1b')]['attributes']||null:null,'limit':_0x2cb228[_0x54ab('0x1b')]?_0x2cb228[_0x54ab('0x1b')][_0x54ab('0x1e')]||null:null,'include':_0x2cb228['options']?_0x2cb228[_0x54ab('0x1b')][_0x54ab('0x1f')]?_[_0x54ab('0x20')](_0x2cb228[_0x54ab('0x1b')][_0x54ab('0x1f')],function(_0x5ed137){return{'model':db[_0x5ed137[_0x54ab('0x21')]],'as':_0x5ed137['as'],'attributes':_0x5ed137[_0x54ab('0x22')],'include':_0x5ed137[_0x54ab('0x1f')]?_[_0x54ab('0x20')](_0x5ed137[_0x54ab('0x1f')],function(_0x47c0e8){return{'model':db[_0x47c0e8['model']],'as':_0x47c0e8['as'],'attributes':_0x47c0e8['attributes'],'include':_0x47c0e8['include']?_[_0x54ab('0x20')](_0x47c0e8['include'],function(_0x2a070c){return{'model':db[_0x2a070c[_0x54ab('0x21')]],'as':_0x2a070c['as'],'attributes':_0x2a070c[_0x54ab('0x22')]};}):[]};}):[]};}):[]:[]})[_0x54ab('0x10')](function(_0x3007c3){logger[_0x54ab('0x11')](_0x54ab('0x23'),_0x2cb228);logger[_0x54ab('0x14')]('GetFaxQueue',_0x2cb228,JSON[_0x54ab('0x16')](_0x3007c3));_0x33ac56(_0x3007c3);})['catch'](function(_0x4d2b01){logger[_0x54ab('0x17')](_0x54ab('0x23'),_0x4d2b01[_0x54ab('0x18')],_0x2cb228);_0x5381c2(_0x528855[_0x54ab('0x17')](0x1f4,_0x4d2b01['message']));});});};exports[_0x54ab('0x24')]=function(_0x18330f){var _0x43f947=this;return new Promise(function(_0x3b0a28,_0x4be5bd){return db['FaxQueue']['find']({'raw':_0x18330f['options']?_0x18330f[_0x54ab('0x1b')]['raw']===undefined?!![]:![]:!![],'where':_0x18330f['options']?_0x18330f[_0x54ab('0x1b')][_0x54ab('0x1d')]||null:null,'attributes':_0x18330f[_0x54ab('0x1b')]?_0x18330f[_0x54ab('0x1b')][_0x54ab('0x22')]||null:null,'include':_0x18330f[_0x54ab('0x1b')]?_0x18330f['options']['include']?_[_0x54ab('0x20')](_0x18330f[_0x54ab('0x1b')][_0x54ab('0x1f')],function(_0x3534bc){return{'model':db[_0x3534bc[_0x54ab('0x21')]],'as':_0x3534bc['as'],'attributes':_0x3534bc[_0x54ab('0x22')],'include':_0x3534bc[_0x54ab('0x1f')]?_['map'](_0x3534bc['include'],function(_0x110e4c){return{'model':db[_0x110e4c[_0x54ab('0x21')]],'as':_0x110e4c['as'],'attributes':_0x110e4c[_0x54ab('0x22')],'include':_0x110e4c[_0x54ab('0x1f')]?_[_0x54ab('0x20')](_0x110e4c[_0x54ab('0x1f')],function(_0x194405){return{'model':db[_0x194405[_0x54ab('0x21')]],'as':_0x194405['as'],'attributes':_0x194405[_0x54ab('0x22')]};}):[]};}):[]};}):[]:[]})[_0x54ab('0x10')](function(_0x5bb674){logger['info']('ShowFaxQueue',_0x18330f);logger[_0x54ab('0x14')](_0x54ab('0x24'),_0x18330f,JSON[_0x54ab('0x16')](_0x5bb674));_0x3b0a28(_0x5bb674);})['catch'](function(_0x3b1da5){logger[_0x54ab('0x17')](_0x54ab('0x24'),_0x3b1da5[_0x54ab('0x18')],_0x18330f);_0x4be5bd(_0x43f947[_0x54ab('0x17')](0x1f4,_0x3b1da5[_0x54ab('0x18')]));});});};
\ No newline at end of file
+var _0xd19d=['localhost','socket.io-emitter','redis','./faxQueue.socket','register','then','info','FaxQueue,\x20%s,\x20%s','request\x20sent','debug','stringify','error','code','message','result','catch','FaxQueue','findAll','options','raw','where','attributes','map','include','model','GetFaxQueue','ShowFaxQueue','lodash','util','moment','bluebird','ioredis','../../config/utils','rpc','../../config/environment','jayson/promise','client','http'];(function(_0x41e018,_0x54cb55){var _0x52327d=function(_0x538992){while(--_0x538992){_0x41e018['push'](_0x41e018['shift']());}};_0x52327d(++_0x54cb55);}(_0xd19d,0x1bd));var _0xdd19=function(_0x38275c,_0x23ea90){_0x38275c=_0x38275c-0x0;var _0x183a15=_0xd19d[_0x38275c];return _0x183a15;};'use strict';var _=require(_0xdd19('0x0'));var util=require(_0xdd19('0x1'));var moment=require(_0xdd19('0x2'));var BPromise=require(_0xdd19('0x3'));var rs=require('randomstring');var fs=require('fs');var Redis=require(_0xdd19('0x4'));var db=require('../../mysqldb')['db'];var utils=require(_0xdd19('0x5'));var logger=require('../../config/logger')(_0xdd19('0x6'));var config=require(_0xdd19('0x7'));var jayson=require(_0xdd19('0x8'));var client=jayson[_0xdd19('0x9')][_0xdd19('0xa')]({'port':0x232a});config['redis']=_['defaults'](config['redis'],{'host':_0xdd19('0xb'),'port':0x18eb});var socket=require(_0xdd19('0xc'))(new Redis(config[_0xdd19('0xd')]));require(_0xdd19('0xe'))[_0xdd19('0xf')](socket);function respondWithRpcPromise(_0x10f438,_0x3e849a,_0x460799){return new BPromise(function(_0x4c5722,_0x505349){return client['request'](_0x10f438,_0x460799)[_0xdd19('0x10')](function(_0x588bbd){logger[_0xdd19('0x11')](_0xdd19('0x12'),_0x3e849a,_0xdd19('0x13'));logger[_0xdd19('0x14')]('FaxQueue,\x20%s,\x20%s,\x20%s',_0x3e849a,_0xdd19('0x13'),JSON[_0xdd19('0x15')](_0x588bbd));if(_0x588bbd[_0xdd19('0x16')]){if(_0x588bbd['error'][_0xdd19('0x17')]===0x1f4){logger['error']('FaxQueue,\x20%s,\x20%s',_0x3e849a,_0x588bbd[_0xdd19('0x16')][_0xdd19('0x18')]);return _0x505349(_0x588bbd[_0xdd19('0x16')][_0xdd19('0x18')]);}logger[_0xdd19('0x16')]('FaxQueue,\x20%s,\x20%s',_0x3e849a,_0x588bbd['error']['message']);return _0x4c5722(_0x588bbd['error'][_0xdd19('0x18')]);}else{logger[_0xdd19('0x11')](_0xdd19('0x12'),_0x3e849a,_0xdd19('0x13'));_0x4c5722(_0x588bbd[_0xdd19('0x19')][_0xdd19('0x18')]);}})[_0xdd19('0x1a')](function(_0x18697c){logger[_0xdd19('0x16')](_0xdd19('0x12'),_0x3e849a,_0x18697c);_0x505349(_0x18697c);});});}exports['GetFaxQueue']=function(_0xa2823a){var _0x97e6e9=this;return new Promise(function(_0x261d58,_0x5bcfc0){return db[_0xdd19('0x1b')][_0xdd19('0x1c')]({'raw':_0xa2823a[_0xdd19('0x1d')]?_0xa2823a[_0xdd19('0x1d')][_0xdd19('0x1e')]===undefined?!![]:![]:!![],'where':_0xa2823a[_0xdd19('0x1d')]?_0xa2823a[_0xdd19('0x1d')][_0xdd19('0x1f')]||null:null,'attributes':_0xa2823a['options']?_0xa2823a['options'][_0xdd19('0x20')]||null:null,'limit':_0xa2823a['options']?_0xa2823a[_0xdd19('0x1d')]['limit']||null:null,'include':_0xa2823a[_0xdd19('0x1d')]?_0xa2823a['options']['include']?_[_0xdd19('0x21')](_0xa2823a[_0xdd19('0x1d')][_0xdd19('0x22')],function(_0x1adeb3){return{'model':db[_0x1adeb3[_0xdd19('0x23')]],'as':_0x1adeb3['as'],'attributes':_0x1adeb3['attributes'],'include':_0x1adeb3[_0xdd19('0x22')]?_[_0xdd19('0x21')](_0x1adeb3[_0xdd19('0x22')],function(_0x3fa68e){return{'model':db[_0x3fa68e[_0xdd19('0x23')]],'as':_0x3fa68e['as'],'attributes':_0x3fa68e['attributes'],'include':_0x3fa68e['include']?_[_0xdd19('0x21')](_0x3fa68e[_0xdd19('0x22')],function(_0x491e46){return{'model':db[_0x491e46['model']],'as':_0x491e46['as'],'attributes':_0x491e46['attributes']};}):[]};}):[]};}):[]:[]})['then'](function(_0x34dd39){logger[_0xdd19('0x11')](_0xdd19('0x24'),_0xa2823a);logger[_0xdd19('0x14')]('GetFaxQueue',_0xa2823a,JSON[_0xdd19('0x15')](_0x34dd39));_0x261d58(_0x34dd39);})['catch'](function(_0x13d62c){logger[_0xdd19('0x16')]('GetFaxQueue',_0x13d62c[_0xdd19('0x18')],_0xa2823a);_0x5bcfc0(_0x97e6e9[_0xdd19('0x16')](0x1f4,_0x13d62c['message']));});});};exports['ShowFaxQueue']=function(_0x1dce34){var _0x390a7e=this;return new Promise(function(_0x56b8d7,_0x209b53){return db[_0xdd19('0x1b')]['find']({'raw':_0x1dce34[_0xdd19('0x1d')]?_0x1dce34['options'][_0xdd19('0x1e')]===undefined?!![]:![]:!![],'where':_0x1dce34[_0xdd19('0x1d')]?_0x1dce34['options'][_0xdd19('0x1f')]||null:null,'attributes':_0x1dce34['options']?_0x1dce34[_0xdd19('0x1d')][_0xdd19('0x20')]||null:null,'include':_0x1dce34['options']?_0x1dce34[_0xdd19('0x1d')][_0xdd19('0x22')]?_[_0xdd19('0x21')](_0x1dce34['options']['include'],function(_0x3bb4b3){return{'model':db[_0x3bb4b3[_0xdd19('0x23')]],'as':_0x3bb4b3['as'],'attributes':_0x3bb4b3['attributes'],'include':_0x3bb4b3[_0xdd19('0x22')]?_[_0xdd19('0x21')](_0x3bb4b3[_0xdd19('0x22')],function(_0x43919b){return{'model':db[_0x43919b['model']],'as':_0x43919b['as'],'attributes':_0x43919b[_0xdd19('0x20')],'include':_0x43919b[_0xdd19('0x22')]?_[_0xdd19('0x21')](_0x43919b[_0xdd19('0x22')],function(_0x430ae3){return{'model':db[_0x430ae3[_0xdd19('0x23')]],'as':_0x430ae3['as'],'attributes':_0x430ae3[_0xdd19('0x20')]};}):[]};}):[]};}):[]:[]})[_0xdd19('0x10')](function(_0x47b4f8){logger[_0xdd19('0x11')](_0xdd19('0x25'),_0x1dce34);logger['debug'](_0xdd19('0x25'),_0x1dce34,JSON[_0xdd19('0x15')](_0x47b4f8));_0x56b8d7(_0x47b4f8);})[_0xdd19('0x1a')](function(_0x279afb){logger[_0xdd19('0x16')](_0xdd19('0x25'),_0x279afb['message'],_0x1dce34);_0x209b53(_0x390a7e[_0xdd19('0x16')](0x1f4,_0x279afb['message']));});});};
\ No newline at end of file
diff --git a/server/api/faxQueue/faxQueue.socket.js b/server/api/faxQueue/faxQueue.socket.js
index d892885..679f503 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 _0xeb46=['length','faxQueue:','./faxQueue.events','remove','update','emit','removeListener','register'];(function(_0x293f28,_0x5c2c19){var _0x497515=function(_0x70f90b){while(--_0x70f90b){_0x293f28['push'](_0x293f28['shift']());}};_0x497515(++_0x5c2c19);}(_0xeb46,0x12a));var _0x6eb4=function(_0x321bb2,_0x202794){_0x321bb2=_0x321bb2-0x0;var _0x9c12ed=_0xeb46[_0x321bb2];return _0x9c12ed;};'use strict';var FaxQueueEvents=require(_0x6eb4('0x0'));var events=['save',_0x6eb4('0x1'),_0x6eb4('0x2')];function createListener(_0x1e784f,_0x25ae6d){return function(_0x2acc7e){_0x25ae6d[_0x6eb4('0x3')](_0x1e784f,_0x2acc7e);};}function removeListener(_0x1bdbb9,_0xd93f0f){return function(){FaxQueueEvents[_0x6eb4('0x4')](_0x1bdbb9,_0xd93f0f);};}exports[_0x6eb4('0x5')]=function(_0x573553){for(var _0x2f86c2=0x0,_0x1daaa9=events[_0x6eb4('0x6')];_0x2f86c2<_0x1daaa9;_0x2f86c2++){var _0x4aa8b9=events[_0x2f86c2];var _0x4d30d7=createListener(_0x6eb4('0x7')+_0x4aa8b9,_0x573553);FaxQueueEvents['on'](_0x4aa8b9,_0x4d30d7);}};
\ No newline at end of file
+var _0xd978=['emit','removeListener','register','length','./faxQueue.events','save'];(function(_0x4715d2,_0x3371b2){var _0x141811=function(_0x520bc6){while(--_0x520bc6){_0x4715d2['push'](_0x4715d2['shift']());}};_0x141811(++_0x3371b2);}(_0xd978,0xfa));var _0x8d97=function(_0x543429,_0x140390){_0x543429=_0x543429-0x0;var _0x112a46=_0xd978[_0x543429];return _0x112a46;};'use strict';var FaxQueueEvents=require(_0x8d97('0x0'));var events=[_0x8d97('0x1'),'remove','update'];function createListener(_0x5e69ed,_0x1e2652){return function(_0x219d28){_0x1e2652[_0x8d97('0x2')](_0x5e69ed,_0x219d28);};}function removeListener(_0x1c6e9b,_0x293957){return function(){FaxQueueEvents[_0x8d97('0x3')](_0x1c6e9b,_0x293957);};}exports[_0x8d97('0x4')]=function(_0x4b8331){for(var _0x93807f=0x0,_0x5b3a33=events[_0x8d97('0x5')];_0x93807f<_0x5b3a33;_0x93807f++){var _0x290c40=events[_0x93807f];var _0x458b2a=createListener('faxQueue:'+_0x290c40,_0x4b8331);FaxQueueEvents['on'](_0x290c40,_0x458b2a);}};
\ No newline at end of file
diff --git a/server/api/faxQueue/index.js b/server/api/faxQueue/index.js
index f4ac2bc..0b93d7a 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 _0xd8b0=['util','Router','../../components/auth/service','../../components/interaction/service','../../config/environment','./faxQueue.controller','index','get','/describe','describe','isAuthenticated','show','/:id/members','getMembers','/:id/teams','getTeams','/:id/users','getAgents','post','create','addTeams','addAgents','/:id','update','delete','destroy','removeTeams','exports','multer'];(function(_0x46971a,_0x4a8702){var _0x548b2c=function(_0xaffe0e){while(--_0xaffe0e){_0x46971a['push'](_0x46971a['shift']());}};_0x548b2c(++_0x4a8702);}(_0xd8b0,0xad));var _0x0d8b=function(_0x20a584,_0xe384a5){_0x20a584=_0x20a584-0x0;var _0x4b41a8=_0xd8b0[_0x20a584];return _0x4b41a8;};'use strict';var multer=require(_0x0d8b('0x0'));var util=require(_0x0d8b('0x1'));var path=require('path');var timeout=require('connect-timeout');var express=require('express');var router=express[_0x0d8b('0x2')]();var auth=require(_0x0d8b('0x3'));var interaction=require(_0x0d8b('0x4'));var config=require(_0x0d8b('0x5'));var controller=require(_0x0d8b('0x6'));router['get']('/',auth['isAuthenticated'](),controller[_0x0d8b('0x7')]);router[_0x0d8b('0x8')](_0x0d8b('0x9'),auth['isAuthenticated'](),controller[_0x0d8b('0xa')]);router[_0x0d8b('0x8')]('/:id',auth[_0x0d8b('0xb')](),controller[_0x0d8b('0xc')]);router[_0x0d8b('0x8')](_0x0d8b('0xd'),auth[_0x0d8b('0xb')](),controller[_0x0d8b('0xe')]);router[_0x0d8b('0x8')](_0x0d8b('0xf'),auth['isAuthenticated'](),controller[_0x0d8b('0x10')]);router['get'](_0x0d8b('0x11'),auth[_0x0d8b('0xb')](),controller[_0x0d8b('0x12')]);router[_0x0d8b('0x13')]('/',auth[_0x0d8b('0xb')](),controller[_0x0d8b('0x14')]);router[_0x0d8b('0x13')](_0x0d8b('0xf'),auth[_0x0d8b('0xb')](),controller[_0x0d8b('0x15')]);router[_0x0d8b('0x13')](_0x0d8b('0x11'),auth[_0x0d8b('0xb')](),controller[_0x0d8b('0x16')]);router['put'](_0x0d8b('0x17'),auth[_0x0d8b('0xb')](),controller[_0x0d8b('0x18')]);router[_0x0d8b('0x19')](_0x0d8b('0x17'),auth['isAuthenticated'](),controller[_0x0d8b('0x1a')]);router[_0x0d8b('0x19')](_0x0d8b('0xf'),auth[_0x0d8b('0xb')](),controller[_0x0d8b('0x1b')]);router[_0x0d8b('0x19')](_0x0d8b('0x11'),auth[_0x0d8b('0xb')](),controller['removeAgents']);module[_0x0d8b('0x1c')]=router;
\ No newline at end of file
+var _0xd8b0=['util','Router','../../components/auth/service','../../components/interaction/service','../../config/environment','./faxQueue.controller','index','get','/describe','describe','isAuthenticated','show','/:id/members','getMembers','/:id/teams','getTeams','/:id/users','getAgents','post','create','addTeams','addAgents','/:id','update','delete','destroy','removeTeams','exports','multer'];(function(_0x14a911,_0x524493){var _0x3219ee=function(_0x348184){while(--_0x348184){_0x14a911['push'](_0x14a911['shift']());}};_0x3219ee(++_0x524493);}(_0xd8b0,0xad));var _0x0d8b=function(_0x20a584,_0xe384a5){_0x20a584=_0x20a584-0x0;var _0x4b41a8=_0xd8b0[_0x20a584];return _0x4b41a8;};'use strict';var multer=require(_0x0d8b('0x0'));var util=require(_0x0d8b('0x1'));var path=require('path');var timeout=require('connect-timeout');var express=require('express');var router=express[_0x0d8b('0x2')]();var auth=require(_0x0d8b('0x3'));var interaction=require(_0x0d8b('0x4'));var config=require(_0x0d8b('0x5'));var controller=require(_0x0d8b('0x6'));router['get']('/',auth['isAuthenticated'](),controller[_0x0d8b('0x7')]);router[_0x0d8b('0x8')](_0x0d8b('0x9'),auth['isAuthenticated'](),controller[_0x0d8b('0xa')]);router[_0x0d8b('0x8')]('/:id',auth[_0x0d8b('0xb')](),controller[_0x0d8b('0xc')]);router[_0x0d8b('0x8')](_0x0d8b('0xd'),auth[_0x0d8b('0xb')](),controller[_0x0d8b('0xe')]);router[_0x0d8b('0x8')](_0x0d8b('0xf'),auth['isAuthenticated'](),controller[_0x0d8b('0x10')]);router['get'](_0x0d8b('0x11'),auth[_0x0d8b('0xb')](),controller[_0x0d8b('0x12')]);router[_0x0d8b('0x13')]('/',auth[_0x0d8b('0xb')](),controller[_0x0d8b('0x14')]);router[_0x0d8b('0x13')](_0x0d8b('0xf'),auth[_0x0d8b('0xb')](),controller[_0x0d8b('0x15')]);router[_0x0d8b('0x13')](_0x0d8b('0x11'),auth[_0x0d8b('0xb')](),controller[_0x0d8b('0x16')]);router['put'](_0x0d8b('0x17'),auth[_0x0d8b('0xb')](),controller[_0x0d8b('0x18')]);router[_0x0d8b('0x19')](_0x0d8b('0x17'),auth['isAuthenticated'](),controller[_0x0d8b('0x1a')]);router[_0x0d8b('0x19')](_0x0d8b('0xf'),auth[_0x0d8b('0xb')](),controller[_0x0d8b('0x1b')]);router[_0x0d8b('0x19')](_0x0d8b('0x11'),auth[_0x0d8b('0xb')](),controller['removeAgents']);module[_0x0d8b('0x1c')]=router;
\ No newline at end of file
diff --git a/server/api/faxQueueReport/faxQueueReport.attributes.js b/server/api/faxQueueReport/faxQueueReport.attributes.js
index b2271bc..6d8518f 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 _0x9c07=['DATE','moment','sequelize','STRING'];(function(_0x5c0068,_0x2cba49){var _0x4ece6d=function(_0x2cf817){while(--_0x2cf817){_0x5c0068['push'](_0x5c0068['shift']());}};_0x4ece6d(++_0x2cba49);}(_0x9c07,0x16d));var _0x79c0=function(_0x33e2c2,_0xb29113){_0x33e2c2=_0x33e2c2-0x0;var _0x4245e1=_0x9c07[_0x33e2c2];return _0x4245e1;};'use strict';var moment=require(_0x79c0('0x0'));var Sequelize=require(_0x79c0('0x1'));module['exports']={'uniqueid':{'type':Sequelize['STRING'],'allowNull':![]},'from':{'type':Sequelize[_0x79c0('0x2')]},'joinAt':{'type':Sequelize[_0x79c0('0x3')]},'leaveAt':{'type':Sequelize[_0x79c0('0x3')]},'acceptAt':{'type':Sequelize[_0x79c0('0x3')]},'exitAt':{'type':Sequelize['DATE']},'reason':{'type':Sequelize['STRING']}};
\ No newline at end of file
+var _0x6bd9=['moment','sequelize','exports','STRING','DATE'];(function(_0x1ae7c8,_0x274e1d){var _0x66aab0=function(_0x3dd2b0){while(--_0x3dd2b0){_0x1ae7c8['push'](_0x1ae7c8['shift']());}};_0x66aab0(++_0x274e1d);}(_0x6bd9,0xaa));var _0x96bd=function(_0x51e795,_0x402f92){_0x51e795=_0x51e795-0x0;var _0x358732=_0x6bd9[_0x51e795];return _0x358732;};'use strict';var moment=require(_0x96bd('0x0'));var Sequelize=require(_0x96bd('0x1'));module[_0x96bd('0x2')]={'uniqueid':{'type':Sequelize[_0x96bd('0x3')],'allowNull':![]},'from':{'type':Sequelize['STRING']},'joinAt':{'type':Sequelize[_0x96bd('0x4')]},'leaveAt':{'type':Sequelize['DATE']},'acceptAt':{'type':Sequelize[_0x96bd('0x4')]},'exitAt':{'type':Sequelize['DATE']},'reason':{'type':Sequelize['STRING']}};
\ No newline at end of file
diff --git a/server/api/faxQueueReport/faxQueueReport.controller.js b/server/api/faxQueueReport/faxQueueReport.controller.js
index a55312f..c609967 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 _0x96f8=['attributes','intersection','fields','length','hasOwnProperty','nolimit','limit','order','sort','where','filters','merge','filter','options','includeAll','include','findAll','rows','catch','show','find','create','params','body','describe','html-pdf','eml-format','rimraf','zip-dir','fast-json-patch','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','sendStatus','status','end','count','offset','set','Content-Range','json','save','update','destroy','then','error','name','send','index','map','FaxQueueReport','rawAttributes','fieldName','type','key','model','query'];(function(_0x2f1bb5,_0x5ea72f){var _0x986af5=function(_0x2ae4c1){while(--_0x2ae4c1){_0x2f1bb5['push'](_0x2f1bb5['shift']());}};_0x986af5(++_0x5ea72f);}(_0x96f8,0x195));var _0x896f=function(_0x3d7023,_0x1ccec0){_0x3d7023=_0x3d7023-0x0;var _0x14c5c0=_0x96f8[_0x3d7023];return _0x14c5c0;};'use strict';var pdf=require(_0x896f('0x0'));var emlformat=require(_0x896f('0x1'));var rimraf=require(_0x896f('0x2'));var zipdir=require(_0x896f('0x3'));var jsonpatch=require(_0x896f('0x4'));var rp=require('request-promise');var moment=require('moment');var BPromise=require(_0x896f('0x5'));var Mustache=require(_0x896f('0x6'));var util=require(_0x896f('0x7'));var path=require(_0x896f('0x8'));var sox=require(_0x896f('0x9'));var csv=require(_0x896f('0xa'));var ejs=require(_0x896f('0xb'));var fs=require('fs');var _=require(_0x896f('0xc'));var squel=require(_0x896f('0xd'));var crypto=require('crypto');var jsforce=require(_0x896f('0xe'));var deskjs=require(_0x896f('0xf'));var toCsv=require('to-csv');var querystring=require(_0x896f('0x10'));var Papa=require(_0x896f('0x11'));var Redis=require(_0x896f('0x12'));var authService=require(_0x896f('0x13'));var qs=require(_0x896f('0x14'));var as=require(_0x896f('0x15'));var hardwareService=require(_0x896f('0x16'));var logger=require(_0x896f('0x17'))(_0x896f('0x18'));var utils=require(_0x896f('0x19'));var config=require(_0x896f('0x1a'));var db=require('../../mysqldb')['db'];function respondWithStatusCode(_0x114ed9,_0x30801f){_0x30801f=_0x30801f||0xcc;return function(_0x2caf1c){if(_0x2caf1c){return _0x114ed9[_0x896f('0x1b')](_0x30801f);}return _0x114ed9[_0x896f('0x1c')](_0x30801f)[_0x896f('0x1d')]();};}function respondWithResult(_0x394243,_0xd4b188){_0xd4b188=_0xd4b188||0xc8;return function(_0x17535b){if(_0x17535b){return _0x394243['status'](_0xd4b188)['json'](_0x17535b);}};}function respondWithFilteredResult(_0x323c88,_0x5476a9){return function(_0xa89765){if(_0xa89765){var _0x406f79=_0xa89765[_0x896f('0x1e')],_0x1a65cc=_0x5476a9[_0x896f('0x1f')],_0x58f2e0=_0x5476a9[_0x896f('0x1f')]+_0x5476a9['limit'],_0x66d55b;if(_0x58f2e0>=_0x406f79){_0x58f2e0=_0x406f79;_0x66d55b=0xc8;}else{_0x66d55b=0xce;}_0x323c88[_0x896f('0x1c')](_0x66d55b);return _0x323c88[_0x896f('0x20')](_0x896f('0x21'),_0x1a65cc+'-'+_0x58f2e0+'/'+_0x406f79)[_0x896f('0x22')](_0xa89765);}return null;};}function patchUpdates(_0x3b6463){return function(_0x364d51){try{jsonpatch['apply'](_0x364d51,_0x3b6463,!![]);}catch(_0xe1c82c){return BPromise['reject'](_0xe1c82c);}return _0x364d51[_0x896f('0x23')]();};}function saveUpdates(_0x180c99,_0x5baa85){return function(_0x2623f0){if(_0x2623f0){return _0x2623f0[_0x896f('0x24')](_0x180c99)['then'](function(_0x379836){return _0x379836;});}return null;};}function removeEntity(_0x3c01e9,_0x369d82){return function(_0x2d74ba){if(_0x2d74ba){return _0x2d74ba[_0x896f('0x25')]()[_0x896f('0x26')](function(){_0x3c01e9[_0x896f('0x1c')](0xcc)['end']();});}};}function handleEntityNotFound(_0x3ee2d7,_0x3d1cfb){return function(_0x2758ad){if(!_0x2758ad){_0x3ee2d7['sendStatus'](0x194);}return _0x2758ad;};}function handleError(_0x4358c2,_0x2250f3){_0x2250f3=_0x2250f3||0x1f4;return function(_0x2cc136){logger[_0x896f('0x27')](_0x2cc136['stack']);if(_0x2cc136[_0x896f('0x28')]){delete _0x2cc136[_0x896f('0x28')];}_0x4358c2[_0x896f('0x1c')](_0x2250f3)[_0x896f('0x29')](_0x2cc136);};}exports[_0x896f('0x2a')]=function(_0x173f27,_0x1771e1){var _0x152d77={},_0x4ece06={},_0x34dc0f={'count':0x0,'rows':[]};var _0x2db94a=_[_0x896f('0x2b')](db[_0x896f('0x2c')][_0x896f('0x2d')],function(_0x5df16d){return{'name':_0x5df16d[_0x896f('0x2e')],'type':_0x5df16d[_0x896f('0x2f')][_0x896f('0x30')]};});_0x4ece06[_0x896f('0x31')]=_[_0x896f('0x2b')](_0x2db94a,'name');_0x4ece06[_0x896f('0x32')]=_['keys'](_0x173f27[_0x896f('0x32')]);_0x4ece06['filters']=_['intersection'](_0x4ece06['model'],_0x4ece06['query']);_0x152d77[_0x896f('0x33')]=_[_0x896f('0x34')](_0x4ece06[_0x896f('0x31')],qs[_0x896f('0x35')](_0x173f27[_0x896f('0x32')][_0x896f('0x35')]));_0x152d77[_0x896f('0x33')]=_0x152d77[_0x896f('0x33')][_0x896f('0x36')]?_0x152d77['attributes']:_0x4ece06[_0x896f('0x31')];if(!_0x173f27[_0x896f('0x32')][_0x896f('0x37')](_0x896f('0x38'))){_0x152d77['limit']=qs[_0x896f('0x39')](_0x173f27['query']['limit']);_0x152d77[_0x896f('0x1f')]=qs[_0x896f('0x1f')](_0x173f27['query']['offset']);}_0x152d77[_0x896f('0x3a')]=qs[_0x896f('0x3b')](_0x173f27[_0x896f('0x32')]['sort']);_0x152d77[_0x896f('0x3c')]=qs[_0x896f('0x3d')](_['pick'](_0x173f27[_0x896f('0x32')],_0x4ece06['filters']));if(_0x173f27[_0x896f('0x32')]['filter']){_0x152d77['where']=_[_0x896f('0x3e')](_0x152d77[_0x896f('0x3c')],{'$or':_['map'](_0x2db94a,function(_0x5e1bd8){if(_0x5e1bd8[_0x896f('0x2f')]!=='VIRTUAL'){var _0x45afb7={};_0x45afb7[_0x5e1bd8[_0x896f('0x28')]]={'$like':'%'+_0x173f27[_0x896f('0x32')][_0x896f('0x3f')]+'%'};return _0x45afb7;}})});}_0x152d77=_[_0x896f('0x3e')]({},_0x152d77,_0x173f27[_0x896f('0x40')]);var _0x5866b5={'where':_0x152d77[_0x896f('0x3c')]};return db[_0x896f('0x2c')][_0x896f('0x1e')](_0x5866b5)[_0x896f('0x26')](function(_0x173970){_0x34dc0f[_0x896f('0x1e')]=_0x173970;if(_0x173f27['query'][_0x896f('0x41')]){_0x152d77[_0x896f('0x42')]=[{'all':!![]}];}return db[_0x896f('0x2c')][_0x896f('0x43')](_0x152d77);})[_0x896f('0x26')](function(_0x9d41a5){_0x34dc0f[_0x896f('0x44')]=_0x9d41a5;return _0x34dc0f;})[_0x896f('0x26')](respondWithFilteredResult(_0x1771e1,_0x152d77))[_0x896f('0x45')](handleError(_0x1771e1,null));};exports[_0x896f('0x46')]=function(_0x3c7d5c,_0x5a5caf){var _0x4fd681={'raw':!![],'where':{'id':_0x3c7d5c['params']['id']}},_0xfc0ead={};_0xfc0ead[_0x896f('0x31')]=_['keys'](db[_0x896f('0x2c')]['rawAttributes']);_0xfc0ead[_0x896f('0x32')]=_['keys'](_0x3c7d5c[_0x896f('0x32')]);_0xfc0ead[_0x896f('0x3d')]=_[_0x896f('0x34')](_0xfc0ead[_0x896f('0x31')],_0xfc0ead['query']);_0x4fd681[_0x896f('0x33')]=_[_0x896f('0x34')](_0xfc0ead['model'],qs[_0x896f('0x35')](_0x3c7d5c[_0x896f('0x32')][_0x896f('0x35')]));_0x4fd681['attributes']=_0x4fd681[_0x896f('0x33')][_0x896f('0x36')]?_0x4fd681[_0x896f('0x33')]:_0xfc0ead[_0x896f('0x31')];if(_0x3c7d5c['query'][_0x896f('0x41')]){_0x4fd681['include']=[{'all':!![]}];}_0x4fd681=_['merge']({},_0x4fd681,_0x3c7d5c[_0x896f('0x40')]);return db[_0x896f('0x2c')][_0x896f('0x47')](_0x4fd681)['then'](handleEntityNotFound(_0x5a5caf,null))[_0x896f('0x26')](respondWithResult(_0x5a5caf,null))['catch'](handleError(_0x5a5caf,null));};exports[_0x896f('0x48')]=function(_0x9784e,_0x1aa312){return db[_0x896f('0x2c')][_0x896f('0x48')](_0x9784e['body'],{})[_0x896f('0x26')](respondWithResult(_0x1aa312,0xc9))[_0x896f('0x45')](handleError(_0x1aa312,null));};exports[_0x896f('0x24')]=function(_0x2f2542,_0x43356d){if(_0x2f2542['body']['id']){delete _0x2f2542['body']['id'];}return db[_0x896f('0x2c')][_0x896f('0x47')]({'where':{'id':_0x2f2542[_0x896f('0x49')]['id']}})[_0x896f('0x26')](handleEntityNotFound(_0x43356d,null))[_0x896f('0x26')](saveUpdates(_0x2f2542[_0x896f('0x4a')],null))['then'](respondWithResult(_0x43356d,null))[_0x896f('0x45')](handleError(_0x43356d,null));};exports[_0x896f('0x25')]=function(_0x5f0324,_0x199f2e){return db[_0x896f('0x2c')][_0x896f('0x47')]({'where':{'id':_0x5f0324['params']['id']}})[_0x896f('0x26')](handleEntityNotFound(_0x199f2e,null))['then'](removeEntity(_0x199f2e,null))['catch'](handleError(_0x199f2e,null));};exports[_0x896f('0x4b')]=function(_0x1f3e73,_0x4d6cb6){return db[_0x896f('0x2c')]['describe']()['then'](respondWithResult(_0x4d6cb6,null))[_0x896f('0x45')](handleError(_0x4d6cb6,null));};
\ No newline at end of file
+var _0xc42a=['count','offset','set','Content-Range','reject','save','update','then','destroy','end','sendStatus','error','name','send','FaxQueueReport','rawAttributes','fieldName','type','key','model','keys','query','filters','intersection','fields','attributes','length','hasOwnProperty','nolimit','limit','order','where','pick','filter','merge','map','VIRTUAL','options','includeAll','include','rows','catch','show','params','create','body','find','describe','html-pdf','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','bluebird','mustache','util','path','sox','to-csv','lodash','crypto','jsforce','querystring','papaparse','ioredis','../../components/parsers/advancedSearch','../../config/logger','api','../../config/utils','../../config/environment','../../mysqldb','status','json'];(function(_0x5f1b1e,_0x299f3f){var _0x5170ca=function(_0xcfb2a4){while(--_0xcfb2a4){_0x5f1b1e['push'](_0x5f1b1e['shift']());}};_0x5170ca(++_0x299f3f);}(_0xc42a,0x1a2));var _0xac42=function(_0x2f01e1,_0x51a54c){_0x2f01e1=_0x2f01e1-0x0;var _0x4953f8=_0xc42a[_0x2f01e1];return _0x4953f8;};'use strict';var pdf=require(_0xac42('0x0'));var emlformat=require(_0xac42('0x1'));var rimraf=require(_0xac42('0x2'));var zipdir=require(_0xac42('0x3'));var jsonpatch=require(_0xac42('0x4'));var rp=require(_0xac42('0x5'));var moment=require('moment');var BPromise=require(_0xac42('0x6'));var Mustache=require(_0xac42('0x7'));var util=require(_0xac42('0x8'));var path=require(_0xac42('0x9'));var sox=require(_0xac42('0xa'));var csv=require(_0xac42('0xb'));var ejs=require('ejs');var fs=require('fs');var _=require(_0xac42('0xc'));var squel=require('squel');var crypto=require(_0xac42('0xd'));var jsforce=require(_0xac42('0xe'));var deskjs=require('desk.js');var toCsv=require(_0xac42('0xb'));var querystring=require(_0xac42('0xf'));var Papa=require(_0xac42('0x10'));var Redis=require(_0xac42('0x11'));var authService=require('../../components/auth/service');var qs=require('../../components/parsers/qs');var as=require(_0xac42('0x12'));var hardwareService=require('../../config/license/hardware');var logger=require(_0xac42('0x13'))(_0xac42('0x14'));var utils=require(_0xac42('0x15'));var config=require(_0xac42('0x16'));var db=require(_0xac42('0x17'))['db'];function respondWithStatusCode(_0x243221,_0x3d93c3){_0x3d93c3=_0x3d93c3||0xcc;return function(_0x49f8f6){if(_0x49f8f6){return _0x243221['sendStatus'](_0x3d93c3);}return _0x243221[_0xac42('0x18')](_0x3d93c3)['end']();};}function respondWithResult(_0x22c28e,_0x563020){_0x563020=_0x563020||0xc8;return function(_0x471838){if(_0x471838){return _0x22c28e[_0xac42('0x18')](_0x563020)[_0xac42('0x19')](_0x471838);}};}function respondWithFilteredResult(_0x3174f4,_0x2d5828){return function(_0x34ebd0){if(_0x34ebd0){var _0x528c00=_0x34ebd0[_0xac42('0x1a')],_0xb58f6f=_0x2d5828[_0xac42('0x1b')],_0xefd5fd=_0x2d5828['offset']+_0x2d5828['limit'],_0xd523ec;if(_0xefd5fd>=_0x528c00){_0xefd5fd=_0x528c00;_0xd523ec=0xc8;}else{_0xd523ec=0xce;}_0x3174f4[_0xac42('0x18')](_0xd523ec);return _0x3174f4[_0xac42('0x1c')](_0xac42('0x1d'),_0xb58f6f+'-'+_0xefd5fd+'/'+_0x528c00)[_0xac42('0x19')](_0x34ebd0);}return null;};}function patchUpdates(_0xa5c895){return function(_0x9667e7){try{jsonpatch['apply'](_0x9667e7,_0xa5c895,!![]);}catch(_0x49dd82){return BPromise[_0xac42('0x1e')](_0x49dd82);}return _0x9667e7[_0xac42('0x1f')]();};}function saveUpdates(_0x57a812,_0x5108a7){return function(_0xc4574e){if(_0xc4574e){return _0xc4574e[_0xac42('0x20')](_0x57a812)[_0xac42('0x21')](function(_0x5c1ef0){return _0x5c1ef0;});}return null;};}function removeEntity(_0xb3cb60,_0x1f25ea){return function(_0x32c50e){if(_0x32c50e){return _0x32c50e[_0xac42('0x22')]()['then'](function(){_0xb3cb60[_0xac42('0x18')](0xcc)[_0xac42('0x23')]();});}};}function handleEntityNotFound(_0x491886,_0xb8024e){return function(_0x371518){if(!_0x371518){_0x491886[_0xac42('0x24')](0x194);}return _0x371518;};}function handleError(_0x562684,_0x342de7){_0x342de7=_0x342de7||0x1f4;return function(_0x379b00){logger[_0xac42('0x25')](_0x379b00['stack']);if(_0x379b00[_0xac42('0x26')]){delete _0x379b00[_0xac42('0x26')];}_0x562684[_0xac42('0x18')](_0x342de7)[_0xac42('0x27')](_0x379b00);};}exports['index']=function(_0x2f6aff,_0x494fa4){var _0x4ba7c0={},_0x2593b2={},_0x373852={'count':0x0,'rows':[]};var _0x181c4c=_['map'](db[_0xac42('0x28')][_0xac42('0x29')],function(_0x29e3df){return{'name':_0x29e3df[_0xac42('0x2a')],'type':_0x29e3df[_0xac42('0x2b')][_0xac42('0x2c')]};});_0x2593b2[_0xac42('0x2d')]=_['map'](_0x181c4c,'name');_0x2593b2['query']=_[_0xac42('0x2e')](_0x2f6aff[_0xac42('0x2f')]);_0x2593b2[_0xac42('0x30')]=_[_0xac42('0x31')](_0x2593b2[_0xac42('0x2d')],_0x2593b2['query']);_0x4ba7c0['attributes']=_[_0xac42('0x31')](_0x2593b2['model'],qs[_0xac42('0x32')](_0x2f6aff[_0xac42('0x2f')][_0xac42('0x32')]));_0x4ba7c0[_0xac42('0x33')]=_0x4ba7c0[_0xac42('0x33')][_0xac42('0x34')]?_0x4ba7c0[_0xac42('0x33')]:_0x2593b2[_0xac42('0x2d')];if(!_0x2f6aff[_0xac42('0x2f')][_0xac42('0x35')](_0xac42('0x36'))){_0x4ba7c0[_0xac42('0x37')]=qs[_0xac42('0x37')](_0x2f6aff['query'][_0xac42('0x37')]);_0x4ba7c0[_0xac42('0x1b')]=qs[_0xac42('0x1b')](_0x2f6aff[_0xac42('0x2f')][_0xac42('0x1b')]);}_0x4ba7c0[_0xac42('0x38')]=qs['sort'](_0x2f6aff[_0xac42('0x2f')]['sort']);_0x4ba7c0[_0xac42('0x39')]=qs[_0xac42('0x30')](_[_0xac42('0x3a')](_0x2f6aff[_0xac42('0x2f')],_0x2593b2['filters']));if(_0x2f6aff[_0xac42('0x2f')][_0xac42('0x3b')]){_0x4ba7c0['where']=_[_0xac42('0x3c')](_0x4ba7c0[_0xac42('0x39')],{'$or':_[_0xac42('0x3d')](_0x181c4c,function(_0x50d6a3){if(_0x50d6a3[_0xac42('0x2b')]!==_0xac42('0x3e')){var _0x946954={};_0x946954[_0x50d6a3[_0xac42('0x26')]]={'$like':'%'+_0x2f6aff[_0xac42('0x2f')][_0xac42('0x3b')]+'%'};return _0x946954;}})});}_0x4ba7c0=_[_0xac42('0x3c')]({},_0x4ba7c0,_0x2f6aff[_0xac42('0x3f')]);var _0x30ca0a={'where':_0x4ba7c0[_0xac42('0x39')]};return db['FaxQueueReport'][_0xac42('0x1a')](_0x30ca0a)['then'](function(_0x288653){_0x373852[_0xac42('0x1a')]=_0x288653;if(_0x2f6aff['query'][_0xac42('0x40')]){_0x4ba7c0[_0xac42('0x41')]=[{'all':!![]}];}return db['FaxQueueReport']['findAll'](_0x4ba7c0);})['then'](function(_0x5928ec){_0x373852[_0xac42('0x42')]=_0x5928ec;return _0x373852;})[_0xac42('0x21')](respondWithFilteredResult(_0x494fa4,_0x4ba7c0))[_0xac42('0x43')](handleError(_0x494fa4,null));};exports[_0xac42('0x44')]=function(_0x47de50,_0x111bff){var _0x5237c5={'raw':!![],'where':{'id':_0x47de50[_0xac42('0x45')]['id']}},_0x211e24={};_0x211e24['model']=_[_0xac42('0x2e')](db[_0xac42('0x28')][_0xac42('0x29')]);_0x211e24[_0xac42('0x2f')]=_[_0xac42('0x2e')](_0x47de50['query']);_0x211e24['filters']=_[_0xac42('0x31')](_0x211e24[_0xac42('0x2d')],_0x211e24['query']);_0x5237c5[_0xac42('0x33')]=_[_0xac42('0x31')](_0x211e24[_0xac42('0x2d')],qs[_0xac42('0x32')](_0x47de50['query'][_0xac42('0x32')]));_0x5237c5[_0xac42('0x33')]=_0x5237c5[_0xac42('0x33')][_0xac42('0x34')]?_0x5237c5[_0xac42('0x33')]:_0x211e24[_0xac42('0x2d')];if(_0x47de50['query'][_0xac42('0x40')]){_0x5237c5[_0xac42('0x41')]=[{'all':!![]}];}_0x5237c5=_[_0xac42('0x3c')]({},_0x5237c5,_0x47de50['options']);return db[_0xac42('0x28')]['find'](_0x5237c5)[_0xac42('0x21')](handleEntityNotFound(_0x111bff,null))[_0xac42('0x21')](respondWithResult(_0x111bff,null))[_0xac42('0x43')](handleError(_0x111bff,null));};exports[_0xac42('0x46')]=function(_0x54cf41,_0x43563a){return db['FaxQueueReport'][_0xac42('0x46')](_0x54cf41[_0xac42('0x47')],{})[_0xac42('0x21')](respondWithResult(_0x43563a,0xc9))['catch'](handleError(_0x43563a,null));};exports['update']=function(_0x4876f7,_0x3fa7e3){if(_0x4876f7[_0xac42('0x47')]['id']){delete _0x4876f7['body']['id'];}return db[_0xac42('0x28')][_0xac42('0x48')]({'where':{'id':_0x4876f7['params']['id']}})[_0xac42('0x21')](handleEntityNotFound(_0x3fa7e3,null))[_0xac42('0x21')](saveUpdates(_0x4876f7[_0xac42('0x47')],null))[_0xac42('0x21')](respondWithResult(_0x3fa7e3,null))[_0xac42('0x43')](handleError(_0x3fa7e3,null));};exports['destroy']=function(_0x4fe374,_0xf8e91c){return db[_0xac42('0x28')]['find']({'where':{'id':_0x4fe374[_0xac42('0x45')]['id']}})['then'](handleEntityNotFound(_0xf8e91c,null))[_0xac42('0x21')](removeEntity(_0xf8e91c,null))[_0xac42('0x43')](handleError(_0xf8e91c,null));};exports[_0xac42('0x49')]=function(_0x58ccfc,_0x54bd20){return db[_0xac42('0x28')][_0xac42('0x49')]()[_0xac42('0x21')](respondWithResult(_0x54bd20,null))[_0xac42('0x43')](handleError(_0x54bd20,null));};
\ No newline at end of file
diff --git a/server/api/faxQueueReport/faxQueueReport.model.js b/server/api/faxQueueReport/faxQueueReport.model.js
index 058df6f..5dc2bb7 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 _0x4cb4=['lodash','util','../../config/logger','moment','bluebird','request-promise','path','./faxQueueReport.attributes','exports','define','uniqueid'];(function(_0x14add3,_0x13ce8d){var _0x4a174f=function(_0x2b3ed7){while(--_0x2b3ed7){_0x14add3['push'](_0x14add3['shift']());}};_0x4a174f(++_0x13ce8d);}(_0x4cb4,0x197));var _0x44cb=function(_0x537c37,_0x536e74){_0x537c37=_0x537c37-0x0;var _0x241f84=_0x4cb4[_0x537c37];return _0x241f84;};'use strict';var _=require(_0x44cb('0x0'));var util=require(_0x44cb('0x1'));var logger=require(_0x44cb('0x2'))('api');var moment=require(_0x44cb('0x3'));var BPromise=require(_0x44cb('0x4'));var rp=require(_0x44cb('0x5'));var fs=require('fs');var path=require(_0x44cb('0x6'));var rimraf=require('rimraf');var config=require('../../config/environment');var attributes=require(_0x44cb('0x7'));module[_0x44cb('0x8')]=function(_0x168e40,_0x5dc384){return _0x168e40[_0x44cb('0x9')]('FaxQueueReport',attributes,{'tableName':'report_fax_queue','paranoid':![],'indexes':[{'name':'uniqueid','fields':[_0x44cb('0xa')]}],'timestamps':!![]});};
\ No newline at end of file
+var _0x52ed=['report_fax_queue','uniqueid','lodash','moment','bluebird','request-promise','path','rimraf','../../config/environment','./faxQueueReport.attributes','exports','define','FaxQueueReport'];(function(_0x4df557,_0x27a29e){var _0x50c0df=function(_0x47c5c5){while(--_0x47c5c5){_0x4df557['push'](_0x4df557['shift']());}};_0x50c0df(++_0x27a29e);}(_0x52ed,0xec));var _0xd52e=function(_0x4dc35f,_0x377c51){_0x4dc35f=_0x4dc35f-0x0;var _0x1f8820=_0x52ed[_0x4dc35f];return _0x1f8820;};'use strict';var _=require(_0xd52e('0x0'));var util=require('util');var logger=require('../../config/logger')('api');var moment=require(_0xd52e('0x1'));var BPromise=require(_0xd52e('0x2'));var rp=require(_0xd52e('0x3'));var fs=require('fs');var path=require(_0xd52e('0x4'));var rimraf=require(_0xd52e('0x5'));var config=require(_0xd52e('0x6'));var attributes=require(_0xd52e('0x7'));module[_0xd52e('0x8')]=function(_0x56b40e,_0x27a9ce){return _0x56b40e[_0xd52e('0x9')](_0xd52e('0xa'),attributes,{'tableName':_0xd52e('0xb'),'paranoid':![],'indexes':[{'name':_0xd52e('0xc'),'fields':[_0xd52e('0xc')]}],'timestamps':!![]});};
\ No newline at end of file
diff --git a/server/api/faxQueueReport/faxQueueReport.rpc.js b/server/api/faxQueueReport/faxQueueReport.rpc.js
index d55cb3d..418ba7b 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 _0xc971=['UpdateFaxQueueReport','update','lodash','util','moment','bluebird','randomstring','../../mysqldb','../../config/utils','../../config/logger','jayson/promise','client','request','info','FaxQueueReport,\x20%s,\x20%s','debug','stringify','error','code','message','request\x20sent','CreateFaxQueueReport','FaxQueueReport','create','body','options','raw','then','catch'];(function(_0x113b16,_0x1a2532){var _0x37e46d=function(_0x1acdc3){while(--_0x1acdc3){_0x113b16['push'](_0x113b16['shift']());}};_0x37e46d(++_0x1a2532);}(_0xc971,0x17b));var _0x1c97=function(_0xd1d19a,_0x1933f0){_0xd1d19a=_0xd1d19a-0x0;var _0x52a79d=_0xc971[_0xd1d19a];return _0x52a79d;};'use strict';var _=require(_0x1c97('0x0'));var util=require(_0x1c97('0x1'));var moment=require(_0x1c97('0x2'));var BPromise=require(_0x1c97('0x3'));var rs=require(_0x1c97('0x4'));var fs=require('fs');var Redis=require('ioredis');var db=require(_0x1c97('0x5'))['db'];var utils=require(_0x1c97('0x6'));var logger=require(_0x1c97('0x7'))('rpc');var config=require('../../config/environment');var jayson=require(_0x1c97('0x8'));var client=jayson[_0x1c97('0x9')]['http']({'port':0x232a});function respondWithRpcPromise(_0x4a03ec,_0x1bc56d,_0x29006a){return new BPromise(function(_0x58f7f0,_0x211dff){return client[_0x1c97('0xa')](_0x4a03ec,_0x29006a)['then'](function(_0x1806d8){logger[_0x1c97('0xb')](_0x1c97('0xc'),_0x1bc56d,'request\x20sent');logger[_0x1c97('0xd')]('FaxQueueReport,\x20%s,\x20%s,\x20%s',_0x1bc56d,'request\x20sent',JSON[_0x1c97('0xe')](_0x1806d8));if(_0x1806d8[_0x1c97('0xf')]){if(_0x1806d8['error'][_0x1c97('0x10')]===0x1f4){logger[_0x1c97('0xf')](_0x1c97('0xc'),_0x1bc56d,_0x1806d8[_0x1c97('0xf')]['message']);return _0x211dff(_0x1806d8[_0x1c97('0xf')][_0x1c97('0x11')]);}logger[_0x1c97('0xf')](_0x1c97('0xc'),_0x1bc56d,_0x1806d8[_0x1c97('0xf')][_0x1c97('0x11')]);return _0x58f7f0(_0x1806d8[_0x1c97('0xf')]['message']);}else{logger[_0x1c97('0xb')](_0x1c97('0xc'),_0x1bc56d,_0x1c97('0x12'));_0x58f7f0(_0x1806d8['result']['message']);}})['catch'](function(_0x59f8e4){logger[_0x1c97('0xf')](_0x1c97('0xc'),_0x1bc56d,_0x59f8e4);_0x211dff(_0x59f8e4);});});}exports[_0x1c97('0x13')]=function(_0x1431f4){var _0x575983=this;return new Promise(function(_0x403cbc,_0x90c291){return db[_0x1c97('0x14')][_0x1c97('0x15')](_0x1431f4[_0x1c97('0x16')],{'raw':_0x1431f4[_0x1c97('0x17')]?_0x1431f4['options'][_0x1c97('0x18')]===undefined?!![]:![]:!![]})[_0x1c97('0x19')](function(_0x343343){logger[_0x1c97('0xb')](_0x1c97('0x13'),_0x1431f4);logger[_0x1c97('0xd')](_0x1c97('0x13'),_0x1431f4,JSON[_0x1c97('0xe')](_0x343343));_0x403cbc(_0x343343);})[_0x1c97('0x1a')](function(_0x534ea3){logger['error'](_0x1c97('0x13'),_0x534ea3[_0x1c97('0x11')],_0x1431f4);_0x90c291(_0x575983[_0x1c97('0xf')](0x1f4,_0x534ea3['message']));});});};exports[_0x1c97('0x1b')]=function(_0x5924c1){var _0x164fbe=this;return new Promise(function(_0x510119,_0x1afb64){return db[_0x1c97('0x14')][_0x1c97('0x1c')](_0x5924c1[_0x1c97('0x16')],{'raw':_0x5924c1['options']?_0x5924c1[_0x1c97('0x17')][_0x1c97('0x18')]===undefined?!![]:![]:!![],'individualHooks':!![],'where':_0x5924c1[_0x1c97('0x17')]?_0x5924c1[_0x1c97('0x17')]['where']||null:null,'attributes':_0x5924c1[_0x1c97('0x17')]?_0x5924c1[_0x1c97('0x17')]['attributes']||null:null,'limit':_0x5924c1[_0x1c97('0x17')]?_0x5924c1['options']['limit']||null:null})[_0x1c97('0x19')](function(_0x314ddf){logger[_0x1c97('0xb')](_0x1c97('0x1b'),_0x5924c1);logger[_0x1c97('0xd')](_0x1c97('0x1b'),_0x5924c1,JSON[_0x1c97('0xe')](_0x314ddf));_0x510119(_0x314ddf);})[_0x1c97('0x1a')](function(_0x342eed){logger['error']('UpdateFaxQueueReport',_0x342eed[_0x1c97('0x11')],_0x5924c1);_0x1afb64(_0x164fbe[_0x1c97('0xf')](0x1f4,_0x342eed[_0x1c97('0x11')]));});});};
\ No newline at end of file
+var _0x842d=['bluebird','randomstring','ioredis','../../config/logger','rpc','../../config/environment','jayson/promise','client','http','then','info','request\x20sent','debug','FaxQueueReport,\x20%s,\x20%s,\x20%s','stringify','error','message','FaxQueueReport,\x20%s,\x20%s','FaxQueueReport','body','options','raw','CreateFaxQueueReport','UpdateFaxQueueReport','update','where','attributes','limit','catch','lodash','moment'];(function(_0x58fd8d,_0x3aea71){var _0x5c975b=function(_0x4ef743){while(--_0x4ef743){_0x58fd8d['push'](_0x58fd8d['shift']());}};_0x5c975b(++_0x3aea71);}(_0x842d,0x1ee));var _0xd842=function(_0x22a8c4,_0x51c09a){_0x22a8c4=_0x22a8c4-0x0;var _0x104c6d=_0x842d[_0x22a8c4];return _0x104c6d;};'use strict';var _=require(_0xd842('0x0'));var util=require('util');var moment=require(_0xd842('0x1'));var BPromise=require(_0xd842('0x2'));var rs=require(_0xd842('0x3'));var fs=require('fs');var Redis=require(_0xd842('0x4'));var db=require('../../mysqldb')['db'];var utils=require('../../config/utils');var logger=require(_0xd842('0x5'))(_0xd842('0x6'));var config=require(_0xd842('0x7'));var jayson=require(_0xd842('0x8'));var client=jayson[_0xd842('0x9')][_0xd842('0xa')]({'port':0x232a});function respondWithRpcPromise(_0x8a7818,_0x1ba775,_0xc709ab){return new BPromise(function(_0x3b9add,_0x4a7f31){return client['request'](_0x8a7818,_0xc709ab)[_0xd842('0xb')](function(_0x4da1e9){logger[_0xd842('0xc')]('FaxQueueReport,\x20%s,\x20%s',_0x1ba775,_0xd842('0xd'));logger[_0xd842('0xe')](_0xd842('0xf'),_0x1ba775,_0xd842('0xd'),JSON[_0xd842('0x10')](_0x4da1e9));if(_0x4da1e9[_0xd842('0x11')]){if(_0x4da1e9[_0xd842('0x11')]['code']===0x1f4){logger[_0xd842('0x11')]('FaxQueueReport,\x20%s,\x20%s',_0x1ba775,_0x4da1e9[_0xd842('0x11')][_0xd842('0x12')]);return _0x4a7f31(_0x4da1e9['error'][_0xd842('0x12')]);}logger[_0xd842('0x11')](_0xd842('0x13'),_0x1ba775,_0x4da1e9['error'][_0xd842('0x12')]);return _0x3b9add(_0x4da1e9[_0xd842('0x11')]['message']);}else{logger['info'](_0xd842('0x13'),_0x1ba775,_0xd842('0xd'));_0x3b9add(_0x4da1e9['result'][_0xd842('0x12')]);}})['catch'](function(_0x6c6697){logger[_0xd842('0x11')]('FaxQueueReport,\x20%s,\x20%s',_0x1ba775,_0x6c6697);_0x4a7f31(_0x6c6697);});});}exports['CreateFaxQueueReport']=function(_0x585dde){var _0x3a358f=this;return new Promise(function(_0x3f69e3,_0x27bd2a){return db[_0xd842('0x14')]['create'](_0x585dde[_0xd842('0x15')],{'raw':_0x585dde[_0xd842('0x16')]?_0x585dde['options'][_0xd842('0x17')]===undefined?!![]:![]:!![]})['then'](function(_0xc0ecdb){logger[_0xd842('0xc')](_0xd842('0x18'),_0x585dde);logger['debug'](_0xd842('0x18'),_0x585dde,JSON[_0xd842('0x10')](_0xc0ecdb));_0x3f69e3(_0xc0ecdb);})['catch'](function(_0x52bebf){logger['error']('CreateFaxQueueReport',_0x52bebf[_0xd842('0x12')],_0x585dde);_0x27bd2a(_0x3a358f['error'](0x1f4,_0x52bebf['message']));});});};exports[_0xd842('0x19')]=function(_0x5e3b12){var _0x3dfc1f=this;return new Promise(function(_0x2616c0,_0x33d257){return db[_0xd842('0x14')][_0xd842('0x1a')](_0x5e3b12[_0xd842('0x15')],{'raw':_0x5e3b12[_0xd842('0x16')]?_0x5e3b12[_0xd842('0x16')]['raw']===undefined?!![]:![]:!![],'individualHooks':!![],'where':_0x5e3b12[_0xd842('0x16')]?_0x5e3b12['options'][_0xd842('0x1b')]||null:null,'attributes':_0x5e3b12[_0xd842('0x16')]?_0x5e3b12[_0xd842('0x16')][_0xd842('0x1c')]||null:null,'limit':_0x5e3b12[_0xd842('0x16')]?_0x5e3b12[_0xd842('0x16')][_0xd842('0x1d')]||null:null})[_0xd842('0xb')](function(_0x4a9b3b){logger[_0xd842('0xc')]('UpdateFaxQueueReport',_0x5e3b12);logger[_0xd842('0xe')](_0xd842('0x19'),_0x5e3b12,JSON[_0xd842('0x10')](_0x4a9b3b));_0x2616c0(_0x4a9b3b);})[_0xd842('0x1e')](function(_0x22f2d3){logger[_0xd842('0x11')](_0xd842('0x19'),_0x22f2d3[_0xd842('0x12')],_0x5e3b12);_0x33d257(_0x3dfc1f[_0xd842('0x11')](0x1f4,_0x22f2d3[_0xd842('0x12')]));});});};
\ No newline at end of file
diff --git a/server/api/faxQueueReport/index.js b/server/api/faxQueueReport/index.js
index 33aa00b..39f27ee 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 _0xece4=['put','update','destroy','exports','multer','util','path','connect-timeout','express','Router','../../components/interaction/service','./faxQueueReport.controller','get','isAuthenticated','index','/describe','/:id','show','post','create'];(function(_0x25d73a,_0x16cd99){var _0x2a2475=function(_0x2fcab0){while(--_0x2fcab0){_0x25d73a['push'](_0x25d73a['shift']());}};_0x2a2475(++_0x16cd99);}(_0xece4,0x1a8));var _0x4ece=function(_0x1f936c,_0x193245){_0x1f936c=_0x1f936c-0x0;var _0x5e1508=_0xece4[_0x1f936c];return _0x5e1508;};'use strict';var multer=require(_0x4ece('0x0'));var util=require(_0x4ece('0x1'));var path=require(_0x4ece('0x2'));var timeout=require(_0x4ece('0x3'));var express=require(_0x4ece('0x4'));var router=express[_0x4ece('0x5')]();var auth=require('../../components/auth/service');var interaction=require(_0x4ece('0x6'));var config=require('../../config/environment');var controller=require(_0x4ece('0x7'));router[_0x4ece('0x8')]('/',auth[_0x4ece('0x9')](),controller[_0x4ece('0xa')]);router[_0x4ece('0x8')](_0x4ece('0xb'),auth[_0x4ece('0x9')](),controller['describe']);router[_0x4ece('0x8')](_0x4ece('0xc'),auth[_0x4ece('0x9')](),controller[_0x4ece('0xd')]);router[_0x4ece('0xe')]('/',auth[_0x4ece('0x9')](),controller[_0x4ece('0xf')]);router[_0x4ece('0x10')]('/:id',auth[_0x4ece('0x9')](),controller[_0x4ece('0x11')]);router['delete'](_0x4ece('0xc'),auth[_0x4ece('0x9')](),controller[_0x4ece('0x12')]);module[_0x4ece('0x13')]=router;
\ No newline at end of file
+var _0x5e7e=['connect-timeout','express','../../components/auth/service','../../components/interaction/service','../../config/environment','./faxQueueReport.controller','get','isAuthenticated','index','/describe','describe','/:id','show','put','destroy','util','path'];(function(_0x5626a9,_0x9e64ed){var _0x46fe57=function(_0x4bfd99){while(--_0x4bfd99){_0x5626a9['push'](_0x5626a9['shift']());}};_0x46fe57(++_0x9e64ed);}(_0x5e7e,0x141));var _0xe5e7=function(_0x48740b,_0x893fd8){_0x48740b=_0x48740b-0x0;var _0xb868f2=_0x5e7e[_0x48740b];return _0xb868f2;};'use strict';var multer=require('multer');var util=require(_0xe5e7('0x0'));var path=require(_0xe5e7('0x1'));var timeout=require(_0xe5e7('0x2'));var express=require(_0xe5e7('0x3'));var router=express['Router']();var auth=require(_0xe5e7('0x4'));var interaction=require(_0xe5e7('0x5'));var config=require(_0xe5e7('0x6'));var controller=require(_0xe5e7('0x7'));router[_0xe5e7('0x8')]('/',auth[_0xe5e7('0x9')](),controller[_0xe5e7('0xa')]);router[_0xe5e7('0x8')](_0xe5e7('0xb'),auth[_0xe5e7('0x9')](),controller[_0xe5e7('0xc')]);router[_0xe5e7('0x8')](_0xe5e7('0xd'),auth['isAuthenticated'](),controller[_0xe5e7('0xe')]);router['post']('/',auth[_0xe5e7('0x9')](),controller['create']);router[_0xe5e7('0xf')]('/:id',auth[_0xe5e7('0x9')](),controller['update']);router['delete']('/:id',auth[_0xe5e7('0x9')](),controller[_0xe5e7('0x10')]);module['exports']=router;
\ No newline at end of file
diff --git a/server/api/faxTransferReport/faxTransferReport.attributes.js b/server/api/faxTransferReport/faxTransferReport.attributes.js
index 38f4784..0ebffa2 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 _0x2b28=['agent','queue','NOW','moment','sequelize','exports','ENUM','account'];(function(_0x2df507,_0x553862){var _0x1f7167=function(_0x11319e){while(--_0x11319e){_0x2df507['push'](_0x2df507['shift']());}};_0x1f7167(++_0x553862);}(_0x2b28,0xcb));var _0x82b2=function(_0x3fe6df,_0x5a04d4){_0x3fe6df=_0x3fe6df-0x0;var _0x372a0e=_0x2b28[_0x3fe6df];return _0x372a0e;};'use strict';var moment=require(_0x82b2('0x0'));var Sequelize=require(_0x82b2('0x1'));module[_0x82b2('0x2')]={'uniqueid':{'type':Sequelize['STRING'],'allowNull':![]},'type':{'type':Sequelize[_0x82b2('0x3')](_0x82b2('0x4'),_0x82b2('0x5'),_0x82b2('0x6')),'allowNull':![],'defaultValue':'queue'},'transferredAt':{'type':Sequelize['DATE'],'allowNull':![],'defaultValue':Sequelize[_0x82b2('0x7')]}};
\ No newline at end of file
+var _0x9047=['account','agent','queue','DATE','NOW','sequelize','exports','ENUM'];(function(_0x5ce8b9,_0x5cded8){var _0xe34be0=function(_0xe3d4e5){while(--_0xe3d4e5){_0x5ce8b9['push'](_0x5ce8b9['shift']());}};_0xe34be0(++_0x5cded8);}(_0x9047,0x115));var _0x7904=function(_0x1b69f0,_0x3ca093){_0x1b69f0=_0x1b69f0-0x0;var _0x55ff4e=_0x9047[_0x1b69f0];return _0x55ff4e;};'use strict';var moment=require('moment');var Sequelize=require(_0x7904('0x0'));module[_0x7904('0x1')]={'uniqueid':{'type':Sequelize['STRING'],'allowNull':![]},'type':{'type':Sequelize[_0x7904('0x2')](_0x7904('0x3'),_0x7904('0x4'),_0x7904('0x5')),'allowNull':![],'defaultValue':_0x7904('0x5')},'transferredAt':{'type':Sequelize[_0x7904('0x6')],'allowNull':![],'defaultValue':Sequelize[_0x7904('0x7')]}};
\ No newline at end of file
diff --git a/server/api/faxTransferReport/faxTransferReport.controller.js b/server/api/faxTransferReport/faxTransferReport.controller.js
index 1257bc2..b7e81c0 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 _0xb34f=['save','then','destroy','error','name','index','fieldName','type','model','query','filters','intersection','attributes','fields','length','hasOwnProperty','nolimit','limit','order','sort','where','pick','filter','merge','map','options','FaxTransferReport','includeAll','include','findAll','rows','catch','show','params','keys','rawAttributes','find','create','body','update','describe','eml-format','zip-dir','fast-json-patch','request-promise','moment','bluebird','mustache','util','path','sox','to-csv','ejs','lodash','crypto','desk.js','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/logger','api','../../config/utils','../../config/environment','../../mysqldb','sendStatus','status','json','count','offset','set','Content-Range','apply','reject'];(function(_0x4b0e4a,_0x419b6f){var _0x48ab94=function(_0x2d6f4d){while(--_0x2d6f4d){_0x4b0e4a['push'](_0x4b0e4a['shift']());}};_0x48ab94(++_0x419b6f);}(_0xb34f,0x155));var _0xfb34=function(_0x25426e,_0x469fc1){_0x25426e=_0x25426e-0x0;var _0x5e52d8=_0xb34f[_0x25426e];return _0x5e52d8;};'use strict';var pdf=require('html-pdf');var emlformat=require(_0xfb34('0x0'));var rimraf=require('rimraf');var zipdir=require(_0xfb34('0x1'));var jsonpatch=require(_0xfb34('0x2'));var rp=require(_0xfb34('0x3'));var moment=require(_0xfb34('0x4'));var BPromise=require(_0xfb34('0x5'));var Mustache=require(_0xfb34('0x6'));var util=require(_0xfb34('0x7'));var path=require(_0xfb34('0x8'));var sox=require(_0xfb34('0x9'));var csv=require(_0xfb34('0xa'));var ejs=require(_0xfb34('0xb'));var fs=require('fs');var _=require(_0xfb34('0xc'));var squel=require('squel');var crypto=require(_0xfb34('0xd'));var jsforce=require('jsforce');var deskjs=require(_0xfb34('0xe'));var toCsv=require(_0xfb34('0xa'));var querystring=require('querystring');var Papa=require(_0xfb34('0xf'));var Redis=require(_0xfb34('0x10'));var authService=require(_0xfb34('0x11'));var qs=require(_0xfb34('0x12'));var as=require(_0xfb34('0x13'));var hardwareService=require('../../config/license/hardware');var logger=require(_0xfb34('0x14'))(_0xfb34('0x15'));var utils=require(_0xfb34('0x16'));var config=require(_0xfb34('0x17'));var db=require(_0xfb34('0x18'))['db'];function respondWithStatusCode(_0x261391,_0x4af9d2){_0x4af9d2=_0x4af9d2||0xcc;return function(_0x3b56f0){if(_0x3b56f0){return _0x261391[_0xfb34('0x19')](_0x4af9d2);}return _0x261391[_0xfb34('0x1a')](_0x4af9d2)['end']();};}function respondWithResult(_0x485ac3,_0x2df544){_0x2df544=_0x2df544||0xc8;return function(_0x26ad37){if(_0x26ad37){return _0x485ac3['status'](_0x2df544)[_0xfb34('0x1b')](_0x26ad37);}};}function respondWithFilteredResult(_0x22a509,_0x575530){return function(_0x11f037){if(_0x11f037){var _0x5f4f34=_0x11f037[_0xfb34('0x1c')],_0x2dd554=_0x575530[_0xfb34('0x1d')],_0x44244d=_0x575530[_0xfb34('0x1d')]+_0x575530['limit'],_0x739f6c;if(_0x44244d>=_0x5f4f34){_0x44244d=_0x5f4f34;_0x739f6c=0xc8;}else{_0x739f6c=0xce;}_0x22a509[_0xfb34('0x1a')](_0x739f6c);return _0x22a509[_0xfb34('0x1e')](_0xfb34('0x1f'),_0x2dd554+'-'+_0x44244d+'/'+_0x5f4f34)[_0xfb34('0x1b')](_0x11f037);}return null;};}function patchUpdates(_0x26cc2c){return function(_0x34c31a){try{jsonpatch[_0xfb34('0x20')](_0x34c31a,_0x26cc2c,!![]);}catch(_0x297371){return BPromise[_0xfb34('0x21')](_0x297371);}return _0x34c31a[_0xfb34('0x22')]();};}function saveUpdates(_0x51c113,_0x19f194){return function(_0x5798e3){if(_0x5798e3){return _0x5798e3['update'](_0x51c113)[_0xfb34('0x23')](function(_0x1489c1){return _0x1489c1;});}return null;};}function removeEntity(_0x5b7bae,_0x3b75a0){return function(_0x52672e){if(_0x52672e){return _0x52672e[_0xfb34('0x24')]()['then'](function(){_0x5b7bae[_0xfb34('0x1a')](0xcc)['end']();});}};}function handleEntityNotFound(_0x2177ab,_0x4ff440){return function(_0x48d7bb){if(!_0x48d7bb){_0x2177ab[_0xfb34('0x19')](0x194);}return _0x48d7bb;};}function handleError(_0x13aded,_0x1ce3f7){_0x1ce3f7=_0x1ce3f7||0x1f4;return function(_0x59118a){logger[_0xfb34('0x25')](_0x59118a['stack']);if(_0x59118a[_0xfb34('0x26')]){delete _0x59118a[_0xfb34('0x26')];}_0x13aded[_0xfb34('0x1a')](_0x1ce3f7)['send'](_0x59118a);};}exports[_0xfb34('0x27')]=function(_0x49f12e,_0x4a2471){var _0xc3bf66={},_0x3474b6={},_0x2bfecf={'count':0x0,'rows':[]};var _0x21ffa1=_['map'](db['FaxTransferReport']['rawAttributes'],function(_0x19f771){return{'name':_0x19f771[_0xfb34('0x28')],'type':_0x19f771[_0xfb34('0x29')]['key']};});_0x3474b6[_0xfb34('0x2a')]=_['map'](_0x21ffa1,_0xfb34('0x26'));_0x3474b6[_0xfb34('0x2b')]=_['keys'](_0x49f12e[_0xfb34('0x2b')]);_0x3474b6[_0xfb34('0x2c')]=_[_0xfb34('0x2d')](_0x3474b6[_0xfb34('0x2a')],_0x3474b6[_0xfb34('0x2b')]);_0xc3bf66[_0xfb34('0x2e')]=_[_0xfb34('0x2d')](_0x3474b6[_0xfb34('0x2a')],qs[_0xfb34('0x2f')](_0x49f12e[_0xfb34('0x2b')]['fields']));_0xc3bf66[_0xfb34('0x2e')]=_0xc3bf66[_0xfb34('0x2e')][_0xfb34('0x30')]?_0xc3bf66['attributes']:_0x3474b6[_0xfb34('0x2a')];if(!_0x49f12e[_0xfb34('0x2b')][_0xfb34('0x31')](_0xfb34('0x32'))){_0xc3bf66[_0xfb34('0x33')]=qs[_0xfb34('0x33')](_0x49f12e['query'][_0xfb34('0x33')]);_0xc3bf66[_0xfb34('0x1d')]=qs[_0xfb34('0x1d')](_0x49f12e['query'][_0xfb34('0x1d')]);}_0xc3bf66[_0xfb34('0x34')]=qs[_0xfb34('0x35')](_0x49f12e[_0xfb34('0x2b')][_0xfb34('0x35')]);_0xc3bf66[_0xfb34('0x36')]=qs[_0xfb34('0x2c')](_[_0xfb34('0x37')](_0x49f12e[_0xfb34('0x2b')],_0x3474b6[_0xfb34('0x2c')]));if(_0x49f12e[_0xfb34('0x2b')][_0xfb34('0x38')]){_0xc3bf66['where']=_[_0xfb34('0x39')](_0xc3bf66[_0xfb34('0x36')],{'$or':_[_0xfb34('0x3a')](_0x21ffa1,function(_0xe5aea2){if(_0xe5aea2[_0xfb34('0x29')]!=='VIRTUAL'){var _0x27af2a={};_0x27af2a[_0xe5aea2[_0xfb34('0x26')]]={'$like':'%'+_0x49f12e[_0xfb34('0x2b')][_0xfb34('0x38')]+'%'};return _0x27af2a;}})});}_0xc3bf66=_[_0xfb34('0x39')]({},_0xc3bf66,_0x49f12e[_0xfb34('0x3b')]);var _0x13c374={'where':_0xc3bf66[_0xfb34('0x36')]};return db[_0xfb34('0x3c')][_0xfb34('0x1c')](_0x13c374)[_0xfb34('0x23')](function(_0x361d8d){_0x2bfecf['count']=_0x361d8d;if(_0x49f12e[_0xfb34('0x2b')][_0xfb34('0x3d')]){_0xc3bf66[_0xfb34('0x3e')]=[{'all':!![]}];}return db[_0xfb34('0x3c')][_0xfb34('0x3f')](_0xc3bf66);})[_0xfb34('0x23')](function(_0x34ba31){_0x2bfecf[_0xfb34('0x40')]=_0x34ba31;return _0x2bfecf;})[_0xfb34('0x23')](respondWithFilteredResult(_0x4a2471,_0xc3bf66))[_0xfb34('0x41')](handleError(_0x4a2471,null));};exports[_0xfb34('0x42')]=function(_0x3d68ab,_0xcdf267){var _0x2b464b={'raw':!![],'where':{'id':_0x3d68ab[_0xfb34('0x43')]['id']}},_0xfb53eb={};_0xfb53eb[_0xfb34('0x2a')]=_[_0xfb34('0x44')](db['FaxTransferReport'][_0xfb34('0x45')]);_0xfb53eb[_0xfb34('0x2b')]=_['keys'](_0x3d68ab[_0xfb34('0x2b')]);_0xfb53eb[_0xfb34('0x2c')]=_['intersection'](_0xfb53eb[_0xfb34('0x2a')],_0xfb53eb[_0xfb34('0x2b')]);_0x2b464b['attributes']=_['intersection'](_0xfb53eb[_0xfb34('0x2a')],qs[_0xfb34('0x2f')](_0x3d68ab[_0xfb34('0x2b')][_0xfb34('0x2f')]));_0x2b464b['attributes']=_0x2b464b[_0xfb34('0x2e')][_0xfb34('0x30')]?_0x2b464b[_0xfb34('0x2e')]:_0xfb53eb[_0xfb34('0x2a')];if(_0x3d68ab['query'][_0xfb34('0x3d')]){_0x2b464b[_0xfb34('0x3e')]=[{'all':!![]}];}_0x2b464b=_[_0xfb34('0x39')]({},_0x2b464b,_0x3d68ab[_0xfb34('0x3b')]);return db['FaxTransferReport'][_0xfb34('0x46')](_0x2b464b)[_0xfb34('0x23')](handleEntityNotFound(_0xcdf267,null))[_0xfb34('0x23')](respondWithResult(_0xcdf267,null))[_0xfb34('0x41')](handleError(_0xcdf267,null));};exports[_0xfb34('0x47')]=function(_0x3227fd,_0x43f9c3){return db[_0xfb34('0x3c')][_0xfb34('0x47')](_0x3227fd[_0xfb34('0x48')],{})['then'](respondWithResult(_0x43f9c3,0xc9))[_0xfb34('0x41')](handleError(_0x43f9c3,null));};exports[_0xfb34('0x49')]=function(_0x25f3e0,_0x5432c9){if(_0x25f3e0[_0xfb34('0x48')]['id']){delete _0x25f3e0[_0xfb34('0x48')]['id'];}return db['FaxTransferReport'][_0xfb34('0x46')]({'where':{'id':_0x25f3e0['params']['id']}})[_0xfb34('0x23')](handleEntityNotFound(_0x5432c9,null))[_0xfb34('0x23')](saveUpdates(_0x25f3e0['body'],null))[_0xfb34('0x23')](respondWithResult(_0x5432c9,null))[_0xfb34('0x41')](handleError(_0x5432c9,null));};exports[_0xfb34('0x24')]=function(_0x175238,_0x4c7aec){return db[_0xfb34('0x3c')][_0xfb34('0x46')]({'where':{'id':_0x175238[_0xfb34('0x43')]['id']}})['then'](handleEntityNotFound(_0x4c7aec,null))['then'](removeEntity(_0x4c7aec,null))[_0xfb34('0x41')](handleError(_0x4c7aec,null));};exports[_0xfb34('0x4a')]=function(_0x2da1ef,_0x8f540e){return db['FaxTransferReport'][_0xfb34('0x4a')]()[_0xfb34('0x23')](respondWithResult(_0x8f540e,null))[_0xfb34('0x41')](handleError(_0x8f540e,null));};
\ No newline at end of file
+var _0x6a72=['filters','intersection','fields','attributes','length','hasOwnProperty','nolimit','order','sort','where','pick','merge','type','VIRTUAL','filter','options','includeAll','include','findAll','catch','show','params','find','body','describe','rimraf','zip-dir','moment','bluebird','mustache','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','sendStatus','status','end','count','offset','limit','reject','save','update','destroy','then','error','name','send','map','FaxTransferReport','rawAttributes','fieldName','key','model','query','keys'];(function(_0x15bca7,_0x2112ea){var _0x445cc2=function(_0x3ced2c){while(--_0x3ced2c){_0x15bca7['push'](_0x15bca7['shift']());}};_0x445cc2(++_0x2112ea);}(_0x6a72,0xa3));var _0x26a7=function(_0x6ec1fe,_0x3e820c){_0x6ec1fe=_0x6ec1fe-0x0;var _0x16d021=_0x6a72[_0x6ec1fe];return _0x16d021;};'use strict';var pdf=require('html-pdf');var emlformat=require('eml-format');var rimraf=require(_0x26a7('0x0'));var zipdir=require(_0x26a7('0x1'));var jsonpatch=require('fast-json-patch');var rp=require('request-promise');var moment=require(_0x26a7('0x2'));var BPromise=require(_0x26a7('0x3'));var Mustache=require(_0x26a7('0x4'));var util=require('util');var path=require('path');var sox=require('sox');var csv=require(_0x26a7('0x5'));var ejs=require(_0x26a7('0x6'));var fs=require('fs');var _=require(_0x26a7('0x7'));var squel=require(_0x26a7('0x8'));var crypto=require(_0x26a7('0x9'));var jsforce=require(_0x26a7('0xa'));var deskjs=require(_0x26a7('0xb'));var toCsv=require(_0x26a7('0x5'));var querystring=require(_0x26a7('0xc'));var Papa=require('papaparse');var Redis=require(_0x26a7('0xd'));var authService=require(_0x26a7('0xe'));var qs=require(_0x26a7('0xf'));var as=require(_0x26a7('0x10'));var hardwareService=require(_0x26a7('0x11'));var logger=require(_0x26a7('0x12'))(_0x26a7('0x13'));var utils=require(_0x26a7('0x14'));var config=require(_0x26a7('0x15'));var db=require('../../mysqldb')['db'];function respondWithStatusCode(_0x476c54,_0x32a442){_0x32a442=_0x32a442||0xcc;return function(_0x1b8b48){if(_0x1b8b48){return _0x476c54[_0x26a7('0x16')](_0x32a442);}return _0x476c54[_0x26a7('0x17')](_0x32a442)[_0x26a7('0x18')]();};}function respondWithResult(_0x445117,_0x5d3e41){_0x5d3e41=_0x5d3e41||0xc8;return function(_0x35c0c2){if(_0x35c0c2){return _0x445117[_0x26a7('0x17')](_0x5d3e41)['json'](_0x35c0c2);}};}function respondWithFilteredResult(_0x71c7a2,_0x4ec873){return function(_0x38d423){if(_0x38d423){var _0x361476=_0x38d423[_0x26a7('0x19')],_0x57e889=_0x4ec873[_0x26a7('0x1a')],_0xf129d7=_0x4ec873[_0x26a7('0x1a')]+_0x4ec873[_0x26a7('0x1b')],_0x1b4ff6;if(_0xf129d7>=_0x361476){_0xf129d7=_0x361476;_0x1b4ff6=0xc8;}else{_0x1b4ff6=0xce;}_0x71c7a2[_0x26a7('0x17')](_0x1b4ff6);return _0x71c7a2['set']('Content-Range',_0x57e889+'-'+_0xf129d7+'/'+_0x361476)['json'](_0x38d423);}return null;};}function patchUpdates(_0x1f71ec){return function(_0x54a064){try{jsonpatch['apply'](_0x54a064,_0x1f71ec,!![]);}catch(_0x17c930){return BPromise[_0x26a7('0x1c')](_0x17c930);}return _0x54a064[_0x26a7('0x1d')]();};}function saveUpdates(_0x2ecc37,_0x7f0d8b){return function(_0x55f4b5){if(_0x55f4b5){return _0x55f4b5[_0x26a7('0x1e')](_0x2ecc37)['then'](function(_0x4e4ec4){return _0x4e4ec4;});}return null;};}function removeEntity(_0x18b5e8,_0x270d29){return function(_0x377b89){if(_0x377b89){return _0x377b89[_0x26a7('0x1f')]()[_0x26a7('0x20')](function(){_0x18b5e8[_0x26a7('0x17')](0xcc)[_0x26a7('0x18')]();});}};}function handleEntityNotFound(_0x2ff89e,_0x518cfb){return function(_0x571d1f){if(!_0x571d1f){_0x2ff89e[_0x26a7('0x16')](0x194);}return _0x571d1f;};}function handleError(_0x2af95d,_0x471352){_0x471352=_0x471352||0x1f4;return function(_0x29cf11){logger[_0x26a7('0x21')](_0x29cf11['stack']);if(_0x29cf11[_0x26a7('0x22')]){delete _0x29cf11[_0x26a7('0x22')];}_0x2af95d['status'](_0x471352)[_0x26a7('0x23')](_0x29cf11);};}exports['index']=function(_0x289ea0,_0x27c3c6){var _0x475b75={},_0x1b3d68={},_0x1e614b={'count':0x0,'rows':[]};var _0x49c853=_[_0x26a7('0x24')](db[_0x26a7('0x25')][_0x26a7('0x26')],function(_0xd775b1){return{'name':_0xd775b1[_0x26a7('0x27')],'type':_0xd775b1['type'][_0x26a7('0x28')]};});_0x1b3d68[_0x26a7('0x29')]=_[_0x26a7('0x24')](_0x49c853,_0x26a7('0x22'));_0x1b3d68[_0x26a7('0x2a')]=_[_0x26a7('0x2b')](_0x289ea0[_0x26a7('0x2a')]);_0x1b3d68[_0x26a7('0x2c')]=_[_0x26a7('0x2d')](_0x1b3d68[_0x26a7('0x29')],_0x1b3d68[_0x26a7('0x2a')]);_0x475b75['attributes']=_[_0x26a7('0x2d')](_0x1b3d68[_0x26a7('0x29')],qs['fields'](_0x289ea0[_0x26a7('0x2a')][_0x26a7('0x2e')]));_0x475b75[_0x26a7('0x2f')]=_0x475b75[_0x26a7('0x2f')][_0x26a7('0x30')]?_0x475b75[_0x26a7('0x2f')]:_0x1b3d68[_0x26a7('0x29')];if(!_0x289ea0[_0x26a7('0x2a')][_0x26a7('0x31')](_0x26a7('0x32'))){_0x475b75[_0x26a7('0x1b')]=qs[_0x26a7('0x1b')](_0x289ea0[_0x26a7('0x2a')][_0x26a7('0x1b')]);_0x475b75[_0x26a7('0x1a')]=qs['offset'](_0x289ea0['query'][_0x26a7('0x1a')]);}_0x475b75[_0x26a7('0x33')]=qs['sort'](_0x289ea0[_0x26a7('0x2a')][_0x26a7('0x34')]);_0x475b75[_0x26a7('0x35')]=qs[_0x26a7('0x2c')](_[_0x26a7('0x36')](_0x289ea0[_0x26a7('0x2a')],_0x1b3d68[_0x26a7('0x2c')]));if(_0x289ea0[_0x26a7('0x2a')]['filter']){_0x475b75[_0x26a7('0x35')]=_[_0x26a7('0x37')](_0x475b75['where'],{'$or':_['map'](_0x49c853,function(_0x246312){if(_0x246312[_0x26a7('0x38')]!==_0x26a7('0x39')){var _0x192242={};_0x192242[_0x246312[_0x26a7('0x22')]]={'$like':'%'+_0x289ea0['query'][_0x26a7('0x3a')]+'%'};return _0x192242;}})});}_0x475b75=_[_0x26a7('0x37')]({},_0x475b75,_0x289ea0[_0x26a7('0x3b')]);var _0x482b82={'where':_0x475b75[_0x26a7('0x35')]};return db[_0x26a7('0x25')][_0x26a7('0x19')](_0x482b82)['then'](function(_0x357791){_0x1e614b[_0x26a7('0x19')]=_0x357791;if(_0x289ea0['query'][_0x26a7('0x3c')]){_0x475b75[_0x26a7('0x3d')]=[{'all':!![]}];}return db['FaxTransferReport'][_0x26a7('0x3e')](_0x475b75);})[_0x26a7('0x20')](function(_0x2b61b5){_0x1e614b['rows']=_0x2b61b5;return _0x1e614b;})['then'](respondWithFilteredResult(_0x27c3c6,_0x475b75))[_0x26a7('0x3f')](handleError(_0x27c3c6,null));};exports[_0x26a7('0x40')]=function(_0x59a183,_0x39b66d){var _0x37ef9a={'raw':!![],'where':{'id':_0x59a183[_0x26a7('0x41')]['id']}},_0x53c6ff={};_0x53c6ff['model']=_[_0x26a7('0x2b')](db[_0x26a7('0x25')]['rawAttributes']);_0x53c6ff[_0x26a7('0x2a')]=_[_0x26a7('0x2b')](_0x59a183[_0x26a7('0x2a')]);_0x53c6ff[_0x26a7('0x2c')]=_[_0x26a7('0x2d')](_0x53c6ff[_0x26a7('0x29')],_0x53c6ff[_0x26a7('0x2a')]);_0x37ef9a[_0x26a7('0x2f')]=_[_0x26a7('0x2d')](_0x53c6ff[_0x26a7('0x29')],qs[_0x26a7('0x2e')](_0x59a183[_0x26a7('0x2a')][_0x26a7('0x2e')]));_0x37ef9a[_0x26a7('0x2f')]=_0x37ef9a[_0x26a7('0x2f')]['length']?_0x37ef9a['attributes']:_0x53c6ff[_0x26a7('0x29')];if(_0x59a183[_0x26a7('0x2a')]['includeAll']){_0x37ef9a[_0x26a7('0x3d')]=[{'all':!![]}];}_0x37ef9a=_[_0x26a7('0x37')]({},_0x37ef9a,_0x59a183['options']);return db[_0x26a7('0x25')][_0x26a7('0x42')](_0x37ef9a)[_0x26a7('0x20')](handleEntityNotFound(_0x39b66d,null))[_0x26a7('0x20')](respondWithResult(_0x39b66d,null))[_0x26a7('0x3f')](handleError(_0x39b66d,null));};exports['create']=function(_0x6eb48c,_0x569426){return db[_0x26a7('0x25')]['create'](_0x6eb48c[_0x26a7('0x43')],{})['then'](respondWithResult(_0x569426,0xc9))['catch'](handleError(_0x569426,null));};exports[_0x26a7('0x1e')]=function(_0x1b4fc1,_0x1656a6){if(_0x1b4fc1[_0x26a7('0x43')]['id']){delete _0x1b4fc1[_0x26a7('0x43')]['id'];}return db[_0x26a7('0x25')]['find']({'where':{'id':_0x1b4fc1[_0x26a7('0x41')]['id']}})[_0x26a7('0x20')](handleEntityNotFound(_0x1656a6,null))[_0x26a7('0x20')](saveUpdates(_0x1b4fc1[_0x26a7('0x43')],null))[_0x26a7('0x20')](respondWithResult(_0x1656a6,null))[_0x26a7('0x3f')](handleError(_0x1656a6,null));};exports[_0x26a7('0x1f')]=function(_0x3bff63,_0x2ae97b){return db[_0x26a7('0x25')][_0x26a7('0x42')]({'where':{'id':_0x3bff63['params']['id']}})[_0x26a7('0x20')](handleEntityNotFound(_0x2ae97b,null))[_0x26a7('0x20')](removeEntity(_0x2ae97b,null))[_0x26a7('0x3f')](handleError(_0x2ae97b,null));};exports[_0x26a7('0x44')]=function(_0x1dde90,_0x1f3f7c){return db[_0x26a7('0x25')][_0x26a7('0x44')]()['then'](respondWithResult(_0x1f3f7c,null))[_0x26a7('0x3f')](handleError(_0x1f3f7c,null));};
\ No newline at end of file
diff --git a/server/api/faxTransferReport/faxTransferReport.model.js b/server/api/faxTransferReport/faxTransferReport.model.js
index 7543b28..5603d3a 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 _0x5ba4=['rimraf','../../config/environment','FaxTransferReport','uniqueid','lodash','util','../../config/logger','api','path'];(function(_0x502c7d,_0x2f1285){var _0x30b7ed=function(_0x2d92f3){while(--_0x2d92f3){_0x502c7d['push'](_0x502c7d['shift']());}};_0x30b7ed(++_0x2f1285);}(_0x5ba4,0x136));var _0x45ba=function(_0x5bd426,_0x4878e5){_0x5bd426=_0x5bd426-0x0;var _0x23a7eb=_0x5ba4[_0x5bd426];return _0x23a7eb;};'use strict';var _=require(_0x45ba('0x0'));var util=require(_0x45ba('0x1'));var logger=require(_0x45ba('0x2'))(_0x45ba('0x3'));var moment=require('moment');var BPromise=require('bluebird');var rp=require('request-promise');var fs=require('fs');var path=require(_0x45ba('0x4'));var rimraf=require(_0x45ba('0x5'));var config=require(_0x45ba('0x6'));var attributes=require('./faxTransferReport.attributes');module['exports']=function(_0x5c0f46,_0xbc2986){return _0x5c0f46['define'](_0x45ba('0x7'),attributes,{'tableName':'report_fax_transfer','paranoid':![],'indexes':[{'name':_0x45ba('0x8'),'fields':['uniqueid']}],'timestamps':!![]});};
\ No newline at end of file
+var _0x74d0=['../../config/environment','./faxTransferReport.attributes','define','uniqueid','lodash','util','../../config/logger','api','bluebird','request-promise','rimraf'];(function(_0x1d819f,_0x3456c7){var _0x40c01d=function(_0x29ab93){while(--_0x29ab93){_0x1d819f['push'](_0x1d819f['shift']());}};_0x40c01d(++_0x3456c7);}(_0x74d0,0x88));var _0x074d=function(_0x5b561d,_0x422b7c){_0x5b561d=_0x5b561d-0x0;var _0x431060=_0x74d0[_0x5b561d];return _0x431060;};'use strict';var _=require(_0x074d('0x0'));var util=require(_0x074d('0x1'));var logger=require(_0x074d('0x2'))(_0x074d('0x3'));var moment=require('moment');var BPromise=require(_0x074d('0x4'));var rp=require(_0x074d('0x5'));var fs=require('fs');var path=require('path');var rimraf=require(_0x074d('0x6'));var config=require(_0x074d('0x7'));var attributes=require(_0x074d('0x8'));module['exports']=function(_0x125386,_0x511095){return _0x125386[_0x074d('0x9')]('FaxTransferReport',attributes,{'tableName':'report_fax_transfer','paranoid':![],'indexes':[{'name':_0x074d('0xa'),'fields':[_0x074d('0xa')]}],'timestamps':!![]});};
\ No newline at end of file
diff --git a/server/api/faxTransferReport/faxTransferReport.rpc.js b/server/api/faxTransferReport/faxTransferReport.rpc.js
index 533d9bb..41faed7 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 _0x883b=['http','request','then','FaxTransferReport,\x20%s,\x20%s','debug','FaxTransferReport,\x20%s,\x20%s,\x20%s','request\x20sent','stringify','error','message','info','result','catch','lodash','util','moment','ioredis','../../mysqldb','../../config/utils','jayson/promise','client'];(function(_0x278d73,_0xb20d63){var _0x31ca5c=function(_0x3355d5){while(--_0x3355d5){_0x278d73['push'](_0x278d73['shift']());}};_0x31ca5c(++_0xb20d63);}(_0x883b,0x109));var _0xb883=function(_0x3dd15e,_0x1f0015){_0x3dd15e=_0x3dd15e-0x0;var _0x231fd0=_0x883b[_0x3dd15e];return _0x231fd0;};'use strict';var _=require(_0xb883('0x0'));var util=require(_0xb883('0x1'));var moment=require(_0xb883('0x2'));var BPromise=require('bluebird');var rs=require('randomstring');var fs=require('fs');var Redis=require(_0xb883('0x3'));var db=require(_0xb883('0x4'))['db'];var utils=require(_0xb883('0x5'));var logger=require('../../config/logger')('rpc');var config=require('../../config/environment');var jayson=require(_0xb883('0x6'));var client=jayson[_0xb883('0x7')][_0xb883('0x8')]({'port':0x232a});function respondWithRpcPromise(_0x2e647f,_0x33d1a3,_0x3ed23c){return new BPromise(function(_0x1e1ed4,_0x441338){return client[_0xb883('0x9')](_0x2e647f,_0x3ed23c)[_0xb883('0xa')](function(_0x53680a){logger['info'](_0xb883('0xb'),_0x33d1a3,'request\x20sent');logger[_0xb883('0xc')](_0xb883('0xd'),_0x33d1a3,_0xb883('0xe'),JSON[_0xb883('0xf')](_0x53680a));if(_0x53680a['error']){if(_0x53680a['error']['code']===0x1f4){logger[_0xb883('0x10')](_0xb883('0xb'),_0x33d1a3,_0x53680a[_0xb883('0x10')][_0xb883('0x11')]);return _0x441338(_0x53680a[_0xb883('0x10')][_0xb883('0x11')]);}logger['error'](_0xb883('0xb'),_0x33d1a3,_0x53680a[_0xb883('0x10')][_0xb883('0x11')]);return _0x1e1ed4(_0x53680a['error'][_0xb883('0x11')]);}else{logger[_0xb883('0x12')](_0xb883('0xb'),_0x33d1a3,_0xb883('0xe'));_0x1e1ed4(_0x53680a[_0xb883('0x13')][_0xb883('0x11')]);}})[_0xb883('0x14')](function(_0x3c1361){logger[_0xb883('0x10')](_0xb883('0xb'),_0x33d1a3,_0x3c1361);_0x441338(_0x3c1361);});});}
\ No newline at end of file
+var _0xd321=['request\x20sent','debug','stringify','error','message','result','catch','lodash','util','moment','randomstring','ioredis','../../config/logger','rpc','client','http','request','info','FaxTransferReport,\x20%s,\x20%s'];(function(_0x2fbba8,_0x1ec63b){var _0x1165bb=function(_0xcdb853){while(--_0xcdb853){_0x2fbba8['push'](_0x2fbba8['shift']());}};_0x1165bb(++_0x1ec63b);}(_0xd321,0xfe));var _0x1d32=function(_0x35fba8,_0x41eccb){_0x35fba8=_0x35fba8-0x0;var _0x2c18e7=_0xd321[_0x35fba8];return _0x2c18e7;};'use strict';var _=require(_0x1d32('0x0'));var util=require(_0x1d32('0x1'));var moment=require(_0x1d32('0x2'));var BPromise=require('bluebird');var rs=require(_0x1d32('0x3'));var fs=require('fs');var Redis=require(_0x1d32('0x4'));var db=require('../../mysqldb')['db'];var utils=require('../../config/utils');var logger=require(_0x1d32('0x5'))(_0x1d32('0x6'));var config=require('../../config/environment');var jayson=require('jayson/promise');var client=jayson[_0x1d32('0x7')][_0x1d32('0x8')]({'port':0x232a});function respondWithRpcPromise(_0x525545,_0x52f370,_0x5c18a9){return new BPromise(function(_0x4706d2,_0x3d8e94){return client[_0x1d32('0x9')](_0x525545,_0x5c18a9)['then'](function(_0x4b55c4){logger[_0x1d32('0xa')](_0x1d32('0xb'),_0x52f370,_0x1d32('0xc'));logger[_0x1d32('0xd')]('FaxTransferReport,\x20%s,\x20%s,\x20%s',_0x52f370,'request\x20sent',JSON[_0x1d32('0xe')](_0x4b55c4));if(_0x4b55c4[_0x1d32('0xf')]){if(_0x4b55c4[_0x1d32('0xf')]['code']===0x1f4){logger[_0x1d32('0xf')]('FaxTransferReport,\x20%s,\x20%s',_0x52f370,_0x4b55c4['error'][_0x1d32('0x10')]);return _0x3d8e94(_0x4b55c4[_0x1d32('0xf')]['message']);}logger[_0x1d32('0xf')]('FaxTransferReport,\x20%s,\x20%s',_0x52f370,_0x4b55c4[_0x1d32('0xf')][_0x1d32('0x10')]);return _0x4706d2(_0x4b55c4[_0x1d32('0xf')]['message']);}else{logger[_0x1d32('0xa')](_0x1d32('0xb'),_0x52f370,'request\x20sent');_0x4706d2(_0x4b55c4[_0x1d32('0x11')]['message']);}})[_0x1d32('0x12')](function(_0x31dbcd){logger[_0x1d32('0xf')](_0x1d32('0xb'),_0x52f370,_0x31dbcd);_0x3d8e94(_0x31dbcd);});});}
\ No newline at end of file
diff --git a/server/api/faxTransferReport/index.js b/server/api/faxTransferReport/index.js
index 2083693..7db2fae 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 _0x3d53=['Router','../../components/auth/service','../../components/interaction/service','../../config/environment','./faxTransferReport.controller','get','isAuthenticated','index','/describe','describe','/:id','show','post','create','put','update','destroy','multer','path','connect-timeout'];(function(_0x55b438,_0x504c43){var _0x62e105=function(_0x48d008){while(--_0x48d008){_0x55b438['push'](_0x55b438['shift']());}};_0x62e105(++_0x504c43);}(_0x3d53,0x179));var _0x33d5=function(_0x43de22,_0x1eced6){_0x43de22=_0x43de22-0x0;var _0x4b15ee=_0x3d53[_0x43de22];return _0x4b15ee;};'use strict';var multer=require(_0x33d5('0x0'));var util=require('util');var path=require(_0x33d5('0x1'));var timeout=require(_0x33d5('0x2'));var express=require('express');var router=express[_0x33d5('0x3')]();var auth=require(_0x33d5('0x4'));var interaction=require(_0x33d5('0x5'));var config=require(_0x33d5('0x6'));var controller=require(_0x33d5('0x7'));router[_0x33d5('0x8')]('/',auth[_0x33d5('0x9')](),controller[_0x33d5('0xa')]);router[_0x33d5('0x8')](_0x33d5('0xb'),auth[_0x33d5('0x9')](),controller[_0x33d5('0xc')]);router[_0x33d5('0x8')](_0x33d5('0xd'),auth[_0x33d5('0x9')](),controller[_0x33d5('0xe')]);router[_0x33d5('0xf')]('/',auth[_0x33d5('0x9')](),controller[_0x33d5('0x10')]);router[_0x33d5('0x11')](_0x33d5('0xd'),auth[_0x33d5('0x9')](),controller[_0x33d5('0x12')]);router['delete'](_0x33d5('0xd'),auth[_0x33d5('0x9')](),controller[_0x33d5('0x13')]);module['exports']=router;
\ No newline at end of file
+var _0xe484=['./faxTransferReport.controller','get','index','/describe','isAuthenticated','/:id','show','post','create','put','update','destroy','exports','multer','util','path','Router','../../components/auth/service','../../components/interaction/service'];(function(_0x38c652,_0x1ea1b7){var _0x218a37=function(_0x5dcb2a){while(--_0x5dcb2a){_0x38c652['push'](_0x38c652['shift']());}};_0x218a37(++_0x1ea1b7);}(_0xe484,0x1c2));var _0x4e48=function(_0x242491,_0x25ad0d){_0x242491=_0x242491-0x0;var _0x3f5c33=_0xe484[_0x242491];return _0x3f5c33;};'use strict';var multer=require(_0x4e48('0x0'));var util=require(_0x4e48('0x1'));var path=require(_0x4e48('0x2'));var timeout=require('connect-timeout');var express=require('express');var router=express[_0x4e48('0x3')]();var auth=require(_0x4e48('0x4'));var interaction=require(_0x4e48('0x5'));var config=require('../../config/environment');var controller=require(_0x4e48('0x6'));router[_0x4e48('0x7')]('/',auth['isAuthenticated'](),controller[_0x4e48('0x8')]);router[_0x4e48('0x7')](_0x4e48('0x9'),auth[_0x4e48('0xa')](),controller['describe']);router[_0x4e48('0x7')](_0x4e48('0xb'),auth[_0x4e48('0xa')](),controller[_0x4e48('0xc')]);router[_0x4e48('0xd')]('/',auth['isAuthenticated'](),controller[_0x4e48('0xe')]);router[_0x4e48('0xf')](_0x4e48('0xb'),auth[_0x4e48('0xa')](),controller[_0x4e48('0x10')]);router['delete'](_0x4e48('0xb'),auth['isAuthenticated'](),controller[_0x4e48('0x11')]);module[_0x4e48('0x12')]=router;
\ No newline at end of file
diff --git a/server/api/intDeskAccount/index.js b/server/api/intDeskAccount/index.js
index 26243e5..8af8954 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 _0x106f=['destroy','exports','multer','util','connect-timeout','express','../../components/auth/service','../../config/environment','./intDeskAccount.controller','get','isAuthenticated','index','/:id','show','getFields','post','create','/:id/configurations','addConfiguration','put','update','delete'];(function(_0x13ff53,_0x5e1424){var _0x290228=function(_0x3e3133){while(--_0x3e3133){_0x13ff53['push'](_0x13ff53['shift']());}};_0x290228(++_0x5e1424);}(_0x106f,0x162));var _0xf106=function(_0x58a197,_0x1aaf50){_0x58a197=_0x58a197-0x0;var _0x49a44b=_0x106f[_0x58a197];return _0x49a44b;};'use strict';var multer=require(_0xf106('0x0'));var util=require(_0xf106('0x1'));var path=require('path');var timeout=require(_0xf106('0x2'));var express=require(_0xf106('0x3'));var router=express['Router']();var auth=require(_0xf106('0x4'));var interaction=require('../../components/interaction/service');var config=require(_0xf106('0x5'));var controller=require(_0xf106('0x6'));router[_0xf106('0x7')]('/',auth[_0xf106('0x8')](),controller[_0xf106('0x9')]);router[_0xf106('0x7')](_0xf106('0xa'),auth['isAuthenticated'](),controller[_0xf106('0xb')]);router[_0xf106('0x7')]('/:id/configurations',auth['isAuthenticated'](),controller['getConfigurations']);router['get']('/:id/fields',auth[_0xf106('0x8')](),controller[_0xf106('0xc')]);router[_0xf106('0xd')]('/',auth[_0xf106('0x8')](),controller[_0xf106('0xe')]);router[_0xf106('0xd')](_0xf106('0xf'),auth[_0xf106('0x8')](),controller[_0xf106('0x10')]);router[_0xf106('0x11')](_0xf106('0xa'),auth['isAuthenticated'](),controller[_0xf106('0x12')]);router[_0xf106('0x13')]('/:id',auth['isAuthenticated'](),controller[_0xf106('0x14')]);module[_0xf106('0x15')]=router;
\ No newline at end of file
+var _0x826a=['getFields','post','create','addConfiguration','put','update','destroy','exports','util','connect-timeout','Router','../../components/auth/service','../../components/interaction/service','../../config/environment','get','isAuthenticated','index','/:id','show','/:id/configurations','getConfigurations','/:id/fields'];(function(_0x577f15,_0x3813f8){var _0x1e8fb8=function(_0x42f461){while(--_0x42f461){_0x577f15['push'](_0x577f15['shift']());}};_0x1e8fb8(++_0x3813f8);}(_0x826a,0x1aa));var _0xa826=function(_0x436901,_0x28598e){_0x436901=_0x436901-0x0;var _0x283ea9=_0x826a[_0x436901];return _0x283ea9;};'use strict';var multer=require('multer');var util=require(_0xa826('0x0'));var path=require('path');var timeout=require(_0xa826('0x1'));var express=require('express');var router=express[_0xa826('0x2')]();var auth=require(_0xa826('0x3'));var interaction=require(_0xa826('0x4'));var config=require(_0xa826('0x5'));var controller=require('./intDeskAccount.controller');router[_0xa826('0x6')]('/',auth[_0xa826('0x7')](),controller[_0xa826('0x8')]);router[_0xa826('0x6')](_0xa826('0x9'),auth[_0xa826('0x7')](),controller[_0xa826('0xa')]);router[_0xa826('0x6')](_0xa826('0xb'),auth[_0xa826('0x7')](),controller[_0xa826('0xc')]);router[_0xa826('0x6')](_0xa826('0xd'),auth[_0xa826('0x7')](),controller[_0xa826('0xe')]);router[_0xa826('0xf')]('/',auth['isAuthenticated'](),controller[_0xa826('0x10')]);router['post'](_0xa826('0xb'),auth[_0xa826('0x7')](),controller[_0xa826('0x11')]);router[_0xa826('0x12')](_0xa826('0x9'),auth[_0xa826('0x7')](),controller[_0xa826('0x13')]);router['delete'](_0xa826('0x9'),auth['isAuthenticated'](),controller[_0xa826('0x14')]);module[_0xa826('0x15')]=router;
\ No newline at end of file
diff --git a/server/api/intDeskAccount/intDeskAccount.attributes.js b/server/api/intDeskAccount/intDeskAccount.attributes.js
index 13ca88b..6b507e1 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 _0x4959=['STRING','ENUM','basic','integrationTab','newTab'];(function(_0x556ce7,_0x57c560){var _0x4a5eba=function(_0x56853b){while(--_0x56853b){_0x556ce7['push'](_0x556ce7['shift']());}};_0x4a5eba(++_0x57c560);}(_0x4959,0x9b));var _0x9495=function(_0x21046a,_0x453b8d){_0x21046a=_0x21046a-0x0;var _0x21527a=_0x4959[_0x21046a];return _0x21527a;};'use strict';var Sequelize=require('sequelize');module['exports']={'name':{'type':Sequelize[_0x9495('0x0')]},'description':{'type':Sequelize[_0x9495('0x0')]},'username':{'type':Sequelize[_0x9495('0x0')]},'remoteUri':{'type':Sequelize['STRING']},'authType':{'type':Sequelize[_0x9495('0x1')](_0x9495('0x2')),'defaultValue':_0x9495('0x2')},'password':{'type':Sequelize[_0x9495('0x0')]},'consumerKey':{'type':Sequelize['STRING']},'consumerSecret':{'type':Sequelize[_0x9495('0x0')]},'token':{'type':Sequelize[_0x9495('0x0')]},'tokenSecret':{'type':Sequelize[_0x9495('0x0')]},'serverUrl':{'type':Sequelize[_0x9495('0x0')]},'type':{'type':Sequelize[_0x9495('0x1')](_0x9495('0x3'),_0x9495('0x4')),'defaultValue':_0x9495('0x3')}};
\ No newline at end of file
+var _0x5f8e=['basic','ENUM','integrationTab','newTab','sequelize','exports','STRING'];(function(_0x584308,_0x1379b3){var _0x45865b=function(_0x145a82){while(--_0x145a82){_0x584308['push'](_0x584308['shift']());}};_0x45865b(++_0x1379b3);}(_0x5f8e,0x131));var _0xe5f8=function(_0x40f9a0,_0x3458cc){_0x40f9a0=_0x40f9a0-0x0;var _0x3e3144=_0x5f8e[_0x40f9a0];return _0x3e3144;};'use strict';var Sequelize=require(_0xe5f8('0x0'));module[_0xe5f8('0x1')]={'name':{'type':Sequelize[_0xe5f8('0x2')]},'description':{'type':Sequelize[_0xe5f8('0x2')]},'username':{'type':Sequelize[_0xe5f8('0x2')]},'remoteUri':{'type':Sequelize[_0xe5f8('0x2')]},'authType':{'type':Sequelize['ENUM']('basic'),'defaultValue':_0xe5f8('0x3')},'password':{'type':Sequelize['STRING']},'consumerKey':{'type':Sequelize[_0xe5f8('0x2')]},'consumerSecret':{'type':Sequelize[_0xe5f8('0x2')]},'token':{'type':Sequelize[_0xe5f8('0x2')]},'tokenSecret':{'type':Sequelize[_0xe5f8('0x2')]},'serverUrl':{'type':Sequelize['STRING']},'type':{'type':Sequelize[_0xe5f8('0x4')](_0xe5f8('0x5'),_0xe5f8('0x6')),'defaultValue':_0xe5f8('0x5')}};
\ No newline at end of file
diff --git a/server/api/intDeskAccount/intDeskAccount.controller.js b/server/api/intDeskAccount/intDeskAccount.controller.js
index c417abd..b6445a8 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 _0x66c7=['test','Sequelize','info','DeskAccount,\x20%s,\x20%s','debug','DeskAccount,\x20%s,\x20%s,\x20%s','request\x20sent','code','error','message','catch','sendStatus','status','json','count','offset','set','Content-Range','apply','reject','save','update','then','destroy','end','name','send','index','map','DeskAccount','rawAttributes','fieldName','key','keys','query','intersection','fields','attributes','length','model','nolimit','limit','order','sort','filters','filter','where','type','VIRTUAL','merge','includeAll','include','findAll','params','options','find','create','body','getConfigurations','findOne','DeskConfiguration','pick','hasOwnProperty','addConfiguration','Subjects','getSubjects','channel','getDescriptions','Descriptions','priority','remoteUri','username','consumerKey','consumerSecret','token','tokenSecret','substring','GET','format','%s/custom_fields','application/json','basic','headers','Authorization','Basic\x20%s','%s:%s','password','base64','concat','_embedded','active','label','getFields','stringify','Wrong\x20credentials','statusCode','html-pdf','eml-format','rimraf','fast-json-patch','request-promise','moment','bluebird','mustache','util','sox','to-csv','ejs','lodash','squel','crypto','jsforce','desk.js','papaparse','ioredis','../../components/auth/service','../../components/parsers/advancedSearch','../../config/logger','api','../../config/utils','../../config/environment','../../mysqldb','../../components/integrations/configuration','jayson/promise','client','http'];(function(_0x515099,_0x46bdbd){var _0x26e0a7=function(_0x47df3b){while(--_0x47df3b){_0x515099['push'](_0x515099['shift']());}};_0x26e0a7(++_0x46bdbd);}(_0x66c7,0x15c));var _0x766c=function(_0x395f46,_0x2d080f){_0x395f46=_0x395f46-0x0;var _0x96e2a2=_0x66c7[_0x395f46];return _0x96e2a2;};'use strict';var pdf=require(_0x766c('0x0'));var emlformat=require(_0x766c('0x1'));var rimraf=require(_0x766c('0x2'));var zipdir=require('zip-dir');var jsonpatch=require(_0x766c('0x3'));var rp=require(_0x766c('0x4'));var moment=require(_0x766c('0x5'));var BPromise=require(_0x766c('0x6'));var Mustache=require(_0x766c('0x7'));var util=require(_0x766c('0x8'));var path=require('path');var sox=require(_0x766c('0x9'));var csv=require(_0x766c('0xa'));var ejs=require(_0x766c('0xb'));var fs=require('fs');var _=require(_0x766c('0xc'));var squel=require(_0x766c('0xd'));var crypto=require(_0x766c('0xe'));var jsforce=require(_0x766c('0xf'));var deskjs=require(_0x766c('0x10'));var toCsv=require('to-csv');var querystring=require('querystring');var Papa=require(_0x766c('0x11'));var Redis=require(_0x766c('0x12'));var authService=require(_0x766c('0x13'));var qs=require('../../components/parsers/qs');var as=require(_0x766c('0x14'));var hardwareService=require('../../config/license/hardware');var logger=require(_0x766c('0x15'))(_0x766c('0x16'));var utils=require(_0x766c('0x17'));var config=require(_0x766c('0x18'));var db=require(_0x766c('0x19'))['db'];var integrations=require(_0x766c('0x1a'));var jayson=require(_0x766c('0x1b'));var client=jayson[_0x766c('0x1c')][_0x766c('0x1d')]({'port':0x232a});function checkPasswordPattern(_0x425542,_0x1db25d,_0x1f866d){if(_0x1f866d){var _0x26dbe2=new RegExp(/(?=.*[a-z])(?=.*[A-Z])(?=.*[0-9])(?=.*[?!@#\$%\^&\*~\-_=+[{\]\}])(?=.{8,})/);if(_0x26dbe2[_0x766c('0x1e')](_0x1db25d)){return _0x425542;}else{throw new db[(_0x766c('0x1f'))]['ValidationError']('The\x20password\x20must\x20be\x20at\x20least\x208\x20characters\x20long\x20and\x20have\x201\x20lowercase\x20character,\x201\x20uppercase\x20character,\x201\x20number\x20and\x201\x20special\x20character\x20~!@#$%^&-_=+[{]}.');}}else{return _0x425542;}}function respondWithRpcPromise(_0x491b9e,_0x35fcdc,_0x3e0cf0,_0xfadbc1){return new BPromise(function(_0x1150da,_0xe9d7ef){var _0x357602=_0xfadbc1||client;return _0x357602['request'](_0x491b9e,_0x3e0cf0)['then'](function(_0x21dbb7){logger[_0x766c('0x20')](_0x766c('0x21'),_0x35fcdc,'request\x20sent');logger[_0x766c('0x22')](_0x766c('0x23'),_0x35fcdc,_0x766c('0x24'),JSON['stringify'](_0x21dbb7));if(_0x21dbb7['error']){if(_0x21dbb7['error'][_0x766c('0x25')]===0x1f4){logger['error'](_0x766c('0x21'),_0x35fcdc,_0x21dbb7[_0x766c('0x26')]['message']);return _0xe9d7ef(_0x21dbb7['error'][_0x766c('0x27')]);}logger[_0x766c('0x26')](_0x766c('0x21'),_0x35fcdc,_0x21dbb7['error'][_0x766c('0x27')]);return _0x1150da(_0x21dbb7[_0x766c('0x26')]['message']);}else{logger['info']('DeskAccount,\x20%s,\x20%s',_0x35fcdc,_0x766c('0x24'));_0x1150da(_0x21dbb7['result'][_0x766c('0x27')]);}})[_0x766c('0x28')](function(_0x3e1034){logger['error'](_0x766c('0x21'),_0x35fcdc,_0x3e1034);_0xe9d7ef(_0x3e1034);});});}function respondWithStatusCode(_0x444310,_0x19cb9b){_0x19cb9b=_0x19cb9b||0xcc;return function(_0x329e94){if(_0x329e94){return _0x444310[_0x766c('0x29')](_0x19cb9b);}return _0x444310[_0x766c('0x2a')](_0x19cb9b)['end']();};}function respondWithResult(_0x62a8f8,_0x323fc4){_0x323fc4=_0x323fc4||0xc8;return function(_0x19e9c1){if(_0x19e9c1){return _0x62a8f8[_0x766c('0x2a')](_0x323fc4)[_0x766c('0x2b')](_0x19e9c1);}};}function respondWithFilteredResult(_0x539341,_0x541166){return function(_0x2d7de6){if(_0x2d7de6){var _0x19b6e8=_0x2d7de6[_0x766c('0x2c')],_0x1d5288=_0x541166['offset'],_0x549dde=_0x541166[_0x766c('0x2d')]+_0x541166['limit'],_0x9f13ba;if(_0x549dde>=_0x19b6e8){_0x549dde=_0x19b6e8;_0x9f13ba=0xc8;}else{_0x9f13ba=0xce;}_0x539341['status'](_0x9f13ba);return _0x539341[_0x766c('0x2e')](_0x766c('0x2f'),_0x1d5288+'-'+_0x549dde+'/'+_0x19b6e8)[_0x766c('0x2b')](_0x2d7de6);}return null;};}function patchUpdates(_0x5b94cf){return function(_0x5fc75d){try{jsonpatch[_0x766c('0x30')](_0x5fc75d,_0x5b94cf,!![]);}catch(_0x6fd6e1){return BPromise[_0x766c('0x31')](_0x6fd6e1);}return _0x5fc75d[_0x766c('0x32')]();};}function saveUpdates(_0x56589e,_0x4b8374){return function(_0x4659cc){if(_0x4659cc){return _0x4659cc[_0x766c('0x33')](_0x56589e)[_0x766c('0x34')](function(_0x13b96a){return _0x13b96a;});}return null;};}function removeEntity(_0x136d95,_0x48d31d){return function(_0x452db1){if(_0x452db1){return _0x452db1[_0x766c('0x35')]()[_0x766c('0x34')](function(){_0x136d95['status'](0xcc)[_0x766c('0x36')]();});}};}function handleEntityNotFound(_0x4b765c,_0x52e578){return function(_0x30c7bd){if(!_0x30c7bd){_0x4b765c[_0x766c('0x29')](0x194);}return _0x30c7bd;};}function handleError(_0x26bd0b,_0x182a81){_0x182a81=_0x182a81||0x1f4;return function(_0x2f96e3){logger[_0x766c('0x26')](_0x2f96e3['stack']);if(_0x2f96e3['name']){delete _0x2f96e3[_0x766c('0x37')];}_0x26bd0b[_0x766c('0x2a')](_0x182a81)[_0x766c('0x38')](_0x2f96e3);};}exports[_0x766c('0x39')]=function(_0x160f9e,_0x20a900){var _0x120f17={},_0x2f11f9={},_0x19e984={'count':0x0,'rows':[]};var _0xa1c774=_[_0x766c('0x3a')](db[_0x766c('0x3b')][_0x766c('0x3c')],function(_0x4b2b06){return{'name':_0x4b2b06[_0x766c('0x3d')],'type':_0x4b2b06['type'][_0x766c('0x3e')]};});_0x2f11f9['model']=_[_0x766c('0x3a')](_0xa1c774,_0x766c('0x37'));_0x2f11f9['query']=_[_0x766c('0x3f')](_0x160f9e[_0x766c('0x40')]);_0x2f11f9['filters']=_[_0x766c('0x41')](_0x2f11f9['model'],_0x2f11f9['query']);_0x120f17['attributes']=_[_0x766c('0x41')](_0x2f11f9['model'],qs[_0x766c('0x42')](_0x160f9e[_0x766c('0x40')][_0x766c('0x42')]));_0x120f17[_0x766c('0x43')]=_0x120f17[_0x766c('0x43')][_0x766c('0x44')]?_0x120f17[_0x766c('0x43')]:_0x2f11f9[_0x766c('0x45')];if(!_0x160f9e[_0x766c('0x40')]['hasOwnProperty'](_0x766c('0x46'))){_0x120f17[_0x766c('0x47')]=qs['limit'](_0x160f9e['query']['limit']);_0x120f17[_0x766c('0x2d')]=qs[_0x766c('0x2d')](_0x160f9e['query'][_0x766c('0x2d')]);}_0x120f17[_0x766c('0x48')]=qs['sort'](_0x160f9e[_0x766c('0x40')][_0x766c('0x49')]);_0x120f17['where']=qs[_0x766c('0x4a')](_['pick'](_0x160f9e[_0x766c('0x40')],_0x2f11f9[_0x766c('0x4a')]));if(_0x160f9e[_0x766c('0x40')][_0x766c('0x4b')]){_0x120f17[_0x766c('0x4c')]=_['merge'](_0x120f17[_0x766c('0x4c')],{'$or':_[_0x766c('0x3a')](_0xa1c774,function(_0x51cd5a){if(_0x51cd5a[_0x766c('0x4d')]!==_0x766c('0x4e')){var _0x53dafb={};_0x53dafb[_0x51cd5a['name']]={'$like':'%'+_0x160f9e[_0x766c('0x40')][_0x766c('0x4b')]+'%'};return _0x53dafb;}})});}_0x120f17=_[_0x766c('0x4f')]({},_0x120f17,_0x160f9e['options']);var _0x430d89={'where':_0x120f17[_0x766c('0x4c')]};return db[_0x766c('0x3b')]['count'](_0x430d89)[_0x766c('0x34')](function(_0x29c771){_0x19e984['count']=_0x29c771;if(_0x160f9e[_0x766c('0x40')][_0x766c('0x50')]){_0x120f17[_0x766c('0x51')]=[{'all':!![]}];}return db['DeskAccount'][_0x766c('0x52')](_0x120f17);})['then'](function(_0x572da4){_0x19e984['rows']=_0x572da4;return _0x19e984;})[_0x766c('0x34')](respondWithFilteredResult(_0x20a900,_0x120f17))[_0x766c('0x28')](handleError(_0x20a900,null));};exports['show']=function(_0x2b53ca,_0xcb8c71){var _0x449568={'raw':![],'where':{'id':_0x2b53ca[_0x766c('0x53')]['id']}},_0x5f4d5b={};_0x5f4d5b['model']=_[_0x766c('0x3f')](db[_0x766c('0x3b')][_0x766c('0x3c')]);_0x5f4d5b[_0x766c('0x40')]=_[_0x766c('0x3f')](_0x2b53ca[_0x766c('0x40')]);_0x5f4d5b[_0x766c('0x4a')]=_[_0x766c('0x41')](_0x5f4d5b[_0x766c('0x45')],_0x5f4d5b['query']);_0x449568[_0x766c('0x43')]=_[_0x766c('0x41')](_0x5f4d5b[_0x766c('0x45')],qs[_0x766c('0x42')](_0x2b53ca[_0x766c('0x40')]['fields']));_0x449568['attributes']=_0x449568[_0x766c('0x43')]['length']?_0x449568[_0x766c('0x43')]:_0x5f4d5b[_0x766c('0x45')];if(_0x2b53ca['query'][_0x766c('0x50')]){_0x449568[_0x766c('0x51')]=[{'all':!![]}];}_0x449568=_[_0x766c('0x4f')]({},_0x449568,_0x2b53ca[_0x766c('0x54')]);return db['DeskAccount'][_0x766c('0x55')](_0x449568)[_0x766c('0x34')](handleEntityNotFound(_0xcb8c71,null))[_0x766c('0x34')](respondWithResult(_0xcb8c71,null))[_0x766c('0x28')](handleError(_0xcb8c71,null));};exports[_0x766c('0x56')]=function(_0x3ae7d8,_0x1c7796){return db[_0x766c('0x3b')][_0x766c('0x56')](_0x3ae7d8[_0x766c('0x57')],{})[_0x766c('0x34')](respondWithResult(_0x1c7796,0xc9))['catch'](handleError(_0x1c7796,null));};exports[_0x766c('0x33')]=function(_0xddfde2,_0x3215fb){if(_0xddfde2['body']['id']){delete _0xddfde2['body']['id'];}return db[_0x766c('0x3b')][_0x766c('0x55')]({'where':{'id':_0xddfde2['params']['id']}})[_0x766c('0x34')](handleEntityNotFound(_0x3215fb,null))[_0x766c('0x34')](saveUpdates(_0xddfde2[_0x766c('0x57')],null))[_0x766c('0x34')](respondWithResult(_0x3215fb,null))[_0x766c('0x28')](handleError(_0x3215fb,null));};exports[_0x766c('0x35')]=function(_0x1d4425,_0x5dd0cd){return db[_0x766c('0x3b')][_0x766c('0x55')]({'where':{'id':_0x1d4425[_0x766c('0x53')]['id']}})['then'](handleEntityNotFound(_0x5dd0cd,null))[_0x766c('0x34')](removeEntity(_0x5dd0cd,null))[_0x766c('0x28')](handleError(_0x5dd0cd,null));};exports[_0x766c('0x58')]=function(_0x47406c,_0x4bd478,_0x446e9f){var _0x1d291c={};var _0x9c5585={};var _0x1bfce9;var _0x40377c;return db['DeskAccount'][_0x766c('0x59')]({'where':{'id':_0x47406c[_0x766c('0x53')]['id']}})[_0x766c('0x34')](handleEntityNotFound(_0x4bd478,null))['then'](function(_0xd89b3e){if(_0xd89b3e){_0x1bfce9=_0xd89b3e;_0x9c5585[_0x766c('0x45')]=_[_0x766c('0x3f')](db[_0x766c('0x5a')][_0x766c('0x3c')]);_0x9c5585[_0x766c('0x40')]=_['keys'](_0x47406c[_0x766c('0x40')]);_0x9c5585[_0x766c('0x4a')]=_['intersection'](_0x9c5585[_0x766c('0x45')],_0x9c5585['query']);_0x1d291c[_0x766c('0x43')]=_[_0x766c('0x41')](_0x9c5585[_0x766c('0x45')],qs['fields'](_0x47406c[_0x766c('0x40')][_0x766c('0x42')]));_0x1d291c[_0x766c('0x43')]=_0x1d291c[_0x766c('0x43')][_0x766c('0x44')]?_0x1d291c['attributes']:_0x9c5585['model'];_0x1d291c['order']=qs[_0x766c('0x49')](_0x47406c[_0x766c('0x40')][_0x766c('0x49')]);_0x1d291c[_0x766c('0x4c')]=qs[_0x766c('0x4a')](_[_0x766c('0x5b')](_0x47406c['query'],_0x9c5585['filters']));if(_0x47406c[_0x766c('0x40')][_0x766c('0x4b')]){_0x1d291c['where']=_[_0x766c('0x4f')](_0x1d291c[_0x766c('0x4c')],{'$or':_['map'](_0x1d291c['attributes'],function(_0x23b217){var _0x45802c={};_0x45802c[_0x23b217]={'$like':'%'+_0x47406c[_0x766c('0x40')][_0x766c('0x4b')]+'%'};return _0x45802c;})});}_0x1d291c=_['merge']({},_0x1d291c,_0x47406c[_0x766c('0x54')]);return _0x1bfce9[_0x766c('0x58')](_0x1d291c);}})[_0x766c('0x34')](function(_0x3a2323){if(_0x3a2323){_0x40377c=_0x3a2323['length'];if(!_0x47406c['query'][_0x766c('0x5c')](_0x766c('0x46'))){_0x1d291c['limit']=qs[_0x766c('0x47')](_0x47406c['query'][_0x766c('0x47')]);_0x1d291c[_0x766c('0x2d')]=qs['offset'](_0x47406c[_0x766c('0x40')][_0x766c('0x2d')]);}return _0x1bfce9[_0x766c('0x58')](_0x1d291c);}})['then'](function(_0x43154b){if(_0x43154b){return _0x43154b?{'count':_0x40377c,'rows':_0x43154b}:null;}})['then'](respondWithResult(_0x4bd478,null))[_0x766c('0x28')](handleError(_0x4bd478,null));};exports[_0x766c('0x5d')]=function(_0x3da3df,_0xb83772,_0x550d3b){if(_0x3da3df[_0x766c('0x57')]['id']){delete _0x3da3df[_0x766c('0x57')]['id'];}return db[_0x766c('0x3b')]['findOne']({'where':{'id':_0x3da3df[_0x766c('0x53')]['id']}})[_0x766c('0x34')](handleEntityNotFound(_0xb83772,null))[_0x766c('0x34')](function(_0x483a8d){if(_0x483a8d){_0x3da3df['body']['AccountId']=_0x483a8d['id'];_0x3da3df[_0x766c('0x57')][_0x766c('0x5e')]=integrations[_0x766c('0x5f')](_0x3da3df[_0x766c('0x57')][_0x766c('0x60')],_0x3da3df['body'][_0x766c('0x4d')]);_0x3da3df[_0x766c('0x57')]['Descriptions']=integrations[_0x766c('0x61')](_0x3da3df[_0x766c('0x57')][_0x766c('0x60')],_0x3da3df[_0x766c('0x57')][_0x766c('0x4d')]);return db['DeskConfiguration']['create'](_0x3da3df['body'],{'include':[{'model':db['DeskField'],'as':'Subjects'},{'model':db['DeskField'],'as':_0x766c('0x62')}]});}return null;})[_0x766c('0x34')](respondWithResult(_0xb83772,null))[_0x766c('0x28')](handleError(_0xb83772,null));};exports['getFields']=function(_0x4412de,_0x42f581,_0x3eebf8){var _0x3d9851=[{'name':_0x766c('0x63'),'label':'priority','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 _0x2f4792='';return db[_0x766c('0x3b')][_0x766c('0x59')]({'where':{'id':_0x4412de[_0x766c('0x53')]['id']},'attributes':['id',_0x766c('0x64'),'authType',_0x766c('0x65'),'password',_0x766c('0x66'),_0x766c('0x67'),_0x766c('0x68'),_0x766c('0x69')]})[_0x766c('0x34')](handleEntityNotFound(_0x42f581,null))['then'](function(_0x394dbe){if(_0x394dbe){_0x2f4792=_0x394dbe['remoteUri'];var _0x5c771=_0x2f4792['slice'](-0x1);if(_0x5c771==='/'){_0x2f4792=_0x2f4792[_0x766c('0x6a')](0x0,_0x2f4792['lastIndexOf'](_0x5c771));}var _0x461f78={'method':_0x766c('0x6b'),'uri':util[_0x766c('0x6c')](_0x766c('0x6d'),_0x2f4792),'headers':{'Content-Type':_0x766c('0x6e'),'Accept':_0x766c('0x6e')},'json':!![]};if(_0x394dbe['authType']===_0x766c('0x6f')){_0x461f78[_0x766c('0x70')][_0x766c('0x71')]=util[_0x766c('0x6c')](_0x766c('0x72'),new Buffer(util[_0x766c('0x6c')](_0x766c('0x73'),_0x394dbe[_0x766c('0x65')],_0x394dbe[_0x766c('0x74')]))['toString'](_0x766c('0x75')));}return rp(_0x461f78)[_0x766c('0x34')](function(_0x5dcb9e){return _0x3d9851[_0x766c('0x76')](_[_0x766c('0x3a')](_0x5dcb9e[_0x766c('0x77')]['entries'],function(_0x435b71){return{'id':_0x435b71['name'],'name':_0x435b71[_0x766c('0x37')],'type':_0x435b71['type'],'active':_0x435b71[_0x766c('0x78')],'label':_0x435b71[_0x766c('0x79')],'custom':!![]};}));});}})['then'](function(_0x13b9b){return{'count':_0x13b9b['length'],'rows':_0x13b9b};})['then'](respondWithResult(_0x42f581,null))[_0x766c('0x28')](function(_0x2cb64c){var _0x2974c8=_0x4412de[_0x766c('0x40')][_0x766c('0x1e')]?0x1f4:_0x2cb64c['statusCode']||0x1f4;logger[_0x766c('0x26')]('getFields,\x20%s,\x20%s,\x20%s',_0x766c('0x7a'),_0x2974c8,JSON[_0x766c('0x7b')](_0x2cb64c));delete _0x2cb64c['name'];if(_0x2974c8===0x191){_0x2974c8=0x190;}_0x42f581[_0x766c('0x2a')](_0x2974c8)['send'](_0x4412de[_0x766c('0x40')][_0x766c('0x1e')]?{'message':_0x766c('0x7c'),'statusCode':_0x2cb64c[_0x766c('0x7d')]}:_0x2cb64c);});};
\ No newline at end of file
+var _0x4a70=['moment','bluebird','mustache','util','ejs','lodash','squel','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','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','DeskAccount,\x20%s,\x20%s','request\x20sent','debug','DeskAccount,\x20%s,\x20%s,\x20%s','stringify','code','error','message','info','result','catch','sendStatus','status','end','count','offset','limit','Content-Range','json','apply','reject','save','update','name','send','index','map','DeskAccount','fieldName','type','key','model','query','keys','filters','intersection','fields','attributes','length','nolimit','order','sort','pick','filter','where','VIRTUAL','merge','options','includeAll','include','findAll','rows','show','params','find','create','body','destroy','getConfigurations','findOne','DeskConfiguration','rawAttributes','hasOwnProperty','addConfiguration','Subjects','getSubjects','channel','Descriptions','getDescriptions','DeskField','getFields','priority','remoteUri','authType','username','consumerKey','consumerSecret','lastIndexOf','GET','format','%s/custom_fields','application/json','basic','headers','Authorization','%s:%s','password','toString','concat','_embedded','label','getFields,\x20%s,\x20%s,\x20%s','Wrong\x20credentials','html-pdf','eml-format','rimraf','fast-json-patch'];(function(_0x3eaa42,_0x340128){var _0x2fb1bd=function(_0x1da511){while(--_0x1da511){_0x3eaa42['push'](_0x3eaa42['shift']());}};_0x2fb1bd(++_0x340128);}(_0x4a70,0x77));var _0x04a7=function(_0x1ee0a1,_0x51058e){_0x1ee0a1=_0x1ee0a1-0x0;var _0x1d2d5b=_0x4a70[_0x1ee0a1];return _0x1d2d5b;};'use strict';var pdf=require(_0x04a7('0x0'));var emlformat=require(_0x04a7('0x1'));var rimraf=require(_0x04a7('0x2'));var zipdir=require('zip-dir');var jsonpatch=require(_0x04a7('0x3'));var rp=require('request-promise');var moment=require(_0x04a7('0x4'));var BPromise=require(_0x04a7('0x5'));var Mustache=require(_0x04a7('0x6'));var util=require(_0x04a7('0x7'));var path=require('path');var sox=require('sox');var csv=require('to-csv');var ejs=require(_0x04a7('0x8'));var fs=require('fs');var _=require(_0x04a7('0x9'));var squel=require(_0x04a7('0xa'));var crypto=require('crypto');var jsforce=require(_0x04a7('0xb'));var deskjs=require(_0x04a7('0xc'));var toCsv=require(_0x04a7('0xd'));var querystring=require(_0x04a7('0xe'));var Papa=require(_0x04a7('0xf'));var Redis=require('ioredis');var authService=require(_0x04a7('0x10'));var qs=require('../../components/parsers/qs');var as=require(_0x04a7('0x11'));var hardwareService=require(_0x04a7('0x12'));var logger=require(_0x04a7('0x13'))(_0x04a7('0x14'));var utils=require(_0x04a7('0x15'));var config=require(_0x04a7('0x16'));var db=require(_0x04a7('0x17'))['db'];var integrations=require(_0x04a7('0x18'));var jayson=require(_0x04a7('0x19'));var client=jayson['client']['http']({'port':0x232a});function checkPasswordPattern(_0x1c95f1,_0x3296a4,_0x5a3008){if(_0x5a3008){var _0x1e3e5c=new RegExp(/(?=.*[a-z])(?=.*[A-Z])(?=.*[0-9])(?=.*[?!@#\$%\^&\*~\-_=+[{\]\}])(?=.{8,})/);if(_0x1e3e5c[_0x04a7('0x1a')](_0x3296a4)){return _0x1c95f1;}else{throw new db[(_0x04a7('0x1b'))]['ValidationError'](_0x04a7('0x1c'));}}else{return _0x1c95f1;}}function respondWithRpcPromise(_0x2d3648,_0x4c73a7,_0xd6f6e2,_0x51a269){return new BPromise(function(_0x4bbeec,_0x3177a3){var _0x251741=_0x51a269||client;return _0x251741['request'](_0x2d3648,_0xd6f6e2)[_0x04a7('0x1d')](function(_0x416d87){logger['info'](_0x04a7('0x1e'),_0x4c73a7,_0x04a7('0x1f'));logger[_0x04a7('0x20')](_0x04a7('0x21'),_0x4c73a7,_0x04a7('0x1f'),JSON[_0x04a7('0x22')](_0x416d87));if(_0x416d87['error']){if(_0x416d87['error'][_0x04a7('0x23')]===0x1f4){logger[_0x04a7('0x24')]('DeskAccount,\x20%s,\x20%s',_0x4c73a7,_0x416d87[_0x04a7('0x24')]['message']);return _0x3177a3(_0x416d87[_0x04a7('0x24')]['message']);}logger[_0x04a7('0x24')]('DeskAccount,\x20%s,\x20%s',_0x4c73a7,_0x416d87[_0x04a7('0x24')]['message']);return _0x4bbeec(_0x416d87[_0x04a7('0x24')][_0x04a7('0x25')]);}else{logger[_0x04a7('0x26')](_0x04a7('0x1e'),_0x4c73a7,_0x04a7('0x1f'));_0x4bbeec(_0x416d87[_0x04a7('0x27')][_0x04a7('0x25')]);}})[_0x04a7('0x28')](function(_0x1aa91f){logger[_0x04a7('0x24')]('DeskAccount,\x20%s,\x20%s',_0x4c73a7,_0x1aa91f);_0x3177a3(_0x1aa91f);});});}function respondWithStatusCode(_0x2aa71e,_0x574b88){_0x574b88=_0x574b88||0xcc;return function(_0x274bc8){if(_0x274bc8){return _0x2aa71e[_0x04a7('0x29')](_0x574b88);}return _0x2aa71e[_0x04a7('0x2a')](_0x574b88)[_0x04a7('0x2b')]();};}function respondWithResult(_0x2d9e1d,_0x1be6fc){_0x1be6fc=_0x1be6fc||0xc8;return function(_0x183c61){if(_0x183c61){return _0x2d9e1d[_0x04a7('0x2a')](_0x1be6fc)['json'](_0x183c61);}};}function respondWithFilteredResult(_0x1643db,_0x16fd48){return function(_0x40d1c5){if(_0x40d1c5){var _0x2eea0c=_0x40d1c5[_0x04a7('0x2c')],_0x241037=_0x16fd48[_0x04a7('0x2d')],_0x49d12e=_0x16fd48['offset']+_0x16fd48[_0x04a7('0x2e')],_0x564df8;if(_0x49d12e>=_0x2eea0c){_0x49d12e=_0x2eea0c;_0x564df8=0xc8;}else{_0x564df8=0xce;}_0x1643db[_0x04a7('0x2a')](_0x564df8);return _0x1643db['set'](_0x04a7('0x2f'),_0x241037+'-'+_0x49d12e+'/'+_0x2eea0c)[_0x04a7('0x30')](_0x40d1c5);}return null;};}function patchUpdates(_0x4a56c2){return function(_0x3f2f75){try{jsonpatch[_0x04a7('0x31')](_0x3f2f75,_0x4a56c2,!![]);}catch(_0xe2759a){return BPromise[_0x04a7('0x32')](_0xe2759a);}return _0x3f2f75[_0x04a7('0x33')]();};}function saveUpdates(_0x249209,_0xd1cd45){return function(_0xafe970){if(_0xafe970){return _0xafe970[_0x04a7('0x34')](_0x249209)[_0x04a7('0x1d')](function(_0x25adc3){return _0x25adc3;});}return null;};}function removeEntity(_0xb047e,_0x1d0799){return function(_0x3becc8){if(_0x3becc8){return _0x3becc8['destroy']()[_0x04a7('0x1d')](function(){_0xb047e[_0x04a7('0x2a')](0xcc)['end']();});}};}function handleEntityNotFound(_0x41dbde,_0x5d5c2c){return function(_0x54a8a2){if(!_0x54a8a2){_0x41dbde['sendStatus'](0x194);}return _0x54a8a2;};}function handleError(_0x2be23c,_0x44cf0e){_0x44cf0e=_0x44cf0e||0x1f4;return function(_0x3ad282){logger[_0x04a7('0x24')](_0x3ad282['stack']);if(_0x3ad282[_0x04a7('0x35')]){delete _0x3ad282['name'];}_0x2be23c[_0x04a7('0x2a')](_0x44cf0e)[_0x04a7('0x36')](_0x3ad282);};}exports[_0x04a7('0x37')]=function(_0x1f7e27,_0x117226){var _0x1680a4={},_0x4c0d94={},_0x4d7694={'count':0x0,'rows':[]};var _0xea7fd5=_[_0x04a7('0x38')](db[_0x04a7('0x39')]['rawAttributes'],function(_0x1ec717){return{'name':_0x1ec717[_0x04a7('0x3a')],'type':_0x1ec717[_0x04a7('0x3b')][_0x04a7('0x3c')]};});_0x4c0d94[_0x04a7('0x3d')]=_['map'](_0xea7fd5,_0x04a7('0x35'));_0x4c0d94[_0x04a7('0x3e')]=_[_0x04a7('0x3f')](_0x1f7e27[_0x04a7('0x3e')]);_0x4c0d94[_0x04a7('0x40')]=_['intersection'](_0x4c0d94[_0x04a7('0x3d')],_0x4c0d94[_0x04a7('0x3e')]);_0x1680a4['attributes']=_[_0x04a7('0x41')](_0x4c0d94['model'],qs[_0x04a7('0x42')](_0x1f7e27[_0x04a7('0x3e')][_0x04a7('0x42')]));_0x1680a4[_0x04a7('0x43')]=_0x1680a4['attributes'][_0x04a7('0x44')]?_0x1680a4[_0x04a7('0x43')]:_0x4c0d94[_0x04a7('0x3d')];if(!_0x1f7e27[_0x04a7('0x3e')]['hasOwnProperty'](_0x04a7('0x45'))){_0x1680a4['limit']=qs[_0x04a7('0x2e')](_0x1f7e27['query']['limit']);_0x1680a4[_0x04a7('0x2d')]=qs[_0x04a7('0x2d')](_0x1f7e27['query'][_0x04a7('0x2d')]);}_0x1680a4[_0x04a7('0x46')]=qs['sort'](_0x1f7e27[_0x04a7('0x3e')][_0x04a7('0x47')]);_0x1680a4['where']=qs['filters'](_[_0x04a7('0x48')](_0x1f7e27[_0x04a7('0x3e')],_0x4c0d94['filters']));if(_0x1f7e27[_0x04a7('0x3e')][_0x04a7('0x49')]){_0x1680a4[_0x04a7('0x4a')]=_['merge'](_0x1680a4[_0x04a7('0x4a')],{'$or':_['map'](_0xea7fd5,function(_0x3bdf84){if(_0x3bdf84['type']!==_0x04a7('0x4b')){var _0x555375={};_0x555375[_0x3bdf84[_0x04a7('0x35')]]={'$like':'%'+_0x1f7e27[_0x04a7('0x3e')]['filter']+'%'};return _0x555375;}})});}_0x1680a4=_[_0x04a7('0x4c')]({},_0x1680a4,_0x1f7e27[_0x04a7('0x4d')]);var _0x1988d5={'where':_0x1680a4[_0x04a7('0x4a')]};return db[_0x04a7('0x39')][_0x04a7('0x2c')](_0x1988d5)[_0x04a7('0x1d')](function(_0x183511){_0x4d7694['count']=_0x183511;if(_0x1f7e27[_0x04a7('0x3e')][_0x04a7('0x4e')]){_0x1680a4[_0x04a7('0x4f')]=[{'all':!![]}];}return db[_0x04a7('0x39')][_0x04a7('0x50')](_0x1680a4);})[_0x04a7('0x1d')](function(_0x5bef4a){_0x4d7694[_0x04a7('0x51')]=_0x5bef4a;return _0x4d7694;})[_0x04a7('0x1d')](respondWithFilteredResult(_0x117226,_0x1680a4))['catch'](handleError(_0x117226,null));};exports[_0x04a7('0x52')]=function(_0x959fcd,_0x2302c7){var _0x9d1b52={'raw':![],'where':{'id':_0x959fcd[_0x04a7('0x53')]['id']}},_0x3f1376={};_0x3f1376[_0x04a7('0x3d')]=_['keys'](db[_0x04a7('0x39')]['rawAttributes']);_0x3f1376[_0x04a7('0x3e')]=_[_0x04a7('0x3f')](_0x959fcd[_0x04a7('0x3e')]);_0x3f1376['filters']=_[_0x04a7('0x41')](_0x3f1376[_0x04a7('0x3d')],_0x3f1376['query']);_0x9d1b52[_0x04a7('0x43')]=_[_0x04a7('0x41')](_0x3f1376[_0x04a7('0x3d')],qs[_0x04a7('0x42')](_0x959fcd[_0x04a7('0x3e')][_0x04a7('0x42')]));_0x9d1b52[_0x04a7('0x43')]=_0x9d1b52[_0x04a7('0x43')][_0x04a7('0x44')]?_0x9d1b52[_0x04a7('0x43')]:_0x3f1376[_0x04a7('0x3d')];if(_0x959fcd[_0x04a7('0x3e')][_0x04a7('0x4e')]){_0x9d1b52[_0x04a7('0x4f')]=[{'all':!![]}];}_0x9d1b52=_[_0x04a7('0x4c')]({},_0x9d1b52,_0x959fcd[_0x04a7('0x4d')]);return db[_0x04a7('0x39')][_0x04a7('0x54')](_0x9d1b52)[_0x04a7('0x1d')](handleEntityNotFound(_0x2302c7,null))[_0x04a7('0x1d')](respondWithResult(_0x2302c7,null))['catch'](handleError(_0x2302c7,null));};exports[_0x04a7('0x55')]=function(_0x562448,_0x1c9f97){return db[_0x04a7('0x39')][_0x04a7('0x55')](_0x562448[_0x04a7('0x56')],{})[_0x04a7('0x1d')](respondWithResult(_0x1c9f97,0xc9))[_0x04a7('0x28')](handleError(_0x1c9f97,null));};exports['update']=function(_0x422e9b,_0x4627fa){if(_0x422e9b[_0x04a7('0x56')]['id']){delete _0x422e9b['body']['id'];}return db[_0x04a7('0x39')][_0x04a7('0x54')]({'where':{'id':_0x422e9b[_0x04a7('0x53')]['id']}})[_0x04a7('0x1d')](handleEntityNotFound(_0x4627fa,null))[_0x04a7('0x1d')](saveUpdates(_0x422e9b[_0x04a7('0x56')],null))[_0x04a7('0x1d')](respondWithResult(_0x4627fa,null))[_0x04a7('0x28')](handleError(_0x4627fa,null));};exports[_0x04a7('0x57')]=function(_0x49b59f,_0x274822){return db[_0x04a7('0x39')][_0x04a7('0x54')]({'where':{'id':_0x49b59f[_0x04a7('0x53')]['id']}})[_0x04a7('0x1d')](handleEntityNotFound(_0x274822,null))[_0x04a7('0x1d')](removeEntity(_0x274822,null))[_0x04a7('0x28')](handleError(_0x274822,null));};exports[_0x04a7('0x58')]=function(_0x24cdaa,_0x3d647a,_0x4c8e99){var _0x449102={};var _0x5c0c3c={};var _0x436c97;var _0x1668b1;return db[_0x04a7('0x39')][_0x04a7('0x59')]({'where':{'id':_0x24cdaa[_0x04a7('0x53')]['id']}})[_0x04a7('0x1d')](handleEntityNotFound(_0x3d647a,null))[_0x04a7('0x1d')](function(_0x552061){if(_0x552061){_0x436c97=_0x552061;_0x5c0c3c['model']=_['keys'](db[_0x04a7('0x5a')][_0x04a7('0x5b')]);_0x5c0c3c[_0x04a7('0x3e')]=_[_0x04a7('0x3f')](_0x24cdaa['query']);_0x5c0c3c[_0x04a7('0x40')]=_[_0x04a7('0x41')](_0x5c0c3c[_0x04a7('0x3d')],_0x5c0c3c[_0x04a7('0x3e')]);_0x449102['attributes']=_[_0x04a7('0x41')](_0x5c0c3c['model'],qs['fields'](_0x24cdaa[_0x04a7('0x3e')][_0x04a7('0x42')]));_0x449102['attributes']=_0x449102['attributes']['length']?_0x449102[_0x04a7('0x43')]:_0x5c0c3c[_0x04a7('0x3d')];_0x449102[_0x04a7('0x46')]=qs['sort'](_0x24cdaa[_0x04a7('0x3e')][_0x04a7('0x47')]);_0x449102[_0x04a7('0x4a')]=qs['filters'](_['pick'](_0x24cdaa[_0x04a7('0x3e')],_0x5c0c3c[_0x04a7('0x40')]));if(_0x24cdaa[_0x04a7('0x3e')]['filter']){_0x449102[_0x04a7('0x4a')]=_[_0x04a7('0x4c')](_0x449102[_0x04a7('0x4a')],{'$or':_['map'](_0x449102[_0x04a7('0x43')],function(_0x17b0ca){var _0x40f915={};_0x40f915[_0x17b0ca]={'$like':'%'+_0x24cdaa[_0x04a7('0x3e')][_0x04a7('0x49')]+'%'};return _0x40f915;})});}_0x449102=_[_0x04a7('0x4c')]({},_0x449102,_0x24cdaa[_0x04a7('0x4d')]);return _0x436c97[_0x04a7('0x58')](_0x449102);}})['then'](function(_0x5968be){if(_0x5968be){_0x1668b1=_0x5968be[_0x04a7('0x44')];if(!_0x24cdaa[_0x04a7('0x3e')][_0x04a7('0x5c')](_0x04a7('0x45'))){_0x449102[_0x04a7('0x2e')]=qs[_0x04a7('0x2e')](_0x24cdaa[_0x04a7('0x3e')][_0x04a7('0x2e')]);_0x449102[_0x04a7('0x2d')]=qs[_0x04a7('0x2d')](_0x24cdaa[_0x04a7('0x3e')]['offset']);}return _0x436c97['getConfigurations'](_0x449102);}})['then'](function(_0x47a26f){if(_0x47a26f){return _0x47a26f?{'count':_0x1668b1,'rows':_0x47a26f}:null;}})[_0x04a7('0x1d')](respondWithResult(_0x3d647a,null))[_0x04a7('0x28')](handleError(_0x3d647a,null));};exports[_0x04a7('0x5d')]=function(_0x1043e6,_0x2cf2ad,_0x1f2b2c){if(_0x1043e6[_0x04a7('0x56')]['id']){delete _0x1043e6[_0x04a7('0x56')]['id'];}return db['DeskAccount']['findOne']({'where':{'id':_0x1043e6['params']['id']}})[_0x04a7('0x1d')](handleEntityNotFound(_0x2cf2ad,null))[_0x04a7('0x1d')](function(_0x58a1a9){if(_0x58a1a9){_0x1043e6['body']['AccountId']=_0x58a1a9['id'];_0x1043e6['body'][_0x04a7('0x5e')]=integrations[_0x04a7('0x5f')](_0x1043e6[_0x04a7('0x56')][_0x04a7('0x60')],_0x1043e6[_0x04a7('0x56')][_0x04a7('0x3b')]);_0x1043e6[_0x04a7('0x56')][_0x04a7('0x61')]=integrations[_0x04a7('0x62')](_0x1043e6[_0x04a7('0x56')][_0x04a7('0x60')],_0x1043e6[_0x04a7('0x56')]['type']);return db[_0x04a7('0x5a')][_0x04a7('0x55')](_0x1043e6[_0x04a7('0x56')],{'include':[{'model':db[_0x04a7('0x63')],'as':_0x04a7('0x5e')},{'model':db[_0x04a7('0x63')],'as':_0x04a7('0x61')}]});}return null;})[_0x04a7('0x1d')](respondWithResult(_0x2cf2ad,null))[_0x04a7('0x28')](handleError(_0x2cf2ad,null));};exports[_0x04a7('0x64')]=function(_0x22e7e5,_0xac53ec,_0xc7fe8b){var _0x399882=[{'name':'priority','label':_0x04a7('0x65'),'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 _0xce36be='';return db['DeskAccount'][_0x04a7('0x59')]({'where':{'id':_0x22e7e5[_0x04a7('0x53')]['id']},'attributes':['id',_0x04a7('0x66'),_0x04a7('0x67'),_0x04a7('0x68'),'password',_0x04a7('0x69'),_0x04a7('0x6a'),'token','tokenSecret']})[_0x04a7('0x1d')](handleEntityNotFound(_0xac53ec,null))['then'](function(_0x1328b9){if(_0x1328b9){_0xce36be=_0x1328b9[_0x04a7('0x66')];var _0x283e1a=_0xce36be['slice'](-0x1);if(_0x283e1a==='/'){_0xce36be=_0xce36be['substring'](0x0,_0xce36be[_0x04a7('0x6b')](_0x283e1a));}var _0x3258a4={'method':_0x04a7('0x6c'),'uri':util[_0x04a7('0x6d')](_0x04a7('0x6e'),_0xce36be),'headers':{'Content-Type':_0x04a7('0x6f'),'Accept':_0x04a7('0x6f')},'json':!![]};if(_0x1328b9[_0x04a7('0x67')]===_0x04a7('0x70')){_0x3258a4[_0x04a7('0x71')][_0x04a7('0x72')]=util['format']('Basic\x20%s',new Buffer(util[_0x04a7('0x6d')](_0x04a7('0x73'),_0x1328b9[_0x04a7('0x68')],_0x1328b9[_0x04a7('0x74')]))[_0x04a7('0x75')]('base64'));}return rp(_0x3258a4)[_0x04a7('0x1d')](function(_0xdb54ea){return _0x399882[_0x04a7('0x76')](_[_0x04a7('0x38')](_0xdb54ea[_0x04a7('0x77')]['entries'],function(_0x864a17){return{'id':_0x864a17[_0x04a7('0x35')],'name':_0x864a17['name'],'type':_0x864a17[_0x04a7('0x3b')],'active':_0x864a17['active'],'label':_0x864a17[_0x04a7('0x78')],'custom':!![]};}));});}})[_0x04a7('0x1d')](function(_0x230467){return{'count':_0x230467[_0x04a7('0x44')],'rows':_0x230467};})[_0x04a7('0x1d')](respondWithResult(_0xac53ec,null))['catch'](function(_0x4c7eba){var _0xba922=_0x22e7e5[_0x04a7('0x3e')][_0x04a7('0x1a')]?0x1f4:_0x4c7eba['statusCode']||0x1f4;logger[_0x04a7('0x24')](_0x04a7('0x79'),_0x04a7('0x64'),_0xba922,JSON['stringify'](_0x4c7eba));delete _0x4c7eba[_0x04a7('0x35')];if(_0xba922===0x191){_0xba922=0x190;}_0xac53ec['status'](_0xba922)['send'](_0x22e7e5['query']['test']?{'message':_0x04a7('0x7a'),'statusCode':_0x4c7eba['statusCode']}:_0x4c7eba);});};
\ No newline at end of file
diff --git a/server/api/intDeskAccount/intDeskAccount.model.js b/server/api/intDeskAccount/intDeskAccount.model.js
index 6876e7b..daab655 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 _0xa028=['api','bluebird','request-promise','path','../../config/environment','./intDeskAccount.attributes','exports','define','int_desk_accounts','lodash','../../config/logger'];(function(_0x3dd15e,_0x1f0015){var _0x231fd0=function(_0x4f680a){while(--_0x4f680a){_0x3dd15e['push'](_0x3dd15e['shift']());}};_0x231fd0(++_0x1f0015);}(_0xa028,0x13d));var _0x8a02=function(_0x5679f6,_0x10c2e4){_0x5679f6=_0x5679f6-0x0;var _0x113688=_0xa028[_0x5679f6];return _0x113688;};'use strict';var _=require(_0x8a02('0x0'));var util=require('util');var logger=require(_0x8a02('0x1'))(_0x8a02('0x2'));var moment=require('moment');var BPromise=require(_0x8a02('0x3'));var rp=require(_0x8a02('0x4'));var fs=require('fs');var path=require(_0x8a02('0x5'));var rimraf=require('rimraf');var config=require(_0x8a02('0x6'));var attributes=require(_0x8a02('0x7'));var integrations=require('../../components/integrations/configuration');module[_0x8a02('0x8')]=function(_0x515f80,_0x283f85){return _0x515f80[_0x8a02('0x9')]('DeskAccount',attributes,{'tableName':_0x8a02('0xa'),'paranoid':![],'indexes':[],'timestamps':!![]});};
\ No newline at end of file
+var _0x3730=['exports','DeskAccount','int_desk_accounts','lodash','util','../../config/logger','api','moment','bluebird','request-promise','./intDeskAccount.attributes'];(function(_0x518e55,_0x162a8c){var _0x21995b=function(_0x4b7db1){while(--_0x4b7db1){_0x518e55['push'](_0x518e55['shift']());}};_0x21995b(++_0x162a8c);}(_0x3730,0x87));var _0x0373=function(_0x3a8ae5,_0x32687a){_0x3a8ae5=_0x3a8ae5-0x0;var _0x550f6d=_0x3730[_0x3a8ae5];return _0x550f6d;};'use strict';var _=require(_0x0373('0x0'));var util=require(_0x0373('0x1'));var logger=require(_0x0373('0x2'))(_0x0373('0x3'));var moment=require(_0x0373('0x4'));var BPromise=require(_0x0373('0x5'));var rp=require(_0x0373('0x6'));var fs=require('fs');var path=require('path');var rimraf=require('rimraf');var config=require('../../config/environment');var attributes=require(_0x0373('0x7'));var integrations=require('../../components/integrations/configuration');module[_0x0373('0x8')]=function(_0x4c7f42,_0x2d10d9){return _0x4c7f42['define'](_0x0373('0x9'),attributes,{'tableName':_0x0373('0xa'),'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 3dd5f42..50c35da 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 _0x692c=['../../config/utils','../../config/logger','../../config/environment','jayson/promise','client','http','then','info','DeskAccount,\x20%s,\x20%s','request\x20sent','debug','DeskAccount,\x20%s,\x20%s,\x20%s','error','code','message','result','catch','DeskAccount','findAll','options','raw','where','attributes','limit','include','map','model','stringify','ShowDeskAccount','find','lodash','util','moment','randomstring','../../mysqldb'];(function(_0x1d2caf,_0x2dd29b){var _0x1ac54f=function(_0x33801c){while(--_0x33801c){_0x1d2caf['push'](_0x1d2caf['shift']());}};_0x1ac54f(++_0x2dd29b);}(_0x692c,0x1c2));var _0xc692=function(_0xd0521b,_0x1a3c13){_0xd0521b=_0xd0521b-0x0;var _0x557af3=_0x692c[_0xd0521b];return _0x557af3;};'use strict';var _=require(_0xc692('0x0'));var util=require(_0xc692('0x1'));var moment=require(_0xc692('0x2'));var BPromise=require('bluebird');var rs=require(_0xc692('0x3'));var fs=require('fs');var Redis=require('ioredis');var db=require(_0xc692('0x4'))['db'];var utils=require(_0xc692('0x5'));var logger=require(_0xc692('0x6'))('rpc');var config=require(_0xc692('0x7'));var jayson=require(_0xc692('0x8'));var client=jayson[_0xc692('0x9')][_0xc692('0xa')]({'port':0x232a});function respondWithRpcPromise(_0x197862,_0x4d7acd,_0x21a956){return new BPromise(function(_0x1a9adb,_0x40cd60){return client['request'](_0x197862,_0x21a956)[_0xc692('0xb')](function(_0x11f4be){logger[_0xc692('0xc')](_0xc692('0xd'),_0x4d7acd,_0xc692('0xe'));logger[_0xc692('0xf')](_0xc692('0x10'),_0x4d7acd,_0xc692('0xe'),JSON['stringify'](_0x11f4be));if(_0x11f4be[_0xc692('0x11')]){if(_0x11f4be[_0xc692('0x11')][_0xc692('0x12')]===0x1f4){logger[_0xc692('0x11')]('DeskAccount,\x20%s,\x20%s',_0x4d7acd,_0x11f4be['error'][_0xc692('0x13')]);return _0x40cd60(_0x11f4be[_0xc692('0x11')][_0xc692('0x13')]);}logger[_0xc692('0x11')](_0xc692('0xd'),_0x4d7acd,_0x11f4be[_0xc692('0x11')][_0xc692('0x13')]);return _0x1a9adb(_0x11f4be[_0xc692('0x11')]['message']);}else{logger[_0xc692('0xc')](_0xc692('0xd'),_0x4d7acd,_0xc692('0xe'));_0x1a9adb(_0x11f4be[_0xc692('0x14')]['message']);}})[_0xc692('0x15')](function(_0x4f8c01){logger[_0xc692('0x11')](_0xc692('0xd'),_0x4d7acd,_0x4f8c01);_0x40cd60(_0x4f8c01);});});}exports['GetDeskAccount']=function(_0xc4b125){var _0x61c4e3=this;return new Promise(function(_0xc4484f,_0x428d54){return db[_0xc692('0x16')][_0xc692('0x17')]({'raw':_0xc4b125['options']?_0xc4b125[_0xc692('0x18')][_0xc692('0x19')]===undefined?!![]:![]:!![],'where':_0xc4b125[_0xc692('0x18')]?_0xc4b125[_0xc692('0x18')][_0xc692('0x1a')]||null:null,'attributes':_0xc4b125[_0xc692('0x18')]?_0xc4b125[_0xc692('0x18')][_0xc692('0x1b')]||null:null,'limit':_0xc4b125['options']?_0xc4b125[_0xc692('0x18')][_0xc692('0x1c')]||null:null,'include':_0xc4b125[_0xc692('0x18')]?_0xc4b125[_0xc692('0x18')][_0xc692('0x1d')]?_[_0xc692('0x1e')](_0xc4b125[_0xc692('0x18')][_0xc692('0x1d')],function(_0x4f2691){return{'model':db[_0x4f2691['model']],'as':_0x4f2691['as'],'attributes':_0x4f2691['attributes'],'include':_0x4f2691[_0xc692('0x1d')]?_['map'](_0x4f2691[_0xc692('0x1d')],function(_0x2e627c){return{'model':db[_0x2e627c[_0xc692('0x1f')]],'as':_0x2e627c['as'],'attributes':_0x2e627c['attributes'],'include':_0x2e627c['include']?_[_0xc692('0x1e')](_0x2e627c[_0xc692('0x1d')],function(_0x20e955){return{'model':db[_0x20e955[_0xc692('0x1f')]],'as':_0x20e955['as'],'attributes':_0x20e955[_0xc692('0x1b')]};}):[]};}):[]};}):[]:[]})[_0xc692('0xb')](function(_0x1f9b25){logger[_0xc692('0xc')]('GetDeskAccount',_0xc4b125);logger[_0xc692('0xf')]('GetDeskAccount',_0xc4b125,JSON[_0xc692('0x20')](_0x1f9b25));_0xc4484f(_0x1f9b25);})[_0xc692('0x15')](function(_0x3dd2e6){logger[_0xc692('0x11')]('GetDeskAccount',_0x3dd2e6[_0xc692('0x13')],_0xc4b125);_0x428d54(_0x61c4e3[_0xc692('0x11')](0x1f4,_0x3dd2e6[_0xc692('0x13')]));});});};exports[_0xc692('0x21')]=function(_0x31d0e8){var _0x14a443=this;return new Promise(function(_0x5c889e,_0x3bf802){return db[_0xc692('0x16')][_0xc692('0x22')]({'raw':_0x31d0e8[_0xc692('0x18')]?_0x31d0e8[_0xc692('0x18')]['raw']===undefined?!![]:![]:!![],'where':_0x31d0e8[_0xc692('0x18')]?_0x31d0e8[_0xc692('0x18')][_0xc692('0x1a')]||null:null,'attributes':_0x31d0e8[_0xc692('0x18')]?_0x31d0e8[_0xc692('0x18')]['attributes']||null:null,'include':_0x31d0e8[_0xc692('0x18')]?_0x31d0e8[_0xc692('0x18')][_0xc692('0x1d')]?_[_0xc692('0x1e')](_0x31d0e8[_0xc692('0x18')]['include'],function(_0x2e95b8){return{'model':db[_0x2e95b8[_0xc692('0x1f')]],'as':_0x2e95b8['as'],'attributes':_0x2e95b8['attributes'],'include':_0x2e95b8[_0xc692('0x1d')]?_[_0xc692('0x1e')](_0x2e95b8[_0xc692('0x1d')],function(_0x491cf6){return{'model':db[_0x491cf6[_0xc692('0x1f')]],'as':_0x491cf6['as'],'attributes':_0x491cf6[_0xc692('0x1b')],'include':_0x491cf6[_0xc692('0x1d')]?_[_0xc692('0x1e')](_0x491cf6[_0xc692('0x1d')],function(_0x45fcb9){return{'model':db[_0x45fcb9[_0xc692('0x1f')]],'as':_0x45fcb9['as'],'attributes':_0x45fcb9[_0xc692('0x1b')]};}):[]};}):[]};}):[]:[]})[_0xc692('0xb')](function(_0x1f321e){logger[_0xc692('0xc')](_0xc692('0x21'),_0x31d0e8);logger[_0xc692('0xf')](_0xc692('0x21'),_0x31d0e8,JSON['stringify'](_0x1f321e));_0x5c889e(_0x1f321e);})[_0xc692('0x15')](function(_0x2b7dd2){logger[_0xc692('0x11')](_0xc692('0x21'),_0x2b7dd2['message'],_0x31d0e8);_0x3bf802(_0x14a443['error'](0x1f4,_0x2b7dd2[_0xc692('0x13')]));});});};
\ No newline at end of file
+var _0x34d9=['jayson/promise','client','http','request','then','info','request\x20sent','DeskAccount,\x20%s,\x20%s,\x20%s','stringify','error','message','result','catch','DeskAccount,\x20%s,\x20%s','GetDeskAccount','DeskAccount','findAll','options','raw','attributes','limit','map','include','model','debug','ShowDeskAccount','find','where','lodash','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','rpc','../../config/environment'];(function(_0x1d393d,_0x5eb1c6){var _0x32a3d0=function(_0x275205){while(--_0x275205){_0x1d393d['push'](_0x1d393d['shift']());}};_0x32a3d0(++_0x5eb1c6);}(_0x34d9,0x1f0));var _0x934d=function(_0x4dc837,_0x4d859a){_0x4dc837=_0x4dc837-0x0;var _0x27bd83=_0x34d9[_0x4dc837];return _0x27bd83;};'use strict';var _=require(_0x934d('0x0'));var util=require('util');var moment=require('moment');var BPromise=require(_0x934d('0x1'));var rs=require(_0x934d('0x2'));var fs=require('fs');var Redis=require(_0x934d('0x3'));var db=require(_0x934d('0x4'))['db'];var utils=require(_0x934d('0x5'));var logger=require('../../config/logger')(_0x934d('0x6'));var config=require(_0x934d('0x7'));var jayson=require(_0x934d('0x8'));var client=jayson[_0x934d('0x9')][_0x934d('0xa')]({'port':0x232a});function respondWithRpcPromise(_0x21b4d0,_0x282d30,_0x111afc){return new BPromise(function(_0x95fe04,_0x51f122){return client[_0x934d('0xb')](_0x21b4d0,_0x111afc)[_0x934d('0xc')](function(_0x41b02f){logger[_0x934d('0xd')]('DeskAccount,\x20%s,\x20%s',_0x282d30,_0x934d('0xe'));logger['debug'](_0x934d('0xf'),_0x282d30,_0x934d('0xe'),JSON[_0x934d('0x10')](_0x41b02f));if(_0x41b02f[_0x934d('0x11')]){if(_0x41b02f[_0x934d('0x11')]['code']===0x1f4){logger['error']('DeskAccount,\x20%s,\x20%s',_0x282d30,_0x41b02f[_0x934d('0x11')][_0x934d('0x12')]);return _0x51f122(_0x41b02f[_0x934d('0x11')][_0x934d('0x12')]);}logger['error']('DeskAccount,\x20%s,\x20%s',_0x282d30,_0x41b02f[_0x934d('0x11')][_0x934d('0x12')]);return _0x95fe04(_0x41b02f[_0x934d('0x11')][_0x934d('0x12')]);}else{logger[_0x934d('0xd')]('DeskAccount,\x20%s,\x20%s',_0x282d30,_0x934d('0xe'));_0x95fe04(_0x41b02f[_0x934d('0x13')][_0x934d('0x12')]);}})[_0x934d('0x14')](function(_0x489b22){logger['error'](_0x934d('0x15'),_0x282d30,_0x489b22);_0x51f122(_0x489b22);});});}exports[_0x934d('0x16')]=function(_0x1fb8c2){var _0x5ebe3a=this;return new Promise(function(_0x57ba17,_0x58815f){return db[_0x934d('0x17')][_0x934d('0x18')]({'raw':_0x1fb8c2['options']?_0x1fb8c2[_0x934d('0x19')][_0x934d('0x1a')]===undefined?!![]:![]:!![],'where':_0x1fb8c2[_0x934d('0x19')]?_0x1fb8c2[_0x934d('0x19')]['where']||null:null,'attributes':_0x1fb8c2['options']?_0x1fb8c2[_0x934d('0x19')][_0x934d('0x1b')]||null:null,'limit':_0x1fb8c2['options']?_0x1fb8c2[_0x934d('0x19')][_0x934d('0x1c')]||null:null,'include':_0x1fb8c2['options']?_0x1fb8c2['options']['include']?_[_0x934d('0x1d')](_0x1fb8c2[_0x934d('0x19')][_0x934d('0x1e')],function(_0x1f8628){return{'model':db[_0x1f8628[_0x934d('0x1f')]],'as':_0x1f8628['as'],'attributes':_0x1f8628[_0x934d('0x1b')],'include':_0x1f8628[_0x934d('0x1e')]?_[_0x934d('0x1d')](_0x1f8628['include'],function(_0x3cc435){return{'model':db[_0x3cc435[_0x934d('0x1f')]],'as':_0x3cc435['as'],'attributes':_0x3cc435[_0x934d('0x1b')],'include':_0x3cc435[_0x934d('0x1e')]?_[_0x934d('0x1d')](_0x3cc435[_0x934d('0x1e')],function(_0x5bf7ba){return{'model':db[_0x5bf7ba[_0x934d('0x1f')]],'as':_0x5bf7ba['as'],'attributes':_0x5bf7ba[_0x934d('0x1b')]};}):[]};}):[]};}):[]:[]})[_0x934d('0xc')](function(_0x297206){logger[_0x934d('0xd')](_0x934d('0x16'),_0x1fb8c2);logger[_0x934d('0x20')](_0x934d('0x16'),_0x1fb8c2,JSON['stringify'](_0x297206));_0x57ba17(_0x297206);})[_0x934d('0x14')](function(_0x23d814){logger['error'](_0x934d('0x16'),_0x23d814[_0x934d('0x12')],_0x1fb8c2);_0x58815f(_0x5ebe3a[_0x934d('0x11')](0x1f4,_0x23d814[_0x934d('0x12')]));});});};exports[_0x934d('0x21')]=function(_0x3ed2bb){var _0x5433a7=this;return new Promise(function(_0x1fccef,_0x40c9a1){return db[_0x934d('0x17')][_0x934d('0x22')]({'raw':_0x3ed2bb[_0x934d('0x19')]?_0x3ed2bb['options']['raw']===undefined?!![]:![]:!![],'where':_0x3ed2bb[_0x934d('0x19')]?_0x3ed2bb[_0x934d('0x19')][_0x934d('0x23')]||null:null,'attributes':_0x3ed2bb[_0x934d('0x19')]?_0x3ed2bb[_0x934d('0x19')][_0x934d('0x1b')]||null:null,'include':_0x3ed2bb[_0x934d('0x19')]?_0x3ed2bb['options']['include']?_[_0x934d('0x1d')](_0x3ed2bb['options'][_0x934d('0x1e')],function(_0x47d26b){return{'model':db[_0x47d26b[_0x934d('0x1f')]],'as':_0x47d26b['as'],'attributes':_0x47d26b[_0x934d('0x1b')],'include':_0x47d26b['include']?_[_0x934d('0x1d')](_0x47d26b[_0x934d('0x1e')],function(_0x46ff27){return{'model':db[_0x46ff27[_0x934d('0x1f')]],'as':_0x46ff27['as'],'attributes':_0x46ff27[_0x934d('0x1b')],'include':_0x46ff27[_0x934d('0x1e')]?_[_0x934d('0x1d')](_0x46ff27['include'],function(_0x13322d){return{'model':db[_0x13322d[_0x934d('0x1f')]],'as':_0x13322d['as'],'attributes':_0x13322d[_0x934d('0x1b')]};}):[]};}):[]};}):[]:[]})[_0x934d('0xc')](function(_0x1b41d5){logger[_0x934d('0xd')](_0x934d('0x21'),_0x3ed2bb);logger[_0x934d('0x20')](_0x934d('0x21'),_0x3ed2bb,JSON['stringify'](_0x1b41d5));_0x1fccef(_0x1b41d5);})[_0x934d('0x14')](function(_0x163361){logger[_0x934d('0x11')](_0x934d('0x21'),_0x163361[_0x934d('0x12')],_0x3ed2bb);_0x40c9a1(_0x5433a7[_0x934d('0x11')](0x1f4,_0x163361[_0x934d('0x12')]));});});};
\ No newline at end of file
diff --git a/server/api/intDeskConfiguration/index.js b/server/api/intDeskConfiguration/index.js
index 7b17617..10a5aeb 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 _0x7a54=['/:id/tags','getTags','post','setTags','put','/:id','update','destroy','exports','multer','util','path','express','Router','../../components/interaction/service','../../config/environment','./intDeskConfiguration.controller','get','isAuthenticated','show','/:id/fields','/:id/subjects','getDescriptions'];(function(_0x540842,_0x4017eb){var _0x85498e=function(_0x5620d2){while(--_0x5620d2){_0x540842['push'](_0x540842['shift']());}};_0x85498e(++_0x4017eb);}(_0x7a54,0x106));var _0x47a5=function(_0x10d132,_0x4ab394){_0x10d132=_0x10d132-0x0;var _0x27e70e=_0x7a54[_0x10d132];return _0x27e70e;};'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')]('/:id',auth[_0x47a5('0x9')](),controller[_0x47a5('0xa')]);router['get'](_0x47a5('0xb'),auth['isAuthenticated'](),controller['getFields']);router['get'](_0x47a5('0xc'),auth[_0x47a5('0x9')](),controller['getSubjects']);router[_0x47a5('0x8')]('/:id/descriptions',auth['isAuthenticated'](),controller[_0x47a5('0xd')]);router[_0x47a5('0x8')](_0x47a5('0xe'),auth[_0x47a5('0x9')](),controller[_0x47a5('0xf')]);router[_0x47a5('0x10')]('/',auth[_0x47a5('0x9')](),controller['create']);router[_0x47a5('0x10')](_0x47a5('0xe'),auth[_0x47a5('0x9')](),controller[_0x47a5('0x11')]);router[_0x47a5('0x12')](_0x47a5('0x13'),auth[_0x47a5('0x9')](),controller[_0x47a5('0x14')]);router['delete'](_0x47a5('0x13'),auth[_0x47a5('0x9')](),controller[_0x47a5('0x15')]);module[_0x47a5('0x16')]=router;
\ No newline at end of file
+var _0x23bb=['getDescriptions','getTags','post','create','/:id/tags','setTags','put','/:id','update','delete','destroy','multer','connect-timeout','express','Router','../../components/interaction/service','../../config/environment','./intDeskConfiguration.controller','get','isAuthenticated','/:id/subjects','getSubjects'];(function(_0x20752e,_0x25627c){var _0x36f5f4=function(_0xcf6596){while(--_0xcf6596){_0x20752e['push'](_0x20752e['shift']());}};_0x36f5f4(++_0x25627c);}(_0x23bb,0x79));var _0xb23b=function(_0x57252a,_0x1ceae9){_0x57252a=_0x57252a-0x0;var _0x2733a8=_0x23bb[_0x57252a];return _0x2733a8;};'use strict';var multer=require(_0xb23b('0x0'));var util=require('util');var path=require('path');var timeout=require(_0xb23b('0x1'));var express=require(_0xb23b('0x2'));var router=express[_0xb23b('0x3')]();var auth=require('../../components/auth/service');var interaction=require(_0xb23b('0x4'));var config=require(_0xb23b('0x5'));var controller=require(_0xb23b('0x6'));router['get']('/',auth['isAuthenticated'](),controller['index']);router[_0xb23b('0x7')]('/:id',auth['isAuthenticated'](),controller['show']);router[_0xb23b('0x7')]('/:id/fields',auth[_0xb23b('0x8')](),controller['getFields']);router[_0xb23b('0x7')](_0xb23b('0x9'),auth['isAuthenticated'](),controller[_0xb23b('0xa')]);router[_0xb23b('0x7')]('/:id/descriptions',auth[_0xb23b('0x8')](),controller[_0xb23b('0xb')]);router[_0xb23b('0x7')]('/:id/tags',auth[_0xb23b('0x8')](),controller[_0xb23b('0xc')]);router[_0xb23b('0xd')]('/',auth[_0xb23b('0x8')](),controller[_0xb23b('0xe')]);router[_0xb23b('0xd')](_0xb23b('0xf'),auth[_0xb23b('0x8')](),controller[_0xb23b('0x10')]);router[_0xb23b('0x11')](_0xb23b('0x12'),auth[_0xb23b('0x8')](),controller[_0xb23b('0x13')]);router[_0xb23b('0x14')](_0xb23b('0x12'),auth[_0xb23b('0x8')](),controller[_0xb23b('0x15')]);module['exports']=router;
\ No newline at end of file
diff --git a/server/api/intDeskConfiguration/intDeskConfiguration.attributes.js b/server/api/intDeskConfiguration/intDeskConfiguration.attributes.js
index cb7ee17..1d4249b 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 _0x132d=['exports','STRING','sequelize'];(function(_0x397e5f,_0x454c8f){var _0x5302b8=function(_0x1a29ef){while(--_0x1a29ef){_0x397e5f['push'](_0x397e5f['shift']());}};_0x5302b8(++_0x454c8f);}(_0x132d,0x1b5));var _0xd132=function(_0x20db32,_0x105065){_0x20db32=_0x20db32-0x0;var _0x2ea165=_0x132d[_0x20db32];return _0x2ea165;};'use strict';var Sequelize=require(_0xd132('0x0'));module[_0xd132('0x1')]={'name':{'type':Sequelize[_0xd132('0x2')]},'description':{'type':Sequelize[_0xd132('0x2')]}};
\ No newline at end of file
+var _0xdb18=['STRING'];(function(_0x18dce0,_0x12947d){var _0x214321=function(_0x2e2086){while(--_0x2e2086){_0x18dce0['push'](_0x18dce0['shift']());}};_0x214321(++_0x12947d);}(_0xdb18,0x1a0));var _0x8db1=function(_0x9698a8,_0x369203){_0x9698a8=_0x9698a8-0x0;var _0x22902a=_0xdb18[_0x9698a8];return _0x22902a;};'use strict';var Sequelize=require('sequelize');module['exports']={'name':{'type':Sequelize[_0x8db1('0x0')]},'description':{'type':Sequelize['STRING']}};
\ No newline at end of file
diff --git a/server/api/intDeskConfiguration/intDeskConfiguration.controller.js b/server/api/intDeskConfiguration/intDeskConfiguration.controller.js
index 7b74e18..95ebc85 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 _0xbfc5=['path','sox','to-csv','ejs','lodash','squel','jsforce','querystring','ioredis','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','../../config/utils','../../config/environment','../../mysqldb','jayson/promise','client','http','test','Sequelize','ValidationError','then','info','DeskConfiguration,\x20%s,\x20%s','request\x20sent','debug','DeskConfiguration,\x20%s,\x20%s,\x20%s','stringify','error','message','result','sendStatus','status','end','json','count','offset','limit','set','Content-Range','apply','save','update','destroy','stack','name','send','index','map','DeskConfiguration','rawAttributes','key','model','query','filters','intersection','attributes','fields','hasOwnProperty','nolimit','order','sort','where','merge','type','VIRTUAL','filter','includeAll','include','findAll','rows','catch','show','params','keys','length','options','find','create','body','getFields','pick','getSubjects','findOne','DeskField','getDescriptions','Tag','getTags','ids','rimraf','zip-dir','fast-json-patch','moment','mustache','util'];(function(_0x1e7b16,_0x4607a1){var _0x37fadc=function(_0x1fc9ce){while(--_0x1fc9ce){_0x1e7b16['push'](_0x1e7b16['shift']());}};_0x37fadc(++_0x4607a1);}(_0xbfc5,0xba));var _0x5bfc=function(_0x1fc09f,_0x4626b8){_0x1fc09f=_0x1fc09f-0x0;var _0x3ce059=_0xbfc5[_0x1fc09f];return _0x3ce059;};'use strict';var pdf=require('html-pdf');var emlformat=require('eml-format');var rimraf=require(_0x5bfc('0x0'));var zipdir=require(_0x5bfc('0x1'));var jsonpatch=require(_0x5bfc('0x2'));var rp=require('request-promise');var moment=require(_0x5bfc('0x3'));var BPromise=require('bluebird');var Mustache=require(_0x5bfc('0x4'));var util=require(_0x5bfc('0x5'));var path=require(_0x5bfc('0x6'));var sox=require(_0x5bfc('0x7'));var csv=require(_0x5bfc('0x8'));var ejs=require(_0x5bfc('0x9'));var fs=require('fs');var _=require(_0x5bfc('0xa'));var squel=require(_0x5bfc('0xb'));var crypto=require('crypto');var jsforce=require(_0x5bfc('0xc'));var deskjs=require('desk.js');var toCsv=require('to-csv');var querystring=require(_0x5bfc('0xd'));var Papa=require('papaparse');var Redis=require(_0x5bfc('0xe'));var authService=require('../../components/auth/service');var qs=require(_0x5bfc('0xf'));var as=require(_0x5bfc('0x10'));var hardwareService=require(_0x5bfc('0x11'));var logger=require(_0x5bfc('0x12'))('api');var utils=require(_0x5bfc('0x13'));var config=require(_0x5bfc('0x14'));var db=require(_0x5bfc('0x15'))['db'];var jayson=require(_0x5bfc('0x16'));var client=jayson[_0x5bfc('0x17')][_0x5bfc('0x18')]({'port':0x232a});function checkPasswordPattern(_0x38836d,_0xab39d7,_0x440399){if(_0x440399){var _0x4bba0c=new RegExp(/(?=.*[a-z])(?=.*[A-Z])(?=.*[0-9])(?=.*[?!@#\$%\^&\*~\-_=+[{\]\}])(?=.{8,})/);if(_0x4bba0c[_0x5bfc('0x19')](_0xab39d7)){return _0x38836d;}else{throw new db[(_0x5bfc('0x1a'))][(_0x5bfc('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 _0x38836d;}}function respondWithRpcPromise(_0x132d4c,_0x9ddf3,_0x5be348,_0x288588){return new BPromise(function(_0x175c30,_0x2884f7){var _0x215387=_0x288588||client;return _0x215387['request'](_0x132d4c,_0x5be348)[_0x5bfc('0x1c')](function(_0x585fae){logger[_0x5bfc('0x1d')](_0x5bfc('0x1e'),_0x9ddf3,_0x5bfc('0x1f'));logger[_0x5bfc('0x20')](_0x5bfc('0x21'),_0x9ddf3,_0x5bfc('0x1f'),JSON[_0x5bfc('0x22')](_0x585fae));if(_0x585fae[_0x5bfc('0x23')]){if(_0x585fae[_0x5bfc('0x23')]['code']===0x1f4){logger[_0x5bfc('0x23')]('DeskConfiguration,\x20%s,\x20%s',_0x9ddf3,_0x585fae[_0x5bfc('0x23')][_0x5bfc('0x24')]);return _0x2884f7(_0x585fae['error'][_0x5bfc('0x24')]);}logger[_0x5bfc('0x23')](_0x5bfc('0x1e'),_0x9ddf3,_0x585fae[_0x5bfc('0x23')][_0x5bfc('0x24')]);return _0x175c30(_0x585fae['error'][_0x5bfc('0x24')]);}else{logger[_0x5bfc('0x1d')](_0x5bfc('0x1e'),_0x9ddf3,_0x5bfc('0x1f'));_0x175c30(_0x585fae[_0x5bfc('0x25')][_0x5bfc('0x24')]);}})['catch'](function(_0xd33256){logger[_0x5bfc('0x23')](_0x5bfc('0x1e'),_0x9ddf3,_0xd33256);_0x2884f7(_0xd33256);});});}function respondWithStatusCode(_0x3e5e95,_0x1b96ec){_0x1b96ec=_0x1b96ec||0xcc;return function(_0xcf9052){if(_0xcf9052){return _0x3e5e95[_0x5bfc('0x26')](_0x1b96ec);}return _0x3e5e95[_0x5bfc('0x27')](_0x1b96ec)[_0x5bfc('0x28')]();};}function respondWithResult(_0x3c0ee9,_0xb9765c){_0xb9765c=_0xb9765c||0xc8;return function(_0x5ef37c){if(_0x5ef37c){return _0x3c0ee9[_0x5bfc('0x27')](_0xb9765c)[_0x5bfc('0x29')](_0x5ef37c);}};}function respondWithFilteredResult(_0x3776cb,_0x211170){return function(_0x1dbcf0){if(_0x1dbcf0){var _0x57be46=_0x1dbcf0[_0x5bfc('0x2a')],_0x324a82=_0x211170[_0x5bfc('0x2b')],_0x256ae8=_0x211170[_0x5bfc('0x2b')]+_0x211170[_0x5bfc('0x2c')],_0x3656fa;if(_0x256ae8>=_0x57be46){_0x256ae8=_0x57be46;_0x3656fa=0xc8;}else{_0x3656fa=0xce;}_0x3776cb['status'](_0x3656fa);return _0x3776cb[_0x5bfc('0x2d')](_0x5bfc('0x2e'),_0x324a82+'-'+_0x256ae8+'/'+_0x57be46)[_0x5bfc('0x29')](_0x1dbcf0);}return null;};}function patchUpdates(_0x65972e){return function(_0x4a4d0f){try{jsonpatch[_0x5bfc('0x2f')](_0x4a4d0f,_0x65972e,!![]);}catch(_0x10b6e7){return BPromise['reject'](_0x10b6e7);}return _0x4a4d0f[_0x5bfc('0x30')]();};}function saveUpdates(_0x2202fa,_0x557453){return function(_0x5a8dfc){if(_0x5a8dfc){return _0x5a8dfc[_0x5bfc('0x31')](_0x2202fa)[_0x5bfc('0x1c')](function(_0x5ad380){return _0x5ad380;});}return null;};}function removeEntity(_0x5b3b09,_0x1d8e2f){return function(_0x5788e1){if(_0x5788e1){return _0x5788e1[_0x5bfc('0x32')]()['then'](function(){_0x5b3b09[_0x5bfc('0x27')](0xcc)[_0x5bfc('0x28')]();});}};}function handleEntityNotFound(_0x36052b,_0x51bc83){return function(_0x14f1f2){if(!_0x14f1f2){_0x36052b[_0x5bfc('0x26')](0x194);}return _0x14f1f2;};}function handleError(_0x453aae,_0x520abc){_0x520abc=_0x520abc||0x1f4;return function(_0x52c43f){logger[_0x5bfc('0x23')](_0x52c43f[_0x5bfc('0x33')]);if(_0x52c43f[_0x5bfc('0x34')]){delete _0x52c43f[_0x5bfc('0x34')];}_0x453aae[_0x5bfc('0x27')](_0x520abc)[_0x5bfc('0x35')](_0x52c43f);};}exports[_0x5bfc('0x36')]=function(_0x59b8f5,_0x1da61c){var _0x24478f={},_0x3d4706={},_0x3ce0d3={'count':0x0,'rows':[]};var _0x2353f2=_[_0x5bfc('0x37')](db[_0x5bfc('0x38')][_0x5bfc('0x39')],function(_0x2b0bc9){return{'name':_0x2b0bc9['fieldName'],'type':_0x2b0bc9['type'][_0x5bfc('0x3a')]};});_0x3d4706[_0x5bfc('0x3b')]=_[_0x5bfc('0x37')](_0x2353f2,'name');_0x3d4706['query']=_['keys'](_0x59b8f5[_0x5bfc('0x3c')]);_0x3d4706[_0x5bfc('0x3d')]=_[_0x5bfc('0x3e')](_0x3d4706[_0x5bfc('0x3b')],_0x3d4706[_0x5bfc('0x3c')]);_0x24478f[_0x5bfc('0x3f')]=_[_0x5bfc('0x3e')](_0x3d4706['model'],qs['fields'](_0x59b8f5[_0x5bfc('0x3c')][_0x5bfc('0x40')]));_0x24478f[_0x5bfc('0x3f')]=_0x24478f[_0x5bfc('0x3f')]['length']?_0x24478f[_0x5bfc('0x3f')]:_0x3d4706[_0x5bfc('0x3b')];if(!_0x59b8f5['query'][_0x5bfc('0x41')](_0x5bfc('0x42'))){_0x24478f[_0x5bfc('0x2c')]=qs[_0x5bfc('0x2c')](_0x59b8f5[_0x5bfc('0x3c')]['limit']);_0x24478f[_0x5bfc('0x2b')]=qs[_0x5bfc('0x2b')](_0x59b8f5['query']['offset']);}_0x24478f[_0x5bfc('0x43')]=qs[_0x5bfc('0x44')](_0x59b8f5[_0x5bfc('0x3c')][_0x5bfc('0x44')]);_0x24478f['where']=qs[_0x5bfc('0x3d')](_['pick'](_0x59b8f5[_0x5bfc('0x3c')],_0x3d4706['filters']));if(_0x59b8f5[_0x5bfc('0x3c')]['filter']){_0x24478f[_0x5bfc('0x45')]=_[_0x5bfc('0x46')](_0x24478f[_0x5bfc('0x45')],{'$or':_[_0x5bfc('0x37')](_0x2353f2,function(_0x13d062){if(_0x13d062[_0x5bfc('0x47')]!==_0x5bfc('0x48')){var _0x57b4de={};_0x57b4de[_0x13d062[_0x5bfc('0x34')]]={'$like':'%'+_0x59b8f5['query'][_0x5bfc('0x49')]+'%'};return _0x57b4de;}})});}_0x24478f=_[_0x5bfc('0x46')]({},_0x24478f,_0x59b8f5['options']);var _0x4c101f={'where':_0x24478f[_0x5bfc('0x45')]};return db['DeskConfiguration'][_0x5bfc('0x2a')](_0x4c101f)[_0x5bfc('0x1c')](function(_0x3dd768){_0x3ce0d3[_0x5bfc('0x2a')]=_0x3dd768;if(_0x59b8f5[_0x5bfc('0x3c')][_0x5bfc('0x4a')]){_0x24478f[_0x5bfc('0x4b')]=[{'all':!![]}];}return db[_0x5bfc('0x38')][_0x5bfc('0x4c')](_0x24478f);})['then'](function(_0x34a7ae){_0x3ce0d3[_0x5bfc('0x4d')]=_0x34a7ae;return _0x3ce0d3;})[_0x5bfc('0x1c')](respondWithFilteredResult(_0x1da61c,_0x24478f))[_0x5bfc('0x4e')](handleError(_0x1da61c,null));};exports[_0x5bfc('0x4f')]=function(_0x463f72,_0x1f3745){var _0x4a4c52={'raw':![],'where':{'id':_0x463f72[_0x5bfc('0x50')]['id']}},_0xbe549d={};_0xbe549d[_0x5bfc('0x3b')]=_[_0x5bfc('0x51')](db['DeskConfiguration']['rawAttributes']);_0xbe549d[_0x5bfc('0x3c')]=_[_0x5bfc('0x51')](_0x463f72['query']);_0xbe549d[_0x5bfc('0x3d')]=_[_0x5bfc('0x3e')](_0xbe549d[_0x5bfc('0x3b')],_0xbe549d[_0x5bfc('0x3c')]);_0x4a4c52[_0x5bfc('0x3f')]=_[_0x5bfc('0x3e')](_0xbe549d[_0x5bfc('0x3b')],qs[_0x5bfc('0x40')](_0x463f72['query'][_0x5bfc('0x40')]));_0x4a4c52['attributes']=_0x4a4c52[_0x5bfc('0x3f')][_0x5bfc('0x52')]?_0x4a4c52[_0x5bfc('0x3f')]:_0xbe549d[_0x5bfc('0x3b')];if(_0x463f72[_0x5bfc('0x3c')][_0x5bfc('0x4a')]){_0x4a4c52[_0x5bfc('0x4b')]=[{'all':!![]}];}_0x4a4c52=_[_0x5bfc('0x46')]({},_0x4a4c52,_0x463f72[_0x5bfc('0x53')]);return db[_0x5bfc('0x38')][_0x5bfc('0x54')](_0x4a4c52)['then'](handleEntityNotFound(_0x1f3745,null))[_0x5bfc('0x1c')](respondWithResult(_0x1f3745,null))['catch'](handleError(_0x1f3745,null));};exports[_0x5bfc('0x55')]=function(_0x513d91,_0x29440c){return db[_0x5bfc('0x38')][_0x5bfc('0x55')](_0x513d91[_0x5bfc('0x56')],{})['then'](respondWithResult(_0x29440c,0xc9))[_0x5bfc('0x4e')](handleError(_0x29440c,null));};exports[_0x5bfc('0x31')]=function(_0x97bc97,_0x1bca74){if(_0x97bc97['body']['id']){delete _0x97bc97[_0x5bfc('0x56')]['id'];}return db[_0x5bfc('0x38')][_0x5bfc('0x54')]({'where':{'id':_0x97bc97[_0x5bfc('0x50')]['id']}})['then'](handleEntityNotFound(_0x1bca74,null))['then'](saveUpdates(_0x97bc97[_0x5bfc('0x56')],null))[_0x5bfc('0x1c')](respondWithResult(_0x1bca74,null))['catch'](handleError(_0x1bca74,null));};exports[_0x5bfc('0x32')]=function(_0x4c9a79,_0x52989f){return db[_0x5bfc('0x38')][_0x5bfc('0x54')]({'where':{'id':_0x4c9a79[_0x5bfc('0x50')]['id']}})['then'](handleEntityNotFound(_0x52989f,null))[_0x5bfc('0x1c')](removeEntity(_0x52989f,null))[_0x5bfc('0x4e')](handleError(_0x52989f,null));};exports[_0x5bfc('0x57')]=function(_0x4f9a0f,_0x1cd543,_0x4751e3){var _0x8bd4cb={};var _0x1a895b={};var _0x16c548;var _0x1e493f;return db[_0x5bfc('0x38')]['findOne']({'where':{'id':_0x4f9a0f[_0x5bfc('0x50')]['id']}})[_0x5bfc('0x1c')](handleEntityNotFound(_0x1cd543,null))['then'](function(_0x7a8393){if(_0x7a8393){_0x16c548=_0x7a8393;_0x1a895b['model']=_[_0x5bfc('0x51')](db['DeskField']['rawAttributes']);_0x1a895b[_0x5bfc('0x3c')]=_[_0x5bfc('0x51')](_0x4f9a0f[_0x5bfc('0x3c')]);_0x1a895b[_0x5bfc('0x3d')]=_['intersection'](_0x1a895b['model'],_0x1a895b[_0x5bfc('0x3c')]);_0x8bd4cb[_0x5bfc('0x3f')]=_['intersection'](_0x1a895b[_0x5bfc('0x3b')],qs[_0x5bfc('0x40')](_0x4f9a0f[_0x5bfc('0x3c')][_0x5bfc('0x40')]));_0x8bd4cb[_0x5bfc('0x3f')]=_0x8bd4cb[_0x5bfc('0x3f')][_0x5bfc('0x52')]?_0x8bd4cb[_0x5bfc('0x3f')]:_0x1a895b[_0x5bfc('0x3b')];_0x8bd4cb[_0x5bfc('0x43')]=qs[_0x5bfc('0x44')](_0x4f9a0f[_0x5bfc('0x3c')][_0x5bfc('0x44')]);_0x8bd4cb[_0x5bfc('0x45')]=qs[_0x5bfc('0x3d')](_[_0x5bfc('0x58')](_0x4f9a0f[_0x5bfc('0x3c')],_0x1a895b[_0x5bfc('0x3d')]));if(_0x4f9a0f[_0x5bfc('0x3c')][_0x5bfc('0x49')]){_0x8bd4cb[_0x5bfc('0x45')]=_[_0x5bfc('0x46')](_0x8bd4cb[_0x5bfc('0x45')],{'$or':_[_0x5bfc('0x37')](_0x8bd4cb[_0x5bfc('0x3f')],function(_0x4b1e4d){var _0x118c82={};_0x118c82[_0x4b1e4d]={'$like':'%'+_0x4f9a0f[_0x5bfc('0x3c')]['filter']+'%'};return _0x118c82;})});}_0x8bd4cb=_[_0x5bfc('0x46')]({},_0x8bd4cb,_0x4f9a0f[_0x5bfc('0x53')]);return _0x16c548[_0x5bfc('0x57')](_0x8bd4cb);}})[_0x5bfc('0x1c')](function(_0x1f44b4){if(_0x1f44b4){_0x1e493f=_0x1f44b4[_0x5bfc('0x52')];if(!_0x4f9a0f['query'][_0x5bfc('0x41')](_0x5bfc('0x42'))){_0x8bd4cb[_0x5bfc('0x2c')]=qs[_0x5bfc('0x2c')](_0x4f9a0f[_0x5bfc('0x3c')]['limit']);_0x8bd4cb['offset']=qs[_0x5bfc('0x2b')](_0x4f9a0f[_0x5bfc('0x3c')][_0x5bfc('0x2b')]);}return _0x16c548[_0x5bfc('0x57')](_0x8bd4cb);}})[_0x5bfc('0x1c')](function(_0x45245a){if(_0x45245a){return _0x45245a?{'count':_0x1e493f,'rows':_0x45245a}:null;}})[_0x5bfc('0x1c')](respondWithResult(_0x1cd543,null))[_0x5bfc('0x4e')](handleError(_0x1cd543,null));};exports[_0x5bfc('0x59')]=function(_0xa92337,_0x29ea70,_0x1b1dfc){var _0x25b0b6={};var _0x498644={};var _0x542575;var _0x3284e9;return db[_0x5bfc('0x38')][_0x5bfc('0x5a')]({'where':{'id':_0xa92337[_0x5bfc('0x50')]['id']}})['then'](handleEntityNotFound(_0x29ea70,null))[_0x5bfc('0x1c')](function(_0x5d8b89){if(_0x5d8b89){_0x542575=_0x5d8b89;_0x498644[_0x5bfc('0x3b')]=_[_0x5bfc('0x51')](db[_0x5bfc('0x5b')][_0x5bfc('0x39')]);_0x498644[_0x5bfc('0x3c')]=_[_0x5bfc('0x51')](_0xa92337[_0x5bfc('0x3c')]);_0x498644['filters']=_[_0x5bfc('0x3e')](_0x498644[_0x5bfc('0x3b')],_0x498644[_0x5bfc('0x3c')]);_0x25b0b6[_0x5bfc('0x3f')]=_['intersection'](_0x498644['model'],qs['fields'](_0xa92337[_0x5bfc('0x3c')]['fields']));_0x25b0b6[_0x5bfc('0x3f')]=_0x25b0b6[_0x5bfc('0x3f')]['length']?_0x25b0b6[_0x5bfc('0x3f')]:_0x498644['model'];_0x25b0b6[_0x5bfc('0x43')]=qs[_0x5bfc('0x44')](_0xa92337[_0x5bfc('0x3c')][_0x5bfc('0x44')]);_0x25b0b6['where']=qs['filters'](_[_0x5bfc('0x58')](_0xa92337['query'],_0x498644[_0x5bfc('0x3d')]));if(_0xa92337[_0x5bfc('0x3c')]['filter']){_0x25b0b6['where']=_[_0x5bfc('0x46')](_0x25b0b6[_0x5bfc('0x45')],{'$or':_[_0x5bfc('0x37')](_0x25b0b6[_0x5bfc('0x3f')],function(_0x524706){var _0x3117fa={};_0x3117fa[_0x524706]={'$like':'%'+_0xa92337[_0x5bfc('0x3c')][_0x5bfc('0x49')]+'%'};return _0x3117fa;})});}_0x25b0b6=_[_0x5bfc('0x46')]({},_0x25b0b6,_0xa92337[_0x5bfc('0x53')]);return _0x542575['getSubjects'](_0x25b0b6);}})[_0x5bfc('0x1c')](function(_0x1aba92){if(_0x1aba92){_0x3284e9=_0x1aba92[_0x5bfc('0x52')];if(!_0xa92337[_0x5bfc('0x3c')][_0x5bfc('0x41')](_0x5bfc('0x42'))){_0x25b0b6[_0x5bfc('0x2c')]=qs[_0x5bfc('0x2c')](_0xa92337['query']['limit']);_0x25b0b6[_0x5bfc('0x2b')]=qs[_0x5bfc('0x2b')](_0xa92337['query'][_0x5bfc('0x2b')]);}return _0x542575[_0x5bfc('0x59')](_0x25b0b6);}})[_0x5bfc('0x1c')](function(_0x297e5d){if(_0x297e5d){return _0x297e5d?{'count':_0x3284e9,'rows':_0x297e5d}:null;}})[_0x5bfc('0x1c')](respondWithResult(_0x29ea70,null))[_0x5bfc('0x4e')](handleError(_0x29ea70,null));};exports['getDescriptions']=function(_0x234519,_0x5585a8,_0x5cfaa2){var _0x23d8ad={};var _0x4a862c={};var _0x326be1;var _0x38b3a7;return db[_0x5bfc('0x38')]['findOne']({'where':{'id':_0x234519[_0x5bfc('0x50')]['id']}})[_0x5bfc('0x1c')](handleEntityNotFound(_0x5585a8,null))[_0x5bfc('0x1c')](function(_0x2fa2cc){if(_0x2fa2cc){_0x326be1=_0x2fa2cc;_0x4a862c[_0x5bfc('0x3b')]=_[_0x5bfc('0x51')](db[_0x5bfc('0x5b')][_0x5bfc('0x39')]);_0x4a862c['query']=_[_0x5bfc('0x51')](_0x234519[_0x5bfc('0x3c')]);_0x4a862c[_0x5bfc('0x3d')]=_['intersection'](_0x4a862c['model'],_0x4a862c[_0x5bfc('0x3c')]);_0x23d8ad[_0x5bfc('0x3f')]=_[_0x5bfc('0x3e')](_0x4a862c[_0x5bfc('0x3b')],qs[_0x5bfc('0x40')](_0x234519['query'][_0x5bfc('0x40')]));_0x23d8ad[_0x5bfc('0x3f')]=_0x23d8ad[_0x5bfc('0x3f')][_0x5bfc('0x52')]?_0x23d8ad['attributes']:_0x4a862c[_0x5bfc('0x3b')];_0x23d8ad['order']=qs['sort'](_0x234519[_0x5bfc('0x3c')][_0x5bfc('0x44')]);_0x23d8ad[_0x5bfc('0x45')]=qs[_0x5bfc('0x3d')](_['pick'](_0x234519[_0x5bfc('0x3c')],_0x4a862c[_0x5bfc('0x3d')]));if(_0x234519[_0x5bfc('0x3c')][_0x5bfc('0x49')]){_0x23d8ad[_0x5bfc('0x45')]=_[_0x5bfc('0x46')](_0x23d8ad[_0x5bfc('0x45')],{'$or':_[_0x5bfc('0x37')](_0x23d8ad[_0x5bfc('0x3f')],function(_0xce31e7){var _0x1eb427={};_0x1eb427[_0xce31e7]={'$like':'%'+_0x234519['query'][_0x5bfc('0x49')]+'%'};return _0x1eb427;})});}_0x23d8ad=_[_0x5bfc('0x46')]({},_0x23d8ad,_0x234519[_0x5bfc('0x53')]);return _0x326be1[_0x5bfc('0x5c')](_0x23d8ad);}})['then'](function(_0x3273ab){if(_0x3273ab){_0x38b3a7=_0x3273ab[_0x5bfc('0x52')];if(!_0x234519[_0x5bfc('0x3c')][_0x5bfc('0x41')](_0x5bfc('0x42'))){_0x23d8ad['limit']=qs[_0x5bfc('0x2c')](_0x234519[_0x5bfc('0x3c')]['limit']);_0x23d8ad[_0x5bfc('0x2b')]=qs[_0x5bfc('0x2b')](_0x234519[_0x5bfc('0x3c')]['offset']);}return _0x326be1['getDescriptions'](_0x23d8ad);}})[_0x5bfc('0x1c')](function(_0x4893d7){if(_0x4893d7){return _0x4893d7?{'count':_0x38b3a7,'rows':_0x4893d7}:null;}})[_0x5bfc('0x1c')](respondWithResult(_0x5585a8,null))[_0x5bfc('0x4e')](handleError(_0x5585a8,null));};exports['getTags']=function(_0x5a0c1d,_0x23bacb,_0x3af5ba){var _0x10cb15={};var _0xae17d1={};var _0x4e5afe;var _0x5c0774;return db[_0x5bfc('0x38')][_0x5bfc('0x5a')]({'where':{'id':_0x5a0c1d[_0x5bfc('0x50')]['id']}})[_0x5bfc('0x1c')](handleEntityNotFound(_0x23bacb,null))[_0x5bfc('0x1c')](function(_0x3909b4){if(_0x3909b4){_0x4e5afe=_0x3909b4;_0xae17d1['model']=_['keys'](db[_0x5bfc('0x5d')][_0x5bfc('0x39')]);_0xae17d1[_0x5bfc('0x3c')]=_[_0x5bfc('0x51')](_0x5a0c1d[_0x5bfc('0x3c')]);_0xae17d1[_0x5bfc('0x3d')]=_[_0x5bfc('0x3e')](_0xae17d1[_0x5bfc('0x3b')],_0xae17d1[_0x5bfc('0x3c')]);_0x10cb15[_0x5bfc('0x3f')]=_[_0x5bfc('0x3e')](_0xae17d1[_0x5bfc('0x3b')],qs[_0x5bfc('0x40')](_0x5a0c1d[_0x5bfc('0x3c')][_0x5bfc('0x40')]));_0x10cb15[_0x5bfc('0x3f')]=_0x10cb15[_0x5bfc('0x3f')]['length']?_0x10cb15[_0x5bfc('0x3f')]:_0xae17d1[_0x5bfc('0x3b')];_0x10cb15[_0x5bfc('0x43')]=qs['sort'](_0x5a0c1d[_0x5bfc('0x3c')][_0x5bfc('0x44')]);_0x10cb15[_0x5bfc('0x45')]=qs[_0x5bfc('0x3d')](_['pick'](_0x5a0c1d[_0x5bfc('0x3c')],_0xae17d1[_0x5bfc('0x3d')]));if(_0x5a0c1d[_0x5bfc('0x3c')]['filter']){_0x10cb15[_0x5bfc('0x45')]=_[_0x5bfc('0x46')](_0x10cb15['where'],{'$or':_[_0x5bfc('0x37')](_0x10cb15[_0x5bfc('0x3f')],function(_0x1b7f73){var _0x1c88e9={};_0x1c88e9[_0x1b7f73]={'$like':'%'+_0x5a0c1d[_0x5bfc('0x3c')]['filter']+'%'};return _0x1c88e9;})});}_0x10cb15=_[_0x5bfc('0x46')]({},_0x10cb15,_0x5a0c1d[_0x5bfc('0x53')]);return _0x4e5afe[_0x5bfc('0x5e')](_0x10cb15);}})[_0x5bfc('0x1c')](function(_0x850fb4){if(_0x850fb4){_0x5c0774=_0x850fb4[_0x5bfc('0x52')];if(!_0x5a0c1d['query'][_0x5bfc('0x41')](_0x5bfc('0x42'))){_0x10cb15[_0x5bfc('0x2c')]=qs[_0x5bfc('0x2c')](_0x5a0c1d[_0x5bfc('0x3c')][_0x5bfc('0x2c')]);_0x10cb15[_0x5bfc('0x2b')]=qs[_0x5bfc('0x2b')](_0x5a0c1d['query'][_0x5bfc('0x2b')]);}return _0x4e5afe['getTags'](_0x10cb15);}})[_0x5bfc('0x1c')](function(_0x3901dc){if(_0x3901dc){return _0x3901dc?{'count':_0x5c0774,'rows':_0x3901dc}:null;}})[_0x5bfc('0x1c')](respondWithResult(_0x23bacb,null))[_0x5bfc('0x4e')](handleError(_0x23bacb,null));};exports['setTags']=function(_0xc9a2f3,_0x87df7a,_0x1eadbd){if(_0xc9a2f3['body']['id']){delete _0xc9a2f3['body']['id'];}return db[_0x5bfc('0x38')]['findOne']({'where':{'id':_0xc9a2f3[_0x5bfc('0x50')]['id']}})[_0x5bfc('0x1c')](handleEntityNotFound(_0x87df7a,null))[_0x5bfc('0x1c')](function(_0x2ce720){if(_0x2ce720){return _0x2ce720['setTags'](_0xc9a2f3[_0x5bfc('0x56')][_0x5bfc('0x5f')]||[]);}return null;})['then'](respondWithResult(_0x87df7a,null))[_0x5bfc('0x4e')](handleError(_0x87df7a,null));};
\ No newline at end of file
+var _0x7979=['eml-format','zip-dir','fast-json-patch','moment','util','path','sox','ejs','lodash','squel','jsforce','desk.js','to-csv','querystring','papaparse','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/utils','../../mysqldb','jayson/promise','http','Sequelize','ValidationError','DeskConfiguration,\x20%s,\x20%s','debug','request\x20sent','stringify','error','code','message','info','result','catch','sendStatus','end','status','json','offset','limit','set','Content-Range','reject','save','update','destroy','stack','name','send','index','DeskConfiguration','rawAttributes','fieldName','type','key','map','query','filters','intersection','model','attributes','fields','length','order','sort','where','pick','filter','merge','count','then','includeAll','include','findAll','show','keys','create','body','params','find','getFields','DeskField','options','getSubjects','findOne','hasOwnProperty','getDescriptions','nolimit','getTags','Tag','setTags','ids','html-pdf'];(function(_0x125436,_0x17384b){var _0x12bcfe=function(_0x594a22){while(--_0x594a22){_0x125436['push'](_0x125436['shift']());}};_0x12bcfe(++_0x17384b);}(_0x7979,0xb9));var _0x9797=function(_0xf88549,_0x29b6ca){_0xf88549=_0xf88549-0x0;var _0x2e64d2=_0x7979[_0xf88549];return _0x2e64d2;};'use strict';var pdf=require(_0x9797('0x0'));var emlformat=require(_0x9797('0x1'));var rimraf=require('rimraf');var zipdir=require(_0x9797('0x2'));var jsonpatch=require(_0x9797('0x3'));var rp=require('request-promise');var moment=require(_0x9797('0x4'));var BPromise=require('bluebird');var Mustache=require('mustache');var util=require(_0x9797('0x5'));var path=require(_0x9797('0x6'));var sox=require(_0x9797('0x7'));var csv=require('to-csv');var ejs=require(_0x9797('0x8'));var fs=require('fs');var _=require(_0x9797('0x9'));var squel=require(_0x9797('0xa'));var crypto=require('crypto');var jsforce=require(_0x9797('0xb'));var deskjs=require(_0x9797('0xc'));var toCsv=require(_0x9797('0xd'));var querystring=require(_0x9797('0xe'));var Papa=require(_0x9797('0xf'));var Redis=require('ioredis');var authService=require(_0x9797('0x10'));var qs=require(_0x9797('0x11'));var as=require(_0x9797('0x12'));var hardwareService=require('../../config/license/hardware');var logger=require('../../config/logger')('api');var utils=require(_0x9797('0x13'));var config=require('../../config/environment');var db=require(_0x9797('0x14'))['db'];var jayson=require(_0x9797('0x15'));var client=jayson['client'][_0x9797('0x16')]({'port':0x232a});function checkPasswordPattern(_0x29bcce,_0x424cb4,_0x2060a2){if(_0x2060a2){var _0x57bd54=new RegExp(/(?=.*[a-z])(?=.*[A-Z])(?=.*[0-9])(?=.*[?!@#\$%\^&\*~\-_=+[{\]\}])(?=.{8,})/);if(_0x57bd54['test'](_0x424cb4)){return _0x29bcce;}else{throw new db[(_0x9797('0x17'))][(_0x9797('0x18'))]('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 _0x29bcce;}}function respondWithRpcPromise(_0x20e49e,_0x47d2b5,_0x1571cb,_0x29d6a6){return new BPromise(function(_0x1d9907,_0x40643a){var _0x2a3f13=_0x29d6a6||client;return _0x2a3f13['request'](_0x20e49e,_0x1571cb)['then'](function(_0x4f3121){logger['info'](_0x9797('0x19'),_0x47d2b5,'request\x20sent');logger[_0x9797('0x1a')]('DeskConfiguration,\x20%s,\x20%s,\x20%s',_0x47d2b5,_0x9797('0x1b'),JSON[_0x9797('0x1c')](_0x4f3121));if(_0x4f3121[_0x9797('0x1d')]){if(_0x4f3121[_0x9797('0x1d')][_0x9797('0x1e')]===0x1f4){logger[_0x9797('0x1d')](_0x9797('0x19'),_0x47d2b5,_0x4f3121['error'][_0x9797('0x1f')]);return _0x40643a(_0x4f3121[_0x9797('0x1d')][_0x9797('0x1f')]);}logger['error'](_0x9797('0x19'),_0x47d2b5,_0x4f3121['error'][_0x9797('0x1f')]);return _0x1d9907(_0x4f3121['error'][_0x9797('0x1f')]);}else{logger[_0x9797('0x20')](_0x9797('0x19'),_0x47d2b5,_0x9797('0x1b'));_0x1d9907(_0x4f3121[_0x9797('0x21')][_0x9797('0x1f')]);}})[_0x9797('0x22')](function(_0x76bc0d){logger['error'](_0x9797('0x19'),_0x47d2b5,_0x76bc0d);_0x40643a(_0x76bc0d);});});}function respondWithStatusCode(_0x1519c3,_0x2d39dd){_0x2d39dd=_0x2d39dd||0xcc;return function(_0x2939e2){if(_0x2939e2){return _0x1519c3[_0x9797('0x23')](_0x2d39dd);}return _0x1519c3['status'](_0x2d39dd)[_0x9797('0x24')]();};}function respondWithResult(_0x2d4834,_0xb013c6){_0xb013c6=_0xb013c6||0xc8;return function(_0x39fa9a){if(_0x39fa9a){return _0x2d4834[_0x9797('0x25')](_0xb013c6)[_0x9797('0x26')](_0x39fa9a);}};}function respondWithFilteredResult(_0x39ba56,_0x1e3963){return function(_0x11be6e){if(_0x11be6e){var _0x26a233=_0x11be6e['count'],_0x3e4353=_0x1e3963['offset'],_0x477ab6=_0x1e3963[_0x9797('0x27')]+_0x1e3963[_0x9797('0x28')],_0x3df191;if(_0x477ab6>=_0x26a233){_0x477ab6=_0x26a233;_0x3df191=0xc8;}else{_0x3df191=0xce;}_0x39ba56[_0x9797('0x25')](_0x3df191);return _0x39ba56[_0x9797('0x29')](_0x9797('0x2a'),_0x3e4353+'-'+_0x477ab6+'/'+_0x26a233)[_0x9797('0x26')](_0x11be6e);}return null;};}function patchUpdates(_0xba37c3){return function(_0x3cf4b3){try{jsonpatch['apply'](_0x3cf4b3,_0xba37c3,!![]);}catch(_0x27102c){return BPromise[_0x9797('0x2b')](_0x27102c);}return _0x3cf4b3[_0x9797('0x2c')]();};}function saveUpdates(_0x4e4e6d,_0x39071b){return function(_0x842f02){if(_0x842f02){return _0x842f02[_0x9797('0x2d')](_0x4e4e6d)['then'](function(_0xb45daa){return _0xb45daa;});}return null;};}function removeEntity(_0x117bac,_0x2521bb){return function(_0x3fb4f1){if(_0x3fb4f1){return _0x3fb4f1[_0x9797('0x2e')]()['then'](function(){_0x117bac['status'](0xcc)[_0x9797('0x24')]();});}};}function handleEntityNotFound(_0xed8735,_0x63032f){return function(_0x48bd91){if(!_0x48bd91){_0xed8735[_0x9797('0x23')](0x194);}return _0x48bd91;};}function handleError(_0x3d8034,_0x3c7319){_0x3c7319=_0x3c7319||0x1f4;return function(_0x3decab){logger[_0x9797('0x1d')](_0x3decab[_0x9797('0x2f')]);if(_0x3decab['name']){delete _0x3decab[_0x9797('0x30')];}_0x3d8034[_0x9797('0x25')](_0x3c7319)[_0x9797('0x31')](_0x3decab);};}exports[_0x9797('0x32')]=function(_0x1493df,_0x4eeb92){var _0x1a480e={},_0x37ad30={},_0x240e8d={'count':0x0,'rows':[]};var _0x3eb6a2=_['map'](db[_0x9797('0x33')][_0x9797('0x34')],function(_0x1236e9){return{'name':_0x1236e9[_0x9797('0x35')],'type':_0x1236e9[_0x9797('0x36')][_0x9797('0x37')]};});_0x37ad30['model']=_[_0x9797('0x38')](_0x3eb6a2,_0x9797('0x30'));_0x37ad30[_0x9797('0x39')]=_['keys'](_0x1493df[_0x9797('0x39')]);_0x37ad30[_0x9797('0x3a')]=_[_0x9797('0x3b')](_0x37ad30[_0x9797('0x3c')],_0x37ad30['query']);_0x1a480e[_0x9797('0x3d')]=_[_0x9797('0x3b')](_0x37ad30[_0x9797('0x3c')],qs[_0x9797('0x3e')](_0x1493df['query'][_0x9797('0x3e')]));_0x1a480e['attributes']=_0x1a480e[_0x9797('0x3d')][_0x9797('0x3f')]?_0x1a480e[_0x9797('0x3d')]:_0x37ad30['model'];if(!_0x1493df[_0x9797('0x39')]['hasOwnProperty']('nolimit')){_0x1a480e[_0x9797('0x28')]=qs[_0x9797('0x28')](_0x1493df[_0x9797('0x39')][_0x9797('0x28')]);_0x1a480e[_0x9797('0x27')]=qs['offset'](_0x1493df['query']['offset']);}_0x1a480e[_0x9797('0x40')]=qs[_0x9797('0x41')](_0x1493df[_0x9797('0x39')][_0x9797('0x41')]);_0x1a480e[_0x9797('0x42')]=qs['filters'](_[_0x9797('0x43')](_0x1493df['query'],_0x37ad30[_0x9797('0x3a')]));if(_0x1493df[_0x9797('0x39')][_0x9797('0x44')]){_0x1a480e[_0x9797('0x42')]=_[_0x9797('0x45')](_0x1a480e[_0x9797('0x42')],{'$or':_[_0x9797('0x38')](_0x3eb6a2,function(_0x29572c){if(_0x29572c[_0x9797('0x36')]!=='VIRTUAL'){var _0x1f094a={};_0x1f094a[_0x29572c[_0x9797('0x30')]]={'$like':'%'+_0x1493df[_0x9797('0x39')][_0x9797('0x44')]+'%'};return _0x1f094a;}})});}_0x1a480e=_['merge']({},_0x1a480e,_0x1493df['options']);var _0x1c481d={'where':_0x1a480e[_0x9797('0x42')]};return db[_0x9797('0x33')][_0x9797('0x46')](_0x1c481d)[_0x9797('0x47')](function(_0x461846){_0x240e8d[_0x9797('0x46')]=_0x461846;if(_0x1493df['query'][_0x9797('0x48')]){_0x1a480e[_0x9797('0x49')]=[{'all':!![]}];}return db['DeskConfiguration'][_0x9797('0x4a')](_0x1a480e);})[_0x9797('0x47')](function(_0x19df3f){_0x240e8d['rows']=_0x19df3f;return _0x240e8d;})[_0x9797('0x47')](respondWithFilteredResult(_0x4eeb92,_0x1a480e))[_0x9797('0x22')](handleError(_0x4eeb92,null));};exports[_0x9797('0x4b')]=function(_0x96d723,_0x4dd3b8){var _0x58b7c5={'raw':![],'where':{'id':_0x96d723['params']['id']}},_0x229c7a={};_0x229c7a[_0x9797('0x3c')]=_[_0x9797('0x4c')](db[_0x9797('0x33')][_0x9797('0x34')]);_0x229c7a[_0x9797('0x39')]=_[_0x9797('0x4c')](_0x96d723['query']);_0x229c7a[_0x9797('0x3a')]=_[_0x9797('0x3b')](_0x229c7a['model'],_0x229c7a[_0x9797('0x39')]);_0x58b7c5[_0x9797('0x3d')]=_[_0x9797('0x3b')](_0x229c7a[_0x9797('0x3c')],qs[_0x9797('0x3e')](_0x96d723[_0x9797('0x39')][_0x9797('0x3e')]));_0x58b7c5[_0x9797('0x3d')]=_0x58b7c5[_0x9797('0x3d')][_0x9797('0x3f')]?_0x58b7c5['attributes']:_0x229c7a[_0x9797('0x3c')];if(_0x96d723['query'][_0x9797('0x48')]){_0x58b7c5[_0x9797('0x49')]=[{'all':!![]}];}_0x58b7c5=_['merge']({},_0x58b7c5,_0x96d723['options']);return db[_0x9797('0x33')]['find'](_0x58b7c5)['then'](handleEntityNotFound(_0x4dd3b8,null))[_0x9797('0x47')](respondWithResult(_0x4dd3b8,null))['catch'](handleError(_0x4dd3b8,null));};exports['create']=function(_0x842936,_0x36ad6a){return db[_0x9797('0x33')][_0x9797('0x4d')](_0x842936[_0x9797('0x4e')],{})[_0x9797('0x47')](respondWithResult(_0x36ad6a,0xc9))[_0x9797('0x22')](handleError(_0x36ad6a,null));};exports[_0x9797('0x2d')]=function(_0x50d23a,_0x51037a){if(_0x50d23a[_0x9797('0x4e')]['id']){delete _0x50d23a[_0x9797('0x4e')]['id'];}return db['DeskConfiguration']['find']({'where':{'id':_0x50d23a[_0x9797('0x4f')]['id']}})[_0x9797('0x47')](handleEntityNotFound(_0x51037a,null))[_0x9797('0x47')](saveUpdates(_0x50d23a[_0x9797('0x4e')],null))[_0x9797('0x47')](respondWithResult(_0x51037a,null))['catch'](handleError(_0x51037a,null));};exports[_0x9797('0x2e')]=function(_0x58809d,_0x4bb0b1){return db[_0x9797('0x33')][_0x9797('0x50')]({'where':{'id':_0x58809d[_0x9797('0x4f')]['id']}})[_0x9797('0x47')](handleEntityNotFound(_0x4bb0b1,null))[_0x9797('0x47')](removeEntity(_0x4bb0b1,null))[_0x9797('0x22')](handleError(_0x4bb0b1,null));};exports[_0x9797('0x51')]=function(_0x1cdb9b,_0x22753c,_0x567611){var _0x47a956={};var _0x41257a={};var _0x3b6f0f;var _0x26967b;return db[_0x9797('0x33')]['findOne']({'where':{'id':_0x1cdb9b[_0x9797('0x4f')]['id']}})[_0x9797('0x47')](handleEntityNotFound(_0x22753c,null))[_0x9797('0x47')](function(_0x420c6a){if(_0x420c6a){_0x3b6f0f=_0x420c6a;_0x41257a[_0x9797('0x3c')]=_[_0x9797('0x4c')](db[_0x9797('0x52')][_0x9797('0x34')]);_0x41257a[_0x9797('0x39')]=_[_0x9797('0x4c')](_0x1cdb9b[_0x9797('0x39')]);_0x41257a[_0x9797('0x3a')]=_['intersection'](_0x41257a[_0x9797('0x3c')],_0x41257a[_0x9797('0x39')]);_0x47a956['attributes']=_['intersection'](_0x41257a[_0x9797('0x3c')],qs[_0x9797('0x3e')](_0x1cdb9b[_0x9797('0x39')][_0x9797('0x3e')]));_0x47a956[_0x9797('0x3d')]=_0x47a956[_0x9797('0x3d')][_0x9797('0x3f')]?_0x47a956[_0x9797('0x3d')]:_0x41257a['model'];_0x47a956[_0x9797('0x40')]=qs[_0x9797('0x41')](_0x1cdb9b[_0x9797('0x39')][_0x9797('0x41')]);_0x47a956['where']=qs[_0x9797('0x3a')](_['pick'](_0x1cdb9b[_0x9797('0x39')],_0x41257a[_0x9797('0x3a')]));if(_0x1cdb9b[_0x9797('0x39')][_0x9797('0x44')]){_0x47a956['where']=_[_0x9797('0x45')](_0x47a956[_0x9797('0x42')],{'$or':_[_0x9797('0x38')](_0x47a956[_0x9797('0x3d')],function(_0x3e9bf1){var _0x25a0ff={};_0x25a0ff[_0x3e9bf1]={'$like':'%'+_0x1cdb9b[_0x9797('0x39')][_0x9797('0x44')]+'%'};return _0x25a0ff;})});}_0x47a956=_[_0x9797('0x45')]({},_0x47a956,_0x1cdb9b[_0x9797('0x53')]);return _0x3b6f0f[_0x9797('0x51')](_0x47a956);}})[_0x9797('0x47')](function(_0x54f027){if(_0x54f027){_0x26967b=_0x54f027[_0x9797('0x3f')];if(!_0x1cdb9b[_0x9797('0x39')]['hasOwnProperty']('nolimit')){_0x47a956['limit']=qs['limit'](_0x1cdb9b['query'][_0x9797('0x28')]);_0x47a956['offset']=qs[_0x9797('0x27')](_0x1cdb9b[_0x9797('0x39')][_0x9797('0x27')]);}return _0x3b6f0f[_0x9797('0x51')](_0x47a956);}})['then'](function(_0x5bf567){if(_0x5bf567){return _0x5bf567?{'count':_0x26967b,'rows':_0x5bf567}:null;}})[_0x9797('0x47')](respondWithResult(_0x22753c,null))[_0x9797('0x22')](handleError(_0x22753c,null));};exports[_0x9797('0x54')]=function(_0x3cda8e,_0xd6e6b4,_0x49f573){var _0x26a11a={};var _0x41e02f={};var _0x249edc;var _0x1055ea;return db[_0x9797('0x33')][_0x9797('0x55')]({'where':{'id':_0x3cda8e[_0x9797('0x4f')]['id']}})[_0x9797('0x47')](handleEntityNotFound(_0xd6e6b4,null))[_0x9797('0x47')](function(_0x3da5f3){if(_0x3da5f3){_0x249edc=_0x3da5f3;_0x41e02f[_0x9797('0x3c')]=_['keys'](db[_0x9797('0x52')]['rawAttributes']);_0x41e02f[_0x9797('0x39')]=_[_0x9797('0x4c')](_0x3cda8e[_0x9797('0x39')]);_0x41e02f[_0x9797('0x3a')]=_['intersection'](_0x41e02f[_0x9797('0x3c')],_0x41e02f['query']);_0x26a11a[_0x9797('0x3d')]=_[_0x9797('0x3b')](_0x41e02f[_0x9797('0x3c')],qs[_0x9797('0x3e')](_0x3cda8e['query'][_0x9797('0x3e')]));_0x26a11a['attributes']=_0x26a11a[_0x9797('0x3d')][_0x9797('0x3f')]?_0x26a11a[_0x9797('0x3d')]:_0x41e02f['model'];_0x26a11a[_0x9797('0x40')]=qs[_0x9797('0x41')](_0x3cda8e[_0x9797('0x39')][_0x9797('0x41')]);_0x26a11a['where']=qs[_0x9797('0x3a')](_[_0x9797('0x43')](_0x3cda8e[_0x9797('0x39')],_0x41e02f[_0x9797('0x3a')]));if(_0x3cda8e['query'][_0x9797('0x44')]){_0x26a11a['where']=_[_0x9797('0x45')](_0x26a11a[_0x9797('0x42')],{'$or':_[_0x9797('0x38')](_0x26a11a[_0x9797('0x3d')],function(_0x46cc80){var _0x21a853={};_0x21a853[_0x46cc80]={'$like':'%'+_0x3cda8e['query']['filter']+'%'};return _0x21a853;})});}_0x26a11a=_[_0x9797('0x45')]({},_0x26a11a,_0x3cda8e[_0x9797('0x53')]);return _0x249edc[_0x9797('0x54')](_0x26a11a);}})[_0x9797('0x47')](function(_0x5adddb){if(_0x5adddb){_0x1055ea=_0x5adddb[_0x9797('0x3f')];if(!_0x3cda8e[_0x9797('0x39')][_0x9797('0x56')]('nolimit')){_0x26a11a[_0x9797('0x28')]=qs[_0x9797('0x28')](_0x3cda8e['query'][_0x9797('0x28')]);_0x26a11a['offset']=qs[_0x9797('0x27')](_0x3cda8e['query']['offset']);}return _0x249edc['getSubjects'](_0x26a11a);}})[_0x9797('0x47')](function(_0x3c7ef1){if(_0x3c7ef1){return _0x3c7ef1?{'count':_0x1055ea,'rows':_0x3c7ef1}:null;}})[_0x9797('0x47')](respondWithResult(_0xd6e6b4,null))[_0x9797('0x22')](handleError(_0xd6e6b4,null));};exports['getDescriptions']=function(_0x2f3202,_0x552681,_0x4a5541){var _0xe37b9={};var _0x150e99={};var _0x40c1e3;var _0x564a8f;return db['DeskConfiguration']['findOne']({'where':{'id':_0x2f3202[_0x9797('0x4f')]['id']}})[_0x9797('0x47')](handleEntityNotFound(_0x552681,null))['then'](function(_0x2a4a21){if(_0x2a4a21){_0x40c1e3=_0x2a4a21;_0x150e99[_0x9797('0x3c')]=_[_0x9797('0x4c')](db['DeskField'][_0x9797('0x34')]);_0x150e99[_0x9797('0x39')]=_['keys'](_0x2f3202[_0x9797('0x39')]);_0x150e99[_0x9797('0x3a')]=_[_0x9797('0x3b')](_0x150e99[_0x9797('0x3c')],_0x150e99['query']);_0xe37b9['attributes']=_[_0x9797('0x3b')](_0x150e99['model'],qs[_0x9797('0x3e')](_0x2f3202[_0x9797('0x39')][_0x9797('0x3e')]));_0xe37b9[_0x9797('0x3d')]=_0xe37b9['attributes']['length']?_0xe37b9[_0x9797('0x3d')]:_0x150e99[_0x9797('0x3c')];_0xe37b9['order']=qs[_0x9797('0x41')](_0x2f3202[_0x9797('0x39')][_0x9797('0x41')]);_0xe37b9[_0x9797('0x42')]=qs[_0x9797('0x3a')](_[_0x9797('0x43')](_0x2f3202[_0x9797('0x39')],_0x150e99[_0x9797('0x3a')]));if(_0x2f3202[_0x9797('0x39')][_0x9797('0x44')]){_0xe37b9[_0x9797('0x42')]=_[_0x9797('0x45')](_0xe37b9[_0x9797('0x42')],{'$or':_[_0x9797('0x38')](_0xe37b9[_0x9797('0x3d')],function(_0x345125){var _0x5ee0fc={};_0x5ee0fc[_0x345125]={'$like':'%'+_0x2f3202[_0x9797('0x39')][_0x9797('0x44')]+'%'};return _0x5ee0fc;})});}_0xe37b9=_[_0x9797('0x45')]({},_0xe37b9,_0x2f3202['options']);return _0x40c1e3[_0x9797('0x57')](_0xe37b9);}})[_0x9797('0x47')](function(_0x3423e7){if(_0x3423e7){_0x564a8f=_0x3423e7[_0x9797('0x3f')];if(!_0x2f3202[_0x9797('0x39')][_0x9797('0x56')](_0x9797('0x58'))){_0xe37b9[_0x9797('0x28')]=qs['limit'](_0x2f3202[_0x9797('0x39')]['limit']);_0xe37b9['offset']=qs[_0x9797('0x27')](_0x2f3202[_0x9797('0x39')][_0x9797('0x27')]);}return _0x40c1e3['getDescriptions'](_0xe37b9);}})[_0x9797('0x47')](function(_0x4dd441){if(_0x4dd441){return _0x4dd441?{'count':_0x564a8f,'rows':_0x4dd441}:null;}})['then'](respondWithResult(_0x552681,null))['catch'](handleError(_0x552681,null));};exports[_0x9797('0x59')]=function(_0x478964,_0x45ead3,_0x3790dc){var _0x19a4a0={};var _0x563fa6={};var _0x27cc9b;var _0x2ace9d;return db['DeskConfiguration'][_0x9797('0x55')]({'where':{'id':_0x478964['params']['id']}})['then'](handleEntityNotFound(_0x45ead3,null))[_0x9797('0x47')](function(_0x5e11f6){if(_0x5e11f6){_0x27cc9b=_0x5e11f6;_0x563fa6[_0x9797('0x3c')]=_[_0x9797('0x4c')](db[_0x9797('0x5a')][_0x9797('0x34')]);_0x563fa6[_0x9797('0x39')]=_[_0x9797('0x4c')](_0x478964[_0x9797('0x39')]);_0x563fa6[_0x9797('0x3a')]=_[_0x9797('0x3b')](_0x563fa6[_0x9797('0x3c')],_0x563fa6['query']);_0x19a4a0[_0x9797('0x3d')]=_[_0x9797('0x3b')](_0x563fa6[_0x9797('0x3c')],qs[_0x9797('0x3e')](_0x478964['query'][_0x9797('0x3e')]));_0x19a4a0['attributes']=_0x19a4a0[_0x9797('0x3d')][_0x9797('0x3f')]?_0x19a4a0[_0x9797('0x3d')]:_0x563fa6[_0x9797('0x3c')];_0x19a4a0[_0x9797('0x40')]=qs[_0x9797('0x41')](_0x478964[_0x9797('0x39')][_0x9797('0x41')]);_0x19a4a0[_0x9797('0x42')]=qs['filters'](_[_0x9797('0x43')](_0x478964[_0x9797('0x39')],_0x563fa6[_0x9797('0x3a')]));if(_0x478964[_0x9797('0x39')]['filter']){_0x19a4a0[_0x9797('0x42')]=_[_0x9797('0x45')](_0x19a4a0[_0x9797('0x42')],{'$or':_[_0x9797('0x38')](_0x19a4a0[_0x9797('0x3d')],function(_0x259dfd){var _0x50cbc6={};_0x50cbc6[_0x259dfd]={'$like':'%'+_0x478964['query'][_0x9797('0x44')]+'%'};return _0x50cbc6;})});}_0x19a4a0=_[_0x9797('0x45')]({},_0x19a4a0,_0x478964['options']);return _0x27cc9b[_0x9797('0x59')](_0x19a4a0);}})['then'](function(_0x51de69){if(_0x51de69){_0x2ace9d=_0x51de69['length'];if(!_0x478964[_0x9797('0x39')][_0x9797('0x56')](_0x9797('0x58'))){_0x19a4a0['limit']=qs[_0x9797('0x28')](_0x478964[_0x9797('0x39')][_0x9797('0x28')]);_0x19a4a0[_0x9797('0x27')]=qs[_0x9797('0x27')](_0x478964[_0x9797('0x39')][_0x9797('0x27')]);}return _0x27cc9b[_0x9797('0x59')](_0x19a4a0);}})[_0x9797('0x47')](function(_0x99c10a){if(_0x99c10a){return _0x99c10a?{'count':_0x2ace9d,'rows':_0x99c10a}:null;}})[_0x9797('0x47')](respondWithResult(_0x45ead3,null))[_0x9797('0x22')](handleError(_0x45ead3,null));};exports[_0x9797('0x5b')]=function(_0x119f6d,_0x4b922e,_0x42531e){if(_0x119f6d[_0x9797('0x4e')]['id']){delete _0x119f6d[_0x9797('0x4e')]['id'];}return db['DeskConfiguration'][_0x9797('0x55')]({'where':{'id':_0x119f6d['params']['id']}})[_0x9797('0x47')](handleEntityNotFound(_0x4b922e,null))[_0x9797('0x47')](function(_0xc9a75e){if(_0xc9a75e){return _0xc9a75e[_0x9797('0x5b')](_0x119f6d['body'][_0x9797('0x5c')]||[]);}return null;})['then'](respondWithResult(_0x4b922e,null))[_0x9797('0x22')](handleError(_0x4b922e,null));};
\ No newline at end of file
diff --git a/server/api/intDeskConfiguration/intDeskConfiguration.model.js b/server/api/intDeskConfiguration/intDeskConfiguration.model.js
index 6ae7e5b..6443b1a 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 _0xecb9=['int_desk_configurations','lodash','util','../../config/logger','api','moment','bluebird','path','rimraf','../../config/environment','./intDeskConfiguration.attributes','exports','define','DeskConfiguration'];(function(_0x17d9e3,_0x1f969c){var _0x14192d=function(_0x159745){while(--_0x159745){_0x17d9e3['push'](_0x17d9e3['shift']());}};_0x14192d(++_0x1f969c);}(_0xecb9,0xd3));var _0x9ecb=function(_0x2238b1,_0x2cf83b){_0x2238b1=_0x2238b1-0x0;var _0x3bffa6=_0xecb9[_0x2238b1];return _0x3bffa6;};'use strict';var _=require(_0x9ecb('0x0'));var util=require(_0x9ecb('0x1'));var logger=require(_0x9ecb('0x2'))(_0x9ecb('0x3'));var moment=require(_0x9ecb('0x4'));var BPromise=require(_0x9ecb('0x5'));var rp=require('request-promise');var fs=require('fs');var path=require(_0x9ecb('0x6'));var rimraf=require(_0x9ecb('0x7'));var config=require(_0x9ecb('0x8'));var attributes=require(_0x9ecb('0x9'));module[_0x9ecb('0xa')]=function(_0x164ee9,_0x4331cb){return _0x164ee9[_0x9ecb('0xb')](_0x9ecb('0xc'),attributes,{'tableName':_0x9ecb('0xd'),'paranoid':![],'indexes':[],'timestamps':!![]});};
\ No newline at end of file
+var _0x954d=['api','bluebird','path','rimraf','../../config/environment','./intDeskConfiguration.attributes','exports','define','DeskConfiguration','int_desk_configurations','lodash','util'];(function(_0x216f7d,_0x496249){var _0xc49d7f=function(_0x27be52){while(--_0x27be52){_0x216f7d['push'](_0x216f7d['shift']());}};_0xc49d7f(++_0x496249);}(_0x954d,0xbe));var _0xd954=function(_0x5a70a2,_0xf1e7f9){_0x5a70a2=_0x5a70a2-0x0;var _0x1c88fd=_0x954d[_0x5a70a2];return _0x1c88fd;};'use strict';var _=require(_0xd954('0x0'));var util=require(_0xd954('0x1'));var logger=require('../../config/logger')(_0xd954('0x2'));var moment=require('moment');var BPromise=require(_0xd954('0x3'));var rp=require('request-promise');var fs=require('fs');var path=require(_0xd954('0x4'));var rimraf=require(_0xd954('0x5'));var config=require(_0xd954('0x6'));var attributes=require(_0xd954('0x7'));module[_0xd954('0x8')]=function(_0xc650c8,_0x586a7d){return _0xc650c8[_0xd954('0x9')](_0xd954('0xa'),attributes,{'tableName':_0xd954('0xb'),'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 b8b1d70..eb2585b 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 _0x1152=['ioredis','../../mysqldb','../../config/utils','rpc','jayson/promise','client','request','then','info','debug','DeskConfiguration,\x20%s,\x20%s,\x20%s','request\x20sent','error','code','DeskConfiguration,\x20%s,\x20%s','message','result','catch','lodash','util','moment','bluebird','randomstring'];(function(_0x4e2c58,_0x20b37f){var _0x31c4e3=function(_0x5b8188){while(--_0x5b8188){_0x4e2c58['push'](_0x4e2c58['shift']());}};_0x31c4e3(++_0x20b37f);}(_0x1152,0x182));var _0x2115=function(_0xe58ae2,_0x30a065){_0xe58ae2=_0xe58ae2-0x0;var _0x369b69=_0x1152[_0xe58ae2];return _0x369b69;};'use strict';var _=require(_0x2115('0x0'));var util=require(_0x2115('0x1'));var moment=require(_0x2115('0x2'));var BPromise=require(_0x2115('0x3'));var rs=require(_0x2115('0x4'));var fs=require('fs');var Redis=require(_0x2115('0x5'));var db=require(_0x2115('0x6'))['db'];var utils=require(_0x2115('0x7'));var logger=require('../../config/logger')(_0x2115('0x8'));var config=require('../../config/environment');var jayson=require(_0x2115('0x9'));var client=jayson[_0x2115('0xa')]['http']({'port':0x232a});function respondWithRpcPromise(_0x564071,_0x54cdd0,_0x5dbb85){return new BPromise(function(_0x5df6db,_0x158711){return client[_0x2115('0xb')](_0x564071,_0x5dbb85)[_0x2115('0xc')](function(_0x5156f2){logger[_0x2115('0xd')]('DeskConfiguration,\x20%s,\x20%s',_0x54cdd0,'request\x20sent');logger[_0x2115('0xe')](_0x2115('0xf'),_0x54cdd0,_0x2115('0x10'),JSON['stringify'](_0x5156f2));if(_0x5156f2[_0x2115('0x11')]){if(_0x5156f2['error'][_0x2115('0x12')]===0x1f4){logger[_0x2115('0x11')](_0x2115('0x13'),_0x54cdd0,_0x5156f2[_0x2115('0x11')][_0x2115('0x14')]);return _0x158711(_0x5156f2['error'][_0x2115('0x14')]);}logger['error'](_0x2115('0x13'),_0x54cdd0,_0x5156f2[_0x2115('0x11')][_0x2115('0x14')]);return _0x5df6db(_0x5156f2[_0x2115('0x11')][_0x2115('0x14')]);}else{logger[_0x2115('0xd')](_0x2115('0x13'),_0x54cdd0,'request\x20sent');_0x5df6db(_0x5156f2[_0x2115('0x15')][_0x2115('0x14')]);}})[_0x2115('0x16')](function(_0x184c05){logger[_0x2115('0x11')](_0x2115('0x13'),_0x54cdd0,_0x184c05);_0x158711(_0x184c05);});});}
\ No newline at end of file
+var _0x6ff1=['result','catch','lodash','util','moment','bluebird','../../mysqldb','../../config/logger','rpc','../../config/environment','jayson/promise','request','then','info','DeskConfiguration,\x20%s,\x20%s','request\x20sent','debug','DeskConfiguration,\x20%s,\x20%s,\x20%s','stringify','error','code','message'];(function(_0x494367,_0x28026e){var _0x5eabc2=function(_0x4a4339){while(--_0x4a4339){_0x494367['push'](_0x494367['shift']());}};_0x5eabc2(++_0x28026e);}(_0x6ff1,0x10a));var _0x16ff=function(_0x4097c8,_0x3f3c36){_0x4097c8=_0x4097c8-0x0;var _0x1506d3=_0x6ff1[_0x4097c8];return _0x1506d3;};'use strict';var _=require(_0x16ff('0x0'));var util=require(_0x16ff('0x1'));var moment=require(_0x16ff('0x2'));var BPromise=require(_0x16ff('0x3'));var rs=require('randomstring');var fs=require('fs');var Redis=require('ioredis');var db=require(_0x16ff('0x4'))['db'];var utils=require('../../config/utils');var logger=require(_0x16ff('0x5'))(_0x16ff('0x6'));var config=require(_0x16ff('0x7'));var jayson=require(_0x16ff('0x8'));var client=jayson['client']['http']({'port':0x232a});function respondWithRpcPromise(_0x560612,_0x4e6fbf,_0x133612){return new BPromise(function(_0x218c28,_0x3b368c){return client[_0x16ff('0x9')](_0x560612,_0x133612)[_0x16ff('0xa')](function(_0xc1a41){logger[_0x16ff('0xb')](_0x16ff('0xc'),_0x4e6fbf,_0x16ff('0xd'));logger[_0x16ff('0xe')](_0x16ff('0xf'),_0x4e6fbf,_0x16ff('0xd'),JSON[_0x16ff('0x10')](_0xc1a41));if(_0xc1a41[_0x16ff('0x11')]){if(_0xc1a41[_0x16ff('0x11')][_0x16ff('0x12')]===0x1f4){logger[_0x16ff('0x11')](_0x16ff('0xc'),_0x4e6fbf,_0xc1a41[_0x16ff('0x11')][_0x16ff('0x13')]);return _0x3b368c(_0xc1a41['error']['message']);}logger[_0x16ff('0x11')](_0x16ff('0xc'),_0x4e6fbf,_0xc1a41[_0x16ff('0x11')][_0x16ff('0x13')]);return _0x218c28(_0xc1a41[_0x16ff('0x11')][_0x16ff('0x13')]);}else{logger['info'](_0x16ff('0xc'),_0x4e6fbf,_0x16ff('0xd'));_0x218c28(_0xc1a41[_0x16ff('0x14')]['message']);}})[_0x16ff('0x15')](function(_0x43b519){logger[_0x16ff('0x11')]('DeskConfiguration,\x20%s,\x20%s',_0x4e6fbf,_0x43b519);_0x3b368c(_0x43b519);});});}
\ No newline at end of file
diff --git a/server/api/intDeskField/index.js b/server/api/intDeskField/index.js
index 60f6b14..e6e79a2 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 _0xc61d=['../../config/environment','./intDeskField.controller','isAuthenticated','index','get','show','post','put','/:id','update','exports','multer','util','path','connect-timeout','express','Router','../../components/auth/service','../../components/interaction/service'];(function(_0x2e9ef9,_0x3ce383){var _0x5d862a=function(_0x3e4dcc){while(--_0x3e4dcc){_0x2e9ef9['push'](_0x2e9ef9['shift']());}};_0x5d862a(++_0x3ce383);}(_0xc61d,0xdc));var _0xdc61=function(_0x15a30b,_0x5d6a07){_0x15a30b=_0x15a30b-0x0;var _0x1ef0b9=_0xc61d[_0x15a30b];return _0x1ef0b9;};'use strict';var multer=require(_0xdc61('0x0'));var util=require(_0xdc61('0x1'));var path=require(_0xdc61('0x2'));var timeout=require(_0xdc61('0x3'));var express=require(_0xdc61('0x4'));var router=express[_0xdc61('0x5')]();var auth=require(_0xdc61('0x6'));var interaction=require(_0xdc61('0x7'));var config=require(_0xdc61('0x8'));var controller=require(_0xdc61('0x9'));router['get']('/',auth[_0xdc61('0xa')](),controller[_0xdc61('0xb')]);router[_0xdc61('0xc')]('/:id',auth['isAuthenticated'](),controller[_0xdc61('0xd')]);router[_0xdc61('0xe')]('/',auth[_0xdc61('0xa')](),controller['create']);router[_0xdc61('0xf')](_0xdc61('0x10'),auth[_0xdc61('0xa')](),controller[_0xdc61('0x11')]);router['delete']('/:id',auth['isAuthenticated'](),controller['destroy']);module[_0xdc61('0x12')]=router;
\ No newline at end of file
+var _0x13a8=['get','isAuthenticated','/:id','show','create','delete','destroy','exports','util','path','connect-timeout','express','../../components/auth/service','../../components/interaction/service'];(function(_0x369cd2,_0x2a70bf){var _0x527087=function(_0x2f167a){while(--_0x2f167a){_0x369cd2['push'](_0x369cd2['shift']());}};_0x527087(++_0x2a70bf);}(_0x13a8,0xbe));var _0x813a=function(_0x32eec1,_0x5563cc){_0x32eec1=_0x32eec1-0x0;var _0x45987d=_0x13a8[_0x32eec1];return _0x45987d;};'use strict';var multer=require('multer');var util=require(_0x813a('0x0'));var path=require(_0x813a('0x1'));var timeout=require(_0x813a('0x2'));var express=require(_0x813a('0x3'));var router=express['Router']();var auth=require(_0x813a('0x4'));var interaction=require(_0x813a('0x5'));var config=require('../../config/environment');var controller=require('./intDeskField.controller');router[_0x813a('0x6')]('/',auth[_0x813a('0x7')](),controller['index']);router[_0x813a('0x6')](_0x813a('0x8'),auth[_0x813a('0x7')](),controller[_0x813a('0x9')]);router['post']('/',auth[_0x813a('0x7')](),controller[_0x813a('0xa')]);router['put'](_0x813a('0x8'),auth[_0x813a('0x7')](),controller['update']);router[_0x813a('0xb')](_0x813a('0x8'),auth[_0x813a('0x7')](),controller[_0x813a('0xc')]);module[_0x813a('0xd')]=router;
\ No newline at end of file
diff --git a/server/api/intDeskField/intDeskField.attributes.js b/server/api/intDeskField/intDeskField.attributes.js
index 68ee681..75cdc7e 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 _0xe289=['customVariable','keyValue','STRING','ENUM','BOOLEAN','sequelize','string','variable'];(function(_0x3dd15e,_0x1f0015){var _0x231fd0=function(_0x4f680a){while(--_0x4f680a){_0x3dd15e['push'](_0x3dd15e['shift']());}};_0x231fd0(++_0x1f0015);}(_0xe289,0x1b5));var _0x9e28=function(_0x46afa4,_0x55f3e6){_0x46afa4=_0x46afa4-0x0;var _0x4430de=_0xe289[_0x46afa4];return _0x4430de;};'use strict';var Sequelize=require(_0x9e28('0x0'));module['exports']={'type':{'type':Sequelize['ENUM'](_0x9e28('0x1'),_0x9e28('0x2'),_0x9e28('0x3'),_0x9e28('0x4')),'defaultValue':_0x9e28('0x1')},'content':{'type':Sequelize[_0x9e28('0x5')]},'key':{'type':Sequelize[_0x9e28('0x5')]},'keyType':{'type':Sequelize[_0x9e28('0x6')](_0x9e28('0x1'),_0x9e28('0x2'),_0x9e28('0x3'))},'keyContent':{'type':Sequelize[_0x9e28('0x5')]},'idField':{'type':Sequelize[_0x9e28('0x5')]},'nameField':{'type':Sequelize[_0x9e28('0x5')]},'customField':{'type':Sequelize[_0x9e28('0x7')],'defaultValue':!![]},'variableName':{'type':Sequelize[_0x9e28('0x5')]}};
\ No newline at end of file
+var _0x1d2e=['STRING','exports','ENUM','string','variable','customVariable'];(function(_0x21f133,_0x325cef){var _0x596b68=function(_0x2ba306){while(--_0x2ba306){_0x21f133['push'](_0x21f133['shift']());}};_0x596b68(++_0x325cef);}(_0x1d2e,0x187));var _0xe1d2=function(_0x2a6e8c,_0x34b0da){_0x2a6e8c=_0x2a6e8c-0x0;var _0x44f28b=_0x1d2e[_0x2a6e8c];return _0x44f28b;};'use strict';var Sequelize=require('sequelize');module[_0xe1d2('0x0')]={'type':{'type':Sequelize[_0xe1d2('0x1')](_0xe1d2('0x2'),_0xe1d2('0x3'),_0xe1d2('0x4'),'keyValue'),'defaultValue':_0xe1d2('0x2')},'content':{'type':Sequelize['STRING']},'key':{'type':Sequelize[_0xe1d2('0x5')]},'keyType':{'type':Sequelize[_0xe1d2('0x1')]('string',_0xe1d2('0x3'),'customVariable')},'keyContent':{'type':Sequelize['STRING']},'idField':{'type':Sequelize[_0xe1d2('0x5')]},'nameField':{'type':Sequelize[_0xe1d2('0x5')]},'customField':{'type':Sequelize['BOOLEAN'],'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 2ee6e84..09adbf1 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 _0x5089=['filters','pick','filter','merge','VIRTUAL','options','includeAll','include','findAll','rows','show','params','find','catch','create','body','destroy','html-pdf','eml-format','zip-dir','fast-json-patch','request-promise','moment','bluebird','util','sox','to-csv','ejs','squel','crypto','desk.js','papaparse','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/environment','sendStatus','status','end','count','offset','set','Content-Range','json','reject','update','then','name','send','index','map','DeskField','rawAttributes','fieldName','type','model','keys','query','intersection','attributes','fields','length','hasOwnProperty','nolimit','limit','order','sort','where'];(function(_0x401a51,_0x4172ba){var _0x4d747b=function(_0x16ff0c){while(--_0x16ff0c){_0x401a51['push'](_0x401a51['shift']());}};_0x4d747b(++_0x4172ba);}(_0x5089,0x1bb));var _0x9508=function(_0x532807,_0x92d7fd){_0x532807=_0x532807-0x0;var _0x40b83f=_0x5089[_0x532807];return _0x40b83f;};'use strict';var pdf=require(_0x9508('0x0'));var emlformat=require(_0x9508('0x1'));var rimraf=require('rimraf');var zipdir=require(_0x9508('0x2'));var jsonpatch=require(_0x9508('0x3'));var rp=require(_0x9508('0x4'));var moment=require(_0x9508('0x5'));var BPromise=require(_0x9508('0x6'));var Mustache=require('mustache');var util=require(_0x9508('0x7'));var path=require('path');var sox=require(_0x9508('0x8'));var csv=require(_0x9508('0x9'));var ejs=require(_0x9508('0xa'));var fs=require('fs');var _=require('lodash');var squel=require(_0x9508('0xb'));var crypto=require(_0x9508('0xc'));var jsforce=require('jsforce');var deskjs=require(_0x9508('0xd'));var toCsv=require(_0x9508('0x9'));var querystring=require('querystring');var Papa=require(_0x9508('0xe'));var Redis=require('ioredis');var authService=require(_0x9508('0xf'));var qs=require(_0x9508('0x10'));var as=require(_0x9508('0x11'));var hardwareService=require(_0x9508('0x12'));var logger=require(_0x9508('0x13'))(_0x9508('0x14'));var utils=require('../../config/utils');var config=require(_0x9508('0x15'));var db=require('../../mysqldb')['db'];function respondWithStatusCode(_0x2c4fd9,_0x396896){_0x396896=_0x396896||0xcc;return function(_0x554c90){if(_0x554c90){return _0x2c4fd9[_0x9508('0x16')](_0x396896);}return _0x2c4fd9[_0x9508('0x17')](_0x396896)[_0x9508('0x18')]();};}function respondWithResult(_0x4701de,_0x51ef92){_0x51ef92=_0x51ef92||0xc8;return function(_0x440709){if(_0x440709){return _0x4701de[_0x9508('0x17')](_0x51ef92)['json'](_0x440709);}};}function respondWithFilteredResult(_0x2a281d,_0x539746){return function(_0x25d4d6){if(_0x25d4d6){var _0x418889=_0x25d4d6[_0x9508('0x19')],_0x374c03=_0x539746[_0x9508('0x1a')],_0x255a03=_0x539746[_0x9508('0x1a')]+_0x539746['limit'],_0x127340;if(_0x255a03>=_0x418889){_0x255a03=_0x418889;_0x127340=0xc8;}else{_0x127340=0xce;}_0x2a281d[_0x9508('0x17')](_0x127340);return _0x2a281d[_0x9508('0x1b')](_0x9508('0x1c'),_0x374c03+'-'+_0x255a03+'/'+_0x418889)[_0x9508('0x1d')](_0x25d4d6);}return null;};}function patchUpdates(_0x23c30e){return function(_0x22a9fe){try{jsonpatch['apply'](_0x22a9fe,_0x23c30e,!![]);}catch(_0x4cbf6a){return BPromise[_0x9508('0x1e')](_0x4cbf6a);}return _0x22a9fe['save']();};}function saveUpdates(_0x2272e2,_0x4e9e9f){return function(_0x3ba927){if(_0x3ba927){return _0x3ba927[_0x9508('0x1f')](_0x2272e2)[_0x9508('0x20')](function(_0x1dfc6c){return _0x1dfc6c;});}return null;};}function removeEntity(_0x1edf1b,_0x2f8106){return function(_0x20eb53){if(_0x20eb53){return _0x20eb53['destroy']()['then'](function(){_0x1edf1b[_0x9508('0x17')](0xcc)[_0x9508('0x18')]();});}};}function handleEntityNotFound(_0x39e6b0,_0xf70830){return function(_0x16c54f){if(!_0x16c54f){_0x39e6b0[_0x9508('0x16')](0x194);}return _0x16c54f;};}function handleError(_0x4b68e9,_0x5e9a80){_0x5e9a80=_0x5e9a80||0x1f4;return function(_0x46d23f){logger['error'](_0x46d23f['stack']);if(_0x46d23f[_0x9508('0x21')]){delete _0x46d23f['name'];}_0x4b68e9['status'](_0x5e9a80)[_0x9508('0x22')](_0x46d23f);};}exports[_0x9508('0x23')]=function(_0x57c7ae,_0x49246b){var _0x32b0dd={},_0x22b2e2={},_0x4529a8={'count':0x0,'rows':[]};var _0x1f7755=_[_0x9508('0x24')](db[_0x9508('0x25')][_0x9508('0x26')],function(_0x414534){return{'name':_0x414534[_0x9508('0x27')],'type':_0x414534[_0x9508('0x28')]['key']};});_0x22b2e2[_0x9508('0x29')]=_[_0x9508('0x24')](_0x1f7755,_0x9508('0x21'));_0x22b2e2['query']=_[_0x9508('0x2a')](_0x57c7ae[_0x9508('0x2b')]);_0x22b2e2['filters']=_[_0x9508('0x2c')](_0x22b2e2[_0x9508('0x29')],_0x22b2e2['query']);_0x32b0dd[_0x9508('0x2d')]=_[_0x9508('0x2c')](_0x22b2e2[_0x9508('0x29')],qs[_0x9508('0x2e')](_0x57c7ae['query']['fields']));_0x32b0dd[_0x9508('0x2d')]=_0x32b0dd[_0x9508('0x2d')][_0x9508('0x2f')]?_0x32b0dd['attributes']:_0x22b2e2['model'];if(!_0x57c7ae[_0x9508('0x2b')][_0x9508('0x30')](_0x9508('0x31'))){_0x32b0dd[_0x9508('0x32')]=qs[_0x9508('0x32')](_0x57c7ae[_0x9508('0x2b')][_0x9508('0x32')]);_0x32b0dd[_0x9508('0x1a')]=qs[_0x9508('0x1a')](_0x57c7ae[_0x9508('0x2b')]['offset']);}_0x32b0dd[_0x9508('0x33')]=qs[_0x9508('0x34')](_0x57c7ae['query'][_0x9508('0x34')]);_0x32b0dd[_0x9508('0x35')]=qs[_0x9508('0x36')](_[_0x9508('0x37')](_0x57c7ae[_0x9508('0x2b')],_0x22b2e2[_0x9508('0x36')]));if(_0x57c7ae[_0x9508('0x2b')][_0x9508('0x38')]){_0x32b0dd[_0x9508('0x35')]=_[_0x9508('0x39')](_0x32b0dd[_0x9508('0x35')],{'$or':_['map'](_0x1f7755,function(_0x125c8f){if(_0x125c8f['type']!==_0x9508('0x3a')){var _0x1dd6c9={};_0x1dd6c9[_0x125c8f[_0x9508('0x21')]]={'$like':'%'+_0x57c7ae['query']['filter']+'%'};return _0x1dd6c9;}})});}_0x32b0dd=_[_0x9508('0x39')]({},_0x32b0dd,_0x57c7ae[_0x9508('0x3b')]);var _0x1277b1={'where':_0x32b0dd[_0x9508('0x35')]};return db['DeskField'][_0x9508('0x19')](_0x1277b1)['then'](function(_0x37b8a2){_0x4529a8[_0x9508('0x19')]=_0x37b8a2;if(_0x57c7ae['query'][_0x9508('0x3c')]){_0x32b0dd[_0x9508('0x3d')]=[{'all':!![]}];}return db['DeskField'][_0x9508('0x3e')](_0x32b0dd);})[_0x9508('0x20')](function(_0x5b601d){_0x4529a8[_0x9508('0x3f')]=_0x5b601d;return _0x4529a8;})['then'](respondWithFilteredResult(_0x49246b,_0x32b0dd))['catch'](handleError(_0x49246b,null));};exports[_0x9508('0x40')]=function(_0x4ff354,_0x254e7f){var _0x22c135={'raw':!![],'where':{'id':_0x4ff354[_0x9508('0x41')]['id']}},_0x10e8f5={};_0x10e8f5['model']=_['keys'](db['DeskField'][_0x9508('0x26')]);_0x10e8f5['query']=_[_0x9508('0x2a')](_0x4ff354['query']);_0x10e8f5[_0x9508('0x36')]=_[_0x9508('0x2c')](_0x10e8f5[_0x9508('0x29')],_0x10e8f5[_0x9508('0x2b')]);_0x22c135['attributes']=_[_0x9508('0x2c')](_0x10e8f5[_0x9508('0x29')],qs[_0x9508('0x2e')](_0x4ff354['query'][_0x9508('0x2e')]));_0x22c135[_0x9508('0x2d')]=_0x22c135['attributes'][_0x9508('0x2f')]?_0x22c135['attributes']:_0x10e8f5[_0x9508('0x29')];if(_0x4ff354['query']['includeAll']){_0x22c135[_0x9508('0x3d')]=[{'all':!![]}];}_0x22c135=_[_0x9508('0x39')]({},_0x22c135,_0x4ff354[_0x9508('0x3b')]);return db[_0x9508('0x25')][_0x9508('0x42')](_0x22c135)[_0x9508('0x20')](handleEntityNotFound(_0x254e7f,null))['then'](respondWithResult(_0x254e7f,null))[_0x9508('0x43')](handleError(_0x254e7f,null));};exports[_0x9508('0x44')]=function(_0x11dac3,_0x4c860a){return db[_0x9508('0x25')][_0x9508('0x44')](_0x11dac3[_0x9508('0x45')],{})[_0x9508('0x20')](respondWithResult(_0x4c860a,0xc9))['catch'](handleError(_0x4c860a,null));};exports[_0x9508('0x1f')]=function(_0x552d10,_0x155928){if(_0x552d10[_0x9508('0x45')]['id']){delete _0x552d10['body']['id'];}return db[_0x9508('0x25')][_0x9508('0x42')]({'where':{'id':_0x552d10['params']['id']}})[_0x9508('0x20')](handleEntityNotFound(_0x155928,null))[_0x9508('0x20')](saveUpdates(_0x552d10['body'],null))[_0x9508('0x20')](respondWithResult(_0x155928,null))['catch'](handleError(_0x155928,null));};exports[_0x9508('0x46')]=function(_0x50df5e,_0x1e6c8c){return db['DeskField']['find']({'where':{'id':_0x50df5e['params']['id']}})['then'](handleEntityNotFound(_0x1e6c8c,null))[_0x9508('0x20')](removeEntity(_0x1e6c8c,null))[_0x9508('0x43')](handleError(_0x1e6c8c,null));};
\ No newline at end of file
+var _0xdb94=['where','filters','filter','merge','type','options','includeAll','include','findAll','rows','catch','show','params','length','find','body','eml-format','rimraf','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','../../config/license/hardware','../../config/logger','api','../../config/utils','../../mysqldb','sendStatus','status','end','json','count','offset','limit','apply','reject','save','update','then','destroy','error','stack','name','send','map','DeskField','rawAttributes','fieldName','key','query','keys','intersection','model','attributes','fields','nolimit','order','sort'];(function(_0x32f074,_0x50355b){var _0x5d932f=function(_0x57c38f){while(--_0x57c38f){_0x32f074['push'](_0x32f074['shift']());}};_0x5d932f(++_0x50355b);}(_0xdb94,0xe5));var _0x4db9=function(_0x3e6262,_0x4c5785){_0x3e6262=_0x3e6262-0x0;var _0x365036=_0xdb94[_0x3e6262];return _0x365036;};'use strict';var pdf=require('html-pdf');var emlformat=require(_0x4db9('0x0'));var rimraf=require(_0x4db9('0x1'));var zipdir=require('zip-dir');var jsonpatch=require(_0x4db9('0x2'));var rp=require(_0x4db9('0x3'));var moment=require(_0x4db9('0x4'));var BPromise=require(_0x4db9('0x5'));var Mustache=require(_0x4db9('0x6'));var util=require('util');var path=require(_0x4db9('0x7'));var sox=require('sox');var csv=require(_0x4db9('0x8'));var ejs=require(_0x4db9('0x9'));var fs=require('fs');var _=require(_0x4db9('0xa'));var squel=require(_0x4db9('0xb'));var crypto=require(_0x4db9('0xc'));var jsforce=require('jsforce');var deskjs=require(_0x4db9('0xd'));var toCsv=require(_0x4db9('0x8'));var querystring=require(_0x4db9('0xe'));var Papa=require(_0x4db9('0xf'));var Redis=require(_0x4db9('0x10'));var authService=require('../../components/auth/service');var qs=require(_0x4db9('0x11'));var as=require(_0x4db9('0x12'));var hardwareService=require(_0x4db9('0x13'));var logger=require(_0x4db9('0x14'))(_0x4db9('0x15'));var utils=require(_0x4db9('0x16'));var config=require('../../config/environment');var db=require(_0x4db9('0x17'))['db'];function respondWithStatusCode(_0x4397fc,_0x59f01c){_0x59f01c=_0x59f01c||0xcc;return function(_0x549c92){if(_0x549c92){return _0x4397fc[_0x4db9('0x18')](_0x59f01c);}return _0x4397fc[_0x4db9('0x19')](_0x59f01c)[_0x4db9('0x1a')]();};}function respondWithResult(_0x4d4046,_0x1a93be){_0x1a93be=_0x1a93be||0xc8;return function(_0x3dde55){if(_0x3dde55){return _0x4d4046[_0x4db9('0x19')](_0x1a93be)[_0x4db9('0x1b')](_0x3dde55);}};}function respondWithFilteredResult(_0x2d89a7,_0x585230){return function(_0x1b1062){if(_0x1b1062){var _0x1a5a9c=_0x1b1062[_0x4db9('0x1c')],_0x5d4d70=_0x585230['offset'],_0x27b387=_0x585230[_0x4db9('0x1d')]+_0x585230[_0x4db9('0x1e')],_0x7df575;if(_0x27b387>=_0x1a5a9c){_0x27b387=_0x1a5a9c;_0x7df575=0xc8;}else{_0x7df575=0xce;}_0x2d89a7['status'](_0x7df575);return _0x2d89a7['set']('Content-Range',_0x5d4d70+'-'+_0x27b387+'/'+_0x1a5a9c)[_0x4db9('0x1b')](_0x1b1062);}return null;};}function patchUpdates(_0x4235ab){return function(_0x48ff99){try{jsonpatch[_0x4db9('0x1f')](_0x48ff99,_0x4235ab,!![]);}catch(_0x1f6b24){return BPromise[_0x4db9('0x20')](_0x1f6b24);}return _0x48ff99[_0x4db9('0x21')]();};}function saveUpdates(_0x439433,_0x28b7f6){return function(_0x34a6ed){if(_0x34a6ed){return _0x34a6ed[_0x4db9('0x22')](_0x439433)[_0x4db9('0x23')](function(_0x41d0c1){return _0x41d0c1;});}return null;};}function removeEntity(_0x29b4ff,_0x102402){return function(_0x4d56a1){if(_0x4d56a1){return _0x4d56a1[_0x4db9('0x24')]()[_0x4db9('0x23')](function(){_0x29b4ff['status'](0xcc)[_0x4db9('0x1a')]();});}};}function handleEntityNotFound(_0x3f4931,_0x4419af){return function(_0x402898){if(!_0x402898){_0x3f4931['sendStatus'](0x194);}return _0x402898;};}function handleError(_0xe3dbe,_0x506cc9){_0x506cc9=_0x506cc9||0x1f4;return function(_0x1cf805){logger[_0x4db9('0x25')](_0x1cf805[_0x4db9('0x26')]);if(_0x1cf805[_0x4db9('0x27')]){delete _0x1cf805[_0x4db9('0x27')];}_0xe3dbe[_0x4db9('0x19')](_0x506cc9)[_0x4db9('0x28')](_0x1cf805);};}exports['index']=function(_0x5f59be,_0x1b2647){var _0x5ce6cc={},_0x910137={},_0x2653be={'count':0x0,'rows':[]};var _0x38d5e2=_[_0x4db9('0x29')](db[_0x4db9('0x2a')][_0x4db9('0x2b')],function(_0x1d0dc2){return{'name':_0x1d0dc2[_0x4db9('0x2c')],'type':_0x1d0dc2['type'][_0x4db9('0x2d')]};});_0x910137['model']=_[_0x4db9('0x29')](_0x38d5e2,_0x4db9('0x27'));_0x910137[_0x4db9('0x2e')]=_[_0x4db9('0x2f')](_0x5f59be[_0x4db9('0x2e')]);_0x910137['filters']=_[_0x4db9('0x30')](_0x910137[_0x4db9('0x31')],_0x910137[_0x4db9('0x2e')]);_0x5ce6cc[_0x4db9('0x32')]=_['intersection'](_0x910137['model'],qs[_0x4db9('0x33')](_0x5f59be[_0x4db9('0x2e')]['fields']));_0x5ce6cc['attributes']=_0x5ce6cc[_0x4db9('0x32')]['length']?_0x5ce6cc['attributes']:_0x910137[_0x4db9('0x31')];if(!_0x5f59be[_0x4db9('0x2e')]['hasOwnProperty'](_0x4db9('0x34'))){_0x5ce6cc[_0x4db9('0x1e')]=qs[_0x4db9('0x1e')](_0x5f59be[_0x4db9('0x2e')]['limit']);_0x5ce6cc[_0x4db9('0x1d')]=qs['offset'](_0x5f59be['query']['offset']);}_0x5ce6cc[_0x4db9('0x35')]=qs[_0x4db9('0x36')](_0x5f59be['query'][_0x4db9('0x36')]);_0x5ce6cc[_0x4db9('0x37')]=qs['filters'](_['pick'](_0x5f59be['query'],_0x910137[_0x4db9('0x38')]));if(_0x5f59be['query'][_0x4db9('0x39')]){_0x5ce6cc['where']=_[_0x4db9('0x3a')](_0x5ce6cc[_0x4db9('0x37')],{'$or':_[_0x4db9('0x29')](_0x38d5e2,function(_0x10ccbc){if(_0x10ccbc[_0x4db9('0x3b')]!=='VIRTUAL'){var _0x1cf917={};_0x1cf917[_0x10ccbc['name']]={'$like':'%'+_0x5f59be[_0x4db9('0x2e')][_0x4db9('0x39')]+'%'};return _0x1cf917;}})});}_0x5ce6cc=_[_0x4db9('0x3a')]({},_0x5ce6cc,_0x5f59be[_0x4db9('0x3c')]);var _0x146850={'where':_0x5ce6cc[_0x4db9('0x37')]};return db['DeskField'][_0x4db9('0x1c')](_0x146850)[_0x4db9('0x23')](function(_0x5ba7df){_0x2653be['count']=_0x5ba7df;if(_0x5f59be[_0x4db9('0x2e')][_0x4db9('0x3d')]){_0x5ce6cc[_0x4db9('0x3e')]=[{'all':!![]}];}return db[_0x4db9('0x2a')][_0x4db9('0x3f')](_0x5ce6cc);})[_0x4db9('0x23')](function(_0x1a9fe7){_0x2653be[_0x4db9('0x40')]=_0x1a9fe7;return _0x2653be;})[_0x4db9('0x23')](respondWithFilteredResult(_0x1b2647,_0x5ce6cc))[_0x4db9('0x41')](handleError(_0x1b2647,null));};exports[_0x4db9('0x42')]=function(_0x3254d1,_0x489967){var _0x2716d6={'raw':!![],'where':{'id':_0x3254d1[_0x4db9('0x43')]['id']}},_0x4a2121={};_0x4a2121[_0x4db9('0x31')]=_['keys'](db['DeskField'][_0x4db9('0x2b')]);_0x4a2121[_0x4db9('0x2e')]=_[_0x4db9('0x2f')](_0x3254d1['query']);_0x4a2121[_0x4db9('0x38')]=_['intersection'](_0x4a2121[_0x4db9('0x31')],_0x4a2121[_0x4db9('0x2e')]);_0x2716d6[_0x4db9('0x32')]=_[_0x4db9('0x30')](_0x4a2121[_0x4db9('0x31')],qs['fields'](_0x3254d1[_0x4db9('0x2e')][_0x4db9('0x33')]));_0x2716d6[_0x4db9('0x32')]=_0x2716d6[_0x4db9('0x32')][_0x4db9('0x44')]?_0x2716d6['attributes']:_0x4a2121[_0x4db9('0x31')];if(_0x3254d1[_0x4db9('0x2e')][_0x4db9('0x3d')]){_0x2716d6[_0x4db9('0x3e')]=[{'all':!![]}];}_0x2716d6=_[_0x4db9('0x3a')]({},_0x2716d6,_0x3254d1[_0x4db9('0x3c')]);return db[_0x4db9('0x2a')][_0x4db9('0x45')](_0x2716d6)[_0x4db9('0x23')](handleEntityNotFound(_0x489967,null))['then'](respondWithResult(_0x489967,null))[_0x4db9('0x41')](handleError(_0x489967,null));};exports['create']=function(_0x53f3bb,_0x21d18d){return db[_0x4db9('0x2a')]['create'](_0x53f3bb['body'],{})[_0x4db9('0x23')](respondWithResult(_0x21d18d,0xc9))[_0x4db9('0x41')](handleError(_0x21d18d,null));};exports[_0x4db9('0x22')]=function(_0x7f0aac,_0x2c2c17){if(_0x7f0aac[_0x4db9('0x46')]['id']){delete _0x7f0aac[_0x4db9('0x46')]['id'];}return db[_0x4db9('0x2a')][_0x4db9('0x45')]({'where':{'id':_0x7f0aac[_0x4db9('0x43')]['id']}})[_0x4db9('0x23')](handleEntityNotFound(_0x2c2c17,null))['then'](saveUpdates(_0x7f0aac[_0x4db9('0x46')],null))[_0x4db9('0x23')](respondWithResult(_0x2c2c17,null))['catch'](handleError(_0x2c2c17,null));};exports[_0x4db9('0x24')]=function(_0x5a461d,_0x26ae1a){return db[_0x4db9('0x2a')][_0x4db9('0x45')]({'where':{'id':_0x5a461d[_0x4db9('0x43')]['id']}})[_0x4db9('0x23')](handleEntityNotFound(_0x26ae1a,null))[_0x4db9('0x23')](removeEntity(_0x26ae1a,null))[_0x4db9('0x41')](handleError(_0x26ae1a,null));};
\ No newline at end of file
diff --git a/server/api/intDeskField/intDeskField.model.js b/server/api/intDeskField/intDeskField.model.js
index 4e0bb84..84184da 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 _0xc78b=['desk_unique_index','idField','FieldId','lodash','util','../../config/logger','api','moment','bluebird','request-promise','path','../../config/environment','./intDeskField.attributes','exports','define','DeskField'];(function(_0x311375,_0x3d0bbd){var _0x2c5262=function(_0x16648c){while(--_0x16648c){_0x311375['push'](_0x311375['shift']());}};_0x2c5262(++_0x3d0bbd);}(_0xc78b,0x1f3));var _0xbc78=function(_0x20e205,_0x5d1e06){_0x20e205=_0x20e205-0x0;var _0x168b52=_0xc78b[_0x20e205];return _0x168b52;};'use strict';var _=require(_0xbc78('0x0'));var util=require(_0xbc78('0x1'));var logger=require(_0xbc78('0x2'))(_0xbc78('0x3'));var moment=require(_0xbc78('0x4'));var BPromise=require(_0xbc78('0x5'));var rp=require(_0xbc78('0x6'));var fs=require('fs');var path=require(_0xbc78('0x7'));var rimraf=require('rimraf');var config=require(_0xbc78('0x8'));var attributes=require(_0xbc78('0x9'));module[_0xbc78('0xa')]=function(_0x54aa04,_0xe8d4e9){return _0x54aa04[_0xbc78('0xb')](_0xbc78('0xc'),attributes,{'tableName':'int_desk_fields','paranoid':![],'indexes':[{'name':_0xbc78('0xd'),'fields':[_0xbc78('0xe'),_0xbc78('0xf')],'unique':!![]}],'timestamps':!![]});};
\ No newline at end of file
+var _0x090a=['int_desk_fields','desk_unique_index','idField','FieldId','lodash','util','../../config/logger','api','request-promise','path','rimraf','../../config/environment','./intDeskField.attributes','define'];(function(_0x2235bf,_0x3a06a7){var _0x4c3a64=function(_0x3b3bb6){while(--_0x3b3bb6){_0x2235bf['push'](_0x2235bf['shift']());}};_0x4c3a64(++_0x3a06a7);}(_0x090a,0xc8));var _0xa090=function(_0x463a3c,_0x47c2ae){_0x463a3c=_0x463a3c-0x0;var _0x41186b=_0x090a[_0x463a3c];return _0x41186b;};'use strict';var _=require(_0xa090('0x0'));var util=require(_0xa090('0x1'));var logger=require(_0xa090('0x2'))(_0xa090('0x3'));var moment=require('moment');var BPromise=require('bluebird');var rp=require(_0xa090('0x4'));var fs=require('fs');var path=require(_0xa090('0x5'));var rimraf=require(_0xa090('0x6'));var config=require(_0xa090('0x7'));var attributes=require(_0xa090('0x8'));module['exports']=function(_0x123e6b,_0x7bcfed){return _0x123e6b[_0xa090('0x9')]('DeskField',attributes,{'tableName':_0xa090('0xa'),'paranoid':![],'indexes':[{'name':_0xa090('0xb'),'fields':[_0xa090('0xc'),_0xa090('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 5b5f792..0dcfeaf 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 _0x9713=['request','info','DeskField,\x20%s,\x20%s','request\x20sent','debug','DeskField,\x20%s,\x20%s,\x20%s','stringify','error','code','message','result','catch','lodash','util','moment','bluebird','ioredis','../../mysqldb','../../config/logger','../../config/environment','jayson/promise','client','http'];(function(_0x507f9e,_0x308d20){var _0x250f7e=function(_0x144202){while(--_0x144202){_0x507f9e['push'](_0x507f9e['shift']());}};_0x250f7e(++_0x308d20);}(_0x9713,0x14e));var _0x3971=function(_0x32e668,_0x4b5cf6){_0x32e668=_0x32e668-0x0;var _0x1ff7b3=_0x9713[_0x32e668];return _0x1ff7b3;};'use strict';var _=require(_0x3971('0x0'));var util=require(_0x3971('0x1'));var moment=require(_0x3971('0x2'));var BPromise=require(_0x3971('0x3'));var rs=require('randomstring');var fs=require('fs');var Redis=require(_0x3971('0x4'));var db=require(_0x3971('0x5'))['db'];var utils=require('../../config/utils');var logger=require(_0x3971('0x6'))('rpc');var config=require(_0x3971('0x7'));var jayson=require(_0x3971('0x8'));var client=jayson[_0x3971('0x9')][_0x3971('0xa')]({'port':0x232a});function respondWithRpcPromise(_0x2dde16,_0x2de5c6,_0x2f601d){return new BPromise(function(_0x44eace,_0x3517cf){return client[_0x3971('0xb')](_0x2dde16,_0x2f601d)['then'](function(_0x536062){logger[_0x3971('0xc')](_0x3971('0xd'),_0x2de5c6,_0x3971('0xe'));logger[_0x3971('0xf')](_0x3971('0x10'),_0x2de5c6,_0x3971('0xe'),JSON[_0x3971('0x11')](_0x536062));if(_0x536062[_0x3971('0x12')]){if(_0x536062[_0x3971('0x12')][_0x3971('0x13')]===0x1f4){logger[_0x3971('0x12')](_0x3971('0xd'),_0x2de5c6,_0x536062[_0x3971('0x12')][_0x3971('0x14')]);return _0x3517cf(_0x536062['error'][_0x3971('0x14')]);}logger[_0x3971('0x12')](_0x3971('0xd'),_0x2de5c6,_0x536062['error']['message']);return _0x44eace(_0x536062[_0x3971('0x12')][_0x3971('0x14')]);}else{logger['info'](_0x3971('0xd'),_0x2de5c6,'request\x20sent');_0x44eace(_0x536062[_0x3971('0x15')][_0x3971('0x14')]);}})[_0x3971('0x16')](function(_0x5f0797){logger[_0x3971('0x12')](_0x3971('0xd'),_0x2de5c6,_0x5f0797);_0x3517cf(_0x5f0797);});});}
\ No newline at end of file
+var _0xe10a=['../../config/environment','jayson/promise','client','request','DeskField,\x20%s,\x20%s','debug','DeskField,\x20%s,\x20%s,\x20%s','stringify','error','code','message','info','request\x20sent','catch','lodash','moment','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc'];(function(_0x373cd0,_0x1ba136){var _0x31c43a=function(_0x5b0662){while(--_0x5b0662){_0x373cd0['push'](_0x373cd0['shift']());}};_0x31c43a(++_0x1ba136);}(_0xe10a,0x66));var _0xae10=function(_0xc5ab53,_0x25bfcc){_0xc5ab53=_0xc5ab53-0x0;var _0x1ccec9=_0xe10a[_0xc5ab53];return _0x1ccec9;};'use strict';var _=require(_0xae10('0x0'));var util=require('util');var moment=require(_0xae10('0x1'));var BPromise=require('bluebird');var rs=require(_0xae10('0x2'));var fs=require('fs');var Redis=require(_0xae10('0x3'));var db=require(_0xae10('0x4'))['db'];var utils=require(_0xae10('0x5'));var logger=require(_0xae10('0x6'))(_0xae10('0x7'));var config=require(_0xae10('0x8'));var jayson=require(_0xae10('0x9'));var client=jayson[_0xae10('0xa')]['http']({'port':0x232a});function respondWithRpcPromise(_0x18391b,_0x10deab,_0x4a0d40){return new BPromise(function(_0x2510b3,_0xbae60a){return client[_0xae10('0xb')](_0x18391b,_0x4a0d40)['then'](function(_0x2c0733){logger['info'](_0xae10('0xc'),_0x10deab,'request\x20sent');logger[_0xae10('0xd')](_0xae10('0xe'),_0x10deab,'request\x20sent',JSON[_0xae10('0xf')](_0x2c0733));if(_0x2c0733[_0xae10('0x10')]){if(_0x2c0733[_0xae10('0x10')][_0xae10('0x11')]===0x1f4){logger[_0xae10('0x10')](_0xae10('0xc'),_0x10deab,_0x2c0733[_0xae10('0x10')][_0xae10('0x12')]);return _0xbae60a(_0x2c0733['error']['message']);}logger[_0xae10('0x10')](_0xae10('0xc'),_0x10deab,_0x2c0733['error'][_0xae10('0x12')]);return _0x2510b3(_0x2c0733[_0xae10('0x10')][_0xae10('0x12')]);}else{logger[_0xae10('0x13')](_0xae10('0xc'),_0x10deab,_0xae10('0x14'));_0x2510b3(_0x2c0733['result'][_0xae10('0x12')]);}})[_0xae10('0x15')](function(_0x4f510f){logger[_0xae10('0x10')]('DeskField,\x20%s,\x20%s',_0x10deab,_0x4f510f);_0xbae60a(_0x4f510f);});});}
\ No newline at end of file
diff --git a/server/api/intDynamics365Account/index.js b/server/api/intDynamics365Account/index.js
index 92fd8d6..104aded 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 _0x16f8=['delete','destroy','multer','util','path','connect-timeout','express','Router','../../components/auth/service','../../components/interaction/service','../../config/environment','./intDynamics365Account.controller','get','isAuthenticated','index','/:id','show','/:id/configurations','getConfigurations','/:id/fields','post','addConfiguration','put','update'];(function(_0x55f107,_0x41419b){var _0x4fd11b=function(_0x6b148e){while(--_0x6b148e){_0x55f107['push'](_0x55f107['shift']());}};_0x4fd11b(++_0x41419b);}(_0x16f8,0x92));var _0x816f=function(_0x126ee1,_0x4b9781){_0x126ee1=_0x126ee1-0x0;var _0x32524c=_0x16f8[_0x126ee1];return _0x32524c;};'use strict';var multer=require(_0x816f('0x0'));var util=require(_0x816f('0x1'));var path=require(_0x816f('0x2'));var timeout=require(_0x816f('0x3'));var express=require(_0x816f('0x4'));var router=express[_0x816f('0x5')]();var auth=require(_0x816f('0x6'));var interaction=require(_0x816f('0x7'));var config=require(_0x816f('0x8'));var controller=require(_0x816f('0x9'));router[_0x816f('0xa')]('/',auth[_0x816f('0xb')](),controller[_0x816f('0xc')]);router[_0x816f('0xa')](_0x816f('0xd'),auth[_0x816f('0xb')](),controller[_0x816f('0xe')]);router[_0x816f('0xa')](_0x816f('0xf'),auth[_0x816f('0xb')](),controller[_0x816f('0x10')]);router[_0x816f('0xa')](_0x816f('0x11'),auth[_0x816f('0xb')](),controller['getFields']);router[_0x816f('0x12')]('/',auth[_0x816f('0xb')](),controller['create']);router[_0x816f('0x12')]('/:id/configurations',auth[_0x816f('0xb')](),controller[_0x816f('0x13')]);router[_0x816f('0x14')]('/:id',auth[_0x816f('0xb')](),controller[_0x816f('0x15')]);router[_0x816f('0x16')](_0x816f('0xd'),auth['isAuthenticated'](),controller[_0x816f('0x17')]);module['exports']=router;
\ No newline at end of file
+var _0xd4d4=['./intDynamics365Account.controller','get','isAuthenticated','index','/:id','/:id/configurations','getConfigurations','/:id/fields','getFields','post','addConfiguration','update','delete','exports','connect-timeout','express','Router','../../components/auth/service','../../components/interaction/service'];(function(_0x3dd15e,_0x1f0015){var _0x231fd0=function(_0x4f680a){while(--_0x4f680a){_0x3dd15e['push'](_0x3dd15e['shift']());}};_0x231fd0(++_0x1f0015);}(_0xd4d4,0x177));var _0x4d4d=function(_0x4fd423,_0xa6f26b){_0x4fd423=_0x4fd423-0x0;var _0x48289a=_0xd4d4[_0x4fd423];return _0x48289a;};'use strict';var multer=require('multer');var util=require('util');var path=require('path');var timeout=require(_0x4d4d('0x0'));var express=require(_0x4d4d('0x1'));var router=express[_0x4d4d('0x2')]();var auth=require(_0x4d4d('0x3'));var interaction=require(_0x4d4d('0x4'));var config=require('../../config/environment');var controller=require(_0x4d4d('0x5'));router[_0x4d4d('0x6')]('/',auth[_0x4d4d('0x7')](),controller[_0x4d4d('0x8')]);router[_0x4d4d('0x6')](_0x4d4d('0x9'),auth[_0x4d4d('0x7')](),controller['show']);router[_0x4d4d('0x6')](_0x4d4d('0xa'),auth[_0x4d4d('0x7')](),controller[_0x4d4d('0xb')]);router[_0x4d4d('0x6')](_0x4d4d('0xc'),auth[_0x4d4d('0x7')](),controller[_0x4d4d('0xd')]);router[_0x4d4d('0xe')]('/',auth[_0x4d4d('0x7')](),controller['create']);router[_0x4d4d('0xe')](_0x4d4d('0xa'),auth['isAuthenticated'](),controller[_0x4d4d('0xf')]);router['put'](_0x4d4d('0x9'),auth[_0x4d4d('0x7')](),controller[_0x4d4d('0x10')]);router[_0x4d4d('0x11')](_0x4d4d('0x9'),auth['isAuthenticated'](),controller['destroy']);module[_0x4d4d('0x12')]=router;
\ No newline at end of file
diff --git a/server/api/intDynamics365Account/intDynamics365Account.attributes.js b/server/api/intDynamics365Account/intDynamics365Account.attributes.js
index 47263df..ccc7429 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 _0x016a=['STRING','sequelize','exports'];(function(_0x1960ce,_0x5e2d14){var _0x15ff00=function(_0x12afab){while(--_0x12afab){_0x1960ce['push'](_0x1960ce['shift']());}};_0x15ff00(++_0x5e2d14);}(_0x016a,0x14e));var _0xa016=function(_0x22e47a,_0x4ea10c){_0x22e47a=_0x22e47a-0x0;var _0x15a12a=_0x016a[_0x22e47a];return _0x15a12a;};'use strict';var Sequelize=require(_0xa016('0x0'));module[_0xa016('0x1')]={'name':{'type':Sequelize[_0xa016('0x2')]},'username':{'type':Sequelize[_0xa016('0x2')]},'password':{'type':Sequelize['STRING']},'remoteUri':{'type':Sequelize[_0xa016('0x2')]},'tenantId':{'type':Sequelize[_0xa016('0x2')]},'clientId':{'type':Sequelize['STRING']},'clientSecret':{'type':Sequelize['STRING']},'serverUrl':{'type':Sequelize[_0xa016('0x2')]},'description':{'type':Sequelize[_0xa016('0x2')]}};
\ No newline at end of file
+var _0xabd8=['STRING','sequelize','exports'];(function(_0x4c7645,_0x49d3ab){var _0x59d1fc=function(_0xb7553f){while(--_0xb7553f){_0x4c7645['push'](_0x4c7645['shift']());}};_0x59d1fc(++_0x49d3ab);}(_0xabd8,0x184));var _0x8abd=function(_0x44216d,_0x4938a7){_0x44216d=_0x44216d-0x0;var _0xeca523=_0xabd8[_0x44216d];return _0xeca523;};'use strict';var Sequelize=require(_0x8abd('0x0'));module[_0x8abd('0x1')]={'name':{'type':Sequelize[_0x8abd('0x2')]},'username':{'type':Sequelize[_0x8abd('0x2')]},'password':{'type':Sequelize[_0x8abd('0x2')]},'remoteUri':{'type':Sequelize['STRING']},'tenantId':{'type':Sequelize[_0x8abd('0x2')]},'clientId':{'type':Sequelize['STRING']},'clientSecret':{'type':Sequelize[_0x8abd('0x2')]},'serverUrl':{'type':Sequelize[_0x8abd('0x2')]},'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 f481946..826e27e 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 _0x1d3a=['error','code','message','result','sendStatus','status','end','json','count','offset','limit','set','Content-Range','apply','update','destroy','stack','name','send','index','fieldName','type','key','model','map','keys','query','filters','intersection','attributes','fields','length','nolimit','order','sort','where','pick','merge','VIRTUAL','filter','Dynamics365Account','includeAll','include','findAll','catch','show','params','rawAttributes','options','find','create','getConfigurations','findOne','Dynamics365Configuration','hasOwnProperty','body','AccountId','Subjects','getSubjects','channel','Descriptions','Dynamics365Field','getFields','ticketType','Incident','PhoneCall','description','customerid','subject','directioncode','phonecall_activity_parties','accountidyominame','actualserviceunits','billedserviceunits','contactidname','contactidyominame','contractdetailidname','createdbyexternalpartyname','createdbyexternalpartyyominame','createdbyyominame','createdon','createdonbehalfbyname','customeridname','customeridtype','customeridyominame','entitlementidname','entityimage_timestamp','escalatedon','firstresponsebykpiidname','followupby','importsequencenumber','influencescore','kbarticleidname','lastonholdtime','masteridname','modifiedbyexternalpartyname','modifiedbyexternalpartyyominame','modifiedbyyominame','modifiedon','modifiedonbehalfbyname','msdyn_incidenttypename','msdyn_iotalertname','numberofchildincidents','onholdtime','overriddencreatedon','owneridtype','owneridyominame','parentcaseidname','primarycontactidname','primarycontactidyominame','prioritycodename','productidname','productserialnumber','resolveby','resolvebykpiidname','responseby','responsiblecontactidyominame','sentimentvalue','slaname','socialprofileidname','statecode','statuscode','subjectidname','ticketnumber','timezoneruleversionnumber','traversedpath','utcconversiontimezonecode','versionnumber','concat','username','password','remoteUri','tenantId','clientId','slice','substring','lastIndexOf','format','%s/api/data/v9.0/','POST','https://login.microsoftonline.com/','/oauth2/token','clientSecret','access_token','GET','Bearer\x20','4.0','value','MetadataId',')?$select=LogicalName&$expand=Attributes($select=LogicalName)','Attributes','remove','includes','forEach','@odata.type','PicklistAttributeMetadata','push','all','BooleanAttributeMetadata','StringAttributeMetadata','DoubleAttributeMetadata','IntegerAttributeMetadata','DateTimeAttributeMetadata','StatusAttributeMetadata','EntityNameAttributeMetadata','StateAttributeMetadata','DecimalAttributeMetadata','Wrong\x20credentials','EntityDefinitions(',')/Microsoft.Dynamics.CRM.PicklistAttributeMetadata?','$select=DisplayName,LogicalName&$expand=OptionSet($select=Options)','Options','Label','UserLocalizedLabel','Value','LogicalName','DisplayName',')/Attributes(','OptionSet','FalseOption','false',')/Microsoft.Dynamics.CRM.','?$select=DisplayName,LogicalName','html-pdf','eml-format','fast-json-patch','request-promise','bluebird','mustache','util','path','ejs','squel','jsforce','to-csv','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/logger','api','../../config/utils','../../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~!@#$%^&-_=+[{]}.','then','info','Dynamics365Account,\x20%s,\x20%s','request\x20sent','debug','Dynamics365Account,\x20%s,\x20%s,\x20%s'];(function(_0x122ef9,_0x451d2a){var _0x42fba0=function(_0x17c9d3){while(--_0x17c9d3){_0x122ef9['push'](_0x122ef9['shift']());}};_0x42fba0(++_0x451d2a);}(_0x1d3a,0x18f));var _0xa1d3=function(_0x2f1762,_0xab43df){_0x2f1762=_0x2f1762-0x0;var _0x8ab21=_0x1d3a[_0x2f1762];return _0x8ab21;};'use strict';var pdf=require(_0xa1d3('0x0'));var emlformat=require(_0xa1d3('0x1'));var rimraf=require('rimraf');var zipdir=require('zip-dir');var jsonpatch=require(_0xa1d3('0x2'));var rp=require(_0xa1d3('0x3'));var moment=require('moment');var BPromise=require(_0xa1d3('0x4'));var Mustache=require(_0xa1d3('0x5'));var util=require(_0xa1d3('0x6'));var path=require(_0xa1d3('0x7'));var sox=require('sox');var csv=require('to-csv');var ejs=require(_0xa1d3('0x8'));var fs=require('fs');var _=require('lodash');var squel=require(_0xa1d3('0x9'));var crypto=require('crypto');var jsforce=require(_0xa1d3('0xa'));var deskjs=require('desk.js');var toCsv=require(_0xa1d3('0xb'));var querystring=require(_0xa1d3('0xc'));var Papa=require(_0xa1d3('0xd'));var Redis=require(_0xa1d3('0xe'));var authService=require(_0xa1d3('0xf'));var qs=require(_0xa1d3('0x10'));var as=require(_0xa1d3('0x11'));var hardwareService=require('../../config/license/hardware');var logger=require(_0xa1d3('0x12'))(_0xa1d3('0x13'));var utils=require(_0xa1d3('0x14'));var config=require('../../config/environment');var db=require(_0xa1d3('0x15'))['db'];var integrations=require('../../components/integrations/configuration');var jayson=require(_0xa1d3('0x16'));var client=jayson[_0xa1d3('0x17')][_0xa1d3('0x18')]({'port':0x232a});function checkPasswordPattern(_0x443a41,_0x43c7d8,_0x30f9a4){if(_0x30f9a4){var _0x1de6fa=new RegExp(/(?=.*[a-z])(?=.*[A-Z])(?=.*[0-9])(?=.*[?!@#\$%\^&\*~\-_=+[{\]\}])(?=.{8,})/);if(_0x1de6fa[_0xa1d3('0x19')](_0x43c7d8)){return _0x443a41;}else{throw new db['Sequelize']['ValidationError'](_0xa1d3('0x1a'));}}else{return _0x443a41;}}function respondWithRpcPromise(_0x4d42ef,_0x1da8f2,_0x3b957d,_0x5ce542){return new BPromise(function(_0x58811d,_0x537835){var _0x27a22b=_0x5ce542||client;return _0x27a22b['request'](_0x4d42ef,_0x3b957d)[_0xa1d3('0x1b')](function(_0x4f664b){logger[_0xa1d3('0x1c')](_0xa1d3('0x1d'),_0x1da8f2,_0xa1d3('0x1e'));logger[_0xa1d3('0x1f')](_0xa1d3('0x20'),_0x1da8f2,_0xa1d3('0x1e'),JSON['stringify'](_0x4f664b));if(_0x4f664b[_0xa1d3('0x21')]){if(_0x4f664b[_0xa1d3('0x21')][_0xa1d3('0x22')]===0x1f4){logger[_0xa1d3('0x21')](_0xa1d3('0x1d'),_0x1da8f2,_0x4f664b[_0xa1d3('0x21')][_0xa1d3('0x23')]);return _0x537835(_0x4f664b['error'][_0xa1d3('0x23')]);}logger['error'](_0xa1d3('0x1d'),_0x1da8f2,_0x4f664b[_0xa1d3('0x21')][_0xa1d3('0x23')]);return _0x58811d(_0x4f664b[_0xa1d3('0x21')][_0xa1d3('0x23')]);}else{logger['info'](_0xa1d3('0x1d'),_0x1da8f2,_0xa1d3('0x1e'));_0x58811d(_0x4f664b[_0xa1d3('0x24')][_0xa1d3('0x23')]);}})['catch'](function(_0x59c55f){logger[_0xa1d3('0x21')]('Dynamics365Account,\x20%s,\x20%s',_0x1da8f2,_0x59c55f);_0x537835(_0x59c55f);});});}function respondWithStatusCode(_0x1dd36c,_0xcb9c51){_0xcb9c51=_0xcb9c51||0xcc;return function(_0x577d3d){if(_0x577d3d){return _0x1dd36c[_0xa1d3('0x25')](_0xcb9c51);}return _0x1dd36c[_0xa1d3('0x26')](_0xcb9c51)[_0xa1d3('0x27')]();};}function respondWithResult(_0x3d4667,_0x3d441e){_0x3d441e=_0x3d441e||0xc8;return function(_0x336e41){if(_0x336e41){return _0x3d4667[_0xa1d3('0x26')](_0x3d441e)[_0xa1d3('0x28')](_0x336e41);}};}function respondWithFilteredResult(_0x1405eb,_0x45d0ff){return function(_0x98565d){if(_0x98565d){var _0xcebb4e=_0x98565d[_0xa1d3('0x29')],_0x15d83b=_0x45d0ff['offset'],_0x27abd3=_0x45d0ff[_0xa1d3('0x2a')]+_0x45d0ff[_0xa1d3('0x2b')],_0x512eae;if(_0x27abd3>=_0xcebb4e){_0x27abd3=_0xcebb4e;_0x512eae=0xc8;}else{_0x512eae=0xce;}_0x1405eb[_0xa1d3('0x26')](_0x512eae);return _0x1405eb[_0xa1d3('0x2c')](_0xa1d3('0x2d'),_0x15d83b+'-'+_0x27abd3+'/'+_0xcebb4e)['json'](_0x98565d);}return null;};}function patchUpdates(_0x3dd63f){return function(_0x3a5755){try{jsonpatch[_0xa1d3('0x2e')](_0x3a5755,_0x3dd63f,!![]);}catch(_0x599f07){return BPromise['reject'](_0x599f07);}return _0x3a5755['save']();};}function saveUpdates(_0x256cbe,_0x36064d){return function(_0x271ce0){if(_0x271ce0){return _0x271ce0[_0xa1d3('0x2f')](_0x256cbe)[_0xa1d3('0x1b')](function(_0x369129){return _0x369129;});}return null;};}function removeEntity(_0xb989b4,_0x404778){return function(_0x130fd2){if(_0x130fd2){return _0x130fd2[_0xa1d3('0x30')]()[_0xa1d3('0x1b')](function(){_0xb989b4[_0xa1d3('0x26')](0xcc)[_0xa1d3('0x27')]();});}};}function handleEntityNotFound(_0x309937,_0x733d5c){return function(_0x42eff2){if(!_0x42eff2){_0x309937[_0xa1d3('0x25')](0x194);}return _0x42eff2;};}function handleError(_0x106d2a,_0x111dd6){_0x111dd6=_0x111dd6||0x1f4;return function(_0x57680f){logger[_0xa1d3('0x21')](_0x57680f[_0xa1d3('0x31')]);if(_0x57680f[_0xa1d3('0x32')]){delete _0x57680f[_0xa1d3('0x32')];}_0x106d2a[_0xa1d3('0x26')](_0x111dd6)[_0xa1d3('0x33')](_0x57680f);};}exports[_0xa1d3('0x34')]=function(_0x453236,_0x240326){var _0x3bcb57={},_0x3412c9={},_0x233d60={'count':0x0,'rows':[]};var _0x489e60=_['map'](db['Dynamics365Account']['rawAttributes'],function(_0x4bab12){return{'name':_0x4bab12[_0xa1d3('0x35')],'type':_0x4bab12[_0xa1d3('0x36')][_0xa1d3('0x37')]};});_0x3412c9[_0xa1d3('0x38')]=_[_0xa1d3('0x39')](_0x489e60,_0xa1d3('0x32'));_0x3412c9['query']=_[_0xa1d3('0x3a')](_0x453236[_0xa1d3('0x3b')]);_0x3412c9[_0xa1d3('0x3c')]=_[_0xa1d3('0x3d')](_0x3412c9['model'],_0x3412c9[_0xa1d3('0x3b')]);_0x3bcb57[_0xa1d3('0x3e')]=_[_0xa1d3('0x3d')](_0x3412c9[_0xa1d3('0x38')],qs[_0xa1d3('0x3f')](_0x453236[_0xa1d3('0x3b')]['fields']));_0x3bcb57[_0xa1d3('0x3e')]=_0x3bcb57[_0xa1d3('0x3e')][_0xa1d3('0x40')]?_0x3bcb57[_0xa1d3('0x3e')]:_0x3412c9[_0xa1d3('0x38')];if(!_0x453236[_0xa1d3('0x3b')]['hasOwnProperty'](_0xa1d3('0x41'))){_0x3bcb57[_0xa1d3('0x2b')]=qs['limit'](_0x453236[_0xa1d3('0x3b')][_0xa1d3('0x2b')]);_0x3bcb57[_0xa1d3('0x2a')]=qs[_0xa1d3('0x2a')](_0x453236[_0xa1d3('0x3b')]['offset']);}_0x3bcb57[_0xa1d3('0x42')]=qs[_0xa1d3('0x43')](_0x453236[_0xa1d3('0x3b')]['sort']);_0x3bcb57[_0xa1d3('0x44')]=qs[_0xa1d3('0x3c')](_[_0xa1d3('0x45')](_0x453236[_0xa1d3('0x3b')],_0x3412c9[_0xa1d3('0x3c')]));if(_0x453236[_0xa1d3('0x3b')]['filter']){_0x3bcb57[_0xa1d3('0x44')]=_[_0xa1d3('0x46')](_0x3bcb57[_0xa1d3('0x44')],{'$or':_[_0xa1d3('0x39')](_0x489e60,function(_0x940120){if(_0x940120[_0xa1d3('0x36')]!==_0xa1d3('0x47')){var _0x451166={};_0x451166[_0x940120[_0xa1d3('0x32')]]={'$like':'%'+_0x453236[_0xa1d3('0x3b')][_0xa1d3('0x48')]+'%'};return _0x451166;}})});}_0x3bcb57=_['merge']({},_0x3bcb57,_0x453236['options']);var _0x503081={'where':_0x3bcb57[_0xa1d3('0x44')]};return db[_0xa1d3('0x49')][_0xa1d3('0x29')](_0x503081)[_0xa1d3('0x1b')](function(_0x16687d){_0x233d60[_0xa1d3('0x29')]=_0x16687d;if(_0x453236[_0xa1d3('0x3b')][_0xa1d3('0x4a')]){_0x3bcb57[_0xa1d3('0x4b')]=[{'all':!![]}];}return db[_0xa1d3('0x49')][_0xa1d3('0x4c')](_0x3bcb57);})['then'](function(_0x120172){_0x233d60['rows']=_0x120172;return _0x233d60;})[_0xa1d3('0x1b')](respondWithFilteredResult(_0x240326,_0x3bcb57))[_0xa1d3('0x4d')](handleError(_0x240326,null));};exports[_0xa1d3('0x4e')]=function(_0x5682d4,_0x1100ff){var _0xcc9be4={'raw':![],'where':{'id':_0x5682d4[_0xa1d3('0x4f')]['id']}},_0x5d9c18={};_0x5d9c18[_0xa1d3('0x38')]=_['keys'](db[_0xa1d3('0x49')][_0xa1d3('0x50')]);_0x5d9c18[_0xa1d3('0x3b')]=_[_0xa1d3('0x3a')](_0x5682d4[_0xa1d3('0x3b')]);_0x5d9c18[_0xa1d3('0x3c')]=_[_0xa1d3('0x3d')](_0x5d9c18[_0xa1d3('0x38')],_0x5d9c18['query']);_0xcc9be4[_0xa1d3('0x3e')]=_[_0xa1d3('0x3d')](_0x5d9c18[_0xa1d3('0x38')],qs[_0xa1d3('0x3f')](_0x5682d4[_0xa1d3('0x3b')][_0xa1d3('0x3f')]));_0xcc9be4[_0xa1d3('0x3e')]=_0xcc9be4[_0xa1d3('0x3e')]['length']?_0xcc9be4[_0xa1d3('0x3e')]:_0x5d9c18[_0xa1d3('0x38')];if(_0x5682d4[_0xa1d3('0x3b')][_0xa1d3('0x4a')]){_0xcc9be4[_0xa1d3('0x4b')]=[{'all':!![]}];}_0xcc9be4=_['merge']({},_0xcc9be4,_0x5682d4[_0xa1d3('0x51')]);return db['Dynamics365Account'][_0xa1d3('0x52')](_0xcc9be4)[_0xa1d3('0x1b')](handleEntityNotFound(_0x1100ff,null))[_0xa1d3('0x1b')](respondWithResult(_0x1100ff,null))['catch'](handleError(_0x1100ff,null));};exports[_0xa1d3('0x53')]=function(_0x2188d6,_0x59fd92){return db[_0xa1d3('0x49')][_0xa1d3('0x53')](_0x2188d6['body'],{})[_0xa1d3('0x1b')](respondWithResult(_0x59fd92,0xc9))[_0xa1d3('0x4d')](handleError(_0x59fd92,null));};exports[_0xa1d3('0x2f')]=function(_0x1f5360,_0x344509){if(_0x1f5360['body']['id']){delete _0x1f5360['body']['id'];}return db['Dynamics365Account'][_0xa1d3('0x52')]({'where':{'id':_0x1f5360['params']['id']}})[_0xa1d3('0x1b')](handleEntityNotFound(_0x344509,null))['then'](saveUpdates(_0x1f5360['body'],null))['then'](respondWithResult(_0x344509,null))[_0xa1d3('0x4d')](handleError(_0x344509,null));};exports[_0xa1d3('0x30')]=function(_0x5538fa,_0x43eb6a){return db[_0xa1d3('0x49')][_0xa1d3('0x52')]({'where':{'id':_0x5538fa[_0xa1d3('0x4f')]['id']}})[_0xa1d3('0x1b')](handleEntityNotFound(_0x43eb6a,null))[_0xa1d3('0x1b')](removeEntity(_0x43eb6a,null))['catch'](handleError(_0x43eb6a,null));};exports[_0xa1d3('0x54')]=function(_0x23f246,_0x20759a,_0x172ff6){var _0xbed451={};var _0x39dd40={};var _0x1cb252;var _0x26c7d6;return db['Dynamics365Account'][_0xa1d3('0x55')]({'where':{'id':_0x23f246[_0xa1d3('0x4f')]['id']}})['then'](handleEntityNotFound(_0x20759a,null))[_0xa1d3('0x1b')](function(_0x4c36ef){if(_0x4c36ef){_0x1cb252=_0x4c36ef;_0x39dd40[_0xa1d3('0x38')]=_['keys'](db[_0xa1d3('0x56')][_0xa1d3('0x50')]);_0x39dd40[_0xa1d3('0x3b')]=_[_0xa1d3('0x3a')](_0x23f246[_0xa1d3('0x3b')]);_0x39dd40['filters']=_['intersection'](_0x39dd40[_0xa1d3('0x38')],_0x39dd40[_0xa1d3('0x3b')]);_0xbed451['attributes']=_['intersection'](_0x39dd40[_0xa1d3('0x38')],qs[_0xa1d3('0x3f')](_0x23f246[_0xa1d3('0x3b')][_0xa1d3('0x3f')]));_0xbed451['attributes']=_0xbed451[_0xa1d3('0x3e')]['length']?_0xbed451['attributes']:_0x39dd40['model'];_0xbed451[_0xa1d3('0x42')]=qs[_0xa1d3('0x43')](_0x23f246[_0xa1d3('0x3b')][_0xa1d3('0x43')]);_0xbed451[_0xa1d3('0x44')]=qs['filters'](_[_0xa1d3('0x45')](_0x23f246[_0xa1d3('0x3b')],_0x39dd40[_0xa1d3('0x3c')]));if(_0x23f246[_0xa1d3('0x3b')][_0xa1d3('0x48')]){_0xbed451[_0xa1d3('0x44')]=_[_0xa1d3('0x46')](_0xbed451[_0xa1d3('0x44')],{'$or':_[_0xa1d3('0x39')](_0xbed451[_0xa1d3('0x3e')],function(_0x34974e){var _0x3adae0={};_0x3adae0[_0x34974e]={'$like':'%'+_0x23f246['query'][_0xa1d3('0x48')]+'%'};return _0x3adae0;})});}_0xbed451=_[_0xa1d3('0x46')]({},_0xbed451,_0x23f246[_0xa1d3('0x51')]);return _0x1cb252[_0xa1d3('0x54')](_0xbed451);}})['then'](function(_0x323d3d){if(_0x323d3d){_0x26c7d6=_0x323d3d['length'];if(!_0x23f246['query'][_0xa1d3('0x57')](_0xa1d3('0x41'))){_0xbed451[_0xa1d3('0x2b')]=qs[_0xa1d3('0x2b')](_0x23f246['query'][_0xa1d3('0x2b')]);_0xbed451[_0xa1d3('0x2a')]=qs[_0xa1d3('0x2a')](_0x23f246['query'][_0xa1d3('0x2a')]);}return _0x1cb252[_0xa1d3('0x54')](_0xbed451);}})[_0xa1d3('0x1b')](function(_0x2cb63a){if(_0x2cb63a){return _0x2cb63a?{'count':_0x26c7d6,'rows':_0x2cb63a}:null;}})[_0xa1d3('0x1b')](respondWithResult(_0x20759a,null))[_0xa1d3('0x4d')](handleError(_0x20759a,null));};exports['addConfiguration']=function(_0x24b1da,_0x122385,_0x176fc7){if(_0x24b1da[_0xa1d3('0x58')]['id']){delete _0x24b1da[_0xa1d3('0x58')]['id'];}return db['Dynamics365Account']['findOne']({'where':{'id':_0x24b1da['params']['id']}})[_0xa1d3('0x1b')](handleEntityNotFound(_0x122385,null))[_0xa1d3('0x1b')](function(_0x6957ea){if(_0x6957ea){_0x24b1da[_0xa1d3('0x58')][_0xa1d3('0x59')]=_0x6957ea['id'];_0x24b1da[_0xa1d3('0x58')][_0xa1d3('0x5a')]=integrations[_0xa1d3('0x5b')](_0x24b1da[_0xa1d3('0x58')][_0xa1d3('0x5c')],_0x24b1da[_0xa1d3('0x58')][_0xa1d3('0x36')]);_0x24b1da[_0xa1d3('0x58')][_0xa1d3('0x5d')]=integrations['getDescriptions'](_0x24b1da[_0xa1d3('0x58')][_0xa1d3('0x5c')],_0x24b1da['body'][_0xa1d3('0x36')]);return db[_0xa1d3('0x56')][_0xa1d3('0x53')](_0x24b1da[_0xa1d3('0x58')],{'include':[{'model':db[_0xa1d3('0x5e')],'as':_0xa1d3('0x5a')},{'model':db[_0xa1d3('0x5e')],'as':_0xa1d3('0x5d')}]});}return null;})['then'](respondWithResult(_0x122385,null))['catch'](handleError(_0x122385,null));};exports[_0xa1d3('0x5f')]=function(_0x123bb5,_0x157904,_0x3c35e5){var _0x20de9b=_0x123bb5[_0xa1d3('0x3b')][_0xa1d3('0x60')];var _0x559f63=_0x20de9b==='incident'?_0xa1d3('0x61'):_0xa1d3('0x62');var _0x49c59d='';var _0x66d612='';var _0x459480='';var _0x1c3114='';var _0x46b680='';var _0x4c1bc4='';var _0x276545='';var _0x243ae6='';var _0x399209=['title',_0xa1d3('0x63'),_0xa1d3('0x64'),'ownerid','caseorigincode',_0xa1d3('0x65'),'phonenumber','regardingobjectid',_0xa1d3('0x66'),_0xa1d3('0x67')];var _0x4bc460=['accountidname',_0xa1d3('0x68'),_0xa1d3('0x69'),_0xa1d3('0x6a'),_0xa1d3('0x6b'),_0xa1d3('0x6c'),_0xa1d3('0x6d'),'contractidname',_0xa1d3('0x6e'),_0xa1d3('0x6f'),'createdbyname',_0xa1d3('0x70'),_0xa1d3('0x71'),_0xa1d3('0x72'),'createdonbehalfbyyominame',_0xa1d3('0x73'),_0xa1d3('0x74'),_0xa1d3('0x75'),'emailaddress',_0xa1d3('0x76'),_0xa1d3('0x77'),'entityimage_url',_0xa1d3('0x78'),'exchangerate',_0xa1d3('0x79'),_0xa1d3('0x7a'),_0xa1d3('0x7b'),_0xa1d3('0x7c'),_0xa1d3('0x7d'),_0xa1d3('0x7e'),_0xa1d3('0x7f'),_0xa1d3('0x80'),_0xa1d3('0x81'),'modifiedbyname',_0xa1d3('0x82'),_0xa1d3('0x83'),_0xa1d3('0x84'),'modifiedonbehalfbyyominame',_0xa1d3('0x85'),_0xa1d3('0x86'),_0xa1d3('0x87'),_0xa1d3('0x88'),_0xa1d3('0x89'),'owneridname',_0xa1d3('0x8a'),_0xa1d3('0x8b'),_0xa1d3('0x8c'),_0xa1d3('0x8d'),_0xa1d3('0x8e'),_0xa1d3('0x8f'),_0xa1d3('0x90'),_0xa1d3('0x91'),_0xa1d3('0x92'),_0xa1d3('0x93'),_0xa1d3('0x94'),'responsiblecontactidname',_0xa1d3('0x95'),_0xa1d3('0x96'),'slainvokedidname',_0xa1d3('0x97'),_0xa1d3('0x98'),_0xa1d3('0x99'),_0xa1d3('0x9a'),_0xa1d3('0x9b'),_0xa1d3('0x9c'),_0xa1d3('0x9d'),'transactioncurrencyidname',_0xa1d3('0x9e'),_0xa1d3('0x9f'),_0xa1d3('0xa0')];var _0x596905=_0x399209[_0xa1d3('0xa1')](_0x4bc460);return db[_0xa1d3('0x49')][_0xa1d3('0x55')]({'where':{'id':_0x123bb5[_0xa1d3('0x4f')]['id']},'attributes':['id',_0xa1d3('0xa2'),_0xa1d3('0xa3'),_0xa1d3('0xa4'),_0xa1d3('0xa5'),_0xa1d3('0xa6'),'clientSecret']})['then'](handleEntityNotFound(_0x157904,null))[_0xa1d3('0x1b')](function(_0x1fd7c4){if(_0x1fd7c4){_0x243ae6=_0x1fd7c4[_0xa1d3('0xa4')];var _0x421b98=_0x243ae6[_0xa1d3('0xa7')](-0x1);if(_0x421b98==='/'){_0x243ae6=_0x243ae6[_0xa1d3('0xa8')](0x0,_0x243ae6[_0xa1d3('0xa9')](_0x421b98));}_0x276545=util[_0xa1d3('0xaa')](_0xa1d3('0xab'),_0x243ae6);var _0x3e8175={'method':_0xa1d3('0xac'),'uri':_0xa1d3('0xad')+_0x1fd7c4[_0xa1d3('0xa5')]+_0xa1d3('0xae'),'form':{'client_id':_0x1fd7c4[_0xa1d3('0xa6')],'resource':_0x243ae6,'username':_0x1fd7c4['username'],'password':_0x1fd7c4[_0xa1d3('0xa3')],'grant_type':_0xa1d3('0xa3'),'client_secret':_0x1fd7c4[_0xa1d3('0xaf')]},'json':!![]};return rp(_0x3e8175);}})['then'](function(_0x22e785){_0x4c1bc4=_0x22e785[_0xa1d3('0xb0')];var _0x1d493a={'method':_0xa1d3('0xb1'),'uri':encodeURI(_0x276545+'EntityDefinitions?$select=DisplayName,EntitySetName&$filter=SchemaName\x20eq\x20\x27'+_0x559f63+'\x27'),'headers':{'Authorization':_0xa1d3('0xb2')+_0x4c1bc4,'If-None-Match':null,'OData-Version':_0xa1d3('0xb3')},'json':!![]};return rp(_0x1d493a);})['then'](function(_0x3af265){var _0x370f76=_0x3af265[_0xa1d3('0xb4')][0x0];var _0x3757b7=_0x370f76[_0xa1d3('0xb5')];var _0x180750={'method':_0xa1d3('0xb1'),'uri':_0x276545+'EntityDefinitions('+_0x3757b7+_0xa1d3('0xb6'),'headers':{'Authorization':_0xa1d3('0xb2')+_0x4c1bc4,'If-None-Match':null,'OData-Version':'4.0'},'json':!![]};return rp(_0x180750);})[_0xa1d3('0x1b')](function(_0x1e050a){_0x49c59d=_0x1e050a;_0x66d612=_0x49c59d[_0xa1d3('0xb7')];_0x66d612=_[_0xa1d3('0xb8')](_0x66d612,function(_0x4a5765){return!_0x596905[_0xa1d3('0xb9')](_0x4a5765['LogicalName']);});var _0x370251=[];var _0x486c22=[];_0x66d612[_0xa1d3('0xba')](function(_0x3a40c6){if(_0x3a40c6[_0xa1d3('0xbb')]){var _0x3c330a=_0x3a40c6[_0xa1d3('0xbb')][_0xa1d3('0xa8')](_0x3a40c6[_0xa1d3('0xbb')]['lastIndexOf']('.')+0x1);if(_0x3c330a===_0xa1d3('0xbc')){_0x370251[_0xa1d3('0xbd')](getSelectList(_0x276545,_0x20de9b,_0x486c22,_0x49c59d[_0xa1d3('0xb5')],_0x3a40c6['MetadataId'],_0x4c1bc4));}}});return Promise[_0xa1d3('0xbe')](_0x370251);})[_0xa1d3('0x1b')](function(_0x193564){_0x459480=_0x193564[0x0];var _0x3ea2b7=[];var _0x5acfa3=[];_0x66d612[_0xa1d3('0xba')](function(_0x1597a7){if(!_['isNil'](_0x1597a7[_0xa1d3('0xbb')])){var _0x212009=_0x1597a7['@odata.type']['substring'](_0x1597a7[_0xa1d3('0xbb')][_0xa1d3('0xa9')]('.')+0x1);if(_0x212009===_0xa1d3('0xbf')){_0x3ea2b7[_0xa1d3('0xbd')](getBooleanList(_0x276545,_0x20de9b,_0x5acfa3,_0x49c59d[_0xa1d3('0xb5')],_0x1597a7['MetadataId'],_0x4c1bc4));}}});return Promise[_0xa1d3('0xbe')](_0x3ea2b7);})['then'](function(_0x183b6d){_0x1c3114=_0x183b6d[0x0];var _0x31a2a3=[];var _0x5ac43a=[];_0x66d612[_0xa1d3('0xba')](function(_0x1ed45d){if(_0x1ed45d[_0xa1d3('0xbb')]){var _0x50eaa8=_0x1ed45d[_0xa1d3('0xbb')][_0xa1d3('0xa8')](_0x1ed45d[_0xa1d3('0xbb')][_0xa1d3('0xa9')]('.')+0x1);if(_0x50eaa8===_0xa1d3('0xc0')||_0x50eaa8===_0xa1d3('0xc1')||_0x50eaa8==='BigIntAttributeMetadata'||_0x50eaa8===_0xa1d3('0xc2')||_0x50eaa8==='MemoAttributeMetadata'||_0x50eaa8===_0xa1d3('0xc3')||_0x50eaa8===_0xa1d3('0xc4')||_0x50eaa8===_0xa1d3('0xc5')||_0x50eaa8===_0xa1d3('0xc6')||_0x50eaa8===_0xa1d3('0xc7')){_0x31a2a3['push'](getInputList(_0x276545,_0x20de9b,_0x50eaa8,_0x5ac43a,_0x49c59d[_0xa1d3('0xb5')],_0x1ed45d[_0xa1d3('0xb5')],_0x4c1bc4));}}});return Promise[_0xa1d3('0xbe')](_0x31a2a3);})['then'](function(_0x50cdbf){_0x46b680=_0x50cdbf[0x0];var _0x516769=_0x459480[_0xa1d3('0xa1')](_0x1c3114)[_0xa1d3('0xa1')](_0x46b680);var _0xc8cbfd={'count':_0x516769[_0xa1d3('0x40')],'rows':_0x516769};return _0xc8cbfd;})[_0xa1d3('0x1b')](respondWithResult(_0x157904,null))[_0xa1d3('0x4d')](function(_0x5e354c){var _0x2c378f=_0x123bb5['query'][_0xa1d3('0x19')]?0x1f4:_0x5e354c['statusCode']||0x1f4;logger[_0xa1d3('0x21')](_0x5e354c[_0xa1d3('0x31')]);delete _0x5e354c[_0xa1d3('0x32')];if(_0x2c378f===0x191){_0x2c378f=0x190;}_0x157904['status'](_0x2c378f)[_0xa1d3('0x33')](_0x123bb5[_0xa1d3('0x3b')][_0xa1d3('0x19')]?{'message':_0xa1d3('0xc8'),'statusCode':_0x5e354c['statusCode']}:_0x5e354c);});};function getSelectList(_0x19199f,_0x3c7ac3,_0x2b3468,_0xfbd6cb,_0x2a62a1,_0x530dc4){var _0x15e522={'method':'GET','uri':_0x19199f+_0xa1d3('0xc9')+_0xfbd6cb+')/Attributes('+_0x2a62a1+_0xa1d3('0xca')+_0xa1d3('0xcb'),'headers':{'Authorization':_0xa1d3('0xb2')+_0x530dc4,'If-None-Match':null,'OData-Version':_0xa1d3('0xb3')},'json':!![]};return rp(_0x15e522)['then'](function(_0x416b6e){var _0x123e7e=[];var _0x4e2d79=_0x416b6e['OptionSet'][_0xa1d3('0xcc')];_0x4e2d79[_0xa1d3('0xba')](function(_0x152598){_0x123e7e['push']({'name':_0x152598[_0xa1d3('0xcd')][_0xa1d3('0xce')][_0xa1d3('0xcd')],'value':String(_0x152598[_0xa1d3('0xcf')])});});var _0x4beef1={'id':_0x3c7ac3+'_'+_0x416b6e[_0xa1d3('0xd0')],'name':_0x416b6e[_0xa1d3('0xd1')][_0xa1d3('0xce')][_0xa1d3('0xcd')],'custom':![],'options':_0x123e7e};_0x2b3468['push'](_0x4beef1);return _0x2b3468;});}function getBooleanList(_0x492a17,_0x4a6813,_0x53e751,_0x3a79a8,_0x59eb06,_0x3f92b0){var _0x4f2550={'method':_0xa1d3('0xb1'),'uri':_0x492a17+'EntityDefinitions('+_0x3a79a8+_0xa1d3('0xd2')+_0x59eb06+')/Microsoft.Dynamics.CRM.BooleanAttributeMetadata?$select=DisplayName,LogicalName&$expand=OptionSet($select=FalseOption,\x20TrueOption)','headers':{'Authorization':'Bearer\x20'+_0x3f92b0,'If-None-Match':null,'OData-Version':_0xa1d3('0xb3')},'json':!![]};return rp(_0x4f2550)[_0xa1d3('0x1b')](function(_0x224d95){var _0xe7f907=[];_0xe7f907[_0xa1d3('0xbd')]({'name':_0x224d95[_0xa1d3('0xd3')]['TrueOption']['Label'][_0xa1d3('0xce')][_0xa1d3('0xcd')],'value':'true'},{'name':_0x224d95[_0xa1d3('0xd3')][_0xa1d3('0xd4')]['Label'][_0xa1d3('0xce')][_0xa1d3('0xcd')],'value':_0xa1d3('0xd5')});var _0x29edcd={'id':_0x4a6813+'_'+_0x224d95['LogicalName'],'name':_0x224d95[_0xa1d3('0xd1')]['UserLocalizedLabel'][_0xa1d3('0xcd')],'custom':![],'options':_0xe7f907};_0x53e751[_0xa1d3('0xbd')](_0x29edcd);return _0x53e751;});}function getInputList(_0x7ab501,_0x5cfbfe,_0x53b76f,_0x478497,_0x5d07ab,_0x262a61,_0x58a21a){var _0x154d90={'method':_0xa1d3('0xb1'),'uri':_0x7ab501+_0xa1d3('0xc9')+_0x5d07ab+_0xa1d3('0xd2')+_0x262a61+_0xa1d3('0xd6')+_0x53b76f+_0xa1d3('0xd7'),'headers':{'Authorization':_0xa1d3('0xb2')+_0x58a21a,'If-None-Match':null,'OData-Version':_0xa1d3('0xb3')},'json':!![]};return rp(_0x154d90)[_0xa1d3('0x1b')](function(_0x4c020c){var _0xa778c3={'id':_0x5cfbfe+'_'+_0x4c020c[_0xa1d3('0xd0')],'name':_0x4c020c[_0xa1d3('0xd1')]['UserLocalizedLabel']?_0x4c020c[_0xa1d3('0xd1')]['UserLocalizedLabel'][_0xa1d3('0xcd')]:_0x4c020c[_0xa1d3('0xd0')],'custom':![],'options':[]};_0x478497['push'](_0xa778c3);return _0x478497;});}
\ No newline at end of file
+var _0x8107=['Label','UserLocalizedLabel','Value','LogicalName','OptionSet','FalseOption','false','DisplayName','?$select=DisplayName,LogicalName','html-pdf','eml-format','zip-dir','fast-json-patch','request-promise','moment','bluebird','mustache','util','sox','to-csv','ejs','lodash','squel','crypto','desk.js','querystring','ioredis','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/environment','../../mysqldb','../../components/integrations/configuration','jayson/promise','client','Sequelize','ValidationError','The\x20password\x20must\x20be\x20at\x20least\x208\x20characters\x20long\x20and\x20have\x201\x20lowercase\x20character,\x201\x20uppercase\x20character,\x201\x20number\x20and\x201\x20special\x20character\x20~!@#$%^&-_=+[{]}.','request','then','Dynamics365Account,\x20%s,\x20%s','request\x20sent','Dynamics365Account,\x20%s,\x20%s,\x20%s','stringify','error','code','message','result','catch','sendStatus','end','json','offset','limit','status','set','Content-Range','reject','save','update','destroy','stack','name','send','map','Dynamics365Account','fieldName','key','keys','filters','intersection','model','query','fields','attributes','length','hasOwnProperty','nolimit','order','sort','pick','filter','where','type','VIRTUAL','count','include','findAll','rows','show','rawAttributes','includeAll','create','body','params','find','getConfigurations','findOne','merge','options','addConfiguration','getSubjects','channel','Descriptions','Dynamics365Configuration','Dynamics365Field','getFields','ticketType','incident','Incident','title','description','customerid','ownerid','caseorigincode','phonenumber','regardingobjectid','directioncode','phonecall_activity_parties','accountidname','accountidyominame','actualserviceunits','billedserviceunits','contactidname','contactidyominame','contractidname','createdbyexternalpartyname','createdbyexternalpartyyominame','createdbyyominame','createdonbehalfbyyominame','customeridname','customeridtype','customeridyominame','emailaddress','entitlementidname','entityimage_timestamp','exchangerate','firstresponsebykpiidname','followupby','importsequencenumber','influencescore','kbarticleidname','lastonholdtime','modifiedbyexternalpartyname','modifiedbyname','modifiedbyyominame','modifiedon','modifiedonbehalfbyname','modifiedonbehalfbyyominame','msdyn_incidenttypename','msdyn_iotalertname','onholdtime','overriddencreatedon','owneridname','owneridtype','primarycontactidname','prioritycodename','productserialnumber','resolveby','resolvebykpiidname','responsiblecontactidname','responsiblecontactidyominame','sentimentvalue','slainvokedidname','slaname','socialprofileidname','statecode','statuscode','ticketnumber','timezoneruleversionnumber','utcconversiontimezonecode','versionnumber','concat','username','tenantId','clientId','remoteUri','slice','lastIndexOf','format','POST','https://login.microsoftonline.com/','/oauth2/token','password','clientSecret','EntityDefinitions?$select=DisplayName,EntitySetName&$filter=SchemaName\x20eq\x20\x27','Bearer\x20','4.0','MetadataId','GET','EntityDefinitions(',')?$select=LogicalName&$expand=Attributes($select=LogicalName)','Attributes','remove','includes','forEach','@odata.type','substring','PicklistAttributeMetadata','all','isNil','IntegerAttributeMetadata','MemoAttributeMetadata','DateTimeAttributeMetadata','StatusAttributeMetadata','EntityNameAttributeMetadata','StateAttributeMetadata','DecimalAttributeMetadata','push','test','statusCode','Wrong\x20credentials',')/Attributes(',')/Microsoft.Dynamics.CRM.PicklistAttributeMetadata?','Options'];(function(_0x49fb35,_0x121edc){var _0xd05ed7=function(_0x593b7d){while(--_0x593b7d){_0x49fb35['push'](_0x49fb35['shift']());}};_0xd05ed7(++_0x121edc);}(_0x8107,0x1bd));var _0x7810=function(_0x592a9d,_0x434abb){_0x592a9d=_0x592a9d-0x0;var _0x59d2b3=_0x8107[_0x592a9d];return _0x59d2b3;};'use strict';var pdf=require(_0x7810('0x0'));var emlformat=require(_0x7810('0x1'));var rimraf=require('rimraf');var zipdir=require(_0x7810('0x2'));var jsonpatch=require(_0x7810('0x3'));var rp=require(_0x7810('0x4'));var moment=require(_0x7810('0x5'));var BPromise=require(_0x7810('0x6'));var Mustache=require(_0x7810('0x7'));var util=require(_0x7810('0x8'));var path=require('path');var sox=require(_0x7810('0x9'));var csv=require(_0x7810('0xa'));var ejs=require(_0x7810('0xb'));var fs=require('fs');var _=require(_0x7810('0xc'));var squel=require(_0x7810('0xd'));var crypto=require(_0x7810('0xe'));var jsforce=require('jsforce');var deskjs=require(_0x7810('0xf'));var toCsv=require(_0x7810('0xa'));var querystring=require(_0x7810('0x10'));var Papa=require('papaparse');var Redis=require(_0x7810('0x11'));var authService=require('../../components/auth/service');var qs=require(_0x7810('0x12'));var as=require(_0x7810('0x13'));var hardwareService=require(_0x7810('0x14'));var logger=require(_0x7810('0x15'))(_0x7810('0x16'));var utils=require(_0x7810('0x17'));var config=require(_0x7810('0x18'));var db=require(_0x7810('0x19'))['db'];var integrations=require(_0x7810('0x1a'));var jayson=require(_0x7810('0x1b'));var client=jayson[_0x7810('0x1c')]['http']({'port':0x232a});function checkPasswordPattern(_0x192a6d,_0x2f8b7b,_0x1405b9){if(_0x1405b9){var _0x474708=new RegExp(/(?=.*[a-z])(?=.*[A-Z])(?=.*[0-9])(?=.*[?!@#\$%\^&\*~\-_=+[{\]\}])(?=.{8,})/);if(_0x474708['test'](_0x2f8b7b)){return _0x192a6d;}else{throw new db[(_0x7810('0x1d'))][(_0x7810('0x1e'))](_0x7810('0x1f'));}}else{return _0x192a6d;}}function respondWithRpcPromise(_0x531e31,_0x2d64a4,_0x828bb5,_0x309493){return new BPromise(function(_0x93e73f,_0x111132){var _0x1c9813=_0x309493||client;return _0x1c9813[_0x7810('0x20')](_0x531e31,_0x828bb5)[_0x7810('0x21')](function(_0x33f1e1){logger['info'](_0x7810('0x22'),_0x2d64a4,_0x7810('0x23'));logger['debug'](_0x7810('0x24'),_0x2d64a4,_0x7810('0x23'),JSON[_0x7810('0x25')](_0x33f1e1));if(_0x33f1e1['error']){if(_0x33f1e1[_0x7810('0x26')][_0x7810('0x27')]===0x1f4){logger[_0x7810('0x26')]('Dynamics365Account,\x20%s,\x20%s',_0x2d64a4,_0x33f1e1[_0x7810('0x26')]['message']);return _0x111132(_0x33f1e1[_0x7810('0x26')][_0x7810('0x28')]);}logger[_0x7810('0x26')]('Dynamics365Account,\x20%s,\x20%s',_0x2d64a4,_0x33f1e1[_0x7810('0x26')][_0x7810('0x28')]);return _0x93e73f(_0x33f1e1[_0x7810('0x26')][_0x7810('0x28')]);}else{logger['info'](_0x7810('0x22'),_0x2d64a4,_0x7810('0x23'));_0x93e73f(_0x33f1e1[_0x7810('0x29')][_0x7810('0x28')]);}})[_0x7810('0x2a')](function(_0x56eaf7){logger[_0x7810('0x26')](_0x7810('0x22'),_0x2d64a4,_0x56eaf7);_0x111132(_0x56eaf7);});});}function respondWithStatusCode(_0x552325,_0x21a563){_0x21a563=_0x21a563||0xcc;return function(_0x363b66){if(_0x363b66){return _0x552325[_0x7810('0x2b')](_0x21a563);}return _0x552325['status'](_0x21a563)[_0x7810('0x2c')]();};}function respondWithResult(_0x459709,_0x2cf8f6){_0x2cf8f6=_0x2cf8f6||0xc8;return function(_0x1a0324){if(_0x1a0324){return _0x459709['status'](_0x2cf8f6)[_0x7810('0x2d')](_0x1a0324);}};}function respondWithFilteredResult(_0x57aa10,_0x555b44){return function(_0x5165aa){if(_0x5165aa){var _0x49897f=_0x5165aa['count'],_0x15d473=_0x555b44[_0x7810('0x2e')],_0x1362d8=_0x555b44[_0x7810('0x2e')]+_0x555b44[_0x7810('0x2f')],_0x2878dc;if(_0x1362d8>=_0x49897f){_0x1362d8=_0x49897f;_0x2878dc=0xc8;}else{_0x2878dc=0xce;}_0x57aa10[_0x7810('0x30')](_0x2878dc);return _0x57aa10[_0x7810('0x31')](_0x7810('0x32'),_0x15d473+'-'+_0x1362d8+'/'+_0x49897f)[_0x7810('0x2d')](_0x5165aa);}return null;};}function patchUpdates(_0x3faa59){return function(_0x3a785c){try{jsonpatch['apply'](_0x3a785c,_0x3faa59,!![]);}catch(_0x348971){return BPromise[_0x7810('0x33')](_0x348971);}return _0x3a785c[_0x7810('0x34')]();};}function saveUpdates(_0x5d7ca7,_0xc6680e){return function(_0x491bda){if(_0x491bda){return _0x491bda[_0x7810('0x35')](_0x5d7ca7)[_0x7810('0x21')](function(_0x36923c){return _0x36923c;});}return null;};}function removeEntity(_0xe9a51e,_0x384e16){return function(_0x47ff5e){if(_0x47ff5e){return _0x47ff5e[_0x7810('0x36')]()[_0x7810('0x21')](function(){_0xe9a51e[_0x7810('0x30')](0xcc)[_0x7810('0x2c')]();});}};}function handleEntityNotFound(_0x69b430,_0xe3434c){return function(_0x3fea25){if(!_0x3fea25){_0x69b430['sendStatus'](0x194);}return _0x3fea25;};}function handleError(_0x4850af,_0x404df0){_0x404df0=_0x404df0||0x1f4;return function(_0xc2112e){logger['error'](_0xc2112e[_0x7810('0x37')]);if(_0xc2112e[_0x7810('0x38')]){delete _0xc2112e[_0x7810('0x38')];}_0x4850af[_0x7810('0x30')](_0x404df0)[_0x7810('0x39')](_0xc2112e);};}exports['index']=function(_0x2b9f80,_0x24d01a){var _0x2c9977={},_0x319f5e={},_0x95433c={'count':0x0,'rows':[]};var _0x5d81d5=_[_0x7810('0x3a')](db[_0x7810('0x3b')]['rawAttributes'],function(_0x8705d4){return{'name':_0x8705d4[_0x7810('0x3c')],'type':_0x8705d4['type'][_0x7810('0x3d')]};});_0x319f5e['model']=_[_0x7810('0x3a')](_0x5d81d5,_0x7810('0x38'));_0x319f5e['query']=_[_0x7810('0x3e')](_0x2b9f80['query']);_0x319f5e[_0x7810('0x3f')]=_[_0x7810('0x40')](_0x319f5e[_0x7810('0x41')],_0x319f5e[_0x7810('0x42')]);_0x2c9977['attributes']=_[_0x7810('0x40')](_0x319f5e[_0x7810('0x41')],qs[_0x7810('0x43')](_0x2b9f80[_0x7810('0x42')][_0x7810('0x43')]));_0x2c9977[_0x7810('0x44')]=_0x2c9977[_0x7810('0x44')][_0x7810('0x45')]?_0x2c9977['attributes']:_0x319f5e[_0x7810('0x41')];if(!_0x2b9f80[_0x7810('0x42')][_0x7810('0x46')](_0x7810('0x47'))){_0x2c9977[_0x7810('0x2f')]=qs['limit'](_0x2b9f80[_0x7810('0x42')][_0x7810('0x2f')]);_0x2c9977[_0x7810('0x2e')]=qs[_0x7810('0x2e')](_0x2b9f80[_0x7810('0x42')][_0x7810('0x2e')]);}_0x2c9977[_0x7810('0x48')]=qs[_0x7810('0x49')](_0x2b9f80[_0x7810('0x42')][_0x7810('0x49')]);_0x2c9977['where']=qs[_0x7810('0x3f')](_[_0x7810('0x4a')](_0x2b9f80[_0x7810('0x42')],_0x319f5e[_0x7810('0x3f')]));if(_0x2b9f80[_0x7810('0x42')][_0x7810('0x4b')]){_0x2c9977[_0x7810('0x4c')]=_['merge'](_0x2c9977[_0x7810('0x4c')],{'$or':_[_0x7810('0x3a')](_0x5d81d5,function(_0x5c4669){if(_0x5c4669[_0x7810('0x4d')]!==_0x7810('0x4e')){var _0x75a0d6={};_0x75a0d6[_0x5c4669[_0x7810('0x38')]]={'$like':'%'+_0x2b9f80[_0x7810('0x42')][_0x7810('0x4b')]+'%'};return _0x75a0d6;}})});}_0x2c9977=_['merge']({},_0x2c9977,_0x2b9f80['options']);var _0x164e8b={'where':_0x2c9977[_0x7810('0x4c')]};return db[_0x7810('0x3b')][_0x7810('0x4f')](_0x164e8b)[_0x7810('0x21')](function(_0x318536){_0x95433c[_0x7810('0x4f')]=_0x318536;if(_0x2b9f80[_0x7810('0x42')]['includeAll']){_0x2c9977[_0x7810('0x50')]=[{'all':!![]}];}return db[_0x7810('0x3b')][_0x7810('0x51')](_0x2c9977);})[_0x7810('0x21')](function(_0x1528c3){_0x95433c[_0x7810('0x52')]=_0x1528c3;return _0x95433c;})[_0x7810('0x21')](respondWithFilteredResult(_0x24d01a,_0x2c9977))[_0x7810('0x2a')](handleError(_0x24d01a,null));};exports[_0x7810('0x53')]=function(_0x55406d,_0x36ecbf){var _0x495fdb={'raw':![],'where':{'id':_0x55406d['params']['id']}},_0x33d731={};_0x33d731['model']=_[_0x7810('0x3e')](db['Dynamics365Account'][_0x7810('0x54')]);_0x33d731[_0x7810('0x42')]=_['keys'](_0x55406d[_0x7810('0x42')]);_0x33d731['filters']=_[_0x7810('0x40')](_0x33d731[_0x7810('0x41')],_0x33d731[_0x7810('0x42')]);_0x495fdb[_0x7810('0x44')]=_[_0x7810('0x40')](_0x33d731[_0x7810('0x41')],qs[_0x7810('0x43')](_0x55406d[_0x7810('0x42')][_0x7810('0x43')]));_0x495fdb[_0x7810('0x44')]=_0x495fdb[_0x7810('0x44')][_0x7810('0x45')]?_0x495fdb[_0x7810('0x44')]:_0x33d731[_0x7810('0x41')];if(_0x55406d['query'][_0x7810('0x55')]){_0x495fdb[_0x7810('0x50')]=[{'all':!![]}];}_0x495fdb=_['merge']({},_0x495fdb,_0x55406d['options']);return db[_0x7810('0x3b')]['find'](_0x495fdb)['then'](handleEntityNotFound(_0x36ecbf,null))['then'](respondWithResult(_0x36ecbf,null))[_0x7810('0x2a')](handleError(_0x36ecbf,null));};exports[_0x7810('0x56')]=function(_0x281a0a,_0x31fe31){return db[_0x7810('0x3b')][_0x7810('0x56')](_0x281a0a[_0x7810('0x57')],{})[_0x7810('0x21')](respondWithResult(_0x31fe31,0xc9))[_0x7810('0x2a')](handleError(_0x31fe31,null));};exports[_0x7810('0x35')]=function(_0x1d16cb,_0x335e16){if(_0x1d16cb[_0x7810('0x57')]['id']){delete _0x1d16cb[_0x7810('0x57')]['id'];}return db['Dynamics365Account']['find']({'where':{'id':_0x1d16cb[_0x7810('0x58')]['id']}})[_0x7810('0x21')](handleEntityNotFound(_0x335e16,null))[_0x7810('0x21')](saveUpdates(_0x1d16cb['body'],null))['then'](respondWithResult(_0x335e16,null))[_0x7810('0x2a')](handleError(_0x335e16,null));};exports[_0x7810('0x36')]=function(_0x4315bf,_0xe5708){return db[_0x7810('0x3b')][_0x7810('0x59')]({'where':{'id':_0x4315bf[_0x7810('0x58')]['id']}})[_0x7810('0x21')](handleEntityNotFound(_0xe5708,null))['then'](removeEntity(_0xe5708,null))[_0x7810('0x2a')](handleError(_0xe5708,null));};exports[_0x7810('0x5a')]=function(_0x441e61,_0x9adf03,_0xeb40fe){var _0x7e5dae={};var _0x4463d3={};var _0x335d72;var _0x27daec;return db[_0x7810('0x3b')][_0x7810('0x5b')]({'where':{'id':_0x441e61['params']['id']}})[_0x7810('0x21')](handleEntityNotFound(_0x9adf03,null))[_0x7810('0x21')](function(_0x5a70bb){if(_0x5a70bb){_0x335d72=_0x5a70bb;_0x4463d3[_0x7810('0x41')]=_[_0x7810('0x3e')](db['Dynamics365Configuration'][_0x7810('0x54')]);_0x4463d3[_0x7810('0x42')]=_[_0x7810('0x3e')](_0x441e61[_0x7810('0x42')]);_0x4463d3[_0x7810('0x3f')]=_['intersection'](_0x4463d3[_0x7810('0x41')],_0x4463d3[_0x7810('0x42')]);_0x7e5dae[_0x7810('0x44')]=_['intersection'](_0x4463d3['model'],qs['fields'](_0x441e61[_0x7810('0x42')][_0x7810('0x43')]));_0x7e5dae['attributes']=_0x7e5dae['attributes'][_0x7810('0x45')]?_0x7e5dae[_0x7810('0x44')]:_0x4463d3[_0x7810('0x41')];_0x7e5dae['order']=qs[_0x7810('0x49')](_0x441e61['query'][_0x7810('0x49')]);_0x7e5dae['where']=qs['filters'](_['pick'](_0x441e61['query'],_0x4463d3[_0x7810('0x3f')]));if(_0x441e61[_0x7810('0x42')][_0x7810('0x4b')]){_0x7e5dae['where']=_[_0x7810('0x5c')](_0x7e5dae['where'],{'$or':_[_0x7810('0x3a')](_0x7e5dae[_0x7810('0x44')],function(_0x408818){var _0x4d1448={};_0x4d1448[_0x408818]={'$like':'%'+_0x441e61[_0x7810('0x42')][_0x7810('0x4b')]+'%'};return _0x4d1448;})});}_0x7e5dae=_[_0x7810('0x5c')]({},_0x7e5dae,_0x441e61[_0x7810('0x5d')]);return _0x335d72[_0x7810('0x5a')](_0x7e5dae);}})['then'](function(_0x57c615){if(_0x57c615){_0x27daec=_0x57c615[_0x7810('0x45')];if(!_0x441e61[_0x7810('0x42')][_0x7810('0x46')](_0x7810('0x47'))){_0x7e5dae['limit']=qs[_0x7810('0x2f')](_0x441e61[_0x7810('0x42')][_0x7810('0x2f')]);_0x7e5dae[_0x7810('0x2e')]=qs[_0x7810('0x2e')](_0x441e61[_0x7810('0x42')][_0x7810('0x2e')]);}return _0x335d72[_0x7810('0x5a')](_0x7e5dae);}})[_0x7810('0x21')](function(_0x55b711){if(_0x55b711){return _0x55b711?{'count':_0x27daec,'rows':_0x55b711}:null;}})[_0x7810('0x21')](respondWithResult(_0x9adf03,null))[_0x7810('0x2a')](handleError(_0x9adf03,null));};exports[_0x7810('0x5e')]=function(_0x16885f,_0x27ebf7,_0x2fc414){if(_0x16885f[_0x7810('0x57')]['id']){delete _0x16885f[_0x7810('0x57')]['id'];}return db[_0x7810('0x3b')][_0x7810('0x5b')]({'where':{'id':_0x16885f[_0x7810('0x58')]['id']}})['then'](handleEntityNotFound(_0x27ebf7,null))[_0x7810('0x21')](function(_0x1282a6){if(_0x1282a6){_0x16885f[_0x7810('0x57')]['AccountId']=_0x1282a6['id'];_0x16885f[_0x7810('0x57')]['Subjects']=integrations[_0x7810('0x5f')](_0x16885f[_0x7810('0x57')][_0x7810('0x60')],_0x16885f[_0x7810('0x57')][_0x7810('0x4d')]);_0x16885f['body'][_0x7810('0x61')]=integrations['getDescriptions'](_0x16885f[_0x7810('0x57')][_0x7810('0x60')],_0x16885f[_0x7810('0x57')][_0x7810('0x4d')]);return db[_0x7810('0x62')][_0x7810('0x56')](_0x16885f[_0x7810('0x57')],{'include':[{'model':db[_0x7810('0x63')],'as':'Subjects'},{'model':db[_0x7810('0x63')],'as':_0x7810('0x61')}]});}return null;})[_0x7810('0x21')](respondWithResult(_0x27ebf7,null))['catch'](handleError(_0x27ebf7,null));};exports[_0x7810('0x64')]=function(_0x9d05b7,_0x2ebad7,_0x21cac2){var _0x3df493=_0x9d05b7[_0x7810('0x42')][_0x7810('0x65')];var _0x5d56b7=_0x3df493===_0x7810('0x66')?_0x7810('0x67'):'PhoneCall';var _0x247025='';var _0x7ffed2='';var _0x39ab85='';var _0x299e95='';var _0x53289b='';var _0x5061f0='';var _0x33def1='';var _0x54d5c7='';var _0x554719=[_0x7810('0x68'),_0x7810('0x69'),_0x7810('0x6a'),_0x7810('0x6b'),_0x7810('0x6c'),'subject',_0x7810('0x6d'),_0x7810('0x6e'),_0x7810('0x6f'),_0x7810('0x70')];var _0x4f0f9f=[_0x7810('0x71'),_0x7810('0x72'),_0x7810('0x73'),_0x7810('0x74'),_0x7810('0x75'),_0x7810('0x76'),'contractdetailidname',_0x7810('0x77'),_0x7810('0x78'),_0x7810('0x79'),'createdbyname',_0x7810('0x7a'),'createdon','createdonbehalfbyname',_0x7810('0x7b'),_0x7810('0x7c'),_0x7810('0x7d'),_0x7810('0x7e'),_0x7810('0x7f'),_0x7810('0x80'),_0x7810('0x81'),'entityimage_url','escalatedon',_0x7810('0x82'),_0x7810('0x83'),_0x7810('0x84'),_0x7810('0x85'),_0x7810('0x86'),_0x7810('0x87'),_0x7810('0x88'),'masteridname',_0x7810('0x89'),'modifiedbyexternalpartyyominame',_0x7810('0x8a'),_0x7810('0x8b'),_0x7810('0x8c'),_0x7810('0x8d'),_0x7810('0x8e'),_0x7810('0x8f'),_0x7810('0x90'),'numberofchildincidents',_0x7810('0x91'),_0x7810('0x92'),_0x7810('0x93'),_0x7810('0x94'),'owneridyominame','parentcaseidname',_0x7810('0x95'),'primarycontactidyominame',_0x7810('0x96'),'productidname',_0x7810('0x97'),_0x7810('0x98'),_0x7810('0x99'),'responseby',_0x7810('0x9a'),_0x7810('0x9b'),_0x7810('0x9c'),_0x7810('0x9d'),_0x7810('0x9e'),_0x7810('0x9f'),_0x7810('0xa0'),_0x7810('0xa1'),'subjectidname',_0x7810('0xa2'),_0x7810('0xa3'),'transactioncurrencyidname','traversedpath',_0x7810('0xa4'),_0x7810('0xa5')];var _0x343899=_0x554719[_0x7810('0xa6')](_0x4f0f9f);return db[_0x7810('0x3b')][_0x7810('0x5b')]({'where':{'id':_0x9d05b7['params']['id']},'attributes':['id',_0x7810('0xa7'),'password','remoteUri',_0x7810('0xa8'),_0x7810('0xa9'),'clientSecret']})['then'](handleEntityNotFound(_0x2ebad7,null))[_0x7810('0x21')](function(_0x50a64a){if(_0x50a64a){_0x54d5c7=_0x50a64a[_0x7810('0xaa')];var _0x132251=_0x54d5c7[_0x7810('0xab')](-0x1);if(_0x132251==='/'){_0x54d5c7=_0x54d5c7['substring'](0x0,_0x54d5c7[_0x7810('0xac')](_0x132251));}_0x33def1=util[_0x7810('0xad')]('%s/api/data/v9.0/',_0x54d5c7);var _0x1789de={'method':_0x7810('0xae'),'uri':_0x7810('0xaf')+_0x50a64a[_0x7810('0xa8')]+_0x7810('0xb0'),'form':{'client_id':_0x50a64a[_0x7810('0xa9')],'resource':_0x54d5c7,'username':_0x50a64a[_0x7810('0xa7')],'password':_0x50a64a[_0x7810('0xb1')],'grant_type':_0x7810('0xb1'),'client_secret':_0x50a64a[_0x7810('0xb2')]},'json':!![]};return rp(_0x1789de);}})[_0x7810('0x21')](function(_0x590a38){_0x5061f0=_0x590a38['access_token'];var _0x4f42f4={'method':'GET','uri':encodeURI(_0x33def1+_0x7810('0xb3')+_0x5d56b7+'\x27'),'headers':{'Authorization':_0x7810('0xb4')+_0x5061f0,'If-None-Match':null,'OData-Version':_0x7810('0xb5')},'json':!![]};return rp(_0x4f42f4);})[_0x7810('0x21')](function(_0x4dbf89){var _0x236707=_0x4dbf89['value'][0x0];var _0x414002=_0x236707[_0x7810('0xb6')];var _0x3bf916={'method':_0x7810('0xb7'),'uri':_0x33def1+_0x7810('0xb8')+_0x414002+_0x7810('0xb9'),'headers':{'Authorization':_0x7810('0xb4')+_0x5061f0,'If-None-Match':null,'OData-Version':_0x7810('0xb5')},'json':!![]};return rp(_0x3bf916);})[_0x7810('0x21')](function(_0x16f622){_0x247025=_0x16f622;_0x7ffed2=_0x247025[_0x7810('0xba')];_0x7ffed2=_[_0x7810('0xbb')](_0x7ffed2,function(_0x57ba06){return!_0x343899[_0x7810('0xbc')](_0x57ba06['LogicalName']);});var _0x48319a=[];var _0x4a5b2d=[];_0x7ffed2[_0x7810('0xbd')](function(_0x12e16d){if(_0x12e16d[_0x7810('0xbe')]){var _0x1c6ef7=_0x12e16d[_0x7810('0xbe')][_0x7810('0xbf')](_0x12e16d[_0x7810('0xbe')][_0x7810('0xac')]('.')+0x1);if(_0x1c6ef7===_0x7810('0xc0')){_0x48319a['push'](getSelectList(_0x33def1,_0x3df493,_0x4a5b2d,_0x247025[_0x7810('0xb6')],_0x12e16d[_0x7810('0xb6')],_0x5061f0));}}});return Promise[_0x7810('0xc1')](_0x48319a);})[_0x7810('0x21')](function(_0x514155){_0x39ab85=_0x514155[0x0];var _0x467f84=[];var _0xaabd24=[];_0x7ffed2[_0x7810('0xbd')](function(_0x1c977a){if(!_[_0x7810('0xc2')](_0x1c977a[_0x7810('0xbe')])){var _0x2a424f=_0x1c977a[_0x7810('0xbe')][_0x7810('0xbf')](_0x1c977a['@odata.type'][_0x7810('0xac')]('.')+0x1);if(_0x2a424f==='BooleanAttributeMetadata'){_0x467f84['push'](getBooleanList(_0x33def1,_0x3df493,_0xaabd24,_0x247025[_0x7810('0xb6')],_0x1c977a[_0x7810('0xb6')],_0x5061f0));}}});return Promise[_0x7810('0xc1')](_0x467f84);})[_0x7810('0x21')](function(_0x16b5b0){_0x299e95=_0x16b5b0[0x0];var _0x56c33c=[];var _0x1891b9=[];_0x7ffed2[_0x7810('0xbd')](function(_0x235e97){if(_0x235e97[_0x7810('0xbe')]){var _0x5c063e=_0x235e97[_0x7810('0xbe')][_0x7810('0xbf')](_0x235e97[_0x7810('0xbe')]['lastIndexOf']('.')+0x1);if(_0x5c063e==='StringAttributeMetadata'||_0x5c063e==='DoubleAttributeMetadata'||_0x5c063e==='BigIntAttributeMetadata'||_0x5c063e===_0x7810('0xc3')||_0x5c063e===_0x7810('0xc4')||_0x5c063e===_0x7810('0xc5')||_0x5c063e===_0x7810('0xc6')||_0x5c063e===_0x7810('0xc7')||_0x5c063e===_0x7810('0xc8')||_0x5c063e===_0x7810('0xc9')){_0x56c33c[_0x7810('0xca')](getInputList(_0x33def1,_0x3df493,_0x5c063e,_0x1891b9,_0x247025[_0x7810('0xb6')],_0x235e97[_0x7810('0xb6')],_0x5061f0));}}});return Promise[_0x7810('0xc1')](_0x56c33c);})[_0x7810('0x21')](function(_0x5ca6c2){_0x53289b=_0x5ca6c2[0x0];var _0x392383=_0x39ab85[_0x7810('0xa6')](_0x299e95)[_0x7810('0xa6')](_0x53289b);var _0x10df2c={'count':_0x392383[_0x7810('0x45')],'rows':_0x392383};return _0x10df2c;})['then'](respondWithResult(_0x2ebad7,null))[_0x7810('0x2a')](function(_0x3e7430){var _0x3d9124=_0x9d05b7['query'][_0x7810('0xcb')]?0x1f4:_0x3e7430[_0x7810('0xcc')]||0x1f4;logger['error'](_0x3e7430[_0x7810('0x37')]);delete _0x3e7430['name'];if(_0x3d9124===0x191){_0x3d9124=0x190;}_0x2ebad7[_0x7810('0x30')](_0x3d9124)[_0x7810('0x39')](_0x9d05b7[_0x7810('0x42')][_0x7810('0xcb')]?{'message':_0x7810('0xcd'),'statusCode':_0x3e7430[_0x7810('0xcc')]}:_0x3e7430);});};function getSelectList(_0xcee4d1,_0x399faa,_0x173fd9,_0x2d4e33,_0x5356eb,_0x22371e){var _0x3e9fb5={'method':_0x7810('0xb7'),'uri':_0xcee4d1+_0x7810('0xb8')+_0x2d4e33+_0x7810('0xce')+_0x5356eb+_0x7810('0xcf')+'$select=DisplayName,LogicalName&$expand=OptionSet($select=Options)','headers':{'Authorization':'Bearer\x20'+_0x22371e,'If-None-Match':null,'OData-Version':'4.0'},'json':!![]};return rp(_0x3e9fb5)[_0x7810('0x21')](function(_0x32b6ce){var _0x3bfdb7=[];var _0x4c8871=_0x32b6ce['OptionSet'][_0x7810('0xd0')];_0x4c8871['forEach'](function(_0x9c1fbf){_0x3bfdb7['push']({'name':_0x9c1fbf[_0x7810('0xd1')][_0x7810('0xd2')]['Label'],'value':String(_0x9c1fbf[_0x7810('0xd3')])});});var _0x3f72b1={'id':_0x399faa+'_'+_0x32b6ce[_0x7810('0xd4')],'name':_0x32b6ce['DisplayName']['UserLocalizedLabel'][_0x7810('0xd1')],'custom':![],'options':_0x3bfdb7};_0x173fd9[_0x7810('0xca')](_0x3f72b1);return _0x173fd9;});}function getBooleanList(_0x49724e,_0x507cba,_0x3476bf,_0xe8dad2,_0x1f12b1,_0x20d4a5){var _0x2949d2={'method':'GET','uri':_0x49724e+_0x7810('0xb8')+_0xe8dad2+_0x7810('0xce')+_0x1f12b1+')/Microsoft.Dynamics.CRM.BooleanAttributeMetadata?$select=DisplayName,LogicalName&$expand=OptionSet($select=FalseOption,\x20TrueOption)','headers':{'Authorization':'Bearer\x20'+_0x20d4a5,'If-None-Match':null,'OData-Version':'4.0'},'json':!![]};return rp(_0x2949d2)[_0x7810('0x21')](function(_0x52ede8){var _0x5bc607=[];_0x5bc607['push']({'name':_0x52ede8[_0x7810('0xd5')]['TrueOption'][_0x7810('0xd1')][_0x7810('0xd2')][_0x7810('0xd1')],'value':'true'},{'name':_0x52ede8[_0x7810('0xd5')][_0x7810('0xd6')]['Label'][_0x7810('0xd2')][_0x7810('0xd1')],'value':_0x7810('0xd7')});var _0x4a3d2d={'id':_0x507cba+'_'+_0x52ede8['LogicalName'],'name':_0x52ede8[_0x7810('0xd8')][_0x7810('0xd2')][_0x7810('0xd1')],'custom':![],'options':_0x5bc607};_0x3476bf['push'](_0x4a3d2d);return _0x3476bf;});}function getInputList(_0x2a3801,_0x53a88c,_0x5e8adf,_0x2461d3,_0x36c01d,_0x35e878,_0x12da6d){var _0x4a0dfb={'method':_0x7810('0xb7'),'uri':_0x2a3801+_0x7810('0xb8')+_0x36c01d+')/Attributes('+_0x35e878+')/Microsoft.Dynamics.CRM.'+_0x5e8adf+_0x7810('0xd9'),'headers':{'Authorization':'Bearer\x20'+_0x12da6d,'If-None-Match':null,'OData-Version':_0x7810('0xb5')},'json':!![]};return rp(_0x4a0dfb)[_0x7810('0x21')](function(_0x385aa6){var _0x2528ef={'id':_0x53a88c+'_'+_0x385aa6[_0x7810('0xd4')],'name':_0x385aa6[_0x7810('0xd8')][_0x7810('0xd2')]?_0x385aa6[_0x7810('0xd8')][_0x7810('0xd2')][_0x7810('0xd1')]:_0x385aa6[_0x7810('0xd4')],'custom':![],'options':[]};_0x2461d3[_0x7810('0xca')](_0x2528ef);return _0x2461d3;});}
\ No newline at end of file
diff --git a/server/api/intDynamics365Account/intDynamics365Account.model.js b/server/api/intDynamics365Account/intDynamics365Account.model.js
index f115eb3..c8a1409 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 _0x94c1=['../../components/integrations/configuration','exports','define','Dynamics365Account','int_dynamics365_accounts','lodash','util','../../config/logger','api','moment','bluebird','path','rimraf','./intDynamics365Account.attributes'];(function(_0x1d48f2,_0x27e007){var _0x531e46=function(_0x59b1ce){while(--_0x59b1ce){_0x1d48f2['push'](_0x1d48f2['shift']());}};_0x531e46(++_0x27e007);}(_0x94c1,0x1c5));var _0x194c=function(_0x570eb6,_0xf3c68f){_0x570eb6=_0x570eb6-0x0;var _0x508ea9=_0x94c1[_0x570eb6];return _0x508ea9;};'use strict';var _=require(_0x194c('0x0'));var util=require(_0x194c('0x1'));var logger=require(_0x194c('0x2'))(_0x194c('0x3'));var moment=require(_0x194c('0x4'));var BPromise=require(_0x194c('0x5'));var rp=require('request-promise');var fs=require('fs');var path=require(_0x194c('0x6'));var rimraf=require(_0x194c('0x7'));var config=require('../../config/environment');var attributes=require(_0x194c('0x8'));var integrations=require(_0x194c('0x9'));module[_0x194c('0xa')]=function(_0x241bb9,_0x4b29bc){return _0x241bb9[_0x194c('0xb')](_0x194c('0xc'),attributes,{'tableName':_0x194c('0xd'),'paranoid':![],'indexes':[],'timestamps':!![]});};
\ No newline at end of file
+var _0x3c46=['api','moment','request-promise','path','../../config/environment','./intDynamics365Account.attributes','../../components/integrations/configuration','define','int_dynamics365_accounts','lodash','util'];(function(_0x104504,_0x443c9b){var _0x2f3e8f=function(_0x31c8ca){while(--_0x31c8ca){_0x104504['push'](_0x104504['shift']());}};_0x2f3e8f(++_0x443c9b);}(_0x3c46,0x82));var _0x63c4=function(_0xc7e035,_0x1e62ea){_0xc7e035=_0xc7e035-0x0;var _0x3a0bc3=_0x3c46[_0xc7e035];return _0x3a0bc3;};'use strict';var _=require(_0x63c4('0x0'));var util=require(_0x63c4('0x1'));var logger=require('../../config/logger')(_0x63c4('0x2'));var moment=require(_0x63c4('0x3'));var BPromise=require('bluebird');var rp=require(_0x63c4('0x4'));var fs=require('fs');var path=require(_0x63c4('0x5'));var rimraf=require('rimraf');var config=require(_0x63c4('0x6'));var attributes=require(_0x63c4('0x7'));var integrations=require(_0x63c4('0x8'));module['exports']=function(_0x2fe0e6,_0x137d90){return _0x2fe0e6[_0x63c4('0x9')]('Dynamics365Account',attributes,{'tableName':_0x63c4('0xa'),'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 8b1a758..9883cfd 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 _0xce22=['code','message','info','result','GetDynamics365Account','findAll','options','raw','attributes','include','map','model','debug','stringify','catch','ShowDynamics365Account','find','where','lodash','util','moment','bluebird','randomstring','../../mysqldb','../../config/logger','rpc','../../config/environment','jayson/promise','client','http','request','then','Dynamics365Account,\x20%s,\x20%s','request\x20sent','Dynamics365Account,\x20%s,\x20%s,\x20%s','error'];(function(_0x41b309,_0x13c669){var _0x140969=function(_0x163fe7){while(--_0x163fe7){_0x41b309['push'](_0x41b309['shift']());}};_0x140969(++_0x13c669);}(_0xce22,0xea));var _0x2ce2=function(_0x1df50d,_0x15d7b5){_0x1df50d=_0x1df50d-0x0;var _0x8f8dc6=_0xce22[_0x1df50d];return _0x8f8dc6;};'use strict';var _=require(_0x2ce2('0x0'));var util=require(_0x2ce2('0x1'));var moment=require(_0x2ce2('0x2'));var BPromise=require(_0x2ce2('0x3'));var rs=require(_0x2ce2('0x4'));var fs=require('fs');var Redis=require('ioredis');var db=require(_0x2ce2('0x5'))['db'];var utils=require('../../config/utils');var logger=require(_0x2ce2('0x6'))(_0x2ce2('0x7'));var config=require(_0x2ce2('0x8'));var jayson=require(_0x2ce2('0x9'));var client=jayson[_0x2ce2('0xa')][_0x2ce2('0xb')]({'port':0x232a});function respondWithRpcPromise(_0x6515b5,_0x4d0c17,_0x225737){return new BPromise(function(_0x111f56,_0x3c3d0b){return client[_0x2ce2('0xc')](_0x6515b5,_0x225737)[_0x2ce2('0xd')](function(_0x1dff2c){logger['info'](_0x2ce2('0xe'),_0x4d0c17,_0x2ce2('0xf'));logger['debug'](_0x2ce2('0x10'),_0x4d0c17,_0x2ce2('0xf'),JSON['stringify'](_0x1dff2c));if(_0x1dff2c[_0x2ce2('0x11')]){if(_0x1dff2c[_0x2ce2('0x11')][_0x2ce2('0x12')]===0x1f4){logger[_0x2ce2('0x11')]('Dynamics365Account,\x20%s,\x20%s',_0x4d0c17,_0x1dff2c[_0x2ce2('0x11')][_0x2ce2('0x13')]);return _0x3c3d0b(_0x1dff2c[_0x2ce2('0x11')]['message']);}logger[_0x2ce2('0x11')]('Dynamics365Account,\x20%s,\x20%s',_0x4d0c17,_0x1dff2c['error'][_0x2ce2('0x13')]);return _0x111f56(_0x1dff2c[_0x2ce2('0x11')][_0x2ce2('0x13')]);}else{logger[_0x2ce2('0x14')](_0x2ce2('0xe'),_0x4d0c17,_0x2ce2('0xf'));_0x111f56(_0x1dff2c[_0x2ce2('0x15')]['message']);}})['catch'](function(_0x515f90){logger[_0x2ce2('0x11')](_0x2ce2('0xe'),_0x4d0c17,_0x515f90);_0x3c3d0b(_0x515f90);});});}exports[_0x2ce2('0x16')]=function(_0x3443e6){var _0x3a7989=this;return new Promise(function(_0x560a77,_0x35353e){return db['Dynamics365Account'][_0x2ce2('0x17')]({'raw':_0x3443e6[_0x2ce2('0x18')]?_0x3443e6[_0x2ce2('0x18')][_0x2ce2('0x19')]===undefined?!![]:![]:!![],'where':_0x3443e6[_0x2ce2('0x18')]?_0x3443e6[_0x2ce2('0x18')]['where']||null:null,'attributes':_0x3443e6['options']?_0x3443e6[_0x2ce2('0x18')][_0x2ce2('0x1a')]||null:null,'limit':_0x3443e6[_0x2ce2('0x18')]?_0x3443e6[_0x2ce2('0x18')]['limit']||null:null,'include':_0x3443e6['options']?_0x3443e6['options'][_0x2ce2('0x1b')]?_[_0x2ce2('0x1c')](_0x3443e6['options'][_0x2ce2('0x1b')],function(_0x43a7b6){return{'model':db[_0x43a7b6[_0x2ce2('0x1d')]],'as':_0x43a7b6['as'],'attributes':_0x43a7b6[_0x2ce2('0x1a')],'include':_0x43a7b6[_0x2ce2('0x1b')]?_[_0x2ce2('0x1c')](_0x43a7b6[_0x2ce2('0x1b')],function(_0x5c748f){return{'model':db[_0x5c748f['model']],'as':_0x5c748f['as'],'attributes':_0x5c748f[_0x2ce2('0x1a')],'include':_0x5c748f['include']?_[_0x2ce2('0x1c')](_0x5c748f[_0x2ce2('0x1b')],function(_0x3a701e){return{'model':db[_0x3a701e[_0x2ce2('0x1d')]],'as':_0x3a701e['as'],'attributes':_0x3a701e[_0x2ce2('0x1a')]};}):[]};}):[]};}):[]:[]})['then'](function(_0x585752){logger[_0x2ce2('0x14')]('GetDynamics365Account',_0x3443e6);logger[_0x2ce2('0x1e')](_0x2ce2('0x16'),_0x3443e6,JSON[_0x2ce2('0x1f')](_0x585752));_0x560a77(_0x585752);})[_0x2ce2('0x20')](function(_0x1e1f17){logger[_0x2ce2('0x11')]('GetDynamics365Account',_0x1e1f17[_0x2ce2('0x13')],_0x3443e6);_0x35353e(_0x3a7989[_0x2ce2('0x11')](0x1f4,_0x1e1f17[_0x2ce2('0x13')]));});});};exports[_0x2ce2('0x21')]=function(_0x12457b){var _0x104a2e=this;return new Promise(function(_0x2222fc,_0x133043){return db['Dynamics365Account'][_0x2ce2('0x22')]({'raw':_0x12457b['options']?_0x12457b['options'][_0x2ce2('0x19')]===undefined?!![]:![]:!![],'where':_0x12457b[_0x2ce2('0x18')]?_0x12457b['options'][_0x2ce2('0x23')]||null:null,'attributes':_0x12457b[_0x2ce2('0x18')]?_0x12457b[_0x2ce2('0x18')][_0x2ce2('0x1a')]||null:null,'include':_0x12457b[_0x2ce2('0x18')]?_0x12457b[_0x2ce2('0x18')]['include']?_[_0x2ce2('0x1c')](_0x12457b[_0x2ce2('0x18')][_0x2ce2('0x1b')],function(_0x3da6e6){return{'model':db[_0x3da6e6['model']],'as':_0x3da6e6['as'],'attributes':_0x3da6e6[_0x2ce2('0x1a')],'include':_0x3da6e6[_0x2ce2('0x1b')]?_[_0x2ce2('0x1c')](_0x3da6e6[_0x2ce2('0x1b')],function(_0x339263){return{'model':db[_0x339263[_0x2ce2('0x1d')]],'as':_0x339263['as'],'attributes':_0x339263[_0x2ce2('0x1a')],'include':_0x339263[_0x2ce2('0x1b')]?_[_0x2ce2('0x1c')](_0x339263[_0x2ce2('0x1b')],function(_0xa328a){return{'model':db[_0xa328a['model']],'as':_0xa328a['as'],'attributes':_0xa328a[_0x2ce2('0x1a')]};}):[]};}):[]};}):[]:[]})[_0x2ce2('0xd')](function(_0x11f96f){logger[_0x2ce2('0x14')](_0x2ce2('0x21'),_0x12457b);logger[_0x2ce2('0x1e')](_0x2ce2('0x21'),_0x12457b,JSON[_0x2ce2('0x1f')](_0x11f96f));_0x2222fc(_0x11f96f);})[_0x2ce2('0x20')](function(_0x2e207d){logger[_0x2ce2('0x11')](_0x2ce2('0x21'),_0x2e207d['message'],_0x12457b);_0x133043(_0x104a2e[_0x2ce2('0x11')](0x1f4,_0x2e207d[_0x2ce2('0x13')]));});});};
\ No newline at end of file
+var _0x16ce=['debug','Dynamics365Account,\x20%s,\x20%s,\x20%s','stringify','error','code','message','result','GetDynamics365Account','Dynamics365Account','raw','options','where','limit','include','map','model','attributes','then','find','ShowDynamics365Account','util','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/environment','client','http','request','info','Dynamics365Account,\x20%s,\x20%s','request\x20sent'];(function(_0x4c06a3,_0x1e6b6f){var _0x7ff53c=function(_0x559eff){while(--_0x559eff){_0x4c06a3['push'](_0x4c06a3['shift']());}};_0x7ff53c(++_0x1e6b6f);}(_0x16ce,0xfb));var _0xe16c=function(_0x22da60,_0x35eb4a){_0x22da60=_0x22da60-0x0;var _0x5cff56=_0x16ce[_0x22da60];return _0x5cff56;};'use strict';var _=require('lodash');var util=require(_0xe16c('0x0'));var moment=require(_0xe16c('0x1'));var BPromise=require(_0xe16c('0x2'));var rs=require(_0xe16c('0x3'));var fs=require('fs');var Redis=require(_0xe16c('0x4'));var db=require(_0xe16c('0x5'))['db'];var utils=require('../../config/utils');var logger=require('../../config/logger')('rpc');var config=require(_0xe16c('0x6'));var jayson=require('jayson/promise');var client=jayson[_0xe16c('0x7')][_0xe16c('0x8')]({'port':0x232a});function respondWithRpcPromise(_0x3b149c,_0x1cf3f9,_0x1d8b72){return new BPromise(function(_0x14d6d4,_0x37f822){return client[_0xe16c('0x9')](_0x3b149c,_0x1d8b72)['then'](function(_0x30feb4){logger[_0xe16c('0xa')](_0xe16c('0xb'),_0x1cf3f9,_0xe16c('0xc'));logger[_0xe16c('0xd')](_0xe16c('0xe'),_0x1cf3f9,_0xe16c('0xc'),JSON[_0xe16c('0xf')](_0x30feb4));if(_0x30feb4[_0xe16c('0x10')]){if(_0x30feb4[_0xe16c('0x10')][_0xe16c('0x11')]===0x1f4){logger['error'](_0xe16c('0xb'),_0x1cf3f9,_0x30feb4[_0xe16c('0x10')][_0xe16c('0x12')]);return _0x37f822(_0x30feb4[_0xe16c('0x10')]['message']);}logger['error'](_0xe16c('0xb'),_0x1cf3f9,_0x30feb4[_0xe16c('0x10')][_0xe16c('0x12')]);return _0x14d6d4(_0x30feb4[_0xe16c('0x10')]['message']);}else{logger[_0xe16c('0xa')]('Dynamics365Account,\x20%s,\x20%s',_0x1cf3f9,_0xe16c('0xc'));_0x14d6d4(_0x30feb4[_0xe16c('0x13')][_0xe16c('0x12')]);}})['catch'](function(_0x72f37f){logger[_0xe16c('0x10')](_0xe16c('0xb'),_0x1cf3f9,_0x72f37f);_0x37f822(_0x72f37f);});});}exports[_0xe16c('0x14')]=function(_0x2afddf){var _0x5121f8=this;return new Promise(function(_0x99130d,_0x7867db){return db[_0xe16c('0x15')]['findAll']({'raw':_0x2afddf['options']?_0x2afddf['options'][_0xe16c('0x16')]===undefined?!![]:![]:!![],'where':_0x2afddf[_0xe16c('0x17')]?_0x2afddf[_0xe16c('0x17')][_0xe16c('0x18')]||null:null,'attributes':_0x2afddf[_0xe16c('0x17')]?_0x2afddf[_0xe16c('0x17')]['attributes']||null:null,'limit':_0x2afddf[_0xe16c('0x17')]?_0x2afddf[_0xe16c('0x17')][_0xe16c('0x19')]||null:null,'include':_0x2afddf[_0xe16c('0x17')]?_0x2afddf['options'][_0xe16c('0x1a')]?_[_0xe16c('0x1b')](_0x2afddf[_0xe16c('0x17')][_0xe16c('0x1a')],function(_0x461744){return{'model':db[_0x461744[_0xe16c('0x1c')]],'as':_0x461744['as'],'attributes':_0x461744[_0xe16c('0x1d')],'include':_0x461744[_0xe16c('0x1a')]?_['map'](_0x461744[_0xe16c('0x1a')],function(_0x9fd053){return{'model':db[_0x9fd053['model']],'as':_0x9fd053['as'],'attributes':_0x9fd053[_0xe16c('0x1d')],'include':_0x9fd053['include']?_[_0xe16c('0x1b')](_0x9fd053['include'],function(_0x27cc66){return{'model':db[_0x27cc66[_0xe16c('0x1c')]],'as':_0x27cc66['as'],'attributes':_0x27cc66[_0xe16c('0x1d')]};}):[]};}):[]};}):[]:[]})[_0xe16c('0x1e')](function(_0x473025){logger[_0xe16c('0xa')](_0xe16c('0x14'),_0x2afddf);logger[_0xe16c('0xd')](_0xe16c('0x14'),_0x2afddf,JSON[_0xe16c('0xf')](_0x473025));_0x99130d(_0x473025);})['catch'](function(_0x2bd23b){logger[_0xe16c('0x10')](_0xe16c('0x14'),_0x2bd23b['message'],_0x2afddf);_0x7867db(_0x5121f8[_0xe16c('0x10')](0x1f4,_0x2bd23b[_0xe16c('0x12')]));});});};exports['ShowDynamics365Account']=function(_0x1ce8f5){var _0x25ec64=this;return new Promise(function(_0x4ee06e,_0x3e0e51){return db[_0xe16c('0x15')][_0xe16c('0x1f')]({'raw':_0x1ce8f5[_0xe16c('0x17')]?_0x1ce8f5[_0xe16c('0x17')][_0xe16c('0x16')]===undefined?!![]:![]:!![],'where':_0x1ce8f5['options']?_0x1ce8f5[_0xe16c('0x17')][_0xe16c('0x18')]||null:null,'attributes':_0x1ce8f5['options']?_0x1ce8f5[_0xe16c('0x17')][_0xe16c('0x1d')]||null:null,'include':_0x1ce8f5[_0xe16c('0x17')]?_0x1ce8f5[_0xe16c('0x17')][_0xe16c('0x1a')]?_[_0xe16c('0x1b')](_0x1ce8f5[_0xe16c('0x17')]['include'],function(_0x290bd4){return{'model':db[_0x290bd4[_0xe16c('0x1c')]],'as':_0x290bd4['as'],'attributes':_0x290bd4[_0xe16c('0x1d')],'include':_0x290bd4[_0xe16c('0x1a')]?_[_0xe16c('0x1b')](_0x290bd4[_0xe16c('0x1a')],function(_0x15564e){return{'model':db[_0x15564e[_0xe16c('0x1c')]],'as':_0x15564e['as'],'attributes':_0x15564e[_0xe16c('0x1d')],'include':_0x15564e[_0xe16c('0x1a')]?_[_0xe16c('0x1b')](_0x15564e[_0xe16c('0x1a')],function(_0x1f4fe5){return{'model':db[_0x1f4fe5[_0xe16c('0x1c')]],'as':_0x1f4fe5['as'],'attributes':_0x1f4fe5[_0xe16c('0x1d')]};}):[]};}):[]};}):[]:[]})[_0xe16c('0x1e')](function(_0x5a3351){logger[_0xe16c('0xa')](_0xe16c('0x20'),_0x1ce8f5);logger[_0xe16c('0xd')](_0xe16c('0x20'),_0x1ce8f5,JSON[_0xe16c('0xf')](_0x5a3351));_0x4ee06e(_0x5a3351);})['catch'](function(_0x4e9b4a){logger[_0xe16c('0x10')](_0xe16c('0x20'),_0x4e9b4a[_0xe16c('0x12')],_0x1ce8f5);_0x3e0e51(_0x25ec64[_0xe16c('0x10')](0x1f4,_0x4e9b4a[_0xe16c('0x12')]));});});};
\ No newline at end of file
diff --git a/server/api/intDynamics365Configuration/index.js b/server/api/intDynamics365Configuration/index.js
index 1949c2e..62c31bf 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 _0x716a=['destroy','exports','util','path','connect-timeout','express','../../components/auth/service','../../components/interaction/service','../../config/environment','./intDynamics365Configuration.controller','get','index','/:id','show','/:id/fields','isAuthenticated','getFields','/:id/subjects','getSubjects','/:id/descriptions','getDescriptions','post','create','put','update','delete'];(function(_0x1d24eb,_0x12295b){var _0x1dc576=function(_0x4d5770){while(--_0x4d5770){_0x1d24eb['push'](_0x1d24eb['shift']());}};_0x1dc576(++_0x12295b);}(_0x716a,0x120));var _0xa716=function(_0x473738,_0x15ea31){_0x473738=_0x473738-0x0;var _0x1df4ae=_0x716a[_0x473738];return _0x1df4ae;};'use strict';var multer=require('multer');var util=require(_0xa716('0x0'));var path=require(_0xa716('0x1'));var timeout=require(_0xa716('0x2'));var express=require(_0xa716('0x3'));var router=express['Router']();var auth=require(_0xa716('0x4'));var interaction=require(_0xa716('0x5'));var config=require(_0xa716('0x6'));var controller=require(_0xa716('0x7'));router[_0xa716('0x8')]('/',auth['isAuthenticated'](),controller[_0xa716('0x9')]);router['get'](_0xa716('0xa'),auth['isAuthenticated'](),controller[_0xa716('0xb')]);router['get'](_0xa716('0xc'),auth[_0xa716('0xd')](),controller[_0xa716('0xe')]);router[_0xa716('0x8')](_0xa716('0xf'),auth[_0xa716('0xd')](),controller[_0xa716('0x10')]);router['get'](_0xa716('0x11'),auth[_0xa716('0xd')](),controller[_0xa716('0x12')]);router[_0xa716('0x13')]('/',auth[_0xa716('0xd')](),controller[_0xa716('0x14')]);router[_0xa716('0x15')](_0xa716('0xa'),auth[_0xa716('0xd')](),controller[_0xa716('0x16')]);router[_0xa716('0x17')]('/:id',auth[_0xa716('0xd')](),controller[_0xa716('0x18')]);module[_0xa716('0x19')]=router;
\ No newline at end of file
+var _0x7438=['getDescriptions','post','create','put','update','destroy','exports','util','connect-timeout','Router','../../components/auth/service','../../config/environment','./intDynamics365Configuration.controller','get','isAuthenticated','index','/:id','show','/:id/fields','/:id/subjects','getSubjects','/:id/descriptions'];(function(_0x2fb2dc,_0x3471da){var _0xdc9483=function(_0x58e79f){while(--_0x58e79f){_0x2fb2dc['push'](_0x2fb2dc['shift']());}};_0xdc9483(++_0x3471da);}(_0x7438,0x1a9));var _0x8743=function(_0x2ced26,_0x46247e){_0x2ced26=_0x2ced26-0x0;var _0x46b6eb=_0x7438[_0x2ced26];return _0x46b6eb;};'use strict';var multer=require('multer');var util=require(_0x8743('0x0'));var path=require('path');var timeout=require(_0x8743('0x1'));var express=require('express');var router=express[_0x8743('0x2')]();var auth=require(_0x8743('0x3'));var interaction=require('../../components/interaction/service');var config=require(_0x8743('0x4'));var controller=require(_0x8743('0x5'));router[_0x8743('0x6')]('/',auth[_0x8743('0x7')](),controller[_0x8743('0x8')]);router['get'](_0x8743('0x9'),auth[_0x8743('0x7')](),controller[_0x8743('0xa')]);router[_0x8743('0x6')](_0x8743('0xb'),auth[_0x8743('0x7')](),controller['getFields']);router[_0x8743('0x6')](_0x8743('0xc'),auth['isAuthenticated'](),controller[_0x8743('0xd')]);router[_0x8743('0x6')](_0x8743('0xe'),auth['isAuthenticated'](),controller[_0x8743('0xf')]);router[_0x8743('0x10')]('/',auth[_0x8743('0x7')](),controller[_0x8743('0x11')]);router[_0x8743('0x12')](_0x8743('0x9'),auth['isAuthenticated'](),controller[_0x8743('0x13')]);router['delete']('/:id',auth[_0x8743('0x7')](),controller[_0x8743('0x14')]);module[_0x8743('0x15')]=router;
\ No newline at end of file
diff --git a/server/api/intDynamics365Configuration/intDynamics365Configuration.attributes.js b/server/api/intDynamics365Configuration/intDynamics365Configuration.attributes.js
index 174c848..c76eed9 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 _0x6e58=['sequelize','STRING','ENUM','incident'];(function(_0x15664e,_0x3b48d8){var _0x353cc9=function(_0x4127e5){while(--_0x4127e5){_0x15664e['push'](_0x15664e['shift']());}};_0x353cc9(++_0x3b48d8);}(_0x6e58,0x15c));var _0x86e5=function(_0x2af8b9,_0x5b7f3e){_0x2af8b9=_0x2af8b9-0x0;var _0x19d80e=_0x6e58[_0x2af8b9];return _0x19d80e;};'use strict';var Sequelize=require(_0x86e5('0x0'));module['exports']={'name':{'type':Sequelize[_0x86e5('0x1')]},'description':{'type':Sequelize[_0x86e5('0x1')]},'ticketType':{'type':Sequelize[_0x86e5('0x2')](_0x86e5('0x3'),'phonecall'),'defaultValue':_0x86e5('0x3')}};
\ No newline at end of file
+var _0xe80b=['sequelize','exports','STRING','ENUM','incident','phonecall'];(function(_0x3ab51d,_0x2fa01d){var _0x29a04e=function(_0x7807b0){while(--_0x7807b0){_0x3ab51d['push'](_0x3ab51d['shift']());}};_0x29a04e(++_0x2fa01d);}(_0xe80b,0x150));var _0xbe80=function(_0x559ee8,_0x482a67){_0x559ee8=_0x559ee8-0x0;var _0x3f14a9=_0xe80b[_0x559ee8];return _0x3f14a9;};'use strict';var Sequelize=require(_0xbe80('0x0'));module[_0xbe80('0x1')]={'name':{'type':Sequelize[_0xbe80('0x2')]},'description':{'type':Sequelize[_0xbe80('0x2')]},'ticketType':{'type':Sequelize[_0xbe80('0x3')](_0xbe80('0x4'),_0xbe80('0x5')),'defaultValue':_0xbe80('0x4')}};
\ No newline at end of file
diff --git a/server/api/intDynamics365Configuration/intDynamics365Configuration.controller.js b/server/api/intDynamics365Configuration/intDynamics365Configuration.controller.js
index 53c4cfb..e6c3e67 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 _0xb062=['request','then','info','Dynamics365Configuration,\x20%s,\x20%s','request\x20sent','stringify','error','code','message','result','sendStatus','status','end','json','count','offset','limit','apply','reject','save','update','destroy','stack','name','send','index','map','Dynamics365Configuration','rawAttributes','fieldName','key','model','query','filters','intersection','fields','attributes','hasOwnProperty','nolimit','order','sort','where','pick','merge','type','VIRTUAL','filter','options','includeAll','include','rows','catch','show','params','keys','create','body','find','getFields','findOne','Dynamics365Field','length','getSubjects','getDescriptions','eml-format','rimraf','zip-dir','fast-json-patch','moment','bluebird','util','path','to-csv','ejs','lodash','squel','crypto','jsforce','desk.js','querystring','papaparse','../../components/parsers/qs','../../components/parsers/advancedSearch','../../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~!@#$%^&-_=+[{]}.'];(function(_0x5488ef,_0x435369){var _0x2a217c=function(_0x56fe00){while(--_0x56fe00){_0x5488ef['push'](_0x5488ef['shift']());}};_0x2a217c(++_0x435369);}(_0xb062,0x1b4));var _0x2b06=function(_0x591978,_0x3b7cf2){_0x591978=_0x591978-0x0;var _0x378df3=_0xb062[_0x591978];return _0x378df3;};'use strict';var pdf=require('html-pdf');var emlformat=require(_0x2b06('0x0'));var rimraf=require(_0x2b06('0x1'));var zipdir=require(_0x2b06('0x2'));var jsonpatch=require(_0x2b06('0x3'));var rp=require('request-promise');var moment=require(_0x2b06('0x4'));var BPromise=require(_0x2b06('0x5'));var Mustache=require('mustache');var util=require(_0x2b06('0x6'));var path=require(_0x2b06('0x7'));var sox=require('sox');var csv=require(_0x2b06('0x8'));var ejs=require(_0x2b06('0x9'));var fs=require('fs');var _=require(_0x2b06('0xa'));var squel=require(_0x2b06('0xb'));var crypto=require(_0x2b06('0xc'));var jsforce=require(_0x2b06('0xd'));var deskjs=require(_0x2b06('0xe'));var toCsv=require(_0x2b06('0x8'));var querystring=require(_0x2b06('0xf'));var Papa=require(_0x2b06('0x10'));var Redis=require('ioredis');var authService=require('../../components/auth/service');var qs=require(_0x2b06('0x11'));var as=require(_0x2b06('0x12'));var hardwareService=require('../../config/license/hardware');var logger=require(_0x2b06('0x13'))(_0x2b06('0x14'));var utils=require('../../config/utils');var config=require(_0x2b06('0x15'));var db=require('../../mysqldb')['db'];var jayson=require(_0x2b06('0x16'));var client=jayson[_0x2b06('0x17')][_0x2b06('0x18')]({'port':0x232a});function checkPasswordPattern(_0x38387d,_0xe1117b,_0x239c30){if(_0x239c30){var _0xbb1d51=new RegExp(/(?=.*[a-z])(?=.*[A-Z])(?=.*[0-9])(?=.*[?!@#\$%\^&\*~\-_=+[{\]\}])(?=.{8,})/);if(_0xbb1d51[_0x2b06('0x19')](_0xe1117b)){return _0x38387d;}else{throw new db[(_0x2b06('0x1a'))][(_0x2b06('0x1b'))](_0x2b06('0x1c'));}}else{return _0x38387d;}}function respondWithRpcPromise(_0x52e3bf,_0xd52ff2,_0x42c701,_0x1bdc95){return new BPromise(function(_0x431051,_0x4e3579){var _0x161904=_0x1bdc95||client;return _0x161904[_0x2b06('0x1d')](_0x52e3bf,_0x42c701)[_0x2b06('0x1e')](function(_0x550db6){logger[_0x2b06('0x1f')](_0x2b06('0x20'),_0xd52ff2,_0x2b06('0x21'));logger['debug']('Dynamics365Configuration,\x20%s,\x20%s,\x20%s',_0xd52ff2,_0x2b06('0x21'),JSON[_0x2b06('0x22')](_0x550db6));if(_0x550db6[_0x2b06('0x23')]){if(_0x550db6[_0x2b06('0x23')][_0x2b06('0x24')]===0x1f4){logger[_0x2b06('0x23')](_0x2b06('0x20'),_0xd52ff2,_0x550db6[_0x2b06('0x23')][_0x2b06('0x25')]);return _0x4e3579(_0x550db6[_0x2b06('0x23')]['message']);}logger[_0x2b06('0x23')](_0x2b06('0x20'),_0xd52ff2,_0x550db6['error'][_0x2b06('0x25')]);return _0x431051(_0x550db6[_0x2b06('0x23')][_0x2b06('0x25')]);}else{logger['info'](_0x2b06('0x20'),_0xd52ff2,'request\x20sent');_0x431051(_0x550db6[_0x2b06('0x26')][_0x2b06('0x25')]);}})['catch'](function(_0x3218ad){logger['error']('Dynamics365Configuration,\x20%s,\x20%s',_0xd52ff2,_0x3218ad);_0x4e3579(_0x3218ad);});});}function respondWithStatusCode(_0x23e4e4,_0x37c715){_0x37c715=_0x37c715||0xcc;return function(_0x1e8952){if(_0x1e8952){return _0x23e4e4[_0x2b06('0x27')](_0x37c715);}return _0x23e4e4[_0x2b06('0x28')](_0x37c715)[_0x2b06('0x29')]();};}function respondWithResult(_0x3a4896,_0x2fc0b0){_0x2fc0b0=_0x2fc0b0||0xc8;return function(_0x2f4a73){if(_0x2f4a73){return _0x3a4896[_0x2b06('0x28')](_0x2fc0b0)[_0x2b06('0x2a')](_0x2f4a73);}};}function respondWithFilteredResult(_0x49bd7a,_0x18975d){return function(_0xab6c19){if(_0xab6c19){var _0x1c70ba=_0xab6c19[_0x2b06('0x2b')],_0x50f51c=_0x18975d[_0x2b06('0x2c')],_0x400d4e=_0x18975d[_0x2b06('0x2c')]+_0x18975d[_0x2b06('0x2d')],_0x50e95a;if(_0x400d4e>=_0x1c70ba){_0x400d4e=_0x1c70ba;_0x50e95a=0xc8;}else{_0x50e95a=0xce;}_0x49bd7a[_0x2b06('0x28')](_0x50e95a);return _0x49bd7a['set']('Content-Range',_0x50f51c+'-'+_0x400d4e+'/'+_0x1c70ba)[_0x2b06('0x2a')](_0xab6c19);}return null;};}function patchUpdates(_0x28605c){return function(_0x1c18f1){try{jsonpatch[_0x2b06('0x2e')](_0x1c18f1,_0x28605c,!![]);}catch(_0x35dea5){return BPromise[_0x2b06('0x2f')](_0x35dea5);}return _0x1c18f1[_0x2b06('0x30')]();};}function saveUpdates(_0x4b7329,_0x1ccab4){return function(_0x23535a){if(_0x23535a){return _0x23535a[_0x2b06('0x31')](_0x4b7329)['then'](function(_0x5beff2){return _0x5beff2;});}return null;};}function removeEntity(_0x5de8c6,_0x5d129e){return function(_0x446d2b){if(_0x446d2b){return _0x446d2b[_0x2b06('0x32')]()[_0x2b06('0x1e')](function(){_0x5de8c6[_0x2b06('0x28')](0xcc)[_0x2b06('0x29')]();});}};}function handleEntityNotFound(_0x170663,_0x3897f5){return function(_0x5da242){if(!_0x5da242){_0x170663['sendStatus'](0x194);}return _0x5da242;};}function handleError(_0x3bcb4a,_0x5b8d9b){_0x5b8d9b=_0x5b8d9b||0x1f4;return function(_0x537ded){logger[_0x2b06('0x23')](_0x537ded[_0x2b06('0x33')]);if(_0x537ded['name']){delete _0x537ded[_0x2b06('0x34')];}_0x3bcb4a['status'](_0x5b8d9b)[_0x2b06('0x35')](_0x537ded);};}exports[_0x2b06('0x36')]=function(_0x5ab47e,_0x4870cd){var _0x13df2c={},_0x56a4b1={},_0x596186={'count':0x0,'rows':[]};var _0x388c7d=_[_0x2b06('0x37')](db[_0x2b06('0x38')][_0x2b06('0x39')],function(_0x33d710){return{'name':_0x33d710[_0x2b06('0x3a')],'type':_0x33d710['type'][_0x2b06('0x3b')]};});_0x56a4b1[_0x2b06('0x3c')]=_[_0x2b06('0x37')](_0x388c7d,'name');_0x56a4b1[_0x2b06('0x3d')]=_['keys'](_0x5ab47e['query']);_0x56a4b1[_0x2b06('0x3e')]=_[_0x2b06('0x3f')](_0x56a4b1['model'],_0x56a4b1[_0x2b06('0x3d')]);_0x13df2c['attributes']=_[_0x2b06('0x3f')](_0x56a4b1[_0x2b06('0x3c')],qs['fields'](_0x5ab47e['query'][_0x2b06('0x40')]));_0x13df2c['attributes']=_0x13df2c[_0x2b06('0x41')]['length']?_0x13df2c['attributes']:_0x56a4b1[_0x2b06('0x3c')];if(!_0x5ab47e[_0x2b06('0x3d')][_0x2b06('0x42')](_0x2b06('0x43'))){_0x13df2c['limit']=qs[_0x2b06('0x2d')](_0x5ab47e[_0x2b06('0x3d')][_0x2b06('0x2d')]);_0x13df2c[_0x2b06('0x2c')]=qs[_0x2b06('0x2c')](_0x5ab47e[_0x2b06('0x3d')][_0x2b06('0x2c')]);}_0x13df2c[_0x2b06('0x44')]=qs[_0x2b06('0x45')](_0x5ab47e[_0x2b06('0x3d')][_0x2b06('0x45')]);_0x13df2c[_0x2b06('0x46')]=qs[_0x2b06('0x3e')](_[_0x2b06('0x47')](_0x5ab47e[_0x2b06('0x3d')],_0x56a4b1['filters']));if(_0x5ab47e[_0x2b06('0x3d')]['filter']){_0x13df2c[_0x2b06('0x46')]=_[_0x2b06('0x48')](_0x13df2c[_0x2b06('0x46')],{'$or':_[_0x2b06('0x37')](_0x388c7d,function(_0x2cdbd0){if(_0x2cdbd0[_0x2b06('0x49')]!==_0x2b06('0x4a')){var _0x2a0ba1={};_0x2a0ba1[_0x2cdbd0[_0x2b06('0x34')]]={'$like':'%'+_0x5ab47e['query'][_0x2b06('0x4b')]+'%'};return _0x2a0ba1;}})});}_0x13df2c=_['merge']({},_0x13df2c,_0x5ab47e[_0x2b06('0x4c')]);var _0x5c0cb8={'where':_0x13df2c[_0x2b06('0x46')]};return db[_0x2b06('0x38')][_0x2b06('0x2b')](_0x5c0cb8)['then'](function(_0x5cc84f){_0x596186[_0x2b06('0x2b')]=_0x5cc84f;if(_0x5ab47e['query'][_0x2b06('0x4d')]){_0x13df2c[_0x2b06('0x4e')]=[{'all':!![]}];}return db[_0x2b06('0x38')]['findAll'](_0x13df2c);})['then'](function(_0x5738f0){_0x596186[_0x2b06('0x4f')]=_0x5738f0;return _0x596186;})[_0x2b06('0x1e')](respondWithFilteredResult(_0x4870cd,_0x13df2c))[_0x2b06('0x50')](handleError(_0x4870cd,null));};exports[_0x2b06('0x51')]=function(_0x3cefeb,_0x5a880c){var _0x95a0c5={'raw':![],'where':{'id':_0x3cefeb[_0x2b06('0x52')]['id']}},_0x1417a2={};_0x1417a2[_0x2b06('0x3c')]=_[_0x2b06('0x53')](db[_0x2b06('0x38')][_0x2b06('0x39')]);_0x1417a2['query']=_[_0x2b06('0x53')](_0x3cefeb[_0x2b06('0x3d')]);_0x1417a2[_0x2b06('0x3e')]=_['intersection'](_0x1417a2['model'],_0x1417a2[_0x2b06('0x3d')]);_0x95a0c5[_0x2b06('0x41')]=_[_0x2b06('0x3f')](_0x1417a2[_0x2b06('0x3c')],qs[_0x2b06('0x40')](_0x3cefeb['query'][_0x2b06('0x40')]));_0x95a0c5['attributes']=_0x95a0c5[_0x2b06('0x41')]['length']?_0x95a0c5[_0x2b06('0x41')]:_0x1417a2[_0x2b06('0x3c')];if(_0x3cefeb[_0x2b06('0x3d')][_0x2b06('0x4d')]){_0x95a0c5[_0x2b06('0x4e')]=[{'all':!![]}];}_0x95a0c5=_[_0x2b06('0x48')]({},_0x95a0c5,_0x3cefeb[_0x2b06('0x4c')]);return db[_0x2b06('0x38')]['find'](_0x95a0c5)[_0x2b06('0x1e')](handleEntityNotFound(_0x5a880c,null))[_0x2b06('0x1e')](respondWithResult(_0x5a880c,null))[_0x2b06('0x50')](handleError(_0x5a880c,null));};exports[_0x2b06('0x54')]=function(_0x58bde4,_0x5ea6c6){return db['Dynamics365Configuration'][_0x2b06('0x54')](_0x58bde4[_0x2b06('0x55')],{})[_0x2b06('0x1e')](respondWithResult(_0x5ea6c6,0xc9))[_0x2b06('0x50')](handleError(_0x5ea6c6,null));};exports[_0x2b06('0x31')]=function(_0x47eeac,_0x24dbc3){if(_0x47eeac[_0x2b06('0x55')]['id']){delete _0x47eeac[_0x2b06('0x55')]['id'];}return db['Dynamics365Configuration']['find']({'where':{'id':_0x47eeac[_0x2b06('0x52')]['id']}})[_0x2b06('0x1e')](handleEntityNotFound(_0x24dbc3,null))[_0x2b06('0x1e')](saveUpdates(_0x47eeac[_0x2b06('0x55')],null))[_0x2b06('0x1e')](respondWithResult(_0x24dbc3,null))[_0x2b06('0x50')](handleError(_0x24dbc3,null));};exports[_0x2b06('0x32')]=function(_0x38e910,_0x37982a){return db[_0x2b06('0x38')][_0x2b06('0x56')]({'where':{'id':_0x38e910['params']['id']}})['then'](handleEntityNotFound(_0x37982a,null))[_0x2b06('0x1e')](removeEntity(_0x37982a,null))['catch'](handleError(_0x37982a,null));};exports[_0x2b06('0x57')]=function(_0x2fed2c,_0x624695,_0x16c765){var _0x1fd3b3={};var _0x294026={};var _0x597801;var _0x5d88f0;return db[_0x2b06('0x38')][_0x2b06('0x58')]({'where':{'id':_0x2fed2c[_0x2b06('0x52')]['id']}})[_0x2b06('0x1e')](handleEntityNotFound(_0x624695,null))[_0x2b06('0x1e')](function(_0x3af172){if(_0x3af172){_0x597801=_0x3af172;_0x294026['model']=_['keys'](db[_0x2b06('0x59')][_0x2b06('0x39')]);_0x294026['query']=_['keys'](_0x2fed2c[_0x2b06('0x3d')]);_0x294026[_0x2b06('0x3e')]=_[_0x2b06('0x3f')](_0x294026[_0x2b06('0x3c')],_0x294026['query']);_0x1fd3b3['attributes']=_[_0x2b06('0x3f')](_0x294026[_0x2b06('0x3c')],qs['fields'](_0x2fed2c[_0x2b06('0x3d')][_0x2b06('0x40')]));_0x1fd3b3[_0x2b06('0x41')]=_0x1fd3b3[_0x2b06('0x41')][_0x2b06('0x5a')]?_0x1fd3b3['attributes']:_0x294026[_0x2b06('0x3c')];_0x1fd3b3['order']=qs[_0x2b06('0x45')](_0x2fed2c[_0x2b06('0x3d')][_0x2b06('0x45')]);_0x1fd3b3[_0x2b06('0x46')]=qs[_0x2b06('0x3e')](_[_0x2b06('0x47')](_0x2fed2c['query'],_0x294026[_0x2b06('0x3e')]));if(_0x2fed2c[_0x2b06('0x3d')][_0x2b06('0x4b')]){_0x1fd3b3[_0x2b06('0x46')]=_[_0x2b06('0x48')](_0x1fd3b3[_0x2b06('0x46')],{'$or':_[_0x2b06('0x37')](_0x1fd3b3[_0x2b06('0x41')],function(_0x975eef){var _0x59d56d={};_0x59d56d[_0x975eef]={'$like':'%'+_0x2fed2c[_0x2b06('0x3d')][_0x2b06('0x4b')]+'%'};return _0x59d56d;})});}_0x1fd3b3=_[_0x2b06('0x48')]({},_0x1fd3b3,_0x2fed2c[_0x2b06('0x4c')]);return _0x597801[_0x2b06('0x57')](_0x1fd3b3);}})[_0x2b06('0x1e')](function(_0x1ac421){if(_0x1ac421){_0x5d88f0=_0x1ac421[_0x2b06('0x5a')];if(!_0x2fed2c[_0x2b06('0x3d')]['hasOwnProperty'](_0x2b06('0x43'))){_0x1fd3b3[_0x2b06('0x2d')]=qs[_0x2b06('0x2d')](_0x2fed2c[_0x2b06('0x3d')][_0x2b06('0x2d')]);_0x1fd3b3['offset']=qs[_0x2b06('0x2c')](_0x2fed2c[_0x2b06('0x3d')][_0x2b06('0x2c')]);}return _0x597801['getFields'](_0x1fd3b3);}})[_0x2b06('0x1e')](function(_0x12fd6b){if(_0x12fd6b){return _0x12fd6b?{'count':_0x5d88f0,'rows':_0x12fd6b}:null;}})[_0x2b06('0x1e')](respondWithResult(_0x624695,null))[_0x2b06('0x50')](handleError(_0x624695,null));};exports['getSubjects']=function(_0x1adc34,_0x3d16c7,_0x46d699){var _0x1238ed={};var _0xe9faba={};var _0x1f3af9;var _0x2acfd2;return db['Dynamics365Configuration'][_0x2b06('0x58')]({'where':{'id':_0x1adc34[_0x2b06('0x52')]['id']}})['then'](handleEntityNotFound(_0x3d16c7,null))[_0x2b06('0x1e')](function(_0x38a28b){if(_0x38a28b){_0x1f3af9=_0x38a28b;_0xe9faba[_0x2b06('0x3c')]=_['keys'](db[_0x2b06('0x59')][_0x2b06('0x39')]);_0xe9faba[_0x2b06('0x3d')]=_[_0x2b06('0x53')](_0x1adc34['query']);_0xe9faba['filters']=_[_0x2b06('0x3f')](_0xe9faba[_0x2b06('0x3c')],_0xe9faba[_0x2b06('0x3d')]);_0x1238ed[_0x2b06('0x41')]=_[_0x2b06('0x3f')](_0xe9faba['model'],qs['fields'](_0x1adc34[_0x2b06('0x3d')]['fields']));_0x1238ed[_0x2b06('0x41')]=_0x1238ed[_0x2b06('0x41')][_0x2b06('0x5a')]?_0x1238ed[_0x2b06('0x41')]:_0xe9faba[_0x2b06('0x3c')];_0x1238ed['order']=qs[_0x2b06('0x45')](_0x1adc34['query']['sort']);_0x1238ed['where']=qs['filters'](_[_0x2b06('0x47')](_0x1adc34['query'],_0xe9faba['filters']));if(_0x1adc34[_0x2b06('0x3d')][_0x2b06('0x4b')]){_0x1238ed[_0x2b06('0x46')]=_[_0x2b06('0x48')](_0x1238ed[_0x2b06('0x46')],{'$or':_[_0x2b06('0x37')](_0x1238ed[_0x2b06('0x41')],function(_0x54cf6a){var _0x25cccc={};_0x25cccc[_0x54cf6a]={'$like':'%'+_0x1adc34[_0x2b06('0x3d')][_0x2b06('0x4b')]+'%'};return _0x25cccc;})});}_0x1238ed=_[_0x2b06('0x48')]({},_0x1238ed,_0x1adc34[_0x2b06('0x4c')]);return _0x1f3af9['getSubjects'](_0x1238ed);}})['then'](function(_0xb32a6){if(_0xb32a6){_0x2acfd2=_0xb32a6[_0x2b06('0x5a')];if(!_0x1adc34[_0x2b06('0x3d')][_0x2b06('0x42')](_0x2b06('0x43'))){_0x1238ed[_0x2b06('0x2d')]=qs[_0x2b06('0x2d')](_0x1adc34[_0x2b06('0x3d')][_0x2b06('0x2d')]);_0x1238ed['offset']=qs[_0x2b06('0x2c')](_0x1adc34[_0x2b06('0x3d')][_0x2b06('0x2c')]);}return _0x1f3af9[_0x2b06('0x5b')](_0x1238ed);}})[_0x2b06('0x1e')](function(_0x4a78c4){if(_0x4a78c4){return _0x4a78c4?{'count':_0x2acfd2,'rows':_0x4a78c4}:null;}})[_0x2b06('0x1e')](respondWithResult(_0x3d16c7,null))['catch'](handleError(_0x3d16c7,null));};exports[_0x2b06('0x5c')]=function(_0x17937b,_0x14b042,_0x21dc55){var _0x23e53c={};var _0x9c77f1={};var _0x528f22;var _0x1844a6;return db[_0x2b06('0x38')]['findOne']({'where':{'id':_0x17937b[_0x2b06('0x52')]['id']}})[_0x2b06('0x1e')](handleEntityNotFound(_0x14b042,null))[_0x2b06('0x1e')](function(_0x187b62){if(_0x187b62){_0x528f22=_0x187b62;_0x9c77f1['model']=_['keys'](db['Dynamics365Field'][_0x2b06('0x39')]);_0x9c77f1[_0x2b06('0x3d')]=_[_0x2b06('0x53')](_0x17937b[_0x2b06('0x3d')]);_0x9c77f1['filters']=_[_0x2b06('0x3f')](_0x9c77f1[_0x2b06('0x3c')],_0x9c77f1[_0x2b06('0x3d')]);_0x23e53c[_0x2b06('0x41')]=_[_0x2b06('0x3f')](_0x9c77f1[_0x2b06('0x3c')],qs['fields'](_0x17937b['query'][_0x2b06('0x40')]));_0x23e53c[_0x2b06('0x41')]=_0x23e53c['attributes']['length']?_0x23e53c[_0x2b06('0x41')]:_0x9c77f1['model'];_0x23e53c['order']=qs[_0x2b06('0x45')](_0x17937b['query'][_0x2b06('0x45')]);_0x23e53c[_0x2b06('0x46')]=qs[_0x2b06('0x3e')](_[_0x2b06('0x47')](_0x17937b[_0x2b06('0x3d')],_0x9c77f1[_0x2b06('0x3e')]));if(_0x17937b['query'][_0x2b06('0x4b')]){_0x23e53c[_0x2b06('0x46')]=_[_0x2b06('0x48')](_0x23e53c[_0x2b06('0x46')],{'$or':_[_0x2b06('0x37')](_0x23e53c[_0x2b06('0x41')],function(_0x20e1db){var _0x3ae56c={};_0x3ae56c[_0x20e1db]={'$like':'%'+_0x17937b[_0x2b06('0x3d')][_0x2b06('0x4b')]+'%'};return _0x3ae56c;})});}_0x23e53c=_['merge']({},_0x23e53c,_0x17937b[_0x2b06('0x4c')]);return _0x528f22[_0x2b06('0x5c')](_0x23e53c);}})['then'](function(_0x1e5f83){if(_0x1e5f83){_0x1844a6=_0x1e5f83[_0x2b06('0x5a')];if(!_0x17937b[_0x2b06('0x3d')]['hasOwnProperty'](_0x2b06('0x43'))){_0x23e53c[_0x2b06('0x2d')]=qs[_0x2b06('0x2d')](_0x17937b[_0x2b06('0x3d')][_0x2b06('0x2d')]);_0x23e53c[_0x2b06('0x2c')]=qs['offset'](_0x17937b['query'][_0x2b06('0x2c')]);}return _0x528f22[_0x2b06('0x5c')](_0x23e53c);}})[_0x2b06('0x1e')](function(_0x194ad5){if(_0x194ad5){return _0x194ad5?{'count':_0x1844a6,'rows':_0x194ad5}:null;}})['then'](respondWithResult(_0x14b042,null))[_0x2b06('0x50')](handleError(_0x14b042,null));};
\ No newline at end of file
+var _0x9b69=['desk.js','querystring','papaparse','../../components/auth/service','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','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~!@#$%^&-_=+[{]}.','then','info','Dynamics365Configuration,\x20%s,\x20%s','request\x20sent','stringify','error','message','result','catch','sendStatus','status','end','json','count','limit','set','Content-Range','apply','reject','save','destroy','name','send','index','map','fieldName','type','key','model','query','keys','intersection','fields','attributes','length','hasOwnProperty','nolimit','offset','sort','where','filters','pick','filter','merge','VIRTUAL','Dynamics365Configuration','includeAll','include','findAll','rows','show','rawAttributes','options','body','update','find','params','getFields','findOne','getSubjects','Dynamics365Field','order','getDescriptions','html-pdf','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','moment','bluebird','mustache','util','sox','to-csv','ejs','lodash','squel','crypto','jsforce'];(function(_0x9d14e3,_0x5a6072){var _0x19bf32=function(_0x19da07){while(--_0x19da07){_0x9d14e3['push'](_0x9d14e3['shift']());}};_0x19bf32(++_0x5a6072);}(_0x9b69,0x1d9));var _0x99b6=function(_0xb36d7,_0x329cab){_0xb36d7=_0xb36d7-0x0;var _0x38007e=_0x9b69[_0xb36d7];return _0x38007e;};'use strict';var pdf=require(_0x99b6('0x0'));var emlformat=require(_0x99b6('0x1'));var rimraf=require(_0x99b6('0x2'));var zipdir=require(_0x99b6('0x3'));var jsonpatch=require(_0x99b6('0x4'));var rp=require(_0x99b6('0x5'));var moment=require(_0x99b6('0x6'));var BPromise=require(_0x99b6('0x7'));var Mustache=require(_0x99b6('0x8'));var util=require(_0x99b6('0x9'));var path=require('path');var sox=require(_0x99b6('0xa'));var csv=require(_0x99b6('0xb'));var ejs=require(_0x99b6('0xc'));var fs=require('fs');var _=require(_0x99b6('0xd'));var squel=require(_0x99b6('0xe'));var crypto=require(_0x99b6('0xf'));var jsforce=require(_0x99b6('0x10'));var deskjs=require(_0x99b6('0x11'));var toCsv=require(_0x99b6('0xb'));var querystring=require(_0x99b6('0x12'));var Papa=require(_0x99b6('0x13'));var Redis=require('ioredis');var authService=require(_0x99b6('0x14'));var qs=require('../../components/parsers/qs');var as=require(_0x99b6('0x15'));var hardwareService=require(_0x99b6('0x16'));var logger=require(_0x99b6('0x17'))(_0x99b6('0x18'));var utils=require(_0x99b6('0x19'));var config=require(_0x99b6('0x1a'));var db=require(_0x99b6('0x1b'))['db'];var jayson=require(_0x99b6('0x1c'));var client=jayson[_0x99b6('0x1d')][_0x99b6('0x1e')]({'port':0x232a});function checkPasswordPattern(_0x68e3ab,_0x2a9a1f,_0x55a2d8){if(_0x55a2d8){var _0x2da857=new RegExp(/(?=.*[a-z])(?=.*[A-Z])(?=.*[0-9])(?=.*[?!@#\$%\^&\*~\-_=+[{\]\}])(?=.{8,})/);if(_0x2da857[_0x99b6('0x1f')](_0x2a9a1f)){return _0x68e3ab;}else{throw new db[(_0x99b6('0x20'))][(_0x99b6('0x21'))](_0x99b6('0x22'));}}else{return _0x68e3ab;}}function respondWithRpcPromise(_0x2da2b9,_0x246a53,_0x39ae1c,_0xc3ba27){return new BPromise(function(_0x24424a,_0x5dd405){var _0x2fe070=_0xc3ba27||client;return _0x2fe070['request'](_0x2da2b9,_0x39ae1c)[_0x99b6('0x23')](function(_0x2a1b10){logger[_0x99b6('0x24')](_0x99b6('0x25'),_0x246a53,'request\x20sent');logger['debug']('Dynamics365Configuration,\x20%s,\x20%s,\x20%s',_0x246a53,_0x99b6('0x26'),JSON[_0x99b6('0x27')](_0x2a1b10));if(_0x2a1b10['error']){if(_0x2a1b10['error']['code']===0x1f4){logger[_0x99b6('0x28')](_0x99b6('0x25'),_0x246a53,_0x2a1b10['error'][_0x99b6('0x29')]);return _0x5dd405(_0x2a1b10['error'][_0x99b6('0x29')]);}logger[_0x99b6('0x28')](_0x99b6('0x25'),_0x246a53,_0x2a1b10[_0x99b6('0x28')][_0x99b6('0x29')]);return _0x24424a(_0x2a1b10[_0x99b6('0x28')][_0x99b6('0x29')]);}else{logger[_0x99b6('0x24')]('Dynamics365Configuration,\x20%s,\x20%s',_0x246a53,_0x99b6('0x26'));_0x24424a(_0x2a1b10[_0x99b6('0x2a')]['message']);}})[_0x99b6('0x2b')](function(_0x1f22d4){logger['error'](_0x99b6('0x25'),_0x246a53,_0x1f22d4);_0x5dd405(_0x1f22d4);});});}function respondWithStatusCode(_0xc56cf5,_0x182258){_0x182258=_0x182258||0xcc;return function(_0x236769){if(_0x236769){return _0xc56cf5[_0x99b6('0x2c')](_0x182258);}return _0xc56cf5[_0x99b6('0x2d')](_0x182258)[_0x99b6('0x2e')]();};}function respondWithResult(_0x548e98,_0x42ee5c){_0x42ee5c=_0x42ee5c||0xc8;return function(_0x391d27){if(_0x391d27){return _0x548e98[_0x99b6('0x2d')](_0x42ee5c)[_0x99b6('0x2f')](_0x391d27);}};}function respondWithFilteredResult(_0x30fdc5,_0x108064){return function(_0x46b1c4){if(_0x46b1c4){var _0x396c89=_0x46b1c4[_0x99b6('0x30')],_0x30697f=_0x108064['offset'],_0x75b28a=_0x108064['offset']+_0x108064[_0x99b6('0x31')],_0x3e3084;if(_0x75b28a>=_0x396c89){_0x75b28a=_0x396c89;_0x3e3084=0xc8;}else{_0x3e3084=0xce;}_0x30fdc5[_0x99b6('0x2d')](_0x3e3084);return _0x30fdc5[_0x99b6('0x32')](_0x99b6('0x33'),_0x30697f+'-'+_0x75b28a+'/'+_0x396c89)[_0x99b6('0x2f')](_0x46b1c4);}return null;};}function patchUpdates(_0x276492){return function(_0x5c8f08){try{jsonpatch[_0x99b6('0x34')](_0x5c8f08,_0x276492,!![]);}catch(_0xd03c08){return BPromise[_0x99b6('0x35')](_0xd03c08);}return _0x5c8f08[_0x99b6('0x36')]();};}function saveUpdates(_0x331ef9,_0x153f14){return function(_0x1be592){if(_0x1be592){return _0x1be592['update'](_0x331ef9)['then'](function(_0x39c707){return _0x39c707;});}return null;};}function removeEntity(_0x9e25d2,_0x47b769){return function(_0x26aa2e){if(_0x26aa2e){return _0x26aa2e[_0x99b6('0x37')]()[_0x99b6('0x23')](function(){_0x9e25d2[_0x99b6('0x2d')](0xcc)['end']();});}};}function handleEntityNotFound(_0x23ec54,_0x5d5493){return function(_0x511daa){if(!_0x511daa){_0x23ec54[_0x99b6('0x2c')](0x194);}return _0x511daa;};}function handleError(_0x29a7da,_0x234314){_0x234314=_0x234314||0x1f4;return function(_0x4eed33){logger['error'](_0x4eed33['stack']);if(_0x4eed33[_0x99b6('0x38')]){delete _0x4eed33['name'];}_0x29a7da[_0x99b6('0x2d')](_0x234314)[_0x99b6('0x39')](_0x4eed33);};}exports[_0x99b6('0x3a')]=function(_0x2757ee,_0xa9c81c){var _0x3d79d7={},_0x2e0d12={},_0x155241={'count':0x0,'rows':[]};var _0x4d26b1=_[_0x99b6('0x3b')](db['Dynamics365Configuration']['rawAttributes'],function(_0x329d62){return{'name':_0x329d62[_0x99b6('0x3c')],'type':_0x329d62[_0x99b6('0x3d')][_0x99b6('0x3e')]};});_0x2e0d12[_0x99b6('0x3f')]=_[_0x99b6('0x3b')](_0x4d26b1,_0x99b6('0x38'));_0x2e0d12[_0x99b6('0x40')]=_[_0x99b6('0x41')](_0x2757ee[_0x99b6('0x40')]);_0x2e0d12['filters']=_[_0x99b6('0x42')](_0x2e0d12[_0x99b6('0x3f')],_0x2e0d12['query']);_0x3d79d7['attributes']=_['intersection'](_0x2e0d12[_0x99b6('0x3f')],qs[_0x99b6('0x43')](_0x2757ee[_0x99b6('0x40')][_0x99b6('0x43')]));_0x3d79d7[_0x99b6('0x44')]=_0x3d79d7[_0x99b6('0x44')][_0x99b6('0x45')]?_0x3d79d7[_0x99b6('0x44')]:_0x2e0d12['model'];if(!_0x2757ee[_0x99b6('0x40')][_0x99b6('0x46')](_0x99b6('0x47'))){_0x3d79d7[_0x99b6('0x31')]=qs['limit'](_0x2757ee[_0x99b6('0x40')][_0x99b6('0x31')]);_0x3d79d7[_0x99b6('0x48')]=qs['offset'](_0x2757ee['query'][_0x99b6('0x48')]);}_0x3d79d7['order']=qs[_0x99b6('0x49')](_0x2757ee[_0x99b6('0x40')][_0x99b6('0x49')]);_0x3d79d7[_0x99b6('0x4a')]=qs[_0x99b6('0x4b')](_[_0x99b6('0x4c')](_0x2757ee[_0x99b6('0x40')],_0x2e0d12[_0x99b6('0x4b')]));if(_0x2757ee[_0x99b6('0x40')][_0x99b6('0x4d')]){_0x3d79d7[_0x99b6('0x4a')]=_[_0x99b6('0x4e')](_0x3d79d7[_0x99b6('0x4a')],{'$or':_[_0x99b6('0x3b')](_0x4d26b1,function(_0x270c4d){if(_0x270c4d['type']!==_0x99b6('0x4f')){var _0x2c3fa4={};_0x2c3fa4[_0x270c4d[_0x99b6('0x38')]]={'$like':'%'+_0x2757ee['query']['filter']+'%'};return _0x2c3fa4;}})});}_0x3d79d7=_[_0x99b6('0x4e')]({},_0x3d79d7,_0x2757ee['options']);var _0x598f41={'where':_0x3d79d7[_0x99b6('0x4a')]};return db[_0x99b6('0x50')][_0x99b6('0x30')](_0x598f41)[_0x99b6('0x23')](function(_0x554505){_0x155241['count']=_0x554505;if(_0x2757ee[_0x99b6('0x40')][_0x99b6('0x51')]){_0x3d79d7[_0x99b6('0x52')]=[{'all':!![]}];}return db['Dynamics365Configuration'][_0x99b6('0x53')](_0x3d79d7);})[_0x99b6('0x23')](function(_0x3371cf){_0x155241[_0x99b6('0x54')]=_0x3371cf;return _0x155241;})['then'](respondWithFilteredResult(_0xa9c81c,_0x3d79d7))[_0x99b6('0x2b')](handleError(_0xa9c81c,null));};exports[_0x99b6('0x55')]=function(_0x2a1cda,_0x5bfb32){var _0x59b17d={'raw':![],'where':{'id':_0x2a1cda['params']['id']}},_0x457614={};_0x457614[_0x99b6('0x3f')]=_[_0x99b6('0x41')](db[_0x99b6('0x50')][_0x99b6('0x56')]);_0x457614[_0x99b6('0x40')]=_['keys'](_0x2a1cda[_0x99b6('0x40')]);_0x457614[_0x99b6('0x4b')]=_['intersection'](_0x457614[_0x99b6('0x3f')],_0x457614[_0x99b6('0x40')]);_0x59b17d[_0x99b6('0x44')]=_[_0x99b6('0x42')](_0x457614['model'],qs[_0x99b6('0x43')](_0x2a1cda[_0x99b6('0x40')][_0x99b6('0x43')]));_0x59b17d[_0x99b6('0x44')]=_0x59b17d[_0x99b6('0x44')][_0x99b6('0x45')]?_0x59b17d['attributes']:_0x457614['model'];if(_0x2a1cda[_0x99b6('0x40')][_0x99b6('0x51')]){_0x59b17d['include']=[{'all':!![]}];}_0x59b17d=_[_0x99b6('0x4e')]({},_0x59b17d,_0x2a1cda[_0x99b6('0x57')]);return db[_0x99b6('0x50')]['find'](_0x59b17d)[_0x99b6('0x23')](handleEntityNotFound(_0x5bfb32,null))['then'](respondWithResult(_0x5bfb32,null))[_0x99b6('0x2b')](handleError(_0x5bfb32,null));};exports['create']=function(_0x4db855,_0xbf260){return db[_0x99b6('0x50')]['create'](_0x4db855[_0x99b6('0x58')],{})[_0x99b6('0x23')](respondWithResult(_0xbf260,0xc9))['catch'](handleError(_0xbf260,null));};exports[_0x99b6('0x59')]=function(_0x4909ea,_0x33dcb3){if(_0x4909ea[_0x99b6('0x58')]['id']){delete _0x4909ea[_0x99b6('0x58')]['id'];}return db[_0x99b6('0x50')][_0x99b6('0x5a')]({'where':{'id':_0x4909ea['params']['id']}})['then'](handleEntityNotFound(_0x33dcb3,null))['then'](saveUpdates(_0x4909ea[_0x99b6('0x58')],null))['then'](respondWithResult(_0x33dcb3,null))[_0x99b6('0x2b')](handleError(_0x33dcb3,null));};exports[_0x99b6('0x37')]=function(_0x324736,_0x36e1b2){return db[_0x99b6('0x50')][_0x99b6('0x5a')]({'where':{'id':_0x324736[_0x99b6('0x5b')]['id']}})['then'](handleEntityNotFound(_0x36e1b2,null))[_0x99b6('0x23')](removeEntity(_0x36e1b2,null))[_0x99b6('0x2b')](handleError(_0x36e1b2,null));};exports[_0x99b6('0x5c')]=function(_0x372201,_0x55a1bf,_0x22cdd4){var _0x49272d={};var _0x2d5b72={};var _0x3a276f;var _0x29c62d;return db[_0x99b6('0x50')][_0x99b6('0x5d')]({'where':{'id':_0x372201[_0x99b6('0x5b')]['id']}})['then'](handleEntityNotFound(_0x55a1bf,null))[_0x99b6('0x23')](function(_0x45dc85){if(_0x45dc85){_0x3a276f=_0x45dc85;_0x2d5b72[_0x99b6('0x3f')]=_[_0x99b6('0x41')](db['Dynamics365Field'][_0x99b6('0x56')]);_0x2d5b72[_0x99b6('0x40')]=_[_0x99b6('0x41')](_0x372201[_0x99b6('0x40')]);_0x2d5b72[_0x99b6('0x4b')]=_[_0x99b6('0x42')](_0x2d5b72[_0x99b6('0x3f')],_0x2d5b72['query']);_0x49272d[_0x99b6('0x44')]=_[_0x99b6('0x42')](_0x2d5b72[_0x99b6('0x3f')],qs['fields'](_0x372201[_0x99b6('0x40')]['fields']));_0x49272d['attributes']=_0x49272d['attributes'][_0x99b6('0x45')]?_0x49272d['attributes']:_0x2d5b72[_0x99b6('0x3f')];_0x49272d['order']=qs[_0x99b6('0x49')](_0x372201['query'][_0x99b6('0x49')]);_0x49272d[_0x99b6('0x4a')]=qs[_0x99b6('0x4b')](_['pick'](_0x372201[_0x99b6('0x40')],_0x2d5b72[_0x99b6('0x4b')]));if(_0x372201[_0x99b6('0x40')]['filter']){_0x49272d[_0x99b6('0x4a')]=_[_0x99b6('0x4e')](_0x49272d[_0x99b6('0x4a')],{'$or':_[_0x99b6('0x3b')](_0x49272d[_0x99b6('0x44')],function(_0x27f58e){var _0x57a1f7={};_0x57a1f7[_0x27f58e]={'$like':'%'+_0x372201[_0x99b6('0x40')][_0x99b6('0x4d')]+'%'};return _0x57a1f7;})});}_0x49272d=_[_0x99b6('0x4e')]({},_0x49272d,_0x372201[_0x99b6('0x57')]);return _0x3a276f['getFields'](_0x49272d);}})[_0x99b6('0x23')](function(_0x1f4af8){if(_0x1f4af8){_0x29c62d=_0x1f4af8[_0x99b6('0x45')];if(!_0x372201[_0x99b6('0x40')][_0x99b6('0x46')](_0x99b6('0x47'))){_0x49272d['limit']=qs['limit'](_0x372201[_0x99b6('0x40')][_0x99b6('0x31')]);_0x49272d['offset']=qs[_0x99b6('0x48')](_0x372201['query'][_0x99b6('0x48')]);}return _0x3a276f[_0x99b6('0x5c')](_0x49272d);}})[_0x99b6('0x23')](function(_0x2c8fc4){if(_0x2c8fc4){return _0x2c8fc4?{'count':_0x29c62d,'rows':_0x2c8fc4}:null;}})[_0x99b6('0x23')](respondWithResult(_0x55a1bf,null))[_0x99b6('0x2b')](handleError(_0x55a1bf,null));};exports[_0x99b6('0x5e')]=function(_0x2221b5,_0x52ea5c,_0x50882d){var _0x3adf8d={};var _0x4c44c5={};var _0x1b7b92;var _0xd1e790;return db['Dynamics365Configuration'][_0x99b6('0x5d')]({'where':{'id':_0x2221b5[_0x99b6('0x5b')]['id']}})[_0x99b6('0x23')](handleEntityNotFound(_0x52ea5c,null))[_0x99b6('0x23')](function(_0x1f1e28){if(_0x1f1e28){_0x1b7b92=_0x1f1e28;_0x4c44c5[_0x99b6('0x3f')]=_[_0x99b6('0x41')](db[_0x99b6('0x5f')][_0x99b6('0x56')]);_0x4c44c5[_0x99b6('0x40')]=_[_0x99b6('0x41')](_0x2221b5[_0x99b6('0x40')]);_0x4c44c5[_0x99b6('0x4b')]=_[_0x99b6('0x42')](_0x4c44c5[_0x99b6('0x3f')],_0x4c44c5[_0x99b6('0x40')]);_0x3adf8d[_0x99b6('0x44')]=_[_0x99b6('0x42')](_0x4c44c5[_0x99b6('0x3f')],qs['fields'](_0x2221b5[_0x99b6('0x40')][_0x99b6('0x43')]));_0x3adf8d[_0x99b6('0x44')]=_0x3adf8d[_0x99b6('0x44')][_0x99b6('0x45')]?_0x3adf8d[_0x99b6('0x44')]:_0x4c44c5[_0x99b6('0x3f')];_0x3adf8d[_0x99b6('0x60')]=qs[_0x99b6('0x49')](_0x2221b5[_0x99b6('0x40')][_0x99b6('0x49')]);_0x3adf8d['where']=qs[_0x99b6('0x4b')](_[_0x99b6('0x4c')](_0x2221b5[_0x99b6('0x40')],_0x4c44c5[_0x99b6('0x4b')]));if(_0x2221b5[_0x99b6('0x40')][_0x99b6('0x4d')]){_0x3adf8d[_0x99b6('0x4a')]=_['merge'](_0x3adf8d[_0x99b6('0x4a')],{'$or':_[_0x99b6('0x3b')](_0x3adf8d[_0x99b6('0x44')],function(_0x338b46){var _0x3e6da9={};_0x3e6da9[_0x338b46]={'$like':'%'+_0x2221b5['query'][_0x99b6('0x4d')]+'%'};return _0x3e6da9;})});}_0x3adf8d=_['merge']({},_0x3adf8d,_0x2221b5[_0x99b6('0x57')]);return _0x1b7b92['getSubjects'](_0x3adf8d);}})['then'](function(_0x447d75){if(_0x447d75){_0xd1e790=_0x447d75['length'];if(!_0x2221b5[_0x99b6('0x40')]['hasOwnProperty']('nolimit')){_0x3adf8d[_0x99b6('0x31')]=qs[_0x99b6('0x31')](_0x2221b5[_0x99b6('0x40')][_0x99b6('0x31')]);_0x3adf8d[_0x99b6('0x48')]=qs['offset'](_0x2221b5[_0x99b6('0x40')][_0x99b6('0x48')]);}return _0x1b7b92[_0x99b6('0x5e')](_0x3adf8d);}})[_0x99b6('0x23')](function(_0x309ee5){if(_0x309ee5){return _0x309ee5?{'count':_0xd1e790,'rows':_0x309ee5}:null;}})['then'](respondWithResult(_0x52ea5c,null))['catch'](handleError(_0x52ea5c,null));};exports['getDescriptions']=function(_0x124ff4,_0x2be6e7,_0x18dc86){var _0xb3e34f={};var _0x3decd4={};var _0x147a81;var _0x18da44;return db[_0x99b6('0x50')][_0x99b6('0x5d')]({'where':{'id':_0x124ff4[_0x99b6('0x5b')]['id']}})[_0x99b6('0x23')](handleEntityNotFound(_0x2be6e7,null))[_0x99b6('0x23')](function(_0x43e8eb){if(_0x43e8eb){_0x147a81=_0x43e8eb;_0x3decd4[_0x99b6('0x3f')]=_[_0x99b6('0x41')](db['Dynamics365Field'][_0x99b6('0x56')]);_0x3decd4['query']=_['keys'](_0x124ff4[_0x99b6('0x40')]);_0x3decd4[_0x99b6('0x4b')]=_['intersection'](_0x3decd4[_0x99b6('0x3f')],_0x3decd4[_0x99b6('0x40')]);_0xb3e34f[_0x99b6('0x44')]=_[_0x99b6('0x42')](_0x3decd4['model'],qs[_0x99b6('0x43')](_0x124ff4['query']['fields']));_0xb3e34f['attributes']=_0xb3e34f['attributes']['length']?_0xb3e34f[_0x99b6('0x44')]:_0x3decd4[_0x99b6('0x3f')];_0xb3e34f[_0x99b6('0x60')]=qs[_0x99b6('0x49')](_0x124ff4[_0x99b6('0x40')][_0x99b6('0x49')]);_0xb3e34f[_0x99b6('0x4a')]=qs['filters'](_[_0x99b6('0x4c')](_0x124ff4[_0x99b6('0x40')],_0x3decd4[_0x99b6('0x4b')]));if(_0x124ff4['query'][_0x99b6('0x4d')]){_0xb3e34f[_0x99b6('0x4a')]=_['merge'](_0xb3e34f['where'],{'$or':_['map'](_0xb3e34f['attributes'],function(_0x5f4542){var _0x425b43={};_0x425b43[_0x5f4542]={'$like':'%'+_0x124ff4[_0x99b6('0x40')]['filter']+'%'};return _0x425b43;})});}_0xb3e34f=_[_0x99b6('0x4e')]({},_0xb3e34f,_0x124ff4[_0x99b6('0x57')]);return _0x147a81[_0x99b6('0x61')](_0xb3e34f);}})[_0x99b6('0x23')](function(_0x300856){if(_0x300856){_0x18da44=_0x300856[_0x99b6('0x45')];if(!_0x124ff4[_0x99b6('0x40')]['hasOwnProperty'](_0x99b6('0x47'))){_0xb3e34f[_0x99b6('0x31')]=qs[_0x99b6('0x31')](_0x124ff4['query']['limit']);_0xb3e34f[_0x99b6('0x48')]=qs[_0x99b6('0x48')](_0x124ff4[_0x99b6('0x40')]['offset']);}return _0x147a81[_0x99b6('0x61')](_0xb3e34f);}})['then'](function(_0x250b76){if(_0x250b76){return _0x250b76?{'count':_0x18da44,'rows':_0x250b76}:null;}})[_0x99b6('0x23')](respondWithResult(_0x2be6e7,null))[_0x99b6('0x2b')](handleError(_0x2be6e7,null));};
\ No newline at end of file
diff --git a/server/api/intDynamics365Configuration/intDynamics365Configuration.model.js b/server/api/intDynamics365Configuration/intDynamics365Configuration.model.js
index 7fd8584..270904c 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 _0x75e8=['path','rimraf','../../config/environment','./intDynamics365Configuration.attributes','exports','define','lodash','../../config/logger','api','moment','bluebird'];(function(_0x11389d,_0x3308f9){var _0x450692=function(_0x3f56c1){while(--_0x3f56c1){_0x11389d['push'](_0x11389d['shift']());}};_0x450692(++_0x3308f9);}(_0x75e8,0x1c9));var _0x875e=function(_0x5519a6,_0x55ddad){_0x5519a6=_0x5519a6-0x0;var _0x7d5537=_0x75e8[_0x5519a6];return _0x7d5537;};'use strict';var _=require(_0x875e('0x0'));var util=require('util');var logger=require(_0x875e('0x1'))(_0x875e('0x2'));var moment=require(_0x875e('0x3'));var BPromise=require(_0x875e('0x4'));var rp=require('request-promise');var fs=require('fs');var path=require(_0x875e('0x5'));var rimraf=require(_0x875e('0x6'));var config=require(_0x875e('0x7'));var attributes=require(_0x875e('0x8'));module[_0x875e('0x9')]=function(_0x1c4ced,_0x2db935){return _0x1c4ced[_0x875e('0xa')]('Dynamics365Configuration',attributes,{'tableName':'int_dynamics365_configurations','paranoid':![],'indexes':[],'timestamps':!![]});};
\ No newline at end of file
+var _0x4a8c=['api','moment','request-promise','path','rimraf','../../config/environment','./intDynamics365Configuration.attributes','exports','define','Dynamics365Configuration','util','../../config/logger'];(function(_0x1cc8fe,_0x105328){var _0x230054=function(_0x1a1b56){while(--_0x1a1b56){_0x1cc8fe['push'](_0x1cc8fe['shift']());}};_0x230054(++_0x105328);}(_0x4a8c,0x14e));var _0xc4a8=function(_0x22f1e8,_0x1ba477){_0x22f1e8=_0x22f1e8-0x0;var _0x20e9ac=_0x4a8c[_0x22f1e8];return _0x20e9ac;};'use strict';var _=require('lodash');var util=require(_0xc4a8('0x0'));var logger=require(_0xc4a8('0x1'))(_0xc4a8('0x2'));var moment=require(_0xc4a8('0x3'));var BPromise=require('bluebird');var rp=require(_0xc4a8('0x4'));var fs=require('fs');var path=require(_0xc4a8('0x5'));var rimraf=require(_0xc4a8('0x6'));var config=require(_0xc4a8('0x7'));var attributes=require(_0xc4a8('0x8'));module[_0xc4a8('0x9')]=function(_0x5bc7c9,_0x4e8576){return _0x5bc7c9[_0xc4a8('0xa')](_0xc4a8('0xb'),attributes,{'tableName':'int_dynamics365_configurations','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 c3ed951..232e41c 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 _0xff2e=['client','http','request\x20sent','Dynamics365Configuration,\x20%s,\x20%s,\x20%s','error','code','Dynamics365Configuration,\x20%s,\x20%s','message','catch','lodash','util','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','rpc','../../config/environment','jayson/promise'];(function(_0x2a1a31,_0x1b8b1a){var _0xe175e8=function(_0xa6f2c2){while(--_0xa6f2c2){_0x2a1a31['push'](_0x2a1a31['shift']());}};_0xe175e8(++_0x1b8b1a);}(_0xff2e,0x6d));var _0xeff2=function(_0x2c5fcc,_0x2dfaae){_0x2c5fcc=_0x2c5fcc-0x0;var _0x2e3942=_0xff2e[_0x2c5fcc];return _0x2e3942;};'use strict';var _=require(_0xeff2('0x0'));var util=require(_0xeff2('0x1'));var moment=require(_0xeff2('0x2'));var BPromise=require(_0xeff2('0x3'));var rs=require(_0xeff2('0x4'));var fs=require('fs');var Redis=require(_0xeff2('0x5'));var db=require(_0xeff2('0x6'))['db'];var utils=require(_0xeff2('0x7'));var logger=require('../../config/logger')(_0xeff2('0x8'));var config=require(_0xeff2('0x9'));var jayson=require(_0xeff2('0xa'));var client=jayson[_0xeff2('0xb')][_0xeff2('0xc')]({'port':0x232a});function respondWithRpcPromise(_0x1b3cc5,_0x56dd8d,_0x50920f){return new BPromise(function(_0x2c5c7e,_0x3dca97){return client['request'](_0x1b3cc5,_0x50920f)['then'](function(_0x1c76ca){logger['info']('Dynamics365Configuration,\x20%s,\x20%s',_0x56dd8d,_0xeff2('0xd'));logger['debug'](_0xeff2('0xe'),_0x56dd8d,_0xeff2('0xd'),JSON['stringify'](_0x1c76ca));if(_0x1c76ca[_0xeff2('0xf')]){if(_0x1c76ca[_0xeff2('0xf')][_0xeff2('0x10')]===0x1f4){logger[_0xeff2('0xf')](_0xeff2('0x11'),_0x56dd8d,_0x1c76ca[_0xeff2('0xf')][_0xeff2('0x12')]);return _0x3dca97(_0x1c76ca['error'][_0xeff2('0x12')]);}logger[_0xeff2('0xf')](_0xeff2('0x11'),_0x56dd8d,_0x1c76ca[_0xeff2('0xf')][_0xeff2('0x12')]);return _0x2c5c7e(_0x1c76ca[_0xeff2('0xf')]['message']);}else{logger['info'](_0xeff2('0x11'),_0x56dd8d,_0xeff2('0xd'));_0x2c5c7e(_0x1c76ca['result']['message']);}})[_0xeff2('0x13')](function(_0x522032){logger[_0xeff2('0xf')](_0xeff2('0x11'),_0x56dd8d,_0x522032);_0x3dca97(_0x522032);});});}
\ No newline at end of file
+var _0x252b=['catch','util','bluebird','ioredis','../../config/logger','rpc','../../config/environment','jayson/promise','client','then','Dynamics365Configuration,\x20%s,\x20%s','request\x20sent','debug','Dynamics365Configuration,\x20%s,\x20%s,\x20%s','stringify','error','message','result'];(function(_0x5d60d1,_0x325ad0){var _0x5e94a7=function(_0x40fb9c){while(--_0x40fb9c){_0x5d60d1['push'](_0x5d60d1['shift']());}};_0x5e94a7(++_0x325ad0);}(_0x252b,0x7f));var _0xb252=function(_0x138975,_0x319d77){_0x138975=_0x138975-0x0;var _0x2ff39a=_0x252b[_0x138975];return _0x2ff39a;};'use strict';var _=require('lodash');var util=require(_0xb252('0x0'));var moment=require('moment');var BPromise=require(_0xb252('0x1'));var rs=require('randomstring');var fs=require('fs');var Redis=require(_0xb252('0x2'));var db=require('../../mysqldb')['db'];var utils=require('../../config/utils');var logger=require(_0xb252('0x3'))(_0xb252('0x4'));var config=require(_0xb252('0x5'));var jayson=require(_0xb252('0x6'));var client=jayson[_0xb252('0x7')]['http']({'port':0x232a});function respondWithRpcPromise(_0x17eb30,_0x4bd841,_0x4cc8d8){return new BPromise(function(_0x38e4e2,_0x12f32f){return client['request'](_0x17eb30,_0x4cc8d8)[_0xb252('0x8')](function(_0x35f500){logger['info'](_0xb252('0x9'),_0x4bd841,_0xb252('0xa'));logger[_0xb252('0xb')](_0xb252('0xc'),_0x4bd841,_0xb252('0xa'),JSON[_0xb252('0xd')](_0x35f500));if(_0x35f500[_0xb252('0xe')]){if(_0x35f500[_0xb252('0xe')]['code']===0x1f4){logger[_0xb252('0xe')](_0xb252('0x9'),_0x4bd841,_0x35f500[_0xb252('0xe')][_0xb252('0xf')]);return _0x12f32f(_0x35f500[_0xb252('0xe')]['message']);}logger['error'](_0xb252('0x9'),_0x4bd841,_0x35f500[_0xb252('0xe')]['message']);return _0x38e4e2(_0x35f500[_0xb252('0xe')]['message']);}else{logger['info'](_0xb252('0x9'),_0x4bd841,_0xb252('0xa'));_0x38e4e2(_0x35f500[_0xb252('0x10')]['message']);}})[_0xb252('0x11')](function(_0x1cc346){logger[_0xb252('0xe')]('Dynamics365Configuration,\x20%s,\x20%s',_0x4bd841,_0x1cc346);_0x12f32f(_0x1cc346);});});}
\ No newline at end of file
diff --git a/server/api/intDynamics365Field/index.js b/server/api/intDynamics365Field/index.js
index 7054231..7db0a44 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 _0x24cd=['create','update','delete','destroy','exports','multer','util','connect-timeout','Router','../../components/auth/service','../../components/interaction/service','./intDynamics365Field.controller','get','index','/:id','isAuthenticated','show','post'];(function(_0x3e13be,_0x26ec39){var _0x35b946=function(_0x21f577){while(--_0x21f577){_0x3e13be['push'](_0x3e13be['shift']());}};_0x35b946(++_0x26ec39);}(_0x24cd,0x83));var _0xd24c=function(_0x148243,_0x801290){_0x148243=_0x148243-0x0;var _0xbc0333=_0x24cd[_0x148243];return _0xbc0333;};'use strict';var multer=require(_0xd24c('0x0'));var util=require(_0xd24c('0x1'));var path=require('path');var timeout=require(_0xd24c('0x2'));var express=require('express');var router=express[_0xd24c('0x3')]();var auth=require(_0xd24c('0x4'));var interaction=require(_0xd24c('0x5'));var config=require('../../config/environment');var controller=require(_0xd24c('0x6'));router[_0xd24c('0x7')]('/',auth['isAuthenticated'](),controller[_0xd24c('0x8')]);router[_0xd24c('0x7')](_0xd24c('0x9'),auth[_0xd24c('0xa')](),controller[_0xd24c('0xb')]);router[_0xd24c('0xc')]('/',auth[_0xd24c('0xa')](),controller[_0xd24c('0xd')]);router['put']('/:id',auth[_0xd24c('0xa')](),controller[_0xd24c('0xe')]);router[_0xd24c('0xf')](_0xd24c('0x9'),auth[_0xd24c('0xa')](),controller[_0xd24c('0x10')]);module[_0xd24c('0x11')]=router;
\ No newline at end of file
+var _0xaf80=['util','path','connect-timeout','../../components/interaction/service','../../config/environment','./intDynamics365Field.controller','get','isAuthenticated','index','post','create','/:id','update','destroy','exports','multer'];(function(_0x190fd2,_0x4daf50){var _0x1abb5c=function(_0x3a0b17){while(--_0x3a0b17){_0x190fd2['push'](_0x190fd2['shift']());}};_0x1abb5c(++_0x4daf50);}(_0xaf80,0x1ef));var _0x0af8=function(_0x33ebc8,_0x1dfb83){_0x33ebc8=_0x33ebc8-0x0;var _0x4882f4=_0xaf80[_0x33ebc8];return _0x4882f4;};'use strict';var multer=require(_0x0af8('0x0'));var util=require(_0x0af8('0x1'));var path=require(_0x0af8('0x2'));var timeout=require(_0x0af8('0x3'));var express=require('express');var router=express['Router']();var auth=require('../../components/auth/service');var interaction=require(_0x0af8('0x4'));var config=require(_0x0af8('0x5'));var controller=require(_0x0af8('0x6'));router[_0x0af8('0x7')]('/',auth[_0x0af8('0x8')](),controller[_0x0af8('0x9')]);router['get']('/:id',auth[_0x0af8('0x8')](),controller['show']);router[_0x0af8('0xa')]('/',auth[_0x0af8('0x8')](),controller[_0x0af8('0xb')]);router['put'](_0x0af8('0xc'),auth[_0x0af8('0x8')](),controller[_0x0af8('0xd')]);router['delete']('/:id',auth[_0x0af8('0x8')](),controller[_0x0af8('0xe')]);module[_0x0af8('0xf')]=router;
\ No newline at end of file
diff --git a/server/api/intDynamics365Field/intDynamics365Field.attributes.js b/server/api/intDynamics365Field/intDynamics365Field.attributes.js
index 60b6ff5..1545589 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 _0xb819=['keyValue','STRING','variable','sequelize','ENUM','string','customVariable'];(function(_0x30780e,_0x537b34){var _0x5b9129=function(_0xcf4cd1){while(--_0xcf4cd1){_0x30780e['push'](_0x30780e['shift']());}};_0x5b9129(++_0x537b34);}(_0xb819,0x137));var _0x9b81=function(_0x4eb63f,_0x478d7d){_0x4eb63f=_0x4eb63f-0x0;var _0x474d90=_0xb819[_0x4eb63f];return _0x474d90;};'use strict';var Sequelize=require(_0x9b81('0x0'));module['exports']={'type':{'type':Sequelize[_0x9b81('0x1')](_0x9b81('0x2'),'variable',_0x9b81('0x3'),_0x9b81('0x4')),'defaultValue':_0x9b81('0x2')},'content':{'type':Sequelize[_0x9b81('0x5')]},'key':{'type':Sequelize['STRING']},'keyType':{'type':Sequelize[_0x9b81('0x1')]('string',_0x9b81('0x6'),_0x9b81('0x3'))},'keyContent':{'type':Sequelize[_0x9b81('0x5')]},'idField':{'type':Sequelize[_0x9b81('0x5')]},'nameField':{'type':Sequelize[_0x9b81('0x5')]},'customField':{'type':Sequelize['BOOLEAN'],'defaultValue':!![]},'variableName':{'type':Sequelize[_0x9b81('0x5')]}};
\ No newline at end of file
+var _0xbfc0=['customVariable','keyValue','STRING','ENUM','BOOLEAN','sequelize','exports','string'];(function(_0x27c068,_0x342981){var _0xe5a67f=function(_0x20658a){while(--_0x20658a){_0x27c068['push'](_0x27c068['shift']());}};_0xe5a67f(++_0x342981);}(_0xbfc0,0x115));var _0x0bfc=function(_0x57bb3a,_0x237ede){_0x57bb3a=_0x57bb3a-0x0;var _0x5decaa=_0xbfc0[_0x57bb3a];return _0x5decaa;};'use strict';var Sequelize=require(_0x0bfc('0x0'));module[_0x0bfc('0x1')]={'type':{'type':Sequelize['ENUM'](_0x0bfc('0x2'),'variable',_0x0bfc('0x3'),_0x0bfc('0x4')),'defaultValue':_0x0bfc('0x2')},'content':{'type':Sequelize['STRING']},'key':{'type':Sequelize[_0x0bfc('0x5')]},'keyType':{'type':Sequelize[_0x0bfc('0x6')]('string','variable','customVariable')},'keyContent':{'type':Sequelize[_0x0bfc('0x5')]},'idField':{'type':Sequelize['STRING']},'nameField':{'type':Sequelize['STRING']},'customField':{'type':Sequelize[_0x0bfc('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 1005c1d..5f8fd63 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 _0x1fcc=['destroy','html-pdf','eml-format','zip-dir','fast-json-patch','request-promise','moment','bluebird','mustache','util','sox','to-csv','ejs','squel','crypto','desk.js','papaparse','../../components/auth/service','../../components/parsers/qs','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/environment','status','end','json','offset','set','Content-Range','apply','reject','then','sendStatus','error','stack','name','send','index','Dynamics365Field','fieldName','type','key','model','map','query','filters','intersection','attributes','hasOwnProperty','nolimit','limit','order','sort','where','pick','filter','merge','options','count','includeAll','findAll','catch','keys','rawAttributes','fields','length','include','find','create','body','update','params'];(function(_0x14add3,_0x13ce8d){var _0x4a174f=function(_0x2b3ed7){while(--_0x2b3ed7){_0x14add3['push'](_0x14add3['shift']());}};_0x4a174f(++_0x13ce8d);}(_0x1fcc,0x125));var _0xc1fc=function(_0x2f1114,_0x4561f1){_0x2f1114=_0x2f1114-0x0;var _0x2fe856=_0x1fcc[_0x2f1114];return _0x2fe856;};'use strict';var pdf=require(_0xc1fc('0x0'));var emlformat=require(_0xc1fc('0x1'));var rimraf=require('rimraf');var zipdir=require(_0xc1fc('0x2'));var jsonpatch=require(_0xc1fc('0x3'));var rp=require(_0xc1fc('0x4'));var moment=require(_0xc1fc('0x5'));var BPromise=require(_0xc1fc('0x6'));var Mustache=require(_0xc1fc('0x7'));var util=require(_0xc1fc('0x8'));var path=require('path');var sox=require(_0xc1fc('0x9'));var csv=require(_0xc1fc('0xa'));var ejs=require(_0xc1fc('0xb'));var fs=require('fs');var _=require('lodash');var squel=require(_0xc1fc('0xc'));var crypto=require(_0xc1fc('0xd'));var jsforce=require('jsforce');var deskjs=require(_0xc1fc('0xe'));var toCsv=require(_0xc1fc('0xa'));var querystring=require('querystring');var Papa=require(_0xc1fc('0xf'));var Redis=require('ioredis');var authService=require(_0xc1fc('0x10'));var qs=require(_0xc1fc('0x11'));var as=require('../../components/parsers/advancedSearch');var hardwareService=require(_0xc1fc('0x12'));var logger=require(_0xc1fc('0x13'))(_0xc1fc('0x14'));var utils=require(_0xc1fc('0x15'));var config=require(_0xc1fc('0x16'));var db=require('../../mysqldb')['db'];function respondWithStatusCode(_0x26608f,_0x10d1d3){_0x10d1d3=_0x10d1d3||0xcc;return function(_0x354393){if(_0x354393){return _0x26608f['sendStatus'](_0x10d1d3);}return _0x26608f[_0xc1fc('0x17')](_0x10d1d3)[_0xc1fc('0x18')]();};}function respondWithResult(_0x199d01,_0x52b0bb){_0x52b0bb=_0x52b0bb||0xc8;return function(_0x2a8519){if(_0x2a8519){return _0x199d01[_0xc1fc('0x17')](_0x52b0bb)[_0xc1fc('0x19')](_0x2a8519);}};}function respondWithFilteredResult(_0x201115,_0x232bc2){return function(_0xd04a31){if(_0xd04a31){var _0x476bcf=_0xd04a31['count'],_0x427326=_0x232bc2[_0xc1fc('0x1a')],_0x1d64e9=_0x232bc2['offset']+_0x232bc2['limit'],_0x2259c7;if(_0x1d64e9>=_0x476bcf){_0x1d64e9=_0x476bcf;_0x2259c7=0xc8;}else{_0x2259c7=0xce;}_0x201115[_0xc1fc('0x17')](_0x2259c7);return _0x201115[_0xc1fc('0x1b')](_0xc1fc('0x1c'),_0x427326+'-'+_0x1d64e9+'/'+_0x476bcf)[_0xc1fc('0x19')](_0xd04a31);}return null;};}function patchUpdates(_0x364589){return function(_0x2b48ff){try{jsonpatch[_0xc1fc('0x1d')](_0x2b48ff,_0x364589,!![]);}catch(_0x1ae5b6){return BPromise[_0xc1fc('0x1e')](_0x1ae5b6);}return _0x2b48ff['save']();};}function saveUpdates(_0x278721,_0x36122b){return function(_0x56b0f3){if(_0x56b0f3){return _0x56b0f3['update'](_0x278721)[_0xc1fc('0x1f')](function(_0x2cf1c3){return _0x2cf1c3;});}return null;};}function removeEntity(_0x20c00d,_0x528900){return function(_0x474c8f){if(_0x474c8f){return _0x474c8f['destroy']()['then'](function(){_0x20c00d[_0xc1fc('0x17')](0xcc)[_0xc1fc('0x18')]();});}};}function handleEntityNotFound(_0x34aaa4,_0x3aacf2){return function(_0x214ddd){if(!_0x214ddd){_0x34aaa4[_0xc1fc('0x20')](0x194);}return _0x214ddd;};}function handleError(_0x4c4d9a,_0x4622da){_0x4622da=_0x4622da||0x1f4;return function(_0x4eccc3){logger[_0xc1fc('0x21')](_0x4eccc3[_0xc1fc('0x22')]);if(_0x4eccc3['name']){delete _0x4eccc3[_0xc1fc('0x23')];}_0x4c4d9a[_0xc1fc('0x17')](_0x4622da)[_0xc1fc('0x24')](_0x4eccc3);};}exports[_0xc1fc('0x25')]=function(_0x41810e,_0x9644db){var _0x518afd={},_0x369914={},_0x41f2a4={'count':0x0,'rows':[]};var _0xe38fb5=_['map'](db[_0xc1fc('0x26')]['rawAttributes'],function(_0x3c0da5){return{'name':_0x3c0da5[_0xc1fc('0x27')],'type':_0x3c0da5[_0xc1fc('0x28')][_0xc1fc('0x29')]};});_0x369914[_0xc1fc('0x2a')]=_[_0xc1fc('0x2b')](_0xe38fb5,'name');_0x369914[_0xc1fc('0x2c')]=_['keys'](_0x41810e[_0xc1fc('0x2c')]);_0x369914[_0xc1fc('0x2d')]=_['intersection'](_0x369914['model'],_0x369914[_0xc1fc('0x2c')]);_0x518afd['attributes']=_[_0xc1fc('0x2e')](_0x369914[_0xc1fc('0x2a')],qs['fields'](_0x41810e[_0xc1fc('0x2c')]['fields']));_0x518afd[_0xc1fc('0x2f')]=_0x518afd[_0xc1fc('0x2f')]['length']?_0x518afd[_0xc1fc('0x2f')]:_0x369914[_0xc1fc('0x2a')];if(!_0x41810e['query'][_0xc1fc('0x30')](_0xc1fc('0x31'))){_0x518afd['limit']=qs[_0xc1fc('0x32')](_0x41810e['query']['limit']);_0x518afd[_0xc1fc('0x1a')]=qs[_0xc1fc('0x1a')](_0x41810e['query'][_0xc1fc('0x1a')]);}_0x518afd[_0xc1fc('0x33')]=qs[_0xc1fc('0x34')](_0x41810e[_0xc1fc('0x2c')][_0xc1fc('0x34')]);_0x518afd[_0xc1fc('0x35')]=qs[_0xc1fc('0x2d')](_[_0xc1fc('0x36')](_0x41810e[_0xc1fc('0x2c')],_0x369914['filters']));if(_0x41810e['query'][_0xc1fc('0x37')]){_0x518afd['where']=_[_0xc1fc('0x38')](_0x518afd[_0xc1fc('0x35')],{'$or':_[_0xc1fc('0x2b')](_0xe38fb5,function(_0x33b0f1){if(_0x33b0f1['type']!=='VIRTUAL'){var _0x16e585={};_0x16e585[_0x33b0f1[_0xc1fc('0x23')]]={'$like':'%'+_0x41810e[_0xc1fc('0x2c')][_0xc1fc('0x37')]+'%'};return _0x16e585;}})});}_0x518afd=_[_0xc1fc('0x38')]({},_0x518afd,_0x41810e[_0xc1fc('0x39')]);var _0x26f130={'where':_0x518afd[_0xc1fc('0x35')]};return db['Dynamics365Field']['count'](_0x26f130)[_0xc1fc('0x1f')](function(_0x4da591){_0x41f2a4[_0xc1fc('0x3a')]=_0x4da591;if(_0x41810e['query'][_0xc1fc('0x3b')]){_0x518afd['include']=[{'all':!![]}];}return db['Dynamics365Field'][_0xc1fc('0x3c')](_0x518afd);})[_0xc1fc('0x1f')](function(_0x29d26f){_0x41f2a4['rows']=_0x29d26f;return _0x41f2a4;})['then'](respondWithFilteredResult(_0x9644db,_0x518afd))[_0xc1fc('0x3d')](handleError(_0x9644db,null));};exports['show']=function(_0x4cb6cf,_0x376d7c){var _0x2366d1={'raw':!![],'where':{'id':_0x4cb6cf['params']['id']}},_0x2e2233={};_0x2e2233['model']=_[_0xc1fc('0x3e')](db[_0xc1fc('0x26')][_0xc1fc('0x3f')]);_0x2e2233[_0xc1fc('0x2c')]=_[_0xc1fc('0x3e')](_0x4cb6cf[_0xc1fc('0x2c')]);_0x2e2233[_0xc1fc('0x2d')]=_[_0xc1fc('0x2e')](_0x2e2233[_0xc1fc('0x2a')],_0x2e2233[_0xc1fc('0x2c')]);_0x2366d1[_0xc1fc('0x2f')]=_['intersection'](_0x2e2233[_0xc1fc('0x2a')],qs[_0xc1fc('0x40')](_0x4cb6cf[_0xc1fc('0x2c')][_0xc1fc('0x40')]));_0x2366d1[_0xc1fc('0x2f')]=_0x2366d1[_0xc1fc('0x2f')][_0xc1fc('0x41')]?_0x2366d1['attributes']:_0x2e2233[_0xc1fc('0x2a')];if(_0x4cb6cf[_0xc1fc('0x2c')][_0xc1fc('0x3b')]){_0x2366d1[_0xc1fc('0x42')]=[{'all':!![]}];}_0x2366d1=_[_0xc1fc('0x38')]({},_0x2366d1,_0x4cb6cf[_0xc1fc('0x39')]);return db[_0xc1fc('0x26')][_0xc1fc('0x43')](_0x2366d1)['then'](handleEntityNotFound(_0x376d7c,null))[_0xc1fc('0x1f')](respondWithResult(_0x376d7c,null))[_0xc1fc('0x3d')](handleError(_0x376d7c,null));};exports[_0xc1fc('0x44')]=function(_0x3ba9ea,_0x567b16){return db[_0xc1fc('0x26')][_0xc1fc('0x44')](_0x3ba9ea[_0xc1fc('0x45')],{})[_0xc1fc('0x1f')](respondWithResult(_0x567b16,0xc9))[_0xc1fc('0x3d')](handleError(_0x567b16,null));};exports[_0xc1fc('0x46')]=function(_0xe76f74,_0x303d12){if(_0xe76f74[_0xc1fc('0x45')]['id']){delete _0xe76f74[_0xc1fc('0x45')]['id'];}return db[_0xc1fc('0x26')]['find']({'where':{'id':_0xe76f74[_0xc1fc('0x47')]['id']}})[_0xc1fc('0x1f')](handleEntityNotFound(_0x303d12,null))[_0xc1fc('0x1f')](saveUpdates(_0xe76f74[_0xc1fc('0x45')],null))['then'](respondWithResult(_0x303d12,null))['catch'](handleError(_0x303d12,null));};exports[_0xc1fc('0x48')]=function(_0x484c80,_0x56d25c){return db[_0xc1fc('0x26')]['find']({'where':{'id':_0x484c80[_0xc1fc('0x47')]['id']}})[_0xc1fc('0x1f')](handleEntityNotFound(_0x56d25c,null))['then'](removeEntity(_0x56d25c,null))[_0xc1fc('0x3d')](handleError(_0x56d25c,null));};
\ No newline at end of file
+var _0x6f44=['intersection','fields','attributes','hasOwnProperty','nolimit','limit','offset','order','sort','filters','pick','filter','where','VIRTUAL','merge','options','Dynamics365Field','includeAll','include','findAll','rows','catch','show','params','length','create','body','find','html-pdf','eml-format','zip-dir','fast-json-patch','request-promise','moment','bluebird','mustache','util','path','sox','ejs','lodash','squel','desk.js','to-csv','papaparse','../../components/auth/service','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/environment','../../mysqldb','sendStatus','status','json','count','set','Content-Range','apply','save','update','then','end','error','stack','name','send','index','rawAttributes','fieldName','type','key','model','map','query','keys'];(function(_0x595bd1,_0xb1e7a){var _0xd0344f=function(_0x5eb2fd){while(--_0x5eb2fd){_0x595bd1['push'](_0x595bd1['shift']());}};_0xd0344f(++_0xb1e7a);}(_0x6f44,0x1ea));var _0x46f4=function(_0x5886f0,_0x2f2ef0){_0x5886f0=_0x5886f0-0x0;var _0x132861=_0x6f44[_0x5886f0];return _0x132861;};'use strict';var pdf=require(_0x46f4('0x0'));var emlformat=require(_0x46f4('0x1'));var rimraf=require('rimraf');var zipdir=require(_0x46f4('0x2'));var jsonpatch=require(_0x46f4('0x3'));var rp=require(_0x46f4('0x4'));var moment=require(_0x46f4('0x5'));var BPromise=require(_0x46f4('0x6'));var Mustache=require(_0x46f4('0x7'));var util=require(_0x46f4('0x8'));var path=require(_0x46f4('0x9'));var sox=require(_0x46f4('0xa'));var csv=require('to-csv');var ejs=require(_0x46f4('0xb'));var fs=require('fs');var _=require(_0x46f4('0xc'));var squel=require(_0x46f4('0xd'));var crypto=require('crypto');var jsforce=require('jsforce');var deskjs=require(_0x46f4('0xe'));var toCsv=require(_0x46f4('0xf'));var querystring=require('querystring');var Papa=require(_0x46f4('0x10'));var Redis=require('ioredis');var authService=require(_0x46f4('0x11'));var qs=require('../../components/parsers/qs');var as=require(_0x46f4('0x12'));var hardwareService=require(_0x46f4('0x13'));var logger=require(_0x46f4('0x14'))(_0x46f4('0x15'));var utils=require(_0x46f4('0x16'));var config=require(_0x46f4('0x17'));var db=require(_0x46f4('0x18'))['db'];function respondWithStatusCode(_0x3c22e0,_0x21d4a6){_0x21d4a6=_0x21d4a6||0xcc;return function(_0x1f4748){if(_0x1f4748){return _0x3c22e0[_0x46f4('0x19')](_0x21d4a6);}return _0x3c22e0[_0x46f4('0x1a')](_0x21d4a6)['end']();};}function respondWithResult(_0x3b3b92,_0x33f73c){_0x33f73c=_0x33f73c||0xc8;return function(_0x52db86){if(_0x52db86){return _0x3b3b92[_0x46f4('0x1a')](_0x33f73c)[_0x46f4('0x1b')](_0x52db86);}};}function respondWithFilteredResult(_0x1a1649,_0x4dd2fb){return function(_0x3dc516){if(_0x3dc516){var _0x4e0661=_0x3dc516[_0x46f4('0x1c')],_0x4e84ce=_0x4dd2fb['offset'],_0x45917e=_0x4dd2fb['offset']+_0x4dd2fb['limit'],_0xf082a9;if(_0x45917e>=_0x4e0661){_0x45917e=_0x4e0661;_0xf082a9=0xc8;}else{_0xf082a9=0xce;}_0x1a1649['status'](_0xf082a9);return _0x1a1649[_0x46f4('0x1d')](_0x46f4('0x1e'),_0x4e84ce+'-'+_0x45917e+'/'+_0x4e0661)['json'](_0x3dc516);}return null;};}function patchUpdates(_0x22209b){return function(_0x108e6d){try{jsonpatch[_0x46f4('0x1f')](_0x108e6d,_0x22209b,!![]);}catch(_0x33521e){return BPromise['reject'](_0x33521e);}return _0x108e6d[_0x46f4('0x20')]();};}function saveUpdates(_0x390137,_0x1627db){return function(_0x6476f0){if(_0x6476f0){return _0x6476f0[_0x46f4('0x21')](_0x390137)[_0x46f4('0x22')](function(_0x47e1fa){return _0x47e1fa;});}return null;};}function removeEntity(_0x4bae60,_0x2b88d3){return function(_0x39760b){if(_0x39760b){return _0x39760b['destroy']()[_0x46f4('0x22')](function(){_0x4bae60[_0x46f4('0x1a')](0xcc)[_0x46f4('0x23')]();});}};}function handleEntityNotFound(_0x47528b,_0x36092e){return function(_0x41be5e){if(!_0x41be5e){_0x47528b[_0x46f4('0x19')](0x194);}return _0x41be5e;};}function handleError(_0x58d27d,_0x39eb2f){_0x39eb2f=_0x39eb2f||0x1f4;return function(_0x301e24){logger[_0x46f4('0x24')](_0x301e24[_0x46f4('0x25')]);if(_0x301e24[_0x46f4('0x26')]){delete _0x301e24['name'];}_0x58d27d[_0x46f4('0x1a')](_0x39eb2f)[_0x46f4('0x27')](_0x301e24);};}exports[_0x46f4('0x28')]=function(_0x30d302,_0x57eb00){var _0x33a7c5={},_0x531aef={},_0x13573d={'count':0x0,'rows':[]};var _0x552ab0=_['map'](db['Dynamics365Field'][_0x46f4('0x29')],function(_0x57ff78){return{'name':_0x57ff78[_0x46f4('0x2a')],'type':_0x57ff78[_0x46f4('0x2b')][_0x46f4('0x2c')]};});_0x531aef[_0x46f4('0x2d')]=_[_0x46f4('0x2e')](_0x552ab0,'name');_0x531aef[_0x46f4('0x2f')]=_[_0x46f4('0x30')](_0x30d302[_0x46f4('0x2f')]);_0x531aef['filters']=_[_0x46f4('0x31')](_0x531aef[_0x46f4('0x2d')],_0x531aef[_0x46f4('0x2f')]);_0x33a7c5['attributes']=_['intersection'](_0x531aef[_0x46f4('0x2d')],qs[_0x46f4('0x32')](_0x30d302[_0x46f4('0x2f')]['fields']));_0x33a7c5[_0x46f4('0x33')]=_0x33a7c5[_0x46f4('0x33')]['length']?_0x33a7c5[_0x46f4('0x33')]:_0x531aef['model'];if(!_0x30d302[_0x46f4('0x2f')][_0x46f4('0x34')](_0x46f4('0x35'))){_0x33a7c5[_0x46f4('0x36')]=qs[_0x46f4('0x36')](_0x30d302['query'][_0x46f4('0x36')]);_0x33a7c5[_0x46f4('0x37')]=qs['offset'](_0x30d302[_0x46f4('0x2f')][_0x46f4('0x37')]);}_0x33a7c5[_0x46f4('0x38')]=qs[_0x46f4('0x39')](_0x30d302['query'][_0x46f4('0x39')]);_0x33a7c5['where']=qs[_0x46f4('0x3a')](_[_0x46f4('0x3b')](_0x30d302[_0x46f4('0x2f')],_0x531aef[_0x46f4('0x3a')]));if(_0x30d302['query'][_0x46f4('0x3c')]){_0x33a7c5['where']=_['merge'](_0x33a7c5[_0x46f4('0x3d')],{'$or':_['map'](_0x552ab0,function(_0x520f05){if(_0x520f05[_0x46f4('0x2b')]!==_0x46f4('0x3e')){var _0x5ed740={};_0x5ed740[_0x520f05[_0x46f4('0x26')]]={'$like':'%'+_0x30d302['query'][_0x46f4('0x3c')]+'%'};return _0x5ed740;}})});}_0x33a7c5=_[_0x46f4('0x3f')]({},_0x33a7c5,_0x30d302[_0x46f4('0x40')]);var _0x3735d3={'where':_0x33a7c5['where']};return db[_0x46f4('0x41')][_0x46f4('0x1c')](_0x3735d3)[_0x46f4('0x22')](function(_0x5e22ba){_0x13573d['count']=_0x5e22ba;if(_0x30d302['query'][_0x46f4('0x42')]){_0x33a7c5[_0x46f4('0x43')]=[{'all':!![]}];}return db[_0x46f4('0x41')][_0x46f4('0x44')](_0x33a7c5);})['then'](function(_0x448f42){_0x13573d[_0x46f4('0x45')]=_0x448f42;return _0x13573d;})[_0x46f4('0x22')](respondWithFilteredResult(_0x57eb00,_0x33a7c5))[_0x46f4('0x46')](handleError(_0x57eb00,null));};exports[_0x46f4('0x47')]=function(_0x4b2de4,_0xe86eae){var _0x306400={'raw':!![],'where':{'id':_0x4b2de4[_0x46f4('0x48')]['id']}},_0x297cf9={};_0x297cf9[_0x46f4('0x2d')]=_['keys'](db['Dynamics365Field']['rawAttributes']);_0x297cf9[_0x46f4('0x2f')]=_[_0x46f4('0x30')](_0x4b2de4[_0x46f4('0x2f')]);_0x297cf9['filters']=_[_0x46f4('0x31')](_0x297cf9[_0x46f4('0x2d')],_0x297cf9[_0x46f4('0x2f')]);_0x306400[_0x46f4('0x33')]=_[_0x46f4('0x31')](_0x297cf9[_0x46f4('0x2d')],qs[_0x46f4('0x32')](_0x4b2de4[_0x46f4('0x2f')][_0x46f4('0x32')]));_0x306400[_0x46f4('0x33')]=_0x306400[_0x46f4('0x33')][_0x46f4('0x49')]?_0x306400[_0x46f4('0x33')]:_0x297cf9['model'];if(_0x4b2de4[_0x46f4('0x2f')][_0x46f4('0x42')]){_0x306400[_0x46f4('0x43')]=[{'all':!![]}];}_0x306400=_[_0x46f4('0x3f')]({},_0x306400,_0x4b2de4[_0x46f4('0x40')]);return db[_0x46f4('0x41')]['find'](_0x306400)['then'](handleEntityNotFound(_0xe86eae,null))['then'](respondWithResult(_0xe86eae,null))[_0x46f4('0x46')](handleError(_0xe86eae,null));};exports[_0x46f4('0x4a')]=function(_0x20698d,_0x19b357){return db[_0x46f4('0x41')][_0x46f4('0x4a')](_0x20698d[_0x46f4('0x4b')],{})[_0x46f4('0x22')](respondWithResult(_0x19b357,0xc9))[_0x46f4('0x46')](handleError(_0x19b357,null));};exports[_0x46f4('0x21')]=function(_0x21319d,_0x1d1513){if(_0x21319d['body']['id']){delete _0x21319d[_0x46f4('0x4b')]['id'];}return db[_0x46f4('0x41')][_0x46f4('0x4c')]({'where':{'id':_0x21319d['params']['id']}})['then'](handleEntityNotFound(_0x1d1513,null))[_0x46f4('0x22')](saveUpdates(_0x21319d[_0x46f4('0x4b')],null))[_0x46f4('0x22')](respondWithResult(_0x1d1513,null))['catch'](handleError(_0x1d1513,null));};exports['destroy']=function(_0x11f959,_0x1e3551){return db[_0x46f4('0x41')][_0x46f4('0x4c')]({'where':{'id':_0x11f959[_0x46f4('0x48')]['id']}})[_0x46f4('0x22')](handleEntityNotFound(_0x1e3551,null))['then'](removeEntity(_0x1e3551,null))[_0x46f4('0x46')](handleError(_0x1e3551,null));};
\ No newline at end of file
diff --git a/server/api/intDynamics365Field/intDynamics365Field.model.js b/server/api/intDynamics365Field/intDynamics365Field.model.js
index 03519fa..dbb4e94 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 _0x1076=['bluebird','request-promise','path','rimraf','../../config/environment','./intDynamics365Field.attributes','exports','define','Dynamics365Field','int_dynamics365_fields','dynamics365_unique_index','lodash','../../config/logger','api'];(function(_0x5a27b3,_0x2baa42){var _0x115a14=function(_0x241ef2){while(--_0x241ef2){_0x5a27b3['push'](_0x5a27b3['shift']());}};_0x115a14(++_0x2baa42);}(_0x1076,0xc1));var _0x6107=function(_0x21549c,_0x6d64d1){_0x21549c=_0x21549c-0x0;var _0x426cbd=_0x1076[_0x21549c];return _0x426cbd;};'use strict';var _=require(_0x6107('0x0'));var util=require('util');var logger=require(_0x6107('0x1'))(_0x6107('0x2'));var moment=require('moment');var BPromise=require(_0x6107('0x3'));var rp=require(_0x6107('0x4'));var fs=require('fs');var path=require(_0x6107('0x5'));var rimraf=require(_0x6107('0x6'));var config=require(_0x6107('0x7'));var attributes=require(_0x6107('0x8'));module[_0x6107('0x9')]=function(_0xf2340c,_0x585c82){return _0xf2340c[_0x6107('0xa')](_0x6107('0xb'),attributes,{'tableName':_0x6107('0xc'),'paranoid':![],'indexes':[{'name':_0x6107('0xd'),'fields':['idField','FieldId'],'unique':!![]}],'timestamps':!![]});};
\ No newline at end of file
+var _0x4bdf=['../../config/logger','api','moment','bluebird','request-promise','path','rimraf','../../config/environment','./intDynamics365Field.attributes','exports','define','Dynamics365Field','int_dynamics365_fields','dynamics365_unique_index','lodash','util'];(function(_0x43a5c7,_0x2286bf){var _0x3b12a2=function(_0x1f8f53){while(--_0x1f8f53){_0x43a5c7['push'](_0x43a5c7['shift']());}};_0x3b12a2(++_0x2286bf);}(_0x4bdf,0x1be));var _0xf4bd=function(_0xaaa4df,_0x77d473){_0xaaa4df=_0xaaa4df-0x0;var _0x166419=_0x4bdf[_0xaaa4df];return _0x166419;};'use strict';var _=require(_0xf4bd('0x0'));var util=require(_0xf4bd('0x1'));var logger=require(_0xf4bd('0x2'))(_0xf4bd('0x3'));var moment=require(_0xf4bd('0x4'));var BPromise=require(_0xf4bd('0x5'));var rp=require(_0xf4bd('0x6'));var fs=require('fs');var path=require(_0xf4bd('0x7'));var rimraf=require(_0xf4bd('0x8'));var config=require(_0xf4bd('0x9'));var attributes=require(_0xf4bd('0xa'));module[_0xf4bd('0xb')]=function(_0xb9702d,_0x225fdb){return _0xb9702d[_0xf4bd('0xc')](_0xf4bd('0xd'),attributes,{'tableName':_0xf4bd('0xe'),'paranoid':![],'indexes':[{'name':_0xf4bd('0xf'),'fields':['idField','FieldId'],'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 df0b7b5..9f194d3 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 _0x8085=['client','http','request','then','info','Dynamics365Field,\x20%s,\x20%s','request\x20sent','debug','Dynamics365Field,\x20%s,\x20%s,\x20%s','error','code','message','result','lodash','bluebird','randomstring','ioredis','../../mysqldb','rpc','../../config/environment'];(function(_0x4bc4c8,_0x3139d3){var _0x3bb121=function(_0x95ad12){while(--_0x95ad12){_0x4bc4c8['push'](_0x4bc4c8['shift']());}};_0x3bb121(++_0x3139d3);}(_0x8085,0x71));var _0x5808=function(_0x58c20f,_0x4cdb1b){_0x58c20f=_0x58c20f-0x0;var _0x3b0318=_0x8085[_0x58c20f];return _0x3b0318;};'use strict';var _=require(_0x5808('0x0'));var util=require('util');var moment=require('moment');var BPromise=require(_0x5808('0x1'));var rs=require(_0x5808('0x2'));var fs=require('fs');var Redis=require(_0x5808('0x3'));var db=require(_0x5808('0x4'))['db'];var utils=require('../../config/utils');var logger=require('../../config/logger')(_0x5808('0x5'));var config=require(_0x5808('0x6'));var jayson=require('jayson/promise');var client=jayson[_0x5808('0x7')][_0x5808('0x8')]({'port':0x232a});function respondWithRpcPromise(_0x39458f,_0x2d204e,_0x2a9716){return new BPromise(function(_0x5b30b9,_0x30e63c){return client[_0x5808('0x9')](_0x39458f,_0x2a9716)[_0x5808('0xa')](function(_0x447811){logger[_0x5808('0xb')](_0x5808('0xc'),_0x2d204e,_0x5808('0xd'));logger[_0x5808('0xe')](_0x5808('0xf'),_0x2d204e,'request\x20sent',JSON['stringify'](_0x447811));if(_0x447811[_0x5808('0x10')]){if(_0x447811[_0x5808('0x10')][_0x5808('0x11')]===0x1f4){logger[_0x5808('0x10')](_0x5808('0xc'),_0x2d204e,_0x447811[_0x5808('0x10')][_0x5808('0x12')]);return _0x30e63c(_0x447811['error']['message']);}logger[_0x5808('0x10')](_0x5808('0xc'),_0x2d204e,_0x447811[_0x5808('0x10')][_0x5808('0x12')]);return _0x5b30b9(_0x447811[_0x5808('0x10')][_0x5808('0x12')]);}else{logger[_0x5808('0xb')](_0x5808('0xc'),_0x2d204e,_0x5808('0xd'));_0x5b30b9(_0x447811[_0x5808('0x13')][_0x5808('0x12')]);}})['catch'](function(_0x3342ae){logger['error'](_0x5808('0xc'),_0x2d204e,_0x3342ae);_0x30e63c(_0x3342ae);});});}
\ No newline at end of file
+var _0xbb67=['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','result','catch','util','moment','bluebird','randomstring','ioredis','../../config/utils','../../config/logger'];(function(_0x4475c5,_0x27b79c){var _0x3aec71=function(_0x3f3bb8){while(--_0x3f3bb8){_0x4475c5['push'](_0x4475c5['shift']());}};_0x3aec71(++_0x27b79c);}(_0xbb67,0x161));var _0x7bb6=function(_0x22b95a,_0x23d8b1){_0x22b95a=_0x22b95a-0x0;var _0xda8e7b=_0xbb67[_0x22b95a];return _0xda8e7b;};'use strict';var _=require('lodash');var util=require(_0x7bb6('0x0'));var moment=require(_0x7bb6('0x1'));var BPromise=require(_0x7bb6('0x2'));var rs=require(_0x7bb6('0x3'));var fs=require('fs');var Redis=require(_0x7bb6('0x4'));var db=require('../../mysqldb')['db'];var utils=require(_0x7bb6('0x5'));var logger=require(_0x7bb6('0x6'))(_0x7bb6('0x7'));var config=require(_0x7bb6('0x8'));var jayson=require(_0x7bb6('0x9'));var client=jayson[_0x7bb6('0xa')][_0x7bb6('0xb')]({'port':0x232a});function respondWithRpcPromise(_0x2a059b,_0x5f1898,_0x45441a){return new BPromise(function(_0x15fb32,_0x214244){return client[_0x7bb6('0xc')](_0x2a059b,_0x45441a)[_0x7bb6('0xd')](function(_0x168bb6){logger[_0x7bb6('0xe')](_0x7bb6('0xf'),_0x5f1898,_0x7bb6('0x10'));logger['debug'](_0x7bb6('0x11'),_0x5f1898,_0x7bb6('0x10'),JSON[_0x7bb6('0x12')](_0x168bb6));if(_0x168bb6[_0x7bb6('0x13')]){if(_0x168bb6[_0x7bb6('0x13')][_0x7bb6('0x14')]===0x1f4){logger[_0x7bb6('0x13')](_0x7bb6('0xf'),_0x5f1898,_0x168bb6[_0x7bb6('0x13')]['message']);return _0x214244(_0x168bb6['error'][_0x7bb6('0x15')]);}logger[_0x7bb6('0x13')]('Dynamics365Field,\x20%s,\x20%s',_0x5f1898,_0x168bb6[_0x7bb6('0x13')][_0x7bb6('0x15')]);return _0x15fb32(_0x168bb6[_0x7bb6('0x13')][_0x7bb6('0x15')]);}else{logger[_0x7bb6('0xe')](_0x7bb6('0xf'),_0x5f1898,'request\x20sent');_0x15fb32(_0x168bb6[_0x7bb6('0x16')][_0x7bb6('0x15')]);}})[_0x7bb6('0x17')](function(_0x4095a1){logger[_0x7bb6('0x13')](_0x7bb6('0xf'),_0x5f1898,_0x4095a1);_0x214244(_0x4095a1);});});}
\ No newline at end of file
diff --git a/server/api/intFreshdeskAccount/index.js b/server/api/intFreshdeskAccount/index.js
index 6ba6d4c..705e3f3 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 _0x8f0c=['index','show','/:id/configurations','getConfigurations','/:id/fields','getFields','post','create','addConfiguration','put','/:id','update','delete','destroy','exports','multer','util','path','connect-timeout','express','Router','../../components/auth/service','./intFreshdeskAccount.controller','get','isAuthenticated'];(function(_0x40a045,_0x516f0e){var _0x1a687c=function(_0x48c9fe){while(--_0x48c9fe){_0x40a045['push'](_0x40a045['shift']());}};_0x1a687c(++_0x516f0e);}(_0x8f0c,0x1b8));var _0xc8f0=function(_0x10dfdf,_0x36b623){_0x10dfdf=_0x10dfdf-0x0;var _0x4d857d=_0x8f0c[_0x10dfdf];return _0x4d857d;};'use strict';var multer=require(_0xc8f0('0x0'));var util=require(_0xc8f0('0x1'));var path=require(_0xc8f0('0x2'));var timeout=require(_0xc8f0('0x3'));var express=require(_0xc8f0('0x4'));var router=express[_0xc8f0('0x5')]();var auth=require(_0xc8f0('0x6'));var interaction=require('../../components/interaction/service');var config=require('../../config/environment');var controller=require(_0xc8f0('0x7'));router[_0xc8f0('0x8')]('/',auth[_0xc8f0('0x9')](),controller[_0xc8f0('0xa')]);router[_0xc8f0('0x8')]('/:id',auth[_0xc8f0('0x9')](),controller[_0xc8f0('0xb')]);router['get'](_0xc8f0('0xc'),auth[_0xc8f0('0x9')](),controller[_0xc8f0('0xd')]);router[_0xc8f0('0x8')](_0xc8f0('0xe'),auth[_0xc8f0('0x9')](),controller[_0xc8f0('0xf')]);router[_0xc8f0('0x10')]('/',auth[_0xc8f0('0x9')](),controller[_0xc8f0('0x11')]);router[_0xc8f0('0x10')]('/:id/configurations',auth[_0xc8f0('0x9')](),controller[_0xc8f0('0x12')]);router[_0xc8f0('0x13')](_0xc8f0('0x14'),auth[_0xc8f0('0x9')](),controller[_0xc8f0('0x15')]);router[_0xc8f0('0x16')](_0xc8f0('0x14'),auth[_0xc8f0('0x9')](),controller[_0xc8f0('0x17')]);module[_0xc8f0('0x18')]=router;
\ No newline at end of file
+var _0x41be=['delete','exports','multer','util','express','Router','../../components/interaction/service','../../config/environment','./intFreshdeskAccount.controller','get','isAuthenticated','index','/:id','/:id/fields','getFields','post','create','/:id/configurations','put','update'];(function(_0x203f65,_0x322710){var _0x148b03=function(_0x406d03){while(--_0x406d03){_0x203f65['push'](_0x203f65['shift']());}};_0x148b03(++_0x322710);}(_0x41be,0xa2));var _0xe41b=function(_0x53afe9,_0x2c9f40){_0x53afe9=_0x53afe9-0x0;var _0x396396=_0x41be[_0x53afe9];return _0x396396;};'use strict';var multer=require(_0xe41b('0x0'));var util=require(_0xe41b('0x1'));var path=require('path');var timeout=require('connect-timeout');var express=require(_0xe41b('0x2'));var router=express[_0xe41b('0x3')]();var auth=require('../../components/auth/service');var interaction=require(_0xe41b('0x4'));var config=require(_0xe41b('0x5'));var controller=require(_0xe41b('0x6'));router[_0xe41b('0x7')]('/',auth[_0xe41b('0x8')](),controller[_0xe41b('0x9')]);router[_0xe41b('0x7')](_0xe41b('0xa'),auth[_0xe41b('0x8')](),controller['show']);router['get']('/:id/configurations',auth[_0xe41b('0x8')](),controller['getConfigurations']);router['get'](_0xe41b('0xb'),auth[_0xe41b('0x8')](),controller[_0xe41b('0xc')]);router[_0xe41b('0xd')]('/',auth[_0xe41b('0x8')](),controller[_0xe41b('0xe')]);router[_0xe41b('0xd')](_0xe41b('0xf'),auth['isAuthenticated'](),controller['addConfiguration']);router[_0xe41b('0x10')]('/:id',auth[_0xe41b('0x8')](),controller[_0xe41b('0x11')]);router[_0xe41b('0x12')](_0xe41b('0xa'),auth[_0xe41b('0x8')](),controller['destroy']);module[_0xe41b('0x13')]=router;
\ No newline at end of file
diff --git a/server/api/intFreshdeskAccount/intFreshdeskAccount.attributes.js b/server/api/intFreshdeskAccount/intFreshdeskAccount.attributes.js
index 59ed824..6adfeff 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 _0x01d3=['username','remoteUri','sequelize','exports','STRING'];(function(_0x4b2aa8,_0x46e6ac){var _0x1e3672=function(_0x447958){while(--_0x447958){_0x4b2aa8['push'](_0x4b2aa8['shift']());}};_0x1e3672(++_0x46e6ac);}(_0x01d3,0xa2));var _0x301d=function(_0x2a7e10,_0x190fd2){_0x2a7e10=_0x2a7e10-0x0;var _0x213fdf=_0x01d3[_0x2a7e10];return _0x213fdf;};'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
+var _0xc891=['STRING','username','sequelize'];(function(_0x4fb425,_0x1e8c0e){var _0x3a1ff8=function(_0x5f213a){while(--_0x5f213a){_0x4fb425['push'](_0x4fb425['shift']());}};_0x3a1ff8(++_0x1e8c0e);}(_0xc891,0x152));var _0x1c89=function(_0x491a7f,_0x28bb80){_0x491a7f=_0x491a7f-0x0;var _0x3d8f44=_0xc891[_0x491a7f];return _0x3d8f44;};'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/intFreshdeskAccount/intFreshdeskAccount.controller.js b/server/api/intFreshdeskAccount/intFreshdeskAccount.controller.js
index d02bf2e..8051d78 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 _0x5c09=['FreshdeskField','getFields','apiKey','remoteUri','slice','GET','format','%s/%s','api/v2/ticket_fields','Basic\x20%s','%s:X','toString','base64','subject','agent','priority','source','ticket_type','company','remove','default','custom_dropdown','choices','capitalize','statusCode','getFields,\x20%s,\x20%s,\x20%s','Wrong\x20credentials','html-pdf','eml-format','rimraf','zip-dir','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/advancedSearch','../../config/license/hardware','../../config/logger','api','../../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','info','FreshdeskAccount,\x20%s,\x20%s','request\x20sent','debug','stringify','error','code','message','catch','status','end','json','count','offset','set','Content-Range','apply','reject','save','update','sendStatus','name','send','FreshdeskAccount','rawAttributes','fieldName','key','model','query','filters','attributes','intersection','fields','hasOwnProperty','nolimit','limit','order','sort','where','pick','filter','type','VIRTUAL','options','includeAll','rows','show','keys','length','include','merge','create','body','params','destroy','find','getConfigurations','findOne','map','addConfiguration','AccountId','Subjects','getSubjects','channel','Descriptions','getDescriptions'];(function(_0xb1d903,_0x2f36f4){var _0xfc370f=function(_0x2b78d0){while(--_0x2b78d0){_0xb1d903['push'](_0xb1d903['shift']());}};_0xfc370f(++_0x2f36f4);}(_0x5c09,0x9c));var _0x95c0=function(_0x19ada2,_0xdf7a43){_0x19ada2=_0x19ada2-0x0;var _0x29cbd4=_0x5c09[_0x19ada2];return _0x29cbd4;};'use strict';var pdf=require(_0x95c0('0x0'));var emlformat=require(_0x95c0('0x1'));var rimraf=require(_0x95c0('0x2'));var zipdir=require(_0x95c0('0x3'));var jsonpatch=require(_0x95c0('0x4'));var rp=require(_0x95c0('0x5'));var moment=require(_0x95c0('0x6'));var BPromise=require(_0x95c0('0x7'));var Mustache=require(_0x95c0('0x8'));var util=require(_0x95c0('0x9'));var path=require(_0x95c0('0xa'));var sox=require(_0x95c0('0xb'));var csv=require(_0x95c0('0xc'));var ejs=require('ejs');var fs=require('fs');var _=require(_0x95c0('0xd'));var squel=require(_0x95c0('0xe'));var crypto=require(_0x95c0('0xf'));var jsforce=require('jsforce');var deskjs=require(_0x95c0('0x10'));var toCsv=require('to-csv');var querystring=require(_0x95c0('0x11'));var Papa=require(_0x95c0('0x12'));var Redis=require('ioredis');var authService=require(_0x95c0('0x13'));var qs=require('../../components/parsers/qs');var as=require(_0x95c0('0x14'));var hardwareService=require(_0x95c0('0x15'));var logger=require(_0x95c0('0x16'))(_0x95c0('0x17'));var utils=require(_0x95c0('0x18'));var config=require(_0x95c0('0x19'));var db=require(_0x95c0('0x1a'))['db'];var integrations=require(_0x95c0('0x1b'));var jayson=require(_0x95c0('0x1c'));var client=jayson[_0x95c0('0x1d')]['http']({'port':0x232a});function checkPasswordPattern(_0xe04288,_0x4911ca,_0x469db9){if(_0x469db9){var _0x288570=new RegExp(/(?=.*[a-z])(?=.*[A-Z])(?=.*[0-9])(?=.*[?!@#\$%\^&\*~\-_=+[{\]\}])(?=.{8,})/);if(_0x288570[_0x95c0('0x1e')](_0x4911ca)){return _0xe04288;}else{throw new db[(_0x95c0('0x1f'))][(_0x95c0('0x20'))](_0x95c0('0x21'));}}else{return _0xe04288;}}function respondWithRpcPromise(_0x18961c,_0x583f4b,_0x5b1642,_0xcceeda){return new BPromise(function(_0x16ed0a,_0x5ab9e9){var _0x318829=_0xcceeda||client;return _0x318829[_0x95c0('0x22')](_0x18961c,_0x5b1642)[_0x95c0('0x23')](function(_0x45646a){logger[_0x95c0('0x24')](_0x95c0('0x25'),_0x583f4b,_0x95c0('0x26'));logger[_0x95c0('0x27')]('FreshdeskAccount,\x20%s,\x20%s,\x20%s',_0x583f4b,'request\x20sent',JSON[_0x95c0('0x28')](_0x45646a));if(_0x45646a[_0x95c0('0x29')]){if(_0x45646a[_0x95c0('0x29')][_0x95c0('0x2a')]===0x1f4){logger[_0x95c0('0x29')](_0x95c0('0x25'),_0x583f4b,_0x45646a['error'][_0x95c0('0x2b')]);return _0x5ab9e9(_0x45646a[_0x95c0('0x29')][_0x95c0('0x2b')]);}logger[_0x95c0('0x29')](_0x95c0('0x25'),_0x583f4b,_0x45646a[_0x95c0('0x29')]['message']);return _0x16ed0a(_0x45646a[_0x95c0('0x29')][_0x95c0('0x2b')]);}else{logger[_0x95c0('0x24')](_0x95c0('0x25'),_0x583f4b,'request\x20sent');_0x16ed0a(_0x45646a['result'][_0x95c0('0x2b')]);}})[_0x95c0('0x2c')](function(_0x563cd0){logger[_0x95c0('0x29')]('FreshdeskAccount,\x20%s,\x20%s',_0x583f4b,_0x563cd0);_0x5ab9e9(_0x563cd0);});});}function respondWithStatusCode(_0x450c00,_0x45dfa7){_0x45dfa7=_0x45dfa7||0xcc;return function(_0x2b419e){if(_0x2b419e){return _0x450c00['sendStatus'](_0x45dfa7);}return _0x450c00[_0x95c0('0x2d')](_0x45dfa7)[_0x95c0('0x2e')]();};}function respondWithResult(_0x160659,_0x46d34a){_0x46d34a=_0x46d34a||0xc8;return function(_0x535b9e){if(_0x535b9e){return _0x160659[_0x95c0('0x2d')](_0x46d34a)[_0x95c0('0x2f')](_0x535b9e);}};}function respondWithFilteredResult(_0x40130b,_0xbafaae){return function(_0x5241b2){if(_0x5241b2){var _0x211119=_0x5241b2[_0x95c0('0x30')],_0x1f32b9=_0xbafaae[_0x95c0('0x31')],_0x528a09=_0xbafaae['offset']+_0xbafaae['limit'],_0x33293c;if(_0x528a09>=_0x211119){_0x528a09=_0x211119;_0x33293c=0xc8;}else{_0x33293c=0xce;}_0x40130b['status'](_0x33293c);return _0x40130b[_0x95c0('0x32')](_0x95c0('0x33'),_0x1f32b9+'-'+_0x528a09+'/'+_0x211119)['json'](_0x5241b2);}return null;};}function patchUpdates(_0x2d138e){return function(_0x27c8a5){try{jsonpatch[_0x95c0('0x34')](_0x27c8a5,_0x2d138e,!![]);}catch(_0x22ff71){return BPromise[_0x95c0('0x35')](_0x22ff71);}return _0x27c8a5[_0x95c0('0x36')]();};}function saveUpdates(_0x4ad950,_0x2905f6){return function(_0x2eada1){if(_0x2eada1){return _0x2eada1[_0x95c0('0x37')](_0x4ad950)[_0x95c0('0x23')](function(_0x2e07c2){return _0x2e07c2;});}return null;};}function removeEntity(_0xfeab5e,_0x38fe27){return function(_0x46b672){if(_0x46b672){return _0x46b672['destroy']()[_0x95c0('0x23')](function(){_0xfeab5e[_0x95c0('0x2d')](0xcc)[_0x95c0('0x2e')]();});}};}function handleEntityNotFound(_0x1412d2,_0x3180c6){return function(_0x421f4b){if(!_0x421f4b){_0x1412d2[_0x95c0('0x38')](0x194);}return _0x421f4b;};}function handleError(_0x423699,_0x151fe9){_0x151fe9=_0x151fe9||0x1f4;return function(_0x2e1070){logger['error'](_0x2e1070['stack']);if(_0x2e1070[_0x95c0('0x39')]){delete _0x2e1070[_0x95c0('0x39')];}_0x423699[_0x95c0('0x2d')](_0x151fe9)[_0x95c0('0x3a')](_0x2e1070);};}exports['index']=function(_0x2c6f8c,_0x5a92fb){var _0xc7cec7={},_0x1a1c9a={},_0x190137={'count':0x0,'rows':[]};var _0x575acc=_['map'](db[_0x95c0('0x3b')][_0x95c0('0x3c')],function(_0x4a71fd){return{'name':_0x4a71fd[_0x95c0('0x3d')],'type':_0x4a71fd['type'][_0x95c0('0x3e')]};});_0x1a1c9a[_0x95c0('0x3f')]=_['map'](_0x575acc,_0x95c0('0x39'));_0x1a1c9a[_0x95c0('0x40')]=_['keys'](_0x2c6f8c['query']);_0x1a1c9a[_0x95c0('0x41')]=_['intersection'](_0x1a1c9a[_0x95c0('0x3f')],_0x1a1c9a[_0x95c0('0x40')]);_0xc7cec7[_0x95c0('0x42')]=_[_0x95c0('0x43')](_0x1a1c9a[_0x95c0('0x3f')],qs[_0x95c0('0x44')](_0x2c6f8c[_0x95c0('0x40')]['fields']));_0xc7cec7[_0x95c0('0x42')]=_0xc7cec7[_0x95c0('0x42')]['length']?_0xc7cec7['attributes']:_0x1a1c9a[_0x95c0('0x3f')];if(!_0x2c6f8c['query'][_0x95c0('0x45')](_0x95c0('0x46'))){_0xc7cec7['limit']=qs[_0x95c0('0x47')](_0x2c6f8c[_0x95c0('0x40')]['limit']);_0xc7cec7['offset']=qs['offset'](_0x2c6f8c['query'][_0x95c0('0x31')]);}_0xc7cec7[_0x95c0('0x48')]=qs[_0x95c0('0x49')](_0x2c6f8c['query'][_0x95c0('0x49')]);_0xc7cec7[_0x95c0('0x4a')]=qs[_0x95c0('0x41')](_[_0x95c0('0x4b')](_0x2c6f8c['query'],_0x1a1c9a[_0x95c0('0x41')]));if(_0x2c6f8c[_0x95c0('0x40')][_0x95c0('0x4c')]){_0xc7cec7[_0x95c0('0x4a')]=_['merge'](_0xc7cec7['where'],{'$or':_['map'](_0x575acc,function(_0x468569){if(_0x468569[_0x95c0('0x4d')]!==_0x95c0('0x4e')){var _0x53bb3d={};_0x53bb3d[_0x468569['name']]={'$like':'%'+_0x2c6f8c[_0x95c0('0x40')][_0x95c0('0x4c')]+'%'};return _0x53bb3d;}})});}_0xc7cec7=_['merge']({},_0xc7cec7,_0x2c6f8c[_0x95c0('0x4f')]);var _0x204b77={'where':_0xc7cec7[_0x95c0('0x4a')]};return db[_0x95c0('0x3b')][_0x95c0('0x30')](_0x204b77)['then'](function(_0x181643){_0x190137[_0x95c0('0x30')]=_0x181643;if(_0x2c6f8c[_0x95c0('0x40')][_0x95c0('0x50')]){_0xc7cec7['include']=[{'all':!![]}];}return db[_0x95c0('0x3b')]['findAll'](_0xc7cec7);})[_0x95c0('0x23')](function(_0x386c07){_0x190137[_0x95c0('0x51')]=_0x386c07;return _0x190137;})['then'](respondWithFilteredResult(_0x5a92fb,_0xc7cec7))[_0x95c0('0x2c')](handleError(_0x5a92fb,null));};exports[_0x95c0('0x52')]=function(_0x27b078,_0x382801){var _0x19d116={'raw':![],'where':{'id':_0x27b078['params']['id']}},_0x2095af={};_0x2095af[_0x95c0('0x3f')]=_[_0x95c0('0x53')](db[_0x95c0('0x3b')][_0x95c0('0x3c')]);_0x2095af[_0x95c0('0x40')]=_[_0x95c0('0x53')](_0x27b078['query']);_0x2095af['filters']=_[_0x95c0('0x43')](_0x2095af['model'],_0x2095af['query']);_0x19d116[_0x95c0('0x42')]=_[_0x95c0('0x43')](_0x2095af[_0x95c0('0x3f')],qs[_0x95c0('0x44')](_0x27b078[_0x95c0('0x40')][_0x95c0('0x44')]));_0x19d116['attributes']=_0x19d116[_0x95c0('0x42')][_0x95c0('0x54')]?_0x19d116[_0x95c0('0x42')]:_0x2095af[_0x95c0('0x3f')];if(_0x27b078[_0x95c0('0x40')][_0x95c0('0x50')]){_0x19d116[_0x95c0('0x55')]=[{'all':!![]}];}_0x19d116=_[_0x95c0('0x56')]({},_0x19d116,_0x27b078[_0x95c0('0x4f')]);return db['FreshdeskAccount']['find'](_0x19d116)[_0x95c0('0x23')](handleEntityNotFound(_0x382801,null))['then'](respondWithResult(_0x382801,null))[_0x95c0('0x2c')](handleError(_0x382801,null));};exports[_0x95c0('0x57')]=function(_0x246fdd,_0x52d1d5){return db[_0x95c0('0x3b')]['create'](_0x246fdd[_0x95c0('0x58')],{})['then'](respondWithResult(_0x52d1d5,0xc9))['catch'](handleError(_0x52d1d5,null));};exports[_0x95c0('0x37')]=function(_0x2d222f,_0x1909aa){if(_0x2d222f[_0x95c0('0x58')]['id']){delete _0x2d222f[_0x95c0('0x58')]['id'];}return db[_0x95c0('0x3b')]['find']({'where':{'id':_0x2d222f[_0x95c0('0x59')]['id']}})['then'](handleEntityNotFound(_0x1909aa,null))['then'](saveUpdates(_0x2d222f[_0x95c0('0x58')],null))[_0x95c0('0x23')](respondWithResult(_0x1909aa,null))[_0x95c0('0x2c')](handleError(_0x1909aa,null));};exports[_0x95c0('0x5a')]=function(_0x46bf20,_0xd3c108){return db[_0x95c0('0x3b')][_0x95c0('0x5b')]({'where':{'id':_0x46bf20[_0x95c0('0x59')]['id']}})[_0x95c0('0x23')](handleEntityNotFound(_0xd3c108,null))[_0x95c0('0x23')](removeEntity(_0xd3c108,null))[_0x95c0('0x2c')](handleError(_0xd3c108,null));};exports[_0x95c0('0x5c')]=function(_0x10070c,_0x301995,_0x496e2e){var _0x562712={};var _0x48daed={};var _0x5dbe3d;var _0x5b57b1;return db[_0x95c0('0x3b')][_0x95c0('0x5d')]({'where':{'id':_0x10070c['params']['id']}})[_0x95c0('0x23')](handleEntityNotFound(_0x301995,null))['then'](function(_0x2a8a1b){if(_0x2a8a1b){_0x5dbe3d=_0x2a8a1b;_0x48daed[_0x95c0('0x3f')]=_[_0x95c0('0x53')](db['FreshdeskConfiguration'][_0x95c0('0x3c')]);_0x48daed[_0x95c0('0x40')]=_[_0x95c0('0x53')](_0x10070c[_0x95c0('0x40')]);_0x48daed[_0x95c0('0x41')]=_['intersection'](_0x48daed[_0x95c0('0x3f')],_0x48daed['query']);_0x562712[_0x95c0('0x42')]=_[_0x95c0('0x43')](_0x48daed[_0x95c0('0x3f')],qs[_0x95c0('0x44')](_0x10070c['query'][_0x95c0('0x44')]));_0x562712[_0x95c0('0x42')]=_0x562712['attributes'][_0x95c0('0x54')]?_0x562712[_0x95c0('0x42')]:_0x48daed[_0x95c0('0x3f')];_0x562712[_0x95c0('0x48')]=qs[_0x95c0('0x49')](_0x10070c[_0x95c0('0x40')][_0x95c0('0x49')]);_0x562712[_0x95c0('0x4a')]=qs['filters'](_[_0x95c0('0x4b')](_0x10070c[_0x95c0('0x40')],_0x48daed['filters']));if(_0x10070c['query'][_0x95c0('0x4c')]){_0x562712['where']=_[_0x95c0('0x56')](_0x562712[_0x95c0('0x4a')],{'$or':_[_0x95c0('0x5e')](_0x562712[_0x95c0('0x42')],function(_0x482677){var _0x326358={};_0x326358[_0x482677]={'$like':'%'+_0x10070c[_0x95c0('0x40')][_0x95c0('0x4c')]+'%'};return _0x326358;})});}_0x562712=_[_0x95c0('0x56')]({},_0x562712,_0x10070c['options']);return _0x5dbe3d['getConfigurations'](_0x562712);}})[_0x95c0('0x23')](function(_0x3c33b4){if(_0x3c33b4){_0x5b57b1=_0x3c33b4[_0x95c0('0x54')];if(!_0x10070c['query'][_0x95c0('0x45')](_0x95c0('0x46'))){_0x562712[_0x95c0('0x47')]=qs[_0x95c0('0x47')](_0x10070c[_0x95c0('0x40')][_0x95c0('0x47')]);_0x562712[_0x95c0('0x31')]=qs['offset'](_0x10070c[_0x95c0('0x40')][_0x95c0('0x31')]);}return _0x5dbe3d[_0x95c0('0x5c')](_0x562712);}})[_0x95c0('0x23')](function(_0x412c70){if(_0x412c70){return _0x412c70?{'count':_0x5b57b1,'rows':_0x412c70}:null;}})[_0x95c0('0x23')](respondWithResult(_0x301995,null))[_0x95c0('0x2c')](handleError(_0x301995,null));};exports[_0x95c0('0x5f')]=function(_0x2501d8,_0x32ec03,_0x577b9b){if(_0x2501d8[_0x95c0('0x58')]['id']){delete _0x2501d8[_0x95c0('0x58')]['id'];}return db[_0x95c0('0x3b')][_0x95c0('0x5d')]({'where':{'id':_0x2501d8[_0x95c0('0x59')]['id']}})[_0x95c0('0x23')](handleEntityNotFound(_0x32ec03,null))[_0x95c0('0x23')](function(_0x4892cd){if(_0x4892cd){_0x2501d8[_0x95c0('0x58')][_0x95c0('0x60')]=_0x4892cd['id'];_0x2501d8[_0x95c0('0x58')][_0x95c0('0x61')]=integrations[_0x95c0('0x62')](_0x2501d8['body'][_0x95c0('0x63')],_0x2501d8[_0x95c0('0x58')][_0x95c0('0x4d')]);_0x2501d8[_0x95c0('0x58')][_0x95c0('0x64')]=integrations[_0x95c0('0x65')](_0x2501d8[_0x95c0('0x58')][_0x95c0('0x63')],_0x2501d8[_0x95c0('0x58')][_0x95c0('0x4d')]);return db['FreshdeskConfiguration']['create'](_0x2501d8[_0x95c0('0x58')],{'include':[{'model':db[_0x95c0('0x66')],'as':_0x95c0('0x61')},{'model':db['FreshdeskField'],'as':'Descriptions'}]});}return null;})[_0x95c0('0x23')](respondWithResult(_0x32ec03,null))['catch'](handleError(_0x32ec03,null));};exports[_0x95c0('0x67')]=function(_0x31897c,_0x485f15,_0x5992de){var _0x28fb9e='';return db[_0x95c0('0x3b')]['findOne']({'where':{'id':_0x31897c[_0x95c0('0x59')]['id']},'attributes':['id','remoteUri',_0x95c0('0x68')]})[_0x95c0('0x23')](handleEntityNotFound(_0x485f15,null))[_0x95c0('0x23')](function(_0x556755){if(_0x556755){_0x28fb9e=_0x556755[_0x95c0('0x69')];var _0x29b7ba=_0x28fb9e[_0x95c0('0x6a')](-0x1);if(_0x29b7ba==='/'){_0x28fb9e=_0x28fb9e['substring'](0x0,_0x28fb9e['lastIndexOf'](_0x29b7ba));}return rp({'method':_0x95c0('0x6b'),'uri':util[_0x95c0('0x6c')](_0x95c0('0x6d'),_0x28fb9e,_0x95c0('0x6e')),'headers':{'Authorization':util['format'](_0x95c0('0x6f'),new Buffer(util[_0x95c0('0x6c')](_0x95c0('0x70'),_0x556755[_0x95c0('0x68')]))[_0x95c0('0x71')](_0x95c0('0x72')))},'json':!![]});}})[_0x95c0('0x23')](function(_0xf636ef){if(_0xf636ef){var _0x5d397d=['requester',_0x95c0('0x73'),_0x95c0('0x74'),'description',_0x95c0('0x2d'),_0x95c0('0x75'),'group',_0x95c0('0x76'),_0x95c0('0x77'),'group',_0x95c0('0x78')];_[_0x95c0('0x79')](_0xf636ef,function(_0x37639b){return _0x5d397d['includes'](_0x37639b[_0x95c0('0x39')])||!_0x37639b[_0x95c0('0x7a')]&&_0x37639b[_0x95c0('0x4d')]!=='custom_text'&&_0x37639b['type']!==_0x95c0('0x7b');});return{'count':_0xf636ef['length'],'rows':_['map'](_0xf636ef,function(_0x5bec66){return{'id':_0x5bec66[_0x95c0('0x39')],'name':_0x5bec66['label'],'custom':!_0x5bec66[_0x95c0('0x7a')],'options':_0x5bec66[_0x95c0('0x7c')]?_[_0x95c0('0x5e')](_0x5bec66[_0x95c0('0x7c')],function(_0x57ad43){return{'name':_[_0x95c0('0x7d')](_0x57ad43),'value':_0x57ad43};}):[]};})};}})[_0x95c0('0x23')](respondWithResult(_0x485f15,null))[_0x95c0('0x2c')](function(_0x1b7498){var _0x1fa664=_0x31897c[_0x95c0('0x40')][_0x95c0('0x1e')]?0x1f4:_0x1b7498[_0x95c0('0x7e')]||0x1f4;logger[_0x95c0('0x29')](_0x95c0('0x7f'),_0x95c0('0x67'),_0x1fa664,JSON[_0x95c0('0x28')](_0x1b7498));delete _0x1b7498['name'];if(_0x1fa664===0x191){_0x1fa664=0x190;}_0x485f15[_0x95c0('0x2d')](_0x1fa664)[_0x95c0('0x3a')](_0x31897c['query'][_0x95c0('0x1e')]?{'message':_0x95c0('0x80'),'statusCode':_0x1b7498['statusCode']}:_0x1b7498);});};
\ No newline at end of file
+var _0x1106=['filter','map','VIRTUAL','merge','include','findAll','rows','rawAttributes','intersection','includeAll','options','find','create','body','params','getConfigurations','findOne','FreshdeskConfiguration','addConfiguration','AccountId','Subjects','Descriptions','getDescriptions','FreshdeskField','getFields','remoteUri','apiKey','slice','substring','lastIndexOf','GET','format','%s/%s','Basic\x20%s','%s:X','base64','subject','agent','priority','group','source','company','remove','includes','custom_text','custom_dropdown','label','default','capitalize','Wrong\x20credentials','statusCode','html-pdf','eml-format','rimraf','fast-json-patch','request-promise','moment','bluebird','mustache','path','to-csv','ejs','lodash','jsforce','desk.js','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/environment','../../components/integrations/configuration','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','FreshdeskAccount,\x20%s,\x20%s','debug','FreshdeskAccount,\x20%s,\x20%s,\x20%s','request\x20sent','stringify','error','code','message','info','result','catch','sendStatus','end','status','json','count','offset','limit','set','reject','save','update','destroy','then','name','send','index','FreshdeskAccount','fieldName','type','model','query','keys','attributes','fields','length','hasOwnProperty','nolimit','order','sort','where','pick','filters'];(function(_0x1b5a05,_0x2c80de){var _0x347931=function(_0xd39454){while(--_0xd39454){_0x1b5a05['push'](_0x1b5a05['shift']());}};_0x347931(++_0x2c80de);}(_0x1106,0xb0));var _0x6110=function(_0x151b4b,_0x1dd44f){_0x151b4b=_0x151b4b-0x0;var _0x175eaa=_0x1106[_0x151b4b];return _0x175eaa;};'use strict';var pdf=require(_0x6110('0x0'));var emlformat=require(_0x6110('0x1'));var rimraf=require(_0x6110('0x2'));var zipdir=require('zip-dir');var jsonpatch=require(_0x6110('0x3'));var rp=require(_0x6110('0x4'));var moment=require(_0x6110('0x5'));var BPromise=require(_0x6110('0x6'));var Mustache=require(_0x6110('0x7'));var util=require('util');var path=require(_0x6110('0x8'));var sox=require('sox');var csv=require(_0x6110('0x9'));var ejs=require(_0x6110('0xa'));var fs=require('fs');var _=require(_0x6110('0xb'));var squel=require('squel');var crypto=require('crypto');var jsforce=require(_0x6110('0xc'));var deskjs=require(_0x6110('0xd'));var toCsv=require('to-csv');var querystring=require('querystring');var Papa=require('papaparse');var Redis=require(_0x6110('0xe'));var authService=require(_0x6110('0xf'));var qs=require(_0x6110('0x10'));var as=require(_0x6110('0x11'));var hardwareService=require(_0x6110('0x12'));var logger=require(_0x6110('0x13'))(_0x6110('0x14'));var utils=require(_0x6110('0x15'));var config=require(_0x6110('0x16'));var db=require('../../mysqldb')['db'];var integrations=require(_0x6110('0x17'));var jayson=require(_0x6110('0x18'));var client=jayson[_0x6110('0x19')][_0x6110('0x1a')]({'port':0x232a});function checkPasswordPattern(_0x57bd61,_0x47090a,_0x3ac26b){if(_0x3ac26b){var _0x53193f=new RegExp(/(?=.*[a-z])(?=.*[A-Z])(?=.*[0-9])(?=.*[?!@#\$%\^&\*~\-_=+[{\]\}])(?=.{8,})/);if(_0x53193f[_0x6110('0x1b')](_0x47090a)){return _0x57bd61;}else{throw new db[(_0x6110('0x1c'))]['ValidationError'](_0x6110('0x1d'));}}else{return _0x57bd61;}}function respondWithRpcPromise(_0x6e8924,_0x5e2050,_0x511fc2,_0x182f67){return new BPromise(function(_0x9cf5f5,_0x2a5bb3){var _0x1e0a6c=_0x182f67||client;return _0x1e0a6c[_0x6110('0x1e')](_0x6e8924,_0x511fc2)['then'](function(_0x45ed81){logger['info'](_0x6110('0x1f'),_0x5e2050,'request\x20sent');logger[_0x6110('0x20')](_0x6110('0x21'),_0x5e2050,_0x6110('0x22'),JSON[_0x6110('0x23')](_0x45ed81));if(_0x45ed81[_0x6110('0x24')]){if(_0x45ed81[_0x6110('0x24')][_0x6110('0x25')]===0x1f4){logger[_0x6110('0x24')](_0x6110('0x1f'),_0x5e2050,_0x45ed81[_0x6110('0x24')][_0x6110('0x26')]);return _0x2a5bb3(_0x45ed81[_0x6110('0x24')][_0x6110('0x26')]);}logger[_0x6110('0x24')](_0x6110('0x1f'),_0x5e2050,_0x45ed81[_0x6110('0x24')]['message']);return _0x9cf5f5(_0x45ed81[_0x6110('0x24')][_0x6110('0x26')]);}else{logger[_0x6110('0x27')](_0x6110('0x1f'),_0x5e2050,'request\x20sent');_0x9cf5f5(_0x45ed81[_0x6110('0x28')]['message']);}})[_0x6110('0x29')](function(_0x46abe8){logger[_0x6110('0x24')](_0x6110('0x1f'),_0x5e2050,_0x46abe8);_0x2a5bb3(_0x46abe8);});});}function respondWithStatusCode(_0x1ae93e,_0x4d77eb){_0x4d77eb=_0x4d77eb||0xcc;return function(_0x20e42c){if(_0x20e42c){return _0x1ae93e[_0x6110('0x2a')](_0x4d77eb);}return _0x1ae93e['status'](_0x4d77eb)[_0x6110('0x2b')]();};}function respondWithResult(_0x166143,_0xe9e281){_0xe9e281=_0xe9e281||0xc8;return function(_0xb771c0){if(_0xb771c0){return _0x166143[_0x6110('0x2c')](_0xe9e281)[_0x6110('0x2d')](_0xb771c0);}};}function respondWithFilteredResult(_0x16d292,_0x9fed17){return function(_0x5deba6){if(_0x5deba6){var _0xc370b2=_0x5deba6[_0x6110('0x2e')],_0x2788bb=_0x9fed17['offset'],_0x497c40=_0x9fed17[_0x6110('0x2f')]+_0x9fed17[_0x6110('0x30')],_0x2b3089;if(_0x497c40>=_0xc370b2){_0x497c40=_0xc370b2;_0x2b3089=0xc8;}else{_0x2b3089=0xce;}_0x16d292[_0x6110('0x2c')](_0x2b3089);return _0x16d292[_0x6110('0x31')]('Content-Range',_0x2788bb+'-'+_0x497c40+'/'+_0xc370b2)['json'](_0x5deba6);}return null;};}function patchUpdates(_0x37241c){return function(_0x5d0601){try{jsonpatch['apply'](_0x5d0601,_0x37241c,!![]);}catch(_0x3b4c9a){return BPromise[_0x6110('0x32')](_0x3b4c9a);}return _0x5d0601[_0x6110('0x33')]();};}function saveUpdates(_0xb4ef3b,_0xe897ed){return function(_0x5cc7b9){if(_0x5cc7b9){return _0x5cc7b9[_0x6110('0x34')](_0xb4ef3b)['then'](function(_0x1ff53a){return _0x1ff53a;});}return null;};}function removeEntity(_0x233009,_0x5b309c){return function(_0x22ab74){if(_0x22ab74){return _0x22ab74[_0x6110('0x35')]()[_0x6110('0x36')](function(){_0x233009[_0x6110('0x2c')](0xcc)[_0x6110('0x2b')]();});}};}function handleEntityNotFound(_0x568f2d,_0x5c8601){return function(_0x845a10){if(!_0x845a10){_0x568f2d[_0x6110('0x2a')](0x194);}return _0x845a10;};}function handleError(_0x134273,_0xd361ee){_0xd361ee=_0xd361ee||0x1f4;return function(_0x37c592){logger[_0x6110('0x24')](_0x37c592['stack']);if(_0x37c592[_0x6110('0x37')]){delete _0x37c592['name'];}_0x134273['status'](_0xd361ee)[_0x6110('0x38')](_0x37c592);};}exports[_0x6110('0x39')]=function(_0x2a306a,_0x6de1cb){var _0x14d6d7={},_0x2db9fb={},_0x200971={'count':0x0,'rows':[]};var _0x1c0bf6=_['map'](db[_0x6110('0x3a')]['rawAttributes'],function(_0x307fc0){return{'name':_0x307fc0[_0x6110('0x3b')],'type':_0x307fc0[_0x6110('0x3c')]['key']};});_0x2db9fb[_0x6110('0x3d')]=_['map'](_0x1c0bf6,_0x6110('0x37'));_0x2db9fb[_0x6110('0x3e')]=_[_0x6110('0x3f')](_0x2a306a[_0x6110('0x3e')]);_0x2db9fb['filters']=_['intersection'](_0x2db9fb[_0x6110('0x3d')],_0x2db9fb[_0x6110('0x3e')]);_0x14d6d7[_0x6110('0x40')]=_['intersection'](_0x2db9fb[_0x6110('0x3d')],qs['fields'](_0x2a306a['query'][_0x6110('0x41')]));_0x14d6d7['attributes']=_0x14d6d7['attributes'][_0x6110('0x42')]?_0x14d6d7[_0x6110('0x40')]:_0x2db9fb['model'];if(!_0x2a306a['query'][_0x6110('0x43')](_0x6110('0x44'))){_0x14d6d7['limit']=qs['limit'](_0x2a306a[_0x6110('0x3e')][_0x6110('0x30')]);_0x14d6d7[_0x6110('0x2f')]=qs['offset'](_0x2a306a['query'][_0x6110('0x2f')]);}_0x14d6d7[_0x6110('0x45')]=qs[_0x6110('0x46')](_0x2a306a[_0x6110('0x3e')][_0x6110('0x46')]);_0x14d6d7[_0x6110('0x47')]=qs['filters'](_[_0x6110('0x48')](_0x2a306a[_0x6110('0x3e')],_0x2db9fb[_0x6110('0x49')]));if(_0x2a306a[_0x6110('0x3e')][_0x6110('0x4a')]){_0x14d6d7[_0x6110('0x47')]=_['merge'](_0x14d6d7['where'],{'$or':_[_0x6110('0x4b')](_0x1c0bf6,function(_0x4bfa08){if(_0x4bfa08['type']!==_0x6110('0x4c')){var _0xa95c59={};_0xa95c59[_0x4bfa08[_0x6110('0x37')]]={'$like':'%'+_0x2a306a['query'][_0x6110('0x4a')]+'%'};return _0xa95c59;}})});}_0x14d6d7=_[_0x6110('0x4d')]({},_0x14d6d7,_0x2a306a['options']);var _0x58a189={'where':_0x14d6d7[_0x6110('0x47')]};return db['FreshdeskAccount'][_0x6110('0x2e')](_0x58a189)['then'](function(_0x245e48){_0x200971[_0x6110('0x2e')]=_0x245e48;if(_0x2a306a[_0x6110('0x3e')]['includeAll']){_0x14d6d7[_0x6110('0x4e')]=[{'all':!![]}];}return db[_0x6110('0x3a')][_0x6110('0x4f')](_0x14d6d7);})['then'](function(_0x230e6a){_0x200971[_0x6110('0x50')]=_0x230e6a;return _0x200971;})[_0x6110('0x36')](respondWithFilteredResult(_0x6de1cb,_0x14d6d7))['catch'](handleError(_0x6de1cb,null));};exports['show']=function(_0x4a8818,_0x5cc654){var _0x28c887={'raw':![],'where':{'id':_0x4a8818['params']['id']}},_0x2d321a={};_0x2d321a[_0x6110('0x3d')]=_['keys'](db['FreshdeskAccount'][_0x6110('0x51')]);_0x2d321a[_0x6110('0x3e')]=_[_0x6110('0x3f')](_0x4a8818['query']);_0x2d321a[_0x6110('0x49')]=_[_0x6110('0x52')](_0x2d321a[_0x6110('0x3d')],_0x2d321a[_0x6110('0x3e')]);_0x28c887[_0x6110('0x40')]=_[_0x6110('0x52')](_0x2d321a[_0x6110('0x3d')],qs[_0x6110('0x41')](_0x4a8818[_0x6110('0x3e')][_0x6110('0x41')]));_0x28c887[_0x6110('0x40')]=_0x28c887['attributes'][_0x6110('0x42')]?_0x28c887[_0x6110('0x40')]:_0x2d321a[_0x6110('0x3d')];if(_0x4a8818[_0x6110('0x3e')][_0x6110('0x53')]){_0x28c887['include']=[{'all':!![]}];}_0x28c887=_[_0x6110('0x4d')]({},_0x28c887,_0x4a8818[_0x6110('0x54')]);return db[_0x6110('0x3a')][_0x6110('0x55')](_0x28c887)[_0x6110('0x36')](handleEntityNotFound(_0x5cc654,null))['then'](respondWithResult(_0x5cc654,null))[_0x6110('0x29')](handleError(_0x5cc654,null));};exports[_0x6110('0x56')]=function(_0xb2245b,_0x4fbd71){return db[_0x6110('0x3a')][_0x6110('0x56')](_0xb2245b[_0x6110('0x57')],{})[_0x6110('0x36')](respondWithResult(_0x4fbd71,0xc9))[_0x6110('0x29')](handleError(_0x4fbd71,null));};exports['update']=function(_0x463535,_0x46228d){if(_0x463535[_0x6110('0x57')]['id']){delete _0x463535[_0x6110('0x57')]['id'];}return db[_0x6110('0x3a')][_0x6110('0x55')]({'where':{'id':_0x463535[_0x6110('0x58')]['id']}})[_0x6110('0x36')](handleEntityNotFound(_0x46228d,null))[_0x6110('0x36')](saveUpdates(_0x463535[_0x6110('0x57')],null))['then'](respondWithResult(_0x46228d,null))['catch'](handleError(_0x46228d,null));};exports[_0x6110('0x35')]=function(_0x5056d7,_0x59d235){return db[_0x6110('0x3a')][_0x6110('0x55')]({'where':{'id':_0x5056d7[_0x6110('0x58')]['id']}})[_0x6110('0x36')](handleEntityNotFound(_0x59d235,null))[_0x6110('0x36')](removeEntity(_0x59d235,null))[_0x6110('0x29')](handleError(_0x59d235,null));};exports[_0x6110('0x59')]=function(_0x161542,_0x238efa,_0x988f51){var _0xc2c064={};var _0x518723={};var _0x75a951;var _0x5d9d4d;return db[_0x6110('0x3a')][_0x6110('0x5a')]({'where':{'id':_0x161542[_0x6110('0x58')]['id']}})['then'](handleEntityNotFound(_0x238efa,null))[_0x6110('0x36')](function(_0x5b356a){if(_0x5b356a){_0x75a951=_0x5b356a;_0x518723[_0x6110('0x3d')]=_[_0x6110('0x3f')](db[_0x6110('0x5b')]['rawAttributes']);_0x518723['query']=_[_0x6110('0x3f')](_0x161542[_0x6110('0x3e')]);_0x518723[_0x6110('0x49')]=_[_0x6110('0x52')](_0x518723['model'],_0x518723[_0x6110('0x3e')]);_0xc2c064[_0x6110('0x40')]=_[_0x6110('0x52')](_0x518723['model'],qs[_0x6110('0x41')](_0x161542['query']['fields']));_0xc2c064['attributes']=_0xc2c064[_0x6110('0x40')][_0x6110('0x42')]?_0xc2c064[_0x6110('0x40')]:_0x518723[_0x6110('0x3d')];_0xc2c064[_0x6110('0x45')]=qs[_0x6110('0x46')](_0x161542[_0x6110('0x3e')][_0x6110('0x46')]);_0xc2c064[_0x6110('0x47')]=qs[_0x6110('0x49')](_[_0x6110('0x48')](_0x161542[_0x6110('0x3e')],_0x518723[_0x6110('0x49')]));if(_0x161542[_0x6110('0x3e')][_0x6110('0x4a')]){_0xc2c064['where']=_[_0x6110('0x4d')](_0xc2c064[_0x6110('0x47')],{'$or':_[_0x6110('0x4b')](_0xc2c064['attributes'],function(_0x47351f){var _0x33ba90={};_0x33ba90[_0x47351f]={'$like':'%'+_0x161542[_0x6110('0x3e')][_0x6110('0x4a')]+'%'};return _0x33ba90;})});}_0xc2c064=_['merge']({},_0xc2c064,_0x161542[_0x6110('0x54')]);return _0x75a951[_0x6110('0x59')](_0xc2c064);}})[_0x6110('0x36')](function(_0xef4437){if(_0xef4437){_0x5d9d4d=_0xef4437['length'];if(!_0x161542[_0x6110('0x3e')]['hasOwnProperty'](_0x6110('0x44'))){_0xc2c064[_0x6110('0x30')]=qs[_0x6110('0x30')](_0x161542[_0x6110('0x3e')][_0x6110('0x30')]);_0xc2c064[_0x6110('0x2f')]=qs[_0x6110('0x2f')](_0x161542[_0x6110('0x3e')][_0x6110('0x2f')]);}return _0x75a951['getConfigurations'](_0xc2c064);}})[_0x6110('0x36')](function(_0x2bbe9a){if(_0x2bbe9a){return _0x2bbe9a?{'count':_0x5d9d4d,'rows':_0x2bbe9a}:null;}})[_0x6110('0x36')](respondWithResult(_0x238efa,null))[_0x6110('0x29')](handleError(_0x238efa,null));};exports[_0x6110('0x5c')]=function(_0x1f8b9c,_0x647f02,_0x4f4908){if(_0x1f8b9c[_0x6110('0x57')]['id']){delete _0x1f8b9c[_0x6110('0x57')]['id'];}return db['FreshdeskAccount'][_0x6110('0x5a')]({'where':{'id':_0x1f8b9c['params']['id']}})[_0x6110('0x36')](handleEntityNotFound(_0x647f02,null))['then'](function(_0x13930d){if(_0x13930d){_0x1f8b9c[_0x6110('0x57')][_0x6110('0x5d')]=_0x13930d['id'];_0x1f8b9c[_0x6110('0x57')][_0x6110('0x5e')]=integrations['getSubjects'](_0x1f8b9c['body']['channel'],_0x1f8b9c[_0x6110('0x57')][_0x6110('0x3c')]);_0x1f8b9c[_0x6110('0x57')][_0x6110('0x5f')]=integrations[_0x6110('0x60')](_0x1f8b9c[_0x6110('0x57')]['channel'],_0x1f8b9c[_0x6110('0x57')][_0x6110('0x3c')]);return db['FreshdeskConfiguration']['create'](_0x1f8b9c[_0x6110('0x57')],{'include':[{'model':db[_0x6110('0x61')],'as':'Subjects'},{'model':db[_0x6110('0x61')],'as':_0x6110('0x5f')}]});}return null;})['then'](respondWithResult(_0x647f02,null))['catch'](handleError(_0x647f02,null));};exports[_0x6110('0x62')]=function(_0x567479,_0x54ec4e,_0x35c45c){var _0x472b3b='';return db[_0x6110('0x3a')]['findOne']({'where':{'id':_0x567479['params']['id']},'attributes':['id',_0x6110('0x63'),_0x6110('0x64')]})[_0x6110('0x36')](handleEntityNotFound(_0x54ec4e,null))[_0x6110('0x36')](function(_0x590a88){if(_0x590a88){_0x472b3b=_0x590a88[_0x6110('0x63')];var _0xda7386=_0x472b3b[_0x6110('0x65')](-0x1);if(_0xda7386==='/'){_0x472b3b=_0x472b3b[_0x6110('0x66')](0x0,_0x472b3b[_0x6110('0x67')](_0xda7386));}return rp({'method':_0x6110('0x68'),'uri':util[_0x6110('0x69')](_0x6110('0x6a'),_0x472b3b,'api/v2/ticket_fields'),'headers':{'Authorization':util['format'](_0x6110('0x6b'),new Buffer(util[_0x6110('0x69')](_0x6110('0x6c'),_0x590a88[_0x6110('0x64')]))['toString'](_0x6110('0x6d')))},'json':!![]});}})[_0x6110('0x36')](function(_0x1bb1a8){if(_0x1bb1a8){var _0xd6a059=['requester',_0x6110('0x6e'),_0x6110('0x6f'),'description',_0x6110('0x2c'),_0x6110('0x70'),_0x6110('0x71'),_0x6110('0x72'),'ticket_type',_0x6110('0x71'),_0x6110('0x73')];_[_0x6110('0x74')](_0x1bb1a8,function(_0x33f635){return _0xd6a059[_0x6110('0x75')](_0x33f635['name'])||!_0x33f635['default']&&_0x33f635[_0x6110('0x3c')]!==_0x6110('0x76')&&_0x33f635[_0x6110('0x3c')]!==_0x6110('0x77');});return{'count':_0x1bb1a8['length'],'rows':_['map'](_0x1bb1a8,function(_0x610f44){return{'id':_0x610f44[_0x6110('0x37')],'name':_0x610f44[_0x6110('0x78')],'custom':!_0x610f44[_0x6110('0x79')],'options':_0x610f44['choices']?_[_0x6110('0x4b')](_0x610f44['choices'],function(_0x40dfec){return{'name':_[_0x6110('0x7a')](_0x40dfec),'value':_0x40dfec};}):[]};})};}})['then'](respondWithResult(_0x54ec4e,null))['catch'](function(_0xc1a787){var _0x27841d=_0x567479[_0x6110('0x3e')][_0x6110('0x1b')]?0x1f4:_0xc1a787['statusCode']||0x1f4;logger[_0x6110('0x24')]('getFields,\x20%s,\x20%s,\x20%s','getFields',_0x27841d,JSON[_0x6110('0x23')](_0xc1a787));delete _0xc1a787[_0x6110('0x37')];if(_0x27841d===0x191){_0x27841d=0x190;}_0x54ec4e['status'](_0x27841d)[_0x6110('0x38')](_0x567479[_0x6110('0x3e')][_0x6110('0x1b')]?{'message':_0x6110('0x7b'),'statusCode':_0xc1a787[_0x6110('0x7c')]}:_0xc1a787);});};
\ No newline at end of file
diff --git a/server/api/intFreshdeskAccount/intFreshdeskAccount.model.js b/server/api/intFreshdeskAccount/intFreshdeskAccount.model.js
index a5dc708..16b30ae 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 _0x9dbb=['bluebird','request-promise','path','rimraf','../../config/environment','./intFreshdeskAccount.attributes','../../components/integrations/configuration','define','FreshdeskAccount','lodash','util','../../config/logger','api'];(function(_0x29f98b,_0xb86421){var _0x2245ca=function(_0x50b741){while(--_0x50b741){_0x29f98b['push'](_0x29f98b['shift']());}};_0x2245ca(++_0xb86421);}(_0x9dbb,0x175));var _0xb9db=function(_0x4f3056,_0xe685f6){_0x4f3056=_0x4f3056-0x0;var _0x2b8af0=_0x9dbb[_0x4f3056];return _0x2b8af0;};'use strict';var _=require(_0xb9db('0x0'));var util=require(_0xb9db('0x1'));var logger=require(_0xb9db('0x2'))(_0xb9db('0x3'));var moment=require('moment');var BPromise=require(_0xb9db('0x4'));var rp=require(_0xb9db('0x5'));var fs=require('fs');var path=require(_0xb9db('0x6'));var rimraf=require(_0xb9db('0x7'));var config=require(_0xb9db('0x8'));var attributes=require(_0xb9db('0x9'));var integrations=require(_0xb9db('0xa'));module['exports']=function(_0x10e33c,_0x499306){return _0x10e33c[_0xb9db('0xb')](_0xb9db('0xc'),attributes,{'tableName':'int_freshdesk_accounts','paranoid':![],'indexes':[],'timestamps':!![]});};
\ No newline at end of file
+var _0x04ff=['int_freshdesk_accounts','lodash','util','../../config/logger','api','moment','bluebird','request-promise','path','rimraf','../../config/environment','./intFreshdeskAccount.attributes','define'];(function(_0x24f4ee,_0x21a959){var _0x4c2f97=function(_0x23a41a){while(--_0x23a41a){_0x24f4ee['push'](_0x24f4ee['shift']());}};_0x4c2f97(++_0x21a959);}(_0x04ff,0x153));var _0xf04f=function(_0x549a2c,_0x13bd03){_0x549a2c=_0x549a2c-0x0;var _0x16b56b=_0x04ff[_0x549a2c];return _0x16b56b;};'use strict';var _=require(_0xf04f('0x0'));var util=require(_0xf04f('0x1'));var logger=require(_0xf04f('0x2'))(_0xf04f('0x3'));var moment=require(_0xf04f('0x4'));var BPromise=require(_0xf04f('0x5'));var rp=require(_0xf04f('0x6'));var fs=require('fs');var path=require(_0xf04f('0x7'));var rimraf=require(_0xf04f('0x8'));var config=require(_0xf04f('0x9'));var attributes=require(_0xf04f('0xa'));var integrations=require('../../components/integrations/configuration');module['exports']=function(_0x2acb40,_0x26809e){return _0x2acb40[_0xf04f('0xb')]('FreshdeskAccount',attributes,{'tableName':_0xf04f('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 488c1bf..0d7182f 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 _0xcf6a=['ioredis','../../config/utils','rpc','../../config/environment','client','http','FreshdeskAccount,\x20%s,\x20%s','request\x20sent','debug','FreshdeskAccount,\x20%s,\x20%s,\x20%s','stringify','error','message','info','result','catch','GetFreshdeskAccount','FreshdeskAccount','findAll','options','raw','where','attributes','limit','include','map','model','then','ShowFreshdeskAccount','lodash','util','moment','bluebird','randomstring'];(function(_0x58dc25,_0x49b9d5){var _0x21b0a7=function(_0x38a186){while(--_0x38a186){_0x58dc25['push'](_0x58dc25['shift']());}};_0x21b0a7(++_0x49b9d5);}(_0xcf6a,0x1b5));var _0xacf6=function(_0xc4001c,_0x1bf8f0){_0xc4001c=_0xc4001c-0x0;var _0x49f7bc=_0xcf6a[_0xc4001c];return _0x49f7bc;};'use strict';var _=require(_0xacf6('0x0'));var util=require(_0xacf6('0x1'));var moment=require(_0xacf6('0x2'));var BPromise=require(_0xacf6('0x3'));var rs=require(_0xacf6('0x4'));var fs=require('fs');var Redis=require(_0xacf6('0x5'));var db=require('../../mysqldb')['db'];var utils=require(_0xacf6('0x6'));var logger=require('../../config/logger')(_0xacf6('0x7'));var config=require(_0xacf6('0x8'));var jayson=require('jayson/promise');var client=jayson[_0xacf6('0x9')][_0xacf6('0xa')]({'port':0x232a});function respondWithRpcPromise(_0x42e76d,_0x593d5c,_0x3474d2){return new BPromise(function(_0x2c395b,_0x12905e){return client['request'](_0x42e76d,_0x3474d2)['then'](function(_0x252eb3){logger['info'](_0xacf6('0xb'),_0x593d5c,_0xacf6('0xc'));logger[_0xacf6('0xd')](_0xacf6('0xe'),_0x593d5c,'request\x20sent',JSON[_0xacf6('0xf')](_0x252eb3));if(_0x252eb3[_0xacf6('0x10')]){if(_0x252eb3[_0xacf6('0x10')]['code']===0x1f4){logger[_0xacf6('0x10')]('FreshdeskAccount,\x20%s,\x20%s',_0x593d5c,_0x252eb3[_0xacf6('0x10')]['message']);return _0x12905e(_0x252eb3['error'][_0xacf6('0x11')]);}logger[_0xacf6('0x10')](_0xacf6('0xb'),_0x593d5c,_0x252eb3['error']['message']);return _0x2c395b(_0x252eb3[_0xacf6('0x10')][_0xacf6('0x11')]);}else{logger[_0xacf6('0x12')]('FreshdeskAccount,\x20%s,\x20%s',_0x593d5c,_0xacf6('0xc'));_0x2c395b(_0x252eb3[_0xacf6('0x13')][_0xacf6('0x11')]);}})[_0xacf6('0x14')](function(_0x53ff90){logger[_0xacf6('0x10')](_0xacf6('0xb'),_0x593d5c,_0x53ff90);_0x12905e(_0x53ff90);});});}exports[_0xacf6('0x15')]=function(_0x28f52f){var _0x81e965=this;return new Promise(function(_0x4a4f6d,_0x2f8cfe){return db[_0xacf6('0x16')][_0xacf6('0x17')]({'raw':_0x28f52f[_0xacf6('0x18')]?_0x28f52f[_0xacf6('0x18')][_0xacf6('0x19')]===undefined?!![]:![]:!![],'where':_0x28f52f[_0xacf6('0x18')]?_0x28f52f[_0xacf6('0x18')][_0xacf6('0x1a')]||null:null,'attributes':_0x28f52f['options']?_0x28f52f[_0xacf6('0x18')][_0xacf6('0x1b')]||null:null,'limit':_0x28f52f[_0xacf6('0x18')]?_0x28f52f[_0xacf6('0x18')][_0xacf6('0x1c')]||null:null,'include':_0x28f52f[_0xacf6('0x18')]?_0x28f52f[_0xacf6('0x18')][_0xacf6('0x1d')]?_[_0xacf6('0x1e')](_0x28f52f[_0xacf6('0x18')]['include'],function(_0x3587f6){return{'model':db[_0x3587f6['model']],'as':_0x3587f6['as'],'attributes':_0x3587f6[_0xacf6('0x1b')],'include':_0x3587f6[_0xacf6('0x1d')]?_[_0xacf6('0x1e')](_0x3587f6[_0xacf6('0x1d')],function(_0x342512){return{'model':db[_0x342512['model']],'as':_0x342512['as'],'attributes':_0x342512[_0xacf6('0x1b')],'include':_0x342512[_0xacf6('0x1d')]?_[_0xacf6('0x1e')](_0x342512[_0xacf6('0x1d')],function(_0x35ddb9){return{'model':db[_0x35ddb9[_0xacf6('0x1f')]],'as':_0x35ddb9['as'],'attributes':_0x35ddb9[_0xacf6('0x1b')]};}):[]};}):[]};}):[]:[]})[_0xacf6('0x20')](function(_0x5ae8cd){logger['info'](_0xacf6('0x15'),_0x28f52f);logger[_0xacf6('0xd')](_0xacf6('0x15'),_0x28f52f,JSON[_0xacf6('0xf')](_0x5ae8cd));_0x4a4f6d(_0x5ae8cd);})[_0xacf6('0x14')](function(_0x3d7861){logger['error'](_0xacf6('0x15'),_0x3d7861['message'],_0x28f52f);_0x2f8cfe(_0x81e965[_0xacf6('0x10')](0x1f4,_0x3d7861[_0xacf6('0x11')]));});});};exports[_0xacf6('0x21')]=function(_0x49c045){var _0x357dd0=this;return new Promise(function(_0x27b9b7,_0x7482be){return db[_0xacf6('0x16')]['find']({'raw':_0x49c045[_0xacf6('0x18')]?_0x49c045[_0xacf6('0x18')][_0xacf6('0x19')]===undefined?!![]:![]:!![],'where':_0x49c045[_0xacf6('0x18')]?_0x49c045[_0xacf6('0x18')]['where']||null:null,'attributes':_0x49c045['options']?_0x49c045[_0xacf6('0x18')][_0xacf6('0x1b')]||null:null,'include':_0x49c045[_0xacf6('0x18')]?_0x49c045['options']['include']?_[_0xacf6('0x1e')](_0x49c045['options'][_0xacf6('0x1d')],function(_0x35f4ce){return{'model':db[_0x35f4ce['model']],'as':_0x35f4ce['as'],'attributes':_0x35f4ce[_0xacf6('0x1b')],'include':_0x35f4ce['include']?_[_0xacf6('0x1e')](_0x35f4ce[_0xacf6('0x1d')],function(_0x18dee7){return{'model':db[_0x18dee7[_0xacf6('0x1f')]],'as':_0x18dee7['as'],'attributes':_0x18dee7[_0xacf6('0x1b')],'include':_0x18dee7['include']?_[_0xacf6('0x1e')](_0x18dee7[_0xacf6('0x1d')],function(_0x30ca90){return{'model':db[_0x30ca90['model']],'as':_0x30ca90['as'],'attributes':_0x30ca90[_0xacf6('0x1b')]};}):[]};}):[]};}):[]:[]})['then'](function(_0x1e310f){logger[_0xacf6('0x12')]('ShowFreshdeskAccount',_0x49c045);logger[_0xacf6('0xd')](_0xacf6('0x21'),_0x49c045,JSON[_0xacf6('0xf')](_0x1e310f));_0x27b9b7(_0x1e310f);})[_0xacf6('0x14')](function(_0x48c5ed){logger['error'](_0xacf6('0x21'),_0x48c5ed['message'],_0x49c045);_0x7482be(_0x357dd0[_0xacf6('0x10')](0x1f4,_0x48c5ed[_0xacf6('0x11')]));});});};
\ No newline at end of file
+var _0xf33f=['FreshdeskAccount,\x20%s,\x20%s','request\x20sent','debug','FreshdeskAccount,\x20%s,\x20%s,\x20%s','stringify','error','code','result','message','catch','findAll','options','raw','where','attributes','limit','include','map','model','then','GetFreshdeskAccount','ShowFreshdeskAccount','FreshdeskAccount','find','lodash','bluebird','randomstring','../../mysqldb','../../config/utils','../../config/logger','rpc','client','http','info'];(function(_0x26019e,_0x96c8c4){var _0x451cad=function(_0x1b0d41){while(--_0x1b0d41){_0x26019e['push'](_0x26019e['shift']());}};_0x451cad(++_0x96c8c4);}(_0xf33f,0x18e));var _0xff33=function(_0xd4ad90,_0x5f3886){_0xd4ad90=_0xd4ad90-0x0;var _0x520b19=_0xf33f[_0xd4ad90];return _0x520b19;};'use strict';var _=require(_0xff33('0x0'));var util=require('util');var moment=require('moment');var BPromise=require(_0xff33('0x1'));var rs=require(_0xff33('0x2'));var fs=require('fs');var Redis=require('ioredis');var db=require(_0xff33('0x3'))['db'];var utils=require(_0xff33('0x4'));var logger=require(_0xff33('0x5'))(_0xff33('0x6'));var config=require('../../config/environment');var jayson=require('jayson/promise');var client=jayson[_0xff33('0x7')][_0xff33('0x8')]({'port':0x232a});function respondWithRpcPromise(_0x10af02,_0x3a9e83,_0x754c4d){return new BPromise(function(_0x70888b,_0x4032fc){return client['request'](_0x10af02,_0x754c4d)['then'](function(_0x216000){logger[_0xff33('0x9')](_0xff33('0xa'),_0x3a9e83,_0xff33('0xb'));logger[_0xff33('0xc')](_0xff33('0xd'),_0x3a9e83,_0xff33('0xb'),JSON[_0xff33('0xe')](_0x216000));if(_0x216000[_0xff33('0xf')]){if(_0x216000[_0xff33('0xf')][_0xff33('0x10')]===0x1f4){logger[_0xff33('0xf')](_0xff33('0xa'),_0x3a9e83,_0x216000[_0xff33('0xf')]['message']);return _0x4032fc(_0x216000[_0xff33('0xf')]['message']);}logger['error'](_0xff33('0xa'),_0x3a9e83,_0x216000[_0xff33('0xf')]['message']);return _0x70888b(_0x216000[_0xff33('0xf')]['message']);}else{logger[_0xff33('0x9')](_0xff33('0xa'),_0x3a9e83,_0xff33('0xb'));_0x70888b(_0x216000[_0xff33('0x11')][_0xff33('0x12')]);}})[_0xff33('0x13')](function(_0x32feac){logger['error'](_0xff33('0xa'),_0x3a9e83,_0x32feac);_0x4032fc(_0x32feac);});});}exports['GetFreshdeskAccount']=function(_0x53cff2){var _0x507c44=this;return new Promise(function(_0x5ba836,_0x388c65){return db['FreshdeskAccount'][_0xff33('0x14')]({'raw':_0x53cff2[_0xff33('0x15')]?_0x53cff2[_0xff33('0x15')][_0xff33('0x16')]===undefined?!![]:![]:!![],'where':_0x53cff2[_0xff33('0x15')]?_0x53cff2['options'][_0xff33('0x17')]||null:null,'attributes':_0x53cff2[_0xff33('0x15')]?_0x53cff2[_0xff33('0x15')][_0xff33('0x18')]||null:null,'limit':_0x53cff2['options']?_0x53cff2[_0xff33('0x15')][_0xff33('0x19')]||null:null,'include':_0x53cff2[_0xff33('0x15')]?_0x53cff2[_0xff33('0x15')][_0xff33('0x1a')]?_['map'](_0x53cff2[_0xff33('0x15')][_0xff33('0x1a')],function(_0x3c9120){return{'model':db[_0x3c9120['model']],'as':_0x3c9120['as'],'attributes':_0x3c9120[_0xff33('0x18')],'include':_0x3c9120[_0xff33('0x1a')]?_[_0xff33('0x1b')](_0x3c9120[_0xff33('0x1a')],function(_0x3155fc){return{'model':db[_0x3155fc[_0xff33('0x1c')]],'as':_0x3155fc['as'],'attributes':_0x3155fc[_0xff33('0x18')],'include':_0x3155fc[_0xff33('0x1a')]?_[_0xff33('0x1b')](_0x3155fc[_0xff33('0x1a')],function(_0x4238dc){return{'model':db[_0x4238dc[_0xff33('0x1c')]],'as':_0x4238dc['as'],'attributes':_0x4238dc[_0xff33('0x18')]};}):[]};}):[]};}):[]:[]})[_0xff33('0x1d')](function(_0x2e44f5){logger[_0xff33('0x9')]('GetFreshdeskAccount',_0x53cff2);logger[_0xff33('0xc')]('GetFreshdeskAccount',_0x53cff2,JSON[_0xff33('0xe')](_0x2e44f5));_0x5ba836(_0x2e44f5);})[_0xff33('0x13')](function(_0x1de491){logger[_0xff33('0xf')](_0xff33('0x1e'),_0x1de491[_0xff33('0x12')],_0x53cff2);_0x388c65(_0x507c44[_0xff33('0xf')](0x1f4,_0x1de491['message']));});});};exports[_0xff33('0x1f')]=function(_0x24c23a){var _0x19fa12=this;return new Promise(function(_0x4dc9ae,_0x3de0bf){return db[_0xff33('0x20')][_0xff33('0x21')]({'raw':_0x24c23a[_0xff33('0x15')]?_0x24c23a[_0xff33('0x15')][_0xff33('0x16')]===undefined?!![]:![]:!![],'where':_0x24c23a[_0xff33('0x15')]?_0x24c23a[_0xff33('0x15')]['where']||null:null,'attributes':_0x24c23a[_0xff33('0x15')]?_0x24c23a[_0xff33('0x15')][_0xff33('0x18')]||null:null,'include':_0x24c23a[_0xff33('0x15')]?_0x24c23a[_0xff33('0x15')][_0xff33('0x1a')]?_[_0xff33('0x1b')](_0x24c23a[_0xff33('0x15')][_0xff33('0x1a')],function(_0x141588){return{'model':db[_0x141588['model']],'as':_0x141588['as'],'attributes':_0x141588[_0xff33('0x18')],'include':_0x141588[_0xff33('0x1a')]?_[_0xff33('0x1b')](_0x141588['include'],function(_0x366369){return{'model':db[_0x366369['model']],'as':_0x366369['as'],'attributes':_0x366369[_0xff33('0x18')],'include':_0x366369[_0xff33('0x1a')]?_[_0xff33('0x1b')](_0x366369[_0xff33('0x1a')],function(_0x4ebcf2){return{'model':db[_0x4ebcf2[_0xff33('0x1c')]],'as':_0x4ebcf2['as'],'attributes':_0x4ebcf2[_0xff33('0x18')]};}):[]};}):[]};}):[]:[]})[_0xff33('0x1d')](function(_0x413f69){logger['info']('ShowFreshdeskAccount',_0x24c23a);logger[_0xff33('0xc')]('ShowFreshdeskAccount',_0x24c23a,JSON[_0xff33('0xe')](_0x413f69));_0x4dc9ae(_0x413f69);})[_0xff33('0x13')](function(_0x285a50){logger[_0xff33('0xf')]('ShowFreshdeskAccount',_0x285a50[_0xff33('0x12')],_0x24c23a);_0x3de0bf(_0x19fa12[_0xff33('0xf')](0x1f4,_0x285a50[_0xff33('0x12')]));});});};
\ No newline at end of file
diff --git a/server/api/intFreshdeskConfiguration/index.js b/server/api/intFreshdeskConfiguration/index.js
index 2db199a..dfc5caf 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 _0x70c5=['update','delete','destroy','exports','multer','util','path','connect-timeout','express','Router','../../components/auth/service','../../components/interaction/service','../../config/environment','./intFreshdeskConfiguration.controller','get','index','/:id','isAuthenticated','/:id/fields','getFields','getSubjects','getDescriptions','/:id/tags','getTags','post','create','setTags','put'];(function(_0x4c0622,_0x5dacaf){var _0x1799d8=function(_0x2ba801){while(--_0x2ba801){_0x4c0622['push'](_0x4c0622['shift']());}};_0x1799d8(++_0x5dacaf);}(_0x70c5,0x100));var _0x570c=function(_0x132474,_0x2c234c){_0x132474=_0x132474-0x0;var _0x509119=_0x70c5[_0x132474];return _0x509119;};'use strict';var multer=require(_0x570c('0x0'));var util=require(_0x570c('0x1'));var path=require(_0x570c('0x2'));var timeout=require(_0x570c('0x3'));var express=require(_0x570c('0x4'));var router=express[_0x570c('0x5')]();var auth=require(_0x570c('0x6'));var interaction=require(_0x570c('0x7'));var config=require(_0x570c('0x8'));var controller=require(_0x570c('0x9'));router[_0x570c('0xa')]('/',auth['isAuthenticated'](),controller[_0x570c('0xb')]);router[_0x570c('0xa')](_0x570c('0xc'),auth[_0x570c('0xd')](),controller['show']);router[_0x570c('0xa')](_0x570c('0xe'),auth[_0x570c('0xd')](),controller[_0x570c('0xf')]);router[_0x570c('0xa')]('/:id/subjects',auth[_0x570c('0xd')](),controller[_0x570c('0x10')]);router[_0x570c('0xa')]('/:id/descriptions',auth[_0x570c('0xd')](),controller[_0x570c('0x11')]);router[_0x570c('0xa')](_0x570c('0x12'),auth[_0x570c('0xd')](),controller[_0x570c('0x13')]);router[_0x570c('0x14')]('/',auth[_0x570c('0xd')](),controller[_0x570c('0x15')]);router[_0x570c('0x14')](_0x570c('0x12'),auth['isAuthenticated'](),controller[_0x570c('0x16')]);router[_0x570c('0x17')](_0x570c('0xc'),auth['isAuthenticated'](),controller[_0x570c('0x18')]);router[_0x570c('0x19')]('/:id',auth['isAuthenticated'](),controller[_0x570c('0x1a')]);module[_0x570c('0x1b')]=router;
\ No newline at end of file
+var _0xc2c5=['show','/:id/fields','getFields','/:id/subjects','getSubjects','/:id/tags','getTags','create','setTags','put','update','delete','destroy','multer','util','path','express','Router','../../components/auth/service','./intFreshdeskConfiguration.controller','get','/:id','isAuthenticated'];(function(_0x1f568f,_0x188a64){var _0x1cac56=function(_0x3a1652){while(--_0x3a1652){_0x1f568f['push'](_0x1f568f['shift']());}};_0x1cac56(++_0x188a64);}(_0xc2c5,0x1d9));var _0x5c2c=function(_0x303d9f,_0x1eeb62){_0x303d9f=_0x303d9f-0x0;var _0x37eccf=_0xc2c5[_0x303d9f];return _0x37eccf;};'use strict';var multer=require(_0x5c2c('0x0'));var util=require(_0x5c2c('0x1'));var path=require(_0x5c2c('0x2'));var timeout=require('connect-timeout');var express=require(_0x5c2c('0x3'));var router=express[_0x5c2c('0x4')]();var auth=require(_0x5c2c('0x5'));var interaction=require('../../components/interaction/service');var config=require('../../config/environment');var controller=require(_0x5c2c('0x6'));router[_0x5c2c('0x7')]('/',auth['isAuthenticated'](),controller['index']);router[_0x5c2c('0x7')](_0x5c2c('0x8'),auth[_0x5c2c('0x9')](),controller[_0x5c2c('0xa')]);router[_0x5c2c('0x7')](_0x5c2c('0xb'),auth['isAuthenticated'](),controller[_0x5c2c('0xc')]);router[_0x5c2c('0x7')](_0x5c2c('0xd'),auth[_0x5c2c('0x9')](),controller[_0x5c2c('0xe')]);router['get']('/:id/descriptions',auth[_0x5c2c('0x9')](),controller['getDescriptions']);router[_0x5c2c('0x7')](_0x5c2c('0xf'),auth[_0x5c2c('0x9')](),controller[_0x5c2c('0x10')]);router['post']('/',auth[_0x5c2c('0x9')](),controller[_0x5c2c('0x11')]);router['post'](_0x5c2c('0xf'),auth[_0x5c2c('0x9')](),controller[_0x5c2c('0x12')]);router[_0x5c2c('0x13')]('/:id',auth['isAuthenticated'](),controller[_0x5c2c('0x14')]);router[_0x5c2c('0x15')](_0x5c2c('0x8'),auth['isAuthenticated'](),controller[_0x5c2c('0x16')]);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 9180379..db101d1 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 _0xf683=['sequelize','STRING'];(function(_0x1f86da,_0x3fb279){var _0xc5ef75=function(_0xcd20c6){while(--_0xcd20c6){_0x1f86da['push'](_0x1f86da['shift']());}};_0xc5ef75(++_0x3fb279);}(_0xf683,0xaa));var _0x3f68=function(_0x5bfb62,_0x226ba9){_0x5bfb62=_0x5bfb62-0x0;var _0x3c4948=_0xf683[_0x5bfb62];return _0x3c4948;};'use strict';var Sequelize=require(_0x3f68('0x0'));module['exports']={'name':{'type':Sequelize[_0x3f68('0x1')]},'description':{'type':Sequelize[_0x3f68('0x1')]}};
\ No newline at end of file
+var _0xa3b6=['STRING','sequelize','exports'];(function(_0x14add3,_0x13ce8d){var _0x4a174f=function(_0x2b3ed7){while(--_0x2b3ed7){_0x14add3['push'](_0x14add3['shift']());}};_0x4a174f(++_0x13ce8d);}(_0xa3b6,0x85));var _0x6a3b=function(_0x4eb60d,_0x3391df){_0x4eb60d=_0x4eb60d-0x0;var _0x3e8218=_0xa3b6[_0x4eb60d];return _0x3e8218;};'use strict';var Sequelize=require(_0x6a3b('0x0'));module[_0x6a3b('0x1')]={'name':{'type':Sequelize[_0x6a3b('0x2')]},'description':{'type':Sequelize[_0x6a3b('0x2')]}};
\ No newline at end of file
diff --git a/server/api/intFreshdeskConfiguration/intFreshdeskConfiguration.controller.js b/server/api/intFreshdeskConfiguration/intFreshdeskConfiguration.controller.js
index 4824a94..44fb19b 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 _0x2b22=['Sequelize','ValidationError','request','then','info','FreshdeskConfiguration,\x20%s,\x20%s,\x20%s','stringify','error','code','FreshdeskConfiguration,\x20%s,\x20%s','message','request\x20sent','catch','sendStatus','end','json','offset','set','Content-Range','apply','update','status','stack','name','send','FreshdeskConfiguration','rawAttributes','type','query','keys','filters','intersection','model','attributes','fields','length','hasOwnProperty','nolimit','limit','order','sort','where','filter','merge','map','VIRTUAL','options','count','include','findAll','params','includeAll','find','create','body','getFields','findOne','FreshdeskField','pick','getSubjects','getDescriptions','getTags','setTags','ids','html-pdf','eml-format','rimraf','zip-dir','fast-json-patch','moment','mustache','path','sox','to-csv','lodash','squel','crypto','jsforce','desk.js','querystring','papaparse','ioredis','../../components/parsers/qs','../../config/logger','api','../../config/utils','../../mysqldb','client','http','test'];(function(_0x3bf83f,_0x181cac){var _0x22c4a9=function(_0xb3ff0d){while(--_0xb3ff0d){_0x3bf83f['push'](_0x3bf83f['shift']());}};_0x22c4a9(++_0x181cac);}(_0x2b22,0xf4));var _0x22b2=function(_0xa7aea8,_0x3606f2){_0xa7aea8=_0xa7aea8-0x0;var _0x2d0ba3=_0x2b22[_0xa7aea8];return _0x2d0ba3;};'use strict';var pdf=require(_0x22b2('0x0'));var emlformat=require(_0x22b2('0x1'));var rimraf=require(_0x22b2('0x2'));var zipdir=require(_0x22b2('0x3'));var jsonpatch=require(_0x22b2('0x4'));var rp=require('request-promise');var moment=require(_0x22b2('0x5'));var BPromise=require('bluebird');var Mustache=require(_0x22b2('0x6'));var util=require('util');var path=require(_0x22b2('0x7'));var sox=require(_0x22b2('0x8'));var csv=require(_0x22b2('0x9'));var ejs=require('ejs');var fs=require('fs');var _=require(_0x22b2('0xa'));var squel=require(_0x22b2('0xb'));var crypto=require(_0x22b2('0xc'));var jsforce=require(_0x22b2('0xd'));var deskjs=require(_0x22b2('0xe'));var toCsv=require(_0x22b2('0x9'));var querystring=require(_0x22b2('0xf'));var Papa=require(_0x22b2('0x10'));var Redis=require(_0x22b2('0x11'));var authService=require('../../components/auth/service');var qs=require(_0x22b2('0x12'));var as=require('../../components/parsers/advancedSearch');var hardwareService=require('../../config/license/hardware');var logger=require(_0x22b2('0x13'))(_0x22b2('0x14'));var utils=require(_0x22b2('0x15'));var config=require('../../config/environment');var db=require(_0x22b2('0x16'))['db'];var jayson=require('jayson/promise');var client=jayson[_0x22b2('0x17')][_0x22b2('0x18')]({'port':0x232a});function checkPasswordPattern(_0x50053d,_0x4376b5,_0x270dc9){if(_0x270dc9){var _0xda2305=new RegExp(/(?=.*[a-z])(?=.*[A-Z])(?=.*[0-9])(?=.*[?!@#\$%\^&\*~\-_=+[{\]\}])(?=.{8,})/);if(_0xda2305[_0x22b2('0x19')](_0x4376b5)){return _0x50053d;}else{throw new db[(_0x22b2('0x1a'))][(_0x22b2('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 _0x50053d;}}function respondWithRpcPromise(_0x5f1c12,_0x44a5bc,_0x28dcb5,_0x11da6d){return new BPromise(function(_0xeda152,_0xe1048e){var _0x4dc4e1=_0x11da6d||client;return _0x4dc4e1[_0x22b2('0x1c')](_0x5f1c12,_0x28dcb5)[_0x22b2('0x1d')](function(_0x100b07){logger[_0x22b2('0x1e')]('FreshdeskConfiguration,\x20%s,\x20%s',_0x44a5bc,'request\x20sent');logger['debug'](_0x22b2('0x1f'),_0x44a5bc,'request\x20sent',JSON[_0x22b2('0x20')](_0x100b07));if(_0x100b07[_0x22b2('0x21')]){if(_0x100b07['error'][_0x22b2('0x22')]===0x1f4){logger[_0x22b2('0x21')](_0x22b2('0x23'),_0x44a5bc,_0x100b07['error'][_0x22b2('0x24')]);return _0xe1048e(_0x100b07[_0x22b2('0x21')][_0x22b2('0x24')]);}logger[_0x22b2('0x21')](_0x22b2('0x23'),_0x44a5bc,_0x100b07[_0x22b2('0x21')]['message']);return _0xeda152(_0x100b07[_0x22b2('0x21')][_0x22b2('0x24')]);}else{logger[_0x22b2('0x1e')](_0x22b2('0x23'),_0x44a5bc,_0x22b2('0x25'));_0xeda152(_0x100b07['result'][_0x22b2('0x24')]);}})[_0x22b2('0x26')](function(_0x2464b8){logger[_0x22b2('0x21')](_0x22b2('0x23'),_0x44a5bc,_0x2464b8);_0xe1048e(_0x2464b8);});});}function respondWithStatusCode(_0x102304,_0x581c1b){_0x581c1b=_0x581c1b||0xcc;return function(_0x5747d4){if(_0x5747d4){return _0x102304[_0x22b2('0x27')](_0x581c1b);}return _0x102304['status'](_0x581c1b)[_0x22b2('0x28')]();};}function respondWithResult(_0x13f606,_0x51f486){_0x51f486=_0x51f486||0xc8;return function(_0x3466f5){if(_0x3466f5){return _0x13f606['status'](_0x51f486)[_0x22b2('0x29')](_0x3466f5);}};}function respondWithFilteredResult(_0xcf97a7,_0x39cb4){return function(_0x686a8f){if(_0x686a8f){var _0x57afcd=_0x686a8f['count'],_0x1f38a4=_0x39cb4[_0x22b2('0x2a')],_0x3b09f6=_0x39cb4['offset']+_0x39cb4['limit'],_0x13af98;if(_0x3b09f6>=_0x57afcd){_0x3b09f6=_0x57afcd;_0x13af98=0xc8;}else{_0x13af98=0xce;}_0xcf97a7['status'](_0x13af98);return _0xcf97a7[_0x22b2('0x2b')](_0x22b2('0x2c'),_0x1f38a4+'-'+_0x3b09f6+'/'+_0x57afcd)[_0x22b2('0x29')](_0x686a8f);}return null;};}function patchUpdates(_0x435b4c){return function(_0x5c9089){try{jsonpatch[_0x22b2('0x2d')](_0x5c9089,_0x435b4c,!![]);}catch(_0x1ec1a9){return BPromise['reject'](_0x1ec1a9);}return _0x5c9089['save']();};}function saveUpdates(_0x25b9d3,_0x311060){return function(_0x29a4fd){if(_0x29a4fd){return _0x29a4fd[_0x22b2('0x2e')](_0x25b9d3)[_0x22b2('0x1d')](function(_0x403b4a){return _0x403b4a;});}return null;};}function removeEntity(_0x174e27,_0x2dfa7c){return function(_0x48c8cb){if(_0x48c8cb){return _0x48c8cb['destroy']()[_0x22b2('0x1d')](function(){_0x174e27[_0x22b2('0x2f')](0xcc)['end']();});}};}function handleEntityNotFound(_0x4c0fe1,_0x2e466a){return function(_0x162429){if(!_0x162429){_0x4c0fe1['sendStatus'](0x194);}return _0x162429;};}function handleError(_0x36580d,_0x2d140f){_0x2d140f=_0x2d140f||0x1f4;return function(_0x2d02a7){logger['error'](_0x2d02a7[_0x22b2('0x30')]);if(_0x2d02a7[_0x22b2('0x31')]){delete _0x2d02a7[_0x22b2('0x31')];}_0x36580d[_0x22b2('0x2f')](_0x2d140f)[_0x22b2('0x32')](_0x2d02a7);};}exports['index']=function(_0x2cc249,_0x1b8382){var _0x4bbee0={},_0x1a1469={},_0x3bfea2={'count':0x0,'rows':[]};var _0x39c3a6=_['map'](db[_0x22b2('0x33')][_0x22b2('0x34')],function(_0x395684){return{'name':_0x395684['fieldName'],'type':_0x395684[_0x22b2('0x35')]['key']};});_0x1a1469['model']=_['map'](_0x39c3a6,_0x22b2('0x31'));_0x1a1469[_0x22b2('0x36')]=_[_0x22b2('0x37')](_0x2cc249['query']);_0x1a1469[_0x22b2('0x38')]=_[_0x22b2('0x39')](_0x1a1469[_0x22b2('0x3a')],_0x1a1469['query']);_0x4bbee0[_0x22b2('0x3b')]=_[_0x22b2('0x39')](_0x1a1469[_0x22b2('0x3a')],qs['fields'](_0x2cc249[_0x22b2('0x36')][_0x22b2('0x3c')]));_0x4bbee0[_0x22b2('0x3b')]=_0x4bbee0[_0x22b2('0x3b')][_0x22b2('0x3d')]?_0x4bbee0[_0x22b2('0x3b')]:_0x1a1469[_0x22b2('0x3a')];if(!_0x2cc249[_0x22b2('0x36')][_0x22b2('0x3e')](_0x22b2('0x3f'))){_0x4bbee0['limit']=qs['limit'](_0x2cc249[_0x22b2('0x36')][_0x22b2('0x40')]);_0x4bbee0[_0x22b2('0x2a')]=qs[_0x22b2('0x2a')](_0x2cc249['query'][_0x22b2('0x2a')]);}_0x4bbee0[_0x22b2('0x41')]=qs[_0x22b2('0x42')](_0x2cc249[_0x22b2('0x36')][_0x22b2('0x42')]);_0x4bbee0[_0x22b2('0x43')]=qs[_0x22b2('0x38')](_['pick'](_0x2cc249['query'],_0x1a1469[_0x22b2('0x38')]));if(_0x2cc249['query'][_0x22b2('0x44')]){_0x4bbee0[_0x22b2('0x43')]=_[_0x22b2('0x45')](_0x4bbee0[_0x22b2('0x43')],{'$or':_[_0x22b2('0x46')](_0x39c3a6,function(_0x11864c){if(_0x11864c[_0x22b2('0x35')]!==_0x22b2('0x47')){var _0x51e7fe={};_0x51e7fe[_0x11864c[_0x22b2('0x31')]]={'$like':'%'+_0x2cc249[_0x22b2('0x36')][_0x22b2('0x44')]+'%'};return _0x51e7fe;}})});}_0x4bbee0=_[_0x22b2('0x45')]({},_0x4bbee0,_0x2cc249[_0x22b2('0x48')]);var _0x5e3c32={'where':_0x4bbee0[_0x22b2('0x43')]};return db['FreshdeskConfiguration'][_0x22b2('0x49')](_0x5e3c32)[_0x22b2('0x1d')](function(_0x1e43ff){_0x3bfea2[_0x22b2('0x49')]=_0x1e43ff;if(_0x2cc249[_0x22b2('0x36')]['includeAll']){_0x4bbee0[_0x22b2('0x4a')]=[{'all':!![]}];}return db[_0x22b2('0x33')][_0x22b2('0x4b')](_0x4bbee0);})[_0x22b2('0x1d')](function(_0x3b829e){_0x3bfea2['rows']=_0x3b829e;return _0x3bfea2;})[_0x22b2('0x1d')](respondWithFilteredResult(_0x1b8382,_0x4bbee0))[_0x22b2('0x26')](handleError(_0x1b8382,null));};exports['show']=function(_0x1e0dc4,_0x54cbf6){var _0x5e8d29={'raw':![],'where':{'id':_0x1e0dc4[_0x22b2('0x4c')]['id']}},_0x2d3f1c={};_0x2d3f1c[_0x22b2('0x3a')]=_[_0x22b2('0x37')](db[_0x22b2('0x33')][_0x22b2('0x34')]);_0x2d3f1c[_0x22b2('0x36')]=_[_0x22b2('0x37')](_0x1e0dc4['query']);_0x2d3f1c['filters']=_[_0x22b2('0x39')](_0x2d3f1c[_0x22b2('0x3a')],_0x2d3f1c[_0x22b2('0x36')]);_0x5e8d29['attributes']=_[_0x22b2('0x39')](_0x2d3f1c['model'],qs['fields'](_0x1e0dc4[_0x22b2('0x36')][_0x22b2('0x3c')]));_0x5e8d29[_0x22b2('0x3b')]=_0x5e8d29[_0x22b2('0x3b')]['length']?_0x5e8d29[_0x22b2('0x3b')]:_0x2d3f1c[_0x22b2('0x3a')];if(_0x1e0dc4[_0x22b2('0x36')][_0x22b2('0x4d')]){_0x5e8d29['include']=[{'all':!![]}];}_0x5e8d29=_[_0x22b2('0x45')]({},_0x5e8d29,_0x1e0dc4[_0x22b2('0x48')]);return db[_0x22b2('0x33')][_0x22b2('0x4e')](_0x5e8d29)['then'](handleEntityNotFound(_0x54cbf6,null))[_0x22b2('0x1d')](respondWithResult(_0x54cbf6,null))['catch'](handleError(_0x54cbf6,null));};exports[_0x22b2('0x4f')]=function(_0x5485c4,_0x105276){return db[_0x22b2('0x33')]['create'](_0x5485c4[_0x22b2('0x50')],{})[_0x22b2('0x1d')](respondWithResult(_0x105276,0xc9))[_0x22b2('0x26')](handleError(_0x105276,null));};exports['update']=function(_0xc14758,_0x3a1106){if(_0xc14758['body']['id']){delete _0xc14758[_0x22b2('0x50')]['id'];}return db[_0x22b2('0x33')]['find']({'where':{'id':_0xc14758[_0x22b2('0x4c')]['id']}})['then'](handleEntityNotFound(_0x3a1106,null))[_0x22b2('0x1d')](saveUpdates(_0xc14758[_0x22b2('0x50')],null))[_0x22b2('0x1d')](respondWithResult(_0x3a1106,null))[_0x22b2('0x26')](handleError(_0x3a1106,null));};exports['destroy']=function(_0x39e851,_0x2e9bd2){return db[_0x22b2('0x33')][_0x22b2('0x4e')]({'where':{'id':_0x39e851['params']['id']}})[_0x22b2('0x1d')](handleEntityNotFound(_0x2e9bd2,null))[_0x22b2('0x1d')](removeEntity(_0x2e9bd2,null))[_0x22b2('0x26')](handleError(_0x2e9bd2,null));};exports[_0x22b2('0x51')]=function(_0x33f0c7,_0xcaf486,_0x49ba1c){var _0x2ccd7a={};var _0xbdbeda={};var _0x25c9e7;var _0x52aa53;return db[_0x22b2('0x33')][_0x22b2('0x52')]({'where':{'id':_0x33f0c7[_0x22b2('0x4c')]['id']}})['then'](handleEntityNotFound(_0xcaf486,null))[_0x22b2('0x1d')](function(_0x457cfa){if(_0x457cfa){_0x25c9e7=_0x457cfa;_0xbdbeda[_0x22b2('0x3a')]=_[_0x22b2('0x37')](db[_0x22b2('0x53')][_0x22b2('0x34')]);_0xbdbeda[_0x22b2('0x36')]=_[_0x22b2('0x37')](_0x33f0c7[_0x22b2('0x36')]);_0xbdbeda[_0x22b2('0x38')]=_[_0x22b2('0x39')](_0xbdbeda[_0x22b2('0x3a')],_0xbdbeda[_0x22b2('0x36')]);_0x2ccd7a['attributes']=_[_0x22b2('0x39')](_0xbdbeda[_0x22b2('0x3a')],qs['fields'](_0x33f0c7[_0x22b2('0x36')]['fields']));_0x2ccd7a[_0x22b2('0x3b')]=_0x2ccd7a[_0x22b2('0x3b')]['length']?_0x2ccd7a[_0x22b2('0x3b')]:_0xbdbeda['model'];_0x2ccd7a[_0x22b2('0x41')]=qs[_0x22b2('0x42')](_0x33f0c7['query']['sort']);_0x2ccd7a[_0x22b2('0x43')]=qs[_0x22b2('0x38')](_[_0x22b2('0x54')](_0x33f0c7['query'],_0xbdbeda['filters']));if(_0x33f0c7[_0x22b2('0x36')][_0x22b2('0x44')]){_0x2ccd7a['where']=_['merge'](_0x2ccd7a[_0x22b2('0x43')],{'$or':_[_0x22b2('0x46')](_0x2ccd7a[_0x22b2('0x3b')],function(_0x475103){var _0x25278d={};_0x25278d[_0x475103]={'$like':'%'+_0x33f0c7[_0x22b2('0x36')][_0x22b2('0x44')]+'%'};return _0x25278d;})});}_0x2ccd7a=_['merge']({},_0x2ccd7a,_0x33f0c7[_0x22b2('0x48')]);return _0x25c9e7[_0x22b2('0x51')](_0x2ccd7a);}})[_0x22b2('0x1d')](function(_0x5b03a8){if(_0x5b03a8){_0x52aa53=_0x5b03a8[_0x22b2('0x3d')];if(!_0x33f0c7['query']['hasOwnProperty']('nolimit')){_0x2ccd7a[_0x22b2('0x40')]=qs[_0x22b2('0x40')](_0x33f0c7[_0x22b2('0x36')][_0x22b2('0x40')]);_0x2ccd7a[_0x22b2('0x2a')]=qs[_0x22b2('0x2a')](_0x33f0c7[_0x22b2('0x36')][_0x22b2('0x2a')]);}return _0x25c9e7[_0x22b2('0x51')](_0x2ccd7a);}})[_0x22b2('0x1d')](function(_0x10ec71){if(_0x10ec71){return _0x10ec71?{'count':_0x52aa53,'rows':_0x10ec71}:null;}})[_0x22b2('0x1d')](respondWithResult(_0xcaf486,null))[_0x22b2('0x26')](handleError(_0xcaf486,null));};exports['getSubjects']=function(_0x1e3ddb,_0x485632,_0x1eee03){var _0x13c7cd={};var _0x551e77={};var _0x219df9;var _0x57a829;return db[_0x22b2('0x33')][_0x22b2('0x52')]({'where':{'id':_0x1e3ddb['params']['id']}})[_0x22b2('0x1d')](handleEntityNotFound(_0x485632,null))[_0x22b2('0x1d')](function(_0x3fa2fb){if(_0x3fa2fb){_0x219df9=_0x3fa2fb;_0x551e77[_0x22b2('0x3a')]=_[_0x22b2('0x37')](db[_0x22b2('0x53')][_0x22b2('0x34')]);_0x551e77[_0x22b2('0x36')]=_[_0x22b2('0x37')](_0x1e3ddb[_0x22b2('0x36')]);_0x551e77[_0x22b2('0x38')]=_[_0x22b2('0x39')](_0x551e77[_0x22b2('0x3a')],_0x551e77[_0x22b2('0x36')]);_0x13c7cd[_0x22b2('0x3b')]=_[_0x22b2('0x39')](_0x551e77[_0x22b2('0x3a')],qs[_0x22b2('0x3c')](_0x1e3ddb[_0x22b2('0x36')][_0x22b2('0x3c')]));_0x13c7cd[_0x22b2('0x3b')]=_0x13c7cd[_0x22b2('0x3b')][_0x22b2('0x3d')]?_0x13c7cd['attributes']:_0x551e77[_0x22b2('0x3a')];_0x13c7cd[_0x22b2('0x41')]=qs[_0x22b2('0x42')](_0x1e3ddb[_0x22b2('0x36')][_0x22b2('0x42')]);_0x13c7cd[_0x22b2('0x43')]=qs[_0x22b2('0x38')](_[_0x22b2('0x54')](_0x1e3ddb[_0x22b2('0x36')],_0x551e77[_0x22b2('0x38')]));if(_0x1e3ddb[_0x22b2('0x36')][_0x22b2('0x44')]){_0x13c7cd[_0x22b2('0x43')]=_[_0x22b2('0x45')](_0x13c7cd[_0x22b2('0x43')],{'$or':_[_0x22b2('0x46')](_0x13c7cd[_0x22b2('0x3b')],function(_0x25fe17){var _0x26c794={};_0x26c794[_0x25fe17]={'$like':'%'+_0x1e3ddb[_0x22b2('0x36')][_0x22b2('0x44')]+'%'};return _0x26c794;})});}_0x13c7cd=_['merge']({},_0x13c7cd,_0x1e3ddb['options']);return _0x219df9[_0x22b2('0x55')](_0x13c7cd);}})[_0x22b2('0x1d')](function(_0x1b0b63){if(_0x1b0b63){_0x57a829=_0x1b0b63[_0x22b2('0x3d')];if(!_0x1e3ddb[_0x22b2('0x36')][_0x22b2('0x3e')](_0x22b2('0x3f'))){_0x13c7cd['limit']=qs['limit'](_0x1e3ddb[_0x22b2('0x36')][_0x22b2('0x40')]);_0x13c7cd[_0x22b2('0x2a')]=qs['offset'](_0x1e3ddb[_0x22b2('0x36')][_0x22b2('0x2a')]);}return _0x219df9[_0x22b2('0x55')](_0x13c7cd);}})[_0x22b2('0x1d')](function(_0x46b1a5){if(_0x46b1a5){return _0x46b1a5?{'count':_0x57a829,'rows':_0x46b1a5}:null;}})[_0x22b2('0x1d')](respondWithResult(_0x485632,null))[_0x22b2('0x26')](handleError(_0x485632,null));};exports['getDescriptions']=function(_0x537f69,_0x4ca809,_0x514df1){var _0x82e5ff={};var _0x3317ec={};var _0x4c133e;var _0x4c91ea;return db[_0x22b2('0x33')][_0x22b2('0x52')]({'where':{'id':_0x537f69[_0x22b2('0x4c')]['id']}})[_0x22b2('0x1d')](handleEntityNotFound(_0x4ca809,null))[_0x22b2('0x1d')](function(_0x4ad947){if(_0x4ad947){_0x4c133e=_0x4ad947;_0x3317ec[_0x22b2('0x3a')]=_[_0x22b2('0x37')](db[_0x22b2('0x53')]['rawAttributes']);_0x3317ec[_0x22b2('0x36')]=_[_0x22b2('0x37')](_0x537f69[_0x22b2('0x36')]);_0x3317ec[_0x22b2('0x38')]=_[_0x22b2('0x39')](_0x3317ec[_0x22b2('0x3a')],_0x3317ec['query']);_0x82e5ff[_0x22b2('0x3b')]=_[_0x22b2('0x39')](_0x3317ec['model'],qs[_0x22b2('0x3c')](_0x537f69['query'][_0x22b2('0x3c')]));_0x82e5ff[_0x22b2('0x3b')]=_0x82e5ff[_0x22b2('0x3b')][_0x22b2('0x3d')]?_0x82e5ff['attributes']:_0x3317ec[_0x22b2('0x3a')];_0x82e5ff[_0x22b2('0x41')]=qs[_0x22b2('0x42')](_0x537f69[_0x22b2('0x36')][_0x22b2('0x42')]);_0x82e5ff['where']=qs[_0x22b2('0x38')](_[_0x22b2('0x54')](_0x537f69[_0x22b2('0x36')],_0x3317ec[_0x22b2('0x38')]));if(_0x537f69[_0x22b2('0x36')][_0x22b2('0x44')]){_0x82e5ff[_0x22b2('0x43')]=_[_0x22b2('0x45')](_0x82e5ff['where'],{'$or':_[_0x22b2('0x46')](_0x82e5ff[_0x22b2('0x3b')],function(_0x13a58d){var _0x47e701={};_0x47e701[_0x13a58d]={'$like':'%'+_0x537f69['query'][_0x22b2('0x44')]+'%'};return _0x47e701;})});}_0x82e5ff=_[_0x22b2('0x45')]({},_0x82e5ff,_0x537f69['options']);return _0x4c133e[_0x22b2('0x56')](_0x82e5ff);}})[_0x22b2('0x1d')](function(_0x39dd4c){if(_0x39dd4c){_0x4c91ea=_0x39dd4c[_0x22b2('0x3d')];if(!_0x537f69[_0x22b2('0x36')][_0x22b2('0x3e')](_0x22b2('0x3f'))){_0x82e5ff[_0x22b2('0x40')]=qs[_0x22b2('0x40')](_0x537f69[_0x22b2('0x36')][_0x22b2('0x40')]);_0x82e5ff['offset']=qs['offset'](_0x537f69[_0x22b2('0x36')]['offset']);}return _0x4c133e[_0x22b2('0x56')](_0x82e5ff);}})[_0x22b2('0x1d')](function(_0x44253d){if(_0x44253d){return _0x44253d?{'count':_0x4c91ea,'rows':_0x44253d}:null;}})[_0x22b2('0x1d')](respondWithResult(_0x4ca809,null))[_0x22b2('0x26')](handleError(_0x4ca809,null));};exports['getTags']=function(_0x1edc71,_0x5a6f17,_0x4eb44d){var _0x5dec06={};var _0x56f1c5={};var _0x1ce1a6;var _0x47ba14;return db[_0x22b2('0x33')][_0x22b2('0x52')]({'where':{'id':_0x1edc71['params']['id']}})['then'](handleEntityNotFound(_0x5a6f17,null))[_0x22b2('0x1d')](function(_0x24d3d9){if(_0x24d3d9){_0x1ce1a6=_0x24d3d9;_0x56f1c5[_0x22b2('0x3a')]=_[_0x22b2('0x37')](db['Tag'][_0x22b2('0x34')]);_0x56f1c5[_0x22b2('0x36')]=_[_0x22b2('0x37')](_0x1edc71[_0x22b2('0x36')]);_0x56f1c5[_0x22b2('0x38')]=_['intersection'](_0x56f1c5['model'],_0x56f1c5[_0x22b2('0x36')]);_0x5dec06[_0x22b2('0x3b')]=_[_0x22b2('0x39')](_0x56f1c5[_0x22b2('0x3a')],qs[_0x22b2('0x3c')](_0x1edc71[_0x22b2('0x36')]['fields']));_0x5dec06[_0x22b2('0x3b')]=_0x5dec06[_0x22b2('0x3b')]['length']?_0x5dec06[_0x22b2('0x3b')]:_0x56f1c5[_0x22b2('0x3a')];_0x5dec06['order']=qs[_0x22b2('0x42')](_0x1edc71[_0x22b2('0x36')][_0x22b2('0x42')]);_0x5dec06[_0x22b2('0x43')]=qs[_0x22b2('0x38')](_[_0x22b2('0x54')](_0x1edc71['query'],_0x56f1c5[_0x22b2('0x38')]));if(_0x1edc71['query'][_0x22b2('0x44')]){_0x5dec06[_0x22b2('0x43')]=_['merge'](_0x5dec06[_0x22b2('0x43')],{'$or':_[_0x22b2('0x46')](_0x5dec06[_0x22b2('0x3b')],function(_0x3c54f8){var _0x36204c={};_0x36204c[_0x3c54f8]={'$like':'%'+_0x1edc71[_0x22b2('0x36')]['filter']+'%'};return _0x36204c;})});}_0x5dec06=_['merge']({},_0x5dec06,_0x1edc71[_0x22b2('0x48')]);return _0x1ce1a6[_0x22b2('0x57')](_0x5dec06);}})['then'](function(_0x3ee37c){if(_0x3ee37c){_0x47ba14=_0x3ee37c[_0x22b2('0x3d')];if(!_0x1edc71[_0x22b2('0x36')][_0x22b2('0x3e')](_0x22b2('0x3f'))){_0x5dec06[_0x22b2('0x40')]=qs[_0x22b2('0x40')](_0x1edc71[_0x22b2('0x36')][_0x22b2('0x40')]);_0x5dec06['offset']=qs['offset'](_0x1edc71[_0x22b2('0x36')][_0x22b2('0x2a')]);}return _0x1ce1a6[_0x22b2('0x57')](_0x5dec06);}})['then'](function(_0x3e931d){if(_0x3e931d){return _0x3e931d?{'count':_0x47ba14,'rows':_0x3e931d}:null;}})[_0x22b2('0x1d')](respondWithResult(_0x5a6f17,null))[_0x22b2('0x26')](handleError(_0x5a6f17,null));};exports[_0x22b2('0x58')]=function(_0x5e9ed5,_0x2a4ff5,_0x41b503){if(_0x5e9ed5[_0x22b2('0x50')]['id']){delete _0x5e9ed5[_0x22b2('0x50')]['id'];}return db[_0x22b2('0x33')]['findOne']({'where':{'id':_0x5e9ed5['params']['id']}})[_0x22b2('0x1d')](handleEntityNotFound(_0x2a4ff5,null))[_0x22b2('0x1d')](function(_0x4ee911){if(_0x4ee911){return _0x4ee911['setTags'](_0x5e9ed5['body'][_0x22b2('0x59')]||[]);}return null;})[_0x22b2('0x1d')](respondWithResult(_0x2a4ff5,null))['catch'](handleError(_0x2a4ff5,null));};
\ No newline at end of file
+var _0x340e=['squel','crypto','jsforce','desk.js','querystring','papaparse','ioredis','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','../../config/utils','../../config/environment','../../mysqldb','jayson/promise','client','http','test','Sequelize','ValidationError','request','then','info','FreshdeskConfiguration,\x20%s,\x20%s','request\x20sent','FreshdeskConfiguration,\x20%s,\x20%s,\x20%s','stringify','error','message','result','catch','sendStatus','status','end','json','count','offset','set','Content-Range','apply','save','destroy','stack','name','send','index','map','FreshdeskConfiguration','fieldName','type','key','model','query','filters','attributes','intersection','fields','length','hasOwnProperty','limit','order','sort','where','pick','filter','VIRTUAL','merge','options','includeAll','include','show','keys','rawAttributes','find','create','body','update','params','getFields','findOne','FreshdeskField','getSubjects','nolimit','getDescriptions','getTags','Tag','setTags','ids','html-pdf','rimraf','request-promise','moment','mustache','util','path','to-csv','lodash'];(function(_0x218e76,_0x5f0903){var _0x4269bb=function(_0x3881db){while(--_0x3881db){_0x218e76['push'](_0x218e76['shift']());}};_0x4269bb(++_0x5f0903);}(_0x340e,0x1dc));var _0xe340=function(_0x219289,_0x1ba487){_0x219289=_0x219289-0x0;var _0x2d7c18=_0x340e[_0x219289];return _0x2d7c18;};'use strict';var pdf=require(_0xe340('0x0'));var emlformat=require('eml-format');var rimraf=require(_0xe340('0x1'));var zipdir=require('zip-dir');var jsonpatch=require('fast-json-patch');var rp=require(_0xe340('0x2'));var moment=require(_0xe340('0x3'));var BPromise=require('bluebird');var Mustache=require(_0xe340('0x4'));var util=require(_0xe340('0x5'));var path=require(_0xe340('0x6'));var sox=require('sox');var csv=require(_0xe340('0x7'));var ejs=require('ejs');var fs=require('fs');var _=require(_0xe340('0x8'));var squel=require(_0xe340('0x9'));var crypto=require(_0xe340('0xa'));var jsforce=require(_0xe340('0xb'));var deskjs=require(_0xe340('0xc'));var toCsv=require('to-csv');var querystring=require(_0xe340('0xd'));var Papa=require(_0xe340('0xe'));var Redis=require(_0xe340('0xf'));var authService=require('../../components/auth/service');var qs=require(_0xe340('0x10'));var as=require(_0xe340('0x11'));var hardwareService=require(_0xe340('0x12'));var logger=require(_0xe340('0x13'))('api');var utils=require(_0xe340('0x14'));var config=require(_0xe340('0x15'));var db=require(_0xe340('0x16'))['db'];var jayson=require(_0xe340('0x17'));var client=jayson[_0xe340('0x18')][_0xe340('0x19')]({'port':0x232a});function checkPasswordPattern(_0x326c9b,_0x5cabda,_0x10bfbc){if(_0x10bfbc){var _0x247af2=new RegExp(/(?=.*[a-z])(?=.*[A-Z])(?=.*[0-9])(?=.*[?!@#\$%\^&\*~\-_=+[{\]\}])(?=.{8,})/);if(_0x247af2[_0xe340('0x1a')](_0x5cabda)){return _0x326c9b;}else{throw new db[(_0xe340('0x1b'))][(_0xe340('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 _0x326c9b;}}function respondWithRpcPromise(_0xd2d22a,_0xd401cd,_0x5f12d0,_0xc2784a){return new BPromise(function(_0x335ab9,_0x3b3eeb){var _0x367a47=_0xc2784a||client;return _0x367a47[_0xe340('0x1d')](_0xd2d22a,_0x5f12d0)[_0xe340('0x1e')](function(_0x1d749b){logger[_0xe340('0x1f')](_0xe340('0x20'),_0xd401cd,_0xe340('0x21'));logger['debug'](_0xe340('0x22'),_0xd401cd,_0xe340('0x21'),JSON[_0xe340('0x23')](_0x1d749b));if(_0x1d749b[_0xe340('0x24')]){if(_0x1d749b[_0xe340('0x24')]['code']===0x1f4){logger[_0xe340('0x24')](_0xe340('0x20'),_0xd401cd,_0x1d749b[_0xe340('0x24')][_0xe340('0x25')]);return _0x3b3eeb(_0x1d749b[_0xe340('0x24')]['message']);}logger[_0xe340('0x24')](_0xe340('0x20'),_0xd401cd,_0x1d749b[_0xe340('0x24')][_0xe340('0x25')]);return _0x335ab9(_0x1d749b[_0xe340('0x24')][_0xe340('0x25')]);}else{logger[_0xe340('0x1f')](_0xe340('0x20'),_0xd401cd,_0xe340('0x21'));_0x335ab9(_0x1d749b[_0xe340('0x26')][_0xe340('0x25')]);}})[_0xe340('0x27')](function(_0x4feb29){logger[_0xe340('0x24')](_0xe340('0x20'),_0xd401cd,_0x4feb29);_0x3b3eeb(_0x4feb29);});});}function respondWithStatusCode(_0x487b36,_0x1e160f){_0x1e160f=_0x1e160f||0xcc;return function(_0x3fe91e){if(_0x3fe91e){return _0x487b36[_0xe340('0x28')](_0x1e160f);}return _0x487b36[_0xe340('0x29')](_0x1e160f)[_0xe340('0x2a')]();};}function respondWithResult(_0x3792db,_0x531bd4){_0x531bd4=_0x531bd4||0xc8;return function(_0x1eedcc){if(_0x1eedcc){return _0x3792db['status'](_0x531bd4)[_0xe340('0x2b')](_0x1eedcc);}};}function respondWithFilteredResult(_0xdc89e5,_0x2e3c82){return function(_0x323324){if(_0x323324){var _0x131584=_0x323324[_0xe340('0x2c')],_0x376446=_0x2e3c82[_0xe340('0x2d')],_0x4ccbf7=_0x2e3c82[_0xe340('0x2d')]+_0x2e3c82['limit'],_0x34342c;if(_0x4ccbf7>=_0x131584){_0x4ccbf7=_0x131584;_0x34342c=0xc8;}else{_0x34342c=0xce;}_0xdc89e5[_0xe340('0x29')](_0x34342c);return _0xdc89e5[_0xe340('0x2e')](_0xe340('0x2f'),_0x376446+'-'+_0x4ccbf7+'/'+_0x131584)[_0xe340('0x2b')](_0x323324);}return null;};}function patchUpdates(_0x358731){return function(_0x5d4d74){try{jsonpatch[_0xe340('0x30')](_0x5d4d74,_0x358731,!![]);}catch(_0x533649){return BPromise['reject'](_0x533649);}return _0x5d4d74[_0xe340('0x31')]();};}function saveUpdates(_0x5b6151,_0x3717fe){return function(_0x2cff00){if(_0x2cff00){return _0x2cff00['update'](_0x5b6151)[_0xe340('0x1e')](function(_0x1e4743){return _0x1e4743;});}return null;};}function removeEntity(_0x3d0502,_0x1219a9){return function(_0x42b323){if(_0x42b323){return _0x42b323[_0xe340('0x32')]()['then'](function(){_0x3d0502[_0xe340('0x29')](0xcc)['end']();});}};}function handleEntityNotFound(_0x3814fe,_0x27cd12){return function(_0x30b6bb){if(!_0x30b6bb){_0x3814fe[_0xe340('0x28')](0x194);}return _0x30b6bb;};}function handleError(_0x46f3e1,_0x2efc7c){_0x2efc7c=_0x2efc7c||0x1f4;return function(_0x40e8f2){logger[_0xe340('0x24')](_0x40e8f2[_0xe340('0x33')]);if(_0x40e8f2[_0xe340('0x34')]){delete _0x40e8f2[_0xe340('0x34')];}_0x46f3e1[_0xe340('0x29')](_0x2efc7c)[_0xe340('0x35')](_0x40e8f2);};}exports[_0xe340('0x36')]=function(_0x11a499,_0x367c32){var _0xa287f2={},_0x2d5d59={},_0x5e0242={'count':0x0,'rows':[]};var _0xd02821=_[_0xe340('0x37')](db[_0xe340('0x38')]['rawAttributes'],function(_0xbf7819){return{'name':_0xbf7819[_0xe340('0x39')],'type':_0xbf7819[_0xe340('0x3a')][_0xe340('0x3b')]};});_0x2d5d59[_0xe340('0x3c')]=_['map'](_0xd02821,'name');_0x2d5d59[_0xe340('0x3d')]=_['keys'](_0x11a499['query']);_0x2d5d59[_0xe340('0x3e')]=_['intersection'](_0x2d5d59[_0xe340('0x3c')],_0x2d5d59[_0xe340('0x3d')]);_0xa287f2[_0xe340('0x3f')]=_[_0xe340('0x40')](_0x2d5d59[_0xe340('0x3c')],qs[_0xe340('0x41')](_0x11a499['query'][_0xe340('0x41')]));_0xa287f2['attributes']=_0xa287f2[_0xe340('0x3f')][_0xe340('0x42')]?_0xa287f2[_0xe340('0x3f')]:_0x2d5d59['model'];if(!_0x11a499['query'][_0xe340('0x43')]('nolimit')){_0xa287f2[_0xe340('0x44')]=qs['limit'](_0x11a499[_0xe340('0x3d')]['limit']);_0xa287f2[_0xe340('0x2d')]=qs[_0xe340('0x2d')](_0x11a499[_0xe340('0x3d')]['offset']);}_0xa287f2[_0xe340('0x45')]=qs[_0xe340('0x46')](_0x11a499[_0xe340('0x3d')]['sort']);_0xa287f2[_0xe340('0x47')]=qs[_0xe340('0x3e')](_[_0xe340('0x48')](_0x11a499['query'],_0x2d5d59['filters']));if(_0x11a499[_0xe340('0x3d')][_0xe340('0x49')]){_0xa287f2[_0xe340('0x47')]=_['merge'](_0xa287f2['where'],{'$or':_[_0xe340('0x37')](_0xd02821,function(_0xca6487){if(_0xca6487[_0xe340('0x3a')]!==_0xe340('0x4a')){var _0x5e68fa={};_0x5e68fa[_0xca6487[_0xe340('0x34')]]={'$like':'%'+_0x11a499[_0xe340('0x3d')][_0xe340('0x49')]+'%'};return _0x5e68fa;}})});}_0xa287f2=_[_0xe340('0x4b')]({},_0xa287f2,_0x11a499[_0xe340('0x4c')]);var _0x586156={'where':_0xa287f2[_0xe340('0x47')]};return db[_0xe340('0x38')]['count'](_0x586156)[_0xe340('0x1e')](function(_0x4c3177){_0x5e0242[_0xe340('0x2c')]=_0x4c3177;if(_0x11a499[_0xe340('0x3d')][_0xe340('0x4d')]){_0xa287f2[_0xe340('0x4e')]=[{'all':!![]}];}return db[_0xe340('0x38')]['findAll'](_0xa287f2);})['then'](function(_0x3480e9){_0x5e0242['rows']=_0x3480e9;return _0x5e0242;})[_0xe340('0x1e')](respondWithFilteredResult(_0x367c32,_0xa287f2))['catch'](handleError(_0x367c32,null));};exports[_0xe340('0x4f')]=function(_0x5ca0f8,_0x1b9b92){var _0x4426bc={'raw':![],'where':{'id':_0x5ca0f8['params']['id']}},_0x5b8f5a={};_0x5b8f5a['model']=_[_0xe340('0x50')](db[_0xe340('0x38')][_0xe340('0x51')]);_0x5b8f5a[_0xe340('0x3d')]=_[_0xe340('0x50')](_0x5ca0f8[_0xe340('0x3d')]);_0x5b8f5a['filters']=_[_0xe340('0x40')](_0x5b8f5a[_0xe340('0x3c')],_0x5b8f5a['query']);_0x4426bc['attributes']=_['intersection'](_0x5b8f5a['model'],qs['fields'](_0x5ca0f8[_0xe340('0x3d')][_0xe340('0x41')]));_0x4426bc[_0xe340('0x3f')]=_0x4426bc[_0xe340('0x3f')][_0xe340('0x42')]?_0x4426bc[_0xe340('0x3f')]:_0x5b8f5a[_0xe340('0x3c')];if(_0x5ca0f8[_0xe340('0x3d')][_0xe340('0x4d')]){_0x4426bc['include']=[{'all':!![]}];}_0x4426bc=_[_0xe340('0x4b')]({},_0x4426bc,_0x5ca0f8['options']);return db['FreshdeskConfiguration'][_0xe340('0x52')](_0x4426bc)[_0xe340('0x1e')](handleEntityNotFound(_0x1b9b92,null))[_0xe340('0x1e')](respondWithResult(_0x1b9b92,null))['catch'](handleError(_0x1b9b92,null));};exports[_0xe340('0x53')]=function(_0x15ee9a,_0x4987e0){return db[_0xe340('0x38')][_0xe340('0x53')](_0x15ee9a[_0xe340('0x54')],{})[_0xe340('0x1e')](respondWithResult(_0x4987e0,0xc9))[_0xe340('0x27')](handleError(_0x4987e0,null));};exports[_0xe340('0x55')]=function(_0x24070a,_0x91e7a5){if(_0x24070a['body']['id']){delete _0x24070a[_0xe340('0x54')]['id'];}return db[_0xe340('0x38')]['find']({'where':{'id':_0x24070a[_0xe340('0x56')]['id']}})[_0xe340('0x1e')](handleEntityNotFound(_0x91e7a5,null))[_0xe340('0x1e')](saveUpdates(_0x24070a[_0xe340('0x54')],null))[_0xe340('0x1e')](respondWithResult(_0x91e7a5,null))[_0xe340('0x27')](handleError(_0x91e7a5,null));};exports[_0xe340('0x32')]=function(_0x179d7a,_0x514fe2){return db[_0xe340('0x38')][_0xe340('0x52')]({'where':{'id':_0x179d7a[_0xe340('0x56')]['id']}})[_0xe340('0x1e')](handleEntityNotFound(_0x514fe2,null))[_0xe340('0x1e')](removeEntity(_0x514fe2,null))[_0xe340('0x27')](handleError(_0x514fe2,null));};exports[_0xe340('0x57')]=function(_0x5b9a5e,_0x370779,_0x1d19bf){var _0x158c5f={};var _0x2dfc4a={};var _0x200687;var _0x2fff09;return db[_0xe340('0x38')][_0xe340('0x58')]({'where':{'id':_0x5b9a5e['params']['id']}})[_0xe340('0x1e')](handleEntityNotFound(_0x370779,null))['then'](function(_0x2ab662){if(_0x2ab662){_0x200687=_0x2ab662;_0x2dfc4a['model']=_['keys'](db[_0xe340('0x59')][_0xe340('0x51')]);_0x2dfc4a['query']=_[_0xe340('0x50')](_0x5b9a5e[_0xe340('0x3d')]);_0x2dfc4a['filters']=_[_0xe340('0x40')](_0x2dfc4a['model'],_0x2dfc4a[_0xe340('0x3d')]);_0x158c5f[_0xe340('0x3f')]=_['intersection'](_0x2dfc4a[_0xe340('0x3c')],qs[_0xe340('0x41')](_0x5b9a5e[_0xe340('0x3d')][_0xe340('0x41')]));_0x158c5f[_0xe340('0x3f')]=_0x158c5f[_0xe340('0x3f')]['length']?_0x158c5f['attributes']:_0x2dfc4a['model'];_0x158c5f[_0xe340('0x45')]=qs[_0xe340('0x46')](_0x5b9a5e[_0xe340('0x3d')][_0xe340('0x46')]);_0x158c5f[_0xe340('0x47')]=qs[_0xe340('0x3e')](_[_0xe340('0x48')](_0x5b9a5e[_0xe340('0x3d')],_0x2dfc4a[_0xe340('0x3e')]));if(_0x5b9a5e['query'][_0xe340('0x49')]){_0x158c5f['where']=_['merge'](_0x158c5f[_0xe340('0x47')],{'$or':_[_0xe340('0x37')](_0x158c5f[_0xe340('0x3f')],function(_0x5c99cf){var _0x3ff4e0={};_0x3ff4e0[_0x5c99cf]={'$like':'%'+_0x5b9a5e[_0xe340('0x3d')]['filter']+'%'};return _0x3ff4e0;})});}_0x158c5f=_[_0xe340('0x4b')]({},_0x158c5f,_0x5b9a5e['options']);return _0x200687[_0xe340('0x57')](_0x158c5f);}})['then'](function(_0x460ab2){if(_0x460ab2){_0x2fff09=_0x460ab2[_0xe340('0x42')];if(!_0x5b9a5e[_0xe340('0x3d')][_0xe340('0x43')]('nolimit')){_0x158c5f['limit']=qs[_0xe340('0x44')](_0x5b9a5e['query']['limit']);_0x158c5f[_0xe340('0x2d')]=qs[_0xe340('0x2d')](_0x5b9a5e[_0xe340('0x3d')][_0xe340('0x2d')]);}return _0x200687['getFields'](_0x158c5f);}})[_0xe340('0x1e')](function(_0x1578ea){if(_0x1578ea){return _0x1578ea?{'count':_0x2fff09,'rows':_0x1578ea}:null;}})[_0xe340('0x1e')](respondWithResult(_0x370779,null))[_0xe340('0x27')](handleError(_0x370779,null));};exports[_0xe340('0x5a')]=function(_0x1de7f3,_0x377d4d,_0x28e1a2){var _0x45a9c8={};var _0x35da9d={};var _0xe5f3d0;var _0x5351d4;return db[_0xe340('0x38')]['findOne']({'where':{'id':_0x1de7f3[_0xe340('0x56')]['id']}})['then'](handleEntityNotFound(_0x377d4d,null))['then'](function(_0x6d77a0){if(_0x6d77a0){_0xe5f3d0=_0x6d77a0;_0x35da9d[_0xe340('0x3c')]=_[_0xe340('0x50')](db['FreshdeskField'][_0xe340('0x51')]);_0x35da9d[_0xe340('0x3d')]=_[_0xe340('0x50')](_0x1de7f3[_0xe340('0x3d')]);_0x35da9d['filters']=_[_0xe340('0x40')](_0x35da9d['model'],_0x35da9d[_0xe340('0x3d')]);_0x45a9c8[_0xe340('0x3f')]=_[_0xe340('0x40')](_0x35da9d['model'],qs[_0xe340('0x41')](_0x1de7f3[_0xe340('0x3d')][_0xe340('0x41')]));_0x45a9c8[_0xe340('0x3f')]=_0x45a9c8[_0xe340('0x3f')][_0xe340('0x42')]?_0x45a9c8[_0xe340('0x3f')]:_0x35da9d[_0xe340('0x3c')];_0x45a9c8[_0xe340('0x45')]=qs['sort'](_0x1de7f3['query']['sort']);_0x45a9c8[_0xe340('0x47')]=qs[_0xe340('0x3e')](_[_0xe340('0x48')](_0x1de7f3[_0xe340('0x3d')],_0x35da9d['filters']));if(_0x1de7f3[_0xe340('0x3d')]['filter']){_0x45a9c8[_0xe340('0x47')]=_[_0xe340('0x4b')](_0x45a9c8[_0xe340('0x47')],{'$or':_[_0xe340('0x37')](_0x45a9c8[_0xe340('0x3f')],function(_0x2d9b3c){var _0x538f95={};_0x538f95[_0x2d9b3c]={'$like':'%'+_0x1de7f3[_0xe340('0x3d')][_0xe340('0x49')]+'%'};return _0x538f95;})});}_0x45a9c8=_[_0xe340('0x4b')]({},_0x45a9c8,_0x1de7f3['options']);return _0xe5f3d0[_0xe340('0x5a')](_0x45a9c8);}})[_0xe340('0x1e')](function(_0x378da6){if(_0x378da6){_0x5351d4=_0x378da6['length'];if(!_0x1de7f3[_0xe340('0x3d')][_0xe340('0x43')](_0xe340('0x5b'))){_0x45a9c8[_0xe340('0x44')]=qs[_0xe340('0x44')](_0x1de7f3[_0xe340('0x3d')][_0xe340('0x44')]);_0x45a9c8[_0xe340('0x2d')]=qs[_0xe340('0x2d')](_0x1de7f3[_0xe340('0x3d')][_0xe340('0x2d')]);}return _0xe5f3d0[_0xe340('0x5a')](_0x45a9c8);}})[_0xe340('0x1e')](function(_0x5af084){if(_0x5af084){return _0x5af084?{'count':_0x5351d4,'rows':_0x5af084}:null;}})['then'](respondWithResult(_0x377d4d,null))[_0xe340('0x27')](handleError(_0x377d4d,null));};exports[_0xe340('0x5c')]=function(_0x49c4aa,_0x2e3ff0,_0x35f60b){var _0x2a8631={};var _0x4446b1={};var _0x57fc00;var _0x225e6c;return db[_0xe340('0x38')]['findOne']({'where':{'id':_0x49c4aa[_0xe340('0x56')]['id']}})[_0xe340('0x1e')](handleEntityNotFound(_0x2e3ff0,null))[_0xe340('0x1e')](function(_0x479295){if(_0x479295){_0x57fc00=_0x479295;_0x4446b1[_0xe340('0x3c')]=_['keys'](db['FreshdeskField'][_0xe340('0x51')]);_0x4446b1[_0xe340('0x3d')]=_['keys'](_0x49c4aa['query']);_0x4446b1[_0xe340('0x3e')]=_[_0xe340('0x40')](_0x4446b1[_0xe340('0x3c')],_0x4446b1[_0xe340('0x3d')]);_0x2a8631[_0xe340('0x3f')]=_['intersection'](_0x4446b1['model'],qs[_0xe340('0x41')](_0x49c4aa[_0xe340('0x3d')][_0xe340('0x41')]));_0x2a8631['attributes']=_0x2a8631[_0xe340('0x3f')][_0xe340('0x42')]?_0x2a8631['attributes']:_0x4446b1[_0xe340('0x3c')];_0x2a8631[_0xe340('0x45')]=qs[_0xe340('0x46')](_0x49c4aa[_0xe340('0x3d')][_0xe340('0x46')]);_0x2a8631[_0xe340('0x47')]=qs[_0xe340('0x3e')](_[_0xe340('0x48')](_0x49c4aa[_0xe340('0x3d')],_0x4446b1[_0xe340('0x3e')]));if(_0x49c4aa[_0xe340('0x3d')]['filter']){_0x2a8631[_0xe340('0x47')]=_[_0xe340('0x4b')](_0x2a8631[_0xe340('0x47')],{'$or':_[_0xe340('0x37')](_0x2a8631[_0xe340('0x3f')],function(_0x3bf552){var _0x3fc763={};_0x3fc763[_0x3bf552]={'$like':'%'+_0x49c4aa[_0xe340('0x3d')][_0xe340('0x49')]+'%'};return _0x3fc763;})});}_0x2a8631=_[_0xe340('0x4b')]({},_0x2a8631,_0x49c4aa['options']);return _0x57fc00[_0xe340('0x5c')](_0x2a8631);}})[_0xe340('0x1e')](function(_0x5a91ff){if(_0x5a91ff){_0x225e6c=_0x5a91ff['length'];if(!_0x49c4aa[_0xe340('0x3d')][_0xe340('0x43')](_0xe340('0x5b'))){_0x2a8631[_0xe340('0x44')]=qs[_0xe340('0x44')](_0x49c4aa[_0xe340('0x3d')]['limit']);_0x2a8631[_0xe340('0x2d')]=qs['offset'](_0x49c4aa[_0xe340('0x3d')][_0xe340('0x2d')]);}return _0x57fc00[_0xe340('0x5c')](_0x2a8631);}})[_0xe340('0x1e')](function(_0x575aeb){if(_0x575aeb){return _0x575aeb?{'count':_0x225e6c,'rows':_0x575aeb}:null;}})[_0xe340('0x1e')](respondWithResult(_0x2e3ff0,null))[_0xe340('0x27')](handleError(_0x2e3ff0,null));};exports[_0xe340('0x5d')]=function(_0x30f642,_0x3e8d51,_0x542384){var _0x521bf0={};var _0x48e39e={};var _0x9a41af;var _0x3c9b15;return db[_0xe340('0x38')][_0xe340('0x58')]({'where':{'id':_0x30f642[_0xe340('0x56')]['id']}})[_0xe340('0x1e')](handleEntityNotFound(_0x3e8d51,null))[_0xe340('0x1e')](function(_0x458edd){if(_0x458edd){_0x9a41af=_0x458edd;_0x48e39e['model']=_[_0xe340('0x50')](db[_0xe340('0x5e')]['rawAttributes']);_0x48e39e['query']=_[_0xe340('0x50')](_0x30f642[_0xe340('0x3d')]);_0x48e39e[_0xe340('0x3e')]=_[_0xe340('0x40')](_0x48e39e[_0xe340('0x3c')],_0x48e39e[_0xe340('0x3d')]);_0x521bf0['attributes']=_['intersection'](_0x48e39e['model'],qs[_0xe340('0x41')](_0x30f642[_0xe340('0x3d')][_0xe340('0x41')]));_0x521bf0[_0xe340('0x3f')]=_0x521bf0[_0xe340('0x3f')]['length']?_0x521bf0[_0xe340('0x3f')]:_0x48e39e[_0xe340('0x3c')];_0x521bf0['order']=qs['sort'](_0x30f642[_0xe340('0x3d')][_0xe340('0x46')]);_0x521bf0[_0xe340('0x47')]=qs[_0xe340('0x3e')](_[_0xe340('0x48')](_0x30f642[_0xe340('0x3d')],_0x48e39e[_0xe340('0x3e')]));if(_0x30f642['query']['filter']){_0x521bf0['where']=_[_0xe340('0x4b')](_0x521bf0[_0xe340('0x47')],{'$or':_['map'](_0x521bf0[_0xe340('0x3f')],function(_0x42ab79){var _0x3c0b24={};_0x3c0b24[_0x42ab79]={'$like':'%'+_0x30f642['query']['filter']+'%'};return _0x3c0b24;})});}_0x521bf0=_[_0xe340('0x4b')]({},_0x521bf0,_0x30f642[_0xe340('0x4c')]);return _0x9a41af['getTags'](_0x521bf0);}})[_0xe340('0x1e')](function(_0x3e6ea3){if(_0x3e6ea3){_0x3c9b15=_0x3e6ea3['length'];if(!_0x30f642[_0xe340('0x3d')][_0xe340('0x43')]('nolimit')){_0x521bf0[_0xe340('0x44')]=qs['limit'](_0x30f642['query'][_0xe340('0x44')]);_0x521bf0[_0xe340('0x2d')]=qs['offset'](_0x30f642[_0xe340('0x3d')][_0xe340('0x2d')]);}return _0x9a41af[_0xe340('0x5d')](_0x521bf0);}})['then'](function(_0x2a6675){if(_0x2a6675){return _0x2a6675?{'count':_0x3c9b15,'rows':_0x2a6675}:null;}})[_0xe340('0x1e')](respondWithResult(_0x3e8d51,null))[_0xe340('0x27')](handleError(_0x3e8d51,null));};exports[_0xe340('0x5f')]=function(_0x9a3651,_0x5019f9,_0x291d81){if(_0x9a3651[_0xe340('0x54')]['id']){delete _0x9a3651[_0xe340('0x54')]['id'];}return db[_0xe340('0x38')][_0xe340('0x58')]({'where':{'id':_0x9a3651[_0xe340('0x56')]['id']}})[_0xe340('0x1e')](handleEntityNotFound(_0x5019f9,null))['then'](function(_0x227718){if(_0x227718){return _0x227718[_0xe340('0x5f')](_0x9a3651[_0xe340('0x54')][_0xe340('0x60')]||[]);}return null;})[_0xe340('0x1e')](respondWithResult(_0x5019f9,null))[_0xe340('0x27')](handleError(_0x5019f9,null));};
\ No newline at end of file
diff --git a/server/api/intFreshdeskConfiguration/intFreshdeskConfiguration.model.js b/server/api/intFreshdeskConfiguration/intFreshdeskConfiguration.model.js
index 32a05c9..815f2cd 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 _0xaed6=['./intFreshdeskConfiguration.attributes','exports','define','FreshdeskConfiguration','int_freshdesk_configurations','lodash','util','../../config/logger','api','moment','bluebird','request-promise','path','rimraf','../../config/environment'];(function(_0x68f89,_0x51d829){var _0xfeaab2=function(_0x28ed8e){while(--_0x28ed8e){_0x68f89['push'](_0x68f89['shift']());}};_0xfeaab2(++_0x51d829);}(_0xaed6,0xe6));var _0x6aed=function(_0x9f13de,_0x2c0b6b){_0x9f13de=_0x9f13de-0x0;var _0x1b678e=_0xaed6[_0x9f13de];return _0x1b678e;};'use strict';var _=require(_0x6aed('0x0'));var util=require(_0x6aed('0x1'));var logger=require(_0x6aed('0x2'))(_0x6aed('0x3'));var moment=require(_0x6aed('0x4'));var BPromise=require(_0x6aed('0x5'));var rp=require(_0x6aed('0x6'));var fs=require('fs');var path=require(_0x6aed('0x7'));var rimraf=require(_0x6aed('0x8'));var config=require(_0x6aed('0x9'));var attributes=require(_0x6aed('0xa'));module[_0x6aed('0xb')]=function(_0x56af78,_0x2ba0bc){return _0x56af78[_0x6aed('0xc')](_0x6aed('0xd'),attributes,{'tableName':_0x6aed('0xe'),'paranoid':![],'indexes':[],'timestamps':!![]});};
\ No newline at end of file
+var _0x4cff=['int_freshdesk_configurations','lodash','util','../../config/logger','api','bluebird','request-promise','rimraf','../../config/environment','./intFreshdeskConfiguration.attributes'];(function(_0x321bb2,_0x202794){var _0x9c12ed=function(_0x263dd3){while(--_0x263dd3){_0x321bb2['push'](_0x321bb2['shift']());}};_0x9c12ed(++_0x202794);}(_0x4cff,0x191));var _0xf4cf=function(_0x1eee16,_0xe0b93b){_0x1eee16=_0x1eee16-0x0;var _0x433c9c=_0x4cff[_0x1eee16];return _0x433c9c;};'use strict';var _=require(_0xf4cf('0x0'));var util=require(_0xf4cf('0x1'));var logger=require(_0xf4cf('0x2'))(_0xf4cf('0x3'));var moment=require('moment');var BPromise=require(_0xf4cf('0x4'));var rp=require(_0xf4cf('0x5'));var fs=require('fs');var path=require('path');var rimraf=require(_0xf4cf('0x6'));var config=require(_0xf4cf('0x7'));var attributes=require(_0xf4cf('0x8'));module['exports']=function(_0x2ab6dc,_0x2facb5){return _0x2ab6dc['define']('FreshdeskConfiguration',attributes,{'tableName':_0xf4cf('0x9'),'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 778af91..53b3ef6 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 _0xce3a=['util','moment','randomstring','ioredis','../../mysqldb','../../config/utils','rpc','../../config/environment','jayson/promise','http','request','info','FreshdeskConfiguration,\x20%s,\x20%s','debug','FreshdeskConfiguration,\x20%s,\x20%s,\x20%s','request\x20sent','stringify','error','code','message','result','catch','lodash'];(function(_0x5d1cb4,_0x2d0c2c){var _0x37ddca=function(_0x1a9adc){while(--_0x1a9adc){_0x5d1cb4['push'](_0x5d1cb4['shift']());}};_0x37ddca(++_0x2d0c2c);}(_0xce3a,0x12a));var _0xace3=function(_0x1acf21,_0x5127f8){_0x1acf21=_0x1acf21-0x0;var _0x2e116a=_0xce3a[_0x1acf21];return _0x2e116a;};'use strict';var _=require(_0xace3('0x0'));var util=require(_0xace3('0x1'));var moment=require(_0xace3('0x2'));var BPromise=require('bluebird');var rs=require(_0xace3('0x3'));var fs=require('fs');var Redis=require(_0xace3('0x4'));var db=require(_0xace3('0x5'))['db'];var utils=require(_0xace3('0x6'));var logger=require('../../config/logger')(_0xace3('0x7'));var config=require(_0xace3('0x8'));var jayson=require(_0xace3('0x9'));var client=jayson['client'][_0xace3('0xa')]({'port':0x232a});function respondWithRpcPromise(_0x3a23c5,_0x3d5a4d,_0x1659c6){return new BPromise(function(_0xcf8e87,_0x334003){return client[_0xace3('0xb')](_0x3a23c5,_0x1659c6)['then'](function(_0x106da6){logger[_0xace3('0xc')](_0xace3('0xd'),_0x3d5a4d,'request\x20sent');logger[_0xace3('0xe')](_0xace3('0xf'),_0x3d5a4d,_0xace3('0x10'),JSON[_0xace3('0x11')](_0x106da6));if(_0x106da6[_0xace3('0x12')]){if(_0x106da6['error'][_0xace3('0x13')]===0x1f4){logger['error'](_0xace3('0xd'),_0x3d5a4d,_0x106da6['error'][_0xace3('0x14')]);return _0x334003(_0x106da6[_0xace3('0x12')]['message']);}logger[_0xace3('0x12')](_0xace3('0xd'),_0x3d5a4d,_0x106da6[_0xace3('0x12')][_0xace3('0x14')]);return _0xcf8e87(_0x106da6[_0xace3('0x12')][_0xace3('0x14')]);}else{logger['info'](_0xace3('0xd'),_0x3d5a4d,_0xace3('0x10'));_0xcf8e87(_0x106da6[_0xace3('0x15')]['message']);}})[_0xace3('0x16')](function(_0x34be29){logger['error'](_0xace3('0xd'),_0x3d5a4d,_0x34be29);_0x334003(_0x34be29);});});}
\ No newline at end of file
+var _0x815a=['bluebird','ioredis','../../config/utils','rpc','jayson/promise','client','http','then','FreshdeskConfiguration,\x20%s,\x20%s','request\x20sent','stringify','error','code','message','info','result','lodash','util','moment'];(function(_0xc55d64,_0x133f2d){var _0x4194f6=function(_0x4a38c9){while(--_0x4a38c9){_0xc55d64['push'](_0xc55d64['shift']());}};_0x4194f6(++_0x133f2d);}(_0x815a,0xbb));var _0xa815=function(_0x49c057,_0xc808ed){_0x49c057=_0x49c057-0x0;var _0xd8f0e6=_0x815a[_0x49c057];return _0xd8f0e6;};'use strict';var _=require(_0xa815('0x0'));var util=require(_0xa815('0x1'));var moment=require(_0xa815('0x2'));var BPromise=require(_0xa815('0x3'));var rs=require('randomstring');var fs=require('fs');var Redis=require(_0xa815('0x4'));var db=require('../../mysqldb')['db'];var utils=require(_0xa815('0x5'));var logger=require('../../config/logger')(_0xa815('0x6'));var config=require('../../config/environment');var jayson=require(_0xa815('0x7'));var client=jayson[_0xa815('0x8')][_0xa815('0x9')]({'port':0x232a});function respondWithRpcPromise(_0xd78457,_0x5cb63f,_0x2172ab){return new BPromise(function(_0xc15c88,_0x584869){return client['request'](_0xd78457,_0x2172ab)[_0xa815('0xa')](function(_0x48b364){logger['info'](_0xa815('0xb'),_0x5cb63f,_0xa815('0xc'));logger['debug']('FreshdeskConfiguration,\x20%s,\x20%s,\x20%s',_0x5cb63f,_0xa815('0xc'),JSON[_0xa815('0xd')](_0x48b364));if(_0x48b364['error']){if(_0x48b364[_0xa815('0xe')][_0xa815('0xf')]===0x1f4){logger[_0xa815('0xe')](_0xa815('0xb'),_0x5cb63f,_0x48b364[_0xa815('0xe')][_0xa815('0x10')]);return _0x584869(_0x48b364[_0xa815('0xe')][_0xa815('0x10')]);}logger[_0xa815('0xe')](_0xa815('0xb'),_0x5cb63f,_0x48b364[_0xa815('0xe')][_0xa815('0x10')]);return _0xc15c88(_0x48b364['error'][_0xa815('0x10')]);}else{logger[_0xa815('0x11')]('FreshdeskConfiguration,\x20%s,\x20%s',_0x5cb63f,'request\x20sent');_0xc15c88(_0x48b364[_0xa815('0x12')][_0xa815('0x10')]);}})['catch'](function(_0x850671){logger[_0xa815('0xe')]('FreshdeskConfiguration,\x20%s,\x20%s',_0x5cb63f,_0x850671);_0x584869(_0x850671);});});}
\ No newline at end of file
diff --git a/server/api/intFreshdeskField/index.js b/server/api/intFreshdeskField/index.js
index ca62a4c..f10c828 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 _0x34e8=['multer','util','path','connect-timeout','Router','../../components/auth/service','../../components/interaction/service','../../config/environment','./intFreshdeskField.controller','get','isAuthenticated','show','post','create','put','/:id','update','delete','destroy','exports'];(function(_0x44474f,_0x431580){var _0x427d97=function(_0x53f7d4){while(--_0x53f7d4){_0x44474f['push'](_0x44474f['shift']());}};_0x427d97(++_0x431580);}(_0x34e8,0x12c));var _0x834e=function(_0x40fa6b,_0x175614){_0x40fa6b=_0x40fa6b-0x0;var _0x3bbe20=_0x34e8[_0x40fa6b];return _0x3bbe20;};'use strict';var multer=require(_0x834e('0x0'));var util=require(_0x834e('0x1'));var path=require(_0x834e('0x2'));var timeout=require(_0x834e('0x3'));var express=require('express');var router=express[_0x834e('0x4')]();var auth=require(_0x834e('0x5'));var interaction=require(_0x834e('0x6'));var config=require(_0x834e('0x7'));var controller=require(_0x834e('0x8'));router[_0x834e('0x9')]('/',auth[_0x834e('0xa')](),controller['index']);router[_0x834e('0x9')]('/:id',auth[_0x834e('0xa')](),controller[_0x834e('0xb')]);router[_0x834e('0xc')]('/',auth[_0x834e('0xa')](),controller[_0x834e('0xd')]);router[_0x834e('0xe')](_0x834e('0xf'),auth[_0x834e('0xa')](),controller[_0x834e('0x10')]);router[_0x834e('0x11')](_0x834e('0xf'),auth[_0x834e('0xa')](),controller[_0x834e('0x12')]);module[_0x834e('0x13')]=router;
\ No newline at end of file
+var _0x008c=['show','destroy','multer','util','path','connect-timeout','express','../../components/auth/service','../../components/interaction/service','../../config/environment','./intFreshdeskField.controller','get','isAuthenticated','index','/:id'];(function(_0x509bab,_0x317622){var _0x9842ca=function(_0x51970f){while(--_0x51970f){_0x509bab['push'](_0x509bab['shift']());}};_0x9842ca(++_0x317622);}(_0x008c,0x188));var _0xc008=function(_0x25e225,_0x4253fb){_0x25e225=_0x25e225-0x0;var _0x5ce20d=_0x008c[_0x25e225];return _0x5ce20d;};'use strict';var multer=require(_0xc008('0x0'));var util=require(_0xc008('0x1'));var path=require(_0xc008('0x2'));var timeout=require(_0xc008('0x3'));var express=require(_0xc008('0x4'));var router=express['Router']();var auth=require(_0xc008('0x5'));var interaction=require(_0xc008('0x6'));var config=require(_0xc008('0x7'));var controller=require(_0xc008('0x8'));router[_0xc008('0x9')]('/',auth[_0xc008('0xa')](),controller[_0xc008('0xb')]);router[_0xc008('0x9')](_0xc008('0xc'),auth['isAuthenticated'](),controller[_0xc008('0xd')]);router['post']('/',auth[_0xc008('0xa')](),controller['create']);router['put'](_0xc008('0xc'),auth[_0xc008('0xa')](),controller['update']);router['delete']('/:id',auth[_0xc008('0xa')](),controller[_0xc008('0xe')]);module['exports']=router;
\ No newline at end of file
diff --git a/server/api/intFreshdeskField/intFreshdeskField.attributes.js b/server/api/intFreshdeskField/intFreshdeskField.attributes.js
index 8665070..bceaaf2 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 _0xc03e=['ENUM','variable','BOOLEAN','sequelize','string','customVariable','STRING'];(function(_0x339ac7,_0x127451){var _0x32deff=function(_0x2f32ca){while(--_0x2f32ca){_0x339ac7['push'](_0x339ac7['shift']());}};_0x32deff(++_0x127451);}(_0xc03e,0x15a));var _0xec03=function(_0x3f7598,_0x212e37){_0x3f7598=_0x3f7598-0x0;var _0x51fb16=_0xc03e[_0x3f7598];return _0x51fb16;};'use strict';var Sequelize=require(_0xec03('0x0'));module['exports']={'type':{'type':Sequelize['ENUM'](_0xec03('0x1'),'variable',_0xec03('0x2'),'keyValue'),'defaultValue':_0xec03('0x1')},'content':{'type':Sequelize[_0xec03('0x3')]},'key':{'type':Sequelize[_0xec03('0x3')]},'keyType':{'type':Sequelize[_0xec03('0x4')](_0xec03('0x1'),_0xec03('0x5'),_0xec03('0x2'))},'keyContent':{'type':Sequelize[_0xec03('0x3')]},'idField':{'type':Sequelize[_0xec03('0x3')]},'nameField':{'type':Sequelize['STRING']},'customField':{'type':Sequelize[_0xec03('0x6')],'defaultValue':!![]},'variableName':{'type':Sequelize[_0xec03('0x3')]}};
\ No newline at end of file
+var _0x4350=['STRING','ENUM','sequelize','exports','string','customVariable','keyValue'];(function(_0x2ee96f,_0x21a613){var _0x8f741a=function(_0x6b4b8b){while(--_0x6b4b8b){_0x2ee96f['push'](_0x2ee96f['shift']());}};_0x8f741a(++_0x21a613);}(_0x4350,0x1d0));var _0x0435=function(_0x3f4ed8,_0x32b832){_0x3f4ed8=_0x3f4ed8-0x0;var _0x51e8b7=_0x4350[_0x3f4ed8];return _0x51e8b7;};'use strict';var Sequelize=require(_0x0435('0x0'));module[_0x0435('0x1')]={'type':{'type':Sequelize['ENUM'](_0x0435('0x2'),'variable',_0x0435('0x3'),_0x0435('0x4')),'defaultValue':'string'},'content':{'type':Sequelize[_0x0435('0x5')]},'key':{'type':Sequelize[_0x0435('0x5')]},'keyType':{'type':Sequelize[_0x0435('0x6')](_0x0435('0x2'),'variable',_0x0435('0x3'))},'keyContent':{'type':Sequelize['STRING']},'idField':{'type':Sequelize['STRING']},'nameField':{'type':Sequelize[_0x0435('0x5')]},'customField':{'type':Sequelize['BOOLEAN'],'defaultValue':!![]},'variableName':{'type':Sequelize['STRING']}};
\ No newline at end of file
diff --git a/server/api/intFreshdeskField/intFreshdeskField.controller.js b/server/api/intFreshdeskField/intFreshdeskField.controller.js
index 255bccc..333745b 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 _0x9626=['../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/environment','status','end','json','count','offset','limit','set','Content-Range','reject','save','update','then','sendStatus','name','send','index','map','rawAttributes','fieldName','type','model','query','keys','filters','intersection','attributes','fields','length','nolimit','order','sort','where','pick','filter','merge','VIRTUAL','options','FreshdeskField','includeAll','include','findAll','rows','catch','show','params','find','create','body','destroy','html-pdf','zip-dir','fast-json-patch','moment','bluebird','to-csv','lodash','squel','crypto','desk.js','querystring','ioredis'];(function(_0x374b9f,_0x35d296){var _0x4e6423=function(_0x15a880){while(--_0x15a880){_0x374b9f['push'](_0x374b9f['shift']());}};_0x4e6423(++_0x35d296);}(_0x9626,0x108));var _0x6962=function(_0x325467,_0x4cff05){_0x325467=_0x325467-0x0;var _0x3c4462=_0x9626[_0x325467];return _0x3c4462;};'use strict';var pdf=require(_0x6962('0x0'));var emlformat=require('eml-format');var rimraf=require('rimraf');var zipdir=require(_0x6962('0x1'));var jsonpatch=require(_0x6962('0x2'));var rp=require('request-promise');var moment=require(_0x6962('0x3'));var BPromise=require(_0x6962('0x4'));var Mustache=require('mustache');var util=require('util');var path=require('path');var sox=require('sox');var csv=require(_0x6962('0x5'));var ejs=require('ejs');var fs=require('fs');var _=require(_0x6962('0x6'));var squel=require(_0x6962('0x7'));var crypto=require(_0x6962('0x8'));var jsforce=require('jsforce');var deskjs=require(_0x6962('0x9'));var toCsv=require(_0x6962('0x5'));var querystring=require(_0x6962('0xa'));var Papa=require('papaparse');var Redis=require(_0x6962('0xb'));var authService=require(_0x6962('0xc'));var qs=require(_0x6962('0xd'));var as=require(_0x6962('0xe'));var hardwareService=require(_0x6962('0xf'));var logger=require(_0x6962('0x10'))(_0x6962('0x11'));var utils=require(_0x6962('0x12'));var config=require(_0x6962('0x13'));var db=require('../../mysqldb')['db'];function respondWithStatusCode(_0x3c36ba,_0x244d24){_0x244d24=_0x244d24||0xcc;return function(_0x30b397){if(_0x30b397){return _0x3c36ba['sendStatus'](_0x244d24);}return _0x3c36ba[_0x6962('0x14')](_0x244d24)[_0x6962('0x15')]();};}function respondWithResult(_0xb127ed,_0x6157f8){_0x6157f8=_0x6157f8||0xc8;return function(_0x6297f4){if(_0x6297f4){return _0xb127ed[_0x6962('0x14')](_0x6157f8)[_0x6962('0x16')](_0x6297f4);}};}function respondWithFilteredResult(_0x3dda9f,_0x42de29){return function(_0x2929b6){if(_0x2929b6){var _0x1ef830=_0x2929b6[_0x6962('0x17')],_0xa8403e=_0x42de29['offset'],_0x20c437=_0x42de29[_0x6962('0x18')]+_0x42de29[_0x6962('0x19')],_0x524e46;if(_0x20c437>=_0x1ef830){_0x20c437=_0x1ef830;_0x524e46=0xc8;}else{_0x524e46=0xce;}_0x3dda9f[_0x6962('0x14')](_0x524e46);return _0x3dda9f[_0x6962('0x1a')](_0x6962('0x1b'),_0xa8403e+'-'+_0x20c437+'/'+_0x1ef830)[_0x6962('0x16')](_0x2929b6);}return null;};}function patchUpdates(_0x549fc2){return function(_0x11a0a0){try{jsonpatch['apply'](_0x11a0a0,_0x549fc2,!![]);}catch(_0xe55731){return BPromise[_0x6962('0x1c')](_0xe55731);}return _0x11a0a0[_0x6962('0x1d')]();};}function saveUpdates(_0x10f22a,_0x2c613b){return function(_0x33d1a2){if(_0x33d1a2){return _0x33d1a2[_0x6962('0x1e')](_0x10f22a)['then'](function(_0x5f26d5){return _0x5f26d5;});}return null;};}function removeEntity(_0x4e9291,_0x1e5968){return function(_0x58146c){if(_0x58146c){return _0x58146c['destroy']()[_0x6962('0x1f')](function(){_0x4e9291[_0x6962('0x14')](0xcc)['end']();});}};}function handleEntityNotFound(_0x3bffc7,_0x3ba4aa){return function(_0x13ac50){if(!_0x13ac50){_0x3bffc7[_0x6962('0x20')](0x194);}return _0x13ac50;};}function handleError(_0x348524,_0x47722b){_0x47722b=_0x47722b||0x1f4;return function(_0x501e95){logger['error'](_0x501e95['stack']);if(_0x501e95[_0x6962('0x21')]){delete _0x501e95['name'];}_0x348524[_0x6962('0x14')](_0x47722b)[_0x6962('0x22')](_0x501e95);};}exports[_0x6962('0x23')]=function(_0x5d243b,_0x43d6ae){var _0x3fb142={},_0x448475={},_0x5172fb={'count':0x0,'rows':[]};var _0x200ebc=_[_0x6962('0x24')](db['FreshdeskField'][_0x6962('0x25')],function(_0x390546){return{'name':_0x390546[_0x6962('0x26')],'type':_0x390546[_0x6962('0x27')]['key']};});_0x448475[_0x6962('0x28')]=_['map'](_0x200ebc,_0x6962('0x21'));_0x448475[_0x6962('0x29')]=_[_0x6962('0x2a')](_0x5d243b[_0x6962('0x29')]);_0x448475[_0x6962('0x2b')]=_[_0x6962('0x2c')](_0x448475['model'],_0x448475['query']);_0x3fb142[_0x6962('0x2d')]=_[_0x6962('0x2c')](_0x448475[_0x6962('0x28')],qs['fields'](_0x5d243b[_0x6962('0x29')][_0x6962('0x2e')]));_0x3fb142[_0x6962('0x2d')]=_0x3fb142['attributes'][_0x6962('0x2f')]?_0x3fb142[_0x6962('0x2d')]:_0x448475['model'];if(!_0x5d243b[_0x6962('0x29')]['hasOwnProperty'](_0x6962('0x30'))){_0x3fb142[_0x6962('0x19')]=qs[_0x6962('0x19')](_0x5d243b['query']['limit']);_0x3fb142[_0x6962('0x18')]=qs['offset'](_0x5d243b[_0x6962('0x29')][_0x6962('0x18')]);}_0x3fb142[_0x6962('0x31')]=qs[_0x6962('0x32')](_0x5d243b[_0x6962('0x29')]['sort']);_0x3fb142[_0x6962('0x33')]=qs[_0x6962('0x2b')](_[_0x6962('0x34')](_0x5d243b['query'],_0x448475[_0x6962('0x2b')]));if(_0x5d243b[_0x6962('0x29')][_0x6962('0x35')]){_0x3fb142[_0x6962('0x33')]=_[_0x6962('0x36')](_0x3fb142['where'],{'$or':_[_0x6962('0x24')](_0x200ebc,function(_0x2dacb7){if(_0x2dacb7[_0x6962('0x27')]!==_0x6962('0x37')){var _0x56c939={};_0x56c939[_0x2dacb7[_0x6962('0x21')]]={'$like':'%'+_0x5d243b['query'][_0x6962('0x35')]+'%'};return _0x56c939;}})});}_0x3fb142=_[_0x6962('0x36')]({},_0x3fb142,_0x5d243b[_0x6962('0x38')]);var _0x2392c1={'where':_0x3fb142['where']};return db[_0x6962('0x39')][_0x6962('0x17')](_0x2392c1)[_0x6962('0x1f')](function(_0x38dee0){_0x5172fb[_0x6962('0x17')]=_0x38dee0;if(_0x5d243b[_0x6962('0x29')][_0x6962('0x3a')]){_0x3fb142[_0x6962('0x3b')]=[{'all':!![]}];}return db[_0x6962('0x39')][_0x6962('0x3c')](_0x3fb142);})[_0x6962('0x1f')](function(_0x14f5a1){_0x5172fb[_0x6962('0x3d')]=_0x14f5a1;return _0x5172fb;})[_0x6962('0x1f')](respondWithFilteredResult(_0x43d6ae,_0x3fb142))[_0x6962('0x3e')](handleError(_0x43d6ae,null));};exports[_0x6962('0x3f')]=function(_0x15767b,_0x1c5b0c){var _0x285cab={'raw':!![],'where':{'id':_0x15767b[_0x6962('0x40')]['id']}},_0x2302cc={};_0x2302cc['model']=_[_0x6962('0x2a')](db[_0x6962('0x39')]['rawAttributes']);_0x2302cc['query']=_[_0x6962('0x2a')](_0x15767b[_0x6962('0x29')]);_0x2302cc[_0x6962('0x2b')]=_[_0x6962('0x2c')](_0x2302cc[_0x6962('0x28')],_0x2302cc[_0x6962('0x29')]);_0x285cab[_0x6962('0x2d')]=_[_0x6962('0x2c')](_0x2302cc['model'],qs[_0x6962('0x2e')](_0x15767b[_0x6962('0x29')][_0x6962('0x2e')]));_0x285cab[_0x6962('0x2d')]=_0x285cab[_0x6962('0x2d')][_0x6962('0x2f')]?_0x285cab[_0x6962('0x2d')]:_0x2302cc[_0x6962('0x28')];if(_0x15767b['query'][_0x6962('0x3a')]){_0x285cab[_0x6962('0x3b')]=[{'all':!![]}];}_0x285cab=_[_0x6962('0x36')]({},_0x285cab,_0x15767b[_0x6962('0x38')]);return db[_0x6962('0x39')][_0x6962('0x41')](_0x285cab)[_0x6962('0x1f')](handleEntityNotFound(_0x1c5b0c,null))[_0x6962('0x1f')](respondWithResult(_0x1c5b0c,null))['catch'](handleError(_0x1c5b0c,null));};exports[_0x6962('0x42')]=function(_0x203065,_0x5e86b7){return db[_0x6962('0x39')][_0x6962('0x42')](_0x203065[_0x6962('0x43')],{})[_0x6962('0x1f')](respondWithResult(_0x5e86b7,0xc9))[_0x6962('0x3e')](handleError(_0x5e86b7,null));};exports[_0x6962('0x1e')]=function(_0x39b35b,_0x45be52){if(_0x39b35b[_0x6962('0x43')]['id']){delete _0x39b35b[_0x6962('0x43')]['id'];}return db[_0x6962('0x39')][_0x6962('0x41')]({'where':{'id':_0x39b35b[_0x6962('0x40')]['id']}})[_0x6962('0x1f')](handleEntityNotFound(_0x45be52,null))[_0x6962('0x1f')](saveUpdates(_0x39b35b[_0x6962('0x43')],null))[_0x6962('0x1f')](respondWithResult(_0x45be52,null))[_0x6962('0x3e')](handleError(_0x45be52,null));};exports[_0x6962('0x44')]=function(_0x29770b,_0x566046){return db[_0x6962('0x39')]['find']({'where':{'id':_0x29770b[_0x6962('0x40')]['id']}})[_0x6962('0x1f')](handleEntityNotFound(_0x566046,null))[_0x6962('0x1f')](removeEntity(_0x566046,null))[_0x6962('0x3e')](handleError(_0x566046,null));};
\ No newline at end of file
+var _0x0b21=['limit','set','json','apply','reject','save','then','end','error','stack','name','send','index','rawAttributes','type','model','query','filters','intersection','fields','attributes','length','hasOwnProperty','nolimit','sort','where','filter','map','merge','options','FreshdeskField','include','findAll','rows','catch','params','includeAll','find','create','body','html-pdf','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','moment','bluebird','mustache','path','to-csv','ejs','lodash','squel','crypto','jsforce','desk.js','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../config/license/hardware','../../config/utils','../../config/environment','../../mysqldb','sendStatus','status','count','offset'];(function(_0x12d033,_0x25fa2f){var _0x3b4e80=function(_0x46c1f4){while(--_0x46c1f4){_0x12d033['push'](_0x12d033['shift']());}};_0x3b4e80(++_0x25fa2f);}(_0x0b21,0x1cc));var _0x10b2=function(_0x442416,_0x24a1f7){_0x442416=_0x442416-0x0;var _0x30b798=_0x0b21[_0x442416];return _0x30b798;};'use strict';var pdf=require(_0x10b2('0x0'));var emlformat=require(_0x10b2('0x1'));var rimraf=require(_0x10b2('0x2'));var zipdir=require(_0x10b2('0x3'));var jsonpatch=require(_0x10b2('0x4'));var rp=require(_0x10b2('0x5'));var moment=require(_0x10b2('0x6'));var BPromise=require(_0x10b2('0x7'));var Mustache=require(_0x10b2('0x8'));var util=require('util');var path=require(_0x10b2('0x9'));var sox=require('sox');var csv=require(_0x10b2('0xa'));var ejs=require(_0x10b2('0xb'));var fs=require('fs');var _=require(_0x10b2('0xc'));var squel=require(_0x10b2('0xd'));var crypto=require(_0x10b2('0xe'));var jsforce=require(_0x10b2('0xf'));var deskjs=require(_0x10b2('0x10'));var toCsv=require('to-csv');var querystring=require(_0x10b2('0x11'));var Papa=require(_0x10b2('0x12'));var Redis=require(_0x10b2('0x13'));var authService=require(_0x10b2('0x14'));var qs=require(_0x10b2('0x15'));var as=require('../../components/parsers/advancedSearch');var hardwareService=require(_0x10b2('0x16'));var logger=require('../../config/logger')('api');var utils=require(_0x10b2('0x17'));var config=require(_0x10b2('0x18'));var db=require(_0x10b2('0x19'))['db'];function respondWithStatusCode(_0x5b2573,_0xba3af){_0xba3af=_0xba3af||0xcc;return function(_0x4501f4){if(_0x4501f4){return _0x5b2573[_0x10b2('0x1a')](_0xba3af);}return _0x5b2573[_0x10b2('0x1b')](_0xba3af)['end']();};}function respondWithResult(_0x1cdf5d,_0x21aa2e){_0x21aa2e=_0x21aa2e||0xc8;return function(_0x402e29){if(_0x402e29){return _0x1cdf5d[_0x10b2('0x1b')](_0x21aa2e)['json'](_0x402e29);}};}function respondWithFilteredResult(_0x22c33f,_0x279b0d){return function(_0x38a072){if(_0x38a072){var _0x1eb9d5=_0x38a072[_0x10b2('0x1c')],_0x4ec3f8=_0x279b0d[_0x10b2('0x1d')],_0x3c40e9=_0x279b0d['offset']+_0x279b0d[_0x10b2('0x1e')],_0x528291;if(_0x3c40e9>=_0x1eb9d5){_0x3c40e9=_0x1eb9d5;_0x528291=0xc8;}else{_0x528291=0xce;}_0x22c33f[_0x10b2('0x1b')](_0x528291);return _0x22c33f[_0x10b2('0x1f')]('Content-Range',_0x4ec3f8+'-'+_0x3c40e9+'/'+_0x1eb9d5)[_0x10b2('0x20')](_0x38a072);}return null;};}function patchUpdates(_0x54bab8){return function(_0xb1f0f6){try{jsonpatch[_0x10b2('0x21')](_0xb1f0f6,_0x54bab8,!![]);}catch(_0x552ce3){return BPromise[_0x10b2('0x22')](_0x552ce3);}return _0xb1f0f6[_0x10b2('0x23')]();};}function saveUpdates(_0xa50342,_0x520699){return function(_0x1df200){if(_0x1df200){return _0x1df200['update'](_0xa50342)[_0x10b2('0x24')](function(_0x460d6f){return _0x460d6f;});}return null;};}function removeEntity(_0x8d659b,_0x25d533){return function(_0x33a0b6){if(_0x33a0b6){return _0x33a0b6['destroy']()[_0x10b2('0x24')](function(){_0x8d659b[_0x10b2('0x1b')](0xcc)[_0x10b2('0x25')]();});}};}function handleEntityNotFound(_0x1b9cfc,_0x361835){return function(_0x4a0f88){if(!_0x4a0f88){_0x1b9cfc[_0x10b2('0x1a')](0x194);}return _0x4a0f88;};}function handleError(_0x4a16a6,_0x172c49){_0x172c49=_0x172c49||0x1f4;return function(_0x426f88){logger[_0x10b2('0x26')](_0x426f88[_0x10b2('0x27')]);if(_0x426f88[_0x10b2('0x28')]){delete _0x426f88[_0x10b2('0x28')];}_0x4a16a6[_0x10b2('0x1b')](_0x172c49)[_0x10b2('0x29')](_0x426f88);};}exports[_0x10b2('0x2a')]=function(_0x5d7791,_0x1f8831){var _0x1e2baa={},_0x449ba4={},_0x562d4e={'count':0x0,'rows':[]};var _0x106082=_['map'](db['FreshdeskField'][_0x10b2('0x2b')],function(_0x53db7f){return{'name':_0x53db7f['fieldName'],'type':_0x53db7f[_0x10b2('0x2c')]['key']};});_0x449ba4[_0x10b2('0x2d')]=_['map'](_0x106082,'name');_0x449ba4[_0x10b2('0x2e')]=_['keys'](_0x5d7791[_0x10b2('0x2e')]);_0x449ba4[_0x10b2('0x2f')]=_[_0x10b2('0x30')](_0x449ba4[_0x10b2('0x2d')],_0x449ba4[_0x10b2('0x2e')]);_0x1e2baa['attributes']=_['intersection'](_0x449ba4[_0x10b2('0x2d')],qs['fields'](_0x5d7791[_0x10b2('0x2e')][_0x10b2('0x31')]));_0x1e2baa[_0x10b2('0x32')]=_0x1e2baa[_0x10b2('0x32')][_0x10b2('0x33')]?_0x1e2baa[_0x10b2('0x32')]:_0x449ba4['model'];if(!_0x5d7791[_0x10b2('0x2e')][_0x10b2('0x34')](_0x10b2('0x35'))){_0x1e2baa[_0x10b2('0x1e')]=qs[_0x10b2('0x1e')](_0x5d7791['query'][_0x10b2('0x1e')]);_0x1e2baa[_0x10b2('0x1d')]=qs[_0x10b2('0x1d')](_0x5d7791[_0x10b2('0x2e')][_0x10b2('0x1d')]);}_0x1e2baa['order']=qs[_0x10b2('0x36')](_0x5d7791[_0x10b2('0x2e')][_0x10b2('0x36')]);_0x1e2baa[_0x10b2('0x37')]=qs['filters'](_['pick'](_0x5d7791['query'],_0x449ba4[_0x10b2('0x2f')]));if(_0x5d7791['query'][_0x10b2('0x38')]){_0x1e2baa[_0x10b2('0x37')]=_['merge'](_0x1e2baa[_0x10b2('0x37')],{'$or':_[_0x10b2('0x39')](_0x106082,function(_0xe9c9a7){if(_0xe9c9a7[_0x10b2('0x2c')]!=='VIRTUAL'){var _0x3abb6a={};_0x3abb6a[_0xe9c9a7[_0x10b2('0x28')]]={'$like':'%'+_0x5d7791[_0x10b2('0x2e')]['filter']+'%'};return _0x3abb6a;}})});}_0x1e2baa=_[_0x10b2('0x3a')]({},_0x1e2baa,_0x5d7791[_0x10b2('0x3b')]);var _0x2d01d8={'where':_0x1e2baa['where']};return db[_0x10b2('0x3c')][_0x10b2('0x1c')](_0x2d01d8)[_0x10b2('0x24')](function(_0x122d75){_0x562d4e['count']=_0x122d75;if(_0x5d7791[_0x10b2('0x2e')]['includeAll']){_0x1e2baa[_0x10b2('0x3d')]=[{'all':!![]}];}return db[_0x10b2('0x3c')][_0x10b2('0x3e')](_0x1e2baa);})[_0x10b2('0x24')](function(_0x4ba262){_0x562d4e[_0x10b2('0x3f')]=_0x4ba262;return _0x562d4e;})[_0x10b2('0x24')](respondWithFilteredResult(_0x1f8831,_0x1e2baa))[_0x10b2('0x40')](handleError(_0x1f8831,null));};exports['show']=function(_0xb3ed34,_0x31f472){var _0x38d0e3={'raw':!![],'where':{'id':_0xb3ed34[_0x10b2('0x41')]['id']}},_0x51f565={};_0x51f565[_0x10b2('0x2d')]=_['keys'](db[_0x10b2('0x3c')][_0x10b2('0x2b')]);_0x51f565[_0x10b2('0x2e')]=_['keys'](_0xb3ed34[_0x10b2('0x2e')]);_0x51f565[_0x10b2('0x2f')]=_[_0x10b2('0x30')](_0x51f565[_0x10b2('0x2d')],_0x51f565[_0x10b2('0x2e')]);_0x38d0e3[_0x10b2('0x32')]=_[_0x10b2('0x30')](_0x51f565['model'],qs[_0x10b2('0x31')](_0xb3ed34['query'][_0x10b2('0x31')]));_0x38d0e3[_0x10b2('0x32')]=_0x38d0e3[_0x10b2('0x32')][_0x10b2('0x33')]?_0x38d0e3[_0x10b2('0x32')]:_0x51f565[_0x10b2('0x2d')];if(_0xb3ed34[_0x10b2('0x2e')][_0x10b2('0x42')]){_0x38d0e3[_0x10b2('0x3d')]=[{'all':!![]}];}_0x38d0e3=_[_0x10b2('0x3a')]({},_0x38d0e3,_0xb3ed34[_0x10b2('0x3b')]);return db[_0x10b2('0x3c')][_0x10b2('0x43')](_0x38d0e3)[_0x10b2('0x24')](handleEntityNotFound(_0x31f472,null))[_0x10b2('0x24')](respondWithResult(_0x31f472,null))[_0x10b2('0x40')](handleError(_0x31f472,null));};exports[_0x10b2('0x44')]=function(_0x64f5c2,_0x303297){return db[_0x10b2('0x3c')][_0x10b2('0x44')](_0x64f5c2[_0x10b2('0x45')],{})[_0x10b2('0x24')](respondWithResult(_0x303297,0xc9))[_0x10b2('0x40')](handleError(_0x303297,null));};exports['update']=function(_0x25b786,_0x27d7b7){if(_0x25b786[_0x10b2('0x45')]['id']){delete _0x25b786[_0x10b2('0x45')]['id'];}return db[_0x10b2('0x3c')][_0x10b2('0x43')]({'where':{'id':_0x25b786[_0x10b2('0x41')]['id']}})[_0x10b2('0x24')](handleEntityNotFound(_0x27d7b7,null))[_0x10b2('0x24')](saveUpdates(_0x25b786['body'],null))['then'](respondWithResult(_0x27d7b7,null))[_0x10b2('0x40')](handleError(_0x27d7b7,null));};exports['destroy']=function(_0x203cf3,_0x35348c){return db['FreshdeskField'][_0x10b2('0x43')]({'where':{'id':_0x203cf3['params']['id']}})[_0x10b2('0x24')](handleEntityNotFound(_0x35348c,null))[_0x10b2('0x24')](removeEntity(_0x35348c,null))[_0x10b2('0x40')](handleError(_0x35348c,null));};
\ No newline at end of file
diff --git a/server/api/intFreshdeskField/intFreshdeskField.model.js b/server/api/intFreshdeskField/intFreshdeskField.model.js
index 2a933c0..e4b8d64 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 _0xe128=['FreshdeskField','freshdesk_unique_index','lodash','util','../../config/logger','api','moment','bluebird','request-promise','../../config/environment','./intFreshdeskField.attributes','define'];(function(_0x415c4a,_0x112dd2){var _0x73ac8c=function(_0xde55e8){while(--_0xde55e8){_0x415c4a['push'](_0x415c4a['shift']());}};_0x73ac8c(++_0x112dd2);}(_0xe128,0x7a));var _0x8e12=function(_0x289e64,_0x5adb3c){_0x289e64=_0x289e64-0x0;var _0x30246c=_0xe128[_0x289e64];return _0x30246c;};'use strict';var _=require(_0x8e12('0x0'));var util=require(_0x8e12('0x1'));var logger=require(_0x8e12('0x2'))(_0x8e12('0x3'));var moment=require(_0x8e12('0x4'));var BPromise=require(_0x8e12('0x5'));var rp=require(_0x8e12('0x6'));var fs=require('fs');var path=require('path');var rimraf=require('rimraf');var config=require(_0x8e12('0x7'));var attributes=require(_0x8e12('0x8'));module['exports']=function(_0x5bd8a6,_0x26c841){return _0x5bd8a6[_0x8e12('0x9')](_0x8e12('0xa'),attributes,{'tableName':'int_freshdesk_fields','paranoid':![],'indexes':[{'name':_0x8e12('0xb'),'fields':['idField','FieldId'],'unique':!![]}],'timestamps':!![]});};
\ No newline at end of file
+var _0xde16=['int_freshdesk_fields','idField','FieldId','util','api','moment','bluebird','request-promise','path','rimraf','../../config/environment','exports'];(function(_0x62c958,_0x2bfdbc){var _0x57ec61=function(_0x5c0094){while(--_0x5c0094){_0x62c958['push'](_0x62c958['shift']());}};_0x57ec61(++_0x2bfdbc);}(_0xde16,0x177));var _0x6de1=function(_0x40f60f,_0x6930d5){_0x40f60f=_0x40f60f-0x0;var _0x307011=_0xde16[_0x40f60f];return _0x307011;};'use strict';var _=require('lodash');var util=require(_0x6de1('0x0'));var logger=require('../../config/logger')(_0x6de1('0x1'));var moment=require(_0x6de1('0x2'));var BPromise=require(_0x6de1('0x3'));var rp=require(_0x6de1('0x4'));var fs=require('fs');var path=require(_0x6de1('0x5'));var rimraf=require(_0x6de1('0x6'));var config=require(_0x6de1('0x7'));var attributes=require('./intFreshdeskField.attributes');module[_0x6de1('0x8')]=function(_0xd2ea51,_0x31e00e){return _0xd2ea51['define']('FreshdeskField',attributes,{'tableName':_0x6de1('0x9'),'paranoid':![],'indexes':[{'name':'freshdesk_unique_index','fields':[_0x6de1('0xa'),_0x6de1('0xb')],'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 be20296..bf2870a 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(_0x3dd15e,_0x1f0015){var _0x231fd0=function(_0x4f680a){while(--_0x4f680a){_0x3dd15e['push'](_0x3dd15e['shift']());}};_0x231fd0(++_0x1f0015);}(_0x7a54,0x106));var _0x47a5=function(_0x2dd939,_0x31642c){_0x2dd939=_0x2dd939-0x0;var _0x30698e=_0x7a54[_0x2dd939];return _0x30698e;};'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 _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(_0x3b380d,_0x4bf247){var _0x54502b=function(_0x35d207){while(--_0x35d207){_0x3b380d['push'](_0x3b380d['shift']());}};_0x54502b(++_0x4bf247);}(_0x7a54,0x106));var _0x47a5=function(_0x1f9369,_0x5a2d74){_0x1f9369=_0x1f9369-0x0;var _0x2d9d84=_0x7a54[_0x1f9369];return _0x2d9d84;};'use strict';var _=require(_0x47a5('0x0'));var util=require(_0x47a5('0x1'));var moment=require(_0x47a5('0x2'));var BPromise=require('bluebird');var rs=require(_0x47a5('0x3'));var fs=require('fs');var Redis=require(_0x47a5('0x4'));var db=require('../../mysqldb')['db'];var utils=require(_0x47a5('0x5'));var logger=require(_0x47a5('0x6'))(_0x47a5('0x7'));var config=require(_0x47a5('0x8'));var jayson=require(_0x47a5('0x9'));var client=jayson['client'][_0x47a5('0xa')]({'port':0x232a});function respondWithRpcPromise(_0x59199c,_0x343372,_0x30e405){return new BPromise(function(_0x506eda,_0x194fb0){return client['request'](_0x59199c,_0x30e405)['then'](function(_0x582352){logger[_0x47a5('0xb')](_0x47a5('0xc'),_0x343372,'request\x20sent');logger[_0x47a5('0xd')]('FreshdeskField,\x20%s,\x20%s,\x20%s',_0x343372,'request\x20sent',JSON[_0x47a5('0xe')](_0x582352));if(_0x582352[_0x47a5('0xf')]){if(_0x582352[_0x47a5('0xf')][_0x47a5('0x10')]===0x1f4){logger[_0x47a5('0xf')](_0x47a5('0xc'),_0x343372,_0x582352[_0x47a5('0xf')]['message']);return _0x194fb0(_0x582352[_0x47a5('0xf')][_0x47a5('0x11')]);}logger[_0x47a5('0xf')](_0x47a5('0xc'),_0x343372,_0x582352[_0x47a5('0xf')][_0x47a5('0x11')]);return _0x506eda(_0x582352[_0x47a5('0xf')][_0x47a5('0x11')]);}else{logger['info'](_0x47a5('0xc'),_0x343372,_0x47a5('0x12'));_0x506eda(_0x582352[_0x47a5('0x13')][_0x47a5('0x11')]);}})[_0x47a5('0x14')](function(_0x574af6){logger['error'](_0x47a5('0xc'),_0x343372,_0x574af6);_0x194fb0(_0x574af6);});});}
\ No newline at end of file
diff --git a/server/api/intFreshsalesAccount/index.js b/server/api/intFreshsalesAccount/index.js
index 4a517c0..b30d1d6 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 _0x76d4=['getFields','post','put','delete','/:id','exports','multer','util','connect-timeout','express','Router','../../components/auth/service','../../components/interaction/service','isAuthenticated','index','show','get','/:id/configurations'];(function(_0x5cc670,_0x3613cc){var _0x2842af=function(_0x47a2d9){while(--_0x47a2d9){_0x5cc670['push'](_0x5cc670['shift']());}};_0x2842af(++_0x3613cc);}(_0x76d4,0x14a));var _0x476d=function(_0x2bba15,_0x2059ea){_0x2bba15=_0x2bba15-0x0;var _0x391b08=_0x76d4[_0x2bba15];return _0x391b08;};'use strict';var multer=require(_0x476d('0x0'));var util=require(_0x476d('0x1'));var path=require('path');var timeout=require(_0x476d('0x2'));var express=require(_0x476d('0x3'));var router=express[_0x476d('0x4')]();var auth=require(_0x476d('0x5'));var interaction=require(_0x476d('0x6'));var config=require('../../config/environment');var controller=require('./intFreshsalesAccount.controller');router['get']('/',auth[_0x476d('0x7')](),controller[_0x476d('0x8')]);router['get']('/:id',auth['isAuthenticated'](),controller[_0x476d('0x9')]);router[_0x476d('0xa')](_0x476d('0xb'),auth[_0x476d('0x7')](),controller['getConfigurations']);router[_0x476d('0xa')]('/:id/fields',auth[_0x476d('0x7')](),controller[_0x476d('0xc')]);router[_0x476d('0xd')]('/',auth['isAuthenticated'](),controller['create']);router['post'](_0x476d('0xb'),auth[_0x476d('0x7')](),controller['addConfiguration']);router[_0x476d('0xe')]('/:id',auth['isAuthenticated'](),controller['update']);router[_0x476d('0xf')](_0x476d('0x10'),auth[_0x476d('0x7')](),controller['destroy']);module[_0x476d('0x11')]=router;
\ No newline at end of file
+var _0xfb6a=['isAuthenticated','index','/:id','show','/:id/configurations','getFields','post','create','addConfiguration','put','update','exports','multer','util','path','connect-timeout','express','Router','../../components/auth/service','../../config/environment','./intFreshsalesAccount.controller','get'];(function(_0x2def9e,_0x4c6715){var _0x2adeb9=function(_0xc2d946){while(--_0xc2d946){_0x2def9e['push'](_0x2def9e['shift']());}};_0x2adeb9(++_0x4c6715);}(_0xfb6a,0xa6));var _0xafb6=function(_0x4e7413,_0x5dffb1){_0x4e7413=_0x4e7413-0x0;var _0x11b6de=_0xfb6a[_0x4e7413];return _0x11b6de;};'use strict';var multer=require(_0xafb6('0x0'));var util=require(_0xafb6('0x1'));var path=require(_0xafb6('0x2'));var timeout=require(_0xafb6('0x3'));var express=require(_0xafb6('0x4'));var router=express[_0xafb6('0x5')]();var auth=require(_0xafb6('0x6'));var interaction=require('../../components/interaction/service');var config=require(_0xafb6('0x7'));var controller=require(_0xafb6('0x8'));router[_0xafb6('0x9')]('/',auth[_0xafb6('0xa')](),controller[_0xafb6('0xb')]);router[_0xafb6('0x9')](_0xafb6('0xc'),auth[_0xafb6('0xa')](),controller[_0xafb6('0xd')]);router[_0xafb6('0x9')](_0xafb6('0xe'),auth[_0xafb6('0xa')](),controller['getConfigurations']);router[_0xafb6('0x9')]('/:id/fields',auth['isAuthenticated'](),controller[_0xafb6('0xf')]);router[_0xafb6('0x10')]('/',auth[_0xafb6('0xa')](),controller[_0xafb6('0x11')]);router[_0xafb6('0x10')]('/:id/configurations',auth[_0xafb6('0xa')](),controller[_0xafb6('0x12')]);router[_0xafb6('0x13')]('/:id',auth[_0xafb6('0xa')](),controller[_0xafb6('0x14')]);router['delete'](_0xafb6('0xc'),auth[_0xafb6('0xa')](),controller['destroy']);module[_0xafb6('0x15')]=router;
\ No newline at end of file
diff --git a/server/api/intFreshsalesAccount/intFreshsalesAccount.attributes.js b/server/api/intFreshsalesAccount/intFreshsalesAccount.attributes.js
index d57fea4..daf02f0 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 _0x707d=['sequelize','exports','STRING','username','remoteUri'];(function(_0x55471a,_0x2b6458){var _0x385bcd=function(_0x1adf70){while(--_0x1adf70){_0x55471a['push'](_0x55471a['shift']());}};_0x385bcd(++_0x2b6458);}(_0x707d,0x18b));var _0xd707=function(_0x1d2e8e,_0x443d69){_0x1d2e8e=_0x1d2e8e-0x0;var _0x510843=_0x707d[_0x1d2e8e];return _0x510843;};'use strict';var Sequelize=require(_0xd707('0x0'));module[_0xd707('0x1')]={'name':{'type':Sequelize[_0xd707('0x2')]},'description':{'type':Sequelize[_0xd707('0x2')]},'username':{'type':Sequelize[_0xd707('0x2')],'unique':_0xd707('0x3')},'apiKey':{'type':Sequelize[_0xd707('0x2')]},'remoteUri':{'type':Sequelize['STRING'],'unique':_0xd707('0x4')},'serverUrl':{'type':Sequelize[_0xd707('0x2')]}};
\ No newline at end of file
+var _0x50a5=['remoteUri','sequelize','exports','STRING'];(function(_0x44813d,_0x2255b1){var _0x2bd336=function(_0x14c994){while(--_0x14c994){_0x44813d['push'](_0x44813d['shift']());}};_0x2bd336(++_0x2255b1);}(_0x50a5,0xd1));var _0x550a=function(_0x2dfe1d,_0x4558ae){_0x2dfe1d=_0x2dfe1d-0x0;var _0x26670d=_0x50a5[_0x2dfe1d];return _0x26670d;};'use strict';var Sequelize=require(_0x550a('0x0'));module[_0x550a('0x1')]={'name':{'type':Sequelize['STRING']},'description':{'type':Sequelize['STRING']},'username':{'type':Sequelize['STRING'],'unique':'username'},'apiKey':{'type':Sequelize[_0x550a('0x2')]},'remoteUri':{'type':Sequelize['STRING'],'unique':_0x550a('0x3')},'serverUrl':{'type':Sequelize[_0x550a('0x2')]}};
\ No newline at end of file
diff --git a/server/api/intFreshsalesAccount/intFreshsalesAccount.controller.js b/server/api/intFreshsalesAccount/intFreshsalesAccount.controller.js
index 651d2ef..f38bcf0 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 _0x9d89=['../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/environment','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','FreshsalesAccount,\x20%s,\x20%s','debug','FreshsalesAccount,\x20%s,\x20%s,\x20%s','request\x20sent','stringify','error','code','message','result','sendStatus','status','end','count','offset','limit','set','Content-Range','json','apply','reject','update','destroy','stack','name','send','index','FreshsalesAccount','rawAttributes','fieldName','type','key','query','keys','filters','intersection','attributes','length','model','nolimit','sort','pick','filter','merge','where','VIRTUAL','options','includeAll','include','rows','catch','show','params','fields','create','body','getConfigurations','findOne','FreshsalesConfiguration','order','map','addConfiguration','AccountId','getSubjects','channel','Descriptions','getDescriptions','FreshsalesField','getFields','username','remoteUri','apiKey','slice','substring','lastIndexOf','format','%s%s','users','email','Requested\x20Resource\x20not\x20Found','statusCode','getFields,\x20%s,\x20%s,\x20%s','Wrong\x20credentials','rimraf','fast-json-patch','request-promise','moment','bluebird','mustache','util','path','sox','to-csv','ejs','lodash','squel','crypto','jsforce','desk.js','querystring','../../components/auth/service','../../components/parsers/qs'];(function(_0x195d2e,_0x163f16){var _0x1b131d=function(_0x448260){while(--_0x448260){_0x195d2e['push'](_0x195d2e['shift']());}};_0x1b131d(++_0x163f16);}(_0x9d89,0xd5));var _0x99d8=function(_0x3531a9,_0x48e9ff){_0x3531a9=_0x3531a9-0x0;var _0x359f9e=_0x9d89[_0x3531a9];return _0x359f9e;};'use strict';var pdf=require('html-pdf');var emlformat=require('eml-format');var rimraf=require(_0x99d8('0x0'));var zipdir=require('zip-dir');var jsonpatch=require(_0x99d8('0x1'));var rp=require(_0x99d8('0x2'));var moment=require(_0x99d8('0x3'));var BPromise=require(_0x99d8('0x4'));var Mustache=require(_0x99d8('0x5'));var util=require(_0x99d8('0x6'));var path=require(_0x99d8('0x7'));var sox=require(_0x99d8('0x8'));var csv=require(_0x99d8('0x9'));var ejs=require(_0x99d8('0xa'));var fs=require('fs');var _=require(_0x99d8('0xb'));var squel=require(_0x99d8('0xc'));var crypto=require(_0x99d8('0xd'));var jsforce=require(_0x99d8('0xe'));var deskjs=require(_0x99d8('0xf'));var toCsv=require(_0x99d8('0x9'));var querystring=require(_0x99d8('0x10'));var Papa=require('papaparse');var Redis=require('ioredis');var authService=require(_0x99d8('0x11'));var qs=require(_0x99d8('0x12'));var as=require(_0x99d8('0x13'));var hardwareService=require(_0x99d8('0x14'));var logger=require(_0x99d8('0x15'))(_0x99d8('0x16'));var utils=require(_0x99d8('0x17'));var config=require(_0x99d8('0x18'));var db=require('../../mysqldb')['db'];var integrations=require('../../components/integrations/configuration');var jayson=require('jayson/promise');var client=jayson[_0x99d8('0x19')][_0x99d8('0x1a')]({'port':0x232a});function checkPasswordPattern(_0x3347f4,_0x2c310c,_0x54903b){if(_0x54903b){var _0x590073=new RegExp(/(?=.*[a-z])(?=.*[A-Z])(?=.*[0-9])(?=.*[?!@#\$%\^&\*~\-_=+[{\]\}])(?=.{8,})/);if(_0x590073[_0x99d8('0x1b')](_0x2c310c)){return _0x3347f4;}else{throw new db[(_0x99d8('0x1c'))][(_0x99d8('0x1d'))](_0x99d8('0x1e'));}}else{return _0x3347f4;}}function respondWithRpcPromise(_0x5e1ebf,_0x5ca8d4,_0x2d4369,_0x2ae987){return new BPromise(function(_0xc72170,_0x380850){var _0x550d1b=_0x2ae987||client;return _0x550d1b[_0x99d8('0x1f')](_0x5e1ebf,_0x2d4369)[_0x99d8('0x20')](function(_0xf5cabe){logger[_0x99d8('0x21')](_0x99d8('0x22'),_0x5ca8d4,'request\x20sent');logger[_0x99d8('0x23')](_0x99d8('0x24'),_0x5ca8d4,_0x99d8('0x25'),JSON[_0x99d8('0x26')](_0xf5cabe));if(_0xf5cabe[_0x99d8('0x27')]){if(_0xf5cabe[_0x99d8('0x27')][_0x99d8('0x28')]===0x1f4){logger[_0x99d8('0x27')](_0x99d8('0x22'),_0x5ca8d4,_0xf5cabe[_0x99d8('0x27')][_0x99d8('0x29')]);return _0x380850(_0xf5cabe[_0x99d8('0x27')][_0x99d8('0x29')]);}logger[_0x99d8('0x27')]('FreshsalesAccount,\x20%s,\x20%s',_0x5ca8d4,_0xf5cabe[_0x99d8('0x27')][_0x99d8('0x29')]);return _0xc72170(_0xf5cabe[_0x99d8('0x27')]['message']);}else{logger[_0x99d8('0x21')](_0x99d8('0x22'),_0x5ca8d4,_0x99d8('0x25'));_0xc72170(_0xf5cabe[_0x99d8('0x2a')]['message']);}})['catch'](function(_0x3bc154){logger[_0x99d8('0x27')](_0x99d8('0x22'),_0x5ca8d4,_0x3bc154);_0x380850(_0x3bc154);});});}function respondWithStatusCode(_0x4ab20,_0x253eaf){_0x253eaf=_0x253eaf||0xcc;return function(_0x59d9fc){if(_0x59d9fc){return _0x4ab20[_0x99d8('0x2b')](_0x253eaf);}return _0x4ab20[_0x99d8('0x2c')](_0x253eaf)[_0x99d8('0x2d')]();};}function respondWithResult(_0x47542d,_0x3b3d80){_0x3b3d80=_0x3b3d80||0xc8;return function(_0xe89bb3){if(_0xe89bb3){return _0x47542d[_0x99d8('0x2c')](_0x3b3d80)['json'](_0xe89bb3);}};}function respondWithFilteredResult(_0x21b650,_0x4947a9){return function(_0x2277cc){if(_0x2277cc){var _0x13de52=_0x2277cc[_0x99d8('0x2e')],_0x4720ed=_0x4947a9[_0x99d8('0x2f')],_0x5d2d19=_0x4947a9[_0x99d8('0x2f')]+_0x4947a9[_0x99d8('0x30')],_0x5aad13;if(_0x5d2d19>=_0x13de52){_0x5d2d19=_0x13de52;_0x5aad13=0xc8;}else{_0x5aad13=0xce;}_0x21b650[_0x99d8('0x2c')](_0x5aad13);return _0x21b650[_0x99d8('0x31')](_0x99d8('0x32'),_0x4720ed+'-'+_0x5d2d19+'/'+_0x13de52)[_0x99d8('0x33')](_0x2277cc);}return null;};}function patchUpdates(_0x179ba8){return function(_0x96ad9){try{jsonpatch[_0x99d8('0x34')](_0x96ad9,_0x179ba8,!![]);}catch(_0x1ccb35){return BPromise[_0x99d8('0x35')](_0x1ccb35);}return _0x96ad9['save']();};}function saveUpdates(_0x4116ff,_0x82d84f){return function(_0x2e3ff0){if(_0x2e3ff0){return _0x2e3ff0[_0x99d8('0x36')](_0x4116ff)[_0x99d8('0x20')](function(_0x2ed776){return _0x2ed776;});}return null;};}function removeEntity(_0x487a8f,_0x159884){return function(_0x27b468){if(_0x27b468){return _0x27b468[_0x99d8('0x37')]()[_0x99d8('0x20')](function(){_0x487a8f[_0x99d8('0x2c')](0xcc)[_0x99d8('0x2d')]();});}};}function handleEntityNotFound(_0x719709,_0x3ffc0e){return function(_0x3fc281){if(!_0x3fc281){_0x719709[_0x99d8('0x2b')](0x194);}return _0x3fc281;};}function handleError(_0x21a33a,_0x320e1f){_0x320e1f=_0x320e1f||0x1f4;return function(_0x13d5ca){logger[_0x99d8('0x27')](_0x13d5ca[_0x99d8('0x38')]);if(_0x13d5ca[_0x99d8('0x39')]){delete _0x13d5ca[_0x99d8('0x39')];}_0x21a33a['status'](_0x320e1f)[_0x99d8('0x3a')](_0x13d5ca);};}exports[_0x99d8('0x3b')]=function(_0x562d32,_0x2a6c4f){var _0x1277df={},_0x237322={},_0x43902a={'count':0x0,'rows':[]};var _0x4e9891=_['map'](db[_0x99d8('0x3c')][_0x99d8('0x3d')],function(_0x21274b){return{'name':_0x21274b[_0x99d8('0x3e')],'type':_0x21274b[_0x99d8('0x3f')][_0x99d8('0x40')]};});_0x237322['model']=_['map'](_0x4e9891,_0x99d8('0x39'));_0x237322[_0x99d8('0x41')]=_[_0x99d8('0x42')](_0x562d32['query']);_0x237322[_0x99d8('0x43')]=_[_0x99d8('0x44')](_0x237322['model'],_0x237322[_0x99d8('0x41')]);_0x1277df[_0x99d8('0x45')]=_[_0x99d8('0x44')](_0x237322['model'],qs['fields'](_0x562d32[_0x99d8('0x41')]['fields']));_0x1277df[_0x99d8('0x45')]=_0x1277df[_0x99d8('0x45')][_0x99d8('0x46')]?_0x1277df[_0x99d8('0x45')]:_0x237322[_0x99d8('0x47')];if(!_0x562d32[_0x99d8('0x41')]['hasOwnProperty'](_0x99d8('0x48'))){_0x1277df[_0x99d8('0x30')]=qs[_0x99d8('0x30')](_0x562d32['query']['limit']);_0x1277df[_0x99d8('0x2f')]=qs[_0x99d8('0x2f')](_0x562d32[_0x99d8('0x41')][_0x99d8('0x2f')]);}_0x1277df['order']=qs[_0x99d8('0x49')](_0x562d32[_0x99d8('0x41')][_0x99d8('0x49')]);_0x1277df['where']=qs[_0x99d8('0x43')](_[_0x99d8('0x4a')](_0x562d32[_0x99d8('0x41')],_0x237322['filters']));if(_0x562d32[_0x99d8('0x41')][_0x99d8('0x4b')]){_0x1277df['where']=_[_0x99d8('0x4c')](_0x1277df[_0x99d8('0x4d')],{'$or':_['map'](_0x4e9891,function(_0x101878){if(_0x101878[_0x99d8('0x3f')]!==_0x99d8('0x4e')){var _0x5b5583={};_0x5b5583[_0x101878[_0x99d8('0x39')]]={'$like':'%'+_0x562d32[_0x99d8('0x41')][_0x99d8('0x4b')]+'%'};return _0x5b5583;}})});}_0x1277df=_['merge']({},_0x1277df,_0x562d32[_0x99d8('0x4f')]);var _0x1bd5d0={'where':_0x1277df[_0x99d8('0x4d')]};return db[_0x99d8('0x3c')]['count'](_0x1bd5d0)[_0x99d8('0x20')](function(_0x1931fd){_0x43902a['count']=_0x1931fd;if(_0x562d32[_0x99d8('0x41')][_0x99d8('0x50')]){_0x1277df[_0x99d8('0x51')]=[{'all':!![]}];}return db[_0x99d8('0x3c')]['findAll'](_0x1277df);})[_0x99d8('0x20')](function(_0x479fd3){_0x43902a[_0x99d8('0x52')]=_0x479fd3;return _0x43902a;})[_0x99d8('0x20')](respondWithFilteredResult(_0x2a6c4f,_0x1277df))[_0x99d8('0x53')](handleError(_0x2a6c4f,null));};exports[_0x99d8('0x54')]=function(_0x2ac1b4,_0xe8c629){var _0x2989ed={'raw':![],'where':{'id':_0x2ac1b4[_0x99d8('0x55')]['id']}},_0x419af9={};_0x419af9[_0x99d8('0x47')]=_[_0x99d8('0x42')](db[_0x99d8('0x3c')][_0x99d8('0x3d')]);_0x419af9[_0x99d8('0x41')]=_[_0x99d8('0x42')](_0x2ac1b4['query']);_0x419af9[_0x99d8('0x43')]=_[_0x99d8('0x44')](_0x419af9[_0x99d8('0x47')],_0x419af9['query']);_0x2989ed['attributes']=_['intersection'](_0x419af9[_0x99d8('0x47')],qs[_0x99d8('0x56')](_0x2ac1b4[_0x99d8('0x41')]['fields']));_0x2989ed['attributes']=_0x2989ed['attributes'][_0x99d8('0x46')]?_0x2989ed[_0x99d8('0x45')]:_0x419af9[_0x99d8('0x47')];if(_0x2ac1b4[_0x99d8('0x41')]['includeAll']){_0x2989ed[_0x99d8('0x51')]=[{'all':!![]}];}_0x2989ed=_[_0x99d8('0x4c')]({},_0x2989ed,_0x2ac1b4[_0x99d8('0x4f')]);return db[_0x99d8('0x3c')]['find'](_0x2989ed)[_0x99d8('0x20')](handleEntityNotFound(_0xe8c629,null))['then'](respondWithResult(_0xe8c629,null))[_0x99d8('0x53')](handleError(_0xe8c629,null));};exports[_0x99d8('0x57')]=function(_0x215aa0,_0x199867){return db[_0x99d8('0x3c')]['create'](_0x215aa0[_0x99d8('0x58')],{})[_0x99d8('0x20')](respondWithResult(_0x199867,0xc9))[_0x99d8('0x53')](handleError(_0x199867,null));};exports['update']=function(_0x1e3eb0,_0x541245){if(_0x1e3eb0[_0x99d8('0x58')]['id']){delete _0x1e3eb0[_0x99d8('0x58')]['id'];}return db[_0x99d8('0x3c')]['find']({'where':{'id':_0x1e3eb0[_0x99d8('0x55')]['id']}})[_0x99d8('0x20')](handleEntityNotFound(_0x541245,null))[_0x99d8('0x20')](saveUpdates(_0x1e3eb0[_0x99d8('0x58')],null))[_0x99d8('0x20')](respondWithResult(_0x541245,null))[_0x99d8('0x53')](handleError(_0x541245,null));};exports[_0x99d8('0x37')]=function(_0x482643,_0x15987c){return db['FreshsalesAccount']['find']({'where':{'id':_0x482643['params']['id']}})['then'](handleEntityNotFound(_0x15987c,null))[_0x99d8('0x20')](removeEntity(_0x15987c,null))[_0x99d8('0x53')](handleError(_0x15987c,null));};exports[_0x99d8('0x59')]=function(_0x400e07,_0x1520c3,_0x253b25){var _0x2f10e8={};var _0x1e922a={};var _0x3ba758;var _0x1d6ed8;return db[_0x99d8('0x3c')][_0x99d8('0x5a')]({'where':{'id':_0x400e07[_0x99d8('0x55')]['id']}})[_0x99d8('0x20')](handleEntityNotFound(_0x1520c3,null))[_0x99d8('0x20')](function(_0x477dce){if(_0x477dce){_0x3ba758=_0x477dce;_0x1e922a[_0x99d8('0x47')]=_['keys'](db[_0x99d8('0x5b')][_0x99d8('0x3d')]);_0x1e922a['query']=_[_0x99d8('0x42')](_0x400e07['query']);_0x1e922a['filters']=_['intersection'](_0x1e922a[_0x99d8('0x47')],_0x1e922a['query']);_0x2f10e8[_0x99d8('0x45')]=_['intersection'](_0x1e922a['model'],qs[_0x99d8('0x56')](_0x400e07[_0x99d8('0x41')][_0x99d8('0x56')]));_0x2f10e8[_0x99d8('0x45')]=_0x2f10e8[_0x99d8('0x45')][_0x99d8('0x46')]?_0x2f10e8[_0x99d8('0x45')]:_0x1e922a['model'];_0x2f10e8[_0x99d8('0x5c')]=qs[_0x99d8('0x49')](_0x400e07['query'][_0x99d8('0x49')]);_0x2f10e8[_0x99d8('0x4d')]=qs['filters'](_[_0x99d8('0x4a')](_0x400e07[_0x99d8('0x41')],_0x1e922a[_0x99d8('0x43')]));if(_0x400e07[_0x99d8('0x41')][_0x99d8('0x4b')]){_0x2f10e8[_0x99d8('0x4d')]=_[_0x99d8('0x4c')](_0x2f10e8['where'],{'$or':_[_0x99d8('0x5d')](_0x2f10e8[_0x99d8('0x45')],function(_0x10b8d2){var _0x31552e={};_0x31552e[_0x10b8d2]={'$like':'%'+_0x400e07[_0x99d8('0x41')][_0x99d8('0x4b')]+'%'};return _0x31552e;})});}_0x2f10e8=_['merge']({},_0x2f10e8,_0x400e07['options']);return _0x3ba758[_0x99d8('0x59')](_0x2f10e8);}})[_0x99d8('0x20')](function(_0x20b1d9){if(_0x20b1d9){_0x1d6ed8=_0x20b1d9[_0x99d8('0x46')];if(!_0x400e07[_0x99d8('0x41')]['hasOwnProperty'](_0x99d8('0x48'))){_0x2f10e8['limit']=qs[_0x99d8('0x30')](_0x400e07['query']['limit']);_0x2f10e8[_0x99d8('0x2f')]=qs[_0x99d8('0x2f')](_0x400e07[_0x99d8('0x41')]['offset']);}return _0x3ba758[_0x99d8('0x59')](_0x2f10e8);}})[_0x99d8('0x20')](function(_0x354b5e){if(_0x354b5e){return _0x354b5e?{'count':_0x1d6ed8,'rows':_0x354b5e}:null;}})[_0x99d8('0x20')](respondWithResult(_0x1520c3,null))[_0x99d8('0x53')](handleError(_0x1520c3,null));};exports[_0x99d8('0x5e')]=function(_0x4acfe2,_0x1a461d,_0x6e1fee){if(_0x4acfe2[_0x99d8('0x58')]['id']){delete _0x4acfe2['body']['id'];}return db[_0x99d8('0x3c')][_0x99d8('0x5a')]({'where':{'id':_0x4acfe2[_0x99d8('0x55')]['id']}})[_0x99d8('0x20')](handleEntityNotFound(_0x1a461d,null))[_0x99d8('0x20')](function(_0x230223){if(_0x230223){_0x4acfe2[_0x99d8('0x58')][_0x99d8('0x5f')]=_0x230223['id'];_0x4acfe2[_0x99d8('0x58')]['Subjects']=integrations[_0x99d8('0x60')](_0x4acfe2[_0x99d8('0x58')][_0x99d8('0x61')],_0x4acfe2[_0x99d8('0x58')][_0x99d8('0x3f')]);_0x4acfe2[_0x99d8('0x58')][_0x99d8('0x62')]=integrations[_0x99d8('0x63')](_0x4acfe2[_0x99d8('0x58')][_0x99d8('0x61')],_0x4acfe2[_0x99d8('0x58')][_0x99d8('0x3f')]);return db[_0x99d8('0x5b')]['create'](_0x4acfe2[_0x99d8('0x58')],{'include':[{'model':db[_0x99d8('0x64')],'as':'Subjects'},{'model':db[_0x99d8('0x64')],'as':_0x99d8('0x62')}]});}return null;})[_0x99d8('0x20')](respondWithResult(_0x1a461d,null))[_0x99d8('0x53')](handleError(_0x1a461d,null));};exports[_0x99d8('0x65')]=function(_0x128898,_0x2cb452,_0x2dea26){var _0x5bff2f='';var _0x5a22d9='';return db[_0x99d8('0x3c')]['findOne']({'where':{'id':_0x128898['params']['id']},'attributes':['id',_0x99d8('0x66'),_0x99d8('0x67'),_0x99d8('0x68')]})[_0x99d8('0x20')](handleEntityNotFound(_0x2cb452,null))[_0x99d8('0x20')](function(_0x287dd1){if(_0x287dd1){_0x5a22d9=_0x287dd1[_0x99d8('0x66')];_0x5bff2f=_0x287dd1[_0x99d8('0x67')];var _0x232346=_0x287dd1[_0x99d8('0x67')][_0x99d8('0x69')](-0x1);if(_0x232346==='/'){_0x5bff2f=_0x5bff2f[_0x99d8('0x6a')](0x0,_0x5bff2f[_0x99d8('0x6b')](_0x232346));}return rp({'method':'GET','uri':util[_0x99d8('0x6c')](_0x99d8('0x6d'),_0x5bff2f,'/api/selector/owners'),'headers':{'Authorization':'Token\x20token='+_0x287dd1[_0x99d8('0x68')]},'json':!![]});}})['then'](function(_0x416874){if(_0x416874){var _0x3037fc=_0x416874[_0x99d8('0x6e')];var _0x4ec145=![];var _0x2ba5c2=null;for(_0x2ba5c2=0x0;_0x2ba5c2<_0x3037fc[_0x99d8('0x46')];_0x2ba5c2++){if(_0x3037fc[_0x2ba5c2][_0x99d8('0x6f')]===_0x5a22d9){_0x4ec145=!![];}}if(_0x4ec145){return!![];}else{throw new Error({'statusCode':0x194,'message':_0x99d8('0x70')});}}})[_0x99d8('0x20')](respondWithResult(_0x2cb452,null))[_0x99d8('0x53')](function(_0xafd739){var _0xb967fa=_0x128898[_0x99d8('0x41')][_0x99d8('0x1b')]?0x1f4:_0xafd739[_0x99d8('0x71')]||0x1f4;logger[_0x99d8('0x27')](_0x99d8('0x72'),_0x99d8('0x65'),_0xb967fa,JSON['stringify'](_0xafd739));delete _0xafd739['name'];if(_0xb967fa===0x191){_0xb967fa=0x190;}_0x2cb452[_0x99d8('0x2c')](_0xb967fa)['send'](_0x128898[_0x99d8('0x41')][_0x99d8('0x1b')]?{'message':_0x99d8('0x73'),'statusCode':_0xafd739['statusCode']}:_0xafd739);});};
\ No newline at end of file
+var _0xa9e4=['../../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','FreshsalesAccount,\x20%s,\x20%s','request\x20sent','stringify','error','code','message','result','sendStatus','status','end','json','count','offset','limit','set','apply','reject','update','name','send','index','map','rawAttributes','fieldName','type','key','model','query','keys','intersection','attributes','fields','hasOwnProperty','nolimit','sort','where','filters','filter','merge','VIRTUAL','findAll','rows','catch','params','length','include','options','find','create','FreshsalesAccount','body','destroy','getConfigurations','order','findOne','AccountId','Subjects','Descriptions','getDescriptions','channel','FreshsalesConfiguration','FreshsalesField','getFields','username','remoteUri','substring','GET','format','%s%s','Token\x20token=','apiKey','Requested\x20Resource\x20not\x20Found','getFields,\x20%s,\x20%s,\x20%s','Wrong\x20credentials','statusCode','html-pdf','eml-format','rimraf','fast-json-patch','moment','bluebird','mustache','to-csv','ejs','squel','crypto','jsforce','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../config/logger','api','../../config/utils'];(function(_0x65d3db,_0x3e2f20){var _0x4e997e=function(_0xfc2c96){while(--_0xfc2c96){_0x65d3db['push'](_0x65d3db['shift']());}};_0x4e997e(++_0x3e2f20);}(_0xa9e4,0xbb));var _0x4a9e=function(_0x828c94,_0x2861aa){_0x828c94=_0x828c94-0x0;var _0x54c03b=_0xa9e4[_0x828c94];return _0x54c03b;};'use strict';var pdf=require(_0x4a9e('0x0'));var emlformat=require(_0x4a9e('0x1'));var rimraf=require(_0x4a9e('0x2'));var zipdir=require('zip-dir');var jsonpatch=require(_0x4a9e('0x3'));var rp=require('request-promise');var moment=require(_0x4a9e('0x4'));var BPromise=require(_0x4a9e('0x5'));var Mustache=require(_0x4a9e('0x6'));var util=require('util');var path=require('path');var sox=require('sox');var csv=require(_0x4a9e('0x7'));var ejs=require(_0x4a9e('0x8'));var fs=require('fs');var _=require('lodash');var squel=require(_0x4a9e('0x9'));var crypto=require(_0x4a9e('0xa'));var jsforce=require(_0x4a9e('0xb'));var deskjs=require('desk.js');var toCsv=require('to-csv');var querystring=require('querystring');var Papa=require(_0x4a9e('0xc'));var Redis=require(_0x4a9e('0xd'));var authService=require(_0x4a9e('0xe'));var qs=require(_0x4a9e('0xf'));var as=require('../../components/parsers/advancedSearch');var hardwareService=require('../../config/license/hardware');var logger=require(_0x4a9e('0x10'))(_0x4a9e('0x11'));var utils=require(_0x4a9e('0x12'));var config=require('../../config/environment');var db=require(_0x4a9e('0x13'))['db'];var integrations=require('../../components/integrations/configuration');var jayson=require('jayson/promise');var client=jayson['client'][_0x4a9e('0x14')]({'port':0x232a});function checkPasswordPattern(_0x3aa76d,_0x2cf882,_0x3d43a5){if(_0x3d43a5){var _0x15aa48=new RegExp(/(?=.*[a-z])(?=.*[A-Z])(?=.*[0-9])(?=.*[?!@#\$%\^&\*~\-_=+[{\]\}])(?=.{8,})/);if(_0x15aa48[_0x4a9e('0x15')](_0x2cf882)){return _0x3aa76d;}else{throw new db[(_0x4a9e('0x16'))][(_0x4a9e('0x17'))](_0x4a9e('0x18'));}}else{return _0x3aa76d;}}function respondWithRpcPromise(_0x300608,_0xfa3d1e,_0x2f14fb,_0x3ce9ab){return new BPromise(function(_0x5ec7bc,_0x175943){var _0x3699dc=_0x3ce9ab||client;return _0x3699dc[_0x4a9e('0x19')](_0x300608,_0x2f14fb)[_0x4a9e('0x1a')](function(_0x555343){logger[_0x4a9e('0x1b')](_0x4a9e('0x1c'),_0xfa3d1e,_0x4a9e('0x1d'));logger['debug']('FreshsalesAccount,\x20%s,\x20%s,\x20%s',_0xfa3d1e,'request\x20sent',JSON[_0x4a9e('0x1e')](_0x555343));if(_0x555343[_0x4a9e('0x1f')]){if(_0x555343[_0x4a9e('0x1f')][_0x4a9e('0x20')]===0x1f4){logger[_0x4a9e('0x1f')]('FreshsalesAccount,\x20%s,\x20%s',_0xfa3d1e,_0x555343[_0x4a9e('0x1f')][_0x4a9e('0x21')]);return _0x175943(_0x555343[_0x4a9e('0x1f')][_0x4a9e('0x21')]);}logger[_0x4a9e('0x1f')](_0x4a9e('0x1c'),_0xfa3d1e,_0x555343[_0x4a9e('0x1f')][_0x4a9e('0x21')]);return _0x5ec7bc(_0x555343[_0x4a9e('0x1f')]['message']);}else{logger['info']('FreshsalesAccount,\x20%s,\x20%s',_0xfa3d1e,_0x4a9e('0x1d'));_0x5ec7bc(_0x555343[_0x4a9e('0x22')][_0x4a9e('0x21')]);}})['catch'](function(_0x3eb5ca){logger[_0x4a9e('0x1f')](_0x4a9e('0x1c'),_0xfa3d1e,_0x3eb5ca);_0x175943(_0x3eb5ca);});});}function respondWithStatusCode(_0x1f8440,_0x402e6d){_0x402e6d=_0x402e6d||0xcc;return function(_0x1a6aee){if(_0x1a6aee){return _0x1f8440[_0x4a9e('0x23')](_0x402e6d);}return _0x1f8440[_0x4a9e('0x24')](_0x402e6d)[_0x4a9e('0x25')]();};}function respondWithResult(_0x2dfb8e,_0x5941fa){_0x5941fa=_0x5941fa||0xc8;return function(_0x38e870){if(_0x38e870){return _0x2dfb8e['status'](_0x5941fa)[_0x4a9e('0x26')](_0x38e870);}};}function respondWithFilteredResult(_0xefb7a,_0x510580){return function(_0x251379){if(_0x251379){var _0x198caa=_0x251379[_0x4a9e('0x27')],_0x7b0b9c=_0x510580[_0x4a9e('0x28')],_0x5dc179=_0x510580['offset']+_0x510580[_0x4a9e('0x29')],_0x569335;if(_0x5dc179>=_0x198caa){_0x5dc179=_0x198caa;_0x569335=0xc8;}else{_0x569335=0xce;}_0xefb7a[_0x4a9e('0x24')](_0x569335);return _0xefb7a[_0x4a9e('0x2a')]('Content-Range',_0x7b0b9c+'-'+_0x5dc179+'/'+_0x198caa)[_0x4a9e('0x26')](_0x251379);}return null;};}function patchUpdates(_0x19571c){return function(_0x5b1104){try{jsonpatch[_0x4a9e('0x2b')](_0x5b1104,_0x19571c,!![]);}catch(_0x22c121){return BPromise[_0x4a9e('0x2c')](_0x22c121);}return _0x5b1104['save']();};}function saveUpdates(_0x5ce131,_0x1b2a29){return function(_0x44da1d){if(_0x44da1d){return _0x44da1d[_0x4a9e('0x2d')](_0x5ce131)[_0x4a9e('0x1a')](function(_0x27faed){return _0x27faed;});}return null;};}function removeEntity(_0x3a2559,_0x968c80){return function(_0x22c7f4){if(_0x22c7f4){return _0x22c7f4['destroy']()[_0x4a9e('0x1a')](function(){_0x3a2559[_0x4a9e('0x24')](0xcc)[_0x4a9e('0x25')]();});}};}function handleEntityNotFound(_0x5b4589,_0x23a0fc){return function(_0x4c68fd){if(!_0x4c68fd){_0x5b4589[_0x4a9e('0x23')](0x194);}return _0x4c68fd;};}function handleError(_0x19da40,_0x4037b1){_0x4037b1=_0x4037b1||0x1f4;return function(_0x24c1a7){logger[_0x4a9e('0x1f')](_0x24c1a7['stack']);if(_0x24c1a7['name']){delete _0x24c1a7[_0x4a9e('0x2e')];}_0x19da40['status'](_0x4037b1)[_0x4a9e('0x2f')](_0x24c1a7);};}exports[_0x4a9e('0x30')]=function(_0x43e1ec,_0x28176d){var _0x525dd0={},_0x378e16={},_0x107172={'count':0x0,'rows':[]};var _0x2d1069=_[_0x4a9e('0x31')](db['FreshsalesAccount'][_0x4a9e('0x32')],function(_0x5b3ebc){return{'name':_0x5b3ebc[_0x4a9e('0x33')],'type':_0x5b3ebc[_0x4a9e('0x34')][_0x4a9e('0x35')]};});_0x378e16[_0x4a9e('0x36')]=_[_0x4a9e('0x31')](_0x2d1069,_0x4a9e('0x2e'));_0x378e16[_0x4a9e('0x37')]=_[_0x4a9e('0x38')](_0x43e1ec['query']);_0x378e16['filters']=_[_0x4a9e('0x39')](_0x378e16[_0x4a9e('0x36')],_0x378e16[_0x4a9e('0x37')]);_0x525dd0[_0x4a9e('0x3a')]=_['intersection'](_0x378e16['model'],qs['fields'](_0x43e1ec[_0x4a9e('0x37')][_0x4a9e('0x3b')]));_0x525dd0[_0x4a9e('0x3a')]=_0x525dd0['attributes']['length']?_0x525dd0[_0x4a9e('0x3a')]:_0x378e16[_0x4a9e('0x36')];if(!_0x43e1ec[_0x4a9e('0x37')][_0x4a9e('0x3c')](_0x4a9e('0x3d'))){_0x525dd0[_0x4a9e('0x29')]=qs[_0x4a9e('0x29')](_0x43e1ec[_0x4a9e('0x37')][_0x4a9e('0x29')]);_0x525dd0['offset']=qs[_0x4a9e('0x28')](_0x43e1ec[_0x4a9e('0x37')][_0x4a9e('0x28')]);}_0x525dd0['order']=qs[_0x4a9e('0x3e')](_0x43e1ec[_0x4a9e('0x37')][_0x4a9e('0x3e')]);_0x525dd0[_0x4a9e('0x3f')]=qs[_0x4a9e('0x40')](_['pick'](_0x43e1ec['query'],_0x378e16[_0x4a9e('0x40')]));if(_0x43e1ec[_0x4a9e('0x37')][_0x4a9e('0x41')]){_0x525dd0['where']=_[_0x4a9e('0x42')](_0x525dd0[_0x4a9e('0x3f')],{'$or':_[_0x4a9e('0x31')](_0x2d1069,function(_0x5c5178){if(_0x5c5178[_0x4a9e('0x34')]!==_0x4a9e('0x43')){var _0x8ef391={};_0x8ef391[_0x5c5178['name']]={'$like':'%'+_0x43e1ec['query']['filter']+'%'};return _0x8ef391;}})});}_0x525dd0=_[_0x4a9e('0x42')]({},_0x525dd0,_0x43e1ec['options']);var _0x4eb486={'where':_0x525dd0['where']};return db['FreshsalesAccount']['count'](_0x4eb486)[_0x4a9e('0x1a')](function(_0x41530b){_0x107172[_0x4a9e('0x27')]=_0x41530b;if(_0x43e1ec[_0x4a9e('0x37')]['includeAll']){_0x525dd0['include']=[{'all':!![]}];}return db['FreshsalesAccount'][_0x4a9e('0x44')](_0x525dd0);})[_0x4a9e('0x1a')](function(_0x334376){_0x107172[_0x4a9e('0x45')]=_0x334376;return _0x107172;})[_0x4a9e('0x1a')](respondWithFilteredResult(_0x28176d,_0x525dd0))[_0x4a9e('0x46')](handleError(_0x28176d,null));};exports['show']=function(_0x56c532,_0x551f4d){var _0x570b39={'raw':![],'where':{'id':_0x56c532[_0x4a9e('0x47')]['id']}},_0x233c3e={};_0x233c3e['model']=_['keys'](db['FreshsalesAccount'][_0x4a9e('0x32')]);_0x233c3e[_0x4a9e('0x37')]=_[_0x4a9e('0x38')](_0x56c532[_0x4a9e('0x37')]);_0x233c3e[_0x4a9e('0x40')]=_[_0x4a9e('0x39')](_0x233c3e[_0x4a9e('0x36')],_0x233c3e[_0x4a9e('0x37')]);_0x570b39[_0x4a9e('0x3a')]=_[_0x4a9e('0x39')](_0x233c3e[_0x4a9e('0x36')],qs['fields'](_0x56c532['query'][_0x4a9e('0x3b')]));_0x570b39[_0x4a9e('0x3a')]=_0x570b39[_0x4a9e('0x3a')][_0x4a9e('0x48')]?_0x570b39[_0x4a9e('0x3a')]:_0x233c3e[_0x4a9e('0x36')];if(_0x56c532['query']['includeAll']){_0x570b39[_0x4a9e('0x49')]=[{'all':!![]}];}_0x570b39=_[_0x4a9e('0x42')]({},_0x570b39,_0x56c532[_0x4a9e('0x4a')]);return db['FreshsalesAccount'][_0x4a9e('0x4b')](_0x570b39)[_0x4a9e('0x1a')](handleEntityNotFound(_0x551f4d,null))[_0x4a9e('0x1a')](respondWithResult(_0x551f4d,null))[_0x4a9e('0x46')](handleError(_0x551f4d,null));};exports[_0x4a9e('0x4c')]=function(_0x9ae2c7,_0x73c037){return db[_0x4a9e('0x4d')][_0x4a9e('0x4c')](_0x9ae2c7[_0x4a9e('0x4e')],{})[_0x4a9e('0x1a')](respondWithResult(_0x73c037,0xc9))['catch'](handleError(_0x73c037,null));};exports[_0x4a9e('0x2d')]=function(_0x1520e4,_0x57f212){if(_0x1520e4[_0x4a9e('0x4e')]['id']){delete _0x1520e4[_0x4a9e('0x4e')]['id'];}return db[_0x4a9e('0x4d')]['find']({'where':{'id':_0x1520e4[_0x4a9e('0x47')]['id']}})[_0x4a9e('0x1a')](handleEntityNotFound(_0x57f212,null))['then'](saveUpdates(_0x1520e4[_0x4a9e('0x4e')],null))[_0x4a9e('0x1a')](respondWithResult(_0x57f212,null))[_0x4a9e('0x46')](handleError(_0x57f212,null));};exports[_0x4a9e('0x4f')]=function(_0x2b74fd,_0x4518ce){return db[_0x4a9e('0x4d')]['find']({'where':{'id':_0x2b74fd[_0x4a9e('0x47')]['id']}})[_0x4a9e('0x1a')](handleEntityNotFound(_0x4518ce,null))[_0x4a9e('0x1a')](removeEntity(_0x4518ce,null))[_0x4a9e('0x46')](handleError(_0x4518ce,null));};exports[_0x4a9e('0x50')]=function(_0x4af143,_0x1d524e,_0x1c5ab0){var _0xe44af2={};var _0xdc54ba={};var _0x571f7e;var _0x2adf49;return db[_0x4a9e('0x4d')]['findOne']({'where':{'id':_0x4af143[_0x4a9e('0x47')]['id']}})[_0x4a9e('0x1a')](handleEntityNotFound(_0x1d524e,null))[_0x4a9e('0x1a')](function(_0x5e3200){if(_0x5e3200){_0x571f7e=_0x5e3200;_0xdc54ba['model']=_[_0x4a9e('0x38')](db['FreshsalesConfiguration'][_0x4a9e('0x32')]);_0xdc54ba['query']=_[_0x4a9e('0x38')](_0x4af143[_0x4a9e('0x37')]);_0xdc54ba[_0x4a9e('0x40')]=_[_0x4a9e('0x39')](_0xdc54ba[_0x4a9e('0x36')],_0xdc54ba[_0x4a9e('0x37')]);_0xe44af2['attributes']=_['intersection'](_0xdc54ba['model'],qs[_0x4a9e('0x3b')](_0x4af143[_0x4a9e('0x37')][_0x4a9e('0x3b')]));_0xe44af2['attributes']=_0xe44af2[_0x4a9e('0x3a')][_0x4a9e('0x48')]?_0xe44af2[_0x4a9e('0x3a')]:_0xdc54ba[_0x4a9e('0x36')];_0xe44af2[_0x4a9e('0x51')]=qs[_0x4a9e('0x3e')](_0x4af143['query'][_0x4a9e('0x3e')]);_0xe44af2['where']=qs[_0x4a9e('0x40')](_['pick'](_0x4af143[_0x4a9e('0x37')],_0xdc54ba[_0x4a9e('0x40')]));if(_0x4af143['query'][_0x4a9e('0x41')]){_0xe44af2[_0x4a9e('0x3f')]=_[_0x4a9e('0x42')](_0xe44af2[_0x4a9e('0x3f')],{'$or':_[_0x4a9e('0x31')](_0xe44af2[_0x4a9e('0x3a')],function(_0x1d3e85){var _0x3af14d={};_0x3af14d[_0x1d3e85]={'$like':'%'+_0x4af143[_0x4a9e('0x37')][_0x4a9e('0x41')]+'%'};return _0x3af14d;})});}_0xe44af2=_[_0x4a9e('0x42')]({},_0xe44af2,_0x4af143['options']);return _0x571f7e[_0x4a9e('0x50')](_0xe44af2);}})[_0x4a9e('0x1a')](function(_0x184755){if(_0x184755){_0x2adf49=_0x184755[_0x4a9e('0x48')];if(!_0x4af143[_0x4a9e('0x37')][_0x4a9e('0x3c')](_0x4a9e('0x3d'))){_0xe44af2[_0x4a9e('0x29')]=qs[_0x4a9e('0x29')](_0x4af143[_0x4a9e('0x37')]['limit']);_0xe44af2['offset']=qs[_0x4a9e('0x28')](_0x4af143['query']['offset']);}return _0x571f7e[_0x4a9e('0x50')](_0xe44af2);}})[_0x4a9e('0x1a')](function(_0x2ccec8){if(_0x2ccec8){return _0x2ccec8?{'count':_0x2adf49,'rows':_0x2ccec8}:null;}})[_0x4a9e('0x1a')](respondWithResult(_0x1d524e,null))[_0x4a9e('0x46')](handleError(_0x1d524e,null));};exports['addConfiguration']=function(_0x7d127a,_0x157928,_0x2c68e9){if(_0x7d127a['body']['id']){delete _0x7d127a[_0x4a9e('0x4e')]['id'];}return db[_0x4a9e('0x4d')][_0x4a9e('0x52')]({'where':{'id':_0x7d127a[_0x4a9e('0x47')]['id']}})[_0x4a9e('0x1a')](handleEntityNotFound(_0x157928,null))[_0x4a9e('0x1a')](function(_0x44c91e){if(_0x44c91e){_0x7d127a['body'][_0x4a9e('0x53')]=_0x44c91e['id'];_0x7d127a[_0x4a9e('0x4e')][_0x4a9e('0x54')]=integrations['getSubjects'](_0x7d127a['body']['channel'],_0x7d127a[_0x4a9e('0x4e')][_0x4a9e('0x34')]);_0x7d127a[_0x4a9e('0x4e')][_0x4a9e('0x55')]=integrations[_0x4a9e('0x56')](_0x7d127a[_0x4a9e('0x4e')][_0x4a9e('0x57')],_0x7d127a['body'][_0x4a9e('0x34')]);return db[_0x4a9e('0x58')][_0x4a9e('0x4c')](_0x7d127a[_0x4a9e('0x4e')],{'include':[{'model':db[_0x4a9e('0x59')],'as':_0x4a9e('0x54')},{'model':db[_0x4a9e('0x59')],'as':'Descriptions'}]});}return null;})[_0x4a9e('0x1a')](respondWithResult(_0x157928,null))[_0x4a9e('0x46')](handleError(_0x157928,null));};exports[_0x4a9e('0x5a')]=function(_0x1313fd,_0x413a91,_0x9fcce7){var _0xd2eb21='';var _0x4ecb85='';return db[_0x4a9e('0x4d')][_0x4a9e('0x52')]({'where':{'id':_0x1313fd[_0x4a9e('0x47')]['id']},'attributes':['id',_0x4a9e('0x5b'),_0x4a9e('0x5c'),'apiKey']})[_0x4a9e('0x1a')](handleEntityNotFound(_0x413a91,null))[_0x4a9e('0x1a')](function(_0x2ab013){if(_0x2ab013){_0x4ecb85=_0x2ab013[_0x4a9e('0x5b')];_0xd2eb21=_0x2ab013[_0x4a9e('0x5c')];var _0x41dc88=_0x2ab013['remoteUri']['slice'](-0x1);if(_0x41dc88==='/'){_0xd2eb21=_0xd2eb21[_0x4a9e('0x5d')](0x0,_0xd2eb21['lastIndexOf'](_0x41dc88));}return rp({'method':_0x4a9e('0x5e'),'uri':util[_0x4a9e('0x5f')](_0x4a9e('0x60'),_0xd2eb21,'/api/selector/owners'),'headers':{'Authorization':_0x4a9e('0x61')+_0x2ab013[_0x4a9e('0x62')]},'json':!![]});}})[_0x4a9e('0x1a')](function(_0x1af2c3){if(_0x1af2c3){var _0x4e5180=_0x1af2c3['users'];var _0x10d520=![];var _0x1bbfa9=null;for(_0x1bbfa9=0x0;_0x1bbfa9<_0x4e5180[_0x4a9e('0x48')];_0x1bbfa9++){if(_0x4e5180[_0x1bbfa9]['email']===_0x4ecb85){_0x10d520=!![];}}if(_0x10d520){return!![];}else{throw new Error({'statusCode':0x194,'message':_0x4a9e('0x63')});}}})[_0x4a9e('0x1a')](respondWithResult(_0x413a91,null))[_0x4a9e('0x46')](function(_0x2334b9){var _0x2eb220=_0x1313fd['query'][_0x4a9e('0x15')]?0x1f4:_0x2334b9['statusCode']||0x1f4;logger[_0x4a9e('0x1f')](_0x4a9e('0x64'),_0x4a9e('0x5a'),_0x2eb220,JSON[_0x4a9e('0x1e')](_0x2334b9));delete _0x2334b9['name'];if(_0x2eb220===0x191){_0x2eb220=0x190;}_0x413a91[_0x4a9e('0x24')](_0x2eb220)['send'](_0x1313fd[_0x4a9e('0x37')][_0x4a9e('0x15')]?{'message':_0x4a9e('0x65'),'statusCode':_0x2334b9[_0x4a9e('0x66')]}:_0x2334b9);});};
\ No newline at end of file
diff --git a/server/api/intFreshsalesAccount/intFreshsalesAccount.model.js b/server/api/intFreshsalesAccount/intFreshsalesAccount.model.js
index a2a290a..d2268c0 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 _0xdc45=['exports','int_freshsales_accounts','lodash','util','../../config/logger','moment','path','rimraf','../../config/environment','./intFreshsalesAccount.attributes'];(function(_0x4b1cbb,_0x5a98eb){var _0x5bd02c=function(_0x5cdb60){while(--_0x5cdb60){_0x4b1cbb['push'](_0x4b1cbb['shift']());}};_0x5bd02c(++_0x5a98eb);}(_0xdc45,0x156));var _0x5dc4=function(_0x5e8061,_0x15c4b7){_0x5e8061=_0x5e8061-0x0;var _0x8a4f81=_0xdc45[_0x5e8061];return _0x8a4f81;};'use strict';var _=require(_0x5dc4('0x0'));var util=require(_0x5dc4('0x1'));var logger=require(_0x5dc4('0x2'))('api');var moment=require(_0x5dc4('0x3'));var BPromise=require('bluebird');var rp=require('request-promise');var fs=require('fs');var path=require(_0x5dc4('0x4'));var rimraf=require(_0x5dc4('0x5'));var config=require(_0x5dc4('0x6'));var attributes=require(_0x5dc4('0x7'));var integrations=require('../../components/integrations/configuration');module[_0x5dc4('0x8')]=function(_0x26db6b,_0x438a82){return _0x26db6b['define']('FreshsalesAccount',attributes,{'tableName':_0x5dc4('0x9'),'paranoid':![],'indexes':[],'timestamps':!![]});};
\ No newline at end of file
+var _0xe31a=['./intFreshsalesAccount.attributes','../../components/integrations/configuration','define','FreshsalesAccount','int_freshsales_accounts','lodash','util','moment','bluebird','request-promise','path','rimraf','../../config/environment'];(function(_0x328d98,_0x4a34a3){var _0x188eb5=function(_0x3133dd){while(--_0x3133dd){_0x328d98['push'](_0x328d98['shift']());}};_0x188eb5(++_0x4a34a3);}(_0xe31a,0x87));var _0xae31=function(_0x411017,_0x4a8117){_0x411017=_0x411017-0x0;var _0x2adeea=_0xe31a[_0x411017];return _0x2adeea;};'use strict';var _=require(_0xae31('0x0'));var util=require(_0xae31('0x1'));var logger=require('../../config/logger')('api');var moment=require(_0xae31('0x2'));var BPromise=require(_0xae31('0x3'));var rp=require(_0xae31('0x4'));var fs=require('fs');var path=require(_0xae31('0x5'));var rimraf=require(_0xae31('0x6'));var config=require(_0xae31('0x7'));var attributes=require(_0xae31('0x8'));var integrations=require(_0xae31('0x9'));module['exports']=function(_0x2e494e,_0x35227c){return _0x2e494e[_0xae31('0xa')](_0xae31('0xb'),attributes,{'tableName':_0xae31('0xc'),'paranoid':![],'indexes':[],'timestamps':!![]});};
\ No newline at end of file
diff --git a/server/api/intFreshsalesAccount/intFreshsalesAccount.rpc.js b/server/api/intFreshsalesAccount/intFreshsalesAccount.rpc.js
index 0469f33..962a870 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 _0xd7d1=['code','message','result','catch','GetFreshsalesAccount','findAll','options','raw','attributes','limit','include','map','model','debug','FreshsalesAccount','find','ShowFreshsalesAccount','lodash','util','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','client','request','then','info','FreshsalesAccount,\x20%s,\x20%s','request\x20sent','FreshsalesAccount,\x20%s,\x20%s,\x20%s','stringify','error'];(function(_0x420b6f,_0x49d395){var _0x538844=function(_0x1a20ec){while(--_0x1a20ec){_0x420b6f['push'](_0x420b6f['shift']());}};_0x538844(++_0x49d395);}(_0xd7d1,0x1b3));var _0x1d7d=function(_0x1a0136,_0x2d6ee3){_0x1a0136=_0x1a0136-0x0;var _0x5cb99f=_0xd7d1[_0x1a0136];return _0x5cb99f;};'use strict';var _=require(_0x1d7d('0x0'));var util=require(_0x1d7d('0x1'));var moment=require(_0x1d7d('0x2'));var BPromise=require(_0x1d7d('0x3'));var rs=require(_0x1d7d('0x4'));var fs=require('fs');var Redis=require(_0x1d7d('0x5'));var db=require(_0x1d7d('0x6'))['db'];var utils=require(_0x1d7d('0x7'));var logger=require(_0x1d7d('0x8'))(_0x1d7d('0x9'));var config=require(_0x1d7d('0xa'));var jayson=require(_0x1d7d('0xb'));var client=jayson[_0x1d7d('0xc')]['http']({'port':0x232a});function respondWithRpcPromise(_0x462ef8,_0x1aa456,_0x14dbf6){return new BPromise(function(_0x3675a2,_0xd6189e){return client[_0x1d7d('0xd')](_0x462ef8,_0x14dbf6)[_0x1d7d('0xe')](function(_0xa44223){logger[_0x1d7d('0xf')](_0x1d7d('0x10'),_0x1aa456,_0x1d7d('0x11'));logger['debug'](_0x1d7d('0x12'),_0x1aa456,'request\x20sent',JSON[_0x1d7d('0x13')](_0xa44223));if(_0xa44223[_0x1d7d('0x14')]){if(_0xa44223[_0x1d7d('0x14')][_0x1d7d('0x15')]===0x1f4){logger['error'](_0x1d7d('0x10'),_0x1aa456,_0xa44223['error']['message']);return _0xd6189e(_0xa44223[_0x1d7d('0x14')][_0x1d7d('0x16')]);}logger['error']('FreshsalesAccount,\x20%s,\x20%s',_0x1aa456,_0xa44223[_0x1d7d('0x14')][_0x1d7d('0x16')]);return _0x3675a2(_0xa44223[_0x1d7d('0x14')][_0x1d7d('0x16')]);}else{logger[_0x1d7d('0xf')]('FreshsalesAccount,\x20%s,\x20%s',_0x1aa456,_0x1d7d('0x11'));_0x3675a2(_0xa44223[_0x1d7d('0x17')]['message']);}})[_0x1d7d('0x18')](function(_0x162c3a){logger[_0x1d7d('0x14')](_0x1d7d('0x10'),_0x1aa456,_0x162c3a);_0xd6189e(_0x162c3a);});});}exports[_0x1d7d('0x19')]=function(_0x4db4f2){var _0x664e3f=this;return new Promise(function(_0x191024,_0x5cbb8f){return db['FreshsalesAccount'][_0x1d7d('0x1a')]({'raw':_0x4db4f2[_0x1d7d('0x1b')]?_0x4db4f2[_0x1d7d('0x1b')][_0x1d7d('0x1c')]===undefined?!![]:![]:!![],'where':_0x4db4f2[_0x1d7d('0x1b')]?_0x4db4f2[_0x1d7d('0x1b')]['where']||null:null,'attributes':_0x4db4f2[_0x1d7d('0x1b')]?_0x4db4f2[_0x1d7d('0x1b')][_0x1d7d('0x1d')]||null:null,'limit':_0x4db4f2['options']?_0x4db4f2[_0x1d7d('0x1b')][_0x1d7d('0x1e')]||null:null,'include':_0x4db4f2['options']?_0x4db4f2['options'][_0x1d7d('0x1f')]?_[_0x1d7d('0x20')](_0x4db4f2[_0x1d7d('0x1b')]['include'],function(_0x377653){return{'model':db[_0x377653[_0x1d7d('0x21')]],'as':_0x377653['as'],'attributes':_0x377653[_0x1d7d('0x1d')],'include':_0x377653[_0x1d7d('0x1f')]?_['map'](_0x377653[_0x1d7d('0x1f')],function(_0x151198){return{'model':db[_0x151198['model']],'as':_0x151198['as'],'attributes':_0x151198['attributes'],'include':_0x151198[_0x1d7d('0x1f')]?_['map'](_0x151198[_0x1d7d('0x1f')],function(_0x2d4de4){return{'model':db[_0x2d4de4[_0x1d7d('0x21')]],'as':_0x2d4de4['as'],'attributes':_0x2d4de4[_0x1d7d('0x1d')]};}):[]};}):[]};}):[]:[]})[_0x1d7d('0xe')](function(_0x59f827){logger[_0x1d7d('0xf')](_0x1d7d('0x19'),_0x4db4f2);logger[_0x1d7d('0x22')]('GetFreshsalesAccount',_0x4db4f2,JSON[_0x1d7d('0x13')](_0x59f827));_0x191024(_0x59f827);})[_0x1d7d('0x18')](function(_0x23ad85){logger['error']('GetFreshsalesAccount',_0x23ad85['message'],_0x4db4f2);_0x5cbb8f(_0x664e3f[_0x1d7d('0x14')](0x1f4,_0x23ad85[_0x1d7d('0x16')]));});});};exports['ShowFreshsalesAccount']=function(_0x1ebcbc){var _0x3e4136=this;return new Promise(function(_0x16a81d,_0x3336ab){return db[_0x1d7d('0x23')][_0x1d7d('0x24')]({'raw':_0x1ebcbc[_0x1d7d('0x1b')]?_0x1ebcbc[_0x1d7d('0x1b')][_0x1d7d('0x1c')]===undefined?!![]:![]:!![],'where':_0x1ebcbc[_0x1d7d('0x1b')]?_0x1ebcbc['options']['where']||null:null,'attributes':_0x1ebcbc[_0x1d7d('0x1b')]?_0x1ebcbc[_0x1d7d('0x1b')][_0x1d7d('0x1d')]||null:null,'include':_0x1ebcbc[_0x1d7d('0x1b')]?_0x1ebcbc[_0x1d7d('0x1b')][_0x1d7d('0x1f')]?_[_0x1d7d('0x20')](_0x1ebcbc[_0x1d7d('0x1b')][_0x1d7d('0x1f')],function(_0x47b6b2){return{'model':db[_0x47b6b2[_0x1d7d('0x21')]],'as':_0x47b6b2['as'],'attributes':_0x47b6b2[_0x1d7d('0x1d')],'include':_0x47b6b2[_0x1d7d('0x1f')]?_[_0x1d7d('0x20')](_0x47b6b2['include'],function(_0x4ee17f){return{'model':db[_0x4ee17f[_0x1d7d('0x21')]],'as':_0x4ee17f['as'],'attributes':_0x4ee17f[_0x1d7d('0x1d')],'include':_0x4ee17f['include']?_[_0x1d7d('0x20')](_0x4ee17f[_0x1d7d('0x1f')],function(_0x568092){return{'model':db[_0x568092['model']],'as':_0x568092['as'],'attributes':_0x568092[_0x1d7d('0x1d')]};}):[]};}):[]};}):[]:[]})[_0x1d7d('0xe')](function(_0x406f57){logger[_0x1d7d('0xf')](_0x1d7d('0x25'),_0x1ebcbc);logger[_0x1d7d('0x22')](_0x1d7d('0x25'),_0x1ebcbc,JSON[_0x1d7d('0x13')](_0x406f57));_0x16a81d(_0x406f57);})[_0x1d7d('0x18')](function(_0x318b9a){logger['error']('ShowFreshsalesAccount',_0x318b9a['message'],_0x1ebcbc);_0x3336ab(_0x3e4136['error'](0x1f4,_0x318b9a[_0x1d7d('0x16')]));});});};
\ No newline at end of file
+var _0xfd58=['info','result','catch','GetFreshsalesAccount','FreshsalesAccount','findAll','options','attributes','map','include','model','ShowFreshsalesAccount','find','raw','lodash','util','bluebird','randomstring','../../mysqldb','../../config/utils','../../config/logger','rpc','jayson/promise','client','http','request','request\x20sent','debug','stringify','error','code','FreshsalesAccount,\x20%s,\x20%s','message'];(function(_0x296c49,_0x43510a){var _0x219a06=function(_0x278948){while(--_0x278948){_0x296c49['push'](_0x296c49['shift']());}};_0x219a06(++_0x43510a);}(_0xfd58,0xb3));var _0x8fd5=function(_0x2641f9,_0x26715f){_0x2641f9=_0x2641f9-0x0;var _0x585741=_0xfd58[_0x2641f9];return _0x585741;};'use strict';var _=require(_0x8fd5('0x0'));var util=require(_0x8fd5('0x1'));var moment=require('moment');var BPromise=require(_0x8fd5('0x2'));var rs=require(_0x8fd5('0x3'));var fs=require('fs');var Redis=require('ioredis');var db=require(_0x8fd5('0x4'))['db'];var utils=require(_0x8fd5('0x5'));var logger=require(_0x8fd5('0x6'))(_0x8fd5('0x7'));var config=require('../../config/environment');var jayson=require(_0x8fd5('0x8'));var client=jayson[_0x8fd5('0x9')][_0x8fd5('0xa')]({'port':0x232a});function respondWithRpcPromise(_0x4e10e4,_0x16ac3f,_0x32bad9){return new BPromise(function(_0x273344,_0x1042a1){return client[_0x8fd5('0xb')](_0x4e10e4,_0x32bad9)['then'](function(_0x462ac4){logger['info']('FreshsalesAccount,\x20%s,\x20%s',_0x16ac3f,_0x8fd5('0xc'));logger[_0x8fd5('0xd')]('FreshsalesAccount,\x20%s,\x20%s,\x20%s',_0x16ac3f,_0x8fd5('0xc'),JSON[_0x8fd5('0xe')](_0x462ac4));if(_0x462ac4['error']){if(_0x462ac4[_0x8fd5('0xf')][_0x8fd5('0x10')]===0x1f4){logger['error'](_0x8fd5('0x11'),_0x16ac3f,_0x462ac4[_0x8fd5('0xf')][_0x8fd5('0x12')]);return _0x1042a1(_0x462ac4[_0x8fd5('0xf')]['message']);}logger['error']('FreshsalesAccount,\x20%s,\x20%s',_0x16ac3f,_0x462ac4[_0x8fd5('0xf')][_0x8fd5('0x12')]);return _0x273344(_0x462ac4[_0x8fd5('0xf')][_0x8fd5('0x12')]);}else{logger[_0x8fd5('0x13')](_0x8fd5('0x11'),_0x16ac3f,_0x8fd5('0xc'));_0x273344(_0x462ac4[_0x8fd5('0x14')][_0x8fd5('0x12')]);}})[_0x8fd5('0x15')](function(_0x53b2dd){logger[_0x8fd5('0xf')](_0x8fd5('0x11'),_0x16ac3f,_0x53b2dd);_0x1042a1(_0x53b2dd);});});}exports[_0x8fd5('0x16')]=function(_0x4ab4ec){var _0x4e8e9d=this;return new Promise(function(_0x5daea6,_0x8509c8){return db[_0x8fd5('0x17')][_0x8fd5('0x18')]({'raw':_0x4ab4ec[_0x8fd5('0x19')]?_0x4ab4ec[_0x8fd5('0x19')]['raw']===undefined?!![]:![]:!![],'where':_0x4ab4ec['options']?_0x4ab4ec[_0x8fd5('0x19')]['where']||null:null,'attributes':_0x4ab4ec[_0x8fd5('0x19')]?_0x4ab4ec[_0x8fd5('0x19')][_0x8fd5('0x1a')]||null:null,'limit':_0x4ab4ec[_0x8fd5('0x19')]?_0x4ab4ec['options']['limit']||null:null,'include':_0x4ab4ec['options']?_0x4ab4ec[_0x8fd5('0x19')]['include']?_[_0x8fd5('0x1b')](_0x4ab4ec[_0x8fd5('0x19')][_0x8fd5('0x1c')],function(_0x6b7da9){return{'model':db[_0x6b7da9['model']],'as':_0x6b7da9['as'],'attributes':_0x6b7da9[_0x8fd5('0x1a')],'include':_0x6b7da9[_0x8fd5('0x1c')]?_[_0x8fd5('0x1b')](_0x6b7da9[_0x8fd5('0x1c')],function(_0xef4623){return{'model':db[_0xef4623['model']],'as':_0xef4623['as'],'attributes':_0xef4623[_0x8fd5('0x1a')],'include':_0xef4623[_0x8fd5('0x1c')]?_[_0x8fd5('0x1b')](_0xef4623['include'],function(_0x5dd206){return{'model':db[_0x5dd206[_0x8fd5('0x1d')]],'as':_0x5dd206['as'],'attributes':_0x5dd206[_0x8fd5('0x1a')]};}):[]};}):[]};}):[]:[]})['then'](function(_0x17928e){logger[_0x8fd5('0x13')](_0x8fd5('0x16'),_0x4ab4ec);logger[_0x8fd5('0xd')]('GetFreshsalesAccount',_0x4ab4ec,JSON[_0x8fd5('0xe')](_0x17928e));_0x5daea6(_0x17928e);})[_0x8fd5('0x15')](function(_0x4906f1){logger[_0x8fd5('0xf')](_0x8fd5('0x16'),_0x4906f1[_0x8fd5('0x12')],_0x4ab4ec);_0x8509c8(_0x4e8e9d[_0x8fd5('0xf')](0x1f4,_0x4906f1[_0x8fd5('0x12')]));});});};exports[_0x8fd5('0x1e')]=function(_0x56fe65){var _0x266798=this;return new Promise(function(_0x2ce9c9,_0x1c1565){return db['FreshsalesAccount'][_0x8fd5('0x1f')]({'raw':_0x56fe65[_0x8fd5('0x19')]?_0x56fe65[_0x8fd5('0x19')][_0x8fd5('0x20')]===undefined?!![]:![]:!![],'where':_0x56fe65['options']?_0x56fe65['options']['where']||null:null,'attributes':_0x56fe65['options']?_0x56fe65[_0x8fd5('0x19')][_0x8fd5('0x1a')]||null:null,'include':_0x56fe65[_0x8fd5('0x19')]?_0x56fe65[_0x8fd5('0x19')]['include']?_[_0x8fd5('0x1b')](_0x56fe65[_0x8fd5('0x19')][_0x8fd5('0x1c')],function(_0x44729f){return{'model':db[_0x44729f[_0x8fd5('0x1d')]],'as':_0x44729f['as'],'attributes':_0x44729f['attributes'],'include':_0x44729f[_0x8fd5('0x1c')]?_[_0x8fd5('0x1b')](_0x44729f[_0x8fd5('0x1c')],function(_0x35cadd){return{'model':db[_0x35cadd[_0x8fd5('0x1d')]],'as':_0x35cadd['as'],'attributes':_0x35cadd[_0x8fd5('0x1a')],'include':_0x35cadd[_0x8fd5('0x1c')]?_[_0x8fd5('0x1b')](_0x35cadd[_0x8fd5('0x1c')],function(_0xbaa71f){return{'model':db[_0xbaa71f['model']],'as':_0xbaa71f['as'],'attributes':_0xbaa71f[_0x8fd5('0x1a')]};}):[]};}):[]};}):[]:[]})['then'](function(_0x369969){logger[_0x8fd5('0x13')](_0x8fd5('0x1e'),_0x56fe65);logger[_0x8fd5('0xd')](_0x8fd5('0x1e'),_0x56fe65,JSON[_0x8fd5('0xe')](_0x369969));_0x2ce9c9(_0x369969);})['catch'](function(_0x357ef7){logger[_0x8fd5('0xf')]('ShowFreshsalesAccount',_0x357ef7['message'],_0x56fe65);_0x1c1565(_0x266798['error'](0x1f4,_0x357ef7[_0x8fd5('0x12')]));});});};
\ No newline at end of file
diff --git a/server/api/intFreshsalesConfiguration/index.js b/server/api/intFreshsalesConfiguration/index.js
index 2125dcc..9b4366b 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 _0xe3f6=['getDescriptions','/:id/fields','getFields','post','create','put','update','exports','multer','util','path','connect-timeout','Router','../../components/interaction/service','get','isAuthenticated','index','/:id','show','getSubjects','/:id/descriptions'];(function(_0x123ff8,_0x2b9a42){var _0x2d8b5e=function(_0x970b6f){while(--_0x970b6f){_0x123ff8['push'](_0x123ff8['shift']());}};_0x2d8b5e(++_0x2b9a42);}(_0xe3f6,0xc5));var _0x6e3f=function(_0x220f3f,_0x11c540){_0x220f3f=_0x220f3f-0x0;var _0x1f170e=_0xe3f6[_0x220f3f];return _0x1f170e;};'use strict';var multer=require(_0x6e3f('0x0'));var util=require(_0x6e3f('0x1'));var path=require(_0x6e3f('0x2'));var timeout=require(_0x6e3f('0x3'));var express=require('express');var router=express[_0x6e3f('0x4')]();var auth=require('../../components/auth/service');var interaction=require(_0x6e3f('0x5'));var config=require('../../config/environment');var controller=require('./intFreshsalesConfiguration.controller');router[_0x6e3f('0x6')]('/',auth[_0x6e3f('0x7')](),controller[_0x6e3f('0x8')]);router[_0x6e3f('0x6')](_0x6e3f('0x9'),auth['isAuthenticated'](),controller[_0x6e3f('0xa')]);router[_0x6e3f('0x6')]('/:id/subjects',auth['isAuthenticated'](),controller[_0x6e3f('0xb')]);router[_0x6e3f('0x6')](_0x6e3f('0xc'),auth[_0x6e3f('0x7')](),controller[_0x6e3f('0xd')]);router[_0x6e3f('0x6')](_0x6e3f('0xe'),auth[_0x6e3f('0x7')](),controller[_0x6e3f('0xf')]);router[_0x6e3f('0x10')]('/',auth[_0x6e3f('0x7')](),controller[_0x6e3f('0x11')]);router[_0x6e3f('0x12')]('/:id',auth[_0x6e3f('0x7')](),controller[_0x6e3f('0x13')]);router['delete'](_0x6e3f('0x9'),auth['isAuthenticated'](),controller['destroy']);module[_0x6e3f('0x14')]=router;
\ No newline at end of file
+var _0x7e33=['../../components/auth/service','./intFreshsalesConfiguration.controller','get','isAuthenticated','index','show','/:id/subjects','/:id/descriptions','getDescriptions','/:id/fields','getFields','post','create','put','/:id','delete','exports','multer','util','express','Router'];(function(_0x5c3c0b,_0x4ee35e){var _0x52ecd2=function(_0x3cf575){while(--_0x3cf575){_0x5c3c0b['push'](_0x5c3c0b['shift']());}};_0x52ecd2(++_0x4ee35e);}(_0x7e33,0x7a));var _0x37e3=function(_0xa7d933,_0x2de780){_0xa7d933=_0xa7d933-0x0;var _0x30abca=_0x7e33[_0xa7d933];return _0x30abca;};'use strict';var multer=require(_0x37e3('0x0'));var util=require(_0x37e3('0x1'));var path=require('path');var timeout=require('connect-timeout');var express=require(_0x37e3('0x2'));var router=express[_0x37e3('0x3')]();var auth=require(_0x37e3('0x4'));var interaction=require('../../components/interaction/service');var config=require('../../config/environment');var controller=require(_0x37e3('0x5'));router[_0x37e3('0x6')]('/',auth[_0x37e3('0x7')](),controller[_0x37e3('0x8')]);router[_0x37e3('0x6')]('/:id',auth[_0x37e3('0x7')](),controller[_0x37e3('0x9')]);router[_0x37e3('0x6')](_0x37e3('0xa'),auth[_0x37e3('0x7')](),controller['getSubjects']);router['get'](_0x37e3('0xb'),auth[_0x37e3('0x7')](),controller[_0x37e3('0xc')]);router['get'](_0x37e3('0xd'),auth[_0x37e3('0x7')](),controller[_0x37e3('0xe')]);router[_0x37e3('0xf')]('/',auth['isAuthenticated'](),controller[_0x37e3('0x10')]);router[_0x37e3('0x11')](_0x37e3('0x12'),auth[_0x37e3('0x7')](),controller['update']);router[_0x37e3('0x13')](_0x37e3('0x12'),auth[_0x37e3('0x7')](),controller['destroy']);module[_0x37e3('0x14')]=router;
\ No newline at end of file
diff --git a/server/api/intFreshsalesConfiguration/intFreshsalesConfiguration.attributes.js b/server/api/intFreshsalesConfiguration/intFreshsalesConfiguration.attributes.js
index a719f7d..7e31bca 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 _0x0767=['STRING','sequelize','exports'];(function(_0x2aec52,_0x59d962){var _0x3b8835=function(_0x3e2604){while(--_0x3e2604){_0x2aec52['push'](_0x2aec52['shift']());}};_0x3b8835(++_0x59d962);}(_0x0767,0xcd));var _0x7076=function(_0x4eb6be,_0x66b77){_0x4eb6be=_0x4eb6be-0x0;var _0xbfb9f6=_0x0767[_0x4eb6be];return _0xbfb9f6;};'use strict';var Sequelize=require(_0x7076('0x0'));module[_0x7076('0x1')]={'name':{'type':Sequelize[_0x7076('0x2')]},'description':{'type':Sequelize[_0x7076('0x2')]}};
\ No newline at end of file
+var _0xfca9=['sequelize','STRING'];(function(_0x110dc0,_0x3a6615){var _0x39aeb1=function(_0x46fa33){while(--_0x46fa33){_0x110dc0['push'](_0x110dc0['shift']());}};_0x39aeb1(++_0x3a6615);}(_0xfca9,0x9e));var _0x9fca=function(_0x1277ca,_0x432b26){_0x1277ca=_0x1277ca-0x0;var _0x15b711=_0xfca9[_0x1277ca];return _0x15b711;};'use strict';var Sequelize=require(_0x9fca('0x0'));module['exports']={'name':{'type':Sequelize[_0x9fca('0x1')]},'description':{'type':Sequelize['STRING']}};
\ No newline at end of file
diff --git a/server/api/intFreshsalesConfiguration/intFreshsalesConfiguration.controller.js b/server/api/intFreshsalesConfiguration/intFreshsalesConfiguration.controller.js
index 94f2599..3ff87b5 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 _0x304b=['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','FreshsalesConfiguration,\x20%s,\x20%s','request\x20sent','debug','FreshsalesConfiguration,\x20%s,\x20%s,\x20%s','error','code','message','info','sendStatus','end','count','offset','status','set','apply','reject','save','update','destroy','stack','name','index','map','FreshsalesConfiguration','key','model','keys','query','filters','intersection','fields','length','attributes','hasOwnProperty','nolimit','limit','order','sort','where','pick','type','merge','include','findAll','rows','catch','show','params','rawAttributes','options','create','body','find','findOne','FreshsalesField','filter','getSubjects','getDescriptions','getFields','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','moment','bluebird','mustache','sox','to-csv','ejs','lodash','squel','crypto','jsforce','desk.js','papaparse','ioredis','../../components/auth/service','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/environment'];(function(_0xf64026,_0x43afd3){var _0x1050be=function(_0x27c04f){while(--_0x27c04f){_0xf64026['push'](_0xf64026['shift']());}};_0x1050be(++_0x43afd3);}(_0x304b,0xfb));var _0xb304=function(_0x262045,_0x1a7ce6){_0x262045=_0x262045-0x0;var _0x23d122=_0x304b[_0x262045];return _0x23d122;};'use strict';var pdf=require('html-pdf');var emlformat=require(_0xb304('0x0'));var rimraf=require(_0xb304('0x1'));var zipdir=require(_0xb304('0x2'));var jsonpatch=require(_0xb304('0x3'));var rp=require(_0xb304('0x4'));var moment=require(_0xb304('0x5'));var BPromise=require(_0xb304('0x6'));var Mustache=require(_0xb304('0x7'));var util=require('util');var path=require('path');var sox=require(_0xb304('0x8'));var csv=require(_0xb304('0x9'));var ejs=require(_0xb304('0xa'));var fs=require('fs');var _=require(_0xb304('0xb'));var squel=require(_0xb304('0xc'));var crypto=require(_0xb304('0xd'));var jsforce=require(_0xb304('0xe'));var deskjs=require(_0xb304('0xf'));var toCsv=require(_0xb304('0x9'));var querystring=require('querystring');var Papa=require(_0xb304('0x10'));var Redis=require(_0xb304('0x11'));var authService=require(_0xb304('0x12'));var qs=require('../../components/parsers/qs');var as=require(_0xb304('0x13'));var hardwareService=require(_0xb304('0x14'));var logger=require(_0xb304('0x15'))(_0xb304('0x16'));var utils=require(_0xb304('0x17'));var config=require(_0xb304('0x18'));var db=require('../../mysqldb')['db'];var jayson=require(_0xb304('0x19'));var client=jayson[_0xb304('0x1a')][_0xb304('0x1b')]({'port':0x232a});function checkPasswordPattern(_0x743f7d,_0x489a00,_0x21153d){if(_0x21153d){var _0x2ce439=new RegExp(/(?=.*[a-z])(?=.*[A-Z])(?=.*[0-9])(?=.*[?!@#\$%\^&\*~\-_=+[{\]\}])(?=.{8,})/);if(_0x2ce439[_0xb304('0x1c')](_0x489a00)){return _0x743f7d;}else{throw new db[(_0xb304('0x1d'))][(_0xb304('0x1e'))](_0xb304('0x1f'));}}else{return _0x743f7d;}}function respondWithRpcPromise(_0x116b86,_0x1a15c9,_0x218d92,_0x22ac4b){return new BPromise(function(_0x3d20b5,_0x3be8cb){var _0x1252cb=_0x22ac4b||client;return _0x1252cb['request'](_0x116b86,_0x218d92)[_0xb304('0x20')](function(_0x5166c5){logger['info'](_0xb304('0x21'),_0x1a15c9,_0xb304('0x22'));logger[_0xb304('0x23')](_0xb304('0x24'),_0x1a15c9,_0xb304('0x22'),JSON['stringify'](_0x5166c5));if(_0x5166c5[_0xb304('0x25')]){if(_0x5166c5['error'][_0xb304('0x26')]===0x1f4){logger[_0xb304('0x25')]('FreshsalesConfiguration,\x20%s,\x20%s',_0x1a15c9,_0x5166c5['error']['message']);return _0x3be8cb(_0x5166c5[_0xb304('0x25')][_0xb304('0x27')]);}logger[_0xb304('0x25')](_0xb304('0x21'),_0x1a15c9,_0x5166c5['error'][_0xb304('0x27')]);return _0x3d20b5(_0x5166c5[_0xb304('0x25')][_0xb304('0x27')]);}else{logger[_0xb304('0x28')]('FreshsalesConfiguration,\x20%s,\x20%s',_0x1a15c9,'request\x20sent');_0x3d20b5(_0x5166c5['result'][_0xb304('0x27')]);}})['catch'](function(_0x40c7d7){logger['error'](_0xb304('0x21'),_0x1a15c9,_0x40c7d7);_0x3be8cb(_0x40c7d7);});});}function respondWithStatusCode(_0x148f48,_0x2b5271){_0x2b5271=_0x2b5271||0xcc;return function(_0x4de541){if(_0x4de541){return _0x148f48[_0xb304('0x29')](_0x2b5271);}return _0x148f48['status'](_0x2b5271)[_0xb304('0x2a')]();};}function respondWithResult(_0x4f46d2,_0x19d4bc){_0x19d4bc=_0x19d4bc||0xc8;return function(_0x2e3d0d){if(_0x2e3d0d){return _0x4f46d2['status'](_0x19d4bc)['json'](_0x2e3d0d);}};}function respondWithFilteredResult(_0x368a0d,_0x25e77b){return function(_0x2af69a){if(_0x2af69a){var _0xdfe560=_0x2af69a[_0xb304('0x2b')],_0x1d468d=_0x25e77b[_0xb304('0x2c')],_0x19ecc6=_0x25e77b[_0xb304('0x2c')]+_0x25e77b['limit'],_0x36af11;if(_0x19ecc6>=_0xdfe560){_0x19ecc6=_0xdfe560;_0x36af11=0xc8;}else{_0x36af11=0xce;}_0x368a0d[_0xb304('0x2d')](_0x36af11);return _0x368a0d[_0xb304('0x2e')]('Content-Range',_0x1d468d+'-'+_0x19ecc6+'/'+_0xdfe560)['json'](_0x2af69a);}return null;};}function patchUpdates(_0x35f4c7){return function(_0x320915){try{jsonpatch[_0xb304('0x2f')](_0x320915,_0x35f4c7,!![]);}catch(_0x4bb765){return BPromise[_0xb304('0x30')](_0x4bb765);}return _0x320915[_0xb304('0x31')]();};}function saveUpdates(_0x5c342b,_0x3d69dc){return function(_0x3580ad){if(_0x3580ad){return _0x3580ad[_0xb304('0x32')](_0x5c342b)[_0xb304('0x20')](function(_0xb8f2c6){return _0xb8f2c6;});}return null;};}function removeEntity(_0x4a9d1c,_0x139fd4){return function(_0x30a3c1){if(_0x30a3c1){return _0x30a3c1[_0xb304('0x33')]()[_0xb304('0x20')](function(){_0x4a9d1c[_0xb304('0x2d')](0xcc)[_0xb304('0x2a')]();});}};}function handleEntityNotFound(_0x726a2,_0x461877){return function(_0x3e25e4){if(!_0x3e25e4){_0x726a2[_0xb304('0x29')](0x194);}return _0x3e25e4;};}function handleError(_0x3f7fba,_0x224285){_0x224285=_0x224285||0x1f4;return function(_0x8652ac){logger[_0xb304('0x25')](_0x8652ac[_0xb304('0x34')]);if(_0x8652ac[_0xb304('0x35')]){delete _0x8652ac[_0xb304('0x35')];}_0x3f7fba[_0xb304('0x2d')](_0x224285)['send'](_0x8652ac);};}exports[_0xb304('0x36')]=function(_0x240e6f,_0x48715b){var _0x3c81ec={},_0x4ad982={},_0x167126={'count':0x0,'rows':[]};var _0x948597=_[_0xb304('0x37')](db[_0xb304('0x38')]['rawAttributes'],function(_0x2757a9){return{'name':_0x2757a9['fieldName'],'type':_0x2757a9['type'][_0xb304('0x39')]};});_0x4ad982[_0xb304('0x3a')]=_[_0xb304('0x37')](_0x948597,'name');_0x4ad982['query']=_[_0xb304('0x3b')](_0x240e6f[_0xb304('0x3c')]);_0x4ad982[_0xb304('0x3d')]=_[_0xb304('0x3e')](_0x4ad982[_0xb304('0x3a')],_0x4ad982[_0xb304('0x3c')]);_0x3c81ec['attributes']=_[_0xb304('0x3e')](_0x4ad982[_0xb304('0x3a')],qs[_0xb304('0x3f')](_0x240e6f['query']['fields']));_0x3c81ec['attributes']=_0x3c81ec['attributes'][_0xb304('0x40')]?_0x3c81ec[_0xb304('0x41')]:_0x4ad982['model'];if(!_0x240e6f[_0xb304('0x3c')][_0xb304('0x42')](_0xb304('0x43'))){_0x3c81ec[_0xb304('0x44')]=qs[_0xb304('0x44')](_0x240e6f[_0xb304('0x3c')][_0xb304('0x44')]);_0x3c81ec[_0xb304('0x2c')]=qs[_0xb304('0x2c')](_0x240e6f[_0xb304('0x3c')][_0xb304('0x2c')]);}_0x3c81ec[_0xb304('0x45')]=qs[_0xb304('0x46')](_0x240e6f['query'][_0xb304('0x46')]);_0x3c81ec[_0xb304('0x47')]=qs['filters'](_[_0xb304('0x48')](_0x240e6f['query'],_0x4ad982['filters']));if(_0x240e6f[_0xb304('0x3c')]['filter']){_0x3c81ec[_0xb304('0x47')]=_['merge'](_0x3c81ec[_0xb304('0x47')],{'$or':_[_0xb304('0x37')](_0x948597,function(_0x184645){if(_0x184645[_0xb304('0x49')]!=='VIRTUAL'){var _0x4a3c76={};_0x4a3c76[_0x184645[_0xb304('0x35')]]={'$like':'%'+_0x240e6f[_0xb304('0x3c')]['filter']+'%'};return _0x4a3c76;}})});}_0x3c81ec=_[_0xb304('0x4a')]({},_0x3c81ec,_0x240e6f['options']);var _0x1a6f2d={'where':_0x3c81ec[_0xb304('0x47')]};return db[_0xb304('0x38')][_0xb304('0x2b')](_0x1a6f2d)[_0xb304('0x20')](function(_0x118e47){_0x167126[_0xb304('0x2b')]=_0x118e47;if(_0x240e6f[_0xb304('0x3c')]['includeAll']){_0x3c81ec[_0xb304('0x4b')]=[{'all':!![]}];}return db[_0xb304('0x38')][_0xb304('0x4c')](_0x3c81ec);})[_0xb304('0x20')](function(_0x527a17){_0x167126[_0xb304('0x4d')]=_0x527a17;return _0x167126;})[_0xb304('0x20')](respondWithFilteredResult(_0x48715b,_0x3c81ec))[_0xb304('0x4e')](handleError(_0x48715b,null));};exports[_0xb304('0x4f')]=function(_0x36173d,_0x38ec58){var _0x3a85a1={'raw':![],'where':{'id':_0x36173d[_0xb304('0x50')]['id']}},_0xc6ddb7={};_0xc6ddb7[_0xb304('0x3a')]=_[_0xb304('0x3b')](db[_0xb304('0x38')][_0xb304('0x51')]);_0xc6ddb7[_0xb304('0x3c')]=_[_0xb304('0x3b')](_0x36173d[_0xb304('0x3c')]);_0xc6ddb7[_0xb304('0x3d')]=_[_0xb304('0x3e')](_0xc6ddb7[_0xb304('0x3a')],_0xc6ddb7[_0xb304('0x3c')]);_0x3a85a1[_0xb304('0x41')]=_[_0xb304('0x3e')](_0xc6ddb7[_0xb304('0x3a')],qs[_0xb304('0x3f')](_0x36173d[_0xb304('0x3c')]['fields']));_0x3a85a1[_0xb304('0x41')]=_0x3a85a1['attributes'][_0xb304('0x40')]?_0x3a85a1[_0xb304('0x41')]:_0xc6ddb7['model'];if(_0x36173d['query']['includeAll']){_0x3a85a1[_0xb304('0x4b')]=[{'all':!![]}];}_0x3a85a1=_[_0xb304('0x4a')]({},_0x3a85a1,_0x36173d[_0xb304('0x52')]);return db[_0xb304('0x38')]['find'](_0x3a85a1)[_0xb304('0x20')](handleEntityNotFound(_0x38ec58,null))[_0xb304('0x20')](respondWithResult(_0x38ec58,null))['catch'](handleError(_0x38ec58,null));};exports[_0xb304('0x53')]=function(_0x94ebde,_0x571c46){return db[_0xb304('0x38')][_0xb304('0x53')](_0x94ebde[_0xb304('0x54')],{})[_0xb304('0x20')](respondWithResult(_0x571c46,0xc9))['catch'](handleError(_0x571c46,null));};exports[_0xb304('0x32')]=function(_0x390f16,_0x2bfa16){if(_0x390f16[_0xb304('0x54')]['id']){delete _0x390f16[_0xb304('0x54')]['id'];}return db[_0xb304('0x38')][_0xb304('0x55')]({'where':{'id':_0x390f16[_0xb304('0x50')]['id']}})[_0xb304('0x20')](handleEntityNotFound(_0x2bfa16,null))[_0xb304('0x20')](saveUpdates(_0x390f16[_0xb304('0x54')],null))['then'](respondWithResult(_0x2bfa16,null))[_0xb304('0x4e')](handleError(_0x2bfa16,null));};exports[_0xb304('0x33')]=function(_0x3949f1,_0x1b3b17){return db[_0xb304('0x38')]['find']({'where':{'id':_0x3949f1[_0xb304('0x50')]['id']}})[_0xb304('0x20')](handleEntityNotFound(_0x1b3b17,null))['then'](removeEntity(_0x1b3b17,null))['catch'](handleError(_0x1b3b17,null));};exports['getSubjects']=function(_0x4df2bf,_0x1d1ea3,_0x4a58b3){var _0x276cf9={};var _0x21daa0={};var _0x47d673;var _0x468625;return db[_0xb304('0x38')][_0xb304('0x56')]({'where':{'id':_0x4df2bf[_0xb304('0x50')]['id']}})[_0xb304('0x20')](handleEntityNotFound(_0x1d1ea3,null))[_0xb304('0x20')](function(_0x3f68d1){if(_0x3f68d1){_0x47d673=_0x3f68d1;_0x21daa0['model']=_[_0xb304('0x3b')](db[_0xb304('0x57')][_0xb304('0x51')]);_0x21daa0['query']=_[_0xb304('0x3b')](_0x4df2bf[_0xb304('0x3c')]);_0x21daa0[_0xb304('0x3d')]=_[_0xb304('0x3e')](_0x21daa0[_0xb304('0x3a')],_0x21daa0[_0xb304('0x3c')]);_0x276cf9['attributes']=_[_0xb304('0x3e')](_0x21daa0[_0xb304('0x3a')],qs[_0xb304('0x3f')](_0x4df2bf['query']['fields']));_0x276cf9[_0xb304('0x41')]=_0x276cf9[_0xb304('0x41')][_0xb304('0x40')]?_0x276cf9[_0xb304('0x41')]:_0x21daa0[_0xb304('0x3a')];_0x276cf9[_0xb304('0x45')]=qs[_0xb304('0x46')](_0x4df2bf[_0xb304('0x3c')][_0xb304('0x46')]);_0x276cf9[_0xb304('0x47')]=qs['filters'](_[_0xb304('0x48')](_0x4df2bf['query'],_0x21daa0[_0xb304('0x3d')]));if(_0x4df2bf[_0xb304('0x3c')][_0xb304('0x58')]){_0x276cf9['where']=_[_0xb304('0x4a')](_0x276cf9[_0xb304('0x47')],{'$or':_[_0xb304('0x37')](_0x276cf9[_0xb304('0x41')],function(_0x21d4fe){var _0x16fb10={};_0x16fb10[_0x21d4fe]={'$like':'%'+_0x4df2bf[_0xb304('0x3c')]['filter']+'%'};return _0x16fb10;})});}_0x276cf9=_[_0xb304('0x4a')]({},_0x276cf9,_0x4df2bf[_0xb304('0x52')]);return _0x47d673[_0xb304('0x59')](_0x276cf9);}})['then'](function(_0xcf6cb8){if(_0xcf6cb8){_0x468625=_0xcf6cb8[_0xb304('0x40')];if(!_0x4df2bf[_0xb304('0x3c')][_0xb304('0x42')](_0xb304('0x43'))){_0x276cf9[_0xb304('0x44')]=qs['limit'](_0x4df2bf['query'][_0xb304('0x44')]);_0x276cf9['offset']=qs[_0xb304('0x2c')](_0x4df2bf[_0xb304('0x3c')][_0xb304('0x2c')]);}return _0x47d673[_0xb304('0x59')](_0x276cf9);}})[_0xb304('0x20')](function(_0x3d9787){if(_0x3d9787){return _0x3d9787?{'count':_0x468625,'rows':_0x3d9787}:null;}})[_0xb304('0x20')](respondWithResult(_0x1d1ea3,null))['catch'](handleError(_0x1d1ea3,null));};exports['getDescriptions']=function(_0x42b26c,_0x50b0e9,_0x56d1c2){var _0x19cba2={};var _0x1c72a7={};var _0x2cd525;var _0x2e6ca7;return db[_0xb304('0x38')][_0xb304('0x56')]({'where':{'id':_0x42b26c['params']['id']}})['then'](handleEntityNotFound(_0x50b0e9,null))[_0xb304('0x20')](function(_0x117b4a){if(_0x117b4a){_0x2cd525=_0x117b4a;_0x1c72a7[_0xb304('0x3a')]=_['keys'](db[_0xb304('0x57')][_0xb304('0x51')]);_0x1c72a7[_0xb304('0x3c')]=_[_0xb304('0x3b')](_0x42b26c[_0xb304('0x3c')]);_0x1c72a7[_0xb304('0x3d')]=_[_0xb304('0x3e')](_0x1c72a7[_0xb304('0x3a')],_0x1c72a7['query']);_0x19cba2[_0xb304('0x41')]=_[_0xb304('0x3e')](_0x1c72a7['model'],qs[_0xb304('0x3f')](_0x42b26c['query'][_0xb304('0x3f')]));_0x19cba2['attributes']=_0x19cba2[_0xb304('0x41')][_0xb304('0x40')]?_0x19cba2[_0xb304('0x41')]:_0x1c72a7[_0xb304('0x3a')];_0x19cba2[_0xb304('0x45')]=qs['sort'](_0x42b26c[_0xb304('0x3c')]['sort']);_0x19cba2[_0xb304('0x47')]=qs[_0xb304('0x3d')](_[_0xb304('0x48')](_0x42b26c[_0xb304('0x3c')],_0x1c72a7[_0xb304('0x3d')]));if(_0x42b26c[_0xb304('0x3c')][_0xb304('0x58')]){_0x19cba2[_0xb304('0x47')]=_[_0xb304('0x4a')](_0x19cba2['where'],{'$or':_[_0xb304('0x37')](_0x19cba2['attributes'],function(_0x496981){var _0x52e6f9={};_0x52e6f9[_0x496981]={'$like':'%'+_0x42b26c[_0xb304('0x3c')][_0xb304('0x58')]+'%'};return _0x52e6f9;})});}_0x19cba2=_[_0xb304('0x4a')]({},_0x19cba2,_0x42b26c['options']);return _0x2cd525['getDescriptions'](_0x19cba2);}})[_0xb304('0x20')](function(_0x2bbc24){if(_0x2bbc24){_0x2e6ca7=_0x2bbc24[_0xb304('0x40')];if(!_0x42b26c[_0xb304('0x3c')][_0xb304('0x42')]('nolimit')){_0x19cba2['limit']=qs[_0xb304('0x44')](_0x42b26c[_0xb304('0x3c')][_0xb304('0x44')]);_0x19cba2[_0xb304('0x2c')]=qs[_0xb304('0x2c')](_0x42b26c['query']['offset']);}return _0x2cd525[_0xb304('0x5a')](_0x19cba2);}})[_0xb304('0x20')](function(_0x35bca4){if(_0x35bca4){return _0x35bca4?{'count':_0x2e6ca7,'rows':_0x35bca4}:null;}})[_0xb304('0x20')](respondWithResult(_0x50b0e9,null))['catch'](handleError(_0x50b0e9,null));};exports['getFields']=function(_0x4a0977,_0x3b7082,_0x51210e){var _0x2205ac={};var _0x50ba28={};var _0x25c8d9;var _0x3f116b;return db['FreshsalesConfiguration']['findOne']({'where':{'id':_0x4a0977[_0xb304('0x50')]['id']}})['then'](handleEntityNotFound(_0x3b7082,null))[_0xb304('0x20')](function(_0x16c0a9){if(_0x16c0a9){_0x25c8d9=_0x16c0a9;_0x50ba28[_0xb304('0x3a')]=_[_0xb304('0x3b')](db[_0xb304('0x57')][_0xb304('0x51')]);_0x50ba28[_0xb304('0x3c')]=_[_0xb304('0x3b')](_0x4a0977[_0xb304('0x3c')]);_0x50ba28['filters']=_['intersection'](_0x50ba28[_0xb304('0x3a')],_0x50ba28['query']);_0x2205ac['attributes']=_[_0xb304('0x3e')](_0x50ba28[_0xb304('0x3a')],qs[_0xb304('0x3f')](_0x4a0977['query'][_0xb304('0x3f')]));_0x2205ac[_0xb304('0x41')]=_0x2205ac[_0xb304('0x41')]['length']?_0x2205ac[_0xb304('0x41')]:_0x50ba28[_0xb304('0x3a')];_0x2205ac[_0xb304('0x45')]=qs['sort'](_0x4a0977[_0xb304('0x3c')][_0xb304('0x46')]);_0x2205ac[_0xb304('0x47')]=qs['filters'](_[_0xb304('0x48')](_0x4a0977[_0xb304('0x3c')],_0x50ba28[_0xb304('0x3d')]));if(_0x4a0977['query'][_0xb304('0x58')]){_0x2205ac[_0xb304('0x47')]=_['merge'](_0x2205ac['where'],{'$or':_[_0xb304('0x37')](_0x2205ac[_0xb304('0x41')],function(_0x594a5d){var _0x3f6134={};_0x3f6134[_0x594a5d]={'$like':'%'+_0x4a0977[_0xb304('0x3c')][_0xb304('0x58')]+'%'};return _0x3f6134;})});}_0x2205ac=_[_0xb304('0x4a')]({},_0x2205ac,_0x4a0977[_0xb304('0x52')]);return _0x25c8d9[_0xb304('0x5b')](_0x2205ac);}})[_0xb304('0x20')](function(_0x204b1d){if(_0x204b1d){_0x3f116b=_0x204b1d[_0xb304('0x40')];if(!_0x4a0977[_0xb304('0x3c')][_0xb304('0x42')](_0xb304('0x43'))){_0x2205ac['limit']=qs[_0xb304('0x44')](_0x4a0977['query'][_0xb304('0x44')]);_0x2205ac[_0xb304('0x2c')]=qs['offset'](_0x4a0977[_0xb304('0x3c')]['offset']);}return _0x25c8d9[_0xb304('0x5b')](_0x2205ac);}})[_0xb304('0x20')](function(_0x580da3){if(_0x580da3){return _0x580da3?{'count':_0x3f116b,'rows':_0x580da3}:null;}})['then'](respondWithResult(_0x3b7082,null))['catch'](handleError(_0x3b7082,null));};
\ No newline at end of file
+var _0x86f4=['getDescriptions','getFields','html-pdf','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','moment','mustache','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/utils','../../config/environment','../../mysqldb','jayson/promise','client','http','test','Sequelize','then','info','FreshsalesConfiguration,\x20%s,\x20%s','FreshsalesConfiguration,\x20%s,\x20%s,\x20%s','request\x20sent','stringify','error','code','message','result','catch','sendStatus','status','end','json','count','offset','limit','set','Content-Range','apply','reject','save','update','stack','name','send','index','FreshsalesConfiguration','rawAttributes','type','key','model','map','query','keys','filters','intersection','attributes','fields','length','hasOwnProperty','nolimit','order','sort','pick','filter','merge','where','VIRTUAL','options','includeAll','include','findAll','rows','show','find','create','body','params','getSubjects','findOne','FreshsalesField'];(function(_0x321bb2,_0x202794){var _0x9c12ed=function(_0x263dd3){while(--_0x263dd3){_0x321bb2['push'](_0x321bb2['shift']());}};_0x9c12ed(++_0x202794);}(_0x86f4,0x18a));var _0x486f=function(_0x272b03,_0x3d8fce){_0x272b03=_0x272b03-0x0;var _0x2c9d4b=_0x86f4[_0x272b03];return _0x2c9d4b;};'use strict';var pdf=require(_0x486f('0x0'));var emlformat=require(_0x486f('0x1'));var rimraf=require(_0x486f('0x2'));var zipdir=require(_0x486f('0x3'));var jsonpatch=require(_0x486f('0x4'));var rp=require(_0x486f('0x5'));var moment=require(_0x486f('0x6'));var BPromise=require('bluebird');var Mustache=require(_0x486f('0x7'));var util=require(_0x486f('0x8'));var path=require('path');var sox=require(_0x486f('0x9'));var csv=require(_0x486f('0xa'));var ejs=require(_0x486f('0xb'));var fs=require('fs');var _=require(_0x486f('0xc'));var squel=require(_0x486f('0xd'));var crypto=require(_0x486f('0xe'));var jsforce=require('jsforce');var deskjs=require(_0x486f('0xf'));var toCsv=require(_0x486f('0xa'));var querystring=require(_0x486f('0x10'));var Papa=require(_0x486f('0x11'));var Redis=require(_0x486f('0x12'));var authService=require(_0x486f('0x13'));var qs=require(_0x486f('0x14'));var as=require(_0x486f('0x15'));var hardwareService=require(_0x486f('0x16'));var logger=require(_0x486f('0x17'))(_0x486f('0x18'));var utils=require(_0x486f('0x19'));var config=require(_0x486f('0x1a'));var db=require(_0x486f('0x1b'))['db'];var jayson=require(_0x486f('0x1c'));var client=jayson[_0x486f('0x1d')][_0x486f('0x1e')]({'port':0x232a});function checkPasswordPattern(_0x4eb4f9,_0x294bed,_0x5cb33a){if(_0x5cb33a){var _0x46d0a9=new RegExp(/(?=.*[a-z])(?=.*[A-Z])(?=.*[0-9])(?=.*[?!@#\$%\^&\*~\-_=+[{\]\}])(?=.{8,})/);if(_0x46d0a9[_0x486f('0x1f')](_0x294bed)){return _0x4eb4f9;}else{throw new db[(_0x486f('0x20'))]['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 _0x4eb4f9;}}function respondWithRpcPromise(_0x11c2af,_0x3a4fef,_0x51334f,_0x16830e){return new BPromise(function(_0x2ab753,_0x3ebe6a){var _0x4ec12f=_0x16830e||client;return _0x4ec12f['request'](_0x11c2af,_0x51334f)[_0x486f('0x21')](function(_0x3eeae0){logger[_0x486f('0x22')](_0x486f('0x23'),_0x3a4fef,'request\x20sent');logger['debug'](_0x486f('0x24'),_0x3a4fef,_0x486f('0x25'),JSON[_0x486f('0x26')](_0x3eeae0));if(_0x3eeae0[_0x486f('0x27')]){if(_0x3eeae0[_0x486f('0x27')][_0x486f('0x28')]===0x1f4){logger[_0x486f('0x27')](_0x486f('0x23'),_0x3a4fef,_0x3eeae0[_0x486f('0x27')][_0x486f('0x29')]);return _0x3ebe6a(_0x3eeae0[_0x486f('0x27')][_0x486f('0x29')]);}logger[_0x486f('0x27')](_0x486f('0x23'),_0x3a4fef,_0x3eeae0[_0x486f('0x27')][_0x486f('0x29')]);return _0x2ab753(_0x3eeae0['error'][_0x486f('0x29')]);}else{logger[_0x486f('0x22')](_0x486f('0x23'),_0x3a4fef,_0x486f('0x25'));_0x2ab753(_0x3eeae0[_0x486f('0x2a')][_0x486f('0x29')]);}})[_0x486f('0x2b')](function(_0xbf5f3a){logger[_0x486f('0x27')](_0x486f('0x23'),_0x3a4fef,_0xbf5f3a);_0x3ebe6a(_0xbf5f3a);});});}function respondWithStatusCode(_0x2e983b,_0x71a26f){_0x71a26f=_0x71a26f||0xcc;return function(_0x387462){if(_0x387462){return _0x2e983b[_0x486f('0x2c')](_0x71a26f);}return _0x2e983b[_0x486f('0x2d')](_0x71a26f)[_0x486f('0x2e')]();};}function respondWithResult(_0x6f1e8e,_0x477458){_0x477458=_0x477458||0xc8;return function(_0xdc34ff){if(_0xdc34ff){return _0x6f1e8e[_0x486f('0x2d')](_0x477458)[_0x486f('0x2f')](_0xdc34ff);}};}function respondWithFilteredResult(_0x25531f,_0x5105ee){return function(_0x486b86){if(_0x486b86){var _0x52fb3a=_0x486b86[_0x486f('0x30')],_0x5b4718=_0x5105ee[_0x486f('0x31')],_0x173512=_0x5105ee['offset']+_0x5105ee[_0x486f('0x32')],_0x5c994a;if(_0x173512>=_0x52fb3a){_0x173512=_0x52fb3a;_0x5c994a=0xc8;}else{_0x5c994a=0xce;}_0x25531f['status'](_0x5c994a);return _0x25531f[_0x486f('0x33')](_0x486f('0x34'),_0x5b4718+'-'+_0x173512+'/'+_0x52fb3a)[_0x486f('0x2f')](_0x486b86);}return null;};}function patchUpdates(_0x604ec3){return function(_0x1962c2){try{jsonpatch[_0x486f('0x35')](_0x1962c2,_0x604ec3,!![]);}catch(_0x5613ca){return BPromise[_0x486f('0x36')](_0x5613ca);}return _0x1962c2[_0x486f('0x37')]();};}function saveUpdates(_0xdd39fe,_0x429b8d){return function(_0x168d11){if(_0x168d11){return _0x168d11[_0x486f('0x38')](_0xdd39fe)[_0x486f('0x21')](function(_0x1756d3){return _0x1756d3;});}return null;};}function removeEntity(_0x5764ca,_0x34b842){return function(_0x45aa41){if(_0x45aa41){return _0x45aa41['destroy']()[_0x486f('0x21')](function(){_0x5764ca[_0x486f('0x2d')](0xcc)[_0x486f('0x2e')]();});}};}function handleEntityNotFound(_0xb657e7,_0x4bd2b7){return function(_0x531c16){if(!_0x531c16){_0xb657e7[_0x486f('0x2c')](0x194);}return _0x531c16;};}function handleError(_0x40dd81,_0x1be0da){_0x1be0da=_0x1be0da||0x1f4;return function(_0x202ea8){logger[_0x486f('0x27')](_0x202ea8[_0x486f('0x39')]);if(_0x202ea8[_0x486f('0x3a')]){delete _0x202ea8['name'];}_0x40dd81[_0x486f('0x2d')](_0x1be0da)[_0x486f('0x3b')](_0x202ea8);};}exports[_0x486f('0x3c')]=function(_0x51c5dc,_0x5678d8){var _0x3fbdc6={},_0x115419={},_0x4b80f8={'count':0x0,'rows':[]};var _0x22c18d=_['map'](db[_0x486f('0x3d')][_0x486f('0x3e')],function(_0x5ca543){return{'name':_0x5ca543['fieldName'],'type':_0x5ca543[_0x486f('0x3f')][_0x486f('0x40')]};});_0x115419[_0x486f('0x41')]=_[_0x486f('0x42')](_0x22c18d,_0x486f('0x3a'));_0x115419[_0x486f('0x43')]=_[_0x486f('0x44')](_0x51c5dc[_0x486f('0x43')]);_0x115419[_0x486f('0x45')]=_[_0x486f('0x46')](_0x115419[_0x486f('0x41')],_0x115419[_0x486f('0x43')]);_0x3fbdc6[_0x486f('0x47')]=_[_0x486f('0x46')](_0x115419['model'],qs[_0x486f('0x48')](_0x51c5dc[_0x486f('0x43')]['fields']));_0x3fbdc6[_0x486f('0x47')]=_0x3fbdc6[_0x486f('0x47')][_0x486f('0x49')]?_0x3fbdc6[_0x486f('0x47')]:_0x115419[_0x486f('0x41')];if(!_0x51c5dc[_0x486f('0x43')][_0x486f('0x4a')](_0x486f('0x4b'))){_0x3fbdc6[_0x486f('0x32')]=qs['limit'](_0x51c5dc['query'][_0x486f('0x32')]);_0x3fbdc6[_0x486f('0x31')]=qs[_0x486f('0x31')](_0x51c5dc[_0x486f('0x43')][_0x486f('0x31')]);}_0x3fbdc6[_0x486f('0x4c')]=qs[_0x486f('0x4d')](_0x51c5dc[_0x486f('0x43')][_0x486f('0x4d')]);_0x3fbdc6['where']=qs[_0x486f('0x45')](_[_0x486f('0x4e')](_0x51c5dc[_0x486f('0x43')],_0x115419[_0x486f('0x45')]));if(_0x51c5dc['query'][_0x486f('0x4f')]){_0x3fbdc6['where']=_[_0x486f('0x50')](_0x3fbdc6[_0x486f('0x51')],{'$or':_[_0x486f('0x42')](_0x22c18d,function(_0x1fe73f){if(_0x1fe73f[_0x486f('0x3f')]!==_0x486f('0x52')){var _0x5534b1={};_0x5534b1[_0x1fe73f['name']]={'$like':'%'+_0x51c5dc[_0x486f('0x43')][_0x486f('0x4f')]+'%'};return _0x5534b1;}})});}_0x3fbdc6=_[_0x486f('0x50')]({},_0x3fbdc6,_0x51c5dc[_0x486f('0x53')]);var _0x4dbf30={'where':_0x3fbdc6[_0x486f('0x51')]};return db[_0x486f('0x3d')][_0x486f('0x30')](_0x4dbf30)['then'](function(_0x272a8f){_0x4b80f8[_0x486f('0x30')]=_0x272a8f;if(_0x51c5dc[_0x486f('0x43')][_0x486f('0x54')]){_0x3fbdc6[_0x486f('0x55')]=[{'all':!![]}];}return db[_0x486f('0x3d')][_0x486f('0x56')](_0x3fbdc6);})[_0x486f('0x21')](function(_0x51ca91){_0x4b80f8[_0x486f('0x57')]=_0x51ca91;return _0x4b80f8;})['then'](respondWithFilteredResult(_0x5678d8,_0x3fbdc6))[_0x486f('0x2b')](handleError(_0x5678d8,null));};exports[_0x486f('0x58')]=function(_0x4554f3,_0x1055cf){var _0x34033e={'raw':![],'where':{'id':_0x4554f3['params']['id']}},_0x2e5746={};_0x2e5746[_0x486f('0x41')]=_[_0x486f('0x44')](db[_0x486f('0x3d')][_0x486f('0x3e')]);_0x2e5746[_0x486f('0x43')]=_[_0x486f('0x44')](_0x4554f3[_0x486f('0x43')]);_0x2e5746[_0x486f('0x45')]=_[_0x486f('0x46')](_0x2e5746['model'],_0x2e5746[_0x486f('0x43')]);_0x34033e[_0x486f('0x47')]=_[_0x486f('0x46')](_0x2e5746['model'],qs[_0x486f('0x48')](_0x4554f3[_0x486f('0x43')][_0x486f('0x48')]));_0x34033e['attributes']=_0x34033e[_0x486f('0x47')][_0x486f('0x49')]?_0x34033e[_0x486f('0x47')]:_0x2e5746[_0x486f('0x41')];if(_0x4554f3['query']['includeAll']){_0x34033e[_0x486f('0x55')]=[{'all':!![]}];}_0x34033e=_[_0x486f('0x50')]({},_0x34033e,_0x4554f3[_0x486f('0x53')]);return db[_0x486f('0x3d')][_0x486f('0x59')](_0x34033e)[_0x486f('0x21')](handleEntityNotFound(_0x1055cf,null))[_0x486f('0x21')](respondWithResult(_0x1055cf,null))[_0x486f('0x2b')](handleError(_0x1055cf,null));};exports['create']=function(_0x14820c,_0x5469bb){return db[_0x486f('0x3d')][_0x486f('0x5a')](_0x14820c[_0x486f('0x5b')],{})[_0x486f('0x21')](respondWithResult(_0x5469bb,0xc9))['catch'](handleError(_0x5469bb,null));};exports[_0x486f('0x38')]=function(_0x188e6a,_0x1303f7){if(_0x188e6a[_0x486f('0x5b')]['id']){delete _0x188e6a['body']['id'];}return db[_0x486f('0x3d')][_0x486f('0x59')]({'where':{'id':_0x188e6a[_0x486f('0x5c')]['id']}})[_0x486f('0x21')](handleEntityNotFound(_0x1303f7,null))[_0x486f('0x21')](saveUpdates(_0x188e6a[_0x486f('0x5b')],null))[_0x486f('0x21')](respondWithResult(_0x1303f7,null))[_0x486f('0x2b')](handleError(_0x1303f7,null));};exports['destroy']=function(_0x42778e,_0x4754d6){return db[_0x486f('0x3d')][_0x486f('0x59')]({'where':{'id':_0x42778e['params']['id']}})[_0x486f('0x21')](handleEntityNotFound(_0x4754d6,null))['then'](removeEntity(_0x4754d6,null))[_0x486f('0x2b')](handleError(_0x4754d6,null));};exports[_0x486f('0x5d')]=function(_0x419093,_0x2d2ded,_0x55d41f){var _0x455b85={};var _0xa72483={};var _0x3d0f84;var _0x1f596c;return db['FreshsalesConfiguration'][_0x486f('0x5e')]({'where':{'id':_0x419093[_0x486f('0x5c')]['id']}})[_0x486f('0x21')](handleEntityNotFound(_0x2d2ded,null))[_0x486f('0x21')](function(_0x40ddfe){if(_0x40ddfe){_0x3d0f84=_0x40ddfe;_0xa72483[_0x486f('0x41')]=_[_0x486f('0x44')](db[_0x486f('0x5f')][_0x486f('0x3e')]);_0xa72483[_0x486f('0x43')]=_[_0x486f('0x44')](_0x419093[_0x486f('0x43')]);_0xa72483[_0x486f('0x45')]=_[_0x486f('0x46')](_0xa72483['model'],_0xa72483[_0x486f('0x43')]);_0x455b85['attributes']=_[_0x486f('0x46')](_0xa72483['model'],qs[_0x486f('0x48')](_0x419093[_0x486f('0x43')]['fields']));_0x455b85['attributes']=_0x455b85[_0x486f('0x47')]['length']?_0x455b85[_0x486f('0x47')]:_0xa72483[_0x486f('0x41')];_0x455b85['order']=qs[_0x486f('0x4d')](_0x419093[_0x486f('0x43')][_0x486f('0x4d')]);_0x455b85[_0x486f('0x51')]=qs[_0x486f('0x45')](_[_0x486f('0x4e')](_0x419093['query'],_0xa72483[_0x486f('0x45')]));if(_0x419093[_0x486f('0x43')][_0x486f('0x4f')]){_0x455b85['where']=_[_0x486f('0x50')](_0x455b85['where'],{'$or':_[_0x486f('0x42')](_0x455b85['attributes'],function(_0x17a23){var _0x165595={};_0x165595[_0x17a23]={'$like':'%'+_0x419093[_0x486f('0x43')][_0x486f('0x4f')]+'%'};return _0x165595;})});}_0x455b85=_['merge']({},_0x455b85,_0x419093[_0x486f('0x53')]);return _0x3d0f84[_0x486f('0x5d')](_0x455b85);}})[_0x486f('0x21')](function(_0x53f673){if(_0x53f673){_0x1f596c=_0x53f673[_0x486f('0x49')];if(!_0x419093[_0x486f('0x43')][_0x486f('0x4a')](_0x486f('0x4b'))){_0x455b85['limit']=qs[_0x486f('0x32')](_0x419093[_0x486f('0x43')][_0x486f('0x32')]);_0x455b85['offset']=qs[_0x486f('0x31')](_0x419093[_0x486f('0x43')][_0x486f('0x31')]);}return _0x3d0f84['getSubjects'](_0x455b85);}})[_0x486f('0x21')](function(_0x101334){if(_0x101334){return _0x101334?{'count':_0x1f596c,'rows':_0x101334}:null;}})['then'](respondWithResult(_0x2d2ded,null))['catch'](handleError(_0x2d2ded,null));};exports['getDescriptions']=function(_0x4c4208,_0x3c3a88,_0x36496c){var _0x8c111a={};var _0x3ca472={};var _0x1ecc6f;var _0x1c49d2;return db[_0x486f('0x3d')][_0x486f('0x5e')]({'where':{'id':_0x4c4208['params']['id']}})[_0x486f('0x21')](handleEntityNotFound(_0x3c3a88,null))[_0x486f('0x21')](function(_0x30276d){if(_0x30276d){_0x1ecc6f=_0x30276d;_0x3ca472[_0x486f('0x41')]=_[_0x486f('0x44')](db['FreshsalesField']['rawAttributes']);_0x3ca472[_0x486f('0x43')]=_[_0x486f('0x44')](_0x4c4208['query']);_0x3ca472[_0x486f('0x45')]=_[_0x486f('0x46')](_0x3ca472['model'],_0x3ca472['query']);_0x8c111a[_0x486f('0x47')]=_[_0x486f('0x46')](_0x3ca472[_0x486f('0x41')],qs[_0x486f('0x48')](_0x4c4208[_0x486f('0x43')][_0x486f('0x48')]));_0x8c111a[_0x486f('0x47')]=_0x8c111a['attributes']['length']?_0x8c111a[_0x486f('0x47')]:_0x3ca472['model'];_0x8c111a[_0x486f('0x4c')]=qs['sort'](_0x4c4208[_0x486f('0x43')]['sort']);_0x8c111a['where']=qs[_0x486f('0x45')](_['pick'](_0x4c4208['query'],_0x3ca472[_0x486f('0x45')]));if(_0x4c4208['query'][_0x486f('0x4f')]){_0x8c111a['where']=_[_0x486f('0x50')](_0x8c111a[_0x486f('0x51')],{'$or':_[_0x486f('0x42')](_0x8c111a[_0x486f('0x47')],function(_0x59c308){var _0xf72086={};_0xf72086[_0x59c308]={'$like':'%'+_0x4c4208[_0x486f('0x43')]['filter']+'%'};return _0xf72086;})});}_0x8c111a=_[_0x486f('0x50')]({},_0x8c111a,_0x4c4208['options']);return _0x1ecc6f[_0x486f('0x60')](_0x8c111a);}})['then'](function(_0x30c3f1){if(_0x30c3f1){_0x1c49d2=_0x30c3f1['length'];if(!_0x4c4208['query']['hasOwnProperty'](_0x486f('0x4b'))){_0x8c111a[_0x486f('0x32')]=qs[_0x486f('0x32')](_0x4c4208[_0x486f('0x43')][_0x486f('0x32')]);_0x8c111a[_0x486f('0x31')]=qs[_0x486f('0x31')](_0x4c4208[_0x486f('0x43')][_0x486f('0x31')]);}return _0x1ecc6f[_0x486f('0x60')](_0x8c111a);}})['then'](function(_0x1022de){if(_0x1022de){return _0x1022de?{'count':_0x1c49d2,'rows':_0x1022de}:null;}})[_0x486f('0x21')](respondWithResult(_0x3c3a88,null))[_0x486f('0x2b')](handleError(_0x3c3a88,null));};exports[_0x486f('0x61')]=function(_0x5d3159,_0x48d919,_0x5c2d46){var _0x30d0b9={};var _0xd187c5={};var _0x5cf7e2;var _0x5da4d5;return db['FreshsalesConfiguration'][_0x486f('0x5e')]({'where':{'id':_0x5d3159[_0x486f('0x5c')]['id']}})[_0x486f('0x21')](handleEntityNotFound(_0x48d919,null))['then'](function(_0x4efcec){if(_0x4efcec){_0x5cf7e2=_0x4efcec;_0xd187c5['model']=_[_0x486f('0x44')](db['FreshsalesField'][_0x486f('0x3e')]);_0xd187c5['query']=_[_0x486f('0x44')](_0x5d3159['query']);_0xd187c5[_0x486f('0x45')]=_[_0x486f('0x46')](_0xd187c5[_0x486f('0x41')],_0xd187c5[_0x486f('0x43')]);_0x30d0b9[_0x486f('0x47')]=_[_0x486f('0x46')](_0xd187c5[_0x486f('0x41')],qs[_0x486f('0x48')](_0x5d3159['query'][_0x486f('0x48')]));_0x30d0b9['attributes']=_0x30d0b9[_0x486f('0x47')]['length']?_0x30d0b9[_0x486f('0x47')]:_0xd187c5[_0x486f('0x41')];_0x30d0b9['order']=qs[_0x486f('0x4d')](_0x5d3159[_0x486f('0x43')][_0x486f('0x4d')]);_0x30d0b9['where']=qs[_0x486f('0x45')](_[_0x486f('0x4e')](_0x5d3159[_0x486f('0x43')],_0xd187c5['filters']));if(_0x5d3159['query'][_0x486f('0x4f')]){_0x30d0b9[_0x486f('0x51')]=_['merge'](_0x30d0b9[_0x486f('0x51')],{'$or':_[_0x486f('0x42')](_0x30d0b9[_0x486f('0x47')],function(_0x3437bf){var _0x369f07={};_0x369f07[_0x3437bf]={'$like':'%'+_0x5d3159[_0x486f('0x43')][_0x486f('0x4f')]+'%'};return _0x369f07;})});}_0x30d0b9=_[_0x486f('0x50')]({},_0x30d0b9,_0x5d3159[_0x486f('0x53')]);return _0x5cf7e2[_0x486f('0x61')](_0x30d0b9);}})[_0x486f('0x21')](function(_0x3c1bd3){if(_0x3c1bd3){_0x5da4d5=_0x3c1bd3[_0x486f('0x49')];if(!_0x5d3159[_0x486f('0x43')][_0x486f('0x4a')]('nolimit')){_0x30d0b9[_0x486f('0x32')]=qs['limit'](_0x5d3159[_0x486f('0x43')]['limit']);_0x30d0b9[_0x486f('0x31')]=qs['offset'](_0x5d3159[_0x486f('0x43')][_0x486f('0x31')]);}return _0x5cf7e2[_0x486f('0x61')](_0x30d0b9);}})[_0x486f('0x21')](function(_0x5d66ca){if(_0x5d66ca){return _0x5d66ca?{'count':_0x5da4d5,'rows':_0x5d66ca}:null;}})[_0x486f('0x21')](respondWithResult(_0x48d919,null))[_0x486f('0x2b')](handleError(_0x48d919,null));};
\ No newline at end of file
diff --git a/server/api/intFreshsalesConfiguration/intFreshsalesConfiguration.model.js b/server/api/intFreshsalesConfiguration/intFreshsalesConfiguration.model.js
index 1b22980..db0765d 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 _0x1e91=['request-promise','path','rimraf','./intFreshsalesConfiguration.attributes','exports','define','FreshsalesConfiguration','util','api','bluebird'];(function(_0x289891,_0x49a0fa){var _0x31cf2e=function(_0x8cebce){while(--_0x8cebce){_0x289891['push'](_0x289891['shift']());}};_0x31cf2e(++_0x49a0fa);}(_0x1e91,0xe3));var _0x11e9=function(_0x4e8358,_0x508bfa){_0x4e8358=_0x4e8358-0x0;var _0xac9370=_0x1e91[_0x4e8358];return _0xac9370;};'use strict';var _=require('lodash');var util=require(_0x11e9('0x0'));var logger=require('../../config/logger')(_0x11e9('0x1'));var moment=require('moment');var BPromise=require(_0x11e9('0x2'));var rp=require(_0x11e9('0x3'));var fs=require('fs');var path=require(_0x11e9('0x4'));var rimraf=require(_0x11e9('0x5'));var config=require('../../config/environment');var attributes=require(_0x11e9('0x6'));module[_0x11e9('0x7')]=function(_0x143198,_0x303c9d){return _0x143198[_0x11e9('0x8')](_0x11e9('0x9'),attributes,{'tableName':'int_freshsales_configurations','paranoid':![],'indexes':[],'timestamps':!![]});};
\ No newline at end of file
+var _0xab02=['exports','define','lodash','util','../../config/logger','api','moment','bluebird','request-promise','path','rimraf','../../config/environment','./intFreshsalesConfiguration.attributes'];(function(_0x4de9cf,_0x43fadf){var _0x22f258=function(_0x5c64cd){while(--_0x5c64cd){_0x4de9cf['push'](_0x4de9cf['shift']());}};_0x22f258(++_0x43fadf);}(_0xab02,0xc5));var _0x2ab0=function(_0x54167d,_0x5324b4){_0x54167d=_0x54167d-0x0;var _0x292a30=_0xab02[_0x54167d];return _0x292a30;};'use strict';var _=require(_0x2ab0('0x0'));var util=require(_0x2ab0('0x1'));var logger=require(_0x2ab0('0x2'))(_0x2ab0('0x3'));var moment=require(_0x2ab0('0x4'));var BPromise=require(_0x2ab0('0x5'));var rp=require(_0x2ab0('0x6'));var fs=require('fs');var path=require(_0x2ab0('0x7'));var rimraf=require(_0x2ab0('0x8'));var config=require(_0x2ab0('0x9'));var attributes=require(_0x2ab0('0xa'));module[_0x2ab0('0xb')]=function(_0x35197d,_0x4bfdd4){return _0x35197d[_0x2ab0('0xc')]('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 5a0d0f7..8ffd258 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 _0x2242=['code','error','message','result','catch','lodash','util','moment','randomstring','ioredis','../../config/utils','../../config/logger','../../config/environment','jayson/promise','client','request','then','info','FreshsalesConfiguration,\x20%s,\x20%s','request\x20sent','debug','FreshsalesConfiguration,\x20%s,\x20%s,\x20%s','stringify'];(function(_0x38179f,_0x395ce6){var _0x1bae80=function(_0x10f0a2){while(--_0x10f0a2){_0x38179f['push'](_0x38179f['shift']());}};_0x1bae80(++_0x395ce6);}(_0x2242,0x1a3));var _0x2224=function(_0x2e699b,_0x16aab6){_0x2e699b=_0x2e699b-0x0;var _0x5aa40b=_0x2242[_0x2e699b];return _0x5aa40b;};'use strict';var _=require(_0x2224('0x0'));var util=require(_0x2224('0x1'));var moment=require(_0x2224('0x2'));var BPromise=require('bluebird');var rs=require(_0x2224('0x3'));var fs=require('fs');var Redis=require(_0x2224('0x4'));var db=require('../../mysqldb')['db'];var utils=require(_0x2224('0x5'));var logger=require(_0x2224('0x6'))('rpc');var config=require(_0x2224('0x7'));var jayson=require(_0x2224('0x8'));var client=jayson[_0x2224('0x9')]['http']({'port':0x232a});function respondWithRpcPromise(_0x28833b,_0x16893c,_0x35f807){return new BPromise(function(_0x25c6d4,_0x18149e){return client[_0x2224('0xa')](_0x28833b,_0x35f807)[_0x2224('0xb')](function(_0x147bd7){logger[_0x2224('0xc')](_0x2224('0xd'),_0x16893c,_0x2224('0xe'));logger[_0x2224('0xf')](_0x2224('0x10'),_0x16893c,_0x2224('0xe'),JSON[_0x2224('0x11')](_0x147bd7));if(_0x147bd7['error']){if(_0x147bd7['error'][_0x2224('0x12')]===0x1f4){logger[_0x2224('0x13')](_0x2224('0xd'),_0x16893c,_0x147bd7[_0x2224('0x13')]['message']);return _0x18149e(_0x147bd7[_0x2224('0x13')][_0x2224('0x14')]);}logger['error']('FreshsalesConfiguration,\x20%s,\x20%s',_0x16893c,_0x147bd7[_0x2224('0x13')][_0x2224('0x14')]);return _0x25c6d4(_0x147bd7['error']['message']);}else{logger[_0x2224('0xc')](_0x2224('0xd'),_0x16893c,_0x2224('0xe'));_0x25c6d4(_0x147bd7[_0x2224('0x15')][_0x2224('0x14')]);}})[_0x2224('0x16')](function(_0x34d045){logger[_0x2224('0x13')]('FreshsalesConfiguration,\x20%s,\x20%s',_0x16893c,_0x34d045);_0x18149e(_0x34d045);});});}
\ No newline at end of file
+var _0x86fd=['debug','error','code','message','info','result','catch','lodash','util','moment','bluebird','ioredis','../../config/utils','../../config/logger','../../config/environment','jayson/promise','request','then','FreshsalesConfiguration,\x20%s,\x20%s','request\x20sent'];(function(_0x17d9e3,_0x1f969c){var _0x14192d=function(_0x159745){while(--_0x159745){_0x17d9e3['push'](_0x17d9e3['shift']());}};_0x14192d(++_0x1f969c);}(_0x86fd,0xa7));var _0xd86f=function(_0x539533,_0x59b89b){_0x539533=_0x539533-0x0;var _0x3942f3=_0x86fd[_0x539533];return _0x3942f3;};'use strict';var _=require(_0xd86f('0x0'));var util=require(_0xd86f('0x1'));var moment=require(_0xd86f('0x2'));var BPromise=require(_0xd86f('0x3'));var rs=require('randomstring');var fs=require('fs');var Redis=require(_0xd86f('0x4'));var db=require('../../mysqldb')['db'];var utils=require(_0xd86f('0x5'));var logger=require(_0xd86f('0x6'))('rpc');var config=require(_0xd86f('0x7'));var jayson=require(_0xd86f('0x8'));var client=jayson['client']['http']({'port':0x232a});function respondWithRpcPromise(_0x2843b2,_0x500cb8,_0x3f1920){return new BPromise(function(_0x4cd46e,_0x2b4117){return client[_0xd86f('0x9')](_0x2843b2,_0x3f1920)[_0xd86f('0xa')](function(_0x1205ae){logger['info'](_0xd86f('0xb'),_0x500cb8,_0xd86f('0xc'));logger[_0xd86f('0xd')]('FreshsalesConfiguration,\x20%s,\x20%s,\x20%s',_0x500cb8,'request\x20sent',JSON['stringify'](_0x1205ae));if(_0x1205ae['error']){if(_0x1205ae[_0xd86f('0xe')][_0xd86f('0xf')]===0x1f4){logger[_0xd86f('0xe')](_0xd86f('0xb'),_0x500cb8,_0x1205ae['error']['message']);return _0x2b4117(_0x1205ae[_0xd86f('0xe')][_0xd86f('0x10')]);}logger[_0xd86f('0xe')](_0xd86f('0xb'),_0x500cb8,_0x1205ae[_0xd86f('0xe')]['message']);return _0x4cd46e(_0x1205ae['error']['message']);}else{logger[_0xd86f('0x11')](_0xd86f('0xb'),_0x500cb8,_0xd86f('0xc'));_0x4cd46e(_0x1205ae[_0xd86f('0x12')][_0xd86f('0x10')]);}})[_0xd86f('0x13')](function(_0x5cd7c9){logger[_0xd86f('0xe')]('FreshsalesConfiguration,\x20%s,\x20%s',_0x500cb8,_0x5cd7c9);_0x2b4117(_0x5cd7c9);});});}
\ No newline at end of file
diff --git a/server/api/intFreshsalesField/index.js b/server/api/intFreshsalesField/index.js
index 5307909..ec9bb2d 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 _0xe38a=['isAuthenticated','/:id','create','put','update','delete','destroy','exports','util','path','connect-timeout','express','Router','../../components/auth/service','../../components/interaction/service','./intFreshsalesField.controller','get'];(function(_0xb9496b,_0x574ec5){var _0xcafc78=function(_0x27cbf5){while(--_0x27cbf5){_0xb9496b['push'](_0xb9496b['shift']());}};_0xcafc78(++_0x574ec5);}(_0xe38a,0x6e));var _0xae38=function(_0x523adf,_0x3e1620){_0x523adf=_0x523adf-0x0;var _0x283870=_0xe38a[_0x523adf];return _0x283870;};'use strict';var multer=require('multer');var util=require(_0xae38('0x0'));var path=require(_0xae38('0x1'));var timeout=require(_0xae38('0x2'));var express=require(_0xae38('0x3'));var router=express[_0xae38('0x4')]();var auth=require(_0xae38('0x5'));var interaction=require(_0xae38('0x6'));var config=require('../../config/environment');var controller=require(_0xae38('0x7'));router[_0xae38('0x8')]('/',auth[_0xae38('0x9')](),controller['index']);router['get'](_0xae38('0xa'),auth[_0xae38('0x9')](),controller['show']);router['post']('/',auth[_0xae38('0x9')](),controller[_0xae38('0xb')]);router[_0xae38('0xc')](_0xae38('0xa'),auth[_0xae38('0x9')](),controller[_0xae38('0xd')]);router[_0xae38('0xe')]('/:id',auth[_0xae38('0x9')](),controller[_0xae38('0xf')]);module[_0xae38('0x10')]=router;
\ No newline at end of file
+var _0x3fd7=['multer','util','path','connect-timeout','Router','../../components/auth/service','../../components/interaction/service','../../config/environment','./intFreshsalesField.controller','get','isAuthenticated','index','/:id','show','post','create','put','update','destroy','exports'];(function(_0x3dd15e,_0x1f0015){var _0x231fd0=function(_0x4f680a){while(--_0x4f680a){_0x3dd15e['push'](_0x3dd15e['shift']());}};_0x231fd0(++_0x1f0015);}(_0x3fd7,0x78));var _0x73fd=function(_0x89f538,_0x1a05d0){_0x89f538=_0x89f538-0x0;var _0x5792f6=_0x3fd7[_0x89f538];return _0x5792f6;};'use strict';var multer=require(_0x73fd('0x0'));var util=require(_0x73fd('0x1'));var path=require(_0x73fd('0x2'));var timeout=require(_0x73fd('0x3'));var express=require('express');var router=express[_0x73fd('0x4')]();var auth=require(_0x73fd('0x5'));var interaction=require(_0x73fd('0x6'));var config=require(_0x73fd('0x7'));var controller=require(_0x73fd('0x8'));router[_0x73fd('0x9')]('/',auth[_0x73fd('0xa')](),controller[_0x73fd('0xb')]);router[_0x73fd('0x9')](_0x73fd('0xc'),auth[_0x73fd('0xa')](),controller[_0x73fd('0xd')]);router[_0x73fd('0xe')]('/',auth['isAuthenticated'](),controller[_0x73fd('0xf')]);router[_0x73fd('0x10')](_0x73fd('0xc'),auth['isAuthenticated'](),controller[_0x73fd('0x11')]);router['delete'](_0x73fd('0xc'),auth['isAuthenticated'](),controller[_0x73fd('0x12')]);module[_0x73fd('0x13')]=router;
\ No newline at end of file
diff --git a/server/api/intFreshsalesField/intFreshsalesField.attributes.js b/server/api/intFreshsalesField/intFreshsalesField.attributes.js
index 298d15d..4762129 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 _0xcdc8=['BOOLEAN','exports','string','customVariable','keyValue','STRING','ENUM','variable'];(function(_0x14add3,_0x13ce8d){var _0x4a174f=function(_0x2b3ed7){while(--_0x2b3ed7){_0x14add3['push'](_0x14add3['shift']());}};_0x4a174f(++_0x13ce8d);}(_0xcdc8,0x1a9));var _0x8cdc=function(_0x1e7b16,_0x4607a1){_0x1e7b16=_0x1e7b16-0x0;var _0x37fadc=_0xcdc8[_0x1e7b16];return _0x37fadc;};'use strict';var Sequelize=require('sequelize');module[_0x8cdc('0x0')]={'type':{'type':Sequelize['ENUM'](_0x8cdc('0x1'),'variable',_0x8cdc('0x2'),_0x8cdc('0x3')),'defaultValue':_0x8cdc('0x1')},'content':{'type':Sequelize['STRING']},'key':{'type':Sequelize[_0x8cdc('0x4')]},'keyType':{'type':Sequelize[_0x8cdc('0x5')](_0x8cdc('0x1'),_0x8cdc('0x6'),_0x8cdc('0x2'))},'keyContent':{'type':Sequelize[_0x8cdc('0x4')]},'idField':{'type':Sequelize['STRING']},'nameField':{'type':Sequelize[_0x8cdc('0x4')]},'customField':{'type':Sequelize[_0x8cdc('0x7')],'defaultValue':!![]},'variableName':{'type':Sequelize[_0x8cdc('0x4')]}};
\ No newline at end of file
+var _0x4ac0=['customVariable','keyValue','string','STRING','sequelize','variable'];(function(_0x1043ea,_0x22d2bb){var _0x3b9cf6=function(_0x418b04){while(--_0x418b04){_0x1043ea['push'](_0x1043ea['shift']());}};_0x3b9cf6(++_0x22d2bb);}(_0x4ac0,0xa0));var _0x04ac=function(_0x397e5f,_0x454c8f){_0x397e5f=_0x397e5f-0x0;var _0x5302b8=_0x4ac0[_0x397e5f];return _0x5302b8;};'use strict';var Sequelize=require(_0x04ac('0x0'));module['exports']={'type':{'type':Sequelize['ENUM']('string',_0x04ac('0x1'),_0x04ac('0x2'),_0x04ac('0x3')),'defaultValue':_0x04ac('0x4')},'content':{'type':Sequelize[_0x04ac('0x5')]},'key':{'type':Sequelize[_0x04ac('0x5')]},'keyType':{'type':Sequelize['ENUM'](_0x04ac('0x4'),'variable',_0x04ac('0x2'))},'keyContent':{'type':Sequelize['STRING']},'idField':{'type':Sequelize[_0x04ac('0x5')]},'nameField':{'type':Sequelize[_0x04ac('0x5')]},'customField':{'type':Sequelize['BOOLEAN'],'defaultValue':!![]},'variableName':{'type':Sequelize[_0x04ac('0x5')]}};
\ No newline at end of file
diff --git a/server/api/intFreshsalesField/intFreshsalesField.controller.js b/server/api/intFreshsalesField/intFreshsalesField.controller.js
index 0d3d3db..4000910 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 _0x74f0=['count','offset','limit','set','Content-Range','apply','save','update','then','destroy','end','name','send','FreshsalesField','rawAttributes','type','map','query','keys','filters','model','attributes','fields','length','hasOwnProperty','nolimit','order','sort','where','filter','merge','options','findAll','rows','show','params','includeAll','include','find','create','body','catch','eml-format','fast-json-patch','request-promise','moment','bluebird','path','sox','to-csv','ejs','lodash','squel','crypto','desk.js','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','api','../../config/utils','../../config/environment','../../mysqldb','sendStatus','status','json'];(function(_0x515744,_0x9236fd){var _0x70e90f=function(_0x2b267c){while(--_0x2b267c){_0x515744['push'](_0x515744['shift']());}};_0x70e90f(++_0x9236fd);}(_0x74f0,0xf3));var _0x074f=function(_0x16f77c,_0x5256b1){_0x16f77c=_0x16f77c-0x0;var _0x78986e=_0x74f0[_0x16f77c];return _0x78986e;};'use strict';var pdf=require('html-pdf');var emlformat=require(_0x074f('0x0'));var rimraf=require('rimraf');var zipdir=require('zip-dir');var jsonpatch=require(_0x074f('0x1'));var rp=require(_0x074f('0x2'));var moment=require(_0x074f('0x3'));var BPromise=require(_0x074f('0x4'));var Mustache=require('mustache');var util=require('util');var path=require(_0x074f('0x5'));var sox=require(_0x074f('0x6'));var csv=require(_0x074f('0x7'));var ejs=require(_0x074f('0x8'));var fs=require('fs');var _=require(_0x074f('0x9'));var squel=require(_0x074f('0xa'));var crypto=require(_0x074f('0xb'));var jsforce=require('jsforce');var deskjs=require(_0x074f('0xc'));var toCsv=require(_0x074f('0x7'));var querystring=require('querystring');var Papa=require(_0x074f('0xd'));var Redis=require(_0x074f('0xe'));var authService=require(_0x074f('0xf'));var qs=require(_0x074f('0x10'));var as=require(_0x074f('0x11'));var hardwareService=require('../../config/license/hardware');var logger=require('../../config/logger')(_0x074f('0x12'));var utils=require(_0x074f('0x13'));var config=require(_0x074f('0x14'));var db=require(_0x074f('0x15'))['db'];function respondWithStatusCode(_0x148da,_0x2416e0){_0x2416e0=_0x2416e0||0xcc;return function(_0x1d3304){if(_0x1d3304){return _0x148da[_0x074f('0x16')](_0x2416e0);}return _0x148da[_0x074f('0x17')](_0x2416e0)['end']();};}function respondWithResult(_0x159692,_0x59f78a){_0x59f78a=_0x59f78a||0xc8;return function(_0x12ed92){if(_0x12ed92){return _0x159692[_0x074f('0x17')](_0x59f78a)[_0x074f('0x18')](_0x12ed92);}};}function respondWithFilteredResult(_0x14ffd4,_0x2d7c55){return function(_0x237960){if(_0x237960){var _0x7e19fe=_0x237960[_0x074f('0x19')],_0x1edf9c=_0x2d7c55['offset'],_0x3f1a47=_0x2d7c55[_0x074f('0x1a')]+_0x2d7c55[_0x074f('0x1b')],_0x428987;if(_0x3f1a47>=_0x7e19fe){_0x3f1a47=_0x7e19fe;_0x428987=0xc8;}else{_0x428987=0xce;}_0x14ffd4[_0x074f('0x17')](_0x428987);return _0x14ffd4[_0x074f('0x1c')](_0x074f('0x1d'),_0x1edf9c+'-'+_0x3f1a47+'/'+_0x7e19fe)[_0x074f('0x18')](_0x237960);}return null;};}function patchUpdates(_0x548aab){return function(_0x568a50){try{jsonpatch[_0x074f('0x1e')](_0x568a50,_0x548aab,!![]);}catch(_0x5d8c10){return BPromise['reject'](_0x5d8c10);}return _0x568a50[_0x074f('0x1f')]();};}function saveUpdates(_0x288569,_0x1563f3){return function(_0x5feafd){if(_0x5feafd){return _0x5feafd[_0x074f('0x20')](_0x288569)[_0x074f('0x21')](function(_0x23406f){return _0x23406f;});}return null;};}function removeEntity(_0x3ecb4b,_0x1acf0a){return function(_0x2c3b23){if(_0x2c3b23){return _0x2c3b23[_0x074f('0x22')]()[_0x074f('0x21')](function(){_0x3ecb4b[_0x074f('0x17')](0xcc)[_0x074f('0x23')]();});}};}function handleEntityNotFound(_0x39e502,_0x1bd2c7){return function(_0xdfa2d8){if(!_0xdfa2d8){_0x39e502[_0x074f('0x16')](0x194);}return _0xdfa2d8;};}function handleError(_0x440d23,_0x8b8e98){_0x8b8e98=_0x8b8e98||0x1f4;return function(_0x5672ef){logger['error'](_0x5672ef['stack']);if(_0x5672ef[_0x074f('0x24')]){delete _0x5672ef[_0x074f('0x24')];}_0x440d23[_0x074f('0x17')](_0x8b8e98)[_0x074f('0x25')](_0x5672ef);};}exports['index']=function(_0x21cec2,_0x339370){var _0x3fb202={},_0x312119={},_0x470acc={'count':0x0,'rows':[]};var _0xb9722a=_['map'](db[_0x074f('0x26')][_0x074f('0x27')],function(_0x2b98d7){return{'name':_0x2b98d7['fieldName'],'type':_0x2b98d7[_0x074f('0x28')]['key']};});_0x312119['model']=_[_0x074f('0x29')](_0xb9722a,'name');_0x312119[_0x074f('0x2a')]=_[_0x074f('0x2b')](_0x21cec2[_0x074f('0x2a')]);_0x312119[_0x074f('0x2c')]=_['intersection'](_0x312119[_0x074f('0x2d')],_0x312119[_0x074f('0x2a')]);_0x3fb202[_0x074f('0x2e')]=_['intersection'](_0x312119[_0x074f('0x2d')],qs[_0x074f('0x2f')](_0x21cec2[_0x074f('0x2a')][_0x074f('0x2f')]));_0x3fb202[_0x074f('0x2e')]=_0x3fb202['attributes'][_0x074f('0x30')]?_0x3fb202[_0x074f('0x2e')]:_0x312119['model'];if(!_0x21cec2[_0x074f('0x2a')][_0x074f('0x31')](_0x074f('0x32'))){_0x3fb202['limit']=qs[_0x074f('0x1b')](_0x21cec2[_0x074f('0x2a')]['limit']);_0x3fb202[_0x074f('0x1a')]=qs[_0x074f('0x1a')](_0x21cec2[_0x074f('0x2a')][_0x074f('0x1a')]);}_0x3fb202[_0x074f('0x33')]=qs[_0x074f('0x34')](_0x21cec2[_0x074f('0x2a')][_0x074f('0x34')]);_0x3fb202[_0x074f('0x35')]=qs[_0x074f('0x2c')](_['pick'](_0x21cec2[_0x074f('0x2a')],_0x312119[_0x074f('0x2c')]));if(_0x21cec2['query'][_0x074f('0x36')]){_0x3fb202[_0x074f('0x35')]=_[_0x074f('0x37')](_0x3fb202[_0x074f('0x35')],{'$or':_[_0x074f('0x29')](_0xb9722a,function(_0x380c0e){if(_0x380c0e[_0x074f('0x28')]!=='VIRTUAL'){var _0x3f850c={};_0x3f850c[_0x380c0e[_0x074f('0x24')]]={'$like':'%'+_0x21cec2[_0x074f('0x2a')][_0x074f('0x36')]+'%'};return _0x3f850c;}})});}_0x3fb202=_[_0x074f('0x37')]({},_0x3fb202,_0x21cec2[_0x074f('0x38')]);var _0x567a2a={'where':_0x3fb202[_0x074f('0x35')]};return db[_0x074f('0x26')]['count'](_0x567a2a)[_0x074f('0x21')](function(_0x41b1f2){_0x470acc[_0x074f('0x19')]=_0x41b1f2;if(_0x21cec2['query']['includeAll']){_0x3fb202['include']=[{'all':!![]}];}return db[_0x074f('0x26')][_0x074f('0x39')](_0x3fb202);})[_0x074f('0x21')](function(_0x5b9a17){_0x470acc[_0x074f('0x3a')]=_0x5b9a17;return _0x470acc;})[_0x074f('0x21')](respondWithFilteredResult(_0x339370,_0x3fb202))['catch'](handleError(_0x339370,null));};exports[_0x074f('0x3b')]=function(_0x3aad9a,_0x14f3be){var _0x46ca91={'raw':!![],'where':{'id':_0x3aad9a[_0x074f('0x3c')]['id']}},_0x3a6e10={};_0x3a6e10[_0x074f('0x2d')]=_[_0x074f('0x2b')](db[_0x074f('0x26')][_0x074f('0x27')]);_0x3a6e10['query']=_[_0x074f('0x2b')](_0x3aad9a['query']);_0x3a6e10[_0x074f('0x2c')]=_['intersection'](_0x3a6e10[_0x074f('0x2d')],_0x3a6e10['query']);_0x46ca91[_0x074f('0x2e')]=_['intersection'](_0x3a6e10[_0x074f('0x2d')],qs[_0x074f('0x2f')](_0x3aad9a[_0x074f('0x2a')][_0x074f('0x2f')]));_0x46ca91[_0x074f('0x2e')]=_0x46ca91[_0x074f('0x2e')][_0x074f('0x30')]?_0x46ca91['attributes']:_0x3a6e10[_0x074f('0x2d')];if(_0x3aad9a[_0x074f('0x2a')][_0x074f('0x3d')]){_0x46ca91[_0x074f('0x3e')]=[{'all':!![]}];}_0x46ca91=_['merge']({},_0x46ca91,_0x3aad9a[_0x074f('0x38')]);return db['FreshsalesField'][_0x074f('0x3f')](_0x46ca91)[_0x074f('0x21')](handleEntityNotFound(_0x14f3be,null))[_0x074f('0x21')](respondWithResult(_0x14f3be,null))['catch'](handleError(_0x14f3be,null));};exports[_0x074f('0x40')]=function(_0x53b6fc,_0x3316ed){return db[_0x074f('0x26')]['create'](_0x53b6fc[_0x074f('0x41')],{})['then'](respondWithResult(_0x3316ed,0xc9))[_0x074f('0x42')](handleError(_0x3316ed,null));};exports[_0x074f('0x20')]=function(_0x598fee,_0x57c89f){if(_0x598fee['body']['id']){delete _0x598fee['body']['id'];}return db[_0x074f('0x26')][_0x074f('0x3f')]({'where':{'id':_0x598fee[_0x074f('0x3c')]['id']}})[_0x074f('0x21')](handleEntityNotFound(_0x57c89f,null))['then'](saveUpdates(_0x598fee[_0x074f('0x41')],null))[_0x074f('0x21')](respondWithResult(_0x57c89f,null))[_0x074f('0x42')](handleError(_0x57c89f,null));};exports[_0x074f('0x22')]=function(_0xb66ad7,_0x42ab64){return db[_0x074f('0x26')][_0x074f('0x3f')]({'where':{'id':_0xb66ad7['params']['id']}})[_0x074f('0x21')](handleEntityNotFound(_0x42ab64,null))[_0x074f('0x21')](removeEntity(_0x42ab64,null))[_0x074f('0x42')](handleError(_0x42ab64,null));};
\ No newline at end of file
+var _0xa25c=['../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/environment','../../mysqldb','sendStatus','end','status','json','count','offset','limit','set','Content-Range','apply','reject','update','then','destroy','error','name','send','index','map','FreshsalesField','rawAttributes','fieldName','type','key','model','query','keys','intersection','fields','attributes','length','hasOwnProperty','order','sort','where','filters','merge','VIRTUAL','includeAll','rows','catch','show','params','find','create','body','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','moment','bluebird','mustache','path','ejs','squel','crypto','jsforce','desk.js','to-csv','ioredis'];(function(_0x3e182f,_0x380ec7){var _0x23edc9=function(_0x3ca65e){while(--_0x3ca65e){_0x3e182f['push'](_0x3e182f['shift']());}};_0x23edc9(++_0x380ec7);}(_0xa25c,0x13f));var _0xca25=function(_0x37a61a,_0x522a83){_0x37a61a=_0x37a61a-0x0;var _0x320494=_0xa25c[_0x37a61a];return _0x320494;};'use strict';var pdf=require('html-pdf');var emlformat=require(_0xca25('0x0'));var rimraf=require(_0xca25('0x1'));var zipdir=require(_0xca25('0x2'));var jsonpatch=require(_0xca25('0x3'));var rp=require(_0xca25('0x4'));var moment=require(_0xca25('0x5'));var BPromise=require(_0xca25('0x6'));var Mustache=require(_0xca25('0x7'));var util=require('util');var path=require(_0xca25('0x8'));var sox=require('sox');var csv=require('to-csv');var ejs=require(_0xca25('0x9'));var fs=require('fs');var _=require('lodash');var squel=require(_0xca25('0xa'));var crypto=require(_0xca25('0xb'));var jsforce=require(_0xca25('0xc'));var deskjs=require(_0xca25('0xd'));var toCsv=require(_0xca25('0xe'));var querystring=require('querystring');var Papa=require('papaparse');var Redis=require(_0xca25('0xf'));var authService=require('../../components/auth/service');var qs=require(_0xca25('0x10'));var as=require(_0xca25('0x11'));var hardwareService=require(_0xca25('0x12'));var logger=require('../../config/logger')('api');var utils=require('../../config/utils');var config=require(_0xca25('0x13'));var db=require(_0xca25('0x14'))['db'];function respondWithStatusCode(_0x3ced96,_0x5697aa){_0x5697aa=_0x5697aa||0xcc;return function(_0x534bca){if(_0x534bca){return _0x3ced96[_0xca25('0x15')](_0x5697aa);}return _0x3ced96['status'](_0x5697aa)[_0xca25('0x16')]();};}function respondWithResult(_0xc5a21a,_0x35093c){_0x35093c=_0x35093c||0xc8;return function(_0x1a3207){if(_0x1a3207){return _0xc5a21a[_0xca25('0x17')](_0x35093c)[_0xca25('0x18')](_0x1a3207);}};}function respondWithFilteredResult(_0x241b80,_0x33aa25){return function(_0x2a1af3){if(_0x2a1af3){var _0x42bc1e=_0x2a1af3[_0xca25('0x19')],_0x2b5cef=_0x33aa25['offset'],_0x587403=_0x33aa25[_0xca25('0x1a')]+_0x33aa25[_0xca25('0x1b')],_0x3616c3;if(_0x587403>=_0x42bc1e){_0x587403=_0x42bc1e;_0x3616c3=0xc8;}else{_0x3616c3=0xce;}_0x241b80[_0xca25('0x17')](_0x3616c3);return _0x241b80[_0xca25('0x1c')](_0xca25('0x1d'),_0x2b5cef+'-'+_0x587403+'/'+_0x42bc1e)['json'](_0x2a1af3);}return null;};}function patchUpdates(_0x11d7f4){return function(_0x47a74b){try{jsonpatch[_0xca25('0x1e')](_0x47a74b,_0x11d7f4,!![]);}catch(_0x1cf09c){return BPromise[_0xca25('0x1f')](_0x1cf09c);}return _0x47a74b['save']();};}function saveUpdates(_0x2b6ec6,_0x3598c7){return function(_0x235d92){if(_0x235d92){return _0x235d92[_0xca25('0x20')](_0x2b6ec6)[_0xca25('0x21')](function(_0x38d6e6){return _0x38d6e6;});}return null;};}function removeEntity(_0x292c88,_0x54c91a){return function(_0x48fdf5){if(_0x48fdf5){return _0x48fdf5[_0xca25('0x22')]()[_0xca25('0x21')](function(){_0x292c88[_0xca25('0x17')](0xcc)[_0xca25('0x16')]();});}};}function handleEntityNotFound(_0x2615d4,_0x40e5e2){return function(_0x8cec43){if(!_0x8cec43){_0x2615d4[_0xca25('0x15')](0x194);}return _0x8cec43;};}function handleError(_0x2f1f2a,_0x349364){_0x349364=_0x349364||0x1f4;return function(_0x365ba4){logger[_0xca25('0x23')](_0x365ba4['stack']);if(_0x365ba4[_0xca25('0x24')]){delete _0x365ba4[_0xca25('0x24')];}_0x2f1f2a[_0xca25('0x17')](_0x349364)[_0xca25('0x25')](_0x365ba4);};}exports[_0xca25('0x26')]=function(_0x5d60f9,_0x274de1){var _0x41eb3a={},_0x3d7414={},_0xd61524={'count':0x0,'rows':[]};var _0x2ae0e3=_[_0xca25('0x27')](db[_0xca25('0x28')][_0xca25('0x29')],function(_0x3e72cb){return{'name':_0x3e72cb[_0xca25('0x2a')],'type':_0x3e72cb[_0xca25('0x2b')][_0xca25('0x2c')]};});_0x3d7414[_0xca25('0x2d')]=_[_0xca25('0x27')](_0x2ae0e3,_0xca25('0x24'));_0x3d7414[_0xca25('0x2e')]=_[_0xca25('0x2f')](_0x5d60f9[_0xca25('0x2e')]);_0x3d7414['filters']=_[_0xca25('0x30')](_0x3d7414[_0xca25('0x2d')],_0x3d7414[_0xca25('0x2e')]);_0x41eb3a['attributes']=_[_0xca25('0x30')](_0x3d7414[_0xca25('0x2d')],qs[_0xca25('0x31')](_0x5d60f9[_0xca25('0x2e')][_0xca25('0x31')]));_0x41eb3a[_0xca25('0x32')]=_0x41eb3a['attributes'][_0xca25('0x33')]?_0x41eb3a['attributes']:_0x3d7414[_0xca25('0x2d')];if(!_0x5d60f9[_0xca25('0x2e')][_0xca25('0x34')]('nolimit')){_0x41eb3a[_0xca25('0x1b')]=qs[_0xca25('0x1b')](_0x5d60f9[_0xca25('0x2e')][_0xca25('0x1b')]);_0x41eb3a[_0xca25('0x1a')]=qs['offset'](_0x5d60f9[_0xca25('0x2e')][_0xca25('0x1a')]);}_0x41eb3a[_0xca25('0x35')]=qs[_0xca25('0x36')](_0x5d60f9[_0xca25('0x2e')][_0xca25('0x36')]);_0x41eb3a[_0xca25('0x37')]=qs['filters'](_['pick'](_0x5d60f9[_0xca25('0x2e')],_0x3d7414[_0xca25('0x38')]));if(_0x5d60f9['query']['filter']){_0x41eb3a[_0xca25('0x37')]=_[_0xca25('0x39')](_0x41eb3a[_0xca25('0x37')],{'$or':_['map'](_0x2ae0e3,function(_0x9c1ce3){if(_0x9c1ce3[_0xca25('0x2b')]!==_0xca25('0x3a')){var _0x1dc9ca={};_0x1dc9ca[_0x9c1ce3[_0xca25('0x24')]]={'$like':'%'+_0x5d60f9[_0xca25('0x2e')]['filter']+'%'};return _0x1dc9ca;}})});}_0x41eb3a=_[_0xca25('0x39')]({},_0x41eb3a,_0x5d60f9['options']);var _0x4b1460={'where':_0x41eb3a[_0xca25('0x37')]};return db[_0xca25('0x28')][_0xca25('0x19')](_0x4b1460)[_0xca25('0x21')](function(_0xe41645){_0xd61524[_0xca25('0x19')]=_0xe41645;if(_0x5d60f9[_0xca25('0x2e')][_0xca25('0x3b')]){_0x41eb3a['include']=[{'all':!![]}];}return db[_0xca25('0x28')]['findAll'](_0x41eb3a);})[_0xca25('0x21')](function(_0x4a5c10){_0xd61524[_0xca25('0x3c')]=_0x4a5c10;return _0xd61524;})[_0xca25('0x21')](respondWithFilteredResult(_0x274de1,_0x41eb3a))[_0xca25('0x3d')](handleError(_0x274de1,null));};exports[_0xca25('0x3e')]=function(_0x5c5adb,_0x422ba6){var _0x5aafa5={'raw':!![],'where':{'id':_0x5c5adb[_0xca25('0x3f')]['id']}},_0x275e3d={};_0x275e3d['model']=_[_0xca25('0x2f')](db[_0xca25('0x28')][_0xca25('0x29')]);_0x275e3d[_0xca25('0x2e')]=_[_0xca25('0x2f')](_0x5c5adb[_0xca25('0x2e')]);_0x275e3d[_0xca25('0x38')]=_['intersection'](_0x275e3d[_0xca25('0x2d')],_0x275e3d[_0xca25('0x2e')]);_0x5aafa5['attributes']=_['intersection'](_0x275e3d['model'],qs['fields'](_0x5c5adb[_0xca25('0x2e')][_0xca25('0x31')]));_0x5aafa5[_0xca25('0x32')]=_0x5aafa5[_0xca25('0x32')]['length']?_0x5aafa5[_0xca25('0x32')]:_0x275e3d[_0xca25('0x2d')];if(_0x5c5adb[_0xca25('0x2e')][_0xca25('0x3b')]){_0x5aafa5['include']=[{'all':!![]}];}_0x5aafa5=_[_0xca25('0x39')]({},_0x5aafa5,_0x5c5adb['options']);return db[_0xca25('0x28')][_0xca25('0x40')](_0x5aafa5)[_0xca25('0x21')](handleEntityNotFound(_0x422ba6,null))[_0xca25('0x21')](respondWithResult(_0x422ba6,null))[_0xca25('0x3d')](handleError(_0x422ba6,null));};exports[_0xca25('0x41')]=function(_0x5978f4,_0x19b077){return db[_0xca25('0x28')][_0xca25('0x41')](_0x5978f4[_0xca25('0x42')],{})[_0xca25('0x21')](respondWithResult(_0x19b077,0xc9))[_0xca25('0x3d')](handleError(_0x19b077,null));};exports[_0xca25('0x20')]=function(_0x352a17,_0x3ba55c){if(_0x352a17[_0xca25('0x42')]['id']){delete _0x352a17[_0xca25('0x42')]['id'];}return db[_0xca25('0x28')][_0xca25('0x40')]({'where':{'id':_0x352a17[_0xca25('0x3f')]['id']}})[_0xca25('0x21')](handleEntityNotFound(_0x3ba55c,null))[_0xca25('0x21')](saveUpdates(_0x352a17[_0xca25('0x42')],null))[_0xca25('0x21')](respondWithResult(_0x3ba55c,null))['catch'](handleError(_0x3ba55c,null));};exports[_0xca25('0x22')]=function(_0x39d342,_0x9fcba){return db[_0xca25('0x28')]['find']({'where':{'id':_0x39d342[_0xca25('0x3f')]['id']}})[_0xca25('0x21')](handleEntityNotFound(_0x9fcba,null))['then'](removeEntity(_0x9fcba,null))[_0xca25('0x3d')](handleError(_0x9fcba,null));};
\ No newline at end of file
diff --git a/server/api/intFreshsalesField/intFreshsalesField.model.js b/server/api/intFreshsalesField/intFreshsalesField.model.js
index fcdb4e9..1cd848e 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 _0x5bf2=['int_freshsales_fields','freshsales_unique_index','idField','FieldId','lodash','../../config/logger','api','moment','bluebird','request-promise','path','rimraf','./intFreshsalesField.attributes','exports','define'];(function(_0xfbdff6,_0x2af690){var _0x4cb9be=function(_0x4022d8){while(--_0x4022d8){_0xfbdff6['push'](_0xfbdff6['shift']());}};_0x4cb9be(++_0x2af690);}(_0x5bf2,0x1e4));var _0x25bf=function(_0x11f784,_0x83773b){_0x11f784=_0x11f784-0x0;var _0x402564=_0x5bf2[_0x11f784];return _0x402564;};'use strict';var _=require(_0x25bf('0x0'));var util=require('util');var logger=require(_0x25bf('0x1'))(_0x25bf('0x2'));var moment=require(_0x25bf('0x3'));var BPromise=require(_0x25bf('0x4'));var rp=require(_0x25bf('0x5'));var fs=require('fs');var path=require(_0x25bf('0x6'));var rimraf=require(_0x25bf('0x7'));var config=require('../../config/environment');var attributes=require(_0x25bf('0x8'));module[_0x25bf('0x9')]=function(_0x5aae5d,_0x4d6a58){return _0x5aae5d[_0x25bf('0xa')]('FreshsalesField',attributes,{'tableName':_0x25bf('0xb'),'paranoid':![],'indexes':[{'name':_0x25bf('0xc'),'fields':[_0x25bf('0xd'),_0x25bf('0xe')],'unique':!![]}],'timestamps':!![]});};
\ No newline at end of file
+var _0xbd3c=['path','rimraf','../../config/environment','exports','FreshsalesField','int_freshsales_fields','idField','FieldId','util','../../config/logger','api','moment','bluebird','request-promise'];(function(_0x2e51e7,_0x5a8213){var _0x2f1675=function(_0x562181){while(--_0x562181){_0x2e51e7['push'](_0x2e51e7['shift']());}};_0x2f1675(++_0x5a8213);}(_0xbd3c,0x166));var _0xcbd3=function(_0x427c69,_0x292d18){_0x427c69=_0x427c69-0x0;var _0x21b2a6=_0xbd3c[_0x427c69];return _0x21b2a6;};'use strict';var _=require('lodash');var util=require(_0xcbd3('0x0'));var logger=require(_0xcbd3('0x1'))(_0xcbd3('0x2'));var moment=require(_0xcbd3('0x3'));var BPromise=require(_0xcbd3('0x4'));var rp=require(_0xcbd3('0x5'));var fs=require('fs');var path=require(_0xcbd3('0x6'));var rimraf=require(_0xcbd3('0x7'));var config=require(_0xcbd3('0x8'));var attributes=require('./intFreshsalesField.attributes');module[_0xcbd3('0x9')]=function(_0x143493,_0x11bcab){return _0x143493['define'](_0xcbd3('0xa'),attributes,{'tableName':_0xcbd3('0xb'),'paranoid':![],'indexes':[{'name':'freshsales_unique_index','fields':[_0xcbd3('0xc'),_0xcbd3('0xd')],'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 fd1b659..d7dd461 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 _0xb697=['message','result','catch','lodash','util','randomstring','../../config/logger','rpc','../../config/environment','jayson/promise','client','http','request','then','info','FreshsalesField,\x20%s,\x20%s','request\x20sent','debug','stringify','error'];(function(_0x5799c7,_0x148769){var _0x3b5a17=function(_0x458250){while(--_0x458250){_0x5799c7['push'](_0x5799c7['shift']());}};_0x3b5a17(++_0x148769);}(_0xb697,0xcb));var _0x7b69=function(_0x13dd60,_0x2e9782){_0x13dd60=_0x13dd60-0x0;var _0x4e0126=_0xb697[_0x13dd60];return _0x4e0126;};'use strict';var _=require(_0x7b69('0x0'));var util=require(_0x7b69('0x1'));var moment=require('moment');var BPromise=require('bluebird');var rs=require(_0x7b69('0x2'));var fs=require('fs');var Redis=require('ioredis');var db=require('../../mysqldb')['db'];var utils=require('../../config/utils');var logger=require(_0x7b69('0x3'))(_0x7b69('0x4'));var config=require(_0x7b69('0x5'));var jayson=require(_0x7b69('0x6'));var client=jayson[_0x7b69('0x7')][_0x7b69('0x8')]({'port':0x232a});function respondWithRpcPromise(_0x6364a5,_0x2c530b,_0xd7615b){return new BPromise(function(_0xb17e9f,_0x380e7e){return client[_0x7b69('0x9')](_0x6364a5,_0xd7615b)[_0x7b69('0xa')](function(_0x517f53){logger[_0x7b69('0xb')](_0x7b69('0xc'),_0x2c530b,_0x7b69('0xd'));logger[_0x7b69('0xe')]('FreshsalesField,\x20%s,\x20%s,\x20%s',_0x2c530b,'request\x20sent',JSON[_0x7b69('0xf')](_0x517f53));if(_0x517f53['error']){if(_0x517f53[_0x7b69('0x10')]['code']===0x1f4){logger[_0x7b69('0x10')](_0x7b69('0xc'),_0x2c530b,_0x517f53['error'][_0x7b69('0x11')]);return _0x380e7e(_0x517f53[_0x7b69('0x10')][_0x7b69('0x11')]);}logger[_0x7b69('0x10')](_0x7b69('0xc'),_0x2c530b,_0x517f53[_0x7b69('0x10')][_0x7b69('0x11')]);return _0xb17e9f(_0x517f53[_0x7b69('0x10')]['message']);}else{logger[_0x7b69('0xb')](_0x7b69('0xc'),_0x2c530b,_0x7b69('0xd'));_0xb17e9f(_0x517f53[_0x7b69('0x12')][_0x7b69('0x11')]);}})[_0x7b69('0x13')](function(_0x2f3885){logger['error'](_0x7b69('0xc'),_0x2c530b,_0x2f3885);_0x380e7e(_0x2f3885);});});}
\ No newline at end of file
+var _0x030a=['util','moment','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','jayson/promise','client','request','then','info','FreshsalesField,\x20%s,\x20%s','request\x20sent','debug','stringify','error','message','result','catch','lodash'];(function(_0x54da5c,_0x58832f){var _0x3301ba=function(_0x3ca43b){while(--_0x3ca43b){_0x54da5c['push'](_0x54da5c['shift']());}};_0x3301ba(++_0x58832f);}(_0x030a,0xdb));var _0xa030=function(_0x4cdbb2,_0x7c8b5a){_0x4cdbb2=_0x4cdbb2-0x0;var _0x2f6dba=_0x030a[_0x4cdbb2];return _0x2f6dba;};'use strict';var _=require(_0xa030('0x0'));var util=require(_0xa030('0x1'));var moment=require(_0xa030('0x2'));var BPromise=require('bluebird');var rs=require(_0xa030('0x3'));var fs=require('fs');var Redis=require(_0xa030('0x4'));var db=require(_0xa030('0x5'))['db'];var utils=require(_0xa030('0x6'));var logger=require(_0xa030('0x7'))(_0xa030('0x8'));var config=require('../../config/environment');var jayson=require(_0xa030('0x9'));var client=jayson[_0xa030('0xa')]['http']({'port':0x232a});function respondWithRpcPromise(_0x2bd0d4,_0x1b3151,_0x50d71d){return new BPromise(function(_0x1d58fe,_0x1f12f8){return client[_0xa030('0xb')](_0x2bd0d4,_0x50d71d)[_0xa030('0xc')](function(_0xf888f7){logger[_0xa030('0xd')](_0xa030('0xe'),_0x1b3151,_0xa030('0xf'));logger[_0xa030('0x10')]('FreshsalesField,\x20%s,\x20%s,\x20%s',_0x1b3151,'request\x20sent',JSON[_0xa030('0x11')](_0xf888f7));if(_0xf888f7[_0xa030('0x12')]){if(_0xf888f7[_0xa030('0x12')]['code']===0x1f4){logger[_0xa030('0x12')](_0xa030('0xe'),_0x1b3151,_0xf888f7[_0xa030('0x12')]['message']);return _0x1f12f8(_0xf888f7[_0xa030('0x12')][_0xa030('0x13')]);}logger[_0xa030('0x12')](_0xa030('0xe'),_0x1b3151,_0xf888f7[_0xa030('0x12')][_0xa030('0x13')]);return _0x1d58fe(_0xf888f7[_0xa030('0x12')]['message']);}else{logger[_0xa030('0xd')](_0xa030('0xe'),_0x1b3151,_0xa030('0xf'));_0x1d58fe(_0xf888f7[_0xa030('0x14')]['message']);}})[_0xa030('0x15')](function(_0x26ab51){logger[_0xa030('0x12')](_0xa030('0xe'),_0x1b3151,_0x26ab51);_0x1f12f8(_0x26ab51);});});}
\ No newline at end of file
diff --git a/server/api/intSalesforceAccount/index.js b/server/api/intSalesforceAccount/index.js
index 922f601..efb9760 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 _0xae53=['get','index','/:id','isAuthenticated','show','/:id/configurations','getConfigurations','post','create','addConfiguration','put','delete','destroy','exports','multer','path','connect-timeout','express','../../components/auth/service','../../components/interaction/service','../../config/environment','./intSalesforceAccount.controller'];(function(_0x8af47d,_0x12896d){var _0x10b6f1=function(_0x158d6f){while(--_0x158d6f){_0x8af47d['push'](_0x8af47d['shift']());}};_0x10b6f1(++_0x12896d);}(_0xae53,0x16e));var _0x3ae5=function(_0x1203f,_0x554bbc){_0x1203f=_0x1203f-0x0;var _0x365f0a=_0xae53[_0x1203f];return _0x365f0a;};'use strict';var multer=require(_0x3ae5('0x0'));var util=require('util');var path=require(_0x3ae5('0x1'));var timeout=require(_0x3ae5('0x2'));var express=require(_0x3ae5('0x3'));var router=express['Router']();var auth=require(_0x3ae5('0x4'));var interaction=require(_0x3ae5('0x5'));var config=require(_0x3ae5('0x6'));var controller=require(_0x3ae5('0x7'));router[_0x3ae5('0x8')]('/',auth['isAuthenticated'](),controller[_0x3ae5('0x9')]);router['get'](_0x3ae5('0xa'),auth[_0x3ae5('0xb')](),controller[_0x3ae5('0xc')]);router[_0x3ae5('0x8')](_0x3ae5('0xd'),auth[_0x3ae5('0xb')](),controller[_0x3ae5('0xe')]);router[_0x3ae5('0x8')]('/:id/fields',auth[_0x3ae5('0xb')](),controller['getFields']);router[_0x3ae5('0xf')]('/',auth[_0x3ae5('0xb')](),controller[_0x3ae5('0x10')]);router[_0x3ae5('0xf')](_0x3ae5('0xd'),auth['isAuthenticated'](),controller[_0x3ae5('0x11')]);router[_0x3ae5('0x12')](_0x3ae5('0xa'),auth['isAuthenticated'](),controller['update']);router[_0x3ae5('0x13')]('/:id',auth[_0x3ae5('0xb')](),controller[_0x3ae5('0x14')]);module[_0x3ae5('0x15')]=router;
\ No newline at end of file
+var _0x24e3=['delete','exports','util','connect-timeout','express','Router','../../components/auth/service','../../components/interaction/service','../../config/environment','./intSalesforceAccount.controller','get','isAuthenticated','/:id','show','/:id/configurations','/:id/fields','getFields','post','create','addConfiguration','put','update'];(function(_0x3a5f1e,_0x364ae4){var _0x4da246=function(_0x4ba957){while(--_0x4ba957){_0x3a5f1e['push'](_0x3a5f1e['shift']());}};_0x4da246(++_0x364ae4);}(_0x24e3,0x1a4));var _0x324e=function(_0x45fbef,_0x2414f3){_0x45fbef=_0x45fbef-0x0;var _0x29ea64=_0x24e3[_0x45fbef];return _0x29ea64;};'use strict';var multer=require('multer');var util=require(_0x324e('0x0'));var path=require('path');var timeout=require(_0x324e('0x1'));var express=require(_0x324e('0x2'));var router=express[_0x324e('0x3')]();var auth=require(_0x324e('0x4'));var interaction=require(_0x324e('0x5'));var config=require(_0x324e('0x6'));var controller=require(_0x324e('0x7'));router[_0x324e('0x8')]('/',auth[_0x324e('0x9')](),controller['index']);router[_0x324e('0x8')](_0x324e('0xa'),auth[_0x324e('0x9')](),controller[_0x324e('0xb')]);router[_0x324e('0x8')](_0x324e('0xc'),auth[_0x324e('0x9')](),controller['getConfigurations']);router[_0x324e('0x8')](_0x324e('0xd'),auth[_0x324e('0x9')](),controller[_0x324e('0xe')]);router[_0x324e('0xf')]('/',auth[_0x324e('0x9')](),controller[_0x324e('0x10')]);router[_0x324e('0xf')](_0x324e('0xc'),auth[_0x324e('0x9')](),controller[_0x324e('0x11')]);router[_0x324e('0x12')](_0x324e('0xa'),auth[_0x324e('0x9')](),controller[_0x324e('0x13')]);router[_0x324e('0x14')](_0x324e('0xa'),auth[_0x324e('0x9')](),controller['destroy']);module[_0x324e('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 d6253e6..586b850 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 _0x4975=['username','integrationTab','sequelize','STRING'];(function(_0x329437,_0x1de73a){var _0x3789d9=function(_0x37832e){while(--_0x37832e){_0x329437['push'](_0x329437['shift']());}};_0x3789d9(++_0x1de73a);}(_0x4975,0x86));var _0x5497=function(_0x2e4d44,_0x217e09){_0x2e4d44=_0x2e4d44-0x0;var _0xc0b9e7=_0x4975[_0x2e4d44];return _0xc0b9e7;};'use strict';var Sequelize=require(_0x5497('0x0'));module['exports']={'name':{'type':Sequelize[_0x5497('0x1')]},'description':{'type':Sequelize[_0x5497('0x1')]},'username':{'type':Sequelize[_0x5497('0x1')],'unique':_0x5497('0x2')},'remoteUri':{'type':Sequelize[_0x5497('0x1')]},'password':{'type':Sequelize[_0x5497('0x1')]},'clientId':{'type':Sequelize[_0x5497('0x1')]},'clientSecret':{'type':Sequelize[_0x5497('0x1')]},'securityToken':{'type':Sequelize[_0x5497('0x1')]},'serverUrl':{'type':Sequelize[_0x5497('0x1')]},'type':{'type':Sequelize['ENUM'](_0x5497('0x3'),'newTab'),'defaultValue':_0x5497('0x3')}};
\ No newline at end of file
+var _0x53ec=['ENUM','newTab','integrationTab','sequelize','exports','STRING','username'];(function(_0x3dd15e,_0x1f0015){var _0x231fd0=function(_0x4f680a){while(--_0x4f680a){_0x3dd15e['push'](_0x3dd15e['shift']());}};_0x231fd0(++_0x1f0015);}(_0x53ec,0x192));var _0xc53e=function(_0x593cbd,_0x141c5b){_0x593cbd=_0x593cbd-0x0;var _0x1ea4aa=_0x53ec[_0x593cbd];return _0x1ea4aa;};'use strict';var Sequelize=require(_0xc53e('0x0'));module[_0xc53e('0x1')]={'name':{'type':Sequelize[_0xc53e('0x2')]},'description':{'type':Sequelize[_0xc53e('0x2')]},'username':{'type':Sequelize[_0xc53e('0x2')],'unique':_0xc53e('0x3')},'remoteUri':{'type':Sequelize['STRING']},'password':{'type':Sequelize[_0xc53e('0x2')]},'clientId':{'type':Sequelize['STRING']},'clientSecret':{'type':Sequelize[_0xc53e('0x2')]},'securityToken':{'type':Sequelize[_0xc53e('0x2')]},'serverUrl':{'type':Sequelize['STRING']},'type':{'type':Sequelize[_0xc53e('0x4')]('integrationTab',_0xc53e('0x5')),'defaultValue':_0xc53e('0x6')}};
\ No newline at end of file
diff --git a/server/api/intSalesforceAccount/intSalesforceAccount.controller.js b/server/api/intSalesforceAccount/intSalesforceAccount.controller.js
index bb8bc1a..dd3d79e 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 _0x0295=['info','SalesforceAccount,\x20%s,\x20%s','request\x20sent','debug','SalesforceAccount,\x20%s,\x20%s,\x20%s','stringify','error','message','result','sendStatus','status','end','json','count','offset','limit','set','Content-Range','apply','reject','save','destroy','stack','name','index','rawAttributes','fieldName','type','key','model','map','query','keys','filters','intersection','fields','attributes','length','hasOwnProperty','nolimit','order','sort','where','filter','VIRTUAL','options','SalesforceAccount','includeAll','include','findAll','rows','catch','show','params','merge','find','create','body','getConfigurations','addConfiguration','findOne','AccountId','Subjects','getSubjects','channel','Descriptions','SalesforceConfiguration','SalesforceField','getFields','clientId','clientSecret','username','securityToken','remoteUri','substring','lastIndexOf','Connection','password','concat','isNil','ticketType','sobject','describe','CallDisposition','CallObject','CallType','IsArchived','Priority','Status','Case','IsEscalated','SuppliedName','SuppliedCompany','custom','label','picklistValues','value','True','False','false','getFields,\x20%s,\x20%s,\x20%s','Wrong\x20credentials','statusCode','html-pdf','zip-dir','moment','bluebird','mustache','util','path','sox','to-csv','ejs','lodash','desk.js','querystring','ioredis','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','api','../../config/utils','../../config/environment','../../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'];(function(_0x33f95e,_0x22c0cb){var _0x5a940f=function(_0x1a00cb){while(--_0x1a00cb){_0x33f95e['push'](_0x33f95e['shift']());}};_0x5a940f(++_0x22c0cb);}(_0x0295,0x1f0));var _0x5029=function(_0xe1b102,_0x542a72){_0xe1b102=_0xe1b102-0x0;var _0xed6dcc=_0x0295[_0xe1b102];return _0xed6dcc;};'use strict';var pdf=require(_0x5029('0x0'));var emlformat=require('eml-format');var rimraf=require('rimraf');var zipdir=require(_0x5029('0x1'));var jsonpatch=require('fast-json-patch');var rp=require('request-promise');var moment=require(_0x5029('0x2'));var BPromise=require(_0x5029('0x3'));var Mustache=require(_0x5029('0x4'));var util=require(_0x5029('0x5'));var path=require(_0x5029('0x6'));var sox=require(_0x5029('0x7'));var csv=require(_0x5029('0x8'));var ejs=require(_0x5029('0x9'));var fs=require('fs');var _=require(_0x5029('0xa'));var squel=require('squel');var crypto=require('crypto');var jsforce=require('jsforce');var deskjs=require(_0x5029('0xb'));var toCsv=require('to-csv');var querystring=require(_0x5029('0xc'));var Papa=require('papaparse');var Redis=require(_0x5029('0xd'));var authService=require('../../components/auth/service');var qs=require(_0x5029('0xe'));var as=require(_0x5029('0xf'));var hardwareService=require(_0x5029('0x10'));var logger=require('../../config/logger')(_0x5029('0x11'));var utils=require(_0x5029('0x12'));var config=require(_0x5029('0x13'));var db=require('../../mysqldb')['db'];var integrations=require(_0x5029('0x14'));var jayson=require(_0x5029('0x15'));var client=jayson['client']['http']({'port':0x232a});function checkPasswordPattern(_0x49f836,_0x4aebb6,_0x2484ac){if(_0x2484ac){var _0x2e0369=new RegExp(/(?=.*[a-z])(?=.*[A-Z])(?=.*[0-9])(?=.*[?!@#\$%\^&\*~\-_=+[{\]\}])(?=.{8,})/);if(_0x2e0369[_0x5029('0x16')](_0x4aebb6)){return _0x49f836;}else{throw new db[(_0x5029('0x17'))][(_0x5029('0x18'))](_0x5029('0x19'));}}else{return _0x49f836;}}function respondWithRpcPromise(_0xe278b7,_0x317c20,_0x10bf55,_0x326923){return new BPromise(function(_0x457c73,_0x353cba){var _0x3786b5=_0x326923||client;return _0x3786b5[_0x5029('0x1a')](_0xe278b7,_0x10bf55)[_0x5029('0x1b')](function(_0x4f7ab4){logger[_0x5029('0x1c')](_0x5029('0x1d'),_0x317c20,_0x5029('0x1e'));logger[_0x5029('0x1f')](_0x5029('0x20'),_0x317c20,_0x5029('0x1e'),JSON[_0x5029('0x21')](_0x4f7ab4));if(_0x4f7ab4['error']){if(_0x4f7ab4[_0x5029('0x22')]['code']===0x1f4){logger[_0x5029('0x22')](_0x5029('0x1d'),_0x317c20,_0x4f7ab4[_0x5029('0x22')][_0x5029('0x23')]);return _0x353cba(_0x4f7ab4['error']['message']);}logger[_0x5029('0x22')]('SalesforceAccount,\x20%s,\x20%s',_0x317c20,_0x4f7ab4[_0x5029('0x22')][_0x5029('0x23')]);return _0x457c73(_0x4f7ab4[_0x5029('0x22')][_0x5029('0x23')]);}else{logger[_0x5029('0x1c')](_0x5029('0x1d'),_0x317c20,_0x5029('0x1e'));_0x457c73(_0x4f7ab4[_0x5029('0x24')][_0x5029('0x23')]);}})['catch'](function(_0x564866){logger['error'](_0x5029('0x1d'),_0x317c20,_0x564866);_0x353cba(_0x564866);});});}function respondWithStatusCode(_0x45666c,_0x51093c){_0x51093c=_0x51093c||0xcc;return function(_0x5727e9){if(_0x5727e9){return _0x45666c[_0x5029('0x25')](_0x51093c);}return _0x45666c[_0x5029('0x26')](_0x51093c)[_0x5029('0x27')]();};}function respondWithResult(_0x5527fc,_0x2c501f){_0x2c501f=_0x2c501f||0xc8;return function(_0xb14bc){if(_0xb14bc){return _0x5527fc['status'](_0x2c501f)[_0x5029('0x28')](_0xb14bc);}};}function respondWithFilteredResult(_0x31f0a0,_0x16ad8b){return function(_0x4a24b9){if(_0x4a24b9){var _0x32da06=_0x4a24b9[_0x5029('0x29')],_0x251f99=_0x16ad8b[_0x5029('0x2a')],_0xe5313e=_0x16ad8b['offset']+_0x16ad8b[_0x5029('0x2b')],_0x4b6f92;if(_0xe5313e>=_0x32da06){_0xe5313e=_0x32da06;_0x4b6f92=0xc8;}else{_0x4b6f92=0xce;}_0x31f0a0[_0x5029('0x26')](_0x4b6f92);return _0x31f0a0[_0x5029('0x2c')](_0x5029('0x2d'),_0x251f99+'-'+_0xe5313e+'/'+_0x32da06)[_0x5029('0x28')](_0x4a24b9);}return null;};}function patchUpdates(_0x2a1ed6){return function(_0x44255a){try{jsonpatch[_0x5029('0x2e')](_0x44255a,_0x2a1ed6,!![]);}catch(_0x250156){return BPromise[_0x5029('0x2f')](_0x250156);}return _0x44255a[_0x5029('0x30')]();};}function saveUpdates(_0x4519c8,_0x4ff3db){return function(_0x11ae38){if(_0x11ae38){return _0x11ae38['update'](_0x4519c8)[_0x5029('0x1b')](function(_0x4f672e){return _0x4f672e;});}return null;};}function removeEntity(_0x48f387,_0x2bc434){return function(_0x447680){if(_0x447680){return _0x447680[_0x5029('0x31')]()['then'](function(){_0x48f387[_0x5029('0x26')](0xcc)[_0x5029('0x27')]();});}};}function handleEntityNotFound(_0x3f20fb,_0x29c59a){return function(_0x1bb896){if(!_0x1bb896){_0x3f20fb[_0x5029('0x25')](0x194);}return _0x1bb896;};}function handleError(_0x46ec59,_0x22205e){_0x22205e=_0x22205e||0x1f4;return function(_0x456cfc){logger['error'](_0x456cfc[_0x5029('0x32')]);if(_0x456cfc[_0x5029('0x33')]){delete _0x456cfc[_0x5029('0x33')];}_0x46ec59[_0x5029('0x26')](_0x22205e)['send'](_0x456cfc);};}exports[_0x5029('0x34')]=function(_0x388cca,_0x3e2d88){var _0x594549={},_0x4904cc={},_0x2d1ccb={'count':0x0,'rows':[]};var _0x17756b=_['map'](db['SalesforceAccount'][_0x5029('0x35')],function(_0x157969){return{'name':_0x157969[_0x5029('0x36')],'type':_0x157969[_0x5029('0x37')][_0x5029('0x38')]};});_0x4904cc[_0x5029('0x39')]=_[_0x5029('0x3a')](_0x17756b,_0x5029('0x33'));_0x4904cc[_0x5029('0x3b')]=_[_0x5029('0x3c')](_0x388cca[_0x5029('0x3b')]);_0x4904cc[_0x5029('0x3d')]=_[_0x5029('0x3e')](_0x4904cc[_0x5029('0x39')],_0x4904cc['query']);_0x594549['attributes']=_[_0x5029('0x3e')](_0x4904cc[_0x5029('0x39')],qs[_0x5029('0x3f')](_0x388cca['query'][_0x5029('0x3f')]));_0x594549[_0x5029('0x40')]=_0x594549['attributes'][_0x5029('0x41')]?_0x594549['attributes']:_0x4904cc[_0x5029('0x39')];if(!_0x388cca['query'][_0x5029('0x42')](_0x5029('0x43'))){_0x594549[_0x5029('0x2b')]=qs[_0x5029('0x2b')](_0x388cca[_0x5029('0x3b')][_0x5029('0x2b')]);_0x594549[_0x5029('0x2a')]=qs[_0x5029('0x2a')](_0x388cca[_0x5029('0x3b')]['offset']);}_0x594549[_0x5029('0x44')]=qs[_0x5029('0x45')](_0x388cca[_0x5029('0x3b')][_0x5029('0x45')]);_0x594549[_0x5029('0x46')]=qs[_0x5029('0x3d')](_['pick'](_0x388cca[_0x5029('0x3b')],_0x4904cc[_0x5029('0x3d')]));if(_0x388cca[_0x5029('0x3b')][_0x5029('0x47')]){_0x594549[_0x5029('0x46')]=_['merge'](_0x594549[_0x5029('0x46')],{'$or':_[_0x5029('0x3a')](_0x17756b,function(_0x248556){if(_0x248556[_0x5029('0x37')]!==_0x5029('0x48')){var _0x128aff={};_0x128aff[_0x248556[_0x5029('0x33')]]={'$like':'%'+_0x388cca[_0x5029('0x3b')][_0x5029('0x47')]+'%'};return _0x128aff;}})});}_0x594549=_['merge']({},_0x594549,_0x388cca[_0x5029('0x49')]);var _0x27d2ad={'where':_0x594549[_0x5029('0x46')]};return db[_0x5029('0x4a')]['count'](_0x27d2ad)['then'](function(_0x17a515){_0x2d1ccb[_0x5029('0x29')]=_0x17a515;if(_0x388cca[_0x5029('0x3b')][_0x5029('0x4b')]){_0x594549[_0x5029('0x4c')]=[{'all':!![]}];}return db[_0x5029('0x4a')][_0x5029('0x4d')](_0x594549);})[_0x5029('0x1b')](function(_0x1257a4){_0x2d1ccb[_0x5029('0x4e')]=_0x1257a4;return _0x2d1ccb;})[_0x5029('0x1b')](respondWithFilteredResult(_0x3e2d88,_0x594549))[_0x5029('0x4f')](handleError(_0x3e2d88,null));};exports[_0x5029('0x50')]=function(_0x18f1f5,_0x3168bd){var _0x175cc0={'raw':![],'where':{'id':_0x18f1f5[_0x5029('0x51')]['id']}},_0x10fc07={};_0x10fc07[_0x5029('0x39')]=_[_0x5029('0x3c')](db[_0x5029('0x4a')]['rawAttributes']);_0x10fc07[_0x5029('0x3b')]=_['keys'](_0x18f1f5[_0x5029('0x3b')]);_0x10fc07[_0x5029('0x3d')]=_['intersection'](_0x10fc07['model'],_0x10fc07[_0x5029('0x3b')]);_0x175cc0['attributes']=_['intersection'](_0x10fc07[_0x5029('0x39')],qs[_0x5029('0x3f')](_0x18f1f5[_0x5029('0x3b')]['fields']));_0x175cc0['attributes']=_0x175cc0[_0x5029('0x40')][_0x5029('0x41')]?_0x175cc0['attributes']:_0x10fc07[_0x5029('0x39')];if(_0x18f1f5['query'][_0x5029('0x4b')]){_0x175cc0['include']=[{'all':!![]}];}_0x175cc0=_[_0x5029('0x52')]({},_0x175cc0,_0x18f1f5[_0x5029('0x49')]);return db[_0x5029('0x4a')][_0x5029('0x53')](_0x175cc0)[_0x5029('0x1b')](handleEntityNotFound(_0x3168bd,null))[_0x5029('0x1b')](respondWithResult(_0x3168bd,null))[_0x5029('0x4f')](handleError(_0x3168bd,null));};exports[_0x5029('0x54')]=function(_0x586936,_0x1df044){return db['SalesforceAccount'][_0x5029('0x54')](_0x586936[_0x5029('0x55')],{})['then'](respondWithResult(_0x1df044,0xc9))[_0x5029('0x4f')](handleError(_0x1df044,null));};exports['update']=function(_0x58928f,_0x55c57c){if(_0x58928f[_0x5029('0x55')]['id']){delete _0x58928f['body']['id'];}return db[_0x5029('0x4a')][_0x5029('0x53')]({'where':{'id':_0x58928f[_0x5029('0x51')]['id']}})['then'](handleEntityNotFound(_0x55c57c,null))[_0x5029('0x1b')](saveUpdates(_0x58928f['body'],null))['then'](respondWithResult(_0x55c57c,null))[_0x5029('0x4f')](handleError(_0x55c57c,null));};exports[_0x5029('0x31')]=function(_0x81e39c,_0x448273){return db[_0x5029('0x4a')]['find']({'where':{'id':_0x81e39c[_0x5029('0x51')]['id']}})[_0x5029('0x1b')](handleEntityNotFound(_0x448273,null))[_0x5029('0x1b')](removeEntity(_0x448273,null))[_0x5029('0x4f')](handleError(_0x448273,null));};exports['getConfigurations']=function(_0x33812b,_0xfffc0d,_0x4d4a2d){var _0x512de9={};var _0x2afd44={};var _0x4685a6;var _0x1263ba;return db[_0x5029('0x4a')]['findOne']({'where':{'id':_0x33812b[_0x5029('0x51')]['id']}})[_0x5029('0x1b')](handleEntityNotFound(_0xfffc0d,null))[_0x5029('0x1b')](function(_0x2aebb3){if(_0x2aebb3){_0x4685a6=_0x2aebb3;_0x2afd44[_0x5029('0x39')]=_[_0x5029('0x3c')](db['SalesforceConfiguration']['rawAttributes']);_0x2afd44[_0x5029('0x3b')]=_[_0x5029('0x3c')](_0x33812b[_0x5029('0x3b')]);_0x2afd44['filters']=_[_0x5029('0x3e')](_0x2afd44[_0x5029('0x39')],_0x2afd44[_0x5029('0x3b')]);_0x512de9[_0x5029('0x40')]=_[_0x5029('0x3e')](_0x2afd44['model'],qs[_0x5029('0x3f')](_0x33812b[_0x5029('0x3b')][_0x5029('0x3f')]));_0x512de9['attributes']=_0x512de9[_0x5029('0x40')]['length']?_0x512de9[_0x5029('0x40')]:_0x2afd44['model'];_0x512de9[_0x5029('0x44')]=qs[_0x5029('0x45')](_0x33812b[_0x5029('0x3b')][_0x5029('0x45')]);_0x512de9[_0x5029('0x46')]=qs[_0x5029('0x3d')](_['pick'](_0x33812b[_0x5029('0x3b')],_0x2afd44[_0x5029('0x3d')]));if(_0x33812b[_0x5029('0x3b')][_0x5029('0x47')]){_0x512de9[_0x5029('0x46')]=_['merge'](_0x512de9[_0x5029('0x46')],{'$or':_['map'](_0x512de9[_0x5029('0x40')],function(_0x539f80){var _0xacab3={};_0xacab3[_0x539f80]={'$like':'%'+_0x33812b['query'][_0x5029('0x47')]+'%'};return _0xacab3;})});}_0x512de9=_['merge']({},_0x512de9,_0x33812b['options']);return _0x4685a6[_0x5029('0x56')](_0x512de9);}})['then'](function(_0x2d2a40){if(_0x2d2a40){_0x1263ba=_0x2d2a40[_0x5029('0x41')];if(!_0x33812b[_0x5029('0x3b')]['hasOwnProperty'](_0x5029('0x43'))){_0x512de9['limit']=qs[_0x5029('0x2b')](_0x33812b[_0x5029('0x3b')][_0x5029('0x2b')]);_0x512de9[_0x5029('0x2a')]=qs[_0x5029('0x2a')](_0x33812b['query'][_0x5029('0x2a')]);}return _0x4685a6[_0x5029('0x56')](_0x512de9);}})['then'](function(_0x6500bb){if(_0x6500bb){return _0x6500bb?{'count':_0x1263ba,'rows':_0x6500bb}:null;}})[_0x5029('0x1b')](respondWithResult(_0xfffc0d,null))[_0x5029('0x4f')](handleError(_0xfffc0d,null));};exports[_0x5029('0x57')]=function(_0x9b1c13,_0x1bd1c6,_0x5bd84e){if(_0x9b1c13['body']['id']){delete _0x9b1c13[_0x5029('0x55')]['id'];}return db['SalesforceAccount'][_0x5029('0x58')]({'where':{'id':_0x9b1c13[_0x5029('0x51')]['id']}})['then'](handleEntityNotFound(_0x1bd1c6,null))[_0x5029('0x1b')](function(_0x574d06){if(_0x574d06){_0x9b1c13['body'][_0x5029('0x59')]=_0x574d06['id'];_0x9b1c13[_0x5029('0x55')][_0x5029('0x5a')]=integrations[_0x5029('0x5b')](_0x9b1c13['body'][_0x5029('0x5c')],_0x9b1c13[_0x5029('0x55')]['type']);_0x9b1c13[_0x5029('0x55')][_0x5029('0x5d')]=integrations['getDescriptions'](_0x9b1c13['body']['channel'],_0x9b1c13[_0x5029('0x55')][_0x5029('0x37')]);return db[_0x5029('0x5e')][_0x5029('0x54')](_0x9b1c13[_0x5029('0x55')],{'include':[{'model':db[_0x5029('0x5f')],'as':_0x5029('0x5a')},{'model':db[_0x5029('0x5f')],'as':_0x5029('0x5d')}]});}return null;})['then'](respondWithResult(_0x1bd1c6,null))['catch'](handleError(_0x1bd1c6,null));};exports[_0x5029('0x60')]=function(_0x413f9e,_0xf51086,_0x15906f){var _0x2d8c9a;var _0x3f5115='';var _0x459230='Task';return db[_0x5029('0x4a')][_0x5029('0x58')]({'where':{'id':_0x413f9e[_0x5029('0x51')]['id']},'attributes':['id','remoteUri',_0x5029('0x61'),_0x5029('0x62'),_0x5029('0x63'),'password',_0x5029('0x64')]})[_0x5029('0x1b')](handleEntityNotFound(_0xf51086,null))[_0x5029('0x1b')](function(_0x50af55){if(_0x50af55){_0x3f5115=_0x50af55[_0x5029('0x65')];var _0x145616=_0x3f5115['slice'](-0x1);if(_0x145616==='/'){_0x3f5115=_0x3f5115[_0x5029('0x66')](0x0,_0x3f5115[_0x5029('0x67')](_0x145616));}_0x2d8c9a=new jsforce[(_0x5029('0x68'))]({'oauth2':{'loginUrl':_0x3f5115,'clientId':_0x50af55[_0x5029('0x61')],'clientSecret':_0x50af55[_0x5029('0x62')]}});return _0x2d8c9a['login'](_0x50af55[_0x5029('0x63')],_0x50af55[_0x5029('0x69')][_0x5029('0x6a')](_0x50af55[_0x5029('0x64')]));}})[_0x5029('0x1b')](function(_0x5e7f50){if(_0x5e7f50){if(!_[_0x5029('0x6b')](_0x413f9e[_0x5029('0x3b')][_0x5029('0x6c')])){_0x459230=_0x413f9e['query'][_0x5029('0x6c')];}return _0x2d8c9a[_0x5029('0x6d')](_0x459230)[_0x5029('0x6e')]();}})[_0x5029('0x1b')](function(_0x1b3860){var _0x320a91=[_0x5029('0x6f'),'CallDurationInSeconds',_0x5029('0x70'),_0x5029('0x71'),_0x5029('0x72'),_0x5029('0x73'),_0x5029('0x74'),'Type'];if(!_[_0x5029('0x6b')](_0x413f9e[_0x5029('0x3b')][_0x5029('0x6c')])&&_0x413f9e['query'][_0x5029('0x6c')]===_0x5029('0x75')){_0x320a91=['Type','Origin','Reason',_0x5029('0x74'),_0x5029('0x73'),_0x5029('0x76'),_0x5029('0x77'),_0x5029('0x78')];}if(_0x1b3860){_['remove'](_0x1b3860[_0x5029('0x3f')],function(_0x2e4782){return _0x2e4782[_0x5029('0x79')]===![]&&!_0x320a91['includes'](_0x2e4782['name']);});return{'count':_0x1b3860[_0x5029('0x3f')][_0x5029('0x41')],'rows':_[_0x5029('0x3a')](_0x1b3860[_0x5029('0x3f')],function(_0x597381){return{'id':_0x597381[_0x5029('0x33')],'name':_0x597381[_0x5029('0x7a')],'custom':_0x597381[_0x5029('0x79')],'options':_0x597381[_0x5029('0x7b')][_0x5029('0x41')]>0x0?_[_0x5029('0x3a')](_0x597381[_0x5029('0x7b')],function(_0xe4b730){return{'name':_0xe4b730['label'],'value':_0xe4b730[_0x5029('0x7c')]};}):_0x597381['type']=='boolean'?[{'name':_0x5029('0x7d'),'value':'true'},{'name':_0x5029('0x7e'),'value':_0x5029('0x7f')}]:[]};})};}})[_0x5029('0x1b')](respondWithResult(_0xf51086,null))[_0x5029('0x4f')](function(_0x1b6f4c){var _0x227d13=_0x413f9e[_0x5029('0x3b')][_0x5029('0x16')]?0x1f4:_0x1b6f4c['statusCode']||0x1f4;logger['error'](_0x5029('0x80'),'getFields',_0x227d13,JSON['stringify'](_0x1b6f4c));delete _0x1b6f4c[_0x5029('0x33')];if(_0x227d13===0x191){_0x227d13=0x190;}_0xf51086['status'](_0x227d13)['send'](_0x413f9e[_0x5029('0x3b')][_0x5029('0x16')]?{'message':_0x5029('0x81'),'statusCode':_0x1b6f4c[_0x5029('0x82')]}:_0x1b6f4c);});};
\ No newline at end of file
+var _0x326f=['filter','map','VIRTUAL','includeAll','include','findAll','rows','show','params','intersection','merge','find','create','body','update','getConfigurations','findOne','SalesforceConfiguration','options','addConfiguration','AccountId','getSubjects','Descriptions','SalesforceField','Subjects','getFields','Task','remoteUri','clientSecret','username','password','securityToken','slice','clientId','login','concat','isNil','ticketType','describe','CallDisposition','CallDurationInSeconds','CallObject','CallType','IsArchived','Status','Type','Case','Origin','Reason','Priority','IsEscalated','SuppliedName','SuppliedCompany','remove','custom','includes','label','picklistValues','value','True','true','False','false','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','SalesforceAccount,\x20%s,\x20%s','request\x20sent','debug','SalesforceAccount,\x20%s,\x20%s,\x20%s','error','code','message','result','catch','sendStatus','status','end','count','offset','limit','set','Content-Range','json','apply','reject','then','destroy','stack','name','index','SalesforceAccount','rawAttributes','fieldName','type','key','model','query','keys','filters','fields','attributes','length','hasOwnProperty','nolimit','order','sort','where','pick'];(function(_0x5e8483,_0x9a6fa2){var _0x26c308=function(_0x4ddaac){while(--_0x4ddaac){_0x5e8483['push'](_0x5e8483['shift']());}};_0x26c308(++_0x9a6fa2);}(_0x326f,0xd1));var _0xf326=function(_0x2ee20f,_0x59aa23){_0x2ee20f=_0x2ee20f-0x0;var _0x2f3b14=_0x326f[_0x2ee20f];return _0x2f3b14;};'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']('SalesforceAccount,\x20%s,\x20%s',_0x11f6d2,_0x3ad7da[_0xf326('0x20')]['message']);return _0x287a2a(_0x3ad7da['error'][_0xf326('0x22')]);}logger[_0xf326('0x20')]('SalesforceAccount,\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']('SalesforceAccount,\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')]));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;var _0x2c81a7='';var _0x366312=_0xf326('0x61');return db['SalesforceAccount'][_0xf326('0x57')]({'where':{'id':_0x3855a4[_0xf326('0x4f')]['id']},'attributes':['id',_0xf326('0x62'),'clientId',_0xf326('0x63'),_0xf326('0x64'),_0xf326('0x65'),_0xf326('0x66')]})['then'](handleEntityNotFound(_0x5290da,null))[_0xf326('0x30')](function(_0x5c9900){if(_0x5c9900){_0x2c81a7=_0x5c9900['remoteUri'];var _0x32d9c5=_0x2c81a7[_0xf326('0x67')](-0x1);if(_0x32d9c5==='/'){_0x2c81a7=_0x2c81a7['substring'](0x0,_0x2c81a7['lastIndexOf'](_0x32d9c5));}_0x5b1494=new jsforce['Connection']({'oauth2':{'loginUrl':_0x2c81a7,'clientId':_0x5c9900[_0xf326('0x68')],'clientSecret':_0x5c9900['clientSecret']}});return _0x5b1494[_0xf326('0x69')](_0x5c9900[_0xf326('0x64')],_0x5c9900[_0xf326('0x65')][_0xf326('0x6a')](_0x5c9900[_0xf326('0x66')]));}})[_0xf326('0x30')](function(_0x5d23f0){if(_0x5d23f0){if(!_[_0xf326('0x6b')](_0x3855a4[_0xf326('0x3b')]['ticketType'])){_0x366312=_0x3855a4['query'][_0xf326('0x6c')];}return _0x5b1494['sobject'](_0x366312)[_0xf326('0x6d')]();}})[_0xf326('0x30')](function(_0x153027){var _0x363e64=[_0xf326('0x6e'),_0xf326('0x6f'),_0xf326('0x70'),_0xf326('0x71'),_0xf326('0x72'),'Priority',_0xf326('0x73'),_0xf326('0x74')];if(!_['isNil'](_0x3855a4[_0xf326('0x3b')]['ticketType'])&&_0x3855a4[_0xf326('0x3b')][_0xf326('0x6c')]===_0xf326('0x75')){_0x363e64=['Type',_0xf326('0x76'),_0xf326('0x77'),_0xf326('0x73'),_0xf326('0x78'),_0xf326('0x79'),_0xf326('0x7a'),_0xf326('0x7b')];}if(_0x153027){_[_0xf326('0x7c')](_0x153027[_0xf326('0x3e')],function(_0x38b696){return _0x38b696[_0xf326('0x7d')]===![]&&!_0x363e64[_0xf326('0x7e')](_0x38b696[_0xf326('0x33')]);});return{'count':_0x153027[_0xf326('0x3e')][_0xf326('0x40')],'rows':_['map'](_0x153027[_0xf326('0x3e')],function(_0x24aaca){return{'id':_0x24aaca['name'],'name':_0x24aaca[_0xf326('0x7f')],'custom':_0x24aaca[_0xf326('0x7d')],'options':_0x24aaca['picklistValues'][_0xf326('0x40')]>0x0?_[_0xf326('0x48')](_0x24aaca[_0xf326('0x80')],function(_0x8dbd96){return{'name':_0x8dbd96[_0xf326('0x7f')],'value':_0x8dbd96[_0xf326('0x81')]};}):_0x24aaca[_0xf326('0x38')]=='boolean'?[{'name':_0xf326('0x82'),'value':_0xf326('0x83')},{'name':_0xf326('0x84'),'value':_0xf326('0x85')}]:[]};})};}})[_0xf326('0x30')](respondWithResult(_0x5290da,null))[_0xf326('0x24')](function(_0x204002){var _0x3b250d=_0x3855a4['query'][_0xf326('0x86')]?0x1f4:_0x204002[_0xf326('0x87')]||0x1f4;logger['error'](_0xf326('0x88'),'getFields',_0x3b250d,JSON[_0xf326('0x89')](_0x204002));delete _0x204002[_0xf326('0x33')];if(_0x3b250d===0x191){_0x3b250d=0x190;}_0x5290da[_0xf326('0x26')](_0x3b250d)[_0xf326('0x8a')](_0x3855a4[_0xf326('0x3b')][_0xf326('0x86')]?{'message':_0xf326('0x8b'),'statusCode':_0x204002[_0xf326('0x87')]}:_0x204002);});};
\ No newline at end of file
diff --git a/server/api/intSalesforceAccount/intSalesforceAccount.model.js b/server/api/intSalesforceAccount/intSalesforceAccount.model.js
index 2894e8f..abb88aa 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 _0x556e=['request-promise','path','rimraf','../../config/environment','./intSalesforceAccount.attributes','exports','define','SalesforceAccount','int_salesforce_accounts','lodash','moment','bluebird'];(function(_0x8c43de,_0x90ff31){var _0xa6591b=function(_0x469716){while(--_0x469716){_0x8c43de['push'](_0x8c43de['shift']());}};_0xa6591b(++_0x90ff31);}(_0x556e,0x195));var _0xe556=function(_0x9d39e9,_0x3aebc9){_0x9d39e9=_0x9d39e9-0x0;var _0x4ac75b=_0x556e[_0x9d39e9];return _0x4ac75b;};'use strict';var _=require(_0xe556('0x0'));var util=require('util');var logger=require('../../config/logger')('api');var moment=require(_0xe556('0x1'));var BPromise=require(_0xe556('0x2'));var rp=require(_0xe556('0x3'));var fs=require('fs');var path=require(_0xe556('0x4'));var rimraf=require(_0xe556('0x5'));var config=require(_0xe556('0x6'));var attributes=require(_0xe556('0x7'));var integrations=require('../../components/integrations/configuration');module[_0xe556('0x8')]=function(_0x28a0fa,_0x12165f){return _0x28a0fa[_0xe556('0x9')](_0xe556('0xa'),attributes,{'tableName':_0xe556('0xb'),'paranoid':![],'indexes':[],'timestamps':!![]});};
\ No newline at end of file
+var _0x2c48=['SalesforceAccount','int_salesforce_accounts','lodash','util','../../config/logger','api','request-promise','path','../../config/environment','./intSalesforceAccount.attributes','../../components/integrations/configuration','exports','define'];(function(_0x26730d,_0x1dc21c){var _0xd775ce=function(_0x2be570){while(--_0x2be570){_0x26730d['push'](_0x26730d['shift']());}};_0xd775ce(++_0x1dc21c);}(_0x2c48,0x13a));var _0x82c4=function(_0x43d11d,_0xccff91){_0x43d11d=_0x43d11d-0x0;var _0x38cd08=_0x2c48[_0x43d11d];return _0x38cd08;};'use strict';var _=require(_0x82c4('0x0'));var util=require(_0x82c4('0x1'));var logger=require(_0x82c4('0x2'))(_0x82c4('0x3'));var moment=require('moment');var BPromise=require('bluebird');var rp=require(_0x82c4('0x4'));var fs=require('fs');var path=require(_0x82c4('0x5'));var rimraf=require('rimraf');var config=require(_0x82c4('0x6'));var attributes=require(_0x82c4('0x7'));var integrations=require(_0x82c4('0x8'));module[_0x82c4('0x9')]=function(_0x43abd9,_0x5f0ce0){return _0x43abd9[_0x82c4('0xa')](_0x82c4('0xb'),attributes,{'tableName':_0x82c4('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 e80835e..745e878 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 _0x4ea3=['options','raw','where','attributes','include','map','find','model','ShowSalesforceAccount','debug','lodash','util','moment','bluebird','ioredis','../../config/utils','../../config/environment','jayson/promise','client','http','request','then','info','SalesforceAccount,\x20%s,\x20%s','SalesforceAccount,\x20%s,\x20%s,\x20%s','request\x20sent','stringify','error','code','message','catch','GetSalesforceAccount','SalesforceAccount','findAll'];(function(_0x4ff6ad,_0x288261){var _0x594d46=function(_0x76e3dd){while(--_0x76e3dd){_0x4ff6ad['push'](_0x4ff6ad['shift']());}};_0x594d46(++_0x288261);}(_0x4ea3,0x70));var _0x34ea=function(_0x1facfa,_0x1acf7d){_0x1facfa=_0x1facfa-0x0;var _0x9ec701=_0x4ea3[_0x1facfa];return _0x9ec701;};'use strict';var _=require(_0x34ea('0x0'));var util=require(_0x34ea('0x1'));var moment=require(_0x34ea('0x2'));var BPromise=require(_0x34ea('0x3'));var rs=require('randomstring');var fs=require('fs');var Redis=require(_0x34ea('0x4'));var db=require('../../mysqldb')['db'];var utils=require(_0x34ea('0x5'));var logger=require('../../config/logger')('rpc');var config=require(_0x34ea('0x6'));var jayson=require(_0x34ea('0x7'));var client=jayson[_0x34ea('0x8')][_0x34ea('0x9')]({'port':0x232a});function respondWithRpcPromise(_0x40434e,_0x18b461,_0x22b09e){return new BPromise(function(_0x5bec7c,_0x341727){return client[_0x34ea('0xa')](_0x40434e,_0x22b09e)[_0x34ea('0xb')](function(_0x5132c4){logger[_0x34ea('0xc')](_0x34ea('0xd'),_0x18b461,'request\x20sent');logger['debug'](_0x34ea('0xe'),_0x18b461,_0x34ea('0xf'),JSON[_0x34ea('0x10')](_0x5132c4));if(_0x5132c4['error']){if(_0x5132c4[_0x34ea('0x11')][_0x34ea('0x12')]===0x1f4){logger[_0x34ea('0x11')](_0x34ea('0xd'),_0x18b461,_0x5132c4[_0x34ea('0x11')][_0x34ea('0x13')]);return _0x341727(_0x5132c4[_0x34ea('0x11')][_0x34ea('0x13')]);}logger[_0x34ea('0x11')](_0x34ea('0xd'),_0x18b461,_0x5132c4[_0x34ea('0x11')]['message']);return _0x5bec7c(_0x5132c4[_0x34ea('0x11')][_0x34ea('0x13')]);}else{logger[_0x34ea('0xc')](_0x34ea('0xd'),_0x18b461,_0x34ea('0xf'));_0x5bec7c(_0x5132c4['result'][_0x34ea('0x13')]);}})[_0x34ea('0x14')](function(_0x3fa3b0){logger[_0x34ea('0x11')]('SalesforceAccount,\x20%s,\x20%s',_0x18b461,_0x3fa3b0);_0x341727(_0x3fa3b0);});});}exports[_0x34ea('0x15')]=function(_0x34caea){var _0x5aeea3=this;return new Promise(function(_0x5340a4,_0x72fef0){return db[_0x34ea('0x16')][_0x34ea('0x17')]({'raw':_0x34caea[_0x34ea('0x18')]?_0x34caea['options'][_0x34ea('0x19')]===undefined?!![]:![]:!![],'where':_0x34caea[_0x34ea('0x18')]?_0x34caea[_0x34ea('0x18')][_0x34ea('0x1a')]||null:null,'attributes':_0x34caea['options']?_0x34caea['options'][_0x34ea('0x1b')]||null:null,'limit':_0x34caea[_0x34ea('0x18')]?_0x34caea[_0x34ea('0x18')]['limit']||null:null,'include':_0x34caea['options']?_0x34caea[_0x34ea('0x18')][_0x34ea('0x1c')]?_[_0x34ea('0x1d')](_0x34caea[_0x34ea('0x18')][_0x34ea('0x1c')],function(_0x697475){return{'model':db[_0x697475['model']],'as':_0x697475['as'],'attributes':_0x697475[_0x34ea('0x1b')],'include':_0x697475[_0x34ea('0x1c')]?_[_0x34ea('0x1d')](_0x697475[_0x34ea('0x1c')],function(_0x5b5885){return{'model':db[_0x5b5885['model']],'as':_0x5b5885['as'],'attributes':_0x5b5885['attributes'],'include':_0x5b5885[_0x34ea('0x1c')]?_[_0x34ea('0x1d')](_0x5b5885[_0x34ea('0x1c')],function(_0x4204d7){return{'model':db[_0x4204d7['model']],'as':_0x4204d7['as'],'attributes':_0x4204d7[_0x34ea('0x1b')]};}):[]};}):[]};}):[]:[]})[_0x34ea('0xb')](function(_0x27c6f7){logger['info']('GetSalesforceAccount',_0x34caea);logger['debug']('GetSalesforceAccount',_0x34caea,JSON[_0x34ea('0x10')](_0x27c6f7));_0x5340a4(_0x27c6f7);})[_0x34ea('0x14')](function(_0x859b7e){logger[_0x34ea('0x11')]('GetSalesforceAccount',_0x859b7e[_0x34ea('0x13')],_0x34caea);_0x72fef0(_0x5aeea3['error'](0x1f4,_0x859b7e[_0x34ea('0x13')]));});});};exports['ShowSalesforceAccount']=function(_0x3272f9){var _0x14e018=this;return new Promise(function(_0x3cb968,_0x57b19d){return db[_0x34ea('0x16')][_0x34ea('0x1e')]({'raw':_0x3272f9['options']?_0x3272f9[_0x34ea('0x18')]['raw']===undefined?!![]:![]:!![],'where':_0x3272f9[_0x34ea('0x18')]?_0x3272f9[_0x34ea('0x18')][_0x34ea('0x1a')]||null:null,'attributes':_0x3272f9['options']?_0x3272f9['options'][_0x34ea('0x1b')]||null:null,'include':_0x3272f9['options']?_0x3272f9[_0x34ea('0x18')][_0x34ea('0x1c')]?_['map'](_0x3272f9[_0x34ea('0x18')][_0x34ea('0x1c')],function(_0x2cdde6){return{'model':db[_0x2cdde6[_0x34ea('0x1f')]],'as':_0x2cdde6['as'],'attributes':_0x2cdde6['attributes'],'include':_0x2cdde6['include']?_['map'](_0x2cdde6[_0x34ea('0x1c')],function(_0x6668cd){return{'model':db[_0x6668cd[_0x34ea('0x1f')]],'as':_0x6668cd['as'],'attributes':_0x6668cd['attributes'],'include':_0x6668cd['include']?_['map'](_0x6668cd[_0x34ea('0x1c')],function(_0x39fe11){return{'model':db[_0x39fe11['model']],'as':_0x39fe11['as'],'attributes':_0x39fe11[_0x34ea('0x1b')]};}):[]};}):[]};}):[]:[]})[_0x34ea('0xb')](function(_0x2db107){logger[_0x34ea('0xc')](_0x34ea('0x20'),_0x3272f9);logger[_0x34ea('0x21')]('ShowSalesforceAccount',_0x3272f9,JSON[_0x34ea('0x10')](_0x2db107));_0x3cb968(_0x2db107);})[_0x34ea('0x14')](function(_0x60f384){logger[_0x34ea('0x11')]('ShowSalesforceAccount',_0x60f384['message'],_0x3272f9);_0x57b19d(_0x14e018[_0x34ea('0x11')](0x1f4,_0x60f384[_0x34ea('0x13')]));});});};
\ No newline at end of file
+var _0x41bb=['../../config/environment','jayson/promise','client','request','then','info','SalesforceAccount,\x20%s,\x20%s','request\x20sent','debug','error','code','message','result','catch','GetSalesforceAccount','findAll','options','raw','attributes','limit','include','map','model','stringify','ShowSalesforceAccount','SalesforceAccount','where','lodash','util','bluebird','ioredis','../../mysqldb','../../config/utils','../../config/logger'];(function(_0x187550,_0x3dd443){var _0x5cc345=function(_0x3568e2){while(--_0x3568e2){_0x187550['push'](_0x187550['shift']());}};_0x5cc345(++_0x3dd443);}(_0x41bb,0xc5));var _0xb41b=function(_0x5dcd2a,_0x44b5ce){_0x5dcd2a=_0x5dcd2a-0x0;var _0x52448b=_0x41bb[_0x5dcd2a];return _0x52448b;};'use strict';var _=require(_0xb41b('0x0'));var util=require(_0xb41b('0x1'));var moment=require('moment');var BPromise=require(_0xb41b('0x2'));var rs=require('randomstring');var fs=require('fs');var Redis=require(_0xb41b('0x3'));var db=require(_0xb41b('0x4'))['db'];var utils=require(_0xb41b('0x5'));var logger=require(_0xb41b('0x6'))('rpc');var config=require(_0xb41b('0x7'));var jayson=require(_0xb41b('0x8'));var client=jayson[_0xb41b('0x9')]['http']({'port':0x232a});function respondWithRpcPromise(_0x5455ce,_0x497242,_0x2704f0){return new BPromise(function(_0x29c30d,_0x53722a){return client[_0xb41b('0xa')](_0x5455ce,_0x2704f0)[_0xb41b('0xb')](function(_0x11b8b2){logger[_0xb41b('0xc')](_0xb41b('0xd'),_0x497242,_0xb41b('0xe'));logger[_0xb41b('0xf')]('SalesforceAccount,\x20%s,\x20%s,\x20%s',_0x497242,_0xb41b('0xe'),JSON['stringify'](_0x11b8b2));if(_0x11b8b2[_0xb41b('0x10')]){if(_0x11b8b2[_0xb41b('0x10')][_0xb41b('0x11')]===0x1f4){logger[_0xb41b('0x10')](_0xb41b('0xd'),_0x497242,_0x11b8b2['error'][_0xb41b('0x12')]);return _0x53722a(_0x11b8b2[_0xb41b('0x10')][_0xb41b('0x12')]);}logger[_0xb41b('0x10')](_0xb41b('0xd'),_0x497242,_0x11b8b2['error']['message']);return _0x29c30d(_0x11b8b2['error'][_0xb41b('0x12')]);}else{logger[_0xb41b('0xc')](_0xb41b('0xd'),_0x497242,_0xb41b('0xe'));_0x29c30d(_0x11b8b2[_0xb41b('0x13')]['message']);}})[_0xb41b('0x14')](function(_0xd0b6b5){logger[_0xb41b('0x10')](_0xb41b('0xd'),_0x497242,_0xd0b6b5);_0x53722a(_0xd0b6b5);});});}exports[_0xb41b('0x15')]=function(_0x47154d){var _0x198783=this;return new Promise(function(_0x5df8c2,_0x4b3580){return db['SalesforceAccount'][_0xb41b('0x16')]({'raw':_0x47154d['options']?_0x47154d[_0xb41b('0x17')][_0xb41b('0x18')]===undefined?!![]:![]:!![],'where':_0x47154d[_0xb41b('0x17')]?_0x47154d['options']['where']||null:null,'attributes':_0x47154d[_0xb41b('0x17')]?_0x47154d[_0xb41b('0x17')][_0xb41b('0x19')]||null:null,'limit':_0x47154d[_0xb41b('0x17')]?_0x47154d[_0xb41b('0x17')][_0xb41b('0x1a')]||null:null,'include':_0x47154d['options']?_0x47154d['options'][_0xb41b('0x1b')]?_[_0xb41b('0x1c')](_0x47154d[_0xb41b('0x17')]['include'],function(_0x14e9c8){return{'model':db[_0x14e9c8[_0xb41b('0x1d')]],'as':_0x14e9c8['as'],'attributes':_0x14e9c8['attributes'],'include':_0x14e9c8[_0xb41b('0x1b')]?_[_0xb41b('0x1c')](_0x14e9c8['include'],function(_0xed3c7e){return{'model':db[_0xed3c7e['model']],'as':_0xed3c7e['as'],'attributes':_0xed3c7e[_0xb41b('0x19')],'include':_0xed3c7e[_0xb41b('0x1b')]?_['map'](_0xed3c7e[_0xb41b('0x1b')],function(_0x4265b8){return{'model':db[_0x4265b8['model']],'as':_0x4265b8['as'],'attributes':_0x4265b8['attributes']};}):[]};}):[]};}):[]:[]})[_0xb41b('0xb')](function(_0x46aecf){logger[_0xb41b('0xc')](_0xb41b('0x15'),_0x47154d);logger[_0xb41b('0xf')](_0xb41b('0x15'),_0x47154d,JSON[_0xb41b('0x1e')](_0x46aecf));_0x5df8c2(_0x46aecf);})['catch'](function(_0x26ef96){logger[_0xb41b('0x10')]('GetSalesforceAccount',_0x26ef96[_0xb41b('0x12')],_0x47154d);_0x4b3580(_0x198783['error'](0x1f4,_0x26ef96[_0xb41b('0x12')]));});});};exports[_0xb41b('0x1f')]=function(_0x597a35){var _0x23a6ed=this;return new Promise(function(_0x4a95e7,_0x29da9f){return db[_0xb41b('0x20')]['find']({'raw':_0x597a35[_0xb41b('0x17')]?_0x597a35[_0xb41b('0x17')][_0xb41b('0x18')]===undefined?!![]:![]:!![],'where':_0x597a35[_0xb41b('0x17')]?_0x597a35[_0xb41b('0x17')][_0xb41b('0x21')]||null:null,'attributes':_0x597a35[_0xb41b('0x17')]?_0x597a35[_0xb41b('0x17')][_0xb41b('0x19')]||null:null,'include':_0x597a35[_0xb41b('0x17')]?_0x597a35['options'][_0xb41b('0x1b')]?_['map'](_0x597a35['options'][_0xb41b('0x1b')],function(_0x192ceb){return{'model':db[_0x192ceb[_0xb41b('0x1d')]],'as':_0x192ceb['as'],'attributes':_0x192ceb[_0xb41b('0x19')],'include':_0x192ceb[_0xb41b('0x1b')]?_[_0xb41b('0x1c')](_0x192ceb[_0xb41b('0x1b')],function(_0x197197){return{'model':db[_0x197197[_0xb41b('0x1d')]],'as':_0x197197['as'],'attributes':_0x197197[_0xb41b('0x19')],'include':_0x197197[_0xb41b('0x1b')]?_['map'](_0x197197[_0xb41b('0x1b')],function(_0x27990d){return{'model':db[_0x27990d[_0xb41b('0x1d')]],'as':_0x27990d['as'],'attributes':_0x27990d[_0xb41b('0x19')]};}):[]};}):[]};}):[]:[]})[_0xb41b('0xb')](function(_0x10b3f6){logger['info']('ShowSalesforceAccount',_0x597a35);logger[_0xb41b('0xf')](_0xb41b('0x1f'),_0x597a35,JSON['stringify'](_0x10b3f6));_0x4a95e7(_0x10b3f6);})[_0xb41b('0x14')](function(_0x47363e){logger[_0xb41b('0x10')](_0xb41b('0x1f'),_0x47363e[_0xb41b('0x12')],_0x597a35);_0x29da9f(_0x23a6ed['error'](0x1f4,_0x47363e[_0xb41b('0x12')]));});});};
\ No newline at end of file
diff --git a/server/api/intSalesforceConfiguration/index.js b/server/api/intSalesforceConfiguration/index.js
index 398a0fc..27bc15d 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 _0x6685=['update','delete','exports','util','path','connect-timeout','express','Router','../../components/auth/service','../../components/interaction/service','../../config/environment','./intSalesforceConfiguration.controller','get','isAuthenticated','show','/:id/fields','/:id/descriptions','post'];(function(_0x14ee4b,_0x824aee){var _0x1ecdcc=function(_0x4e3a37){while(--_0x4e3a37){_0x14ee4b['push'](_0x14ee4b['shift']());}};_0x1ecdcc(++_0x824aee);}(_0x6685,0x111));var _0x5668=function(_0x33fc96,_0x5d2c44){_0x33fc96=_0x33fc96-0x0;var _0x1c2d1c=_0x6685[_0x33fc96];return _0x1c2d1c;};'use strict';var multer=require('multer');var util=require(_0x5668('0x0'));var path=require(_0x5668('0x1'));var timeout=require(_0x5668('0x2'));var express=require(_0x5668('0x3'));var router=express[_0x5668('0x4')]();var auth=require(_0x5668('0x5'));var interaction=require(_0x5668('0x6'));var config=require(_0x5668('0x7'));var controller=require(_0x5668('0x8'));router[_0x5668('0x9')]('/',auth[_0x5668('0xa')](),controller['index']);router['get']('/:id',auth[_0x5668('0xa')](),controller[_0x5668('0xb')]);router[_0x5668('0x9')](_0x5668('0xc'),auth[_0x5668('0xa')](),controller['getFields']);router[_0x5668('0x9')]('/:id/subjects',auth['isAuthenticated'](),controller['getSubjects']);router['get'](_0x5668('0xd'),auth[_0x5668('0xa')](),controller['getDescriptions']);router[_0x5668('0xe')]('/',auth['isAuthenticated'](),controller['create']);router['put']('/:id',auth[_0x5668('0xa')](),controller[_0x5668('0xf')]);router[_0x5668('0x10')]('/:id',auth['isAuthenticated'](),controller['destroy']);module[_0x5668('0x11')]=router;
\ No newline at end of file
+var _0xc7b1=['create','put','update','delete','destroy','exports','util','connect-timeout','../../components/auth/service','../../components/interaction/service','../../config/environment','./intSalesforceConfiguration.controller','get','isAuthenticated','index','/:id','show','/:id/fields','getFields','getSubjects','/:id/descriptions','getDescriptions','post'];(function(_0x397c8d,_0xf0a1a4){var _0x1c5b0a=function(_0x4585d8){while(--_0x4585d8){_0x397c8d['push'](_0x397c8d['shift']());}};_0x1c5b0a(++_0xf0a1a4);}(_0xc7b1,0xa7));var _0x1c7b=function(_0x10316a,_0x125dc8){_0x10316a=_0x10316a-0x0;var _0x36ac2e=_0xc7b1[_0x10316a];return _0x36ac2e;};'use strict';var multer=require('multer');var util=require(_0x1c7b('0x0'));var path=require('path');var timeout=require(_0x1c7b('0x1'));var express=require('express');var router=express['Router']();var auth=require(_0x1c7b('0x2'));var interaction=require(_0x1c7b('0x3'));var config=require(_0x1c7b('0x4'));var controller=require(_0x1c7b('0x5'));router[_0x1c7b('0x6')]('/',auth[_0x1c7b('0x7')](),controller[_0x1c7b('0x8')]);router[_0x1c7b('0x6')](_0x1c7b('0x9'),auth[_0x1c7b('0x7')](),controller[_0x1c7b('0xa')]);router[_0x1c7b('0x6')](_0x1c7b('0xb'),auth['isAuthenticated'](),controller[_0x1c7b('0xc')]);router[_0x1c7b('0x6')]('/:id/subjects',auth[_0x1c7b('0x7')](),controller[_0x1c7b('0xd')]);router[_0x1c7b('0x6')](_0x1c7b('0xe'),auth['isAuthenticated'](),controller[_0x1c7b('0xf')]);router[_0x1c7b('0x10')]('/',auth['isAuthenticated'](),controller[_0x1c7b('0x11')]);router[_0x1c7b('0x12')]('/:id',auth[_0x1c7b('0x7')](),controller[_0x1c7b('0x13')]);router[_0x1c7b('0x14')](_0x1c7b('0x9'),auth[_0x1c7b('0x7')](),controller[_0x1c7b('0x15')]);module[_0x1c7b('0x16')]=router;
\ No newline at end of file
diff --git a/server/api/intSalesforceConfiguration/intSalesforceConfiguration.attributes.js b/server/api/intSalesforceConfiguration/intSalesforceConfiguration.attributes.js
index fe15eb9..8e5517f 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 _0xc25f=['STRING','ENUM','Case','Task','contact_lead','lead','nothing','contact','sequelize','exports'];(function(_0x1a4c27,_0x5a4b45){var _0x578d9=function(_0x10b6df){while(--_0x10b6df){_0x1a4c27['push'](_0x1a4c27['shift']());}};_0x578d9(++_0x5a4b45);}(_0xc25f,0x80));var _0xfc25=function(_0xa464c9,_0x7c86d8){_0xa464c9=_0xa464c9-0x0;var _0x3d73c4=_0xc25f[_0xa464c9];return _0x3d73c4;};'use strict';var Sequelize=require(_0xfc25('0x0'));module[_0xfc25('0x1')]={'name':{'type':Sequelize[_0xfc25('0x2')]},'description':{'type':Sequelize['STRING']},'ticketType':{'type':Sequelize[_0xfc25('0x3')]('Task',_0xfc25('0x4')),'defaultValue':_0xfc25('0x5')},'moduleSearch':{'type':Sequelize[_0xfc25('0x3')](_0xfc25('0x6'),'contact',_0xfc25('0x7')),'defaultValue':_0xfc25('0x6')},'moduleCreate':{'type':Sequelize['ENUM'](_0xfc25('0x8'),_0xfc25('0x9'),_0xfc25('0x7')),'defaultValue':_0xfc25('0x7')}};
\ No newline at end of file
+var _0xfd3b=['ENUM','Task','contact_lead','contact','lead','nothing','sequelize','exports','STRING'];(function(_0x1925c6,_0x154d01){var _0x236a1a=function(_0x310236){while(--_0x310236){_0x1925c6['push'](_0x1925c6['shift']());}};_0x236a1a(++_0x154d01);}(_0xfd3b,0x8d));var _0xbfd3=function(_0x50a567,_0x587da2){_0x50a567=_0x50a567-0x0;var _0x1e9f94=_0xfd3b[_0x50a567];return _0x1e9f94;};'use strict';var Sequelize=require(_0xbfd3('0x0'));module[_0xbfd3('0x1')]={'name':{'type':Sequelize[_0xbfd3('0x2')]},'description':{'type':Sequelize['STRING']},'ticketType':{'type':Sequelize[_0xbfd3('0x3')](_0xbfd3('0x4'),'Case'),'defaultValue':_0xbfd3('0x4')},'moduleSearch':{'type':Sequelize[_0xbfd3('0x3')](_0xbfd3('0x5'),_0xbfd3('0x6'),_0xbfd3('0x7')),'defaultValue':_0xbfd3('0x5')},'moduleCreate':{'type':Sequelize[_0xbfd3('0x3')](_0xbfd3('0x8'),_0xbfd3('0x6'),_0xbfd3('0x7')),'defaultValue':_0xbfd3('0x7')}};
\ No newline at end of file
diff --git a/server/api/intSalesforceConfiguration/intSalesforceConfiguration.controller.js b/server/api/intSalesforceConfiguration/intSalesforceConfiguration.controller.js
index 36533b4..1708cdb 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 _0x6ad4=['moment','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','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','request\x20sent','debug','stringify','error','code','message','SalesforceConfiguration,\x20%s,\x20%s','sendStatus','status','end','count','offset','limit','set','apply','reject','update','stack','name','map','SalesforceConfiguration','rawAttributes','fieldName','type','key','model','query','keys','intersection','fields','attributes','length','hasOwnProperty','sort','where','filters','pick','filter','merge','VIRTUAL','options','includeAll','findAll','catch','params','find','create','body','destroy','SalesforceField','order','getFields','nolimit','getSubjects','getDescriptions','eml-format','rimraf','zip-dir','fast-json-patch'];(function(_0x12d098,_0x41c620){var _0x1d0f9d=function(_0x59ad20){while(--_0x59ad20){_0x12d098['push'](_0x12d098['shift']());}};_0x1d0f9d(++_0x41c620);}(_0x6ad4,0x1b9));var _0x46ad=function(_0x15ce98,_0x279067){_0x15ce98=_0x15ce98-0x0;var _0x41fb05=_0x6ad4[_0x15ce98];return _0x41fb05;};'use strict';var pdf=require('html-pdf');var emlformat=require(_0x46ad('0x0'));var rimraf=require(_0x46ad('0x1'));var zipdir=require(_0x46ad('0x2'));var jsonpatch=require(_0x46ad('0x3'));var rp=require('request-promise');var moment=require(_0x46ad('0x4'));var BPromise=require('bluebird');var Mustache=require(_0x46ad('0x5'));var util=require(_0x46ad('0x6'));var path=require(_0x46ad('0x7'));var sox=require(_0x46ad('0x8'));var csv=require('to-csv');var ejs=require(_0x46ad('0x9'));var fs=require('fs');var _=require(_0x46ad('0xa'));var squel=require('squel');var crypto=require(_0x46ad('0xb'));var jsforce=require(_0x46ad('0xc'));var deskjs=require(_0x46ad('0xd'));var toCsv=require(_0x46ad('0xe'));var querystring=require(_0x46ad('0xf'));var Papa=require('papaparse');var Redis=require(_0x46ad('0x10'));var authService=require(_0x46ad('0x11'));var qs=require(_0x46ad('0x12'));var as=require(_0x46ad('0x13'));var hardwareService=require(_0x46ad('0x14'));var logger=require('../../config/logger')(_0x46ad('0x15'));var utils=require(_0x46ad('0x16'));var config=require(_0x46ad('0x17'));var db=require('../../mysqldb')['db'];var jayson=require(_0x46ad('0x18'));var client=jayson[_0x46ad('0x19')][_0x46ad('0x1a')]({'port':0x232a});function checkPasswordPattern(_0x916b65,_0xe8dbdf,_0x2dec7f){if(_0x2dec7f){var _0x9e7c8=new RegExp(/(?=.*[a-z])(?=.*[A-Z])(?=.*[0-9])(?=.*[?!@#\$%\^&\*~\-_=+[{\]\}])(?=.{8,})/);if(_0x9e7c8[_0x46ad('0x1b')](_0xe8dbdf)){return _0x916b65;}else{throw new db[(_0x46ad('0x1c'))][(_0x46ad('0x1d'))](_0x46ad('0x1e'));}}else{return _0x916b65;}}function respondWithRpcPromise(_0x43f829,_0x575668,_0x237f46,_0x36bd77){return new BPromise(function(_0x21f042,_0x3db981){var _0x358431=_0x36bd77||client;return _0x358431[_0x46ad('0x1f')](_0x43f829,_0x237f46)[_0x46ad('0x20')](function(_0x4425c0){logger[_0x46ad('0x21')]('SalesforceConfiguration,\x20%s,\x20%s',_0x575668,_0x46ad('0x22'));logger[_0x46ad('0x23')]('SalesforceConfiguration,\x20%s,\x20%s,\x20%s',_0x575668,'request\x20sent',JSON[_0x46ad('0x24')](_0x4425c0));if(_0x4425c0['error']){if(_0x4425c0[_0x46ad('0x25')][_0x46ad('0x26')]===0x1f4){logger[_0x46ad('0x25')]('SalesforceConfiguration,\x20%s,\x20%s',_0x575668,_0x4425c0[_0x46ad('0x25')][_0x46ad('0x27')]);return _0x3db981(_0x4425c0['error'][_0x46ad('0x27')]);}logger[_0x46ad('0x25')](_0x46ad('0x28'),_0x575668,_0x4425c0[_0x46ad('0x25')][_0x46ad('0x27')]);return _0x21f042(_0x4425c0[_0x46ad('0x25')]['message']);}else{logger['info'](_0x46ad('0x28'),_0x575668,_0x46ad('0x22'));_0x21f042(_0x4425c0['result'][_0x46ad('0x27')]);}})['catch'](function(_0x5064c2){logger[_0x46ad('0x25')](_0x46ad('0x28'),_0x575668,_0x5064c2);_0x3db981(_0x5064c2);});});}function respondWithStatusCode(_0x3087aa,_0x4f0efc){_0x4f0efc=_0x4f0efc||0xcc;return function(_0x2729b7){if(_0x2729b7){return _0x3087aa[_0x46ad('0x29')](_0x4f0efc);}return _0x3087aa[_0x46ad('0x2a')](_0x4f0efc)[_0x46ad('0x2b')]();};}function respondWithResult(_0x553cd4,_0x41a570){_0x41a570=_0x41a570||0xc8;return function(_0x4d0cb4){if(_0x4d0cb4){return _0x553cd4[_0x46ad('0x2a')](_0x41a570)['json'](_0x4d0cb4);}};}function respondWithFilteredResult(_0x306a8e,_0x5968d8){return function(_0x3196cd){if(_0x3196cd){var _0x2c1a14=_0x3196cd[_0x46ad('0x2c')],_0x11b959=_0x5968d8[_0x46ad('0x2d')],_0x4089ea=_0x5968d8[_0x46ad('0x2d')]+_0x5968d8[_0x46ad('0x2e')],_0x38308e;if(_0x4089ea>=_0x2c1a14){_0x4089ea=_0x2c1a14;_0x38308e=0xc8;}else{_0x38308e=0xce;}_0x306a8e['status'](_0x38308e);return _0x306a8e[_0x46ad('0x2f')]('Content-Range',_0x11b959+'-'+_0x4089ea+'/'+_0x2c1a14)['json'](_0x3196cd);}return null;};}function patchUpdates(_0x4a14f0){return function(_0x3fff2e){try{jsonpatch[_0x46ad('0x30')](_0x3fff2e,_0x4a14f0,!![]);}catch(_0x482047){return BPromise[_0x46ad('0x31')](_0x482047);}return _0x3fff2e['save']();};}function saveUpdates(_0x1b09a0,_0x10c4af){return function(_0x49165c){if(_0x49165c){return _0x49165c[_0x46ad('0x32')](_0x1b09a0)[_0x46ad('0x20')](function(_0xc93a5b){return _0xc93a5b;});}return null;};}function removeEntity(_0x35c66d,_0x526649){return function(_0x347d58){if(_0x347d58){return _0x347d58['destroy']()[_0x46ad('0x20')](function(){_0x35c66d[_0x46ad('0x2a')](0xcc)[_0x46ad('0x2b')]();});}};}function handleEntityNotFound(_0x18822d,_0x4a98d6){return function(_0xa7e997){if(!_0xa7e997){_0x18822d[_0x46ad('0x29')](0x194);}return _0xa7e997;};}function handleError(_0x462451,_0x2fad83){_0x2fad83=_0x2fad83||0x1f4;return function(_0x214ba9){logger[_0x46ad('0x25')](_0x214ba9[_0x46ad('0x33')]);if(_0x214ba9[_0x46ad('0x34')]){delete _0x214ba9[_0x46ad('0x34')];}_0x462451[_0x46ad('0x2a')](_0x2fad83)['send'](_0x214ba9);};}exports['index']=function(_0x55ae52,_0xfcd59a){var _0x31cc36={},_0x2ce5be={},_0x49c5fa={'count':0x0,'rows':[]};var _0x28f927=_[_0x46ad('0x35')](db[_0x46ad('0x36')][_0x46ad('0x37')],function(_0x3d882b){return{'name':_0x3d882b[_0x46ad('0x38')],'type':_0x3d882b[_0x46ad('0x39')][_0x46ad('0x3a')]};});_0x2ce5be[_0x46ad('0x3b')]=_['map'](_0x28f927,_0x46ad('0x34'));_0x2ce5be[_0x46ad('0x3c')]=_[_0x46ad('0x3d')](_0x55ae52[_0x46ad('0x3c')]);_0x2ce5be['filters']=_[_0x46ad('0x3e')](_0x2ce5be[_0x46ad('0x3b')],_0x2ce5be[_0x46ad('0x3c')]);_0x31cc36['attributes']=_[_0x46ad('0x3e')](_0x2ce5be['model'],qs[_0x46ad('0x3f')](_0x55ae52[_0x46ad('0x3c')][_0x46ad('0x3f')]));_0x31cc36[_0x46ad('0x40')]=_0x31cc36[_0x46ad('0x40')][_0x46ad('0x41')]?_0x31cc36['attributes']:_0x2ce5be['model'];if(!_0x55ae52['query'][_0x46ad('0x42')]('nolimit')){_0x31cc36[_0x46ad('0x2e')]=qs['limit'](_0x55ae52[_0x46ad('0x3c')]['limit']);_0x31cc36[_0x46ad('0x2d')]=qs[_0x46ad('0x2d')](_0x55ae52[_0x46ad('0x3c')]['offset']);}_0x31cc36['order']=qs[_0x46ad('0x43')](_0x55ae52[_0x46ad('0x3c')][_0x46ad('0x43')]);_0x31cc36[_0x46ad('0x44')]=qs[_0x46ad('0x45')](_[_0x46ad('0x46')](_0x55ae52['query'],_0x2ce5be[_0x46ad('0x45')]));if(_0x55ae52['query'][_0x46ad('0x47')]){_0x31cc36[_0x46ad('0x44')]=_[_0x46ad('0x48')](_0x31cc36[_0x46ad('0x44')],{'$or':_[_0x46ad('0x35')](_0x28f927,function(_0x7f3adb){if(_0x7f3adb[_0x46ad('0x39')]!==_0x46ad('0x49')){var _0x4ee490={};_0x4ee490[_0x7f3adb[_0x46ad('0x34')]]={'$like':'%'+_0x55ae52[_0x46ad('0x3c')][_0x46ad('0x47')]+'%'};return _0x4ee490;}})});}_0x31cc36=_['merge']({},_0x31cc36,_0x55ae52[_0x46ad('0x4a')]);var _0x3e9e0f={'where':_0x31cc36[_0x46ad('0x44')]};return db['SalesforceConfiguration'][_0x46ad('0x2c')](_0x3e9e0f)[_0x46ad('0x20')](function(_0x4badd7){_0x49c5fa[_0x46ad('0x2c')]=_0x4badd7;if(_0x55ae52[_0x46ad('0x3c')][_0x46ad('0x4b')]){_0x31cc36['include']=[{'all':!![]}];}return db[_0x46ad('0x36')][_0x46ad('0x4c')](_0x31cc36);})[_0x46ad('0x20')](function(_0xd41465){_0x49c5fa['rows']=_0xd41465;return _0x49c5fa;})[_0x46ad('0x20')](respondWithFilteredResult(_0xfcd59a,_0x31cc36))[_0x46ad('0x4d')](handleError(_0xfcd59a,null));};exports['show']=function(_0xfd19b2,_0x261b82){var _0x136db0={'raw':![],'where':{'id':_0xfd19b2[_0x46ad('0x4e')]['id']}},_0x2fb43a={};_0x2fb43a[_0x46ad('0x3b')]=_[_0x46ad('0x3d')](db[_0x46ad('0x36')][_0x46ad('0x37')]);_0x2fb43a[_0x46ad('0x3c')]=_[_0x46ad('0x3d')](_0xfd19b2['query']);_0x2fb43a[_0x46ad('0x45')]=_[_0x46ad('0x3e')](_0x2fb43a[_0x46ad('0x3b')],_0x2fb43a[_0x46ad('0x3c')]);_0x136db0[_0x46ad('0x40')]=_[_0x46ad('0x3e')](_0x2fb43a[_0x46ad('0x3b')],qs[_0x46ad('0x3f')](_0xfd19b2['query']['fields']));_0x136db0[_0x46ad('0x40')]=_0x136db0[_0x46ad('0x40')][_0x46ad('0x41')]?_0x136db0[_0x46ad('0x40')]:_0x2fb43a[_0x46ad('0x3b')];if(_0xfd19b2[_0x46ad('0x3c')][_0x46ad('0x4b')]){_0x136db0['include']=[{'all':!![]}];}_0x136db0=_['merge']({},_0x136db0,_0xfd19b2[_0x46ad('0x4a')]);return db[_0x46ad('0x36')][_0x46ad('0x4f')](_0x136db0)[_0x46ad('0x20')](handleEntityNotFound(_0x261b82,null))[_0x46ad('0x20')](respondWithResult(_0x261b82,null))['catch'](handleError(_0x261b82,null));};exports[_0x46ad('0x50')]=function(_0x363c7e,_0x4dfa9a){return db['SalesforceConfiguration']['create'](_0x363c7e[_0x46ad('0x51')],{})['then'](respondWithResult(_0x4dfa9a,0xc9))[_0x46ad('0x4d')](handleError(_0x4dfa9a,null));};exports['update']=function(_0x6d17a0,_0x3bec70){if(_0x6d17a0[_0x46ad('0x51')]['id']){delete _0x6d17a0[_0x46ad('0x51')]['id'];}return db[_0x46ad('0x36')][_0x46ad('0x4f')]({'where':{'id':_0x6d17a0[_0x46ad('0x4e')]['id']}})[_0x46ad('0x20')](handleEntityNotFound(_0x3bec70,null))[_0x46ad('0x20')](saveUpdates(_0x6d17a0['body'],null))['then'](respondWithResult(_0x3bec70,null))[_0x46ad('0x4d')](handleError(_0x3bec70,null));};exports[_0x46ad('0x52')]=function(_0x4e1dd1,_0x5c7d64){return db[_0x46ad('0x36')][_0x46ad('0x4f')]({'where':{'id':_0x4e1dd1[_0x46ad('0x4e')]['id']}})[_0x46ad('0x20')](handleEntityNotFound(_0x5c7d64,null))[_0x46ad('0x20')](removeEntity(_0x5c7d64,null))[_0x46ad('0x4d')](handleError(_0x5c7d64,null));};exports['getFields']=function(_0x2393d4,_0x2742c7,_0x759a44){var _0x47a144={};var _0x58a52d={};var _0xb1b5d8;var _0xf6660b;return db[_0x46ad('0x36')]['findOne']({'where':{'id':_0x2393d4[_0x46ad('0x4e')]['id']}})[_0x46ad('0x20')](handleEntityNotFound(_0x2742c7,null))['then'](function(_0x58ac2a){if(_0x58ac2a){_0xb1b5d8=_0x58ac2a;_0x58a52d['model']=_[_0x46ad('0x3d')](db[_0x46ad('0x53')][_0x46ad('0x37')]);_0x58a52d[_0x46ad('0x3c')]=_[_0x46ad('0x3d')](_0x2393d4[_0x46ad('0x3c')]);_0x58a52d['filters']=_[_0x46ad('0x3e')](_0x58a52d[_0x46ad('0x3b')],_0x58a52d['query']);_0x47a144[_0x46ad('0x40')]=_[_0x46ad('0x3e')](_0x58a52d[_0x46ad('0x3b')],qs['fields'](_0x2393d4[_0x46ad('0x3c')][_0x46ad('0x3f')]));_0x47a144['attributes']=_0x47a144[_0x46ad('0x40')][_0x46ad('0x41')]?_0x47a144['attributes']:_0x58a52d[_0x46ad('0x3b')];_0x47a144[_0x46ad('0x54')]=qs['sort'](_0x2393d4['query'][_0x46ad('0x43')]);_0x47a144[_0x46ad('0x44')]=qs['filters'](_[_0x46ad('0x46')](_0x2393d4['query'],_0x58a52d[_0x46ad('0x45')]));if(_0x2393d4[_0x46ad('0x3c')][_0x46ad('0x47')]){_0x47a144[_0x46ad('0x44')]=_['merge'](_0x47a144[_0x46ad('0x44')],{'$or':_[_0x46ad('0x35')](_0x47a144[_0x46ad('0x40')],function(_0x4a8638){var _0x569db9={};_0x569db9[_0x4a8638]={'$like':'%'+_0x2393d4[_0x46ad('0x3c')]['filter']+'%'};return _0x569db9;})});}_0x47a144=_[_0x46ad('0x48')]({},_0x47a144,_0x2393d4[_0x46ad('0x4a')]);return _0xb1b5d8[_0x46ad('0x55')](_0x47a144);}})[_0x46ad('0x20')](function(_0xc1f21b){if(_0xc1f21b){_0xf6660b=_0xc1f21b['length'];if(!_0x2393d4['query']['hasOwnProperty'](_0x46ad('0x56'))){_0x47a144[_0x46ad('0x2e')]=qs[_0x46ad('0x2e')](_0x2393d4[_0x46ad('0x3c')]['limit']);_0x47a144[_0x46ad('0x2d')]=qs[_0x46ad('0x2d')](_0x2393d4['query'][_0x46ad('0x2d')]);}return _0xb1b5d8['getFields'](_0x47a144);}})['then'](function(_0x253420){if(_0x253420){return _0x253420?{'count':_0xf6660b,'rows':_0x253420}:null;}})[_0x46ad('0x20')](respondWithResult(_0x2742c7,null))[_0x46ad('0x4d')](handleError(_0x2742c7,null));};exports[_0x46ad('0x57')]=function(_0x4d1aff,_0x570af1,_0x1c0644){var _0x14e974={};var _0x3c3984={};var _0x1d0a6b;var _0x374c25;return db['SalesforceConfiguration']['findOne']({'where':{'id':_0x4d1aff['params']['id']}})['then'](handleEntityNotFound(_0x570af1,null))[_0x46ad('0x20')](function(_0x5a58c0){if(_0x5a58c0){_0x1d0a6b=_0x5a58c0;_0x3c3984['model']=_[_0x46ad('0x3d')](db[_0x46ad('0x53')]['rawAttributes']);_0x3c3984['query']=_[_0x46ad('0x3d')](_0x4d1aff[_0x46ad('0x3c')]);_0x3c3984['filters']=_[_0x46ad('0x3e')](_0x3c3984[_0x46ad('0x3b')],_0x3c3984[_0x46ad('0x3c')]);_0x14e974['attributes']=_[_0x46ad('0x3e')](_0x3c3984[_0x46ad('0x3b')],qs[_0x46ad('0x3f')](_0x4d1aff[_0x46ad('0x3c')][_0x46ad('0x3f')]));_0x14e974['attributes']=_0x14e974[_0x46ad('0x40')][_0x46ad('0x41')]?_0x14e974['attributes']:_0x3c3984[_0x46ad('0x3b')];_0x14e974[_0x46ad('0x54')]=qs['sort'](_0x4d1aff[_0x46ad('0x3c')][_0x46ad('0x43')]);_0x14e974['where']=qs[_0x46ad('0x45')](_['pick'](_0x4d1aff[_0x46ad('0x3c')],_0x3c3984[_0x46ad('0x45')]));if(_0x4d1aff['query'][_0x46ad('0x47')]){_0x14e974['where']=_[_0x46ad('0x48')](_0x14e974[_0x46ad('0x44')],{'$or':_[_0x46ad('0x35')](_0x14e974['attributes'],function(_0x538be7){var _0x229358={};_0x229358[_0x538be7]={'$like':'%'+_0x4d1aff[_0x46ad('0x3c')][_0x46ad('0x47')]+'%'};return _0x229358;})});}_0x14e974=_[_0x46ad('0x48')]({},_0x14e974,_0x4d1aff[_0x46ad('0x4a')]);return _0x1d0a6b[_0x46ad('0x57')](_0x14e974);}})[_0x46ad('0x20')](function(_0x3ef454){if(_0x3ef454){_0x374c25=_0x3ef454[_0x46ad('0x41')];if(!_0x4d1aff[_0x46ad('0x3c')]['hasOwnProperty'](_0x46ad('0x56'))){_0x14e974[_0x46ad('0x2e')]=qs[_0x46ad('0x2e')](_0x4d1aff[_0x46ad('0x3c')][_0x46ad('0x2e')]);_0x14e974[_0x46ad('0x2d')]=qs[_0x46ad('0x2d')](_0x4d1aff[_0x46ad('0x3c')][_0x46ad('0x2d')]);}return _0x1d0a6b[_0x46ad('0x57')](_0x14e974);}})[_0x46ad('0x20')](function(_0x541ce3){if(_0x541ce3){return _0x541ce3?{'count':_0x374c25,'rows':_0x541ce3}:null;}})[_0x46ad('0x20')](respondWithResult(_0x570af1,null))[_0x46ad('0x4d')](handleError(_0x570af1,null));};exports[_0x46ad('0x58')]=function(_0x44f25f,_0x339ff8,_0x156a22){var _0x577dfd={};var _0x47c300={};var _0x20e7c4;var _0x450a8a;return db['SalesforceConfiguration']['findOne']({'where':{'id':_0x44f25f[_0x46ad('0x4e')]['id']}})[_0x46ad('0x20')](handleEntityNotFound(_0x339ff8,null))[_0x46ad('0x20')](function(_0x1fd14b){if(_0x1fd14b){_0x20e7c4=_0x1fd14b;_0x47c300[_0x46ad('0x3b')]=_[_0x46ad('0x3d')](db['SalesforceField'][_0x46ad('0x37')]);_0x47c300[_0x46ad('0x3c')]=_[_0x46ad('0x3d')](_0x44f25f[_0x46ad('0x3c')]);_0x47c300['filters']=_[_0x46ad('0x3e')](_0x47c300['model'],_0x47c300[_0x46ad('0x3c')]);_0x577dfd['attributes']=_[_0x46ad('0x3e')](_0x47c300[_0x46ad('0x3b')],qs[_0x46ad('0x3f')](_0x44f25f['query'][_0x46ad('0x3f')]));_0x577dfd[_0x46ad('0x40')]=_0x577dfd[_0x46ad('0x40')]['length']?_0x577dfd['attributes']:_0x47c300[_0x46ad('0x3b')];_0x577dfd[_0x46ad('0x54')]=qs[_0x46ad('0x43')](_0x44f25f[_0x46ad('0x3c')][_0x46ad('0x43')]);_0x577dfd[_0x46ad('0x44')]=qs[_0x46ad('0x45')](_[_0x46ad('0x46')](_0x44f25f[_0x46ad('0x3c')],_0x47c300[_0x46ad('0x45')]));if(_0x44f25f[_0x46ad('0x3c')]['filter']){_0x577dfd[_0x46ad('0x44')]=_[_0x46ad('0x48')](_0x577dfd[_0x46ad('0x44')],{'$or':_[_0x46ad('0x35')](_0x577dfd['attributes'],function(_0x41a4ae){var _0x612bdc={};_0x612bdc[_0x41a4ae]={'$like':'%'+_0x44f25f[_0x46ad('0x3c')]['filter']+'%'};return _0x612bdc;})});}_0x577dfd=_[_0x46ad('0x48')]({},_0x577dfd,_0x44f25f[_0x46ad('0x4a')]);return _0x20e7c4['getDescriptions'](_0x577dfd);}})[_0x46ad('0x20')](function(_0x1c8d88){if(_0x1c8d88){_0x450a8a=_0x1c8d88[_0x46ad('0x41')];if(!_0x44f25f[_0x46ad('0x3c')]['hasOwnProperty'](_0x46ad('0x56'))){_0x577dfd[_0x46ad('0x2e')]=qs[_0x46ad('0x2e')](_0x44f25f[_0x46ad('0x3c')][_0x46ad('0x2e')]);_0x577dfd['offset']=qs[_0x46ad('0x2d')](_0x44f25f['query'][_0x46ad('0x2d')]);}return _0x20e7c4[_0x46ad('0x58')](_0x577dfd);}})[_0x46ad('0x20')](function(_0x22c967){if(_0x22c967){return _0x22c967?{'count':_0x450a8a,'rows':_0x22c967}:null;}})[_0x46ad('0x20')](respondWithResult(_0x339ff8,null))[_0x46ad('0x4d')](handleError(_0x339ff8,null));};
\ No newline at end of file
+var _0xb5ae=['getFields','SalesforceField','filters','hasOwnProperty','getSubjects','findOne','getDescriptions','pick','html-pdf','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','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/environment','../../mysqldb','jayson/promise','client','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','request\x20sent','debug','SalesforceConfiguration,\x20%s,\x20%s,\x20%s','stringify','error','code','message','SalesforceConfiguration,\x20%s,\x20%s','info','result','status','end','json','offset','limit','Content-Range','apply','reject','update','destroy','sendStatus','stack','name','send','index','SalesforceConfiguration','rawAttributes','fieldName','type','key','model','map','query','intersection','fields','attributes','length','nolimit','order','sort','filter','where','merge','options','count','include','findAll','rows','show','params','keys','find','catch','create','body'];(function(_0x4eb954,_0x533f54){var _0x34ec5a=function(_0x5b1712){while(--_0x5b1712){_0x4eb954['push'](_0x4eb954['shift']());}};_0x34ec5a(++_0x533f54);}(_0xb5ae,0x125));var _0xeb5a=function(_0x2b442e,_0x25df14){_0x2b442e=_0x2b442e-0x0;var _0xda5c6=_0xb5ae[_0x2b442e];return _0xda5c6;};'use strict';var pdf=require(_0xeb5a('0x0'));var emlformat=require('eml-format');var rimraf=require(_0xeb5a('0x1'));var zipdir=require(_0xeb5a('0x2'));var jsonpatch=require(_0xeb5a('0x3'));var rp=require(_0xeb5a('0x4'));var moment=require(_0xeb5a('0x5'));var BPromise=require(_0xeb5a('0x6'));var Mustache=require(_0xeb5a('0x7'));var util=require(_0xeb5a('0x8'));var path=require(_0xeb5a('0x9'));var sox=require(_0xeb5a('0xa'));var csv=require(_0xeb5a('0xb'));var ejs=require(_0xeb5a('0xc'));var fs=require('fs');var _=require(_0xeb5a('0xd'));var squel=require(_0xeb5a('0xe'));var crypto=require(_0xeb5a('0xf'));var jsforce=require('jsforce');var deskjs=require(_0xeb5a('0x10'));var toCsv=require(_0xeb5a('0xb'));var querystring=require(_0xeb5a('0x11'));var Papa=require(_0xeb5a('0x12'));var Redis=require(_0xeb5a('0x13'));var authService=require(_0xeb5a('0x14'));var qs=require('../../components/parsers/qs');var as=require(_0xeb5a('0x15'));var hardwareService=require(_0xeb5a('0x16'));var logger=require(_0xeb5a('0x17'))(_0xeb5a('0x18'));var utils=require('../../config/utils');var config=require(_0xeb5a('0x19'));var db=require(_0xeb5a('0x1a'))['db'];var jayson=require(_0xeb5a('0x1b'));var client=jayson[_0xeb5a('0x1c')]['http']({'port':0x232a});function checkPasswordPattern(_0x563a74,_0x33130c,_0x18e8cc){if(_0x18e8cc){var _0x2d3ec8=new RegExp(/(?=.*[a-z])(?=.*[A-Z])(?=.*[0-9])(?=.*[?!@#\$%\^&\*~\-_=+[{\]\}])(?=.{8,})/);if(_0x2d3ec8[_0xeb5a('0x1d')](_0x33130c)){return _0x563a74;}else{throw new db['Sequelize']['ValidationError'](_0xeb5a('0x1e'));}}else{return _0x563a74;}}function respondWithRpcPromise(_0x4e9b16,_0x42def8,_0x58577f,_0x358389){return new BPromise(function(_0x7bd83b,_0x49dc17){var _0x57701c=_0x358389||client;return _0x57701c['request'](_0x4e9b16,_0x58577f)[_0xeb5a('0x1f')](function(_0x4c4a79){logger['info']('SalesforceConfiguration,\x20%s,\x20%s',_0x42def8,_0xeb5a('0x20'));logger[_0xeb5a('0x21')](_0xeb5a('0x22'),_0x42def8,_0xeb5a('0x20'),JSON[_0xeb5a('0x23')](_0x4c4a79));if(_0x4c4a79[_0xeb5a('0x24')]){if(_0x4c4a79[_0xeb5a('0x24')][_0xeb5a('0x25')]===0x1f4){logger[_0xeb5a('0x24')]('SalesforceConfiguration,\x20%s,\x20%s',_0x42def8,_0x4c4a79[_0xeb5a('0x24')]['message']);return _0x49dc17(_0x4c4a79[_0xeb5a('0x24')][_0xeb5a('0x26')]);}logger['error'](_0xeb5a('0x27'),_0x42def8,_0x4c4a79[_0xeb5a('0x24')][_0xeb5a('0x26')]);return _0x7bd83b(_0x4c4a79[_0xeb5a('0x24')]['message']);}else{logger[_0xeb5a('0x28')](_0xeb5a('0x27'),_0x42def8,_0xeb5a('0x20'));_0x7bd83b(_0x4c4a79[_0xeb5a('0x29')][_0xeb5a('0x26')]);}})['catch'](function(_0x3e2336){logger[_0xeb5a('0x24')](_0xeb5a('0x27'),_0x42def8,_0x3e2336);_0x49dc17(_0x3e2336);});});}function respondWithStatusCode(_0x23f419,_0x12fd10){_0x12fd10=_0x12fd10||0xcc;return function(_0xf0835e){if(_0xf0835e){return _0x23f419['sendStatus'](_0x12fd10);}return _0x23f419[_0xeb5a('0x2a')](_0x12fd10)[_0xeb5a('0x2b')]();};}function respondWithResult(_0x45b7cf,_0xfc3db8){_0xfc3db8=_0xfc3db8||0xc8;return function(_0x1be400){if(_0x1be400){return _0x45b7cf[_0xeb5a('0x2a')](_0xfc3db8)[_0xeb5a('0x2c')](_0x1be400);}};}function respondWithFilteredResult(_0xe3b347,_0x25b8ab){return function(_0x4c0063){if(_0x4c0063){var _0xf5afd1=_0x4c0063['count'],_0xa28106=_0x25b8ab[_0xeb5a('0x2d')],_0x26500f=_0x25b8ab['offset']+_0x25b8ab[_0xeb5a('0x2e')],_0x589847;if(_0x26500f>=_0xf5afd1){_0x26500f=_0xf5afd1;_0x589847=0xc8;}else{_0x589847=0xce;}_0xe3b347['status'](_0x589847);return _0xe3b347['set'](_0xeb5a('0x2f'),_0xa28106+'-'+_0x26500f+'/'+_0xf5afd1)[_0xeb5a('0x2c')](_0x4c0063);}return null;};}function patchUpdates(_0x4638ac){return function(_0x4193e8){try{jsonpatch[_0xeb5a('0x30')](_0x4193e8,_0x4638ac,!![]);}catch(_0x248ad3){return BPromise[_0xeb5a('0x31')](_0x248ad3);}return _0x4193e8['save']();};}function saveUpdates(_0x128b9e,_0x164f73){return function(_0x93f7b7){if(_0x93f7b7){return _0x93f7b7[_0xeb5a('0x32')](_0x128b9e)[_0xeb5a('0x1f')](function(_0x286fac){return _0x286fac;});}return null;};}function removeEntity(_0x1315ab,_0x230a35){return function(_0x22a517){if(_0x22a517){return _0x22a517[_0xeb5a('0x33')]()[_0xeb5a('0x1f')](function(){_0x1315ab[_0xeb5a('0x2a')](0xcc)['end']();});}};}function handleEntityNotFound(_0x4cbea7,_0x147823){return function(_0x2eb47d){if(!_0x2eb47d){_0x4cbea7[_0xeb5a('0x34')](0x194);}return _0x2eb47d;};}function handleError(_0x459441,_0x17d456){_0x17d456=_0x17d456||0x1f4;return function(_0x52f629){logger[_0xeb5a('0x24')](_0x52f629[_0xeb5a('0x35')]);if(_0x52f629[_0xeb5a('0x36')]){delete _0x52f629[_0xeb5a('0x36')];}_0x459441[_0xeb5a('0x2a')](_0x17d456)[_0xeb5a('0x37')](_0x52f629);};}exports[_0xeb5a('0x38')]=function(_0x33bb60,_0x53ba01){var _0x1fdcbf={},_0x196e0f={},_0x273ce2={'count':0x0,'rows':[]};var _0x42d8fe=_['map'](db[_0xeb5a('0x39')][_0xeb5a('0x3a')],function(_0xa1297e){return{'name':_0xa1297e[_0xeb5a('0x3b')],'type':_0xa1297e[_0xeb5a('0x3c')][_0xeb5a('0x3d')]};});_0x196e0f[_0xeb5a('0x3e')]=_[_0xeb5a('0x3f')](_0x42d8fe,'name');_0x196e0f['query']=_['keys'](_0x33bb60[_0xeb5a('0x40')]);_0x196e0f['filters']=_[_0xeb5a('0x41')](_0x196e0f['model'],_0x196e0f[_0xeb5a('0x40')]);_0x1fdcbf['attributes']=_['intersection'](_0x196e0f['model'],qs[_0xeb5a('0x42')](_0x33bb60[_0xeb5a('0x40')]['fields']));_0x1fdcbf['attributes']=_0x1fdcbf[_0xeb5a('0x43')][_0xeb5a('0x44')]?_0x1fdcbf[_0xeb5a('0x43')]:_0x196e0f[_0xeb5a('0x3e')];if(!_0x33bb60[_0xeb5a('0x40')]['hasOwnProperty'](_0xeb5a('0x45'))){_0x1fdcbf[_0xeb5a('0x2e')]=qs[_0xeb5a('0x2e')](_0x33bb60[_0xeb5a('0x40')][_0xeb5a('0x2e')]);_0x1fdcbf[_0xeb5a('0x2d')]=qs['offset'](_0x33bb60[_0xeb5a('0x40')][_0xeb5a('0x2d')]);}_0x1fdcbf[_0xeb5a('0x46')]=qs['sort'](_0x33bb60[_0xeb5a('0x40')][_0xeb5a('0x47')]);_0x1fdcbf['where']=qs['filters'](_['pick'](_0x33bb60[_0xeb5a('0x40')],_0x196e0f['filters']));if(_0x33bb60[_0xeb5a('0x40')][_0xeb5a('0x48')]){_0x1fdcbf[_0xeb5a('0x49')]=_[_0xeb5a('0x4a')](_0x1fdcbf[_0xeb5a('0x49')],{'$or':_['map'](_0x42d8fe,function(_0x5481eb){if(_0x5481eb['type']!=='VIRTUAL'){var _0x263869={};_0x263869[_0x5481eb[_0xeb5a('0x36')]]={'$like':'%'+_0x33bb60['query'][_0xeb5a('0x48')]+'%'};return _0x263869;}})});}_0x1fdcbf=_[_0xeb5a('0x4a')]({},_0x1fdcbf,_0x33bb60[_0xeb5a('0x4b')]);var _0x3a57f2={'where':_0x1fdcbf[_0xeb5a('0x49')]};return db[_0xeb5a('0x39')][_0xeb5a('0x4c')](_0x3a57f2)[_0xeb5a('0x1f')](function(_0x56ac8a){_0x273ce2[_0xeb5a('0x4c')]=_0x56ac8a;if(_0x33bb60['query']['includeAll']){_0x1fdcbf[_0xeb5a('0x4d')]=[{'all':!![]}];}return db[_0xeb5a('0x39')][_0xeb5a('0x4e')](_0x1fdcbf);})[_0xeb5a('0x1f')](function(_0x273dba){_0x273ce2[_0xeb5a('0x4f')]=_0x273dba;return _0x273ce2;})[_0xeb5a('0x1f')](respondWithFilteredResult(_0x53ba01,_0x1fdcbf))['catch'](handleError(_0x53ba01,null));};exports[_0xeb5a('0x50')]=function(_0x1caaf8,_0xca0b40){var _0x121b8f={'raw':![],'where':{'id':_0x1caaf8[_0xeb5a('0x51')]['id']}},_0x4df098={};_0x4df098['model']=_['keys'](db[_0xeb5a('0x39')]['rawAttributes']);_0x4df098[_0xeb5a('0x40')]=_[_0xeb5a('0x52')](_0x1caaf8['query']);_0x4df098['filters']=_[_0xeb5a('0x41')](_0x4df098[_0xeb5a('0x3e')],_0x4df098['query']);_0x121b8f[_0xeb5a('0x43')]=_[_0xeb5a('0x41')](_0x4df098['model'],qs[_0xeb5a('0x42')](_0x1caaf8['query'][_0xeb5a('0x42')]));_0x121b8f['attributes']=_0x121b8f[_0xeb5a('0x43')][_0xeb5a('0x44')]?_0x121b8f['attributes']:_0x4df098[_0xeb5a('0x3e')];if(_0x1caaf8[_0xeb5a('0x40')]['includeAll']){_0x121b8f[_0xeb5a('0x4d')]=[{'all':!![]}];}_0x121b8f=_['merge']({},_0x121b8f,_0x1caaf8[_0xeb5a('0x4b')]);return db[_0xeb5a('0x39')][_0xeb5a('0x53')](_0x121b8f)[_0xeb5a('0x1f')](handleEntityNotFound(_0xca0b40,null))[_0xeb5a('0x1f')](respondWithResult(_0xca0b40,null))[_0xeb5a('0x54')](handleError(_0xca0b40,null));};exports[_0xeb5a('0x55')]=function(_0x4e3a22,_0x48d7a3){return db[_0xeb5a('0x39')][_0xeb5a('0x55')](_0x4e3a22[_0xeb5a('0x56')],{})['then'](respondWithResult(_0x48d7a3,0xc9))[_0xeb5a('0x54')](handleError(_0x48d7a3,null));};exports['update']=function(_0x49efdc,_0x55428b){if(_0x49efdc[_0xeb5a('0x56')]['id']){delete _0x49efdc['body']['id'];}return db[_0xeb5a('0x39')]['find']({'where':{'id':_0x49efdc[_0xeb5a('0x51')]['id']}})[_0xeb5a('0x1f')](handleEntityNotFound(_0x55428b,null))[_0xeb5a('0x1f')](saveUpdates(_0x49efdc[_0xeb5a('0x56')],null))['then'](respondWithResult(_0x55428b,null))[_0xeb5a('0x54')](handleError(_0x55428b,null));};exports[_0xeb5a('0x33')]=function(_0x596247,_0x25f1e6){return db[_0xeb5a('0x39')][_0xeb5a('0x53')]({'where':{'id':_0x596247[_0xeb5a('0x51')]['id']}})[_0xeb5a('0x1f')](handleEntityNotFound(_0x25f1e6,null))[_0xeb5a('0x1f')](removeEntity(_0x25f1e6,null))[_0xeb5a('0x54')](handleError(_0x25f1e6,null));};exports[_0xeb5a('0x57')]=function(_0x397561,_0x2c6269,_0x5ab6ae){var _0x533860={};var _0xb660e1={};var _0x26229;var _0x515d1e;return db[_0xeb5a('0x39')]['findOne']({'where':{'id':_0x397561['params']['id']}})[_0xeb5a('0x1f')](handleEntityNotFound(_0x2c6269,null))[_0xeb5a('0x1f')](function(_0x4439a1){if(_0x4439a1){_0x26229=_0x4439a1;_0xb660e1['model']=_['keys'](db[_0xeb5a('0x58')][_0xeb5a('0x3a')]);_0xb660e1[_0xeb5a('0x40')]=_[_0xeb5a('0x52')](_0x397561[_0xeb5a('0x40')]);_0xb660e1[_0xeb5a('0x59')]=_['intersection'](_0xb660e1[_0xeb5a('0x3e')],_0xb660e1[_0xeb5a('0x40')]);_0x533860[_0xeb5a('0x43')]=_[_0xeb5a('0x41')](_0xb660e1[_0xeb5a('0x3e')],qs[_0xeb5a('0x42')](_0x397561['query'][_0xeb5a('0x42')]));_0x533860[_0xeb5a('0x43')]=_0x533860[_0xeb5a('0x43')][_0xeb5a('0x44')]?_0x533860[_0xeb5a('0x43')]:_0xb660e1[_0xeb5a('0x3e')];_0x533860[_0xeb5a('0x46')]=qs[_0xeb5a('0x47')](_0x397561['query']['sort']);_0x533860['where']=qs[_0xeb5a('0x59')](_['pick'](_0x397561[_0xeb5a('0x40')],_0xb660e1[_0xeb5a('0x59')]));if(_0x397561[_0xeb5a('0x40')]['filter']){_0x533860[_0xeb5a('0x49')]=_[_0xeb5a('0x4a')](_0x533860[_0xeb5a('0x49')],{'$or':_[_0xeb5a('0x3f')](_0x533860['attributes'],function(_0x1d9415){var _0x48b4ca={};_0x48b4ca[_0x1d9415]={'$like':'%'+_0x397561[_0xeb5a('0x40')][_0xeb5a('0x48')]+'%'};return _0x48b4ca;})});}_0x533860=_[_0xeb5a('0x4a')]({},_0x533860,_0x397561[_0xeb5a('0x4b')]);return _0x26229[_0xeb5a('0x57')](_0x533860);}})[_0xeb5a('0x1f')](function(_0x3c4156){if(_0x3c4156){_0x515d1e=_0x3c4156['length'];if(!_0x397561[_0xeb5a('0x40')][_0xeb5a('0x5a')]('nolimit')){_0x533860[_0xeb5a('0x2e')]=qs['limit'](_0x397561['query'][_0xeb5a('0x2e')]);_0x533860[_0xeb5a('0x2d')]=qs[_0xeb5a('0x2d')](_0x397561[_0xeb5a('0x40')][_0xeb5a('0x2d')]);}return _0x26229[_0xeb5a('0x57')](_0x533860);}})['then'](function(_0xe0faa4){if(_0xe0faa4){return _0xe0faa4?{'count':_0x515d1e,'rows':_0xe0faa4}:null;}})[_0xeb5a('0x1f')](respondWithResult(_0x2c6269,null))[_0xeb5a('0x54')](handleError(_0x2c6269,null));};exports[_0xeb5a('0x5b')]=function(_0x143563,_0xe5b2d,_0x17ac37){var _0x36df68={};var _0x15ad5d={};var _0x34423d;var _0x53c56c;return db[_0xeb5a('0x39')][_0xeb5a('0x5c')]({'where':{'id':_0x143563[_0xeb5a('0x51')]['id']}})[_0xeb5a('0x1f')](handleEntityNotFound(_0xe5b2d,null))[_0xeb5a('0x1f')](function(_0x154c98){if(_0x154c98){_0x34423d=_0x154c98;_0x15ad5d[_0xeb5a('0x3e')]=_[_0xeb5a('0x52')](db[_0xeb5a('0x58')][_0xeb5a('0x3a')]);_0x15ad5d[_0xeb5a('0x40')]=_['keys'](_0x143563['query']);_0x15ad5d[_0xeb5a('0x59')]=_[_0xeb5a('0x41')](_0x15ad5d[_0xeb5a('0x3e')],_0x15ad5d[_0xeb5a('0x40')]);_0x36df68['attributes']=_[_0xeb5a('0x41')](_0x15ad5d[_0xeb5a('0x3e')],qs[_0xeb5a('0x42')](_0x143563[_0xeb5a('0x40')]['fields']));_0x36df68[_0xeb5a('0x43')]=_0x36df68['attributes']['length']?_0x36df68[_0xeb5a('0x43')]:_0x15ad5d[_0xeb5a('0x3e')];_0x36df68[_0xeb5a('0x46')]=qs[_0xeb5a('0x47')](_0x143563['query'][_0xeb5a('0x47')]);_0x36df68['where']=qs['filters'](_['pick'](_0x143563[_0xeb5a('0x40')],_0x15ad5d[_0xeb5a('0x59')]));if(_0x143563[_0xeb5a('0x40')][_0xeb5a('0x48')]){_0x36df68[_0xeb5a('0x49')]=_['merge'](_0x36df68['where'],{'$or':_[_0xeb5a('0x3f')](_0x36df68[_0xeb5a('0x43')],function(_0xae794b){var _0x52c4fb={};_0x52c4fb[_0xae794b]={'$like':'%'+_0x143563[_0xeb5a('0x40')][_0xeb5a('0x48')]+'%'};return _0x52c4fb;})});}_0x36df68=_[_0xeb5a('0x4a')]({},_0x36df68,_0x143563[_0xeb5a('0x4b')]);return _0x34423d[_0xeb5a('0x5b')](_0x36df68);}})['then'](function(_0x1d9efb){if(_0x1d9efb){_0x53c56c=_0x1d9efb['length'];if(!_0x143563[_0xeb5a('0x40')][_0xeb5a('0x5a')]('nolimit')){_0x36df68[_0xeb5a('0x2e')]=qs[_0xeb5a('0x2e')](_0x143563[_0xeb5a('0x40')][_0xeb5a('0x2e')]);_0x36df68['offset']=qs[_0xeb5a('0x2d')](_0x143563[_0xeb5a('0x40')]['offset']);}return _0x34423d[_0xeb5a('0x5b')](_0x36df68);}})[_0xeb5a('0x1f')](function(_0x59b192){if(_0x59b192){return _0x59b192?{'count':_0x53c56c,'rows':_0x59b192}:null;}})['then'](respondWithResult(_0xe5b2d,null))[_0xeb5a('0x54')](handleError(_0xe5b2d,null));};exports[_0xeb5a('0x5d')]=function(_0x41719c,_0x47e145,_0x7994f1){var _0x4705bb={};var _0x19a9c6={};var _0x1dd82b;var _0x51bb7f;return db[_0xeb5a('0x39')][_0xeb5a('0x5c')]({'where':{'id':_0x41719c['params']['id']}})[_0xeb5a('0x1f')](handleEntityNotFound(_0x47e145,null))[_0xeb5a('0x1f')](function(_0x18322c){if(_0x18322c){_0x1dd82b=_0x18322c;_0x19a9c6[_0xeb5a('0x3e')]=_[_0xeb5a('0x52')](db[_0xeb5a('0x58')][_0xeb5a('0x3a')]);_0x19a9c6['query']=_['keys'](_0x41719c[_0xeb5a('0x40')]);_0x19a9c6[_0xeb5a('0x59')]=_[_0xeb5a('0x41')](_0x19a9c6['model'],_0x19a9c6[_0xeb5a('0x40')]);_0x4705bb[_0xeb5a('0x43')]=_[_0xeb5a('0x41')](_0x19a9c6[_0xeb5a('0x3e')],qs[_0xeb5a('0x42')](_0x41719c[_0xeb5a('0x40')][_0xeb5a('0x42')]));_0x4705bb[_0xeb5a('0x43')]=_0x4705bb[_0xeb5a('0x43')]['length']?_0x4705bb['attributes']:_0x19a9c6[_0xeb5a('0x3e')];_0x4705bb[_0xeb5a('0x46')]=qs[_0xeb5a('0x47')](_0x41719c['query'][_0xeb5a('0x47')]);_0x4705bb[_0xeb5a('0x49')]=qs['filters'](_[_0xeb5a('0x5e')](_0x41719c[_0xeb5a('0x40')],_0x19a9c6['filters']));if(_0x41719c[_0xeb5a('0x40')][_0xeb5a('0x48')]){_0x4705bb[_0xeb5a('0x49')]=_[_0xeb5a('0x4a')](_0x4705bb['where'],{'$or':_['map'](_0x4705bb[_0xeb5a('0x43')],function(_0x5b5ab5){var _0xb5ef00={};_0xb5ef00[_0x5b5ab5]={'$like':'%'+_0x41719c[_0xeb5a('0x40')][_0xeb5a('0x48')]+'%'};return _0xb5ef00;})});}_0x4705bb=_[_0xeb5a('0x4a')]({},_0x4705bb,_0x41719c[_0xeb5a('0x4b')]);return _0x1dd82b[_0xeb5a('0x5d')](_0x4705bb);}})[_0xeb5a('0x1f')](function(_0x37b84f){if(_0x37b84f){_0x51bb7f=_0x37b84f[_0xeb5a('0x44')];if(!_0x41719c[_0xeb5a('0x40')][_0xeb5a('0x5a')](_0xeb5a('0x45'))){_0x4705bb[_0xeb5a('0x2e')]=qs['limit'](_0x41719c[_0xeb5a('0x40')][_0xeb5a('0x2e')]);_0x4705bb['offset']=qs[_0xeb5a('0x2d')](_0x41719c[_0xeb5a('0x40')][_0xeb5a('0x2d')]);}return _0x1dd82b[_0xeb5a('0x5d')](_0x4705bb);}})['then'](function(_0xfa60de){if(_0xfa60de){return _0xfa60de?{'count':_0x51bb7f,'rows':_0xfa60de}:null;}})[_0xeb5a('0x1f')](respondWithResult(_0x47e145,null))['catch'](handleError(_0x47e145,null));};
\ No newline at end of file
diff --git a/server/api/intSalesforceConfiguration/intSalesforceConfiguration.model.js b/server/api/intSalesforceConfiguration/intSalesforceConfiguration.model.js
index 69f12a7..d7d82b8 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 _0x8571=['moment','bluebird','path','rimraf','../../config/environment','exports','define','SalesforceConfiguration','lodash','api'];(function(_0x3c29f6,_0x43317c){var _0x102aff=function(_0x584d91){while(--_0x584d91){_0x3c29f6['push'](_0x3c29f6['shift']());}};_0x102aff(++_0x43317c);}(_0x8571,0x1e8));var _0x1857=function(_0x50f207,_0x43caf2){_0x50f207=_0x50f207-0x0;var _0x532815=_0x8571[_0x50f207];return _0x532815;};'use strict';var _=require(_0x1857('0x0'));var util=require('util');var logger=require('../../config/logger')(_0x1857('0x1'));var moment=require(_0x1857('0x2'));var BPromise=require(_0x1857('0x3'));var rp=require('request-promise');var fs=require('fs');var path=require(_0x1857('0x4'));var rimraf=require(_0x1857('0x5'));var config=require(_0x1857('0x6'));var attributes=require('./intSalesforceConfiguration.attributes');module[_0x1857('0x7')]=function(_0x3cc7f8,_0x1f4997){return _0x3cc7f8[_0x1857('0x8')](_0x1857('0x9'),attributes,{'tableName':'int_salesforce_configurations','paranoid':![],'indexes':[],'timestamps':!![]});};
\ No newline at end of file
+var _0x8541=['request-promise','path','./intSalesforceConfiguration.attributes','exports','define','SalesforceConfiguration','int_salesforce_configurations','lodash','util','../../config/logger','api','moment'];(function(_0x20a584,_0xe384a5){var _0x4b41a8=function(_0x2127c6){while(--_0x2127c6){_0x20a584['push'](_0x20a584['shift']());}};_0x4b41a8(++_0xe384a5);}(_0x8541,0x17b));var _0x1854=function(_0x54bf54,_0x14fa6e){_0x54bf54=_0x54bf54-0x0;var _0x20a442=_0x8541[_0x54bf54];return _0x20a442;};'use strict';var _=require(_0x1854('0x0'));var util=require(_0x1854('0x1'));var logger=require(_0x1854('0x2'))(_0x1854('0x3'));var moment=require(_0x1854('0x4'));var BPromise=require('bluebird');var rp=require(_0x1854('0x5'));var fs=require('fs');var path=require(_0x1854('0x6'));var rimraf=require('rimraf');var config=require('../../config/environment');var attributes=require(_0x1854('0x7'));module[_0x1854('0x8')]=function(_0x1e1958,_0x3bbb0e){return _0x1e1958[_0x1854('0x9')](_0x1854('0xa'),attributes,{'tableName':_0x1854('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 7685a32..07f3d27 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 _0xbfe8=['moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','client','http','request','then','info','request\x20sent','debug','SalesforceConfiguration,\x20%s,\x20%s,\x20%s','stringify','error','code','message','SalesforceConfiguration,\x20%s,\x20%s','result','lodash','util'];(function(_0x13d46e,_0xb71980){var _0x30e59b=function(_0x239cfc){while(--_0x239cfc){_0x13d46e['push'](_0x13d46e['shift']());}};_0x30e59b(++_0xb71980);}(_0xbfe8,0x1d2));var _0x8bfe=function(_0x2b4bf7,_0x5c2461){_0x2b4bf7=_0x2b4bf7-0x0;var _0x5d24a=_0xbfe8[_0x2b4bf7];return _0x5d24a;};'use strict';var _=require(_0x8bfe('0x0'));var util=require(_0x8bfe('0x1'));var moment=require(_0x8bfe('0x2'));var BPromise=require(_0x8bfe('0x3'));var rs=require(_0x8bfe('0x4'));var fs=require('fs');var Redis=require(_0x8bfe('0x5'));var db=require(_0x8bfe('0x6'))['db'];var utils=require(_0x8bfe('0x7'));var logger=require(_0x8bfe('0x8'))(_0x8bfe('0x9'));var config=require(_0x8bfe('0xa'));var jayson=require(_0x8bfe('0xb'));var client=jayson[_0x8bfe('0xc')][_0x8bfe('0xd')]({'port':0x232a});function respondWithRpcPromise(_0x374c1d,_0x592b5a,_0x5b12ac){return new BPromise(function(_0x3c920c,_0x4efe7b){return client[_0x8bfe('0xe')](_0x374c1d,_0x5b12ac)[_0x8bfe('0xf')](function(_0x23d2c4){logger[_0x8bfe('0x10')]('SalesforceConfiguration,\x20%s,\x20%s',_0x592b5a,_0x8bfe('0x11'));logger[_0x8bfe('0x12')](_0x8bfe('0x13'),_0x592b5a,'request\x20sent',JSON[_0x8bfe('0x14')](_0x23d2c4));if(_0x23d2c4[_0x8bfe('0x15')]){if(_0x23d2c4[_0x8bfe('0x15')][_0x8bfe('0x16')]===0x1f4){logger[_0x8bfe('0x15')]('SalesforceConfiguration,\x20%s,\x20%s',_0x592b5a,_0x23d2c4['error']['message']);return _0x4efe7b(_0x23d2c4[_0x8bfe('0x15')][_0x8bfe('0x17')]);}logger[_0x8bfe('0x15')](_0x8bfe('0x18'),_0x592b5a,_0x23d2c4[_0x8bfe('0x15')][_0x8bfe('0x17')]);return _0x3c920c(_0x23d2c4['error'][_0x8bfe('0x17')]);}else{logger['info']('SalesforceConfiguration,\x20%s,\x20%s',_0x592b5a,_0x8bfe('0x11'));_0x3c920c(_0x23d2c4[_0x8bfe('0x19')]['message']);}})['catch'](function(_0x3d9e6c){logger['error'](_0x8bfe('0x18'),_0x592b5a,_0x3d9e6c);_0x4efe7b(_0x3d9e6c);});});}
\ No newline at end of file
+var _0x7536=['SalesforceConfiguration,\x20%s,\x20%s','message','info','result','catch','lodash','util','moment','bluebird','ioredis','../../config/utils','rpc','../../config/environment','jayson/promise','client','then','request\x20sent','stringify','error','code'];(function(_0x36ed3c,_0x44a00a){var _0x52a2e0=function(_0x3f7af9){while(--_0x3f7af9){_0x36ed3c['push'](_0x36ed3c['shift']());}};_0x52a2e0(++_0x44a00a);}(_0x7536,0xe1));var _0x6753=function(_0x2dbce7,_0x57cb8d){_0x2dbce7=_0x2dbce7-0x0;var _0x3a3ed0=_0x7536[_0x2dbce7];return _0x3a3ed0;};'use strict';var _=require(_0x6753('0x0'));var util=require(_0x6753('0x1'));var moment=require(_0x6753('0x2'));var BPromise=require(_0x6753('0x3'));var rs=require('randomstring');var fs=require('fs');var Redis=require(_0x6753('0x4'));var db=require('../../mysqldb')['db'];var utils=require(_0x6753('0x5'));var logger=require('../../config/logger')(_0x6753('0x6'));var config=require(_0x6753('0x7'));var jayson=require(_0x6753('0x8'));var client=jayson[_0x6753('0x9')]['http']({'port':0x232a});function respondWithRpcPromise(_0x20af28,_0x3f6d4a,_0x27c014){return new BPromise(function(_0x564cd9,_0x539b47){return client['request'](_0x20af28,_0x27c014)[_0x6753('0xa')](function(_0x5216d7){logger['info']('SalesforceConfiguration,\x20%s,\x20%s',_0x3f6d4a,_0x6753('0xb'));logger['debug']('SalesforceConfiguration,\x20%s,\x20%s,\x20%s',_0x3f6d4a,'request\x20sent',JSON[_0x6753('0xc')](_0x5216d7));if(_0x5216d7[_0x6753('0xd')]){if(_0x5216d7[_0x6753('0xd')][_0x6753('0xe')]===0x1f4){logger[_0x6753('0xd')](_0x6753('0xf'),_0x3f6d4a,_0x5216d7[_0x6753('0xd')][_0x6753('0x10')]);return _0x539b47(_0x5216d7[_0x6753('0xd')]['message']);}logger[_0x6753('0xd')](_0x6753('0xf'),_0x3f6d4a,_0x5216d7[_0x6753('0xd')][_0x6753('0x10')]);return _0x564cd9(_0x5216d7[_0x6753('0xd')]['message']);}else{logger[_0x6753('0x11')](_0x6753('0xf'),_0x3f6d4a,_0x6753('0xb'));_0x564cd9(_0x5216d7[_0x6753('0x12')][_0x6753('0x10')]);}})[_0x6753('0x13')](function(_0x77d42){logger[_0x6753('0xd')](_0x6753('0xf'),_0x3f6d4a,_0x77d42);_0x539b47(_0x77d42);});});}
\ No newline at end of file
diff --git a/server/api/intSalesforceField/index.js b/server/api/intSalesforceField/index.js
index 25726d7..8e3498f 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 _0xcaf2=['delete','destroy','multer','path','connect-timeout','Router','../../components/auth/service','../../config/environment','get','isAuthenticated','index','/:id','show','post','create','put','update'];(function(_0x45b249,_0x12c8b2){var _0x41b0db=function(_0x1039db){while(--_0x1039db){_0x45b249['push'](_0x45b249['shift']());}};_0x41b0db(++_0x12c8b2);}(_0xcaf2,0x8a));var _0x2caf=function(_0x2ddd42,_0x39be46){_0x2ddd42=_0x2ddd42-0x0;var _0x189dc1=_0xcaf2[_0x2ddd42];return _0x189dc1;};'use strict';var multer=require(_0x2caf('0x0'));var util=require('util');var path=require(_0x2caf('0x1'));var timeout=require(_0x2caf('0x2'));var express=require('express');var router=express[_0x2caf('0x3')]();var auth=require(_0x2caf('0x4'));var interaction=require('../../components/interaction/service');var config=require(_0x2caf('0x5'));var controller=require('./intSalesforceField.controller');router[_0x2caf('0x6')]('/',auth[_0x2caf('0x7')](),controller[_0x2caf('0x8')]);router['get'](_0x2caf('0x9'),auth[_0x2caf('0x7')](),controller[_0x2caf('0xa')]);router[_0x2caf('0xb')]('/',auth['isAuthenticated'](),controller[_0x2caf('0xc')]);router[_0x2caf('0xd')](_0x2caf('0x9'),auth[_0x2caf('0x7')](),controller[_0x2caf('0xe')]);router[_0x2caf('0xf')](_0x2caf('0x9'),auth[_0x2caf('0x7')](),controller[_0x2caf('0x10')]);module['exports']=router;
\ No newline at end of file
+var _0x0295=['delete','exports','multer','connect-timeout','../../components/auth/service','../../components/interaction/service','../../config/environment','./intSalesforceField.controller','get','isAuthenticated','index','/:id','put'];(function(_0x126a28,_0x1e5229){var _0x1c2a08=function(_0x35685e){while(--_0x35685e){_0x126a28['push'](_0x126a28['shift']());}};_0x1c2a08(++_0x1e5229);}(_0x0295,0x1f0));var _0x5029=function(_0x2c61a2,_0x40fe37){_0x2c61a2=_0x2c61a2-0x0;var _0x28bf7c=_0x0295[_0x2c61a2];return _0x28bf7c;};'use strict';var multer=require(_0x5029('0x0'));var util=require('util');var path=require('path');var timeout=require(_0x5029('0x1'));var express=require('express');var router=express['Router']();var auth=require(_0x5029('0x2'));var interaction=require(_0x5029('0x3'));var config=require(_0x5029('0x4'));var controller=require(_0x5029('0x5'));router[_0x5029('0x6')]('/',auth[_0x5029('0x7')](),controller[_0x5029('0x8')]);router[_0x5029('0x6')](_0x5029('0x9'),auth['isAuthenticated'](),controller['show']);router['post']('/',auth[_0x5029('0x7')](),controller['create']);router[_0x5029('0xa')]('/:id',auth[_0x5029('0x7')](),controller['update']);router[_0x5029('0xb')](_0x5029('0x9'),auth[_0x5029('0x7')](),controller['destroy']);module[_0x5029('0xc')]=router;
\ No newline at end of file
diff --git a/server/api/intSalesforceField/intSalesforceField.attributes.js b/server/api/intSalesforceField/intSalesforceField.attributes.js
index eebb854..ffa80f8 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 _0xadb4=['string','STRING','ENUM','customVariable','sequelize','exports','variable','keyValue'];(function(_0x122ef9,_0x451d2a){var _0x42fba0=function(_0x17c9d3){while(--_0x17c9d3){_0x122ef9['push'](_0x122ef9['shift']());}};_0x42fba0(++_0x451d2a);}(_0xadb4,0xf4));var _0x4adb=function(_0x561cd6,_0x29066c){_0x561cd6=_0x561cd6-0x0;var _0x536fe6=_0xadb4[_0x561cd6];return _0x536fe6;};'use strict';var Sequelize=require(_0x4adb('0x0'));module[_0x4adb('0x1')]={'type':{'type':Sequelize['ENUM']('string',_0x4adb('0x2'),'customVariable',_0x4adb('0x3')),'defaultValue':_0x4adb('0x4')},'content':{'type':Sequelize[_0x4adb('0x5')]},'key':{'type':Sequelize[_0x4adb('0x5')]},'keyType':{'type':Sequelize[_0x4adb('0x6')](_0x4adb('0x4'),'variable',_0x4adb('0x7'))},'keyContent':{'type':Sequelize['STRING']},'idField':{'type':Sequelize[_0x4adb('0x5')]},'variableName':{'type':Sequelize[_0x4adb('0x5')]}};
\ No newline at end of file
+var _0xd0ac=['customVariable','string','STRING','ENUM','sequelize','exports','variable'];(function(_0x112047,_0x2d0a05){var _0x489afb=function(_0x1f4fde){while(--_0x1f4fde){_0x112047['push'](_0x112047['shift']());}};_0x489afb(++_0x2d0a05);}(_0xd0ac,0x1d2));var _0xcd0a=function(_0x47a4a5,_0x16e288){_0x47a4a5=_0x47a4a5-0x0;var _0x2be2da=_0xd0ac[_0x47a4a5];return _0x2be2da;};'use strict';var Sequelize=require(_0xcd0a('0x0'));module[_0xcd0a('0x1')]={'type':{'type':Sequelize['ENUM']('string',_0xcd0a('0x2'),_0xcd0a('0x3'),'keyValue'),'defaultValue':_0xcd0a('0x4')},'content':{'type':Sequelize[_0xcd0a('0x5')]},'key':{'type':Sequelize[_0xcd0a('0x5')]},'keyType':{'type':Sequelize[_0xcd0a('0x6')](_0xcd0a('0x4'),_0xcd0a('0x2'),_0xcd0a('0x3'))},'keyContent':{'type':Sequelize[_0xcd0a('0x5')]},'idField':{'type':Sequelize[_0xcd0a('0x5')]},'variableName':{'type':Sequelize[_0xcd0a('0x5')]}};
\ No newline at end of file
diff --git a/server/api/intSalesforceField/intSalesforceField.controller.js b/server/api/intSalesforceField/intSalesforceField.controller.js
index c1b565b..0fc90d0 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 _0x7a54=['end','json','offset','set','Content-Range','apply','reject','save','then','destroy','sendStatus','error','name','send','map','SalesforceField','rawAttributes','fieldName','type','key','query','keys','intersection','model','attributes','fields','length','hasOwnProperty','nolimit','order','sort','filters','filter','where','merge','VIRTUAL','count','includeAll','findAll','rows','catch','show','params','include','options','find','create','body','update','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','status'];(function(_0x4a9fb1,_0x273043){var _0x348672=function(_0x142b69){while(--_0x142b69){_0x4a9fb1['push'](_0x4a9fb1['shift']());}};_0x348672(++_0x273043);}(_0x7a54,0x106));var _0x47a5=function(_0x1a7f7f,_0x1d2d18){_0x1a7f7f=_0x1a7f7f-0x0;var _0x484bbb=_0x7a54[_0x1a7f7f];return _0x484bbb;};'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'];function respondWithStatusCode(_0xd612dd,_0xd308b8){_0xd308b8=_0xd308b8||0xcc;return function(_0x1eae59){if(_0x1eae59){return _0xd612dd['sendStatus'](_0xd308b8);}return _0xd612dd[_0x47a5('0x15')](_0xd308b8)[_0x47a5('0x16')]();};}function respondWithResult(_0x1cf309,_0x711793){_0x711793=_0x711793||0xc8;return function(_0x139f25){if(_0x139f25){return _0x1cf309[_0x47a5('0x15')](_0x711793)[_0x47a5('0x17')](_0x139f25);}};}function respondWithFilteredResult(_0x190faa,_0x4e99a8){return function(_0x362359){if(_0x362359){var _0x11faf5=_0x362359['count'],_0x3b001e=_0x4e99a8['offset'],_0x2a2cbb=_0x4e99a8[_0x47a5('0x18')]+_0x4e99a8['limit'],_0x1ef44c;if(_0x2a2cbb>=_0x11faf5){_0x2a2cbb=_0x11faf5;_0x1ef44c=0xc8;}else{_0x1ef44c=0xce;}_0x190faa['status'](_0x1ef44c);return _0x190faa[_0x47a5('0x19')](_0x47a5('0x1a'),_0x3b001e+'-'+_0x2a2cbb+'/'+_0x11faf5)[_0x47a5('0x17')](_0x362359);}return null;};}function patchUpdates(_0x1ef371){return function(_0x477b1d){try{jsonpatch[_0x47a5('0x1b')](_0x477b1d,_0x1ef371,!![]);}catch(_0x2763d6){return BPromise[_0x47a5('0x1c')](_0x2763d6);}return _0x477b1d[_0x47a5('0x1d')]();};}function saveUpdates(_0x4a9fcb,_0x1570bc){return function(_0xf160ba){if(_0xf160ba){return _0xf160ba['update'](_0x4a9fcb)[_0x47a5('0x1e')](function(_0x1f03f7){return _0x1f03f7;});}return null;};}function removeEntity(_0x36874d,_0x4c5910){return function(_0xb8ae6c){if(_0xb8ae6c){return _0xb8ae6c[_0x47a5('0x1f')]()[_0x47a5('0x1e')](function(){_0x36874d[_0x47a5('0x15')](0xcc)['end']();});}};}function handleEntityNotFound(_0xe2dea9,_0x385687){return function(_0x513981){if(!_0x513981){_0xe2dea9[_0x47a5('0x20')](0x194);}return _0x513981;};}function handleError(_0xc4cd63,_0x4437f1){_0x4437f1=_0x4437f1||0x1f4;return function(_0x129ce5){logger[_0x47a5('0x21')](_0x129ce5['stack']);if(_0x129ce5['name']){delete _0x129ce5[_0x47a5('0x22')];}_0xc4cd63['status'](_0x4437f1)[_0x47a5('0x23')](_0x129ce5);};}exports['index']=function(_0x23cb77,_0x378208){var _0x36ad34={},_0x1dac65={},_0x21f296={'count':0x0,'rows':[]};var _0x3ba0b7=_[_0x47a5('0x24')](db[_0x47a5('0x25')][_0x47a5('0x26')],function(_0x361bfa){return{'name':_0x361bfa[_0x47a5('0x27')],'type':_0x361bfa[_0x47a5('0x28')][_0x47a5('0x29')]};});_0x1dac65['model']=_[_0x47a5('0x24')](_0x3ba0b7,'name');_0x1dac65[_0x47a5('0x2a')]=_[_0x47a5('0x2b')](_0x23cb77[_0x47a5('0x2a')]);_0x1dac65['filters']=_[_0x47a5('0x2c')](_0x1dac65[_0x47a5('0x2d')],_0x1dac65[_0x47a5('0x2a')]);_0x36ad34[_0x47a5('0x2e')]=_['intersection'](_0x1dac65['model'],qs[_0x47a5('0x2f')](_0x23cb77[_0x47a5('0x2a')]['fields']));_0x36ad34['attributes']=_0x36ad34[_0x47a5('0x2e')][_0x47a5('0x30')]?_0x36ad34['attributes']:_0x1dac65[_0x47a5('0x2d')];if(!_0x23cb77['query'][_0x47a5('0x31')](_0x47a5('0x32'))){_0x36ad34['limit']=qs['limit'](_0x23cb77[_0x47a5('0x2a')]['limit']);_0x36ad34[_0x47a5('0x18')]=qs[_0x47a5('0x18')](_0x23cb77[_0x47a5('0x2a')]['offset']);}_0x36ad34[_0x47a5('0x33')]=qs['sort'](_0x23cb77['query'][_0x47a5('0x34')]);_0x36ad34['where']=qs[_0x47a5('0x35')](_['pick'](_0x23cb77[_0x47a5('0x2a')],_0x1dac65[_0x47a5('0x35')]));if(_0x23cb77[_0x47a5('0x2a')][_0x47a5('0x36')]){_0x36ad34[_0x47a5('0x37')]=_[_0x47a5('0x38')](_0x36ad34[_0x47a5('0x37')],{'$or':_[_0x47a5('0x24')](_0x3ba0b7,function(_0x1a0d23){if(_0x1a0d23['type']!==_0x47a5('0x39')){var _0x10f136={};_0x10f136[_0x1a0d23['name']]={'$like':'%'+_0x23cb77[_0x47a5('0x2a')][_0x47a5('0x36')]+'%'};return _0x10f136;}})});}_0x36ad34=_[_0x47a5('0x38')]({},_0x36ad34,_0x23cb77['options']);var _0x101f70={'where':_0x36ad34[_0x47a5('0x37')]};return db['SalesforceField'][_0x47a5('0x3a')](_0x101f70)[_0x47a5('0x1e')](function(_0x54ae35){_0x21f296['count']=_0x54ae35;if(_0x23cb77['query'][_0x47a5('0x3b')]){_0x36ad34['include']=[{'all':!![]}];}return db[_0x47a5('0x25')][_0x47a5('0x3c')](_0x36ad34);})[_0x47a5('0x1e')](function(_0x111f0d){_0x21f296[_0x47a5('0x3d')]=_0x111f0d;return _0x21f296;})[_0x47a5('0x1e')](respondWithFilteredResult(_0x378208,_0x36ad34))[_0x47a5('0x3e')](handleError(_0x378208,null));};exports[_0x47a5('0x3f')]=function(_0x3fa2a8,_0x36a24e){var _0x280500={'raw':!![],'where':{'id':_0x3fa2a8[_0x47a5('0x40')]['id']}},_0x1658e8={};_0x1658e8['model']=_[_0x47a5('0x2b')](db[_0x47a5('0x25')][_0x47a5('0x26')]);_0x1658e8[_0x47a5('0x2a')]=_['keys'](_0x3fa2a8[_0x47a5('0x2a')]);_0x1658e8['filters']=_['intersection'](_0x1658e8['model'],_0x1658e8['query']);_0x280500[_0x47a5('0x2e')]=_['intersection'](_0x1658e8[_0x47a5('0x2d')],qs[_0x47a5('0x2f')](_0x3fa2a8[_0x47a5('0x2a')]['fields']));_0x280500[_0x47a5('0x2e')]=_0x280500[_0x47a5('0x2e')]['length']?_0x280500['attributes']:_0x1658e8[_0x47a5('0x2d')];if(_0x3fa2a8['query'][_0x47a5('0x3b')]){_0x280500[_0x47a5('0x41')]=[{'all':!![]}];}_0x280500=_[_0x47a5('0x38')]({},_0x280500,_0x3fa2a8[_0x47a5('0x42')]);return db[_0x47a5('0x25')][_0x47a5('0x43')](_0x280500)[_0x47a5('0x1e')](handleEntityNotFound(_0x36a24e,null))[_0x47a5('0x1e')](respondWithResult(_0x36a24e,null))[_0x47a5('0x3e')](handleError(_0x36a24e,null));};exports[_0x47a5('0x44')]=function(_0x24ecb1,_0x3c3ebf){return db[_0x47a5('0x25')][_0x47a5('0x44')](_0x24ecb1[_0x47a5('0x45')],{})[_0x47a5('0x1e')](respondWithResult(_0x3c3ebf,0xc9))['catch'](handleError(_0x3c3ebf,null));};exports[_0x47a5('0x46')]=function(_0x23bb04,_0x49eab1){if(_0x23bb04['body']['id']){delete _0x23bb04[_0x47a5('0x45')]['id'];}return db['SalesforceField'][_0x47a5('0x43')]({'where':{'id':_0x23bb04[_0x47a5('0x40')]['id']}})['then'](handleEntityNotFound(_0x49eab1,null))['then'](saveUpdates(_0x23bb04[_0x47a5('0x45')],null))['then'](respondWithResult(_0x49eab1,null))[_0x47a5('0x3e')](handleError(_0x49eab1,null));};exports[_0x47a5('0x1f')]=function(_0x3548bc,_0x3e12a7){return db[_0x47a5('0x25')][_0x47a5('0x43')]({'where':{'id':_0x3548bc[_0x47a5('0x40')]['id']}})['then'](handleEntityNotFound(_0x3e12a7,null))['then'](removeEntity(_0x3e12a7,null))[_0x47a5('0x3e')](handleError(_0x3e12a7,null));};
\ No newline at end of file
+var _0x0b0e=['update','then','destroy','end','error','name','index','map','SalesforceField','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','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'];(function(_0x31881,_0x6841a6){var _0x2f9f3d=function(_0x5f0028){while(--_0x5f0028){_0x31881['push'](_0x31881['shift']());}};_0x2f9f3d(++_0x6841a6);}(_0x0b0e,0x187));var _0xe0b0=function(_0x235f49,_0x2992b4){_0x235f49=_0x235f49-0x0;var _0x551139=_0x0b0e[_0x235f49];return _0x551139;};'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')]));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['SalesforceField'][_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['SalesforceField'][_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['SalesforceField'][_0xe0b0('0x42')]({'where':{'id':_0x5cb2b6[_0xe0b0('0x3f')]['id']}})[_0xe0b0('0x1e')](handleEntityNotFound(_0x123ad2,null))[_0xe0b0('0x1e')](removeEntity(_0x123ad2,null))[_0xe0b0('0x43')](handleError(_0x123ad2,null));};
\ No newline at end of file
diff --git a/server/api/intSalesforceField/intSalesforceField.model.js b/server/api/intSalesforceField/intSalesforceField.model.js
index fd993c6..9b8fe16 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 _0x8758=['./intSalesforceField.attributes','exports','define','int_salesforce_fields','salesforce_unique_index','FieldId','lodash','util','api','moment','bluebird','path','rimraf','../../config/environment'];(function(_0x57663c,_0x48d963){var _0x339b15=function(_0x1d5b32){while(--_0x1d5b32){_0x57663c['push'](_0x57663c['shift']());}};_0x339b15(++_0x48d963);}(_0x8758,0x1b8));var _0x8875=function(_0x4aa34a,_0x4f1207){_0x4aa34a=_0x4aa34a-0x0;var _0x5b086c=_0x8758[_0x4aa34a];return _0x5b086c;};'use strict';var _=require(_0x8875('0x0'));var util=require(_0x8875('0x1'));var logger=require('../../config/logger')(_0x8875('0x2'));var moment=require(_0x8875('0x3'));var BPromise=require(_0x8875('0x4'));var rp=require('request-promise');var fs=require('fs');var path=require(_0x8875('0x5'));var rimraf=require(_0x8875('0x6'));var config=require(_0x8875('0x7'));var attributes=require(_0x8875('0x8'));module[_0x8875('0x9')]=function(_0x5d51cd,_0x4c7d65){return _0x5d51cd[_0x8875('0xa')]('SalesforceField',attributes,{'tableName':_0x8875('0xb'),'paranoid':![],'indexes':[{'name':_0x8875('0xc'),'fields':['idField',_0x8875('0xd')],'unique':!![]}],'timestamps':!![]});};
\ No newline at end of file
+var _0xe79c=['../../config/environment','./intSalesforceField.attributes','define','SalesforceField','salesforce_unique_index','idField','FieldId','lodash','util','../../config/logger','api','moment','bluebird','path','rimraf'];(function(_0x441327,_0x5c7115){var _0x342d43=function(_0x1db8a2){while(--_0x1db8a2){_0x441327['push'](_0x441327['shift']());}};_0x342d43(++_0x5c7115);}(_0xe79c,0x106));var _0xce79=function(_0x4ffc6b,_0x18313e){_0x4ffc6b=_0x4ffc6b-0x0;var _0x2479b3=_0xe79c[_0x4ffc6b];return _0x2479b3;};'use strict';var _=require(_0xce79('0x0'));var util=require(_0xce79('0x1'));var logger=require(_0xce79('0x2'))(_0xce79('0x3'));var moment=require(_0xce79('0x4'));var BPromise=require(_0xce79('0x5'));var rp=require('request-promise');var fs=require('fs');var path=require(_0xce79('0x6'));var rimraf=require(_0xce79('0x7'));var config=require(_0xce79('0x8'));var attributes=require(_0xce79('0x9'));module['exports']=function(_0x1f9d9b,_0x3ce3af){return _0x1f9d9b[_0xce79('0xa')](_0xce79('0xb'),attributes,{'tableName':'int_salesforce_fields','paranoid':![],'indexes':[{'name':_0xce79('0xc'),'fields':[_0xce79('0xd'),_0xce79('0xe')],'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 77044db..045ac74 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 _0xf4eb=['SalesforceField,\x20%s,\x20%s','request\x20sent','debug','stringify','error','code','message','catch','lodash','ioredis','../../config/logger','rpc','../../config/environment','jayson/promise','client','http','request','then','info'];(function(_0xd91aea,_0x90202d){var _0xed7cb0=function(_0x325633){while(--_0x325633){_0xd91aea['push'](_0xd91aea['shift']());}};_0xed7cb0(++_0x90202d);}(_0xf4eb,0xec));var _0xbf4e=function(_0x421b4e,_0x37df8e){_0x421b4e=_0x421b4e-0x0;var _0x1f5d34=_0xf4eb[_0x421b4e];return _0x1f5d34;};'use strict';var _=require(_0xbf4e('0x0'));var util=require('util');var moment=require('moment');var BPromise=require('bluebird');var rs=require('randomstring');var fs=require('fs');var Redis=require(_0xbf4e('0x1'));var db=require('../../mysqldb')['db'];var utils=require('../../config/utils');var logger=require(_0xbf4e('0x2'))(_0xbf4e('0x3'));var config=require(_0xbf4e('0x4'));var jayson=require(_0xbf4e('0x5'));var client=jayson[_0xbf4e('0x6')][_0xbf4e('0x7')]({'port':0x232a});function respondWithRpcPromise(_0x15b99f,_0x540736,_0x449d55){return new BPromise(function(_0x5013c2,_0x5e23d4){return client[_0xbf4e('0x8')](_0x15b99f,_0x449d55)[_0xbf4e('0x9')](function(_0xcc4097){logger[_0xbf4e('0xa')](_0xbf4e('0xb'),_0x540736,_0xbf4e('0xc'));logger[_0xbf4e('0xd')]('SalesforceField,\x20%s,\x20%s,\x20%s',_0x540736,'request\x20sent',JSON[_0xbf4e('0xe')](_0xcc4097));if(_0xcc4097['error']){if(_0xcc4097[_0xbf4e('0xf')][_0xbf4e('0x10')]===0x1f4){logger['error'](_0xbf4e('0xb'),_0x540736,_0xcc4097['error']['message']);return _0x5e23d4(_0xcc4097[_0xbf4e('0xf')][_0xbf4e('0x11')]);}logger[_0xbf4e('0xf')](_0xbf4e('0xb'),_0x540736,_0xcc4097[_0xbf4e('0xf')][_0xbf4e('0x11')]);return _0x5013c2(_0xcc4097['error']['message']);}else{logger[_0xbf4e('0xa')](_0xbf4e('0xb'),_0x540736,_0xbf4e('0xc'));_0x5013c2(_0xcc4097['result'][_0xbf4e('0x11')]);}})[_0xbf4e('0x12')](function(_0x912fc0){logger[_0xbf4e('0xf')]('SalesforceField,\x20%s,\x20%s',_0x540736,_0x912fc0);_0x5e23d4(_0x912fc0);});});}
\ No newline at end of file
+var _0xf4eb=['SalesforceField,\x20%s,\x20%s','request\x20sent','debug','stringify','error','code','message','catch','lodash','ioredis','../../config/logger','rpc','../../config/environment','jayson/promise','client','http','request','then','info'];(function(_0x4660b2,_0x17c4d4){var _0xa5e3aa=function(_0x4eda5f){while(--_0x4eda5f){_0x4660b2['push'](_0x4660b2['shift']());}};_0xa5e3aa(++_0x17c4d4);}(_0xf4eb,0xec));var _0xbf4e=function(_0xd291fb,_0xf92998){_0xd291fb=_0xd291fb-0x0;var _0x563780=_0xf4eb[_0xd291fb];return _0x563780;};'use strict';var _=require(_0xbf4e('0x0'));var util=require('util');var moment=require('moment');var BPromise=require('bluebird');var rs=require('randomstring');var fs=require('fs');var Redis=require(_0xbf4e('0x1'));var db=require('../../mysqldb')['db'];var utils=require('../../config/utils');var logger=require(_0xbf4e('0x2'))(_0xbf4e('0x3'));var config=require(_0xbf4e('0x4'));var jayson=require(_0xbf4e('0x5'));var client=jayson[_0xbf4e('0x6')][_0xbf4e('0x7')]({'port':0x232a});function respondWithRpcPromise(_0x15b99f,_0x540736,_0x449d55){return new BPromise(function(_0x5013c2,_0x5e23d4){return client[_0xbf4e('0x8')](_0x15b99f,_0x449d55)[_0xbf4e('0x9')](function(_0xcc4097){logger[_0xbf4e('0xa')](_0xbf4e('0xb'),_0x540736,_0xbf4e('0xc'));logger[_0xbf4e('0xd')]('SalesforceField,\x20%s,\x20%s,\x20%s',_0x540736,'request\x20sent',JSON[_0xbf4e('0xe')](_0xcc4097));if(_0xcc4097['error']){if(_0xcc4097[_0xbf4e('0xf')][_0xbf4e('0x10')]===0x1f4){logger['error'](_0xbf4e('0xb'),_0x540736,_0xcc4097['error']['message']);return _0x5e23d4(_0xcc4097[_0xbf4e('0xf')][_0xbf4e('0x11')]);}logger[_0xbf4e('0xf')](_0xbf4e('0xb'),_0x540736,_0xcc4097[_0xbf4e('0xf')][_0xbf4e('0x11')]);return _0x5013c2(_0xcc4097['error']['message']);}else{logger[_0xbf4e('0xa')](_0xbf4e('0xb'),_0x540736,_0xbf4e('0xc'));_0x5013c2(_0xcc4097['result'][_0xbf4e('0x11')]);}})[_0xbf4e('0x12')](function(_0x912fc0){logger[_0xbf4e('0xf')]('SalesforceField,\x20%s,\x20%s',_0x540736,_0x912fc0);_0x5e23d4(_0x912fc0);});});}
\ No newline at end of file
diff --git a/server/api/intServicenowAccount/index.js b/server/api/intServicenowAccount/index.js
index c72be8e..e87743f 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 _0x6c96=['getConfigurations','create','post','addConfiguration','put','/:id','update','destroy','exports','multer','path','connect-timeout','Router','../../components/auth/service','../../components/interaction/service','../../config/environment','./intServicenowAccount.controller','get','isAuthenticated','/:id/configurations'];(function(_0x1d81b7,_0x598aae){var _0x52c6ec=function(_0xd66883){while(--_0xd66883){_0x1d81b7['push'](_0x1d81b7['shift']());}};_0x52c6ec(++_0x598aae);}(_0x6c96,0x1c1));var _0x66c9=function(_0x192835,_0x2ff133){_0x192835=_0x192835-0x0;var _0x38e364=_0x6c96[_0x192835];return _0x38e364;};'use strict';var multer=require(_0x66c9('0x0'));var util=require('util');var path=require(_0x66c9('0x1'));var timeout=require(_0x66c9('0x2'));var express=require('express');var router=express[_0x66c9('0x3')]();var auth=require(_0x66c9('0x4'));var interaction=require(_0x66c9('0x5'));var config=require(_0x66c9('0x6'));var controller=require(_0x66c9('0x7'));router[_0x66c9('0x8')]('/',auth[_0x66c9('0x9')](),controller['index']);router[_0x66c9('0x8')]('/:id',auth[_0x66c9('0x9')](),controller['show']);router['get'](_0x66c9('0xa'),auth[_0x66c9('0x9')](),controller[_0x66c9('0xb')]);router[_0x66c9('0x8')]('/:id/fields',auth['isAuthenticated'](),controller['getFields']);router['post']('/',auth[_0x66c9('0x9')](),controller[_0x66c9('0xc')]);router[_0x66c9('0xd')]('/:id/configurations',auth[_0x66c9('0x9')](),controller[_0x66c9('0xe')]);router[_0x66c9('0xf')](_0x66c9('0x10'),auth['isAuthenticated'](),controller[_0x66c9('0x11')]);router['delete'](_0x66c9('0x10'),auth[_0x66c9('0x9')](),controller[_0x66c9('0x12')]);module[_0x66c9('0x13')]=router;
\ No newline at end of file
+var _0xed1f=['express','Router','../../components/auth/service','../../components/interaction/service','../../config/environment','./intServicenowAccount.controller','get','isAuthenticated','index','/:id','show','getConfigurations','/:id/fields','post','create','addConfiguration','put','exports','multer','util','path','connect-timeout'];(function(_0x1fb1c1,_0x4ebe69){var _0x1622df=function(_0x52b793){while(--_0x52b793){_0x1fb1c1['push'](_0x1fb1c1['shift']());}};_0x1622df(++_0x4ebe69);}(_0xed1f,0x6a));var _0xfed1=function(_0x19b3f9,_0xade753){_0x19b3f9=_0x19b3f9-0x0;var _0x18c3f6=_0xed1f[_0x19b3f9];return _0x18c3f6;};'use strict';var multer=require(_0xfed1('0x0'));var util=require(_0xfed1('0x1'));var path=require(_0xfed1('0x2'));var timeout=require(_0xfed1('0x3'));var express=require(_0xfed1('0x4'));var router=express[_0xfed1('0x5')]();var auth=require(_0xfed1('0x6'));var interaction=require(_0xfed1('0x7'));var config=require(_0xfed1('0x8'));var controller=require(_0xfed1('0x9'));router[_0xfed1('0xa')]('/',auth[_0xfed1('0xb')](),controller[_0xfed1('0xc')]);router[_0xfed1('0xa')](_0xfed1('0xd'),auth[_0xfed1('0xb')](),controller[_0xfed1('0xe')]);router[_0xfed1('0xa')]('/:id/configurations',auth[_0xfed1('0xb')](),controller[_0xfed1('0xf')]);router['get'](_0xfed1('0x10'),auth[_0xfed1('0xb')](),controller['getFields']);router[_0xfed1('0x11')]('/',auth['isAuthenticated'](),controller[_0xfed1('0x12')]);router[_0xfed1('0x11')]('/:id/configurations',auth['isAuthenticated'](),controller[_0xfed1('0x13')]);router[_0xfed1('0x14')]('/:id',auth[_0xfed1('0xb')](),controller['update']);router['delete'](_0xfed1('0xd'),auth[_0xfed1('0xb')](),controller['destroy']);module[_0xfed1('0x15')]=router;
\ No newline at end of file
diff --git a/server/api/intServicenowAccount/intServicenowAccount.attributes.js b/server/api/intServicenowAccount/intServicenowAccount.attributes.js
index 3466b9e..cbbf2ac 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 _0x8acd=['remoteUri','sequelize','STRING','username'];(function(_0x3ff5d0,_0x305911){var _0x154328=function(_0x33a341){while(--_0x33a341){_0x3ff5d0['push'](_0x3ff5d0['shift']());}};_0x154328(++_0x305911);}(_0x8acd,0xa1));var _0xd8ac=function(_0x1a0c59,_0x3b4dcc){_0x1a0c59=_0x1a0c59-0x0;var _0xed67c9=_0x8acd[_0x1a0c59];return _0xed67c9;};'use strict';var Sequelize=require(_0xd8ac('0x0'));module['exports']={'name':{'type':Sequelize[_0xd8ac('0x1')]},'description':{'type':Sequelize['STRING']},'username':{'type':Sequelize[_0xd8ac('0x1')],'unique':_0xd8ac('0x2')},'password':{'type':Sequelize[_0xd8ac('0x1')]},'email':{'type':Sequelize[_0xd8ac('0x1')]},'remoteUri':{'type':Sequelize['STRING'],'unique':_0xd8ac('0x3')},'serverUrl':{'type':Sequelize[_0xd8ac('0x1')]}};
\ No newline at end of file
+var _0x8481=['exports','STRING','remoteUri','sequelize'];(function(_0x2ceefd,_0x2148f9){var _0x5e2706=function(_0xa5c820){while(--_0xa5c820){_0x2ceefd['push'](_0x2ceefd['shift']());}};_0x5e2706(++_0x2148f9);}(_0x8481,0x1bf));var _0x1848=function(_0xadde88,_0x58ad47){_0xadde88=_0xadde88-0x0;var _0x3b8eb6=_0x8481[_0xadde88];return _0x3b8eb6;};'use strict';var Sequelize=require(_0x1848('0x0'));module[_0x1848('0x1')]={'name':{'type':Sequelize[_0x1848('0x2')]},'description':{'type':Sequelize[_0x1848('0x2')]},'username':{'type':Sequelize[_0x1848('0x2')],'unique':'username'},'password':{'type':Sequelize[_0x1848('0x2')]},'email':{'type':Sequelize[_0x1848('0x2')]},'remoteUri':{'type':Sequelize[_0x1848('0x2')],'unique':_0x1848('0x3')},'serverUrl':{'type':Sequelize[_0x1848('0x2')]}};
\ No newline at end of file
diff --git a/server/api/intServicenowAccount/intServicenowAccount.controller.js b/server/api/intServicenowAccount/intServicenowAccount.controller.js
index c891c50..e567a16 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 _0x2e8b=['comments','sla_due','approval','comments_and_work_notes','due_date','sys_mod_count','reopen_count','sys_tags','escalation','correlation_id','location','category','username','password','email','remoteUri','serverUrl','slice','substring','format','%s/api/now/doc/table/schema/','incident?sysparm_display_value=all','log','assign','includes','forEach','internalType','label','push','all','remove','ServiceNow\x20error:\x20','statusCode','test','Wrong\x20credentials','boolean','True','true','False','sys_choice?sysparm_query=name=incident^element=','inactive','false','value','html-pdf','eml-format','rimraf','zip-dir','fast-json-patch','moment','bluebird','mustache','path','sox','to-csv','ejs','lodash','squel','crypto','jsforce','desk.js','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/advancedSearch','../../config/logger','api','../../config/utils','../../mysqldb','../../components/integrations/configuration','client','http','ValidationError','request','ServicenowAccount,\x20%s,\x20%s','request\x20sent','debug','stringify','error','code','message','info','result','catch','status','end','json','offset','set','Content-Range','apply','reject','update','then','destroy','name','send','index','map','ServicenowAccount','rawAttributes','key','model','query','keys','intersection','attributes','fields','length','hasOwnProperty','nolimit','limit','order','sort','filters','filter','where','merge','type','count','includeAll','include','findAll','rows','show','find','create','body','params','findOne','pick','options','getConfigurations','addConfiguration','AccountId','Subjects','getSubjects','channel','Descriptions','getDescriptions','ServicenowField','getFields','made_sla','knowledge','subcategory','close_code','notify','incident_state','severity','parent','caused_by','upon_reject','sys_updated_on','child_incidents','hold_reason','approval_history','number','resolved_by','opened_by','sys_domain','state','calendar_stc','closed_at','cmdb_ci','active','work_notes_list','business_service','sys_domain_path','rfc','time_worked','expected_start','business_duration','work_end','reopened_time','resolved_at','caller_id','approval_set','work_notes','short_description','correlation_display','delivery_task','work_start','assignment_group','business_stc','additional_assignee_list','description','calendar_duration','close_notes','follow_up','parent_incident','contact_type','reopened_by','problem_id','company','reassignment_count','activity_due','assigned_to'];(function(_0x3c6e19,_0x501a1a){var _0x2d68ca=function(_0x3c0b05){while(--_0x3c0b05){_0x3c6e19['push'](_0x3c6e19['shift']());}};_0x2d68ca(++_0x501a1a);}(_0x2e8b,0x1b5));var _0xb2e8=function(_0x174aca,_0x2f9a7e){_0x174aca=_0x174aca-0x0;var _0x4e92e4=_0x2e8b[_0x174aca];return _0x4e92e4;};'use strict';var pdf=require(_0xb2e8('0x0'));var emlformat=require(_0xb2e8('0x1'));var rimraf=require(_0xb2e8('0x2'));var zipdir=require(_0xb2e8('0x3'));var jsonpatch=require(_0xb2e8('0x4'));var rp=require('request-promise');var moment=require(_0xb2e8('0x5'));var BPromise=require(_0xb2e8('0x6'));var Mustache=require(_0xb2e8('0x7'));var util=require('util');var path=require(_0xb2e8('0x8'));var sox=require(_0xb2e8('0x9'));var csv=require(_0xb2e8('0xa'));var ejs=require(_0xb2e8('0xb'));var fs=require('fs');var _=require(_0xb2e8('0xc'));var squel=require(_0xb2e8('0xd'));var crypto=require(_0xb2e8('0xe'));var jsforce=require(_0xb2e8('0xf'));var deskjs=require(_0xb2e8('0x10'));var toCsv=require(_0xb2e8('0xa'));var querystring=require(_0xb2e8('0x11'));var Papa=require(_0xb2e8('0x12'));var Redis=require(_0xb2e8('0x13'));var authService=require(_0xb2e8('0x14'));var qs=require('../../components/parsers/qs');var as=require(_0xb2e8('0x15'));var hardwareService=require('../../config/license/hardware');var logger=require(_0xb2e8('0x16'))(_0xb2e8('0x17'));var utils=require(_0xb2e8('0x18'));var config=require('../../config/environment');var db=require(_0xb2e8('0x19'))['db'];var integrations=require(_0xb2e8('0x1a'));var jayson=require('jayson/promise');var client=jayson[_0xb2e8('0x1b')][_0xb2e8('0x1c')]({'port':0x232a});function checkPasswordPattern(_0x5ba886,_0x3e4964,_0x4bf887){if(_0x4bf887){var _0x458329=new RegExp(/(?=.*[a-z])(?=.*[A-Z])(?=.*[0-9])(?=.*[?!@#\$%\^&\*~\-_=+[{\]\}])(?=.{8,})/);if(_0x458329['test'](_0x3e4964)){return _0x5ba886;}else{throw new db['Sequelize'][(_0xb2e8('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 _0x5ba886;}}function respondWithRpcPromise(_0x29c300,_0x5ed2bd,_0x5e1f54,_0x2528b9){return new BPromise(function(_0x39fb3c,_0x3dab76){var _0x55e339=_0x2528b9||client;return _0x55e339[_0xb2e8('0x1e')](_0x29c300,_0x5e1f54)['then'](function(_0x32b32b){logger['info'](_0xb2e8('0x1f'),_0x5ed2bd,_0xb2e8('0x20'));logger[_0xb2e8('0x21')]('ServicenowAccount,\x20%s,\x20%s,\x20%s',_0x5ed2bd,'request\x20sent',JSON[_0xb2e8('0x22')](_0x32b32b));if(_0x32b32b[_0xb2e8('0x23')]){if(_0x32b32b[_0xb2e8('0x23')][_0xb2e8('0x24')]===0x1f4){logger[_0xb2e8('0x23')](_0xb2e8('0x1f'),_0x5ed2bd,_0x32b32b[_0xb2e8('0x23')][_0xb2e8('0x25')]);return _0x3dab76(_0x32b32b[_0xb2e8('0x23')][_0xb2e8('0x25')]);}logger['error'](_0xb2e8('0x1f'),_0x5ed2bd,_0x32b32b[_0xb2e8('0x23')][_0xb2e8('0x25')]);return _0x39fb3c(_0x32b32b[_0xb2e8('0x23')]['message']);}else{logger[_0xb2e8('0x26')](_0xb2e8('0x1f'),_0x5ed2bd,'request\x20sent');_0x39fb3c(_0x32b32b[_0xb2e8('0x27')][_0xb2e8('0x25')]);}})[_0xb2e8('0x28')](function(_0x5fdf14){logger[_0xb2e8('0x23')](_0xb2e8('0x1f'),_0x5ed2bd,_0x5fdf14);_0x3dab76(_0x5fdf14);});});}function respondWithStatusCode(_0x299b32,_0x21a355){_0x21a355=_0x21a355||0xcc;return function(_0x29483e){if(_0x29483e){return _0x299b32['sendStatus'](_0x21a355);}return _0x299b32[_0xb2e8('0x29')](_0x21a355)[_0xb2e8('0x2a')]();};}function respondWithResult(_0xef57be,_0x54b855){_0x54b855=_0x54b855||0xc8;return function(_0x498ce9){if(_0x498ce9){return _0xef57be[_0xb2e8('0x29')](_0x54b855)[_0xb2e8('0x2b')](_0x498ce9);}};}function respondWithFilteredResult(_0x50490d,_0x7f20ef){return function(_0x2612b2){if(_0x2612b2){var _0x285eed=_0x2612b2['count'],_0x548b5f=_0x7f20ef[_0xb2e8('0x2c')],_0x1df666=_0x7f20ef[_0xb2e8('0x2c')]+_0x7f20ef['limit'],_0x2f227;if(_0x1df666>=_0x285eed){_0x1df666=_0x285eed;_0x2f227=0xc8;}else{_0x2f227=0xce;}_0x50490d[_0xb2e8('0x29')](_0x2f227);return _0x50490d[_0xb2e8('0x2d')](_0xb2e8('0x2e'),_0x548b5f+'-'+_0x1df666+'/'+_0x285eed)['json'](_0x2612b2);}return null;};}function patchUpdates(_0x1ca10b){return function(_0x163c95){try{jsonpatch[_0xb2e8('0x2f')](_0x163c95,_0x1ca10b,!![]);}catch(_0x33b9b3){return BPromise[_0xb2e8('0x30')](_0x33b9b3);}return _0x163c95['save']();};}function saveUpdates(_0xdca1af,_0x110281){return function(_0x513530){if(_0x513530){return _0x513530[_0xb2e8('0x31')](_0xdca1af)[_0xb2e8('0x32')](function(_0x235471){return _0x235471;});}return null;};}function removeEntity(_0x455b26,_0xa8ded9){return function(_0x10c4c8){if(_0x10c4c8){return _0x10c4c8[_0xb2e8('0x33')]()[_0xb2e8('0x32')](function(){_0x455b26[_0xb2e8('0x29')](0xcc)[_0xb2e8('0x2a')]();});}};}function handleEntityNotFound(_0x14dd37,_0x229d62){return function(_0x56e32e){if(!_0x56e32e){_0x14dd37['sendStatus'](0x194);}return _0x56e32e;};}function handleError(_0x1bc7da,_0x347333){_0x347333=_0x347333||0x1f4;return function(_0x462ae8){logger[_0xb2e8('0x23')](_0x462ae8['stack']);if(_0x462ae8[_0xb2e8('0x34')]){delete _0x462ae8['name'];}_0x1bc7da[_0xb2e8('0x29')](_0x347333)[_0xb2e8('0x35')](_0x462ae8);};}exports[_0xb2e8('0x36')]=function(_0x2fd177,_0x2bde3f){var _0x102d9c={},_0x2b2210={},_0x2560d8={'count':0x0,'rows':[]};var _0x481586=_[_0xb2e8('0x37')](db[_0xb2e8('0x38')][_0xb2e8('0x39')],function(_0x285e63){return{'name':_0x285e63['fieldName'],'type':_0x285e63['type'][_0xb2e8('0x3a')]};});_0x2b2210[_0xb2e8('0x3b')]=_[_0xb2e8('0x37')](_0x481586,_0xb2e8('0x34'));_0x2b2210[_0xb2e8('0x3c')]=_[_0xb2e8('0x3d')](_0x2fd177[_0xb2e8('0x3c')]);_0x2b2210['filters']=_[_0xb2e8('0x3e')](_0x2b2210[_0xb2e8('0x3b')],_0x2b2210['query']);_0x102d9c[_0xb2e8('0x3f')]=_[_0xb2e8('0x3e')](_0x2b2210['model'],qs[_0xb2e8('0x40')](_0x2fd177[_0xb2e8('0x3c')]['fields']));_0x102d9c[_0xb2e8('0x3f')]=_0x102d9c[_0xb2e8('0x3f')][_0xb2e8('0x41')]?_0x102d9c['attributes']:_0x2b2210[_0xb2e8('0x3b')];if(!_0x2fd177[_0xb2e8('0x3c')][_0xb2e8('0x42')](_0xb2e8('0x43'))){_0x102d9c[_0xb2e8('0x44')]=qs[_0xb2e8('0x44')](_0x2fd177[_0xb2e8('0x3c')][_0xb2e8('0x44')]);_0x102d9c['offset']=qs[_0xb2e8('0x2c')](_0x2fd177['query']['offset']);}_0x102d9c[_0xb2e8('0x45')]=qs['sort'](_0x2fd177[_0xb2e8('0x3c')][_0xb2e8('0x46')]);_0x102d9c['where']=qs[_0xb2e8('0x47')](_['pick'](_0x2fd177[_0xb2e8('0x3c')],_0x2b2210['filters']));if(_0x2fd177[_0xb2e8('0x3c')][_0xb2e8('0x48')]){_0x102d9c[_0xb2e8('0x49')]=_[_0xb2e8('0x4a')](_0x102d9c[_0xb2e8('0x49')],{'$or':_['map'](_0x481586,function(_0x2bc89d){if(_0x2bc89d[_0xb2e8('0x4b')]!=='VIRTUAL'){var _0x1873f7={};_0x1873f7[_0x2bc89d['name']]={'$like':'%'+_0x2fd177['query']['filter']+'%'};return _0x1873f7;}})});}_0x102d9c=_['merge']({},_0x102d9c,_0x2fd177['options']);var _0x3e2d78={'where':_0x102d9c[_0xb2e8('0x49')]};return db[_0xb2e8('0x38')][_0xb2e8('0x4c')](_0x3e2d78)['then'](function(_0x385c31){_0x2560d8[_0xb2e8('0x4c')]=_0x385c31;if(_0x2fd177[_0xb2e8('0x3c')][_0xb2e8('0x4d')]){_0x102d9c[_0xb2e8('0x4e')]=[{'all':!![]}];}return db[_0xb2e8('0x38')][_0xb2e8('0x4f')](_0x102d9c);})['then'](function(_0x59e0f5){_0x2560d8[_0xb2e8('0x50')]=_0x59e0f5;return _0x2560d8;})[_0xb2e8('0x32')](respondWithFilteredResult(_0x2bde3f,_0x102d9c))['catch'](handleError(_0x2bde3f,null));};exports[_0xb2e8('0x51')]=function(_0x20d676,_0x4268fd){var _0x91147e={'raw':![],'where':{'id':_0x20d676['params']['id']}},_0x488ee9={};_0x488ee9[_0xb2e8('0x3b')]=_[_0xb2e8('0x3d')](db['ServicenowAccount']['rawAttributes']);_0x488ee9[_0xb2e8('0x3c')]=_[_0xb2e8('0x3d')](_0x20d676[_0xb2e8('0x3c')]);_0x488ee9[_0xb2e8('0x47')]=_[_0xb2e8('0x3e')](_0x488ee9[_0xb2e8('0x3b')],_0x488ee9[_0xb2e8('0x3c')]);_0x91147e[_0xb2e8('0x3f')]=_['intersection'](_0x488ee9['model'],qs[_0xb2e8('0x40')](_0x20d676['query'][_0xb2e8('0x40')]));_0x91147e[_0xb2e8('0x3f')]=_0x91147e['attributes']['length']?_0x91147e[_0xb2e8('0x3f')]:_0x488ee9[_0xb2e8('0x3b')];if(_0x20d676[_0xb2e8('0x3c')][_0xb2e8('0x4d')]){_0x91147e['include']=[{'all':!![]}];}_0x91147e=_[_0xb2e8('0x4a')]({},_0x91147e,_0x20d676['options']);return db[_0xb2e8('0x38')][_0xb2e8('0x52')](_0x91147e)['then'](handleEntityNotFound(_0x4268fd,null))[_0xb2e8('0x32')](respondWithResult(_0x4268fd,null))[_0xb2e8('0x28')](handleError(_0x4268fd,null));};exports[_0xb2e8('0x53')]=function(_0x3c9b85,_0x4a6c66){return db[_0xb2e8('0x38')][_0xb2e8('0x53')](_0x3c9b85[_0xb2e8('0x54')],{})[_0xb2e8('0x32')](respondWithResult(_0x4a6c66,0xc9))['catch'](handleError(_0x4a6c66,null));};exports[_0xb2e8('0x31')]=function(_0x17df3c,_0x241923){if(_0x17df3c[_0xb2e8('0x54')]['id']){delete _0x17df3c[_0xb2e8('0x54')]['id'];}return db[_0xb2e8('0x38')][_0xb2e8('0x52')]({'where':{'id':_0x17df3c[_0xb2e8('0x55')]['id']}})[_0xb2e8('0x32')](handleEntityNotFound(_0x241923,null))[_0xb2e8('0x32')](saveUpdates(_0x17df3c[_0xb2e8('0x54')],null))[_0xb2e8('0x32')](respondWithResult(_0x241923,null))[_0xb2e8('0x28')](handleError(_0x241923,null));};exports[_0xb2e8('0x33')]=function(_0x43f820,_0x1546ca){return db[_0xb2e8('0x38')][_0xb2e8('0x52')]({'where':{'id':_0x43f820[_0xb2e8('0x55')]['id']}})[_0xb2e8('0x32')](handleEntityNotFound(_0x1546ca,null))['then'](removeEntity(_0x1546ca,null))['catch'](handleError(_0x1546ca,null));};exports['getConfigurations']=function(_0x186e23,_0x596b2b,_0x4b43e0){var _0x3c6c46={};var _0x1f5105={};var _0x10e20e;var _0x5478c8;return db[_0xb2e8('0x38')][_0xb2e8('0x56')]({'where':{'id':_0x186e23[_0xb2e8('0x55')]['id']}})[_0xb2e8('0x32')](handleEntityNotFound(_0x596b2b,null))[_0xb2e8('0x32')](function(_0x2f43b6){if(_0x2f43b6){_0x10e20e=_0x2f43b6;_0x1f5105[_0xb2e8('0x3b')]=_[_0xb2e8('0x3d')](db['ServicenowConfiguration'][_0xb2e8('0x39')]);_0x1f5105[_0xb2e8('0x3c')]=_[_0xb2e8('0x3d')](_0x186e23[_0xb2e8('0x3c')]);_0x1f5105['filters']=_['intersection'](_0x1f5105[_0xb2e8('0x3b')],_0x1f5105['query']);_0x3c6c46[_0xb2e8('0x3f')]=_['intersection'](_0x1f5105[_0xb2e8('0x3b')],qs[_0xb2e8('0x40')](_0x186e23['query']['fields']));_0x3c6c46[_0xb2e8('0x3f')]=_0x3c6c46[_0xb2e8('0x3f')][_0xb2e8('0x41')]?_0x3c6c46[_0xb2e8('0x3f')]:_0x1f5105[_0xb2e8('0x3b')];_0x3c6c46[_0xb2e8('0x45')]=qs[_0xb2e8('0x46')](_0x186e23[_0xb2e8('0x3c')]['sort']);_0x3c6c46['where']=qs[_0xb2e8('0x47')](_[_0xb2e8('0x57')](_0x186e23[_0xb2e8('0x3c')],_0x1f5105['filters']));if(_0x186e23[_0xb2e8('0x3c')][_0xb2e8('0x48')]){_0x3c6c46[_0xb2e8('0x49')]=_[_0xb2e8('0x4a')](_0x3c6c46[_0xb2e8('0x49')],{'$or':_[_0xb2e8('0x37')](_0x3c6c46[_0xb2e8('0x3f')],function(_0x1fad2d){var _0x5d7ffb={};_0x5d7ffb[_0x1fad2d]={'$like':'%'+_0x186e23[_0xb2e8('0x3c')][_0xb2e8('0x48')]+'%'};return _0x5d7ffb;})});}_0x3c6c46=_[_0xb2e8('0x4a')]({},_0x3c6c46,_0x186e23[_0xb2e8('0x58')]);return _0x10e20e['getConfigurations'](_0x3c6c46);}})[_0xb2e8('0x32')](function(_0x1ed373){if(_0x1ed373){_0x5478c8=_0x1ed373[_0xb2e8('0x41')];if(!_0x186e23['query']['hasOwnProperty'](_0xb2e8('0x43'))){_0x3c6c46[_0xb2e8('0x44')]=qs[_0xb2e8('0x44')](_0x186e23[_0xb2e8('0x3c')]['limit']);_0x3c6c46[_0xb2e8('0x2c')]=qs[_0xb2e8('0x2c')](_0x186e23[_0xb2e8('0x3c')][_0xb2e8('0x2c')]);}return _0x10e20e[_0xb2e8('0x59')](_0x3c6c46);}})[_0xb2e8('0x32')](function(_0xc9584){if(_0xc9584){return _0xc9584?{'count':_0x5478c8,'rows':_0xc9584}:null;}})[_0xb2e8('0x32')](respondWithResult(_0x596b2b,null))['catch'](handleError(_0x596b2b,null));};exports[_0xb2e8('0x5a')]=function(_0x4041e2,_0x52f840,_0x431fc4){if(_0x4041e2[_0xb2e8('0x54')]['id']){delete _0x4041e2['body']['id'];}return db[_0xb2e8('0x38')][_0xb2e8('0x56')]({'where':{'id':_0x4041e2[_0xb2e8('0x55')]['id']}})[_0xb2e8('0x32')](handleEntityNotFound(_0x52f840,null))[_0xb2e8('0x32')](function(_0x5a3c7a){if(_0x5a3c7a){_0x4041e2[_0xb2e8('0x54')][_0xb2e8('0x5b')]=_0x5a3c7a['id'];_0x4041e2[_0xb2e8('0x54')][_0xb2e8('0x5c')]=integrations[_0xb2e8('0x5d')](_0x4041e2[_0xb2e8('0x54')][_0xb2e8('0x5e')],_0x4041e2['body'][_0xb2e8('0x4b')]);_0x4041e2[_0xb2e8('0x54')][_0xb2e8('0x5f')]=integrations[_0xb2e8('0x60')](_0x4041e2[_0xb2e8('0x54')][_0xb2e8('0x5e')],_0x4041e2['body'][_0xb2e8('0x4b')]);return db['ServicenowConfiguration'][_0xb2e8('0x53')](_0x4041e2['body'],{'include':[{'model':db[_0xb2e8('0x61')],'as':'Subjects'},{'model':db['ServicenowField'],'as':_0xb2e8('0x5f')}]});}return null;})[_0xb2e8('0x32')](respondWithResult(_0x52f840,null))[_0xb2e8('0x28')](handleError(_0x52f840,null));};exports[_0xb2e8('0x62')]=function(_0xfab81d,_0x347bd8,_0x5b34e8){var _0x3cca90=[_0xb2e8('0x63'),'hold_reason',_0xb2e8('0x64'),_0xb2e8('0x65'),_0xb2e8('0x66'),_0xb2e8('0x67'),_0xb2e8('0x68'),_0xb2e8('0x69'),'category'];var _0x3c847e=[_0xb2e8('0x6a'),_0xb2e8('0x63'),_0xb2e8('0x6b'),'watch_list',_0xb2e8('0x6c'),_0xb2e8('0x6d'),_0xb2e8('0x6e'),_0xb2e8('0x6f'),_0xb2e8('0x70'),_0xb2e8('0x71'),_0xb2e8('0x72'),'sys_updated_by',_0xb2e8('0x73'),'user_input','sys_created_on',_0xb2e8('0x74'),_0xb2e8('0x75'),'sys_created_by','knowledge',_0xb2e8('0x45'),_0xb2e8('0x76'),_0xb2e8('0x77'),_0xb2e8('0x78'),'delivery_plan','impact',_0xb2e8('0x79'),_0xb2e8('0x7a'),_0xb2e8('0x7b'),'priority',_0xb2e8('0x7c'),_0xb2e8('0x7d'),_0xb2e8('0x7e'),_0xb2e8('0x7f'),'opened_at',_0xb2e8('0x80'),'group_list',_0xb2e8('0x81'),_0xb2e8('0x82'),_0xb2e8('0x83'),_0xb2e8('0x84'),_0xb2e8('0x85'),_0xb2e8('0x65'),_0xb2e8('0x86'),_0xb2e8('0x87'),_0xb2e8('0x66'),_0xb2e8('0x88'),_0xb2e8('0x89'),_0xb2e8('0x8a'),_0xb2e8('0x8b'),_0xb2e8('0x8c'),_0xb2e8('0x8d'),_0xb2e8('0x8e'),_0xb2e8('0x8f'),_0xb2e8('0x67'),'sys_class_name',_0xb2e8('0x90'),'closed_by',_0xb2e8('0x91'),_0xb2e8('0x92'),'sys_id',_0xb2e8('0x93'),_0xb2e8('0x94'),'incident_state','urgency',_0xb2e8('0x95'),_0xb2e8('0x96'),_0xb2e8('0x97'),_0xb2e8('0x98'),_0xb2e8('0x99'),_0xb2e8('0x69'),_0xb2e8('0x9a'),_0xb2e8('0x9b'),_0xb2e8('0x9c'),_0xb2e8('0x9d'),_0xb2e8('0x9e'),_0xb2e8('0x9f'),_0xb2e8('0xa0'),_0xb2e8('0xa1'),_0xb2e8('0xa2'),'upon_approval',_0xb2e8('0xa3'),_0xb2e8('0xa4'),_0xb2e8('0xa5')];var _0x145c5f='';var _0x16c97d='';var _0x5a82eb=[];var _0x34df77='';var _0x28b6af='';var _0x535199=[];var _0x596cad='';var _0x16e9cc='';var _0x1041f8={};var _0x315b59='';return db['ServicenowAccount'][_0xb2e8('0x56')]({'where':{'id':_0xfab81d[_0xb2e8('0x55')]['id']},'attributes':['id',_0xb2e8('0xa6'),_0xb2e8('0xa7'),_0xb2e8('0xa8'),_0xb2e8('0xa9'),_0xb2e8('0xaa')]})[_0xb2e8('0x32')](handleEntityNotFound(_0x347bd8,null))[_0xb2e8('0x32')](function(_0x47fff0){if(_0x47fff0){_0x315b59=_0x47fff0[_0xb2e8('0xa9')];var _0xd9adff=_0x315b59[_0xb2e8('0xab')](-0x1);if(_0xd9adff==='/'){_0x315b59=_0x315b59[_0xb2e8('0xac')](0x0,_0x315b59['lastIndexOf'](_0xd9adff));}_0x16e9cc=util[_0xb2e8('0xad')](_0xb2e8('0xae'),_0x315b59);_0x596cad=util[_0xb2e8('0xad')]('%s/api/now/table/',_0x315b59);_0x1041f8={'user':_0x47fff0['username'],'pass':_0x47fff0[_0xb2e8('0xa7')]};var _0x26af37={'method':'GET','uri':_0x16e9cc+_0xb2e8('0xaf'),'auth':_0x1041f8,'json':!![]};return rp(_0x26af37);}})[_0xb2e8('0x32')](function(_0x4f085f){if(_0x4f085f[_0xb2e8('0x27')][_0xb2e8('0x41')]>0x0){_0x145c5f=_0x4f085f[_0xb2e8('0x27')];}console[_0xb2e8('0xb0')]('incident\x20table\x20objects',_0x145c5f);_0x535199=[];_0x16c97d=Object[_0xb2e8('0xb1')]([],_0x145c5f);_['remove'](_0x16c97d,function(_0x51131d){return!_0x3cca90[_0xb2e8('0xb2')](_0x51131d[_0xb2e8('0x34')]);});_0x16c97d[_0xb2e8('0xb3')](function(_0x1b04a9){var _0x1d6165=createFieldObject(_0x596cad,_0x1041f8,_0x1b04a9[_0xb2e8('0xb4')],_0x1b04a9[_0xb2e8('0x34')],_0x1b04a9[_0xb2e8('0xb5')],![]);_0x535199[_0xb2e8('0xb6')](_0x1d6165);});return Promise[_0xb2e8('0xb7')](_0x535199);})[_0xb2e8('0x32')](function(_0x566320){_0x5a82eb=_0x566320;_0x34df77=Object[_0xb2e8('0xb1')]([],_0x145c5f);console['log']('TCL:\x20_object',_0x145c5f);_[_0xb2e8('0xb8')](_0x34df77,function(_0xf0356d){return _0x3c847e['includes'](_0xf0356d['name']);});console['log']('TCL:\x20exports.getEntityFields\x20->\x20_objectsCustom',_0x34df77);_0x535199=[];_0x34df77[_0xb2e8('0xb3')](function(_0x417eda){var _0x3d9ca6=createFieldObject(_0x596cad,_0x1041f8,_0x417eda[_0xb2e8('0xb4')],_0x417eda[_0xb2e8('0x34')],_0x417eda[_0xb2e8('0xb5')],!![]);_0x535199['push'](_0x3d9ca6);});return Promise['all'](_0x535199);})[_0xb2e8('0x32')](function(_0x334309){_0x28b6af=_0x334309;var _0x5a6cea=_0x5a82eb['concat'](_0x28b6af);return{'count':_0x5a6cea[_0xb2e8('0x41')],'rows':_0x5a6cea};})['then'](respondWithResult(_0x347bd8,null))[_0xb2e8('0x28')](function(_0x37178a){console[_0xb2e8('0xb0')](_0xb2e8('0xb9')+_0x37178a);var _0x4fac23=_0xfab81d[_0xb2e8('0x3c')]['test']?0x1f4:_0x37178a[_0xb2e8('0xba')]||0x1f4;logger[_0xb2e8('0x23')](_0x37178a['stack']);delete _0x37178a[_0xb2e8('0x34')];if(_0x4fac23===0x191){_0x4fac23=0x190;}_0x347bd8[_0xb2e8('0x29')](_0x4fac23)[_0xb2e8('0x35')](_0xfab81d[_0xb2e8('0x3c')][_0xb2e8('0xbb')]?{'message':_0xb2e8('0xbc'),'statusCode':_0x37178a[_0xb2e8('0xba')]}:_0x37178a);});};function createFieldObject(_0x44e29d,_0x360554,_0x109cde,_0x12ed25,_0x3c9128,_0x15dc9d){return new Promise(function(_0x190048,_0x2096c6){var _0x3006cb={'id':_0x12ed25,'name':_0x3c9128,'custom':_0x15dc9d};if(_0x109cde===_0xb2e8('0xbd')){_0x3006cb[_0xb2e8('0x58')]=[{'name':_0xb2e8('0xbe'),'value':_0xb2e8('0xbf')},{'name':_0xb2e8('0xc0'),'value':'false'}];_0x190048(_0x3006cb);}else{var _0x18d7d6={'method':'GET','uri':_0x44e29d+_0xb2e8('0xc1')+_0x12ed25,'auth':_0x360554,'json':!![]};return rp(_0x18d7d6)['then'](function(_0x145ac9){var _0x583abd=[];if(_0x145ac9[_0xb2e8('0x27')]['length']>0x0){_0x145ac9[_0xb2e8('0x27')][_0xb2e8('0xb3')](function(_0xfd9eff){if(_0xfd9eff[_0xb2e8('0xc2')]===_0xb2e8('0xc3')){var _0x3ed4b7={'name':_0xfd9eff[_0xb2e8('0xb5')],'value':_0xfd9eff[_0xb2e8('0xc4')]};_0x583abd[_0xb2e8('0xb6')](_0x3ed4b7);}});}_0x3006cb[_0xb2e8('0x58')]=_0x583abd;if(_0x3006cb[_0xb2e8('0x58')][_0xb2e8('0x41')]>0x0){_0x190048(_0x3006cb);}else{if(_0x15dc9d==![]){_0x190048();}else{_0x190048(_0x3006cb);}}});}});}
\ No newline at end of file
+var _0xe538=['problem_id','reassignment_count','assigned_to','severity','comments','sla_due','approval','due_date','sys_mod_count','upon_approval','correlation_id','location','username','remoteUri','slice','substring','lastIndexOf','format','%s/api/now/doc/table/schema/','password','GET','incident?sysparm_display_value=all','result','log','assign','remove','internalType','push','TCL:\x20_object','includes','TCL:\x20exports.getEntityFields\x20->\x20_objectsCustom','forEach','label','all','ServiceNow\x20error:\x20','Wrong\x20credentials','statusCode','boolean','True','true','false','inactive','value','html-pdf','eml-format','rimraf','zip-dir','fast-json-patch','moment','bluebird','path','sox','ejs','squel','crypto','desk.js','to-csv','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/advancedSearch','api','../../config/utils','../../config/environment','../../mysqldb','../../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','ServicenowAccount,\x20%s,\x20%s','request\x20sent','ServicenowAccount,\x20%s,\x20%s,\x20%s','stringify','error','code','message','catch','sendStatus','status','end','json','count','offset','set','Content-Range','apply','save','update','destroy','stack','name','send','map','ServicenowAccount','rawAttributes','fieldName','type','key','model','query','filters','intersection','attributes','length','limit','order','sort','where','pick','merge','VIRTUAL','filter','options','includeAll','findAll','rows','show','params','keys','fields','create','body','find','getConfigurations','findOne','ServicenowConfiguration','hasOwnProperty','nolimit','addConfiguration','AccountId','Subjects','getSubjects','channel','Descriptions','getDescriptions','ServicenowField','getFields','made_sla','hold_reason','knowledge','subcategory','notify','incident_state','category','parent','sys_updated_on','approval_history','number','resolved_by','sys_updated_by','opened_by','sys_created_on','sys_domain','state','closed_at','cmdb_ci','delivery_plan','impact','active','priority','sys_domain_path','time_worked','group_list','reopened_time','resolved_at','caller_id','approval_set','work_notes','correlation_display','work_start','assignment_group','business_stc','description','calendar_duration','sys_class_name','close_notes','closed_by','contact_type','reopened_by','urgency'];(function(_0x571431,_0x548636){var _0x3e7682=function(_0x5209f9){while(--_0x5209f9){_0x571431['push'](_0x571431['shift']());}};_0x3e7682(++_0x548636);}(_0xe538,0xe6));var _0x8e53=function(_0xeb0035,_0x2c3d9a){_0xeb0035=_0xeb0035-0x0;var _0x190e57=_0xe538[_0xeb0035];return _0x190e57;};'use strict';var pdf=require(_0x8e53('0x0'));var emlformat=require(_0x8e53('0x1'));var rimraf=require(_0x8e53('0x2'));var zipdir=require(_0x8e53('0x3'));var jsonpatch=require(_0x8e53('0x4'));var rp=require('request-promise');var moment=require(_0x8e53('0x5'));var BPromise=require(_0x8e53('0x6'));var Mustache=require('mustache');var util=require('util');var path=require(_0x8e53('0x7'));var sox=require(_0x8e53('0x8'));var csv=require('to-csv');var ejs=require(_0x8e53('0x9'));var fs=require('fs');var _=require('lodash');var squel=require(_0x8e53('0xa'));var crypto=require(_0x8e53('0xb'));var jsforce=require('jsforce');var deskjs=require(_0x8e53('0xc'));var toCsv=require(_0x8e53('0xd'));var querystring=require(_0x8e53('0xe'));var Papa=require(_0x8e53('0xf'));var Redis=require(_0x8e53('0x10'));var authService=require(_0x8e53('0x11'));var qs=require('../../components/parsers/qs');var as=require(_0x8e53('0x12'));var hardwareService=require('../../config/license/hardware');var logger=require('../../config/logger')(_0x8e53('0x13'));var utils=require(_0x8e53('0x14'));var config=require(_0x8e53('0x15'));var db=require(_0x8e53('0x16'))['db'];var integrations=require(_0x8e53('0x17'));var jayson=require('jayson/promise');var client=jayson[_0x8e53('0x18')][_0x8e53('0x19')]({'port':0x232a});function checkPasswordPattern(_0x22f8ad,_0x826abf,_0x3a00e5){if(_0x3a00e5){var _0x4500d3=new RegExp(/(?=.*[a-z])(?=.*[A-Z])(?=.*[0-9])(?=.*[?!@#\$%\^&\*~\-_=+[{\]\}])(?=.{8,})/);if(_0x4500d3[_0x8e53('0x1a')](_0x826abf)){return _0x22f8ad;}else{throw new db[(_0x8e53('0x1b'))][(_0x8e53('0x1c'))](_0x8e53('0x1d'));}}else{return _0x22f8ad;}}function respondWithRpcPromise(_0x3ac14a,_0x1cb5ef,_0x2170da,_0x1cd808){return new BPromise(function(_0x5429ef,_0x1efbd3){var _0xd31567=_0x1cd808||client;return _0xd31567[_0x8e53('0x1e')](_0x3ac14a,_0x2170da)[_0x8e53('0x1f')](function(_0x3e0bea){logger[_0x8e53('0x20')](_0x8e53('0x21'),_0x1cb5ef,_0x8e53('0x22'));logger['debug'](_0x8e53('0x23'),_0x1cb5ef,_0x8e53('0x22'),JSON[_0x8e53('0x24')](_0x3e0bea));if(_0x3e0bea['error']){if(_0x3e0bea[_0x8e53('0x25')][_0x8e53('0x26')]===0x1f4){logger[_0x8e53('0x25')]('ServicenowAccount,\x20%s,\x20%s',_0x1cb5ef,_0x3e0bea[_0x8e53('0x25')][_0x8e53('0x27')]);return _0x1efbd3(_0x3e0bea[_0x8e53('0x25')][_0x8e53('0x27')]);}logger['error'](_0x8e53('0x21'),_0x1cb5ef,_0x3e0bea[_0x8e53('0x25')][_0x8e53('0x27')]);return _0x5429ef(_0x3e0bea['error'][_0x8e53('0x27')]);}else{logger[_0x8e53('0x20')]('ServicenowAccount,\x20%s,\x20%s',_0x1cb5ef,_0x8e53('0x22'));_0x5429ef(_0x3e0bea['result']['message']);}})[_0x8e53('0x28')](function(_0x12a4f2){logger['error'](_0x8e53('0x21'),_0x1cb5ef,_0x12a4f2);_0x1efbd3(_0x12a4f2);});});}function respondWithStatusCode(_0x41d534,_0x36be62){_0x36be62=_0x36be62||0xcc;return function(_0xbdc7ea){if(_0xbdc7ea){return _0x41d534[_0x8e53('0x29')](_0x36be62);}return _0x41d534[_0x8e53('0x2a')](_0x36be62)[_0x8e53('0x2b')]();};}function respondWithResult(_0x57c29d,_0x1cd354){_0x1cd354=_0x1cd354||0xc8;return function(_0x132047){if(_0x132047){return _0x57c29d[_0x8e53('0x2a')](_0x1cd354)[_0x8e53('0x2c')](_0x132047);}};}function respondWithFilteredResult(_0x5e509c,_0x1256ff){return function(_0x494ba8){if(_0x494ba8){var _0xe3c126=_0x494ba8[_0x8e53('0x2d')],_0x39a485=_0x1256ff[_0x8e53('0x2e')],_0x3b3219=_0x1256ff[_0x8e53('0x2e')]+_0x1256ff['limit'],_0x4be2dd;if(_0x3b3219>=_0xe3c126){_0x3b3219=_0xe3c126;_0x4be2dd=0xc8;}else{_0x4be2dd=0xce;}_0x5e509c[_0x8e53('0x2a')](_0x4be2dd);return _0x5e509c[_0x8e53('0x2f')](_0x8e53('0x30'),_0x39a485+'-'+_0x3b3219+'/'+_0xe3c126)['json'](_0x494ba8);}return null;};}function patchUpdates(_0x2f8369){return function(_0x252a0b){try{jsonpatch[_0x8e53('0x31')](_0x252a0b,_0x2f8369,!![]);}catch(_0xe48dd1){return BPromise['reject'](_0xe48dd1);}return _0x252a0b[_0x8e53('0x32')]();};}function saveUpdates(_0x481a1b,_0x463ae5){return function(_0x5657e5){if(_0x5657e5){return _0x5657e5[_0x8e53('0x33')](_0x481a1b)[_0x8e53('0x1f')](function(_0x44cc66){return _0x44cc66;});}return null;};}function removeEntity(_0x1f0a00,_0x3bc25f){return function(_0x25f6f8){if(_0x25f6f8){return _0x25f6f8[_0x8e53('0x34')]()[_0x8e53('0x1f')](function(){_0x1f0a00[_0x8e53('0x2a')](0xcc)[_0x8e53('0x2b')]();});}};}function handleEntityNotFound(_0x538bd0,_0x510396){return function(_0x489528){if(!_0x489528){_0x538bd0[_0x8e53('0x29')](0x194);}return _0x489528;};}function handleError(_0x5f51e5,_0x58f310){_0x58f310=_0x58f310||0x1f4;return function(_0x1271ab){logger[_0x8e53('0x25')](_0x1271ab[_0x8e53('0x35')]);if(_0x1271ab['name']){delete _0x1271ab[_0x8e53('0x36')];}_0x5f51e5[_0x8e53('0x2a')](_0x58f310)[_0x8e53('0x37')](_0x1271ab);};}exports['index']=function(_0x15384d,_0x4a3096){var _0xbd0670={},_0x193a58={},_0x1a2718={'count':0x0,'rows':[]};var _0x26eeee=_[_0x8e53('0x38')](db[_0x8e53('0x39')][_0x8e53('0x3a')],function(_0x2e3ad7){return{'name':_0x2e3ad7[_0x8e53('0x3b')],'type':_0x2e3ad7[_0x8e53('0x3c')][_0x8e53('0x3d')]};});_0x193a58[_0x8e53('0x3e')]=_['map'](_0x26eeee,_0x8e53('0x36'));_0x193a58[_0x8e53('0x3f')]=_['keys'](_0x15384d[_0x8e53('0x3f')]);_0x193a58[_0x8e53('0x40')]=_[_0x8e53('0x41')](_0x193a58[_0x8e53('0x3e')],_0x193a58[_0x8e53('0x3f')]);_0xbd0670[_0x8e53('0x42')]=_[_0x8e53('0x41')](_0x193a58[_0x8e53('0x3e')],qs['fields'](_0x15384d[_0x8e53('0x3f')]['fields']));_0xbd0670['attributes']=_0xbd0670['attributes'][_0x8e53('0x43')]?_0xbd0670[_0x8e53('0x42')]:_0x193a58[_0x8e53('0x3e')];if(!_0x15384d[_0x8e53('0x3f')]['hasOwnProperty']('nolimit')){_0xbd0670[_0x8e53('0x44')]=qs[_0x8e53('0x44')](_0x15384d[_0x8e53('0x3f')][_0x8e53('0x44')]);_0xbd0670[_0x8e53('0x2e')]=qs[_0x8e53('0x2e')](_0x15384d[_0x8e53('0x3f')]['offset']);}_0xbd0670[_0x8e53('0x45')]=qs[_0x8e53('0x46')](_0x15384d[_0x8e53('0x3f')][_0x8e53('0x46')]);_0xbd0670[_0x8e53('0x47')]=qs[_0x8e53('0x40')](_[_0x8e53('0x48')](_0x15384d[_0x8e53('0x3f')],_0x193a58[_0x8e53('0x40')]));if(_0x15384d[_0x8e53('0x3f')]['filter']){_0xbd0670['where']=_[_0x8e53('0x49')](_0xbd0670[_0x8e53('0x47')],{'$or':_[_0x8e53('0x38')](_0x26eeee,function(_0x4c721a){if(_0x4c721a[_0x8e53('0x3c')]!==_0x8e53('0x4a')){var _0x53b6c3={};_0x53b6c3[_0x4c721a[_0x8e53('0x36')]]={'$like':'%'+_0x15384d['query'][_0x8e53('0x4b')]+'%'};return _0x53b6c3;}})});}_0xbd0670=_[_0x8e53('0x49')]({},_0xbd0670,_0x15384d[_0x8e53('0x4c')]);var _0x55c952={'where':_0xbd0670[_0x8e53('0x47')]};return db[_0x8e53('0x39')][_0x8e53('0x2d')](_0x55c952)['then'](function(_0x34feeb){_0x1a2718[_0x8e53('0x2d')]=_0x34feeb;if(_0x15384d[_0x8e53('0x3f')][_0x8e53('0x4d')]){_0xbd0670['include']=[{'all':!![]}];}return db[_0x8e53('0x39')][_0x8e53('0x4e')](_0xbd0670);})[_0x8e53('0x1f')](function(_0x2f240d){_0x1a2718[_0x8e53('0x4f')]=_0x2f240d;return _0x1a2718;})[_0x8e53('0x1f')](respondWithFilteredResult(_0x4a3096,_0xbd0670))[_0x8e53('0x28')](handleError(_0x4a3096,null));};exports[_0x8e53('0x50')]=function(_0x345c7e,_0x4e4263){var _0x71123b={'raw':![],'where':{'id':_0x345c7e[_0x8e53('0x51')]['id']}},_0x22d40b={};_0x22d40b[_0x8e53('0x3e')]=_[_0x8e53('0x52')](db['ServicenowAccount']['rawAttributes']);_0x22d40b['query']=_['keys'](_0x345c7e[_0x8e53('0x3f')]);_0x22d40b[_0x8e53('0x40')]=_[_0x8e53('0x41')](_0x22d40b['model'],_0x22d40b[_0x8e53('0x3f')]);_0x71123b[_0x8e53('0x42')]=_[_0x8e53('0x41')](_0x22d40b[_0x8e53('0x3e')],qs[_0x8e53('0x53')](_0x345c7e[_0x8e53('0x3f')]['fields']));_0x71123b[_0x8e53('0x42')]=_0x71123b[_0x8e53('0x42')][_0x8e53('0x43')]?_0x71123b[_0x8e53('0x42')]:_0x22d40b[_0x8e53('0x3e')];if(_0x345c7e[_0x8e53('0x3f')][_0x8e53('0x4d')]){_0x71123b['include']=[{'all':!![]}];}_0x71123b=_[_0x8e53('0x49')]({},_0x71123b,_0x345c7e[_0x8e53('0x4c')]);return db[_0x8e53('0x39')]['find'](_0x71123b)[_0x8e53('0x1f')](handleEntityNotFound(_0x4e4263,null))['then'](respondWithResult(_0x4e4263,null))[_0x8e53('0x28')](handleError(_0x4e4263,null));};exports[_0x8e53('0x54')]=function(_0x36dc15,_0x3cca75){return db[_0x8e53('0x39')]['create'](_0x36dc15[_0x8e53('0x55')],{})[_0x8e53('0x1f')](respondWithResult(_0x3cca75,0xc9))[_0x8e53('0x28')](handleError(_0x3cca75,null));};exports[_0x8e53('0x33')]=function(_0x1ba1f6,_0x5393ad){if(_0x1ba1f6[_0x8e53('0x55')]['id']){delete _0x1ba1f6[_0x8e53('0x55')]['id'];}return db['ServicenowAccount'][_0x8e53('0x56')]({'where':{'id':_0x1ba1f6['params']['id']}})[_0x8e53('0x1f')](handleEntityNotFound(_0x5393ad,null))['then'](saveUpdates(_0x1ba1f6[_0x8e53('0x55')],null))['then'](respondWithResult(_0x5393ad,null))[_0x8e53('0x28')](handleError(_0x5393ad,null));};exports[_0x8e53('0x34')]=function(_0x19c503,_0x224e08){return db[_0x8e53('0x39')]['find']({'where':{'id':_0x19c503[_0x8e53('0x51')]['id']}})[_0x8e53('0x1f')](handleEntityNotFound(_0x224e08,null))[_0x8e53('0x1f')](removeEntity(_0x224e08,null))['catch'](handleError(_0x224e08,null));};exports[_0x8e53('0x57')]=function(_0x37fbd4,_0x20a776,_0x4231dc){var _0x36b312={};var _0x318583={};var _0xb8bcf1;var _0x367b93;return db[_0x8e53('0x39')][_0x8e53('0x58')]({'where':{'id':_0x37fbd4[_0x8e53('0x51')]['id']}})[_0x8e53('0x1f')](handleEntityNotFound(_0x20a776,null))[_0x8e53('0x1f')](function(_0x554a18){if(_0x554a18){_0xb8bcf1=_0x554a18;_0x318583[_0x8e53('0x3e')]=_[_0x8e53('0x52')](db[_0x8e53('0x59')][_0x8e53('0x3a')]);_0x318583[_0x8e53('0x3f')]=_[_0x8e53('0x52')](_0x37fbd4[_0x8e53('0x3f')]);_0x318583[_0x8e53('0x40')]=_[_0x8e53('0x41')](_0x318583[_0x8e53('0x3e')],_0x318583[_0x8e53('0x3f')]);_0x36b312[_0x8e53('0x42')]=_[_0x8e53('0x41')](_0x318583['model'],qs[_0x8e53('0x53')](_0x37fbd4['query']['fields']));_0x36b312[_0x8e53('0x42')]=_0x36b312[_0x8e53('0x42')][_0x8e53('0x43')]?_0x36b312['attributes']:_0x318583[_0x8e53('0x3e')];_0x36b312[_0x8e53('0x45')]=qs[_0x8e53('0x46')](_0x37fbd4[_0x8e53('0x3f')][_0x8e53('0x46')]);_0x36b312[_0x8e53('0x47')]=qs[_0x8e53('0x40')](_[_0x8e53('0x48')](_0x37fbd4[_0x8e53('0x3f')],_0x318583[_0x8e53('0x40')]));if(_0x37fbd4[_0x8e53('0x3f')]['filter']){_0x36b312[_0x8e53('0x47')]=_['merge'](_0x36b312[_0x8e53('0x47')],{'$or':_[_0x8e53('0x38')](_0x36b312[_0x8e53('0x42')],function(_0x194fc5){var _0x47645a={};_0x47645a[_0x194fc5]={'$like':'%'+_0x37fbd4['query'][_0x8e53('0x4b')]+'%'};return _0x47645a;})});}_0x36b312=_['merge']({},_0x36b312,_0x37fbd4[_0x8e53('0x4c')]);return _0xb8bcf1[_0x8e53('0x57')](_0x36b312);}})[_0x8e53('0x1f')](function(_0x283b20){if(_0x283b20){_0x367b93=_0x283b20[_0x8e53('0x43')];if(!_0x37fbd4[_0x8e53('0x3f')][_0x8e53('0x5a')](_0x8e53('0x5b'))){_0x36b312[_0x8e53('0x44')]=qs['limit'](_0x37fbd4[_0x8e53('0x3f')]['limit']);_0x36b312[_0x8e53('0x2e')]=qs['offset'](_0x37fbd4['query']['offset']);}return _0xb8bcf1[_0x8e53('0x57')](_0x36b312);}})[_0x8e53('0x1f')](function(_0x48c1a5){if(_0x48c1a5){return _0x48c1a5?{'count':_0x367b93,'rows':_0x48c1a5}:null;}})[_0x8e53('0x1f')](respondWithResult(_0x20a776,null))[_0x8e53('0x28')](handleError(_0x20a776,null));};exports[_0x8e53('0x5c')]=function(_0x57036f,_0x2c79f8,_0x10edfa){if(_0x57036f[_0x8e53('0x55')]['id']){delete _0x57036f['body']['id'];}return db[_0x8e53('0x39')][_0x8e53('0x58')]({'where':{'id':_0x57036f[_0x8e53('0x51')]['id']}})[_0x8e53('0x1f')](handleEntityNotFound(_0x2c79f8,null))[_0x8e53('0x1f')](function(_0xaa188){if(_0xaa188){_0x57036f[_0x8e53('0x55')][_0x8e53('0x5d')]=_0xaa188['id'];_0x57036f[_0x8e53('0x55')][_0x8e53('0x5e')]=integrations[_0x8e53('0x5f')](_0x57036f[_0x8e53('0x55')][_0x8e53('0x60')],_0x57036f[_0x8e53('0x55')]['type']);_0x57036f['body'][_0x8e53('0x61')]=integrations[_0x8e53('0x62')](_0x57036f[_0x8e53('0x55')][_0x8e53('0x60')],_0x57036f[_0x8e53('0x55')][_0x8e53('0x3c')]);return db[_0x8e53('0x59')]['create'](_0x57036f[_0x8e53('0x55')],{'include':[{'model':db[_0x8e53('0x63')],'as':_0x8e53('0x5e')},{'model':db['ServicenowField'],'as':_0x8e53('0x61')}]});}return null;})[_0x8e53('0x1f')](respondWithResult(_0x2c79f8,null))[_0x8e53('0x28')](handleError(_0x2c79f8,null));};exports[_0x8e53('0x64')]=function(_0x5c7c89,_0x3c3cf7,_0x241fc7){var _0x36685a=[_0x8e53('0x65'),_0x8e53('0x66'),_0x8e53('0x67'),_0x8e53('0x68'),'close_code',_0x8e53('0x69'),_0x8e53('0x6a'),'severity',_0x8e53('0x6b')];var _0x36c69c=[_0x8e53('0x6c'),_0x8e53('0x65'),'caused_by','watch_list','upon_reject',_0x8e53('0x6d'),'child_incidents',_0x8e53('0x66'),_0x8e53('0x6e'),_0x8e53('0x6f'),_0x8e53('0x70'),_0x8e53('0x71'),_0x8e53('0x72'),'user_input',_0x8e53('0x73'),_0x8e53('0x74'),_0x8e53('0x75'),'sys_created_by','knowledge',_0x8e53('0x45'),'calendar_stc',_0x8e53('0x76'),_0x8e53('0x77'),_0x8e53('0x78'),_0x8e53('0x79'),_0x8e53('0x7a'),'work_notes_list','business_service',_0x8e53('0x7b'),_0x8e53('0x7c'),'rfc',_0x8e53('0x7d'),'expected_start','opened_at','business_duration',_0x8e53('0x7e'),'work_end',_0x8e53('0x7f'),_0x8e53('0x80'),_0x8e53('0x81'),_0x8e53('0x82'),_0x8e53('0x68'),_0x8e53('0x83'),'short_description','close_code',_0x8e53('0x84'),'delivery_task',_0x8e53('0x85'),_0x8e53('0x86'),_0x8e53('0x87'),'additional_assignee_list',_0x8e53('0x88'),_0x8e53('0x89'),_0x8e53('0x69'),_0x8e53('0x8a'),_0x8e53('0x8b'),_0x8e53('0x8c'),'follow_up','parent_incident','sys_id',_0x8e53('0x8d'),_0x8e53('0x8e'),_0x8e53('0x6a'),_0x8e53('0x8f'),_0x8e53('0x90'),'company',_0x8e53('0x91'),'activity_due',_0x8e53('0x92'),_0x8e53('0x93'),_0x8e53('0x94'),_0x8e53('0x95'),_0x8e53('0x96'),'comments_and_work_notes',_0x8e53('0x97'),_0x8e53('0x98'),'reopen_count','sys_tags','escalation',_0x8e53('0x99'),_0x8e53('0x9a'),_0x8e53('0x9b'),_0x8e53('0x6b')];var _0x198efe='';var _0xd46bae='';var _0x20c987=[];var _0x13fc9d='';var _0x62e353='';var _0xd34171=[];var _0x16215c='';var _0x6c1679='';var _0x21e9a0={};var _0xf8b0e9='';return db[_0x8e53('0x39')]['findOne']({'where':{'id':_0x5c7c89[_0x8e53('0x51')]['id']},'attributes':['id',_0x8e53('0x9c'),'password','email',_0x8e53('0x9d'),'serverUrl']})[_0x8e53('0x1f')](handleEntityNotFound(_0x3c3cf7,null))['then'](function(_0x2060a5){if(_0x2060a5){_0xf8b0e9=_0x2060a5['remoteUri'];var _0x47580e=_0xf8b0e9[_0x8e53('0x9e')](-0x1);if(_0x47580e==='/'){_0xf8b0e9=_0xf8b0e9[_0x8e53('0x9f')](0x0,_0xf8b0e9[_0x8e53('0xa0')](_0x47580e));}_0x6c1679=util[_0x8e53('0xa1')](_0x8e53('0xa2'),_0xf8b0e9);_0x16215c=util[_0x8e53('0xa1')]('%s/api/now/table/',_0xf8b0e9);_0x21e9a0={'user':_0x2060a5['username'],'pass':_0x2060a5[_0x8e53('0xa3')]};var _0x4ddda7={'method':_0x8e53('0xa4'),'uri':_0x6c1679+_0x8e53('0xa5'),'auth':_0x21e9a0,'json':!![]};return rp(_0x4ddda7);}})['then'](function(_0x4dca61){if(_0x4dca61[_0x8e53('0xa6')]['length']>0x0){_0x198efe=_0x4dca61[_0x8e53('0xa6')];}console[_0x8e53('0xa7')]('incident\x20table\x20objects',_0x198efe);_0xd34171=[];_0xd46bae=Object[_0x8e53('0xa8')]([],_0x198efe);_[_0x8e53('0xa9')](_0xd46bae,function(_0x100175){return!_0x36685a['includes'](_0x100175[_0x8e53('0x36')]);});_0xd46bae['forEach'](function(_0x2ce69c){var _0x48b962=createFieldObject(_0x16215c,_0x21e9a0,_0x2ce69c[_0x8e53('0xaa')],_0x2ce69c[_0x8e53('0x36')],_0x2ce69c['label'],![]);_0xd34171[_0x8e53('0xab')](_0x48b962);});return Promise['all'](_0xd34171);})[_0x8e53('0x1f')](function(_0x1aaa52){_0x20c987=_0x1aaa52;_0x13fc9d=Object[_0x8e53('0xa8')]([],_0x198efe);console[_0x8e53('0xa7')](_0x8e53('0xac'),_0x198efe);_[_0x8e53('0xa9')](_0x13fc9d,function(_0x140f9d){return _0x36c69c[_0x8e53('0xad')](_0x140f9d[_0x8e53('0x36')]);});console[_0x8e53('0xa7')](_0x8e53('0xae'),_0x13fc9d);_0xd34171=[];_0x13fc9d[_0x8e53('0xaf')](function(_0x3644be){var _0x201270=createFieldObject(_0x16215c,_0x21e9a0,_0x3644be[_0x8e53('0xaa')],_0x3644be[_0x8e53('0x36')],_0x3644be[_0x8e53('0xb0')],!![]);_0xd34171[_0x8e53('0xab')](_0x201270);});return Promise[_0x8e53('0xb1')](_0xd34171);})[_0x8e53('0x1f')](function(_0x4b91ad){_0x62e353=_0x4b91ad;var _0x5aed65=_0x20c987['concat'](_0x62e353);return{'count':_0x5aed65[_0x8e53('0x43')],'rows':_0x5aed65};})['then'](respondWithResult(_0x3c3cf7,null))[_0x8e53('0x28')](function(_0x3356d6){console['log'](_0x8e53('0xb2')+_0x3356d6);var _0x50c2c7=_0x5c7c89[_0x8e53('0x3f')][_0x8e53('0x1a')]?0x1f4:_0x3356d6['statusCode']||0x1f4;logger[_0x8e53('0x25')](_0x3356d6[_0x8e53('0x35')]);delete _0x3356d6[_0x8e53('0x36')];if(_0x50c2c7===0x191){_0x50c2c7=0x190;}_0x3c3cf7[_0x8e53('0x2a')](_0x50c2c7)['send'](_0x5c7c89[_0x8e53('0x3f')][_0x8e53('0x1a')]?{'message':_0x8e53('0xb3'),'statusCode':_0x3356d6[_0x8e53('0xb4')]}:_0x3356d6);});};function createFieldObject(_0x111414,_0x2a5408,_0x3ce352,_0x143b1c,_0x5d0483,_0x2a96fe){return new Promise(function(_0x1f0b85,_0x351e6f){var _0x38633c={'id':_0x143b1c,'name':_0x5d0483,'custom':_0x2a96fe};if(_0x3ce352===_0x8e53('0xb5')){_0x38633c['options']=[{'name':_0x8e53('0xb6'),'value':_0x8e53('0xb7')},{'name':'False','value':_0x8e53('0xb8')}];_0x1f0b85(_0x38633c);}else{var _0x25b45a={'method':_0x8e53('0xa4'),'uri':_0x111414+'sys_choice?sysparm_query=name=incident^element='+_0x143b1c,'auth':_0x2a5408,'json':!![]};return rp(_0x25b45a)[_0x8e53('0x1f')](function(_0x2d5ad7){var _0x31cb6f=[];if(_0x2d5ad7[_0x8e53('0xa6')][_0x8e53('0x43')]>0x0){_0x2d5ad7[_0x8e53('0xa6')][_0x8e53('0xaf')](function(_0x53023d){if(_0x53023d[_0x8e53('0xb9')]===_0x8e53('0xb8')){var _0x562dfe={'name':_0x53023d[_0x8e53('0xb0')],'value':_0x53023d[_0x8e53('0xba')]};_0x31cb6f['push'](_0x562dfe);}});}_0x38633c[_0x8e53('0x4c')]=_0x31cb6f;if(_0x38633c[_0x8e53('0x4c')][_0x8e53('0x43')]>0x0){_0x1f0b85(_0x38633c);}else{if(_0x2a96fe==![]){_0x1f0b85();}else{_0x1f0b85(_0x38633c);}}});}});}
\ No newline at end of file
diff --git a/server/api/intServicenowAccount/intServicenowAccount.model.js b/server/api/intServicenowAccount/intServicenowAccount.model.js
index 79c30f8..4fedee3 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 _0x6b8f=['../../components/integrations/configuration','define','ServicenowAccount','util','api','request-promise','path','../../config/environment','./intServicenowAccount.attributes'];(function(_0x50547e,_0x794b69){var _0xdf923f=function(_0x901df3){while(--_0x901df3){_0x50547e['push'](_0x50547e['shift']());}};_0xdf923f(++_0x794b69);}(_0x6b8f,0x1bc));var _0xf6b8=function(_0x16f14f,_0x48af34){_0x16f14f=_0x16f14f-0x0;var _0x5ba2a2=_0x6b8f[_0x16f14f];return _0x5ba2a2;};'use strict';var _=require('lodash');var util=require(_0xf6b8('0x0'));var logger=require('../../config/logger')(_0xf6b8('0x1'));var moment=require('moment');var BPromise=require('bluebird');var rp=require(_0xf6b8('0x2'));var fs=require('fs');var path=require(_0xf6b8('0x3'));var rimraf=require('rimraf');var config=require(_0xf6b8('0x4'));var attributes=require(_0xf6b8('0x5'));var integrations=require(_0xf6b8('0x6'));module['exports']=function(_0x2d035e,_0x79c66d){return _0x2d035e[_0xf6b8('0x7')](_0xf6b8('0x8'),attributes,{'tableName':'int_servicenow_accounts','paranoid':![],'indexes':[],'timestamps':!![]});};
\ No newline at end of file
+var _0x5162=['../../config/environment','./intServicenowAccount.attributes','../../components/integrations/configuration','define','ServicenowAccount','int_servicenow_accounts','lodash','bluebird','request-promise','path','rimraf'];(function(_0x13ac10,_0x46e79e){var _0x28eda2=function(_0x169ef0){while(--_0x169ef0){_0x13ac10['push'](_0x13ac10['shift']());}};_0x28eda2(++_0x46e79e);}(_0x5162,0x103));var _0x2516=function(_0xf73390,_0x14c109){_0xf73390=_0xf73390-0x0;var _0x4b212f=_0x5162[_0xf73390];return _0x4b212f;};'use strict';var _=require(_0x2516('0x0'));var util=require('util');var logger=require('../../config/logger')('api');var moment=require('moment');var BPromise=require(_0x2516('0x1'));var rp=require(_0x2516('0x2'));var fs=require('fs');var path=require(_0x2516('0x3'));var rimraf=require(_0x2516('0x4'));var config=require(_0x2516('0x5'));var attributes=require(_0x2516('0x6'));var integrations=require(_0x2516('0x7'));module['exports']=function(_0x48f411,_0x5beeb3){return _0x48f411[_0x2516('0x8')](_0x2516('0x9'),attributes,{'tableName':_0x2516('0xa'),'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 01a17cc..a60b99f 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 _0x6542=['result','catch','GetServicenowAccount','findAll','options','raw','where','limit','include','model','attributes','map','then','ShowServicenowAccount','ServicenowAccount','lodash','util','bluebird','randomstring','ioredis','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','client','info','ServicenowAccount,\x20%s,\x20%s','request\x20sent','debug','ServicenowAccount,\x20%s,\x20%s,\x20%s','stringify','error','code','message'];(function(_0x3d9fe2,_0x4839b1){var _0x55f8be=function(_0x4063a9){while(--_0x4063a9){_0x3d9fe2['push'](_0x3d9fe2['shift']());}};_0x55f8be(++_0x4839b1);}(_0x6542,0xe1));var _0x2654=function(_0xe2af4b,_0x350664){_0xe2af4b=_0xe2af4b-0x0;var _0x2a5b63=_0x6542[_0xe2af4b];return _0x2a5b63;};'use strict';var _=require(_0x2654('0x0'));var util=require(_0x2654('0x1'));var moment=require('moment');var BPromise=require(_0x2654('0x2'));var rs=require(_0x2654('0x3'));var fs=require('fs');var Redis=require(_0x2654('0x4'));var db=require('../../mysqldb')['db'];var utils=require(_0x2654('0x5'));var logger=require(_0x2654('0x6'))(_0x2654('0x7'));var config=require(_0x2654('0x8'));var jayson=require(_0x2654('0x9'));var client=jayson[_0x2654('0xa')]['http']({'port':0x232a});function respondWithRpcPromise(_0x2f7876,_0x3d262a,_0x38f19b){return new BPromise(function(_0x589d89,_0xdb3aa7){return client['request'](_0x2f7876,_0x38f19b)['then'](function(_0x48623d){logger[_0x2654('0xb')](_0x2654('0xc'),_0x3d262a,_0x2654('0xd'));logger[_0x2654('0xe')](_0x2654('0xf'),_0x3d262a,_0x2654('0xd'),JSON[_0x2654('0x10')](_0x48623d));if(_0x48623d[_0x2654('0x11')]){if(_0x48623d[_0x2654('0x11')][_0x2654('0x12')]===0x1f4){logger[_0x2654('0x11')](_0x2654('0xc'),_0x3d262a,_0x48623d[_0x2654('0x11')][_0x2654('0x13')]);return _0xdb3aa7(_0x48623d[_0x2654('0x11')][_0x2654('0x13')]);}logger[_0x2654('0x11')](_0x2654('0xc'),_0x3d262a,_0x48623d[_0x2654('0x11')][_0x2654('0x13')]);return _0x589d89(_0x48623d[_0x2654('0x11')][_0x2654('0x13')]);}else{logger['info'](_0x2654('0xc'),_0x3d262a,'request\x20sent');_0x589d89(_0x48623d[_0x2654('0x14')]['message']);}})[_0x2654('0x15')](function(_0x2437ef){logger[_0x2654('0x11')](_0x2654('0xc'),_0x3d262a,_0x2437ef);_0xdb3aa7(_0x2437ef);});});}exports[_0x2654('0x16')]=function(_0x5a1751){var _0x1c7b14=this;return new Promise(function(_0x15adb1,_0x4bbf83){return db['ServicenowAccount'][_0x2654('0x17')]({'raw':_0x5a1751[_0x2654('0x18')]?_0x5a1751[_0x2654('0x18')][_0x2654('0x19')]===undefined?!![]:![]:!![],'where':_0x5a1751[_0x2654('0x18')]?_0x5a1751[_0x2654('0x18')][_0x2654('0x1a')]||null:null,'attributes':_0x5a1751[_0x2654('0x18')]?_0x5a1751[_0x2654('0x18')]['attributes']||null:null,'limit':_0x5a1751[_0x2654('0x18')]?_0x5a1751[_0x2654('0x18')][_0x2654('0x1b')]||null:null,'include':_0x5a1751['options']?_0x5a1751[_0x2654('0x18')][_0x2654('0x1c')]?_['map'](_0x5a1751[_0x2654('0x18')][_0x2654('0x1c')],function(_0x555c31){return{'model':db[_0x555c31[_0x2654('0x1d')]],'as':_0x555c31['as'],'attributes':_0x555c31[_0x2654('0x1e')],'include':_0x555c31[_0x2654('0x1c')]?_[_0x2654('0x1f')](_0x555c31[_0x2654('0x1c')],function(_0x30cfdd){return{'model':db[_0x30cfdd['model']],'as':_0x30cfdd['as'],'attributes':_0x30cfdd['attributes'],'include':_0x30cfdd[_0x2654('0x1c')]?_['map'](_0x30cfdd[_0x2654('0x1c')],function(_0x357f7b){return{'model':db[_0x357f7b[_0x2654('0x1d')]],'as':_0x357f7b['as'],'attributes':_0x357f7b[_0x2654('0x1e')]};}):[]};}):[]};}):[]:[]})[_0x2654('0x20')](function(_0x226c14){logger['info'](_0x2654('0x16'),_0x5a1751);logger[_0x2654('0xe')](_0x2654('0x16'),_0x5a1751,JSON[_0x2654('0x10')](_0x226c14));_0x15adb1(_0x226c14);})[_0x2654('0x15')](function(_0x33bad8){logger['error'](_0x2654('0x16'),_0x33bad8[_0x2654('0x13')],_0x5a1751);_0x4bbf83(_0x1c7b14[_0x2654('0x11')](0x1f4,_0x33bad8[_0x2654('0x13')]));});});};exports[_0x2654('0x21')]=function(_0x516768){var _0x4cc4ed=this;return new Promise(function(_0x235154,_0x4533b5){return db[_0x2654('0x22')]['find']({'raw':_0x516768[_0x2654('0x18')]?_0x516768[_0x2654('0x18')][_0x2654('0x19')]===undefined?!![]:![]:!![],'where':_0x516768[_0x2654('0x18')]?_0x516768[_0x2654('0x18')]['where']||null:null,'attributes':_0x516768[_0x2654('0x18')]?_0x516768[_0x2654('0x18')]['attributes']||null:null,'include':_0x516768[_0x2654('0x18')]?_0x516768[_0x2654('0x18')][_0x2654('0x1c')]?_['map'](_0x516768[_0x2654('0x18')][_0x2654('0x1c')],function(_0x9ce220){return{'model':db[_0x9ce220[_0x2654('0x1d')]],'as':_0x9ce220['as'],'attributes':_0x9ce220[_0x2654('0x1e')],'include':_0x9ce220['include']?_[_0x2654('0x1f')](_0x9ce220['include'],function(_0x477dbd){return{'model':db[_0x477dbd[_0x2654('0x1d')]],'as':_0x477dbd['as'],'attributes':_0x477dbd['attributes'],'include':_0x477dbd[_0x2654('0x1c')]?_[_0x2654('0x1f')](_0x477dbd['include'],function(_0x56865a){return{'model':db[_0x56865a['model']],'as':_0x56865a['as'],'attributes':_0x56865a[_0x2654('0x1e')]};}):[]};}):[]};}):[]:[]})['then'](function(_0x1b27a7){logger[_0x2654('0xb')]('ShowServicenowAccount',_0x516768);logger[_0x2654('0xe')](_0x2654('0x21'),_0x516768,JSON['stringify'](_0x1b27a7));_0x235154(_0x1b27a7);})['catch'](function(_0x2d06cd){logger[_0x2654('0x11')](_0x2654('0x21'),_0x2d06cd[_0x2654('0x13')],_0x516768);_0x4533b5(_0x4cc4ed[_0x2654('0x11')](0x1f4,_0x2d06cd[_0x2654('0x13')]));});});};
\ No newline at end of file
+var _0xb2f2=['ServicenowAccount','find','where','bluebird','randomstring','ioredis','../../mysqldb','rpc','../../config/environment','jayson/promise','client','http','request','then','ServicenowAccount,\x20%s,\x20%s','request\x20sent','debug','ServicenowAccount,\x20%s,\x20%s,\x20%s','error','message','result','catch','GetServicenowAccount','findAll','options','raw','limit','map','model','attributes','include','info','stringify','ShowServicenowAccount'];(function(_0x3dd15e,_0x1f0015){var _0x231fd0=function(_0x4f680a){while(--_0x4f680a){_0x3dd15e['push'](_0x3dd15e['shift']());}};_0x231fd0(++_0x1f0015);}(_0xb2f2,0x179));var _0x2b2f=function(_0x2e4975,_0x50350d){_0x2e4975=_0x2e4975-0x0;var _0x553118=_0xb2f2[_0x2e4975];return _0x553118;};'use strict';var _=require('lodash');var util=require('util');var moment=require('moment');var BPromise=require(_0x2b2f('0x0'));var rs=require(_0x2b2f('0x1'));var fs=require('fs');var Redis=require(_0x2b2f('0x2'));var db=require(_0x2b2f('0x3'))['db'];var utils=require('../../config/utils');var logger=require('../../config/logger')(_0x2b2f('0x4'));var config=require(_0x2b2f('0x5'));var jayson=require(_0x2b2f('0x6'));var client=jayson[_0x2b2f('0x7')][_0x2b2f('0x8')]({'port':0x232a});function respondWithRpcPromise(_0xa2a0d0,_0x4ca3af,_0x1af7ed){return new BPromise(function(_0x3f0ee4,_0x46a272){return client[_0x2b2f('0x9')](_0xa2a0d0,_0x1af7ed)[_0x2b2f('0xa')](function(_0x520a){logger['info'](_0x2b2f('0xb'),_0x4ca3af,_0x2b2f('0xc'));logger[_0x2b2f('0xd')](_0x2b2f('0xe'),_0x4ca3af,_0x2b2f('0xc'),JSON['stringify'](_0x520a));if(_0x520a[_0x2b2f('0xf')]){if(_0x520a[_0x2b2f('0xf')]['code']===0x1f4){logger['error'](_0x2b2f('0xb'),_0x4ca3af,_0x520a['error'][_0x2b2f('0x10')]);return _0x46a272(_0x520a[_0x2b2f('0xf')][_0x2b2f('0x10')]);}logger[_0x2b2f('0xf')](_0x2b2f('0xb'),_0x4ca3af,_0x520a['error']['message']);return _0x3f0ee4(_0x520a[_0x2b2f('0xf')][_0x2b2f('0x10')]);}else{logger['info']('ServicenowAccount,\x20%s,\x20%s',_0x4ca3af,'request\x20sent');_0x3f0ee4(_0x520a[_0x2b2f('0x11')][_0x2b2f('0x10')]);}})[_0x2b2f('0x12')](function(_0x5873ca){logger[_0x2b2f('0xf')]('ServicenowAccount,\x20%s,\x20%s',_0x4ca3af,_0x5873ca);_0x46a272(_0x5873ca);});});}exports[_0x2b2f('0x13')]=function(_0x51f946){var _0x3d54b1=this;return new Promise(function(_0x6f7d66,_0x9952ed){return db['ServicenowAccount'][_0x2b2f('0x14')]({'raw':_0x51f946[_0x2b2f('0x15')]?_0x51f946[_0x2b2f('0x15')][_0x2b2f('0x16')]===undefined?!![]:![]:!![],'where':_0x51f946['options']?_0x51f946[_0x2b2f('0x15')]['where']||null:null,'attributes':_0x51f946['options']?_0x51f946['options']['attributes']||null:null,'limit':_0x51f946[_0x2b2f('0x15')]?_0x51f946[_0x2b2f('0x15')][_0x2b2f('0x17')]||null:null,'include':_0x51f946[_0x2b2f('0x15')]?_0x51f946['options']['include']?_[_0x2b2f('0x18')](_0x51f946[_0x2b2f('0x15')]['include'],function(_0x944344){return{'model':db[_0x944344[_0x2b2f('0x19')]],'as':_0x944344['as'],'attributes':_0x944344[_0x2b2f('0x1a')],'include':_0x944344[_0x2b2f('0x1b')]?_[_0x2b2f('0x18')](_0x944344[_0x2b2f('0x1b')],function(_0x4e514a){return{'model':db[_0x4e514a['model']],'as':_0x4e514a['as'],'attributes':_0x4e514a[_0x2b2f('0x1a')],'include':_0x4e514a[_0x2b2f('0x1b')]?_[_0x2b2f('0x18')](_0x4e514a[_0x2b2f('0x1b')],function(_0x1b419c){return{'model':db[_0x1b419c['model']],'as':_0x1b419c['as'],'attributes':_0x1b419c[_0x2b2f('0x1a')]};}):[]};}):[]};}):[]:[]})['then'](function(_0x1d0134){logger[_0x2b2f('0x1c')](_0x2b2f('0x13'),_0x51f946);logger['debug'](_0x2b2f('0x13'),_0x51f946,JSON[_0x2b2f('0x1d')](_0x1d0134));_0x6f7d66(_0x1d0134);})['catch'](function(_0x3d4bb3){logger[_0x2b2f('0xf')]('GetServicenowAccount',_0x3d4bb3[_0x2b2f('0x10')],_0x51f946);_0x9952ed(_0x3d54b1[_0x2b2f('0xf')](0x1f4,_0x3d4bb3[_0x2b2f('0x10')]));});});};exports[_0x2b2f('0x1e')]=function(_0x2bd2dd){var _0xbf505=this;return new Promise(function(_0x200085,_0xd11eaa){return db[_0x2b2f('0x1f')][_0x2b2f('0x20')]({'raw':_0x2bd2dd[_0x2b2f('0x15')]?_0x2bd2dd[_0x2b2f('0x15')]['raw']===undefined?!![]:![]:!![],'where':_0x2bd2dd['options']?_0x2bd2dd['options'][_0x2b2f('0x21')]||null:null,'attributes':_0x2bd2dd['options']?_0x2bd2dd[_0x2b2f('0x15')]['attributes']||null:null,'include':_0x2bd2dd[_0x2b2f('0x15')]?_0x2bd2dd[_0x2b2f('0x15')]['include']?_['map'](_0x2bd2dd[_0x2b2f('0x15')]['include'],function(_0x3ff29c){return{'model':db[_0x3ff29c['model']],'as':_0x3ff29c['as'],'attributes':_0x3ff29c['attributes'],'include':_0x3ff29c[_0x2b2f('0x1b')]?_[_0x2b2f('0x18')](_0x3ff29c['include'],function(_0xbffc81){return{'model':db[_0xbffc81['model']],'as':_0xbffc81['as'],'attributes':_0xbffc81[_0x2b2f('0x1a')],'include':_0xbffc81['include']?_[_0x2b2f('0x18')](_0xbffc81['include'],function(_0x6f4a0){return{'model':db[_0x6f4a0['model']],'as':_0x6f4a0['as'],'attributes':_0x6f4a0['attributes']};}):[]};}):[]};}):[]:[]})['then'](function(_0x58484e){logger[_0x2b2f('0x1c')]('ShowServicenowAccount',_0x2bd2dd);logger['debug'](_0x2b2f('0x1e'),_0x2bd2dd,JSON[_0x2b2f('0x1d')](_0x58484e));_0x200085(_0x58484e);})[_0x2b2f('0x12')](function(_0x57f38f){logger[_0x2b2f('0xf')]('ShowServicenowAccount',_0x57f38f['message'],_0x2bd2dd);_0xd11eaa(_0xbf505[_0x2b2f('0xf')](0x1f4,_0x57f38f[_0x2b2f('0x10')]));});});};
\ No newline at end of file
diff --git a/server/api/intServicenowConfiguration/index.js b/server/api/intServicenowConfiguration/index.js
index ed2fa43..5830570 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 _0x1847=['Router','../../components/auth/service','../../config/environment','./intServicenowConfiguration.controller','get','isAuthenticated','index','/:id','show','getFields','/:id/subjects','getSubjects','/:id/descriptions','update','multer','util','path','connect-timeout','express'];(function(_0x1aeda2,_0x1217eb){var _0x32dc6d=function(_0x34a460){while(--_0x34a460){_0x1aeda2['push'](_0x1aeda2['shift']());}};_0x32dc6d(++_0x1217eb);}(_0x1847,0xa6));var _0x7184=function(_0xc0a626,_0x3f3d91){_0xc0a626=_0xc0a626-0x0;var _0x2717b6=_0x1847[_0xc0a626];return _0x2717b6;};'use strict';var multer=require(_0x7184('0x0'));var util=require(_0x7184('0x1'));var path=require(_0x7184('0x2'));var timeout=require(_0x7184('0x3'));var express=require(_0x7184('0x4'));var router=express[_0x7184('0x5')]();var auth=require(_0x7184('0x6'));var interaction=require('../../components/interaction/service');var config=require(_0x7184('0x7'));var controller=require(_0x7184('0x8'));router[_0x7184('0x9')]('/',auth[_0x7184('0xa')](),controller[_0x7184('0xb')]);router[_0x7184('0x9')](_0x7184('0xc'),auth[_0x7184('0xa')](),controller[_0x7184('0xd')]);router['get']('/:id/fields',auth[_0x7184('0xa')](),controller[_0x7184('0xe')]);router[_0x7184('0x9')](_0x7184('0xf'),auth[_0x7184('0xa')](),controller[_0x7184('0x10')]);router[_0x7184('0x9')](_0x7184('0x11'),auth['isAuthenticated'](),controller['getDescriptions']);router['post']('/',auth[_0x7184('0xa')](),controller['create']);router['put'](_0x7184('0xc'),auth[_0x7184('0xa')](),controller[_0x7184('0x12')]);router['delete'](_0x7184('0xc'),auth[_0x7184('0xa')](),controller['destroy']);module['exports']=router;
\ No newline at end of file
+var _0xa539=['put','delete','destroy','util','path','express','../../components/auth/service','../../components/interaction/service','../../config/environment','./intServicenowConfiguration.controller','isAuthenticated','index','get','/:id','show','/:id/fields','getFields','/:id/subjects','/:id/descriptions','create'];(function(_0x3f97a7,_0x4732e9){var _0x4cead3=function(_0x4fb68c){while(--_0x4fb68c){_0x3f97a7['push'](_0x3f97a7['shift']());}};_0x4cead3(++_0x4732e9);}(_0xa539,0x143));var _0x9a53=function(_0x3565ed,_0xc8a56a){_0x3565ed=_0x3565ed-0x0;var _0x5b57ef=_0xa539[_0x3565ed];return _0x5b57ef;};'use strict';var multer=require('multer');var util=require(_0x9a53('0x0'));var path=require(_0x9a53('0x1'));var timeout=require('connect-timeout');var express=require(_0x9a53('0x2'));var router=express['Router']();var auth=require(_0x9a53('0x3'));var interaction=require(_0x9a53('0x4'));var config=require(_0x9a53('0x5'));var controller=require(_0x9a53('0x6'));router['get']('/',auth[_0x9a53('0x7')](),controller[_0x9a53('0x8')]);router[_0x9a53('0x9')](_0x9a53('0xa'),auth[_0x9a53('0x7')](),controller[_0x9a53('0xb')]);router[_0x9a53('0x9')](_0x9a53('0xc'),auth['isAuthenticated'](),controller[_0x9a53('0xd')]);router[_0x9a53('0x9')](_0x9a53('0xe'),auth[_0x9a53('0x7')](),controller['getSubjects']);router[_0x9a53('0x9')](_0x9a53('0xf'),auth[_0x9a53('0x7')](),controller['getDescriptions']);router['post']('/',auth[_0x9a53('0x7')](),controller[_0x9a53('0x10')]);router[_0x9a53('0x11')]('/:id',auth[_0x9a53('0x7')](),controller['update']);router[_0x9a53('0x12')]('/:id',auth[_0x9a53('0x7')](),controller[_0x9a53('0x13')]);module['exports']=router;
\ No newline at end of file
diff --git a/server/api/intServicenowConfiguration/intServicenowConfiguration.attributes.js b/server/api/intServicenowConfiguration/intServicenowConfiguration.attributes.js
index 59649aa..78d09f1 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 _0x26e3=['exports','STRING','sequelize'];(function(_0x3e103d,_0x55790c){var _0x4931bf=function(_0x541250){while(--_0x541250){_0x3e103d['push'](_0x3e103d['shift']());}};_0x4931bf(++_0x55790c);}(_0x26e3,0x6b));var _0x326e=function(_0x2d91c6,_0x10ae0e){_0x2d91c6=_0x2d91c6-0x0;var _0x3a8d19=_0x26e3[_0x2d91c6];return _0x3a8d19;};'use strict';var Sequelize=require(_0x326e('0x0'));module[_0x326e('0x1')]={'name':{'type':Sequelize[_0x326e('0x2')]},'description':{'type':Sequelize[_0x326e('0x2')]}};
\ No newline at end of file
+var _0xe4c6=['STRING','sequelize','exports'];(function(_0x42cae2,_0x284ef8){var _0x5f256f=function(_0x41abc8){while(--_0x41abc8){_0x42cae2['push'](_0x42cae2['shift']());}};_0x5f256f(++_0x284ef8);}(_0xe4c6,0x9a));var _0x6e4c=function(_0x5be745,_0x190739){_0x5be745=_0x5be745-0x0;var _0x39eac8=_0xe4c6[_0x5be745];return _0x39eac8;};'use strict';var Sequelize=require(_0x6e4c('0x0'));module[_0x6e4c('0x1')]={'name':{'type':Sequelize[_0x6e4c('0x2')]},'description':{'type':Sequelize[_0x6e4c('0x2')]}};
\ No newline at end of file
diff --git a/server/api/intServicenowConfiguration/intServicenowConfiguration.controller.js b/server/api/intServicenowConfiguration/intServicenowConfiguration.controller.js
index 65b89f4..233a813 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 _0x5cde=['name','send','index','map','ServicenowConfiguration','fieldName','type','key','model','query','keys','intersection','attributes','fields','length','nolimit','order','sort','where','filters','merge','VIRTUAL','filter','options','includeAll','include','rows','show','rawAttributes','create','body','params','find','getFields','findOne','ServicenowField','pick','hasOwnProperty','getSubjects','getDescriptions','eml-format','zip-dir','request-promise','moment','bluebird','mustache','util','sox','to-csv','ejs','lodash','crypto','jsforce','desk.js','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../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','ServicenowConfiguration,\x20%s,\x20%s','request\x20sent','debug','error','code','message','result','catch','sendStatus','status','end','count','offset','limit','set','Content-Range','json','reject','save','update','destroy','stack'];(function(_0x396bcc,_0x1104a7){var _0x219212=function(_0x42af75){while(--_0x42af75){_0x396bcc['push'](_0x396bcc['shift']());}};_0x219212(++_0x1104a7);}(_0x5cde,0xe4));var _0xe5cd=function(_0x3d42d8,_0x4cffaa){_0x3d42d8=_0x3d42d8-0x0;var _0x27fc41=_0x5cde[_0x3d42d8];return _0x27fc41;};'use strict';var pdf=require('html-pdf');var emlformat=require(_0xe5cd('0x0'));var rimraf=require('rimraf');var zipdir=require(_0xe5cd('0x1'));var jsonpatch=require('fast-json-patch');var rp=require(_0xe5cd('0x2'));var moment=require(_0xe5cd('0x3'));var BPromise=require(_0xe5cd('0x4'));var Mustache=require(_0xe5cd('0x5'));var util=require(_0xe5cd('0x6'));var path=require('path');var sox=require(_0xe5cd('0x7'));var csv=require(_0xe5cd('0x8'));var ejs=require(_0xe5cd('0x9'));var fs=require('fs');var _=require(_0xe5cd('0xa'));var squel=require('squel');var crypto=require(_0xe5cd('0xb'));var jsforce=require(_0xe5cd('0xc'));var deskjs=require(_0xe5cd('0xd'));var toCsv=require('to-csv');var querystring=require('querystring');var Papa=require(_0xe5cd('0xe'));var Redis=require(_0xe5cd('0xf'));var authService=require(_0xe5cd('0x10'));var qs=require(_0xe5cd('0x11'));var as=require(_0xe5cd('0x12'));var hardwareService=require('../../config/license/hardware');var logger=require('../../config/logger')('api');var utils=require(_0xe5cd('0x13'));var config=require(_0xe5cd('0x14'));var db=require(_0xe5cd('0x15'))['db'];var jayson=require(_0xe5cd('0x16'));var client=jayson[_0xe5cd('0x17')][_0xe5cd('0x18')]({'port':0x232a});function checkPasswordPattern(_0x2d8ac2,_0x2e3fa5,_0x875588){if(_0x875588){var _0x547918=new RegExp(/(?=.*[a-z])(?=.*[A-Z])(?=.*[0-9])(?=.*[?!@#\$%\^&\*~\-_=+[{\]\}])(?=.{8,})/);if(_0x547918[_0xe5cd('0x19')](_0x2e3fa5)){return _0x2d8ac2;}else{throw new db[(_0xe5cd('0x1a'))][(_0xe5cd('0x1b'))](_0xe5cd('0x1c'));}}else{return _0x2d8ac2;}}function respondWithRpcPromise(_0x4c8c17,_0x3b11c6,_0x531e87,_0x260238){return new BPromise(function(_0x204271,_0x5829b3){var _0x385124=_0x260238||client;return _0x385124[_0xe5cd('0x1d')](_0x4c8c17,_0x531e87)[_0xe5cd('0x1e')](function(_0x1299b2){logger[_0xe5cd('0x1f')](_0xe5cd('0x20'),_0x3b11c6,_0xe5cd('0x21'));logger[_0xe5cd('0x22')]('ServicenowConfiguration,\x20%s,\x20%s,\x20%s',_0x3b11c6,_0xe5cd('0x21'),JSON['stringify'](_0x1299b2));if(_0x1299b2[_0xe5cd('0x23')]){if(_0x1299b2[_0xe5cd('0x23')][_0xe5cd('0x24')]===0x1f4){logger[_0xe5cd('0x23')](_0xe5cd('0x20'),_0x3b11c6,_0x1299b2[_0xe5cd('0x23')][_0xe5cd('0x25')]);return _0x5829b3(_0x1299b2['error'][_0xe5cd('0x25')]);}logger[_0xe5cd('0x23')](_0xe5cd('0x20'),_0x3b11c6,_0x1299b2['error'][_0xe5cd('0x25')]);return _0x204271(_0x1299b2[_0xe5cd('0x23')]['message']);}else{logger[_0xe5cd('0x1f')](_0xe5cd('0x20'),_0x3b11c6,_0xe5cd('0x21'));_0x204271(_0x1299b2[_0xe5cd('0x26')][_0xe5cd('0x25')]);}})[_0xe5cd('0x27')](function(_0x3dbf69){logger['error']('ServicenowConfiguration,\x20%s,\x20%s',_0x3b11c6,_0x3dbf69);_0x5829b3(_0x3dbf69);});});}function respondWithStatusCode(_0x56f0e9,_0x3f6ffc){_0x3f6ffc=_0x3f6ffc||0xcc;return function(_0x5e5449){if(_0x5e5449){return _0x56f0e9[_0xe5cd('0x28')](_0x3f6ffc);}return _0x56f0e9[_0xe5cd('0x29')](_0x3f6ffc)[_0xe5cd('0x2a')]();};}function respondWithResult(_0x535a60,_0x46938a){_0x46938a=_0x46938a||0xc8;return function(_0x5f25b2){if(_0x5f25b2){return _0x535a60[_0xe5cd('0x29')](_0x46938a)['json'](_0x5f25b2);}};}function respondWithFilteredResult(_0x6c2399,_0x250812){return function(_0x1dc8f2){if(_0x1dc8f2){var _0x5388f5=_0x1dc8f2[_0xe5cd('0x2b')],_0x549432=_0x250812[_0xe5cd('0x2c')],_0xb70c85=_0x250812['offset']+_0x250812[_0xe5cd('0x2d')],_0xcda950;if(_0xb70c85>=_0x5388f5){_0xb70c85=_0x5388f5;_0xcda950=0xc8;}else{_0xcda950=0xce;}_0x6c2399[_0xe5cd('0x29')](_0xcda950);return _0x6c2399[_0xe5cd('0x2e')](_0xe5cd('0x2f'),_0x549432+'-'+_0xb70c85+'/'+_0x5388f5)[_0xe5cd('0x30')](_0x1dc8f2);}return null;};}function patchUpdates(_0x275ee2){return function(_0x519ba7){try{jsonpatch['apply'](_0x519ba7,_0x275ee2,!![]);}catch(_0x5daaf7){return BPromise[_0xe5cd('0x31')](_0x5daaf7);}return _0x519ba7[_0xe5cd('0x32')]();};}function saveUpdates(_0x18c2da,_0x491549){return function(_0x206b47){if(_0x206b47){return _0x206b47[_0xe5cd('0x33')](_0x18c2da)[_0xe5cd('0x1e')](function(_0x3d6d13){return _0x3d6d13;});}return null;};}function removeEntity(_0x55708e,_0x36f7de){return function(_0x331baa){if(_0x331baa){return _0x331baa[_0xe5cd('0x34')]()[_0xe5cd('0x1e')](function(){_0x55708e[_0xe5cd('0x29')](0xcc)[_0xe5cd('0x2a')]();});}};}function handleEntityNotFound(_0x5313c2,_0x561a67){return function(_0x427193){if(!_0x427193){_0x5313c2[_0xe5cd('0x28')](0x194);}return _0x427193;};}function handleError(_0x5cf3fd,_0x2e638d){_0x2e638d=_0x2e638d||0x1f4;return function(_0x5876ba){logger[_0xe5cd('0x23')](_0x5876ba[_0xe5cd('0x35')]);if(_0x5876ba['name']){delete _0x5876ba[_0xe5cd('0x36')];}_0x5cf3fd[_0xe5cd('0x29')](_0x2e638d)[_0xe5cd('0x37')](_0x5876ba);};}exports[_0xe5cd('0x38')]=function(_0x1c8447,_0x1892a3){var _0x2bedf3={},_0x15749c={},_0x5111d1={'count':0x0,'rows':[]};var _0x7bcb4b=_[_0xe5cd('0x39')](db[_0xe5cd('0x3a')]['rawAttributes'],function(_0x367b04){return{'name':_0x367b04[_0xe5cd('0x3b')],'type':_0x367b04[_0xe5cd('0x3c')][_0xe5cd('0x3d')]};});_0x15749c[_0xe5cd('0x3e')]=_['map'](_0x7bcb4b,_0xe5cd('0x36'));_0x15749c[_0xe5cd('0x3f')]=_[_0xe5cd('0x40')](_0x1c8447[_0xe5cd('0x3f')]);_0x15749c['filters']=_[_0xe5cd('0x41')](_0x15749c[_0xe5cd('0x3e')],_0x15749c['query']);_0x2bedf3[_0xe5cd('0x42')]=_[_0xe5cd('0x41')](_0x15749c[_0xe5cd('0x3e')],qs[_0xe5cd('0x43')](_0x1c8447[_0xe5cd('0x3f')]['fields']));_0x2bedf3[_0xe5cd('0x42')]=_0x2bedf3[_0xe5cd('0x42')][_0xe5cd('0x44')]?_0x2bedf3[_0xe5cd('0x42')]:_0x15749c['model'];if(!_0x1c8447[_0xe5cd('0x3f')]['hasOwnProperty'](_0xe5cd('0x45'))){_0x2bedf3['limit']=qs[_0xe5cd('0x2d')](_0x1c8447[_0xe5cd('0x3f')][_0xe5cd('0x2d')]);_0x2bedf3['offset']=qs[_0xe5cd('0x2c')](_0x1c8447[_0xe5cd('0x3f')][_0xe5cd('0x2c')]);}_0x2bedf3[_0xe5cd('0x46')]=qs[_0xe5cd('0x47')](_0x1c8447[_0xe5cd('0x3f')]['sort']);_0x2bedf3[_0xe5cd('0x48')]=qs[_0xe5cd('0x49')](_['pick'](_0x1c8447[_0xe5cd('0x3f')],_0x15749c[_0xe5cd('0x49')]));if(_0x1c8447[_0xe5cd('0x3f')]['filter']){_0x2bedf3['where']=_[_0xe5cd('0x4a')](_0x2bedf3[_0xe5cd('0x48')],{'$or':_['map'](_0x7bcb4b,function(_0x2b9145){if(_0x2b9145[_0xe5cd('0x3c')]!==_0xe5cd('0x4b')){var _0x5e2773={};_0x5e2773[_0x2b9145[_0xe5cd('0x36')]]={'$like':'%'+_0x1c8447[_0xe5cd('0x3f')][_0xe5cd('0x4c')]+'%'};return _0x5e2773;}})});}_0x2bedf3=_[_0xe5cd('0x4a')]({},_0x2bedf3,_0x1c8447[_0xe5cd('0x4d')]);var _0x455afc={'where':_0x2bedf3['where']};return db[_0xe5cd('0x3a')][_0xe5cd('0x2b')](_0x455afc)[_0xe5cd('0x1e')](function(_0x8f1abd){_0x5111d1[_0xe5cd('0x2b')]=_0x8f1abd;if(_0x1c8447[_0xe5cd('0x3f')][_0xe5cd('0x4e')]){_0x2bedf3[_0xe5cd('0x4f')]=[{'all':!![]}];}return db['ServicenowConfiguration']['findAll'](_0x2bedf3);})[_0xe5cd('0x1e')](function(_0x42634b){_0x5111d1[_0xe5cd('0x50')]=_0x42634b;return _0x5111d1;})[_0xe5cd('0x1e')](respondWithFilteredResult(_0x1892a3,_0x2bedf3))['catch'](handleError(_0x1892a3,null));};exports[_0xe5cd('0x51')]=function(_0x19360d,_0x2c12a5){var _0x4ba8ef={'raw':![],'where':{'id':_0x19360d['params']['id']}},_0x24eb42={};_0x24eb42[_0xe5cd('0x3e')]=_[_0xe5cd('0x40')](db[_0xe5cd('0x3a')][_0xe5cd('0x52')]);_0x24eb42[_0xe5cd('0x3f')]=_[_0xe5cd('0x40')](_0x19360d[_0xe5cd('0x3f')]);_0x24eb42[_0xe5cd('0x49')]=_['intersection'](_0x24eb42[_0xe5cd('0x3e')],_0x24eb42[_0xe5cd('0x3f')]);_0x4ba8ef['attributes']=_[_0xe5cd('0x41')](_0x24eb42[_0xe5cd('0x3e')],qs[_0xe5cd('0x43')](_0x19360d[_0xe5cd('0x3f')][_0xe5cd('0x43')]));_0x4ba8ef[_0xe5cd('0x42')]=_0x4ba8ef['attributes'][_0xe5cd('0x44')]?_0x4ba8ef[_0xe5cd('0x42')]:_0x24eb42[_0xe5cd('0x3e')];if(_0x19360d[_0xe5cd('0x3f')][_0xe5cd('0x4e')]){_0x4ba8ef[_0xe5cd('0x4f')]=[{'all':!![]}];}_0x4ba8ef=_[_0xe5cd('0x4a')]({},_0x4ba8ef,_0x19360d['options']);return db['ServicenowConfiguration']['find'](_0x4ba8ef)[_0xe5cd('0x1e')](handleEntityNotFound(_0x2c12a5,null))[_0xe5cd('0x1e')](respondWithResult(_0x2c12a5,null))[_0xe5cd('0x27')](handleError(_0x2c12a5,null));};exports[_0xe5cd('0x53')]=function(_0x187885,_0x1c80dc){return db[_0xe5cd('0x3a')]['create'](_0x187885[_0xe5cd('0x54')],{})['then'](respondWithResult(_0x1c80dc,0xc9))[_0xe5cd('0x27')](handleError(_0x1c80dc,null));};exports['update']=function(_0x223629,_0x3a02ea){if(_0x223629[_0xe5cd('0x54')]['id']){delete _0x223629[_0xe5cd('0x54')]['id'];}return db[_0xe5cd('0x3a')]['find']({'where':{'id':_0x223629[_0xe5cd('0x55')]['id']}})[_0xe5cd('0x1e')](handleEntityNotFound(_0x3a02ea,null))[_0xe5cd('0x1e')](saveUpdates(_0x223629['body'],null))[_0xe5cd('0x1e')](respondWithResult(_0x3a02ea,null))[_0xe5cd('0x27')](handleError(_0x3a02ea,null));};exports['destroy']=function(_0x280ff0,_0x36e773){return db[_0xe5cd('0x3a')][_0xe5cd('0x56')]({'where':{'id':_0x280ff0['params']['id']}})[_0xe5cd('0x1e')](handleEntityNotFound(_0x36e773,null))[_0xe5cd('0x1e')](removeEntity(_0x36e773,null))[_0xe5cd('0x27')](handleError(_0x36e773,null));};exports[_0xe5cd('0x57')]=function(_0x146c4b,_0x3bdc70,_0x154f1e){var _0x4bf3f3={};var _0x20d5ca={};var _0x24390a;var _0x3bfaa3;return db['ServicenowConfiguration'][_0xe5cd('0x58')]({'where':{'id':_0x146c4b['params']['id']}})['then'](handleEntityNotFound(_0x3bdc70,null))[_0xe5cd('0x1e')](function(_0x4d2943){if(_0x4d2943){_0x24390a=_0x4d2943;_0x20d5ca[_0xe5cd('0x3e')]=_[_0xe5cd('0x40')](db[_0xe5cd('0x59')]['rawAttributes']);_0x20d5ca['query']=_['keys'](_0x146c4b[_0xe5cd('0x3f')]);_0x20d5ca[_0xe5cd('0x49')]=_[_0xe5cd('0x41')](_0x20d5ca['model'],_0x20d5ca[_0xe5cd('0x3f')]);_0x4bf3f3[_0xe5cd('0x42')]=_[_0xe5cd('0x41')](_0x20d5ca[_0xe5cd('0x3e')],qs[_0xe5cd('0x43')](_0x146c4b[_0xe5cd('0x3f')][_0xe5cd('0x43')]));_0x4bf3f3[_0xe5cd('0x42')]=_0x4bf3f3['attributes'][_0xe5cd('0x44')]?_0x4bf3f3[_0xe5cd('0x42')]:_0x20d5ca['model'];_0x4bf3f3['order']=qs[_0xe5cd('0x47')](_0x146c4b[_0xe5cd('0x3f')][_0xe5cd('0x47')]);_0x4bf3f3[_0xe5cd('0x48')]=qs['filters'](_[_0xe5cd('0x5a')](_0x146c4b[_0xe5cd('0x3f')],_0x20d5ca[_0xe5cd('0x49')]));if(_0x146c4b[_0xe5cd('0x3f')]['filter']){_0x4bf3f3[_0xe5cd('0x48')]=_['merge'](_0x4bf3f3[_0xe5cd('0x48')],{'$or':_[_0xe5cd('0x39')](_0x4bf3f3[_0xe5cd('0x42')],function(_0x4fc440){var _0x4ea155={};_0x4ea155[_0x4fc440]={'$like':'%'+_0x146c4b['query']['filter']+'%'};return _0x4ea155;})});}_0x4bf3f3=_[_0xe5cd('0x4a')]({},_0x4bf3f3,_0x146c4b[_0xe5cd('0x4d')]);return _0x24390a[_0xe5cd('0x57')](_0x4bf3f3);}})[_0xe5cd('0x1e')](function(_0x55e4c3){if(_0x55e4c3){_0x3bfaa3=_0x55e4c3[_0xe5cd('0x44')];if(!_0x146c4b[_0xe5cd('0x3f')]['hasOwnProperty']('nolimit')){_0x4bf3f3['limit']=qs[_0xe5cd('0x2d')](_0x146c4b[_0xe5cd('0x3f')][_0xe5cd('0x2d')]);_0x4bf3f3[_0xe5cd('0x2c')]=qs[_0xe5cd('0x2c')](_0x146c4b[_0xe5cd('0x3f')][_0xe5cd('0x2c')]);}return _0x24390a['getFields'](_0x4bf3f3);}})['then'](function(_0x1c9e91){if(_0x1c9e91){return _0x1c9e91?{'count':_0x3bfaa3,'rows':_0x1c9e91}:null;}})[_0xe5cd('0x1e')](respondWithResult(_0x3bdc70,null))['catch'](handleError(_0x3bdc70,null));};exports['getSubjects']=function(_0x4045cc,_0x1b9ff8,_0x3add01){var _0xcf7de5={};var _0x160571={};var _0x1b96a8;var _0x5b97d9;return db[_0xe5cd('0x3a')][_0xe5cd('0x58')]({'where':{'id':_0x4045cc[_0xe5cd('0x55')]['id']}})[_0xe5cd('0x1e')](handleEntityNotFound(_0x1b9ff8,null))[_0xe5cd('0x1e')](function(_0x329f1e){if(_0x329f1e){_0x1b96a8=_0x329f1e;_0x160571['model']=_[_0xe5cd('0x40')](db[_0xe5cd('0x59')][_0xe5cd('0x52')]);_0x160571['query']=_[_0xe5cd('0x40')](_0x4045cc[_0xe5cd('0x3f')]);_0x160571['filters']=_[_0xe5cd('0x41')](_0x160571['model'],_0x160571[_0xe5cd('0x3f')]);_0xcf7de5[_0xe5cd('0x42')]=_[_0xe5cd('0x41')](_0x160571['model'],qs[_0xe5cd('0x43')](_0x4045cc['query'][_0xe5cd('0x43')]));_0xcf7de5[_0xe5cd('0x42')]=_0xcf7de5[_0xe5cd('0x42')]['length']?_0xcf7de5[_0xe5cd('0x42')]:_0x160571[_0xe5cd('0x3e')];_0xcf7de5['order']=qs[_0xe5cd('0x47')](_0x4045cc['query'][_0xe5cd('0x47')]);_0xcf7de5[_0xe5cd('0x48')]=qs[_0xe5cd('0x49')](_[_0xe5cd('0x5a')](_0x4045cc[_0xe5cd('0x3f')],_0x160571[_0xe5cd('0x49')]));if(_0x4045cc[_0xe5cd('0x3f')]['filter']){_0xcf7de5['where']=_[_0xe5cd('0x4a')](_0xcf7de5[_0xe5cd('0x48')],{'$or':_[_0xe5cd('0x39')](_0xcf7de5['attributes'],function(_0x1b0139){var _0x33c1c8={};_0x33c1c8[_0x1b0139]={'$like':'%'+_0x4045cc[_0xe5cd('0x3f')]['filter']+'%'};return _0x33c1c8;})});}_0xcf7de5=_['merge']({},_0xcf7de5,_0x4045cc[_0xe5cd('0x4d')]);return _0x1b96a8['getSubjects'](_0xcf7de5);}})[_0xe5cd('0x1e')](function(_0x175d26){if(_0x175d26){_0x5b97d9=_0x175d26[_0xe5cd('0x44')];if(!_0x4045cc[_0xe5cd('0x3f')][_0xe5cd('0x5b')](_0xe5cd('0x45'))){_0xcf7de5['limit']=qs['limit'](_0x4045cc[_0xe5cd('0x3f')][_0xe5cd('0x2d')]);_0xcf7de5[_0xe5cd('0x2c')]=qs[_0xe5cd('0x2c')](_0x4045cc[_0xe5cd('0x3f')][_0xe5cd('0x2c')]);}return _0x1b96a8[_0xe5cd('0x5c')](_0xcf7de5);}})['then'](function(_0x9db049){if(_0x9db049){return _0x9db049?{'count':_0x5b97d9,'rows':_0x9db049}:null;}})[_0xe5cd('0x1e')](respondWithResult(_0x1b9ff8,null))[_0xe5cd('0x27')](handleError(_0x1b9ff8,null));};exports[_0xe5cd('0x5d')]=function(_0x4fdd63,_0x459fc4,_0x5c2303){var _0x1930eb={};var _0x4e32c8={};var _0x5b9c47;var _0x5f5896;return db[_0xe5cd('0x3a')][_0xe5cd('0x58')]({'where':{'id':_0x4fdd63[_0xe5cd('0x55')]['id']}})[_0xe5cd('0x1e')](handleEntityNotFound(_0x459fc4,null))[_0xe5cd('0x1e')](function(_0x147cfc){if(_0x147cfc){_0x5b9c47=_0x147cfc;_0x4e32c8['model']=_[_0xe5cd('0x40')](db[_0xe5cd('0x59')][_0xe5cd('0x52')]);_0x4e32c8[_0xe5cd('0x3f')]=_['keys'](_0x4fdd63[_0xe5cd('0x3f')]);_0x4e32c8[_0xe5cd('0x49')]=_[_0xe5cd('0x41')](_0x4e32c8[_0xe5cd('0x3e')],_0x4e32c8['query']);_0x1930eb[_0xe5cd('0x42')]=_[_0xe5cd('0x41')](_0x4e32c8['model'],qs['fields'](_0x4fdd63[_0xe5cd('0x3f')][_0xe5cd('0x43')]));_0x1930eb[_0xe5cd('0x42')]=_0x1930eb[_0xe5cd('0x42')]['length']?_0x1930eb['attributes']:_0x4e32c8[_0xe5cd('0x3e')];_0x1930eb[_0xe5cd('0x46')]=qs['sort'](_0x4fdd63[_0xe5cd('0x3f')][_0xe5cd('0x47')]);_0x1930eb['where']=qs[_0xe5cd('0x49')](_['pick'](_0x4fdd63['query'],_0x4e32c8['filters']));if(_0x4fdd63[_0xe5cd('0x3f')]['filter']){_0x1930eb[_0xe5cd('0x48')]=_[_0xe5cd('0x4a')](_0x1930eb['where'],{'$or':_[_0xe5cd('0x39')](_0x1930eb['attributes'],function(_0x3eb929){var _0xcda62b={};_0xcda62b[_0x3eb929]={'$like':'%'+_0x4fdd63['query'][_0xe5cd('0x4c')]+'%'};return _0xcda62b;})});}_0x1930eb=_['merge']({},_0x1930eb,_0x4fdd63[_0xe5cd('0x4d')]);return _0x5b9c47[_0xe5cd('0x5d')](_0x1930eb);}})['then'](function(_0x47d76d){if(_0x47d76d){_0x5f5896=_0x47d76d['length'];if(!_0x4fdd63[_0xe5cd('0x3f')]['hasOwnProperty']('nolimit')){_0x1930eb[_0xe5cd('0x2d')]=qs['limit'](_0x4fdd63[_0xe5cd('0x3f')][_0xe5cd('0x2d')]);_0x1930eb['offset']=qs['offset'](_0x4fdd63['query'][_0xe5cd('0x2c')]);}return _0x5b9c47['getDescriptions'](_0x1930eb);}})[_0xe5cd('0x1e')](function(_0x5c3700){if(_0x5c3700){return _0x5c3700?{'count':_0x5f5896,'rows':_0x5c3700}:null;}})['then'](respondWithResult(_0x459fc4,null))[_0xe5cd('0x27')](handleError(_0x459fc4,null));};
\ No newline at end of file
+var _0x31e2=['getSubjects','pick','getDescriptions','rimraf','fast-json-patch','bluebird','util','path','sox','to-csv','crypto','jsforce','desk.js','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/advancedSearch','../../config/logger','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','ServicenowConfiguration,\x20%s,\x20%s','debug','ServicenowConfiguration,\x20%s,\x20%s,\x20%s','request\x20sent','stringify','error','code','message','result','catch','sendStatus','end','status','json','count','offset','set','Content-Range','apply','reject','save','update','destroy','stack','name','send','index','rawAttributes','fieldName','model','map','query','keys','filters','intersection','fields','length','attributes','nolimit','limit','order','sort','where','merge','type','VIRTUAL','filter','options','ServicenowConfiguration','includeAll','include','findAll','rows','show','params','find','create','body','getFields','findOne','ServicenowField','hasOwnProperty'];(function(_0x205de3,_0x50bc59){var _0x6ca7b=function(_0x212253){while(--_0x212253){_0x205de3['push'](_0x205de3['shift']());}};_0x6ca7b(++_0x50bc59);}(_0x31e2,0xb9));var _0x231e=function(_0x38fb8b,_0x70dd0a){_0x38fb8b=_0x38fb8b-0x0;var _0x1ec681=_0x31e2[_0x38fb8b];return _0x1ec681;};'use strict';var pdf=require('html-pdf');var emlformat=require('eml-format');var rimraf=require(_0x231e('0x0'));var zipdir=require('zip-dir');var jsonpatch=require(_0x231e('0x1'));var rp=require('request-promise');var moment=require('moment');var BPromise=require(_0x231e('0x2'));var Mustache=require('mustache');var util=require(_0x231e('0x3'));var path=require(_0x231e('0x4'));var sox=require(_0x231e('0x5'));var csv=require(_0x231e('0x6'));var ejs=require('ejs');var fs=require('fs');var _=require('lodash');var squel=require('squel');var crypto=require(_0x231e('0x7'));var jsforce=require(_0x231e('0x8'));var deskjs=require(_0x231e('0x9'));var toCsv=require(_0x231e('0x6'));var querystring=require(_0x231e('0xa'));var Papa=require(_0x231e('0xb'));var Redis=require(_0x231e('0xc'));var authService=require(_0x231e('0xd'));var qs=require('../../components/parsers/qs');var as=require(_0x231e('0xe'));var hardwareService=require('../../config/license/hardware');var logger=require(_0x231e('0xf'))('api');var utils=require('../../config/utils');var config=require('../../config/environment');var db=require('../../mysqldb')['db'];var jayson=require(_0x231e('0x10'));var client=jayson[_0x231e('0x11')][_0x231e('0x12')]({'port':0x232a});function checkPasswordPattern(_0x1a63d9,_0xf20b3,_0x1d212c){if(_0x1d212c){var _0x56ea80=new RegExp(/(?=.*[a-z])(?=.*[A-Z])(?=.*[0-9])(?=.*[?!@#\$%\^&\*~\-_=+[{\]\}])(?=.{8,})/);if(_0x56ea80[_0x231e('0x13')](_0xf20b3)){return _0x1a63d9;}else{throw new db[(_0x231e('0x14'))][(_0x231e('0x15'))](_0x231e('0x16'));}}else{return _0x1a63d9;}}function respondWithRpcPromise(_0xa5d1f6,_0x23a0d1,_0x247812,_0x566453){return new BPromise(function(_0x13a5f2,_0x31b419){var _0x5e534a=_0x566453||client;return _0x5e534a[_0x231e('0x17')](_0xa5d1f6,_0x247812)[_0x231e('0x18')](function(_0x174d3e){logger[_0x231e('0x19')](_0x231e('0x1a'),_0x23a0d1,'request\x20sent');logger[_0x231e('0x1b')](_0x231e('0x1c'),_0x23a0d1,_0x231e('0x1d'),JSON[_0x231e('0x1e')](_0x174d3e));if(_0x174d3e[_0x231e('0x1f')]){if(_0x174d3e[_0x231e('0x1f')][_0x231e('0x20')]===0x1f4){logger[_0x231e('0x1f')](_0x231e('0x1a'),_0x23a0d1,_0x174d3e[_0x231e('0x1f')][_0x231e('0x21')]);return _0x31b419(_0x174d3e[_0x231e('0x1f')]['message']);}logger[_0x231e('0x1f')]('ServicenowConfiguration,\x20%s,\x20%s',_0x23a0d1,_0x174d3e[_0x231e('0x1f')][_0x231e('0x21')]);return _0x13a5f2(_0x174d3e[_0x231e('0x1f')][_0x231e('0x21')]);}else{logger['info'](_0x231e('0x1a'),_0x23a0d1,_0x231e('0x1d'));_0x13a5f2(_0x174d3e[_0x231e('0x22')][_0x231e('0x21')]);}})[_0x231e('0x23')](function(_0x40a171){logger[_0x231e('0x1f')](_0x231e('0x1a'),_0x23a0d1,_0x40a171);_0x31b419(_0x40a171);});});}function respondWithStatusCode(_0x4448b6,_0x561a97){_0x561a97=_0x561a97||0xcc;return function(_0x150177){if(_0x150177){return _0x4448b6[_0x231e('0x24')](_0x561a97);}return _0x4448b6['status'](_0x561a97)[_0x231e('0x25')]();};}function respondWithResult(_0x53c652,_0x987c02){_0x987c02=_0x987c02||0xc8;return function(_0x3c1f30){if(_0x3c1f30){return _0x53c652[_0x231e('0x26')](_0x987c02)[_0x231e('0x27')](_0x3c1f30);}};}function respondWithFilteredResult(_0x44478b,_0x2045f5){return function(_0x214438){if(_0x214438){var _0x47edab=_0x214438[_0x231e('0x28')],_0x4a357b=_0x2045f5[_0x231e('0x29')],_0x34670c=_0x2045f5[_0x231e('0x29')]+_0x2045f5['limit'],_0x2546e7;if(_0x34670c>=_0x47edab){_0x34670c=_0x47edab;_0x2546e7=0xc8;}else{_0x2546e7=0xce;}_0x44478b[_0x231e('0x26')](_0x2546e7);return _0x44478b[_0x231e('0x2a')](_0x231e('0x2b'),_0x4a357b+'-'+_0x34670c+'/'+_0x47edab)[_0x231e('0x27')](_0x214438);}return null;};}function patchUpdates(_0x458c2e){return function(_0x2027d5){try{jsonpatch[_0x231e('0x2c')](_0x2027d5,_0x458c2e,!![]);}catch(_0x5c3ce8){return BPromise[_0x231e('0x2d')](_0x5c3ce8);}return _0x2027d5[_0x231e('0x2e')]();};}function saveUpdates(_0x2d86f4,_0x27b09a){return function(_0x41325c){if(_0x41325c){return _0x41325c[_0x231e('0x2f')](_0x2d86f4)[_0x231e('0x18')](function(_0x538c10){return _0x538c10;});}return null;};}function removeEntity(_0x5d8610,_0x4f4153){return function(_0x2e7caf){if(_0x2e7caf){return _0x2e7caf[_0x231e('0x30')]()[_0x231e('0x18')](function(){_0x5d8610['status'](0xcc)[_0x231e('0x25')]();});}};}function handleEntityNotFound(_0x1fbae2,_0x2145cb){return function(_0x31bcf5){if(!_0x31bcf5){_0x1fbae2[_0x231e('0x24')](0x194);}return _0x31bcf5;};}function handleError(_0x41e575,_0x2ee46e){_0x2ee46e=_0x2ee46e||0x1f4;return function(_0x10faf6){logger[_0x231e('0x1f')](_0x10faf6[_0x231e('0x31')]);if(_0x10faf6[_0x231e('0x32')]){delete _0x10faf6[_0x231e('0x32')];}_0x41e575[_0x231e('0x26')](_0x2ee46e)[_0x231e('0x33')](_0x10faf6);};}exports[_0x231e('0x34')]=function(_0x4447a3,_0x3afe81){var _0x5ed9c6={},_0x3f92c3={},_0x3448e6={'count':0x0,'rows':[]};var _0x12a428=_['map'](db['ServicenowConfiguration'][_0x231e('0x35')],function(_0x5d077b){return{'name':_0x5d077b[_0x231e('0x36')],'type':_0x5d077b['type']['key']};});_0x3f92c3[_0x231e('0x37')]=_[_0x231e('0x38')](_0x12a428,_0x231e('0x32'));_0x3f92c3[_0x231e('0x39')]=_[_0x231e('0x3a')](_0x4447a3[_0x231e('0x39')]);_0x3f92c3[_0x231e('0x3b')]=_[_0x231e('0x3c')](_0x3f92c3[_0x231e('0x37')],_0x3f92c3[_0x231e('0x39')]);_0x5ed9c6['attributes']=_[_0x231e('0x3c')](_0x3f92c3[_0x231e('0x37')],qs[_0x231e('0x3d')](_0x4447a3[_0x231e('0x39')]['fields']));_0x5ed9c6['attributes']=_0x5ed9c6['attributes'][_0x231e('0x3e')]?_0x5ed9c6[_0x231e('0x3f')]:_0x3f92c3[_0x231e('0x37')];if(!_0x4447a3[_0x231e('0x39')]['hasOwnProperty'](_0x231e('0x40'))){_0x5ed9c6['limit']=qs[_0x231e('0x41')](_0x4447a3[_0x231e('0x39')]['limit']);_0x5ed9c6[_0x231e('0x29')]=qs[_0x231e('0x29')](_0x4447a3[_0x231e('0x39')][_0x231e('0x29')]);}_0x5ed9c6[_0x231e('0x42')]=qs['sort'](_0x4447a3['query'][_0x231e('0x43')]);_0x5ed9c6[_0x231e('0x44')]=qs['filters'](_['pick'](_0x4447a3[_0x231e('0x39')],_0x3f92c3[_0x231e('0x3b')]));if(_0x4447a3[_0x231e('0x39')]['filter']){_0x5ed9c6[_0x231e('0x44')]=_[_0x231e('0x45')](_0x5ed9c6['where'],{'$or':_[_0x231e('0x38')](_0x12a428,function(_0x16eff7){if(_0x16eff7[_0x231e('0x46')]!==_0x231e('0x47')){var _0x5bf64e={};_0x5bf64e[_0x16eff7['name']]={'$like':'%'+_0x4447a3[_0x231e('0x39')][_0x231e('0x48')]+'%'};return _0x5bf64e;}})});}_0x5ed9c6=_[_0x231e('0x45')]({},_0x5ed9c6,_0x4447a3[_0x231e('0x49')]);var _0x36b0e7={'where':_0x5ed9c6[_0x231e('0x44')]};return db[_0x231e('0x4a')]['count'](_0x36b0e7)[_0x231e('0x18')](function(_0x2fdfee){_0x3448e6[_0x231e('0x28')]=_0x2fdfee;if(_0x4447a3['query'][_0x231e('0x4b')]){_0x5ed9c6[_0x231e('0x4c')]=[{'all':!![]}];}return db['ServicenowConfiguration'][_0x231e('0x4d')](_0x5ed9c6);})[_0x231e('0x18')](function(_0x3f8817){_0x3448e6[_0x231e('0x4e')]=_0x3f8817;return _0x3448e6;})['then'](respondWithFilteredResult(_0x3afe81,_0x5ed9c6))[_0x231e('0x23')](handleError(_0x3afe81,null));};exports[_0x231e('0x4f')]=function(_0x45ef2c,_0x5a37df){var _0x55458b={'raw':![],'where':{'id':_0x45ef2c[_0x231e('0x50')]['id']}},_0x5411c8={};_0x5411c8[_0x231e('0x37')]=_[_0x231e('0x3a')](db[_0x231e('0x4a')][_0x231e('0x35')]);_0x5411c8[_0x231e('0x39')]=_[_0x231e('0x3a')](_0x45ef2c[_0x231e('0x39')]);_0x5411c8[_0x231e('0x3b')]=_[_0x231e('0x3c')](_0x5411c8[_0x231e('0x37')],_0x5411c8[_0x231e('0x39')]);_0x55458b[_0x231e('0x3f')]=_[_0x231e('0x3c')](_0x5411c8[_0x231e('0x37')],qs[_0x231e('0x3d')](_0x45ef2c['query'][_0x231e('0x3d')]));_0x55458b['attributes']=_0x55458b[_0x231e('0x3f')][_0x231e('0x3e')]?_0x55458b[_0x231e('0x3f')]:_0x5411c8[_0x231e('0x37')];if(_0x45ef2c[_0x231e('0x39')][_0x231e('0x4b')]){_0x55458b['include']=[{'all':!![]}];}_0x55458b=_[_0x231e('0x45')]({},_0x55458b,_0x45ef2c['options']);return db[_0x231e('0x4a')][_0x231e('0x51')](_0x55458b)[_0x231e('0x18')](handleEntityNotFound(_0x5a37df,null))['then'](respondWithResult(_0x5a37df,null))['catch'](handleError(_0x5a37df,null));};exports[_0x231e('0x52')]=function(_0x1399f1,_0x284270){return db['ServicenowConfiguration'][_0x231e('0x52')](_0x1399f1[_0x231e('0x53')],{})[_0x231e('0x18')](respondWithResult(_0x284270,0xc9))[_0x231e('0x23')](handleError(_0x284270,null));};exports[_0x231e('0x2f')]=function(_0x387fb1,_0x2bae8f){if(_0x387fb1[_0x231e('0x53')]['id']){delete _0x387fb1[_0x231e('0x53')]['id'];}return db['ServicenowConfiguration'][_0x231e('0x51')]({'where':{'id':_0x387fb1[_0x231e('0x50')]['id']}})[_0x231e('0x18')](handleEntityNotFound(_0x2bae8f,null))[_0x231e('0x18')](saveUpdates(_0x387fb1[_0x231e('0x53')],null))[_0x231e('0x18')](respondWithResult(_0x2bae8f,null))[_0x231e('0x23')](handleError(_0x2bae8f,null));};exports['destroy']=function(_0x1caccc,_0x4d0631){return db['ServicenowConfiguration'][_0x231e('0x51')]({'where':{'id':_0x1caccc['params']['id']}})[_0x231e('0x18')](handleEntityNotFound(_0x4d0631,null))[_0x231e('0x18')](removeEntity(_0x4d0631,null))[_0x231e('0x23')](handleError(_0x4d0631,null));};exports[_0x231e('0x54')]=function(_0x2081a6,_0x2c6d11,_0xf2ddb){var _0x275dce={};var _0xf73f2d={};var _0x37627b;var _0x5ec3a8;return db[_0x231e('0x4a')][_0x231e('0x55')]({'where':{'id':_0x2081a6[_0x231e('0x50')]['id']}})[_0x231e('0x18')](handleEntityNotFound(_0x2c6d11,null))[_0x231e('0x18')](function(_0x129842){if(_0x129842){_0x37627b=_0x129842;_0xf73f2d[_0x231e('0x37')]=_[_0x231e('0x3a')](db[_0x231e('0x56')][_0x231e('0x35')]);_0xf73f2d['query']=_[_0x231e('0x3a')](_0x2081a6[_0x231e('0x39')]);_0xf73f2d[_0x231e('0x3b')]=_['intersection'](_0xf73f2d[_0x231e('0x37')],_0xf73f2d[_0x231e('0x39')]);_0x275dce[_0x231e('0x3f')]=_[_0x231e('0x3c')](_0xf73f2d['model'],qs[_0x231e('0x3d')](_0x2081a6['query'][_0x231e('0x3d')]));_0x275dce['attributes']=_0x275dce[_0x231e('0x3f')][_0x231e('0x3e')]?_0x275dce[_0x231e('0x3f')]:_0xf73f2d[_0x231e('0x37')];_0x275dce[_0x231e('0x42')]=qs[_0x231e('0x43')](_0x2081a6['query']['sort']);_0x275dce[_0x231e('0x44')]=qs['filters'](_['pick'](_0x2081a6[_0x231e('0x39')],_0xf73f2d[_0x231e('0x3b')]));if(_0x2081a6['query'][_0x231e('0x48')]){_0x275dce[_0x231e('0x44')]=_['merge'](_0x275dce[_0x231e('0x44')],{'$or':_[_0x231e('0x38')](_0x275dce[_0x231e('0x3f')],function(_0x3e58c1){var _0x2a9966={};_0x2a9966[_0x3e58c1]={'$like':'%'+_0x2081a6[_0x231e('0x39')][_0x231e('0x48')]+'%'};return _0x2a9966;})});}_0x275dce=_[_0x231e('0x45')]({},_0x275dce,_0x2081a6[_0x231e('0x49')]);return _0x37627b['getFields'](_0x275dce);}})[_0x231e('0x18')](function(_0x49983d){if(_0x49983d){_0x5ec3a8=_0x49983d[_0x231e('0x3e')];if(!_0x2081a6[_0x231e('0x39')][_0x231e('0x57')](_0x231e('0x40'))){_0x275dce[_0x231e('0x41')]=qs['limit'](_0x2081a6[_0x231e('0x39')]['limit']);_0x275dce[_0x231e('0x29')]=qs[_0x231e('0x29')](_0x2081a6[_0x231e('0x39')][_0x231e('0x29')]);}return _0x37627b[_0x231e('0x54')](_0x275dce);}})[_0x231e('0x18')](function(_0x4a22d9){if(_0x4a22d9){return _0x4a22d9?{'count':_0x5ec3a8,'rows':_0x4a22d9}:null;}})[_0x231e('0x18')](respondWithResult(_0x2c6d11,null))[_0x231e('0x23')](handleError(_0x2c6d11,null));};exports[_0x231e('0x58')]=function(_0xeb1375,_0x12040e,_0x22ad85){var _0x5c940f={};var _0x4ea164={};var _0x4849c8;var _0x43e869;return db[_0x231e('0x4a')][_0x231e('0x55')]({'where':{'id':_0xeb1375['params']['id']}})[_0x231e('0x18')](handleEntityNotFound(_0x12040e,null))['then'](function(_0x2a88cb){if(_0x2a88cb){_0x4849c8=_0x2a88cb;_0x4ea164[_0x231e('0x37')]=_['keys'](db[_0x231e('0x56')][_0x231e('0x35')]);_0x4ea164[_0x231e('0x39')]=_['keys'](_0xeb1375[_0x231e('0x39')]);_0x4ea164[_0x231e('0x3b')]=_[_0x231e('0x3c')](_0x4ea164[_0x231e('0x37')],_0x4ea164[_0x231e('0x39')]);_0x5c940f[_0x231e('0x3f')]=_['intersection'](_0x4ea164[_0x231e('0x37')],qs[_0x231e('0x3d')](_0xeb1375['query'][_0x231e('0x3d')]));_0x5c940f[_0x231e('0x3f')]=_0x5c940f[_0x231e('0x3f')][_0x231e('0x3e')]?_0x5c940f[_0x231e('0x3f')]:_0x4ea164[_0x231e('0x37')];_0x5c940f[_0x231e('0x42')]=qs[_0x231e('0x43')](_0xeb1375[_0x231e('0x39')][_0x231e('0x43')]);_0x5c940f[_0x231e('0x44')]=qs[_0x231e('0x3b')](_[_0x231e('0x59')](_0xeb1375[_0x231e('0x39')],_0x4ea164[_0x231e('0x3b')]));if(_0xeb1375['query'][_0x231e('0x48')]){_0x5c940f[_0x231e('0x44')]=_[_0x231e('0x45')](_0x5c940f['where'],{'$or':_[_0x231e('0x38')](_0x5c940f[_0x231e('0x3f')],function(_0x3a0c1c){var _0x16fe3d={};_0x16fe3d[_0x3a0c1c]={'$like':'%'+_0xeb1375[_0x231e('0x39')]['filter']+'%'};return _0x16fe3d;})});}_0x5c940f=_[_0x231e('0x45')]({},_0x5c940f,_0xeb1375[_0x231e('0x49')]);return _0x4849c8[_0x231e('0x58')](_0x5c940f);}})[_0x231e('0x18')](function(_0x308c31){if(_0x308c31){_0x43e869=_0x308c31[_0x231e('0x3e')];if(!_0xeb1375[_0x231e('0x39')][_0x231e('0x57')](_0x231e('0x40'))){_0x5c940f['limit']=qs[_0x231e('0x41')](_0xeb1375[_0x231e('0x39')]['limit']);_0x5c940f[_0x231e('0x29')]=qs[_0x231e('0x29')](_0xeb1375[_0x231e('0x39')]['offset']);}return _0x4849c8[_0x231e('0x58')](_0x5c940f);}})[_0x231e('0x18')](function(_0x2e734d){if(_0x2e734d){return _0x2e734d?{'count':_0x43e869,'rows':_0x2e734d}:null;}})[_0x231e('0x18')](respondWithResult(_0x12040e,null))[_0x231e('0x23')](handleError(_0x12040e,null));};exports[_0x231e('0x5a')]=function(_0x11ca7c,_0x486e60,_0x42321c){var _0x3f3de0={};var _0x49a05e={};var _0x51b943;var _0x5d6f69;return db[_0x231e('0x4a')][_0x231e('0x55')]({'where':{'id':_0x11ca7c[_0x231e('0x50')]['id']}})['then'](handleEntityNotFound(_0x486e60,null))[_0x231e('0x18')](function(_0x5129b3){if(_0x5129b3){_0x51b943=_0x5129b3;_0x49a05e['model']=_['keys'](db[_0x231e('0x56')][_0x231e('0x35')]);_0x49a05e[_0x231e('0x39')]=_['keys'](_0x11ca7c[_0x231e('0x39')]);_0x49a05e[_0x231e('0x3b')]=_['intersection'](_0x49a05e[_0x231e('0x37')],_0x49a05e[_0x231e('0x39')]);_0x3f3de0[_0x231e('0x3f')]=_[_0x231e('0x3c')](_0x49a05e[_0x231e('0x37')],qs[_0x231e('0x3d')](_0x11ca7c[_0x231e('0x39')][_0x231e('0x3d')]));_0x3f3de0[_0x231e('0x3f')]=_0x3f3de0['attributes']['length']?_0x3f3de0[_0x231e('0x3f')]:_0x49a05e[_0x231e('0x37')];_0x3f3de0[_0x231e('0x42')]=qs[_0x231e('0x43')](_0x11ca7c['query'][_0x231e('0x43')]);_0x3f3de0[_0x231e('0x44')]=qs[_0x231e('0x3b')](_[_0x231e('0x59')](_0x11ca7c[_0x231e('0x39')],_0x49a05e[_0x231e('0x3b')]));if(_0x11ca7c['query']['filter']){_0x3f3de0[_0x231e('0x44')]=_[_0x231e('0x45')](_0x3f3de0[_0x231e('0x44')],{'$or':_[_0x231e('0x38')](_0x3f3de0[_0x231e('0x3f')],function(_0x4149b8){var _0x206294={};_0x206294[_0x4149b8]={'$like':'%'+_0x11ca7c['query'][_0x231e('0x48')]+'%'};return _0x206294;})});}_0x3f3de0=_[_0x231e('0x45')]({},_0x3f3de0,_0x11ca7c['options']);return _0x51b943['getDescriptions'](_0x3f3de0);}})[_0x231e('0x18')](function(_0x12e92d){if(_0x12e92d){_0x5d6f69=_0x12e92d[_0x231e('0x3e')];if(!_0x11ca7c[_0x231e('0x39')][_0x231e('0x57')]('nolimit')){_0x3f3de0[_0x231e('0x41')]=qs['limit'](_0x11ca7c[_0x231e('0x39')][_0x231e('0x41')]);_0x3f3de0[_0x231e('0x29')]=qs[_0x231e('0x29')](_0x11ca7c['query'][_0x231e('0x29')]);}return _0x51b943[_0x231e('0x5a')](_0x3f3de0);}})['then'](function(_0x2547d6){if(_0x2547d6){return _0x2547d6?{'count':_0x5d6f69,'rows':_0x2547d6}:null;}})['then'](respondWithResult(_0x486e60,null))[_0x231e('0x23')](handleError(_0x486e60,null));};
\ No newline at end of file
diff --git a/server/api/intServicenowConfiguration/intServicenowConfiguration.model.js b/server/api/intServicenowConfiguration/intServicenowConfiguration.model.js
index 0957ee9..55ac752 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 _0x31c1=['rimraf','define','int_servicenow_configurations','util','../../config/logger','moment','request-promise','path'];(function(_0x258b93,_0x188ccc){var _0x35484b=function(_0x2563ea){while(--_0x2563ea){_0x258b93['push'](_0x258b93['shift']());}};_0x35484b(++_0x188ccc);}(_0x31c1,0x1ab));var _0x131c=function(_0x7b444b,_0x2b1114){_0x7b444b=_0x7b444b-0x0;var _0xb5824a=_0x31c1[_0x7b444b];return _0xb5824a;};'use strict';var _=require('lodash');var util=require(_0x131c('0x0'));var logger=require(_0x131c('0x1'))('api');var moment=require(_0x131c('0x2'));var BPromise=require('bluebird');var rp=require(_0x131c('0x3'));var fs=require('fs');var path=require(_0x131c('0x4'));var rimraf=require(_0x131c('0x5'));var config=require('../../config/environment');var attributes=require('./intServicenowConfiguration.attributes');module['exports']=function(_0x285dea,_0x6808b9){return _0x285dea[_0x131c('0x6')]('ServicenowConfiguration',attributes,{'tableName':_0x131c('0x7'),'paranoid':![],'indexes':[],'timestamps':!![]});};
\ No newline at end of file
+var _0x4a28=['request-promise','path','rimraf','../../config/environment','./intServicenowConfiguration.attributes','exports','define','lodash','util','../../config/logger','api','moment'];(function(_0x17a764,_0x113740){var _0x8de701=function(_0x3e1f49){while(--_0x3e1f49){_0x17a764['push'](_0x17a764['shift']());}};_0x8de701(++_0x113740);}(_0x4a28,0xaf));var _0x84a2=function(_0x5930c1,_0xa26ab2){_0x5930c1=_0x5930c1-0x0;var _0x5a30d4=_0x4a28[_0x5930c1];return _0x5a30d4;};'use strict';var _=require(_0x84a2('0x0'));var util=require(_0x84a2('0x1'));var logger=require(_0x84a2('0x2'))(_0x84a2('0x3'));var moment=require(_0x84a2('0x4'));var BPromise=require('bluebird');var rp=require(_0x84a2('0x5'));var fs=require('fs');var path=require(_0x84a2('0x6'));var rimraf=require(_0x84a2('0x7'));var config=require(_0x84a2('0x8'));var attributes=require(_0x84a2('0x9'));module[_0x84a2('0xa')]=function(_0x2296f6,_0x5b1048){return _0x2296f6[_0x84a2('0xb')]('ServicenowConfiguration',attributes,{'tableName':'int_servicenow_configurations','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 6b38241..7bfea7f 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 _0xe5c0=['jayson/promise','client','http','request','then','ServicenowConfiguration,\x20%s,\x20%s','request\x20sent','ServicenowConfiguration,\x20%s,\x20%s,\x20%s','code','error','message','info','result','catch','util','moment','bluebird','randomstring','../../config/utils','../../config/logger','../../config/environment'];(function(_0x2ebf63,_0x1d0795){var _0x5aa8d1=function(_0x2feec1){while(--_0x2feec1){_0x2ebf63['push'](_0x2ebf63['shift']());}};_0x5aa8d1(++_0x1d0795);}(_0xe5c0,0xf5));var _0x0e5c=function(_0x431807,_0x187385){_0x431807=_0x431807-0x0;var _0x51d062=_0xe5c0[_0x431807];return _0x51d062;};'use strict';var _=require('lodash');var util=require(_0x0e5c('0x0'));var moment=require(_0x0e5c('0x1'));var BPromise=require(_0x0e5c('0x2'));var rs=require(_0x0e5c('0x3'));var fs=require('fs');var Redis=require('ioredis');var db=require('../../mysqldb')['db'];var utils=require(_0x0e5c('0x4'));var logger=require(_0x0e5c('0x5'))('rpc');var config=require(_0x0e5c('0x6'));var jayson=require(_0x0e5c('0x7'));var client=jayson[_0x0e5c('0x8')][_0x0e5c('0x9')]({'port':0x232a});function respondWithRpcPromise(_0xdd037f,_0x54bac9,_0x4f1591){return new BPromise(function(_0xb71f5,_0x2e83e7){return client[_0x0e5c('0xa')](_0xdd037f,_0x4f1591)[_0x0e5c('0xb')](function(_0x41a249){logger['info'](_0x0e5c('0xc'),_0x54bac9,_0x0e5c('0xd'));logger['debug'](_0x0e5c('0xe'),_0x54bac9,_0x0e5c('0xd'),JSON['stringify'](_0x41a249));if(_0x41a249['error']){if(_0x41a249['error'][_0x0e5c('0xf')]===0x1f4){logger[_0x0e5c('0x10')]('ServicenowConfiguration,\x20%s,\x20%s',_0x54bac9,_0x41a249['error'][_0x0e5c('0x11')]);return _0x2e83e7(_0x41a249[_0x0e5c('0x10')][_0x0e5c('0x11')]);}logger[_0x0e5c('0x10')]('ServicenowConfiguration,\x20%s,\x20%s',_0x54bac9,_0x41a249[_0x0e5c('0x10')][_0x0e5c('0x11')]);return _0xb71f5(_0x41a249[_0x0e5c('0x10')][_0x0e5c('0x11')]);}else{logger[_0x0e5c('0x12')]('ServicenowConfiguration,\x20%s,\x20%s',_0x54bac9,'request\x20sent');_0xb71f5(_0x41a249[_0x0e5c('0x13')]['message']);}})[_0x0e5c('0x14')](function(_0x4aab1b){logger[_0x0e5c('0x10')](_0x0e5c('0xc'),_0x54bac9,_0x4aab1b);_0x2e83e7(_0x4aab1b);});});}
\ No newline at end of file
+var _0x54f9=['../../config/logger','../../config/environment','jayson/promise','client','http','request','then','info','ServicenowConfiguration,\x20%s,\x20%s','request\x20sent','debug','ServicenowConfiguration,\x20%s,\x20%s,\x20%s','stringify','error','message','result','moment','bluebird','randomstring','ioredis','../../config/utils'];(function(_0x546396,_0x2c9c88){var _0x2bff38=function(_0xfba240){while(--_0xfba240){_0x546396['push'](_0x546396['shift']());}};_0x2bff38(++_0x2c9c88);}(_0x54f9,0x18a));var _0x954f=function(_0x316b74,_0x4440f3){_0x316b74=_0x316b74-0x0;var _0x4c7c94=_0x54f9[_0x316b74];return _0x4c7c94;};'use strict';var _=require('lodash');var util=require('util');var moment=require(_0x954f('0x0'));var BPromise=require(_0x954f('0x1'));var rs=require(_0x954f('0x2'));var fs=require('fs');var Redis=require(_0x954f('0x3'));var db=require('../../mysqldb')['db'];var utils=require(_0x954f('0x4'));var logger=require(_0x954f('0x5'))('rpc');var config=require(_0x954f('0x6'));var jayson=require(_0x954f('0x7'));var client=jayson[_0x954f('0x8')][_0x954f('0x9')]({'port':0x232a});function respondWithRpcPromise(_0x22544c,_0x5c1e82,_0x1a5162){return new BPromise(function(_0x30abbc,_0x56cdc9){return client[_0x954f('0xa')](_0x22544c,_0x1a5162)[_0x954f('0xb')](function(_0x1fcc46){logger[_0x954f('0xc')](_0x954f('0xd'),_0x5c1e82,_0x954f('0xe'));logger[_0x954f('0xf')](_0x954f('0x10'),_0x5c1e82,_0x954f('0xe'),JSON[_0x954f('0x11')](_0x1fcc46));if(_0x1fcc46['error']){if(_0x1fcc46['error']['code']===0x1f4){logger[_0x954f('0x12')](_0x954f('0xd'),_0x5c1e82,_0x1fcc46[_0x954f('0x12')][_0x954f('0x13')]);return _0x56cdc9(_0x1fcc46[_0x954f('0x12')]['message']);}logger[_0x954f('0x12')]('ServicenowConfiguration,\x20%s,\x20%s',_0x5c1e82,_0x1fcc46[_0x954f('0x12')]['message']);return _0x30abbc(_0x1fcc46[_0x954f('0x12')][_0x954f('0x13')]);}else{logger['info']('ServicenowConfiguration,\x20%s,\x20%s',_0x5c1e82,_0x954f('0xe'));_0x30abbc(_0x1fcc46[_0x954f('0x14')]['message']);}})['catch'](function(_0x21a40a){logger[_0x954f('0x12')](_0x954f('0xd'),_0x5c1e82,_0x21a40a);_0x56cdc9(_0x21a40a);});});}
\ No newline at end of file
diff --git a/server/api/intServicenowField/index.js b/server/api/intServicenowField/index.js
index bbdd086..3ad1a01 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 _0x2130=['multer','util','path','connect-timeout','express','../../components/auth/service','../../components/interaction/service','../../config/environment','./intServicenowField.controller','get','isAuthenticated','index','/:id','show','post','create','update','delete','destroy','exports'];(function(_0x3dd15e,_0x1f0015){var _0x231fd0=function(_0x4f680a){while(--_0x4f680a){_0x3dd15e['push'](_0x3dd15e['shift']());}};_0x231fd0(++_0x1f0015);}(_0x2130,0xc8));var _0x0213=function(_0x565c49,_0x54acd0){_0x565c49=_0x565c49-0x0;var _0x20ca34=_0x2130[_0x565c49];return _0x20ca34;};'use strict';var multer=require(_0x0213('0x0'));var util=require(_0x0213('0x1'));var path=require(_0x0213('0x2'));var timeout=require(_0x0213('0x3'));var express=require(_0x0213('0x4'));var router=express['Router']();var auth=require(_0x0213('0x5'));var interaction=require(_0x0213('0x6'));var config=require(_0x0213('0x7'));var controller=require(_0x0213('0x8'));router[_0x0213('0x9')]('/',auth[_0x0213('0xa')](),controller[_0x0213('0xb')]);router[_0x0213('0x9')](_0x0213('0xc'),auth[_0x0213('0xa')](),controller[_0x0213('0xd')]);router[_0x0213('0xe')]('/',auth['isAuthenticated'](),controller[_0x0213('0xf')]);router['put'](_0x0213('0xc'),auth[_0x0213('0xa')](),controller[_0x0213('0x10')]);router[_0x0213('0x11')](_0x0213('0xc'),auth['isAuthenticated'](),controller[_0x0213('0x12')]);module[_0x0213('0x13')]=router;
\ No newline at end of file
+var _0x24f7=['./intServicenowField.controller','isAuthenticated','index','get','/:id','post','put','update','delete','destroy','multer','util','path','Router','../../components/auth/service','../../config/environment'];(function(_0x240901,_0x4b5d01){var _0x226b18=function(_0x4da658){while(--_0x4da658){_0x240901['push'](_0x240901['shift']());}};_0x226b18(++_0x4b5d01);}(_0x24f7,0x9a));var _0x724f=function(_0x21a9d9,_0x4d5ac8){_0x21a9d9=_0x21a9d9-0x0;var _0x46adce=_0x24f7[_0x21a9d9];return _0x46adce;};'use strict';var multer=require(_0x724f('0x0'));var util=require(_0x724f('0x1'));var path=require(_0x724f('0x2'));var timeout=require('connect-timeout');var express=require('express');var router=express[_0x724f('0x3')]();var auth=require(_0x724f('0x4'));var interaction=require('../../components/interaction/service');var config=require(_0x724f('0x5'));var controller=require(_0x724f('0x6'));router['get']('/',auth[_0x724f('0x7')](),controller[_0x724f('0x8')]);router[_0x724f('0x9')](_0x724f('0xa'),auth['isAuthenticated'](),controller['show']);router[_0x724f('0xb')]('/',auth[_0x724f('0x7')](),controller['create']);router[_0x724f('0xc')](_0x724f('0xa'),auth[_0x724f('0x7')](),controller[_0x724f('0xd')]);router[_0x724f('0xe')](_0x724f('0xa'),auth[_0x724f('0x7')](),controller[_0x724f('0xf')]);module['exports']=router;
\ No newline at end of file
diff --git a/server/api/intServicenowField/intServicenowField.attributes.js b/server/api/intServicenowField/intServicenowField.attributes.js
index 730f8b5..f31a679 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 _0x3999=['customVariable','BOOLEAN','sequelize','ENUM','string','keyValue','STRING','variable'];(function(_0x580b15,_0x28afa4){var _0x1adb1b=function(_0x47a01f){while(--_0x47a01f){_0x580b15['push'](_0x580b15['shift']());}};_0x1adb1b(++_0x28afa4);}(_0x3999,0x18a));var _0x9399=function(_0x2a9b7f,_0x163821){_0x2a9b7f=_0x2a9b7f-0x0;var _0x52b1ea=_0x3999[_0x2a9b7f];return _0x52b1ea;};'use strict';var Sequelize=require(_0x9399('0x0'));module['exports']={'type':{'type':Sequelize[_0x9399('0x1')](_0x9399('0x2'),'variable','customVariable',_0x9399('0x3')),'defaultValue':_0x9399('0x2')},'content':{'type':Sequelize[_0x9399('0x4')]},'key':{'type':Sequelize[_0x9399('0x4')]},'keyType':{'type':Sequelize[_0x9399('0x1')](_0x9399('0x2'),_0x9399('0x5'),_0x9399('0x6'))},'keyContent':{'type':Sequelize[_0x9399('0x4')]},'idField':{'type':Sequelize['STRING']},'nameField':{'type':Sequelize[_0x9399('0x4')]},'customField':{'type':Sequelize[_0x9399('0x7')],'defaultValue':!![]},'variableName':{'type':Sequelize[_0x9399('0x4')]}};
\ No newline at end of file
+var _0xf81b=['ENUM','customVariable','BOOLEAN','sequelize','exports','string','variable','keyValue','STRING'];(function(_0xf0cf28,_0x1a5fe2){var _0x2d367d=function(_0x57362f){while(--_0x57362f){_0xf0cf28['push'](_0xf0cf28['shift']());}};_0x2d367d(++_0x1a5fe2);}(_0xf81b,0x81));var _0xbf81=function(_0x429af2,_0x206ce7){_0x429af2=_0x429af2-0x0;var _0x1866f6=_0xf81b[_0x429af2];return _0x1866f6;};'use strict';var Sequelize=require(_0xbf81('0x0'));module[_0xbf81('0x1')]={'type':{'type':Sequelize['ENUM'](_0xbf81('0x2'),_0xbf81('0x3'),'customVariable',_0xbf81('0x4')),'defaultValue':_0xbf81('0x2')},'content':{'type':Sequelize[_0xbf81('0x5')]},'key':{'type':Sequelize[_0xbf81('0x5')]},'keyType':{'type':Sequelize[_0xbf81('0x6')](_0xbf81('0x2'),_0xbf81('0x3'),_0xbf81('0x7'))},'keyContent':{'type':Sequelize[_0xbf81('0x5')]},'idField':{'type':Sequelize[_0xbf81('0x5')]},'nameField':{'type':Sequelize[_0xbf81('0x5')]},'customField':{'type':Sequelize[_0xbf81('0x8')],'defaultValue':!![]},'variableName':{'type':Sequelize[_0xbf81('0x5')]}};
\ No newline at end of file
diff --git a/server/api/intServicenowField/intServicenowField.controller.js b/server/api/intServicenowField/intServicenowField.controller.js
index 072e1a5..eaa46a7 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 _0x9622=['name','send','index','map','ServicenowField','rawAttributes','fieldName','type','query','keys','filters','intersection','attributes','fields','length','model','nolimit','order','where','pick','filter','VIRTUAL','merge','options','include','findAll','rows','show','params','includeAll','find','create','body','catch','html-pdf','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','moment','mustache','util','sox','to-csv','ejs','lodash','squel','crypto','jsforce','desk.js','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','../../config/utils','../../config/environment','../../mysqldb','sendStatus','status','json','count','offset','limit','set','Content-Range','apply','reject','save','update','then','destroy','error'];(function(_0x5962b8,_0x3230cd){var _0x3599ac=function(_0x5a0007){while(--_0x5a0007){_0x5962b8['push'](_0x5962b8['shift']());}};_0x3599ac(++_0x3230cd);}(_0x9622,0x1a3));var _0x2962=function(_0x422c78,_0x562821){_0x422c78=_0x422c78-0x0;var _0x191cdf=_0x9622[_0x422c78];return _0x191cdf;};'use strict';var pdf=require(_0x2962('0x0'));var emlformat=require(_0x2962('0x1'));var rimraf=require(_0x2962('0x2'));var zipdir=require(_0x2962('0x3'));var jsonpatch=require(_0x2962('0x4'));var rp=require(_0x2962('0x5'));var moment=require(_0x2962('0x6'));var BPromise=require('bluebird');var Mustache=require(_0x2962('0x7'));var util=require(_0x2962('0x8'));var path=require('path');var sox=require(_0x2962('0x9'));var csv=require(_0x2962('0xa'));var ejs=require(_0x2962('0xb'));var fs=require('fs');var _=require(_0x2962('0xc'));var squel=require(_0x2962('0xd'));var crypto=require(_0x2962('0xe'));var jsforce=require(_0x2962('0xf'));var deskjs=require(_0x2962('0x10'));var toCsv=require(_0x2962('0xa'));var querystring=require(_0x2962('0x11'));var Papa=require(_0x2962('0x12'));var Redis=require(_0x2962('0x13'));var authService=require(_0x2962('0x14'));var qs=require(_0x2962('0x15'));var as=require(_0x2962('0x16'));var hardwareService=require(_0x2962('0x17'));var logger=require(_0x2962('0x18'))('api');var utils=require(_0x2962('0x19'));var config=require(_0x2962('0x1a'));var db=require(_0x2962('0x1b'))['db'];function respondWithStatusCode(_0x5405f0,_0x5550b6){_0x5550b6=_0x5550b6||0xcc;return function(_0x3ce440){if(_0x3ce440){return _0x5405f0[_0x2962('0x1c')](_0x5550b6);}return _0x5405f0[_0x2962('0x1d')](_0x5550b6)['end']();};}function respondWithResult(_0x447355,_0x5046ec){_0x5046ec=_0x5046ec||0xc8;return function(_0x1bb74c){if(_0x1bb74c){return _0x447355['status'](_0x5046ec)[_0x2962('0x1e')](_0x1bb74c);}};}function respondWithFilteredResult(_0x47cce5,_0x126df5){return function(_0x27a204){if(_0x27a204){var _0x53e947=_0x27a204[_0x2962('0x1f')],_0x27a9d1=_0x126df5[_0x2962('0x20')],_0x397db5=_0x126df5[_0x2962('0x20')]+_0x126df5[_0x2962('0x21')],_0x6f6391;if(_0x397db5>=_0x53e947){_0x397db5=_0x53e947;_0x6f6391=0xc8;}else{_0x6f6391=0xce;}_0x47cce5['status'](_0x6f6391);return _0x47cce5[_0x2962('0x22')](_0x2962('0x23'),_0x27a9d1+'-'+_0x397db5+'/'+_0x53e947)['json'](_0x27a204);}return null;};}function patchUpdates(_0x44f0fd){return function(_0x57fca6){try{jsonpatch[_0x2962('0x24')](_0x57fca6,_0x44f0fd,!![]);}catch(_0x42f4b5){return BPromise[_0x2962('0x25')](_0x42f4b5);}return _0x57fca6[_0x2962('0x26')]();};}function saveUpdates(_0x252eec,_0x79c214){return function(_0x5b2520){if(_0x5b2520){return _0x5b2520[_0x2962('0x27')](_0x252eec)[_0x2962('0x28')](function(_0x2dd8d9){return _0x2dd8d9;});}return null;};}function removeEntity(_0xc88d20,_0x5b89d2){return function(_0x3f74cb){if(_0x3f74cb){return _0x3f74cb[_0x2962('0x29')]()[_0x2962('0x28')](function(){_0xc88d20['status'](0xcc)['end']();});}};}function handleEntityNotFound(_0x1c6aa7,_0x8b4532){return function(_0x58807){if(!_0x58807){_0x1c6aa7[_0x2962('0x1c')](0x194);}return _0x58807;};}function handleError(_0xd72c7c,_0x37f01b){_0x37f01b=_0x37f01b||0x1f4;return function(_0x2a991b){logger[_0x2962('0x2a')](_0x2a991b['stack']);if(_0x2a991b[_0x2962('0x2b')]){delete _0x2a991b['name'];}_0xd72c7c[_0x2962('0x1d')](_0x37f01b)[_0x2962('0x2c')](_0x2a991b);};}exports[_0x2962('0x2d')]=function(_0x1bcfef,_0x29abf3){var _0x33efd3={},_0x1a00ad={},_0xfde677={'count':0x0,'rows':[]};var _0x49166c=_[_0x2962('0x2e')](db[_0x2962('0x2f')][_0x2962('0x30')],function(_0x15cf02){return{'name':_0x15cf02[_0x2962('0x31')],'type':_0x15cf02[_0x2962('0x32')]['key']};});_0x1a00ad['model']=_['map'](_0x49166c,'name');_0x1a00ad[_0x2962('0x33')]=_[_0x2962('0x34')](_0x1bcfef[_0x2962('0x33')]);_0x1a00ad[_0x2962('0x35')]=_[_0x2962('0x36')](_0x1a00ad['model'],_0x1a00ad[_0x2962('0x33')]);_0x33efd3[_0x2962('0x37')]=_[_0x2962('0x36')](_0x1a00ad['model'],qs['fields'](_0x1bcfef['query'][_0x2962('0x38')]));_0x33efd3[_0x2962('0x37')]=_0x33efd3['attributes'][_0x2962('0x39')]?_0x33efd3[_0x2962('0x37')]:_0x1a00ad[_0x2962('0x3a')];if(!_0x1bcfef[_0x2962('0x33')]['hasOwnProperty'](_0x2962('0x3b'))){_0x33efd3[_0x2962('0x21')]=qs['limit'](_0x1bcfef['query'][_0x2962('0x21')]);_0x33efd3['offset']=qs['offset'](_0x1bcfef[_0x2962('0x33')][_0x2962('0x20')]);}_0x33efd3[_0x2962('0x3c')]=qs['sort'](_0x1bcfef[_0x2962('0x33')]['sort']);_0x33efd3[_0x2962('0x3d')]=qs[_0x2962('0x35')](_[_0x2962('0x3e')](_0x1bcfef[_0x2962('0x33')],_0x1a00ad[_0x2962('0x35')]));if(_0x1bcfef[_0x2962('0x33')][_0x2962('0x3f')]){_0x33efd3[_0x2962('0x3d')]=_['merge'](_0x33efd3[_0x2962('0x3d')],{'$or':_['map'](_0x49166c,function(_0x531348){if(_0x531348[_0x2962('0x32')]!==_0x2962('0x40')){var _0x326023={};_0x326023[_0x531348[_0x2962('0x2b')]]={'$like':'%'+_0x1bcfef[_0x2962('0x33')][_0x2962('0x3f')]+'%'};return _0x326023;}})});}_0x33efd3=_[_0x2962('0x41')]({},_0x33efd3,_0x1bcfef[_0x2962('0x42')]);var _0x1b6ce={'where':_0x33efd3[_0x2962('0x3d')]};return db[_0x2962('0x2f')][_0x2962('0x1f')](_0x1b6ce)[_0x2962('0x28')](function(_0x9c443a){_0xfde677[_0x2962('0x1f')]=_0x9c443a;if(_0x1bcfef[_0x2962('0x33')]['includeAll']){_0x33efd3[_0x2962('0x43')]=[{'all':!![]}];}return db[_0x2962('0x2f')][_0x2962('0x44')](_0x33efd3);})['then'](function(_0x3f15ac){_0xfde677[_0x2962('0x45')]=_0x3f15ac;return _0xfde677;})['then'](respondWithFilteredResult(_0x29abf3,_0x33efd3))['catch'](handleError(_0x29abf3,null));};exports[_0x2962('0x46')]=function(_0x45a316,_0x516e95){var _0x34c667={'raw':!![],'where':{'id':_0x45a316[_0x2962('0x47')]['id']}},_0x55232b={};_0x55232b['model']=_[_0x2962('0x34')](db[_0x2962('0x2f')][_0x2962('0x30')]);_0x55232b['query']=_[_0x2962('0x34')](_0x45a316[_0x2962('0x33')]);_0x55232b[_0x2962('0x35')]=_['intersection'](_0x55232b[_0x2962('0x3a')],_0x55232b[_0x2962('0x33')]);_0x34c667[_0x2962('0x37')]=_[_0x2962('0x36')](_0x55232b[_0x2962('0x3a')],qs['fields'](_0x45a316[_0x2962('0x33')]['fields']));_0x34c667[_0x2962('0x37')]=_0x34c667[_0x2962('0x37')][_0x2962('0x39')]?_0x34c667[_0x2962('0x37')]:_0x55232b['model'];if(_0x45a316[_0x2962('0x33')][_0x2962('0x48')]){_0x34c667['include']=[{'all':!![]}];}_0x34c667=_[_0x2962('0x41')]({},_0x34c667,_0x45a316[_0x2962('0x42')]);return db['ServicenowField'][_0x2962('0x49')](_0x34c667)[_0x2962('0x28')](handleEntityNotFound(_0x516e95,null))[_0x2962('0x28')](respondWithResult(_0x516e95,null))['catch'](handleError(_0x516e95,null));};exports[_0x2962('0x4a')]=function(_0x1033ce,_0x47c096){return db['ServicenowField']['create'](_0x1033ce[_0x2962('0x4b')],{})[_0x2962('0x28')](respondWithResult(_0x47c096,0xc9))[_0x2962('0x4c')](handleError(_0x47c096,null));};exports[_0x2962('0x27')]=function(_0x316185,_0xabc77d){if(_0x316185[_0x2962('0x4b')]['id']){delete _0x316185[_0x2962('0x4b')]['id'];}return db[_0x2962('0x2f')]['find']({'where':{'id':_0x316185[_0x2962('0x47')]['id']}})['then'](handleEntityNotFound(_0xabc77d,null))[_0x2962('0x28')](saveUpdates(_0x316185[_0x2962('0x4b')],null))[_0x2962('0x28')](respondWithResult(_0xabc77d,null))[_0x2962('0x4c')](handleError(_0xabc77d,null));};exports[_0x2962('0x29')]=function(_0x55378b,_0x5b2cc5){return db[_0x2962('0x2f')]['find']({'where':{'id':_0x55378b[_0x2962('0x47')]['id']}})[_0x2962('0x28')](handleEntityNotFound(_0x5b2cc5,null))[_0x2962('0x28')](removeEntity(_0x5b2cc5,null))[_0x2962('0x4c')](handleError(_0x5b2cc5,null));};
\ No newline at end of file
+var _0x5dcf=['mustache','path','to-csv','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','status','end','json','offset','limit','set','reject','save','update','then','destroy','stack','name','send','index','ServicenowField','rawAttributes','fieldName','type','key','model','map','query','intersection','attributes','fields','hasOwnProperty','nolimit','order','filters','pick','filter','where','merge','VIRTUAL','options','count','findAll','rows','catch','keys','length','includeAll','include','find','create','body','params','html-pdf','eml-format','fast-json-patch','request-promise','bluebird'];(function(_0x321bb2,_0x202794){var _0x9c12ed=function(_0x263dd3){while(--_0x263dd3){_0x321bb2['push'](_0x321bb2['shift']());}};_0x9c12ed(++_0x202794);}(_0x5dcf,0xd9));var _0xf5dc=function(_0x18f63c,_0x32fcfc){_0x18f63c=_0x18f63c-0x0;var _0x2f3b17=_0x5dcf[_0x18f63c];return _0x2f3b17;};'use strict';var pdf=require(_0xf5dc('0x0'));var emlformat=require(_0xf5dc('0x1'));var rimraf=require('rimraf');var zipdir=require('zip-dir');var jsonpatch=require(_0xf5dc('0x2'));var rp=require(_0xf5dc('0x3'));var moment=require('moment');var BPromise=require(_0xf5dc('0x4'));var Mustache=require(_0xf5dc('0x5'));var util=require('util');var path=require(_0xf5dc('0x6'));var sox=require('sox');var csv=require(_0xf5dc('0x7'));var ejs=require('ejs');var fs=require('fs');var _=require(_0xf5dc('0x8'));var squel=require(_0xf5dc('0x9'));var crypto=require(_0xf5dc('0xa'));var jsforce=require(_0xf5dc('0xb'));var deskjs=require(_0xf5dc('0xc'));var toCsv=require('to-csv');var querystring=require(_0xf5dc('0xd'));var Papa=require(_0xf5dc('0xe'));var Redis=require(_0xf5dc('0xf'));var authService=require(_0xf5dc('0x10'));var qs=require(_0xf5dc('0x11'));var as=require(_0xf5dc('0x12'));var hardwareService=require(_0xf5dc('0x13'));var logger=require(_0xf5dc('0x14'))(_0xf5dc('0x15'));var utils=require(_0xf5dc('0x16'));var config=require(_0xf5dc('0x17'));var db=require(_0xf5dc('0x18'))['db'];function respondWithStatusCode(_0x3c4974,_0x3fca61){_0x3fca61=_0x3fca61||0xcc;return function(_0x1f6fa8){if(_0x1f6fa8){return _0x3c4974[_0xf5dc('0x19')](_0x3fca61);}return _0x3c4974[_0xf5dc('0x1a')](_0x3fca61)[_0xf5dc('0x1b')]();};}function respondWithResult(_0x4864d8,_0x9d846e){_0x9d846e=_0x9d846e||0xc8;return function(_0x1685b7){if(_0x1685b7){return _0x4864d8[_0xf5dc('0x1a')](_0x9d846e)[_0xf5dc('0x1c')](_0x1685b7);}};}function respondWithFilteredResult(_0x66b97a,_0x21741a){return function(_0x19f854){if(_0x19f854){var _0x150931=_0x19f854['count'],_0x466f93=_0x21741a[_0xf5dc('0x1d')],_0x1490a0=_0x21741a[_0xf5dc('0x1d')]+_0x21741a[_0xf5dc('0x1e')],_0x576bb3;if(_0x1490a0>=_0x150931){_0x1490a0=_0x150931;_0x576bb3=0xc8;}else{_0x576bb3=0xce;}_0x66b97a[_0xf5dc('0x1a')](_0x576bb3);return _0x66b97a[_0xf5dc('0x1f')]('Content-Range',_0x466f93+'-'+_0x1490a0+'/'+_0x150931)[_0xf5dc('0x1c')](_0x19f854);}return null;};}function patchUpdates(_0x1b8355){return function(_0x44c8f2){try{jsonpatch['apply'](_0x44c8f2,_0x1b8355,!![]);}catch(_0x3df013){return BPromise[_0xf5dc('0x20')](_0x3df013);}return _0x44c8f2[_0xf5dc('0x21')]();};}function saveUpdates(_0x2db92f,_0x40eaed){return function(_0x1505aa){if(_0x1505aa){return _0x1505aa[_0xf5dc('0x22')](_0x2db92f)[_0xf5dc('0x23')](function(_0x2cd770){return _0x2cd770;});}return null;};}function removeEntity(_0x5b41ec,_0x1926df){return function(_0x42aa5b){if(_0x42aa5b){return _0x42aa5b[_0xf5dc('0x24')]()['then'](function(){_0x5b41ec[_0xf5dc('0x1a')](0xcc)[_0xf5dc('0x1b')]();});}};}function handleEntityNotFound(_0x2c59dc,_0x651e8f){return function(_0x48467a){if(!_0x48467a){_0x2c59dc[_0xf5dc('0x19')](0x194);}return _0x48467a;};}function handleError(_0x11154d,_0x3a9cd2){_0x3a9cd2=_0x3a9cd2||0x1f4;return function(_0x4e1ebf){logger['error'](_0x4e1ebf[_0xf5dc('0x25')]);if(_0x4e1ebf[_0xf5dc('0x26')]){delete _0x4e1ebf['name'];}_0x11154d[_0xf5dc('0x1a')](_0x3a9cd2)[_0xf5dc('0x27')](_0x4e1ebf);};}exports[_0xf5dc('0x28')]=function(_0x4b74b5,_0xf3c4b8){var _0x476258={},_0x299dcc={},_0x379e7e={'count':0x0,'rows':[]};var _0xf76b03=_['map'](db[_0xf5dc('0x29')][_0xf5dc('0x2a')],function(_0x24fe94){return{'name':_0x24fe94[_0xf5dc('0x2b')],'type':_0x24fe94[_0xf5dc('0x2c')][_0xf5dc('0x2d')]};});_0x299dcc[_0xf5dc('0x2e')]=_[_0xf5dc('0x2f')](_0xf76b03,_0xf5dc('0x26'));_0x299dcc[_0xf5dc('0x30')]=_['keys'](_0x4b74b5['query']);_0x299dcc['filters']=_[_0xf5dc('0x31')](_0x299dcc[_0xf5dc('0x2e')],_0x299dcc[_0xf5dc('0x30')]);_0x476258[_0xf5dc('0x32')]=_['intersection'](_0x299dcc[_0xf5dc('0x2e')],qs[_0xf5dc('0x33')](_0x4b74b5[_0xf5dc('0x30')]['fields']));_0x476258[_0xf5dc('0x32')]=_0x476258[_0xf5dc('0x32')]['length']?_0x476258[_0xf5dc('0x32')]:_0x299dcc[_0xf5dc('0x2e')];if(!_0x4b74b5[_0xf5dc('0x30')][_0xf5dc('0x34')](_0xf5dc('0x35'))){_0x476258[_0xf5dc('0x1e')]=qs[_0xf5dc('0x1e')](_0x4b74b5[_0xf5dc('0x30')][_0xf5dc('0x1e')]);_0x476258[_0xf5dc('0x1d')]=qs[_0xf5dc('0x1d')](_0x4b74b5[_0xf5dc('0x30')]['offset']);}_0x476258[_0xf5dc('0x36')]=qs['sort'](_0x4b74b5[_0xf5dc('0x30')]['sort']);_0x476258['where']=qs[_0xf5dc('0x37')](_[_0xf5dc('0x38')](_0x4b74b5[_0xf5dc('0x30')],_0x299dcc[_0xf5dc('0x37')]));if(_0x4b74b5[_0xf5dc('0x30')][_0xf5dc('0x39')]){_0x476258[_0xf5dc('0x3a')]=_[_0xf5dc('0x3b')](_0x476258[_0xf5dc('0x3a')],{'$or':_['map'](_0xf76b03,function(_0xa7107c){if(_0xa7107c[_0xf5dc('0x2c')]!==_0xf5dc('0x3c')){var _0x237e8c={};_0x237e8c[_0xa7107c[_0xf5dc('0x26')]]={'$like':'%'+_0x4b74b5[_0xf5dc('0x30')][_0xf5dc('0x39')]+'%'};return _0x237e8c;}})});}_0x476258=_[_0xf5dc('0x3b')]({},_0x476258,_0x4b74b5[_0xf5dc('0x3d')]);var _0x54b283={'where':_0x476258[_0xf5dc('0x3a')]};return db[_0xf5dc('0x29')][_0xf5dc('0x3e')](_0x54b283)[_0xf5dc('0x23')](function(_0x25e3be){_0x379e7e[_0xf5dc('0x3e')]=_0x25e3be;if(_0x4b74b5['query']['includeAll']){_0x476258['include']=[{'all':!![]}];}return db[_0xf5dc('0x29')][_0xf5dc('0x3f')](_0x476258);})[_0xf5dc('0x23')](function(_0x4a4ae2){_0x379e7e[_0xf5dc('0x40')]=_0x4a4ae2;return _0x379e7e;})['then'](respondWithFilteredResult(_0xf3c4b8,_0x476258))[_0xf5dc('0x41')](handleError(_0xf3c4b8,null));};exports['show']=function(_0xa350b0,_0x4597d7){var _0x4a0eca={'raw':!![],'where':{'id':_0xa350b0['params']['id']}},_0x583c05={};_0x583c05[_0xf5dc('0x2e')]=_['keys'](db[_0xf5dc('0x29')]['rawAttributes']);_0x583c05['query']=_[_0xf5dc('0x42')](_0xa350b0[_0xf5dc('0x30')]);_0x583c05[_0xf5dc('0x37')]=_[_0xf5dc('0x31')](_0x583c05[_0xf5dc('0x2e')],_0x583c05[_0xf5dc('0x30')]);_0x4a0eca['attributes']=_[_0xf5dc('0x31')](_0x583c05['model'],qs['fields'](_0xa350b0[_0xf5dc('0x30')][_0xf5dc('0x33')]));_0x4a0eca[_0xf5dc('0x32')]=_0x4a0eca[_0xf5dc('0x32')][_0xf5dc('0x43')]?_0x4a0eca[_0xf5dc('0x32')]:_0x583c05[_0xf5dc('0x2e')];if(_0xa350b0[_0xf5dc('0x30')][_0xf5dc('0x44')]){_0x4a0eca[_0xf5dc('0x45')]=[{'all':!![]}];}_0x4a0eca=_[_0xf5dc('0x3b')]({},_0x4a0eca,_0xa350b0[_0xf5dc('0x3d')]);return db[_0xf5dc('0x29')][_0xf5dc('0x46')](_0x4a0eca)['then'](handleEntityNotFound(_0x4597d7,null))[_0xf5dc('0x23')](respondWithResult(_0x4597d7,null))[_0xf5dc('0x41')](handleError(_0x4597d7,null));};exports[_0xf5dc('0x47')]=function(_0x597a1f,_0x23d1f1){return db[_0xf5dc('0x29')][_0xf5dc('0x47')](_0x597a1f[_0xf5dc('0x48')],{})[_0xf5dc('0x23')](respondWithResult(_0x23d1f1,0xc9))[_0xf5dc('0x41')](handleError(_0x23d1f1,null));};exports[_0xf5dc('0x22')]=function(_0x124ac3,_0x381fdb){if(_0x124ac3[_0xf5dc('0x48')]['id']){delete _0x124ac3[_0xf5dc('0x48')]['id'];}return db[_0xf5dc('0x29')]['find']({'where':{'id':_0x124ac3[_0xf5dc('0x49')]['id']}})[_0xf5dc('0x23')](handleEntityNotFound(_0x381fdb,null))[_0xf5dc('0x23')](saveUpdates(_0x124ac3[_0xf5dc('0x48')],null))[_0xf5dc('0x23')](respondWithResult(_0x381fdb,null))[_0xf5dc('0x41')](handleError(_0x381fdb,null));};exports[_0xf5dc('0x24')]=function(_0x15829f,_0xc5b426){return db[_0xf5dc('0x29')][_0xf5dc('0x46')]({'where':{'id':_0x15829f[_0xf5dc('0x49')]['id']}})[_0xf5dc('0x23')](handleEntityNotFound(_0xc5b426,null))[_0xf5dc('0x23')](removeEntity(_0xc5b426,null))[_0xf5dc('0x41')](handleError(_0xc5b426,null));};
\ No newline at end of file
diff --git a/server/api/intServicenowField/intServicenowField.model.js b/server/api/intServicenowField/intServicenowField.model.js
index 6fc4b5b..7e0338a 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 _0xde75=['exports','define','int_servicenow_fields','servicenow_unique_index','idField','FieldId','lodash','util','../../config/logger','api','moment','bluebird','request-promise','rimraf','../../config/environment'];(function(_0xe10c03,_0x4c8ab5){var _0x5e9f80=function(_0x1a6bea){while(--_0x1a6bea){_0xe10c03['push'](_0xe10c03['shift']());}};_0x5e9f80(++_0x4c8ab5);}(_0xde75,0x150));var _0x5de7=function(_0x46eb0b,_0x1fa719){_0x46eb0b=_0x46eb0b-0x0;var _0x174b30=_0xde75[_0x46eb0b];return _0x174b30;};'use strict';var _=require(_0x5de7('0x0'));var util=require(_0x5de7('0x1'));var logger=require(_0x5de7('0x2'))(_0x5de7('0x3'));var moment=require(_0x5de7('0x4'));var BPromise=require(_0x5de7('0x5'));var rp=require(_0x5de7('0x6'));var fs=require('fs');var path=require('path');var rimraf=require(_0x5de7('0x7'));var config=require(_0x5de7('0x8'));var attributes=require('./intServicenowField.attributes');module[_0x5de7('0x9')]=function(_0x62ff5a,_0x6fce45){return _0x62ff5a[_0x5de7('0xa')]('ServicenowField',attributes,{'tableName':_0x5de7('0xb'),'paranoid':![],'indexes':[{'name':_0x5de7('0xc'),'fields':[_0x5de7('0xd'),_0x5de7('0xe')],'unique':!![]}],'timestamps':!![]});};
\ No newline at end of file
+var _0xe532=['ServicenowField','int_servicenow_fields','servicenow_unique_index','idField','lodash','util','api','moment','path','rimraf','../../config/environment','./intServicenowField.attributes','exports','define'];(function(_0x4792c8,_0x5158a1){var _0x35edb1=function(_0x2472d3){while(--_0x2472d3){_0x4792c8['push'](_0x4792c8['shift']());}};_0x35edb1(++_0x5158a1);}(_0xe532,0x1a8));var _0x2e53=function(_0x504df1,_0x289598){_0x504df1=_0x504df1-0x0;var _0x1063b5=_0xe532[_0x504df1];return _0x1063b5;};'use strict';var _=require(_0x2e53('0x0'));var util=require(_0x2e53('0x1'));var logger=require('../../config/logger')(_0x2e53('0x2'));var moment=require(_0x2e53('0x3'));var BPromise=require('bluebird');var rp=require('request-promise');var fs=require('fs');var path=require(_0x2e53('0x4'));var rimraf=require(_0x2e53('0x5'));var config=require(_0x2e53('0x6'));var attributes=require(_0x2e53('0x7'));module[_0x2e53('0x8')]=function(_0x23f5b9,_0x6bc728){return _0x23f5b9[_0x2e53('0x9')](_0x2e53('0xa'),attributes,{'tableName':_0x2e53('0xb'),'paranoid':![],'indexes':[{'name':_0x2e53('0xc'),'fields':[_0x2e53('0xd'),'FieldId'],'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 f8dfafa..c065bd7 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 _0x1daf=['request\x20sent','debug','ServicenowField,\x20%s,\x20%s,\x20%s','error','message','ServicenowField,\x20%s,\x20%s','catch','lodash','moment','bluebird','ioredis','../../config/utils','../../config/logger','rpc','jayson/promise','client','request','then','info'];(function(_0x3b0350,_0x132610){var _0x39beeb=function(_0x46ad5d){while(--_0x46ad5d){_0x3b0350['push'](_0x3b0350['shift']());}};_0x39beeb(++_0x132610);}(_0x1daf,0xd8));var _0xf1da=function(_0x5b644e,_0x2e5e07){_0x5b644e=_0x5b644e-0x0;var _0x49c6bf=_0x1daf[_0x5b644e];return _0x49c6bf;};'use strict';var _=require(_0xf1da('0x0'));var util=require('util');var moment=require(_0xf1da('0x1'));var BPromise=require(_0xf1da('0x2'));var rs=require('randomstring');var fs=require('fs');var Redis=require(_0xf1da('0x3'));var db=require('../../mysqldb')['db'];var utils=require(_0xf1da('0x4'));var logger=require(_0xf1da('0x5'))(_0xf1da('0x6'));var config=require('../../config/environment');var jayson=require(_0xf1da('0x7'));var client=jayson[_0xf1da('0x8')]['http']({'port':0x232a});function respondWithRpcPromise(_0x5c18ed,_0xf477c,_0x34f206){return new BPromise(function(_0xb9d5d2,_0x4f93b2){return client[_0xf1da('0x9')](_0x5c18ed,_0x34f206)[_0xf1da('0xa')](function(_0x56e8b3){logger[_0xf1da('0xb')]('ServicenowField,\x20%s,\x20%s',_0xf477c,_0xf1da('0xc'));logger[_0xf1da('0xd')](_0xf1da('0xe'),_0xf477c,'request\x20sent',JSON['stringify'](_0x56e8b3));if(_0x56e8b3[_0xf1da('0xf')]){if(_0x56e8b3['error']['code']===0x1f4){logger['error']('ServicenowField,\x20%s,\x20%s',_0xf477c,_0x56e8b3[_0xf1da('0xf')][_0xf1da('0x10')]);return _0x4f93b2(_0x56e8b3[_0xf1da('0xf')][_0xf1da('0x10')]);}logger[_0xf1da('0xf')](_0xf1da('0x11'),_0xf477c,_0x56e8b3['error']['message']);return _0xb9d5d2(_0x56e8b3['error']['message']);}else{logger['info']('ServicenowField,\x20%s,\x20%s',_0xf477c,_0xf1da('0xc'));_0xb9d5d2(_0x56e8b3['result']['message']);}})[_0xf1da('0x12')](function(_0x36682f){logger[_0xf1da('0xf')]('ServicenowField,\x20%s,\x20%s',_0xf477c,_0x36682f);_0x4f93b2(_0x36682f);});});}
\ No newline at end of file
+var _0xba13=['info','ServicenowField,\x20%s,\x20%s','debug','ServicenowField,\x20%s,\x20%s,\x20%s','request\x20sent','stringify','error','code','message','catch','lodash','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/environment','jayson/promise','client','http','request','then'];(function(_0x4a2752,_0x31ed0e){var _0x380819=function(_0x4b6ba8){while(--_0x4b6ba8){_0x4a2752['push'](_0x4a2752['shift']());}};_0x380819(++_0x31ed0e);}(_0xba13,0x135));var _0x3ba1=function(_0x45d55e,_0x2fede3){_0x45d55e=_0x45d55e-0x0;var _0x29812a=_0xba13[_0x45d55e];return _0x29812a;};'use strict';var _=require(_0x3ba1('0x0'));var util=require('util');var moment=require(_0x3ba1('0x1'));var BPromise=require(_0x3ba1('0x2'));var rs=require(_0x3ba1('0x3'));var fs=require('fs');var Redis=require(_0x3ba1('0x4'));var db=require(_0x3ba1('0x5'))['db'];var utils=require(_0x3ba1('0x6'));var logger=require('../../config/logger')('rpc');var config=require(_0x3ba1('0x7'));var jayson=require(_0x3ba1('0x8'));var client=jayson[_0x3ba1('0x9')][_0x3ba1('0xa')]({'port':0x232a});function respondWithRpcPromise(_0x55a7ae,_0x144b85,_0x3266d0){return new BPromise(function(_0x25fa63,_0x3c0756){return client[_0x3ba1('0xb')](_0x55a7ae,_0x3266d0)[_0x3ba1('0xc')](function(_0x1d9f83){logger[_0x3ba1('0xd')](_0x3ba1('0xe'),_0x144b85,'request\x20sent');logger[_0x3ba1('0xf')](_0x3ba1('0x10'),_0x144b85,_0x3ba1('0x11'),JSON[_0x3ba1('0x12')](_0x1d9f83));if(_0x1d9f83[_0x3ba1('0x13')]){if(_0x1d9f83[_0x3ba1('0x13')][_0x3ba1('0x14')]===0x1f4){logger[_0x3ba1('0x13')](_0x3ba1('0xe'),_0x144b85,_0x1d9f83[_0x3ba1('0x13')][_0x3ba1('0x15')]);return _0x3c0756(_0x1d9f83[_0x3ba1('0x13')][_0x3ba1('0x15')]);}logger['error'](_0x3ba1('0xe'),_0x144b85,_0x1d9f83[_0x3ba1('0x13')]['message']);return _0x25fa63(_0x1d9f83[_0x3ba1('0x13')][_0x3ba1('0x15')]);}else{logger['info'](_0x3ba1('0xe'),_0x144b85,_0x3ba1('0x11'));_0x25fa63(_0x1d9f83['result']['message']);}})[_0x3ba1('0x16')](function(_0x4ef171){logger[_0x3ba1('0x13')](_0x3ba1('0xe'),_0x144b85,_0x4ef171);_0x3c0756(_0x4ef171);});});}
\ No newline at end of file
diff --git a/server/api/intSugarcrmAccount/index.js b/server/api/intSugarcrmAccount/index.js
index 4ca6819..9f6c9ba 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 _0x35e3=['getFields','post','create','/:id/configurations','delete','exports','multer','connect-timeout','express','../../components/auth/service','isAuthenticated','index','get','/:id','show','getConfigurations','/:id/fields'];(function(_0x1f2533,_0x2e89ce){var _0x39495a=function(_0x3dbcd5){while(--_0x3dbcd5){_0x1f2533['push'](_0x1f2533['shift']());}};_0x39495a(++_0x2e89ce);}(_0x35e3,0x149));var _0x335e=function(_0x25fc41,_0x250864){_0x25fc41=_0x25fc41-0x0;var _0x1371d1=_0x35e3[_0x25fc41];return _0x1371d1;};'use strict';var multer=require(_0x335e('0x0'));var util=require('util');var path=require('path');var timeout=require(_0x335e('0x1'));var express=require(_0x335e('0x2'));var router=express['Router']();var auth=require(_0x335e('0x3'));var interaction=require('../../components/interaction/service');var config=require('../../config/environment');var controller=require('./intSugarcrmAccount.controller');router['get']('/',auth[_0x335e('0x4')](),controller[_0x335e('0x5')]);router[_0x335e('0x6')](_0x335e('0x7'),auth[_0x335e('0x4')](),controller[_0x335e('0x8')]);router[_0x335e('0x6')]('/:id/configurations',auth[_0x335e('0x4')](),controller[_0x335e('0x9')]);router['get'](_0x335e('0xa'),auth[_0x335e('0x4')](),controller[_0x335e('0xb')]);router[_0x335e('0xc')]('/',auth[_0x335e('0x4')](),controller[_0x335e('0xd')]);router[_0x335e('0xc')](_0x335e('0xe'),auth[_0x335e('0x4')](),controller['addConfiguration']);router['put'](_0x335e('0x7'),auth['isAuthenticated'](),controller['update']);router[_0x335e('0xf')](_0x335e('0x7'),auth[_0x335e('0x4')](),controller['destroy']);module[_0x335e('0x10')]=router;
\ No newline at end of file
+var _0xf5e8=['get','isAuthenticated','index','/:id','show','/:id/configurations','getConfigurations','getFields','post','create','addConfiguration','put','update','delete','exports','util','connect-timeout','express','../../components/interaction/service','../../config/environment','./intSugarcrmAccount.controller'];(function(_0x3eaf8d,_0x591eab){var _0x481f5b=function(_0x397e89){while(--_0x397e89){_0x3eaf8d['push'](_0x3eaf8d['shift']());}};_0x481f5b(++_0x591eab);}(_0xf5e8,0x1b3));var _0x8f5e=function(_0x474c66,_0xbce925){_0x474c66=_0x474c66-0x0;var _0xcbd9bf=_0xf5e8[_0x474c66];return _0xcbd9bf;};'use strict';var multer=require('multer');var util=require(_0x8f5e('0x0'));var path=require('path');var timeout=require(_0x8f5e('0x1'));var express=require(_0x8f5e('0x2'));var router=express['Router']();var auth=require('../../components/auth/service');var interaction=require(_0x8f5e('0x3'));var config=require(_0x8f5e('0x4'));var controller=require(_0x8f5e('0x5'));router[_0x8f5e('0x6')]('/',auth[_0x8f5e('0x7')](),controller[_0x8f5e('0x8')]);router[_0x8f5e('0x6')](_0x8f5e('0x9'),auth[_0x8f5e('0x7')](),controller[_0x8f5e('0xa')]);router[_0x8f5e('0x6')](_0x8f5e('0xb'),auth[_0x8f5e('0x7')](),controller[_0x8f5e('0xc')]);router[_0x8f5e('0x6')]('/:id/fields',auth[_0x8f5e('0x7')](),controller[_0x8f5e('0xd')]);router[_0x8f5e('0xe')]('/',auth[_0x8f5e('0x7')](),controller[_0x8f5e('0xf')]);router['post'](_0x8f5e('0xb'),auth[_0x8f5e('0x7')](),controller[_0x8f5e('0x10')]);router[_0x8f5e('0x11')](_0x8f5e('0x9'),auth['isAuthenticated'](),controller[_0x8f5e('0x12')]);router[_0x8f5e('0x13')](_0x8f5e('0x9'),auth[_0x8f5e('0x7')](),controller['destroy']);module[_0x8f5e('0x14')]=router;
\ No newline at end of file
diff --git a/server/api/intSugarcrmAccount/intSugarcrmAccount.attributes.js b/server/api/intSugarcrmAccount/intSugarcrmAccount.attributes.js
index 4764a75..7ddcc7a 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 _0x8ea3=['username','remoteUri','sequelize','exports','STRING'];(function(_0x12fa29,_0x548875){var _0x34949c=function(_0x33e90f){while(--_0x33e90f){_0x12fa29['push'](_0x12fa29['shift']());}};_0x34949c(++_0x548875);}(_0x8ea3,0x192));var _0x38ea=function(_0x3b7610,_0x4d52d7){_0x3b7610=_0x3b7610-0x0;var _0xa42efa=_0x8ea3[_0x3b7610];return _0xa42efa;};'use strict';var Sequelize=require(_0x38ea('0x0'));module[_0x38ea('0x1')]={'name':{'type':Sequelize[_0x38ea('0x2')]},'description':{'type':Sequelize['STRING']},'username':{'type':Sequelize[_0x38ea('0x2')],'unique':_0x38ea('0x3')},'password':{'type':Sequelize[_0x38ea('0x2')]},'remoteUri':{'type':Sequelize[_0x38ea('0x2')],'unique':_0x38ea('0x4')},'serverUrl':{'type':Sequelize['STRING']}};
\ No newline at end of file
+var _0x2860=['STRING','username','sequelize','exports'];(function(_0x4a4e15,_0x565e88){var _0x53e1bf=function(_0x3654e9){while(--_0x3654e9){_0x4a4e15['push'](_0x4a4e15['shift']());}};_0x53e1bf(++_0x565e88);}(_0x2860,0x18e));var _0x0286=function(_0x5c660a,_0x4b5262){_0x5c660a=_0x5c660a-0x0;var _0x3a77a4=_0x2860[_0x5c660a];return _0x3a77a4;};'use strict';var Sequelize=require(_0x0286('0x0'));module[_0x0286('0x1')]={'name':{'type':Sequelize['STRING']},'description':{'type':Sequelize[_0x0286('0x2')]},'username':{'type':Sequelize[_0x0286('0x2')],'unique':_0x0286('0x3')},'password':{'type':Sequelize[_0x0286('0x2')]},'remoteUri':{'type':Sequelize[_0x0286('0x2')],'unique':'remoteUri'},'serverUrl':{'type':Sequelize[_0x0286('0x2')]}};
\ No newline at end of file
diff --git a/server/api/intSugarcrmAccount/intSugarcrmAccount.controller.js b/server/api/intSugarcrmAccount/intSugarcrmAccount.controller.js
index ac03219..7e931f3 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 _0x4b70=['SugarcrmAccount','rawAttributes','fieldName','type','model','query','intersection','attributes','fields','length','hasOwnProperty','nolimit','order','sort','where','filters','pick','filter','VIRTUAL','merge','includeAll','include','findAll','rows','show','params','keys','options','find','create','body','getConfigurations','findOne','SugarcrmConfiguration','Subjects','getSubjects','channel','Descriptions','getDescriptions','SugarcrmField','assigned_user_id','created_by','date_start','duration_hours','parent_id','parent_type','username','password','remoteUri','slice','substring','POST','format','/service/v4_1/rest.php','login','JSON','PLAIN','xCALLY\x20Motion\x20Integration','Password\x20Expired','%s%s','get_module_fields','stringify','Calls','values','module_fields','includes','label','endsWith','value','test','statusCode','getFields,\x20%s,\x20%s,\x20%s','getFields','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','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../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','info','SugarcrmAccount,\x20%s,\x20%s','request\x20sent','debug','SugarcrmAccount,\x20%s,\x20%s,\x20%s','error','code','message','result','catch','status','json','count','offset','limit','set','Content-Range','apply','update','destroy','sendStatus','stack','name','index','map'];(function(_0x56b2ec,_0x34e2c7){var _0x4af8e1=function(_0x558107){while(--_0x558107){_0x56b2ec['push'](_0x56b2ec['shift']());}};_0x4af8e1(++_0x34e2c7);}(_0x4b70,0xce));var _0x04b7=function(_0x317e20,_0x306782){_0x317e20=_0x317e20-0x0;var _0x3a3197=_0x4b70[_0x317e20];return _0x3a3197;};'use strict';var pdf=require('html-pdf');var emlformat=require(_0x04b7('0x0'));var rimraf=require('rimraf');var zipdir=require(_0x04b7('0x1'));var jsonpatch=require(_0x04b7('0x2'));var rp=require(_0x04b7('0x3'));var moment=require(_0x04b7('0x4'));var BPromise=require(_0x04b7('0x5'));var Mustache=require(_0x04b7('0x6'));var util=require(_0x04b7('0x7'));var path=require(_0x04b7('0x8'));var sox=require(_0x04b7('0x9'));var csv=require(_0x04b7('0xa'));var ejs=require(_0x04b7('0xb'));var fs=require('fs');var _=require(_0x04b7('0xc'));var squel=require(_0x04b7('0xd'));var crypto=require(_0x04b7('0xe'));var jsforce=require(_0x04b7('0xf'));var deskjs=require(_0x04b7('0x10'));var toCsv=require(_0x04b7('0xa'));var querystring=require(_0x04b7('0x11'));var Papa=require(_0x04b7('0x12'));var Redis=require('ioredis');var authService=require(_0x04b7('0x13'));var qs=require(_0x04b7('0x14'));var as=require(_0x04b7('0x15'));var hardwareService=require(_0x04b7('0x16'));var logger=require(_0x04b7('0x17'))(_0x04b7('0x18'));var utils=require('../../config/utils');var config=require('../../config/environment');var db=require(_0x04b7('0x19'))['db'];var integrations=require(_0x04b7('0x1a'));var jayson=require(_0x04b7('0x1b'));var client=jayson[_0x04b7('0x1c')][_0x04b7('0x1d')]({'port':0x232a});function checkPasswordPattern(_0x2533fe,_0x500cd3,_0x4d7447){if(_0x4d7447){var _0x12fc61=new RegExp(/(?=.*[a-z])(?=.*[A-Z])(?=.*[0-9])(?=.*[?!@#\$%\^&\*~\-_=+[{\]\}])(?=.{8,})/);if(_0x12fc61['test'](_0x500cd3)){return _0x2533fe;}else{throw new db[(_0x04b7('0x1e'))][(_0x04b7('0x1f'))](_0x04b7('0x20'));}}else{return _0x2533fe;}}function respondWithRpcPromise(_0x4baee4,_0x22895e,_0x47cc8a,_0x540ff0){return new BPromise(function(_0x5ef57c,_0x337687){var _0x35103c=_0x540ff0||client;return _0x35103c[_0x04b7('0x21')](_0x4baee4,_0x47cc8a)[_0x04b7('0x22')](function(_0x1258ca){logger[_0x04b7('0x23')](_0x04b7('0x24'),_0x22895e,_0x04b7('0x25'));logger[_0x04b7('0x26')](_0x04b7('0x27'),_0x22895e,_0x04b7('0x25'),JSON['stringify'](_0x1258ca));if(_0x1258ca[_0x04b7('0x28')]){if(_0x1258ca[_0x04b7('0x28')][_0x04b7('0x29')]===0x1f4){logger['error']('SugarcrmAccount,\x20%s,\x20%s',_0x22895e,_0x1258ca[_0x04b7('0x28')]['message']);return _0x337687(_0x1258ca[_0x04b7('0x28')][_0x04b7('0x2a')]);}logger[_0x04b7('0x28')]('SugarcrmAccount,\x20%s,\x20%s',_0x22895e,_0x1258ca[_0x04b7('0x28')][_0x04b7('0x2a')]);return _0x5ef57c(_0x1258ca[_0x04b7('0x28')]['message']);}else{logger['info'](_0x04b7('0x24'),_0x22895e,_0x04b7('0x25'));_0x5ef57c(_0x1258ca[_0x04b7('0x2b')]['message']);}})[_0x04b7('0x2c')](function(_0x38d6c8){logger['error'](_0x04b7('0x24'),_0x22895e,_0x38d6c8);_0x337687(_0x38d6c8);});});}function respondWithStatusCode(_0x21d8b4,_0x5cbdca){_0x5cbdca=_0x5cbdca||0xcc;return function(_0x10b6e6){if(_0x10b6e6){return _0x21d8b4['sendStatus'](_0x5cbdca);}return _0x21d8b4[_0x04b7('0x2d')](_0x5cbdca)['end']();};}function respondWithResult(_0x219662,_0x41475a){_0x41475a=_0x41475a||0xc8;return function(_0x3210a8){if(_0x3210a8){return _0x219662[_0x04b7('0x2d')](_0x41475a)[_0x04b7('0x2e')](_0x3210a8);}};}function respondWithFilteredResult(_0x1e1800,_0x3b9f72){return function(_0x2349f0){if(_0x2349f0){var _0x1ee389=_0x2349f0[_0x04b7('0x2f')],_0xc9d9e3=_0x3b9f72[_0x04b7('0x30')],_0x1f5149=_0x3b9f72[_0x04b7('0x30')]+_0x3b9f72[_0x04b7('0x31')],_0x2c9526;if(_0x1f5149>=_0x1ee389){_0x1f5149=_0x1ee389;_0x2c9526=0xc8;}else{_0x2c9526=0xce;}_0x1e1800[_0x04b7('0x2d')](_0x2c9526);return _0x1e1800[_0x04b7('0x32')](_0x04b7('0x33'),_0xc9d9e3+'-'+_0x1f5149+'/'+_0x1ee389)[_0x04b7('0x2e')](_0x2349f0);}return null;};}function patchUpdates(_0x82881a){return function(_0x1987c0){try{jsonpatch[_0x04b7('0x34')](_0x1987c0,_0x82881a,!![]);}catch(_0x19655a){return BPromise['reject'](_0x19655a);}return _0x1987c0['save']();};}function saveUpdates(_0x4868a5,_0x21f05f){return function(_0x159ae9){if(_0x159ae9){return _0x159ae9[_0x04b7('0x35')](_0x4868a5)[_0x04b7('0x22')](function(_0x49967c){return _0x49967c;});}return null;};}function removeEntity(_0x32ab5c,_0x3f6494){return function(_0x528ac2){if(_0x528ac2){return _0x528ac2[_0x04b7('0x36')]()[_0x04b7('0x22')](function(){_0x32ab5c['status'](0xcc)['end']();});}};}function handleEntityNotFound(_0x2b2ff3,_0x3e03bd){return function(_0xb46687){if(!_0xb46687){_0x2b2ff3[_0x04b7('0x37')](0x194);}return _0xb46687;};}function handleError(_0x5bd4fe,_0x47288c){_0x47288c=_0x47288c||0x1f4;return function(_0x42b153){logger[_0x04b7('0x28')](_0x42b153[_0x04b7('0x38')]);if(_0x42b153[_0x04b7('0x39')]){delete _0x42b153['name'];}_0x5bd4fe[_0x04b7('0x2d')](_0x47288c)['send'](_0x42b153);};}exports[_0x04b7('0x3a')]=function(_0x46867e,_0x10d071){var _0x58fbf6={},_0x1275e1={},_0xae737a={'count':0x0,'rows':[]};var _0x30822a=_[_0x04b7('0x3b')](db[_0x04b7('0x3c')][_0x04b7('0x3d')],function(_0xbc9fca){return{'name':_0xbc9fca[_0x04b7('0x3e')],'type':_0xbc9fca[_0x04b7('0x3f')]['key']};});_0x1275e1[_0x04b7('0x40')]=_[_0x04b7('0x3b')](_0x30822a,_0x04b7('0x39'));_0x1275e1[_0x04b7('0x41')]=_['keys'](_0x46867e['query']);_0x1275e1['filters']=_[_0x04b7('0x42')](_0x1275e1[_0x04b7('0x40')],_0x1275e1['query']);_0x58fbf6[_0x04b7('0x43')]=_[_0x04b7('0x42')](_0x1275e1[_0x04b7('0x40')],qs[_0x04b7('0x44')](_0x46867e[_0x04b7('0x41')][_0x04b7('0x44')]));_0x58fbf6[_0x04b7('0x43')]=_0x58fbf6[_0x04b7('0x43')][_0x04b7('0x45')]?_0x58fbf6[_0x04b7('0x43')]:_0x1275e1[_0x04b7('0x40')];if(!_0x46867e[_0x04b7('0x41')][_0x04b7('0x46')](_0x04b7('0x47'))){_0x58fbf6[_0x04b7('0x31')]=qs[_0x04b7('0x31')](_0x46867e[_0x04b7('0x41')][_0x04b7('0x31')]);_0x58fbf6[_0x04b7('0x30')]=qs[_0x04b7('0x30')](_0x46867e['query']['offset']);}_0x58fbf6[_0x04b7('0x48')]=qs[_0x04b7('0x49')](_0x46867e[_0x04b7('0x41')][_0x04b7('0x49')]);_0x58fbf6[_0x04b7('0x4a')]=qs[_0x04b7('0x4b')](_[_0x04b7('0x4c')](_0x46867e[_0x04b7('0x41')],_0x1275e1[_0x04b7('0x4b')]));if(_0x46867e[_0x04b7('0x41')][_0x04b7('0x4d')]){_0x58fbf6[_0x04b7('0x4a')]=_['merge'](_0x58fbf6[_0x04b7('0x4a')],{'$or':_[_0x04b7('0x3b')](_0x30822a,function(_0x51fcf0){if(_0x51fcf0[_0x04b7('0x3f')]!==_0x04b7('0x4e')){var _0x41794a={};_0x41794a[_0x51fcf0['name']]={'$like':'%'+_0x46867e[_0x04b7('0x41')]['filter']+'%'};return _0x41794a;}})});}_0x58fbf6=_[_0x04b7('0x4f')]({},_0x58fbf6,_0x46867e['options']);var _0x28145a={'where':_0x58fbf6['where']};return db['SugarcrmAccount'][_0x04b7('0x2f')](_0x28145a)[_0x04b7('0x22')](function(_0x240313){_0xae737a[_0x04b7('0x2f')]=_0x240313;if(_0x46867e[_0x04b7('0x41')][_0x04b7('0x50')]){_0x58fbf6[_0x04b7('0x51')]=[{'all':!![]}];}return db[_0x04b7('0x3c')][_0x04b7('0x52')](_0x58fbf6);})[_0x04b7('0x22')](function(_0x438084){_0xae737a[_0x04b7('0x53')]=_0x438084;return _0xae737a;})[_0x04b7('0x22')](respondWithFilteredResult(_0x10d071,_0x58fbf6))[_0x04b7('0x2c')](handleError(_0x10d071,null));};exports[_0x04b7('0x54')]=function(_0x4f760c,_0x160f17){var _0x5c2fba={'raw':![],'where':{'id':_0x4f760c[_0x04b7('0x55')]['id']}},_0x3a7440={};_0x3a7440['model']=_['keys'](db[_0x04b7('0x3c')][_0x04b7('0x3d')]);_0x3a7440['query']=_[_0x04b7('0x56')](_0x4f760c[_0x04b7('0x41')]);_0x3a7440[_0x04b7('0x4b')]=_['intersection'](_0x3a7440[_0x04b7('0x40')],_0x3a7440[_0x04b7('0x41')]);_0x5c2fba[_0x04b7('0x43')]=_['intersection'](_0x3a7440[_0x04b7('0x40')],qs[_0x04b7('0x44')](_0x4f760c[_0x04b7('0x41')][_0x04b7('0x44')]));_0x5c2fba[_0x04b7('0x43')]=_0x5c2fba[_0x04b7('0x43')][_0x04b7('0x45')]?_0x5c2fba[_0x04b7('0x43')]:_0x3a7440[_0x04b7('0x40')];if(_0x4f760c[_0x04b7('0x41')]['includeAll']){_0x5c2fba['include']=[{'all':!![]}];}_0x5c2fba=_['merge']({},_0x5c2fba,_0x4f760c[_0x04b7('0x57')]);return db[_0x04b7('0x3c')][_0x04b7('0x58')](_0x5c2fba)[_0x04b7('0x22')](handleEntityNotFound(_0x160f17,null))['then'](respondWithResult(_0x160f17,null))[_0x04b7('0x2c')](handleError(_0x160f17,null));};exports[_0x04b7('0x59')]=function(_0x32ca42,_0x23b831){return db[_0x04b7('0x3c')][_0x04b7('0x59')](_0x32ca42['body'],{})[_0x04b7('0x22')](respondWithResult(_0x23b831,0xc9))[_0x04b7('0x2c')](handleError(_0x23b831,null));};exports[_0x04b7('0x35')]=function(_0xd29a41,_0x44237f){if(_0xd29a41[_0x04b7('0x5a')]['id']){delete _0xd29a41[_0x04b7('0x5a')]['id'];}return db[_0x04b7('0x3c')][_0x04b7('0x58')]({'where':{'id':_0xd29a41[_0x04b7('0x55')]['id']}})['then'](handleEntityNotFound(_0x44237f,null))[_0x04b7('0x22')](saveUpdates(_0xd29a41['body'],null))[_0x04b7('0x22')](respondWithResult(_0x44237f,null))['catch'](handleError(_0x44237f,null));};exports['destroy']=function(_0x19934b,_0x86d1c8){return db[_0x04b7('0x3c')][_0x04b7('0x58')]({'where':{'id':_0x19934b[_0x04b7('0x55')]['id']}})[_0x04b7('0x22')](handleEntityNotFound(_0x86d1c8,null))[_0x04b7('0x22')](removeEntity(_0x86d1c8,null))['catch'](handleError(_0x86d1c8,null));};exports[_0x04b7('0x5b')]=function(_0x53cc27,_0x3c5e1d,_0x731d6f){var _0x88a92e={};var _0x579a30={};var _0x269c87;var _0x325cef;return db[_0x04b7('0x3c')][_0x04b7('0x5c')]({'where':{'id':_0x53cc27[_0x04b7('0x55')]['id']}})[_0x04b7('0x22')](handleEntityNotFound(_0x3c5e1d,null))[_0x04b7('0x22')](function(_0x409067){if(_0x409067){_0x269c87=_0x409067;_0x579a30['model']=_[_0x04b7('0x56')](db[_0x04b7('0x5d')][_0x04b7('0x3d')]);_0x579a30[_0x04b7('0x41')]=_['keys'](_0x53cc27[_0x04b7('0x41')]);_0x579a30['filters']=_[_0x04b7('0x42')](_0x579a30[_0x04b7('0x40')],_0x579a30[_0x04b7('0x41')]);_0x88a92e[_0x04b7('0x43')]=_[_0x04b7('0x42')](_0x579a30[_0x04b7('0x40')],qs[_0x04b7('0x44')](_0x53cc27['query'][_0x04b7('0x44')]));_0x88a92e[_0x04b7('0x43')]=_0x88a92e['attributes']['length']?_0x88a92e[_0x04b7('0x43')]:_0x579a30[_0x04b7('0x40')];_0x88a92e[_0x04b7('0x48')]=qs[_0x04b7('0x49')](_0x53cc27['query'][_0x04b7('0x49')]);_0x88a92e[_0x04b7('0x4a')]=qs[_0x04b7('0x4b')](_[_0x04b7('0x4c')](_0x53cc27[_0x04b7('0x41')],_0x579a30['filters']));if(_0x53cc27[_0x04b7('0x41')][_0x04b7('0x4d')]){_0x88a92e[_0x04b7('0x4a')]=_['merge'](_0x88a92e[_0x04b7('0x4a')],{'$or':_[_0x04b7('0x3b')](_0x88a92e['attributes'],function(_0x35d18c){var _0x20c9f9={};_0x20c9f9[_0x35d18c]={'$like':'%'+_0x53cc27[_0x04b7('0x41')][_0x04b7('0x4d')]+'%'};return _0x20c9f9;})});}_0x88a92e=_[_0x04b7('0x4f')]({},_0x88a92e,_0x53cc27[_0x04b7('0x57')]);return _0x269c87[_0x04b7('0x5b')](_0x88a92e);}})[_0x04b7('0x22')](function(_0x315af4){if(_0x315af4){_0x325cef=_0x315af4['length'];if(!_0x53cc27[_0x04b7('0x41')][_0x04b7('0x46')]('nolimit')){_0x88a92e[_0x04b7('0x31')]=qs[_0x04b7('0x31')](_0x53cc27[_0x04b7('0x41')][_0x04b7('0x31')]);_0x88a92e[_0x04b7('0x30')]=qs[_0x04b7('0x30')](_0x53cc27[_0x04b7('0x41')][_0x04b7('0x30')]);}return _0x269c87[_0x04b7('0x5b')](_0x88a92e);}})['then'](function(_0x202acc){if(_0x202acc){return _0x202acc?{'count':_0x325cef,'rows':_0x202acc}:null;}})[_0x04b7('0x22')](respondWithResult(_0x3c5e1d,null))['catch'](handleError(_0x3c5e1d,null));};exports['addConfiguration']=function(_0x27b00c,_0x5080f3,_0x386db6){if(_0x27b00c[_0x04b7('0x5a')]['id']){delete _0x27b00c[_0x04b7('0x5a')]['id'];}return db[_0x04b7('0x3c')]['findOne']({'where':{'id':_0x27b00c[_0x04b7('0x55')]['id']}})['then'](handleEntityNotFound(_0x5080f3,null))['then'](function(_0xbd16c2){if(_0xbd16c2){_0x27b00c['body']['AccountId']=_0xbd16c2['id'];_0x27b00c['body'][_0x04b7('0x5e')]=integrations[_0x04b7('0x5f')](_0x27b00c[_0x04b7('0x5a')][_0x04b7('0x60')],_0x27b00c[_0x04b7('0x5a')][_0x04b7('0x3f')]);_0x27b00c['body'][_0x04b7('0x61')]=integrations[_0x04b7('0x62')](_0x27b00c[_0x04b7('0x5a')][_0x04b7('0x60')],_0x27b00c[_0x04b7('0x5a')][_0x04b7('0x3f')]);return db[_0x04b7('0x5d')]['create'](_0x27b00c[_0x04b7('0x5a')],{'include':[{'model':db['SugarcrmField'],'as':_0x04b7('0x5e')},{'model':db[_0x04b7('0x63')],'as':'Descriptions'}]});}return null;})['then'](respondWithResult(_0x5080f3,null))['catch'](handleError(_0x5080f3,null));};exports['getFields']=function(_0x41fde9,_0x1f992c,_0xba48e4){var _0x49f51c='';var _0x3961f2=['id',_0x04b7('0x39'),_0x04b7('0x64'),_0x04b7('0x65'),'description',_0x04b7('0x66'),_0x04b7('0x67'),'duration_minutes',_0x04b7('0x68'),_0x04b7('0x69'),'parent_name','direction'];return db[_0x04b7('0x3c')][_0x04b7('0x5c')]({'where':{'id':_0x41fde9['params']['id']},'attributes':['id',_0x04b7('0x6a'),_0x04b7('0x6b'),_0x04b7('0x6c')]})[_0x04b7('0x22')](handleEntityNotFound(_0x1f992c,null))[_0x04b7('0x22')](function(_0x5b9d7d){if(_0x5b9d7d){_0x49f51c=_0x5b9d7d[_0x04b7('0x6c')];var _0x3308de=_0x49f51c[_0x04b7('0x6d')](-0x1);if(_0x3308de==='/'){_0x49f51c=_0x49f51c[_0x04b7('0x6e')](0x0,_0x49f51c['lastIndexOf'](_0x3308de));}return rp({'method':_0x04b7('0x6f'),'uri':util[_0x04b7('0x70')]('%s%s',_0x49f51c,_0x04b7('0x71')),'json':!![],'form':{'method':_0x04b7('0x72'),'input_type':_0x04b7('0x73'),'response_type':_0x04b7('0x73'),'rest_data':JSON['stringify']({'user_auth':{'user_name':_0x5b9d7d[_0x04b7('0x6a')],'password':_0x5b9d7d[_0x04b7('0x6b')],'encryption':_0x04b7('0x74')},'application':_0x04b7('0x75')})}});}})[_0x04b7('0x22')](function(_0x1f800b){if(_0x1f800b&&_0x1f800b['name']!=='Invalid\x20Login'&&_0x1f800b[_0x04b7('0x39')]!==_0x04b7('0x76')){return rp({'method':_0x04b7('0x6f'),'uri':util['format'](_0x04b7('0x77'),_0x49f51c,_0x04b7('0x71')),'json':!![],'form':{'method':_0x04b7('0x78'),'input_type':_0x04b7('0x73'),'response_type':_0x04b7('0x73'),'rest_data':JSON[_0x04b7('0x79')]({'session':_0x1f800b['id'],'module_name':_0x04b7('0x7a')})}})[_0x04b7('0x22')](function(_0x297a8a){if(_0x297a8a){var _0x429aed=_[_0x04b7('0x7b')](_0x297a8a[_0x04b7('0x7c')]);_['remove'](_0x429aed,function(_0x4ac921){return _0x3961f2[_0x04b7('0x7d')](_0x4ac921[_0x04b7('0x39')]);});return{'count':_0x429aed[_0x04b7('0x45')],'rows':_['map'](_0x429aed,function(_0x490243){return{'id':_0x490243[_0x04b7('0x39')],'name':_0x490243[_0x04b7('0x7e')],'custom':_[_0x04b7('0x7f')](_0x490243[_0x04b7('0x39')],'_c')?!![]:![],'options':_0x490243[_0x04b7('0x57')]?_[_0x04b7('0x3b')](_[_0x04b7('0x7b')](_0x490243['options']),function(_0x5a95c8){return{'name':_0x5a95c8[_0x04b7('0x80')],'value':_0x5a95c8[_0x04b7('0x39')]};}):[]};})};}})[_0x04b7('0x22')](respondWithResult(_0x1f992c,null))[_0x04b7('0x2c')](function(_0x1422a8){var _0x559a34=_0x41fde9[_0x04b7('0x41')][_0x04b7('0x81')]?0x1f4:_0x1422a8[_0x04b7('0x82')]||0x1f4;logger[_0x04b7('0x28')](_0x04b7('0x83'),_0x04b7('0x84'),_0x559a34,JSON[_0x04b7('0x79')](_0x1422a8));delete _0x1422a8[_0x04b7('0x39')];if(_0x559a34===0x191){_0x559a34=0x190;}_0x1f992c[_0x04b7('0x2d')](_0x559a34)['send'](_0x41fde9['query']['test']?{'message':'Wrong\x20credentials','statusCode':_0x1422a8[_0x04b7('0x82')]}:_0x1422a8);});}else{var _0x3f4a23=0x1f4;_0x1f992c['status'](_0x3f4a23)['send']({'message':'Wrong\x20credentials','statusCode':0x190});}});};
\ No newline at end of file
+var _0x80af=['getConfigurations','findOne','SugarcrmConfiguration','addConfiguration','AccountId','getSubjects','Descriptions','getDescriptions','SugarcrmField','Subjects','assigned_user_id','created_by','date_start','duration_hours','parent_id','parent_name','direction','username','password','slice','substring','lastIndexOf','POST','format','%s%s','/service/v4_1/rest.php','JSON','PLAIN','xCALLY\x20Motion\x20Integration','Invalid\x20Login','Password\x20Expired','get_module_fields','stringify','Calls','values','module_fields','includes','endsWith','value','test','statusCode','getFields,\x20%s,\x20%s,\x20%s','eml-format','rimraf','zip-dir','fast-json-patch','moment','bluebird','mustache','util','path','to-csv','ejs','lodash','squel','crypto','jsforce','desk.js','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/utils','../../mysqldb','../../components/integrations/configuration','jayson/promise','client','http','Sequelize','ValidationError','request','then','info','request\x20sent','debug','SugarcrmAccount,\x20%s,\x20%s,\x20%s','error','SugarcrmAccount,\x20%s,\x20%s','message','catch','status','end','count','offset','set','Content-Range','json','apply','reject','save','update','destroy','stack','name','send','index','SugarcrmAccount','rawAttributes','fieldName','type','key','model','map','keys','query','filters','intersection','fields','attributes','length','hasOwnProperty','nolimit','limit','order','sort','pick','merge','VIRTUAL','filter','options','where','includeAll','findAll','show','params','find','create','body'];(function(_0x2f6f50,_0x1d21a7){var _0x2cf365=function(_0x1c40a7){while(--_0x1c40a7){_0x2f6f50['push'](_0x2f6f50['shift']());}};_0x2cf365(++_0x1d21a7);}(_0x80af,0x12a));var _0xf80a=function(_0x302b3c,_0x59e611){_0x302b3c=_0x302b3c-0x0;var _0x5e2c76=_0x80af[_0x302b3c];return _0x5e2c76;};'use strict';var pdf=require('html-pdf');var emlformat=require(_0xf80a('0x0'));var rimraf=require(_0xf80a('0x1'));var zipdir=require(_0xf80a('0x2'));var jsonpatch=require(_0xf80a('0x3'));var rp=require('request-promise');var moment=require(_0xf80a('0x4'));var BPromise=require(_0xf80a('0x5'));var Mustache=require(_0xf80a('0x6'));var util=require(_0xf80a('0x7'));var path=require(_0xf80a('0x8'));var sox=require('sox');var csv=require(_0xf80a('0x9'));var ejs=require(_0xf80a('0xa'));var fs=require('fs');var _=require(_0xf80a('0xb'));var squel=require(_0xf80a('0xc'));var crypto=require(_0xf80a('0xd'));var jsforce=require(_0xf80a('0xe'));var deskjs=require(_0xf80a('0xf'));var toCsv=require(_0xf80a('0x9'));var querystring=require('querystring');var Papa=require('papaparse');var Redis=require(_0xf80a('0x10'));var authService=require(_0xf80a('0x11'));var qs=require(_0xf80a('0x12'));var as=require(_0xf80a('0x13'));var hardwareService=require('../../config/license/hardware');var logger=require('../../config/logger')('api');var utils=require(_0xf80a('0x14'));var config=require('../../config/environment');var db=require(_0xf80a('0x15'))['db'];var integrations=require(_0xf80a('0x16'));var jayson=require(_0xf80a('0x17'));var client=jayson[_0xf80a('0x18')][_0xf80a('0x19')]({'port':0x232a});function checkPasswordPattern(_0x4664f1,_0x49eb9d,_0x222d54){if(_0x222d54){var _0x110b97=new RegExp(/(?=.*[a-z])(?=.*[A-Z])(?=.*[0-9])(?=.*[?!@#\$%\^&\*~\-_=+[{\]\}])(?=.{8,})/);if(_0x110b97['test'](_0x49eb9d)){return _0x4664f1;}else{throw new db[(_0xf80a('0x1a'))][(_0xf80a('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 _0x4664f1;}}function respondWithRpcPromise(_0x166844,_0xb99a66,_0x50603d,_0x1eb772){return new BPromise(function(_0x258021,_0x5f2bcd){var _0x44e5dc=_0x1eb772||client;return _0x44e5dc[_0xf80a('0x1c')](_0x166844,_0x50603d)[_0xf80a('0x1d')](function(_0xceb62c){logger[_0xf80a('0x1e')]('SugarcrmAccount,\x20%s,\x20%s',_0xb99a66,_0xf80a('0x1f'));logger[_0xf80a('0x20')](_0xf80a('0x21'),_0xb99a66,'request\x20sent',JSON['stringify'](_0xceb62c));if(_0xceb62c[_0xf80a('0x22')]){if(_0xceb62c[_0xf80a('0x22')]['code']===0x1f4){logger[_0xf80a('0x22')](_0xf80a('0x23'),_0xb99a66,_0xceb62c[_0xf80a('0x22')][_0xf80a('0x24')]);return _0x5f2bcd(_0xceb62c[_0xf80a('0x22')]['message']);}logger['error'](_0xf80a('0x23'),_0xb99a66,_0xceb62c[_0xf80a('0x22')][_0xf80a('0x24')]);return _0x258021(_0xceb62c[_0xf80a('0x22')][_0xf80a('0x24')]);}else{logger['info']('SugarcrmAccount,\x20%s,\x20%s',_0xb99a66,'request\x20sent');_0x258021(_0xceb62c['result'][_0xf80a('0x24')]);}})[_0xf80a('0x25')](function(_0x3ef1ca){logger[_0xf80a('0x22')](_0xf80a('0x23'),_0xb99a66,_0x3ef1ca);_0x5f2bcd(_0x3ef1ca);});});}function respondWithStatusCode(_0x1eafa1,_0x16c220){_0x16c220=_0x16c220||0xcc;return function(_0x45cec0){if(_0x45cec0){return _0x1eafa1['sendStatus'](_0x16c220);}return _0x1eafa1[_0xf80a('0x26')](_0x16c220)[_0xf80a('0x27')]();};}function respondWithResult(_0xce02ba,_0x1d9a29){_0x1d9a29=_0x1d9a29||0xc8;return function(_0x3141b0){if(_0x3141b0){return _0xce02ba[_0xf80a('0x26')](_0x1d9a29)['json'](_0x3141b0);}};}function respondWithFilteredResult(_0xb27d38,_0x1cd8be){return function(_0x3df43a){if(_0x3df43a){var _0x346b78=_0x3df43a[_0xf80a('0x28')],_0x71a489=_0x1cd8be['offset'],_0x124cdf=_0x1cd8be[_0xf80a('0x29')]+_0x1cd8be['limit'],_0x594872;if(_0x124cdf>=_0x346b78){_0x124cdf=_0x346b78;_0x594872=0xc8;}else{_0x594872=0xce;}_0xb27d38[_0xf80a('0x26')](_0x594872);return _0xb27d38[_0xf80a('0x2a')](_0xf80a('0x2b'),_0x71a489+'-'+_0x124cdf+'/'+_0x346b78)[_0xf80a('0x2c')](_0x3df43a);}return null;};}function patchUpdates(_0x318f77){return function(_0x4e3855){try{jsonpatch[_0xf80a('0x2d')](_0x4e3855,_0x318f77,!![]);}catch(_0x49536c){return BPromise[_0xf80a('0x2e')](_0x49536c);}return _0x4e3855[_0xf80a('0x2f')]();};}function saveUpdates(_0x10f126,_0x1a8ca6){return function(_0x325e3f){if(_0x325e3f){return _0x325e3f[_0xf80a('0x30')](_0x10f126)[_0xf80a('0x1d')](function(_0x44e0ff){return _0x44e0ff;});}return null;};}function removeEntity(_0x3367b0,_0x35a4fe){return function(_0x590b9e){if(_0x590b9e){return _0x590b9e[_0xf80a('0x31')]()[_0xf80a('0x1d')](function(){_0x3367b0['status'](0xcc)[_0xf80a('0x27')]();});}};}function handleEntityNotFound(_0x511d0c,_0x448095){return function(_0x2b7588){if(!_0x2b7588){_0x511d0c['sendStatus'](0x194);}return _0x2b7588;};}function handleError(_0x5d2423,_0x452128){_0x452128=_0x452128||0x1f4;return function(_0x56146d){logger['error'](_0x56146d[_0xf80a('0x32')]);if(_0x56146d[_0xf80a('0x33')]){delete _0x56146d['name'];}_0x5d2423[_0xf80a('0x26')](_0x452128)[_0xf80a('0x34')](_0x56146d);};}exports[_0xf80a('0x35')]=function(_0x31771a,_0x1d5375){var _0x23b258={},_0x440234={},_0x135162={'count':0x0,'rows':[]};var _0xd5a8a8=_['map'](db[_0xf80a('0x36')][_0xf80a('0x37')],function(_0x4b4b1a){return{'name':_0x4b4b1a[_0xf80a('0x38')],'type':_0x4b4b1a[_0xf80a('0x39')][_0xf80a('0x3a')]};});_0x440234[_0xf80a('0x3b')]=_[_0xf80a('0x3c')](_0xd5a8a8,_0xf80a('0x33'));_0x440234['query']=_[_0xf80a('0x3d')](_0x31771a[_0xf80a('0x3e')]);_0x440234[_0xf80a('0x3f')]=_[_0xf80a('0x40')](_0x440234[_0xf80a('0x3b')],_0x440234[_0xf80a('0x3e')]);_0x23b258['attributes']=_['intersection'](_0x440234['model'],qs[_0xf80a('0x41')](_0x31771a[_0xf80a('0x3e')][_0xf80a('0x41')]));_0x23b258[_0xf80a('0x42')]=_0x23b258[_0xf80a('0x42')][_0xf80a('0x43')]?_0x23b258['attributes']:_0x440234[_0xf80a('0x3b')];if(!_0x31771a['query'][_0xf80a('0x44')](_0xf80a('0x45'))){_0x23b258['limit']=qs[_0xf80a('0x46')](_0x31771a['query'][_0xf80a('0x46')]);_0x23b258['offset']=qs[_0xf80a('0x29')](_0x31771a['query'][_0xf80a('0x29')]);}_0x23b258[_0xf80a('0x47')]=qs[_0xf80a('0x48')](_0x31771a[_0xf80a('0x3e')]['sort']);_0x23b258['where']=qs[_0xf80a('0x3f')](_[_0xf80a('0x49')](_0x31771a[_0xf80a('0x3e')],_0x440234[_0xf80a('0x3f')]));if(_0x31771a[_0xf80a('0x3e')]['filter']){_0x23b258['where']=_[_0xf80a('0x4a')](_0x23b258['where'],{'$or':_[_0xf80a('0x3c')](_0xd5a8a8,function(_0x225f6b){if(_0x225f6b[_0xf80a('0x39')]!==_0xf80a('0x4b')){var _0x2b64fc={};_0x2b64fc[_0x225f6b[_0xf80a('0x33')]]={'$like':'%'+_0x31771a[_0xf80a('0x3e')][_0xf80a('0x4c')]+'%'};return _0x2b64fc;}})});}_0x23b258=_['merge']({},_0x23b258,_0x31771a[_0xf80a('0x4d')]);var _0x162cdc={'where':_0x23b258[_0xf80a('0x4e')]};return db['SugarcrmAccount'][_0xf80a('0x28')](_0x162cdc)[_0xf80a('0x1d')](function(_0x228a7a){_0x135162['count']=_0x228a7a;if(_0x31771a[_0xf80a('0x3e')][_0xf80a('0x4f')]){_0x23b258['include']=[{'all':!![]}];}return db['SugarcrmAccount'][_0xf80a('0x50')](_0x23b258);})[_0xf80a('0x1d')](function(_0x172f48){_0x135162['rows']=_0x172f48;return _0x135162;})[_0xf80a('0x1d')](respondWithFilteredResult(_0x1d5375,_0x23b258))[_0xf80a('0x25')](handleError(_0x1d5375,null));};exports[_0xf80a('0x51')]=function(_0x836619,_0x4d1f52){var _0x277693={'raw':![],'where':{'id':_0x836619[_0xf80a('0x52')]['id']}},_0x527eb5={};_0x527eb5[_0xf80a('0x3b')]=_['keys'](db[_0xf80a('0x36')][_0xf80a('0x37')]);_0x527eb5[_0xf80a('0x3e')]=_[_0xf80a('0x3d')](_0x836619[_0xf80a('0x3e')]);_0x527eb5[_0xf80a('0x3f')]=_[_0xf80a('0x40')](_0x527eb5['model'],_0x527eb5['query']);_0x277693[_0xf80a('0x42')]=_[_0xf80a('0x40')](_0x527eb5[_0xf80a('0x3b')],qs[_0xf80a('0x41')](_0x836619[_0xf80a('0x3e')][_0xf80a('0x41')]));_0x277693[_0xf80a('0x42')]=_0x277693[_0xf80a('0x42')][_0xf80a('0x43')]?_0x277693[_0xf80a('0x42')]:_0x527eb5[_0xf80a('0x3b')];if(_0x836619[_0xf80a('0x3e')][_0xf80a('0x4f')]){_0x277693['include']=[{'all':!![]}];}_0x277693=_['merge']({},_0x277693,_0x836619[_0xf80a('0x4d')]);return db['SugarcrmAccount'][_0xf80a('0x53')](_0x277693)[_0xf80a('0x1d')](handleEntityNotFound(_0x4d1f52,null))[_0xf80a('0x1d')](respondWithResult(_0x4d1f52,null))[_0xf80a('0x25')](handleError(_0x4d1f52,null));};exports[_0xf80a('0x54')]=function(_0x2570c4,_0x299466){return db[_0xf80a('0x36')]['create'](_0x2570c4[_0xf80a('0x55')],{})[_0xf80a('0x1d')](respondWithResult(_0x299466,0xc9))[_0xf80a('0x25')](handleError(_0x299466,null));};exports[_0xf80a('0x30')]=function(_0x5257c9,_0x4c778e){if(_0x5257c9[_0xf80a('0x55')]['id']){delete _0x5257c9[_0xf80a('0x55')]['id'];}return db[_0xf80a('0x36')][_0xf80a('0x53')]({'where':{'id':_0x5257c9[_0xf80a('0x52')]['id']}})[_0xf80a('0x1d')](handleEntityNotFound(_0x4c778e,null))['then'](saveUpdates(_0x5257c9['body'],null))[_0xf80a('0x1d')](respondWithResult(_0x4c778e,null))['catch'](handleError(_0x4c778e,null));};exports[_0xf80a('0x31')]=function(_0x1e2fd3,_0x8b4f8f){return db['SugarcrmAccount'][_0xf80a('0x53')]({'where':{'id':_0x1e2fd3['params']['id']}})[_0xf80a('0x1d')](handleEntityNotFound(_0x8b4f8f,null))[_0xf80a('0x1d')](removeEntity(_0x8b4f8f,null))[_0xf80a('0x25')](handleError(_0x8b4f8f,null));};exports[_0xf80a('0x56')]=function(_0x20847a,_0x389ca8,_0x3b1b4e){var _0x210fd8={};var _0xcf89a6={};var _0x1d8434;var _0x384d1c;return db['SugarcrmAccount'][_0xf80a('0x57')]({'where':{'id':_0x20847a[_0xf80a('0x52')]['id']}})[_0xf80a('0x1d')](handleEntityNotFound(_0x389ca8,null))[_0xf80a('0x1d')](function(_0x32fc78){if(_0x32fc78){_0x1d8434=_0x32fc78;_0xcf89a6[_0xf80a('0x3b')]=_[_0xf80a('0x3d')](db[_0xf80a('0x58')][_0xf80a('0x37')]);_0xcf89a6[_0xf80a('0x3e')]=_[_0xf80a('0x3d')](_0x20847a[_0xf80a('0x3e')]);_0xcf89a6[_0xf80a('0x3f')]=_[_0xf80a('0x40')](_0xcf89a6[_0xf80a('0x3b')],_0xcf89a6[_0xf80a('0x3e')]);_0x210fd8[_0xf80a('0x42')]=_[_0xf80a('0x40')](_0xcf89a6['model'],qs[_0xf80a('0x41')](_0x20847a[_0xf80a('0x3e')][_0xf80a('0x41')]));_0x210fd8[_0xf80a('0x42')]=_0x210fd8['attributes'][_0xf80a('0x43')]?_0x210fd8[_0xf80a('0x42')]:_0xcf89a6[_0xf80a('0x3b')];_0x210fd8['order']=qs[_0xf80a('0x48')](_0x20847a[_0xf80a('0x3e')]['sort']);_0x210fd8[_0xf80a('0x4e')]=qs['filters'](_[_0xf80a('0x49')](_0x20847a[_0xf80a('0x3e')],_0xcf89a6[_0xf80a('0x3f')]));if(_0x20847a[_0xf80a('0x3e')][_0xf80a('0x4c')]){_0x210fd8[_0xf80a('0x4e')]=_[_0xf80a('0x4a')](_0x210fd8[_0xf80a('0x4e')],{'$or':_['map'](_0x210fd8[_0xf80a('0x42')],function(_0x317da0){var _0x4e5862={};_0x4e5862[_0x317da0]={'$like':'%'+_0x20847a['query'][_0xf80a('0x4c')]+'%'};return _0x4e5862;})});}_0x210fd8=_[_0xf80a('0x4a')]({},_0x210fd8,_0x20847a['options']);return _0x1d8434[_0xf80a('0x56')](_0x210fd8);}})['then'](function(_0x30d6c7){if(_0x30d6c7){_0x384d1c=_0x30d6c7['length'];if(!_0x20847a[_0xf80a('0x3e')][_0xf80a('0x44')](_0xf80a('0x45'))){_0x210fd8['limit']=qs['limit'](_0x20847a[_0xf80a('0x3e')][_0xf80a('0x46')]);_0x210fd8[_0xf80a('0x29')]=qs['offset'](_0x20847a[_0xf80a('0x3e')]['offset']);}return _0x1d8434[_0xf80a('0x56')](_0x210fd8);}})[_0xf80a('0x1d')](function(_0x2b9736){if(_0x2b9736){return _0x2b9736?{'count':_0x384d1c,'rows':_0x2b9736}:null;}})[_0xf80a('0x1d')](respondWithResult(_0x389ca8,null))[_0xf80a('0x25')](handleError(_0x389ca8,null));};exports[_0xf80a('0x59')]=function(_0x12c422,_0x1d1469,_0xb338a3){if(_0x12c422[_0xf80a('0x55')]['id']){delete _0x12c422['body']['id'];}return db[_0xf80a('0x36')][_0xf80a('0x57')]({'where':{'id':_0x12c422[_0xf80a('0x52')]['id']}})[_0xf80a('0x1d')](handleEntityNotFound(_0x1d1469,null))[_0xf80a('0x1d')](function(_0x5982b6){if(_0x5982b6){_0x12c422['body'][_0xf80a('0x5a')]=_0x5982b6['id'];_0x12c422[_0xf80a('0x55')]['Subjects']=integrations[_0xf80a('0x5b')](_0x12c422[_0xf80a('0x55')]['channel'],_0x12c422[_0xf80a('0x55')][_0xf80a('0x39')]);_0x12c422[_0xf80a('0x55')][_0xf80a('0x5c')]=integrations[_0xf80a('0x5d')](_0x12c422[_0xf80a('0x55')]['channel'],_0x12c422[_0xf80a('0x55')][_0xf80a('0x39')]);return db[_0xf80a('0x58')]['create'](_0x12c422[_0xf80a('0x55')],{'include':[{'model':db[_0xf80a('0x5e')],'as':_0xf80a('0x5f')},{'model':db[_0xf80a('0x5e')],'as':_0xf80a('0x5c')}]});}return null;})[_0xf80a('0x1d')](respondWithResult(_0x1d1469,null))[_0xf80a('0x25')](handleError(_0x1d1469,null));};exports['getFields']=function(_0x415d7b,_0x4f16ff,_0x2cfda8){var _0x37b7db='';var _0x3d915a=['id','name',_0xf80a('0x60'),_0xf80a('0x61'),'description',_0xf80a('0x62'),_0xf80a('0x63'),'duration_minutes',_0xf80a('0x64'),'parent_type',_0xf80a('0x65'),_0xf80a('0x66')];return db[_0xf80a('0x36')][_0xf80a('0x57')]({'where':{'id':_0x415d7b[_0xf80a('0x52')]['id']},'attributes':['id',_0xf80a('0x67'),_0xf80a('0x68'),'remoteUri']})[_0xf80a('0x1d')](handleEntityNotFound(_0x4f16ff,null))[_0xf80a('0x1d')](function(_0x36af7f){if(_0x36af7f){_0x37b7db=_0x36af7f['remoteUri'];var _0x1b2e9c=_0x37b7db[_0xf80a('0x69')](-0x1);if(_0x1b2e9c==='/'){_0x37b7db=_0x37b7db[_0xf80a('0x6a')](0x0,_0x37b7db[_0xf80a('0x6b')](_0x1b2e9c));}return rp({'method':_0xf80a('0x6c'),'uri':util[_0xf80a('0x6d')](_0xf80a('0x6e'),_0x37b7db,_0xf80a('0x6f')),'json':!![],'form':{'method':'login','input_type':_0xf80a('0x70'),'response_type':_0xf80a('0x70'),'rest_data':JSON['stringify']({'user_auth':{'user_name':_0x36af7f[_0xf80a('0x67')],'password':_0x36af7f[_0xf80a('0x68')],'encryption':_0xf80a('0x71')},'application':_0xf80a('0x72')})}});}})[_0xf80a('0x1d')](function(_0x582bf9){if(_0x582bf9&&_0x582bf9['name']!==_0xf80a('0x73')&&_0x582bf9['name']!==_0xf80a('0x74')){return rp({'method':_0xf80a('0x6c'),'uri':util['format'](_0xf80a('0x6e'),_0x37b7db,_0xf80a('0x6f')),'json':!![],'form':{'method':_0xf80a('0x75'),'input_type':_0xf80a('0x70'),'response_type':'JSON','rest_data':JSON[_0xf80a('0x76')]({'session':_0x582bf9['id'],'module_name':_0xf80a('0x77')})}})[_0xf80a('0x1d')](function(_0x16a141){if(_0x16a141){var _0x2acd90=_[_0xf80a('0x78')](_0x16a141[_0xf80a('0x79')]);_['remove'](_0x2acd90,function(_0x251748){return _0x3d915a[_0xf80a('0x7a')](_0x251748['name']);});return{'count':_0x2acd90[_0xf80a('0x43')],'rows':_[_0xf80a('0x3c')](_0x2acd90,function(_0x29a5a5){return{'id':_0x29a5a5[_0xf80a('0x33')],'name':_0x29a5a5['label'],'custom':_[_0xf80a('0x7b')](_0x29a5a5[_0xf80a('0x33')],'_c')?!![]:![],'options':_0x29a5a5[_0xf80a('0x4d')]?_[_0xf80a('0x3c')](_[_0xf80a('0x78')](_0x29a5a5[_0xf80a('0x4d')]),function(_0x580cc0){return{'name':_0x580cc0[_0xf80a('0x7c')],'value':_0x580cc0['name']};}):[]};})};}})[_0xf80a('0x1d')](respondWithResult(_0x4f16ff,null))[_0xf80a('0x25')](function(_0x5f15f7){var _0x1cd66b=_0x415d7b[_0xf80a('0x3e')][_0xf80a('0x7d')]?0x1f4:_0x5f15f7[_0xf80a('0x7e')]||0x1f4;logger[_0xf80a('0x22')](_0xf80a('0x7f'),'getFields',_0x1cd66b,JSON[_0xf80a('0x76')](_0x5f15f7));delete _0x5f15f7[_0xf80a('0x33')];if(_0x1cd66b===0x191){_0x1cd66b=0x190;}_0x4f16ff['status'](_0x1cd66b)[_0xf80a('0x34')](_0x415d7b[_0xf80a('0x3e')]['test']?{'message':'Wrong\x20credentials','statusCode':_0x5f15f7[_0xf80a('0x7e')]}:_0x5f15f7);});}else{var _0x32b7fa=0x1f4;_0x4f16ff['status'](_0x32b7fa)[_0xf80a('0x34')]({'message':'Wrong\x20credentials','statusCode':0x190});}});};
\ No newline at end of file
diff --git a/server/api/intSugarcrmAccount/intSugarcrmAccount.model.js b/server/api/intSugarcrmAccount/intSugarcrmAccount.model.js
index 3ec7be0..ab30df0 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 _0x4b72=['int_sugarcrm_accounts','lodash','../../config/logger','api','moment','request-promise','path','exports','SugarcrmAccount'];(function(_0x3554f8,_0x265d21){var _0x4f58a6=function(_0x409774){while(--_0x409774){_0x3554f8['push'](_0x3554f8['shift']());}};_0x4f58a6(++_0x265d21);}(_0x4b72,0xac));var _0x24b7=function(_0x17caa3,_0x503a1c){_0x17caa3=_0x17caa3-0x0;var _0x41f9db=_0x4b72[_0x17caa3];return _0x41f9db;};'use strict';var _=require(_0x24b7('0x0'));var util=require('util');var logger=require(_0x24b7('0x1'))(_0x24b7('0x2'));var moment=require(_0x24b7('0x3'));var BPromise=require('bluebird');var rp=require(_0x24b7('0x4'));var fs=require('fs');var path=require(_0x24b7('0x5'));var rimraf=require('rimraf');var config=require('../../config/environment');var attributes=require('./intSugarcrmAccount.attributes');var integrations=require('../../components/integrations/configuration');module[_0x24b7('0x6')]=function(_0x21af33,_0x4bc493){return _0x21af33['define'](_0x24b7('0x7'),attributes,{'tableName':_0x24b7('0x8'),'paranoid':![],'indexes':[],'timestamps':!![]});};
\ No newline at end of file
+var _0xd2b7=['request-promise','path','rimraf','./intSugarcrmAccount.attributes','exports','define','SugarcrmAccount','int_sugarcrm_accounts','lodash','util','../../config/logger'];(function(_0x5c351c,_0x2046d8){var _0x26f3b3=function(_0x47ac18){while(--_0x47ac18){_0x5c351c['push'](_0x5c351c['shift']());}};_0x26f3b3(++_0x2046d8);}(_0xd2b7,0x97));var _0x7d2b=function(_0x5a4400,_0xfae3b6){_0x5a4400=_0x5a4400-0x0;var _0xf9b532=_0xd2b7[_0x5a4400];return _0xf9b532;};'use strict';var _=require(_0x7d2b('0x0'));var util=require(_0x7d2b('0x1'));var logger=require(_0x7d2b('0x2'))('api');var moment=require('moment');var BPromise=require('bluebird');var rp=require(_0x7d2b('0x3'));var fs=require('fs');var path=require(_0x7d2b('0x4'));var rimraf=require(_0x7d2b('0x5'));var config=require('../../config/environment');var attributes=require(_0x7d2b('0x6'));var integrations=require('../../components/integrations/configuration');module[_0x7d2b('0x7')]=function(_0x44b50c,_0x47f572){return _0x44b50c[_0x7d2b('0x8')](_0x7d2b('0x9'),attributes,{'tableName':_0x7d2b('0xa'),'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 968debe..3045a53 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 _0xaf64=['findAll','options','raw','attributes','limit','map','include','model','debug','catch','ShowSugarcrmAccount','where','lodash','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','http','request','then','SugarcrmAccount,\x20%s,\x20%s','request\x20sent','stringify','error','code','message','info','result','GetSugarcrmAccount','SugarcrmAccount'];(function(_0x550d2a,_0x3b1087){var _0x2009b4=function(_0x182f6d){while(--_0x182f6d){_0x550d2a['push'](_0x550d2a['shift']());}};_0x2009b4(++_0x3b1087);}(_0xaf64,0x1bc));var _0x4af6=function(_0x469a3c,_0x5ebc10){_0x469a3c=_0x469a3c-0x0;var _0x968f4=_0xaf64[_0x469a3c];return _0x968f4;};'use strict';var _=require(_0x4af6('0x0'));var util=require('util');var moment=require(_0x4af6('0x1'));var BPromise=require(_0x4af6('0x2'));var rs=require(_0x4af6('0x3'));var fs=require('fs');var Redis=require(_0x4af6('0x4'));var db=require(_0x4af6('0x5'))['db'];var utils=require(_0x4af6('0x6'));var logger=require(_0x4af6('0x7'))(_0x4af6('0x8'));var config=require(_0x4af6('0x9'));var jayson=require(_0x4af6('0xa'));var client=jayson['client'][_0x4af6('0xb')]({'port':0x232a});function respondWithRpcPromise(_0x3ca7dc,_0x265a57,_0x4a993a){return new BPromise(function(_0x380e55,_0x2c2d03){return client[_0x4af6('0xc')](_0x3ca7dc,_0x4a993a)[_0x4af6('0xd')](function(_0x151ab1){logger['info'](_0x4af6('0xe'),_0x265a57,_0x4af6('0xf'));logger['debug']('SugarcrmAccount,\x20%s,\x20%s,\x20%s',_0x265a57,'request\x20sent',JSON[_0x4af6('0x10')](_0x151ab1));if(_0x151ab1[_0x4af6('0x11')]){if(_0x151ab1[_0x4af6('0x11')][_0x4af6('0x12')]===0x1f4){logger[_0x4af6('0x11')](_0x4af6('0xe'),_0x265a57,_0x151ab1[_0x4af6('0x11')][_0x4af6('0x13')]);return _0x2c2d03(_0x151ab1[_0x4af6('0x11')][_0x4af6('0x13')]);}logger[_0x4af6('0x11')](_0x4af6('0xe'),_0x265a57,_0x151ab1[_0x4af6('0x11')]['message']);return _0x380e55(_0x151ab1[_0x4af6('0x11')][_0x4af6('0x13')]);}else{logger[_0x4af6('0x14')](_0x4af6('0xe'),_0x265a57,_0x4af6('0xf'));_0x380e55(_0x151ab1[_0x4af6('0x15')]['message']);}})['catch'](function(_0x23e42f){logger[_0x4af6('0x11')]('SugarcrmAccount,\x20%s,\x20%s',_0x265a57,_0x23e42f);_0x2c2d03(_0x23e42f);});});}exports[_0x4af6('0x16')]=function(_0x205b97){var _0x38e5f0=this;return new Promise(function(_0x214596,_0xb3001a){return db[_0x4af6('0x17')][_0x4af6('0x18')]({'raw':_0x205b97[_0x4af6('0x19')]?_0x205b97[_0x4af6('0x19')][_0x4af6('0x1a')]===undefined?!![]:![]:!![],'where':_0x205b97[_0x4af6('0x19')]?_0x205b97['options']['where']||null:null,'attributes':_0x205b97[_0x4af6('0x19')]?_0x205b97[_0x4af6('0x19')][_0x4af6('0x1b')]||null:null,'limit':_0x205b97[_0x4af6('0x19')]?_0x205b97[_0x4af6('0x19')][_0x4af6('0x1c')]||null:null,'include':_0x205b97[_0x4af6('0x19')]?_0x205b97[_0x4af6('0x19')]['include']?_[_0x4af6('0x1d')](_0x205b97[_0x4af6('0x19')][_0x4af6('0x1e')],function(_0x432329){return{'model':db[_0x432329[_0x4af6('0x1f')]],'as':_0x432329['as'],'attributes':_0x432329['attributes'],'include':_0x432329[_0x4af6('0x1e')]?_[_0x4af6('0x1d')](_0x432329[_0x4af6('0x1e')],function(_0x62e328){return{'model':db[_0x62e328['model']],'as':_0x62e328['as'],'attributes':_0x62e328[_0x4af6('0x1b')],'include':_0x62e328[_0x4af6('0x1e')]?_[_0x4af6('0x1d')](_0x62e328['include'],function(_0xbaa52){return{'model':db[_0xbaa52[_0x4af6('0x1f')]],'as':_0xbaa52['as'],'attributes':_0xbaa52[_0x4af6('0x1b')]};}):[]};}):[]};}):[]:[]})['then'](function(_0x6e407c){logger[_0x4af6('0x14')](_0x4af6('0x16'),_0x205b97);logger[_0x4af6('0x20')](_0x4af6('0x16'),_0x205b97,JSON[_0x4af6('0x10')](_0x6e407c));_0x214596(_0x6e407c);})[_0x4af6('0x21')](function(_0x4ce41d){logger[_0x4af6('0x11')](_0x4af6('0x16'),_0x4ce41d['message'],_0x205b97);_0xb3001a(_0x38e5f0[_0x4af6('0x11')](0x1f4,_0x4ce41d['message']));});});};exports[_0x4af6('0x22')]=function(_0x1966ee){var _0x2aa874=this;return new Promise(function(_0x3dc4cd,_0x5549a4){return db[_0x4af6('0x17')]['find']({'raw':_0x1966ee[_0x4af6('0x19')]?_0x1966ee[_0x4af6('0x19')]['raw']===undefined?!![]:![]:!![],'where':_0x1966ee[_0x4af6('0x19')]?_0x1966ee[_0x4af6('0x19')][_0x4af6('0x23')]||null:null,'attributes':_0x1966ee[_0x4af6('0x19')]?_0x1966ee[_0x4af6('0x19')][_0x4af6('0x1b')]||null:null,'include':_0x1966ee['options']?_0x1966ee['options'][_0x4af6('0x1e')]?_[_0x4af6('0x1d')](_0x1966ee['options'][_0x4af6('0x1e')],function(_0x1a2c7b){return{'model':db[_0x1a2c7b[_0x4af6('0x1f')]],'as':_0x1a2c7b['as'],'attributes':_0x1a2c7b[_0x4af6('0x1b')],'include':_0x1a2c7b[_0x4af6('0x1e')]?_[_0x4af6('0x1d')](_0x1a2c7b[_0x4af6('0x1e')],function(_0x56a155){return{'model':db[_0x56a155['model']],'as':_0x56a155['as'],'attributes':_0x56a155[_0x4af6('0x1b')],'include':_0x56a155[_0x4af6('0x1e')]?_[_0x4af6('0x1d')](_0x56a155[_0x4af6('0x1e')],function(_0x28b45c){return{'model':db[_0x28b45c[_0x4af6('0x1f')]],'as':_0x28b45c['as'],'attributes':_0x28b45c['attributes']};}):[]};}):[]};}):[]:[]})[_0x4af6('0xd')](function(_0x1b15f0){logger['info'](_0x4af6('0x22'),_0x1966ee);logger[_0x4af6('0x20')](_0x4af6('0x22'),_0x1966ee,JSON[_0x4af6('0x10')](_0x1b15f0));_0x3dc4cd(_0x1b15f0);})['catch'](function(_0xcfaf59){logger['error']('ShowSugarcrmAccount',_0xcfaf59[_0x4af6('0x13')],_0x1966ee);_0x5549a4(_0x2aa874[_0x4af6('0x11')](0x1f4,_0xcfaf59[_0x4af6('0x13')]));});});};
\ No newline at end of file
+var _0xe64a=['findAll','options','where','limit','include','map','model','attributes','catch','ShowSugarcrmAccount','SugarcrmAccount','raw','debug','lodash','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','../../config/environment','jayson/promise','client','http','then','info','SugarcrmAccount,\x20%s,\x20%s','SugarcrmAccount,\x20%s,\x20%s,\x20%s','request\x20sent','stringify','error','code','message','result','GetSugarcrmAccount'];(function(_0x13cb09,_0x2516f4){var _0x5a04af=function(_0x37e1f9){while(--_0x37e1f9){_0x13cb09['push'](_0x13cb09['shift']());}};_0x5a04af(++_0x2516f4);}(_0xe64a,0x79));var _0xae64=function(_0x4a9fb1,_0x273043){_0x4a9fb1=_0x4a9fb1-0x0;var _0x348672=_0xe64a[_0x4a9fb1];return _0x348672;};'use strict';var _=require(_0xae64('0x0'));var util=require('util');var moment=require(_0xae64('0x1'));var BPromise=require(_0xae64('0x2'));var rs=require(_0xae64('0x3'));var fs=require('fs');var Redis=require(_0xae64('0x4'));var db=require(_0xae64('0x5'))['db'];var utils=require(_0xae64('0x6'));var logger=require(_0xae64('0x7'))('rpc');var config=require(_0xae64('0x8'));var jayson=require(_0xae64('0x9'));var client=jayson[_0xae64('0xa')][_0xae64('0xb')]({'port':0x232a});function respondWithRpcPromise(_0x32a594,_0x1f2fb5,_0xe01a26){return new BPromise(function(_0x5e9bb,_0x36408f){return client['request'](_0x32a594,_0xe01a26)[_0xae64('0xc')](function(_0x1601c8){logger[_0xae64('0xd')](_0xae64('0xe'),_0x1f2fb5,'request\x20sent');logger['debug'](_0xae64('0xf'),_0x1f2fb5,_0xae64('0x10'),JSON[_0xae64('0x11')](_0x1601c8));if(_0x1601c8['error']){if(_0x1601c8[_0xae64('0x12')][_0xae64('0x13')]===0x1f4){logger[_0xae64('0x12')](_0xae64('0xe'),_0x1f2fb5,_0x1601c8['error'][_0xae64('0x14')]);return _0x36408f(_0x1601c8[_0xae64('0x12')][_0xae64('0x14')]);}logger[_0xae64('0x12')]('SugarcrmAccount,\x20%s,\x20%s',_0x1f2fb5,_0x1601c8['error'][_0xae64('0x14')]);return _0x5e9bb(_0x1601c8[_0xae64('0x12')][_0xae64('0x14')]);}else{logger[_0xae64('0xd')](_0xae64('0xe'),_0x1f2fb5,_0xae64('0x10'));_0x5e9bb(_0x1601c8[_0xae64('0x15')][_0xae64('0x14')]);}})['catch'](function(_0x22cddd){logger[_0xae64('0x12')]('SugarcrmAccount,\x20%s,\x20%s',_0x1f2fb5,_0x22cddd);_0x36408f(_0x22cddd);});});}exports[_0xae64('0x16')]=function(_0xe000d1){var _0x2baecc=this;return new Promise(function(_0x24b5b3,_0x956e5e){return db['SugarcrmAccount'][_0xae64('0x17')]({'raw':_0xe000d1[_0xae64('0x18')]?_0xe000d1[_0xae64('0x18')]['raw']===undefined?!![]:![]:!![],'where':_0xe000d1['options']?_0xe000d1['options'][_0xae64('0x19')]||null:null,'attributes':_0xe000d1[_0xae64('0x18')]?_0xe000d1[_0xae64('0x18')]['attributes']||null:null,'limit':_0xe000d1[_0xae64('0x18')]?_0xe000d1[_0xae64('0x18')][_0xae64('0x1a')]||null:null,'include':_0xe000d1[_0xae64('0x18')]?_0xe000d1[_0xae64('0x18')][_0xae64('0x1b')]?_[_0xae64('0x1c')](_0xe000d1[_0xae64('0x18')][_0xae64('0x1b')],function(_0x171a12){return{'model':db[_0x171a12[_0xae64('0x1d')]],'as':_0x171a12['as'],'attributes':_0x171a12[_0xae64('0x1e')],'include':_0x171a12[_0xae64('0x1b')]?_[_0xae64('0x1c')](_0x171a12[_0xae64('0x1b')],function(_0x347b29){return{'model':db[_0x347b29['model']],'as':_0x347b29['as'],'attributes':_0x347b29[_0xae64('0x1e')],'include':_0x347b29['include']?_['map'](_0x347b29[_0xae64('0x1b')],function(_0xd1b44d){return{'model':db[_0xd1b44d[_0xae64('0x1d')]],'as':_0xd1b44d['as'],'attributes':_0xd1b44d[_0xae64('0x1e')]};}):[]};}):[]};}):[]:[]})[_0xae64('0xc')](function(_0x4e1cfb){logger[_0xae64('0xd')](_0xae64('0x16'),_0xe000d1);logger['debug']('GetSugarcrmAccount',_0xe000d1,JSON['stringify'](_0x4e1cfb));_0x24b5b3(_0x4e1cfb);})[_0xae64('0x1f')](function(_0x9d9f63){logger[_0xae64('0x12')](_0xae64('0x16'),_0x9d9f63['message'],_0xe000d1);_0x956e5e(_0x2baecc['error'](0x1f4,_0x9d9f63[_0xae64('0x14')]));});});};exports[_0xae64('0x20')]=function(_0x1fce98){var _0x300f7f=this;return new Promise(function(_0x49f392,_0x13e700){return db[_0xae64('0x21')]['find']({'raw':_0x1fce98[_0xae64('0x18')]?_0x1fce98['options'][_0xae64('0x22')]===undefined?!![]:![]:!![],'where':_0x1fce98['options']?_0x1fce98[_0xae64('0x18')][_0xae64('0x19')]||null:null,'attributes':_0x1fce98[_0xae64('0x18')]?_0x1fce98[_0xae64('0x18')][_0xae64('0x1e')]||null:null,'include':_0x1fce98['options']?_0x1fce98[_0xae64('0x18')]['include']?_['map'](_0x1fce98[_0xae64('0x18')][_0xae64('0x1b')],function(_0x465a2d){return{'model':db[_0x465a2d[_0xae64('0x1d')]],'as':_0x465a2d['as'],'attributes':_0x465a2d[_0xae64('0x1e')],'include':_0x465a2d[_0xae64('0x1b')]?_[_0xae64('0x1c')](_0x465a2d[_0xae64('0x1b')],function(_0x47699d){return{'model':db[_0x47699d[_0xae64('0x1d')]],'as':_0x47699d['as'],'attributes':_0x47699d[_0xae64('0x1e')],'include':_0x47699d['include']?_[_0xae64('0x1c')](_0x47699d['include'],function(_0x15adaf){return{'model':db[_0x15adaf[_0xae64('0x1d')]],'as':_0x15adaf['as'],'attributes':_0x15adaf[_0xae64('0x1e')]};}):[]};}):[]};}):[]:[]})['then'](function(_0x5b85b9){logger['info'](_0xae64('0x20'),_0x1fce98);logger[_0xae64('0x23')](_0xae64('0x20'),_0x1fce98,JSON['stringify'](_0x5b85b9));_0x49f392(_0x5b85b9);})[_0xae64('0x1f')](function(_0x5235aa){logger[_0xae64('0x12')](_0xae64('0x20'),_0x5235aa[_0xae64('0x14')],_0x1fce98);_0x13e700(_0x300f7f['error'](0x1f4,_0x5235aa['message']));});});};
\ No newline at end of file
diff --git a/server/api/intSugarcrmConfiguration/index.js b/server/api/intSugarcrmConfiguration/index.js
index b47fc85..27fd3d0 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 _0x2c3b=['isAuthenticated','show','/:id/fields','getFields','/:id/subjects','getSubjects','/:id/descriptions','getDescriptions','post','update','exports','multer','util','path','connect-timeout','Router','../../components/auth/service','../../components/interaction/service','../../config/environment','./intSugarcrmConfiguration.controller','index','get','/:id'];(function(_0x33fafb,_0x446452){var _0x302b23=function(_0x3b3318){while(--_0x3b3318){_0x33fafb['push'](_0x33fafb['shift']());}};_0x302b23(++_0x446452);}(_0x2c3b,0x67));var _0xb2c3=function(_0xa14d8c,_0x14759b){_0xa14d8c=_0xa14d8c-0x0;var _0x3facda=_0x2c3b[_0xa14d8c];return _0x3facda;};'use strict';var multer=require(_0xb2c3('0x0'));var util=require(_0xb2c3('0x1'));var path=require(_0xb2c3('0x2'));var timeout=require(_0xb2c3('0x3'));var express=require('express');var router=express[_0xb2c3('0x4')]();var auth=require(_0xb2c3('0x5'));var interaction=require(_0xb2c3('0x6'));var config=require(_0xb2c3('0x7'));var controller=require(_0xb2c3('0x8'));router['get']('/',auth['isAuthenticated'](),controller[_0xb2c3('0x9')]);router[_0xb2c3('0xa')](_0xb2c3('0xb'),auth[_0xb2c3('0xc')](),controller[_0xb2c3('0xd')]);router[_0xb2c3('0xa')](_0xb2c3('0xe'),auth[_0xb2c3('0xc')](),controller[_0xb2c3('0xf')]);router[_0xb2c3('0xa')](_0xb2c3('0x10'),auth[_0xb2c3('0xc')](),controller[_0xb2c3('0x11')]);router[_0xb2c3('0xa')](_0xb2c3('0x12'),auth[_0xb2c3('0xc')](),controller[_0xb2c3('0x13')]);router[_0xb2c3('0x14')]('/',auth['isAuthenticated'](),controller['create']);router['put'](_0xb2c3('0xb'),auth[_0xb2c3('0xc')](),controller[_0xb2c3('0x15')]);router['delete'](_0xb2c3('0xb'),auth[_0xb2c3('0xc')](),controller['destroy']);module[_0xb2c3('0x16')]=router;
\ No newline at end of file
+var _0xd790=['post','put','update','delete','exports','multer','util','path','connect-timeout','Router','./intSugarcrmConfiguration.controller','get','isAuthenticated','index','/:id','/:id/fields','getFields','/:id/subjects','getSubjects','/:id/descriptions','getDescriptions'];(function(_0x5d6814,_0x1dfdc5){var _0x271a00=function(_0xf9c87c){while(--_0xf9c87c){_0x5d6814['push'](_0x5d6814['shift']());}};_0x271a00(++_0x1dfdc5);}(_0xd790,0x83));var _0x0d79=function(_0x11c5da,_0x5799cf){_0x11c5da=_0x11c5da-0x0;var _0x5cfbf1=_0xd790[_0x11c5da];return _0x5cfbf1;};'use strict';var multer=require(_0x0d79('0x0'));var util=require(_0x0d79('0x1'));var path=require(_0x0d79('0x2'));var timeout=require(_0x0d79('0x3'));var express=require('express');var router=express[_0x0d79('0x4')]();var auth=require('../../components/auth/service');var interaction=require('../../components/interaction/service');var config=require('../../config/environment');var controller=require(_0x0d79('0x5'));router[_0x0d79('0x6')]('/',auth[_0x0d79('0x7')](),controller[_0x0d79('0x8')]);router[_0x0d79('0x6')](_0x0d79('0x9'),auth[_0x0d79('0x7')](),controller['show']);router[_0x0d79('0x6')](_0x0d79('0xa'),auth[_0x0d79('0x7')](),controller[_0x0d79('0xb')]);router[_0x0d79('0x6')](_0x0d79('0xc'),auth[_0x0d79('0x7')](),controller[_0x0d79('0xd')]);router[_0x0d79('0x6')](_0x0d79('0xe'),auth[_0x0d79('0x7')](),controller[_0x0d79('0xf')]);router[_0x0d79('0x10')]('/',auth['isAuthenticated'](),controller['create']);router[_0x0d79('0x11')](_0x0d79('0x9'),auth[_0x0d79('0x7')](),controller[_0x0d79('0x12')]);router[_0x0d79('0x13')](_0x0d79('0x9'),auth[_0x0d79('0x7')](),controller['destroy']);module[_0x0d79('0x14')]=router;
\ No newline at end of file
diff --git a/server/api/intSugarcrmConfiguration/intSugarcrmConfiguration.attributes.js b/server/api/intSugarcrmConfiguration/intSugarcrmConfiguration.attributes.js
index f3302d4..ddc949f 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 _0x4896=['exports','STRING'];(function(_0x4fb42b,_0x34ba41){var _0x5e25c2=function(_0x41b972){while(--_0x41b972){_0x4fb42b['push'](_0x4fb42b['shift']());}};_0x5e25c2(++_0x34ba41);}(_0x4896,0x1a8));var _0x6489=function(_0x25ac79,_0x489368){_0x25ac79=_0x25ac79-0x0;var _0x4076d8=_0x4896[_0x25ac79];return _0x4076d8;};'use strict';var Sequelize=require('sequelize');module[_0x6489('0x0')]={'name':{'type':Sequelize[_0x6489('0x1')]},'description':{'type':Sequelize[_0x6489('0x1')]}};
\ No newline at end of file
+var _0xd1d6=['STRING'];(function(_0x39072d,_0x50c4af){var _0x1e3ab=function(_0x2cb820){while(--_0x2cb820){_0x39072d['push'](_0x39072d['shift']());}};_0x1e3ab(++_0x50c4af);}(_0xd1d6,0x182));var _0x6d1d=function(_0x40358f,_0x36dc38){_0x40358f=_0x40358f-0x0;var _0x5486b6=_0xd1d6[_0x40358f];return _0x5486b6;};'use strict';var Sequelize=require('sequelize');module['exports']={'name':{'type':Sequelize[_0x6d1d('0x0')]},'description':{'type':Sequelize['STRING']}};
\ No newline at end of file
diff --git a/server/api/intSugarcrmConfiguration/intSugarcrmConfiguration.controller.js b/server/api/intSugarcrmConfiguration/intSugarcrmConfiguration.controller.js
index d63f71e..5fd9a79 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 _0x9ab8=['create','body','find','findOne','getFields','getSubjects','nolimit','getDescriptions','SugarcrmField','html-pdf','rimraf','zip-dir','fast-json-patch','bluebird','util','sox','to-csv','ejs','lodash','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','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~!@#$%^&-_=+[{]}.','then','info','SugarcrmConfiguration,\x20%s,\x20%s','request\x20sent','debug','SugarcrmConfiguration,\x20%s,\x20%s,\x20%s','stringify','error','message','status','offset','limit','set','Content-Range','json','apply','reject','save','update','destroy','end','sendStatus','stack','name','send','index','map','SugarcrmConfiguration','rawAttributes','type','key','model','query','keys','filters','attributes','intersection','fields','length','hasOwnProperty','order','sort','where','pick','merge','filter','options','count','includeAll','include','findAll','rows','catch','show','params'];(function(_0x26b479,_0x4b8818){var _0x3acbfc=function(_0x120bd2){while(--_0x120bd2){_0x26b479['push'](_0x26b479['shift']());}};_0x3acbfc(++_0x4b8818);}(_0x9ab8,0xc3));var _0x89ab=function(_0x4dcedb,_0x29dbbe){_0x4dcedb=_0x4dcedb-0x0;var _0x43caa=_0x9ab8[_0x4dcedb];return _0x43caa;};'use strict';var pdf=require(_0x89ab('0x0'));var emlformat=require('eml-format');var rimraf=require(_0x89ab('0x1'));var zipdir=require(_0x89ab('0x2'));var jsonpatch=require(_0x89ab('0x3'));var rp=require('request-promise');var moment=require('moment');var BPromise=require(_0x89ab('0x4'));var Mustache=require('mustache');var util=require(_0x89ab('0x5'));var path=require('path');var sox=require(_0x89ab('0x6'));var csv=require(_0x89ab('0x7'));var ejs=require(_0x89ab('0x8'));var fs=require('fs');var _=require(_0x89ab('0x9'));var squel=require('squel');var crypto=require(_0x89ab('0xa'));var jsforce=require(_0x89ab('0xb'));var deskjs=require(_0x89ab('0xc'));var toCsv=require('to-csv');var querystring=require('querystring');var Papa=require(_0x89ab('0xd'));var Redis=require(_0x89ab('0xe'));var authService=require(_0x89ab('0xf'));var qs=require(_0x89ab('0x10'));var as=require(_0x89ab('0x11'));var hardwareService=require(_0x89ab('0x12'));var logger=require(_0x89ab('0x13'))('api');var utils=require(_0x89ab('0x14'));var config=require(_0x89ab('0x15'));var db=require(_0x89ab('0x16'))['db'];var jayson=require(_0x89ab('0x17'));var client=jayson['client'][_0x89ab('0x18')]({'port':0x232a});function checkPasswordPattern(_0xae3bc1,_0x3ff589,_0x4a296c){if(_0x4a296c){var _0x4cf3e7=new RegExp(/(?=.*[a-z])(?=.*[A-Z])(?=.*[0-9])(?=.*[?!@#\$%\^&\*~\-_=+[{\]\}])(?=.{8,})/);if(_0x4cf3e7[_0x89ab('0x19')](_0x3ff589)){return _0xae3bc1;}else{throw new db[(_0x89ab('0x1a'))][(_0x89ab('0x1b'))](_0x89ab('0x1c'));}}else{return _0xae3bc1;}}function respondWithRpcPromise(_0x2a54bd,_0x12840e,_0x545607,_0x431f0f){return new BPromise(function(_0x4fd88e,_0x3034cf){var _0x1bc82a=_0x431f0f||client;return _0x1bc82a['request'](_0x2a54bd,_0x545607)[_0x89ab('0x1d')](function(_0x40b43c){logger[_0x89ab('0x1e')](_0x89ab('0x1f'),_0x12840e,_0x89ab('0x20'));logger[_0x89ab('0x21')](_0x89ab('0x22'),_0x12840e,'request\x20sent',JSON[_0x89ab('0x23')](_0x40b43c));if(_0x40b43c[_0x89ab('0x24')]){if(_0x40b43c[_0x89ab('0x24')]['code']===0x1f4){logger[_0x89ab('0x24')]('SugarcrmConfiguration,\x20%s,\x20%s',_0x12840e,_0x40b43c[_0x89ab('0x24')]['message']);return _0x3034cf(_0x40b43c[_0x89ab('0x24')][_0x89ab('0x25')]);}logger[_0x89ab('0x24')](_0x89ab('0x1f'),_0x12840e,_0x40b43c[_0x89ab('0x24')][_0x89ab('0x25')]);return _0x4fd88e(_0x40b43c['error'][_0x89ab('0x25')]);}else{logger[_0x89ab('0x1e')](_0x89ab('0x1f'),_0x12840e,_0x89ab('0x20'));_0x4fd88e(_0x40b43c['result'][_0x89ab('0x25')]);}})['catch'](function(_0x4bb617){logger[_0x89ab('0x24')](_0x89ab('0x1f'),_0x12840e,_0x4bb617);_0x3034cf(_0x4bb617);});});}function respondWithStatusCode(_0x571508,_0x3b5223){_0x3b5223=_0x3b5223||0xcc;return function(_0x46d716){if(_0x46d716){return _0x571508['sendStatus'](_0x3b5223);}return _0x571508[_0x89ab('0x26')](_0x3b5223)['end']();};}function respondWithResult(_0x4d4f91,_0x7eb09d){_0x7eb09d=_0x7eb09d||0xc8;return function(_0x2660f3){if(_0x2660f3){return _0x4d4f91[_0x89ab('0x26')](_0x7eb09d)['json'](_0x2660f3);}};}function respondWithFilteredResult(_0x20b3f1,_0x4d1513){return function(_0x2ab718){if(_0x2ab718){var _0x3ec8e9=_0x2ab718['count'],_0x1e6300=_0x4d1513['offset'],_0x1980bb=_0x4d1513[_0x89ab('0x27')]+_0x4d1513[_0x89ab('0x28')],_0x5a782d;if(_0x1980bb>=_0x3ec8e9){_0x1980bb=_0x3ec8e9;_0x5a782d=0xc8;}else{_0x5a782d=0xce;}_0x20b3f1['status'](_0x5a782d);return _0x20b3f1[_0x89ab('0x29')](_0x89ab('0x2a'),_0x1e6300+'-'+_0x1980bb+'/'+_0x3ec8e9)[_0x89ab('0x2b')](_0x2ab718);}return null;};}function patchUpdates(_0x255580){return function(_0x4be55e){try{jsonpatch[_0x89ab('0x2c')](_0x4be55e,_0x255580,!![]);}catch(_0x471b75){return BPromise[_0x89ab('0x2d')](_0x471b75);}return _0x4be55e[_0x89ab('0x2e')]();};}function saveUpdates(_0x1c57a7,_0x590201){return function(_0x22422a){if(_0x22422a){return _0x22422a[_0x89ab('0x2f')](_0x1c57a7)[_0x89ab('0x1d')](function(_0xaee2ec){return _0xaee2ec;});}return null;};}function removeEntity(_0x2564d3,_0x4311c5){return function(_0x106ab9){if(_0x106ab9){return _0x106ab9[_0x89ab('0x30')]()[_0x89ab('0x1d')](function(){_0x2564d3[_0x89ab('0x26')](0xcc)[_0x89ab('0x31')]();});}};}function handleEntityNotFound(_0x4e4b4e,_0xa62b8d){return function(_0x3aa41b){if(!_0x3aa41b){_0x4e4b4e[_0x89ab('0x32')](0x194);}return _0x3aa41b;};}function handleError(_0x52a5cf,_0x525e5e){_0x525e5e=_0x525e5e||0x1f4;return function(_0x54681a){logger[_0x89ab('0x24')](_0x54681a[_0x89ab('0x33')]);if(_0x54681a['name']){delete _0x54681a[_0x89ab('0x34')];}_0x52a5cf[_0x89ab('0x26')](_0x525e5e)[_0x89ab('0x35')](_0x54681a);};}exports[_0x89ab('0x36')]=function(_0x294b73,_0x399914){var _0x11f8b3={},_0x542694={},_0x24f3f6={'count':0x0,'rows':[]};var _0x346055=_[_0x89ab('0x37')](db[_0x89ab('0x38')][_0x89ab('0x39')],function(_0x577491){return{'name':_0x577491['fieldName'],'type':_0x577491[_0x89ab('0x3a')][_0x89ab('0x3b')]};});_0x542694[_0x89ab('0x3c')]=_['map'](_0x346055,_0x89ab('0x34'));_0x542694[_0x89ab('0x3d')]=_[_0x89ab('0x3e')](_0x294b73[_0x89ab('0x3d')]);_0x542694[_0x89ab('0x3f')]=_['intersection'](_0x542694[_0x89ab('0x3c')],_0x542694[_0x89ab('0x3d')]);_0x11f8b3[_0x89ab('0x40')]=_[_0x89ab('0x41')](_0x542694['model'],qs[_0x89ab('0x42')](_0x294b73['query'][_0x89ab('0x42')]));_0x11f8b3[_0x89ab('0x40')]=_0x11f8b3[_0x89ab('0x40')][_0x89ab('0x43')]?_0x11f8b3['attributes']:_0x542694[_0x89ab('0x3c')];if(!_0x294b73[_0x89ab('0x3d')][_0x89ab('0x44')]('nolimit')){_0x11f8b3['limit']=qs[_0x89ab('0x28')](_0x294b73[_0x89ab('0x3d')][_0x89ab('0x28')]);_0x11f8b3[_0x89ab('0x27')]=qs['offset'](_0x294b73[_0x89ab('0x3d')][_0x89ab('0x27')]);}_0x11f8b3[_0x89ab('0x45')]=qs['sort'](_0x294b73[_0x89ab('0x3d')][_0x89ab('0x46')]);_0x11f8b3[_0x89ab('0x47')]=qs[_0x89ab('0x3f')](_[_0x89ab('0x48')](_0x294b73[_0x89ab('0x3d')],_0x542694[_0x89ab('0x3f')]));if(_0x294b73['query']['filter']){_0x11f8b3[_0x89ab('0x47')]=_[_0x89ab('0x49')](_0x11f8b3[_0x89ab('0x47')],{'$or':_[_0x89ab('0x37')](_0x346055,function(_0x1c3844){if(_0x1c3844[_0x89ab('0x3a')]!=='VIRTUAL'){var _0x4b5625={};_0x4b5625[_0x1c3844[_0x89ab('0x34')]]={'$like':'%'+_0x294b73['query'][_0x89ab('0x4a')]+'%'};return _0x4b5625;}})});}_0x11f8b3=_[_0x89ab('0x49')]({},_0x11f8b3,_0x294b73[_0x89ab('0x4b')]);var _0x143a1b={'where':_0x11f8b3[_0x89ab('0x47')]};return db[_0x89ab('0x38')][_0x89ab('0x4c')](_0x143a1b)['then'](function(_0x4e57bd){_0x24f3f6[_0x89ab('0x4c')]=_0x4e57bd;if(_0x294b73[_0x89ab('0x3d')][_0x89ab('0x4d')]){_0x11f8b3[_0x89ab('0x4e')]=[{'all':!![]}];}return db[_0x89ab('0x38')][_0x89ab('0x4f')](_0x11f8b3);})['then'](function(_0x465df7){_0x24f3f6[_0x89ab('0x50')]=_0x465df7;return _0x24f3f6;})['then'](respondWithFilteredResult(_0x399914,_0x11f8b3))[_0x89ab('0x51')](handleError(_0x399914,null));};exports[_0x89ab('0x52')]=function(_0x372681,_0x324125){var _0x2cd75b={'raw':![],'where':{'id':_0x372681[_0x89ab('0x53')]['id']}},_0x1b33ba={};_0x1b33ba[_0x89ab('0x3c')]=_[_0x89ab('0x3e')](db['SugarcrmConfiguration']['rawAttributes']);_0x1b33ba[_0x89ab('0x3d')]=_['keys'](_0x372681[_0x89ab('0x3d')]);_0x1b33ba[_0x89ab('0x3f')]=_[_0x89ab('0x41')](_0x1b33ba['model'],_0x1b33ba[_0x89ab('0x3d')]);_0x2cd75b[_0x89ab('0x40')]=_[_0x89ab('0x41')](_0x1b33ba[_0x89ab('0x3c')],qs[_0x89ab('0x42')](_0x372681[_0x89ab('0x3d')][_0x89ab('0x42')]));_0x2cd75b[_0x89ab('0x40')]=_0x2cd75b[_0x89ab('0x40')][_0x89ab('0x43')]?_0x2cd75b[_0x89ab('0x40')]:_0x1b33ba[_0x89ab('0x3c')];if(_0x372681[_0x89ab('0x3d')][_0x89ab('0x4d')]){_0x2cd75b[_0x89ab('0x4e')]=[{'all':!![]}];}_0x2cd75b=_[_0x89ab('0x49')]({},_0x2cd75b,_0x372681[_0x89ab('0x4b')]);return db[_0x89ab('0x38')]['find'](_0x2cd75b)[_0x89ab('0x1d')](handleEntityNotFound(_0x324125,null))['then'](respondWithResult(_0x324125,null))[_0x89ab('0x51')](handleError(_0x324125,null));};exports['create']=function(_0x105209,_0x5750a5){return db[_0x89ab('0x38')][_0x89ab('0x54')](_0x105209['body'],{})[_0x89ab('0x1d')](respondWithResult(_0x5750a5,0xc9))[_0x89ab('0x51')](handleError(_0x5750a5,null));};exports[_0x89ab('0x2f')]=function(_0x3018bf,_0x2dc255){if(_0x3018bf[_0x89ab('0x55')]['id']){delete _0x3018bf['body']['id'];}return db['SugarcrmConfiguration'][_0x89ab('0x56')]({'where':{'id':_0x3018bf[_0x89ab('0x53')]['id']}})[_0x89ab('0x1d')](handleEntityNotFound(_0x2dc255,null))[_0x89ab('0x1d')](saveUpdates(_0x3018bf[_0x89ab('0x55')],null))[_0x89ab('0x1d')](respondWithResult(_0x2dc255,null))[_0x89ab('0x51')](handleError(_0x2dc255,null));};exports[_0x89ab('0x30')]=function(_0x4a56a5,_0x3b6331){return db['SugarcrmConfiguration'][_0x89ab('0x56')]({'where':{'id':_0x4a56a5[_0x89ab('0x53')]['id']}})['then'](handleEntityNotFound(_0x3b6331,null))[_0x89ab('0x1d')](removeEntity(_0x3b6331,null))[_0x89ab('0x51')](handleError(_0x3b6331,null));};exports['getFields']=function(_0x110ae3,_0x3cde6a,_0x40b0d9){var _0x5db4ae={};var _0x55ac2b={};var _0x21971f;var _0x327d80;return db[_0x89ab('0x38')][_0x89ab('0x57')]({'where':{'id':_0x110ae3[_0x89ab('0x53')]['id']}})[_0x89ab('0x1d')](handleEntityNotFound(_0x3cde6a,null))[_0x89ab('0x1d')](function(_0x317d8a){if(_0x317d8a){_0x21971f=_0x317d8a;_0x55ac2b[_0x89ab('0x3c')]=_['keys'](db['SugarcrmField'][_0x89ab('0x39')]);_0x55ac2b[_0x89ab('0x3d')]=_[_0x89ab('0x3e')](_0x110ae3['query']);_0x55ac2b['filters']=_['intersection'](_0x55ac2b[_0x89ab('0x3c')],_0x55ac2b[_0x89ab('0x3d')]);_0x5db4ae[_0x89ab('0x40')]=_[_0x89ab('0x41')](_0x55ac2b['model'],qs['fields'](_0x110ae3[_0x89ab('0x3d')][_0x89ab('0x42')]));_0x5db4ae[_0x89ab('0x40')]=_0x5db4ae[_0x89ab('0x40')][_0x89ab('0x43')]?_0x5db4ae['attributes']:_0x55ac2b[_0x89ab('0x3c')];_0x5db4ae[_0x89ab('0x45')]=qs[_0x89ab('0x46')](_0x110ae3[_0x89ab('0x3d')]['sort']);_0x5db4ae['where']=qs[_0x89ab('0x3f')](_[_0x89ab('0x48')](_0x110ae3[_0x89ab('0x3d')],_0x55ac2b[_0x89ab('0x3f')]));if(_0x110ae3[_0x89ab('0x3d')][_0x89ab('0x4a')]){_0x5db4ae[_0x89ab('0x47')]=_[_0x89ab('0x49')](_0x5db4ae[_0x89ab('0x47')],{'$or':_[_0x89ab('0x37')](_0x5db4ae[_0x89ab('0x40')],function(_0x307956){var _0x3178f0={};_0x3178f0[_0x307956]={'$like':'%'+_0x110ae3['query']['filter']+'%'};return _0x3178f0;})});}_0x5db4ae=_[_0x89ab('0x49')]({},_0x5db4ae,_0x110ae3[_0x89ab('0x4b')]);return _0x21971f['getFields'](_0x5db4ae);}})[_0x89ab('0x1d')](function(_0x20921b){if(_0x20921b){_0x327d80=_0x20921b['length'];if(!_0x110ae3['query'][_0x89ab('0x44')]('nolimit')){_0x5db4ae[_0x89ab('0x28')]=qs[_0x89ab('0x28')](_0x110ae3[_0x89ab('0x3d')][_0x89ab('0x28')]);_0x5db4ae[_0x89ab('0x27')]=qs[_0x89ab('0x27')](_0x110ae3[_0x89ab('0x3d')]['offset']);}return _0x21971f[_0x89ab('0x58')](_0x5db4ae);}})[_0x89ab('0x1d')](function(_0x2f36c9){if(_0x2f36c9){return _0x2f36c9?{'count':_0x327d80,'rows':_0x2f36c9}:null;}})['then'](respondWithResult(_0x3cde6a,null))[_0x89ab('0x51')](handleError(_0x3cde6a,null));};exports[_0x89ab('0x59')]=function(_0x5d2e5e,_0x35f4d2,_0x557205){var _0x11bebd={};var _0x56c9ce={};var _0x127669;var _0x15c64c;return db['SugarcrmConfiguration'][_0x89ab('0x57')]({'where':{'id':_0x5d2e5e[_0x89ab('0x53')]['id']}})['then'](handleEntityNotFound(_0x35f4d2,null))[_0x89ab('0x1d')](function(_0x2fb95f){if(_0x2fb95f){_0x127669=_0x2fb95f;_0x56c9ce[_0x89ab('0x3c')]=_[_0x89ab('0x3e')](db['SugarcrmField'][_0x89ab('0x39')]);_0x56c9ce[_0x89ab('0x3d')]=_[_0x89ab('0x3e')](_0x5d2e5e[_0x89ab('0x3d')]);_0x56c9ce[_0x89ab('0x3f')]=_['intersection'](_0x56c9ce[_0x89ab('0x3c')],_0x56c9ce[_0x89ab('0x3d')]);_0x11bebd[_0x89ab('0x40')]=_[_0x89ab('0x41')](_0x56c9ce[_0x89ab('0x3c')],qs['fields'](_0x5d2e5e['query'][_0x89ab('0x42')]));_0x11bebd[_0x89ab('0x40')]=_0x11bebd[_0x89ab('0x40')][_0x89ab('0x43')]?_0x11bebd[_0x89ab('0x40')]:_0x56c9ce[_0x89ab('0x3c')];_0x11bebd[_0x89ab('0x45')]=qs['sort'](_0x5d2e5e[_0x89ab('0x3d')][_0x89ab('0x46')]);_0x11bebd['where']=qs[_0x89ab('0x3f')](_['pick'](_0x5d2e5e[_0x89ab('0x3d')],_0x56c9ce['filters']));if(_0x5d2e5e[_0x89ab('0x3d')]['filter']){_0x11bebd[_0x89ab('0x47')]=_['merge'](_0x11bebd[_0x89ab('0x47')],{'$or':_[_0x89ab('0x37')](_0x11bebd[_0x89ab('0x40')],function(_0x25764e){var _0x390b30={};_0x390b30[_0x25764e]={'$like':'%'+_0x5d2e5e['query'][_0x89ab('0x4a')]+'%'};return _0x390b30;})});}_0x11bebd=_[_0x89ab('0x49')]({},_0x11bebd,_0x5d2e5e[_0x89ab('0x4b')]);return _0x127669[_0x89ab('0x59')](_0x11bebd);}})['then'](function(_0x50988d){if(_0x50988d){_0x15c64c=_0x50988d[_0x89ab('0x43')];if(!_0x5d2e5e['query'][_0x89ab('0x44')](_0x89ab('0x5a'))){_0x11bebd[_0x89ab('0x28')]=qs[_0x89ab('0x28')](_0x5d2e5e[_0x89ab('0x3d')][_0x89ab('0x28')]);_0x11bebd[_0x89ab('0x27')]=qs[_0x89ab('0x27')](_0x5d2e5e['query'][_0x89ab('0x27')]);}return _0x127669['getSubjects'](_0x11bebd);}})[_0x89ab('0x1d')](function(_0xae38f1){if(_0xae38f1){return _0xae38f1?{'count':_0x15c64c,'rows':_0xae38f1}:null;}})[_0x89ab('0x1d')](respondWithResult(_0x35f4d2,null))['catch'](handleError(_0x35f4d2,null));};exports[_0x89ab('0x5b')]=function(_0x510072,_0x23066d,_0x44b267){var _0x5645cd={};var _0x9926b5={};var _0x1bc0da;var _0x46aabf;return db['SugarcrmConfiguration'][_0x89ab('0x57')]({'where':{'id':_0x510072[_0x89ab('0x53')]['id']}})[_0x89ab('0x1d')](handleEntityNotFound(_0x23066d,null))['then'](function(_0x33d180){if(_0x33d180){_0x1bc0da=_0x33d180;_0x9926b5[_0x89ab('0x3c')]=_[_0x89ab('0x3e')](db[_0x89ab('0x5c')][_0x89ab('0x39')]);_0x9926b5[_0x89ab('0x3d')]=_[_0x89ab('0x3e')](_0x510072[_0x89ab('0x3d')]);_0x9926b5[_0x89ab('0x3f')]=_['intersection'](_0x9926b5[_0x89ab('0x3c')],_0x9926b5['query']);_0x5645cd['attributes']=_[_0x89ab('0x41')](_0x9926b5[_0x89ab('0x3c')],qs['fields'](_0x510072['query']['fields']));_0x5645cd['attributes']=_0x5645cd[_0x89ab('0x40')][_0x89ab('0x43')]?_0x5645cd[_0x89ab('0x40')]:_0x9926b5[_0x89ab('0x3c')];_0x5645cd[_0x89ab('0x45')]=qs[_0x89ab('0x46')](_0x510072['query']['sort']);_0x5645cd[_0x89ab('0x47')]=qs['filters'](_[_0x89ab('0x48')](_0x510072[_0x89ab('0x3d')],_0x9926b5['filters']));if(_0x510072[_0x89ab('0x3d')]['filter']){_0x5645cd['where']=_[_0x89ab('0x49')](_0x5645cd[_0x89ab('0x47')],{'$or':_[_0x89ab('0x37')](_0x5645cd[_0x89ab('0x40')],function(_0x24990d){var _0x374b2c={};_0x374b2c[_0x24990d]={'$like':'%'+_0x510072['query'][_0x89ab('0x4a')]+'%'};return _0x374b2c;})});}_0x5645cd=_[_0x89ab('0x49')]({},_0x5645cd,_0x510072['options']);return _0x1bc0da[_0x89ab('0x5b')](_0x5645cd);}})[_0x89ab('0x1d')](function(_0xf972a2){if(_0xf972a2){_0x46aabf=_0xf972a2[_0x89ab('0x43')];if(!_0x510072[_0x89ab('0x3d')][_0x89ab('0x44')](_0x89ab('0x5a'))){_0x5645cd[_0x89ab('0x28')]=qs[_0x89ab('0x28')](_0x510072[_0x89ab('0x3d')]['limit']);_0x5645cd[_0x89ab('0x27')]=qs[_0x89ab('0x27')](_0x510072[_0x89ab('0x3d')][_0x89ab('0x27')]);}return _0x1bc0da['getDescriptions'](_0x5645cd);}})[_0x89ab('0x1d')](function(_0x37d712){if(_0x37d712){return _0x37d712?{'count':_0x46aabf,'rows':_0x37d712}:null;}})[_0x89ab('0x1d')](respondWithResult(_0x23066d,null))[_0x89ab('0x51')](handleError(_0x23066d,null));};
\ No newline at end of file
+var _0x113d=['filters','intersection','attributes','fields','length','hasOwnProperty','order','sort','where','pick','filter','merge','VIRTUAL','options','then','count','includeAll','findAll','rows','show','params','keys','include','create','body','find','destroy','getFields','findOne','SugarcrmField','nolimit','getSubjects','rawAttributes','getDescriptions','html-pdf','eml-format','fast-json-patch','bluebird','util','path','sox','lodash','crypto','desk.js','to-csv','querystring','ioredis','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','../../config/utils','../../config/environment','../../mysqldb','jayson/promise','client','http','test','Sequelize','ValidationError','request','info','request\x20sent','debug','SugarcrmConfiguration,\x20%s,\x20%s,\x20%s','stringify','error','code','message','SugarcrmConfiguration,\x20%s,\x20%s','catch','sendStatus','status','end','json','offset','limit','set','Content-Range','apply','reject','save','update','stack','name','send','index','SugarcrmConfiguration','fieldName','key','model','map','query'];(function(_0x3dd15e,_0x1f0015){var _0x231fd0=function(_0x4f680a){while(--_0x4f680a){_0x3dd15e['push'](_0x3dd15e['shift']());}};_0x231fd0(++_0x1f0015);}(_0x113d,0x139));var _0xd113=function(_0x176c7c,_0x575659){_0x176c7c=_0x176c7c-0x0;var _0x401587=_0x113d[_0x176c7c];return _0x401587;};'use strict';var pdf=require(_0xd113('0x0'));var emlformat=require(_0xd113('0x1'));var rimraf=require('rimraf');var zipdir=require('zip-dir');var jsonpatch=require(_0xd113('0x2'));var rp=require('request-promise');var moment=require('moment');var BPromise=require(_0xd113('0x3'));var Mustache=require('mustache');var util=require(_0xd113('0x4'));var path=require(_0xd113('0x5'));var sox=require(_0xd113('0x6'));var csv=require('to-csv');var ejs=require('ejs');var fs=require('fs');var _=require(_0xd113('0x7'));var squel=require('squel');var crypto=require(_0xd113('0x8'));var jsforce=require('jsforce');var deskjs=require(_0xd113('0x9'));var toCsv=require(_0xd113('0xa'));var querystring=require(_0xd113('0xb'));var Papa=require('papaparse');var Redis=require(_0xd113('0xc'));var authService=require('../../components/auth/service');var qs=require(_0xd113('0xd'));var as=require(_0xd113('0xe'));var hardwareService=require(_0xd113('0xf'));var logger=require(_0xd113('0x10'))('api');var utils=require(_0xd113('0x11'));var config=require(_0xd113('0x12'));var db=require(_0xd113('0x13'))['db'];var jayson=require(_0xd113('0x14'));var client=jayson[_0xd113('0x15')][_0xd113('0x16')]({'port':0x232a});function checkPasswordPattern(_0x32934f,_0x2f361f,_0x4514e4){if(_0x4514e4){var _0x208cfc=new RegExp(/(?=.*[a-z])(?=.*[A-Z])(?=.*[0-9])(?=.*[?!@#\$%\^&\*~\-_=+[{\]\}])(?=.{8,})/);if(_0x208cfc[_0xd113('0x17')](_0x2f361f)){return _0x32934f;}else{throw new db[(_0xd113('0x18'))][(_0xd113('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 _0x32934f;}}function respondWithRpcPromise(_0x52bb45,_0x15aa5f,_0x1ee360,_0x245fcc){return new BPromise(function(_0x3ba25b,_0x292c49){var _0x43da8f=_0x245fcc||client;return _0x43da8f[_0xd113('0x1a')](_0x52bb45,_0x1ee360)['then'](function(_0x4aaef2){logger[_0xd113('0x1b')]('SugarcrmConfiguration,\x20%s,\x20%s',_0x15aa5f,_0xd113('0x1c'));logger[_0xd113('0x1d')](_0xd113('0x1e'),_0x15aa5f,'request\x20sent',JSON[_0xd113('0x1f')](_0x4aaef2));if(_0x4aaef2[_0xd113('0x20')]){if(_0x4aaef2[_0xd113('0x20')][_0xd113('0x21')]===0x1f4){logger[_0xd113('0x20')]('SugarcrmConfiguration,\x20%s,\x20%s',_0x15aa5f,_0x4aaef2[_0xd113('0x20')][_0xd113('0x22')]);return _0x292c49(_0x4aaef2[_0xd113('0x20')]['message']);}logger[_0xd113('0x20')](_0xd113('0x23'),_0x15aa5f,_0x4aaef2[_0xd113('0x20')][_0xd113('0x22')]);return _0x3ba25b(_0x4aaef2[_0xd113('0x20')][_0xd113('0x22')]);}else{logger[_0xd113('0x1b')](_0xd113('0x23'),_0x15aa5f,_0xd113('0x1c'));_0x3ba25b(_0x4aaef2['result']['message']);}})[_0xd113('0x24')](function(_0x4726a5){logger['error'](_0xd113('0x23'),_0x15aa5f,_0x4726a5);_0x292c49(_0x4726a5);});});}function respondWithStatusCode(_0x3cf128,_0x2fcc6a){_0x2fcc6a=_0x2fcc6a||0xcc;return function(_0x55dc60){if(_0x55dc60){return _0x3cf128[_0xd113('0x25')](_0x2fcc6a);}return _0x3cf128[_0xd113('0x26')](_0x2fcc6a)[_0xd113('0x27')]();};}function respondWithResult(_0x41c79e,_0x277147){_0x277147=_0x277147||0xc8;return function(_0xa4129b){if(_0xa4129b){return _0x41c79e[_0xd113('0x26')](_0x277147)[_0xd113('0x28')](_0xa4129b);}};}function respondWithFilteredResult(_0x3f3718,_0x2ff1fe){return function(_0x1f66b8){if(_0x1f66b8){var _0x8e525e=_0x1f66b8['count'],_0x87db5d=_0x2ff1fe[_0xd113('0x29')],_0xdc2802=_0x2ff1fe['offset']+_0x2ff1fe[_0xd113('0x2a')],_0xd0c75d;if(_0xdc2802>=_0x8e525e){_0xdc2802=_0x8e525e;_0xd0c75d=0xc8;}else{_0xd0c75d=0xce;}_0x3f3718[_0xd113('0x26')](_0xd0c75d);return _0x3f3718[_0xd113('0x2b')](_0xd113('0x2c'),_0x87db5d+'-'+_0xdc2802+'/'+_0x8e525e)[_0xd113('0x28')](_0x1f66b8);}return null;};}function patchUpdates(_0x6f7bff){return function(_0x3475f7){try{jsonpatch[_0xd113('0x2d')](_0x3475f7,_0x6f7bff,!![]);}catch(_0x2fd203){return BPromise[_0xd113('0x2e')](_0x2fd203);}return _0x3475f7[_0xd113('0x2f')]();};}function saveUpdates(_0x86eb57,_0x429371){return function(_0x23c46a){if(_0x23c46a){return _0x23c46a[_0xd113('0x30')](_0x86eb57)['then'](function(_0x5a32c9){return _0x5a32c9;});}return null;};}function removeEntity(_0x5c7a7e,_0x1c0dd8){return function(_0x1bc839){if(_0x1bc839){return _0x1bc839['destroy']()['then'](function(){_0x5c7a7e[_0xd113('0x26')](0xcc)[_0xd113('0x27')]();});}};}function handleEntityNotFound(_0x58b5aa,_0x56f6af){return function(_0x38b4c1){if(!_0x38b4c1){_0x58b5aa['sendStatus'](0x194);}return _0x38b4c1;};}function handleError(_0x56679e,_0x59e094){_0x59e094=_0x59e094||0x1f4;return function(_0x235fb5){logger[_0xd113('0x20')](_0x235fb5[_0xd113('0x31')]);if(_0x235fb5[_0xd113('0x32')]){delete _0x235fb5[_0xd113('0x32')];}_0x56679e[_0xd113('0x26')](_0x59e094)[_0xd113('0x33')](_0x235fb5);};}exports[_0xd113('0x34')]=function(_0x47e13c,_0x1e62cc){var _0x304204={},_0x302d2d={},_0x1f9a4b={'count':0x0,'rows':[]};var _0x361b0d=_['map'](db[_0xd113('0x35')]['rawAttributes'],function(_0x4f2478){return{'name':_0x4f2478[_0xd113('0x36')],'type':_0x4f2478['type'][_0xd113('0x37')]};});_0x302d2d[_0xd113('0x38')]=_[_0xd113('0x39')](_0x361b0d,_0xd113('0x32'));_0x302d2d[_0xd113('0x3a')]=_['keys'](_0x47e13c[_0xd113('0x3a')]);_0x302d2d[_0xd113('0x3b')]=_[_0xd113('0x3c')](_0x302d2d[_0xd113('0x38')],_0x302d2d['query']);_0x304204[_0xd113('0x3d')]=_['intersection'](_0x302d2d[_0xd113('0x38')],qs[_0xd113('0x3e')](_0x47e13c[_0xd113('0x3a')][_0xd113('0x3e')]));_0x304204[_0xd113('0x3d')]=_0x304204[_0xd113('0x3d')][_0xd113('0x3f')]?_0x304204['attributes']:_0x302d2d[_0xd113('0x38')];if(!_0x47e13c[_0xd113('0x3a')][_0xd113('0x40')]('nolimit')){_0x304204[_0xd113('0x2a')]=qs[_0xd113('0x2a')](_0x47e13c[_0xd113('0x3a')][_0xd113('0x2a')]);_0x304204['offset']=qs[_0xd113('0x29')](_0x47e13c['query']['offset']);}_0x304204[_0xd113('0x41')]=qs[_0xd113('0x42')](_0x47e13c[_0xd113('0x3a')]['sort']);_0x304204[_0xd113('0x43')]=qs[_0xd113('0x3b')](_[_0xd113('0x44')](_0x47e13c[_0xd113('0x3a')],_0x302d2d['filters']));if(_0x47e13c['query'][_0xd113('0x45')]){_0x304204['where']=_[_0xd113('0x46')](_0x304204[_0xd113('0x43')],{'$or':_['map'](_0x361b0d,function(_0x4e944f){if(_0x4e944f['type']!==_0xd113('0x47')){var _0x37e825={};_0x37e825[_0x4e944f[_0xd113('0x32')]]={'$like':'%'+_0x47e13c[_0xd113('0x3a')][_0xd113('0x45')]+'%'};return _0x37e825;}})});}_0x304204=_[_0xd113('0x46')]({},_0x304204,_0x47e13c[_0xd113('0x48')]);var _0x141097={'where':_0x304204[_0xd113('0x43')]};return db[_0xd113('0x35')]['count'](_0x141097)[_0xd113('0x49')](function(_0x379250){_0x1f9a4b[_0xd113('0x4a')]=_0x379250;if(_0x47e13c[_0xd113('0x3a')][_0xd113('0x4b')]){_0x304204['include']=[{'all':!![]}];}return db['SugarcrmConfiguration'][_0xd113('0x4c')](_0x304204);})[_0xd113('0x49')](function(_0xc27540){_0x1f9a4b[_0xd113('0x4d')]=_0xc27540;return _0x1f9a4b;})[_0xd113('0x49')](respondWithFilteredResult(_0x1e62cc,_0x304204))[_0xd113('0x24')](handleError(_0x1e62cc,null));};exports[_0xd113('0x4e')]=function(_0x274375,_0x425d76){var _0x408f7e={'raw':![],'where':{'id':_0x274375[_0xd113('0x4f')]['id']}},_0x34562b={};_0x34562b[_0xd113('0x38')]=_[_0xd113('0x50')](db[_0xd113('0x35')]['rawAttributes']);_0x34562b[_0xd113('0x3a')]=_[_0xd113('0x50')](_0x274375['query']);_0x34562b['filters']=_[_0xd113('0x3c')](_0x34562b[_0xd113('0x38')],_0x34562b[_0xd113('0x3a')]);_0x408f7e[_0xd113('0x3d')]=_[_0xd113('0x3c')](_0x34562b['model'],qs[_0xd113('0x3e')](_0x274375[_0xd113('0x3a')][_0xd113('0x3e')]));_0x408f7e[_0xd113('0x3d')]=_0x408f7e[_0xd113('0x3d')][_0xd113('0x3f')]?_0x408f7e[_0xd113('0x3d')]:_0x34562b[_0xd113('0x38')];if(_0x274375[_0xd113('0x3a')]['includeAll']){_0x408f7e[_0xd113('0x51')]=[{'all':!![]}];}_0x408f7e=_[_0xd113('0x46')]({},_0x408f7e,_0x274375[_0xd113('0x48')]);return db[_0xd113('0x35')]['find'](_0x408f7e)[_0xd113('0x49')](handleEntityNotFound(_0x425d76,null))[_0xd113('0x49')](respondWithResult(_0x425d76,null))[_0xd113('0x24')](handleError(_0x425d76,null));};exports[_0xd113('0x52')]=function(_0x105fcc,_0x38d8b6){return db['SugarcrmConfiguration'][_0xd113('0x52')](_0x105fcc['body'],{})[_0xd113('0x49')](respondWithResult(_0x38d8b6,0xc9))['catch'](handleError(_0x38d8b6,null));};exports[_0xd113('0x30')]=function(_0x575dfc,_0x293c19){if(_0x575dfc[_0xd113('0x53')]['id']){delete _0x575dfc['body']['id'];}return db['SugarcrmConfiguration'][_0xd113('0x54')]({'where':{'id':_0x575dfc[_0xd113('0x4f')]['id']}})[_0xd113('0x49')](handleEntityNotFound(_0x293c19,null))[_0xd113('0x49')](saveUpdates(_0x575dfc['body'],null))[_0xd113('0x49')](respondWithResult(_0x293c19,null))[_0xd113('0x24')](handleError(_0x293c19,null));};exports[_0xd113('0x55')]=function(_0x3fbfd1,_0x37e110){return db[_0xd113('0x35')]['find']({'where':{'id':_0x3fbfd1[_0xd113('0x4f')]['id']}})[_0xd113('0x49')](handleEntityNotFound(_0x37e110,null))[_0xd113('0x49')](removeEntity(_0x37e110,null))[_0xd113('0x24')](handleError(_0x37e110,null));};exports[_0xd113('0x56')]=function(_0x562d53,_0x253785,_0x113216){var _0x5cfed9={};var _0x55441e={};var _0x52a447;var _0x366583;return db['SugarcrmConfiguration'][_0xd113('0x57')]({'where':{'id':_0x562d53['params']['id']}})[_0xd113('0x49')](handleEntityNotFound(_0x253785,null))[_0xd113('0x49')](function(_0x17801a){if(_0x17801a){_0x52a447=_0x17801a;_0x55441e[_0xd113('0x38')]=_[_0xd113('0x50')](db[_0xd113('0x58')]['rawAttributes']);_0x55441e[_0xd113('0x3a')]=_[_0xd113('0x50')](_0x562d53[_0xd113('0x3a')]);_0x55441e[_0xd113('0x3b')]=_[_0xd113('0x3c')](_0x55441e[_0xd113('0x38')],_0x55441e[_0xd113('0x3a')]);_0x5cfed9[_0xd113('0x3d')]=_['intersection'](_0x55441e['model'],qs[_0xd113('0x3e')](_0x562d53['query']['fields']));_0x5cfed9['attributes']=_0x5cfed9['attributes'][_0xd113('0x3f')]?_0x5cfed9[_0xd113('0x3d')]:_0x55441e[_0xd113('0x38')];_0x5cfed9[_0xd113('0x41')]=qs[_0xd113('0x42')](_0x562d53[_0xd113('0x3a')][_0xd113('0x42')]);_0x5cfed9[_0xd113('0x43')]=qs[_0xd113('0x3b')](_['pick'](_0x562d53[_0xd113('0x3a')],_0x55441e[_0xd113('0x3b')]));if(_0x562d53[_0xd113('0x3a')]['filter']){_0x5cfed9['where']=_['merge'](_0x5cfed9[_0xd113('0x43')],{'$or':_[_0xd113('0x39')](_0x5cfed9[_0xd113('0x3d')],function(_0x585884){var _0x33c718={};_0x33c718[_0x585884]={'$like':'%'+_0x562d53[_0xd113('0x3a')][_0xd113('0x45')]+'%'};return _0x33c718;})});}_0x5cfed9=_['merge']({},_0x5cfed9,_0x562d53['options']);return _0x52a447['getFields'](_0x5cfed9);}})[_0xd113('0x49')](function(_0x4bf95f){if(_0x4bf95f){_0x366583=_0x4bf95f[_0xd113('0x3f')];if(!_0x562d53[_0xd113('0x3a')][_0xd113('0x40')](_0xd113('0x59'))){_0x5cfed9[_0xd113('0x2a')]=qs[_0xd113('0x2a')](_0x562d53[_0xd113('0x3a')][_0xd113('0x2a')]);_0x5cfed9[_0xd113('0x29')]=qs[_0xd113('0x29')](_0x562d53[_0xd113('0x3a')][_0xd113('0x29')]);}return _0x52a447['getFields'](_0x5cfed9);}})[_0xd113('0x49')](function(_0x4e9d0d){if(_0x4e9d0d){return _0x4e9d0d?{'count':_0x366583,'rows':_0x4e9d0d}:null;}})[_0xd113('0x49')](respondWithResult(_0x253785,null))[_0xd113('0x24')](handleError(_0x253785,null));};exports[_0xd113('0x5a')]=function(_0x146bb0,_0x47972c,_0x2dea55){var _0x34885e={};var _0x5824ab={};var _0x5bb7a1;var _0x10886f;return db[_0xd113('0x35')][_0xd113('0x57')]({'where':{'id':_0x146bb0[_0xd113('0x4f')]['id']}})['then'](handleEntityNotFound(_0x47972c,null))[_0xd113('0x49')](function(_0x294cb7){if(_0x294cb7){_0x5bb7a1=_0x294cb7;_0x5824ab[_0xd113('0x38')]=_['keys'](db[_0xd113('0x58')][_0xd113('0x5b')]);_0x5824ab[_0xd113('0x3a')]=_['keys'](_0x146bb0['query']);_0x5824ab[_0xd113('0x3b')]=_[_0xd113('0x3c')](_0x5824ab[_0xd113('0x38')],_0x5824ab[_0xd113('0x3a')]);_0x34885e[_0xd113('0x3d')]=_['intersection'](_0x5824ab[_0xd113('0x38')],qs['fields'](_0x146bb0['query']['fields']));_0x34885e[_0xd113('0x3d')]=_0x34885e['attributes']['length']?_0x34885e['attributes']:_0x5824ab[_0xd113('0x38')];_0x34885e[_0xd113('0x41')]=qs[_0xd113('0x42')](_0x146bb0['query']['sort']);_0x34885e[_0xd113('0x43')]=qs[_0xd113('0x3b')](_[_0xd113('0x44')](_0x146bb0[_0xd113('0x3a')],_0x5824ab[_0xd113('0x3b')]));if(_0x146bb0['query']['filter']){_0x34885e[_0xd113('0x43')]=_[_0xd113('0x46')](_0x34885e[_0xd113('0x43')],{'$or':_[_0xd113('0x39')](_0x34885e[_0xd113('0x3d')],function(_0x3878c7){var _0x28904d={};_0x28904d[_0x3878c7]={'$like':'%'+_0x146bb0[_0xd113('0x3a')][_0xd113('0x45')]+'%'};return _0x28904d;})});}_0x34885e=_['merge']({},_0x34885e,_0x146bb0['options']);return _0x5bb7a1[_0xd113('0x5a')](_0x34885e);}})[_0xd113('0x49')](function(_0x404eb7){if(_0x404eb7){_0x10886f=_0x404eb7[_0xd113('0x3f')];if(!_0x146bb0[_0xd113('0x3a')][_0xd113('0x40')](_0xd113('0x59'))){_0x34885e[_0xd113('0x2a')]=qs[_0xd113('0x2a')](_0x146bb0[_0xd113('0x3a')]['limit']);_0x34885e[_0xd113('0x29')]=qs[_0xd113('0x29')](_0x146bb0[_0xd113('0x3a')]['offset']);}return _0x5bb7a1['getSubjects'](_0x34885e);}})['then'](function(_0x135ec0){if(_0x135ec0){return _0x135ec0?{'count':_0x10886f,'rows':_0x135ec0}:null;}})['then'](respondWithResult(_0x47972c,null))['catch'](handleError(_0x47972c,null));};exports[_0xd113('0x5c')]=function(_0x3a345f,_0x752488,_0x131c80){var _0x28f82a={};var _0x2f86dd={};var _0x2cd5ca;var _0x41695d;return db[_0xd113('0x35')][_0xd113('0x57')]({'where':{'id':_0x3a345f[_0xd113('0x4f')]['id']}})[_0xd113('0x49')](handleEntityNotFound(_0x752488,null))[_0xd113('0x49')](function(_0x4e9c0d){if(_0x4e9c0d){_0x2cd5ca=_0x4e9c0d;_0x2f86dd[_0xd113('0x38')]=_[_0xd113('0x50')](db[_0xd113('0x58')][_0xd113('0x5b')]);_0x2f86dd[_0xd113('0x3a')]=_[_0xd113('0x50')](_0x3a345f[_0xd113('0x3a')]);_0x2f86dd['filters']=_[_0xd113('0x3c')](_0x2f86dd['model'],_0x2f86dd[_0xd113('0x3a')]);_0x28f82a[_0xd113('0x3d')]=_[_0xd113('0x3c')](_0x2f86dd[_0xd113('0x38')],qs[_0xd113('0x3e')](_0x3a345f[_0xd113('0x3a')][_0xd113('0x3e')]));_0x28f82a[_0xd113('0x3d')]=_0x28f82a['attributes']['length']?_0x28f82a['attributes']:_0x2f86dd[_0xd113('0x38')];_0x28f82a[_0xd113('0x41')]=qs[_0xd113('0x42')](_0x3a345f[_0xd113('0x3a')]['sort']);_0x28f82a[_0xd113('0x43')]=qs[_0xd113('0x3b')](_['pick'](_0x3a345f[_0xd113('0x3a')],_0x2f86dd[_0xd113('0x3b')]));if(_0x3a345f['query'][_0xd113('0x45')]){_0x28f82a['where']=_['merge'](_0x28f82a[_0xd113('0x43')],{'$or':_[_0xd113('0x39')](_0x28f82a[_0xd113('0x3d')],function(_0x4a45f3){var _0x2e761a={};_0x2e761a[_0x4a45f3]={'$like':'%'+_0x3a345f[_0xd113('0x3a')][_0xd113('0x45')]+'%'};return _0x2e761a;})});}_0x28f82a=_[_0xd113('0x46')]({},_0x28f82a,_0x3a345f[_0xd113('0x48')]);return _0x2cd5ca['getDescriptions'](_0x28f82a);}})[_0xd113('0x49')](function(_0x450f1e){if(_0x450f1e){_0x41695d=_0x450f1e[_0xd113('0x3f')];if(!_0x3a345f[_0xd113('0x3a')]['hasOwnProperty'](_0xd113('0x59'))){_0x28f82a[_0xd113('0x2a')]=qs['limit'](_0x3a345f['query'][_0xd113('0x2a')]);_0x28f82a[_0xd113('0x29')]=qs[_0xd113('0x29')](_0x3a345f[_0xd113('0x3a')][_0xd113('0x29')]);}return _0x2cd5ca[_0xd113('0x5c')](_0x28f82a);}})[_0xd113('0x49')](function(_0x3a9551){if(_0x3a9551){return _0x3a9551?{'count':_0x41695d,'rows':_0x3a9551}:null;}})['then'](respondWithResult(_0x752488,null))[_0xd113('0x24')](handleError(_0x752488,null));};
\ No newline at end of file
diff --git a/server/api/intSugarcrmConfiguration/intSugarcrmConfiguration.model.js b/server/api/intSugarcrmConfiguration/intSugarcrmConfiguration.model.js
index 605a192..2f3eb10 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 _0x1e59=['./intSugarcrmConfiguration.attributes','exports','SugarcrmConfiguration','int_sugarcrm_configurations','util','../../config/logger','api','moment','bluebird','path','rimraf'];(function(_0x544099,_0x372b30){var _0x20ab09=function(_0x149613){while(--_0x149613){_0x544099['push'](_0x544099['shift']());}};_0x20ab09(++_0x372b30);}(_0x1e59,0x159));var _0x91e5=function(_0x52afbd,_0x41e891){_0x52afbd=_0x52afbd-0x0;var _0x4c41bb=_0x1e59[_0x52afbd];return _0x4c41bb;};'use strict';var _=require('lodash');var util=require(_0x91e5('0x0'));var logger=require(_0x91e5('0x1'))(_0x91e5('0x2'));var moment=require(_0x91e5('0x3'));var BPromise=require(_0x91e5('0x4'));var rp=require('request-promise');var fs=require('fs');var path=require(_0x91e5('0x5'));var rimraf=require(_0x91e5('0x6'));var config=require('../../config/environment');var attributes=require(_0x91e5('0x7'));module[_0x91e5('0x8')]=function(_0x584e7b,_0x172726){return _0x584e7b['define'](_0x91e5('0x9'),attributes,{'tableName':_0x91e5('0xa'),'paranoid':![],'indexes':[],'timestamps':!![]});};
\ No newline at end of file
+var _0xd270=['../../config/environment','./intSugarcrmConfiguration.attributes','exports','define','SugarcrmConfiguration','int_sugarcrm_configurations','lodash','util','../../config/logger','api','moment','request-promise','path','rimraf'];(function(_0xd62041,_0x6fdb24){var _0x4483fa=function(_0x354d2d){while(--_0x354d2d){_0xd62041['push'](_0xd62041['shift']());}};_0x4483fa(++_0x6fdb24);}(_0xd270,0x156));var _0x0d27=function(_0x40396c,_0x19cd07){_0x40396c=_0x40396c-0x0;var _0x587fa6=_0xd270[_0x40396c];return _0x587fa6;};'use strict';var _=require(_0x0d27('0x0'));var util=require(_0x0d27('0x1'));var logger=require(_0x0d27('0x2'))(_0x0d27('0x3'));var moment=require(_0x0d27('0x4'));var BPromise=require('bluebird');var rp=require(_0x0d27('0x5'));var fs=require('fs');var path=require(_0x0d27('0x6'));var rimraf=require(_0x0d27('0x7'));var config=require(_0x0d27('0x8'));var attributes=require(_0x0d27('0x9'));module[_0x0d27('0xa')]=function(_0x40a7df,_0x3e0920){return _0x40a7df[_0x0d27('0xb')](_0x0d27('0xc'),attributes,{'tableName':_0x0d27('0xd'),'paranoid':![],'indexes':[],'timestamps':!![]});};
\ No newline at end of file
diff --git a/server/api/intSugarcrmConfiguration/intSugarcrmConfiguration.rpc.js b/server/api/intSugarcrmConfiguration/intSugarcrmConfiguration.rpc.js
index 119d26a..dd7bb3d 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 _0x6967=['client','http','request','info','debug','SugarcrmConfiguration,\x20%s,\x20%s,\x20%s','stringify','error','code','SugarcrmConfiguration,\x20%s,\x20%s','message','result','lodash','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','rpc','../../config/environment','jayson/promise'];(function(_0x26097e,_0x268ecb){var _0x49590f=function(_0x4ce526){while(--_0x4ce526){_0x26097e['push'](_0x26097e['shift']());}};_0x49590f(++_0x268ecb);}(_0x6967,0x198));var _0x7696=function(_0x248f2b,_0x46d97e){_0x248f2b=_0x248f2b-0x0;var _0x4904e0=_0x6967[_0x248f2b];return _0x4904e0;};'use strict';var _=require(_0x7696('0x0'));var util=require('util');var moment=require(_0x7696('0x1'));var BPromise=require(_0x7696('0x2'));var rs=require(_0x7696('0x3'));var fs=require('fs');var Redis=require(_0x7696('0x4'));var db=require(_0x7696('0x5'))['db'];var utils=require(_0x7696('0x6'));var logger=require('../../config/logger')(_0x7696('0x7'));var config=require(_0x7696('0x8'));var jayson=require(_0x7696('0x9'));var client=jayson[_0x7696('0xa')][_0x7696('0xb')]({'port':0x232a});function respondWithRpcPromise(_0x3b008a,_0x413419,_0x23e936){return new BPromise(function(_0x4002fa,_0x93f356){return client[_0x7696('0xc')](_0x3b008a,_0x23e936)['then'](function(_0x3f1327){logger[_0x7696('0xd')]('SugarcrmConfiguration,\x20%s,\x20%s',_0x413419,'request\x20sent');logger[_0x7696('0xe')](_0x7696('0xf'),_0x413419,'request\x20sent',JSON[_0x7696('0x10')](_0x3f1327));if(_0x3f1327[_0x7696('0x11')]){if(_0x3f1327['error'][_0x7696('0x12')]===0x1f4){logger[_0x7696('0x11')](_0x7696('0x13'),_0x413419,_0x3f1327['error']['message']);return _0x93f356(_0x3f1327[_0x7696('0x11')][_0x7696('0x14')]);}logger[_0x7696('0x11')](_0x7696('0x13'),_0x413419,_0x3f1327[_0x7696('0x11')][_0x7696('0x14')]);return _0x4002fa(_0x3f1327[_0x7696('0x11')]['message']);}else{logger[_0x7696('0xd')](_0x7696('0x13'),_0x413419,'request\x20sent');_0x4002fa(_0x3f1327[_0x7696('0x15')][_0x7696('0x14')]);}})['catch'](function(_0x45a106){logger['error'](_0x7696('0x13'),_0x413419,_0x45a106);_0x93f356(_0x45a106);});});}
\ No newline at end of file
+var _0x9f66=['rpc','client','http','request','then','info','request\x20sent','debug','SugarcrmConfiguration,\x20%s,\x20%s,\x20%s','stringify','error','SugarcrmConfiguration,\x20%s,\x20%s','message','result','catch','lodash','util','moment','bluebird','randomstring','ioredis','../../config/utils','../../config/logger'];(function(_0x3215b8,_0x271e86){var _0x400428=function(_0x2cec07){while(--_0x2cec07){_0x3215b8['push'](_0x3215b8['shift']());}};_0x400428(++_0x271e86);}(_0x9f66,0x196));var _0x69f6=function(_0x4f00ef,_0x56541c){_0x4f00ef=_0x4f00ef-0x0;var _0x3a8766=_0x9f66[_0x4f00ef];return _0x3a8766;};'use strict';var _=require(_0x69f6('0x0'));var util=require(_0x69f6('0x1'));var moment=require(_0x69f6('0x2'));var BPromise=require(_0x69f6('0x3'));var rs=require(_0x69f6('0x4'));var fs=require('fs');var Redis=require(_0x69f6('0x5'));var db=require('../../mysqldb')['db'];var utils=require(_0x69f6('0x6'));var logger=require(_0x69f6('0x7'))(_0x69f6('0x8'));var config=require('../../config/environment');var jayson=require('jayson/promise');var client=jayson[_0x69f6('0x9')][_0x69f6('0xa')]({'port':0x232a});function respondWithRpcPromise(_0x8f13a0,_0x1ea689,_0x50b9db){return new BPromise(function(_0x3bb173,_0x53a3d5){return client[_0x69f6('0xb')](_0x8f13a0,_0x50b9db)[_0x69f6('0xc')](function(_0x33d504){logger[_0x69f6('0xd')]('SugarcrmConfiguration,\x20%s,\x20%s',_0x1ea689,_0x69f6('0xe'));logger[_0x69f6('0xf')](_0x69f6('0x10'),_0x1ea689,_0x69f6('0xe'),JSON[_0x69f6('0x11')](_0x33d504));if(_0x33d504[_0x69f6('0x12')]){if(_0x33d504[_0x69f6('0x12')]['code']===0x1f4){logger['error'](_0x69f6('0x13'),_0x1ea689,_0x33d504[_0x69f6('0x12')]['message']);return _0x53a3d5(_0x33d504[_0x69f6('0x12')][_0x69f6('0x14')]);}logger[_0x69f6('0x12')](_0x69f6('0x13'),_0x1ea689,_0x33d504[_0x69f6('0x12')][_0x69f6('0x14')]);return _0x3bb173(_0x33d504['error'][_0x69f6('0x14')]);}else{logger[_0x69f6('0xd')](_0x69f6('0x13'),_0x1ea689,_0x69f6('0xe'));_0x3bb173(_0x33d504[_0x69f6('0x15')]['message']);}})[_0x69f6('0x16')](function(_0x184ed0){logger[_0x69f6('0x12')](_0x69f6('0x13'),_0x1ea689,_0x184ed0);_0x53a3d5(_0x184ed0);});});}
\ No newline at end of file
diff --git a/server/api/intSugarcrmField/index.js b/server/api/intSugarcrmField/index.js
index a131a7c..c6b6d9b 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 _0x6f6f=['post','create','put','update','delete','exports','multer','path','express','Router','../../components/auth/service','../../components/interaction/service','../../config/environment','./intSugarcrmField.controller','get','/:id','isAuthenticated','show'];(function(_0x4814d2,_0x22c926){var _0x2bb7c8=function(_0x179769){while(--_0x179769){_0x4814d2['push'](_0x4814d2['shift']());}};_0x2bb7c8(++_0x22c926);}(_0x6f6f,0x102));var _0xf6f6=function(_0x454fa7,_0x4e3a42){_0x454fa7=_0x454fa7-0x0;var _0x206cf6=_0x6f6f[_0x454fa7];return _0x206cf6;};'use strict';var multer=require(_0xf6f6('0x0'));var util=require('util');var path=require(_0xf6f6('0x1'));var timeout=require('connect-timeout');var express=require(_0xf6f6('0x2'));var router=express[_0xf6f6('0x3')]();var auth=require(_0xf6f6('0x4'));var interaction=require(_0xf6f6('0x5'));var config=require(_0xf6f6('0x6'));var controller=require(_0xf6f6('0x7'));router[_0xf6f6('0x8')]('/',auth['isAuthenticated'](),controller['index']);router[_0xf6f6('0x8')](_0xf6f6('0x9'),auth[_0xf6f6('0xa')](),controller[_0xf6f6('0xb')]);router[_0xf6f6('0xc')]('/',auth['isAuthenticated'](),controller[_0xf6f6('0xd')]);router[_0xf6f6('0xe')](_0xf6f6('0x9'),auth['isAuthenticated'](),controller[_0xf6f6('0xf')]);router[_0xf6f6('0x10')](_0xf6f6('0x9'),auth[_0xf6f6('0xa')](),controller['destroy']);module[_0xf6f6('0x11')]=router;
\ No newline at end of file
+var _0x38cc=['Router','../../components/auth/service','../../components/interaction/service','../../config/environment','./intSugarcrmField.controller','get','isAuthenticated','index','/:id','show','post','create','put','destroy','multer','path','connect-timeout','express'];(function(_0x308374,_0x550e85){var _0x1f71e0=function(_0x18377d){while(--_0x18377d){_0x308374['push'](_0x308374['shift']());}};_0x1f71e0(++_0x550e85);}(_0x38cc,0x19a));var _0xc38c=function(_0x321bb2,_0x202794){_0x321bb2=_0x321bb2-0x0;var _0x9c12ed=_0x38cc[_0x321bb2];return _0x9c12ed;};'use strict';var multer=require(_0xc38c('0x0'));var util=require('util');var path=require(_0xc38c('0x1'));var timeout=require(_0xc38c('0x2'));var express=require(_0xc38c('0x3'));var router=express[_0xc38c('0x4')]();var auth=require(_0xc38c('0x5'));var interaction=require(_0xc38c('0x6'));var config=require(_0xc38c('0x7'));var controller=require(_0xc38c('0x8'));router[_0xc38c('0x9')]('/',auth[_0xc38c('0xa')](),controller[_0xc38c('0xb')]);router[_0xc38c('0x9')](_0xc38c('0xc'),auth[_0xc38c('0xa')](),controller[_0xc38c('0xd')]);router[_0xc38c('0xe')]('/',auth['isAuthenticated'](),controller[_0xc38c('0xf')]);router[_0xc38c('0x10')]('/:id',auth[_0xc38c('0xa')](),controller['update']);router['delete']('/:id',auth['isAuthenticated'](),controller[_0xc38c('0x11')]);module['exports']=router;
\ No newline at end of file
diff --git a/server/api/intSugarcrmField/intSugarcrmField.attributes.js b/server/api/intSugarcrmField/intSugarcrmField.attributes.js
index d172b10..4a5cd07 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 _0x6c32=['keyValue','string','customVariable','STRING','BOOLEAN','sequelize','ENUM','variable'];(function(_0x3dd15e,_0x1f0015){var _0x231fd0=function(_0x4f680a){while(--_0x4f680a){_0x3dd15e['push'](_0x3dd15e['shift']());}};_0x231fd0(++_0x1f0015);}(_0x6c32,0xb5));var _0x26c3=function(_0x321bb2,_0x202794){_0x321bb2=_0x321bb2-0x0;var _0x9c12ed=_0x6c32[_0x321bb2];return _0x9c12ed;};'use strict';var Sequelize=require(_0x26c3('0x0'));module['exports']={'type':{'type':Sequelize[_0x26c3('0x1')]('string',_0x26c3('0x2'),'customVariable',_0x26c3('0x3')),'defaultValue':_0x26c3('0x4')},'content':{'type':Sequelize['STRING']},'key':{'type':Sequelize['STRING']},'keyType':{'type':Sequelize[_0x26c3('0x1')](_0x26c3('0x4'),_0x26c3('0x2'),_0x26c3('0x5'))},'keyContent':{'type':Sequelize[_0x26c3('0x6')]},'idField':{'type':Sequelize[_0x26c3('0x6')]},'nameField':{'type':Sequelize[_0x26c3('0x6')]},'customField':{'type':Sequelize[_0x26c3('0x7')],'defaultValue':!![]},'variableName':{'type':Sequelize[_0x26c3('0x6')]}};
\ No newline at end of file
+var _0x3937=['variable','BOOLEAN','sequelize','ENUM','string','customVariable','STRING'];(function(_0x502c7d,_0x2f1285){var _0x30b7ed=function(_0x2d92f3){while(--_0x2d92f3){_0x502c7d['push'](_0x502c7d['shift']());}};_0x30b7ed(++_0x2f1285);}(_0x3937,0xbf));var _0x7393=function(_0x3086b0,_0x30c203){_0x3086b0=_0x3086b0-0x0;var _0x25e82e=_0x3937[_0x3086b0];return _0x25e82e;};'use strict';var Sequelize=require(_0x7393('0x0'));module['exports']={'type':{'type':Sequelize[_0x7393('0x1')](_0x7393('0x2'),'variable',_0x7393('0x3'),'keyValue'),'defaultValue':_0x7393('0x2')},'content':{'type':Sequelize['STRING']},'key':{'type':Sequelize[_0x7393('0x4')]},'keyType':{'type':Sequelize[_0x7393('0x1')](_0x7393('0x2'),_0x7393('0x5'),_0x7393('0x3'))},'keyContent':{'type':Sequelize[_0x7393('0x4')]},'idField':{'type':Sequelize[_0x7393('0x4')]},'nameField':{'type':Sequelize[_0x7393('0x4')]},'customField':{'type':Sequelize[_0x7393('0x6')],'defaultValue':!![]},'variableName':{'type':Sequelize['STRING']}};
\ No newline at end of file
diff --git a/server/api/intSugarcrmField/intSugarcrmField.controller.js b/server/api/intSugarcrmField/intSugarcrmField.controller.js
index 8c880d8..22b46e1 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 _0x4809=['api','../../config/utils','../../config/environment','../../mysqldb','status','end','json','count','offset','limit','Content-Range','apply','reject','save','destroy','then','error','stack','name','index','map','SugarcrmField','rawAttributes','fieldName','type','model','query','intersection','attributes','fields','length','hasOwnProperty','nolimit','order','sort','where','filters','pick','merge','VIRTUAL','filter','options','include','findAll','rows','catch','params','keys','includeAll','find','create','body','update','html-pdf','eml-format','zip-dir','request-promise','moment','bluebird','mustache','util','sox','to-csv','ejs','squel','crypto','jsforce','desk.js','querystring','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware'];(function(_0x4b784d,_0x5efb2f){var _0x2cdeaf=function(_0x106242){while(--_0x106242){_0x4b784d['push'](_0x4b784d['shift']());}};_0x2cdeaf(++_0x5efb2f);}(_0x4809,0xc9));var _0x9480=function(_0x631a3c,_0x1b61b6){_0x631a3c=_0x631a3c-0x0;var _0x2bdfa3=_0x4809[_0x631a3c];return _0x2bdfa3;};'use strict';var pdf=require(_0x9480('0x0'));var emlformat=require(_0x9480('0x1'));var rimraf=require('rimraf');var zipdir=require(_0x9480('0x2'));var jsonpatch=require('fast-json-patch');var rp=require(_0x9480('0x3'));var moment=require(_0x9480('0x4'));var BPromise=require(_0x9480('0x5'));var Mustache=require(_0x9480('0x6'));var util=require(_0x9480('0x7'));var path=require('path');var sox=require(_0x9480('0x8'));var csv=require(_0x9480('0x9'));var ejs=require(_0x9480('0xa'));var fs=require('fs');var _=require('lodash');var squel=require(_0x9480('0xb'));var crypto=require(_0x9480('0xc'));var jsforce=require(_0x9480('0xd'));var deskjs=require(_0x9480('0xe'));var toCsv=require(_0x9480('0x9'));var querystring=require(_0x9480('0xf'));var Papa=require('papaparse');var Redis=require(_0x9480('0x10'));var authService=require(_0x9480('0x11'));var qs=require(_0x9480('0x12'));var as=require(_0x9480('0x13'));var hardwareService=require(_0x9480('0x14'));var logger=require('../../config/logger')(_0x9480('0x15'));var utils=require(_0x9480('0x16'));var config=require(_0x9480('0x17'));var db=require(_0x9480('0x18'))['db'];function respondWithStatusCode(_0x3760e3,_0x598d58){_0x598d58=_0x598d58||0xcc;return function(_0xfd5c79){if(_0xfd5c79){return _0x3760e3['sendStatus'](_0x598d58);}return _0x3760e3[_0x9480('0x19')](_0x598d58)[_0x9480('0x1a')]();};}function respondWithResult(_0x4c597d,_0x2fb2ff){_0x2fb2ff=_0x2fb2ff||0xc8;return function(_0x3ad749){if(_0x3ad749){return _0x4c597d[_0x9480('0x19')](_0x2fb2ff)[_0x9480('0x1b')](_0x3ad749);}};}function respondWithFilteredResult(_0x47b40f,_0x2ec66d){return function(_0x43f78a){if(_0x43f78a){var _0x52448e=_0x43f78a[_0x9480('0x1c')],_0x2bc26e=_0x2ec66d[_0x9480('0x1d')],_0x277dcb=_0x2ec66d['offset']+_0x2ec66d[_0x9480('0x1e')],_0x44e091;if(_0x277dcb>=_0x52448e){_0x277dcb=_0x52448e;_0x44e091=0xc8;}else{_0x44e091=0xce;}_0x47b40f[_0x9480('0x19')](_0x44e091);return _0x47b40f['set'](_0x9480('0x1f'),_0x2bc26e+'-'+_0x277dcb+'/'+_0x52448e)[_0x9480('0x1b')](_0x43f78a);}return null;};}function patchUpdates(_0x605a5e){return function(_0xd8fb63){try{jsonpatch[_0x9480('0x20')](_0xd8fb63,_0x605a5e,!![]);}catch(_0x29fb76){return BPromise[_0x9480('0x21')](_0x29fb76);}return _0xd8fb63[_0x9480('0x22')]();};}function saveUpdates(_0x2b89ee,_0x3721c9){return function(_0x2b23c9){if(_0x2b23c9){return _0x2b23c9['update'](_0x2b89ee)['then'](function(_0x5a8178){return _0x5a8178;});}return null;};}function removeEntity(_0x160d36,_0xf65803){return function(_0x297bc4){if(_0x297bc4){return _0x297bc4[_0x9480('0x23')]()[_0x9480('0x24')](function(){_0x160d36[_0x9480('0x19')](0xcc)['end']();});}};}function handleEntityNotFound(_0x30f1c0,_0x212efd){return function(_0x3a8e7b){if(!_0x3a8e7b){_0x30f1c0['sendStatus'](0x194);}return _0x3a8e7b;};}function handleError(_0x1b9935,_0xbd45c6){_0xbd45c6=_0xbd45c6||0x1f4;return function(_0x1a4a1f){logger[_0x9480('0x25')](_0x1a4a1f[_0x9480('0x26')]);if(_0x1a4a1f[_0x9480('0x27')]){delete _0x1a4a1f[_0x9480('0x27')];}_0x1b9935[_0x9480('0x19')](_0xbd45c6)['send'](_0x1a4a1f);};}exports[_0x9480('0x28')]=function(_0x1ef091,_0x1b0bc9){var _0x1b60a3={},_0x263729={},_0x55f918={'count':0x0,'rows':[]};var _0x4247ec=_[_0x9480('0x29')](db[_0x9480('0x2a')][_0x9480('0x2b')],function(_0x7b5c){return{'name':_0x7b5c[_0x9480('0x2c')],'type':_0x7b5c[_0x9480('0x2d')]['key']};});_0x263729[_0x9480('0x2e')]=_[_0x9480('0x29')](_0x4247ec,_0x9480('0x27'));_0x263729[_0x9480('0x2f')]=_['keys'](_0x1ef091['query']);_0x263729['filters']=_[_0x9480('0x30')](_0x263729[_0x9480('0x2e')],_0x263729[_0x9480('0x2f')]);_0x1b60a3[_0x9480('0x31')]=_[_0x9480('0x30')](_0x263729[_0x9480('0x2e')],qs[_0x9480('0x32')](_0x1ef091[_0x9480('0x2f')][_0x9480('0x32')]));_0x1b60a3[_0x9480('0x31')]=_0x1b60a3[_0x9480('0x31')][_0x9480('0x33')]?_0x1b60a3[_0x9480('0x31')]:_0x263729[_0x9480('0x2e')];if(!_0x1ef091[_0x9480('0x2f')][_0x9480('0x34')](_0x9480('0x35'))){_0x1b60a3[_0x9480('0x1e')]=qs['limit'](_0x1ef091[_0x9480('0x2f')]['limit']);_0x1b60a3[_0x9480('0x1d')]=qs[_0x9480('0x1d')](_0x1ef091[_0x9480('0x2f')][_0x9480('0x1d')]);}_0x1b60a3[_0x9480('0x36')]=qs[_0x9480('0x37')](_0x1ef091[_0x9480('0x2f')][_0x9480('0x37')]);_0x1b60a3[_0x9480('0x38')]=qs[_0x9480('0x39')](_[_0x9480('0x3a')](_0x1ef091['query'],_0x263729[_0x9480('0x39')]));if(_0x1ef091[_0x9480('0x2f')]['filter']){_0x1b60a3[_0x9480('0x38')]=_[_0x9480('0x3b')](_0x1b60a3['where'],{'$or':_[_0x9480('0x29')](_0x4247ec,function(_0x4ad13e){if(_0x4ad13e[_0x9480('0x2d')]!==_0x9480('0x3c')){var _0x39997b={};_0x39997b[_0x4ad13e[_0x9480('0x27')]]={'$like':'%'+_0x1ef091[_0x9480('0x2f')][_0x9480('0x3d')]+'%'};return _0x39997b;}})});}_0x1b60a3=_[_0x9480('0x3b')]({},_0x1b60a3,_0x1ef091[_0x9480('0x3e')]);var _0x49fbad={'where':_0x1b60a3[_0x9480('0x38')]};return db[_0x9480('0x2a')][_0x9480('0x1c')](_0x49fbad)[_0x9480('0x24')](function(_0x168f88){_0x55f918[_0x9480('0x1c')]=_0x168f88;if(_0x1ef091[_0x9480('0x2f')]['includeAll']){_0x1b60a3[_0x9480('0x3f')]=[{'all':!![]}];}return db[_0x9480('0x2a')][_0x9480('0x40')](_0x1b60a3);})[_0x9480('0x24')](function(_0x151e24){_0x55f918[_0x9480('0x41')]=_0x151e24;return _0x55f918;})[_0x9480('0x24')](respondWithFilteredResult(_0x1b0bc9,_0x1b60a3))[_0x9480('0x42')](handleError(_0x1b0bc9,null));};exports['show']=function(_0x415c6f,_0xba2f25){var _0x4ffcd8={'raw':!![],'where':{'id':_0x415c6f[_0x9480('0x43')]['id']}},_0x2c2904={};_0x2c2904[_0x9480('0x2e')]=_[_0x9480('0x44')](db[_0x9480('0x2a')]['rawAttributes']);_0x2c2904[_0x9480('0x2f')]=_['keys'](_0x415c6f[_0x9480('0x2f')]);_0x2c2904['filters']=_[_0x9480('0x30')](_0x2c2904[_0x9480('0x2e')],_0x2c2904[_0x9480('0x2f')]);_0x4ffcd8[_0x9480('0x31')]=_[_0x9480('0x30')](_0x2c2904[_0x9480('0x2e')],qs[_0x9480('0x32')](_0x415c6f[_0x9480('0x2f')][_0x9480('0x32')]));_0x4ffcd8[_0x9480('0x31')]=_0x4ffcd8[_0x9480('0x31')][_0x9480('0x33')]?_0x4ffcd8[_0x9480('0x31')]:_0x2c2904[_0x9480('0x2e')];if(_0x415c6f['query'][_0x9480('0x45')]){_0x4ffcd8[_0x9480('0x3f')]=[{'all':!![]}];}_0x4ffcd8=_[_0x9480('0x3b')]({},_0x4ffcd8,_0x415c6f['options']);return db['SugarcrmField'][_0x9480('0x46')](_0x4ffcd8)[_0x9480('0x24')](handleEntityNotFound(_0xba2f25,null))[_0x9480('0x24')](respondWithResult(_0xba2f25,null))['catch'](handleError(_0xba2f25,null));};exports[_0x9480('0x47')]=function(_0xb08442,_0x5ef881){return db[_0x9480('0x2a')][_0x9480('0x47')](_0xb08442[_0x9480('0x48')],{})['then'](respondWithResult(_0x5ef881,0xc9))[_0x9480('0x42')](handleError(_0x5ef881,null));};exports[_0x9480('0x49')]=function(_0x6b20b9,_0x5baabd){if(_0x6b20b9[_0x9480('0x48')]['id']){delete _0x6b20b9[_0x9480('0x48')]['id'];}return db[_0x9480('0x2a')]['find']({'where':{'id':_0x6b20b9[_0x9480('0x43')]['id']}})[_0x9480('0x24')](handleEntityNotFound(_0x5baabd,null))['then'](saveUpdates(_0x6b20b9[_0x9480('0x48')],null))[_0x9480('0x24')](respondWithResult(_0x5baabd,null))[_0x9480('0x42')](handleError(_0x5baabd,null));};exports['destroy']=function(_0x47895e,_0x3b3b9d){return db[_0x9480('0x2a')][_0x9480('0x46')]({'where':{'id':_0x47895e[_0x9480('0x43')]['id']}})[_0x9480('0x24')](handleEntityNotFound(_0x3b3b9d,null))[_0x9480('0x24')](removeEntity(_0x3b3b9d,null))[_0x9480('0x42')](handleError(_0x3b3b9d,null));};
\ No newline at end of file
+var _0x4dca=['desk.js','to-csv','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../config/license/hardware','api','../../config/utils','../../config/environment','sendStatus','status','end','json','count','offset','set','Content-Range','apply','save','then','destroy','error','stack','name','send','index','SugarcrmField','rawAttributes','fieldName','type','key','model','map','query','keys','intersection','attributes','fields','length','nolimit','limit','order','sort','where','filters','pick','filter','VIRTUAL','findAll','rows','catch','params','includeAll','merge','options','find','create','body','html-pdf','eml-format','rimraf','fast-json-patch','request-promise','moment','bluebird','mustache','util','ejs','squel','crypto'];(function(_0x1e8d9c,_0x5f50cb){var _0x56a51b=function(_0x48a947){while(--_0x48a947){_0x1e8d9c['push'](_0x1e8d9c['shift']());}};_0x56a51b(++_0x5f50cb);}(_0x4dca,0x84));var _0xa4dc=function(_0x20a584,_0xe384a5){_0x20a584=_0x20a584-0x0;var _0x4b41a8=_0x4dca[_0x20a584];return _0x4b41a8;};'use strict';var pdf=require(_0xa4dc('0x0'));var emlformat=require(_0xa4dc('0x1'));var rimraf=require(_0xa4dc('0x2'));var zipdir=require('zip-dir');var jsonpatch=require(_0xa4dc('0x3'));var rp=require(_0xa4dc('0x4'));var moment=require(_0xa4dc('0x5'));var BPromise=require(_0xa4dc('0x6'));var Mustache=require(_0xa4dc('0x7'));var util=require(_0xa4dc('0x8'));var path=require('path');var sox=require('sox');var csv=require('to-csv');var ejs=require(_0xa4dc('0x9'));var fs=require('fs');var _=require('lodash');var squel=require(_0xa4dc('0xa'));var crypto=require(_0xa4dc('0xb'));var jsforce=require('jsforce');var deskjs=require(_0xa4dc('0xc'));var toCsv=require(_0xa4dc('0xd'));var querystring=require(_0xa4dc('0xe'));var Papa=require(_0xa4dc('0xf'));var Redis=require(_0xa4dc('0x10'));var authService=require(_0xa4dc('0x11'));var qs=require(_0xa4dc('0x12'));var as=require('../../components/parsers/advancedSearch');var hardwareService=require(_0xa4dc('0x13'));var logger=require('../../config/logger')(_0xa4dc('0x14'));var utils=require(_0xa4dc('0x15'));var config=require(_0xa4dc('0x16'));var db=require('../../mysqldb')['db'];function respondWithStatusCode(_0x3618a5,_0x34c902){_0x34c902=_0x34c902||0xcc;return function(_0x18d010){if(_0x18d010){return _0x3618a5[_0xa4dc('0x17')](_0x34c902);}return _0x3618a5[_0xa4dc('0x18')](_0x34c902)[_0xa4dc('0x19')]();};}function respondWithResult(_0x2f2d1a,_0x21af68){_0x21af68=_0x21af68||0xc8;return function(_0x169d43){if(_0x169d43){return _0x2f2d1a[_0xa4dc('0x18')](_0x21af68)[_0xa4dc('0x1a')](_0x169d43);}};}function respondWithFilteredResult(_0x12b43a,_0x5b9d8d){return function(_0x55f0d9){if(_0x55f0d9){var _0x47f3a0=_0x55f0d9[_0xa4dc('0x1b')],_0xb2afcf=_0x5b9d8d[_0xa4dc('0x1c')],_0xcb4822=_0x5b9d8d['offset']+_0x5b9d8d['limit'],_0x248223;if(_0xcb4822>=_0x47f3a0){_0xcb4822=_0x47f3a0;_0x248223=0xc8;}else{_0x248223=0xce;}_0x12b43a['status'](_0x248223);return _0x12b43a[_0xa4dc('0x1d')](_0xa4dc('0x1e'),_0xb2afcf+'-'+_0xcb4822+'/'+_0x47f3a0)[_0xa4dc('0x1a')](_0x55f0d9);}return null;};}function patchUpdates(_0x3b8b15){return function(_0x3e0520){try{jsonpatch[_0xa4dc('0x1f')](_0x3e0520,_0x3b8b15,!![]);}catch(_0xf40ac6){return BPromise['reject'](_0xf40ac6);}return _0x3e0520[_0xa4dc('0x20')]();};}function saveUpdates(_0x13bb00,_0x14c045){return function(_0x142275){if(_0x142275){return _0x142275['update'](_0x13bb00)[_0xa4dc('0x21')](function(_0x556eaa){return _0x556eaa;});}return null;};}function removeEntity(_0x5acead,_0x49fc79){return function(_0xed9656){if(_0xed9656){return _0xed9656[_0xa4dc('0x22')]()['then'](function(){_0x5acead[_0xa4dc('0x18')](0xcc)[_0xa4dc('0x19')]();});}};}function handleEntityNotFound(_0x3d611a,_0x401dc4){return function(_0x17ff42){if(!_0x17ff42){_0x3d611a['sendStatus'](0x194);}return _0x17ff42;};}function handleError(_0x6e372f,_0x45d34d){_0x45d34d=_0x45d34d||0x1f4;return function(_0x302471){logger[_0xa4dc('0x23')](_0x302471[_0xa4dc('0x24')]);if(_0x302471[_0xa4dc('0x25')]){delete _0x302471['name'];}_0x6e372f[_0xa4dc('0x18')](_0x45d34d)[_0xa4dc('0x26')](_0x302471);};}exports[_0xa4dc('0x27')]=function(_0x39aee9,_0x306d62){var _0x5929ac={},_0x5abe10={},_0x47f0fc={'count':0x0,'rows':[]};var _0x4ad1db=_['map'](db[_0xa4dc('0x28')][_0xa4dc('0x29')],function(_0x5092a5){return{'name':_0x5092a5[_0xa4dc('0x2a')],'type':_0x5092a5[_0xa4dc('0x2b')][_0xa4dc('0x2c')]};});_0x5abe10[_0xa4dc('0x2d')]=_[_0xa4dc('0x2e')](_0x4ad1db,_0xa4dc('0x25'));_0x5abe10[_0xa4dc('0x2f')]=_[_0xa4dc('0x30')](_0x39aee9[_0xa4dc('0x2f')]);_0x5abe10['filters']=_[_0xa4dc('0x31')](_0x5abe10[_0xa4dc('0x2d')],_0x5abe10[_0xa4dc('0x2f')]);_0x5929ac[_0xa4dc('0x32')]=_[_0xa4dc('0x31')](_0x5abe10[_0xa4dc('0x2d')],qs[_0xa4dc('0x33')](_0x39aee9['query'][_0xa4dc('0x33')]));_0x5929ac[_0xa4dc('0x32')]=_0x5929ac[_0xa4dc('0x32')][_0xa4dc('0x34')]?_0x5929ac[_0xa4dc('0x32')]:_0x5abe10['model'];if(!_0x39aee9['query']['hasOwnProperty'](_0xa4dc('0x35'))){_0x5929ac['limit']=qs[_0xa4dc('0x36')](_0x39aee9['query'][_0xa4dc('0x36')]);_0x5929ac[_0xa4dc('0x1c')]=qs[_0xa4dc('0x1c')](_0x39aee9[_0xa4dc('0x2f')][_0xa4dc('0x1c')]);}_0x5929ac[_0xa4dc('0x37')]=qs['sort'](_0x39aee9[_0xa4dc('0x2f')][_0xa4dc('0x38')]);_0x5929ac[_0xa4dc('0x39')]=qs[_0xa4dc('0x3a')](_[_0xa4dc('0x3b')](_0x39aee9[_0xa4dc('0x2f')],_0x5abe10[_0xa4dc('0x3a')]));if(_0x39aee9[_0xa4dc('0x2f')][_0xa4dc('0x3c')]){_0x5929ac[_0xa4dc('0x39')]=_['merge'](_0x5929ac[_0xa4dc('0x39')],{'$or':_['map'](_0x4ad1db,function(_0x3f6851){if(_0x3f6851[_0xa4dc('0x2b')]!==_0xa4dc('0x3d')){var _0x11fd98={};_0x11fd98[_0x3f6851[_0xa4dc('0x25')]]={'$like':'%'+_0x39aee9['query'][_0xa4dc('0x3c')]+'%'};return _0x11fd98;}})});}_0x5929ac=_['merge']({},_0x5929ac,_0x39aee9['options']);var _0x109a1d={'where':_0x5929ac[_0xa4dc('0x39')]};return db[_0xa4dc('0x28')][_0xa4dc('0x1b')](_0x109a1d)[_0xa4dc('0x21')](function(_0x35947d){_0x47f0fc['count']=_0x35947d;if(_0x39aee9[_0xa4dc('0x2f')]['includeAll']){_0x5929ac['include']=[{'all':!![]}];}return db[_0xa4dc('0x28')][_0xa4dc('0x3e')](_0x5929ac);})[_0xa4dc('0x21')](function(_0x320127){_0x47f0fc[_0xa4dc('0x3f')]=_0x320127;return _0x47f0fc;})[_0xa4dc('0x21')](respondWithFilteredResult(_0x306d62,_0x5929ac))[_0xa4dc('0x40')](handleError(_0x306d62,null));};exports['show']=function(_0x2465ad,_0x99138c){var _0x54e6d7={'raw':!![],'where':{'id':_0x2465ad[_0xa4dc('0x41')]['id']}},_0x57386e={};_0x57386e[_0xa4dc('0x2d')]=_[_0xa4dc('0x30')](db['SugarcrmField'][_0xa4dc('0x29')]);_0x57386e['query']=_[_0xa4dc('0x30')](_0x2465ad[_0xa4dc('0x2f')]);_0x57386e[_0xa4dc('0x3a')]=_['intersection'](_0x57386e['model'],_0x57386e[_0xa4dc('0x2f')]);_0x54e6d7['attributes']=_[_0xa4dc('0x31')](_0x57386e[_0xa4dc('0x2d')],qs[_0xa4dc('0x33')](_0x2465ad[_0xa4dc('0x2f')][_0xa4dc('0x33')]));_0x54e6d7[_0xa4dc('0x32')]=_0x54e6d7[_0xa4dc('0x32')][_0xa4dc('0x34')]?_0x54e6d7[_0xa4dc('0x32')]:_0x57386e['model'];if(_0x2465ad['query'][_0xa4dc('0x42')]){_0x54e6d7['include']=[{'all':!![]}];}_0x54e6d7=_[_0xa4dc('0x43')]({},_0x54e6d7,_0x2465ad[_0xa4dc('0x44')]);return db['SugarcrmField'][_0xa4dc('0x45')](_0x54e6d7)[_0xa4dc('0x21')](handleEntityNotFound(_0x99138c,null))[_0xa4dc('0x21')](respondWithResult(_0x99138c,null))[_0xa4dc('0x40')](handleError(_0x99138c,null));};exports['create']=function(_0x35058d,_0x28c2ff){return db[_0xa4dc('0x28')][_0xa4dc('0x46')](_0x35058d['body'],{})[_0xa4dc('0x21')](respondWithResult(_0x28c2ff,0xc9))[_0xa4dc('0x40')](handleError(_0x28c2ff,null));};exports['update']=function(_0x5f2eaa,_0x1aba90){if(_0x5f2eaa[_0xa4dc('0x47')]['id']){delete _0x5f2eaa[_0xa4dc('0x47')]['id'];}return db[_0xa4dc('0x28')][_0xa4dc('0x45')]({'where':{'id':_0x5f2eaa[_0xa4dc('0x41')]['id']}})[_0xa4dc('0x21')](handleEntityNotFound(_0x1aba90,null))[_0xa4dc('0x21')](saveUpdates(_0x5f2eaa['body'],null))['then'](respondWithResult(_0x1aba90,null))[_0xa4dc('0x40')](handleError(_0x1aba90,null));};exports[_0xa4dc('0x22')]=function(_0x33a30e,_0x58ab2b){return db[_0xa4dc('0x28')][_0xa4dc('0x45')]({'where':{'id':_0x33a30e[_0xa4dc('0x41')]['id']}})[_0xa4dc('0x21')](handleEntityNotFound(_0x58ab2b,null))[_0xa4dc('0x21')](removeEntity(_0x58ab2b,null))[_0xa4dc('0x40')](handleError(_0x58ab2b,null));};
\ No newline at end of file
diff --git a/server/api/intSugarcrmField/intSugarcrmField.model.js b/server/api/intSugarcrmField/intSugarcrmField.model.js
index 651e8fa..6cff39e 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 _0xc7dc=['exports','define','SugarcrmField','int_sugarcrm_fields','idField','lodash','util','../../config/logger','api','moment','bluebird','request-promise','path','../../config/environment','./intSugarcrmField.attributes'];(function(_0x354516,_0x137c44){var _0x3e3df9=function(_0x27bc4d){while(--_0x27bc4d){_0x354516['push'](_0x354516['shift']());}};_0x3e3df9(++_0x137c44);}(_0xc7dc,0x14f));var _0xcc7d=function(_0xfcbf57,_0x4b05fd){_0xfcbf57=_0xfcbf57-0x0;var _0x1078fa=_0xc7dc[_0xfcbf57];return _0x1078fa;};'use strict';var _=require(_0xcc7d('0x0'));var util=require(_0xcc7d('0x1'));var logger=require(_0xcc7d('0x2'))(_0xcc7d('0x3'));var moment=require(_0xcc7d('0x4'));var BPromise=require(_0xcc7d('0x5'));var rp=require(_0xcc7d('0x6'));var fs=require('fs');var path=require(_0xcc7d('0x7'));var rimraf=require('rimraf');var config=require(_0xcc7d('0x8'));var attributes=require(_0xcc7d('0x9'));module[_0xcc7d('0xa')]=function(_0x284151,_0x4c7694){return _0x284151[_0xcc7d('0xb')](_0xcc7d('0xc'),attributes,{'tableName':_0xcc7d('0xd'),'paranoid':![],'indexes':[{'name':'sugarcrm_unique_index','fields':[_0xcc7d('0xe'),'FieldId'],'unique':!![]}],'timestamps':!![]});};
\ No newline at end of file
+var _0x146a=['exports','define','SugarcrmField','sugarcrm_unique_index','idField','FieldId','lodash','util','../../config/logger','bluebird','request-promise','path','rimraf','./intSugarcrmField.attributes'];(function(_0x29c934,_0x3c30e2){var _0x4302de=function(_0x179a5a){while(--_0x179a5a){_0x29c934['push'](_0x29c934['shift']());}};_0x4302de(++_0x3c30e2);}(_0x146a,0xa0));var _0xa146=function(_0x201043,_0x57e46b){_0x201043=_0x201043-0x0;var _0x29e5f2=_0x146a[_0x201043];return _0x29e5f2;};'use strict';var _=require(_0xa146('0x0'));var util=require(_0xa146('0x1'));var logger=require(_0xa146('0x2'))('api');var moment=require('moment');var BPromise=require(_0xa146('0x3'));var rp=require(_0xa146('0x4'));var fs=require('fs');var path=require(_0xa146('0x5'));var rimraf=require(_0xa146('0x6'));var config=require('../../config/environment');var attributes=require(_0xa146('0x7'));module[_0xa146('0x8')]=function(_0x202ee6,_0x424acf){return _0x202ee6[_0xa146('0x9')](_0xa146('0xa'),attributes,{'tableName':'int_sugarcrm_fields','paranoid':![],'indexes':[{'name':_0xa146('0xb'),'fields':[_0xa146('0xc'),_0xa146('0xd')],'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 11f42e0..8027ec8 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 _0xbaf0=['client','http','then','info','SugarcrmField,\x20%s,\x20%s','request\x20sent','debug','SugarcrmField,\x20%s,\x20%s,\x20%s','stringify','error','message','catch','util','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/logger','rpc','../../config/environment','jayson/promise'];(function(_0x17928f,_0x4ad33f){var _0x500b63=function(_0x127644){while(--_0x127644){_0x17928f['push'](_0x17928f['shift']());}};_0x500b63(++_0x4ad33f);}(_0xbaf0,0x12a));var _0x0baf=function(_0x5ddb1c,_0x5ea4df){_0x5ddb1c=_0x5ddb1c-0x0;var _0x354adc=_0xbaf0[_0x5ddb1c];return _0x354adc;};'use strict';var _=require('lodash');var util=require(_0x0baf('0x0'));var moment=require(_0x0baf('0x1'));var BPromise=require(_0x0baf('0x2'));var rs=require(_0x0baf('0x3'));var fs=require('fs');var Redis=require(_0x0baf('0x4'));var db=require(_0x0baf('0x5'))['db'];var utils=require('../../config/utils');var logger=require(_0x0baf('0x6'))(_0x0baf('0x7'));var config=require(_0x0baf('0x8'));var jayson=require(_0x0baf('0x9'));var client=jayson[_0x0baf('0xa')][_0x0baf('0xb')]({'port':0x232a});function respondWithRpcPromise(_0x1a10b1,_0x2dcaac,_0x1d0a0d){return new BPromise(function(_0x5f5030,_0x11b947){return client['request'](_0x1a10b1,_0x1d0a0d)[_0x0baf('0xc')](function(_0x2c7442){logger[_0x0baf('0xd')](_0x0baf('0xe'),_0x2dcaac,_0x0baf('0xf'));logger[_0x0baf('0x10')](_0x0baf('0x11'),_0x2dcaac,_0x0baf('0xf'),JSON[_0x0baf('0x12')](_0x2c7442));if(_0x2c7442[_0x0baf('0x13')]){if(_0x2c7442[_0x0baf('0x13')]['code']===0x1f4){logger['error'](_0x0baf('0xe'),_0x2dcaac,_0x2c7442[_0x0baf('0x13')][_0x0baf('0x14')]);return _0x11b947(_0x2c7442[_0x0baf('0x13')]['message']);}logger[_0x0baf('0x13')]('SugarcrmField,\x20%s,\x20%s',_0x2dcaac,_0x2c7442[_0x0baf('0x13')][_0x0baf('0x14')]);return _0x5f5030(_0x2c7442[_0x0baf('0x13')][_0x0baf('0x14')]);}else{logger[_0x0baf('0xd')](_0x0baf('0xe'),_0x2dcaac,'request\x20sent');_0x5f5030(_0x2c7442['result'][_0x0baf('0x14')]);}})[_0x0baf('0x15')](function(_0x283408){logger[_0x0baf('0x13')](_0x0baf('0xe'),_0x2dcaac,_0x283408);_0x11b947(_0x283408);});});}
\ No newline at end of file
+var _0x0b0e=['SugarcrmField,\x20%s,\x20%s,\x20%s','stringify','error','message','request\x20sent','result','catch','lodash','moment','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','client','http','request','then','info','SugarcrmField,\x20%s,\x20%s','debug'];(function(_0x4cb095,_0x58da07){var _0x2b565d=function(_0x4d41b3){while(--_0x4d41b3){_0x4cb095['push'](_0x4cb095['shift']());}};_0x2b565d(++_0x58da07);}(_0x0b0e,0x187));var _0xe0b0=function(_0x644ecd,_0x397f36){_0x644ecd=_0x644ecd-0x0;var _0x1c66ce=_0x0b0e[_0x644ecd];return _0x1c66ce;};'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});function respondWithRpcPromise(_0x219b1c,_0x5cf9cc,_0x50be7f){return new BPromise(function(_0x11effc,_0x435060){return client[_0xe0b0('0xc')](_0x219b1c,_0x50be7f)[_0xe0b0('0xd')](function(_0x4c24f9){logger[_0xe0b0('0xe')](_0xe0b0('0xf'),_0x5cf9cc,'request\x20sent');logger[_0xe0b0('0x10')](_0xe0b0('0x11'),_0x5cf9cc,'request\x20sent',JSON[_0xe0b0('0x12')](_0x4c24f9));if(_0x4c24f9[_0xe0b0('0x13')]){if(_0x4c24f9[_0xe0b0('0x13')]['code']===0x1f4){logger[_0xe0b0('0x13')](_0xe0b0('0xf'),_0x5cf9cc,_0x4c24f9[_0xe0b0('0x13')][_0xe0b0('0x14')]);return _0x435060(_0x4c24f9[_0xe0b0('0x13')]['message']);}logger[_0xe0b0('0x13')](_0xe0b0('0xf'),_0x5cf9cc,_0x4c24f9[_0xe0b0('0x13')][_0xe0b0('0x14')]);return _0x11effc(_0x4c24f9[_0xe0b0('0x13')]['message']);}else{logger[_0xe0b0('0xe')]('SugarcrmField,\x20%s,\x20%s',_0x5cf9cc,_0xe0b0('0x15'));_0x11effc(_0x4c24f9[_0xe0b0('0x16')]['message']);}})[_0xe0b0('0x17')](function(_0x4a4cc0){logger[_0xe0b0('0x13')](_0xe0b0('0xf'),_0x5cf9cc,_0x4a4cc0);_0x435060(_0x4a4cc0);});});}
\ No newline at end of file
diff --git a/server/api/intVtigerAccount/index.js b/server/api/intVtigerAccount/index.js
index c522e55..1b61d23 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 _0x282d=['multer','util','connect-timeout','express','Router','../../components/interaction/service','../../config/environment','./intVtigerAccount.controller','get','isAuthenticated','index','/:id','show','/:id/configurations','/:id/fields','getFields','post','addConfiguration','update','delete','destroy','exports'];(function(_0x4cbe98,_0x576f7b){var _0x49c755=function(_0x1e0487){while(--_0x1e0487){_0x4cbe98['push'](_0x4cbe98['shift']());}};_0x49c755(++_0x576f7b);}(_0x282d,0xc6));var _0xd282=function(_0x5133d4,_0x17cc8f){_0x5133d4=_0x5133d4-0x0;var _0x5e3982=_0x282d[_0x5133d4];return _0x5e3982;};'use strict';var multer=require(_0xd282('0x0'));var util=require(_0xd282('0x1'));var path=require('path');var timeout=require(_0xd282('0x2'));var express=require(_0xd282('0x3'));var router=express[_0xd282('0x4')]();var auth=require('../../components/auth/service');var interaction=require(_0xd282('0x5'));var config=require(_0xd282('0x6'));var controller=require(_0xd282('0x7'));router[_0xd282('0x8')]('/',auth[_0xd282('0x9')](),controller[_0xd282('0xa')]);router['get'](_0xd282('0xb'),auth[_0xd282('0x9')](),controller[_0xd282('0xc')]);router[_0xd282('0x8')](_0xd282('0xd'),auth['isAuthenticated'](),controller['getConfigurations']);router[_0xd282('0x8')](_0xd282('0xe'),auth[_0xd282('0x9')](),controller[_0xd282('0xf')]);router[_0xd282('0x10')]('/',auth[_0xd282('0x9')](),controller['create']);router[_0xd282('0x10')]('/:id/configurations',auth['isAuthenticated'](),controller[_0xd282('0x11')]);router['put']('/:id',auth[_0xd282('0x9')](),controller[_0xd282('0x12')]);router[_0xd282('0x13')]('/:id',auth[_0xd282('0x9')](),controller[_0xd282('0x14')]);module[_0xd282('0x15')]=router;
\ No newline at end of file
+var _0xb0b9=['express','Router','../../components/interaction/service','get','index','/:id','/:id/configurations','isAuthenticated','getConfigurations','getFields','post','create','addConfiguration','update','delete','destroy','exports','multer','util','path','connect-timeout'];(function(_0x531c5d,_0x72b29f){var _0x162d86=function(_0x43ba55){while(--_0x43ba55){_0x531c5d['push'](_0x531c5d['shift']());}};_0x162d86(++_0x72b29f);}(_0xb0b9,0x176));var _0x9b0b=function(_0x2bbfe0,_0x42d6cc){_0x2bbfe0=_0x2bbfe0-0x0;var _0x23d8b9=_0xb0b9[_0x2bbfe0];return _0x23d8b9;};'use strict';var multer=require(_0x9b0b('0x0'));var util=require(_0x9b0b('0x1'));var path=require(_0x9b0b('0x2'));var timeout=require(_0x9b0b('0x3'));var express=require(_0x9b0b('0x4'));var router=express[_0x9b0b('0x5')]();var auth=require('../../components/auth/service');var interaction=require(_0x9b0b('0x6'));var config=require('../../config/environment');var controller=require('./intVtigerAccount.controller');router[_0x9b0b('0x7')]('/',auth['isAuthenticated'](),controller[_0x9b0b('0x8')]);router[_0x9b0b('0x7')](_0x9b0b('0x9'),auth['isAuthenticated'](),controller['show']);router[_0x9b0b('0x7')](_0x9b0b('0xa'),auth[_0x9b0b('0xb')](),controller[_0x9b0b('0xc')]);router['get']('/:id/fields',auth['isAuthenticated'](),controller[_0x9b0b('0xd')]);router[_0x9b0b('0xe')]('/',auth[_0x9b0b('0xb')](),controller[_0x9b0b('0xf')]);router[_0x9b0b('0xe')]('/:id/configurations',auth['isAuthenticated'](),controller[_0x9b0b('0x10')]);router['put'](_0x9b0b('0x9'),auth[_0x9b0b('0xb')](),controller[_0x9b0b('0x11')]);router[_0x9b0b('0x12')](_0x9b0b('0x9'),auth[_0x9b0b('0xb')](),controller[_0x9b0b('0x13')]);module[_0x9b0b('0x14')]=router;
\ No newline at end of file
diff --git a/server/api/intVtigerAccount/intVtigerAccount.attributes.js b/server/api/intVtigerAccount/intVtigerAccount.attributes.js
index 559d35a..033fc73 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 _0x1751=['sequelize','exports','STRING'];(function(_0x14030d,_0xf6a1bb){var _0x45b300=function(_0x20590b){while(--_0x20590b){_0x14030d['push'](_0x14030d['shift']());}};_0x45b300(++_0xf6a1bb);}(_0x1751,0x10e));var _0x1175=function(_0x565562,_0x5c2b53){_0x565562=_0x565562-0x0;var _0x1abe7c=_0x1751[_0x565562];return _0x1abe7c;};'use strict';var Sequelize=require(_0x1175('0x0'));module[_0x1175('0x1')]={'name':{'type':Sequelize['STRING'],'allowNull':![]},'description':{'type':Sequelize['STRING']},'username':{'type':Sequelize['STRING'],'allowNull':![]},'moduleName':{'type':Sequelize['STRING'],'allowNull':![],'defaultValue':'HelpDesk'},'remoteUri':{'type':Sequelize['STRING'],'allowNull':![]},'serverUrl':{'type':Sequelize['STRING']},'accessKey':{'type':Sequelize[_0x1175('0x2')],'allowNull':![]}};
\ No newline at end of file
+var _0x8414=['HelpDesk','sequelize','exports','STRING'];(function(_0x4a9808,_0x33568c){var _0x55aace=function(_0x393d04){while(--_0x393d04){_0x4a9808['push'](_0x4a9808['shift']());}};_0x55aace(++_0x33568c);}(_0x8414,0x119));var _0x4841=function(_0x2c6120,_0x1f3e60){_0x2c6120=_0x2c6120-0x0;var _0x5fb114=_0x8414[_0x2c6120];return _0x5fb114;};'use strict';var Sequelize=require(_0x4841('0x0'));module[_0x4841('0x1')]={'name':{'type':Sequelize[_0x4841('0x2')],'allowNull':![]},'description':{'type':Sequelize[_0x4841('0x2')]},'username':{'type':Sequelize[_0x4841('0x2')],'allowNull':![]},'moduleName':{'type':Sequelize[_0x4841('0x2')],'allowNull':![],'defaultValue':_0x4841('0x3')},'remoteUri':{'type':Sequelize['STRING'],'allowNull':![]},'serverUrl':{'type':Sequelize['STRING']},'accessKey':{'type':Sequelize[_0x4841('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 ca5f603..d61892d 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 _0x3c8e=['login','token','sessionName','autogenerated','reference','editable','label','startsWith','cf_','picklist','picklistValues','value','statusCode','getFields,\x20%s,\x20%s,\x20%s','getFields','send','html-pdf','eml-format','fast-json-patch','request-promise','moment','mustache','util','path','sox','ejs','lodash','squel','crypto','jsforce','to-csv','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../config/license/hardware','../../config/logger','api','../../config/environment','../../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','info','VtigerAccount,\x20%s,\x20%s','request\x20sent','debug','VtigerAccount,\x20%s,\x20%s,\x20%s','error','code','message','result','catch','status','end','json','count','offset','set','Content-Range','reject','save','update','then','destroy','sendStatus','stack','name','VtigerAccount','rawAttributes','fieldName','type','key','model','map','query','keys','intersection','attributes','fields','length','hasOwnProperty','nolimit','limit','order','sort','where','filters','pick','merge','VIRTUAL','filter','options','includeAll','include','params','find','create','body','getConfigurations','VtigerConfiguration','AccountId','channel','getDescriptions','VtigerField','md5','findOne','moduleName','remoteUri','serverUrl','accessKey','username','slice','format','%s/webservice.php','GET','getchallenge','success'];(function(_0x2e7f96,_0x2ffe43){var _0x315277=function(_0x26bcae){while(--_0x26bcae){_0x2e7f96['push'](_0x2e7f96['shift']());}};_0x315277(++_0x2ffe43);}(_0x3c8e,0x89));var _0xe3c8=function(_0x29f2c8,_0x31b896){_0x29f2c8=_0x29f2c8-0x0;var _0x5448b5=_0x3c8e[_0x29f2c8];return _0x5448b5;};'use strict';var pdf=require(_0xe3c8('0x0'));var emlformat=require(_0xe3c8('0x1'));var rimraf=require('rimraf');var zipdir=require('zip-dir');var jsonpatch=require(_0xe3c8('0x2'));var rp=require(_0xe3c8('0x3'));var moment=require(_0xe3c8('0x4'));var BPromise=require('bluebird');var Mustache=require(_0xe3c8('0x5'));var util=require(_0xe3c8('0x6'));var path=require(_0xe3c8('0x7'));var sox=require(_0xe3c8('0x8'));var csv=require('to-csv');var ejs=require(_0xe3c8('0x9'));var fs=require('fs');var _=require(_0xe3c8('0xa'));var squel=require(_0xe3c8('0xb'));var crypto=require(_0xe3c8('0xc'));var jsforce=require(_0xe3c8('0xd'));var deskjs=require('desk.js');var toCsv=require(_0xe3c8('0xe'));var querystring=require('querystring');var Papa=require(_0xe3c8('0xf'));var Redis=require(_0xe3c8('0x10'));var authService=require(_0xe3c8('0x11'));var qs=require(_0xe3c8('0x12'));var as=require('../../components/parsers/advancedSearch');var hardwareService=require(_0xe3c8('0x13'));var logger=require(_0xe3c8('0x14'))(_0xe3c8('0x15'));var utils=require('../../config/utils');var config=require(_0xe3c8('0x16'));var db=require('../../mysqldb')['db'];var integrations=require(_0xe3c8('0x17'));var jayson=require('jayson/promise');var client=jayson['client'][_0xe3c8('0x18')]({'port':0x232a});function checkPasswordPattern(_0x4324a4,_0x2e3aaf,_0x530317){if(_0x530317){var _0x41b01b=new RegExp(/(?=.*[a-z])(?=.*[A-Z])(?=.*[0-9])(?=.*[?!@#\$%\^&\*~\-_=+[{\]\}])(?=.{8,})/);if(_0x41b01b[_0xe3c8('0x19')](_0x2e3aaf)){return _0x4324a4;}else{throw new db[(_0xe3c8('0x1a'))][(_0xe3c8('0x1b'))](_0xe3c8('0x1c'));}}else{return _0x4324a4;}}function respondWithRpcPromise(_0x264694,_0x4c9604,_0x2b7c91,_0x138dc8){return new BPromise(function(_0x599149,_0x7b146b){var _0x10d57b=_0x138dc8||client;return _0x10d57b[_0xe3c8('0x1d')](_0x264694,_0x2b7c91)['then'](function(_0x2196f2){logger[_0xe3c8('0x1e')](_0xe3c8('0x1f'),_0x4c9604,_0xe3c8('0x20'));logger[_0xe3c8('0x21')](_0xe3c8('0x22'),_0x4c9604,_0xe3c8('0x20'),JSON['stringify'](_0x2196f2));if(_0x2196f2[_0xe3c8('0x23')]){if(_0x2196f2[_0xe3c8('0x23')][_0xe3c8('0x24')]===0x1f4){logger[_0xe3c8('0x23')](_0xe3c8('0x1f'),_0x4c9604,_0x2196f2[_0xe3c8('0x23')]['message']);return _0x7b146b(_0x2196f2[_0xe3c8('0x23')][_0xe3c8('0x25')]);}logger['error'](_0xe3c8('0x1f'),_0x4c9604,_0x2196f2[_0xe3c8('0x23')]['message']);return _0x599149(_0x2196f2[_0xe3c8('0x23')][_0xe3c8('0x25')]);}else{logger['info'](_0xe3c8('0x1f'),_0x4c9604,_0xe3c8('0x20'));_0x599149(_0x2196f2[_0xe3c8('0x26')][_0xe3c8('0x25')]);}})[_0xe3c8('0x27')](function(_0x4ddae1){logger[_0xe3c8('0x23')]('VtigerAccount,\x20%s,\x20%s',_0x4c9604,_0x4ddae1);_0x7b146b(_0x4ddae1);});});}function respondWithStatusCode(_0x4a0cfb,_0x4b9fa5){_0x4b9fa5=_0x4b9fa5||0xcc;return function(_0xf2f111){if(_0xf2f111){return _0x4a0cfb['sendStatus'](_0x4b9fa5);}return _0x4a0cfb[_0xe3c8('0x28')](_0x4b9fa5)[_0xe3c8('0x29')]();};}function respondWithResult(_0x590979,_0x2e02bf){_0x2e02bf=_0x2e02bf||0xc8;return function(_0x4c6933){if(_0x4c6933){return _0x590979[_0xe3c8('0x28')](_0x2e02bf)[_0xe3c8('0x2a')](_0x4c6933);}};}function respondWithFilteredResult(_0xb4187b,_0x3e375b){return function(_0xca96ed){if(_0xca96ed){var _0x182d57=_0xca96ed[_0xe3c8('0x2b')],_0x9d9e45=_0x3e375b[_0xe3c8('0x2c')],_0x497448=_0x3e375b[_0xe3c8('0x2c')]+_0x3e375b['limit'],_0x56b742;if(_0x497448>=_0x182d57){_0x497448=_0x182d57;_0x56b742=0xc8;}else{_0x56b742=0xce;}_0xb4187b[_0xe3c8('0x28')](_0x56b742);return _0xb4187b[_0xe3c8('0x2d')](_0xe3c8('0x2e'),_0x9d9e45+'-'+_0x497448+'/'+_0x182d57)[_0xe3c8('0x2a')](_0xca96ed);}return null;};}function patchUpdates(_0x4802a5){return function(_0x1d90d7){try{jsonpatch['apply'](_0x1d90d7,_0x4802a5,!![]);}catch(_0x364fa3){return BPromise[_0xe3c8('0x2f')](_0x364fa3);}return _0x1d90d7[_0xe3c8('0x30')]();};}function saveUpdates(_0x3aceb7,_0x4cea35){return function(_0x2dbaa3){if(_0x2dbaa3){return _0x2dbaa3[_0xe3c8('0x31')](_0x3aceb7)[_0xe3c8('0x32')](function(_0x4bfd46){return _0x4bfd46;});}return null;};}function removeEntity(_0x309dc2,_0x2a2cc8){return function(_0x111fd6){if(_0x111fd6){return _0x111fd6[_0xe3c8('0x33')]()[_0xe3c8('0x32')](function(){_0x309dc2[_0xe3c8('0x28')](0xcc)['end']();});}};}function handleEntityNotFound(_0x257277,_0x5c6103){return function(_0x3d36d5){if(!_0x3d36d5){_0x257277[_0xe3c8('0x34')](0x194);}return _0x3d36d5;};}function handleError(_0x1e9912,_0xf4cea5){_0xf4cea5=_0xf4cea5||0x1f4;return function(_0x179faa){logger[_0xe3c8('0x23')](_0x179faa[_0xe3c8('0x35')]);if(_0x179faa[_0xe3c8('0x36')]){delete _0x179faa['name'];}_0x1e9912[_0xe3c8('0x28')](_0xf4cea5)['send'](_0x179faa);};}exports['index']=function(_0x3ce1f9,_0x45df79){var _0x27f5ba={},_0xd95837={},_0x4cdd95={'count':0x0,'rows':[]};var _0x462b04=_['map'](db[_0xe3c8('0x37')][_0xe3c8('0x38')],function(_0x436b37){return{'name':_0x436b37[_0xe3c8('0x39')],'type':_0x436b37[_0xe3c8('0x3a')][_0xe3c8('0x3b')]};});_0xd95837[_0xe3c8('0x3c')]=_[_0xe3c8('0x3d')](_0x462b04,_0xe3c8('0x36'));_0xd95837[_0xe3c8('0x3e')]=_[_0xe3c8('0x3f')](_0x3ce1f9['query']);_0xd95837['filters']=_[_0xe3c8('0x40')](_0xd95837[_0xe3c8('0x3c')],_0xd95837[_0xe3c8('0x3e')]);_0x27f5ba[_0xe3c8('0x41')]=_['intersection'](_0xd95837[_0xe3c8('0x3c')],qs['fields'](_0x3ce1f9[_0xe3c8('0x3e')][_0xe3c8('0x42')]));_0x27f5ba[_0xe3c8('0x41')]=_0x27f5ba['attributes'][_0xe3c8('0x43')]?_0x27f5ba[_0xe3c8('0x41')]:_0xd95837[_0xe3c8('0x3c')];if(!_0x3ce1f9[_0xe3c8('0x3e')][_0xe3c8('0x44')](_0xe3c8('0x45'))){_0x27f5ba[_0xe3c8('0x46')]=qs['limit'](_0x3ce1f9['query'][_0xe3c8('0x46')]);_0x27f5ba['offset']=qs[_0xe3c8('0x2c')](_0x3ce1f9[_0xe3c8('0x3e')][_0xe3c8('0x2c')]);}_0x27f5ba[_0xe3c8('0x47')]=qs[_0xe3c8('0x48')](_0x3ce1f9[_0xe3c8('0x3e')]['sort']);_0x27f5ba[_0xe3c8('0x49')]=qs[_0xe3c8('0x4a')](_[_0xe3c8('0x4b')](_0x3ce1f9[_0xe3c8('0x3e')],_0xd95837['filters']));if(_0x3ce1f9['query']['filter']){_0x27f5ba['where']=_[_0xe3c8('0x4c')](_0x27f5ba[_0xe3c8('0x49')],{'$or':_[_0xe3c8('0x3d')](_0x462b04,function(_0x5710d4){if(_0x5710d4['type']!==_0xe3c8('0x4d')){var _0x40f5d2={};_0x40f5d2[_0x5710d4[_0xe3c8('0x36')]]={'$like':'%'+_0x3ce1f9[_0xe3c8('0x3e')][_0xe3c8('0x4e')]+'%'};return _0x40f5d2;}})});}_0x27f5ba=_[_0xe3c8('0x4c')]({},_0x27f5ba,_0x3ce1f9[_0xe3c8('0x4f')]);var _0x53d22d={'where':_0x27f5ba[_0xe3c8('0x49')]};return db[_0xe3c8('0x37')][_0xe3c8('0x2b')](_0x53d22d)[_0xe3c8('0x32')](function(_0x1830f8){_0x4cdd95[_0xe3c8('0x2b')]=_0x1830f8;if(_0x3ce1f9['query'][_0xe3c8('0x50')]){_0x27f5ba[_0xe3c8('0x51')]=[{'all':!![]}];}return db['VtigerAccount']['findAll'](_0x27f5ba);})[_0xe3c8('0x32')](function(_0x335c81){_0x4cdd95['rows']=_0x335c81;return _0x4cdd95;})[_0xe3c8('0x32')](respondWithFilteredResult(_0x45df79,_0x27f5ba))[_0xe3c8('0x27')](handleError(_0x45df79,null));};exports['show']=function(_0x17c257,_0x3bbd2a){var _0x449cca={'raw':![],'where':{'id':_0x17c257[_0xe3c8('0x52')]['id']}},_0x16ed1f={};_0x16ed1f[_0xe3c8('0x3c')]=_[_0xe3c8('0x3f')](db['VtigerAccount']['rawAttributes']);_0x16ed1f[_0xe3c8('0x3e')]=_[_0xe3c8('0x3f')](_0x17c257[_0xe3c8('0x3e')]);_0x16ed1f[_0xe3c8('0x4a')]=_[_0xe3c8('0x40')](_0x16ed1f['model'],_0x16ed1f[_0xe3c8('0x3e')]);_0x449cca[_0xe3c8('0x41')]=_[_0xe3c8('0x40')](_0x16ed1f[_0xe3c8('0x3c')],qs[_0xe3c8('0x42')](_0x17c257[_0xe3c8('0x3e')]['fields']));_0x449cca[_0xe3c8('0x41')]=_0x449cca[_0xe3c8('0x41')][_0xe3c8('0x43')]?_0x449cca[_0xe3c8('0x41')]:_0x16ed1f[_0xe3c8('0x3c')];if(_0x17c257['query']['includeAll']){_0x449cca[_0xe3c8('0x51')]=[{'all':!![]}];}_0x449cca=_[_0xe3c8('0x4c')]({},_0x449cca,_0x17c257[_0xe3c8('0x4f')]);return db[_0xe3c8('0x37')][_0xe3c8('0x53')](_0x449cca)[_0xe3c8('0x32')](handleEntityNotFound(_0x3bbd2a,null))[_0xe3c8('0x32')](respondWithResult(_0x3bbd2a,null))[_0xe3c8('0x27')](handleError(_0x3bbd2a,null));};exports[_0xe3c8('0x54')]=function(_0x4d787d,_0x41727b){return db[_0xe3c8('0x37')][_0xe3c8('0x54')](_0x4d787d['body'],{})['then'](respondWithResult(_0x41727b,0xc9))['catch'](handleError(_0x41727b,null));};exports[_0xe3c8('0x31')]=function(_0x1ecdc0,_0x4bebd9){if(_0x1ecdc0[_0xe3c8('0x55')]['id']){delete _0x1ecdc0[_0xe3c8('0x55')]['id'];}return db['VtigerAccount']['find']({'where':{'id':_0x1ecdc0['params']['id']}})['then'](handleEntityNotFound(_0x4bebd9,null))['then'](saveUpdates(_0x1ecdc0[_0xe3c8('0x55')],null))['then'](respondWithResult(_0x4bebd9,null))[_0xe3c8('0x27')](handleError(_0x4bebd9,null));};exports[_0xe3c8('0x33')]=function(_0xfca356,_0x46ca6e){return db[_0xe3c8('0x37')][_0xe3c8('0x53')]({'where':{'id':_0xfca356[_0xe3c8('0x52')]['id']}})['then'](handleEntityNotFound(_0x46ca6e,null))[_0xe3c8('0x32')](removeEntity(_0x46ca6e,null))[_0xe3c8('0x27')](handleError(_0x46ca6e,null));};exports[_0xe3c8('0x56')]=function(_0xdb2ac1,_0x4e38fa,_0x1a6783){var _0x3097c2={};var _0x1d0df={};var _0x27091c;var _0xc7804b;return db['VtigerAccount']['findOne']({'where':{'id':_0xdb2ac1[_0xe3c8('0x52')]['id']}})[_0xe3c8('0x32')](handleEntityNotFound(_0x4e38fa,null))[_0xe3c8('0x32')](function(_0x55671a){if(_0x55671a){_0x27091c=_0x55671a;_0x1d0df[_0xe3c8('0x3c')]=_[_0xe3c8('0x3f')](db[_0xe3c8('0x57')]['rawAttributes']);_0x1d0df[_0xe3c8('0x3e')]=_['keys'](_0xdb2ac1[_0xe3c8('0x3e')]);_0x1d0df[_0xe3c8('0x4a')]=_[_0xe3c8('0x40')](_0x1d0df[_0xe3c8('0x3c')],_0x1d0df['query']);_0x3097c2[_0xe3c8('0x41')]=_[_0xe3c8('0x40')](_0x1d0df[_0xe3c8('0x3c')],qs[_0xe3c8('0x42')](_0xdb2ac1[_0xe3c8('0x3e')][_0xe3c8('0x42')]));_0x3097c2[_0xe3c8('0x41')]=_0x3097c2['attributes'][_0xe3c8('0x43')]?_0x3097c2[_0xe3c8('0x41')]:_0x1d0df[_0xe3c8('0x3c')];_0x3097c2[_0xe3c8('0x47')]=qs[_0xe3c8('0x48')](_0xdb2ac1['query'][_0xe3c8('0x48')]);_0x3097c2[_0xe3c8('0x49')]=qs[_0xe3c8('0x4a')](_[_0xe3c8('0x4b')](_0xdb2ac1['query'],_0x1d0df[_0xe3c8('0x4a')]));if(_0xdb2ac1[_0xe3c8('0x3e')][_0xe3c8('0x4e')]){_0x3097c2[_0xe3c8('0x49')]=_[_0xe3c8('0x4c')](_0x3097c2[_0xe3c8('0x49')],{'$or':_[_0xe3c8('0x3d')](_0x3097c2['attributes'],function(_0x15a0eb){var _0x43d8c9={};_0x43d8c9[_0x15a0eb]={'$like':'%'+_0xdb2ac1['query'][_0xe3c8('0x4e')]+'%'};return _0x43d8c9;})});}_0x3097c2=_[_0xe3c8('0x4c')]({},_0x3097c2,_0xdb2ac1['options']);return _0x27091c[_0xe3c8('0x56')](_0x3097c2);}})[_0xe3c8('0x32')](function(_0x564b08){if(_0x564b08){_0xc7804b=_0x564b08[_0xe3c8('0x43')];if(!_0xdb2ac1[_0xe3c8('0x3e')][_0xe3c8('0x44')](_0xe3c8('0x45'))){_0x3097c2['limit']=qs[_0xe3c8('0x46')](_0xdb2ac1['query'][_0xe3c8('0x46')]);_0x3097c2[_0xe3c8('0x2c')]=qs[_0xe3c8('0x2c')](_0xdb2ac1[_0xe3c8('0x3e')]['offset']);}return _0x27091c[_0xe3c8('0x56')](_0x3097c2);}})[_0xe3c8('0x32')](function(_0x54f692){if(_0x54f692){return _0x54f692?{'count':_0xc7804b,'rows':_0x54f692}:null;}})[_0xe3c8('0x32')](respondWithResult(_0x4e38fa,null))[_0xe3c8('0x27')](handleError(_0x4e38fa,null));};exports['addConfiguration']=function(_0x390b5d,_0x15247a,_0x41cae0){if(_0x390b5d['body']['id']){delete _0x390b5d[_0xe3c8('0x55')]['id'];}return db['VtigerAccount']['findOne']({'where':{'id':_0x390b5d[_0xe3c8('0x52')]['id']}})[_0xe3c8('0x32')](handleEntityNotFound(_0x15247a,null))[_0xe3c8('0x32')](function(_0x594b57){if(_0x594b57){_0x390b5d[_0xe3c8('0x55')][_0xe3c8('0x58')]=_0x594b57['id'];_0x390b5d[_0xe3c8('0x55')]['Subjects']=integrations['getSubjects'](_0x390b5d[_0xe3c8('0x55')][_0xe3c8('0x59')],_0x390b5d['body'][_0xe3c8('0x3a')]);_0x390b5d['body']['Descriptions']=integrations[_0xe3c8('0x5a')](_0x390b5d[_0xe3c8('0x55')][_0xe3c8('0x59')],_0x390b5d[_0xe3c8('0x55')][_0xe3c8('0x3a')]);return db[_0xe3c8('0x57')][_0xe3c8('0x54')](_0x390b5d[_0xe3c8('0x55')],{'include':[{'model':db[_0xe3c8('0x5b')],'as':'Subjects'},{'model':db[_0xe3c8('0x5b')],'as':'Descriptions'}]});}return null;})[_0xe3c8('0x32')](respondWithResult(_0x15247a,null))[_0xe3c8('0x27')](handleError(_0x15247a,null));};var md5=require(_0xe3c8('0x5c'));exports['getFields']=function(_0x57d99e,_0xbeb8e4,_0xd5d6e3){var _0x13c3a4=null;var _0x390fe7=null;var _0x106ee4=null;var _0x38a33a=null;var _0x31d572='';return db['VtigerAccount'][_0xe3c8('0x5d')]({'where':{'id':_0x57d99e['params']['id']},'attributes':['id','name','username','description',_0xe3c8('0x5e'),_0xe3c8('0x5f'),_0xe3c8('0x60'),_0xe3c8('0x61')]})[_0xe3c8('0x32')](handleEntityNotFound(_0xbeb8e4,null))[_0xe3c8('0x32')](function(_0x29045f){if(_0x29045f){_0x13c3a4=_0x29045f[_0xe3c8('0x62')];_0x390fe7=_0x29045f[_0xe3c8('0x61')];_0x106ee4=_0x29045f[_0xe3c8('0x5e')];_0x31d572=_0x29045f[_0xe3c8('0x5f')];var _0x2d0eca=_0x31d572[_0xe3c8('0x63')](-0x1);if(_0x2d0eca==='/'){_0x31d572=_0x31d572['substring'](0x0,_0x31d572['lastIndexOf'](_0x2d0eca));}_0x38a33a=util[_0xe3c8('0x64')](_0xe3c8('0x65'),_0x31d572);var _0x3646b3={'method':_0xe3c8('0x66'),'uri':_0x38a33a,'qs':{'operation':_0xe3c8('0x67'),'username':_0x29045f[_0xe3c8('0x62')]},'json':!![]};return rp(_0x3646b3);}})[_0xe3c8('0x32')](function(_0x2db58f){if(_0x2db58f[_0xe3c8('0x68')]){var _0x1f1967={'method':'POST','uri':_0x38a33a,'form':{'operation':_0xe3c8('0x69'),'username':_0x13c3a4,'accessKey':md5(_0x2db58f[_0xe3c8('0x26')][_0xe3c8('0x6a')]+_0x390fe7)},'json':!![]};return rp(_0x1f1967);}})[_0xe3c8('0x32')](function(_0x3588){if(_0x3588['success']){var _0x22879b={'method':_0xe3c8('0x66'),'uri':_0x38a33a,'qs':{'operation':'describe','username':_0x13c3a4,'sessionName':_0x3588[_0xe3c8('0x26')][_0xe3c8('0x6b')],'elementType':_0x106ee4},'json':!![]};return rp(_0x22879b);}})[_0xe3c8('0x32')](function(_0x221aa0){if(_0x221aa0[_0xe3c8('0x68')]){var _0x3581cf=[_0xe3c8('0x6c'),_0xe3c8('0x6d'),'owner'];_['remove'](_0x221aa0[_0xe3c8('0x26')][_0xe3c8('0x42')],function(_0x4ee826){return _0x3581cf['includes'](_0x4ee826[_0xe3c8('0x3a')][_0xe3c8('0x36')]);});_['remove'](_0x221aa0[_0xe3c8('0x26')][_0xe3c8('0x42')],function(_0xe9d3a1){return _0xe9d3a1[_0xe3c8('0x6e')]==='false';});return{'count':_0x221aa0['result'][_0xe3c8('0x42')][_0xe3c8('0x43')],'rows':_[_0xe3c8('0x3d')](_0x221aa0[_0xe3c8('0x26')][_0xe3c8('0x42')],function(_0x38d006){return{'id':_0x38d006['name'],'name':_0x38d006[_0xe3c8('0x6f')],'custom':_[_0xe3c8('0x70')](_0x38d006['name'],_0xe3c8('0x71'))?!![]:![],'options':_0x38d006[_0xe3c8('0x3a')][_0xe3c8('0x36')]===_0xe3c8('0x72')&&_0x38d006['type'][_0xe3c8('0x73')]['length']>0x0?_['map'](_0x38d006[_0xe3c8('0x3a')]['picklistValues'],function(_0x4eec73){return{'name':_0x4eec73[_0xe3c8('0x6f')],'value':_0x4eec73[_0xe3c8('0x74')]};}):[]};})};}})[_0xe3c8('0x32')](respondWithResult(_0xbeb8e4,null))[_0xe3c8('0x27')](function(_0x45f21c){console['log']('vTiger\x20error:\x20'+_0x45f21c);var _0x529323=_0x57d99e[_0xe3c8('0x3e')][_0xe3c8('0x19')]?0x1f4:_0x45f21c[_0xe3c8('0x75')]||0x1f4;logger['error'](_0xe3c8('0x76'),_0xe3c8('0x77'),_0x529323,JSON['stringify'](_0x45f21c));delete _0x45f21c['name'];if(_0x529323===0x191){_0x529323=0x190;}_0xbeb8e4['status'](_0x529323)[_0xe3c8('0x78')](_0x57d99e[_0xe3c8('0x3e')]['test']?{'message':'Wrong\x20credentials','statusCode':_0x45f21c[_0xe3c8('0x75')]}:_0x45f21c);});};
\ No newline at end of file
+var _0x8d9e=['count','offset','set','Content-Range','save','update','end','stack','map','VtigerAccount','rawAttributes','type','name','query','keys','intersection','model','fields','attributes','nolimit','limit','order','sort','where','filters','pick','filter','merge','VIRTUAL','includeAll','include','findAll','rows','show','find','create','body','params','destroy','getConfigurations','findOne','VtigerConfiguration','length','AccountId','Subjects','getSubjects','channel','getDescriptions','VtigerField','md5','getFields','username','moduleName','remoteUri','serverUrl','accessKey','slice','substring','format','%s/webservice.php','success','POST','login','result','token','GET','describe','sessionName','owner','remove','includes','editable','false','startsWith','picklistValues','label','value','vTiger\x20error:\x20','statusCode','getFields,\x20%s,\x20%s,\x20%s','stringify','send','html-pdf','eml-format','rimraf','fast-json-patch','request-promise','moment','bluebird','mustache','util','path','to-csv','squel','crypto','jsforce','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/advancedSearch','../../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~!@#$%^&-_=+[{]}.','request','then','VtigerAccount,\x20%s,\x20%s','request\x20sent','debug','VtigerAccount,\x20%s,\x20%s,\x20%s','error','code','message','info','catch','sendStatus','status','json'];(function(_0x35d840,_0x2a1192){var _0x9cd8b1=function(_0x2e3fb8){while(--_0x2e3fb8){_0x35d840['push'](_0x35d840['shift']());}};_0x9cd8b1(++_0x2a1192);}(_0x8d9e,0x150));var _0xe8d9=function(_0xe672c8,_0x3ae505){_0xe672c8=_0xe672c8-0x0;var _0x104b7f=_0x8d9e[_0xe672c8];return _0x104b7f;};'use strict';var pdf=require(_0xe8d9('0x0'));var emlformat=require(_0xe8d9('0x1'));var rimraf=require(_0xe8d9('0x2'));var zipdir=require('zip-dir');var jsonpatch=require(_0xe8d9('0x3'));var rp=require(_0xe8d9('0x4'));var moment=require(_0xe8d9('0x5'));var BPromise=require(_0xe8d9('0x6'));var Mustache=require(_0xe8d9('0x7'));var util=require(_0xe8d9('0x8'));var path=require(_0xe8d9('0x9'));var sox=require('sox');var csv=require(_0xe8d9('0xa'));var ejs=require('ejs');var fs=require('fs');var _=require('lodash');var squel=require(_0xe8d9('0xb'));var crypto=require(_0xe8d9('0xc'));var jsforce=require(_0xe8d9('0xd'));var deskjs=require('desk.js');var toCsv=require('to-csv');var querystring=require(_0xe8d9('0xe'));var Papa=require(_0xe8d9('0xf'));var Redis=require(_0xe8d9('0x10'));var authService=require(_0xe8d9('0x11'));var qs=require('../../components/parsers/qs');var as=require(_0xe8d9('0x12'));var hardwareService=require(_0xe8d9('0x13'));var logger=require(_0xe8d9('0x14'))(_0xe8d9('0x15'));var utils=require(_0xe8d9('0x16'));var config=require(_0xe8d9('0x17'));var db=require(_0xe8d9('0x18'))['db'];var integrations=require('../../components/integrations/configuration');var jayson=require(_0xe8d9('0x19'));var client=jayson[_0xe8d9('0x1a')]['http']({'port':0x232a});function checkPasswordPattern(_0x7470,_0x25dae7,_0x21a91e){if(_0x21a91e){var _0x1c4424=new RegExp(/(?=.*[a-z])(?=.*[A-Z])(?=.*[0-9])(?=.*[?!@#\$%\^&\*~\-_=+[{\]\}])(?=.{8,})/);if(_0x1c4424[_0xe8d9('0x1b')](_0x25dae7)){return _0x7470;}else{throw new db[(_0xe8d9('0x1c'))][(_0xe8d9('0x1d'))](_0xe8d9('0x1e'));}}else{return _0x7470;}}function respondWithRpcPromise(_0x25809b,_0x12461e,_0x1410ac,_0xc368c0){return new BPromise(function(_0x1f5bb9,_0x43c13e){var _0x6700ea=_0xc368c0||client;return _0x6700ea[_0xe8d9('0x1f')](_0x25809b,_0x1410ac)[_0xe8d9('0x20')](function(_0x41eae4){logger['info'](_0xe8d9('0x21'),_0x12461e,_0xe8d9('0x22'));logger[_0xe8d9('0x23')](_0xe8d9('0x24'),_0x12461e,_0xe8d9('0x22'),JSON['stringify'](_0x41eae4));if(_0x41eae4['error']){if(_0x41eae4[_0xe8d9('0x25')][_0xe8d9('0x26')]===0x1f4){logger[_0xe8d9('0x25')](_0xe8d9('0x21'),_0x12461e,_0x41eae4[_0xe8d9('0x25')][_0xe8d9('0x27')]);return _0x43c13e(_0x41eae4['error']['message']);}logger['error'](_0xe8d9('0x21'),_0x12461e,_0x41eae4['error'][_0xe8d9('0x27')]);return _0x1f5bb9(_0x41eae4['error']['message']);}else{logger[_0xe8d9('0x28')](_0xe8d9('0x21'),_0x12461e,_0xe8d9('0x22'));_0x1f5bb9(_0x41eae4['result'][_0xe8d9('0x27')]);}})[_0xe8d9('0x29')](function(_0x3efdee){logger['error'](_0xe8d9('0x21'),_0x12461e,_0x3efdee);_0x43c13e(_0x3efdee);});});}function respondWithStatusCode(_0x1f31a9,_0x56c2bd){_0x56c2bd=_0x56c2bd||0xcc;return function(_0x501421){if(_0x501421){return _0x1f31a9[_0xe8d9('0x2a')](_0x56c2bd);}return _0x1f31a9[_0xe8d9('0x2b')](_0x56c2bd)['end']();};}function respondWithResult(_0xf7ecbe,_0x497bd5){_0x497bd5=_0x497bd5||0xc8;return function(_0x9ae21c){if(_0x9ae21c){return _0xf7ecbe['status'](_0x497bd5)[_0xe8d9('0x2c')](_0x9ae21c);}};}function respondWithFilteredResult(_0x113929,_0x41a736){return function(_0x441218){if(_0x441218){var _0xd1903f=_0x441218[_0xe8d9('0x2d')],_0x58dec1=_0x41a736['offset'],_0x5e9559=_0x41a736[_0xe8d9('0x2e')]+_0x41a736['limit'],_0x29b476;if(_0x5e9559>=_0xd1903f){_0x5e9559=_0xd1903f;_0x29b476=0xc8;}else{_0x29b476=0xce;}_0x113929[_0xe8d9('0x2b')](_0x29b476);return _0x113929[_0xe8d9('0x2f')](_0xe8d9('0x30'),_0x58dec1+'-'+_0x5e9559+'/'+_0xd1903f)['json'](_0x441218);}return null;};}function patchUpdates(_0x3ded1d){return function(_0x13a7b2){try{jsonpatch['apply'](_0x13a7b2,_0x3ded1d,!![]);}catch(_0x31764f){return BPromise['reject'](_0x31764f);}return _0x13a7b2[_0xe8d9('0x31')]();};}function saveUpdates(_0x4bbc06,_0x449e12){return function(_0xe1b957){if(_0xe1b957){return _0xe1b957[_0xe8d9('0x32')](_0x4bbc06)[_0xe8d9('0x20')](function(_0x129551){return _0x129551;});}return null;};}function removeEntity(_0x2ab36c,_0x175f85){return function(_0x95ed7c){if(_0x95ed7c){return _0x95ed7c['destroy']()[_0xe8d9('0x20')](function(){_0x2ab36c[_0xe8d9('0x2b')](0xcc)[_0xe8d9('0x33')]();});}};}function handleEntityNotFound(_0x5ebe7b,_0xcc58f){return function(_0x4a061c){if(!_0x4a061c){_0x5ebe7b[_0xe8d9('0x2a')](0x194);}return _0x4a061c;};}function handleError(_0x437d53,_0x1b10dd){_0x1b10dd=_0x1b10dd||0x1f4;return function(_0x3f8cd6){logger[_0xe8d9('0x25')](_0x3f8cd6[_0xe8d9('0x34')]);if(_0x3f8cd6['name']){delete _0x3f8cd6['name'];}_0x437d53[_0xe8d9('0x2b')](_0x1b10dd)['send'](_0x3f8cd6);};}exports['index']=function(_0x245662,_0x511a9a){var _0x380561={},_0x4f85d2={},_0x3b7845={'count':0x0,'rows':[]};var _0x18ecdc=_[_0xe8d9('0x35')](db[_0xe8d9('0x36')][_0xe8d9('0x37')],function(_0x453568){return{'name':_0x453568['fieldName'],'type':_0x453568[_0xe8d9('0x38')]['key']};});_0x4f85d2['model']=_['map'](_0x18ecdc,_0xe8d9('0x39'));_0x4f85d2[_0xe8d9('0x3a')]=_[_0xe8d9('0x3b')](_0x245662[_0xe8d9('0x3a')]);_0x4f85d2['filters']=_[_0xe8d9('0x3c')](_0x4f85d2['model'],_0x4f85d2[_0xe8d9('0x3a')]);_0x380561['attributes']=_[_0xe8d9('0x3c')](_0x4f85d2[_0xe8d9('0x3d')],qs[_0xe8d9('0x3e')](_0x245662[_0xe8d9('0x3a')][_0xe8d9('0x3e')]));_0x380561[_0xe8d9('0x3f')]=_0x380561[_0xe8d9('0x3f')]['length']?_0x380561[_0xe8d9('0x3f')]:_0x4f85d2[_0xe8d9('0x3d')];if(!_0x245662['query']['hasOwnProperty'](_0xe8d9('0x40'))){_0x380561[_0xe8d9('0x41')]=qs[_0xe8d9('0x41')](_0x245662[_0xe8d9('0x3a')][_0xe8d9('0x41')]);_0x380561[_0xe8d9('0x2e')]=qs[_0xe8d9('0x2e')](_0x245662['query'][_0xe8d9('0x2e')]);}_0x380561[_0xe8d9('0x42')]=qs[_0xe8d9('0x43')](_0x245662['query'][_0xe8d9('0x43')]);_0x380561[_0xe8d9('0x44')]=qs[_0xe8d9('0x45')](_[_0xe8d9('0x46')](_0x245662[_0xe8d9('0x3a')],_0x4f85d2['filters']));if(_0x245662[_0xe8d9('0x3a')][_0xe8d9('0x47')]){_0x380561[_0xe8d9('0x44')]=_[_0xe8d9('0x48')](_0x380561[_0xe8d9('0x44')],{'$or':_[_0xe8d9('0x35')](_0x18ecdc,function(_0x5508e8){if(_0x5508e8[_0xe8d9('0x38')]!==_0xe8d9('0x49')){var _0x198115={};_0x198115[_0x5508e8[_0xe8d9('0x39')]]={'$like':'%'+_0x245662[_0xe8d9('0x3a')][_0xe8d9('0x47')]+'%'};return _0x198115;}})});}_0x380561=_[_0xe8d9('0x48')]({},_0x380561,_0x245662['options']);var _0x16c9d9={'where':_0x380561[_0xe8d9('0x44')]};return db['VtigerAccount']['count'](_0x16c9d9)['then'](function(_0x4bccd9){_0x3b7845[_0xe8d9('0x2d')]=_0x4bccd9;if(_0x245662[_0xe8d9('0x3a')][_0xe8d9('0x4a')]){_0x380561[_0xe8d9('0x4b')]=[{'all':!![]}];}return db[_0xe8d9('0x36')][_0xe8d9('0x4c')](_0x380561);})['then'](function(_0x404b4d){_0x3b7845[_0xe8d9('0x4d')]=_0x404b4d;return _0x3b7845;})[_0xe8d9('0x20')](respondWithFilteredResult(_0x511a9a,_0x380561))[_0xe8d9('0x29')](handleError(_0x511a9a,null));};exports[_0xe8d9('0x4e')]=function(_0x4d4ba5,_0x2fc897){var _0x511e8c={'raw':![],'where':{'id':_0x4d4ba5['params']['id']}},_0x2f28dc={};_0x2f28dc['model']=_['keys'](db[_0xe8d9('0x36')][_0xe8d9('0x37')]);_0x2f28dc[_0xe8d9('0x3a')]=_[_0xe8d9('0x3b')](_0x4d4ba5[_0xe8d9('0x3a')]);_0x2f28dc['filters']=_['intersection'](_0x2f28dc[_0xe8d9('0x3d')],_0x2f28dc[_0xe8d9('0x3a')]);_0x511e8c[_0xe8d9('0x3f')]=_[_0xe8d9('0x3c')](_0x2f28dc['model'],qs[_0xe8d9('0x3e')](_0x4d4ba5[_0xe8d9('0x3a')][_0xe8d9('0x3e')]));_0x511e8c[_0xe8d9('0x3f')]=_0x511e8c[_0xe8d9('0x3f')]['length']?_0x511e8c['attributes']:_0x2f28dc[_0xe8d9('0x3d')];if(_0x4d4ba5[_0xe8d9('0x3a')][_0xe8d9('0x4a')]){_0x511e8c[_0xe8d9('0x4b')]=[{'all':!![]}];}_0x511e8c=_['merge']({},_0x511e8c,_0x4d4ba5['options']);return db['VtigerAccount'][_0xe8d9('0x4f')](_0x511e8c)[_0xe8d9('0x20')](handleEntityNotFound(_0x2fc897,null))[_0xe8d9('0x20')](respondWithResult(_0x2fc897,null))[_0xe8d9('0x29')](handleError(_0x2fc897,null));};exports['create']=function(_0x496eb3,_0x947e45){return db[_0xe8d9('0x36')][_0xe8d9('0x50')](_0x496eb3[_0xe8d9('0x51')],{})[_0xe8d9('0x20')](respondWithResult(_0x947e45,0xc9))[_0xe8d9('0x29')](handleError(_0x947e45,null));};exports[_0xe8d9('0x32')]=function(_0x310eb4,_0x33a35e){if(_0x310eb4[_0xe8d9('0x51')]['id']){delete _0x310eb4['body']['id'];}return db[_0xe8d9('0x36')][_0xe8d9('0x4f')]({'where':{'id':_0x310eb4[_0xe8d9('0x52')]['id']}})[_0xe8d9('0x20')](handleEntityNotFound(_0x33a35e,null))[_0xe8d9('0x20')](saveUpdates(_0x310eb4[_0xe8d9('0x51')],null))['then'](respondWithResult(_0x33a35e,null))[_0xe8d9('0x29')](handleError(_0x33a35e,null));};exports[_0xe8d9('0x53')]=function(_0x48bbdc,_0x18e46d){return db['VtigerAccount'][_0xe8d9('0x4f')]({'where':{'id':_0x48bbdc[_0xe8d9('0x52')]['id']}})[_0xe8d9('0x20')](handleEntityNotFound(_0x18e46d,null))[_0xe8d9('0x20')](removeEntity(_0x18e46d,null))[_0xe8d9('0x29')](handleError(_0x18e46d,null));};exports[_0xe8d9('0x54')]=function(_0x378d41,_0x58e039,_0x7e2099){var _0x52827d={};var _0x3b393a={};var _0x4248ff;var _0x55b4a7;return db[_0xe8d9('0x36')][_0xe8d9('0x55')]({'where':{'id':_0x378d41[_0xe8d9('0x52')]['id']}})[_0xe8d9('0x20')](handleEntityNotFound(_0x58e039,null))['then'](function(_0x2ba21f){if(_0x2ba21f){_0x4248ff=_0x2ba21f;_0x3b393a[_0xe8d9('0x3d')]=_[_0xe8d9('0x3b')](db[_0xe8d9('0x56')][_0xe8d9('0x37')]);_0x3b393a['query']=_['keys'](_0x378d41[_0xe8d9('0x3a')]);_0x3b393a[_0xe8d9('0x45')]=_['intersection'](_0x3b393a[_0xe8d9('0x3d')],_0x3b393a[_0xe8d9('0x3a')]);_0x52827d['attributes']=_[_0xe8d9('0x3c')](_0x3b393a[_0xe8d9('0x3d')],qs[_0xe8d9('0x3e')](_0x378d41[_0xe8d9('0x3a')][_0xe8d9('0x3e')]));_0x52827d['attributes']=_0x52827d['attributes'][_0xe8d9('0x57')]?_0x52827d[_0xe8d9('0x3f')]:_0x3b393a[_0xe8d9('0x3d')];_0x52827d[_0xe8d9('0x42')]=qs['sort'](_0x378d41[_0xe8d9('0x3a')][_0xe8d9('0x43')]);_0x52827d[_0xe8d9('0x44')]=qs[_0xe8d9('0x45')](_['pick'](_0x378d41[_0xe8d9('0x3a')],_0x3b393a[_0xe8d9('0x45')]));if(_0x378d41[_0xe8d9('0x3a')][_0xe8d9('0x47')]){_0x52827d[_0xe8d9('0x44')]=_['merge'](_0x52827d[_0xe8d9('0x44')],{'$or':_['map'](_0x52827d[_0xe8d9('0x3f')],function(_0x524863){var _0x1bb53a={};_0x1bb53a[_0x524863]={'$like':'%'+_0x378d41[_0xe8d9('0x3a')][_0xe8d9('0x47')]+'%'};return _0x1bb53a;})});}_0x52827d=_[_0xe8d9('0x48')]({},_0x52827d,_0x378d41['options']);return _0x4248ff[_0xe8d9('0x54')](_0x52827d);}})[_0xe8d9('0x20')](function(_0x36d544){if(_0x36d544){_0x55b4a7=_0x36d544[_0xe8d9('0x57')];if(!_0x378d41[_0xe8d9('0x3a')]['hasOwnProperty'](_0xe8d9('0x40'))){_0x52827d[_0xe8d9('0x41')]=qs[_0xe8d9('0x41')](_0x378d41['query'][_0xe8d9('0x41')]);_0x52827d['offset']=qs['offset'](_0x378d41[_0xe8d9('0x3a')]['offset']);}return _0x4248ff['getConfigurations'](_0x52827d);}})[_0xe8d9('0x20')](function(_0x1f0cda){if(_0x1f0cda){return _0x1f0cda?{'count':_0x55b4a7,'rows':_0x1f0cda}:null;}})[_0xe8d9('0x20')](respondWithResult(_0x58e039,null))['catch'](handleError(_0x58e039,null));};exports['addConfiguration']=function(_0x38036e,_0x51eec4,_0x13b831){if(_0x38036e[_0xe8d9('0x51')]['id']){delete _0x38036e[_0xe8d9('0x51')]['id'];}return db[_0xe8d9('0x36')]['findOne']({'where':{'id':_0x38036e['params']['id']}})[_0xe8d9('0x20')](handleEntityNotFound(_0x51eec4,null))[_0xe8d9('0x20')](function(_0x5dedc4){if(_0x5dedc4){_0x38036e[_0xe8d9('0x51')][_0xe8d9('0x58')]=_0x5dedc4['id'];_0x38036e[_0xe8d9('0x51')][_0xe8d9('0x59')]=integrations[_0xe8d9('0x5a')](_0x38036e[_0xe8d9('0x51')][_0xe8d9('0x5b')],_0x38036e[_0xe8d9('0x51')][_0xe8d9('0x38')]);_0x38036e[_0xe8d9('0x51')]['Descriptions']=integrations[_0xe8d9('0x5c')](_0x38036e[_0xe8d9('0x51')]['channel'],_0x38036e[_0xe8d9('0x51')][_0xe8d9('0x38')]);return db[_0xe8d9('0x56')][_0xe8d9('0x50')](_0x38036e['body'],{'include':[{'model':db[_0xe8d9('0x5d')],'as':_0xe8d9('0x59')},{'model':db[_0xe8d9('0x5d')],'as':'Descriptions'}]});}return null;})[_0xe8d9('0x20')](respondWithResult(_0x51eec4,null))[_0xe8d9('0x29')](handleError(_0x51eec4,null));};var md5=require(_0xe8d9('0x5e'));exports[_0xe8d9('0x5f')]=function(_0x424b3a,_0x45b7ed,_0x39e736){var _0x164cef=null;var _0x319017=null;var _0x34b064=null;var _0x4c5dd4=null;var _0x1089cc='';return db[_0xe8d9('0x36')][_0xe8d9('0x55')]({'where':{'id':_0x424b3a[_0xe8d9('0x52')]['id']},'attributes':['id','name',_0xe8d9('0x60'),'description',_0xe8d9('0x61'),_0xe8d9('0x62'),_0xe8d9('0x63'),_0xe8d9('0x64')]})[_0xe8d9('0x20')](handleEntityNotFound(_0x45b7ed,null))[_0xe8d9('0x20')](function(_0x2ea3d3){if(_0x2ea3d3){_0x164cef=_0x2ea3d3['username'];_0x319017=_0x2ea3d3[_0xe8d9('0x64')];_0x34b064=_0x2ea3d3[_0xe8d9('0x61')];_0x1089cc=_0x2ea3d3[_0xe8d9('0x62')];var _0x2b6890=_0x1089cc[_0xe8d9('0x65')](-0x1);if(_0x2b6890==='/'){_0x1089cc=_0x1089cc[_0xe8d9('0x66')](0x0,_0x1089cc['lastIndexOf'](_0x2b6890));}_0x4c5dd4=util[_0xe8d9('0x67')](_0xe8d9('0x68'),_0x1089cc);var _0x43d94f={'method':'GET','uri':_0x4c5dd4,'qs':{'operation':'getchallenge','username':_0x2ea3d3[_0xe8d9('0x60')]},'json':!![]};return rp(_0x43d94f);}})['then'](function(_0x4c7a9e){if(_0x4c7a9e[_0xe8d9('0x69')]){var _0x1fe828={'method':_0xe8d9('0x6a'),'uri':_0x4c5dd4,'form':{'operation':_0xe8d9('0x6b'),'username':_0x164cef,'accessKey':md5(_0x4c7a9e[_0xe8d9('0x6c')][_0xe8d9('0x6d')]+_0x319017)},'json':!![]};return rp(_0x1fe828);}})[_0xe8d9('0x20')](function(_0x5e371d){if(_0x5e371d[_0xe8d9('0x69')]){var _0x186114={'method':_0xe8d9('0x6e'),'uri':_0x4c5dd4,'qs':{'operation':_0xe8d9('0x6f'),'username':_0x164cef,'sessionName':_0x5e371d[_0xe8d9('0x6c')][_0xe8d9('0x70')],'elementType':_0x34b064},'json':!![]};return rp(_0x186114);}})['then'](function(_0x2abcde){if(_0x2abcde[_0xe8d9('0x69')]){var _0x19205e=['autogenerated','reference',_0xe8d9('0x71')];_[_0xe8d9('0x72')](_0x2abcde[_0xe8d9('0x6c')][_0xe8d9('0x3e')],function(_0x286102){return _0x19205e[_0xe8d9('0x73')](_0x286102[_0xe8d9('0x38')][_0xe8d9('0x39')]);});_[_0xe8d9('0x72')](_0x2abcde['result'][_0xe8d9('0x3e')],function(_0x156e8e){return _0x156e8e[_0xe8d9('0x74')]===_0xe8d9('0x75');});return{'count':_0x2abcde['result']['fields'][_0xe8d9('0x57')],'rows':_[_0xe8d9('0x35')](_0x2abcde[_0xe8d9('0x6c')][_0xe8d9('0x3e')],function(_0x110084){return{'id':_0x110084[_0xe8d9('0x39')],'name':_0x110084['label'],'custom':_[_0xe8d9('0x76')](_0x110084[_0xe8d9('0x39')],'cf_')?!![]:![],'options':_0x110084[_0xe8d9('0x38')]['name']==='picklist'&&_0x110084[_0xe8d9('0x38')][_0xe8d9('0x77')][_0xe8d9('0x57')]>0x0?_[_0xe8d9('0x35')](_0x110084[_0xe8d9('0x38')][_0xe8d9('0x77')],function(_0x2b1866){return{'name':_0x2b1866[_0xe8d9('0x78')],'value':_0x2b1866[_0xe8d9('0x79')]};}):[]};})};}})[_0xe8d9('0x20')](respondWithResult(_0x45b7ed,null))[_0xe8d9('0x29')](function(_0x57b4e1){console['log'](_0xe8d9('0x7a')+_0x57b4e1);var _0x1d63ef=_0x424b3a[_0xe8d9('0x3a')][_0xe8d9('0x1b')]?0x1f4:_0x57b4e1[_0xe8d9('0x7b')]||0x1f4;logger[_0xe8d9('0x25')](_0xe8d9('0x7c'),_0xe8d9('0x5f'),_0x1d63ef,JSON[_0xe8d9('0x7d')](_0x57b4e1));delete _0x57b4e1[_0xe8d9('0x39')];if(_0x1d63ef===0x191){_0x1d63ef=0x190;}_0x45b7ed[_0xe8d9('0x2b')](_0x1d63ef)[_0xe8d9('0x7e')](_0x424b3a[_0xe8d9('0x3a')]['test']?{'message':'Wrong\x20credentials','statusCode':_0x57b4e1[_0xe8d9('0x7b')]}:_0x57b4e1);});};
\ No newline at end of file
diff --git a/server/api/intVtigerAccount/intVtigerAccount.model.js b/server/api/intVtigerAccount/intVtigerAccount.model.js
index fdb3f73..5454e36 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 _0x3720=['api','moment','bluebird','request-promise','path','../../config/environment','./intVtigerAccount.attributes','../../components/integrations/configuration','define','VtigerAccount','util','../../config/logger'];(function(_0x17df74,_0x500ba1){var _0xdd5476=function(_0x4881f0){while(--_0x4881f0){_0x17df74['push'](_0x17df74['shift']());}};_0xdd5476(++_0x500ba1);}(_0x3720,0xa6));var _0x0372=function(_0x110c3d,_0x12ee06){_0x110c3d=_0x110c3d-0x0;var _0x226d67=_0x3720[_0x110c3d];return _0x226d67;};'use strict';var _=require('lodash');var util=require(_0x0372('0x0'));var logger=require(_0x0372('0x1'))(_0x0372('0x2'));var moment=require(_0x0372('0x3'));var BPromise=require(_0x0372('0x4'));var rp=require(_0x0372('0x5'));var fs=require('fs');var path=require(_0x0372('0x6'));var rimraf=require('rimraf');var config=require(_0x0372('0x7'));var attributes=require(_0x0372('0x8'));var integrations=require(_0x0372('0x9'));module['exports']=function(_0x55387a,_0x48a2c9){return _0x55387a[_0x0372('0xa')](_0x0372('0xb'),attributes,{'tableName':'int_vtiger_accounts','paranoid':![],'indexes':[],'timestamps':!![]});};
\ No newline at end of file
+var _0xc724=['path','rimraf','exports','define','VtigerAccount','util','../../config/logger','moment','request-promise'];(function(_0x4eb832,_0x324bff){var _0x2e5927=function(_0x4687ce){while(--_0x4687ce){_0x4eb832['push'](_0x4eb832['shift']());}};_0x2e5927(++_0x324bff);}(_0xc724,0x19a));var _0x4c72=function(_0x4d0b60,_0x4ccc29){_0x4d0b60=_0x4d0b60-0x0;var _0x4efdc4=_0xc724[_0x4d0b60];return _0x4efdc4;};'use strict';var _=require('lodash');var util=require(_0x4c72('0x0'));var logger=require(_0x4c72('0x1'))('api');var moment=require(_0x4c72('0x2'));var BPromise=require('bluebird');var rp=require(_0x4c72('0x3'));var fs=require('fs');var path=require(_0x4c72('0x4'));var rimraf=require(_0x4c72('0x5'));var config=require('../../config/environment');var attributes=require('./intVtigerAccount.attributes');var integrations=require('../../components/integrations/configuration');module[_0x4c72('0x6')]=function(_0x4346af,_0xe05ada){return _0x4346af[_0x4c72('0x7')](_0x4c72('0x8'),attributes,{'tableName':'int_vtiger_accounts','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 bc3843a..025e72b 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 _0x031b=['util','moment','bluebird','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','client','http','request','then','info','VtigerAccount,\x20%s,\x20%s','VtigerAccount,\x20%s,\x20%s,\x20%s','request\x20sent','error','message','result','catch','VtigerAccount','options','where','attributes','limit','include','map','model','GetVtigerAccount','stringify','ShowVtigerAccount','raw','debug'];(function(_0x1cdc0e,_0x33f70d){var _0x14e1d3=function(_0x41d42a){while(--_0x41d42a){_0x1cdc0e['push'](_0x1cdc0e['shift']());}};_0x14e1d3(++_0x33f70d);}(_0x031b,0x1c7));var _0xb031=function(_0x328edc,_0x1203cb){_0x328edc=_0x328edc-0x0;var _0x871bd=_0x031b[_0x328edc];return _0x871bd;};'use strict';var _=require('lodash');var util=require(_0xb031('0x0'));var moment=require(_0xb031('0x1'));var BPromise=require(_0xb031('0x2'));var rs=require('randomstring');var fs=require('fs');var Redis=require(_0xb031('0x3'));var db=require(_0xb031('0x4'))['db'];var utils=require(_0xb031('0x5'));var logger=require(_0xb031('0x6'))(_0xb031('0x7'));var config=require(_0xb031('0x8'));var jayson=require(_0xb031('0x9'));var client=jayson[_0xb031('0xa')][_0xb031('0xb')]({'port':0x232a});function respondWithRpcPromise(_0x14426c,_0x5f4b10,_0x3e66e5){return new BPromise(function(_0x57c413,_0x4a9a4f){return client[_0xb031('0xc')](_0x14426c,_0x3e66e5)[_0xb031('0xd')](function(_0x5ec60d){logger[_0xb031('0xe')](_0xb031('0xf'),_0x5f4b10,'request\x20sent');logger['debug'](_0xb031('0x10'),_0x5f4b10,_0xb031('0x11'),JSON['stringify'](_0x5ec60d));if(_0x5ec60d[_0xb031('0x12')]){if(_0x5ec60d[_0xb031('0x12')]['code']===0x1f4){logger[_0xb031('0x12')](_0xb031('0xf'),_0x5f4b10,_0x5ec60d[_0xb031('0x12')][_0xb031('0x13')]);return _0x4a9a4f(_0x5ec60d[_0xb031('0x12')][_0xb031('0x13')]);}logger[_0xb031('0x12')]('VtigerAccount,\x20%s,\x20%s',_0x5f4b10,_0x5ec60d[_0xb031('0x12')][_0xb031('0x13')]);return _0x57c413(_0x5ec60d[_0xb031('0x12')][_0xb031('0x13')]);}else{logger['info'](_0xb031('0xf'),_0x5f4b10,_0xb031('0x11'));_0x57c413(_0x5ec60d[_0xb031('0x14')][_0xb031('0x13')]);}})[_0xb031('0x15')](function(_0x352943){logger[_0xb031('0x12')]('VtigerAccount,\x20%s,\x20%s',_0x5f4b10,_0x352943);_0x4a9a4f(_0x352943);});});}exports['GetVtigerAccount']=function(_0x2a05c0){var _0xbe9b3e=this;return new Promise(function(_0x144ef3,_0x53b502){return db[_0xb031('0x16')]['findAll']({'raw':_0x2a05c0[_0xb031('0x17')]?_0x2a05c0[_0xb031('0x17')]['raw']===undefined?!![]:![]:!![],'where':_0x2a05c0['options']?_0x2a05c0[_0xb031('0x17')][_0xb031('0x18')]||null:null,'attributes':_0x2a05c0[_0xb031('0x17')]?_0x2a05c0[_0xb031('0x17')][_0xb031('0x19')]||null:null,'limit':_0x2a05c0[_0xb031('0x17')]?_0x2a05c0[_0xb031('0x17')][_0xb031('0x1a')]||null:null,'include':_0x2a05c0['options']?_0x2a05c0[_0xb031('0x17')][_0xb031('0x1b')]?_[_0xb031('0x1c')](_0x2a05c0['options'][_0xb031('0x1b')],function(_0x4b40ac){return{'model':db[_0x4b40ac['model']],'as':_0x4b40ac['as'],'attributes':_0x4b40ac[_0xb031('0x19')],'include':_0x4b40ac[_0xb031('0x1b')]?_[_0xb031('0x1c')](_0x4b40ac[_0xb031('0x1b')],function(_0x45617b){return{'model':db[_0x45617b['model']],'as':_0x45617b['as'],'attributes':_0x45617b[_0xb031('0x19')],'include':_0x45617b[_0xb031('0x1b')]?_[_0xb031('0x1c')](_0x45617b[_0xb031('0x1b')],function(_0x1d5715){return{'model':db[_0x1d5715[_0xb031('0x1d')]],'as':_0x1d5715['as'],'attributes':_0x1d5715['attributes']};}):[]};}):[]};}):[]:[]})[_0xb031('0xd')](function(_0x522f60){logger[_0xb031('0xe')](_0xb031('0x1e'),_0x2a05c0);logger['debug'](_0xb031('0x1e'),_0x2a05c0,JSON[_0xb031('0x1f')](_0x522f60));_0x144ef3(_0x522f60);})[_0xb031('0x15')](function(_0x369196){logger[_0xb031('0x12')](_0xb031('0x1e'),_0x369196[_0xb031('0x13')],_0x2a05c0);_0x53b502(_0xbe9b3e[_0xb031('0x12')](0x1f4,_0x369196['message']));});});};exports[_0xb031('0x20')]=function(_0x2594f6){var _0x2f38a2=this;return new Promise(function(_0x1cd329,_0x1c93cf){return db['VtigerAccount']['find']({'raw':_0x2594f6['options']?_0x2594f6[_0xb031('0x17')][_0xb031('0x21')]===undefined?!![]:![]:!![],'where':_0x2594f6[_0xb031('0x17')]?_0x2594f6[_0xb031('0x17')][_0xb031('0x18')]||null:null,'attributes':_0x2594f6['options']?_0x2594f6[_0xb031('0x17')][_0xb031('0x19')]||null:null,'include':_0x2594f6[_0xb031('0x17')]?_0x2594f6[_0xb031('0x17')][_0xb031('0x1b')]?_['map'](_0x2594f6[_0xb031('0x17')][_0xb031('0x1b')],function(_0x28d76a){return{'model':db[_0x28d76a['model']],'as':_0x28d76a['as'],'attributes':_0x28d76a[_0xb031('0x19')],'include':_0x28d76a[_0xb031('0x1b')]?_[_0xb031('0x1c')](_0x28d76a['include'],function(_0x25157d){return{'model':db[_0x25157d[_0xb031('0x1d')]],'as':_0x25157d['as'],'attributes':_0x25157d['attributes'],'include':_0x25157d[_0xb031('0x1b')]?_['map'](_0x25157d[_0xb031('0x1b')],function(_0x35d394){return{'model':db[_0x35d394[_0xb031('0x1d')]],'as':_0x35d394['as'],'attributes':_0x35d394[_0xb031('0x19')]};}):[]};}):[]};}):[]:[]})['then'](function(_0x16dd87){logger[_0xb031('0xe')](_0xb031('0x20'),_0x2594f6);logger[_0xb031('0x22')]('ShowVtigerAccount',_0x2594f6,JSON[_0xb031('0x1f')](_0x16dd87));_0x1cd329(_0x16dd87);})[_0xb031('0x15')](function(_0x4edaa1){logger[_0xb031('0x12')]('ShowVtigerAccount',_0x4edaa1[_0xb031('0x13')],_0x2594f6);_0x1c93cf(_0x2f38a2['error'](0x1f4,_0x4edaa1[_0xb031('0x13')]));});});};
\ No newline at end of file
+var _0xbdd7=['result','catch','GetVtigerAccount','VtigerAccount','findAll','options','raw','where','include','map','model','attributes','stringify','find','lodash','util','moment','bluebird','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','client','http','request','then','info','VtigerAccount,\x20%s,\x20%s','request\x20sent','debug','VtigerAccount,\x20%s,\x20%s,\x20%s','error','code','message'];(function(_0x15ec41,_0x48dd45){var _0x2fa788=function(_0x91af32){while(--_0x91af32){_0x15ec41['push'](_0x15ec41['shift']());}};_0x2fa788(++_0x48dd45);}(_0xbdd7,0x152));var _0x7bdd=function(_0x432682,_0x253044){_0x432682=_0x432682-0x0;var _0x463d05=_0xbdd7[_0x432682];return _0x463d05;};'use strict';var _=require(_0x7bdd('0x0'));var util=require(_0x7bdd('0x1'));var moment=require(_0x7bdd('0x2'));var BPromise=require(_0x7bdd('0x3'));var rs=require('randomstring');var fs=require('fs');var Redis=require('ioredis');var db=require(_0x7bdd('0x4'))['db'];var utils=require(_0x7bdd('0x5'));var logger=require(_0x7bdd('0x6'))(_0x7bdd('0x7'));var config=require(_0x7bdd('0x8'));var jayson=require(_0x7bdd('0x9'));var client=jayson[_0x7bdd('0xa')][_0x7bdd('0xb')]({'port':0x232a});function respondWithRpcPromise(_0x49b3f2,_0x364c7b,_0x4c5a10){return new BPromise(function(_0xa2111f,_0x818ab5){return client[_0x7bdd('0xc')](_0x49b3f2,_0x4c5a10)[_0x7bdd('0xd')](function(_0x48e52c){logger[_0x7bdd('0xe')](_0x7bdd('0xf'),_0x364c7b,_0x7bdd('0x10'));logger[_0x7bdd('0x11')](_0x7bdd('0x12'),_0x364c7b,'request\x20sent',JSON['stringify'](_0x48e52c));if(_0x48e52c[_0x7bdd('0x13')]){if(_0x48e52c[_0x7bdd('0x13')][_0x7bdd('0x14')]===0x1f4){logger[_0x7bdd('0x13')](_0x7bdd('0xf'),_0x364c7b,_0x48e52c[_0x7bdd('0x13')][_0x7bdd('0x15')]);return _0x818ab5(_0x48e52c['error'][_0x7bdd('0x15')]);}logger[_0x7bdd('0x13')]('VtigerAccount,\x20%s,\x20%s',_0x364c7b,_0x48e52c[_0x7bdd('0x13')][_0x7bdd('0x15')]);return _0xa2111f(_0x48e52c[_0x7bdd('0x13')][_0x7bdd('0x15')]);}else{logger[_0x7bdd('0xe')](_0x7bdd('0xf'),_0x364c7b,_0x7bdd('0x10'));_0xa2111f(_0x48e52c[_0x7bdd('0x16')][_0x7bdd('0x15')]);}})[_0x7bdd('0x17')](function(_0x83f359){logger[_0x7bdd('0x13')](_0x7bdd('0xf'),_0x364c7b,_0x83f359);_0x818ab5(_0x83f359);});});}exports[_0x7bdd('0x18')]=function(_0xb184ba){var _0x197164=this;return new Promise(function(_0x1eeb64,_0x45e44d){return db[_0x7bdd('0x19')][_0x7bdd('0x1a')]({'raw':_0xb184ba[_0x7bdd('0x1b')]?_0xb184ba[_0x7bdd('0x1b')][_0x7bdd('0x1c')]===undefined?!![]:![]:!![],'where':_0xb184ba[_0x7bdd('0x1b')]?_0xb184ba['options'][_0x7bdd('0x1d')]||null:null,'attributes':_0xb184ba[_0x7bdd('0x1b')]?_0xb184ba[_0x7bdd('0x1b')]['attributes']||null:null,'limit':_0xb184ba[_0x7bdd('0x1b')]?_0xb184ba[_0x7bdd('0x1b')]['limit']||null:null,'include':_0xb184ba[_0x7bdd('0x1b')]?_0xb184ba[_0x7bdd('0x1b')][_0x7bdd('0x1e')]?_[_0x7bdd('0x1f')](_0xb184ba[_0x7bdd('0x1b')][_0x7bdd('0x1e')],function(_0x30d473){return{'model':db[_0x30d473[_0x7bdd('0x20')]],'as':_0x30d473['as'],'attributes':_0x30d473[_0x7bdd('0x21')],'include':_0x30d473[_0x7bdd('0x1e')]?_[_0x7bdd('0x1f')](_0x30d473[_0x7bdd('0x1e')],function(_0x1c9e8e){return{'model':db[_0x1c9e8e[_0x7bdd('0x20')]],'as':_0x1c9e8e['as'],'attributes':_0x1c9e8e['attributes'],'include':_0x1c9e8e[_0x7bdd('0x1e')]?_[_0x7bdd('0x1f')](_0x1c9e8e[_0x7bdd('0x1e')],function(_0xaa090f){return{'model':db[_0xaa090f[_0x7bdd('0x20')]],'as':_0xaa090f['as'],'attributes':_0xaa090f['attributes']};}):[]};}):[]};}):[]:[]})[_0x7bdd('0xd')](function(_0x343301){logger[_0x7bdd('0xe')](_0x7bdd('0x18'),_0xb184ba);logger[_0x7bdd('0x11')](_0x7bdd('0x18'),_0xb184ba,JSON[_0x7bdd('0x22')](_0x343301));_0x1eeb64(_0x343301);})[_0x7bdd('0x17')](function(_0x253089){logger[_0x7bdd('0x13')]('GetVtigerAccount',_0x253089[_0x7bdd('0x15')],_0xb184ba);_0x45e44d(_0x197164[_0x7bdd('0x13')](0x1f4,_0x253089[_0x7bdd('0x15')]));});});};exports['ShowVtigerAccount']=function(_0x5ca6b4){var _0x6ecd45=this;return new Promise(function(_0x67d7d8,_0x265045){return db[_0x7bdd('0x19')][_0x7bdd('0x23')]({'raw':_0x5ca6b4['options']?_0x5ca6b4[_0x7bdd('0x1b')][_0x7bdd('0x1c')]===undefined?!![]:![]:!![],'where':_0x5ca6b4[_0x7bdd('0x1b')]?_0x5ca6b4[_0x7bdd('0x1b')][_0x7bdd('0x1d')]||null:null,'attributes':_0x5ca6b4[_0x7bdd('0x1b')]?_0x5ca6b4[_0x7bdd('0x1b')][_0x7bdd('0x21')]||null:null,'include':_0x5ca6b4[_0x7bdd('0x1b')]?_0x5ca6b4[_0x7bdd('0x1b')][_0x7bdd('0x1e')]?_[_0x7bdd('0x1f')](_0x5ca6b4[_0x7bdd('0x1b')][_0x7bdd('0x1e')],function(_0x39009a){return{'model':db[_0x39009a['model']],'as':_0x39009a['as'],'attributes':_0x39009a['attributes'],'include':_0x39009a['include']?_[_0x7bdd('0x1f')](_0x39009a[_0x7bdd('0x1e')],function(_0x384c17){return{'model':db[_0x384c17[_0x7bdd('0x20')]],'as':_0x384c17['as'],'attributes':_0x384c17[_0x7bdd('0x21')],'include':_0x384c17[_0x7bdd('0x1e')]?_[_0x7bdd('0x1f')](_0x384c17[_0x7bdd('0x1e')],function(_0x22d374){return{'model':db[_0x22d374['model']],'as':_0x22d374['as'],'attributes':_0x22d374['attributes']};}):[]};}):[]};}):[]:[]})[_0x7bdd('0xd')](function(_0x180bae){logger[_0x7bdd('0xe')]('ShowVtigerAccount',_0x5ca6b4);logger[_0x7bdd('0x11')]('ShowVtigerAccount',_0x5ca6b4,JSON['stringify'](_0x180bae));_0x67d7d8(_0x180bae);})[_0x7bdd('0x17')](function(_0x4dd140){logger['error']('ShowVtigerAccount',_0x4dd140[_0x7bdd('0x15')],_0x5ca6b4);_0x265045(_0x6ecd45['error'](0x1f4,_0x4dd140[_0x7bdd('0x15')]));});});};
\ No newline at end of file
diff --git a/server/api/intVtigerConfiguration/index.js b/server/api/intVtigerConfiguration/index.js
index 0ec107a..4ee9edb 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(_0x2aa2c6,_0x1a5d3b){var _0x238abf=function(_0x3ca9fd){while(--_0x3ca9fd){_0x2aa2c6['push'](_0x2aa2c6['shift']());}};_0x238abf(++_0x1a5d3b);}(_0xb10b,0x12a));var _0xbb10=function(_0x178d95,_0x5880c1){_0x178d95=_0x178d95-0x0;var _0x55688c=_0xb10b[_0x178d95];return _0x55688c;};'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 _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(_0x3d3650,_0x1ae5c5){var _0x389435=function(_0x5e252c){while(--_0x5e252c){_0x3d3650['push'](_0x3d3650['shift']());}};_0x389435(++_0x1ae5c5);}(_0xb10b,0x12a));var _0xbb10=function(_0x1ae139,_0x529c60){_0x1ae139=_0x1ae139-0x0;var _0x5e0de7=_0xb10b[_0x1ae139];return _0x5e0de7;};'use strict';var multer=require(_0xbb10('0x0'));var util=require('util');var path=require(_0xbb10('0x1'));var timeout=require(_0xbb10('0x2'));var express=require(_0xbb10('0x3'));var router=express['Router']();var auth=require(_0xbb10('0x4'));var interaction=require(_0xbb10('0x5'));var config=require(_0xbb10('0x6'));var controller=require(_0xbb10('0x7'));router[_0xbb10('0x8')]('/',auth[_0xbb10('0x9')](),controller['index']);router[_0xbb10('0x8')](_0xbb10('0xa'),auth['isAuthenticated'](),controller[_0xbb10('0xb')]);router[_0xbb10('0x8')](_0xbb10('0xc'),auth[_0xbb10('0x9')](),controller[_0xbb10('0xd')]);router[_0xbb10('0x8')](_0xbb10('0xe'),auth[_0xbb10('0x9')](),controller['getSubjects']);router['get'](_0xbb10('0xf'),auth[_0xbb10('0x9')](),controller[_0xbb10('0x10')]);router['post']('/',auth[_0xbb10('0x9')](),controller['create']);router[_0xbb10('0x11')](_0xbb10('0xa'),auth[_0xbb10('0x9')](),controller[_0xbb10('0x12')]);router[_0xbb10('0x13')](_0xbb10('0xa'),auth['isAuthenticated'](),controller[_0xbb10('0x14')]);module[_0xbb10('0x15')]=router;
\ No newline at end of file
diff --git a/server/api/intVtigerConfiguration/intVtigerConfiguration.attributes.js b/server/api/intVtigerConfiguration/intVtigerConfiguration.attributes.js
index 4486f56..9e5f62b 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 _0x4b49=['STRING','exports'];(function(_0x51d129,_0x175d7d){var _0x44c377=function(_0x5ee454){while(--_0x5ee454){_0x51d129['push'](_0x51d129['shift']());}};_0x44c377(++_0x175d7d);}(_0x4b49,0x1d9));var _0x94b4=function(_0x3dd15e,_0x1f0015){_0x3dd15e=_0x3dd15e-0x0;var _0x231fd0=_0x4b49[_0x3dd15e];return _0x231fd0;};'use strict';var Sequelize=require('sequelize');module[_0x94b4('0x0')]={'name':{'type':Sequelize['STRING']},'description':{'type':Sequelize[_0x94b4('0x1')]}};
\ No newline at end of file
+var _0x3cfd=['sequelize','STRING'];(function(_0x5e3a9a,_0x5e15c0){var _0xdcf034=function(_0x509774){while(--_0x509774){_0x5e3a9a['push'](_0x5e3a9a['shift']());}};_0xdcf034(++_0x5e15c0);}(_0x3cfd,0x15e));var _0xd3cf=function(_0x68b52e,_0xe1abf9){_0x68b52e=_0x68b52e-0x0;var _0x4278c3=_0x3cfd[_0x68b52e];return _0x4278c3;};'use strict';var Sequelize=require(_0xd3cf('0x0'));module['exports']={'name':{'type':Sequelize[_0xd3cf('0x1')]},'description':{'type':Sequelize[_0xd3cf('0x1')]}};
\ No newline at end of file
diff --git a/server/api/intVtigerConfiguration/intVtigerConfiguration.controller.js b/server/api/intVtigerConfiguration/intVtigerConfiguration.controller.js
index 6bc8fb6..03a0ae8 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 _0x3427=['params','getFields','findOne','VtigerField','order','getSubjects','pick','getDescriptions','html-pdf','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','mustache','util','path','ejs','lodash','crypto','desk.js','to-csv','querystring','papaparse','ioredis','../../components/parsers/qs','api','../../config/utils','../../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','VtigerConfiguration,\x20%s,\x20%s','request\x20sent','VtigerConfiguration,\x20%s,\x20%s,\x20%s','stringify','error','code','message','result','catch','sendStatus','status','count','offset','limit','set','Content-Range','json','apply','update','destroy','end','stack','send','index','map','rawAttributes','fieldName','type','key','model','query','keys','attributes','fields','hasOwnProperty','nolimit','sort','filters','where','merge','VIRTUAL','name','filter','options','includeAll','include','VtigerConfiguration','findAll','rows','intersection','length','find','create','body'];(function(_0x236a85,_0x5c8ca3){var _0x777d97=function(_0x10458c){while(--_0x10458c){_0x236a85['push'](_0x236a85['shift']());}};_0x777d97(++_0x5c8ca3);}(_0x3427,0x11f));var _0x7342=function(_0x2fef33,_0x1dde7f){_0x2fef33=_0x2fef33-0x0;var _0x2f73b7=_0x3427[_0x2fef33];return _0x2f73b7;};'use strict';var pdf=require(_0x7342('0x0'));var emlformat=require(_0x7342('0x1'));var rimraf=require(_0x7342('0x2'));var zipdir=require(_0x7342('0x3'));var jsonpatch=require(_0x7342('0x4'));var rp=require(_0x7342('0x5'));var moment=require('moment');var BPromise=require('bluebird');var Mustache=require(_0x7342('0x6'));var util=require(_0x7342('0x7'));var path=require(_0x7342('0x8'));var sox=require('sox');var csv=require('to-csv');var ejs=require(_0x7342('0x9'));var fs=require('fs');var _=require(_0x7342('0xa'));var squel=require('squel');var crypto=require(_0x7342('0xb'));var jsforce=require('jsforce');var deskjs=require(_0x7342('0xc'));var toCsv=require(_0x7342('0xd'));var querystring=require(_0x7342('0xe'));var Papa=require(_0x7342('0xf'));var Redis=require(_0x7342('0x10'));var authService=require('../../components/auth/service');var qs=require(_0x7342('0x11'));var as=require('../../components/parsers/advancedSearch');var hardwareService=require('../../config/license/hardware');var logger=require('../../config/logger')(_0x7342('0x12'));var utils=require(_0x7342('0x13'));var config=require(_0x7342('0x14'));var db=require(_0x7342('0x15'))['db'];var jayson=require(_0x7342('0x16'));var client=jayson['client'][_0x7342('0x17')]({'port':0x232a});function checkPasswordPattern(_0x148723,_0x2a9f48,_0x599d53){if(_0x599d53){var _0x375836=new RegExp(/(?=.*[a-z])(?=.*[A-Z])(?=.*[0-9])(?=.*[?!@#\$%\^&\*~\-_=+[{\]\}])(?=.{8,})/);if(_0x375836[_0x7342('0x18')](_0x2a9f48)){return _0x148723;}else{throw new db[(_0x7342('0x19'))][(_0x7342('0x1a'))](_0x7342('0x1b'));}}else{return _0x148723;}}function respondWithRpcPromise(_0x3b03d0,_0x502695,_0x11277f,_0x3da06d){return new BPromise(function(_0x4ccc53,_0x5fa6b){var _0x51d601=_0x3da06d||client;return _0x51d601[_0x7342('0x1c')](_0x3b03d0,_0x11277f)[_0x7342('0x1d')](function(_0xbd9b50){logger[_0x7342('0x1e')](_0x7342('0x1f'),_0x502695,_0x7342('0x20'));logger['debug'](_0x7342('0x21'),_0x502695,_0x7342('0x20'),JSON[_0x7342('0x22')](_0xbd9b50));if(_0xbd9b50[_0x7342('0x23')]){if(_0xbd9b50[_0x7342('0x23')][_0x7342('0x24')]===0x1f4){logger[_0x7342('0x23')]('VtigerConfiguration,\x20%s,\x20%s',_0x502695,_0xbd9b50[_0x7342('0x23')]['message']);return _0x5fa6b(_0xbd9b50[_0x7342('0x23')][_0x7342('0x25')]);}logger[_0x7342('0x23')](_0x7342('0x1f'),_0x502695,_0xbd9b50[_0x7342('0x23')][_0x7342('0x25')]);return _0x4ccc53(_0xbd9b50['error'][_0x7342('0x25')]);}else{logger[_0x7342('0x1e')]('VtigerConfiguration,\x20%s,\x20%s',_0x502695,_0x7342('0x20'));_0x4ccc53(_0xbd9b50[_0x7342('0x26')][_0x7342('0x25')]);}})[_0x7342('0x27')](function(_0x52393b){logger['error'](_0x7342('0x1f'),_0x502695,_0x52393b);_0x5fa6b(_0x52393b);});});}function respondWithStatusCode(_0x5d76dd,_0xfdd73d){_0xfdd73d=_0xfdd73d||0xcc;return function(_0x4ea481){if(_0x4ea481){return _0x5d76dd[_0x7342('0x28')](_0xfdd73d);}return _0x5d76dd[_0x7342('0x29')](_0xfdd73d)['end']();};}function respondWithResult(_0x359c8c,_0x2e5ff2){_0x2e5ff2=_0x2e5ff2||0xc8;return function(_0x275221){if(_0x275221){return _0x359c8c[_0x7342('0x29')](_0x2e5ff2)['json'](_0x275221);}};}function respondWithFilteredResult(_0x45b0db,_0x1a63cc){return function(_0x49a352){if(_0x49a352){var _0x36f9c0=_0x49a352[_0x7342('0x2a')],_0x4c33dd=_0x1a63cc[_0x7342('0x2b')],_0x35cd91=_0x1a63cc[_0x7342('0x2b')]+_0x1a63cc[_0x7342('0x2c')],_0x32e7d2;if(_0x35cd91>=_0x36f9c0){_0x35cd91=_0x36f9c0;_0x32e7d2=0xc8;}else{_0x32e7d2=0xce;}_0x45b0db[_0x7342('0x29')](_0x32e7d2);return _0x45b0db[_0x7342('0x2d')](_0x7342('0x2e'),_0x4c33dd+'-'+_0x35cd91+'/'+_0x36f9c0)[_0x7342('0x2f')](_0x49a352);}return null;};}function patchUpdates(_0xad6404){return function(_0x2694f2){try{jsonpatch[_0x7342('0x30')](_0x2694f2,_0xad6404,!![]);}catch(_0x1f5e8a){return BPromise['reject'](_0x1f5e8a);}return _0x2694f2['save']();};}function saveUpdates(_0x417b87,_0x32934e){return function(_0x20bf5e){if(_0x20bf5e){return _0x20bf5e[_0x7342('0x31')](_0x417b87)['then'](function(_0x1c95ad){return _0x1c95ad;});}return null;};}function removeEntity(_0x2ce437,_0x15013b){return function(_0x189bfa){if(_0x189bfa){return _0x189bfa[_0x7342('0x32')]()[_0x7342('0x1d')](function(){_0x2ce437['status'](0xcc)[_0x7342('0x33')]();});}};}function handleEntityNotFound(_0x39ee98,_0x28bf5a){return function(_0x5a43e4){if(!_0x5a43e4){_0x39ee98[_0x7342('0x28')](0x194);}return _0x5a43e4;};}function handleError(_0x450456,_0x384334){_0x384334=_0x384334||0x1f4;return function(_0x15800b){logger[_0x7342('0x23')](_0x15800b[_0x7342('0x34')]);if(_0x15800b['name']){delete _0x15800b['name'];}_0x450456[_0x7342('0x29')](_0x384334)[_0x7342('0x35')](_0x15800b);};}exports[_0x7342('0x36')]=function(_0x20190d,_0x4a230a){var _0x52da63={},_0x183daf={},_0x2101ce={'count':0x0,'rows':[]};var _0x4f80f5=_[_0x7342('0x37')](db['VtigerConfiguration'][_0x7342('0x38')],function(_0x2c2d27){return{'name':_0x2c2d27[_0x7342('0x39')],'type':_0x2c2d27[_0x7342('0x3a')][_0x7342('0x3b')]};});_0x183daf[_0x7342('0x3c')]=_[_0x7342('0x37')](_0x4f80f5,'name');_0x183daf[_0x7342('0x3d')]=_[_0x7342('0x3e')](_0x20190d[_0x7342('0x3d')]);_0x183daf['filters']=_['intersection'](_0x183daf[_0x7342('0x3c')],_0x183daf[_0x7342('0x3d')]);_0x52da63[_0x7342('0x3f')]=_['intersection'](_0x183daf[_0x7342('0x3c')],qs[_0x7342('0x40')](_0x20190d['query']['fields']));_0x52da63[_0x7342('0x3f')]=_0x52da63[_0x7342('0x3f')]['length']?_0x52da63[_0x7342('0x3f')]:_0x183daf[_0x7342('0x3c')];if(!_0x20190d[_0x7342('0x3d')][_0x7342('0x41')](_0x7342('0x42'))){_0x52da63['limit']=qs[_0x7342('0x2c')](_0x20190d[_0x7342('0x3d')][_0x7342('0x2c')]);_0x52da63[_0x7342('0x2b')]=qs[_0x7342('0x2b')](_0x20190d[_0x7342('0x3d')][_0x7342('0x2b')]);}_0x52da63['order']=qs[_0x7342('0x43')](_0x20190d[_0x7342('0x3d')]['sort']);_0x52da63['where']=qs[_0x7342('0x44')](_['pick'](_0x20190d[_0x7342('0x3d')],_0x183daf['filters']));if(_0x20190d[_0x7342('0x3d')]['filter']){_0x52da63[_0x7342('0x45')]=_[_0x7342('0x46')](_0x52da63[_0x7342('0x45')],{'$or':_[_0x7342('0x37')](_0x4f80f5,function(_0xc571e7){if(_0xc571e7[_0x7342('0x3a')]!==_0x7342('0x47')){var _0x270344={};_0x270344[_0xc571e7[_0x7342('0x48')]]={'$like':'%'+_0x20190d['query'][_0x7342('0x49')]+'%'};return _0x270344;}})});}_0x52da63=_['merge']({},_0x52da63,_0x20190d[_0x7342('0x4a')]);var _0x1195d5={'where':_0x52da63[_0x7342('0x45')]};return db['VtigerConfiguration']['count'](_0x1195d5)[_0x7342('0x1d')](function(_0x55754a){_0x2101ce[_0x7342('0x2a')]=_0x55754a;if(_0x20190d[_0x7342('0x3d')][_0x7342('0x4b')]){_0x52da63[_0x7342('0x4c')]=[{'all':!![]}];}return db[_0x7342('0x4d')][_0x7342('0x4e')](_0x52da63);})[_0x7342('0x1d')](function(_0x171288){_0x2101ce[_0x7342('0x4f')]=_0x171288;return _0x2101ce;})[_0x7342('0x1d')](respondWithFilteredResult(_0x4a230a,_0x52da63))['catch'](handleError(_0x4a230a,null));};exports['show']=function(_0x5cfa1d,_0x5417c7){var _0x2ede4e={'raw':![],'where':{'id':_0x5cfa1d['params']['id']}},_0x5bd6c0={};_0x5bd6c0[_0x7342('0x3c')]=_['keys'](db[_0x7342('0x4d')][_0x7342('0x38')]);_0x5bd6c0['query']=_[_0x7342('0x3e')](_0x5cfa1d['query']);_0x5bd6c0[_0x7342('0x44')]=_[_0x7342('0x50')](_0x5bd6c0[_0x7342('0x3c')],_0x5bd6c0['query']);_0x2ede4e[_0x7342('0x3f')]=_['intersection'](_0x5bd6c0[_0x7342('0x3c')],qs['fields'](_0x5cfa1d[_0x7342('0x3d')][_0x7342('0x40')]));_0x2ede4e['attributes']=_0x2ede4e[_0x7342('0x3f')][_0x7342('0x51')]?_0x2ede4e[_0x7342('0x3f')]:_0x5bd6c0['model'];if(_0x5cfa1d[_0x7342('0x3d')][_0x7342('0x4b')]){_0x2ede4e[_0x7342('0x4c')]=[{'all':!![]}];}_0x2ede4e=_[_0x7342('0x46')]({},_0x2ede4e,_0x5cfa1d[_0x7342('0x4a')]);return db[_0x7342('0x4d')][_0x7342('0x52')](_0x2ede4e)[_0x7342('0x1d')](handleEntityNotFound(_0x5417c7,null))[_0x7342('0x1d')](respondWithResult(_0x5417c7,null))[_0x7342('0x27')](handleError(_0x5417c7,null));};exports[_0x7342('0x53')]=function(_0x44940a,_0x19b37a){return db[_0x7342('0x4d')][_0x7342('0x53')](_0x44940a[_0x7342('0x54')],{})[_0x7342('0x1d')](respondWithResult(_0x19b37a,0xc9))[_0x7342('0x27')](handleError(_0x19b37a,null));};exports[_0x7342('0x31')]=function(_0x3f56a6,_0x37f6ca){if(_0x3f56a6['body']['id']){delete _0x3f56a6[_0x7342('0x54')]['id'];}return db[_0x7342('0x4d')][_0x7342('0x52')]({'where':{'id':_0x3f56a6[_0x7342('0x55')]['id']}})['then'](handleEntityNotFound(_0x37f6ca,null))[_0x7342('0x1d')](saveUpdates(_0x3f56a6['body'],null))[_0x7342('0x1d')](respondWithResult(_0x37f6ca,null))[_0x7342('0x27')](handleError(_0x37f6ca,null));};exports['destroy']=function(_0x582db4,_0x35c80a){return db['VtigerConfiguration']['find']({'where':{'id':_0x582db4[_0x7342('0x55')]['id']}})[_0x7342('0x1d')](handleEntityNotFound(_0x35c80a,null))[_0x7342('0x1d')](removeEntity(_0x35c80a,null))[_0x7342('0x27')](handleError(_0x35c80a,null));};exports[_0x7342('0x56')]=function(_0x24a59e,_0x1170fb,_0x5d9a8a){var _0x58e743={};var _0x255e8b={};var _0x141638;var _0x36bdde;return db[_0x7342('0x4d')][_0x7342('0x57')]({'where':{'id':_0x24a59e['params']['id']}})[_0x7342('0x1d')](handleEntityNotFound(_0x1170fb,null))[_0x7342('0x1d')](function(_0x1fd7ca){if(_0x1fd7ca){_0x141638=_0x1fd7ca;_0x255e8b['model']=_[_0x7342('0x3e')](db[_0x7342('0x58')][_0x7342('0x38')]);_0x255e8b['query']=_[_0x7342('0x3e')](_0x24a59e[_0x7342('0x3d')]);_0x255e8b['filters']=_[_0x7342('0x50')](_0x255e8b[_0x7342('0x3c')],_0x255e8b[_0x7342('0x3d')]);_0x58e743[_0x7342('0x3f')]=_[_0x7342('0x50')](_0x255e8b[_0x7342('0x3c')],qs[_0x7342('0x40')](_0x24a59e['query']['fields']));_0x58e743['attributes']=_0x58e743[_0x7342('0x3f')][_0x7342('0x51')]?_0x58e743[_0x7342('0x3f')]:_0x255e8b[_0x7342('0x3c')];_0x58e743[_0x7342('0x59')]=qs['sort'](_0x24a59e[_0x7342('0x3d')][_0x7342('0x43')]);_0x58e743['where']=qs[_0x7342('0x44')](_['pick'](_0x24a59e[_0x7342('0x3d')],_0x255e8b[_0x7342('0x44')]));if(_0x24a59e[_0x7342('0x3d')][_0x7342('0x49')]){_0x58e743[_0x7342('0x45')]=_[_0x7342('0x46')](_0x58e743[_0x7342('0x45')],{'$or':_['map'](_0x58e743[_0x7342('0x3f')],function(_0xaf9253){var _0x59890b={};_0x59890b[_0xaf9253]={'$like':'%'+_0x24a59e[_0x7342('0x3d')]['filter']+'%'};return _0x59890b;})});}_0x58e743=_[_0x7342('0x46')]({},_0x58e743,_0x24a59e[_0x7342('0x4a')]);return _0x141638[_0x7342('0x56')](_0x58e743);}})[_0x7342('0x1d')](function(_0x153bf0){if(_0x153bf0){_0x36bdde=_0x153bf0[_0x7342('0x51')];if(!_0x24a59e[_0x7342('0x3d')][_0x7342('0x41')](_0x7342('0x42'))){_0x58e743[_0x7342('0x2c')]=qs[_0x7342('0x2c')](_0x24a59e[_0x7342('0x3d')]['limit']);_0x58e743['offset']=qs[_0x7342('0x2b')](_0x24a59e[_0x7342('0x3d')][_0x7342('0x2b')]);}return _0x141638[_0x7342('0x56')](_0x58e743);}})[_0x7342('0x1d')](function(_0x3f2521){if(_0x3f2521){return _0x3f2521?{'count':_0x36bdde,'rows':_0x3f2521}:null;}})[_0x7342('0x1d')](respondWithResult(_0x1170fb,null))[_0x7342('0x27')](handleError(_0x1170fb,null));};exports[_0x7342('0x5a')]=function(_0x2243e5,_0x3c0b1c,_0x4fc5c5){var _0x236bf0={};var _0x18445a={};var _0x5d4f56;var _0x186ca1;return db[_0x7342('0x4d')][_0x7342('0x57')]({'where':{'id':_0x2243e5['params']['id']}})[_0x7342('0x1d')](handleEntityNotFound(_0x3c0b1c,null))[_0x7342('0x1d')](function(_0x3332f6){if(_0x3332f6){_0x5d4f56=_0x3332f6;_0x18445a[_0x7342('0x3c')]=_[_0x7342('0x3e')](db['VtigerField'][_0x7342('0x38')]);_0x18445a[_0x7342('0x3d')]=_[_0x7342('0x3e')](_0x2243e5[_0x7342('0x3d')]);_0x18445a[_0x7342('0x44')]=_['intersection'](_0x18445a[_0x7342('0x3c')],_0x18445a[_0x7342('0x3d')]);_0x236bf0[_0x7342('0x3f')]=_['intersection'](_0x18445a[_0x7342('0x3c')],qs[_0x7342('0x40')](_0x2243e5[_0x7342('0x3d')][_0x7342('0x40')]));_0x236bf0[_0x7342('0x3f')]=_0x236bf0[_0x7342('0x3f')]['length']?_0x236bf0['attributes']:_0x18445a['model'];_0x236bf0[_0x7342('0x59')]=qs['sort'](_0x2243e5['query'][_0x7342('0x43')]);_0x236bf0['where']=qs[_0x7342('0x44')](_[_0x7342('0x5b')](_0x2243e5['query'],_0x18445a['filters']));if(_0x2243e5[_0x7342('0x3d')][_0x7342('0x49')]){_0x236bf0['where']=_['merge'](_0x236bf0[_0x7342('0x45')],{'$or':_['map'](_0x236bf0[_0x7342('0x3f')],function(_0xc15708){var _0x856a4b={};_0x856a4b[_0xc15708]={'$like':'%'+_0x2243e5[_0x7342('0x3d')][_0x7342('0x49')]+'%'};return _0x856a4b;})});}_0x236bf0=_[_0x7342('0x46')]({},_0x236bf0,_0x2243e5[_0x7342('0x4a')]);return _0x5d4f56[_0x7342('0x5a')](_0x236bf0);}})[_0x7342('0x1d')](function(_0xddead6){if(_0xddead6){_0x186ca1=_0xddead6[_0x7342('0x51')];if(!_0x2243e5[_0x7342('0x3d')]['hasOwnProperty'](_0x7342('0x42'))){_0x236bf0[_0x7342('0x2c')]=qs[_0x7342('0x2c')](_0x2243e5[_0x7342('0x3d')][_0x7342('0x2c')]);_0x236bf0[_0x7342('0x2b')]=qs['offset'](_0x2243e5[_0x7342('0x3d')][_0x7342('0x2b')]);}return _0x5d4f56[_0x7342('0x5a')](_0x236bf0);}})['then'](function(_0x246ecc){if(_0x246ecc){return _0x246ecc?{'count':_0x186ca1,'rows':_0x246ecc}:null;}})['then'](respondWithResult(_0x3c0b1c,null))[_0x7342('0x27')](handleError(_0x3c0b1c,null));};exports['getDescriptions']=function(_0x3108a4,_0x4a9288,_0x3ba67c){var _0x135149={};var _0x3db76a={};var _0x2947a1;var _0x930f71;return db[_0x7342('0x4d')][_0x7342('0x57')]({'where':{'id':_0x3108a4[_0x7342('0x55')]['id']}})[_0x7342('0x1d')](handleEntityNotFound(_0x4a9288,null))[_0x7342('0x1d')](function(_0x33d8b4){if(_0x33d8b4){_0x2947a1=_0x33d8b4;_0x3db76a[_0x7342('0x3c')]=_[_0x7342('0x3e')](db[_0x7342('0x58')][_0x7342('0x38')]);_0x3db76a[_0x7342('0x3d')]=_[_0x7342('0x3e')](_0x3108a4[_0x7342('0x3d')]);_0x3db76a[_0x7342('0x44')]=_[_0x7342('0x50')](_0x3db76a[_0x7342('0x3c')],_0x3db76a[_0x7342('0x3d')]);_0x135149['attributes']=_[_0x7342('0x50')](_0x3db76a[_0x7342('0x3c')],qs['fields'](_0x3108a4[_0x7342('0x3d')][_0x7342('0x40')]));_0x135149['attributes']=_0x135149[_0x7342('0x3f')][_0x7342('0x51')]?_0x135149['attributes']:_0x3db76a[_0x7342('0x3c')];_0x135149['order']=qs[_0x7342('0x43')](_0x3108a4[_0x7342('0x3d')][_0x7342('0x43')]);_0x135149[_0x7342('0x45')]=qs[_0x7342('0x44')](_[_0x7342('0x5b')](_0x3108a4[_0x7342('0x3d')],_0x3db76a[_0x7342('0x44')]));if(_0x3108a4[_0x7342('0x3d')][_0x7342('0x49')]){_0x135149[_0x7342('0x45')]=_[_0x7342('0x46')](_0x135149[_0x7342('0x45')],{'$or':_[_0x7342('0x37')](_0x135149[_0x7342('0x3f')],function(_0x36d2b4){var _0xbb66ad={};_0xbb66ad[_0x36d2b4]={'$like':'%'+_0x3108a4['query'][_0x7342('0x49')]+'%'};return _0xbb66ad;})});}_0x135149=_[_0x7342('0x46')]({},_0x135149,_0x3108a4[_0x7342('0x4a')]);return _0x2947a1[_0x7342('0x5c')](_0x135149);}})[_0x7342('0x1d')](function(_0x2b6ee8){if(_0x2b6ee8){_0x930f71=_0x2b6ee8[_0x7342('0x51')];if(!_0x3108a4['query']['hasOwnProperty'](_0x7342('0x42'))){_0x135149['limit']=qs[_0x7342('0x2c')](_0x3108a4['query'][_0x7342('0x2c')]);_0x135149[_0x7342('0x2b')]=qs[_0x7342('0x2b')](_0x3108a4[_0x7342('0x3d')][_0x7342('0x2b')]);}return _0x2947a1['getDescriptions'](_0x135149);}})[_0x7342('0x1d')](function(_0x12c113){if(_0x12c113){return _0x12c113?{'count':_0x930f71,'rows':_0x12c113}:null;}})[_0x7342('0x1d')](respondWithResult(_0x4a9288,null))['catch'](handleError(_0x4a9288,null));};
\ No newline at end of file
+var _0x6236=['mustache','to-csv','lodash','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','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','VtigerConfiguration,\x20%s,\x20%s','request\x20sent','debug','VtigerConfiguration,\x20%s,\x20%s,\x20%s','error','code','message','result','catch','status','end','offset','limit','set','Content-Range','reject','save','update','destroy','sendStatus','stack','name','send','map','VtigerConfiguration','rawAttributes','type','query','keys','filters','intersection','attributes','model','fields','hasOwnProperty','order','sort','where','filter','merge','VIRTUAL','options','count','includeAll','include','findAll','rows','show','length','find','create','body','params','getFields','findOne','VtigerField','pick','nolimit','getSubjects','getDescriptions','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','bluebird'];(function(_0x5045b5,_0x2840eb){var _0x564757=function(_0x3d0d5c){while(--_0x3d0d5c){_0x5045b5['push'](_0x5045b5['shift']());}};_0x564757(++_0x2840eb);}(_0x6236,0x1c6));var _0x6623=function(_0x4780d6,_0x9df294){_0x4780d6=_0x4780d6-0x0;var _0x444777=_0x6236[_0x4780d6];return _0x444777;};'use strict';var pdf=require('html-pdf');var emlformat=require(_0x6623('0x0'));var rimraf=require(_0x6623('0x1'));var zipdir=require(_0x6623('0x2'));var jsonpatch=require(_0x6623('0x3'));var rp=require(_0x6623('0x4'));var moment=require('moment');var BPromise=require(_0x6623('0x5'));var Mustache=require(_0x6623('0x6'));var util=require('util');var path=require('path');var sox=require('sox');var csv=require(_0x6623('0x7'));var ejs=require('ejs');var fs=require('fs');var _=require(_0x6623('0x8'));var squel=require(_0x6623('0x9'));var crypto=require(_0x6623('0xa'));var jsforce=require(_0x6623('0xb'));var deskjs=require(_0x6623('0xc'));var toCsv=require(_0x6623('0x7'));var querystring=require(_0x6623('0xd'));var Papa=require(_0x6623('0xe'));var Redis=require(_0x6623('0xf'));var authService=require(_0x6623('0x10'));var qs=require(_0x6623('0x11'));var as=require(_0x6623('0x12'));var hardwareService=require(_0x6623('0x13'));var logger=require(_0x6623('0x14'))('api');var utils=require(_0x6623('0x15'));var config=require(_0x6623('0x16'));var db=require('../../mysqldb')['db'];var jayson=require('jayson/promise');var client=jayson[_0x6623('0x17')][_0x6623('0x18')]({'port':0x232a});function checkPasswordPattern(_0xdd7ab1,_0x20a135,_0x10999d){if(_0x10999d){var _0x32e7af=new RegExp(/(?=.*[a-z])(?=.*[A-Z])(?=.*[0-9])(?=.*[?!@#\$%\^&\*~\-_=+[{\]\}])(?=.{8,})/);if(_0x32e7af[_0x6623('0x19')](_0x20a135)){return _0xdd7ab1;}else{throw new db[(_0x6623('0x1a'))][(_0x6623('0x1b'))](_0x6623('0x1c'));}}else{return _0xdd7ab1;}}function respondWithRpcPromise(_0x44f2a4,_0x1cb6fb,_0x3746a4,_0x5db2e2){return new BPromise(function(_0x11bc67,_0x34d8f4){var _0x58c48d=_0x5db2e2||client;return _0x58c48d[_0x6623('0x1d')](_0x44f2a4,_0x3746a4)[_0x6623('0x1e')](function(_0x21989f){logger[_0x6623('0x1f')](_0x6623('0x20'),_0x1cb6fb,_0x6623('0x21'));logger[_0x6623('0x22')](_0x6623('0x23'),_0x1cb6fb,_0x6623('0x21'),JSON['stringify'](_0x21989f));if(_0x21989f[_0x6623('0x24')]){if(_0x21989f[_0x6623('0x24')][_0x6623('0x25')]===0x1f4){logger[_0x6623('0x24')](_0x6623('0x20'),_0x1cb6fb,_0x21989f[_0x6623('0x24')][_0x6623('0x26')]);return _0x34d8f4(_0x21989f[_0x6623('0x24')][_0x6623('0x26')]);}logger[_0x6623('0x24')]('VtigerConfiguration,\x20%s,\x20%s',_0x1cb6fb,_0x21989f[_0x6623('0x24')][_0x6623('0x26')]);return _0x11bc67(_0x21989f['error']['message']);}else{logger['info'](_0x6623('0x20'),_0x1cb6fb,_0x6623('0x21'));_0x11bc67(_0x21989f[_0x6623('0x27')]['message']);}})[_0x6623('0x28')](function(_0x20bdfa){logger['error'](_0x6623('0x20'),_0x1cb6fb,_0x20bdfa);_0x34d8f4(_0x20bdfa);});});}function respondWithStatusCode(_0x4687ea,_0x5a3182){_0x5a3182=_0x5a3182||0xcc;return function(_0x37c277){if(_0x37c277){return _0x4687ea['sendStatus'](_0x5a3182);}return _0x4687ea[_0x6623('0x29')](_0x5a3182)[_0x6623('0x2a')]();};}function respondWithResult(_0x23b962,_0x185caf){_0x185caf=_0x185caf||0xc8;return function(_0x3a8e53){if(_0x3a8e53){return _0x23b962[_0x6623('0x29')](_0x185caf)['json'](_0x3a8e53);}};}function respondWithFilteredResult(_0x14207a,_0x16668e){return function(_0x3d27e6){if(_0x3d27e6){var _0x16dc9e=_0x3d27e6['count'],_0x1df76d=_0x16668e[_0x6623('0x2b')],_0x3833e4=_0x16668e[_0x6623('0x2b')]+_0x16668e[_0x6623('0x2c')],_0x124327;if(_0x3833e4>=_0x16dc9e){_0x3833e4=_0x16dc9e;_0x124327=0xc8;}else{_0x124327=0xce;}_0x14207a['status'](_0x124327);return _0x14207a[_0x6623('0x2d')](_0x6623('0x2e'),_0x1df76d+'-'+_0x3833e4+'/'+_0x16dc9e)['json'](_0x3d27e6);}return null;};}function patchUpdates(_0x3ee16a){return function(_0x628f6d){try{jsonpatch['apply'](_0x628f6d,_0x3ee16a,!![]);}catch(_0x4d8edf){return BPromise[_0x6623('0x2f')](_0x4d8edf);}return _0x628f6d[_0x6623('0x30')]();};}function saveUpdates(_0x520cc2,_0x11c86f){return function(_0x1765d2){if(_0x1765d2){return _0x1765d2[_0x6623('0x31')](_0x520cc2)[_0x6623('0x1e')](function(_0x3c3dde){return _0x3c3dde;});}return null;};}function removeEntity(_0x13a919,_0x2252e6){return function(_0x4291ff){if(_0x4291ff){return _0x4291ff[_0x6623('0x32')]()['then'](function(){_0x13a919[_0x6623('0x29')](0xcc)[_0x6623('0x2a')]();});}};}function handleEntityNotFound(_0x234b4d,_0x5b5af5){return function(_0x2c1ccf){if(!_0x2c1ccf){_0x234b4d[_0x6623('0x33')](0x194);}return _0x2c1ccf;};}function handleError(_0x37dc26,_0x99a110){_0x99a110=_0x99a110||0x1f4;return function(_0x5bfbd5){logger[_0x6623('0x24')](_0x5bfbd5[_0x6623('0x34')]);if(_0x5bfbd5[_0x6623('0x35')]){delete _0x5bfbd5['name'];}_0x37dc26[_0x6623('0x29')](_0x99a110)[_0x6623('0x36')](_0x5bfbd5);};}exports['index']=function(_0x2d9c9a,_0x202715){var _0x39e8de={},_0x2cf09b={},_0x3de9fc={'count':0x0,'rows':[]};var _0x2c8e45=_[_0x6623('0x37')](db[_0x6623('0x38')][_0x6623('0x39')],function(_0x631a53){return{'name':_0x631a53['fieldName'],'type':_0x631a53[_0x6623('0x3a')]['key']};});_0x2cf09b['model']=_[_0x6623('0x37')](_0x2c8e45,'name');_0x2cf09b[_0x6623('0x3b')]=_[_0x6623('0x3c')](_0x2d9c9a[_0x6623('0x3b')]);_0x2cf09b[_0x6623('0x3d')]=_[_0x6623('0x3e')](_0x2cf09b['model'],_0x2cf09b['query']);_0x39e8de[_0x6623('0x3f')]=_[_0x6623('0x3e')](_0x2cf09b[_0x6623('0x40')],qs['fields'](_0x2d9c9a[_0x6623('0x3b')][_0x6623('0x41')]));_0x39e8de[_0x6623('0x3f')]=_0x39e8de['attributes']['length']?_0x39e8de[_0x6623('0x3f')]:_0x2cf09b[_0x6623('0x40')];if(!_0x2d9c9a[_0x6623('0x3b')][_0x6623('0x42')]('nolimit')){_0x39e8de['limit']=qs[_0x6623('0x2c')](_0x2d9c9a[_0x6623('0x3b')][_0x6623('0x2c')]);_0x39e8de[_0x6623('0x2b')]=qs['offset'](_0x2d9c9a[_0x6623('0x3b')][_0x6623('0x2b')]);}_0x39e8de[_0x6623('0x43')]=qs['sort'](_0x2d9c9a[_0x6623('0x3b')][_0x6623('0x44')]);_0x39e8de[_0x6623('0x45')]=qs[_0x6623('0x3d')](_['pick'](_0x2d9c9a[_0x6623('0x3b')],_0x2cf09b['filters']));if(_0x2d9c9a['query'][_0x6623('0x46')]){_0x39e8de[_0x6623('0x45')]=_[_0x6623('0x47')](_0x39e8de[_0x6623('0x45')],{'$or':_[_0x6623('0x37')](_0x2c8e45,function(_0x3fceb0){if(_0x3fceb0[_0x6623('0x3a')]!==_0x6623('0x48')){var _0x4b4bda={};_0x4b4bda[_0x3fceb0[_0x6623('0x35')]]={'$like':'%'+_0x2d9c9a['query'][_0x6623('0x46')]+'%'};return _0x4b4bda;}})});}_0x39e8de=_[_0x6623('0x47')]({},_0x39e8de,_0x2d9c9a[_0x6623('0x49')]);var _0x55013f={'where':_0x39e8de[_0x6623('0x45')]};return db[_0x6623('0x38')][_0x6623('0x4a')](_0x55013f)[_0x6623('0x1e')](function(_0x3beb90){_0x3de9fc[_0x6623('0x4a')]=_0x3beb90;if(_0x2d9c9a[_0x6623('0x3b')][_0x6623('0x4b')]){_0x39e8de[_0x6623('0x4c')]=[{'all':!![]}];}return db[_0x6623('0x38')][_0x6623('0x4d')](_0x39e8de);})['then'](function(_0x33a036){_0x3de9fc[_0x6623('0x4e')]=_0x33a036;return _0x3de9fc;})[_0x6623('0x1e')](respondWithFilteredResult(_0x202715,_0x39e8de))[_0x6623('0x28')](handleError(_0x202715,null));};exports[_0x6623('0x4f')]=function(_0x203b66,_0x188e71){var _0x317c78={'raw':![],'where':{'id':_0x203b66['params']['id']}},_0x3e4c95={};_0x3e4c95[_0x6623('0x40')]=_[_0x6623('0x3c')](db['VtigerConfiguration']['rawAttributes']);_0x3e4c95['query']=_[_0x6623('0x3c')](_0x203b66[_0x6623('0x3b')]);_0x3e4c95[_0x6623('0x3d')]=_[_0x6623('0x3e')](_0x3e4c95[_0x6623('0x40')],_0x3e4c95[_0x6623('0x3b')]);_0x317c78[_0x6623('0x3f')]=_['intersection'](_0x3e4c95['model'],qs[_0x6623('0x41')](_0x203b66[_0x6623('0x3b')][_0x6623('0x41')]));_0x317c78['attributes']=_0x317c78[_0x6623('0x3f')][_0x6623('0x50')]?_0x317c78[_0x6623('0x3f')]:_0x3e4c95['model'];if(_0x203b66[_0x6623('0x3b')][_0x6623('0x4b')]){_0x317c78[_0x6623('0x4c')]=[{'all':!![]}];}_0x317c78=_[_0x6623('0x47')]({},_0x317c78,_0x203b66[_0x6623('0x49')]);return db['VtigerConfiguration'][_0x6623('0x51')](_0x317c78)[_0x6623('0x1e')](handleEntityNotFound(_0x188e71,null))[_0x6623('0x1e')](respondWithResult(_0x188e71,null))['catch'](handleError(_0x188e71,null));};exports[_0x6623('0x52')]=function(_0x5e3a06,_0x4d6747){return db[_0x6623('0x38')][_0x6623('0x52')](_0x5e3a06[_0x6623('0x53')],{})[_0x6623('0x1e')](respondWithResult(_0x4d6747,0xc9))[_0x6623('0x28')](handleError(_0x4d6747,null));};exports['update']=function(_0x3f8ee7,_0x2a5057){if(_0x3f8ee7[_0x6623('0x53')]['id']){delete _0x3f8ee7[_0x6623('0x53')]['id'];}return db[_0x6623('0x38')][_0x6623('0x51')]({'where':{'id':_0x3f8ee7[_0x6623('0x54')]['id']}})[_0x6623('0x1e')](handleEntityNotFound(_0x2a5057,null))[_0x6623('0x1e')](saveUpdates(_0x3f8ee7['body'],null))[_0x6623('0x1e')](respondWithResult(_0x2a5057,null))[_0x6623('0x28')](handleError(_0x2a5057,null));};exports[_0x6623('0x32')]=function(_0x39f1a1,_0x1e8278){return db[_0x6623('0x38')]['find']({'where':{'id':_0x39f1a1[_0x6623('0x54')]['id']}})[_0x6623('0x1e')](handleEntityNotFound(_0x1e8278,null))[_0x6623('0x1e')](removeEntity(_0x1e8278,null))[_0x6623('0x28')](handleError(_0x1e8278,null));};exports[_0x6623('0x55')]=function(_0x294762,_0x4a0efd,_0x2e77a0){var _0x31931c={};var _0x36b17a={};var _0x58244a;var _0x3c908b;return db[_0x6623('0x38')][_0x6623('0x56')]({'where':{'id':_0x294762[_0x6623('0x54')]['id']}})[_0x6623('0x1e')](handleEntityNotFound(_0x4a0efd,null))[_0x6623('0x1e')](function(_0x55e010){if(_0x55e010){_0x58244a=_0x55e010;_0x36b17a[_0x6623('0x40')]=_[_0x6623('0x3c')](db[_0x6623('0x57')][_0x6623('0x39')]);_0x36b17a[_0x6623('0x3b')]=_['keys'](_0x294762['query']);_0x36b17a[_0x6623('0x3d')]=_[_0x6623('0x3e')](_0x36b17a['model'],_0x36b17a[_0x6623('0x3b')]);_0x31931c['attributes']=_[_0x6623('0x3e')](_0x36b17a[_0x6623('0x40')],qs['fields'](_0x294762[_0x6623('0x3b')][_0x6623('0x41')]));_0x31931c['attributes']=_0x31931c[_0x6623('0x3f')][_0x6623('0x50')]?_0x31931c[_0x6623('0x3f')]:_0x36b17a['model'];_0x31931c[_0x6623('0x43')]=qs[_0x6623('0x44')](_0x294762[_0x6623('0x3b')][_0x6623('0x44')]);_0x31931c[_0x6623('0x45')]=qs[_0x6623('0x3d')](_[_0x6623('0x58')](_0x294762[_0x6623('0x3b')],_0x36b17a['filters']));if(_0x294762[_0x6623('0x3b')][_0x6623('0x46')]){_0x31931c[_0x6623('0x45')]=_[_0x6623('0x47')](_0x31931c[_0x6623('0x45')],{'$or':_[_0x6623('0x37')](_0x31931c[_0x6623('0x3f')],function(_0x250f31){var _0x56a7a9={};_0x56a7a9[_0x250f31]={'$like':'%'+_0x294762[_0x6623('0x3b')][_0x6623('0x46')]+'%'};return _0x56a7a9;})});}_0x31931c=_[_0x6623('0x47')]({},_0x31931c,_0x294762[_0x6623('0x49')]);return _0x58244a['getFields'](_0x31931c);}})[_0x6623('0x1e')](function(_0xa2278c){if(_0xa2278c){_0x3c908b=_0xa2278c[_0x6623('0x50')];if(!_0x294762[_0x6623('0x3b')][_0x6623('0x42')](_0x6623('0x59'))){_0x31931c[_0x6623('0x2c')]=qs['limit'](_0x294762[_0x6623('0x3b')]['limit']);_0x31931c[_0x6623('0x2b')]=qs[_0x6623('0x2b')](_0x294762[_0x6623('0x3b')]['offset']);}return _0x58244a[_0x6623('0x55')](_0x31931c);}})[_0x6623('0x1e')](function(_0x1d2ec0){if(_0x1d2ec0){return _0x1d2ec0?{'count':_0x3c908b,'rows':_0x1d2ec0}:null;}})[_0x6623('0x1e')](respondWithResult(_0x4a0efd,null))[_0x6623('0x28')](handleError(_0x4a0efd,null));};exports[_0x6623('0x5a')]=function(_0x5f4de8,_0x167468,_0x14dec2){var _0x19699={};var _0x3538db={};var _0xf68f9c;var _0x1c58f1;return db[_0x6623('0x38')]['findOne']({'where':{'id':_0x5f4de8['params']['id']}})['then'](handleEntityNotFound(_0x167468,null))['then'](function(_0x376f42){if(_0x376f42){_0xf68f9c=_0x376f42;_0x3538db[_0x6623('0x40')]=_['keys'](db['VtigerField'][_0x6623('0x39')]);_0x3538db[_0x6623('0x3b')]=_[_0x6623('0x3c')](_0x5f4de8[_0x6623('0x3b')]);_0x3538db[_0x6623('0x3d')]=_[_0x6623('0x3e')](_0x3538db['model'],_0x3538db[_0x6623('0x3b')]);_0x19699['attributes']=_[_0x6623('0x3e')](_0x3538db[_0x6623('0x40')],qs['fields'](_0x5f4de8[_0x6623('0x3b')][_0x6623('0x41')]));_0x19699[_0x6623('0x3f')]=_0x19699[_0x6623('0x3f')][_0x6623('0x50')]?_0x19699[_0x6623('0x3f')]:_0x3538db['model'];_0x19699[_0x6623('0x43')]=qs[_0x6623('0x44')](_0x5f4de8[_0x6623('0x3b')][_0x6623('0x44')]);_0x19699[_0x6623('0x45')]=qs[_0x6623('0x3d')](_['pick'](_0x5f4de8[_0x6623('0x3b')],_0x3538db[_0x6623('0x3d')]));if(_0x5f4de8['query']['filter']){_0x19699['where']=_[_0x6623('0x47')](_0x19699[_0x6623('0x45')],{'$or':_[_0x6623('0x37')](_0x19699[_0x6623('0x3f')],function(_0x2bb588){var _0x29bf4e={};_0x29bf4e[_0x2bb588]={'$like':'%'+_0x5f4de8['query'][_0x6623('0x46')]+'%'};return _0x29bf4e;})});}_0x19699=_[_0x6623('0x47')]({},_0x19699,_0x5f4de8[_0x6623('0x49')]);return _0xf68f9c[_0x6623('0x5a')](_0x19699);}})[_0x6623('0x1e')](function(_0x54313f){if(_0x54313f){_0x1c58f1=_0x54313f[_0x6623('0x50')];if(!_0x5f4de8['query'][_0x6623('0x42')](_0x6623('0x59'))){_0x19699[_0x6623('0x2c')]=qs[_0x6623('0x2c')](_0x5f4de8[_0x6623('0x3b')][_0x6623('0x2c')]);_0x19699[_0x6623('0x2b')]=qs[_0x6623('0x2b')](_0x5f4de8[_0x6623('0x3b')]['offset']);}return _0xf68f9c[_0x6623('0x5a')](_0x19699);}})[_0x6623('0x1e')](function(_0x448751){if(_0x448751){return _0x448751?{'count':_0x1c58f1,'rows':_0x448751}:null;}})[_0x6623('0x1e')](respondWithResult(_0x167468,null))[_0x6623('0x28')](handleError(_0x167468,null));};exports[_0x6623('0x5b')]=function(_0x29112e,_0x23fb3a,_0x4cf4f2){var _0x13cc56={};var _0x1af48a={};var _0x4be277;var _0x132330;return db[_0x6623('0x38')]['findOne']({'where':{'id':_0x29112e['params']['id']}})[_0x6623('0x1e')](handleEntityNotFound(_0x23fb3a,null))[_0x6623('0x1e')](function(_0x49e497){if(_0x49e497){_0x4be277=_0x49e497;_0x1af48a['model']=_['keys'](db[_0x6623('0x57')][_0x6623('0x39')]);_0x1af48a['query']=_[_0x6623('0x3c')](_0x29112e[_0x6623('0x3b')]);_0x1af48a[_0x6623('0x3d')]=_['intersection'](_0x1af48a[_0x6623('0x40')],_0x1af48a[_0x6623('0x3b')]);_0x13cc56[_0x6623('0x3f')]=_[_0x6623('0x3e')](_0x1af48a[_0x6623('0x40')],qs[_0x6623('0x41')](_0x29112e['query'][_0x6623('0x41')]));_0x13cc56['attributes']=_0x13cc56[_0x6623('0x3f')][_0x6623('0x50')]?_0x13cc56[_0x6623('0x3f')]:_0x1af48a[_0x6623('0x40')];_0x13cc56[_0x6623('0x43')]=qs['sort'](_0x29112e[_0x6623('0x3b')][_0x6623('0x44')]);_0x13cc56[_0x6623('0x45')]=qs[_0x6623('0x3d')](_[_0x6623('0x58')](_0x29112e[_0x6623('0x3b')],_0x1af48a[_0x6623('0x3d')]));if(_0x29112e[_0x6623('0x3b')][_0x6623('0x46')]){_0x13cc56[_0x6623('0x45')]=_[_0x6623('0x47')](_0x13cc56['where'],{'$or':_['map'](_0x13cc56[_0x6623('0x3f')],function(_0x5dd19d){var _0x392f92={};_0x392f92[_0x5dd19d]={'$like':'%'+_0x29112e[_0x6623('0x3b')]['filter']+'%'};return _0x392f92;})});}_0x13cc56=_[_0x6623('0x47')]({},_0x13cc56,_0x29112e[_0x6623('0x49')]);return _0x4be277[_0x6623('0x5b')](_0x13cc56);}})[_0x6623('0x1e')](function(_0x665e16){if(_0x665e16){_0x132330=_0x665e16[_0x6623('0x50')];if(!_0x29112e['query']['hasOwnProperty'](_0x6623('0x59'))){_0x13cc56[_0x6623('0x2c')]=qs[_0x6623('0x2c')](_0x29112e['query'][_0x6623('0x2c')]);_0x13cc56[_0x6623('0x2b')]=qs[_0x6623('0x2b')](_0x29112e[_0x6623('0x3b')][_0x6623('0x2b')]);}return _0x4be277[_0x6623('0x5b')](_0x13cc56);}})['then'](function(_0x5e6233){if(_0x5e6233){return _0x5e6233?{'count':_0x132330,'rows':_0x5e6233}:null;}})[_0x6623('0x1e')](respondWithResult(_0x23fb3a,null))['catch'](handleError(_0x23fb3a,null));};
\ No newline at end of file
diff --git a/server/api/intVtigerConfiguration/intVtigerConfiguration.model.js b/server/api/intVtigerConfiguration/intVtigerConfiguration.model.js
index 73b5f6a..4dd2423 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 _0x9e6f=['../../config/logger','api','moment','request-promise','path','../../config/environment','./intVtigerConfiguration.attributes','exports','define','VtigerConfiguration','lodash'];(function(_0xd1ff65,_0x92ef72){var _0x423db1=function(_0x1fe121){while(--_0x1fe121){_0xd1ff65['push'](_0xd1ff65['shift']());}};_0x423db1(++_0x92ef72);}(_0x9e6f,0xc5));var _0xf9e6=function(_0x565c49,_0x54acd0){_0x565c49=_0x565c49-0x0;var _0x20ca34=_0x9e6f[_0x565c49];return _0x20ca34;};'use strict';var _=require(_0xf9e6('0x0'));var util=require('util');var logger=require(_0xf9e6('0x1'))(_0xf9e6('0x2'));var moment=require(_0xf9e6('0x3'));var BPromise=require('bluebird');var rp=require(_0xf9e6('0x4'));var fs=require('fs');var path=require(_0xf9e6('0x5'));var rimraf=require('rimraf');var config=require(_0xf9e6('0x6'));var attributes=require(_0xf9e6('0x7'));module[_0xf9e6('0x8')]=function(_0x20d13b,_0x1eb98b){return _0x20d13b[_0xf9e6('0x9')](_0xf9e6('0xa'),attributes,{'tableName':'int_vtiger_configurations','paranoid':![],'indexes':[],'timestamps':!![]});};
\ No newline at end of file
+var _0x548f=['VtigerConfiguration','int_vtiger_configurations','util','../../config/logger','api','moment','request-promise','../../config/environment','exports','define'];(function(_0x224022,_0x638fe1){var _0x4359a6=function(_0x493033){while(--_0x493033){_0x224022['push'](_0x224022['shift']());}};_0x4359a6(++_0x638fe1);}(_0x548f,0x11a));var _0xf548=function(_0x2070da,_0x45e586){_0x2070da=_0x2070da-0x0;var _0x4f9fe1=_0x548f[_0x2070da];return _0x4f9fe1;};'use strict';var _=require('lodash');var util=require(_0xf548('0x0'));var logger=require(_0xf548('0x1'))(_0xf548('0x2'));var moment=require(_0xf548('0x3'));var BPromise=require('bluebird');var rp=require(_0xf548('0x4'));var fs=require('fs');var path=require('path');var rimraf=require('rimraf');var config=require(_0xf548('0x5'));var attributes=require('./intVtigerConfiguration.attributes');module[_0xf548('0x6')]=function(_0x187a11,_0x4cd8c9){return _0x187a11[_0xf548('0x7')](_0xf548('0x8'),attributes,{'tableName':_0xf548('0x9'),'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 dc44e51..40cd622 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 _0x8ceb=['bluebird','randomstring','ioredis','../../config/utils','../../config/logger','jayson/promise','client','request','then','debug','VtigerConfiguration,\x20%s,\x20%s,\x20%s','request\x20sent','stringify','error','code','VtigerConfiguration,\x20%s,\x20%s','message','result','catch','util','moment'];(function(_0x3a8744,_0x57b7ca){var _0x4f9e91=function(_0x3d7ce9){while(--_0x3d7ce9){_0x3a8744['push'](_0x3a8744['shift']());}};_0x4f9e91(++_0x57b7ca);}(_0x8ceb,0x91));var _0xb8ce=function(_0x57643d,_0x49d621){_0x57643d=_0x57643d-0x0;var _0x5d1e43=_0x8ceb[_0x57643d];return _0x5d1e43;};'use strict';var _=require('lodash');var util=require(_0xb8ce('0x0'));var moment=require(_0xb8ce('0x1'));var BPromise=require(_0xb8ce('0x2'));var rs=require(_0xb8ce('0x3'));var fs=require('fs');var Redis=require(_0xb8ce('0x4'));var db=require('../../mysqldb')['db'];var utils=require(_0xb8ce('0x5'));var logger=require(_0xb8ce('0x6'))('rpc');var config=require('../../config/environment');var jayson=require(_0xb8ce('0x7'));var client=jayson[_0xb8ce('0x8')]['http']({'port':0x232a});function respondWithRpcPromise(_0x5449df,_0x8efd8e,_0x352f9d){return new BPromise(function(_0x50a46f,_0x1f6084){return client[_0xb8ce('0x9')](_0x5449df,_0x352f9d)[_0xb8ce('0xa')](function(_0x34fd67){logger['info']('VtigerConfiguration,\x20%s,\x20%s',_0x8efd8e,'request\x20sent');logger[_0xb8ce('0xb')](_0xb8ce('0xc'),_0x8efd8e,_0xb8ce('0xd'),JSON[_0xb8ce('0xe')](_0x34fd67));if(_0x34fd67['error']){if(_0x34fd67[_0xb8ce('0xf')][_0xb8ce('0x10')]===0x1f4){logger[_0xb8ce('0xf')](_0xb8ce('0x11'),_0x8efd8e,_0x34fd67[_0xb8ce('0xf')][_0xb8ce('0x12')]);return _0x1f6084(_0x34fd67[_0xb8ce('0xf')][_0xb8ce('0x12')]);}logger[_0xb8ce('0xf')]('VtigerConfiguration,\x20%s,\x20%s',_0x8efd8e,_0x34fd67[_0xb8ce('0xf')][_0xb8ce('0x12')]);return _0x50a46f(_0x34fd67[_0xb8ce('0xf')][_0xb8ce('0x12')]);}else{logger['info'](_0xb8ce('0x11'),_0x8efd8e,_0xb8ce('0xd'));_0x50a46f(_0x34fd67[_0xb8ce('0x13')][_0xb8ce('0x12')]);}})[_0xb8ce('0x14')](function(_0x1ae4d7){logger[_0xb8ce('0xf')](_0xb8ce('0x11'),_0x8efd8e,_0x1ae4d7);_0x1f6084(_0x1ae4d7);});});}
\ No newline at end of file
+var _0x687a=['result','catch','util','moment','randomstring','ioredis','../../config/logger','rpc','../../config/environment','jayson/promise','client','request','request\x20sent','stringify','error','code','VtigerConfiguration,\x20%s,\x20%s','message','info'];(function(_0x4081e3,_0x5edd4e){var _0x410872=function(_0x4c5a22){while(--_0x4c5a22){_0x4081e3['push'](_0x4081e3['shift']());}};_0x410872(++_0x5edd4e);}(_0x687a,0x1ca));var _0xa687=function(_0x4b369d,_0x265eb8){_0x4b369d=_0x4b369d-0x0;var _0x571a98=_0x687a[_0x4b369d];return _0x571a98;};'use strict';var _=require('lodash');var util=require(_0xa687('0x0'));var moment=require(_0xa687('0x1'));var BPromise=require('bluebird');var rs=require(_0xa687('0x2'));var fs=require('fs');var Redis=require(_0xa687('0x3'));var db=require('../../mysqldb')['db'];var utils=require('../../config/utils');var logger=require(_0xa687('0x4'))(_0xa687('0x5'));var config=require(_0xa687('0x6'));var jayson=require(_0xa687('0x7'));var client=jayson[_0xa687('0x8')]['http']({'port':0x232a});function respondWithRpcPromise(_0x29ed84,_0x5d70d3,_0x56d18f){return new BPromise(function(_0x37d2bb,_0x5644d5){return client[_0xa687('0x9')](_0x29ed84,_0x56d18f)['then'](function(_0x2806b7){logger['info']('VtigerConfiguration,\x20%s,\x20%s',_0x5d70d3,_0xa687('0xa'));logger['debug']('VtigerConfiguration,\x20%s,\x20%s,\x20%s',_0x5d70d3,'request\x20sent',JSON[_0xa687('0xb')](_0x2806b7));if(_0x2806b7[_0xa687('0xc')]){if(_0x2806b7[_0xa687('0xc')][_0xa687('0xd')]===0x1f4){logger[_0xa687('0xc')](_0xa687('0xe'),_0x5d70d3,_0x2806b7['error'][_0xa687('0xf')]);return _0x5644d5(_0x2806b7[_0xa687('0xc')][_0xa687('0xf')]);}logger[_0xa687('0xc')](_0xa687('0xe'),_0x5d70d3,_0x2806b7[_0xa687('0xc')][_0xa687('0xf')]);return _0x37d2bb(_0x2806b7[_0xa687('0xc')][_0xa687('0xf')]);}else{logger[_0xa687('0x10')](_0xa687('0xe'),_0x5d70d3,_0xa687('0xa'));_0x37d2bb(_0x2806b7[_0xa687('0x11')][_0xa687('0xf')]);}})[_0xa687('0x12')](function(_0x1ce859){logger['error'](_0xa687('0xe'),_0x5d70d3,_0x1ce859);_0x5644d5(_0x1ce859);});});}
\ No newline at end of file
diff --git a/server/api/intVtigerField/index.js b/server/api/intVtigerField/index.js
index 9a72947..2ffda4c 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 _0xac54=['../../components/auth/service','../../components/interaction/service','../../config/environment','./intVtigerField.controller','get','index','/:id','isAuthenticated','show','post','create','update','delete','exports','multer','util','connect-timeout','express'];(function(_0x146802,_0x5f2977){var _0x5a8a52=function(_0x3f1e79){while(--_0x3f1e79){_0x146802['push'](_0x146802['shift']());}};_0x5a8a52(++_0x5f2977);}(_0xac54,0xb0));var _0x4ac5=function(_0x20f386,_0x19c16b){_0x20f386=_0x20f386-0x0;var _0x4d2ae2=_0xac54[_0x20f386];return _0x4d2ae2;};'use strict';var multer=require(_0x4ac5('0x0'));var util=require(_0x4ac5('0x1'));var path=require('path');var timeout=require(_0x4ac5('0x2'));var express=require(_0x4ac5('0x3'));var router=express['Router']();var auth=require(_0x4ac5('0x4'));var interaction=require(_0x4ac5('0x5'));var config=require(_0x4ac5('0x6'));var controller=require(_0x4ac5('0x7'));router[_0x4ac5('0x8')]('/',auth['isAuthenticated'](),controller[_0x4ac5('0x9')]);router[_0x4ac5('0x8')](_0x4ac5('0xa'),auth[_0x4ac5('0xb')](),controller[_0x4ac5('0xc')]);router[_0x4ac5('0xd')]('/',auth[_0x4ac5('0xb')](),controller[_0x4ac5('0xe')]);router['put'](_0x4ac5('0xa'),auth[_0x4ac5('0xb')](),controller[_0x4ac5('0xf')]);router[_0x4ac5('0x10')]('/:id',auth['isAuthenticated'](),controller['destroy']);module[_0x4ac5('0x11')]=router;
\ No newline at end of file
+var _0x1915=['get','isAuthenticated','index','/:id','show','post','create','put','update','delete','destroy','exports','multer','util','path','connect-timeout','express','./intVtigerField.controller'];(function(_0x3ff085,_0x27c92e){var _0x2b68c3=function(_0x37811e){while(--_0x37811e){_0x3ff085['push'](_0x3ff085['shift']());}};_0x2b68c3(++_0x27c92e);}(_0x1915,0x150));var _0x5191=function(_0x321bb2,_0x202794){_0x321bb2=_0x321bb2-0x0;var _0x9c12ed=_0x1915[_0x321bb2];return _0x9c12ed;};'use strict';var multer=require(_0x5191('0x0'));var util=require(_0x5191('0x1'));var path=require(_0x5191('0x2'));var timeout=require(_0x5191('0x3'));var express=require(_0x5191('0x4'));var router=express['Router']();var auth=require('../../components/auth/service');var interaction=require('../../components/interaction/service');var config=require('../../config/environment');var controller=require(_0x5191('0x5'));router[_0x5191('0x6')]('/',auth[_0x5191('0x7')](),controller[_0x5191('0x8')]);router['get'](_0x5191('0x9'),auth['isAuthenticated'](),controller[_0x5191('0xa')]);router[_0x5191('0xb')]('/',auth[_0x5191('0x7')](),controller[_0x5191('0xc')]);router[_0x5191('0xd')](_0x5191('0x9'),auth[_0x5191('0x7')](),controller[_0x5191('0xe')]);router[_0x5191('0xf')](_0x5191('0x9'),auth[_0x5191('0x7')](),controller[_0x5191('0x10')]);module[_0x5191('0x11')]=router;
\ No newline at end of file
diff --git a/server/api/intVtigerField/intVtigerField.attributes.js b/server/api/intVtigerField/intVtigerField.attributes.js
index 5081e5d..67bf55e 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 _0x6bdc=['ENUM','string','variable','customVariable','keyValue','STRING','sequelize','exports'];(function(_0x25a22b,_0x4ee12c){var _0x41fbe4=function(_0x3c8efc){while(--_0x3c8efc){_0x25a22b['push'](_0x25a22b['shift']());}};_0x41fbe4(++_0x4ee12c);}(_0x6bdc,0x14e));var _0xc6bd=function(_0x33b77c,_0x24aef9){_0x33b77c=_0x33b77c-0x0;var _0x5e3c2c=_0x6bdc[_0x33b77c];return _0x5e3c2c;};'use strict';var Sequelize=require(_0xc6bd('0x0'));module[_0xc6bd('0x1')]={'type':{'type':Sequelize[_0xc6bd('0x2')](_0xc6bd('0x3'),_0xc6bd('0x4'),_0xc6bd('0x5'),_0xc6bd('0x6')),'defaultValue':_0xc6bd('0x3')},'content':{'type':Sequelize[_0xc6bd('0x7')]},'key':{'type':Sequelize[_0xc6bd('0x7')]},'keyType':{'type':Sequelize['ENUM'](_0xc6bd('0x3'),_0xc6bd('0x4'),_0xc6bd('0x5'))},'keyContent':{'type':Sequelize[_0xc6bd('0x7')]},'idField':{'type':Sequelize[_0xc6bd('0x7')]},'nameField':{'type':Sequelize[_0xc6bd('0x7')]},'customField':{'type':Sequelize['BOOLEAN'],'defaultValue':!![]},'variableName':{'type':Sequelize[_0xc6bd('0x7')]}};
\ No newline at end of file
+var _0x9b6d=['keyValue','STRING','exports','ENUM','string','variable','customVariable'];(function(_0x576dd3,_0x1bd733){var _0x41100d=function(_0x528d1a){while(--_0x528d1a){_0x576dd3['push'](_0x576dd3['shift']());}};_0x41100d(++_0x1bd733);}(_0x9b6d,0x105));var _0xd9b6=function(_0x5339e8,_0x36ef5e){_0x5339e8=_0x5339e8-0x0;var _0x59a010=_0x9b6d[_0x5339e8];return _0x59a010;};'use strict';var Sequelize=require('sequelize');module[_0xd9b6('0x0')]={'type':{'type':Sequelize[_0xd9b6('0x1')](_0xd9b6('0x2'),_0xd9b6('0x3'),_0xd9b6('0x4'),_0xd9b6('0x5')),'defaultValue':_0xd9b6('0x2')},'content':{'type':Sequelize[_0xd9b6('0x6')]},'key':{'type':Sequelize[_0xd9b6('0x6')]},'keyType':{'type':Sequelize[_0xd9b6('0x1')](_0xd9b6('0x2'),'variable',_0xd9b6('0x4'))},'keyContent':{'type':Sequelize[_0xd9b6('0x6')]},'idField':{'type':Sequelize[_0xd9b6('0x6')]},'nameField':{'type':Sequelize[_0xd9b6('0x6')]},'customField':{'type':Sequelize['BOOLEAN'],'defaultValue':!![]},'variableName':{'type':Sequelize[_0xd9b6('0x6')]}};
\ No newline at end of file
diff --git a/server/api/intVtigerField/intVtigerField.controller.js b/server/api/intVtigerField/intVtigerField.controller.js
index 500492a..c1c3e06 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 _0x16a5=['offset','set','Content-Range','apply','update','then','sendStatus','error','stack','name','index','map','VtigerField','rawAttributes','type','key','query','keys','intersection','model','attributes','fields','length','hasOwnProperty','nolimit','limit','order','sort','where','filters','pick','merge','VIRTUAL','filter','options','includeAll','include','findAll','catch','params','find','create','body','destroy','html-pdf','eml-format','rimraf','zip-dir','request-promise','moment','bluebird','mustache','util','sox','to-csv','ejs','lodash','squel','crypto','jsforce','querystring','papaparse','ioredis','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/logger','api','../../config/utils','../../config/environment','end','status','json','count'];(function(_0x2e9f19,_0x52a4ab){var _0x3dacd3=function(_0x5e9baf){while(--_0x5e9baf){_0x2e9f19['push'](_0x2e9f19['shift']());}};_0x3dacd3(++_0x52a4ab);}(_0x16a5,0x199));var _0x516a=function(_0x2cfb58,_0x3d9412){_0x2cfb58=_0x2cfb58-0x0;var _0xd99951=_0x16a5[_0x2cfb58];return _0xd99951;};'use strict';var pdf=require(_0x516a('0x0'));var emlformat=require(_0x516a('0x1'));var rimraf=require(_0x516a('0x2'));var zipdir=require(_0x516a('0x3'));var jsonpatch=require('fast-json-patch');var rp=require(_0x516a('0x4'));var moment=require(_0x516a('0x5'));var BPromise=require(_0x516a('0x6'));var Mustache=require(_0x516a('0x7'));var util=require(_0x516a('0x8'));var path=require('path');var sox=require(_0x516a('0x9'));var csv=require(_0x516a('0xa'));var ejs=require(_0x516a('0xb'));var fs=require('fs');var _=require(_0x516a('0xc'));var squel=require(_0x516a('0xd'));var crypto=require(_0x516a('0xe'));var jsforce=require(_0x516a('0xf'));var deskjs=require('desk.js');var toCsv=require('to-csv');var querystring=require(_0x516a('0x10'));var Papa=require(_0x516a('0x11'));var Redis=require(_0x516a('0x12'));var authService=require('../../components/auth/service');var qs=require(_0x516a('0x13'));var as=require(_0x516a('0x14'));var hardwareService=require('../../config/license/hardware');var logger=require(_0x516a('0x15'))(_0x516a('0x16'));var utils=require(_0x516a('0x17'));var config=require(_0x516a('0x18'));var db=require('../../mysqldb')['db'];function respondWithStatusCode(_0x141d84,_0x3f63a1){_0x3f63a1=_0x3f63a1||0xcc;return function(_0x54df16){if(_0x54df16){return _0x141d84['sendStatus'](_0x3f63a1);}return _0x141d84['status'](_0x3f63a1)[_0x516a('0x19')]();};}function respondWithResult(_0x3f4e6e,_0x1f7c84){_0x1f7c84=_0x1f7c84||0xc8;return function(_0x54ca14){if(_0x54ca14){return _0x3f4e6e[_0x516a('0x1a')](_0x1f7c84)[_0x516a('0x1b')](_0x54ca14);}};}function respondWithFilteredResult(_0x28a5e6,_0x664b16){return function(_0x104a56){if(_0x104a56){var _0x543694=_0x104a56[_0x516a('0x1c')],_0xd81e38=_0x664b16[_0x516a('0x1d')],_0x19ffd3=_0x664b16[_0x516a('0x1d')]+_0x664b16['limit'],_0x11aac6;if(_0x19ffd3>=_0x543694){_0x19ffd3=_0x543694;_0x11aac6=0xc8;}else{_0x11aac6=0xce;}_0x28a5e6['status'](_0x11aac6);return _0x28a5e6[_0x516a('0x1e')](_0x516a('0x1f'),_0xd81e38+'-'+_0x19ffd3+'/'+_0x543694)[_0x516a('0x1b')](_0x104a56);}return null;};}function patchUpdates(_0x21827d){return function(_0x552849){try{jsonpatch[_0x516a('0x20')](_0x552849,_0x21827d,!![]);}catch(_0x3cb6c9){return BPromise['reject'](_0x3cb6c9);}return _0x552849['save']();};}function saveUpdates(_0x3111fb,_0x174468){return function(_0x419556){if(_0x419556){return _0x419556[_0x516a('0x21')](_0x3111fb)[_0x516a('0x22')](function(_0xcba378){return _0xcba378;});}return null;};}function removeEntity(_0x833854,_0x51a1ee){return function(_0xa299e7){if(_0xa299e7){return _0xa299e7['destroy']()[_0x516a('0x22')](function(){_0x833854[_0x516a('0x1a')](0xcc)['end']();});}};}function handleEntityNotFound(_0x2030e7,_0x26aaaf){return function(_0x4b51e4){if(!_0x4b51e4){_0x2030e7[_0x516a('0x23')](0x194);}return _0x4b51e4;};}function handleError(_0x4d62e8,_0x11d9f1){_0x11d9f1=_0x11d9f1||0x1f4;return function(_0x5d5949){logger[_0x516a('0x24')](_0x5d5949[_0x516a('0x25')]);if(_0x5d5949['name']){delete _0x5d5949[_0x516a('0x26')];}_0x4d62e8[_0x516a('0x1a')](_0x11d9f1)['send'](_0x5d5949);};}exports[_0x516a('0x27')]=function(_0x31c332,_0x17ee89){var _0x5b02b1={},_0xe553b2={},_0x212844={'count':0x0,'rows':[]};var _0x577367=_[_0x516a('0x28')](db[_0x516a('0x29')][_0x516a('0x2a')],function(_0x3258ac){return{'name':_0x3258ac['fieldName'],'type':_0x3258ac[_0x516a('0x2b')][_0x516a('0x2c')]};});_0xe553b2['model']=_['map'](_0x577367,_0x516a('0x26'));_0xe553b2[_0x516a('0x2d')]=_[_0x516a('0x2e')](_0x31c332[_0x516a('0x2d')]);_0xe553b2['filters']=_[_0x516a('0x2f')](_0xe553b2[_0x516a('0x30')],_0xe553b2[_0x516a('0x2d')]);_0x5b02b1[_0x516a('0x31')]=_[_0x516a('0x2f')](_0xe553b2['model'],qs[_0x516a('0x32')](_0x31c332[_0x516a('0x2d')][_0x516a('0x32')]));_0x5b02b1[_0x516a('0x31')]=_0x5b02b1[_0x516a('0x31')][_0x516a('0x33')]?_0x5b02b1[_0x516a('0x31')]:_0xe553b2['model'];if(!_0x31c332['query'][_0x516a('0x34')](_0x516a('0x35'))){_0x5b02b1[_0x516a('0x36')]=qs['limit'](_0x31c332[_0x516a('0x2d')]['limit']);_0x5b02b1['offset']=qs['offset'](_0x31c332['query'][_0x516a('0x1d')]);}_0x5b02b1[_0x516a('0x37')]=qs[_0x516a('0x38')](_0x31c332[_0x516a('0x2d')][_0x516a('0x38')]);_0x5b02b1[_0x516a('0x39')]=qs[_0x516a('0x3a')](_[_0x516a('0x3b')](_0x31c332[_0x516a('0x2d')],_0xe553b2['filters']));if(_0x31c332['query']['filter']){_0x5b02b1['where']=_[_0x516a('0x3c')](_0x5b02b1[_0x516a('0x39')],{'$or':_['map'](_0x577367,function(_0x45a9a5){if(_0x45a9a5[_0x516a('0x2b')]!==_0x516a('0x3d')){var _0x459260={};_0x459260[_0x45a9a5['name']]={'$like':'%'+_0x31c332[_0x516a('0x2d')][_0x516a('0x3e')]+'%'};return _0x459260;}})});}_0x5b02b1=_['merge']({},_0x5b02b1,_0x31c332[_0x516a('0x3f')]);var _0x1c40a1={'where':_0x5b02b1[_0x516a('0x39')]};return db[_0x516a('0x29')]['count'](_0x1c40a1)['then'](function(_0x1fbac8){_0x212844[_0x516a('0x1c')]=_0x1fbac8;if(_0x31c332['query'][_0x516a('0x40')]){_0x5b02b1[_0x516a('0x41')]=[{'all':!![]}];}return db[_0x516a('0x29')][_0x516a('0x42')](_0x5b02b1);})[_0x516a('0x22')](function(_0x323c1b){_0x212844['rows']=_0x323c1b;return _0x212844;})[_0x516a('0x22')](respondWithFilteredResult(_0x17ee89,_0x5b02b1))[_0x516a('0x43')](handleError(_0x17ee89,null));};exports['show']=function(_0x3b7d1e,_0x16055e){var _0x3fa03a={'raw':!![],'where':{'id':_0x3b7d1e[_0x516a('0x44')]['id']}},_0x4ca0e9={};_0x4ca0e9[_0x516a('0x30')]=_[_0x516a('0x2e')](db['VtigerField'][_0x516a('0x2a')]);_0x4ca0e9[_0x516a('0x2d')]=_[_0x516a('0x2e')](_0x3b7d1e[_0x516a('0x2d')]);_0x4ca0e9['filters']=_['intersection'](_0x4ca0e9[_0x516a('0x30')],_0x4ca0e9[_0x516a('0x2d')]);_0x3fa03a[_0x516a('0x31')]=_[_0x516a('0x2f')](_0x4ca0e9[_0x516a('0x30')],qs[_0x516a('0x32')](_0x3b7d1e[_0x516a('0x2d')][_0x516a('0x32')]));_0x3fa03a['attributes']=_0x3fa03a[_0x516a('0x31')][_0x516a('0x33')]?_0x3fa03a[_0x516a('0x31')]:_0x4ca0e9['model'];if(_0x3b7d1e['query'][_0x516a('0x40')]){_0x3fa03a[_0x516a('0x41')]=[{'all':!![]}];}_0x3fa03a=_[_0x516a('0x3c')]({},_0x3fa03a,_0x3b7d1e[_0x516a('0x3f')]);return db['VtigerField'][_0x516a('0x45')](_0x3fa03a)['then'](handleEntityNotFound(_0x16055e,null))[_0x516a('0x22')](respondWithResult(_0x16055e,null))[_0x516a('0x43')](handleError(_0x16055e,null));};exports['create']=function(_0xe998a0,_0x567bae){return db[_0x516a('0x29')][_0x516a('0x46')](_0xe998a0['body'],{})['then'](respondWithResult(_0x567bae,0xc9))['catch'](handleError(_0x567bae,null));};exports['update']=function(_0x1b71a6,_0x5c6928){if(_0x1b71a6[_0x516a('0x47')]['id']){delete _0x1b71a6[_0x516a('0x47')]['id'];}return db['VtigerField']['find']({'where':{'id':_0x1b71a6[_0x516a('0x44')]['id']}})[_0x516a('0x22')](handleEntityNotFound(_0x5c6928,null))[_0x516a('0x22')](saveUpdates(_0x1b71a6[_0x516a('0x47')],null))[_0x516a('0x22')](respondWithResult(_0x5c6928,null))[_0x516a('0x43')](handleError(_0x5c6928,null));};exports[_0x516a('0x48')]=function(_0xf7fe5e,_0x2410be){return db[_0x516a('0x29')][_0x516a('0x45')]({'where':{'id':_0xf7fe5e[_0x516a('0x44')]['id']}})[_0x516a('0x22')](handleEntityNotFound(_0x2410be,null))['then'](removeEntity(_0x2410be,null))[_0x516a('0x43')](handleError(_0x2410be,null));};
\ No newline at end of file
+var _0x683e=['filters','intersection','attributes','fields','model','hasOwnProperty','nolimit','order','sort','where','pick','filter','VIRTUAL','merge','options','findAll','show','params','length','include','find','catch','create','body','html-pdf','eml-format','rimraf','moment','bluebird','mustache','util','path','sox','ejs','lodash','squel','crypto','jsforce','desk.js','to-csv','querystring','papaparse','ioredis','../../components/parsers/qs','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/environment','../../mysqldb','end','status','json','count','offset','limit','set','apply','reject','update','then','sendStatus','stack','name','index','map','VtigerField','rawAttributes','type','query','keys'];(function(_0x198d29,_0x1171a8){var _0x5dfeb8=function(_0x364e07){while(--_0x364e07){_0x198d29['push'](_0x198d29['shift']());}};_0x5dfeb8(++_0x1171a8);}(_0x683e,0xa6));var _0xe683=function(_0x2f7e15,_0x6e0949){_0x2f7e15=_0x2f7e15-0x0;var _0xbf1bf1=_0x683e[_0x2f7e15];return _0xbf1bf1;};'use strict';var pdf=require(_0xe683('0x0'));var emlformat=require(_0xe683('0x1'));var rimraf=require(_0xe683('0x2'));var zipdir=require('zip-dir');var jsonpatch=require('fast-json-patch');var rp=require('request-promise');var moment=require(_0xe683('0x3'));var BPromise=require(_0xe683('0x4'));var Mustache=require(_0xe683('0x5'));var util=require(_0xe683('0x6'));var path=require(_0xe683('0x7'));var sox=require(_0xe683('0x8'));var csv=require('to-csv');var ejs=require(_0xe683('0x9'));var fs=require('fs');var _=require(_0xe683('0xa'));var squel=require(_0xe683('0xb'));var crypto=require(_0xe683('0xc'));var jsforce=require(_0xe683('0xd'));var deskjs=require(_0xe683('0xe'));var toCsv=require(_0xe683('0xf'));var querystring=require(_0xe683('0x10'));var Papa=require(_0xe683('0x11'));var Redis=require(_0xe683('0x12'));var authService=require('../../components/auth/service');var qs=require(_0xe683('0x13'));var as=require('../../components/parsers/advancedSearch');var hardwareService=require(_0xe683('0x14'));var logger=require(_0xe683('0x15'))(_0xe683('0x16'));var utils=require(_0xe683('0x17'));var config=require(_0xe683('0x18'));var db=require(_0xe683('0x19'))['db'];function respondWithStatusCode(_0x44752b,_0x5a652e){_0x5a652e=_0x5a652e||0xcc;return function(_0x5650d6){if(_0x5650d6){return _0x44752b['sendStatus'](_0x5a652e);}return _0x44752b['status'](_0x5a652e)[_0xe683('0x1a')]();};}function respondWithResult(_0x314715,_0x27b404){_0x27b404=_0x27b404||0xc8;return function(_0x2cfe04){if(_0x2cfe04){return _0x314715[_0xe683('0x1b')](_0x27b404)[_0xe683('0x1c')](_0x2cfe04);}};}function respondWithFilteredResult(_0x279c4f,_0x486327){return function(_0x48ea44){if(_0x48ea44){var _0x50527c=_0x48ea44[_0xe683('0x1d')],_0x1f874a=_0x486327[_0xe683('0x1e')],_0xbc0223=_0x486327[_0xe683('0x1e')]+_0x486327[_0xe683('0x1f')],_0x3cd74d;if(_0xbc0223>=_0x50527c){_0xbc0223=_0x50527c;_0x3cd74d=0xc8;}else{_0x3cd74d=0xce;}_0x279c4f[_0xe683('0x1b')](_0x3cd74d);return _0x279c4f[_0xe683('0x20')]('Content-Range',_0x1f874a+'-'+_0xbc0223+'/'+_0x50527c)[_0xe683('0x1c')](_0x48ea44);}return null;};}function patchUpdates(_0x4c0b76){return function(_0x4d7299){try{jsonpatch[_0xe683('0x21')](_0x4d7299,_0x4c0b76,!![]);}catch(_0x566ee3){return BPromise[_0xe683('0x22')](_0x566ee3);}return _0x4d7299['save']();};}function saveUpdates(_0xdc7a48,_0x3935e0){return function(_0x52975){if(_0x52975){return _0x52975[_0xe683('0x23')](_0xdc7a48)[_0xe683('0x24')](function(_0x38f3e0){return _0x38f3e0;});}return null;};}function removeEntity(_0x358455,_0x2073cf){return function(_0x71e16d){if(_0x71e16d){return _0x71e16d['destroy']()['then'](function(){_0x358455['status'](0xcc)['end']();});}};}function handleEntityNotFound(_0x180674,_0x12ed5a){return function(_0x40c080){if(!_0x40c080){_0x180674[_0xe683('0x25')](0x194);}return _0x40c080;};}function handleError(_0x5509b9,_0x6c268e){_0x6c268e=_0x6c268e||0x1f4;return function(_0x303f7d){logger['error'](_0x303f7d[_0xe683('0x26')]);if(_0x303f7d[_0xe683('0x27')]){delete _0x303f7d[_0xe683('0x27')];}_0x5509b9['status'](_0x6c268e)['send'](_0x303f7d);};}exports[_0xe683('0x28')]=function(_0x52f025,_0x301e60){var _0x344401={},_0x41eebe={},_0x58c218={'count':0x0,'rows':[]};var _0x57ef7f=_[_0xe683('0x29')](db[_0xe683('0x2a')][_0xe683('0x2b')],function(_0x1aeee4){return{'name':_0x1aeee4['fieldName'],'type':_0x1aeee4[_0xe683('0x2c')]['key']};});_0x41eebe['model']=_[_0xe683('0x29')](_0x57ef7f,_0xe683('0x27'));_0x41eebe[_0xe683('0x2d')]=_[_0xe683('0x2e')](_0x52f025[_0xe683('0x2d')]);_0x41eebe[_0xe683('0x2f')]=_[_0xe683('0x30')](_0x41eebe['model'],_0x41eebe[_0xe683('0x2d')]);_0x344401[_0xe683('0x31')]=_['intersection'](_0x41eebe['model'],qs[_0xe683('0x32')](_0x52f025[_0xe683('0x2d')][_0xe683('0x32')]));_0x344401['attributes']=_0x344401[_0xe683('0x31')]['length']?_0x344401[_0xe683('0x31')]:_0x41eebe[_0xe683('0x33')];if(!_0x52f025[_0xe683('0x2d')][_0xe683('0x34')](_0xe683('0x35'))){_0x344401['limit']=qs[_0xe683('0x1f')](_0x52f025[_0xe683('0x2d')][_0xe683('0x1f')]);_0x344401[_0xe683('0x1e')]=qs[_0xe683('0x1e')](_0x52f025[_0xe683('0x2d')][_0xe683('0x1e')]);}_0x344401[_0xe683('0x36')]=qs[_0xe683('0x37')](_0x52f025['query'][_0xe683('0x37')]);_0x344401[_0xe683('0x38')]=qs[_0xe683('0x2f')](_[_0xe683('0x39')](_0x52f025[_0xe683('0x2d')],_0x41eebe[_0xe683('0x2f')]));if(_0x52f025[_0xe683('0x2d')][_0xe683('0x3a')]){_0x344401['where']=_['merge'](_0x344401[_0xe683('0x38')],{'$or':_[_0xe683('0x29')](_0x57ef7f,function(_0x9214ab){if(_0x9214ab[_0xe683('0x2c')]!==_0xe683('0x3b')){var _0xcb0981={};_0xcb0981[_0x9214ab[_0xe683('0x27')]]={'$like':'%'+_0x52f025['query'][_0xe683('0x3a')]+'%'};return _0xcb0981;}})});}_0x344401=_[_0xe683('0x3c')]({},_0x344401,_0x52f025[_0xe683('0x3d')]);var _0x1794cf={'where':_0x344401['where']};return db[_0xe683('0x2a')][_0xe683('0x1d')](_0x1794cf)[_0xe683('0x24')](function(_0xc7cf5e){_0x58c218[_0xe683('0x1d')]=_0xc7cf5e;if(_0x52f025[_0xe683('0x2d')]['includeAll']){_0x344401['include']=[{'all':!![]}];}return db[_0xe683('0x2a')][_0xe683('0x3e')](_0x344401);})[_0xe683('0x24')](function(_0x12f67b){_0x58c218['rows']=_0x12f67b;return _0x58c218;})[_0xe683('0x24')](respondWithFilteredResult(_0x301e60,_0x344401))['catch'](handleError(_0x301e60,null));};exports[_0xe683('0x3f')]=function(_0x5b723c,_0x185e44){var _0x1bdeaf={'raw':!![],'where':{'id':_0x5b723c[_0xe683('0x40')]['id']}},_0x7a3608={};_0x7a3608[_0xe683('0x33')]=_['keys'](db[_0xe683('0x2a')]['rawAttributes']);_0x7a3608[_0xe683('0x2d')]=_[_0xe683('0x2e')](_0x5b723c[_0xe683('0x2d')]);_0x7a3608[_0xe683('0x2f')]=_[_0xe683('0x30')](_0x7a3608[_0xe683('0x33')],_0x7a3608['query']);_0x1bdeaf['attributes']=_['intersection'](_0x7a3608[_0xe683('0x33')],qs[_0xe683('0x32')](_0x5b723c[_0xe683('0x2d')]['fields']));_0x1bdeaf['attributes']=_0x1bdeaf[_0xe683('0x31')][_0xe683('0x41')]?_0x1bdeaf[_0xe683('0x31')]:_0x7a3608[_0xe683('0x33')];if(_0x5b723c['query']['includeAll']){_0x1bdeaf[_0xe683('0x42')]=[{'all':!![]}];}_0x1bdeaf=_[_0xe683('0x3c')]({},_0x1bdeaf,_0x5b723c[_0xe683('0x3d')]);return db[_0xe683('0x2a')][_0xe683('0x43')](_0x1bdeaf)[_0xe683('0x24')](handleEntityNotFound(_0x185e44,null))[_0xe683('0x24')](respondWithResult(_0x185e44,null))[_0xe683('0x44')](handleError(_0x185e44,null));};exports[_0xe683('0x45')]=function(_0x381116,_0x556e3c){return db[_0xe683('0x2a')][_0xe683('0x45')](_0x381116[_0xe683('0x46')],{})[_0xe683('0x24')](respondWithResult(_0x556e3c,0xc9))[_0xe683('0x44')](handleError(_0x556e3c,null));};exports[_0xe683('0x23')]=function(_0x3fec75,_0x1243b7){if(_0x3fec75[_0xe683('0x46')]['id']){delete _0x3fec75['body']['id'];}return db[_0xe683('0x2a')][_0xe683('0x43')]({'where':{'id':_0x3fec75[_0xe683('0x40')]['id']}})[_0xe683('0x24')](handleEntityNotFound(_0x1243b7,null))['then'](saveUpdates(_0x3fec75[_0xe683('0x46')],null))[_0xe683('0x24')](respondWithResult(_0x1243b7,null))[_0xe683('0x44')](handleError(_0x1243b7,null));};exports['destroy']=function(_0x1ae3f2,_0x286092){return db[_0xe683('0x2a')]['find']({'where':{'id':_0x1ae3f2[_0xe683('0x40')]['id']}})[_0xe683('0x24')](handleEntityNotFound(_0x286092,null))[_0xe683('0x24')](removeEntity(_0x286092,null))[_0xe683('0x44')](handleError(_0x286092,null));};
\ No newline at end of file
diff --git a/server/api/intVtigerField/intVtigerField.model.js b/server/api/intVtigerField/intVtigerField.model.js
index 47de4c6..c606964 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 _0x9957=['rimraf','./intVtigerField.attributes','exports','define','VtigerField','vtiger_unique_index','idField','lodash','util','../../config/logger','api','bluebird','request-promise','path'];(function(_0x1b7368,_0x3286ed){var _0x25d54c=function(_0x2366da){while(--_0x2366da){_0x1b7368['push'](_0x1b7368['shift']());}};_0x25d54c(++_0x3286ed);}(_0x9957,0x93));var _0x7995=function(_0x4cf98e,_0xba4b79){_0x4cf98e=_0x4cf98e-0x0;var _0x1623ac=_0x9957[_0x4cf98e];return _0x1623ac;};'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':'int_vtiger_fields','paranoid':![],'indexes':[{'name':_0x7995('0xc'),'fields':[_0x7995('0xd'),'FieldId'],'unique':!![]}],'timestamps':!![]});};
\ No newline at end of file
+var _0x7a54=['int_vtiger_fields','idField','lodash','util','../../config/logger','moment','bluebird','path','rimraf','../../config/environment','./intVtigerField.attributes','exports','VtigerField'];(function(_0xb410d6,_0x3ba02a){var _0xd50992=function(_0x28f0a9){while(--_0x28f0a9){_0xb410d6['push'](_0xb410d6['shift']());}};_0xd50992(++_0x3ba02a);}(_0x7a54,0x106));var _0x47a5=function(_0x57e9d5,_0x2c6a19){_0x57e9d5=_0x57e9d5-0x0;var _0x1d07fd=_0x7a54[_0x57e9d5];return _0x1d07fd;};'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':[{'name':'vtiger_unique_index','fields':[_0x47a5('0xc'),'FieldId'],'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 cd3dab2..7c30a64 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 _0xc6fe=['http','then','info','VtigerField,\x20%s,\x20%s','request\x20sent','debug','VtigerField,\x20%s,\x20%s,\x20%s','stringify','error','message','result','catch','lodash','util','bluebird','randomstring','ioredis','../../config/utils','rpc','../../config/environment','jayson/promise','client'];(function(_0x223d7b,_0x1b8d11){var _0x363875=function(_0x2a56ab){while(--_0x2a56ab){_0x223d7b['push'](_0x223d7b['shift']());}};_0x363875(++_0x1b8d11);}(_0xc6fe,0xbc));var _0xec6f=function(_0x27fbbd,_0x24e30e){_0x27fbbd=_0x27fbbd-0x0;var _0x1563be=_0xc6fe[_0x27fbbd];return _0x1563be;};'use strict';var _=require(_0xec6f('0x0'));var util=require(_0xec6f('0x1'));var moment=require('moment');var BPromise=require(_0xec6f('0x2'));var rs=require(_0xec6f('0x3'));var fs=require('fs');var Redis=require(_0xec6f('0x4'));var db=require('../../mysqldb')['db'];var utils=require(_0xec6f('0x5'));var logger=require('../../config/logger')(_0xec6f('0x6'));var config=require(_0xec6f('0x7'));var jayson=require(_0xec6f('0x8'));var client=jayson[_0xec6f('0x9')][_0xec6f('0xa')]({'port':0x232a});function respondWithRpcPromise(_0x29fa2c,_0x20b111,_0x219264){return new BPromise(function(_0x7bcb13,_0x38485a){return client['request'](_0x29fa2c,_0x219264)[_0xec6f('0xb')](function(_0x2ae551){logger[_0xec6f('0xc')](_0xec6f('0xd'),_0x20b111,_0xec6f('0xe'));logger[_0xec6f('0xf')](_0xec6f('0x10'),_0x20b111,_0xec6f('0xe'),JSON[_0xec6f('0x11')](_0x2ae551));if(_0x2ae551[_0xec6f('0x12')]){if(_0x2ae551[_0xec6f('0x12')]['code']===0x1f4){logger[_0xec6f('0x12')](_0xec6f('0xd'),_0x20b111,_0x2ae551[_0xec6f('0x12')][_0xec6f('0x13')]);return _0x38485a(_0x2ae551[_0xec6f('0x12')]['message']);}logger['error'](_0xec6f('0xd'),_0x20b111,_0x2ae551[_0xec6f('0x12')]['message']);return _0x7bcb13(_0x2ae551['error'][_0xec6f('0x13')]);}else{logger[_0xec6f('0xc')]('VtigerField,\x20%s,\x20%s',_0x20b111,'request\x20sent');_0x7bcb13(_0x2ae551[_0xec6f('0x14')][_0xec6f('0x13')]);}})[_0xec6f('0x15')](function(_0x3d4ea1){logger['error']('VtigerField,\x20%s,\x20%s',_0x20b111,_0x3d4ea1);_0x38485a(_0x3d4ea1);});});}
\ No newline at end of file
+var _0xa478=['http','then','info','request\x20sent','debug','error','code','message','VtigerField,\x20%s,\x20%s','result','catch','lodash','util','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise'];(function(_0x1635fe,_0x5f1d9f){var _0x3c512a=function(_0x26b53d){while(--_0x26b53d){_0x1635fe['push'](_0x1635fe['shift']());}};_0x3c512a(++_0x5f1d9f);}(_0xa478,0x136));var _0x8a47=function(_0x4b4b0e,_0x6c674){_0x4b4b0e=_0x4b4b0e-0x0;var _0x4c2d91=_0xa478[_0x4b4b0e];return _0x4c2d91;};'use strict';var _=require(_0x8a47('0x0'));var util=require(_0x8a47('0x1'));var moment=require(_0x8a47('0x2'));var BPromise=require(_0x8a47('0x3'));var rs=require(_0x8a47('0x4'));var fs=require('fs');var Redis=require(_0x8a47('0x5'));var db=require(_0x8a47('0x6'))['db'];var utils=require(_0x8a47('0x7'));var logger=require(_0x8a47('0x8'))(_0x8a47('0x9'));var config=require(_0x8a47('0xa'));var jayson=require(_0x8a47('0xb'));var client=jayson['client'][_0x8a47('0xc')]({'port':0x232a});function respondWithRpcPromise(_0x2d62a6,_0x3de815,_0x3cb340){return new BPromise(function(_0x56884b,_0x384886){return client['request'](_0x2d62a6,_0x3cb340)[_0x8a47('0xd')](function(_0x369fc9){logger[_0x8a47('0xe')]('VtigerField,\x20%s,\x20%s',_0x3de815,_0x8a47('0xf'));logger[_0x8a47('0x10')]('VtigerField,\x20%s,\x20%s,\x20%s',_0x3de815,_0x8a47('0xf'),JSON['stringify'](_0x369fc9));if(_0x369fc9[_0x8a47('0x11')]){if(_0x369fc9[_0x8a47('0x11')][_0x8a47('0x12')]===0x1f4){logger['error']('VtigerField,\x20%s,\x20%s',_0x3de815,_0x369fc9['error'][_0x8a47('0x13')]);return _0x384886(_0x369fc9[_0x8a47('0x11')]['message']);}logger[_0x8a47('0x11')](_0x8a47('0x14'),_0x3de815,_0x369fc9[_0x8a47('0x11')][_0x8a47('0x13')]);return _0x56884b(_0x369fc9[_0x8a47('0x11')][_0x8a47('0x13')]);}else{logger[_0x8a47('0xe')](_0x8a47('0x14'),_0x3de815,_0x8a47('0xf'));_0x56884b(_0x369fc9[_0x8a47('0x15')][_0x8a47('0x13')]);}})[_0x8a47('0x16')](function(_0x2917d9){logger['error'](_0x8a47('0x14'),_0x3de815,_0x2917d9);_0x384886(_0x2917d9);});});}
\ No newline at end of file
diff --git a/server/api/intZendeskAccount/index.js b/server/api/intZendeskAccount/index.js
index 000d42c..06544ec 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 _0x3f0d=['update','delete','destroy','util','path','connect-timeout','express','Router','../../components/auth/service','../../components/interaction/service','../../config/environment','./intZendeskAccount.controller','get','isAuthenticated','/:id','show','/:id/configurations','/:id/fields','post','create','put'];(function(_0x176667,_0x497bcd){var _0x435cd6=function(_0x59a62b){while(--_0x59a62b){_0x176667['push'](_0x176667['shift']());}};_0x435cd6(++_0x497bcd);}(_0x3f0d,0xd5));var _0xd3f0=function(_0x12ac68,_0x1397bb){_0x12ac68=_0x12ac68-0x0;var _0x15d4e2=_0x3f0d[_0x12ac68];return _0x15d4e2;};'use strict';var multer=require('multer');var util=require(_0xd3f0('0x0'));var path=require(_0xd3f0('0x1'));var timeout=require(_0xd3f0('0x2'));var express=require(_0xd3f0('0x3'));var router=express[_0xd3f0('0x4')]();var auth=require(_0xd3f0('0x5'));var interaction=require(_0xd3f0('0x6'));var config=require(_0xd3f0('0x7'));var controller=require(_0xd3f0('0x8'));router[_0xd3f0('0x9')]('/',auth[_0xd3f0('0xa')](),controller['index']);router['get'](_0xd3f0('0xb'),auth[_0xd3f0('0xa')](),controller[_0xd3f0('0xc')]);router['get'](_0xd3f0('0xd'),auth['isAuthenticated'](),controller['getConfigurations']);router[_0xd3f0('0x9')](_0xd3f0('0xe'),auth['isAuthenticated'](),controller['getFields']);router[_0xd3f0('0xf')]('/',auth[_0xd3f0('0xa')](),controller[_0xd3f0('0x10')]);router[_0xd3f0('0xf')](_0xd3f0('0xd'),auth[_0xd3f0('0xa')](),controller['addConfiguration']);router[_0xd3f0('0x11')](_0xd3f0('0xb'),auth[_0xd3f0('0xa')](),controller[_0xd3f0('0x12')]);router[_0xd3f0('0x13')](_0xd3f0('0xb'),auth[_0xd3f0('0xa')](),controller[_0xd3f0('0x14')]);module['exports']=router;
\ No newline at end of file
+var _0x97c0=['./intZendeskAccount.controller','get','index','isAuthenticated','/:id/configurations','getConfigurations','/:id/fields','post','addConfiguration','/:id','delete','destroy','exports','multer','util','path','connect-timeout','express','../../components/interaction/service','../../config/environment'];(function(_0x3de8a4,_0x289a5c){var _0x4635cf=function(_0x2bddb8){while(--_0x2bddb8){_0x3de8a4['push'](_0x3de8a4['shift']());}};_0x4635cf(++_0x289a5c);}(_0x97c0,0x189));var _0x097c=function(_0xfc9617,_0xfa8998){_0xfc9617=_0xfc9617-0x0;var _0x596b4d=_0x97c0[_0xfc9617];return _0x596b4d;};'use strict';var multer=require(_0x097c('0x0'));var util=require(_0x097c('0x1'));var path=require(_0x097c('0x2'));var timeout=require(_0x097c('0x3'));var express=require(_0x097c('0x4'));var router=express['Router']();var auth=require('../../components/auth/service');var interaction=require(_0x097c('0x5'));var config=require(_0x097c('0x6'));var controller=require(_0x097c('0x7'));router[_0x097c('0x8')]('/',auth['isAuthenticated'](),controller[_0x097c('0x9')]);router[_0x097c('0x8')]('/:id',auth[_0x097c('0xa')](),controller['show']);router['get'](_0x097c('0xb'),auth['isAuthenticated'](),controller[_0x097c('0xc')]);router[_0x097c('0x8')](_0x097c('0xd'),auth[_0x097c('0xa')](),controller['getFields']);router[_0x097c('0xe')]('/',auth[_0x097c('0xa')](),controller['create']);router[_0x097c('0xe')](_0x097c('0xb'),auth[_0x097c('0xa')](),controller[_0x097c('0xf')]);router['put'](_0x097c('0x10'),auth[_0x097c('0xa')](),controller['update']);router[_0x097c('0x11')](_0x097c('0x10'),auth['isAuthenticated'](),controller[_0x097c('0x12')]);module[_0x097c('0x13')]=router;
\ No newline at end of file
diff --git a/server/api/intZendeskAccount/intZendeskAccount.attributes.js b/server/api/intZendeskAccount/intZendeskAccount.attributes.js
index 9b11bc5..93a2236 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 _0x4637=['password','token','newTab','integrationTab','STRING','username','remoteUri','ENUM'];(function(_0x23b655,_0x4feb2b){var _0x364b32=function(_0x4e41ac){while(--_0x4e41ac){_0x23b655['push'](_0x23b655['shift']());}};_0x364b32(++_0x4feb2b);}(_0x4637,0x1bc));var _0x7463=function(_0x491a7f,_0x28bb80){_0x491a7f=_0x491a7f-0x0;var _0x3d8f44=_0x4637[_0x491a7f];return _0x3d8f44;};'use strict';var Sequelize=require('sequelize');module['exports']={'name':{'type':Sequelize['STRING']},'description':{'type':Sequelize[_0x7463('0x0')]},'username':{'type':Sequelize[_0x7463('0x0')],'unique':_0x7463('0x1')},'password':{'type':Sequelize[_0x7463('0x0')]},'token':{'type':Sequelize[_0x7463('0x0')]},'remoteUri':{'type':Sequelize[_0x7463('0x0')],'unique':_0x7463('0x2')},'authType':{'type':Sequelize[_0x7463('0x3')](_0x7463('0x4'),_0x7463('0x5')),'defaultValue':_0x7463('0x4')},'serverUrl':{'type':Sequelize['STRING']},'type':{'type':Sequelize['ENUM']('integrationTab',_0x7463('0x6')),'defaultValue':_0x7463('0x7')}};
\ No newline at end of file
+var _0x5420=['remoteUri','password','token','ENUM','integrationTab','newTab','sequelize','exports','STRING'];(function(_0x618414,_0x1a7a60){var _0x21c19a=function(_0x507b17){while(--_0x507b17){_0x618414['push'](_0x618414['shift']());}};_0x21c19a(++_0x1a7a60);}(_0x5420,0x192));var _0x0542=function(_0x58e503,_0xe7312a){_0x58e503=_0x58e503-0x0;var _0x1183da=_0x5420[_0x58e503];return _0x1183da;};'use strict';var Sequelize=require(_0x0542('0x0'));module[_0x0542('0x1')]={'name':{'type':Sequelize[_0x0542('0x2')]},'description':{'type':Sequelize[_0x0542('0x2')]},'username':{'type':Sequelize[_0x0542('0x2')],'unique':'username'},'password':{'type':Sequelize['STRING']},'token':{'type':Sequelize[_0x0542('0x2')]},'remoteUri':{'type':Sequelize['STRING'],'unique':_0x0542('0x3')},'authType':{'type':Sequelize['ENUM'](_0x0542('0x4'),_0x0542('0x5')),'defaultValue':_0x0542('0x4')},'serverUrl':{'type':Sequelize[_0x0542('0x2')]},'type':{'type':Sequelize[_0x0542('0x6')](_0x0542('0x7'),_0x0542('0x8')),'defaultValue':_0x0542('0x7')}};
\ No newline at end of file
diff --git a/server/api/intZendeskAccount/intZendeskAccount.controller.js b/server/api/intZendeskAccount/intZendeskAccount.controller.js
index 61b1cc7..17b3a96 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 _0x4006=['description','group','remove','position','title','system_field_options','custom_field_options','statusCode','getFields,\x20%s,\x20%s,\x20%s','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','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','client','test','Sequelize','ValidationError','The\x20password\x20must\x20be\x20at\x20least\x208\x20characters\x20long\x20and\x20have\x201\x20lowercase\x20character,\x201\x20uppercase\x20character,\x201\x20number\x20and\x201\x20special\x20character\x20~!@#$%^&-_=+[{]}.','info','debug','ZendeskAccount,\x20%s,\x20%s,\x20%s','stringify','error','code','message','ZendeskAccount,\x20%s,\x20%s','request\x20sent','result','sendStatus','status','end','json','count','offset','limit','set','Content-Range','apply','save','update','then','destroy','stack','name','send','index','map','ZendeskAccount','key','model','query','keys','filters','attributes','intersection','fields','length','hasOwnProperty','nolimit','sort','where','merge','type','VIRTUAL','filter','includeAll','include','rows','catch','show','options','create','body','find','params','getConfigurations','findOne','ZendeskConfiguration','order','pick','AccountId','Subjects','getSubjects','channel','getDescriptions','ZendeskField','Descriptions','password','authType','remoteUri','slice','substring','lastIndexOf','format','%s/%s','ticket_fields','headers','Basic\x20%s','username','toString','token','%s/token:%s','subject'];(function(_0x2d770b,_0x4d5a8f){var _0x210ba7=function(_0x1e44cb){while(--_0x1e44cb){_0x2d770b['push'](_0x2d770b['shift']());}};_0x210ba7(++_0x4d5a8f);}(_0x4006,0x8b));var _0x6400=function(_0x3514db,_0x53731b){_0x3514db=_0x3514db-0x0;var _0x1dd2ea=_0x4006[_0x3514db];return _0x1dd2ea;};'use strict';var pdf=require(_0x6400('0x0'));var emlformat=require(_0x6400('0x1'));var rimraf=require(_0x6400('0x2'));var zipdir=require(_0x6400('0x3'));var jsonpatch=require(_0x6400('0x4'));var rp=require(_0x6400('0x5'));var moment=require(_0x6400('0x6'));var BPromise=require(_0x6400('0x7'));var Mustache=require(_0x6400('0x8'));var util=require(_0x6400('0x9'));var path=require(_0x6400('0xa'));var sox=require(_0x6400('0xb'));var csv=require(_0x6400('0xc'));var ejs=require(_0x6400('0xd'));var fs=require('fs');var _=require('lodash');var squel=require(_0x6400('0xe'));var crypto=require(_0x6400('0xf'));var jsforce=require(_0x6400('0x10'));var deskjs=require(_0x6400('0x11'));var toCsv=require(_0x6400('0xc'));var querystring=require(_0x6400('0x12'));var Papa=require(_0x6400('0x13'));var Redis=require(_0x6400('0x14'));var authService=require(_0x6400('0x15'));var qs=require(_0x6400('0x16'));var as=require(_0x6400('0x17'));var hardwareService=require(_0x6400('0x18'));var logger=require(_0x6400('0x19'))(_0x6400('0x1a'));var utils=require(_0x6400('0x1b'));var config=require(_0x6400('0x1c'));var db=require(_0x6400('0x1d'))['db'];var integrations=require(_0x6400('0x1e'));var jayson=require('jayson/promise');var client=jayson[_0x6400('0x1f')]['http']({'port':0x232a});function checkPasswordPattern(_0x131d93,_0x2a554c,_0x475a88){if(_0x475a88){var _0xbcee21=new RegExp(/(?=.*[a-z])(?=.*[A-Z])(?=.*[0-9])(?=.*[?!@#\$%\^&\*~\-_=+[{\]\}])(?=.{8,})/);if(_0xbcee21[_0x6400('0x20')](_0x2a554c)){return _0x131d93;}else{throw new db[(_0x6400('0x21'))][(_0x6400('0x22'))](_0x6400('0x23'));}}else{return _0x131d93;}}function respondWithRpcPromise(_0x5a9020,_0x23897c,_0x2cfa88,_0x29cfcc){return new BPromise(function(_0x647938,_0x31f005){var _0x26569c=_0x29cfcc||client;return _0x26569c['request'](_0x5a9020,_0x2cfa88)['then'](function(_0x23969e){logger[_0x6400('0x24')]('ZendeskAccount,\x20%s,\x20%s',_0x23897c,'request\x20sent');logger[_0x6400('0x25')](_0x6400('0x26'),_0x23897c,'request\x20sent',JSON[_0x6400('0x27')](_0x23969e));if(_0x23969e[_0x6400('0x28')]){if(_0x23969e[_0x6400('0x28')][_0x6400('0x29')]===0x1f4){logger[_0x6400('0x28')]('ZendeskAccount,\x20%s,\x20%s',_0x23897c,_0x23969e[_0x6400('0x28')][_0x6400('0x2a')]);return _0x31f005(_0x23969e[_0x6400('0x28')][_0x6400('0x2a')]);}logger[_0x6400('0x28')]('ZendeskAccount,\x20%s,\x20%s',_0x23897c,_0x23969e[_0x6400('0x28')][_0x6400('0x2a')]);return _0x647938(_0x23969e['error'][_0x6400('0x2a')]);}else{logger[_0x6400('0x24')](_0x6400('0x2b'),_0x23897c,_0x6400('0x2c'));_0x647938(_0x23969e[_0x6400('0x2d')][_0x6400('0x2a')]);}})['catch'](function(_0x2a65af){logger[_0x6400('0x28')](_0x6400('0x2b'),_0x23897c,_0x2a65af);_0x31f005(_0x2a65af);});});}function respondWithStatusCode(_0x2ff40f,_0x486e54){_0x486e54=_0x486e54||0xcc;return function(_0x2f2e48){if(_0x2f2e48){return _0x2ff40f[_0x6400('0x2e')](_0x486e54);}return _0x2ff40f[_0x6400('0x2f')](_0x486e54)[_0x6400('0x30')]();};}function respondWithResult(_0x441b20,_0x157c24){_0x157c24=_0x157c24||0xc8;return function(_0x335909){if(_0x335909){return _0x441b20[_0x6400('0x2f')](_0x157c24)[_0x6400('0x31')](_0x335909);}};}function respondWithFilteredResult(_0x2ee09c,_0xc1e883){return function(_0x477e8d){if(_0x477e8d){var _0x547d2c=_0x477e8d[_0x6400('0x32')],_0x5b3306=_0xc1e883[_0x6400('0x33')],_0x4c71d3=_0xc1e883[_0x6400('0x33')]+_0xc1e883[_0x6400('0x34')],_0x365ca2;if(_0x4c71d3>=_0x547d2c){_0x4c71d3=_0x547d2c;_0x365ca2=0xc8;}else{_0x365ca2=0xce;}_0x2ee09c[_0x6400('0x2f')](_0x365ca2);return _0x2ee09c[_0x6400('0x35')](_0x6400('0x36'),_0x5b3306+'-'+_0x4c71d3+'/'+_0x547d2c)[_0x6400('0x31')](_0x477e8d);}return null;};}function patchUpdates(_0x518a3b){return function(_0x67ff9e){try{jsonpatch[_0x6400('0x37')](_0x67ff9e,_0x518a3b,!![]);}catch(_0x6042f9){return BPromise['reject'](_0x6042f9);}return _0x67ff9e[_0x6400('0x38')]();};}function saveUpdates(_0x25d85a,_0xcee9a){return function(_0x1aa824){if(_0x1aa824){return _0x1aa824[_0x6400('0x39')](_0x25d85a)[_0x6400('0x3a')](function(_0x61f39c){return _0x61f39c;});}return null;};}function removeEntity(_0x246ec6,_0x4dc1a9){return function(_0xbacee){if(_0xbacee){return _0xbacee[_0x6400('0x3b')]()[_0x6400('0x3a')](function(){_0x246ec6[_0x6400('0x2f')](0xcc)['end']();});}};}function handleEntityNotFound(_0xd9667a,_0x2c706c){return function(_0x39e962){if(!_0x39e962){_0xd9667a['sendStatus'](0x194);}return _0x39e962;};}function handleError(_0x35e070,_0xcde0ae){_0xcde0ae=_0xcde0ae||0x1f4;return function(_0x3dd48c){logger['error'](_0x3dd48c[_0x6400('0x3c')]);if(_0x3dd48c[_0x6400('0x3d')]){delete _0x3dd48c['name'];}_0x35e070[_0x6400('0x2f')](_0xcde0ae)[_0x6400('0x3e')](_0x3dd48c);};}exports[_0x6400('0x3f')]=function(_0x37915e,_0x2d9fe8){var _0x1dfbec={},_0x232b43={},_0x11c3bd={'count':0x0,'rows':[]};var _0x8e4a6e=_[_0x6400('0x40')](db[_0x6400('0x41')]['rawAttributes'],function(_0x44be4e){return{'name':_0x44be4e['fieldName'],'type':_0x44be4e['type'][_0x6400('0x42')]};});_0x232b43[_0x6400('0x43')]=_[_0x6400('0x40')](_0x8e4a6e,'name');_0x232b43[_0x6400('0x44')]=_[_0x6400('0x45')](_0x37915e[_0x6400('0x44')]);_0x232b43[_0x6400('0x46')]=_['intersection'](_0x232b43[_0x6400('0x43')],_0x232b43['query']);_0x1dfbec[_0x6400('0x47')]=_[_0x6400('0x48')](_0x232b43[_0x6400('0x43')],qs['fields'](_0x37915e['query'][_0x6400('0x49')]));_0x1dfbec[_0x6400('0x47')]=_0x1dfbec[_0x6400('0x47')][_0x6400('0x4a')]?_0x1dfbec['attributes']:_0x232b43[_0x6400('0x43')];if(!_0x37915e[_0x6400('0x44')][_0x6400('0x4b')](_0x6400('0x4c'))){_0x1dfbec[_0x6400('0x34')]=qs['limit'](_0x37915e[_0x6400('0x44')][_0x6400('0x34')]);_0x1dfbec['offset']=qs[_0x6400('0x33')](_0x37915e[_0x6400('0x44')]['offset']);}_0x1dfbec['order']=qs[_0x6400('0x4d')](_0x37915e['query']['sort']);_0x1dfbec[_0x6400('0x4e')]=qs[_0x6400('0x46')](_['pick'](_0x37915e[_0x6400('0x44')],_0x232b43[_0x6400('0x46')]));if(_0x37915e[_0x6400('0x44')]['filter']){_0x1dfbec[_0x6400('0x4e')]=_[_0x6400('0x4f')](_0x1dfbec[_0x6400('0x4e')],{'$or':_[_0x6400('0x40')](_0x8e4a6e,function(_0x5049ba){if(_0x5049ba[_0x6400('0x50')]!==_0x6400('0x51')){var _0x165bfc={};_0x165bfc[_0x5049ba[_0x6400('0x3d')]]={'$like':'%'+_0x37915e[_0x6400('0x44')][_0x6400('0x52')]+'%'};return _0x165bfc;}})});}_0x1dfbec=_[_0x6400('0x4f')]({},_0x1dfbec,_0x37915e['options']);var _0x3b2c80={'where':_0x1dfbec[_0x6400('0x4e')]};return db[_0x6400('0x41')][_0x6400('0x32')](_0x3b2c80)[_0x6400('0x3a')](function(_0xfbe3bd){_0x11c3bd['count']=_0xfbe3bd;if(_0x37915e[_0x6400('0x44')][_0x6400('0x53')]){_0x1dfbec[_0x6400('0x54')]=[{'all':!![]}];}return db['ZendeskAccount']['findAll'](_0x1dfbec);})[_0x6400('0x3a')](function(_0x29a24b){_0x11c3bd[_0x6400('0x55')]=_0x29a24b;return _0x11c3bd;})[_0x6400('0x3a')](respondWithFilteredResult(_0x2d9fe8,_0x1dfbec))[_0x6400('0x56')](handleError(_0x2d9fe8,null));};exports[_0x6400('0x57')]=function(_0x249933,_0x1cf9c7){var _0x24a4e1={'raw':![],'where':{'id':_0x249933['params']['id']}},_0x3d221b={};_0x3d221b[_0x6400('0x43')]=_[_0x6400('0x45')](db[_0x6400('0x41')]['rawAttributes']);_0x3d221b[_0x6400('0x44')]=_[_0x6400('0x45')](_0x249933[_0x6400('0x44')]);_0x3d221b['filters']=_[_0x6400('0x48')](_0x3d221b[_0x6400('0x43')],_0x3d221b[_0x6400('0x44')]);_0x24a4e1[_0x6400('0x47')]=_[_0x6400('0x48')](_0x3d221b[_0x6400('0x43')],qs[_0x6400('0x49')](_0x249933['query'][_0x6400('0x49')]));_0x24a4e1['attributes']=_0x24a4e1[_0x6400('0x47')][_0x6400('0x4a')]?_0x24a4e1['attributes']:_0x3d221b['model'];if(_0x249933[_0x6400('0x44')]['includeAll']){_0x24a4e1['include']=[{'all':!![]}];}_0x24a4e1=_[_0x6400('0x4f')]({},_0x24a4e1,_0x249933[_0x6400('0x58')]);return db[_0x6400('0x41')]['find'](_0x24a4e1)[_0x6400('0x3a')](handleEntityNotFound(_0x1cf9c7,null))[_0x6400('0x3a')](respondWithResult(_0x1cf9c7,null))[_0x6400('0x56')](handleError(_0x1cf9c7,null));};exports[_0x6400('0x59')]=function(_0x2f0ae5,_0x3f0546){return db[_0x6400('0x41')][_0x6400('0x59')](_0x2f0ae5[_0x6400('0x5a')],{})[_0x6400('0x3a')](respondWithResult(_0x3f0546,0xc9))[_0x6400('0x56')](handleError(_0x3f0546,null));};exports['update']=function(_0x21a528,_0x75ff1f){if(_0x21a528['body']['id']){delete _0x21a528['body']['id'];}return db[_0x6400('0x41')][_0x6400('0x5b')]({'where':{'id':_0x21a528['params']['id']}})[_0x6400('0x3a')](handleEntityNotFound(_0x75ff1f,null))['then'](saveUpdates(_0x21a528[_0x6400('0x5a')],null))[_0x6400('0x3a')](respondWithResult(_0x75ff1f,null))[_0x6400('0x56')](handleError(_0x75ff1f,null));};exports['destroy']=function(_0x454335,_0x435694){return db[_0x6400('0x41')][_0x6400('0x5b')]({'where':{'id':_0x454335[_0x6400('0x5c')]['id']}})['then'](handleEntityNotFound(_0x435694,null))[_0x6400('0x3a')](removeEntity(_0x435694,null))[_0x6400('0x56')](handleError(_0x435694,null));};exports[_0x6400('0x5d')]=function(_0x3206cd,_0x5c167c,_0x2a5e0c){var _0x1df2d9={};var _0x3c073e={};var _0x5d4ea4;var _0x3a27f2;return db[_0x6400('0x41')][_0x6400('0x5e')]({'where':{'id':_0x3206cd['params']['id']}})[_0x6400('0x3a')](handleEntityNotFound(_0x5c167c,null))[_0x6400('0x3a')](function(_0x487997){if(_0x487997){_0x5d4ea4=_0x487997;_0x3c073e[_0x6400('0x43')]=_[_0x6400('0x45')](db[_0x6400('0x5f')]['rawAttributes']);_0x3c073e[_0x6400('0x44')]=_[_0x6400('0x45')](_0x3206cd['query']);_0x3c073e[_0x6400('0x46')]=_[_0x6400('0x48')](_0x3c073e[_0x6400('0x43')],_0x3c073e[_0x6400('0x44')]);_0x1df2d9[_0x6400('0x47')]=_[_0x6400('0x48')](_0x3c073e[_0x6400('0x43')],qs[_0x6400('0x49')](_0x3206cd[_0x6400('0x44')][_0x6400('0x49')]));_0x1df2d9['attributes']=_0x1df2d9[_0x6400('0x47')][_0x6400('0x4a')]?_0x1df2d9[_0x6400('0x47')]:_0x3c073e[_0x6400('0x43')];_0x1df2d9[_0x6400('0x60')]=qs[_0x6400('0x4d')](_0x3206cd[_0x6400('0x44')][_0x6400('0x4d')]);_0x1df2d9[_0x6400('0x4e')]=qs[_0x6400('0x46')](_[_0x6400('0x61')](_0x3206cd['query'],_0x3c073e[_0x6400('0x46')]));if(_0x3206cd[_0x6400('0x44')][_0x6400('0x52')]){_0x1df2d9[_0x6400('0x4e')]=_[_0x6400('0x4f')](_0x1df2d9['where'],{'$or':_[_0x6400('0x40')](_0x1df2d9[_0x6400('0x47')],function(_0x3b7167){var _0x4193e8={};_0x4193e8[_0x3b7167]={'$like':'%'+_0x3206cd['query'][_0x6400('0x52')]+'%'};return _0x4193e8;})});}_0x1df2d9=_[_0x6400('0x4f')]({},_0x1df2d9,_0x3206cd[_0x6400('0x58')]);return _0x5d4ea4[_0x6400('0x5d')](_0x1df2d9);}})['then'](function(_0x3331fd){if(_0x3331fd){_0x3a27f2=_0x3331fd[_0x6400('0x4a')];if(!_0x3206cd['query'][_0x6400('0x4b')](_0x6400('0x4c'))){_0x1df2d9[_0x6400('0x34')]=qs[_0x6400('0x34')](_0x3206cd[_0x6400('0x44')]['limit']);_0x1df2d9['offset']=qs[_0x6400('0x33')](_0x3206cd[_0x6400('0x44')][_0x6400('0x33')]);}return _0x5d4ea4['getConfigurations'](_0x1df2d9);}})[_0x6400('0x3a')](function(_0x261179){if(_0x261179){return _0x261179?{'count':_0x3a27f2,'rows':_0x261179}:null;}})[_0x6400('0x3a')](respondWithResult(_0x5c167c,null))[_0x6400('0x56')](handleError(_0x5c167c,null));};exports['addConfiguration']=function(_0x2fea5f,_0x443d77,_0x5444ce){if(_0x2fea5f[_0x6400('0x5a')]['id']){delete _0x2fea5f[_0x6400('0x5a')]['id'];}return db[_0x6400('0x41')][_0x6400('0x5e')]({'where':{'id':_0x2fea5f['params']['id']}})['then'](handleEntityNotFound(_0x443d77,null))[_0x6400('0x3a')](function(_0x16c078){if(_0x16c078){_0x2fea5f[_0x6400('0x5a')][_0x6400('0x62')]=_0x16c078['id'];_0x2fea5f[_0x6400('0x5a')][_0x6400('0x63')]=integrations[_0x6400('0x64')](_0x2fea5f['body'][_0x6400('0x65')],_0x2fea5f[_0x6400('0x5a')]['type']);_0x2fea5f[_0x6400('0x5a')]['Descriptions']=integrations[_0x6400('0x66')](_0x2fea5f[_0x6400('0x5a')][_0x6400('0x65')],_0x2fea5f[_0x6400('0x5a')][_0x6400('0x50')]);return db[_0x6400('0x5f')][_0x6400('0x59')](_0x2fea5f[_0x6400('0x5a')],{'include':[{'model':db[_0x6400('0x67')],'as':_0x6400('0x63')},{'model':db['ZendeskField'],'as':_0x6400('0x68')}]});}return null;})[_0x6400('0x3a')](respondWithResult(_0x443d77,null))[_0x6400('0x56')](handleError(_0x443d77,null));};exports['getFields']=function(_0x5e43fa,_0x41cd63,_0x41fdfc){var _0x367752='';return db[_0x6400('0x41')]['findOne']({'where':{'id':_0x5e43fa[_0x6400('0x5c')]['id']},'attributes':['id','username',_0x6400('0x69'),'token',_0x6400('0x6a'),'remoteUri']})['then'](handleEntityNotFound(_0x41cd63,null))[_0x6400('0x3a')](function(_0x153733){if(_0x153733){_0x367752=_0x153733[_0x6400('0x6b')];var _0x4b1e82=_0x367752[_0x6400('0x6c')](-0x1);if(_0x4b1e82==='/'){_0x367752=_0x367752[_0x6400('0x6d')](0x0,_0x367752[_0x6400('0x6e')](_0x4b1e82));}var _0xd2afc9={'method':'GET','uri':util[_0x6400('0x6f')](_0x6400('0x70'),_0x367752,_0x6400('0x71')),'json':!![]};switch(_0x153733['authType']){case _0x6400('0x69'):_0xd2afc9[_0x6400('0x72')]={'Authorization':util['format'](_0x6400('0x73'),new Buffer(util['format']('%s:%s',_0x153733[_0x6400('0x74')],_0x153733['password']))[_0x6400('0x75')]('base64'))};break;case _0x6400('0x76'):_0xd2afc9[_0x6400('0x72')]={'Authorization':util[_0x6400('0x6f')](_0x6400('0x73'),new Buffer(util[_0x6400('0x6f')](_0x6400('0x77'),_0x153733['username'],_0x153733[_0x6400('0x76')]))[_0x6400('0x75')]('base64'))};break;default:throw new db[(_0x6400('0x21'))]['ValidationError']('Unknown\x20authentication\x20type');}return rp(_0xd2afc9);}})[_0x6400('0x3a')](function(_0x2ba91a){if(_0x2ba91a){var _0x5ecf1b=[_0x6400('0x78'),_0x6400('0x79'),_0x6400('0x7a'),'assignee'];_[_0x6400('0x7b')](_0x2ba91a[_0x6400('0x71')],function(_0x7fa821){return _0x5ecf1b['includes'](_0x7fa821[_0x6400('0x50')]);});return{'count':_0x2ba91a['ticket_fields'][_0x6400('0x4a')],'rows':_['map'](_0x2ba91a['ticket_fields'],function(_0x1b2e8c){return{'id':_0x1b2e8c['id'],'name':_0x1b2e8c[_0x6400('0x7c')]>0x7?_0x1b2e8c[_0x6400('0x7d')]:_0x1b2e8c[_0x6400('0x50')],'custom':_0x1b2e8c['position']>0x7?!![]:![],'options':_0x1b2e8c[_0x6400('0x7e')]?_0x1b2e8c['system_field_options']:_0x1b2e8c[_0x6400('0x7f')]?_0x1b2e8c[_0x6400('0x7f')]:[]};})};}})[_0x6400('0x3a')](respondWithResult(_0x41cd63,null))['catch'](function(_0xc44aa2){var _0x419ff0=_0x5e43fa[_0x6400('0x44')][_0x6400('0x20')]?0x1f4:_0xc44aa2[_0x6400('0x80')]||0x1f4;logger[_0x6400('0x28')](_0x6400('0x81'),'getFields',_0x419ff0,JSON[_0x6400('0x27')](_0xc44aa2));delete _0xc44aa2[_0x6400('0x3d')];if(_0x419ff0===0x191){_0x419ff0=0x190;}_0x41cd63[_0x6400('0x2f')](_0x419ff0)[_0x6400('0x3e')](_0x5e43fa[_0x6400('0x44')][_0x6400('0x20')]?{'message':'Wrong\x20credentials','statusCode':_0xc44aa2[_0x6400('0x80')]}:_0xc44aa2);});};
\ No newline at end of file
+var _0xe5a6=['attributes','length','hasOwnProperty','nolimit','limit','order','sort','where','pick','filter','merge','type','options','findAll','show','params','keys','fields','includeAll','find','create','body','getConfigurations','findOne','ZendeskConfiguration','addConfiguration','AccountId','Subjects','getSubjects','channel','getDescriptions','ZendeskField','Descriptions','getFields','password','token','authType','remoteUri','slice','lastIndexOf','format','%s/%s','ticket_fields','Basic\x20%s','%s:%s','username','toString','base64','%s/token:%s','Unknown\x20authentication\x20type','subject','description','group','remove','includes','position','title','system_field_options','custom_field_options','statusCode','getFields,\x20%s,\x20%s,\x20%s','Wrong\x20credentials','html-pdf','eml-format','rimraf','zip-dir','request-promise','moment','bluebird','mustache','util','to-csv','squel','crypto','jsforce','desk.js','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../config/license/hardware','../../config/utils','../../config/environment','../../mysqldb','../../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','info','request\x20sent','debug','ZendeskAccount,\x20%s,\x20%s,\x20%s','stringify','error','code','ZendeskAccount,\x20%s,\x20%s','message','catch','sendStatus','status','json','count','offset','set','Content-Range','apply','update','then','destroy','end','stack','name','send','index','ZendeskAccount','fieldName','key','model','map','query','filters','intersection'];(function(_0x47a491,_0x45e171){var _0x3b176b=function(_0x8c826){while(--_0x8c826){_0x47a491['push'](_0x47a491['shift']());}};_0x3b176b(++_0x45e171);}(_0xe5a6,0x1bb));var _0x6e5a=function(_0x522ae8,_0x3b637e){_0x522ae8=_0x522ae8-0x0;var _0x3189b9=_0xe5a6[_0x522ae8];return _0x3189b9;};'use strict';var pdf=require(_0x6e5a('0x0'));var emlformat=require(_0x6e5a('0x1'));var rimraf=require(_0x6e5a('0x2'));var zipdir=require(_0x6e5a('0x3'));var jsonpatch=require('fast-json-patch');var rp=require(_0x6e5a('0x4'));var moment=require(_0x6e5a('0x5'));var BPromise=require(_0x6e5a('0x6'));var Mustache=require(_0x6e5a('0x7'));var util=require(_0x6e5a('0x8'));var path=require('path');var sox=require('sox');var csv=require(_0x6e5a('0x9'));var ejs=require('ejs');var fs=require('fs');var _=require('lodash');var squel=require(_0x6e5a('0xa'));var crypto=require(_0x6e5a('0xb'));var jsforce=require(_0x6e5a('0xc'));var deskjs=require(_0x6e5a('0xd'));var toCsv=require('to-csv');var querystring=require(_0x6e5a('0xe'));var Papa=require(_0x6e5a('0xf'));var Redis=require(_0x6e5a('0x10'));var authService=require(_0x6e5a('0x11'));var qs=require(_0x6e5a('0x12'));var as=require('../../components/parsers/advancedSearch');var hardwareService=require(_0x6e5a('0x13'));var logger=require('../../config/logger')('api');var utils=require(_0x6e5a('0x14'));var config=require(_0x6e5a('0x15'));var db=require(_0x6e5a('0x16'))['db'];var integrations=require(_0x6e5a('0x17'));var jayson=require('jayson/promise');var client=jayson[_0x6e5a('0x18')][_0x6e5a('0x19')]({'port':0x232a});function checkPasswordPattern(_0x392ca7,_0x376d63,_0x3c719d){if(_0x3c719d){var _0x395fd2=new RegExp(/(?=.*[a-z])(?=.*[A-Z])(?=.*[0-9])(?=.*[?!@#\$%\^&\*~\-_=+[{\]\}])(?=.{8,})/);if(_0x395fd2[_0x6e5a('0x1a')](_0x376d63)){return _0x392ca7;}else{throw new db[(_0x6e5a('0x1b'))][(_0x6e5a('0x1c'))](_0x6e5a('0x1d'));}}else{return _0x392ca7;}}function respondWithRpcPromise(_0x3f09ec,_0x20be1e,_0x57ba63,_0x20d310){return new BPromise(function(_0x481f1d,_0x4d99e9){var _0x699b6e=_0x20d310||client;return _0x699b6e[_0x6e5a('0x1e')](_0x3f09ec,_0x57ba63)['then'](function(_0x590eee){logger[_0x6e5a('0x1f')]('ZendeskAccount,\x20%s,\x20%s',_0x20be1e,_0x6e5a('0x20'));logger[_0x6e5a('0x21')](_0x6e5a('0x22'),_0x20be1e,_0x6e5a('0x20'),JSON[_0x6e5a('0x23')](_0x590eee));if(_0x590eee[_0x6e5a('0x24')]){if(_0x590eee['error'][_0x6e5a('0x25')]===0x1f4){logger[_0x6e5a('0x24')](_0x6e5a('0x26'),_0x20be1e,_0x590eee['error'][_0x6e5a('0x27')]);return _0x4d99e9(_0x590eee[_0x6e5a('0x24')][_0x6e5a('0x27')]);}logger['error']('ZendeskAccount,\x20%s,\x20%s',_0x20be1e,_0x590eee[_0x6e5a('0x24')]['message']);return _0x481f1d(_0x590eee[_0x6e5a('0x24')][_0x6e5a('0x27')]);}else{logger[_0x6e5a('0x1f')](_0x6e5a('0x26'),_0x20be1e,_0x6e5a('0x20'));_0x481f1d(_0x590eee['result'][_0x6e5a('0x27')]);}})[_0x6e5a('0x28')](function(_0x2a7c7f){logger[_0x6e5a('0x24')]('ZendeskAccount,\x20%s,\x20%s',_0x20be1e,_0x2a7c7f);_0x4d99e9(_0x2a7c7f);});});}function respondWithStatusCode(_0x29a9c7,_0x497e5a){_0x497e5a=_0x497e5a||0xcc;return function(_0x4ec610){if(_0x4ec610){return _0x29a9c7[_0x6e5a('0x29')](_0x497e5a);}return _0x29a9c7['status'](_0x497e5a)['end']();};}function respondWithResult(_0xe41c1,_0x20397c){_0x20397c=_0x20397c||0xc8;return function(_0x3fcc9e){if(_0x3fcc9e){return _0xe41c1[_0x6e5a('0x2a')](_0x20397c)[_0x6e5a('0x2b')](_0x3fcc9e);}};}function respondWithFilteredResult(_0x3cd6f9,_0x1de627){return function(_0x133b4b){if(_0x133b4b){var _0x45a1df=_0x133b4b[_0x6e5a('0x2c')],_0x48fc6e=_0x1de627[_0x6e5a('0x2d')],_0x5e9017=_0x1de627[_0x6e5a('0x2d')]+_0x1de627['limit'],_0x42f232;if(_0x5e9017>=_0x45a1df){_0x5e9017=_0x45a1df;_0x42f232=0xc8;}else{_0x42f232=0xce;}_0x3cd6f9[_0x6e5a('0x2a')](_0x42f232);return _0x3cd6f9[_0x6e5a('0x2e')](_0x6e5a('0x2f'),_0x48fc6e+'-'+_0x5e9017+'/'+_0x45a1df)[_0x6e5a('0x2b')](_0x133b4b);}return null;};}function patchUpdates(_0x3ec6c7){return function(_0x5f5bc2){try{jsonpatch[_0x6e5a('0x30')](_0x5f5bc2,_0x3ec6c7,!![]);}catch(_0x741d60){return BPromise['reject'](_0x741d60);}return _0x5f5bc2['save']();};}function saveUpdates(_0x17148e,_0x4f562a){return function(_0x533e81){if(_0x533e81){return _0x533e81[_0x6e5a('0x31')](_0x17148e)[_0x6e5a('0x32')](function(_0x1919ac){return _0x1919ac;});}return null;};}function removeEntity(_0x16c8ea,_0x609205){return function(_0x2437a7){if(_0x2437a7){return _0x2437a7[_0x6e5a('0x33')]()[_0x6e5a('0x32')](function(){_0x16c8ea[_0x6e5a('0x2a')](0xcc)[_0x6e5a('0x34')]();});}};}function handleEntityNotFound(_0x1e6af8,_0x1e788d){return function(_0x14e6bf){if(!_0x14e6bf){_0x1e6af8[_0x6e5a('0x29')](0x194);}return _0x14e6bf;};}function handleError(_0x438038,_0x1da33b){_0x1da33b=_0x1da33b||0x1f4;return function(_0xd5bc92){logger[_0x6e5a('0x24')](_0xd5bc92[_0x6e5a('0x35')]);if(_0xd5bc92['name']){delete _0xd5bc92[_0x6e5a('0x36')];}_0x438038[_0x6e5a('0x2a')](_0x1da33b)[_0x6e5a('0x37')](_0xd5bc92);};}exports[_0x6e5a('0x38')]=function(_0x15acb0,_0x2dd17f){var _0x4d2871={},_0x1a8173={},_0x1bf0d7={'count':0x0,'rows':[]};var _0x3b6986=_['map'](db[_0x6e5a('0x39')]['rawAttributes'],function(_0x3daf1a){return{'name':_0x3daf1a[_0x6e5a('0x3a')],'type':_0x3daf1a['type'][_0x6e5a('0x3b')]};});_0x1a8173[_0x6e5a('0x3c')]=_[_0x6e5a('0x3d')](_0x3b6986,_0x6e5a('0x36'));_0x1a8173[_0x6e5a('0x3e')]=_['keys'](_0x15acb0['query']);_0x1a8173[_0x6e5a('0x3f')]=_[_0x6e5a('0x40')](_0x1a8173[_0x6e5a('0x3c')],_0x1a8173[_0x6e5a('0x3e')]);_0x4d2871[_0x6e5a('0x41')]=_['intersection'](_0x1a8173[_0x6e5a('0x3c')],qs['fields'](_0x15acb0[_0x6e5a('0x3e')]['fields']));_0x4d2871[_0x6e5a('0x41')]=_0x4d2871[_0x6e5a('0x41')][_0x6e5a('0x42')]?_0x4d2871[_0x6e5a('0x41')]:_0x1a8173[_0x6e5a('0x3c')];if(!_0x15acb0['query'][_0x6e5a('0x43')](_0x6e5a('0x44'))){_0x4d2871[_0x6e5a('0x45')]=qs[_0x6e5a('0x45')](_0x15acb0[_0x6e5a('0x3e')][_0x6e5a('0x45')]);_0x4d2871[_0x6e5a('0x2d')]=qs[_0x6e5a('0x2d')](_0x15acb0[_0x6e5a('0x3e')][_0x6e5a('0x2d')]);}_0x4d2871[_0x6e5a('0x46')]=qs['sort'](_0x15acb0[_0x6e5a('0x3e')][_0x6e5a('0x47')]);_0x4d2871[_0x6e5a('0x48')]=qs['filters'](_[_0x6e5a('0x49')](_0x15acb0[_0x6e5a('0x3e')],_0x1a8173[_0x6e5a('0x3f')]));if(_0x15acb0['query'][_0x6e5a('0x4a')]){_0x4d2871[_0x6e5a('0x48')]=_[_0x6e5a('0x4b')](_0x4d2871[_0x6e5a('0x48')],{'$or':_[_0x6e5a('0x3d')](_0x3b6986,function(_0x3d7578){if(_0x3d7578[_0x6e5a('0x4c')]!=='VIRTUAL'){var _0x5a87da={};_0x5a87da[_0x3d7578[_0x6e5a('0x36')]]={'$like':'%'+_0x15acb0['query'][_0x6e5a('0x4a')]+'%'};return _0x5a87da;}})});}_0x4d2871=_[_0x6e5a('0x4b')]({},_0x4d2871,_0x15acb0[_0x6e5a('0x4d')]);var _0x24e9ec={'where':_0x4d2871[_0x6e5a('0x48')]};return db['ZendeskAccount'][_0x6e5a('0x2c')](_0x24e9ec)[_0x6e5a('0x32')](function(_0x244e32){_0x1bf0d7['count']=_0x244e32;if(_0x15acb0[_0x6e5a('0x3e')]['includeAll']){_0x4d2871['include']=[{'all':!![]}];}return db[_0x6e5a('0x39')][_0x6e5a('0x4e')](_0x4d2871);})['then'](function(_0x4e1cef){_0x1bf0d7['rows']=_0x4e1cef;return _0x1bf0d7;})['then'](respondWithFilteredResult(_0x2dd17f,_0x4d2871))['catch'](handleError(_0x2dd17f,null));};exports[_0x6e5a('0x4f')]=function(_0x26350c,_0x248a30){var _0x4d6814={'raw':![],'where':{'id':_0x26350c[_0x6e5a('0x50')]['id']}},_0x2904b1={};_0x2904b1[_0x6e5a('0x3c')]=_[_0x6e5a('0x51')](db['ZendeskAccount']['rawAttributes']);_0x2904b1['query']=_[_0x6e5a('0x51')](_0x26350c[_0x6e5a('0x3e')]);_0x2904b1[_0x6e5a('0x3f')]=_[_0x6e5a('0x40')](_0x2904b1['model'],_0x2904b1[_0x6e5a('0x3e')]);_0x4d6814[_0x6e5a('0x41')]=_[_0x6e5a('0x40')](_0x2904b1[_0x6e5a('0x3c')],qs[_0x6e5a('0x52')](_0x26350c['query'][_0x6e5a('0x52')]));_0x4d6814['attributes']=_0x4d6814['attributes'][_0x6e5a('0x42')]?_0x4d6814[_0x6e5a('0x41')]:_0x2904b1[_0x6e5a('0x3c')];if(_0x26350c[_0x6e5a('0x3e')][_0x6e5a('0x53')]){_0x4d6814['include']=[{'all':!![]}];}_0x4d6814=_[_0x6e5a('0x4b')]({},_0x4d6814,_0x26350c[_0x6e5a('0x4d')]);return db['ZendeskAccount'][_0x6e5a('0x54')](_0x4d6814)[_0x6e5a('0x32')](handleEntityNotFound(_0x248a30,null))[_0x6e5a('0x32')](respondWithResult(_0x248a30,null))[_0x6e5a('0x28')](handleError(_0x248a30,null));};exports[_0x6e5a('0x55')]=function(_0x3dad1f,_0x4f790f){return db[_0x6e5a('0x39')]['create'](_0x3dad1f[_0x6e5a('0x56')],{})[_0x6e5a('0x32')](respondWithResult(_0x4f790f,0xc9))[_0x6e5a('0x28')](handleError(_0x4f790f,null));};exports[_0x6e5a('0x31')]=function(_0x1aa8b6,_0x4a8617){if(_0x1aa8b6[_0x6e5a('0x56')]['id']){delete _0x1aa8b6[_0x6e5a('0x56')]['id'];}return db[_0x6e5a('0x39')]['find']({'where':{'id':_0x1aa8b6['params']['id']}})[_0x6e5a('0x32')](handleEntityNotFound(_0x4a8617,null))[_0x6e5a('0x32')](saveUpdates(_0x1aa8b6['body'],null))[_0x6e5a('0x32')](respondWithResult(_0x4a8617,null))[_0x6e5a('0x28')](handleError(_0x4a8617,null));};exports[_0x6e5a('0x33')]=function(_0x114447,_0x20badf){return db[_0x6e5a('0x39')]['find']({'where':{'id':_0x114447[_0x6e5a('0x50')]['id']}})['then'](handleEntityNotFound(_0x20badf,null))['then'](removeEntity(_0x20badf,null))[_0x6e5a('0x28')](handleError(_0x20badf,null));};exports[_0x6e5a('0x57')]=function(_0x3c216f,_0x2920ae,_0x42c498){var _0x117047={};var _0x5cf147={};var _0x46d92c;var _0x1f32e7;return db[_0x6e5a('0x39')][_0x6e5a('0x58')]({'where':{'id':_0x3c216f[_0x6e5a('0x50')]['id']}})[_0x6e5a('0x32')](handleEntityNotFound(_0x2920ae,null))[_0x6e5a('0x32')](function(_0x21af27){if(_0x21af27){_0x46d92c=_0x21af27;_0x5cf147[_0x6e5a('0x3c')]=_[_0x6e5a('0x51')](db[_0x6e5a('0x59')]['rawAttributes']);_0x5cf147[_0x6e5a('0x3e')]=_[_0x6e5a('0x51')](_0x3c216f[_0x6e5a('0x3e')]);_0x5cf147[_0x6e5a('0x3f')]=_[_0x6e5a('0x40')](_0x5cf147[_0x6e5a('0x3c')],_0x5cf147[_0x6e5a('0x3e')]);_0x117047[_0x6e5a('0x41')]=_[_0x6e5a('0x40')](_0x5cf147[_0x6e5a('0x3c')],qs[_0x6e5a('0x52')](_0x3c216f[_0x6e5a('0x3e')]['fields']));_0x117047['attributes']=_0x117047['attributes']['length']?_0x117047[_0x6e5a('0x41')]:_0x5cf147[_0x6e5a('0x3c')];_0x117047[_0x6e5a('0x46')]=qs[_0x6e5a('0x47')](_0x3c216f['query'][_0x6e5a('0x47')]);_0x117047['where']=qs['filters'](_[_0x6e5a('0x49')](_0x3c216f[_0x6e5a('0x3e')],_0x5cf147[_0x6e5a('0x3f')]));if(_0x3c216f[_0x6e5a('0x3e')]['filter']){_0x117047[_0x6e5a('0x48')]=_[_0x6e5a('0x4b')](_0x117047['where'],{'$or':_[_0x6e5a('0x3d')](_0x117047['attributes'],function(_0x12fa28){var _0x233fc1={};_0x233fc1[_0x12fa28]={'$like':'%'+_0x3c216f[_0x6e5a('0x3e')]['filter']+'%'};return _0x233fc1;})});}_0x117047=_[_0x6e5a('0x4b')]({},_0x117047,_0x3c216f[_0x6e5a('0x4d')]);return _0x46d92c[_0x6e5a('0x57')](_0x117047);}})[_0x6e5a('0x32')](function(_0x1ff0fb){if(_0x1ff0fb){_0x1f32e7=_0x1ff0fb[_0x6e5a('0x42')];if(!_0x3c216f[_0x6e5a('0x3e')][_0x6e5a('0x43')]('nolimit')){_0x117047[_0x6e5a('0x45')]=qs['limit'](_0x3c216f['query'][_0x6e5a('0x45')]);_0x117047[_0x6e5a('0x2d')]=qs[_0x6e5a('0x2d')](_0x3c216f[_0x6e5a('0x3e')][_0x6e5a('0x2d')]);}return _0x46d92c[_0x6e5a('0x57')](_0x117047);}})[_0x6e5a('0x32')](function(_0x24a88f){if(_0x24a88f){return _0x24a88f?{'count':_0x1f32e7,'rows':_0x24a88f}:null;}})[_0x6e5a('0x32')](respondWithResult(_0x2920ae,null))[_0x6e5a('0x28')](handleError(_0x2920ae,null));};exports[_0x6e5a('0x5a')]=function(_0x4e8c29,_0x1ee99c,_0x1ef150){if(_0x4e8c29[_0x6e5a('0x56')]['id']){delete _0x4e8c29[_0x6e5a('0x56')]['id'];}return db[_0x6e5a('0x39')][_0x6e5a('0x58')]({'where':{'id':_0x4e8c29[_0x6e5a('0x50')]['id']}})[_0x6e5a('0x32')](handleEntityNotFound(_0x1ee99c,null))[_0x6e5a('0x32')](function(_0xa83250){if(_0xa83250){_0x4e8c29[_0x6e5a('0x56')][_0x6e5a('0x5b')]=_0xa83250['id'];_0x4e8c29['body'][_0x6e5a('0x5c')]=integrations[_0x6e5a('0x5d')](_0x4e8c29[_0x6e5a('0x56')][_0x6e5a('0x5e')],_0x4e8c29[_0x6e5a('0x56')][_0x6e5a('0x4c')]);_0x4e8c29[_0x6e5a('0x56')]['Descriptions']=integrations[_0x6e5a('0x5f')](_0x4e8c29['body']['channel'],_0x4e8c29[_0x6e5a('0x56')][_0x6e5a('0x4c')]);return db[_0x6e5a('0x59')][_0x6e5a('0x55')](_0x4e8c29[_0x6e5a('0x56')],{'include':[{'model':db[_0x6e5a('0x60')],'as':_0x6e5a('0x5c')},{'model':db[_0x6e5a('0x60')],'as':_0x6e5a('0x61')}]});}return null;})[_0x6e5a('0x32')](respondWithResult(_0x1ee99c,null))['catch'](handleError(_0x1ee99c,null));};exports[_0x6e5a('0x62')]=function(_0x4a9aa4,_0x2b3835,_0x5841a8){var _0x33c596='';return db['ZendeskAccount'][_0x6e5a('0x58')]({'where':{'id':_0x4a9aa4['params']['id']},'attributes':['id','username',_0x6e5a('0x63'),_0x6e5a('0x64'),_0x6e5a('0x65'),_0x6e5a('0x66')]})[_0x6e5a('0x32')](handleEntityNotFound(_0x2b3835,null))['then'](function(_0x180d94){if(_0x180d94){_0x33c596=_0x180d94[_0x6e5a('0x66')];var _0x5107c8=_0x33c596[_0x6e5a('0x67')](-0x1);if(_0x5107c8==='/'){_0x33c596=_0x33c596['substring'](0x0,_0x33c596[_0x6e5a('0x68')](_0x5107c8));}var _0xcb1a28={'method':'GET','uri':util[_0x6e5a('0x69')](_0x6e5a('0x6a'),_0x33c596,_0x6e5a('0x6b')),'json':!![]};switch(_0x180d94[_0x6e5a('0x65')]){case _0x6e5a('0x63'):_0xcb1a28['headers']={'Authorization':util[_0x6e5a('0x69')](_0x6e5a('0x6c'),new Buffer(util['format'](_0x6e5a('0x6d'),_0x180d94[_0x6e5a('0x6e')],_0x180d94['password']))[_0x6e5a('0x6f')](_0x6e5a('0x70')))};break;case _0x6e5a('0x64'):_0xcb1a28['headers']={'Authorization':util[_0x6e5a('0x69')](_0x6e5a('0x6c'),new Buffer(util[_0x6e5a('0x69')](_0x6e5a('0x71'),_0x180d94['username'],_0x180d94[_0x6e5a('0x64')]))[_0x6e5a('0x6f')](_0x6e5a('0x70')))};break;default:throw new db[(_0x6e5a('0x1b'))][(_0x6e5a('0x1c'))](_0x6e5a('0x72'));}return rp(_0xcb1a28);}})[_0x6e5a('0x32')](function(_0x1f6c5d){if(_0x1f6c5d){var _0x4961ff=[_0x6e5a('0x73'),_0x6e5a('0x74'),_0x6e5a('0x75'),'assignee'];_[_0x6e5a('0x76')](_0x1f6c5d['ticket_fields'],function(_0xd3284b){return _0x4961ff[_0x6e5a('0x77')](_0xd3284b['type']);});return{'count':_0x1f6c5d['ticket_fields'][_0x6e5a('0x42')],'rows':_[_0x6e5a('0x3d')](_0x1f6c5d[_0x6e5a('0x6b')],function(_0x2054f5){return{'id':_0x2054f5['id'],'name':_0x2054f5[_0x6e5a('0x78')]>0x7?_0x2054f5[_0x6e5a('0x79')]:_0x2054f5[_0x6e5a('0x4c')],'custom':_0x2054f5[_0x6e5a('0x78')]>0x7?!![]:![],'options':_0x2054f5['system_field_options']?_0x2054f5[_0x6e5a('0x7a')]:_0x2054f5[_0x6e5a('0x7b')]?_0x2054f5['custom_field_options']:[]};})};}})['then'](respondWithResult(_0x2b3835,null))[_0x6e5a('0x28')](function(_0x487161){var _0x49a03d=_0x4a9aa4['query'][_0x6e5a('0x1a')]?0x1f4:_0x487161[_0x6e5a('0x7c')]||0x1f4;logger[_0x6e5a('0x24')](_0x6e5a('0x7d'),'getFields',_0x49a03d,JSON[_0x6e5a('0x23')](_0x487161));delete _0x487161[_0x6e5a('0x36')];if(_0x49a03d===0x191){_0x49a03d=0x190;}_0x2b3835[_0x6e5a('0x2a')](_0x49a03d)[_0x6e5a('0x37')](_0x4a9aa4[_0x6e5a('0x3e')][_0x6e5a('0x1a')]?{'message':_0x6e5a('0x7e'),'statusCode':_0x487161[_0x6e5a('0x7c')]}:_0x487161);});};
\ No newline at end of file
diff --git a/server/api/intZendeskAccount/intZendeskAccount.model.js b/server/api/intZendeskAccount/intZendeskAccount.model.js
index 9b195fa..2aebd77 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 _0x9ee3=['int_zendesk_accounts','util','api','bluebird','path','rimraf','../../config/environment','./intZendeskAccount.attributes','exports','define','ZendeskAccount'];(function(_0x55677b,_0x3e5655){var _0x104b88=function(_0x78d34f){while(--_0x78d34f){_0x55677b['push'](_0x55677b['shift']());}};_0x104b88(++_0x3e5655);}(_0x9ee3,0xdd));var _0x39ee=function(_0x464d02,_0x980475){_0x464d02=_0x464d02-0x0;var _0x199935=_0x9ee3[_0x464d02];return _0x199935;};'use strict';var _=require('lodash');var util=require(_0x39ee('0x0'));var logger=require('../../config/logger')(_0x39ee('0x1'));var moment=require('moment');var BPromise=require(_0x39ee('0x2'));var rp=require('request-promise');var fs=require('fs');var path=require(_0x39ee('0x3'));var rimraf=require(_0x39ee('0x4'));var config=require(_0x39ee('0x5'));var attributes=require(_0x39ee('0x6'));var integrations=require('../../components/integrations/configuration');module[_0x39ee('0x7')]=function(_0x47660d,_0x169898){return _0x47660d[_0x39ee('0x8')](_0x39ee('0x9'),attributes,{'tableName':_0x39ee('0xa'),'paranoid':![],'indexes':[],'timestamps':!![]});};
\ No newline at end of file
+var _0xa3b7=['./intZendeskAccount.attributes','../../components/integrations/configuration','exports','ZendeskAccount','int_zendesk_accounts','lodash','api','moment','rimraf','../../config/environment'];(function(_0x218efe,_0x475a17){var _0x1ffa33=function(_0x4f7fd0){while(--_0x4f7fd0){_0x218efe['push'](_0x218efe['shift']());}};_0x1ffa33(++_0x475a17);}(_0xa3b7,0x11d));var _0x7a3b=function(_0x4aba15,_0x4e90aa){_0x4aba15=_0x4aba15-0x0;var _0x1c8122=_0xa3b7[_0x4aba15];return _0x1c8122;};'use strict';var _=require(_0x7a3b('0x0'));var util=require('util');var logger=require('../../config/logger')(_0x7a3b('0x1'));var moment=require(_0x7a3b('0x2'));var BPromise=require('bluebird');var rp=require('request-promise');var fs=require('fs');var path=require('path');var rimraf=require(_0x7a3b('0x3'));var config=require(_0x7a3b('0x4'));var attributes=require(_0x7a3b('0x5'));var integrations=require(_0x7a3b('0x6'));module[_0x7a3b('0x7')]=function(_0x189ade,_0x7f30c6){return _0x189ade['define'](_0x7a3b('0x8'),attributes,{'tableName':_0x7a3b('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 ad9c1c4..02ca2c3 100644
--- a/server/api/intZendeskAccount/intZendeskAccount.rpc.js
+++ b/server/api/intZendeskAccount/intZendeskAccount.rpc.js
@@ -15,4 +15,4 @@
// * treaties. The SOFTWARE PRODUCT is licensed, not sold. *
// * *
// *************************************************************************
-var _0xcb91=['../../config/utils','../../config/logger','../../config/environment','jayson/promise','http','request','info','ZendeskAccount,\x20%s,\x20%s','request\x20sent','debug','ZendeskAccount,\x20%s,\x20%s,\x20%s','stringify','error','code','message','catch','GetZendeskAccount','ZendeskAccount','findAll','options','raw','attributes','include','map','model','then','ShowZendeskAccount','find','where','moment','bluebird','randomstring','ioredis'];(function(_0x31e29a,_0x349c9b){var _0x32d892=function(_0x41cc86){while(--_0x41cc86){_0x31e29a['push'](_0x31e29a['shift']());}};_0x32d892(++_0x349c9b);}(_0xcb91,0x1a9));var _0x1cb9=function(_0x336264,_0x32e1d9){_0x336264=_0x336264-0x0;var _0x53cf91=_0xcb91[_0x336264];return _0x53cf91;};'use strict';var _=require('lodash');var util=require('util');var moment=require(_0x1cb9('0x0'));var BPromise=require(_0x1cb9('0x1'));var rs=require(_0x1cb9('0x2'));var fs=require('fs');var Redis=require(_0x1cb9('0x3'));var db=require('../../mysqldb')['db'];var utils=require(_0x1cb9('0x4'));var logger=require(_0x1cb9('0x5'))('rpc');var config=require(_0x1cb9('0x6'));var jayson=require(_0x1cb9('0x7'));var client=jayson['client'][_0x1cb9('0x8')]({'port':0x232a});function respondWithRpcPromise(_0x3f7deb,_0x4ffe20,_0x38737d){return new BPromise(function(_0x12567c,_0x59d1be){return client[_0x1cb9('0x9')](_0x3f7deb,_0x38737d)['then'](function(_0x567139){logger[_0x1cb9('0xa')](_0x1cb9('0xb'),_0x4ffe20,_0x1cb9('0xc'));logger[_0x1cb9('0xd')](_0x1cb9('0xe'),_0x4ffe20,'request\x20sent',JSON[_0x1cb9('0xf')](_0x567139));if(_0x567139[_0x1cb9('0x10')]){if(_0x567139[_0x1cb9('0x10')][_0x1cb9('0x11')]===0x1f4){logger[_0x1cb9('0x10')]('ZendeskAccount,\x20%s,\x20%s',_0x4ffe20,_0x567139['error']['message']);return _0x59d1be(_0x567139[_0x1cb9('0x10')][_0x1cb9('0x12')]);}logger[_0x1cb9('0x10')](_0x1cb9('0xb'),_0x4ffe20,_0x567139['error'][_0x1cb9('0x12')]);return _0x12567c(_0x567139[_0x1cb9('0x10')][_0x1cb9('0x12')]);}else{logger[_0x1cb9('0xa')](_0x1cb9('0xb'),_0x4ffe20,'request\x20sent');_0x12567c(_0x567139['result'][_0x1cb9('0x12')]);}})[_0x1cb9('0x13')](function(_0x3904b7){logger[_0x1cb9('0x10')](_0x1cb9('0xb'),_0x4ffe20,_0x3904b7);_0x59d1be(_0x3904b7);});});}exports[_0x1cb9('0x14')]=function(_0x23d3a9){var _0x4e1340=this;return new Promise(function(_0x479d43,_0x1b2fa6){return db[_0x1cb9('0x15')][_0x1cb9('0x16')]({'raw':_0x23d3a9[_0x1cb9('0x17')]?_0x23d3a9[_0x1cb9('0x17')][_0x1cb9('0x18')]===undefined?!![]:![]:!![],'where':_0x23d3a9[_0x1cb9('0x17')]?_0x23d3a9['options']['where']||null:null,'attributes':_0x23d3a9[_0x1cb9('0x17')]?_0x23d3a9['options'][_0x1cb9('0x19')]||null:null,'limit':_0x23d3a9[_0x1cb9('0x17')]?_0x23d3a9['options']['limit']||null:null,'include':_0x23d3a9[_0x1cb9('0x17')]?_0x23d3a9[_0x1cb9('0x17')][_0x1cb9('0x1a')]?_[_0x1cb9('0x1b')](_0x23d3a9[_0x1cb9('0x17')][_0x1cb9('0x1a')],function(_0x59ebea){return{'model':db[_0x59ebea['model']],'as':_0x59ebea['as'],'attributes':_0x59ebea[_0x1cb9('0x19')],'include':_0x59ebea['include']?_[_0x1cb9('0x1b')](_0x59ebea[_0x1cb9('0x1a')],function(_0x69b4c8){return{'model':db[_0x69b4c8[_0x1cb9('0x1c')]],'as':_0x69b4c8['as'],'attributes':_0x69b4c8[_0x1cb9('0x19')],'include':_0x69b4c8['include']?_[_0x1cb9('0x1b')](_0x69b4c8[_0x1cb9('0x1a')],function(_0x4c8d76){return{'model':db[_0x4c8d76[_0x1cb9('0x1c')]],'as':_0x4c8d76['as'],'attributes':_0x4c8d76[_0x1cb9('0x19')]};}):[]};}):[]};}):[]:[]})[_0x1cb9('0x1d')](function(_0x1804fd){logger[_0x1cb9('0xa')](_0x1cb9('0x14'),_0x23d3a9);logger[_0x1cb9('0xd')](_0x1cb9('0x14'),_0x23d3a9,JSON[_0x1cb9('0xf')](_0x1804fd));_0x479d43(_0x1804fd);})[_0x1cb9('0x13')](function(_0x48888d){logger[_0x1cb9('0x10')]('GetZendeskAccount',_0x48888d[_0x1cb9('0x12')],_0x23d3a9);_0x1b2fa6(_0x4e1340['error'](0x1f4,_0x48888d[_0x1cb9('0x12')]));});});};exports[_0x1cb9('0x1e')]=function(_0x3cd7f5){var _0x2038aa=this;return new Promise(function(_0x561d89,_0x1c701f){return db['ZendeskAccount'][_0x1cb9('0x1f')]({'raw':_0x3cd7f5[_0x1cb9('0x17')]?_0x3cd7f5[_0x1cb9('0x17')]['raw']===undefined?!![]:![]:!![],'where':_0x3cd7f5[_0x1cb9('0x17')]?_0x3cd7f5['options'][_0x1cb9('0x20')]||null:null,'attributes':_0x3cd7f5['options']?_0x3cd7f5[_0x1cb9('0x17')][_0x1cb9('0x19')]||null:null,'include':_0x3cd7f5[_0x1cb9('0x17')]?_0x3cd7f5[_0x1cb9('0x17')]['include']?_[_0x1cb9('0x1b')](_0x3cd7f5[_0x1cb9('0x17')][_0x1cb9('0x1a')],function(_0x91a1db){return{'model':db[_0x91a1db[_0x1cb9('0x1c')]],'as':_0x91a1db['as'],'attributes':_0x91a1db[_0x1cb9('0x19')],'include':_0x91a1db[_0x1cb9('0x1a')]?_[_0x1cb9('0x1b')](_0x91a1db[_0x1cb9('0x1a')],function(_0x1de287){return{'model':db[_0x1de287[_0x1cb9('0x1c')]],'as':_0x1de287['as'],'attributes':_0x1de287[_0x1cb9('0x19')],'include':_0x1de287[_0x1cb9('0x1a')]?_['map'](_0x1de287['include'],function(_0x299ff8){return{'model':db[_0x299ff8[_0x1cb9('0x1c')]],'as':_0x299ff8['as'],'attributes':_0x299ff8[_0x1cb9('0x19')]};}):[]};}):[]};}):[]:[]})[_0x1cb9('0x1d')](function(_0x385daa){logger[_0x1cb9('0xa')](_0x1cb9('0x1e'),_0x3cd7f5);logger[_0x1cb9('0xd')]('ShowZendeskAccount',_0x3cd7f5,JSON[_0x1cb9('0xf')](_0x385daa));_0x561d89(_0x385daa);})[_0x1cb9('0x13')](function(_0xefe136){logger['error'](_0x1cb9('0x1e'),_0xefe136['message'],_0x3cd7f5);_0x1c701f(_0x2038aa[_0x1cb9('0x10')](0x1f4,_0xefe136['message']));});});};
\ No newline at end of file
+var _0xbaf0=['ZendeskAccount,\x20%s,\x20%s,\x20%s','stringify','error','message','catch','GetZendeskAccount','ZendeskAccount','findAll','options','where','attributes','limit','include','model','map','ShowZendeskAccount','find','raw','util','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/logger','rpc','../../config/environment','jayson/promise','client','http','then','info','ZendeskAccount,\x20%s,\x20%s','request\x20sent','debug'];(function(_0x29a29f,_0x155ce7){var _0x443ea3=function(_0xe0dd24){while(--_0xe0dd24){_0x29a29f['push'](_0x29a29f['shift']());}};_0x443ea3(++_0x155ce7);}(_0xbaf0,0x12a));var _0x0baf=function(_0x465028,_0x4570ac){_0x465028=_0x465028-0x0;var _0xb783d4=_0xbaf0[_0x465028];return _0xb783d4;};'use strict';var _=require('lodash');var util=require(_0x0baf('0x0'));var moment=require(_0x0baf('0x1'));var BPromise=require(_0x0baf('0x2'));var rs=require(_0x0baf('0x3'));var fs=require('fs');var Redis=require(_0x0baf('0x4'));var db=require(_0x0baf('0x5'))['db'];var utils=require('../../config/utils');var logger=require(_0x0baf('0x6'))(_0x0baf('0x7'));var config=require(_0x0baf('0x8'));var jayson=require(_0x0baf('0x9'));var client=jayson[_0x0baf('0xa')][_0x0baf('0xb')]({'port':0x232a});function respondWithRpcPromise(_0x1a10b1,_0x2dcaac,_0x1d0a0d){return new BPromise(function(_0x5f5030,_0x11b947){return client['request'](_0x1a10b1,_0x1d0a0d)[_0x0baf('0xc')](function(_0x2c7442){logger[_0x0baf('0xd')](_0x0baf('0xe'),_0x2dcaac,_0x0baf('0xf'));logger[_0x0baf('0x10')](_0x0baf('0x11'),_0x2dcaac,_0x0baf('0xf'),JSON[_0x0baf('0x12')](_0x2c7442));if(_0x2c7442[_0x0baf('0x13')]){if(_0x2c7442[_0x0baf('0x13')]['code']===0x1f4){logger['error'](_0x0baf('0xe'),_0x2dcaac,_0x2c7442[_0x0baf('0x13')][_0x0baf('0x14')]);return _0x11b947(_0x2c7442[_0x0baf('0x13')]['message']);}logger[_0x0baf('0x13')]('ZendeskAccount,\x20%s,\x20%s',_0x2dcaac,_0x2c7442[_0x0baf('0x13')][_0x0baf('0x14')]);return _0x5f5030(_0x2c7442[_0x0baf('0x13')][_0x0baf('0x14')]);}else{logger[_0x0baf('0xd')](_0x0baf('0xe'),_0x2dcaac,'request\x20sent');_0x5f5030(_0x2c7442['result'][_0x0baf('0x14')]);}})[_0x0baf('0x15')](function(_0x283408){logger[_0x0baf('0x13')](_0x0baf('0xe'),_0x2dcaac,_0x283408);_0x11b947(_0x283408);});});}exports[_0x0baf('0x16')]=function(_0x53c338){var _0x63c820=this;return new Promise(function(_0xfbecec,_0x1ef0e5){return db[_0x0baf('0x17')][_0x0baf('0x18')]({'raw':_0x53c338[_0x0baf('0x19')]?_0x53c338['options']['raw']===undefined?!![]:![]:!![],'where':_0x53c338[_0x0baf('0x19')]?_0x53c338[_0x0baf('0x19')][_0x0baf('0x1a')]||null:null,'attributes':_0x53c338[_0x0baf('0x19')]?_0x53c338[_0x0baf('0x19')][_0x0baf('0x1b')]||null:null,'limit':_0x53c338[_0x0baf('0x19')]?_0x53c338[_0x0baf('0x19')][_0x0baf('0x1c')]||null:null,'include':_0x53c338[_0x0baf('0x19')]?_0x53c338['options'][_0x0baf('0x1d')]?_['map'](_0x53c338[_0x0baf('0x19')]['include'],function(_0x4de74c){return{'model':db[_0x4de74c[_0x0baf('0x1e')]],'as':_0x4de74c['as'],'attributes':_0x4de74c['attributes'],'include':_0x4de74c['include']?_[_0x0baf('0x1f')](_0x4de74c[_0x0baf('0x1d')],function(_0x34e264){return{'model':db[_0x34e264[_0x0baf('0x1e')]],'as':_0x34e264['as'],'attributes':_0x34e264[_0x0baf('0x1b')],'include':_0x34e264['include']?_[_0x0baf('0x1f')](_0x34e264[_0x0baf('0x1d')],function(_0x1ca35a){return{'model':db[_0x1ca35a[_0x0baf('0x1e')]],'as':_0x1ca35a['as'],'attributes':_0x1ca35a[_0x0baf('0x1b')]};}):[]};}):[]};}):[]:[]})[_0x0baf('0xc')](function(_0x453525){logger['info'](_0x0baf('0x16'),_0x53c338);logger[_0x0baf('0x10')](_0x0baf('0x16'),_0x53c338,JSON[_0x0baf('0x12')](_0x453525));_0xfbecec(_0x453525);})['catch'](function(_0x29dbdf){logger[_0x0baf('0x13')]('GetZendeskAccount',_0x29dbdf[_0x0baf('0x14')],_0x53c338);_0x1ef0e5(_0x63c820[_0x0baf('0x13')](0x1f4,_0x29dbdf[_0x0baf('0x14')]));});});};exports[_0x0baf('0x20')]=function(_0xd14f0f){var _0x366924=this;return new Promise(function(_0x213a6a,_0x57476f){return db[_0x0baf('0x17')][_0x0baf('0x21')]({'raw':_0xd14f0f[_0x0baf('0x19')]?_0xd14f0f[_0x0baf('0x19')][_0x0baf('0x22')]===undefined?!![]:![]:!![],'where':_0xd14f0f[_0x0baf('0x19')]?_0xd14f0f[_0x0baf('0x19')][_0x0baf('0x1a')]||null:null,'attributes':_0xd14f0f[_0x0baf('0x19')]?_0xd14f0f[_0x0baf('0x19')][_0x0baf('0x1b')]||null:null,'include':_0xd14f0f[_0x0baf('0x19')]?_0xd14f0f[_0x0baf('0x19')][_0x0baf('0x1d')]?_['map'](_0xd14f0f[_0x0baf('0x19')]['include'],function(_0x1aa474){return{'model':db[_0x1aa474[_0x0baf('0x1e')]],'as':_0x1aa474['as'],'attributes':_0x1aa474[_0x0baf('0x1b')],'include':_0x1aa474[_0x0baf('0x1d')]?_['map'](_0x1aa474[_0x0baf('0x1d')],function(_0x1d6575){return{'model':db[_0x1d6575['model']],'as':_0x1d6575['as'],'attributes':_0x1d6575[_0x0baf('0x1b')],'include':_0x1d6575[_0x0baf('0x1d')]?_[_0x0baf('0x1f')](_0x1d6575[_0x0baf('0x1d')],function(_0x1f60bd){return{'model':db[_0x1f60bd[_0x0baf('0x1e')]],'as':_0x1f60bd['as'],'attributes':_0x1f60bd[_0x0baf('0x1b')]};}):[]};}):[]};}):[]:[]})[_0x0baf('0xc')](function(_0x4aa6ed){logger[_0x0baf('0xd')](_0x0baf('0x20'),_0xd14f0f);logger['debug'](_0x0baf('0x20'),_0xd14f0f,JSON['stringify'](_0x4aa6ed));_0x213a6a(_0x4aa6ed);})['catch'](function(_0x11bc49){logger[_0x0baf('0x13')]('ShowZendeskAccount',_0x11bc49['message'],_0xd14f0f);_0x57476f(_0x366924[_0x0baf('0x13')](0x1f4,_0x11bc49[_0x0baf('0x14')]));});});};
\ No newline at end of file
diff --git a/server/api/intZendeskConfiguration/index.js b/server/api/intZendeskConfiguration/index.js
index fb2aa4f..ab0ed37 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 _0x0652=['getTags','post','create','put','delete','exports','util','path','connect-timeout','express','Router','../../components/auth/service','../../components/interaction/service','../../config/environment','get','isAuthenticated','index','/:id','/:id/fields','/:id/subjects','getSubjects','/:id/descriptions','getDescriptions','/:id/tags'];(function(_0x5008c8,_0x342e4a){var _0x28d778=function(_0x2dd365){while(--_0x2dd365){_0x5008c8['push'](_0x5008c8['shift']());}};_0x28d778(++_0x342e4a);}(_0x0652,0x126));var _0x2065=function(_0x5a513f,_0x198d7d){_0x5a513f=_0x5a513f-0x0;var _0x263ecf=_0x0652[_0x5a513f];return _0x263ecf;};'use strict';var multer=require('multer');var util=require(_0x2065('0x0'));var path=require(_0x2065('0x1'));var timeout=require(_0x2065('0x2'));var express=require(_0x2065('0x3'));var router=express[_0x2065('0x4')]();var auth=require(_0x2065('0x5'));var interaction=require(_0x2065('0x6'));var config=require(_0x2065('0x7'));var controller=require('./intZendeskConfiguration.controller');router[_0x2065('0x8')]('/',auth[_0x2065('0x9')](),controller[_0x2065('0xa')]);router[_0x2065('0x8')](_0x2065('0xb'),auth[_0x2065('0x9')](),controller['show']);router['get'](_0x2065('0xc'),auth[_0x2065('0x9')](),controller['getFields']);router[_0x2065('0x8')](_0x2065('0xd'),auth[_0x2065('0x9')](),controller[_0x2065('0xe')]);router['get'](_0x2065('0xf'),auth[_0x2065('0x9')](),controller[_0x2065('0x10')]);router[_0x2065('0x8')](_0x2065('0x11'),auth[_0x2065('0x9')](),controller[_0x2065('0x12')]);router[_0x2065('0x13')]('/',auth['isAuthenticated'](),controller[_0x2065('0x14')]);router[_0x2065('0x13')](_0x2065('0x11'),auth['isAuthenticated'](),controller['setTags']);router[_0x2065('0x15')](_0x2065('0xb'),auth[_0x2065('0x9')](),controller['update']);router[_0x2065('0x16')](_0x2065('0xb'),auth[_0x2065('0x9')](),controller['destroy']);module[_0x2065('0x17')]=router;
\ No newline at end of file
+var _0x2373=['isAuthenticated','/:id/fields','getFields','getSubjects','getDescriptions','getTags','post','create','setTags','put','update','delete','multer','path','connect-timeout','express','Router','../../components/auth/service','../../components/interaction/service','../../config/environment','get','index','/:id'];(function(_0x14add3,_0x13ce8d){var _0x4a174f=function(_0x2b3ed7){while(--_0x2b3ed7){_0x14add3['push'](_0x14add3['shift']());}};_0x4a174f(++_0x13ce8d);}(_0x2373,0xdb));var _0x3237=function(_0x1775a8,_0x1816c5){_0x1775a8=_0x1775a8-0x0;var _0x1ea6ad=_0x2373[_0x1775a8];return _0x1ea6ad;};'use strict';var multer=require(_0x3237('0x0'));var util=require('util');var path=require(_0x3237('0x1'));var timeout=require(_0x3237('0x2'));var express=require(_0x3237('0x3'));var router=express[_0x3237('0x4')]();var auth=require(_0x3237('0x5'));var interaction=require(_0x3237('0x6'));var config=require(_0x3237('0x7'));var controller=require('./intZendeskConfiguration.controller');router[_0x3237('0x8')]('/',auth['isAuthenticated'](),controller[_0x3237('0x9')]);router['get'](_0x3237('0xa'),auth[_0x3237('0xb')](),controller['show']);router['get'](_0x3237('0xc'),auth[_0x3237('0xb')](),controller[_0x3237('0xd')]);router[_0x3237('0x8')]('/:id/subjects',auth[_0x3237('0xb')](),controller[_0x3237('0xe')]);router[_0x3237('0x8')]('/:id/descriptions',auth[_0x3237('0xb')](),controller[_0x3237('0xf')]);router[_0x3237('0x8')]('/:id/tags',auth[_0x3237('0xb')](),controller[_0x3237('0x10')]);router[_0x3237('0x11')]('/',auth[_0x3237('0xb')](),controller[_0x3237('0x12')]);router[_0x3237('0x11')]('/:id/tags',auth[_0x3237('0xb')](),controller[_0x3237('0x13')]);router[_0x3237('0x14')]('/:id',auth['isAuthenticated'](),controller[_0x3237('0x15')]);router[_0x3237('0x16')](_0x3237('0xa'),auth[_0x3237('0xb')](),controller['destroy']);module['exports']=router;
\ No newline at end of file
diff --git a/server/api/intZendeskConfiguration/intZendeskConfiguration.attributes.js b/server/api/intZendeskConfiguration/intZendeskConfiguration.attributes.js
index e1bd907..b190cf0 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 _0x6407=['exports','STRING','sequelize'];(function(_0x19521e,_0x4188cc){var _0x52b557=function(_0x4c413d){while(--_0x4c413d){_0x19521e['push'](_0x19521e['shift']());}};_0x52b557(++_0x4188cc);}(_0x6407,0x122));var _0x7640=function(_0x4c440b,_0x3ea627){_0x4c440b=_0x4c440b-0x0;var _0x2d48cf=_0x6407[_0x4c440b];return _0x2d48cf;};'use strict';var Sequelize=require(_0x7640('0x0'));module[_0x7640('0x1')]={'name':{'type':Sequelize['STRING']},'description':{'type':Sequelize[_0x7640('0x2')]}};
\ No newline at end of file
+var _0xe7ae=['STRING','sequelize','exports'];(function(_0x4ded27,_0x49a18c){var _0x105ecc=function(_0x471060){while(--_0x471060){_0x4ded27['push'](_0x4ded27['shift']());}};_0x105ecc(++_0x49a18c);}(_0xe7ae,0x76));var _0xee7a=function(_0x4b8b81,_0x34f111){_0x4b8b81=_0x4b8b81-0x0;var _0xed7d61=_0xe7ae[_0x4b8b81];return _0xed7d61;};'use strict';var Sequelize=require(_0xee7a('0x0'));module[_0xee7a('0x1')]={'name':{'type':Sequelize['STRING']},'description':{'type':Sequelize[_0xee7a('0x2')]}};
\ No newline at end of file
diff --git a/server/api/intZendeskConfiguration/intZendeskConfiguration.controller.js b/server/api/intZendeskConfiguration/intZendeskConfiguration.controller.js
index 7201f14..483d391 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 _0x814b=['filters','pick','merge','type','VIRTUAL','filter','options','ZendeskConfiguration','count','includeAll','include','findAll','rows','show','params','keys','find','body','getFields','findOne','ZendeskField','getSubjects','getDescriptions','getTags','setTags','ids','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','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','error','ZendeskConfiguration,\x20%s,\x20%s','message','catch','sendStatus','status','end','json','offset','Content-Range','reject','save','update','destroy','stack','name','send','index','map','rawAttributes','fieldName','key','intersection','model','query','attributes','fields','length','hasOwnProperty','nolimit','limit','order','sort','where'];(function(_0x3e14ff,_0x2c9a34){var _0xff5f08=function(_0x2d8d96){while(--_0x2d8d96){_0x3e14ff['push'](_0x3e14ff['shift']());}};_0xff5f08(++_0x2c9a34);}(_0x814b,0x1a2));var _0xb814=function(_0xe719ec,_0x5a280e){_0xe719ec=_0xe719ec-0x0;var _0x4842a1=_0x814b[_0xe719ec];return _0x4842a1;};'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'];var jayson=require(_0xb814('0x1a'));var client=jayson[_0xb814('0x1b')][_0xb814('0x1c')]({'port':0x232a});function checkPasswordPattern(_0x2ce718,_0x3bde14,_0x1438e7){if(_0x1438e7){var _0x41ed7b=new RegExp(/(?=.*[a-z])(?=.*[A-Z])(?=.*[0-9])(?=.*[?!@#\$%\^&\*~\-_=+[{\]\}])(?=.{8,})/);if(_0x41ed7b[_0xb814('0x1d')](_0x3bde14)){return _0x2ce718;}else{throw new db[(_0xb814('0x1e'))][(_0xb814('0x1f'))](_0xb814('0x20'));}}else{return _0x2ce718;}}function respondWithRpcPromise(_0x17f5bd,_0x39bfcf,_0x303aca,_0x3a71d6){return new BPromise(function(_0x45e0d0,_0x265a83){var _0x125ce2=_0x3a71d6||client;return _0x125ce2[_0xb814('0x21')](_0x17f5bd,_0x303aca)[_0xb814('0x22')](function(_0x48c9df){logger[_0xb814('0x23')]('ZendeskConfiguration,\x20%s,\x20%s',_0x39bfcf,_0xb814('0x24'));logger[_0xb814('0x25')]('ZendeskConfiguration,\x20%s,\x20%s,\x20%s',_0x39bfcf,'request\x20sent',JSON['stringify'](_0x48c9df));if(_0x48c9df[_0xb814('0x26')]){if(_0x48c9df['error']['code']===0x1f4){logger[_0xb814('0x26')](_0xb814('0x27'),_0x39bfcf,_0x48c9df[_0xb814('0x26')]['message']);return _0x265a83(_0x48c9df[_0xb814('0x26')]['message']);}logger[_0xb814('0x26')](_0xb814('0x27'),_0x39bfcf,_0x48c9df[_0xb814('0x26')][_0xb814('0x28')]);return _0x45e0d0(_0x48c9df[_0xb814('0x26')][_0xb814('0x28')]);}else{logger[_0xb814('0x23')]('ZendeskConfiguration,\x20%s,\x20%s',_0x39bfcf,_0xb814('0x24'));_0x45e0d0(_0x48c9df['result'][_0xb814('0x28')]);}})[_0xb814('0x29')](function(_0x31c7ec){logger[_0xb814('0x26')](_0xb814('0x27'),_0x39bfcf,_0x31c7ec);_0x265a83(_0x31c7ec);});});}function respondWithStatusCode(_0xb9e57d,_0x3d836c){_0x3d836c=_0x3d836c||0xcc;return function(_0x5755ea){if(_0x5755ea){return _0xb9e57d[_0xb814('0x2a')](_0x3d836c);}return _0xb9e57d[_0xb814('0x2b')](_0x3d836c)[_0xb814('0x2c')]();};}function respondWithResult(_0x349394,_0x32ed56){_0x32ed56=_0x32ed56||0xc8;return function(_0x1d5965){if(_0x1d5965){return _0x349394[_0xb814('0x2b')](_0x32ed56)[_0xb814('0x2d')](_0x1d5965);}};}function respondWithFilteredResult(_0x5a6291,_0x271aa8){return function(_0x328a08){if(_0x328a08){var _0x52ed64=_0x328a08['count'],_0x9008b2=_0x271aa8[_0xb814('0x2e')],_0x37d24d=_0x271aa8[_0xb814('0x2e')]+_0x271aa8['limit'],_0x530744;if(_0x37d24d>=_0x52ed64){_0x37d24d=_0x52ed64;_0x530744=0xc8;}else{_0x530744=0xce;}_0x5a6291[_0xb814('0x2b')](_0x530744);return _0x5a6291['set'](_0xb814('0x2f'),_0x9008b2+'-'+_0x37d24d+'/'+_0x52ed64)['json'](_0x328a08);}return null;};}function patchUpdates(_0x4cfc58){return function(_0x419cd9){try{jsonpatch['apply'](_0x419cd9,_0x4cfc58,!![]);}catch(_0x2431e2){return BPromise[_0xb814('0x30')](_0x2431e2);}return _0x419cd9[_0xb814('0x31')]();};}function saveUpdates(_0x599f9f,_0x51d5ae){return function(_0x26d3a9){if(_0x26d3a9){return _0x26d3a9[_0xb814('0x32')](_0x599f9f)['then'](function(_0x2c8943){return _0x2c8943;});}return null;};}function removeEntity(_0xe558d5,_0x692c72){return function(_0x217b7e){if(_0x217b7e){return _0x217b7e[_0xb814('0x33')]()[_0xb814('0x22')](function(){_0xe558d5[_0xb814('0x2b')](0xcc)['end']();});}};}function handleEntityNotFound(_0x3207ec,_0x2263f6){return function(_0x30de5a){if(!_0x30de5a){_0x3207ec[_0xb814('0x2a')](0x194);}return _0x30de5a;};}function handleError(_0x14100d,_0x4ff31a){_0x4ff31a=_0x4ff31a||0x1f4;return function(_0x16ef82){logger['error'](_0x16ef82[_0xb814('0x34')]);if(_0x16ef82[_0xb814('0x35')]){delete _0x16ef82[_0xb814('0x35')];}_0x14100d['status'](_0x4ff31a)[_0xb814('0x36')](_0x16ef82);};}exports[_0xb814('0x37')]=function(_0x4ea6f8,_0x2fcd92){var _0x2d0e27={},_0x1a8bd0={},_0x1f7cd8={'count':0x0,'rows':[]};var _0xd77d96=_[_0xb814('0x38')](db['ZendeskConfiguration'][_0xb814('0x39')],function(_0x4e4684){return{'name':_0x4e4684[_0xb814('0x3a')],'type':_0x4e4684['type'][_0xb814('0x3b')]};});_0x1a8bd0['model']=_[_0xb814('0x38')](_0xd77d96,_0xb814('0x35'));_0x1a8bd0['query']=_['keys'](_0x4ea6f8['query']);_0x1a8bd0['filters']=_[_0xb814('0x3c')](_0x1a8bd0[_0xb814('0x3d')],_0x1a8bd0[_0xb814('0x3e')]);_0x2d0e27[_0xb814('0x3f')]=_['intersection'](_0x1a8bd0['model'],qs[_0xb814('0x40')](_0x4ea6f8['query'][_0xb814('0x40')]));_0x2d0e27[_0xb814('0x3f')]=_0x2d0e27[_0xb814('0x3f')][_0xb814('0x41')]?_0x2d0e27[_0xb814('0x3f')]:_0x1a8bd0[_0xb814('0x3d')];if(!_0x4ea6f8[_0xb814('0x3e')][_0xb814('0x42')](_0xb814('0x43'))){_0x2d0e27['limit']=qs['limit'](_0x4ea6f8['query'][_0xb814('0x44')]);_0x2d0e27['offset']=qs[_0xb814('0x2e')](_0x4ea6f8['query'][_0xb814('0x2e')]);}_0x2d0e27[_0xb814('0x45')]=qs[_0xb814('0x46')](_0x4ea6f8[_0xb814('0x3e')]['sort']);_0x2d0e27[_0xb814('0x47')]=qs[_0xb814('0x48')](_[_0xb814('0x49')](_0x4ea6f8[_0xb814('0x3e')],_0x1a8bd0[_0xb814('0x48')]));if(_0x4ea6f8[_0xb814('0x3e')]['filter']){_0x2d0e27[_0xb814('0x47')]=_[_0xb814('0x4a')](_0x2d0e27[_0xb814('0x47')],{'$or':_[_0xb814('0x38')](_0xd77d96,function(_0x46408b){if(_0x46408b[_0xb814('0x4b')]!==_0xb814('0x4c')){var _0x519545={};_0x519545[_0x46408b['name']]={'$like':'%'+_0x4ea6f8[_0xb814('0x3e')][_0xb814('0x4d')]+'%'};return _0x519545;}})});}_0x2d0e27=_[_0xb814('0x4a')]({},_0x2d0e27,_0x4ea6f8[_0xb814('0x4e')]);var _0x43f1b={'where':_0x2d0e27[_0xb814('0x47')]};return db[_0xb814('0x4f')][_0xb814('0x50')](_0x43f1b)[_0xb814('0x22')](function(_0x344198){_0x1f7cd8[_0xb814('0x50')]=_0x344198;if(_0x4ea6f8['query'][_0xb814('0x51')]){_0x2d0e27[_0xb814('0x52')]=[{'all':!![]}];}return db['ZendeskConfiguration'][_0xb814('0x53')](_0x2d0e27);})['then'](function(_0x2fb0f7){_0x1f7cd8[_0xb814('0x54')]=_0x2fb0f7;return _0x1f7cd8;})[_0xb814('0x22')](respondWithFilteredResult(_0x2fcd92,_0x2d0e27))[_0xb814('0x29')](handleError(_0x2fcd92,null));};exports[_0xb814('0x55')]=function(_0x4096d4,_0x2cc806){var _0x45480e={'raw':![],'where':{'id':_0x4096d4[_0xb814('0x56')]['id']}},_0x32a397={};_0x32a397['model']=_['keys'](db[_0xb814('0x4f')][_0xb814('0x39')]);_0x32a397[_0xb814('0x3e')]=_[_0xb814('0x57')](_0x4096d4[_0xb814('0x3e')]);_0x32a397[_0xb814('0x48')]=_[_0xb814('0x3c')](_0x32a397['model'],_0x32a397[_0xb814('0x3e')]);_0x45480e[_0xb814('0x3f')]=_[_0xb814('0x3c')](_0x32a397['model'],qs[_0xb814('0x40')](_0x4096d4['query'][_0xb814('0x40')]));_0x45480e['attributes']=_0x45480e[_0xb814('0x3f')][_0xb814('0x41')]?_0x45480e['attributes']:_0x32a397[_0xb814('0x3d')];if(_0x4096d4[_0xb814('0x3e')][_0xb814('0x51')]){_0x45480e['include']=[{'all':!![]}];}_0x45480e=_[_0xb814('0x4a')]({},_0x45480e,_0x4096d4['options']);return db[_0xb814('0x4f')][_0xb814('0x58')](_0x45480e)['then'](handleEntityNotFound(_0x2cc806,null))[_0xb814('0x22')](respondWithResult(_0x2cc806,null))['catch'](handleError(_0x2cc806,null));};exports['create']=function(_0x3b9709,_0x35f59a){return db[_0xb814('0x4f')]['create'](_0x3b9709[_0xb814('0x59')],{})['then'](respondWithResult(_0x35f59a,0xc9))[_0xb814('0x29')](handleError(_0x35f59a,null));};exports[_0xb814('0x32')]=function(_0x58d6e5,_0x2db5a6){if(_0x58d6e5['body']['id']){delete _0x58d6e5[_0xb814('0x59')]['id'];}return db[_0xb814('0x4f')][_0xb814('0x58')]({'where':{'id':_0x58d6e5[_0xb814('0x56')]['id']}})[_0xb814('0x22')](handleEntityNotFound(_0x2db5a6,null))[_0xb814('0x22')](saveUpdates(_0x58d6e5[_0xb814('0x59')],null))[_0xb814('0x22')](respondWithResult(_0x2db5a6,null))['catch'](handleError(_0x2db5a6,null));};exports[_0xb814('0x33')]=function(_0x5441c5,_0x5d71d5){return db[_0xb814('0x4f')][_0xb814('0x58')]({'where':{'id':_0x5441c5['params']['id']}})[_0xb814('0x22')](handleEntityNotFound(_0x5d71d5,null))['then'](removeEntity(_0x5d71d5,null))['catch'](handleError(_0x5d71d5,null));};exports[_0xb814('0x5a')]=function(_0x5257be,_0x3ff213,_0xd1cd8b){var _0x2dec52={};var _0x586957={};var _0x1a0ef4;var _0x4df65c;return db[_0xb814('0x4f')][_0xb814('0x5b')]({'where':{'id':_0x5257be[_0xb814('0x56')]['id']}})[_0xb814('0x22')](handleEntityNotFound(_0x3ff213,null))[_0xb814('0x22')](function(_0x3b374b){if(_0x3b374b){_0x1a0ef4=_0x3b374b;_0x586957[_0xb814('0x3d')]=_[_0xb814('0x57')](db[_0xb814('0x5c')]['rawAttributes']);_0x586957[_0xb814('0x3e')]=_[_0xb814('0x57')](_0x5257be[_0xb814('0x3e')]);_0x586957[_0xb814('0x48')]=_[_0xb814('0x3c')](_0x586957[_0xb814('0x3d')],_0x586957['query']);_0x2dec52[_0xb814('0x3f')]=_['intersection'](_0x586957[_0xb814('0x3d')],qs[_0xb814('0x40')](_0x5257be[_0xb814('0x3e')]['fields']));_0x2dec52[_0xb814('0x3f')]=_0x2dec52['attributes'][_0xb814('0x41')]?_0x2dec52['attributes']:_0x586957[_0xb814('0x3d')];_0x2dec52[_0xb814('0x45')]=qs[_0xb814('0x46')](_0x5257be[_0xb814('0x3e')][_0xb814('0x46')]);_0x2dec52[_0xb814('0x47')]=qs[_0xb814('0x48')](_['pick'](_0x5257be[_0xb814('0x3e')],_0x586957['filters']));if(_0x5257be[_0xb814('0x3e')][_0xb814('0x4d')]){_0x2dec52[_0xb814('0x47')]=_[_0xb814('0x4a')](_0x2dec52[_0xb814('0x47')],{'$or':_[_0xb814('0x38')](_0x2dec52['attributes'],function(_0x12882a){var _0x1a2603={};_0x1a2603[_0x12882a]={'$like':'%'+_0x5257be['query'][_0xb814('0x4d')]+'%'};return _0x1a2603;})});}_0x2dec52=_[_0xb814('0x4a')]({},_0x2dec52,_0x5257be[_0xb814('0x4e')]);return _0x1a0ef4[_0xb814('0x5a')](_0x2dec52);}})[_0xb814('0x22')](function(_0x51d834){if(_0x51d834){_0x4df65c=_0x51d834[_0xb814('0x41')];if(!_0x5257be['query'][_0xb814('0x42')](_0xb814('0x43'))){_0x2dec52[_0xb814('0x44')]=qs[_0xb814('0x44')](_0x5257be[_0xb814('0x3e')][_0xb814('0x44')]);_0x2dec52['offset']=qs['offset'](_0x5257be['query'][_0xb814('0x2e')]);}return _0x1a0ef4['getFields'](_0x2dec52);}})[_0xb814('0x22')](function(_0x1d3954){if(_0x1d3954){return _0x1d3954?{'count':_0x4df65c,'rows':_0x1d3954}:null;}})[_0xb814('0x22')](respondWithResult(_0x3ff213,null))['catch'](handleError(_0x3ff213,null));};exports[_0xb814('0x5d')]=function(_0x3e5ce8,_0xee204,_0x5aabbe){var _0x30f717={};var _0x1bf0b7={};var _0x1f39c0;var _0x3564e0;return db['ZendeskConfiguration']['findOne']({'where':{'id':_0x3e5ce8[_0xb814('0x56')]['id']}})[_0xb814('0x22')](handleEntityNotFound(_0xee204,null))[_0xb814('0x22')](function(_0x408870){if(_0x408870){_0x1f39c0=_0x408870;_0x1bf0b7[_0xb814('0x3d')]=_[_0xb814('0x57')](db[_0xb814('0x5c')][_0xb814('0x39')]);_0x1bf0b7[_0xb814('0x3e')]=_[_0xb814('0x57')](_0x3e5ce8[_0xb814('0x3e')]);_0x1bf0b7[_0xb814('0x48')]=_[_0xb814('0x3c')](_0x1bf0b7[_0xb814('0x3d')],_0x1bf0b7[_0xb814('0x3e')]);_0x30f717['attributes']=_[_0xb814('0x3c')](_0x1bf0b7[_0xb814('0x3d')],qs[_0xb814('0x40')](_0x3e5ce8[_0xb814('0x3e')][_0xb814('0x40')]));_0x30f717[_0xb814('0x3f')]=_0x30f717['attributes'][_0xb814('0x41')]?_0x30f717['attributes']:_0x1bf0b7[_0xb814('0x3d')];_0x30f717[_0xb814('0x45')]=qs[_0xb814('0x46')](_0x3e5ce8[_0xb814('0x3e')][_0xb814('0x46')]);_0x30f717['where']=qs['filters'](_[_0xb814('0x49')](_0x3e5ce8[_0xb814('0x3e')],_0x1bf0b7[_0xb814('0x48')]));if(_0x3e5ce8[_0xb814('0x3e')]['filter']){_0x30f717[_0xb814('0x47')]=_['merge'](_0x30f717[_0xb814('0x47')],{'$or':_[_0xb814('0x38')](_0x30f717['attributes'],function(_0x58b016){var _0x2fa6b7={};_0x2fa6b7[_0x58b016]={'$like':'%'+_0x3e5ce8['query'][_0xb814('0x4d')]+'%'};return _0x2fa6b7;})});}_0x30f717=_[_0xb814('0x4a')]({},_0x30f717,_0x3e5ce8[_0xb814('0x4e')]);return _0x1f39c0[_0xb814('0x5d')](_0x30f717);}})[_0xb814('0x22')](function(_0x420bde){if(_0x420bde){_0x3564e0=_0x420bde[_0xb814('0x41')];if(!_0x3e5ce8['query'][_0xb814('0x42')]('nolimit')){_0x30f717[_0xb814('0x44')]=qs['limit'](_0x3e5ce8[_0xb814('0x3e')][_0xb814('0x44')]);_0x30f717['offset']=qs[_0xb814('0x2e')](_0x3e5ce8['query'][_0xb814('0x2e')]);}return _0x1f39c0[_0xb814('0x5d')](_0x30f717);}})['then'](function(_0x5a0c4a){if(_0x5a0c4a){return _0x5a0c4a?{'count':_0x3564e0,'rows':_0x5a0c4a}:null;}})[_0xb814('0x22')](respondWithResult(_0xee204,null))[_0xb814('0x29')](handleError(_0xee204,null));};exports[_0xb814('0x5e')]=function(_0x6f5e6a,_0x220f8b,_0x4394da){var _0x2b12a9={};var _0x314600={};var _0x8cb107;var _0x34f49c;return db['ZendeskConfiguration']['findOne']({'where':{'id':_0x6f5e6a['params']['id']}})['then'](handleEntityNotFound(_0x220f8b,null))['then'](function(_0x45a202){if(_0x45a202){_0x8cb107=_0x45a202;_0x314600[_0xb814('0x3d')]=_[_0xb814('0x57')](db['ZendeskField'][_0xb814('0x39')]);_0x314600[_0xb814('0x3e')]=_[_0xb814('0x57')](_0x6f5e6a[_0xb814('0x3e')]);_0x314600[_0xb814('0x48')]=_[_0xb814('0x3c')](_0x314600[_0xb814('0x3d')],_0x314600[_0xb814('0x3e')]);_0x2b12a9['attributes']=_[_0xb814('0x3c')](_0x314600[_0xb814('0x3d')],qs[_0xb814('0x40')](_0x6f5e6a[_0xb814('0x3e')]['fields']));_0x2b12a9[_0xb814('0x3f')]=_0x2b12a9[_0xb814('0x3f')][_0xb814('0x41')]?_0x2b12a9[_0xb814('0x3f')]:_0x314600[_0xb814('0x3d')];_0x2b12a9['order']=qs['sort'](_0x6f5e6a[_0xb814('0x3e')]['sort']);_0x2b12a9[_0xb814('0x47')]=qs[_0xb814('0x48')](_['pick'](_0x6f5e6a[_0xb814('0x3e')],_0x314600['filters']));if(_0x6f5e6a[_0xb814('0x3e')]['filter']){_0x2b12a9[_0xb814('0x47')]=_[_0xb814('0x4a')](_0x2b12a9[_0xb814('0x47')],{'$or':_[_0xb814('0x38')](_0x2b12a9[_0xb814('0x3f')],function(_0x1ae812){var _0x455b22={};_0x455b22[_0x1ae812]={'$like':'%'+_0x6f5e6a['query']['filter']+'%'};return _0x455b22;})});}_0x2b12a9=_[_0xb814('0x4a')]({},_0x2b12a9,_0x6f5e6a['options']);return _0x8cb107['getDescriptions'](_0x2b12a9);}})[_0xb814('0x22')](function(_0x8fbda1){if(_0x8fbda1){_0x34f49c=_0x8fbda1[_0xb814('0x41')];if(!_0x6f5e6a['query'][_0xb814('0x42')]('nolimit')){_0x2b12a9[_0xb814('0x44')]=qs[_0xb814('0x44')](_0x6f5e6a[_0xb814('0x3e')][_0xb814('0x44')]);_0x2b12a9['offset']=qs[_0xb814('0x2e')](_0x6f5e6a[_0xb814('0x3e')][_0xb814('0x2e')]);}return _0x8cb107['getDescriptions'](_0x2b12a9);}})[_0xb814('0x22')](function(_0x3fc77d){if(_0x3fc77d){return _0x3fc77d?{'count':_0x34f49c,'rows':_0x3fc77d}:null;}})[_0xb814('0x22')](respondWithResult(_0x220f8b,null))['catch'](handleError(_0x220f8b,null));};exports[_0xb814('0x5f')]=function(_0x2d0651,_0x9dc06b,_0x216d67){var _0x40b3c5={};var _0x1ae8e8={};var _0x37a7ab;var _0x472c38;return db[_0xb814('0x4f')][_0xb814('0x5b')]({'where':{'id':_0x2d0651[_0xb814('0x56')]['id']}})[_0xb814('0x22')](handleEntityNotFound(_0x9dc06b,null))[_0xb814('0x22')](function(_0x5b8d2e){if(_0x5b8d2e){_0x37a7ab=_0x5b8d2e;_0x1ae8e8['model']=_[_0xb814('0x57')](db['Tag'][_0xb814('0x39')]);_0x1ae8e8[_0xb814('0x3e')]=_[_0xb814('0x57')](_0x2d0651[_0xb814('0x3e')]);_0x1ae8e8[_0xb814('0x48')]=_[_0xb814('0x3c')](_0x1ae8e8[_0xb814('0x3d')],_0x1ae8e8['query']);_0x40b3c5['attributes']=_[_0xb814('0x3c')](_0x1ae8e8['model'],qs[_0xb814('0x40')](_0x2d0651[_0xb814('0x3e')][_0xb814('0x40')]));_0x40b3c5['attributes']=_0x40b3c5[_0xb814('0x3f')][_0xb814('0x41')]?_0x40b3c5[_0xb814('0x3f')]:_0x1ae8e8[_0xb814('0x3d')];_0x40b3c5[_0xb814('0x45')]=qs['sort'](_0x2d0651[_0xb814('0x3e')][_0xb814('0x46')]);_0x40b3c5['where']=qs[_0xb814('0x48')](_[_0xb814('0x49')](_0x2d0651[_0xb814('0x3e')],_0x1ae8e8['filters']));if(_0x2d0651[_0xb814('0x3e')][_0xb814('0x4d')]){_0x40b3c5['where']=_[_0xb814('0x4a')](_0x40b3c5[_0xb814('0x47')],{'$or':_['map'](_0x40b3c5[_0xb814('0x3f')],function(_0x269832){var _0x3f4cbf={};_0x3f4cbf[_0x269832]={'$like':'%'+_0x2d0651[_0xb814('0x3e')][_0xb814('0x4d')]+'%'};return _0x3f4cbf;})});}_0x40b3c5=_[_0xb814('0x4a')]({},_0x40b3c5,_0x2d0651[_0xb814('0x4e')]);return _0x37a7ab[_0xb814('0x5f')](_0x40b3c5);}})[_0xb814('0x22')](function(_0x1f8c7a){if(_0x1f8c7a){_0x472c38=_0x1f8c7a[_0xb814('0x41')];if(!_0x2d0651[_0xb814('0x3e')]['hasOwnProperty']('nolimit')){_0x40b3c5[_0xb814('0x44')]=qs['limit'](_0x2d0651['query'][_0xb814('0x44')]);_0x40b3c5['offset']=qs['offset'](_0x2d0651['query'][_0xb814('0x2e')]);}return _0x37a7ab[_0xb814('0x5f')](_0x40b3c5);}})[_0xb814('0x22')](function(_0x5eb4b1){if(_0x5eb4b1){return _0x5eb4b1?{'count':_0x472c38,'rows':_0x5eb4b1}:null;}})[_0xb814('0x22')](respondWithResult(_0x9dc06b,null))['catch'](handleError(_0x9dc06b,null));};exports[_0xb814('0x60')]=function(_0x2e6660,_0x49a8de,_0x3c6a59){if(_0x2e6660['body']['id']){delete _0x2e6660[_0xb814('0x59')]['id'];}return db[_0xb814('0x4f')][_0xb814('0x5b')]({'where':{'id':_0x2e6660[_0xb814('0x56')]['id']}})[_0xb814('0x22')](handleEntityNotFound(_0x49a8de,null))[_0xb814('0x22')](function(_0x1f2ef8){if(_0x1f2ef8){return _0x1f2ef8[_0xb814('0x60')](_0x2e6660[_0xb814('0x59')][_0xb814('0x61')]||[]);}return null;})[_0xb814('0x22')](respondWithResult(_0x49a8de,null))[_0xb814('0x29')](handleError(_0x49a8de,null));};
\ No newline at end of file
+var _0x1261=['update','then','destroy','stack','name','send','index','map','ZendeskConfiguration','rawAttributes','type','model','query','keys','filters','intersection','attributes','fields','length','hasOwnProperty','nolimit','order','sort','pick','filter','merge','count','includeAll','findAll','rows','catch','show','include','create','body','find','params','getFields','findOne','where','options','getSubjects','ZendeskField','getDescriptions','Tag','getTags','setTags','ids','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','moment','bluebird','mustache','util','path','ejs','lodash','crypto','jsforce','desk.js','to-csv','querystring','ioredis','../../components/auth/service','../../components/parsers/qs','../../config/license/hardware','../../config/utils','../../mysqldb','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','info','debug','ZendeskConfiguration,\x20%s,\x20%s,\x20%s','error','code','ZendeskConfiguration,\x20%s,\x20%s','message','request\x20sent','sendStatus','status','offset','limit','set','apply','save'];(function(_0x5783f4,_0x4a9e0a){var _0x28e380=function(_0x1ffc49){while(--_0x1ffc49){_0x5783f4['push'](_0x5783f4['shift']());}};_0x28e380(++_0x4a9e0a);}(_0x1261,0x144));var _0x1126=function(_0x3fea84,_0x3e832f){_0x3fea84=_0x3fea84-0x0;var _0x20778a=_0x1261[_0x3fea84];return _0x20778a;};'use strict';var pdf=require('html-pdf');var emlformat=require(_0x1126('0x0'));var rimraf=require(_0x1126('0x1'));var zipdir=require(_0x1126('0x2'));var jsonpatch=require(_0x1126('0x3'));var rp=require(_0x1126('0x4'));var moment=require(_0x1126('0x5'));var BPromise=require(_0x1126('0x6'));var Mustache=require(_0x1126('0x7'));var util=require(_0x1126('0x8'));var path=require(_0x1126('0x9'));var sox=require('sox');var csv=require('to-csv');var ejs=require(_0x1126('0xa'));var fs=require('fs');var _=require(_0x1126('0xb'));var squel=require('squel');var crypto=require(_0x1126('0xc'));var jsforce=require(_0x1126('0xd'));var deskjs=require(_0x1126('0xe'));var toCsv=require(_0x1126('0xf'));var querystring=require(_0x1126('0x10'));var Papa=require('papaparse');var Redis=require(_0x1126('0x11'));var authService=require(_0x1126('0x12'));var qs=require(_0x1126('0x13'));var as=require('../../components/parsers/advancedSearch');var hardwareService=require(_0x1126('0x14'));var logger=require('../../config/logger')('api');var utils=require(_0x1126('0x15'));var config=require('../../config/environment');var db=require(_0x1126('0x16'))['db'];var jayson=require(_0x1126('0x17'));var client=jayson[_0x1126('0x18')][_0x1126('0x19')]({'port':0x232a});function checkPasswordPattern(_0xca0355,_0x3f10e9,_0xd8ca42){if(_0xd8ca42){var _0x2048ad=new RegExp(/(?=.*[a-z])(?=.*[A-Z])(?=.*[0-9])(?=.*[?!@#\$%\^&\*~\-_=+[{\]\}])(?=.{8,})/);if(_0x2048ad[_0x1126('0x1a')](_0x3f10e9)){return _0xca0355;}else{throw new db['Sequelize']['ValidationError'](_0x1126('0x1b'));}}else{return _0xca0355;}}function respondWithRpcPromise(_0x154e20,_0x279455,_0x4be0c6,_0x45149c){return new BPromise(function(_0x4794a7,_0x35fe9f){var _0x42f379=_0x45149c||client;return _0x42f379[_0x1126('0x1c')](_0x154e20,_0x4be0c6)['then'](function(_0x245cd7){logger[_0x1126('0x1d')]('ZendeskConfiguration,\x20%s,\x20%s',_0x279455,'request\x20sent');logger[_0x1126('0x1e')](_0x1126('0x1f'),_0x279455,'request\x20sent',JSON['stringify'](_0x245cd7));if(_0x245cd7[_0x1126('0x20')]){if(_0x245cd7['error'][_0x1126('0x21')]===0x1f4){logger[_0x1126('0x20')](_0x1126('0x22'),_0x279455,_0x245cd7['error'][_0x1126('0x23')]);return _0x35fe9f(_0x245cd7['error']['message']);}logger[_0x1126('0x20')](_0x1126('0x22'),_0x279455,_0x245cd7[_0x1126('0x20')][_0x1126('0x23')]);return _0x4794a7(_0x245cd7['error'][_0x1126('0x23')]);}else{logger[_0x1126('0x1d')]('ZendeskConfiguration,\x20%s,\x20%s',_0x279455,_0x1126('0x24'));_0x4794a7(_0x245cd7['result']['message']);}})['catch'](function(_0x2199d9){logger[_0x1126('0x20')](_0x1126('0x22'),_0x279455,_0x2199d9);_0x35fe9f(_0x2199d9);});});}function respondWithStatusCode(_0x34bcf1,_0x566c09){_0x566c09=_0x566c09||0xcc;return function(_0x1b07a7){if(_0x1b07a7){return _0x34bcf1[_0x1126('0x25')](_0x566c09);}return _0x34bcf1[_0x1126('0x26')](_0x566c09)['end']();};}function respondWithResult(_0x35eec3,_0x375e59){_0x375e59=_0x375e59||0xc8;return function(_0xa293f4){if(_0xa293f4){return _0x35eec3['status'](_0x375e59)['json'](_0xa293f4);}};}function respondWithFilteredResult(_0xeb7d89,_0x39bf0e){return function(_0x55e195){if(_0x55e195){var _0x2fb797=_0x55e195['count'],_0x23d2bc=_0x39bf0e[_0x1126('0x27')],_0x4a334a=_0x39bf0e['offset']+_0x39bf0e[_0x1126('0x28')],_0x3fa694;if(_0x4a334a>=_0x2fb797){_0x4a334a=_0x2fb797;_0x3fa694=0xc8;}else{_0x3fa694=0xce;}_0xeb7d89['status'](_0x3fa694);return _0xeb7d89[_0x1126('0x29')]('Content-Range',_0x23d2bc+'-'+_0x4a334a+'/'+_0x2fb797)['json'](_0x55e195);}return null;};}function patchUpdates(_0x4a53ab){return function(_0x17646e){try{jsonpatch[_0x1126('0x2a')](_0x17646e,_0x4a53ab,!![]);}catch(_0x1cef48){return BPromise['reject'](_0x1cef48);}return _0x17646e[_0x1126('0x2b')]();};}function saveUpdates(_0x226afb,_0x56f7f8){return function(_0x3dd50e){if(_0x3dd50e){return _0x3dd50e[_0x1126('0x2c')](_0x226afb)[_0x1126('0x2d')](function(_0x29fbfa){return _0x29fbfa;});}return null;};}function removeEntity(_0x5836a2,_0x5ecbc3){return function(_0x2a7edc){if(_0x2a7edc){return _0x2a7edc[_0x1126('0x2e')]()[_0x1126('0x2d')](function(){_0x5836a2[_0x1126('0x26')](0xcc)['end']();});}};}function handleEntityNotFound(_0x145314,_0x6f4312){return function(_0x313ebe){if(!_0x313ebe){_0x145314[_0x1126('0x25')](0x194);}return _0x313ebe;};}function handleError(_0x3b0f79,_0x5df232){_0x5df232=_0x5df232||0x1f4;return function(_0x2a0dfe){logger[_0x1126('0x20')](_0x2a0dfe[_0x1126('0x2f')]);if(_0x2a0dfe[_0x1126('0x30')]){delete _0x2a0dfe['name'];}_0x3b0f79['status'](_0x5df232)[_0x1126('0x31')](_0x2a0dfe);};}exports[_0x1126('0x32')]=function(_0x511e6b,_0xde37cf){var _0xf3c21b={},_0x11b0f6={},_0x5c08b9={'count':0x0,'rows':[]};var _0x4b3859=_[_0x1126('0x33')](db[_0x1126('0x34')][_0x1126('0x35')],function(_0x156554){return{'name':_0x156554['fieldName'],'type':_0x156554[_0x1126('0x36')]['key']};});_0x11b0f6[_0x1126('0x37')]=_[_0x1126('0x33')](_0x4b3859,_0x1126('0x30'));_0x11b0f6[_0x1126('0x38')]=_[_0x1126('0x39')](_0x511e6b['query']);_0x11b0f6[_0x1126('0x3a')]=_[_0x1126('0x3b')](_0x11b0f6[_0x1126('0x37')],_0x11b0f6[_0x1126('0x38')]);_0xf3c21b[_0x1126('0x3c')]=_[_0x1126('0x3b')](_0x11b0f6[_0x1126('0x37')],qs['fields'](_0x511e6b[_0x1126('0x38')][_0x1126('0x3d')]));_0xf3c21b[_0x1126('0x3c')]=_0xf3c21b[_0x1126('0x3c')][_0x1126('0x3e')]?_0xf3c21b['attributes']:_0x11b0f6['model'];if(!_0x511e6b[_0x1126('0x38')][_0x1126('0x3f')](_0x1126('0x40'))){_0xf3c21b[_0x1126('0x28')]=qs[_0x1126('0x28')](_0x511e6b[_0x1126('0x38')]['limit']);_0xf3c21b['offset']=qs['offset'](_0x511e6b[_0x1126('0x38')]['offset']);}_0xf3c21b[_0x1126('0x41')]=qs[_0x1126('0x42')](_0x511e6b[_0x1126('0x38')][_0x1126('0x42')]);_0xf3c21b['where']=qs['filters'](_[_0x1126('0x43')](_0x511e6b[_0x1126('0x38')],_0x11b0f6[_0x1126('0x3a')]));if(_0x511e6b['query'][_0x1126('0x44')]){_0xf3c21b['where']=_[_0x1126('0x45')](_0xf3c21b['where'],{'$or':_[_0x1126('0x33')](_0x4b3859,function(_0xe178b4){if(_0xe178b4[_0x1126('0x36')]!=='VIRTUAL'){var _0xfaa3d8={};_0xfaa3d8[_0xe178b4[_0x1126('0x30')]]={'$like':'%'+_0x511e6b[_0x1126('0x38')]['filter']+'%'};return _0xfaa3d8;}})});}_0xf3c21b=_['merge']({},_0xf3c21b,_0x511e6b['options']);var _0x6e78cf={'where':_0xf3c21b['where']};return db[_0x1126('0x34')]['count'](_0x6e78cf)[_0x1126('0x2d')](function(_0x323499){_0x5c08b9[_0x1126('0x46')]=_0x323499;if(_0x511e6b[_0x1126('0x38')][_0x1126('0x47')]){_0xf3c21b['include']=[{'all':!![]}];}return db[_0x1126('0x34')][_0x1126('0x48')](_0xf3c21b);})['then'](function(_0x1a15f8){_0x5c08b9[_0x1126('0x49')]=_0x1a15f8;return _0x5c08b9;})['then'](respondWithFilteredResult(_0xde37cf,_0xf3c21b))[_0x1126('0x4a')](handleError(_0xde37cf,null));};exports[_0x1126('0x4b')]=function(_0x518e0a,_0x3e4eeb){var _0xbdde58={'raw':![],'where':{'id':_0x518e0a['params']['id']}},_0x213a76={};_0x213a76[_0x1126('0x37')]=_[_0x1126('0x39')](db[_0x1126('0x34')][_0x1126('0x35')]);_0x213a76[_0x1126('0x38')]=_[_0x1126('0x39')](_0x518e0a[_0x1126('0x38')]);_0x213a76[_0x1126('0x3a')]=_['intersection'](_0x213a76[_0x1126('0x37')],_0x213a76['query']);_0xbdde58[_0x1126('0x3c')]=_[_0x1126('0x3b')](_0x213a76['model'],qs['fields'](_0x518e0a[_0x1126('0x38')][_0x1126('0x3d')]));_0xbdde58[_0x1126('0x3c')]=_0xbdde58['attributes'][_0x1126('0x3e')]?_0xbdde58[_0x1126('0x3c')]:_0x213a76[_0x1126('0x37')];if(_0x518e0a[_0x1126('0x38')]['includeAll']){_0xbdde58[_0x1126('0x4c')]=[{'all':!![]}];}_0xbdde58=_[_0x1126('0x45')]({},_0xbdde58,_0x518e0a['options']);return db['ZendeskConfiguration']['find'](_0xbdde58)['then'](handleEntityNotFound(_0x3e4eeb,null))[_0x1126('0x2d')](respondWithResult(_0x3e4eeb,null))[_0x1126('0x4a')](handleError(_0x3e4eeb,null));};exports['create']=function(_0x16552b,_0x1c7a2b){return db[_0x1126('0x34')][_0x1126('0x4d')](_0x16552b[_0x1126('0x4e')],{})['then'](respondWithResult(_0x1c7a2b,0xc9))[_0x1126('0x4a')](handleError(_0x1c7a2b,null));};exports[_0x1126('0x2c')]=function(_0x5d6414,_0x322016){if(_0x5d6414[_0x1126('0x4e')]['id']){delete _0x5d6414[_0x1126('0x4e')]['id'];}return db[_0x1126('0x34')][_0x1126('0x4f')]({'where':{'id':_0x5d6414['params']['id']}})[_0x1126('0x2d')](handleEntityNotFound(_0x322016,null))['then'](saveUpdates(_0x5d6414[_0x1126('0x4e')],null))[_0x1126('0x2d')](respondWithResult(_0x322016,null))[_0x1126('0x4a')](handleError(_0x322016,null));};exports['destroy']=function(_0x427add,_0x2340f8){return db['ZendeskConfiguration'][_0x1126('0x4f')]({'where':{'id':_0x427add[_0x1126('0x50')]['id']}})[_0x1126('0x2d')](handleEntityNotFound(_0x2340f8,null))['then'](removeEntity(_0x2340f8,null))[_0x1126('0x4a')](handleError(_0x2340f8,null));};exports[_0x1126('0x51')]=function(_0x22ab18,_0x308ee4,_0x128c94){var _0x26949c={};var _0x30c848={};var _0x114be2;var _0x47e53d;return db[_0x1126('0x34')][_0x1126('0x52')]({'where':{'id':_0x22ab18[_0x1126('0x50')]['id']}})[_0x1126('0x2d')](handleEntityNotFound(_0x308ee4,null))[_0x1126('0x2d')](function(_0x4f5772){if(_0x4f5772){_0x114be2=_0x4f5772;_0x30c848[_0x1126('0x37')]=_[_0x1126('0x39')](db['ZendeskField'][_0x1126('0x35')]);_0x30c848['query']=_[_0x1126('0x39')](_0x22ab18[_0x1126('0x38')]);_0x30c848['filters']=_[_0x1126('0x3b')](_0x30c848[_0x1126('0x37')],_0x30c848[_0x1126('0x38')]);_0x26949c['attributes']=_[_0x1126('0x3b')](_0x30c848['model'],qs['fields'](_0x22ab18[_0x1126('0x38')][_0x1126('0x3d')]));_0x26949c[_0x1126('0x3c')]=_0x26949c[_0x1126('0x3c')][_0x1126('0x3e')]?_0x26949c[_0x1126('0x3c')]:_0x30c848[_0x1126('0x37')];_0x26949c['order']=qs[_0x1126('0x42')](_0x22ab18[_0x1126('0x38')][_0x1126('0x42')]);_0x26949c[_0x1126('0x53')]=qs[_0x1126('0x3a')](_[_0x1126('0x43')](_0x22ab18['query'],_0x30c848['filters']));if(_0x22ab18[_0x1126('0x38')][_0x1126('0x44')]){_0x26949c['where']=_['merge'](_0x26949c['where'],{'$or':_['map'](_0x26949c[_0x1126('0x3c')],function(_0x37b1ab){var _0x3440c5={};_0x3440c5[_0x37b1ab]={'$like':'%'+_0x22ab18['query'][_0x1126('0x44')]+'%'};return _0x3440c5;})});}_0x26949c=_[_0x1126('0x45')]({},_0x26949c,_0x22ab18[_0x1126('0x54')]);return _0x114be2[_0x1126('0x51')](_0x26949c);}})[_0x1126('0x2d')](function(_0x3f007b){if(_0x3f007b){_0x47e53d=_0x3f007b[_0x1126('0x3e')];if(!_0x22ab18['query'][_0x1126('0x3f')](_0x1126('0x40'))){_0x26949c[_0x1126('0x28')]=qs[_0x1126('0x28')](_0x22ab18[_0x1126('0x38')]['limit']);_0x26949c['offset']=qs[_0x1126('0x27')](_0x22ab18[_0x1126('0x38')]['offset']);}return _0x114be2[_0x1126('0x51')](_0x26949c);}})[_0x1126('0x2d')](function(_0x366675){if(_0x366675){return _0x366675?{'count':_0x47e53d,'rows':_0x366675}:null;}})[_0x1126('0x2d')](respondWithResult(_0x308ee4,null))[_0x1126('0x4a')](handleError(_0x308ee4,null));};exports[_0x1126('0x55')]=function(_0x41ce78,_0x247f12,_0xd20fbe){var _0x3d5e15={};var _0x16e48a={};var _0x1228cf;var _0x3dad39;return db['ZendeskConfiguration'][_0x1126('0x52')]({'where':{'id':_0x41ce78[_0x1126('0x50')]['id']}})[_0x1126('0x2d')](handleEntityNotFound(_0x247f12,null))['then'](function(_0x484881){if(_0x484881){_0x1228cf=_0x484881;_0x16e48a[_0x1126('0x37')]=_[_0x1126('0x39')](db[_0x1126('0x56')][_0x1126('0x35')]);_0x16e48a['query']=_['keys'](_0x41ce78['query']);_0x16e48a[_0x1126('0x3a')]=_[_0x1126('0x3b')](_0x16e48a[_0x1126('0x37')],_0x16e48a[_0x1126('0x38')]);_0x3d5e15['attributes']=_[_0x1126('0x3b')](_0x16e48a['model'],qs[_0x1126('0x3d')](_0x41ce78[_0x1126('0x38')][_0x1126('0x3d')]));_0x3d5e15[_0x1126('0x3c')]=_0x3d5e15[_0x1126('0x3c')][_0x1126('0x3e')]?_0x3d5e15[_0x1126('0x3c')]:_0x16e48a['model'];_0x3d5e15[_0x1126('0x41')]=qs['sort'](_0x41ce78[_0x1126('0x38')][_0x1126('0x42')]);_0x3d5e15['where']=qs[_0x1126('0x3a')](_[_0x1126('0x43')](_0x41ce78['query'],_0x16e48a[_0x1126('0x3a')]));if(_0x41ce78[_0x1126('0x38')]['filter']){_0x3d5e15['where']=_[_0x1126('0x45')](_0x3d5e15[_0x1126('0x53')],{'$or':_[_0x1126('0x33')](_0x3d5e15['attributes'],function(_0x4d007b){var _0x4b0fab={};_0x4b0fab[_0x4d007b]={'$like':'%'+_0x41ce78[_0x1126('0x38')]['filter']+'%'};return _0x4b0fab;})});}_0x3d5e15=_['merge']({},_0x3d5e15,_0x41ce78[_0x1126('0x54')]);return _0x1228cf['getSubjects'](_0x3d5e15);}})[_0x1126('0x2d')](function(_0x288a0c){if(_0x288a0c){_0x3dad39=_0x288a0c['length'];if(!_0x41ce78[_0x1126('0x38')][_0x1126('0x3f')](_0x1126('0x40'))){_0x3d5e15[_0x1126('0x28')]=qs[_0x1126('0x28')](_0x41ce78['query'][_0x1126('0x28')]);_0x3d5e15[_0x1126('0x27')]=qs['offset'](_0x41ce78[_0x1126('0x38')][_0x1126('0x27')]);}return _0x1228cf[_0x1126('0x55')](_0x3d5e15);}})[_0x1126('0x2d')](function(_0x2598a7){if(_0x2598a7){return _0x2598a7?{'count':_0x3dad39,'rows':_0x2598a7}:null;}})[_0x1126('0x2d')](respondWithResult(_0x247f12,null))[_0x1126('0x4a')](handleError(_0x247f12,null));};exports[_0x1126('0x57')]=function(_0xeaf964,_0x9a2af0,_0xbe2a8f){var _0x3af321={};var _0x2010a9={};var _0x3b5384;var _0x8bfa0;return db[_0x1126('0x34')]['findOne']({'where':{'id':_0xeaf964[_0x1126('0x50')]['id']}})[_0x1126('0x2d')](handleEntityNotFound(_0x9a2af0,null))[_0x1126('0x2d')](function(_0x1483f4){if(_0x1483f4){_0x3b5384=_0x1483f4;_0x2010a9[_0x1126('0x37')]=_['keys'](db[_0x1126('0x56')]['rawAttributes']);_0x2010a9['query']=_[_0x1126('0x39')](_0xeaf964[_0x1126('0x38')]);_0x2010a9['filters']=_['intersection'](_0x2010a9[_0x1126('0x37')],_0x2010a9[_0x1126('0x38')]);_0x3af321[_0x1126('0x3c')]=_[_0x1126('0x3b')](_0x2010a9[_0x1126('0x37')],qs[_0x1126('0x3d')](_0xeaf964[_0x1126('0x38')][_0x1126('0x3d')]));_0x3af321[_0x1126('0x3c')]=_0x3af321['attributes'][_0x1126('0x3e')]?_0x3af321[_0x1126('0x3c')]:_0x2010a9[_0x1126('0x37')];_0x3af321[_0x1126('0x41')]=qs[_0x1126('0x42')](_0xeaf964[_0x1126('0x38')]['sort']);_0x3af321[_0x1126('0x53')]=qs[_0x1126('0x3a')](_[_0x1126('0x43')](_0xeaf964[_0x1126('0x38')],_0x2010a9[_0x1126('0x3a')]));if(_0xeaf964[_0x1126('0x38')][_0x1126('0x44')]){_0x3af321[_0x1126('0x53')]=_[_0x1126('0x45')](_0x3af321[_0x1126('0x53')],{'$or':_['map'](_0x3af321['attributes'],function(_0x271d7c){var _0x55496f={};_0x55496f[_0x271d7c]={'$like':'%'+_0xeaf964[_0x1126('0x38')]['filter']+'%'};return _0x55496f;})});}_0x3af321=_[_0x1126('0x45')]({},_0x3af321,_0xeaf964['options']);return _0x3b5384[_0x1126('0x57')](_0x3af321);}})['then'](function(_0x5c5044){if(_0x5c5044){_0x8bfa0=_0x5c5044['length'];if(!_0xeaf964[_0x1126('0x38')][_0x1126('0x3f')]('nolimit')){_0x3af321['limit']=qs[_0x1126('0x28')](_0xeaf964[_0x1126('0x38')][_0x1126('0x28')]);_0x3af321['offset']=qs['offset'](_0xeaf964[_0x1126('0x38')]['offset']);}return _0x3b5384[_0x1126('0x57')](_0x3af321);}})[_0x1126('0x2d')](function(_0x41c7f8){if(_0x41c7f8){return _0x41c7f8?{'count':_0x8bfa0,'rows':_0x41c7f8}:null;}})[_0x1126('0x2d')](respondWithResult(_0x9a2af0,null))[_0x1126('0x4a')](handleError(_0x9a2af0,null));};exports['getTags']=function(_0x591c75,_0x5ae7ac,_0xd808db){var _0xfc9fb4={};var _0x3758fa={};var _0x1b8218;var _0x23bd79;return db[_0x1126('0x34')][_0x1126('0x52')]({'where':{'id':_0x591c75[_0x1126('0x50')]['id']}})[_0x1126('0x2d')](handleEntityNotFound(_0x5ae7ac,null))[_0x1126('0x2d')](function(_0x5119a1){if(_0x5119a1){_0x1b8218=_0x5119a1;_0x3758fa[_0x1126('0x37')]=_['keys'](db[_0x1126('0x58')]['rawAttributes']);_0x3758fa[_0x1126('0x38')]=_[_0x1126('0x39')](_0x591c75[_0x1126('0x38')]);_0x3758fa[_0x1126('0x3a')]=_['intersection'](_0x3758fa[_0x1126('0x37')],_0x3758fa[_0x1126('0x38')]);_0xfc9fb4['attributes']=_['intersection'](_0x3758fa[_0x1126('0x37')],qs[_0x1126('0x3d')](_0x591c75[_0x1126('0x38')]['fields']));_0xfc9fb4[_0x1126('0x3c')]=_0xfc9fb4['attributes'][_0x1126('0x3e')]?_0xfc9fb4[_0x1126('0x3c')]:_0x3758fa['model'];_0xfc9fb4[_0x1126('0x41')]=qs[_0x1126('0x42')](_0x591c75[_0x1126('0x38')][_0x1126('0x42')]);_0xfc9fb4[_0x1126('0x53')]=qs['filters'](_[_0x1126('0x43')](_0x591c75[_0x1126('0x38')],_0x3758fa[_0x1126('0x3a')]));if(_0x591c75['query']['filter']){_0xfc9fb4['where']=_[_0x1126('0x45')](_0xfc9fb4[_0x1126('0x53')],{'$or':_[_0x1126('0x33')](_0xfc9fb4[_0x1126('0x3c')],function(_0x4fcca3){var _0x101553={};_0x101553[_0x4fcca3]={'$like':'%'+_0x591c75[_0x1126('0x38')][_0x1126('0x44')]+'%'};return _0x101553;})});}_0xfc9fb4=_[_0x1126('0x45')]({},_0xfc9fb4,_0x591c75[_0x1126('0x54')]);return _0x1b8218['getTags'](_0xfc9fb4);}})[_0x1126('0x2d')](function(_0x21c487){if(_0x21c487){_0x23bd79=_0x21c487['length'];if(!_0x591c75[_0x1126('0x38')]['hasOwnProperty']('nolimit')){_0xfc9fb4[_0x1126('0x28')]=qs['limit'](_0x591c75[_0x1126('0x38')][_0x1126('0x28')]);_0xfc9fb4[_0x1126('0x27')]=qs[_0x1126('0x27')](_0x591c75[_0x1126('0x38')][_0x1126('0x27')]);}return _0x1b8218[_0x1126('0x59')](_0xfc9fb4);}})[_0x1126('0x2d')](function(_0x3762e0){if(_0x3762e0){return _0x3762e0?{'count':_0x23bd79,'rows':_0x3762e0}:null;}})['then'](respondWithResult(_0x5ae7ac,null))[_0x1126('0x4a')](handleError(_0x5ae7ac,null));};exports[_0x1126('0x5a')]=function(_0x1cda9d,_0x369447,_0x5a96ee){if(_0x1cda9d[_0x1126('0x4e')]['id']){delete _0x1cda9d[_0x1126('0x4e')]['id'];}return db[_0x1126('0x34')][_0x1126('0x52')]({'where':{'id':_0x1cda9d['params']['id']}})['then'](handleEntityNotFound(_0x369447,null))['then'](function(_0x3229ee){if(_0x3229ee){return _0x3229ee['setTags'](_0x1cda9d[_0x1126('0x4e')][_0x1126('0x5b')]||[]);}return null;})['then'](respondWithResult(_0x369447,null))['catch'](handleError(_0x369447,null));};
\ No newline at end of file
diff --git a/server/api/intZendeskConfiguration/intZendeskConfiguration.model.js b/server/api/intZendeskConfiguration/intZendeskConfiguration.model.js
index 9d7e608..58d6f42 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 _0xfba6=['rimraf','ZendeskConfiguration','int_zendesk_configurations','util','api','moment','request-promise','path'];(function(_0x18ab2a,_0x4debcd){var _0x16dcee=function(_0x10107a){while(--_0x10107a){_0x18ab2a['push'](_0x18ab2a['shift']());}};_0x16dcee(++_0x4debcd);}(_0xfba6,0x193));var _0x6fba=function(_0x28b0a4,_0x2ea758){_0x28b0a4=_0x28b0a4-0x0;var _0x105ce6=_0xfba6[_0x28b0a4];return _0x105ce6;};'use strict';var _=require('lodash');var util=require(_0x6fba('0x0'));var logger=require('../../config/logger')(_0x6fba('0x1'));var moment=require(_0x6fba('0x2'));var BPromise=require('bluebird');var rp=require(_0x6fba('0x3'));var fs=require('fs');var path=require(_0x6fba('0x4'));var rimraf=require(_0x6fba('0x5'));var config=require('../../config/environment');var attributes=require('./intZendeskConfiguration.attributes');module['exports']=function(_0x503fad,_0x29c2a5){return _0x503fad['define'](_0x6fba('0x6'),attributes,{'tableName':_0x6fba('0x7'),'paranoid':![],'indexes':[],'timestamps':!![]});};
\ No newline at end of file
+var _0x3fb0=['rimraf','../../config/environment','./intZendeskConfiguration.attributes','exports','define','ZendeskConfiguration','lodash','util','../../config/logger','api','moment','bluebird','request-promise','path'];(function(_0xd73884,_0x2ca96d){var _0x16b79c=function(_0x1521bc){while(--_0x1521bc){_0xd73884['push'](_0xd73884['shift']());}};_0x16b79c(++_0x2ca96d);}(_0x3fb0,0x1d4));var _0x03fb=function(_0x483d45,_0x4be74b){_0x483d45=_0x483d45-0x0;var _0x1d59e2=_0x3fb0[_0x483d45];return _0x1d59e2;};'use strict';var _=require(_0x03fb('0x0'));var util=require(_0x03fb('0x1'));var logger=require(_0x03fb('0x2'))(_0x03fb('0x3'));var moment=require(_0x03fb('0x4'));var BPromise=require(_0x03fb('0x5'));var rp=require(_0x03fb('0x6'));var fs=require('fs');var path=require(_0x03fb('0x7'));var rimraf=require(_0x03fb('0x8'));var config=require(_0x03fb('0x9'));var attributes=require(_0x03fb('0xa'));module[_0x03fb('0xb')]=function(_0x3a36da,_0x23533a){return _0x3a36da[_0x03fb('0xc')](_0x03fb('0xd'),attributes,{'tableName':'int_zendesk_configurations','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 1399390..cbd65fe 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 _0xb202=['randomstring','ioredis','../../config/utils','../../config/logger','../../config/environment','jayson/promise','client','http','request','info','ZendeskConfiguration,\x20%s,\x20%s','request\x20sent','debug','ZendeskConfiguration,\x20%s,\x20%s,\x20%s','stringify','error','code','message','result','catch','lodash','util','moment','bluebird'];(function(_0x3947c9,_0x4d6c97){var _0x2e7871=function(_0x1236cc){while(--_0x1236cc){_0x3947c9['push'](_0x3947c9['shift']());}};_0x2e7871(++_0x4d6c97);}(_0xb202,0x134));var _0x2b20=function(_0x2763f2,_0x416af8){_0x2763f2=_0x2763f2-0x0;var _0x3ef471=_0xb202[_0x2763f2];return _0x3ef471;};'use strict';var _=require(_0x2b20('0x0'));var util=require(_0x2b20('0x1'));var moment=require(_0x2b20('0x2'));var BPromise=require(_0x2b20('0x3'));var rs=require(_0x2b20('0x4'));var fs=require('fs');var Redis=require(_0x2b20('0x5'));var db=require('../../mysqldb')['db'];var utils=require(_0x2b20('0x6'));var logger=require(_0x2b20('0x7'))('rpc');var config=require(_0x2b20('0x8'));var jayson=require(_0x2b20('0x9'));var client=jayson[_0x2b20('0xa')][_0x2b20('0xb')]({'port':0x232a});function respondWithRpcPromise(_0x47bc29,_0x29c959,_0x47299e){return new BPromise(function(_0x2081e6,_0x9039de){return client[_0x2b20('0xc')](_0x47bc29,_0x47299e)['then'](function(_0x4d6f1b){logger[_0x2b20('0xd')](_0x2b20('0xe'),_0x29c959,_0x2b20('0xf'));logger[_0x2b20('0x10')](_0x2b20('0x11'),_0x29c959,_0x2b20('0xf'),JSON[_0x2b20('0x12')](_0x4d6f1b));if(_0x4d6f1b['error']){if(_0x4d6f1b[_0x2b20('0x13')][_0x2b20('0x14')]===0x1f4){logger['error']('ZendeskConfiguration,\x20%s,\x20%s',_0x29c959,_0x4d6f1b[_0x2b20('0x13')][_0x2b20('0x15')]);return _0x9039de(_0x4d6f1b['error']['message']);}logger['error'](_0x2b20('0xe'),_0x29c959,_0x4d6f1b[_0x2b20('0x13')]['message']);return _0x2081e6(_0x4d6f1b[_0x2b20('0x13')]['message']);}else{logger[_0x2b20('0xd')](_0x2b20('0xe'),_0x29c959,_0x2b20('0xf'));_0x2081e6(_0x4d6f1b[_0x2b20('0x16')][_0x2b20('0x15')]);}})[_0x2b20('0x17')](function(_0x354885){logger[_0x2b20('0x13')](_0x2b20('0xe'),_0x29c959,_0x354885);_0x9039de(_0x354885);});});}
\ No newline at end of file
+var _0x2b7b=['then','info','ZendeskConfiguration,\x20%s,\x20%s','request\x20sent','ZendeskConfiguration,\x20%s,\x20%s,\x20%s','error','message','result','catch','lodash','util','moment','randomstring','ioredis','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','request'];(function(_0x111c6a,_0x394b70){var _0xe21fc9=function(_0x539d3f){while(--_0x539d3f){_0x111c6a['push'](_0x111c6a['shift']());}};_0xe21fc9(++_0x394b70);}(_0x2b7b,0x135));var _0xb2b7=function(_0x160c73,_0x2ee678){_0x160c73=_0x160c73-0x0;var _0xd9302=_0x2b7b[_0x160c73];return _0xd9302;};'use strict';var _=require(_0xb2b7('0x0'));var util=require(_0xb2b7('0x1'));var moment=require(_0xb2b7('0x2'));var BPromise=require('bluebird');var rs=require(_0xb2b7('0x3'));var fs=require('fs');var Redis=require(_0xb2b7('0x4'));var db=require('../../mysqldb')['db'];var utils=require(_0xb2b7('0x5'));var logger=require(_0xb2b7('0x6'))(_0xb2b7('0x7'));var config=require(_0xb2b7('0x8'));var jayson=require(_0xb2b7('0x9'));var client=jayson['client']['http']({'port':0x232a});function respondWithRpcPromise(_0x4739cb,_0x3a09cf,_0x5b873d){return new BPromise(function(_0x31bc99,_0x440016){return client[_0xb2b7('0xa')](_0x4739cb,_0x5b873d)[_0xb2b7('0xb')](function(_0x2d1264){logger[_0xb2b7('0xc')](_0xb2b7('0xd'),_0x3a09cf,_0xb2b7('0xe'));logger['debug'](_0xb2b7('0xf'),_0x3a09cf,'request\x20sent',JSON['stringify'](_0x2d1264));if(_0x2d1264['error']){if(_0x2d1264[_0xb2b7('0x10')]['code']===0x1f4){logger[_0xb2b7('0x10')](_0xb2b7('0xd'),_0x3a09cf,_0x2d1264['error'][_0xb2b7('0x11')]);return _0x440016(_0x2d1264[_0xb2b7('0x10')][_0xb2b7('0x11')]);}logger['error'](_0xb2b7('0xd'),_0x3a09cf,_0x2d1264['error'][_0xb2b7('0x11')]);return _0x31bc99(_0x2d1264[_0xb2b7('0x10')][_0xb2b7('0x11')]);}else{logger[_0xb2b7('0xc')](_0xb2b7('0xd'),_0x3a09cf,_0xb2b7('0xe'));_0x31bc99(_0x2d1264[_0xb2b7('0x12')][_0xb2b7('0x11')]);}})[_0xb2b7('0x13')](function(_0x420023){logger['error'](_0xb2b7('0xd'),_0x3a09cf,_0x420023);_0x440016(_0x420023);});});}
\ No newline at end of file
diff --git a/server/api/intZendeskField/index.js b/server/api/intZendeskField/index.js
index 84c7aac..d4c13b1 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 _0xb764=['express','Router','../../components/interaction/service','../../config/environment','./intZendeskField.controller','isAuthenticated','index','get','/:id','show','post','create','update','multer','path','connect-timeout'];(function(_0x12ca5f,_0x223d98){var _0xfc3ae9=function(_0x1928fb){while(--_0x1928fb){_0x12ca5f['push'](_0x12ca5f['shift']());}};_0xfc3ae9(++_0x223d98);}(_0xb764,0x11d));var _0x4b76=function(_0x614b0e,_0x5b8c02){_0x614b0e=_0x614b0e-0x0;var _0x32b96=_0xb764[_0x614b0e];return _0x32b96;};'use strict';var multer=require(_0x4b76('0x0'));var util=require('util');var path=require(_0x4b76('0x1'));var timeout=require(_0x4b76('0x2'));var express=require(_0x4b76('0x3'));var router=express[_0x4b76('0x4')]();var auth=require('../../components/auth/service');var interaction=require(_0x4b76('0x5'));var config=require(_0x4b76('0x6'));var controller=require(_0x4b76('0x7'));router['get']('/',auth[_0x4b76('0x8')](),controller[_0x4b76('0x9')]);router[_0x4b76('0xa')](_0x4b76('0xb'),auth[_0x4b76('0x8')](),controller[_0x4b76('0xc')]);router[_0x4b76('0xd')]('/',auth['isAuthenticated'](),controller[_0x4b76('0xe')]);router['put']('/:id',auth[_0x4b76('0x8')](),controller[_0x4b76('0xf')]);router['delete'](_0x4b76('0xb'),auth[_0x4b76('0x8')](),controller['destroy']);module['exports']=router;
\ No newline at end of file
+var _0x3442=['multer','util','connect-timeout','express','Router','../../components/auth/service','../../components/interaction/service','../../config/environment','./intZendeskField.controller','get','isAuthenticated','post','create','exports'];(function(_0x13f25a,_0x429fad){var _0xd22b3e=function(_0x4ab61c){while(--_0x4ab61c){_0x13f25a['push'](_0x13f25a['shift']());}};_0xd22b3e(++_0x429fad);}(_0x3442,0x118));var _0x2344=function(_0x6ff171,_0x9aa2){_0x6ff171=_0x6ff171-0x0;var _0x396ea1=_0x3442[_0x6ff171];return _0x396ea1;};'use strict';var multer=require(_0x2344('0x0'));var util=require(_0x2344('0x1'));var path=require('path');var timeout=require(_0x2344('0x2'));var express=require(_0x2344('0x3'));var router=express[_0x2344('0x4')]();var auth=require(_0x2344('0x5'));var interaction=require(_0x2344('0x6'));var config=require(_0x2344('0x7'));var controller=require(_0x2344('0x8'));router[_0x2344('0x9')]('/',auth[_0x2344('0xa')](),controller['index']);router[_0x2344('0x9')]('/:id',auth[_0x2344('0xa')](),controller['show']);router[_0x2344('0xb')]('/',auth[_0x2344('0xa')](),controller[_0x2344('0xc')]);router['put']('/:id',auth[_0x2344('0xa')](),controller['update']);router['delete']('/:id',auth[_0x2344('0xa')](),controller['destroy']);module[_0x2344('0xd')]=router;
\ No newline at end of file
diff --git a/server/api/intZendeskField/intZendeskField.attributes.js b/server/api/intZendeskField/intZendeskField.attributes.js
index 285c843..b6ba21e 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 _0x61df=['STRING','ENUM','customVariable','string','variable','keyValue'];(function(_0x366d8c,_0x327b9c){var _0x102e72=function(_0x39e9c5){while(--_0x39e9c5){_0x366d8c['push'](_0x366d8c['shift']());}};_0x102e72(++_0x327b9c);}(_0x61df,0xbd));var _0xf61d=function(_0x12a267,_0x3ca18c){_0x12a267=_0x12a267-0x0;var _0x42ac67=_0x61df[_0x12a267];return _0x42ac67;};'use strict';var Sequelize=require('sequelize');module['exports']={'type':{'type':Sequelize['ENUM'](_0xf61d('0x0'),_0xf61d('0x1'),'customVariable',_0xf61d('0x2')),'defaultValue':_0xf61d('0x0')},'content':{'type':Sequelize['STRING']},'key':{'type':Sequelize[_0xf61d('0x3')]},'keyType':{'type':Sequelize[_0xf61d('0x4')](_0xf61d('0x0'),_0xf61d('0x1'),_0xf61d('0x5'))},'keyContent':{'type':Sequelize[_0xf61d('0x3')]},'idField':{'type':Sequelize['STRING']},'nameField':{'type':Sequelize[_0xf61d('0x3')]},'customField':{'type':Sequelize['BOOLEAN'],'defaultValue':!![]},'variableName':{'type':Sequelize[_0xf61d('0x3')]}};
\ No newline at end of file
+var _0x6bac=['variable','customVariable','STRING','BOOLEAN','sequelize','ENUM','string'];(function(_0x3f9ad6,_0x1b6aef){var _0x58cdb1=function(_0x40d58c){while(--_0x40d58c){_0x3f9ad6['push'](_0x3f9ad6['shift']());}};_0x58cdb1(++_0x1b6aef);}(_0x6bac,0xa5));var _0xc6ba=function(_0x3b244f,_0x24e1d3){_0x3b244f=_0x3b244f-0x0;var _0x537610=_0x6bac[_0x3b244f];return _0x537610;};'use strict';var Sequelize=require(_0xc6ba('0x0'));module['exports']={'type':{'type':Sequelize[_0xc6ba('0x1')](_0xc6ba('0x2'),_0xc6ba('0x3'),_0xc6ba('0x4'),'keyValue'),'defaultValue':'string'},'content':{'type':Sequelize['STRING']},'key':{'type':Sequelize[_0xc6ba('0x5')]},'keyType':{'type':Sequelize[_0xc6ba('0x1')]('string',_0xc6ba('0x3'),_0xc6ba('0x4'))},'keyContent':{'type':Sequelize[_0xc6ba('0x5')]},'idField':{'type':Sequelize[_0xc6ba('0x5')]},'nameField':{'type':Sequelize[_0xc6ba('0x5')]},'customField':{'type':Sequelize[_0xc6ba('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 86bada4..ed86ae1 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 _0x2559=['intersection','attributes','fields','nolimit','limit','sort','where','pick','filter','merge','VIRTUAL','includeAll','include','findAll','rows','show','params','length','options','find','create','body','catch','html-pdf','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','moment','bluebird','mustache','util','sox','to-csv','squel','crypto','jsforce','desk.js','papaparse','ioredis','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','api','../../config/utils','../../mysqldb','sendStatus','status','end','json','count','offset','set','apply','update','destroy','then','error','stack','name','send','index','ZendeskField','rawAttributes','fieldName','model','map','query','keys','filters'];(function(_0xdbce8,_0x550d11){var _0x4e8866=function(_0x570546){while(--_0x570546){_0xdbce8['push'](_0xdbce8['shift']());}};_0x4e8866(++_0x550d11);}(_0x2559,0x17a));var _0x9255=function(_0x311b7a,_0x2300fc){_0x311b7a=_0x311b7a-0x0;var _0x4e3aa1=_0x2559[_0x311b7a];return _0x4e3aa1;};'use strict';var pdf=require(_0x9255('0x0'));var emlformat=require(_0x9255('0x1'));var rimraf=require(_0x9255('0x2'));var zipdir=require(_0x9255('0x3'));var jsonpatch=require(_0x9255('0x4'));var rp=require(_0x9255('0x5'));var moment=require(_0x9255('0x6'));var BPromise=require(_0x9255('0x7'));var Mustache=require(_0x9255('0x8'));var util=require(_0x9255('0x9'));var path=require('path');var sox=require(_0x9255('0xa'));var csv=require(_0x9255('0xb'));var ejs=require('ejs');var fs=require('fs');var _=require('lodash');var squel=require(_0x9255('0xc'));var crypto=require(_0x9255('0xd'));var jsforce=require(_0x9255('0xe'));var deskjs=require(_0x9255('0xf'));var toCsv=require(_0x9255('0xb'));var querystring=require('querystring');var Papa=require(_0x9255('0x10'));var Redis=require(_0x9255('0x11'));var authService=require('../../components/auth/service');var qs=require(_0x9255('0x12'));var as=require(_0x9255('0x13'));var hardwareService=require(_0x9255('0x14'));var logger=require('../../config/logger')(_0x9255('0x15'));var utils=require(_0x9255('0x16'));var config=require('../../config/environment');var db=require(_0x9255('0x17'))['db'];function respondWithStatusCode(_0x4b5de4,_0x5a67dd){_0x5a67dd=_0x5a67dd||0xcc;return function(_0x42030a){if(_0x42030a){return _0x4b5de4[_0x9255('0x18')](_0x5a67dd);}return _0x4b5de4[_0x9255('0x19')](_0x5a67dd)[_0x9255('0x1a')]();};}function respondWithResult(_0x8f9875,_0x475a8f){_0x475a8f=_0x475a8f||0xc8;return function(_0x5cbed4){if(_0x5cbed4){return _0x8f9875[_0x9255('0x19')](_0x475a8f)[_0x9255('0x1b')](_0x5cbed4);}};}function respondWithFilteredResult(_0x40310b,_0x229765){return function(_0x19ff45){if(_0x19ff45){var _0xc5e020=_0x19ff45[_0x9255('0x1c')],_0x32c5bf=_0x229765[_0x9255('0x1d')],_0x5fa084=_0x229765[_0x9255('0x1d')]+_0x229765['limit'],_0x27bd17;if(_0x5fa084>=_0xc5e020){_0x5fa084=_0xc5e020;_0x27bd17=0xc8;}else{_0x27bd17=0xce;}_0x40310b['status'](_0x27bd17);return _0x40310b[_0x9255('0x1e')]('Content-Range',_0x32c5bf+'-'+_0x5fa084+'/'+_0xc5e020)['json'](_0x19ff45);}return null;};}function patchUpdates(_0xbd2293){return function(_0x575381){try{jsonpatch[_0x9255('0x1f')](_0x575381,_0xbd2293,!![]);}catch(_0x5a7cde){return BPromise['reject'](_0x5a7cde);}return _0x575381['save']();};}function saveUpdates(_0xd758e6,_0x599816){return function(_0x7e9d8){if(_0x7e9d8){return _0x7e9d8[_0x9255('0x20')](_0xd758e6)['then'](function(_0x5233b3){return _0x5233b3;});}return null;};}function removeEntity(_0x425339,_0x72eed4){return function(_0x42fbe8){if(_0x42fbe8){return _0x42fbe8[_0x9255('0x21')]()[_0x9255('0x22')](function(){_0x425339[_0x9255('0x19')](0xcc)['end']();});}};}function handleEntityNotFound(_0x25ebdb,_0x4b18e0){return function(_0xaff4df){if(!_0xaff4df){_0x25ebdb[_0x9255('0x18')](0x194);}return _0xaff4df;};}function handleError(_0x11bea3,_0x593c68){_0x593c68=_0x593c68||0x1f4;return function(_0x5684de){logger[_0x9255('0x23')](_0x5684de[_0x9255('0x24')]);if(_0x5684de['name']){delete _0x5684de[_0x9255('0x25')];}_0x11bea3['status'](_0x593c68)[_0x9255('0x26')](_0x5684de);};}exports[_0x9255('0x27')]=function(_0x1820c1,_0x11af03){var _0x57b6da={},_0x52c236={},_0x240048={'count':0x0,'rows':[]};var _0x1dd709=_['map'](db[_0x9255('0x28')][_0x9255('0x29')],function(_0xb36012){return{'name':_0xb36012[_0x9255('0x2a')],'type':_0xb36012['type']['key']};});_0x52c236[_0x9255('0x2b')]=_[_0x9255('0x2c')](_0x1dd709,'name');_0x52c236[_0x9255('0x2d')]=_[_0x9255('0x2e')](_0x1820c1['query']);_0x52c236[_0x9255('0x2f')]=_[_0x9255('0x30')](_0x52c236[_0x9255('0x2b')],_0x52c236[_0x9255('0x2d')]);_0x57b6da[_0x9255('0x31')]=_['intersection'](_0x52c236[_0x9255('0x2b')],qs[_0x9255('0x32')](_0x1820c1[_0x9255('0x2d')][_0x9255('0x32')]));_0x57b6da[_0x9255('0x31')]=_0x57b6da['attributes']['length']?_0x57b6da[_0x9255('0x31')]:_0x52c236[_0x9255('0x2b')];if(!_0x1820c1[_0x9255('0x2d')]['hasOwnProperty'](_0x9255('0x33'))){_0x57b6da['limit']=qs[_0x9255('0x34')](_0x1820c1[_0x9255('0x2d')][_0x9255('0x34')]);_0x57b6da[_0x9255('0x1d')]=qs[_0x9255('0x1d')](_0x1820c1[_0x9255('0x2d')][_0x9255('0x1d')]);}_0x57b6da['order']=qs[_0x9255('0x35')](_0x1820c1[_0x9255('0x2d')][_0x9255('0x35')]);_0x57b6da[_0x9255('0x36')]=qs['filters'](_[_0x9255('0x37')](_0x1820c1[_0x9255('0x2d')],_0x52c236[_0x9255('0x2f')]));if(_0x1820c1['query'][_0x9255('0x38')]){_0x57b6da[_0x9255('0x36')]=_[_0x9255('0x39')](_0x57b6da[_0x9255('0x36')],{'$or':_['map'](_0x1dd709,function(_0x4c4d06){if(_0x4c4d06['type']!==_0x9255('0x3a')){var _0x2800f4={};_0x2800f4[_0x4c4d06['name']]={'$like':'%'+_0x1820c1[_0x9255('0x2d')][_0x9255('0x38')]+'%'};return _0x2800f4;}})});}_0x57b6da=_['merge']({},_0x57b6da,_0x1820c1['options']);var _0x4d6257={'where':_0x57b6da['where']};return db[_0x9255('0x28')][_0x9255('0x1c')](_0x4d6257)[_0x9255('0x22')](function(_0x5a16ae){_0x240048[_0x9255('0x1c')]=_0x5a16ae;if(_0x1820c1['query'][_0x9255('0x3b')]){_0x57b6da[_0x9255('0x3c')]=[{'all':!![]}];}return db[_0x9255('0x28')][_0x9255('0x3d')](_0x57b6da);})[_0x9255('0x22')](function(_0x5c01f8){_0x240048[_0x9255('0x3e')]=_0x5c01f8;return _0x240048;})[_0x9255('0x22')](respondWithFilteredResult(_0x11af03,_0x57b6da))['catch'](handleError(_0x11af03,null));};exports[_0x9255('0x3f')]=function(_0x4d0c48,_0x1d47f6){var _0x442a6d={'raw':!![],'where':{'id':_0x4d0c48[_0x9255('0x40')]['id']}},_0xba1e93={};_0xba1e93['model']=_[_0x9255('0x2e')](db[_0x9255('0x28')][_0x9255('0x29')]);_0xba1e93[_0x9255('0x2d')]=_[_0x9255('0x2e')](_0x4d0c48[_0x9255('0x2d')]);_0xba1e93[_0x9255('0x2f')]=_[_0x9255('0x30')](_0xba1e93[_0x9255('0x2b')],_0xba1e93[_0x9255('0x2d')]);_0x442a6d[_0x9255('0x31')]=_[_0x9255('0x30')](_0xba1e93[_0x9255('0x2b')],qs[_0x9255('0x32')](_0x4d0c48['query'][_0x9255('0x32')]));_0x442a6d[_0x9255('0x31')]=_0x442a6d[_0x9255('0x31')][_0x9255('0x41')]?_0x442a6d[_0x9255('0x31')]:_0xba1e93[_0x9255('0x2b')];if(_0x4d0c48[_0x9255('0x2d')][_0x9255('0x3b')]){_0x442a6d[_0x9255('0x3c')]=[{'all':!![]}];}_0x442a6d=_['merge']({},_0x442a6d,_0x4d0c48[_0x9255('0x42')]);return db[_0x9255('0x28')][_0x9255('0x43')](_0x442a6d)[_0x9255('0x22')](handleEntityNotFound(_0x1d47f6,null))[_0x9255('0x22')](respondWithResult(_0x1d47f6,null))['catch'](handleError(_0x1d47f6,null));};exports[_0x9255('0x44')]=function(_0x177f38,_0x54e24f){return db['ZendeskField']['create'](_0x177f38[_0x9255('0x45')],{})[_0x9255('0x22')](respondWithResult(_0x54e24f,0xc9))[_0x9255('0x46')](handleError(_0x54e24f,null));};exports[_0x9255('0x20')]=function(_0x5d6917,_0x2f141b){if(_0x5d6917[_0x9255('0x45')]['id']){delete _0x5d6917[_0x9255('0x45')]['id'];}return db['ZendeskField'][_0x9255('0x43')]({'where':{'id':_0x5d6917['params']['id']}})['then'](handleEntityNotFound(_0x2f141b,null))[_0x9255('0x22')](saveUpdates(_0x5d6917[_0x9255('0x45')],null))[_0x9255('0x22')](respondWithResult(_0x2f141b,null))['catch'](handleError(_0x2f141b,null));};exports[_0x9255('0x21')]=function(_0x3115ec,_0x335897){return db[_0x9255('0x28')][_0x9255('0x43')]({'where':{'id':_0x3115ec[_0x9255('0x40')]['id']}})['then'](handleEntityNotFound(_0x335897,null))[_0x9255('0x22')](removeEntity(_0x335897,null))[_0x9255('0x46')](handleError(_0x335897,null));};
\ No newline at end of file
+var _0xd746=['params','include','create','body','find','html-pdf','zip-dir','moment','bluebird','mustache','util','path','to-csv','ejs','lodash','squel','crypto','jsforce','papaparse','ioredis','../../components/parsers/advancedSearch','../../config/logger','../../config/utils','../../config/environment','../../mysqldb','status','json','count','offset','set','Content-Range','apply','reject','save','update','destroy','then','end','error','name','send','index','map','rawAttributes','type','key','keys','query','filters','intersection','model','attributes','fields','hasOwnProperty','nolimit','limit','order','sort','where','pick','filter','merge','VIRTUAL','ZendeskField','includeAll','findAll','catch','show'];(function(_0x16a06b,_0x515f0c){var _0x3b9ca4=function(_0x402aa1){while(--_0x402aa1){_0x16a06b['push'](_0x16a06b['shift']());}};_0x3b9ca4(++_0x515f0c);}(_0xd746,0x159));var _0x6d74=function(_0x25e7cb,_0x3579b7){_0x25e7cb=_0x25e7cb-0x0;var _0x375d92=_0xd746[_0x25e7cb];return _0x375d92;};'use strict';var pdf=require(_0x6d74('0x0'));var emlformat=require('eml-format');var rimraf=require('rimraf');var zipdir=require(_0x6d74('0x1'));var jsonpatch=require('fast-json-patch');var rp=require('request-promise');var moment=require(_0x6d74('0x2'));var BPromise=require(_0x6d74('0x3'));var Mustache=require(_0x6d74('0x4'));var util=require(_0x6d74('0x5'));var path=require(_0x6d74('0x6'));var sox=require('sox');var csv=require(_0x6d74('0x7'));var ejs=require(_0x6d74('0x8'));var fs=require('fs');var _=require(_0x6d74('0x9'));var squel=require(_0x6d74('0xa'));var crypto=require(_0x6d74('0xb'));var jsforce=require(_0x6d74('0xc'));var deskjs=require('desk.js');var toCsv=require(_0x6d74('0x7'));var querystring=require('querystring');var Papa=require(_0x6d74('0xd'));var Redis=require(_0x6d74('0xe'));var authService=require('../../components/auth/service');var qs=require('../../components/parsers/qs');var as=require(_0x6d74('0xf'));var hardwareService=require('../../config/license/hardware');var logger=require(_0x6d74('0x10'))('api');var utils=require(_0x6d74('0x11'));var config=require(_0x6d74('0x12'));var db=require(_0x6d74('0x13'))['db'];function respondWithStatusCode(_0x481f88,_0x147dd2){_0x147dd2=_0x147dd2||0xcc;return function(_0x39bc6d){if(_0x39bc6d){return _0x481f88['sendStatus'](_0x147dd2);}return _0x481f88[_0x6d74('0x14')](_0x147dd2)['end']();};}function respondWithResult(_0x3431e7,_0xab041c){_0xab041c=_0xab041c||0xc8;return function(_0x3dd9d8){if(_0x3dd9d8){return _0x3431e7[_0x6d74('0x14')](_0xab041c)[_0x6d74('0x15')](_0x3dd9d8);}};}function respondWithFilteredResult(_0x19f0d3,_0x385ef5){return function(_0x4261de){if(_0x4261de){var _0x43639e=_0x4261de[_0x6d74('0x16')],_0x1bef6a=_0x385ef5[_0x6d74('0x17')],_0x25c453=_0x385ef5[_0x6d74('0x17')]+_0x385ef5['limit'],_0x161944;if(_0x25c453>=_0x43639e){_0x25c453=_0x43639e;_0x161944=0xc8;}else{_0x161944=0xce;}_0x19f0d3[_0x6d74('0x14')](_0x161944);return _0x19f0d3[_0x6d74('0x18')](_0x6d74('0x19'),_0x1bef6a+'-'+_0x25c453+'/'+_0x43639e)[_0x6d74('0x15')](_0x4261de);}return null;};}function patchUpdates(_0x9e574b){return function(_0x5ad130){try{jsonpatch[_0x6d74('0x1a')](_0x5ad130,_0x9e574b,!![]);}catch(_0x276fce){return BPromise[_0x6d74('0x1b')](_0x276fce);}return _0x5ad130[_0x6d74('0x1c')]();};}function saveUpdates(_0x530222,_0x41113d){return function(_0x2b4d67){if(_0x2b4d67){return _0x2b4d67[_0x6d74('0x1d')](_0x530222)['then'](function(_0x6b7249){return _0x6b7249;});}return null;};}function removeEntity(_0x4450ae,_0x33568d){return function(_0x2a2198){if(_0x2a2198){return _0x2a2198[_0x6d74('0x1e')]()[_0x6d74('0x1f')](function(){_0x4450ae['status'](0xcc)[_0x6d74('0x20')]();});}};}function handleEntityNotFound(_0x55898a,_0x1b4f22){return function(_0x33f49c){if(!_0x33f49c){_0x55898a['sendStatus'](0x194);}return _0x33f49c;};}function handleError(_0x15cbf7,_0x7407db){_0x7407db=_0x7407db||0x1f4;return function(_0x47f2de){logger[_0x6d74('0x21')](_0x47f2de['stack']);if(_0x47f2de[_0x6d74('0x22')]){delete _0x47f2de[_0x6d74('0x22')];}_0x15cbf7[_0x6d74('0x14')](_0x7407db)[_0x6d74('0x23')](_0x47f2de);};}exports[_0x6d74('0x24')]=function(_0x559df1,_0xe92d0c){var _0x512df1={},_0x528acc={},_0x1806bc={'count':0x0,'rows':[]};var _0xd2bd21=_[_0x6d74('0x25')](db['ZendeskField'][_0x6d74('0x26')],function(_0xe3e5f7){return{'name':_0xe3e5f7['fieldName'],'type':_0xe3e5f7[_0x6d74('0x27')][_0x6d74('0x28')]};});_0x528acc['model']=_[_0x6d74('0x25')](_0xd2bd21,_0x6d74('0x22'));_0x528acc['query']=_[_0x6d74('0x29')](_0x559df1[_0x6d74('0x2a')]);_0x528acc[_0x6d74('0x2b')]=_[_0x6d74('0x2c')](_0x528acc[_0x6d74('0x2d')],_0x528acc[_0x6d74('0x2a')]);_0x512df1[_0x6d74('0x2e')]=_[_0x6d74('0x2c')](_0x528acc[_0x6d74('0x2d')],qs[_0x6d74('0x2f')](_0x559df1[_0x6d74('0x2a')][_0x6d74('0x2f')]));_0x512df1['attributes']=_0x512df1[_0x6d74('0x2e')]['length']?_0x512df1[_0x6d74('0x2e')]:_0x528acc[_0x6d74('0x2d')];if(!_0x559df1[_0x6d74('0x2a')][_0x6d74('0x30')](_0x6d74('0x31'))){_0x512df1[_0x6d74('0x32')]=qs['limit'](_0x559df1[_0x6d74('0x2a')][_0x6d74('0x32')]);_0x512df1[_0x6d74('0x17')]=qs[_0x6d74('0x17')](_0x559df1[_0x6d74('0x2a')][_0x6d74('0x17')]);}_0x512df1[_0x6d74('0x33')]=qs[_0x6d74('0x34')](_0x559df1['query']['sort']);_0x512df1[_0x6d74('0x35')]=qs[_0x6d74('0x2b')](_[_0x6d74('0x36')](_0x559df1[_0x6d74('0x2a')],_0x528acc[_0x6d74('0x2b')]));if(_0x559df1[_0x6d74('0x2a')][_0x6d74('0x37')]){_0x512df1[_0x6d74('0x35')]=_[_0x6d74('0x38')](_0x512df1[_0x6d74('0x35')],{'$or':_['map'](_0xd2bd21,function(_0x1c0785){if(_0x1c0785[_0x6d74('0x27')]!==_0x6d74('0x39')){var _0x2e61da={};_0x2e61da[_0x1c0785[_0x6d74('0x22')]]={'$like':'%'+_0x559df1[_0x6d74('0x2a')][_0x6d74('0x37')]+'%'};return _0x2e61da;}})});}_0x512df1=_[_0x6d74('0x38')]({},_0x512df1,_0x559df1['options']);var _0x173527={'where':_0x512df1[_0x6d74('0x35')]};return db[_0x6d74('0x3a')][_0x6d74('0x16')](_0x173527)[_0x6d74('0x1f')](function(_0xe66207){_0x1806bc[_0x6d74('0x16')]=_0xe66207;if(_0x559df1[_0x6d74('0x2a')][_0x6d74('0x3b')]){_0x512df1['include']=[{'all':!![]}];}return db[_0x6d74('0x3a')][_0x6d74('0x3c')](_0x512df1);})[_0x6d74('0x1f')](function(_0xb972f4){_0x1806bc['rows']=_0xb972f4;return _0x1806bc;})[_0x6d74('0x1f')](respondWithFilteredResult(_0xe92d0c,_0x512df1))[_0x6d74('0x3d')](handleError(_0xe92d0c,null));};exports[_0x6d74('0x3e')]=function(_0x25e54a,_0x51a4d1){var _0x4024a8={'raw':!![],'where':{'id':_0x25e54a[_0x6d74('0x3f')]['id']}},_0x1a0ac6={};_0x1a0ac6[_0x6d74('0x2d')]=_[_0x6d74('0x29')](db[_0x6d74('0x3a')][_0x6d74('0x26')]);_0x1a0ac6[_0x6d74('0x2a')]=_[_0x6d74('0x29')](_0x25e54a[_0x6d74('0x2a')]);_0x1a0ac6['filters']=_[_0x6d74('0x2c')](_0x1a0ac6[_0x6d74('0x2d')],_0x1a0ac6[_0x6d74('0x2a')]);_0x4024a8['attributes']=_[_0x6d74('0x2c')](_0x1a0ac6['model'],qs[_0x6d74('0x2f')](_0x25e54a[_0x6d74('0x2a')]['fields']));_0x4024a8[_0x6d74('0x2e')]=_0x4024a8[_0x6d74('0x2e')]['length']?_0x4024a8[_0x6d74('0x2e')]:_0x1a0ac6[_0x6d74('0x2d')];if(_0x25e54a['query'][_0x6d74('0x3b')]){_0x4024a8[_0x6d74('0x40')]=[{'all':!![]}];}_0x4024a8=_[_0x6d74('0x38')]({},_0x4024a8,_0x25e54a['options']);return db['ZendeskField']['find'](_0x4024a8)[_0x6d74('0x1f')](handleEntityNotFound(_0x51a4d1,null))['then'](respondWithResult(_0x51a4d1,null))[_0x6d74('0x3d')](handleError(_0x51a4d1,null));};exports['create']=function(_0x3de9c5,_0x27d615){return db['ZendeskField'][_0x6d74('0x41')](_0x3de9c5['body'],{})[_0x6d74('0x1f')](respondWithResult(_0x27d615,0xc9))[_0x6d74('0x3d')](handleError(_0x27d615,null));};exports['update']=function(_0x340eb1,_0xb44a24){if(_0x340eb1[_0x6d74('0x42')]['id']){delete _0x340eb1['body']['id'];}return db[_0x6d74('0x3a')]['find']({'where':{'id':_0x340eb1[_0x6d74('0x3f')]['id']}})[_0x6d74('0x1f')](handleEntityNotFound(_0xb44a24,null))[_0x6d74('0x1f')](saveUpdates(_0x340eb1['body'],null))[_0x6d74('0x1f')](respondWithResult(_0xb44a24,null))[_0x6d74('0x3d')](handleError(_0xb44a24,null));};exports['destroy']=function(_0x49dd2d,_0x2fcdee){return db[_0x6d74('0x3a')][_0x6d74('0x43')]({'where':{'id':_0x49dd2d[_0x6d74('0x3f')]['id']}})[_0x6d74('0x1f')](handleEntityNotFound(_0x2fcdee,null))[_0x6d74('0x1f')](removeEntity(_0x2fcdee,null))['catch'](handleError(_0x2fcdee,null));};
\ No newline at end of file
diff --git a/server/api/intZendeskField/intZendeskField.model.js b/server/api/intZendeskField/intZendeskField.model.js
index d4e921f..46cbbb1 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 _0x0cfa=['zendesk_unique_index','idField','FieldId','lodash','util','../../config/logger','api','moment','bluebird','path','../../config/environment','./intZendeskField.attributes','exports','define','ZendeskField','int_zendesk_fields'];(function(_0x53a876,_0xafe38e){var _0x1e6ba9=function(_0x343329){while(--_0x343329){_0x53a876['push'](_0x53a876['shift']());}};_0x1e6ba9(++_0xafe38e);}(_0x0cfa,0x73));var _0xa0cf=function(_0x5d4e6a,_0x36f602){_0x5d4e6a=_0x5d4e6a-0x0;var _0x231f30=_0x0cfa[_0x5d4e6a];return _0x231f30;};'use strict';var _=require(_0xa0cf('0x0'));var util=require(_0xa0cf('0x1'));var logger=require(_0xa0cf('0x2'))(_0xa0cf('0x3'));var moment=require(_0xa0cf('0x4'));var BPromise=require(_0xa0cf('0x5'));var rp=require('request-promise');var fs=require('fs');var path=require(_0xa0cf('0x6'));var rimraf=require('rimraf');var config=require(_0xa0cf('0x7'));var attributes=require(_0xa0cf('0x8'));module[_0xa0cf('0x9')]=function(_0x265c33,_0x848d37){return _0x265c33[_0xa0cf('0xa')](_0xa0cf('0xb'),attributes,{'tableName':_0xa0cf('0xc'),'paranoid':![],'indexes':[{'name':_0xa0cf('0xd'),'fields':[_0xa0cf('0xe'),_0xa0cf('0xf')],'unique':!![]}],'timestamps':!![]});};
\ No newline at end of file
+var _0x74f0=['int_zendesk_fields','idField','FieldId','util','moment','bluebird','request-promise','path','./intZendeskField.attributes','exports','define','ZendeskField'];(function(_0x1fd6b0,_0x5a40a0){var _0x202a08=function(_0x3a0674){while(--_0x3a0674){_0x1fd6b0['push'](_0x1fd6b0['shift']());}};_0x202a08(++_0x5a40a0);}(_0x74f0,0xf3));var _0x074f=function(_0x1a9390,_0x3339e6){_0x1a9390=_0x1a9390-0x0;var _0x2b4514=_0x74f0[_0x1a9390];return _0x2b4514;};'use strict';var _=require('lodash');var util=require(_0x074f('0x0'));var logger=require('../../config/logger')('api');var moment=require(_0x074f('0x1'));var BPromise=require(_0x074f('0x2'));var rp=require(_0x074f('0x3'));var fs=require('fs');var path=require(_0x074f('0x4'));var rimraf=require('rimraf');var config=require('../../config/environment');var attributes=require(_0x074f('0x5'));module[_0x074f('0x6')]=function(_0x203f47,_0x126607){return _0x203f47[_0x074f('0x7')](_0x074f('0x8'),attributes,{'tableName':_0x074f('0x9'),'paranoid':![],'indexes':[{'name':'zendesk_unique_index','fields':[_0x074f('0xa'),_0x074f('0xb')],'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 f50b9c5..ec69c2f 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 _0xd483=['then','info','ZendeskField,\x20%s,\x20%s','request\x20sent','debug','ZendeskField,\x20%s,\x20%s,\x20%s','stringify','error','code','message','result','catch','util','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','http','request'];(function(_0x2c6174,_0x2593ac){var _0x213de9=function(_0x576f25){while(--_0x576f25){_0x2c6174['push'](_0x2c6174['shift']());}};_0x213de9(++_0x2593ac);}(_0xd483,0x198));var _0x3d48=function(_0x1e1df9,_0xe3565c){_0x1e1df9=_0x1e1df9-0x0;var _0x15e3b1=_0xd483[_0x1e1df9];return _0x15e3b1;};'use strict';var _=require('lodash');var util=require(_0x3d48('0x0'));var moment=require('moment');var BPromise=require(_0x3d48('0x1'));var rs=require(_0x3d48('0x2'));var fs=require('fs');var Redis=require(_0x3d48('0x3'));var db=require(_0x3d48('0x4'))['db'];var utils=require(_0x3d48('0x5'));var logger=require(_0x3d48('0x6'))(_0x3d48('0x7'));var config=require('../../config/environment');var jayson=require('jayson/promise');var client=jayson['client'][_0x3d48('0x8')]({'port':0x232a});function respondWithRpcPromise(_0x27856b,_0x11ed72,_0x9b7ba8){return new BPromise(function(_0x225cd7,_0x466c2e){return client[_0x3d48('0x9')](_0x27856b,_0x9b7ba8)[_0x3d48('0xa')](function(_0x4b3613){logger[_0x3d48('0xb')](_0x3d48('0xc'),_0x11ed72,_0x3d48('0xd'));logger[_0x3d48('0xe')](_0x3d48('0xf'),_0x11ed72,_0x3d48('0xd'),JSON[_0x3d48('0x10')](_0x4b3613));if(_0x4b3613[_0x3d48('0x11')]){if(_0x4b3613[_0x3d48('0x11')][_0x3d48('0x12')]===0x1f4){logger[_0x3d48('0x11')](_0x3d48('0xc'),_0x11ed72,_0x4b3613[_0x3d48('0x11')][_0x3d48('0x13')]);return _0x466c2e(_0x4b3613[_0x3d48('0x11')]['message']);}logger[_0x3d48('0x11')](_0x3d48('0xc'),_0x11ed72,_0x4b3613['error']['message']);return _0x225cd7(_0x4b3613[_0x3d48('0x11')]['message']);}else{logger[_0x3d48('0xb')](_0x3d48('0xc'),_0x11ed72,_0x3d48('0xd'));_0x225cd7(_0x4b3613[_0x3d48('0x14')][_0x3d48('0x13')]);}})[_0x3d48('0x15')](function(_0x43295d){logger[_0x3d48('0x11')](_0x3d48('0xc'),_0x11ed72,_0x43295d);_0x466c2e(_0x43295d);});});}
\ No newline at end of file
+var _0x766e=['lodash','util','moment','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','http','request','info','ZendeskField,\x20%s,\x20%s','request\x20sent','debug','stringify','error','code','message','result'];(function(_0x3dd15e,_0x1f0015){var _0x231fd0=function(_0x4f680a){while(--_0x4f680a){_0x3dd15e['push'](_0x3dd15e['shift']());}};_0x231fd0(++_0x1f0015);}(_0x766e,0x14a));var _0xe766=function(_0x568cf0,_0x1a44cb){_0x568cf0=_0x568cf0-0x0;var _0x360f81=_0x766e[_0x568cf0];return _0x360f81;};'use strict';var _=require(_0xe766('0x0'));var util=require(_0xe766('0x1'));var moment=require(_0xe766('0x2'));var BPromise=require('bluebird');var rs=require(_0xe766('0x3'));var fs=require('fs');var Redis=require(_0xe766('0x4'));var db=require(_0xe766('0x5'))['db'];var utils=require(_0xe766('0x6'));var logger=require(_0xe766('0x7'))(_0xe766('0x8'));var config=require(_0xe766('0x9'));var jayson=require(_0xe766('0xa'));var client=jayson['client'][_0xe766('0xb')]({'port':0x232a});function respondWithRpcPromise(_0x1e84e7,_0x1e981c,_0x20d3ea){return new BPromise(function(_0x5f3555,_0x254717){return client[_0xe766('0xc')](_0x1e84e7,_0x20d3ea)['then'](function(_0x1ffcbb){logger[_0xe766('0xd')](_0xe766('0xe'),_0x1e981c,_0xe766('0xf'));logger[_0xe766('0x10')]('ZendeskField,\x20%s,\x20%s,\x20%s',_0x1e981c,_0xe766('0xf'),JSON[_0xe766('0x11')](_0x1ffcbb));if(_0x1ffcbb['error']){if(_0x1ffcbb[_0xe766('0x12')][_0xe766('0x13')]===0x1f4){logger[_0xe766('0x12')]('ZendeskField,\x20%s,\x20%s',_0x1e981c,_0x1ffcbb[_0xe766('0x12')]['message']);return _0x254717(_0x1ffcbb[_0xe766('0x12')]['message']);}logger['error'](_0xe766('0xe'),_0x1e981c,_0x1ffcbb[_0xe766('0x12')][_0xe766('0x14')]);return _0x5f3555(_0x1ffcbb['error'][_0xe766('0x14')]);}else{logger['info'](_0xe766('0xe'),_0x1e981c,'request\x20sent');_0x5f3555(_0x1ffcbb[_0xe766('0x15')]['message']);}})['catch'](function(_0xd7c5b6){logger['error'](_0xe766('0xe'),_0x1e981c,_0xd7c5b6);_0x254717(_0xd7c5b6);});});}
\ No newline at end of file
diff --git a/server/api/intZohoAccount/index.js b/server/api/intZohoAccount/index.js
index 62aaab8..8d99cc5 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 _0x89ac=['destroy','exports','connect-timeout','express','../../components/auth/service','../../components/interaction/service','../../config/environment','./intZohoAccount.controller','get','isAuthenticated','/:id','show','getConfigurations','/:id/fields','post','create','addConfiguration','delete'];(function(_0x304547,_0x29ca00){var _0x58ba38=function(_0x2bbfe3){while(--_0x2bbfe3){_0x304547['push'](_0x304547['shift']());}};_0x58ba38(++_0x29ca00);}(_0x89ac,0x1c4));var _0xc89a=function(_0x3f08c3,_0x7edc84){_0x3f08c3=_0x3f08c3-0x0;var _0x1ce461=_0x89ac[_0x3f08c3];return _0x1ce461;};'use strict';var multer=require('multer');var util=require('util');var path=require('path');var timeout=require(_0xc89a('0x0'));var express=require(_0xc89a('0x1'));var router=express['Router']();var auth=require(_0xc89a('0x2'));var interaction=require(_0xc89a('0x3'));var config=require(_0xc89a('0x4'));var controller=require(_0xc89a('0x5'));router[_0xc89a('0x6')]('/',auth[_0xc89a('0x7')](),controller['index']);router[_0xc89a('0x6')](_0xc89a('0x8'),auth[_0xc89a('0x7')](),controller[_0xc89a('0x9')]);router[_0xc89a('0x6')]('/:id/configurations',auth[_0xc89a('0x7')](),controller[_0xc89a('0xa')]);router[_0xc89a('0x6')](_0xc89a('0xb'),auth['isAuthenticated'](),controller['getFields']);router[_0xc89a('0xc')]('/',auth[_0xc89a('0x7')](),controller[_0xc89a('0xd')]);router[_0xc89a('0xc')]('/:id/configurations',auth[_0xc89a('0x7')](),controller[_0xc89a('0xe')]);router['put'](_0xc89a('0x8'),auth[_0xc89a('0x7')](),controller['update']);router[_0xc89a('0xf')](_0xc89a('0x8'),auth[_0xc89a('0x7')](),controller[_0xc89a('0x10')]);module[_0xc89a('0x11')]=router;
\ No newline at end of file
+var _0x31db=['destroy','multer','path','express','Router','../../components/auth/service','../../components/interaction/service','../../config/environment','./intZohoAccount.controller','get','index','/:id','isAuthenticated','show','/:id/configurations','getConfigurations','getFields','post','create','addConfiguration','put','update','delete'];(function(_0x425474,_0xe7ddc5){var _0x2f3e4e=function(_0xc6aa6a){while(--_0xc6aa6a){_0x425474['push'](_0x425474['shift']());}};_0x2f3e4e(++_0xe7ddc5);}(_0x31db,0xe7));var _0xb31d=function(_0x3c4a7c,_0x2f4e3c){_0x3c4a7c=_0x3c4a7c-0x0;var _0xf13d1e=_0x31db[_0x3c4a7c];return _0xf13d1e;};'use strict';var multer=require(_0xb31d('0x0'));var util=require('util');var path=require(_0xb31d('0x1'));var timeout=require('connect-timeout');var express=require(_0xb31d('0x2'));var router=express[_0xb31d('0x3')]();var auth=require(_0xb31d('0x4'));var interaction=require(_0xb31d('0x5'));var config=require(_0xb31d('0x6'));var controller=require(_0xb31d('0x7'));router[_0xb31d('0x8')]('/',auth['isAuthenticated'](),controller[_0xb31d('0x9')]);router[_0xb31d('0x8')](_0xb31d('0xa'),auth[_0xb31d('0xb')](),controller[_0xb31d('0xc')]);router[_0xb31d('0x8')](_0xb31d('0xd'),auth[_0xb31d('0xb')](),controller[_0xb31d('0xe')]);router[_0xb31d('0x8')]('/:id/fields',auth[_0xb31d('0xb')](),controller[_0xb31d('0xf')]);router[_0xb31d('0x10')]('/',auth['isAuthenticated'](),controller[_0xb31d('0x11')]);router[_0xb31d('0x10')](_0xb31d('0xd'),auth['isAuthenticated'](),controller[_0xb31d('0x12')]);router[_0xb31d('0x13')](_0xb31d('0xa'),auth[_0xb31d('0xb')](),controller[_0xb31d('0x14')]);router[_0xb31d('0x15')]('/:id',auth[_0xb31d('0xb')](),controller[_0xb31d('0x16')]);module['exports']=router;
\ No newline at end of file
diff --git a/server/api/intZohoAccount/intZohoAccount.attributes.js b/server/api/intZohoAccount/intZohoAccount.attributes.js
index 9f2c9fd..10b2363 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 _0xe340=['STRING','sequelize','exports'];(function(_0xd2286c,_0x304f9d){var _0x2519e0=function(_0x3264e8){while(--_0x3264e8){_0xd2286c['push'](_0xd2286c['shift']());}};_0x2519e0(++_0x304f9d);}(_0xe340,0xdc));var _0x0e34=function(_0x1035c1,_0x2d8583){_0x1035c1=_0x1035c1-0x0;var _0x308d67=_0xe340[_0x1035c1];return _0x308d67;};'use strict';var Sequelize=require(_0x0e34('0x0'));module[_0x0e34('0x1')]={'name':{'type':Sequelize[_0x0e34('0x2')]},'description':{'type':Sequelize[_0x0e34('0x2')]},'host':{'type':Sequelize[_0x0e34('0x2')]},'zone':{'type':Sequelize['STRING']},'clientId':{'type':Sequelize[_0x0e34('0x2')]},'clientSecret':{'type':Sequelize[_0x0e34('0x2')]},'serverUrl':{'type':Sequelize[_0x0e34('0x2')]},'code':{'type':Sequelize[_0x0e34('0x2')]},'refreshToken':{'type':Sequelize[_0x0e34('0x2')]}};
\ No newline at end of file
+var _0x1ffc=['STRING','sequelize','exports'];(function(_0x514364,_0x431908){var _0x187ef5=function(_0x3a22f1){while(--_0x3a22f1){_0x514364['push'](_0x514364['shift']());}};_0x187ef5(++_0x431908);}(_0x1ffc,0x8e));var _0xc1ff=function(_0x53f8ae,_0x1955ba){_0x53f8ae=_0x53f8ae-0x0;var _0x131c02=_0x1ffc[_0x53f8ae];return _0x131c02;};'use strict';var Sequelize=require(_0xc1ff('0x0'));module[_0xc1ff('0x1')]={'name':{'type':Sequelize[_0xc1ff('0x2')]},'description':{'type':Sequelize['STRING']},'host':{'type':Sequelize['STRING']},'zone':{'type':Sequelize[_0xc1ff('0x2')]},'clientId':{'type':Sequelize['STRING']},'clientSecret':{'type':Sequelize[_0xc1ff('0x2')]},'serverUrl':{'type':Sequelize['STRING']},'code':{'type':Sequelize[_0xc1ff('0x2')]},'refreshToken':{'type':Sequelize[_0xc1ff('0x2')]}};
\ No newline at end of file
diff --git a/server/api/intZohoAccount/intZohoAccount.controller.js b/server/api/intZohoAccount/intZohoAccount.controller.js
index 6cc24c3..1771ff0 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 _0x0703=['findAll','rows','catch','create','body','find','params','getConfigurations','findOne','ZohoConfiguration','addConfiguration','AccountId','Subjects','getSubjects','channel','Descriptions','getDescriptions','ZohoField','https://accounts.zoho.com','https://accounts.zoho.com.au','https://accounts.zoho.com.cn','POST','/oauth/v2/token','refreshToken','clientId','clientSecret','refresh_token','access_token','Unable\x20to\x20retrieve\x20the\x20access\x20token','getFields','host','zoho.eu','com','serverUrl','substring','Refresh\x20Token\x20not\x20available\x20for\x20the\x20account','https://www.zohoapis.%s/crm/v2/settings/fields','Calls','Zoho-oauthtoken\x20','response','Owner','Subject','Description','WhoId','Call_Duration','Call_Result','Call_Start_Time','remove','api_name','push','display_label','custom_field','data_type','picklist','pick_list_values','Wrong\x20credentials','statusCode','html-pdf','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','mustache','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','client','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','ZohoAccount,\x20%s,\x20%s','request\x20sent','ZohoAccount,\x20%s,\x20%s,\x20%s','stringify','error','code','message','sendStatus','status','end','json','count','offset','limit','Content-Range','save','update','destroy','name','send','index','map','rawAttributes','type','query','keys','filters','intersection','model','fields','attributes','length','hasOwnProperty','nolimit','order','sort','where','pick','filter','merge','VIRTUAL','options','ZohoAccount','includeAll','include'];(function(_0x27ecc0,_0x3c151c){var _0x269733=function(_0x5a6fdb){while(--_0x5a6fdb){_0x27ecc0['push'](_0x27ecc0['shift']());}};_0x269733(++_0x3c151c);}(_0x0703,0xc0));var _0x3070=function(_0x2a56ad,_0x2b94bf){_0x2a56ad=_0x2a56ad-0x0;var _0x425175=_0x0703[_0x2a56ad];return _0x425175;};'use strict';var pdf=require(_0x3070('0x0'));var emlformat=require(_0x3070('0x1'));var rimraf=require(_0x3070('0x2'));var zipdir=require(_0x3070('0x3'));var jsonpatch=require(_0x3070('0x4'));var rp=require(_0x3070('0x5'));var moment=require('moment');var BPromise=require('bluebird');var Mustache=require(_0x3070('0x6'));var util=require('util');var path=require(_0x3070('0x7'));var sox=require(_0x3070('0x8'));var csv=require(_0x3070('0x9'));var ejs=require(_0x3070('0xa'));var fs=require('fs');var _=require(_0x3070('0xb'));var squel=require(_0x3070('0xc'));var crypto=require('crypto');var jsforce=require(_0x3070('0xd'));var deskjs=require(_0x3070('0xe'));var toCsv=require(_0x3070('0x9'));var querystring=require(_0x3070('0xf'));var Papa=require(_0x3070('0x10'));var Redis=require(_0x3070('0x11'));var authService=require(_0x3070('0x12'));var qs=require(_0x3070('0x13'));var as=require(_0x3070('0x14'));var hardwareService=require(_0x3070('0x15'));var logger=require(_0x3070('0x16'))(_0x3070('0x17'));var utils=require(_0x3070('0x18'));var config=require('../../config/environment');var db=require(_0x3070('0x19'))['db'];var integrations=require('../../components/integrations/configuration');var jayson=require('jayson/promise');var client=jayson[_0x3070('0x1a')]['http']({'port':0x232a});function checkPasswordPattern(_0x357a90,_0x1e2df5,_0x16c2ad){if(_0x16c2ad){var _0x3b2095=new RegExp(/(?=.*[a-z])(?=.*[A-Z])(?=.*[0-9])(?=.*[?!@#\$%\^&\*~\-_=+[{\]\}])(?=.{8,})/);if(_0x3b2095[_0x3070('0x1b')](_0x1e2df5)){return _0x357a90;}else{throw new db['Sequelize'][(_0x3070('0x1c'))](_0x3070('0x1d'));}}else{return _0x357a90;}}function respondWithRpcPromise(_0x594936,_0x563d63,_0xb54756,_0x33ec56){return new BPromise(function(_0x2b92b9,_0x33927b){var _0x766377=_0x33ec56||client;return _0x766377[_0x3070('0x1e')](_0x594936,_0xb54756)[_0x3070('0x1f')](function(_0x17f600){logger[_0x3070('0x20')](_0x3070('0x21'),_0x563d63,_0x3070('0x22'));logger['debug'](_0x3070('0x23'),_0x563d63,'request\x20sent',JSON[_0x3070('0x24')](_0x17f600));if(_0x17f600[_0x3070('0x25')]){if(_0x17f600[_0x3070('0x25')][_0x3070('0x26')]===0x1f4){logger[_0x3070('0x25')](_0x3070('0x21'),_0x563d63,_0x17f600[_0x3070('0x25')]['message']);return _0x33927b(_0x17f600[_0x3070('0x25')][_0x3070('0x27')]);}logger[_0x3070('0x25')](_0x3070('0x21'),_0x563d63,_0x17f600[_0x3070('0x25')][_0x3070('0x27')]);return _0x2b92b9(_0x17f600[_0x3070('0x25')][_0x3070('0x27')]);}else{logger[_0x3070('0x20')](_0x3070('0x21'),_0x563d63,_0x3070('0x22'));_0x2b92b9(_0x17f600['result'][_0x3070('0x27')]);}})['catch'](function(_0x462521){logger[_0x3070('0x25')](_0x3070('0x21'),_0x563d63,_0x462521);_0x33927b(_0x462521);});});}function respondWithStatusCode(_0x4b1e97,_0x3b423e){_0x3b423e=_0x3b423e||0xcc;return function(_0x9b15d8){if(_0x9b15d8){return _0x4b1e97[_0x3070('0x28')](_0x3b423e);}return _0x4b1e97[_0x3070('0x29')](_0x3b423e)[_0x3070('0x2a')]();};}function respondWithResult(_0xe826d9,_0x2def9d){_0x2def9d=_0x2def9d||0xc8;return function(_0x29a64e){if(_0x29a64e){return _0xe826d9[_0x3070('0x29')](_0x2def9d)[_0x3070('0x2b')](_0x29a64e);}};}function respondWithFilteredResult(_0x5928cd,_0x1b423a){return function(_0x6cf4fd){if(_0x6cf4fd){var _0x1ffb6a=_0x6cf4fd[_0x3070('0x2c')],_0x2fdfdc=_0x1b423a[_0x3070('0x2d')],_0x78b0b7=_0x1b423a[_0x3070('0x2d')]+_0x1b423a[_0x3070('0x2e')],_0x289a37;if(_0x78b0b7>=_0x1ffb6a){_0x78b0b7=_0x1ffb6a;_0x289a37=0xc8;}else{_0x289a37=0xce;}_0x5928cd[_0x3070('0x29')](_0x289a37);return _0x5928cd['set'](_0x3070('0x2f'),_0x2fdfdc+'-'+_0x78b0b7+'/'+_0x1ffb6a)[_0x3070('0x2b')](_0x6cf4fd);}return null;};}function patchUpdates(_0x3b7fd5){return function(_0x948fff){try{jsonpatch['apply'](_0x948fff,_0x3b7fd5,!![]);}catch(_0x8610){return BPromise['reject'](_0x8610);}return _0x948fff[_0x3070('0x30')]();};}function saveUpdates(_0xc599b3,_0x34d973){return function(_0x13be58){if(_0x13be58){return _0x13be58[_0x3070('0x31')](_0xc599b3)[_0x3070('0x1f')](function(_0x46d446){return _0x46d446;});}return null;};}function removeEntity(_0x4bd06f,_0xcdd8c8){return function(_0x288154){if(_0x288154){return _0x288154[_0x3070('0x32')]()[_0x3070('0x1f')](function(){_0x4bd06f[_0x3070('0x29')](0xcc)[_0x3070('0x2a')]();});}};}function handleEntityNotFound(_0x23e7cc,_0xe72952){return function(_0x447983){if(!_0x447983){_0x23e7cc[_0x3070('0x28')](0x194);}return _0x447983;};}function handleError(_0x2651b2,_0x57b733){_0x57b733=_0x57b733||0x1f4;return function(_0x45dd0c){logger['error'](_0x45dd0c['stack']);if(_0x45dd0c[_0x3070('0x33')]){delete _0x45dd0c[_0x3070('0x33')];}_0x2651b2[_0x3070('0x29')](_0x57b733)[_0x3070('0x34')](_0x45dd0c);};}exports[_0x3070('0x35')]=function(_0x530e31,_0x454250){var _0x292845={},_0x25855b={},_0x382bca={'count':0x0,'rows':[]};var _0x22e403=_[_0x3070('0x36')](db['ZohoAccount'][_0x3070('0x37')],function(_0x3cb314){return{'name':_0x3cb314['fieldName'],'type':_0x3cb314[_0x3070('0x38')]['key']};});_0x25855b['model']=_[_0x3070('0x36')](_0x22e403,'name');_0x25855b[_0x3070('0x39')]=_[_0x3070('0x3a')](_0x530e31['query']);_0x25855b[_0x3070('0x3b')]=_[_0x3070('0x3c')](_0x25855b[_0x3070('0x3d')],_0x25855b['query']);_0x292845['attributes']=_[_0x3070('0x3c')](_0x25855b['model'],qs[_0x3070('0x3e')](_0x530e31[_0x3070('0x39')]['fields']));_0x292845[_0x3070('0x3f')]=_0x292845[_0x3070('0x3f')][_0x3070('0x40')]?_0x292845[_0x3070('0x3f')]:_0x25855b['model'];if(!_0x530e31['query'][_0x3070('0x41')](_0x3070('0x42'))){_0x292845['limit']=qs[_0x3070('0x2e')](_0x530e31[_0x3070('0x39')]['limit']);_0x292845['offset']=qs[_0x3070('0x2d')](_0x530e31[_0x3070('0x39')][_0x3070('0x2d')]);}_0x292845[_0x3070('0x43')]=qs[_0x3070('0x44')](_0x530e31['query'][_0x3070('0x44')]);_0x292845[_0x3070('0x45')]=qs['filters'](_[_0x3070('0x46')](_0x530e31[_0x3070('0x39')],_0x25855b['filters']));if(_0x530e31[_0x3070('0x39')][_0x3070('0x47')]){_0x292845['where']=_[_0x3070('0x48')](_0x292845['where'],{'$or':_[_0x3070('0x36')](_0x22e403,function(_0x44aa94){if(_0x44aa94[_0x3070('0x38')]!==_0x3070('0x49')){var _0x5c81d4={};_0x5c81d4[_0x44aa94['name']]={'$like':'%'+_0x530e31[_0x3070('0x39')]['filter']+'%'};return _0x5c81d4;}})});}_0x292845=_[_0x3070('0x48')]({},_0x292845,_0x530e31[_0x3070('0x4a')]);var _0x163fc4={'where':_0x292845[_0x3070('0x45')]};return db[_0x3070('0x4b')][_0x3070('0x2c')](_0x163fc4)[_0x3070('0x1f')](function(_0x1d3afc){_0x382bca['count']=_0x1d3afc;if(_0x530e31['query'][_0x3070('0x4c')]){_0x292845[_0x3070('0x4d')]=[{'all':!![]}];}return db[_0x3070('0x4b')][_0x3070('0x4e')](_0x292845);})[_0x3070('0x1f')](function(_0x1fc5c7){_0x382bca[_0x3070('0x4f')]=_0x1fc5c7;return _0x382bca;})[_0x3070('0x1f')](respondWithFilteredResult(_0x454250,_0x292845))[_0x3070('0x50')](handleError(_0x454250,null));};exports['show']=function(_0x550ec3,_0xa6b128){var _0x2af1b2={'raw':![],'where':{'id':_0x550ec3['params']['id']}},_0x3dd546={};_0x3dd546[_0x3070('0x3d')]=_[_0x3070('0x3a')](db[_0x3070('0x4b')][_0x3070('0x37')]);_0x3dd546[_0x3070('0x39')]=_[_0x3070('0x3a')](_0x550ec3[_0x3070('0x39')]);_0x3dd546['filters']=_[_0x3070('0x3c')](_0x3dd546[_0x3070('0x3d')],_0x3dd546[_0x3070('0x39')]);_0x2af1b2[_0x3070('0x3f')]=_[_0x3070('0x3c')](_0x3dd546[_0x3070('0x3d')],qs['fields'](_0x550ec3[_0x3070('0x39')]['fields']));_0x2af1b2[_0x3070('0x3f')]=_0x2af1b2[_0x3070('0x3f')][_0x3070('0x40')]?_0x2af1b2[_0x3070('0x3f')]:_0x3dd546[_0x3070('0x3d')];if(_0x550ec3[_0x3070('0x39')][_0x3070('0x4c')]){_0x2af1b2[_0x3070('0x4d')]=[{'all':!![]}];}_0x2af1b2=_[_0x3070('0x48')]({},_0x2af1b2,_0x550ec3['options']);return db['ZohoAccount']['find'](_0x2af1b2)[_0x3070('0x1f')](handleEntityNotFound(_0xa6b128,null))[_0x3070('0x1f')](respondWithResult(_0xa6b128,null))[_0x3070('0x50')](handleError(_0xa6b128,null));};exports['create']=function(_0xdb7987,_0x3cead8){return db[_0x3070('0x4b')][_0x3070('0x51')](_0xdb7987[_0x3070('0x52')],{})['then'](respondWithResult(_0x3cead8,0xc9))['catch'](handleError(_0x3cead8,null));};exports['update']=function(_0x4c7971,_0x4a3268){if(_0x4c7971[_0x3070('0x52')]['id']){delete _0x4c7971[_0x3070('0x52')]['id'];}return db[_0x3070('0x4b')][_0x3070('0x53')]({'where':{'id':_0x4c7971[_0x3070('0x54')]['id']}})[_0x3070('0x1f')](handleEntityNotFound(_0x4a3268,null))[_0x3070('0x1f')](saveUpdates(_0x4c7971[_0x3070('0x52')],null))[_0x3070('0x1f')](respondWithResult(_0x4a3268,null))['catch'](handleError(_0x4a3268,null));};exports[_0x3070('0x32')]=function(_0x3f5427,_0x5d6680){return db['ZohoAccount'][_0x3070('0x53')]({'where':{'id':_0x3f5427[_0x3070('0x54')]['id']}})[_0x3070('0x1f')](handleEntityNotFound(_0x5d6680,null))[_0x3070('0x1f')](removeEntity(_0x5d6680,null))[_0x3070('0x50')](handleError(_0x5d6680,null));};exports[_0x3070('0x55')]=function(_0x66cfff,_0x103e10,_0x31824e){var _0x389e72={};var _0x49c232={};var _0x39a110;var _0x5e1226;return db['ZohoAccount'][_0x3070('0x56')]({'where':{'id':_0x66cfff[_0x3070('0x54')]['id']}})[_0x3070('0x1f')](handleEntityNotFound(_0x103e10,null))[_0x3070('0x1f')](function(_0x3b65b5){if(_0x3b65b5){_0x39a110=_0x3b65b5;_0x49c232[_0x3070('0x3d')]=_['keys'](db[_0x3070('0x57')][_0x3070('0x37')]);_0x49c232[_0x3070('0x39')]=_[_0x3070('0x3a')](_0x66cfff[_0x3070('0x39')]);_0x49c232['filters']=_[_0x3070('0x3c')](_0x49c232[_0x3070('0x3d')],_0x49c232['query']);_0x389e72[_0x3070('0x3f')]=_[_0x3070('0x3c')](_0x49c232[_0x3070('0x3d')],qs['fields'](_0x66cfff[_0x3070('0x39')][_0x3070('0x3e')]));_0x389e72[_0x3070('0x3f')]=_0x389e72[_0x3070('0x3f')][_0x3070('0x40')]?_0x389e72[_0x3070('0x3f')]:_0x49c232['model'];_0x389e72[_0x3070('0x43')]=qs[_0x3070('0x44')](_0x66cfff['query']['sort']);_0x389e72[_0x3070('0x45')]=qs[_0x3070('0x3b')](_[_0x3070('0x46')](_0x66cfff[_0x3070('0x39')],_0x49c232[_0x3070('0x3b')]));if(_0x66cfff['query'][_0x3070('0x47')]){_0x389e72['where']=_[_0x3070('0x48')](_0x389e72[_0x3070('0x45')],{'$or':_[_0x3070('0x36')](_0x389e72[_0x3070('0x3f')],function(_0x15f2e0){var _0x5d382e={};_0x5d382e[_0x15f2e0]={'$like':'%'+_0x66cfff[_0x3070('0x39')][_0x3070('0x47')]+'%'};return _0x5d382e;})});}_0x389e72=_[_0x3070('0x48')]({},_0x389e72,_0x66cfff[_0x3070('0x4a')]);return _0x39a110[_0x3070('0x55')](_0x389e72);}})['then'](function(_0x5a9525){if(_0x5a9525){_0x5e1226=_0x5a9525[_0x3070('0x40')];if(!_0x66cfff['query'][_0x3070('0x41')](_0x3070('0x42'))){_0x389e72[_0x3070('0x2e')]=qs[_0x3070('0x2e')](_0x66cfff[_0x3070('0x39')]['limit']);_0x389e72[_0x3070('0x2d')]=qs[_0x3070('0x2d')](_0x66cfff[_0x3070('0x39')]['offset']);}return _0x39a110['getConfigurations'](_0x389e72);}})[_0x3070('0x1f')](function(_0x1aae03){if(_0x1aae03){return _0x1aae03?{'count':_0x5e1226,'rows':_0x1aae03}:null;}})[_0x3070('0x1f')](respondWithResult(_0x103e10,null))[_0x3070('0x50')](handleError(_0x103e10,null));};exports[_0x3070('0x58')]=function(_0x44cfb0,_0x25bb15,_0x151791){if(_0x44cfb0[_0x3070('0x52')]['id']){delete _0x44cfb0[_0x3070('0x52')]['id'];}return db[_0x3070('0x4b')][_0x3070('0x56')]({'where':{'id':_0x44cfb0[_0x3070('0x54')]['id']}})['then'](handleEntityNotFound(_0x25bb15,null))[_0x3070('0x1f')](function(_0x4cd7a6){if(_0x4cd7a6){_0x44cfb0['body'][_0x3070('0x59')]=_0x4cd7a6['id'];_0x44cfb0[_0x3070('0x52')][_0x3070('0x5a')]=integrations[_0x3070('0x5b')](_0x44cfb0['body'][_0x3070('0x5c')],_0x44cfb0[_0x3070('0x52')]['type']);_0x44cfb0[_0x3070('0x52')][_0x3070('0x5d')]=integrations[_0x3070('0x5e')](_0x44cfb0[_0x3070('0x52')][_0x3070('0x5c')],_0x44cfb0[_0x3070('0x52')]['type']);return db[_0x3070('0x57')][_0x3070('0x51')](_0x44cfb0['body'],{'include':[{'model':db[_0x3070('0x5f')],'as':'Subjects'},{'model':db[_0x3070('0x5f')],'as':_0x3070('0x5d')}]});}return null;})[_0x3070('0x1f')](respondWithResult(_0x25bb15,null))[_0x3070('0x50')](handleError(_0x25bb15,null));};function getAccessToken(_0x4b26f1){return new Promise(function(_0x7dab34,_0x47c139){var _0x541021;switch(_0x4b26f1['zone']){case'US':_0x541021=_0x3070('0x60');break;case'AU':_0x541021=_0x3070('0x61');break;case'EU':_0x541021='https://accounts.zoho.eu';break;case'IN':_0x541021='https://accounts.zoho.in';break;case'CN':_0x541021=_0x3070('0x62');break;default:_0x541021='https://accounts.zoho.eu';break;}var _0x575408={'method':_0x3070('0x63'),'uri':_0x541021+_0x3070('0x64'),'qs':{'refresh_token':_0x4b26f1[_0x3070('0x65')],'client_id':_0x4b26f1[_0x3070('0x66')],'client_secret':_0x4b26f1[_0x3070('0x67')],'grant_type':_0x3070('0x68')},'json':!![]};return rp(_0x575408)[_0x3070('0x1f')](function(_0x107321){if(_0x107321[_0x3070('0x69')]){_0x7dab34(_0x107321[_0x3070('0x69')]);}else{_0x47c139(_0x3070('0x6a'));}})[_0x3070('0x50')](function(_0x46e2eb){_0x47c139(_0x46e2eb);});});}exports[_0x3070('0x6b')]=function(_0x409f7c,_0x5a6601,_0xfb41bd){var _0x6886f4,_0x4f2a1f,_0x301621,_0x5b764b,_0xbfacd;return db[_0x3070('0x4b')][_0x3070('0x56')]({'where':{'id':_0x409f7c[_0x3070('0x54')]['id']},'attributes':['id',_0x3070('0x6c'),'zone',_0x3070('0x66'),'clientSecret','serverUrl',_0x3070('0x26'),_0x3070('0x65')]})[_0x3070('0x1f')](handleEntityNotFound(_0x5a6601,null))['then'](function(_0x2ada09){_0xbfacd=_0x2ada09;_0x6886f4=_0xbfacd[_0x3070('0x6c')];_0x4f2a1f=_0x6886f4===_0x3070('0x6d')?'eu':_0x3070('0x6e');_0x301621=_0xbfacd[_0x3070('0x6f')];var _0x10a5f2=_0x301621['slice'](-0x1);if(_0x10a5f2==='/'||_0x10a5f2==='\x5c'||_0x10a5f2===':'){_0x301621=_0x301621[_0x3070('0x70')](0x0,_0x301621['lastIndexOf'](_0x10a5f2));}if(!_0xbfacd['refreshToken']){throw new Error(_0x3070('0x71'));}return getAccessToken(_0xbfacd);})[_0x3070('0x1f')](function(_0x504e94){if(_0x504e94){return rp({'method':'GET','uri':util['format'](_0x3070('0x72'),_0x4f2a1f),'qs':{'module':_0x3070('0x73')},'headers':{'Authorization':_0x3070('0x74')+_0x504e94},'json':!![]});}})[_0x3070('0x1f')](function(_0x8ff24a){if(_0x8ff24a){if(_0x8ff24a[_0x3070('0x75')]&&_0x8ff24a['response'][_0x3070('0x25')]){throw new Error(_0x8ff24a[_0x3070('0x75')]['error'][_0x3070('0x27')]);}var _0x3897f6=[];var _0x4184c9=[];var _0x280e81=[_0x3070('0x76'),_0x3070('0x77'),_0x3070('0x78'),_0x3070('0x79'),_0x3070('0x7a'),_0x3070('0x7b'),_0x3070('0x7c'),'Call_Type'];_0x4184c9=_[_0x3070('0x7d')](_0x8ff24a[_0x3070('0x3e')],function(_0x31cc8d){return _0x280e81['includes'](_0x31cc8d[_0x3070('0x7e')]);});for(var _0x2258b4=0x0;_0x2258b4<_0x4184c9['length'];_0x2258b4++){if(_0x4184c9[_0x2258b4]['system_mandatory']===![]){_0x3897f6[_0x3070('0x7f')]({'id':_0x4184c9[_0x2258b4]['id'],'name':_0x4184c9[_0x2258b4][_0x3070('0x80')],'custom':_0x4184c9[_0x2258b4][_0x3070('0x81')],'options':_0x4184c9[_0x2258b4][_0x3070('0x82')]===_0x3070('0x83')&&_0x4184c9[_0x2258b4][_0x3070('0x84')]['length']>-0x1?_[_0x3070('0x36')](_0x4184c9[_0x2258b4][_0x3070('0x84')],function(_0x2e236c){return{'name':_0x2e236c,'value':_0x2e236c};}):[]});}}return{'count':_0x3897f6[_0x3070('0x40')],'rows':_0x3897f6};}else{return{'count':0x0,'rows':[]};}})[_0x3070('0x1f')](respondWithResult(_0x5a6601,null))[_0x3070('0x50')](function(_0x3d6179){var _0x389886=_0x409f7c[_0x3070('0x39')][_0x3070('0x1b')]?0x1f4:_0x3d6179['statusCode']||0x1f4;logger[_0x3070('0x25')]('getFields,\x20%s,\x20%s,\x20%s',_0x3070('0x6b'),_0x389886,JSON[_0x3070('0x24')](_0x3d6179));delete _0x3d6179[_0x3070('0x33')];if(_0x389886===0x191){_0x389886=0x190;}_0x5a6601['status'](_0x389886)[_0x3070('0x34')](_0x409f7c[_0x3070('0x39')][_0x3070('0x1b')]?{'message':_0x3070('0x85'),'statusCode':_0x3d6179[_0x3070('0x86')]}:_0x3d6179);});};
\ No newline at end of file
+var _0x21f8=['zip-dir','request-promise','moment','bluebird','mustache','util','sox','to-csv','ejs','lodash','squel','jsforce','desk.js','querystring','papaparse','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/environment','../../mysqldb','../../components/integrations/configuration','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','ZohoAccount,\x20%s,\x20%s','request\x20sent','stringify','error','code','message','sendStatus','end','status','json','offset','limit','set','Content-Range','apply','update','stack','name','send','map','ZohoAccount','rawAttributes','type','key','query','filters','intersection','model','attributes','fields','length','hasOwnProperty','nolimit','sort','where','pick','filter','merge','VIRTUAL','count','includeAll','findAll','rows','show','keys','include','options','find','catch','create','body','params','destroy','ZohoConfiguration','order','getConfigurations','addConfiguration','AccountId','Subjects','channel','getDescriptions','ZohoField','Descriptions','https://accounts.zoho.com','https://accounts.zoho.com.au','https://accounts.zoho.in','https://accounts.zoho.com.cn','https://accounts.zoho.eu','POST','/oauth/v2/token','refreshToken','clientId','refresh_token','access_token','Unable\x20to\x20retrieve\x20the\x20access\x20token','getFields','host','zone','clientSecret','serverUrl','zoho.eu','com','slice','substring','GET','format','https://www.zohoapis.%s/crm/v2/settings/fields','response','Owner','Subject','Description','WhoId','Call_Result','Call_Start_Time','Call_Type','remove','includes','api_name','system_mandatory','push','display_label','custom_field','data_type','picklist','pick_list_values','statusCode','getFields,\x20%s,\x20%s,\x20%s','Wrong\x20credentials','html-pdf','eml-format','rimraf'];(function(_0x88cd7b,_0x4c884c){var _0x56fcc8=function(_0x513b3d){while(--_0x513b3d){_0x88cd7b['push'](_0x88cd7b['shift']());}};_0x56fcc8(++_0x4c884c);}(_0x21f8,0x119));var _0x821f=function(_0x43de22,_0x1eced6){_0x43de22=_0x43de22-0x0;var _0x4b15ee=_0x21f8[_0x43de22];return _0x4b15ee;};'use strict';var pdf=require(_0x821f('0x0'));var emlformat=require(_0x821f('0x1'));var rimraf=require(_0x821f('0x2'));var zipdir=require(_0x821f('0x3'));var jsonpatch=require('fast-json-patch');var rp=require(_0x821f('0x4'));var moment=require(_0x821f('0x5'));var BPromise=require(_0x821f('0x6'));var Mustache=require(_0x821f('0x7'));var util=require(_0x821f('0x8'));var path=require('path');var sox=require(_0x821f('0x9'));var csv=require(_0x821f('0xa'));var ejs=require(_0x821f('0xb'));var fs=require('fs');var _=require(_0x821f('0xc'));var squel=require(_0x821f('0xd'));var crypto=require('crypto');var jsforce=require(_0x821f('0xe'));var deskjs=require(_0x821f('0xf'));var toCsv=require('to-csv');var querystring=require(_0x821f('0x10'));var Papa=require(_0x821f('0x11'));var Redis=require('ioredis');var authService=require(_0x821f('0x12'));var qs=require(_0x821f('0x13'));var as=require(_0x821f('0x14'));var hardwareService=require(_0x821f('0x15'));var logger=require(_0x821f('0x16'))(_0x821f('0x17'));var utils=require('../../config/utils');var config=require(_0x821f('0x18'));var db=require(_0x821f('0x19'))['db'];var integrations=require(_0x821f('0x1a'));var jayson=require('jayson/promise');var client=jayson['client'][_0x821f('0x1b')]({'port':0x232a});function checkPasswordPattern(_0x12e416,_0x1eb8bd,_0x21cf2a){if(_0x21cf2a){var _0x145f95=new RegExp(/(?=.*[a-z])(?=.*[A-Z])(?=.*[0-9])(?=.*[?!@#\$%\^&\*~\-_=+[{\]\}])(?=.{8,})/);if(_0x145f95[_0x821f('0x1c')](_0x1eb8bd)){return _0x12e416;}else{throw new db[(_0x821f('0x1d'))]['ValidationError'](_0x821f('0x1e'));}}else{return _0x12e416;}}function respondWithRpcPromise(_0x31bf9e,_0xf0e8b7,_0x483064,_0x1b47d3){return new BPromise(function(_0x4b7e30,_0x542b6c){var _0x48b503=_0x1b47d3||client;return _0x48b503[_0x821f('0x1f')](_0x31bf9e,_0x483064)[_0x821f('0x20')](function(_0x38f98b){logger[_0x821f('0x21')](_0x821f('0x22'),_0xf0e8b7,'request\x20sent');logger['debug']('ZohoAccount,\x20%s,\x20%s,\x20%s',_0xf0e8b7,_0x821f('0x23'),JSON[_0x821f('0x24')](_0x38f98b));if(_0x38f98b[_0x821f('0x25')]){if(_0x38f98b[_0x821f('0x25')][_0x821f('0x26')]===0x1f4){logger[_0x821f('0x25')]('ZohoAccount,\x20%s,\x20%s',_0xf0e8b7,_0x38f98b['error'][_0x821f('0x27')]);return _0x542b6c(_0x38f98b[_0x821f('0x25')][_0x821f('0x27')]);}logger[_0x821f('0x25')](_0x821f('0x22'),_0xf0e8b7,_0x38f98b[_0x821f('0x25')][_0x821f('0x27')]);return _0x4b7e30(_0x38f98b[_0x821f('0x25')][_0x821f('0x27')]);}else{logger[_0x821f('0x21')](_0x821f('0x22'),_0xf0e8b7,_0x821f('0x23'));_0x4b7e30(_0x38f98b['result']['message']);}})['catch'](function(_0x3d41a0){logger['error'](_0x821f('0x22'),_0xf0e8b7,_0x3d41a0);_0x542b6c(_0x3d41a0);});});}function respondWithStatusCode(_0x4b19ac,_0x5d05cf){_0x5d05cf=_0x5d05cf||0xcc;return function(_0x13fd5c){if(_0x13fd5c){return _0x4b19ac[_0x821f('0x28')](_0x5d05cf);}return _0x4b19ac['status'](_0x5d05cf)[_0x821f('0x29')]();};}function respondWithResult(_0x90348b,_0x1258cc){_0x1258cc=_0x1258cc||0xc8;return function(_0x2ee1fa){if(_0x2ee1fa){return _0x90348b[_0x821f('0x2a')](_0x1258cc)[_0x821f('0x2b')](_0x2ee1fa);}};}function respondWithFilteredResult(_0x2bb3e3,_0x16d780){return function(_0x447e37){if(_0x447e37){var _0x22e166=_0x447e37['count'],_0x28caf5=_0x16d780[_0x821f('0x2c')],_0xe7469d=_0x16d780['offset']+_0x16d780[_0x821f('0x2d')],_0x2ca62a;if(_0xe7469d>=_0x22e166){_0xe7469d=_0x22e166;_0x2ca62a=0xc8;}else{_0x2ca62a=0xce;}_0x2bb3e3[_0x821f('0x2a')](_0x2ca62a);return _0x2bb3e3[_0x821f('0x2e')](_0x821f('0x2f'),_0x28caf5+'-'+_0xe7469d+'/'+_0x22e166)[_0x821f('0x2b')](_0x447e37);}return null;};}function patchUpdates(_0x5ecfaf){return function(_0x3361a1){try{jsonpatch[_0x821f('0x30')](_0x3361a1,_0x5ecfaf,!![]);}catch(_0x19cc33){return BPromise['reject'](_0x19cc33);}return _0x3361a1['save']();};}function saveUpdates(_0x3dc36f,_0x55b10e){return function(_0x373268){if(_0x373268){return _0x373268[_0x821f('0x31')](_0x3dc36f)[_0x821f('0x20')](function(_0x59d5ab){return _0x59d5ab;});}return null;};}function removeEntity(_0x21853c,_0x1b8a05){return function(_0x32deda){if(_0x32deda){return _0x32deda['destroy']()[_0x821f('0x20')](function(){_0x21853c['status'](0xcc)[_0x821f('0x29')]();});}};}function handleEntityNotFound(_0x316aef,_0x22a39b){return function(_0x2cd36a){if(!_0x2cd36a){_0x316aef['sendStatus'](0x194);}return _0x2cd36a;};}function handleError(_0x122775,_0x4f1f0f){_0x4f1f0f=_0x4f1f0f||0x1f4;return function(_0x275029){logger['error'](_0x275029[_0x821f('0x32')]);if(_0x275029[_0x821f('0x33')]){delete _0x275029[_0x821f('0x33')];}_0x122775['status'](_0x4f1f0f)[_0x821f('0x34')](_0x275029);};}exports['index']=function(_0x51ff8d,_0xcbcb8b){var _0x12ebea={},_0x20f4b9={},_0x52e54a={'count':0x0,'rows':[]};var _0xe49c26=_[_0x821f('0x35')](db[_0x821f('0x36')][_0x821f('0x37')],function(_0x364ab7){return{'name':_0x364ab7['fieldName'],'type':_0x364ab7[_0x821f('0x38')][_0x821f('0x39')]};});_0x20f4b9['model']=_[_0x821f('0x35')](_0xe49c26,_0x821f('0x33'));_0x20f4b9['query']=_['keys'](_0x51ff8d[_0x821f('0x3a')]);_0x20f4b9[_0x821f('0x3b')]=_[_0x821f('0x3c')](_0x20f4b9[_0x821f('0x3d')],_0x20f4b9[_0x821f('0x3a')]);_0x12ebea[_0x821f('0x3e')]=_[_0x821f('0x3c')](_0x20f4b9[_0x821f('0x3d')],qs[_0x821f('0x3f')](_0x51ff8d[_0x821f('0x3a')][_0x821f('0x3f')]));_0x12ebea[_0x821f('0x3e')]=_0x12ebea[_0x821f('0x3e')][_0x821f('0x40')]?_0x12ebea[_0x821f('0x3e')]:_0x20f4b9['model'];if(!_0x51ff8d[_0x821f('0x3a')][_0x821f('0x41')](_0x821f('0x42'))){_0x12ebea['limit']=qs[_0x821f('0x2d')](_0x51ff8d[_0x821f('0x3a')]['limit']);_0x12ebea[_0x821f('0x2c')]=qs[_0x821f('0x2c')](_0x51ff8d[_0x821f('0x3a')][_0x821f('0x2c')]);}_0x12ebea['order']=qs['sort'](_0x51ff8d[_0x821f('0x3a')][_0x821f('0x43')]);_0x12ebea[_0x821f('0x44')]=qs['filters'](_[_0x821f('0x45')](_0x51ff8d[_0x821f('0x3a')],_0x20f4b9[_0x821f('0x3b')]));if(_0x51ff8d[_0x821f('0x3a')][_0x821f('0x46')]){_0x12ebea[_0x821f('0x44')]=_[_0x821f('0x47')](_0x12ebea['where'],{'$or':_[_0x821f('0x35')](_0xe49c26,function(_0xd2263f){if(_0xd2263f[_0x821f('0x38')]!==_0x821f('0x48')){var _0x1ed170={};_0x1ed170[_0xd2263f[_0x821f('0x33')]]={'$like':'%'+_0x51ff8d[_0x821f('0x3a')][_0x821f('0x46')]+'%'};return _0x1ed170;}})});}_0x12ebea=_[_0x821f('0x47')]({},_0x12ebea,_0x51ff8d['options']);var _0x33fcd7={'where':_0x12ebea[_0x821f('0x44')]};return db['ZohoAccount']['count'](_0x33fcd7)['then'](function(_0x2c2403){_0x52e54a[_0x821f('0x49')]=_0x2c2403;if(_0x51ff8d[_0x821f('0x3a')][_0x821f('0x4a')]){_0x12ebea['include']=[{'all':!![]}];}return db[_0x821f('0x36')][_0x821f('0x4b')](_0x12ebea);})[_0x821f('0x20')](function(_0x31eeec){_0x52e54a[_0x821f('0x4c')]=_0x31eeec;return _0x52e54a;})['then'](respondWithFilteredResult(_0xcbcb8b,_0x12ebea))['catch'](handleError(_0xcbcb8b,null));};exports[_0x821f('0x4d')]=function(_0x1ac35b,_0x5cfc0f){var _0x1a4ff3={'raw':![],'where':{'id':_0x1ac35b['params']['id']}},_0x4aa66e={};_0x4aa66e[_0x821f('0x3d')]=_['keys'](db[_0x821f('0x36')][_0x821f('0x37')]);_0x4aa66e['query']=_[_0x821f('0x4e')](_0x1ac35b[_0x821f('0x3a')]);_0x4aa66e[_0x821f('0x3b')]=_['intersection'](_0x4aa66e[_0x821f('0x3d')],_0x4aa66e[_0x821f('0x3a')]);_0x1a4ff3[_0x821f('0x3e')]=_[_0x821f('0x3c')](_0x4aa66e[_0x821f('0x3d')],qs[_0x821f('0x3f')](_0x1ac35b[_0x821f('0x3a')][_0x821f('0x3f')]));_0x1a4ff3[_0x821f('0x3e')]=_0x1a4ff3[_0x821f('0x3e')][_0x821f('0x40')]?_0x1a4ff3['attributes']:_0x4aa66e[_0x821f('0x3d')];if(_0x1ac35b['query'][_0x821f('0x4a')]){_0x1a4ff3[_0x821f('0x4f')]=[{'all':!![]}];}_0x1a4ff3=_[_0x821f('0x47')]({},_0x1a4ff3,_0x1ac35b[_0x821f('0x50')]);return db[_0x821f('0x36')][_0x821f('0x51')](_0x1a4ff3)[_0x821f('0x20')](handleEntityNotFound(_0x5cfc0f,null))[_0x821f('0x20')](respondWithResult(_0x5cfc0f,null))[_0x821f('0x52')](handleError(_0x5cfc0f,null));};exports[_0x821f('0x53')]=function(_0x5bad36,_0x33ad73){return db[_0x821f('0x36')][_0x821f('0x53')](_0x5bad36[_0x821f('0x54')],{})[_0x821f('0x20')](respondWithResult(_0x33ad73,0xc9))[_0x821f('0x52')](handleError(_0x33ad73,null));};exports[_0x821f('0x31')]=function(_0x214448,_0xe5ae89){if(_0x214448[_0x821f('0x54')]['id']){delete _0x214448[_0x821f('0x54')]['id'];}return db[_0x821f('0x36')]['find']({'where':{'id':_0x214448[_0x821f('0x55')]['id']}})[_0x821f('0x20')](handleEntityNotFound(_0xe5ae89,null))[_0x821f('0x20')](saveUpdates(_0x214448[_0x821f('0x54')],null))[_0x821f('0x20')](respondWithResult(_0xe5ae89,null))[_0x821f('0x52')](handleError(_0xe5ae89,null));};exports[_0x821f('0x56')]=function(_0x239068,_0x51a1a8){return db['ZohoAccount'][_0x821f('0x51')]({'where':{'id':_0x239068[_0x821f('0x55')]['id']}})['then'](handleEntityNotFound(_0x51a1a8,null))[_0x821f('0x20')](removeEntity(_0x51a1a8,null))['catch'](handleError(_0x51a1a8,null));};exports['getConfigurations']=function(_0x1042ac,_0x1fbc6f,_0x2ee6f9){var _0x32423e={};var _0x34b72c={};var _0x1c2b42;var _0x36f742;return db[_0x821f('0x36')]['findOne']({'where':{'id':_0x1042ac[_0x821f('0x55')]['id']}})[_0x821f('0x20')](handleEntityNotFound(_0x1fbc6f,null))[_0x821f('0x20')](function(_0x441193){if(_0x441193){_0x1c2b42=_0x441193;_0x34b72c[_0x821f('0x3d')]=_[_0x821f('0x4e')](db[_0x821f('0x57')][_0x821f('0x37')]);_0x34b72c[_0x821f('0x3a')]=_[_0x821f('0x4e')](_0x1042ac[_0x821f('0x3a')]);_0x34b72c[_0x821f('0x3b')]=_[_0x821f('0x3c')](_0x34b72c[_0x821f('0x3d')],_0x34b72c[_0x821f('0x3a')]);_0x32423e[_0x821f('0x3e')]=_[_0x821f('0x3c')](_0x34b72c[_0x821f('0x3d')],qs[_0x821f('0x3f')](_0x1042ac['query'][_0x821f('0x3f')]));_0x32423e['attributes']=_0x32423e[_0x821f('0x3e')][_0x821f('0x40')]?_0x32423e[_0x821f('0x3e')]:_0x34b72c['model'];_0x32423e[_0x821f('0x58')]=qs['sort'](_0x1042ac['query'][_0x821f('0x43')]);_0x32423e[_0x821f('0x44')]=qs[_0x821f('0x3b')](_['pick'](_0x1042ac[_0x821f('0x3a')],_0x34b72c[_0x821f('0x3b')]));if(_0x1042ac[_0x821f('0x3a')][_0x821f('0x46')]){_0x32423e[_0x821f('0x44')]=_[_0x821f('0x47')](_0x32423e['where'],{'$or':_[_0x821f('0x35')](_0x32423e['attributes'],function(_0x1eedab){var _0x435ac0={};_0x435ac0[_0x1eedab]={'$like':'%'+_0x1042ac[_0x821f('0x3a')][_0x821f('0x46')]+'%'};return _0x435ac0;})});}_0x32423e=_[_0x821f('0x47')]({},_0x32423e,_0x1042ac[_0x821f('0x50')]);return _0x1c2b42[_0x821f('0x59')](_0x32423e);}})[_0x821f('0x20')](function(_0x96deab){if(_0x96deab){_0x36f742=_0x96deab['length'];if(!_0x1042ac[_0x821f('0x3a')]['hasOwnProperty'](_0x821f('0x42'))){_0x32423e[_0x821f('0x2d')]=qs['limit'](_0x1042ac[_0x821f('0x3a')][_0x821f('0x2d')]);_0x32423e[_0x821f('0x2c')]=qs['offset'](_0x1042ac[_0x821f('0x3a')]['offset']);}return _0x1c2b42[_0x821f('0x59')](_0x32423e);}})[_0x821f('0x20')](function(_0x5d1d4e){if(_0x5d1d4e){return _0x5d1d4e?{'count':_0x36f742,'rows':_0x5d1d4e}:null;}})[_0x821f('0x20')](respondWithResult(_0x1fbc6f,null))[_0x821f('0x52')](handleError(_0x1fbc6f,null));};exports[_0x821f('0x5a')]=function(_0x39756a,_0x24db38,_0xecd9e7){if(_0x39756a[_0x821f('0x54')]['id']){delete _0x39756a['body']['id'];}return db[_0x821f('0x36')]['findOne']({'where':{'id':_0x39756a[_0x821f('0x55')]['id']}})[_0x821f('0x20')](handleEntityNotFound(_0x24db38,null))[_0x821f('0x20')](function(_0x3ee985){if(_0x3ee985){_0x39756a['body'][_0x821f('0x5b')]=_0x3ee985['id'];_0x39756a[_0x821f('0x54')][_0x821f('0x5c')]=integrations['getSubjects'](_0x39756a[_0x821f('0x54')][_0x821f('0x5d')],_0x39756a[_0x821f('0x54')][_0x821f('0x38')]);_0x39756a['body']['Descriptions']=integrations[_0x821f('0x5e')](_0x39756a[_0x821f('0x54')][_0x821f('0x5d')],_0x39756a['body'][_0x821f('0x38')]);return db[_0x821f('0x57')][_0x821f('0x53')](_0x39756a['body'],{'include':[{'model':db['ZohoField'],'as':'Subjects'},{'model':db[_0x821f('0x5f')],'as':_0x821f('0x60')}]});}return null;})[_0x821f('0x20')](respondWithResult(_0x24db38,null))[_0x821f('0x52')](handleError(_0x24db38,null));};function getAccessToken(_0x21f89e){return new Promise(function(_0x4f4ff3,_0x1bccfe){var _0x5cc1a9;switch(_0x21f89e['zone']){case'US':_0x5cc1a9=_0x821f('0x61');break;case'AU':_0x5cc1a9=_0x821f('0x62');break;case'EU':_0x5cc1a9='https://accounts.zoho.eu';break;case'IN':_0x5cc1a9=_0x821f('0x63');break;case'CN':_0x5cc1a9=_0x821f('0x64');break;default:_0x5cc1a9=_0x821f('0x65');break;}var _0x16d618={'method':_0x821f('0x66'),'uri':_0x5cc1a9+_0x821f('0x67'),'qs':{'refresh_token':_0x21f89e[_0x821f('0x68')],'client_id':_0x21f89e[_0x821f('0x69')],'client_secret':_0x21f89e['clientSecret'],'grant_type':_0x821f('0x6a')},'json':!![]};return rp(_0x16d618)[_0x821f('0x20')](function(_0x336ec6){if(_0x336ec6['access_token']){_0x4f4ff3(_0x336ec6[_0x821f('0x6b')]);}else{_0x1bccfe(_0x821f('0x6c'));}})['catch'](function(_0x1af646){_0x1bccfe(_0x1af646);});});}exports[_0x821f('0x6d')]=function(_0x506989,_0x1bf6be,_0x1d103e){var _0x5cf975,_0x48da40,_0x4be16e,_0x4ed585,_0x53083f;return db[_0x821f('0x36')]['findOne']({'where':{'id':_0x506989[_0x821f('0x55')]['id']},'attributes':['id',_0x821f('0x6e'),_0x821f('0x6f'),_0x821f('0x69'),_0x821f('0x70'),_0x821f('0x71'),_0x821f('0x26'),_0x821f('0x68')]})[_0x821f('0x20')](handleEntityNotFound(_0x1bf6be,null))['then'](function(_0x2d032b){_0x53083f=_0x2d032b;_0x5cf975=_0x53083f[_0x821f('0x6e')];_0x48da40=_0x5cf975===_0x821f('0x72')?'eu':_0x821f('0x73');_0x4be16e=_0x53083f[_0x821f('0x71')];var _0x32a3c2=_0x4be16e[_0x821f('0x74')](-0x1);if(_0x32a3c2==='/'||_0x32a3c2==='\x5c'||_0x32a3c2===':'){_0x4be16e=_0x4be16e[_0x821f('0x75')](0x0,_0x4be16e['lastIndexOf'](_0x32a3c2));}if(!_0x53083f[_0x821f('0x68')]){throw new Error('Refresh\x20Token\x20not\x20available\x20for\x20the\x20account');}return getAccessToken(_0x53083f);})[_0x821f('0x20')](function(_0xd5b8b8){if(_0xd5b8b8){return rp({'method':_0x821f('0x76'),'uri':util[_0x821f('0x77')](_0x821f('0x78'),_0x48da40),'qs':{'module':'Calls'},'headers':{'Authorization':'Zoho-oauthtoken\x20'+_0xd5b8b8},'json':!![]});}})[_0x821f('0x20')](function(_0x2f7d60){if(_0x2f7d60){if(_0x2f7d60[_0x821f('0x79')]&&_0x2f7d60[_0x821f('0x79')][_0x821f('0x25')]){throw new Error(_0x2f7d60[_0x821f('0x79')][_0x821f('0x25')][_0x821f('0x27')]);}var _0x5d6505=[];var _0x1bd77e=[];var _0x44ee0a=[_0x821f('0x7a'),_0x821f('0x7b'),_0x821f('0x7c'),_0x821f('0x7d'),'Call_Duration',_0x821f('0x7e'),_0x821f('0x7f'),_0x821f('0x80')];_0x1bd77e=_[_0x821f('0x81')](_0x2f7d60['fields'],function(_0x500758){return _0x44ee0a[_0x821f('0x82')](_0x500758[_0x821f('0x83')]);});for(var _0x5af55f=0x0;_0x5af55f<_0x1bd77e['length'];_0x5af55f++){if(_0x1bd77e[_0x5af55f][_0x821f('0x84')]===![]){_0x5d6505[_0x821f('0x85')]({'id':_0x1bd77e[_0x5af55f]['id'],'name':_0x1bd77e[_0x5af55f][_0x821f('0x86')],'custom':_0x1bd77e[_0x5af55f][_0x821f('0x87')],'options':_0x1bd77e[_0x5af55f][_0x821f('0x88')]===_0x821f('0x89')&&_0x1bd77e[_0x5af55f][_0x821f('0x8a')][_0x821f('0x40')]>-0x1?_[_0x821f('0x35')](_0x1bd77e[_0x5af55f][_0x821f('0x8a')],function(_0x2e0f99){return{'name':_0x2e0f99,'value':_0x2e0f99};}):[]});}}return{'count':_0x5d6505['length'],'rows':_0x5d6505};}else{return{'count':0x0,'rows':[]};}})[_0x821f('0x20')](respondWithResult(_0x1bf6be,null))[_0x821f('0x52')](function(_0xe89099){var _0x5688bc=_0x506989[_0x821f('0x3a')][_0x821f('0x1c')]?0x1f4:_0xe89099[_0x821f('0x8b')]||0x1f4;logger[_0x821f('0x25')](_0x821f('0x8c'),_0x821f('0x6d'),_0x5688bc,JSON['stringify'](_0xe89099));delete _0xe89099['name'];if(_0x5688bc===0x191){_0x5688bc=0x190;}_0x1bf6be[_0x821f('0x2a')](_0x5688bc)[_0x821f('0x34')](_0x506989[_0x821f('0x3a')][_0x821f('0x1c')]?{'message':_0x821f('0x8d'),'statusCode':_0xe89099['statusCode']}:_0xe89099);});};
\ No newline at end of file
diff --git a/server/api/intZohoAccount/intZohoAccount.model.js b/server/api/intZohoAccount/intZohoAccount.model.js
index b3bd41e..0d1cc23 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 _0x8f88=['ZohoAccount','int_zoho_accounts','changed','zone','serverUrl','clientId','code','slice','lastIndexOf','https://accounts.zoho.in','https://accounts.zoho.com.cn','https://accounts.zoho.eu','POST','/oauth/v2/token','authorization_code','clientSecret','application/x-www-form-urlencoded','then','parse','refresh_token','refreshToken','info','ZohoAccount,\x20Refresh\x20token\x20successfully\x20generated\x20for\x20account\x20\x22%s\x22\x20#%d','name','error','format','inspect','catch','ZohoAccount,\x20Unable\x20to\x20generate\x20the\x20refresh\x20token\x20for\x20account\x20\x22%s\x22\x20#%d','substring','https://accounts.zoho.com.au','../../config/logger','api','moment','bluebird','path','rimraf','../../components/integrations/configuration','exports','define'];(function(_0x1cf212,_0x575c3a){var _0x495513=function(_0x5495b1){while(--_0x5495b1){_0x1cf212['push'](_0x1cf212['shift']());}};_0x495513(++_0x575c3a);}(_0x8f88,0x10f));var _0x88f8=function(_0x5a5aca,_0x368fbb){_0x5a5aca=_0x5a5aca-0x0;var _0x1cb523=_0x8f88[_0x5a5aca];return _0x1cb523;};'use strict';var _=require('lodash');var util=require('util');var logger=require(_0x88f8('0x0'))(_0x88f8('0x1'));var moment=require(_0x88f8('0x2'));var BPromise=require(_0x88f8('0x3'));var rp=require('request-promise');var fs=require('fs');var path=require(_0x88f8('0x4'));var rimraf=require(_0x88f8('0x5'));var config=require('../../config/environment');var attributes=require('./intZohoAccount.attributes');var integrations=require(_0x88f8('0x6'));module[_0x88f8('0x7')]=function(_0xbc0cb4,_0xb9a7de){return _0xbc0cb4[_0x88f8('0x8')](_0x88f8('0x9'),attributes,{'tableName':_0x88f8('0xa'),'paranoid':![],'indexes':[],'timestamps':!![],'hooks':{'beforeCreate':function(_0x555fd4,_0xc44ec,_0x189fc4){if(_0x555fd4[_0x88f8('0xb')](_0x88f8('0xc'))||_0x555fd4[_0x88f8('0xb')](_0x88f8('0xd'))||_0x555fd4[_0x88f8('0xb')](_0x88f8('0xe'))||_0x555fd4[_0x88f8('0xb')]('clientSecret')||_0x555fd4[_0x88f8('0xb')](_0x88f8('0xf'))||_0x555fd4[_0x88f8('0xb')]('host')){var _0x2ef8e8,_0xa72f4e;_0x2ef8e8=_0x555fd4['serverUrl'];var _0x133e30=_0x2ef8e8[_0x88f8('0x10')](-0x1);if(_0x133e30==='/'||_0x133e30==='\x5c'||_0x133e30===':'){_0x2ef8e8=_0x2ef8e8['substring'](0x0,_0x2ef8e8[_0x88f8('0x11')](_0x133e30));}switch(_0x555fd4[_0x88f8('0xc')]){case'US':_0xa72f4e='https://accounts.zoho.com';break;case'AU':_0xa72f4e='https://accounts.zoho.com.au';break;case'IN':_0xa72f4e=_0x88f8('0x12');break;case'CN':_0xa72f4e=_0x88f8('0x13');break;default:_0xa72f4e=_0x88f8('0x14');break;}var _0x5ebcac={'method':_0x88f8('0x15'),'uri':_0xa72f4e+_0x88f8('0x16'),'form':{'grant_type':_0x88f8('0x17'),'client_id':_0x555fd4['clientId'],'client_secret':_0x555fd4[_0x88f8('0x18')],'redirect_uri':_0x555fd4['serverUrl'],'code':_0x555fd4['code']},'headers':{'Content-Type':_0x88f8('0x19')}};return rp(_0x5ebcac)[_0x88f8('0x1a')](function(_0x11d61c){var _0x422537=JSON[_0x88f8('0x1b')](_0x11d61c);if(_0x422537[_0x88f8('0x1c')]){_0x555fd4[_0x88f8('0x1d')]=_0x422537[_0x88f8('0x1c')];logger[_0x88f8('0x1e')](util['format'](_0x88f8('0x1f'),_0x555fd4[_0x88f8('0x20')],_0x555fd4['id']));}else{logger[_0x88f8('0x21')](util[_0x88f8('0x22')]('ZohoAccount,\x20Unable\x20to\x20generate\x20the\x20refresh\x20token\x20for\x20account\x20\x22%s\x22\x20#%d',_0x555fd4['name'],_0x555fd4['id']),util[_0x88f8('0x23')](_0x422537,{'showHidden':![],'depth':null}));}return _0x189fc4(null,_0xc44ec);})[_0x88f8('0x24')](function(_0x35ecfd){logger['error'](util[_0x88f8('0x22')](_0x88f8('0x25'),_0x555fd4[_0x88f8('0x20')],_0x555fd4['id']),util[_0x88f8('0x23')](parsedResult,{'showHidden':![],'depth':null}));return _0x189fc4(_0x35ecfd);});}else{return _0x189fc4(null,_0xc44ec);}},'beforeUpdate':function(_0x57e77e,_0x1bbc3c,_0x58aba5){if(_0x57e77e[_0x88f8('0xb')]('zone')||_0x57e77e[_0x88f8('0xb')](_0x88f8('0xd'))||_0x57e77e[_0x88f8('0xb')]('clientId')||_0x57e77e[_0x88f8('0xb')](_0x88f8('0x18'))||_0x57e77e[_0x88f8('0xb')](_0x88f8('0xf'))||_0x57e77e[_0x88f8('0xb')]('host')){var _0xf3bf0e,_0x369a8a;_0xf3bf0e=_0x57e77e[_0x88f8('0xd')];var _0x28402f=_0xf3bf0e[_0x88f8('0x10')](-0x1);if(_0x28402f==='/'||_0x28402f==='\x5c'||_0x28402f===':'){_0xf3bf0e=_0xf3bf0e[_0x88f8('0x26')](0x0,_0xf3bf0e[_0x88f8('0x11')](_0x28402f));}switch(_0x57e77e['zone']){case'US':_0x369a8a='https://accounts.zoho.com';break;case'AU':_0x369a8a=_0x88f8('0x27');break;case'IN':_0x369a8a=_0x88f8('0x12');break;case'CN':_0x369a8a='https://accounts.zoho.com.cn';break;default:_0x369a8a=_0x88f8('0x14');break;}var _0x21c272={'method':_0x88f8('0x15'),'uri':_0x369a8a+_0x88f8('0x16'),'form':{'grant_type':_0x88f8('0x17'),'client_id':_0x57e77e[_0x88f8('0xe')],'client_secret':_0x57e77e[_0x88f8('0x18')],'redirect_uri':_0x57e77e[_0x88f8('0xd')],'code':_0x57e77e[_0x88f8('0xf')]},'headers':{'Content-Type':'application/x-www-form-urlencoded'}};return rp(_0x21c272)[_0x88f8('0x1a')](function(_0x5247f4){var _0x24c7cf=JSON['parse'](_0x5247f4);if(_0x24c7cf[_0x88f8('0x1c')]){_0x57e77e['refreshToken']=_0x24c7cf[_0x88f8('0x1c')];logger['info'](util[_0x88f8('0x22')](_0x88f8('0x1f'),_0x57e77e['name'],_0x57e77e['id']));}else{logger[_0x88f8('0x21')](util[_0x88f8('0x22')]('ZohoAccount,\x20Unable\x20to\x20generate\x20the\x20refresh\x20token\x20for\x20account\x20\x22%s\x22\x20#%d',_0x57e77e[_0x88f8('0x20')],_0x57e77e['id']),util['inspect'](_0x24c7cf,{'showHidden':![],'depth':null}));}return _0x58aba5(null,_0x1bbc3c);})['catch'](function(_0x125538){logger[_0x88f8('0x21')](util[_0x88f8('0x22')](_0x88f8('0x25'),_0x57e77e['name'],_0x57e77e['id']),util[_0x88f8('0x23')](parsedResult,{'showHidden':![],'depth':null}));return _0x58aba5(_0x125538);});}else{return _0x58aba5(null,_0x1bbc3c);}}}});};
\ No newline at end of file
+var _0x7b11=['serverUrl','clientId','clientSecret','code','host','slice','substring','https://accounts.zoho.com','https://accounts.zoho.com.au','https://accounts.zoho.in','https://accounts.zoho.com.cn','https://accounts.zoho.eu','POST','/oauth/v2/token','authorization_code','application/x-www-form-urlencoded','then','refresh_token','refreshToken','info','format','ZohoAccount,\x20Refresh\x20token\x20successfully\x20generated\x20for\x20account\x20\x22%s\x22\x20#%d','name','ZohoAccount,\x20Unable\x20to\x20generate\x20the\x20refresh\x20token\x20for\x20account\x20\x22%s\x22\x20#%d','inspect','error','parse','catch','lodash','util','../../config/logger','api','moment','bluebird','request-promise','../../config/environment','./intZohoAccount.attributes','../../components/integrations/configuration','define','ZohoAccount','int_zoho_accounts','zone','changed'];(function(_0x357e3d,_0x203266){var _0x2e3754=function(_0x46347a){while(--_0x46347a){_0x357e3d['push'](_0x357e3d['shift']());}};_0x2e3754(++_0x203266);}(_0x7b11,0x19f));var _0x17b1=function(_0x2b81fd,_0x6d1870){_0x2b81fd=_0x2b81fd-0x0;var _0x530475=_0x7b11[_0x2b81fd];return _0x530475;};'use strict';var _=require(_0x17b1('0x0'));var util=require(_0x17b1('0x1'));var logger=require(_0x17b1('0x2'))(_0x17b1('0x3'));var moment=require(_0x17b1('0x4'));var BPromise=require(_0x17b1('0x5'));var rp=require(_0x17b1('0x6'));var fs=require('fs');var path=require('path');var rimraf=require('rimraf');var config=require(_0x17b1('0x7'));var attributes=require(_0x17b1('0x8'));var integrations=require(_0x17b1('0x9'));module['exports']=function(_0xa0836,_0x4e8b61){return _0xa0836[_0x17b1('0xa')](_0x17b1('0xb'),attributes,{'tableName':_0x17b1('0xc'),'paranoid':![],'indexes':[],'timestamps':!![],'hooks':{'beforeCreate':function(_0x58b9cb,_0x17fda4,_0x16beca){if(_0x58b9cb['changed'](_0x17b1('0xd'))||_0x58b9cb[_0x17b1('0xe')](_0x17b1('0xf'))||_0x58b9cb[_0x17b1('0xe')](_0x17b1('0x10'))||_0x58b9cb[_0x17b1('0xe')](_0x17b1('0x11'))||_0x58b9cb[_0x17b1('0xe')](_0x17b1('0x12'))||_0x58b9cb[_0x17b1('0xe')](_0x17b1('0x13'))){var _0x50bc88,_0x13d803;_0x50bc88=_0x58b9cb['serverUrl'];var _0x3ca8d6=_0x50bc88[_0x17b1('0x14')](-0x1);if(_0x3ca8d6==='/'||_0x3ca8d6==='\x5c'||_0x3ca8d6===':'){_0x50bc88=_0x50bc88[_0x17b1('0x15')](0x0,_0x50bc88['lastIndexOf'](_0x3ca8d6));}switch(_0x58b9cb['zone']){case'US':_0x13d803=_0x17b1('0x16');break;case'AU':_0x13d803=_0x17b1('0x17');break;case'IN':_0x13d803=_0x17b1('0x18');break;case'CN':_0x13d803=_0x17b1('0x19');break;default:_0x13d803=_0x17b1('0x1a');break;}var _0x29d3f1={'method':_0x17b1('0x1b'),'uri':_0x13d803+_0x17b1('0x1c'),'form':{'grant_type':_0x17b1('0x1d'),'client_id':_0x58b9cb[_0x17b1('0x10')],'client_secret':_0x58b9cb[_0x17b1('0x11')],'redirect_uri':_0x58b9cb[_0x17b1('0xf')],'code':_0x58b9cb[_0x17b1('0x12')]},'headers':{'Content-Type':_0x17b1('0x1e')}};return rp(_0x29d3f1)[_0x17b1('0x1f')](function(_0x51c3f5){var _0x3a2ef4=JSON['parse'](_0x51c3f5);if(_0x3a2ef4[_0x17b1('0x20')]){_0x58b9cb[_0x17b1('0x21')]=_0x3a2ef4[_0x17b1('0x20')];logger[_0x17b1('0x22')](util[_0x17b1('0x23')](_0x17b1('0x24'),_0x58b9cb[_0x17b1('0x25')],_0x58b9cb['id']));}else{logger['error'](util[_0x17b1('0x23')](_0x17b1('0x26'),_0x58b9cb[_0x17b1('0x25')],_0x58b9cb['id']),util[_0x17b1('0x27')](_0x3a2ef4,{'showHidden':![],'depth':null}));}return _0x16beca(null,_0x17fda4);})['catch'](function(_0x46fa95){logger[_0x17b1('0x28')](util[_0x17b1('0x23')](_0x17b1('0x26'),_0x58b9cb['name'],_0x58b9cb['id']),util[_0x17b1('0x27')](parsedResult,{'showHidden':![],'depth':null}));return _0x16beca(_0x46fa95);});}else{return _0x16beca(null,_0x17fda4);}},'beforeUpdate':function(_0x5af52e,_0x467f40,_0x47eee9){if(_0x5af52e[_0x17b1('0xe')](_0x17b1('0xd'))||_0x5af52e[_0x17b1('0xe')]('serverUrl')||_0x5af52e[_0x17b1('0xe')]('clientId')||_0x5af52e[_0x17b1('0xe')](_0x17b1('0x11'))||_0x5af52e[_0x17b1('0xe')](_0x17b1('0x12'))||_0x5af52e[_0x17b1('0xe')](_0x17b1('0x13'))){var _0x5b814f,_0xfdf978;_0x5b814f=_0x5af52e['serverUrl'];var _0x3aa8fc=_0x5b814f[_0x17b1('0x14')](-0x1);if(_0x3aa8fc==='/'||_0x3aa8fc==='\x5c'||_0x3aa8fc===':'){_0x5b814f=_0x5b814f[_0x17b1('0x15')](0x0,_0x5b814f['lastIndexOf'](_0x3aa8fc));}switch(_0x5af52e[_0x17b1('0xd')]){case'US':_0xfdf978='https://accounts.zoho.com';break;case'AU':_0xfdf978=_0x17b1('0x17');break;case'IN':_0xfdf978=_0x17b1('0x18');break;case'CN':_0xfdf978=_0x17b1('0x19');break;default:_0xfdf978='https://accounts.zoho.eu';break;}var _0x51efc2={'method':_0x17b1('0x1b'),'uri':_0xfdf978+'/oauth/v2/token','form':{'grant_type':_0x17b1('0x1d'),'client_id':_0x5af52e[_0x17b1('0x10')],'client_secret':_0x5af52e[_0x17b1('0x11')],'redirect_uri':_0x5af52e[_0x17b1('0xf')],'code':_0x5af52e[_0x17b1('0x12')]},'headers':{'Content-Type':'application/x-www-form-urlencoded'}};return rp(_0x51efc2)[_0x17b1('0x1f')](function(_0x1cb737){var _0x4b8d83=JSON[_0x17b1('0x29')](_0x1cb737);if(_0x4b8d83['refresh_token']){_0x5af52e[_0x17b1('0x21')]=_0x4b8d83[_0x17b1('0x20')];logger[_0x17b1('0x22')](util[_0x17b1('0x23')](_0x17b1('0x24'),_0x5af52e[_0x17b1('0x25')],_0x5af52e['id']));}else{logger[_0x17b1('0x28')](util[_0x17b1('0x23')](_0x17b1('0x26'),_0x5af52e[_0x17b1('0x25')],_0x5af52e['id']),util['inspect'](_0x4b8d83,{'showHidden':![],'depth':null}));}return _0x47eee9(null,_0x467f40);})[_0x17b1('0x2a')](function(_0x5c7643){logger[_0x17b1('0x28')](util[_0x17b1('0x23')](_0x17b1('0x26'),_0x5af52e[_0x17b1('0x25')],_0x5af52e['id']),util[_0x17b1('0x27')](parsedResult,{'showHidden':![],'depth':null}));return _0x47eee9(_0x5c7643);});}else{return _0x47eee9(null,_0x467f40);}}}});};
\ No newline at end of file
diff --git a/server/api/intZohoAccount/intZohoAccount.rpc.js b/server/api/intZohoAccount/intZohoAccount.rpc.js
index e4c48e8..2d3a0d3 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 _0xc373=['util','moment','bluebird','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','request','then','info','debug','ZohoAccount,\x20%s,\x20%s,\x20%s','request\x20sent','stringify','error','code','ZohoAccount,\x20%s,\x20%s','message','result','catch','ZohoAccount','findAll','options','raw','where','attributes','limit','map','include','model','GetZohoAccount','find','ShowZohoAccount'];(function(_0x31e29a,_0x349c9b){var _0x32d892=function(_0x41cc86){while(--_0x41cc86){_0x31e29a['push'](_0x31e29a['shift']());}};_0x32d892(++_0x349c9b);}(_0xc373,0x1c7));var _0x3c37=function(_0x5f08a6,_0x400121){_0x5f08a6=_0x5f08a6-0x0;var _0x5d0641=_0xc373[_0x5f08a6];return _0x5d0641;};'use strict';var _=require('lodash');var util=require(_0x3c37('0x0'));var moment=require(_0x3c37('0x1'));var BPromise=require(_0x3c37('0x2'));var rs=require('randomstring');var fs=require('fs');var Redis=require('ioredis');var db=require(_0x3c37('0x3'))['db'];var utils=require(_0x3c37('0x4'));var logger=require(_0x3c37('0x5'))(_0x3c37('0x6'));var config=require(_0x3c37('0x7'));var jayson=require(_0x3c37('0x8'));var client=jayson['client']['http']({'port':0x232a});function respondWithRpcPromise(_0x2e1941,_0x1244e6,_0x14b09d){return new BPromise(function(_0x10617,_0x465de6){return client[_0x3c37('0x9')](_0x2e1941,_0x14b09d)[_0x3c37('0xa')](function(_0x59d4f9){logger[_0x3c37('0xb')]('ZohoAccount,\x20%s,\x20%s',_0x1244e6,'request\x20sent');logger[_0x3c37('0xc')](_0x3c37('0xd'),_0x1244e6,_0x3c37('0xe'),JSON[_0x3c37('0xf')](_0x59d4f9));if(_0x59d4f9[_0x3c37('0x10')]){if(_0x59d4f9[_0x3c37('0x10')][_0x3c37('0x11')]===0x1f4){logger['error'](_0x3c37('0x12'),_0x1244e6,_0x59d4f9[_0x3c37('0x10')][_0x3c37('0x13')]);return _0x465de6(_0x59d4f9['error']['message']);}logger[_0x3c37('0x10')]('ZohoAccount,\x20%s,\x20%s',_0x1244e6,_0x59d4f9['error'][_0x3c37('0x13')]);return _0x10617(_0x59d4f9[_0x3c37('0x10')][_0x3c37('0x13')]);}else{logger[_0x3c37('0xb')](_0x3c37('0x12'),_0x1244e6,_0x3c37('0xe'));_0x10617(_0x59d4f9[_0x3c37('0x14')][_0x3c37('0x13')]);}})[_0x3c37('0x15')](function(_0x4e1560){logger[_0x3c37('0x10')](_0x3c37('0x12'),_0x1244e6,_0x4e1560);_0x465de6(_0x4e1560);});});}exports['GetZohoAccount']=function(_0x55761e){var _0x3ae991=this;return new Promise(function(_0x12a47c,_0x2f3f34){return db[_0x3c37('0x16')][_0x3c37('0x17')]({'raw':_0x55761e[_0x3c37('0x18')]?_0x55761e['options'][_0x3c37('0x19')]===undefined?!![]:![]:!![],'where':_0x55761e['options']?_0x55761e['options'][_0x3c37('0x1a')]||null:null,'attributes':_0x55761e[_0x3c37('0x18')]?_0x55761e[_0x3c37('0x18')][_0x3c37('0x1b')]||null:null,'limit':_0x55761e[_0x3c37('0x18')]?_0x55761e['options'][_0x3c37('0x1c')]||null:null,'include':_0x55761e['options']?_0x55761e[_0x3c37('0x18')]['include']?_[_0x3c37('0x1d')](_0x55761e[_0x3c37('0x18')][_0x3c37('0x1e')],function(_0x574890){return{'model':db[_0x574890['model']],'as':_0x574890['as'],'attributes':_0x574890['attributes'],'include':_0x574890['include']?_['map'](_0x574890[_0x3c37('0x1e')],function(_0xb334d0){return{'model':db[_0xb334d0[_0x3c37('0x1f')]],'as':_0xb334d0['as'],'attributes':_0xb334d0[_0x3c37('0x1b')],'include':_0xb334d0['include']?_['map'](_0xb334d0['include'],function(_0x65ac66){return{'model':db[_0x65ac66[_0x3c37('0x1f')]],'as':_0x65ac66['as'],'attributes':_0x65ac66['attributes']};}):[]};}):[]};}):[]:[]})['then'](function(_0x1ba7e0){logger[_0x3c37('0xb')](_0x3c37('0x20'),_0x55761e);logger[_0x3c37('0xc')](_0x3c37('0x20'),_0x55761e,JSON[_0x3c37('0xf')](_0x1ba7e0));_0x12a47c(_0x1ba7e0);})[_0x3c37('0x15')](function(_0x3abacf){logger[_0x3c37('0x10')](_0x3c37('0x20'),_0x3abacf['message'],_0x55761e);_0x2f3f34(_0x3ae991[_0x3c37('0x10')](0x1f4,_0x3abacf[_0x3c37('0x13')]));});});};exports['ShowZohoAccount']=function(_0x579142){var _0x14936d=this;return new Promise(function(_0x3bc99a,_0x35590b){return db['ZohoAccount'][_0x3c37('0x21')]({'raw':_0x579142['options']?_0x579142[_0x3c37('0x18')][_0x3c37('0x19')]===undefined?!![]:![]:!![],'where':_0x579142[_0x3c37('0x18')]?_0x579142[_0x3c37('0x18')][_0x3c37('0x1a')]||null:null,'attributes':_0x579142[_0x3c37('0x18')]?_0x579142[_0x3c37('0x18')][_0x3c37('0x1b')]||null:null,'include':_0x579142[_0x3c37('0x18')]?_0x579142[_0x3c37('0x18')]['include']?_['map'](_0x579142['options'][_0x3c37('0x1e')],function(_0x4502c2){return{'model':db[_0x4502c2[_0x3c37('0x1f')]],'as':_0x4502c2['as'],'attributes':_0x4502c2[_0x3c37('0x1b')],'include':_0x4502c2[_0x3c37('0x1e')]?_[_0x3c37('0x1d')](_0x4502c2[_0x3c37('0x1e')],function(_0xd72614){return{'model':db[_0xd72614[_0x3c37('0x1f')]],'as':_0xd72614['as'],'attributes':_0xd72614[_0x3c37('0x1b')],'include':_0xd72614[_0x3c37('0x1e')]?_[_0x3c37('0x1d')](_0xd72614['include'],function(_0xecdc5b){return{'model':db[_0xecdc5b[_0x3c37('0x1f')]],'as':_0xecdc5b['as'],'attributes':_0xecdc5b['attributes']};}):[]};}):[]};}):[]:[]})['then'](function(_0x3a3f5b){logger[_0x3c37('0xb')](_0x3c37('0x22'),_0x579142);logger[_0x3c37('0xc')](_0x3c37('0x22'),_0x579142,JSON[_0x3c37('0xf')](_0x3a3f5b));_0x3bc99a(_0x3a3f5b);})[_0x3c37('0x15')](function(_0x12053a){logger[_0x3c37('0x10')]('ShowZohoAccount',_0x12053a[_0x3c37('0x13')],_0x579142);_0x35590b(_0x14936d[_0x3c37('0x10')](0x1f4,_0x12053a[_0x3c37('0x13')]));});});};
\ No newline at end of file
+var _0xc759=['../../config/utils','../../config/logger','jayson/promise','client','request','then','info','ZohoAccount,\x20%s,\x20%s','request\x20sent','ZohoAccount,\x20%s,\x20%s,\x20%s','stringify','error','code','message','result','catch','ZohoAccount','options','raw','where','attributes','limit','map','include','model','GetZohoAccount','ShowZohoAccount','find','util','moment','bluebird','randomstring','../../mysqldb'];(function(_0x584852,_0x3e04c0){var _0x52c10b=function(_0x40c857){while(--_0x40c857){_0x584852['push'](_0x584852['shift']());}};_0x52c10b(++_0x3e04c0);}(_0xc759,0xa0));var _0x9c75=function(_0x2a11c6,_0x6f9869){_0x2a11c6=_0x2a11c6-0x0;var _0x4ca876=_0xc759[_0x2a11c6];return _0x4ca876;};'use strict';var _=require('lodash');var util=require(_0x9c75('0x0'));var moment=require(_0x9c75('0x1'));var BPromise=require(_0x9c75('0x2'));var rs=require(_0x9c75('0x3'));var fs=require('fs');var Redis=require('ioredis');var db=require(_0x9c75('0x4'))['db'];var utils=require(_0x9c75('0x5'));var logger=require(_0x9c75('0x6'))('rpc');var config=require('../../config/environment');var jayson=require(_0x9c75('0x7'));var client=jayson[_0x9c75('0x8')]['http']({'port':0x232a});function respondWithRpcPromise(_0xc6ada5,_0x1bebbf,_0xbc5643){return new BPromise(function(_0x4eaf95,_0x285197){return client[_0x9c75('0x9')](_0xc6ada5,_0xbc5643)[_0x9c75('0xa')](function(_0x53cfe0){logger[_0x9c75('0xb')](_0x9c75('0xc'),_0x1bebbf,_0x9c75('0xd'));logger['debug'](_0x9c75('0xe'),_0x1bebbf,_0x9c75('0xd'),JSON[_0x9c75('0xf')](_0x53cfe0));if(_0x53cfe0[_0x9c75('0x10')]){if(_0x53cfe0[_0x9c75('0x10')][_0x9c75('0x11')]===0x1f4){logger[_0x9c75('0x10')](_0x9c75('0xc'),_0x1bebbf,_0x53cfe0[_0x9c75('0x10')]['message']);return _0x285197(_0x53cfe0[_0x9c75('0x10')][_0x9c75('0x12')]);}logger[_0x9c75('0x10')]('ZohoAccount,\x20%s,\x20%s',_0x1bebbf,_0x53cfe0[_0x9c75('0x10')][_0x9c75('0x12')]);return _0x4eaf95(_0x53cfe0['error'][_0x9c75('0x12')]);}else{logger[_0x9c75('0xb')](_0x9c75('0xc'),_0x1bebbf,_0x9c75('0xd'));_0x4eaf95(_0x53cfe0[_0x9c75('0x13')][_0x9c75('0x12')]);}})[_0x9c75('0x14')](function(_0x84ce10){logger[_0x9c75('0x10')](_0x9c75('0xc'),_0x1bebbf,_0x84ce10);_0x285197(_0x84ce10);});});}exports['GetZohoAccount']=function(_0x25b870){var _0x1b87d5=this;return new Promise(function(_0x4cc6a1,_0x545977){return db[_0x9c75('0x15')]['findAll']({'raw':_0x25b870[_0x9c75('0x16')]?_0x25b870[_0x9c75('0x16')][_0x9c75('0x17')]===undefined?!![]:![]:!![],'where':_0x25b870[_0x9c75('0x16')]?_0x25b870[_0x9c75('0x16')][_0x9c75('0x18')]||null:null,'attributes':_0x25b870[_0x9c75('0x16')]?_0x25b870[_0x9c75('0x16')][_0x9c75('0x19')]||null:null,'limit':_0x25b870['options']?_0x25b870[_0x9c75('0x16')][_0x9c75('0x1a')]||null:null,'include':_0x25b870['options']?_0x25b870[_0x9c75('0x16')]['include']?_[_0x9c75('0x1b')](_0x25b870['options'][_0x9c75('0x1c')],function(_0x4c5e46){return{'model':db[_0x4c5e46[_0x9c75('0x1d')]],'as':_0x4c5e46['as'],'attributes':_0x4c5e46['attributes'],'include':_0x4c5e46[_0x9c75('0x1c')]?_[_0x9c75('0x1b')](_0x4c5e46['include'],function(_0x13e2fc){return{'model':db[_0x13e2fc[_0x9c75('0x1d')]],'as':_0x13e2fc['as'],'attributes':_0x13e2fc['attributes'],'include':_0x13e2fc[_0x9c75('0x1c')]?_[_0x9c75('0x1b')](_0x13e2fc[_0x9c75('0x1c')],function(_0x32751f){return{'model':db[_0x32751f['model']],'as':_0x32751f['as'],'attributes':_0x32751f['attributes']};}):[]};}):[]};}):[]:[]})[_0x9c75('0xa')](function(_0xfa3453){logger[_0x9c75('0xb')]('GetZohoAccount',_0x25b870);logger['debug'](_0x9c75('0x1e'),_0x25b870,JSON[_0x9c75('0xf')](_0xfa3453));_0x4cc6a1(_0xfa3453);})[_0x9c75('0x14')](function(_0x5b4dee){logger[_0x9c75('0x10')](_0x9c75('0x1e'),_0x5b4dee[_0x9c75('0x12')],_0x25b870);_0x545977(_0x1b87d5[_0x9c75('0x10')](0x1f4,_0x5b4dee[_0x9c75('0x12')]));});});};exports[_0x9c75('0x1f')]=function(_0x227766){var _0x35df08=this;return new Promise(function(_0x205435,_0x367aca){return db[_0x9c75('0x15')][_0x9c75('0x20')]({'raw':_0x227766[_0x9c75('0x16')]?_0x227766['options'][_0x9c75('0x17')]===undefined?!![]:![]:!![],'where':_0x227766[_0x9c75('0x16')]?_0x227766[_0x9c75('0x16')]['where']||null:null,'attributes':_0x227766[_0x9c75('0x16')]?_0x227766[_0x9c75('0x16')][_0x9c75('0x19')]||null:null,'include':_0x227766[_0x9c75('0x16')]?_0x227766['options'][_0x9c75('0x1c')]?_[_0x9c75('0x1b')](_0x227766[_0x9c75('0x16')][_0x9c75('0x1c')],function(_0x3916ed){return{'model':db[_0x3916ed[_0x9c75('0x1d')]],'as':_0x3916ed['as'],'attributes':_0x3916ed['attributes'],'include':_0x3916ed[_0x9c75('0x1c')]?_[_0x9c75('0x1b')](_0x3916ed[_0x9c75('0x1c')],function(_0x339e14){return{'model':db[_0x339e14[_0x9c75('0x1d')]],'as':_0x339e14['as'],'attributes':_0x339e14[_0x9c75('0x19')],'include':_0x339e14[_0x9c75('0x1c')]?_[_0x9c75('0x1b')](_0x339e14[_0x9c75('0x1c')],function(_0x1a2ca4){return{'model':db[_0x1a2ca4[_0x9c75('0x1d')]],'as':_0x1a2ca4['as'],'attributes':_0x1a2ca4[_0x9c75('0x19')]};}):[]};}):[]};}):[]:[]})[_0x9c75('0xa')](function(_0x1a7c18){logger['info'](_0x9c75('0x1f'),_0x227766);logger['debug'](_0x9c75('0x1f'),_0x227766,JSON[_0x9c75('0xf')](_0x1a7c18));_0x205435(_0x1a7c18);})['catch'](function(_0x7902b1){logger[_0x9c75('0x10')](_0x9c75('0x1f'),_0x7902b1[_0x9c75('0x12')],_0x227766);_0x367aca(_0x35df08[_0x9c75('0x10')](0x1f4,_0x7902b1[_0x9c75('0x12')]));});});};
\ No newline at end of file
diff --git a/server/api/intZohoConfiguration/index.js b/server/api/intZohoConfiguration/index.js
index 0edf5d9..35235e3 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 _0xd0a4=['Router','../../components/auth/service','../../components/interaction/service','../../config/environment','./intZohoConfiguration.controller','get','isAuthenticated','index','show','getFields','/:id/subjects','getSubjects','/:id/descriptions','create','put','/:id','destroy','exports','multer','util'];(function(_0x17a337,_0x4a3f87){var _0x51b683=function(_0x4d3151){while(--_0x4d3151){_0x17a337['push'](_0x17a337['shift']());}};_0x51b683(++_0x4a3f87);}(_0xd0a4,0x166));var _0x4d0a=function(_0x3b380d,_0x4bf247){_0x3b380d=_0x3b380d-0x0;var _0x54502b=_0xd0a4[_0x3b380d];return _0x54502b;};'use strict';var multer=require(_0x4d0a('0x0'));var util=require(_0x4d0a('0x1'));var path=require('path');var timeout=require('connect-timeout');var express=require('express');var router=express[_0x4d0a('0x2')]();var auth=require(_0x4d0a('0x3'));var interaction=require(_0x4d0a('0x4'));var config=require(_0x4d0a('0x5'));var controller=require(_0x4d0a('0x6'));router[_0x4d0a('0x7')]('/',auth[_0x4d0a('0x8')](),controller[_0x4d0a('0x9')]);router[_0x4d0a('0x7')]('/:id',auth['isAuthenticated'](),controller[_0x4d0a('0xa')]);router[_0x4d0a('0x7')]('/:id/fields',auth[_0x4d0a('0x8')](),controller[_0x4d0a('0xb')]);router['get'](_0x4d0a('0xc'),auth[_0x4d0a('0x8')](),controller[_0x4d0a('0xd')]);router[_0x4d0a('0x7')](_0x4d0a('0xe'),auth['isAuthenticated'](),controller['getDescriptions']);router['post']('/',auth[_0x4d0a('0x8')](),controller[_0x4d0a('0xf')]);router[_0x4d0a('0x10')]('/:id',auth['isAuthenticated'](),controller['update']);router['delete'](_0x4d0a('0x11'),auth['isAuthenticated'](),controller[_0x4d0a('0x12')]);module[_0x4d0a('0x13')]=router;
\ No newline at end of file
+var _0x317b=['../../components/interaction/service','../../config/environment','./intZohoConfiguration.controller','get','isAuthenticated','index','/:id','/:id/fields','getFields','/:id/subjects','getSubjects','getDescriptions','put','update','exports','multer','util','connect-timeout','express','../../components/auth/service'];(function(_0x3c115b,_0x74b3f4){var _0xfa4fbd=function(_0x4b845e){while(--_0x4b845e){_0x3c115b['push'](_0x3c115b['shift']());}};_0xfa4fbd(++_0x74b3f4);}(_0x317b,0x1c7));var _0xb317=function(_0x6d6811,_0x1d8a45){_0x6d6811=_0x6d6811-0x0;var _0x159843=_0x317b[_0x6d6811];return _0x159843;};'use strict';var multer=require(_0xb317('0x0'));var util=require(_0xb317('0x1'));var path=require('path');var timeout=require(_0xb317('0x2'));var express=require(_0xb317('0x3'));var router=express['Router']();var auth=require(_0xb317('0x4'));var interaction=require(_0xb317('0x5'));var config=require(_0xb317('0x6'));var controller=require(_0xb317('0x7'));router[_0xb317('0x8')]('/',auth[_0xb317('0x9')](),controller[_0xb317('0xa')]);router[_0xb317('0x8')](_0xb317('0xb'),auth[_0xb317('0x9')](),controller['show']);router[_0xb317('0x8')](_0xb317('0xc'),auth['isAuthenticated'](),controller[_0xb317('0xd')]);router[_0xb317('0x8')](_0xb317('0xe'),auth[_0xb317('0x9')](),controller[_0xb317('0xf')]);router[_0xb317('0x8')]('/:id/descriptions',auth[_0xb317('0x9')](),controller[_0xb317('0x10')]);router['post']('/',auth[_0xb317('0x9')](),controller['create']);router[_0xb317('0x11')](_0xb317('0xb'),auth[_0xb317('0x9')](),controller[_0xb317('0x12')]);router['delete'](_0xb317('0xb'),auth['isAuthenticated'](),controller['destroy']);module[_0xb317('0x13')]=router;
\ No newline at end of file
diff --git a/server/api/intZohoConfiguration/intZohoConfiguration.attributes.js b/server/api/intZohoConfiguration/intZohoConfiguration.attributes.js
index c845222..0956c72 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 _0x204b=['ENUM','contact_lead','contact','sequelize','exports','STRING','lead'];(function(_0x2693c6,_0x37d8e1){var _0x12fe0c=function(_0x3f66ab){while(--_0x3f66ab){_0x2693c6['push'](_0x2693c6['shift']());}};_0x12fe0c(++_0x37d8e1);}(_0x204b,0xb2));var _0xb204=function(_0x53ccf2,_0x13cb67){_0x53ccf2=_0x53ccf2-0x0;var _0x5a2964=_0x204b[_0x53ccf2];return _0x5a2964;};'use strict';var Sequelize=require(_0xb204('0x0'));module[_0xb204('0x1')]={'name':{'type':Sequelize[_0xb204('0x2')]},'moduleCreate':{'type':Sequelize['ENUM'](_0xb204('0x3'),'contact','nothing'),'defaultValue':_0xb204('0x3')},'moduleSearch':{'type':Sequelize[_0xb204('0x4')](_0xb204('0x5'),_0xb204('0x6'),_0xb204('0x3')),'defaultValue':'contact_lead'},'description':{'type':Sequelize[_0xb204('0x2')]}};
\ No newline at end of file
+var _0xe55c=['contact_lead','contact','sequelize','exports','STRING','lead','ENUM'];(function(_0x1169f6,_0x16df26){var _0x378991=function(_0x41a4c7){while(--_0x41a4c7){_0x1169f6['push'](_0x1169f6['shift']());}};_0x378991(++_0x16df26);}(_0xe55c,0x19f));var _0xce55=function(_0x1f3b92,_0x1ac036){_0x1f3b92=_0x1f3b92-0x0;var _0x5c4a0d=_0xe55c[_0x1f3b92];return _0x5c4a0d;};'use strict';var Sequelize=require(_0xce55('0x0'));module[_0xce55('0x1')]={'name':{'type':Sequelize[_0xce55('0x2')]},'moduleCreate':{'type':Sequelize['ENUM']('lead','contact','nothing'),'defaultValue':_0xce55('0x3')},'moduleSearch':{'type':Sequelize[_0xce55('0x4')](_0xce55('0x5'),_0xce55('0x6'),_0xce55('0x3')),'defaultValue':_0xce55('0x5')},'description':{'type':Sequelize[_0xce55('0x2')]}};
\ No newline at end of file
diff --git a/server/api/intZohoConfiguration/intZohoConfiguration.controller.js b/server/api/intZohoConfiguration/intZohoConfiguration.controller.js
index 12c4c77..e5dfb21 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 _0x9957=['result','catch','sendStatus','status','end','json','count','offset','set','Content-Range','apply','save','update','name','send','index','ZohoConfiguration','rawAttributes','fieldName','key','model','map','query','keys','filters','intersection','attributes','fields','length','hasOwnProperty','limit','order','pick','filter','where','merge','type','options','includeAll','findAll','rows','show','params','find','create','body','getFields','findOne','ZohoField','sort','nolimit','getSubjects','getDescriptions','html-pdf','eml-format','rimraf','zip-dir','request-promise','moment','bluebird','mustache','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','api','../../config/utils','../../mysqldb','jayson/promise','client','http','Sequelize','ValidationError','The\x20password\x20must\x20be\x20at\x20least\x208\x20characters\x20long\x20and\x20have\x201\x20lowercase\x20character,\x201\x20uppercase\x20character,\x201\x20number\x20and\x201\x20special\x20character\x20~!@#$%^&-_=+[{]}.','then','info','ZohoConfiguration,\x20%s,\x20%s','request\x20sent','debug','stringify','code','error','message'];(function(_0x14b39d,_0x456247){var _0x5f1b91=function(_0x36db6c){while(--_0x36db6c){_0x14b39d['push'](_0x14b39d['shift']());}};_0x5f1b91(++_0x456247);}(_0x9957,0x93));var _0x7995=function(_0x6c993a,_0x5ea3ab){_0x6c993a=_0x6c993a-0x0;var _0x27f547=_0x9957[_0x6c993a];return _0x27f547;};'use strict';var pdf=require(_0x7995('0x0'));var emlformat=require(_0x7995('0x1'));var rimraf=require(_0x7995('0x2'));var zipdir=require(_0x7995('0x3'));var jsonpatch=require('fast-json-patch');var rp=require(_0x7995('0x4'));var moment=require(_0x7995('0x5'));var BPromise=require(_0x7995('0x6'));var Mustache=require(_0x7995('0x7'));var util=require('util');var path=require(_0x7995('0x8'));var sox=require(_0x7995('0x9'));var csv=require(_0x7995('0xa'));var ejs=require(_0x7995('0xb'));var fs=require('fs');var _=require(_0x7995('0xc'));var squel=require(_0x7995('0xd'));var crypto=require('crypto');var jsforce=require(_0x7995('0xe'));var deskjs=require(_0x7995('0xf'));var toCsv=require('to-csv');var querystring=require(_0x7995('0x10'));var Papa=require(_0x7995('0x11'));var Redis=require(_0x7995('0x12'));var authService=require(_0x7995('0x13'));var qs=require(_0x7995('0x14'));var as=require(_0x7995('0x15'));var hardwareService=require(_0x7995('0x16'));var logger=require('../../config/logger')(_0x7995('0x17'));var utils=require(_0x7995('0x18'));var config=require('../../config/environment');var db=require(_0x7995('0x19'))['db'];var jayson=require(_0x7995('0x1a'));var client=jayson[_0x7995('0x1b')][_0x7995('0x1c')]({'port':0x232a});function checkPasswordPattern(_0x281576,_0x23999f,_0x2bbe7a){if(_0x2bbe7a){var _0x4cc004=new RegExp(/(?=.*[a-z])(?=.*[A-Z])(?=.*[0-9])(?=.*[?!@#\$%\^&\*~\-_=+[{\]\}])(?=.{8,})/);if(_0x4cc004['test'](_0x23999f)){return _0x281576;}else{throw new db[(_0x7995('0x1d'))][(_0x7995('0x1e'))](_0x7995('0x1f'));}}else{return _0x281576;}}function respondWithRpcPromise(_0x321ae8,_0x3f1d3e,_0x1a5310,_0x2202ce){return new BPromise(function(_0x41cbf0,_0x5377e5){var _0x2eeacc=_0x2202ce||client;return _0x2eeacc['request'](_0x321ae8,_0x1a5310)[_0x7995('0x20')](function(_0x37f297){logger[_0x7995('0x21')](_0x7995('0x22'),_0x3f1d3e,_0x7995('0x23'));logger[_0x7995('0x24')]('ZohoConfiguration,\x20%s,\x20%s,\x20%s',_0x3f1d3e,'request\x20sent',JSON[_0x7995('0x25')](_0x37f297));if(_0x37f297['error']){if(_0x37f297['error'][_0x7995('0x26')]===0x1f4){logger[_0x7995('0x27')]('ZohoConfiguration,\x20%s,\x20%s',_0x3f1d3e,_0x37f297[_0x7995('0x27')]['message']);return _0x5377e5(_0x37f297['error'][_0x7995('0x28')]);}logger[_0x7995('0x27')](_0x7995('0x22'),_0x3f1d3e,_0x37f297[_0x7995('0x27')][_0x7995('0x28')]);return _0x41cbf0(_0x37f297[_0x7995('0x27')]['message']);}else{logger[_0x7995('0x21')](_0x7995('0x22'),_0x3f1d3e,_0x7995('0x23'));_0x41cbf0(_0x37f297[_0x7995('0x29')][_0x7995('0x28')]);}})[_0x7995('0x2a')](function(_0x475351){logger[_0x7995('0x27')]('ZohoConfiguration,\x20%s,\x20%s',_0x3f1d3e,_0x475351);_0x5377e5(_0x475351);});});}function respondWithStatusCode(_0x39df42,_0x34e70c){_0x34e70c=_0x34e70c||0xcc;return function(_0x401dc3){if(_0x401dc3){return _0x39df42[_0x7995('0x2b')](_0x34e70c);}return _0x39df42[_0x7995('0x2c')](_0x34e70c)[_0x7995('0x2d')]();};}function respondWithResult(_0x56691a,_0x47625f){_0x47625f=_0x47625f||0xc8;return function(_0x5911c3){if(_0x5911c3){return _0x56691a[_0x7995('0x2c')](_0x47625f)[_0x7995('0x2e')](_0x5911c3);}};}function respondWithFilteredResult(_0xf16cc2,_0x132a42){return function(_0x11c1eb){if(_0x11c1eb){var _0x4b6f99=_0x11c1eb[_0x7995('0x2f')],_0x9b2a15=_0x132a42[_0x7995('0x30')],_0x514445=_0x132a42['offset']+_0x132a42['limit'],_0x456a28;if(_0x514445>=_0x4b6f99){_0x514445=_0x4b6f99;_0x456a28=0xc8;}else{_0x456a28=0xce;}_0xf16cc2['status'](_0x456a28);return _0xf16cc2[_0x7995('0x31')](_0x7995('0x32'),_0x9b2a15+'-'+_0x514445+'/'+_0x4b6f99)[_0x7995('0x2e')](_0x11c1eb);}return null;};}function patchUpdates(_0x2b874d){return function(_0x2e3493){try{jsonpatch[_0x7995('0x33')](_0x2e3493,_0x2b874d,!![]);}catch(_0x538841){return BPromise['reject'](_0x538841);}return _0x2e3493[_0x7995('0x34')]();};}function saveUpdates(_0x5524af,_0x553671){return function(_0x3eb566){if(_0x3eb566){return _0x3eb566[_0x7995('0x35')](_0x5524af)[_0x7995('0x20')](function(_0x1f7d27){return _0x1f7d27;});}return null;};}function removeEntity(_0x510841,_0x44309d){return function(_0x33e24e){if(_0x33e24e){return _0x33e24e['destroy']()['then'](function(){_0x510841['status'](0xcc)[_0x7995('0x2d')]();});}};}function handleEntityNotFound(_0x3acfc3,_0x4a176f){return function(_0x3e7020){if(!_0x3e7020){_0x3acfc3['sendStatus'](0x194);}return _0x3e7020;};}function handleError(_0x37917b,_0x1cb058){_0x1cb058=_0x1cb058||0x1f4;return function(_0x177cb4){logger['error'](_0x177cb4['stack']);if(_0x177cb4[_0x7995('0x36')]){delete _0x177cb4['name'];}_0x37917b['status'](_0x1cb058)[_0x7995('0x37')](_0x177cb4);};}exports[_0x7995('0x38')]=function(_0x5212ff,_0x1baa15){var _0x1922b4={},_0x2b772f={},_0x18667c={'count':0x0,'rows':[]};var _0x1e3dbf=_['map'](db[_0x7995('0x39')][_0x7995('0x3a')],function(_0xf612e6){return{'name':_0xf612e6[_0x7995('0x3b')],'type':_0xf612e6['type'][_0x7995('0x3c')]};});_0x2b772f[_0x7995('0x3d')]=_[_0x7995('0x3e')](_0x1e3dbf,_0x7995('0x36'));_0x2b772f[_0x7995('0x3f')]=_[_0x7995('0x40')](_0x5212ff['query']);_0x2b772f[_0x7995('0x41')]=_[_0x7995('0x42')](_0x2b772f[_0x7995('0x3d')],_0x2b772f[_0x7995('0x3f')]);_0x1922b4[_0x7995('0x43')]=_[_0x7995('0x42')](_0x2b772f[_0x7995('0x3d')],qs[_0x7995('0x44')](_0x5212ff[_0x7995('0x3f')][_0x7995('0x44')]));_0x1922b4[_0x7995('0x43')]=_0x1922b4[_0x7995('0x43')][_0x7995('0x45')]?_0x1922b4['attributes']:_0x2b772f['model'];if(!_0x5212ff[_0x7995('0x3f')][_0x7995('0x46')]('nolimit')){_0x1922b4['limit']=qs[_0x7995('0x47')](_0x5212ff['query']['limit']);_0x1922b4[_0x7995('0x30')]=qs[_0x7995('0x30')](_0x5212ff[_0x7995('0x3f')]['offset']);}_0x1922b4[_0x7995('0x48')]=qs['sort'](_0x5212ff[_0x7995('0x3f')]['sort']);_0x1922b4['where']=qs[_0x7995('0x41')](_[_0x7995('0x49')](_0x5212ff[_0x7995('0x3f')],_0x2b772f[_0x7995('0x41')]));if(_0x5212ff['query'][_0x7995('0x4a')]){_0x1922b4[_0x7995('0x4b')]=_[_0x7995('0x4c')](_0x1922b4[_0x7995('0x4b')],{'$or':_['map'](_0x1e3dbf,function(_0x5f28e7){if(_0x5f28e7[_0x7995('0x4d')]!=='VIRTUAL'){var _0x23c41d={};_0x23c41d[_0x5f28e7['name']]={'$like':'%'+_0x5212ff[_0x7995('0x3f')]['filter']+'%'};return _0x23c41d;}})});}_0x1922b4=_[_0x7995('0x4c')]({},_0x1922b4,_0x5212ff[_0x7995('0x4e')]);var _0x4d9245={'where':_0x1922b4[_0x7995('0x4b')]};return db[_0x7995('0x39')][_0x7995('0x2f')](_0x4d9245)[_0x7995('0x20')](function(_0x4c6837){_0x18667c[_0x7995('0x2f')]=_0x4c6837;if(_0x5212ff[_0x7995('0x3f')][_0x7995('0x4f')]){_0x1922b4['include']=[{'all':!![]}];}return db[_0x7995('0x39')][_0x7995('0x50')](_0x1922b4);})[_0x7995('0x20')](function(_0x3d8ae3){_0x18667c[_0x7995('0x51')]=_0x3d8ae3;return _0x18667c;})['then'](respondWithFilteredResult(_0x1baa15,_0x1922b4))[_0x7995('0x2a')](handleError(_0x1baa15,null));};exports[_0x7995('0x52')]=function(_0x5921b9,_0x3d1dbb){var _0x5843ba={'raw':![],'where':{'id':_0x5921b9[_0x7995('0x53')]['id']}},_0x1d87f9={};_0x1d87f9[_0x7995('0x3d')]=_[_0x7995('0x40')](db[_0x7995('0x39')][_0x7995('0x3a')]);_0x1d87f9[_0x7995('0x3f')]=_['keys'](_0x5921b9[_0x7995('0x3f')]);_0x1d87f9[_0x7995('0x41')]=_[_0x7995('0x42')](_0x1d87f9['model'],_0x1d87f9[_0x7995('0x3f')]);_0x5843ba[_0x7995('0x43')]=_[_0x7995('0x42')](_0x1d87f9['model'],qs['fields'](_0x5921b9['query'][_0x7995('0x44')]));_0x5843ba[_0x7995('0x43')]=_0x5843ba['attributes'][_0x7995('0x45')]?_0x5843ba[_0x7995('0x43')]:_0x1d87f9[_0x7995('0x3d')];if(_0x5921b9[_0x7995('0x3f')][_0x7995('0x4f')]){_0x5843ba['include']=[{'all':!![]}];}_0x5843ba=_[_0x7995('0x4c')]({},_0x5843ba,_0x5921b9['options']);return db[_0x7995('0x39')][_0x7995('0x54')](_0x5843ba)[_0x7995('0x20')](handleEntityNotFound(_0x3d1dbb,null))['then'](respondWithResult(_0x3d1dbb,null))['catch'](handleError(_0x3d1dbb,null));};exports['create']=function(_0x563f8e,_0x2e13b0){return db[_0x7995('0x39')][_0x7995('0x55')](_0x563f8e[_0x7995('0x56')],{})[_0x7995('0x20')](respondWithResult(_0x2e13b0,0xc9))[_0x7995('0x2a')](handleError(_0x2e13b0,null));};exports[_0x7995('0x35')]=function(_0xda6ce8,_0x328671){if(_0xda6ce8[_0x7995('0x56')]['id']){delete _0xda6ce8[_0x7995('0x56')]['id'];}return db[_0x7995('0x39')][_0x7995('0x54')]({'where':{'id':_0xda6ce8[_0x7995('0x53')]['id']}})[_0x7995('0x20')](handleEntityNotFound(_0x328671,null))[_0x7995('0x20')](saveUpdates(_0xda6ce8[_0x7995('0x56')],null))[_0x7995('0x20')](respondWithResult(_0x328671,null))[_0x7995('0x2a')](handleError(_0x328671,null));};exports['destroy']=function(_0x56a374,_0x630737){return db[_0x7995('0x39')][_0x7995('0x54')]({'where':{'id':_0x56a374['params']['id']}})['then'](handleEntityNotFound(_0x630737,null))[_0x7995('0x20')](removeEntity(_0x630737,null))[_0x7995('0x2a')](handleError(_0x630737,null));};exports[_0x7995('0x57')]=function(_0x332a85,_0x51c50b,_0x13cd7b){var _0x74ff38={};var _0xef5044={};var _0x33c49c;var _0x502d43;return db['ZohoConfiguration'][_0x7995('0x58')]({'where':{'id':_0x332a85[_0x7995('0x53')]['id']}})[_0x7995('0x20')](handleEntityNotFound(_0x51c50b,null))[_0x7995('0x20')](function(_0x37072){if(_0x37072){_0x33c49c=_0x37072;_0xef5044[_0x7995('0x3d')]=_[_0x7995('0x40')](db[_0x7995('0x59')][_0x7995('0x3a')]);_0xef5044['query']=_[_0x7995('0x40')](_0x332a85[_0x7995('0x3f')]);_0xef5044[_0x7995('0x41')]=_[_0x7995('0x42')](_0xef5044['model'],_0xef5044['query']);_0x74ff38[_0x7995('0x43')]=_[_0x7995('0x42')](_0xef5044['model'],qs[_0x7995('0x44')](_0x332a85[_0x7995('0x3f')][_0x7995('0x44')]));_0x74ff38[_0x7995('0x43')]=_0x74ff38[_0x7995('0x43')]['length']?_0x74ff38[_0x7995('0x43')]:_0xef5044['model'];_0x74ff38[_0x7995('0x48')]=qs[_0x7995('0x5a')](_0x332a85[_0x7995('0x3f')][_0x7995('0x5a')]);_0x74ff38[_0x7995('0x4b')]=qs[_0x7995('0x41')](_[_0x7995('0x49')](_0x332a85[_0x7995('0x3f')],_0xef5044[_0x7995('0x41')]));if(_0x332a85[_0x7995('0x3f')][_0x7995('0x4a')]){_0x74ff38[_0x7995('0x4b')]=_['merge'](_0x74ff38[_0x7995('0x4b')],{'$or':_[_0x7995('0x3e')](_0x74ff38[_0x7995('0x43')],function(_0xc2b660){var _0x2c6548={};_0x2c6548[_0xc2b660]={'$like':'%'+_0x332a85['query']['filter']+'%'};return _0x2c6548;})});}_0x74ff38=_[_0x7995('0x4c')]({},_0x74ff38,_0x332a85[_0x7995('0x4e')]);return _0x33c49c[_0x7995('0x57')](_0x74ff38);}})[_0x7995('0x20')](function(_0x5aa2ec){if(_0x5aa2ec){_0x502d43=_0x5aa2ec[_0x7995('0x45')];if(!_0x332a85['query']['hasOwnProperty'](_0x7995('0x5b'))){_0x74ff38[_0x7995('0x47')]=qs[_0x7995('0x47')](_0x332a85[_0x7995('0x3f')][_0x7995('0x47')]);_0x74ff38[_0x7995('0x30')]=qs[_0x7995('0x30')](_0x332a85[_0x7995('0x3f')][_0x7995('0x30')]);}return _0x33c49c[_0x7995('0x57')](_0x74ff38);}})['then'](function(_0x2dc1f7){if(_0x2dc1f7){return _0x2dc1f7?{'count':_0x502d43,'rows':_0x2dc1f7}:null;}})[_0x7995('0x20')](respondWithResult(_0x51c50b,null))[_0x7995('0x2a')](handleError(_0x51c50b,null));};exports['getSubjects']=function(_0x1fe1cb,_0x1d2f9d,_0x705f0){var _0x3a7d9d={};var _0x3b0d30={};var _0x51ab1e;var _0x550a10;return db[_0x7995('0x39')][_0x7995('0x58')]({'where':{'id':_0x1fe1cb[_0x7995('0x53')]['id']}})[_0x7995('0x20')](handleEntityNotFound(_0x1d2f9d,null))['then'](function(_0x5e8b4c){if(_0x5e8b4c){_0x51ab1e=_0x5e8b4c;_0x3b0d30[_0x7995('0x3d')]=_[_0x7995('0x40')](db[_0x7995('0x59')][_0x7995('0x3a')]);_0x3b0d30['query']=_[_0x7995('0x40')](_0x1fe1cb[_0x7995('0x3f')]);_0x3b0d30['filters']=_['intersection'](_0x3b0d30[_0x7995('0x3d')],_0x3b0d30[_0x7995('0x3f')]);_0x3a7d9d['attributes']=_[_0x7995('0x42')](_0x3b0d30['model'],qs[_0x7995('0x44')](_0x1fe1cb[_0x7995('0x3f')]['fields']));_0x3a7d9d['attributes']=_0x3a7d9d[_0x7995('0x43')]['length']?_0x3a7d9d[_0x7995('0x43')]:_0x3b0d30[_0x7995('0x3d')];_0x3a7d9d[_0x7995('0x48')]=qs[_0x7995('0x5a')](_0x1fe1cb[_0x7995('0x3f')][_0x7995('0x5a')]);_0x3a7d9d[_0x7995('0x4b')]=qs[_0x7995('0x41')](_[_0x7995('0x49')](_0x1fe1cb[_0x7995('0x3f')],_0x3b0d30[_0x7995('0x41')]));if(_0x1fe1cb[_0x7995('0x3f')][_0x7995('0x4a')]){_0x3a7d9d[_0x7995('0x4b')]=_[_0x7995('0x4c')](_0x3a7d9d[_0x7995('0x4b')],{'$or':_[_0x7995('0x3e')](_0x3a7d9d[_0x7995('0x43')],function(_0x2ff7ba){var _0xa2fc8e={};_0xa2fc8e[_0x2ff7ba]={'$like':'%'+_0x1fe1cb[_0x7995('0x3f')][_0x7995('0x4a')]+'%'};return _0xa2fc8e;})});}_0x3a7d9d=_[_0x7995('0x4c')]({},_0x3a7d9d,_0x1fe1cb[_0x7995('0x4e')]);return _0x51ab1e[_0x7995('0x5c')](_0x3a7d9d);}})[_0x7995('0x20')](function(_0x2f7f51){if(_0x2f7f51){_0x550a10=_0x2f7f51[_0x7995('0x45')];if(!_0x1fe1cb['query'][_0x7995('0x46')](_0x7995('0x5b'))){_0x3a7d9d['limit']=qs['limit'](_0x1fe1cb[_0x7995('0x3f')][_0x7995('0x47')]);_0x3a7d9d[_0x7995('0x30')]=qs[_0x7995('0x30')](_0x1fe1cb[_0x7995('0x3f')][_0x7995('0x30')]);}return _0x51ab1e['getSubjects'](_0x3a7d9d);}})[_0x7995('0x20')](function(_0xb68962){if(_0xb68962){return _0xb68962?{'count':_0x550a10,'rows':_0xb68962}:null;}})[_0x7995('0x20')](respondWithResult(_0x1d2f9d,null))[_0x7995('0x2a')](handleError(_0x1d2f9d,null));};exports[_0x7995('0x5d')]=function(_0x3f0bff,_0x151d99,_0xc93dcb){var _0x560095={};var _0x1c8e7d={};var _0x2b8217;var _0x5c04c9;return db['ZohoConfiguration'][_0x7995('0x58')]({'where':{'id':_0x3f0bff[_0x7995('0x53')]['id']}})[_0x7995('0x20')](handleEntityNotFound(_0x151d99,null))[_0x7995('0x20')](function(_0xe42797){if(_0xe42797){_0x2b8217=_0xe42797;_0x1c8e7d['model']=_[_0x7995('0x40')](db[_0x7995('0x59')]['rawAttributes']);_0x1c8e7d[_0x7995('0x3f')]=_[_0x7995('0x40')](_0x3f0bff['query']);_0x1c8e7d[_0x7995('0x41')]=_['intersection'](_0x1c8e7d[_0x7995('0x3d')],_0x1c8e7d[_0x7995('0x3f')]);_0x560095[_0x7995('0x43')]=_[_0x7995('0x42')](_0x1c8e7d[_0x7995('0x3d')],qs['fields'](_0x3f0bff[_0x7995('0x3f')][_0x7995('0x44')]));_0x560095[_0x7995('0x43')]=_0x560095['attributes'][_0x7995('0x45')]?_0x560095[_0x7995('0x43')]:_0x1c8e7d[_0x7995('0x3d')];_0x560095[_0x7995('0x48')]=qs['sort'](_0x3f0bff[_0x7995('0x3f')][_0x7995('0x5a')]);_0x560095[_0x7995('0x4b')]=qs['filters'](_['pick'](_0x3f0bff[_0x7995('0x3f')],_0x1c8e7d[_0x7995('0x41')]));if(_0x3f0bff['query']['filter']){_0x560095[_0x7995('0x4b')]=_[_0x7995('0x4c')](_0x560095[_0x7995('0x4b')],{'$or':_[_0x7995('0x3e')](_0x560095[_0x7995('0x43')],function(_0x551b5e){var _0x56003d={};_0x56003d[_0x551b5e]={'$like':'%'+_0x3f0bff[_0x7995('0x3f')]['filter']+'%'};return _0x56003d;})});}_0x560095=_['merge']({},_0x560095,_0x3f0bff[_0x7995('0x4e')]);return _0x2b8217[_0x7995('0x5d')](_0x560095);}})[_0x7995('0x20')](function(_0x5eb360){if(_0x5eb360){_0x5c04c9=_0x5eb360[_0x7995('0x45')];if(!_0x3f0bff[_0x7995('0x3f')][_0x7995('0x46')](_0x7995('0x5b'))){_0x560095[_0x7995('0x47')]=qs['limit'](_0x3f0bff[_0x7995('0x3f')][_0x7995('0x47')]);_0x560095[_0x7995('0x30')]=qs[_0x7995('0x30')](_0x3f0bff['query'][_0x7995('0x30')]);}return _0x2b8217[_0x7995('0x5d')](_0x560095);}})['then'](function(_0x310272){if(_0x310272){return _0x310272?{'count':_0x5c04c9,'rows':_0x310272}:null;}})[_0x7995('0x20')](respondWithResult(_0x151d99,null))['catch'](handleError(_0x151d99,null));};
\ No newline at end of file
+var _0x008c=['save','update','stack','name','send','index','ZohoConfiguration','rawAttributes','model','query','keys','filters','intersection','attributes','fields','length','hasOwnProperty','nolimit','order','sort','where','type','merge','options','includeAll','include','findAll','rows','params','create','body','find','getFields','findOne','ZohoField','pick','filter','map','getSubjects','getDescriptions','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','../../config/environment','../../mysqldb','jayson/promise','client','http','Sequelize','ValidationError','The\x20password\x20must\x20be\x20at\x20least\x208\x20characters\x20long\x20and\x20have\x201\x20lowercase\x20character,\x201\x20uppercase\x20character,\x201\x20number\x20and\x201\x20special\x20character\x20~!@#$%^&-_=+[{]}.','request','then','debug','ZohoConfiguration,\x20%s,\x20%s,\x20%s','stringify','ZohoConfiguration,\x20%s,\x20%s','error','message','info','request\x20sent','catch','sendStatus','status','end','count','offset','limit','apply','reject'];(function(_0x139120,_0x3766c4){var _0x12e7e5=function(_0x43449e){while(--_0x43449e){_0x139120['push'](_0x139120['shift']());}};_0x12e7e5(++_0x3766c4);}(_0x008c,0x188));var _0xc008=function(_0x1044e5,_0x498e01){_0x1044e5=_0x1044e5-0x0;var _0x5ad0dd=_0x008c[_0x1044e5];return _0x5ad0dd;};'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'];var jayson=require(_0xc008('0x17'));var client=jayson[_0xc008('0x18')][_0xc008('0x19')]({'port':0x232a});function checkPasswordPattern(_0x69726e,_0x593f7a,_0x560e28){if(_0x560e28){var _0x33f44c=new RegExp(/(?=.*[a-z])(?=.*[A-Z])(?=.*[0-9])(?=.*[?!@#\$%\^&\*~\-_=+[{\]\}])(?=.{8,})/);if(_0x33f44c['test'](_0x593f7a)){return _0x69726e;}else{throw new db[(_0xc008('0x1a'))][(_0xc008('0x1b'))](_0xc008('0x1c'));}}else{return _0x69726e;}}function respondWithRpcPromise(_0x339ffc,_0x3f0ecf,_0x5ee00b,_0x5e894e){return new BPromise(function(_0x4bd0f4,_0x11ef38){var _0x15a6ad=_0x5e894e||client;return _0x15a6ad[_0xc008('0x1d')](_0x339ffc,_0x5ee00b)[_0xc008('0x1e')](function(_0x4fe771){logger['info']('ZohoConfiguration,\x20%s,\x20%s',_0x3f0ecf,'request\x20sent');logger[_0xc008('0x1f')](_0xc008('0x20'),_0x3f0ecf,'request\x20sent',JSON[_0xc008('0x21')](_0x4fe771));if(_0x4fe771['error']){if(_0x4fe771['error']['code']===0x1f4){logger['error'](_0xc008('0x22'),_0x3f0ecf,_0x4fe771['error']['message']);return _0x11ef38(_0x4fe771['error']['message']);}logger['error'](_0xc008('0x22'),_0x3f0ecf,_0x4fe771[_0xc008('0x23')][_0xc008('0x24')]);return _0x4bd0f4(_0x4fe771[_0xc008('0x23')][_0xc008('0x24')]);}else{logger[_0xc008('0x25')]('ZohoConfiguration,\x20%s,\x20%s',_0x3f0ecf,_0xc008('0x26'));_0x4bd0f4(_0x4fe771['result']['message']);}})[_0xc008('0x27')](function(_0x36f358){logger[_0xc008('0x23')](_0xc008('0x22'),_0x3f0ecf,_0x36f358);_0x11ef38(_0x36f358);});});}function respondWithStatusCode(_0x5410f5,_0x48582b){_0x48582b=_0x48582b||0xcc;return function(_0x5de1e9){if(_0x5de1e9){return _0x5410f5[_0xc008('0x28')](_0x48582b);}return _0x5410f5[_0xc008('0x29')](_0x48582b)[_0xc008('0x2a')]();};}function respondWithResult(_0x2e31c2,_0x5bebd9){_0x5bebd9=_0x5bebd9||0xc8;return function(_0x5e2aca){if(_0x5e2aca){return _0x2e31c2['status'](_0x5bebd9)['json'](_0x5e2aca);}};}function respondWithFilteredResult(_0x4caaf4,_0x3865c0){return function(_0x29ba43){if(_0x29ba43){var _0x25eae4=_0x29ba43[_0xc008('0x2b')],_0x529961=_0x3865c0[_0xc008('0x2c')],_0x24c14c=_0x3865c0['offset']+_0x3865c0[_0xc008('0x2d')],_0x32390d;if(_0x24c14c>=_0x25eae4){_0x24c14c=_0x25eae4;_0x32390d=0xc8;}else{_0x32390d=0xce;}_0x4caaf4[_0xc008('0x29')](_0x32390d);return _0x4caaf4['set']('Content-Range',_0x529961+'-'+_0x24c14c+'/'+_0x25eae4)['json'](_0x29ba43);}return null;};}function patchUpdates(_0x1032b2){return function(_0x267abd){try{jsonpatch[_0xc008('0x2e')](_0x267abd,_0x1032b2,!![]);}catch(_0x10889f){return BPromise[_0xc008('0x2f')](_0x10889f);}return _0x267abd[_0xc008('0x30')]();};}function saveUpdates(_0x294f97,_0x22d8e8){return function(_0x1fe1e1){if(_0x1fe1e1){return _0x1fe1e1[_0xc008('0x31')](_0x294f97)[_0xc008('0x1e')](function(_0x1ac7c8){return _0x1ac7c8;});}return null;};}function removeEntity(_0x596ee8,_0x334a09){return function(_0x4b7fd4){if(_0x4b7fd4){return _0x4b7fd4['destroy']()[_0xc008('0x1e')](function(){_0x596ee8[_0xc008('0x29')](0xcc)[_0xc008('0x2a')]();});}};}function handleEntityNotFound(_0xca0520,_0xd0e05a){return function(_0x3cd878){if(!_0x3cd878){_0xca0520[_0xc008('0x28')](0x194);}return _0x3cd878;};}function handleError(_0x470e79,_0x29d4b3){_0x29d4b3=_0x29d4b3||0x1f4;return function(_0x4f14d2){logger[_0xc008('0x23')](_0x4f14d2[_0xc008('0x32')]);if(_0x4f14d2[_0xc008('0x33')]){delete _0x4f14d2[_0xc008('0x33')];}_0x470e79[_0xc008('0x29')](_0x29d4b3)[_0xc008('0x34')](_0x4f14d2);};}exports[_0xc008('0x35')]=function(_0x5d0e06,_0x35f360){var _0x21763f={},_0x50e1d4={},_0x399b64={'count':0x0,'rows':[]};var _0x15453c=_['map'](db[_0xc008('0x36')][_0xc008('0x37')],function(_0x280e9b){return{'name':_0x280e9b['fieldName'],'type':_0x280e9b['type']['key']};});_0x50e1d4[_0xc008('0x38')]=_['map'](_0x15453c,_0xc008('0x33'));_0x50e1d4[_0xc008('0x39')]=_[_0xc008('0x3a')](_0x5d0e06[_0xc008('0x39')]);_0x50e1d4[_0xc008('0x3b')]=_[_0xc008('0x3c')](_0x50e1d4[_0xc008('0x38')],_0x50e1d4[_0xc008('0x39')]);_0x21763f[_0xc008('0x3d')]=_[_0xc008('0x3c')](_0x50e1d4[_0xc008('0x38')],qs[_0xc008('0x3e')](_0x5d0e06[_0xc008('0x39')][_0xc008('0x3e')]));_0x21763f['attributes']=_0x21763f[_0xc008('0x3d')][_0xc008('0x3f')]?_0x21763f[_0xc008('0x3d')]:_0x50e1d4[_0xc008('0x38')];if(!_0x5d0e06['query'][_0xc008('0x40')](_0xc008('0x41'))){_0x21763f[_0xc008('0x2d')]=qs[_0xc008('0x2d')](_0x5d0e06[_0xc008('0x39')]['limit']);_0x21763f[_0xc008('0x2c')]=qs[_0xc008('0x2c')](_0x5d0e06[_0xc008('0x39')][_0xc008('0x2c')]);}_0x21763f[_0xc008('0x42')]=qs['sort'](_0x5d0e06[_0xc008('0x39')][_0xc008('0x43')]);_0x21763f[_0xc008('0x44')]=qs[_0xc008('0x3b')](_['pick'](_0x5d0e06[_0xc008('0x39')],_0x50e1d4[_0xc008('0x3b')]));if(_0x5d0e06[_0xc008('0x39')]['filter']){_0x21763f[_0xc008('0x44')]=_['merge'](_0x21763f[_0xc008('0x44')],{'$or':_['map'](_0x15453c,function(_0x46fa8f){if(_0x46fa8f[_0xc008('0x45')]!=='VIRTUAL'){var _0x31007c={};_0x31007c[_0x46fa8f[_0xc008('0x33')]]={'$like':'%'+_0x5d0e06[_0xc008('0x39')]['filter']+'%'};return _0x31007c;}})});}_0x21763f=_[_0xc008('0x46')]({},_0x21763f,_0x5d0e06[_0xc008('0x47')]);var _0x200469={'where':_0x21763f[_0xc008('0x44')]};return db[_0xc008('0x36')][_0xc008('0x2b')](_0x200469)['then'](function(_0x47cafa){_0x399b64['count']=_0x47cafa;if(_0x5d0e06[_0xc008('0x39')][_0xc008('0x48')]){_0x21763f[_0xc008('0x49')]=[{'all':!![]}];}return db[_0xc008('0x36')][_0xc008('0x4a')](_0x21763f);})[_0xc008('0x1e')](function(_0x2cf641){_0x399b64[_0xc008('0x4b')]=_0x2cf641;return _0x399b64;})['then'](respondWithFilteredResult(_0x35f360,_0x21763f))['catch'](handleError(_0x35f360,null));};exports['show']=function(_0x2d5a49,_0x2651cf){var _0x158eae={'raw':![],'where':{'id':_0x2d5a49[_0xc008('0x4c')]['id']}},_0x511383={};_0x511383[_0xc008('0x38')]=_[_0xc008('0x3a')](db[_0xc008('0x36')][_0xc008('0x37')]);_0x511383[_0xc008('0x39')]=_[_0xc008('0x3a')](_0x2d5a49[_0xc008('0x39')]);_0x511383[_0xc008('0x3b')]=_[_0xc008('0x3c')](_0x511383['model'],_0x511383['query']);_0x158eae[_0xc008('0x3d')]=_['intersection'](_0x511383[_0xc008('0x38')],qs[_0xc008('0x3e')](_0x2d5a49[_0xc008('0x39')]['fields']));_0x158eae[_0xc008('0x3d')]=_0x158eae[_0xc008('0x3d')][_0xc008('0x3f')]?_0x158eae[_0xc008('0x3d')]:_0x511383[_0xc008('0x38')];if(_0x2d5a49['query'][_0xc008('0x48')]){_0x158eae[_0xc008('0x49')]=[{'all':!![]}];}_0x158eae=_['merge']({},_0x158eae,_0x2d5a49[_0xc008('0x47')]);return db[_0xc008('0x36')]['find'](_0x158eae)['then'](handleEntityNotFound(_0x2651cf,null))[_0xc008('0x1e')](respondWithResult(_0x2651cf,null))[_0xc008('0x27')](handleError(_0x2651cf,null));};exports[_0xc008('0x4d')]=function(_0x30d0aa,_0x14b6a0){return db['ZohoConfiguration']['create'](_0x30d0aa[_0xc008('0x4e')],{})['then'](respondWithResult(_0x14b6a0,0xc9))[_0xc008('0x27')](handleError(_0x14b6a0,null));};exports[_0xc008('0x31')]=function(_0xf94fcb,_0x2f1105){if(_0xf94fcb[_0xc008('0x4e')]['id']){delete _0xf94fcb[_0xc008('0x4e')]['id'];}return db['ZohoConfiguration'][_0xc008('0x4f')]({'where':{'id':_0xf94fcb[_0xc008('0x4c')]['id']}})[_0xc008('0x1e')](handleEntityNotFound(_0x2f1105,null))[_0xc008('0x1e')](saveUpdates(_0xf94fcb[_0xc008('0x4e')],null))['then'](respondWithResult(_0x2f1105,null))[_0xc008('0x27')](handleError(_0x2f1105,null));};exports['destroy']=function(_0x535e6e,_0x5dbfca){return db[_0xc008('0x36')][_0xc008('0x4f')]({'where':{'id':_0x535e6e[_0xc008('0x4c')]['id']}})['then'](handleEntityNotFound(_0x5dbfca,null))[_0xc008('0x1e')](removeEntity(_0x5dbfca,null))[_0xc008('0x27')](handleError(_0x5dbfca,null));};exports[_0xc008('0x50')]=function(_0x47a58b,_0x3587c3,_0x1092cb){var _0x12ba3f={};var _0x1b5a22={};var _0x5baff1;var _0x4022dd;return db['ZohoConfiguration'][_0xc008('0x51')]({'where':{'id':_0x47a58b[_0xc008('0x4c')]['id']}})[_0xc008('0x1e')](handleEntityNotFound(_0x3587c3,null))[_0xc008('0x1e')](function(_0x192c87){if(_0x192c87){_0x5baff1=_0x192c87;_0x1b5a22[_0xc008('0x38')]=_['keys'](db[_0xc008('0x52')]['rawAttributes']);_0x1b5a22['query']=_[_0xc008('0x3a')](_0x47a58b[_0xc008('0x39')]);_0x1b5a22['filters']=_[_0xc008('0x3c')](_0x1b5a22[_0xc008('0x38')],_0x1b5a22[_0xc008('0x39')]);_0x12ba3f[_0xc008('0x3d')]=_[_0xc008('0x3c')](_0x1b5a22[_0xc008('0x38')],qs[_0xc008('0x3e')](_0x47a58b['query'][_0xc008('0x3e')]));_0x12ba3f[_0xc008('0x3d')]=_0x12ba3f[_0xc008('0x3d')][_0xc008('0x3f')]?_0x12ba3f[_0xc008('0x3d')]:_0x1b5a22[_0xc008('0x38')];_0x12ba3f[_0xc008('0x42')]=qs[_0xc008('0x43')](_0x47a58b[_0xc008('0x39')][_0xc008('0x43')]);_0x12ba3f[_0xc008('0x44')]=qs[_0xc008('0x3b')](_[_0xc008('0x53')](_0x47a58b[_0xc008('0x39')],_0x1b5a22['filters']));if(_0x47a58b[_0xc008('0x39')][_0xc008('0x54')]){_0x12ba3f[_0xc008('0x44')]=_['merge'](_0x12ba3f[_0xc008('0x44')],{'$or':_[_0xc008('0x55')](_0x12ba3f['attributes'],function(_0x53765c){var _0x1a03fd={};_0x1a03fd[_0x53765c]={'$like':'%'+_0x47a58b[_0xc008('0x39')][_0xc008('0x54')]+'%'};return _0x1a03fd;})});}_0x12ba3f=_[_0xc008('0x46')]({},_0x12ba3f,_0x47a58b[_0xc008('0x47')]);return _0x5baff1[_0xc008('0x50')](_0x12ba3f);}})[_0xc008('0x1e')](function(_0x38191e){if(_0x38191e){_0x4022dd=_0x38191e[_0xc008('0x3f')];if(!_0x47a58b[_0xc008('0x39')][_0xc008('0x40')]('nolimit')){_0x12ba3f[_0xc008('0x2d')]=qs[_0xc008('0x2d')](_0x47a58b[_0xc008('0x39')][_0xc008('0x2d')]);_0x12ba3f['offset']=qs[_0xc008('0x2c')](_0x47a58b['query'][_0xc008('0x2c')]);}return _0x5baff1[_0xc008('0x50')](_0x12ba3f);}})[_0xc008('0x1e')](function(_0x4ccffe){if(_0x4ccffe){return _0x4ccffe?{'count':_0x4022dd,'rows':_0x4ccffe}:null;}})[_0xc008('0x1e')](respondWithResult(_0x3587c3,null))[_0xc008('0x27')](handleError(_0x3587c3,null));};exports[_0xc008('0x56')]=function(_0x553f5c,_0x35b28a,_0x539fc8){var _0x50ee03={};var _0xee7a85={};var _0x23012c;var _0x6fe732;return db[_0xc008('0x36')]['findOne']({'where':{'id':_0x553f5c[_0xc008('0x4c')]['id']}})[_0xc008('0x1e')](handleEntityNotFound(_0x35b28a,null))['then'](function(_0x3efb77){if(_0x3efb77){_0x23012c=_0x3efb77;_0xee7a85['model']=_[_0xc008('0x3a')](db['ZohoField'][_0xc008('0x37')]);_0xee7a85['query']=_[_0xc008('0x3a')](_0x553f5c[_0xc008('0x39')]);_0xee7a85[_0xc008('0x3b')]=_[_0xc008('0x3c')](_0xee7a85['model'],_0xee7a85[_0xc008('0x39')]);_0x50ee03[_0xc008('0x3d')]=_[_0xc008('0x3c')](_0xee7a85[_0xc008('0x38')],qs[_0xc008('0x3e')](_0x553f5c[_0xc008('0x39')][_0xc008('0x3e')]));_0x50ee03[_0xc008('0x3d')]=_0x50ee03['attributes'][_0xc008('0x3f')]?_0x50ee03['attributes']:_0xee7a85['model'];_0x50ee03['order']=qs[_0xc008('0x43')](_0x553f5c[_0xc008('0x39')][_0xc008('0x43')]);_0x50ee03[_0xc008('0x44')]=qs[_0xc008('0x3b')](_[_0xc008('0x53')](_0x553f5c[_0xc008('0x39')],_0xee7a85[_0xc008('0x3b')]));if(_0x553f5c[_0xc008('0x39')]['filter']){_0x50ee03[_0xc008('0x44')]=_[_0xc008('0x46')](_0x50ee03[_0xc008('0x44')],{'$or':_[_0xc008('0x55')](_0x50ee03[_0xc008('0x3d')],function(_0x3b2669){var _0x23d4ff={};_0x23d4ff[_0x3b2669]={'$like':'%'+_0x553f5c[_0xc008('0x39')][_0xc008('0x54')]+'%'};return _0x23d4ff;})});}_0x50ee03=_[_0xc008('0x46')]({},_0x50ee03,_0x553f5c[_0xc008('0x47')]);return _0x23012c[_0xc008('0x56')](_0x50ee03);}})['then'](function(_0x4e7af3){if(_0x4e7af3){_0x6fe732=_0x4e7af3[_0xc008('0x3f')];if(!_0x553f5c[_0xc008('0x39')][_0xc008('0x40')]('nolimit')){_0x50ee03[_0xc008('0x2d')]=qs[_0xc008('0x2d')](_0x553f5c['query']['limit']);_0x50ee03['offset']=qs[_0xc008('0x2c')](_0x553f5c[_0xc008('0x39')][_0xc008('0x2c')]);}return _0x23012c[_0xc008('0x56')](_0x50ee03);}})[_0xc008('0x1e')](function(_0x44f515){if(_0x44f515){return _0x44f515?{'count':_0x6fe732,'rows':_0x44f515}:null;}})[_0xc008('0x1e')](respondWithResult(_0x35b28a,null))[_0xc008('0x27')](handleError(_0x35b28a,null));};exports[_0xc008('0x57')]=function(_0x1e7a11,_0x52091b,_0x57b8ad){var _0xc644fe={};var _0x31ebde={};var _0x3f3dcf;var _0x3f1e41;return db[_0xc008('0x36')][_0xc008('0x51')]({'where':{'id':_0x1e7a11['params']['id']}})['then'](handleEntityNotFound(_0x52091b,null))[_0xc008('0x1e')](function(_0x391425){if(_0x391425){_0x3f3dcf=_0x391425;_0x31ebde[_0xc008('0x38')]=_['keys'](db['ZohoField']['rawAttributes']);_0x31ebde['query']=_['keys'](_0x1e7a11['query']);_0x31ebde[_0xc008('0x3b')]=_['intersection'](_0x31ebde[_0xc008('0x38')],_0x31ebde['query']);_0xc644fe[_0xc008('0x3d')]=_[_0xc008('0x3c')](_0x31ebde[_0xc008('0x38')],qs['fields'](_0x1e7a11['query'][_0xc008('0x3e')]));_0xc644fe['attributes']=_0xc644fe[_0xc008('0x3d')][_0xc008('0x3f')]?_0xc644fe['attributes']:_0x31ebde[_0xc008('0x38')];_0xc644fe['order']=qs['sort'](_0x1e7a11[_0xc008('0x39')][_0xc008('0x43')]);_0xc644fe['where']=qs[_0xc008('0x3b')](_[_0xc008('0x53')](_0x1e7a11[_0xc008('0x39')],_0x31ebde['filters']));if(_0x1e7a11[_0xc008('0x39')][_0xc008('0x54')]){_0xc644fe[_0xc008('0x44')]=_[_0xc008('0x46')](_0xc644fe[_0xc008('0x44')],{'$or':_[_0xc008('0x55')](_0xc644fe['attributes'],function(_0x6dfd99){var _0xdaff5b={};_0xdaff5b[_0x6dfd99]={'$like':'%'+_0x1e7a11[_0xc008('0x39')]['filter']+'%'};return _0xdaff5b;})});}_0xc644fe=_[_0xc008('0x46')]({},_0xc644fe,_0x1e7a11[_0xc008('0x47')]);return _0x3f3dcf[_0xc008('0x57')](_0xc644fe);}})['then'](function(_0x48c38b){if(_0x48c38b){_0x3f1e41=_0x48c38b['length'];if(!_0x1e7a11[_0xc008('0x39')][_0xc008('0x40')](_0xc008('0x41'))){_0xc644fe[_0xc008('0x2d')]=qs[_0xc008('0x2d')](_0x1e7a11[_0xc008('0x39')][_0xc008('0x2d')]);_0xc644fe[_0xc008('0x2c')]=qs['offset'](_0x1e7a11[_0xc008('0x39')][_0xc008('0x2c')]);}return _0x3f3dcf['getDescriptions'](_0xc644fe);}})['then'](function(_0x2257b0){if(_0x2257b0){return _0x2257b0?{'count':_0x3f1e41,'rows':_0x2257b0}:null;}})[_0xc008('0x1e')](respondWithResult(_0x52091b,null))[_0xc008('0x27')](handleError(_0x52091b,null));};
\ No newline at end of file
diff --git a/server/api/intZohoConfiguration/intZohoConfiguration.model.js b/server/api/intZohoConfiguration/intZohoConfiguration.model.js
index 3999baf..9c0b530 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 _0xa1da=['bluebird','request-promise','path','./intZohoConfiguration.attributes','exports','int_zoho_configurations','lodash','util','../../config/logger','api','moment'];(function(_0x4ae829,_0x2c842c){var _0x256b31=function(_0x34f104){while(--_0x34f104){_0x4ae829['push'](_0x4ae829['shift']());}};_0x256b31(++_0x2c842c);}(_0xa1da,0xcc));var _0xaa1d=function(_0x3b7bc9,_0x30faed){_0x3b7bc9=_0x3b7bc9-0x0;var _0x457988=_0xa1da[_0x3b7bc9];return _0x457988;};'use strict';var _=require(_0xaa1d('0x0'));var util=require(_0xaa1d('0x1'));var logger=require(_0xaa1d('0x2'))(_0xaa1d('0x3'));var moment=require(_0xaa1d('0x4'));var BPromise=require(_0xaa1d('0x5'));var rp=require(_0xaa1d('0x6'));var fs=require('fs');var path=require(_0xaa1d('0x7'));var rimraf=require('rimraf');var config=require('../../config/environment');var attributes=require(_0xaa1d('0x8'));module[_0xaa1d('0x9')]=function(_0x3e93bd,_0x3e1b2a){return _0x3e93bd['define']('ZohoConfiguration',attributes,{'tableName':_0xaa1d('0xa'),'paranoid':![],'indexes':[],'timestamps':!![]});};
\ No newline at end of file
+var _0xf935=['int_zoho_configurations','util','../../config/logger','api','bluebird','path','rimraf','../../config/environment','./intZohoConfiguration.attributes','exports','define','ZohoConfiguration'];(function(_0x13fe07,_0x54713c){var _0x2f2f66=function(_0x3ea80a){while(--_0x3ea80a){_0x13fe07['push'](_0x13fe07['shift']());}};_0x2f2f66(++_0x54713c);}(_0xf935,0x79));var _0x5f93=function(_0xa464c9,_0x7c86d8){_0xa464c9=_0xa464c9-0x0;var _0x3d73c4=_0xf935[_0xa464c9];return _0x3d73c4;};'use strict';var _=require('lodash');var util=require(_0x5f93('0x0'));var logger=require(_0x5f93('0x1'))(_0x5f93('0x2'));var moment=require('moment');var BPromise=require(_0x5f93('0x3'));var rp=require('request-promise');var fs=require('fs');var path=require(_0x5f93('0x4'));var rimraf=require(_0x5f93('0x5'));var config=require(_0x5f93('0x6'));var attributes=require(_0x5f93('0x7'));module[_0x5f93('0x8')]=function(_0x451ffa,_0x1b80c0){return _0x451ffa[_0x5f93('0x9')](_0x5f93('0xa'),attributes,{'tableName':_0x5f93('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 a5e2cbf..5313e00 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 _0x8a00=['rpc','jayson/promise','client','http','info','ZohoConfiguration,\x20%s,\x20%s','request\x20sent','debug','ZohoConfiguration,\x20%s,\x20%s,\x20%s','stringify','error','code','message','result','lodash','util','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger'];(function(_0x43a6cd,_0x503d1a){var _0x5acb36=function(_0x2dd95e){while(--_0x2dd95e){_0x43a6cd['push'](_0x43a6cd['shift']());}};_0x5acb36(++_0x503d1a);}(_0x8a00,0x81));var _0x08a0=function(_0x4eef6b,_0x13a0ad){_0x4eef6b=_0x4eef6b-0x0;var _0x3c0b50=_0x8a00[_0x4eef6b];return _0x3c0b50;};'use strict';var _=require(_0x08a0('0x0'));var util=require(_0x08a0('0x1'));var moment=require(_0x08a0('0x2'));var BPromise=require(_0x08a0('0x3'));var rs=require(_0x08a0('0x4'));var fs=require('fs');var Redis=require(_0x08a0('0x5'));var db=require(_0x08a0('0x6'))['db'];var utils=require(_0x08a0('0x7'));var logger=require(_0x08a0('0x8'))(_0x08a0('0x9'));var config=require('../../config/environment');var jayson=require(_0x08a0('0xa'));var client=jayson[_0x08a0('0xb')][_0x08a0('0xc')]({'port':0x232a});function respondWithRpcPromise(_0x246947,_0x57152f,_0x4c9acf){return new BPromise(function(_0x4abe0c,_0x24b3c2){return client['request'](_0x246947,_0x4c9acf)['then'](function(_0x2ac961){logger[_0x08a0('0xd')](_0x08a0('0xe'),_0x57152f,_0x08a0('0xf'));logger[_0x08a0('0x10')](_0x08a0('0x11'),_0x57152f,_0x08a0('0xf'),JSON[_0x08a0('0x12')](_0x2ac961));if(_0x2ac961[_0x08a0('0x13')]){if(_0x2ac961['error'][_0x08a0('0x14')]===0x1f4){logger[_0x08a0('0x13')](_0x08a0('0xe'),_0x57152f,_0x2ac961[_0x08a0('0x13')][_0x08a0('0x15')]);return _0x24b3c2(_0x2ac961[_0x08a0('0x13')]['message']);}logger['error'](_0x08a0('0xe'),_0x57152f,_0x2ac961[_0x08a0('0x13')][_0x08a0('0x15')]);return _0x4abe0c(_0x2ac961[_0x08a0('0x13')][_0x08a0('0x15')]);}else{logger[_0x08a0('0xd')]('ZohoConfiguration,\x20%s,\x20%s',_0x57152f,_0x08a0('0xf'));_0x4abe0c(_0x2ac961[_0x08a0('0x16')][_0x08a0('0x15')]);}})['catch'](function(_0x937055){logger[_0x08a0('0x13')]('ZohoConfiguration,\x20%s,\x20%s',_0x57152f,_0x937055);_0x24b3c2(_0x937055);});});}
\ No newline at end of file
+var _0x85fb=['ioredis','../../mysqldb','../../config/logger','jayson/promise','http','request','then','info','ZohoConfiguration,\x20%s,\x20%s','request\x20sent','ZohoConfiguration,\x20%s,\x20%s,\x20%s','stringify','error','code','message','result','util','moment','randomstring'];(function(_0x111e95,_0x4fbaae){var _0x703e9b=function(_0x2177ba){while(--_0x2177ba){_0x111e95['push'](_0x111e95['shift']());}};_0x703e9b(++_0x4fbaae);}(_0x85fb,0xa8));var _0xb85f=function(_0x57b54c,_0x54ce0d){_0x57b54c=_0x57b54c-0x0;var _0x59cc19=_0x85fb[_0x57b54c];return _0x59cc19;};'use strict';var _=require('lodash');var util=require(_0xb85f('0x0'));var moment=require(_0xb85f('0x1'));var BPromise=require('bluebird');var rs=require(_0xb85f('0x2'));var fs=require('fs');var Redis=require(_0xb85f('0x3'));var db=require(_0xb85f('0x4'))['db'];var utils=require('../../config/utils');var logger=require(_0xb85f('0x5'))('rpc');var config=require('../../config/environment');var jayson=require(_0xb85f('0x6'));var client=jayson['client'][_0xb85f('0x7')]({'port':0x232a});function respondWithRpcPromise(_0xa776e9,_0x245922,_0x127343){return new BPromise(function(_0x1b6546,_0x20ea58){return client[_0xb85f('0x8')](_0xa776e9,_0x127343)[_0xb85f('0x9')](function(_0x2ad400){logger[_0xb85f('0xa')](_0xb85f('0xb'),_0x245922,_0xb85f('0xc'));logger['debug'](_0xb85f('0xd'),_0x245922,_0xb85f('0xc'),JSON[_0xb85f('0xe')](_0x2ad400));if(_0x2ad400['error']){if(_0x2ad400[_0xb85f('0xf')][_0xb85f('0x10')]===0x1f4){logger['error'](_0xb85f('0xb'),_0x245922,_0x2ad400[_0xb85f('0xf')][_0xb85f('0x11')]);return _0x20ea58(_0x2ad400[_0xb85f('0xf')][_0xb85f('0x11')]);}logger[_0xb85f('0xf')]('ZohoConfiguration,\x20%s,\x20%s',_0x245922,_0x2ad400[_0xb85f('0xf')][_0xb85f('0x11')]);return _0x1b6546(_0x2ad400['error']['message']);}else{logger[_0xb85f('0xa')](_0xb85f('0xb'),_0x245922,_0xb85f('0xc'));_0x1b6546(_0x2ad400[_0xb85f('0x12')][_0xb85f('0x11')]);}})['catch'](function(_0x425eae){logger[_0xb85f('0xf')](_0xb85f('0xb'),_0x245922,_0x425eae);_0x20ea58(_0x425eae);});});}
\ No newline at end of file
diff --git a/server/api/intZohoField/index.js b/server/api/intZohoField/index.js
index d5fca9d..b4264da 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 _0x1a37=['multer','util','path','connect-timeout','express','Router','../../components/auth/service','../../components/interaction/service','../../config/environment','./intZohoField.controller','isAuthenticated','get','/:id','show','update','delete','destroy','exports'];(function(_0x12cc05,_0x378e9c){var _0x5412ec=function(_0x441bca){while(--_0x441bca){_0x12cc05['push'](_0x12cc05['shift']());}};_0x5412ec(++_0x378e9c);}(_0x1a37,0xb4));var _0x71a3=function(_0x3ab51d,_0x2fa01d){_0x3ab51d=_0x3ab51d-0x0;var _0x29a04e=_0x1a37[_0x3ab51d];return _0x29a04e;};'use strict';var multer=require(_0x71a3('0x0'));var util=require(_0x71a3('0x1'));var path=require(_0x71a3('0x2'));var timeout=require(_0x71a3('0x3'));var express=require(_0x71a3('0x4'));var router=express[_0x71a3('0x5')]();var auth=require(_0x71a3('0x6'));var interaction=require(_0x71a3('0x7'));var config=require(_0x71a3('0x8'));var controller=require(_0x71a3('0x9'));router['get']('/',auth[_0x71a3('0xa')](),controller['index']);router[_0x71a3('0xb')](_0x71a3('0xc'),auth[_0x71a3('0xa')](),controller[_0x71a3('0xd')]);router['post']('/',auth['isAuthenticated'](),controller['create']);router['put'](_0x71a3('0xc'),auth[_0x71a3('0xa')](),controller[_0x71a3('0xe')]);router[_0x71a3('0xf')](_0x71a3('0xc'),auth[_0x71a3('0xa')](),controller[_0x71a3('0x10')]);module[_0x71a3('0x11')]=router;
\ No newline at end of file
+var _0x896e=['isAuthenticated','/:id','show','post','create','put','update','destroy','exports','multer','util','path','connect-timeout','express','Router','../../components/auth/service','../../components/interaction/service','../../config/environment','./intZohoField.controller','get'];(function(_0x482fc8,_0x4d40ce){var _0x1ba080=function(_0x54a809){while(--_0x54a809){_0x482fc8['push'](_0x482fc8['shift']());}};_0x1ba080(++_0x4d40ce);}(_0x896e,0x1e9));var _0xe896=function(_0x8afb57,_0x409ec3){_0x8afb57=_0x8afb57-0x0;var _0x1c7bf6=_0x896e[_0x8afb57];return _0x1c7bf6;};'use strict';var multer=require(_0xe896('0x0'));var util=require(_0xe896('0x1'));var path=require(_0xe896('0x2'));var timeout=require(_0xe896('0x3'));var express=require(_0xe896('0x4'));var router=express[_0xe896('0x5')]();var auth=require(_0xe896('0x6'));var interaction=require(_0xe896('0x7'));var config=require(_0xe896('0x8'));var controller=require(_0xe896('0x9'));router[_0xe896('0xa')]('/',auth[_0xe896('0xb')](),controller['index']);router[_0xe896('0xa')](_0xe896('0xc'),auth[_0xe896('0xb')](),controller[_0xe896('0xd')]);router[_0xe896('0xe')]('/',auth['isAuthenticated'](),controller[_0xe896('0xf')]);router[_0xe896('0x10')](_0xe896('0xc'),auth['isAuthenticated'](),controller[_0xe896('0x11')]);router['delete'](_0xe896('0xc'),auth['isAuthenticated'](),controller[_0xe896('0x12')]);module[_0xe896('0x13')]=router;
\ No newline at end of file
diff --git a/server/api/intZohoField/intZohoField.attributes.js b/server/api/intZohoField/intZohoField.attributes.js
index 93843eb..4a0b1a2 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 _0x884d=['variable','BOOLEAN','sequelize','exports','ENUM','customVariable','keyValue','string','STRING'];(function(_0x53000f,_0x8bf312){var _0x2abb69=function(_0x2501b0){while(--_0x2501b0){_0x53000f['push'](_0x53000f['shift']());}};_0x2abb69(++_0x8bf312);}(_0x884d,0x1b2));var _0xd884=function(_0x9ff99f,_0x403705){_0x9ff99f=_0x9ff99f-0x0;var _0x2ce03a=_0x884d[_0x9ff99f];return _0x2ce03a;};'use strict';var Sequelize=require(_0xd884('0x0'));module[_0xd884('0x1')]={'type':{'type':Sequelize[_0xd884('0x2')]('string','variable',_0xd884('0x3'),_0xd884('0x4')),'defaultValue':_0xd884('0x5')},'content':{'type':Sequelize[_0xd884('0x6')]},'key':{'type':Sequelize[_0xd884('0x6')]},'keyType':{'type':Sequelize[_0xd884('0x2')](_0xd884('0x5'),_0xd884('0x7'),'customVariable')},'keyContent':{'type':Sequelize[_0xd884('0x6')]},'idField':{'type':Sequelize[_0xd884('0x6')]},'nameField':{'type':Sequelize[_0xd884('0x6')]},'customField':{'type':Sequelize[_0xd884('0x8')],'defaultValue':!![]},'variableName':{'type':Sequelize['STRING']}};
\ No newline at end of file
+var _0x8f69=['ENUM','variable','customVariable','keyValue','STRING','string','BOOLEAN','sequelize','exports'];(function(_0x3ad147,_0x1c9fe3){var _0x70dd7c=function(_0x5111a9){while(--_0x5111a9){_0x3ad147['push'](_0x3ad147['shift']());}};_0x70dd7c(++_0x1c9fe3);}(_0x8f69,0xfa));var _0x98f6=function(_0x187279,_0x26d152){_0x187279=_0x187279-0x0;var _0x3da59d=_0x8f69[_0x187279];return _0x3da59d;};'use strict';var Sequelize=require(_0x98f6('0x0'));module[_0x98f6('0x1')]={'type':{'type':Sequelize[_0x98f6('0x2')]('string',_0x98f6('0x3'),_0x98f6('0x4'),_0x98f6('0x5')),'defaultValue':'string'},'content':{'type':Sequelize['STRING']},'key':{'type':Sequelize[_0x98f6('0x6')]},'keyType':{'type':Sequelize['ENUM'](_0x98f6('0x7'),_0x98f6('0x3'),_0x98f6('0x4'))},'keyContent':{'type':Sequelize[_0x98f6('0x6')]},'idField':{'type':Sequelize['STRING']},'nameField':{'type':Sequelize[_0x98f6('0x6')]},'customField':{'type':Sequelize[_0x98f6('0x8')],'defaultValue':!![]},'variableName':{'type':Sequelize[_0x98f6('0x6')]}};
\ No newline at end of file
diff --git a/server/api/intZohoField/intZohoField.controller.js b/server/api/intZohoField/intZohoField.controller.js
index f2618c9..bfbd3e9 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 _0x6920=['../../mysqldb','sendStatus','status','json','count','offset','limit','set','Content-Range','apply','reject','update','destroy','then','end','error','stack','name','send','index','map','ZohoField','fieldName','type','key','keys','query','filters','intersection','model','attributes','fields','length','hasOwnProperty','nolimit','order','sort','pick','filter','where','merge','VIRTUAL','options','includeAll','include','rows','catch','show','params','rawAttributes','find','create','body','html-pdf','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','moment','bluebird','mustache','util','path','to-csv','ejs','lodash','squel','crypto','jsforce','desk.js','querystring','ioredis','../../components/parsers/qs','../../config/license/hardware','api','../../config/utils','../../config/environment'];(function(_0x122ef9,_0x451d2a){var _0x42fba0=function(_0x17c9d3){while(--_0x17c9d3){_0x122ef9['push'](_0x122ef9['shift']());}};_0x42fba0(++_0x451d2a);}(_0x6920,0xd1));var _0x0692=function(_0x179b53,_0x31f6fe){_0x179b53=_0x179b53-0x0;var _0x38a146=_0x6920[_0x179b53];return _0x38a146;};'use strict';var pdf=require(_0x0692('0x0'));var emlformat=require(_0x0692('0x1'));var rimraf=require(_0x0692('0x2'));var zipdir=require(_0x0692('0x3'));var jsonpatch=require(_0x0692('0x4'));var rp=require(_0x0692('0x5'));var moment=require(_0x0692('0x6'));var BPromise=require(_0x0692('0x7'));var Mustache=require(_0x0692('0x8'));var util=require(_0x0692('0x9'));var path=require(_0x0692('0xa'));var sox=require('sox');var csv=require(_0x0692('0xb'));var ejs=require(_0x0692('0xc'));var fs=require('fs');var _=require(_0x0692('0xd'));var squel=require(_0x0692('0xe'));var crypto=require(_0x0692('0xf'));var jsforce=require(_0x0692('0x10'));var deskjs=require(_0x0692('0x11'));var toCsv=require(_0x0692('0xb'));var querystring=require(_0x0692('0x12'));var Papa=require('papaparse');var Redis=require(_0x0692('0x13'));var authService=require('../../components/auth/service');var qs=require(_0x0692('0x14'));var as=require('../../components/parsers/advancedSearch');var hardwareService=require(_0x0692('0x15'));var logger=require('../../config/logger')(_0x0692('0x16'));var utils=require(_0x0692('0x17'));var config=require(_0x0692('0x18'));var db=require(_0x0692('0x19'))['db'];function respondWithStatusCode(_0x431343,_0x30555c){_0x30555c=_0x30555c||0xcc;return function(_0x286609){if(_0x286609){return _0x431343[_0x0692('0x1a')](_0x30555c);}return _0x431343[_0x0692('0x1b')](_0x30555c)['end']();};}function respondWithResult(_0x30bd36,_0x5b5b30){_0x5b5b30=_0x5b5b30||0xc8;return function(_0x1c5d95){if(_0x1c5d95){return _0x30bd36[_0x0692('0x1b')](_0x5b5b30)[_0x0692('0x1c')](_0x1c5d95);}};}function respondWithFilteredResult(_0x11c415,_0x447c15){return function(_0x13dff7){if(_0x13dff7){var _0x5d27fc=_0x13dff7[_0x0692('0x1d')],_0x463514=_0x447c15[_0x0692('0x1e')],_0x2dc630=_0x447c15[_0x0692('0x1e')]+_0x447c15[_0x0692('0x1f')],_0x230be1;if(_0x2dc630>=_0x5d27fc){_0x2dc630=_0x5d27fc;_0x230be1=0xc8;}else{_0x230be1=0xce;}_0x11c415[_0x0692('0x1b')](_0x230be1);return _0x11c415[_0x0692('0x20')](_0x0692('0x21'),_0x463514+'-'+_0x2dc630+'/'+_0x5d27fc)[_0x0692('0x1c')](_0x13dff7);}return null;};}function patchUpdates(_0x10fa39){return function(_0x4a3da0){try{jsonpatch[_0x0692('0x22')](_0x4a3da0,_0x10fa39,!![]);}catch(_0x27b151){return BPromise[_0x0692('0x23')](_0x27b151);}return _0x4a3da0['save']();};}function saveUpdates(_0x15c337,_0x598a89){return function(_0x1361b4){if(_0x1361b4){return _0x1361b4[_0x0692('0x24')](_0x15c337)['then'](function(_0x1aef49){return _0x1aef49;});}return null;};}function removeEntity(_0x678722,_0x579a63){return function(_0x1e2c16){if(_0x1e2c16){return _0x1e2c16[_0x0692('0x25')]()[_0x0692('0x26')](function(){_0x678722[_0x0692('0x1b')](0xcc)[_0x0692('0x27')]();});}};}function handleEntityNotFound(_0xe4629b,_0x43c097){return function(_0x4c2b0d){if(!_0x4c2b0d){_0xe4629b[_0x0692('0x1a')](0x194);}return _0x4c2b0d;};}function handleError(_0x292904,_0x284457){_0x284457=_0x284457||0x1f4;return function(_0x5841f4){logger[_0x0692('0x28')](_0x5841f4[_0x0692('0x29')]);if(_0x5841f4['name']){delete _0x5841f4[_0x0692('0x2a')];}_0x292904[_0x0692('0x1b')](_0x284457)[_0x0692('0x2b')](_0x5841f4);};}exports[_0x0692('0x2c')]=function(_0x2a576b,_0x424a9c){var _0x29cbae={},_0x4f95a3={},_0x3a8ecc={'count':0x0,'rows':[]};var _0x535f37=_[_0x0692('0x2d')](db[_0x0692('0x2e')]['rawAttributes'],function(_0x230640){return{'name':_0x230640[_0x0692('0x2f')],'type':_0x230640[_0x0692('0x30')][_0x0692('0x31')]};});_0x4f95a3['model']=_[_0x0692('0x2d')](_0x535f37,_0x0692('0x2a'));_0x4f95a3['query']=_[_0x0692('0x32')](_0x2a576b[_0x0692('0x33')]);_0x4f95a3[_0x0692('0x34')]=_[_0x0692('0x35')](_0x4f95a3[_0x0692('0x36')],_0x4f95a3['query']);_0x29cbae[_0x0692('0x37')]=_[_0x0692('0x35')](_0x4f95a3[_0x0692('0x36')],qs[_0x0692('0x38')](_0x2a576b[_0x0692('0x33')][_0x0692('0x38')]));_0x29cbae[_0x0692('0x37')]=_0x29cbae['attributes'][_0x0692('0x39')]?_0x29cbae[_0x0692('0x37')]:_0x4f95a3[_0x0692('0x36')];if(!_0x2a576b['query'][_0x0692('0x3a')](_0x0692('0x3b'))){_0x29cbae[_0x0692('0x1f')]=qs['limit'](_0x2a576b['query'][_0x0692('0x1f')]);_0x29cbae[_0x0692('0x1e')]=qs[_0x0692('0x1e')](_0x2a576b['query'][_0x0692('0x1e')]);}_0x29cbae[_0x0692('0x3c')]=qs[_0x0692('0x3d')](_0x2a576b[_0x0692('0x33')][_0x0692('0x3d')]);_0x29cbae['where']=qs[_0x0692('0x34')](_[_0x0692('0x3e')](_0x2a576b[_0x0692('0x33')],_0x4f95a3[_0x0692('0x34')]));if(_0x2a576b[_0x0692('0x33')][_0x0692('0x3f')]){_0x29cbae[_0x0692('0x40')]=_[_0x0692('0x41')](_0x29cbae[_0x0692('0x40')],{'$or':_[_0x0692('0x2d')](_0x535f37,function(_0x39c152){if(_0x39c152[_0x0692('0x30')]!==_0x0692('0x42')){var _0xf84d1b={};_0xf84d1b[_0x39c152[_0x0692('0x2a')]]={'$like':'%'+_0x2a576b[_0x0692('0x33')][_0x0692('0x3f')]+'%'};return _0xf84d1b;}})});}_0x29cbae=_[_0x0692('0x41')]({},_0x29cbae,_0x2a576b[_0x0692('0x43')]);var _0x4677b9={'where':_0x29cbae[_0x0692('0x40')]};return db['ZohoField']['count'](_0x4677b9)[_0x0692('0x26')](function(_0x242c51){_0x3a8ecc['count']=_0x242c51;if(_0x2a576b[_0x0692('0x33')][_0x0692('0x44')]){_0x29cbae[_0x0692('0x45')]=[{'all':!![]}];}return db[_0x0692('0x2e')]['findAll'](_0x29cbae);})[_0x0692('0x26')](function(_0x425f23){_0x3a8ecc[_0x0692('0x46')]=_0x425f23;return _0x3a8ecc;})[_0x0692('0x26')](respondWithFilteredResult(_0x424a9c,_0x29cbae))[_0x0692('0x47')](handleError(_0x424a9c,null));};exports[_0x0692('0x48')]=function(_0xe5db8c,_0x1f52d1){var _0x5a9d0d={'raw':!![],'where':{'id':_0xe5db8c[_0x0692('0x49')]['id']}},_0xf57064={};_0xf57064[_0x0692('0x36')]=_[_0x0692('0x32')](db[_0x0692('0x2e')][_0x0692('0x4a')]);_0xf57064[_0x0692('0x33')]=_['keys'](_0xe5db8c['query']);_0xf57064[_0x0692('0x34')]=_[_0x0692('0x35')](_0xf57064[_0x0692('0x36')],_0xf57064[_0x0692('0x33')]);_0x5a9d0d['attributes']=_[_0x0692('0x35')](_0xf57064[_0x0692('0x36')],qs[_0x0692('0x38')](_0xe5db8c[_0x0692('0x33')][_0x0692('0x38')]));_0x5a9d0d[_0x0692('0x37')]=_0x5a9d0d[_0x0692('0x37')][_0x0692('0x39')]?_0x5a9d0d['attributes']:_0xf57064[_0x0692('0x36')];if(_0xe5db8c[_0x0692('0x33')][_0x0692('0x44')]){_0x5a9d0d[_0x0692('0x45')]=[{'all':!![]}];}_0x5a9d0d=_[_0x0692('0x41')]({},_0x5a9d0d,_0xe5db8c[_0x0692('0x43')]);return db[_0x0692('0x2e')][_0x0692('0x4b')](_0x5a9d0d)[_0x0692('0x26')](handleEntityNotFound(_0x1f52d1,null))['then'](respondWithResult(_0x1f52d1,null))['catch'](handleError(_0x1f52d1,null));};exports[_0x0692('0x4c')]=function(_0x4a9a7c,_0x2fa9e4){return db[_0x0692('0x2e')][_0x0692('0x4c')](_0x4a9a7c['body'],{})[_0x0692('0x26')](respondWithResult(_0x2fa9e4,0xc9))[_0x0692('0x47')](handleError(_0x2fa9e4,null));};exports[_0x0692('0x24')]=function(_0x508d27,_0x389bb0){if(_0x508d27[_0x0692('0x4d')]['id']){delete _0x508d27[_0x0692('0x4d')]['id'];}return db[_0x0692('0x2e')][_0x0692('0x4b')]({'where':{'id':_0x508d27['params']['id']}})[_0x0692('0x26')](handleEntityNotFound(_0x389bb0,null))[_0x0692('0x26')](saveUpdates(_0x508d27['body'],null))[_0x0692('0x26')](respondWithResult(_0x389bb0,null))[_0x0692('0x47')](handleError(_0x389bb0,null));};exports[_0x0692('0x25')]=function(_0x3e2159,_0x1d1be7){return db['ZohoField'][_0x0692('0x4b')]({'where':{'id':_0x3e2159[_0x0692('0x49')]['id']}})[_0x0692('0x26')](handleEntityNotFound(_0x1d1be7,null))['then'](removeEntity(_0x1d1be7,null))[_0x0692('0x47')](handleError(_0x1d1be7,null));};
\ No newline at end of file
+var _0x0cc7=['nolimit','order','sort','where','filters','pick','filter','merge','VIRTUAL','includeAll','include','rows','catch','show','params','find','create','body','rimraf','zip-dir','fast-json-patch','request-promise','moment','bluebird','mustache','path','sox','to-csv','ejs','crypto','jsforce','desk.js','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/logger','api','../../config/utils','../../config/environment','count','offset','limit','status','set','json','apply','reject','save','update','then','destroy','sendStatus','stack','name','send','map','ZohoField','fieldName','type','key','query','keys','model','attributes','intersection','fields','length'];(function(_0x4e8bf7,_0x51dadc){var _0x42f457=function(_0x4e030f){while(--_0x4e030f){_0x4e8bf7['push'](_0x4e8bf7['shift']());}};_0x42f457(++_0x51dadc);}(_0x0cc7,0x122));var _0x70cc=function(_0x1caf6a,_0x26a5bf){_0x1caf6a=_0x1caf6a-0x0;var _0x1bf493=_0x0cc7[_0x1caf6a];return _0x1bf493;};'use strict';var pdf=require('html-pdf');var emlformat=require('eml-format');var rimraf=require(_0x70cc('0x0'));var zipdir=require(_0x70cc('0x1'));var jsonpatch=require(_0x70cc('0x2'));var rp=require(_0x70cc('0x3'));var moment=require(_0x70cc('0x4'));var BPromise=require(_0x70cc('0x5'));var Mustache=require(_0x70cc('0x6'));var util=require('util');var path=require(_0x70cc('0x7'));var sox=require(_0x70cc('0x8'));var csv=require(_0x70cc('0x9'));var ejs=require(_0x70cc('0xa'));var fs=require('fs');var _=require('lodash');var squel=require('squel');var crypto=require(_0x70cc('0xb'));var jsforce=require(_0x70cc('0xc'));var deskjs=require(_0x70cc('0xd'));var toCsv=require('to-csv');var querystring=require('querystring');var Papa=require('papaparse');var Redis=require(_0x70cc('0xe'));var authService=require(_0x70cc('0xf'));var qs=require(_0x70cc('0x10'));var as=require(_0x70cc('0x11'));var hardwareService=require('../../config/license/hardware');var logger=require(_0x70cc('0x12'))(_0x70cc('0x13'));var utils=require(_0x70cc('0x14'));var config=require(_0x70cc('0x15'));var db=require('../../mysqldb')['db'];function respondWithStatusCode(_0x61e984,_0x206215){_0x206215=_0x206215||0xcc;return function(_0x6ce1ac){if(_0x6ce1ac){return _0x61e984['sendStatus'](_0x206215);}return _0x61e984['status'](_0x206215)['end']();};}function respondWithResult(_0x5c7f25,_0x246aa9){_0x246aa9=_0x246aa9||0xc8;return function(_0x408e9f){if(_0x408e9f){return _0x5c7f25['status'](_0x246aa9)['json'](_0x408e9f);}};}function respondWithFilteredResult(_0x3bca06,_0x447573){return function(_0x1b2246){if(_0x1b2246){var _0x400144=_0x1b2246[_0x70cc('0x16')],_0x10010a=_0x447573[_0x70cc('0x17')],_0x497e76=_0x447573[_0x70cc('0x17')]+_0x447573[_0x70cc('0x18')],_0x76e3b1;if(_0x497e76>=_0x400144){_0x497e76=_0x400144;_0x76e3b1=0xc8;}else{_0x76e3b1=0xce;}_0x3bca06[_0x70cc('0x19')](_0x76e3b1);return _0x3bca06[_0x70cc('0x1a')]('Content-Range',_0x10010a+'-'+_0x497e76+'/'+_0x400144)[_0x70cc('0x1b')](_0x1b2246);}return null;};}function patchUpdates(_0x27f1fc){return function(_0x339caf){try{jsonpatch[_0x70cc('0x1c')](_0x339caf,_0x27f1fc,!![]);}catch(_0x10afac){return BPromise[_0x70cc('0x1d')](_0x10afac);}return _0x339caf[_0x70cc('0x1e')]();};}function saveUpdates(_0x360727,_0x140b19){return function(_0x5cde09){if(_0x5cde09){return _0x5cde09[_0x70cc('0x1f')](_0x360727)[_0x70cc('0x20')](function(_0x5726c3){return _0x5726c3;});}return null;};}function removeEntity(_0x3d7b5d,_0x42e860){return function(_0x5ec5c5){if(_0x5ec5c5){return _0x5ec5c5[_0x70cc('0x21')]()['then'](function(){_0x3d7b5d[_0x70cc('0x19')](0xcc)['end']();});}};}function handleEntityNotFound(_0x53a6df,_0x308943){return function(_0x2ddde2){if(!_0x2ddde2){_0x53a6df[_0x70cc('0x22')](0x194);}return _0x2ddde2;};}function handleError(_0x52b8b0,_0x5a22d7){_0x5a22d7=_0x5a22d7||0x1f4;return function(_0x381de){logger['error'](_0x381de[_0x70cc('0x23')]);if(_0x381de[_0x70cc('0x24')]){delete _0x381de['name'];}_0x52b8b0[_0x70cc('0x19')](_0x5a22d7)[_0x70cc('0x25')](_0x381de);};}exports['index']=function(_0x2722f5,_0x5e72d4){var _0x22567d={},_0x2930a1={},_0x4cc392={'count':0x0,'rows':[]};var _0x18dd9b=_[_0x70cc('0x26')](db[_0x70cc('0x27')]['rawAttributes'],function(_0x1fd800){return{'name':_0x1fd800[_0x70cc('0x28')],'type':_0x1fd800[_0x70cc('0x29')][_0x70cc('0x2a')]};});_0x2930a1['model']=_['map'](_0x18dd9b,_0x70cc('0x24'));_0x2930a1[_0x70cc('0x2b')]=_[_0x70cc('0x2c')](_0x2722f5['query']);_0x2930a1['filters']=_['intersection'](_0x2930a1[_0x70cc('0x2d')],_0x2930a1[_0x70cc('0x2b')]);_0x22567d[_0x70cc('0x2e')]=_[_0x70cc('0x2f')](_0x2930a1[_0x70cc('0x2d')],qs[_0x70cc('0x30')](_0x2722f5['query'][_0x70cc('0x30')]));_0x22567d[_0x70cc('0x2e')]=_0x22567d[_0x70cc('0x2e')][_0x70cc('0x31')]?_0x22567d[_0x70cc('0x2e')]:_0x2930a1['model'];if(!_0x2722f5[_0x70cc('0x2b')]['hasOwnProperty'](_0x70cc('0x32'))){_0x22567d[_0x70cc('0x18')]=qs[_0x70cc('0x18')](_0x2722f5[_0x70cc('0x2b')]['limit']);_0x22567d['offset']=qs[_0x70cc('0x17')](_0x2722f5[_0x70cc('0x2b')][_0x70cc('0x17')]);}_0x22567d[_0x70cc('0x33')]=qs['sort'](_0x2722f5[_0x70cc('0x2b')][_0x70cc('0x34')]);_0x22567d[_0x70cc('0x35')]=qs[_0x70cc('0x36')](_[_0x70cc('0x37')](_0x2722f5[_0x70cc('0x2b')],_0x2930a1[_0x70cc('0x36')]));if(_0x2722f5['query'][_0x70cc('0x38')]){_0x22567d[_0x70cc('0x35')]=_[_0x70cc('0x39')](_0x22567d[_0x70cc('0x35')],{'$or':_['map'](_0x18dd9b,function(_0x52b58a){if(_0x52b58a[_0x70cc('0x29')]!==_0x70cc('0x3a')){var _0x34cda7={};_0x34cda7[_0x52b58a[_0x70cc('0x24')]]={'$like':'%'+_0x2722f5[_0x70cc('0x2b')]['filter']+'%'};return _0x34cda7;}})});}_0x22567d=_[_0x70cc('0x39')]({},_0x22567d,_0x2722f5['options']);var _0x25ea60={'where':_0x22567d['where']};return db[_0x70cc('0x27')][_0x70cc('0x16')](_0x25ea60)['then'](function(_0x39380e){_0x4cc392[_0x70cc('0x16')]=_0x39380e;if(_0x2722f5[_0x70cc('0x2b')][_0x70cc('0x3b')]){_0x22567d[_0x70cc('0x3c')]=[{'all':!![]}];}return db[_0x70cc('0x27')]['findAll'](_0x22567d);})[_0x70cc('0x20')](function(_0x5bedd3){_0x4cc392[_0x70cc('0x3d')]=_0x5bedd3;return _0x4cc392;})[_0x70cc('0x20')](respondWithFilteredResult(_0x5e72d4,_0x22567d))[_0x70cc('0x3e')](handleError(_0x5e72d4,null));};exports[_0x70cc('0x3f')]=function(_0x391cbb,_0x41046a){var _0x8124c1={'raw':!![],'where':{'id':_0x391cbb[_0x70cc('0x40')]['id']}},_0x26f4cb={};_0x26f4cb[_0x70cc('0x2d')]=_[_0x70cc('0x2c')](db[_0x70cc('0x27')]['rawAttributes']);_0x26f4cb[_0x70cc('0x2b')]=_[_0x70cc('0x2c')](_0x391cbb[_0x70cc('0x2b')]);_0x26f4cb[_0x70cc('0x36')]=_[_0x70cc('0x2f')](_0x26f4cb[_0x70cc('0x2d')],_0x26f4cb[_0x70cc('0x2b')]);_0x8124c1[_0x70cc('0x2e')]=_['intersection'](_0x26f4cb['model'],qs['fields'](_0x391cbb[_0x70cc('0x2b')][_0x70cc('0x30')]));_0x8124c1[_0x70cc('0x2e')]=_0x8124c1[_0x70cc('0x2e')]['length']?_0x8124c1[_0x70cc('0x2e')]:_0x26f4cb[_0x70cc('0x2d')];if(_0x391cbb[_0x70cc('0x2b')][_0x70cc('0x3b')]){_0x8124c1[_0x70cc('0x3c')]=[{'all':!![]}];}_0x8124c1=_['merge']({},_0x8124c1,_0x391cbb['options']);return db[_0x70cc('0x27')][_0x70cc('0x41')](_0x8124c1)[_0x70cc('0x20')](handleEntityNotFound(_0x41046a,null))[_0x70cc('0x20')](respondWithResult(_0x41046a,null))[_0x70cc('0x3e')](handleError(_0x41046a,null));};exports['create']=function(_0x2244f1,_0x12d333){return db['ZohoField'][_0x70cc('0x42')](_0x2244f1['body'],{})['then'](respondWithResult(_0x12d333,0xc9))[_0x70cc('0x3e')](handleError(_0x12d333,null));};exports[_0x70cc('0x1f')]=function(_0x30c73d,_0x538e04){if(_0x30c73d['body']['id']){delete _0x30c73d[_0x70cc('0x43')]['id'];}return db['ZohoField']['find']({'where':{'id':_0x30c73d[_0x70cc('0x40')]['id']}})[_0x70cc('0x20')](handleEntityNotFound(_0x538e04,null))[_0x70cc('0x20')](saveUpdates(_0x30c73d[_0x70cc('0x43')],null))[_0x70cc('0x20')](respondWithResult(_0x538e04,null))[_0x70cc('0x3e')](handleError(_0x538e04,null));};exports[_0x70cc('0x21')]=function(_0x2bf2b5,_0x450f75){return db['ZohoField'][_0x70cc('0x41')]({'where':{'id':_0x2bf2b5[_0x70cc('0x40')]['id']}})[_0x70cc('0x20')](handleEntityNotFound(_0x450f75,null))[_0x70cc('0x20')](removeEntity(_0x450f75,null))['catch'](handleError(_0x450f75,null));};
\ No newline at end of file
diff --git a/server/api/intZohoField/intZohoField.model.js b/server/api/intZohoField/intZohoField.model.js
index 608fe18..5d94c10 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 _0x70d9=['lodash','util','../../config/logger','moment','bluebird','request-promise','rimraf','./intZohoField.attributes','exports','define','ZohoField','zoho_unique_index','idField','FieldId'];(function(_0x46d6d5,_0x808111){var _0x2b4c36=function(_0x21d428){while(--_0x21d428){_0x46d6d5['push'](_0x46d6d5['shift']());}};_0x2b4c36(++_0x808111);}(_0x70d9,0x1ce));var _0x970d=function(_0x126558,_0x143c9a){_0x126558=_0x126558-0x0;var _0x1f6d14=_0x70d9[_0x126558];return _0x1f6d14;};'use strict';var _=require(_0x970d('0x0'));var util=require(_0x970d('0x1'));var logger=require(_0x970d('0x2'))('api');var moment=require(_0x970d('0x3'));var BPromise=require(_0x970d('0x4'));var rp=require(_0x970d('0x5'));var fs=require('fs');var path=require('path');var rimraf=require(_0x970d('0x6'));var config=require('../../config/environment');var attributes=require(_0x970d('0x7'));module[_0x970d('0x8')]=function(_0x19d52a,_0x712325){return _0x19d52a[_0x970d('0x9')](_0x970d('0xa'),attributes,{'tableName':'int_zoho_fields','paranoid':![],'indexes':[{'name':_0x970d('0xb'),'fields':[_0x970d('0xc'),_0x970d('0xd')],'unique':!![]}],'timestamps':!![]});};
\ No newline at end of file
+var _0x071b=['moment','bluebird','../../config/environment','./intZohoField.attributes','exports','define','ZohoField','zoho_unique_index','lodash','util','../../config/logger','api'];(function(_0x45b54c,_0x2db7f8){var _0xb23cbb=function(_0x539f8c){while(--_0x539f8c){_0x45b54c['push'](_0x45b54c['shift']());}};_0xb23cbb(++_0x2db7f8);}(_0x071b,0xc8));var _0xb071=function(_0x3fb961,_0x1e0e94){_0x3fb961=_0x3fb961-0x0;var _0x15c1d2=_0x071b[_0x3fb961];return _0x15c1d2;};'use strict';var _=require(_0xb071('0x0'));var util=require(_0xb071('0x1'));var logger=require(_0xb071('0x2'))(_0xb071('0x3'));var moment=require(_0xb071('0x4'));var BPromise=require(_0xb071('0x5'));var rp=require('request-promise');var fs=require('fs');var path=require('path');var rimraf=require('rimraf');var config=require(_0xb071('0x6'));var attributes=require(_0xb071('0x7'));module[_0xb071('0x8')]=function(_0x416856,_0xaf3374){return _0x416856[_0xb071('0x9')](_0xb071('0xa'),attributes,{'tableName':'int_zoho_fields','paranoid':![],'indexes':[{'name':_0xb071('0xb'),'fields':['idField','FieldId'],'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 72bc224..a7ff275 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 _0xd0bb=['debug','stringify','error','code','ZohoField,\x20%s,\x20%s','message','result','catch','lodash','util','moment','randomstring','../../mysqldb','../../config/utils','rpc','jayson/promise','client','http','request','then','request\x20sent'];(function(_0x5ddffa,_0xf085d6){var _0x271b61=function(_0x425f13){while(--_0x425f13){_0x5ddffa['push'](_0x5ddffa['shift']());}};_0x271b61(++_0xf085d6);}(_0xd0bb,0x1eb));var _0xbd0b=function(_0x2bc78d,_0x31a288){_0x2bc78d=_0x2bc78d-0x0;var _0x5d96c9=_0xd0bb[_0x2bc78d];return _0x5d96c9;};'use strict';var _=require(_0xbd0b('0x0'));var util=require(_0xbd0b('0x1'));var moment=require(_0xbd0b('0x2'));var BPromise=require('bluebird');var rs=require(_0xbd0b('0x3'));var fs=require('fs');var Redis=require('ioredis');var db=require(_0xbd0b('0x4'))['db'];var utils=require(_0xbd0b('0x5'));var logger=require('../../config/logger')(_0xbd0b('0x6'));var config=require('../../config/environment');var jayson=require(_0xbd0b('0x7'));var client=jayson[_0xbd0b('0x8')][_0xbd0b('0x9')]({'port':0x232a});function respondWithRpcPromise(_0x37c205,_0x809599,_0x5eb975){return new BPromise(function(_0x2a4075,_0x4533ff){return client[_0xbd0b('0xa')](_0x37c205,_0x5eb975)[_0xbd0b('0xb')](function(_0x16e185){logger['info']('ZohoField,\x20%s,\x20%s',_0x809599,_0xbd0b('0xc'));logger[_0xbd0b('0xd')]('ZohoField,\x20%s,\x20%s,\x20%s',_0x809599,_0xbd0b('0xc'),JSON[_0xbd0b('0xe')](_0x16e185));if(_0x16e185['error']){if(_0x16e185[_0xbd0b('0xf')][_0xbd0b('0x10')]===0x1f4){logger[_0xbd0b('0xf')](_0xbd0b('0x11'),_0x809599,_0x16e185[_0xbd0b('0xf')][_0xbd0b('0x12')]);return _0x4533ff(_0x16e185[_0xbd0b('0xf')][_0xbd0b('0x12')]);}logger[_0xbd0b('0xf')](_0xbd0b('0x11'),_0x809599,_0x16e185[_0xbd0b('0xf')]['message']);return _0x2a4075(_0x16e185[_0xbd0b('0xf')]['message']);}else{logger['info'](_0xbd0b('0x11'),_0x809599,_0xbd0b('0xc'));_0x2a4075(_0x16e185[_0xbd0b('0x13')][_0xbd0b('0x12')]);}})[_0xbd0b('0x14')](function(_0x546db3){logger['error'](_0xbd0b('0x11'),_0x809599,_0x546db3);_0x4533ff(_0x546db3);});});}
\ No newline at end of file
+var _0xfd28=['error','code','message','info','result','util','moment','randomstring','../../mysqldb','../../config/utils','../../config/logger','../../config/environment','jayson/promise','client','http','request','ZohoField,\x20%s,\x20%s','debug','request\x20sent'];(function(_0x38b763,_0x4ce22f){var _0x1dbd8c=function(_0x6f8ff9){while(--_0x6f8ff9){_0x38b763['push'](_0x38b763['shift']());}};_0x1dbd8c(++_0x4ce22f);}(_0xfd28,0x148));var _0x8fd2=function(_0x2aecb2,_0x343312){_0x2aecb2=_0x2aecb2-0x0;var _0x3ebb80=_0xfd28[_0x2aecb2];return _0x3ebb80;};'use strict';var _=require('lodash');var util=require(_0x8fd2('0x0'));var moment=require(_0x8fd2('0x1'));var BPromise=require('bluebird');var rs=require(_0x8fd2('0x2'));var fs=require('fs');var Redis=require('ioredis');var db=require(_0x8fd2('0x3'))['db'];var utils=require(_0x8fd2('0x4'));var logger=require(_0x8fd2('0x5'))('rpc');var config=require(_0x8fd2('0x6'));var jayson=require(_0x8fd2('0x7'));var client=jayson[_0x8fd2('0x8')][_0x8fd2('0x9')]({'port':0x232a});function respondWithRpcPromise(_0x2f0afc,_0x4bdc1a,_0x53d938){return new BPromise(function(_0x10fccf,_0x466c3d){return client[_0x8fd2('0xa')](_0x2f0afc,_0x53d938)['then'](function(_0x13cc69){logger['info'](_0x8fd2('0xb'),_0x4bdc1a,'request\x20sent');logger[_0x8fd2('0xc')]('ZohoField,\x20%s,\x20%s,\x20%s',_0x4bdc1a,_0x8fd2('0xd'),JSON['stringify'](_0x13cc69));if(_0x13cc69[_0x8fd2('0xe')]){if(_0x13cc69['error'][_0x8fd2('0xf')]===0x1f4){logger[_0x8fd2('0xe')](_0x8fd2('0xb'),_0x4bdc1a,_0x13cc69[_0x8fd2('0xe')][_0x8fd2('0x10')]);return _0x466c3d(_0x13cc69[_0x8fd2('0xe')][_0x8fd2('0x10')]);}logger[_0x8fd2('0xe')](_0x8fd2('0xb'),_0x4bdc1a,_0x13cc69[_0x8fd2('0xe')][_0x8fd2('0x10')]);return _0x10fccf(_0x13cc69[_0x8fd2('0xe')][_0x8fd2('0x10')]);}else{logger[_0x8fd2('0x11')](_0x8fd2('0xb'),_0x4bdc1a,'request\x20sent');_0x10fccf(_0x13cc69[_0x8fd2('0x12')]['message']);}})['catch'](function(_0x56f75d){logger[_0x8fd2('0xe')](_0x8fd2('0xb'),_0x4bdc1a,_0x56f75d);_0x466c3d(_0x56f75d);});});}
\ No newline at end of file
diff --git a/server/api/integration/index.js b/server/api/integration/index.js
index 1c89a35..7f4550e 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 _0xe451=['exports','path','../../components/auth/service','../../components/interaction/service','../../config/environment'];(function(_0x2deb2b,_0x35f4e5){var _0x5836a0=function(_0x10d89b){while(--_0x10d89b){_0x2deb2b['push'](_0x2deb2b['shift']());}};_0x5836a0(++_0x35f4e5);}(_0xe451,0xec));var _0x1e45=function(_0x42b9fc,_0x56c961){_0x42b9fc=_0x42b9fc-0x0;var _0x5b58f3=_0xe451[_0x42b9fc];return _0x5b58f3;};'use strict';var multer=require('multer');var util=require('util');var path=require(_0x1e45('0x0'));var timeout=require('connect-timeout');var express=require('express');var router=express['Router']();var auth=require(_0x1e45('0x1'));var interaction=require(_0x1e45('0x2'));var config=require(_0x1e45('0x3'));module[_0x1e45('0x4')]=router;
\ No newline at end of file
+var _0x0e5e=['path','connect-timeout','express','../../components/auth/service','../../components/interaction/service','exports','multer','util'];(function(_0x4bb67f,_0x46f9e9){var _0x3c93f0=function(_0x349315){while(--_0x349315){_0x4bb67f['push'](_0x4bb67f['shift']());}};_0x3c93f0(++_0x46f9e9);}(_0x0e5e,0x1ce));var _0xe0e5=function(_0x3dd15e,_0x1f0015){_0x3dd15e=_0x3dd15e-0x0;var _0x231fd0=_0x0e5e[_0x3dd15e];return _0x231fd0;};'use strict';var multer=require(_0xe0e5('0x0'));var util=require(_0xe0e5('0x1'));var path=require(_0xe0e5('0x2'));var timeout=require(_0xe0e5('0x3'));var express=require(_0xe0e5('0x4'));var router=express['Router']();var auth=require(_0xe0e5('0x5'));var interaction=require(_0xe0e5('0x6'));var config=require('../../config/environment');module[_0xe0e5('0x7')]=router;
\ No newline at end of file
diff --git a/server/api/integration/integration.attributes.js b/server/api/integration/integration.attributes.js
index 465ca27..02045a8 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 _0x7b08=['sequelize','exports','STRING','unique_name_and_version','app.js','INTEGER','BOOLEAN','state'];(function(_0x167cc1,_0x56ef5a){var _0x10bc4b=function(_0xd6a255){while(--_0xd6a255){_0x167cc1['push'](_0x167cc1['shift']());}};_0x10bc4b(++_0x56ef5a);}(_0x7b08,0x158));var _0x87b0=function(_0x55d285,_0x1c668f){_0x55d285=_0x55d285-0x0;var _0x188246=_0x7b08[_0x55d285];return _0x188246;};'use strict';var Sequelize=require(_0x87b0('0x0'));module[_0x87b0('0x1')]={'name':{'type':Sequelize[_0x87b0('0x2')],'allowNull':![],'unique':_0x87b0('0x3')},'version':{'type':Sequelize['STRING'],'allowNull':![],'unique':_0x87b0('0x3')},'main':{'type':Sequelize[_0x87b0('0x2')],'defaultValue':_0x87b0('0x4')},'filename':{'type':Sequelize[_0x87b0('0x2')]},'path':{'type':Sequelize[_0x87b0('0x2')]},'type':{'type':Sequelize[_0x87b0('0x2')]},'size':{'type':Sequelize[_0x87b0('0x5')]},'active':{'type':Sequelize[_0x87b0('0x6')],'defaultValue':![]},'author':{'type':Sequelize[_0x87b0('0x2')]},'logo':{'type':Sequelize[_0x87b0('0x2')]},'state':{'type':Sequelize['STRING'],'unique':_0x87b0('0x7')},'description':{'type':Sequelize[_0x87b0('0x2')]},'title':{'type':Sequelize[_0x87b0('0x2')]},'remoteUri':{'type':Sequelize[_0x87b0('0x2')]},'link':{'type':Sequelize['STRING'],'defaultValue':'#'}};
\ No newline at end of file
+var _0x6084=['STRING','unique_name_and_version','app.js','INTEGER','BOOLEAN','state'];(function(_0x374528,_0x2fda7c){var _0x4ba64a=function(_0x12dc0b){while(--_0x12dc0b){_0x374528['push'](_0x374528['shift']());}};_0x4ba64a(++_0x2fda7c);}(_0x6084,0x1b0));var _0x4608=function(_0x250b48,_0xe85ed1){_0x250b48=_0x250b48-0x0;var _0x5bb772=_0x6084[_0x250b48];return _0x5bb772;};'use strict';var Sequelize=require('sequelize');module['exports']={'name':{'type':Sequelize['STRING'],'allowNull':![],'unique':'unique_name_and_version'},'version':{'type':Sequelize[_0x4608('0x0')],'allowNull':![],'unique':_0x4608('0x1')},'main':{'type':Sequelize[_0x4608('0x0')],'defaultValue':_0x4608('0x2')},'filename':{'type':Sequelize[_0x4608('0x0')]},'path':{'type':Sequelize[_0x4608('0x0')]},'type':{'type':Sequelize[_0x4608('0x0')]},'size':{'type':Sequelize[_0x4608('0x3')]},'active':{'type':Sequelize[_0x4608('0x4')],'defaultValue':![]},'author':{'type':Sequelize[_0x4608('0x0')]},'logo':{'type':Sequelize[_0x4608('0x0')]},'state':{'type':Sequelize[_0x4608('0x0')],'unique':_0x4608('0x5')},'description':{'type':Sequelize[_0x4608('0x0')]},'title':{'type':Sequelize[_0x4608('0x0')]},'remoteUri':{'type':Sequelize[_0x4608('0x0')]},'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 57d8471..7ce3c03 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 _0xe121=['fieldName','key','model','map','keys','filters','intersection','query','fields','attributes','hasOwnProperty','nolimit','order','sort','pick','filter','where','merge','type','VIRTUAL','options','include','findAll','rows','catch','params','length','find','create','body','eml-format','rimraf','zip-dir','moment','bluebird','mustache','util','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/environment','../../mysqldb','sendStatus','status','end','count','offset','limit','set','Content-Range','json','reject','save','update','then','destroy','error','stack','name','send','index','Integration','rawAttributes'];(function(_0x3dd15e,_0x1f0015){var _0x231fd0=function(_0x4f680a){while(--_0x4f680a){_0x3dd15e['push'](_0x3dd15e['shift']());}};_0x231fd0(++_0x1f0015);}(_0xe121,0x19a));var _0x1e12=function(_0x3d48d7,_0x44a658){_0x3d48d7=_0x3d48d7-0x0;var _0x5e80db=_0xe121[_0x3d48d7];return _0x5e80db;};'use strict';var pdf=require('html-pdf');var emlformat=require(_0x1e12('0x0'));var rimraf=require(_0x1e12('0x1'));var zipdir=require(_0x1e12('0x2'));var jsonpatch=require('fast-json-patch');var rp=require('request-promise');var moment=require(_0x1e12('0x3'));var BPromise=require(_0x1e12('0x4'));var Mustache=require(_0x1e12('0x5'));var util=require(_0x1e12('0x6'));var path=require('path');var sox=require('sox');var csv=require(_0x1e12('0x7'));var ejs=require(_0x1e12('0x8'));var fs=require('fs');var _=require(_0x1e12('0x9'));var squel=require(_0x1e12('0xa'));var crypto=require(_0x1e12('0xb'));var jsforce=require(_0x1e12('0xc'));var deskjs=require(_0x1e12('0xd'));var toCsv=require(_0x1e12('0x7'));var querystring=require(_0x1e12('0xe'));var Papa=require(_0x1e12('0xf'));var Redis=require(_0x1e12('0x10'));var authService=require(_0x1e12('0x11'));var qs=require(_0x1e12('0x12'));var as=require(_0x1e12('0x13'));var hardwareService=require(_0x1e12('0x14'));var logger=require(_0x1e12('0x15'))(_0x1e12('0x16'));var utils=require('../../config/utils');var config=require(_0x1e12('0x17'));var db=require(_0x1e12('0x18'))['db'];function respondWithStatusCode(_0x29887d,_0x3a0834){_0x3a0834=_0x3a0834||0xcc;return function(_0x30afb6){if(_0x30afb6){return _0x29887d[_0x1e12('0x19')](_0x3a0834);}return _0x29887d[_0x1e12('0x1a')](_0x3a0834)[_0x1e12('0x1b')]();};}function respondWithResult(_0x33ea00,_0x33ed2c){_0x33ed2c=_0x33ed2c||0xc8;return function(_0x1bd573){if(_0x1bd573){return _0x33ea00[_0x1e12('0x1a')](_0x33ed2c)['json'](_0x1bd573);}};}function respondWithFilteredResult(_0x738aaa,_0x21e49a){return function(_0x2296d5){if(_0x2296d5){var _0x2dc401=_0x2296d5[_0x1e12('0x1c')],_0x267b52=_0x21e49a[_0x1e12('0x1d')],_0x162b39=_0x21e49a[_0x1e12('0x1d')]+_0x21e49a[_0x1e12('0x1e')],_0x351147;if(_0x162b39>=_0x2dc401){_0x162b39=_0x2dc401;_0x351147=0xc8;}else{_0x351147=0xce;}_0x738aaa[_0x1e12('0x1a')](_0x351147);return _0x738aaa[_0x1e12('0x1f')](_0x1e12('0x20'),_0x267b52+'-'+_0x162b39+'/'+_0x2dc401)[_0x1e12('0x21')](_0x2296d5);}return null;};}function patchUpdates(_0x5efc9a){return function(_0x4d1ff6){try{jsonpatch['apply'](_0x4d1ff6,_0x5efc9a,!![]);}catch(_0x392e5f){return BPromise[_0x1e12('0x22')](_0x392e5f);}return _0x4d1ff6[_0x1e12('0x23')]();};}function saveUpdates(_0x5347d9,_0x40ca11){return function(_0x179d98){if(_0x179d98){return _0x179d98[_0x1e12('0x24')](_0x5347d9)[_0x1e12('0x25')](function(_0x30b2af){return _0x30b2af;});}return null;};}function removeEntity(_0x34295d,_0x298a64){return function(_0x44e7c5){if(_0x44e7c5){return _0x44e7c5[_0x1e12('0x26')]()[_0x1e12('0x25')](function(){_0x34295d[_0x1e12('0x1a')](0xcc)[_0x1e12('0x1b')]();});}};}function handleEntityNotFound(_0x9e00e9,_0x4ab616){return function(_0x143e91){if(!_0x143e91){_0x9e00e9[_0x1e12('0x19')](0x194);}return _0x143e91;};}function handleError(_0x3ae4bf,_0x2df40c){_0x2df40c=_0x2df40c||0x1f4;return function(_0x2aed9b){logger[_0x1e12('0x27')](_0x2aed9b[_0x1e12('0x28')]);if(_0x2aed9b[_0x1e12('0x29')]){delete _0x2aed9b[_0x1e12('0x29')];}_0x3ae4bf[_0x1e12('0x1a')](_0x2df40c)[_0x1e12('0x2a')](_0x2aed9b);};}exports[_0x1e12('0x2b')]=function(_0x344ac3,_0x1e13ce){var _0x18480c={},_0xdef98c={},_0x5aab62={'count':0x0,'rows':[]};var _0x45b83b=_['map'](db[_0x1e12('0x2c')][_0x1e12('0x2d')],function(_0x1cf876){return{'name':_0x1cf876[_0x1e12('0x2e')],'type':_0x1cf876['type'][_0x1e12('0x2f')]};});_0xdef98c[_0x1e12('0x30')]=_[_0x1e12('0x31')](_0x45b83b,'name');_0xdef98c['query']=_[_0x1e12('0x32')](_0x344ac3['query']);_0xdef98c[_0x1e12('0x33')]=_['intersection'](_0xdef98c[_0x1e12('0x30')],_0xdef98c['query']);_0x18480c['attributes']=_[_0x1e12('0x34')](_0xdef98c[_0x1e12('0x30')],qs['fields'](_0x344ac3[_0x1e12('0x35')][_0x1e12('0x36')]));_0x18480c[_0x1e12('0x37')]=_0x18480c[_0x1e12('0x37')]['length']?_0x18480c['attributes']:_0xdef98c['model'];if(!_0x344ac3[_0x1e12('0x35')][_0x1e12('0x38')](_0x1e12('0x39'))){_0x18480c[_0x1e12('0x1e')]=qs['limit'](_0x344ac3['query'][_0x1e12('0x1e')]);_0x18480c[_0x1e12('0x1d')]=qs[_0x1e12('0x1d')](_0x344ac3[_0x1e12('0x35')]['offset']);}_0x18480c[_0x1e12('0x3a')]=qs[_0x1e12('0x3b')](_0x344ac3[_0x1e12('0x35')][_0x1e12('0x3b')]);_0x18480c['where']=qs[_0x1e12('0x33')](_[_0x1e12('0x3c')](_0x344ac3[_0x1e12('0x35')],_0xdef98c[_0x1e12('0x33')]));if(_0x344ac3[_0x1e12('0x35')][_0x1e12('0x3d')]){_0x18480c[_0x1e12('0x3e')]=_[_0x1e12('0x3f')](_0x18480c['where'],{'$or':_[_0x1e12('0x31')](_0x45b83b,function(_0x3f1376){if(_0x3f1376[_0x1e12('0x40')]!==_0x1e12('0x41')){var _0x5aaadb={};_0x5aaadb[_0x3f1376[_0x1e12('0x29')]]={'$like':'%'+_0x344ac3['query'][_0x1e12('0x3d')]+'%'};return _0x5aaadb;}})});}_0x18480c=_[_0x1e12('0x3f')]({},_0x18480c,_0x344ac3[_0x1e12('0x42')]);var _0x1165e1={'where':_0x18480c['where']};return db[_0x1e12('0x2c')]['count'](_0x1165e1)[_0x1e12('0x25')](function(_0x56fff9){_0x5aab62[_0x1e12('0x1c')]=_0x56fff9;if(_0x344ac3[_0x1e12('0x35')]['includeAll']){_0x18480c[_0x1e12('0x43')]=[{'all':!![]}];}return db['Integration'][_0x1e12('0x44')](_0x18480c);})[_0x1e12('0x25')](function(_0x38efb5){_0x5aab62[_0x1e12('0x45')]=_0x38efb5;return _0x5aab62;})['then'](respondWithFilteredResult(_0x1e13ce,_0x18480c))[_0x1e12('0x46')](handleError(_0x1e13ce,null));};exports['show']=function(_0x1b7ce0,_0x23f254){var _0x2ae4e9={'raw':![],'where':{'id':_0x1b7ce0[_0x1e12('0x47')]['id']}},_0xb3a3e0={};_0xb3a3e0[_0x1e12('0x30')]=_[_0x1e12('0x32')](db[_0x1e12('0x2c')][_0x1e12('0x2d')]);_0xb3a3e0[_0x1e12('0x35')]=_['keys'](_0x1b7ce0[_0x1e12('0x35')]);_0xb3a3e0['filters']=_[_0x1e12('0x34')](_0xb3a3e0[_0x1e12('0x30')],_0xb3a3e0[_0x1e12('0x35')]);_0x2ae4e9[_0x1e12('0x37')]=_[_0x1e12('0x34')](_0xb3a3e0[_0x1e12('0x30')],qs[_0x1e12('0x36')](_0x1b7ce0[_0x1e12('0x35')][_0x1e12('0x36')]));_0x2ae4e9[_0x1e12('0x37')]=_0x2ae4e9[_0x1e12('0x37')][_0x1e12('0x48')]?_0x2ae4e9['attributes']:_0xb3a3e0['model'];if(_0x1b7ce0[_0x1e12('0x35')]['includeAll']){_0x2ae4e9['include']=[{'all':!![]}];}_0x2ae4e9=_[_0x1e12('0x3f')]({},_0x2ae4e9,_0x1b7ce0[_0x1e12('0x42')]);return db['Integration'][_0x1e12('0x49')](_0x2ae4e9)[_0x1e12('0x25')](handleEntityNotFound(_0x23f254,null))[_0x1e12('0x25')](respondWithResult(_0x23f254,null))['catch'](handleError(_0x23f254,null));};exports['create']=function(_0x354f3d,_0x189583){return db['Integration'][_0x1e12('0x4a')](_0x354f3d[_0x1e12('0x4b')],{})[_0x1e12('0x25')](respondWithResult(_0x189583,0xc9))[_0x1e12('0x46')](handleError(_0x189583,null));};exports['update']=function(_0x4cb94f,_0x2fd2a4){if(_0x4cb94f[_0x1e12('0x4b')]['id']){delete _0x4cb94f[_0x1e12('0x4b')]['id'];}return db[_0x1e12('0x2c')][_0x1e12('0x49')]({'where':{'id':_0x4cb94f['params']['id']}})[_0x1e12('0x25')](handleEntityNotFound(_0x2fd2a4,null))['then'](saveUpdates(_0x4cb94f['body'],null))['then'](respondWithResult(_0x2fd2a4,null))[_0x1e12('0x46')](handleError(_0x2fd2a4,null));};exports[_0x1e12('0x26')]=function(_0x17a615,_0x2fe488){return db['Integration']['find']({'where':{'id':_0x17a615['params']['id']}})[_0x1e12('0x25')](handleEntityNotFound(_0x2fe488,null))[_0x1e12('0x25')](removeEntity(_0x2fe488,null))[_0x1e12('0x46')](handleError(_0x2fe488,null));};
\ No newline at end of file
+var _0xb05b=['pick','filter','merge','type','VIRTUAL','options','includeAll','include','rows','catch','params','keys','find','create','body','destroy','html-pdf','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','moment','bluebird','mustache','sox','to-csv','lodash','squel','crypto','jsforce','desk.js','querystring','papaparse','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/logger','api','../../config/environment','sendStatus','end','status','json','count','offset','limit','set','Content-Range','apply','reject','update','then','stack','send','index','map','Integration','rawAttributes','key','name','filters','intersection','model','attributes','fields','query','length','hasOwnProperty','nolimit','order','where'];(function(_0x295314,_0x17b250){var _0x584b0c=function(_0x51cc84){while(--_0x51cc84){_0x295314['push'](_0x295314['shift']());}};_0x584b0c(++_0x17b250);}(_0xb05b,0x1c0));var _0xbb05=function(_0x46e3ff,_0x50ca39){_0x46e3ff=_0x46e3ff-0x0;var _0x4bf847=_0xb05b[_0x46e3ff];return _0x4bf847;};'use strict';var pdf=require(_0xbb05('0x0'));var emlformat=require(_0xbb05('0x1'));var rimraf=require(_0xbb05('0x2'));var zipdir=require(_0xbb05('0x3'));var jsonpatch=require(_0xbb05('0x4'));var rp=require(_0xbb05('0x5'));var moment=require(_0xbb05('0x6'));var BPromise=require(_0xbb05('0x7'));var Mustache=require(_0xbb05('0x8'));var util=require('util');var path=require('path');var sox=require(_0xbb05('0x9'));var csv=require(_0xbb05('0xa'));var ejs=require('ejs');var fs=require('fs');var _=require(_0xbb05('0xb'));var squel=require(_0xbb05('0xc'));var crypto=require(_0xbb05('0xd'));var jsforce=require(_0xbb05('0xe'));var deskjs=require(_0xbb05('0xf'));var toCsv=require(_0xbb05('0xa'));var querystring=require(_0xbb05('0x10'));var Papa=require(_0xbb05('0x11'));var Redis=require('ioredis');var authService=require(_0xbb05('0x12'));var qs=require(_0xbb05('0x13'));var as=require(_0xbb05('0x14'));var hardwareService=require('../../config/license/hardware');var logger=require(_0xbb05('0x15'))(_0xbb05('0x16'));var utils=require('../../config/utils');var config=require(_0xbb05('0x17'));var db=require('../../mysqldb')['db'];function respondWithStatusCode(_0x22b7b8,_0x4ae1ab){_0x4ae1ab=_0x4ae1ab||0xcc;return function(_0x166509){if(_0x166509){return _0x22b7b8[_0xbb05('0x18')](_0x4ae1ab);}return _0x22b7b8['status'](_0x4ae1ab)[_0xbb05('0x19')]();};}function respondWithResult(_0x1a8b98,_0x29c0da){_0x29c0da=_0x29c0da||0xc8;return function(_0x5cab0a){if(_0x5cab0a){return _0x1a8b98[_0xbb05('0x1a')](_0x29c0da)[_0xbb05('0x1b')](_0x5cab0a);}};}function respondWithFilteredResult(_0x3b9215,_0x53acab){return function(_0x493aa8){if(_0x493aa8){var _0x3357b5=_0x493aa8[_0xbb05('0x1c')],_0x34e161=_0x53acab[_0xbb05('0x1d')],_0xe6f640=_0x53acab[_0xbb05('0x1d')]+_0x53acab[_0xbb05('0x1e')],_0x5779fd;if(_0xe6f640>=_0x3357b5){_0xe6f640=_0x3357b5;_0x5779fd=0xc8;}else{_0x5779fd=0xce;}_0x3b9215['status'](_0x5779fd);return _0x3b9215[_0xbb05('0x1f')](_0xbb05('0x20'),_0x34e161+'-'+_0xe6f640+'/'+_0x3357b5)[_0xbb05('0x1b')](_0x493aa8);}return null;};}function patchUpdates(_0x2c7962){return function(_0x1a83c4){try{jsonpatch[_0xbb05('0x21')](_0x1a83c4,_0x2c7962,!![]);}catch(_0x56e5cc){return BPromise[_0xbb05('0x22')](_0x56e5cc);}return _0x1a83c4['save']();};}function saveUpdates(_0x5cc9b0,_0xbc791b){return function(_0x7b3f4f){if(_0x7b3f4f){return _0x7b3f4f[_0xbb05('0x23')](_0x5cc9b0)['then'](function(_0x55c2b5){return _0x55c2b5;});}return null;};}function removeEntity(_0x22ce6a,_0x270738){return function(_0x47d22c){if(_0x47d22c){return _0x47d22c['destroy']()[_0xbb05('0x24')](function(){_0x22ce6a[_0xbb05('0x1a')](0xcc)[_0xbb05('0x19')]();});}};}function handleEntityNotFound(_0x19e42a,_0x1c163d){return function(_0x505b9a){if(!_0x505b9a){_0x19e42a[_0xbb05('0x18')](0x194);}return _0x505b9a;};}function handleError(_0x163191,_0x160818){_0x160818=_0x160818||0x1f4;return function(_0x302ea2){logger['error'](_0x302ea2[_0xbb05('0x25')]);if(_0x302ea2['name']){delete _0x302ea2['name'];}_0x163191[_0xbb05('0x1a')](_0x160818)[_0xbb05('0x26')](_0x302ea2);};}exports[_0xbb05('0x27')]=function(_0x4cdd60,_0x21a3c0){var _0x197ea4={},_0x55373c={},_0x57e83a={'count':0x0,'rows':[]};var _0x152107=_[_0xbb05('0x28')](db[_0xbb05('0x29')][_0xbb05('0x2a')],function(_0x8ced07){return{'name':_0x8ced07['fieldName'],'type':_0x8ced07['type'][_0xbb05('0x2b')]};});_0x55373c['model']=_[_0xbb05('0x28')](_0x152107,_0xbb05('0x2c'));_0x55373c['query']=_['keys'](_0x4cdd60['query']);_0x55373c[_0xbb05('0x2d')]=_[_0xbb05('0x2e')](_0x55373c[_0xbb05('0x2f')],_0x55373c['query']);_0x197ea4[_0xbb05('0x30')]=_[_0xbb05('0x2e')](_0x55373c['model'],qs[_0xbb05('0x31')](_0x4cdd60[_0xbb05('0x32')][_0xbb05('0x31')]));_0x197ea4['attributes']=_0x197ea4['attributes'][_0xbb05('0x33')]?_0x197ea4[_0xbb05('0x30')]:_0x55373c[_0xbb05('0x2f')];if(!_0x4cdd60[_0xbb05('0x32')][_0xbb05('0x34')](_0xbb05('0x35'))){_0x197ea4['limit']=qs['limit'](_0x4cdd60['query'][_0xbb05('0x1e')]);_0x197ea4[_0xbb05('0x1d')]=qs[_0xbb05('0x1d')](_0x4cdd60[_0xbb05('0x32')][_0xbb05('0x1d')]);}_0x197ea4[_0xbb05('0x36')]=qs['sort'](_0x4cdd60[_0xbb05('0x32')]['sort']);_0x197ea4[_0xbb05('0x37')]=qs[_0xbb05('0x2d')](_[_0xbb05('0x38')](_0x4cdd60[_0xbb05('0x32')],_0x55373c[_0xbb05('0x2d')]));if(_0x4cdd60['query'][_0xbb05('0x39')]){_0x197ea4[_0xbb05('0x37')]=_[_0xbb05('0x3a')](_0x197ea4[_0xbb05('0x37')],{'$or':_['map'](_0x152107,function(_0x1edbd8){if(_0x1edbd8[_0xbb05('0x3b')]!==_0xbb05('0x3c')){var _0x39593d={};_0x39593d[_0x1edbd8[_0xbb05('0x2c')]]={'$like':'%'+_0x4cdd60[_0xbb05('0x32')][_0xbb05('0x39')]+'%'};return _0x39593d;}})});}_0x197ea4=_['merge']({},_0x197ea4,_0x4cdd60[_0xbb05('0x3d')]);var _0x25157b={'where':_0x197ea4[_0xbb05('0x37')]};return db[_0xbb05('0x29')]['count'](_0x25157b)[_0xbb05('0x24')](function(_0x499806){_0x57e83a[_0xbb05('0x1c')]=_0x499806;if(_0x4cdd60[_0xbb05('0x32')][_0xbb05('0x3e')]){_0x197ea4[_0xbb05('0x3f')]=[{'all':!![]}];}return db[_0xbb05('0x29')]['findAll'](_0x197ea4);})['then'](function(_0x41d024){_0x57e83a[_0xbb05('0x40')]=_0x41d024;return _0x57e83a;})[_0xbb05('0x24')](respondWithFilteredResult(_0x21a3c0,_0x197ea4))[_0xbb05('0x41')](handleError(_0x21a3c0,null));};exports['show']=function(_0x32f3b5,_0x174ed9){var _0x2bebc5={'raw':![],'where':{'id':_0x32f3b5[_0xbb05('0x42')]['id']}},_0x1d3fd1={};_0x1d3fd1[_0xbb05('0x2f')]=_[_0xbb05('0x43')](db[_0xbb05('0x29')][_0xbb05('0x2a')]);_0x1d3fd1[_0xbb05('0x32')]=_[_0xbb05('0x43')](_0x32f3b5[_0xbb05('0x32')]);_0x1d3fd1[_0xbb05('0x2d')]=_[_0xbb05('0x2e')](_0x1d3fd1['model'],_0x1d3fd1[_0xbb05('0x32')]);_0x2bebc5[_0xbb05('0x30')]=_['intersection'](_0x1d3fd1[_0xbb05('0x2f')],qs[_0xbb05('0x31')](_0x32f3b5[_0xbb05('0x32')]['fields']));_0x2bebc5[_0xbb05('0x30')]=_0x2bebc5[_0xbb05('0x30')][_0xbb05('0x33')]?_0x2bebc5[_0xbb05('0x30')]:_0x1d3fd1['model'];if(_0x32f3b5[_0xbb05('0x32')][_0xbb05('0x3e')]){_0x2bebc5['include']=[{'all':!![]}];}_0x2bebc5=_[_0xbb05('0x3a')]({},_0x2bebc5,_0x32f3b5[_0xbb05('0x3d')]);return db[_0xbb05('0x29')][_0xbb05('0x44')](_0x2bebc5)[_0xbb05('0x24')](handleEntityNotFound(_0x174ed9,null))[_0xbb05('0x24')](respondWithResult(_0x174ed9,null))[_0xbb05('0x41')](handleError(_0x174ed9,null));};exports[_0xbb05('0x45')]=function(_0x311508,_0x56e85d){return db[_0xbb05('0x29')][_0xbb05('0x45')](_0x311508['body'],{})[_0xbb05('0x24')](respondWithResult(_0x56e85d,0xc9))['catch'](handleError(_0x56e85d,null));};exports[_0xbb05('0x23')]=function(_0x1a7937,_0x143dce){if(_0x1a7937[_0xbb05('0x46')]['id']){delete _0x1a7937['body']['id'];}return db['Integration'][_0xbb05('0x44')]({'where':{'id':_0x1a7937[_0xbb05('0x42')]['id']}})[_0xbb05('0x24')](handleEntityNotFound(_0x143dce,null))[_0xbb05('0x24')](saveUpdates(_0x1a7937['body'],null))[_0xbb05('0x24')](respondWithResult(_0x143dce,null))[_0xbb05('0x41')](handleError(_0x143dce,null));};exports[_0xbb05('0x47')]=function(_0x489950,_0x433d39){return db[_0xbb05('0x29')]['find']({'where':{'id':_0x489950['params']['id']}})['then'](handleEntityNotFound(_0x433d39,null))[_0xbb05('0x24')](removeEntity(_0x433d39,null))[_0xbb05('0x41')](handleError(_0x433d39,null));};
\ No newline at end of file
diff --git a/server/api/integration/integration.model.js b/server/api/integration/integration.model.js
index e35dfaa..1e9f44e 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 _0x75a4=['request-promise','path','rimraf','../../config/environment','./integration.attributes','exports','define','Integration','integrations','lodash','util','../../config/logger','api','moment','bluebird'];(function(_0x256bed,_0xbacb07){var _0x1e4138=function(_0x2f631e){while(--_0x2f631e){_0x256bed['push'](_0x256bed['shift']());}};_0x1e4138(++_0xbacb07);}(_0x75a4,0x1ad));var _0x475a=function(_0x253673,_0xbc7887){_0x253673=_0x253673-0x0;var _0x6b5728=_0x75a4[_0x253673];return _0x6b5728;};'use strict';var _=require(_0x475a('0x0'));var util=require(_0x475a('0x1'));var logger=require(_0x475a('0x2'))(_0x475a('0x3'));var moment=require(_0x475a('0x4'));var BPromise=require(_0x475a('0x5'));var rp=require(_0x475a('0x6'));var fs=require('fs');var path=require(_0x475a('0x7'));var rimraf=require(_0x475a('0x8'));var config=require(_0x475a('0x9'));var attributes=require(_0x475a('0xa'));module[_0x475a('0xb')]=function(_0x811df3,_0x219ad9){return _0x811df3[_0x475a('0xc')](_0x475a('0xd'),attributes,{'tableName':_0x475a('0xe'),'paranoid':![],'indexes':[],'timestamps':!![]});};
\ No newline at end of file
+var _0x942e=['api','moment','bluebird','request-promise','path','rimraf','../../config/environment','./integration.attributes','exports','define','Integration','lodash','../../config/logger'];(function(_0x2c08db,_0x4b5917){var _0x28680d=function(_0x4b2cc4){while(--_0x4b2cc4){_0x2c08db['push'](_0x2c08db['shift']());}};_0x28680d(++_0x4b5917);}(_0x942e,0x1c5));var _0xe942=function(_0x95cee,_0x346b5c){_0x95cee=_0x95cee-0x0;var _0x462bdf=_0x942e[_0x95cee];return _0x462bdf;};'use strict';var _=require(_0xe942('0x0'));var util=require('util');var logger=require(_0xe942('0x1'))(_0xe942('0x2'));var moment=require(_0xe942('0x3'));var BPromise=require(_0xe942('0x4'));var rp=require(_0xe942('0x5'));var fs=require('fs');var path=require(_0xe942('0x6'));var rimraf=require(_0xe942('0x7'));var config=require(_0xe942('0x8'));var attributes=require(_0xe942('0x9'));module[_0xe942('0xa')]=function(_0x1471e5,_0x3b0dd0){return _0x1471e5[_0xe942('0xb')](_0xe942('0xc'),attributes,{'tableName':'integrations','paranoid':![],'indexes':[],'timestamps':!![]});};
\ No newline at end of file
diff --git a/server/api/integration/integration.rpc.js b/server/api/integration/integration.rpc.js
index 33e894e..86895f8 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 _0xe914=['../../mysqldb','../../config/utils','../../config/logger','../../config/environment','jayson/promise','http','request','info','Integration,\x20%s,\x20%s','request\x20sent','debug','stringify','error','code','message','result','catch','lodash','util','bluebird','randomstring','ioredis'];(function(_0x238661,_0x2eeae1){var _0x549cbb=function(_0x19b338){while(--_0x19b338){_0x238661['push'](_0x238661['shift']());}};_0x549cbb(++_0x2eeae1);}(_0xe914,0x7f));var _0x4e91=function(_0x17c1d4,_0x32c94f){_0x17c1d4=_0x17c1d4-0x0;var _0x57bee2=_0xe914[_0x17c1d4];return _0x57bee2;};'use strict';var _=require(_0x4e91('0x0'));var util=require(_0x4e91('0x1'));var moment=require('moment');var BPromise=require(_0x4e91('0x2'));var rs=require(_0x4e91('0x3'));var fs=require('fs');var Redis=require(_0x4e91('0x4'));var db=require(_0x4e91('0x5'))['db'];var utils=require(_0x4e91('0x6'));var logger=require(_0x4e91('0x7'))('rpc');var config=require(_0x4e91('0x8'));var jayson=require(_0x4e91('0x9'));var client=jayson['client'][_0x4e91('0xa')]({'port':0x232a});function respondWithRpcPromise(_0x1d4bd6,_0x3f09cb,_0x2f2098){return new BPromise(function(_0x532b72,_0x49174e){return client[_0x4e91('0xb')](_0x1d4bd6,_0x2f2098)['then'](function(_0x523dec){logger[_0x4e91('0xc')](_0x4e91('0xd'),_0x3f09cb,_0x4e91('0xe'));logger[_0x4e91('0xf')]('Integration,\x20%s,\x20%s,\x20%s',_0x3f09cb,_0x4e91('0xe'),JSON[_0x4e91('0x10')](_0x523dec));if(_0x523dec[_0x4e91('0x11')]){if(_0x523dec['error'][_0x4e91('0x12')]===0x1f4){logger[_0x4e91('0x11')](_0x4e91('0xd'),_0x3f09cb,_0x523dec[_0x4e91('0x11')][_0x4e91('0x13')]);return _0x49174e(_0x523dec[_0x4e91('0x11')][_0x4e91('0x13')]);}logger[_0x4e91('0x11')](_0x4e91('0xd'),_0x3f09cb,_0x523dec['error'][_0x4e91('0x13')]);return _0x532b72(_0x523dec[_0x4e91('0x11')][_0x4e91('0x13')]);}else{logger['info'](_0x4e91('0xd'),_0x3f09cb,_0x4e91('0xe'));_0x532b72(_0x523dec[_0x4e91('0x14')][_0x4e91('0x13')]);}})[_0x4e91('0x15')](function(_0x34f91f){logger[_0x4e91('0x11')](_0x4e91('0xd'),_0x3f09cb,_0x34f91f);_0x49174e(_0x34f91f);});});}
\ No newline at end of file
+var _0xfafb=['client','request','then','Integration,\x20%s,\x20%s','debug','request\x20sent','stringify','error','code','message','info','result','lodash','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise'];(function(_0x32c647,_0x18f706){var _0x112645=function(_0x142a54){while(--_0x142a54){_0x32c647['push'](_0x32c647['shift']());}};_0x112645(++_0x18f706);}(_0xfafb,0xf2));var _0xbfaf=function(_0x3dd15e,_0x1f0015){_0x3dd15e=_0x3dd15e-0x0;var _0x231fd0=_0xfafb[_0x3dd15e];return _0x231fd0;};'use strict';var _=require(_0xbfaf('0x0'));var util=require('util');var moment=require(_0xbfaf('0x1'));var BPromise=require(_0xbfaf('0x2'));var rs=require(_0xbfaf('0x3'));var fs=require('fs');var Redis=require(_0xbfaf('0x4'));var db=require(_0xbfaf('0x5'))['db'];var utils=require(_0xbfaf('0x6'));var logger=require(_0xbfaf('0x7'))(_0xbfaf('0x8'));var config=require(_0xbfaf('0x9'));var jayson=require(_0xbfaf('0xa'));var client=jayson[_0xbfaf('0xb')]['http']({'port':0x232a});function respondWithRpcPromise(_0x6bf3e0,_0x4d1b50,_0x26049c){return new BPromise(function(_0x2b07ca,_0x367886){return client[_0xbfaf('0xc')](_0x6bf3e0,_0x26049c)[_0xbfaf('0xd')](function(_0x193782){logger['info'](_0xbfaf('0xe'),_0x4d1b50,'request\x20sent');logger[_0xbfaf('0xf')]('Integration,\x20%s,\x20%s,\x20%s',_0x4d1b50,_0xbfaf('0x10'),JSON[_0xbfaf('0x11')](_0x193782));if(_0x193782[_0xbfaf('0x12')]){if(_0x193782[_0xbfaf('0x12')][_0xbfaf('0x13')]===0x1f4){logger[_0xbfaf('0x12')](_0xbfaf('0xe'),_0x4d1b50,_0x193782[_0xbfaf('0x12')]['message']);return _0x367886(_0x193782[_0xbfaf('0x12')][_0xbfaf('0x14')]);}logger[_0xbfaf('0x12')](_0xbfaf('0xe'),_0x4d1b50,_0x193782[_0xbfaf('0x12')][_0xbfaf('0x14')]);return _0x2b07ca(_0x193782[_0xbfaf('0x12')][_0xbfaf('0x14')]);}else{logger[_0xbfaf('0x15')](_0xbfaf('0xe'),_0x4d1b50,_0xbfaf('0x10'));_0x2b07ca(_0x193782[_0xbfaf('0x16')]['message']);}})['catch'](function(_0x43e2be){logger['error']('Integration,\x20%s,\x20%s',_0x4d1b50,_0x43e2be);_0x367886(_0x43e2be);});});}
\ No newline at end of file
diff --git a/server/api/integrationReport/index.js b/server/api/integrationReport/index.js
index 27ceb2f..376debb 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 _0x1ae4=['isAuthenticated','show','create','/:id','update','exports','multer','util','path','express','Router','../../components/auth/service','../../components/interaction/service','../../config/environment','./integrationReport.controller','get','index','/describe'];(function(_0x17fb74,_0x203639){var _0x103dd8=function(_0xa3ef61){while(--_0xa3ef61){_0x17fb74['push'](_0x17fb74['shift']());}};_0x103dd8(++_0x203639);}(_0x1ae4,0x114));var _0x41ae=function(_0x15771e,_0x5360e3){_0x15771e=_0x15771e-0x0;var _0x3339ba=_0x1ae4[_0x15771e];return _0x3339ba;};'use strict';var multer=require(_0x41ae('0x0'));var util=require(_0x41ae('0x1'));var path=require(_0x41ae('0x2'));var timeout=require('connect-timeout');var express=require(_0x41ae('0x3'));var router=express[_0x41ae('0x4')]();var auth=require(_0x41ae('0x5'));var interaction=require(_0x41ae('0x6'));var config=require(_0x41ae('0x7'));var controller=require(_0x41ae('0x8'));router[_0x41ae('0x9')]('/',auth['isAuthenticated'](),controller[_0x41ae('0xa')]);router[_0x41ae('0x9')](_0x41ae('0xb'),auth[_0x41ae('0xc')](),controller['describe']);router[_0x41ae('0x9')]('/:id',auth[_0x41ae('0xc')](),controller[_0x41ae('0xd')]);router['post']('/',auth[_0x41ae('0xc')](),controller[_0x41ae('0xe')]);router['put'](_0x41ae('0xf'),auth['isAuthenticated'](),controller[_0x41ae('0x10')]);router['delete'](_0x41ae('0xf'),auth[_0x41ae('0xc')](),controller['destroy']);module[_0x41ae('0x11')]=router;
\ No newline at end of file
+var _0xacd3=['connect-timeout','express','Router','../../components/auth/service','../../config/environment','./integrationReport.controller','get','isAuthenticated','index','/describe','describe','show','put','/:id','update','delete','destroy','multer','util','path'];(function(_0x1b1be2,_0x5d8714){var _0x42d2b2=function(_0x2aeb55){while(--_0x2aeb55){_0x1b1be2['push'](_0x1b1be2['shift']());}};_0x42d2b2(++_0x5d8714);}(_0xacd3,0x115));var _0x3acd=function(_0x36b931,_0x182a48){_0x36b931=_0x36b931-0x0;var _0xea5a78=_0xacd3[_0x36b931];return _0xea5a78;};'use strict';var multer=require(_0x3acd('0x0'));var util=require(_0x3acd('0x1'));var path=require(_0x3acd('0x2'));var timeout=require(_0x3acd('0x3'));var express=require(_0x3acd('0x4'));var router=express[_0x3acd('0x5')]();var auth=require(_0x3acd('0x6'));var interaction=require('../../components/interaction/service');var config=require(_0x3acd('0x7'));var controller=require(_0x3acd('0x8'));router[_0x3acd('0x9')]('/',auth[_0x3acd('0xa')](),controller[_0x3acd('0xb')]);router['get'](_0x3acd('0xc'),auth[_0x3acd('0xa')](),controller[_0x3acd('0xd')]);router[_0x3acd('0x9')]('/:id',auth[_0x3acd('0xa')](),controller[_0x3acd('0xe')]);router['post']('/',auth[_0x3acd('0xa')](),controller['create']);router[_0x3acd('0xf')](_0x3acd('0x10'),auth[_0x3acd('0xa')](),controller[_0x3acd('0x11')]);router[_0x3acd('0x12')](_0x3acd('0x10'),auth[_0x3acd('0xa')](),controller[_0x3acd('0x13')]);module['exports']=router;
\ No newline at end of file
diff --git a/server/api/integrationReport/integrationReport.attributes.js b/server/api/integrationReport/integrationReport.attributes.js
index 4040726..eea025d 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 _0x09fd=['FAILED','sequelize','exports','STRING','INTEGER','DATE','BOOLEAN','TEXT','SENT','SENDING'];(function(_0x61a429,_0x522e43){var _0x534b5c=function(_0x20e348){while(--_0x20e348){_0x61a429['push'](_0x61a429['shift']());}};_0x534b5c(++_0x522e43);}(_0x09fd,0xb5));var _0xd09f=function(_0xc4a93c,_0x223ce7){_0xc4a93c=_0xc4a93c-0x0;var _0x319934=_0x09fd[_0xc4a93c];return _0x319934;};'use strict';var Sequelize=require(_0xd09f('0x0'));module[_0xd09f('0x1')]={'integration':{'type':Sequelize[_0xd09f('0x2')]},'eventChannel':{'type':Sequelize['STRING']},'exitStatus':{'type':Sequelize['STRING']},'ticketId':{'type':Sequelize[_0xd09f('0x2')]},'integrationId':{'type':Sequelize[_0xd09f('0x3')]},'contacts':{'type':Sequelize[_0xd09f('0x2')]},'uniqueid':{'type':Sequelize[_0xd09f('0x2')]},'calleridnum':{'type':Sequelize['STRING']},'calleridname':{'type':Sequelize[_0xd09f('0x2')]},'queue':{'type':Sequelize[_0xd09f('0x2')]},'interface':{'type':Sequelize['STRING']},'membername':{'type':Sequelize[_0xd09f('0x2')]},'agentcalledAt':{'type':Sequelize[_0xd09f('0x4')]},'agentconnectAt':{'type':Sequelize[_0xd09f('0x4')]},'holdtime':{'type':Sequelize['INTEGER']},'agentcomplete':{'type':Sequelize[_0xd09f('0x5')],'defaultValue':![]},'agentcompleteAt':{'type':Sequelize[_0xd09f('0x4')]},'talktime':{'type':Sequelize[_0xd09f('0x3')]},'agentacw':{'type':Sequelize[_0xd09f('0x5')],'defaultValue':![]},'acwtime':{'type':Sequelize[_0xd09f('0x3')]},'reason':{'type':Sequelize[_0xd09f('0x2')]},'agentringnoanswer':{'type':Sequelize[_0xd09f('0x5')],'defaultValue':![]},'agentringnoanswerAt':{'type':Sequelize[_0xd09f('0x4')]},'agentdump':{'type':Sequelize[_0xd09f('0x5')],'defaultValue':![]},'agentdumpAt':{'type':Sequelize[_0xd09f('0x4')]},'lastevent':{'type':Sequelize['STRING']},'channel':{'type':Sequelize[_0xd09f('0x2')]},'channelstate':{'type':Sequelize['INTEGER']},'channelstatedesc':{'type':Sequelize[_0xd09f('0x2')]},'connectedlinenum':{'type':Sequelize[_0xd09f('0x2')]},'connectedlinename':{'type':Sequelize[_0xd09f('0x2')]},'language':{'type':Sequelize[_0xd09f('0x2')]},'accountcode':{'type':Sequelize[_0xd09f('0x2')]},'context':{'type':Sequelize[_0xd09f('0x2')]},'exten':{'type':Sequelize[_0xd09f('0x2')]},'priority':{'type':Sequelize['STRING']},'destchannel':{'type':Sequelize['STRING']},'destchannelstate':{'type':Sequelize[_0xd09f('0x3')]},'destchannelstatedesc':{'type':Sequelize[_0xd09f('0x2')]},'destcalleridnum':{'type':Sequelize['STRING']},'destcalleridname':{'type':Sequelize[_0xd09f('0x2')]},'destconnectedlinenum':{'type':Sequelize['STRING']},'destconnectedlinename':{'type':Sequelize['STRING']},'destlanguage':{'type':Sequelize[_0xd09f('0x2')]},'destaccountcode':{'type':Sequelize[_0xd09f('0x2')]},'destcontext':{'type':Sequelize['STRING']},'destexten':{'type':Sequelize[_0xd09f('0x2')]},'destpriority':{'type':Sequelize[_0xd09f('0x2')]},'destuniqueid':{'type':Sequelize[_0xd09f('0x2')]},'messageId':{'type':Sequelize[_0xd09f('0x2')]},'inReplyTo':{'type':Sequelize[_0xd09f('0x2')]},'subject':{'type':Sequelize[_0xd09f('0x2')]},'from':{'type':Sequelize[_0xd09f('0x2')]},'to':{'type':Sequelize[_0xd09f('0x2')]},'cc':{'type':Sequelize['STRING']},'attachment':{'type':Sequelize[_0xd09f('0x6')]},'html':{'type':Sequelize[_0xd09f('0x6')]},'text':{'type':Sequelize[_0xd09f('0x6')]},'status':{'type':Sequelize['ENUM'](_0xd09f('0x7'),_0xd09f('0x8'),'RECEIVED',_0xd09f('0x9'))},'url':{'type':Sequelize[_0xd09f('0x2')]},'app':{'type':Sequelize[_0xd09f('0x2')]},'appdata':{'type':Sequelize[_0xd09f('0x2')]},'projectId':{'type':Sequelize[_0xd09f('0x3')]}};
\ No newline at end of file
+var _0xe9ab=['INTEGER','DATE','BOOLEAN','TEXT','SENDING','RECEIVED','FAILED','sequelize','exports','STRING'];(function(_0x3414fc,_0xdce392){var _0x2b6b17=function(_0x2a65bc){while(--_0x2a65bc){_0x3414fc['push'](_0x3414fc['shift']());}};_0x2b6b17(++_0xdce392);}(_0xe9ab,0xcf));var _0xbe9a=function(_0x20e6c7,_0x49e36a){_0x20e6c7=_0x20e6c7-0x0;var _0x4a1193=_0xe9ab[_0x20e6c7];return _0x4a1193;};'use strict';var Sequelize=require(_0xbe9a('0x0'));module[_0xbe9a('0x1')]={'integration':{'type':Sequelize[_0xbe9a('0x2')]},'eventChannel':{'type':Sequelize['STRING']},'exitStatus':{'type':Sequelize[_0xbe9a('0x2')]},'ticketId':{'type':Sequelize[_0xbe9a('0x2')]},'integrationId':{'type':Sequelize[_0xbe9a('0x3')]},'contacts':{'type':Sequelize[_0xbe9a('0x2')]},'uniqueid':{'type':Sequelize['STRING']},'calleridnum':{'type':Sequelize[_0xbe9a('0x2')]},'calleridname':{'type':Sequelize[_0xbe9a('0x2')]},'queue':{'type':Sequelize[_0xbe9a('0x2')]},'interface':{'type':Sequelize[_0xbe9a('0x2')]},'membername':{'type':Sequelize['STRING']},'agentcalledAt':{'type':Sequelize[_0xbe9a('0x4')]},'agentconnectAt':{'type':Sequelize[_0xbe9a('0x4')]},'holdtime':{'type':Sequelize['INTEGER']},'agentcomplete':{'type':Sequelize[_0xbe9a('0x5')],'defaultValue':![]},'agentcompleteAt':{'type':Sequelize['DATE']},'talktime':{'type':Sequelize[_0xbe9a('0x3')]},'agentacw':{'type':Sequelize[_0xbe9a('0x5')],'defaultValue':![]},'acwtime':{'type':Sequelize[_0xbe9a('0x3')]},'reason':{'type':Sequelize[_0xbe9a('0x2')]},'agentringnoanswer':{'type':Sequelize[_0xbe9a('0x5')],'defaultValue':![]},'agentringnoanswerAt':{'type':Sequelize[_0xbe9a('0x4')]},'agentdump':{'type':Sequelize[_0xbe9a('0x5')],'defaultValue':![]},'agentdumpAt':{'type':Sequelize[_0xbe9a('0x4')]},'lastevent':{'type':Sequelize[_0xbe9a('0x2')]},'channel':{'type':Sequelize['STRING']},'channelstate':{'type':Sequelize[_0xbe9a('0x3')]},'channelstatedesc':{'type':Sequelize[_0xbe9a('0x2')]},'connectedlinenum':{'type':Sequelize[_0xbe9a('0x2')]},'connectedlinename':{'type':Sequelize[_0xbe9a('0x2')]},'language':{'type':Sequelize['STRING']},'accountcode':{'type':Sequelize[_0xbe9a('0x2')]},'context':{'type':Sequelize[_0xbe9a('0x2')]},'exten':{'type':Sequelize[_0xbe9a('0x2')]},'priority':{'type':Sequelize[_0xbe9a('0x2')]},'destchannel':{'type':Sequelize['STRING']},'destchannelstate':{'type':Sequelize['INTEGER']},'destchannelstatedesc':{'type':Sequelize[_0xbe9a('0x2')]},'destcalleridnum':{'type':Sequelize[_0xbe9a('0x2')]},'destcalleridname':{'type':Sequelize[_0xbe9a('0x2')]},'destconnectedlinenum':{'type':Sequelize[_0xbe9a('0x2')]},'destconnectedlinename':{'type':Sequelize[_0xbe9a('0x2')]},'destlanguage':{'type':Sequelize[_0xbe9a('0x2')]},'destaccountcode':{'type':Sequelize[_0xbe9a('0x2')]},'destcontext':{'type':Sequelize[_0xbe9a('0x2')]},'destexten':{'type':Sequelize[_0xbe9a('0x2')]},'destpriority':{'type':Sequelize[_0xbe9a('0x2')]},'destuniqueid':{'type':Sequelize[_0xbe9a('0x2')]},'messageId':{'type':Sequelize['STRING']},'inReplyTo':{'type':Sequelize['STRING']},'subject':{'type':Sequelize[_0xbe9a('0x2')]},'from':{'type':Sequelize['STRING']},'to':{'type':Sequelize[_0xbe9a('0x2')]},'cc':{'type':Sequelize['STRING']},'attachment':{'type':Sequelize[_0xbe9a('0x6')]},'html':{'type':Sequelize[_0xbe9a('0x6')]},'text':{'type':Sequelize['TEXT']},'status':{'type':Sequelize['ENUM']('SENT',_0xbe9a('0x7'),_0xbe9a('0x8'),_0xbe9a('0x9'))},'url':{'type':Sequelize[_0xbe9a('0x2')]},'app':{'type':Sequelize[_0xbe9a('0x2')]},'appdata':{'type':Sequelize[_0xbe9a('0x2')]},'projectId':{'type':Sequelize[_0xbe9a('0x3')]}};
\ No newline at end of file
diff --git a/server/api/integrationReport/integrationReport.controller.js b/server/api/integrationReport/integrationReport.controller.js
index 9019cf3..aba6bc5 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 _0x6017=['fieldName','type','key','model','name','query','filters','intersection','fields','attributes','length','hasOwnProperty','nolimit','order','sort','where','pick','filter','merge','options','findAll','show','params','keys','rawAttributes','includeAll','include','find','create','catch','body','destroy','html-pdf','eml-format','rimraf','fast-json-patch','request-promise','bluebird','util','to-csv','ejs','lodash','squel','crypto','jsforce','querystring','papaparse','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/logger','api','../../config/utils','../../config/environment','../../mysqldb','sendStatus','status','json','count','offset','limit','Content-Range','apply','reject','update','then','end','error','stack','map','IntegrationReport'];(function(_0x2a8b2f,_0x57c389){var _0x21a9af=function(_0x40427b){while(--_0x40427b){_0x2a8b2f['push'](_0x2a8b2f['shift']());}};_0x21a9af(++_0x57c389);}(_0x6017,0xae));var _0x7601=function(_0x43a57c,_0x2c0d00){_0x43a57c=_0x43a57c-0x0;var _0x5065d4=_0x6017[_0x43a57c];return _0x5065d4;};'use strict';var pdf=require(_0x7601('0x0'));var emlformat=require(_0x7601('0x1'));var rimraf=require(_0x7601('0x2'));var zipdir=require('zip-dir');var jsonpatch=require(_0x7601('0x3'));var rp=require(_0x7601('0x4'));var moment=require('moment');var BPromise=require(_0x7601('0x5'));var Mustache=require('mustache');var util=require(_0x7601('0x6'));var path=require('path');var sox=require('sox');var csv=require(_0x7601('0x7'));var ejs=require(_0x7601('0x8'));var fs=require('fs');var _=require(_0x7601('0x9'));var squel=require(_0x7601('0xa'));var crypto=require(_0x7601('0xb'));var jsforce=require(_0x7601('0xc'));var deskjs=require('desk.js');var toCsv=require(_0x7601('0x7'));var querystring=require(_0x7601('0xd'));var Papa=require(_0x7601('0xe'));var Redis=require('ioredis');var authService=require(_0x7601('0xf'));var qs=require(_0x7601('0x10'));var as=require(_0x7601('0x11'));var hardwareService=require('../../config/license/hardware');var logger=require(_0x7601('0x12'))(_0x7601('0x13'));var utils=require(_0x7601('0x14'));var config=require(_0x7601('0x15'));var db=require(_0x7601('0x16'))['db'];function respondWithStatusCode(_0x35c6dc,_0x4001af){_0x4001af=_0x4001af||0xcc;return function(_0x1e2027){if(_0x1e2027){return _0x35c6dc[_0x7601('0x17')](_0x4001af);}return _0x35c6dc[_0x7601('0x18')](_0x4001af)['end']();};}function respondWithResult(_0x36d776,_0x5ee63a){_0x5ee63a=_0x5ee63a||0xc8;return function(_0x4be36a){if(_0x4be36a){return _0x36d776[_0x7601('0x18')](_0x5ee63a)[_0x7601('0x19')](_0x4be36a);}};}function respondWithFilteredResult(_0x263314,_0x33452d){return function(_0x30b86d){if(_0x30b86d){var _0x3a1706=_0x30b86d[_0x7601('0x1a')],_0xdd9b16=_0x33452d[_0x7601('0x1b')],_0xdfb58a=_0x33452d['offset']+_0x33452d[_0x7601('0x1c')],_0x5e99b9;if(_0xdfb58a>=_0x3a1706){_0xdfb58a=_0x3a1706;_0x5e99b9=0xc8;}else{_0x5e99b9=0xce;}_0x263314['status'](_0x5e99b9);return _0x263314['set'](_0x7601('0x1d'),_0xdd9b16+'-'+_0xdfb58a+'/'+_0x3a1706)[_0x7601('0x19')](_0x30b86d);}return null;};}function patchUpdates(_0x3c1b4b){return function(_0x2eb2eb){try{jsonpatch[_0x7601('0x1e')](_0x2eb2eb,_0x3c1b4b,!![]);}catch(_0x3cb152){return BPromise[_0x7601('0x1f')](_0x3cb152);}return _0x2eb2eb['save']();};}function saveUpdates(_0x1e1901,_0x1d58c0){return function(_0x4ed321){if(_0x4ed321){return _0x4ed321[_0x7601('0x20')](_0x1e1901)[_0x7601('0x21')](function(_0x37ee6c){return _0x37ee6c;});}return null;};}function removeEntity(_0x3cfd9a,_0x99ab5b){return function(_0x12f3f6){if(_0x12f3f6){return _0x12f3f6['destroy']()[_0x7601('0x21')](function(){_0x3cfd9a[_0x7601('0x18')](0xcc)[_0x7601('0x22')]();});}};}function handleEntityNotFound(_0x3a3629,_0x57e7a6){return function(_0x2b9bd){if(!_0x2b9bd){_0x3a3629['sendStatus'](0x194);}return _0x2b9bd;};}function handleError(_0x44944f,_0x561f58){_0x561f58=_0x561f58||0x1f4;return function(_0x5e6be1){logger[_0x7601('0x23')](_0x5e6be1[_0x7601('0x24')]);if(_0x5e6be1['name']){delete _0x5e6be1['name'];}_0x44944f[_0x7601('0x18')](_0x561f58)['send'](_0x5e6be1);};}exports['index']=function(_0x33f5ef,_0x3501ec){var _0xe9582b={},_0x5807ce={},_0xfcc562={'count':0x0,'rows':[]};var _0x4a2321=_[_0x7601('0x25')](db[_0x7601('0x26')]['rawAttributes'],function(_0x4ab32d){return{'name':_0x4ab32d[_0x7601('0x27')],'type':_0x4ab32d[_0x7601('0x28')][_0x7601('0x29')]};});_0x5807ce[_0x7601('0x2a')]=_[_0x7601('0x25')](_0x4a2321,_0x7601('0x2b'));_0x5807ce['query']=_['keys'](_0x33f5ef[_0x7601('0x2c')]);_0x5807ce[_0x7601('0x2d')]=_[_0x7601('0x2e')](_0x5807ce[_0x7601('0x2a')],_0x5807ce[_0x7601('0x2c')]);_0xe9582b['attributes']=_['intersection'](_0x5807ce[_0x7601('0x2a')],qs[_0x7601('0x2f')](_0x33f5ef[_0x7601('0x2c')][_0x7601('0x2f')]));_0xe9582b[_0x7601('0x30')]=_0xe9582b['attributes'][_0x7601('0x31')]?_0xe9582b[_0x7601('0x30')]:_0x5807ce['model'];if(!_0x33f5ef[_0x7601('0x2c')][_0x7601('0x32')](_0x7601('0x33'))){_0xe9582b[_0x7601('0x1c')]=qs[_0x7601('0x1c')](_0x33f5ef['query'][_0x7601('0x1c')]);_0xe9582b[_0x7601('0x1b')]=qs[_0x7601('0x1b')](_0x33f5ef[_0x7601('0x2c')]['offset']);}_0xe9582b[_0x7601('0x34')]=qs['sort'](_0x33f5ef['query'][_0x7601('0x35')]);_0xe9582b[_0x7601('0x36')]=qs[_0x7601('0x2d')](_[_0x7601('0x37')](_0x33f5ef[_0x7601('0x2c')],_0x5807ce[_0x7601('0x2d')]));if(_0x33f5ef[_0x7601('0x2c')][_0x7601('0x38')]){_0xe9582b[_0x7601('0x36')]=_[_0x7601('0x39')](_0xe9582b[_0x7601('0x36')],{'$or':_[_0x7601('0x25')](_0x4a2321,function(_0x16207e){if(_0x16207e[_0x7601('0x28')]!=='VIRTUAL'){var _0x438f2c={};_0x438f2c[_0x16207e[_0x7601('0x2b')]]={'$like':'%'+_0x33f5ef[_0x7601('0x2c')][_0x7601('0x38')]+'%'};return _0x438f2c;}})});}_0xe9582b=_[_0x7601('0x39')]({},_0xe9582b,_0x33f5ef[_0x7601('0x3a')]);var _0x4fb8f7={'where':_0xe9582b[_0x7601('0x36')]};return db[_0x7601('0x26')]['count'](_0x4fb8f7)[_0x7601('0x21')](function(_0x5eb9ed){_0xfcc562[_0x7601('0x1a')]=_0x5eb9ed;if(_0x33f5ef['query']['includeAll']){_0xe9582b['include']=[{'all':!![]}];}return db[_0x7601('0x26')][_0x7601('0x3b')](_0xe9582b);})[_0x7601('0x21')](function(_0xe1d960){_0xfcc562['rows']=_0xe1d960;return _0xfcc562;})[_0x7601('0x21')](respondWithFilteredResult(_0x3501ec,_0xe9582b))['catch'](handleError(_0x3501ec,null));};exports[_0x7601('0x3c')]=function(_0x37276d,_0x264a17){var _0xdf4ed={'raw':![],'where':{'id':_0x37276d[_0x7601('0x3d')]['id']}},_0x40f210={};_0x40f210['model']=_[_0x7601('0x3e')](db['IntegrationReport'][_0x7601('0x3f')]);_0x40f210[_0x7601('0x2c')]=_['keys'](_0x37276d['query']);_0x40f210['filters']=_['intersection'](_0x40f210[_0x7601('0x2a')],_0x40f210[_0x7601('0x2c')]);_0xdf4ed[_0x7601('0x30')]=_[_0x7601('0x2e')](_0x40f210[_0x7601('0x2a')],qs[_0x7601('0x2f')](_0x37276d[_0x7601('0x2c')][_0x7601('0x2f')]));_0xdf4ed[_0x7601('0x30')]=_0xdf4ed[_0x7601('0x30')][_0x7601('0x31')]?_0xdf4ed[_0x7601('0x30')]:_0x40f210[_0x7601('0x2a')];if(_0x37276d[_0x7601('0x2c')][_0x7601('0x40')]){_0xdf4ed[_0x7601('0x41')]=[{'all':!![]}];}_0xdf4ed=_['merge']({},_0xdf4ed,_0x37276d[_0x7601('0x3a')]);return db[_0x7601('0x26')][_0x7601('0x42')](_0xdf4ed)[_0x7601('0x21')](handleEntityNotFound(_0x264a17,null))[_0x7601('0x21')](respondWithResult(_0x264a17,null))['catch'](handleError(_0x264a17,null));};exports[_0x7601('0x43')]=function(_0x5305a3,_0x350854){return db[_0x7601('0x26')]['create'](_0x5305a3['body'],{})[_0x7601('0x21')](respondWithResult(_0x350854,0xc9))[_0x7601('0x44')](handleError(_0x350854,null));};exports[_0x7601('0x20')]=function(_0x2b8ec1,_0x3e05df){if(_0x2b8ec1[_0x7601('0x45')]['id']){delete _0x2b8ec1['body']['id'];}return db[_0x7601('0x26')]['find']({'where':{'id':_0x2b8ec1['params']['id']}})[_0x7601('0x21')](handleEntityNotFound(_0x3e05df,null))[_0x7601('0x21')](saveUpdates(_0x2b8ec1[_0x7601('0x45')],null))['then'](respondWithResult(_0x3e05df,null))[_0x7601('0x44')](handleError(_0x3e05df,null));};exports[_0x7601('0x46')]=function(_0x5892d7,_0x3a5046){return db[_0x7601('0x26')][_0x7601('0x42')]({'where':{'id':_0x5892d7[_0x7601('0x3d')]['id']}})[_0x7601('0x21')](handleEntityNotFound(_0x3a5046,null))[_0x7601('0x21')](removeEntity(_0x3a5046,null))[_0x7601('0x44')](handleError(_0x3a5046,null));};exports['describe']=function(_0x12b31d,_0x30e026){return db[_0x7601('0x26')]['describe']()[_0x7601('0x21')](respondWithResult(_0x30e026,null))[_0x7601('0x44')](handleError(_0x30e026,null));};
\ No newline at end of file
+var _0x4c99=['limit','set','Content-Range','apply','save','update','then','destroy','error','stack','name','send','index','map','IntegrationReport','rawAttributes','fieldName','type','key','query','keys','filters','intersection','attributes','model','fields','length','hasOwnProperty','nolimit','order','sort','pick','filter','merge','where','VIRTUAL','options','includeAll','include','findAll','rows','catch','show','params','find','create','body','describe','html-pdf','rimraf','moment','bluebird','util','path','to-csv','crypto','jsforce','desk.js','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/logger','api','../../config/utils','../../mysqldb','sendStatus','status','end','json','count','offset'];(function(_0x5ddb1c,_0x5ea4df){var _0x354adc=function(_0x2dfb1f){while(--_0x2dfb1f){_0x5ddb1c['push'](_0x5ddb1c['shift']());}};_0x354adc(++_0x5ea4df);}(_0x4c99,0x1ec));var _0x94c9=function(_0x199572,_0x33e667){_0x199572=_0x199572-0x0;var _0x13cfa3=_0x4c99[_0x199572];return _0x13cfa3;};'use strict';var pdf=require(_0x94c9('0x0'));var emlformat=require('eml-format');var rimraf=require(_0x94c9('0x1'));var zipdir=require('zip-dir');var jsonpatch=require('fast-json-patch');var rp=require('request-promise');var moment=require(_0x94c9('0x2'));var BPromise=require(_0x94c9('0x3'));var Mustache=require('mustache');var util=require(_0x94c9('0x4'));var path=require(_0x94c9('0x5'));var sox=require('sox');var csv=require(_0x94c9('0x6'));var ejs=require('ejs');var fs=require('fs');var _=require('lodash');var squel=require('squel');var crypto=require(_0x94c9('0x7'));var jsforce=require(_0x94c9('0x8'));var deskjs=require(_0x94c9('0x9'));var toCsv=require(_0x94c9('0x6'));var querystring=require(_0x94c9('0xa'));var Papa=require(_0x94c9('0xb'));var Redis=require(_0x94c9('0xc'));var authService=require(_0x94c9('0xd'));var qs=require(_0x94c9('0xe'));var as=require(_0x94c9('0xf'));var hardwareService=require('../../config/license/hardware');var logger=require(_0x94c9('0x10'))(_0x94c9('0x11'));var utils=require(_0x94c9('0x12'));var config=require('../../config/environment');var db=require(_0x94c9('0x13'))['db'];function respondWithStatusCode(_0x10f339,_0x3a5540){_0x3a5540=_0x3a5540||0xcc;return function(_0xadd7ac){if(_0xadd7ac){return _0x10f339[_0x94c9('0x14')](_0x3a5540);}return _0x10f339[_0x94c9('0x15')](_0x3a5540)[_0x94c9('0x16')]();};}function respondWithResult(_0x132e5e,_0x495654){_0x495654=_0x495654||0xc8;return function(_0x5990e8){if(_0x5990e8){return _0x132e5e['status'](_0x495654)[_0x94c9('0x17')](_0x5990e8);}};}function respondWithFilteredResult(_0x33b735,_0x5249d3){return function(_0x210709){if(_0x210709){var _0x3abfa5=_0x210709[_0x94c9('0x18')],_0x372b66=_0x5249d3[_0x94c9('0x19')],_0x56609d=_0x5249d3[_0x94c9('0x19')]+_0x5249d3[_0x94c9('0x1a')],_0x5db248;if(_0x56609d>=_0x3abfa5){_0x56609d=_0x3abfa5;_0x5db248=0xc8;}else{_0x5db248=0xce;}_0x33b735['status'](_0x5db248);return _0x33b735[_0x94c9('0x1b')](_0x94c9('0x1c'),_0x372b66+'-'+_0x56609d+'/'+_0x3abfa5)[_0x94c9('0x17')](_0x210709);}return null;};}function patchUpdates(_0x1ae701){return function(_0x30a237){try{jsonpatch[_0x94c9('0x1d')](_0x30a237,_0x1ae701,!![]);}catch(_0x443d7d){return BPromise['reject'](_0x443d7d);}return _0x30a237[_0x94c9('0x1e')]();};}function saveUpdates(_0x26556f,_0x4d7a9b){return function(_0x35b03c){if(_0x35b03c){return _0x35b03c[_0x94c9('0x1f')](_0x26556f)[_0x94c9('0x20')](function(_0x1bb3f0){return _0x1bb3f0;});}return null;};}function removeEntity(_0x41e653,_0x2892d1){return function(_0x410f00){if(_0x410f00){return _0x410f00[_0x94c9('0x21')]()[_0x94c9('0x20')](function(){_0x41e653[_0x94c9('0x15')](0xcc)['end']();});}};}function handleEntityNotFound(_0x2f20bd,_0x50ee41){return function(_0xf5ce65){if(!_0xf5ce65){_0x2f20bd['sendStatus'](0x194);}return _0xf5ce65;};}function handleError(_0x21ffd9,_0x12b535){_0x12b535=_0x12b535||0x1f4;return function(_0x2e5398){logger[_0x94c9('0x22')](_0x2e5398[_0x94c9('0x23')]);if(_0x2e5398[_0x94c9('0x24')]){delete _0x2e5398['name'];}_0x21ffd9[_0x94c9('0x15')](_0x12b535)[_0x94c9('0x25')](_0x2e5398);};}exports[_0x94c9('0x26')]=function(_0x4f12f6,_0x2ea850){var _0x514dc1={},_0x586b40={},_0x79575e={'count':0x0,'rows':[]};var _0x254210=_[_0x94c9('0x27')](db[_0x94c9('0x28')][_0x94c9('0x29')],function(_0x5d265f){return{'name':_0x5d265f[_0x94c9('0x2a')],'type':_0x5d265f[_0x94c9('0x2b')][_0x94c9('0x2c')]};});_0x586b40['model']=_[_0x94c9('0x27')](_0x254210,_0x94c9('0x24'));_0x586b40[_0x94c9('0x2d')]=_[_0x94c9('0x2e')](_0x4f12f6['query']);_0x586b40[_0x94c9('0x2f')]=_[_0x94c9('0x30')](_0x586b40['model'],_0x586b40[_0x94c9('0x2d')]);_0x514dc1[_0x94c9('0x31')]=_[_0x94c9('0x30')](_0x586b40[_0x94c9('0x32')],qs[_0x94c9('0x33')](_0x4f12f6[_0x94c9('0x2d')][_0x94c9('0x33')]));_0x514dc1['attributes']=_0x514dc1[_0x94c9('0x31')][_0x94c9('0x34')]?_0x514dc1[_0x94c9('0x31')]:_0x586b40[_0x94c9('0x32')];if(!_0x4f12f6['query'][_0x94c9('0x35')](_0x94c9('0x36'))){_0x514dc1['limit']=qs[_0x94c9('0x1a')](_0x4f12f6[_0x94c9('0x2d')][_0x94c9('0x1a')]);_0x514dc1['offset']=qs[_0x94c9('0x19')](_0x4f12f6[_0x94c9('0x2d')]['offset']);}_0x514dc1[_0x94c9('0x37')]=qs['sort'](_0x4f12f6['query'][_0x94c9('0x38')]);_0x514dc1['where']=qs[_0x94c9('0x2f')](_[_0x94c9('0x39')](_0x4f12f6[_0x94c9('0x2d')],_0x586b40[_0x94c9('0x2f')]));if(_0x4f12f6[_0x94c9('0x2d')][_0x94c9('0x3a')]){_0x514dc1['where']=_[_0x94c9('0x3b')](_0x514dc1[_0x94c9('0x3c')],{'$or':_[_0x94c9('0x27')](_0x254210,function(_0x3491fd){if(_0x3491fd['type']!==_0x94c9('0x3d')){var _0x309b7b={};_0x309b7b[_0x3491fd[_0x94c9('0x24')]]={'$like':'%'+_0x4f12f6[_0x94c9('0x2d')]['filter']+'%'};return _0x309b7b;}})});}_0x514dc1=_[_0x94c9('0x3b')]({},_0x514dc1,_0x4f12f6[_0x94c9('0x3e')]);var _0x46c19d={'where':_0x514dc1['where']};return db[_0x94c9('0x28')][_0x94c9('0x18')](_0x46c19d)[_0x94c9('0x20')](function(_0x3c8a8a){_0x79575e[_0x94c9('0x18')]=_0x3c8a8a;if(_0x4f12f6[_0x94c9('0x2d')][_0x94c9('0x3f')]){_0x514dc1[_0x94c9('0x40')]=[{'all':!![]}];}return db[_0x94c9('0x28')][_0x94c9('0x41')](_0x514dc1);})[_0x94c9('0x20')](function(_0x3516b1){_0x79575e[_0x94c9('0x42')]=_0x3516b1;return _0x79575e;})[_0x94c9('0x20')](respondWithFilteredResult(_0x2ea850,_0x514dc1))[_0x94c9('0x43')](handleError(_0x2ea850,null));};exports[_0x94c9('0x44')]=function(_0x1117cf,_0xbe12c3){var _0x13825d={'raw':![],'where':{'id':_0x1117cf[_0x94c9('0x45')]['id']}},_0xd8f228={};_0xd8f228['model']=_[_0x94c9('0x2e')](db[_0x94c9('0x28')][_0x94c9('0x29')]);_0xd8f228['query']=_[_0x94c9('0x2e')](_0x1117cf['query']);_0xd8f228[_0x94c9('0x2f')]=_[_0x94c9('0x30')](_0xd8f228[_0x94c9('0x32')],_0xd8f228['query']);_0x13825d[_0x94c9('0x31')]=_['intersection'](_0xd8f228[_0x94c9('0x32')],qs[_0x94c9('0x33')](_0x1117cf[_0x94c9('0x2d')][_0x94c9('0x33')]));_0x13825d[_0x94c9('0x31')]=_0x13825d[_0x94c9('0x31')]['length']?_0x13825d['attributes']:_0xd8f228['model'];if(_0x1117cf[_0x94c9('0x2d')][_0x94c9('0x3f')]){_0x13825d[_0x94c9('0x40')]=[{'all':!![]}];}_0x13825d=_['merge']({},_0x13825d,_0x1117cf[_0x94c9('0x3e')]);return db['IntegrationReport'][_0x94c9('0x46')](_0x13825d)[_0x94c9('0x20')](handleEntityNotFound(_0xbe12c3,null))[_0x94c9('0x20')](respondWithResult(_0xbe12c3,null))[_0x94c9('0x43')](handleError(_0xbe12c3,null));};exports[_0x94c9('0x47')]=function(_0x2cfeb7,_0x3b878e){return db['IntegrationReport'][_0x94c9('0x47')](_0x2cfeb7['body'],{})[_0x94c9('0x20')](respondWithResult(_0x3b878e,0xc9))[_0x94c9('0x43')](handleError(_0x3b878e,null));};exports[_0x94c9('0x1f')]=function(_0x9db0af,_0x3ac806){if(_0x9db0af[_0x94c9('0x48')]['id']){delete _0x9db0af[_0x94c9('0x48')]['id'];}return db[_0x94c9('0x28')]['find']({'where':{'id':_0x9db0af[_0x94c9('0x45')]['id']}})[_0x94c9('0x20')](handleEntityNotFound(_0x3ac806,null))[_0x94c9('0x20')](saveUpdates(_0x9db0af[_0x94c9('0x48')],null))[_0x94c9('0x20')](respondWithResult(_0x3ac806,null))['catch'](handleError(_0x3ac806,null));};exports[_0x94c9('0x21')]=function(_0x8a7e8b,_0x5cb82d){return db[_0x94c9('0x28')]['find']({'where':{'id':_0x8a7e8b[_0x94c9('0x45')]['id']}})['then'](handleEntityNotFound(_0x5cb82d,null))['then'](removeEntity(_0x5cb82d,null))[_0x94c9('0x43')](handleError(_0x5cb82d,null));};exports['describe']=function(_0x3582b1,_0x5ed5bc){return db[_0x94c9('0x28')][_0x94c9('0x49')]()[_0x94c9('0x20')](respondWithResult(_0x5ed5bc,null))['catch'](handleError(_0x5ed5bc,null));};
\ No newline at end of file
diff --git a/server/api/integrationReport/integrationReport.model.js b/server/api/integrationReport/integrationReport.model.js
index c4795cc..70b03d5 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 _0xc710=['lodash','util','api','moment','bluebird','request-promise','path','exports','define','IntegrationReport','report_integration'];(function(_0x2872c5,_0x362506){var _0x5a3d07=function(_0x225572){while(--_0x225572){_0x2872c5['push'](_0x2872c5['shift']());}};_0x5a3d07(++_0x362506);}(_0xc710,0x79));var _0x0c71=function(_0x57233a,_0x2e634b){_0x57233a=_0x57233a-0x0;var _0xedad75=_0xc710[_0x57233a];return _0xedad75;};'use strict';var _=require(_0x0c71('0x0'));var util=require(_0x0c71('0x1'));var logger=require('../../config/logger')(_0x0c71('0x2'));var moment=require(_0x0c71('0x3'));var BPromise=require(_0x0c71('0x4'));var rp=require(_0x0c71('0x5'));var fs=require('fs');var path=require(_0x0c71('0x6'));var rimraf=require('rimraf');var config=require('../../config/environment');var attributes=require('./integrationReport.attributes');module[_0x0c71('0x7')]=function(_0x5716dd,_0x3ee9b5){return _0x5716dd[_0x0c71('0x8')](_0x0c71('0x9'),attributes,{'tableName':_0x0c71('0xa'),'paranoid':![],'indexes':[],'timestamps':!![]});};
\ No newline at end of file
+var _0x332c=['define','lodash','util','../../config/logger','api','moment','path','rimraf','../../config/environment','./integrationReport.attributes','exports'];(function(_0x857439,_0x4d9d34){var _0x559059=function(_0x2f6d6b){while(--_0x2f6d6b){_0x857439['push'](_0x857439['shift']());}};_0x559059(++_0x4d9d34);}(_0x332c,0x7a));var _0xc332=function(_0x2a4ddb,_0x351833){_0x2a4ddb=_0x2a4ddb-0x0;var _0x4da0ab=_0x332c[_0x2a4ddb];return _0x4da0ab;};'use strict';var _=require(_0xc332('0x0'));var util=require(_0xc332('0x1'));var logger=require(_0xc332('0x2'))(_0xc332('0x3'));var moment=require(_0xc332('0x4'));var BPromise=require('bluebird');var rp=require('request-promise');var fs=require('fs');var path=require(_0xc332('0x5'));var rimraf=require(_0xc332('0x6'));var config=require(_0xc332('0x7'));var attributes=require(_0xc332('0x8'));module[_0xc332('0x9')]=function(_0x257848,_0x3fe63e){return _0x257848[_0xc332('0xa')]('IntegrationReport',attributes,{'tableName':'report_integration','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 cb077d3..20fdb75 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(_0x49d41c,_0x2bdc35){var _0xb64c5f=function(_0x28f535){while(--_0x28f535){_0x49d41c['push'](_0x49d41c['shift']());}};_0xb64c5f(++_0x2bdc35);}(_0x4fc2,0x111));var _0x24fc=function(_0x4f1423,_0x13cc99){_0x4f1423=_0x4f1423-0x0;var _0x33c235=_0x4fc2[_0x4f1423];return _0x33c235;};'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 _0xbaf0=['client','http','then','info','IntegrationReport,\x20%s,\x20%s','request\x20sent','debug','IntegrationReport,\x20%s,\x20%s,\x20%s','stringify','error','message','catch','util','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/logger','rpc','../../config/environment','jayson/promise'];(function(_0x387dc1,_0x3ba649){var _0x17567c=function(_0x4690aa){while(--_0x4690aa){_0x387dc1['push'](_0x387dc1['shift']());}};_0x17567c(++_0x3ba649);}(_0xbaf0,0x12a));var _0x0baf=function(_0xa464c9,_0x7c86d8){_0xa464c9=_0xa464c9-0x0;var _0x3d73c4=_0xbaf0[_0xa464c9];return _0x3d73c4;};'use strict';var _=require('lodash');var util=require(_0x0baf('0x0'));var moment=require(_0x0baf('0x1'));var BPromise=require(_0x0baf('0x2'));var rs=require(_0x0baf('0x3'));var fs=require('fs');var Redis=require(_0x0baf('0x4'));var db=require(_0x0baf('0x5'))['db'];var utils=require('../../config/utils');var logger=require(_0x0baf('0x6'))(_0x0baf('0x7'));var config=require(_0x0baf('0x8'));var jayson=require(_0x0baf('0x9'));var client=jayson[_0x0baf('0xa')][_0x0baf('0xb')]({'port':0x232a});function respondWithRpcPromise(_0x1a10b1,_0x2dcaac,_0x1d0a0d){return new BPromise(function(_0x5f5030,_0x11b947){return client['request'](_0x1a10b1,_0x1d0a0d)[_0x0baf('0xc')](function(_0x2c7442){logger[_0x0baf('0xd')](_0x0baf('0xe'),_0x2dcaac,_0x0baf('0xf'));logger[_0x0baf('0x10')](_0x0baf('0x11'),_0x2dcaac,_0x0baf('0xf'),JSON[_0x0baf('0x12')](_0x2c7442));if(_0x2c7442[_0x0baf('0x13')]){if(_0x2c7442[_0x0baf('0x13')]['code']===0x1f4){logger['error'](_0x0baf('0xe'),_0x2dcaac,_0x2c7442[_0x0baf('0x13')][_0x0baf('0x14')]);return _0x11b947(_0x2c7442[_0x0baf('0x13')]['message']);}logger[_0x0baf('0x13')]('IntegrationReport,\x20%s,\x20%s',_0x2dcaac,_0x2c7442[_0x0baf('0x13')][_0x0baf('0x14')]);return _0x5f5030(_0x2c7442[_0x0baf('0x13')][_0x0baf('0x14')]);}else{logger[_0x0baf('0xd')](_0x0baf('0xe'),_0x2dcaac,'request\x20sent');_0x5f5030(_0x2c7442['result'][_0x0baf('0x14')]);}})[_0x0baf('0x15')](function(_0x283408){logger[_0x0baf('0x13')](_0x0baf('0xe'),_0x2dcaac,_0x283408);_0x11b947(_0x283408);});});}
\ No newline at end of file
diff --git a/server/api/interval/index.js b/server/api/interval/index.js
index 1d817c5..afb2b7f 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(_0x4168a1,_0x5d606f){var _0x1acf24=function(_0x187366){while(--_0x187366){_0x4168a1['push'](_0x4168a1['shift']());}};_0x1acf24(++_0x5d606f);}(_0xedd9,0xfc));var _0x9edd=function(_0x3adf07,_0x1ce2af){_0x3adf07=_0x3adf07-0x0;var _0x5ee875=_0xedd9[_0x3adf07];return _0x5ee875;};'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(_0x54c004,_0x3f0783){var _0x1df8be=function(_0x4d8517){while(--_0x4d8517){_0x54c004['push'](_0x54c004['shift']());}};_0x1df8be(++_0x3f0783);}(_0x9c44,0x178));var _0x49c4=function(_0x4f9b18,_0x2cb5ca){_0x4f9b18=_0x4f9b18-0x0;var _0x29f20c=_0x9c44[_0x4f9b18];return _0x29f20c;};'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 ec9dfa5..e8c8ce2 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 _0xa380=['STRING','sequelize','exports'];(function(_0x19b1dd,_0x3600f9){var _0x257877=function(_0x2cc9fe){while(--_0x2cc9fe){_0x19b1dd['push'](_0x19b1dd['shift']());}};_0x257877(++_0x3600f9);}(_0xa380,0xbe));var _0x0a38=function(_0x4ee9e2,_0x3bf426){_0x4ee9e2=_0x4ee9e2-0x0;var _0x1f643f=_0xa380[_0x4ee9e2];return _0x1f643f;};'use strict';var Sequelize=require(_0x0a38('0x0'));module[_0x0a38('0x1')]={'name':{'type':Sequelize[_0x0a38('0x2')]},'description':{'type':Sequelize[_0x0a38('0x2')]},'interval':{'type':Sequelize[_0x0a38('0x2')],'allowNull':!![]}};
\ No newline at end of file
+var _0xe61c=['STRING'];(function(_0x501ca1,_0x6c6edc){var _0x2a99c4=function(_0x542cad){while(--_0x542cad){_0x501ca1['push'](_0x501ca1['shift']());}};_0x2a99c4(++_0x6c6edc);}(_0xe61c,0xf4));var _0xce61=function(_0x2c1114,_0x2a5c50){_0x2c1114=_0x2c1114-0x0;var _0x2b877c=_0xe61c[_0x2c1114];return _0x2b877c;};'use strict';var Sequelize=require('sequelize');module['exports']={'name':{'type':Sequelize[_0xce61('0x0')]},'description':{'type':Sequelize[_0xce61('0x0')]},'interval':{'type':Sequelize[_0xce61('0x0')],'allowNull':!![]}};
\ No newline at end of file
diff --git a/server/api/interval/interval.controller.js b/server/api/interval/interval.controller.js
index bf496bb..341dbff 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 _0xedd9=['sequelize','IntervalId','bulkCreate','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','moment','bluebird','mustache','path','sox','to-csv','ejs','squel','jsforce','desk.js','querystring','ioredis','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/logger','api','../../config/environment','../../mysqldb','../../components/extensions/rewrite','sendStatus','status','json','offset','limit','set','save','update','then','get','Intervals','destroy','end','name','index','map','Interval','rawAttributes','fieldName','type','key','model','query','keys','intersection','fields','attributes','length','hasOwnProperty','nolimit','order','sort','where','filters','pick','filter','VIRTUAL','merge','options','count','includeAll','include','findAll','rows','catch','params','find','create','body','user','role','userProfileId','UserProfileResource','error','getIntervals','addIntervals'];(function(_0x39193a,_0x2a0cbc){var _0x2b47cf=function(_0xd4c1dc){while(--_0xd4c1dc){_0x39193a['push'](_0x39193a['shift']());}};_0x2b47cf(++_0x2a0cbc);}(_0xedd9,0xfc));var _0x9edd=function(_0x443b1e,_0xf7ffe9){_0x443b1e=_0x443b1e-0x0;var _0x3beb6f=_0xedd9[_0x443b1e];return _0x3beb6f;};'use strict';var pdf=require('html-pdf');var emlformat=require(_0x9edd('0x0'));var rimraf=require(_0x9edd('0x1'));var zipdir=require(_0x9edd('0x2'));var jsonpatch=require(_0x9edd('0x3'));var rp=require(_0x9edd('0x4'));var moment=require(_0x9edd('0x5'));var BPromise=require(_0x9edd('0x6'));var Mustache=require(_0x9edd('0x7'));var util=require('util');var path=require(_0x9edd('0x8'));var sox=require(_0x9edd('0x9'));var csv=require(_0x9edd('0xa'));var ejs=require(_0x9edd('0xb'));var fs=require('fs');var _=require('lodash');var squel=require(_0x9edd('0xc'));var crypto=require('crypto');var jsforce=require(_0x9edd('0xd'));var deskjs=require(_0x9edd('0xe'));var toCsv=require(_0x9edd('0xa'));var querystring=require(_0x9edd('0xf'));var Papa=require('papaparse');var Redis=require(_0x9edd('0x10'));var authService=require('../../components/auth/service');var qs=require(_0x9edd('0x11'));var as=require(_0x9edd('0x12'));var hardwareService=require('../../config/license/hardware');var logger=require(_0x9edd('0x13'))(_0x9edd('0x14'));var utils=require('../../config/utils');var config=require(_0x9edd('0x15'));var db=require(_0x9edd('0x16'))['db'];var extensions=require(_0x9edd('0x17'));function respondWithStatusCode(_0xfd544a,_0x287ddd){_0x287ddd=_0x287ddd||0xcc;return function(_0x3a7b84){if(_0x3a7b84){return _0xfd544a[_0x9edd('0x18')](_0x287ddd);}return _0xfd544a[_0x9edd('0x19')](_0x287ddd)['end']();};}function respondWithResult(_0x176bfa,_0x44fc7c){_0x44fc7c=_0x44fc7c||0xc8;return function(_0x891832){if(_0x891832){return _0x176bfa[_0x9edd('0x19')](_0x44fc7c)[_0x9edd('0x1a')](_0x891832);}};}function respondWithFilteredResult(_0x338f3c,_0x1042aa){return function(_0x75a4ab){if(_0x75a4ab){var _0x4ea60f=_0x75a4ab['count'],_0x5f5bf4=_0x1042aa[_0x9edd('0x1b')],_0x448996=_0x1042aa[_0x9edd('0x1b')]+_0x1042aa[_0x9edd('0x1c')],_0x449cee;if(_0x448996>=_0x4ea60f){_0x448996=_0x4ea60f;_0x449cee=0xc8;}else{_0x449cee=0xce;}_0x338f3c['status'](_0x449cee);return _0x338f3c[_0x9edd('0x1d')]('Content-Range',_0x5f5bf4+'-'+_0x448996+'/'+_0x4ea60f)[_0x9edd('0x1a')](_0x75a4ab);}return null;};}function patchUpdates(_0x1083e4){return function(_0x4bdb88){try{jsonpatch['apply'](_0x4bdb88,_0x1083e4,!![]);}catch(_0x45c3ab){return BPromise['reject'](_0x45c3ab);}return _0x4bdb88[_0x9edd('0x1e')]();};}function saveUpdates(_0x54a03f,_0x535f37){return function(_0x356751){if(_0x356751){return _0x356751[_0x9edd('0x1f')](_0x54a03f)['then'](function(_0x5823bc){return _0x5823bc;});}return null;};}function removeEntity(_0x341d67,_0x186186){return function(_0x477878){if(_0x477878){return _0x477878['destroy']()[_0x9edd('0x20')](function(){var _0x1dca43=_0x477878[_0x9edd('0x21')]({'plain':!![]});var _0x2ca65f=_0x9edd('0x22');return db['UserProfileResource'][_0x9edd('0x23')]({'where':{'type':_0x2ca65f,'resourceId':_0x1dca43['id']}})[_0x9edd('0x20')](function(){return _0x477878;});})[_0x9edd('0x20')](function(){_0x341d67[_0x9edd('0x19')](0xcc)[_0x9edd('0x24')]();});}};}function handleEntityNotFound(_0x4d507f,_0x4b3d1b){return function(_0x3276ee){if(!_0x3276ee){_0x4d507f[_0x9edd('0x18')](0x194);}return _0x3276ee;};}function handleError(_0x8d67aa,_0x25e135){_0x25e135=_0x25e135||0x1f4;return function(_0x3c2227){logger['error'](_0x3c2227['stack']);if(_0x3c2227[_0x9edd('0x25')]){delete _0x3c2227[_0x9edd('0x25')];}_0x8d67aa[_0x9edd('0x19')](_0x25e135)['send'](_0x3c2227);};}exports[_0x9edd('0x26')]=function(_0x28cfae,_0x2ae8dd){var _0x41af53={},_0x5eccfb={},_0x2155a1={'count':0x0,'rows':[]};var _0x3fb556=_[_0x9edd('0x27')](db[_0x9edd('0x28')][_0x9edd('0x29')],function(_0x42e664){return{'name':_0x42e664[_0x9edd('0x2a')],'type':_0x42e664[_0x9edd('0x2b')][_0x9edd('0x2c')]};});_0x5eccfb[_0x9edd('0x2d')]=_[_0x9edd('0x27')](_0x3fb556,_0x9edd('0x25'));_0x5eccfb[_0x9edd('0x2e')]=_[_0x9edd('0x2f')](_0x28cfae[_0x9edd('0x2e')]);_0x5eccfb['filters']=_[_0x9edd('0x30')](_0x5eccfb[_0x9edd('0x2d')],_0x5eccfb[_0x9edd('0x2e')]);_0x41af53['attributes']=_[_0x9edd('0x30')](_0x5eccfb[_0x9edd('0x2d')],qs[_0x9edd('0x31')](_0x28cfae[_0x9edd('0x2e')][_0x9edd('0x31')]));_0x41af53[_0x9edd('0x32')]=_0x41af53[_0x9edd('0x32')][_0x9edd('0x33')]?_0x41af53[_0x9edd('0x32')]:_0x5eccfb[_0x9edd('0x2d')];if(!_0x28cfae[_0x9edd('0x2e')][_0x9edd('0x34')](_0x9edd('0x35'))){_0x41af53[_0x9edd('0x1c')]=qs['limit'](_0x28cfae[_0x9edd('0x2e')]['limit']);_0x41af53[_0x9edd('0x1b')]=qs[_0x9edd('0x1b')](_0x28cfae[_0x9edd('0x2e')][_0x9edd('0x1b')]);}_0x41af53[_0x9edd('0x36')]=qs['sort'](_0x28cfae[_0x9edd('0x2e')][_0x9edd('0x37')]);_0x41af53[_0x9edd('0x38')]=qs[_0x9edd('0x39')](_[_0x9edd('0x3a')](_0x28cfae[_0x9edd('0x2e')],_0x5eccfb[_0x9edd('0x39')]));if(_0x28cfae[_0x9edd('0x2e')][_0x9edd('0x3b')]){_0x41af53[_0x9edd('0x38')]=_['merge'](_0x41af53[_0x9edd('0x38')],{'$or':_['map'](_0x3fb556,function(_0x3ef1d5){if(_0x3ef1d5['type']!==_0x9edd('0x3c')){var _0x2858b5={};_0x2858b5[_0x3ef1d5[_0x9edd('0x25')]]={'$like':'%'+_0x28cfae['query'][_0x9edd('0x3b')]+'%'};return _0x2858b5;}})});}_0x41af53=_[_0x9edd('0x3d')]({},_0x41af53,_0x28cfae[_0x9edd('0x3e')]);var _0x48958a={'where':_0x41af53[_0x9edd('0x38')]};return db['Interval'][_0x9edd('0x3f')](_0x48958a)[_0x9edd('0x20')](function(_0x50be2c){_0x2155a1[_0x9edd('0x3f')]=_0x50be2c;if(_0x28cfae[_0x9edd('0x2e')][_0x9edd('0x40')]){_0x41af53[_0x9edd('0x41')]=[{'all':!![]}];}return db['Interval'][_0x9edd('0x42')](_0x41af53);})['then'](function(_0x2bdb3f){_0x2155a1[_0x9edd('0x43')]=_0x2bdb3f;return _0x2155a1;})['then'](respondWithFilteredResult(_0x2ae8dd,_0x41af53))[_0x9edd('0x44')](handleError(_0x2ae8dd,null));};exports['show']=function(_0x548299,_0x369b69){var _0x9cab86={'raw':!![],'where':{'id':_0x548299[_0x9edd('0x45')]['id']}},_0x1f276b={};_0x1f276b[_0x9edd('0x2d')]=_[_0x9edd('0x2f')](db[_0x9edd('0x28')][_0x9edd('0x29')]);_0x1f276b[_0x9edd('0x2e')]=_[_0x9edd('0x2f')](_0x548299[_0x9edd('0x2e')]);_0x1f276b[_0x9edd('0x39')]=_[_0x9edd('0x30')](_0x1f276b[_0x9edd('0x2d')],_0x1f276b[_0x9edd('0x2e')]);_0x9cab86['attributes']=_[_0x9edd('0x30')](_0x1f276b[_0x9edd('0x2d')],qs[_0x9edd('0x31')](_0x548299[_0x9edd('0x2e')][_0x9edd('0x31')]));_0x9cab86[_0x9edd('0x32')]=_0x9cab86[_0x9edd('0x32')]['length']?_0x9cab86['attributes']:_0x1f276b['model'];if(_0x548299[_0x9edd('0x2e')]['includeAll']){_0x9cab86[_0x9edd('0x41')]=[{'all':!![]}];}_0x9cab86=_[_0x9edd('0x3d')]({},_0x9cab86,_0x548299[_0x9edd('0x3e')]);return db[_0x9edd('0x28')][_0x9edd('0x46')](_0x9cab86)['then'](handleEntityNotFound(_0x369b69,null))[_0x9edd('0x20')](respondWithResult(_0x369b69,null))[_0x9edd('0x44')](handleError(_0x369b69,null));};exports[_0x9edd('0x47')]=function(_0x4a89ae,_0x3626bc){return db[_0x9edd('0x28')][_0x9edd('0x47')](_0x4a89ae[_0x9edd('0x48')],{})[_0x9edd('0x20')](function(_0x35bdec){var _0x4d4f33=_0x4a89ae[_0x9edd('0x49')][_0x9edd('0x21')]({'plain':!![]});if(!_0x4d4f33)throw new Error('Unable\x20to\x20retrieve\x20the\x20current\x20user');if(_0x4d4f33[_0x9edd('0x4a')]===_0x9edd('0x49')){var _0x4bb324=_0x35bdec[_0x9edd('0x21')]({'plain':!![]});var _0x8134cd=_0x9edd('0x22');return db['UserProfileSection'][_0x9edd('0x46')]({'where':{'name':_0x8134cd,'userProfileId':_0x4d4f33[_0x9edd('0x4b')]},'raw':!![]})[_0x9edd('0x20')](function(_0x28c7bd){if(_0x28c7bd&&_0x28c7bd['autoAssociation']===0x0){return db[_0x9edd('0x4c')][_0x9edd('0x47')]({'name':_0x4bb324[_0x9edd('0x25')],'resourceId':_0x4bb324['id'],'type':_0x28c7bd['name'],'sectionId':_0x28c7bd['id']},{})[_0x9edd('0x20')](function(){return _0x35bdec;});}else{return _0x35bdec;}})[_0x9edd('0x44')](function(_0x57db43){logger[_0x9edd('0x4d')]('Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s',_0x57db43);throw _0x57db43;});}return _0x35bdec;})[_0x9edd('0x20')](respondWithResult(_0x3626bc,0xc9))[_0x9edd('0x44')](handleError(_0x3626bc,null));};exports[_0x9edd('0x1f')]=function(_0x3fcdf5,_0x1e3c19){if(_0x3fcdf5[_0x9edd('0x48')]['id']){delete _0x3fcdf5[_0x9edd('0x48')]['id'];}return db[_0x9edd('0x28')][_0x9edd('0x46')]({'where':{'id':_0x3fcdf5[_0x9edd('0x45')]['id']}})[_0x9edd('0x20')](handleEntityNotFound(_0x1e3c19,null))['then'](saveUpdates(_0x3fcdf5[_0x9edd('0x48')],null))[_0x9edd('0x20')](respondWithResult(_0x1e3c19,null))[_0x9edd('0x44')](handleError(_0x1e3c19,null));};exports['destroy']=function(_0xe96d6a,_0x54a704){return db['Interval']['find']({'where':{'id':_0xe96d6a[_0x9edd('0x45')]['id']}})[_0x9edd('0x20')](handleEntityNotFound(_0x54a704,null))[_0x9edd('0x20')](removeEntity(_0x54a704,null))[_0x9edd('0x44')](handleError(_0x54a704,null));};exports['addInterval']=function(_0x56b38b,_0x4e3c3e,_0x71820f){if(_0x56b38b[_0x9edd('0x48')]['id']){delete _0x56b38b[_0x9edd('0x48')]['id'];}return db[_0x9edd('0x28')][_0x9edd('0x46')]({'where':{'id':_0x56b38b[_0x9edd('0x45')]['id']}})[_0x9edd('0x20')](handleEntityNotFound(_0x4e3c3e,null))[_0x9edd('0x20')](function(_0x4eb780){if(_0x4eb780){_0x56b38b[_0x9edd('0x48')]['IntervalId']=_0x4eb780['id'];return db[_0x9edd('0x28')][_0x9edd('0x47')](_0x56b38b['body']);}})[_0x9edd('0x20')](respondWithResult(_0x4e3c3e,null))[_0x9edd('0x44')](handleError(_0x4e3c3e,null));};exports[_0x9edd('0x4e')]=function(_0x5ec9af,_0xc648c4,_0x2e1ce3){var _0x430eb4={};var _0x15ebfa={};var _0x1720b1;var _0x2c3173;return db['Interval']['findOne']({'where':{'id':_0x5ec9af[_0x9edd('0x45')]['id']}})['then'](handleEntityNotFound(_0xc648c4,null))[_0x9edd('0x20')](function(_0x3e9a3e){if(_0x3e9a3e){_0x1720b1=_0x3e9a3e;_0x15ebfa[_0x9edd('0x2d')]=_[_0x9edd('0x2f')](db['Interval'][_0x9edd('0x29')]);_0x15ebfa['query']=_[_0x9edd('0x2f')](_0x5ec9af[_0x9edd('0x2e')]);_0x15ebfa[_0x9edd('0x39')]=_['intersection'](_0x15ebfa[_0x9edd('0x2d')],_0x15ebfa['query']);_0x430eb4[_0x9edd('0x32')]=_[_0x9edd('0x30')](_0x15ebfa['model'],qs[_0x9edd('0x31')](_0x5ec9af['query'][_0x9edd('0x31')]));_0x430eb4[_0x9edd('0x32')]=_0x430eb4[_0x9edd('0x32')]['length']?_0x430eb4[_0x9edd('0x32')]:_0x15ebfa[_0x9edd('0x2d')];_0x430eb4[_0x9edd('0x36')]=qs[_0x9edd('0x37')](_0x5ec9af[_0x9edd('0x2e')]['sort']);_0x430eb4['where']=qs[_0x9edd('0x39')](_[_0x9edd('0x3a')](_0x5ec9af['query'],_0x15ebfa['filters']));if(_0x5ec9af['query'][_0x9edd('0x3b')]){_0x430eb4['where']=_['merge'](_0x430eb4[_0x9edd('0x38')],{'$or':_[_0x9edd('0x27')](_0x430eb4['attributes'],function(_0xb9ebeb){var _0x11e082={};_0x11e082[_0xb9ebeb]={'$like':'%'+_0x5ec9af[_0x9edd('0x2e')]['filter']+'%'};return _0x11e082;})});}_0x430eb4=_[_0x9edd('0x3d')]({},_0x430eb4,_0x5ec9af['options']);return _0x1720b1[_0x9edd('0x4e')](_0x430eb4);}})[_0x9edd('0x20')](function(_0x4c8d06){if(_0x4c8d06){_0x2c3173=_0x4c8d06[_0x9edd('0x33')];if(!_0x5ec9af[_0x9edd('0x2e')]['hasOwnProperty'](_0x9edd('0x35'))){_0x430eb4[_0x9edd('0x1c')]=qs[_0x9edd('0x1c')](_0x5ec9af[_0x9edd('0x2e')]['limit']);_0x430eb4[_0x9edd('0x1b')]=qs['offset'](_0x5ec9af[_0x9edd('0x2e')][_0x9edd('0x1b')]);}return _0x1720b1[_0x9edd('0x4e')](_0x430eb4);}})['then'](function(_0x106a67){if(_0x106a67){return _0x106a67?{'count':_0x2c3173,'rows':_0x106a67}:null;}})[_0x9edd('0x20')](respondWithResult(_0xc648c4,null))[_0x9edd('0x44')](handleError(_0xc648c4,null));};exports[_0x9edd('0x4f')]=function(_0x25626a,_0x14e2e5,_0x3fa4a9){return db['Interval']['findOne']({'where':{'id':_0x25626a[_0x9edd('0x45')]['id']}})[_0x9edd('0x20')](handleEntityNotFound(_0x14e2e5,null))[_0x9edd('0x20')](function(_0x171403){if(_0x171403){return db[_0x9edd('0x50')]['transaction'](function(_0x2e40c8){return db[_0x9edd('0x28')][_0x9edd('0x23')]({'where':{'IntervalId':_0x25626a['params']['id']},'transaction':_0x2e40c8})[_0x9edd('0x20')](function(_0x29d70d){var _0x4b1c12=_[_0x9edd('0x27')](_0x25626a[_0x9edd('0x48')],function(_0x58c839){delete _0x58c839['id'];_0x58c839[_0x9edd('0x51')]=_0x25626a[_0x9edd('0x45')]['id'];return _0x58c839;});return db['Interval'][_0x9edd('0x52')](_0x4b1c12,{'transaction':_0x2e40c8});});})['then'](function(){return db['Interval'][_0x9edd('0x42')]({'where':{'IntervalId':_0x25626a[_0x9edd('0x45')]['id']}});});}})[_0x9edd('0x20')](respondWithResult(_0x14e2e5,null))['catch'](handleError(_0x14e2e5,null));};
\ No newline at end of file
+var _0x34e8=['Intervals','find','userProfileId','autoAssociation','update','addInterval','IntervalId','getIntervals','findOne','order','hasOwnProperty','nolimit','addIntervals','sequelize','transaction','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','sendStatus','status','end','count','offset','limit','set','Content-Range','json','apply','reject','save','then','destroy','get','UserProfileResource','error','stack','name','map','Interval','rawAttributes','fieldName','type','key','query','keys','filters','intersection','model','attributes','fields','sort','where','filter','merge','VIRTUAL','options','includeAll','findAll','rows','catch','show','params','length','include','create','body','user','Unable\x20to\x20retrieve\x20the\x20current\x20user','role'];(function(_0x380158,_0x599bd1){var _0x39ac68=function(_0x294e50){while(--_0x294e50){_0x380158['push'](_0x380158['shift']());}};_0x39ac68(++_0x599bd1);}(_0x34e8,0x12c));var _0x834e=function(_0x444852,_0xfdbc66){_0x444852=_0x444852-0x0;var _0x19571e=_0x34e8[_0x444852];return _0x19571e;};'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 extensions=require('../../components/extensions/rewrite');function respondWithStatusCode(_0x5e5b6d,_0x6cd9b9){_0x6cd9b9=_0x6cd9b9||0xcc;return function(_0x58a27e){if(_0x58a27e){return _0x5e5b6d[_0x834e('0x1d')](_0x6cd9b9);}return _0x5e5b6d[_0x834e('0x1e')](_0x6cd9b9)[_0x834e('0x1f')]();};}function respondWithResult(_0x21cc0a,_0x50e860){_0x50e860=_0x50e860||0xc8;return function(_0x43156c){if(_0x43156c){return _0x21cc0a[_0x834e('0x1e')](_0x50e860)['json'](_0x43156c);}};}function respondWithFilteredResult(_0x316205,_0x4a9cdc){return function(_0x38a8cd){if(_0x38a8cd){var _0x36d443=_0x38a8cd[_0x834e('0x20')],_0x478afe=_0x4a9cdc['offset'],_0x43ac41=_0x4a9cdc[_0x834e('0x21')]+_0x4a9cdc[_0x834e('0x22')],_0x22106e;if(_0x43ac41>=_0x36d443){_0x43ac41=_0x36d443;_0x22106e=0xc8;}else{_0x22106e=0xce;}_0x316205[_0x834e('0x1e')](_0x22106e);return _0x316205[_0x834e('0x23')](_0x834e('0x24'),_0x478afe+'-'+_0x43ac41+'/'+_0x36d443)[_0x834e('0x25')](_0x38a8cd);}return null;};}function patchUpdates(_0x1dd214){return function(_0x595515){try{jsonpatch[_0x834e('0x26')](_0x595515,_0x1dd214,!![]);}catch(_0x1fd2c6){return BPromise[_0x834e('0x27')](_0x1fd2c6);}return _0x595515[_0x834e('0x28')]();};}function saveUpdates(_0x4ab05d,_0x45a630){return function(_0x62f8f1){if(_0x62f8f1){return _0x62f8f1['update'](_0x4ab05d)[_0x834e('0x29')](function(_0x28d687){return _0x28d687;});}return null;};}function removeEntity(_0x8d406e,_0x5c55ca){return function(_0x4e3f48){if(_0x4e3f48){return _0x4e3f48[_0x834e('0x2a')]()[_0x834e('0x29')](function(){var _0x589dde=_0x4e3f48[_0x834e('0x2b')]({'plain':!![]});var _0x1dc1e0='Intervals';return db[_0x834e('0x2c')][_0x834e('0x2a')]({'where':{'type':_0x1dc1e0,'resourceId':_0x589dde['id']}})[_0x834e('0x29')](function(){return _0x4e3f48;});})['then'](function(){_0x8d406e[_0x834e('0x1e')](0xcc)[_0x834e('0x1f')]();});}};}function handleEntityNotFound(_0x5e1cc5,_0x5bef62){return function(_0x1e713a){if(!_0x1e713a){_0x5e1cc5['sendStatus'](0x194);}return _0x1e713a;};}function handleError(_0x2826ec,_0x3f1b0b){_0x3f1b0b=_0x3f1b0b||0x1f4;return function(_0x3db026){logger[_0x834e('0x2d')](_0x3db026[_0x834e('0x2e')]);if(_0x3db026[_0x834e('0x2f')]){delete _0x3db026['name'];}_0x2826ec['status'](_0x3f1b0b)['send'](_0x3db026);};}exports['index']=function(_0x2c7a8d,_0x567cea){var _0x106d6a={},_0x5dacc1={},_0xb5bc06={'count':0x0,'rows':[]};var _0x11f1ce=_[_0x834e('0x30')](db[_0x834e('0x31')][_0x834e('0x32')],function(_0x390119){return{'name':_0x390119[_0x834e('0x33')],'type':_0x390119[_0x834e('0x34')][_0x834e('0x35')]};});_0x5dacc1['model']=_[_0x834e('0x30')](_0x11f1ce,'name');_0x5dacc1[_0x834e('0x36')]=_[_0x834e('0x37')](_0x2c7a8d[_0x834e('0x36')]);_0x5dacc1[_0x834e('0x38')]=_[_0x834e('0x39')](_0x5dacc1[_0x834e('0x3a')],_0x5dacc1[_0x834e('0x36')]);_0x106d6a[_0x834e('0x3b')]=_[_0x834e('0x39')](_0x5dacc1[_0x834e('0x3a')],qs['fields'](_0x2c7a8d[_0x834e('0x36')][_0x834e('0x3c')]));_0x106d6a[_0x834e('0x3b')]=_0x106d6a[_0x834e('0x3b')]['length']?_0x106d6a[_0x834e('0x3b')]:_0x5dacc1[_0x834e('0x3a')];if(!_0x2c7a8d['query']['hasOwnProperty']('nolimit')){_0x106d6a[_0x834e('0x22')]=qs[_0x834e('0x22')](_0x2c7a8d[_0x834e('0x36')][_0x834e('0x22')]);_0x106d6a[_0x834e('0x21')]=qs[_0x834e('0x21')](_0x2c7a8d['query'][_0x834e('0x21')]);}_0x106d6a['order']=qs[_0x834e('0x3d')](_0x2c7a8d[_0x834e('0x36')]['sort']);_0x106d6a[_0x834e('0x3e')]=qs[_0x834e('0x38')](_['pick'](_0x2c7a8d['query'],_0x5dacc1[_0x834e('0x38')]));if(_0x2c7a8d[_0x834e('0x36')][_0x834e('0x3f')]){_0x106d6a[_0x834e('0x3e')]=_[_0x834e('0x40')](_0x106d6a['where'],{'$or':_[_0x834e('0x30')](_0x11f1ce,function(_0x548d1d){if(_0x548d1d['type']!==_0x834e('0x41')){var _0x4a7f76={};_0x4a7f76[_0x548d1d[_0x834e('0x2f')]]={'$like':'%'+_0x2c7a8d[_0x834e('0x36')][_0x834e('0x3f')]+'%'};return _0x4a7f76;}})});}_0x106d6a=_[_0x834e('0x40')]({},_0x106d6a,_0x2c7a8d[_0x834e('0x42')]);var _0x574ea8={'where':_0x106d6a[_0x834e('0x3e')]};return db[_0x834e('0x31')][_0x834e('0x20')](_0x574ea8)['then'](function(_0x35380e){_0xb5bc06[_0x834e('0x20')]=_0x35380e;if(_0x2c7a8d['query'][_0x834e('0x43')]){_0x106d6a['include']=[{'all':!![]}];}return db[_0x834e('0x31')][_0x834e('0x44')](_0x106d6a);})['then'](function(_0x4a6942){_0xb5bc06[_0x834e('0x45')]=_0x4a6942;return _0xb5bc06;})[_0x834e('0x29')](respondWithFilteredResult(_0x567cea,_0x106d6a))[_0x834e('0x46')](handleError(_0x567cea,null));};exports[_0x834e('0x47')]=function(_0x8ad264,_0x23feea){var _0x195204={'raw':!![],'where':{'id':_0x8ad264[_0x834e('0x48')]['id']}},_0x4a3381={};_0x4a3381['model']=_[_0x834e('0x37')](db['Interval'][_0x834e('0x32')]);_0x4a3381['query']=_[_0x834e('0x37')](_0x8ad264[_0x834e('0x36')]);_0x4a3381['filters']=_[_0x834e('0x39')](_0x4a3381[_0x834e('0x3a')],_0x4a3381[_0x834e('0x36')]);_0x195204[_0x834e('0x3b')]=_[_0x834e('0x39')](_0x4a3381[_0x834e('0x3a')],qs[_0x834e('0x3c')](_0x8ad264[_0x834e('0x36')][_0x834e('0x3c')]));_0x195204[_0x834e('0x3b')]=_0x195204['attributes'][_0x834e('0x49')]?_0x195204[_0x834e('0x3b')]:_0x4a3381['model'];if(_0x8ad264[_0x834e('0x36')][_0x834e('0x43')]){_0x195204[_0x834e('0x4a')]=[{'all':!![]}];}_0x195204=_[_0x834e('0x40')]({},_0x195204,_0x8ad264[_0x834e('0x42')]);return db[_0x834e('0x31')]['find'](_0x195204)['then'](handleEntityNotFound(_0x23feea,null))[_0x834e('0x29')](respondWithResult(_0x23feea,null))[_0x834e('0x46')](handleError(_0x23feea,null));};exports[_0x834e('0x4b')]=function(_0x40ff5a,_0x3da408){return db[_0x834e('0x31')][_0x834e('0x4b')](_0x40ff5a[_0x834e('0x4c')],{})[_0x834e('0x29')](function(_0x390c45){var _0xf02f0d=_0x40ff5a[_0x834e('0x4d')][_0x834e('0x2b')]({'plain':!![]});if(!_0xf02f0d)throw new Error(_0x834e('0x4e'));if(_0xf02f0d[_0x834e('0x4f')]===_0x834e('0x4d')){var _0x3df078=_0x390c45[_0x834e('0x2b')]({'plain':!![]});var _0x420841=_0x834e('0x50');return db['UserProfileSection'][_0x834e('0x51')]({'where':{'name':_0x420841,'userProfileId':_0xf02f0d[_0x834e('0x52')]},'raw':!![]})['then'](function(_0x3c00a3){if(_0x3c00a3&&_0x3c00a3[_0x834e('0x53')]===0x0){return db['UserProfileResource'][_0x834e('0x4b')]({'name':_0x3df078[_0x834e('0x2f')],'resourceId':_0x3df078['id'],'type':_0x3c00a3[_0x834e('0x2f')],'sectionId':_0x3c00a3['id']},{})[_0x834e('0x29')](function(){return _0x390c45;});}else{return _0x390c45;}})[_0x834e('0x46')](function(_0xb77aab){logger[_0x834e('0x2d')]('Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s',_0xb77aab);throw _0xb77aab;});}return _0x390c45;})[_0x834e('0x29')](respondWithResult(_0x3da408,0xc9))[_0x834e('0x46')](handleError(_0x3da408,null));};exports[_0x834e('0x54')]=function(_0x363675,_0x86ad2b){if(_0x363675[_0x834e('0x4c')]['id']){delete _0x363675[_0x834e('0x4c')]['id'];}return db[_0x834e('0x31')]['find']({'where':{'id':_0x363675[_0x834e('0x48')]['id']}})['then'](handleEntityNotFound(_0x86ad2b,null))[_0x834e('0x29')](saveUpdates(_0x363675['body'],null))[_0x834e('0x29')](respondWithResult(_0x86ad2b,null))['catch'](handleError(_0x86ad2b,null));};exports['destroy']=function(_0x6c0b29,_0x3e1bee){return db['Interval']['find']({'where':{'id':_0x6c0b29[_0x834e('0x48')]['id']}})[_0x834e('0x29')](handleEntityNotFound(_0x3e1bee,null))[_0x834e('0x29')](removeEntity(_0x3e1bee,null))[_0x834e('0x46')](handleError(_0x3e1bee,null));};exports[_0x834e('0x55')]=function(_0x315858,_0x3d3f2b,_0x4273f1){if(_0x315858['body']['id']){delete _0x315858[_0x834e('0x4c')]['id'];}return db[_0x834e('0x31')]['find']({'where':{'id':_0x315858[_0x834e('0x48')]['id']}})['then'](handleEntityNotFound(_0x3d3f2b,null))[_0x834e('0x29')](function(_0x45eceb){if(_0x45eceb){_0x315858['body'][_0x834e('0x56')]=_0x45eceb['id'];return db[_0x834e('0x31')][_0x834e('0x4b')](_0x315858[_0x834e('0x4c')]);}})['then'](respondWithResult(_0x3d3f2b,null))[_0x834e('0x46')](handleError(_0x3d3f2b,null));};exports[_0x834e('0x57')]=function(_0x1dfd5f,_0x5925ef,_0x246b8e){var _0x1fcae9={};var _0x3a7683={};var _0x1a0cd0;var _0x3183c5;return db[_0x834e('0x31')][_0x834e('0x58')]({'where':{'id':_0x1dfd5f[_0x834e('0x48')]['id']}})[_0x834e('0x29')](handleEntityNotFound(_0x5925ef,null))[_0x834e('0x29')](function(_0x1e4310){if(_0x1e4310){_0x1a0cd0=_0x1e4310;_0x3a7683[_0x834e('0x3a')]=_[_0x834e('0x37')](db[_0x834e('0x31')][_0x834e('0x32')]);_0x3a7683[_0x834e('0x36')]=_[_0x834e('0x37')](_0x1dfd5f[_0x834e('0x36')]);_0x3a7683[_0x834e('0x38')]=_[_0x834e('0x39')](_0x3a7683[_0x834e('0x3a')],_0x3a7683[_0x834e('0x36')]);_0x1fcae9['attributes']=_[_0x834e('0x39')](_0x3a7683[_0x834e('0x3a')],qs[_0x834e('0x3c')](_0x1dfd5f[_0x834e('0x36')]['fields']));_0x1fcae9[_0x834e('0x3b')]=_0x1fcae9['attributes']['length']?_0x1fcae9[_0x834e('0x3b')]:_0x3a7683[_0x834e('0x3a')];_0x1fcae9[_0x834e('0x59')]=qs[_0x834e('0x3d')](_0x1dfd5f[_0x834e('0x36')][_0x834e('0x3d')]);_0x1fcae9[_0x834e('0x3e')]=qs[_0x834e('0x38')](_['pick'](_0x1dfd5f[_0x834e('0x36')],_0x3a7683['filters']));if(_0x1dfd5f[_0x834e('0x36')][_0x834e('0x3f')]){_0x1fcae9['where']=_['merge'](_0x1fcae9[_0x834e('0x3e')],{'$or':_[_0x834e('0x30')](_0x1fcae9[_0x834e('0x3b')],function(_0x2cca07){var _0x2c41bd={};_0x2c41bd[_0x2cca07]={'$like':'%'+_0x1dfd5f['query'][_0x834e('0x3f')]+'%'};return _0x2c41bd;})});}_0x1fcae9=_[_0x834e('0x40')]({},_0x1fcae9,_0x1dfd5f[_0x834e('0x42')]);return _0x1a0cd0[_0x834e('0x57')](_0x1fcae9);}})[_0x834e('0x29')](function(_0x28b5c9){if(_0x28b5c9){_0x3183c5=_0x28b5c9[_0x834e('0x49')];if(!_0x1dfd5f[_0x834e('0x36')][_0x834e('0x5a')](_0x834e('0x5b'))){_0x1fcae9['limit']=qs[_0x834e('0x22')](_0x1dfd5f[_0x834e('0x36')][_0x834e('0x22')]);_0x1fcae9[_0x834e('0x21')]=qs['offset'](_0x1dfd5f[_0x834e('0x36')]['offset']);}return _0x1a0cd0['getIntervals'](_0x1fcae9);}})['then'](function(_0x452f7f){if(_0x452f7f){return _0x452f7f?{'count':_0x3183c5,'rows':_0x452f7f}:null;}})[_0x834e('0x29')](respondWithResult(_0x5925ef,null))['catch'](handleError(_0x5925ef,null));};exports[_0x834e('0x5c')]=function(_0x1b200d,_0x4d4477,_0x353246){return db[_0x834e('0x31')]['findOne']({'where':{'id':_0x1b200d['params']['id']}})[_0x834e('0x29')](handleEntityNotFound(_0x4d4477,null))[_0x834e('0x29')](function(_0x8bc7d9){if(_0x8bc7d9){return db[_0x834e('0x5d')][_0x834e('0x5e')](function(_0x493239){return db[_0x834e('0x31')]['destroy']({'where':{'IntervalId':_0x1b200d[_0x834e('0x48')]['id']},'transaction':_0x493239})[_0x834e('0x29')](function(_0x2c758c){var _0x5afb41=_[_0x834e('0x30')](_0x1b200d[_0x834e('0x4c')],function(_0x48521f){delete _0x48521f['id'];_0x48521f[_0x834e('0x56')]=_0x1b200d[_0x834e('0x48')]['id'];return _0x48521f;});return db[_0x834e('0x31')]['bulkCreate'](_0x5afb41,{'transaction':_0x493239});});})[_0x834e('0x29')](function(){return db[_0x834e('0x31')][_0x834e('0x44')]({'where':{'IntervalId':_0x1b200d[_0x834e('0x48')]['id']}});});}})[_0x834e('0x29')](respondWithResult(_0x4d4477,null))[_0x834e('0x46')](handleError(_0x4d4477,null));};
\ No newline at end of file
diff --git a/server/api/interval/interval.model.js b/server/api/interval/interval.model.js
index 3dea9dc..bc3e33d 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 _0xf2fa=['lodash','api','moment','bluebird','request-promise','path','rimraf','../../config/environment','exports','define','Interval','tools_intervals','rewrite'];(function(_0x122ef9,_0x451d2a){var _0x42fba0=function(_0x17c9d3){while(--_0x17c9d3){_0x122ef9['push'](_0x122ef9['shift']());}};_0x42fba0(++_0x451d2a);}(_0xf2fa,0xd0));var _0xaf2f=function(_0x321bb2,_0x202794){_0x321bb2=_0x321bb2-0x0;var _0x9c12ed=_0xf2fa[_0x321bb2];return _0x9c12ed;};'use strict';var _=require(_0xaf2f('0x0'));var util=require('util');var logger=require('../../config/logger')(_0xaf2f('0x1'));var moment=require(_0xaf2f('0x2'));var BPromise=require(_0xaf2f('0x3'));var rp=require(_0xaf2f('0x4'));var fs=require('fs');var path=require(_0xaf2f('0x5'));var rimraf=require(_0xaf2f('0x6'));var config=require(_0xaf2f('0x7'));var attributes=require('./interval.attributes');var extensions=require('../../components/extensions/rewrite');module[_0xaf2f('0x8')]=function(_0x49e700,_0x45e164){return _0x49e700[_0xaf2f('0x9')](_0xaf2f('0xa'),attributes,{'tableName':_0xaf2f('0xb'),'paranoid':![],'indexes':[],'timestamps':!![],'hooks':{'afterCreate':function(_0x2b65f2,_0x5e8ad0){extensions['rewrite'](_0x49e700,_0x2b65f2);},'afterBulkCreate':function(_0x50c838,_0xfd9db5,_0x32715e){_0x32715e();extensions[_0xaf2f('0xc')](_0x49e700,_0x50c838[0x0]);},'afterUpdate':function(_0x9f0311,_0xa1081f){extensions[_0xaf2f('0xc')](_0x49e700,_0x9f0311);},'afterDestroy':function(_0x33d60e,_0x26f602){extensions['rewrite'](_0x49e700,_0x33d60e);}}});};
\ No newline at end of file
+var _0xa870=['define','tools_intervals','rewrite','lodash','api','moment','bluebird','path','../../config/environment','exports'];(function(_0x71e57f,_0x137a93){var _0x1ea64e=function(_0x1a5168){while(--_0x1a5168){_0x71e57f['push'](_0x71e57f['shift']());}};_0x1ea64e(++_0x137a93);}(_0xa870,0x143));var _0x0a87=function(_0x246075,_0x3d097c){_0x246075=_0x246075-0x0;var _0x2fbbb8=_0xa870[_0x246075];return _0x2fbbb8;};'use strict';var _=require(_0x0a87('0x0'));var util=require('util');var logger=require('../../config/logger')(_0x0a87('0x1'));var moment=require(_0x0a87('0x2'));var BPromise=require(_0x0a87('0x3'));var rp=require('request-promise');var fs=require('fs');var path=require(_0x0a87('0x4'));var rimraf=require('rimraf');var config=require(_0x0a87('0x5'));var attributes=require('./interval.attributes');var extensions=require('../../components/extensions/rewrite');module[_0x0a87('0x6')]=function(_0x30235a,_0x1d38ae){return _0x30235a[_0x0a87('0x7')]('Interval',attributes,{'tableName':_0x0a87('0x8'),'paranoid':![],'indexes':[],'timestamps':!![],'hooks':{'afterCreate':function(_0x5a7321,_0x1133d6){extensions[_0x0a87('0x9')](_0x30235a,_0x5a7321);},'afterBulkCreate':function(_0x2a21be,_0x340ec6,_0x4a9ce6){_0x4a9ce6();extensions['rewrite'](_0x30235a,_0x2a21be[0x0]);},'afterUpdate':function(_0x37adae,_0x435315){extensions[_0x0a87('0x9')](_0x30235a,_0x37adae);},'afterDestroy':function(_0x1c8acb,_0x18a80e){extensions[_0x0a87('0x9')](_0x30235a,_0x1c8acb);}}});};
\ No newline at end of file
diff --git a/server/api/interval/interval.rpc.js b/server/api/interval/interval.rpc.js
index bc383e7..4123b09 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 _0x6178=['error','code','message','result','catch','GetInterval','Interval','findAll','options','attributes','include','map','model','ShowInterval','find','raw','lodash','util','moment','bluebird','randomstring','../../mysqldb','../../config/utils','../../config/logger','jayson/promise','http','request','then','info','Interval,\x20%s,\x20%s','request\x20sent','debug','Interval,\x20%s,\x20%s,\x20%s','stringify'];(function(_0x1979a5,_0x2f6748){var _0x17fbdb=function(_0x4b2860){while(--_0x4b2860){_0x1979a5['push'](_0x1979a5['shift']());}};_0x17fbdb(++_0x2f6748);}(_0x6178,0xdc));var _0x8617=function(_0x335d12,_0x4c9a5c){_0x335d12=_0x335d12-0x0;var _0x2723d2=_0x6178[_0x335d12];return _0x2723d2;};'use strict';var _=require(_0x8617('0x0'));var util=require(_0x8617('0x1'));var moment=require(_0x8617('0x2'));var BPromise=require(_0x8617('0x3'));var rs=require(_0x8617('0x4'));var fs=require('fs');var Redis=require('ioredis');var db=require(_0x8617('0x5'))['db'];var utils=require(_0x8617('0x6'));var logger=require(_0x8617('0x7'))('rpc');var config=require('../../config/environment');var jayson=require(_0x8617('0x8'));var client=jayson['client'][_0x8617('0x9')]({'port':0x232a});function respondWithRpcPromise(_0x570788,_0x55e111,_0x152754){return new BPromise(function(_0x25faf6,_0x2bba7f){return client[_0x8617('0xa')](_0x570788,_0x152754)[_0x8617('0xb')](function(_0x45e426){logger[_0x8617('0xc')](_0x8617('0xd'),_0x55e111,_0x8617('0xe'));logger[_0x8617('0xf')](_0x8617('0x10'),_0x55e111,'request\x20sent',JSON[_0x8617('0x11')](_0x45e426));if(_0x45e426['error']){if(_0x45e426[_0x8617('0x12')][_0x8617('0x13')]===0x1f4){logger[_0x8617('0x12')](_0x8617('0xd'),_0x55e111,_0x45e426[_0x8617('0x12')][_0x8617('0x14')]);return _0x2bba7f(_0x45e426[_0x8617('0x12')]['message']);}logger[_0x8617('0x12')](_0x8617('0xd'),_0x55e111,_0x45e426[_0x8617('0x12')]['message']);return _0x25faf6(_0x45e426[_0x8617('0x12')][_0x8617('0x14')]);}else{logger['info'](_0x8617('0xd'),_0x55e111,_0x8617('0xe'));_0x25faf6(_0x45e426[_0x8617('0x15')][_0x8617('0x14')]);}})[_0x8617('0x16')](function(_0xd6e381){logger[_0x8617('0x12')](_0x8617('0xd'),_0x55e111,_0xd6e381);_0x2bba7f(_0xd6e381);});});}exports[_0x8617('0x17')]=function(_0x59a38e){var _0x55542c=this;return new Promise(function(_0x1a2c65,_0x4b5c1f){return db[_0x8617('0x18')][_0x8617('0x19')]({'raw':_0x59a38e['options']?_0x59a38e[_0x8617('0x1a')]['raw']===undefined?!![]:![]:!![],'where':_0x59a38e[_0x8617('0x1a')]?_0x59a38e[_0x8617('0x1a')]['where']||null:null,'attributes':_0x59a38e[_0x8617('0x1a')]?_0x59a38e[_0x8617('0x1a')][_0x8617('0x1b')]||null:null,'limit':_0x59a38e[_0x8617('0x1a')]?_0x59a38e[_0x8617('0x1a')]['limit']||null:null,'include':_0x59a38e['options']?_0x59a38e[_0x8617('0x1a')][_0x8617('0x1c')]?_[_0x8617('0x1d')](_0x59a38e['options'][_0x8617('0x1c')],function(_0x39c8ca){return{'model':db[_0x39c8ca['model']],'as':_0x39c8ca['as'],'attributes':_0x39c8ca['attributes'],'include':_0x39c8ca[_0x8617('0x1c')]?_[_0x8617('0x1d')](_0x39c8ca[_0x8617('0x1c')],function(_0x1483ad){return{'model':db[_0x1483ad[_0x8617('0x1e')]],'as':_0x1483ad['as'],'attributes':_0x1483ad[_0x8617('0x1b')],'include':_0x1483ad[_0x8617('0x1c')]?_[_0x8617('0x1d')](_0x1483ad[_0x8617('0x1c')],function(_0x27a17c){return{'model':db[_0x27a17c[_0x8617('0x1e')]],'as':_0x27a17c['as'],'attributes':_0x27a17c[_0x8617('0x1b')]};}):[]};}):[]};}):[]:[]})['then'](function(_0x3cc59d){logger[_0x8617('0xc')](_0x8617('0x17'),_0x59a38e);logger[_0x8617('0xf')](_0x8617('0x17'),_0x59a38e,JSON[_0x8617('0x11')](_0x3cc59d));_0x1a2c65(_0x3cc59d);})[_0x8617('0x16')](function(_0x1383c5){logger[_0x8617('0x12')](_0x8617('0x17'),_0x1383c5[_0x8617('0x14')],_0x59a38e);_0x4b5c1f(_0x55542c[_0x8617('0x12')](0x1f4,_0x1383c5[_0x8617('0x14')]));});});};exports[_0x8617('0x1f')]=function(_0x11a35f){var _0x5c1aa6=this;return new Promise(function(_0x59758f,_0x7d141b){return db['Interval'][_0x8617('0x20')]({'raw':_0x11a35f[_0x8617('0x1a')]?_0x11a35f[_0x8617('0x1a')][_0x8617('0x21')]===undefined?!![]:![]:!![],'where':_0x11a35f[_0x8617('0x1a')]?_0x11a35f['options']['where']||null:null,'attributes':_0x11a35f[_0x8617('0x1a')]?_0x11a35f[_0x8617('0x1a')][_0x8617('0x1b')]||null:null,'include':_0x11a35f[_0x8617('0x1a')]?_0x11a35f[_0x8617('0x1a')][_0x8617('0x1c')]?_['map'](_0x11a35f[_0x8617('0x1a')][_0x8617('0x1c')],function(_0x23f78c){return{'model':db[_0x23f78c['model']],'as':_0x23f78c['as'],'attributes':_0x23f78c[_0x8617('0x1b')],'include':_0x23f78c[_0x8617('0x1c')]?_[_0x8617('0x1d')](_0x23f78c['include'],function(_0x822072){return{'model':db[_0x822072[_0x8617('0x1e')]],'as':_0x822072['as'],'attributes':_0x822072[_0x8617('0x1b')],'include':_0x822072[_0x8617('0x1c')]?_[_0x8617('0x1d')](_0x822072[_0x8617('0x1c')],function(_0x1dd638){return{'model':db[_0x1dd638['model']],'as':_0x1dd638['as'],'attributes':_0x1dd638[_0x8617('0x1b')]};}):[]};}):[]};}):[]:[]})['then'](function(_0x494c75){logger[_0x8617('0xc')](_0x8617('0x1f'),_0x11a35f);logger['debug'](_0x8617('0x1f'),_0x11a35f,JSON[_0x8617('0x11')](_0x494c75));_0x59758f(_0x494c75);})[_0x8617('0x16')](function(_0x11d147){logger[_0x8617('0x12')](_0x8617('0x1f'),_0x11d147['message'],_0x11a35f);_0x7d141b(_0x5c1aa6[_0x8617('0x12')](0x1f4,_0x11d147[_0x8617('0x14')]));});});};
\ No newline at end of file
+var _0x091c=['where','limit','include','map','attributes','ShowInterval','Interval','find','model','lodash','util','moment','randomstring','ioredis','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','client','http','then','info','Interval,\x20%s,\x20%s','request\x20sent','debug','Interval,\x20%s,\x20%s,\x20%s','stringify','error','code','message','catch','GetInterval','findAll','options','raw'];(function(_0x377a6a,_0x20f864){var _0x166ab9=function(_0x3f29b3){while(--_0x3f29b3){_0x377a6a['push'](_0x377a6a['shift']());}};_0x166ab9(++_0x20f864);}(_0x091c,0xbd));var _0xc091=function(_0x13f0f9,_0x30f9c9){_0x13f0f9=_0x13f0f9-0x0;var _0x5b832c=_0x091c[_0x13f0f9];return _0x5b832c;};'use strict';var _=require(_0xc091('0x0'));var util=require(_0xc091('0x1'));var moment=require(_0xc091('0x2'));var BPromise=require('bluebird');var rs=require(_0xc091('0x3'));var fs=require('fs');var Redis=require(_0xc091('0x4'));var db=require('../../mysqldb')['db'];var utils=require(_0xc091('0x5'));var logger=require(_0xc091('0x6'))(_0xc091('0x7'));var config=require(_0xc091('0x8'));var jayson=require(_0xc091('0x9'));var client=jayson[_0xc091('0xa')][_0xc091('0xb')]({'port':0x232a});function respondWithRpcPromise(_0x1088ce,_0x301798,_0x5a8cb9){return new BPromise(function(_0x21e40c,_0x4e1fdd){return client['request'](_0x1088ce,_0x5a8cb9)[_0xc091('0xc')](function(_0x10c0b0){logger[_0xc091('0xd')](_0xc091('0xe'),_0x301798,_0xc091('0xf'));logger[_0xc091('0x10')](_0xc091('0x11'),_0x301798,_0xc091('0xf'),JSON[_0xc091('0x12')](_0x10c0b0));if(_0x10c0b0[_0xc091('0x13')]){if(_0x10c0b0['error'][_0xc091('0x14')]===0x1f4){logger[_0xc091('0x13')](_0xc091('0xe'),_0x301798,_0x10c0b0[_0xc091('0x13')][_0xc091('0x15')]);return _0x4e1fdd(_0x10c0b0[_0xc091('0x13')][_0xc091('0x15')]);}logger['error']('Interval,\x20%s,\x20%s',_0x301798,_0x10c0b0['error']['message']);return _0x21e40c(_0x10c0b0[_0xc091('0x13')][_0xc091('0x15')]);}else{logger[_0xc091('0xd')](_0xc091('0xe'),_0x301798,_0xc091('0xf'));_0x21e40c(_0x10c0b0['result'][_0xc091('0x15')]);}})[_0xc091('0x16')](function(_0x35c1be){logger[_0xc091('0x13')](_0xc091('0xe'),_0x301798,_0x35c1be);_0x4e1fdd(_0x35c1be);});});}exports[_0xc091('0x17')]=function(_0x17a64d){var _0x1ebba4=this;return new Promise(function(_0x39b960,_0x3c2540){return db['Interval'][_0xc091('0x18')]({'raw':_0x17a64d[_0xc091('0x19')]?_0x17a64d[_0xc091('0x19')][_0xc091('0x1a')]===undefined?!![]:![]:!![],'where':_0x17a64d[_0xc091('0x19')]?_0x17a64d[_0xc091('0x19')][_0xc091('0x1b')]||null:null,'attributes':_0x17a64d[_0xc091('0x19')]?_0x17a64d[_0xc091('0x19')]['attributes']||null:null,'limit':_0x17a64d[_0xc091('0x19')]?_0x17a64d[_0xc091('0x19')][_0xc091('0x1c')]||null:null,'include':_0x17a64d['options']?_0x17a64d['options'][_0xc091('0x1d')]?_[_0xc091('0x1e')](_0x17a64d['options'][_0xc091('0x1d')],function(_0x886785){return{'model':db[_0x886785['model']],'as':_0x886785['as'],'attributes':_0x886785[_0xc091('0x1f')],'include':_0x886785['include']?_[_0xc091('0x1e')](_0x886785[_0xc091('0x1d')],function(_0x3ecc7c){return{'model':db[_0x3ecc7c['model']],'as':_0x3ecc7c['as'],'attributes':_0x3ecc7c[_0xc091('0x1f')],'include':_0x3ecc7c[_0xc091('0x1d')]?_['map'](_0x3ecc7c[_0xc091('0x1d')],function(_0x113055){return{'model':db[_0x113055['model']],'as':_0x113055['as'],'attributes':_0x113055['attributes']};}):[]};}):[]};}):[]:[]})[_0xc091('0xc')](function(_0x1128d7){logger['info'](_0xc091('0x17'),_0x17a64d);logger[_0xc091('0x10')](_0xc091('0x17'),_0x17a64d,JSON[_0xc091('0x12')](_0x1128d7));_0x39b960(_0x1128d7);})['catch'](function(_0x107b0a){logger['error'](_0xc091('0x17'),_0x107b0a['message'],_0x17a64d);_0x3c2540(_0x1ebba4[_0xc091('0x13')](0x1f4,_0x107b0a['message']));});});};exports[_0xc091('0x20')]=function(_0x145756){var _0x48edd2=this;return new Promise(function(_0x276bb0,_0x3d9349){return db[_0xc091('0x21')][_0xc091('0x22')]({'raw':_0x145756[_0xc091('0x19')]?_0x145756[_0xc091('0x19')][_0xc091('0x1a')]===undefined?!![]:![]:!![],'where':_0x145756['options']?_0x145756[_0xc091('0x19')]['where']||null:null,'attributes':_0x145756[_0xc091('0x19')]?_0x145756[_0xc091('0x19')][_0xc091('0x1f')]||null:null,'include':_0x145756['options']?_0x145756[_0xc091('0x19')][_0xc091('0x1d')]?_[_0xc091('0x1e')](_0x145756['options'][_0xc091('0x1d')],function(_0x2da19e){return{'model':db[_0x2da19e[_0xc091('0x23')]],'as':_0x2da19e['as'],'attributes':_0x2da19e[_0xc091('0x1f')],'include':_0x2da19e[_0xc091('0x1d')]?_[_0xc091('0x1e')](_0x2da19e['include'],function(_0x3ea6e4){return{'model':db[_0x3ea6e4[_0xc091('0x23')]],'as':_0x3ea6e4['as'],'attributes':_0x3ea6e4['attributes'],'include':_0x3ea6e4[_0xc091('0x1d')]?_['map'](_0x3ea6e4['include'],function(_0xddce72){return{'model':db[_0xddce72[_0xc091('0x23')]],'as':_0xddce72['as'],'attributes':_0xddce72[_0xc091('0x1f')]};}):[]};}):[]};}):[]:[]})[_0xc091('0xc')](function(_0x326fcd){logger[_0xc091('0xd')](_0xc091('0x20'),_0x145756);logger['debug'](_0xc091('0x20'),_0x145756,JSON['stringify'](_0x326fcd));_0x276bb0(_0x326fcd);})[_0xc091('0x16')](function(_0x7237ac){logger[_0xc091('0x13')]('ShowInterval',_0x7237ac['message'],_0x145756);_0x3d9349(_0x48edd2['error'](0x1f4,_0x7237ac['message']));});});};
\ No newline at end of file
diff --git a/server/api/jira/index.js b/server/api/jira/index.js
index 7c89487..869d858 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 _0x3f2b=['send','express','Router','../../components/auth/service','./jira.controller','post','isAuthenticated'];(function(_0x1591b0,_0x31909f){var _0x29c8de=function(_0x2f629f){while(--_0x2f629f){_0x1591b0['push'](_0x1591b0['shift']());}};_0x29c8de(++_0x31909f);}(_0x3f2b,0x13c));var _0xb3f2=function(_0x12082a,_0xc9ffa9){_0x12082a=_0x12082a-0x0;var _0x2f9e71=_0x3f2b[_0x12082a];return _0x2f9e71;};'use strict';var express=require(_0xb3f2('0x0'));var router=express[_0xb3f2('0x1')]();var auth=require(_0xb3f2('0x2'));var controller=require(_0xb3f2('0x3'));router[_0xb3f2('0x4')]('/',auth[_0xb3f2('0x5')](),controller[_0xb3f2('0x6')]);module['exports']=router;
\ No newline at end of file
+var _0x2b34=['isAuthenticated','send','exports','Router','../../components/auth/service','./jira.controller','post'];(function(_0x59b32c,_0x2741f7){var _0x5a42fb=function(_0x15b9a1){while(--_0x15b9a1){_0x59b32c['push'](_0x59b32c['shift']());}};_0x5a42fb(++_0x2741f7);}(_0x2b34,0x81));var _0x42b3=function(_0x58a4b9,_0x1a8f42){_0x58a4b9=_0x58a4b9-0x0;var _0x69dbe1=_0x2b34[_0x58a4b9];return _0x69dbe1;};'use strict';var express=require('express');var router=express[_0x42b3('0x0')]();var auth=require(_0x42b3('0x1'));var controller=require(_0x42b3('0x2'));router[_0x42b3('0x3')]('/',auth[_0x42b3('0x4')](),controller[_0x42b3('0x5')]);module[_0x42b3('0x6')]=router;
\ No newline at end of file
diff --git a/server/api/jira/jira.controller.js b/server/api/jira/jira.controller.js
index 4ce95a9..5ad365b 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 _0xa754=['status','statusCode','json','parse','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','socket','connection','remoteAddress','bluebird','https','../../config/logger','key','MOTGUI','summary','Report','\x20from\x20','description','stringify','Bug','fields','customfield_11500','customfield_11502','customfield_11503','customfield_11504','reason','track.xcallymotion.com','/rest/api/2/issue','POST','application/json','Basic\x20','toString','base64','request','setEncoding','utf8','data','end'];(function(_0x54e4d5,_0x20669c){var _0x41a222=function(_0x27b7c1){while(--_0x27b7c1){_0x54e4d5['push'](_0x54e4d5['shift']());}};_0x41a222(++_0x20669c);}(_0xa754,0x1f3));var _0x4a75=function(_0xdac719,_0x45f6f7){_0xdac719=_0xdac719-0x0;var _0x3ff0a9=_0xa754[_0xdac719];return _0x3ff0a9;};'use strict';var BPromise=require(_0x4a75('0x0'));var https=require(_0x4a75('0x1'));var logger=require(_0x4a75('0x2'))('api');var USERNAME='support';var PASSWORD='3eAmWpBVP0';function openIssue(_0xf5bb0a,_0x6b0829){var _0x5d87b1={'fields':{'project':{'key':_0xf5bb0a[_0x4a75('0x3')]||_0x4a75('0x4')},'summary':(_0xf5bb0a[_0x4a75('0x5')]||_0x4a75('0x6'))+_0x4a75('0x7')+_0xf5bb0a['ip'],'description':_0xf5bb0a[_0x4a75('0x8')]||JSON[_0x4a75('0x9')](_0xf5bb0a),'issuetype':{'name':_0xf5bb0a['issuetype']||_0x4a75('0xa')}}};_0x5d87b1[_0x4a75('0xb')][_0x4a75('0xc')]=_0xf5bb0a['email'];_0x5d87b1['fields']['customfield_11501']=_0xf5bb0a['oldToken'];_0x5d87b1[_0x4a75('0xb')][_0x4a75('0xd')]=_0xf5bb0a['newToken'];_0x5d87b1[_0x4a75('0xb')][_0x4a75('0xe')]=_0xf5bb0a['name'];_0x5d87b1[_0x4a75('0xb')][_0x4a75('0xf')]=_0xf5bb0a[_0x4a75('0x10')];_0x5d87b1['fields']['customfield_10102']=_0xf5bb0a['ip'];var _0x1f73d0={'host':_0x4a75('0x11'),'port':0x1bb,'path':_0x4a75('0x12'),'method':_0x4a75('0x13'),'timeout':0x4e20,'headers':{'Content-Type':_0x4a75('0x14'),'Authorization':_0x4a75('0x15')+new Buffer(USERNAME+':'+PASSWORD)[_0x4a75('0x16')](_0x4a75('0x17'))}};var _0x24c773=JSON[_0x4a75('0x9')](_0x5d87b1);var _0x18b8aa=https[_0x4a75('0x18')](_0x1f73d0,function(_0x5e4329){_0x5e4329[_0x4a75('0x19')](_0x4a75('0x1a'));var _0x135614='';_0x5e4329['on'](_0x4a75('0x1b'),function(_0x4ee416){_0x135614+=_0x4ee416;});_0x5e4329['on'](_0x4a75('0x1c'),function(){if(_0x6b0829){return _0x6b0829[_0x4a75('0x1d')](_0x5e4329[_0x4a75('0x1e')])[_0x4a75('0x1f')](JSON[_0x4a75('0x20')](_0x135614));}});});_0x18b8aa['on']('error',function(_0x199515){if(_0x6b0829){return _0x6b0829[_0x4a75('0x1d')](0x1f4)[_0x4a75('0x1f')]({'errors':[{'message':_0x4a75('0x21'),'type':_0x4a75('0x22')}]});}});_0x18b8aa[_0x4a75('0x23')](_0x24c773);_0x18b8aa[_0x4a75('0x1c')]();}exports[_0x4a75('0x24')]=openIssue;exports[_0x4a75('0x25')]=function(_0x1cb80a,_0x39192c){_0x1cb80a[_0x4a75('0x26')]['ip']=_0x1cb80a[_0x4a75('0x27')][_0x4a75('0x28')]||_0x1cb80a['connection']['remoteAddress']||_0x1cb80a[_0x4a75('0x29')]['remoteAddress']||_0x1cb80a[_0x4a75('0x2a')][_0x4a75('0x29')][_0x4a75('0x2b')];return openIssue(_0x1cb80a[_0x4a75('0x26')],_0x39192c);};
\ No newline at end of file
+var _0x6ac3=['setEncoding','utf8','status','statusCode','json','parse','error','api.jira','end','openIssue','send','body','connection','remoteAddress','socket','bluebird','https','../../config/logger','api','support','3eAmWpBVP0','key','summary','Report','\x20from\x20','description','stringify','issuetype','Bug','customfield_11500','fields','customfield_11501','oldToken','customfield_11502','newToken','customfield_11503','name','customfield_11504','reason','customfield_10102','track.xcallymotion.com','/rest/api/2/issue','POST','application/json','Basic\x20','base64','request'];(function(_0x58ab93,_0xdf0e53){var _0x8e8faa=function(_0x48381b){while(--_0x48381b){_0x58ab93['push'](_0x58ab93['shift']());}};_0x8e8faa(++_0xdf0e53);}(_0x6ac3,0x129));var _0x36ac=function(_0x56235c,_0x359549){_0x56235c=_0x56235c-0x0;var _0xbb4255=_0x6ac3[_0x56235c];return _0xbb4255;};'use strict';var BPromise=require(_0x36ac('0x0'));var https=require(_0x36ac('0x1'));var logger=require(_0x36ac('0x2'))(_0x36ac('0x3'));var USERNAME=_0x36ac('0x4');var PASSWORD=_0x36ac('0x5');function openIssue(_0x2c7ace,_0x3524c8){var _0x5cafff={'fields':{'project':{'key':_0x2c7ace[_0x36ac('0x6')]||'MOTGUI'},'summary':(_0x2c7ace[_0x36ac('0x7')]||_0x36ac('0x8'))+_0x36ac('0x9')+_0x2c7ace['ip'],'description':_0x2c7ace[_0x36ac('0xa')]||JSON[_0x36ac('0xb')](_0x2c7ace),'issuetype':{'name':_0x2c7ace[_0x36ac('0xc')]||_0x36ac('0xd')}}};_0x5cafff['fields'][_0x36ac('0xe')]=_0x2c7ace['email'];_0x5cafff[_0x36ac('0xf')][_0x36ac('0x10')]=_0x2c7ace[_0x36ac('0x11')];_0x5cafff[_0x36ac('0xf')][_0x36ac('0x12')]=_0x2c7ace[_0x36ac('0x13')];_0x5cafff[_0x36ac('0xf')][_0x36ac('0x14')]=_0x2c7ace[_0x36ac('0x15')];_0x5cafff[_0x36ac('0xf')][_0x36ac('0x16')]=_0x2c7ace[_0x36ac('0x17')];_0x5cafff['fields'][_0x36ac('0x18')]=_0x2c7ace['ip'];var _0x54e076={'host':_0x36ac('0x19'),'port':0x1bb,'path':_0x36ac('0x1a'),'method':_0x36ac('0x1b'),'timeout':0x4e20,'headers':{'Content-Type':_0x36ac('0x1c'),'Authorization':_0x36ac('0x1d')+new Buffer(USERNAME+':'+PASSWORD)['toString'](_0x36ac('0x1e'))}};var _0x553ffa=JSON[_0x36ac('0xb')](_0x5cafff);var _0x5a3835=https[_0x36ac('0x1f')](_0x54e076,function(_0x3f0e72){_0x3f0e72[_0x36ac('0x20')](_0x36ac('0x21'));var _0x122984='';_0x3f0e72['on']('data',function(_0x4d351b){_0x122984+=_0x4d351b;});_0x3f0e72['on']('end',function(){if(_0x3524c8){return _0x3524c8[_0x36ac('0x22')](_0x3f0e72[_0x36ac('0x23')])[_0x36ac('0x24')](JSON[_0x36ac('0x25')](_0x122984));}});});_0x5a3835['on'](_0x36ac('0x26'),function(_0x3bb35a){if(_0x3524c8){return _0x3524c8[_0x36ac('0x22')](0x1f4)[_0x36ac('0x24')]({'errors':[{'message':'Error\x20during\x20license\x20request.\x20Please\x20contact\x20our\x20license\x20team\x20at\x20license@xcally.com\x20with\x20your\x20request','type':_0x36ac('0x27')}]});}});_0x5a3835['write'](_0x553ffa);_0x5a3835[_0x36ac('0x28')]();}exports[_0x36ac('0x29')]=openIssue;exports[_0x36ac('0x2a')]=function(_0x231ff1,_0x368c49){_0x231ff1[_0x36ac('0x2b')]['ip']=_0x231ff1['headers']['x-forwarded-for']||_0x231ff1[_0x36ac('0x2c')][_0x36ac('0x2d')]||_0x231ff1[_0x36ac('0x2e')]['remoteAddress']||_0x231ff1['connection'][_0x36ac('0x2e')][_0x36ac('0x2d')];return openIssue(_0x231ff1[_0x36ac('0x2b')],_0x368c49);};
\ No newline at end of file
diff --git a/server/api/jscriptyAnswerReport/index.js b/server/api/jscriptyAnswerReport/index.js
index 8543754..315930e 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 _0x839d=['exports','path','connect-timeout','Router','../../components/auth/service','../../components/interaction/service','../../config/environment','./jscriptyAnswerReport.controller','get','isAuthenticated','index','/describe','describe','/:id','post','put','delete'];(function(_0x3635ce,_0x33a6f9){var _0x97ecd0=function(_0x123d98){while(--_0x123d98){_0x3635ce['push'](_0x3635ce['shift']());}};_0x97ecd0(++_0x33a6f9);}(_0x839d,0x1dd));var _0xd839=function(_0x4e9c01,_0x3da8eb){_0x4e9c01=_0x4e9c01-0x0;var _0x44b977=_0x839d[_0x4e9c01];return _0x44b977;};'use strict';var multer=require('multer');var util=require('util');var path=require(_0xd839('0x0'));var timeout=require(_0xd839('0x1'));var express=require('express');var router=express[_0xd839('0x2')]();var auth=require(_0xd839('0x3'));var interaction=require(_0xd839('0x4'));var config=require(_0xd839('0x5'));var controller=require(_0xd839('0x6'));router[_0xd839('0x7')]('/',auth[_0xd839('0x8')](),controller[_0xd839('0x9')]);router[_0xd839('0x7')](_0xd839('0xa'),auth[_0xd839('0x8')](),controller[_0xd839('0xb')]);router['get'](_0xd839('0xc'),auth['isAuthenticated'](),controller['show']);router[_0xd839('0xd')]('/',auth[_0xd839('0x8')](),controller['create']);router[_0xd839('0xe')]('/:id',auth['isAuthenticated'](),controller['update']);router[_0xd839('0xf')](_0xd839('0xc'),auth[_0xd839('0x8')](),controller['destroy']);module[_0xd839('0x10')]=router;
\ No newline at end of file
+var _0xbfc4=['index','/describe','describe','/:id','show','post','create','update','delete','destroy','exports','multer','util','path','connect-timeout','express','../../components/auth/service','../../components/interaction/service','../../config/environment','./jscriptyAnswerReport.controller','get','isAuthenticated'];(function(_0x3dd15e,_0x1f0015){var _0x231fd0=function(_0x4f680a){while(--_0x4f680a){_0x3dd15e['push'](_0x3dd15e['shift']());}};_0x231fd0(++_0x1f0015);}(_0xbfc4,0x1ad));var _0x4bfc=function(_0x16a9a3,_0x56ecd9){_0x16a9a3=_0x16a9a3-0x0;var _0xe7f3d9=_0xbfc4[_0x16a9a3];return _0xe7f3d9;};'use strict';var multer=require(_0x4bfc('0x0'));var util=require(_0x4bfc('0x1'));var path=require(_0x4bfc('0x2'));var timeout=require(_0x4bfc('0x3'));var express=require(_0x4bfc('0x4'));var router=express['Router']();var auth=require(_0x4bfc('0x5'));var interaction=require(_0x4bfc('0x6'));var config=require(_0x4bfc('0x7'));var controller=require(_0x4bfc('0x8'));router[_0x4bfc('0x9')]('/',auth[_0x4bfc('0xa')](),controller[_0x4bfc('0xb')]);router['get'](_0x4bfc('0xc'),auth['isAuthenticated'](),controller[_0x4bfc('0xd')]);router[_0x4bfc('0x9')](_0x4bfc('0xe'),auth[_0x4bfc('0xa')](),controller[_0x4bfc('0xf')]);router[_0x4bfc('0x10')]('/',auth['isAuthenticated'](),controller[_0x4bfc('0x11')]);router['put']('/:id',auth[_0x4bfc('0xa')](),controller[_0x4bfc('0x12')]);router[_0x4bfc('0x13')](_0x4bfc('0xe'),auth[_0x4bfc('0xa')](),controller[_0x4bfc('0x14')]);module[_0x4bfc('0x15')]=router;
\ No newline at end of file
diff --git a/server/api/jscriptyAnswerReport/jscriptyAnswerReport.attributes.js b/server/api/jscriptyAnswerReport/jscriptyAnswerReport.attributes.js
index f5e3056..6bea224 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 _0xc739=['long','sequelize','STRING','TEXT'];(function(_0x43b08,_0x15f967){var _0x5e05f4=function(_0x4bb0cb){while(--_0x4bb0cb){_0x43b08['push'](_0x43b08['shift']());}};_0x5e05f4(++_0x15f967);}(_0xc739,0x91));var _0x9c73=function(_0x31e77c,_0x2fa446){_0x31e77c=_0x31e77c-0x0;var _0x6b7c0b=_0xc739[_0x31e77c];return _0x6b7c0b;};'use strict';var Sequelize=require(_0x9c73('0x0'));module['exports']={'question':{'type':Sequelize[_0x9c73('0x1')]},'answer':{'type':Sequelize[_0x9c73('0x2')](_0x9c73('0x3'))},'membername':{'type':Sequelize['STRING']},'projectname':{'type':Sequelize[_0x9c73('0x1')]},'queue':{'type':Sequelize['STRING']},'uniqueid':{'type':Sequelize[_0x9c73('0x1')]},'calleridname':{'type':Sequelize['STRING']},'calleridnum':{'type':Sequelize[_0x9c73('0x1')]},'questionId':{'type':Sequelize[_0x9c73('0x1')]}};
\ No newline at end of file
+var _0x7990=['sequelize','exports','TEXT','long','STRING'];(function(_0x3142a6,_0x2c4863){var _0x18b30d=function(_0x3ad4b0){while(--_0x3ad4b0){_0x3142a6['push'](_0x3142a6['shift']());}};_0x18b30d(++_0x2c4863);}(_0x7990,0xd2));var _0x0799=function(_0x3e04db,_0x14cf3c){_0x3e04db=_0x3e04db-0x0;var _0x4ab641=_0x7990[_0x3e04db];return _0x4ab641;};'use strict';var Sequelize=require(_0x0799('0x0'));module[_0x0799('0x1')]={'question':{'type':Sequelize['STRING']},'answer':{'type':Sequelize[_0x0799('0x2')](_0x0799('0x3'))},'membername':{'type':Sequelize[_0x0799('0x4')]},'projectname':{'type':Sequelize[_0x0799('0x4')]},'queue':{'type':Sequelize[_0x0799('0x4')]},'uniqueid':{'type':Sequelize[_0x0799('0x4')]},'calleridname':{'type':Sequelize[_0x0799('0x4')]},'calleridnum':{'type':Sequelize['STRING']},'questionId':{'type':Sequelize[_0x0799('0x4')]}};
\ No newline at end of file
diff --git a/server/api/jscriptyAnswerReport/jscriptyAnswerReport.controller.js b/server/api/jscriptyAnswerReport/jscriptyAnswerReport.controller.js
index 60273ce..40729ba 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 _0xdb79=['papaparse','ioredis','../../components/auth/service','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/environment','../../mysqldb','status','end','json','offset','set','reject','save','update','destroy','then','sendStatus','error','name','send','index','map','JscriptyAnswerReport','rawAttributes','fieldName','type','model','query','filters','attributes','intersection','fields','length','hasOwnProperty','nolimit','limit','order','sort','filter','where','VIRTUAL','merge','options','count','includeAll','include','rows','catch','params','keys','find','create','body','describe','html-pdf','eml-format','rimraf','request-promise','bluebird','util','path','lodash','squel','crypto','desk.js','to-csv','querystring'];(function(_0x589f2d,_0x24e47e){var _0x55940d=function(_0x28b78a){while(--_0x28b78a){_0x589f2d['push'](_0x589f2d['shift']());}};_0x55940d(++_0x24e47e);}(_0xdb79,0x1e4));var _0x9db7=function(_0x1d24eb,_0x12295b){_0x1d24eb=_0x1d24eb-0x0;var _0x1dc576=_0xdb79[_0x1d24eb];return _0x1dc576;};'use strict';var pdf=require(_0x9db7('0x0'));var emlformat=require(_0x9db7('0x1'));var rimraf=require(_0x9db7('0x2'));var zipdir=require('zip-dir');var jsonpatch=require('fast-json-patch');var rp=require(_0x9db7('0x3'));var moment=require('moment');var BPromise=require(_0x9db7('0x4'));var Mustache=require('mustache');var util=require(_0x9db7('0x5'));var path=require(_0x9db7('0x6'));var sox=require('sox');var csv=require('to-csv');var ejs=require('ejs');var fs=require('fs');var _=require(_0x9db7('0x7'));var squel=require(_0x9db7('0x8'));var crypto=require(_0x9db7('0x9'));var jsforce=require('jsforce');var deskjs=require(_0x9db7('0xa'));var toCsv=require(_0x9db7('0xb'));var querystring=require(_0x9db7('0xc'));var Papa=require(_0x9db7('0xd'));var Redis=require(_0x9db7('0xe'));var authService=require(_0x9db7('0xf'));var qs=require('../../components/parsers/qs');var as=require(_0x9db7('0x10'));var hardwareService=require(_0x9db7('0x11'));var logger=require(_0x9db7('0x12'))(_0x9db7('0x13'));var utils=require(_0x9db7('0x14'));var config=require(_0x9db7('0x15'));var db=require(_0x9db7('0x16'))['db'];function respondWithStatusCode(_0x47b245,_0x35e83d){_0x35e83d=_0x35e83d||0xcc;return function(_0x2ad418){if(_0x2ad418){return _0x47b245['sendStatus'](_0x35e83d);}return _0x47b245[_0x9db7('0x17')](_0x35e83d)[_0x9db7('0x18')]();};}function respondWithResult(_0x2784ed,_0x5cc551){_0x5cc551=_0x5cc551||0xc8;return function(_0x43931a){if(_0x43931a){return _0x2784ed[_0x9db7('0x17')](_0x5cc551)[_0x9db7('0x19')](_0x43931a);}};}function respondWithFilteredResult(_0x2f0a3d,_0x433032){return function(_0x57bd4f){if(_0x57bd4f){var _0x10d08a=_0x57bd4f['count'],_0x3abfb4=_0x433032[_0x9db7('0x1a')],_0x55543d=_0x433032[_0x9db7('0x1a')]+_0x433032['limit'],_0xeb2dfd;if(_0x55543d>=_0x10d08a){_0x55543d=_0x10d08a;_0xeb2dfd=0xc8;}else{_0xeb2dfd=0xce;}_0x2f0a3d[_0x9db7('0x17')](_0xeb2dfd);return _0x2f0a3d[_0x9db7('0x1b')]('Content-Range',_0x3abfb4+'-'+_0x55543d+'/'+_0x10d08a)[_0x9db7('0x19')](_0x57bd4f);}return null;};}function patchUpdates(_0x25f50e){return function(_0x18f028){try{jsonpatch['apply'](_0x18f028,_0x25f50e,!![]);}catch(_0x42e703){return BPromise[_0x9db7('0x1c')](_0x42e703);}return _0x18f028[_0x9db7('0x1d')]();};}function saveUpdates(_0x1e46c8,_0x54fcb6){return function(_0x3f0ea9){if(_0x3f0ea9){return _0x3f0ea9[_0x9db7('0x1e')](_0x1e46c8)['then'](function(_0x2d1eea){return _0x2d1eea;});}return null;};}function removeEntity(_0x4412b2,_0x4b802a){return function(_0x55a52e){if(_0x55a52e){return _0x55a52e[_0x9db7('0x1f')]()[_0x9db7('0x20')](function(){_0x4412b2[_0x9db7('0x17')](0xcc)['end']();});}};}function handleEntityNotFound(_0x572877,_0x4c1f78){return function(_0xee89cc){if(!_0xee89cc){_0x572877[_0x9db7('0x21')](0x194);}return _0xee89cc;};}function handleError(_0x4dd1e3,_0x471fd7){_0x471fd7=_0x471fd7||0x1f4;return function(_0x5e76f6){logger[_0x9db7('0x22')](_0x5e76f6['stack']);if(_0x5e76f6[_0x9db7('0x23')]){delete _0x5e76f6[_0x9db7('0x23')];}_0x4dd1e3[_0x9db7('0x17')](_0x471fd7)[_0x9db7('0x24')](_0x5e76f6);};}exports[_0x9db7('0x25')]=function(_0x3cb07c,_0x21174c){var _0x193cb1={},_0x74be34={},_0x14121b={'count':0x0,'rows':[]};var _0x5f500a=_[_0x9db7('0x26')](db[_0x9db7('0x27')][_0x9db7('0x28')],function(_0x1baf38){return{'name':_0x1baf38[_0x9db7('0x29')],'type':_0x1baf38[_0x9db7('0x2a')]['key']};});_0x74be34[_0x9db7('0x2b')]=_['map'](_0x5f500a,_0x9db7('0x23'));_0x74be34[_0x9db7('0x2c')]=_['keys'](_0x3cb07c[_0x9db7('0x2c')]);_0x74be34[_0x9db7('0x2d')]=_['intersection'](_0x74be34[_0x9db7('0x2b')],_0x74be34[_0x9db7('0x2c')]);_0x193cb1[_0x9db7('0x2e')]=_[_0x9db7('0x2f')](_0x74be34[_0x9db7('0x2b')],qs[_0x9db7('0x30')](_0x3cb07c[_0x9db7('0x2c')][_0x9db7('0x30')]));_0x193cb1[_0x9db7('0x2e')]=_0x193cb1[_0x9db7('0x2e')][_0x9db7('0x31')]?_0x193cb1[_0x9db7('0x2e')]:_0x74be34[_0x9db7('0x2b')];if(!_0x3cb07c[_0x9db7('0x2c')][_0x9db7('0x32')](_0x9db7('0x33'))){_0x193cb1[_0x9db7('0x34')]=qs[_0x9db7('0x34')](_0x3cb07c[_0x9db7('0x2c')][_0x9db7('0x34')]);_0x193cb1[_0x9db7('0x1a')]=qs[_0x9db7('0x1a')](_0x3cb07c['query'][_0x9db7('0x1a')]);}_0x193cb1[_0x9db7('0x35')]=qs['sort'](_0x3cb07c[_0x9db7('0x2c')][_0x9db7('0x36')]);_0x193cb1['where']=qs['filters'](_['pick'](_0x3cb07c[_0x9db7('0x2c')],_0x74be34[_0x9db7('0x2d')]));if(_0x3cb07c[_0x9db7('0x2c')][_0x9db7('0x37')]){_0x193cb1[_0x9db7('0x38')]=_['merge'](_0x193cb1[_0x9db7('0x38')],{'$or':_['map'](_0x5f500a,function(_0x3c0deb){if(_0x3c0deb[_0x9db7('0x2a')]!==_0x9db7('0x39')){var _0x3d66fe={};_0x3d66fe[_0x3c0deb['name']]={'$like':'%'+_0x3cb07c['query']['filter']+'%'};return _0x3d66fe;}})});}_0x193cb1=_[_0x9db7('0x3a')]({},_0x193cb1,_0x3cb07c[_0x9db7('0x3b')]);var _0xe43355={'where':_0x193cb1[_0x9db7('0x38')]};return db[_0x9db7('0x27')][_0x9db7('0x3c')](_0xe43355)[_0x9db7('0x20')](function(_0x1cf852){_0x14121b[_0x9db7('0x3c')]=_0x1cf852;if(_0x3cb07c['query'][_0x9db7('0x3d')]){_0x193cb1[_0x9db7('0x3e')]=[{'all':!![]}];}return db[_0x9db7('0x27')]['findAll'](_0x193cb1);})[_0x9db7('0x20')](function(_0x1fe897){_0x14121b[_0x9db7('0x3f')]=_0x1fe897;return _0x14121b;})[_0x9db7('0x20')](respondWithFilteredResult(_0x21174c,_0x193cb1))[_0x9db7('0x40')](handleError(_0x21174c,null));};exports['show']=function(_0x13b575,_0x374ad5){var _0x2090ce={'raw':!![],'where':{'id':_0x13b575[_0x9db7('0x41')]['id']}},_0x5e8607={};_0x5e8607[_0x9db7('0x2b')]=_[_0x9db7('0x42')](db[_0x9db7('0x27')][_0x9db7('0x28')]);_0x5e8607[_0x9db7('0x2c')]=_[_0x9db7('0x42')](_0x13b575[_0x9db7('0x2c')]);_0x5e8607[_0x9db7('0x2d')]=_[_0x9db7('0x2f')](_0x5e8607['model'],_0x5e8607[_0x9db7('0x2c')]);_0x2090ce[_0x9db7('0x2e')]=_['intersection'](_0x5e8607[_0x9db7('0x2b')],qs[_0x9db7('0x30')](_0x13b575[_0x9db7('0x2c')][_0x9db7('0x30')]));_0x2090ce['attributes']=_0x2090ce['attributes']['length']?_0x2090ce[_0x9db7('0x2e')]:_0x5e8607[_0x9db7('0x2b')];if(_0x13b575[_0x9db7('0x2c')][_0x9db7('0x3d')]){_0x2090ce[_0x9db7('0x3e')]=[{'all':!![]}];}_0x2090ce=_[_0x9db7('0x3a')]({},_0x2090ce,_0x13b575[_0x9db7('0x3b')]);return db[_0x9db7('0x27')][_0x9db7('0x43')](_0x2090ce)['then'](handleEntityNotFound(_0x374ad5,null))[_0x9db7('0x20')](respondWithResult(_0x374ad5,null))[_0x9db7('0x40')](handleError(_0x374ad5,null));};exports[_0x9db7('0x44')]=function(_0x16a7d3,_0x5beba7){return db[_0x9db7('0x27')]['create'](_0x16a7d3[_0x9db7('0x45')],{})[_0x9db7('0x20')](respondWithResult(_0x5beba7,0xc9))[_0x9db7('0x40')](handleError(_0x5beba7,null));};exports[_0x9db7('0x1e')]=function(_0x39c53f,_0x47b20b){if(_0x39c53f['body']['id']){delete _0x39c53f[_0x9db7('0x45')]['id'];}return db[_0x9db7('0x27')][_0x9db7('0x43')]({'where':{'id':_0x39c53f[_0x9db7('0x41')]['id']}})['then'](handleEntityNotFound(_0x47b20b,null))[_0x9db7('0x20')](saveUpdates(_0x39c53f['body'],null))['then'](respondWithResult(_0x47b20b,null))[_0x9db7('0x40')](handleError(_0x47b20b,null));};exports[_0x9db7('0x1f')]=function(_0x64adf,_0x500a97){return db['JscriptyAnswerReport']['find']({'where':{'id':_0x64adf[_0x9db7('0x41')]['id']}})[_0x9db7('0x20')](handleEntityNotFound(_0x500a97,null))[_0x9db7('0x20')](removeEntity(_0x500a97,null))['catch'](handleError(_0x500a97,null));};exports[_0x9db7('0x46')]=function(_0x5bc995,_0x2566e5){return db[_0x9db7('0x27')]['describe']()[_0x9db7('0x20')](respondWithResult(_0x2566e5,null))['catch'](handleError(_0x2566e5,null));};
\ No newline at end of file
+var _0xec18=['ejs','lodash','squel','crypto','to-csv','querystring','papaparse','../../components/parsers/qs','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/environment','../../mysqldb','status','end','count','offset','limit','set','Content-Range','json','apply','save','update','then','sendStatus','error','stack','name','send','index','map','JscriptyAnswerReport','fieldName','type','key','model','keys','intersection','query','attributes','fields','length','hasOwnProperty','nolimit','order','sort','pick','filters','filter','where','merge','VIRTUAL','options','includeAll','include','findAll','rows','catch','show','rawAttributes','find','create','body','params','describe','eml-format','rimraf','zip-dir','request-promise','moment','bluebird','mustache','util','path','sox'];(function(_0x1dae94,_0x239003){var _0x36ce2d=function(_0x295f18){while(--_0x295f18){_0x1dae94['push'](_0x1dae94['shift']());}};_0x36ce2d(++_0x239003);}(_0xec18,0x12a));var _0x8ec1=function(_0xe09032,_0x4a1128){_0xe09032=_0xe09032-0x0;var _0x1e3d5e=_0xec18[_0xe09032];return _0x1e3d5e;};'use strict';var pdf=require('html-pdf');var emlformat=require(_0x8ec1('0x0'));var rimraf=require(_0x8ec1('0x1'));var zipdir=require(_0x8ec1('0x2'));var jsonpatch=require('fast-json-patch');var rp=require(_0x8ec1('0x3'));var moment=require(_0x8ec1('0x4'));var BPromise=require(_0x8ec1('0x5'));var Mustache=require(_0x8ec1('0x6'));var util=require(_0x8ec1('0x7'));var path=require(_0x8ec1('0x8'));var sox=require(_0x8ec1('0x9'));var csv=require('to-csv');var ejs=require(_0x8ec1('0xa'));var fs=require('fs');var _=require(_0x8ec1('0xb'));var squel=require(_0x8ec1('0xc'));var crypto=require(_0x8ec1('0xd'));var jsforce=require('jsforce');var deskjs=require('desk.js');var toCsv=require(_0x8ec1('0xe'));var querystring=require(_0x8ec1('0xf'));var Papa=require(_0x8ec1('0x10'));var Redis=require('ioredis');var authService=require('../../components/auth/service');var qs=require(_0x8ec1('0x11'));var as=require('../../components/parsers/advancedSearch');var hardwareService=require(_0x8ec1('0x12'));var logger=require(_0x8ec1('0x13'))(_0x8ec1('0x14'));var utils=require(_0x8ec1('0x15'));var config=require(_0x8ec1('0x16'));var db=require(_0x8ec1('0x17'))['db'];function respondWithStatusCode(_0x37b6f3,_0x483a5e){_0x483a5e=_0x483a5e||0xcc;return function(_0x47f6e2){if(_0x47f6e2){return _0x37b6f3['sendStatus'](_0x483a5e);}return _0x37b6f3[_0x8ec1('0x18')](_0x483a5e)[_0x8ec1('0x19')]();};}function respondWithResult(_0x599157,_0x37a768){_0x37a768=_0x37a768||0xc8;return function(_0x132309){if(_0x132309){return _0x599157[_0x8ec1('0x18')](_0x37a768)['json'](_0x132309);}};}function respondWithFilteredResult(_0x650bca,_0x5e30c9){return function(_0x19814e){if(_0x19814e){var _0x276c28=_0x19814e[_0x8ec1('0x1a')],_0x4b88a9=_0x5e30c9[_0x8ec1('0x1b')],_0x2e6dba=_0x5e30c9['offset']+_0x5e30c9[_0x8ec1('0x1c')],_0x3f5d12;if(_0x2e6dba>=_0x276c28){_0x2e6dba=_0x276c28;_0x3f5d12=0xc8;}else{_0x3f5d12=0xce;}_0x650bca[_0x8ec1('0x18')](_0x3f5d12);return _0x650bca[_0x8ec1('0x1d')](_0x8ec1('0x1e'),_0x4b88a9+'-'+_0x2e6dba+'/'+_0x276c28)[_0x8ec1('0x1f')](_0x19814e);}return null;};}function patchUpdates(_0x4d9ad6){return function(_0x6d5c71){try{jsonpatch[_0x8ec1('0x20')](_0x6d5c71,_0x4d9ad6,!![]);}catch(_0x1a0a94){return BPromise['reject'](_0x1a0a94);}return _0x6d5c71[_0x8ec1('0x21')]();};}function saveUpdates(_0x566d74,_0x44faa5){return function(_0x28ae5b){if(_0x28ae5b){return _0x28ae5b[_0x8ec1('0x22')](_0x566d74)[_0x8ec1('0x23')](function(_0xeb965d){return _0xeb965d;});}return null;};}function removeEntity(_0x510bbb,_0x5a8e7a){return function(_0x39274d){if(_0x39274d){return _0x39274d['destroy']()[_0x8ec1('0x23')](function(){_0x510bbb[_0x8ec1('0x18')](0xcc)[_0x8ec1('0x19')]();});}};}function handleEntityNotFound(_0x460b10,_0x559677){return function(_0x54c041){if(!_0x54c041){_0x460b10[_0x8ec1('0x24')](0x194);}return _0x54c041;};}function handleError(_0x238a56,_0x1a6599){_0x1a6599=_0x1a6599||0x1f4;return function(_0x1add00){logger[_0x8ec1('0x25')](_0x1add00[_0x8ec1('0x26')]);if(_0x1add00[_0x8ec1('0x27')]){delete _0x1add00['name'];}_0x238a56['status'](_0x1a6599)[_0x8ec1('0x28')](_0x1add00);};}exports[_0x8ec1('0x29')]=function(_0x799f1b,_0x995bd4){var _0x10967e={},_0x288b55={},_0x5d4c33={'count':0x0,'rows':[]};var _0x548a5b=_[_0x8ec1('0x2a')](db[_0x8ec1('0x2b')]['rawAttributes'],function(_0x305ab6){return{'name':_0x305ab6[_0x8ec1('0x2c')],'type':_0x305ab6[_0x8ec1('0x2d')][_0x8ec1('0x2e')]};});_0x288b55[_0x8ec1('0x2f')]=_[_0x8ec1('0x2a')](_0x548a5b,_0x8ec1('0x27'));_0x288b55['query']=_[_0x8ec1('0x30')](_0x799f1b['query']);_0x288b55['filters']=_[_0x8ec1('0x31')](_0x288b55[_0x8ec1('0x2f')],_0x288b55[_0x8ec1('0x32')]);_0x10967e[_0x8ec1('0x33')]=_[_0x8ec1('0x31')](_0x288b55[_0x8ec1('0x2f')],qs[_0x8ec1('0x34')](_0x799f1b['query'][_0x8ec1('0x34')]));_0x10967e[_0x8ec1('0x33')]=_0x10967e[_0x8ec1('0x33')][_0x8ec1('0x35')]?_0x10967e[_0x8ec1('0x33')]:_0x288b55[_0x8ec1('0x2f')];if(!_0x799f1b[_0x8ec1('0x32')][_0x8ec1('0x36')](_0x8ec1('0x37'))){_0x10967e[_0x8ec1('0x1c')]=qs[_0x8ec1('0x1c')](_0x799f1b[_0x8ec1('0x32')][_0x8ec1('0x1c')]);_0x10967e[_0x8ec1('0x1b')]=qs[_0x8ec1('0x1b')](_0x799f1b[_0x8ec1('0x32')]['offset']);}_0x10967e[_0x8ec1('0x38')]=qs[_0x8ec1('0x39')](_0x799f1b[_0x8ec1('0x32')][_0x8ec1('0x39')]);_0x10967e['where']=qs['filters'](_[_0x8ec1('0x3a')](_0x799f1b[_0x8ec1('0x32')],_0x288b55[_0x8ec1('0x3b')]));if(_0x799f1b[_0x8ec1('0x32')][_0x8ec1('0x3c')]){_0x10967e[_0x8ec1('0x3d')]=_[_0x8ec1('0x3e')](_0x10967e['where'],{'$or':_[_0x8ec1('0x2a')](_0x548a5b,function(_0x341dab){if(_0x341dab['type']!==_0x8ec1('0x3f')){var _0x43d526={};_0x43d526[_0x341dab[_0x8ec1('0x27')]]={'$like':'%'+_0x799f1b[_0x8ec1('0x32')][_0x8ec1('0x3c')]+'%'};return _0x43d526;}})});}_0x10967e=_[_0x8ec1('0x3e')]({},_0x10967e,_0x799f1b[_0x8ec1('0x40')]);var _0x9460b7={'where':_0x10967e[_0x8ec1('0x3d')]};return db[_0x8ec1('0x2b')][_0x8ec1('0x1a')](_0x9460b7)['then'](function(_0xb562ce){_0x5d4c33[_0x8ec1('0x1a')]=_0xb562ce;if(_0x799f1b['query'][_0x8ec1('0x41')]){_0x10967e[_0x8ec1('0x42')]=[{'all':!![]}];}return db[_0x8ec1('0x2b')][_0x8ec1('0x43')](_0x10967e);})[_0x8ec1('0x23')](function(_0x35c259){_0x5d4c33[_0x8ec1('0x44')]=_0x35c259;return _0x5d4c33;})[_0x8ec1('0x23')](respondWithFilteredResult(_0x995bd4,_0x10967e))[_0x8ec1('0x45')](handleError(_0x995bd4,null));};exports[_0x8ec1('0x46')]=function(_0x143b3d,_0x36e426){var _0x35c32b={'raw':!![],'where':{'id':_0x143b3d['params']['id']}},_0x546c41={};_0x546c41['model']=_[_0x8ec1('0x30')](db[_0x8ec1('0x2b')][_0x8ec1('0x47')]);_0x546c41[_0x8ec1('0x32')]=_[_0x8ec1('0x30')](_0x143b3d[_0x8ec1('0x32')]);_0x546c41[_0x8ec1('0x3b')]=_['intersection'](_0x546c41[_0x8ec1('0x2f')],_0x546c41['query']);_0x35c32b[_0x8ec1('0x33')]=_[_0x8ec1('0x31')](_0x546c41[_0x8ec1('0x2f')],qs['fields'](_0x143b3d[_0x8ec1('0x32')][_0x8ec1('0x34')]));_0x35c32b['attributes']=_0x35c32b[_0x8ec1('0x33')][_0x8ec1('0x35')]?_0x35c32b[_0x8ec1('0x33')]:_0x546c41[_0x8ec1('0x2f')];if(_0x143b3d[_0x8ec1('0x32')]['includeAll']){_0x35c32b['include']=[{'all':!![]}];}_0x35c32b=_[_0x8ec1('0x3e')]({},_0x35c32b,_0x143b3d[_0x8ec1('0x40')]);return db[_0x8ec1('0x2b')][_0x8ec1('0x48')](_0x35c32b)['then'](handleEntityNotFound(_0x36e426,null))['then'](respondWithResult(_0x36e426,null))[_0x8ec1('0x45')](handleError(_0x36e426,null));};exports[_0x8ec1('0x49')]=function(_0xcddffa,_0x4eb845){return db[_0x8ec1('0x2b')]['create'](_0xcddffa['body'],{})[_0x8ec1('0x23')](respondWithResult(_0x4eb845,0xc9))[_0x8ec1('0x45')](handleError(_0x4eb845,null));};exports['update']=function(_0x411053,_0x2a06aa){if(_0x411053[_0x8ec1('0x4a')]['id']){delete _0x411053[_0x8ec1('0x4a')]['id'];}return db[_0x8ec1('0x2b')][_0x8ec1('0x48')]({'where':{'id':_0x411053[_0x8ec1('0x4b')]['id']}})[_0x8ec1('0x23')](handleEntityNotFound(_0x2a06aa,null))['then'](saveUpdates(_0x411053[_0x8ec1('0x4a')],null))[_0x8ec1('0x23')](respondWithResult(_0x2a06aa,null))[_0x8ec1('0x45')](handleError(_0x2a06aa,null));};exports['destroy']=function(_0x253c51,_0x180e3b){return db[_0x8ec1('0x2b')]['find']({'where':{'id':_0x253c51[_0x8ec1('0x4b')]['id']}})[_0x8ec1('0x23')](handleEntityNotFound(_0x180e3b,null))[_0x8ec1('0x23')](removeEntity(_0x180e3b,null))['catch'](handleError(_0x180e3b,null));};exports[_0x8ec1('0x4c')]=function(_0x1f6d4c,_0x28ba9b){return db[_0x8ec1('0x2b')][_0x8ec1('0x4c')]()[_0x8ec1('0x23')](respondWithResult(_0x28ba9b,null))['catch'](handleError(_0x28ba9b,null));};
\ No newline at end of file
diff --git a/server/api/jscriptyAnswerReport/jscriptyAnswerReport.model.js b/server/api/jscriptyAnswerReport/jscriptyAnswerReport.model.js
index 37d0f0d..d340253 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 _0x8f65=['../../config/logger','api','moment','bluebird','request-promise','path','./jscriptyAnswerReport.attributes','exports','JscriptyAnswerReport','report_jscripty_answers','lodash','util'];(function(_0x2e8a2b,_0x4cfc63){var _0x4bb929=function(_0x308206){while(--_0x308206){_0x2e8a2b['push'](_0x2e8a2b['shift']());}};_0x4bb929(++_0x4cfc63);}(_0x8f65,0x1c6));var _0x58f6=function(_0x580229,_0x1e3d09){_0x580229=_0x580229-0x0;var _0x2890ee=_0x8f65[_0x580229];return _0x2890ee;};'use strict';var _=require(_0x58f6('0x0'));var util=require(_0x58f6('0x1'));var logger=require(_0x58f6('0x2'))(_0x58f6('0x3'));var moment=require(_0x58f6('0x4'));var BPromise=require(_0x58f6('0x5'));var rp=require(_0x58f6('0x6'));var fs=require('fs');var path=require(_0x58f6('0x7'));var rimraf=require('rimraf');var config=require('../../config/environment');var attributes=require(_0x58f6('0x8'));module[_0x58f6('0x9')]=function(_0x268d64,_0x1c35a0){return _0x268d64['define'](_0x58f6('0xa'),attributes,{'tableName':_0x58f6('0xb'),'paranoid':![],'indexes':[],'timestamps':!![]});};
\ No newline at end of file
+var _0x7b1f=['define','JscriptyAnswerReport','report_jscripty_answers','lodash','util','../../config/logger','api','moment','bluebird','request-promise','./jscriptyAnswerReport.attributes','exports'];(function(_0x149bb0,_0x5215b3){var _0x11499b=function(_0x1f5ac9){while(--_0x1f5ac9){_0x149bb0['push'](_0x149bb0['shift']());}};_0x11499b(++_0x5215b3);}(_0x7b1f,0xab));var _0xf7b1=function(_0x3500d1,_0x571280){_0x3500d1=_0x3500d1-0x0;var _0x5f2b41=_0x7b1f[_0x3500d1];return _0x5f2b41;};'use strict';var _=require(_0xf7b1('0x0'));var util=require(_0xf7b1('0x1'));var logger=require(_0xf7b1('0x2'))(_0xf7b1('0x3'));var moment=require(_0xf7b1('0x4'));var BPromise=require(_0xf7b1('0x5'));var rp=require(_0xf7b1('0x6'));var fs=require('fs');var path=require('path');var rimraf=require('rimraf');var config=require('../../config/environment');var attributes=require(_0xf7b1('0x7'));module[_0xf7b1('0x8')]=function(_0x2955b7,_0x331cb9){return _0x2955b7[_0xf7b1('0x9')](_0xf7b1('0xa'),attributes,{'tableName':_0xf7b1('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 1b2138f..a2a3c75 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 _0xba7b=['catch','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/environment','client','request','then','info','JscriptyAnswerReport,\x20%s,\x20%s,\x20%s','request\x20sent','stringify','error','code','JscriptyAnswerReport,\x20%s,\x20%s','message','result'];(function(_0x3dd15e,_0x1f0015){var _0x231fd0=function(_0x4f680a){while(--_0x4f680a){_0x3dd15e['push'](_0x3dd15e['shift']());}};_0x231fd0(++_0x1f0015);}(_0xba7b,0x1a3));var _0xbba7=function(_0x2a7312,_0x1784b7){_0x2a7312=_0x2a7312-0x0;var _0x48cd88=_0xba7b[_0x2a7312];return _0x48cd88;};'use strict';var _=require('lodash');var util=require('util');var moment=require(_0xbba7('0x0'));var BPromise=require(_0xbba7('0x1'));var rs=require(_0xbba7('0x2'));var fs=require('fs');var Redis=require(_0xbba7('0x3'));var db=require(_0xbba7('0x4'))['db'];var utils=require('../../config/utils');var logger=require('../../config/logger')('rpc');var config=require(_0xbba7('0x5'));var jayson=require('jayson/promise');var client=jayson[_0xbba7('0x6')]['http']({'port':0x232a});function respondWithRpcPromise(_0x3d6024,_0x205f50,_0x12a214){return new BPromise(function(_0x25e67b,_0x46cff9){return client[_0xbba7('0x7')](_0x3d6024,_0x12a214)[_0xbba7('0x8')](function(_0x154c1f){logger[_0xbba7('0x9')]('JscriptyAnswerReport,\x20%s,\x20%s',_0x205f50,'request\x20sent');logger['debug'](_0xbba7('0xa'),_0x205f50,_0xbba7('0xb'),JSON[_0xbba7('0xc')](_0x154c1f));if(_0x154c1f[_0xbba7('0xd')]){if(_0x154c1f[_0xbba7('0xd')][_0xbba7('0xe')]===0x1f4){logger[_0xbba7('0xd')](_0xbba7('0xf'),_0x205f50,_0x154c1f[_0xbba7('0xd')][_0xbba7('0x10')]);return _0x46cff9(_0x154c1f[_0xbba7('0xd')][_0xbba7('0x10')]);}logger['error'](_0xbba7('0xf'),_0x205f50,_0x154c1f['error'][_0xbba7('0x10')]);return _0x25e67b(_0x154c1f[_0xbba7('0xd')][_0xbba7('0x10')]);}else{logger[_0xbba7('0x9')](_0xbba7('0xf'),_0x205f50,_0xbba7('0xb'));_0x25e67b(_0x154c1f[_0xbba7('0x11')][_0xbba7('0x10')]);}})[_0xbba7('0x12')](function(_0x4d5792){logger[_0xbba7('0xd')](_0xbba7('0xf'),_0x205f50,_0x4d5792);_0x46cff9(_0x4d5792);});});}
\ No newline at end of file
+var _0x1bc0=['randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','../../config/environment','jayson/promise','client','http','then','info','JscriptyAnswerReport,\x20%s,\x20%s','debug','stringify','error','message','request\x20sent','result','catch','lodash','util','moment'];(function(_0x18a68b,_0x5a6b0f){var _0x489ad1=function(_0x37093b){while(--_0x37093b){_0x18a68b['push'](_0x18a68b['shift']());}};_0x489ad1(++_0x5a6b0f);}(_0x1bc0,0x189));var _0x01bc=function(_0x35f55f,_0x10f86c){_0x35f55f=_0x35f55f-0x0;var _0xdb688f=_0x1bc0[_0x35f55f];return _0xdb688f;};'use strict';var _=require(_0x01bc('0x0'));var util=require(_0x01bc('0x1'));var moment=require(_0x01bc('0x2'));var BPromise=require('bluebird');var rs=require(_0x01bc('0x3'));var fs=require('fs');var Redis=require(_0x01bc('0x4'));var db=require(_0x01bc('0x5'))['db'];var utils=require(_0x01bc('0x6'));var logger=require(_0x01bc('0x7'))('rpc');var config=require(_0x01bc('0x8'));var jayson=require(_0x01bc('0x9'));var client=jayson[_0x01bc('0xa')][_0x01bc('0xb')]({'port':0x232a});function respondWithRpcPromise(_0x3d681b,_0x3609fe,_0xa8a859){return new BPromise(function(_0x2b6302,_0x78ba71){return client['request'](_0x3d681b,_0xa8a859)[_0x01bc('0xc')](function(_0x48a8a8){logger[_0x01bc('0xd')](_0x01bc('0xe'),_0x3609fe,'request\x20sent');logger[_0x01bc('0xf')]('JscriptyAnswerReport,\x20%s,\x20%s,\x20%s',_0x3609fe,'request\x20sent',JSON[_0x01bc('0x10')](_0x48a8a8));if(_0x48a8a8[_0x01bc('0x11')]){if(_0x48a8a8['error']['code']===0x1f4){logger[_0x01bc('0x11')]('JscriptyAnswerReport,\x20%s,\x20%s',_0x3609fe,_0x48a8a8[_0x01bc('0x11')][_0x01bc('0x12')]);return _0x78ba71(_0x48a8a8[_0x01bc('0x11')]['message']);}logger[_0x01bc('0x11')](_0x01bc('0xe'),_0x3609fe,_0x48a8a8[_0x01bc('0x11')][_0x01bc('0x12')]);return _0x2b6302(_0x48a8a8['error'][_0x01bc('0x12')]);}else{logger[_0x01bc('0xd')](_0x01bc('0xe'),_0x3609fe,_0x01bc('0x13'));_0x2b6302(_0x48a8a8[_0x01bc('0x14')][_0x01bc('0x12')]);}})[_0x01bc('0x15')](function(_0x2cb61d){logger[_0x01bc('0x11')]('JscriptyAnswerReport,\x20%s,\x20%s',_0x3609fe,_0x2cb61d);_0x78ba71(_0x2cb61d);});});}
\ No newline at end of file
diff --git a/server/api/jscriptyProject/index.js b/server/api/jscriptyProject/index.js
index 0ce2edf..2a464ba 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 _0x45f7=['/:id','isAuthenticated','/:id/sessions','getSessions','/:id/answers','getAnswers','/:id/summary','30s','getSummary','post','create','/:id/clone','clone','put','destroy','exports','util','path','connect-timeout','express','Router','./jscriptyProject.controller','get','index'];(function(_0x5426e2,_0x5f2968){var _0x920dc=function(_0x3a87c6){while(--_0x3a87c6){_0x5426e2['push'](_0x5426e2['shift']());}};_0x920dc(++_0x5f2968);}(_0x45f7,0x148));var _0x745f=function(_0x3b5ad9,_0x223867){_0x3b5ad9=_0x3b5ad9-0x0;var _0x611ae9=_0x45f7[_0x3b5ad9];return _0x611ae9;};'use strict';var multer=require('multer');var util=require(_0x745f('0x0'));var path=require(_0x745f('0x1'));var timeout=require(_0x745f('0x2'));var express=require(_0x745f('0x3'));var router=express[_0x745f('0x4')]();var auth=require('../../components/auth/service');var interaction=require('../../components/interaction/service');var config=require('../../config/environment');var controller=require(_0x745f('0x5'));router[_0x745f('0x6')]('/',auth['isAuthenticated'](),controller[_0x745f('0x7')]);router['get'](_0x745f('0x8'),auth[_0x745f('0x9')](),controller['show']);router[_0x745f('0x6')](_0x745f('0xa'),auth['isAuthenticated'](),controller[_0x745f('0xb')]);router['get'](_0x745f('0xc'),auth[_0x745f('0x9')](),controller[_0x745f('0xd')]);router['get'](_0x745f('0xe'),auth[_0x745f('0x9')](),timeout(_0x745f('0xf')),controller[_0x745f('0x10')]);router[_0x745f('0x11')]('/',auth[_0x745f('0x9')](),controller[_0x745f('0x12')]);router[_0x745f('0x11')](_0x745f('0x13'),auth['isAuthenticated'](),controller[_0x745f('0x14')]);router[_0x745f('0x15')](_0x745f('0x8'),auth[_0x745f('0x9')](),controller['update']);router['delete'](_0x745f('0x8'),auth['isAuthenticated'](),controller[_0x745f('0x16')]);module[_0x745f('0x17')]=router;
\ No newline at end of file
+var _0x8738=['../../components/interaction/service','./jscriptyProject.controller','isAuthenticated','index','/:id','show','/:id/sessions','getSessions','/:id/answers','getAnswers','get','30s','getSummary','post','create','/:id/clone','clone','put','delete','destroy','exports','multer','path','connect-timeout','express','Router','../../components/auth/service'];(function(_0x231b8d,_0x3adce2){var _0x33d2ac=function(_0x1e495e){while(--_0x1e495e){_0x231b8d['push'](_0x231b8d['shift']());}};_0x33d2ac(++_0x3adce2);}(_0x8738,0x1aa));var _0x8873=function(_0x13cd35,_0x59bdbd){_0x13cd35=_0x13cd35-0x0;var _0x24220e=_0x8738[_0x13cd35];return _0x24220e;};'use strict';var multer=require(_0x8873('0x0'));var util=require('util');var path=require(_0x8873('0x1'));var timeout=require(_0x8873('0x2'));var express=require(_0x8873('0x3'));var router=express[_0x8873('0x4')]();var auth=require(_0x8873('0x5'));var interaction=require(_0x8873('0x6'));var config=require('../../config/environment');var controller=require(_0x8873('0x7'));router['get']('/',auth[_0x8873('0x8')](),controller[_0x8873('0x9')]);router['get'](_0x8873('0xa'),auth[_0x8873('0x8')](),controller[_0x8873('0xb')]);router['get'](_0x8873('0xc'),auth[_0x8873('0x8')](),controller[_0x8873('0xd')]);router['get'](_0x8873('0xe'),auth['isAuthenticated'](),controller[_0x8873('0xf')]);router[_0x8873('0x10')]('/:id/summary',auth[_0x8873('0x8')](),timeout(_0x8873('0x11')),controller[_0x8873('0x12')]);router[_0x8873('0x13')]('/',auth[_0x8873('0x8')](),controller[_0x8873('0x14')]);router[_0x8873('0x13')](_0x8873('0x15'),auth[_0x8873('0x8')](),controller[_0x8873('0x16')]);router[_0x8873('0x17')](_0x8873('0xa'),auth[_0x8873('0x8')](),controller['update']);router[_0x8873('0x18')]('/:id',auth[_0x8873('0x8')](),controller[_0x8873('0x19')]);module[_0x8873('0x1a')]=router;
\ No newline at end of file
diff --git a/server/api/jscriptyProject/jscriptyProject.attributes.js b/server/api/jscriptyProject/jscriptyProject.attributes.js
index efa62ad..4a9800c 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 _0x53eb=['exports','STRING','TEXT','long','setDataValue','isString','formData','format','{\x22name\x22:\x22%s\x22,\x22description\x22:\x22%s\x22,\x22pages\x22:[]}','getDataValue','description','BOOLEAN','sequelize','lodash','util'];(function(_0x160134,_0x15d3b1){var _0x4b092e=function(_0x500352){while(--_0x500352){_0x160134['push'](_0x160134['shift']());}};_0x4b092e(++_0x15d3b1);}(_0x53eb,0x1ec));var _0xb53e=function(_0x498e31,_0x19bf8b){_0x498e31=_0x498e31-0x0;var _0x5c8e99=_0x53eb[_0x498e31];return _0x5c8e99;};'use strict';var Sequelize=require(_0xb53e('0x0'));var _=require(_0xb53e('0x1'));var util=require(_0xb53e('0x2'));module[_0xb53e('0x3')]={'name':{'type':Sequelize[_0xb53e('0x4')],'unique':'name'},'description':{'type':Sequelize['STRING']},'formData':{'type':Sequelize[_0xb53e('0x5')](_0xb53e('0x6')),'set':function(_0x10150b){if(_['isObjectLike'](_0x10150b)){this[_0xb53e('0x7')]('formData',JSON['stringify'](_0x10150b));}else if(_[_0xb53e('0x8')](_0x10150b)){this[_0xb53e('0x7')]('formData',_0x10150b);}else{this[_0xb53e('0x7')](_0xb53e('0x9'),util[_0xb53e('0xa')](_0xb53e('0xb'),this['getDataValue']('name')||'',this[_0xb53e('0xc')](_0xb53e('0xd'))||''));}}},'enableUncompleteSave':{'type':Sequelize[_0xb53e('0xe')],'defaultValue':!![]},'sendUnpauseOnSubmit':{'type':Sequelize[_0xb53e('0xe')],'defaultValue':![]}};
\ No newline at end of file
+var _0x758c=['stringify','isString','format','{\x22name\x22:\x22%s\x22,\x22description\x22:\x22%s\x22,\x22pages\x22:[]}','getDataValue','description','BOOLEAN','sequelize','util','STRING','name','TEXT','setDataValue','formData'];(function(_0x1fe8e4,_0x4593ba){var _0x2d6229=function(_0x5587e9){while(--_0x5587e9){_0x1fe8e4['push'](_0x1fe8e4['shift']());}};_0x2d6229(++_0x4593ba);}(_0x758c,0x1d5));var _0xc758=function(_0x517ac3,_0x18addf){_0x517ac3=_0x517ac3-0x0;var _0x1500c1=_0x758c[_0x517ac3];return _0x1500c1;};'use strict';var Sequelize=require(_0xc758('0x0'));var _=require('lodash');var util=require(_0xc758('0x1'));module['exports']={'name':{'type':Sequelize[_0xc758('0x2')],'unique':_0xc758('0x3')},'description':{'type':Sequelize['STRING']},'formData':{'type':Sequelize[_0xc758('0x4')]('long'),'set':function(_0x1b7d9b){if(_['isObjectLike'](_0x1b7d9b)){this[_0xc758('0x5')](_0xc758('0x6'),JSON[_0xc758('0x7')](_0x1b7d9b));}else if(_[_0xc758('0x8')](_0x1b7d9b)){this[_0xc758('0x5')](_0xc758('0x6'),_0x1b7d9b);}else{this[_0xc758('0x5')]('formData',util[_0xc758('0x9')](_0xc758('0xa'),this[_0xc758('0xb')]('name')||'',this[_0xc758('0xb')](_0xc758('0xc'))||''));}}},'enableUncompleteSave':{'type':Sequelize['BOOLEAN'],'defaultValue':!![]},'sendUnpauseOnSubmit':{'type':Sequelize[_0xc758('0xd')],'defaultValue':![]}};
\ No newline at end of file
diff --git a/server/api/jscriptyProject/jscriptyProject.controller.js b/server/api/jscriptyProject/jscriptyProject.controller.js
index bf486dd..9940be0 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 _0x089b=['rows','catch','show','params','rawAttributes','find','create','body','Unable\x20to\x20retrieve\x20the\x20current\x20user','role','Projects','UserProfileSection','userProfileId','autoAssociation','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','clone','intersection','options','omit','createdAt','updatedAt','user','JscriptySessionReport','pick','getAnswers','findOne','JscriptyAnswerReport','hasOwnProperty','ProjectId','include','number','fromCharCode','apply','indexOf','toString','getSummary','startTime','starttime','parse','JscriptyQuestionReport','questionId','question','SessionId','push','isEmpty','writeFileSync','format','/tmp/Jscripty_Project_%d_Summary_%s.csv','setHeader','Content-disposition','Jscripty_Project_%d_Summary_%s.csv','text/csv','download','sendStatus','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','moment','mustache','path','to-csv','squel','crypto','desk.js','querystring','papaparse','../../components/auth/service','../../components/parsers/advancedSearch','../../config/license/hardware','api','../../config/utils','../../config/environment','../../mysqldb','status','end','json','count','offset','limit','reject','update','then','destroy','get','UserProfileResource','error','stack','name','send','fieldName','map','query','keys','filters','model','attributes','fields','length','nolimit','order','sort','where','filter','merge','type','VIRTUAL','JscriptyProject','includeAll','findAll'];(function(_0x37bc1a,_0x6e3a54){var _0x1d7e39=function(_0x986f1f){while(--_0x986f1f){_0x37bc1a['push'](_0x37bc1a['shift']());}};_0x1d7e39(++_0x6e3a54);}(_0x089b,0x1f2));var _0xb089=function(_0x19556e,_0xa6d8d6){_0x19556e=_0x19556e-0x0;var _0x54c95c=_0x089b[_0x19556e];return _0x54c95c;};'use strict';var pdf=require('html-pdf');var emlformat=require(_0xb089('0x0'));var rimraf=require(_0xb089('0x1'));var zipdir=require(_0xb089('0x2'));var jsonpatch=require(_0xb089('0x3'));var rp=require(_0xb089('0x4'));var moment=require(_0xb089('0x5'));var BPromise=require('bluebird');var Mustache=require(_0xb089('0x6'));var util=require('util');var path=require(_0xb089('0x7'));var sox=require('sox');var csv=require(_0xb089('0x8'));var ejs=require('ejs');var fs=require('fs');var _=require('lodash');var squel=require(_0xb089('0x9'));var crypto=require(_0xb089('0xa'));var jsforce=require('jsforce');var deskjs=require(_0xb089('0xb'));var toCsv=require('to-csv');var querystring=require(_0xb089('0xc'));var Papa=require(_0xb089('0xd'));var Redis=require('ioredis');var authService=require(_0xb089('0xe'));var qs=require('../../components/parsers/qs');var as=require(_0xb089('0xf'));var hardwareService=require(_0xb089('0x10'));var logger=require('../../config/logger')(_0xb089('0x11'));var utils=require(_0xb089('0x12'));var config=require(_0xb089('0x13'));var db=require(_0xb089('0x14'))['db'];function respondWithStatusCode(_0x1db21c,_0x5cc915){_0x5cc915=_0x5cc915||0xcc;return function(_0x242099){if(_0x242099){return _0x1db21c['sendStatus'](_0x5cc915);}return _0x1db21c[_0xb089('0x15')](_0x5cc915)[_0xb089('0x16')]();};}function respondWithResult(_0x29cba0,_0xc9d1a3){_0xc9d1a3=_0xc9d1a3||0xc8;return function(_0x33d3ea){if(_0x33d3ea){return _0x29cba0[_0xb089('0x15')](_0xc9d1a3)[_0xb089('0x17')](_0x33d3ea);}};}function respondWithFilteredResult(_0x40c07c,_0x3333dc){return function(_0x3f471e){if(_0x3f471e){var _0x498715=_0x3f471e[_0xb089('0x18')],_0x4f233f=_0x3333dc[_0xb089('0x19')],_0x3e180f=_0x3333dc['offset']+_0x3333dc[_0xb089('0x1a')],_0x4d83d7;if(_0x3e180f>=_0x498715){_0x3e180f=_0x498715;_0x4d83d7=0xc8;}else{_0x4d83d7=0xce;}_0x40c07c[_0xb089('0x15')](_0x4d83d7);return _0x40c07c['set']('Content-Range',_0x4f233f+'-'+_0x3e180f+'/'+_0x498715)['json'](_0x3f471e);}return null;};}function patchUpdates(_0x2577ef){return function(_0x5734cf){try{jsonpatch['apply'](_0x5734cf,_0x2577ef,!![]);}catch(_0x550931){return BPromise[_0xb089('0x1b')](_0x550931);}return _0x5734cf['save']();};}function saveUpdates(_0xed8eb1,_0x4608e5){return function(_0x223ea4){if(_0x223ea4){return _0x223ea4[_0xb089('0x1c')](_0xed8eb1)[_0xb089('0x1d')](function(_0x530510){return _0x530510;});}return null;};}function removeEntity(_0x4d5d99,_0xc8eb1d){return function(_0x59a45d){if(_0x59a45d){return _0x59a45d[_0xb089('0x1e')]()['then'](function(){var _0x55a22c=_0x59a45d[_0xb089('0x1f')]({'plain':!![]});var _0x5bd236='Projects';return db[_0xb089('0x20')][_0xb089('0x1e')]({'where':{'type':_0x5bd236,'resourceId':_0x55a22c['id']}})[_0xb089('0x1d')](function(){return _0x59a45d;});})[_0xb089('0x1d')](function(){_0x4d5d99[_0xb089('0x15')](0xcc)[_0xb089('0x16')]();});}};}function handleEntityNotFound(_0x4e495c,_0x13341b){return function(_0x42c520){if(!_0x42c520){_0x4e495c['sendStatus'](0x194);}return _0x42c520;};}function handleError(_0x13894a,_0x155b59){_0x155b59=_0x155b59||0x1f4;return function(_0x4b063e){logger[_0xb089('0x21')](_0x4b063e[_0xb089('0x22')]);if(_0x4b063e[_0xb089('0x23')]){delete _0x4b063e[_0xb089('0x23')];}_0x13894a[_0xb089('0x15')](_0x155b59)[_0xb089('0x24')](_0x4b063e);};}exports['index']=function(_0x59a4bc,_0x5663ff){var _0x4820a4={},_0x343dab={},_0x16aa65={'count':0x0,'rows':[]};var _0x4a771f=_['map'](db['JscriptyProject']['rawAttributes'],function(_0x57dfe8){return{'name':_0x57dfe8[_0xb089('0x25')],'type':_0x57dfe8['type']['key']};});_0x343dab['model']=_[_0xb089('0x26')](_0x4a771f,'name');_0x343dab[_0xb089('0x27')]=_[_0xb089('0x28')](_0x59a4bc[_0xb089('0x27')]);_0x343dab[_0xb089('0x29')]=_['intersection'](_0x343dab[_0xb089('0x2a')],_0x343dab[_0xb089('0x27')]);_0x4820a4[_0xb089('0x2b')]=_['intersection'](_0x343dab[_0xb089('0x2a')],qs[_0xb089('0x2c')](_0x59a4bc[_0xb089('0x27')][_0xb089('0x2c')]));_0x4820a4[_0xb089('0x2b')]=_0x4820a4[_0xb089('0x2b')][_0xb089('0x2d')]?_0x4820a4[_0xb089('0x2b')]:_0x343dab['model'];if(!_0x59a4bc[_0xb089('0x27')]['hasOwnProperty'](_0xb089('0x2e'))){_0x4820a4['limit']=qs[_0xb089('0x1a')](_0x59a4bc[_0xb089('0x27')]['limit']);_0x4820a4[_0xb089('0x19')]=qs[_0xb089('0x19')](_0x59a4bc['query'][_0xb089('0x19')]);}_0x4820a4[_0xb089('0x2f')]=qs['sort'](_0x59a4bc[_0xb089('0x27')][_0xb089('0x30')]);_0x4820a4[_0xb089('0x31')]=qs['filters'](_['pick'](_0x59a4bc['query'],_0x343dab[_0xb089('0x29')]));if(_0x59a4bc[_0xb089('0x27')][_0xb089('0x32')]){_0x4820a4[_0xb089('0x31')]=_[_0xb089('0x33')](_0x4820a4[_0xb089('0x31')],{'$or':_['map'](_0x4a771f,function(_0x58e8ff){if(_0x58e8ff[_0xb089('0x34')]!==_0xb089('0x35')){var _0x14e470={};_0x14e470[_0x58e8ff[_0xb089('0x23')]]={'$like':'%'+_0x59a4bc[_0xb089('0x27')][_0xb089('0x32')]+'%'};return _0x14e470;}})});}_0x4820a4=_[_0xb089('0x33')]({},_0x4820a4,_0x59a4bc['options']);var _0xf3bf97={'where':_0x4820a4[_0xb089('0x31')]};return db[_0xb089('0x36')][_0xb089('0x18')](_0xf3bf97)['then'](function(_0x28acd1){_0x16aa65['count']=_0x28acd1;if(_0x59a4bc[_0xb089('0x27')][_0xb089('0x37')]){_0x4820a4['include']=[{'all':!![]}];}return db[_0xb089('0x36')][_0xb089('0x38')](_0x4820a4);})[_0xb089('0x1d')](function(_0x32e075){_0x16aa65[_0xb089('0x39')]=_0x32e075;return _0x16aa65;})[_0xb089('0x1d')](respondWithFilteredResult(_0x5663ff,_0x4820a4))[_0xb089('0x3a')](handleError(_0x5663ff,null));};exports[_0xb089('0x3b')]=function(_0x3e5e6a,_0x550e6d){var _0x44fe49={'raw':![],'where':{'id':_0x3e5e6a[_0xb089('0x3c')]['id']}},_0x295436={};_0x295436['model']=_[_0xb089('0x28')](db[_0xb089('0x36')][_0xb089('0x3d')]);_0x295436['query']=_[_0xb089('0x28')](_0x3e5e6a[_0xb089('0x27')]);_0x295436[_0xb089('0x29')]=_['intersection'](_0x295436[_0xb089('0x2a')],_0x295436[_0xb089('0x27')]);_0x44fe49[_0xb089('0x2b')]=_['intersection'](_0x295436['model'],qs[_0xb089('0x2c')](_0x3e5e6a[_0xb089('0x27')][_0xb089('0x2c')]));_0x44fe49[_0xb089('0x2b')]=_0x44fe49[_0xb089('0x2b')][_0xb089('0x2d')]?_0x44fe49[_0xb089('0x2b')]:_0x295436[_0xb089('0x2a')];if(_0x3e5e6a[_0xb089('0x27')]['includeAll']){_0x44fe49['include']=[{'all':!![]}];}_0x44fe49=_[_0xb089('0x33')]({},_0x44fe49,_0x3e5e6a['options']);return db[_0xb089('0x36')][_0xb089('0x3e')](_0x44fe49)[_0xb089('0x1d')](handleEntityNotFound(_0x550e6d,null))['then'](respondWithResult(_0x550e6d,null))[_0xb089('0x3a')](handleError(_0x550e6d,null));};exports[_0xb089('0x3f')]=function(_0x27788e,_0x5038ec){return db[_0xb089('0x36')][_0xb089('0x3f')](_0x27788e[_0xb089('0x40')],{})[_0xb089('0x1d')](function(_0x55a923){var _0xb9ef65=_0x27788e['user']['get']({'plain':!![]});if(!_0xb9ef65)throw new Error(_0xb089('0x41'));if(_0xb9ef65[_0xb089('0x42')]==='user'){var _0x47142a=_0x55a923['get']({'plain':!![]});var _0x413d19=_0xb089('0x43');return db[_0xb089('0x44')][_0xb089('0x3e')]({'where':{'name':_0x413d19,'userProfileId':_0xb9ef65[_0xb089('0x45')]},'raw':!![]})[_0xb089('0x1d')](function(_0x452f8d){if(_0x452f8d&&_0x452f8d[_0xb089('0x46')]===0x0){return db['UserProfileResource'][_0xb089('0x3f')]({'name':_0x47142a[_0xb089('0x23')],'resourceId':_0x47142a['id'],'type':_0x452f8d['name'],'sectionId':_0x452f8d['id']},{})[_0xb089('0x1d')](function(){return _0x55a923;});}else{return _0x55a923;}})['catch'](function(_0x9d8eea){logger[_0xb089('0x21')](_0xb089('0x47'),_0x9d8eea);throw _0x9d8eea;});}return _0x55a923;})[_0xb089('0x1d')](respondWithResult(_0x5038ec,0xc9))[_0xb089('0x3a')](handleError(_0x5038ec,null));};exports[_0xb089('0x48')]=function(_0x3821db,_0xa2d62b){var _0x15cd54={'where':{'id':_0x3821db[_0xb089('0x3c')]['id']}},_0x23ec16={};_0x23ec16[_0xb089('0x2a')]=_[_0xb089('0x28')](db[_0xb089('0x36')][_0xb089('0x3d')]);_0x15cd54[_0xb089('0x2b')]=_[_0xb089('0x49')](_0x23ec16[_0xb089('0x2a')],qs['fields'](_0x3821db[_0xb089('0x27')][_0xb089('0x2c')]));_0x15cd54[_0xb089('0x2b')]=_0x15cd54[_0xb089('0x2b')][_0xb089('0x2d')]?_0x15cd54[_0xb089('0x2b')]:_0x23ec16['model'];if(_0x3821db[_0xb089('0x27')][_0xb089('0x37')]){_0x15cd54['include']=[{'all':!![]}];}_0x15cd54=_[_0xb089('0x33')]({},_0x15cd54,_0x3821db[_0xb089('0x4a')]);return db[_0xb089('0x36')][_0xb089('0x3e')](_0x15cd54)[_0xb089('0x1d')](handleEntityNotFound(_0xa2d62b,null))[_0xb089('0x1d')](function(_0x3b0bd0){if(_0x3b0bd0){var _0x1e8820=_0x3b0bd0[_0xb089('0x1f')]({'plain':!![]});_0x1e8820=qs[_0xb089('0x4b')](_0x1e8820,['id',_0xb089('0x4c'),_0xb089('0x4d')]);_0x3821db['body']=_[_0xb089('0x4b')](_0x3821db['body'],['id',_0xb089('0x4c'),_0xb089('0x4d')]);return db[_0xb089('0x36')][_0xb089('0x3f')](_[_0xb089('0x33')](_0x1e8820,_0x3821db[_0xb089('0x40')]),{'include':_0x3821db['query'][_0xb089('0x37')]?[{'all':!![]}]:undefined})[_0xb089('0x1d')](function(_0x79bde3){var _0x285d13=_0x3821db[_0xb089('0x4e')][_0xb089('0x1f')]({'plain':!![]});if(!_0x285d13)throw new Error(_0xb089('0x41'));if(_0x285d13[_0xb089('0x42')]==='user'){var _0x5999a4=_0x79bde3['get']({'plain':!![]});var _0x3867a3='Projects';return db[_0xb089('0x44')]['find']({'where':{'name':_0x3867a3,'userProfileId':_0x285d13['userProfileId']},'raw':!![]})[_0xb089('0x1d')](function(_0x3c0b82){if(_0x3c0b82&&_0x3c0b82[_0xb089('0x46')]===0x0){return db['UserProfileResource'][_0xb089('0x3f')]({'name':_0x5999a4[_0xb089('0x23')],'resourceId':_0x5999a4['id'],'type':_0x3c0b82[_0xb089('0x23')],'sectionId':_0x3c0b82['id']},{})[_0xb089('0x1d')](function(){return _0x79bde3;});}else{return _0x79bde3;}})[_0xb089('0x3a')](function(_0x166f2f){logger['error'](_0xb089('0x47'),_0x166f2f);throw _0x166f2f;});}return _0x79bde3;});}})[_0xb089('0x1d')](respondWithResult(_0xa2d62b,0xc9))['catch'](handleError(_0xa2d62b,null));};exports[_0xb089('0x1c')]=function(_0x206140,_0x458fa0){if(_0x206140['body']['id']){delete _0x206140[_0xb089('0x40')]['id'];}return db[_0xb089('0x36')][_0xb089('0x3e')]({'where':{'id':_0x206140[_0xb089('0x3c')]['id']}})['then'](handleEntityNotFound(_0x458fa0,null))['then'](saveUpdates(_0x206140[_0xb089('0x40')],null))[_0xb089('0x1d')](respondWithResult(_0x458fa0,null))[_0xb089('0x3a')](handleError(_0x458fa0,null));};exports[_0xb089('0x1e')]=function(_0x35131e,_0x1bb5f1){return db['JscriptyProject']['find']({'where':{'id':_0x35131e[_0xb089('0x3c')]['id']}})['then'](handleEntityNotFound(_0x1bb5f1,null))[_0xb089('0x1d')](removeEntity(_0x1bb5f1,null))['catch'](handleError(_0x1bb5f1,null));};exports['getSessions']=function(_0x4ad03a,_0x176197,_0x2350e4){var _0x15167c={'raw':!![],'where':{}};var _0x27f0e5={};var _0x1c59a0={'count':0x0,'rows':[]};return db[_0xb089('0x36')]['findOne']({'where':{'id':_0x4ad03a['params']['id']}})[_0xb089('0x1d')](handleEntityNotFound(_0x176197,null))[_0xb089('0x1d')](function(_0xf7a9f3){if(_0xf7a9f3){_0x27f0e5[_0xb089('0x2a')]=_[_0xb089('0x28')](db[_0xb089('0x4f')][_0xb089('0x3d')]);_0x27f0e5[_0xb089('0x27')]=_[_0xb089('0x28')](_0x4ad03a['query']);_0x27f0e5[_0xb089('0x29')]=_['intersection'](_0x27f0e5['model'],_0x27f0e5[_0xb089('0x27')]);_0x15167c[_0xb089('0x2b')]=_[_0xb089('0x49')](_0x27f0e5[_0xb089('0x2a')],qs[_0xb089('0x2c')](_0x4ad03a[_0xb089('0x27')][_0xb089('0x2c')]));_0x15167c[_0xb089('0x2b')]=_0x15167c[_0xb089('0x2b')]['length']?_0x15167c[_0xb089('0x2b')]:_0x27f0e5['model'];if(!_0x4ad03a[_0xb089('0x27')]['hasOwnProperty']('nolimit')){_0x15167c[_0xb089('0x1a')]=qs[_0xb089('0x1a')](_0x4ad03a[_0xb089('0x27')][_0xb089('0x1a')]);_0x15167c['offset']=qs['offset'](_0x4ad03a[_0xb089('0x27')]['offset']);}_0x15167c['order']=qs[_0xb089('0x30')](_0x4ad03a[_0xb089('0x27')][_0xb089('0x30')]);_0x15167c[_0xb089('0x31')]=qs['filters'](_[_0xb089('0x50')](_0x4ad03a['query'],_0x27f0e5[_0xb089('0x29')]));_0x15167c[_0xb089('0x31')]['ProjectId']=_0xf7a9f3['id'];if(_0x4ad03a[_0xb089('0x27')][_0xb089('0x32')]){_0x15167c[_0xb089('0x31')]=_[_0xb089('0x33')](_0x15167c[_0xb089('0x31')],{'$or':_[_0xb089('0x26')](_0x15167c['attributes'],function(_0x11b66f){var _0x4e5991={};_0x4e5991[_0x11b66f]={'$like':'%'+_0x4ad03a[_0xb089('0x27')][_0xb089('0x32')]+'%'};return _0x4e5991;})});}_0x15167c=_[_0xb089('0x33')]({},_0x15167c,_0x4ad03a[_0xb089('0x4a')]);return db[_0xb089('0x4f')][_0xb089('0x18')]({'where':_0x15167c[_0xb089('0x31')]})[_0xb089('0x1d')](function(_0x5f44c9){_0x1c59a0[_0xb089('0x18')]=_0x5f44c9;if(_0x4ad03a[_0xb089('0x27')][_0xb089('0x37')]){_0x15167c['include']=[{'all':!![]}];}return db['JscriptySessionReport']['findAll'](_0x15167c);})[_0xb089('0x1d')](function(_0x300e20){_0x1c59a0[_0xb089('0x39')]=_0x300e20;return _0x1c59a0;});}})[_0xb089('0x1d')](respondWithFilteredResult(_0x176197,_0x15167c))['catch'](handleError(_0x176197,null));};exports[_0xb089('0x51')]=function(_0x566d75,_0xdec4c,_0x78accb){var _0x262ee2={'raw':!![],'where':{}};var _0x14a706={};var _0x2b4cff={'count':0x0,'rows':[]};return db[_0xb089('0x36')][_0xb089('0x52')]({'where':{'id':_0x566d75[_0xb089('0x3c')]['id']}})[_0xb089('0x1d')](handleEntityNotFound(_0xdec4c,null))[_0xb089('0x1d')](function(_0x2c89af){if(_0x2c89af){_0x14a706[_0xb089('0x2a')]=_['keys'](db[_0xb089('0x53')][_0xb089('0x3d')]);_0x14a706[_0xb089('0x27')]=_[_0xb089('0x28')](_0x566d75[_0xb089('0x27')]);_0x14a706[_0xb089('0x29')]=_['intersection'](_0x14a706[_0xb089('0x2a')],_0x14a706[_0xb089('0x27')]);_0x262ee2[_0xb089('0x2b')]=_[_0xb089('0x49')](_0x14a706[_0xb089('0x2a')],qs[_0xb089('0x2c')](_0x566d75['query'][_0xb089('0x2c')]));_0x262ee2[_0xb089('0x2b')]=_0x262ee2['attributes'][_0xb089('0x2d')]?_0x262ee2[_0xb089('0x2b')]:_0x14a706[_0xb089('0x2a')];if(!_0x566d75[_0xb089('0x27')][_0xb089('0x54')](_0xb089('0x2e'))){_0x262ee2[_0xb089('0x1a')]=qs[_0xb089('0x1a')](_0x566d75[_0xb089('0x27')][_0xb089('0x1a')]);_0x262ee2[_0xb089('0x19')]=qs[_0xb089('0x19')](_0x566d75[_0xb089('0x27')][_0xb089('0x19')]);}_0x262ee2['order']=qs[_0xb089('0x30')](_0x566d75[_0xb089('0x27')][_0xb089('0x30')]);_0x262ee2[_0xb089('0x31')]=qs['filters'](_[_0xb089('0x50')](_0x566d75[_0xb089('0x27')],_0x14a706['filters']));_0x262ee2[_0xb089('0x31')][_0xb089('0x55')]=_0x2c89af['id'];if(_0x566d75[_0xb089('0x27')][_0xb089('0x32')]){_0x262ee2[_0xb089('0x31')]=_[_0xb089('0x33')](_0x262ee2[_0xb089('0x31')],{'$or':_[_0xb089('0x26')](_0x262ee2[_0xb089('0x2b')],function(_0x1424f0){var _0x46ac00={};_0x46ac00[_0x1424f0]={'$like':'%'+_0x566d75[_0xb089('0x27')][_0xb089('0x32')]+'%'};return _0x46ac00;})});}_0x262ee2=_[_0xb089('0x33')]({},_0x262ee2,_0x566d75[_0xb089('0x4a')]);return db['JscriptyAnswerReport'][_0xb089('0x18')]({'where':_0x262ee2['where']})[_0xb089('0x1d')](function(_0x928e08){_0x2b4cff[_0xb089('0x18')]=_0x928e08;if(_0x566d75[_0xb089('0x27')][_0xb089('0x37')]){_0x262ee2[_0xb089('0x56')]=[{'all':!![]}];}return db['JscriptyAnswerReport'][_0xb089('0x38')](_0x262ee2);})['then'](function(_0x5ab375){_0x2b4cff[_0xb089('0x39')]=_0x5ab375;return _0x2b4cff;});}})[_0xb089('0x1d')](respondWithFilteredResult(_0xdec4c,_0x262ee2))[_0xb089('0x3a')](handleError(_0xdec4c,null));};function char(_0x1bd586){return _0xb089('0x57')===typeof _0x1bd586?String[_0xb089('0x58')][_0xb089('0x59')](null,arguments):_0x1bd586;}function needsEncapsulation(_0x25aa42){return!!_0x25aa42&&(_0x25aa42['toString']()[_0xb089('0x5a')](char(0xd))>=0x0||_0x25aa42[_0xb089('0x5b')]()[_0xb089('0x5a')](char(0xa))>=0x0||_0x25aa42[_0xb089('0x5b')]()[_0xb089('0x5a')](char(0x2c))>=0x0||_0x25aa42[_0xb089('0x5b')]()[_0xb089('0x5a')](char(0x22))>=0x0);}function encapsulate(_0x324055){var _0x1bbe7f=char(0x22),_0x434631='\x5c'+char(0x22),_0x37582e=_0x324055[_0xb089('0x5b')]()['replace'](new RegExp(_0x1bbe7f,'g'),_0x434631);return _0x1bbe7f+_0x37582e+_0x1bbe7f;}exports[_0xb089('0x5c')]=function(_0x3833e1,_0xd9143e,_0x16f839){var _0x1b66b4,_0x1f1dc7;var _0x14782b={'where':{'ProjectId':_0x3833e1['params']['id']}};if(_0x3833e1[_0xb089('0x27')][_0xb089('0x5d')]){_0x14782b[_0xb089('0x31')][_0xb089('0x5e')]=JSON[_0xb089('0x5f')](_0x3833e1[_0xb089('0x27')][_0xb089('0x5d')]);}return db[_0xb089('0x4f')][_0xb089('0x38')](_0x14782b)['then'](handleEntityNotFound(_0xd9143e,null))[_0xb089('0x1d')](function(_0x69132a){if(_0x69132a){_0x1b66b4=_0x69132a;return db[_0xb089('0x60')][_0xb089('0x38')]({'where':{'SessionId':{'$in':_[_0xb089('0x26')](_0x1b66b4,'id')},'ProjectId':_0x3833e1['params']['id']},'order':'-createdAt'});}})[_0xb089('0x1d')](handleEntityNotFound(_0xd9143e,null))['then'](function(_0x2cf4c0){if(_0x2cf4c0){_0x1f1dc7=_0x2cf4c0;var _0x5765b5={};for(var _0x113cf0=0x0,_0xf3eb1f=_0x1f1dc7[_0xb089('0x2d')];_0x113cf0<_0xf3eb1f;_0x113cf0++){if(!_0x5765b5['hasOwnProperty'](_0x1f1dc7[_0x113cf0][_0xb089('0x61')])){_0x5765b5[_0x1f1dc7[_0x113cf0][_0xb089('0x61')]]=needsEncapsulation(_0x1f1dc7[_0x113cf0][_0xb089('0x62')])?encapsulate(_0x1f1dc7[_0x113cf0][_0xb089('0x62')]):_0x1f1dc7[_0x113cf0][_0xb089('0x62')];}}var _0x1fc0d0=[],_0x54779d={};for(var _0x3ada75=0x0,_0x4f6ab1=_0x1b66b4[_0xb089('0x2d')];_0x3ada75<_0x4f6ab1;_0x3ada75++){_0x54779d={'ProjectId':_0x3833e1[_0xb089('0x3c')]['id'],'SessionId':_0x1b66b4[_0x3ada75]['id'],'StartTime':moment(_0x1b66b4[_0x3ada75][_0xb089('0x5e')])['format']('YYYY-MM-DD\x20HH:mm:ss')};for(var _0x3bcf51=0x0,_0x1f497b=_0x1f1dc7[_0xb089('0x2d')];_0x3bcf51<_0x1f497b;_0x3bcf51++){if(_0x1f1dc7[_0x3bcf51][_0xb089('0x63')]==_0x1b66b4[_0x3ada75]['id']&&_0x5765b5[_0xb089('0x54')](_0x1f1dc7[_0x3bcf51][_0xb089('0x61')])){_0x54779d[_0x5765b5[_0x1f1dc7[_0x3bcf51][_0xb089('0x61')]]]=_0x1f1dc7[_0x3bcf51]['answer'];}}for(var _0x5dc729 in _0x5765b5){if(!_0x54779d[_0xb089('0x54')](_0x5765b5[_0x5dc729])){_0x54779d[_0x5765b5[_0x5dc729]]=null;}}_0x1fc0d0[_0xb089('0x64')](_0x54779d);}return _0x1fc0d0;}})[_0xb089('0x1d')](function(_0x39bb6d){if(!_[_0xb089('0x65')](_0x39bb6d)){var _0x94590b=toCsv(_0x39bb6d);var _0x4d85ce=Date['now']();fs[_0xb089('0x66')](util[_0xb089('0x67')](_0xb089('0x68'),_0x3833e1['params']['id'],_0x4d85ce),_0x94590b);_0xd9143e[_0xb089('0x69')](_0xb089('0x6a'),'attachment;\x20filename='+util['format'](_0xb089('0x6b'),_0x3833e1['params']['id'],_0x4d85ce));_0xd9143e[_0xb089('0x69')]('Content-type',_0xb089('0x6c'));return _0xd9143e[_0xb089('0x6d')](util['format'](_0xb089('0x68'),_0x3833e1[_0xb089('0x3c')]['id'],_0x4d85ce));}else{return _0xd9143e[_0xb089('0x6e')](0xcc);}})[_0xb089('0x3a')](handleError(_0xd9143e,null));};
\ No newline at end of file
+var _0x42ce=['nolimit','order','sort','where','pick','filter','merge','options','count','include','rows','show','find','catch','create','body','user','Unable\x20to\x20retrieve\x20the\x20current\x20user','role','UserProfileSection','userProfileId','autoAssociation','includeAll','omit','createdAt','params','getSessions','findOne','JscriptySessionReport','hasOwnProperty','findAll','getAnswers','JscriptyAnswerReport','ProjectId','number','fromCharCode','apply','toString','indexOf','replace','getSummary','startTime','starttime','parse','JscriptyQuestionReport','questionId','question','format','YYYY-MM-DD\x20HH:mm:ss','SessionId','answer','push','isEmpty','now','writeFileSync','setHeader','attachment;\x20filename=','Jscripty_Project_%d_Summary_%s.csv','Content-type','html-pdf','eml-format','zip-dir','fast-json-patch','request-promise','moment','mustache','util','ejs','squel','jsforce','desk.js','querystring','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','api','../../config/utils','../../config/environment','../../mysqldb','status','end','offset','limit','set','Content-Range','json','reject','update','then','get','Projects','UserProfileResource','destroy','sendStatus','error','stack','name','map','JscriptyProject','rawAttributes','fieldName','type','key','model','query','keys','filters','intersection','attributes','fields','length'];(function(_0x33fa0f,_0x46e4c0){var _0x28e89e=function(_0x48d5e2){while(--_0x48d5e2){_0x33fa0f['push'](_0x33fa0f['shift']());}};_0x28e89e(++_0x46e4c0);}(_0x42ce,0xab));var _0xe42c=function(_0x3ee5df,_0x583073){_0x3ee5df=_0x3ee5df-0x0;var _0x446d24=_0x42ce[_0x3ee5df];return _0x446d24;};'use strict';var pdf=require(_0xe42c('0x0'));var emlformat=require(_0xe42c('0x1'));var rimraf=require('rimraf');var zipdir=require(_0xe42c('0x2'));var jsonpatch=require(_0xe42c('0x3'));var rp=require(_0xe42c('0x4'));var moment=require(_0xe42c('0x5'));var BPromise=require('bluebird');var Mustache=require(_0xe42c('0x6'));var util=require(_0xe42c('0x7'));var path=require('path');var sox=require('sox');var csv=require('to-csv');var ejs=require(_0xe42c('0x8'));var fs=require('fs');var _=require('lodash');var squel=require(_0xe42c('0x9'));var crypto=require('crypto');var jsforce=require(_0xe42c('0xa'));var deskjs=require(_0xe42c('0xb'));var toCsv=require('to-csv');var querystring=require(_0xe42c('0xc'));var Papa=require('papaparse');var Redis=require('ioredis');var authService=require(_0xe42c('0xd'));var qs=require(_0xe42c('0xe'));var as=require(_0xe42c('0xf'));var hardwareService=require(_0xe42c('0x10'));var logger=require('../../config/logger')(_0xe42c('0x11'));var utils=require(_0xe42c('0x12'));var config=require(_0xe42c('0x13'));var db=require(_0xe42c('0x14'))['db'];function respondWithStatusCode(_0x504aa6,_0x5c7354){_0x5c7354=_0x5c7354||0xcc;return function(_0x50a867){if(_0x50a867){return _0x504aa6['sendStatus'](_0x5c7354);}return _0x504aa6[_0xe42c('0x15')](_0x5c7354)[_0xe42c('0x16')]();};}function respondWithResult(_0x23fcd2,_0x151e76){_0x151e76=_0x151e76||0xc8;return function(_0x4128d7){if(_0x4128d7){return _0x23fcd2[_0xe42c('0x15')](_0x151e76)['json'](_0x4128d7);}};}function respondWithFilteredResult(_0x1b8b3f,_0x2eb459){return function(_0x5549f5){if(_0x5549f5){var _0x540ab7=_0x5549f5['count'],_0x2b53f3=_0x2eb459['offset'],_0x50d899=_0x2eb459[_0xe42c('0x17')]+_0x2eb459[_0xe42c('0x18')],_0x16495e;if(_0x50d899>=_0x540ab7){_0x50d899=_0x540ab7;_0x16495e=0xc8;}else{_0x16495e=0xce;}_0x1b8b3f['status'](_0x16495e);return _0x1b8b3f[_0xe42c('0x19')](_0xe42c('0x1a'),_0x2b53f3+'-'+_0x50d899+'/'+_0x540ab7)[_0xe42c('0x1b')](_0x5549f5);}return null;};}function patchUpdates(_0x2bb062){return function(_0x43d458){try{jsonpatch['apply'](_0x43d458,_0x2bb062,!![]);}catch(_0x52b11b){return BPromise[_0xe42c('0x1c')](_0x52b11b);}return _0x43d458['save']();};}function saveUpdates(_0x48d606,_0x2fdbc9){return function(_0xf12c1e){if(_0xf12c1e){return _0xf12c1e[_0xe42c('0x1d')](_0x48d606)[_0xe42c('0x1e')](function(_0x3a6747){return _0x3a6747;});}return null;};}function removeEntity(_0x52df6d,_0x5a8e67){return function(_0x15c176){if(_0x15c176){return _0x15c176['destroy']()[_0xe42c('0x1e')](function(){var _0x4d996d=_0x15c176[_0xe42c('0x1f')]({'plain':!![]});var _0x152cd9=_0xe42c('0x20');return db[_0xe42c('0x21')][_0xe42c('0x22')]({'where':{'type':_0x152cd9,'resourceId':_0x4d996d['id']}})[_0xe42c('0x1e')](function(){return _0x15c176;});})[_0xe42c('0x1e')](function(){_0x52df6d[_0xe42c('0x15')](0xcc)[_0xe42c('0x16')]();});}};}function handleEntityNotFound(_0x523a4d,_0x544ec5){return function(_0x10bb95){if(!_0x10bb95){_0x523a4d[_0xe42c('0x23')](0x194);}return _0x10bb95;};}function handleError(_0x68799d,_0x9803f4){_0x9803f4=_0x9803f4||0x1f4;return function(_0x5f385e){logger[_0xe42c('0x24')](_0x5f385e[_0xe42c('0x25')]);if(_0x5f385e[_0xe42c('0x26')]){delete _0x5f385e[_0xe42c('0x26')];}_0x68799d[_0xe42c('0x15')](_0x9803f4)['send'](_0x5f385e);};}exports['index']=function(_0x5814f3,_0x53ff3c){var _0x376b54={},_0x535465={},_0x45f1dc={'count':0x0,'rows':[]};var _0x2c20f9=_[_0xe42c('0x27')](db[_0xe42c('0x28')][_0xe42c('0x29')],function(_0x45f274){return{'name':_0x45f274[_0xe42c('0x2a')],'type':_0x45f274[_0xe42c('0x2b')][_0xe42c('0x2c')]};});_0x535465[_0xe42c('0x2d')]=_[_0xe42c('0x27')](_0x2c20f9,'name');_0x535465[_0xe42c('0x2e')]=_[_0xe42c('0x2f')](_0x5814f3['query']);_0x535465[_0xe42c('0x30')]=_[_0xe42c('0x31')](_0x535465[_0xe42c('0x2d')],_0x535465['query']);_0x376b54[_0xe42c('0x32')]=_[_0xe42c('0x31')](_0x535465[_0xe42c('0x2d')],qs[_0xe42c('0x33')](_0x5814f3[_0xe42c('0x2e')][_0xe42c('0x33')]));_0x376b54[_0xe42c('0x32')]=_0x376b54['attributes'][_0xe42c('0x34')]?_0x376b54['attributes']:_0x535465[_0xe42c('0x2d')];if(!_0x5814f3['query']['hasOwnProperty'](_0xe42c('0x35'))){_0x376b54[_0xe42c('0x18')]=qs[_0xe42c('0x18')](_0x5814f3[_0xe42c('0x2e')][_0xe42c('0x18')]);_0x376b54[_0xe42c('0x17')]=qs[_0xe42c('0x17')](_0x5814f3[_0xe42c('0x2e')][_0xe42c('0x17')]);}_0x376b54[_0xe42c('0x36')]=qs[_0xe42c('0x37')](_0x5814f3[_0xe42c('0x2e')][_0xe42c('0x37')]);_0x376b54[_0xe42c('0x38')]=qs['filters'](_[_0xe42c('0x39')](_0x5814f3[_0xe42c('0x2e')],_0x535465[_0xe42c('0x30')]));if(_0x5814f3[_0xe42c('0x2e')][_0xe42c('0x3a')]){_0x376b54[_0xe42c('0x38')]=_[_0xe42c('0x3b')](_0x376b54[_0xe42c('0x38')],{'$or':_['map'](_0x2c20f9,function(_0xdaac9c){if(_0xdaac9c['type']!=='VIRTUAL'){var _0x9eaf49={};_0x9eaf49[_0xdaac9c[_0xe42c('0x26')]]={'$like':'%'+_0x5814f3[_0xe42c('0x2e')][_0xe42c('0x3a')]+'%'};return _0x9eaf49;}})});}_0x376b54=_[_0xe42c('0x3b')]({},_0x376b54,_0x5814f3[_0xe42c('0x3c')]);var _0x18ac1f={'where':_0x376b54['where']};return db[_0xe42c('0x28')][_0xe42c('0x3d')](_0x18ac1f)[_0xe42c('0x1e')](function(_0x48e5f0){_0x45f1dc['count']=_0x48e5f0;if(_0x5814f3['query']['includeAll']){_0x376b54[_0xe42c('0x3e')]=[{'all':!![]}];}return db['JscriptyProject']['findAll'](_0x376b54);})[_0xe42c('0x1e')](function(_0x5415d7){_0x45f1dc[_0xe42c('0x3f')]=_0x5415d7;return _0x45f1dc;})[_0xe42c('0x1e')](respondWithFilteredResult(_0x53ff3c,_0x376b54))['catch'](handleError(_0x53ff3c,null));};exports[_0xe42c('0x40')]=function(_0x11754d,_0x54e1e6){var _0x4dfd8a={'raw':![],'where':{'id':_0x11754d['params']['id']}},_0x51a493={};_0x51a493[_0xe42c('0x2d')]=_[_0xe42c('0x2f')](db['JscriptyProject'][_0xe42c('0x29')]);_0x51a493[_0xe42c('0x2e')]=_[_0xe42c('0x2f')](_0x11754d['query']);_0x51a493[_0xe42c('0x30')]=_[_0xe42c('0x31')](_0x51a493[_0xe42c('0x2d')],_0x51a493['query']);_0x4dfd8a[_0xe42c('0x32')]=_[_0xe42c('0x31')](_0x51a493[_0xe42c('0x2d')],qs[_0xe42c('0x33')](_0x11754d[_0xe42c('0x2e')][_0xe42c('0x33')]));_0x4dfd8a[_0xe42c('0x32')]=_0x4dfd8a[_0xe42c('0x32')][_0xe42c('0x34')]?_0x4dfd8a['attributes']:_0x51a493[_0xe42c('0x2d')];if(_0x11754d[_0xe42c('0x2e')]['includeAll']){_0x4dfd8a[_0xe42c('0x3e')]=[{'all':!![]}];}_0x4dfd8a=_[_0xe42c('0x3b')]({},_0x4dfd8a,_0x11754d[_0xe42c('0x3c')]);return db[_0xe42c('0x28')][_0xe42c('0x41')](_0x4dfd8a)['then'](handleEntityNotFound(_0x54e1e6,null))[_0xe42c('0x1e')](respondWithResult(_0x54e1e6,null))[_0xe42c('0x42')](handleError(_0x54e1e6,null));};exports[_0xe42c('0x43')]=function(_0x2829f5,_0x465dd3){return db['JscriptyProject'][_0xe42c('0x43')](_0x2829f5[_0xe42c('0x44')],{})['then'](function(_0x17611b){var _0x1460cf=_0x2829f5[_0xe42c('0x45')][_0xe42c('0x1f')]({'plain':!![]});if(!_0x1460cf)throw new Error(_0xe42c('0x46'));if(_0x1460cf[_0xe42c('0x47')]===_0xe42c('0x45')){var _0x236fdb=_0x17611b[_0xe42c('0x1f')]({'plain':!![]});var _0x3db862=_0xe42c('0x20');return db[_0xe42c('0x48')][_0xe42c('0x41')]({'where':{'name':_0x3db862,'userProfileId':_0x1460cf[_0xe42c('0x49')]},'raw':!![]})[_0xe42c('0x1e')](function(_0x159247){if(_0x159247&&_0x159247[_0xe42c('0x4a')]===0x0){return db[_0xe42c('0x21')][_0xe42c('0x43')]({'name':_0x236fdb[_0xe42c('0x26')],'resourceId':_0x236fdb['id'],'type':_0x159247[_0xe42c('0x26')],'sectionId':_0x159247['id']},{})[_0xe42c('0x1e')](function(){return _0x17611b;});}else{return _0x17611b;}})['catch'](function(_0x4705a8){logger[_0xe42c('0x24')]('Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s',_0x4705a8);throw _0x4705a8;});}return _0x17611b;})[_0xe42c('0x1e')](respondWithResult(_0x465dd3,0xc9))[_0xe42c('0x42')](handleError(_0x465dd3,null));};exports['clone']=function(_0x53b506,_0x39e028){var _0x23ebf6={'where':{'id':_0x53b506['params']['id']}},_0x23d6e2={};_0x23d6e2[_0xe42c('0x2d')]=_[_0xe42c('0x2f')](db[_0xe42c('0x28')][_0xe42c('0x29')]);_0x23ebf6[_0xe42c('0x32')]=_[_0xe42c('0x31')](_0x23d6e2[_0xe42c('0x2d')],qs[_0xe42c('0x33')](_0x53b506[_0xe42c('0x2e')][_0xe42c('0x33')]));_0x23ebf6['attributes']=_0x23ebf6[_0xe42c('0x32')][_0xe42c('0x34')]?_0x23ebf6[_0xe42c('0x32')]:_0x23d6e2[_0xe42c('0x2d')];if(_0x53b506[_0xe42c('0x2e')][_0xe42c('0x4b')]){_0x23ebf6[_0xe42c('0x3e')]=[{'all':!![]}];}_0x23ebf6=_[_0xe42c('0x3b')]({},_0x23ebf6,_0x53b506[_0xe42c('0x3c')]);return db[_0xe42c('0x28')][_0xe42c('0x41')](_0x23ebf6)[_0xe42c('0x1e')](handleEntityNotFound(_0x39e028,null))[_0xe42c('0x1e')](function(_0x3a3485){if(_0x3a3485){var _0x46c274=_0x3a3485[_0xe42c('0x1f')]({'plain':!![]});_0x46c274=qs[_0xe42c('0x4c')](_0x46c274,['id',_0xe42c('0x4d'),'updatedAt']);_0x53b506[_0xe42c('0x44')]=_[_0xe42c('0x4c')](_0x53b506[_0xe42c('0x44')],['id',_0xe42c('0x4d'),'updatedAt']);return db[_0xe42c('0x28')]['create'](_[_0xe42c('0x3b')](_0x46c274,_0x53b506[_0xe42c('0x44')]),{'include':_0x53b506[_0xe42c('0x2e')][_0xe42c('0x4b')]?[{'all':!![]}]:undefined})[_0xe42c('0x1e')](function(_0x5408e8){var _0xedc13b=_0x53b506[_0xe42c('0x45')]['get']({'plain':!![]});if(!_0xedc13b)throw new Error(_0xe42c('0x46'));if(_0xedc13b[_0xe42c('0x47')]==='user'){var _0x4ba00a=_0x5408e8[_0xe42c('0x1f')]({'plain':!![]});var _0xca0f91=_0xe42c('0x20');return db[_0xe42c('0x48')]['find']({'where':{'name':_0xca0f91,'userProfileId':_0xedc13b['userProfileId']},'raw':!![]})[_0xe42c('0x1e')](function(_0x63ae33){if(_0x63ae33&&_0x63ae33[_0xe42c('0x4a')]===0x0){return db[_0xe42c('0x21')][_0xe42c('0x43')]({'name':_0x4ba00a[_0xe42c('0x26')],'resourceId':_0x4ba00a['id'],'type':_0x63ae33[_0xe42c('0x26')],'sectionId':_0x63ae33['id']},{})[_0xe42c('0x1e')](function(){return _0x5408e8;});}else{return _0x5408e8;}})['catch'](function(_0x44cdd2){logger[_0xe42c('0x24')]('Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s',_0x44cdd2);throw _0x44cdd2;});}return _0x5408e8;});}})['then'](respondWithResult(_0x39e028,0xc9))['catch'](handleError(_0x39e028,null));};exports[_0xe42c('0x1d')]=function(_0x1286e7,_0x167080){if(_0x1286e7[_0xe42c('0x44')]['id']){delete _0x1286e7[_0xe42c('0x44')]['id'];}return db[_0xe42c('0x28')][_0xe42c('0x41')]({'where':{'id':_0x1286e7[_0xe42c('0x4e')]['id']}})[_0xe42c('0x1e')](handleEntityNotFound(_0x167080,null))[_0xe42c('0x1e')](saveUpdates(_0x1286e7[_0xe42c('0x44')],null))['then'](respondWithResult(_0x167080,null))[_0xe42c('0x42')](handleError(_0x167080,null));};exports[_0xe42c('0x22')]=function(_0x275384,_0x416497){return db[_0xe42c('0x28')]['find']({'where':{'id':_0x275384[_0xe42c('0x4e')]['id']}})['then'](handleEntityNotFound(_0x416497,null))['then'](removeEntity(_0x416497,null))[_0xe42c('0x42')](handleError(_0x416497,null));};exports[_0xe42c('0x4f')]=function(_0x2b0d24,_0x238a9e,_0x47f16c){var _0x5b5d47={'raw':!![],'where':{}};var _0x6d5c6a={};var _0x16a4d1={'count':0x0,'rows':[]};return db[_0xe42c('0x28')][_0xe42c('0x50')]({'where':{'id':_0x2b0d24[_0xe42c('0x4e')]['id']}})[_0xe42c('0x1e')](handleEntityNotFound(_0x238a9e,null))[_0xe42c('0x1e')](function(_0x31eaf8){if(_0x31eaf8){_0x6d5c6a[_0xe42c('0x2d')]=_[_0xe42c('0x2f')](db[_0xe42c('0x51')][_0xe42c('0x29')]);_0x6d5c6a['query']=_['keys'](_0x2b0d24[_0xe42c('0x2e')]);_0x6d5c6a[_0xe42c('0x30')]=_[_0xe42c('0x31')](_0x6d5c6a['model'],_0x6d5c6a[_0xe42c('0x2e')]);_0x5b5d47[_0xe42c('0x32')]=_['intersection'](_0x6d5c6a['model'],qs[_0xe42c('0x33')](_0x2b0d24[_0xe42c('0x2e')]['fields']));_0x5b5d47['attributes']=_0x5b5d47[_0xe42c('0x32')][_0xe42c('0x34')]?_0x5b5d47[_0xe42c('0x32')]:_0x6d5c6a[_0xe42c('0x2d')];if(!_0x2b0d24[_0xe42c('0x2e')][_0xe42c('0x52')]('nolimit')){_0x5b5d47[_0xe42c('0x18')]=qs[_0xe42c('0x18')](_0x2b0d24[_0xe42c('0x2e')][_0xe42c('0x18')]);_0x5b5d47['offset']=qs['offset'](_0x2b0d24[_0xe42c('0x2e')][_0xe42c('0x17')]);}_0x5b5d47['order']=qs[_0xe42c('0x37')](_0x2b0d24['query'][_0xe42c('0x37')]);_0x5b5d47[_0xe42c('0x38')]=qs[_0xe42c('0x30')](_[_0xe42c('0x39')](_0x2b0d24[_0xe42c('0x2e')],_0x6d5c6a['filters']));_0x5b5d47[_0xe42c('0x38')]['ProjectId']=_0x31eaf8['id'];if(_0x2b0d24[_0xe42c('0x2e')][_0xe42c('0x3a')]){_0x5b5d47[_0xe42c('0x38')]=_[_0xe42c('0x3b')](_0x5b5d47['where'],{'$or':_[_0xe42c('0x27')](_0x5b5d47['attributes'],function(_0x8dce4f){var _0x304864={};_0x304864[_0x8dce4f]={'$like':'%'+_0x2b0d24[_0xe42c('0x2e')]['filter']+'%'};return _0x304864;})});}_0x5b5d47=_[_0xe42c('0x3b')]({},_0x5b5d47,_0x2b0d24[_0xe42c('0x3c')]);return db[_0xe42c('0x51')][_0xe42c('0x3d')]({'where':_0x5b5d47[_0xe42c('0x38')]})[_0xe42c('0x1e')](function(_0x377897){_0x16a4d1[_0xe42c('0x3d')]=_0x377897;if(_0x2b0d24[_0xe42c('0x2e')]['includeAll']){_0x5b5d47[_0xe42c('0x3e')]=[{'all':!![]}];}return db[_0xe42c('0x51')][_0xe42c('0x53')](_0x5b5d47);})[_0xe42c('0x1e')](function(_0x4f723c){_0x16a4d1['rows']=_0x4f723c;return _0x16a4d1;});}})['then'](respondWithFilteredResult(_0x238a9e,_0x5b5d47))[_0xe42c('0x42')](handleError(_0x238a9e,null));};exports[_0xe42c('0x54')]=function(_0x1fda17,_0x3f8718,_0x4ea3ce){var _0x172926={'raw':!![],'where':{}};var _0x39d9bf={};var _0x158ed1={'count':0x0,'rows':[]};return db[_0xe42c('0x28')][_0xe42c('0x50')]({'where':{'id':_0x1fda17[_0xe42c('0x4e')]['id']}})[_0xe42c('0x1e')](handleEntityNotFound(_0x3f8718,null))[_0xe42c('0x1e')](function(_0x591d54){if(_0x591d54){_0x39d9bf[_0xe42c('0x2d')]=_[_0xe42c('0x2f')](db[_0xe42c('0x55')]['rawAttributes']);_0x39d9bf[_0xe42c('0x2e')]=_['keys'](_0x1fda17['query']);_0x39d9bf[_0xe42c('0x30')]=_[_0xe42c('0x31')](_0x39d9bf[_0xe42c('0x2d')],_0x39d9bf[_0xe42c('0x2e')]);_0x172926[_0xe42c('0x32')]=_[_0xe42c('0x31')](_0x39d9bf[_0xe42c('0x2d')],qs[_0xe42c('0x33')](_0x1fda17[_0xe42c('0x2e')][_0xe42c('0x33')]));_0x172926[_0xe42c('0x32')]=_0x172926[_0xe42c('0x32')]['length']?_0x172926['attributes']:_0x39d9bf[_0xe42c('0x2d')];if(!_0x1fda17['query'][_0xe42c('0x52')](_0xe42c('0x35'))){_0x172926[_0xe42c('0x18')]=qs[_0xe42c('0x18')](_0x1fda17['query'][_0xe42c('0x18')]);_0x172926['offset']=qs[_0xe42c('0x17')](_0x1fda17[_0xe42c('0x2e')][_0xe42c('0x17')]);}_0x172926[_0xe42c('0x36')]=qs[_0xe42c('0x37')](_0x1fda17[_0xe42c('0x2e')][_0xe42c('0x37')]);_0x172926[_0xe42c('0x38')]=qs['filters'](_['pick'](_0x1fda17[_0xe42c('0x2e')],_0x39d9bf['filters']));_0x172926[_0xe42c('0x38')][_0xe42c('0x56')]=_0x591d54['id'];if(_0x1fda17[_0xe42c('0x2e')]['filter']){_0x172926['where']=_[_0xe42c('0x3b')](_0x172926[_0xe42c('0x38')],{'$or':_[_0xe42c('0x27')](_0x172926[_0xe42c('0x32')],function(_0xd8e1cd){var _0x413ad4={};_0x413ad4[_0xd8e1cd]={'$like':'%'+_0x1fda17[_0xe42c('0x2e')][_0xe42c('0x3a')]+'%'};return _0x413ad4;})});}_0x172926=_[_0xe42c('0x3b')]({},_0x172926,_0x1fda17['options']);return db[_0xe42c('0x55')][_0xe42c('0x3d')]({'where':_0x172926[_0xe42c('0x38')]})[_0xe42c('0x1e')](function(_0x3cdbbd){_0x158ed1[_0xe42c('0x3d')]=_0x3cdbbd;if(_0x1fda17[_0xe42c('0x2e')][_0xe42c('0x4b')]){_0x172926[_0xe42c('0x3e')]=[{'all':!![]}];}return db[_0xe42c('0x55')][_0xe42c('0x53')](_0x172926);})['then'](function(_0x25bbbb){_0x158ed1[_0xe42c('0x3f')]=_0x25bbbb;return _0x158ed1;});}})[_0xe42c('0x1e')](respondWithFilteredResult(_0x3f8718,_0x172926))['catch'](handleError(_0x3f8718,null));};function char(_0x2d4279){return _0xe42c('0x57')===typeof _0x2d4279?String[_0xe42c('0x58')][_0xe42c('0x59')](null,arguments):_0x2d4279;}function needsEncapsulation(_0x44167a){return!!_0x44167a&&(_0x44167a[_0xe42c('0x5a')]()[_0xe42c('0x5b')](char(0xd))>=0x0||_0x44167a[_0xe42c('0x5a')]()[_0xe42c('0x5b')](char(0xa))>=0x0||_0x44167a[_0xe42c('0x5a')]()[_0xe42c('0x5b')](char(0x2c))>=0x0||_0x44167a[_0xe42c('0x5a')]()['indexOf'](char(0x22))>=0x0);}function encapsulate(_0x57f5ab){var _0x28ec9d=char(0x22),_0x505a6c='\x5c'+char(0x22),_0x53f7f2=_0x57f5ab['toString']()[_0xe42c('0x5c')](new RegExp(_0x28ec9d,'g'),_0x505a6c);return _0x28ec9d+_0x53f7f2+_0x28ec9d;}exports[_0xe42c('0x5d')]=function(_0x4b9b95,_0x4473ac,_0x1e1f7c){var _0x406d12,_0x4858b4;var _0x3d478c={'where':{'ProjectId':_0x4b9b95[_0xe42c('0x4e')]['id']}};if(_0x4b9b95[_0xe42c('0x2e')][_0xe42c('0x5e')]){_0x3d478c[_0xe42c('0x38')][_0xe42c('0x5f')]=JSON[_0xe42c('0x60')](_0x4b9b95[_0xe42c('0x2e')][_0xe42c('0x5e')]);}return db[_0xe42c('0x51')][_0xe42c('0x53')](_0x3d478c)['then'](handleEntityNotFound(_0x4473ac,null))[_0xe42c('0x1e')](function(_0xd2b8fc){if(_0xd2b8fc){_0x406d12=_0xd2b8fc;return db[_0xe42c('0x61')][_0xe42c('0x53')]({'where':{'SessionId':{'$in':_['map'](_0x406d12,'id')},'ProjectId':_0x4b9b95[_0xe42c('0x4e')]['id']},'order':'-createdAt'});}})[_0xe42c('0x1e')](handleEntityNotFound(_0x4473ac,null))[_0xe42c('0x1e')](function(_0x3fdc32){if(_0x3fdc32){_0x4858b4=_0x3fdc32;var _0x2bfd63={};for(var _0x542e8a=0x0,_0x58c306=_0x4858b4[_0xe42c('0x34')];_0x542e8a<_0x58c306;_0x542e8a++){if(!_0x2bfd63[_0xe42c('0x52')](_0x4858b4[_0x542e8a][_0xe42c('0x62')])){_0x2bfd63[_0x4858b4[_0x542e8a]['questionId']]=needsEncapsulation(_0x4858b4[_0x542e8a][_0xe42c('0x63')])?encapsulate(_0x4858b4[_0x542e8a]['question']):_0x4858b4[_0x542e8a][_0xe42c('0x63')];}}var _0x342cae=[],_0x1c7fbb={};for(var _0x3c48a9=0x0,_0x3f60cb=_0x406d12[_0xe42c('0x34')];_0x3c48a9<_0x3f60cb;_0x3c48a9++){_0x1c7fbb={'ProjectId':_0x4b9b95[_0xe42c('0x4e')]['id'],'SessionId':_0x406d12[_0x3c48a9]['id'],'StartTime':moment(_0x406d12[_0x3c48a9]['starttime'])[_0xe42c('0x64')](_0xe42c('0x65'))};for(var _0x49eaaf=0x0,_0x45ae5d=_0x4858b4['length'];_0x49eaaf<_0x45ae5d;_0x49eaaf++){if(_0x4858b4[_0x49eaaf][_0xe42c('0x66')]==_0x406d12[_0x3c48a9]['id']&&_0x2bfd63[_0xe42c('0x52')](_0x4858b4[_0x49eaaf][_0xe42c('0x62')])){_0x1c7fbb[_0x2bfd63[_0x4858b4[_0x49eaaf]['questionId']]]=_0x4858b4[_0x49eaaf][_0xe42c('0x67')];}}for(var _0x4137ae in _0x2bfd63){if(!_0x1c7fbb[_0xe42c('0x52')](_0x2bfd63[_0x4137ae])){_0x1c7fbb[_0x2bfd63[_0x4137ae]]=null;}}_0x342cae[_0xe42c('0x68')](_0x1c7fbb);}return _0x342cae;}})[_0xe42c('0x1e')](function(_0x478ecc){if(!_[_0xe42c('0x69')](_0x478ecc)){var _0x201108=toCsv(_0x478ecc);var _0x5d7bd6=Date[_0xe42c('0x6a')]();fs[_0xe42c('0x6b')](util['format']('/tmp/Jscripty_Project_%d_Summary_%s.csv',_0x4b9b95[_0xe42c('0x4e')]['id'],_0x5d7bd6),_0x201108);_0x4473ac[_0xe42c('0x6c')]('Content-disposition',_0xe42c('0x6d')+util[_0xe42c('0x64')](_0xe42c('0x6e'),_0x4b9b95['params']['id'],_0x5d7bd6));_0x4473ac[_0xe42c('0x6c')](_0xe42c('0x6f'),'text/csv');return _0x4473ac['download'](util[_0xe42c('0x64')]('/tmp/Jscripty_Project_%d_Summary_%s.csv',_0x4b9b95['params']['id'],_0x5d7bd6));}else{return _0x4473ac['sendStatus'](0xcc);}})[_0xe42c('0x42')](handleError(_0x4473ac,null));};
\ No newline at end of file
diff --git a/server/api/jscriptyProject/jscriptyProject.model.js b/server/api/jscriptyProject/jscriptyProject.model.js
index a2be467..248eee0 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 _0x980f=['moment','request-promise','path','../../config/environment','./jscriptyProject.attributes','exports','define','JscriptyProject','jscripty_projects','lodash','util','../../config/logger','api'];(function(_0x39f00e,_0x25af8d){var _0x1f742a=function(_0x4aa030){while(--_0x4aa030){_0x39f00e['push'](_0x39f00e['shift']());}};_0x1f742a(++_0x25af8d);}(_0x980f,0xe6));var _0xf980=function(_0x15a99d,_0x4486ea){_0x15a99d=_0x15a99d-0x0;var _0x2cb908=_0x980f[_0x15a99d];return _0x2cb908;};'use strict';var _=require(_0xf980('0x0'));var util=require(_0xf980('0x1'));var logger=require(_0xf980('0x2'))(_0xf980('0x3'));var moment=require(_0xf980('0x4'));var BPromise=require('bluebird');var rp=require(_0xf980('0x5'));var fs=require('fs');var path=require(_0xf980('0x6'));var rimraf=require('rimraf');var config=require(_0xf980('0x7'));var attributes=require(_0xf980('0x8'));module[_0xf980('0x9')]=function(_0x2aa0a0,_0x35fdb7){return _0x2aa0a0[_0xf980('0xa')](_0xf980('0xb'),attributes,{'tableName':_0xf980('0xc'),'paranoid':![],'indexes':[],'timestamps':!![]});};
\ No newline at end of file
+var _0x9af9=['../../config/environment','./jscriptyProject.attributes','exports','define','jscripty_projects','lodash','api','bluebird','request-promise','path','rimraf'];(function(_0x122ef9,_0x451d2a){var _0x42fba0=function(_0x17c9d3){while(--_0x17c9d3){_0x122ef9['push'](_0x122ef9['shift']());}};_0x42fba0(++_0x451d2a);}(_0x9af9,0x73));var _0x99af=function(_0x1d2f50,_0x34752f){_0x1d2f50=_0x1d2f50-0x0;var _0x2e4651=_0x9af9[_0x1d2f50];return _0x2e4651;};'use strict';var _=require(_0x99af('0x0'));var util=require('util');var logger=require('../../config/logger')(_0x99af('0x1'));var moment=require('moment');var BPromise=require(_0x99af('0x2'));var rp=require(_0x99af('0x3'));var fs=require('fs');var path=require(_0x99af('0x4'));var rimraf=require(_0x99af('0x5'));var config=require(_0x99af('0x6'));var attributes=require(_0x99af('0x7'));module[_0x99af('0x8')]=function(_0x975145,_0x2c24d1){return _0x975145[_0x99af('0x9')]('JscriptyProject',attributes,{'tableName':_0x99af('0xa'),'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 ba6a606..85c940a 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 _0x2459=['then','info','JscriptyProject,\x20%s,\x20%s','request\x20sent','debug','JscriptyProject,\x20%s,\x20%s,\x20%s','stringify','error','message','result','catch','lodash','util','randomstring','ioredis','../../mysqldb','../../config/utils','rpc','../../config/environment','jayson/promise','client','request'];(function(_0x10e840,_0x5b3935){var _0x405caa=function(_0x46b707){while(--_0x46b707){_0x10e840['push'](_0x10e840['shift']());}};_0x405caa(++_0x5b3935);}(_0x2459,0xfd));var _0x9245=function(_0x4e1d3c,_0x4f9988){_0x4e1d3c=_0x4e1d3c-0x0;var _0x5177b2=_0x2459[_0x4e1d3c];return _0x5177b2;};'use strict';var _=require(_0x9245('0x0'));var util=require(_0x9245('0x1'));var moment=require('moment');var BPromise=require('bluebird');var rs=require(_0x9245('0x2'));var fs=require('fs');var Redis=require(_0x9245('0x3'));var db=require(_0x9245('0x4'))['db'];var utils=require(_0x9245('0x5'));var logger=require('../../config/logger')(_0x9245('0x6'));var config=require(_0x9245('0x7'));var jayson=require(_0x9245('0x8'));var client=jayson[_0x9245('0x9')]['http']({'port':0x232a});function respondWithRpcPromise(_0x42a2c1,_0x3c9fa0,_0x329e5a){return new BPromise(function(_0x473581,_0xaf9949){return client[_0x9245('0xa')](_0x42a2c1,_0x329e5a)[_0x9245('0xb')](function(_0x29d336){logger[_0x9245('0xc')](_0x9245('0xd'),_0x3c9fa0,_0x9245('0xe'));logger[_0x9245('0xf')](_0x9245('0x10'),_0x3c9fa0,_0x9245('0xe'),JSON[_0x9245('0x11')](_0x29d336));if(_0x29d336[_0x9245('0x12')]){if(_0x29d336[_0x9245('0x12')]['code']===0x1f4){logger[_0x9245('0x12')](_0x9245('0xd'),_0x3c9fa0,_0x29d336[_0x9245('0x12')][_0x9245('0x13')]);return _0xaf9949(_0x29d336[_0x9245('0x12')][_0x9245('0x13')]);}logger[_0x9245('0x12')]('JscriptyProject,\x20%s,\x20%s',_0x3c9fa0,_0x29d336[_0x9245('0x12')][_0x9245('0x13')]);return _0x473581(_0x29d336[_0x9245('0x12')][_0x9245('0x13')]);}else{logger[_0x9245('0xc')](_0x9245('0xd'),_0x3c9fa0,_0x9245('0xe'));_0x473581(_0x29d336[_0x9245('0x14')][_0x9245('0x13')]);}})[_0x9245('0x15')](function(_0x48e4e0){logger[_0x9245('0x12')](_0x9245('0xd'),_0x3c9fa0,_0x48e4e0);_0xaf9949(_0x48e4e0);});});}
\ No newline at end of file
+var _0x3bff=['JscriptyProject,\x20%s,\x20%s','debug','JscriptyProject,\x20%s,\x20%s,\x20%s','request\x20sent','stringify','error','code','message','result','catch','lodash','util','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','../../config/environment','client','http','request','then','info'];(function(_0x17702f,_0x570158){var _0x3afcb4=function(_0x1c1f97){while(--_0x1c1f97){_0x17702f['push'](_0x17702f['shift']());}};_0x3afcb4(++_0x570158);}(_0x3bff,0x19a));var _0xf3bf=function(_0x295317,_0x46aebf){_0x295317=_0x295317-0x0;var _0x458246=_0x3bff[_0x295317];return _0x458246;};'use strict';var _=require(_0xf3bf('0x0'));var util=require(_0xf3bf('0x1'));var moment=require(_0xf3bf('0x2'));var BPromise=require(_0xf3bf('0x3'));var rs=require(_0xf3bf('0x4'));var fs=require('fs');var Redis=require(_0xf3bf('0x5'));var db=require(_0xf3bf('0x6'))['db'];var utils=require(_0xf3bf('0x7'));var logger=require(_0xf3bf('0x8'))('rpc');var config=require(_0xf3bf('0x9'));var jayson=require('jayson/promise');var client=jayson[_0xf3bf('0xa')][_0xf3bf('0xb')]({'port':0x232a});function respondWithRpcPromise(_0x83a942,_0x2baaa2,_0x171957){return new BPromise(function(_0x4972d4,_0x4a8647){return client[_0xf3bf('0xc')](_0x83a942,_0x171957)[_0xf3bf('0xd')](function(_0x37ba6d){logger[_0xf3bf('0xe')](_0xf3bf('0xf'),_0x2baaa2,'request\x20sent');logger[_0xf3bf('0x10')](_0xf3bf('0x11'),_0x2baaa2,_0xf3bf('0x12'),JSON[_0xf3bf('0x13')](_0x37ba6d));if(_0x37ba6d[_0xf3bf('0x14')]){if(_0x37ba6d[_0xf3bf('0x14')][_0xf3bf('0x15')]===0x1f4){logger[_0xf3bf('0x14')](_0xf3bf('0xf'),_0x2baaa2,_0x37ba6d[_0xf3bf('0x14')][_0xf3bf('0x16')]);return _0x4a8647(_0x37ba6d[_0xf3bf('0x14')][_0xf3bf('0x16')]);}logger['error'](_0xf3bf('0xf'),_0x2baaa2,_0x37ba6d[_0xf3bf('0x14')][_0xf3bf('0x16')]);return _0x4972d4(_0x37ba6d[_0xf3bf('0x14')][_0xf3bf('0x16')]);}else{logger[_0xf3bf('0xe')](_0xf3bf('0xf'),_0x2baaa2,_0xf3bf('0x12'));_0x4972d4(_0x37ba6d[_0xf3bf('0x17')][_0xf3bf('0x16')]);}})[_0xf3bf('0x18')](function(_0x44b393){logger[_0xf3bf('0x14')](_0xf3bf('0xf'),_0x2baaa2,_0x44b393);_0x4a8647(_0x44b393);});});}
\ No newline at end of file
diff --git a/server/api/jscriptyQuestionReport/index.js b/server/api/jscriptyQuestionReport/index.js
index 45d9baa..07d42ef 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 _0xb9d4=['Router','../../components/auth/service','../../components/interaction/service','../../config/environment','./jscriptyQuestionReport.controller','get','index','isAuthenticated','describe','/:id','show','post','create','put','update','delete','exports','multer','util'];(function(_0x568a2e,_0x5909d0){var _0x2136e9=function(_0x4c02b6){while(--_0x4c02b6){_0x568a2e['push'](_0x568a2e['shift']());}};_0x2136e9(++_0x5909d0);}(_0xb9d4,0x83));var _0x4b9d=function(_0x4bbd94,_0x460fbd){_0x4bbd94=_0x4bbd94-0x0;var _0x48c85f=_0xb9d4[_0x4bbd94];return _0x48c85f;};'use strict';var multer=require(_0x4b9d('0x0'));var util=require(_0x4b9d('0x1'));var path=require('path');var timeout=require('connect-timeout');var express=require('express');var router=express[_0x4b9d('0x2')]();var auth=require(_0x4b9d('0x3'));var interaction=require(_0x4b9d('0x4'));var config=require(_0x4b9d('0x5'));var controller=require(_0x4b9d('0x6'));router[_0x4b9d('0x7')]('/',auth['isAuthenticated'](),controller[_0x4b9d('0x8')]);router[_0x4b9d('0x7')]('/describe',auth[_0x4b9d('0x9')](),controller[_0x4b9d('0xa')]);router['get'](_0x4b9d('0xb'),auth[_0x4b9d('0x9')](),controller[_0x4b9d('0xc')]);router[_0x4b9d('0xd')]('/',auth['isAuthenticated'](),controller[_0x4b9d('0xe')]);router[_0x4b9d('0xf')]('/:id',auth['isAuthenticated'](),controller[_0x4b9d('0x10')]);router[_0x4b9d('0x11')](_0x4b9d('0xb'),auth[_0x4b9d('0x9')](),controller['destroy']);module[_0x4b9d('0x12')]=router;
\ No newline at end of file
+var _0x2b45=['connect-timeout','express','../../components/auth/service','../../config/environment','./jscriptyQuestionReport.controller','get','isAuthenticated','index','describe','/:id','show','post','create','put','update','delete','destroy','exports','util','path'];(function(_0x3cecfd,_0x560e91){var _0x307e03=function(_0x3db6c0){while(--_0x3db6c0){_0x3cecfd['push'](_0x3cecfd['shift']());}};_0x307e03(++_0x560e91);}(_0x2b45,0x1de));var _0x52b4=function(_0x296e16,_0x15c306){_0x296e16=_0x296e16-0x0;var _0x4efff5=_0x2b45[_0x296e16];return _0x4efff5;};'use strict';var multer=require('multer');var util=require(_0x52b4('0x0'));var path=require(_0x52b4('0x1'));var timeout=require(_0x52b4('0x2'));var express=require(_0x52b4('0x3'));var router=express['Router']();var auth=require(_0x52b4('0x4'));var interaction=require('../../components/interaction/service');var config=require(_0x52b4('0x5'));var controller=require(_0x52b4('0x6'));router[_0x52b4('0x7')]('/',auth[_0x52b4('0x8')](),controller[_0x52b4('0x9')]);router['get']('/describe',auth[_0x52b4('0x8')](),controller[_0x52b4('0xa')]);router[_0x52b4('0x7')](_0x52b4('0xb'),auth['isAuthenticated'](),controller[_0x52b4('0xc')]);router[_0x52b4('0xd')]('/',auth['isAuthenticated'](),controller[_0x52b4('0xe')]);router[_0x52b4('0xf')]('/:id',auth[_0x52b4('0x8')](),controller[_0x52b4('0x10')]);router[_0x52b4('0x11')]('/:id',auth[_0x52b4('0x8')](),controller[_0x52b4('0x12')]);module[_0x52b4('0x13')]=router;
\ No newline at end of file
diff --git a/server/api/jscriptyQuestionReport/jscriptyQuestionReport.attributes.js b/server/api/jscriptyQuestionReport/jscriptyQuestionReport.attributes.js
index 2ec7dd0..69da919 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 _0xc5d4=['exports','TEXT','long','STRING','sequelize'];(function(_0x3028f0,_0x26f1fa){var _0x449902=function(_0x323457){while(--_0x323457){_0x3028f0['push'](_0x3028f0['shift']());}};_0x449902(++_0x26f1fa);}(_0xc5d4,0x1b2));var _0x4c5d=function(_0x1d8965,_0xda701e){_0x1d8965=_0x1d8965-0x0;var _0x4bed3f=_0xc5d4[_0x1d8965];return _0x4bed3f;};'use strict';var Sequelize=require(_0x4c5d('0x0'));module[_0x4c5d('0x1')]={'question':{'type':Sequelize['STRING']},'answer':{'type':Sequelize[_0x4c5d('0x2')](_0x4c5d('0x3'))},'membername':{'type':Sequelize[_0x4c5d('0x4')]},'projectname':{'type':Sequelize[_0x4c5d('0x4')]},'queue':{'type':Sequelize[_0x4c5d('0x4')]},'uniqueid':{'type':Sequelize[_0x4c5d('0x4')]},'calleridname':{'type':Sequelize[_0x4c5d('0x4')]},'calleridnum':{'type':Sequelize[_0x4c5d('0x4')]},'questionId':{'type':Sequelize[_0x4c5d('0x4')]}};
\ No newline at end of file
+var _0xaa62=['STRING','TEXT','sequelize'];(function(_0x911353,_0x1648ed){var _0x2f05fa=function(_0x4a00a4){while(--_0x4a00a4){_0x911353['push'](_0x911353['shift']());}};_0x2f05fa(++_0x1648ed);}(_0xaa62,0x16d));var _0x2aa6=function(_0x2e1a12,_0x16cf07){_0x2e1a12=_0x2e1a12-0x0;var _0x7f1afd=_0xaa62[_0x2e1a12];return _0x7f1afd;};'use strict';var Sequelize=require(_0x2aa6('0x0'));module['exports']={'question':{'type':Sequelize[_0x2aa6('0x1')]},'answer':{'type':Sequelize[_0x2aa6('0x2')]('long')},'membername':{'type':Sequelize['STRING']},'projectname':{'type':Sequelize[_0x2aa6('0x1')]},'queue':{'type':Sequelize[_0x2aa6('0x1')]},'uniqueid':{'type':Sequelize[_0x2aa6('0x1')]},'calleridname':{'type':Sequelize[_0x2aa6('0x1')]},'calleridnum':{'type':Sequelize[_0x2aa6('0x1')]},'questionId':{'type':Sequelize[_0x2aa6('0x1')]}};
\ No newline at end of file
diff --git a/server/api/jscriptyQuestionReport/jscriptyQuestionReport.controller.js b/server/api/jscriptyQuestionReport/jscriptyQuestionReport.controller.js
index bfe3c8d..25372ab 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 _0x99c2=['findAll','rows','catch','params','intersection','create','body','find','destroy','describe','html-pdf','zip-dir','bluebird','mustache','util','sox','ejs','lodash','squel','jsforce','desk.js','to-csv','querystring','papaparse','../../components/auth/service','../../components/parsers/qs','../../config/license/hardware','../../config/logger','api','../../config/environment','status','end','count','offset','limit','set','Content-Range','json','apply','reject','save','update','then','sendStatus','error','stack','name','index','rawAttributes','fieldName','type','key','model','map','query','keys','attributes','fields','length','nolimit','order','sort','filters','filter','where','VIRTUAL','merge','options','includeAll','include','JscriptyQuestionReport'];(function(_0x2ad987,_0x221c7a){var _0x5ea2cf=function(_0x39a157){while(--_0x39a157){_0x2ad987['push'](_0x2ad987['shift']());}};_0x5ea2cf(++_0x221c7a);}(_0x99c2,0xdf));var _0x299c=function(_0x47e7b4,_0x1dbdec){_0x47e7b4=_0x47e7b4-0x0;var _0x2d6c51=_0x99c2[_0x47e7b4];return _0x2d6c51;};'use strict';var pdf=require(_0x299c('0x0'));var emlformat=require('eml-format');var rimraf=require('rimraf');var zipdir=require(_0x299c('0x1'));var jsonpatch=require('fast-json-patch');var rp=require('request-promise');var moment=require('moment');var BPromise=require(_0x299c('0x2'));var Mustache=require(_0x299c('0x3'));var util=require(_0x299c('0x4'));var path=require('path');var sox=require(_0x299c('0x5'));var csv=require('to-csv');var ejs=require(_0x299c('0x6'));var fs=require('fs');var _=require(_0x299c('0x7'));var squel=require(_0x299c('0x8'));var crypto=require('crypto');var jsforce=require(_0x299c('0x9'));var deskjs=require(_0x299c('0xa'));var toCsv=require(_0x299c('0xb'));var querystring=require(_0x299c('0xc'));var Papa=require(_0x299c('0xd'));var Redis=require('ioredis');var authService=require(_0x299c('0xe'));var qs=require(_0x299c('0xf'));var as=require('../../components/parsers/advancedSearch');var hardwareService=require(_0x299c('0x10'));var logger=require(_0x299c('0x11'))(_0x299c('0x12'));var utils=require('../../config/utils');var config=require(_0x299c('0x13'));var db=require('../../mysqldb')['db'];function respondWithStatusCode(_0x482bbb,_0x25eb46){_0x25eb46=_0x25eb46||0xcc;return function(_0x510673){if(_0x510673){return _0x482bbb['sendStatus'](_0x25eb46);}return _0x482bbb[_0x299c('0x14')](_0x25eb46)[_0x299c('0x15')]();};}function respondWithResult(_0x4cc34b,_0x2b4182){_0x2b4182=_0x2b4182||0xc8;return function(_0x168cdd){if(_0x168cdd){return _0x4cc34b[_0x299c('0x14')](_0x2b4182)['json'](_0x168cdd);}};}function respondWithFilteredResult(_0x43cc3e,_0x11da15){return function(_0x53541e){if(_0x53541e){var _0x35c59d=_0x53541e[_0x299c('0x16')],_0x2d50f3=_0x11da15[_0x299c('0x17')],_0x13d4e9=_0x11da15[_0x299c('0x17')]+_0x11da15[_0x299c('0x18')],_0x4d3b56;if(_0x13d4e9>=_0x35c59d){_0x13d4e9=_0x35c59d;_0x4d3b56=0xc8;}else{_0x4d3b56=0xce;}_0x43cc3e[_0x299c('0x14')](_0x4d3b56);return _0x43cc3e[_0x299c('0x19')](_0x299c('0x1a'),_0x2d50f3+'-'+_0x13d4e9+'/'+_0x35c59d)[_0x299c('0x1b')](_0x53541e);}return null;};}function patchUpdates(_0x5535a2){return function(_0x45590d){try{jsonpatch[_0x299c('0x1c')](_0x45590d,_0x5535a2,!![]);}catch(_0x3ade14){return BPromise[_0x299c('0x1d')](_0x3ade14);}return _0x45590d[_0x299c('0x1e')]();};}function saveUpdates(_0x730376,_0x2b7921){return function(_0x410fd0){if(_0x410fd0){return _0x410fd0[_0x299c('0x1f')](_0x730376)[_0x299c('0x20')](function(_0x2f2446){return _0x2f2446;});}return null;};}function removeEntity(_0x7cbfc0,_0x509781){return function(_0x4acbb6){if(_0x4acbb6){return _0x4acbb6['destroy']()['then'](function(){_0x7cbfc0[_0x299c('0x14')](0xcc)[_0x299c('0x15')]();});}};}function handleEntityNotFound(_0x39692a,_0x5bd15e){return function(_0x17be1c){if(!_0x17be1c){_0x39692a[_0x299c('0x21')](0x194);}return _0x17be1c;};}function handleError(_0x499048,_0x34a8dc){_0x34a8dc=_0x34a8dc||0x1f4;return function(_0x52e647){logger[_0x299c('0x22')](_0x52e647[_0x299c('0x23')]);if(_0x52e647[_0x299c('0x24')]){delete _0x52e647[_0x299c('0x24')];}_0x499048[_0x299c('0x14')](_0x34a8dc)['send'](_0x52e647);};}exports[_0x299c('0x25')]=function(_0x9a9e5f,_0x413e56){var _0x36c555={},_0x503435={},_0xfe7c7a={'count':0x0,'rows':[]};var _0x5aadd7=_['map'](db['JscriptyQuestionReport'][_0x299c('0x26')],function(_0x24fc99){return{'name':_0x24fc99[_0x299c('0x27')],'type':_0x24fc99[_0x299c('0x28')][_0x299c('0x29')]};});_0x503435[_0x299c('0x2a')]=_[_0x299c('0x2b')](_0x5aadd7,'name');_0x503435[_0x299c('0x2c')]=_[_0x299c('0x2d')](_0x9a9e5f[_0x299c('0x2c')]);_0x503435['filters']=_['intersection'](_0x503435[_0x299c('0x2a')],_0x503435['query']);_0x36c555[_0x299c('0x2e')]=_['intersection'](_0x503435['model'],qs[_0x299c('0x2f')](_0x9a9e5f[_0x299c('0x2c')][_0x299c('0x2f')]));_0x36c555['attributes']=_0x36c555['attributes'][_0x299c('0x30')]?_0x36c555['attributes']:_0x503435[_0x299c('0x2a')];if(!_0x9a9e5f[_0x299c('0x2c')]['hasOwnProperty'](_0x299c('0x31'))){_0x36c555['limit']=qs[_0x299c('0x18')](_0x9a9e5f[_0x299c('0x2c')][_0x299c('0x18')]);_0x36c555[_0x299c('0x17')]=qs[_0x299c('0x17')](_0x9a9e5f[_0x299c('0x2c')]['offset']);}_0x36c555[_0x299c('0x32')]=qs[_0x299c('0x33')](_0x9a9e5f['query'][_0x299c('0x33')]);_0x36c555['where']=qs[_0x299c('0x34')](_['pick'](_0x9a9e5f[_0x299c('0x2c')],_0x503435[_0x299c('0x34')]));if(_0x9a9e5f[_0x299c('0x2c')][_0x299c('0x35')]){_0x36c555['where']=_['merge'](_0x36c555[_0x299c('0x36')],{'$or':_['map'](_0x5aadd7,function(_0x584c7b){if(_0x584c7b[_0x299c('0x28')]!==_0x299c('0x37')){var _0x33ce28={};_0x33ce28[_0x584c7b[_0x299c('0x24')]]={'$like':'%'+_0x9a9e5f['query']['filter']+'%'};return _0x33ce28;}})});}_0x36c555=_[_0x299c('0x38')]({},_0x36c555,_0x9a9e5f[_0x299c('0x39')]);var _0x3ceee3={'where':_0x36c555[_0x299c('0x36')]};return db['JscriptyQuestionReport'][_0x299c('0x16')](_0x3ceee3)['then'](function(_0x4722bc){_0xfe7c7a[_0x299c('0x16')]=_0x4722bc;if(_0x9a9e5f['query'][_0x299c('0x3a')]){_0x36c555[_0x299c('0x3b')]=[{'all':!![]}];}return db[_0x299c('0x3c')][_0x299c('0x3d')](_0x36c555);})[_0x299c('0x20')](function(_0x438194){_0xfe7c7a[_0x299c('0x3e')]=_0x438194;return _0xfe7c7a;})[_0x299c('0x20')](respondWithFilteredResult(_0x413e56,_0x36c555))[_0x299c('0x3f')](handleError(_0x413e56,null));};exports['show']=function(_0x226edc,_0xd23484){var _0x132a5={'raw':!![],'where':{'id':_0x226edc[_0x299c('0x40')]['id']}},_0xd23c33={};_0xd23c33['model']=_[_0x299c('0x2d')](db[_0x299c('0x3c')]['rawAttributes']);_0xd23c33[_0x299c('0x2c')]=_[_0x299c('0x2d')](_0x226edc['query']);_0xd23c33[_0x299c('0x34')]=_[_0x299c('0x41')](_0xd23c33[_0x299c('0x2a')],_0xd23c33[_0x299c('0x2c')]);_0x132a5[_0x299c('0x2e')]=_[_0x299c('0x41')](_0xd23c33[_0x299c('0x2a')],qs[_0x299c('0x2f')](_0x226edc[_0x299c('0x2c')]['fields']));_0x132a5[_0x299c('0x2e')]=_0x132a5[_0x299c('0x2e')][_0x299c('0x30')]?_0x132a5[_0x299c('0x2e')]:_0xd23c33[_0x299c('0x2a')];if(_0x226edc[_0x299c('0x2c')][_0x299c('0x3a')]){_0x132a5['include']=[{'all':!![]}];}_0x132a5=_[_0x299c('0x38')]({},_0x132a5,_0x226edc[_0x299c('0x39')]);return db[_0x299c('0x3c')]['find'](_0x132a5)[_0x299c('0x20')](handleEntityNotFound(_0xd23484,null))[_0x299c('0x20')](respondWithResult(_0xd23484,null))[_0x299c('0x3f')](handleError(_0xd23484,null));};exports[_0x299c('0x42')]=function(_0x372dc1,_0x15ea69){return db[_0x299c('0x3c')][_0x299c('0x42')](_0x372dc1[_0x299c('0x43')],{})[_0x299c('0x20')](respondWithResult(_0x15ea69,0xc9))[_0x299c('0x3f')](handleError(_0x15ea69,null));};exports[_0x299c('0x1f')]=function(_0x4a9b97,_0x2a6a29){if(_0x4a9b97[_0x299c('0x43')]['id']){delete _0x4a9b97[_0x299c('0x43')]['id'];}return db['JscriptyQuestionReport'][_0x299c('0x44')]({'where':{'id':_0x4a9b97[_0x299c('0x40')]['id']}})['then'](handleEntityNotFound(_0x2a6a29,null))[_0x299c('0x20')](saveUpdates(_0x4a9b97[_0x299c('0x43')],null))[_0x299c('0x20')](respondWithResult(_0x2a6a29,null))[_0x299c('0x3f')](handleError(_0x2a6a29,null));};exports[_0x299c('0x45')]=function(_0xe1bf70,_0x1fe1e1){return db['JscriptyQuestionReport'][_0x299c('0x44')]({'where':{'id':_0xe1bf70[_0x299c('0x40')]['id']}})[_0x299c('0x20')](handleEntityNotFound(_0x1fe1e1,null))[_0x299c('0x20')](removeEntity(_0x1fe1e1,null))['catch'](handleError(_0x1fe1e1,null));};exports[_0x299c('0x46')]=function(_0x4e3a4b,_0x488c52){return db[_0x299c('0x3c')]['describe']()[_0x299c('0x20')](respondWithResult(_0x488c52,null))[_0x299c('0x3f')](handleError(_0x488c52,null));};
\ No newline at end of file
+var _0xc3b5=['end','error','name','index','map','JscriptyQuestionReport','rawAttributes','fieldName','type','key','model','query','keys','filters','attributes','intersection','fields','length','nolimit','order','sort','pick','where','merge','VIRTUAL','options','count','includeAll','findAll','catch','show','params','include','find','create','body','describe','html-pdf','eml-format','zip-dir','fast-json-patch','moment','bluebird','mustache','util','path','sox','to-csv','ejs','squel','crypto','desk.js','querystring','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/environment','../../mysqldb','sendStatus','status','offset','limit','set','Content-Range','json','apply','reject','update','destroy','then'];(function(_0x3f5ec9,_0x2ed473){var _0x503ca4=function(_0x16a834){while(--_0x16a834){_0x3f5ec9['push'](_0x3f5ec9['shift']());}};_0x503ca4(++_0x2ed473);}(_0xc3b5,0x103));var _0x5c3b=function(_0x44a735,_0x19f829){_0x44a735=_0x44a735-0x0;var _0x3386e8=_0xc3b5[_0x44a735];return _0x3386e8;};'use strict';var pdf=require(_0x5c3b('0x0'));var emlformat=require(_0x5c3b('0x1'));var rimraf=require('rimraf');var zipdir=require(_0x5c3b('0x2'));var jsonpatch=require(_0x5c3b('0x3'));var rp=require('request-promise');var moment=require(_0x5c3b('0x4'));var BPromise=require(_0x5c3b('0x5'));var Mustache=require(_0x5c3b('0x6'));var util=require(_0x5c3b('0x7'));var path=require(_0x5c3b('0x8'));var sox=require(_0x5c3b('0x9'));var csv=require(_0x5c3b('0xa'));var ejs=require(_0x5c3b('0xb'));var fs=require('fs');var _=require('lodash');var squel=require(_0x5c3b('0xc'));var crypto=require(_0x5c3b('0xd'));var jsforce=require('jsforce');var deskjs=require(_0x5c3b('0xe'));var toCsv=require(_0x5c3b('0xa'));var querystring=require(_0x5c3b('0xf'));var Papa=require('papaparse');var Redis=require(_0x5c3b('0x10'));var authService=require(_0x5c3b('0x11'));var qs=require(_0x5c3b('0x12'));var as=require(_0x5c3b('0x13'));var hardwareService=require(_0x5c3b('0x14'));var logger=require(_0x5c3b('0x15'))(_0x5c3b('0x16'));var utils=require('../../config/utils');var config=require(_0x5c3b('0x17'));var db=require(_0x5c3b('0x18'))['db'];function respondWithStatusCode(_0x3194f5,_0x44fdd8){_0x44fdd8=_0x44fdd8||0xcc;return function(_0x3ec6ef){if(_0x3ec6ef){return _0x3194f5[_0x5c3b('0x19')](_0x44fdd8);}return _0x3194f5['status'](_0x44fdd8)['end']();};}function respondWithResult(_0x1120c0,_0x497ae9){_0x497ae9=_0x497ae9||0xc8;return function(_0x3a4d3a){if(_0x3a4d3a){return _0x1120c0[_0x5c3b('0x1a')](_0x497ae9)['json'](_0x3a4d3a);}};}function respondWithFilteredResult(_0xf01881,_0x3099df){return function(_0x118145){if(_0x118145){var _0x2ba056=_0x118145['count'],_0x5ade6f=_0x3099df[_0x5c3b('0x1b')],_0x29cc70=_0x3099df['offset']+_0x3099df[_0x5c3b('0x1c')],_0x2923cb;if(_0x29cc70>=_0x2ba056){_0x29cc70=_0x2ba056;_0x2923cb=0xc8;}else{_0x2923cb=0xce;}_0xf01881[_0x5c3b('0x1a')](_0x2923cb);return _0xf01881[_0x5c3b('0x1d')](_0x5c3b('0x1e'),_0x5ade6f+'-'+_0x29cc70+'/'+_0x2ba056)[_0x5c3b('0x1f')](_0x118145);}return null;};}function patchUpdates(_0x1808f0){return function(_0x9e367c){try{jsonpatch[_0x5c3b('0x20')](_0x9e367c,_0x1808f0,!![]);}catch(_0x43b524){return BPromise[_0x5c3b('0x21')](_0x43b524);}return _0x9e367c['save']();};}function saveUpdates(_0x1ecbe7,_0x1d0a4e){return function(_0x40b8c1){if(_0x40b8c1){return _0x40b8c1[_0x5c3b('0x22')](_0x1ecbe7)['then'](function(_0x1f1577){return _0x1f1577;});}return null;};}function removeEntity(_0xf2e63f,_0x507c04){return function(_0x2ed97f){if(_0x2ed97f){return _0x2ed97f[_0x5c3b('0x23')]()[_0x5c3b('0x24')](function(){_0xf2e63f[_0x5c3b('0x1a')](0xcc)[_0x5c3b('0x25')]();});}};}function handleEntityNotFound(_0x4dd6eb,_0x45f8dd){return function(_0x324f11){if(!_0x324f11){_0x4dd6eb[_0x5c3b('0x19')](0x194);}return _0x324f11;};}function handleError(_0x15e007,_0x25c46d){_0x25c46d=_0x25c46d||0x1f4;return function(_0x5d38d7){logger[_0x5c3b('0x26')](_0x5d38d7['stack']);if(_0x5d38d7['name']){delete _0x5d38d7[_0x5c3b('0x27')];}_0x15e007[_0x5c3b('0x1a')](_0x25c46d)['send'](_0x5d38d7);};}exports[_0x5c3b('0x28')]=function(_0x4be1f9,_0x5437a0){var _0x46190d={},_0x57a2a8={},_0x2d34f0={'count':0x0,'rows':[]};var _0x29ee42=_[_0x5c3b('0x29')](db[_0x5c3b('0x2a')][_0x5c3b('0x2b')],function(_0xbda673){return{'name':_0xbda673[_0x5c3b('0x2c')],'type':_0xbda673[_0x5c3b('0x2d')][_0x5c3b('0x2e')]};});_0x57a2a8[_0x5c3b('0x2f')]=_[_0x5c3b('0x29')](_0x29ee42,_0x5c3b('0x27'));_0x57a2a8[_0x5c3b('0x30')]=_[_0x5c3b('0x31')](_0x4be1f9[_0x5c3b('0x30')]);_0x57a2a8[_0x5c3b('0x32')]=_['intersection'](_0x57a2a8['model'],_0x57a2a8[_0x5c3b('0x30')]);_0x46190d[_0x5c3b('0x33')]=_[_0x5c3b('0x34')](_0x57a2a8['model'],qs[_0x5c3b('0x35')](_0x4be1f9['query'][_0x5c3b('0x35')]));_0x46190d[_0x5c3b('0x33')]=_0x46190d[_0x5c3b('0x33')][_0x5c3b('0x36')]?_0x46190d[_0x5c3b('0x33')]:_0x57a2a8['model'];if(!_0x4be1f9[_0x5c3b('0x30')]['hasOwnProperty'](_0x5c3b('0x37'))){_0x46190d['limit']=qs[_0x5c3b('0x1c')](_0x4be1f9[_0x5c3b('0x30')][_0x5c3b('0x1c')]);_0x46190d[_0x5c3b('0x1b')]=qs[_0x5c3b('0x1b')](_0x4be1f9['query'][_0x5c3b('0x1b')]);}_0x46190d[_0x5c3b('0x38')]=qs[_0x5c3b('0x39')](_0x4be1f9[_0x5c3b('0x30')]['sort']);_0x46190d['where']=qs[_0x5c3b('0x32')](_[_0x5c3b('0x3a')](_0x4be1f9['query'],_0x57a2a8['filters']));if(_0x4be1f9[_0x5c3b('0x30')]['filter']){_0x46190d[_0x5c3b('0x3b')]=_[_0x5c3b('0x3c')](_0x46190d[_0x5c3b('0x3b')],{'$or':_[_0x5c3b('0x29')](_0x29ee42,function(_0x251a5f){if(_0x251a5f[_0x5c3b('0x2d')]!==_0x5c3b('0x3d')){var _0x1fe320={};_0x1fe320[_0x251a5f[_0x5c3b('0x27')]]={'$like':'%'+_0x4be1f9[_0x5c3b('0x30')]['filter']+'%'};return _0x1fe320;}})});}_0x46190d=_[_0x5c3b('0x3c')]({},_0x46190d,_0x4be1f9[_0x5c3b('0x3e')]);var _0x111564={'where':_0x46190d[_0x5c3b('0x3b')]};return db['JscriptyQuestionReport'][_0x5c3b('0x3f')](_0x111564)[_0x5c3b('0x24')](function(_0x39aed5){_0x2d34f0[_0x5c3b('0x3f')]=_0x39aed5;if(_0x4be1f9['query'][_0x5c3b('0x40')]){_0x46190d['include']=[{'all':!![]}];}return db[_0x5c3b('0x2a')][_0x5c3b('0x41')](_0x46190d);})[_0x5c3b('0x24')](function(_0x309397){_0x2d34f0['rows']=_0x309397;return _0x2d34f0;})[_0x5c3b('0x24')](respondWithFilteredResult(_0x5437a0,_0x46190d))[_0x5c3b('0x42')](handleError(_0x5437a0,null));};exports[_0x5c3b('0x43')]=function(_0x406ca2,_0x4218ed){var _0x1f659c={'raw':!![],'where':{'id':_0x406ca2[_0x5c3b('0x44')]['id']}},_0x2e4cc1={};_0x2e4cc1[_0x5c3b('0x2f')]=_[_0x5c3b('0x31')](db[_0x5c3b('0x2a')]['rawAttributes']);_0x2e4cc1['query']=_[_0x5c3b('0x31')](_0x406ca2['query']);_0x2e4cc1[_0x5c3b('0x32')]=_[_0x5c3b('0x34')](_0x2e4cc1[_0x5c3b('0x2f')],_0x2e4cc1[_0x5c3b('0x30')]);_0x1f659c[_0x5c3b('0x33')]=_[_0x5c3b('0x34')](_0x2e4cc1[_0x5c3b('0x2f')],qs[_0x5c3b('0x35')](_0x406ca2[_0x5c3b('0x30')][_0x5c3b('0x35')]));_0x1f659c[_0x5c3b('0x33')]=_0x1f659c[_0x5c3b('0x33')][_0x5c3b('0x36')]?_0x1f659c[_0x5c3b('0x33')]:_0x2e4cc1[_0x5c3b('0x2f')];if(_0x406ca2[_0x5c3b('0x30')][_0x5c3b('0x40')]){_0x1f659c[_0x5c3b('0x45')]=[{'all':!![]}];}_0x1f659c=_[_0x5c3b('0x3c')]({},_0x1f659c,_0x406ca2[_0x5c3b('0x3e')]);return db['JscriptyQuestionReport'][_0x5c3b('0x46')](_0x1f659c)[_0x5c3b('0x24')](handleEntityNotFound(_0x4218ed,null))[_0x5c3b('0x24')](respondWithResult(_0x4218ed,null))[_0x5c3b('0x42')](handleError(_0x4218ed,null));};exports[_0x5c3b('0x47')]=function(_0x44faf9,_0x77977f){return db[_0x5c3b('0x2a')][_0x5c3b('0x47')](_0x44faf9[_0x5c3b('0x48')],{})[_0x5c3b('0x24')](respondWithResult(_0x77977f,0xc9))[_0x5c3b('0x42')](handleError(_0x77977f,null));};exports[_0x5c3b('0x22')]=function(_0x44014c,_0x2bba17){if(_0x44014c[_0x5c3b('0x48')]['id']){delete _0x44014c[_0x5c3b('0x48')]['id'];}return db[_0x5c3b('0x2a')]['find']({'where':{'id':_0x44014c[_0x5c3b('0x44')]['id']}})[_0x5c3b('0x24')](handleEntityNotFound(_0x2bba17,null))[_0x5c3b('0x24')](saveUpdates(_0x44014c['body'],null))[_0x5c3b('0x24')](respondWithResult(_0x2bba17,null))[_0x5c3b('0x42')](handleError(_0x2bba17,null));};exports['destroy']=function(_0x2b7920,_0x2db907){return db['JscriptyQuestionReport'][_0x5c3b('0x46')]({'where':{'id':_0x2b7920[_0x5c3b('0x44')]['id']}})[_0x5c3b('0x24')](handleEntityNotFound(_0x2db907,null))[_0x5c3b('0x24')](removeEntity(_0x2db907,null))[_0x5c3b('0x42')](handleError(_0x2db907,null));};exports[_0x5c3b('0x49')]=function(_0x38c739,_0x3d583d){return db[_0x5c3b('0x2a')][_0x5c3b('0x49')]()[_0x5c3b('0x24')](respondWithResult(_0x3d583d,null))['catch'](handleError(_0x3d583d,null));};
\ No newline at end of file
diff --git a/server/api/jscriptyQuestionReport/jscriptyQuestionReport.model.js b/server/api/jscriptyQuestionReport/jscriptyQuestionReport.model.js
index 36b8f4a..ff0b5db 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 _0xf762=['lodash','util','../../config/logger','api','moment','bluebird','request-promise','path','rimraf','../../config/environment','define','JscriptyQuestionReport'];(function(_0x4dcc2d,_0x422839){var _0x1bbd79=function(_0x173341){while(--_0x173341){_0x4dcc2d['push'](_0x4dcc2d['shift']());}};_0x1bbd79(++_0x422839);}(_0xf762,0xd8));var _0x2f76=function(_0x220ce1,_0x1cb63b){_0x220ce1=_0x220ce1-0x0;var _0x30d935=_0xf762[_0x220ce1];return _0x30d935;};'use strict';var _=require(_0x2f76('0x0'));var util=require(_0x2f76('0x1'));var logger=require(_0x2f76('0x2'))(_0x2f76('0x3'));var moment=require(_0x2f76('0x4'));var BPromise=require(_0x2f76('0x5'));var rp=require(_0x2f76('0x6'));var fs=require('fs');var path=require(_0x2f76('0x7'));var rimraf=require(_0x2f76('0x8'));var config=require(_0x2f76('0x9'));var attributes=require('./jscriptyQuestionReport.attributes');module['exports']=function(_0x30758e,_0x5c7d07){return _0x30758e[_0x2f76('0xa')](_0x2f76('0xb'),attributes,{'tableName':'report_jscripty_questions','paranoid':![],'indexes':[],'timestamps':!![]});};
\ No newline at end of file
+var _0x0300=['api','moment','request-promise','path','../../config/environment','exports','JscriptyQuestionReport','report_jscripty_questions','lodash'];(function(_0x56e0e8,_0x16ef91){var _0x2dab50=function(_0x4fe720){while(--_0x4fe720){_0x56e0e8['push'](_0x56e0e8['shift']());}};_0x2dab50(++_0x16ef91);}(_0x0300,0xbc));var _0x0030=function(_0x1fb8d3,_0x4e6853){_0x1fb8d3=_0x1fb8d3-0x0;var _0x2e8009=_0x0300[_0x1fb8d3];return _0x2e8009;};'use strict';var _=require(_0x0030('0x0'));var util=require('util');var logger=require('../../config/logger')(_0x0030('0x1'));var moment=require(_0x0030('0x2'));var BPromise=require('bluebird');var rp=require(_0x0030('0x3'));var fs=require('fs');var path=require(_0x0030('0x4'));var rimraf=require('rimraf');var config=require(_0x0030('0x5'));var attributes=require('./jscriptyQuestionReport.attributes');module[_0x0030('0x6')]=function(_0x5137ea,_0x40facc){return _0x5137ea['define'](_0x0030('0x7'),attributes,{'tableName':_0x0030('0x8'),'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 629f512..5c8d6ab 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 _0xea4e=['JscriptyQuestionReport,\x20%s,\x20%s','request\x20sent','JscriptyQuestionReport,\x20%s,\x20%s,\x20%s','stringify','error','code','message','result','catch','lodash','util','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','../../config/environment','jayson/promise','client','http','request','then','info'];(function(_0xd94b6b,_0x3d0bb2){var _0x54aa20=function(_0x38d580){while(--_0x38d580){_0xd94b6b['push'](_0xd94b6b['shift']());}};_0x54aa20(++_0x3d0bb2);}(_0xea4e,0x69));var _0xeea4=function(_0x23b655,_0x4feb2b){_0x23b655=_0x23b655-0x0;var _0x364b32=_0xea4e[_0x23b655];return _0x364b32;};'use strict';var _=require(_0xeea4('0x0'));var util=require(_0xeea4('0x1'));var moment=require('moment');var BPromise=require(_0xeea4('0x2'));var rs=require(_0xeea4('0x3'));var fs=require('fs');var Redis=require(_0xeea4('0x4'));var db=require(_0xeea4('0x5'))['db'];var utils=require(_0xeea4('0x6'));var logger=require(_0xeea4('0x7'))('rpc');var config=require(_0xeea4('0x8'));var jayson=require(_0xeea4('0x9'));var client=jayson[_0xeea4('0xa')][_0xeea4('0xb')]({'port':0x232a});function respondWithRpcPromise(_0x12dc94,_0x4a301d,_0x565fff){return new BPromise(function(_0x477456,_0x4248c4){return client[_0xeea4('0xc')](_0x12dc94,_0x565fff)[_0xeea4('0xd')](function(_0x268456){logger[_0xeea4('0xe')](_0xeea4('0xf'),_0x4a301d,_0xeea4('0x10'));logger['debug'](_0xeea4('0x11'),_0x4a301d,_0xeea4('0x10'),JSON[_0xeea4('0x12')](_0x268456));if(_0x268456['error']){if(_0x268456[_0xeea4('0x13')][_0xeea4('0x14')]===0x1f4){logger[_0xeea4('0x13')]('JscriptyQuestionReport,\x20%s,\x20%s',_0x4a301d,_0x268456['error'][_0xeea4('0x15')]);return _0x4248c4(_0x268456[_0xeea4('0x13')][_0xeea4('0x15')]);}logger[_0xeea4('0x13')](_0xeea4('0xf'),_0x4a301d,_0x268456[_0xeea4('0x13')][_0xeea4('0x15')]);return _0x477456(_0x268456['error'][_0xeea4('0x15')]);}else{logger[_0xeea4('0xe')](_0xeea4('0xf'),_0x4a301d,_0xeea4('0x10'));_0x477456(_0x268456[_0xeea4('0x16')][_0xeea4('0x15')]);}})[_0xeea4('0x17')](function(_0x7111da){logger['error'](_0xeea4('0xf'),_0x4a301d,_0x7111da);_0x4248c4(_0x7111da);});});}
\ No newline at end of file
+var _0x6c99=['lodash','util','bluebird','randomstring','ioredis','../../mysqldb','../../config/environment','jayson/promise','client','http','info','JscriptyQuestionReport,\x20%s,\x20%s','request\x20sent','debug','JscriptyQuestionReport,\x20%s,\x20%s,\x20%s','stringify','error','code','message'];(function(_0x57293e,_0x331fdb){var _0x11be6f=function(_0x314906){while(--_0x314906){_0x57293e['push'](_0x57293e['shift']());}};_0x11be6f(++_0x331fdb);}(_0x6c99,0x1b5));var _0x96c9=function(_0x27604f,_0x5ae336){_0x27604f=_0x27604f-0x0;var _0x40d189=_0x6c99[_0x27604f];return _0x40d189;};'use strict';var _=require(_0x96c9('0x0'));var util=require(_0x96c9('0x1'));var moment=require('moment');var BPromise=require(_0x96c9('0x2'));var rs=require(_0x96c9('0x3'));var fs=require('fs');var Redis=require(_0x96c9('0x4'));var db=require(_0x96c9('0x5'))['db'];var utils=require('../../config/utils');var logger=require('../../config/logger')('rpc');var config=require(_0x96c9('0x6'));var jayson=require(_0x96c9('0x7'));var client=jayson[_0x96c9('0x8')][_0x96c9('0x9')]({'port':0x232a});function respondWithRpcPromise(_0xfbef7a,_0x5d7745,_0x279bf0){return new BPromise(function(_0x34ae62,_0x469eea){return client['request'](_0xfbef7a,_0x279bf0)['then'](function(_0x18bcfb){logger[_0x96c9('0xa')](_0x96c9('0xb'),_0x5d7745,_0x96c9('0xc'));logger[_0x96c9('0xd')](_0x96c9('0xe'),_0x5d7745,_0x96c9('0xc'),JSON[_0x96c9('0xf')](_0x18bcfb));if(_0x18bcfb[_0x96c9('0x10')]){if(_0x18bcfb[_0x96c9('0x10')][_0x96c9('0x11')]===0x1f4){logger['error'](_0x96c9('0xb'),_0x5d7745,_0x18bcfb[_0x96c9('0x10')][_0x96c9('0x12')]);return _0x469eea(_0x18bcfb['error']['message']);}logger[_0x96c9('0x10')](_0x96c9('0xb'),_0x5d7745,_0x18bcfb[_0x96c9('0x10')]['message']);return _0x34ae62(_0x18bcfb[_0x96c9('0x10')]['message']);}else{logger[_0x96c9('0xa')](_0x96c9('0xb'),_0x5d7745,_0x96c9('0xc'));_0x34ae62(_0x18bcfb['result'][_0x96c9('0x12')]);}})['catch'](function(_0x36a69d){logger['error']('JscriptyQuestionReport,\x20%s,\x20%s',_0x5d7745,_0x36a69d);_0x469eea(_0x36a69d);});});}
\ No newline at end of file
diff --git a/server/api/jscriptySessionReport/index.js b/server/api/jscriptySessionReport/index.js
index 9b58d8f..77060ed 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 _0x7c8e=['post','create','put','delete','destroy','exports','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'];(function(_0x229f85,_0x57b6e6){var _0x425c85=function(_0x58b38e){while(--_0x58b38e){_0x229f85['push'](_0x229f85['shift']());}};_0x425c85(++_0x57b6e6);}(_0x7c8e,0x10e));var _0xe7c8=function(_0x3601f2,_0x34af7a){_0x3601f2=_0x3601f2-0x0;var _0xb360a3=_0x7c8e[_0x3601f2];return _0xb360a3;};'use strict';var multer=require('multer');var util=require(_0xe7c8('0x0'));var path=require(_0xe7c8('0x1'));var timeout=require(_0xe7c8('0x2'));var express=require(_0xe7c8('0x3'));var router=express[_0xe7c8('0x4')]();var auth=require(_0xe7c8('0x5'));var interaction=require(_0xe7c8('0x6'));var config=require(_0xe7c8('0x7'));var controller=require(_0xe7c8('0x8'));router[_0xe7c8('0x9')]('/',auth[_0xe7c8('0xa')](),controller[_0xe7c8('0xb')]);router[_0xe7c8('0x9')](_0xe7c8('0xc'),auth[_0xe7c8('0xa')](),controller[_0xe7c8('0xd')]);router[_0xe7c8('0x9')](_0xe7c8('0xe'),auth['isAuthenticated'](),controller[_0xe7c8('0xf')]);router[_0xe7c8('0x9')](_0xe7c8('0x10'),auth['isAuthenticated'](),controller[_0xe7c8('0x11')]);router[_0xe7c8('0x12')]('/',auth[_0xe7c8('0xa')](),controller[_0xe7c8('0x13')]);router[_0xe7c8('0x14')](_0xe7c8('0xe'),auth['isAuthenticated'](),controller['update']);router[_0xe7c8('0x15')](_0xe7c8('0xe'),auth[_0xe7c8('0xa')](),controller[_0xe7c8('0x16')]);module[_0xe7c8('0x17')]=router;
\ No newline at end of file
+var _0x9221=['post','put','delete','/:id','util','path','express','Router','../../components/interaction/service','../../config/environment','./jscriptySessionReport.controller','get','isAuthenticated','index','describe','/:id/questions'];(function(_0x2080a3,_0x48acfa){var _0x8d7d17=function(_0x2dbc06){while(--_0x2dbc06){_0x2080a3['push'](_0x2080a3['shift']());}};_0x8d7d17(++_0x48acfa);}(_0x9221,0x64));var _0x1922=function(_0x401b3e,_0xed8de5){_0x401b3e=_0x401b3e-0x0;var _0x4f290f=_0x9221[_0x401b3e];return _0x4f290f;};'use strict';var multer=require('multer');var util=require(_0x1922('0x0'));var path=require(_0x1922('0x1'));var timeout=require('connect-timeout');var express=require(_0x1922('0x2'));var router=express[_0x1922('0x3')]();var auth=require('../../components/auth/service');var interaction=require(_0x1922('0x4'));var config=require(_0x1922('0x5'));var controller=require(_0x1922('0x6'));router[_0x1922('0x7')]('/',auth[_0x1922('0x8')](),controller[_0x1922('0x9')]);router[_0x1922('0x7')]('/describe',auth[_0x1922('0x8')](),controller[_0x1922('0xa')]);router[_0x1922('0x7')]('/:id',auth[_0x1922('0x8')](),controller['show']);router[_0x1922('0x7')](_0x1922('0xb'),auth[_0x1922('0x8')](),controller['getQuestions']);router[_0x1922('0xc')]('/',auth[_0x1922('0x8')](),controller['create']);router[_0x1922('0xd')]('/:id',auth[_0x1922('0x8')](),controller['update']);router[_0x1922('0xe')](_0x1922('0xf'),auth[_0x1922('0x8')](),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 8c10154..947ded4 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 _0x7f73=['setDataValue','starttime','endtime','format','YYYY-MM-DD\x20HH:mm:ss','STRING','BOOLEAN','sequelize','exports','DATE'];(function(_0x27af45,_0x1b57aa){var _0x18df21=function(_0x4b7679){while(--_0x4b7679){_0x27af45['push'](_0x27af45['shift']());}};_0x18df21(++_0x1b57aa);}(_0x7f73,0xbb));var _0x37f7=function(_0x381c8a,_0x5eead6){_0x381c8a=_0x381c8a-0x0;var _0x25a5e0=_0x7f73[_0x381c8a];return _0x25a5e0;};'use strict';var moment=require('moment');var Sequelize=require(_0x37f7('0x0'));module[_0x37f7('0x1')]={'starttime':{'type':Sequelize[_0x37f7('0x2')],'set':function(_0x1cd945){this[_0x37f7('0x3')](_0x37f7('0x4'),_0x1cd945);this[_0x37f7('0x3')](_0x37f7('0x5'),moment()[_0x37f7('0x6')](_0x37f7('0x7')));}},'endtime':{'type':Sequelize[_0x37f7('0x2')]},'membername':{'type':Sequelize[_0x37f7('0x8')]},'projectname':{'type':Sequelize['STRING']},'queue':{'type':Sequelize['STRING']},'uniqueid':{'type':Sequelize[_0x37f7('0x8')]},'calleridname':{'type':Sequelize[_0x37f7('0x8')]},'calleridnum':{'type':Sequelize[_0x37f7('0x8')]},'completed':{'type':Sequelize[_0x37f7('0x9')],'defaultValue':![]}};
\ No newline at end of file
+var _0x0a38=['YYYY-MM-DD\x20HH:mm:ss','STRING','BOOLEAN','moment','sequelize','exports','setDataValue','starttime'];(function(_0x18cd5b,_0x10240b){var _0x5eaa52=function(_0x2bccad){while(--_0x2bccad){_0x18cd5b['push'](_0x18cd5b['shift']());}};_0x5eaa52(++_0x10240b);}(_0x0a38,0x10b));var _0x80a3=function(_0x182475,_0x59cc18){_0x182475=_0x182475-0x0;var _0x1a2ef6=_0x0a38[_0x182475];return _0x1a2ef6;};'use strict';var moment=require(_0x80a3('0x0'));var Sequelize=require(_0x80a3('0x1'));module[_0x80a3('0x2')]={'starttime':{'type':Sequelize['DATE'],'set':function(_0x22a6a8){this[_0x80a3('0x3')](_0x80a3('0x4'),_0x22a6a8);this[_0x80a3('0x3')]('endtime',moment()['format'](_0x80a3('0x5')));}},'endtime':{'type':Sequelize['DATE']},'membername':{'type':Sequelize[_0x80a3('0x6')]},'projectname':{'type':Sequelize[_0x80a3('0x6')]},'queue':{'type':Sequelize[_0x80a3('0x6')]},'uniqueid':{'type':Sequelize[_0x80a3('0x6')]},'calleridname':{'type':Sequelize[_0x80a3('0x6')]},'calleridnum':{'type':Sequelize['STRING']},'completed':{'type':Sequelize[_0x80a3('0x7')],'defaultValue':![]}};
\ No newline at end of file
diff --git a/server/api/jscriptySessionReport/jscriptySessionReport.controller.js b/server/api/jscriptySessionReport/jscriptySessionReport.controller.js
index 8cc946c..a0a9f07 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 _0xb970=['model','query','keys','filters','attributes','fields','hasOwnProperty','nolimit','order','sort','where','filter','VIRTUAL','merge','options','count','includeAll','include','findAll','rows','catch','show','intersection','length','create','body','find','params','describe','getQuestions','findOne','JscriptyQuestionReport','pick','html-pdf','rimraf','zip-dir','fast-json-patch','request-promise','moment','bluebird','mustache','util','to-csv','ejs','squel','jsforce','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../config/license/hardware','../../config/logger','api','../../config/environment','../../mysqldb','sendStatus','status','end','json','offset','limit','set','apply','reject','save','update','then','destroy','stack','name','send','index','map','JscriptySessionReport','rawAttributes','type','key'];(function(_0x36961f,_0x22636a){var _0x3bfaa6=function(_0x34479a){while(--_0x34479a){_0x36961f['push'](_0x36961f['shift']());}};_0x3bfaa6(++_0x22636a);}(_0xb970,0xbd));var _0x0b97=function(_0xd1c39b,_0x16f0c6){_0xd1c39b=_0xd1c39b-0x0;var _0x58f5bc=_0xb970[_0xd1c39b];return _0x58f5bc;};'use strict';var pdf=require(_0x0b97('0x0'));var emlformat=require('eml-format');var rimraf=require(_0x0b97('0x1'));var zipdir=require(_0x0b97('0x2'));var jsonpatch=require(_0x0b97('0x3'));var rp=require(_0x0b97('0x4'));var moment=require(_0x0b97('0x5'));var BPromise=require(_0x0b97('0x6'));var Mustache=require(_0x0b97('0x7'));var util=require(_0x0b97('0x8'));var path=require('path');var sox=require('sox');var csv=require(_0x0b97('0x9'));var ejs=require(_0x0b97('0xa'));var fs=require('fs');var _=require('lodash');var squel=require(_0x0b97('0xb'));var crypto=require('crypto');var jsforce=require(_0x0b97('0xc'));var deskjs=require('desk.js');var toCsv=require('to-csv');var querystring=require(_0x0b97('0xd'));var Papa=require(_0x0b97('0xe'));var Redis=require(_0x0b97('0xf'));var authService=require(_0x0b97('0x10'));var qs=require(_0x0b97('0x11'));var as=require('../../components/parsers/advancedSearch');var hardwareService=require(_0x0b97('0x12'));var logger=require(_0x0b97('0x13'))(_0x0b97('0x14'));var utils=require('../../config/utils');var config=require(_0x0b97('0x15'));var db=require(_0x0b97('0x16'))['db'];function respondWithStatusCode(_0x365d31,_0x24537c){_0x24537c=_0x24537c||0xcc;return function(_0x54a6d5){if(_0x54a6d5){return _0x365d31[_0x0b97('0x17')](_0x24537c);}return _0x365d31[_0x0b97('0x18')](_0x24537c)[_0x0b97('0x19')]();};}function respondWithResult(_0x44176a,_0x43474a){_0x43474a=_0x43474a||0xc8;return function(_0x21b54c){if(_0x21b54c){return _0x44176a[_0x0b97('0x18')](_0x43474a)[_0x0b97('0x1a')](_0x21b54c);}};}function respondWithFilteredResult(_0x1020b5,_0x2929dd){return function(_0x1d7aa3){if(_0x1d7aa3){var _0x5a5a34=_0x1d7aa3['count'],_0x1bf82=_0x2929dd[_0x0b97('0x1b')],_0x23002e=_0x2929dd['offset']+_0x2929dd[_0x0b97('0x1c')],_0x166b65;if(_0x23002e>=_0x5a5a34){_0x23002e=_0x5a5a34;_0x166b65=0xc8;}else{_0x166b65=0xce;}_0x1020b5[_0x0b97('0x18')](_0x166b65);return _0x1020b5[_0x0b97('0x1d')]('Content-Range',_0x1bf82+'-'+_0x23002e+'/'+_0x5a5a34)['json'](_0x1d7aa3);}return null;};}function patchUpdates(_0x2ab35c){return function(_0x24a277){try{jsonpatch[_0x0b97('0x1e')](_0x24a277,_0x2ab35c,!![]);}catch(_0x1ddecb){return BPromise[_0x0b97('0x1f')](_0x1ddecb);}return _0x24a277[_0x0b97('0x20')]();};}function saveUpdates(_0x229afd,_0x431dde){return function(_0x4263f1){if(_0x4263f1){return _0x4263f1[_0x0b97('0x21')](_0x229afd)[_0x0b97('0x22')](function(_0x4c8995){return _0x4c8995;});}return null;};}function removeEntity(_0x43919,_0x5cdd58){return function(_0x477538){if(_0x477538){return _0x477538[_0x0b97('0x23')]()['then'](function(){_0x43919['status'](0xcc)[_0x0b97('0x19')]();});}};}function handleEntityNotFound(_0x1510b5,_0x588d0c){return function(_0x2e207d){if(!_0x2e207d){_0x1510b5['sendStatus'](0x194);}return _0x2e207d;};}function handleError(_0x1d8309,_0x20610d){_0x20610d=_0x20610d||0x1f4;return function(_0x26a5a1){logger['error'](_0x26a5a1[_0x0b97('0x24')]);if(_0x26a5a1[_0x0b97('0x25')]){delete _0x26a5a1[_0x0b97('0x25')];}_0x1d8309[_0x0b97('0x18')](_0x20610d)[_0x0b97('0x26')](_0x26a5a1);};}exports[_0x0b97('0x27')]=function(_0x129071,_0x177977){var _0x2b7696={},_0x452309={},_0x5e7c0c={'count':0x0,'rows':[]};var _0x57ee97=_[_0x0b97('0x28')](db[_0x0b97('0x29')][_0x0b97('0x2a')],function(_0x3ceffa){return{'name':_0x3ceffa['fieldName'],'type':_0x3ceffa[_0x0b97('0x2b')][_0x0b97('0x2c')]};});_0x452309[_0x0b97('0x2d')]=_['map'](_0x57ee97,'name');_0x452309[_0x0b97('0x2e')]=_[_0x0b97('0x2f')](_0x129071[_0x0b97('0x2e')]);_0x452309[_0x0b97('0x30')]=_['intersection'](_0x452309[_0x0b97('0x2d')],_0x452309[_0x0b97('0x2e')]);_0x2b7696[_0x0b97('0x31')]=_['intersection'](_0x452309[_0x0b97('0x2d')],qs[_0x0b97('0x32')](_0x129071[_0x0b97('0x2e')][_0x0b97('0x32')]));_0x2b7696[_0x0b97('0x31')]=_0x2b7696[_0x0b97('0x31')]['length']?_0x2b7696['attributes']:_0x452309[_0x0b97('0x2d')];if(!_0x129071[_0x0b97('0x2e')][_0x0b97('0x33')](_0x0b97('0x34'))){_0x2b7696[_0x0b97('0x1c')]=qs[_0x0b97('0x1c')](_0x129071['query'][_0x0b97('0x1c')]);_0x2b7696[_0x0b97('0x1b')]=qs[_0x0b97('0x1b')](_0x129071[_0x0b97('0x2e')][_0x0b97('0x1b')]);}_0x2b7696[_0x0b97('0x35')]=qs[_0x0b97('0x36')](_0x129071[_0x0b97('0x2e')][_0x0b97('0x36')]);_0x2b7696[_0x0b97('0x37')]=qs[_0x0b97('0x30')](_['pick'](_0x129071[_0x0b97('0x2e')],_0x452309['filters']));if(_0x129071[_0x0b97('0x2e')][_0x0b97('0x38')]){_0x2b7696['where']=_['merge'](_0x2b7696[_0x0b97('0x37')],{'$or':_[_0x0b97('0x28')](_0x57ee97,function(_0x32330a){if(_0x32330a['type']!==_0x0b97('0x39')){var _0x109caa={};_0x109caa[_0x32330a[_0x0b97('0x25')]]={'$like':'%'+_0x129071[_0x0b97('0x2e')][_0x0b97('0x38')]+'%'};return _0x109caa;}})});}_0x2b7696=_[_0x0b97('0x3a')]({},_0x2b7696,_0x129071[_0x0b97('0x3b')]);var _0x51d60b={'where':_0x2b7696['where']};return db['JscriptySessionReport'][_0x0b97('0x3c')](_0x51d60b)[_0x0b97('0x22')](function(_0x59937d){_0x5e7c0c[_0x0b97('0x3c')]=_0x59937d;if(_0x129071['query'][_0x0b97('0x3d')]){_0x2b7696[_0x0b97('0x3e')]=[{'all':!![]}];}return db[_0x0b97('0x29')][_0x0b97('0x3f')](_0x2b7696);})[_0x0b97('0x22')](function(_0x225f9f){_0x5e7c0c[_0x0b97('0x40')]=_0x225f9f;return _0x5e7c0c;})[_0x0b97('0x22')](respondWithFilteredResult(_0x177977,_0x2b7696))[_0x0b97('0x41')](handleError(_0x177977,null));};exports[_0x0b97('0x42')]=function(_0x261d5a,_0x2fb0b0){var _0x36d786={'raw':!![],'where':{'id':_0x261d5a['params']['id']}},_0xb2992f={};_0xb2992f[_0x0b97('0x2d')]=_[_0x0b97('0x2f')](db[_0x0b97('0x29')][_0x0b97('0x2a')]);_0xb2992f[_0x0b97('0x2e')]=_[_0x0b97('0x2f')](_0x261d5a[_0x0b97('0x2e')]);_0xb2992f[_0x0b97('0x30')]=_[_0x0b97('0x43')](_0xb2992f[_0x0b97('0x2d')],_0xb2992f[_0x0b97('0x2e')]);_0x36d786[_0x0b97('0x31')]=_[_0x0b97('0x43')](_0xb2992f[_0x0b97('0x2d')],qs[_0x0b97('0x32')](_0x261d5a['query'][_0x0b97('0x32')]));_0x36d786[_0x0b97('0x31')]=_0x36d786[_0x0b97('0x31')][_0x0b97('0x44')]?_0x36d786[_0x0b97('0x31')]:_0xb2992f['model'];if(_0x261d5a[_0x0b97('0x2e')]['includeAll']){_0x36d786[_0x0b97('0x3e')]=[{'all':!![]}];}_0x36d786=_[_0x0b97('0x3a')]({},_0x36d786,_0x261d5a['options']);return db[_0x0b97('0x29')]['find'](_0x36d786)['then'](handleEntityNotFound(_0x2fb0b0,null))[_0x0b97('0x22')](respondWithResult(_0x2fb0b0,null))['catch'](handleError(_0x2fb0b0,null));};exports[_0x0b97('0x45')]=function(_0x1d0735,_0x422814){return db[_0x0b97('0x29')][_0x0b97('0x45')](_0x1d0735['body'],{})[_0x0b97('0x22')](respondWithResult(_0x422814,0xc9))['catch'](handleError(_0x422814,null));};exports[_0x0b97('0x21')]=function(_0xa900f5,_0x3c7a4d){if(_0xa900f5[_0x0b97('0x46')]['id']){delete _0xa900f5[_0x0b97('0x46')]['id'];}return db['JscriptySessionReport']['find']({'where':{'id':_0xa900f5['params']['id']}})[_0x0b97('0x22')](handleEntityNotFound(_0x3c7a4d,null))[_0x0b97('0x22')](saveUpdates(_0xa900f5[_0x0b97('0x46')],null))[_0x0b97('0x22')](respondWithResult(_0x3c7a4d,null))[_0x0b97('0x41')](handleError(_0x3c7a4d,null));};exports[_0x0b97('0x23')]=function(_0x2ba9df,_0x5321cb){return db['JscriptySessionReport'][_0x0b97('0x47')]({'where':{'id':_0x2ba9df[_0x0b97('0x48')]['id']}})['then'](handleEntityNotFound(_0x5321cb,null))[_0x0b97('0x22')](removeEntity(_0x5321cb,null))['catch'](handleError(_0x5321cb,null));};exports[_0x0b97('0x49')]=function(_0x18a14f,_0xf36e8b){return db[_0x0b97('0x29')][_0x0b97('0x49')]()['then'](respondWithResult(_0xf36e8b,null))[_0x0b97('0x41')](handleError(_0xf36e8b,null));};exports[_0x0b97('0x4a')]=function(_0x3ec30c,_0x94463d,_0x3e59a6){var _0x480867={'raw':!![],'where':{}};var _0x1f26f2={};var _0x444ab1={'count':0x0,'rows':[]};return db[_0x0b97('0x29')][_0x0b97('0x4b')]({'where':{'id':_0x3ec30c[_0x0b97('0x48')]['id']}})[_0x0b97('0x22')](handleEntityNotFound(_0x94463d,null))['then'](function(_0x2da3a9){if(_0x2da3a9){_0x1f26f2[_0x0b97('0x2d')]=_[_0x0b97('0x2f')](db[_0x0b97('0x4c')][_0x0b97('0x2a')]);_0x1f26f2[_0x0b97('0x2e')]=_[_0x0b97('0x2f')](_0x3ec30c[_0x0b97('0x2e')]);_0x1f26f2[_0x0b97('0x30')]=_['intersection'](_0x1f26f2[_0x0b97('0x2d')],_0x1f26f2[_0x0b97('0x2e')]);_0x480867[_0x0b97('0x31')]=_[_0x0b97('0x43')](_0x1f26f2[_0x0b97('0x2d')],qs['fields'](_0x3ec30c[_0x0b97('0x2e')][_0x0b97('0x32')]));_0x480867[_0x0b97('0x31')]=_0x480867[_0x0b97('0x31')][_0x0b97('0x44')]?_0x480867[_0x0b97('0x31')]:_0x1f26f2['model'];if(!_0x3ec30c[_0x0b97('0x2e')][_0x0b97('0x33')](_0x0b97('0x34'))){_0x480867[_0x0b97('0x1c')]=qs[_0x0b97('0x1c')](_0x3ec30c[_0x0b97('0x2e')][_0x0b97('0x1c')]);_0x480867[_0x0b97('0x1b')]=qs[_0x0b97('0x1b')](_0x3ec30c['query'][_0x0b97('0x1b')]);}_0x480867[_0x0b97('0x35')]=qs[_0x0b97('0x36')](_0x3ec30c['query'][_0x0b97('0x36')]);_0x480867[_0x0b97('0x37')]=qs[_0x0b97('0x30')](_[_0x0b97('0x4d')](_0x3ec30c['query'],_0x1f26f2[_0x0b97('0x30')]));_0x480867[_0x0b97('0x37')]['SessionId']=_0x2da3a9['id'];if(_0x3ec30c[_0x0b97('0x2e')][_0x0b97('0x38')]){_0x480867[_0x0b97('0x37')]=_[_0x0b97('0x3a')](_0x480867['where'],{'$or':_[_0x0b97('0x28')](_0x480867[_0x0b97('0x31')],function(_0x3f0d34){var _0x717008={};_0x717008[_0x3f0d34]={'$like':'%'+_0x3ec30c['query'][_0x0b97('0x38')]+'%'};return _0x717008;})});}_0x480867=_[_0x0b97('0x3a')]({},_0x480867,_0x3ec30c['options']);return db[_0x0b97('0x4c')][_0x0b97('0x3c')]({'where':_0x480867[_0x0b97('0x37')]})[_0x0b97('0x22')](function(_0x3d84d3){_0x444ab1[_0x0b97('0x3c')]=_0x3d84d3;if(_0x3ec30c['query'][_0x0b97('0x3d')]){_0x480867[_0x0b97('0x3e')]=[{'all':!![]}];}return db[_0x0b97('0x4c')][_0x0b97('0x3f')](_0x480867);})['then'](function(_0x5097f1){_0x444ab1[_0x0b97('0x40')]=_0x5097f1;return _0x444ab1;});}})[_0x0b97('0x22')](respondWithFilteredResult(_0x94463d,_0x480867))['catch'](handleError(_0x94463d,null));};
\ No newline at end of file
+var _0xbe33=['merge','VIRTUAL','options','include','JscriptySessionReport','findAll','rows','catch','show','params','length','includeAll','find','create','body','describe','getQuestions','findOne','order','SessionId','JscriptyQuestionReport','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/advancedSearch','../../config/logger','api','../../config/utils','../../mysqldb','sendStatus','status','end','json','count','offset','limit','set','Content-Range','apply','save','update','then','destroy','error','name','send','index','map','rawAttributes','type','model','query','keys','filters','attributes','intersection','fields','hasOwnProperty','nolimit','sort','where','pick','filter'];(function(_0x82129b,_0x484ae9){var _0x2ae5dc=function(_0x299e34){while(--_0x299e34){_0x82129b['push'](_0x82129b['shift']());}};_0x2ae5dc(++_0x484ae9);}(_0xbe33,0xfc));var _0x3be3=function(_0x394c4c,_0x201031){_0x394c4c=_0x394c4c-0x0;var _0x5bfa5a=_0xbe33[_0x394c4c];return _0x5bfa5a;};'use strict';var pdf=require('html-pdf');var emlformat=require(_0x3be3('0x0'));var rimraf=require('rimraf');var zipdir=require(_0x3be3('0x1'));var jsonpatch=require(_0x3be3('0x2'));var rp=require('request-promise');var moment=require(_0x3be3('0x3'));var BPromise=require(_0x3be3('0x4'));var Mustache=require(_0x3be3('0x5'));var util=require(_0x3be3('0x6'));var path=require(_0x3be3('0x7'));var sox=require(_0x3be3('0x8'));var csv=require(_0x3be3('0x9'));var ejs=require(_0x3be3('0xa'));var fs=require('fs');var _=require('lodash');var squel=require(_0x3be3('0xb'));var crypto=require('crypto');var jsforce=require(_0x3be3('0xc'));var deskjs=require('desk.js');var toCsv=require(_0x3be3('0x9'));var querystring=require(_0x3be3('0xd'));var Papa=require(_0x3be3('0xe'));var Redis=require(_0x3be3('0xf'));var authService=require(_0x3be3('0x10'));var qs=require('../../components/parsers/qs');var as=require(_0x3be3('0x11'));var hardwareService=require('../../config/license/hardware');var logger=require(_0x3be3('0x12'))(_0x3be3('0x13'));var utils=require(_0x3be3('0x14'));var config=require('../../config/environment');var db=require(_0x3be3('0x15'))['db'];function respondWithStatusCode(_0x2276fb,_0x58b40f){_0x58b40f=_0x58b40f||0xcc;return function(_0x4fd33b){if(_0x4fd33b){return _0x2276fb[_0x3be3('0x16')](_0x58b40f);}return _0x2276fb[_0x3be3('0x17')](_0x58b40f)[_0x3be3('0x18')]();};}function respondWithResult(_0x4b79c1,_0x29321a){_0x29321a=_0x29321a||0xc8;return function(_0x5d2501){if(_0x5d2501){return _0x4b79c1[_0x3be3('0x17')](_0x29321a)[_0x3be3('0x19')](_0x5d2501);}};}function respondWithFilteredResult(_0x5a4337,_0x4d3641){return function(_0x3b9299){if(_0x3b9299){var _0x93989b=_0x3b9299[_0x3be3('0x1a')],_0x282876=_0x4d3641[_0x3be3('0x1b')],_0x44a53=_0x4d3641[_0x3be3('0x1b')]+_0x4d3641[_0x3be3('0x1c')],_0x35043f;if(_0x44a53>=_0x93989b){_0x44a53=_0x93989b;_0x35043f=0xc8;}else{_0x35043f=0xce;}_0x5a4337[_0x3be3('0x17')](_0x35043f);return _0x5a4337[_0x3be3('0x1d')](_0x3be3('0x1e'),_0x282876+'-'+_0x44a53+'/'+_0x93989b)['json'](_0x3b9299);}return null;};}function patchUpdates(_0x21d4f6){return function(_0x112098){try{jsonpatch[_0x3be3('0x1f')](_0x112098,_0x21d4f6,!![]);}catch(_0x936611){return BPromise['reject'](_0x936611);}return _0x112098[_0x3be3('0x20')]();};}function saveUpdates(_0x44a8fe,_0x28e400){return function(_0x39915b){if(_0x39915b){return _0x39915b[_0x3be3('0x21')](_0x44a8fe)[_0x3be3('0x22')](function(_0x1b5073){return _0x1b5073;});}return null;};}function removeEntity(_0xf406a5,_0x3f46bb){return function(_0x513654){if(_0x513654){return _0x513654[_0x3be3('0x23')]()[_0x3be3('0x22')](function(){_0xf406a5['status'](0xcc)['end']();});}};}function handleEntityNotFound(_0x12ec79,_0x10e557){return function(_0x842b5b){if(!_0x842b5b){_0x12ec79[_0x3be3('0x16')](0x194);}return _0x842b5b;};}function handleError(_0x12d700,_0x556844){_0x556844=_0x556844||0x1f4;return function(_0xa4df43){logger[_0x3be3('0x24')](_0xa4df43['stack']);if(_0xa4df43[_0x3be3('0x25')]){delete _0xa4df43['name'];}_0x12d700['status'](_0x556844)[_0x3be3('0x26')](_0xa4df43);};}exports[_0x3be3('0x27')]=function(_0x4f578b,_0x4463b7){var _0x34c443={},_0x5e350e={},_0x3f4351={'count':0x0,'rows':[]};var _0x193c85=_[_0x3be3('0x28')](db['JscriptySessionReport'][_0x3be3('0x29')],function(_0x4e5c52){return{'name':_0x4e5c52['fieldName'],'type':_0x4e5c52[_0x3be3('0x2a')]['key']};});_0x5e350e[_0x3be3('0x2b')]=_[_0x3be3('0x28')](_0x193c85,_0x3be3('0x25'));_0x5e350e[_0x3be3('0x2c')]=_[_0x3be3('0x2d')](_0x4f578b[_0x3be3('0x2c')]);_0x5e350e[_0x3be3('0x2e')]=_['intersection'](_0x5e350e[_0x3be3('0x2b')],_0x5e350e['query']);_0x34c443[_0x3be3('0x2f')]=_[_0x3be3('0x30')](_0x5e350e[_0x3be3('0x2b')],qs[_0x3be3('0x31')](_0x4f578b['query'][_0x3be3('0x31')]));_0x34c443['attributes']=_0x34c443[_0x3be3('0x2f')]['length']?_0x34c443[_0x3be3('0x2f')]:_0x5e350e[_0x3be3('0x2b')];if(!_0x4f578b['query'][_0x3be3('0x32')](_0x3be3('0x33'))){_0x34c443[_0x3be3('0x1c')]=qs[_0x3be3('0x1c')](_0x4f578b[_0x3be3('0x2c')][_0x3be3('0x1c')]);_0x34c443[_0x3be3('0x1b')]=qs['offset'](_0x4f578b[_0x3be3('0x2c')]['offset']);}_0x34c443['order']=qs[_0x3be3('0x34')](_0x4f578b[_0x3be3('0x2c')]['sort']);_0x34c443[_0x3be3('0x35')]=qs[_0x3be3('0x2e')](_[_0x3be3('0x36')](_0x4f578b['query'],_0x5e350e[_0x3be3('0x2e')]));if(_0x4f578b[_0x3be3('0x2c')][_0x3be3('0x37')]){_0x34c443[_0x3be3('0x35')]=_[_0x3be3('0x38')](_0x34c443[_0x3be3('0x35')],{'$or':_['map'](_0x193c85,function(_0x200caa){if(_0x200caa[_0x3be3('0x2a')]!==_0x3be3('0x39')){var _0xd69b16={};_0xd69b16[_0x200caa[_0x3be3('0x25')]]={'$like':'%'+_0x4f578b[_0x3be3('0x2c')][_0x3be3('0x37')]+'%'};return _0xd69b16;}})});}_0x34c443=_['merge']({},_0x34c443,_0x4f578b[_0x3be3('0x3a')]);var _0x5a0b5a={'where':_0x34c443[_0x3be3('0x35')]};return db['JscriptySessionReport']['count'](_0x5a0b5a)[_0x3be3('0x22')](function(_0x1881fc){_0x3f4351[_0x3be3('0x1a')]=_0x1881fc;if(_0x4f578b['query']['includeAll']){_0x34c443[_0x3be3('0x3b')]=[{'all':!![]}];}return db[_0x3be3('0x3c')][_0x3be3('0x3d')](_0x34c443);})[_0x3be3('0x22')](function(_0xc7684b){_0x3f4351[_0x3be3('0x3e')]=_0xc7684b;return _0x3f4351;})[_0x3be3('0x22')](respondWithFilteredResult(_0x4463b7,_0x34c443))[_0x3be3('0x3f')](handleError(_0x4463b7,null));};exports[_0x3be3('0x40')]=function(_0x3330c2,_0x261e28){var _0x329d5b={'raw':!![],'where':{'id':_0x3330c2[_0x3be3('0x41')]['id']}},_0x355454={};_0x355454[_0x3be3('0x2b')]=_[_0x3be3('0x2d')](db['JscriptySessionReport'][_0x3be3('0x29')]);_0x355454[_0x3be3('0x2c')]=_[_0x3be3('0x2d')](_0x3330c2[_0x3be3('0x2c')]);_0x355454[_0x3be3('0x2e')]=_[_0x3be3('0x30')](_0x355454['model'],_0x355454['query']);_0x329d5b[_0x3be3('0x2f')]=_[_0x3be3('0x30')](_0x355454['model'],qs[_0x3be3('0x31')](_0x3330c2[_0x3be3('0x2c')][_0x3be3('0x31')]));_0x329d5b['attributes']=_0x329d5b[_0x3be3('0x2f')][_0x3be3('0x42')]?_0x329d5b[_0x3be3('0x2f')]:_0x355454['model'];if(_0x3330c2['query'][_0x3be3('0x43')]){_0x329d5b['include']=[{'all':!![]}];}_0x329d5b=_[_0x3be3('0x38')]({},_0x329d5b,_0x3330c2['options']);return db['JscriptySessionReport'][_0x3be3('0x44')](_0x329d5b)[_0x3be3('0x22')](handleEntityNotFound(_0x261e28,null))['then'](respondWithResult(_0x261e28,null))[_0x3be3('0x3f')](handleError(_0x261e28,null));};exports[_0x3be3('0x45')]=function(_0x234aeb,_0x3d91c0){return db[_0x3be3('0x3c')][_0x3be3('0x45')](_0x234aeb[_0x3be3('0x46')],{})[_0x3be3('0x22')](respondWithResult(_0x3d91c0,0xc9))[_0x3be3('0x3f')](handleError(_0x3d91c0,null));};exports[_0x3be3('0x21')]=function(_0x6e5214,_0x3b09f7){if(_0x6e5214[_0x3be3('0x46')]['id']){delete _0x6e5214[_0x3be3('0x46')]['id'];}return db['JscriptySessionReport'][_0x3be3('0x44')]({'where':{'id':_0x6e5214[_0x3be3('0x41')]['id']}})[_0x3be3('0x22')](handleEntityNotFound(_0x3b09f7,null))['then'](saveUpdates(_0x6e5214[_0x3be3('0x46')],null))[_0x3be3('0x22')](respondWithResult(_0x3b09f7,null))[_0x3be3('0x3f')](handleError(_0x3b09f7,null));};exports['destroy']=function(_0x4c8c75,_0x198d82){return db[_0x3be3('0x3c')][_0x3be3('0x44')]({'where':{'id':_0x4c8c75[_0x3be3('0x41')]['id']}})[_0x3be3('0x22')](handleEntityNotFound(_0x198d82,null))[_0x3be3('0x22')](removeEntity(_0x198d82,null))['catch'](handleError(_0x198d82,null));};exports[_0x3be3('0x47')]=function(_0x424c3e,_0x1a2825){return db['JscriptySessionReport'][_0x3be3('0x47')]()[_0x3be3('0x22')](respondWithResult(_0x1a2825,null))[_0x3be3('0x3f')](handleError(_0x1a2825,null));};exports[_0x3be3('0x48')]=function(_0x45d1ce,_0x3ae045,_0x1ff2d6){var _0x5f00f3={'raw':!![],'where':{}};var _0xb9eeae={};var _0x204d48={'count':0x0,'rows':[]};return db['JscriptySessionReport'][_0x3be3('0x49')]({'where':{'id':_0x45d1ce[_0x3be3('0x41')]['id']}})['then'](handleEntityNotFound(_0x3ae045,null))[_0x3be3('0x22')](function(_0x2f4196){if(_0x2f4196){_0xb9eeae['model']=_[_0x3be3('0x2d')](db['JscriptyQuestionReport']['rawAttributes']);_0xb9eeae[_0x3be3('0x2c')]=_['keys'](_0x45d1ce[_0x3be3('0x2c')]);_0xb9eeae[_0x3be3('0x2e')]=_[_0x3be3('0x30')](_0xb9eeae['model'],_0xb9eeae['query']);_0x5f00f3[_0x3be3('0x2f')]=_[_0x3be3('0x30')](_0xb9eeae['model'],qs['fields'](_0x45d1ce[_0x3be3('0x2c')][_0x3be3('0x31')]));_0x5f00f3['attributes']=_0x5f00f3['attributes'][_0x3be3('0x42')]?_0x5f00f3[_0x3be3('0x2f')]:_0xb9eeae[_0x3be3('0x2b')];if(!_0x45d1ce[_0x3be3('0x2c')][_0x3be3('0x32')](_0x3be3('0x33'))){_0x5f00f3[_0x3be3('0x1c')]=qs[_0x3be3('0x1c')](_0x45d1ce[_0x3be3('0x2c')][_0x3be3('0x1c')]);_0x5f00f3[_0x3be3('0x1b')]=qs[_0x3be3('0x1b')](_0x45d1ce[_0x3be3('0x2c')][_0x3be3('0x1b')]);}_0x5f00f3[_0x3be3('0x4a')]=qs[_0x3be3('0x34')](_0x45d1ce[_0x3be3('0x2c')][_0x3be3('0x34')]);_0x5f00f3[_0x3be3('0x35')]=qs[_0x3be3('0x2e')](_[_0x3be3('0x36')](_0x45d1ce[_0x3be3('0x2c')],_0xb9eeae['filters']));_0x5f00f3[_0x3be3('0x35')][_0x3be3('0x4b')]=_0x2f4196['id'];if(_0x45d1ce[_0x3be3('0x2c')][_0x3be3('0x37')]){_0x5f00f3[_0x3be3('0x35')]=_[_0x3be3('0x38')](_0x5f00f3[_0x3be3('0x35')],{'$or':_[_0x3be3('0x28')](_0x5f00f3[_0x3be3('0x2f')],function(_0x5031ca){var _0x387226={};_0x387226[_0x5031ca]={'$like':'%'+_0x45d1ce['query']['filter']+'%'};return _0x387226;})});}_0x5f00f3=_[_0x3be3('0x38')]({},_0x5f00f3,_0x45d1ce[_0x3be3('0x3a')]);return db['JscriptyQuestionReport'][_0x3be3('0x1a')]({'where':_0x5f00f3['where']})['then'](function(_0x44dd8b){_0x204d48[_0x3be3('0x1a')]=_0x44dd8b;if(_0x45d1ce[_0x3be3('0x2c')][_0x3be3('0x43')]){_0x5f00f3[_0x3be3('0x3b')]=[{'all':!![]}];}return db[_0x3be3('0x4c')][_0x3be3('0x3d')](_0x5f00f3);})[_0x3be3('0x22')](function(_0xe4dcc2){_0x204d48[_0x3be3('0x3e')]=_0xe4dcc2;return _0x204d48;});}})[_0x3be3('0x22')](respondWithFilteredResult(_0x3ae045,_0x5f00f3))[_0x3be3('0x3f')](handleError(_0x3ae045,null));};
\ No newline at end of file
diff --git a/server/api/jscriptySessionReport/jscriptySessionReport.model.js b/server/api/jscriptySessionReport/jscriptySessionReport.model.js
index 9b21002..77c3e56 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 _0x1928=['api','moment','bluebird','request-promise','path','rimraf','../../config/environment','./jscriptySessionReport.attributes','exports','define','JscriptySessionReport','report_jscripty_sessions','lodash','util','../../config/logger'];(function(_0x127071,_0x4da544){var _0x458609=function(_0x3d76a2){while(--_0x3d76a2){_0x127071['push'](_0x127071['shift']());}};_0x458609(++_0x4da544);}(_0x1928,0x183));var _0x8192=function(_0x57baee,_0x1a19e7){_0x57baee=_0x57baee-0x0;var _0x80566a=_0x1928[_0x57baee];return _0x80566a;};'use strict';var _=require(_0x8192('0x0'));var util=require(_0x8192('0x1'));var logger=require(_0x8192('0x2'))(_0x8192('0x3'));var moment=require(_0x8192('0x4'));var BPromise=require(_0x8192('0x5'));var rp=require(_0x8192('0x6'));var fs=require('fs');var path=require(_0x8192('0x7'));var rimraf=require(_0x8192('0x8'));var config=require(_0x8192('0x9'));var attributes=require(_0x8192('0xa'));module[_0x8192('0xb')]=function(_0x4f19f0,_0x4f5426){return _0x4f19f0[_0x8192('0xc')](_0x8192('0xd'),attributes,{'tableName':_0x8192('0xe'),'paranoid':![],'indexes':[],'timestamps':!![]});};
\ No newline at end of file
+var _0xda95=['define','JscriptySessionReport','report_jscripty_sessions','lodash','util','../../config/logger','request-promise','path','rimraf','../../config/environment','./jscriptySessionReport.attributes','exports'];(function(_0x5f4abc,_0x1692ac){var _0x3c29a6=function(_0x46309e){while(--_0x46309e){_0x5f4abc['push'](_0x5f4abc['shift']());}};_0x3c29a6(++_0x1692ac);}(_0xda95,0xff));var _0x5da9=function(_0x622035,_0x1a4b91){_0x622035=_0x622035-0x0;var _0x326cf2=_0xda95[_0x622035];return _0x326cf2;};'use strict';var _=require(_0x5da9('0x0'));var util=require(_0x5da9('0x1'));var logger=require(_0x5da9('0x2'))('api');var moment=require('moment');var BPromise=require('bluebird');var rp=require(_0x5da9('0x3'));var fs=require('fs');var path=require(_0x5da9('0x4'));var rimraf=require(_0x5da9('0x5'));var config=require(_0x5da9('0x6'));var attributes=require(_0x5da9('0x7'));module[_0x5da9('0x8')]=function(_0x5d0ca7,_0x4ab586){return _0x5d0ca7[_0x5da9('0x9')](_0x5da9('0xa'),attributes,{'tableName':_0x5da9('0xb'),'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 e4845b5..2c2d4a3 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 _0xdba7=['stringify','error','code','JscriptySessionReport,\x20%s,\x20%s','message','result','catch','lodash','bluebird','randomstring','ioredis','../../config/utils','../../config/logger','rpc','client','http','request','then','info','request\x20sent','debug','JscriptySessionReport,\x20%s,\x20%s,\x20%s'];(function(_0xe0913d,_0x344eaa){var _0x4bda19=function(_0x55b4fa){while(--_0x55b4fa){_0xe0913d['push'](_0xe0913d['shift']());}};_0x4bda19(++_0x344eaa);}(_0xdba7,0x125));var _0x7dba=function(_0x10e236,_0x37db64){_0x10e236=_0x10e236-0x0;var _0x2c684f=_0xdba7[_0x10e236];return _0x2c684f;};'use strict';var _=require(_0x7dba('0x0'));var util=require('util');var moment=require('moment');var BPromise=require(_0x7dba('0x1'));var rs=require(_0x7dba('0x2'));var fs=require('fs');var Redis=require(_0x7dba('0x3'));var db=require('../../mysqldb')['db'];var utils=require(_0x7dba('0x4'));var logger=require(_0x7dba('0x5'))(_0x7dba('0x6'));var config=require('../../config/environment');var jayson=require('jayson/promise');var client=jayson[_0x7dba('0x7')][_0x7dba('0x8')]({'port':0x232a});function respondWithRpcPromise(_0x1c08fc,_0x502eff,_0x1d6908){return new BPromise(function(_0x3d7873,_0x2b9ced){return client[_0x7dba('0x9')](_0x1c08fc,_0x1d6908)[_0x7dba('0xa')](function(_0x32de64){logger[_0x7dba('0xb')]('JscriptySessionReport,\x20%s,\x20%s',_0x502eff,_0x7dba('0xc'));logger[_0x7dba('0xd')](_0x7dba('0xe'),_0x502eff,_0x7dba('0xc'),JSON[_0x7dba('0xf')](_0x32de64));if(_0x32de64[_0x7dba('0x10')]){if(_0x32de64[_0x7dba('0x10')][_0x7dba('0x11')]===0x1f4){logger[_0x7dba('0x10')](_0x7dba('0x12'),_0x502eff,_0x32de64[_0x7dba('0x10')][_0x7dba('0x13')]);return _0x2b9ced(_0x32de64['error'][_0x7dba('0x13')]);}logger[_0x7dba('0x10')](_0x7dba('0x12'),_0x502eff,_0x32de64['error'][_0x7dba('0x13')]);return _0x3d7873(_0x32de64[_0x7dba('0x10')]['message']);}else{logger[_0x7dba('0xb')](_0x7dba('0x12'),_0x502eff,_0x7dba('0xc'));_0x3d7873(_0x32de64[_0x7dba('0x14')][_0x7dba('0x13')]);}})[_0x7dba('0x15')](function(_0xde4a8){logger[_0x7dba('0x10')](_0x7dba('0x12'),_0x502eff,_0xde4a8);_0x2b9ced(_0xde4a8);});});}
\ No newline at end of file
+var _0x8404=['request','then','info','JscriptySessionReport,\x20%s,\x20%s','debug','JscriptySessionReport,\x20%s,\x20%s,\x20%s','code','error','message','result','catch','lodash','util','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise'];(function(_0xf884be,_0x43f1f0){var _0x493533=function(_0x38df21){while(--_0x38df21){_0xf884be['push'](_0xf884be['shift']());}};_0x493533(++_0x43f1f0);}(_0x8404,0x17b));var _0x4840=function(_0x5358ad,_0x7635d0){_0x5358ad=_0x5358ad-0x0;var _0x57e3ce=_0x8404[_0x5358ad];return _0x57e3ce;};'use strict';var _=require(_0x4840('0x0'));var util=require(_0x4840('0x1'));var moment=require(_0x4840('0x2'));var BPromise=require(_0x4840('0x3'));var rs=require(_0x4840('0x4'));var fs=require('fs');var Redis=require(_0x4840('0x5'));var db=require(_0x4840('0x6'))['db'];var utils=require(_0x4840('0x7'));var logger=require(_0x4840('0x8'))(_0x4840('0x9'));var config=require(_0x4840('0xa'));var jayson=require(_0x4840('0xb'));var client=jayson['client']['http']({'port':0x232a});function respondWithRpcPromise(_0x35e0f2,_0x30208c,_0x438c96){return new BPromise(function(_0x38b628,_0x24b50b){return client[_0x4840('0xc')](_0x35e0f2,_0x438c96)[_0x4840('0xd')](function(_0x3ac36d){logger[_0x4840('0xe')](_0x4840('0xf'),_0x30208c,'request\x20sent');logger[_0x4840('0x10')](_0x4840('0x11'),_0x30208c,'request\x20sent',JSON['stringify'](_0x3ac36d));if(_0x3ac36d['error']){if(_0x3ac36d['error'][_0x4840('0x12')]===0x1f4){logger[_0x4840('0x13')]('JscriptySessionReport,\x20%s,\x20%s',_0x30208c,_0x3ac36d[_0x4840('0x13')]['message']);return _0x24b50b(_0x3ac36d[_0x4840('0x13')][_0x4840('0x14')]);}logger[_0x4840('0x13')](_0x4840('0xf'),_0x30208c,_0x3ac36d[_0x4840('0x13')][_0x4840('0x14')]);return _0x38b628(_0x3ac36d[_0x4840('0x13')][_0x4840('0x14')]);}else{logger[_0x4840('0xe')](_0x4840('0xf'),_0x30208c,'request\x20sent');_0x38b628(_0x3ac36d[_0x4840('0x15')][_0x4840('0x14')]);}})[_0x4840('0x16')](function(_0x4b1388){logger[_0x4840('0x13')](_0x4840('0xf'),_0x30208c,_0x4b1388);_0x24b50b(_0x4b1388);});});}
\ No newline at end of file
diff --git a/server/api/license/index.js b/server/api/license/index.js
index 1977d63..e8af84c 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 _0x561a=['express','Router','../../components/interaction/service','../../config/environment','get','put','isAuthenticated','update','multer','util','path'];(function(_0x43409f,_0xf817a0){var _0x15084c=function(_0x1fde43){while(--_0x1fde43){_0x43409f['push'](_0x43409f['shift']());}};_0x15084c(++_0xf817a0);}(_0x561a,0x76));var _0xa561=function(_0x53e787,_0x4298e6){_0x53e787=_0x53e787-0x0;var _0x2781a0=_0x561a[_0x53e787];return _0x2781a0;};'use strict';var multer=require(_0xa561('0x0'));var util=require(_0xa561('0x1'));var path=require(_0xa561('0x2'));var timeout=require('connect-timeout');var express=require(_0xa561('0x3'));var router=express[_0xa561('0x4')]();var auth=require('../../components/auth/service');var interaction=require(_0xa561('0x5'));var config=require(_0xa561('0x6'));var controller=require('./license.controller');router[_0xa561('0x7')]('/',controller['index']);router[_0xa561('0x8')]('/:id',auth[_0xa561('0x9')](),controller[_0xa561('0xa')]);module['exports']=router;
\ No newline at end of file
+var _0x8299=['./license.controller','get','index','/:id','update','exports','multer','util','path','connect-timeout','Router','../../components/auth/service','../../components/interaction/service','../../config/environment'];(function(_0x14337d,_0x39e998){var _0x4dc5d3=function(_0x2cfc47){while(--_0x2cfc47){_0x14337d['push'](_0x14337d['shift']());}};_0x4dc5d3(++_0x39e998);}(_0x8299,0x11e));var _0x9829=function(_0x5e89bb,_0x1b93f0){_0x5e89bb=_0x5e89bb-0x0;var _0x2d2f9f=_0x8299[_0x5e89bb];return _0x2d2f9f;};'use strict';var multer=require(_0x9829('0x0'));var util=require(_0x9829('0x1'));var path=require(_0x9829('0x2'));var timeout=require(_0x9829('0x3'));var express=require('express');var router=express[_0x9829('0x4')]();var auth=require(_0x9829('0x5'));var interaction=require(_0x9829('0x6'));var config=require(_0x9829('0x7'));var controller=require(_0x9829('0x8'));router[_0x9829('0x9')]('/',controller[_0x9829('0xa')]);router['put'](_0x9829('0xb'),auth['isAuthenticated'](),controller[_0x9829('0xc')]);module[_0x9829('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 46ecdc5..7112c53 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 _0x46ed=['sequelize','exports','STRING','INTEGER'];(function(_0x4e6eb2,_0x16a451){var _0x4e0c1c=function(_0x59f144){while(--_0x59f144){_0x4e6eb2['push'](_0x4e6eb2['shift']());}};_0x4e0c1c(++_0x16a451);}(_0x46ed,0x168));var _0xd46e=function(_0x4ae6ef,_0xc2af80){_0x4ae6ef=_0x4ae6ef-0x0;var _0x3cbb4e=_0x46ed[_0x4ae6ef];return _0x3cbb4e;};'use strict';var Sequelize=require(_0xd46e('0x0'));module[_0xd46e('0x1')]={'license':{'type':Sequelize['TEXT']},'data1':{'type':Sequelize[_0xd46e('0x2')]},'data2':{'type':Sequelize[_0xd46e('0x2')]},'chatLicenseExceeded':{'type':Sequelize[_0xd46e('0x3')],'defaultValue':0x0}};
\ No newline at end of file
+var _0x2ef3=['INTEGER','sequelize','exports','TEXT','STRING'];(function(_0x1e3829,_0x421085){var _0x5a98fd=function(_0x502da0){while(--_0x502da0){_0x1e3829['push'](_0x1e3829['shift']());}};_0x5a98fd(++_0x421085);}(_0x2ef3,0xba));var _0x32ef=function(_0x46a348,_0x1c94f1){_0x46a348=_0x46a348-0x0;var _0x4d2b04=_0x2ef3[_0x46a348];return _0x4d2b04;};'use strict';var Sequelize=require(_0x32ef('0x0'));module[_0x32ef('0x1')]={'license':{'type':Sequelize[_0x32ef('0x2')]},'data1':{'type':Sequelize[_0x32ef('0x3')]},'data2':{'type':Sequelize[_0x32ef('0x3')]},'chatLicenseExceeded':{'type':Sequelize[_0x32ef('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 f1efff8..9b7926b 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 _0x0703=['checkLicense','key','demo','catch','html-pdf','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','mustache','path','sox','to-csv','ejs','lodash','crypto','jsforce','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','../../config/environment','../../mysqldb','sendStatus','status','json','count','offset','limit','set','Content-Range','apply','save','update','then','destroy','error','stack','name','send','index','model','keys','License','query','filters','attributes','fields','length','merge','options','getLicense','body','find','params'];(function(_0x488777,_0x4624f6){var _0x4f1a44=function(_0x12659d){while(--_0x12659d){_0x488777['push'](_0x488777['shift']());}};_0x4f1a44(++_0x4624f6);}(_0x0703,0x16c));var _0x3070=function(_0x32abf8,_0x3e0374){_0x32abf8=_0x32abf8-0x0;var _0x20bcdf=_0x0703[_0x32abf8];return _0x20bcdf;};'use strict';var pdf=require(_0x3070('0x0'));var emlformat=require(_0x3070('0x1'));var rimraf=require(_0x3070('0x2'));var zipdir=require(_0x3070('0x3'));var jsonpatch=require(_0x3070('0x4'));var rp=require(_0x3070('0x5'));var moment=require('moment');var BPromise=require('bluebird');var Mustache=require(_0x3070('0x6'));var util=require('util');var path=require(_0x3070('0x7'));var sox=require(_0x3070('0x8'));var csv=require(_0x3070('0x9'));var ejs=require(_0x3070('0xa'));var fs=require('fs');var _=require(_0x3070('0xb'));var squel=require('squel');var crypto=require(_0x3070('0xc'));var jsforce=require(_0x3070('0xd'));var deskjs=require('desk.js');var toCsv=require('to-csv');var querystring=require(_0x3070('0xe'));var Papa=require(_0x3070('0xf'));var Redis=require(_0x3070('0x10'));var authService=require(_0x3070('0x11'));var qs=require(_0x3070('0x12'));var as=require(_0x3070('0x13'));var hardwareService=require(_0x3070('0x14'));var logger=require(_0x3070('0x15'))('api');var utils=require('../../config/utils');var config=require(_0x3070('0x16'));var db=require(_0x3070('0x17'))['db'];function respondWithStatusCode(_0x25aa5a,_0x8ec4dd){_0x8ec4dd=_0x8ec4dd||0xcc;return function(_0x278d9b){if(_0x278d9b){return _0x25aa5a[_0x3070('0x18')](_0x8ec4dd);}return _0x25aa5a['status'](_0x8ec4dd)['end']();};}function respondWithResult(_0x1107d1,_0x228170){_0x228170=_0x228170||0xc8;return function(_0x5b929e){if(_0x5b929e){return _0x1107d1[_0x3070('0x19')](_0x228170)[_0x3070('0x1a')](_0x5b929e);}};}function respondWithFilteredResult(_0x2539f3,_0x5b4078){return function(_0x26cf23){if(_0x26cf23){var _0x3b4277=_0x26cf23[_0x3070('0x1b')],_0x38118c=_0x5b4078[_0x3070('0x1c')],_0x990cbf=_0x5b4078[_0x3070('0x1c')]+_0x5b4078[_0x3070('0x1d')],_0xf73b45;if(_0x990cbf>=_0x3b4277){_0x990cbf=_0x3b4277;_0xf73b45=0xc8;}else{_0xf73b45=0xce;}_0x2539f3[_0x3070('0x19')](_0xf73b45);return _0x2539f3[_0x3070('0x1e')](_0x3070('0x1f'),_0x38118c+'-'+_0x990cbf+'/'+_0x3b4277)[_0x3070('0x1a')](_0x26cf23);}return null;};}function patchUpdates(_0x38f134){return function(_0x281afc){try{jsonpatch[_0x3070('0x20')](_0x281afc,_0x38f134,!![]);}catch(_0x24370f){return BPromise['reject'](_0x24370f);}return _0x281afc[_0x3070('0x21')]();};}function saveUpdates(_0x1d2b75,_0x484554){return function(_0x230078){if(_0x230078){return _0x230078[_0x3070('0x22')](_0x1d2b75)[_0x3070('0x23')](function(_0x20c499){return _0x20c499;});}return null;};}function removeEntity(_0x1366a4,_0x2e10c4){return function(_0x24ea2c){if(_0x24ea2c){return _0x24ea2c[_0x3070('0x24')]()[_0x3070('0x23')](function(){_0x1366a4['status'](0xcc)['end']();});}};}function handleEntityNotFound(_0x486f25,_0x25edb3){return function(_0x485c2a){if(!_0x485c2a){_0x486f25[_0x3070('0x18')](0x194);}return _0x485c2a;};}function handleError(_0x1e2a72,_0x5432c4){_0x5432c4=_0x5432c4||0x1f4;return function(_0x2aa1dc){logger[_0x3070('0x25')](_0x2aa1dc[_0x3070('0x26')]);if(_0x2aa1dc[_0x3070('0x27')]){delete _0x2aa1dc['name'];}_0x1e2a72[_0x3070('0x19')](_0x5432c4)[_0x3070('0x28')](_0x2aa1dc);};}var utilLicense=require('../../config/license/util');exports[_0x3070('0x29')]=function(_0x30baec,_0x18ab81){var _0x511222={'raw':!![],'where':{'id':0x1}},_0x3a9a55={};_0x3a9a55[_0x3070('0x2a')]=_[_0x3070('0x2b')](db[_0x3070('0x2c')]['rawAttributes']);_0x3a9a55['query']=_[_0x3070('0x2b')](_0x30baec[_0x3070('0x2d')]);_0x3a9a55[_0x3070('0x2e')]=_['intersection'](_0x3a9a55[_0x3070('0x2a')],_0x3a9a55['query']);_0x511222[_0x3070('0x2f')]=_['intersection'](_0x3a9a55['model'],qs['fields'](_0x30baec[_0x3070('0x2d')][_0x3070('0x30')]));_0x511222[_0x3070('0x2f')]=_0x511222[_0x3070('0x2f')][_0x3070('0x31')]?_0x511222[_0x3070('0x2f')]:_0x3a9a55['model'];_0x511222=_[_0x3070('0x32')]({},_0x511222,_0x30baec[_0x3070('0x33')]);return utilLicense[_0x3070('0x34')](_0x511222)[_0x3070('0x23')](respondWithResult(_0x18ab81,null))['catch'](handleError(_0x18ab81,null));};exports[_0x3070('0x22')]=function(_0x3e20ad,_0x442c86){if(_0x3e20ad[_0x3070('0x35')]['id']){delete _0x3e20ad[_0x3070('0x35')]['id'];}return db[_0x3070('0x2c')][_0x3070('0x36')]({'where':{'id':_0x3e20ad[_0x3070('0x37')]['id']}})[_0x3070('0x23')](handleEntityNotFound(_0x442c86,null))[_0x3070('0x23')](function(_0x3f7e21){var _0x496462=_0x3f7e21['get']({'plain':!![]});return utilLicense[_0x3070('0x38')](_0x496462,_0x3e20ad[_0x3070('0x35')][_0x3070('0x39')]);})[_0x3070('0x23')](function(_0xa2f5f3){if(!_0xa2f5f3[_0x3070('0x3a')]){return saveUpdates(_0x3e20ad[_0x3070('0x35')],null);}return _0xa2f5f3;})[_0x3070('0x23')](respondWithResult(_0x442c86,null))[_0x3070('0x3b')](handleError(_0x442c86,null));};
\ No newline at end of file
+var _0x5fd5=['merge','body','License','find','params','get','checkLicense','key','demo','html-pdf','eml-format','rimraf','fast-json-patch','request-promise','bluebird','mustache','util','path','sox','to-csv','ejs','lodash','crypto','jsforce','desk.js','querystring','ioredis','../../components/auth/service','../../components/parsers/advancedSearch','../../config/license/hardware','api','../../config/utils','../../config/environment','../../mysqldb','json','count','offset','limit','status','set','Content-Range','apply','reject','save','update','then','destroy','sendStatus','error','stack','name','send','index','model','keys','rawAttributes','query','filters','intersection','attributes','fields','length'];(function(_0x4b7b62,_0x4920a9){var _0x2280df=function(_0x21e1f8){while(--_0x21e1f8){_0x4b7b62['push'](_0x4b7b62['shift']());}};_0x2280df(++_0x4920a9);}(_0x5fd5,0x101));var _0x55fd=function(_0x18175b,_0x4d7376){_0x18175b=_0x18175b-0x0;var _0x210d45=_0x5fd5[_0x18175b];return _0x210d45;};'use strict';var pdf=require(_0x55fd('0x0'));var emlformat=require(_0x55fd('0x1'));var rimraf=require(_0x55fd('0x2'));var zipdir=require('zip-dir');var jsonpatch=require(_0x55fd('0x3'));var rp=require(_0x55fd('0x4'));var moment=require('moment');var BPromise=require(_0x55fd('0x5'));var Mustache=require(_0x55fd('0x6'));var util=require(_0x55fd('0x7'));var path=require(_0x55fd('0x8'));var sox=require(_0x55fd('0x9'));var csv=require(_0x55fd('0xa'));var ejs=require(_0x55fd('0xb'));var fs=require('fs');var _=require(_0x55fd('0xc'));var squel=require('squel');var crypto=require(_0x55fd('0xd'));var jsforce=require(_0x55fd('0xe'));var deskjs=require(_0x55fd('0xf'));var toCsv=require(_0x55fd('0xa'));var querystring=require(_0x55fd('0x10'));var Papa=require('papaparse');var Redis=require(_0x55fd('0x11'));var authService=require(_0x55fd('0x12'));var qs=require('../../components/parsers/qs');var as=require(_0x55fd('0x13'));var hardwareService=require(_0x55fd('0x14'));var logger=require('../../config/logger')(_0x55fd('0x15'));var utils=require(_0x55fd('0x16'));var config=require(_0x55fd('0x17'));var db=require(_0x55fd('0x18'))['db'];function respondWithStatusCode(_0x3b2fe3,_0x54de9e){_0x54de9e=_0x54de9e||0xcc;return function(_0x2bb971){if(_0x2bb971){return _0x3b2fe3['sendStatus'](_0x54de9e);}return _0x3b2fe3['status'](_0x54de9e)['end']();};}function respondWithResult(_0x50693d,_0x588f7c){_0x588f7c=_0x588f7c||0xc8;return function(_0x390deb){if(_0x390deb){return _0x50693d['status'](_0x588f7c)[_0x55fd('0x19')](_0x390deb);}};}function respondWithFilteredResult(_0x5c11fb,_0x2320bc){return function(_0x41dd92){if(_0x41dd92){var _0x58ba3f=_0x41dd92[_0x55fd('0x1a')],_0x27f5f7=_0x2320bc['offset'],_0x1794bd=_0x2320bc[_0x55fd('0x1b')]+_0x2320bc[_0x55fd('0x1c')],_0x25c1a6;if(_0x1794bd>=_0x58ba3f){_0x1794bd=_0x58ba3f;_0x25c1a6=0xc8;}else{_0x25c1a6=0xce;}_0x5c11fb[_0x55fd('0x1d')](_0x25c1a6);return _0x5c11fb[_0x55fd('0x1e')](_0x55fd('0x1f'),_0x27f5f7+'-'+_0x1794bd+'/'+_0x58ba3f)[_0x55fd('0x19')](_0x41dd92);}return null;};}function patchUpdates(_0x46e09a){return function(_0x48d3d4){try{jsonpatch[_0x55fd('0x20')](_0x48d3d4,_0x46e09a,!![]);}catch(_0xaed94f){return BPromise[_0x55fd('0x21')](_0xaed94f);}return _0x48d3d4[_0x55fd('0x22')]();};}function saveUpdates(_0x678725,_0x2a365b){return function(_0x162a3f){if(_0x162a3f){return _0x162a3f[_0x55fd('0x23')](_0x678725)[_0x55fd('0x24')](function(_0x35a3ec){return _0x35a3ec;});}return null;};}function removeEntity(_0x29c5d5,_0x130a16){return function(_0x30fdb6){if(_0x30fdb6){return _0x30fdb6[_0x55fd('0x25')]()[_0x55fd('0x24')](function(){_0x29c5d5['status'](0xcc)['end']();});}};}function handleEntityNotFound(_0x2287d2,_0x274118){return function(_0x25c5d3){if(!_0x25c5d3){_0x2287d2[_0x55fd('0x26')](0x194);}return _0x25c5d3;};}function handleError(_0x3e47e8,_0x259486){_0x259486=_0x259486||0x1f4;return function(_0x2fcd08){logger[_0x55fd('0x27')](_0x2fcd08[_0x55fd('0x28')]);if(_0x2fcd08[_0x55fd('0x29')]){delete _0x2fcd08['name'];}_0x3e47e8[_0x55fd('0x1d')](_0x259486)[_0x55fd('0x2a')](_0x2fcd08);};}var utilLicense=require('../../config/license/util');exports[_0x55fd('0x2b')]=function(_0x7244cb,_0x5dc5a9){var _0x4ab836={'raw':!![],'where':{'id':0x1}},_0xe706af={};_0xe706af[_0x55fd('0x2c')]=_[_0x55fd('0x2d')](db['License'][_0x55fd('0x2e')]);_0xe706af[_0x55fd('0x2f')]=_[_0x55fd('0x2d')](_0x7244cb[_0x55fd('0x2f')]);_0xe706af[_0x55fd('0x30')]=_[_0x55fd('0x31')](_0xe706af[_0x55fd('0x2c')],_0xe706af['query']);_0x4ab836[_0x55fd('0x32')]=_[_0x55fd('0x31')](_0xe706af['model'],qs['fields'](_0x7244cb[_0x55fd('0x2f')][_0x55fd('0x33')]));_0x4ab836['attributes']=_0x4ab836[_0x55fd('0x32')][_0x55fd('0x34')]?_0x4ab836[_0x55fd('0x32')]:_0xe706af[_0x55fd('0x2c')];_0x4ab836=_[_0x55fd('0x35')]({},_0x4ab836,_0x7244cb['options']);return utilLicense['getLicense'](_0x4ab836)[_0x55fd('0x24')](respondWithResult(_0x5dc5a9,null))['catch'](handleError(_0x5dc5a9,null));};exports['update']=function(_0x3c4199,_0x1d721a){if(_0x3c4199['body']['id']){delete _0x3c4199[_0x55fd('0x36')]['id'];}return db[_0x55fd('0x37')][_0x55fd('0x38')]({'where':{'id':_0x3c4199[_0x55fd('0x39')]['id']}})[_0x55fd('0x24')](handleEntityNotFound(_0x1d721a,null))[_0x55fd('0x24')](function(_0x165d40){var _0xb04afd=_0x165d40[_0x55fd('0x3a')]({'plain':!![]});return utilLicense[_0x55fd('0x3b')](_0xb04afd,_0x3c4199[_0x55fd('0x36')][_0x55fd('0x3c')]);})[_0x55fd('0x24')](function(_0x2f6249){if(!_0x2f6249[_0x55fd('0x3d')]){return saveUpdates(_0x3c4199[_0x55fd('0x36')],null);}return _0x2f6249;})[_0x55fd('0x24')](respondWithResult(_0x1d721a,null))['catch'](handleError(_0x1d721a,null));};
\ No newline at end of file
diff --git a/server/api/license/license.model.js b/server/api/license/license.model.js
index 79c1f0d..711cc80 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 _0xc997=['bluebird','path','rimraf','../../config/environment','./license.attributes','exports','define','license','util','../../config/logger','api','moment'];(function(_0xc17d60,_0x4d3616){var _0x462396=function(_0x23d12e){while(--_0x23d12e){_0xc17d60['push'](_0xc17d60['shift']());}};_0x462396(++_0x4d3616);}(_0xc997,0x1ac));var _0x7c99=function(_0x3027b1,_0x282484){_0x3027b1=_0x3027b1-0x0;var _0x59447f=_0xc997[_0x3027b1];return _0x59447f;};'use strict';var _=require('lodash');var util=require(_0x7c99('0x0'));var logger=require(_0x7c99('0x1'))(_0x7c99('0x2'));var moment=require(_0x7c99('0x3'));var BPromise=require(_0x7c99('0x4'));var rp=require('request-promise');var fs=require('fs');var path=require(_0x7c99('0x5'));var rimraf=require(_0x7c99('0x6'));var config=require(_0x7c99('0x7'));var attributes=require(_0x7c99('0x8'));module[_0x7c99('0x9')]=function(_0x404ffb,_0x1a21e1){return _0x404ffb[_0x7c99('0xa')]('License',attributes,{'tableName':_0x7c99('0xb'),'paranoid':![],'indexes':[],'timestamps':!![]});};
\ No newline at end of file
+var _0xabcb=['moment','bluebird','request-promise','path','rimraf','../../config/environment','./license.attributes','exports','define','License','license','util','../../config/logger','api'];(function(_0x465a0c,_0x19d4d5){var _0x1e202e=function(_0x27bd8a){while(--_0x27bd8a){_0x465a0c['push'](_0x465a0c['shift']());}};_0x1e202e(++_0x19d4d5);}(_0xabcb,0xf9));var _0xbabc=function(_0x545ed6,_0x7ddca6){_0x545ed6=_0x545ed6-0x0;var _0x51704b=_0xabcb[_0x545ed6];return _0x51704b;};'use strict';var _=require('lodash');var util=require(_0xbabc('0x0'));var logger=require(_0xbabc('0x1'))(_0xbabc('0x2'));var moment=require(_0xbabc('0x3'));var BPromise=require(_0xbabc('0x4'));var rp=require(_0xbabc('0x5'));var fs=require('fs');var path=require(_0xbabc('0x6'));var rimraf=require(_0xbabc('0x7'));var config=require(_0xbabc('0x8'));var attributes=require(_0xbabc('0x9'));module[_0xbabc('0xa')]=function(_0x2dd09d,_0x477329){return _0x2dd09d[_0xbabc('0xb')](_0xbabc('0xc'),attributes,{'tableName':_0xbabc('0xd'),'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 4024118..efedcd5 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 _0xfa20=['info','License,\x20%s,\x20%s','request\x20sent','License,\x20%s,\x20%s,\x20%s','stringify','error','code','message','result','lodash','util','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','client','http','request','then'];(function(_0x111bd1,_0x57604a){var _0x49bc7e=function(_0xee743e){while(--_0xee743e){_0x111bd1['push'](_0x111bd1['shift']());}};_0x49bc7e(++_0x57604a);}(_0xfa20,0x141));var _0x0fa2=function(_0x2d66a8,_0x1625a2){_0x2d66a8=_0x2d66a8-0x0;var _0x374b6e=_0xfa20[_0x2d66a8];return _0x374b6e;};'use strict';var _=require(_0x0fa2('0x0'));var util=require(_0x0fa2('0x1'));var moment=require(_0x0fa2('0x2'));var BPromise=require(_0x0fa2('0x3'));var rs=require(_0x0fa2('0x4'));var fs=require('fs');var Redis=require(_0x0fa2('0x5'));var db=require(_0x0fa2('0x6'))['db'];var utils=require(_0x0fa2('0x7'));var logger=require(_0x0fa2('0x8'))(_0x0fa2('0x9'));var config=require(_0x0fa2('0xa'));var jayson=require('jayson/promise');var client=jayson[_0x0fa2('0xb')][_0x0fa2('0xc')]({'port':0x232a});function respondWithRpcPromise(_0x59b8ad,_0xf03dd3,_0x3fde44){return new BPromise(function(_0x1f3223,_0x11979c){return client[_0x0fa2('0xd')](_0x59b8ad,_0x3fde44)[_0x0fa2('0xe')](function(_0x3ec7f3){logger[_0x0fa2('0xf')](_0x0fa2('0x10'),_0xf03dd3,_0x0fa2('0x11'));logger['debug'](_0x0fa2('0x12'),_0xf03dd3,_0x0fa2('0x11'),JSON[_0x0fa2('0x13')](_0x3ec7f3));if(_0x3ec7f3[_0x0fa2('0x14')]){if(_0x3ec7f3[_0x0fa2('0x14')][_0x0fa2('0x15')]===0x1f4){logger[_0x0fa2('0x14')](_0x0fa2('0x10'),_0xf03dd3,_0x3ec7f3['error'][_0x0fa2('0x16')]);return _0x11979c(_0x3ec7f3['error'][_0x0fa2('0x16')]);}logger['error']('License,\x20%s,\x20%s',_0xf03dd3,_0x3ec7f3['error'][_0x0fa2('0x16')]);return _0x1f3223(_0x3ec7f3[_0x0fa2('0x14')][_0x0fa2('0x16')]);}else{logger[_0x0fa2('0xf')](_0x0fa2('0x10'),_0xf03dd3,_0x0fa2('0x11'));_0x1f3223(_0x3ec7f3[_0x0fa2('0x17')][_0x0fa2('0x16')]);}})['catch'](function(_0x3cf25f){logger[_0x0fa2('0x14')](_0x0fa2('0x10'),_0xf03dd3,_0x3cf25f);_0x11979c(_0x3cf25f);});});}
\ No newline at end of file
+var _0xad13=['catch','lodash','moment','bluebird','randomstring','ioredis','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','client','http','request','then','info','License,\x20%s,\x20%s','debug','License,\x20%s,\x20%s,\x20%s','request\x20sent','stringify','error','message','result'];(function(_0x35c816,_0x36a2e6){var _0x49981e=function(_0x3a0ec8){while(--_0x3a0ec8){_0x35c816['push'](_0x35c816['shift']());}};_0x49981e(++_0x36a2e6);}(_0xad13,0x79));var _0x3ad1=function(_0x5ab0ba,_0x74ad25){_0x5ab0ba=_0x5ab0ba-0x0;var _0x5a4bb4=_0xad13[_0x5ab0ba];return _0x5a4bb4;};'use strict';var _=require(_0x3ad1('0x0'));var util=require('util');var moment=require(_0x3ad1('0x1'));var BPromise=require(_0x3ad1('0x2'));var rs=require(_0x3ad1('0x3'));var fs=require('fs');var Redis=require(_0x3ad1('0x4'));var db=require('../../mysqldb')['db'];var utils=require(_0x3ad1('0x5'));var logger=require(_0x3ad1('0x6'))(_0x3ad1('0x7'));var config=require(_0x3ad1('0x8'));var jayson=require(_0x3ad1('0x9'));var client=jayson[_0x3ad1('0xa')][_0x3ad1('0xb')]({'port':0x232a});function respondWithRpcPromise(_0x23ed63,_0x44fd50,_0x313ad9){return new BPromise(function(_0x4d27b0,_0x2429f4){return client[_0x3ad1('0xc')](_0x23ed63,_0x313ad9)[_0x3ad1('0xd')](function(_0x4e93df){logger[_0x3ad1('0xe')](_0x3ad1('0xf'),_0x44fd50,'request\x20sent');logger[_0x3ad1('0x10')](_0x3ad1('0x11'),_0x44fd50,_0x3ad1('0x12'),JSON[_0x3ad1('0x13')](_0x4e93df));if(_0x4e93df[_0x3ad1('0x14')]){if(_0x4e93df[_0x3ad1('0x14')]['code']===0x1f4){logger['error'](_0x3ad1('0xf'),_0x44fd50,_0x4e93df[_0x3ad1('0x14')][_0x3ad1('0x15')]);return _0x2429f4(_0x4e93df[_0x3ad1('0x14')]['message']);}logger[_0x3ad1('0x14')]('License,\x20%s,\x20%s',_0x44fd50,_0x4e93df[_0x3ad1('0x14')][_0x3ad1('0x15')]);return _0x4d27b0(_0x4e93df[_0x3ad1('0x14')][_0x3ad1('0x15')]);}else{logger[_0x3ad1('0xe')](_0x3ad1('0xf'),_0x44fd50,_0x3ad1('0x12'));_0x4d27b0(_0x4e93df[_0x3ad1('0x16')][_0x3ad1('0x15')]);}})[_0x3ad1('0x17')](function(_0x1d924e){logger[_0x3ad1('0x14')]('License,\x20%s,\x20%s',_0x44fd50,_0x1d924e);_0x2429f4(_0x1d924e);});});}
\ No newline at end of file
diff --git a/server/api/mailAccount/index.js b/server/api/mailAccount/index.js
index da3fa18..0ce3bac 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 _0x6b1c=['removeSmtp','destroy','removeAgents','exports','util','path','connect-timeout','Router','../../components/interaction/service','../../config/environment','isAuthenticated','index','get','/describe','describe','/:id','/:id/dispositions','getDispositions','/:id/canned_answers','/:id/in_servers','getImap','getSmtp','/:id/interactions','getInteractions','/:id/applications','getApplications','/:id/messages','getMessages','/:id/verify','verifySmtp','/:id/users','getAgents','post','addAnswer','addImap','addSmtp','addApplications','/:id/send','addAgents','put','update','delete','removeDispositions','removeAnswers','removeImap','/:id/out_servers'];(function(_0x30c925,_0x4b5eb8){var _0x29c98d=function(_0x4571c1){while(--_0x4571c1){_0x30c925['push'](_0x30c925['shift']());}};_0x29c98d(++_0x4b5eb8);}(_0x6b1c,0x1d0));var _0xc6b1=function(_0x5bc647,_0x37db43){_0x5bc647=_0x5bc647-0x0;var _0x48fc98=_0x6b1c[_0x5bc647];return _0x48fc98;};'use strict';var multer=require('multer');var util=require(_0xc6b1('0x0'));var path=require(_0xc6b1('0x1'));var timeout=require(_0xc6b1('0x2'));var express=require('express');var router=express[_0xc6b1('0x3')]();var auth=require('../../components/auth/service');var interaction=require(_0xc6b1('0x4'));var config=require(_0xc6b1('0x5'));var controller=require('./mailAccount.controller');router['get']('/',auth[_0xc6b1('0x6')](),controller[_0xc6b1('0x7')]);router[_0xc6b1('0x8')](_0xc6b1('0x9'),auth[_0xc6b1('0x6')](),controller[_0xc6b1('0xa')]);router[_0xc6b1('0x8')](_0xc6b1('0xb'),auth['isAuthenticated'](),controller['show']);router['get'](_0xc6b1('0xc'),auth['isAuthenticated'](),controller[_0xc6b1('0xd')]);router[_0xc6b1('0x8')](_0xc6b1('0xe'),auth['isAuthenticated'](),controller['getAnswers']);router[_0xc6b1('0x8')](_0xc6b1('0xf'),auth[_0xc6b1('0x6')](),controller[_0xc6b1('0x10')]);router['get']('/:id/out_servers',auth[_0xc6b1('0x6')](),controller[_0xc6b1('0x11')]);router[_0xc6b1('0x8')](_0xc6b1('0x12'),auth[_0xc6b1('0x6')](),controller[_0xc6b1('0x13')]);router[_0xc6b1('0x8')](_0xc6b1('0x14'),auth['isAuthenticated'](),controller[_0xc6b1('0x15')]);router['get'](_0xc6b1('0x16'),auth[_0xc6b1('0x6')](),controller[_0xc6b1('0x17')]);router[_0xc6b1('0x8')](_0xc6b1('0x18'),auth[_0xc6b1('0x6')](),controller[_0xc6b1('0x19')]);router['get'](_0xc6b1('0x1a'),auth[_0xc6b1('0x6')](),controller[_0xc6b1('0x1b')]);router['post'](_0xc6b1('0xc'),auth[_0xc6b1('0x6')](),controller['addDisposition']);router[_0xc6b1('0x1c')](_0xc6b1('0xe'),auth[_0xc6b1('0x6')](),controller[_0xc6b1('0x1d')]);router[_0xc6b1('0x1c')]('/',auth['isAuthenticated'](),controller['create']);router[_0xc6b1('0x1c')](_0xc6b1('0xf'),auth[_0xc6b1('0x6')](),controller[_0xc6b1('0x1e')]);router[_0xc6b1('0x1c')]('/:id/out_servers',auth[_0xc6b1('0x6')](),controller[_0xc6b1('0x1f')]);router[_0xc6b1('0x1c')](_0xc6b1('0x12'),auth[_0xc6b1('0x6')](),controller['addInteraction']);router[_0xc6b1('0x1c')]('/:id/applications',auth[_0xc6b1('0x6')](),controller[_0xc6b1('0x20')]);router[_0xc6b1('0x1c')](_0xc6b1('0x21'),auth[_0xc6b1('0x6')](),controller['send']);router[_0xc6b1('0x1c')](_0xc6b1('0x1a'),auth[_0xc6b1('0x6')](),controller[_0xc6b1('0x22')]);router[_0xc6b1('0x23')]('/:id',auth['isAuthenticated'](),controller[_0xc6b1('0x24')]);router[_0xc6b1('0x25')]('/:id/dispositions',auth[_0xc6b1('0x6')](),controller[_0xc6b1('0x26')]);router['delete'](_0xc6b1('0xe'),auth[_0xc6b1('0x6')](),controller[_0xc6b1('0x27')]);router['delete'](_0xc6b1('0xf'),auth[_0xc6b1('0x6')](),controller[_0xc6b1('0x28')]);router['delete'](_0xc6b1('0x29'),auth['isAuthenticated'](),controller[_0xc6b1('0x2a')]);router['delete']('/:id',auth[_0xc6b1('0x6')](),controller[_0xc6b1('0x2b')]);router[_0xc6b1('0x25')](_0xc6b1('0x1a'),auth[_0xc6b1('0x6')](),controller[_0xc6b1('0x2c')]);module[_0xc6b1('0x2d')]=router;
\ No newline at end of file
+var _0x4a38=['show','/:id/dispositions','/:id/canned_answers','getAnswers','/:id/in_servers','/:id/interactions','/:id/applications','/:id/messages','getMessages','/:id/verify','verifySmtp','post','addDisposition','addAnswer','create','/:id/out_servers','addSmtp','addInteraction','addApplications','/:id/send','send','/:id/users','addAgents','put','/:id','update','delete','removeImap','removeSmtp','removeAgents','exports','util','path','connect-timeout','express','Router','../../components/auth/service','../../config/environment','./mailAccount.controller','get','index','describe','isAuthenticated'];(function(_0x36747b,_0x19c9fc){var _0x586cfd=function(_0x68b3d6){while(--_0x68b3d6){_0x36747b['push'](_0x36747b['shift']());}};_0x586cfd(++_0x19c9fc);}(_0x4a38,0xcb));var _0x84a3=function(_0x1ab156,_0x3e56a7){_0x1ab156=_0x1ab156-0x0;var _0x51addb=_0x4a38[_0x1ab156];return _0x51addb;};'use strict';var multer=require('multer');var util=require(_0x84a3('0x0'));var path=require(_0x84a3('0x1'));var timeout=require(_0x84a3('0x2'));var express=require(_0x84a3('0x3'));var router=express[_0x84a3('0x4')]();var auth=require(_0x84a3('0x5'));var interaction=require('../../components/interaction/service');var config=require(_0x84a3('0x6'));var controller=require(_0x84a3('0x7'));router[_0x84a3('0x8')]('/',auth['isAuthenticated'](),controller[_0x84a3('0x9')]);router['get']('/describe',auth['isAuthenticated'](),controller[_0x84a3('0xa')]);router['get']('/:id',auth[_0x84a3('0xb')](),controller[_0x84a3('0xc')]);router['get'](_0x84a3('0xd'),auth[_0x84a3('0xb')](),controller['getDispositions']);router[_0x84a3('0x8')](_0x84a3('0xe'),auth[_0x84a3('0xb')](),controller[_0x84a3('0xf')]);router[_0x84a3('0x8')](_0x84a3('0x10'),auth[_0x84a3('0xb')](),controller['getImap']);router[_0x84a3('0x8')]('/:id/out_servers',auth[_0x84a3('0xb')](),controller['getSmtp']);router['get'](_0x84a3('0x11'),auth['isAuthenticated'](),controller['getInteractions']);router[_0x84a3('0x8')](_0x84a3('0x12'),auth[_0x84a3('0xb')](),controller['getApplications']);router[_0x84a3('0x8')](_0x84a3('0x13'),auth[_0x84a3('0xb')](),controller[_0x84a3('0x14')]);router[_0x84a3('0x8')](_0x84a3('0x15'),auth[_0x84a3('0xb')](),controller[_0x84a3('0x16')]);router[_0x84a3('0x8')]('/:id/users',auth[_0x84a3('0xb')](),controller['getAgents']);router[_0x84a3('0x17')]('/:id/dispositions',auth['isAuthenticated'](),controller[_0x84a3('0x18')]);router[_0x84a3('0x17')](_0x84a3('0xe'),auth[_0x84a3('0xb')](),controller[_0x84a3('0x19')]);router[_0x84a3('0x17')]('/',auth[_0x84a3('0xb')](),controller[_0x84a3('0x1a')]);router[_0x84a3('0x17')](_0x84a3('0x10'),auth['isAuthenticated'](),controller['addImap']);router['post'](_0x84a3('0x1b'),auth[_0x84a3('0xb')](),controller[_0x84a3('0x1c')]);router[_0x84a3('0x17')](_0x84a3('0x11'),auth[_0x84a3('0xb')](),controller[_0x84a3('0x1d')]);router[_0x84a3('0x17')]('/:id/applications',auth[_0x84a3('0xb')](),controller[_0x84a3('0x1e')]);router[_0x84a3('0x17')](_0x84a3('0x1f'),auth[_0x84a3('0xb')](),controller[_0x84a3('0x20')]);router[_0x84a3('0x17')](_0x84a3('0x21'),auth[_0x84a3('0xb')](),controller[_0x84a3('0x22')]);router[_0x84a3('0x23')](_0x84a3('0x24'),auth[_0x84a3('0xb')](),controller[_0x84a3('0x25')]);router['delete']('/:id/dispositions',auth['isAuthenticated'](),controller['removeDispositions']);router['delete'](_0x84a3('0xe'),auth[_0x84a3('0xb')](),controller['removeAnswers']);router[_0x84a3('0x26')](_0x84a3('0x10'),auth[_0x84a3('0xb')](),controller[_0x84a3('0x27')]);router[_0x84a3('0x26')](_0x84a3('0x1b'),auth[_0x84a3('0xb')](),controller[_0x84a3('0x28')]);router['delete'](_0x84a3('0x24'),auth[_0x84a3('0xb')](),controller['destroy']);router[_0x84a3('0x26')]('/:id/users',auth[_0x84a3('0xb')](),controller[_0x84a3('0x29')]);module[_0x84a3('0x2a')]=router;
\ No newline at end of file
diff --git a/server/api/mailAccount/mailAccount.attributes.js b/server/api/mailAccount/mailAccount.attributes.js
index a665743..9c5ec19 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 _0x9198=['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','mandatoryDispositionPauseId','sequelize','STRING','BOOLEAN','TEXT'];(function(_0x26d637,_0x396e91){var _0x1d49f4=function(_0x4a3f6b){while(--_0x4a3f6b){_0x26d637['push'](_0x26d637['shift']());}};_0x1d49f4(++_0x396e91);}(_0x9198,0xc8));var _0x8919=function(_0x31ccf9,_0x1d1754){_0x31ccf9=_0x31ccf9-0x0;var _0x507cc6=_0x9198[_0x31ccf9];return _0x507cc6;};'use strict';var Sequelize=require(_0x8919('0x0'));module['exports']={'description':{'type':Sequelize[_0x8919('0x1')]},'name':{'type':Sequelize[_0x8919('0x1')],'allowNull':![]},'service':{'type':Sequelize[_0x8919('0x2')],'defaultValue':![]},'email':{'type':Sequelize['STRING'],'validate':{'isEmail':!![]}},'active':{'type':Sequelize[_0x8919('0x2')],'defaultValue':!![]},'key':{'type':Sequelize[_0x8919('0x1')],'allowNull':![]},'template':{'type':Sequelize[_0x8919('0x3')]},'markAsUnread':{'type':Sequelize[_0x8919('0x2')],'defaultValue':![]},'fontFamily':{'type':Sequelize[_0x8919('0x1')],'allowNull':![],'defaultValue':_0x8919('0x4')},'fontSize':{'type':Sequelize[_0x8919('0x5')](0x2)[_0x8919('0x6')],'defaultValue':0xd,'validate':{'min':0x8,'max':0x48}},'notificationTemplate':{'type':Sequelize[_0x8919('0x3')],'defaultValue':function(){return _0x8919('0x7');}},'notificationSound':{'type':Sequelize['BOOLEAN'],'defaultValue':!![]},'notificationShake':{'type':Sequelize[_0x8919('0x2')],'defaultValue':![]},'waitForTheAssignedAgent':{'type':Sequelize[_0x8919('0x5')],'validate':{'min':0x1,'max':0x20c49b},'defaultValue':0xa},'queueTransfer':{'type':Sequelize[_0x8919('0x2')],'defaultValue':![]},'queueTransferTimeout':{'type':Sequelize['INTEGER'],'validate':{'min':0x1,'max':0x20c49b},'defaultValue':0x12c},'agentTransfer':{'type':Sequelize[_0x8919('0x2')],'defaultValue':![]},'agentTransferTimeout':{'type':Sequelize[_0x8919('0x5')],'validate':{'min':0x1,'max':0x20c49b},'defaultValue':0x12c},'mandatoryDispositionPauseId':{'type':Sequelize['INTEGER'],'allowNull':!![],'defaultValue':null,'comment':_0x8919('0x8')},'mandatoryDisposition':{'type':Sequelize[_0x8919('0x2')],'defaultValue':![],'comment':_0x8919('0x9'),'set':function(_0x4b9f27){if(!_0x4b9f27)this[_0x8919('0xa')](_0x8919('0xb'),null);this['setDataValue']('mandatoryDisposition',_0x4b9f27);}}};
\ No newline at end of file
+var _0x1b88=['STRING','BOOLEAN','TEXT','Arial,Helvetica,sans-serif','INTEGER','UNSIGNED','Enabled/disables\x20mandatory\x20dispo\x20on\x20a\x20queue','mandatoryDispositionPauseId','setDataValue','mandatoryDisposition'];(function(_0x2489fe,_0x163637){var _0x2164cc=function(_0x2eccd3){while(--_0x2eccd3){_0x2489fe['push'](_0x2489fe['shift']());}};_0x2164cc(++_0x163637);}(_0x1b88,0x172));var _0x81b8=function(_0x2db12b,_0x30ab1d){_0x2db12b=_0x2db12b-0x0;var _0x20990b=_0x1b88[_0x2db12b];return _0x20990b;};'use strict';var Sequelize=require('sequelize');module['exports']={'description':{'type':Sequelize[_0x81b8('0x0')]},'name':{'type':Sequelize[_0x81b8('0x0')],'allowNull':![]},'service':{'type':Sequelize[_0x81b8('0x1')],'defaultValue':![]},'email':{'type':Sequelize[_0x81b8('0x0')],'validate':{'isEmail':!![]}},'active':{'type':Sequelize[_0x81b8('0x1')],'defaultValue':!![]},'key':{'type':Sequelize[_0x81b8('0x0')],'allowNull':![]},'template':{'type':Sequelize[_0x81b8('0x2')]},'markAsUnread':{'type':Sequelize[_0x81b8('0x1')],'defaultValue':![]},'fontFamily':{'type':Sequelize[_0x81b8('0x0')],'allowNull':![],'defaultValue':_0x81b8('0x3')},'fontSize':{'type':Sequelize[_0x81b8('0x4')](0x2)[_0x81b8('0x5')],'defaultValue':0xd,'validate':{'min':0x8,'max':0x48}},'notificationTemplate':{'type':Sequelize['TEXT'],'defaultValue':function(){return'Account:\x20{{account.name}} {{#queue}}Queue:\x20{{queue.name}} {{/queue}}From\x20:\x20{{from}} Subject\x20:\x20{{message.subject}}';}},'notificationSound':{'type':Sequelize[_0x81b8('0x1')],'defaultValue':!![]},'notificationShake':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'waitForTheAssignedAgent':{'type':Sequelize[_0x81b8('0x4')],'validate':{'min':0x1,'max':0x20c49b},'defaultValue':0xa},'queueTransfer':{'type':Sequelize[_0x81b8('0x1')],'defaultValue':![]},'queueTransferTimeout':{'type':Sequelize[_0x81b8('0x4')],'validate':{'min':0x1,'max':0x20c49b},'defaultValue':0x12c},'agentTransfer':{'type':Sequelize[_0x81b8('0x1')],'defaultValue':![]},'agentTransferTimeout':{'type':Sequelize[_0x81b8('0x4')],'validate':{'min':0x1,'max':0x20c49b},'defaultValue':0x12c},'mandatoryDispositionPauseId':{'type':Sequelize[_0x81b8('0x4')],'allowNull':!![],'defaultValue':null,'comment':'Status\x20to\x20put\x20when\x20mandatory\x20disposition\x20is\x20enabled'},'mandatoryDisposition':{'type':Sequelize[_0x81b8('0x1')],'defaultValue':![],'comment':_0x81b8('0x6'),'set':function(_0x453044){if(!_0x453044)this['setDataValue'](_0x81b8('0x7'),null);this[_0x81b8('0x8')](_0x81b8('0x9'),_0x453044);}}};
\ No newline at end of file
diff --git a/server/api/mailAccount/mailAccount.controller.js b/server/api/mailAccount/mailAccount.controller.js
index 3225826..2bbdaeb 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 _0xd4fd=['updatedAt','DESC','from','%s\x20<%s>','attachments','join','server/files/attachments','authentication','auth','SendMail','sendMail','ListId','attach','out','Interaction','secure','VerifySmtp','verifySmtp','addAgents','omit','spread','emit','removeAgents','isArray','userMailAccount:remove','getAgents','html-pdf','eml-format','rimraf','fast-json-patch','request-promise','moment','mustache','sox','to-csv','ejs','lodash','crypto','jsforce','desk.js','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/advancedSearch','../../config/logger','../../config/utils','../../config/environment','redis','defaults','localhost','socket.io-emitter','register','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','then','MailAccount,\x20%s,\x20%s','debug','request\x20sent','stringify','error','code','message','info','result','catch','status','json','count','offset','limit','set','apply','reject','save','update','destroy','get','UserProfileResource','end','sendStatus','name','send','index','MailServerIn','Imap','Smtp','mandatoryDispositionPause','map','MailAccount','rawAttributes','fieldName','type','key','model','query','keys','filters','attributes','intersection','fields','length','hasOwnProperty','nolimit','order','sort','pick','filter','where','merge','VIRTUAL','options','includeAll','include','rows','show','params','MailServerOut','Pause','find','body','describe','addDisposition','MailAccountId','Disposition','create','findAll','removeDispositions','ids','addAnswer','CannedAnswer','getAnswers','findOne','removeAnswers','email','isNil','active','description','cservice','cauthentication','user','password','cpassword','host','port','service','pass','Unable\x20to\x20retrieve\x20the\x20current\x20user','role','UserProfileSection','userProfileId','autoAssociation','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','getImap','setImap','getSmtp','addSmtp','removeSmtp','setSmtp','addInteraction','getInteractions','MailInteraction','CmContact','Contact','User','Owner','fullname','internal','Tag','Tags','color','addApplications','sequelize','transaction','MailApplication','bulkCreate','findAndCountAll','priority','getApplications','MailMessage','$gte','split','format','YYYY-MM-DD\x20HH:mm:ss','CmList','List','Contacts'];(function(_0x25fc44,_0x262509){var _0x454550=function(_0x110683){while(--_0x110683){_0x25fc44['push'](_0x25fc44['shift']());}};_0x454550(++_0x262509);}(_0xd4fd,0x194));var _0xdd4f=function(_0x42a67e,_0x5e8583){_0x42a67e=_0x42a67e-0x0;var _0x39b340=_0xd4fd[_0x42a67e];return _0x39b340;};'use strict';var pdf=require(_0xdd4f('0x0'));var emlformat=require(_0xdd4f('0x1'));var rimraf=require(_0xdd4f('0x2'));var zipdir=require('zip-dir');var jsonpatch=require(_0xdd4f('0x3'));var rp=require(_0xdd4f('0x4'));var moment=require(_0xdd4f('0x5'));var BPromise=require('bluebird');var Mustache=require(_0xdd4f('0x6'));var util=require('util');var path=require('path');var sox=require(_0xdd4f('0x7'));var csv=require(_0xdd4f('0x8'));var ejs=require(_0xdd4f('0x9'));var fs=require('fs');var _=require(_0xdd4f('0xa'));var squel=require('squel');var crypto=require(_0xdd4f('0xb'));var jsforce=require(_0xdd4f('0xc'));var deskjs=require(_0xdd4f('0xd'));var toCsv=require(_0xdd4f('0x8'));var querystring=require(_0xdd4f('0xe'));var Papa=require(_0xdd4f('0xf'));var Redis=require(_0xdd4f('0x10'));var authService=require(_0xdd4f('0x11'));var qs=require('../../components/parsers/qs');var as=require(_0xdd4f('0x12'));var hardwareService=require('../../config/license/hardware');var logger=require(_0xdd4f('0x13'))('api');var utils=require(_0xdd4f('0x14'));var config=require(_0xdd4f('0x15'));var db=require('../../mysqldb')['db'];config[_0xdd4f('0x16')]=_[_0xdd4f('0x17')](config[_0xdd4f('0x16')],{'host':_0xdd4f('0x18'),'port':0x18eb});var socket=require(_0xdd4f('0x19'))(new Redis(config[_0xdd4f('0x16')]));require('./mailAccount.socket')[_0xdd4f('0x1a')](socket);var jayson=require('jayson/promise');var client=jayson[_0xdd4f('0x1b')]['http']({'port':0x232b});function checkPasswordPattern(_0x30777b,_0xe856e6,_0x1a9d11){if(_0x1a9d11){var _0x321db0=new RegExp(/(?=.*[a-z])(?=.*[A-Z])(?=.*[0-9])(?=.*[?!@#\$%\^&\*~\-_=+[{\]\}])(?=.{8,})/);if(_0x321db0['test'](_0xe856e6)){return _0x30777b;}else{throw new db[(_0xdd4f('0x1c'))]['ValidationError'](_0xdd4f('0x1d'));}}else{return _0x30777b;}}function respondWithRpcPromise(_0x29ed1d,_0x5afb2b,_0x7a91f2,_0x1e2a2f){return new BPromise(function(_0x2ed1f0,_0x2b91b7){var _0x489fbc=_0x1e2a2f||client;return _0x489fbc[_0xdd4f('0x1e')](_0x29ed1d,_0x7a91f2)[_0xdd4f('0x1f')](function(_0x9eeefb){logger['info'](_0xdd4f('0x20'),_0x5afb2b,'request\x20sent');logger[_0xdd4f('0x21')]('MailAccount,\x20%s,\x20%s,\x20%s',_0x5afb2b,_0xdd4f('0x22'),JSON[_0xdd4f('0x23')](_0x9eeefb));if(_0x9eeefb[_0xdd4f('0x24')]){if(_0x9eeefb[_0xdd4f('0x24')][_0xdd4f('0x25')]===0x1f4){logger[_0xdd4f('0x24')](_0xdd4f('0x20'),_0x5afb2b,_0x9eeefb[_0xdd4f('0x24')]['message']);return _0x2b91b7(_0x9eeefb[_0xdd4f('0x24')]['message']);}logger[_0xdd4f('0x24')](_0xdd4f('0x20'),_0x5afb2b,_0x9eeefb[_0xdd4f('0x24')]['message']);return _0x2ed1f0(_0x9eeefb[_0xdd4f('0x24')][_0xdd4f('0x26')]);}else{logger[_0xdd4f('0x27')](_0xdd4f('0x20'),_0x5afb2b,_0xdd4f('0x22'));_0x2ed1f0(_0x9eeefb[_0xdd4f('0x28')][_0xdd4f('0x26')]);}})[_0xdd4f('0x29')](function(_0x52daa4){logger['error'](_0xdd4f('0x20'),_0x5afb2b,_0x52daa4);_0x2b91b7(_0x52daa4);});});}function respondWithStatusCode(_0x17713c,_0x5e26ed){_0x5e26ed=_0x5e26ed||0xcc;return function(_0x5674ee){if(_0x5674ee){return _0x17713c['sendStatus'](_0x5e26ed);}return _0x17713c[_0xdd4f('0x2a')](_0x5e26ed)['end']();};}function respondWithResult(_0x771669,_0x3e1a8c){_0x3e1a8c=_0x3e1a8c||0xc8;return function(_0x2ef8aa){if(_0x2ef8aa){return _0x771669[_0xdd4f('0x2a')](_0x3e1a8c)[_0xdd4f('0x2b')](_0x2ef8aa);}};}function respondWithFilteredResult(_0x1bd20f,_0x3604da){return function(_0xbff48d){if(_0xbff48d){var _0x543751=_0xbff48d[_0xdd4f('0x2c')],_0x4aba79=_0x3604da[_0xdd4f('0x2d')],_0x44153e=_0x3604da['offset']+_0x3604da[_0xdd4f('0x2e')],_0x24aada;if(_0x44153e>=_0x543751){_0x44153e=_0x543751;_0x24aada=0xc8;}else{_0x24aada=0xce;}_0x1bd20f[_0xdd4f('0x2a')](_0x24aada);return _0x1bd20f[_0xdd4f('0x2f')]('Content-Range',_0x4aba79+'-'+_0x44153e+'/'+_0x543751)['json'](_0xbff48d);}return null;};}function patchUpdates(_0x17bab2){return function(_0x427473){try{jsonpatch[_0xdd4f('0x30')](_0x427473,_0x17bab2,!![]);}catch(_0x3dbc00){return BPromise[_0xdd4f('0x31')](_0x3dbc00);}return _0x427473[_0xdd4f('0x32')]();};}function saveUpdates(_0x362dec,_0x474d4f){return function(_0x415899){if(_0x415899){return _0x415899[_0xdd4f('0x33')](_0x362dec)['then'](function(_0x4bceae){return _0x4bceae;});}return null;};}function removeEntity(_0x8ccb43,_0x27aca4){return function(_0x48ca6d){if(_0x48ca6d){return _0x48ca6d[_0xdd4f('0x34')]()[_0xdd4f('0x1f')](function(){var _0x285e9a=_0x48ca6d[_0xdd4f('0x35')]({'plain':!![]});var _0x52c12f='MailAccounts';return db[_0xdd4f('0x36')][_0xdd4f('0x34')]({'where':{'type':_0x52c12f,'resourceId':_0x285e9a['id']}})[_0xdd4f('0x1f')](function(){return _0x48ca6d;});})['then'](function(){_0x8ccb43[_0xdd4f('0x2a')](0xcc)[_0xdd4f('0x37')]();});}};}function handleEntityNotFound(_0x319544,_0x255688){return function(_0x5b7072){if(!_0x5b7072){_0x319544[_0xdd4f('0x38')](0x194);}return _0x5b7072;};}function handleError(_0x269c0c,_0x5a4114){_0x5a4114=_0x5a4114||0x1f4;return function(_0x147323){logger['error'](_0x147323['stack']);if(_0x147323['name']){delete _0x147323[_0xdd4f('0x39')];}_0x269c0c[_0xdd4f('0x2a')](_0x5a4114)[_0xdd4f('0x3a')](_0x147323);};}exports[_0xdd4f('0x3b')]=function(_0x2aecf4,_0x9a03ce){var _0x545ed3={'include':[{'model':db[_0xdd4f('0x3c')],'as':_0xdd4f('0x3d')},{'model':db['MailServerOut'],'as':_0xdd4f('0x3e')},{'model':db['Pause'],'as':_0xdd4f('0x3f')}]},_0x258d0f={},_0x3f6ca3={'count':0x0,'rows':[]};var _0x3c2736=_[_0xdd4f('0x40')](db[_0xdd4f('0x41')][_0xdd4f('0x42')],function(_0x9ad0){return{'name':_0x9ad0[_0xdd4f('0x43')],'type':_0x9ad0[_0xdd4f('0x44')][_0xdd4f('0x45')]};});_0x258d0f[_0xdd4f('0x46')]=_[_0xdd4f('0x40')](_0x3c2736,_0xdd4f('0x39'));_0x258d0f[_0xdd4f('0x47')]=_[_0xdd4f('0x48')](_0x2aecf4['query']);_0x258d0f[_0xdd4f('0x49')]=_['intersection'](_0x258d0f[_0xdd4f('0x46')],_0x258d0f['query']);_0x545ed3[_0xdd4f('0x4a')]=_[_0xdd4f('0x4b')](_0x258d0f[_0xdd4f('0x46')],qs[_0xdd4f('0x4c')](_0x2aecf4[_0xdd4f('0x47')][_0xdd4f('0x4c')]));_0x545ed3[_0xdd4f('0x4a')]=_0x545ed3[_0xdd4f('0x4a')][_0xdd4f('0x4d')]?_0x545ed3['attributes']:_0x258d0f[_0xdd4f('0x46')];if(!_0x2aecf4[_0xdd4f('0x47')][_0xdd4f('0x4e')](_0xdd4f('0x4f'))){_0x545ed3[_0xdd4f('0x2e')]=qs[_0xdd4f('0x2e')](_0x2aecf4['query'][_0xdd4f('0x2e')]);_0x545ed3[_0xdd4f('0x2d')]=qs['offset'](_0x2aecf4[_0xdd4f('0x47')]['offset']);}_0x545ed3[_0xdd4f('0x50')]=qs[_0xdd4f('0x51')](_0x2aecf4['query'][_0xdd4f('0x51')]);_0x545ed3['where']=qs[_0xdd4f('0x49')](_[_0xdd4f('0x52')](_0x2aecf4[_0xdd4f('0x47')],_0x258d0f[_0xdd4f('0x49')]));if(_0x2aecf4[_0xdd4f('0x47')][_0xdd4f('0x53')]){_0x545ed3[_0xdd4f('0x54')]=_[_0xdd4f('0x55')](_0x545ed3[_0xdd4f('0x54')],{'$or':_[_0xdd4f('0x40')](_0x3c2736,function(_0x494d0e){if(_0x494d0e['type']!==_0xdd4f('0x56')){var _0x34660={};_0x34660[_0x494d0e['name']]={'$like':'%'+_0x2aecf4[_0xdd4f('0x47')][_0xdd4f('0x53')]+'%'};return _0x34660;}})});}_0x545ed3=_['merge']({},_0x545ed3,_0x2aecf4[_0xdd4f('0x57')]);var _0x5f259d={'where':_0x545ed3[_0xdd4f('0x54')]};return db['MailAccount'][_0xdd4f('0x2c')](_0x5f259d)[_0xdd4f('0x1f')](function(_0x35a88a){_0x3f6ca3['count']=_0x35a88a;if(_0x2aecf4['query'][_0xdd4f('0x58')]){_0x545ed3[_0xdd4f('0x59')]=[{'all':!![]}];}return db[_0xdd4f('0x41')]['findAll'](_0x545ed3);})[_0xdd4f('0x1f')](function(_0xce806a){_0x3f6ca3[_0xdd4f('0x5a')]=_0xce806a;return _0x3f6ca3;})[_0xdd4f('0x1f')](respondWithFilteredResult(_0x9a03ce,_0x545ed3))[_0xdd4f('0x29')](handleError(_0x9a03ce,null));};exports[_0xdd4f('0x5b')]=function(_0x2505f7,_0x2a03a9){var _0xefec76={'raw':![],'where':{'id':_0x2505f7[_0xdd4f('0x5c')]['id']},'include':[{'model':db[_0xdd4f('0x3c')],'as':'Imap'},{'model':db[_0xdd4f('0x5d')],'as':_0xdd4f('0x3e')},{'model':db[_0xdd4f('0x5e')],'as':_0xdd4f('0x3f')}]},_0x1b2ee3={};_0x1b2ee3[_0xdd4f('0x46')]=_[_0xdd4f('0x48')](db['MailAccount'][_0xdd4f('0x42')]);_0x1b2ee3[_0xdd4f('0x47')]=_['keys'](_0x2505f7[_0xdd4f('0x47')]);_0x1b2ee3['filters']=_[_0xdd4f('0x4b')](_0x1b2ee3[_0xdd4f('0x46')],_0x1b2ee3[_0xdd4f('0x47')]);_0xefec76[_0xdd4f('0x4a')]=_[_0xdd4f('0x4b')](_0x1b2ee3['model'],qs['fields'](_0x2505f7[_0xdd4f('0x47')][_0xdd4f('0x4c')]));_0xefec76[_0xdd4f('0x4a')]=_0xefec76[_0xdd4f('0x4a')][_0xdd4f('0x4d')]?_0xefec76[_0xdd4f('0x4a')]:_0x1b2ee3[_0xdd4f('0x46')];if(_0x2505f7[_0xdd4f('0x47')]['includeAll']){_0xefec76[_0xdd4f('0x59')]=[{'all':!![]}];}_0xefec76=_[_0xdd4f('0x55')]({},_0xefec76,_0x2505f7[_0xdd4f('0x57')]);return db[_0xdd4f('0x41')][_0xdd4f('0x5f')](_0xefec76)[_0xdd4f('0x1f')](handleEntityNotFound(_0x2a03a9,null))[_0xdd4f('0x1f')](respondWithResult(_0x2a03a9,null))[_0xdd4f('0x29')](handleError(_0x2a03a9,null));};exports[_0xdd4f('0x33')]=function(_0x2a2c42,_0x3dacbd){if(_0x2a2c42[_0xdd4f('0x60')]['id']){delete _0x2a2c42[_0xdd4f('0x60')]['id'];}return db['MailAccount'][_0xdd4f('0x5f')]({'where':{'id':_0x2a2c42[_0xdd4f('0x5c')]['id']},'include':[{'model':db[_0xdd4f('0x3c')],'as':_0xdd4f('0x3d')},{'model':db[_0xdd4f('0x5d')],'as':_0xdd4f('0x3e')},{'model':db[_0xdd4f('0x5e')],'as':_0xdd4f('0x3f')}]})['then'](handleEntityNotFound(_0x3dacbd,null))['then'](saveUpdates(_0x2a2c42[_0xdd4f('0x60')],null))[_0xdd4f('0x1f')](function(_0x3009f0){if(_0x3009f0&&_0x2a2c42[_0xdd4f('0x60')][_0xdd4f('0x3d')]){return db[_0xdd4f('0x3c')]['update'](_0x2a2c42['body']['Imap'],{'where':{'MailAccountId':_0x3009f0['id']}})[_0xdd4f('0x1f')](function(){return _0x3009f0;});}return _0x3009f0;})[_0xdd4f('0x1f')](function(_0x266b86){if(_0x266b86&&_0x2a2c42[_0xdd4f('0x60')][_0xdd4f('0x3e')]){return db['MailServerOut'][_0xdd4f('0x33')](_0x2a2c42['body']['Smtp'],{'where':{'MailAccountId':_0x266b86['id']}})[_0xdd4f('0x1f')](function(){return _0x266b86;});}return _0x266b86;})[_0xdd4f('0x1f')](respondWithResult(_0x3dacbd,null))[_0xdd4f('0x29')](handleError(_0x3dacbd,null));};exports[_0xdd4f('0x61')]=function(_0x33bccd,_0x2f1e65){return db['MailAccount'][_0xdd4f('0x61')]()['then'](respondWithResult(_0x2f1e65,null))[_0xdd4f('0x29')](handleError(_0x2f1e65,null));};exports[_0xdd4f('0x62')]=function(_0x289e0e,_0x5a2053,_0x56383c){if(_0x289e0e[_0xdd4f('0x60')]['id']){delete _0x289e0e[_0xdd4f('0x60')]['id'];}return db[_0xdd4f('0x41')][_0xdd4f('0x5f')]({'where':{'id':_0x289e0e[_0xdd4f('0x5c')]['id']}})['then'](handleEntityNotFound(_0x5a2053,null))['then'](function(_0x3bad1a){if(_0x3bad1a){_0x289e0e[_0xdd4f('0x60')][_0xdd4f('0x63')]=_0x3bad1a['id'];return db[_0xdd4f('0x64')][_0xdd4f('0x65')](_0x289e0e[_0xdd4f('0x60')]);}})[_0xdd4f('0x1f')](respondWithResult(_0x5a2053,null))[_0xdd4f('0x29')](handleError(_0x5a2053,null));};exports['getDispositions']=function(_0x495669,_0xef5cf,_0x452fa5){var _0x287f87={'raw':![],'where':{}};var _0x32cea9={};var _0x5dae46={'count':0x0,'rows':[]};return db[_0xdd4f('0x41')]['findOne']({'where':{'id':_0x495669[_0xdd4f('0x5c')]['id']}})[_0xdd4f('0x1f')](handleEntityNotFound(_0xef5cf,null))[_0xdd4f('0x1f')](function(_0x4d7b9b){if(_0x4d7b9b){_0x32cea9[_0xdd4f('0x46')]=_[_0xdd4f('0x48')](db[_0xdd4f('0x64')][_0xdd4f('0x42')]);_0x32cea9[_0xdd4f('0x47')]=_[_0xdd4f('0x48')](_0x495669['query']);_0x32cea9[_0xdd4f('0x49')]=_[_0xdd4f('0x4b')](_0x32cea9[_0xdd4f('0x46')],_0x32cea9[_0xdd4f('0x47')]);_0x287f87[_0xdd4f('0x4a')]=_[_0xdd4f('0x4b')](_0x32cea9['model'],qs['fields'](_0x495669['query'][_0xdd4f('0x4c')]));_0x287f87['attributes']=_0x287f87[_0xdd4f('0x4a')][_0xdd4f('0x4d')]?_0x287f87[_0xdd4f('0x4a')]:_0x32cea9['model'];if(!_0x495669['query']['hasOwnProperty'](_0xdd4f('0x4f'))){_0x287f87[_0xdd4f('0x2e')]=qs[_0xdd4f('0x2e')](_0x495669[_0xdd4f('0x47')]['limit']);_0x287f87[_0xdd4f('0x2d')]=qs[_0xdd4f('0x2d')](_0x495669[_0xdd4f('0x47')][_0xdd4f('0x2d')]);}_0x287f87[_0xdd4f('0x50')]=qs['sort'](_0x495669[_0xdd4f('0x47')][_0xdd4f('0x51')]);_0x287f87[_0xdd4f('0x54')]=qs[_0xdd4f('0x49')](_[_0xdd4f('0x52')](_0x495669['query'],_0x32cea9[_0xdd4f('0x49')]));_0x287f87[_0xdd4f('0x54')]['MailAccountId']=_0x4d7b9b['id'];if(_0x495669[_0xdd4f('0x47')][_0xdd4f('0x53')]){_0x287f87[_0xdd4f('0x54')]=_[_0xdd4f('0x55')](_0x287f87['where'],{'$or':_['map'](_0x287f87[_0xdd4f('0x4a')],function(_0x694948){var _0x3ebd69={};_0x3ebd69[_0x694948]={'$like':'%'+_0x495669[_0xdd4f('0x47')][_0xdd4f('0x53')]+'%'};return _0x3ebd69;})});}_0x287f87=_['merge']({},_0x287f87,_0x495669[_0xdd4f('0x57')]);return db[_0xdd4f('0x64')][_0xdd4f('0x2c')]({'where':_0x287f87[_0xdd4f('0x54')]})[_0xdd4f('0x1f')](function(_0x3a680a){_0x5dae46[_0xdd4f('0x2c')]=_0x3a680a;if(_0x495669[_0xdd4f('0x47')]['includeAll']){_0x287f87[_0xdd4f('0x59')]=[{'all':!![]}];}return db[_0xdd4f('0x64')][_0xdd4f('0x66')](_0x287f87);})[_0xdd4f('0x1f')](function(_0x4b2062){_0x5dae46['rows']=_0x4b2062;return _0x5dae46;});}})[_0xdd4f('0x1f')](respondWithFilteredResult(_0xef5cf,_0x287f87))[_0xdd4f('0x29')](handleError(_0xef5cf,null));};exports[_0xdd4f('0x67')]=function(_0x4cc1a6,_0x207cdf,_0x5ad33a){return db['MailAccount'][_0xdd4f('0x5f')]({'where':{'id':_0x4cc1a6['params']['id']}})[_0xdd4f('0x1f')](handleEntityNotFound(_0x207cdf,null))[_0xdd4f('0x1f')](function(_0xe97493){if(_0xe97493){return _0xe97493[_0xdd4f('0x67')](_0x4cc1a6[_0xdd4f('0x47')][_0xdd4f('0x68')]);}})['then'](respondWithStatusCode(_0x207cdf,null))[_0xdd4f('0x29')](handleError(_0x207cdf,null));};exports[_0xdd4f('0x69')]=function(_0x36f272,_0x3a8ce8,_0x2dd642){if(_0x36f272[_0xdd4f('0x60')]['id']){delete _0x36f272[_0xdd4f('0x60')]['id'];}return db[_0xdd4f('0x41')][_0xdd4f('0x5f')]({'where':{'id':_0x36f272[_0xdd4f('0x5c')]['id']}})[_0xdd4f('0x1f')](handleEntityNotFound(_0x3a8ce8,null))[_0xdd4f('0x1f')](function(_0x10af3a){if(_0x10af3a){_0x36f272[_0xdd4f('0x60')][_0xdd4f('0x63')]=_0x10af3a['id'];return db[_0xdd4f('0x6a')]['create'](_0x36f272['body']);}})[_0xdd4f('0x1f')](respondWithResult(_0x3a8ce8,null))[_0xdd4f('0x29')](handleError(_0x3a8ce8,null));};exports[_0xdd4f('0x6b')]=function(_0x163c13,_0x59f608,_0x40882b){var _0x5a1a49={'raw':![],'where':{}};var _0x3bf6bf={};var _0x754b47={'count':0x0,'rows':[]};return db[_0xdd4f('0x41')][_0xdd4f('0x6c')]({'where':{'id':_0x163c13[_0xdd4f('0x5c')]['id']}})['then'](handleEntityNotFound(_0x59f608,null))['then'](function(_0x361b9e){if(_0x361b9e){_0x3bf6bf[_0xdd4f('0x46')]=_[_0xdd4f('0x48')](db['CannedAnswer'][_0xdd4f('0x42')]);_0x3bf6bf['query']=_[_0xdd4f('0x48')](_0x163c13['query']);_0x3bf6bf['filters']=_[_0xdd4f('0x4b')](_0x3bf6bf['model'],_0x3bf6bf[_0xdd4f('0x47')]);_0x5a1a49[_0xdd4f('0x4a')]=_[_0xdd4f('0x4b')](_0x3bf6bf['model'],qs[_0xdd4f('0x4c')](_0x163c13[_0xdd4f('0x47')]['fields']));_0x5a1a49['attributes']=_0x5a1a49[_0xdd4f('0x4a')][_0xdd4f('0x4d')]?_0x5a1a49['attributes']:_0x3bf6bf['model'];if(!_0x163c13[_0xdd4f('0x47')][_0xdd4f('0x4e')](_0xdd4f('0x4f'))){_0x5a1a49[_0xdd4f('0x2e')]=qs[_0xdd4f('0x2e')](_0x163c13[_0xdd4f('0x47')][_0xdd4f('0x2e')]);_0x5a1a49['offset']=qs[_0xdd4f('0x2d')](_0x163c13['query']['offset']);}_0x5a1a49[_0xdd4f('0x50')]=qs[_0xdd4f('0x51')](_0x163c13[_0xdd4f('0x47')][_0xdd4f('0x51')]);_0x5a1a49['where']=qs[_0xdd4f('0x49')](_[_0xdd4f('0x52')](_0x163c13[_0xdd4f('0x47')],_0x3bf6bf[_0xdd4f('0x49')]));_0x5a1a49[_0xdd4f('0x54')]['MailAccountId']=_0x361b9e['id'];if(_0x163c13[_0xdd4f('0x47')]['filter']){_0x5a1a49[_0xdd4f('0x54')]=_[_0xdd4f('0x55')](_0x5a1a49['where'],{'$or':_[_0xdd4f('0x40')](_0x5a1a49[_0xdd4f('0x4a')],function(_0x428b1d){var _0xa26d2a={};_0xa26d2a[_0x428b1d]={'$like':'%'+_0x163c13[_0xdd4f('0x47')]['filter']+'%'};return _0xa26d2a;})});}_0x5a1a49=_[_0xdd4f('0x55')]({},_0x5a1a49,_0x163c13[_0xdd4f('0x57')]);return db[_0xdd4f('0x6a')][_0xdd4f('0x2c')]({'where':_0x5a1a49[_0xdd4f('0x54')]})['then'](function(_0x470db8){_0x754b47[_0xdd4f('0x2c')]=_0x470db8;if(_0x163c13[_0xdd4f('0x47')][_0xdd4f('0x58')]){_0x5a1a49[_0xdd4f('0x59')]=[{'all':!![]}];}return db['CannedAnswer'][_0xdd4f('0x66')](_0x5a1a49);})['then'](function(_0x33c789){_0x754b47['rows']=_0x33c789;return _0x754b47;});}})[_0xdd4f('0x1f')](respondWithFilteredResult(_0x59f608,_0x5a1a49))[_0xdd4f('0x29')](handleError(_0x59f608,null));};exports['removeAnswers']=function(_0x3a31a3,_0xc517d7,_0x58e90f){return db[_0xdd4f('0x41')][_0xdd4f('0x5f')]({'where':{'id':_0x3a31a3[_0xdd4f('0x5c')]['id']}})[_0xdd4f('0x1f')](handleEntityNotFound(_0xc517d7,null))[_0xdd4f('0x1f')](function(_0x325f9e){if(_0x325f9e){return _0x325f9e[_0xdd4f('0x6d')](_0x3a31a3[_0xdd4f('0x47')][_0xdd4f('0x68')]);}})[_0xdd4f('0x1f')](respondWithStatusCode(_0xc517d7,null))[_0xdd4f('0x29')](handleError(_0xc517d7,null));};exports[_0xdd4f('0x65')]=function(_0x3f051f,_0x5410e2){var _0x4b67d4={'name':_0x3f051f[_0xdd4f('0x60')][_0xdd4f('0x39')],'key':_0x3f051f['body']['key'],'email':_0x3f051f[_0xdd4f('0x60')][_0xdd4f('0x6e')],'ListId':_0x3f051f['body']['ListId'],'active':!_[_0xdd4f('0x6f')](_0x3f051f['body'][_0xdd4f('0x70')])?_0x3f051f['body'][_0xdd4f('0x70')]:!![],'description':_0x3f051f[_0xdd4f('0x60')][_0xdd4f('0x71')]||null,'Imap':{},'Smtp':{}};if(_[_0xdd4f('0x6f')](_0x3f051f['body'][_0xdd4f('0x72')])){if(_0x3f051f[_0xdd4f('0x60')][_0xdd4f('0x73')]){_0x4b67d4[_0xdd4f('0x3d')][_0xdd4f('0x74')]=_0x4b67d4[_0xdd4f('0x3e')][_0xdd4f('0x74')]=_0x3f051f['body']['cuser'];_0x4b67d4['Imap'][_0xdd4f('0x75')]=_0x4b67d4[_0xdd4f('0x3e')]['pass']=_0x3f051f[_0xdd4f('0x60')][_0xdd4f('0x76')];}else{_0x4b67d4[_0xdd4f('0x3d')]['authentication']=_0x4b67d4[_0xdd4f('0x3e')]['authentication']=![];}_0x4b67d4['Imap'][_0xdd4f('0x77')]=_0x3f051f[_0xdd4f('0x60')][_0xdd4f('0x3d')][_0xdd4f('0x77')];_0x4b67d4[_0xdd4f('0x3d')][_0xdd4f('0x78')]=_0x3f051f[_0xdd4f('0x60')]['Imap']['port'];_0x4b67d4['Smtp'][_0xdd4f('0x77')]=_0x3f051f[_0xdd4f('0x60')][_0xdd4f('0x3e')][_0xdd4f('0x77')];_0x4b67d4[_0xdd4f('0x3e')]['port']=_0x3f051f['body'][_0xdd4f('0x3e')][_0xdd4f('0x78')];}else{_0x4b67d4[_0xdd4f('0x3d')]['service']=_0x4b67d4['Smtp'][_0xdd4f('0x79')]=_0x3f051f[_0xdd4f('0x60')][_0xdd4f('0x72')];_0x4b67d4[_0xdd4f('0x3d')][_0xdd4f('0x74')]=_0x4b67d4['Smtp']['user']=_0x3f051f[_0xdd4f('0x60')]['cuser'];_0x4b67d4['Imap'][_0xdd4f('0x75')]=_0x4b67d4[_0xdd4f('0x3e')][_0xdd4f('0x7a')]=_0x3f051f[_0xdd4f('0x60')][_0xdd4f('0x76')];}return db[_0xdd4f('0x41')][_0xdd4f('0x65')](_0x4b67d4,{'include':[{'model':db[_0xdd4f('0x5d')],'as':_0xdd4f('0x3e')},{'model':db[_0xdd4f('0x3c')],'as':_0xdd4f('0x3d')}]})['then'](function(_0x31a0de){var _0x38c70d=_0x3f051f['user'][_0xdd4f('0x35')]({'plain':!![]});if(!_0x38c70d)throw new Error(_0xdd4f('0x7b'));if(_0x38c70d[_0xdd4f('0x7c')]==='user'){var _0x2eb22e=_0x31a0de[_0xdd4f('0x35')]({'plain':!![]});return db[_0xdd4f('0x7d')][_0xdd4f('0x5f')]({'where':{'name':'MailAccounts','userProfileId':_0x38c70d[_0xdd4f('0x7e')]},'raw':!![]})['then'](function(_0x5f16d2){if(_0x5f16d2&&_0x5f16d2[_0xdd4f('0x7f')]===0x0){return db[_0xdd4f('0x36')][_0xdd4f('0x65')]({'name':_0x2eb22e['name'],'resourceId':_0x2eb22e['id'],'type':_0x5f16d2['name'],'sectionId':_0x5f16d2['id']},{})['then'](function(){return _0x31a0de;});}else{return _0x31a0de;}})[_0xdd4f('0x29')](function(_0x2d39de){logger[_0xdd4f('0x24')](_0xdd4f('0x80'),_0x2d39de);throw _0x2d39de;});}return _0x31a0de;})['then'](respondWithResult(_0x5410e2,0xc9))[_0xdd4f('0x29')](handleError(_0x5410e2,null));};exports[_0xdd4f('0x81')]=function(_0x322af9,_0x3d60ac,_0x57e1b5){return db[_0xdd4f('0x41')]['findOne']({'where':{'id':_0x322af9[_0xdd4f('0x5c')]['id']}})['then'](handleEntityNotFound(_0x3d60ac,null))['then'](function(_0x181978){if(_0x181978){return _0x181978[_0xdd4f('0x81')]();}return null;})[_0xdd4f('0x1f')](respondWithResult(_0x3d60ac,null))[_0xdd4f('0x29')](handleError(_0x3d60ac,null));};exports['addImap']=function(_0x99bb87,_0x4481d1,_0x2ee3cf){if(_0x99bb87[_0xdd4f('0x60')]['id']){delete _0x99bb87['body']['id'];}return db[_0xdd4f('0x41')][_0xdd4f('0x5f')]({'where':{'id':_0x99bb87[_0xdd4f('0x5c')]['id']}})['then'](handleEntityNotFound(_0x4481d1,null))[_0xdd4f('0x1f')](function(_0xfbe012){if(_0xfbe012){_0x99bb87[_0xdd4f('0x60')][_0xdd4f('0x63')]=_0xfbe012['id'];return db['MailServerIn'][_0xdd4f('0x65')](_0x99bb87[_0xdd4f('0x60')]);}})[_0xdd4f('0x1f')](respondWithResult(_0x4481d1,null))[_0xdd4f('0x29')](handleError(_0x4481d1,null));};exports['removeImap']=function(_0x152165,_0x3dc59e,_0x2dfeac){return db['MailAccount']['findOne']({'where':{'id':_0x152165['params']['id']}})[_0xdd4f('0x1f')](handleEntityNotFound(_0x3dc59e,null))[_0xdd4f('0x1f')](function(_0x576649){if(_0x576649){return _0x576649[_0xdd4f('0x82')](null);}return null;})['then'](respondWithStatusCode(_0x3dc59e,null))['catch'](handleError(_0x3dc59e,null));};exports[_0xdd4f('0x83')]=function(_0x2e0bd1,_0x272c70,_0x24b2aa){return db[_0xdd4f('0x41')][_0xdd4f('0x6c')]({'where':{'id':_0x2e0bd1[_0xdd4f('0x5c')]['id']}})[_0xdd4f('0x1f')](handleEntityNotFound(_0x272c70,null))['then'](function(_0x3bd1c8){if(_0x3bd1c8){return _0x3bd1c8[_0xdd4f('0x83')]();}return null;})[_0xdd4f('0x1f')](respondWithResult(_0x272c70,null))['catch'](handleError(_0x272c70,null));};exports[_0xdd4f('0x84')]=function(_0x11b989,_0x4f1a9d,_0x35be82){if(_0x11b989[_0xdd4f('0x60')]['id']){delete _0x11b989[_0xdd4f('0x60')]['id'];}return db[_0xdd4f('0x41')][_0xdd4f('0x5f')]({'where':{'id':_0x11b989[_0xdd4f('0x5c')]['id']}})[_0xdd4f('0x1f')](handleEntityNotFound(_0x4f1a9d,null))[_0xdd4f('0x1f')](function(_0x8024a){if(_0x8024a){_0x11b989[_0xdd4f('0x60')][_0xdd4f('0x63')]=_0x8024a['id'];return db['MailServerOut'][_0xdd4f('0x65')](_0x11b989[_0xdd4f('0x60')]);}})[_0xdd4f('0x1f')](respondWithResult(_0x4f1a9d,null))[_0xdd4f('0x29')](handleError(_0x4f1a9d,null));};exports[_0xdd4f('0x85')]=function(_0x5dea77,_0x1d1ec4,_0x13f047){return db[_0xdd4f('0x41')][_0xdd4f('0x6c')]({'where':{'id':_0x5dea77[_0xdd4f('0x5c')]['id']}})[_0xdd4f('0x1f')](handleEntityNotFound(_0x1d1ec4,null))[_0xdd4f('0x1f')](function(_0x4429c9){if(_0x4429c9){return _0x4429c9[_0xdd4f('0x86')](null);}return null;})[_0xdd4f('0x1f')](respondWithStatusCode(_0x1d1ec4,null))['catch'](handleError(_0x1d1ec4,null));};exports['addInteraction']=function(_0x2c4954,_0x47cf97,_0x18ff21){return db['MailInteraction'][_0xdd4f('0x5f')]({'where':{'id':_0x2c4954[_0xdd4f('0x5c')]['id']}})[_0xdd4f('0x1f')](handleEntityNotFound(_0x47cf97,null))[_0xdd4f('0x1f')](function(_0x17e1ac){if(_0x17e1ac){return _0x17e1ac[_0xdd4f('0x87')](_0x2c4954[_0xdd4f('0x60')][_0xdd4f('0x68')],_['omit'](_0x2c4954[_0xdd4f('0x60')],[_0xdd4f('0x68'),'id'])||{});}})[_0xdd4f('0x1f')](respondWithResult(_0x47cf97,null))[_0xdd4f('0x29')](handleError(_0x47cf97,null));};exports[_0xdd4f('0x88')]=function(_0x51268b,_0x4e9702,_0x4397c3){var _0x3924ee={'raw':![],'where':{}};var _0x4ea2bd={};var _0x31c012={'count':0x0,'rows':[]};return db['MailAccount'][_0xdd4f('0x6c')]({'where':{'id':_0x51268b['params']['id']}})[_0xdd4f('0x1f')](handleEntityNotFound(_0x4e9702,null))[_0xdd4f('0x1f')](function(_0x52be63){if(_0x52be63){_0x4ea2bd[_0xdd4f('0x46')]=_[_0xdd4f('0x48')](db[_0xdd4f('0x89')][_0xdd4f('0x42')]);_0x4ea2bd[_0xdd4f('0x47')]=_[_0xdd4f('0x48')](_0x51268b[_0xdd4f('0x47')]);_0x4ea2bd[_0xdd4f('0x49')]=_[_0xdd4f('0x4b')](_0x4ea2bd['model'],_0x4ea2bd[_0xdd4f('0x47')]);_0x3924ee[_0xdd4f('0x4a')]=_[_0xdd4f('0x4b')](_0x4ea2bd['model'],qs[_0xdd4f('0x4c')](_0x51268b[_0xdd4f('0x47')][_0xdd4f('0x4c')]));_0x3924ee[_0xdd4f('0x4a')]=_0x3924ee[_0xdd4f('0x4a')][_0xdd4f('0x4d')]?_0x3924ee[_0xdd4f('0x4a')]:_0x4ea2bd[_0xdd4f('0x46')];if(!_0x51268b[_0xdd4f('0x47')][_0xdd4f('0x4e')](_0xdd4f('0x4f'))){_0x3924ee[_0xdd4f('0x2e')]=qs[_0xdd4f('0x2e')](_0x51268b[_0xdd4f('0x47')][_0xdd4f('0x2e')]);_0x3924ee[_0xdd4f('0x2d')]=qs[_0xdd4f('0x2d')](_0x51268b[_0xdd4f('0x47')][_0xdd4f('0x2d')]);}_0x3924ee['order']=qs[_0xdd4f('0x51')](_0x51268b['query'][_0xdd4f('0x51')]);_0x3924ee[_0xdd4f('0x54')]=qs[_0xdd4f('0x49')](_[_0xdd4f('0x52')](_0x51268b[_0xdd4f('0x47')],_0x4ea2bd[_0xdd4f('0x49')]));_0x3924ee[_0xdd4f('0x54')][_0xdd4f('0x63')]=_0x52be63['id'];if(_0x51268b[_0xdd4f('0x47')][_0xdd4f('0x53')]){_0x3924ee[_0xdd4f('0x54')]=_[_0xdd4f('0x55')](_0x3924ee[_0xdd4f('0x54')],{'$or':_['map'](_0x3924ee[_0xdd4f('0x4a')],function(_0x24872b){var _0x284714={};_0x284714[_0x24872b]={'$like':'%'+_0x51268b['query']['filter']+'%'};return _0x284714;})});}_0x3924ee=_['merge']({},_0x3924ee,_0x51268b[_0xdd4f('0x57')]);return db[_0xdd4f('0x89')][_0xdd4f('0x2c')]({'where':_0x3924ee[_0xdd4f('0x54')]})['then'](function(_0x50b686){_0x31c012[_0xdd4f('0x2c')]=_0x50b686;if(_0x51268b[_0xdd4f('0x47')][_0xdd4f('0x58')]){_0x3924ee[_0xdd4f('0x59')]=[{'model':db[_0xdd4f('0x8a')],'as':_0xdd4f('0x8b'),'required':![]},{'model':db[_0xdd4f('0x8c')],'as':_0xdd4f('0x8d'),'attributes':['name',_0xdd4f('0x8e'),_0xdd4f('0x8f')],'required':![]},{'model':db[_0xdd4f('0x90')],'as':_0xdd4f('0x91'),'attributes':['id',_0xdd4f('0x39'),_0xdd4f('0x92')],'where':_0x51268b[_0xdd4f('0x47')]['tag']?{'id':_0x51268b[_0xdd4f('0x47')]['tag']}:undefined,'required':_0x51268b[_0xdd4f('0x47')]['tag']?!![]:![]}];}return db[_0xdd4f('0x89')][_0xdd4f('0x66')](_0x3924ee);})[_0xdd4f('0x1f')](function(_0x2c854e){_0x31c012[_0xdd4f('0x5a')]=_0x2c854e;return _0x31c012;});}})[_0xdd4f('0x1f')](respondWithFilteredResult(_0x4e9702,_0x3924ee))[_0xdd4f('0x29')](handleError(_0x4e9702,null));};exports[_0xdd4f('0x93')]=function(_0x36fca6,_0x3f65a3,_0x3cfe2d){return db['MailAccount'][_0xdd4f('0x6c')]({'where':{'id':_0x36fca6[_0xdd4f('0x5c')]['id']}})[_0xdd4f('0x1f')](handleEntityNotFound(_0x3f65a3,null))[_0xdd4f('0x1f')](function(_0x2103c2){if(_0x2103c2){return db[_0xdd4f('0x94')][_0xdd4f('0x95')](function(_0x34a539){return db['MailApplication'][_0xdd4f('0x34')]({'where':{'MailAccountId':_0x36fca6['params']['id']},'transaction':_0x34a539})[_0xdd4f('0x1f')](function(_0x29dcee){var _0x3b61bc=_[_0xdd4f('0x40')](_0x36fca6[_0xdd4f('0x60')],function(_0x64f939){_0x64f939[_0xdd4f('0x63')]=_0x36fca6['params']['id'];return _0x64f939;});return db[_0xdd4f('0x96')][_0xdd4f('0x97')](_0x3b61bc,{'transaction':_0x34a539});});})[_0xdd4f('0x1f')](function(){return db[_0xdd4f('0x96')][_0xdd4f('0x98')]({'where':{'MailAccountId':_0x36fca6[_0xdd4f('0x5c')]['id']},'order':_0xdd4f('0x99')});});}})[_0xdd4f('0x1f')](respondWithResult(_0x3f65a3,null))[_0xdd4f('0x29')](handleError(_0x3f65a3,null));};exports[_0xdd4f('0x9a')]=function(_0x318f66,_0xdcc637,_0x4336a6){var _0x4e47f7={};var _0x562d59={};var _0x5268db;var _0x43e060;return db[_0xdd4f('0x41')][_0xdd4f('0x6c')]({'where':{'id':_0x318f66[_0xdd4f('0x5c')]['id']}})[_0xdd4f('0x1f')](handleEntityNotFound(_0xdcc637,null))['then'](function(_0x1aba38){if(_0x1aba38){_0x5268db=_0x1aba38;_0x562d59['model']=_['keys'](db[_0xdd4f('0x96')][_0xdd4f('0x42')]);_0x562d59['query']=_[_0xdd4f('0x48')](_0x318f66['query']);_0x562d59[_0xdd4f('0x49')]=_[_0xdd4f('0x4b')](_0x562d59[_0xdd4f('0x46')],_0x562d59[_0xdd4f('0x47')]);_0x4e47f7['attributes']=_[_0xdd4f('0x4b')](_0x562d59[_0xdd4f('0x46')],qs[_0xdd4f('0x4c')](_0x318f66[_0xdd4f('0x47')][_0xdd4f('0x4c')]));_0x4e47f7[_0xdd4f('0x4a')]=_0x4e47f7[_0xdd4f('0x4a')]['length']?_0x4e47f7['attributes']:_0x562d59[_0xdd4f('0x46')];_0x4e47f7[_0xdd4f('0x50')]=qs[_0xdd4f('0x51')](_0x318f66[_0xdd4f('0x47')][_0xdd4f('0x51')]);_0x4e47f7[_0xdd4f('0x54')]=qs['filters'](_[_0xdd4f('0x52')](_0x318f66[_0xdd4f('0x47')],_0x562d59[_0xdd4f('0x49')]));if(_0x318f66[_0xdd4f('0x47')][_0xdd4f('0x53')]){_0x4e47f7[_0xdd4f('0x54')]=_[_0xdd4f('0x55')](_0x4e47f7[_0xdd4f('0x54')],{'$or':_['map'](_0x4e47f7[_0xdd4f('0x4a')],function(_0x328fb1){var _0x1735c7={};_0x1735c7[_0x328fb1]={'$like':'%'+_0x318f66['query'][_0xdd4f('0x53')]+'%'};return _0x1735c7;})});}_0x4e47f7=_[_0xdd4f('0x55')]({},_0x4e47f7,_0x318f66[_0xdd4f('0x57')]);return _0x5268db[_0xdd4f('0x9a')](_0x4e47f7);}})[_0xdd4f('0x1f')](function(_0x540a4b){if(_0x540a4b){_0x43e060=_0x540a4b['length'];if(!_0x318f66[_0xdd4f('0x47')][_0xdd4f('0x4e')](_0xdd4f('0x4f'))){_0x4e47f7[_0xdd4f('0x2e')]=qs[_0xdd4f('0x2e')](_0x318f66[_0xdd4f('0x47')][_0xdd4f('0x2e')]);_0x4e47f7['offset']=qs[_0xdd4f('0x2d')](_0x318f66['query'][_0xdd4f('0x2d')]);}return _0x5268db['getApplications'](_0x4e47f7);}})[_0xdd4f('0x1f')](function(_0x10a96b){if(_0x10a96b){return _0x10a96b?{'count':_0x43e060,'rows':_0x10a96b}:null;}})[_0xdd4f('0x1f')](respondWithResult(_0xdcc637,null))['catch'](handleError(_0xdcc637,null));};exports['getMessages']=function(_0x3fd9cc,_0x1efcb2,_0x29e415){var _0x513282={'raw':!![],'where':{}};var _0x3a0505={};var _0x1a6089={'count':0x0,'rows':[]};return db['MailAccount'][_0xdd4f('0x6c')]({'where':{'id':_0x3fd9cc[_0xdd4f('0x5c')]['id']}})[_0xdd4f('0x1f')](handleEntityNotFound(_0x1efcb2,null))[_0xdd4f('0x1f')](function(_0x4f3614){if(_0x4f3614){_0x3a0505[_0xdd4f('0x46')]=_[_0xdd4f('0x48')](db[_0xdd4f('0x9b')][_0xdd4f('0x42')]);_0x3a0505['query']=_[_0xdd4f('0x48')](_0x3fd9cc[_0xdd4f('0x47')]);_0x3a0505['filters']=_[_0xdd4f('0x4b')](_0x3a0505['model'],_0x3a0505[_0xdd4f('0x47')]);_0x513282[_0xdd4f('0x4a')]=_[_0xdd4f('0x4b')](_0x3a0505[_0xdd4f('0x46')],qs[_0xdd4f('0x4c')](_0x3fd9cc[_0xdd4f('0x47')][_0xdd4f('0x4c')]));_0x513282[_0xdd4f('0x4a')]=_0x513282[_0xdd4f('0x4a')][_0xdd4f('0x4d')]?_0x513282[_0xdd4f('0x4a')]:_0x3a0505[_0xdd4f('0x46')];if(!_0x3fd9cc[_0xdd4f('0x47')][_0xdd4f('0x4e')](_0xdd4f('0x4f'))){_0x513282['limit']=qs['limit'](_0x3fd9cc['query'][_0xdd4f('0x2e')]);_0x513282[_0xdd4f('0x2d')]=qs[_0xdd4f('0x2d')](_0x3fd9cc[_0xdd4f('0x47')][_0xdd4f('0x2d')]);}_0x513282[_0xdd4f('0x50')]=qs['sort'](_0x3fd9cc[_0xdd4f('0x47')][_0xdd4f('0x51')]);_0x513282[_0xdd4f('0x54')]=qs[_0xdd4f('0x49')](_['pick'](_0x3fd9cc[_0xdd4f('0x47')],_0x3a0505[_0xdd4f('0x49')]));_0x513282['where'][_0xdd4f('0x63')]=_0x4f3614['id'];if(_0x3fd9cc[_0xdd4f('0x47')][_0xdd4f('0x53')]){_0x513282['where']=_[_0xdd4f('0x55')](_0x513282[_0xdd4f('0x54')],{'$or':_[_0xdd4f('0x40')](_0x513282[_0xdd4f('0x4a')],function(_0x41537a){var _0x5b1cb2={};_0x5b1cb2[_0x41537a]={'$like':'%'+_0x3fd9cc[_0xdd4f('0x47')][_0xdd4f('0x53')]+'%'};return _0x5b1cb2;})});}if(_0x3fd9cc[_0xdd4f('0x47')][_0xdd4f('0x9c')]){var _0x4f6f3b=_0x3fd9cc[_0xdd4f('0x47')]['$gte'][_0xdd4f('0x9d')](',');var _0x1b7aa0={};_0x1b7aa0[_0x4f6f3b[0x0]]={'$gte':moment(_0x4f6f3b[0x1])[_0xdd4f('0x9e')](_0xdd4f('0x9f'))};_0x513282['where']=_[_0xdd4f('0x55')](_0x513282[_0xdd4f('0x54')],_0x1b7aa0);}_0x513282=_[_0xdd4f('0x55')]({},_0x513282,_0x3fd9cc[_0xdd4f('0x57')]);return db[_0xdd4f('0x9b')][_0xdd4f('0x2c')]({'where':_0x513282[_0xdd4f('0x54')]})[_0xdd4f('0x1f')](function(_0x34a97c){_0x1a6089[_0xdd4f('0x2c')]=_0x34a97c;if(_0x3fd9cc[_0xdd4f('0x47')][_0xdd4f('0x58')]){_0x513282[_0xdd4f('0x59')]=[{'all':!![]}];}return db[_0xdd4f('0x9b')][_0xdd4f('0x66')](_0x513282);})[_0xdd4f('0x1f')](function(_0xc2c2a1){_0x1a6089[_0xdd4f('0x5a')]=_0xc2c2a1;return _0x1a6089;});}})[_0xdd4f('0x1f')](respondWithFilteredResult(_0x1efcb2,_0x513282))['catch'](handleError(_0x1efcb2,null));};exports[_0xdd4f('0x3a')]=function(_0x51df15,_0x2ef288,_0x221f71){var _0x1e57ff,_0x68d0cb={},_0x597a71;if(_0x51df15[_0xdd4f('0x60')]['to']){_0x597a71=_0x51df15[_0xdd4f('0x60')]['to'][_0xdd4f('0x9d')](',')[0x0];}return db[_0xdd4f('0x41')][_0xdd4f('0x5f')]({'where':{'id':_0x51df15[_0xdd4f('0x5c')]['id']},'include':[{'model':db[_0xdd4f('0xa0')],'as':_0xdd4f('0xa1'),'include':[{'model':db[_0xdd4f('0x8a')],'as':_0xdd4f('0xa2'),'where':{'email':_0x597a71},'limit':0x1,'order':[[_0xdd4f('0xa3'),_0xdd4f('0xa4')]]}]},{'model':db['MailServerOut'],'as':_0xdd4f('0x3e'),'raw':!![]}]})[_0xdd4f('0x1f')](handleEntityNotFound(_0x2ef288,null))[_0xdd4f('0x1f')](function(_0x4aec03){if(_0x4aec03){_0x1e57ff=_0x4aec03;if(_0x4aec03[_0xdd4f('0x3e')]){if(_[_0xdd4f('0x6f')](_0x51df15[_0xdd4f('0x60')][_0xdd4f('0xa5')])){_0x51df15[_0xdd4f('0x60')][_0xdd4f('0xa5')]=util[_0xdd4f('0x9e')](_0xdd4f('0xa6'),_0x4aec03[_0xdd4f('0x39')],_0x4aec03[_0xdd4f('0x6e')]||_0x4aec03['Smtp'][_0xdd4f('0x74')]);}if(_0x51df15['body']['attachments']&&_0x51df15[_0xdd4f('0x60')][_0xdd4f('0xa7')]['length']){for(var _0x9c447d=0x0;_0x9c447d<_0x51df15['body'][_0xdd4f('0xa7')][_0xdd4f('0x4d')];_0x9c447d+=0x1){_0x51df15[_0xdd4f('0x60')][_0xdd4f('0xa7')][_0x9c447d]={'filename':_0x51df15[_0xdd4f('0x60')][_0xdd4f('0xa7')][_0x9c447d][_0xdd4f('0x39')],'path':path[_0xdd4f('0xa8')](config['root'],_0xdd4f('0xa9'),_0x51df15[_0xdd4f('0x60')]['attachments'][_0x9c447d]['basename'])};}}var _0x7d020c={'tls':{'rejectUnauthorized':![]}};if(_[_0xdd4f('0x6f')](_0x4aec03[_0xdd4f('0x3e')]['service'])){if(_0x4aec03[_0xdd4f('0x3e')][_0xdd4f('0xaa')]){_0x7d020c[_0xdd4f('0xab')]={'user':_0x4aec03[_0xdd4f('0x3e')][_0xdd4f('0x74')],'pass':_0x4aec03[_0xdd4f('0x3e')]['pass']};}_0x7d020c[_0xdd4f('0x77')]=_0x4aec03[_0xdd4f('0x3e')][_0xdd4f('0x77')];_0x7d020c[_0xdd4f('0x78')]=_0x4aec03[_0xdd4f('0x3e')][_0xdd4f('0x78')];_0x7d020c['secure']=_0x4aec03[_0xdd4f('0x3e')]['secure'];}else{_0x7d020c[_0xdd4f('0x79')]=_0x4aec03[_0xdd4f('0x3e')][_0xdd4f('0x79')];_0x7d020c['auth']={'user':_0x4aec03[_0xdd4f('0x3e')][_0xdd4f('0x74')],'pass':_0x4aec03[_0xdd4f('0x3e')]['pass']};}return respondWithRpcPromise(_0xdd4f('0xac'),_0xdd4f('0xad'),{'account':_0x7d020c,'message':_0x51df15[_0xdd4f('0x60')]});}else{throw new Error('List\x20not\x20found');}}})[_0xdd4f('0x1f')](function(_0x100c82){if(_0x100c82){_0x68d0cb=_0x100c82;if(_0x1e57ff[_0xdd4f('0xa1')]){if(_0x1e57ff[_0xdd4f('0xa1')]['Contacts'][_0xdd4f('0x4d')]){return _0x1e57ff[_0xdd4f('0xa1')][_0xdd4f('0xa2')][0x0];}else{return db[_0xdd4f('0x8a')][_0xdd4f('0x65')](_[_0xdd4f('0x17')](_0x51df15[_0xdd4f('0x60')],{'firstName':_0x51df15['body']['to'],'email':_0x51df15[_0xdd4f('0x60')]['to'],'phone':_0x51df15[_0xdd4f('0x60')]['to'],'ListId':_0x1e57ff[_0xdd4f('0xae')]}));}}else{throw new Error('List\x20not\x20found');}}})['then'](function(_0x5b8514){if(_0x5b8514){var _0x2aa58b={'UserId':_0x51df15[_0xdd4f('0x74')]['id'],'ContactId':_0x5b8514['id'],'MailAccountId':_0x1e57ff['id'],'inReplyTo':_0x68d0cb['messageId'],'to':_0x51df15[_0xdd4f('0x60')][_0xdd4f('0xa5')],'cc':_0x51df15['body']['cc'],'subject':_0x51df15[_0xdd4f('0x60')]['subject'],'attach':_0x51df15['body'][_0xdd4f('0xaf')],'firstMsgDirection':_0xdd4f('0xb0'),'lastMsgAt':moment()['format'](_0xdd4f('0x9f')),'lastMsgDirection':_0xdd4f('0xb0'),'lastMsgBody':_0x51df15[_0xdd4f('0x60')][_0xdd4f('0x60')],'Messages':[_[_0xdd4f('0x55')](_0x51df15[_0xdd4f('0x60')],{'messageId':_0x68d0cb['messageId'],'sentAt':moment()[_0xdd4f('0x9e')](_0xdd4f('0x9f')),'read':!![],'MailAccountId':_0x1e57ff['id'],'UserId':_0x51df15[_0xdd4f('0x74')]['id'],'ContactId':_0x5b8514['id']})]};if(_0x51df15[_0xdd4f('0x60')][_0xdd4f('0xb1')]){_0x2aa58b=_[_0xdd4f('0x55')](_0x2aa58b,_0x51df15[_0xdd4f('0x60')][_0xdd4f('0xb1')]);}return db[_0xdd4f('0x89')][_0xdd4f('0x65')](_0x2aa58b,{'include':[{'model':db[_0xdd4f('0x9b')],'as':'Messages'}]});}})[_0xdd4f('0x1f')](respondWithResult(_0x2ef288,null))[_0xdd4f('0x29')](handleError(_0x2ef288,null));};exports['verifySmtp']=function(_0x4ec083,_0x253028,_0x4391e8){return db['MailAccount']['find']({'where':{'id':_0x4ec083['params']['id']},'include':[{'model':db[_0xdd4f('0x5d')],'as':_0xdd4f('0x3e'),'raw':!![]}]})['then'](handleEntityNotFound(_0x253028,null))[_0xdd4f('0x1f')](function(_0x208564){if(_0x208564&&_0x208564[_0xdd4f('0x3e')]){var _0x19b3d2={'id':_0x208564['id'],'tls':{'rejectUnauthorized':![]}};if(_0x208564['Smtp']['service']){_0x19b3d2[_0xdd4f('0x79')]=_0x208564[_0xdd4f('0x3e')][_0xdd4f('0x79')];}else{_0x19b3d2['host']=_0x208564['Smtp']['host'];_0x19b3d2['port']=_0x208564[_0xdd4f('0x3e')][_0xdd4f('0x78')];_0x19b3d2[_0xdd4f('0xb2')]=_0x208564[_0xdd4f('0x3e')][_0xdd4f('0xb2')];}if(_0x208564[_0xdd4f('0x3e')][_0xdd4f('0xaa')]){_0x19b3d2[_0xdd4f('0xab')]={'user':_0x208564['Smtp'][_0xdd4f('0x74')],'pass':_0x208564[_0xdd4f('0x3e')][_0xdd4f('0x7a')]};}return respondWithRpcPromise(_0xdd4f('0xb3'),_0xdd4f('0xb4'),{'account':_0x19b3d2});}})['then'](respondWithResult(_0x253028,null))['catch'](handleError(_0x253028,null));};exports[_0xdd4f('0x34')]=function(_0x397da7,_0x170326){return db[_0xdd4f('0x41')]['find']({'where':{'id':_0x397da7[_0xdd4f('0x5c')]['id']}})[_0xdd4f('0x1f')](handleEntityNotFound(_0x170326,null))['then'](function(_0x10dd2a){if(_0x10dd2a&&_0x10dd2a[_0xdd4f('0x79')]){throw new db[(_0xdd4f('0x1c'))]['ValidationError']('You\x20can\x27t\x20remove\x20the\x20mail\x20service\x20account');}return _0x10dd2a;})['then'](removeEntity(_0x170326,null))[_0xdd4f('0x29')](handleError(_0x170326,null));};exports[_0xdd4f('0xb5')]=function(_0x20aaef,_0x1dfbe6,_0x204ef7){return db['MailAccount'][_0xdd4f('0x5f')]({'where':{'id':_0x20aaef[_0xdd4f('0x5c')]['id']}})['then'](handleEntityNotFound(_0x1dfbe6,null))[_0xdd4f('0x1f')](function(_0x3c1cd7){if(_0x3c1cd7){return _0x3c1cd7[_0xdd4f('0xb5')](_0x20aaef['body'][_0xdd4f('0x68')],_[_0xdd4f('0xb6')](_0x20aaef['body'],['ids','id'])||{})[_0xdd4f('0xb7')](function(_0x3eed91){for(var _0x48192b=0x0;_0x48192b<_0x20aaef[_0xdd4f('0x60')][_0xdd4f('0x68')][_0xdd4f('0x4d')];_0x48192b+=0x1){socket[_0xdd4f('0xb8')]('userMailAccount:save',{'UserId':_0x20aaef['body'][_0xdd4f('0x68')][_0x48192b],'MailAccountId':_0x20aaef[_0xdd4f('0x5c')]['id']});}return _0x3eed91;});}})[_0xdd4f('0x1f')](respondWithResult(_0x1dfbe6,null))[_0xdd4f('0x29')](handleError(_0x1dfbe6,null));};exports[_0xdd4f('0xb9')]=function(_0x4d9f56,_0x7183b,_0x20b497){return db[_0xdd4f('0x41')]['find']({'where':{'id':_0x4d9f56['params']['id']}})['then'](handleEntityNotFound(_0x7183b,null))['then'](function(_0xb2c184){if(_0xb2c184){return _0xb2c184[_0xdd4f('0xb9')](_0x4d9f56[_0xdd4f('0x47')][_0xdd4f('0x68')])['then'](function(){if(_[_0xdd4f('0xba')](_0x4d9f56['query'][_0xdd4f('0x68')])){for(var _0x381651=0x0;_0x381651<_0x4d9f56[_0xdd4f('0x47')][_0xdd4f('0x68')]['length'];_0x381651+=0x1){socket[_0xdd4f('0xb8')](_0xdd4f('0xbb'),{'UserId':Number(_0x4d9f56['query']['ids'][_0x381651]),'MailAccountId':Number(_0x4d9f56[_0xdd4f('0x5c')]['id'])});}}else{socket[_0xdd4f('0xb8')](_0xdd4f('0xbb'),{'UserId':Number(_0x4d9f56['query'][_0xdd4f('0x68')]),'MailAccountId':Number(_0x4d9f56[_0xdd4f('0x5c')]['id'])});}});}})[_0xdd4f('0x1f')](respondWithStatusCode(_0x7183b,null))['catch'](handleError(_0x7183b,null));};exports[_0xdd4f('0xbc')]=function(_0x54c218,_0x38de16,_0x5ab983){var _0x5ba995={};var _0x2365f1={};var _0x4f004a;var _0x1ff81f;return db[_0xdd4f('0x41')][_0xdd4f('0x6c')]({'where':{'id':_0x54c218[_0xdd4f('0x5c')]['id']}})[_0xdd4f('0x1f')](handleEntityNotFound(_0x38de16,null))[_0xdd4f('0x1f')](function(_0x389e7f){if(_0x389e7f){_0x4f004a=_0x389e7f;_0x2365f1['model']=_['keys'](db[_0xdd4f('0x8c')]['rawAttributes']);_0x2365f1[_0xdd4f('0x47')]=_[_0xdd4f('0x48')](_0x54c218[_0xdd4f('0x47')]);_0x2365f1['filters']=_['intersection'](_0x2365f1[_0xdd4f('0x46')],_0x2365f1['query']);_0x5ba995[_0xdd4f('0x4a')]=_[_0xdd4f('0x4b')](_0x2365f1[_0xdd4f('0x46')],qs[_0xdd4f('0x4c')](_0x54c218[_0xdd4f('0x47')][_0xdd4f('0x4c')]));_0x5ba995[_0xdd4f('0x4a')]=_0x5ba995[_0xdd4f('0x4a')][_0xdd4f('0x4d')]?_0x5ba995[_0xdd4f('0x4a')]:_0x2365f1[_0xdd4f('0x46')];_0x5ba995[_0xdd4f('0x50')]=qs['sort'](_0x54c218['query'][_0xdd4f('0x51')]);_0x5ba995[_0xdd4f('0x54')]=qs[_0xdd4f('0x49')](_['pick'](_0x54c218[_0xdd4f('0x47')],_0x2365f1['filters']));if(_0x54c218[_0xdd4f('0x47')]['filter']){_0x5ba995[_0xdd4f('0x54')]=_[_0xdd4f('0x55')](_0x5ba995['where'],{'$or':_['map'](_0x5ba995[_0xdd4f('0x4a')],function(_0x3335d1){var _0x3e86e9={};_0x3e86e9[_0x3335d1]={'$like':'%'+_0x54c218[_0xdd4f('0x47')][_0xdd4f('0x53')]+'%'};return _0x3e86e9;})});}_0x5ba995=_[_0xdd4f('0x55')]({},_0x5ba995,_0x54c218[_0xdd4f('0x57')]);return _0x4f004a['getAgents'](_0x5ba995);}})[_0xdd4f('0x1f')](function(_0x21efd1){if(_0x21efd1){_0x1ff81f=_0x21efd1[_0xdd4f('0x4d')];if(!_0x54c218[_0xdd4f('0x47')][_0xdd4f('0x4e')]('nolimit')){_0x5ba995['limit']=qs[_0xdd4f('0x2e')](_0x54c218[_0xdd4f('0x47')]['limit']);_0x5ba995[_0xdd4f('0x2d')]=qs[_0xdd4f('0x2d')](_0x54c218[_0xdd4f('0x47')][_0xdd4f('0x2d')]);}return _0x4f004a[_0xdd4f('0xbc')](_0x5ba995);}})[_0xdd4f('0x1f')](function(_0x3ae495){if(_0x3ae495){return _0x3ae495?{'count':_0x1ff81f,'rows':_0x3ae495}:null;}})[_0xdd4f('0x1f')](respondWithResult(_0x38de16,null))['catch'](handleError(_0x38de16,null));};
\ No newline at end of file
+var _0xfa60=['server/files/attachments','basename','auth','secure','SendMail','sendMail','List\x20not\x20found','List','subject','attach','out','messageId','Interaction','Messages','verifySmtp','VerifySmtp','Sequelize','addAgents','omit','spread','removeAgents','isArray','emit','userMailAccount:remove','getAgents','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','moment','bluebird','mustache','util','path','to-csv','lodash','squel','crypto','jsforce','desk.js','papaparse','ioredis','../../components/auth/service','../../config/license/hardware','api','../../mysqldb','redis','defaults','socket.io-emitter','./mailAccount.socket','register','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~!@#$%^&-_=+[{]}.','info','request\x20sent','debug','MailAccount,\x20%s,\x20%s,\x20%s','stringify','error','code','MailAccount,\x20%s,\x20%s','message','result','sendStatus','status','json','count','offset','limit','set','reject','save','update','then','destroy','get','MailAccounts','end','stack','name','index','MailServerIn','Imap','Smtp','Pause','mandatoryDispositionPause','MailAccount','rawAttributes','fieldName','key','keys','intersection','model','attributes','fields','query','hasOwnProperty','nolimit','order','sort','where','filters','type','filter','merge','includeAll','findAll','rows','show','MailServerOut','length','include','options','find','catch','body','params','describe','addDisposition','MailAccountId','Disposition','create','getDispositions','findOne','pick','map','removeDispositions','ids','addAnswer','CannedAnswer','getAnswers','removeAnswers','email','ListId','active','description','isNil','cauthentication','user','cuser','password','pass','authentication','host','port','service','cservice','cpassword','Unable\x20to\x20retrieve\x20the\x20current\x20user','UserProfileSection','autoAssociation','UserProfileResource','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','getImap','removeImap','getSmtp','addSmtp','removeSmtp','setSmtp','addInteraction','MailInteraction','getInteractions','CmContact','Contact','User','Owner','fullname','internal','Tag','Tags','color','tag','addApplications','sequelize','transaction','MailApplication','findAndCountAll','priority','getApplications','getMessages','$gte','split','format','YYYY-MM-DD\x20HH:mm:ss','MailMessage','send','CmList','Contacts','DESC','from','%s\x20<%s>','attachments','join','root'];(function(_0x5837e7,_0x35de4f){var _0x537783=function(_0x4cce5d){while(--_0x4cce5d){_0x5837e7['push'](_0x5837e7['shift']());}};_0x537783(++_0x35de4f);}(_0xfa60,0x1a7));var _0x0fa6=function(_0x9c2d53,_0x199005){_0x9c2d53=_0x9c2d53-0x0;var _0x51e402=_0xfa60[_0x9c2d53];return _0x51e402;};'use strict';var pdf=require('html-pdf');var emlformat=require(_0x0fa6('0x0'));var rimraf=require(_0x0fa6('0x1'));var zipdir=require(_0x0fa6('0x2'));var jsonpatch=require(_0x0fa6('0x3'));var rp=require(_0x0fa6('0x4'));var moment=require(_0x0fa6('0x5'));var BPromise=require(_0x0fa6('0x6'));var Mustache=require(_0x0fa6('0x7'));var util=require(_0x0fa6('0x8'));var path=require(_0x0fa6('0x9'));var sox=require('sox');var csv=require(_0x0fa6('0xa'));var ejs=require('ejs');var fs=require('fs');var _=require(_0x0fa6('0xb'));var squel=require(_0x0fa6('0xc'));var crypto=require(_0x0fa6('0xd'));var jsforce=require(_0x0fa6('0xe'));var deskjs=require(_0x0fa6('0xf'));var toCsv=require(_0x0fa6('0xa'));var querystring=require('querystring');var Papa=require(_0x0fa6('0x10'));var Redis=require(_0x0fa6('0x11'));var authService=require(_0x0fa6('0x12'));var qs=require('../../components/parsers/qs');var as=require('../../components/parsers/advancedSearch');var hardwareService=require(_0x0fa6('0x13'));var logger=require('../../config/logger')(_0x0fa6('0x14'));var utils=require('../../config/utils');var config=require('../../config/environment');var db=require(_0x0fa6('0x15'))['db'];config[_0x0fa6('0x16')]=_[_0x0fa6('0x17')](config[_0x0fa6('0x16')],{'host':'localhost','port':0x18eb});var socket=require(_0x0fa6('0x18'))(new Redis(config[_0x0fa6('0x16')]));require(_0x0fa6('0x19'))[_0x0fa6('0x1a')](socket);var jayson=require(_0x0fa6('0x1b'));var client=jayson[_0x0fa6('0x1c')][_0x0fa6('0x1d')]({'port':0x232b});function checkPasswordPattern(_0x3318c0,_0x291e88,_0x1beb84){if(_0x1beb84){var _0xd205e8=new RegExp(/(?=.*[a-z])(?=.*[A-Z])(?=.*[0-9])(?=.*[?!@#\$%\^&\*~\-_=+[{\]\}])(?=.{8,})/);if(_0xd205e8[_0x0fa6('0x1e')](_0x291e88)){return _0x3318c0;}else{throw new db['Sequelize'][(_0x0fa6('0x1f'))](_0x0fa6('0x20'));}}else{return _0x3318c0;}}function respondWithRpcPromise(_0xb489c1,_0x5064fd,_0x1dc61d,_0xcd4008){return new BPromise(function(_0x47f2b5,_0x40726d){var _0x3c39b1=_0xcd4008||client;return _0x3c39b1['request'](_0xb489c1,_0x1dc61d)['then'](function(_0x5b18e0){logger[_0x0fa6('0x21')]('MailAccount,\x20%s,\x20%s',_0x5064fd,_0x0fa6('0x22'));logger[_0x0fa6('0x23')](_0x0fa6('0x24'),_0x5064fd,'request\x20sent',JSON[_0x0fa6('0x25')](_0x5b18e0));if(_0x5b18e0['error']){if(_0x5b18e0[_0x0fa6('0x26')][_0x0fa6('0x27')]===0x1f4){logger[_0x0fa6('0x26')](_0x0fa6('0x28'),_0x5064fd,_0x5b18e0[_0x0fa6('0x26')]['message']);return _0x40726d(_0x5b18e0[_0x0fa6('0x26')][_0x0fa6('0x29')]);}logger[_0x0fa6('0x26')]('MailAccount,\x20%s,\x20%s',_0x5064fd,_0x5b18e0[_0x0fa6('0x26')][_0x0fa6('0x29')]);return _0x47f2b5(_0x5b18e0[_0x0fa6('0x26')][_0x0fa6('0x29')]);}else{logger[_0x0fa6('0x21')](_0x0fa6('0x28'),_0x5064fd,_0x0fa6('0x22'));_0x47f2b5(_0x5b18e0[_0x0fa6('0x2a')][_0x0fa6('0x29')]);}})['catch'](function(_0x1c9c8f){logger[_0x0fa6('0x26')]('MailAccount,\x20%s,\x20%s',_0x5064fd,_0x1c9c8f);_0x40726d(_0x1c9c8f);});});}function respondWithStatusCode(_0x42d433,_0x120f05){_0x120f05=_0x120f05||0xcc;return function(_0x2dbf0e){if(_0x2dbf0e){return _0x42d433[_0x0fa6('0x2b')](_0x120f05);}return _0x42d433[_0x0fa6('0x2c')](_0x120f05)['end']();};}function respondWithResult(_0x1daf5d,_0x4dcac0){_0x4dcac0=_0x4dcac0||0xc8;return function(_0x2a2523){if(_0x2a2523){return _0x1daf5d[_0x0fa6('0x2c')](_0x4dcac0)[_0x0fa6('0x2d')](_0x2a2523);}};}function respondWithFilteredResult(_0x3ea2c3,_0x1437c7){return function(_0x1bdb36){if(_0x1bdb36){var _0x212019=_0x1bdb36[_0x0fa6('0x2e')],_0x1787c5=_0x1437c7['offset'],_0xfcab72=_0x1437c7[_0x0fa6('0x2f')]+_0x1437c7[_0x0fa6('0x30')],_0x136af5;if(_0xfcab72>=_0x212019){_0xfcab72=_0x212019;_0x136af5=0xc8;}else{_0x136af5=0xce;}_0x3ea2c3[_0x0fa6('0x2c')](_0x136af5);return _0x3ea2c3[_0x0fa6('0x31')]('Content-Range',_0x1787c5+'-'+_0xfcab72+'/'+_0x212019)[_0x0fa6('0x2d')](_0x1bdb36);}return null;};}function patchUpdates(_0x8c172){return function(_0x1a8ece){try{jsonpatch['apply'](_0x1a8ece,_0x8c172,!![]);}catch(_0x38d975){return BPromise[_0x0fa6('0x32')](_0x38d975);}return _0x1a8ece[_0x0fa6('0x33')]();};}function saveUpdates(_0x448fd4,_0x125172){return function(_0x522d4f){if(_0x522d4f){return _0x522d4f[_0x0fa6('0x34')](_0x448fd4)[_0x0fa6('0x35')](function(_0x2dc2b1){return _0x2dc2b1;});}return null;};}function removeEntity(_0x4cf419,_0x5addac){return function(_0x5b3b38){if(_0x5b3b38){return _0x5b3b38[_0x0fa6('0x36')]()[_0x0fa6('0x35')](function(){var _0x319385=_0x5b3b38[_0x0fa6('0x37')]({'plain':!![]});var _0x191398=_0x0fa6('0x38');return db['UserProfileResource'][_0x0fa6('0x36')]({'where':{'type':_0x191398,'resourceId':_0x319385['id']}})[_0x0fa6('0x35')](function(){return _0x5b3b38;});})['then'](function(){_0x4cf419['status'](0xcc)[_0x0fa6('0x39')]();});}};}function handleEntityNotFound(_0x559ae5,_0x1bf5c8){return function(_0x290e5f){if(!_0x290e5f){_0x559ae5[_0x0fa6('0x2b')](0x194);}return _0x290e5f;};}function handleError(_0x5d7128,_0xcae486){_0xcae486=_0xcae486||0x1f4;return function(_0x30df0c){logger[_0x0fa6('0x26')](_0x30df0c[_0x0fa6('0x3a')]);if(_0x30df0c[_0x0fa6('0x3b')]){delete _0x30df0c[_0x0fa6('0x3b')];}_0x5d7128[_0x0fa6('0x2c')](_0xcae486)['send'](_0x30df0c);};}exports[_0x0fa6('0x3c')]=function(_0x241e13,_0x199c82){var _0x5e4ccf={'include':[{'model':db[_0x0fa6('0x3d')],'as':_0x0fa6('0x3e')},{'model':db['MailServerOut'],'as':_0x0fa6('0x3f')},{'model':db[_0x0fa6('0x40')],'as':_0x0fa6('0x41')}]},_0x3611f1={},_0x5bcb5e={'count':0x0,'rows':[]};var _0x184c66=_['map'](db[_0x0fa6('0x42')][_0x0fa6('0x43')],function(_0x5de715){return{'name':_0x5de715[_0x0fa6('0x44')],'type':_0x5de715['type'][_0x0fa6('0x45')]};});_0x3611f1['model']=_['map'](_0x184c66,_0x0fa6('0x3b'));_0x3611f1['query']=_[_0x0fa6('0x46')](_0x241e13['query']);_0x3611f1['filters']=_[_0x0fa6('0x47')](_0x3611f1[_0x0fa6('0x48')],_0x3611f1['query']);_0x5e4ccf[_0x0fa6('0x49')]=_[_0x0fa6('0x47')](_0x3611f1[_0x0fa6('0x48')],qs[_0x0fa6('0x4a')](_0x241e13['query'][_0x0fa6('0x4a')]));_0x5e4ccf[_0x0fa6('0x49')]=_0x5e4ccf[_0x0fa6('0x49')]['length']?_0x5e4ccf[_0x0fa6('0x49')]:_0x3611f1[_0x0fa6('0x48')];if(!_0x241e13[_0x0fa6('0x4b')][_0x0fa6('0x4c')](_0x0fa6('0x4d'))){_0x5e4ccf['limit']=qs['limit'](_0x241e13[_0x0fa6('0x4b')]['limit']);_0x5e4ccf[_0x0fa6('0x2f')]=qs[_0x0fa6('0x2f')](_0x241e13[_0x0fa6('0x4b')][_0x0fa6('0x2f')]);}_0x5e4ccf[_0x0fa6('0x4e')]=qs[_0x0fa6('0x4f')](_0x241e13[_0x0fa6('0x4b')][_0x0fa6('0x4f')]);_0x5e4ccf[_0x0fa6('0x50')]=qs[_0x0fa6('0x51')](_['pick'](_0x241e13[_0x0fa6('0x4b')],_0x3611f1[_0x0fa6('0x51')]));if(_0x241e13[_0x0fa6('0x4b')]['filter']){_0x5e4ccf['where']=_['merge'](_0x5e4ccf[_0x0fa6('0x50')],{'$or':_['map'](_0x184c66,function(_0x33ccd6){if(_0x33ccd6[_0x0fa6('0x52')]!=='VIRTUAL'){var _0x3d4de0={};_0x3d4de0[_0x33ccd6['name']]={'$like':'%'+_0x241e13[_0x0fa6('0x4b')][_0x0fa6('0x53')]+'%'};return _0x3d4de0;}})});}_0x5e4ccf=_[_0x0fa6('0x54')]({},_0x5e4ccf,_0x241e13['options']);var _0x3a737e={'where':_0x5e4ccf[_0x0fa6('0x50')]};return db['MailAccount'][_0x0fa6('0x2e')](_0x3a737e)[_0x0fa6('0x35')](function(_0x2974a9){_0x5bcb5e[_0x0fa6('0x2e')]=_0x2974a9;if(_0x241e13[_0x0fa6('0x4b')][_0x0fa6('0x55')]){_0x5e4ccf['include']=[{'all':!![]}];}return db[_0x0fa6('0x42')][_0x0fa6('0x56')](_0x5e4ccf);})['then'](function(_0x2068df){_0x5bcb5e[_0x0fa6('0x57')]=_0x2068df;return _0x5bcb5e;})[_0x0fa6('0x35')](respondWithFilteredResult(_0x199c82,_0x5e4ccf))['catch'](handleError(_0x199c82,null));};exports[_0x0fa6('0x58')]=function(_0x2622a7,_0x1e2579){var _0xdac4fe={'raw':![],'where':{'id':_0x2622a7['params']['id']},'include':[{'model':db[_0x0fa6('0x3d')],'as':_0x0fa6('0x3e')},{'model':db[_0x0fa6('0x59')],'as':'Smtp'},{'model':db[_0x0fa6('0x40')],'as':'mandatoryDispositionPause'}]},_0x429c2d={};_0x429c2d[_0x0fa6('0x48')]=_[_0x0fa6('0x46')](db[_0x0fa6('0x42')]['rawAttributes']);_0x429c2d[_0x0fa6('0x4b')]=_[_0x0fa6('0x46')](_0x2622a7['query']);_0x429c2d[_0x0fa6('0x51')]=_[_0x0fa6('0x47')](_0x429c2d[_0x0fa6('0x48')],_0x429c2d[_0x0fa6('0x4b')]);_0xdac4fe[_0x0fa6('0x49')]=_[_0x0fa6('0x47')](_0x429c2d[_0x0fa6('0x48')],qs[_0x0fa6('0x4a')](_0x2622a7['query'][_0x0fa6('0x4a')]));_0xdac4fe[_0x0fa6('0x49')]=_0xdac4fe['attributes'][_0x0fa6('0x5a')]?_0xdac4fe[_0x0fa6('0x49')]:_0x429c2d[_0x0fa6('0x48')];if(_0x2622a7[_0x0fa6('0x4b')][_0x0fa6('0x55')]){_0xdac4fe[_0x0fa6('0x5b')]=[{'all':!![]}];}_0xdac4fe=_[_0x0fa6('0x54')]({},_0xdac4fe,_0x2622a7[_0x0fa6('0x5c')]);return db[_0x0fa6('0x42')][_0x0fa6('0x5d')](_0xdac4fe)[_0x0fa6('0x35')](handleEntityNotFound(_0x1e2579,null))['then'](respondWithResult(_0x1e2579,null))[_0x0fa6('0x5e')](handleError(_0x1e2579,null));};exports[_0x0fa6('0x34')]=function(_0x1084ab,_0x2716b3){if(_0x1084ab[_0x0fa6('0x5f')]['id']){delete _0x1084ab[_0x0fa6('0x5f')]['id'];}return db[_0x0fa6('0x42')][_0x0fa6('0x5d')]({'where':{'id':_0x1084ab[_0x0fa6('0x60')]['id']},'include':[{'model':db[_0x0fa6('0x3d')],'as':_0x0fa6('0x3e')},{'model':db[_0x0fa6('0x59')],'as':'Smtp'},{'model':db[_0x0fa6('0x40')],'as':'mandatoryDispositionPause'}]})[_0x0fa6('0x35')](handleEntityNotFound(_0x2716b3,null))[_0x0fa6('0x35')](saveUpdates(_0x1084ab[_0x0fa6('0x5f')],null))[_0x0fa6('0x35')](function(_0x20596f){if(_0x20596f&&_0x1084ab['body'][_0x0fa6('0x3e')]){return db[_0x0fa6('0x3d')]['update'](_0x1084ab[_0x0fa6('0x5f')][_0x0fa6('0x3e')],{'where':{'MailAccountId':_0x20596f['id']}})['then'](function(){return _0x20596f;});}return _0x20596f;})[_0x0fa6('0x35')](function(_0x2d0aef){if(_0x2d0aef&&_0x1084ab[_0x0fa6('0x5f')][_0x0fa6('0x3f')]){return db[_0x0fa6('0x59')]['update'](_0x1084ab[_0x0fa6('0x5f')]['Smtp'],{'where':{'MailAccountId':_0x2d0aef['id']}})['then'](function(){return _0x2d0aef;});}return _0x2d0aef;})[_0x0fa6('0x35')](respondWithResult(_0x2716b3,null))[_0x0fa6('0x5e')](handleError(_0x2716b3,null));};exports[_0x0fa6('0x61')]=function(_0x51cb24,_0x368bb6){return db[_0x0fa6('0x42')][_0x0fa6('0x61')]()[_0x0fa6('0x35')](respondWithResult(_0x368bb6,null))['catch'](handleError(_0x368bb6,null));};exports[_0x0fa6('0x62')]=function(_0x33d632,_0x5598f4,_0x2b5266){if(_0x33d632[_0x0fa6('0x5f')]['id']){delete _0x33d632[_0x0fa6('0x5f')]['id'];}return db['MailAccount'][_0x0fa6('0x5d')]({'where':{'id':_0x33d632['params']['id']}})[_0x0fa6('0x35')](handleEntityNotFound(_0x5598f4,null))[_0x0fa6('0x35')](function(_0x43c464){if(_0x43c464){_0x33d632['body'][_0x0fa6('0x63')]=_0x43c464['id'];return db[_0x0fa6('0x64')][_0x0fa6('0x65')](_0x33d632[_0x0fa6('0x5f')]);}})['then'](respondWithResult(_0x5598f4,null))[_0x0fa6('0x5e')](handleError(_0x5598f4,null));};exports[_0x0fa6('0x66')]=function(_0x3f0103,_0xfc2de3,_0x11a1a7){var _0x318f14={'raw':![],'where':{}};var _0x29b20f={};var _0x68ca09={'count':0x0,'rows':[]};return db['MailAccount'][_0x0fa6('0x67')]({'where':{'id':_0x3f0103[_0x0fa6('0x60')]['id']}})[_0x0fa6('0x35')](handleEntityNotFound(_0xfc2de3,null))[_0x0fa6('0x35')](function(_0xbeac00){if(_0xbeac00){_0x29b20f['model']=_[_0x0fa6('0x46')](db[_0x0fa6('0x64')][_0x0fa6('0x43')]);_0x29b20f[_0x0fa6('0x4b')]=_[_0x0fa6('0x46')](_0x3f0103[_0x0fa6('0x4b')]);_0x29b20f['filters']=_[_0x0fa6('0x47')](_0x29b20f['model'],_0x29b20f['query']);_0x318f14[_0x0fa6('0x49')]=_['intersection'](_0x29b20f[_0x0fa6('0x48')],qs[_0x0fa6('0x4a')](_0x3f0103[_0x0fa6('0x4b')][_0x0fa6('0x4a')]));_0x318f14[_0x0fa6('0x49')]=_0x318f14[_0x0fa6('0x49')][_0x0fa6('0x5a')]?_0x318f14['attributes']:_0x29b20f['model'];if(!_0x3f0103[_0x0fa6('0x4b')][_0x0fa6('0x4c')](_0x0fa6('0x4d'))){_0x318f14['limit']=qs[_0x0fa6('0x30')](_0x3f0103[_0x0fa6('0x4b')]['limit']);_0x318f14[_0x0fa6('0x2f')]=qs['offset'](_0x3f0103[_0x0fa6('0x4b')][_0x0fa6('0x2f')]);}_0x318f14['order']=qs[_0x0fa6('0x4f')](_0x3f0103['query']['sort']);_0x318f14['where']=qs[_0x0fa6('0x51')](_[_0x0fa6('0x68')](_0x3f0103[_0x0fa6('0x4b')],_0x29b20f[_0x0fa6('0x51')]));_0x318f14[_0x0fa6('0x50')][_0x0fa6('0x63')]=_0xbeac00['id'];if(_0x3f0103[_0x0fa6('0x4b')][_0x0fa6('0x53')]){_0x318f14[_0x0fa6('0x50')]=_[_0x0fa6('0x54')](_0x318f14[_0x0fa6('0x50')],{'$or':_[_0x0fa6('0x69')](_0x318f14[_0x0fa6('0x49')],function(_0x1488cb){var _0x330f76={};_0x330f76[_0x1488cb]={'$like':'%'+_0x3f0103[_0x0fa6('0x4b')][_0x0fa6('0x53')]+'%'};return _0x330f76;})});}_0x318f14=_['merge']({},_0x318f14,_0x3f0103['options']);return db['Disposition'][_0x0fa6('0x2e')]({'where':_0x318f14[_0x0fa6('0x50')]})[_0x0fa6('0x35')](function(_0x27548c){_0x68ca09[_0x0fa6('0x2e')]=_0x27548c;if(_0x3f0103[_0x0fa6('0x4b')][_0x0fa6('0x55')]){_0x318f14[_0x0fa6('0x5b')]=[{'all':!![]}];}return db[_0x0fa6('0x64')][_0x0fa6('0x56')](_0x318f14);})['then'](function(_0x5d9b34){_0x68ca09[_0x0fa6('0x57')]=_0x5d9b34;return _0x68ca09;});}})[_0x0fa6('0x35')](respondWithFilteredResult(_0xfc2de3,_0x318f14))[_0x0fa6('0x5e')](handleError(_0xfc2de3,null));};exports[_0x0fa6('0x6a')]=function(_0x2a8bb5,_0x58abc0,_0x313a04){return db['MailAccount'][_0x0fa6('0x5d')]({'where':{'id':_0x2a8bb5['params']['id']}})[_0x0fa6('0x35')](handleEntityNotFound(_0x58abc0,null))['then'](function(_0x740af4){if(_0x740af4){return _0x740af4[_0x0fa6('0x6a')](_0x2a8bb5[_0x0fa6('0x4b')][_0x0fa6('0x6b')]);}})[_0x0fa6('0x35')](respondWithStatusCode(_0x58abc0,null))[_0x0fa6('0x5e')](handleError(_0x58abc0,null));};exports[_0x0fa6('0x6c')]=function(_0x1f153b,_0x36b7bc,_0x1cd319){if(_0x1f153b[_0x0fa6('0x5f')]['id']){delete _0x1f153b['body']['id'];}return db[_0x0fa6('0x42')][_0x0fa6('0x5d')]({'where':{'id':_0x1f153b[_0x0fa6('0x60')]['id']}})['then'](handleEntityNotFound(_0x36b7bc,null))[_0x0fa6('0x35')](function(_0x546adf){if(_0x546adf){_0x1f153b[_0x0fa6('0x5f')]['MailAccountId']=_0x546adf['id'];return db[_0x0fa6('0x6d')]['create'](_0x1f153b[_0x0fa6('0x5f')]);}})[_0x0fa6('0x35')](respondWithResult(_0x36b7bc,null))[_0x0fa6('0x5e')](handleError(_0x36b7bc,null));};exports[_0x0fa6('0x6e')]=function(_0xb50ba8,_0x48bcb3,_0x2fa56e){var _0x4f1b62={'raw':![],'where':{}};var _0x188200={};var _0x5d1013={'count':0x0,'rows':[]};return db['MailAccount'][_0x0fa6('0x67')]({'where':{'id':_0xb50ba8[_0x0fa6('0x60')]['id']}})[_0x0fa6('0x35')](handleEntityNotFound(_0x48bcb3,null))['then'](function(_0x1236aa){if(_0x1236aa){_0x188200[_0x0fa6('0x48')]=_[_0x0fa6('0x46')](db['CannedAnswer'][_0x0fa6('0x43')]);_0x188200[_0x0fa6('0x4b')]=_[_0x0fa6('0x46')](_0xb50ba8[_0x0fa6('0x4b')]);_0x188200[_0x0fa6('0x51')]=_[_0x0fa6('0x47')](_0x188200[_0x0fa6('0x48')],_0x188200['query']);_0x4f1b62[_0x0fa6('0x49')]=_[_0x0fa6('0x47')](_0x188200[_0x0fa6('0x48')],qs[_0x0fa6('0x4a')](_0xb50ba8['query'][_0x0fa6('0x4a')]));_0x4f1b62['attributes']=_0x4f1b62[_0x0fa6('0x49')][_0x0fa6('0x5a')]?_0x4f1b62['attributes']:_0x188200[_0x0fa6('0x48')];if(!_0xb50ba8[_0x0fa6('0x4b')][_0x0fa6('0x4c')]('nolimit')){_0x4f1b62[_0x0fa6('0x30')]=qs[_0x0fa6('0x30')](_0xb50ba8[_0x0fa6('0x4b')]['limit']);_0x4f1b62[_0x0fa6('0x2f')]=qs[_0x0fa6('0x2f')](_0xb50ba8[_0x0fa6('0x4b')][_0x0fa6('0x2f')]);}_0x4f1b62[_0x0fa6('0x4e')]=qs[_0x0fa6('0x4f')](_0xb50ba8[_0x0fa6('0x4b')][_0x0fa6('0x4f')]);_0x4f1b62[_0x0fa6('0x50')]=qs['filters'](_[_0x0fa6('0x68')](_0xb50ba8[_0x0fa6('0x4b')],_0x188200[_0x0fa6('0x51')]));_0x4f1b62[_0x0fa6('0x50')]['MailAccountId']=_0x1236aa['id'];if(_0xb50ba8[_0x0fa6('0x4b')]['filter']){_0x4f1b62[_0x0fa6('0x50')]=_[_0x0fa6('0x54')](_0x4f1b62[_0x0fa6('0x50')],{'$or':_[_0x0fa6('0x69')](_0x4f1b62[_0x0fa6('0x49')],function(_0x29722e){var _0x3f8250={};_0x3f8250[_0x29722e]={'$like':'%'+_0xb50ba8[_0x0fa6('0x4b')][_0x0fa6('0x53')]+'%'};return _0x3f8250;})});}_0x4f1b62=_['merge']({},_0x4f1b62,_0xb50ba8[_0x0fa6('0x5c')]);return db[_0x0fa6('0x6d')][_0x0fa6('0x2e')]({'where':_0x4f1b62['where']})[_0x0fa6('0x35')](function(_0x25f417){_0x5d1013[_0x0fa6('0x2e')]=_0x25f417;if(_0xb50ba8['query'][_0x0fa6('0x55')]){_0x4f1b62[_0x0fa6('0x5b')]=[{'all':!![]}];}return db[_0x0fa6('0x6d')]['findAll'](_0x4f1b62);})[_0x0fa6('0x35')](function(_0x315e0e){_0x5d1013[_0x0fa6('0x57')]=_0x315e0e;return _0x5d1013;});}})[_0x0fa6('0x35')](respondWithFilteredResult(_0x48bcb3,_0x4f1b62))['catch'](handleError(_0x48bcb3,null));};exports[_0x0fa6('0x6f')]=function(_0xe3f18b,_0xc9c1e1,_0x2de86f){return db['MailAccount']['find']({'where':{'id':_0xe3f18b[_0x0fa6('0x60')]['id']}})[_0x0fa6('0x35')](handleEntityNotFound(_0xc9c1e1,null))['then'](function(_0x4052d9){if(_0x4052d9){return _0x4052d9['removeAnswers'](_0xe3f18b[_0x0fa6('0x4b')][_0x0fa6('0x6b')]);}})[_0x0fa6('0x35')](respondWithStatusCode(_0xc9c1e1,null))['catch'](handleError(_0xc9c1e1,null));};exports[_0x0fa6('0x65')]=function(_0x1f10a1,_0x3ecc9c){var _0x1d922c={'name':_0x1f10a1[_0x0fa6('0x5f')]['name'],'key':_0x1f10a1[_0x0fa6('0x5f')][_0x0fa6('0x45')],'email':_0x1f10a1[_0x0fa6('0x5f')][_0x0fa6('0x70')],'ListId':_0x1f10a1['body'][_0x0fa6('0x71')],'active':!_['isNil'](_0x1f10a1[_0x0fa6('0x5f')][_0x0fa6('0x72')])?_0x1f10a1[_0x0fa6('0x5f')][_0x0fa6('0x72')]:!![],'description':_0x1f10a1[_0x0fa6('0x5f')][_0x0fa6('0x73')]||null,'Imap':{},'Smtp':{}};if(_[_0x0fa6('0x74')](_0x1f10a1['body']['cservice'])){if(_0x1f10a1[_0x0fa6('0x5f')][_0x0fa6('0x75')]){_0x1d922c[_0x0fa6('0x3e')]['user']=_0x1d922c[_0x0fa6('0x3f')][_0x0fa6('0x76')]=_0x1f10a1['body'][_0x0fa6('0x77')];_0x1d922c['Imap'][_0x0fa6('0x78')]=_0x1d922c[_0x0fa6('0x3f')][_0x0fa6('0x79')]=_0x1f10a1[_0x0fa6('0x5f')]['cpassword'];}else{_0x1d922c['Imap'][_0x0fa6('0x7a')]=_0x1d922c[_0x0fa6('0x3f')][_0x0fa6('0x7a')]=![];}_0x1d922c[_0x0fa6('0x3e')][_0x0fa6('0x7b')]=_0x1f10a1[_0x0fa6('0x5f')][_0x0fa6('0x3e')]['host'];_0x1d922c[_0x0fa6('0x3e')]['port']=_0x1f10a1[_0x0fa6('0x5f')]['Imap'][_0x0fa6('0x7c')];_0x1d922c['Smtp']['host']=_0x1f10a1[_0x0fa6('0x5f')]['Smtp'][_0x0fa6('0x7b')];_0x1d922c[_0x0fa6('0x3f')][_0x0fa6('0x7c')]=_0x1f10a1[_0x0fa6('0x5f')]['Smtp'][_0x0fa6('0x7c')];}else{_0x1d922c[_0x0fa6('0x3e')][_0x0fa6('0x7d')]=_0x1d922c[_0x0fa6('0x3f')][_0x0fa6('0x7d')]=_0x1f10a1[_0x0fa6('0x5f')][_0x0fa6('0x7e')];_0x1d922c['Imap'][_0x0fa6('0x76')]=_0x1d922c['Smtp'][_0x0fa6('0x76')]=_0x1f10a1[_0x0fa6('0x5f')]['cuser'];_0x1d922c['Imap'][_0x0fa6('0x78')]=_0x1d922c['Smtp'][_0x0fa6('0x79')]=_0x1f10a1[_0x0fa6('0x5f')][_0x0fa6('0x7f')];}return db['MailAccount'][_0x0fa6('0x65')](_0x1d922c,{'include':[{'model':db[_0x0fa6('0x59')],'as':_0x0fa6('0x3f')},{'model':db['MailServerIn'],'as':_0x0fa6('0x3e')}]})[_0x0fa6('0x35')](function(_0x4c2746){var _0x17a97b=_0x1f10a1[_0x0fa6('0x76')][_0x0fa6('0x37')]({'plain':!![]});if(!_0x17a97b)throw new Error(_0x0fa6('0x80'));if(_0x17a97b['role']===_0x0fa6('0x76')){var _0x38be27=_0x4c2746[_0x0fa6('0x37')]({'plain':!![]});return db[_0x0fa6('0x81')]['find']({'where':{'name':'MailAccounts','userProfileId':_0x17a97b['userProfileId']},'raw':!![]})[_0x0fa6('0x35')](function(_0x398f55){if(_0x398f55&&_0x398f55[_0x0fa6('0x82')]===0x0){return db[_0x0fa6('0x83')]['create']({'name':_0x38be27[_0x0fa6('0x3b')],'resourceId':_0x38be27['id'],'type':_0x398f55[_0x0fa6('0x3b')],'sectionId':_0x398f55['id']},{})[_0x0fa6('0x35')](function(){return _0x4c2746;});}else{return _0x4c2746;}})['catch'](function(_0x4e1e3d){logger[_0x0fa6('0x26')](_0x0fa6('0x84'),_0x4e1e3d);throw _0x4e1e3d;});}return _0x4c2746;})[_0x0fa6('0x35')](respondWithResult(_0x3ecc9c,0xc9))[_0x0fa6('0x5e')](handleError(_0x3ecc9c,null));};exports['getImap']=function(_0x3c6bd0,_0x5582d9,_0x2652a3){return db[_0x0fa6('0x42')][_0x0fa6('0x67')]({'where':{'id':_0x3c6bd0[_0x0fa6('0x60')]['id']}})[_0x0fa6('0x35')](handleEntityNotFound(_0x5582d9,null))['then'](function(_0x42e939){if(_0x42e939){return _0x42e939[_0x0fa6('0x85')]();}return null;})[_0x0fa6('0x35')](respondWithResult(_0x5582d9,null))[_0x0fa6('0x5e')](handleError(_0x5582d9,null));};exports['addImap']=function(_0x4eed3f,_0x56d64a,_0x28490e){if(_0x4eed3f[_0x0fa6('0x5f')]['id']){delete _0x4eed3f[_0x0fa6('0x5f')]['id'];}return db[_0x0fa6('0x42')][_0x0fa6('0x5d')]({'where':{'id':_0x4eed3f[_0x0fa6('0x60')]['id']}})[_0x0fa6('0x35')](handleEntityNotFound(_0x56d64a,null))[_0x0fa6('0x35')](function(_0x8b55ad){if(_0x8b55ad){_0x4eed3f['body']['MailAccountId']=_0x8b55ad['id'];return db[_0x0fa6('0x3d')][_0x0fa6('0x65')](_0x4eed3f[_0x0fa6('0x5f')]);}})[_0x0fa6('0x35')](respondWithResult(_0x56d64a,null))['catch'](handleError(_0x56d64a,null));};exports[_0x0fa6('0x86')]=function(_0x4734e3,_0x3fb114,_0xf47492){return db[_0x0fa6('0x42')][_0x0fa6('0x67')]({'where':{'id':_0x4734e3[_0x0fa6('0x60')]['id']}})[_0x0fa6('0x35')](handleEntityNotFound(_0x3fb114,null))[_0x0fa6('0x35')](function(_0x5e63a1){if(_0x5e63a1){return _0x5e63a1['setImap'](null);}return null;})[_0x0fa6('0x35')](respondWithStatusCode(_0x3fb114,null))[_0x0fa6('0x5e')](handleError(_0x3fb114,null));};exports[_0x0fa6('0x87')]=function(_0x16ee48,_0x55523e,_0x5721d1){return db['MailAccount'][_0x0fa6('0x67')]({'where':{'id':_0x16ee48[_0x0fa6('0x60')]['id']}})['then'](handleEntityNotFound(_0x55523e,null))['then'](function(_0x3eb618){if(_0x3eb618){return _0x3eb618[_0x0fa6('0x87')]();}return null;})[_0x0fa6('0x35')](respondWithResult(_0x55523e,null))['catch'](handleError(_0x55523e,null));};exports[_0x0fa6('0x88')]=function(_0x3960a5,_0x2c3522,_0x4f1387){if(_0x3960a5[_0x0fa6('0x5f')]['id']){delete _0x3960a5[_0x0fa6('0x5f')]['id'];}return db[_0x0fa6('0x42')]['find']({'where':{'id':_0x3960a5['params']['id']}})[_0x0fa6('0x35')](handleEntityNotFound(_0x2c3522,null))[_0x0fa6('0x35')](function(_0x4221f0){if(_0x4221f0){_0x3960a5[_0x0fa6('0x5f')][_0x0fa6('0x63')]=_0x4221f0['id'];return db[_0x0fa6('0x59')]['create'](_0x3960a5[_0x0fa6('0x5f')]);}})[_0x0fa6('0x35')](respondWithResult(_0x2c3522,null))[_0x0fa6('0x5e')](handleError(_0x2c3522,null));};exports[_0x0fa6('0x89')]=function(_0x450483,_0xa1e24d,_0x336b0c){return db[_0x0fa6('0x42')][_0x0fa6('0x67')]({'where':{'id':_0x450483[_0x0fa6('0x60')]['id']}})['then'](handleEntityNotFound(_0xa1e24d,null))[_0x0fa6('0x35')](function(_0xeff0d1){if(_0xeff0d1){return _0xeff0d1[_0x0fa6('0x8a')](null);}return null;})['then'](respondWithStatusCode(_0xa1e24d,null))[_0x0fa6('0x5e')](handleError(_0xa1e24d,null));};exports[_0x0fa6('0x8b')]=function(_0x2f81b5,_0x24109e,_0x579093){return db[_0x0fa6('0x8c')][_0x0fa6('0x5d')]({'where':{'id':_0x2f81b5[_0x0fa6('0x60')]['id']}})[_0x0fa6('0x35')](handleEntityNotFound(_0x24109e,null))['then'](function(_0x175660){if(_0x175660){return _0x175660['addInteraction'](_0x2f81b5[_0x0fa6('0x5f')][_0x0fa6('0x6b')],_['omit'](_0x2f81b5['body'],[_0x0fa6('0x6b'),'id'])||{});}})[_0x0fa6('0x35')](respondWithResult(_0x24109e,null))['catch'](handleError(_0x24109e,null));};exports[_0x0fa6('0x8d')]=function(_0x5a41b1,_0x3b1c74,_0x18bd41){var _0x2fc1b1={'raw':![],'where':{}};var _0x32d152={};var _0x3fa4b5={'count':0x0,'rows':[]};return db[_0x0fa6('0x42')][_0x0fa6('0x67')]({'where':{'id':_0x5a41b1[_0x0fa6('0x60')]['id']}})[_0x0fa6('0x35')](handleEntityNotFound(_0x3b1c74,null))[_0x0fa6('0x35')](function(_0x5a7157){if(_0x5a7157){_0x32d152[_0x0fa6('0x48')]=_[_0x0fa6('0x46')](db[_0x0fa6('0x8c')][_0x0fa6('0x43')]);_0x32d152[_0x0fa6('0x4b')]=_['keys'](_0x5a41b1[_0x0fa6('0x4b')]);_0x32d152[_0x0fa6('0x51')]=_['intersection'](_0x32d152[_0x0fa6('0x48')],_0x32d152[_0x0fa6('0x4b')]);_0x2fc1b1['attributes']=_[_0x0fa6('0x47')](_0x32d152['model'],qs['fields'](_0x5a41b1[_0x0fa6('0x4b')][_0x0fa6('0x4a')]));_0x2fc1b1[_0x0fa6('0x49')]=_0x2fc1b1[_0x0fa6('0x49')][_0x0fa6('0x5a')]?_0x2fc1b1[_0x0fa6('0x49')]:_0x32d152[_0x0fa6('0x48')];if(!_0x5a41b1['query']['hasOwnProperty'](_0x0fa6('0x4d'))){_0x2fc1b1[_0x0fa6('0x30')]=qs[_0x0fa6('0x30')](_0x5a41b1[_0x0fa6('0x4b')][_0x0fa6('0x30')]);_0x2fc1b1[_0x0fa6('0x2f')]=qs[_0x0fa6('0x2f')](_0x5a41b1[_0x0fa6('0x4b')][_0x0fa6('0x2f')]);}_0x2fc1b1[_0x0fa6('0x4e')]=qs[_0x0fa6('0x4f')](_0x5a41b1[_0x0fa6('0x4b')][_0x0fa6('0x4f')]);_0x2fc1b1[_0x0fa6('0x50')]=qs[_0x0fa6('0x51')](_[_0x0fa6('0x68')](_0x5a41b1[_0x0fa6('0x4b')],_0x32d152[_0x0fa6('0x51')]));_0x2fc1b1[_0x0fa6('0x50')][_0x0fa6('0x63')]=_0x5a7157['id'];if(_0x5a41b1[_0x0fa6('0x4b')]['filter']){_0x2fc1b1[_0x0fa6('0x50')]=_['merge'](_0x2fc1b1[_0x0fa6('0x50')],{'$or':_['map'](_0x2fc1b1[_0x0fa6('0x49')],function(_0x1a4148){var _0x33956f={};_0x33956f[_0x1a4148]={'$like':'%'+_0x5a41b1[_0x0fa6('0x4b')][_0x0fa6('0x53')]+'%'};return _0x33956f;})});}_0x2fc1b1=_['merge']({},_0x2fc1b1,_0x5a41b1[_0x0fa6('0x5c')]);return db[_0x0fa6('0x8c')][_0x0fa6('0x2e')]({'where':_0x2fc1b1['where']})['then'](function(_0x1f4243){_0x3fa4b5['count']=_0x1f4243;if(_0x5a41b1[_0x0fa6('0x4b')][_0x0fa6('0x55')]){_0x2fc1b1['include']=[{'model':db[_0x0fa6('0x8e')],'as':_0x0fa6('0x8f'),'required':![]},{'model':db[_0x0fa6('0x90')],'as':_0x0fa6('0x91'),'attributes':[_0x0fa6('0x3b'),_0x0fa6('0x92'),_0x0fa6('0x93')],'required':![]},{'model':db[_0x0fa6('0x94')],'as':_0x0fa6('0x95'),'attributes':['id',_0x0fa6('0x3b'),_0x0fa6('0x96')],'where':_0x5a41b1['query']['tag']?{'id':_0x5a41b1[_0x0fa6('0x4b')][_0x0fa6('0x97')]}:undefined,'required':_0x5a41b1[_0x0fa6('0x4b')][_0x0fa6('0x97')]?!![]:![]}];}return db[_0x0fa6('0x8c')][_0x0fa6('0x56')](_0x2fc1b1);})[_0x0fa6('0x35')](function(_0x822444){_0x3fa4b5[_0x0fa6('0x57')]=_0x822444;return _0x3fa4b5;});}})[_0x0fa6('0x35')](respondWithFilteredResult(_0x3b1c74,_0x2fc1b1))['catch'](handleError(_0x3b1c74,null));};exports[_0x0fa6('0x98')]=function(_0x580826,_0x149c79,_0x4736be){return db['MailAccount'][_0x0fa6('0x67')]({'where':{'id':_0x580826['params']['id']}})[_0x0fa6('0x35')](handleEntityNotFound(_0x149c79,null))[_0x0fa6('0x35')](function(_0x379509){if(_0x379509){return db[_0x0fa6('0x99')][_0x0fa6('0x9a')](function(_0x4d492c){return db[_0x0fa6('0x9b')][_0x0fa6('0x36')]({'where':{'MailAccountId':_0x580826[_0x0fa6('0x60')]['id']},'transaction':_0x4d492c})[_0x0fa6('0x35')](function(_0xeaa58d){var _0xb6dbb9=_[_0x0fa6('0x69')](_0x580826[_0x0fa6('0x5f')],function(_0x5de2e3){_0x5de2e3[_0x0fa6('0x63')]=_0x580826['params']['id'];return _0x5de2e3;});return db[_0x0fa6('0x9b')]['bulkCreate'](_0xb6dbb9,{'transaction':_0x4d492c});});})[_0x0fa6('0x35')](function(){return db[_0x0fa6('0x9b')][_0x0fa6('0x9c')]({'where':{'MailAccountId':_0x580826['params']['id']},'order':_0x0fa6('0x9d')});});}})[_0x0fa6('0x35')](respondWithResult(_0x149c79,null))[_0x0fa6('0x5e')](handleError(_0x149c79,null));};exports[_0x0fa6('0x9e')]=function(_0x2f97a8,_0x40c70b,_0x10b289){var _0x58587d={};var _0x53c839={};var _0x5540ea;var _0x27a809;return db[_0x0fa6('0x42')]['findOne']({'where':{'id':_0x2f97a8[_0x0fa6('0x60')]['id']}})[_0x0fa6('0x35')](handleEntityNotFound(_0x40c70b,null))[_0x0fa6('0x35')](function(_0x5c52d8){if(_0x5c52d8){_0x5540ea=_0x5c52d8;_0x53c839[_0x0fa6('0x48')]=_[_0x0fa6('0x46')](db[_0x0fa6('0x9b')][_0x0fa6('0x43')]);_0x53c839['query']=_[_0x0fa6('0x46')](_0x2f97a8[_0x0fa6('0x4b')]);_0x53c839[_0x0fa6('0x51')]=_[_0x0fa6('0x47')](_0x53c839[_0x0fa6('0x48')],_0x53c839[_0x0fa6('0x4b')]);_0x58587d[_0x0fa6('0x49')]=_[_0x0fa6('0x47')](_0x53c839[_0x0fa6('0x48')],qs[_0x0fa6('0x4a')](_0x2f97a8[_0x0fa6('0x4b')][_0x0fa6('0x4a')]));_0x58587d['attributes']=_0x58587d[_0x0fa6('0x49')][_0x0fa6('0x5a')]?_0x58587d['attributes']:_0x53c839[_0x0fa6('0x48')];_0x58587d['order']=qs['sort'](_0x2f97a8[_0x0fa6('0x4b')][_0x0fa6('0x4f')]);_0x58587d['where']=qs[_0x0fa6('0x51')](_[_0x0fa6('0x68')](_0x2f97a8['query'],_0x53c839[_0x0fa6('0x51')]));if(_0x2f97a8['query'][_0x0fa6('0x53')]){_0x58587d[_0x0fa6('0x50')]=_[_0x0fa6('0x54')](_0x58587d[_0x0fa6('0x50')],{'$or':_[_0x0fa6('0x69')](_0x58587d[_0x0fa6('0x49')],function(_0x103835){var _0x487b98={};_0x487b98[_0x103835]={'$like':'%'+_0x2f97a8[_0x0fa6('0x4b')][_0x0fa6('0x53')]+'%'};return _0x487b98;})});}_0x58587d=_[_0x0fa6('0x54')]({},_0x58587d,_0x2f97a8['options']);return _0x5540ea['getApplications'](_0x58587d);}})[_0x0fa6('0x35')](function(_0x258991){if(_0x258991){_0x27a809=_0x258991['length'];if(!_0x2f97a8[_0x0fa6('0x4b')][_0x0fa6('0x4c')](_0x0fa6('0x4d'))){_0x58587d[_0x0fa6('0x30')]=qs[_0x0fa6('0x30')](_0x2f97a8[_0x0fa6('0x4b')][_0x0fa6('0x30')]);_0x58587d['offset']=qs[_0x0fa6('0x2f')](_0x2f97a8[_0x0fa6('0x4b')][_0x0fa6('0x2f')]);}return _0x5540ea[_0x0fa6('0x9e')](_0x58587d);}})[_0x0fa6('0x35')](function(_0x630c38){if(_0x630c38){return _0x630c38?{'count':_0x27a809,'rows':_0x630c38}:null;}})[_0x0fa6('0x35')](respondWithResult(_0x40c70b,null))['catch'](handleError(_0x40c70b,null));};exports[_0x0fa6('0x9f')]=function(_0x1c68f5,_0x1d8ca6,_0x2e294f){var _0x3b3e80={'raw':!![],'where':{}};var _0x15c5c3={};var _0x44b483={'count':0x0,'rows':[]};return db[_0x0fa6('0x42')][_0x0fa6('0x67')]({'where':{'id':_0x1c68f5['params']['id']}})[_0x0fa6('0x35')](handleEntityNotFound(_0x1d8ca6,null))[_0x0fa6('0x35')](function(_0x2d9727){if(_0x2d9727){_0x15c5c3['model']=_[_0x0fa6('0x46')](db['MailMessage'][_0x0fa6('0x43')]);_0x15c5c3[_0x0fa6('0x4b')]=_[_0x0fa6('0x46')](_0x1c68f5[_0x0fa6('0x4b')]);_0x15c5c3[_0x0fa6('0x51')]=_[_0x0fa6('0x47')](_0x15c5c3[_0x0fa6('0x48')],_0x15c5c3[_0x0fa6('0x4b')]);_0x3b3e80[_0x0fa6('0x49')]=_['intersection'](_0x15c5c3[_0x0fa6('0x48')],qs['fields'](_0x1c68f5[_0x0fa6('0x4b')]['fields']));_0x3b3e80[_0x0fa6('0x49')]=_0x3b3e80['attributes']['length']?_0x3b3e80[_0x0fa6('0x49')]:_0x15c5c3[_0x0fa6('0x48')];if(!_0x1c68f5[_0x0fa6('0x4b')][_0x0fa6('0x4c')](_0x0fa6('0x4d'))){_0x3b3e80['limit']=qs['limit'](_0x1c68f5[_0x0fa6('0x4b')][_0x0fa6('0x30')]);_0x3b3e80[_0x0fa6('0x2f')]=qs['offset'](_0x1c68f5[_0x0fa6('0x4b')][_0x0fa6('0x2f')]);}_0x3b3e80[_0x0fa6('0x4e')]=qs[_0x0fa6('0x4f')](_0x1c68f5['query'][_0x0fa6('0x4f')]);_0x3b3e80[_0x0fa6('0x50')]=qs[_0x0fa6('0x51')](_['pick'](_0x1c68f5['query'],_0x15c5c3[_0x0fa6('0x51')]));_0x3b3e80[_0x0fa6('0x50')][_0x0fa6('0x63')]=_0x2d9727['id'];if(_0x1c68f5[_0x0fa6('0x4b')]['filter']){_0x3b3e80[_0x0fa6('0x50')]=_[_0x0fa6('0x54')](_0x3b3e80[_0x0fa6('0x50')],{'$or':_['map'](_0x3b3e80[_0x0fa6('0x49')],function(_0x27587f){var _0x586c91={};_0x586c91[_0x27587f]={'$like':'%'+_0x1c68f5[_0x0fa6('0x4b')][_0x0fa6('0x53')]+'%'};return _0x586c91;})});}if(_0x1c68f5[_0x0fa6('0x4b')][_0x0fa6('0xa0')]){var _0x129d87=_0x1c68f5[_0x0fa6('0x4b')][_0x0fa6('0xa0')][_0x0fa6('0xa1')](',');var _0x18a3e6={};_0x18a3e6[_0x129d87[0x0]]={'$gte':moment(_0x129d87[0x1])[_0x0fa6('0xa2')](_0x0fa6('0xa3'))};_0x3b3e80[_0x0fa6('0x50')]=_[_0x0fa6('0x54')](_0x3b3e80[_0x0fa6('0x50')],_0x18a3e6);}_0x3b3e80=_[_0x0fa6('0x54')]({},_0x3b3e80,_0x1c68f5['options']);return db[_0x0fa6('0xa4')][_0x0fa6('0x2e')]({'where':_0x3b3e80['where']})['then'](function(_0x412a7e){_0x44b483[_0x0fa6('0x2e')]=_0x412a7e;if(_0x1c68f5[_0x0fa6('0x4b')]['includeAll']){_0x3b3e80[_0x0fa6('0x5b')]=[{'all':!![]}];}return db[_0x0fa6('0xa4')][_0x0fa6('0x56')](_0x3b3e80);})[_0x0fa6('0x35')](function(_0x306c0f){_0x44b483[_0x0fa6('0x57')]=_0x306c0f;return _0x44b483;});}})['then'](respondWithFilteredResult(_0x1d8ca6,_0x3b3e80))[_0x0fa6('0x5e')](handleError(_0x1d8ca6,null));};exports[_0x0fa6('0xa5')]=function(_0x5be189,_0x482677,_0x7d4031){var _0x97e012,_0x1f5ba1={},_0x5c923d;if(_0x5be189[_0x0fa6('0x5f')]['to']){_0x5c923d=_0x5be189[_0x0fa6('0x5f')]['to']['split'](',')[0x0];}return db[_0x0fa6('0x42')]['find']({'where':{'id':_0x5be189[_0x0fa6('0x60')]['id']},'include':[{'model':db[_0x0fa6('0xa6')],'as':'List','include':[{'model':db['CmContact'],'as':_0x0fa6('0xa7'),'where':{'email':_0x5c923d},'limit':0x1,'order':[['updatedAt',_0x0fa6('0xa8')]]}]},{'model':db[_0x0fa6('0x59')],'as':_0x0fa6('0x3f'),'raw':!![]}]})['then'](handleEntityNotFound(_0x482677,null))[_0x0fa6('0x35')](function(_0x3d3cab){if(_0x3d3cab){_0x97e012=_0x3d3cab;if(_0x3d3cab[_0x0fa6('0x3f')]){if(_['isNil'](_0x5be189[_0x0fa6('0x5f')][_0x0fa6('0xa9')])){_0x5be189[_0x0fa6('0x5f')][_0x0fa6('0xa9')]=util[_0x0fa6('0xa2')](_0x0fa6('0xaa'),_0x3d3cab[_0x0fa6('0x3b')],_0x3d3cab[_0x0fa6('0x70')]||_0x3d3cab[_0x0fa6('0x3f')][_0x0fa6('0x76')]);}if(_0x5be189[_0x0fa6('0x5f')][_0x0fa6('0xab')]&&_0x5be189[_0x0fa6('0x5f')]['attachments'][_0x0fa6('0x5a')]){for(var _0x3473df=0x0;_0x3473df<_0x5be189['body'][_0x0fa6('0xab')][_0x0fa6('0x5a')];_0x3473df+=0x1){_0x5be189['body'][_0x0fa6('0xab')][_0x3473df]={'filename':_0x5be189['body']['attachments'][_0x3473df][_0x0fa6('0x3b')],'path':path[_0x0fa6('0xac')](config[_0x0fa6('0xad')],_0x0fa6('0xae'),_0x5be189['body']['attachments'][_0x3473df][_0x0fa6('0xaf')])};}}var _0x64ec3a={'tls':{'rejectUnauthorized':![]}};if(_[_0x0fa6('0x74')](_0x3d3cab[_0x0fa6('0x3f')][_0x0fa6('0x7d')])){if(_0x3d3cab[_0x0fa6('0x3f')][_0x0fa6('0x7a')]){_0x64ec3a[_0x0fa6('0xb0')]={'user':_0x3d3cab['Smtp']['user'],'pass':_0x3d3cab[_0x0fa6('0x3f')][_0x0fa6('0x79')]};}_0x64ec3a['host']=_0x3d3cab['Smtp'][_0x0fa6('0x7b')];_0x64ec3a[_0x0fa6('0x7c')]=_0x3d3cab[_0x0fa6('0x3f')][_0x0fa6('0x7c')];_0x64ec3a[_0x0fa6('0xb1')]=_0x3d3cab['Smtp'][_0x0fa6('0xb1')];}else{_0x64ec3a[_0x0fa6('0x7d')]=_0x3d3cab[_0x0fa6('0x3f')]['service'];_0x64ec3a[_0x0fa6('0xb0')]={'user':_0x3d3cab[_0x0fa6('0x3f')]['user'],'pass':_0x3d3cab['Smtp']['pass']};}return respondWithRpcPromise(_0x0fa6('0xb2'),_0x0fa6('0xb3'),{'account':_0x64ec3a,'message':_0x5be189[_0x0fa6('0x5f')]});}else{throw new Error(_0x0fa6('0xb4'));}}})['then'](function(_0x1361f9){if(_0x1361f9){_0x1f5ba1=_0x1361f9;if(_0x97e012[_0x0fa6('0xb5')]){if(_0x97e012['List']['Contacts'][_0x0fa6('0x5a')]){return _0x97e012['List'][_0x0fa6('0xa7')][0x0];}else{return db[_0x0fa6('0x8e')][_0x0fa6('0x65')](_[_0x0fa6('0x17')](_0x5be189[_0x0fa6('0x5f')],{'firstName':_0x5be189[_0x0fa6('0x5f')]['to'],'email':_0x5be189[_0x0fa6('0x5f')]['to'],'phone':_0x5be189[_0x0fa6('0x5f')]['to'],'ListId':_0x97e012[_0x0fa6('0x71')]}));}}else{throw new Error(_0x0fa6('0xb4'));}}})[_0x0fa6('0x35')](function(_0x57a8bd){if(_0x57a8bd){var _0xc2cfca={'UserId':_0x5be189[_0x0fa6('0x76')]['id'],'ContactId':_0x57a8bd['id'],'MailAccountId':_0x97e012['id'],'inReplyTo':_0x1f5ba1['messageId'],'to':_0x5be189[_0x0fa6('0x5f')][_0x0fa6('0xa9')],'cc':_0x5be189['body']['cc'],'subject':_0x5be189[_0x0fa6('0x5f')][_0x0fa6('0xb6')],'attach':_0x5be189[_0x0fa6('0x5f')][_0x0fa6('0xb7')],'firstMsgDirection':_0x0fa6('0xb8'),'lastMsgAt':moment()['format'](_0x0fa6('0xa3')),'lastMsgDirection':_0x0fa6('0xb8'),'lastMsgBody':_0x5be189['body'][_0x0fa6('0x5f')],'Messages':[_[_0x0fa6('0x54')](_0x5be189[_0x0fa6('0x5f')],{'messageId':_0x1f5ba1[_0x0fa6('0xb9')],'sentAt':moment()[_0x0fa6('0xa2')](_0x0fa6('0xa3')),'read':!![],'MailAccountId':_0x97e012['id'],'UserId':_0x5be189[_0x0fa6('0x76')]['id'],'ContactId':_0x57a8bd['id']})]};if(_0x5be189[_0x0fa6('0x5f')][_0x0fa6('0xba')]){_0xc2cfca=_[_0x0fa6('0x54')](_0xc2cfca,_0x5be189[_0x0fa6('0x5f')][_0x0fa6('0xba')]);}return db['MailInteraction'][_0x0fa6('0x65')](_0xc2cfca,{'include':[{'model':db[_0x0fa6('0xa4')],'as':_0x0fa6('0xbb')}]});}})[_0x0fa6('0x35')](respondWithResult(_0x482677,null))[_0x0fa6('0x5e')](handleError(_0x482677,null));};exports[_0x0fa6('0xbc')]=function(_0x427f9a,_0x1133e5,_0x11042e){return db[_0x0fa6('0x42')]['find']({'where':{'id':_0x427f9a[_0x0fa6('0x60')]['id']},'include':[{'model':db[_0x0fa6('0x59')],'as':_0x0fa6('0x3f'),'raw':!![]}]})[_0x0fa6('0x35')](handleEntityNotFound(_0x1133e5,null))[_0x0fa6('0x35')](function(_0x41dc76){if(_0x41dc76&&_0x41dc76[_0x0fa6('0x3f')]){var _0x15f575={'id':_0x41dc76['id'],'tls':{'rejectUnauthorized':![]}};if(_0x41dc76[_0x0fa6('0x3f')][_0x0fa6('0x7d')]){_0x15f575['service']=_0x41dc76[_0x0fa6('0x3f')]['service'];}else{_0x15f575[_0x0fa6('0x7b')]=_0x41dc76[_0x0fa6('0x3f')][_0x0fa6('0x7b')];_0x15f575[_0x0fa6('0x7c')]=_0x41dc76[_0x0fa6('0x3f')]['port'];_0x15f575[_0x0fa6('0xb1')]=_0x41dc76['Smtp'][_0x0fa6('0xb1')];}if(_0x41dc76[_0x0fa6('0x3f')][_0x0fa6('0x7a')]){_0x15f575[_0x0fa6('0xb0')]={'user':_0x41dc76[_0x0fa6('0x3f')]['user'],'pass':_0x41dc76[_0x0fa6('0x3f')]['pass']};}return respondWithRpcPromise(_0x0fa6('0xbd'),_0x0fa6('0xbc'),{'account':_0x15f575});}})[_0x0fa6('0x35')](respondWithResult(_0x1133e5,null))[_0x0fa6('0x5e')](handleError(_0x1133e5,null));};exports[_0x0fa6('0x36')]=function(_0x5a46d5,_0x454be6){return db[_0x0fa6('0x42')][_0x0fa6('0x5d')]({'where':{'id':_0x5a46d5[_0x0fa6('0x60')]['id']}})[_0x0fa6('0x35')](handleEntityNotFound(_0x454be6,null))[_0x0fa6('0x35')](function(_0x416ede){if(_0x416ede&&_0x416ede[_0x0fa6('0x7d')]){throw new db[(_0x0fa6('0xbe'))]['ValidationError']('You\x20can\x27t\x20remove\x20the\x20mail\x20service\x20account');}return _0x416ede;})[_0x0fa6('0x35')](removeEntity(_0x454be6,null))['catch'](handleError(_0x454be6,null));};exports[_0x0fa6('0xbf')]=function(_0x58a38d,_0x3789d,_0x30b26e){return db[_0x0fa6('0x42')][_0x0fa6('0x5d')]({'where':{'id':_0x58a38d[_0x0fa6('0x60')]['id']}})[_0x0fa6('0x35')](handleEntityNotFound(_0x3789d,null))['then'](function(_0x515821){if(_0x515821){return _0x515821['addAgents'](_0x58a38d['body'][_0x0fa6('0x6b')],_[_0x0fa6('0xc0')](_0x58a38d[_0x0fa6('0x5f')],[_0x0fa6('0x6b'),'id'])||{})[_0x0fa6('0xc1')](function(_0x5f2e82){for(var _0xa4c99d=0x0;_0xa4c99d<_0x58a38d[_0x0fa6('0x5f')][_0x0fa6('0x6b')][_0x0fa6('0x5a')];_0xa4c99d+=0x1){socket['emit']('userMailAccount:save',{'UserId':_0x58a38d[_0x0fa6('0x5f')][_0x0fa6('0x6b')][_0xa4c99d],'MailAccountId':_0x58a38d['params']['id']});}return _0x5f2e82;});}})['then'](respondWithResult(_0x3789d,null))['catch'](handleError(_0x3789d,null));};exports[_0x0fa6('0xc2')]=function(_0x4a7c91,_0x2512f8,_0x4b2b7e){return db[_0x0fa6('0x42')][_0x0fa6('0x5d')]({'where':{'id':_0x4a7c91[_0x0fa6('0x60')]['id']}})[_0x0fa6('0x35')](handleEntityNotFound(_0x2512f8,null))[_0x0fa6('0x35')](function(_0x18de33){if(_0x18de33){return _0x18de33[_0x0fa6('0xc2')](_0x4a7c91[_0x0fa6('0x4b')][_0x0fa6('0x6b')])[_0x0fa6('0x35')](function(){if(_[_0x0fa6('0xc3')](_0x4a7c91[_0x0fa6('0x4b')][_0x0fa6('0x6b')])){for(var _0x44df4a=0x0;_0x44df4a<_0x4a7c91[_0x0fa6('0x4b')]['ids'][_0x0fa6('0x5a')];_0x44df4a+=0x1){socket[_0x0fa6('0xc4')](_0x0fa6('0xc5'),{'UserId':Number(_0x4a7c91[_0x0fa6('0x4b')][_0x0fa6('0x6b')][_0x44df4a]),'MailAccountId':Number(_0x4a7c91['params']['id'])});}}else{socket[_0x0fa6('0xc4')]('userMailAccount:remove',{'UserId':Number(_0x4a7c91[_0x0fa6('0x4b')][_0x0fa6('0x6b')]),'MailAccountId':Number(_0x4a7c91[_0x0fa6('0x60')]['id'])});}});}})[_0x0fa6('0x35')](respondWithStatusCode(_0x2512f8,null))[_0x0fa6('0x5e')](handleError(_0x2512f8,null));};exports['getAgents']=function(_0x5f2a09,_0x32f9c7,_0x2e4438){var _0x85c883={};var _0x47b538={};var _0x47b7ba;var _0x299a2f;return db[_0x0fa6('0x42')][_0x0fa6('0x67')]({'where':{'id':_0x5f2a09[_0x0fa6('0x60')]['id']}})[_0x0fa6('0x35')](handleEntityNotFound(_0x32f9c7,null))['then'](function(_0x57e73d){if(_0x57e73d){_0x47b7ba=_0x57e73d;_0x47b538[_0x0fa6('0x48')]=_[_0x0fa6('0x46')](db['User'][_0x0fa6('0x43')]);_0x47b538[_0x0fa6('0x4b')]=_['keys'](_0x5f2a09[_0x0fa6('0x4b')]);_0x47b538[_0x0fa6('0x51')]=_['intersection'](_0x47b538['model'],_0x47b538[_0x0fa6('0x4b')]);_0x85c883['attributes']=_[_0x0fa6('0x47')](_0x47b538[_0x0fa6('0x48')],qs['fields'](_0x5f2a09[_0x0fa6('0x4b')][_0x0fa6('0x4a')]));_0x85c883[_0x0fa6('0x49')]=_0x85c883[_0x0fa6('0x49')][_0x0fa6('0x5a')]?_0x85c883['attributes']:_0x47b538[_0x0fa6('0x48')];_0x85c883[_0x0fa6('0x4e')]=qs[_0x0fa6('0x4f')](_0x5f2a09['query'][_0x0fa6('0x4f')]);_0x85c883[_0x0fa6('0x50')]=qs[_0x0fa6('0x51')](_[_0x0fa6('0x68')](_0x5f2a09[_0x0fa6('0x4b')],_0x47b538['filters']));if(_0x5f2a09['query'][_0x0fa6('0x53')]){_0x85c883[_0x0fa6('0x50')]=_['merge'](_0x85c883[_0x0fa6('0x50')],{'$or':_[_0x0fa6('0x69')](_0x85c883[_0x0fa6('0x49')],function(_0x1af26f){var _0x40dd4d={};_0x40dd4d[_0x1af26f]={'$like':'%'+_0x5f2a09[_0x0fa6('0x4b')][_0x0fa6('0x53')]+'%'};return _0x40dd4d;})});}_0x85c883=_[_0x0fa6('0x54')]({},_0x85c883,_0x5f2a09[_0x0fa6('0x5c')]);return _0x47b7ba[_0x0fa6('0xc6')](_0x85c883);}})[_0x0fa6('0x35')](function(_0x3abfb2){if(_0x3abfb2){_0x299a2f=_0x3abfb2[_0x0fa6('0x5a')];if(!_0x5f2a09[_0x0fa6('0x4b')][_0x0fa6('0x4c')]('nolimit')){_0x85c883[_0x0fa6('0x30')]=qs['limit'](_0x5f2a09['query'][_0x0fa6('0x30')]);_0x85c883[_0x0fa6('0x2f')]=qs[_0x0fa6('0x2f')](_0x5f2a09['query']['offset']);}return _0x47b7ba[_0x0fa6('0xc6')](_0x85c883);}})[_0x0fa6('0x35')](function(_0x8ae9f6){if(_0x8ae9f6){return _0x8ae9f6?{'count':_0x299a2f,'rows':_0x8ae9f6}:null;}})['then'](respondWithResult(_0x32f9c7,null))[_0x0fa6('0x5e')](handleError(_0x32f9c7,null));};
\ No newline at end of file
diff --git a/server/api/mailAccount/mailAccount.events.js b/server/api/mailAccount/mailAccount.events.js
index aa22be4..290a051 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 _0x1997=['../../mysqldb','MailAccount','remove','emit','hasOwnProperty','hook','exports'];(function(_0x1a07c1,_0x1aa347){var _0x121acf=function(_0xa93fe4){while(--_0xa93fe4){_0x1a07c1['push'](_0x1a07c1['shift']());}};_0x121acf(++_0x1aa347);}(_0x1997,0x69));var _0x7199=function(_0x2eb541,_0x3f90d3){_0x2eb541=_0x2eb541-0x0;var _0x7b114e=_0x1997[_0x2eb541];return _0x7b114e;};'use strict';var EventEmitter=require('events');var MailAccount=require(_0x7199('0x0'))['db'][_0x7199('0x1')];var MailAccountEvents=new EventEmitter();MailAccountEvents['setMaxListeners'](0x0);var events={'afterCreate':'save','afterUpdate':'update','afterDestroy':_0x7199('0x2')};function emitEvent(_0x4d7ae5){return function(_0x5d5182,_0x230aa7,_0x42af71){MailAccountEvents[_0x7199('0x3')](_0x4d7ae5+':'+_0x5d5182['id'],_0x5d5182);MailAccountEvents[_0x7199('0x3')](_0x4d7ae5,_0x5d5182);_0x42af71(null);};}for(var e in events){if(events[_0x7199('0x4')](e)){var event=events[e];MailAccount[_0x7199('0x5')](e,emitEvent(event));}}module[_0x7199('0x6')]=MailAccountEvents;
\ No newline at end of file
+var _0x04db=['hook','events','../../mysqldb','MailAccount','save','update','remove','emit','hasOwnProperty'];(function(_0x48c2ae,_0x4cea90){var _0x8f7531=function(_0x126458){while(--_0x126458){_0x48c2ae['push'](_0x48c2ae['shift']());}};_0x8f7531(++_0x4cea90);}(_0x04db,0x157));var _0xb04d=function(_0x37950f,_0x529948){_0x37950f=_0x37950f-0x0;var _0x455801=_0x04db[_0x37950f];return _0x455801;};'use strict';var EventEmitter=require(_0xb04d('0x0'));var MailAccount=require(_0xb04d('0x1'))['db'][_0xb04d('0x2')];var MailAccountEvents=new EventEmitter();MailAccountEvents['setMaxListeners'](0x0);var events={'afterCreate':_0xb04d('0x3'),'afterUpdate':_0xb04d('0x4'),'afterDestroy':_0xb04d('0x5')};function emitEvent(_0x10d61a){return function(_0x48ec5d,_0x8e5327,_0x26af54){MailAccountEvents[_0xb04d('0x6')](_0x10d61a+':'+_0x48ec5d['id'],_0x48ec5d);MailAccountEvents['emit'](_0x10d61a,_0x48ec5d);_0x26af54(null);};}for(var e in events){if(events[_0xb04d('0x7')](e)){var event=events[e];MailAccount[_0xb04d('0x8')](e,emitEvent(event));}}module['exports']=MailAccountEvents;
\ No newline at end of file
diff --git a/server/api/mailAccount/mailAccount.model.js b/server/api/mailAccount/mailAccount.model.js
index f5f4598..adc7afb 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 _0x0820=['../../config/environment','./mailAccount.attributes','exports','MailAccount','mail_accounts','../../config/logger','api','moment','bluebird','path','rimraf'];(function(_0x3dd15e,_0x1f0015){var _0x231fd0=function(_0x4f680a){while(--_0x4f680a){_0x3dd15e['push'](_0x3dd15e['shift']());}};_0x231fd0(++_0x1f0015);}(_0x0820,0x1c8));var _0x0082=function(_0x2ec4a5,_0x3e0dff){_0x2ec4a5=_0x2ec4a5-0x0;var _0x165ff3=_0x0820[_0x2ec4a5];return _0x165ff3;};'use strict';var _=require('lodash');var util=require('util');var logger=require(_0x0082('0x0'))(_0x0082('0x1'));var moment=require(_0x0082('0x2'));var BPromise=require(_0x0082('0x3'));var rp=require('request-promise');var fs=require('fs');var path=require(_0x0082('0x4'));var rimraf=require(_0x0082('0x5'));var config=require(_0x0082('0x6'));var attributes=require(_0x0082('0x7'));module[_0x0082('0x8')]=function(_0x194b74,_0x3a70e1){return _0x194b74['define'](_0x0082('0x9'),attributes,{'tableName':_0x0082('0xa'),'paranoid':![],'indexes':[],'timestamps':!![]});};
\ No newline at end of file
+var _0x980c=['path','rimraf','../../config/environment','./mailAccount.attributes','exports','define','mail_accounts','lodash','util','../../config/logger','api','bluebird','request-promise'];(function(_0x3fe042,_0x1106f7){var _0x7d4a1f=function(_0x2df987){while(--_0x2df987){_0x3fe042['push'](_0x3fe042['shift']());}};_0x7d4a1f(++_0x1106f7);}(_0x980c,0x159));var _0xc980=function(_0x5ce200,_0x3d6352){_0x5ce200=_0x5ce200-0x0;var _0x2dfee7=_0x980c[_0x5ce200];return _0x2dfee7;};'use strict';var _=require(_0xc980('0x0'));var util=require(_0xc980('0x1'));var logger=require(_0xc980('0x2'))(_0xc980('0x3'));var moment=require('moment');var BPromise=require(_0xc980('0x4'));var rp=require(_0xc980('0x5'));var fs=require('fs');var path=require(_0xc980('0x6'));var rimraf=require(_0xc980('0x7'));var config=require(_0xc980('0x8'));var attributes=require(_0xc980('0x9'));module[_0xc980('0xa')]=function(_0x5cd1b4,_0x1a3ef1){return _0x5cd1b4[_0xc980('0xb')]('MailAccount',attributes,{'tableName':_0xc980('0xc'),'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 6ab29da..70963e0 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 _0x765e=['../../config/environment','jayson/promise','client','http','redis','localhost','socket.io-emitter','./mailAccount.socket','register','then','request\x20sent','debug','MailAccount,\x20%s,\x20%s,\x20%s','stringify','error','code','MailAccount,\x20%s,\x20%s','message','info','result','catch','GetMailAccount','MailAccount','findAll','options','where','limit','include','model','attributes','map','find','raw','ShowMailAccount','body','mail','difference','keys','CmContact','rawAttributes','createdAt','updatedAt','CompanyId','isNil','from','body\x20is\x20mandatory\x20and\x20not\x20empty','mapKey','mapKey\x20is\x20mandatory,\x20please\x20use\x20one\x20of\x20these:\x20','includes','account','List','Contacts','DESC','MailApplication','Applications','MailServerOut','get','omit','applications','list','priority','asc','autoclose','length','close','*,*,*,*','ListId','create','List\x20not\x20found','contact','messageId','generate','subject','format','YYYY-MM-DD\x20HH:mm:ss','MailInteraction','MailMessage','Messages','Contact\x20not\x20found','spread','update','attach','interaction','created','attachments','originTo','originCc','bcc','Attachment','UserId','User','name','agent','waitForTheAssignedAgent','startRouting','lodash','util','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc'];(function(_0x5a5aca,_0x368fbb){var _0x1cb523=function(_0x43f690){while(--_0x43f690){_0x5a5aca['push'](_0x5a5aca['shift']());}};_0x1cb523(++_0x368fbb);}(_0x765e,0x131));var _0xe765=function(_0x5eb2d0,_0x482f3c){_0x5eb2d0=_0x5eb2d0-0x0;var _0x530485=_0x765e[_0x5eb2d0];return _0x530485;};'use strict';var _=require(_0xe765('0x0'));var util=require(_0xe765('0x1'));var moment=require(_0xe765('0x2'));var BPromise=require(_0xe765('0x3'));var rs=require(_0xe765('0x4'));var fs=require('fs');var Redis=require(_0xe765('0x5'));var db=require(_0xe765('0x6'))['db'];var utils=require(_0xe765('0x7'));var logger=require(_0xe765('0x8'))(_0xe765('0x9'));var config=require(_0xe765('0xa'));var jayson=require(_0xe765('0xb'));var client=jayson[_0xe765('0xc')][_0xe765('0xd')]({'port':0x232c});config[_0xe765('0xe')]=_['defaults'](config[_0xe765('0xe')],{'host':_0xe765('0xf'),'port':0x18eb});var socket=require(_0xe765('0x10'))(new Redis(config[_0xe765('0xe')]));require(_0xe765('0x11'))[_0xe765('0x12')](socket);function respondWithRpcPromise(_0x89a285,_0x53b110,_0x42953c){return new BPromise(function(_0x37db1b,_0x31114a){return client['request'](_0x89a285,_0x42953c)[_0xe765('0x13')](function(_0x57edaf){logger['info']('MailAccount,\x20%s,\x20%s',_0x53b110,_0xe765('0x14'));logger[_0xe765('0x15')](_0xe765('0x16'),_0x53b110,_0xe765('0x14'),JSON[_0xe765('0x17')](_0x57edaf));if(_0x57edaf['error']){if(_0x57edaf[_0xe765('0x18')][_0xe765('0x19')]===0x1f4){logger[_0xe765('0x18')](_0xe765('0x1a'),_0x53b110,_0x57edaf[_0xe765('0x18')]['message']);return _0x31114a(_0x57edaf['error'][_0xe765('0x1b')]);}logger[_0xe765('0x18')](_0xe765('0x1a'),_0x53b110,_0x57edaf['error'][_0xe765('0x1b')]);return _0x37db1b(_0x57edaf[_0xe765('0x18')][_0xe765('0x1b')]);}else{logger[_0xe765('0x1c')](_0xe765('0x1a'),_0x53b110,_0xe765('0x14'));_0x37db1b(_0x57edaf[_0xe765('0x1d')][_0xe765('0x1b')]);}})[_0xe765('0x1e')](function(_0x57fb61){logger[_0xe765('0x18')]('MailAccount,\x20%s,\x20%s',_0x53b110,_0x57fb61);_0x31114a(_0x57fb61);});});}exports[_0xe765('0x1f')]=function(_0x2c3afb){var _0x5b681e=this;return new Promise(function(_0x4733dc,_0x59118f){return db[_0xe765('0x20')][_0xe765('0x21')]({'raw':_0x2c3afb[_0xe765('0x22')]?_0x2c3afb['options']['raw']===undefined?!![]:![]:!![],'where':_0x2c3afb['options']?_0x2c3afb[_0xe765('0x22')][_0xe765('0x23')]||null:null,'attributes':_0x2c3afb[_0xe765('0x22')]?_0x2c3afb[_0xe765('0x22')]['attributes']||null:null,'limit':_0x2c3afb['options']?_0x2c3afb[_0xe765('0x22')][_0xe765('0x24')]||null:null,'include':_0x2c3afb[_0xe765('0x22')]?_0x2c3afb[_0xe765('0x22')][_0xe765('0x25')]?_['map'](_0x2c3afb[_0xe765('0x22')]['include'],function(_0x2b1f66){return{'model':db[_0x2b1f66[_0xe765('0x26')]],'as':_0x2b1f66['as'],'attributes':_0x2b1f66[_0xe765('0x27')],'include':_0x2b1f66[_0xe765('0x25')]?_[_0xe765('0x28')](_0x2b1f66[_0xe765('0x25')],function(_0x471d57){return{'model':db[_0x471d57['model']],'as':_0x471d57['as'],'attributes':_0x471d57['attributes'],'include':_0x471d57[_0xe765('0x25')]?_['map'](_0x471d57[_0xe765('0x25')],function(_0x3f7493){return{'model':db[_0x3f7493[_0xe765('0x26')]],'as':_0x3f7493['as'],'attributes':_0x3f7493[_0xe765('0x27')]};}):[]};}):[]};}):[]:[]})[_0xe765('0x13')](function(_0x4fce2c){logger[_0xe765('0x1c')](_0xe765('0x1f'),_0x2c3afb);logger[_0xe765('0x15')]('GetMailAccount',_0x2c3afb,JSON['stringify'](_0x4fce2c));_0x4733dc(_0x4fce2c);})[_0xe765('0x1e')](function(_0x47d7e7){logger[_0xe765('0x18')](_0xe765('0x1f'),_0x47d7e7[_0xe765('0x1b')],_0x2c3afb);_0x59118f(_0x5b681e[_0xe765('0x18')](0x1f4,_0x47d7e7[_0xe765('0x1b')]));});});};exports['ShowMailAccount']=function(_0x58401e){var _0x3ecf47=this;return new Promise(function(_0x1d0218,_0x2eee38){return db[_0xe765('0x20')][_0xe765('0x29')]({'raw':_0x58401e['options']?_0x58401e['options'][_0xe765('0x2a')]===undefined?!![]:![]:!![],'where':_0x58401e['options']?_0x58401e[_0xe765('0x22')][_0xe765('0x23')]||null:null,'attributes':_0x58401e[_0xe765('0x22')]?_0x58401e[_0xe765('0x22')][_0xe765('0x27')]||null:null,'include':_0x58401e[_0xe765('0x22')]?_0x58401e[_0xe765('0x22')]['include']?_['map'](_0x58401e['options'][_0xe765('0x25')],function(_0x234936){return{'model':db[_0x234936[_0xe765('0x26')]],'as':_0x234936['as'],'attributes':_0x234936[_0xe765('0x27')],'include':_0x234936['include']?_[_0xe765('0x28')](_0x234936[_0xe765('0x25')],function(_0x441f9d){return{'model':db[_0x441f9d[_0xe765('0x26')]],'as':_0x441f9d['as'],'attributes':_0x441f9d['attributes'],'include':_0x441f9d[_0xe765('0x25')]?_['map'](_0x441f9d[_0xe765('0x25')],function(_0x227f4a){return{'model':db[_0x227f4a[_0xe765('0x26')]],'as':_0x227f4a['as'],'attributes':_0x227f4a[_0xe765('0x27')]};}):[]};}):[]};}):[]:[]})[_0xe765('0x13')](function(_0x18bd22){logger[_0xe765('0x1c')](_0xe765('0x2b'),_0x58401e);logger[_0xe765('0x15')](_0xe765('0x2b'),_0x58401e,JSON['stringify'](_0x18bd22));_0x1d0218(_0x18bd22);})[_0xe765('0x1e')](function(_0x17d60e){logger[_0xe765('0x18')]('ShowMailAccount',_0x17d60e['message'],_0x58401e);_0x2eee38(_0x3ecf47['error'](0x1f4,_0x17d60e[_0xe765('0x1b')]));});});};exports['NotifyMailAccount']=function(_0x1f0db1){var _0x10f850=this;return new Promise(function(_0x3be7d7,_0x7b6206){var _0x4aa95d={'body':_0x1f0db1[_0xe765('0x2c')],'channel':_0xe765('0x2d')};var _0x1d964b=_[_0xe765('0x2e')](_[_0xe765('0x2f')](db[_0xe765('0x30')][_0xe765('0x31')]),[_0xe765('0x32'),_0xe765('0x33'),_0xe765('0x34'),'ListId']);var _0x3d3a24=![];if(_0x1f0db1['body']['id']){delete _0x1f0db1[_0xe765('0x2c')]['id'];}if(_[_0xe765('0x35')](_0x1f0db1['body'][_0xe765('0x36')])){return _0x7b6206(_0x10f850['error'](0x1f4,'from\x20is\x20mandatory'));}if(_['isNil'](_0x1f0db1[_0xe765('0x2c')][_0xe765('0x2c')])||_0x1f0db1[_0xe765('0x2c')]['body']===''){return _0x7b6206(_0x10f850[_0xe765('0x18')](0x1f4,_0xe765('0x37')));}if(_[_0xe765('0x35')](_0x1f0db1[_0xe765('0x2c')][_0xe765('0x38')])){return _0x7b6206(_0x10f850[_0xe765('0x18')](0x1f4,_0xe765('0x39')+_0x1d964b));}if(!_[_0xe765('0x3a')](_0x1d964b,_0x1f0db1[_0xe765('0x2c')]['mapKey'])){return _0x7b6206(_0x10f850[_0xe765('0x18')](0x1f4,'mapKey\x20invalid,\x20please\x20use\x20one\x20of\x20these:\x20'+_0x1d964b));}var _0x57405f={};_0x57405f[_0x1f0db1[_0xe765('0x2c')]['mapKey']]=_0x1f0db1[_0xe765('0x2c')][_0xe765('0x36')];return db[_0xe765('0x20')]['find']({'where':{'id':_0x1f0db1[_0xe765('0x3b')]['id']},'include':[{'model':db['CmList'],'as':_0xe765('0x3c'),'include':[{'model':db[_0xe765('0x30')],'as':_0xe765('0x3d'),'where':_0x57405f,'limit':0x1,'order':[['updatedAt',_0xe765('0x3e')]]}]},{'model':db[_0xe765('0x3f')],'as':_0xe765('0x40')},{'model':db[_0xe765('0x41')],'as':'Smtp'}]})['then'](function(_0x5391c8){if(_0x5391c8&&_0x5391c8[_0xe765('0x3c')]){var _0x33eb7b=_0x5391c8[_0xe765('0x42')]({'plain':!![]});_0x4aa95d['account']=_[_0xe765('0x43')](_0x33eb7b,['Applications',_0xe765('0x3c')]);_0x4aa95d[_0xe765('0x44')]=_0x33eb7b[_0xe765('0x40')];_0x4aa95d[_0xe765('0x45')]=_0x33eb7b[_0xe765('0x3c')];_0x4aa95d[_0xe765('0x44')]=_['orderBy'](_0x4aa95d[_0xe765('0x44')],[_0xe765('0x46')],[_0xe765('0x47')]);if(_0x4aa95d[_0xe765('0x3b')]&&_0x4aa95d[_0xe765('0x3b')][_0xe765('0x48')]){_0x4aa95d['applications']['push']({'id':0x0,'priority':_0x4aa95d[_0xe765('0x44')][_0xe765('0x49')]+0x1,'app':_0xe765('0x4a'),'appdata':'autoclose','interval':_0xe765('0x4b')});}if(_0x4aa95d[_0xe765('0x3b')][_0xe765('0x40')]){delete _0x4aa95d[_0xe765('0x3b')][_0xe765('0x40')];}if(_0x4aa95d[_0xe765('0x3b')][_0xe765('0x3c')]){delete _0x4aa95d[_0xe765('0x3b')]['List'];}if(_0x33eb7b['List'][_0xe765('0x3d')]['length']){return _0x33eb7b[_0xe765('0x3c')][_0xe765('0x3d')][0x0];}var _0x8bcddb=_['defaults'](_0x1f0db1[_0xe765('0x2c')],{'firstName':_0x1f0db1[_0xe765('0x2c')]['from'],'ListId':_0x33eb7b[_0xe765('0x4c')]});_0x8bcddb[_0x1f0db1[_0xe765('0x2c')][_0xe765('0x38')]]=_0x1f0db1[_0xe765('0x2c')][_0xe765('0x36')];return db[_0xe765('0x30')][_0xe765('0x4d')](_0x8bcddb);}else{throw new Error(_0xe765('0x4e'));}})[_0xe765('0x13')](function(_0x1f6da3){_0x4aa95d[_0xe765('0x4f')]=_0x1f6da3;if(_0x1f6da3){if(!_0x1f0db1[_0xe765('0x2c')][_0xe765('0x1b')]['messageId']){_0x1f0db1[_0xe765('0x2c')][_0xe765('0x1b')][_0xe765('0x50')]=rs[_0xe765('0x51')]()+'\x20'+_0x1f0db1[_0xe765('0x2c')][_0xe765('0x1b')][_0xe765('0x36')];}var _0x433b6c={'ContactId':_0x1f6da3['id'],'MailAccountId':_0x1f0db1[_0xe765('0x3b')]['id'],'inReplyTo':_0x1f0db1['body'][_0xe765('0x1b')]['messageId'],'to':_0x1f0db1[_0xe765('0x2c')][_0xe765('0x1b')]['from'],'cc':_0x1f0db1[_0xe765('0x2c')][_0xe765('0x1b')]['cc'],'subject':_0x1f0db1[_0xe765('0x2c')][_0xe765('0x1b')][_0xe765('0x52')],'attach':_0x1f0db1[_0xe765('0x2c')][_0xe765('0x1b')]['attach'],'lastMsgAt':moment()[_0xe765('0x53')](_0xe765('0x54')),'lastMsgDirection':'in','lastMsgBody':_0x1f0db1['body'][_0xe765('0x2c')]};return db[_0xe765('0x55')][_0xe765('0x29')]({'where':{'closed':![],'MailAccountId':_0x1f0db1['account']['id']},'include':[{'model':db[_0xe765('0x56')],'as':_0xe765('0x57'),'attributes':[_0xe765('0x50')],'where':{'messageId':_0x1f0db1['body']['message']['inReplyTo']}}]})[_0xe765('0x13')](function(_0x1bace2){if(_0x1bace2){return[_0x1bace2,![]];}return db['MailInteraction']['create'](_0x433b6c)[_0xe765('0x13')](function(_0x52852a){return[_0x52852a,!![]];});});}else{throw new Error(_0xe765('0x58'));}})[_0xe765('0x59')](function(_0xfa79f,_0x1c1968){if(_0xfa79f){_0x3d3a24=_0x1c1968;if(!_0x1c1968){return _0xfa79f[_0xe765('0x5a')]({'inReplyTo':_0x1f0db1[_0xe765('0x2c')][_0xe765('0x1b')][_0xe765('0x50')],'to':_0x1f0db1[_0xe765('0x2c')][_0xe765('0x1b')][_0xe765('0x36')],'cc':_0x1f0db1['body'][_0xe765('0x1b')]['cc'],'subject':_0x1f0db1[_0xe765('0x2c')][_0xe765('0x1b')][_0xe765('0x52')],'attach':_0xfa79f['attach']?_0xfa79f[_0xe765('0x5b')]:_0x1f0db1[_0xe765('0x2c')][_0xe765('0x1b')]['attach'],'substatus':null,'substatusAt':moment()[_0xe765('0x53')](_0xe765('0x54')),'lastMsgAt':moment()[_0xe765('0x53')](_0xe765('0x54')),'lastMsgDirection':'in','lastMsgBody':_0x1f0db1[_0xe765('0x2c')][_0xe765('0x2c')]});}else{return _0xfa79f;}}})[_0xe765('0x13')](function(_0x1dfa27){_0x4aa95d[_0xe765('0x5c')]=_0x1dfa27[_0xe765('0x42')]({'plain':!![]});_0x4aa95d[_0xe765('0x5c')][_0xe765('0x5d')]=_0x3d3a24;return db['MailMessage'][_0xe765('0x4d')]({'body':_0x1f0db1[_0xe765('0x2c')]['body'],'MailAccountId':_0x1f0db1[_0xe765('0x3b')]['id'],'MailInteractionId':_0x1dfa27['id'],'direction':'in','ContactId':_0x4aa95d[_0xe765('0x4f')]['id'],'messageId':_0x1f0db1[_0xe765('0x2c')][_0xe765('0x1b')]['messageId'],'from':_0x1f0db1[_0xe765('0x2c')][_0xe765('0x1b')][_0xe765('0x36')],'to':_0x1f0db1[_0xe765('0x2c')][_0xe765('0x1b')]['to'],'cc':_0x1f0db1[_0xe765('0x2c')][_0xe765('0x1b')]['cc'],'subject':_0x1f0db1[_0xe765('0x2c')]['message']['subject'],'attach':_0x1f0db1[_0xe765('0x2c')][_0xe765('0x1b')]['attach'],'Attachments':_0x1f0db1[_0xe765('0x2c')][_0xe765('0x1b')][_0xe765('0x5e')],'originTo':_0x1f0db1[_0xe765('0x2c')][_0xe765('0x1b')][_0xe765('0x5f')],'originCc':_0x1f0db1[_0xe765('0x2c')][_0xe765('0x1b')][_0xe765('0x60')],'bcc':_0x1f0db1[_0xe765('0x2c')][_0xe765('0x1b')][_0xe765('0x61')]},{'include':[{'model':db[_0xe765('0x62')],'as':'Attachments'}]});})[_0xe765('0x13')](function(_0x56a8fc){_0x4aa95d['message']=_0x56a8fc;if(_0x4aa95d['interaction'][_0xe765('0x63')]){return db[_0xe765('0x64')][_0xe765('0x29')]({'attributes':['id',_0xe765('0x65')],'where':{'id':_0x4aa95d['interaction'][_0xe765('0x63')]}})[_0xe765('0x13')](function(_0x4aec6e){if(_0x4aec6e){_0x4aa95d[_0xe765('0x44')]['unshift']({'id':0x0,'priority':0x0,'app':_0xe765('0x66'),'appdata':_0x4aec6e[_0xe765('0x65')]+','+(_0x4aa95d[_0xe765('0x3b')][_0xe765('0x67')]||0xa),'interval':'*,*,*,*'});}return respondWithRpcPromise('Start','startRouting',_0x4aa95d);});}return respondWithRpcPromise('Start',_0xe765('0x68'),_0x4aa95d);})[_0xe765('0x13')](function(_0xa5348f){_0x3be7d7(_0xa5348f);})[_0xe765('0x1e')](function(_0x197ec0){_0x7b6206(_0x10f850['error'](0x1f4,_0x197ec0[_0xe765('0x1b')]));});});};
\ No newline at end of file
+var _0xe74e=['ShowMailAccount','body','mail','difference','CmContact','rawAttributes','createdAt','updatedAt','ListId','from','from\x20is\x20mandatory','isNil','body\x20is\x20mandatory\x20and\x20not\x20empty','mapKey','includes','mapKey\x20invalid,\x20please\x20use\x20one\x20of\x20these:\x20','find','List','Contacts','DESC','MailApplication','Applications','MailServerOut','Smtp','account','omit','applications','list','orderBy','priority','asc','push','length','close','autoclose','*,*,*,*','defaults','List\x20not\x20found','messageId','subject','format','YYYY-MM-DD\x20HH:mm:ss','MailMessage','Messages','MailInteraction','Contact\x20not\x20found','spread','update','attach','interaction','get','created','create','attachments','originCc','bcc','Attachments','User','name','UserId','unshift','agent','waitForTheAssignedAgent','startRouting','util','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','http','redis','localhost','socket.io-emitter','request','info','MailAccount,\x20%s,\x20%s','request\x20sent','MailAccount,\x20%s,\x20%s,\x20%s','stringify','error','code','message','result','catch','GetMailAccount','MailAccount','findAll','options','raw','attributes','limit','include','map','model','then','debug'];(function(_0x1ae5ab,_0xc5d441){var _0x1ce001=function(_0x5ef96d){while(--_0x5ef96d){_0x1ae5ab['push'](_0x1ae5ab['shift']());}};_0x1ce001(++_0xc5d441);}(_0xe74e,0x10a));var _0xee74=function(_0x34d346,_0x4c6502){_0x34d346=_0x34d346-0x0;var _0x122d76=_0xe74e[_0x34d346];return _0x122d76;};'use strict';var _=require('lodash');var util=require(_0xee74('0x0'));var moment=require(_0xee74('0x1'));var BPromise=require(_0xee74('0x2'));var rs=require(_0xee74('0x3'));var fs=require('fs');var Redis=require(_0xee74('0x4'));var db=require(_0xee74('0x5'))['db'];var utils=require(_0xee74('0x6'));var logger=require(_0xee74('0x7'))(_0xee74('0x8'));var config=require(_0xee74('0x9'));var jayson=require('jayson/promise');var client=jayson['client'][_0xee74('0xa')]({'port':0x232c});config[_0xee74('0xb')]=_['defaults'](config['redis'],{'host':_0xee74('0xc'),'port':0x18eb});var socket=require(_0xee74('0xd'))(new Redis(config[_0xee74('0xb')]));require('./mailAccount.socket')['register'](socket);function respondWithRpcPromise(_0x12f2b7,_0x28ae0d,_0xe6609e){return new BPromise(function(_0x1c68e8,_0x24128b){return client[_0xee74('0xe')](_0x12f2b7,_0xe6609e)['then'](function(_0x428062){logger[_0xee74('0xf')](_0xee74('0x10'),_0x28ae0d,_0xee74('0x11'));logger['debug'](_0xee74('0x12'),_0x28ae0d,_0xee74('0x11'),JSON[_0xee74('0x13')](_0x428062));if(_0x428062[_0xee74('0x14')]){if(_0x428062['error'][_0xee74('0x15')]===0x1f4){logger[_0xee74('0x14')](_0xee74('0x10'),_0x28ae0d,_0x428062[_0xee74('0x14')][_0xee74('0x16')]);return _0x24128b(_0x428062[_0xee74('0x14')]['message']);}logger[_0xee74('0x14')](_0xee74('0x10'),_0x28ae0d,_0x428062[_0xee74('0x14')]['message']);return _0x1c68e8(_0x428062[_0xee74('0x14')][_0xee74('0x16')]);}else{logger['info']('MailAccount,\x20%s,\x20%s',_0x28ae0d,_0xee74('0x11'));_0x1c68e8(_0x428062[_0xee74('0x17')][_0xee74('0x16')]);}})[_0xee74('0x18')](function(_0x122c05){logger['error'](_0xee74('0x10'),_0x28ae0d,_0x122c05);_0x24128b(_0x122c05);});});}exports[_0xee74('0x19')]=function(_0x585726){var _0x14db93=this;return new Promise(function(_0x267b6a,_0x179cb3){return db[_0xee74('0x1a')][_0xee74('0x1b')]({'raw':_0x585726['options']?_0x585726[_0xee74('0x1c')][_0xee74('0x1d')]===undefined?!![]:![]:!![],'where':_0x585726[_0xee74('0x1c')]?_0x585726[_0xee74('0x1c')]['where']||null:null,'attributes':_0x585726['options']?_0x585726['options'][_0xee74('0x1e')]||null:null,'limit':_0x585726[_0xee74('0x1c')]?_0x585726[_0xee74('0x1c')][_0xee74('0x1f')]||null:null,'include':_0x585726[_0xee74('0x1c')]?_0x585726[_0xee74('0x1c')][_0xee74('0x20')]?_[_0xee74('0x21')](_0x585726[_0xee74('0x1c')][_0xee74('0x20')],function(_0xa21779){return{'model':db[_0xa21779[_0xee74('0x22')]],'as':_0xa21779['as'],'attributes':_0xa21779[_0xee74('0x1e')],'include':_0xa21779[_0xee74('0x20')]?_[_0xee74('0x21')](_0xa21779[_0xee74('0x20')],function(_0x24511e){return{'model':db[_0x24511e[_0xee74('0x22')]],'as':_0x24511e['as'],'attributes':_0x24511e[_0xee74('0x1e')],'include':_0x24511e[_0xee74('0x20')]?_['map'](_0x24511e[_0xee74('0x20')],function(_0x3e62bc){return{'model':db[_0x3e62bc[_0xee74('0x22')]],'as':_0x3e62bc['as'],'attributes':_0x3e62bc[_0xee74('0x1e')]};}):[]};}):[]};}):[]:[]})[_0xee74('0x23')](function(_0x399b50){logger['info'](_0xee74('0x19'),_0x585726);logger[_0xee74('0x24')](_0xee74('0x19'),_0x585726,JSON['stringify'](_0x399b50));_0x267b6a(_0x399b50);})[_0xee74('0x18')](function(_0x25d3c9){logger[_0xee74('0x14')](_0xee74('0x19'),_0x25d3c9[_0xee74('0x16')],_0x585726);_0x179cb3(_0x14db93[_0xee74('0x14')](0x1f4,_0x25d3c9[_0xee74('0x16')]));});});};exports[_0xee74('0x25')]=function(_0x378dbd){var _0x1f6d7c=this;return new Promise(function(_0x5bad7c,_0x2cd414){return db['MailAccount']['find']({'raw':_0x378dbd[_0xee74('0x1c')]?_0x378dbd['options']['raw']===undefined?!![]:![]:!![],'where':_0x378dbd[_0xee74('0x1c')]?_0x378dbd[_0xee74('0x1c')]['where']||null:null,'attributes':_0x378dbd[_0xee74('0x1c')]?_0x378dbd[_0xee74('0x1c')][_0xee74('0x1e')]||null:null,'include':_0x378dbd[_0xee74('0x1c')]?_0x378dbd['options'][_0xee74('0x20')]?_['map'](_0x378dbd[_0xee74('0x1c')][_0xee74('0x20')],function(_0x1a8f71){return{'model':db[_0x1a8f71['model']],'as':_0x1a8f71['as'],'attributes':_0x1a8f71[_0xee74('0x1e')],'include':_0x1a8f71['include']?_['map'](_0x1a8f71[_0xee74('0x20')],function(_0x21f000){return{'model':db[_0x21f000[_0xee74('0x22')]],'as':_0x21f000['as'],'attributes':_0x21f000['attributes'],'include':_0x21f000['include']?_[_0xee74('0x21')](_0x21f000[_0xee74('0x20')],function(_0xb94e4c){return{'model':db[_0xb94e4c[_0xee74('0x22')]],'as':_0xb94e4c['as'],'attributes':_0xb94e4c[_0xee74('0x1e')]};}):[]};}):[]};}):[]:[]})[_0xee74('0x23')](function(_0xf1a11){logger[_0xee74('0xf')](_0xee74('0x25'),_0x378dbd);logger[_0xee74('0x24')]('ShowMailAccount',_0x378dbd,JSON[_0xee74('0x13')](_0xf1a11));_0x5bad7c(_0xf1a11);})[_0xee74('0x18')](function(_0x3724fb){logger['error'](_0xee74('0x25'),_0x3724fb[_0xee74('0x16')],_0x378dbd);_0x2cd414(_0x1f6d7c[_0xee74('0x14')](0x1f4,_0x3724fb[_0xee74('0x16')]));});});};exports['NotifyMailAccount']=function(_0x47b06b){var _0x3369bf=this;return new Promise(function(_0x5db032,_0x381506){var _0x435a7b={'body':_0x47b06b[_0xee74('0x26')],'channel':_0xee74('0x27')};var _0xd7bae=_[_0xee74('0x28')](_['keys'](db[_0xee74('0x29')][_0xee74('0x2a')]),[_0xee74('0x2b'),_0xee74('0x2c'),'CompanyId',_0xee74('0x2d')]);var _0x31d871=![];if(_0x47b06b[_0xee74('0x26')]['id']){delete _0x47b06b[_0xee74('0x26')]['id'];}if(_['isNil'](_0x47b06b['body'][_0xee74('0x2e')])){return _0x381506(_0x3369bf['error'](0x1f4,_0xee74('0x2f')));}if(_[_0xee74('0x30')](_0x47b06b[_0xee74('0x26')]['body'])||_0x47b06b[_0xee74('0x26')]['body']===''){return _0x381506(_0x3369bf[_0xee74('0x14')](0x1f4,_0xee74('0x31')));}if(_[_0xee74('0x30')](_0x47b06b['body'][_0xee74('0x32')])){return _0x381506(_0x3369bf[_0xee74('0x14')](0x1f4,'mapKey\x20is\x20mandatory,\x20please\x20use\x20one\x20of\x20these:\x20'+_0xd7bae));}if(!_[_0xee74('0x33')](_0xd7bae,_0x47b06b[_0xee74('0x26')]['mapKey'])){return _0x381506(_0x3369bf[_0xee74('0x14')](0x1f4,_0xee74('0x34')+_0xd7bae));}var _0x1791ef={};_0x1791ef[_0x47b06b[_0xee74('0x26')]['mapKey']]=_0x47b06b[_0xee74('0x26')][_0xee74('0x2e')];return db['MailAccount'][_0xee74('0x35')]({'where':{'id':_0x47b06b['account']['id']},'include':[{'model':db['CmList'],'as':_0xee74('0x36'),'include':[{'model':db[_0xee74('0x29')],'as':_0xee74('0x37'),'where':_0x1791ef,'limit':0x1,'order':[[_0xee74('0x2c'),_0xee74('0x38')]]}]},{'model':db[_0xee74('0x39')],'as':_0xee74('0x3a')},{'model':db[_0xee74('0x3b')],'as':_0xee74('0x3c')}]})['then'](function(_0x5ad786){if(_0x5ad786&&_0x5ad786[_0xee74('0x36')]){var _0x296272=_0x5ad786['get']({'plain':!![]});_0x435a7b[_0xee74('0x3d')]=_[_0xee74('0x3e')](_0x296272,['Applications',_0xee74('0x36')]);_0x435a7b[_0xee74('0x3f')]=_0x296272[_0xee74('0x3a')];_0x435a7b[_0xee74('0x40')]=_0x296272[_0xee74('0x36')];_0x435a7b[_0xee74('0x3f')]=_[_0xee74('0x41')](_0x435a7b['applications'],[_0xee74('0x42')],[_0xee74('0x43')]);if(_0x435a7b[_0xee74('0x3d')]&&_0x435a7b['account']['autoclose']){_0x435a7b[_0xee74('0x3f')][_0xee74('0x44')]({'id':0x0,'priority':_0x435a7b[_0xee74('0x3f')][_0xee74('0x45')]+0x1,'app':_0xee74('0x46'),'appdata':_0xee74('0x47'),'interval':_0xee74('0x48')});}if(_0x435a7b['account'][_0xee74('0x3a')]){delete _0x435a7b[_0xee74('0x3d')][_0xee74('0x3a')];}if(_0x435a7b[_0xee74('0x3d')][_0xee74('0x36')]){delete _0x435a7b[_0xee74('0x3d')][_0xee74('0x36')];}if(_0x296272['List'][_0xee74('0x37')][_0xee74('0x45')]){return _0x296272[_0xee74('0x36')][_0xee74('0x37')][0x0];}var _0x1e3558=_[_0xee74('0x49')](_0x47b06b[_0xee74('0x26')],{'firstName':_0x47b06b[_0xee74('0x26')]['from'],'ListId':_0x296272[_0xee74('0x2d')]});_0x1e3558[_0x47b06b[_0xee74('0x26')][_0xee74('0x32')]]=_0x47b06b['body'][_0xee74('0x2e')];return db[_0xee74('0x29')]['create'](_0x1e3558);}else{throw new Error(_0xee74('0x4a'));}})[_0xee74('0x23')](function(_0x580b8f){_0x435a7b['contact']=_0x580b8f;if(_0x580b8f){if(!_0x47b06b[_0xee74('0x26')]['message'][_0xee74('0x4b')]){_0x47b06b['body']['message'][_0xee74('0x4b')]=rs['generate']()+'\x20'+_0x47b06b[_0xee74('0x26')][_0xee74('0x16')]['from'];}var _0x530847={'ContactId':_0x580b8f['id'],'MailAccountId':_0x47b06b[_0xee74('0x3d')]['id'],'inReplyTo':_0x47b06b[_0xee74('0x26')]['message']['messageId'],'to':_0x47b06b[_0xee74('0x26')][_0xee74('0x16')][_0xee74('0x2e')],'cc':_0x47b06b[_0xee74('0x26')][_0xee74('0x16')]['cc'],'subject':_0x47b06b[_0xee74('0x26')]['message'][_0xee74('0x4c')],'attach':_0x47b06b[_0xee74('0x26')][_0xee74('0x16')]['attach'],'lastMsgAt':moment()[_0xee74('0x4d')](_0xee74('0x4e')),'lastMsgDirection':'in','lastMsgBody':_0x47b06b[_0xee74('0x26')][_0xee74('0x26')]};return db['MailInteraction'][_0xee74('0x35')]({'where':{'closed':![],'MailAccountId':_0x47b06b[_0xee74('0x3d')]['id']},'include':[{'model':db[_0xee74('0x4f')],'as':_0xee74('0x50'),'attributes':[_0xee74('0x4b')],'where':{'messageId':_0x47b06b[_0xee74('0x26')]['message']['inReplyTo']}}]})['then'](function(_0x2a9ff7){if(_0x2a9ff7){return[_0x2a9ff7,![]];}return db[_0xee74('0x51')]['create'](_0x530847)[_0xee74('0x23')](function(_0x5e18ab){return[_0x5e18ab,!![]];});});}else{throw new Error(_0xee74('0x52'));}})[_0xee74('0x53')](function(_0x260839,_0x40410b){if(_0x260839){_0x31d871=_0x40410b;if(!_0x40410b){return _0x260839[_0xee74('0x54')]({'inReplyTo':_0x47b06b['body'][_0xee74('0x16')][_0xee74('0x4b')],'to':_0x47b06b[_0xee74('0x26')][_0xee74('0x16')][_0xee74('0x2e')],'cc':_0x47b06b['body'][_0xee74('0x16')]['cc'],'subject':_0x47b06b[_0xee74('0x26')][_0xee74('0x16')][_0xee74('0x4c')],'attach':_0x260839[_0xee74('0x55')]?_0x260839[_0xee74('0x55')]:_0x47b06b[_0xee74('0x26')]['message']['attach'],'substatus':null,'substatusAt':moment()[_0xee74('0x4d')](_0xee74('0x4e')),'lastMsgAt':moment()[_0xee74('0x4d')](_0xee74('0x4e')),'lastMsgDirection':'in','lastMsgBody':_0x47b06b['body'][_0xee74('0x26')]});}else{return _0x260839;}}})[_0xee74('0x23')](function(_0x47d2b9){_0x435a7b[_0xee74('0x56')]=_0x47d2b9[_0xee74('0x57')]({'plain':!![]});_0x435a7b[_0xee74('0x56')][_0xee74('0x58')]=_0x31d871;return db['MailMessage'][_0xee74('0x59')]({'body':_0x47b06b[_0xee74('0x26')][_0xee74('0x26')],'MailAccountId':_0x47b06b[_0xee74('0x3d')]['id'],'MailInteractionId':_0x47d2b9['id'],'direction':'in','ContactId':_0x435a7b['contact']['id'],'messageId':_0x47b06b[_0xee74('0x26')][_0xee74('0x16')]['messageId'],'from':_0x47b06b[_0xee74('0x26')][_0xee74('0x16')][_0xee74('0x2e')],'to':_0x47b06b[_0xee74('0x26')]['message']['to'],'cc':_0x47b06b[_0xee74('0x26')][_0xee74('0x16')]['cc'],'subject':_0x47b06b[_0xee74('0x26')]['message'][_0xee74('0x4c')],'attach':_0x47b06b[_0xee74('0x26')][_0xee74('0x16')][_0xee74('0x55')],'Attachments':_0x47b06b[_0xee74('0x26')]['message'][_0xee74('0x5a')],'originTo':_0x47b06b[_0xee74('0x26')][_0xee74('0x16')]['originTo'],'originCc':_0x47b06b[_0xee74('0x26')][_0xee74('0x16')][_0xee74('0x5b')],'bcc':_0x47b06b[_0xee74('0x26')][_0xee74('0x16')][_0xee74('0x5c')]},{'include':[{'model':db['Attachment'],'as':_0xee74('0x5d')}]});})[_0xee74('0x23')](function(_0x1cfb84){_0x435a7b[_0xee74('0x16')]=_0x1cfb84;if(_0x435a7b[_0xee74('0x56')]['UserId']){return db[_0xee74('0x5e')][_0xee74('0x35')]({'attributes':['id',_0xee74('0x5f')],'where':{'id':_0x435a7b[_0xee74('0x56')][_0xee74('0x60')]}})[_0xee74('0x23')](function(_0x364da4){if(_0x364da4){_0x435a7b['applications'][_0xee74('0x61')]({'id':0x0,'priority':0x0,'app':_0xee74('0x62'),'appdata':_0x364da4[_0xee74('0x5f')]+','+(_0x435a7b[_0xee74('0x3d')][_0xee74('0x63')]||0xa),'interval':'*,*,*,*'});}return respondWithRpcPromise('Start','startRouting',_0x435a7b);});}return respondWithRpcPromise('Start',_0xee74('0x64'),_0x435a7b);})['then'](function(_0x216481){_0x5db032(_0x216481);})['catch'](function(_0xa72819){_0x381506(_0x3369bf['error'](0x1f4,_0xa72819[_0xee74('0x16')]));});});};
\ No newline at end of file
diff --git a/server/api/mailAccount/mailAccount.socket.js b/server/api/mailAccount/mailAccount.socket.js
index ffd8476..5d04d38 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 _0xdc97=['./mailAccount.events','save','remove','emit','removeListener','register','mailAccount:'];(function(_0x836465,_0x5442ae){var _0x2150ea=function(_0x4f4bc2){while(--_0x4f4bc2){_0x836465['push'](_0x836465['shift']());}};_0x2150ea(++_0x5442ae);}(_0xdc97,0x13b));var _0x7dc9=function(_0x4e71f5,_0x470618){_0x4e71f5=_0x4e71f5-0x0;var _0x24cd70=_0xdc97[_0x4e71f5];return _0x24cd70;};'use strict';var MailAccountEvents=require(_0x7dc9('0x0'));var events=[_0x7dc9('0x1'),_0x7dc9('0x2'),'update'];function createListener(_0x2913e6,_0x4f5c88){return function(_0x228e39){_0x4f5c88[_0x7dc9('0x3')](_0x2913e6,_0x228e39);};}function removeListener(_0x478a95,_0x2a77c1){return function(){MailAccountEvents[_0x7dc9('0x4')](_0x478a95,_0x2a77c1);};}exports[_0x7dc9('0x5')]=function(_0x3ba3ca){for(var _0x589f02=0x0,_0x2636ef=events['length'];_0x589f02<_0x2636ef;_0x589f02++){var _0x4b3229=events[_0x589f02];var _0x2ff923=createListener(_0x7dc9('0x6')+_0x4b3229,_0x3ba3ca);MailAccountEvents['on'](_0x4b3229,_0x2ff923);}};
\ No newline at end of file
+var _0x1354=['save','remove','update','removeListener','length','./mailAccount.events'];(function(_0x26aee4,_0x530ead){var _0x2e1048=function(_0x2e92db){while(--_0x2e92db){_0x26aee4['push'](_0x26aee4['shift']());}};_0x2e1048(++_0x530ead);}(_0x1354,0x95));var _0x4135=function(_0x4fe496,_0x1d8673){_0x4fe496=_0x4fe496-0x0;var _0x422b24=_0x1354[_0x4fe496];return _0x422b24;};'use strict';var MailAccountEvents=require(_0x4135('0x0'));var events=[_0x4135('0x1'),_0x4135('0x2'),_0x4135('0x3')];function createListener(_0x41c8f3,_0x435d5e){return function(_0x102fec){_0x435d5e['emit'](_0x41c8f3,_0x102fec);};}function removeListener(_0x2c75a3,_0x4ed434){return function(){MailAccountEvents[_0x4135('0x4')](_0x2c75a3,_0x4ed434);};}exports['register']=function(_0x14ff47){for(var _0x2bcd68=0x0,_0x5e355d=events[_0x4135('0x5')];_0x2bcd68<_0x5e355d;_0x2bcd68++){var _0x1dcce0=events[_0x2bcd68];var _0x3e7ae3=createListener('mailAccount:'+_0x1dcce0,_0x14ff47);MailAccountEvents['on'](_0x1dcce0,_0x3e7ae3);}};
\ No newline at end of file
diff --git a/server/api/mailApplication/index.js b/server/api/mailApplication/index.js
index 316fab5..8727c0c 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 _0xea28=['/:id','show','put','isAuthenticated','update','delete','destroy','exports','multer','util','path','connect-timeout','express','Router','../../components/auth/service','../../components/interaction/service','./mailApplication.controller','get'];(function(_0x501510,_0x61caa9){var _0x1e6ee5=function(_0x32845b){while(--_0x32845b){_0x501510['push'](_0x501510['shift']());}};_0x1e6ee5(++_0x61caa9);}(_0xea28,0x13a));var _0x8ea2=function(_0x2fbeba,_0x584069){_0x2fbeba=_0x2fbeba-0x0;var _0x598aa3=_0xea28[_0x2fbeba];return _0x598aa3;};'use strict';var multer=require(_0x8ea2('0x0'));var util=require(_0x8ea2('0x1'));var path=require(_0x8ea2('0x2'));var timeout=require(_0x8ea2('0x3'));var express=require(_0x8ea2('0x4'));var router=express[_0x8ea2('0x5')]();var auth=require(_0x8ea2('0x6'));var interaction=require(_0x8ea2('0x7'));var config=require('../../config/environment');var controller=require(_0x8ea2('0x8'));router[_0x8ea2('0x9')](_0x8ea2('0xa'),auth['isAuthenticated'](),controller[_0x8ea2('0xb')]);router[_0x8ea2('0xc')](_0x8ea2('0xa'),auth[_0x8ea2('0xd')](),controller[_0x8ea2('0xe')]);router[_0x8ea2('0xf')](_0x8ea2('0xa'),auth[_0x8ea2('0xd')](),controller[_0x8ea2('0x10')]);module[_0x8ea2('0x11')]=router;
\ No newline at end of file
+var _0x2f68=['util','path','connect-timeout','express','../../components/auth/service','../../config/environment','./mailApplication.controller','/:id','isAuthenticated','delete','exports'];(function(_0x20a584,_0xe384a5){var _0x4b41a8=function(_0x2127c6){while(--_0x2127c6){_0x20a584['push'](_0x20a584['shift']());}};_0x4b41a8(++_0xe384a5);}(_0x2f68,0x9a));var _0x82f6=function(_0x16302e,_0x55ce6a){_0x16302e=_0x16302e-0x0;var _0x3c440a=_0x2f68[_0x16302e];return _0x3c440a;};'use strict';var multer=require('multer');var util=require(_0x82f6('0x0'));var path=require(_0x82f6('0x1'));var timeout=require(_0x82f6('0x2'));var express=require(_0x82f6('0x3'));var router=express['Router']();var auth=require(_0x82f6('0x4'));var interaction=require('../../components/interaction/service');var config=require(_0x82f6('0x5'));var controller=require(_0x82f6('0x6'));router['get'](_0x82f6('0x7'),auth[_0x82f6('0x8')](),controller['show']);router['put'](_0x82f6('0x7'),auth['isAuthenticated'](),controller['update']);router[_0x82f6('0x9')](_0x82f6('0x7'),auth[_0x82f6('0x8')](),controller['destroy']);module[_0x82f6('0xa')]=router;
\ No newline at end of file
diff --git a/server/api/mailApplication/mailApplication.attributes.js b/server/api/mailApplication/mailApplication.attributes.js
index d83b20a..2639c92 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 _0x6612=['STRING','TEXT','*,*,*,*','INTEGER'];(function(_0x421e36,_0x18776e){var _0x20b3e3=function(_0x767de4){while(--_0x767de4){_0x421e36['push'](_0x421e36['shift']());}};_0x20b3e3(++_0x18776e);}(_0x6612,0x127));var _0x2661=function(_0x46aff0,_0x122890){_0x46aff0=_0x46aff0-0x0;var _0x9d78cf=_0x6612[_0x46aff0];return _0x9d78cf;};'use strict';var Sequelize=require('sequelize');module['exports']={'priority':{'type':Sequelize[_0x2661('0x0')],'allowNull':![]},'app':{'type':Sequelize[_0x2661('0x1')],'allowNull':![],'defaultValue':'noop'},'appdata':{'type':Sequelize[_0x2661('0x2')]()},'description':{'type':Sequelize[_0x2661('0x1')]},'interval':{'type':Sequelize[_0x2661('0x1')],'defaultValue':_0x2661('0x3')}};
\ No newline at end of file
+var _0xa16c=['TEXT','*,*,*,*','sequelize','exports','INTEGER','STRING','noop'];(function(_0x2b7764,_0x2606f1){var _0x848dcb=function(_0x1ae85b){while(--_0x1ae85b){_0x2b7764['push'](_0x2b7764['shift']());}};_0x848dcb(++_0x2606f1);}(_0xa16c,0x121));var _0xca16=function(_0x449c15,_0x54d69c){_0x449c15=_0x449c15-0x0;var _0x274bcc=_0xa16c[_0x449c15];return _0x274bcc;};'use strict';var Sequelize=require(_0xca16('0x0'));module[_0xca16('0x1')]={'priority':{'type':Sequelize[_0xca16('0x2')],'allowNull':![]},'app':{'type':Sequelize[_0xca16('0x3')],'allowNull':![],'defaultValue':_0xca16('0x4')},'appdata':{'type':Sequelize[_0xca16('0x5')]()},'description':{'type':Sequelize[_0xca16('0x3')]},'interval':{'type':Sequelize[_0xca16('0x3')],'defaultValue':_0xca16('0x6')}};
\ No newline at end of file
diff --git a/server/api/mailApplication/mailApplication.controller.js b/server/api/mailApplication/mailApplication.controller.js
index 7193632..878b9b3 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 _0x8fcb=['apply','reject','save','update','then','destroy','end','error','stack','name','send','show','params','model','keys','rawAttributes','query','intersection','attributes','fields','length','merge','MailApplication','body','catch','html-pdf','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','mustache','path','sox','to-csv','ejs','lodash','squel','crypto','desk.js','papaparse','ioredis','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/environment','../../mysqldb','sendStatus','status','count','offset','set','json'];(function(_0x2502b7,_0x165d54){var _0x1c8c36=function(_0x9ac276){while(--_0x9ac276){_0x2502b7['push'](_0x2502b7['shift']());}};_0x1c8c36(++_0x165d54);}(_0x8fcb,0xbe));var _0xb8fc=function(_0x270644,_0x559bf0){_0x270644=_0x270644-0x0;var _0x532f6e=_0x8fcb[_0x270644];return _0x532f6e;};'use strict';var pdf=require(_0xb8fc('0x0'));var emlformat=require(_0xb8fc('0x1'));var rimraf=require(_0xb8fc('0x2'));var zipdir=require(_0xb8fc('0x3'));var jsonpatch=require(_0xb8fc('0x4'));var rp=require(_0xb8fc('0x5'));var moment=require('moment');var BPromise=require('bluebird');var Mustache=require(_0xb8fc('0x6'));var util=require('util');var path=require(_0xb8fc('0x7'));var sox=require(_0xb8fc('0x8'));var csv=require(_0xb8fc('0x9'));var ejs=require(_0xb8fc('0xa'));var fs=require('fs');var _=require(_0xb8fc('0xb'));var squel=require(_0xb8fc('0xc'));var crypto=require(_0xb8fc('0xd'));var jsforce=require('jsforce');var deskjs=require(_0xb8fc('0xe'));var toCsv=require(_0xb8fc('0x9'));var querystring=require('querystring');var Papa=require(_0xb8fc('0xf'));var Redis=require(_0xb8fc('0x10'));var authService=require('../../components/auth/service');var qs=require(_0xb8fc('0x11'));var as=require(_0xb8fc('0x12'));var hardwareService=require(_0xb8fc('0x13'));var logger=require(_0xb8fc('0x14'))(_0xb8fc('0x15'));var utils=require('../../config/utils');var config=require(_0xb8fc('0x16'));var db=require(_0xb8fc('0x17'))['db'];function respondWithStatusCode(_0x5cc2c5,_0x5e713b){_0x5e713b=_0x5e713b||0xcc;return function(_0x1e7e96){if(_0x1e7e96){return _0x5cc2c5[_0xb8fc('0x18')](_0x5e713b);}return _0x5cc2c5[_0xb8fc('0x19')](_0x5e713b)['end']();};}function respondWithResult(_0x3a41b6,_0x261ad6){_0x261ad6=_0x261ad6||0xc8;return function(_0x1df0ca){if(_0x1df0ca){return _0x3a41b6['status'](_0x261ad6)['json'](_0x1df0ca);}};}function respondWithFilteredResult(_0x5cf30e,_0x42b21f){return function(_0x10411d){if(_0x10411d){var _0x37d675=_0x10411d[_0xb8fc('0x1a')],_0x1066a9=_0x42b21f[_0xb8fc('0x1b')],_0x1efbd3=_0x42b21f['offset']+_0x42b21f['limit'],_0x40721e;if(_0x1efbd3>=_0x37d675){_0x1efbd3=_0x37d675;_0x40721e=0xc8;}else{_0x40721e=0xce;}_0x5cf30e[_0xb8fc('0x19')](_0x40721e);return _0x5cf30e[_0xb8fc('0x1c')]('Content-Range',_0x1066a9+'-'+_0x1efbd3+'/'+_0x37d675)[_0xb8fc('0x1d')](_0x10411d);}return null;};}function patchUpdates(_0x3d821c){return function(_0x11f8b2){try{jsonpatch[_0xb8fc('0x1e')](_0x11f8b2,_0x3d821c,!![]);}catch(_0x39ebb0){return BPromise[_0xb8fc('0x1f')](_0x39ebb0);}return _0x11f8b2[_0xb8fc('0x20')]();};}function saveUpdates(_0x174900,_0xe1d1f3){return function(_0x1bfbb9){if(_0x1bfbb9){return _0x1bfbb9[_0xb8fc('0x21')](_0x174900)[_0xb8fc('0x22')](function(_0x24b78b){return _0x24b78b;});}return null;};}function removeEntity(_0x495ee0,_0x5c790f){return function(_0x31c5c7){if(_0x31c5c7){return _0x31c5c7[_0xb8fc('0x23')]()['then'](function(){_0x495ee0['status'](0xcc)[_0xb8fc('0x24')]();});}};}function handleEntityNotFound(_0x5c7cad,_0x68b39d){return function(_0x67f2ee){if(!_0x67f2ee){_0x5c7cad[_0xb8fc('0x18')](0x194);}return _0x67f2ee;};}function handleError(_0x29f7ea,_0x2b8234){_0x2b8234=_0x2b8234||0x1f4;return function(_0x2e8240){logger[_0xb8fc('0x25')](_0x2e8240[_0xb8fc('0x26')]);if(_0x2e8240[_0xb8fc('0x27')]){delete _0x2e8240[_0xb8fc('0x27')];}_0x29f7ea['status'](_0x2b8234)[_0xb8fc('0x28')](_0x2e8240);};}exports[_0xb8fc('0x29')]=function(_0x58550f,_0x44bbdc){var _0x47e48b={'raw':!![],'where':{'id':_0x58550f[_0xb8fc('0x2a')]['id']}},_0x26bc63={};_0x26bc63[_0xb8fc('0x2b')]=_[_0xb8fc('0x2c')](db['MailApplication'][_0xb8fc('0x2d')]);_0x26bc63[_0xb8fc('0x2e')]=_[_0xb8fc('0x2c')](_0x58550f[_0xb8fc('0x2e')]);_0x26bc63['filters']=_[_0xb8fc('0x2f')](_0x26bc63[_0xb8fc('0x2b')],_0x26bc63[_0xb8fc('0x2e')]);_0x47e48b[_0xb8fc('0x30')]=_[_0xb8fc('0x2f')](_0x26bc63[_0xb8fc('0x2b')],qs['fields'](_0x58550f['query'][_0xb8fc('0x31')]));_0x47e48b[_0xb8fc('0x30')]=_0x47e48b[_0xb8fc('0x30')][_0xb8fc('0x32')]?_0x47e48b[_0xb8fc('0x30')]:_0x26bc63['model'];if(_0x58550f[_0xb8fc('0x2e')]['includeAll']){_0x47e48b['include']=[{'all':!![]}];}_0x47e48b=_[_0xb8fc('0x33')]({},_0x47e48b,_0x58550f['options']);return db[_0xb8fc('0x34')]['find'](_0x47e48b)[_0xb8fc('0x22')](handleEntityNotFound(_0x44bbdc,null))[_0xb8fc('0x22')](respondWithResult(_0x44bbdc,null))['catch'](handleError(_0x44bbdc,null));};exports[_0xb8fc('0x21')]=function(_0x1a2b68,_0x1cc819){if(_0x1a2b68[_0xb8fc('0x35')]['id']){delete _0x1a2b68[_0xb8fc('0x35')]['id'];}return db[_0xb8fc('0x34')]['find']({'where':{'id':_0x1a2b68[_0xb8fc('0x2a')]['id']}})[_0xb8fc('0x22')](handleEntityNotFound(_0x1cc819,null))[_0xb8fc('0x22')](saveUpdates(_0x1a2b68[_0xb8fc('0x35')],null))[_0xb8fc('0x22')](respondWithResult(_0x1cc819,null))[_0xb8fc('0x36')](handleError(_0x1cc819,null));};exports[_0xb8fc('0x23')]=function(_0x50ca4a,_0x4dd479){return db['MailApplication']['find']({'where':{'id':_0x50ca4a[_0xb8fc('0x2a')]['id']}})[_0xb8fc('0x22')](handleEntityNotFound(_0x4dd479,null))[_0xb8fc('0x22')](removeEntity(_0x4dd479,null))[_0xb8fc('0x36')](handleError(_0x4dd479,null));};
\ No newline at end of file
+var _0xd333=['bluebird','mustache','util','to-csv','ejs','lodash','squel','crypto','jsforce','desk.js','querystring','papaparse','../../components/parsers/advancedSearch','../../config/license/hardware','api','../../config/utils','../../config/environment','../../mysqldb','sendStatus','end','status','json','count','offset','limit','set','Content-Range','reject','save','then','destroy','error','stack','name','send','show','params','model','keys','rawAttributes','query','filters','attributes','fields','include','merge','options','catch','body','find','rimraf','zip-dir','request-promise'];(function(_0x417d17,_0x17bb4f){var _0x3224ac=function(_0x4f96d4){while(--_0x4f96d4){_0x417d17['push'](_0x417d17['shift']());}};_0x3224ac(++_0x17bb4f);}(_0xd333,0x106));var _0x3d33=function(_0x1bd68f,_0x2897c0){_0x1bd68f=_0x1bd68f-0x0;var _0x34889f=_0xd333[_0x1bd68f];return _0x34889f;};'use strict';var pdf=require('html-pdf');var emlformat=require('eml-format');var rimraf=require(_0x3d33('0x0'));var zipdir=require(_0x3d33('0x1'));var jsonpatch=require('fast-json-patch');var rp=require(_0x3d33('0x2'));var moment=require('moment');var BPromise=require(_0x3d33('0x3'));var Mustache=require(_0x3d33('0x4'));var util=require(_0x3d33('0x5'));var path=require('path');var sox=require('sox');var csv=require(_0x3d33('0x6'));var ejs=require(_0x3d33('0x7'));var fs=require('fs');var _=require(_0x3d33('0x8'));var squel=require(_0x3d33('0x9'));var crypto=require(_0x3d33('0xa'));var jsforce=require(_0x3d33('0xb'));var deskjs=require(_0x3d33('0xc'));var toCsv=require(_0x3d33('0x6'));var querystring=require(_0x3d33('0xd'));var Papa=require(_0x3d33('0xe'));var Redis=require('ioredis');var authService=require('../../components/auth/service');var qs=require('../../components/parsers/qs');var as=require(_0x3d33('0xf'));var hardwareService=require(_0x3d33('0x10'));var logger=require('../../config/logger')(_0x3d33('0x11'));var utils=require(_0x3d33('0x12'));var config=require(_0x3d33('0x13'));var db=require(_0x3d33('0x14'))['db'];function respondWithStatusCode(_0x3645d1,_0x479e45){_0x479e45=_0x479e45||0xcc;return function(_0x411f8d){if(_0x411f8d){return _0x3645d1[_0x3d33('0x15')](_0x479e45);}return _0x3645d1['status'](_0x479e45)[_0x3d33('0x16')]();};}function respondWithResult(_0x25aeba,_0xa084de){_0xa084de=_0xa084de||0xc8;return function(_0x4e25e5){if(_0x4e25e5){return _0x25aeba[_0x3d33('0x17')](_0xa084de)[_0x3d33('0x18')](_0x4e25e5);}};}function respondWithFilteredResult(_0x3569b7,_0x214369){return function(_0x34aa50){if(_0x34aa50){var _0x499921=_0x34aa50[_0x3d33('0x19')],_0x3d82d0=_0x214369[_0x3d33('0x1a')],_0x1ea80e=_0x214369[_0x3d33('0x1a')]+_0x214369[_0x3d33('0x1b')],_0x5ed840;if(_0x1ea80e>=_0x499921){_0x1ea80e=_0x499921;_0x5ed840=0xc8;}else{_0x5ed840=0xce;}_0x3569b7['status'](_0x5ed840);return _0x3569b7[_0x3d33('0x1c')](_0x3d33('0x1d'),_0x3d82d0+'-'+_0x1ea80e+'/'+_0x499921)[_0x3d33('0x18')](_0x34aa50);}return null;};}function patchUpdates(_0x480ab4){return function(_0x672baa){try{jsonpatch['apply'](_0x672baa,_0x480ab4,!![]);}catch(_0x31c70d){return BPromise[_0x3d33('0x1e')](_0x31c70d);}return _0x672baa[_0x3d33('0x1f')]();};}function saveUpdates(_0x50eca7,_0x5941e6){return function(_0x859aa2){if(_0x859aa2){return _0x859aa2['update'](_0x50eca7)[_0x3d33('0x20')](function(_0xe3cf6f){return _0xe3cf6f;});}return null;};}function removeEntity(_0x55c33d,_0x358af4){return function(_0x33c21e){if(_0x33c21e){return _0x33c21e[_0x3d33('0x21')]()[_0x3d33('0x20')](function(){_0x55c33d[_0x3d33('0x17')](0xcc)[_0x3d33('0x16')]();});}};}function handleEntityNotFound(_0x16bca2,_0x55f502){return function(_0x147474){if(!_0x147474){_0x16bca2[_0x3d33('0x15')](0x194);}return _0x147474;};}function handleError(_0x1d0e53,_0x5ab18c){_0x5ab18c=_0x5ab18c||0x1f4;return function(_0x5b5de5){logger[_0x3d33('0x22')](_0x5b5de5[_0x3d33('0x23')]);if(_0x5b5de5[_0x3d33('0x24')]){delete _0x5b5de5[_0x3d33('0x24')];}_0x1d0e53[_0x3d33('0x17')](_0x5ab18c)[_0x3d33('0x25')](_0x5b5de5);};}exports[_0x3d33('0x26')]=function(_0x51ed5a,_0x10e361){var _0x500f62={'raw':!![],'where':{'id':_0x51ed5a[_0x3d33('0x27')]['id']}},_0x1b38a5={};_0x1b38a5[_0x3d33('0x28')]=_[_0x3d33('0x29')](db['MailApplication'][_0x3d33('0x2a')]);_0x1b38a5[_0x3d33('0x2b')]=_[_0x3d33('0x29')](_0x51ed5a['query']);_0x1b38a5[_0x3d33('0x2c')]=_['intersection'](_0x1b38a5[_0x3d33('0x28')],_0x1b38a5['query']);_0x500f62[_0x3d33('0x2d')]=_['intersection'](_0x1b38a5[_0x3d33('0x28')],qs[_0x3d33('0x2e')](_0x51ed5a[_0x3d33('0x2b')][_0x3d33('0x2e')]));_0x500f62[_0x3d33('0x2d')]=_0x500f62[_0x3d33('0x2d')]['length']?_0x500f62[_0x3d33('0x2d')]:_0x1b38a5['model'];if(_0x51ed5a[_0x3d33('0x2b')]['includeAll']){_0x500f62[_0x3d33('0x2f')]=[{'all':!![]}];}_0x500f62=_[_0x3d33('0x30')]({},_0x500f62,_0x51ed5a[_0x3d33('0x31')]);return db['MailApplication']['find'](_0x500f62)[_0x3d33('0x20')](handleEntityNotFound(_0x10e361,null))[_0x3d33('0x20')](respondWithResult(_0x10e361,null))[_0x3d33('0x32')](handleError(_0x10e361,null));};exports['update']=function(_0x54afb9,_0x706f5e){if(_0x54afb9[_0x3d33('0x33')]['id']){delete _0x54afb9[_0x3d33('0x33')]['id'];}return db['MailApplication']['find']({'where':{'id':_0x54afb9[_0x3d33('0x27')]['id']}})[_0x3d33('0x20')](handleEntityNotFound(_0x706f5e,null))[_0x3d33('0x20')](saveUpdates(_0x54afb9[_0x3d33('0x33')],null))[_0x3d33('0x20')](respondWithResult(_0x706f5e,null))[_0x3d33('0x32')](handleError(_0x706f5e,null));};exports[_0x3d33('0x21')]=function(_0x479b9b,_0x32431b){return db['MailApplication'][_0x3d33('0x34')]({'where':{'id':_0x479b9b[_0x3d33('0x27')]['id']}})[_0x3d33('0x20')](handleEntityNotFound(_0x32431b,null))['then'](removeEntity(_0x32431b,null))[_0x3d33('0x32')](handleError(_0x32431b,null));};
\ No newline at end of file
diff --git a/server/api/mailApplication/mailApplication.model.js b/server/api/mailApplication/mailApplication.model.js
index f2f5533..4089c36 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 _0x94d4=['moment','bluebird','path','rimraf','../../config/environment','./mailApplication.attributes','exports','utf8mb4','utf8mb4_unicode_ci','lodash','util','api'];(function(_0xf7ff4,_0x543a19){var _0x554e6a=function(_0x4b8192){while(--_0x4b8192){_0xf7ff4['push'](_0xf7ff4['shift']());}};_0x554e6a(++_0x543a19);}(_0x94d4,0xa5));var _0x494d=function(_0x8b5f1a,_0x52935b){_0x8b5f1a=_0x8b5f1a-0x0;var _0x18fcb0=_0x94d4[_0x8b5f1a];return _0x18fcb0;};'use strict';var _=require(_0x494d('0x0'));var util=require(_0x494d('0x1'));var logger=require('../../config/logger')(_0x494d('0x2'));var moment=require(_0x494d('0x3'));var BPromise=require(_0x494d('0x4'));var rp=require('request-promise');var fs=require('fs');var path=require(_0x494d('0x5'));var rimraf=require(_0x494d('0x6'));var config=require(_0x494d('0x7'));var attributes=require(_0x494d('0x8'));module[_0x494d('0x9')]=function(_0x1772bd,_0x595c04){return _0x1772bd['define']('MailApplication',attributes,{'tableName':'mail_applications','paranoid':![],'indexes':[],'timestamps':!![],'charset':_0x494d('0xa'),'collate':_0x494d('0xb')});};
\ No newline at end of file
+var _0xc0d7=['request-promise','path','rimraf','../../config/environment','./mailApplication.attributes','exports','define','MailApplication','mail_applications','utf8mb4_unicode_ci','api','moment','bluebird'];(function(_0x30a6d6,_0x603c35){var _0x361ea1=function(_0x4d35a7){while(--_0x4d35a7){_0x30a6d6['push'](_0x30a6d6['shift']());}};_0x361ea1(++_0x603c35);}(_0xc0d7,0x7f));var _0x7c0d=function(_0x35dcf6,_0x5376a9){_0x35dcf6=_0x35dcf6-0x0;var _0x53837c=_0xc0d7[_0x35dcf6];return _0x53837c;};'use strict';var _=require('lodash');var util=require('util');var logger=require('../../config/logger')(_0x7c0d('0x0'));var moment=require(_0x7c0d('0x1'));var BPromise=require(_0x7c0d('0x2'));var rp=require(_0x7c0d('0x3'));var fs=require('fs');var path=require(_0x7c0d('0x4'));var rimraf=require(_0x7c0d('0x5'));var config=require(_0x7c0d('0x6'));var attributes=require(_0x7c0d('0x7'));module[_0x7c0d('0x8')]=function(_0x5a6a70,_0x507bc0){return _0x5a6a70[_0x7c0d('0x9')](_0x7c0d('0xa'),attributes,{'tableName':_0x7c0d('0xb'),'paranoid':![],'indexes':[],'timestamps':!![],'charset':'utf8mb4','collate':_0x7c0d('0xc')});};
\ No newline at end of file
diff --git a/server/api/mailApplication/mailApplication.rpc.js b/server/api/mailApplication/mailApplication.rpc.js
index ccdd3e6..943e6a5 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 _0xa21c=['raw','attributes','lodash','util','moment','bluebird','ioredis','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','http','request','then','MailApplication,\x20%s,\x20%s','request\x20sent','debug','stringify','error','code','message','info','result','catch','UpdateMailApplication','update','body','options'];(function(_0x4ae8e2,_0x4cf1e8){var _0x322a63=function(_0x2b935d){while(--_0x2b935d){_0x4ae8e2['push'](_0x4ae8e2['shift']());}};_0x322a63(++_0x4cf1e8);}(_0xa21c,0x107));var _0xca21=function(_0x11e3b7,_0x1cfba1){_0x11e3b7=_0x11e3b7-0x0;var _0x390ad2=_0xa21c[_0x11e3b7];return _0x390ad2;};'use strict';var _=require(_0xca21('0x0'));var util=require(_0xca21('0x1'));var moment=require(_0xca21('0x2'));var BPromise=require(_0xca21('0x3'));var rs=require('randomstring');var fs=require('fs');var Redis=require(_0xca21('0x4'));var db=require('../../mysqldb')['db'];var utils=require(_0xca21('0x5'));var logger=require(_0xca21('0x6'))(_0xca21('0x7'));var config=require(_0xca21('0x8'));var jayson=require(_0xca21('0x9'));var client=jayson['client'][_0xca21('0xa')]({'port':0x232a});function respondWithRpcPromise(_0xb4d572,_0x5fc78,_0x48b307){return new BPromise(function(_0x3791c3,_0x52acb1){return client[_0xca21('0xb')](_0xb4d572,_0x48b307)[_0xca21('0xc')](function(_0x2ef511){logger['info'](_0xca21('0xd'),_0x5fc78,_0xca21('0xe'));logger[_0xca21('0xf')]('MailApplication,\x20%s,\x20%s,\x20%s',_0x5fc78,'request\x20sent',JSON[_0xca21('0x10')](_0x2ef511));if(_0x2ef511[_0xca21('0x11')]){if(_0x2ef511[_0xca21('0x11')][_0xca21('0x12')]===0x1f4){logger[_0xca21('0x11')]('MailApplication,\x20%s,\x20%s',_0x5fc78,_0x2ef511[_0xca21('0x11')][_0xca21('0x13')]);return _0x52acb1(_0x2ef511[_0xca21('0x11')][_0xca21('0x13')]);}logger[_0xca21('0x11')](_0xca21('0xd'),_0x5fc78,_0x2ef511['error']['message']);return _0x3791c3(_0x2ef511[_0xca21('0x11')]['message']);}else{logger[_0xca21('0x14')]('MailApplication,\x20%s,\x20%s',_0x5fc78,_0xca21('0xe'));_0x3791c3(_0x2ef511[_0xca21('0x15')]['message']);}})[_0xca21('0x16')](function(_0x49c113){logger[_0xca21('0x11')](_0xca21('0xd'),_0x5fc78,_0x49c113);_0x52acb1(_0x49c113);});});}exports[_0xca21('0x17')]=function(_0x5fbcef){var _0x5b1107=this;return new Promise(function(_0x4c1a98,_0x5f0dcf){return db['MailApplication'][_0xca21('0x18')](_0x5fbcef[_0xca21('0x19')],{'raw':_0x5fbcef[_0xca21('0x1a')]?_0x5fbcef['options'][_0xca21('0x1b')]===undefined?!![]:![]:!![],'individualHooks':!![],'where':_0x5fbcef[_0xca21('0x1a')]?_0x5fbcef[_0xca21('0x1a')]['where']||null:null,'attributes':_0x5fbcef['options']?_0x5fbcef[_0xca21('0x1a')][_0xca21('0x1c')]||null:null,'limit':_0x5fbcef[_0xca21('0x1a')]?_0x5fbcef['options']['limit']||null:null})[_0xca21('0xc')](function(_0x5de0c1){logger[_0xca21('0x14')](_0xca21('0x17'),_0x5fbcef);logger[_0xca21('0xf')]('UpdateMailApplication',_0x5fbcef,JSON['stringify'](_0x5de0c1));_0x4c1a98(_0x5de0c1);})['catch'](function(_0x8d4c2e){logger['error'](_0xca21('0x17'),_0x8d4c2e[_0xca21('0x13')],_0x5fbcef);_0x5f0dcf(_0x5b1107[_0xca21('0x11')](0x1f4,_0x8d4c2e[_0xca21('0x13')]));});});};
\ No newline at end of file
+var _0xbb62=['moment','randomstring','ioredis','../../config/logger','../../config/environment','jayson/promise','client','http','request','then','info','MailApplication,\x20%s,\x20%s','request\x20sent','debug','MailApplication,\x20%s,\x20%s,\x20%s','stringify','error','code','message','result','catch','UpdateMailApplication','MailApplication','update','body','options','raw','attributes','limit','lodash','util'];(function(_0x3bf83f,_0x181cac){var _0x22c4a9=function(_0xb3ff0d){while(--_0xb3ff0d){_0x3bf83f['push'](_0x3bf83f['shift']());}};_0x22c4a9(++_0x181cac);}(_0xbb62,0x191));var _0x2bb6=function(_0x1a8f86,_0x5ed9c4){_0x1a8f86=_0x1a8f86-0x0;var _0x20d876=_0xbb62[_0x1a8f86];return _0x20d876;};'use strict';var _=require(_0x2bb6('0x0'));var util=require(_0x2bb6('0x1'));var moment=require(_0x2bb6('0x2'));var BPromise=require('bluebird');var rs=require(_0x2bb6('0x3'));var fs=require('fs');var Redis=require(_0x2bb6('0x4'));var db=require('../../mysqldb')['db'];var utils=require('../../config/utils');var logger=require(_0x2bb6('0x5'))('rpc');var config=require(_0x2bb6('0x6'));var jayson=require(_0x2bb6('0x7'));var client=jayson[_0x2bb6('0x8')][_0x2bb6('0x9')]({'port':0x232a});function respondWithRpcPromise(_0x5756c9,_0x284589,_0x29fe0a){return new BPromise(function(_0x38964f,_0x2ef70c){return client[_0x2bb6('0xa')](_0x5756c9,_0x29fe0a)[_0x2bb6('0xb')](function(_0x116f19){logger[_0x2bb6('0xc')](_0x2bb6('0xd'),_0x284589,_0x2bb6('0xe'));logger[_0x2bb6('0xf')](_0x2bb6('0x10'),_0x284589,'request\x20sent',JSON[_0x2bb6('0x11')](_0x116f19));if(_0x116f19[_0x2bb6('0x12')]){if(_0x116f19[_0x2bb6('0x12')][_0x2bb6('0x13')]===0x1f4){logger[_0x2bb6('0x12')]('MailApplication,\x20%s,\x20%s',_0x284589,_0x116f19[_0x2bb6('0x12')][_0x2bb6('0x14')]);return _0x2ef70c(_0x116f19[_0x2bb6('0x12')][_0x2bb6('0x14')]);}logger[_0x2bb6('0x12')](_0x2bb6('0xd'),_0x284589,_0x116f19[_0x2bb6('0x12')][_0x2bb6('0x14')]);return _0x38964f(_0x116f19[_0x2bb6('0x12')]['message']);}else{logger[_0x2bb6('0xc')](_0x2bb6('0xd'),_0x284589,_0x2bb6('0xe'));_0x38964f(_0x116f19[_0x2bb6('0x15')][_0x2bb6('0x14')]);}})[_0x2bb6('0x16')](function(_0x4702be){logger[_0x2bb6('0x12')](_0x2bb6('0xd'),_0x284589,_0x4702be);_0x2ef70c(_0x4702be);});});}exports[_0x2bb6('0x17')]=function(_0x2549d3){var _0x26bc7a=this;return new Promise(function(_0x3c2910,_0x423522){return db[_0x2bb6('0x18')][_0x2bb6('0x19')](_0x2549d3[_0x2bb6('0x1a')],{'raw':_0x2549d3['options']?_0x2549d3[_0x2bb6('0x1b')][_0x2bb6('0x1c')]===undefined?!![]:![]:!![],'individualHooks':!![],'where':_0x2549d3[_0x2bb6('0x1b')]?_0x2549d3['options']['where']||null:null,'attributes':_0x2549d3[_0x2bb6('0x1b')]?_0x2549d3[_0x2bb6('0x1b')][_0x2bb6('0x1d')]||null:null,'limit':_0x2549d3[_0x2bb6('0x1b')]?_0x2549d3[_0x2bb6('0x1b')][_0x2bb6('0x1e')]||null:null})[_0x2bb6('0xb')](function(_0x2964d1){logger[_0x2bb6('0xc')](_0x2bb6('0x17'),_0x2549d3);logger[_0x2bb6('0xf')](_0x2bb6('0x17'),_0x2549d3,JSON[_0x2bb6('0x11')](_0x2964d1));_0x3c2910(_0x2964d1);})['catch'](function(_0x19293e){logger['error'](_0x2bb6('0x17'),_0x19293e['message'],_0x2549d3);_0x423522(_0x26bc7a[_0x2bb6('0x12')](0x1f4,_0x19293e[_0x2bb6('0x14')]));});});};
\ No newline at end of file
diff --git a/server/api/mailInteraction/index.js b/server/api/mailInteraction/index.js
index fcf0a8c..eeb4a4a 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 _0x8a62=['Router','../../components/interaction/service','../../config/environment','./mailInteraction.controller','get','isAuthenticated','index','/describe','describe','/:id','show','/:id/messages','/:id/download','download','create','addMessage','post','tracked','addTags','put','mailinteraction:update','update','delete','mailinteraction:destroy','destroy','/:id/tags','removeTags','multer','path','connect-timeout','express'];(function(_0x156f11,_0x5bfb06){var _0x4567e3=function(_0x29f917){while(--_0x29f917){_0x156f11['push'](_0x156f11['shift']());}};_0x4567e3(++_0x5bfb06);}(_0x8a62,0x18f));var _0x28a6=function(_0x5b57dd,_0x12fc3c){_0x5b57dd=_0x5b57dd-0x0;var _0x573267=_0x8a62[_0x5b57dd];return _0x573267;};'use strict';var multer=require(_0x28a6('0x0'));var util=require('util');var path=require(_0x28a6('0x1'));var timeout=require(_0x28a6('0x2'));var express=require(_0x28a6('0x3'));var router=express[_0x28a6('0x4')]();var auth=require('../../components/auth/service');var interaction=require(_0x28a6('0x5'));var config=require(_0x28a6('0x6'));var controller=require(_0x28a6('0x7'));router[_0x28a6('0x8')]('/',auth[_0x28a6('0x9')](),controller[_0x28a6('0xa')]);router[_0x28a6('0x8')](_0x28a6('0xb'),auth['isAuthenticated'](),controller[_0x28a6('0xc')]);router[_0x28a6('0x8')](_0x28a6('0xd'),auth['isAuthenticated'](),controller[_0x28a6('0xe')]);router['get'](_0x28a6('0xf'),auth[_0x28a6('0x9')](),controller['getMessages']);router['get'](_0x28a6('0x10'),auth['isAuthenticated'](),controller[_0x28a6('0x11')]);router['post']('/',auth[_0x28a6('0x9')](),controller[_0x28a6('0x12')]);router['post'](_0x28a6('0xf'),auth[_0x28a6('0x9')](),controller[_0x28a6('0x13')]);router[_0x28a6('0x14')]('/:id/tags',auth[_0x28a6('0x9')](),interaction[_0x28a6('0x15')]('mail','mailinteraction:addtags'),controller[_0x28a6('0x16')]);router[_0x28a6('0x17')](_0x28a6('0xd'),auth[_0x28a6('0x9')](),interaction[_0x28a6('0x15')]('mail',_0x28a6('0x18')),controller[_0x28a6('0x19')]);router[_0x28a6('0x1a')](_0x28a6('0xd'),auth['isAuthenticated'](),interaction['tracked']('mail',_0x28a6('0x1b')),controller[_0x28a6('0x1c')]);router['delete'](_0x28a6('0x1d'),auth[_0x28a6('0x9')](),controller[_0x28a6('0x1e')]);module['exports']=router;
\ No newline at end of file
+var _0xdbce=['isAuthenticated','index','/describe','describe','show','/:id/messages','getMessages','/:id/download','download','post','create','tracked','mail','mailinteraction:addtags','addTags','/:id','mailinteraction:update','update','mailinteraction:destroy','/:id/tags','exports','multer','path','express','Router','../../components/auth/service','../../components/interaction/service','get'];(function(_0x1df6b9,_0x270fd4){var _0x104522=function(_0x48aa52){while(--_0x48aa52){_0x1df6b9['push'](_0x1df6b9['shift']());}};_0x104522(++_0x270fd4);}(_0xdbce,0x1f1));var _0xedbc=function(_0x110782,_0x3a0236){_0x110782=_0x110782-0x0;var _0x20d9d1=_0xdbce[_0x110782];return _0x20d9d1;};'use strict';var multer=require(_0xedbc('0x0'));var util=require('util');var path=require(_0xedbc('0x1'));var timeout=require('connect-timeout');var express=require(_0xedbc('0x2'));var router=express[_0xedbc('0x3')]();var auth=require(_0xedbc('0x4'));var interaction=require(_0xedbc('0x5'));var config=require('../../config/environment');var controller=require('./mailInteraction.controller');router[_0xedbc('0x6')]('/',auth[_0xedbc('0x7')](),controller[_0xedbc('0x8')]);router[_0xedbc('0x6')](_0xedbc('0x9'),auth[_0xedbc('0x7')](),controller[_0xedbc('0xa')]);router[_0xedbc('0x6')]('/:id',auth[_0xedbc('0x7')](),controller[_0xedbc('0xb')]);router[_0xedbc('0x6')](_0xedbc('0xc'),auth[_0xedbc('0x7')](),controller[_0xedbc('0xd')]);router[_0xedbc('0x6')](_0xedbc('0xe'),auth[_0xedbc('0x7')](),controller[_0xedbc('0xf')]);router[_0xedbc('0x10')]('/',auth[_0xedbc('0x7')](),controller[_0xedbc('0x11')]);router[_0xedbc('0x10')](_0xedbc('0xc'),auth[_0xedbc('0x7')](),controller['addMessage']);router['post']('/:id/tags',auth[_0xedbc('0x7')](),interaction[_0xedbc('0x12')](_0xedbc('0x13'),_0xedbc('0x14')),controller[_0xedbc('0x15')]);router['put'](_0xedbc('0x16'),auth[_0xedbc('0x7')](),interaction[_0xedbc('0x12')](_0xedbc('0x13'),_0xedbc('0x17')),controller[_0xedbc('0x18')]);router['delete'](_0xedbc('0x16'),auth[_0xedbc('0x7')](),interaction[_0xedbc('0x12')](_0xedbc('0x13'),_0xedbc('0x19')),controller['destroy']);router['delete'](_0xedbc('0x1a'),auth[_0xedbc('0x7')](),controller['removeTags']);module[_0xedbc('0x1b')]=router;
\ No newline at end of file
diff --git a/server/api/mailInteraction/mailInteraction.attributes.js b/server/api/mailInteraction/mailInteraction.attributes.js
index d1ff7b3..58af6ba 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 _0xbaeb=['DATE','STRING','TEXT','ENUM','out','long','sequelize','exports','BOOLEAN'];(function(_0x5f0fd2,_0x4e35ba){var _0xa9eb71=function(_0x20bf44){while(--_0x20bf44){_0x5f0fd2['push'](_0x5f0fd2['shift']());}};_0xa9eb71(++_0x4e35ba);}(_0xbaeb,0x14a));var _0xbbae=function(_0x3e5267,_0x191c1e){_0x3e5267=_0x3e5267-0x0;var _0x43fc94=_0xbaeb[_0x3e5267];return _0x43fc94;};'use strict';var Sequelize=require(_0xbbae('0x0'));var iconv=require('iconv');module[_0xbbae('0x1')]={'closed':{'type':Sequelize[_0xbbae('0x2')],'defaultValue':![]},'closedAt':{'type':Sequelize[_0xbbae('0x3')]},'disposition':{'type':Sequelize[_0xbbae('0x4')]},'note':{'type':Sequelize[_0xbbae('0x4')]},'inReplyTo':{'type':Sequelize['STRING'](0x1fe)},'to':{'type':Sequelize[_0xbbae('0x4')]},'cc':{'type':Sequelize[_0xbbae('0x5')]('long')},'subject':{'type':Sequelize[_0xbbae('0x5')]()},'attach':{'type':Sequelize[_0xbbae('0x2')],'defaultValue':![]},'read1stAt':{'type':Sequelize[_0xbbae('0x3')]},'substatus':{'type':Sequelize[_0xbbae('0x4')](0x3c)},'substatusAt':{'type':Sequelize[_0xbbae('0x3')]},'firstMsgDirection':{'type':Sequelize[_0xbbae('0x6')]('in',_0xbbae('0x7')),'defaultValue':'in','allowNull':![]},'lastMsgAt':{'type':Sequelize[_0xbbae('0x3')]},'lastMsgDirection':{'type':Sequelize[_0xbbae('0x6')]('in',_0xbbae('0x7')),'defaultValue':'in','allowNull':![]},'lastMsgBody':{'type':Sequelize['TEXT'](_0xbbae('0x8'))},'lastMsgText':{'type':Sequelize[_0xbbae('0x5')](_0xbbae('0x8'))}};
\ No newline at end of file
+var _0x8372=['STRING','long','TEXT','ENUM','out','iconv','exports','BOOLEAN','DATE'];(function(_0x2f8bfc,_0x5b2821){var _0x5979ef=function(_0x3948e4){while(--_0x3948e4){_0x2f8bfc['push'](_0x2f8bfc['shift']());}};_0x5979ef(++_0x5b2821);}(_0x8372,0x7a));var _0x2837=function(_0x542d6d,_0x3acadd){_0x542d6d=_0x542d6d-0x0;var _0xba7f43=_0x8372[_0x542d6d];return _0xba7f43;};'use strict';var Sequelize=require('sequelize');var iconv=require(_0x2837('0x0'));module[_0x2837('0x1')]={'closed':{'type':Sequelize[_0x2837('0x2')],'defaultValue':![]},'closedAt':{'type':Sequelize[_0x2837('0x3')]},'disposition':{'type':Sequelize[_0x2837('0x4')]},'note':{'type':Sequelize['STRING']},'inReplyTo':{'type':Sequelize[_0x2837('0x4')](0x1fe)},'to':{'type':Sequelize[_0x2837('0x4')]},'cc':{'type':Sequelize['TEXT'](_0x2837('0x5'))},'subject':{'type':Sequelize[_0x2837('0x6')]()},'attach':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'read1stAt':{'type':Sequelize[_0x2837('0x3')]},'substatus':{'type':Sequelize[_0x2837('0x4')](0x3c)},'substatusAt':{'type':Sequelize[_0x2837('0x3')]},'firstMsgDirection':{'type':Sequelize[_0x2837('0x7')]('in','out'),'defaultValue':'in','allowNull':![]},'lastMsgAt':{'type':Sequelize[_0x2837('0x3')]},'lastMsgDirection':{'type':Sequelize['ENUM']('in',_0x2837('0x8')),'defaultValue':'in','allowNull':![]},'lastMsgBody':{'type':Sequelize['TEXT']('long')},'lastMsgText':{'type':Sequelize['TEXT'](_0x2837('0x5'))}};
\ No newline at end of file
diff --git a/server/api/mailInteraction/mailInteraction.controller.js b/server/api/mailInteraction/mailInteraction.controller.js
index fbadd60..286d802 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 _0xd589=['bluebird','util','sox','ejs','lodash','squel','desk.js','to-csv','html-to-text','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/environment','redis','localhost','socket.io-emitter','register','end','count','offset','limit','status','Content-Range','json','apply','save','update','then','destroy','error','stack','name','send','Users','TagIds','split','forEach','Tags','push','MailInteraction','findOne','lastMsgBody','lastMsgText','trimStart','fromString','catch','fieldName','type','model','query','keys','intersection','attributes','fields','length','hasOwnProperty','order','sort','where','filters','pick','color','tools_tags','field','u.id','ui.MailInteractionId','from','user_has_mail_interactions','left_join','users','u.id\x20=\x20ui.UserId','select','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','mail_messages','me.MailInteractionId\x20=\x20i.id','mail_interaction_has_tags','it.MailInteractionId\x20=\x20i.id','expr','search','parseSearch','sqlOperator','conditions','find','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','start','Tag','map','union','CONCAT_WS(\x27\x20\x27,\x20o.name,\x20o.fullname)\x20LIKE\x20?','UserId','buildExpression','some','compact','MailAccountId','i.MailAccountId\x20IN\x20?','createdAt','$gte','parse','$lte','i.createdAt\x20BETWEEN\x20?\x20AND\x20?','null','\x20IS\x20NULL','\x20=\x20?','read','`unreadMessages`\x20=\x200','`unreadMessages`\x20>\x200','tag','isArray','filter','replace','\x27\x27\x27\x27','isEmail','c.email\x20LIKE\x20?','MATCH\x20(i.to,\x20i.subject)\x20AGAINST\x20(?\x20IN\x20BOOLEAN\x20MODE)','MATCH\x20(me.plainBody,\x20me.subject)\x20AGAINST\x20(?\x20IN\x20BOOLEAN\x20MODE)','group','Sequelize','QueryTypes','SELECT','clone','SUM(me.read\x20=\x200\x20AND\x20me.direction\x20=\x20\x27in\x27)','DESC','resolve','journey','i.MailAccountId\x20IS\x20NOT\x20NULL','getMailAccounts','i.MailAccountId\x20IS\x20NULL','sequelize','toString','merge','a.key','Account.key','a.mandatoryDisposition','i.id','i.updatedAt','i.closedAt','i.attach','i.lastMsgDirection','i.substatus','i.ContactId','i.MailAccountId','i.UserId','Contact.firstName','c.lastName','Contact.lastName','c.phone','Contact.mobile','c.fax','Contact.fax','o.fullname','Owner.fullname','Owner.internal','groupBy','Setting','enableEmailPreview','rows','show','params','rawAttributes','include','options','create','body','describe','addMessage','MailMessage','omit','ids','getMessages','MailInteractionId','format','YYYY-MM-DD\x20HH:mm:ss','includeAll','addTags','findAll','emit','mailInteractionTags:save','removeTags','download','unix','root','server','tmp','join','files','transcript-%d-%s.zip','attachments','Attachments','Messages','bcc','subject','get','headers','basename','existsSync','build','writeFileSync','message%d.eml','log','err','sendStatus','eml-format','rimraf','zip-dir','fast-json-patch','moment'];(function(_0x527361,_0x1d96b4){var _0x1fcb80=function(_0x4092fd){while(--_0x4092fd){_0x527361['push'](_0x527361['shift']());}};_0x1fcb80(++_0x1d96b4);}(_0xd589,0xde));var _0x9d58=function(_0x2e08a7,_0x20643e){_0x2e08a7=_0x2e08a7-0x0;var _0x55b705=_0xd589[_0x2e08a7];return _0x55b705;};'use strict';var pdf=require('html-pdf');var emlformat=require(_0x9d58('0x0'));var rimraf=require(_0x9d58('0x1'));var zipdir=require(_0x9d58('0x2'));var jsonpatch=require(_0x9d58('0x3'));var rp=require('request-promise');var moment=require(_0x9d58('0x4'));var BPromise=require(_0x9d58('0x5'));var Mustache=require('mustache');var util=require(_0x9d58('0x6'));var path=require('path');var sox=require(_0x9d58('0x7'));var csv=require('to-csv');var ejs=require(_0x9d58('0x8'));var fs=require('fs');var _=require(_0x9d58('0x9'));var squel=require(_0x9d58('0xa'));var crypto=require('crypto');var jsforce=require('jsforce');var deskjs=require(_0x9d58('0xb'));var toCsv=require(_0x9d58('0xc'));var querystring=require('querystring');var Papa=require('papaparse');var htmlToText=require(_0x9d58('0xd'));var Redis=require(_0x9d58('0xe'));var authService=require(_0x9d58('0xf'));var qs=require(_0x9d58('0x10'));var as=require(_0x9d58('0x11'));var hardwareService=require(_0x9d58('0x12'));var logger=require(_0x9d58('0x13'))(_0x9d58('0x14'));var utils=require(_0x9d58('0x15'));var config=require(_0x9d58('0x16'));var db=require('../../mysqldb')['db'];config[_0x9d58('0x17')]=_['defaults'](config[_0x9d58('0x17')],{'host':_0x9d58('0x18'),'port':0x18eb});var socket=require(_0x9d58('0x19'))(new Redis(config['redis']));require('./mailInteraction.socket')[_0x9d58('0x1a')](socket);function respondWithStatusCode(_0x599871,_0x184362){_0x184362=_0x184362||0xcc;return function(_0x4ecc86){if(_0x4ecc86){return _0x599871['sendStatus'](_0x184362);}return _0x599871['status'](_0x184362)[_0x9d58('0x1b')]();};}function respondWithResult(_0x1c69d9,_0x4291c9){_0x4291c9=_0x4291c9||0xc8;return function(_0x18b459){if(_0x18b459){return _0x1c69d9['status'](_0x4291c9)['json'](_0x18b459);}};}function respondWithFilteredResult(_0x207545,_0x33ba77){return function(_0x4a5e29){if(_0x4a5e29){var _0x264c44=_0x4a5e29[_0x9d58('0x1c')],_0x16955a=_0x33ba77[_0x9d58('0x1d')],_0x1db947=_0x33ba77[_0x9d58('0x1d')]+_0x33ba77[_0x9d58('0x1e')],_0x5d9dc7;if(_0x1db947>=_0x264c44){_0x1db947=_0x264c44;_0x5d9dc7=0xc8;}else{_0x5d9dc7=0xce;}_0x207545[_0x9d58('0x1f')](_0x5d9dc7);return _0x207545['set'](_0x9d58('0x20'),_0x16955a+'-'+_0x1db947+'/'+_0x264c44)[_0x9d58('0x21')](_0x4a5e29);}return null;};}function patchUpdates(_0x4566d9){return function(_0x3a12c1){try{jsonpatch[_0x9d58('0x22')](_0x3a12c1,_0x4566d9,!![]);}catch(_0x29fead){return BPromise['reject'](_0x29fead);}return _0x3a12c1[_0x9d58('0x23')]();};}function saveUpdates(_0x463ed7,_0xea8b87){return function(_0x6227d7){if(_0x6227d7){return _0x6227d7[_0x9d58('0x24')](_0x463ed7)[_0x9d58('0x25')](function(_0x51b328){return _0x51b328;});}return null;};}function removeEntity(_0x1e325e,_0x4386c6){return function(_0x492f2f){if(_0x492f2f){return _0x492f2f[_0x9d58('0x26')]()[_0x9d58('0x25')](function(){_0x1e325e[_0x9d58('0x1f')](0xcc)[_0x9d58('0x1b')]();});}};}function handleEntityNotFound(_0x68d855,_0x2d8cb9){return function(_0x329812){if(!_0x329812){_0x68d855['sendStatus'](0x194);}return _0x329812;};}function handleError(_0x113d8f,_0x234a92){_0x234a92=_0x234a92||0x1f4;return function(_0xad8245){logger[_0x9d58('0x27')](_0xad8245[_0x9d58('0x28')]);if(_0xad8245[_0x9d58('0x29')]){delete _0xad8245[_0x9d58('0x29')];}_0x113d8f[_0x9d58('0x1f')](_0x234a92)[_0x9d58('0x2a')](_0xad8245);};}function getInteractionUsers(_0xe438ec,_0x5a7a34){return new BPromise(function(_0x249ad7,_0x3e4b5c){try{if(_0x5a7a34[_0xe438ec['id']]){_0xe438ec[_0x9d58('0x2b')]=_['map'](_0x5a7a34[_0xe438ec['id']],function(_0x2a73fa){return{'id':_0x2a73fa['id'],'fullname':_0x2a73fa['fullname']};});}}catch(_0x2f190b){_0x3e4b5c(_0x2f190b);}_0x249ad7(_0xe438ec);});}function getInteractionTags(_0x8268a4,_0x5ecf79){return new BPromise(function(_0x54d266,_0x383d65){try{if(_0x8268a4[_0x9d58('0x2c')]){_0x8268a4['Tags']=[];_0x8268a4['TagIds'][_0x9d58('0x2d')](',')[_0x9d58('0x2e')](function(_0x56de0a){_0x8268a4[_0x9d58('0x2f')][_0x9d58('0x30')](_0x5ecf79[_0x56de0a]);});}delete _0x8268a4[_0x9d58('0x2c')];}catch(_0x1aeb96){_0x383d65(_0x1aeb96);}_0x54d266(_0x8268a4);});}function getLastMessageText(_0x4dd575){return new BPromise(function(_0x116692,_0xea47c4){return db[_0x9d58('0x31')][_0x9d58('0x32')]({'where':{'id':_0x4dd575['id']},'attributes':[_0x9d58('0x33'),'lastMsgText'],'raw':!![]})[_0x9d58('0x25')](function(_0x107fcc){if(!_0x107fcc[_0x9d58('0x34')]){_0x4dd575[_0x9d58('0x34')]=_[_0x9d58('0x35')](htmlToText[_0x9d58('0x36')](_0x107fcc[_0x9d58('0x33')],{'preserveNewlines':!![],'singleNewLineParagraphs':!![],'uppercaseHeadings':![],'noLinkBrackets':!![],'ignoreImage':!![]}));}else{_0x4dd575[_0x9d58('0x34')]=_0x107fcc[_0x9d58('0x34')];}_0x116692(_0x4dd575);})['catch'](function(_0x10c73c){_0xea47c4(_0x10c73c);});});}function updateMailInteraction(_0x81b170,_0x3819cb,_0x2dd67f,_0x1d9d85){return new BPromise(function(_0x5410dd,_0x4bc8bb){return getInteractionUsers(_0x81b170,_0x2dd67f)[_0x9d58('0x25')](function(_0x27678b){return getInteractionTags(_0x27678b,_0x3819cb);})[_0x9d58('0x25')](function(_0x5da2ed){if(_0x1d9d85){_0x5410dd(getLastMessageText(_0x5da2ed));}else{_0x5410dd(_0x5da2ed);}})[_0x9d58('0x37')](function(_0x50413c){_0x4bc8bb(_0x50413c);});});}exports['index']=function(_0x3471bf,_0x156d89){var _0x471572={},_0x14752e={},_0x1b91fd={'count':0x0,'rows':[]};var _0x3ce778=_['map'](db[_0x9d58('0x31')]['rawAttributes'],function(_0x1263b0){return{'name':_0x1263b0[_0x9d58('0x38')],'type':_0x1263b0[_0x9d58('0x39')]['key']};});_0x14752e[_0x9d58('0x3a')]=_['map'](_0x3ce778,'name');_0x14752e[_0x9d58('0x3b')]=_[_0x9d58('0x3c')](_0x3471bf[_0x9d58('0x3b')]);_0x14752e['filters']=_[_0x9d58('0x3d')](_0x14752e['model'],_0x14752e[_0x9d58('0x3b')]);_0x471572[_0x9d58('0x3e')]=_[_0x9d58('0x3d')](_0x14752e[_0x9d58('0x3a')],qs[_0x9d58('0x3f')](_0x3471bf[_0x9d58('0x3b')][_0x9d58('0x3f')]));_0x471572['attributes']=_0x471572[_0x9d58('0x3e')][_0x9d58('0x40')]?_0x471572[_0x9d58('0x3e')]:_0x14752e['model'];if(!_0x3471bf[_0x9d58('0x3b')][_0x9d58('0x41')]('nolimit')){_0x471572['limit']=qs[_0x9d58('0x1e')](_0x3471bf['query'][_0x9d58('0x1e')]);_0x471572[_0x9d58('0x1d')]=qs[_0x9d58('0x1d')](_0x3471bf[_0x9d58('0x3b')][_0x9d58('0x1d')]);}_0x471572[_0x9d58('0x42')]=qs['sort'](_0x3471bf['query'][_0x9d58('0x43')]);_0x471572[_0x9d58('0x44')]=qs[_0x9d58('0x45')](_[_0x9d58('0x46')](_0x3471bf['query'],_0x14752e[_0x9d58('0x45')]));var _0x4ec1f6=[];var _0x32c587=squel['select']()['field']('id')['field'](_0x9d58('0x29'))['field'](_0x9d58('0x47'))['from'](_0x9d58('0x48'));var _0x4cdab5=squel['select']()[_0x9d58('0x49')](_0x9d58('0x4a'))['field']('u.fullname')[_0x9d58('0x49')](_0x9d58('0x4b'))[_0x9d58('0x4c')](_0x9d58('0x4d'),'ui')[_0x9d58('0x4e')](_0x9d58('0x4f'),'u',_0x9d58('0x50'));var _0x24b7e3=squel[_0x9d58('0x51')]()[_0x9d58('0x4c')](_0x9d58('0x52'),'i')[_0x9d58('0x4e')](_0x9d58('0x53'),'c',_0x9d58('0x54'))[_0x9d58('0x4e')]('users','o',_0x9d58('0x55'))[_0x9d58('0x4e')](_0x9d58('0x56'),'a',_0x9d58('0x57'))[_0x9d58('0x4e')](_0x9d58('0x58'),'me',_0x9d58('0x59'))['left_join'](_0x9d58('0x5a'),'it',_0x9d58('0x5b'))['left_join'](_0x9d58('0x48'),'t','t.id\x20=\x20it.TagId');var _0x527f8c=squel[_0x9d58('0x5c')]();var _0x54b291=[];var _0x7b1935=squel[_0x9d58('0x5c')]();var _0x504e0d;if(_0x3471bf[_0x9d58('0x3b')][_0x9d58('0x5d')]){_0x504e0d=as[_0x9d58('0x5e')](_0x3471bf[_0x9d58('0x3b')][_0x9d58('0x5d')]);var _0x54a409=_0x504e0d[_0x9d58('0x5f')];for(var _0x4ffdd8=0x0;_0x4ffdd8<_0x504e0d[_0x9d58('0x60')][_0x9d58('0x40')];_0x4ffdd8++){var _0x49a22b=_0x504e0d[_0x9d58('0x60')][_0x4ffdd8];var _0x131540='i';var _0x58f85f=_[_0x9d58('0x61')](_0x3ce778,[_0x9d58('0x29'),_0x49a22b[_0x9d58('0x49')]]);if(!_0x58f85f){switch(_0x49a22b[_0x9d58('0x49')]){case _0x9d58('0x62'):if(_0x49a22b['value']==0x1){_0x24b7e3[_0x9d58('0x63')]('`'+_0x49a22b[_0x9d58('0x49')]+_0x9d58('0x64'));}else{_0x24b7e3['having']('`'+_0x49a22b['field']+_0x9d58('0x65'));}break;case _0x9d58('0x66'):if(_0x49a22b[_0x9d58('0x67')]==='$substring'){if(_0x49a22b[_0x9d58('0x68')]['split']('\x20')[_0x9d58('0x40')]>0x1){_0x527f8c[_0x54a409](_0x9d58('0x69'),qs[_0x9d58('0x6a')](_0x49a22b[_0x9d58('0x68')]),null);}else{var _0x940845='%'+_0x49a22b['value']+'%';_0x527f8c[_0x54a409](_0x9d58('0x6b'),_0x940845,_0x940845,_0x940845);}}else{_0x58f85f=_[_0x9d58('0x61')](_0x3ce778,['name',_0x9d58('0x6c')]);_0x49a22b[_0x9d58('0x49')]=_0x9d58('0x6c');_0x508675=as['buildExpression'](_0x131540,_0x58f85f[_0x9d58('0x39')],_0x49a22b);_0x527f8c[_0x54a409](_0x508675[_0x9d58('0x6d')],_0x508675[_0x9d58('0x68')][_0x9d58('0x6e')],_0x508675[_0x9d58('0x68')][_0x9d58('0x1b')]);}break;case _0x9d58('0x6f'):var _0x27d3d9=_0x49a22b[_0x9d58('0x68')][_0x9d58('0x2d')](',')[_0x9d58('0x70')](function(_0x11dc54){return Number(_0x11dc54);});_0x27d3d9[_0x9d58('0x2e')](function(_0x10e772){_0x7b1935['or']('CONCAT(\x27,\x27,\x20`TagIds`,\x20\x27,\x27)\x20LIKE\x20?','%,'+_0x10e772+',%');});_0x54b291=_[_0x9d58('0x71')](_0x54b291,_0x27d3d9);break;case'User':if(_0x49a22b['operator']==='$substring'){_0x527f8c[_0x54a409](_0x9d58('0x72'),'%'+_0x49a22b[_0x9d58('0x68')]+'%',null);}else{_0x58f85f=_[_0x9d58('0x61')](_0x3ce778,[_0x9d58('0x29'),_0x9d58('0x73')]);_0x49a22b['field']=_0x9d58('0x73');_0x508675=as[_0x9d58('0x74')](_0x131540,_0x58f85f[_0x9d58('0x39')],_0x49a22b);_0x527f8c[_0x54a409](_0x508675['text'],_0x508675[_0x9d58('0x68')]['start'],_0x508675[_0x9d58('0x68')][_0x9d58('0x1b')]);}break;case'plainBody':_0x508675=as[_0x9d58('0x74')]('me',null,_0x49a22b);_0x527f8c[_0x54a409](_0x508675['text'],_0x508675[_0x9d58('0x68')][_0x9d58('0x6e')],_0x508675['value']['end']);break;}}else{var _0x508675=as[_0x9d58('0x74')](_0x131540,_0x58f85f[_0x9d58('0x39')],_0x49a22b);_0x527f8c[_0x54a409](_0x508675[_0x9d58('0x6d')],_0x508675[_0x9d58('0x68')]['start'],_0x508675[_0x9d58('0x68')]['end']);}}}else{var _0x4dfb23=_(_0x3471bf['query'])[_0x9d58('0x3c')]()[_0x9d58('0x70')](function(_0x284bb1){return _[_0x9d58('0x75')](_0x3ce778,[_0x9d58('0x29'),_0x284bb1])?_0x284bb1:undefined;})[_0x9d58('0x76')]()['value']();if(!_['isEmpty'](_0x4dfb23)){_0x4dfb23[_0x9d58('0x2e')](function(_0x25ea12){if(_0x25ea12===_0x9d58('0x77')){_0x24b7e3[_0x9d58('0x44')](_0x9d58('0x78'),[]['concat'](_0x3471bf[_0x9d58('0x3b')][_0x25ea12]));}else if(_0x25ea12===_0x9d58('0x79')){var _0x5af821=JSON['parse'](_0x3471bf[_0x9d58('0x3b')][_0x25ea12])[_0x9d58('0x7a')];var _0x54101a=JSON[_0x9d58('0x7b')](_0x3471bf['query'][_0x25ea12])[_0x9d58('0x7c')];_0x24b7e3[_0x9d58('0x44')](_0x9d58('0x7d'),_0x5af821,_0x54101a);}else{if(_0x3471bf[_0x9d58('0x3b')][_0x25ea12]===_0x9d58('0x7e')){_0x24b7e3['where']('i.'+_0x25ea12+_0x9d58('0x7f'));}else{_0x24b7e3[_0x9d58('0x44')]('i.'+_0x25ea12+_0x9d58('0x80'),_0x3471bf[_0x9d58('0x3b')][_0x25ea12]);}}});}if(_0x3471bf[_0x9d58('0x3b')][_0x9d58('0x81')]){if(_0x3471bf['query'][_0x9d58('0x81')]==0x1){_0x24b7e3[_0x9d58('0x63')](_0x9d58('0x82'));}else{_0x24b7e3['having'](_0x9d58('0x83'));}}if(_0x3471bf[_0x9d58('0x3b')][_0x9d58('0x84')]){_0x54b291=_[_0x9d58('0x85')](_0x3471bf[_0x9d58('0x3b')][_0x9d58('0x84')])?_0x3471bf[_0x9d58('0x3b')][_0x9d58('0x84')]:new Array(_0x3471bf[_0x9d58('0x3b')][_0x9d58('0x84')]);_0x54b291[_0x9d58('0x2e')](function(_0x129323){_0x7b1935['or']('CONCAT(\x27,\x27,\x20`TagIds`,\x20\x27,\x27)\x20LIKE\x20?','%,'+_0x129323+',%');});}if(_0x3471bf[_0x9d58('0x3b')][_0x9d58('0x86')]){var _0x19d5df=_0x3471bf[_0x9d58('0x3b')][_0x9d58('0x86')][_0x9d58('0x87')]('\x5c','\x5c\x5c')[_0x9d58('0x87')]('\x27\x27',_0x9d58('0x88'));if(qs['isNumeric'](_0x19d5df)){_0x527f8c['or']('i.id\x20LIKE\x20?',_0x19d5df+'%');}else if(qs[_0x9d58('0x89')](_0x19d5df)){_0x527f8c['or'](_0x9d58('0x8a'),_0x19d5df+'%');}else{_0x527f8c['or'](_0x9d58('0x8b'),qs[_0x9d58('0x6a')](_0x19d5df))['or'](_0x9d58('0x8c'),qs[_0x9d58('0x6a')](_0x19d5df));}}}_0x24b7e3['where'](_0x527f8c);_0x24b7e3[_0x9d58('0x8d')]('i.id');var _0x37fadb={'type':db[_0x9d58('0x8e')][_0x9d58('0x8f')][_0x9d58('0x90')],'raw':!![]};var _0x489d14=_0x24b7e3[_0x9d58('0x91')]();_0x489d14[_0x9d58('0x49')]('i.id');_0x489d14[_0x9d58('0x49')](_0x9d58('0x92'),_0x9d58('0x62'));if(_0x471572[_0x9d58('0x42')]){_0x471572[_0x9d58('0x42')][_0x9d58('0x2e')](function(_0x18e2b8){_0x24b7e3[_0x9d58('0x42')]('i.'+_0x18e2b8[0x0],_0x18e2b8[0x1]===_0x9d58('0x93')?![]:!![]);});}if(!_['isEmpty'](_0x54b291)){_0x24b7e3[_0x9d58('0x63')](_0x7b1935);_0x489d14[_0x9d58('0x44')]('t.id\x20IN\x20?',_0x54b291);}BPromise[_0x9d58('0x94')]()[_0x9d58('0x25')](function(){if(!_0x504e0d){if(_0x3471bf[_0x9d58('0x3b')]['MailAccountId']||_0x3471bf[_0x9d58('0x3b')][_0x9d58('0x95')])return;_0x489d14[_0x9d58('0x44')](_0x9d58('0x96'));_0x24b7e3[_0x9d58('0x44')](_0x9d58('0x96'));return;}return _0x3471bf['user'][_0x9d58('0x97')]({'attributes':['id'],'raw':!![]})['then'](function(_0x2a3bfc){if(_['isEmpty'](_0x2a3bfc)){_0x489d14[_0x9d58('0x44')](_0x9d58('0x98'));_0x24b7e3['where'](_0x9d58('0x98'));}else{_0x489d14[_0x9d58('0x44')](_0x9d58('0x78'),_[_0x9d58('0x70')](_0x2a3bfc,'id'));_0x24b7e3[_0x9d58('0x44')](_0x9d58('0x78'),_['map'](_0x2a3bfc,'id'));}});})[_0x9d58('0x25')](function(){db['sequelize'][_0x9d58('0x3b')](_0x489d14['toString'](),_0x37fadb)['then'](function(_0x8f88f0){_0x1b91fd['count']=_0x8f88f0[_0x9d58('0x40')];if(_0x1b91fd[_0x9d58('0x1c')]===0x0)return[];return db[_0x9d58('0x99')][_0x9d58('0x3b')](_0x32c587[_0x9d58('0x9a')](),_0x37fadb)[_0x9d58('0x25')](function(_0x804de0){_0x4ec1f6=_['keyBy'](_0x804de0,'id');_0x37fadb=_[_0x9d58('0x9b')](_0x37fadb,{'model':db['MailInteraction'],'mapToModel':!![],'raw':!![],'nest':!![]});if(_0x3471bf[_0x9d58('0x3b')][_0x9d58('0x3f')]){_0x471572[_0x9d58('0x3e')]['forEach'](function(_0x3dcec3){_0x24b7e3[_0x9d58('0x49')]('i.'+_0x3dcec3);});}else{_0x24b7e3[_0x9d58('0x49')](_0x9d58('0x92'),'unreadMessages');_0x24b7e3['field'](_0x9d58('0x9c'),_0x9d58('0x9d'));_0x24b7e3[_0x9d58('0x49')](_0x9d58('0x9e'),'Account.mandatoryDisposition');_0x24b7e3[_0x9d58('0x49')](_0x9d58('0x9f'));_0x24b7e3['field']('i.createdAt');_0x24b7e3[_0x9d58('0x49')](_0x9d58('0xa0'));_0x24b7e3['field']('i.closed');_0x24b7e3[_0x9d58('0x49')](_0x9d58('0xa1'));_0x24b7e3['field'](_0x9d58('0xa2'));_0x24b7e3[_0x9d58('0x49')]('i.lastMsgAt');_0x24b7e3[_0x9d58('0x49')](_0x9d58('0xa3'));_0x24b7e3['field']('i.subject');_0x24b7e3[_0x9d58('0x49')]('i.disposition');_0x24b7e3[_0x9d58('0x49')](_0x9d58('0xa4'));_0x24b7e3[_0x9d58('0x49')]('i.to');_0x24b7e3[_0x9d58('0x49')](_0x9d58('0xa5'));_0x24b7e3[_0x9d58('0x49')](_0x9d58('0xa6'));_0x24b7e3[_0x9d58('0x49')](_0x9d58('0xa7'));_0x24b7e3[_0x9d58('0x49')]('c.firstName',_0x9d58('0xa8'));_0x24b7e3[_0x9d58('0x49')](_0x9d58('0xa9'),_0x9d58('0xaa'));_0x24b7e3[_0x9d58('0x49')]('c.email','Contact.email');_0x24b7e3[_0x9d58('0x49')](_0x9d58('0xab'),'Contact.phone');_0x24b7e3['field']('c.mobile',_0x9d58('0xac'));_0x24b7e3[_0x9d58('0x49')](_0x9d58('0xad'),_0x9d58('0xae'));_0x24b7e3['field'](_0x9d58('0xaf'),_0x9d58('0xb0'));_0x24b7e3[_0x9d58('0x49')]('o.internal',_0x9d58('0xb1'));_0x24b7e3[_0x9d58('0x49')]('GROUP_CONCAT(DISTINCT\x20t.id)','TagIds');}_0x24b7e3[_0x9d58('0x1e')](_0x471572[_0x9d58('0x1e')]);_0x24b7e3['offset'](_0x471572[_0x9d58('0x1d')]);return db[_0x9d58('0x99')][_0x9d58('0x3b')](_0x24b7e3[_0x9d58('0x9a')](),_0x37fadb);})[_0x9d58('0x25')](function(_0x4d4026){_0x4cdab5[_0x9d58('0x44')]('ui.MailInteractionId\x20IN\x20?',_['map'](_0x4d4026,'id'));return db[_0x9d58('0x99')][_0x9d58('0x3b')](_0x4cdab5[_0x9d58('0x9a')](),_0x37fadb)[_0x9d58('0x25')](function(_0x4a478d){var _0x100974=_[_0x9d58('0xb2')](_0x4a478d,'MailInteractionId');var _0x2bc3b2=[];return db[_0x9d58('0xb3')][_0x9d58('0x32')]({'attributes':[_0x9d58('0xb4')],'raw':!![]})['then'](function(_0x5880df){var _0xf753a6=_0x5880df[_0x9d58('0xb4')];_0x4d4026[_0x9d58('0x2e')](function(_0x22760d){_0x2bc3b2['push'](updateMailInteraction(_0x22760d,_0x4ec1f6,_0x100974,_0xf753a6));});return BPromise['all'](_0x2bc3b2);});});});})['then'](function(_0xef5485){_0x1b91fd[_0x9d58('0xb5')]=_0xef5485;return _0x1b91fd;})['then'](respondWithFilteredResult(_0x156d89,_0x471572));})[_0x9d58('0x37')](handleError(_0x156d89,null));};exports[_0x9d58('0xb6')]=function(_0x505c46,_0x26feca){var _0xc969ca={'raw':![],'where':{'id':_0x505c46[_0x9d58('0xb7')]['id']}},_0x14eac3={};_0x14eac3[_0x9d58('0x3a')]=_['keys'](db[_0x9d58('0x31')][_0x9d58('0xb8')]);_0x14eac3[_0x9d58('0x3b')]=_[_0x9d58('0x3c')](_0x505c46[_0x9d58('0x3b')]);_0x14eac3[_0x9d58('0x45')]=_['intersection'](_0x14eac3[_0x9d58('0x3a')],_0x14eac3['query']);_0xc969ca['attributes']=_['intersection'](_0x14eac3[_0x9d58('0x3a')],qs[_0x9d58('0x3f')](_0x505c46[_0x9d58('0x3b')][_0x9d58('0x3f')]));_0xc969ca[_0x9d58('0x3e')]=_0xc969ca[_0x9d58('0x3e')][_0x9d58('0x40')]?_0xc969ca[_0x9d58('0x3e')]:_0x14eac3[_0x9d58('0x3a')];if(_0x505c46[_0x9d58('0x3b')]['includeAll']){_0xc969ca[_0x9d58('0xb9')]=[{'all':!![]}];}_0xc969ca=_['merge']({},_0xc969ca,_0x505c46[_0x9d58('0xba')]);return db['MailInteraction'][_0x9d58('0x61')](_0xc969ca)['then'](handleEntityNotFound(_0x26feca,null))[_0x9d58('0x25')](respondWithResult(_0x26feca,null))[_0x9d58('0x37')](handleError(_0x26feca,null));};exports[_0x9d58('0xbb')]=function(_0xde27fc,_0x5322e5){return db[_0x9d58('0x31')][_0x9d58('0xbb')](_0xde27fc[_0x9d58('0xbc')],{})[_0x9d58('0x25')](respondWithResult(_0x5322e5,0xc9))[_0x9d58('0x37')](handleError(_0x5322e5,null));};exports['update']=function(_0x996351,_0x555a1c){if(_0x996351[_0x9d58('0xbc')]['id']){delete _0x996351[_0x9d58('0xbc')]['id'];}return db[_0x9d58('0x31')][_0x9d58('0x61')]({'where':{'id':_0x996351[_0x9d58('0xb7')]['id']}})[_0x9d58('0x25')](handleEntityNotFound(_0x555a1c,null))[_0x9d58('0x25')](saveUpdates(_0x996351[_0x9d58('0xbc')],null))[_0x9d58('0x25')](respondWithResult(_0x555a1c,null))['catch'](handleError(_0x555a1c,null));};exports[_0x9d58('0x26')]=function(_0x2d6ee4,_0x54a0c9){return db[_0x9d58('0x31')][_0x9d58('0x61')]({'where':{'id':_0x2d6ee4[_0x9d58('0xb7')]['id']}})[_0x9d58('0x25')](handleEntityNotFound(_0x54a0c9,null))[_0x9d58('0x25')](removeEntity(_0x54a0c9,null))['catch'](handleError(_0x54a0c9,null));};exports[_0x9d58('0xbd')]=function(_0x132879,_0x3844ae){return db[_0x9d58('0x31')]['describe']()[_0x9d58('0x25')](respondWithResult(_0x3844ae,null))[_0x9d58('0x37')](handleError(_0x3844ae,null));};exports[_0x9d58('0xbe')]=function(_0x3723ba,_0x31088f,_0x35804c){return db[_0x9d58('0xbf')][_0x9d58('0x61')]({'where':{'id':_0x3723ba[_0x9d58('0xb7')]['id']}})[_0x9d58('0x25')](handleEntityNotFound(_0x31088f,null))[_0x9d58('0x25')](function(_0x2d1e58){if(_0x2d1e58){return _0x2d1e58['addMessage'](_0x3723ba[_0x9d58('0xbc')]['ids'],_[_0x9d58('0xc0')](_0x3723ba[_0x9d58('0xbc')],[_0x9d58('0xc1'),'id'])||{});}})['then'](respondWithResult(_0x31088f,null))[_0x9d58('0x37')](handleError(_0x31088f,null));};exports[_0x9d58('0xc2')]=function(_0x2220c6,_0x382e1e,_0x39a84a){var _0x1acd28={'raw':![],'where':{}};var _0x44ff76={};var _0x20f94a={'count':0x0,'rows':[]};return db[_0x9d58('0x31')]['findOne']({'where':{'id':_0x2220c6['params']['id']}})[_0x9d58('0x25')](handleEntityNotFound(_0x382e1e,null))[_0x9d58('0x25')](function(_0x3d674d){if(_0x3d674d){_0x44ff76[_0x9d58('0x3a')]=_[_0x9d58('0x3c')](db[_0x9d58('0xbf')][_0x9d58('0xb8')]);_0x44ff76[_0x9d58('0x3b')]=_[_0x9d58('0x3c')](_0x2220c6[_0x9d58('0x3b')]);_0x44ff76['filters']=_[_0x9d58('0x3d')](_0x44ff76['model'],_0x44ff76[_0x9d58('0x3b')]);_0x1acd28[_0x9d58('0x3e')]=_[_0x9d58('0x3d')](_0x44ff76[_0x9d58('0x3a')],qs[_0x9d58('0x3f')](_0x2220c6[_0x9d58('0x3b')]['fields']));_0x1acd28['attributes']=_0x1acd28['attributes'][_0x9d58('0x40')]?_0x1acd28[_0x9d58('0x3e')]:_0x44ff76[_0x9d58('0x3a')];if(!_0x2220c6[_0x9d58('0x3b')][_0x9d58('0x41')]('nolimit')){_0x1acd28[_0x9d58('0x1e')]=qs['limit'](_0x2220c6[_0x9d58('0x3b')][_0x9d58('0x1e')]);_0x1acd28[_0x9d58('0x1d')]=qs['offset'](_0x2220c6[_0x9d58('0x3b')]['offset']);}_0x1acd28[_0x9d58('0x42')]=qs[_0x9d58('0x43')](_0x2220c6['query'][_0x9d58('0x43')]);_0x1acd28[_0x9d58('0x44')]=qs[_0x9d58('0x45')](_[_0x9d58('0x46')](_0x2220c6['query'],_0x44ff76['filters']));_0x1acd28[_0x9d58('0x44')][_0x9d58('0xc3')]=_0x3d674d['id'];if(_0x2220c6[_0x9d58('0x3b')]['filter']){_0x1acd28['where']=_[_0x9d58('0x9b')](_0x1acd28['where'],{'$or':_[_0x9d58('0x70')](_0x1acd28[_0x9d58('0x3e')],function(_0x5f2475){var _0x99a297={};_0x99a297[_0x5f2475]={'$like':'%'+_0x2220c6[_0x9d58('0x3b')][_0x9d58('0x86')]+'%'};return _0x99a297;})});}if(_0x2220c6['query'][_0x9d58('0x7a')]){var _0xb740dd=_0x2220c6[_0x9d58('0x3b')][_0x9d58('0x7a')][_0x9d58('0x2d')](',');var _0x15a479={};_0x15a479[_0xb740dd[0x0]]={'$gte':moment(_0xb740dd[0x1])[_0x9d58('0xc4')](_0x9d58('0xc5'))};_0x1acd28['where']=_[_0x9d58('0x9b')](_0x1acd28['where'],_0x15a479);}_0x1acd28=_[_0x9d58('0x9b')]({},_0x1acd28,_0x2220c6[_0x9d58('0xba')]);return db[_0x9d58('0xbf')]['count']({'where':_0x1acd28[_0x9d58('0x44')]})[_0x9d58('0x25')](function(_0x51bd30){_0x20f94a[_0x9d58('0x1c')]=_0x51bd30;if(_0x2220c6[_0x9d58('0x3b')][_0x9d58('0xc6')]){_0x1acd28['include']=[{'all':!![]}];}return db[_0x9d58('0xbf')]['findAll'](_0x1acd28);})[_0x9d58('0x25')](function(_0x5e0dce){_0x20f94a[_0x9d58('0xb5')]=_0x5e0dce;return _0x20f94a;});}})['then'](respondWithFilteredResult(_0x382e1e,_0x1acd28))[_0x9d58('0x37')](handleError(_0x382e1e,null));};exports[_0x9d58('0xc7')]=function(_0x252e02,_0x5a10b6,_0xc60812){return db[_0x9d58('0x31')][_0x9d58('0x61')]({'where':{'id':_0x252e02[_0x9d58('0xb7')]['id']}})[_0x9d58('0x25')](handleEntityNotFound(_0x5a10b6,null))[_0x9d58('0x25')](function(_0x5679d5){if(_0x5679d5){return _0x5679d5['setTags'](_0x252e02[_0x9d58('0xbc')][_0x9d58('0xc1')],_['omit'](_0x252e02[_0x9d58('0xbc')],[_0x9d58('0xc1'),'id'])||{})['spread'](function(){return db[_0x9d58('0x6f')][_0x9d58('0xc8')]({'attributes':['id','name','color'],'where':{'id':_0x252e02[_0x9d58('0xbc')][_0x9d58('0xc1')]}});})[_0x9d58('0x25')](function(_0x3ad463){socket[_0x9d58('0xc9')](_0x9d58('0xca'),{'id':Number(_0x252e02[_0x9d58('0xb7')]['id']),'tags':_0x3ad463||[]});return{'id':Number(_0x252e02[_0x9d58('0xb7')]['id']),'tags':_0x3ad463||[]};});}})['then'](respondWithResult(_0x5a10b6,null))['catch'](handleError(_0x5a10b6,null));};exports[_0x9d58('0xcb')]=function(_0x39082b,_0xf7eb91,_0x5945a7){return db[_0x9d58('0x31')][_0x9d58('0x61')]({'where':{'id':_0x39082b[_0x9d58('0xb7')]['id']}})[_0x9d58('0x25')](handleEntityNotFound(_0xf7eb91,null))[_0x9d58('0x25')](function(_0x3de6b4){if(_0x3de6b4){return _0x3de6b4[_0x9d58('0xcb')](_0x39082b['query']['ids']);}})[_0x9d58('0x25')](respondWithStatusCode(_0xf7eb91,null))[_0x9d58('0x37')](handleError(_0xf7eb91,null));};exports[_0x9d58('0xcc')]=function(_0x184404,_0x44c015){var _0x11fb62=moment()[_0x9d58('0xcd')]()[_0x9d58('0x9a')]();var _0x36c7de=path['join'](config[_0x9d58('0xce')],_0x9d58('0xcf'),'files',_0x9d58('0xd0'));var _0x5a4f39=path[_0x9d58('0xd1')](config[_0x9d58('0xce')],_0x9d58('0xcf'),_0x9d58('0xd2'),'attachments');var _0x420eec=path['join'](_0x36c7de,_0x11fb62);var _0x55ed0d=util[_0x9d58('0xc4')](_0x9d58('0xd3'),_0x184404['params']['id'],_0x11fb62);var _0x39aec4=path[_0x9d58('0xd1')](_0x36c7de,_0x55ed0d);var _0x561566=[];if(_0x184404[_0x9d58('0x3b')][_0x9d58('0xd4')]){_0x561566['push']({'model':db['Attachment'],'as':_0x9d58('0xd5'),'raw':!![]});}var _0x4a9cc3=[{'model':db[_0x9d58('0xbf')],'as':_0x9d58('0xd6'),'attributes':['id','body',_0x9d58('0x4c'),'to','cc',_0x9d58('0xd7'),_0x9d58('0xd8'),_0x9d58('0x79')],'where':{'secret':![]},'order':qs['sort']('id'),'include':_0x561566}];return db[_0x9d58('0x31')][_0x9d58('0x61')]({'where':{'id':_0x184404[_0x9d58('0xb7')]['id']},'include':_0x4a9cc3})[_0x9d58('0x25')](handleEntityNotFound(_0x44c015,null))[_0x9d58('0x25')](function(_0x1c25d2){if(_0x1c25d2&&_0x1c25d2[_0x9d58('0xd6')]){var _0x210257=_0x1c25d2[_0x9d58('0xd9')]({'plain':!![]});fs['mkdirSync'](_0x420eec);return BPromise['each'](_0x210257[_0x9d58('0xd6')],function(_0x28647a,_0x4598b9){var _0x10df08={'from':_0x28647a[_0x9d58('0x4c')],'to':_0x28647a['to'],'subject':_0x28647a['subject'],'html':_0x28647a[_0x9d58('0xbc')],'headers':{'Date':moment(_0x28647a[_0x9d58('0x79')])['format']('ddd,\x20DD\x20MMM\x20YYYY\x20HH:mm:ss\x20ZZ')},'attachments':[]};if(_0x28647a['cc']){_0x10df08[_0x9d58('0xda')]['Cc']=_0x28647a['cc'];}if(_0x28647a[_0x9d58('0xd7')]){_0x10df08[_0x9d58('0xda')]['Bcc']=_0x28647a[_0x9d58('0xd7')];}return new BPromise(function(_0x231a90,_0x44fc31){if(_0x28647a[_0x9d58('0xd5')]){for(var _0x3bbc3e=0x0;_0x3bbc3e<_0x28647a['Attachments'][_0x9d58('0x40')];_0x3bbc3e++){var _0x55713a=_0x28647a[_0x9d58('0xd5')][_0x3bbc3e];var _0x149159=path[_0x9d58('0xd1')](_0x5a4f39,_0x55713a[_0x9d58('0xdb')]);if(fs[_0x9d58('0xdc')](_0x149159)){_0x10df08[_0x9d58('0xd4')][_0x9d58('0x30')]({'name':_0x55713a[_0x9d58('0x29')],'contentType':_0x55713a['type'],'data':fs['readFileSync'](_0x149159)});}}}emlformat[_0x9d58('0xdd')](_0x10df08,function(_0x38daa3,_0x11314e){if(_0x38daa3)return _0x44fc31(_0x38daa3);fs[_0x9d58('0xde')](path[_0x9d58('0xd1')](_0x420eec,util[_0x9d58('0xc4')](_0x9d58('0xdf'),_0x4598b9)),_0x11314e);return _0x231a90(_0x11314e);});});})['then'](function(){return new BPromise(function(_0x3da459,_0x2bb458){zipdir(_0x420eec,{'saveTo':_0x39aec4},function(_0x27878a,_0x41bbdb){if(_0x27878a)return _0x2bb458(_0x27878a);return _0x3da459(_0x41bbdb);});})[_0x9d58('0x25')](function(){return new BPromise(function(_0x244adb,_0x4ebc8d){rimraf(_0x420eec,function(_0x44bf08){if(_0x44bf08)_0x4ebc8d(_0x44bf08);return _0x244adb();});});})[_0x9d58('0x25')](function(){return _0x44c015[_0x9d58('0xcc')](_0x39aec4,_0x55ed0d,function(_0x534464){if(_0x534464){console[_0x9d58('0xe0')](_0x9d58('0xe1'),_0x534464);}else{fs['unlinkSync'](_0x39aec4);}});});});}else{return _0x44c015[_0x9d58('0xe2')](0xc8);}})[_0x9d58('0x37')](handleError(_0x44c015,null));};
\ No newline at end of file
+var _0xf27b=['attributes','fields','length','hasOwnProperty','nolimit','order','sort','where','pick','select','field','color','from','tools_tags','u.id','ui.MailInteractionId','user_has_mail_interactions','left_join','u.id\x20=\x20ui.UserId','cm_contacts','c.id\x20=\x20i.ContactId\x20AND\x20c.deletedAt\x20IS\x20NULL','mail_accounts','mail_messages','mail_interaction_has_tags','expr','parseSearch','search','conditions','find','unreadMessages','value','having','`\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','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','plainBody','some','isEmpty','i.MailAccountId\x20IN\x20?','concat','createdAt','$gte','parse','i.createdAt\x20BETWEEN\x20?\x20AND\x20?','null','\x20IS\x20NULL','read','`unreadMessages`\x20=\x200','`unreadMessages`\x20>\x200','tag','isArray','filter','replace','\x27\x27\x27\x27','isNumeric','i.id\x20LIKE\x20?','c.email\x20LIKE\x20?','MATCH\x20(i.to,\x20i.subject)\x20AGAINST\x20(?\x20IN\x20BOOLEAN\x20MODE)','getFullTextValue','group','i.id','QueryTypes','SELECT','clone','DESC','t.id\x20IN\x20?','journey','i.MailAccountId\x20IS\x20NOT\x20NULL','user','getMailAccounts','i.MailAccountId\x20IS\x20NULL','sequelize','toString','keyBy','merge','SUM(me.read\x20=\x200\x20AND\x20me.direction\x20=\x20\x27in\x27)','Account.mandatoryDisposition','i.createdAt','i.updatedAt','i.closed','i.attach','i.lastMsgAt','i.lastMsgDirection','i.subject','i.disposition','i.ContactId','i.MailAccountId','i.UserId','c.firstName','c.lastName','Contact.lastName','c.email','Contact.email','c.phone','Contact.phone','c.mobile','c.fax','o.fullname','Owner.fullname','o.internal','GROUP_CONCAT(DISTINCT\x20t.id)','ui.MailInteractionId\x20IN\x20?','groupBy','MailInteractionId','findOne','all','rows','params','includeAll','include','options','create','body','update','describe','addMessage','MailMessage','ids','omit','getMessages','format','YYYY-MM-DD\x20HH:mm:ss','findAll','addTags','setTags','spread','emit','mailInteractionTags:save','removeTags','download','unix','root','server','files','tmp','join','transcript-%d-%s.zip','attachments','Attachments','Messages','bcc','get','mkdirSync','each','subject','headers','Bcc','basename','existsSync','build','message%d.eml','log','err','unlinkSync','html-pdf','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','mustache','util','sox','to-csv','ejs','lodash','crypto','desk.js','html-to-text','ioredis','api','../../config/utils','../../mysqldb','redis','./mailInteraction.socket','register','sendStatus','status','end','json','count','offset','limit','set','Content-Range','apply','reject','save','then','destroy','error','name','map','TagIds','Tags','split','push','MailInteraction','lastMsgBody','lastMsgText','trimStart','catch','rawAttributes','fieldName','type','key','keys','query','filters','intersection','model'];(function(_0x49ca18,_0x5e6d05){var _0x145d54=function(_0x30b9be){while(--_0x30b9be){_0x49ca18['push'](_0x49ca18['shift']());}};_0x145d54(++_0x5e6d05);}(_0xf27b,0x189));var _0xbf27=function(_0x158da6,_0x3cb06d){_0x158da6=_0x158da6-0x0;var _0x429c30=_0xf27b[_0x158da6];return _0x429c30;};'use strict';var pdf=require(_0xbf27('0x0'));var emlformat=require(_0xbf27('0x1'));var rimraf=require(_0xbf27('0x2'));var zipdir=require(_0xbf27('0x3'));var jsonpatch=require(_0xbf27('0x4'));var rp=require(_0xbf27('0x5'));var moment=require('moment');var BPromise=require('bluebird');var Mustache=require(_0xbf27('0x6'));var util=require(_0xbf27('0x7'));var path=require('path');var sox=require(_0xbf27('0x8'));var csv=require(_0xbf27('0x9'));var ejs=require(_0xbf27('0xa'));var fs=require('fs');var _=require(_0xbf27('0xb'));var squel=require('squel');var crypto=require(_0xbf27('0xc'));var jsforce=require('jsforce');var deskjs=require(_0xbf27('0xd'));var toCsv=require(_0xbf27('0x9'));var querystring=require('querystring');var Papa=require('papaparse');var htmlToText=require(_0xbf27('0xe'));var Redis=require(_0xbf27('0xf'));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('../../config/logger')(_0xbf27('0x10'));var utils=require(_0xbf27('0x11'));var config=require('../../config/environment');var db=require(_0xbf27('0x12'))['db'];config[_0xbf27('0x13')]=_['defaults'](config['redis'],{'host':'localhost','port':0x18eb});var socket=require('socket.io-emitter')(new Redis(config[_0xbf27('0x13')]));require(_0xbf27('0x14'))[_0xbf27('0x15')](socket);function respondWithStatusCode(_0x10329d,_0xdfecf1){_0xdfecf1=_0xdfecf1||0xcc;return function(_0x41a379){if(_0x41a379){return _0x10329d[_0xbf27('0x16')](_0xdfecf1);}return _0x10329d[_0xbf27('0x17')](_0xdfecf1)[_0xbf27('0x18')]();};}function respondWithResult(_0x36b4fc,_0x44e0b6){_0x44e0b6=_0x44e0b6||0xc8;return function(_0x1c6f9e){if(_0x1c6f9e){return _0x36b4fc[_0xbf27('0x17')](_0x44e0b6)[_0xbf27('0x19')](_0x1c6f9e);}};}function respondWithFilteredResult(_0x3cc3b5,_0x119db0){return function(_0x467893){if(_0x467893){var _0x4fa1aa=_0x467893[_0xbf27('0x1a')],_0x4eadda=_0x119db0[_0xbf27('0x1b')],_0x551021=_0x119db0['offset']+_0x119db0[_0xbf27('0x1c')],_0xcec6f7;if(_0x551021>=_0x4fa1aa){_0x551021=_0x4fa1aa;_0xcec6f7=0xc8;}else{_0xcec6f7=0xce;}_0x3cc3b5['status'](_0xcec6f7);return _0x3cc3b5[_0xbf27('0x1d')](_0xbf27('0x1e'),_0x4eadda+'-'+_0x551021+'/'+_0x4fa1aa)[_0xbf27('0x19')](_0x467893);}return null;};}function patchUpdates(_0x300ce2){return function(_0x39a5f0){try{jsonpatch[_0xbf27('0x1f')](_0x39a5f0,_0x300ce2,!![]);}catch(_0x4028d0){return BPromise[_0xbf27('0x20')](_0x4028d0);}return _0x39a5f0[_0xbf27('0x21')]();};}function saveUpdates(_0x2ca3f7,_0x13e8d7){return function(_0x18426c){if(_0x18426c){return _0x18426c['update'](_0x2ca3f7)[_0xbf27('0x22')](function(_0x4fc67d){return _0x4fc67d;});}return null;};}function removeEntity(_0x4997aa,_0x2be209){return function(_0x463449){if(_0x463449){return _0x463449[_0xbf27('0x23')]()['then'](function(){_0x4997aa[_0xbf27('0x17')](0xcc)[_0xbf27('0x18')]();});}};}function handleEntityNotFound(_0x49479a,_0x5d4bbe){return function(_0x83dc48){if(!_0x83dc48){_0x49479a[_0xbf27('0x16')](0x194);}return _0x83dc48;};}function handleError(_0x2d80f9,_0xcd9a8b){_0xcd9a8b=_0xcd9a8b||0x1f4;return function(_0x4fa3fe){logger[_0xbf27('0x24')](_0x4fa3fe['stack']);if(_0x4fa3fe[_0xbf27('0x25')]){delete _0x4fa3fe[_0xbf27('0x25')];}_0x2d80f9[_0xbf27('0x17')](_0xcd9a8b)['send'](_0x4fa3fe);};}function getInteractionUsers(_0x400a39,_0x5c2ecd){return new BPromise(function(_0x16cdc8,_0x3d81b2){try{if(_0x5c2ecd[_0x400a39['id']]){_0x400a39['Users']=_[_0xbf27('0x26')](_0x5c2ecd[_0x400a39['id']],function(_0x17f624){return{'id':_0x17f624['id'],'fullname':_0x17f624['fullname']};});}}catch(_0x17cc2d){_0x3d81b2(_0x17cc2d);}_0x16cdc8(_0x400a39);});}function getInteractionTags(_0x37f053,_0x366eec){return new BPromise(function(_0x3e6ea1,_0x2cab57){try{if(_0x37f053[_0xbf27('0x27')]){_0x37f053[_0xbf27('0x28')]=[];_0x37f053[_0xbf27('0x27')][_0xbf27('0x29')](',')['forEach'](function(_0x34443a){_0x37f053[_0xbf27('0x28')][_0xbf27('0x2a')](_0x366eec[_0x34443a]);});}delete _0x37f053['TagIds'];}catch(_0x4ab029){_0x2cab57(_0x4ab029);}_0x3e6ea1(_0x37f053);});}function getLastMessageText(_0x319223){return new BPromise(function(_0x58155c,_0x254d18){return db[_0xbf27('0x2b')]['findOne']({'where':{'id':_0x319223['id']},'attributes':[_0xbf27('0x2c'),_0xbf27('0x2d')],'raw':!![]})[_0xbf27('0x22')](function(_0x4d1de1){if(!_0x4d1de1[_0xbf27('0x2d')]){_0x319223[_0xbf27('0x2d')]=_[_0xbf27('0x2e')](htmlToText['fromString'](_0x4d1de1[_0xbf27('0x2c')],{'preserveNewlines':!![],'singleNewLineParagraphs':!![],'uppercaseHeadings':![],'noLinkBrackets':!![],'ignoreImage':!![]}));}else{_0x319223[_0xbf27('0x2d')]=_0x4d1de1[_0xbf27('0x2d')];}_0x58155c(_0x319223);})['catch'](function(_0x2709b3){_0x254d18(_0x2709b3);});});}function updateMailInteraction(_0x179884,_0x283f41,_0x5db8ba,_0x288574){return new BPromise(function(_0x326001,_0x1d5490){return getInteractionUsers(_0x179884,_0x5db8ba)[_0xbf27('0x22')](function(_0x3332fa){return getInteractionTags(_0x3332fa,_0x283f41);})[_0xbf27('0x22')](function(_0x3aef6e){if(_0x288574){_0x326001(getLastMessageText(_0x3aef6e));}else{_0x326001(_0x3aef6e);}})[_0xbf27('0x2f')](function(_0x2668d8){_0x1d5490(_0x2668d8);});});}exports['index']=function(_0x2f144f,_0x454aa0){var _0x3ffa09={},_0xe8d011={},_0x2e5cba={'count':0x0,'rows':[]};var _0x2fda38=_[_0xbf27('0x26')](db[_0xbf27('0x2b')][_0xbf27('0x30')],function(_0x5cbd4e){return{'name':_0x5cbd4e[_0xbf27('0x31')],'type':_0x5cbd4e[_0xbf27('0x32')][_0xbf27('0x33')]};});_0xe8d011['model']=_['map'](_0x2fda38,_0xbf27('0x25'));_0xe8d011['query']=_[_0xbf27('0x34')](_0x2f144f[_0xbf27('0x35')]);_0xe8d011[_0xbf27('0x36')]=_[_0xbf27('0x37')](_0xe8d011[_0xbf27('0x38')],_0xe8d011[_0xbf27('0x35')]);_0x3ffa09[_0xbf27('0x39')]=_[_0xbf27('0x37')](_0xe8d011['model'],qs['fields'](_0x2f144f[_0xbf27('0x35')][_0xbf27('0x3a')]));_0x3ffa09['attributes']=_0x3ffa09[_0xbf27('0x39')][_0xbf27('0x3b')]?_0x3ffa09['attributes']:_0xe8d011[_0xbf27('0x38')];if(!_0x2f144f['query'][_0xbf27('0x3c')](_0xbf27('0x3d'))){_0x3ffa09[_0xbf27('0x1c')]=qs[_0xbf27('0x1c')](_0x2f144f[_0xbf27('0x35')][_0xbf27('0x1c')]);_0x3ffa09[_0xbf27('0x1b')]=qs[_0xbf27('0x1b')](_0x2f144f[_0xbf27('0x35')][_0xbf27('0x1b')]);}_0x3ffa09[_0xbf27('0x3e')]=qs[_0xbf27('0x3f')](_0x2f144f[_0xbf27('0x35')][_0xbf27('0x3f')]);_0x3ffa09[_0xbf27('0x40')]=qs['filters'](_[_0xbf27('0x41')](_0x2f144f[_0xbf27('0x35')],_0xe8d011[_0xbf27('0x36')]));var _0x356b4c=[];var _0x24b926=squel[_0xbf27('0x42')]()[_0xbf27('0x43')]('id')[_0xbf27('0x43')]('name')[_0xbf27('0x43')](_0xbf27('0x44'))[_0xbf27('0x45')](_0xbf27('0x46'));var _0x34db75=squel[_0xbf27('0x42')]()[_0xbf27('0x43')](_0xbf27('0x47'))['field']('u.fullname')[_0xbf27('0x43')](_0xbf27('0x48'))[_0xbf27('0x45')](_0xbf27('0x49'),'ui')[_0xbf27('0x4a')]('users','u',_0xbf27('0x4b'));var _0xb85616=squel[_0xbf27('0x42')]()[_0xbf27('0x45')]('mail_interactions','i')[_0xbf27('0x4a')](_0xbf27('0x4c'),'c',_0xbf27('0x4d'))['left_join']('users','o','o.id\x20=\x20i.UserId')[_0xbf27('0x4a')](_0xbf27('0x4e'),'a','a.id\x20=\x20i.MailAccountId')['left_join'](_0xbf27('0x4f'),'me','me.MailInteractionId\x20=\x20i.id')[_0xbf27('0x4a')](_0xbf27('0x50'),'it','it.MailInteractionId\x20=\x20i.id')[_0xbf27('0x4a')](_0xbf27('0x46'),'t','t.id\x20=\x20it.TagId');var _0x5bb50d=squel['expr']();var _0x1e278b=[];var _0xd81f53=squel[_0xbf27('0x51')]();var _0x4562da;if(_0x2f144f[_0xbf27('0x35')]['search']){_0x4562da=as[_0xbf27('0x52')](_0x2f144f[_0xbf27('0x35')][_0xbf27('0x53')]);var _0x235632=_0x4562da['sqlOperator'];for(var _0x1f0a7b=0x0;_0x1f0a7b<_0x4562da[_0xbf27('0x54')][_0xbf27('0x3b')];_0x1f0a7b++){var _0x100ce4=_0x4562da[_0xbf27('0x54')][_0x1f0a7b];var _0x441591='i';var _0x338dc9=_[_0xbf27('0x55')](_0x2fda38,['name',_0x100ce4[_0xbf27('0x43')]]);if(!_0x338dc9){switch(_0x100ce4[_0xbf27('0x43')]){case _0xbf27('0x56'):if(_0x100ce4[_0xbf27('0x57')]==0x1){_0xb85616[_0xbf27('0x58')]('`'+_0x100ce4[_0xbf27('0x43')]+_0xbf27('0x59'));}else{_0xb85616[_0xbf27('0x58')]('`'+_0x100ce4[_0xbf27('0x43')]+'`\x20>\x200');}break;case _0xbf27('0x5a'):if(_0x100ce4[_0xbf27('0x5b')]===_0xbf27('0x5c')){if(_0x100ce4[_0xbf27('0x57')]['split']('\x20')[_0xbf27('0x3b')]>0x1){_0x5bb50d[_0x235632](_0xbf27('0x5d'),qs['getFullTextValue'](_0x100ce4[_0xbf27('0x57')]),null);}else{var _0x44c0be='%'+_0x100ce4[_0xbf27('0x57')]+'%';_0x5bb50d[_0x235632](_0xbf27('0x5e'),_0x44c0be,_0x44c0be,_0x44c0be);}}else{_0x338dc9=_[_0xbf27('0x55')](_0x2fda38,[_0xbf27('0x25'),_0xbf27('0x5f')]);_0x100ce4[_0xbf27('0x43')]=_0xbf27('0x5f');_0x2bcf88=as[_0xbf27('0x60')](_0x441591,_0x338dc9[_0xbf27('0x32')],_0x100ce4);_0x5bb50d[_0x235632](_0x2bcf88[_0xbf27('0x61')],_0x2bcf88['value'][_0xbf27('0x62')],_0x2bcf88[_0xbf27('0x57')][_0xbf27('0x18')]);}break;case _0xbf27('0x63'):var _0x2ededa=_0x100ce4['value'][_0xbf27('0x29')](',')['map'](function(_0x38b2cb){return Number(_0x38b2cb);});_0x2ededa[_0xbf27('0x64')](function(_0x5cbdc8){_0xd81f53['or'](_0xbf27('0x65'),'%,'+_0x5cbdc8+',%');});_0x1e278b=_[_0xbf27('0x66')](_0x1e278b,_0x2ededa);break;case _0xbf27('0x67'):if(_0x100ce4['operator']===_0xbf27('0x5c')){_0x5bb50d[_0x235632](_0xbf27('0x68'),'%'+_0x100ce4[_0xbf27('0x57')]+'%',null);}else{_0x338dc9=_[_0xbf27('0x55')](_0x2fda38,[_0xbf27('0x25'),_0xbf27('0x69')]);_0x100ce4[_0xbf27('0x43')]='UserId';_0x2bcf88=as[_0xbf27('0x60')](_0x441591,_0x338dc9['type'],_0x100ce4);_0x5bb50d[_0x235632](_0x2bcf88['text'],_0x2bcf88[_0xbf27('0x57')]['start'],_0x2bcf88[_0xbf27('0x57')][_0xbf27('0x18')]);}break;case _0xbf27('0x6a'):_0x2bcf88=as[_0xbf27('0x60')]('me',null,_0x100ce4);_0x5bb50d[_0x235632](_0x2bcf88[_0xbf27('0x61')],_0x2bcf88[_0xbf27('0x57')][_0xbf27('0x62')],_0x2bcf88[_0xbf27('0x57')][_0xbf27('0x18')]);break;}}else{var _0x2bcf88=as[_0xbf27('0x60')](_0x441591,_0x338dc9[_0xbf27('0x32')],_0x100ce4);_0x5bb50d[_0x235632](_0x2bcf88[_0xbf27('0x61')],_0x2bcf88[_0xbf27('0x57')][_0xbf27('0x62')],_0x2bcf88[_0xbf27('0x57')][_0xbf27('0x18')]);}}}else{var _0x3f0423=_(_0x2f144f['query'])[_0xbf27('0x34')]()[_0xbf27('0x26')](function(_0x1c867b){return _[_0xbf27('0x6b')](_0x2fda38,['name',_0x1c867b])?_0x1c867b:undefined;})['compact']()[_0xbf27('0x57')]();if(!_[_0xbf27('0x6c')](_0x3f0423)){_0x3f0423[_0xbf27('0x64')](function(_0x20f2be){if(_0x20f2be==='MailAccountId'){_0xb85616['where'](_0xbf27('0x6d'),[][_0xbf27('0x6e')](_0x2f144f[_0xbf27('0x35')][_0x20f2be]));}else if(_0x20f2be===_0xbf27('0x6f')){var _0x498987=JSON['parse'](_0x2f144f['query'][_0x20f2be])[_0xbf27('0x70')];var _0x318436=JSON[_0xbf27('0x71')](_0x2f144f[_0xbf27('0x35')][_0x20f2be])['$lte'];_0xb85616[_0xbf27('0x40')](_0xbf27('0x72'),_0x498987,_0x318436);}else{if(_0x2f144f[_0xbf27('0x35')][_0x20f2be]===_0xbf27('0x73')){_0xb85616['where']('i.'+_0x20f2be+_0xbf27('0x74'));}else{_0xb85616['where']('i.'+_0x20f2be+'\x20=\x20?',_0x2f144f['query'][_0x20f2be]);}}});}if(_0x2f144f[_0xbf27('0x35')]['read']){if(_0x2f144f[_0xbf27('0x35')][_0xbf27('0x75')]==0x1){_0xb85616[_0xbf27('0x58')](_0xbf27('0x76'));}else{_0xb85616['having'](_0xbf27('0x77'));}}if(_0x2f144f[_0xbf27('0x35')][_0xbf27('0x78')]){_0x1e278b=_[_0xbf27('0x79')](_0x2f144f[_0xbf27('0x35')][_0xbf27('0x78')])?_0x2f144f['query'][_0xbf27('0x78')]:new Array(_0x2f144f[_0xbf27('0x35')][_0xbf27('0x78')]);_0x1e278b[_0xbf27('0x64')](function(_0x46dab6){_0xd81f53['or'](_0xbf27('0x65'),'%,'+_0x46dab6+',%');});}if(_0x2f144f[_0xbf27('0x35')]['filter']){var _0xf53c9a=_0x2f144f[_0xbf27('0x35')][_0xbf27('0x7a')][_0xbf27('0x7b')]('\x5c','\x5c\x5c')[_0xbf27('0x7b')]('\x27\x27',_0xbf27('0x7c'));if(qs[_0xbf27('0x7d')](_0xf53c9a)){_0x5bb50d['or'](_0xbf27('0x7e'),_0xf53c9a+'%');}else if(qs['isEmail'](_0xf53c9a)){_0x5bb50d['or'](_0xbf27('0x7f'),_0xf53c9a+'%');}else{_0x5bb50d['or'](_0xbf27('0x80'),qs[_0xbf27('0x81')](_0xf53c9a))['or']('MATCH\x20(me.plainBody,\x20me.subject)\x20AGAINST\x20(?\x20IN\x20BOOLEAN\x20MODE)',qs[_0xbf27('0x81')](_0xf53c9a));}}}_0xb85616['where'](_0x5bb50d);_0xb85616[_0xbf27('0x82')](_0xbf27('0x83'));var _0x4d8b17={'type':db['Sequelize'][_0xbf27('0x84')][_0xbf27('0x85')],'raw':!![]};var _0x7d438f=_0xb85616[_0xbf27('0x86')]();_0x7d438f[_0xbf27('0x43')](_0xbf27('0x83'));_0x7d438f['field']('SUM(me.read\x20=\x200\x20AND\x20me.direction\x20=\x20\x27in\x27)',_0xbf27('0x56'));if(_0x3ffa09[_0xbf27('0x3e')]){_0x3ffa09[_0xbf27('0x3e')]['forEach'](function(_0x11d3bf){_0xb85616[_0xbf27('0x3e')]('i.'+_0x11d3bf[0x0],_0x11d3bf[0x1]===_0xbf27('0x87')?![]:!![]);});}if(!_[_0xbf27('0x6c')](_0x1e278b)){_0xb85616[_0xbf27('0x58')](_0xd81f53);_0x7d438f[_0xbf27('0x40')](_0xbf27('0x88'),_0x1e278b);}BPromise['resolve']()[_0xbf27('0x22')](function(){if(!_0x4562da){if(_0x2f144f[_0xbf27('0x35')]['MailAccountId']||_0x2f144f[_0xbf27('0x35')][_0xbf27('0x89')])return;_0x7d438f[_0xbf27('0x40')](_0xbf27('0x8a'));_0xb85616[_0xbf27('0x40')]('i.MailAccountId\x20IS\x20NOT\x20NULL');return;}return _0x2f144f[_0xbf27('0x8b')][_0xbf27('0x8c')]({'attributes':['id'],'raw':!![]})[_0xbf27('0x22')](function(_0x31380c){if(_[_0xbf27('0x6c')](_0x31380c)){_0x7d438f[_0xbf27('0x40')]('i.MailAccountId\x20IS\x20NULL');_0xb85616[_0xbf27('0x40')](_0xbf27('0x8d'));}else{_0x7d438f[_0xbf27('0x40')](_0xbf27('0x6d'),_[_0xbf27('0x26')](_0x31380c,'id'));_0xb85616[_0xbf27('0x40')](_0xbf27('0x6d'),_[_0xbf27('0x26')](_0x31380c,'id'));}});})[_0xbf27('0x22')](function(){db[_0xbf27('0x8e')][_0xbf27('0x35')](_0x7d438f[_0xbf27('0x8f')](),_0x4d8b17)[_0xbf27('0x22')](function(_0x432682){_0x2e5cba[_0xbf27('0x1a')]=_0x432682[_0xbf27('0x3b')];if(_0x2e5cba['count']===0x0)return[];return db['sequelize'][_0xbf27('0x35')](_0x24b926[_0xbf27('0x8f')](),_0x4d8b17)[_0xbf27('0x22')](function(_0x1def59){_0x356b4c=_[_0xbf27('0x90')](_0x1def59,'id');_0x4d8b17=_[_0xbf27('0x91')](_0x4d8b17,{'model':db['MailInteraction'],'mapToModel':!![],'raw':!![],'nest':!![]});if(_0x2f144f[_0xbf27('0x35')][_0xbf27('0x3a')]){_0x3ffa09[_0xbf27('0x39')][_0xbf27('0x64')](function(_0x1e26bc){_0xb85616['field']('i.'+_0x1e26bc);});}else{_0xb85616['field'](_0xbf27('0x92'),'unreadMessages');_0xb85616[_0xbf27('0x43')]('a.key','Account.key');_0xb85616[_0xbf27('0x43')]('a.mandatoryDisposition',_0xbf27('0x93'));_0xb85616[_0xbf27('0x43')](_0xbf27('0x83'));_0xb85616['field'](_0xbf27('0x94'));_0xb85616['field'](_0xbf27('0x95'));_0xb85616['field'](_0xbf27('0x96'));_0xb85616['field']('i.closedAt');_0xb85616['field'](_0xbf27('0x97'));_0xb85616[_0xbf27('0x43')](_0xbf27('0x98'));_0xb85616[_0xbf27('0x43')](_0xbf27('0x99'));_0xb85616[_0xbf27('0x43')](_0xbf27('0x9a'));_0xb85616['field'](_0xbf27('0x9b'));_0xb85616['field']('i.substatus');_0xb85616[_0xbf27('0x43')]('i.to');_0xb85616[_0xbf27('0x43')](_0xbf27('0x9c'));_0xb85616[_0xbf27('0x43')](_0xbf27('0x9d'));_0xb85616[_0xbf27('0x43')](_0xbf27('0x9e'));_0xb85616[_0xbf27('0x43')](_0xbf27('0x9f'),'Contact.firstName');_0xb85616['field'](_0xbf27('0xa0'),_0xbf27('0xa1'));_0xb85616[_0xbf27('0x43')](_0xbf27('0xa2'),_0xbf27('0xa3'));_0xb85616[_0xbf27('0x43')](_0xbf27('0xa4'),_0xbf27('0xa5'));_0xb85616[_0xbf27('0x43')](_0xbf27('0xa6'),'Contact.mobile');_0xb85616[_0xbf27('0x43')](_0xbf27('0xa7'),'Contact.fax');_0xb85616['field'](_0xbf27('0xa8'),_0xbf27('0xa9'));_0xb85616[_0xbf27('0x43')](_0xbf27('0xaa'),'Owner.internal');_0xb85616[_0xbf27('0x43')](_0xbf27('0xab'),_0xbf27('0x27'));}_0xb85616[_0xbf27('0x1c')](_0x3ffa09['limit']);_0xb85616[_0xbf27('0x1b')](_0x3ffa09[_0xbf27('0x1b')]);return db[_0xbf27('0x8e')]['query'](_0xb85616[_0xbf27('0x8f')](),_0x4d8b17);})['then'](function(_0x7a3730){_0x34db75[_0xbf27('0x40')](_0xbf27('0xac'),_[_0xbf27('0x26')](_0x7a3730,'id'));return db[_0xbf27('0x8e')][_0xbf27('0x35')](_0x34db75['toString'](),_0x4d8b17)['then'](function(_0x56a7aa){var _0x2e135=_[_0xbf27('0xad')](_0x56a7aa,_0xbf27('0xae'));var _0x56607d=[];return db['Setting'][_0xbf27('0xaf')]({'attributes':['enableEmailPreview'],'raw':!![]})['then'](function(_0x3cb4ee){var _0x76d0d8=_0x3cb4ee['enableEmailPreview'];_0x7a3730[_0xbf27('0x64')](function(_0x22aaac){_0x56607d[_0xbf27('0x2a')](updateMailInteraction(_0x22aaac,_0x356b4c,_0x2e135,_0x76d0d8));});return BPromise[_0xbf27('0xb0')](_0x56607d);});});});})[_0xbf27('0x22')](function(_0x190121){_0x2e5cba[_0xbf27('0xb1')]=_0x190121;return _0x2e5cba;})[_0xbf27('0x22')](respondWithFilteredResult(_0x454aa0,_0x3ffa09));})[_0xbf27('0x2f')](handleError(_0x454aa0,null));};exports['show']=function(_0x47932c,_0x329f06){var _0x51ca10={'raw':![],'where':{'id':_0x47932c[_0xbf27('0xb2')]['id']}},_0x2790c2={};_0x2790c2[_0xbf27('0x38')]=_['keys'](db[_0xbf27('0x2b')]['rawAttributes']);_0x2790c2[_0xbf27('0x35')]=_['keys'](_0x47932c[_0xbf27('0x35')]);_0x2790c2[_0xbf27('0x36')]=_['intersection'](_0x2790c2[_0xbf27('0x38')],_0x2790c2[_0xbf27('0x35')]);_0x51ca10['attributes']=_['intersection'](_0x2790c2[_0xbf27('0x38')],qs[_0xbf27('0x3a')](_0x47932c[_0xbf27('0x35')][_0xbf27('0x3a')]));_0x51ca10[_0xbf27('0x39')]=_0x51ca10['attributes'][_0xbf27('0x3b')]?_0x51ca10[_0xbf27('0x39')]:_0x2790c2['model'];if(_0x47932c[_0xbf27('0x35')][_0xbf27('0xb3')]){_0x51ca10[_0xbf27('0xb4')]=[{'all':!![]}];}_0x51ca10=_[_0xbf27('0x91')]({},_0x51ca10,_0x47932c[_0xbf27('0xb5')]);return db['MailInteraction'][_0xbf27('0x55')](_0x51ca10)[_0xbf27('0x22')](handleEntityNotFound(_0x329f06,null))[_0xbf27('0x22')](respondWithResult(_0x329f06,null))[_0xbf27('0x2f')](handleError(_0x329f06,null));};exports[_0xbf27('0xb6')]=function(_0x1d91eb,_0x27146f){return db[_0xbf27('0x2b')][_0xbf27('0xb6')](_0x1d91eb[_0xbf27('0xb7')],{})[_0xbf27('0x22')](respondWithResult(_0x27146f,0xc9))[_0xbf27('0x2f')](handleError(_0x27146f,null));};exports[_0xbf27('0xb8')]=function(_0x3725a7,_0x4e9199){if(_0x3725a7[_0xbf27('0xb7')]['id']){delete _0x3725a7[_0xbf27('0xb7')]['id'];}return db[_0xbf27('0x2b')][_0xbf27('0x55')]({'where':{'id':_0x3725a7[_0xbf27('0xb2')]['id']}})[_0xbf27('0x22')](handleEntityNotFound(_0x4e9199,null))[_0xbf27('0x22')](saveUpdates(_0x3725a7[_0xbf27('0xb7')],null))[_0xbf27('0x22')](respondWithResult(_0x4e9199,null))['catch'](handleError(_0x4e9199,null));};exports['destroy']=function(_0x4ad26d,_0x1e3452){return db[_0xbf27('0x2b')][_0xbf27('0x55')]({'where':{'id':_0x4ad26d[_0xbf27('0xb2')]['id']}})[_0xbf27('0x22')](handleEntityNotFound(_0x1e3452,null))[_0xbf27('0x22')](removeEntity(_0x1e3452,null))[_0xbf27('0x2f')](handleError(_0x1e3452,null));};exports[_0xbf27('0xb9')]=function(_0x2fe310,_0xb1b821){return db[_0xbf27('0x2b')]['describe']()['then'](respondWithResult(_0xb1b821,null))[_0xbf27('0x2f')](handleError(_0xb1b821,null));};exports[_0xbf27('0xba')]=function(_0x1655e2,_0x58e500,_0x4728cf){return db[_0xbf27('0xbb')][_0xbf27('0x55')]({'where':{'id':_0x1655e2[_0xbf27('0xb2')]['id']}})[_0xbf27('0x22')](handleEntityNotFound(_0x58e500,null))['then'](function(_0x2f3a2d){if(_0x2f3a2d){return _0x2f3a2d[_0xbf27('0xba')](_0x1655e2[_0xbf27('0xb7')][_0xbf27('0xbc')],_[_0xbf27('0xbd')](_0x1655e2[_0xbf27('0xb7')],[_0xbf27('0xbc'),'id'])||{});}})['then'](respondWithResult(_0x58e500,null))[_0xbf27('0x2f')](handleError(_0x58e500,null));};exports[_0xbf27('0xbe')]=function(_0x45fa5b,_0x12e826,_0x569fe9){var _0x39feb1={'raw':![],'where':{}};var _0x1f8e06={};var _0x290ab7={'count':0x0,'rows':[]};return db['MailInteraction'][_0xbf27('0xaf')]({'where':{'id':_0x45fa5b['params']['id']}})[_0xbf27('0x22')](handleEntityNotFound(_0x12e826,null))[_0xbf27('0x22')](function(_0x6ce8d7){if(_0x6ce8d7){_0x1f8e06[_0xbf27('0x38')]=_[_0xbf27('0x34')](db[_0xbf27('0xbb')]['rawAttributes']);_0x1f8e06[_0xbf27('0x35')]=_[_0xbf27('0x34')](_0x45fa5b[_0xbf27('0x35')]);_0x1f8e06[_0xbf27('0x36')]=_[_0xbf27('0x37')](_0x1f8e06[_0xbf27('0x38')],_0x1f8e06['query']);_0x39feb1[_0xbf27('0x39')]=_[_0xbf27('0x37')](_0x1f8e06[_0xbf27('0x38')],qs[_0xbf27('0x3a')](_0x45fa5b[_0xbf27('0x35')][_0xbf27('0x3a')]));_0x39feb1['attributes']=_0x39feb1[_0xbf27('0x39')][_0xbf27('0x3b')]?_0x39feb1[_0xbf27('0x39')]:_0x1f8e06[_0xbf27('0x38')];if(!_0x45fa5b[_0xbf27('0x35')][_0xbf27('0x3c')]('nolimit')){_0x39feb1[_0xbf27('0x1c')]=qs[_0xbf27('0x1c')](_0x45fa5b[_0xbf27('0x35')][_0xbf27('0x1c')]);_0x39feb1[_0xbf27('0x1b')]=qs[_0xbf27('0x1b')](_0x45fa5b['query']['offset']);}_0x39feb1[_0xbf27('0x3e')]=qs['sort'](_0x45fa5b[_0xbf27('0x35')][_0xbf27('0x3f')]);_0x39feb1['where']=qs[_0xbf27('0x36')](_['pick'](_0x45fa5b[_0xbf27('0x35')],_0x1f8e06[_0xbf27('0x36')]));_0x39feb1[_0xbf27('0x40')][_0xbf27('0xae')]=_0x6ce8d7['id'];if(_0x45fa5b[_0xbf27('0x35')][_0xbf27('0x7a')]){_0x39feb1[_0xbf27('0x40')]=_['merge'](_0x39feb1['where'],{'$or':_[_0xbf27('0x26')](_0x39feb1[_0xbf27('0x39')],function(_0x60e656){var _0x53fab3={};_0x53fab3[_0x60e656]={'$like':'%'+_0x45fa5b['query'][_0xbf27('0x7a')]+'%'};return _0x53fab3;})});}if(_0x45fa5b['query'][_0xbf27('0x70')]){var _0x36c270=_0x45fa5b[_0xbf27('0x35')][_0xbf27('0x70')]['split'](',');var _0x492368={};_0x492368[_0x36c270[0x0]]={'$gte':moment(_0x36c270[0x1])[_0xbf27('0xbf')](_0xbf27('0xc0'))};_0x39feb1['where']=_[_0xbf27('0x91')](_0x39feb1[_0xbf27('0x40')],_0x492368);}_0x39feb1=_[_0xbf27('0x91')]({},_0x39feb1,_0x45fa5b[_0xbf27('0xb5')]);return db[_0xbf27('0xbb')][_0xbf27('0x1a')]({'where':_0x39feb1[_0xbf27('0x40')]})[_0xbf27('0x22')](function(_0x1a39b4){_0x290ab7[_0xbf27('0x1a')]=_0x1a39b4;if(_0x45fa5b['query'][_0xbf27('0xb3')]){_0x39feb1[_0xbf27('0xb4')]=[{'all':!![]}];}return db[_0xbf27('0xbb')][_0xbf27('0xc1')](_0x39feb1);})['then'](function(_0x3c3297){_0x290ab7['rows']=_0x3c3297;return _0x290ab7;});}})[_0xbf27('0x22')](respondWithFilteredResult(_0x12e826,_0x39feb1))['catch'](handleError(_0x12e826,null));};exports[_0xbf27('0xc2')]=function(_0x5e99d0,_0x516e93,_0x3a14ef){return db[_0xbf27('0x2b')]['find']({'where':{'id':_0x5e99d0[_0xbf27('0xb2')]['id']}})[_0xbf27('0x22')](handleEntityNotFound(_0x516e93,null))[_0xbf27('0x22')](function(_0x3f9ce8){if(_0x3f9ce8){return _0x3f9ce8[_0xbf27('0xc3')](_0x5e99d0[_0xbf27('0xb7')]['ids'],_[_0xbf27('0xbd')](_0x5e99d0[_0xbf27('0xb7')],[_0xbf27('0xbc'),'id'])||{})[_0xbf27('0xc4')](function(){return db['Tag'][_0xbf27('0xc1')]({'attributes':['id',_0xbf27('0x25'),_0xbf27('0x44')],'where':{'id':_0x5e99d0[_0xbf27('0xb7')]['ids']}});})[_0xbf27('0x22')](function(_0x67a36f){socket[_0xbf27('0xc5')](_0xbf27('0xc6'),{'id':Number(_0x5e99d0[_0xbf27('0xb2')]['id']),'tags':_0x67a36f||[]});return{'id':Number(_0x5e99d0['params']['id']),'tags':_0x67a36f||[]};});}})[_0xbf27('0x22')](respondWithResult(_0x516e93,null))[_0xbf27('0x2f')](handleError(_0x516e93,null));};exports[_0xbf27('0xc7')]=function(_0x23a3a8,_0x2d0ed4,_0x1d4d15){return db['MailInteraction'][_0xbf27('0x55')]({'where':{'id':_0x23a3a8[_0xbf27('0xb2')]['id']}})[_0xbf27('0x22')](handleEntityNotFound(_0x2d0ed4,null))[_0xbf27('0x22')](function(_0x3e1e0e){if(_0x3e1e0e){return _0x3e1e0e['removeTags'](_0x23a3a8['query'][_0xbf27('0xbc')]);}})[_0xbf27('0x22')](respondWithStatusCode(_0x2d0ed4,null))['catch'](handleError(_0x2d0ed4,null));};exports[_0xbf27('0xc8')]=function(_0x55f63f,_0x8e7bf9){var _0x2459d5=moment()[_0xbf27('0xc9')]()['toString']();var _0x51640c=path['join'](config[_0xbf27('0xca')],_0xbf27('0xcb'),_0xbf27('0xcc'),_0xbf27('0xcd'));var _0x1b9195=path[_0xbf27('0xce')](config[_0xbf27('0xca')],_0xbf27('0xcb'),_0xbf27('0xcc'),'attachments');var _0x30e617=path[_0xbf27('0xce')](_0x51640c,_0x2459d5);var _0x5b89d6=util[_0xbf27('0xbf')](_0xbf27('0xcf'),_0x55f63f[_0xbf27('0xb2')]['id'],_0x2459d5);var _0x2b2ff7=path[_0xbf27('0xce')](_0x51640c,_0x5b89d6);var _0x5dc960=[];if(_0x55f63f['query'][_0xbf27('0xd0')]){_0x5dc960[_0xbf27('0x2a')]({'model':db['Attachment'],'as':_0xbf27('0xd1'),'raw':!![]});}var _0x56cba2=[{'model':db['MailMessage'],'as':_0xbf27('0xd2'),'attributes':['id',_0xbf27('0xb7'),_0xbf27('0x45'),'to','cc',_0xbf27('0xd3'),'subject',_0xbf27('0x6f')],'where':{'secret':![]},'order':qs[_0xbf27('0x3f')]('id'),'include':_0x5dc960}];return db[_0xbf27('0x2b')][_0xbf27('0x55')]({'where':{'id':_0x55f63f[_0xbf27('0xb2')]['id']},'include':_0x56cba2})[_0xbf27('0x22')](handleEntityNotFound(_0x8e7bf9,null))[_0xbf27('0x22')](function(_0x426fde){if(_0x426fde&&_0x426fde['Messages']){var _0x1a6a16=_0x426fde[_0xbf27('0xd4')]({'plain':!![]});fs[_0xbf27('0xd5')](_0x30e617);return BPromise[_0xbf27('0xd6')](_0x1a6a16[_0xbf27('0xd2')],function(_0xeb1cc,_0x320e5c){var _0x107a2d={'from':_0xeb1cc['from'],'to':_0xeb1cc['to'],'subject':_0xeb1cc[_0xbf27('0xd7')],'html':_0xeb1cc[_0xbf27('0xb7')],'headers':{'Date':moment(_0xeb1cc[_0xbf27('0x6f')])[_0xbf27('0xbf')]('ddd,\x20DD\x20MMM\x20YYYY\x20HH:mm:ss\x20ZZ')},'attachments':[]};if(_0xeb1cc['cc']){_0x107a2d[_0xbf27('0xd8')]['Cc']=_0xeb1cc['cc'];}if(_0xeb1cc[_0xbf27('0xd3')]){_0x107a2d[_0xbf27('0xd8')][_0xbf27('0xd9')]=_0xeb1cc['bcc'];}return new BPromise(function(_0x1a7851,_0x4453ec){if(_0xeb1cc[_0xbf27('0xd1')]){for(var _0x4b8a15=0x0;_0x4b8a15<_0xeb1cc[_0xbf27('0xd1')]['length'];_0x4b8a15++){var _0x34d307=_0xeb1cc['Attachments'][_0x4b8a15];var _0x510f71=path['join'](_0x1b9195,_0x34d307[_0xbf27('0xda')]);if(fs[_0xbf27('0xdb')](_0x510f71)){_0x107a2d[_0xbf27('0xd0')][_0xbf27('0x2a')]({'name':_0x34d307[_0xbf27('0x25')],'contentType':_0x34d307['type'],'data':fs['readFileSync'](_0x510f71)});}}}emlformat[_0xbf27('0xdc')](_0x107a2d,function(_0x26183d,_0x27a793){if(_0x26183d)return _0x4453ec(_0x26183d);fs['writeFileSync'](path[_0xbf27('0xce')](_0x30e617,util[_0xbf27('0xbf')](_0xbf27('0xdd'),_0x320e5c)),_0x27a793);return _0x1a7851(_0x27a793);});});})[_0xbf27('0x22')](function(){return new BPromise(function(_0x5ded79,_0x10e57f){zipdir(_0x30e617,{'saveTo':_0x2b2ff7},function(_0x359c95,_0x2312e8){if(_0x359c95)return _0x10e57f(_0x359c95);return _0x5ded79(_0x2312e8);});})['then'](function(){return new BPromise(function(_0x4fe838,_0x3e6a8f){rimraf(_0x30e617,function(_0x460f7a){if(_0x460f7a)_0x3e6a8f(_0x460f7a);return _0x4fe838();});});})[_0xbf27('0x22')](function(){return _0x8e7bf9['download'](_0x2b2ff7,_0x5b89d6,function(_0x32f3db){if(_0x32f3db){console[_0xbf27('0xde')](_0xbf27('0xdf'),_0x32f3db);}else{fs[_0xbf27('0xe0')](_0x2b2ff7);}});});});}else{return _0x8e7bf9[_0xbf27('0x16')](0xc8);}})[_0xbf27('0x2f')](handleError(_0x8e7bf9,null));};
\ No newline at end of file
diff --git a/server/api/mailInteraction/mailInteraction.events.js b/server/api/mailInteraction/mailInteraction.events.js
index f957aaf..f75a96f 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 _0x03bd=['events','MailInteraction','MailMessage','setMaxListeners','save','getUsers','then','Users','map','setDataValue','length','emit','hasOwnProperty','hook','exports'];(function(_0x197185,_0x251145){var _0x2c8af1=function(_0x1dbcfd){while(--_0x1dbcfd){_0x197185['push'](_0x197185['shift']());}};_0x2c8af1(++_0x251145);}(_0x03bd,0x11d));var _0xd03b=function(_0x43781f,_0x8b0384){_0x43781f=_0x43781f-0x0;var _0x134de7=_0x03bd[_0x43781f];return _0x134de7;};'use strict';var EventEmitter=require(_0xd03b('0x0'));var MailInteraction=require('../../mysqldb')['db'][_0xd03b('0x1')];var MailMessage=require('../../mysqldb')['db'][_0xd03b('0x2')];var MailInteractionEvents=new EventEmitter();MailInteractionEvents[_0xd03b('0x3')](0x0);var events={'afterCreate':_0xd03b('0x4'),'afterUpdate':'update','afterDestroy':'remove'};function emitEvent(_0x29398f){return function(_0x55f318,_0x21c0ca,_0x4d6d0e){_0x55f318[_0xd03b('0x5')]({'attributes':['id'],'raw':!![]})[_0xd03b('0x6')](function(_0x446510){_0x55f318['setDataValue'](_0xd03b('0x7'),_0x446510[_0xd03b('0x8')](function(_0x1470b8){return{'id':_0x1470b8['id']};}));return MailMessage['findAll']({'where':{'MailInteractionId':_0x55f318['id'],'direction':'in','read':![]},'raw':!![]});})[_0xd03b('0x6')](function(_0x27048f){_0x55f318[_0xd03b('0x9')]('unreadMessages',_0x27048f[_0xd03b('0xa')]);MailInteractionEvents[_0xd03b('0xb')](_0x29398f+':'+_0x55f318['id'],_0x55f318);MailInteractionEvents['emit'](_0x29398f,_0x55f318);_0x4d6d0e(null);})['catch'](_0x4d6d0e(null));};}for(var e in events){if(events[_0xd03b('0xc')](e)){var event=events[e];MailInteraction[_0xd03b('0xd')](e,emitEvent(event));}}module[_0xd03b('0xe')]=MailInteractionEvents;
\ No newline at end of file
+var _0x6dbc=['Users','length','emit','catch','hasOwnProperty','events','../../mysqldb','MailInteraction','MailMessage','setMaxListeners','save','update','remove','getUsers','then','setDataValue'];(function(_0x36bf88,_0x15c459){var _0x332914=function(_0x512adf){while(--_0x512adf){_0x36bf88['push'](_0x36bf88['shift']());}};_0x332914(++_0x15c459);}(_0x6dbc,0x65));var _0xc6db=function(_0x465a0c,_0x19d4d5){_0x465a0c=_0x465a0c-0x0;var _0x1e202e=_0x6dbc[_0x465a0c];return _0x1e202e;};'use strict';var EventEmitter=require(_0xc6db('0x0'));var MailInteraction=require(_0xc6db('0x1'))['db'][_0xc6db('0x2')];var MailMessage=require(_0xc6db('0x1'))['db'][_0xc6db('0x3')];var MailInteractionEvents=new EventEmitter();MailInteractionEvents[_0xc6db('0x4')](0x0);var events={'afterCreate':_0xc6db('0x5'),'afterUpdate':_0xc6db('0x6'),'afterDestroy':_0xc6db('0x7')};function emitEvent(_0x25246b){return function(_0x466d14,_0xd50616,_0x4a0377){_0x466d14[_0xc6db('0x8')]({'attributes':['id'],'raw':!![]})[_0xc6db('0x9')](function(_0x423877){_0x466d14[_0xc6db('0xa')](_0xc6db('0xb'),_0x423877['map'](function(_0xbb5ff){return{'id':_0xbb5ff['id']};}));return MailMessage['findAll']({'where':{'MailInteractionId':_0x466d14['id'],'direction':'in','read':![]},'raw':!![]});})[_0xc6db('0x9')](function(_0x2d67a1){_0x466d14[_0xc6db('0xa')]('unreadMessages',_0x2d67a1[_0xc6db('0xc')]);MailInteractionEvents[_0xc6db('0xd')](_0x25246b+':'+_0x466d14['id'],_0x466d14);MailInteractionEvents[_0xc6db('0xd')](_0x25246b,_0x466d14);_0x4a0377(null);})[_0xc6db('0xe')](_0x4a0377(null));};}for(var e in events){if(events[_0xc6db('0xf')](e)){var event=events[e];MailInteraction['hook'](e,emitEvent(event));}}module['exports']=MailInteractionEvents;
\ No newline at end of file
diff --git a/server/api/mailInteraction/mailInteraction.model.js b/server/api/mailInteraction/mailInteraction.model.js
index b4c420a..16951ed 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 _0x639a=['format','YYYY-MM-DD\x20HH:mm:ss','closed','closedAt','changed','models','get','MailMessage','update','then','utf8mb4','utf8mb4_unicode_ci','util','../../config/logger','api','moment','bluebird','request-promise','rimraf','../../config/environment','./mailInteraction.attributes','define','MailInteraction','fti_mail_interactions','subject','FULLTEXT','substatus','substatusAt'];(function(_0x34238f,_0x432ebf){var _0x262ea5=function(_0x2f39b6){while(--_0x2f39b6){_0x34238f['push'](_0x34238f['shift']());}};_0x262ea5(++_0x432ebf);}(_0x639a,0xec));var _0xa639=function(_0x2075f1,_0x196f45){_0x2075f1=_0x2075f1-0x0;var _0x55160a=_0x639a[_0x2075f1];return _0x55160a;};'use strict';var _=require('lodash');var util=require(_0xa639('0x0'));var logger=require(_0xa639('0x1'))(_0xa639('0x2'));var moment=require(_0xa639('0x3'));var BPromise=require(_0xa639('0x4'));var rp=require(_0xa639('0x5'));var fs=require('fs');var path=require('path');var rimraf=require(_0xa639('0x6'));var config=require(_0xa639('0x7'));var attributes=require(_0xa639('0x8'));module['exports']=function(_0xa1931a,_0x21aca9){return _0xa1931a[_0xa639('0x9')](_0xa639('0xa'),attributes,{'tableName':'mail_interactions','paranoid':![],'indexes':[{'name':_0xa639('0xb'),'fields':[_0xa639('0xc'),'to'],'type':_0xa639('0xd')}],'timestamps':!![],'hooks':{'beforeCreate':function(_0x3060a8,_0x324365,_0x29dea0){if(_0x3060a8[_0xa639('0xe')]){_0x3060a8[_0xa639('0xf')]=moment()[_0xa639('0x10')](_0xa639('0x11'));}if(_0x3060a8[_0xa639('0x12')]){_0x3060a8[_0xa639('0x13')]=moment()[_0xa639('0x10')](_0xa639('0x11'));}_0x29dea0(null,_0x324365);},'beforeUpdate':function(_0x5055a2,_0x5cbf2f,_0x5ba862){if(_0x5055a2[_0xa639('0x14')](_0xa639('0xe'))){_0x5055a2['substatusAt']=_0x5055a2['substatus']?moment()[_0xa639('0x10')](_0xa639('0x11')):null;}if(_0x5055a2['changed'](_0xa639('0x12'))){_0x5055a2[_0xa639('0x13')]=moment()[_0xa639('0x10')]('YYYY-MM-DD\x20HH:mm:ss');_0x5055a2[_0xa639('0xe')]=null;_0x5055a2[_0xa639('0xf')]=null;}_0x5ba862(null,_0x5055a2);},'afterUpdate':function(_0x96a92f,_0xd769d3,_0x39f769){var _0x5924bd=_0xa1931a[_0xa639('0x15')];var _0x4c6311=_0x96a92f[_0xa639('0x16')]({'plain':!![]});if(_0x4c6311[_0xa639('0x12')]){return _0x5924bd[_0xa639('0x17')][_0xa639('0x18')]({'read':!![]},{'where':{'MailInteractionId':_0x4c6311['id']}})[_0xa639('0x19')](function(){_0x39f769();})['catch'](function(_0x57dd6c){_0x39f769(_0x57dd6c);});}else{_0x39f769();}}},'charset':_0xa639('0x1a'),'collate':_0xa639('0x1b')});};
\ No newline at end of file
+var _0xf429=['request-promise','rimraf','../../config/environment','./mailInteraction.attributes','define','MailInteraction','mail_interactions','FULLTEXT','substatus','substatusAt','format','YYYY-MM-DD\x20HH:mm:ss','closed','closedAt','changed','models','MailMessage','update','catch','utf8mb4','util','../../config/logger','api','bluebird'];(function(_0x158752,_0xe0679a){var _0x5a236d=function(_0x3875ef){while(--_0x3875ef){_0x158752['push'](_0x158752['shift']());}};_0x5a236d(++_0xe0679a);}(_0xf429,0xd4));var _0x9f42=function(_0x3a1b90,_0x3c0158){_0x3a1b90=_0x3a1b90-0x0;var _0xf6de77=_0xf429[_0x3a1b90];return _0xf6de77;};'use strict';var _=require('lodash');var util=require(_0x9f42('0x0'));var logger=require(_0x9f42('0x1'))(_0x9f42('0x2'));var moment=require('moment');var BPromise=require(_0x9f42('0x3'));var rp=require(_0x9f42('0x4'));var fs=require('fs');var path=require('path');var rimraf=require(_0x9f42('0x5'));var config=require(_0x9f42('0x6'));var attributes=require(_0x9f42('0x7'));module['exports']=function(_0x4d3ea7,_0x874a2b){return _0x4d3ea7[_0x9f42('0x8')](_0x9f42('0x9'),attributes,{'tableName':_0x9f42('0xa'),'paranoid':![],'indexes':[{'name':'fti_mail_interactions','fields':['subject','to'],'type':_0x9f42('0xb')}],'timestamps':!![],'hooks':{'beforeCreate':function(_0x583df0,_0x9ebde2,_0x5dde1c){if(_0x583df0[_0x9f42('0xc')]){_0x583df0[_0x9f42('0xd')]=moment()[_0x9f42('0xe')](_0x9f42('0xf'));}if(_0x583df0[_0x9f42('0x10')]){_0x583df0[_0x9f42('0x11')]=moment()['format'](_0x9f42('0xf'));}_0x5dde1c(null,_0x9ebde2);},'beforeUpdate':function(_0x4f8b08,_0x425fa5,_0x78bc2a){if(_0x4f8b08[_0x9f42('0x12')](_0x9f42('0xc'))){_0x4f8b08[_0x9f42('0xd')]=_0x4f8b08[_0x9f42('0xc')]?moment()['format'](_0x9f42('0xf')):null;}if(_0x4f8b08[_0x9f42('0x12')](_0x9f42('0x10'))){_0x4f8b08[_0x9f42('0x11')]=moment()['format']('YYYY-MM-DD\x20HH:mm:ss');_0x4f8b08[_0x9f42('0xc')]=null;_0x4f8b08[_0x9f42('0xd')]=null;}_0x78bc2a(null,_0x4f8b08);},'afterUpdate':function(_0x50807b,_0x2658aa,_0x3e292d){var _0x3bdae8=_0x4d3ea7[_0x9f42('0x13')];var _0x186ee6=_0x50807b['get']({'plain':!![]});if(_0x186ee6[_0x9f42('0x10')]){return _0x3bdae8[_0x9f42('0x14')][_0x9f42('0x15')]({'read':!![]},{'where':{'MailInteractionId':_0x186ee6['id']}})['then'](function(){_0x3e292d();})[_0x9f42('0x16')](function(_0x299aa4){_0x3e292d(_0x299aa4);});}else{_0x3e292d();}}},'charset':_0x9f42('0x17'),'collate':'utf8mb4_unicode_ci'});};
\ No newline at end of file
diff --git a/server/api/mailInteraction/mailInteraction.rpc.js b/server/api/mailInteraction/mailInteraction.rpc.js
index 4bec36f..2686848 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 _0xb921=['code','message','info','result','MailInteraction','body','options','where','attributes','limit','UpdateMailInteraction','catch','addTags','omit','ids','spread','AddTags','debug','lodash','util','moment','bluebird','randomstring','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','client','http','redis','defaults','localhost','socket.io-emitter','./mailInteraction.socket','register','request','then','MailInteraction,\x20%s,\x20%s','request\x20sent','MailInteraction,\x20%s,\x20%s,\x20%s','stringify','error'];(function(_0x5ec691,_0x368816){var _0xf9fc8c=function(_0x33f26b){while(--_0x33f26b){_0x5ec691['push'](_0x5ec691['shift']());}};_0xf9fc8c(++_0x368816);}(_0xb921,0x16a));var _0x1b92=function(_0x76b00b,_0x26e939){_0x76b00b=_0x76b00b-0x0;var _0xc8e4a=_0xb921[_0x76b00b];return _0xc8e4a;};'use strict';var _=require(_0x1b92('0x0'));var util=require(_0x1b92('0x1'));var moment=require(_0x1b92('0x2'));var BPromise=require(_0x1b92('0x3'));var rs=require(_0x1b92('0x4'));var fs=require('fs');var Redis=require('ioredis');var db=require('../../mysqldb')['db'];var utils=require(_0x1b92('0x5'));var logger=require(_0x1b92('0x6'))(_0x1b92('0x7'));var config=require(_0x1b92('0x8'));var jayson=require(_0x1b92('0x9'));var client=jayson[_0x1b92('0xa')][_0x1b92('0xb')]({'port':0x232a});config[_0x1b92('0xc')]=_[_0x1b92('0xd')](config[_0x1b92('0xc')],{'host':_0x1b92('0xe'),'port':0x18eb});var socket=require(_0x1b92('0xf'))(new Redis(config[_0x1b92('0xc')]));require(_0x1b92('0x10'))[_0x1b92('0x11')](socket);function respondWithRpcPromise(_0x4c8e30,_0x31e314,_0x1e5802){return new BPromise(function(_0x154b6d,_0x146d68){return client[_0x1b92('0x12')](_0x4c8e30,_0x1e5802)[_0x1b92('0x13')](function(_0x3deaf4){logger['info'](_0x1b92('0x14'),_0x31e314,_0x1b92('0x15'));logger['debug'](_0x1b92('0x16'),_0x31e314,_0x1b92('0x15'),JSON[_0x1b92('0x17')](_0x3deaf4));if(_0x3deaf4[_0x1b92('0x18')]){if(_0x3deaf4[_0x1b92('0x18')][_0x1b92('0x19')]===0x1f4){logger[_0x1b92('0x18')]('MailInteraction,\x20%s,\x20%s',_0x31e314,_0x3deaf4[_0x1b92('0x18')]['message']);return _0x146d68(_0x3deaf4[_0x1b92('0x18')]['message']);}logger[_0x1b92('0x18')]('MailInteraction,\x20%s,\x20%s',_0x31e314,_0x3deaf4[_0x1b92('0x18')][_0x1b92('0x1a')]);return _0x154b6d(_0x3deaf4[_0x1b92('0x18')]['message']);}else{logger[_0x1b92('0x1b')](_0x1b92('0x14'),_0x31e314,_0x1b92('0x15'));_0x154b6d(_0x3deaf4[_0x1b92('0x1c')][_0x1b92('0x1a')]);}})['catch'](function(_0x4024bf){logger[_0x1b92('0x18')](_0x1b92('0x14'),_0x31e314,_0x4024bf);_0x146d68(_0x4024bf);});});}exports['UpdateMailInteraction']=function(_0x227f94){var _0x26460d=this;return new Promise(function(_0x2cdc01,_0x4bfc51){return db[_0x1b92('0x1d')]['update'](_0x227f94[_0x1b92('0x1e')],{'raw':_0x227f94[_0x1b92('0x1f')]?_0x227f94['options']['raw']===undefined?!![]:![]:!![],'individualHooks':!![],'where':_0x227f94[_0x1b92('0x1f')]?_0x227f94[_0x1b92('0x1f')][_0x1b92('0x20')]||null:null,'attributes':_0x227f94[_0x1b92('0x1f')]?_0x227f94[_0x1b92('0x1f')][_0x1b92('0x21')]||null:null,'limit':_0x227f94['options']?_0x227f94[_0x1b92('0x1f')][_0x1b92('0x22')]||null:null})[_0x1b92('0x13')](function(_0x39dcaa){logger['info'](_0x1b92('0x23'),_0x227f94);logger['debug'](_0x1b92('0x23'),_0x227f94,JSON[_0x1b92('0x17')](_0x39dcaa));_0x2cdc01(_0x39dcaa);})[_0x1b92('0x24')](function(_0x3c1fa1){logger[_0x1b92('0x18')](_0x1b92('0x23'),_0x3c1fa1[_0x1b92('0x1a')],_0x227f94);_0x4bfc51(_0x26460d[_0x1b92('0x18')](0x1f4,_0x3c1fa1['message']));});});};exports['AddTagsToMailInteraction']=function(_0x54d92c){return new Promise(function(_0x229c44,_0x525d05){return db[_0x1b92('0x1d')]['find']({'where':_0x54d92c[_0x1b92('0x1f')]?_0x54d92c[_0x1b92('0x1f')][_0x1b92('0x20')]||null:null})['then'](function(_0x404c3e){if(_0x404c3e){return _0x404c3e[_0x1b92('0x25')](_0x54d92c['body']['ids'],_[_0x1b92('0x26')](_0x54d92c[_0x1b92('0x1e')],[_0x1b92('0x27'),'id'])||{});}})[_0x1b92('0x28')](function(_0x203302){logger['info'](_0x1b92('0x29'),_0x54d92c);logger[_0x1b92('0x2a')](_0x1b92('0x29'),_0x54d92c,JSON[_0x1b92('0x17')](_0x203302));_0x229c44(_0x203302);})[_0x1b92('0x24')](function(_0x22515e){logger[_0x1b92('0x18')]('AddTags',_0x22515e[_0x1b92('0x1a')],_0x54d92c);_0x525d05(_this[_0x1b92('0x18')](0x1f4,_0x22515e['message']));});});};
\ No newline at end of file
+var _0xb010=['stringify','error','MailInteraction,\x20%s,\x20%s','message','result','UpdateMailInteraction','MailInteraction','update','body','options','where','limit','catch','AddTagsToMailInteraction','addTags','ids','omit','spread','AddTags','util','bluebird','ioredis','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','client','http','redis','defaults','localhost','socket.io-emitter','register','request','then','info','request\x20sent','debug','MailInteraction,\x20%s,\x20%s,\x20%s'];(function(_0x61b3ab,_0x1fc298){var _0x57097f=function(_0x25970b){while(--_0x25970b){_0x61b3ab['push'](_0x61b3ab['shift']());}};_0x57097f(++_0x1fc298);}(_0xb010,0x8b));var _0x0b01=function(_0x4ae6ef,_0xc2af80){_0x4ae6ef=_0x4ae6ef-0x0;var _0x3cbb4e=_0xb010[_0x4ae6ef];return _0x3cbb4e;};'use strict';var _=require('lodash');var util=require(_0x0b01('0x0'));var moment=require('moment');var BPromise=require(_0x0b01('0x1'));var rs=require('randomstring');var fs=require('fs');var Redis=require(_0x0b01('0x2'));var db=require('../../mysqldb')['db'];var utils=require(_0x0b01('0x3'));var logger=require(_0x0b01('0x4'))(_0x0b01('0x5'));var config=require(_0x0b01('0x6'));var jayson=require(_0x0b01('0x7'));var client=jayson[_0x0b01('0x8')][_0x0b01('0x9')]({'port':0x232a});config[_0x0b01('0xa')]=_[_0x0b01('0xb')](config[_0x0b01('0xa')],{'host':_0x0b01('0xc'),'port':0x18eb});var socket=require(_0x0b01('0xd'))(new Redis(config[_0x0b01('0xa')]));require('./mailInteraction.socket')[_0x0b01('0xe')](socket);function respondWithRpcPromise(_0xae6eac,_0x45108e,_0x22d309){return new BPromise(function(_0x36bd93,_0xfcc830){return client[_0x0b01('0xf')](_0xae6eac,_0x22d309)[_0x0b01('0x10')](function(_0x2008aa){logger[_0x0b01('0x11')]('MailInteraction,\x20%s,\x20%s',_0x45108e,_0x0b01('0x12'));logger[_0x0b01('0x13')](_0x0b01('0x14'),_0x45108e,_0x0b01('0x12'),JSON[_0x0b01('0x15')](_0x2008aa));if(_0x2008aa[_0x0b01('0x16')]){if(_0x2008aa[_0x0b01('0x16')]['code']===0x1f4){logger[_0x0b01('0x16')](_0x0b01('0x17'),_0x45108e,_0x2008aa[_0x0b01('0x16')][_0x0b01('0x18')]);return _0xfcc830(_0x2008aa[_0x0b01('0x16')][_0x0b01('0x18')]);}logger[_0x0b01('0x16')](_0x0b01('0x17'),_0x45108e,_0x2008aa[_0x0b01('0x16')][_0x0b01('0x18')]);return _0x36bd93(_0x2008aa[_0x0b01('0x16')][_0x0b01('0x18')]);}else{logger['info'](_0x0b01('0x17'),_0x45108e,_0x0b01('0x12'));_0x36bd93(_0x2008aa[_0x0b01('0x19')]['message']);}})['catch'](function(_0x52ee7a){logger[_0x0b01('0x16')](_0x0b01('0x17'),_0x45108e,_0x52ee7a);_0xfcc830(_0x52ee7a);});});}exports[_0x0b01('0x1a')]=function(_0x1d9227){var _0x2bc872=this;return new Promise(function(_0x2e47b0,_0x5a68c1){return db[_0x0b01('0x1b')][_0x0b01('0x1c')](_0x1d9227[_0x0b01('0x1d')],{'raw':_0x1d9227[_0x0b01('0x1e')]?_0x1d9227[_0x0b01('0x1e')]['raw']===undefined?!![]:![]:!![],'individualHooks':!![],'where':_0x1d9227['options']?_0x1d9227[_0x0b01('0x1e')][_0x0b01('0x1f')]||null:null,'attributes':_0x1d9227[_0x0b01('0x1e')]?_0x1d9227[_0x0b01('0x1e')]['attributes']||null:null,'limit':_0x1d9227['options']?_0x1d9227['options'][_0x0b01('0x20')]||null:null})['then'](function(_0x4af9f6){logger['info'](_0x0b01('0x1a'),_0x1d9227);logger[_0x0b01('0x13')](_0x0b01('0x1a'),_0x1d9227,JSON[_0x0b01('0x15')](_0x4af9f6));_0x2e47b0(_0x4af9f6);})[_0x0b01('0x21')](function(_0x1c538e){logger[_0x0b01('0x16')](_0x0b01('0x1a'),_0x1c538e['message'],_0x1d9227);_0x5a68c1(_0x2bc872[_0x0b01('0x16')](0x1f4,_0x1c538e[_0x0b01('0x18')]));});});};exports[_0x0b01('0x22')]=function(_0x513f07){return new Promise(function(_0x53b17a,_0x29799c){return db['MailInteraction']['find']({'where':_0x513f07[_0x0b01('0x1e')]?_0x513f07[_0x0b01('0x1e')][_0x0b01('0x1f')]||null:null})['then'](function(_0x3a91bf){if(_0x3a91bf){return _0x3a91bf[_0x0b01('0x23')](_0x513f07[_0x0b01('0x1d')][_0x0b01('0x24')],_[_0x0b01('0x25')](_0x513f07[_0x0b01('0x1d')],[_0x0b01('0x24'),'id'])||{});}})[_0x0b01('0x26')](function(_0x51d668){logger[_0x0b01('0x11')](_0x0b01('0x27'),_0x513f07);logger[_0x0b01('0x13')]('AddTags',_0x513f07,JSON[_0x0b01('0x15')](_0x51d668));_0x53b17a(_0x51d668);})['catch'](function(_0x2f3fb4){logger['error'](_0x0b01('0x27'),_0x2f3fb4['message'],_0x513f07);_0x29799c(_this[_0x0b01('0x16')](0x1f4,_0x2f3fb4[_0x0b01('0x18')]));});});};
\ No newline at end of file
diff --git a/server/api/mailInteraction/mailInteraction.socket.js b/server/api/mailInteraction/mailInteraction.socket.js
index 4d5897d..00d46d0 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 _0x31ac=['register','mailInteraction:','./mailInteraction.events','save','remove','removeListener'];(function(_0x31b236,_0x49138e){var _0x9c4dbd=function(_0x40b04a){while(--_0x40b04a){_0x31b236['push'](_0x31b236['shift']());}};_0x9c4dbd(++_0x49138e);}(_0x31ac,0xb0));var _0xc31a=function(_0x12d224,_0x30616e){_0x12d224=_0x12d224-0x0;var _0x32c471=_0x31ac[_0x12d224];return _0x32c471;};'use strict';var MailInteractionEvents=require(_0xc31a('0x0'));var events=[_0xc31a('0x1'),_0xc31a('0x2'),'update'];function createListener(_0x1c5ad1,_0x17d888){return function(_0x5aad1f){_0x17d888['emit'](_0x1c5ad1,_0x5aad1f);};}function removeListener(_0x3984fa,_0x4521e0){return function(){MailInteractionEvents[_0xc31a('0x3')](_0x3984fa,_0x4521e0);};}exports[_0xc31a('0x4')]=function(_0x29d2cc){for(var _0x3c9d6e=0x0,_0x5149f8=events['length'];_0x3c9d6e<_0x5149f8;_0x3c9d6e++){var _0x451470=events[_0x3c9d6e];var _0x3fe539=createListener(_0xc31a('0x5')+_0x451470,_0x29d2cc);MailInteractionEvents['on'](_0x451470,_0x3fe539);}};
\ No newline at end of file
+var _0xcfbe=['mailInteraction:','./mailInteraction.events','save','remove','emit','removeListener','register','length'];(function(_0x36c247,_0x4b2cf7){var _0x4ce559=function(_0x5ec490){while(--_0x5ec490){_0x36c247['push'](_0x36c247['shift']());}};_0x4ce559(++_0x4b2cf7);}(_0xcfbe,0x171));var _0xecfb=function(_0x368250,_0x36d197){_0x368250=_0x368250-0x0;var _0x3acb12=_0xcfbe[_0x368250];return _0x3acb12;};'use strict';var MailInteractionEvents=require(_0xecfb('0x0'));var events=[_0xecfb('0x1'),_0xecfb('0x2'),'update'];function createListener(_0x120395,_0x1a0dc2){return function(_0x46b62f){_0x1a0dc2[_0xecfb('0x3')](_0x120395,_0x46b62f);};}function removeListener(_0x5a7736,_0xd44ea1){return function(){MailInteractionEvents[_0xecfb('0x4')](_0x5a7736,_0xd44ea1);};}exports[_0xecfb('0x5')]=function(_0x7302a2){for(var _0x8f2cc2=0x0,_0x10e75d=events[_0xecfb('0x6')];_0x8f2cc2<_0x10e75d;_0x8f2cc2++){var _0xc92d59=events[_0x8f2cc2];var _0x2fbcee=createListener(_0xecfb('0x7')+_0xc92d59,_0x7302a2);MailInteractionEvents['on'](_0xc92d59,_0x2fbcee);}};
\ No newline at end of file
diff --git a/server/api/mailMessage/index.js b/server/api/mailMessage/index.js
index 86990ee..d6102ea 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 _0x55ca=['get','isAuthenticated','index','/describe','describe','show','download','post','tracked','mail','mailmessage:create','create','put','/:id','/:id/reject','reject','delete','destroy','exports','multer','util','Router','../../components/auth/service','../../config/environment','./mailMessage.controller'];(function(_0x4c9413,_0x4c34d3){var _0x461161=function(_0x497ffd){while(--_0x497ffd){_0x4c9413['push'](_0x4c9413['shift']());}};_0x461161(++_0x4c34d3);}(_0x55ca,0x126));var _0xa55c=function(_0x45f575,_0x3ae51c){_0x45f575=_0x45f575-0x0;var _0xd8e1a1=_0x55ca[_0x45f575];return _0xd8e1a1;};'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('0x6')]('/:id',auth[_0xa55c('0x7')](),controller[_0xa55c('0xb')]);router['get']('/:id/download',auth[_0xa55c('0x7')](),controller[_0xa55c('0xc')]);router[_0xa55c('0xd')]('/',auth[_0xa55c('0x7')](),interaction[_0xa55c('0xe')](_0xa55c('0xf'),_0xa55c('0x10')),controller[_0xa55c('0x11')]);router[_0xa55c('0x12')](_0xa55c('0x13'),auth['isAuthenticated'](),controller['update']);router[_0xa55c('0x12')]('/:id/accept',auth['isAuthenticated'](),controller['accept']);router[_0xa55c('0x12')](_0xa55c('0x14'),auth[_0xa55c('0x7')](),controller[_0xa55c('0x15')]);router[_0xa55c('0x16')](_0xa55c('0x13'),auth['isAuthenticated'](),controller[_0xa55c('0x17')]);module[_0xa55c('0x18')]=router;
\ No newline at end of file
+var _0x7217=['mailmessage:create','create','put','update','accept','/:id/reject','reject','delete','exports','multer','path','connect-timeout','express','Router','../../components/auth/service','./mailMessage.controller','get','isAuthenticated','index','/describe','describe','/:id','show','/:id/download','post','tracked','mail'];(function(_0x176148,_0x1ac70f){var _0x3a1f7b=function(_0x26a490){while(--_0x26a490){_0x176148['push'](_0x176148['shift']());}};_0x3a1f7b(++_0x1ac70f);}(_0x7217,0x19e));var _0x7721=function(_0x56482c,_0x16118d){_0x56482c=_0x56482c-0x0;var _0x5aae7a=_0x7217[_0x56482c];return _0x5aae7a;};'use strict';var multer=require(_0x7721('0x0'));var util=require('util');var path=require(_0x7721('0x1'));var timeout=require(_0x7721('0x2'));var express=require(_0x7721('0x3'));var router=express[_0x7721('0x4')]();var auth=require(_0x7721('0x5'));var interaction=require('../../components/interaction/service');var config=require('../../config/environment');var controller=require(_0x7721('0x6'));router[_0x7721('0x7')]('/',auth[_0x7721('0x8')](),controller[_0x7721('0x9')]);router[_0x7721('0x7')](_0x7721('0xa'),auth[_0x7721('0x8')](),controller[_0x7721('0xb')]);router[_0x7721('0x7')](_0x7721('0xc'),auth[_0x7721('0x8')](),controller[_0x7721('0xd')]);router[_0x7721('0x7')](_0x7721('0xe'),auth[_0x7721('0x8')](),controller['download']);router[_0x7721('0xf')]('/',auth[_0x7721('0x8')](),interaction[_0x7721('0x10')](_0x7721('0x11'),_0x7721('0x12')),controller[_0x7721('0x13')]);router[_0x7721('0x14')](_0x7721('0xc'),auth['isAuthenticated'](),controller[_0x7721('0x15')]);router[_0x7721('0x14')]('/:id/accept',auth[_0x7721('0x8')](),controller[_0x7721('0x16')]);router[_0x7721('0x14')](_0x7721('0x17'),auth['isAuthenticated'](),controller[_0x7721('0x18')]);router[_0x7721('0x19')]('/:id',auth['isAuthenticated'](),controller['destroy']);module[_0x7721('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 01f2382..b224ae0 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 _0x09d2=['ENUM','out','STRING','DATE','sequelize','lodash','exports','TEXT','long','medium','BOOLEAN'];(function(_0x122096,_0x60c295){var _0x3d1966=function(_0x3d569e){while(--_0x3d569e){_0x122096['push'](_0x122096['shift']());}};_0x3d1966(++_0x60c295);}(_0x09d2,0x1d2));var _0x209d=function(_0x51c8ba,_0x2077cd){_0x51c8ba=_0x51c8ba-0x0;var _0x5c4205=_0x09d2[_0x51c8ba];return _0x5c4205;};'use strict';var Sequelize=require(_0x209d('0x0'));var _=require(_0x209d('0x1'));module[_0x209d('0x2')]={'body':{'type':Sequelize[_0x209d('0x3')](_0x209d('0x4')),'allowNull':![]},'plainBody':{'type':Sequelize[_0x209d('0x3')](_0x209d('0x5'))},'read':{'type':Sequelize[_0x209d('0x6')],'defaultValue':![]},'direction':{'type':Sequelize[_0x209d('0x7')]('in',_0x209d('0x8')),'defaultValue':'out','allowNull':![]},'messageId':{'type':Sequelize[_0x209d('0x9')](0x1fe)},'from':{'type':Sequelize[_0x209d('0x9')]},'to':{'type':Sequelize[_0x209d('0x3')](_0x209d('0x4'))},'cc':{'type':Sequelize[_0x209d('0x3')]('long')},'bcc':{'type':Sequelize['TEXT'](_0x209d('0x4'))},'subject':{'type':Sequelize[_0x209d('0x3')]},'sentAt':{'type':Sequelize[_0x209d('0xa')]},'attach':{'type':Sequelize['INTEGER'],'defaultValue':0x0},'secret':{'type':Sequelize[_0x209d('0x6')],'defaultValue':![]},'readAt':{'type':Sequelize['DATE']},'originTo':{'type':Sequelize[_0x209d('0x3')](_0x209d('0x4'))},'originCc':{'type':Sequelize[_0x209d('0x3')](_0x209d('0x4'))}};
\ No newline at end of file
+var _0x6017=['out','STRING','DATE','INTEGER','sequelize','lodash','exports','long','TEXT','BOOLEAN'];(function(_0x16e2a9,_0x3cbc17){var _0x3d1866=function(_0x52f380){while(--_0x52f380){_0x16e2a9['push'](_0x16e2a9['shift']());}};_0x3d1866(++_0x3cbc17);}(_0x6017,0xae));var _0x7601=function(_0x5c4048,_0x137656){_0x5c4048=_0x5c4048-0x0;var _0x49126f=_0x6017[_0x5c4048];return _0x49126f;};'use strict';var Sequelize=require(_0x7601('0x0'));var _=require(_0x7601('0x1'));module[_0x7601('0x2')]={'body':{'type':Sequelize['TEXT'](_0x7601('0x3')),'allowNull':![]},'plainBody':{'type':Sequelize[_0x7601('0x4')]('medium')},'read':{'type':Sequelize[_0x7601('0x5')],'defaultValue':![]},'direction':{'type':Sequelize['ENUM']('in',_0x7601('0x6')),'defaultValue':'out','allowNull':![]},'messageId':{'type':Sequelize['STRING'](0x1fe)},'from':{'type':Sequelize[_0x7601('0x7')]},'to':{'type':Sequelize[_0x7601('0x4')](_0x7601('0x3'))},'cc':{'type':Sequelize[_0x7601('0x4')](_0x7601('0x3'))},'bcc':{'type':Sequelize[_0x7601('0x4')]('long')},'subject':{'type':Sequelize[_0x7601('0x4')]},'sentAt':{'type':Sequelize[_0x7601('0x8')]},'attach':{'type':Sequelize[_0x7601('0x9')],'defaultValue':0x0},'secret':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'readAt':{'type':Sequelize[_0x7601('0x8')]},'originTo':{'type':Sequelize[_0x7601('0x4')](_0x7601('0x3'))},'originCc':{'type':Sequelize['TEXT'](_0x7601('0x3'))}};
\ No newline at end of file
diff --git a/server/api/mailMessage/mailMessage.controller.js b/server/api/mailMessage/mailMessage.controller.js
index c3eb499..52b99e7 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 _0xaab3=['where','pick','merge','VIRTUAL','includeAll','findAll','rows','catch','show','params','rawAttributes','include','options','body','find','describe','create','direction','out','split','MailAccount','findOne','MailAccountId','CmList','List','CmContact','updatedAt','DESC','Smtp','isNil','service','host','port','secure','authentication','auth','user','pass','attachments','join','root','server/files/attachments','Contacts','ListId','List\x20not\x20found','SendMail','sendMail','messageId','format','YYYY-MM-DD\x20HH:mm:ss','stringify','mail-interactions','accept','mail','read','UserId','Contact','get','MailInteraction','MailInteractionId','read1stAt','interaction','role','AcceptMessage','acceptMessage','manual','interface','channel','event','EventManager','acceptmessage','agent','[MAILMESSAGE:REJECT]\x20id=%s\x20name=%s\x20role=%s\x20interaction=%s\x20body=%s','null','RejectMessage','rejectMessage','SIP/%s','rejectmessage','download','unix','toString','server','files','tmp','message-%s.eml','subject','createdAt','Attachment','from','ddd,\x20DD\x20MMM\x20YYYY\x20HH:mm:ss\x20ZZ','bcc','Bcc','Attachments','basename','existsSync','build','writeFileSync','err','html-pdf','eml-format','rimraf','zip-dir','request-promise','moment','bluebird','mustache','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','api','../../config/environment','../../mysqldb','redis','defaults','localhost','socket.io-emitter','./mailMessage.socket','register','http','client','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','request\x20sent','debug','MailMessage,\x20%s,\x20%s,\x20%s','error','code','MailMessage,\x20%s,\x20%s','message','sendStatus','end','json','count','offset','set','Content-Range','apply','reject','save','update','destroy','status','name','send','index','map','MailMessage','type','key','model','keys','query','filters','intersection','attributes','fields','length','nolimit','limit','order','sort'];(function(_0x4260d0,_0x73ac34){var _0x5f34c2=function(_0x1c28ca){while(--_0x1c28ca){_0x4260d0['push'](_0x4260d0['shift']());}};_0x5f34c2(++_0x73ac34);}(_0xaab3,0x1c4));var _0x3aab=function(_0x15cc38,_0x4b3c93){_0x15cc38=_0x15cc38-0x0;var _0x1306c3=_0xaab3[_0x15cc38];return _0x1306c3;};'use strict';var pdf=require(_0x3aab('0x0'));var emlformat=require(_0x3aab('0x1'));var rimraf=require(_0x3aab('0x2'));var zipdir=require(_0x3aab('0x3'));var jsonpatch=require('fast-json-patch');var rp=require(_0x3aab('0x4'));var moment=require(_0x3aab('0x5'));var BPromise=require(_0x3aab('0x6'));var Mustache=require(_0x3aab('0x7'));var util=require('util');var path=require('path');var sox=require(_0x3aab('0x8'));var csv=require(_0x3aab('0x9'));var ejs=require(_0x3aab('0xa'));var fs=require('fs');var _=require(_0x3aab('0xb'));var squel=require(_0x3aab('0xc'));var crypto=require(_0x3aab('0xd'));var jsforce=require(_0x3aab('0xe'));var deskjs=require(_0x3aab('0xf'));var toCsv=require(_0x3aab('0x9'));var querystring=require(_0x3aab('0x10'));var Papa=require(_0x3aab('0x11'));var Redis=require('ioredis');var authService=require(_0x3aab('0x12'));var qs=require(_0x3aab('0x13'));var as=require(_0x3aab('0x14'));var hardwareService=require(_0x3aab('0x15'));var logger=require(_0x3aab('0x16'))(_0x3aab('0x17'));var utils=require('../../config/utils');var config=require(_0x3aab('0x18'));var db=require(_0x3aab('0x19'))['db'];config[_0x3aab('0x1a')]=_[_0x3aab('0x1b')](config['redis'],{'host':_0x3aab('0x1c'),'port':0x18eb});var socket=require(_0x3aab('0x1d'))(new Redis(config['redis']));require(_0x3aab('0x1e'))[_0x3aab('0x1f')](socket);var jayson=require('jayson/promise');var client=jayson['client'][_0x3aab('0x20')]({'port':0x232c});var client9003=jayson[_0x3aab('0x21')]['http']({'port':0x232b});var client9002=jayson['client'][_0x3aab('0x20')]({'port':0x232a});function checkPasswordPattern(_0x13c52a,_0x54d5d4,_0x457f2e){if(_0x457f2e){var _0x5b6483=new RegExp(/(?=.*[a-z])(?=.*[A-Z])(?=.*[0-9])(?=.*[?!@#\$%\^&\*~\-_=+[{\]\}])(?=.{8,})/);if(_0x5b6483[_0x3aab('0x22')](_0x54d5d4)){return _0x13c52a;}else{throw new db['Sequelize'][(_0x3aab('0x23'))](_0x3aab('0x24'));}}else{return _0x13c52a;}}function respondWithRpcPromise(_0x2651aa,_0x505c0c,_0xa9b2aa,_0x3f7c02){return new BPromise(function(_0x525463,_0x1a18aa){var _0x155e43=_0x3f7c02||client;return _0x155e43[_0x3aab('0x25')](_0x2651aa,_0xa9b2aa)[_0x3aab('0x26')](function(_0x357935){logger[_0x3aab('0x27')]('MailMessage,\x20%s,\x20%s',_0x505c0c,_0x3aab('0x28'));logger[_0x3aab('0x29')](_0x3aab('0x2a'),_0x505c0c,'request\x20sent',JSON['stringify'](_0x357935));if(_0x357935['error']){if(_0x357935[_0x3aab('0x2b')][_0x3aab('0x2c')]===0x1f4){logger[_0x3aab('0x2b')](_0x3aab('0x2d'),_0x505c0c,_0x357935['error'][_0x3aab('0x2e')]);return _0x1a18aa(_0x357935[_0x3aab('0x2b')][_0x3aab('0x2e')]);}logger['error'](_0x3aab('0x2d'),_0x505c0c,_0x357935[_0x3aab('0x2b')][_0x3aab('0x2e')]);return _0x525463(_0x357935['error']['message']);}else{logger[_0x3aab('0x27')](_0x3aab('0x2d'),_0x505c0c,_0x3aab('0x28'));_0x525463(_0x357935['result']['message']);}})['catch'](function(_0x1553ed){logger[_0x3aab('0x2b')](_0x3aab('0x2d'),_0x505c0c,_0x1553ed);_0x1a18aa(_0x1553ed);});});}function respondWithStatusCode(_0xb93434,_0x2bf4a8){_0x2bf4a8=_0x2bf4a8||0xcc;return function(_0x576817){if(_0x576817){return _0xb93434[_0x3aab('0x2f')](_0x2bf4a8);}return _0xb93434['status'](_0x2bf4a8)[_0x3aab('0x30')]();};}function respondWithResult(_0x2498c8,_0x535037){_0x535037=_0x535037||0xc8;return function(_0x999fc6){if(_0x999fc6){return _0x2498c8['status'](_0x535037)[_0x3aab('0x31')](_0x999fc6);}};}function respondWithFilteredResult(_0x42304d,_0x1c0bd6){return function(_0x423d9a){if(_0x423d9a){var _0x38d3f1=_0x423d9a[_0x3aab('0x32')],_0x2ad524=_0x1c0bd6[_0x3aab('0x33')],_0x30c4ed=_0x1c0bd6[_0x3aab('0x33')]+_0x1c0bd6['limit'],_0xd3cc4c;if(_0x30c4ed>=_0x38d3f1){_0x30c4ed=_0x38d3f1;_0xd3cc4c=0xc8;}else{_0xd3cc4c=0xce;}_0x42304d['status'](_0xd3cc4c);return _0x42304d[_0x3aab('0x34')](_0x3aab('0x35'),_0x2ad524+'-'+_0x30c4ed+'/'+_0x38d3f1)[_0x3aab('0x31')](_0x423d9a);}return null;};}function patchUpdates(_0x183287){return function(_0x4039ce){try{jsonpatch[_0x3aab('0x36')](_0x4039ce,_0x183287,!![]);}catch(_0x43c247){return BPromise[_0x3aab('0x37')](_0x43c247);}return _0x4039ce[_0x3aab('0x38')]();};}function saveUpdates(_0x1d78e0,_0x44e0c4){return function(_0x3e170e){if(_0x3e170e){return _0x3e170e[_0x3aab('0x39')](_0x1d78e0)['then'](function(_0x5e7725){return _0x5e7725;});}return null;};}function removeEntity(_0x4da12e,_0x2bf4b4){return function(_0x5589eb){if(_0x5589eb){return _0x5589eb[_0x3aab('0x3a')]()[_0x3aab('0x26')](function(){_0x4da12e[_0x3aab('0x3b')](0xcc)[_0x3aab('0x30')]();});}};}function handleEntityNotFound(_0x52aab0,_0x33603a){return function(_0x5c4260){if(!_0x5c4260){_0x52aab0[_0x3aab('0x2f')](0x194);}return _0x5c4260;};}function handleError(_0x471cf6,_0x522aa6){_0x522aa6=_0x522aa6||0x1f4;return function(_0xca2b5b){logger[_0x3aab('0x2b')](_0xca2b5b['stack']);if(_0xca2b5b[_0x3aab('0x3c')]){delete _0xca2b5b[_0x3aab('0x3c')];}_0x471cf6['status'](_0x522aa6)[_0x3aab('0x3d')](_0xca2b5b);};}exports[_0x3aab('0x3e')]=function(_0x68cabe,_0x43416c){var _0x6efe98={},_0x11fd68={},_0x37ec25={'count':0x0,'rows':[]};var _0x4bc928=_[_0x3aab('0x3f')](db[_0x3aab('0x40')]['rawAttributes'],function(_0x26dc1e){return{'name':_0x26dc1e['fieldName'],'type':_0x26dc1e[_0x3aab('0x41')][_0x3aab('0x42')]};});_0x11fd68[_0x3aab('0x43')]=_[_0x3aab('0x3f')](_0x4bc928,_0x3aab('0x3c'));_0x11fd68['query']=_[_0x3aab('0x44')](_0x68cabe[_0x3aab('0x45')]);_0x11fd68[_0x3aab('0x46')]=_[_0x3aab('0x47')](_0x11fd68[_0x3aab('0x43')],_0x11fd68[_0x3aab('0x45')]);_0x6efe98[_0x3aab('0x48')]=_[_0x3aab('0x47')](_0x11fd68[_0x3aab('0x43')],qs[_0x3aab('0x49')](_0x68cabe[_0x3aab('0x45')][_0x3aab('0x49')]));_0x6efe98[_0x3aab('0x48')]=_0x6efe98[_0x3aab('0x48')][_0x3aab('0x4a')]?_0x6efe98[_0x3aab('0x48')]:_0x11fd68[_0x3aab('0x43')];if(!_0x68cabe[_0x3aab('0x45')]['hasOwnProperty'](_0x3aab('0x4b'))){_0x6efe98[_0x3aab('0x4c')]=qs['limit'](_0x68cabe[_0x3aab('0x45')]['limit']);_0x6efe98['offset']=qs[_0x3aab('0x33')](_0x68cabe[_0x3aab('0x45')]['offset']);}_0x6efe98[_0x3aab('0x4d')]=qs[_0x3aab('0x4e')](_0x68cabe[_0x3aab('0x45')][_0x3aab('0x4e')]);_0x6efe98[_0x3aab('0x4f')]=qs['filters'](_[_0x3aab('0x50')](_0x68cabe['query'],_0x11fd68['filters']));if(_0x68cabe['query']['filter']){_0x6efe98[_0x3aab('0x4f')]=_[_0x3aab('0x51')](_0x6efe98[_0x3aab('0x4f')],{'$or':_[_0x3aab('0x3f')](_0x4bc928,function(_0x4bac50){if(_0x4bac50['type']!==_0x3aab('0x52')){var _0x38a325={};_0x38a325[_0x4bac50[_0x3aab('0x3c')]]={'$like':'%'+_0x68cabe[_0x3aab('0x45')]['filter']+'%'};return _0x38a325;}})});}_0x6efe98=_['merge']({},_0x6efe98,_0x68cabe['options']);var _0xd72937={'where':_0x6efe98[_0x3aab('0x4f')]};return db[_0x3aab('0x40')][_0x3aab('0x32')](_0xd72937)['then'](function(_0x53f123){_0x37ec25[_0x3aab('0x32')]=_0x53f123;if(_0x68cabe[_0x3aab('0x45')][_0x3aab('0x53')]){_0x6efe98['include']=[{'all':!![]}];}return db[_0x3aab('0x40')][_0x3aab('0x54')](_0x6efe98);})[_0x3aab('0x26')](function(_0xeaea99){_0x37ec25[_0x3aab('0x55')]=_0xeaea99;return _0x37ec25;})['then'](respondWithFilteredResult(_0x43416c,_0x6efe98))[_0x3aab('0x56')](handleError(_0x43416c,null));};exports[_0x3aab('0x57')]=function(_0x392e06,_0x139c19){var _0x439418={'raw':!![],'where':{'id':_0x392e06[_0x3aab('0x58')]['id']}},_0x48c24e={};_0x48c24e[_0x3aab('0x43')]=_['keys'](db[_0x3aab('0x40')][_0x3aab('0x59')]);_0x48c24e[_0x3aab('0x45')]=_[_0x3aab('0x44')](_0x392e06['query']);_0x48c24e[_0x3aab('0x46')]=_['intersection'](_0x48c24e[_0x3aab('0x43')],_0x48c24e['query']);_0x439418[_0x3aab('0x48')]=_[_0x3aab('0x47')](_0x48c24e[_0x3aab('0x43')],qs[_0x3aab('0x49')](_0x392e06['query']['fields']));_0x439418[_0x3aab('0x48')]=_0x439418[_0x3aab('0x48')]['length']?_0x439418[_0x3aab('0x48')]:_0x48c24e[_0x3aab('0x43')];if(_0x392e06['query'][_0x3aab('0x53')]){_0x439418[_0x3aab('0x5a')]=[{'all':!![]}];}_0x439418=_[_0x3aab('0x51')]({},_0x439418,_0x392e06[_0x3aab('0x5b')]);return db[_0x3aab('0x40')]['find'](_0x439418)[_0x3aab('0x26')](handleEntityNotFound(_0x139c19,null))[_0x3aab('0x26')](respondWithResult(_0x139c19,null))[_0x3aab('0x56')](handleError(_0x139c19,null));};exports[_0x3aab('0x39')]=function(_0x23457b,_0x1fef70){if(_0x23457b[_0x3aab('0x5c')]['id']){delete _0x23457b[_0x3aab('0x5c')]['id'];}return db['MailMessage'][_0x3aab('0x5d')]({'where':{'id':_0x23457b[_0x3aab('0x58')]['id']}})[_0x3aab('0x26')](handleEntityNotFound(_0x1fef70,null))[_0x3aab('0x26')](saveUpdates(_0x23457b[_0x3aab('0x5c')],null))[_0x3aab('0x26')](respondWithResult(_0x1fef70,null))[_0x3aab('0x56')](handleError(_0x1fef70,null));};exports[_0x3aab('0x3a')]=function(_0x51f5e6,_0x48cc39){return db[_0x3aab('0x40')][_0x3aab('0x5d')]({'where':{'id':_0x51f5e6[_0x3aab('0x58')]['id']}})[_0x3aab('0x26')](handleEntityNotFound(_0x48cc39,null))[_0x3aab('0x26')](removeEntity(_0x48cc39,null))[_0x3aab('0x56')](handleError(_0x48cc39,null));};exports[_0x3aab('0x5e')]=function(_0x36d58c,_0x5a4129){return db[_0x3aab('0x40')]['describe']()[_0x3aab('0x26')](respondWithResult(_0x5a4129,null))[_0x3aab('0x56')](handleError(_0x5a4129,null));};exports['create']=function(_0x325045,_0x2c7bec){return db[_0x3aab('0x40')][_0x3aab('0x5f')](_0x325045[_0x3aab('0x5c')])[_0x3aab('0x26')](function(_0x5cdb90){if(_0x5cdb90){if(_0x5cdb90[_0x3aab('0x60')]===_0x3aab('0x61')&&!_0x5cdb90['secret']){var _0x3128c3,_0x51511f,_0x3cc60a;if(_0x325045[_0x3aab('0x5c')]['to']){_0x51511f=_0x325045[_0x3aab('0x5c')]['to'][_0x3aab('0x62')](',')[0x0];}return db[_0x3aab('0x63')][_0x3aab('0x64')]({'where':{'id':_0x5cdb90[_0x3aab('0x65')]},'include':[{'model':db[_0x3aab('0x66')],'as':_0x3aab('0x67'),'include':[{'model':db[_0x3aab('0x68')],'as':'Contacts','where':{'email':_0x51511f},'limit':0x1,'order':[[_0x3aab('0x69'),_0x3aab('0x6a')]]}]},{'model':db['MailServerOut'],'as':_0x3aab('0x6b'),'raw':!![]}]})['then'](function(_0x37fea3){_0x3128c3=_0x37fea3;if(_0x3128c3&&_0x3128c3[_0x3aab('0x6b')]){var _0x24ffea={'tls':{'rejectUnauthorized':![]}};if(_[_0x3aab('0x6c')](_0x3128c3[_0x3aab('0x6b')][_0x3aab('0x6d')])){_0x24ffea[_0x3aab('0x6e')]=_0x3128c3[_0x3aab('0x6b')][_0x3aab('0x6e')];_0x24ffea[_0x3aab('0x6f')]=_0x3128c3['Smtp'][_0x3aab('0x6f')];_0x24ffea[_0x3aab('0x70')]=_0x3128c3[_0x3aab('0x6b')][_0x3aab('0x70')];if(_0x3128c3[_0x3aab('0x6b')][_0x3aab('0x71')]){_0x24ffea[_0x3aab('0x72')]={'user':_0x3128c3['Smtp'][_0x3aab('0x73')],'pass':_0x3128c3[_0x3aab('0x6b')][_0x3aab('0x74')]};}}else{_0x24ffea[_0x3aab('0x6d')]=_0x3128c3[_0x3aab('0x6b')][_0x3aab('0x6d')];_0x24ffea[_0x3aab('0x72')]={'user':_0x3128c3[_0x3aab('0x6b')][_0x3aab('0x73')],'pass':_0x3128c3[_0x3aab('0x6b')]['pass']};_0x24ffea[_0x3aab('0x70')]=_0x3128c3[_0x3aab('0x6b')][_0x3aab('0x70')];}if(_0x325045[_0x3aab('0x5c')][_0x3aab('0x75')]&&_0x325045[_0x3aab('0x5c')][_0x3aab('0x75')][_0x3aab('0x4a')]){for(var _0x1b8481=0x0;_0x1b8481<_0x325045[_0x3aab('0x5c')][_0x3aab('0x75')][_0x3aab('0x4a')];_0x1b8481+=0x1){_0x325045[_0x3aab('0x5c')]['attachments'][_0x1b8481]={'filename':_0x325045[_0x3aab('0x5c')][_0x3aab('0x75')][_0x1b8481][_0x3aab('0x3c')],'path':path[_0x3aab('0x76')](config[_0x3aab('0x77')],_0x3aab('0x78'),_0x325045['body'][_0x3aab('0x75')][_0x1b8481]['basename'])};}}_0x3cc60a={'account':_0x24ffea,'message':_0x325045[_0x3aab('0x5c')]};return;}})[_0x3aab('0x26')](function(){if(_0x3128c3[_0x3aab('0x67')]){if(_0x3128c3[_0x3aab('0x67')][_0x3aab('0x79')][_0x3aab('0x4a')]){return _0x3128c3[_0x3aab('0x67')][_0x3aab('0x79')][0x0];}else{return db[_0x3aab('0x68')]['create'](_[_0x3aab('0x1b')](_0x325045['body'],{'firstName':_0x325045[_0x3aab('0x5c')]['to'],'email':_0x325045['body']['to'],'phone':_0x325045['body']['to'],'ListId':_0x3128c3[_0x3aab('0x7a')]}));}}else{throw new Error(_0x3aab('0x7b'));}})[_0x3aab('0x26')](function(){if(_0x3cc60a){return respondWithRpcPromise(_0x3aab('0x7c'),_0x3aab('0x7d'),_0x3cc60a,client9003)['then'](function(_0xde7b72){return _0x5cdb90[_0x3aab('0x39')]({'read':!![],'messageId':_0xde7b72[_0x3aab('0x7e')],'sentAt':moment()[_0x3aab('0x7f')](_0x3aab('0x80'))});})[_0x3aab('0x56')](function(_0x34b7eb){logger[_0x3aab('0x2b')]('%s',JSON[_0x3aab('0x81')](_0x34b7eb));return _0x5cdb90;});}return _0x5cdb90;});}return _0x5cdb90;}})[_0x3aab('0x26')](respondWithResult(_0x2c7bec,0xc9))[_0x3aab('0x56')](handleError(_0x2c7bec,null));};var interaction_log=require('../../config/logger')(_0x3aab('0x82'));exports[_0x3aab('0x83')]=function(_0x21f804,_0x4e770e,_0x14400f){var _0x5ed409={'channel':_0x3aab('0x84')};if(_0x21f804[_0x3aab('0x5c')]['id']){delete _0x21f804[_0x3aab('0x5c')]['id'];}_0x21f804[_0x3aab('0x5c')][_0x3aab('0x85')]=!![];_0x21f804[_0x3aab('0x5c')]['readAt']=moment()['format']('YYYY-MM-DD\x20HH:mm:ss');_0x21f804['body'][_0x3aab('0x86')]=_0x21f804[_0x3aab('0x5c')]['UserId']||_0x21f804[_0x3aab('0x73')]['id'];return db[_0x3aab('0x40')][_0x3aab('0x5d')]({'where':{'id':_0x21f804[_0x3aab('0x58')]['id'],'UserId':null},'include':[{'model':db['CmContact'],'as':_0x3aab('0x87')}]})['then'](handleEntityNotFound(_0x4e770e,null))['then'](saveUpdates(_0x21f804[_0x3aab('0x5c')],null))['then'](function(_0x3fe87f){if(_0x3fe87f){_0x5ed409[_0x3aab('0x2e')]=_0x3fe87f[_0x3aab('0x88')]({'plain':!![]});return db[_0x3aab('0x89')]['find']({'where':{'id':_0x3fe87f[_0x3aab('0x8a')]}});}return null;})['then'](handleEntityNotFound(_0x4e770e,null))[_0x3aab('0x26')](function(_0x1e316b){if(_0x1e316b){return _0x1e316b['update']({'UserId':_0x21f804[_0x3aab('0x5c')]['UserId'],'read1stAt':_[_0x3aab('0x6c')](_0x1e316b[_0x3aab('0x8b')])?moment()['format'](_0x3aab('0x80')):undefined});}return null;})[_0x3aab('0x26')](function(_0x49915a){if(_0x49915a){_0x5ed409[_0x3aab('0x8c')]=_0x49915a[_0x3aab('0x88')]({'plain':!![]});interaction_log[_0x3aab('0x27')]('[MAILMESSAGE:ACCEPT]\x20id=%s\x20name=%s\x20role=%s\x20interaction=%s\x20body=%s',_0x21f804[_0x3aab('0x73')]['id'],_0x21f804[_0x3aab('0x73')][_0x3aab('0x3c')],_0x21f804[_0x3aab('0x73')][_0x3aab('0x8d')],_0x5ed409[_0x3aab('0x8c')]['id'],_0x21f804[_0x3aab('0x5c')]?JSON['stringify'](_0x21f804['body']):'null');return respondWithRpcPromise(_0x3aab('0x8e'),_0x3aab('0x8f'),_0x5ed409);}return null;})['then'](function(_0x1b2b06){if(_0x1b2b06){if(_0x21f804[_0x3aab('0x5c')][_0x3aab('0x90')]){_0x5ed409[_0x3aab('0x2e')][_0x3aab('0x91')]=util[_0x3aab('0x7f')]('SIP/%s',_0x21f804[_0x3aab('0x73')]['name']);_0x5ed409['message'][_0x3aab('0x92')]=_0x5ed409['channel'];_0x5ed409[_0x3aab('0x2e')][_0x3aab('0x93')]=_0x3aab('0x83');return respondWithRpcPromise(_0x3aab('0x94'),_0x3aab('0x94'),{'event':_0x3aab('0x95'),'message':_0x5ed409[_0x3aab('0x2e')]},client9002)[_0x3aab('0x26')](function(){return _0x5ed409;});}return _0x5ed409;}return null;})['then'](respondWithResult(_0x4e770e,null))[_0x3aab('0x56')](handleError(_0x4e770e,null));};var interaction_log=require('../../config/logger')('mail-interactions');exports['reject']=function(_0x5d9c49,_0x482090,_0x4a9ad9){var _0x56dfcc={'agent':{},'channel':_0x3aab('0x84')};if(_0x5d9c49['body']['id']){delete _0x5d9c49[_0x3aab('0x5c')]['id'];}_0x5d9c49[_0x3aab('0x5c')][_0x3aab('0x86')]=_0x5d9c49[_0x3aab('0x5c')]['UserId']||_0x5d9c49['user']['id'];_0x56dfcc[_0x3aab('0x96')]['id']=_0x5d9c49[_0x3aab('0x5c')][_0x3aab('0x86')];return db[_0x3aab('0x40')]['find']({'where':{'id':_0x5d9c49[_0x3aab('0x58')]['id'],'UserId':null}})[_0x3aab('0x26')](handleEntityNotFound(_0x482090,null))[_0x3aab('0x26')](function(_0x335eb3){if(_0x335eb3){_0x56dfcc[_0x3aab('0x2e')]=_0x335eb3['get']({'plain':!![]});return db[_0x3aab('0x89')][_0x3aab('0x5d')]({'where':{'id':_0x335eb3['MailInteractionId']}});}return null;})[_0x3aab('0x26')](handleEntityNotFound(_0x482090,null))[_0x3aab('0x26')](function(_0x2976aa){if(_0x2976aa){_0x56dfcc[_0x3aab('0x8c')]=_0x2976aa[_0x3aab('0x88')]({'plain':!![]});interaction_log[_0x3aab('0x27')](_0x3aab('0x97'),_0x5d9c49['user']['id'],_0x5d9c49[_0x3aab('0x73')][_0x3aab('0x3c')],_0x5d9c49[_0x3aab('0x73')][_0x3aab('0x8d')],_0x56dfcc[_0x3aab('0x8c')]['id'],_0x5d9c49[_0x3aab('0x5c')]?JSON['stringify'](_0x5d9c49[_0x3aab('0x5c')]):_0x3aab('0x98'));return respondWithRpcPromise(_0x3aab('0x99'),_0x3aab('0x9a'),_0x56dfcc);}return null;})[_0x3aab('0x26')](function(_0x230868){if(_0x230868){_0x230868[_0x3aab('0x2e')][_0x3aab('0x91')]=util[_0x3aab('0x7f')](_0x3aab('0x9b'),_0x5d9c49['user'][_0x3aab('0x3c')]);_0x230868[_0x3aab('0x2e')][_0x3aab('0x92')]=_0x56dfcc[_0x3aab('0x92')];_0x230868['message'][_0x3aab('0x93')]=_0x3aab('0x37');respondWithRpcPromise(_0x3aab('0x94'),_0x3aab('0x94'),{'event':_0x3aab('0x9c'),'message':_0x230868['message']},client9002);return _0x56dfcc;}return null;})['then'](respondWithResult(_0x482090,null))[_0x3aab('0x56')](handleError(_0x482090,null));};exports[_0x3aab('0x9d')]=function(_0x3ac5e7,_0x39b37b){var _0x40ed70=moment()[_0x3aab('0x9e')]()[_0x3aab('0x9f')]();var _0x4f8219=path[_0x3aab('0x76')](config[_0x3aab('0x77')],_0x3aab('0xa0'),_0x3aab('0xa1'),_0x3aab('0xa2'));var _0x4cd673=path[_0x3aab('0x76')](config[_0x3aab('0x77')],_0x3aab('0xa0'),'files',_0x3aab('0x75'));var _0x228992=util[_0x3aab('0x7f')](_0x3aab('0xa3'),_0x40ed70);return db[_0x3aab('0x40')][_0x3aab('0x5d')]({'where':{'id':_0x3ac5e7[_0x3aab('0x58')]['id']},'attributes':['id',_0x3aab('0x5c'),'from','to','cc','bcc',_0x3aab('0xa4'),_0x3aab('0xa5')],'include':_0x3ac5e7['query'][_0x3aab('0x75')]?[{'model':db[_0x3aab('0xa6')],'as':'Attachments'}]:undefined})[_0x3aab('0x26')](handleEntityNotFound(_0x39b37b,null))[_0x3aab('0x26')](function(_0x164ee2){if(_0x164ee2){var _0xca6131=_0x164ee2;var _0x24916c={'from':_0xca6131[_0x3aab('0xa7')],'to':_0xca6131['to'],'subject':_0xca6131[_0x3aab('0xa4')],'html':_0xca6131['body'],'headers':{'Date':moment(_0xca6131[_0x3aab('0xa5')])[_0x3aab('0x7f')](_0x3aab('0xa8'))},'attachments':[]};if(_0x164ee2['cc']){_0x24916c['headers']['Cc']=_0x164ee2['cc'];}if(_0x164ee2[_0x3aab('0xa9')]){_0x24916c['headers'][_0x3aab('0xaa')]=_0x164ee2['bcc'];}return new BPromise(function(_0x47d77b,_0x4e82a2){if(_0x164ee2[_0x3aab('0xab')]){for(var _0x58958f=0x0;_0x58958f<_0x164ee2[_0x3aab('0xab')]['length'];_0x58958f++){var _0x3549ab=_0x164ee2[_0x3aab('0xab')][_0x58958f];var _0xddc003=path['join'](_0x4cd673,_0x3549ab[_0x3aab('0xac')]);if(fs[_0x3aab('0xad')](_0xddc003)){_0x24916c[_0x3aab('0x75')]['push']({'name':_0x3549ab[_0x3aab('0x3c')],'contentType':_0x3549ab[_0x3aab('0x41')],'data':fs['readFileSync'](_0xddc003)});}}}emlformat[_0x3aab('0xae')](_0x24916c,function(_0x20222e,_0x53b5f9){if(_0x20222e)return _0x4e82a2(_0x20222e);fs[_0x3aab('0xaf')](path[_0x3aab('0x76')](_0x4f8219,_0x228992),_0x53b5f9);return _0x47d77b(_0x53b5f9);});});}})['then'](function(_0x576c77){if(_0x576c77){return _0x39b37b[_0x3aab('0x9d')](path[_0x3aab('0x76')](_0x4f8219,_0x228992),_0x228992,function(_0x31c1e8){if(_0x31c1e8){console['log'](_0x3aab('0xb0'),_0x31c1e8);}else{fs['unlinkSync'](path['join'](_0x4f8219,_0x228992));}});}})[_0x3aab('0x56')](handleError(_0x39b37b,null));};
\ No newline at end of file
+var _0xc41f=['fieldName','type','model','query','keys','intersection','fields','attributes','length','nolimit','sort','where','filters','pick','filter','merge','VIRTUAL','options','includeAll','rows','show','include','find','body','params','describe','create','direction','secret','MailAccountId','CmList','List','CmContact','Contacts','DESC','Smtp','isNil','service','host','port','secure','authentication','auth','pass','user','attachments','join','root','server/files/attachments','basename','ListId','SendMail','messageId','mail-interactions','accept','mail','read','readAt','format','YYYY-MM-DD\x20HH:mm:ss','UserId','Contact','get','MailInteraction','read1stAt','interaction','[MAILMESSAGE:ACCEPT]\x20id=%s\x20name=%s\x20role=%s\x20interaction=%s\x20body=%s','role','stringify','null','AcceptMessage','acceptMessage','interface','SIP/%s','channel','EventManager','acceptmessage','reject','agent','MailInteractionId','rejectMessage','event','rejectmessage','download','toString','server','files','tmp','from','bcc','subject','createdAt','Attachment','Attachments','ddd,\x20DD\x20MMM\x20YYYY\x20HH:mm:ss\x20ZZ','headers','Bcc','push','readFileSync','build','writeFileSync','log','err','rimraf','request-promise','bluebird','mustache','util','sox','ejs','lodash','crypto','jsforce','desk.js','to-csv','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/environment','../../mysqldb','redis','defaults','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','MailMessage,\x20%s,\x20%s','request\x20sent','debug','code','error','message','catch','sendStatus','status','end','json','count','offset','limit','set','Content-Range','apply','save','update','destroy','stack','name','send','index','map','MailMessage','rawAttributes'];(function(_0x29c261,_0x3af39a){var _0x1a9335=function(_0x40d1e8){while(--_0x40d1e8){_0x29c261['push'](_0x29c261['shift']());}};_0x1a9335(++_0x3af39a);}(_0xc41f,0x10b));var _0xfc41=function(_0x284807,_0x4be925){_0x284807=_0x284807-0x0;var _0x50c774=_0xc41f[_0x284807];return _0x50c774;};'use strict';var pdf=require('html-pdf');var emlformat=require('eml-format');var rimraf=require(_0xfc41('0x0'));var zipdir=require('zip-dir');var jsonpatch=require('fast-json-patch');var rp=require(_0xfc41('0x1'));var moment=require('moment');var BPromise=require(_0xfc41('0x2'));var Mustache=require(_0xfc41('0x3'));var util=require(_0xfc41('0x4'));var path=require('path');var sox=require(_0xfc41('0x5'));var csv=require('to-csv');var ejs=require(_0xfc41('0x6'));var fs=require('fs');var _=require(_0xfc41('0x7'));var squel=require('squel');var crypto=require(_0xfc41('0x8'));var jsforce=require(_0xfc41('0x9'));var deskjs=require(_0xfc41('0xa'));var toCsv=require(_0xfc41('0xb'));var querystring=require(_0xfc41('0xc'));var Papa=require(_0xfc41('0xd'));var Redis=require(_0xfc41('0xe'));var authService=require(_0xfc41('0xf'));var qs=require(_0xfc41('0x10'));var as=require(_0xfc41('0x11'));var hardwareService=require(_0xfc41('0x12'));var logger=require(_0xfc41('0x13'))(_0xfc41('0x14'));var utils=require(_0xfc41('0x15'));var config=require(_0xfc41('0x16'));var db=require(_0xfc41('0x17'))['db'];config[_0xfc41('0x18')]=_[_0xfc41('0x19')](config[_0xfc41('0x18')],{'host':'localhost','port':0x18eb});var socket=require('socket.io-emitter')(new Redis(config['redis']));require('./mailMessage.socket')['register'](socket);var jayson=require(_0xfc41('0x1a'));var client=jayson[_0xfc41('0x1b')][_0xfc41('0x1c')]({'port':0x232c});var client9003=jayson[_0xfc41('0x1b')][_0xfc41('0x1c')]({'port':0x232b});var client9002=jayson['client'][_0xfc41('0x1c')]({'port':0x232a});function checkPasswordPattern(_0x35d565,_0x447938,_0x5b78a1){if(_0x5b78a1){var _0x20a26a=new RegExp(/(?=.*[a-z])(?=.*[A-Z])(?=.*[0-9])(?=.*[?!@#\$%\^&\*~\-_=+[{\]\}])(?=.{8,})/);if(_0x20a26a[_0xfc41('0x1d')](_0x447938)){return _0x35d565;}else{throw new db['Sequelize'][(_0xfc41('0x1e'))](_0xfc41('0x1f'));}}else{return _0x35d565;}}function respondWithRpcPromise(_0x334682,_0x111043,_0x721b34,_0x5b8b50){return new BPromise(function(_0x436270,_0x5936f4){var _0x308ed9=_0x5b8b50||client;return _0x308ed9['request'](_0x334682,_0x721b34)[_0xfc41('0x20')](function(_0x2d76e1){logger[_0xfc41('0x21')](_0xfc41('0x22'),_0x111043,_0xfc41('0x23'));logger[_0xfc41('0x24')]('MailMessage,\x20%s,\x20%s,\x20%s',_0x111043,_0xfc41('0x23'),JSON['stringify'](_0x2d76e1));if(_0x2d76e1['error']){if(_0x2d76e1['error'][_0xfc41('0x25')]===0x1f4){logger[_0xfc41('0x26')](_0xfc41('0x22'),_0x111043,_0x2d76e1[_0xfc41('0x26')][_0xfc41('0x27')]);return _0x5936f4(_0x2d76e1[_0xfc41('0x26')][_0xfc41('0x27')]);}logger['error'](_0xfc41('0x22'),_0x111043,_0x2d76e1[_0xfc41('0x26')]['message']);return _0x436270(_0x2d76e1[_0xfc41('0x26')][_0xfc41('0x27')]);}else{logger[_0xfc41('0x21')](_0xfc41('0x22'),_0x111043,'request\x20sent');_0x436270(_0x2d76e1['result'][_0xfc41('0x27')]);}})[_0xfc41('0x28')](function(_0x3341fc){logger[_0xfc41('0x26')]('MailMessage,\x20%s,\x20%s',_0x111043,_0x3341fc);_0x5936f4(_0x3341fc);});});}function respondWithStatusCode(_0x22507f,_0x152520){_0x152520=_0x152520||0xcc;return function(_0x445d8f){if(_0x445d8f){return _0x22507f[_0xfc41('0x29')](_0x152520);}return _0x22507f[_0xfc41('0x2a')](_0x152520)[_0xfc41('0x2b')]();};}function respondWithResult(_0x18259c,_0x3b1437){_0x3b1437=_0x3b1437||0xc8;return function(_0x55e937){if(_0x55e937){return _0x18259c[_0xfc41('0x2a')](_0x3b1437)[_0xfc41('0x2c')](_0x55e937);}};}function respondWithFilteredResult(_0x3ce364,_0x52e514){return function(_0x461578){if(_0x461578){var _0x10bda5=_0x461578[_0xfc41('0x2d')],_0x11bea3=_0x52e514[_0xfc41('0x2e')],_0xc6bda2=_0x52e514[_0xfc41('0x2e')]+_0x52e514[_0xfc41('0x2f')],_0x4f09ac;if(_0xc6bda2>=_0x10bda5){_0xc6bda2=_0x10bda5;_0x4f09ac=0xc8;}else{_0x4f09ac=0xce;}_0x3ce364['status'](_0x4f09ac);return _0x3ce364[_0xfc41('0x30')](_0xfc41('0x31'),_0x11bea3+'-'+_0xc6bda2+'/'+_0x10bda5)['json'](_0x461578);}return null;};}function patchUpdates(_0x46ee28){return function(_0x43dbcc){try{jsonpatch[_0xfc41('0x32')](_0x43dbcc,_0x46ee28,!![]);}catch(_0x42179f){return BPromise['reject'](_0x42179f);}return _0x43dbcc[_0xfc41('0x33')]();};}function saveUpdates(_0x58eb8f,_0x193083){return function(_0x14ee04){if(_0x14ee04){return _0x14ee04[_0xfc41('0x34')](_0x58eb8f)[_0xfc41('0x20')](function(_0x3ff3af){return _0x3ff3af;});}return null;};}function removeEntity(_0x6faa0,_0x7b4c45){return function(_0x3b33df){if(_0x3b33df){return _0x3b33df[_0xfc41('0x35')]()[_0xfc41('0x20')](function(){_0x6faa0[_0xfc41('0x2a')](0xcc)[_0xfc41('0x2b')]();});}};}function handleEntityNotFound(_0x5d6483,_0x17104f){return function(_0x1b01fa){if(!_0x1b01fa){_0x5d6483[_0xfc41('0x29')](0x194);}return _0x1b01fa;};}function handleError(_0x5d9352,_0x22b293){_0x22b293=_0x22b293||0x1f4;return function(_0x134d48){logger[_0xfc41('0x26')](_0x134d48[_0xfc41('0x36')]);if(_0x134d48['name']){delete _0x134d48[_0xfc41('0x37')];}_0x5d9352[_0xfc41('0x2a')](_0x22b293)[_0xfc41('0x38')](_0x134d48);};}exports[_0xfc41('0x39')]=function(_0x47ca36,_0x7fc3c8){var _0x372f07={},_0x3e4aab={},_0x511c82={'count':0x0,'rows':[]};var _0x493711=_[_0xfc41('0x3a')](db[_0xfc41('0x3b')][_0xfc41('0x3c')],function(_0x25b7e1){return{'name':_0x25b7e1[_0xfc41('0x3d')],'type':_0x25b7e1[_0xfc41('0x3e')]['key']};});_0x3e4aab[_0xfc41('0x3f')]=_[_0xfc41('0x3a')](_0x493711,_0xfc41('0x37'));_0x3e4aab[_0xfc41('0x40')]=_[_0xfc41('0x41')](_0x47ca36['query']);_0x3e4aab['filters']=_['intersection'](_0x3e4aab['model'],_0x3e4aab[_0xfc41('0x40')]);_0x372f07['attributes']=_[_0xfc41('0x42')](_0x3e4aab[_0xfc41('0x3f')],qs[_0xfc41('0x43')](_0x47ca36[_0xfc41('0x40')][_0xfc41('0x43')]));_0x372f07[_0xfc41('0x44')]=_0x372f07[_0xfc41('0x44')][_0xfc41('0x45')]?_0x372f07[_0xfc41('0x44')]:_0x3e4aab[_0xfc41('0x3f')];if(!_0x47ca36[_0xfc41('0x40')]['hasOwnProperty'](_0xfc41('0x46'))){_0x372f07[_0xfc41('0x2f')]=qs[_0xfc41('0x2f')](_0x47ca36[_0xfc41('0x40')][_0xfc41('0x2f')]);_0x372f07['offset']=qs[_0xfc41('0x2e')](_0x47ca36[_0xfc41('0x40')]['offset']);}_0x372f07['order']=qs[_0xfc41('0x47')](_0x47ca36[_0xfc41('0x40')][_0xfc41('0x47')]);_0x372f07[_0xfc41('0x48')]=qs[_0xfc41('0x49')](_[_0xfc41('0x4a')](_0x47ca36['query'],_0x3e4aab[_0xfc41('0x49')]));if(_0x47ca36[_0xfc41('0x40')][_0xfc41('0x4b')]){_0x372f07[_0xfc41('0x48')]=_[_0xfc41('0x4c')](_0x372f07['where'],{'$or':_['map'](_0x493711,function(_0x5a73f9){if(_0x5a73f9[_0xfc41('0x3e')]!==_0xfc41('0x4d')){var _0x15639c={};_0x15639c[_0x5a73f9[_0xfc41('0x37')]]={'$like':'%'+_0x47ca36[_0xfc41('0x40')]['filter']+'%'};return _0x15639c;}})});}_0x372f07=_[_0xfc41('0x4c')]({},_0x372f07,_0x47ca36[_0xfc41('0x4e')]);var _0x4052ef={'where':_0x372f07['where']};return db['MailMessage'][_0xfc41('0x2d')](_0x4052ef)[_0xfc41('0x20')](function(_0x54e2cd){_0x511c82[_0xfc41('0x2d')]=_0x54e2cd;if(_0x47ca36[_0xfc41('0x40')][_0xfc41('0x4f')]){_0x372f07['include']=[{'all':!![]}];}return db[_0xfc41('0x3b')]['findAll'](_0x372f07);})[_0xfc41('0x20')](function(_0x2b6c6e){_0x511c82[_0xfc41('0x50')]=_0x2b6c6e;return _0x511c82;})['then'](respondWithFilteredResult(_0x7fc3c8,_0x372f07))[_0xfc41('0x28')](handleError(_0x7fc3c8,null));};exports[_0xfc41('0x51')]=function(_0x1ba0b0,_0x3cb9e3){var _0x2e29b7={'raw':!![],'where':{'id':_0x1ba0b0['params']['id']}},_0x5118db={};_0x5118db[_0xfc41('0x3f')]=_[_0xfc41('0x41')](db[_0xfc41('0x3b')]['rawAttributes']);_0x5118db['query']=_[_0xfc41('0x41')](_0x1ba0b0['query']);_0x5118db[_0xfc41('0x49')]=_[_0xfc41('0x42')](_0x5118db[_0xfc41('0x3f')],_0x5118db['query']);_0x2e29b7['attributes']=_[_0xfc41('0x42')](_0x5118db['model'],qs[_0xfc41('0x43')](_0x1ba0b0[_0xfc41('0x40')][_0xfc41('0x43')]));_0x2e29b7[_0xfc41('0x44')]=_0x2e29b7[_0xfc41('0x44')][_0xfc41('0x45')]?_0x2e29b7[_0xfc41('0x44')]:_0x5118db[_0xfc41('0x3f')];if(_0x1ba0b0['query'][_0xfc41('0x4f')]){_0x2e29b7[_0xfc41('0x52')]=[{'all':!![]}];}_0x2e29b7=_['merge']({},_0x2e29b7,_0x1ba0b0[_0xfc41('0x4e')]);return db[_0xfc41('0x3b')][_0xfc41('0x53')](_0x2e29b7)['then'](handleEntityNotFound(_0x3cb9e3,null))[_0xfc41('0x20')](respondWithResult(_0x3cb9e3,null))[_0xfc41('0x28')](handleError(_0x3cb9e3,null));};exports[_0xfc41('0x34')]=function(_0xc19651,_0x43b101){if(_0xc19651[_0xfc41('0x54')]['id']){delete _0xc19651['body']['id'];}return db['MailMessage']['find']({'where':{'id':_0xc19651[_0xfc41('0x55')]['id']}})[_0xfc41('0x20')](handleEntityNotFound(_0x43b101,null))[_0xfc41('0x20')](saveUpdates(_0xc19651['body'],null))[_0xfc41('0x20')](respondWithResult(_0x43b101,null))[_0xfc41('0x28')](handleError(_0x43b101,null));};exports['destroy']=function(_0x2cc99d,_0x307d30){return db[_0xfc41('0x3b')][_0xfc41('0x53')]({'where':{'id':_0x2cc99d[_0xfc41('0x55')]['id']}})[_0xfc41('0x20')](handleEntityNotFound(_0x307d30,null))[_0xfc41('0x20')](removeEntity(_0x307d30,null))[_0xfc41('0x28')](handleError(_0x307d30,null));};exports[_0xfc41('0x56')]=function(_0x3962b9,_0x58ed4f){return db['MailMessage'][_0xfc41('0x56')]()[_0xfc41('0x20')](respondWithResult(_0x58ed4f,null))[_0xfc41('0x28')](handleError(_0x58ed4f,null));};exports['create']=function(_0x6ac0e1,_0x4c6cf1){return db[_0xfc41('0x3b')][_0xfc41('0x57')](_0x6ac0e1[_0xfc41('0x54')])['then'](function(_0x5686a1){if(_0x5686a1){if(_0x5686a1[_0xfc41('0x58')]==='out'&&!_0x5686a1[_0xfc41('0x59')]){var _0x3299fc,_0x22495f,_0x52cc70;if(_0x6ac0e1['body']['to']){_0x22495f=_0x6ac0e1['body']['to']['split'](',')[0x0];}return db['MailAccount']['findOne']({'where':{'id':_0x5686a1[_0xfc41('0x5a')]},'include':[{'model':db[_0xfc41('0x5b')],'as':_0xfc41('0x5c'),'include':[{'model':db[_0xfc41('0x5d')],'as':_0xfc41('0x5e'),'where':{'email':_0x22495f},'limit':0x1,'order':[['updatedAt',_0xfc41('0x5f')]]}]},{'model':db['MailServerOut'],'as':_0xfc41('0x60'),'raw':!![]}]})[_0xfc41('0x20')](function(_0x5a1e46){_0x3299fc=_0x5a1e46;if(_0x3299fc&&_0x3299fc[_0xfc41('0x60')]){var _0xd8565b={'tls':{'rejectUnauthorized':![]}};if(_[_0xfc41('0x61')](_0x3299fc[_0xfc41('0x60')][_0xfc41('0x62')])){_0xd8565b[_0xfc41('0x63')]=_0x3299fc[_0xfc41('0x60')][_0xfc41('0x63')];_0xd8565b[_0xfc41('0x64')]=_0x3299fc[_0xfc41('0x60')][_0xfc41('0x64')];_0xd8565b[_0xfc41('0x65')]=_0x3299fc[_0xfc41('0x60')]['secure'];if(_0x3299fc['Smtp'][_0xfc41('0x66')]){_0xd8565b[_0xfc41('0x67')]={'user':_0x3299fc[_0xfc41('0x60')]['user'],'pass':_0x3299fc['Smtp'][_0xfc41('0x68')]};}}else{_0xd8565b[_0xfc41('0x62')]=_0x3299fc['Smtp'][_0xfc41('0x62')];_0xd8565b[_0xfc41('0x67')]={'user':_0x3299fc[_0xfc41('0x60')][_0xfc41('0x69')],'pass':_0x3299fc[_0xfc41('0x60')][_0xfc41('0x68')]};_0xd8565b[_0xfc41('0x65')]=_0x3299fc['Smtp'][_0xfc41('0x65')];}if(_0x6ac0e1[_0xfc41('0x54')]['attachments']&&_0x6ac0e1['body'][_0xfc41('0x6a')][_0xfc41('0x45')]){for(var _0x35c8c6=0x0;_0x35c8c6<_0x6ac0e1[_0xfc41('0x54')]['attachments'][_0xfc41('0x45')];_0x35c8c6+=0x1){_0x6ac0e1[_0xfc41('0x54')][_0xfc41('0x6a')][_0x35c8c6]={'filename':_0x6ac0e1[_0xfc41('0x54')][_0xfc41('0x6a')][_0x35c8c6][_0xfc41('0x37')],'path':path[_0xfc41('0x6b')](config[_0xfc41('0x6c')],_0xfc41('0x6d'),_0x6ac0e1[_0xfc41('0x54')][_0xfc41('0x6a')][_0x35c8c6][_0xfc41('0x6e')])};}}_0x52cc70={'account':_0xd8565b,'message':_0x6ac0e1[_0xfc41('0x54')]};return;}})[_0xfc41('0x20')](function(){if(_0x3299fc[_0xfc41('0x5c')]){if(_0x3299fc[_0xfc41('0x5c')][_0xfc41('0x5e')][_0xfc41('0x45')]){return _0x3299fc['List'][_0xfc41('0x5e')][0x0];}else{return db['CmContact'][_0xfc41('0x57')](_[_0xfc41('0x19')](_0x6ac0e1[_0xfc41('0x54')],{'firstName':_0x6ac0e1[_0xfc41('0x54')]['to'],'email':_0x6ac0e1[_0xfc41('0x54')]['to'],'phone':_0x6ac0e1['body']['to'],'ListId':_0x3299fc[_0xfc41('0x6f')]}));}}else{throw new Error('List\x20not\x20found');}})[_0xfc41('0x20')](function(){if(_0x52cc70){return respondWithRpcPromise(_0xfc41('0x70'),'sendMail',_0x52cc70,client9003)[_0xfc41('0x20')](function(_0x1f0830){return _0x5686a1[_0xfc41('0x34')]({'read':!![],'messageId':_0x1f0830[_0xfc41('0x71')],'sentAt':moment()['format']('YYYY-MM-DD\x20HH:mm:ss')});})[_0xfc41('0x28')](function(_0x4066a9){logger[_0xfc41('0x26')]('%s',JSON['stringify'](_0x4066a9));return _0x5686a1;});}return _0x5686a1;});}return _0x5686a1;}})[_0xfc41('0x20')](respondWithResult(_0x4c6cf1,0xc9))['catch'](handleError(_0x4c6cf1,null));};var interaction_log=require(_0xfc41('0x13'))(_0xfc41('0x72'));exports[_0xfc41('0x73')]=function(_0x1d3ebb,_0x3bb906,_0x21e01f){var _0x78f3d0={'channel':_0xfc41('0x74')};if(_0x1d3ebb[_0xfc41('0x54')]['id']){delete _0x1d3ebb[_0xfc41('0x54')]['id'];}_0x1d3ebb['body'][_0xfc41('0x75')]=!![];_0x1d3ebb[_0xfc41('0x54')][_0xfc41('0x76')]=moment()[_0xfc41('0x77')](_0xfc41('0x78'));_0x1d3ebb[_0xfc41('0x54')][_0xfc41('0x79')]=_0x1d3ebb[_0xfc41('0x54')][_0xfc41('0x79')]||_0x1d3ebb[_0xfc41('0x69')]['id'];return db[_0xfc41('0x3b')][_0xfc41('0x53')]({'where':{'id':_0x1d3ebb[_0xfc41('0x55')]['id'],'UserId':null},'include':[{'model':db[_0xfc41('0x5d')],'as':_0xfc41('0x7a')}]})[_0xfc41('0x20')](handleEntityNotFound(_0x3bb906,null))[_0xfc41('0x20')](saveUpdates(_0x1d3ebb['body'],null))[_0xfc41('0x20')](function(_0x4ddbd5){if(_0x4ddbd5){_0x78f3d0['message']=_0x4ddbd5[_0xfc41('0x7b')]({'plain':!![]});return db[_0xfc41('0x7c')][_0xfc41('0x53')]({'where':{'id':_0x4ddbd5['MailInteractionId']}});}return null;})[_0xfc41('0x20')](handleEntityNotFound(_0x3bb906,null))[_0xfc41('0x20')](function(_0x479776){if(_0x479776){return _0x479776[_0xfc41('0x34')]({'UserId':_0x1d3ebb['body'][_0xfc41('0x79')],'read1stAt':_['isNil'](_0x479776[_0xfc41('0x7d')])?moment()[_0xfc41('0x77')](_0xfc41('0x78')):undefined});}return null;})['then'](function(_0x26408c){if(_0x26408c){_0x78f3d0[_0xfc41('0x7e')]=_0x26408c[_0xfc41('0x7b')]({'plain':!![]});interaction_log['info'](_0xfc41('0x7f'),_0x1d3ebb[_0xfc41('0x69')]['id'],_0x1d3ebb[_0xfc41('0x69')][_0xfc41('0x37')],_0x1d3ebb[_0xfc41('0x69')][_0xfc41('0x80')],_0x78f3d0[_0xfc41('0x7e')]['id'],_0x1d3ebb[_0xfc41('0x54')]?JSON[_0xfc41('0x81')](_0x1d3ebb[_0xfc41('0x54')]):_0xfc41('0x82'));return respondWithRpcPromise(_0xfc41('0x83'),_0xfc41('0x84'),_0x78f3d0);}return null;})[_0xfc41('0x20')](function(_0x44a274){if(_0x44a274){if(_0x1d3ebb[_0xfc41('0x54')]['manual']){_0x78f3d0[_0xfc41('0x27')][_0xfc41('0x85')]=util[_0xfc41('0x77')](_0xfc41('0x86'),_0x1d3ebb[_0xfc41('0x69')][_0xfc41('0x37')]);_0x78f3d0[_0xfc41('0x27')][_0xfc41('0x87')]=_0x78f3d0[_0xfc41('0x87')];_0x78f3d0[_0xfc41('0x27')]['event']=_0xfc41('0x73');return respondWithRpcPromise(_0xfc41('0x88'),_0xfc41('0x88'),{'event':_0xfc41('0x89'),'message':_0x78f3d0[_0xfc41('0x27')]},client9002)[_0xfc41('0x20')](function(){return _0x78f3d0;});}return _0x78f3d0;}return null;})['then'](respondWithResult(_0x3bb906,null))[_0xfc41('0x28')](handleError(_0x3bb906,null));};var interaction_log=require('../../config/logger')('mail-interactions');exports[_0xfc41('0x8a')]=function(_0x339f9b,_0x140964,_0x3bd4de){var _0x1c8868={'agent':{},'channel':'mail'};if(_0x339f9b['body']['id']){delete _0x339f9b[_0xfc41('0x54')]['id'];}_0x339f9b[_0xfc41('0x54')][_0xfc41('0x79')]=_0x339f9b[_0xfc41('0x54')][_0xfc41('0x79')]||_0x339f9b['user']['id'];_0x1c8868[_0xfc41('0x8b')]['id']=_0x339f9b[_0xfc41('0x54')][_0xfc41('0x79')];return db[_0xfc41('0x3b')][_0xfc41('0x53')]({'where':{'id':_0x339f9b['params']['id'],'UserId':null}})[_0xfc41('0x20')](handleEntityNotFound(_0x140964,null))['then'](function(_0x4bbe3e){if(_0x4bbe3e){_0x1c8868['message']=_0x4bbe3e[_0xfc41('0x7b')]({'plain':!![]});return db[_0xfc41('0x7c')][_0xfc41('0x53')]({'where':{'id':_0x4bbe3e[_0xfc41('0x8c')]}});}return null;})['then'](handleEntityNotFound(_0x140964,null))[_0xfc41('0x20')](function(_0x1d6680){if(_0x1d6680){_0x1c8868[_0xfc41('0x7e')]=_0x1d6680[_0xfc41('0x7b')]({'plain':!![]});interaction_log[_0xfc41('0x21')]('[MAILMESSAGE:REJECT]\x20id=%s\x20name=%s\x20role=%s\x20interaction=%s\x20body=%s',_0x339f9b[_0xfc41('0x69')]['id'],_0x339f9b['user'][_0xfc41('0x37')],_0x339f9b[_0xfc41('0x69')][_0xfc41('0x80')],_0x1c8868[_0xfc41('0x7e')]['id'],_0x339f9b[_0xfc41('0x54')]?JSON[_0xfc41('0x81')](_0x339f9b[_0xfc41('0x54')]):'null');return respondWithRpcPromise('RejectMessage',_0xfc41('0x8d'),_0x1c8868);}return null;})[_0xfc41('0x20')](function(_0x2e2c64){if(_0x2e2c64){_0x2e2c64[_0xfc41('0x27')][_0xfc41('0x85')]=util['format']('SIP/%s',_0x339f9b[_0xfc41('0x69')][_0xfc41('0x37')]);_0x2e2c64['message'][_0xfc41('0x87')]=_0x1c8868[_0xfc41('0x87')];_0x2e2c64['message'][_0xfc41('0x8e')]=_0xfc41('0x8a');respondWithRpcPromise(_0xfc41('0x88'),_0xfc41('0x88'),{'event':_0xfc41('0x8f'),'message':_0x2e2c64[_0xfc41('0x27')]},client9002);return _0x1c8868;}return null;})['then'](respondWithResult(_0x140964,null))['catch'](handleError(_0x140964,null));};exports[_0xfc41('0x90')]=function(_0x3799e2,_0x4d0e5c){var _0x78facb=moment()['unix']()[_0xfc41('0x91')]();var _0x28ccd8=path['join'](config[_0xfc41('0x6c')],_0xfc41('0x92'),_0xfc41('0x93'),_0xfc41('0x94'));var _0x60772b=path[_0xfc41('0x6b')](config[_0xfc41('0x6c')],_0xfc41('0x92'),_0xfc41('0x93'),'attachments');var _0x4ccb72=util['format']('message-%s.eml',_0x78facb);return db['MailMessage'][_0xfc41('0x53')]({'where':{'id':_0x3799e2[_0xfc41('0x55')]['id']},'attributes':['id',_0xfc41('0x54'),_0xfc41('0x95'),'to','cc',_0xfc41('0x96'),_0xfc41('0x97'),_0xfc41('0x98')],'include':_0x3799e2['query']['attachments']?[{'model':db[_0xfc41('0x99')],'as':_0xfc41('0x9a')}]:undefined})[_0xfc41('0x20')](handleEntityNotFound(_0x4d0e5c,null))[_0xfc41('0x20')](function(_0x39f9da){if(_0x39f9da){var _0x437149=_0x39f9da;var _0xa0ad90={'from':_0x437149[_0xfc41('0x95')],'to':_0x437149['to'],'subject':_0x437149[_0xfc41('0x97')],'html':_0x437149[_0xfc41('0x54')],'headers':{'Date':moment(_0x437149[_0xfc41('0x98')])[_0xfc41('0x77')](_0xfc41('0x9b'))},'attachments':[]};if(_0x39f9da['cc']){_0xa0ad90[_0xfc41('0x9c')]['Cc']=_0x39f9da['cc'];}if(_0x39f9da[_0xfc41('0x96')]){_0xa0ad90[_0xfc41('0x9c')][_0xfc41('0x9d')]=_0x39f9da[_0xfc41('0x96')];}return new BPromise(function(_0x26cf3f,_0x21d29d){if(_0x39f9da[_0xfc41('0x9a')]){for(var _0x479210=0x0;_0x479210<_0x39f9da['Attachments'][_0xfc41('0x45')];_0x479210++){var _0x5c8888=_0x39f9da[_0xfc41('0x9a')][_0x479210];var _0x599c08=path[_0xfc41('0x6b')](_0x60772b,_0x5c8888[_0xfc41('0x6e')]);if(fs['existsSync'](_0x599c08)){_0xa0ad90['attachments'][_0xfc41('0x9e')]({'name':_0x5c8888[_0xfc41('0x37')],'contentType':_0x5c8888[_0xfc41('0x3e')],'data':fs[_0xfc41('0x9f')](_0x599c08)});}}}emlformat[_0xfc41('0xa0')](_0xa0ad90,function(_0x206e8b,_0x18b54f){if(_0x206e8b)return _0x21d29d(_0x206e8b);fs[_0xfc41('0xa1')](path['join'](_0x28ccd8,_0x4ccb72),_0x18b54f);return _0x26cf3f(_0x18b54f);});});}})[_0xfc41('0x20')](function(_0x726bb7){if(_0x726bb7){return _0x4d0e5c[_0xfc41('0x90')](path[_0xfc41('0x6b')](_0x28ccd8,_0x4ccb72),_0x4ccb72,function(_0x1f170f){if(_0x1f170f){console[_0xfc41('0xa2')](_0xfc41('0xa3'),_0x1f170f);}else{fs['unlinkSync'](path['join'](_0x28ccd8,_0x4ccb72));}});}})[_0xfc41('0x28')](handleError(_0x4d0e5c,null));};
\ No newline at end of file
diff --git a/server/api/mailMessage/mailMessage.events.js b/server/api/mailMessage/mailMessage.events.js
index 9c4901e..3ec249e 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 _0xa5eb=['save','update','emit','hook','exports','../../mysqldb','MailMessage'];(function(_0x5c4f6b,_0x2cdfce){var _0x104c4e=function(_0x31171b){while(--_0x31171b){_0x5c4f6b['push'](_0x5c4f6b['shift']());}};_0x104c4e(++_0x2cdfce);}(_0xa5eb,0x15c));var _0xba5e=function(_0x4efb43,_0x34ee30){_0x4efb43=_0x4efb43-0x0;var _0x5e6b14=_0xa5eb[_0x4efb43];return _0x5e6b14;};'use strict';var EventEmitter=require('events');var MailMessage=require(_0xba5e('0x0'))['db'][_0xba5e('0x1')];var MailMessageEvents=new EventEmitter();MailMessageEvents['setMaxListeners'](0x0);var events={'afterCreate':_0xba5e('0x2'),'afterUpdate':_0xba5e('0x3'),'afterDestroy':'remove'};function emitEvent(_0x2dbd6a){return function(_0x30d22,_0x2884d0,_0x5c8167){MailMessageEvents[_0xba5e('0x4')](_0x2dbd6a+':'+_0x30d22['id'],_0x30d22);MailMessageEvents[_0xba5e('0x4')](_0x2dbd6a,_0x30d22);_0x5c8167(null);};}for(var e in events){if(events['hasOwnProperty'](e)){var event=events[e];MailMessage[_0xba5e('0x5')](e,emitEvent(event));}}module[_0xba5e('0x6')]=MailMessageEvents;
\ No newline at end of file
+var _0x86f1=['events','../../mysqldb','MailMessage','setMaxListeners','save','update','remove','hasOwnProperty','hook'];(function(_0x40c577,_0x2225f0){var _0x2adcd=function(_0x5a00a8){while(--_0x5a00a8){_0x40c577['push'](_0x40c577['shift']());}};_0x2adcd(++_0x2225f0);}(_0x86f1,0x156));var _0x186f=function(_0x594e8b,_0xe86cf8){_0x594e8b=_0x594e8b-0x0;var _0x43f9e4=_0x86f1[_0x594e8b];return _0x43f9e4;};'use strict';var EventEmitter=require(_0x186f('0x0'));var MailMessage=require(_0x186f('0x1'))['db'][_0x186f('0x2')];var MailMessageEvents=new EventEmitter();MailMessageEvents[_0x186f('0x3')](0x0);var events={'afterCreate':_0x186f('0x4'),'afterUpdate':_0x186f('0x5'),'afterDestroy':_0x186f('0x6')};function emitEvent(_0x213bef){return function(_0x31cade,_0x898d78,_0x4993aa){MailMessageEvents['emit'](_0x213bef+':'+_0x31cade['id'],_0x31cade);MailMessageEvents['emit'](_0x213bef,_0x31cade);_0x4993aa(null);};}for(var e in events){if(events[_0x186f('0x7')](e)){var event=events[e];MailMessage[_0x186f('0x8')](e,emitEvent(event));}}module['exports']=MailMessageEvents;
\ No newline at end of file
diff --git a/server/api/mailMessage/mailMessage.model.js b/server/api/mailMessage/mailMessage.model.js
index b8b2244..f9e96ac 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 _0xbaf7=['bluebird','request-promise','html-to-text','path','rimraf','../../config/environment','./mailMessage.attributes','exports','define','messageId','plainBody','subject','FULLTEXT','body','fromString','models','get','direction','toLowerCase','out','secret','MailInteraction','MailInteractionId','then','update','createdAt','catch','error','utf8mb4','utf8mb4_unicode_ci','util','../../config/logger','moment'];(function(_0x108d68,_0x9b39de){var _0x11476a=function(_0x21cc20){while(--_0x21cc20){_0x108d68['push'](_0x108d68['shift']());}};_0x11476a(++_0x9b39de);}(_0xbaf7,0x1cb));var _0x7baf=function(_0x1a5e0e,_0x5c9dbc){_0x1a5e0e=_0x1a5e0e-0x0;var _0x3f7eea=_0xbaf7[_0x1a5e0e];return _0x3f7eea;};'use strict';var _=require('lodash');var util=require(_0x7baf('0x0'));var logger=require(_0x7baf('0x1'))('api');var moment=require(_0x7baf('0x2'));var BPromise=require(_0x7baf('0x3'));var rp=require(_0x7baf('0x4'));var htmlToText=require(_0x7baf('0x5'));var fs=require('fs');var path=require(_0x7baf('0x6'));var rimraf=require(_0x7baf('0x7'));var config=require(_0x7baf('0x8'));var attributes=require(_0x7baf('0x9'));module[_0x7baf('0xa')]=function(_0x356890,_0x360b39){return _0x356890[_0x7baf('0xb')]('MailMessage',attributes,{'tableName':'mail_messages','paranoid':![],'indexes':[{'name':'messageId','fields':[_0x7baf('0xc')]},{'name':'fti_mail_messages','fields':[_0x7baf('0xd'),_0x7baf('0xe')],'type':_0x7baf('0xf')}],'timestamps':!![],'hooks':{'beforeCreate':function(_0x5cd911,_0x159b32,_0x254ca4){if(_0x5cd911[_0x7baf('0x10')]){_0x5cd911[_0x7baf('0xd')]=htmlToText[_0x7baf('0x11')](_0x5cd911[_0x7baf('0x10')],{'preserveNewlines':!![],'singleNewLineParagraphs':!![],'uppercaseHeadings':![],'noLinkBrackets':!![],'ignoreImage':!![]});}_0x254ca4(null,_0x159b32);},'afterCreate':function(_0x22faf2,_0xaa6721,_0x45dfbd){var _0x298537=_0x356890[_0x7baf('0x12')];var _0x3a84d7=_0x22faf2[_0x7baf('0x13')]({'plain':!![]});if(_0x3a84d7[_0x7baf('0x14')]['toLowerCase']()==='in'||_0x3a84d7[_0x7baf('0x14')][_0x7baf('0x15')]()===_0x7baf('0x16')&&!_0x3a84d7[_0x7baf('0x17')]&&!_['isNil'](_0x3a84d7['UserId'])){_0x298537[_0x7baf('0x18')]['findOne']({'where':{'id':_0x3a84d7[_0x7baf('0x19')]}})[_0x7baf('0x1a')](function(_0x2b4173){if(_0x2b4173){_0x2b4173[_0x7baf('0x1b')]({'lastMsgAt':_0x3a84d7[_0x7baf('0x1c')],'lastMsgDirection':_0x3a84d7['direction'][_0x7baf('0x15')](),'lastMsgBody':_0x3a84d7['body']});}})[_0x7baf('0x1d')](function(_0x3a262c){console[_0x7baf('0x1e')](_0x3a262c);});}_0x45dfbd();}},'charset':_0x7baf('0x1f'),'collate':_0x7baf('0x20')});};
\ No newline at end of file
+var _0x7518=['define','MailMessage','messageId','fti_mail_messages','plainBody','FULLTEXT','body','models','get','direction','toLowerCase','out','isNil','UserId','findOne','update','catch','error','utf8mb4','utf8mb4_unicode_ci','lodash','../../config/logger','api','moment','bluebird','request-promise','html-to-text','path','rimraf','exports'];(function(_0xd551f7,_0x353a60){var _0x347082=function(_0x59e526){while(--_0x59e526){_0xd551f7['push'](_0xd551f7['shift']());}};_0x347082(++_0x353a60);}(_0x7518,0x122));var _0x8751=function(_0x1d056a,_0x293d07){_0x1d056a=_0x1d056a-0x0;var _0x8e14c0=_0x7518[_0x1d056a];return _0x8e14c0;};'use strict';var _=require(_0x8751('0x0'));var util=require('util');var logger=require(_0x8751('0x1'))(_0x8751('0x2'));var moment=require(_0x8751('0x3'));var BPromise=require(_0x8751('0x4'));var rp=require(_0x8751('0x5'));var htmlToText=require(_0x8751('0x6'));var fs=require('fs');var path=require(_0x8751('0x7'));var rimraf=require(_0x8751('0x8'));var config=require('../../config/environment');var attributes=require('./mailMessage.attributes');module[_0x8751('0x9')]=function(_0x5f0849,_0x280634){return _0x5f0849[_0x8751('0xa')](_0x8751('0xb'),attributes,{'tableName':'mail_messages','paranoid':![],'indexes':[{'name':_0x8751('0xc'),'fields':[_0x8751('0xc')]},{'name':_0x8751('0xd'),'fields':[_0x8751('0xe'),'subject'],'type':_0x8751('0xf')}],'timestamps':!![],'hooks':{'beforeCreate':function(_0x39f632,_0x59c198,_0x4e32e2){if(_0x39f632[_0x8751('0x10')]){_0x39f632[_0x8751('0xe')]=htmlToText['fromString'](_0x39f632[_0x8751('0x10')],{'preserveNewlines':!![],'singleNewLineParagraphs':!![],'uppercaseHeadings':![],'noLinkBrackets':!![],'ignoreImage':!![]});}_0x4e32e2(null,_0x59c198);},'afterCreate':function(_0x25e2a4,_0x3fadc1,_0x5e0aa3){var _0xed2ae2=_0x5f0849[_0x8751('0x11')];var _0xe5e09d=_0x25e2a4[_0x8751('0x12')]({'plain':!![]});if(_0xe5e09d[_0x8751('0x13')]['toLowerCase']()==='in'||_0xe5e09d[_0x8751('0x13')][_0x8751('0x14')]()===_0x8751('0x15')&&!_0xe5e09d['secret']&&!_[_0x8751('0x16')](_0xe5e09d[_0x8751('0x17')])){_0xed2ae2['MailInteraction'][_0x8751('0x18')]({'where':{'id':_0xe5e09d['MailInteractionId']}})['then'](function(_0x4ca0aa){if(_0x4ca0aa){_0x4ca0aa[_0x8751('0x19')]({'lastMsgAt':_0xe5e09d['createdAt'],'lastMsgDirection':_0xe5e09d[_0x8751('0x13')][_0x8751('0x14')](),'lastMsgBody':_0xe5e09d['body']});}})[_0x8751('0x1a')](function(_0x24dde6){console[_0x8751('0x1b')](_0x24dde6);});}_0x5e0aa3();}},'charset':_0x8751('0x1c'),'collate':_0x8751('0x1d')});};
\ No newline at end of file
diff --git a/server/api/mailMessage/mailMessage.rpc.js b/server/api/mailMessage/mailMessage.rpc.js
index 656541f..9f41bea 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 _0xf06c=['redis','register','then','info','request\x20sent','debug','MailMessage,\x20%s,\x20%s,\x20%s','error','code','MailMessage,\x20%s,\x20%s','message','result','catch','CreateMailMessage','MailMessage','body','options','raw','stringify','lodash','util','moment','bluebird','randomstring','../../mysqldb','../../config/utils','../../config/logger','../../config/environment','jayson/promise','client'];(function(_0x1e8c50,_0xd7091b){var _0x4a2134=function(_0x2d4553){while(--_0x2d4553){_0x1e8c50['push'](_0x1e8c50['shift']());}};_0x4a2134(++_0xd7091b);}(_0xf06c,0xc7));var _0xcf06=function(_0x2f00f6,_0x47ec7c){_0x2f00f6=_0x2f00f6-0x0;var _0x149469=_0xf06c[_0x2f00f6];return _0x149469;};'use strict';var _=require(_0xcf06('0x0'));var util=require(_0xcf06('0x1'));var moment=require(_0xcf06('0x2'));var BPromise=require(_0xcf06('0x3'));var rs=require(_0xcf06('0x4'));var fs=require('fs');var Redis=require('ioredis');var db=require(_0xcf06('0x5'))['db'];var utils=require(_0xcf06('0x6'));var logger=require(_0xcf06('0x7'))('rpc');var config=require(_0xcf06('0x8'));var jayson=require(_0xcf06('0x9'));var client=jayson[_0xcf06('0xa')]['http']({'port':0x232a});config[_0xcf06('0xb')]=_['defaults'](config[_0xcf06('0xb')],{'host':'localhost','port':0x18eb});var socket=require('socket.io-emitter')(new Redis(config['redis']));require('./mailMessage.socket')[_0xcf06('0xc')](socket);function respondWithRpcPromise(_0xfd85ed,_0x41dea0,_0x59d6ba){return new BPromise(function(_0x4ed56b,_0x463309){return client['request'](_0xfd85ed,_0x59d6ba)[_0xcf06('0xd')](function(_0x544ac2){logger[_0xcf06('0xe')]('MailMessage,\x20%s,\x20%s',_0x41dea0,_0xcf06('0xf'));logger[_0xcf06('0x10')](_0xcf06('0x11'),_0x41dea0,_0xcf06('0xf'),JSON['stringify'](_0x544ac2));if(_0x544ac2['error']){if(_0x544ac2[_0xcf06('0x12')][_0xcf06('0x13')]===0x1f4){logger[_0xcf06('0x12')](_0xcf06('0x14'),_0x41dea0,_0x544ac2['error'][_0xcf06('0x15')]);return _0x463309(_0x544ac2[_0xcf06('0x12')]['message']);}logger['error'](_0xcf06('0x14'),_0x41dea0,_0x544ac2[_0xcf06('0x12')][_0xcf06('0x15')]);return _0x4ed56b(_0x544ac2['error'][_0xcf06('0x15')]);}else{logger[_0xcf06('0xe')](_0xcf06('0x14'),_0x41dea0,'request\x20sent');_0x4ed56b(_0x544ac2[_0xcf06('0x16')][_0xcf06('0x15')]);}})[_0xcf06('0x17')](function(_0x1aad31){logger[_0xcf06('0x12')]('MailMessage,\x20%s,\x20%s',_0x41dea0,_0x1aad31);_0x463309(_0x1aad31);});});}exports[_0xcf06('0x18')]=function(_0x1be1e3){var _0x1cdcef=this;return new Promise(function(_0x5db08d,_0x465eed){return db[_0xcf06('0x19')]['create'](_0x1be1e3[_0xcf06('0x1a')],{'raw':_0x1be1e3[_0xcf06('0x1b')]?_0x1be1e3['options'][_0xcf06('0x1c')]===undefined?!![]:![]:!![]})[_0xcf06('0xd')](function(_0x139b17){logger[_0xcf06('0xe')](_0xcf06('0x18'),_0x1be1e3);logger[_0xcf06('0x10')](_0xcf06('0x18'),_0x1be1e3,JSON[_0xcf06('0x1d')](_0x139b17));_0x5db08d(_0x139b17);})[_0xcf06('0x17')](function(_0x471a6d){logger[_0xcf06('0x12')](_0xcf06('0x18'),_0x471a6d['message'],_0x1be1e3);_0x465eed(_0x1cdcef['error'](0x1f4,_0x471a6d[_0xcf06('0x15')]));});});};
\ No newline at end of file
+var _0xbacd=['MailMessage,\x20%s,\x20%s,\x20%s','stringify','error','code','message','result','catch','CreateMailMessage','create','options','raw','lodash','util','bluebird','randomstring','ioredis','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','client','http','redis','defaults','localhost','socket.io-emitter','./mailMessage.socket','register','then','info','MailMessage,\x20%s,\x20%s','request\x20sent','debug'];(function(_0x25bcd0,_0x1b41ec){var _0x5a7a7a=function(_0xa2e5b6){while(--_0xa2e5b6){_0x25bcd0['push'](_0x25bcd0['shift']());}};_0x5a7a7a(++_0x1b41ec);}(_0xbacd,0x1c5));var _0xdbac=function(_0x3b8225,_0x3d27f2){_0x3b8225=_0x3b8225-0x0;var _0xec2182=_0xbacd[_0x3b8225];return _0xec2182;};'use strict';var _=require(_0xdbac('0x0'));var util=require(_0xdbac('0x1'));var moment=require('moment');var BPromise=require(_0xdbac('0x2'));var rs=require(_0xdbac('0x3'));var fs=require('fs');var Redis=require(_0xdbac('0x4'));var db=require('../../mysqldb')['db'];var utils=require(_0xdbac('0x5'));var logger=require(_0xdbac('0x6'))(_0xdbac('0x7'));var config=require(_0xdbac('0x8'));var jayson=require(_0xdbac('0x9'));var client=jayson[_0xdbac('0xa')][_0xdbac('0xb')]({'port':0x232a});config[_0xdbac('0xc')]=_[_0xdbac('0xd')](config[_0xdbac('0xc')],{'host':_0xdbac('0xe'),'port':0x18eb});var socket=require(_0xdbac('0xf'))(new Redis(config[_0xdbac('0xc')]));require(_0xdbac('0x10'))[_0xdbac('0x11')](socket);function respondWithRpcPromise(_0x4d025f,_0x18f3ad,_0x258f7e){return new BPromise(function(_0x5abcff,_0x30a135){return client['request'](_0x4d025f,_0x258f7e)[_0xdbac('0x12')](function(_0x354884){logger[_0xdbac('0x13')](_0xdbac('0x14'),_0x18f3ad,_0xdbac('0x15'));logger[_0xdbac('0x16')](_0xdbac('0x17'),_0x18f3ad,_0xdbac('0x15'),JSON[_0xdbac('0x18')](_0x354884));if(_0x354884['error']){if(_0x354884[_0xdbac('0x19')][_0xdbac('0x1a')]===0x1f4){logger[_0xdbac('0x19')](_0xdbac('0x14'),_0x18f3ad,_0x354884[_0xdbac('0x19')][_0xdbac('0x1b')]);return _0x30a135(_0x354884[_0xdbac('0x19')][_0xdbac('0x1b')]);}logger['error'](_0xdbac('0x14'),_0x18f3ad,_0x354884[_0xdbac('0x19')][_0xdbac('0x1b')]);return _0x5abcff(_0x354884['error'][_0xdbac('0x1b')]);}else{logger[_0xdbac('0x13')](_0xdbac('0x14'),_0x18f3ad,_0xdbac('0x15'));_0x5abcff(_0x354884[_0xdbac('0x1c')][_0xdbac('0x1b')]);}})[_0xdbac('0x1d')](function(_0x43fea9){logger[_0xdbac('0x19')](_0xdbac('0x14'),_0x18f3ad,_0x43fea9);_0x30a135(_0x43fea9);});});}exports[_0xdbac('0x1e')]=function(_0x9c74a5){var _0x5ec67c=this;return new Promise(function(_0x3de274,_0x323801){return db['MailMessage'][_0xdbac('0x1f')](_0x9c74a5['body'],{'raw':_0x9c74a5[_0xdbac('0x20')]?_0x9c74a5['options'][_0xdbac('0x21')]===undefined?!![]:![]:!![]})[_0xdbac('0x12')](function(_0x20642c){logger[_0xdbac('0x13')](_0xdbac('0x1e'),_0x9c74a5);logger[_0xdbac('0x16')](_0xdbac('0x1e'),_0x9c74a5,JSON['stringify'](_0x20642c));_0x3de274(_0x20642c);})[_0xdbac('0x1d')](function(_0x822567){logger[_0xdbac('0x19')](_0xdbac('0x1e'),_0x822567[_0xdbac('0x1b')],_0x9c74a5);_0x323801(_0x5ec67c[_0xdbac('0x19')](0x1f4,_0x822567[_0xdbac('0x1b')]));});});};
\ No newline at end of file
diff --git a/server/api/mailMessage/mailMessage.socket.js b/server/api/mailMessage/mailMessage.socket.js
index 4f5b215..3d8ce9c 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 _0xbc8a=['save','update','emit','removeListener','length'];(function(_0x374657,_0x51da49){var _0x3dcf27=function(_0xe863e6){while(--_0xe863e6){_0x374657['push'](_0x374657['shift']());}};_0x3dcf27(++_0x51da49);}(_0xbc8a,0x190));var _0xabc8=function(_0x55a89e,_0x1a05ab){_0x55a89e=_0x55a89e-0x0;var _0x3aa2bd=_0xbc8a[_0x55a89e];return _0x3aa2bd;};'use strict';var MailMessageEvents=require('./mailMessage.events');var events=[_0xabc8('0x0'),'remove',_0xabc8('0x1')];function createListener(_0xaa593e,_0x279421){return function(_0x26a662){_0x279421[_0xabc8('0x2')](_0xaa593e,_0x26a662);};}function removeListener(_0x26c37d,_0x6ef374){return function(){MailMessageEvents[_0xabc8('0x3')](_0x26c37d,_0x6ef374);};}exports['register']=function(_0x4b2afa){for(var _0x3bf739=0x0,_0x3edb5d=events[_0xabc8('0x4')];_0x3bf739<_0x3edb5d;_0x3bf739++){var _0x14d9a2=events[_0x3bf739];var _0x418d32=createListener('mailMessage:'+_0x14d9a2,_0x4b2afa);MailMessageEvents['on'](_0x14d9a2,_0x418d32);}};
\ No newline at end of file
+var _0xa03b=['register','length','mailMessage:','save','removeListener'];(function(_0x5752f1,_0x3c9165){var _0x3c3ef1=function(_0x2c2f96){while(--_0x2c2f96){_0x5752f1['push'](_0x5752f1['shift']());}};_0x3c3ef1(++_0x3c9165);}(_0xa03b,0xad));var _0xba03=function(_0x110c3d,_0x12ee06){_0x110c3d=_0x110c3d-0x0;var _0x226d67=_0xa03b[_0x110c3d];return _0x226d67;};'use strict';var MailMessageEvents=require('./mailMessage.events');var events=[_0xba03('0x0'),'remove','update'];function createListener(_0x3bbe4f,_0x3d6c68){return function(_0x3bb23e){_0x3d6c68['emit'](_0x3bbe4f,_0x3bb23e);};}function removeListener(_0x215692,_0x82ef51){return function(){MailMessageEvents[_0xba03('0x1')](_0x215692,_0x82ef51);};}exports[_0xba03('0x2')]=function(_0xe3188){for(var _0x190378=0x0,_0x2365d5=events[_0xba03('0x3')];_0x190378<_0x2365d5;_0x190378++){var _0x1a72c7=events[_0x190378];var _0x1d4383=createListener(_0xba03('0x4')+_0x1a72c7,_0xe3188);MailMessageEvents['on'](_0x1a72c7,_0x1d4383);}};
\ No newline at end of file
diff --git a/server/api/mailQueue/index.js b/server/api/mailQueue/index.js
index a1bb837..70e66ef 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 _0x514e=['/describe','describe','/:id','/:id/members','getMembers','/:id/teams','getTeams','/:id/users','post','create','addTeams','put','delete','removeTeams','removeAgents','exports','multer','express','Router','../../config/environment','./mailQueue.controller','get','isAuthenticated','index'];(function(_0x19e35c,_0x29cd1e){var _0x3e1fe8=function(_0x17258b){while(--_0x17258b){_0x19e35c['push'](_0x19e35c['shift']());}};_0x3e1fe8(++_0x29cd1e);}(_0x514e,0xa0));var _0xe514=function(_0x436add,_0x368cf0){_0x436add=_0x436add-0x0;var _0x413ba6=_0x514e[_0x436add];return _0x413ba6;};'use strict';var multer=require(_0xe514('0x0'));var util=require('util');var path=require('path');var timeout=require('connect-timeout');var express=require(_0xe514('0x1'));var router=express[_0xe514('0x2')]();var auth=require('../../components/auth/service');var interaction=require('../../components/interaction/service');var config=require(_0xe514('0x3'));var controller=require(_0xe514('0x4'));router[_0xe514('0x5')]('/',auth[_0xe514('0x6')](),controller[_0xe514('0x7')]);router[_0xe514('0x5')](_0xe514('0x8'),auth[_0xe514('0x6')](),controller[_0xe514('0x9')]);router['get'](_0xe514('0xa'),auth[_0xe514('0x6')](),controller['show']);router[_0xe514('0x5')](_0xe514('0xb'),auth[_0xe514('0x6')](),controller[_0xe514('0xc')]);router[_0xe514('0x5')](_0xe514('0xd'),auth['isAuthenticated'](),controller[_0xe514('0xe')]);router[_0xe514('0x5')](_0xe514('0xf'),auth['isAuthenticated'](),controller['getAgents']);router[_0xe514('0x10')]('/',auth['isAuthenticated'](),controller[_0xe514('0x11')]);router[_0xe514('0x10')]('/:id/teams',auth[_0xe514('0x6')](),controller[_0xe514('0x12')]);router[_0xe514('0x10')](_0xe514('0xf'),auth[_0xe514('0x6')](),controller['addAgents']);router[_0xe514('0x13')](_0xe514('0xa'),auth[_0xe514('0x6')](),controller['update']);router['delete']('/:id',auth[_0xe514('0x6')](),controller['destroy']);router[_0xe514('0x14')](_0xe514('0xd'),auth[_0xe514('0x6')](),controller[_0xe514('0x15')]);router[_0xe514('0x14')]('/:id/users',auth[_0xe514('0x6')](),controller[_0xe514('0x16')]);module[_0xe514('0x17')]=router;
\ No newline at end of file
+var _0xff79=['describe','/:id','/:id/members','getMembers','/:id/users','getAgents','post','/:id/teams','addTeams','addAgents','update','delete','destroy','removeTeams','removeAgents','exports','multer','util','path','connect-timeout','express','../../components/auth/service','../../components/interaction/service','../../config/environment','./mailQueue.controller','isAuthenticated','get','/describe'];(function(_0x3a5b06,_0x3dd9cd){var _0x15b6aa=function(_0x2b1b34){while(--_0x2b1b34){_0x3a5b06['push'](_0x3a5b06['shift']());}};_0x15b6aa(++_0x3dd9cd);}(_0xff79,0x1ec));var _0x9ff7=function(_0x4b9a8f,_0x5e5fd5){_0x4b9a8f=_0x4b9a8f-0x0;var _0xa18064=_0xff79[_0x4b9a8f];return _0xa18064;};'use strict';var multer=require(_0x9ff7('0x0'));var util=require(_0x9ff7('0x1'));var path=require(_0x9ff7('0x2'));var timeout=require(_0x9ff7('0x3'));var express=require(_0x9ff7('0x4'));var router=express['Router']();var auth=require(_0x9ff7('0x5'));var interaction=require(_0x9ff7('0x6'));var config=require(_0x9ff7('0x7'));var controller=require(_0x9ff7('0x8'));router['get']('/',auth[_0x9ff7('0x9')](),controller['index']);router[_0x9ff7('0xa')](_0x9ff7('0xb'),auth['isAuthenticated'](),controller[_0x9ff7('0xc')]);router[_0x9ff7('0xa')](_0x9ff7('0xd'),auth[_0x9ff7('0x9')](),controller['show']);router[_0x9ff7('0xa')](_0x9ff7('0xe'),auth['isAuthenticated'](),controller[_0x9ff7('0xf')]);router['get']('/:id/teams',auth['isAuthenticated'](),controller['getTeams']);router[_0x9ff7('0xa')](_0x9ff7('0x10'),auth['isAuthenticated'](),controller[_0x9ff7('0x11')]);router[_0x9ff7('0x12')]('/',auth['isAuthenticated'](),controller['create']);router[_0x9ff7('0x12')](_0x9ff7('0x13'),auth[_0x9ff7('0x9')](),controller[_0x9ff7('0x14')]);router['post'](_0x9ff7('0x10'),auth[_0x9ff7('0x9')](),controller[_0x9ff7('0x15')]);router['put'](_0x9ff7('0xd'),auth[_0x9ff7('0x9')](),controller[_0x9ff7('0x16')]);router[_0x9ff7('0x17')](_0x9ff7('0xd'),auth[_0x9ff7('0x9')](),controller[_0x9ff7('0x18')]);router['delete'](_0x9ff7('0x13'),auth[_0x9ff7('0x9')](),controller[_0x9ff7('0x19')]);router[_0x9ff7('0x17')](_0x9ff7('0x10'),auth[_0x9ff7('0x9')](),controller[_0x9ff7('0x1a')]);module[_0x9ff7('0x1b')]=router;
\ No newline at end of file
diff --git a/server/api/mailQueue/mailQueue.attributes.js b/server/api/mailQueue/mailQueue.attributes.js
index b745327..e9d0c24 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 _0x0344=['ENUM','beepall','sequelize','exports','name','STRING','INTEGER'];(function(_0x44400c,_0x4469e7){var _0x5d3d53=function(_0x2a4102){while(--_0x2a4102){_0x44400c['push'](_0x44400c['shift']());}};_0x5d3d53(++_0x4469e7);}(_0x0344,0x14b));var _0x4034=function(_0x1d9d2a,_0x2d4280){_0x1d9d2a=_0x1d9d2a-0x0;var _0x2d07e9=_0x0344[_0x1d9d2a];return _0x2d07e9;};'use strict';var Sequelize=require(_0x4034('0x0'));module[_0x4034('0x1')]={'name':{'type':Sequelize['STRING'],'unique':_0x4034('0x2'),'validate':{'notEmpty':!![],'is':/^[A-Za-z0-9\.\_]+$/i}},'description':{'type':Sequelize[_0x4034('0x3')]},'timeout':{'type':Sequelize[_0x4034('0x4')],'validate':{'min':0x1,'max':0x20c49b}},'strategy':{'type':Sequelize[_0x4034('0x5')]('rrmemory',_0x4034('0x6'),'roundrobin')}};
\ No newline at end of file
+var _0x8bf4=['name','INTEGER','rrmemory','roundrobin','sequelize','exports','STRING'];(function(_0x122ef9,_0x451d2a){var _0x42fba0=function(_0x17c9d3){while(--_0x17c9d3){_0x122ef9['push'](_0x122ef9['shift']());}};_0x42fba0(++_0x451d2a);}(_0x8bf4,0x185));var _0x48bf=function(_0x652b90,_0x52865b){_0x652b90=_0x652b90-0x0;var _0x523368=_0x8bf4[_0x652b90];return _0x523368;};'use strict';var Sequelize=require(_0x48bf('0x0'));module[_0x48bf('0x1')]={'name':{'type':Sequelize[_0x48bf('0x2')],'unique':_0x48bf('0x3'),'validate':{'notEmpty':!![],'is':/^[A-Za-z0-9\.\_]+$/i}},'description':{'type':Sequelize[_0x48bf('0x2')]},'timeout':{'type':Sequelize[_0x48bf('0x4')],'validate':{'min':0x1,'max':0x20c49b}},'strategy':{'type':Sequelize['ENUM'](_0x48bf('0x5'),'beepall',_0x48bf('0x6'))}};
\ No newline at end of file
diff --git a/server/api/mailQueue/mailQueue.controller.js b/server/api/mailQueue/mailQueue.controller.js
index 7e5c472..fd2a2a1 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 _0x9aca=['status','set','Content-Range','apply','reject','save','update','then','get','MailQueues','UserProfileResource','destroy','sendStatus','error','stack','name','send','index','map','model','query','keys','filters','attributes','intersection','fields','hasOwnProperty','nolimit','order','sort','where','type','filter','options','MailQueue','includeAll','findAll','rows','catch','show','params','rawAttributes','length','include','find','create','Unable\x20to\x20retrieve\x20the\x20current\x20user','role','user','UserProfileSection','userProfileId','autoAssociation','body','describe','getMembers','findOne','UserMailQueue','pick','MailQueueId','merge','User','findAndCountAll','UserId','agent','mailPause','createdAt','format','%s/%s','SIP','updatedAt','getTeams','addTeams','ids','Team','online','voicePause','interface','flatMap','Agents','sequelize','transaction','findOrCreate','forEach','emit','userMailQueue:save','removeTeams','select','tq.TeamId','from','team_has_mail_queues','join','user_has_teams','ut.TeamId\x20=\x20tq.TeamId','MailQueueId\x20=\x20?','push','toString','SELECT','every','TeamId','all','union','value','isEmpty','removeAgents','userMailQueue:remove','addAgents','omit','spread','isArray','getAgents','eml-format','rimraf','zip-dir','fast-json-patch','moment','bluebird','mustache','util','path','to-csv','lodash','crypto','jsforce','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/logger','../../config/utils','redis','./mailQueue.socket','end','json','count','offset','limit'];(function(_0x135448,_0x4ca19f){var _0x28389e=function(_0x5a2113){while(--_0x5a2113){_0x135448['push'](_0x135448['shift']());}};_0x28389e(++_0x4ca19f);}(_0x9aca,0x6e));var _0xa9ac=function(_0x4f9236,_0x5ce3fb){_0x4f9236=_0x4f9236-0x0;var _0x184495=_0x9aca[_0x4f9236];return _0x184495;};'use strict';var pdf=require('html-pdf');var emlformat=require(_0xa9ac('0x0'));var rimraf=require(_0xa9ac('0x1'));var zipdir=require(_0xa9ac('0x2'));var jsonpatch=require(_0xa9ac('0x3'));var rp=require('request-promise');var moment=require(_0xa9ac('0x4'));var BPromise=require(_0xa9ac('0x5'));var Mustache=require(_0xa9ac('0x6'));var util=require(_0xa9ac('0x7'));var path=require(_0xa9ac('0x8'));var sox=require('sox');var csv=require(_0xa9ac('0x9'));var ejs=require('ejs');var fs=require('fs');var _=require(_0xa9ac('0xa'));var squel=require('squel');var crypto=require(_0xa9ac('0xb'));var jsforce=require(_0xa9ac('0xc'));var deskjs=require('desk.js');var toCsv=require(_0xa9ac('0x9'));var querystring=require(_0xa9ac('0xd'));var Papa=require(_0xa9ac('0xe'));var Redis=require(_0xa9ac('0xf'));var authService=require(_0xa9ac('0x10'));var qs=require(_0xa9ac('0x11'));var as=require(_0xa9ac('0x12'));var hardwareService=require('../../config/license/hardware');var logger=require(_0xa9ac('0x13'))('api');var utils=require(_0xa9ac('0x14'));var config=require('../../config/environment');var db=require('../../mysqldb')['db'];config[_0xa9ac('0x15')]=_['defaults'](config[_0xa9ac('0x15')],{'host':'localhost','port':0x18eb});var socket=require('socket.io-emitter')(new Redis(config['redis']));require(_0xa9ac('0x16'))['register'](socket);function respondWithStatusCode(_0x4406c2,_0x5b6e5e){_0x5b6e5e=_0x5b6e5e||0xcc;return function(_0x16b38a){if(_0x16b38a){return _0x4406c2['sendStatus'](_0x5b6e5e);}return _0x4406c2['status'](_0x5b6e5e)[_0xa9ac('0x17')]();};}function respondWithResult(_0x4df649,_0x47b4c6){_0x47b4c6=_0x47b4c6||0xc8;return function(_0x16e405){if(_0x16e405){return _0x4df649['status'](_0x47b4c6)[_0xa9ac('0x18')](_0x16e405);}};}function respondWithFilteredResult(_0x4f74f2,_0x458112){return function(_0x3ca6b7){if(_0x3ca6b7){var _0x2e84cf=_0x3ca6b7[_0xa9ac('0x19')],_0x20fdc1=_0x458112[_0xa9ac('0x1a')],_0x2e2e12=_0x458112[_0xa9ac('0x1a')]+_0x458112[_0xa9ac('0x1b')],_0x177823;if(_0x2e2e12>=_0x2e84cf){_0x2e2e12=_0x2e84cf;_0x177823=0xc8;}else{_0x177823=0xce;}_0x4f74f2[_0xa9ac('0x1c')](_0x177823);return _0x4f74f2[_0xa9ac('0x1d')](_0xa9ac('0x1e'),_0x20fdc1+'-'+_0x2e2e12+'/'+_0x2e84cf)[_0xa9ac('0x18')](_0x3ca6b7);}return null;};}function patchUpdates(_0x2a73fd){return function(_0x527bed){try{jsonpatch[_0xa9ac('0x1f')](_0x527bed,_0x2a73fd,!![]);}catch(_0x57f8ca){return BPromise[_0xa9ac('0x20')](_0x57f8ca);}return _0x527bed[_0xa9ac('0x21')]();};}function saveUpdates(_0x274b51,_0x191b9a){return function(_0x5be0e6){if(_0x5be0e6){return _0x5be0e6[_0xa9ac('0x22')](_0x274b51)['then'](function(_0xff6e2c){return _0xff6e2c;});}return null;};}function removeEntity(_0x516b60,_0x3796b){return function(_0x388fbe){if(_0x388fbe){return _0x388fbe['destroy']()[_0xa9ac('0x23')](function(){var _0x14c16f=_0x388fbe[_0xa9ac('0x24')]({'plain':!![]});var _0x33ab82=_0xa9ac('0x25');return db[_0xa9ac('0x26')][_0xa9ac('0x27')]({'where':{'type':_0x33ab82,'resourceId':_0x14c16f['id']}})['then'](function(){return _0x388fbe;});})[_0xa9ac('0x23')](function(){_0x516b60[_0xa9ac('0x1c')](0xcc)['end']();});}};}function handleEntityNotFound(_0x194163,_0x42a94a){return function(_0x306a4e){if(!_0x306a4e){_0x194163[_0xa9ac('0x28')](0x194);}return _0x306a4e;};}function handleError(_0x335caa,_0x483fb9){_0x483fb9=_0x483fb9||0x1f4;return function(_0x224b99){logger[_0xa9ac('0x29')](_0x224b99[_0xa9ac('0x2a')]);if(_0x224b99[_0xa9ac('0x2b')]){delete _0x224b99[_0xa9ac('0x2b')];}_0x335caa[_0xa9ac('0x1c')](_0x483fb9)[_0xa9ac('0x2c')](_0x224b99);};}exports[_0xa9ac('0x2d')]=function(_0x3664db,_0x3e93e5){var _0x5b6a08={},_0x4ffb22={},_0x3be28f={'count':0x0,'rows':[]};var _0x4f1124=_[_0xa9ac('0x2e')](db['MailQueue']['rawAttributes'],function(_0x4cd7cc){return{'name':_0x4cd7cc['fieldName'],'type':_0x4cd7cc['type']['key']};});_0x4ffb22[_0xa9ac('0x2f')]=_[_0xa9ac('0x2e')](_0x4f1124,_0xa9ac('0x2b'));_0x4ffb22[_0xa9ac('0x30')]=_[_0xa9ac('0x31')](_0x3664db[_0xa9ac('0x30')]);_0x4ffb22[_0xa9ac('0x32')]=_['intersection'](_0x4ffb22['model'],_0x4ffb22[_0xa9ac('0x30')]);_0x5b6a08[_0xa9ac('0x33')]=_[_0xa9ac('0x34')](_0x4ffb22['model'],qs[_0xa9ac('0x35')](_0x3664db[_0xa9ac('0x30')]['fields']));_0x5b6a08['attributes']=_0x5b6a08[_0xa9ac('0x33')]['length']?_0x5b6a08[_0xa9ac('0x33')]:_0x4ffb22['model'];if(!_0x3664db[_0xa9ac('0x30')][_0xa9ac('0x36')](_0xa9ac('0x37'))){_0x5b6a08['limit']=qs[_0xa9ac('0x1b')](_0x3664db['query'][_0xa9ac('0x1b')]);_0x5b6a08[_0xa9ac('0x1a')]=qs[_0xa9ac('0x1a')](_0x3664db['query'][_0xa9ac('0x1a')]);}_0x5b6a08[_0xa9ac('0x38')]=qs[_0xa9ac('0x39')](_0x3664db[_0xa9ac('0x30')][_0xa9ac('0x39')]);_0x5b6a08[_0xa9ac('0x3a')]=qs[_0xa9ac('0x32')](_['pick'](_0x3664db[_0xa9ac('0x30')],_0x4ffb22['filters']));if(_0x3664db[_0xa9ac('0x30')]['filter']){_0x5b6a08[_0xa9ac('0x3a')]=_['merge'](_0x5b6a08[_0xa9ac('0x3a')],{'$or':_['map'](_0x4f1124,function(_0x5dde25){if(_0x5dde25[_0xa9ac('0x3b')]!=='VIRTUAL'){var _0x277c6b={};_0x277c6b[_0x5dde25[_0xa9ac('0x2b')]]={'$like':'%'+_0x3664db[_0xa9ac('0x30')][_0xa9ac('0x3c')]+'%'};return _0x277c6b;}})});}_0x5b6a08=_['merge']({},_0x5b6a08,_0x3664db[_0xa9ac('0x3d')]);var _0x190575={'where':_0x5b6a08[_0xa9ac('0x3a')]};return db[_0xa9ac('0x3e')][_0xa9ac('0x19')](_0x190575)[_0xa9ac('0x23')](function(_0x2bb0aa){_0x3be28f['count']=_0x2bb0aa;if(_0x3664db[_0xa9ac('0x30')][_0xa9ac('0x3f')]){_0x5b6a08['include']=[{'all':!![]}];}return db[_0xa9ac('0x3e')][_0xa9ac('0x40')](_0x5b6a08);})[_0xa9ac('0x23')](function(_0x1e300b){_0x3be28f[_0xa9ac('0x41')]=_0x1e300b;return _0x3be28f;})[_0xa9ac('0x23')](respondWithFilteredResult(_0x3e93e5,_0x5b6a08))[_0xa9ac('0x42')](handleError(_0x3e93e5,null));};exports[_0xa9ac('0x43')]=function(_0x4db96e,_0x4fedc1){var _0xcbb048={'raw':!![],'where':{'id':_0x4db96e[_0xa9ac('0x44')]['id']}},_0x5e03d7={};_0x5e03d7['model']=_['keys'](db[_0xa9ac('0x3e')][_0xa9ac('0x45')]);_0x5e03d7[_0xa9ac('0x30')]=_[_0xa9ac('0x31')](_0x4db96e[_0xa9ac('0x30')]);_0x5e03d7[_0xa9ac('0x32')]=_[_0xa9ac('0x34')](_0x5e03d7[_0xa9ac('0x2f')],_0x5e03d7[_0xa9ac('0x30')]);_0xcbb048[_0xa9ac('0x33')]=_[_0xa9ac('0x34')](_0x5e03d7['model'],qs[_0xa9ac('0x35')](_0x4db96e[_0xa9ac('0x30')][_0xa9ac('0x35')]));_0xcbb048[_0xa9ac('0x33')]=_0xcbb048[_0xa9ac('0x33')][_0xa9ac('0x46')]?_0xcbb048[_0xa9ac('0x33')]:_0x5e03d7[_0xa9ac('0x2f')];if(_0x4db96e[_0xa9ac('0x30')][_0xa9ac('0x3f')]){_0xcbb048[_0xa9ac('0x47')]=[{'all':!![]}];}_0xcbb048=_['merge']({},_0xcbb048,_0x4db96e[_0xa9ac('0x3d')]);return db[_0xa9ac('0x3e')][_0xa9ac('0x48')](_0xcbb048)[_0xa9ac('0x23')](handleEntityNotFound(_0x4fedc1,null))['then'](respondWithResult(_0x4fedc1,null))[_0xa9ac('0x42')](handleError(_0x4fedc1,null));};exports['create']=function(_0x27d82b,_0xfe378f){return db['MailQueue'][_0xa9ac('0x49')](_0x27d82b['body'],{})[_0xa9ac('0x23')](function(_0x4d0baf){var _0x5784a3=_0x27d82b['user'][_0xa9ac('0x24')]({'plain':!![]});if(!_0x5784a3)throw new Error(_0xa9ac('0x4a'));if(_0x5784a3[_0xa9ac('0x4b')]===_0xa9ac('0x4c')){var _0x1321d8=_0x4d0baf[_0xa9ac('0x24')]({'plain':!![]});var _0x59c2b0=_0xa9ac('0x25');return db[_0xa9ac('0x4d')]['find']({'where':{'name':_0x59c2b0,'userProfileId':_0x5784a3[_0xa9ac('0x4e')]},'raw':!![]})[_0xa9ac('0x23')](function(_0x17cef7){if(_0x17cef7&&_0x17cef7[_0xa9ac('0x4f')]===0x0){return db['UserProfileResource']['create']({'name':_0x1321d8['name'],'resourceId':_0x1321d8['id'],'type':_0x17cef7[_0xa9ac('0x2b')],'sectionId':_0x17cef7['id']},{})[_0xa9ac('0x23')](function(){return _0x4d0baf;});}else{return _0x4d0baf;}})[_0xa9ac('0x42')](function(_0x4daece){logger[_0xa9ac('0x29')]('Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s',_0x4daece);throw _0x4daece;});}return _0x4d0baf;})[_0xa9ac('0x23')](respondWithResult(_0xfe378f,0xc9))[_0xa9ac('0x42')](handleError(_0xfe378f,null));};exports[_0xa9ac('0x22')]=function(_0x4642d6,_0x57118e){if(_0x4642d6[_0xa9ac('0x50')]['id']){delete _0x4642d6[_0xa9ac('0x50')]['id'];}return db[_0xa9ac('0x3e')][_0xa9ac('0x48')]({'where':{'id':_0x4642d6[_0xa9ac('0x44')]['id']}})[_0xa9ac('0x23')](handleEntityNotFound(_0x57118e,null))[_0xa9ac('0x23')](saveUpdates(_0x4642d6[_0xa9ac('0x50')],null))[_0xa9ac('0x23')](respondWithResult(_0x57118e,null))[_0xa9ac('0x42')](handleError(_0x57118e,null));};exports[_0xa9ac('0x27')]=function(_0x1c8bae,_0x2b35b8){return db[_0xa9ac('0x3e')]['find']({'where':{'id':_0x1c8bae[_0xa9ac('0x44')]['id']}})['then'](handleEntityNotFound(_0x2b35b8,null))[_0xa9ac('0x23')](removeEntity(_0x2b35b8,null))['catch'](handleError(_0x2b35b8,null));};exports[_0xa9ac('0x51')]=function(_0x4737b7,_0x5d0b33){return db[_0xa9ac('0x3e')]['describe']()[_0xa9ac('0x23')](respondWithResult(_0x5d0b33,null))['catch'](handleError(_0x5d0b33,null));};exports[_0xa9ac('0x52')]=function(_0x4acf65,_0x3f3600,_0x512350){var _0x560962={'raw':!![],'where':{}},_0x2ff420={},_0x58469f;return db['MailQueue'][_0xa9ac('0x53')]({'where':{'id':_0x4acf65[_0xa9ac('0x44')]['id']}})[_0xa9ac('0x23')](handleEntityNotFound(_0x3f3600,null))[_0xa9ac('0x23')](function(_0x5a8743){if(_0x5a8743){_0x58469f=_0x5a8743['get']({'plain':!![]});_0x2ff420[_0xa9ac('0x2f')]=_[_0xa9ac('0x31')](db[_0xa9ac('0x54')][_0xa9ac('0x45')]);_0x2ff420[_0xa9ac('0x30')]=_[_0xa9ac('0x31')](_0x4acf65[_0xa9ac('0x30')]);_0x2ff420[_0xa9ac('0x32')]=_['intersection'](_0x2ff420['model'],_0x2ff420[_0xa9ac('0x30')]);_0x560962['attributes']=_[_0xa9ac('0x34')](_0x2ff420['model'],qs[_0xa9ac('0x35')](_0x4acf65[_0xa9ac('0x30')][_0xa9ac('0x35')]));_0x560962[_0xa9ac('0x33')]=_0x560962[_0xa9ac('0x33')][_0xa9ac('0x46')]?_0x560962['attributes']:_0x2ff420[_0xa9ac('0x2f')];if(!_0x4acf65[_0xa9ac('0x30')]['hasOwnProperty'](_0xa9ac('0x37'))){_0x560962[_0xa9ac('0x1b')]=qs[_0xa9ac('0x1b')](_0x4acf65[_0xa9ac('0x30')][_0xa9ac('0x1b')]);_0x560962['offset']=qs[_0xa9ac('0x1a')](_0x4acf65[_0xa9ac('0x30')][_0xa9ac('0x1a')]);}_0x560962[_0xa9ac('0x38')]=qs[_0xa9ac('0x39')](_0x4acf65['query'][_0xa9ac('0x39')]);_0x560962[_0xa9ac('0x3a')]=qs['filters'](_[_0xa9ac('0x55')](_0x4acf65[_0xa9ac('0x30')],_0x2ff420[_0xa9ac('0x32')]));_0x560962[_0xa9ac('0x3a')][_0xa9ac('0x56')]=_0x5a8743['id'];if(_0x4acf65[_0xa9ac('0x30')][_0xa9ac('0x3c')]){_0x560962[_0xa9ac('0x3a')]=_['merge'](_0x560962[_0xa9ac('0x3a')],{'$or':_[_0xa9ac('0x2e')](_0x560962[_0xa9ac('0x33')],function(_0x4b4f86){var _0x1e3c30={};_0x1e3c30[_0x4b4f86]={'$like':'%'+_0x4acf65[_0xa9ac('0x30')]['filter']+'%'};return _0x1e3c30;})});}_0x560962=_[_0xa9ac('0x57')]({},_0x560962,_0x4acf65['options']);return db[_0xa9ac('0x54')][_0xa9ac('0x40')](_0x560962);}})[_0xa9ac('0x23')](function(_0x3d8a0e){if(_0x3d8a0e){return db[_0xa9ac('0x58')][_0xa9ac('0x59')]({'where':{'id':_[_0xa9ac('0x2e')](_0x3d8a0e,_0xa9ac('0x5a')),'role':_0xa9ac('0x5b')},'attributes':['id',_0xa9ac('0x2b'),_0xa9ac('0x5c'),'updatedAt',_0xa9ac('0x5d')]});}})[_0xa9ac('0x23')](function(_0xdc2115){if(_0xdc2115){return{'count':_0xdc2115['count'],'rows':_[_0xa9ac('0x2e')](_0xdc2115['rows'],function(_0x3fa3fa){return{'membername':_0x3fa3fa[_0xa9ac('0x2b')],'UserId':_0x3fa3fa['id'],'queue_name':_0x58469f['name'],'MailQueueId':_0x58469f['id'],'interface':util[_0xa9ac('0x5e')](_0xa9ac('0x5f'),_0xa9ac('0x60'),_0x3fa3fa['name']),'penalty':0x0,'paused':_0x3fa3fa[_0xa9ac('0x5c')],'createdAt':_0x3fa3fa[_0xa9ac('0x5d')],'updatedAt':_0x3fa3fa[_0xa9ac('0x61')]};})};}else{return{'count':0x0,'rows':[]};}})[_0xa9ac('0x23')](respondWithFilteredResult(_0x3f3600,_0x560962))['catch'](handleError(_0x3f3600,null));};exports['getTeams']=function(_0x1e23d6,_0x1558d0,_0x3a0492){var _0x5db8de={};var _0x17a6ad={};var _0x308b0e;var _0x3ae9f1;return db[_0xa9ac('0x3e')]['findOne']({'where':{'id':_0x1e23d6[_0xa9ac('0x44')]['id']}})['then'](handleEntityNotFound(_0x1558d0,null))[_0xa9ac('0x23')](function(_0x2b7f29){if(_0x2b7f29){_0x308b0e=_0x2b7f29;_0x17a6ad[_0xa9ac('0x2f')]=_['keys'](db['Team'][_0xa9ac('0x45')]);_0x17a6ad[_0xa9ac('0x30')]=_['keys'](_0x1e23d6['query']);_0x17a6ad['filters']=_['intersection'](_0x17a6ad['model'],_0x17a6ad[_0xa9ac('0x30')]);_0x5db8de['attributes']=_['intersection'](_0x17a6ad[_0xa9ac('0x2f')],qs['fields'](_0x1e23d6[_0xa9ac('0x30')][_0xa9ac('0x35')]));_0x5db8de[_0xa9ac('0x33')]=_0x5db8de[_0xa9ac('0x33')][_0xa9ac('0x46')]?_0x5db8de[_0xa9ac('0x33')]:_0x17a6ad['model'];_0x5db8de[_0xa9ac('0x38')]=qs[_0xa9ac('0x39')](_0x1e23d6[_0xa9ac('0x30')]['sort']);_0x5db8de['where']=qs['filters'](_[_0xa9ac('0x55')](_0x1e23d6[_0xa9ac('0x30')],_0x17a6ad[_0xa9ac('0x32')]));if(_0x1e23d6[_0xa9ac('0x30')][_0xa9ac('0x3c')]){_0x5db8de[_0xa9ac('0x3a')]=_[_0xa9ac('0x57')](_0x5db8de['where'],{'$or':_[_0xa9ac('0x2e')](_0x5db8de['attributes'],function(_0x48f28d){var _0x1eec20={};_0x1eec20[_0x48f28d]={'$like':'%'+_0x1e23d6['query']['filter']+'%'};return _0x1eec20;})});}_0x5db8de=_[_0xa9ac('0x57')]({},_0x5db8de,_0x1e23d6[_0xa9ac('0x3d')]);return _0x308b0e[_0xa9ac('0x62')](_0x5db8de);}})['then'](function(_0x75740a){if(_0x75740a){_0x3ae9f1=_0x75740a[_0xa9ac('0x46')];if(!_0x1e23d6[_0xa9ac('0x30')]['hasOwnProperty'](_0xa9ac('0x37'))){_0x5db8de[_0xa9ac('0x1b')]=qs[_0xa9ac('0x1b')](_0x1e23d6[_0xa9ac('0x30')][_0xa9ac('0x1b')]);_0x5db8de[_0xa9ac('0x1a')]=qs['offset'](_0x1e23d6[_0xa9ac('0x30')]['offset']);}return _0x308b0e[_0xa9ac('0x62')](_0x5db8de);}})[_0xa9ac('0x23')](function(_0xb90afd){if(_0xb90afd){return _0xb90afd?{'count':_0x3ae9f1,'rows':_0xb90afd}:null;}})[_0xa9ac('0x23')](respondWithResult(_0x1558d0,null))[_0xa9ac('0x42')](handleError(_0x1558d0,null));};exports[_0xa9ac('0x63')]=function(_0x23ae5b,_0x989997,_0x2107f1){var _0x163ba5=_0x23ae5b['body'][_0xa9ac('0x64')];return db[_0xa9ac('0x65')][_0xa9ac('0x40')]({'where':{'id':_0x163ba5},'attributes':['id'],'include':[{'model':db[_0xa9ac('0x58')],'as':'Agents','attributes':['id',_0xa9ac('0x2b'),_0xa9ac('0x66'),_0xa9ac('0x67'),_0xa9ac('0x68')],'raw':!![]}]})['then'](function(_0x5d1f8d){if(_0x5d1f8d){var _0x4f63dc=_[_0xa9ac('0x69')](_0x5d1f8d,function(_0x3ea7f1){var _0x6ffbf7=_0x3ea7f1[_0xa9ac('0x24')]({'plain':!![]});return _0x6ffbf7[_0xa9ac('0x6a')];});return db[_0xa9ac('0x3e')][_0xa9ac('0x48')]({'where':{'id':_0x23ae5b['params']['id']}})['then'](function(_0xbb3853){return db[_0xa9ac('0x6b')][_0xa9ac('0x6c')](function(_0x3c13ba){return _0xbb3853['addTeams'](_0x163ba5,{'transaction':_0x3c13ba})['then'](function(){return BPromise['each'](_0x4f63dc,function(_0x369193){return db[_0xa9ac('0x54')][_0xa9ac('0x6d')]({'where':{'UserId':_0x369193['id'],'MailQueueId':_0x23ae5b[_0xa9ac('0x44')]['id']},'transaction':_0x3c13ba});});})[_0xa9ac('0x23')](function(){_0x4f63dc[_0xa9ac('0x6e')](function(_0x6f1ee5){socket[_0xa9ac('0x6f')](_0xa9ac('0x70'),{'UserId':_0x6f1ee5['id'],'MailQueueId':_0xbb3853['id']});});});});});}})[_0xa9ac('0x23')](respondWithStatusCode(_0x989997,null))[_0xa9ac('0x42')](handleError(_0x989997,null));};exports[_0xa9ac('0x71')]=function(_0x146def,_0x170d4e,_0x40acd0){return db['Team'][_0xa9ac('0x40')]({'where':{'id':_0x146def[_0xa9ac('0x30')][_0xa9ac('0x64')]},'attributes':['id'],'include':[{'model':db['User'],'as':_0xa9ac('0x6a'),'attributes':['id'],'raw':!![]}]})[_0xa9ac('0x23')](handleEntityNotFound(_0x170d4e,null))['then'](function(_0x46d8a2){var _0xd4847c=_[_0xa9ac('0x2e')](_0x46d8a2,'id');var _0x3b0af4=[];var _0x396f6e=[];var _0xb8e832=squel[_0xa9ac('0x72')]();_0xb8e832['field'](_0xa9ac('0x73'))[_0xa9ac('0x74')](_0xa9ac('0x75'),'tq')[_0xa9ac('0x76')](_0xa9ac('0x77'),'ut',_0xa9ac('0x78'))[_0xa9ac('0x3a')](_0xa9ac('0x79'),_0x146def[_0xa9ac('0x44')]['id']);for(var _0x448c0e=0x0;_0x448c0e<_0x46d8a2[_0xa9ac('0x46')];_0x448c0e+=0x1){let _0x422468=_0x46d8a2[_0x448c0e];for(var _0x2f63a4=0x0;_0x2f63a4<_0x422468[_0xa9ac('0x6a')][_0xa9ac('0x46')];_0x2f63a4+=0x1){let _0x324f7e=_0x422468[_0xa9ac('0x6a')][_0x2f63a4];var _0x5c3650=_0xb8e832['clone']();_0x5c3650[_0xa9ac('0x3a')]('ut.UserId\x20=\x20?',_0x324f7e['id']);_0x396f6e[_0xa9ac('0x7a')](db[_0xa9ac('0x6b')][_0xa9ac('0x30')](_0x5c3650[_0xa9ac('0x7b')](),{'type':db[_0xa9ac('0x6b')]['QueryTypes'][_0xa9ac('0x7c')]})['then'](function(_0x4f25fc){if(_0x4f25fc[_0xa9ac('0x46')]===0x1){return _0x324f7e['id'];}else{var _0x40d0aa=_[_0xa9ac('0x7d')](_[_0xa9ac('0x2e')](_0x4f25fc,_0xa9ac('0x7e')),function(_0x33d354){return _['includes'](_0xd4847c,_0x33d354);});if(_0x40d0aa){return _0x324f7e['id'];}}}));}}return BPromise[_0xa9ac('0x7f')](_0x396f6e)[_0xa9ac('0x23')](function(_0x1187f1){_0x3b0af4=_(_0x3b0af4)[_0xa9ac('0x80')](_0x1187f1)['compact']()[_0xa9ac('0x81')]();return db[_0xa9ac('0x3e')][_0xa9ac('0x48')]({'where':{'id':_0x146def[_0xa9ac('0x44')]['id']}})[_0xa9ac('0x23')](function(_0x3a954e){return db[_0xa9ac('0x6b')][_0xa9ac('0x6c')](function(_0x293992){return _0x3a954e['removeTeams'](_0x146def['query']['ids'],{'transaction':_0x293992})[_0xa9ac('0x23')](function(){if(!_[_0xa9ac('0x82')](_0x3b0af4)){return _0x3a954e[_0xa9ac('0x83')](_0x3b0af4,{'transaction':_0x293992});}})['then'](function(){_0x3b0af4[_0xa9ac('0x6e')](function(_0x4e3b7e){socket['emit'](_0xa9ac('0x84'),{'UserId':_0x4e3b7e,'MailQueueId':_0x3a954e['id']});});});});});});})[_0xa9ac('0x23')](respondWithStatusCode(_0x170d4e,null))[_0xa9ac('0x42')](handleError(_0x170d4e,null));};exports[_0xa9ac('0x85')]=function(_0x23e050,_0x1b1523,_0x403168){return db['MailQueue'][_0xa9ac('0x48')]({'where':{'id':_0x23e050[_0xa9ac('0x44')]['id']}})[_0xa9ac('0x23')](handleEntityNotFound(_0x1b1523,null))['then'](function(_0x45f349){if(_0x45f349){return _0x45f349[_0xa9ac('0x85')](_0x23e050[_0xa9ac('0x50')]['ids'],_[_0xa9ac('0x86')](_0x23e050[_0xa9ac('0x50')],[_0xa9ac('0x64'),'id'])||{})[_0xa9ac('0x87')](function(_0x1b99b3){for(var _0x12633a=0x0;_0x12633a<_0x23e050[_0xa9ac('0x50')][_0xa9ac('0x64')][_0xa9ac('0x46')];_0x12633a+=0x1){socket['emit']('userMailQueue:save',{'UserId':_0x23e050['body'][_0xa9ac('0x64')][_0x12633a],'MailQueueId':_0x23e050[_0xa9ac('0x44')]['id']});}return _0x1b99b3;});}})[_0xa9ac('0x23')](respondWithResult(_0x1b1523,null))['catch'](handleError(_0x1b1523,null));};exports[_0xa9ac('0x83')]=function(_0x3852cd,_0x13f350,_0x59ca37){return db[_0xa9ac('0x3e')][_0xa9ac('0x48')]({'where':{'id':_0x3852cd[_0xa9ac('0x44')]['id']}})['then'](handleEntityNotFound(_0x13f350,null))[_0xa9ac('0x23')](function(_0x21466e){if(_0x21466e){return _0x21466e['removeAgents'](_0x3852cd[_0xa9ac('0x30')][_0xa9ac('0x64')])[_0xa9ac('0x23')](function(){if(_[_0xa9ac('0x88')](_0x3852cd['query'][_0xa9ac('0x64')])){for(var _0x54da49=0x0;_0x54da49<_0x3852cd[_0xa9ac('0x30')][_0xa9ac('0x64')][_0xa9ac('0x46')];_0x54da49+=0x1){socket[_0xa9ac('0x6f')](_0xa9ac('0x84'),{'UserId':Number(_0x3852cd[_0xa9ac('0x30')]['ids'][_0x54da49]),'MailQueueId':Number(_0x3852cd[_0xa9ac('0x44')]['id'])});}}else{socket[_0xa9ac('0x6f')](_0xa9ac('0x84'),{'UserId':Number(_0x3852cd[_0xa9ac('0x30')][_0xa9ac('0x64')]),'MailQueueId':Number(_0x3852cd['params']['id'])});}});}})[_0xa9ac('0x23')](respondWithStatusCode(_0x13f350,null))[_0xa9ac('0x42')](handleError(_0x13f350,null));};exports[_0xa9ac('0x89')]=function(_0x234509,_0x57ea3b,_0x25074f){var _0x1dd1b0={};var _0x53ecfe={};var _0x4c7217;var _0x360c55;return db[_0xa9ac('0x3e')][_0xa9ac('0x53')]({'where':{'id':_0x234509[_0xa9ac('0x44')]['id']}})['then'](handleEntityNotFound(_0x57ea3b,null))['then'](function(_0x195dec){if(_0x195dec){_0x4c7217=_0x195dec;_0x53ecfe[_0xa9ac('0x2f')]=_['keys'](db[_0xa9ac('0x58')]['rawAttributes']);_0x53ecfe[_0xa9ac('0x30')]=_['keys'](_0x234509[_0xa9ac('0x30')]);_0x53ecfe[_0xa9ac('0x32')]=_['intersection'](_0x53ecfe['model'],_0x53ecfe[_0xa9ac('0x30')]);_0x1dd1b0[_0xa9ac('0x33')]=_[_0xa9ac('0x34')](_0x53ecfe[_0xa9ac('0x2f')],qs['fields'](_0x234509[_0xa9ac('0x30')][_0xa9ac('0x35')]));_0x1dd1b0[_0xa9ac('0x33')]=_0x1dd1b0[_0xa9ac('0x33')][_0xa9ac('0x46')]?_0x1dd1b0[_0xa9ac('0x33')]:_0x53ecfe[_0xa9ac('0x2f')];_0x1dd1b0[_0xa9ac('0x38')]=qs[_0xa9ac('0x39')](_0x234509[_0xa9ac('0x30')][_0xa9ac('0x39')]);_0x1dd1b0[_0xa9ac('0x3a')]=qs[_0xa9ac('0x32')](_[_0xa9ac('0x55')](_0x234509[_0xa9ac('0x30')],_0x53ecfe['filters']));if(_0x234509[_0xa9ac('0x30')][_0xa9ac('0x3c')]){_0x1dd1b0[_0xa9ac('0x3a')]=_[_0xa9ac('0x57')](_0x1dd1b0[_0xa9ac('0x3a')],{'$or':_['map'](_0x1dd1b0['attributes'],function(_0x4227cf){var _0x23e5d9={};_0x23e5d9[_0x4227cf]={'$like':'%'+_0x234509['query']['filter']+'%'};return _0x23e5d9;})});}_0x1dd1b0=_[_0xa9ac('0x57')]({},_0x1dd1b0,_0x234509[_0xa9ac('0x3d')]);return _0x4c7217[_0xa9ac('0x89')](_0x1dd1b0);}})['then'](function(_0x4aa450){if(_0x4aa450){_0x360c55=_0x4aa450[_0xa9ac('0x46')];if(!_0x234509[_0xa9ac('0x30')][_0xa9ac('0x36')](_0xa9ac('0x37'))){_0x1dd1b0[_0xa9ac('0x1b')]=qs[_0xa9ac('0x1b')](_0x234509[_0xa9ac('0x30')][_0xa9ac('0x1b')]);_0x1dd1b0[_0xa9ac('0x1a')]=qs[_0xa9ac('0x1a')](_0x234509[_0xa9ac('0x30')][_0xa9ac('0x1a')]);}return _0x4c7217[_0xa9ac('0x89')](_0x1dd1b0);}})[_0xa9ac('0x23')](function(_0x32bd62){if(_0x32bd62){return _0x32bd62?{'count':_0x360c55,'rows':_0x32bd62}:null;}})[_0xa9ac('0x23')](respondWithResult(_0x57ea3b,null))['catch'](handleError(_0x57ea3b,null));};
\ No newline at end of file
+var _0xa72a=['count','offset','limit','set','Content-Range','update','then','get','MailQueues','UserProfileResource','error','name','index','map','fieldName','type','model','query','keys','intersection','attributes','fields','length','hasOwnProperty','order','sort','where','filters','pick','filter','merge','MailQueue','includeAll','include','findAll','rows','show','params','rawAttributes','options','find','catch','create','body','user','Unable\x20to\x20retrieve\x20the\x20current\x20user','role','UserProfileSection','userProfileId','autoAssociation','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','describe','getMembers','findOne','UserMailQueue','nolimit','MailQueueId','User','UserId','mailPause','format','%s/%s','SIP','createdAt','updatedAt','getTeams','Team','addTeams','ids','Agents','online','interface','flatMap','sequelize','transaction','findOrCreate','forEach','select','field','team_has_mail_queues','user_has_teams','ut.TeamId\x20=\x20tq.TeamId','ut.UserId\x20=\x20?','push','toString','QueryTypes','SELECT','every','includes','all','compact','value','isEmpty','emit','addAgents','omit','userMailQueue:save','removeAgents','userMailQueue:remove','getAgents','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','moment','mustache','util','path','lodash','crypto','jsforce','desk.js','to-csv','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/environment','../../mysqldb','redis','defaults','socket.io-emitter','./mailQueue.socket','register','sendStatus','status','end','json'];(function(_0x4565bf,_0x5ad9d6){var _0x5610ba=function(_0x170988){while(--_0x170988){_0x4565bf['push'](_0x4565bf['shift']());}};_0x5610ba(++_0x5ad9d6);}(_0xa72a,0x64));var _0xaa72=function(_0x34a118,_0xbff87c){_0x34a118=_0x34a118-0x0;var _0x18f5ed=_0xa72a[_0x34a118];return _0x18f5ed;};'use strict';var pdf=require('html-pdf');var emlformat=require(_0xaa72('0x0'));var rimraf=require(_0xaa72('0x1'));var zipdir=require(_0xaa72('0x2'));var jsonpatch=require(_0xaa72('0x3'));var rp=require(_0xaa72('0x4'));var moment=require(_0xaa72('0x5'));var BPromise=require('bluebird');var Mustache=require(_0xaa72('0x6'));var util=require(_0xaa72('0x7'));var path=require(_0xaa72('0x8'));var sox=require('sox');var csv=require('to-csv');var ejs=require('ejs');var fs=require('fs');var _=require(_0xaa72('0x9'));var squel=require('squel');var crypto=require(_0xaa72('0xa'));var jsforce=require(_0xaa72('0xb'));var deskjs=require(_0xaa72('0xc'));var toCsv=require(_0xaa72('0xd'));var querystring=require(_0xaa72('0xe'));var Papa=require(_0xaa72('0xf'));var Redis=require(_0xaa72('0x10'));var authService=require(_0xaa72('0x11'));var qs=require(_0xaa72('0x12'));var as=require('../../components/parsers/advancedSearch');var hardwareService=require(_0xaa72('0x13'));var logger=require(_0xaa72('0x14'))(_0xaa72('0x15'));var utils=require(_0xaa72('0x16'));var config=require(_0xaa72('0x17'));var db=require(_0xaa72('0x18'))['db'];config[_0xaa72('0x19')]=_[_0xaa72('0x1a')](config[_0xaa72('0x19')],{'host':'localhost','port':0x18eb});var socket=require(_0xaa72('0x1b'))(new Redis(config[_0xaa72('0x19')]));require(_0xaa72('0x1c'))[_0xaa72('0x1d')](socket);function respondWithStatusCode(_0xafe60d,_0x388746){_0x388746=_0x388746||0xcc;return function(_0x1be1eb){if(_0x1be1eb){return _0xafe60d[_0xaa72('0x1e')](_0x388746);}return _0xafe60d[_0xaa72('0x1f')](_0x388746)[_0xaa72('0x20')]();};}function respondWithResult(_0x25a368,_0x4219ca){_0x4219ca=_0x4219ca||0xc8;return function(_0x1e22ac){if(_0x1e22ac){return _0x25a368[_0xaa72('0x1f')](_0x4219ca)[_0xaa72('0x21')](_0x1e22ac);}};}function respondWithFilteredResult(_0x379e23,_0x47b0ba){return function(_0xa0c7ab){if(_0xa0c7ab){var _0x3aa958=_0xa0c7ab[_0xaa72('0x22')],_0x214a98=_0x47b0ba[_0xaa72('0x23')],_0x1c70aa=_0x47b0ba['offset']+_0x47b0ba[_0xaa72('0x24')],_0x4bb837;if(_0x1c70aa>=_0x3aa958){_0x1c70aa=_0x3aa958;_0x4bb837=0xc8;}else{_0x4bb837=0xce;}_0x379e23[_0xaa72('0x1f')](_0x4bb837);return _0x379e23[_0xaa72('0x25')](_0xaa72('0x26'),_0x214a98+'-'+_0x1c70aa+'/'+_0x3aa958)['json'](_0xa0c7ab);}return null;};}function patchUpdates(_0x16caa2){return function(_0x516dc2){try{jsonpatch['apply'](_0x516dc2,_0x16caa2,!![]);}catch(_0x292144){return BPromise['reject'](_0x292144);}return _0x516dc2['save']();};}function saveUpdates(_0x167852,_0x51a4fa){return function(_0x28f5f0){if(_0x28f5f0){return _0x28f5f0[_0xaa72('0x27')](_0x167852)['then'](function(_0x443cc9){return _0x443cc9;});}return null;};}function removeEntity(_0x2f1a5f,_0xc86fff){return function(_0x68dd91){if(_0x68dd91){return _0x68dd91['destroy']()[_0xaa72('0x28')](function(){var _0x4f6290=_0x68dd91[_0xaa72('0x29')]({'plain':!![]});var _0x4b78e4=_0xaa72('0x2a');return db[_0xaa72('0x2b')]['destroy']({'where':{'type':_0x4b78e4,'resourceId':_0x4f6290['id']}})['then'](function(){return _0x68dd91;});})[_0xaa72('0x28')](function(){_0x2f1a5f[_0xaa72('0x1f')](0xcc)[_0xaa72('0x20')]();});}};}function handleEntityNotFound(_0x257c1b,_0x128b29){return function(_0xeae25b){if(!_0xeae25b){_0x257c1b[_0xaa72('0x1e')](0x194);}return _0xeae25b;};}function handleError(_0x2e5e18,_0x5aa443){_0x5aa443=_0x5aa443||0x1f4;return function(_0x16c485){logger[_0xaa72('0x2c')](_0x16c485['stack']);if(_0x16c485[_0xaa72('0x2d')]){delete _0x16c485[_0xaa72('0x2d')];}_0x2e5e18[_0xaa72('0x1f')](_0x5aa443)['send'](_0x16c485);};}exports[_0xaa72('0x2e')]=function(_0x54494a,_0xd77db9){var _0x461766={},_0x2690a5={},_0x43d9d={'count':0x0,'rows':[]};var _0x1484a0=_[_0xaa72('0x2f')](db['MailQueue']['rawAttributes'],function(_0x2b23ad){return{'name':_0x2b23ad[_0xaa72('0x30')],'type':_0x2b23ad[_0xaa72('0x31')]['key']};});_0x2690a5[_0xaa72('0x32')]=_[_0xaa72('0x2f')](_0x1484a0,_0xaa72('0x2d'));_0x2690a5[_0xaa72('0x33')]=_[_0xaa72('0x34')](_0x54494a[_0xaa72('0x33')]);_0x2690a5['filters']=_[_0xaa72('0x35')](_0x2690a5['model'],_0x2690a5['query']);_0x461766[_0xaa72('0x36')]=_[_0xaa72('0x35')](_0x2690a5['model'],qs[_0xaa72('0x37')](_0x54494a[_0xaa72('0x33')]['fields']));_0x461766[_0xaa72('0x36')]=_0x461766[_0xaa72('0x36')][_0xaa72('0x38')]?_0x461766[_0xaa72('0x36')]:_0x2690a5['model'];if(!_0x54494a[_0xaa72('0x33')][_0xaa72('0x39')]('nolimit')){_0x461766['limit']=qs[_0xaa72('0x24')](_0x54494a[_0xaa72('0x33')][_0xaa72('0x24')]);_0x461766['offset']=qs[_0xaa72('0x23')](_0x54494a[_0xaa72('0x33')][_0xaa72('0x23')]);}_0x461766[_0xaa72('0x3a')]=qs[_0xaa72('0x3b')](_0x54494a[_0xaa72('0x33')][_0xaa72('0x3b')]);_0x461766[_0xaa72('0x3c')]=qs[_0xaa72('0x3d')](_[_0xaa72('0x3e')](_0x54494a['query'],_0x2690a5[_0xaa72('0x3d')]));if(_0x54494a[_0xaa72('0x33')][_0xaa72('0x3f')]){_0x461766[_0xaa72('0x3c')]=_[_0xaa72('0x40')](_0x461766[_0xaa72('0x3c')],{'$or':_['map'](_0x1484a0,function(_0x2382b8){if(_0x2382b8[_0xaa72('0x31')]!=='VIRTUAL'){var _0x1043ca={};_0x1043ca[_0x2382b8[_0xaa72('0x2d')]]={'$like':'%'+_0x54494a[_0xaa72('0x33')][_0xaa72('0x3f')]+'%'};return _0x1043ca;}})});}_0x461766=_[_0xaa72('0x40')]({},_0x461766,_0x54494a['options']);var _0x37acf4={'where':_0x461766[_0xaa72('0x3c')]};return db[_0xaa72('0x41')]['count'](_0x37acf4)[_0xaa72('0x28')](function(_0x442d6d){_0x43d9d[_0xaa72('0x22')]=_0x442d6d;if(_0x54494a['query'][_0xaa72('0x42')]){_0x461766[_0xaa72('0x43')]=[{'all':!![]}];}return db[_0xaa72('0x41')][_0xaa72('0x44')](_0x461766);})[_0xaa72('0x28')](function(_0x1580dc){_0x43d9d[_0xaa72('0x45')]=_0x1580dc;return _0x43d9d;})[_0xaa72('0x28')](respondWithFilteredResult(_0xd77db9,_0x461766))['catch'](handleError(_0xd77db9,null));};exports[_0xaa72('0x46')]=function(_0xeb8539,_0x5033c3){var _0x804204={'raw':!![],'where':{'id':_0xeb8539[_0xaa72('0x47')]['id']}},_0x3d42bc={};_0x3d42bc[_0xaa72('0x32')]=_['keys'](db[_0xaa72('0x41')][_0xaa72('0x48')]);_0x3d42bc[_0xaa72('0x33')]=_[_0xaa72('0x34')](_0xeb8539[_0xaa72('0x33')]);_0x3d42bc['filters']=_[_0xaa72('0x35')](_0x3d42bc[_0xaa72('0x32')],_0x3d42bc[_0xaa72('0x33')]);_0x804204['attributes']=_[_0xaa72('0x35')](_0x3d42bc['model'],qs[_0xaa72('0x37')](_0xeb8539['query'][_0xaa72('0x37')]));_0x804204[_0xaa72('0x36')]=_0x804204[_0xaa72('0x36')][_0xaa72('0x38')]?_0x804204[_0xaa72('0x36')]:_0x3d42bc[_0xaa72('0x32')];if(_0xeb8539[_0xaa72('0x33')][_0xaa72('0x42')]){_0x804204[_0xaa72('0x43')]=[{'all':!![]}];}_0x804204=_[_0xaa72('0x40')]({},_0x804204,_0xeb8539[_0xaa72('0x49')]);return db[_0xaa72('0x41')][_0xaa72('0x4a')](_0x804204)[_0xaa72('0x28')](handleEntityNotFound(_0x5033c3,null))[_0xaa72('0x28')](respondWithResult(_0x5033c3,null))[_0xaa72('0x4b')](handleError(_0x5033c3,null));};exports[_0xaa72('0x4c')]=function(_0x289032,_0x1ed446){return db[_0xaa72('0x41')][_0xaa72('0x4c')](_0x289032[_0xaa72('0x4d')],{})[_0xaa72('0x28')](function(_0x4cefec){var _0x7a6437=_0x289032[_0xaa72('0x4e')][_0xaa72('0x29')]({'plain':!![]});if(!_0x7a6437)throw new Error(_0xaa72('0x4f'));if(_0x7a6437[_0xaa72('0x50')]===_0xaa72('0x4e')){var _0x5a8b7a=_0x4cefec['get']({'plain':!![]});var _0x4dd681=_0xaa72('0x2a');return db[_0xaa72('0x51')][_0xaa72('0x4a')]({'where':{'name':_0x4dd681,'userProfileId':_0x7a6437[_0xaa72('0x52')]},'raw':!![]})[_0xaa72('0x28')](function(_0x2db32b){if(_0x2db32b&&_0x2db32b[_0xaa72('0x53')]===0x0){return db[_0xaa72('0x2b')][_0xaa72('0x4c')]({'name':_0x5a8b7a[_0xaa72('0x2d')],'resourceId':_0x5a8b7a['id'],'type':_0x2db32b[_0xaa72('0x2d')],'sectionId':_0x2db32b['id']},{})[_0xaa72('0x28')](function(){return _0x4cefec;});}else{return _0x4cefec;}})[_0xaa72('0x4b')](function(_0x49dc85){logger[_0xaa72('0x2c')](_0xaa72('0x54'),_0x49dc85);throw _0x49dc85;});}return _0x4cefec;})[_0xaa72('0x28')](respondWithResult(_0x1ed446,0xc9))[_0xaa72('0x4b')](handleError(_0x1ed446,null));};exports['update']=function(_0x1053eb,_0xb6fb0){if(_0x1053eb['body']['id']){delete _0x1053eb[_0xaa72('0x4d')]['id'];}return db[_0xaa72('0x41')][_0xaa72('0x4a')]({'where':{'id':_0x1053eb[_0xaa72('0x47')]['id']}})[_0xaa72('0x28')](handleEntityNotFound(_0xb6fb0,null))[_0xaa72('0x28')](saveUpdates(_0x1053eb[_0xaa72('0x4d')],null))[_0xaa72('0x28')](respondWithResult(_0xb6fb0,null))[_0xaa72('0x4b')](handleError(_0xb6fb0,null));};exports['destroy']=function(_0x27288b,_0x12d609){return db['MailQueue'][_0xaa72('0x4a')]({'where':{'id':_0x27288b[_0xaa72('0x47')]['id']}})[_0xaa72('0x28')](handleEntityNotFound(_0x12d609,null))[_0xaa72('0x28')](removeEntity(_0x12d609,null))['catch'](handleError(_0x12d609,null));};exports[_0xaa72('0x55')]=function(_0x9bcd1a,_0x3de688){return db[_0xaa72('0x41')][_0xaa72('0x55')]()['then'](respondWithResult(_0x3de688,null))[_0xaa72('0x4b')](handleError(_0x3de688,null));};exports[_0xaa72('0x56')]=function(_0x286ef2,_0x333957,_0x322b48){var _0x585cb5={'raw':!![],'where':{}},_0x218beb={},_0x1d6b5b;return db['MailQueue'][_0xaa72('0x57')]({'where':{'id':_0x286ef2[_0xaa72('0x47')]['id']}})['then'](handleEntityNotFound(_0x333957,null))[_0xaa72('0x28')](function(_0x41019e){if(_0x41019e){_0x1d6b5b=_0x41019e[_0xaa72('0x29')]({'plain':!![]});_0x218beb['model']=_[_0xaa72('0x34')](db[_0xaa72('0x58')][_0xaa72('0x48')]);_0x218beb[_0xaa72('0x33')]=_[_0xaa72('0x34')](_0x286ef2[_0xaa72('0x33')]);_0x218beb['filters']=_['intersection'](_0x218beb[_0xaa72('0x32')],_0x218beb[_0xaa72('0x33')]);_0x585cb5[_0xaa72('0x36')]=_[_0xaa72('0x35')](_0x218beb[_0xaa72('0x32')],qs[_0xaa72('0x37')](_0x286ef2[_0xaa72('0x33')][_0xaa72('0x37')]));_0x585cb5[_0xaa72('0x36')]=_0x585cb5[_0xaa72('0x36')]['length']?_0x585cb5[_0xaa72('0x36')]:_0x218beb[_0xaa72('0x32')];if(!_0x286ef2[_0xaa72('0x33')][_0xaa72('0x39')](_0xaa72('0x59'))){_0x585cb5[_0xaa72('0x24')]=qs[_0xaa72('0x24')](_0x286ef2[_0xaa72('0x33')][_0xaa72('0x24')]);_0x585cb5['offset']=qs['offset'](_0x286ef2[_0xaa72('0x33')][_0xaa72('0x23')]);}_0x585cb5[_0xaa72('0x3a')]=qs['sort'](_0x286ef2[_0xaa72('0x33')][_0xaa72('0x3b')]);_0x585cb5[_0xaa72('0x3c')]=qs[_0xaa72('0x3d')](_[_0xaa72('0x3e')](_0x286ef2[_0xaa72('0x33')],_0x218beb[_0xaa72('0x3d')]));_0x585cb5[_0xaa72('0x3c')][_0xaa72('0x5a')]=_0x41019e['id'];if(_0x286ef2[_0xaa72('0x33')][_0xaa72('0x3f')]){_0x585cb5['where']=_[_0xaa72('0x40')](_0x585cb5['where'],{'$or':_[_0xaa72('0x2f')](_0x585cb5['attributes'],function(_0x24ba48){var _0x2524f0={};_0x2524f0[_0x24ba48]={'$like':'%'+_0x286ef2[_0xaa72('0x33')]['filter']+'%'};return _0x2524f0;})});}_0x585cb5=_[_0xaa72('0x40')]({},_0x585cb5,_0x286ef2[_0xaa72('0x49')]);return db['UserMailQueue'][_0xaa72('0x44')](_0x585cb5);}})['then'](function(_0x583ca3){if(_0x583ca3){return db[_0xaa72('0x5b')]['findAndCountAll']({'where':{'id':_[_0xaa72('0x2f')](_0x583ca3,_0xaa72('0x5c')),'role':'agent'},'attributes':['id',_0xaa72('0x2d'),_0xaa72('0x5d'),'updatedAt','createdAt']});}})[_0xaa72('0x28')](function(_0x5ece51){if(_0x5ece51){return{'count':_0x5ece51[_0xaa72('0x22')],'rows':_[_0xaa72('0x2f')](_0x5ece51[_0xaa72('0x45')],function(_0x1db21d){return{'membername':_0x1db21d[_0xaa72('0x2d')],'UserId':_0x1db21d['id'],'queue_name':_0x1d6b5b[_0xaa72('0x2d')],'MailQueueId':_0x1d6b5b['id'],'interface':util[_0xaa72('0x5e')](_0xaa72('0x5f'),_0xaa72('0x60'),_0x1db21d['name']),'penalty':0x0,'paused':_0x1db21d[_0xaa72('0x5d')],'createdAt':_0x1db21d[_0xaa72('0x61')],'updatedAt':_0x1db21d[_0xaa72('0x62')]};})};}else{return{'count':0x0,'rows':[]};}})['then'](respondWithFilteredResult(_0x333957,_0x585cb5))['catch'](handleError(_0x333957,null));};exports[_0xaa72('0x63')]=function(_0x1f1218,_0x258a19,_0x2fed32){var _0x3b5b9a={};var _0xbb99bd={};var _0x3252e3;var _0x1f0d4d;return db[_0xaa72('0x41')][_0xaa72('0x57')]({'where':{'id':_0x1f1218[_0xaa72('0x47')]['id']}})[_0xaa72('0x28')](handleEntityNotFound(_0x258a19,null))[_0xaa72('0x28')](function(_0x4d50a3){if(_0x4d50a3){_0x3252e3=_0x4d50a3;_0xbb99bd[_0xaa72('0x32')]=_[_0xaa72('0x34')](db[_0xaa72('0x64')][_0xaa72('0x48')]);_0xbb99bd[_0xaa72('0x33')]=_[_0xaa72('0x34')](_0x1f1218[_0xaa72('0x33')]);_0xbb99bd[_0xaa72('0x3d')]=_[_0xaa72('0x35')](_0xbb99bd[_0xaa72('0x32')],_0xbb99bd['query']);_0x3b5b9a['attributes']=_[_0xaa72('0x35')](_0xbb99bd[_0xaa72('0x32')],qs[_0xaa72('0x37')](_0x1f1218[_0xaa72('0x33')][_0xaa72('0x37')]));_0x3b5b9a[_0xaa72('0x36')]=_0x3b5b9a[_0xaa72('0x36')]['length']?_0x3b5b9a[_0xaa72('0x36')]:_0xbb99bd['model'];_0x3b5b9a[_0xaa72('0x3a')]=qs['sort'](_0x1f1218[_0xaa72('0x33')]['sort']);_0x3b5b9a[_0xaa72('0x3c')]=qs[_0xaa72('0x3d')](_[_0xaa72('0x3e')](_0x1f1218['query'],_0xbb99bd['filters']));if(_0x1f1218[_0xaa72('0x33')][_0xaa72('0x3f')]){_0x3b5b9a[_0xaa72('0x3c')]=_['merge'](_0x3b5b9a[_0xaa72('0x3c')],{'$or':_[_0xaa72('0x2f')](_0x3b5b9a[_0xaa72('0x36')],function(_0xa94063){var _0x1ace1d={};_0x1ace1d[_0xa94063]={'$like':'%'+_0x1f1218[_0xaa72('0x33')][_0xaa72('0x3f')]+'%'};return _0x1ace1d;})});}_0x3b5b9a=_[_0xaa72('0x40')]({},_0x3b5b9a,_0x1f1218['options']);return _0x3252e3[_0xaa72('0x63')](_0x3b5b9a);}})[_0xaa72('0x28')](function(_0x3fd508){if(_0x3fd508){_0x1f0d4d=_0x3fd508[_0xaa72('0x38')];if(!_0x1f1218['query']['hasOwnProperty'](_0xaa72('0x59'))){_0x3b5b9a[_0xaa72('0x24')]=qs['limit'](_0x1f1218['query'][_0xaa72('0x24')]);_0x3b5b9a['offset']=qs[_0xaa72('0x23')](_0x1f1218[_0xaa72('0x33')]['offset']);}return _0x3252e3[_0xaa72('0x63')](_0x3b5b9a);}})[_0xaa72('0x28')](function(_0x218eb9){if(_0x218eb9){return _0x218eb9?{'count':_0x1f0d4d,'rows':_0x218eb9}:null;}})[_0xaa72('0x28')](respondWithResult(_0x258a19,null))['catch'](handleError(_0x258a19,null));};exports[_0xaa72('0x65')]=function(_0x3e0092,_0x4b3bd0,_0x16e5c1){var _0x4a0575=_0x3e0092[_0xaa72('0x4d')][_0xaa72('0x66')];return db[_0xaa72('0x64')][_0xaa72('0x44')]({'where':{'id':_0x4a0575},'attributes':['id'],'include':[{'model':db['User'],'as':_0xaa72('0x67'),'attributes':['id',_0xaa72('0x2d'),_0xaa72('0x68'),'voicePause',_0xaa72('0x69')],'raw':!![]}]})[_0xaa72('0x28')](function(_0x178d93){if(_0x178d93){var _0x5015c6=_[_0xaa72('0x6a')](_0x178d93,function(_0x3ba9f8){var _0x24c84d=_0x3ba9f8[_0xaa72('0x29')]({'plain':!![]});return _0x24c84d['Agents'];});return db[_0xaa72('0x41')]['find']({'where':{'id':_0x3e0092['params']['id']}})[_0xaa72('0x28')](function(_0x4b0075){return db[_0xaa72('0x6b')][_0xaa72('0x6c')](function(_0x3bda21){return _0x4b0075[_0xaa72('0x65')](_0x4a0575,{'transaction':_0x3bda21})[_0xaa72('0x28')](function(){return BPromise['each'](_0x5015c6,function(_0x319d60){return db[_0xaa72('0x58')][_0xaa72('0x6d')]({'where':{'UserId':_0x319d60['id'],'MailQueueId':_0x3e0092[_0xaa72('0x47')]['id']},'transaction':_0x3bda21});});})[_0xaa72('0x28')](function(){_0x5015c6[_0xaa72('0x6e')](function(_0x55a827){socket['emit']('userMailQueue:save',{'UserId':_0x55a827['id'],'MailQueueId':_0x4b0075['id']});});});});});}})[_0xaa72('0x28')](respondWithStatusCode(_0x4b3bd0,null))[_0xaa72('0x4b')](handleError(_0x4b3bd0,null));};exports['removeTeams']=function(_0x4dc928,_0x31656d,_0x254735){return db[_0xaa72('0x64')][_0xaa72('0x44')]({'where':{'id':_0x4dc928[_0xaa72('0x33')][_0xaa72('0x66')]},'attributes':['id'],'include':[{'model':db[_0xaa72('0x5b')],'as':'Agents','attributes':['id'],'raw':!![]}]})[_0xaa72('0x28')](handleEntityNotFound(_0x31656d,null))[_0xaa72('0x28')](function(_0x3678a2){var _0x22ccc6=_['map'](_0x3678a2,'id');var _0x3ae588=[];var _0x35c6ec=[];var _0x56f201=squel[_0xaa72('0x6f')]();_0x56f201[_0xaa72('0x70')]('tq.TeamId')['from'](_0xaa72('0x71'),'tq')['join'](_0xaa72('0x72'),'ut',_0xaa72('0x73'))[_0xaa72('0x3c')]('MailQueueId\x20=\x20?',_0x4dc928[_0xaa72('0x47')]['id']);for(var _0x5291f4=0x0;_0x5291f4<_0x3678a2[_0xaa72('0x38')];_0x5291f4+=0x1){let _0x33cda4=_0x3678a2[_0x5291f4];for(var _0x36d203=0x0;_0x36d203<_0x33cda4['Agents'][_0xaa72('0x38')];_0x36d203+=0x1){let _0x366946=_0x33cda4[_0xaa72('0x67')][_0x36d203];var _0x19da50=_0x56f201['clone']();_0x19da50[_0xaa72('0x3c')](_0xaa72('0x74'),_0x366946['id']);_0x35c6ec[_0xaa72('0x75')](db[_0xaa72('0x6b')][_0xaa72('0x33')](_0x19da50[_0xaa72('0x76')](),{'type':db[_0xaa72('0x6b')][_0xaa72('0x77')][_0xaa72('0x78')]})[_0xaa72('0x28')](function(_0x808236){if(_0x808236[_0xaa72('0x38')]===0x1){return _0x366946['id'];}else{var _0x78d170=_[_0xaa72('0x79')](_['map'](_0x808236,'TeamId'),function(_0x10e0f7){return _[_0xaa72('0x7a')](_0x22ccc6,_0x10e0f7);});if(_0x78d170){return _0x366946['id'];}}}));}}return BPromise[_0xaa72('0x7b')](_0x35c6ec)['then'](function(_0x95b099){_0x3ae588=_(_0x3ae588)['union'](_0x95b099)[_0xaa72('0x7c')]()[_0xaa72('0x7d')]();return db[_0xaa72('0x41')][_0xaa72('0x4a')]({'where':{'id':_0x4dc928[_0xaa72('0x47')]['id']}})['then'](function(_0x2b4b65){return db[_0xaa72('0x6b')][_0xaa72('0x6c')](function(_0x2ed3d0){return _0x2b4b65['removeTeams'](_0x4dc928[_0xaa72('0x33')][_0xaa72('0x66')],{'transaction':_0x2ed3d0})['then'](function(){if(!_[_0xaa72('0x7e')](_0x3ae588)){return _0x2b4b65['removeAgents'](_0x3ae588,{'transaction':_0x2ed3d0});}})[_0xaa72('0x28')](function(){_0x3ae588[_0xaa72('0x6e')](function(_0x22eedc){socket[_0xaa72('0x7f')]('userMailQueue:remove',{'UserId':_0x22eedc,'MailQueueId':_0x2b4b65['id']});});});});});});})[_0xaa72('0x28')](respondWithStatusCode(_0x31656d,null))[_0xaa72('0x4b')](handleError(_0x31656d,null));};exports['addAgents']=function(_0x40ada5,_0x4b4e52,_0x24de00){return db['MailQueue']['find']({'where':{'id':_0x40ada5[_0xaa72('0x47')]['id']}})[_0xaa72('0x28')](handleEntityNotFound(_0x4b4e52,null))[_0xaa72('0x28')](function(_0x459c7a){if(_0x459c7a){return _0x459c7a[_0xaa72('0x80')](_0x40ada5[_0xaa72('0x4d')][_0xaa72('0x66')],_[_0xaa72('0x81')](_0x40ada5['body'],[_0xaa72('0x66'),'id'])||{})['spread'](function(_0x505e90){for(var _0x141f46=0x0;_0x141f46<_0x40ada5[_0xaa72('0x4d')][_0xaa72('0x66')][_0xaa72('0x38')];_0x141f46+=0x1){socket[_0xaa72('0x7f')](_0xaa72('0x82'),{'UserId':_0x40ada5[_0xaa72('0x4d')][_0xaa72('0x66')][_0x141f46],'MailQueueId':_0x40ada5[_0xaa72('0x47')]['id']});}return _0x505e90;});}})[_0xaa72('0x28')](respondWithResult(_0x4b4e52,null))[_0xaa72('0x4b')](handleError(_0x4b4e52,null));};exports[_0xaa72('0x83')]=function(_0x2f46b6,_0x120eb8,_0x54f99f){return db['MailQueue'][_0xaa72('0x4a')]({'where':{'id':_0x2f46b6[_0xaa72('0x47')]['id']}})['then'](handleEntityNotFound(_0x120eb8,null))['then'](function(_0x5da316){if(_0x5da316){return _0x5da316[_0xaa72('0x83')](_0x2f46b6['query'][_0xaa72('0x66')])['then'](function(){if(_['isArray'](_0x2f46b6[_0xaa72('0x33')][_0xaa72('0x66')])){for(var _0x251769=0x0;_0x251769<_0x2f46b6[_0xaa72('0x33')][_0xaa72('0x66')][_0xaa72('0x38')];_0x251769+=0x1){socket[_0xaa72('0x7f')](_0xaa72('0x84'),{'UserId':Number(_0x2f46b6[_0xaa72('0x33')][_0xaa72('0x66')][_0x251769]),'MailQueueId':Number(_0x2f46b6['params']['id'])});}}else{socket[_0xaa72('0x7f')](_0xaa72('0x84'),{'UserId':Number(_0x2f46b6['query'][_0xaa72('0x66')]),'MailQueueId':Number(_0x2f46b6['params']['id'])});}});}})[_0xaa72('0x28')](respondWithStatusCode(_0x120eb8,null))['catch'](handleError(_0x120eb8,null));};exports[_0xaa72('0x85')]=function(_0x55c525,_0x5b4f95,_0x4f313e){var _0x15cd37={};var _0x72ae71={};var _0x3e9b87;var _0x3b2f80;return db[_0xaa72('0x41')]['findOne']({'where':{'id':_0x55c525[_0xaa72('0x47')]['id']}})[_0xaa72('0x28')](handleEntityNotFound(_0x5b4f95,null))[_0xaa72('0x28')](function(_0x218658){if(_0x218658){_0x3e9b87=_0x218658;_0x72ae71[_0xaa72('0x32')]=_[_0xaa72('0x34')](db[_0xaa72('0x5b')][_0xaa72('0x48')]);_0x72ae71[_0xaa72('0x33')]=_[_0xaa72('0x34')](_0x55c525[_0xaa72('0x33')]);_0x72ae71['filters']=_[_0xaa72('0x35')](_0x72ae71['model'],_0x72ae71[_0xaa72('0x33')]);_0x15cd37[_0xaa72('0x36')]=_['intersection'](_0x72ae71[_0xaa72('0x32')],qs[_0xaa72('0x37')](_0x55c525['query']['fields']));_0x15cd37[_0xaa72('0x36')]=_0x15cd37[_0xaa72('0x36')][_0xaa72('0x38')]?_0x15cd37[_0xaa72('0x36')]:_0x72ae71['model'];_0x15cd37[_0xaa72('0x3a')]=qs[_0xaa72('0x3b')](_0x55c525[_0xaa72('0x33')]['sort']);_0x15cd37['where']=qs[_0xaa72('0x3d')](_[_0xaa72('0x3e')](_0x55c525[_0xaa72('0x33')],_0x72ae71['filters']));if(_0x55c525[_0xaa72('0x33')][_0xaa72('0x3f')]){_0x15cd37[_0xaa72('0x3c')]=_[_0xaa72('0x40')](_0x15cd37['where'],{'$or':_[_0xaa72('0x2f')](_0x15cd37[_0xaa72('0x36')],function(_0x1c25be){var _0x27ed2a={};_0x27ed2a[_0x1c25be]={'$like':'%'+_0x55c525[_0xaa72('0x33')][_0xaa72('0x3f')]+'%'};return _0x27ed2a;})});}_0x15cd37=_['merge']({},_0x15cd37,_0x55c525['options']);return _0x3e9b87[_0xaa72('0x85')](_0x15cd37);}})[_0xaa72('0x28')](function(_0x46ef95){if(_0x46ef95){_0x3b2f80=_0x46ef95[_0xaa72('0x38')];if(!_0x55c525[_0xaa72('0x33')][_0xaa72('0x39')](_0xaa72('0x59'))){_0x15cd37['limit']=qs[_0xaa72('0x24')](_0x55c525[_0xaa72('0x33')][_0xaa72('0x24')]);_0x15cd37[_0xaa72('0x23')]=qs[_0xaa72('0x23')](_0x55c525[_0xaa72('0x33')][_0xaa72('0x23')]);}return _0x3e9b87[_0xaa72('0x85')](_0x15cd37);}})[_0xaa72('0x28')](function(_0x230f80){if(_0x230f80){return _0x230f80?{'count':_0x3b2f80,'rows':_0x230f80}:null;}})[_0xaa72('0x28')](respondWithResult(_0x5b4f95,null))[_0xaa72('0x4b')](handleError(_0x5b4f95,null));};
\ No newline at end of file
diff --git a/server/api/mailQueue/mailQueue.events.js b/server/api/mailQueue/mailQueue.events.js
index 0048381..3f015b7 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 _0x5bd3=['events','../../mysqldb','save','update','emit','hasOwnProperty','hook','exports'];(function(_0x10f83a,_0x258053){var _0x1396cf=function(_0x15f22e){while(--_0x15f22e){_0x10f83a['push'](_0x10f83a['shift']());}};_0x1396cf(++_0x258053);}(_0x5bd3,0xe8));var _0x35bd=function(_0x9dfc10,_0x19c2d5){_0x9dfc10=_0x9dfc10-0x0;var _0x4f938a=_0x5bd3[_0x9dfc10];return _0x4f938a;};'use strict';var EventEmitter=require(_0x35bd('0x0'));var MailQueue=require(_0x35bd('0x1'))['db']['MailQueue'];var MailQueueEvents=new EventEmitter();MailQueueEvents['setMaxListeners'](0x0);var events={'afterCreate':_0x35bd('0x2'),'afterUpdate':_0x35bd('0x3'),'afterDestroy':'remove'};function emitEvent(_0x46d69f){return function(_0x3f46f7,_0x5de763,_0x348dbb){MailQueueEvents[_0x35bd('0x4')](_0x46d69f+':'+_0x3f46f7['id'],_0x3f46f7);MailQueueEvents[_0x35bd('0x4')](_0x46d69f,_0x3f46f7);_0x348dbb(null);};}for(var e in events){if(events[_0x35bd('0x5')](e)){var event=events[e];MailQueue[_0x35bd('0x6')](e,emitEvent(event));}}module[_0x35bd('0x7')]=MailQueueEvents;
\ No newline at end of file
+var _0xdf1a=['remove','emit','hasOwnProperty','hook','exports','../../mysqldb','MailQueue','save','update'];(function(_0x27af45,_0x1b57aa){var _0x18df21=function(_0x4b7679){while(--_0x4b7679){_0x27af45['push'](_0x27af45['shift']());}};_0x18df21(++_0x1b57aa);}(_0xdf1a,0xf8));var _0xadf1=function(_0x1ac120,_0x3e7e45){_0x1ac120=_0x1ac120-0x0;var _0x19b703=_0xdf1a[_0x1ac120];return _0x19b703;};'use strict';var EventEmitter=require('events');var MailQueue=require(_0xadf1('0x0'))['db'][_0xadf1('0x1')];var MailQueueEvents=new EventEmitter();MailQueueEvents['setMaxListeners'](0x0);var events={'afterCreate':_0xadf1('0x2'),'afterUpdate':_0xadf1('0x3'),'afterDestroy':_0xadf1('0x4')};function emitEvent(_0x12de5f){return function(_0x239335,_0x4806c1,_0x2a808f){MailQueueEvents[_0xadf1('0x5')](_0x12de5f+':'+_0x239335['id'],_0x239335);MailQueueEvents[_0xadf1('0x5')](_0x12de5f,_0x239335);_0x2a808f(null);};}for(var e in events){if(events[_0xadf1('0x6')](e)){var event=events[e];MailQueue[_0xadf1('0x7')](e,emitEvent(event));}}module[_0xadf1('0x8')]=MailQueueEvents;
\ No newline at end of file
diff --git a/server/api/mailQueue/mailQueue.model.js b/server/api/mailQueue/mailQueue.model.js
index b9057ab..a63765a 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 _0x1d4c=['lodash','util','../../config/logger','bluebird','path','rimraf','./mailQueue.attributes','exports','MailQueue','mail_queues'];(function(_0x422905,_0x3bce3a){var _0x33dc6c=function(_0x4852c9){while(--_0x4852c9){_0x422905['push'](_0x422905['shift']());}};_0x33dc6c(++_0x3bce3a);}(_0x1d4c,0x8c));var _0xc1d4=function(_0xf969eb,_0x4c6c2d){_0xf969eb=_0xf969eb-0x0;var _0x2de570=_0x1d4c[_0xf969eb];return _0x2de570;};'use strict';var _=require(_0xc1d4('0x0'));var util=require(_0xc1d4('0x1'));var logger=require(_0xc1d4('0x2'))('api');var moment=require('moment');var BPromise=require(_0xc1d4('0x3'));var rp=require('request-promise');var fs=require('fs');var path=require(_0xc1d4('0x4'));var rimraf=require(_0xc1d4('0x5'));var config=require('../../config/environment');var attributes=require(_0xc1d4('0x6'));module[_0xc1d4('0x7')]=function(_0x2252c6,_0x4bd6c1){return _0x2252c6['define'](_0xc1d4('0x8'),attributes,{'tableName':_0xc1d4('0x9'),'paranoid':![],'indexes':[],'timestamps':!![]});};
\ No newline at end of file
+var _0xb4d4=['exports','define','MailQueue','mail_queues','lodash','util','moment','bluebird','path','rimraf','./mailQueue.attributes'];(function(_0x5e8d3e,_0x18ed2e){var _0x1348c0=function(_0x5a889f){while(--_0x5a889f){_0x5e8d3e['push'](_0x5e8d3e['shift']());}};_0x1348c0(++_0x18ed2e);}(_0xb4d4,0xf6));var _0x4b4d=function(_0x3dd15e,_0x1f0015){_0x3dd15e=_0x3dd15e-0x0;var _0x231fd0=_0xb4d4[_0x3dd15e];return _0x231fd0;};'use strict';var _=require(_0x4b4d('0x0'));var util=require(_0x4b4d('0x1'));var logger=require('../../config/logger')('api');var moment=require(_0x4b4d('0x2'));var BPromise=require(_0x4b4d('0x3'));var rp=require('request-promise');var fs=require('fs');var path=require(_0x4b4d('0x4'));var rimraf=require(_0x4b4d('0x5'));var config=require('../../config/environment');var attributes=require(_0x4b4d('0x6'));module[_0x4b4d('0x7')]=function(_0x2e4ef7,_0x386fcb){return _0x2e4ef7[_0x4b4d('0x8')](_0x4b4d('0x9'),attributes,{'tableName':_0x4b4d('0xa'),'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 d9099c8..ac1de81 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 _0xc8b8=['socket.io-emitter','./mailQueue.socket','register','then','info','MailQueue,\x20%s,\x20%s','request\x20sent','debug','MailQueue,\x20%s,\x20%s,\x20%s','error','code','message','result','catch','GetMailQueue','MailQueue','findAll','options','where','attributes','limit','include','map','model','stringify','raw','ShowMailQueue','lodash','util','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','client','http','redis','defaults','localhost'];(function(_0x321bb2,_0x202794){var _0x9c12ed=function(_0x263dd3){while(--_0x263dd3){_0x321bb2['push'](_0x321bb2['shift']());}};_0x9c12ed(++_0x202794);}(_0xc8b8,0x71));var _0x8c8b=function(_0x17a32f,_0x5a51a){_0x17a32f=_0x17a32f-0x0;var _0x15a293=_0xc8b8[_0x17a32f];return _0x15a293;};'use strict';var _=require(_0x8c8b('0x0'));var util=require(_0x8c8b('0x1'));var moment=require('moment');var BPromise=require(_0x8c8b('0x2'));var rs=require(_0x8c8b('0x3'));var fs=require('fs');var Redis=require(_0x8c8b('0x4'));var db=require(_0x8c8b('0x5'))['db'];var utils=require(_0x8c8b('0x6'));var logger=require(_0x8c8b('0x7'))(_0x8c8b('0x8'));var config=require(_0x8c8b('0x9'));var jayson=require(_0x8c8b('0xa'));var client=jayson[_0x8c8b('0xb')][_0x8c8b('0xc')]({'port':0x232a});config[_0x8c8b('0xd')]=_[_0x8c8b('0xe')](config[_0x8c8b('0xd')],{'host':_0x8c8b('0xf'),'port':0x18eb});var socket=require(_0x8c8b('0x10'))(new Redis(config[_0x8c8b('0xd')]));require(_0x8c8b('0x11'))[_0x8c8b('0x12')](socket);function respondWithRpcPromise(_0xa7d222,_0x3844ee,_0x1398e9){return new BPromise(function(_0x3d9447,_0x447973){return client['request'](_0xa7d222,_0x1398e9)[_0x8c8b('0x13')](function(_0x51ce74){logger[_0x8c8b('0x14')](_0x8c8b('0x15'),_0x3844ee,_0x8c8b('0x16'));logger[_0x8c8b('0x17')](_0x8c8b('0x18'),_0x3844ee,_0x8c8b('0x16'),JSON['stringify'](_0x51ce74));if(_0x51ce74[_0x8c8b('0x19')]){if(_0x51ce74['error'][_0x8c8b('0x1a')]===0x1f4){logger[_0x8c8b('0x19')]('MailQueue,\x20%s,\x20%s',_0x3844ee,_0x51ce74['error'][_0x8c8b('0x1b')]);return _0x447973(_0x51ce74[_0x8c8b('0x19')][_0x8c8b('0x1b')]);}logger[_0x8c8b('0x19')](_0x8c8b('0x15'),_0x3844ee,_0x51ce74[_0x8c8b('0x19')][_0x8c8b('0x1b')]);return _0x3d9447(_0x51ce74['error'][_0x8c8b('0x1b')]);}else{logger[_0x8c8b('0x14')](_0x8c8b('0x15'),_0x3844ee,_0x8c8b('0x16'));_0x3d9447(_0x51ce74[_0x8c8b('0x1c')][_0x8c8b('0x1b')]);}})[_0x8c8b('0x1d')](function(_0x37533b){logger[_0x8c8b('0x19')]('MailQueue,\x20%s,\x20%s',_0x3844ee,_0x37533b);_0x447973(_0x37533b);});});}exports[_0x8c8b('0x1e')]=function(_0x6e2431){var _0x470343=this;return new Promise(function(_0x5c27f0,_0x3302c3){return db[_0x8c8b('0x1f')][_0x8c8b('0x20')]({'raw':_0x6e2431['options']?_0x6e2431[_0x8c8b('0x21')]['raw']===undefined?!![]:![]:!![],'where':_0x6e2431[_0x8c8b('0x21')]?_0x6e2431[_0x8c8b('0x21')][_0x8c8b('0x22')]||null:null,'attributes':_0x6e2431['options']?_0x6e2431['options'][_0x8c8b('0x23')]||null:null,'limit':_0x6e2431[_0x8c8b('0x21')]?_0x6e2431[_0x8c8b('0x21')][_0x8c8b('0x24')]||null:null,'include':_0x6e2431[_0x8c8b('0x21')]?_0x6e2431[_0x8c8b('0x21')][_0x8c8b('0x25')]?_[_0x8c8b('0x26')](_0x6e2431['options'][_0x8c8b('0x25')],function(_0x3da19c){return{'model':db[_0x3da19c[_0x8c8b('0x27')]],'as':_0x3da19c['as'],'attributes':_0x3da19c['attributes'],'include':_0x3da19c['include']?_[_0x8c8b('0x26')](_0x3da19c['include'],function(_0x239e78){return{'model':db[_0x239e78['model']],'as':_0x239e78['as'],'attributes':_0x239e78[_0x8c8b('0x23')],'include':_0x239e78[_0x8c8b('0x25')]?_[_0x8c8b('0x26')](_0x239e78[_0x8c8b('0x25')],function(_0x2cfb9e){return{'model':db[_0x2cfb9e[_0x8c8b('0x27')]],'as':_0x2cfb9e['as'],'attributes':_0x2cfb9e[_0x8c8b('0x23')]};}):[]};}):[]};}):[]:[]})['then'](function(_0x387e34){logger[_0x8c8b('0x14')]('GetMailQueue',_0x6e2431);logger[_0x8c8b('0x17')](_0x8c8b('0x1e'),_0x6e2431,JSON[_0x8c8b('0x28')](_0x387e34));_0x5c27f0(_0x387e34);})[_0x8c8b('0x1d')](function(_0x5e6a00){logger[_0x8c8b('0x19')](_0x8c8b('0x1e'),_0x5e6a00['message'],_0x6e2431);_0x3302c3(_0x470343['error'](0x1f4,_0x5e6a00[_0x8c8b('0x1b')]));});});};exports['ShowMailQueue']=function(_0x262765){var _0xd1bfeb=this;return new Promise(function(_0x103a2b,_0x5501aa){return db['MailQueue']['find']({'raw':_0x262765[_0x8c8b('0x21')]?_0x262765[_0x8c8b('0x21')][_0x8c8b('0x29')]===undefined?!![]:![]:!![],'where':_0x262765[_0x8c8b('0x21')]?_0x262765[_0x8c8b('0x21')][_0x8c8b('0x22')]||null:null,'attributes':_0x262765[_0x8c8b('0x21')]?_0x262765[_0x8c8b('0x21')][_0x8c8b('0x23')]||null:null,'include':_0x262765[_0x8c8b('0x21')]?_0x262765['options'][_0x8c8b('0x25')]?_[_0x8c8b('0x26')](_0x262765[_0x8c8b('0x21')]['include'],function(_0x18418e){return{'model':db[_0x18418e[_0x8c8b('0x27')]],'as':_0x18418e['as'],'attributes':_0x18418e[_0x8c8b('0x23')],'include':_0x18418e[_0x8c8b('0x25')]?_[_0x8c8b('0x26')](_0x18418e[_0x8c8b('0x25')],function(_0x44d72e){return{'model':db[_0x44d72e[_0x8c8b('0x27')]],'as':_0x44d72e['as'],'attributes':_0x44d72e[_0x8c8b('0x23')],'include':_0x44d72e[_0x8c8b('0x25')]?_[_0x8c8b('0x26')](_0x44d72e[_0x8c8b('0x25')],function(_0x311312){return{'model':db[_0x311312[_0x8c8b('0x27')]],'as':_0x311312['as'],'attributes':_0x311312[_0x8c8b('0x23')]};}):[]};}):[]};}):[]:[]})['then'](function(_0x44f959){logger['info'](_0x8c8b('0x2a'),_0x262765);logger[_0x8c8b('0x17')](_0x8c8b('0x2a'),_0x262765,JSON[_0x8c8b('0x28')](_0x44f959));_0x103a2b(_0x44f959);})[_0x8c8b('0x1d')](function(_0x4861be){logger[_0x8c8b('0x19')](_0x8c8b('0x2a'),_0x4861be[_0x8c8b('0x1b')],_0x262765);_0x5501aa(_0xd1bfeb[_0x8c8b('0x19')](0x1f4,_0x4861be[_0x8c8b('0x1b')]));});});};
\ No newline at end of file
+var _0x2c34=['defaults','redis','socket.io-emitter','./mailQueue.socket','request','then','info','MailQueue,\x20%s,\x20%s','request\x20sent','debug','stringify','error','message','result','GetMailQueue','MailQueue','findAll','options','raw','attributes','limit','include','map','model','ShowMailQueue','find','where','lodash','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/logger','rpc','jayson/promise','http'];(function(_0x15ceb7,_0x961934){var _0x1d9eaa=function(_0x532231){while(--_0x532231){_0x15ceb7['push'](_0x15ceb7['shift']());}};_0x1d9eaa(++_0x961934);}(_0x2c34,0xd4));var _0x42c3=function(_0x4a9fb1,_0x273043){_0x4a9fb1=_0x4a9fb1-0x0;var _0x348672=_0x2c34[_0x4a9fb1];return _0x348672;};'use strict';var _=require(_0x42c3('0x0'));var util=require('util');var moment=require(_0x42c3('0x1'));var BPromise=require(_0x42c3('0x2'));var rs=require(_0x42c3('0x3'));var fs=require('fs');var Redis=require(_0x42c3('0x4'));var db=require(_0x42c3('0x5'))['db'];var utils=require('../../config/utils');var logger=require(_0x42c3('0x6'))(_0x42c3('0x7'));var config=require('../../config/environment');var jayson=require(_0x42c3('0x8'));var client=jayson['client'][_0x42c3('0x9')]({'port':0x232a});config['redis']=_[_0x42c3('0xa')](config[_0x42c3('0xb')],{'host':'localhost','port':0x18eb});var socket=require(_0x42c3('0xc'))(new Redis(config[_0x42c3('0xb')]));require(_0x42c3('0xd'))['register'](socket);function respondWithRpcPromise(_0x40f6a5,_0x3cf046,_0x108ae4){return new BPromise(function(_0x45acbf,_0x269f73){return client[_0x42c3('0xe')](_0x40f6a5,_0x108ae4)[_0x42c3('0xf')](function(_0x258deb){logger[_0x42c3('0x10')](_0x42c3('0x11'),_0x3cf046,_0x42c3('0x12'));logger[_0x42c3('0x13')]('MailQueue,\x20%s,\x20%s,\x20%s',_0x3cf046,_0x42c3('0x12'),JSON[_0x42c3('0x14')](_0x258deb));if(_0x258deb[_0x42c3('0x15')]){if(_0x258deb[_0x42c3('0x15')]['code']===0x1f4){logger[_0x42c3('0x15')](_0x42c3('0x11'),_0x3cf046,_0x258deb['error'][_0x42c3('0x16')]);return _0x269f73(_0x258deb[_0x42c3('0x15')][_0x42c3('0x16')]);}logger[_0x42c3('0x15')](_0x42c3('0x11'),_0x3cf046,_0x258deb[_0x42c3('0x15')]['message']);return _0x45acbf(_0x258deb[_0x42c3('0x15')][_0x42c3('0x16')]);}else{logger['info'](_0x42c3('0x11'),_0x3cf046,_0x42c3('0x12'));_0x45acbf(_0x258deb[_0x42c3('0x17')][_0x42c3('0x16')]);}})['catch'](function(_0x38dd39){logger[_0x42c3('0x15')](_0x42c3('0x11'),_0x3cf046,_0x38dd39);_0x269f73(_0x38dd39);});});}exports[_0x42c3('0x18')]=function(_0x956783){var _0x26096b=this;return new Promise(function(_0x2dc6fa,_0x512d89){return db[_0x42c3('0x19')][_0x42c3('0x1a')]({'raw':_0x956783['options']?_0x956783[_0x42c3('0x1b')][_0x42c3('0x1c')]===undefined?!![]:![]:!![],'where':_0x956783['options']?_0x956783[_0x42c3('0x1b')]['where']||null:null,'attributes':_0x956783['options']?_0x956783['options'][_0x42c3('0x1d')]||null:null,'limit':_0x956783['options']?_0x956783[_0x42c3('0x1b')][_0x42c3('0x1e')]||null:null,'include':_0x956783['options']?_0x956783[_0x42c3('0x1b')][_0x42c3('0x1f')]?_[_0x42c3('0x20')](_0x956783['options'][_0x42c3('0x1f')],function(_0x2908d8){return{'model':db[_0x2908d8[_0x42c3('0x21')]],'as':_0x2908d8['as'],'attributes':_0x2908d8[_0x42c3('0x1d')],'include':_0x2908d8[_0x42c3('0x1f')]?_[_0x42c3('0x20')](_0x2908d8[_0x42c3('0x1f')],function(_0x5f5c73){return{'model':db[_0x5f5c73[_0x42c3('0x21')]],'as':_0x5f5c73['as'],'attributes':_0x5f5c73[_0x42c3('0x1d')],'include':_0x5f5c73[_0x42c3('0x1f')]?_[_0x42c3('0x20')](_0x5f5c73['include'],function(_0x5011b7){return{'model':db[_0x5011b7['model']],'as':_0x5011b7['as'],'attributes':_0x5011b7['attributes']};}):[]};}):[]};}):[]:[]})[_0x42c3('0xf')](function(_0x346d9e){logger[_0x42c3('0x10')](_0x42c3('0x18'),_0x956783);logger['debug'](_0x42c3('0x18'),_0x956783,JSON[_0x42c3('0x14')](_0x346d9e));_0x2dc6fa(_0x346d9e);})['catch'](function(_0x46a296){logger['error'](_0x42c3('0x18'),_0x46a296[_0x42c3('0x16')],_0x956783);_0x512d89(_0x26096b[_0x42c3('0x15')](0x1f4,_0x46a296[_0x42c3('0x16')]));});});};exports[_0x42c3('0x22')]=function(_0x24f892){var _0x16e19a=this;return new Promise(function(_0x4cf4f8,_0x462d44){return db[_0x42c3('0x19')][_0x42c3('0x23')]({'raw':_0x24f892[_0x42c3('0x1b')]?_0x24f892[_0x42c3('0x1b')][_0x42c3('0x1c')]===undefined?!![]:![]:!![],'where':_0x24f892['options']?_0x24f892[_0x42c3('0x1b')][_0x42c3('0x24')]||null:null,'attributes':_0x24f892['options']?_0x24f892[_0x42c3('0x1b')][_0x42c3('0x1d')]||null:null,'include':_0x24f892[_0x42c3('0x1b')]?_0x24f892[_0x42c3('0x1b')][_0x42c3('0x1f')]?_['map'](_0x24f892[_0x42c3('0x1b')][_0x42c3('0x1f')],function(_0x1e3041){return{'model':db[_0x1e3041[_0x42c3('0x21')]],'as':_0x1e3041['as'],'attributes':_0x1e3041[_0x42c3('0x1d')],'include':_0x1e3041['include']?_['map'](_0x1e3041[_0x42c3('0x1f')],function(_0x3ed0fe){return{'model':db[_0x3ed0fe[_0x42c3('0x21')]],'as':_0x3ed0fe['as'],'attributes':_0x3ed0fe['attributes'],'include':_0x3ed0fe[_0x42c3('0x1f')]?_[_0x42c3('0x20')](_0x3ed0fe[_0x42c3('0x1f')],function(_0x22844f){return{'model':db[_0x22844f['model']],'as':_0x22844f['as'],'attributes':_0x22844f[_0x42c3('0x1d')]};}):[]};}):[]};}):[]:[]})['then'](function(_0x458e77){logger[_0x42c3('0x10')](_0x42c3('0x22'),_0x24f892);logger[_0x42c3('0x13')]('ShowMailQueue',_0x24f892,JSON[_0x42c3('0x14')](_0x458e77));_0x4cf4f8(_0x458e77);})['catch'](function(_0x19a5f4){logger[_0x42c3('0x15')]('ShowMailQueue',_0x19a5f4[_0x42c3('0x16')],_0x24f892);_0x462d44(_0x16e19a[_0x42c3('0x15')](0x1f4,_0x19a5f4[_0x42c3('0x16')]));});});};
\ No newline at end of file
diff --git a/server/api/mailQueue/mailQueue.socket.js b/server/api/mailQueue/mailQueue.socket.js
index da35c1e..ff8d4cd 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 _0xa8e7=['register','length','mailQueue:','./mailQueue.events','emit','removeListener'];(function(_0x21c8cf,_0x18787c){var _0x3e4139=function(_0x25b1b0){while(--_0x25b1b0){_0x21c8cf['push'](_0x21c8cf['shift']());}};_0x3e4139(++_0x18787c);}(_0xa8e7,0x183));var _0x7a8e=function(_0x3b83c1,_0x3365fe){_0x3b83c1=_0x3b83c1-0x0;var _0x111cea=_0xa8e7[_0x3b83c1];return _0x111cea;};'use strict';var MailQueueEvents=require(_0x7a8e('0x0'));var events=['save','remove','update'];function createListener(_0x416861,_0x1c7969){return function(_0x2d835f){_0x1c7969[_0x7a8e('0x1')](_0x416861,_0x2d835f);};}function removeListener(_0x1a4b73,_0x48bb69){return function(){MailQueueEvents[_0x7a8e('0x2')](_0x1a4b73,_0x48bb69);};}exports[_0x7a8e('0x3')]=function(_0x2e0fee){for(var _0x460fc3=0x0,_0x5efd10=events[_0x7a8e('0x4')];_0x460fc3<_0x5efd10;_0x460fc3++){var _0x237658=events[_0x460fc3];var _0x5b806a=createListener(_0x7a8e('0x5')+_0x237658,_0x2e0fee);MailQueueEvents['on'](_0x237658,_0x5b806a);}};
\ No newline at end of file
+var _0xda9f=['remove','update','register','length','./mailQueue.events','save'];(function(_0x75f6c4,_0x842c36){var _0x16175f=function(_0x1af7bc){while(--_0x1af7bc){_0x75f6c4['push'](_0x75f6c4['shift']());}};_0x16175f(++_0x842c36);}(_0xda9f,0x184));var _0xfda9=function(_0x3ae13f,_0x360766){_0x3ae13f=_0x3ae13f-0x0;var _0x70abca=_0xda9f[_0x3ae13f];return _0x70abca;};'use strict';var MailQueueEvents=require(_0xfda9('0x0'));var events=[_0xfda9('0x1'),_0xfda9('0x2'),_0xfda9('0x3')];function createListener(_0x181f2c,_0x192d7e){return function(_0x39428c){_0x192d7e['emit'](_0x181f2c,_0x39428c);};}function removeListener(_0x4a28ae,_0x5e784e){return function(){MailQueueEvents['removeListener'](_0x4a28ae,_0x5e784e);};}exports[_0xfda9('0x4')]=function(_0x33f914){for(var _0x1504d2=0x0,_0xe69d8d=events[_0xfda9('0x5')];_0x1504d2<_0xe69d8d;_0x1504d2++){var _0x45d1ee=events[_0x1504d2];var _0x5311da=createListener('mailQueue:'+_0x45d1ee,_0x33f914);MailQueueEvents['on'](_0x45d1ee,_0x5311da);}};
\ No newline at end of file
diff --git a/server/api/mailQueueReport/index.js b/server/api/mailQueueReport/index.js
index f54a961..ed8bf52 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 _0x3f9b=['describe','/:id','create','put','delete','exports','multer','util','path','express','Router','../../components/auth/service','../../config/environment','./mailQueueReport.controller','get','/describe','isAuthenticated'];(function(_0xa1e3e3,_0x29fe0e){var _0xc980e9=function(_0x1f5adc){while(--_0x1f5adc){_0xa1e3e3['push'](_0xa1e3e3['shift']());}};_0xc980e9(++_0x29fe0e);}(_0x3f9b,0x8e));var _0xb3f9=function(_0x519f3b,_0x482703){_0x519f3b=_0x519f3b-0x0;var _0x4acbb3=_0x3f9b[_0x519f3b];return _0x4acbb3;};'use strict';var multer=require(_0xb3f9('0x0'));var util=require(_0xb3f9('0x1'));var path=require(_0xb3f9('0x2'));var timeout=require('connect-timeout');var express=require(_0xb3f9('0x3'));var router=express[_0xb3f9('0x4')]();var auth=require(_0xb3f9('0x5'));var interaction=require('../../components/interaction/service');var config=require(_0xb3f9('0x6'));var controller=require(_0xb3f9('0x7'));router['get']('/',auth['isAuthenticated'](),controller['index']);router[_0xb3f9('0x8')](_0xb3f9('0x9'),auth[_0xb3f9('0xa')](),controller[_0xb3f9('0xb')]);router['get'](_0xb3f9('0xc'),auth['isAuthenticated'](),controller['show']);router['post']('/',auth['isAuthenticated'](),controller[_0xb3f9('0xd')]);router[_0xb3f9('0xe')](_0xb3f9('0xc'),auth[_0xb3f9('0xa')](),controller['update']);router[_0xb3f9('0xf')](_0xb3f9('0xc'),auth['isAuthenticated'](),controller['destroy']);module[_0xb3f9('0x10')]=router;
\ No newline at end of file
+var _0x6989=['index','/describe','isAuthenticated','describe','/:id','show','post','create','put','update','delete','destroy','exports','multer','util','path','connect-timeout','express','Router','../../components/interaction/service','get'];(function(_0x32a8be,_0x275743){var _0x458316=function(_0xffb95){while(--_0xffb95){_0x32a8be['push'](_0x32a8be['shift']());}};_0x458316(++_0x275743);}(_0x6989,0xf4));var _0x9698=function(_0x40ea2a,_0x1f21db){_0x40ea2a=_0x40ea2a-0x0;var _0x432be2=_0x6989[_0x40ea2a];return _0x432be2;};'use strict';var multer=require(_0x9698('0x0'));var util=require(_0x9698('0x1'));var path=require(_0x9698('0x2'));var timeout=require(_0x9698('0x3'));var express=require(_0x9698('0x4'));var router=express[_0x9698('0x5')]();var auth=require('../../components/auth/service');var interaction=require(_0x9698('0x6'));var config=require('../../config/environment');var controller=require('./mailQueueReport.controller');router[_0x9698('0x7')]('/',auth['isAuthenticated'](),controller[_0x9698('0x8')]);router['get'](_0x9698('0x9'),auth[_0x9698('0xa')](),controller[_0x9698('0xb')]);router[_0x9698('0x7')](_0x9698('0xc'),auth['isAuthenticated'](),controller[_0x9698('0xd')]);router[_0x9698('0xe')]('/',auth[_0x9698('0xa')](),controller[_0x9698('0xf')]);router[_0x9698('0x10')](_0x9698('0xc'),auth[_0x9698('0xa')](),controller[_0x9698('0x11')]);router[_0x9698('0x12')](_0x9698('0xc'),auth[_0x9698('0xa')](),controller[_0x9698('0x13')]);module[_0x9698('0x14')]=router;
\ No newline at end of file
diff --git a/server/api/mailQueueReport/mailQueueReport.attributes.js b/server/api/mailQueueReport/mailQueueReport.attributes.js
index d9e9c54..427786d 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 _0x5a51=['sequelize','STRING','DATE','moment'];(function(_0x82129b,_0x484ae9){var _0x2ae5dc=function(_0x299e34){while(--_0x299e34){_0x82129b['push'](_0x82129b['shift']());}};_0x2ae5dc(++_0x484ae9);}(_0x5a51,0xc3));var _0x15a5=function(_0x118d98,_0x344cbf){_0x118d98=_0x118d98-0x0;var _0xf0f01c=_0x5a51[_0x118d98];return _0xf0f01c;};'use strict';var moment=require(_0x15a5('0x0'));var Sequelize=require(_0x15a5('0x1'));module['exports']={'uniqueid':{'type':Sequelize[_0x15a5('0x2')],'allowNull':![]},'from':{'type':Sequelize['STRING']},'joinAt':{'type':Sequelize[_0x15a5('0x3')]},'leaveAt':{'type':Sequelize[_0x15a5('0x3')]},'acceptAt':{'type':Sequelize[_0x15a5('0x3')]},'exitAt':{'type':Sequelize[_0x15a5('0x3')]},'reason':{'type':Sequelize[_0x15a5('0x2')]}};
\ No newline at end of file
+var _0x68b6=['moment','sequelize','exports','STRING','DATE'];(function(_0xe73080,_0x24c56d){var _0x12cbc4=function(_0x1377e2){while(--_0x1377e2){_0xe73080['push'](_0xe73080['shift']());}};_0x12cbc4(++_0x24c56d);}(_0x68b6,0x1a4));var _0x668b=function(_0x1a6035,_0x5e2590){_0x1a6035=_0x1a6035-0x0;var _0x2bc670=_0x68b6[_0x1a6035];return _0x2bc670;};'use strict';var moment=require(_0x668b('0x0'));var Sequelize=require(_0x668b('0x1'));module[_0x668b('0x2')]={'uniqueid':{'type':Sequelize[_0x668b('0x3')],'allowNull':![]},'from':{'type':Sequelize['STRING']},'joinAt':{'type':Sequelize['DATE']},'leaveAt':{'type':Sequelize[_0x668b('0x4')]},'acceptAt':{'type':Sequelize[_0x668b('0x4')]},'exitAt':{'type':Sequelize[_0x668b('0x4')]},'reason':{'type':Sequelize[_0x668b('0x3')]}};
\ No newline at end of file
diff --git a/server/api/mailQueueReport/mailQueueReport.controller.js b/server/api/mailQueueReport/mailQueueReport.controller.js
index 5fec92c..2fc0d25 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 _0xf279=['model','query','keys','intersection','attributes','fields','length','hasOwnProperty','nolimit','limit','order','sort','where','filters','filter','merge','options','count','include','findAll','rows','catch','show','params','includeAll','find','create','body','describe','html-pdf','eml-format','rimraf','fast-json-patch','moment','mustache','path','ejs','lodash','squel','crypto','jsforce','desk.js','to-csv','papaparse','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','../../config/utils','../../config/environment','../../mysqldb','sendStatus','status','json','offset','set','Content-Range','apply','reject','save','update','then','destroy','end','error','stack','name','map','MailQueueReport','rawAttributes','fieldName','type','key'];(function(_0xd56045,_0x442d16){var _0x73eb19=function(_0xbeafbd){while(--_0xbeafbd){_0xd56045['push'](_0xd56045['shift']());}};_0x73eb19(++_0x442d16);}(_0xf279,0x67));var _0x9f27=function(_0x4d2dfb,_0x4155ff){_0x4d2dfb=_0x4d2dfb-0x0;var _0x51f206=_0xf279[_0x4d2dfb];return _0x51f206;};'use strict';var pdf=require(_0x9f27('0x0'));var emlformat=require(_0x9f27('0x1'));var rimraf=require(_0x9f27('0x2'));var zipdir=require('zip-dir');var jsonpatch=require(_0x9f27('0x3'));var rp=require('request-promise');var moment=require(_0x9f27('0x4'));var BPromise=require('bluebird');var Mustache=require(_0x9f27('0x5'));var util=require('util');var path=require(_0x9f27('0x6'));var sox=require('sox');var csv=require('to-csv');var ejs=require(_0x9f27('0x7'));var fs=require('fs');var _=require(_0x9f27('0x8'));var squel=require(_0x9f27('0x9'));var crypto=require(_0x9f27('0xa'));var jsforce=require(_0x9f27('0xb'));var deskjs=require(_0x9f27('0xc'));var toCsv=require(_0x9f27('0xd'));var querystring=require('querystring');var Papa=require(_0x9f27('0xe'));var Redis=require('ioredis');var authService=require(_0x9f27('0xf'));var qs=require(_0x9f27('0x10'));var as=require(_0x9f27('0x11'));var hardwareService=require(_0x9f27('0x12'));var logger=require(_0x9f27('0x13'))('api');var utils=require(_0x9f27('0x14'));var config=require(_0x9f27('0x15'));var db=require(_0x9f27('0x16'))['db'];function respondWithStatusCode(_0x2ca98b,_0x114371){_0x114371=_0x114371||0xcc;return function(_0x521e2d){if(_0x521e2d){return _0x2ca98b[_0x9f27('0x17')](_0x114371);}return _0x2ca98b[_0x9f27('0x18')](_0x114371)['end']();};}function respondWithResult(_0x32bb82,_0x337678){_0x337678=_0x337678||0xc8;return function(_0x25966e){if(_0x25966e){return _0x32bb82[_0x9f27('0x18')](_0x337678)[_0x9f27('0x19')](_0x25966e);}};}function respondWithFilteredResult(_0x70e69f,_0x2bef79){return function(_0xcdf60){if(_0xcdf60){var _0x26f057=_0xcdf60['count'],_0xe20d3b=_0x2bef79[_0x9f27('0x1a')],_0x1cee54=_0x2bef79[_0x9f27('0x1a')]+_0x2bef79['limit'],_0x1f53a7;if(_0x1cee54>=_0x26f057){_0x1cee54=_0x26f057;_0x1f53a7=0xc8;}else{_0x1f53a7=0xce;}_0x70e69f[_0x9f27('0x18')](_0x1f53a7);return _0x70e69f[_0x9f27('0x1b')](_0x9f27('0x1c'),_0xe20d3b+'-'+_0x1cee54+'/'+_0x26f057)[_0x9f27('0x19')](_0xcdf60);}return null;};}function patchUpdates(_0x3b7700){return function(_0x13032b){try{jsonpatch[_0x9f27('0x1d')](_0x13032b,_0x3b7700,!![]);}catch(_0xa71ac2){return BPromise[_0x9f27('0x1e')](_0xa71ac2);}return _0x13032b[_0x9f27('0x1f')]();};}function saveUpdates(_0x3a1ebf,_0x2baf68){return function(_0xdd7e3a){if(_0xdd7e3a){return _0xdd7e3a[_0x9f27('0x20')](_0x3a1ebf)[_0x9f27('0x21')](function(_0x14aaf6){return _0x14aaf6;});}return null;};}function removeEntity(_0x32a2f6,_0x38a8ad){return function(_0x40fe81){if(_0x40fe81){return _0x40fe81[_0x9f27('0x22')]()[_0x9f27('0x21')](function(){_0x32a2f6[_0x9f27('0x18')](0xcc)[_0x9f27('0x23')]();});}};}function handleEntityNotFound(_0x5ba530,_0xd6614f){return function(_0x1dcd28){if(!_0x1dcd28){_0x5ba530['sendStatus'](0x194);}return _0x1dcd28;};}function handleError(_0x27b346,_0x26f897){_0x26f897=_0x26f897||0x1f4;return function(_0x337ff0){logger[_0x9f27('0x24')](_0x337ff0[_0x9f27('0x25')]);if(_0x337ff0[_0x9f27('0x26')]){delete _0x337ff0[_0x9f27('0x26')];}_0x27b346[_0x9f27('0x18')](_0x26f897)['send'](_0x337ff0);};}exports['index']=function(_0x2bf7ac,_0x222d7b){var _0x360032={},_0x4e06ad={},_0x5784e5={'count':0x0,'rows':[]};var _0x3a656a=_[_0x9f27('0x27')](db[_0x9f27('0x28')][_0x9f27('0x29')],function(_0x4e9af4){return{'name':_0x4e9af4[_0x9f27('0x2a')],'type':_0x4e9af4[_0x9f27('0x2b')][_0x9f27('0x2c')]};});_0x4e06ad[_0x9f27('0x2d')]=_[_0x9f27('0x27')](_0x3a656a,_0x9f27('0x26'));_0x4e06ad[_0x9f27('0x2e')]=_[_0x9f27('0x2f')](_0x2bf7ac[_0x9f27('0x2e')]);_0x4e06ad['filters']=_[_0x9f27('0x30')](_0x4e06ad['model'],_0x4e06ad[_0x9f27('0x2e')]);_0x360032[_0x9f27('0x31')]=_[_0x9f27('0x30')](_0x4e06ad[_0x9f27('0x2d')],qs['fields'](_0x2bf7ac['query'][_0x9f27('0x32')]));_0x360032[_0x9f27('0x31')]=_0x360032['attributes'][_0x9f27('0x33')]?_0x360032[_0x9f27('0x31')]:_0x4e06ad[_0x9f27('0x2d')];if(!_0x2bf7ac['query'][_0x9f27('0x34')](_0x9f27('0x35'))){_0x360032[_0x9f27('0x36')]=qs[_0x9f27('0x36')](_0x2bf7ac[_0x9f27('0x2e')][_0x9f27('0x36')]);_0x360032[_0x9f27('0x1a')]=qs[_0x9f27('0x1a')](_0x2bf7ac['query']['offset']);}_0x360032[_0x9f27('0x37')]=qs['sort'](_0x2bf7ac['query'][_0x9f27('0x38')]);_0x360032[_0x9f27('0x39')]=qs[_0x9f27('0x3a')](_['pick'](_0x2bf7ac[_0x9f27('0x2e')],_0x4e06ad[_0x9f27('0x3a')]));if(_0x2bf7ac['query'][_0x9f27('0x3b')]){_0x360032[_0x9f27('0x39')]=_[_0x9f27('0x3c')](_0x360032[_0x9f27('0x39')],{'$or':_['map'](_0x3a656a,function(_0x47703d){if(_0x47703d[_0x9f27('0x2b')]!=='VIRTUAL'){var _0x1430b2={};_0x1430b2[_0x47703d[_0x9f27('0x26')]]={'$like':'%'+_0x2bf7ac[_0x9f27('0x2e')][_0x9f27('0x3b')]+'%'};return _0x1430b2;}})});}_0x360032=_[_0x9f27('0x3c')]({},_0x360032,_0x2bf7ac[_0x9f27('0x3d')]);var _0x45d043={'where':_0x360032[_0x9f27('0x39')]};return db[_0x9f27('0x28')][_0x9f27('0x3e')](_0x45d043)['then'](function(_0x1fd8aa){_0x5784e5[_0x9f27('0x3e')]=_0x1fd8aa;if(_0x2bf7ac[_0x9f27('0x2e')]['includeAll']){_0x360032[_0x9f27('0x3f')]=[{'all':!![]}];}return db[_0x9f27('0x28')][_0x9f27('0x40')](_0x360032);})[_0x9f27('0x21')](function(_0x1c3ec4){_0x5784e5[_0x9f27('0x41')]=_0x1c3ec4;return _0x5784e5;})[_0x9f27('0x21')](respondWithFilteredResult(_0x222d7b,_0x360032))[_0x9f27('0x42')](handleError(_0x222d7b,null));};exports[_0x9f27('0x43')]=function(_0x4d7a4e,_0x164c86){var _0x2b260c={'raw':!![],'where':{'id':_0x4d7a4e[_0x9f27('0x44')]['id']}},_0x44ad70={};_0x44ad70[_0x9f27('0x2d')]=_['keys'](db[_0x9f27('0x28')][_0x9f27('0x29')]);_0x44ad70[_0x9f27('0x2e')]=_[_0x9f27('0x2f')](_0x4d7a4e['query']);_0x44ad70[_0x9f27('0x3a')]=_[_0x9f27('0x30')](_0x44ad70[_0x9f27('0x2d')],_0x44ad70[_0x9f27('0x2e')]);_0x2b260c[_0x9f27('0x31')]=_[_0x9f27('0x30')](_0x44ad70[_0x9f27('0x2d')],qs[_0x9f27('0x32')](_0x4d7a4e[_0x9f27('0x2e')][_0x9f27('0x32')]));_0x2b260c[_0x9f27('0x31')]=_0x2b260c[_0x9f27('0x31')][_0x9f27('0x33')]?_0x2b260c[_0x9f27('0x31')]:_0x44ad70['model'];if(_0x4d7a4e[_0x9f27('0x2e')][_0x9f27('0x45')]){_0x2b260c[_0x9f27('0x3f')]=[{'all':!![]}];}_0x2b260c=_[_0x9f27('0x3c')]({},_0x2b260c,_0x4d7a4e[_0x9f27('0x3d')]);return db[_0x9f27('0x28')][_0x9f27('0x46')](_0x2b260c)[_0x9f27('0x21')](handleEntityNotFound(_0x164c86,null))['then'](respondWithResult(_0x164c86,null))['catch'](handleError(_0x164c86,null));};exports['create']=function(_0x9d89db,_0x4ad417){return db[_0x9f27('0x28')][_0x9f27('0x47')](_0x9d89db[_0x9f27('0x48')],{})[_0x9f27('0x21')](respondWithResult(_0x4ad417,0xc9))[_0x9f27('0x42')](handleError(_0x4ad417,null));};exports['update']=function(_0x373938,_0x5c4897){if(_0x373938[_0x9f27('0x48')]['id']){delete _0x373938[_0x9f27('0x48')]['id'];}return db[_0x9f27('0x28')][_0x9f27('0x46')]({'where':{'id':_0x373938[_0x9f27('0x44')]['id']}})['then'](handleEntityNotFound(_0x5c4897,null))[_0x9f27('0x21')](saveUpdates(_0x373938[_0x9f27('0x48')],null))[_0x9f27('0x21')](respondWithResult(_0x5c4897,null))[_0x9f27('0x42')](handleError(_0x5c4897,null));};exports[_0x9f27('0x22')]=function(_0x119c0e,_0x16af1c){return db[_0x9f27('0x28')][_0x9f27('0x46')]({'where':{'id':_0x119c0e[_0x9f27('0x44')]['id']}})['then'](handleEntityNotFound(_0x16af1c,null))[_0x9f27('0x21')](removeEntity(_0x16af1c,null))[_0x9f27('0x42')](handleError(_0x16af1c,null));};exports[_0x9f27('0x49')]=function(_0x274cbe,_0x2abf0d){return db[_0x9f27('0x28')][_0x9f27('0x49')]()['then'](respondWithResult(_0x2abf0d,null))[_0x9f27('0x42')](handleError(_0x2abf0d,null));};
\ No newline at end of file
+var _0xfda9=['fields','length','hasOwnProperty','nolimit','order','sort','where','pick','merge','VIRTUAL','filter','MailQueueReport','includeAll','include','findAll','then','rows','catch','show','options','find','create','body','params','destroy','describe','html-pdf','eml-format','zip-dir','fast-json-patch','request-promise','moment','bluebird','util','path','sox','to-csv','ejs','lodash','squel','jsforce','desk.js','papaparse','ioredis','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/utils','../../mysqldb','end','json','count','offset','limit','set','Content-Range','apply','reject','save','update','sendStatus','stack','name','status','send','index','map','rawAttributes','fieldName','type','key','model','query','keys','filters','intersection','attributes'];(function(_0x40bffc,_0x3a45d7){var _0x3007e9=function(_0x4c8fda){while(--_0x4c8fda){_0x40bffc['push'](_0x40bffc['shift']());}};_0x3007e9(++_0x3a45d7);}(_0xfda9,0xb6));var _0x9fda=function(_0x46bc93,_0x537a2d){_0x46bc93=_0x46bc93-0x0;var _0x2e3731=_0xfda9[_0x46bc93];return _0x2e3731;};'use strict';var pdf=require(_0x9fda('0x0'));var emlformat=require(_0x9fda('0x1'));var rimraf=require('rimraf');var zipdir=require(_0x9fda('0x2'));var jsonpatch=require(_0x9fda('0x3'));var rp=require(_0x9fda('0x4'));var moment=require(_0x9fda('0x5'));var BPromise=require(_0x9fda('0x6'));var Mustache=require('mustache');var util=require(_0x9fda('0x7'));var path=require(_0x9fda('0x8'));var sox=require(_0x9fda('0x9'));var csv=require(_0x9fda('0xa'));var ejs=require(_0x9fda('0xb'));var fs=require('fs');var _=require(_0x9fda('0xc'));var squel=require(_0x9fda('0xd'));var crypto=require('crypto');var jsforce=require(_0x9fda('0xe'));var deskjs=require(_0x9fda('0xf'));var toCsv=require('to-csv');var querystring=require('querystring');var Papa=require(_0x9fda('0x10'));var Redis=require(_0x9fda('0x11'));var authService=require('../../components/auth/service');var qs=require('../../components/parsers/qs');var as=require(_0x9fda('0x12'));var hardwareService=require(_0x9fda('0x13'));var logger=require(_0x9fda('0x14'))(_0x9fda('0x15'));var utils=require(_0x9fda('0x16'));var config=require('../../config/environment');var db=require(_0x9fda('0x17'))['db'];function respondWithStatusCode(_0xf924c4,_0x5a3dde){_0x5a3dde=_0x5a3dde||0xcc;return function(_0x1a4c39){if(_0x1a4c39){return _0xf924c4['sendStatus'](_0x5a3dde);}return _0xf924c4['status'](_0x5a3dde)[_0x9fda('0x18')]();};}function respondWithResult(_0x33855b,_0xae9a50){_0xae9a50=_0xae9a50||0xc8;return function(_0x419ba0){if(_0x419ba0){return _0x33855b['status'](_0xae9a50)[_0x9fda('0x19')](_0x419ba0);}};}function respondWithFilteredResult(_0x51119e,_0x1752c5){return function(_0xb84587){if(_0xb84587){var _0x3fa01e=_0xb84587[_0x9fda('0x1a')],_0x4e5679=_0x1752c5[_0x9fda('0x1b')],_0x4b35d6=_0x1752c5[_0x9fda('0x1b')]+_0x1752c5[_0x9fda('0x1c')],_0x301b7e;if(_0x4b35d6>=_0x3fa01e){_0x4b35d6=_0x3fa01e;_0x301b7e=0xc8;}else{_0x301b7e=0xce;}_0x51119e['status'](_0x301b7e);return _0x51119e[_0x9fda('0x1d')](_0x9fda('0x1e'),_0x4e5679+'-'+_0x4b35d6+'/'+_0x3fa01e)[_0x9fda('0x19')](_0xb84587);}return null;};}function patchUpdates(_0x36a105){return function(_0x57ad65){try{jsonpatch[_0x9fda('0x1f')](_0x57ad65,_0x36a105,!![]);}catch(_0xf31ae9){return BPromise[_0x9fda('0x20')](_0xf31ae9);}return _0x57ad65[_0x9fda('0x21')]();};}function saveUpdates(_0x22a284,_0x4a6188){return function(_0x287970){if(_0x287970){return _0x287970[_0x9fda('0x22')](_0x22a284)['then'](function(_0x59ddc4){return _0x59ddc4;});}return null;};}function removeEntity(_0x3e09be,_0x50b55a){return function(_0x3323a3){if(_0x3323a3){return _0x3323a3['destroy']()['then'](function(){_0x3e09be['status'](0xcc)['end']();});}};}function handleEntityNotFound(_0x5b4bb0,_0x1d32a4){return function(_0x5cbe1e){if(!_0x5cbe1e){_0x5b4bb0[_0x9fda('0x23')](0x194);}return _0x5cbe1e;};}function handleError(_0x379c30,_0x5087fe){_0x5087fe=_0x5087fe||0x1f4;return function(_0x663e79){logger['error'](_0x663e79[_0x9fda('0x24')]);if(_0x663e79[_0x9fda('0x25')]){delete _0x663e79[_0x9fda('0x25')];}_0x379c30[_0x9fda('0x26')](_0x5087fe)[_0x9fda('0x27')](_0x663e79);};}exports[_0x9fda('0x28')]=function(_0x1bc5db,_0xbb590d){var _0x27b0cc={},_0xf247c3={},_0x2669ba={'count':0x0,'rows':[]};var _0x17428d=_[_0x9fda('0x29')](db['MailQueueReport'][_0x9fda('0x2a')],function(_0x4b0f96){return{'name':_0x4b0f96[_0x9fda('0x2b')],'type':_0x4b0f96[_0x9fda('0x2c')][_0x9fda('0x2d')]};});_0xf247c3[_0x9fda('0x2e')]=_[_0x9fda('0x29')](_0x17428d,'name');_0xf247c3[_0x9fda('0x2f')]=_[_0x9fda('0x30')](_0x1bc5db[_0x9fda('0x2f')]);_0xf247c3[_0x9fda('0x31')]=_[_0x9fda('0x32')](_0xf247c3[_0x9fda('0x2e')],_0xf247c3['query']);_0x27b0cc[_0x9fda('0x33')]=_['intersection'](_0xf247c3[_0x9fda('0x2e')],qs['fields'](_0x1bc5db[_0x9fda('0x2f')][_0x9fda('0x34')]));_0x27b0cc[_0x9fda('0x33')]=_0x27b0cc[_0x9fda('0x33')][_0x9fda('0x35')]?_0x27b0cc[_0x9fda('0x33')]:_0xf247c3[_0x9fda('0x2e')];if(!_0x1bc5db[_0x9fda('0x2f')][_0x9fda('0x36')](_0x9fda('0x37'))){_0x27b0cc['limit']=qs[_0x9fda('0x1c')](_0x1bc5db[_0x9fda('0x2f')]['limit']);_0x27b0cc[_0x9fda('0x1b')]=qs[_0x9fda('0x1b')](_0x1bc5db[_0x9fda('0x2f')]['offset']);}_0x27b0cc[_0x9fda('0x38')]=qs[_0x9fda('0x39')](_0x1bc5db[_0x9fda('0x2f')][_0x9fda('0x39')]);_0x27b0cc[_0x9fda('0x3a')]=qs['filters'](_[_0x9fda('0x3b')](_0x1bc5db[_0x9fda('0x2f')],_0xf247c3[_0x9fda('0x31')]));if(_0x1bc5db[_0x9fda('0x2f')]['filter']){_0x27b0cc[_0x9fda('0x3a')]=_[_0x9fda('0x3c')](_0x27b0cc[_0x9fda('0x3a')],{'$or':_[_0x9fda('0x29')](_0x17428d,function(_0x2a960c){if(_0x2a960c['type']!==_0x9fda('0x3d')){var _0x49f780={};_0x49f780[_0x2a960c[_0x9fda('0x25')]]={'$like':'%'+_0x1bc5db[_0x9fda('0x2f')][_0x9fda('0x3e')]+'%'};return _0x49f780;}})});}_0x27b0cc=_[_0x9fda('0x3c')]({},_0x27b0cc,_0x1bc5db['options']);var _0x591e23={'where':_0x27b0cc['where']};return db[_0x9fda('0x3f')][_0x9fda('0x1a')](_0x591e23)['then'](function(_0x3f7f55){_0x2669ba[_0x9fda('0x1a')]=_0x3f7f55;if(_0x1bc5db[_0x9fda('0x2f')][_0x9fda('0x40')]){_0x27b0cc[_0x9fda('0x41')]=[{'all':!![]}];}return db['MailQueueReport'][_0x9fda('0x42')](_0x27b0cc);})[_0x9fda('0x43')](function(_0x561036){_0x2669ba[_0x9fda('0x44')]=_0x561036;return _0x2669ba;})[_0x9fda('0x43')](respondWithFilteredResult(_0xbb590d,_0x27b0cc))[_0x9fda('0x45')](handleError(_0xbb590d,null));};exports[_0x9fda('0x46')]=function(_0x7e5101,_0x4f126e){var _0x5ac1a9={'raw':!![],'where':{'id':_0x7e5101['params']['id']}},_0x5bb461={};_0x5bb461[_0x9fda('0x2e')]=_['keys'](db[_0x9fda('0x3f')][_0x9fda('0x2a')]);_0x5bb461[_0x9fda('0x2f')]=_[_0x9fda('0x30')](_0x7e5101[_0x9fda('0x2f')]);_0x5bb461[_0x9fda('0x31')]=_[_0x9fda('0x32')](_0x5bb461[_0x9fda('0x2e')],_0x5bb461[_0x9fda('0x2f')]);_0x5ac1a9['attributes']=_['intersection'](_0x5bb461[_0x9fda('0x2e')],qs['fields'](_0x7e5101[_0x9fda('0x2f')][_0x9fda('0x34')]));_0x5ac1a9[_0x9fda('0x33')]=_0x5ac1a9[_0x9fda('0x33')][_0x9fda('0x35')]?_0x5ac1a9[_0x9fda('0x33')]:_0x5bb461[_0x9fda('0x2e')];if(_0x7e5101[_0x9fda('0x2f')][_0x9fda('0x40')]){_0x5ac1a9['include']=[{'all':!![]}];}_0x5ac1a9=_[_0x9fda('0x3c')]({},_0x5ac1a9,_0x7e5101[_0x9fda('0x47')]);return db['MailQueueReport'][_0x9fda('0x48')](_0x5ac1a9)['then'](handleEntityNotFound(_0x4f126e,null))['then'](respondWithResult(_0x4f126e,null))[_0x9fda('0x45')](handleError(_0x4f126e,null));};exports[_0x9fda('0x49')]=function(_0x3149e3,_0x2e9f35){return db['MailQueueReport'][_0x9fda('0x49')](_0x3149e3['body'],{})[_0x9fda('0x43')](respondWithResult(_0x2e9f35,0xc9))[_0x9fda('0x45')](handleError(_0x2e9f35,null));};exports['update']=function(_0x156cd1,_0x3c368c){if(_0x156cd1[_0x9fda('0x4a')]['id']){delete _0x156cd1[_0x9fda('0x4a')]['id'];}return db[_0x9fda('0x3f')][_0x9fda('0x48')]({'where':{'id':_0x156cd1[_0x9fda('0x4b')]['id']}})['then'](handleEntityNotFound(_0x3c368c,null))[_0x9fda('0x43')](saveUpdates(_0x156cd1['body'],null))[_0x9fda('0x43')](respondWithResult(_0x3c368c,null))[_0x9fda('0x45')](handleError(_0x3c368c,null));};exports[_0x9fda('0x4c')]=function(_0x81d2c5,_0x6bacfd){return db[_0x9fda('0x3f')][_0x9fda('0x48')]({'where':{'id':_0x81d2c5['params']['id']}})[_0x9fda('0x43')](handleEntityNotFound(_0x6bacfd,null))[_0x9fda('0x43')](removeEntity(_0x6bacfd,null))[_0x9fda('0x45')](handleError(_0x6bacfd,null));};exports[_0x9fda('0x4d')]=function(_0x456afd,_0x4393cc){return db['MailQueueReport'][_0x9fda('0x4d')]()[_0x9fda('0x43')](respondWithResult(_0x4393cc,null))[_0x9fda('0x45')](handleError(_0x4393cc,null));};
\ No newline at end of file
diff --git a/server/api/mailQueueReport/mailQueueReport.model.js b/server/api/mailQueueReport/mailQueueReport.model.js
index ba5b147..fda70d0 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 _0xe52b=['report_mail_queue','uniqueid','lodash','moment','bluebird','request-promise','path','../../config/environment','exports','define'];(function(_0x3dd15e,_0x1f0015){var _0x231fd0=function(_0x4f680a){while(--_0x4f680a){_0x3dd15e['push'](_0x3dd15e['shift']());}};_0x231fd0(++_0x1f0015);}(_0xe52b,0x11a));var _0xbe52=function(_0x4bdc51,_0x2c3adf){_0x4bdc51=_0x4bdc51-0x0;var _0x5db2b8=_0xe52b[_0x4bdc51];return _0x5db2b8;};'use strict';var _=require(_0xbe52('0x0'));var util=require('util');var logger=require('../../config/logger')('api');var moment=require(_0xbe52('0x1'));var BPromise=require(_0xbe52('0x2'));var rp=require(_0xbe52('0x3'));var fs=require('fs');var path=require(_0xbe52('0x4'));var rimraf=require('rimraf');var config=require(_0xbe52('0x5'));var attributes=require('./mailQueueReport.attributes');module[_0xbe52('0x6')]=function(_0x4595c4,_0x2266a3){return _0x4595c4[_0xbe52('0x7')]('MailQueueReport',attributes,{'tableName':_0xbe52('0x8'),'paranoid':![],'indexes':[{'name':_0xbe52('0x9'),'fields':[_0xbe52('0x9')]}],'timestamps':!![]});};
\ No newline at end of file
+var _0x1c2a=['../../config/environment','./mailQueueReport.attributes','exports','define','MailQueueReport','uniqueid','lodash','util','api','moment','bluebird','request-promise','path','rimraf'];(function(_0x26b80e,_0x5c9333){var _0x84a8a8=function(_0x2e5b4a){while(--_0x2e5b4a){_0x26b80e['push'](_0x26b80e['shift']());}};_0x84a8a8(++_0x5c9333);}(_0x1c2a,0x68));var _0xa1c2=function(_0xe1bf9b,_0x5824be){_0xe1bf9b=_0xe1bf9b-0x0;var _0x5030c4=_0x1c2a[_0xe1bf9b];return _0x5030c4;};'use strict';var _=require(_0xa1c2('0x0'));var util=require(_0xa1c2('0x1'));var logger=require('../../config/logger')(_0xa1c2('0x2'));var moment=require(_0xa1c2('0x3'));var BPromise=require(_0xa1c2('0x4'));var rp=require(_0xa1c2('0x5'));var fs=require('fs');var path=require(_0xa1c2('0x6'));var rimraf=require(_0xa1c2('0x7'));var config=require(_0xa1c2('0x8'));var attributes=require(_0xa1c2('0x9'));module[_0xa1c2('0xa')]=function(_0x14fec9,_0x183f12){return _0x14fec9[_0xa1c2('0xb')](_0xa1c2('0xc'),attributes,{'tableName':'report_mail_queue','paranoid':![],'indexes':[{'name':_0xa1c2('0xd'),'fields':['uniqueid']}],'timestamps':!![]});};
\ No newline at end of file
diff --git a/server/api/mailQueueReport/mailQueueReport.rpc.js b/server/api/mailQueueReport/mailQueueReport.rpc.js
index c59d7f7..efdb42b 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 _0x781d=['request\x20sent','result','catch','MailQueueReport','create','body','options','raw','CreateMailQueueReport','UpdateMailQueueReport','update','where','attributes','limit','stringify','lodash','util','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','client','http','then','info','MailQueueReport,\x20%s,\x20%s','debug','MailQueueReport,\x20%s,\x20%s,\x20%s','error','code','message'];(function(_0x25bf5c,_0x14339b){var _0x18661c=function(_0x40c574){while(--_0x40c574){_0x25bf5c['push'](_0x25bf5c['shift']());}};_0x18661c(++_0x14339b);}(_0x781d,0x14a));var _0xd781=function(_0x618414,_0x1a7a60){_0x618414=_0x618414-0x0;var _0x21c19a=_0x781d[_0x618414];return _0x21c19a;};'use strict';var _=require(_0xd781('0x0'));var util=require(_0xd781('0x1'));var moment=require('moment');var BPromise=require('bluebird');var rs=require(_0xd781('0x2'));var fs=require('fs');var Redis=require(_0xd781('0x3'));var db=require(_0xd781('0x4'))['db'];var utils=require(_0xd781('0x5'));var logger=require(_0xd781('0x6'))(_0xd781('0x7'));var config=require(_0xd781('0x8'));var jayson=require(_0xd781('0x9'));var client=jayson[_0xd781('0xa')][_0xd781('0xb')]({'port':0x232a});function respondWithRpcPromise(_0x5a07f0,_0x133509,_0x1a242d){return new BPromise(function(_0x50610d,_0x248172){return client['request'](_0x5a07f0,_0x1a242d)[_0xd781('0xc')](function(_0x5c18c8){logger[_0xd781('0xd')](_0xd781('0xe'),_0x133509,'request\x20sent');logger[_0xd781('0xf')](_0xd781('0x10'),_0x133509,'request\x20sent',JSON['stringify'](_0x5c18c8));if(_0x5c18c8[_0xd781('0x11')]){if(_0x5c18c8[_0xd781('0x11')][_0xd781('0x12')]===0x1f4){logger[_0xd781('0x11')](_0xd781('0xe'),_0x133509,_0x5c18c8[_0xd781('0x11')][_0xd781('0x13')]);return _0x248172(_0x5c18c8[_0xd781('0x11')][_0xd781('0x13')]);}logger[_0xd781('0x11')](_0xd781('0xe'),_0x133509,_0x5c18c8['error'][_0xd781('0x13')]);return _0x50610d(_0x5c18c8[_0xd781('0x11')]['message']);}else{logger[_0xd781('0xd')]('MailQueueReport,\x20%s,\x20%s',_0x133509,_0xd781('0x14'));_0x50610d(_0x5c18c8[_0xd781('0x15')][_0xd781('0x13')]);}})[_0xd781('0x16')](function(_0x42a9c1){logger[_0xd781('0x11')](_0xd781('0xe'),_0x133509,_0x42a9c1);_0x248172(_0x42a9c1);});});}exports['CreateMailQueueReport']=function(_0x1407fc){var _0x3f2922=this;return new Promise(function(_0x395d9c,_0x2f1273){return db[_0xd781('0x17')][_0xd781('0x18')](_0x1407fc[_0xd781('0x19')],{'raw':_0x1407fc[_0xd781('0x1a')]?_0x1407fc['options'][_0xd781('0x1b')]===undefined?!![]:![]:!![]})[_0xd781('0xc')](function(_0x1036d3){logger[_0xd781('0xd')](_0xd781('0x1c'),_0x1407fc);logger[_0xd781('0xf')](_0xd781('0x1c'),_0x1407fc,JSON['stringify'](_0x1036d3));_0x395d9c(_0x1036d3);})[_0xd781('0x16')](function(_0x4e2c56){logger['error'](_0xd781('0x1c'),_0x4e2c56['message'],_0x1407fc);_0x2f1273(_0x3f2922[_0xd781('0x11')](0x1f4,_0x4e2c56[_0xd781('0x13')]));});});};exports[_0xd781('0x1d')]=function(_0x31bf57){var _0x391461=this;return new Promise(function(_0x28f4fe,_0x221f14){return db[_0xd781('0x17')][_0xd781('0x1e')](_0x31bf57['body'],{'raw':_0x31bf57['options']?_0x31bf57[_0xd781('0x1a')][_0xd781('0x1b')]===undefined?!![]:![]:!![],'individualHooks':!![],'where':_0x31bf57[_0xd781('0x1a')]?_0x31bf57['options'][_0xd781('0x1f')]||null:null,'attributes':_0x31bf57['options']?_0x31bf57['options'][_0xd781('0x20')]||null:null,'limit':_0x31bf57['options']?_0x31bf57[_0xd781('0x1a')][_0xd781('0x21')]||null:null})['then'](function(_0x5b6b9d){logger[_0xd781('0xd')]('UpdateMailQueueReport',_0x31bf57);logger[_0xd781('0xf')]('UpdateMailQueueReport',_0x31bf57,JSON[_0xd781('0x22')](_0x5b6b9d));_0x28f4fe(_0x5b6b9d);})[_0xd781('0x16')](function(_0x556127){logger['error'](_0xd781('0x1d'),_0x556127[_0xd781('0x13')],_0x31bf57);_0x221f14(_0x391461[_0xd781('0x11')](0x1f4,_0x556127['message']));});});};
\ 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(_0x50f0e1,_0x3ae980){var _0x2258a4=function(_0xd9c5be){while(--_0xd9c5be){_0x50f0e1['push'](_0x50f0e1['shift']());}};_0x2258a4(++_0x3ae980);}(_0x7a54,0x106));var _0x47a5=function(_0xb93636,_0x1bf01d){_0xb93636=_0xb93636-0x0;var _0x4b77a0=_0x7a54[_0xb93636];return _0x4b77a0;};'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 e45590c..f480ab9 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 _0xd835=['Router','../../components/interaction/service','../../config/environment','exports','multer','util','path','express'];(function(_0x4733d3,_0x454290){var _0x1b9a44=function(_0x1a93bb){while(--_0x1a93bb){_0x4733d3['push'](_0x4733d3['shift']());}};_0x1b9a44(++_0x454290);}(_0xd835,0x13c));var _0x5d83=function(_0x3203a1,_0x46c498){_0x3203a1=_0x3203a1-0x0;var _0x24215e=_0xd835[_0x3203a1];return _0x24215e;};'use strict';var multer=require(_0x5d83('0x0'));var util=require(_0x5d83('0x1'));var path=require(_0x5d83('0x2'));var timeout=require('connect-timeout');var express=require(_0x5d83('0x3'));var router=express[_0x5d83('0x4')]();var auth=require('../../components/auth/service');var interaction=require(_0x5d83('0x5'));var config=require(_0x5d83('0x6'));module[_0x5d83('0x7')]=router;
\ No newline at end of file
+var _0x7ef8=['connect-timeout','express','Router','../../components/auth/service','../../components/interaction/service','../../config/environment','exports','util'];(function(_0x72a4d0,_0x41a189){var _0x283c26=function(_0xb268b3){while(--_0xb268b3){_0x72a4d0['push'](_0x72a4d0['shift']());}};_0x283c26(++_0x41a189);}(_0x7ef8,0x9f));var _0x87ef=function(_0x33a13d,_0x1073ec){_0x33a13d=_0x33a13d-0x0;var _0xbf0b74=_0x7ef8[_0x33a13d];return _0xbf0b74;};'use strict';var multer=require('multer');var util=require(_0x87ef('0x0'));var path=require('path');var timeout=require(_0x87ef('0x1'));var express=require(_0x87ef('0x2'));var router=express[_0x87ef('0x3')]();var auth=require(_0x87ef('0x4'));var interaction=require(_0x87ef('0x5'));var config=require(_0x87ef('0x6'));module[_0x87ef('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 4e16d63..4370742 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 _0x2478=['username','INTEGER','BOOLEAN','sequelize','STRING'];(function(_0x477c2a,_0x178659){var _0xac5abb=function(_0x7ead5a){while(--_0x7ead5a){_0x477c2a['push'](_0x477c2a['shift']());}};_0xac5abb(++_0x178659);}(_0x2478,0x12f));var _0x8247=function(_0x341e0f,_0x4a09d0){_0x341e0f=_0x341e0f-0x0;var _0x59555a=_0x2478[_0x341e0f];return _0x59555a;};'use strict';var Sequelize=require(_0x8247('0x0'));module['exports']={'description':{'type':Sequelize['STRING']},'host':{'type':Sequelize['STRING']},'authentication':{'type':Sequelize['BOOLEAN'],'defaultValue':!![]},'user':{'type':Sequelize[_0x8247('0x1')],'unique':_0x8247('0x2')},'password':{'type':Sequelize[_0x8247('0x1')]},'port':{'type':Sequelize[_0x8247('0x3')]},'tls':{'type':Sequelize[_0x8247('0x4')],'defaultValue':!![]},'mailbox':{'type':Sequelize[_0x8247('0x1')],'defaultValue':'INBOX'},'connTimeout':{'type':Sequelize[_0x8247('0x3')],'defaultValue':0xa},'authTimeout':{'type':Sequelize[_0x8247('0x3')],'defaultValue':0x5},'service':{'type':Sequelize[_0x8247('0x1')]}};
\ No newline at end of file
+var _0x9e3a=['exports','STRING','BOOLEAN','username','INTEGER','INBOX','sequelize'];(function(_0xe5842c,_0x5abc8f){var _0x1d896b=function(_0x53e179){while(--_0x53e179){_0xe5842c['push'](_0xe5842c['shift']());}};_0x1d896b(++_0x5abc8f);}(_0x9e3a,0x18e));var _0xa9e3=function(_0x272c6a,_0x1ec866){_0x272c6a=_0x272c6a-0x0;var _0x20c894=_0x9e3a[_0x272c6a];return _0x20c894;};'use strict';var Sequelize=require(_0xa9e3('0x0'));module[_0xa9e3('0x1')]={'description':{'type':Sequelize[_0xa9e3('0x2')]},'host':{'type':Sequelize[_0xa9e3('0x2')]},'authentication':{'type':Sequelize[_0xa9e3('0x3')],'defaultValue':!![]},'user':{'type':Sequelize[_0xa9e3('0x2')],'unique':_0xa9e3('0x4')},'password':{'type':Sequelize['STRING']},'port':{'type':Sequelize[_0xa9e3('0x5')]},'tls':{'type':Sequelize[_0xa9e3('0x3')],'defaultValue':!![]},'mailbox':{'type':Sequelize[_0xa9e3('0x2')],'defaultValue':_0xa9e3('0x6')},'connTimeout':{'type':Sequelize['INTEGER'],'defaultValue':0xa},'authTimeout':{'type':Sequelize[_0xa9e3('0x5')],'defaultValue':0x5},'service':{'type':Sequelize[_0xa9e3('0x2')]}};
\ No newline at end of file
diff --git a/server/api/mailServerIn/mailServerIn.model.js b/server/api/mailServerIn/mailServerIn.model.js
index d96411a..ee31ad5 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 _0xd824=['rimraf','../../config/environment','MailServerIn','mail_servers_in','lodash','util','moment','bluebird','request-promise','path'];(function(_0x24e25e,_0xbd189d){var _0x174e4f=function(_0x18c3ce){while(--_0x18c3ce){_0x24e25e['push'](_0x24e25e['shift']());}};_0x174e4f(++_0xbd189d);}(_0xd824,0xc2));var _0x4d82=function(_0x57b54c,_0x54ce0d){_0x57b54c=_0x57b54c-0x0;var _0x59cc19=_0xd824[_0x57b54c];return _0x59cc19;};'use strict';var _=require(_0x4d82('0x0'));var util=require(_0x4d82('0x1'));var logger=require('../../config/logger')('api');var moment=require(_0x4d82('0x2'));var BPromise=require(_0x4d82('0x3'));var rp=require(_0x4d82('0x4'));var fs=require('fs');var path=require(_0x4d82('0x5'));var rimraf=require(_0x4d82('0x6'));var config=require(_0x4d82('0x7'));var attributes=require('./mailServerIn.attributes');module['exports']=function(_0xd00023,_0x583c7c){return _0xd00023['define'](_0x4d82('0x8'),attributes,{'tableName':_0x4d82('0x9'),'paranoid':![],'indexes':[],'timestamps':!![]});};
\ No newline at end of file
+var _0x0598=['MailServerIn','mail_servers_in','lodash','util','api','request-promise','path','exports'];(function(_0x56f7e2,_0x145392){var _0x36240b=function(_0x216ff7){while(--_0x216ff7){_0x56f7e2['push'](_0x56f7e2['shift']());}};_0x36240b(++_0x145392);}(_0x0598,0x92));var _0x8059=function(_0x21002a,_0x3bcc10){_0x21002a=_0x21002a-0x0;var _0x43fe11=_0x0598[_0x21002a];return _0x43fe11;};'use strict';var _=require(_0x8059('0x0'));var util=require(_0x8059('0x1'));var logger=require('../../config/logger')(_0x8059('0x2'));var moment=require('moment');var BPromise=require('bluebird');var rp=require(_0x8059('0x3'));var fs=require('fs');var path=require(_0x8059('0x4'));var rimraf=require('rimraf');var config=require('../../config/environment');var attributes=require('./mailServerIn.attributes');module[_0x8059('0x5')]=function(_0xa7d7c1,_0x512c0f){return _0xa7d7c1['define'](_0x8059('0x6'),attributes,{'tableName':_0x8059('0x7'),'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 1088343..fcd513b 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 _0x0e0d=['then','info','MailServerIn,\x20%s,\x20%s','debug','request\x20sent','error','code','message','result','catch','MailServerIn','options','where','attributes','limit','include','map','model','GetMailServerIn','lodash','util','moment','randomstring','ioredis','../../mysqldb','rpc','../../config/environment','client','request'];(function(_0x32c66f,_0xdfe712){var _0xfa00d1=function(_0x584a71){while(--_0x584a71){_0x32c66f['push'](_0x32c66f['shift']());}};_0xfa00d1(++_0xdfe712);}(_0x0e0d,0x6a));var _0xd0e0=function(_0x3bf83f,_0x181cac){_0x3bf83f=_0x3bf83f-0x0;var _0x22c4a9=_0x0e0d[_0x3bf83f];return _0x22c4a9;};'use strict';var _=require(_0xd0e0('0x0'));var util=require(_0xd0e0('0x1'));var moment=require(_0xd0e0('0x2'));var BPromise=require('bluebird');var rs=require(_0xd0e0('0x3'));var fs=require('fs');var Redis=require(_0xd0e0('0x4'));var db=require(_0xd0e0('0x5'))['db'];var utils=require('../../config/utils');var logger=require('../../config/logger')(_0xd0e0('0x6'));var config=require(_0xd0e0('0x7'));var jayson=require('jayson/promise');var client=jayson[_0xd0e0('0x8')]['http']({'port':0x232a});function respondWithRpcPromise(_0xca3fd5,_0x4e286e,_0x3c1144){return new BPromise(function(_0x17e984,_0x5153b4){return client[_0xd0e0('0x9')](_0xca3fd5,_0x3c1144)[_0xd0e0('0xa')](function(_0x1c853b){logger[_0xd0e0('0xb')](_0xd0e0('0xc'),_0x4e286e,'request\x20sent');logger[_0xd0e0('0xd')]('MailServerIn,\x20%s,\x20%s,\x20%s',_0x4e286e,_0xd0e0('0xe'),JSON['stringify'](_0x1c853b));if(_0x1c853b[_0xd0e0('0xf')]){if(_0x1c853b[_0xd0e0('0xf')][_0xd0e0('0x10')]===0x1f4){logger[_0xd0e0('0xf')]('MailServerIn,\x20%s,\x20%s',_0x4e286e,_0x1c853b[_0xd0e0('0xf')][_0xd0e0('0x11')]);return _0x5153b4(_0x1c853b[_0xd0e0('0xf')][_0xd0e0('0x11')]);}logger[_0xd0e0('0xf')](_0xd0e0('0xc'),_0x4e286e,_0x1c853b[_0xd0e0('0xf')]['message']);return _0x17e984(_0x1c853b['error'][_0xd0e0('0x11')]);}else{logger[_0xd0e0('0xb')](_0xd0e0('0xc'),_0x4e286e,'request\x20sent');_0x17e984(_0x1c853b[_0xd0e0('0x12')][_0xd0e0('0x11')]);}})[_0xd0e0('0x13')](function(_0x63dc4f){logger[_0xd0e0('0xf')](_0xd0e0('0xc'),_0x4e286e,_0x63dc4f);_0x5153b4(_0x63dc4f);});});}exports['GetMailServerIn']=function(_0x3dfe05){var _0x266ad5=this;return new Promise(function(_0x134741,_0x3910ef){return db[_0xd0e0('0x14')]['findAll']({'raw':_0x3dfe05[_0xd0e0('0x15')]?_0x3dfe05[_0xd0e0('0x15')]['raw']===undefined?!![]:![]:!![],'where':_0x3dfe05[_0xd0e0('0x15')]?_0x3dfe05[_0xd0e0('0x15')][_0xd0e0('0x16')]||null:null,'attributes':_0x3dfe05[_0xd0e0('0x15')]?_0x3dfe05['options'][_0xd0e0('0x17')]||null:null,'limit':_0x3dfe05[_0xd0e0('0x15')]?_0x3dfe05[_0xd0e0('0x15')][_0xd0e0('0x18')]||null:null,'include':_0x3dfe05[_0xd0e0('0x15')]?_0x3dfe05[_0xd0e0('0x15')][_0xd0e0('0x19')]?_[_0xd0e0('0x1a')](_0x3dfe05['options'][_0xd0e0('0x19')],function(_0x311d10){return{'model':db[_0x311d10[_0xd0e0('0x1b')]],'as':_0x311d10['as'],'attributes':_0x311d10[_0xd0e0('0x17')],'include':_0x311d10[_0xd0e0('0x19')]?_[_0xd0e0('0x1a')](_0x311d10[_0xd0e0('0x19')],function(_0x132479){return{'model':db[_0x132479[_0xd0e0('0x1b')]],'as':_0x132479['as'],'attributes':_0x132479[_0xd0e0('0x17')],'include':_0x132479['include']?_['map'](_0x132479[_0xd0e0('0x19')],function(_0x1f68dd){return{'model':db[_0x1f68dd[_0xd0e0('0x1b')]],'as':_0x1f68dd['as'],'attributes':_0x1f68dd[_0xd0e0('0x17')]};}):[]};}):[]};}):[]:[]})[_0xd0e0('0xa')](function(_0x588ffa){logger[_0xd0e0('0xb')](_0xd0e0('0x1c'),_0x3dfe05);logger[_0xd0e0('0xd')]('GetMailServerIn',_0x3dfe05,JSON['stringify'](_0x588ffa));_0x134741(_0x588ffa);})[_0xd0e0('0x13')](function(_0x4ca71a){logger[_0xd0e0('0xf')](_0xd0e0('0x1c'),_0x4ca71a[_0xd0e0('0x11')],_0x3dfe05);_0x3910ef(_0x266ad5[_0xd0e0('0xf')](0x1f4,_0x4ca71a[_0xd0e0('0x11')]));});});};
\ No newline at end of file
+var _0x09d8=['MailServerIn,\x20%s,\x20%s,\x20%s','stringify','error','code','message','info','request\x20sent','result','catch','MailServerIn','options','raw','where','attributes','limit','map','include','model','GetMailServerIn','lodash','util','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','../../config/environment','jayson/promise','client','http','request','then','MailServerIn,\x20%s,\x20%s','debug'];(function(_0x186dbf,_0x356638){var _0x378d99=function(_0x2ce906){while(--_0x2ce906){_0x186dbf['push'](_0x186dbf['shift']());}};_0x378d99(++_0x356638);}(_0x09d8,0x1c3));var _0x809d=function(_0x4b95ca,_0x2a7579){_0x4b95ca=_0x4b95ca-0x0;var _0x235987=_0x09d8[_0x4b95ca];return _0x235987;};'use strict';var _=require(_0x809d('0x0'));var util=require(_0x809d('0x1'));var moment=require(_0x809d('0x2'));var BPromise=require(_0x809d('0x3'));var rs=require(_0x809d('0x4'));var fs=require('fs');var Redis=require(_0x809d('0x5'));var db=require(_0x809d('0x6'))['db'];var utils=require(_0x809d('0x7'));var logger=require(_0x809d('0x8'))('rpc');var config=require(_0x809d('0x9'));var jayson=require(_0x809d('0xa'));var client=jayson[_0x809d('0xb')][_0x809d('0xc')]({'port':0x232a});function respondWithRpcPromise(_0x21c72c,_0x5c1bfc,_0x39920a){return new BPromise(function(_0x6c6fe4,_0x33a0dc){return client[_0x809d('0xd')](_0x21c72c,_0x39920a)[_0x809d('0xe')](function(_0x30de63){logger['info'](_0x809d('0xf'),_0x5c1bfc,'request\x20sent');logger[_0x809d('0x10')](_0x809d('0x11'),_0x5c1bfc,'request\x20sent',JSON[_0x809d('0x12')](_0x30de63));if(_0x30de63[_0x809d('0x13')]){if(_0x30de63[_0x809d('0x13')][_0x809d('0x14')]===0x1f4){logger['error'](_0x809d('0xf'),_0x5c1bfc,_0x30de63[_0x809d('0x13')][_0x809d('0x15')]);return _0x33a0dc(_0x30de63[_0x809d('0x13')][_0x809d('0x15')]);}logger[_0x809d('0x13')](_0x809d('0xf'),_0x5c1bfc,_0x30de63['error'][_0x809d('0x15')]);return _0x6c6fe4(_0x30de63[_0x809d('0x13')]['message']);}else{logger[_0x809d('0x16')](_0x809d('0xf'),_0x5c1bfc,_0x809d('0x17'));_0x6c6fe4(_0x30de63[_0x809d('0x18')][_0x809d('0x15')]);}})[_0x809d('0x19')](function(_0x4da8ef){logger[_0x809d('0x13')]('MailServerIn,\x20%s,\x20%s',_0x5c1bfc,_0x4da8ef);_0x33a0dc(_0x4da8ef);});});}exports['GetMailServerIn']=function(_0x2ad088){var _0x4838b2=this;return new Promise(function(_0x16e9c0,_0x476a38){return db[_0x809d('0x1a')]['findAll']({'raw':_0x2ad088[_0x809d('0x1b')]?_0x2ad088[_0x809d('0x1b')][_0x809d('0x1c')]===undefined?!![]:![]:!![],'where':_0x2ad088['options']?_0x2ad088[_0x809d('0x1b')][_0x809d('0x1d')]||null:null,'attributes':_0x2ad088['options']?_0x2ad088['options'][_0x809d('0x1e')]||null:null,'limit':_0x2ad088['options']?_0x2ad088[_0x809d('0x1b')][_0x809d('0x1f')]||null:null,'include':_0x2ad088['options']?_0x2ad088['options']['include']?_[_0x809d('0x20')](_0x2ad088['options']['include'],function(_0x3774a0){return{'model':db[_0x3774a0['model']],'as':_0x3774a0['as'],'attributes':_0x3774a0[_0x809d('0x1e')],'include':_0x3774a0[_0x809d('0x21')]?_[_0x809d('0x20')](_0x3774a0[_0x809d('0x21')],function(_0xcb6051){return{'model':db[_0xcb6051[_0x809d('0x22')]],'as':_0xcb6051['as'],'attributes':_0xcb6051[_0x809d('0x1e')],'include':_0xcb6051[_0x809d('0x21')]?_['map'](_0xcb6051[_0x809d('0x21')],function(_0xec9cc0){return{'model':db[_0xec9cc0['model']],'as':_0xec9cc0['as'],'attributes':_0xec9cc0['attributes']};}):[]};}):[]};}):[]:[]})['then'](function(_0x158db1){logger[_0x809d('0x16')]('GetMailServerIn',_0x2ad088);logger[_0x809d('0x10')](_0x809d('0x23'),_0x2ad088,JSON['stringify'](_0x158db1));_0x16e9c0(_0x158db1);})[_0x809d('0x19')](function(_0x1c125d){logger[_0x809d('0x13')](_0x809d('0x23'),_0x1c125d['message'],_0x2ad088);_0x476a38(_0x4838b2['error'](0x1f4,_0x1c125d['message']));});});};
\ No newline at end of file
diff --git a/server/api/mailServerOut/index.js b/server/api/mailServerOut/index.js
index a90873a..984fabe 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 _0xc665=['update','delete','destroy','util','path','connect-timeout','express','../../components/auth/service','./mailServerOut.controller','get','isAuthenticated','index','/:id','show','post','create','put'];(function(_0x2d7f0e,_0x3e6fbd){var _0x110b07=function(_0x557b00){while(--_0x557b00){_0x2d7f0e['push'](_0x2d7f0e['shift']());}};_0x110b07(++_0x3e6fbd);}(_0xc665,0xcf));var _0x5c66=function(_0x312f1e,_0x3294fb){_0x312f1e=_0x312f1e-0x0;var _0x10c526=_0xc665[_0x312f1e];return _0x10c526;};'use strict';var multer=require('multer');var util=require(_0x5c66('0x0'));var path=require(_0x5c66('0x1'));var timeout=require(_0x5c66('0x2'));var express=require(_0x5c66('0x3'));var router=express['Router']();var auth=require(_0x5c66('0x4'));var interaction=require('../../components/interaction/service');var config=require('../../config/environment');var controller=require(_0x5c66('0x5'));router[_0x5c66('0x6')]('/',auth[_0x5c66('0x7')](),controller[_0x5c66('0x8')]);router[_0x5c66('0x6')](_0x5c66('0x9'),auth['isAuthenticated'](),controller[_0x5c66('0xa')]);router[_0x5c66('0xb')]('/',auth[_0x5c66('0x7')](),controller[_0x5c66('0xc')]);router[_0x5c66('0xd')]('/:id',auth[_0x5c66('0x7')](),controller[_0x5c66('0xe')]);router[_0x5c66('0xf')](_0x5c66('0x9'),auth[_0x5c66('0x7')](),controller[_0x5c66('0x10')]);module['exports']=router;
\ No newline at end of file
+var _0x8390=['../../components/auth/service','../../components/interaction/service','get','isAuthenticated','index','/:id','show','post','create','put','update','delete','destroy','exports','multer','util','path','connect-timeout','express','Router'];(function(_0x4fc9e6,_0xc51915){var _0x551d28=function(_0x1a603b){while(--_0x1a603b){_0x4fc9e6['push'](_0x4fc9e6['shift']());}};_0x551d28(++_0xc51915);}(_0x8390,0xfe));var _0x0839=function(_0x44a3b0,_0x352810){_0x44a3b0=_0x44a3b0-0x0;var _0x39e6f6=_0x8390[_0x44a3b0];return _0x39e6f6;};'use strict';var multer=require(_0x0839('0x0'));var util=require(_0x0839('0x1'));var path=require(_0x0839('0x2'));var timeout=require(_0x0839('0x3'));var express=require(_0x0839('0x4'));var router=express[_0x0839('0x5')]();var auth=require(_0x0839('0x6'));var interaction=require(_0x0839('0x7'));var config=require('../../config/environment');var controller=require('./mailServerOut.controller');router[_0x0839('0x8')]('/',auth[_0x0839('0x9')](),controller[_0x0839('0xa')]);router['get'](_0x0839('0xb'),auth[_0x0839('0x9')](),controller[_0x0839('0xc')]);router[_0x0839('0xd')]('/',auth[_0x0839('0x9')](),controller[_0x0839('0xe')]);router[_0x0839('0xf')](_0x0839('0xb'),auth['isAuthenticated'](),controller[_0x0839('0x10')]);router[_0x0839('0x11')](_0x0839('0xb'),auth['isAuthenticated'](),controller[_0x0839('0x12')]);module[_0x0839('0x13')]=router;
\ No newline at end of file
diff --git a/server/api/mailServerOut/mailServerOut.attributes.js b/server/api/mailServerOut/mailServerOut.attributes.js
index 852b640..d653654 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 _0x8085=['BOOLEAN','sequelize','STRING','INTEGER'];(function(_0x4a53d,_0x58a95e){var _0x27410e=function(_0x38fc90){while(--_0x38fc90){_0x4a53d['push'](_0x4a53d['shift']());}};_0x27410e(++_0x58a95e);}(_0x8085,0x71));var _0x5808=function(_0x54edc9,_0x345f01){_0x54edc9=_0x54edc9-0x0;var _0x2ae7a9=_0x8085[_0x54edc9];return _0x2ae7a9;};'use strict';var Sequelize=require(_0x5808('0x0'));module['exports']={'description':{'type':Sequelize['STRING']},'host':{'type':Sequelize[_0x5808('0x1')]},'user':{'type':Sequelize[_0x5808('0x1')]},'pass':{'type':Sequelize[_0x5808('0x1')]},'port':{'type':Sequelize[_0x5808('0x2')]},'secure':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'service':{'type':Sequelize['STRING']},'authentication':{'type':Sequelize[_0x5808('0x3')],'defaultValue':!![]}};
\ No newline at end of file
+var _0x8ace=['exports','STRING','INTEGER','BOOLEAN','sequelize'];(function(_0x243b59,_0x3f9495){var _0x3e1676=function(_0x354052){while(--_0x354052){_0x243b59['push'](_0x243b59['shift']());}};_0x3e1676(++_0x3f9495);}(_0x8ace,0x1bc));var _0xe8ac=function(_0x330ac6,_0x3adc83){_0x330ac6=_0x330ac6-0x0;var _0x59b845=_0x8ace[_0x330ac6];return _0x59b845;};'use strict';var Sequelize=require(_0xe8ac('0x0'));module[_0xe8ac('0x1')]={'description':{'type':Sequelize[_0xe8ac('0x2')]},'host':{'type':Sequelize[_0xe8ac('0x2')]},'user':{'type':Sequelize[_0xe8ac('0x2')]},'pass':{'type':Sequelize[_0xe8ac('0x2')]},'port':{'type':Sequelize[_0xe8ac('0x3')]},'secure':{'type':Sequelize[_0xe8ac('0x4')],'defaultValue':![]},'service':{'type':Sequelize[_0xe8ac('0x2')]},'authentication':{'type':Sequelize[_0xe8ac('0x4')],'defaultValue':!![]}};
\ No newline at end of file
diff --git a/server/api/mailServerOut/mailServerOut.controller.js b/server/api/mailServerOut/mailServerOut.controller.js
index aa0c713..5ceff1d 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 _0x3425=['fast-json-patch','moment','path','lodash','squel','crypto','jsforce','to-csv','querystring','ioredis','../../components/auth/service','../../components/parsers/advancedSearch','../../config/logger','api','../../config/utils','../../mysqldb','sendStatus','end','status','json','count','offset','limit','set','Content-Range','apply','reject','then','destroy','error','stack','name','send','index','map','MailServerOut','rawAttributes','model','query','keys','intersection','attributes','length','nolimit','order','sort','where','filters','filter','merge','type','VIRTUAL','options','includeAll','include','findAll','rows','catch','show','params','fields','create','body','update','find','html-pdf','eml-format','rimraf','zip-dir'];(function(_0x1fb35d,_0x5aefb0){var _0x44a673=function(_0x4f96ae){while(--_0x4f96ae){_0x1fb35d['push'](_0x1fb35d['shift']());}};_0x44a673(++_0x5aefb0);}(_0x3425,0x155));var _0x5342=function(_0x5a140c,_0x1c0751){_0x5a140c=_0x5a140c-0x0;var _0x44cc63=_0x3425[_0x5a140c];return _0x44cc63;};'use strict';var pdf=require(_0x5342('0x0'));var emlformat=require(_0x5342('0x1'));var rimraf=require(_0x5342('0x2'));var zipdir=require(_0x5342('0x3'));var jsonpatch=require(_0x5342('0x4'));var rp=require('request-promise');var moment=require(_0x5342('0x5'));var BPromise=require('bluebird');var Mustache=require('mustache');var util=require('util');var path=require(_0x5342('0x6'));var sox=require('sox');var csv=require('to-csv');var ejs=require('ejs');var fs=require('fs');var _=require(_0x5342('0x7'));var squel=require(_0x5342('0x8'));var crypto=require(_0x5342('0x9'));var jsforce=require(_0x5342('0xa'));var deskjs=require('desk.js');var toCsv=require(_0x5342('0xb'));var querystring=require(_0x5342('0xc'));var Papa=require('papaparse');var Redis=require(_0x5342('0xd'));var authService=require(_0x5342('0xe'));var qs=require('../../components/parsers/qs');var as=require(_0x5342('0xf'));var hardwareService=require('../../config/license/hardware');var logger=require(_0x5342('0x10'))(_0x5342('0x11'));var utils=require(_0x5342('0x12'));var config=require('../../config/environment');var db=require(_0x5342('0x13'))['db'];function respondWithStatusCode(_0x4922f8,_0x50138a){_0x50138a=_0x50138a||0xcc;return function(_0x4066a6){if(_0x4066a6){return _0x4922f8[_0x5342('0x14')](_0x50138a);}return _0x4922f8['status'](_0x50138a)[_0x5342('0x15')]();};}function respondWithResult(_0x3f1225,_0x3fc2f9){_0x3fc2f9=_0x3fc2f9||0xc8;return function(_0x2f5ddc){if(_0x2f5ddc){return _0x3f1225[_0x5342('0x16')](_0x3fc2f9)[_0x5342('0x17')](_0x2f5ddc);}};}function respondWithFilteredResult(_0x2dd922,_0x5ba9cb){return function(_0x1c1226){if(_0x1c1226){var _0x7fbb05=_0x1c1226[_0x5342('0x18')],_0x3f1112=_0x5ba9cb[_0x5342('0x19')],_0x382271=_0x5ba9cb[_0x5342('0x19')]+_0x5ba9cb[_0x5342('0x1a')],_0x2535bd;if(_0x382271>=_0x7fbb05){_0x382271=_0x7fbb05;_0x2535bd=0xc8;}else{_0x2535bd=0xce;}_0x2dd922[_0x5342('0x16')](_0x2535bd);return _0x2dd922[_0x5342('0x1b')](_0x5342('0x1c'),_0x3f1112+'-'+_0x382271+'/'+_0x7fbb05)[_0x5342('0x17')](_0x1c1226);}return null;};}function patchUpdates(_0x2a32f4){return function(_0x456c86){try{jsonpatch[_0x5342('0x1d')](_0x456c86,_0x2a32f4,!![]);}catch(_0x5adfaa){return BPromise[_0x5342('0x1e')](_0x5adfaa);}return _0x456c86['save']();};}function saveUpdates(_0x3824f7,_0x372bb9){return function(_0x5ce585){if(_0x5ce585){return _0x5ce585['update'](_0x3824f7)[_0x5342('0x1f')](function(_0x38bf59){return _0x38bf59;});}return null;};}function removeEntity(_0x2674ca,_0x5432b3){return function(_0x2bbbf2){if(_0x2bbbf2){return _0x2bbbf2[_0x5342('0x20')]()[_0x5342('0x1f')](function(){_0x2674ca[_0x5342('0x16')](0xcc)[_0x5342('0x15')]();});}};}function handleEntityNotFound(_0x69029,_0x138f63){return function(_0x598a80){if(!_0x598a80){_0x69029[_0x5342('0x14')](0x194);}return _0x598a80;};}function handleError(_0x41f9f3,_0x47146b){_0x47146b=_0x47146b||0x1f4;return function(_0x51347d){logger[_0x5342('0x21')](_0x51347d[_0x5342('0x22')]);if(_0x51347d[_0x5342('0x23')]){delete _0x51347d['name'];}_0x41f9f3['status'](_0x47146b)[_0x5342('0x24')](_0x51347d);};}exports[_0x5342('0x25')]=function(_0x440ac5,_0x165a41){var _0x187364={},_0x2f367a={},_0x4a1db9={'count':0x0,'rows':[]};var _0x26ba0a=_[_0x5342('0x26')](db[_0x5342('0x27')][_0x5342('0x28')],function(_0x207476){return{'name':_0x207476['fieldName'],'type':_0x207476['type']['key']};});_0x2f367a[_0x5342('0x29')]=_[_0x5342('0x26')](_0x26ba0a,'name');_0x2f367a[_0x5342('0x2a')]=_[_0x5342('0x2b')](_0x440ac5[_0x5342('0x2a')]);_0x2f367a['filters']=_[_0x5342('0x2c')](_0x2f367a[_0x5342('0x29')],_0x2f367a[_0x5342('0x2a')]);_0x187364['attributes']=_[_0x5342('0x2c')](_0x2f367a[_0x5342('0x29')],qs['fields'](_0x440ac5['query']['fields']));_0x187364[_0x5342('0x2d')]=_0x187364['attributes'][_0x5342('0x2e')]?_0x187364[_0x5342('0x2d')]:_0x2f367a[_0x5342('0x29')];if(!_0x440ac5[_0x5342('0x2a')]['hasOwnProperty'](_0x5342('0x2f'))){_0x187364[_0x5342('0x1a')]=qs[_0x5342('0x1a')](_0x440ac5[_0x5342('0x2a')]['limit']);_0x187364[_0x5342('0x19')]=qs[_0x5342('0x19')](_0x440ac5[_0x5342('0x2a')]['offset']);}_0x187364[_0x5342('0x30')]=qs[_0x5342('0x31')](_0x440ac5['query'][_0x5342('0x31')]);_0x187364[_0x5342('0x32')]=qs[_0x5342('0x33')](_['pick'](_0x440ac5[_0x5342('0x2a')],_0x2f367a[_0x5342('0x33')]));if(_0x440ac5[_0x5342('0x2a')][_0x5342('0x34')]){_0x187364[_0x5342('0x32')]=_[_0x5342('0x35')](_0x187364[_0x5342('0x32')],{'$or':_['map'](_0x26ba0a,function(_0x5e73c2){if(_0x5e73c2[_0x5342('0x36')]!==_0x5342('0x37')){var _0x4a1de6={};_0x4a1de6[_0x5e73c2[_0x5342('0x23')]]={'$like':'%'+_0x440ac5[_0x5342('0x2a')][_0x5342('0x34')]+'%'};return _0x4a1de6;}})});}_0x187364=_['merge']({},_0x187364,_0x440ac5[_0x5342('0x38')]);var _0x48c7ba={'where':_0x187364[_0x5342('0x32')]};return db['MailServerOut']['count'](_0x48c7ba)['then'](function(_0x45f949){_0x4a1db9[_0x5342('0x18')]=_0x45f949;if(_0x440ac5[_0x5342('0x2a')][_0x5342('0x39')]){_0x187364[_0x5342('0x3a')]=[{'all':!![]}];}return db[_0x5342('0x27')][_0x5342('0x3b')](_0x187364);})[_0x5342('0x1f')](function(_0x531360){_0x4a1db9[_0x5342('0x3c')]=_0x531360;return _0x4a1db9;})[_0x5342('0x1f')](respondWithFilteredResult(_0x165a41,_0x187364))[_0x5342('0x3d')](handleError(_0x165a41,null));};exports[_0x5342('0x3e')]=function(_0x4a8e37,_0x1f2c6a){var _0x286f29={'raw':!![],'where':{'id':_0x4a8e37[_0x5342('0x3f')]['id']}},_0x18f7dc={};_0x18f7dc[_0x5342('0x29')]=_[_0x5342('0x2b')](db[_0x5342('0x27')]['rawAttributes']);_0x18f7dc[_0x5342('0x2a')]=_[_0x5342('0x2b')](_0x4a8e37['query']);_0x18f7dc[_0x5342('0x33')]=_['intersection'](_0x18f7dc[_0x5342('0x29')],_0x18f7dc[_0x5342('0x2a')]);_0x286f29[_0x5342('0x2d')]=_[_0x5342('0x2c')](_0x18f7dc[_0x5342('0x29')],qs[_0x5342('0x40')](_0x4a8e37[_0x5342('0x2a')]['fields']));_0x286f29[_0x5342('0x2d')]=_0x286f29[_0x5342('0x2d')][_0x5342('0x2e')]?_0x286f29[_0x5342('0x2d')]:_0x18f7dc[_0x5342('0x29')];if(_0x4a8e37[_0x5342('0x2a')][_0x5342('0x39')]){_0x286f29[_0x5342('0x3a')]=[{'all':!![]}];}_0x286f29=_['merge']({},_0x286f29,_0x4a8e37[_0x5342('0x38')]);return db[_0x5342('0x27')]['find'](_0x286f29)[_0x5342('0x1f')](handleEntityNotFound(_0x1f2c6a,null))[_0x5342('0x1f')](respondWithResult(_0x1f2c6a,null))[_0x5342('0x3d')](handleError(_0x1f2c6a,null));};exports['create']=function(_0x5a7c5e,_0x5b4850){return db[_0x5342('0x27')][_0x5342('0x41')](_0x5a7c5e[_0x5342('0x42')],{})[_0x5342('0x1f')](respondWithResult(_0x5b4850,0xc9))[_0x5342('0x3d')](handleError(_0x5b4850,null));};exports[_0x5342('0x43')]=function(_0xd019a9,_0x561ee7){if(_0xd019a9['body']['id']){delete _0xd019a9[_0x5342('0x42')]['id'];}return db[_0x5342('0x27')][_0x5342('0x44')]({'where':{'id':_0xd019a9['params']['id']}})['then'](handleEntityNotFound(_0x561ee7,null))[_0x5342('0x1f')](saveUpdates(_0xd019a9[_0x5342('0x42')],null))[_0x5342('0x1f')](respondWithResult(_0x561ee7,null))[_0x5342('0x3d')](handleError(_0x561ee7,null));};exports[_0x5342('0x20')]=function(_0x4b1aeb,_0x41c15a){return db[_0x5342('0x27')][_0x5342('0x44')]({'where':{'id':_0x4b1aeb[_0x5342('0x3f')]['id']}})[_0x5342('0x1f')](handleEntityNotFound(_0x41c15a,null))['then'](removeEntity(_0x41c15a,null))[_0x5342('0x3d')](handleError(_0x41c15a,null));};
\ No newline at end of file
+var _0x7876=['merge','VIRTUAL','includeAll','include','findAll','rows','catch','show','params','keys','options','find','create','body','html-pdf','rimraf','zip-dir','fast-json-patch','request-promise','moment','bluebird','mustache','util','path','sox','to-csv','ejs','lodash','squel','crypto','jsforce','desk.js','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/advancedSearch','../../config/license/hardware','api','../../config/utils','../../config/environment','../../mysqldb','sendStatus','end','json','count','offset','limit','status','set','Content-Range','apply','reject','save','update','then','destroy','error','name','send','map','MailServerOut','rawAttributes','type','key','model','query','filters','attributes','intersection','fields','length','hasOwnProperty','nolimit','order','sort','filter','where'];(function(_0x587693,_0x27fe90){var _0x510a1a=function(_0x290f71){while(--_0x290f71){_0x587693['push'](_0x587693['shift']());}};_0x510a1a(++_0x27fe90);}(_0x7876,0x194));var _0x6787=function(_0x3da832,_0x2133f1){_0x3da832=_0x3da832-0x0;var _0xe602f2=_0x7876[_0x3da832];return _0xe602f2;};'use strict';var pdf=require(_0x6787('0x0'));var emlformat=require('eml-format');var rimraf=require(_0x6787('0x1'));var zipdir=require(_0x6787('0x2'));var jsonpatch=require(_0x6787('0x3'));var rp=require(_0x6787('0x4'));var moment=require(_0x6787('0x5'));var BPromise=require(_0x6787('0x6'));var Mustache=require(_0x6787('0x7'));var util=require(_0x6787('0x8'));var path=require(_0x6787('0x9'));var sox=require(_0x6787('0xa'));var csv=require(_0x6787('0xb'));var ejs=require(_0x6787('0xc'));var fs=require('fs');var _=require(_0x6787('0xd'));var squel=require(_0x6787('0xe'));var crypto=require(_0x6787('0xf'));var jsforce=require(_0x6787('0x10'));var deskjs=require(_0x6787('0x11'));var toCsv=require(_0x6787('0xb'));var querystring=require(_0x6787('0x12'));var Papa=require(_0x6787('0x13'));var Redis=require(_0x6787('0x14'));var authService=require(_0x6787('0x15'));var qs=require('../../components/parsers/qs');var as=require(_0x6787('0x16'));var hardwareService=require(_0x6787('0x17'));var logger=require('../../config/logger')(_0x6787('0x18'));var utils=require(_0x6787('0x19'));var config=require(_0x6787('0x1a'));var db=require(_0x6787('0x1b'))['db'];function respondWithStatusCode(_0x6897a2,_0x1ff97f){_0x1ff97f=_0x1ff97f||0xcc;return function(_0x3bcde1){if(_0x3bcde1){return _0x6897a2[_0x6787('0x1c')](_0x1ff97f);}return _0x6897a2['status'](_0x1ff97f)[_0x6787('0x1d')]();};}function respondWithResult(_0x59ab9c,_0x22ae6a){_0x22ae6a=_0x22ae6a||0xc8;return function(_0x6e24a0){if(_0x6e24a0){return _0x59ab9c['status'](_0x22ae6a)[_0x6787('0x1e')](_0x6e24a0);}};}function respondWithFilteredResult(_0x36d4f4,_0x5de71b){return function(_0x534d5){if(_0x534d5){var _0xa8eac=_0x534d5[_0x6787('0x1f')],_0x534950=_0x5de71b['offset'],_0x48f730=_0x5de71b[_0x6787('0x20')]+_0x5de71b[_0x6787('0x21')],_0x17be2e;if(_0x48f730>=_0xa8eac){_0x48f730=_0xa8eac;_0x17be2e=0xc8;}else{_0x17be2e=0xce;}_0x36d4f4[_0x6787('0x22')](_0x17be2e);return _0x36d4f4[_0x6787('0x23')](_0x6787('0x24'),_0x534950+'-'+_0x48f730+'/'+_0xa8eac)['json'](_0x534d5);}return null;};}function patchUpdates(_0x2ce47c){return function(_0x5bd1a7){try{jsonpatch[_0x6787('0x25')](_0x5bd1a7,_0x2ce47c,!![]);}catch(_0x51bd33){return BPromise[_0x6787('0x26')](_0x51bd33);}return _0x5bd1a7[_0x6787('0x27')]();};}function saveUpdates(_0x19cdbc,_0x211ac7){return function(_0x105298){if(_0x105298){return _0x105298[_0x6787('0x28')](_0x19cdbc)[_0x6787('0x29')](function(_0x56f6a1){return _0x56f6a1;});}return null;};}function removeEntity(_0x583164,_0x334039){return function(_0x527de9){if(_0x527de9){return _0x527de9[_0x6787('0x2a')]()[_0x6787('0x29')](function(){_0x583164['status'](0xcc)['end']();});}};}function handleEntityNotFound(_0x3bc387,_0x29c6c1){return function(_0x29f75e){if(!_0x29f75e){_0x3bc387['sendStatus'](0x194);}return _0x29f75e;};}function handleError(_0x182f85,_0x8c7818){_0x8c7818=_0x8c7818||0x1f4;return function(_0x1b6dfb){logger[_0x6787('0x2b')](_0x1b6dfb['stack']);if(_0x1b6dfb['name']){delete _0x1b6dfb[_0x6787('0x2c')];}_0x182f85[_0x6787('0x22')](_0x8c7818)[_0x6787('0x2d')](_0x1b6dfb);};}exports['index']=function(_0x5e3a8e,_0x39db67){var _0x476ed1={},_0x49d14a={},_0x50a3fd={'count':0x0,'rows':[]};var _0x55bdf5=_[_0x6787('0x2e')](db[_0x6787('0x2f')][_0x6787('0x30')],function(_0x51da7c){return{'name':_0x51da7c['fieldName'],'type':_0x51da7c[_0x6787('0x31')][_0x6787('0x32')]};});_0x49d14a[_0x6787('0x33')]=_[_0x6787('0x2e')](_0x55bdf5,_0x6787('0x2c'));_0x49d14a[_0x6787('0x34')]=_['keys'](_0x5e3a8e[_0x6787('0x34')]);_0x49d14a[_0x6787('0x35')]=_['intersection'](_0x49d14a[_0x6787('0x33')],_0x49d14a['query']);_0x476ed1[_0x6787('0x36')]=_[_0x6787('0x37')](_0x49d14a[_0x6787('0x33')],qs[_0x6787('0x38')](_0x5e3a8e[_0x6787('0x34')]['fields']));_0x476ed1[_0x6787('0x36')]=_0x476ed1['attributes'][_0x6787('0x39')]?_0x476ed1[_0x6787('0x36')]:_0x49d14a[_0x6787('0x33')];if(!_0x5e3a8e[_0x6787('0x34')][_0x6787('0x3a')](_0x6787('0x3b'))){_0x476ed1[_0x6787('0x21')]=qs[_0x6787('0x21')](_0x5e3a8e[_0x6787('0x34')][_0x6787('0x21')]);_0x476ed1[_0x6787('0x20')]=qs['offset'](_0x5e3a8e[_0x6787('0x34')][_0x6787('0x20')]);}_0x476ed1[_0x6787('0x3c')]=qs[_0x6787('0x3d')](_0x5e3a8e['query'][_0x6787('0x3d')]);_0x476ed1['where']=qs[_0x6787('0x35')](_['pick'](_0x5e3a8e[_0x6787('0x34')],_0x49d14a[_0x6787('0x35')]));if(_0x5e3a8e[_0x6787('0x34')][_0x6787('0x3e')]){_0x476ed1[_0x6787('0x3f')]=_[_0x6787('0x40')](_0x476ed1[_0x6787('0x3f')],{'$or':_['map'](_0x55bdf5,function(_0x3c5f93){if(_0x3c5f93['type']!==_0x6787('0x41')){var _0x2fc742={};_0x2fc742[_0x3c5f93[_0x6787('0x2c')]]={'$like':'%'+_0x5e3a8e[_0x6787('0x34')][_0x6787('0x3e')]+'%'};return _0x2fc742;}})});}_0x476ed1=_[_0x6787('0x40')]({},_0x476ed1,_0x5e3a8e['options']);var _0x2e9396={'where':_0x476ed1[_0x6787('0x3f')]};return db[_0x6787('0x2f')][_0x6787('0x1f')](_0x2e9396)[_0x6787('0x29')](function(_0x139f82){_0x50a3fd[_0x6787('0x1f')]=_0x139f82;if(_0x5e3a8e[_0x6787('0x34')][_0x6787('0x42')]){_0x476ed1[_0x6787('0x43')]=[{'all':!![]}];}return db['MailServerOut'][_0x6787('0x44')](_0x476ed1);})[_0x6787('0x29')](function(_0x3634e1){_0x50a3fd[_0x6787('0x45')]=_0x3634e1;return _0x50a3fd;})[_0x6787('0x29')](respondWithFilteredResult(_0x39db67,_0x476ed1))[_0x6787('0x46')](handleError(_0x39db67,null));};exports[_0x6787('0x47')]=function(_0x35f7b,_0x27b20f){var _0x1600d1={'raw':!![],'where':{'id':_0x35f7b[_0x6787('0x48')]['id']}},_0x387f2e={};_0x387f2e[_0x6787('0x33')]=_['keys'](db[_0x6787('0x2f')][_0x6787('0x30')]);_0x387f2e[_0x6787('0x34')]=_[_0x6787('0x49')](_0x35f7b[_0x6787('0x34')]);_0x387f2e[_0x6787('0x35')]=_[_0x6787('0x37')](_0x387f2e['model'],_0x387f2e[_0x6787('0x34')]);_0x1600d1[_0x6787('0x36')]=_[_0x6787('0x37')](_0x387f2e[_0x6787('0x33')],qs[_0x6787('0x38')](_0x35f7b[_0x6787('0x34')][_0x6787('0x38')]));_0x1600d1[_0x6787('0x36')]=_0x1600d1[_0x6787('0x36')][_0x6787('0x39')]?_0x1600d1[_0x6787('0x36')]:_0x387f2e[_0x6787('0x33')];if(_0x35f7b['query'][_0x6787('0x42')]){_0x1600d1[_0x6787('0x43')]=[{'all':!![]}];}_0x1600d1=_[_0x6787('0x40')]({},_0x1600d1,_0x35f7b[_0x6787('0x4a')]);return db['MailServerOut'][_0x6787('0x4b')](_0x1600d1)['then'](handleEntityNotFound(_0x27b20f,null))[_0x6787('0x29')](respondWithResult(_0x27b20f,null))['catch'](handleError(_0x27b20f,null));};exports[_0x6787('0x4c')]=function(_0x4951bf,_0xa872){return db[_0x6787('0x2f')][_0x6787('0x4c')](_0x4951bf[_0x6787('0x4d')],{})[_0x6787('0x29')](respondWithResult(_0xa872,0xc9))[_0x6787('0x46')](handleError(_0xa872,null));};exports[_0x6787('0x28')]=function(_0xdeffb9,_0x1e6a33){if(_0xdeffb9['body']['id']){delete _0xdeffb9[_0x6787('0x4d')]['id'];}return db[_0x6787('0x2f')][_0x6787('0x4b')]({'where':{'id':_0xdeffb9[_0x6787('0x48')]['id']}})[_0x6787('0x29')](handleEntityNotFound(_0x1e6a33,null))['then'](saveUpdates(_0xdeffb9[_0x6787('0x4d')],null))['then'](respondWithResult(_0x1e6a33,null))[_0x6787('0x46')](handleError(_0x1e6a33,null));};exports['destroy']=function(_0x3a455b,_0x29c2dc){return db[_0x6787('0x2f')][_0x6787('0x4b')]({'where':{'id':_0x3a455b[_0x6787('0x48')]['id']}})[_0x6787('0x29')](handleEntityNotFound(_0x29c2dc,null))[_0x6787('0x29')](removeEntity(_0x29c2dc,null))[_0x6787('0x46')](handleError(_0x29c2dc,null));};
\ No newline at end of file
diff --git a/server/api/mailServerOut/mailServerOut.model.js b/server/api/mailServerOut/mailServerOut.model.js
index b055e4d..73bc25a 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 _0x3f8a=['rimraf','../../config/environment','./mailServerOut.attributes','exports','define','MailServerOut','mail_servers_out','lodash','util','../../config/logger','api','bluebird','request-promise','path'];(function(_0x3b1a65,_0x3e8fe3){var _0x3ff931=function(_0x5754db){while(--_0x5754db){_0x3b1a65['push'](_0x3b1a65['shift']());}};_0x3ff931(++_0x3e8fe3);}(_0x3f8a,0x1d5));var _0xa3f8=function(_0x162053,_0xe1b6fc){_0x162053=_0x162053-0x0;var _0x5236ae=_0x3f8a[_0x162053];return _0x5236ae;};'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':[],'timestamps':!![]});};
\ No newline at end of file
+var _0x814b=['define','MailServerOut','lodash','util','../../config/logger','api','moment','bluebird','path','rimraf','../../config/environment','./mailServerOut.attributes','exports'];(function(_0x5bb908,_0xc4dc33){var _0x3943ff=function(_0x439849){while(--_0x439849){_0x5bb908['push'](_0x5bb908['shift']());}};_0x3943ff(++_0xc4dc33);}(_0x814b,0x1a2));var _0xb814=function(_0x350182,_0x2a9feb){_0x350182=_0x350182-0x0;var _0x4a0892=_0x814b[_0x350182];return _0x4a0892;};'use strict';var _=require(_0xb814('0x0'));var util=require(_0xb814('0x1'));var logger=require(_0xb814('0x2'))(_0xb814('0x3'));var moment=require(_0xb814('0x4'));var BPromise=require(_0xb814('0x5'));var rp=require('request-promise');var fs=require('fs');var path=require(_0xb814('0x6'));var rimraf=require(_0xb814('0x7'));var config=require(_0xb814('0x8'));var attributes=require(_0xb814('0x9'));module[_0xb814('0xa')]=function(_0x322a70,_0x53e507){return _0x322a70[_0xb814('0xb')](_0xb814('0xc'),attributes,{'tableName':'mail_servers_out','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 dd0f8b3..92dc022 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 _0x60a9=['MailServerOut,\x20%s,\x20%s','debug','request\x20sent','stringify','error','message','result','catch','lodash','util','moment','bluebird','randomstring','../../mysqldb','../../config/utils','../../config/logger','rpc','jayson/promise','client','http','request','info'];(function(_0x2c5b19,_0x51d11a){var _0x3a71ed=function(_0x17c580){while(--_0x17c580){_0x2c5b19['push'](_0x2c5b19['shift']());}};_0x3a71ed(++_0x51d11a);}(_0x60a9,0x168));var _0x960a=function(_0x4f8ea1,_0x56500a){_0x4f8ea1=_0x4f8ea1-0x0;var _0x32bfa7=_0x60a9[_0x4f8ea1];return _0x32bfa7;};'use strict';var _=require(_0x960a('0x0'));var util=require(_0x960a('0x1'));var moment=require(_0x960a('0x2'));var BPromise=require(_0x960a('0x3'));var rs=require(_0x960a('0x4'));var fs=require('fs');var Redis=require('ioredis');var db=require(_0x960a('0x5'))['db'];var utils=require(_0x960a('0x6'));var logger=require(_0x960a('0x7'))(_0x960a('0x8'));var config=require('../../config/environment');var jayson=require(_0x960a('0x9'));var client=jayson[_0x960a('0xa')][_0x960a('0xb')]({'port':0x232a});function respondWithRpcPromise(_0x59a54a,_0x503ffe,_0x4ec4fe){return new BPromise(function(_0x2df686,_0x535ffe){return client[_0x960a('0xc')](_0x59a54a,_0x4ec4fe)['then'](function(_0x31d1e1){logger[_0x960a('0xd')](_0x960a('0xe'),_0x503ffe,'request\x20sent');logger[_0x960a('0xf')]('MailServerOut,\x20%s,\x20%s,\x20%s',_0x503ffe,_0x960a('0x10'),JSON[_0x960a('0x11')](_0x31d1e1));if(_0x31d1e1[_0x960a('0x12')]){if(_0x31d1e1[_0x960a('0x12')]['code']===0x1f4){logger[_0x960a('0x12')](_0x960a('0xe'),_0x503ffe,_0x31d1e1[_0x960a('0x12')][_0x960a('0x13')]);return _0x535ffe(_0x31d1e1[_0x960a('0x12')][_0x960a('0x13')]);}logger[_0x960a('0x12')]('MailServerOut,\x20%s,\x20%s',_0x503ffe,_0x31d1e1[_0x960a('0x12')][_0x960a('0x13')]);return _0x2df686(_0x31d1e1[_0x960a('0x12')][_0x960a('0x13')]);}else{logger[_0x960a('0xd')](_0x960a('0xe'),_0x503ffe,_0x960a('0x10'));_0x2df686(_0x31d1e1[_0x960a('0x14')][_0x960a('0x13')]);}})[_0x960a('0x15')](function(_0xe0bf32){logger[_0x960a('0x12')](_0x960a('0xe'),_0x503ffe,_0xe0bf32);_0x535ffe(_0xe0bf32);});});}
\ No newline at end of file
+var _0x5ab2=['info','MailServerOut,\x20%s,\x20%s','request\x20sent','debug','MailServerOut,\x20%s,\x20%s,\x20%s','stringify','error','message','result','catch','lodash','util','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','jayson/promise','client','http','request','then'];(function(_0x212716,_0x45a7a3){var _0x1a0df4=function(_0x17919c){while(--_0x17919c){_0x212716['push'](_0x212716['shift']());}};_0x1a0df4(++_0x45a7a3);}(_0x5ab2,0xeb));var _0x25ab=function(_0x16a992,_0x4dd40a){_0x16a992=_0x16a992-0x0;var _0x3010c9=_0x5ab2[_0x16a992];return _0x3010c9;};'use strict';var _=require(_0x25ab('0x0'));var util=require(_0x25ab('0x1'));var moment=require(_0x25ab('0x2'));var BPromise=require(_0x25ab('0x3'));var rs=require(_0x25ab('0x4'));var fs=require('fs');var Redis=require(_0x25ab('0x5'));var db=require(_0x25ab('0x6'))['db'];var utils=require(_0x25ab('0x7'));var logger=require(_0x25ab('0x8'))(_0x25ab('0x9'));var config=require('../../config/environment');var jayson=require(_0x25ab('0xa'));var client=jayson[_0x25ab('0xb')][_0x25ab('0xc')]({'port':0x232a});function respondWithRpcPromise(_0x43f15e,_0x3ef8cb,_0x4bcc51){return new BPromise(function(_0x1faffc,_0x45c88b){return client[_0x25ab('0xd')](_0x43f15e,_0x4bcc51)[_0x25ab('0xe')](function(_0xec46b){logger[_0x25ab('0xf')](_0x25ab('0x10'),_0x3ef8cb,_0x25ab('0x11'));logger[_0x25ab('0x12')](_0x25ab('0x13'),_0x3ef8cb,'request\x20sent',JSON[_0x25ab('0x14')](_0xec46b));if(_0xec46b[_0x25ab('0x15')]){if(_0xec46b[_0x25ab('0x15')]['code']===0x1f4){logger[_0x25ab('0x15')](_0x25ab('0x10'),_0x3ef8cb,_0xec46b[_0x25ab('0x15')][_0x25ab('0x16')]);return _0x45c88b(_0xec46b['error'][_0x25ab('0x16')]);}logger['error'](_0x25ab('0x10'),_0x3ef8cb,_0xec46b[_0x25ab('0x15')][_0x25ab('0x16')]);return _0x1faffc(_0xec46b[_0x25ab('0x15')][_0x25ab('0x16')]);}else{logger[_0x25ab('0xf')](_0x25ab('0x10'),_0x3ef8cb,_0x25ab('0x11'));_0x1faffc(_0xec46b[_0x25ab('0x17')]['message']);}})[_0x25ab('0x18')](function(_0x2b3a55){logger[_0x25ab('0x15')]('MailServerOut,\x20%s,\x20%s',_0x3ef8cb,_0x2b3a55);_0x45c88b(_0x2b3a55);});});}
\ No newline at end of file
diff --git a/server/api/mailSubstatus/index.js b/server/api/mailSubstatus/index.js
index beb3093..cea9c36 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 _0xe193=['destroy','multer','util','path','connect-timeout','Router','../../components/auth/service','../../components/interaction/service','../../config/environment','./mailSubstatus.controller','isAuthenticated','/describe','get','put','/:id','update','delete'];(function(_0x47242d,_0x13f993){var _0x30273a=function(_0x322cd2){while(--_0x322cd2){_0x47242d['push'](_0x47242d['shift']());}};_0x30273a(++_0x13f993);}(_0xe193,0x89));var _0x3e19=function(_0x5400b7,_0x3cee30){_0x5400b7=_0x5400b7-0x0;var _0x1d127d=_0xe193[_0x5400b7];return _0x1d127d;};'use strict';var multer=require(_0x3e19('0x0'));var util=require(_0x3e19('0x1'));var path=require(_0x3e19('0x2'));var timeout=require(_0x3e19('0x3'));var express=require('express');var router=express[_0x3e19('0x4')]();var auth=require(_0x3e19('0x5'));var interaction=require(_0x3e19('0x6'));var config=require(_0x3e19('0x7'));var controller=require(_0x3e19('0x8'));router['get']('/',auth[_0x3e19('0x9')](),controller['index']);router['get'](_0x3e19('0xa'),auth[_0x3e19('0x9')](),controller['describe']);router[_0x3e19('0xb')]('/:id',auth[_0x3e19('0x9')](),controller['show']);router['post']('/',auth[_0x3e19('0x9')](),controller['create']);router[_0x3e19('0xc')](_0x3e19('0xd'),auth[_0x3e19('0x9')](),controller[_0x3e19('0xe')]);router[_0x3e19('0xf')](_0x3e19('0xd'),auth[_0x3e19('0x9')](),controller[_0x3e19('0x10')]);module['exports']=router;
\ No newline at end of file
+var _0x23b5=['get','isAuthenticated','/describe','describe','/:id','show','post','create','update','delete','destroy','exports','util','path','express','../../components/auth/service','../../components/interaction/service','./mailSubstatus.controller'];(function(_0x20a584,_0xe384a5){var _0x4b41a8=function(_0x2127c6){while(--_0x2127c6){_0x20a584['push'](_0x20a584['shift']());}};_0x4b41a8(++_0xe384a5);}(_0x23b5,0x9c));var _0x523b=function(_0x3f2a90,_0x50baf1){_0x3f2a90=_0x3f2a90-0x0;var _0xb46279=_0x23b5[_0x3f2a90];return _0xb46279;};'use strict';var multer=require('multer');var util=require(_0x523b('0x0'));var path=require(_0x523b('0x1'));var timeout=require('connect-timeout');var express=require(_0x523b('0x2'));var router=express['Router']();var auth=require(_0x523b('0x3'));var interaction=require(_0x523b('0x4'));var config=require('../../config/environment');var controller=require(_0x523b('0x5'));router[_0x523b('0x6')]('/',auth[_0x523b('0x7')](),controller['index']);router['get'](_0x523b('0x8'),auth[_0x523b('0x7')](),controller[_0x523b('0x9')]);router[_0x523b('0x6')](_0x523b('0xa'),auth[_0x523b('0x7')](),controller[_0x523b('0xb')]);router[_0x523b('0xc')]('/',auth[_0x523b('0x7')](),controller[_0x523b('0xd')]);router['put']('/:id',auth[_0x523b('0x7')](),controller[_0x523b('0xe')]);router[_0x523b('0xf')](_0x523b('0xa'),auth[_0x523b('0x7')](),controller[_0x523b('0x10')]);module[_0x523b('0x11')]=router;
\ No newline at end of file
diff --git a/server/api/mailSubstatus/mailSubstatus.attributes.js b/server/api/mailSubstatus/mailSubstatus.attributes.js
index eb4021a..b1aeae0 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 _0xda81=['STRING','sequelize','exports'];(function(_0x3e5086,_0x48f4a2){var _0xfeb102=function(_0x5a945f){while(--_0x5a945f){_0x3e5086['push'](_0x3e5086['shift']());}};_0xfeb102(++_0x48f4a2);}(_0xda81,0x1c3));var _0x1da8=function(_0x1985b3,_0x4af6d1){_0x1985b3=_0x1985b3-0x0;var _0x303f75=_0xda81[_0x1985b3];return _0x303f75;};'use strict';var Sequelize=require(_0x1da8('0x0'));module[_0x1da8('0x1')]={'name':{'type':Sequelize[_0x1da8('0x2')],'unique':'name','allowNull':![],'validate':{'notEmpty':!![]}},'description':{'type':Sequelize[_0x1da8('0x2')]}};
\ No newline at end of file
+var _0x23bb=['STRING','sequelize','name'];(function(_0x1ed662,_0x3e0706){var _0x22d319=function(_0xf42f70){while(--_0xf42f70){_0x1ed662['push'](_0x1ed662['shift']());}};_0x22d319(++_0x3e0706);}(_0x23bb,0x79));var _0xb23b=function(_0x179a0c,_0x2ca073){_0x179a0c=_0x179a0c-0x0;var _0x1c8b9a=_0x23bb[_0x179a0c];return _0x1c8b9a;};'use strict';var Sequelize=require(_0xb23b('0x0'));module['exports']={'name':{'type':Sequelize['STRING'],'unique':_0xb23b('0x1'),'allowNull':![],'validate':{'notEmpty':!![]}},'description':{'type':Sequelize[_0xb23b('0x2')]}};
\ No newline at end of file
diff --git a/server/api/mailSubstatus/mailSubstatus.controller.js b/server/api/mailSubstatus/mailSubstatus.controller.js
index 7d49a75..754c435 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 _0x1883=['fields','length','nolimit','order','sort','pick','filter','where','merge','VIRTUAL','options','includeAll','include','findAll','catch','show','find','create','body','params','describe','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','papaparse','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','api','../../config/utils','sendStatus','status','end','json','count','offset','limit','set','Content-Range','reject','update','then','destroy','error','stack','name','send','index','map','MailSubstatus','rawAttributes','fieldName','type','model','keys','query','filters','intersection','attributes'];(function(_0x438c05,_0x1a1396){var _0x459dce=function(_0x4c1d26){while(--_0x4c1d26){_0x438c05['push'](_0x438c05['shift']());}};_0x459dce(++_0x1a1396);}(_0x1883,0xab));var _0x3188=function(_0x51bf11,_0x39643d){_0x51bf11=_0x51bf11-0x0;var _0x2d06cf=_0x1883[_0x51bf11];return _0x2d06cf;};'use strict';var pdf=require(_0x3188('0x0'));var emlformat=require(_0x3188('0x1'));var rimraf=require(_0x3188('0x2'));var zipdir=require(_0x3188('0x3'));var jsonpatch=require(_0x3188('0x4'));var rp=require(_0x3188('0x5'));var moment=require(_0x3188('0x6'));var BPromise=require(_0x3188('0x7'));var Mustache=require(_0x3188('0x8'));var util=require(_0x3188('0x9'));var path=require(_0x3188('0xa'));var sox=require(_0x3188('0xb'));var csv=require(_0x3188('0xc'));var ejs=require(_0x3188('0xd'));var fs=require('fs');var _=require(_0x3188('0xe'));var squel=require(_0x3188('0xf'));var crypto=require(_0x3188('0x10'));var jsforce=require('jsforce');var deskjs=require(_0x3188('0x11'));var toCsv=require(_0x3188('0xc'));var querystring=require('querystring');var Papa=require(_0x3188('0x12'));var Redis=require('ioredis');var authService=require(_0x3188('0x13'));var qs=require(_0x3188('0x14'));var as=require(_0x3188('0x15'));var hardwareService=require(_0x3188('0x16'));var logger=require('../../config/logger')(_0x3188('0x17'));var utils=require(_0x3188('0x18'));var config=require('../../config/environment');var db=require('../../mysqldb')['db'];function respondWithStatusCode(_0x339b4a,_0x45e94e){_0x45e94e=_0x45e94e||0xcc;return function(_0x20fef6){if(_0x20fef6){return _0x339b4a[_0x3188('0x19')](_0x45e94e);}return _0x339b4a[_0x3188('0x1a')](_0x45e94e)[_0x3188('0x1b')]();};}function respondWithResult(_0x490104,_0x276d69){_0x276d69=_0x276d69||0xc8;return function(_0x5e0044){if(_0x5e0044){return _0x490104['status'](_0x276d69)[_0x3188('0x1c')](_0x5e0044);}};}function respondWithFilteredResult(_0x53668b,_0x54a87f){return function(_0x32c239){if(_0x32c239){var _0x1beead=_0x32c239[_0x3188('0x1d')],_0xa2269=_0x54a87f['offset'],_0x195d8e=_0x54a87f[_0x3188('0x1e')]+_0x54a87f[_0x3188('0x1f')],_0x145293;if(_0x195d8e>=_0x1beead){_0x195d8e=_0x1beead;_0x145293=0xc8;}else{_0x145293=0xce;}_0x53668b[_0x3188('0x1a')](_0x145293);return _0x53668b[_0x3188('0x20')](_0x3188('0x21'),_0xa2269+'-'+_0x195d8e+'/'+_0x1beead)[_0x3188('0x1c')](_0x32c239);}return null;};}function patchUpdates(_0xac7f48){return function(_0x4602c6){try{jsonpatch['apply'](_0x4602c6,_0xac7f48,!![]);}catch(_0x354338){return BPromise[_0x3188('0x22')](_0x354338);}return _0x4602c6['save']();};}function saveUpdates(_0x518b2f,_0x5d8d62){return function(_0x46a318){if(_0x46a318){return _0x46a318[_0x3188('0x23')](_0x518b2f)[_0x3188('0x24')](function(_0x5980f3){return _0x5980f3;});}return null;};}function removeEntity(_0x48673c,_0x266260){return function(_0x461286){if(_0x461286){return _0x461286[_0x3188('0x25')]()[_0x3188('0x24')](function(){_0x48673c[_0x3188('0x1a')](0xcc)['end']();});}};}function handleEntityNotFound(_0x30cf2c,_0x33f882){return function(_0x5a2e67){if(!_0x5a2e67){_0x30cf2c[_0x3188('0x19')](0x194);}return _0x5a2e67;};}function handleError(_0x4be6c3,_0x5c69be){_0x5c69be=_0x5c69be||0x1f4;return function(_0x45ae2f){logger[_0x3188('0x26')](_0x45ae2f[_0x3188('0x27')]);if(_0x45ae2f[_0x3188('0x28')]){delete _0x45ae2f[_0x3188('0x28')];}_0x4be6c3[_0x3188('0x1a')](_0x5c69be)[_0x3188('0x29')](_0x45ae2f);};}exports[_0x3188('0x2a')]=function(_0x4b4675,_0x2cc5d9){var _0x2d000a={},_0x52bb13={},_0xd3ee40={'count':0x0,'rows':[]};var _0x14299b=_[_0x3188('0x2b')](db[_0x3188('0x2c')][_0x3188('0x2d')],function(_0x1f1c6f){return{'name':_0x1f1c6f[_0x3188('0x2e')],'type':_0x1f1c6f[_0x3188('0x2f')]['key']};});_0x52bb13[_0x3188('0x30')]=_['map'](_0x14299b,_0x3188('0x28'));_0x52bb13['query']=_[_0x3188('0x31')](_0x4b4675[_0x3188('0x32')]);_0x52bb13[_0x3188('0x33')]=_[_0x3188('0x34')](_0x52bb13[_0x3188('0x30')],_0x52bb13[_0x3188('0x32')]);_0x2d000a[_0x3188('0x35')]=_[_0x3188('0x34')](_0x52bb13[_0x3188('0x30')],qs[_0x3188('0x36')](_0x4b4675[_0x3188('0x32')][_0x3188('0x36')]));_0x2d000a[_0x3188('0x35')]=_0x2d000a[_0x3188('0x35')][_0x3188('0x37')]?_0x2d000a[_0x3188('0x35')]:_0x52bb13[_0x3188('0x30')];if(!_0x4b4675[_0x3188('0x32')]['hasOwnProperty'](_0x3188('0x38'))){_0x2d000a['limit']=qs[_0x3188('0x1f')](_0x4b4675[_0x3188('0x32')]['limit']);_0x2d000a[_0x3188('0x1e')]=qs[_0x3188('0x1e')](_0x4b4675[_0x3188('0x32')][_0x3188('0x1e')]);}_0x2d000a[_0x3188('0x39')]=qs[_0x3188('0x3a')](_0x4b4675[_0x3188('0x32')]['sort']);_0x2d000a['where']=qs[_0x3188('0x33')](_[_0x3188('0x3b')](_0x4b4675[_0x3188('0x32')],_0x52bb13[_0x3188('0x33')]));if(_0x4b4675['query'][_0x3188('0x3c')]){_0x2d000a[_0x3188('0x3d')]=_[_0x3188('0x3e')](_0x2d000a[_0x3188('0x3d')],{'$or':_['map'](_0x14299b,function(_0x201ef2){if(_0x201ef2['type']!==_0x3188('0x3f')){var _0x57895f={};_0x57895f[_0x201ef2[_0x3188('0x28')]]={'$like':'%'+_0x4b4675[_0x3188('0x32')][_0x3188('0x3c')]+'%'};return _0x57895f;}})});}_0x2d000a=_[_0x3188('0x3e')]({},_0x2d000a,_0x4b4675[_0x3188('0x40')]);var _0x2305bf={'where':_0x2d000a[_0x3188('0x3d')]};return db[_0x3188('0x2c')][_0x3188('0x1d')](_0x2305bf)[_0x3188('0x24')](function(_0x539a0f){_0xd3ee40[_0x3188('0x1d')]=_0x539a0f;if(_0x4b4675[_0x3188('0x32')][_0x3188('0x41')]){_0x2d000a[_0x3188('0x42')]=[{'all':!![]}];}return db[_0x3188('0x2c')][_0x3188('0x43')](_0x2d000a);})['then'](function(_0x6b2347){_0xd3ee40['rows']=_0x6b2347;return _0xd3ee40;})[_0x3188('0x24')](respondWithFilteredResult(_0x2cc5d9,_0x2d000a))[_0x3188('0x44')](handleError(_0x2cc5d9,null));};exports[_0x3188('0x45')]=function(_0x8f3756,_0x42c47b){var _0x549ab2={'raw':!![],'where':{'id':_0x8f3756['params']['id']}},_0x484eeb={};_0x484eeb['model']=_['keys'](db[_0x3188('0x2c')][_0x3188('0x2d')]);_0x484eeb[_0x3188('0x32')]=_[_0x3188('0x31')](_0x8f3756[_0x3188('0x32')]);_0x484eeb['filters']=_[_0x3188('0x34')](_0x484eeb['model'],_0x484eeb[_0x3188('0x32')]);_0x549ab2[_0x3188('0x35')]=_[_0x3188('0x34')](_0x484eeb[_0x3188('0x30')],qs['fields'](_0x8f3756[_0x3188('0x32')][_0x3188('0x36')]));_0x549ab2[_0x3188('0x35')]=_0x549ab2[_0x3188('0x35')][_0x3188('0x37')]?_0x549ab2['attributes']:_0x484eeb['model'];if(_0x8f3756[_0x3188('0x32')][_0x3188('0x41')]){_0x549ab2['include']=[{'all':!![]}];}_0x549ab2=_[_0x3188('0x3e')]({},_0x549ab2,_0x8f3756[_0x3188('0x40')]);return db['MailSubstatus'][_0x3188('0x46')](_0x549ab2)[_0x3188('0x24')](handleEntityNotFound(_0x42c47b,null))[_0x3188('0x24')](respondWithResult(_0x42c47b,null))[_0x3188('0x44')](handleError(_0x42c47b,null));};exports[_0x3188('0x47')]=function(_0x5a3142,_0x467ead){return db['MailSubstatus'][_0x3188('0x47')](_0x5a3142[_0x3188('0x48')],{})[_0x3188('0x24')](respondWithResult(_0x467ead,0xc9))[_0x3188('0x44')](handleError(_0x467ead,null));};exports[_0x3188('0x23')]=function(_0x315524,_0x2aa232){if(_0x315524[_0x3188('0x48')]['id']){delete _0x315524[_0x3188('0x48')]['id'];}return db[_0x3188('0x2c')][_0x3188('0x46')]({'where':{'id':_0x315524['params']['id']}})['then'](handleEntityNotFound(_0x2aa232,null))[_0x3188('0x24')](saveUpdates(_0x315524['body'],null))[_0x3188('0x24')](respondWithResult(_0x2aa232,null))[_0x3188('0x44')](handleError(_0x2aa232,null));};exports['destroy']=function(_0x3abc6b,_0x16417a){return db[_0x3188('0x2c')][_0x3188('0x46')]({'where':{'id':_0x3abc6b[_0x3188('0x49')]['id']}})[_0x3188('0x24')](handleEntityNotFound(_0x16417a,null))[_0x3188('0x24')](removeEntity(_0x16417a,null))[_0x3188('0x44')](handleError(_0x16417a,null));};exports['describe']=function(_0x3b8fe9,_0x3051ce){return db['MailSubstatus'][_0x3188('0x4a')]()['then'](respondWithResult(_0x3051ce,null))[_0x3188('0x44')](handleError(_0x3051ce,null));};
\ No newline at end of file
+var _0x6f47=['../../config/environment','../../mysqldb','sendStatus','status','count','offset','limit','set','Content-Range','json','apply','reject','save','then','end','stack','send','index','fieldName','type','key','map','query','keys','filters','intersection','attributes','model','fields','length','order','sort','where','pick','filter','merge','VIRTUAL','name','MailSubstatus','includeAll','include','findAll','catch','show','params','rawAttributes','options','find','create','update','body','destroy','describe','eml-format','rimraf','fast-json-patch','moment','mustache','util','path','sox','ejs','lodash','squel','jsforce','desk.js','to-csv','querystring','papaparse','../../components/parsers/qs','../../components/parsers/advancedSearch','api','../../config/utils'];(function(_0x13e453,_0x4ab30c){var _0x26aad2=function(_0x3387a1){while(--_0x3387a1){_0x13e453['push'](_0x13e453['shift']());}};_0x26aad2(++_0x4ab30c);}(_0x6f47,0xc7));var _0x76f4=function(_0x13b8f3,_0x442821){_0x13b8f3=_0x13b8f3-0x0;var _0x1a6d06=_0x6f47[_0x13b8f3];return _0x1a6d06;};'use strict';var pdf=require('html-pdf');var emlformat=require(_0x76f4('0x0'));var rimraf=require(_0x76f4('0x1'));var zipdir=require('zip-dir');var jsonpatch=require(_0x76f4('0x2'));var rp=require('request-promise');var moment=require(_0x76f4('0x3'));var BPromise=require('bluebird');var Mustache=require(_0x76f4('0x4'));var util=require(_0x76f4('0x5'));var path=require(_0x76f4('0x6'));var sox=require(_0x76f4('0x7'));var csv=require('to-csv');var ejs=require(_0x76f4('0x8'));var fs=require('fs');var _=require(_0x76f4('0x9'));var squel=require(_0x76f4('0xa'));var crypto=require('crypto');var jsforce=require(_0x76f4('0xb'));var deskjs=require(_0x76f4('0xc'));var toCsv=require(_0x76f4('0xd'));var querystring=require(_0x76f4('0xe'));var Papa=require(_0x76f4('0xf'));var Redis=require('ioredis');var authService=require('../../components/auth/service');var qs=require(_0x76f4('0x10'));var as=require(_0x76f4('0x11'));var hardwareService=require('../../config/license/hardware');var logger=require('../../config/logger')(_0x76f4('0x12'));var utils=require(_0x76f4('0x13'));var config=require(_0x76f4('0x14'));var db=require(_0x76f4('0x15'))['db'];function respondWithStatusCode(_0x1aee7f,_0xafd21e){_0xafd21e=_0xafd21e||0xcc;return function(_0xf7e347){if(_0xf7e347){return _0x1aee7f[_0x76f4('0x16')](_0xafd21e);}return _0x1aee7f[_0x76f4('0x17')](_0xafd21e)['end']();};}function respondWithResult(_0x41ba00,_0x30dabf){_0x30dabf=_0x30dabf||0xc8;return function(_0x5da1ff){if(_0x5da1ff){return _0x41ba00['status'](_0x30dabf)['json'](_0x5da1ff);}};}function respondWithFilteredResult(_0x1d7755,_0x3dd240){return function(_0x979946){if(_0x979946){var _0x40252d=_0x979946[_0x76f4('0x18')],_0x3d8f5a=_0x3dd240[_0x76f4('0x19')],_0x2b5e23=_0x3dd240[_0x76f4('0x19')]+_0x3dd240[_0x76f4('0x1a')],_0x46ba51;if(_0x2b5e23>=_0x40252d){_0x2b5e23=_0x40252d;_0x46ba51=0xc8;}else{_0x46ba51=0xce;}_0x1d7755[_0x76f4('0x17')](_0x46ba51);return _0x1d7755[_0x76f4('0x1b')](_0x76f4('0x1c'),_0x3d8f5a+'-'+_0x2b5e23+'/'+_0x40252d)[_0x76f4('0x1d')](_0x979946);}return null;};}function patchUpdates(_0x397360){return function(_0xfedbe4){try{jsonpatch[_0x76f4('0x1e')](_0xfedbe4,_0x397360,!![]);}catch(_0x435534){return BPromise[_0x76f4('0x1f')](_0x435534);}return _0xfedbe4[_0x76f4('0x20')]();};}function saveUpdates(_0x285232,_0x5bf3d5){return function(_0x262937){if(_0x262937){return _0x262937['update'](_0x285232)[_0x76f4('0x21')](function(_0x24ecac){return _0x24ecac;});}return null;};}function removeEntity(_0xf8f722,_0x517c00){return function(_0x567f2a){if(_0x567f2a){return _0x567f2a['destroy']()[_0x76f4('0x21')](function(){_0xf8f722[_0x76f4('0x17')](0xcc)[_0x76f4('0x22')]();});}};}function handleEntityNotFound(_0x2b6d51,_0x42ef70){return function(_0x4786c9){if(!_0x4786c9){_0x2b6d51[_0x76f4('0x16')](0x194);}return _0x4786c9;};}function handleError(_0x4dac8e,_0x504aa8){_0x504aa8=_0x504aa8||0x1f4;return function(_0x3794fa){logger['error'](_0x3794fa[_0x76f4('0x23')]);if(_0x3794fa['name']){delete _0x3794fa['name'];}_0x4dac8e['status'](_0x504aa8)[_0x76f4('0x24')](_0x3794fa);};}exports[_0x76f4('0x25')]=function(_0xd368a2,_0x1d1fe6){var _0x13d219={},_0x447dbc={},_0x5ca31f={'count':0x0,'rows':[]};var _0x306cb4=_['map'](db['MailSubstatus']['rawAttributes'],function(_0x10ddb4){return{'name':_0x10ddb4[_0x76f4('0x26')],'type':_0x10ddb4[_0x76f4('0x27')][_0x76f4('0x28')]};});_0x447dbc['model']=_[_0x76f4('0x29')](_0x306cb4,'name');_0x447dbc[_0x76f4('0x2a')]=_[_0x76f4('0x2b')](_0xd368a2[_0x76f4('0x2a')]);_0x447dbc[_0x76f4('0x2c')]=_[_0x76f4('0x2d')](_0x447dbc['model'],_0x447dbc['query']);_0x13d219[_0x76f4('0x2e')]=_[_0x76f4('0x2d')](_0x447dbc[_0x76f4('0x2f')],qs[_0x76f4('0x30')](_0xd368a2[_0x76f4('0x2a')][_0x76f4('0x30')]));_0x13d219[_0x76f4('0x2e')]=_0x13d219[_0x76f4('0x2e')][_0x76f4('0x31')]?_0x13d219[_0x76f4('0x2e')]:_0x447dbc[_0x76f4('0x2f')];if(!_0xd368a2[_0x76f4('0x2a')]['hasOwnProperty']('nolimit')){_0x13d219['limit']=qs['limit'](_0xd368a2[_0x76f4('0x2a')][_0x76f4('0x1a')]);_0x13d219[_0x76f4('0x19')]=qs[_0x76f4('0x19')](_0xd368a2[_0x76f4('0x2a')]['offset']);}_0x13d219[_0x76f4('0x32')]=qs[_0x76f4('0x33')](_0xd368a2[_0x76f4('0x2a')][_0x76f4('0x33')]);_0x13d219[_0x76f4('0x34')]=qs[_0x76f4('0x2c')](_[_0x76f4('0x35')](_0xd368a2[_0x76f4('0x2a')],_0x447dbc[_0x76f4('0x2c')]));if(_0xd368a2[_0x76f4('0x2a')][_0x76f4('0x36')]){_0x13d219[_0x76f4('0x34')]=_[_0x76f4('0x37')](_0x13d219[_0x76f4('0x34')],{'$or':_[_0x76f4('0x29')](_0x306cb4,function(_0x88506b){if(_0x88506b[_0x76f4('0x27')]!==_0x76f4('0x38')){var _0x597119={};_0x597119[_0x88506b[_0x76f4('0x39')]]={'$like':'%'+_0xd368a2[_0x76f4('0x2a')][_0x76f4('0x36')]+'%'};return _0x597119;}})});}_0x13d219=_['merge']({},_0x13d219,_0xd368a2['options']);var _0x237fba={'where':_0x13d219['where']};return db[_0x76f4('0x3a')]['count'](_0x237fba)[_0x76f4('0x21')](function(_0x16f36d){_0x5ca31f[_0x76f4('0x18')]=_0x16f36d;if(_0xd368a2[_0x76f4('0x2a')][_0x76f4('0x3b')]){_0x13d219[_0x76f4('0x3c')]=[{'all':!![]}];}return db[_0x76f4('0x3a')][_0x76f4('0x3d')](_0x13d219);})[_0x76f4('0x21')](function(_0x80e29f){_0x5ca31f['rows']=_0x80e29f;return _0x5ca31f;})['then'](respondWithFilteredResult(_0x1d1fe6,_0x13d219))[_0x76f4('0x3e')](handleError(_0x1d1fe6,null));};exports[_0x76f4('0x3f')]=function(_0x364cf7,_0x427c70){var _0x2b7dc8={'raw':!![],'where':{'id':_0x364cf7[_0x76f4('0x40')]['id']}},_0x2d6068={};_0x2d6068[_0x76f4('0x2f')]=_[_0x76f4('0x2b')](db['MailSubstatus'][_0x76f4('0x41')]);_0x2d6068[_0x76f4('0x2a')]=_['keys'](_0x364cf7['query']);_0x2d6068[_0x76f4('0x2c')]=_[_0x76f4('0x2d')](_0x2d6068[_0x76f4('0x2f')],_0x2d6068[_0x76f4('0x2a')]);_0x2b7dc8[_0x76f4('0x2e')]=_['intersection'](_0x2d6068[_0x76f4('0x2f')],qs[_0x76f4('0x30')](_0x364cf7[_0x76f4('0x2a')][_0x76f4('0x30')]));_0x2b7dc8[_0x76f4('0x2e')]=_0x2b7dc8[_0x76f4('0x2e')]['length']?_0x2b7dc8[_0x76f4('0x2e')]:_0x2d6068[_0x76f4('0x2f')];if(_0x364cf7[_0x76f4('0x2a')]['includeAll']){_0x2b7dc8['include']=[{'all':!![]}];}_0x2b7dc8=_[_0x76f4('0x37')]({},_0x2b7dc8,_0x364cf7[_0x76f4('0x42')]);return db[_0x76f4('0x3a')][_0x76f4('0x43')](_0x2b7dc8)[_0x76f4('0x21')](handleEntityNotFound(_0x427c70,null))['then'](respondWithResult(_0x427c70,null))['catch'](handleError(_0x427c70,null));};exports[_0x76f4('0x44')]=function(_0x4a1f9f,_0x42b30d){return db[_0x76f4('0x3a')]['create'](_0x4a1f9f['body'],{})[_0x76f4('0x21')](respondWithResult(_0x42b30d,0xc9))[_0x76f4('0x3e')](handleError(_0x42b30d,null));};exports[_0x76f4('0x45')]=function(_0x217d3a,_0x55e4cc){if(_0x217d3a[_0x76f4('0x46')]['id']){delete _0x217d3a[_0x76f4('0x46')]['id'];}return db[_0x76f4('0x3a')]['find']({'where':{'id':_0x217d3a[_0x76f4('0x40')]['id']}})[_0x76f4('0x21')](handleEntityNotFound(_0x55e4cc,null))['then'](saveUpdates(_0x217d3a['body'],null))[_0x76f4('0x21')](respondWithResult(_0x55e4cc,null))[_0x76f4('0x3e')](handleError(_0x55e4cc,null));};exports[_0x76f4('0x47')]=function(_0x1edc96,_0x2a61d3){return db['MailSubstatus'][_0x76f4('0x43')]({'where':{'id':_0x1edc96['params']['id']}})[_0x76f4('0x21')](handleEntityNotFound(_0x2a61d3,null))[_0x76f4('0x21')](removeEntity(_0x2a61d3,null))[_0x76f4('0x3e')](handleError(_0x2a61d3,null));};exports['describe']=function(_0x312319,_0x326e76){return db['MailSubstatus'][_0x76f4('0x48')]()[_0x76f4('0x21')](respondWithResult(_0x326e76,null))[_0x76f4('0x3e')](handleError(_0x326e76,null));};
\ No newline at end of file
diff --git a/server/api/mailSubstatus/mailSubstatus.model.js b/server/api/mailSubstatus/mailSubstatus.model.js
index 631b766..a7b8250 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 _0x793b=['api','moment','request-promise','path','./mailSubstatus.attributes','exports','define','MailSubstatus','mail_substatuses','lodash','util','../../config/logger'];(function(_0x946b74,_0xbe58ff){var _0x1289bc=function(_0x273271){while(--_0x273271){_0x946b74['push'](_0x946b74['shift']());}};_0x1289bc(++_0xbe58ff);}(_0x793b,0x189));var _0xb793=function(_0x294d7a,_0x312a37){_0x294d7a=_0x294d7a-0x0;var _0x43b0d5=_0x793b[_0x294d7a];return _0x43b0d5;};'use strict';var _=require(_0xb793('0x0'));var util=require(_0xb793('0x1'));var logger=require(_0xb793('0x2'))(_0xb793('0x3'));var moment=require(_0xb793('0x4'));var BPromise=require('bluebird');var rp=require(_0xb793('0x5'));var fs=require('fs');var path=require(_0xb793('0x6'));var rimraf=require('rimraf');var config=require('../../config/environment');var attributes=require(_0xb793('0x7'));module[_0xb793('0x8')]=function(_0x322b07,_0x2b1f19){return _0x322b07[_0xb793('0x9')](_0xb793('0xa'),attributes,{'tableName':_0xb793('0xb'),'paranoid':![],'indexes':[],'timestamps':!![]});};
\ No newline at end of file
+var _0x8383=['request-promise','path','rimraf','../../config/environment','./mailSubstatus.attributes','exports','define','MailSubstatus','lodash','api','moment','bluebird'];(function(_0x243928,_0xebb38c){var _0x3cb768=function(_0x1cc3ae){while(--_0x1cc3ae){_0x243928['push'](_0x243928['shift']());}};_0x3cb768(++_0xebb38c);}(_0x8383,0x98));var _0x3838=function(_0x5a50f1,_0x5aa212){_0x5a50f1=_0x5a50f1-0x0;var _0x1dd8d5=_0x8383[_0x5a50f1];return _0x1dd8d5;};'use strict';var _=require(_0x3838('0x0'));var util=require('util');var logger=require('../../config/logger')(_0x3838('0x1'));var moment=require(_0x3838('0x2'));var BPromise=require(_0x3838('0x3'));var rp=require(_0x3838('0x4'));var fs=require('fs');var path=require(_0x3838('0x5'));var rimraf=require(_0x3838('0x6'));var config=require(_0x3838('0x7'));var attributes=require(_0x3838('0x8'));module[_0x3838('0x9')]=function(_0x7a4cc0,_0x509656){return _0x7a4cc0[_0x3838('0xa')](_0x3838('0xb'),attributes,{'tableName':'mail_substatuses','paranoid':![],'indexes':[],'timestamps':!![]});};
\ No newline at end of file
diff --git a/server/api/mailSubstatus/mailSubstatus.rpc.js b/server/api/mailSubstatus/mailSubstatus.rpc.js
index 00037cb..1f90b0a 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 _0x4483=['stringify','error','message','result','catch','lodash','util','moment','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','../../config/environment','jayson/promise','client','http','then','info','MailSubstatus,\x20%s,\x20%s','request\x20sent','debug','MailSubstatus,\x20%s,\x20%s,\x20%s'];(function(_0x1f7db4,_0x3f4e4a){var _0x490e3d=function(_0x3fb06e){while(--_0x3fb06e){_0x1f7db4['push'](_0x1f7db4['shift']());}};_0x490e3d(++_0x3f4e4a);}(_0x4483,0x1a3));var _0x3448=function(_0x31b797,_0x34f5e5){_0x31b797=_0x31b797-0x0;var _0x982858=_0x4483[_0x31b797];return _0x982858;};'use strict';var _=require(_0x3448('0x0'));var util=require(_0x3448('0x1'));var moment=require(_0x3448('0x2'));var BPromise=require('bluebird');var rs=require(_0x3448('0x3'));var fs=require('fs');var Redis=require(_0x3448('0x4'));var db=require(_0x3448('0x5'))['db'];var utils=require(_0x3448('0x6'));var logger=require(_0x3448('0x7'))('rpc');var config=require(_0x3448('0x8'));var jayson=require(_0x3448('0x9'));var client=jayson[_0x3448('0xa')][_0x3448('0xb')]({'port':0x232a});function respondWithRpcPromise(_0x1bb7e5,_0x2caa81,_0x3cc81d){return new BPromise(function(_0x34b926,_0x5923ee){return client['request'](_0x1bb7e5,_0x3cc81d)[_0x3448('0xc')](function(_0x25c152){logger[_0x3448('0xd')](_0x3448('0xe'),_0x2caa81,_0x3448('0xf'));logger[_0x3448('0x10')](_0x3448('0x11'),_0x2caa81,_0x3448('0xf'),JSON[_0x3448('0x12')](_0x25c152));if(_0x25c152[_0x3448('0x13')]){if(_0x25c152[_0x3448('0x13')]['code']===0x1f4){logger['error'](_0x3448('0xe'),_0x2caa81,_0x25c152[_0x3448('0x13')]['message']);return _0x5923ee(_0x25c152[_0x3448('0x13')][_0x3448('0x14')]);}logger[_0x3448('0x13')]('MailSubstatus,\x20%s,\x20%s',_0x2caa81,_0x25c152[_0x3448('0x13')][_0x3448('0x14')]);return _0x34b926(_0x25c152['error'][_0x3448('0x14')]);}else{logger[_0x3448('0xd')](_0x3448('0xe'),_0x2caa81,'request\x20sent');_0x34b926(_0x25c152[_0x3448('0x15')][_0x3448('0x14')]);}})[_0x3448('0x16')](function(_0x30f8dd){logger[_0x3448('0x13')](_0x3448('0xe'),_0x2caa81,_0x30f8dd);_0x5923ee(_0x30f8dd);});});}
\ No newline at end of file
+var _0xbdb7=['request\x20sent','debug','MailSubstatus,\x20%s,\x20%s,\x20%s','stringify','error','message','result','catch','lodash','util','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','../../config/environment','http','info','MailSubstatus,\x20%s,\x20%s'];(function(_0x2641f9,_0x26715f){var _0x585741=function(_0x2d1462){while(--_0x2d1462){_0x2641f9['push'](_0x2641f9['shift']());}};_0x585741(++_0x26715f);}(_0xbdb7,0x12e));var _0x7bdb=function(_0x1ddc91,_0x132ec7){_0x1ddc91=_0x1ddc91-0x0;var _0x3559bb=_0xbdb7[_0x1ddc91];return _0x3559bb;};'use strict';var _=require(_0x7bdb('0x0'));var util=require(_0x7bdb('0x1'));var moment=require(_0x7bdb('0x2'));var BPromise=require(_0x7bdb('0x3'));var rs=require(_0x7bdb('0x4'));var fs=require('fs');var Redis=require(_0x7bdb('0x5'));var db=require(_0x7bdb('0x6'))['db'];var utils=require(_0x7bdb('0x7'));var logger=require(_0x7bdb('0x8'))('rpc');var config=require(_0x7bdb('0x9'));var jayson=require('jayson/promise');var client=jayson['client'][_0x7bdb('0xa')]({'port':0x232a});function respondWithRpcPromise(_0x1e23a3,_0x493bde,_0x513cba){return new BPromise(function(_0x468041,_0x11a877){return client['request'](_0x1e23a3,_0x513cba)['then'](function(_0xdc2ffc){logger[_0x7bdb('0xb')](_0x7bdb('0xc'),_0x493bde,_0x7bdb('0xd'));logger[_0x7bdb('0xe')](_0x7bdb('0xf'),_0x493bde,_0x7bdb('0xd'),JSON[_0x7bdb('0x10')](_0xdc2ffc));if(_0xdc2ffc['error']){if(_0xdc2ffc['error']['code']===0x1f4){logger[_0x7bdb('0x11')](_0x7bdb('0xc'),_0x493bde,_0xdc2ffc['error'][_0x7bdb('0x12')]);return _0x11a877(_0xdc2ffc['error']['message']);}logger[_0x7bdb('0x11')](_0x7bdb('0xc'),_0x493bde,_0xdc2ffc['error']['message']);return _0x468041(_0xdc2ffc['error'][_0x7bdb('0x12')]);}else{logger[_0x7bdb('0xb')](_0x7bdb('0xc'),_0x493bde,_0x7bdb('0xd'));_0x468041(_0xdc2ffc[_0x7bdb('0x13')][_0x7bdb('0x12')]);}})[_0x7bdb('0x14')](function(_0x1b2d9b){logger['error'](_0x7bdb('0xc'),_0x493bde,_0x1b2d9b);_0x11a877(_0x1b2d9b);});});}
\ No newline at end of file
diff --git a/server/api/mailTransferReport/index.js b/server/api/mailTransferReport/index.js
index ee0e7aa..5b468df 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 _0x85d7=['connect-timeout','Router','../../components/auth/service','../../components/interaction/service','../../config/environment','./mailTransferReport.controller','isAuthenticated','index','describe','/:id','show','post','create','delete','destroy','exports','multer','util','path'];(function(_0x1013e3,_0xccc357){var _0x1b948c=function(_0x516477){while(--_0x516477){_0x1013e3['push'](_0x1013e3['shift']());}};_0x1b948c(++_0xccc357);}(_0x85d7,0x1eb));var _0x785d=function(_0x2417f9,_0x803ba4){_0x2417f9=_0x2417f9-0x0;var _0x142d82=_0x85d7[_0x2417f9];return _0x142d82;};'use strict';var multer=require(_0x785d('0x0'));var util=require(_0x785d('0x1'));var path=require(_0x785d('0x2'));var timeout=require(_0x785d('0x3'));var express=require('express');var router=express[_0x785d('0x4')]();var auth=require(_0x785d('0x5'));var interaction=require(_0x785d('0x6'));var config=require(_0x785d('0x7'));var controller=require(_0x785d('0x8'));router['get']('/',auth[_0x785d('0x9')](),controller[_0x785d('0xa')]);router['get']('/describe',auth[_0x785d('0x9')](),controller[_0x785d('0xb')]);router['get'](_0x785d('0xc'),auth['isAuthenticated'](),controller[_0x785d('0xd')]);router[_0x785d('0xe')]('/',auth[_0x785d('0x9')](),controller[_0x785d('0xf')]);router['put'](_0x785d('0xc'),auth['isAuthenticated'](),controller['update']);router[_0x785d('0x10')](_0x785d('0xc'),auth['isAuthenticated'](),controller[_0x785d('0x11')]);module[_0x785d('0x12')]=router;
\ No newline at end of file
+var _0x764e=['./mailTransferReport.controller','get','/describe','describe','/:id','isAuthenticated','show','post','put','delete','destroy','exports','util','path','connect-timeout','express','../../components/auth/service','../../components/interaction/service','../../config/environment'];(function(_0x5a1b87,_0x52b29e){var _0x346e7d=function(_0x1bb453){while(--_0x1bb453){_0x5a1b87['push'](_0x5a1b87['shift']());}};_0x346e7d(++_0x52b29e);}(_0x764e,0x188));var _0xe764=function(_0x3dd15e,_0x1f0015){_0x3dd15e=_0x3dd15e-0x0;var _0x231fd0=_0x764e[_0x3dd15e];return _0x231fd0;};'use strict';var multer=require('multer');var util=require(_0xe764('0x0'));var path=require(_0xe764('0x1'));var timeout=require(_0xe764('0x2'));var express=require(_0xe764('0x3'));var router=express['Router']();var auth=require(_0xe764('0x4'));var interaction=require(_0xe764('0x5'));var config=require(_0xe764('0x6'));var controller=require(_0xe764('0x7'));router['get']('/',auth['isAuthenticated'](),controller['index']);router[_0xe764('0x8')](_0xe764('0x9'),auth['isAuthenticated'](),controller[_0xe764('0xa')]);router['get'](_0xe764('0xb'),auth[_0xe764('0xc')](),controller[_0xe764('0xd')]);router[_0xe764('0xe')]('/',auth[_0xe764('0xc')](),controller['create']);router[_0xe764('0xf')](_0xe764('0xb'),auth[_0xe764('0xc')](),controller['update']);router[_0xe764('0x10')](_0xe764('0xb'),auth[_0xe764('0xc')](),controller[_0xe764('0x11')]);module[_0xe764('0x12')]=router;
\ No newline at end of file
diff --git a/server/api/mailTransferReport/mailTransferReport.attributes.js b/server/api/mailTransferReport/mailTransferReport.attributes.js
index ed680cc..4d38a01 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 _0x15d5=['DATE','NOW','moment','sequelize','exports','STRING','ENUM','agent','queue'];(function(_0x16e783,_0x4d9780){var _0x226857=function(_0x34efe6){while(--_0x34efe6){_0x16e783['push'](_0x16e783['shift']());}};_0x226857(++_0x4d9780);}(_0x15d5,0x110));var _0x515d=function(_0x266eb8,_0x44d5b1){_0x266eb8=_0x266eb8-0x0;var _0x461f13=_0x15d5[_0x266eb8];return _0x461f13;};'use strict';var moment=require(_0x515d('0x0'));var Sequelize=require(_0x515d('0x1'));module[_0x515d('0x2')]={'uniqueid':{'type':Sequelize[_0x515d('0x3')],'allowNull':![]},'type':{'type':Sequelize[_0x515d('0x4')]('account',_0x515d('0x5'),_0x515d('0x6')),'allowNull':![],'defaultValue':_0x515d('0x6')},'transferredAt':{'type':Sequelize[_0x515d('0x7')],'allowNull':![],'defaultValue':Sequelize[_0x515d('0x8')]}};
\ No newline at end of file
+var _0xcb05=['NOW','sequelize','STRING','account','agent','queue','DATE'];(function(_0x552d53,_0x5abab9){var _0x4eb13e=function(_0x38adfe){while(--_0x38adfe){_0x552d53['push'](_0x552d53['shift']());}};_0x4eb13e(++_0x5abab9);}(_0xcb05,0x94));var _0x5cb0=function(_0x446f82,_0x4adf46){_0x446f82=_0x446f82-0x0;var _0x48a243=_0xcb05[_0x446f82];return _0x48a243;};'use strict';var moment=require('moment');var Sequelize=require(_0x5cb0('0x0'));module['exports']={'uniqueid':{'type':Sequelize[_0x5cb0('0x1')],'allowNull':![]},'type':{'type':Sequelize['ENUM'](_0x5cb0('0x2'),_0x5cb0('0x3'),_0x5cb0('0x4')),'allowNull':![],'defaultValue':_0x5cb0('0x4')},'transferredAt':{'type':Sequelize[_0x5cb0('0x5')],'allowNull':![],'defaultValue':Sequelize[_0x5cb0('0x6')]}};
\ No newline at end of file
diff --git a/server/api/mailTransferReport/mailTransferReport.controller.js b/server/api/mailTransferReport/mailTransferReport.controller.js
index a2ab060..53ffe26 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 _0x7a54=['Content-Range','apply','reject','save','then','destroy','sendStatus','error','name','send','map','MailTransferReport','rawAttributes','fieldName','type','key','query','keys','intersection','model','attributes','fields','length','hasOwnProperty','nolimit','order','sort','filters','filter','where','merge','VIRTUAL','count','includeAll','findAll','rows','catch','show','params','include','options','find','create','body','update','describe','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','status','end','json','offset','set'];(function(_0x47e968,_0xd471b9){var _0x466147=function(_0x387804){while(--_0x387804){_0x47e968['push'](_0x47e968['shift']());}};_0x466147(++_0xd471b9);}(_0x7a54,0x106));var _0x47a5=function(_0x2557c7,_0x544292){_0x2557c7=_0x2557c7-0x0;var _0x25c7db=_0x7a54[_0x2557c7];return _0x25c7db;};'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'];function respondWithStatusCode(_0xd612dd,_0xd308b8){_0xd308b8=_0xd308b8||0xcc;return function(_0x1eae59){if(_0x1eae59){return _0xd612dd['sendStatus'](_0xd308b8);}return _0xd612dd[_0x47a5('0x15')](_0xd308b8)[_0x47a5('0x16')]();};}function respondWithResult(_0x1cf309,_0x711793){_0x711793=_0x711793||0xc8;return function(_0x139f25){if(_0x139f25){return _0x1cf309[_0x47a5('0x15')](_0x711793)[_0x47a5('0x17')](_0x139f25);}};}function respondWithFilteredResult(_0x190faa,_0x4e99a8){return function(_0x362359){if(_0x362359){var _0x11faf5=_0x362359['count'],_0x3b001e=_0x4e99a8['offset'],_0x2a2cbb=_0x4e99a8[_0x47a5('0x18')]+_0x4e99a8['limit'],_0x1ef44c;if(_0x2a2cbb>=_0x11faf5){_0x2a2cbb=_0x11faf5;_0x1ef44c=0xc8;}else{_0x1ef44c=0xce;}_0x190faa['status'](_0x1ef44c);return _0x190faa[_0x47a5('0x19')](_0x47a5('0x1a'),_0x3b001e+'-'+_0x2a2cbb+'/'+_0x11faf5)[_0x47a5('0x17')](_0x362359);}return null;};}function patchUpdates(_0x1ef371){return function(_0x477b1d){try{jsonpatch[_0x47a5('0x1b')](_0x477b1d,_0x1ef371,!![]);}catch(_0x2763d6){return BPromise[_0x47a5('0x1c')](_0x2763d6);}return _0x477b1d[_0x47a5('0x1d')]();};}function saveUpdates(_0x4a9fcb,_0x1570bc){return function(_0xf160ba){if(_0xf160ba){return _0xf160ba['update'](_0x4a9fcb)[_0x47a5('0x1e')](function(_0x1f03f7){return _0x1f03f7;});}return null;};}function removeEntity(_0x36874d,_0x4c5910){return function(_0xb8ae6c){if(_0xb8ae6c){return _0xb8ae6c[_0x47a5('0x1f')]()[_0x47a5('0x1e')](function(){_0x36874d[_0x47a5('0x15')](0xcc)['end']();});}};}function handleEntityNotFound(_0xe2dea9,_0x385687){return function(_0x513981){if(!_0x513981){_0xe2dea9[_0x47a5('0x20')](0x194);}return _0x513981;};}function handleError(_0xc4cd63,_0x4437f1){_0x4437f1=_0x4437f1||0x1f4;return function(_0x129ce5){logger[_0x47a5('0x21')](_0x129ce5['stack']);if(_0x129ce5['name']){delete _0x129ce5[_0x47a5('0x22')];}_0xc4cd63['status'](_0x4437f1)[_0x47a5('0x23')](_0x129ce5);};}exports['index']=function(_0x23cb77,_0x378208){var _0x36ad34={},_0x1dac65={},_0x21f296={'count':0x0,'rows':[]};var _0x3ba0b7=_[_0x47a5('0x24')](db[_0x47a5('0x25')][_0x47a5('0x26')],function(_0x361bfa){return{'name':_0x361bfa[_0x47a5('0x27')],'type':_0x361bfa[_0x47a5('0x28')][_0x47a5('0x29')]};});_0x1dac65['model']=_[_0x47a5('0x24')](_0x3ba0b7,'name');_0x1dac65[_0x47a5('0x2a')]=_[_0x47a5('0x2b')](_0x23cb77[_0x47a5('0x2a')]);_0x1dac65['filters']=_[_0x47a5('0x2c')](_0x1dac65[_0x47a5('0x2d')],_0x1dac65[_0x47a5('0x2a')]);_0x36ad34[_0x47a5('0x2e')]=_['intersection'](_0x1dac65['model'],qs[_0x47a5('0x2f')](_0x23cb77[_0x47a5('0x2a')]['fields']));_0x36ad34['attributes']=_0x36ad34[_0x47a5('0x2e')][_0x47a5('0x30')]?_0x36ad34['attributes']:_0x1dac65[_0x47a5('0x2d')];if(!_0x23cb77['query'][_0x47a5('0x31')](_0x47a5('0x32'))){_0x36ad34['limit']=qs['limit'](_0x23cb77[_0x47a5('0x2a')]['limit']);_0x36ad34[_0x47a5('0x18')]=qs[_0x47a5('0x18')](_0x23cb77[_0x47a5('0x2a')]['offset']);}_0x36ad34[_0x47a5('0x33')]=qs['sort'](_0x23cb77['query'][_0x47a5('0x34')]);_0x36ad34['where']=qs[_0x47a5('0x35')](_['pick'](_0x23cb77[_0x47a5('0x2a')],_0x1dac65[_0x47a5('0x35')]));if(_0x23cb77[_0x47a5('0x2a')][_0x47a5('0x36')]){_0x36ad34[_0x47a5('0x37')]=_[_0x47a5('0x38')](_0x36ad34[_0x47a5('0x37')],{'$or':_[_0x47a5('0x24')](_0x3ba0b7,function(_0x1a0d23){if(_0x1a0d23['type']!==_0x47a5('0x39')){var _0x10f136={};_0x10f136[_0x1a0d23['name']]={'$like':'%'+_0x23cb77[_0x47a5('0x2a')][_0x47a5('0x36')]+'%'};return _0x10f136;}})});}_0x36ad34=_[_0x47a5('0x38')]({},_0x36ad34,_0x23cb77['options']);var _0x101f70={'where':_0x36ad34[_0x47a5('0x37')]};return db['MailTransferReport'][_0x47a5('0x3a')](_0x101f70)[_0x47a5('0x1e')](function(_0x54ae35){_0x21f296['count']=_0x54ae35;if(_0x23cb77['query'][_0x47a5('0x3b')]){_0x36ad34['include']=[{'all':!![]}];}return db[_0x47a5('0x25')][_0x47a5('0x3c')](_0x36ad34);})[_0x47a5('0x1e')](function(_0x111f0d){_0x21f296[_0x47a5('0x3d')]=_0x111f0d;return _0x21f296;})[_0x47a5('0x1e')](respondWithFilteredResult(_0x378208,_0x36ad34))[_0x47a5('0x3e')](handleError(_0x378208,null));};exports[_0x47a5('0x3f')]=function(_0x3fa2a8,_0x36a24e){var _0x280500={'raw':!![],'where':{'id':_0x3fa2a8[_0x47a5('0x40')]['id']}},_0x1658e8={};_0x1658e8['model']=_[_0x47a5('0x2b')](db[_0x47a5('0x25')][_0x47a5('0x26')]);_0x1658e8[_0x47a5('0x2a')]=_['keys'](_0x3fa2a8[_0x47a5('0x2a')]);_0x1658e8['filters']=_['intersection'](_0x1658e8['model'],_0x1658e8['query']);_0x280500[_0x47a5('0x2e')]=_['intersection'](_0x1658e8[_0x47a5('0x2d')],qs[_0x47a5('0x2f')](_0x3fa2a8[_0x47a5('0x2a')]['fields']));_0x280500[_0x47a5('0x2e')]=_0x280500[_0x47a5('0x2e')]['length']?_0x280500['attributes']:_0x1658e8[_0x47a5('0x2d')];if(_0x3fa2a8['query'][_0x47a5('0x3b')]){_0x280500[_0x47a5('0x41')]=[{'all':!![]}];}_0x280500=_[_0x47a5('0x38')]({},_0x280500,_0x3fa2a8[_0x47a5('0x42')]);return db[_0x47a5('0x25')][_0x47a5('0x43')](_0x280500)[_0x47a5('0x1e')](handleEntityNotFound(_0x36a24e,null))[_0x47a5('0x1e')](respondWithResult(_0x36a24e,null))[_0x47a5('0x3e')](handleError(_0x36a24e,null));};exports[_0x47a5('0x44')]=function(_0x24ecb1,_0x3c3ebf){return db[_0x47a5('0x25')][_0x47a5('0x44')](_0x24ecb1[_0x47a5('0x45')],{})[_0x47a5('0x1e')](respondWithResult(_0x3c3ebf,0xc9))['catch'](handleError(_0x3c3ebf,null));};exports[_0x47a5('0x46')]=function(_0x23bb04,_0x49eab1){if(_0x23bb04['body']['id']){delete _0x23bb04[_0x47a5('0x45')]['id'];}return db['MailTransferReport'][_0x47a5('0x43')]({'where':{'id':_0x23bb04[_0x47a5('0x40')]['id']}})['then'](handleEntityNotFound(_0x49eab1,null))['then'](saveUpdates(_0x23bb04[_0x47a5('0x45')],null))['then'](respondWithResult(_0x49eab1,null))[_0x47a5('0x3e')](handleError(_0x49eab1,null));};exports[_0x47a5('0x1f')]=function(_0x3548bc,_0x3e12a7){return db[_0x47a5('0x25')][_0x47a5('0x43')]({'where':{'id':_0x3548bc[_0x47a5('0x40')]['id']}})['then'](handleEntityNotFound(_0x3e12a7,null))['then'](removeEntity(_0x3e12a7,null))[_0x47a5('0x3e')](handleError(_0x3e12a7,null));};exports[_0x47a5('0x47')]=function(_0x1163e3,_0x9ea93e){return db[_0x47a5('0x25')][_0x47a5('0x47')]()[_0x47a5('0x1e')](respondWithResult(_0x9ea93e,null))['catch'](handleError(_0x9ea93e,null));};
\ No newline at end of file
+var _0x9957=['eml-format','rimraf','zip-dir','request-promise','moment','bluebird','mustache','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','api','../../config/utils','../../mysqldb','sendStatus','status','end','json','offset','limit','set','Content-Range','reject','save','then','destroy','error','stack','name','send','map','rawAttributes','fieldName','type','key','query','keys','filters','intersection','model','fields','attributes','pick','filter','where','merge','VIRTUAL','options','MailTransferReport','count','includeAll','include','findAll','rows','show','find','catch','create','body','update','params','describe','html-pdf'];(function(_0x1064ee,_0x54d817){var _0xe88259=function(_0x4717c){while(--_0x4717c){_0x1064ee['push'](_0x1064ee['shift']());}};_0xe88259(++_0x54d817);}(_0x9957,0x93));var _0x7995=function(_0x3947c9,_0x4d6c97){_0x3947c9=_0x3947c9-0x0;var _0x2e7871=_0x9957[_0x3947c9];return _0x2e7871;};'use strict';var pdf=require(_0x7995('0x0'));var emlformat=require(_0x7995('0x1'));var rimraf=require(_0x7995('0x2'));var zipdir=require(_0x7995('0x3'));var jsonpatch=require('fast-json-patch');var rp=require(_0x7995('0x4'));var moment=require(_0x7995('0x5'));var BPromise=require(_0x7995('0x6'));var Mustache=require(_0x7995('0x7'));var util=require('util');var path=require(_0x7995('0x8'));var sox=require(_0x7995('0x9'));var csv=require(_0x7995('0xa'));var ejs=require(_0x7995('0xb'));var fs=require('fs');var _=require(_0x7995('0xc'));var squel=require(_0x7995('0xd'));var crypto=require('crypto');var jsforce=require(_0x7995('0xe'));var deskjs=require(_0x7995('0xf'));var toCsv=require('to-csv');var querystring=require(_0x7995('0x10'));var Papa=require(_0x7995('0x11'));var Redis=require(_0x7995('0x12'));var authService=require(_0x7995('0x13'));var qs=require(_0x7995('0x14'));var as=require(_0x7995('0x15'));var hardwareService=require(_0x7995('0x16'));var logger=require('../../config/logger')(_0x7995('0x17'));var utils=require(_0x7995('0x18'));var config=require('../../config/environment');var db=require(_0x7995('0x19'))['db'];function respondWithStatusCode(_0x2cb37a,_0x19a27e){_0x19a27e=_0x19a27e||0xcc;return function(_0x385f00){if(_0x385f00){return _0x2cb37a[_0x7995('0x1a')](_0x19a27e);}return _0x2cb37a[_0x7995('0x1b')](_0x19a27e)[_0x7995('0x1c')]();};}function respondWithResult(_0x4cc004,_0x58f5ad){_0x58f5ad=_0x58f5ad||0xc8;return function(_0x2b4e94){if(_0x2b4e94){return _0x4cc004[_0x7995('0x1b')](_0x58f5ad)[_0x7995('0x1d')](_0x2b4e94);}};}function respondWithFilteredResult(_0x321ae8,_0x3f1d3e){return function(_0x1a5310){if(_0x1a5310){var _0x2202ce=_0x1a5310['count'],_0x41cbf0=_0x3f1d3e[_0x7995('0x1e')],_0x5377e5=_0x3f1d3e[_0x7995('0x1e')]+_0x3f1d3e[_0x7995('0x1f')],_0x2eeacc;if(_0x5377e5>=_0x2202ce){_0x5377e5=_0x2202ce;_0x2eeacc=0xc8;}else{_0x2eeacc=0xce;}_0x321ae8[_0x7995('0x1b')](_0x2eeacc);return _0x321ae8[_0x7995('0x20')](_0x7995('0x21'),_0x41cbf0+'-'+_0x5377e5+'/'+_0x2202ce)['json'](_0x1a5310);}return null;};}function patchUpdates(_0x54c9ae){return function(_0x2536c8){try{jsonpatch['apply'](_0x2536c8,_0x54c9ae,!![]);}catch(_0x555f74){return BPromise[_0x7995('0x22')](_0x555f74);}return _0x2536c8[_0x7995('0x23')]();};}function saveUpdates(_0x4cbe10,_0x3a9b54){return function(_0x51f276){if(_0x51f276){return _0x51f276['update'](_0x4cbe10)[_0x7995('0x24')](function(_0x327b1f){return _0x327b1f;});}return null;};}function removeEntity(_0x350fd9,_0x1a8568){return function(_0x460924){if(_0x460924){return _0x460924[_0x7995('0x25')]()['then'](function(){_0x350fd9[_0x7995('0x1b')](0xcc)[_0x7995('0x1c')]();});}};}function handleEntityNotFound(_0x204507,_0x285437){return function(_0x563799){if(!_0x563799){_0x204507[_0x7995('0x1a')](0x194);}return _0x563799;};}function handleError(_0x475351,_0x472195){_0x472195=_0x472195||0x1f4;return function(_0x59405a){logger[_0x7995('0x26')](_0x59405a[_0x7995('0x27')]);if(_0x59405a[_0x7995('0x28')]){delete _0x59405a[_0x7995('0x28')];}_0x475351[_0x7995('0x1b')](_0x472195)[_0x7995('0x29')](_0x59405a);};}exports['index']=function(_0x47625f,_0x5911c3){var _0x229742={},_0x49bc7e={},_0xf16cc2={'count':0x0,'rows':[]};var _0x132a42=_[_0x7995('0x2a')](db['MailTransferReport'][_0x7995('0x2b')],function(_0x514445){return{'name':_0x514445[_0x7995('0x2c')],'type':_0x514445[_0x7995('0x2d')][_0x7995('0x2e')]};});_0x49bc7e['model']=_['map'](_0x132a42,'name');_0x49bc7e[_0x7995('0x2f')]=_[_0x7995('0x30')](_0x47625f[_0x7995('0x2f')]);_0x49bc7e[_0x7995('0x31')]=_[_0x7995('0x32')](_0x49bc7e[_0x7995('0x33')],_0x49bc7e['query']);_0x229742['attributes']=_[_0x7995('0x32')](_0x49bc7e['model'],qs[_0x7995('0x34')](_0x47625f[_0x7995('0x2f')][_0x7995('0x34')]));_0x229742[_0x7995('0x35')]=_0x229742[_0x7995('0x35')]['length']?_0x229742[_0x7995('0x35')]:_0x49bc7e[_0x7995('0x33')];if(!_0x47625f['query']['hasOwnProperty']('nolimit')){_0x229742[_0x7995('0x1f')]=qs[_0x7995('0x1f')](_0x47625f['query'][_0x7995('0x1f')]);_0x229742['offset']=qs[_0x7995('0x1e')](_0x47625f[_0x7995('0x2f')][_0x7995('0x1e')]);}_0x229742['order']=qs['sort'](_0x47625f[_0x7995('0x2f')]['sort']);_0x229742['where']=qs[_0x7995('0x31')](_[_0x7995('0x36')](_0x47625f['query'],_0x49bc7e[_0x7995('0x31')]));if(_0x47625f[_0x7995('0x2f')][_0x7995('0x37')]){_0x229742[_0x7995('0x38')]=_[_0x7995('0x39')](_0x229742['where'],{'$or':_[_0x7995('0x2a')](_0x132a42,function(_0x242713){if(_0x242713[_0x7995('0x2d')]!==_0x7995('0x3a')){var _0x4b1541={};_0x4b1541[_0x242713[_0x7995('0x28')]]={'$like':'%'+_0x47625f[_0x7995('0x2f')][_0x7995('0x37')]+'%'};return _0x4b1541;}})});}_0x229742=_[_0x7995('0x39')]({},_0x229742,_0x47625f[_0x7995('0x3b')]);var _0x1035dc={'where':_0x229742['where']};return db[_0x7995('0x3c')][_0x7995('0x3d')](_0x1035dc)[_0x7995('0x24')](function(_0x2ea47f){_0xf16cc2[_0x7995('0x3d')]=_0x2ea47f;if(_0x47625f[_0x7995('0x2f')][_0x7995('0x3e')]){_0x229742[_0x7995('0x3f')]=[{'all':!![]}];}return db[_0x7995('0x3c')][_0x7995('0x40')](_0x229742);})[_0x7995('0x24')](function(_0x270d52){_0xf16cc2[_0x7995('0x41')]=_0x270d52;return _0xf16cc2;})['then'](respondWithFilteredResult(_0x5911c3,_0x229742))['catch'](handleError(_0x5911c3,null));};exports[_0x7995('0x42')]=function(_0x7325e8,_0x58523e){var _0x4b0855={'raw':!![],'where':{'id':_0x7325e8['params']['id']}},_0x3f8522={};_0x3f8522['model']=_[_0x7995('0x30')](db[_0x7995('0x3c')][_0x7995('0x2b')]);_0x3f8522['query']=_[_0x7995('0x30')](_0x7325e8['query']);_0x3f8522[_0x7995('0x31')]=_['intersection'](_0x3f8522['model'],_0x3f8522[_0x7995('0x2f')]);_0x4b0855[_0x7995('0x35')]=_[_0x7995('0x32')](_0x3f8522[_0x7995('0x33')],qs['fields'](_0x7325e8[_0x7995('0x2f')][_0x7995('0x34')]));_0x4b0855[_0x7995('0x35')]=_0x4b0855[_0x7995('0x35')]['length']?_0x4b0855['attributes']:_0x3f8522[_0x7995('0x33')];if(_0x7325e8['query'][_0x7995('0x3e')]){_0x4b0855['include']=[{'all':!![]}];}_0x4b0855=_[_0x7995('0x39')]({},_0x4b0855,_0x7325e8['options']);return db[_0x7995('0x3c')][_0x7995('0x43')](_0x4b0855)['then'](handleEntityNotFound(_0x58523e,null))[_0x7995('0x24')](respondWithResult(_0x58523e,null))[_0x7995('0x44')](handleError(_0x58523e,null));};exports[_0x7995('0x45')]=function(_0xb70a51,_0x4c6837){return db[_0x7995('0x3c')][_0x7995('0x45')](_0xb70a51[_0x7995('0x46')],{})['then'](respondWithResult(_0x4c6837,0xc9))[_0x7995('0x44')](handleError(_0x4c6837,null));};exports[_0x7995('0x47')]=function(_0x511567,_0x3d8ae3){if(_0x511567[_0x7995('0x46')]['id']){delete _0x511567['body']['id'];}return db[_0x7995('0x3c')][_0x7995('0x43')]({'where':{'id':_0x511567['params']['id']}})[_0x7995('0x24')](handleEntityNotFound(_0x3d8ae3,null))['then'](saveUpdates(_0x511567[_0x7995('0x46')],null))[_0x7995('0x24')](respondWithResult(_0x3d8ae3,null))[_0x7995('0x44')](handleError(_0x3d8ae3,null));};exports[_0x7995('0x25')]=function(_0xddf537,_0x14b537){return db[_0x7995('0x3c')]['find']({'where':{'id':_0xddf537[_0x7995('0x48')]['id']}})[_0x7995('0x24')](handleEntityNotFound(_0x14b537,null))[_0x7995('0x24')](removeEntity(_0x14b537,null))['catch'](handleError(_0x14b537,null));};exports[_0x7995('0x49')]=function(_0x1fe77e,_0x12d4b8){return db['MailTransferReport']['describe']()['then'](respondWithResult(_0x12d4b8,null))[_0x7995('0x44')](handleError(_0x12d4b8,null));};
\ No newline at end of file
diff --git a/server/api/mailTransferReport/mailTransferReport.model.js b/server/api/mailTransferReport/mailTransferReport.model.js
index 9592121..c89b5c2 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 _0x5220=['lodash','moment','bluebird','request-promise','path','../../config/environment','./mailTransferReport.attributes','define','MailTransferReport','report_mail_transfer','uniqueid'];(function(_0xdcec97,_0x484c37){var _0x45bf42=function(_0x3ade6d){while(--_0x3ade6d){_0xdcec97['push'](_0xdcec97['shift']());}};_0x45bf42(++_0x484c37);}(_0x5220,0xfd));var _0x0522=function(_0x455580,_0x5cd4dd){_0x455580=_0x455580-0x0;var _0x7aabc2=_0x5220[_0x455580];return _0x7aabc2;};'use strict';var _=require(_0x0522('0x0'));var util=require('util');var logger=require('../../config/logger')('api');var moment=require(_0x0522('0x1'));var BPromise=require(_0x0522('0x2'));var rp=require(_0x0522('0x3'));var fs=require('fs');var path=require(_0x0522('0x4'));var rimraf=require('rimraf');var config=require(_0x0522('0x5'));var attributes=require(_0x0522('0x6'));module['exports']=function(_0x17b905,_0x41f987){return _0x17b905[_0x0522('0x7')](_0x0522('0x8'),attributes,{'tableName':_0x0522('0x9'),'paranoid':![],'indexes':[{'name':'uniqueid','fields':[_0x0522('0xa')]}],'timestamps':!![]});};
\ No newline at end of file
+var _0x14b9=['request-promise','rimraf','./mailTransferReport.attributes','exports','define','MailTransferReport','report_mail_transfer','lodash','util','../../config/logger','api','bluebird'];(function(_0x85746c,_0x4eb9ca){var _0x4ce212=function(_0x648a0f){while(--_0x648a0f){_0x85746c['push'](_0x85746c['shift']());}};_0x4ce212(++_0x4eb9ca);}(_0x14b9,0x11b));var _0x914b=function(_0x512ae8,_0x389797){_0x512ae8=_0x512ae8-0x0;var _0x476064=_0x14b9[_0x512ae8];return _0x476064;};'use strict';var _=require(_0x914b('0x0'));var util=require(_0x914b('0x1'));var logger=require(_0x914b('0x2'))(_0x914b('0x3'));var moment=require('moment');var BPromise=require(_0x914b('0x4'));var rp=require(_0x914b('0x5'));var fs=require('fs');var path=require('path');var rimraf=require(_0x914b('0x6'));var config=require('../../config/environment');var attributes=require(_0x914b('0x7'));module[_0x914b('0x8')]=function(_0x434299,_0xb7441b){return _0x434299[_0x914b('0x9')](_0x914b('0xa'),attributes,{'tableName':_0x914b('0xb'),'paranoid':![],'indexes':[{'name':'uniqueid','fields':['uniqueid']}],'timestamps':!![]});};
\ No newline at end of file
diff --git a/server/api/mailTransferReport/mailTransferReport.rpc.js b/server/api/mailTransferReport/mailTransferReport.rpc.js
index 01373ca..6d8034e 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 _0xbe26=['util','moment','bluebird','rpc','../../config/environment','jayson/promise','client','http','MailTransferReport,\x20%s,\x20%s','request\x20sent','debug','MailTransferReport,\x20%s,\x20%s,\x20%s','error','code','message','info','catch','lodash'];(function(_0x19ab90,_0x23773c){var _0x45b682=function(_0x21ae73){while(--_0x21ae73){_0x19ab90['push'](_0x19ab90['shift']());}};_0x45b682(++_0x23773c);}(_0xbe26,0x1c1));var _0x6be2=function(_0x5be3a8,_0x41704e){_0x5be3a8=_0x5be3a8-0x0;var _0x4d76f9=_0xbe26[_0x5be3a8];return _0x4d76f9;};'use strict';var _=require(_0x6be2('0x0'));var util=require(_0x6be2('0x1'));var moment=require(_0x6be2('0x2'));var BPromise=require(_0x6be2('0x3'));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')(_0x6be2('0x4'));var config=require(_0x6be2('0x5'));var jayson=require(_0x6be2('0x6'));var client=jayson[_0x6be2('0x7')][_0x6be2('0x8')]({'port':0x232a});function respondWithRpcPromise(_0x4f1de7,_0x737ec0,_0xd5ab4){return new BPromise(function(_0x11da5e,_0x163120){return client['request'](_0x4f1de7,_0xd5ab4)['then'](function(_0x3e66b1){logger['info'](_0x6be2('0x9'),_0x737ec0,_0x6be2('0xa'));logger[_0x6be2('0xb')](_0x6be2('0xc'),_0x737ec0,_0x6be2('0xa'),JSON['stringify'](_0x3e66b1));if(_0x3e66b1['error']){if(_0x3e66b1[_0x6be2('0xd')][_0x6be2('0xe')]===0x1f4){logger[_0x6be2('0xd')](_0x6be2('0x9'),_0x737ec0,_0x3e66b1[_0x6be2('0xd')][_0x6be2('0xf')]);return _0x163120(_0x3e66b1[_0x6be2('0xd')][_0x6be2('0xf')]);}logger[_0x6be2('0xd')]('MailTransferReport,\x20%s,\x20%s',_0x737ec0,_0x3e66b1[_0x6be2('0xd')][_0x6be2('0xf')]);return _0x11da5e(_0x3e66b1[_0x6be2('0xd')][_0x6be2('0xf')]);}else{logger[_0x6be2('0x10')](_0x6be2('0x9'),_0x737ec0,_0x6be2('0xa'));_0x11da5e(_0x3e66b1['result'][_0x6be2('0xf')]);}})[_0x6be2('0x11')](function(_0xe58701){logger[_0x6be2('0xd')](_0x6be2('0x9'),_0x737ec0,_0xe58701);_0x163120(_0xe58701);});});}
\ No newline at end of file
+var _0xe1a6=['ioredis','../../mysqldb','../../config/logger','jayson/promise','client','http','request','then','info','MailTransferReport,\x20%s,\x20%s','debug','MailTransferReport,\x20%s,\x20%s,\x20%s','request\x20sent','stringify','error','message','result','catch','lodash','util','moment','bluebird','randomstring'];(function(_0x397e5f,_0x454c8f){var _0x5302b8=function(_0x1a29ef){while(--_0x1a29ef){_0x397e5f['push'](_0x397e5f['shift']());}};_0x5302b8(++_0x454c8f);}(_0xe1a6,0xf8));var _0x6e1a=function(_0x134779,_0x21c3a7){_0x134779=_0x134779-0x0;var _0x32b48f=_0xe1a6[_0x134779];return _0x32b48f;};'use strict';var _=require(_0x6e1a('0x0'));var util=require(_0x6e1a('0x1'));var moment=require(_0x6e1a('0x2'));var BPromise=require(_0x6e1a('0x3'));var rs=require(_0x6e1a('0x4'));var fs=require('fs');var Redis=require(_0x6e1a('0x5'));var db=require(_0x6e1a('0x6'))['db'];var utils=require('../../config/utils');var logger=require(_0x6e1a('0x7'))('rpc');var config=require('../../config/environment');var jayson=require(_0x6e1a('0x8'));var client=jayson[_0x6e1a('0x9')][_0x6e1a('0xa')]({'port':0x232a});function respondWithRpcPromise(_0xa62e5,_0x1235a3,_0x115413){return new BPromise(function(_0x322693,_0x57f25c){return client[_0x6e1a('0xb')](_0xa62e5,_0x115413)[_0x6e1a('0xc')](function(_0x5b804d){logger[_0x6e1a('0xd')](_0x6e1a('0xe'),_0x1235a3,'request\x20sent');logger[_0x6e1a('0xf')](_0x6e1a('0x10'),_0x1235a3,_0x6e1a('0x11'),JSON[_0x6e1a('0x12')](_0x5b804d));if(_0x5b804d['error']){if(_0x5b804d[_0x6e1a('0x13')]['code']===0x1f4){logger[_0x6e1a('0x13')](_0x6e1a('0xe'),_0x1235a3,_0x5b804d[_0x6e1a('0x13')][_0x6e1a('0x14')]);return _0x57f25c(_0x5b804d['error'][_0x6e1a('0x14')]);}logger[_0x6e1a('0x13')](_0x6e1a('0xe'),_0x1235a3,_0x5b804d['error'][_0x6e1a('0x14')]);return _0x322693(_0x5b804d[_0x6e1a('0x13')]['message']);}else{logger[_0x6e1a('0xd')]('MailTransferReport,\x20%s,\x20%s',_0x1235a3,_0x6e1a('0x11'));_0x322693(_0x5b804d[_0x6e1a('0x15')][_0x6e1a('0x14')]);}})[_0x6e1a('0x16')](function(_0xd69c9c){logger[_0x6e1a('0x13')](_0x6e1a('0xe'),_0x1235a3,_0xd69c9c);_0x57f25c(_0xd69c9c);});});}
\ No newline at end of file
diff --git a/server/api/memberReport/index.js b/server/api/memberReport/index.js
index 24027c6..2a9293a 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 _0x9f0a=['isAuthenticated','describe','show','post','create','put','/:id','update','delete','destroy','exports','multer','path','Router','../../components/auth/service','get'];(function(_0x1928c9,_0x13a6d1){var _0x51b5fb=function(_0x24cf70){while(--_0x24cf70){_0x1928c9['push'](_0x1928c9['shift']());}};_0x51b5fb(++_0x13a6d1);}(_0x9f0a,0x6b));var _0xa9f0=function(_0x59d8a5,_0x2c6ee5){_0x59d8a5=_0x59d8a5-0x0;var _0x474b44=_0x9f0a[_0x59d8a5];return _0x474b44;};'use strict';var multer=require(_0xa9f0('0x0'));var util=require('util');var path=require(_0xa9f0('0x1'));var timeout=require('connect-timeout');var express=require('express');var router=express[_0xa9f0('0x2')]();var auth=require(_0xa9f0('0x3'));var interaction=require('../../components/interaction/service');var config=require('../../config/environment');var controller=require('./memberReport.controller');router[_0xa9f0('0x4')]('/',auth[_0xa9f0('0x5')](),controller['index']);router[_0xa9f0('0x4')]('/describe',auth[_0xa9f0('0x5')](),controller[_0xa9f0('0x6')]);router[_0xa9f0('0x4')]('/:id',auth[_0xa9f0('0x5')](),controller[_0xa9f0('0x7')]);router[_0xa9f0('0x8')]('/',auth[_0xa9f0('0x5')](),controller[_0xa9f0('0x9')]);router[_0xa9f0('0xa')](_0xa9f0('0xb'),auth[_0xa9f0('0x5')](),controller[_0xa9f0('0xc')]);router[_0xa9f0('0xd')]('/:id',auth[_0xa9f0('0x5')](),controller[_0xa9f0('0xe')]);module[_0xa9f0('0xf')]=router;
\ No newline at end of file
+var _0x9d4b=['multer','path','connect-timeout','express','Router','../../components/auth/service','../../config/environment','./memberReport.controller','get','index','/describe','describe','/:id','isAuthenticated','show','post','create','put','update','delete','destroy','exports'];(function(_0x18c844,_0x4c886a){var _0x7d7b36=function(_0x1eb18e){while(--_0x1eb18e){_0x18c844['push'](_0x18c844['shift']());}};_0x7d7b36(++_0x4c886a);}(_0x9d4b,0xdc));var _0xb9d4=function(_0x5cb282,_0x43d966){_0x5cb282=_0x5cb282-0x0;var _0x39e0f2=_0x9d4b[_0x5cb282];return _0x39e0f2;};'use strict';var multer=require(_0xb9d4('0x0'));var util=require('util');var path=require(_0xb9d4('0x1'));var timeout=require(_0xb9d4('0x2'));var express=require(_0xb9d4('0x3'));var router=express[_0xb9d4('0x4')]();var auth=require(_0xb9d4('0x5'));var interaction=require('../../components/interaction/service');var config=require(_0xb9d4('0x6'));var controller=require(_0xb9d4('0x7'));router[_0xb9d4('0x8')]('/',auth['isAuthenticated'](),controller[_0xb9d4('0x9')]);router[_0xb9d4('0x8')](_0xb9d4('0xa'),auth['isAuthenticated'](),controller[_0xb9d4('0xb')]);router[_0xb9d4('0x8')](_0xb9d4('0xc'),auth[_0xb9d4('0xd')](),controller[_0xb9d4('0xe')]);router[_0xb9d4('0xf')]('/',auth[_0xb9d4('0xd')](),controller[_0xb9d4('0x10')]);router[_0xb9d4('0x11')]('/:id',auth[_0xb9d4('0xd')](),controller[_0xb9d4('0x12')]);router[_0xb9d4('0x13')](_0xb9d4('0xc'),auth[_0xb9d4('0xd')](),controller[_0xb9d4('0x14')]);module[_0xb9d4('0x15')]=router;
\ No newline at end of file
diff --git a/server/api/memberReport/memberReport.attributes.js b/server/api/memberReport/memberReport.attributes.js
index f85ae1a..da1333f 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 _0xd412=['DEFAULT\x20PAUSE','LOGIN,\x20PAUSE,\x20TALKING','getDataValue','enterAt','exitAt','setDataValue','talk:[inbound,\x20outbound],\x20pause:[reason]','talk:[start]','talk:[destination]','talk:[dial\x20string]','INTEGER','sequelize','moment','STRING'];(function(_0x35885a,_0x42fed7){var _0xe86249=function(_0x98edb3){while(--_0x98edb3){_0x35885a['push'](_0x35885a['shift']());}};_0xe86249(++_0x42fed7);}(_0xd412,0x1e7));var _0x2d41=function(_0x112e6a,_0x4dfc41){_0x112e6a=_0x112e6a-0x0;var _0x1b691b=_0xd412[_0x112e6a];return _0x1b691b;};'use strict';var Sequelize=require(_0x2d41('0x0'));var moment=require(_0x2d41('0x1'));module['exports']={'channel':{'type':Sequelize['STRING']},'membername':{'type':Sequelize['STRING']},'interface':{'type':Sequelize['STRING']},'type':{'type':Sequelize[_0x2d41('0x2')],'defaultValue':_0x2d41('0x3'),'comment':_0x2d41('0x4')},'duration':{'type':Sequelize['INTEGER']},'enterAt':{'type':Sequelize['DATE']},'exitAt':{'type':Sequelize['DATE'],'set':function(_0x21eed3){var _0x2167db=moment(_0x21eed3);var _0x41c93d=moment(this[_0x2d41('0x5')](_0x2d41('0x6')));var _0x2094fe=_0x2167db['diff'](_0x41c93d,'seconds');this['setDataValue'](_0x2d41('0x7'),_0x21eed3);this[_0x2d41('0x8')]('duration',_0x2094fe||null);}},'data1':{'type':Sequelize[_0x2d41('0x2')],'comment':_0x2d41('0x9')},'data2':{'type':Sequelize[_0x2d41('0x2')],'comment':_0x2d41('0xa')},'data3':{'type':Sequelize[_0x2d41('0x2')],'comment':_0x2d41('0xb')},'data4':{'type':Sequelize['STRING'],'comment':_0x2d41('0xc')},'data5':{'type':Sequelize[_0x2d41('0x2')],'comment':'talk:[queue]'},'role':{'type':Sequelize[_0x2d41('0x2')]},'internal':{'type':Sequelize[_0x2d41('0xd')]},'uniqueid':{'type':Sequelize[_0x2d41('0x2')]}};
\ No newline at end of file
+var _0x89b4=['setDataValue','exitAt','duration','talk:[inbound,\x20outbound],\x20pause:[reason]','talk:[start]','talk:[destination]','talk:[dial\x20string]','talk:[queue]','moment','STRING','DEFAULT\x20PAUSE','LOGIN,\x20PAUSE,\x20TALKING','DATE','getDataValue','diff','seconds'];(function(_0x23cff7,_0x1a67a9){var _0x47039f=function(_0x3c8f13){while(--_0x3c8f13){_0x23cff7['push'](_0x23cff7['shift']());}};_0x47039f(++_0x1a67a9);}(_0x89b4,0x148));var _0x489b=function(_0x170d18,_0x1c3cbf){_0x170d18=_0x170d18-0x0;var _0x427188=_0x89b4[_0x170d18];return _0x427188;};'use strict';var Sequelize=require('sequelize');var moment=require(_0x489b('0x0'));module['exports']={'channel':{'type':Sequelize[_0x489b('0x1')]},'membername':{'type':Sequelize[_0x489b('0x1')]},'interface':{'type':Sequelize[_0x489b('0x1')]},'type':{'type':Sequelize[_0x489b('0x1')],'defaultValue':_0x489b('0x2'),'comment':_0x489b('0x3')},'duration':{'type':Sequelize['INTEGER']},'enterAt':{'type':Sequelize['DATE']},'exitAt':{'type':Sequelize[_0x489b('0x4')],'set':function(_0xe5d053){var _0x21d81c=moment(_0xe5d053);var _0x312265=moment(this[_0x489b('0x5')]('enterAt'));var _0x34722a=_0x21d81c[_0x489b('0x6')](_0x312265,_0x489b('0x7'));this[_0x489b('0x8')](_0x489b('0x9'),_0xe5d053);this[_0x489b('0x8')](_0x489b('0xa'),_0x34722a||null);}},'data1':{'type':Sequelize[_0x489b('0x1')],'comment':_0x489b('0xb')},'data2':{'type':Sequelize[_0x489b('0x1')],'comment':_0x489b('0xc')},'data3':{'type':Sequelize[_0x489b('0x1')],'comment':_0x489b('0xd')},'data4':{'type':Sequelize['STRING'],'comment':_0x489b('0xe')},'data5':{'type':Sequelize[_0x489b('0x1')],'comment':_0x489b('0xf')},'role':{'type':Sequelize[_0x489b('0x1')]},'internal':{'type':Sequelize['INTEGER']},'uniqueid':{'type':Sequelize[_0x489b('0x1')]}};
\ No newline at end of file
diff --git a/server/api/memberReport/memberReport.controller.js b/server/api/memberReport/memberReport.controller.js
index d424208..ad5ca43 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 _0xab2c=['find','create','body','update','describe','html-pdf','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','moment','bluebird','mustache','util','to-csv','ejs','lodash','squel','crypto','desk.js','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/environment','../../mysqldb','sendStatus','status','end','json','count','offset','limit','set','apply','reject','save','destroy','stack','name','send','index','map','MemberReport','rawAttributes','fieldName','type','key','model','query','keys','filters','intersection','attributes','fields','hasOwnProperty','nolimit','sort','where','pick','filter','merge','then','include','findAll','rows','catch','show','params','options'];(function(_0x58d939,_0x5cfdae){var _0x1e5115=function(_0x394420){while(--_0x394420){_0x58d939['push'](_0x58d939['shift']());}};_0x1e5115(++_0x5cfdae);}(_0xab2c,0x181));var _0xcab2=function(_0xbba421,_0x81d172){_0xbba421=_0xbba421-0x0;var _0x420880=_0xab2c[_0xbba421];return _0x420880;};'use strict';var pdf=require(_0xcab2('0x0'));var emlformat=require(_0xcab2('0x1'));var rimraf=require(_0xcab2('0x2'));var zipdir=require(_0xcab2('0x3'));var jsonpatch=require(_0xcab2('0x4'));var rp=require(_0xcab2('0x5'));var moment=require(_0xcab2('0x6'));var BPromise=require(_0xcab2('0x7'));var Mustache=require(_0xcab2('0x8'));var util=require(_0xcab2('0x9'));var path=require('path');var sox=require('sox');var csv=require(_0xcab2('0xa'));var ejs=require(_0xcab2('0xb'));var fs=require('fs');var _=require(_0xcab2('0xc'));var squel=require(_0xcab2('0xd'));var crypto=require(_0xcab2('0xe'));var jsforce=require('jsforce');var deskjs=require(_0xcab2('0xf'));var toCsv=require('to-csv');var querystring=require(_0xcab2('0x10'));var Papa=require(_0xcab2('0x11'));var Redis=require(_0xcab2('0x12'));var authService=require(_0xcab2('0x13'));var qs=require(_0xcab2('0x14'));var as=require('../../components/parsers/advancedSearch');var hardwareService=require(_0xcab2('0x15'));var logger=require(_0xcab2('0x16'))(_0xcab2('0x17'));var utils=require(_0xcab2('0x18'));var config=require(_0xcab2('0x19'));var db=require(_0xcab2('0x1a'))['db'];function respondWithStatusCode(_0x43b8f6,_0x1c1b05){_0x1c1b05=_0x1c1b05||0xcc;return function(_0x481594){if(_0x481594){return _0x43b8f6[_0xcab2('0x1b')](_0x1c1b05);}return _0x43b8f6[_0xcab2('0x1c')](_0x1c1b05)[_0xcab2('0x1d')]();};}function respondWithResult(_0x564adb,_0x4d75bc){_0x4d75bc=_0x4d75bc||0xc8;return function(_0x4f7c73){if(_0x4f7c73){return _0x564adb[_0xcab2('0x1c')](_0x4d75bc)[_0xcab2('0x1e')](_0x4f7c73);}};}function respondWithFilteredResult(_0x762fb2,_0x5f4eb0){return function(_0x519a4c){if(_0x519a4c){var _0x34e317=_0x519a4c[_0xcab2('0x1f')],_0x554bad=_0x5f4eb0[_0xcab2('0x20')],_0xe65e12=_0x5f4eb0[_0xcab2('0x20')]+_0x5f4eb0[_0xcab2('0x21')],_0x394189;if(_0xe65e12>=_0x34e317){_0xe65e12=_0x34e317;_0x394189=0xc8;}else{_0x394189=0xce;}_0x762fb2[_0xcab2('0x1c')](_0x394189);return _0x762fb2[_0xcab2('0x22')]('Content-Range',_0x554bad+'-'+_0xe65e12+'/'+_0x34e317)[_0xcab2('0x1e')](_0x519a4c);}return null;};}function patchUpdates(_0x42f361){return function(_0x36df99){try{jsonpatch[_0xcab2('0x23')](_0x36df99,_0x42f361,!![]);}catch(_0x30e3eb){return BPromise[_0xcab2('0x24')](_0x30e3eb);}return _0x36df99[_0xcab2('0x25')]();};}function saveUpdates(_0x32ae18,_0x5cf363){return function(_0x14d18e){if(_0x14d18e){return _0x14d18e['update'](_0x32ae18)['then'](function(_0x2232c8){return _0x2232c8;});}return null;};}function removeEntity(_0x3d70db,_0x5a1786){return function(_0x33875a){if(_0x33875a){return _0x33875a[_0xcab2('0x26')]()['then'](function(){_0x3d70db[_0xcab2('0x1c')](0xcc)[_0xcab2('0x1d')]();});}};}function handleEntityNotFound(_0x7dda48,_0x2552f4){return function(_0x1b9b0c){if(!_0x1b9b0c){_0x7dda48[_0xcab2('0x1b')](0x194);}return _0x1b9b0c;};}function handleError(_0x1962da,_0x373323){_0x373323=_0x373323||0x1f4;return function(_0x15f389){logger['error'](_0x15f389[_0xcab2('0x27')]);if(_0x15f389['name']){delete _0x15f389[_0xcab2('0x28')];}_0x1962da['status'](_0x373323)[_0xcab2('0x29')](_0x15f389);};}exports[_0xcab2('0x2a')]=function(_0x3c83d3,_0x38defa){var _0x531cee={},_0x10d8f1={},_0x1b548d={'count':0x0,'rows':[]};var _0x5a1d52=_[_0xcab2('0x2b')](db[_0xcab2('0x2c')][_0xcab2('0x2d')],function(_0x1a1602){return{'name':_0x1a1602[_0xcab2('0x2e')],'type':_0x1a1602[_0xcab2('0x2f')][_0xcab2('0x30')]};});_0x10d8f1[_0xcab2('0x31')]=_['map'](_0x5a1d52,_0xcab2('0x28'));_0x10d8f1[_0xcab2('0x32')]=_[_0xcab2('0x33')](_0x3c83d3[_0xcab2('0x32')]);_0x10d8f1[_0xcab2('0x34')]=_[_0xcab2('0x35')](_0x10d8f1[_0xcab2('0x31')],_0x10d8f1['query']);_0x531cee[_0xcab2('0x36')]=_[_0xcab2('0x35')](_0x10d8f1[_0xcab2('0x31')],qs[_0xcab2('0x37')](_0x3c83d3['query']['fields']));_0x531cee[_0xcab2('0x36')]=_0x531cee[_0xcab2('0x36')]['length']?_0x531cee[_0xcab2('0x36')]:_0x10d8f1[_0xcab2('0x31')];if(!_0x3c83d3[_0xcab2('0x32')][_0xcab2('0x38')](_0xcab2('0x39'))){_0x531cee[_0xcab2('0x21')]=qs[_0xcab2('0x21')](_0x3c83d3[_0xcab2('0x32')][_0xcab2('0x21')]);_0x531cee[_0xcab2('0x20')]=qs['offset'](_0x3c83d3[_0xcab2('0x32')][_0xcab2('0x20')]);}_0x531cee['order']=qs[_0xcab2('0x3a')](_0x3c83d3['query'][_0xcab2('0x3a')]);_0x531cee[_0xcab2('0x3b')]=qs[_0xcab2('0x34')](_[_0xcab2('0x3c')](_0x3c83d3[_0xcab2('0x32')],_0x10d8f1[_0xcab2('0x34')]));if(_0x3c83d3[_0xcab2('0x32')][_0xcab2('0x3d')]){_0x531cee[_0xcab2('0x3b')]=_[_0xcab2('0x3e')](_0x531cee[_0xcab2('0x3b')],{'$or':_[_0xcab2('0x2b')](_0x5a1d52,function(_0x375f72){if(_0x375f72[_0xcab2('0x2f')]!=='VIRTUAL'){var _0x122614={};_0x122614[_0x375f72['name']]={'$like':'%'+_0x3c83d3['query'][_0xcab2('0x3d')]+'%'};return _0x122614;}})});}_0x531cee=_[_0xcab2('0x3e')]({},_0x531cee,_0x3c83d3['options']);var _0x277f2a={'where':_0x531cee[_0xcab2('0x3b')]};return db[_0xcab2('0x2c')][_0xcab2('0x1f')](_0x277f2a)[_0xcab2('0x3f')](function(_0x581d0d){_0x1b548d[_0xcab2('0x1f')]=_0x581d0d;if(_0x3c83d3[_0xcab2('0x32')]['includeAll']){_0x531cee[_0xcab2('0x40')]=[{'all':!![]}];}return db[_0xcab2('0x2c')][_0xcab2('0x41')](_0x531cee);})[_0xcab2('0x3f')](function(_0x1412d1){_0x1b548d[_0xcab2('0x42')]=_0x1412d1;return _0x1b548d;})['then'](respondWithFilteredResult(_0x38defa,_0x531cee))[_0xcab2('0x43')](handleError(_0x38defa,null));};exports[_0xcab2('0x44')]=function(_0x346568,_0x2bd70b){var _0x5c825e={'raw':!![],'where':{'id':_0x346568[_0xcab2('0x45')]['id']}},_0x546806={};_0x546806['model']=_['keys'](db[_0xcab2('0x2c')]['rawAttributes']);_0x546806[_0xcab2('0x32')]=_['keys'](_0x346568[_0xcab2('0x32')]);_0x546806[_0xcab2('0x34')]=_[_0xcab2('0x35')](_0x546806[_0xcab2('0x31')],_0x546806[_0xcab2('0x32')]);_0x5c825e[_0xcab2('0x36')]=_['intersection'](_0x546806[_0xcab2('0x31')],qs['fields'](_0x346568[_0xcab2('0x32')][_0xcab2('0x37')]));_0x5c825e['attributes']=_0x5c825e[_0xcab2('0x36')]['length']?_0x5c825e[_0xcab2('0x36')]:_0x546806[_0xcab2('0x31')];if(_0x346568[_0xcab2('0x32')]['includeAll']){_0x5c825e[_0xcab2('0x40')]=[{'all':!![]}];}_0x5c825e=_['merge']({},_0x5c825e,_0x346568[_0xcab2('0x46')]);return db['MemberReport'][_0xcab2('0x47')](_0x5c825e)[_0xcab2('0x3f')](handleEntityNotFound(_0x2bd70b,null))[_0xcab2('0x3f')](respondWithResult(_0x2bd70b,null))[_0xcab2('0x43')](handleError(_0x2bd70b,null));};exports[_0xcab2('0x48')]=function(_0x501eb9,_0x189ae8){return db[_0xcab2('0x2c')][_0xcab2('0x48')](_0x501eb9[_0xcab2('0x49')],{})[_0xcab2('0x3f')](respondWithResult(_0x189ae8,0xc9))[_0xcab2('0x43')](handleError(_0x189ae8,null));};exports[_0xcab2('0x4a')]=function(_0x4427c9,_0x96bfe1){if(_0x4427c9[_0xcab2('0x49')]['id']){delete _0x4427c9[_0xcab2('0x49')]['id'];}return db['MemberReport'][_0xcab2('0x47')]({'where':{'id':_0x4427c9[_0xcab2('0x45')]['id']}})[_0xcab2('0x3f')](handleEntityNotFound(_0x96bfe1,null))['then'](saveUpdates(_0x4427c9[_0xcab2('0x49')],null))['then'](respondWithResult(_0x96bfe1,null))[_0xcab2('0x43')](handleError(_0x96bfe1,null));};exports[_0xcab2('0x26')]=function(_0x41f782,_0xfd23a7){return db[_0xcab2('0x2c')][_0xcab2('0x47')]({'where':{'id':_0x41f782[_0xcab2('0x45')]['id']}})[_0xcab2('0x3f')](handleEntityNotFound(_0xfd23a7,null))[_0xcab2('0x3f')](removeEntity(_0xfd23a7,null))['catch'](handleError(_0xfd23a7,null));};exports[_0xcab2('0x4b')]=function(_0x118b06,_0x4360a8){return db[_0xcab2('0x2c')]['describe']()['then'](respondWithResult(_0x4360a8,null))['catch'](handleError(_0x4360a8,null));};
\ No newline at end of file
+var _0x04a3=['to-csv','lodash','squel','crypto','jsforce','desk.js','querystring','papaparse','ioredis','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/environment','../../mysqldb','status','end','offset','set','Content-Range','json','apply','reject','update','then','destroy','error','stack','name','send','index','map','MemberReport','rawAttributes','fieldName','type','key','model','query','keys','filters','intersection','attributes','fields','length','hasOwnProperty','nolimit','limit','order','sort','pick','filter','where','merge','VIRTUAL','options','count','includeAll','include','findAll','catch','show','params','create','body','find','describe','html-pdf','eml-format','rimraf','zip-dir','fast-json-patch','moment','bluebird','mustache'];(function(_0x34835b,_0x33bf31){var _0x4fa609=function(_0x452c70){while(--_0x452c70){_0x34835b['push'](_0x34835b['shift']());}};_0x4fa609(++_0x33bf31);}(_0x04a3,0x179));var _0x304a=function(_0x612a71,_0xb27d3f){_0x612a71=_0x612a71-0x0;var _0xb07bc1=_0x04a3[_0x612a71];return _0xb07bc1;};'use strict';var pdf=require(_0x304a('0x0'));var emlformat=require(_0x304a('0x1'));var rimraf=require(_0x304a('0x2'));var zipdir=require(_0x304a('0x3'));var jsonpatch=require(_0x304a('0x4'));var rp=require('request-promise');var moment=require(_0x304a('0x5'));var BPromise=require(_0x304a('0x6'));var Mustache=require(_0x304a('0x7'));var util=require('util');var path=require('path');var sox=require('sox');var csv=require(_0x304a('0x8'));var ejs=require('ejs');var fs=require('fs');var _=require(_0x304a('0x9'));var squel=require(_0x304a('0xa'));var crypto=require(_0x304a('0xb'));var jsforce=require(_0x304a('0xc'));var deskjs=require(_0x304a('0xd'));var toCsv=require('to-csv');var querystring=require(_0x304a('0xe'));var Papa=require(_0x304a('0xf'));var Redis=require(_0x304a('0x10'));var authService=require('../../components/auth/service');var qs=require(_0x304a('0x11'));var as=require(_0x304a('0x12'));var hardwareService=require(_0x304a('0x13'));var logger=require(_0x304a('0x14'))(_0x304a('0x15'));var utils=require(_0x304a('0x16'));var config=require(_0x304a('0x17'));var db=require(_0x304a('0x18'))['db'];function respondWithStatusCode(_0x515437,_0x19bb7b){_0x19bb7b=_0x19bb7b||0xcc;return function(_0x289017){if(_0x289017){return _0x515437['sendStatus'](_0x19bb7b);}return _0x515437[_0x304a('0x19')](_0x19bb7b)[_0x304a('0x1a')]();};}function respondWithResult(_0x1161e8,_0x4de985){_0x4de985=_0x4de985||0xc8;return function(_0x8833f3){if(_0x8833f3){return _0x1161e8['status'](_0x4de985)['json'](_0x8833f3);}};}function respondWithFilteredResult(_0x9861d4,_0x49d161){return function(_0xabbdee){if(_0xabbdee){var _0x2d231f=_0xabbdee['count'],_0x991d16=_0x49d161[_0x304a('0x1b')],_0x5b928a=_0x49d161[_0x304a('0x1b')]+_0x49d161['limit'],_0x22026e;if(_0x5b928a>=_0x2d231f){_0x5b928a=_0x2d231f;_0x22026e=0xc8;}else{_0x22026e=0xce;}_0x9861d4[_0x304a('0x19')](_0x22026e);return _0x9861d4[_0x304a('0x1c')](_0x304a('0x1d'),_0x991d16+'-'+_0x5b928a+'/'+_0x2d231f)[_0x304a('0x1e')](_0xabbdee);}return null;};}function patchUpdates(_0x56afb4){return function(_0x57aecd){try{jsonpatch[_0x304a('0x1f')](_0x57aecd,_0x56afb4,!![]);}catch(_0x4299ab){return BPromise[_0x304a('0x20')](_0x4299ab);}return _0x57aecd['save']();};}function saveUpdates(_0x3a9171,_0x49cd8e){return function(_0x42e5ac){if(_0x42e5ac){return _0x42e5ac[_0x304a('0x21')](_0x3a9171)[_0x304a('0x22')](function(_0x5bc529){return _0x5bc529;});}return null;};}function removeEntity(_0x22918c,_0x189608){return function(_0x12df42){if(_0x12df42){return _0x12df42[_0x304a('0x23')]()[_0x304a('0x22')](function(){_0x22918c[_0x304a('0x19')](0xcc)[_0x304a('0x1a')]();});}};}function handleEntityNotFound(_0x4640fc,_0x525e55){return function(_0x1ff8bb){if(!_0x1ff8bb){_0x4640fc['sendStatus'](0x194);}return _0x1ff8bb;};}function handleError(_0x1450df,_0x37ac37){_0x37ac37=_0x37ac37||0x1f4;return function(_0xfeda7){logger[_0x304a('0x24')](_0xfeda7[_0x304a('0x25')]);if(_0xfeda7[_0x304a('0x26')]){delete _0xfeda7['name'];}_0x1450df[_0x304a('0x19')](_0x37ac37)[_0x304a('0x27')](_0xfeda7);};}exports[_0x304a('0x28')]=function(_0x5e47db,_0x1630f0){var _0x9886c3={},_0x45c872={},_0x2b5014={'count':0x0,'rows':[]};var _0xbed083=_[_0x304a('0x29')](db[_0x304a('0x2a')][_0x304a('0x2b')],function(_0x5ce53b){return{'name':_0x5ce53b[_0x304a('0x2c')],'type':_0x5ce53b[_0x304a('0x2d')][_0x304a('0x2e')]};});_0x45c872[_0x304a('0x2f')]=_[_0x304a('0x29')](_0xbed083,_0x304a('0x26'));_0x45c872[_0x304a('0x30')]=_[_0x304a('0x31')](_0x5e47db[_0x304a('0x30')]);_0x45c872[_0x304a('0x32')]=_[_0x304a('0x33')](_0x45c872['model'],_0x45c872[_0x304a('0x30')]);_0x9886c3[_0x304a('0x34')]=_[_0x304a('0x33')](_0x45c872[_0x304a('0x2f')],qs[_0x304a('0x35')](_0x5e47db['query']['fields']));_0x9886c3[_0x304a('0x34')]=_0x9886c3[_0x304a('0x34')][_0x304a('0x36')]?_0x9886c3[_0x304a('0x34')]:_0x45c872[_0x304a('0x2f')];if(!_0x5e47db[_0x304a('0x30')][_0x304a('0x37')](_0x304a('0x38'))){_0x9886c3['limit']=qs['limit'](_0x5e47db[_0x304a('0x30')][_0x304a('0x39')]);_0x9886c3[_0x304a('0x1b')]=qs['offset'](_0x5e47db['query']['offset']);}_0x9886c3[_0x304a('0x3a')]=qs[_0x304a('0x3b')](_0x5e47db[_0x304a('0x30')][_0x304a('0x3b')]);_0x9886c3['where']=qs[_0x304a('0x32')](_[_0x304a('0x3c')](_0x5e47db[_0x304a('0x30')],_0x45c872[_0x304a('0x32')]));if(_0x5e47db[_0x304a('0x30')][_0x304a('0x3d')]){_0x9886c3[_0x304a('0x3e')]=_[_0x304a('0x3f')](_0x9886c3['where'],{'$or':_[_0x304a('0x29')](_0xbed083,function(_0x29a9e0){if(_0x29a9e0['type']!==_0x304a('0x40')){var _0x5cd9ec={};_0x5cd9ec[_0x29a9e0[_0x304a('0x26')]]={'$like':'%'+_0x5e47db[_0x304a('0x30')][_0x304a('0x3d')]+'%'};return _0x5cd9ec;}})});}_0x9886c3=_[_0x304a('0x3f')]({},_0x9886c3,_0x5e47db[_0x304a('0x41')]);var _0x1a86dc={'where':_0x9886c3[_0x304a('0x3e')]};return db[_0x304a('0x2a')]['count'](_0x1a86dc)[_0x304a('0x22')](function(_0x3a3abb){_0x2b5014[_0x304a('0x42')]=_0x3a3abb;if(_0x5e47db[_0x304a('0x30')][_0x304a('0x43')]){_0x9886c3[_0x304a('0x44')]=[{'all':!![]}];}return db[_0x304a('0x2a')][_0x304a('0x45')](_0x9886c3);})[_0x304a('0x22')](function(_0x2c82a7){_0x2b5014['rows']=_0x2c82a7;return _0x2b5014;})[_0x304a('0x22')](respondWithFilteredResult(_0x1630f0,_0x9886c3))[_0x304a('0x46')](handleError(_0x1630f0,null));};exports[_0x304a('0x47')]=function(_0x30ec04,_0x38357e){var _0x38699f={'raw':!![],'where':{'id':_0x30ec04[_0x304a('0x48')]['id']}},_0x5e55c5={};_0x5e55c5['model']=_[_0x304a('0x31')](db[_0x304a('0x2a')][_0x304a('0x2b')]);_0x5e55c5['query']=_[_0x304a('0x31')](_0x30ec04[_0x304a('0x30')]);_0x5e55c5[_0x304a('0x32')]=_[_0x304a('0x33')](_0x5e55c5[_0x304a('0x2f')],_0x5e55c5[_0x304a('0x30')]);_0x38699f[_0x304a('0x34')]=_[_0x304a('0x33')](_0x5e55c5[_0x304a('0x2f')],qs[_0x304a('0x35')](_0x30ec04['query'][_0x304a('0x35')]));_0x38699f[_0x304a('0x34')]=_0x38699f[_0x304a('0x34')]['length']?_0x38699f[_0x304a('0x34')]:_0x5e55c5['model'];if(_0x30ec04[_0x304a('0x30')]['includeAll']){_0x38699f[_0x304a('0x44')]=[{'all':!![]}];}_0x38699f=_[_0x304a('0x3f')]({},_0x38699f,_0x30ec04[_0x304a('0x41')]);return db[_0x304a('0x2a')]['find'](_0x38699f)[_0x304a('0x22')](handleEntityNotFound(_0x38357e,null))[_0x304a('0x22')](respondWithResult(_0x38357e,null))[_0x304a('0x46')](handleError(_0x38357e,null));};exports[_0x304a('0x49')]=function(_0x4bbf01,_0x269977){return db[_0x304a('0x2a')][_0x304a('0x49')](_0x4bbf01[_0x304a('0x4a')],{})[_0x304a('0x22')](respondWithResult(_0x269977,0xc9))['catch'](handleError(_0x269977,null));};exports[_0x304a('0x21')]=function(_0x9b1640,_0x2cd02a){if(_0x9b1640[_0x304a('0x4a')]['id']){delete _0x9b1640[_0x304a('0x4a')]['id'];}return db['MemberReport'][_0x304a('0x4b')]({'where':{'id':_0x9b1640[_0x304a('0x48')]['id']}})[_0x304a('0x22')](handleEntityNotFound(_0x2cd02a,null))['then'](saveUpdates(_0x9b1640[_0x304a('0x4a')],null))[_0x304a('0x22')](respondWithResult(_0x2cd02a,null))[_0x304a('0x46')](handleError(_0x2cd02a,null));};exports[_0x304a('0x23')]=function(_0x2f06e4,_0x4d6963){return db[_0x304a('0x2a')][_0x304a('0x4b')]({'where':{'id':_0x2f06e4['params']['id']}})['then'](handleEntityNotFound(_0x4d6963,null))[_0x304a('0x22')](removeEntity(_0x4d6963,null))[_0x304a('0x46')](handleError(_0x4d6963,null));};exports[_0x304a('0x4c')]=function(_0x4b1559,_0x5bce08){return db[_0x304a('0x2a')]['describe']()[_0x304a('0x22')](respondWithResult(_0x5bce08,null))[_0x304a('0x46')](handleError(_0x5bce08,null));};
\ No newline at end of file
diff --git a/server/api/memberReport/memberReport.model.js b/server/api/memberReport/memberReport.model.js
index f2039ef..4d2a85b 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 _0x47a0=['rimraf','exports','define','report_member','membername_interface','membername','interface','lodash','util','../../config/logger','api','moment','request-promise','path'];(function(_0x1ad048,_0x2335f4){var _0x2ae66f=function(_0xaf0112){while(--_0xaf0112){_0x1ad048['push'](_0x1ad048['shift']());}};_0x2ae66f(++_0x2335f4);}(_0x47a0,0xcb));var _0x047a=function(_0x2220b0,_0x4a9ba9){_0x2220b0=_0x2220b0-0x0;var _0x24cef1=_0x47a0[_0x2220b0];return _0x24cef1;};'use strict';var _=require(_0x047a('0x0'));var util=require(_0x047a('0x1'));var logger=require(_0x047a('0x2'))(_0x047a('0x3'));var moment=require(_0x047a('0x4'));var BPromise=require('bluebird');var rp=require(_0x047a('0x5'));var fs=require('fs');var path=require(_0x047a('0x6'));var rimraf=require(_0x047a('0x7'));var config=require('../../config/environment');var attributes=require('./memberReport.attributes');module[_0x047a('0x8')]=function(_0x524829,_0x51bd33){return _0x524829[_0x047a('0x9')]('MemberReport',attributes,{'tableName':_0x047a('0xa'),'paranoid':![],'indexes':[{'name':_0x047a('0xb'),'fields':[_0x047a('0xc'),_0x047a('0xd')]}],'timestamps':!![]});};
\ No newline at end of file
+var _0xdcfc=['moment','bluebird','request-promise','path','rimraf','../../config/environment','define','report_member','membername_interface','membername','interface','lodash','util','../../config/logger','api'];(function(_0x59334d,_0x1e88a7){var _0x59fa2f=function(_0x280a6d){while(--_0x280a6d){_0x59334d['push'](_0x59334d['shift']());}};_0x59fa2f(++_0x1e88a7);}(_0xdcfc,0x1eb));var _0xcdcf=function(_0x50492a,_0x258275){_0x50492a=_0x50492a-0x0;var _0x10d731=_0xdcfc[_0x50492a];return _0x10d731;};'use strict';var _=require(_0xcdcf('0x0'));var util=require(_0xcdcf('0x1'));var logger=require(_0xcdcf('0x2'))(_0xcdcf('0x3'));var moment=require(_0xcdcf('0x4'));var BPromise=require(_0xcdcf('0x5'));var rp=require(_0xcdcf('0x6'));var fs=require('fs');var path=require(_0xcdcf('0x7'));var rimraf=require(_0xcdcf('0x8'));var config=require(_0xcdcf('0x9'));var attributes=require('./memberReport.attributes');module['exports']=function(_0x4e6001,_0x4f38d7){return _0x4e6001[_0xcdcf('0xa')]('MemberReport',attributes,{'tableName':_0xcdcf('0xb'),'paranoid':![],'indexes':[{'name':_0xcdcf('0xc'),'fields':[_0xcdcf('0xd'),_0xcdcf('0xe')]}],'timestamps':!![]});};
\ No newline at end of file
diff --git a/server/api/memberReport/memberReport.rpc.js b/server/api/memberReport/memberReport.rpc.js
index e1bf147..523e7a8 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 _0x7fd0=['where','include','map','model','attributes','debug','CreateMemberReport','MemberReport','create','then','update','body','UpdateMemberReport','util','bluebird','randomstring','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','client','http','request','info','request\x20sent','stringify','error','MemberReport,\x20%s,\x20%s','message','result','catch','GetMemberReport','findAll','raw','options'];(function(_0x1bd313,_0x18b3ef){var _0x4c19b3=function(_0x4fcfa9){while(--_0x4fcfa9){_0x1bd313['push'](_0x1bd313['shift']());}};_0x4c19b3(++_0x18b3ef);}(_0x7fd0,0x15a));var _0x07fd=function(_0x37c9d1,_0x14a440){_0x37c9d1=_0x37c9d1-0x0;var _0x2a49e8=_0x7fd0[_0x37c9d1];return _0x2a49e8;};'use strict';var _=require('lodash');var util=require(_0x07fd('0x0'));var moment=require('moment');var BPromise=require(_0x07fd('0x1'));var rs=require(_0x07fd('0x2'));var fs=require('fs');var Redis=require('ioredis');var db=require(_0x07fd('0x3'))['db'];var utils=require(_0x07fd('0x4'));var logger=require(_0x07fd('0x5'))(_0x07fd('0x6'));var config=require(_0x07fd('0x7'));var jayson=require(_0x07fd('0x8'));var client=jayson[_0x07fd('0x9')][_0x07fd('0xa')]({'port':0x232a});function respondWithRpcPromise(_0x5e31e7,_0x4c4073,_0x35f9f4){return new BPromise(function(_0x22f18e,_0xb2b19b){return client[_0x07fd('0xb')](_0x5e31e7,_0x35f9f4)['then'](function(_0x46c502){logger[_0x07fd('0xc')]('MemberReport,\x20%s,\x20%s',_0x4c4073,_0x07fd('0xd'));logger['debug']('MemberReport,\x20%s,\x20%s,\x20%s',_0x4c4073,'request\x20sent',JSON[_0x07fd('0xe')](_0x46c502));if(_0x46c502[_0x07fd('0xf')]){if(_0x46c502['error']['code']===0x1f4){logger[_0x07fd('0xf')](_0x07fd('0x10'),_0x4c4073,_0x46c502[_0x07fd('0xf')][_0x07fd('0x11')]);return _0xb2b19b(_0x46c502[_0x07fd('0xf')][_0x07fd('0x11')]);}logger['error']('MemberReport,\x20%s,\x20%s',_0x4c4073,_0x46c502[_0x07fd('0xf')]['message']);return _0x22f18e(_0x46c502[_0x07fd('0xf')][_0x07fd('0x11')]);}else{logger[_0x07fd('0xc')](_0x07fd('0x10'),_0x4c4073,'request\x20sent');_0x22f18e(_0x46c502[_0x07fd('0x12')][_0x07fd('0x11')]);}})[_0x07fd('0x13')](function(_0x1a3fcc){logger[_0x07fd('0xf')](_0x07fd('0x10'),_0x4c4073,_0x1a3fcc);_0xb2b19b(_0x1a3fcc);});});}exports[_0x07fd('0x14')]=function(_0x533d2f){var _0x43bdf3=this;return new Promise(function(_0x1ceb63,_0xd9e91c){return db['MemberReport'][_0x07fd('0x15')]({'raw':_0x533d2f['options']?_0x533d2f['options'][_0x07fd('0x16')]===undefined?!![]:![]:!![],'where':_0x533d2f[_0x07fd('0x17')]?_0x533d2f['options'][_0x07fd('0x18')]||null:null,'attributes':_0x533d2f[_0x07fd('0x17')]?_0x533d2f[_0x07fd('0x17')]['attributes']||null:null,'limit':_0x533d2f[_0x07fd('0x17')]?_0x533d2f[_0x07fd('0x17')]['limit']||null:null,'include':_0x533d2f[_0x07fd('0x17')]?_0x533d2f['options'][_0x07fd('0x19')]?_[_0x07fd('0x1a')](_0x533d2f['options'][_0x07fd('0x19')],function(_0xbe140b){return{'model':db[_0xbe140b[_0x07fd('0x1b')]],'as':_0xbe140b['as'],'attributes':_0xbe140b[_0x07fd('0x1c')],'include':_0xbe140b[_0x07fd('0x19')]?_['map'](_0xbe140b['include'],function(_0x57795b){return{'model':db[_0x57795b[_0x07fd('0x1b')]],'as':_0x57795b['as'],'attributes':_0x57795b[_0x07fd('0x1c')],'include':_0x57795b[_0x07fd('0x19')]?_[_0x07fd('0x1a')](_0x57795b[_0x07fd('0x19')],function(_0x41084d){return{'model':db[_0x41084d['model']],'as':_0x41084d['as'],'attributes':_0x41084d['attributes']};}):[]};}):[]};}):[]:[]})['then'](function(_0x9daec9){logger['info'](_0x07fd('0x14'),_0x533d2f);logger[_0x07fd('0x1d')](_0x07fd('0x14'),_0x533d2f,JSON[_0x07fd('0xe')](_0x9daec9));_0x1ceb63(_0x9daec9);})[_0x07fd('0x13')](function(_0x18044d){logger[_0x07fd('0xf')]('GetMemberReport',_0x18044d[_0x07fd('0x11')],_0x533d2f);_0xd9e91c(_0x43bdf3[_0x07fd('0xf')](0x1f4,_0x18044d['message']));});});};exports[_0x07fd('0x1e')]=function(_0x186407){var _0x1ef45f=this;return new Promise(function(_0x18139e,_0x3d4cf8){return db[_0x07fd('0x1f')][_0x07fd('0x20')](_0x186407['body'],{'raw':_0x186407['options']?_0x186407[_0x07fd('0x17')][_0x07fd('0x16')]===undefined?!![]:![]:!![]})[_0x07fd('0x21')](function(_0x3525ec){logger[_0x07fd('0xc')](_0x07fd('0x1e'),_0x186407);logger[_0x07fd('0x1d')]('CreateMemberReport',_0x186407,JSON[_0x07fd('0xe')](_0x3525ec));_0x18139e(_0x3525ec);})[_0x07fd('0x13')](function(_0x5924cd){logger['error']('CreateMemberReport',_0x5924cd['message'],_0x186407);_0x3d4cf8(_0x1ef45f[_0x07fd('0xf')](0x1f4,_0x5924cd['message']));});});};exports['UpdateMemberReport']=function(_0x3e4520){var _0x3b1181=this;return new Promise(function(_0x58d8ee,_0x27d537){return db['MemberReport'][_0x07fd('0x22')](_0x3e4520[_0x07fd('0x23')],{'raw':_0x3e4520[_0x07fd('0x17')]?_0x3e4520['options'][_0x07fd('0x16')]===undefined?!![]:![]:!![],'individualHooks':!![],'where':_0x3e4520['options']?_0x3e4520['options'][_0x07fd('0x18')]||null:null,'attributes':_0x3e4520[_0x07fd('0x17')]?_0x3e4520['options'][_0x07fd('0x1c')]||null:null,'limit':_0x3e4520[_0x07fd('0x17')]?_0x3e4520['options']['limit']||null:null})[_0x07fd('0x21')](function(_0x40f520){logger[_0x07fd('0xc')](_0x07fd('0x24'),_0x3e4520);logger['debug'](_0x07fd('0x24'),_0x3e4520,JSON[_0x07fd('0xe')](_0x40f520));_0x58d8ee(_0x40f520);})['catch'](function(_0x451141){logger[_0x07fd('0xf')](_0x07fd('0x24'),_0x451141[_0x07fd('0x11')],_0x3e4520);_0x27d537(_0x3b1181[_0x07fd('0xf')](0x1f4,_0x451141['message']));});});};
\ No newline at end of file
+var _0x9a3a=['../../config/utils','rpc','../../config/environment','client','http','request','then','MemberReport,\x20%s,\x20%s','request\x20sent','debug','MemberReport,\x20%s,\x20%s,\x20%s','stringify','error','code','message','info','result','catch','MemberReport','findAll','options','raw','where','attributes','include','map','model','GetMemberReport','create','body','CreateMemberReport','UpdateMemberReport','limit','lodash','util','moment','bluebird','randomstring','ioredis','../../mysqldb'];(function(_0x3d8835,_0x300463){var _0x3aa717=function(_0xacb6a8){while(--_0xacb6a8){_0x3d8835['push'](_0x3d8835['shift']());}};_0x3aa717(++_0x300463);}(_0x9a3a,0xe9));var _0xa9a3=function(_0x49bb21,_0x1ee069){_0x49bb21=_0x49bb21-0x0;var _0x140777=_0x9a3a[_0x49bb21];return _0x140777;};'use strict';var _=require(_0xa9a3('0x0'));var util=require(_0xa9a3('0x1'));var moment=require(_0xa9a3('0x2'));var BPromise=require(_0xa9a3('0x3'));var rs=require(_0xa9a3('0x4'));var fs=require('fs');var Redis=require(_0xa9a3('0x5'));var db=require(_0xa9a3('0x6'))['db'];var utils=require(_0xa9a3('0x7'));var logger=require('../../config/logger')(_0xa9a3('0x8'));var config=require(_0xa9a3('0x9'));var jayson=require('jayson/promise');var client=jayson[_0xa9a3('0xa')][_0xa9a3('0xb')]({'port':0x232a});function respondWithRpcPromise(_0x3288e8,_0x169050,_0x14ef14){return new BPromise(function(_0x4969fb,_0x1faf03){return client[_0xa9a3('0xc')](_0x3288e8,_0x14ef14)[_0xa9a3('0xd')](function(_0x1c7e97){logger['info'](_0xa9a3('0xe'),_0x169050,_0xa9a3('0xf'));logger[_0xa9a3('0x10')](_0xa9a3('0x11'),_0x169050,_0xa9a3('0xf'),JSON[_0xa9a3('0x12')](_0x1c7e97));if(_0x1c7e97[_0xa9a3('0x13')]){if(_0x1c7e97[_0xa9a3('0x13')][_0xa9a3('0x14')]===0x1f4){logger[_0xa9a3('0x13')](_0xa9a3('0xe'),_0x169050,_0x1c7e97[_0xa9a3('0x13')][_0xa9a3('0x15')]);return _0x1faf03(_0x1c7e97[_0xa9a3('0x13')][_0xa9a3('0x15')]);}logger[_0xa9a3('0x13')](_0xa9a3('0xe'),_0x169050,_0x1c7e97['error'][_0xa9a3('0x15')]);return _0x4969fb(_0x1c7e97[_0xa9a3('0x13')][_0xa9a3('0x15')]);}else{logger[_0xa9a3('0x16')](_0xa9a3('0xe'),_0x169050,_0xa9a3('0xf'));_0x4969fb(_0x1c7e97[_0xa9a3('0x17')]['message']);}})[_0xa9a3('0x18')](function(_0xab6391){logger[_0xa9a3('0x13')]('MemberReport,\x20%s,\x20%s',_0x169050,_0xab6391);_0x1faf03(_0xab6391);});});}exports['GetMemberReport']=function(_0xfcab6a){var _0x266a04=this;return new Promise(function(_0x27d3ce,_0x4445cd){return db[_0xa9a3('0x19')][_0xa9a3('0x1a')]({'raw':_0xfcab6a['options']?_0xfcab6a[_0xa9a3('0x1b')][_0xa9a3('0x1c')]===undefined?!![]:![]:!![],'where':_0xfcab6a[_0xa9a3('0x1b')]?_0xfcab6a[_0xa9a3('0x1b')][_0xa9a3('0x1d')]||null:null,'attributes':_0xfcab6a[_0xa9a3('0x1b')]?_0xfcab6a[_0xa9a3('0x1b')][_0xa9a3('0x1e')]||null:null,'limit':_0xfcab6a[_0xa9a3('0x1b')]?_0xfcab6a['options']['limit']||null:null,'include':_0xfcab6a['options']?_0xfcab6a[_0xa9a3('0x1b')][_0xa9a3('0x1f')]?_[_0xa9a3('0x20')](_0xfcab6a[_0xa9a3('0x1b')]['include'],function(_0x397d81){return{'model':db[_0x397d81[_0xa9a3('0x21')]],'as':_0x397d81['as'],'attributes':_0x397d81[_0xa9a3('0x1e')],'include':_0x397d81[_0xa9a3('0x1f')]?_['map'](_0x397d81[_0xa9a3('0x1f')],function(_0x33fff0){return{'model':db[_0x33fff0[_0xa9a3('0x21')]],'as':_0x33fff0['as'],'attributes':_0x33fff0[_0xa9a3('0x1e')],'include':_0x33fff0[_0xa9a3('0x1f')]?_[_0xa9a3('0x20')](_0x33fff0[_0xa9a3('0x1f')],function(_0x4c2036){return{'model':db[_0x4c2036['model']],'as':_0x4c2036['as'],'attributes':_0x4c2036[_0xa9a3('0x1e')]};}):[]};}):[]};}):[]:[]})[_0xa9a3('0xd')](function(_0x40a62d){logger[_0xa9a3('0x16')](_0xa9a3('0x22'),_0xfcab6a);logger['debug'](_0xa9a3('0x22'),_0xfcab6a,JSON[_0xa9a3('0x12')](_0x40a62d));_0x27d3ce(_0x40a62d);})[_0xa9a3('0x18')](function(_0x42d9ca){logger[_0xa9a3('0x13')](_0xa9a3('0x22'),_0x42d9ca[_0xa9a3('0x15')],_0xfcab6a);_0x4445cd(_0x266a04[_0xa9a3('0x13')](0x1f4,_0x42d9ca['message']));});});};exports['CreateMemberReport']=function(_0x3e1a29){var _0x3b77b7=this;return new Promise(function(_0x43fa84,_0x4e94b1){return db['MemberReport'][_0xa9a3('0x23')](_0x3e1a29[_0xa9a3('0x24')],{'raw':_0x3e1a29[_0xa9a3('0x1b')]?_0x3e1a29[_0xa9a3('0x1b')][_0xa9a3('0x1c')]===undefined?!![]:![]:!![]})[_0xa9a3('0xd')](function(_0x6dbaa){logger['info']('CreateMemberReport',_0x3e1a29);logger[_0xa9a3('0x10')](_0xa9a3('0x25'),_0x3e1a29,JSON[_0xa9a3('0x12')](_0x6dbaa));_0x43fa84(_0x6dbaa);})[_0xa9a3('0x18')](function(_0x14507a){logger[_0xa9a3('0x13')](_0xa9a3('0x25'),_0x14507a[_0xa9a3('0x15')],_0x3e1a29);_0x4e94b1(_0x3b77b7[_0xa9a3('0x13')](0x1f4,_0x14507a[_0xa9a3('0x15')]));});});};exports[_0xa9a3('0x26')]=function(_0x293713){var _0x43b436=this;return new Promise(function(_0x534bac,_0x1e59b9){return db[_0xa9a3('0x19')]['update'](_0x293713[_0xa9a3('0x24')],{'raw':_0x293713[_0xa9a3('0x1b')]?_0x293713[_0xa9a3('0x1b')]['raw']===undefined?!![]:![]:!![],'individualHooks':!![],'where':_0x293713[_0xa9a3('0x1b')]?_0x293713[_0xa9a3('0x1b')][_0xa9a3('0x1d')]||null:null,'attributes':_0x293713[_0xa9a3('0x1b')]?_0x293713[_0xa9a3('0x1b')][_0xa9a3('0x1e')]||null:null,'limit':_0x293713[_0xa9a3('0x1b')]?_0x293713[_0xa9a3('0x1b')][_0xa9a3('0x27')]||null:null})[_0xa9a3('0xd')](function(_0x3fe65a){logger['info']('UpdateMemberReport',_0x293713);logger[_0xa9a3('0x10')](_0xa9a3('0x26'),_0x293713,JSON['stringify'](_0x3fe65a));_0x534bac(_0x3fe65a);})['catch'](function(_0x19222a){logger[_0xa9a3('0x13')](_0xa9a3('0x26'),_0x19222a[_0xa9a3('0x15')],_0x293713);_0x1e59b9(_0x43b436[_0xa9a3('0x13')](0x1f4,_0x19222a[_0xa9a3('0x15')]));});});};
\ No newline at end of file
diff --git a/server/api/migration/index.js b/server/api/migration/index.js
index f883d5c..da9d12d 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 _0x351d=['multer','path','connect-timeout','express','../../components/auth/service','../../config/environment','./migration.controller','index','exports'];(function(_0x3f076f,_0x46c6c6){var _0x28bae9=function(_0x1fb3f2){while(--_0x1fb3f2){_0x3f076f['push'](_0x3f076f['shift']());}};_0x28bae9(++_0x46c6c6);}(_0x351d,0x90));var _0xd351=function(_0xb69e9c,_0x4ac158){_0xb69e9c=_0xb69e9c-0x0;var _0x1e2c24=_0x351d[_0xb69e9c];return _0x1e2c24;};'use strict';var multer=require(_0xd351('0x0'));var util=require('util');var path=require(_0xd351('0x1'));var timeout=require(_0xd351('0x2'));var express=require(_0xd351('0x3'));var router=express['Router']();var auth=require(_0xd351('0x4'));var interaction=require('../../components/interaction/service');var config=require(_0xd351('0x5'));var controller=require(_0xd351('0x6'));router['get']('/',controller[_0xd351('0x7')]);module[_0xd351('0x8')]=router;
\ No newline at end of file
+var _0x0972=['exports','util','connect-timeout','Router','../../components/auth/service','../../config/environment','./migration.controller','get','index'];(function(_0x109d07,_0x493a0f){var _0x549773=function(_0x1010df){while(--_0x1010df){_0x109d07['push'](_0x109d07['shift']());}};_0x549773(++_0x493a0f);}(_0x0972,0x64));var _0x2097=function(_0x3dac76,_0x2bcc52){_0x3dac76=_0x3dac76-0x0;var _0x25cdcb=_0x0972[_0x3dac76];return _0x25cdcb;};'use strict';var multer=require('multer');var util=require(_0x2097('0x0'));var path=require('path');var timeout=require(_0x2097('0x1'));var express=require('express');var router=express[_0x2097('0x2')]();var auth=require(_0x2097('0x3'));var interaction=require('../../components/interaction/service');var config=require(_0x2097('0x4'));var controller=require(_0x2097('0x5'));router[_0x2097('0x6')]('/',controller[_0x2097('0x7')]);module[_0x2097('0x8')]=router;
\ No newline at end of file
diff --git a/server/api/migration/migration.attributes.js b/server/api/migration/migration.attributes.js
index 0b1cdcd..5e37dad 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 _0xb909=['exports','version','sequelize'];(function(_0x43a290,_0x13c7f1){var _0x226d17=function(_0x24a0f6){while(--_0x24a0f6){_0x43a290['push'](_0x43a290['shift']());}};_0x226d17(++_0x13c7f1);}(_0xb909,0x95));var _0x9b90=function(_0x1d5bd7,_0x37e9c4){_0x1d5bd7=_0x1d5bd7-0x0;var _0x53d013=_0xb909[_0x1d5bd7];return _0x53d013;};'use strict';var Sequelize=require(_0x9b90('0x0'));module[_0x9b90('0x1')]={'version':{'type':Sequelize['STRING'],'unique':_0x9b90('0x2')}};
\ No newline at end of file
+var _0xba08=['STRING','exports'];(function(_0x42389e,_0x1ab174){var _0x464985=function(_0x337f3f){while(--_0x337f3f){_0x42389e['push'](_0x42389e['shift']());}};_0x464985(++_0x1ab174);}(_0xba08,0x123));var _0x8ba0=function(_0x4616c7,_0x5e060d){_0x4616c7=_0x4616c7-0x0;var _0x589a1c=_0xba08[_0x4616c7];return _0x589a1c;};'use strict';var Sequelize=require('sequelize');module[_0x8ba0('0x0')]={'version':{'type':Sequelize[_0x8ba0('0x1')],'unique':'version'}};
\ No newline at end of file
diff --git a/server/api/migration/migration.controller.js b/server/api/migration/migration.controller.js
index a0d7e6b..34fe203 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 _0xb10b=['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','where','merge','Migration','include','rows','catch','html-pdf','rimraf','zip-dir','fast-json-patch','moment','bluebird','mustache','util','path','sox','ejs','lodash','crypto','jsforce','desk.js','to-csv','querystring'];(function(_0x1ce7b1,_0x59966e){var _0x5adf29=function(_0x14a7cd){while(--_0x14a7cd){_0x1ce7b1['push'](_0x1ce7b1['shift']());}};_0x5adf29(++_0x59966e);}(_0xb10b,0x12a));var _0xbb10=function(_0x53c5cf,_0x3ef208){_0x53c5cf=_0x53c5cf-0x0;var _0x3261aa=_0xb10b[_0x53c5cf];return _0x3261aa;};'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['Migration'][_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')]));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));};
\ No newline at end of file
+var _0xb10b=['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','where','merge','Migration','include','rows','catch','html-pdf','rimraf','zip-dir','fast-json-patch','moment','bluebird','mustache','util','path','sox','ejs','lodash','crypto','jsforce','desk.js','to-csv','querystring'];(function(_0x528697,_0x1bfaea){var _0x2d4a99=function(_0x4e26fe){while(--_0x4e26fe){_0x528697['push'](_0x528697['shift']());}};_0x2d4a99(++_0x1bfaea);}(_0xb10b,0x12a));var _0xbb10=function(_0x4996dd,_0x1613fc){_0x4996dd=_0x4996dd-0x0;var _0x98b206=_0xb10b[_0x4996dd];return _0x98b206;};'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['Migration'][_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')]));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));};
\ No newline at end of file
diff --git a/server/api/migration/migration.model.js b/server/api/migration/migration.model.js
index 41d1dab..eb0a00e 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 _0xf155=['bluebird','path','../../config/environment','./migration.attributes','exports','define','Migration','migrations','lodash','util','../../config/logger','api','moment'];(function(_0x300538,_0x8f2df4){var _0x5a316c=function(_0x3a7c40){while(--_0x3a7c40){_0x300538['push'](_0x300538['shift']());}};_0x5a316c(++_0x8f2df4);}(_0xf155,0x1e9));var _0x5f15=function(_0x3564d6,_0x37d1cb){_0x3564d6=_0x3564d6-0x0;var _0x1f2267=_0xf155[_0x3564d6];return _0x1f2267;};'use strict';var _=require(_0x5f15('0x0'));var util=require(_0x5f15('0x1'));var logger=require(_0x5f15('0x2'))(_0x5f15('0x3'));var moment=require(_0x5f15('0x4'));var BPromise=require(_0x5f15('0x5'));var rp=require('request-promise');var fs=require('fs');var path=require(_0x5f15('0x6'));var rimraf=require('rimraf');var config=require(_0x5f15('0x7'));var attributes=require(_0x5f15('0x8'));module[_0x5f15('0x9')]=function(_0x518178,_0x2fa785){return _0x518178[_0x5f15('0xa')](_0x5f15('0xb'),attributes,{'tableName':_0x5f15('0xc'),'paranoid':![],'indexes':[],'timestamps':!![]});};
\ No newline at end of file
+var _0x42da=['path','../../config/environment','./migration.attributes','define','migrations','lodash','util','../../config/logger','api','moment','request-promise'];(function(_0x4b71f5,_0x159213){var _0x1f0933=function(_0x81ef67){while(--_0x81ef67){_0x4b71f5['push'](_0x4b71f5['shift']());}};_0x1f0933(++_0x159213);}(_0x42da,0x19c));var _0xa42d=function(_0x5b6817,_0x3ef7de){_0x5b6817=_0x5b6817-0x0;var _0x1d6593=_0x42da[_0x5b6817];return _0x1d6593;};'use strict';var _=require(_0xa42d('0x0'));var util=require(_0xa42d('0x1'));var logger=require(_0xa42d('0x2'))(_0xa42d('0x3'));var moment=require(_0xa42d('0x4'));var BPromise=require('bluebird');var rp=require(_0xa42d('0x5'));var fs=require('fs');var path=require(_0xa42d('0x6'));var rimraf=require('rimraf');var config=require(_0xa42d('0x7'));var attributes=require(_0xa42d('0x8'));module['exports']=function(_0x2c49e9,_0x3c34b2){return _0x2c49e9[_0xa42d('0x9')]('Migration',attributes,{'tableName':_0xa42d('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 7bfec7d..6e5ce8a 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 _0x8403=['randomstring','../../mysqldb','../../config/utils','rpc','jayson/promise','client','http','request','then','info','Migration,\x20%s,\x20%s','request\x20sent','debug','Migration,\x20%s,\x20%s,\x20%s','error','message','result','catch','lodash','util','moment','bluebird'];(function(_0x321bb2,_0x202794){var _0x9c12ed=function(_0x263dd3){while(--_0x263dd3){_0x321bb2['push'](_0x321bb2['shift']());}};_0x9c12ed(++_0x202794);}(_0x8403,0x188));var _0x3840=function(_0xdeba58,_0x2542c4){_0xdeba58=_0xdeba58-0x0;var _0x4df205=_0x8403[_0xdeba58];return _0x4df205;};'use strict';var _=require(_0x3840('0x0'));var util=require(_0x3840('0x1'));var moment=require(_0x3840('0x2'));var BPromise=require(_0x3840('0x3'));var rs=require(_0x3840('0x4'));var fs=require('fs');var Redis=require('ioredis');var db=require(_0x3840('0x5'))['db'];var utils=require(_0x3840('0x6'));var logger=require('../../config/logger')(_0x3840('0x7'));var config=require('../../config/environment');var jayson=require(_0x3840('0x8'));var client=jayson[_0x3840('0x9')][_0x3840('0xa')]({'port':0x232a});function respondWithRpcPromise(_0xe6c707,_0x2d0dd7,_0xf7c7ad){return new BPromise(function(_0x1a8df2,_0x4e43f7){return client[_0x3840('0xb')](_0xe6c707,_0xf7c7ad)[_0x3840('0xc')](function(_0x6cd76c){logger[_0x3840('0xd')](_0x3840('0xe'),_0x2d0dd7,_0x3840('0xf'));logger[_0x3840('0x10')](_0x3840('0x11'),_0x2d0dd7,_0x3840('0xf'),JSON['stringify'](_0x6cd76c));if(_0x6cd76c[_0x3840('0x12')]){if(_0x6cd76c[_0x3840('0x12')]['code']===0x1f4){logger[_0x3840('0x12')](_0x3840('0xe'),_0x2d0dd7,_0x6cd76c[_0x3840('0x12')][_0x3840('0x13')]);return _0x4e43f7(_0x6cd76c[_0x3840('0x12')][_0x3840('0x13')]);}logger[_0x3840('0x12')](_0x3840('0xe'),_0x2d0dd7,_0x6cd76c[_0x3840('0x12')][_0x3840('0x13')]);return _0x1a8df2(_0x6cd76c['error'][_0x3840('0x13')]);}else{logger['info'](_0x3840('0xe'),_0x2d0dd7,_0x3840('0xf'));_0x1a8df2(_0x6cd76c[_0x3840('0x14')][_0x3840('0x13')]);}})[_0x3840('0x15')](function(_0x40809c){logger[_0x3840('0x12')](_0x3840('0xe'),_0x2d0dd7,_0x40809c);_0x4e43f7(_0x40809c);});});}
\ No newline at end of file
+var _0x15ad=['request','then','Migration,\x20%s,\x20%s','debug','Migration,\x20%s,\x20%s,\x20%s','request\x20sent','error','code','message','result','lodash','util','bluebird','randomstring','ioredis','../../mysqldb','../../config/logger','rpc','jayson/promise','client'];(function(_0x29aba9,_0x40e341){var _0xf177c4=function(_0x22387e){while(--_0x22387e){_0x29aba9['push'](_0x29aba9['shift']());}};_0xf177c4(++_0x40e341);}(_0x15ad,0x6e));var _0xd15a=function(_0x6aaf8b,_0xfe4849){_0x6aaf8b=_0x6aaf8b-0x0;var _0x129edc=_0x15ad[_0x6aaf8b];return _0x129edc;};'use strict';var _=require(_0xd15a('0x0'));var util=require(_0xd15a('0x1'));var moment=require('moment');var BPromise=require(_0xd15a('0x2'));var rs=require(_0xd15a('0x3'));var fs=require('fs');var Redis=require(_0xd15a('0x4'));var db=require(_0xd15a('0x5'))['db'];var utils=require('../../config/utils');var logger=require(_0xd15a('0x6'))(_0xd15a('0x7'));var config=require('../../config/environment');var jayson=require(_0xd15a('0x8'));var client=jayson[_0xd15a('0x9')]['http']({'port':0x232a});function respondWithRpcPromise(_0x4e3998,_0x29c15f,_0x3c13cd){return new BPromise(function(_0x4956f1,_0x3ec5e7){return client[_0xd15a('0xa')](_0x4e3998,_0x3c13cd)[_0xd15a('0xb')](function(_0x2cd5b6){logger['info'](_0xd15a('0xc'),_0x29c15f,'request\x20sent');logger[_0xd15a('0xd')](_0xd15a('0xe'),_0x29c15f,_0xd15a('0xf'),JSON['stringify'](_0x2cd5b6));if(_0x2cd5b6['error']){if(_0x2cd5b6[_0xd15a('0x10')][_0xd15a('0x11')]===0x1f4){logger[_0xd15a('0x10')](_0xd15a('0xc'),_0x29c15f,_0x2cd5b6[_0xd15a('0x10')][_0xd15a('0x12')]);return _0x3ec5e7(_0x2cd5b6[_0xd15a('0x10')][_0xd15a('0x12')]);}logger[_0xd15a('0x10')](_0xd15a('0xc'),_0x29c15f,_0x2cd5b6['error']['message']);return _0x4956f1(_0x2cd5b6[_0xd15a('0x10')][_0xd15a('0x12')]);}else{logger['info'](_0xd15a('0xc'),_0x29c15f,'request\x20sent');_0x4956f1(_0x2cd5b6[_0xd15a('0x13')]['message']);}})['catch'](function(_0x584dff){logger[_0xd15a('0x10')](_0xd15a('0xc'),_0x29c15f,_0x584dff);_0x3ec5e7(_0x584dff);});});}
\ No newline at end of file
diff --git a/server/api/network/index.js b/server/api/network/index.js
index 23e7ea7..16b1933 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 _0x7050=['express','../../components/auth/service','../../config/environment','get','isAuthenticated','index','/:id','show','post','update','destroy','multer','util','path','connect-timeout'];(function(_0x59ee6f,_0x450239){var _0x4c0979=function(_0x565e92){while(--_0x565e92){_0x59ee6f['push'](_0x59ee6f['shift']());}};_0x4c0979(++_0x450239);}(_0x7050,0x74));var _0x0705=function(_0x2adbeb,_0x5581be){_0x2adbeb=_0x2adbeb-0x0;var _0x5e18a6=_0x7050[_0x2adbeb];return _0x5e18a6;};'use strict';var multer=require(_0x0705('0x0'));var util=require(_0x0705('0x1'));var path=require(_0x0705('0x2'));var timeout=require(_0x0705('0x3'));var express=require(_0x0705('0x4'));var router=express['Router']();var auth=require(_0x0705('0x5'));var interaction=require('../../components/interaction/service');var config=require(_0x0705('0x6'));var controller=require('./network.controller');router[_0x0705('0x7')]('/',auth[_0x0705('0x8')](),controller[_0x0705('0x9')]);router[_0x0705('0x7')](_0x0705('0xa'),auth['isAuthenticated'](),controller[_0x0705('0xb')]);router[_0x0705('0xc')]('/',auth[_0x0705('0x8')](),controller['create']);router['put'](_0x0705('0xa'),auth[_0x0705('0x8')](),controller[_0x0705('0xd')]);router['delete']('/:id',auth[_0x0705('0x8')](),controller[_0x0705('0xe')]);module['exports']=router;
\ No newline at end of file
+var _0x77f7=['get','/:id','show','post','create','put','delete','destroy','exports','multer','util','path','connect-timeout','express','Router','../../components/auth/service','../../components/interaction/service','../../config/environment','isAuthenticated','index'];(function(_0x66569,_0x19e1aa){var _0x436290=function(_0x3178c1){while(--_0x3178c1){_0x66569['push'](_0x66569['shift']());}};_0x436290(++_0x19e1aa);}(_0x77f7,0xbd));var _0x777f=function(_0x2cb7b7,_0x2ae5a7){_0x2cb7b7=_0x2cb7b7-0x0;var _0x3133b2=_0x77f7[_0x2cb7b7];return _0x3133b2;};'use strict';var multer=require(_0x777f('0x0'));var util=require(_0x777f('0x1'));var path=require(_0x777f('0x2'));var timeout=require(_0x777f('0x3'));var express=require(_0x777f('0x4'));var router=express[_0x777f('0x5')]();var auth=require(_0x777f('0x6'));var interaction=require(_0x777f('0x7'));var config=require(_0x777f('0x8'));var controller=require('./network.controller');router['get']('/',auth[_0x777f('0x9')](),controller[_0x777f('0xa')]);router[_0x777f('0xb')](_0x777f('0xc'),auth[_0x777f('0x9')](),controller[_0x777f('0xd')]);router[_0x777f('0xe')]('/',auth[_0x777f('0x9')](),controller[_0x777f('0xf')]);router[_0x777f('0x10')]('/:id',auth[_0x777f('0x9')](),controller['update']);router[_0x777f('0x11')](_0x777f('0xc'),auth['isAuthenticated'](),controller[_0x777f('0x12')]);module[_0x777f('0x13')]=router;
\ No newline at end of file
diff --git a/server/api/network/network.attributes.js b/server/api/network/network.attributes.js
index b5759b4..4b58c7a 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(_0x336fd7,_0x564464){var _0x1cfb10=function(_0x1fdf3e){while(--_0x1fdf3e){_0x336fd7['push'](_0x336fd7['shift']());}};_0x1cfb10(++_0x564464);}(_0xa9e0,0x123));var _0x0a9e=function(_0x1da04e,_0x31024b){_0x1da04e=_0x1da04e-0x0;var _0xdd8c41=_0xa9e0[_0x1da04e];return _0xdd8c41;};'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(_0x3068f1,_0x2b56cf){var _0x1fa25f=function(_0x2455db){while(--_0x2455db){_0x3068f1['push'](_0x3068f1['shift']());}};_0x1fa25f(++_0x2b56cf);}(_0xa9e0,0x123));var _0x0a9e=function(_0x30ae5e,_0x391fc4){_0x30ae5e=_0x30ae5e-0x0;var _0x1f2e93=_0xa9e0[_0x30ae5e];return _0x1f2e93;};'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 5963f90..b335b73 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 _0x1439=['length','find','create','sequelize','transaction','body','STUN','readFileSync','join','root','server/files/templates/stun_multiple.ejs','utf8','render','writeFileSync','/etc/asterisk/stun_xcally.conf','res_stun_monitor.so','toUpperCase','TURN','server/files/templates/turn_multiple.ejs','/etc/asterisk/turn_xcally.conf','Reload','server/files/templates/network.ejs','format','/etc/asterisk/sip_xcally_%s.conf','toLowerCase','chan_sip.so','destroy','eml-format','rimraf','zip-dir','fast-json-patch','moment','mustache','util','path','sox','to-csv','ejs','squel','jsforce','ioredis','../../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','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','code','message','Network,\x20%s,\x20%s','info','result','catch','sendStatus','status','end','json','count','offset','limit','Content-Range','apply','update','stack','name','send','index','map','Network','rawAttributes','fieldName','type','query','filters','intersection','model','attributes','fields','hasOwnProperty','nolimit','order','sort','where','pick','merge','VIRTUAL','options','includeAll','include','findAll','rows','show','params','keys'];(function(_0x54b396,_0x3612ee){var _0x532e6d=function(_0xc8286e){while(--_0xc8286e){_0x54b396['push'](_0x54b396['shift']());}};_0x532e6d(++_0x3612ee);}(_0x1439,0x165));var _0x9143=function(_0x145037,_0x16e4b5){_0x145037=_0x145037-0x0;var _0x3fc5cd=_0x1439[_0x145037];return _0x3fc5cd;};'use strict';var pdf=require('html-pdf');var emlformat=require(_0x9143('0x0'));var rimraf=require(_0x9143('0x1'));var zipdir=require(_0x9143('0x2'));var jsonpatch=require(_0x9143('0x3'));var rp=require('request-promise');var moment=require(_0x9143('0x4'));var BPromise=require('bluebird');var Mustache=require(_0x9143('0x5'));var util=require(_0x9143('0x6'));var path=require(_0x9143('0x7'));var sox=require(_0x9143('0x8'));var csv=require(_0x9143('0x9'));var ejs=require(_0x9143('0xa'));var fs=require('fs');var _=require('lodash');var squel=require(_0x9143('0xb'));var crypto=require('crypto');var jsforce=require(_0x9143('0xc'));var deskjs=require('desk.js');var toCsv=require('to-csv');var querystring=require('querystring');var Papa=require('papaparse');var Redis=require(_0x9143('0xd'));var authService=require(_0x9143('0xe'));var qs=require(_0x9143('0xf'));var as=require(_0x9143('0x10'));var hardwareService=require(_0x9143('0x11'));var logger=require(_0x9143('0x12'))(_0x9143('0x13'));var utils=require(_0x9143('0x14'));var config=require(_0x9143('0x15'));var db=require(_0x9143('0x16'))['db'];var jayson=require(_0x9143('0x17'));var client=jayson[_0x9143('0x18')][_0x9143('0x19')]({'port':0x232a});function checkPasswordPattern(_0x5b5d6f,_0x1dd438,_0x2d3121){if(_0x2d3121){var _0x4dcb06=new RegExp(/(?=.*[a-z])(?=.*[A-Z])(?=.*[0-9])(?=.*[?!@#\$%\^&\*~\-_=+[{\]\}])(?=.{8,})/);if(_0x4dcb06[_0x9143('0x1a')](_0x1dd438)){return _0x5b5d6f;}else{throw new db[(_0x9143('0x1b'))][(_0x9143('0x1c'))](_0x9143('0x1d'));}}else{return _0x5b5d6f;}}function respondWithRpcPromise(_0x56e434,_0x2238aa,_0x39ba8c,_0x360090){return new BPromise(function(_0x448cfc,_0x2658d0){var _0x1f787a=_0x360090||client;return _0x1f787a[_0x9143('0x1e')](_0x56e434,_0x39ba8c)[_0x9143('0x1f')](function(_0x4c1d0a){logger['info']('Network,\x20%s,\x20%s',_0x2238aa,_0x9143('0x20'));logger[_0x9143('0x21')]('Network,\x20%s,\x20%s,\x20%s',_0x2238aa,_0x9143('0x20'),JSON[_0x9143('0x22')](_0x4c1d0a));if(_0x4c1d0a[_0x9143('0x23')]){if(_0x4c1d0a[_0x9143('0x23')][_0x9143('0x24')]===0x1f4){logger[_0x9143('0x23')]('Network,\x20%s,\x20%s',_0x2238aa,_0x4c1d0a['error'][_0x9143('0x25')]);return _0x2658d0(_0x4c1d0a[_0x9143('0x23')][_0x9143('0x25')]);}logger[_0x9143('0x23')](_0x9143('0x26'),_0x2238aa,_0x4c1d0a[_0x9143('0x23')]['message']);return _0x448cfc(_0x4c1d0a['error'][_0x9143('0x25')]);}else{logger[_0x9143('0x27')]('Network,\x20%s,\x20%s',_0x2238aa,'request\x20sent');_0x448cfc(_0x4c1d0a[_0x9143('0x28')]['message']);}})[_0x9143('0x29')](function(_0x209b15){logger['error'](_0x9143('0x26'),_0x2238aa,_0x209b15);_0x2658d0(_0x209b15);});});}function respondWithStatusCode(_0x19eae9,_0x469bc9){_0x469bc9=_0x469bc9||0xcc;return function(_0x3883fc){if(_0x3883fc){return _0x19eae9[_0x9143('0x2a')](_0x469bc9);}return _0x19eae9[_0x9143('0x2b')](_0x469bc9)[_0x9143('0x2c')]();};}function respondWithResult(_0x33a0ae,_0x251c51){_0x251c51=_0x251c51||0xc8;return function(_0x8c3de6){if(_0x8c3de6){return _0x33a0ae[_0x9143('0x2b')](_0x251c51)[_0x9143('0x2d')](_0x8c3de6);}};}function respondWithFilteredResult(_0x3ddac4,_0x2b07bd){return function(_0x552f82){if(_0x552f82){var _0x281bd0=_0x552f82[_0x9143('0x2e')],_0x4210e4=_0x2b07bd[_0x9143('0x2f')],_0x4d75d2=_0x2b07bd['offset']+_0x2b07bd[_0x9143('0x30')],_0x1abca8;if(_0x4d75d2>=_0x281bd0){_0x4d75d2=_0x281bd0;_0x1abca8=0xc8;}else{_0x1abca8=0xce;}_0x3ddac4[_0x9143('0x2b')](_0x1abca8);return _0x3ddac4['set'](_0x9143('0x31'),_0x4210e4+'-'+_0x4d75d2+'/'+_0x281bd0)[_0x9143('0x2d')](_0x552f82);}return null;};}function patchUpdates(_0x30a2b1){return function(_0x594d81){try{jsonpatch[_0x9143('0x32')](_0x594d81,_0x30a2b1,!![]);}catch(_0x3776f7){return BPromise['reject'](_0x3776f7);}return _0x594d81['save']();};}function saveUpdates(_0x27a7f8,_0x460686){return function(_0x215802){if(_0x215802){return _0x215802[_0x9143('0x33')](_0x27a7f8)['then'](function(_0x8f471b){return _0x8f471b;});}return null;};}function removeEntity(_0x4c627d,_0xe626c6){return function(_0x2d1102){if(_0x2d1102){return _0x2d1102['destroy']()[_0x9143('0x1f')](function(){_0x4c627d[_0x9143('0x2b')](0xcc)[_0x9143('0x2c')]();});}};}function handleEntityNotFound(_0x2d3da2,_0x11ba4f){return function(_0x8ecd9d){if(!_0x8ecd9d){_0x2d3da2[_0x9143('0x2a')](0x194);}return _0x8ecd9d;};}function handleError(_0x4fba6e,_0x5357d3){_0x5357d3=_0x5357d3||0x1f4;return function(_0x44685f){logger[_0x9143('0x23')](_0x44685f[_0x9143('0x34')]);if(_0x44685f[_0x9143('0x35')]){delete _0x44685f[_0x9143('0x35')];}_0x4fba6e[_0x9143('0x2b')](_0x5357d3)[_0x9143('0x36')](_0x44685f);};}exports[_0x9143('0x37')]=function(_0x364b89,_0xb88a42){var _0x529210={},_0x1c5f24={},_0x5ee7c0={'count':0x0,'rows':[]};var _0x5136eb=_[_0x9143('0x38')](db[_0x9143('0x39')][_0x9143('0x3a')],function(_0xb8636c){return{'name':_0xb8636c[_0x9143('0x3b')],'type':_0xb8636c[_0x9143('0x3c')]['key']};});_0x1c5f24['model']=_[_0x9143('0x38')](_0x5136eb,_0x9143('0x35'));_0x1c5f24['query']=_['keys'](_0x364b89[_0x9143('0x3d')]);_0x1c5f24[_0x9143('0x3e')]=_[_0x9143('0x3f')](_0x1c5f24[_0x9143('0x40')],_0x1c5f24[_0x9143('0x3d')]);_0x529210[_0x9143('0x41')]=_['intersection'](_0x1c5f24[_0x9143('0x40')],qs[_0x9143('0x42')](_0x364b89['query']['fields']));_0x529210['attributes']=_0x529210[_0x9143('0x41')]['length']?_0x529210['attributes']:_0x1c5f24[_0x9143('0x40')];if(!_0x364b89[_0x9143('0x3d')][_0x9143('0x43')](_0x9143('0x44'))){_0x529210[_0x9143('0x30')]=qs[_0x9143('0x30')](_0x364b89[_0x9143('0x3d')][_0x9143('0x30')]);_0x529210[_0x9143('0x2f')]=qs[_0x9143('0x2f')](_0x364b89[_0x9143('0x3d')]['offset']);}_0x529210[_0x9143('0x45')]=qs[_0x9143('0x46')](_0x364b89[_0x9143('0x3d')][_0x9143('0x46')]);_0x529210[_0x9143('0x47')]=qs[_0x9143('0x3e')](_[_0x9143('0x48')](_0x364b89[_0x9143('0x3d')],_0x1c5f24['filters']));if(_0x364b89['query']['filter']){_0x529210[_0x9143('0x47')]=_[_0x9143('0x49')](_0x529210[_0x9143('0x47')],{'$or':_['map'](_0x5136eb,function(_0x303036){if(_0x303036['type']!==_0x9143('0x4a')){var _0x29ad78={};_0x29ad78[_0x303036['name']]={'$like':'%'+_0x364b89['query']['filter']+'%'};return _0x29ad78;}})});}_0x529210=_[_0x9143('0x49')]({},_0x529210,_0x364b89[_0x9143('0x4b')]);var _0x1d903e={'where':_0x529210[_0x9143('0x47')]};return db[_0x9143('0x39')][_0x9143('0x2e')](_0x1d903e)[_0x9143('0x1f')](function(_0x99896a){_0x5ee7c0['count']=_0x99896a;if(_0x364b89[_0x9143('0x3d')][_0x9143('0x4c')]){_0x529210[_0x9143('0x4d')]=[{'all':!![]}];}return db['Network'][_0x9143('0x4e')](_0x529210);})[_0x9143('0x1f')](function(_0x113bcf){_0x5ee7c0[_0x9143('0x4f')]=_0x113bcf;return _0x5ee7c0;})[_0x9143('0x1f')](respondWithFilteredResult(_0xb88a42,_0x529210))[_0x9143('0x29')](handleError(_0xb88a42,null));};exports[_0x9143('0x50')]=function(_0x2c13f7,_0x21e9e5){var _0x3fb5cf={'raw':!![],'where':{'id':_0x2c13f7[_0x9143('0x51')]['id']}},_0x380154={};_0x380154[_0x9143('0x40')]=_[_0x9143('0x52')](db[_0x9143('0x39')][_0x9143('0x3a')]);_0x380154[_0x9143('0x3d')]=_[_0x9143('0x52')](_0x2c13f7[_0x9143('0x3d')]);_0x380154['filters']=_['intersection'](_0x380154[_0x9143('0x40')],_0x380154[_0x9143('0x3d')]);_0x3fb5cf['attributes']=_[_0x9143('0x3f')](_0x380154[_0x9143('0x40')],qs[_0x9143('0x42')](_0x2c13f7[_0x9143('0x3d')][_0x9143('0x42')]));_0x3fb5cf[_0x9143('0x41')]=_0x3fb5cf[_0x9143('0x41')][_0x9143('0x53')]?_0x3fb5cf[_0x9143('0x41')]:_0x380154[_0x9143('0x40')];if(_0x2c13f7['query'][_0x9143('0x4c')]){_0x3fb5cf[_0x9143('0x4d')]=[{'all':!![]}];}_0x3fb5cf=_[_0x9143('0x49')]({},_0x3fb5cf,_0x2c13f7[_0x9143('0x4b')]);return db['Network'][_0x9143('0x54')](_0x3fb5cf)[_0x9143('0x1f')](handleEntityNotFound(_0x21e9e5,null))['then'](respondWithResult(_0x21e9e5,null))[_0x9143('0x29')](handleError(_0x21e9e5,null));};exports[_0x9143('0x55')]=function(_0x31bcdf,_0xd07560,_0x307259){var _0x2f1907;return db[_0x9143('0x56')][_0x9143('0x57')](function(_0x5cb9e6){return db[_0x9143('0x39')][_0x9143('0x55')](_0x31bcdf[_0x9143('0x58')],{'raw':!![]})[_0x9143('0x1f')](function(_0xb66344){_0x2f1907=_0xb66344;return db[_0x9143('0x39')]['findAll']({'where':{'type':_0x31bcdf[_0x9143('0x58')][_0x9143('0x3c')]},'raw':!![]});})[_0x9143('0x1f')](function(_0x4f77fb){if(_0x2f1907['type']['toUpperCase']()==_0x9143('0x59')){var _0x5e7e43=fs[_0x9143('0x5a')](path[_0x9143('0x5b')](config[_0x9143('0x5c')],_0x9143('0x5d')),_0x9143('0x5e'));var _0x409e0b=ejs[_0x9143('0x5f')](_0x5e7e43,{'networks':_0x4f77fb||[]});fs[_0x9143('0x60')](_0x9143('0x61'),_0x409e0b);return respondWithRpcPromise('Reload','create',{'module':_0x9143('0x62')});}else if(_0x2f1907['type'][_0x9143('0x63')]()==_0x9143('0x64')){var _0x104f41=fs['readFileSync'](path['join'](config['root'],_0x9143('0x65')),_0x9143('0x5e'));var _0x806bb5=ejs[_0x9143('0x5f')](_0x104f41,{'networks':_0x4f77fb||[]});fs[_0x9143('0x60')](_0x9143('0x66'),_0x806bb5);return respondWithRpcPromise(_0x9143('0x67'),_0x9143('0x55'),{'module':_0x9143('0x62')});}else{var _0x2ba4b0=fs[_0x9143('0x5a')](path[_0x9143('0x5b')](config[_0x9143('0x5c')],_0x9143('0x68')),_0x9143('0x5e'));var _0x518813=ejs[_0x9143('0x5f')](_0x2ba4b0,{'networks':_0x4f77fb||[]});fs['writeFileSync'](util[_0x9143('0x69')](_0x9143('0x6a'),_0x31bcdf[_0x9143('0x58')]['type'][_0x9143('0x6b')]()),_0x518813);return respondWithRpcPromise(_0x9143('0x67'),'create',{'module':_0x9143('0x6c')});}return null;})[_0x9143('0x1f')](function(){return _0x2f1907;});})[_0x9143('0x1f')](respondWithResult(_0xd07560,0xc9))[_0x9143('0x29')](handleError(_0xd07560,null));};exports[_0x9143('0x33')]=function(_0x51afde,_0x21278d,_0x1e39ee){var _0x25d478;return db[_0x9143('0x56')][_0x9143('0x57')](function(_0x43e2ec){return db['Network'][_0x9143('0x54')]({'where':{'id':_0x51afde[_0x9143('0x51')]['id']}})[_0x9143('0x1f')](handleEntityNotFound(_0x21278d,null))[_0x9143('0x1f')](saveUpdates(_0x51afde[_0x9143('0x58')],null))[_0x9143('0x1f')](function(_0x5a17e5){if(_0x5a17e5){_0x25d478=_0x5a17e5;return db[_0x9143('0x39')][_0x9143('0x4e')]({'where':{'type':_0x25d478['type']},'raw':!![]});}return null;})[_0x9143('0x1f')](function(_0x575cf0){if(_0x25d478['type'][_0x9143('0x63')]()==_0x9143('0x59')){var _0x288771=fs[_0x9143('0x5a')](path[_0x9143('0x5b')](config[_0x9143('0x5c')],_0x9143('0x5d')),_0x9143('0x5e'));var _0xeb7267=ejs['render'](_0x288771,{'networks':_0x575cf0||[]});fs[_0x9143('0x60')](_0x9143('0x61'),_0xeb7267);return respondWithRpcPromise('Reload','update',{'module':_0x9143('0x62')});}else if(_0x25d478[_0x9143('0x3c')][_0x9143('0x63')]()==_0x9143('0x64')){var _0x1a3174=fs['readFileSync'](path[_0x9143('0x5b')](config[_0x9143('0x5c')],_0x9143('0x65')),_0x9143('0x5e'));var _0x14e9fc=ejs[_0x9143('0x5f')](_0x1a3174,{'networks':_0x575cf0||[]});fs[_0x9143('0x60')](_0x9143('0x66'),_0x14e9fc);return respondWithRpcPromise('Reload',_0x9143('0x33'),{'module':_0x9143('0x62')});}else{var _0x390ed6=fs[_0x9143('0x5a')](path[_0x9143('0x5b')](config[_0x9143('0x5c')],'server/files/templates/network.ejs'),'utf8');var _0x5c25b5=ejs[_0x9143('0x5f')](_0x390ed6,{'networks':_0x575cf0||[]});fs[_0x9143('0x60')](util[_0x9143('0x69')](_0x9143('0x6a'),_0x51afde['body'][_0x9143('0x3c')][_0x9143('0x6b')]()),_0x5c25b5);return respondWithRpcPromise(_0x9143('0x67'),_0x9143('0x33'),{'module':_0x9143('0x6c')});}return null;})['then'](function(_0x4ff2ed){if(_0x4ff2ed){return _0x25d478;}return null;});})[_0x9143('0x1f')](respondWithResult(_0x21278d,null))[_0x9143('0x29')](handleError(_0x21278d,null));};exports[_0x9143('0x6d')]=function(_0x16dc9c,_0xe4323c,_0x38a125){var _0x4ed10d;return db[_0x9143('0x39')]['find']({'where':{'id':_0x16dc9c['params']['id']}})[_0x9143('0x1f')](function(_0x53de9b){_0x4ed10d=_0x53de9b;return _0x53de9b;})[_0x9143('0x1f')](handleEntityNotFound(_0xe4323c,null))[_0x9143('0x1f')](removeEntity(_0xe4323c,null))['then'](function(){if(_0x4ed10d){return db['Network'][_0x9143('0x4e')]({'where':{'type':_0x4ed10d[_0x9143('0x3c')]},'raw':!![]});}})[_0x9143('0x1f')](function(_0x5bbbe9){if(_0x4ed10d[_0x9143('0x3c')][_0x9143('0x63')]()==_0x9143('0x59')){var _0x133cb8=fs[_0x9143('0x5a')](path[_0x9143('0x5b')](config[_0x9143('0x5c')],_0x9143('0x5d')),_0x9143('0x5e'));var _0x1fd6fa=ejs[_0x9143('0x5f')](_0x133cb8,{'networks':_0x5bbbe9||[]});fs['writeFileSync'](_0x9143('0x61'),_0x1fd6fa);return respondWithRpcPromise('Reload',_0x9143('0x6d'),{'module':'res_stun_monitor.so'});}else if(_0x4ed10d[_0x9143('0x3c')][_0x9143('0x63')]()==_0x9143('0x64')){var _0x43e4ba=fs[_0x9143('0x5a')](path[_0x9143('0x5b')](config[_0x9143('0x5c')],_0x9143('0x65')),_0x9143('0x5e'));var _0x4d93f4=ejs[_0x9143('0x5f')](_0x43e4ba,{'networks':_0x5bbbe9||[]});fs[_0x9143('0x60')](_0x9143('0x66'),_0x4d93f4);return respondWithRpcPromise(_0x9143('0x67'),'destroy',{'module':_0x9143('0x62')});}else{var _0x121b64=fs['readFileSync'](path[_0x9143('0x5b')](config[_0x9143('0x5c')],_0x9143('0x68')),_0x9143('0x5e'));var _0x33cc7d=ejs[_0x9143('0x5f')](_0x121b64,{'networks':_0x5bbbe9||[]});fs['writeFileSync'](util[_0x9143('0x69')](_0x9143('0x6a'),_0x16dc9c[_0x9143('0x58')][_0x9143('0x3c')]['toLowerCase']()),_0x33cc7d);return respondWithRpcPromise('Reload','destroy',{'module':'chan_sip.so'});}return null;})[_0x9143('0x29')](handleError(_0xe4323c,null));};
\ No newline at end of file
+var _0xcae6=['stringify','error','message','result','catch','status','end','json','count','offset','limit','set','Content-Range','apply','reject','save','update','destroy','stack','name','map','Network','rawAttributes','key','model','query','keys','filters','intersection','attributes','fields','length','hasOwnProperty','nolimit','sort','where','filter','merge','VIRTUAL','options','includeAll','include','findAll','rows','show','params','find','create','sequelize','transaction','body','type','toUpperCase','STUN','join','utf8','render','writeFileSync','Reload','res_stun_monitor.so','TURN','readFileSync','server/files/templates/turn_multiple.ejs','root','format','chan_sip.so','server/files/templates/stun_multiple.ejs','/etc/asterisk/stun_xcally.conf','/etc/asterisk/turn_xcally.conf','server/files/templates/network.ejs','/etc/asterisk/sip_xcally_%s.conf','toLowerCase','eml-format','rimraf','fast-json-patch','moment','bluebird','mustache','path','sox','to-csv','lodash','squel','crypto','querystring','papaparse','../../config/license/hardware','../../config/logger','../../config/utils','../../config/environment','../../mysqldb','jayson/promise','client','http','Sequelize','ValidationError','request','then','info','Network,\x20%s,\x20%s','request\x20sent','debug','Network,\x20%s,\x20%s,\x20%s'];(function(_0x4dd1cb,_0x3bd8bf){var _0x1c5219=function(_0x16794d){while(--_0x16794d){_0x4dd1cb['push'](_0x4dd1cb['shift']());}};_0x1c5219(++_0x3bd8bf);}(_0xcae6,0xaf));var _0x6cae=function(_0x346737,_0x3e6081){_0x346737=_0x346737-0x0;var _0x1ade2e=_0xcae6[_0x346737];return _0x1ade2e;};'use strict';var pdf=require('html-pdf');var emlformat=require(_0x6cae('0x0'));var rimraf=require(_0x6cae('0x1'));var zipdir=require('zip-dir');var jsonpatch=require(_0x6cae('0x2'));var rp=require('request-promise');var moment=require(_0x6cae('0x3'));var BPromise=require(_0x6cae('0x4'));var Mustache=require(_0x6cae('0x5'));var util=require('util');var path=require(_0x6cae('0x6'));var sox=require(_0x6cae('0x7'));var csv=require(_0x6cae('0x8'));var ejs=require('ejs');var fs=require('fs');var _=require(_0x6cae('0x9'));var squel=require(_0x6cae('0xa'));var crypto=require(_0x6cae('0xb'));var jsforce=require('jsforce');var deskjs=require('desk.js');var toCsv=require('to-csv');var querystring=require(_0x6cae('0xc'));var Papa=require(_0x6cae('0xd'));var Redis=require('ioredis');var authService=require('../../components/auth/service');var qs=require('../../components/parsers/qs');var as=require('../../components/parsers/advancedSearch');var hardwareService=require(_0x6cae('0xe'));var logger=require(_0x6cae('0xf'))('api');var utils=require(_0x6cae('0x10'));var config=require(_0x6cae('0x11'));var db=require(_0x6cae('0x12'))['db'];var jayson=require(_0x6cae('0x13'));var client=jayson[_0x6cae('0x14')][_0x6cae('0x15')]({'port':0x232a});function checkPasswordPattern(_0x21e1f5,_0x394b74,_0x204e83){if(_0x204e83){var _0x3918db=new RegExp(/(?=.*[a-z])(?=.*[A-Z])(?=.*[0-9])(?=.*[?!@#\$%\^&\*~\-_=+[{\]\}])(?=.{8,})/);if(_0x3918db['test'](_0x394b74)){return _0x21e1f5;}else{throw new db[(_0x6cae('0x16'))][(_0x6cae('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 _0x21e1f5;}}function respondWithRpcPromise(_0x10e271,_0x311d8e,_0x5bbde0,_0x20fa1e){return new BPromise(function(_0xa8a30a,_0x57ee1c){var _0x5d018a=_0x20fa1e||client;return _0x5d018a[_0x6cae('0x18')](_0x10e271,_0x5bbde0)[_0x6cae('0x19')](function(_0x74ca){logger[_0x6cae('0x1a')](_0x6cae('0x1b'),_0x311d8e,_0x6cae('0x1c'));logger[_0x6cae('0x1d')](_0x6cae('0x1e'),_0x311d8e,'request\x20sent',JSON[_0x6cae('0x1f')](_0x74ca));if(_0x74ca[_0x6cae('0x20')]){if(_0x74ca[_0x6cae('0x20')]['code']===0x1f4){logger[_0x6cae('0x20')](_0x6cae('0x1b'),_0x311d8e,_0x74ca[_0x6cae('0x20')][_0x6cae('0x21')]);return _0x57ee1c(_0x74ca['error']['message']);}logger[_0x6cae('0x20')](_0x6cae('0x1b'),_0x311d8e,_0x74ca['error'][_0x6cae('0x21')]);return _0xa8a30a(_0x74ca[_0x6cae('0x20')]['message']);}else{logger[_0x6cae('0x1a')](_0x6cae('0x1b'),_0x311d8e,_0x6cae('0x1c'));_0xa8a30a(_0x74ca[_0x6cae('0x22')][_0x6cae('0x21')]);}})[_0x6cae('0x23')](function(_0x4b89bc){logger[_0x6cae('0x20')]('Network,\x20%s,\x20%s',_0x311d8e,_0x4b89bc);_0x57ee1c(_0x4b89bc);});});}function respondWithStatusCode(_0x44631b,_0x5010cd){_0x5010cd=_0x5010cd||0xcc;return function(_0x59ab11){if(_0x59ab11){return _0x44631b['sendStatus'](_0x5010cd);}return _0x44631b[_0x6cae('0x24')](_0x5010cd)[_0x6cae('0x25')]();};}function respondWithResult(_0x4fb6a0,_0x5def3c){_0x5def3c=_0x5def3c||0xc8;return function(_0x211baf){if(_0x211baf){return _0x4fb6a0[_0x6cae('0x24')](_0x5def3c)[_0x6cae('0x26')](_0x211baf);}};}function respondWithFilteredResult(_0x4b3782,_0x29622a){return function(_0x77d4dd){if(_0x77d4dd){var _0xaff64d=_0x77d4dd[_0x6cae('0x27')],_0x1f7864=_0x29622a[_0x6cae('0x28')],_0x51b1bf=_0x29622a[_0x6cae('0x28')]+_0x29622a[_0x6cae('0x29')],_0x41fa29;if(_0x51b1bf>=_0xaff64d){_0x51b1bf=_0xaff64d;_0x41fa29=0xc8;}else{_0x41fa29=0xce;}_0x4b3782['status'](_0x41fa29);return _0x4b3782[_0x6cae('0x2a')](_0x6cae('0x2b'),_0x1f7864+'-'+_0x51b1bf+'/'+_0xaff64d)[_0x6cae('0x26')](_0x77d4dd);}return null;};}function patchUpdates(_0x1237e6){return function(_0x46e943){try{jsonpatch[_0x6cae('0x2c')](_0x46e943,_0x1237e6,!![]);}catch(_0x189169){return BPromise[_0x6cae('0x2d')](_0x189169);}return _0x46e943[_0x6cae('0x2e')]();};}function saveUpdates(_0x1bf441,_0x4a603f){return function(_0x149dfa){if(_0x149dfa){return _0x149dfa[_0x6cae('0x2f')](_0x1bf441)['then'](function(_0x4024cc){return _0x4024cc;});}return null;};}function removeEntity(_0x16623c,_0x5c05cf){return function(_0x486230){if(_0x486230){return _0x486230[_0x6cae('0x30')]()[_0x6cae('0x19')](function(){_0x16623c[_0x6cae('0x24')](0xcc)[_0x6cae('0x25')]();});}};}function handleEntityNotFound(_0x33c7da,_0xdbd534){return function(_0x44560c){if(!_0x44560c){_0x33c7da['sendStatus'](0x194);}return _0x44560c;};}function handleError(_0x52429e,_0x1437dc){_0x1437dc=_0x1437dc||0x1f4;return function(_0x246b5c){logger[_0x6cae('0x20')](_0x246b5c[_0x6cae('0x31')]);if(_0x246b5c[_0x6cae('0x32')]){delete _0x246b5c[_0x6cae('0x32')];}_0x52429e['status'](_0x1437dc)['send'](_0x246b5c);};}exports['index']=function(_0x5ab25c,_0x3d8c92){var _0x13c61d={},_0x2f2a34={},_0xb64d3d={'count':0x0,'rows':[]};var _0x18b50d=_[_0x6cae('0x33')](db[_0x6cae('0x34')][_0x6cae('0x35')],function(_0x3561e9){return{'name':_0x3561e9['fieldName'],'type':_0x3561e9['type'][_0x6cae('0x36')]};});_0x2f2a34[_0x6cae('0x37')]=_[_0x6cae('0x33')](_0x18b50d,'name');_0x2f2a34[_0x6cae('0x38')]=_[_0x6cae('0x39')](_0x5ab25c[_0x6cae('0x38')]);_0x2f2a34[_0x6cae('0x3a')]=_[_0x6cae('0x3b')](_0x2f2a34[_0x6cae('0x37')],_0x2f2a34['query']);_0x13c61d[_0x6cae('0x3c')]=_[_0x6cae('0x3b')](_0x2f2a34[_0x6cae('0x37')],qs[_0x6cae('0x3d')](_0x5ab25c['query'][_0x6cae('0x3d')]));_0x13c61d['attributes']=_0x13c61d['attributes'][_0x6cae('0x3e')]?_0x13c61d[_0x6cae('0x3c')]:_0x2f2a34[_0x6cae('0x37')];if(!_0x5ab25c[_0x6cae('0x38')][_0x6cae('0x3f')](_0x6cae('0x40'))){_0x13c61d['limit']=qs[_0x6cae('0x29')](_0x5ab25c[_0x6cae('0x38')]['limit']);_0x13c61d[_0x6cae('0x28')]=qs[_0x6cae('0x28')](_0x5ab25c['query'][_0x6cae('0x28')]);}_0x13c61d['order']=qs[_0x6cae('0x41')](_0x5ab25c[_0x6cae('0x38')][_0x6cae('0x41')]);_0x13c61d[_0x6cae('0x42')]=qs[_0x6cae('0x3a')](_['pick'](_0x5ab25c[_0x6cae('0x38')],_0x2f2a34[_0x6cae('0x3a')]));if(_0x5ab25c[_0x6cae('0x38')][_0x6cae('0x43')]){_0x13c61d['where']=_[_0x6cae('0x44')](_0x13c61d[_0x6cae('0x42')],{'$or':_[_0x6cae('0x33')](_0x18b50d,function(_0x4a76de){if(_0x4a76de['type']!==_0x6cae('0x45')){var _0x1758ca={};_0x1758ca[_0x4a76de[_0x6cae('0x32')]]={'$like':'%'+_0x5ab25c[_0x6cae('0x38')][_0x6cae('0x43')]+'%'};return _0x1758ca;}})});}_0x13c61d=_[_0x6cae('0x44')]({},_0x13c61d,_0x5ab25c[_0x6cae('0x46')]);var _0x270638={'where':_0x13c61d['where']};return db['Network'][_0x6cae('0x27')](_0x270638)[_0x6cae('0x19')](function(_0x1aa273){_0xb64d3d[_0x6cae('0x27')]=_0x1aa273;if(_0x5ab25c[_0x6cae('0x38')][_0x6cae('0x47')]){_0x13c61d[_0x6cae('0x48')]=[{'all':!![]}];}return db[_0x6cae('0x34')][_0x6cae('0x49')](_0x13c61d);})['then'](function(_0xb249a6){_0xb64d3d[_0x6cae('0x4a')]=_0xb249a6;return _0xb64d3d;})[_0x6cae('0x19')](respondWithFilteredResult(_0x3d8c92,_0x13c61d))['catch'](handleError(_0x3d8c92,null));};exports[_0x6cae('0x4b')]=function(_0x59a48d,_0x2319d6){var _0x3b4432={'raw':!![],'where':{'id':_0x59a48d[_0x6cae('0x4c')]['id']}},_0x43529b={};_0x43529b[_0x6cae('0x37')]=_[_0x6cae('0x39')](db[_0x6cae('0x34')][_0x6cae('0x35')]);_0x43529b['query']=_['keys'](_0x59a48d['query']);_0x43529b['filters']=_[_0x6cae('0x3b')](_0x43529b[_0x6cae('0x37')],_0x43529b[_0x6cae('0x38')]);_0x3b4432[_0x6cae('0x3c')]=_[_0x6cae('0x3b')](_0x43529b[_0x6cae('0x37')],qs[_0x6cae('0x3d')](_0x59a48d['query']['fields']));_0x3b4432[_0x6cae('0x3c')]=_0x3b4432['attributes'][_0x6cae('0x3e')]?_0x3b4432[_0x6cae('0x3c')]:_0x43529b[_0x6cae('0x37')];if(_0x59a48d[_0x6cae('0x38')][_0x6cae('0x47')]){_0x3b4432['include']=[{'all':!![]}];}_0x3b4432=_[_0x6cae('0x44')]({},_0x3b4432,_0x59a48d[_0x6cae('0x46')]);return db[_0x6cae('0x34')][_0x6cae('0x4d')](_0x3b4432)[_0x6cae('0x19')](handleEntityNotFound(_0x2319d6,null))[_0x6cae('0x19')](respondWithResult(_0x2319d6,null))[_0x6cae('0x23')](handleError(_0x2319d6,null));};exports[_0x6cae('0x4e')]=function(_0x252792,_0x4123a4,_0x54273f){var _0x5b9c07;return db[_0x6cae('0x4f')][_0x6cae('0x50')](function(_0x5641e0){return db['Network']['create'](_0x252792[_0x6cae('0x51')],{'raw':!![]})['then'](function(_0x1fbbcf){_0x5b9c07=_0x1fbbcf;return db[_0x6cae('0x34')][_0x6cae('0x49')]({'where':{'type':_0x252792[_0x6cae('0x51')][_0x6cae('0x52')]},'raw':!![]});})[_0x6cae('0x19')](function(_0x4dfb6c){if(_0x5b9c07[_0x6cae('0x52')][_0x6cae('0x53')]()==_0x6cae('0x54')){var _0x479d31=fs['readFileSync'](path[_0x6cae('0x55')](config['root'],'server/files/templates/stun_multiple.ejs'),_0x6cae('0x56'));var _0x11967e=ejs[_0x6cae('0x57')](_0x479d31,{'networks':_0x4dfb6c||[]});fs[_0x6cae('0x58')]('/etc/asterisk/stun_xcally.conf',_0x11967e);return respondWithRpcPromise(_0x6cae('0x59'),_0x6cae('0x4e'),{'module':_0x6cae('0x5a')});}else if(_0x5b9c07[_0x6cae('0x52')][_0x6cae('0x53')]()==_0x6cae('0x5b')){var _0x1efd66=fs[_0x6cae('0x5c')](path[_0x6cae('0x55')](config['root'],_0x6cae('0x5d')),_0x6cae('0x56'));var _0x387fd2=ejs['render'](_0x1efd66,{'networks':_0x4dfb6c||[]});fs[_0x6cae('0x58')]('/etc/asterisk/turn_xcally.conf',_0x387fd2);return respondWithRpcPromise('Reload',_0x6cae('0x4e'),{'module':_0x6cae('0x5a')});}else{var _0x2f35b7=fs[_0x6cae('0x5c')](path['join'](config[_0x6cae('0x5e')],'server/files/templates/network.ejs'),'utf8');var _0x3c189d=ejs[_0x6cae('0x57')](_0x2f35b7,{'networks':_0x4dfb6c||[]});fs[_0x6cae('0x58')](util[_0x6cae('0x5f')]('/etc/asterisk/sip_xcally_%s.conf',_0x252792[_0x6cae('0x51')]['type']['toLowerCase']()),_0x3c189d);return respondWithRpcPromise(_0x6cae('0x59'),_0x6cae('0x4e'),{'module':_0x6cae('0x60')});}return null;})[_0x6cae('0x19')](function(){return _0x5b9c07;});})['then'](respondWithResult(_0x4123a4,0xc9))[_0x6cae('0x23')](handleError(_0x4123a4,null));};exports[_0x6cae('0x2f')]=function(_0x33b216,_0x3d2454,_0x157475){var _0x181cb5;return db['sequelize'][_0x6cae('0x50')](function(_0x19146f){return db['Network'][_0x6cae('0x4d')]({'where':{'id':_0x33b216[_0x6cae('0x4c')]['id']}})[_0x6cae('0x19')](handleEntityNotFound(_0x3d2454,null))[_0x6cae('0x19')](saveUpdates(_0x33b216[_0x6cae('0x51')],null))[_0x6cae('0x19')](function(_0x56c312){if(_0x56c312){_0x181cb5=_0x56c312;return db[_0x6cae('0x34')][_0x6cae('0x49')]({'where':{'type':_0x181cb5[_0x6cae('0x52')]},'raw':!![]});}return null;})[_0x6cae('0x19')](function(_0x185d61){if(_0x181cb5[_0x6cae('0x52')]['toUpperCase']()==_0x6cae('0x54')){var _0x50c299=fs[_0x6cae('0x5c')](path[_0x6cae('0x55')](config[_0x6cae('0x5e')],_0x6cae('0x61')),_0x6cae('0x56'));var _0xea0042=ejs['render'](_0x50c299,{'networks':_0x185d61||[]});fs[_0x6cae('0x58')](_0x6cae('0x62'),_0xea0042);return respondWithRpcPromise(_0x6cae('0x59'),_0x6cae('0x2f'),{'module':'res_stun_monitor.so'});}else if(_0x181cb5['type'][_0x6cae('0x53')]()==_0x6cae('0x5b')){var _0x3a277f=fs[_0x6cae('0x5c')](path['join'](config[_0x6cae('0x5e')],_0x6cae('0x5d')),_0x6cae('0x56'));var _0x406ccd=ejs[_0x6cae('0x57')](_0x3a277f,{'networks':_0x185d61||[]});fs[_0x6cae('0x58')](_0x6cae('0x63'),_0x406ccd);return respondWithRpcPromise('Reload',_0x6cae('0x2f'),{'module':_0x6cae('0x5a')});}else{var _0x449a44=fs['readFileSync'](path[_0x6cae('0x55')](config['root'],_0x6cae('0x64')),_0x6cae('0x56'));var _0x2306ea=ejs[_0x6cae('0x57')](_0x449a44,{'networks':_0x185d61||[]});fs[_0x6cae('0x58')](util[_0x6cae('0x5f')](_0x6cae('0x65'),_0x33b216[_0x6cae('0x51')][_0x6cae('0x52')][_0x6cae('0x66')]()),_0x2306ea);return respondWithRpcPromise(_0x6cae('0x59'),_0x6cae('0x2f'),{'module':_0x6cae('0x60')});}return null;})[_0x6cae('0x19')](function(_0x131fa6){if(_0x131fa6){return _0x181cb5;}return null;});})[_0x6cae('0x19')](respondWithResult(_0x3d2454,null))[_0x6cae('0x23')](handleError(_0x3d2454,null));};exports[_0x6cae('0x30')]=function(_0x2a5ae5,_0x47ceb9,_0x15df5b){var _0xfb1976;return db[_0x6cae('0x34')][_0x6cae('0x4d')]({'where':{'id':_0x2a5ae5[_0x6cae('0x4c')]['id']}})[_0x6cae('0x19')](function(_0x2f53ef){_0xfb1976=_0x2f53ef;return _0x2f53ef;})[_0x6cae('0x19')](handleEntityNotFound(_0x47ceb9,null))['then'](removeEntity(_0x47ceb9,null))[_0x6cae('0x19')](function(){if(_0xfb1976){return db[_0x6cae('0x34')][_0x6cae('0x49')]({'where':{'type':_0xfb1976['type']},'raw':!![]});}})[_0x6cae('0x19')](function(_0x5d9403){if(_0xfb1976[_0x6cae('0x52')][_0x6cae('0x53')]()==_0x6cae('0x54')){var _0x348d30=fs[_0x6cae('0x5c')](path[_0x6cae('0x55')](config['root'],_0x6cae('0x61')),_0x6cae('0x56'));var _0xdd8ba9=ejs[_0x6cae('0x57')](_0x348d30,{'networks':_0x5d9403||[]});fs[_0x6cae('0x58')]('/etc/asterisk/stun_xcally.conf',_0xdd8ba9);return respondWithRpcPromise('Reload',_0x6cae('0x30'),{'module':_0x6cae('0x5a')});}else if(_0xfb1976[_0x6cae('0x52')][_0x6cae('0x53')]()==_0x6cae('0x5b')){var _0xbe60c1=fs['readFileSync'](path[_0x6cae('0x55')](config[_0x6cae('0x5e')],'server/files/templates/turn_multiple.ejs'),'utf8');var _0xce8042=ejs['render'](_0xbe60c1,{'networks':_0x5d9403||[]});fs['writeFileSync'](_0x6cae('0x63'),_0xce8042);return respondWithRpcPromise(_0x6cae('0x59'),_0x6cae('0x30'),{'module':'res_stun_monitor.so'});}else{var _0x534d58=fs[_0x6cae('0x5c')](path[_0x6cae('0x55')](config[_0x6cae('0x5e')],'server/files/templates/network.ejs'),_0x6cae('0x56'));var _0x34161e=ejs[_0x6cae('0x57')](_0x534d58,{'networks':_0x5d9403||[]});fs[_0x6cae('0x58')](util[_0x6cae('0x5f')](_0x6cae('0x65'),_0x2a5ae5['body']['type']['toLowerCase']()),_0x34161e);return respondWithRpcPromise(_0x6cae('0x59'),'destroy',{'module':_0x6cae('0x60')});}return null;})['catch'](handleError(_0x47ceb9,null));};
\ No newline at end of file
diff --git a/server/api/network/network.model.js b/server/api/network/network.model.js
index f800594..8ec154c 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 _0xce1e=['path','rimraf','exports','Network','network','util','../../config/logger','api','moment','bluebird'];(function(_0x6cf19c,_0x2f3f02){var _0xce14f3=function(_0x474587){while(--_0x474587){_0x6cf19c['push'](_0x6cf19c['shift']());}};_0xce14f3(++_0x2f3f02);}(_0xce1e,0x145));var _0xece1=function(_0x22cad5,_0x16a1a6){_0x22cad5=_0x22cad5-0x0;var _0x3d2861=_0xce1e[_0x22cad5];return _0x3d2861;};'use strict';var _=require('lodash');var util=require(_0xece1('0x0'));var logger=require(_0xece1('0x1'))(_0xece1('0x2'));var moment=require(_0xece1('0x3'));var BPromise=require(_0xece1('0x4'));var rp=require('request-promise');var fs=require('fs');var path=require(_0xece1('0x5'));var rimraf=require(_0xece1('0x6'));var config=require('../../config/environment');var attributes=require('./network.attributes');module[_0xece1('0x7')]=function(_0x1e2f38,_0x4de7dd){return _0x1e2f38['define'](_0xece1('0x8'),attributes,{'tableName':_0xece1('0x9'),'paranoid':![],'indexes':[],'timestamps':!![]});};
\ No newline at end of file
+var _0xf8e1=['exports','define','network','lodash','util','../../config/logger','api','bluebird','path','rimraf','../../config/environment','./network.attributes'];(function(_0x1f3344,_0x1e290e){var _0x25617b=function(_0x1fe5a4){while(--_0x1fe5a4){_0x1f3344['push'](_0x1f3344['shift']());}};_0x25617b(++_0x1e290e);}(_0xf8e1,0x1ef));var _0x1f8e=function(_0x5b888b,_0x35d5f9){_0x5b888b=_0x5b888b-0x0;var _0x115000=_0xf8e1[_0x5b888b];return _0x115000;};'use strict';var _=require(_0x1f8e('0x0'));var util=require(_0x1f8e('0x1'));var logger=require(_0x1f8e('0x2'))(_0x1f8e('0x3'));var moment=require('moment');var BPromise=require(_0x1f8e('0x4'));var rp=require('request-promise');var fs=require('fs');var path=require(_0x1f8e('0x5'));var rimraf=require(_0x1f8e('0x6'));var config=require(_0x1f8e('0x7'));var attributes=require(_0x1f8e('0x8'));module[_0x1f8e('0x9')]=function(_0x108380,_0x729327){return _0x108380[_0x1f8e('0xa')]('Network',attributes,{'tableName':_0x1f8e('0xb'),'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 a636851..c7dca70 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 _0xb8b0=['request','request\x20sent','debug','Network,\x20%s,\x20%s,\x20%s','stringify','error','code','Network,\x20%s,\x20%s','message','info','catch','lodash','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','../../config/environment','http'];(function(_0x3cf713,_0x3901a9){var _0x174d42=function(_0x3bff25){while(--_0x3bff25){_0x3cf713['push'](_0x3cf713['shift']());}};_0x174d42(++_0x3901a9);}(_0xb8b0,0x1d7));var _0x0b8b=function(_0x48721b,_0x2063b7){_0x48721b=_0x48721b-0x0;var _0x5e2426=_0xb8b0[_0x48721b];return _0x5e2426;};'use strict';var _=require(_0x0b8b('0x0'));var util=require('util');var moment=require('moment');var BPromise=require(_0x0b8b('0x1'));var rs=require(_0x0b8b('0x2'));var fs=require('fs');var Redis=require(_0x0b8b('0x3'));var db=require(_0x0b8b('0x4'))['db'];var utils=require(_0x0b8b('0x5'));var logger=require(_0x0b8b('0x6'))('rpc');var config=require(_0x0b8b('0x7'));var jayson=require('jayson/promise');var client=jayson['client'][_0x0b8b('0x8')]({'port':0x232a});function respondWithRpcPromise(_0x5c43da,_0x5dc635,_0x2b9de6){return new BPromise(function(_0x57a50f,_0x3c8050){return client[_0x0b8b('0x9')](_0x5c43da,_0x2b9de6)['then'](function(_0x238483){logger['info']('Network,\x20%s,\x20%s',_0x5dc635,_0x0b8b('0xa'));logger[_0x0b8b('0xb')](_0x0b8b('0xc'),_0x5dc635,_0x0b8b('0xa'),JSON[_0x0b8b('0xd')](_0x238483));if(_0x238483[_0x0b8b('0xe')]){if(_0x238483[_0x0b8b('0xe')][_0x0b8b('0xf')]===0x1f4){logger[_0x0b8b('0xe')](_0x0b8b('0x10'),_0x5dc635,_0x238483['error'][_0x0b8b('0x11')]);return _0x3c8050(_0x238483[_0x0b8b('0xe')]['message']);}logger[_0x0b8b('0xe')](_0x0b8b('0x10'),_0x5dc635,_0x238483[_0x0b8b('0xe')][_0x0b8b('0x11')]);return _0x57a50f(_0x238483['error']['message']);}else{logger[_0x0b8b('0x12')](_0x0b8b('0x10'),_0x5dc635,_0x0b8b('0xa'));_0x57a50f(_0x238483['result']['message']);}})[_0x0b8b('0x13')](function(_0x2e2009){logger[_0x0b8b('0xe')](_0x0b8b('0x10'),_0x5dc635,_0x2e2009);_0x3c8050(_0x2e2009);});});}
\ No newline at end of file
+var _0x926d=['then','info','request\x20sent','debug','stringify','error','code','message','Network,\x20%s,\x20%s','result','catch','lodash','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','client'];(function(_0x18e3b6,_0x247934){var _0x361973=function(_0x219afa){while(--_0x219afa){_0x18e3b6['push'](_0x18e3b6['shift']());}};_0x361973(++_0x247934);}(_0x926d,0x1ee));var _0xd926=function(_0x1fb4a0,_0x48a602){_0x1fb4a0=_0x1fb4a0-0x0;var _0x1094e7=_0x926d[_0x1fb4a0];return _0x1094e7;};'use strict';var _=require(_0xd926('0x0'));var util=require('util');var moment=require('moment');var BPromise=require('bluebird');var rs=require(_0xd926('0x1'));var fs=require('fs');var Redis=require(_0xd926('0x2'));var db=require(_0xd926('0x3'))['db'];var utils=require(_0xd926('0x4'));var logger=require(_0xd926('0x5'))(_0xd926('0x6'));var config=require(_0xd926('0x7'));var jayson=require(_0xd926('0x8'));var client=jayson[_0xd926('0x9')]['http']({'port':0x232a});function respondWithRpcPromise(_0x3fae32,_0x2efd9b,_0x2d9f49){return new BPromise(function(_0x65bb08,_0x483f55){return client['request'](_0x3fae32,_0x2d9f49)[_0xd926('0xa')](function(_0x7a6904){logger[_0xd926('0xb')]('Network,\x20%s,\x20%s',_0x2efd9b,_0xd926('0xc'));logger[_0xd926('0xd')]('Network,\x20%s,\x20%s,\x20%s',_0x2efd9b,_0xd926('0xc'),JSON[_0xd926('0xe')](_0x7a6904));if(_0x7a6904[_0xd926('0xf')]){if(_0x7a6904[_0xd926('0xf')][_0xd926('0x10')]===0x1f4){logger[_0xd926('0xf')]('Network,\x20%s,\x20%s',_0x2efd9b,_0x7a6904['error'][_0xd926('0x11')]);return _0x483f55(_0x7a6904[_0xd926('0xf')][_0xd926('0x11')]);}logger['error'](_0xd926('0x12'),_0x2efd9b,_0x7a6904[_0xd926('0xf')][_0xd926('0x11')]);return _0x65bb08(_0x7a6904['error'][_0xd926('0x11')]);}else{logger[_0xd926('0xb')](_0xd926('0x12'),_0x2efd9b,_0xd926('0xc'));_0x65bb08(_0x7a6904[_0xd926('0x13')][_0xd926('0x11')]);}})[_0xd926('0x14')](function(_0x364ace){logger['error'](_0xd926('0x12'),_0x2efd9b,_0x364ace);_0x483f55(_0x364ace);});});}
\ No newline at end of file
diff --git a/server/api/openchannelAccount/index.js b/server/api/openchannelAccount/index.js
index ead7ee0..1aeedb5 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 _0xc643=['multer','path','connect-timeout','express','Router','../../components/interaction/service','../../config/environment','./openchannelAccount.controller','get','isAuthenticated','index','/describe','show','/:id/dispositions','getDispositions','/:id/canned_answers','/:id/applications','getApplications','/:id/interactions','/:id/users','getAgents','create','post','addDisposition','/:id/notify','notify','send','put','/:id','update','delete','destroy','removeDispositions','removeAnswers','removeAgents','exports'];(function(_0x1b2ff7,_0x12a034){var _0x31656a=function(_0x1165a5){while(--_0x1165a5){_0x1b2ff7['push'](_0x1b2ff7['shift']());}};_0x31656a(++_0x12a034);}(_0xc643,0x1d4));var _0x3c64=function(_0x29ccbf,_0x5597e1){_0x29ccbf=_0x29ccbf-0x0;var _0x56c110=_0xc643[_0x29ccbf];return _0x56c110;};'use strict';var multer=require(_0x3c64('0x0'));var util=require('util');var path=require(_0x3c64('0x1'));var timeout=require(_0x3c64('0x2'));var express=require(_0x3c64('0x3'));var router=express[_0x3c64('0x4')]();var auth=require('../../components/auth/service');var interaction=require(_0x3c64('0x5'));var config=require(_0x3c64('0x6'));var controller=require(_0x3c64('0x7'));router[_0x3c64('0x8')]('/',auth[_0x3c64('0x9')](),controller[_0x3c64('0xa')]);router['get'](_0x3c64('0xb'),auth[_0x3c64('0x9')](),controller['describe']);router[_0x3c64('0x8')]('/:id',auth['isAuthenticated'](),controller[_0x3c64('0xc')]);router[_0x3c64('0x8')](_0x3c64('0xd'),auth[_0x3c64('0x9')](),controller[_0x3c64('0xe')]);router['get'](_0x3c64('0xf'),auth[_0x3c64('0x9')](),controller['getAnswers']);router[_0x3c64('0x8')](_0x3c64('0x10'),auth['isAuthenticated'](),controller[_0x3c64('0x11')]);router[_0x3c64('0x8')](_0x3c64('0x12'),auth[_0x3c64('0x9')](),controller['getInteractions']);router[_0x3c64('0x8')](_0x3c64('0x13'),auth[_0x3c64('0x9')](),controller[_0x3c64('0x14')]);router['post']('/',auth['isAuthenticated'](),controller[_0x3c64('0x15')]);router[_0x3c64('0x16')](_0x3c64('0xd'),auth[_0x3c64('0x9')](),controller[_0x3c64('0x17')]);router[_0x3c64('0x16')](_0x3c64('0xf'),auth[_0x3c64('0x9')](),controller['addAnswer']);router['post'](_0x3c64('0x18'),controller[_0x3c64('0x19')]);router[_0x3c64('0x16')](_0x3c64('0x10'),auth[_0x3c64('0x9')](),controller['addApplications']);router[_0x3c64('0x16')](_0x3c64('0x13'),auth[_0x3c64('0x9')](),controller['addAgents']);router[_0x3c64('0x16')]('/:id/send',auth[_0x3c64('0x9')](),controller[_0x3c64('0x1a')]);router[_0x3c64('0x1b')](_0x3c64('0x1c'),auth[_0x3c64('0x9')](),controller[_0x3c64('0x1d')]);router[_0x3c64('0x1e')](_0x3c64('0x1c'),auth['isAuthenticated'](),controller[_0x3c64('0x1f')]);router[_0x3c64('0x1e')](_0x3c64('0xd'),auth['isAuthenticated'](),controller[_0x3c64('0x20')]);router[_0x3c64('0x1e')](_0x3c64('0xf'),auth[_0x3c64('0x9')](),controller[_0x3c64('0x21')]);router[_0x3c64('0x1e')]('/:id/users',auth[_0x3c64('0x9')](),controller[_0x3c64('0x22')]);module[_0x3c64('0x23')]=router;
\ No newline at end of file
+var _0xf1b0=['/:id/canned_answers','getAnswers','/:id/applications','/:id/interactions','getInteractions','getAgents','post','create','addDisposition','addAnswer','notify','addApplications','/:id/users','/:id/send','send','put','/:id','update','destroy','removeDispositions','delete','exports','multer','connect-timeout','express','Router','../../components/auth/service','../../components/interaction/service','../../config/environment','./openchannelAccount.controller','get','index','/describe','describe','isAuthenticated','show','/:id/dispositions','getDispositions'];(function(_0x2f4155,_0x2a2007){var _0x116f3c=function(_0x1d7fb7){while(--_0x1d7fb7){_0x2f4155['push'](_0x2f4155['shift']());}};_0x116f3c(++_0x2a2007);}(_0xf1b0,0xae));var _0x0f1b=function(_0x33a694,_0x9b6640){_0x33a694=_0x33a694-0x0;var _0x41ff01=_0xf1b0[_0x33a694];return _0x41ff01;};'use strict';var multer=require(_0x0f1b('0x0'));var util=require('util');var path=require('path');var timeout=require(_0x0f1b('0x1'));var express=require(_0x0f1b('0x2'));var router=express[_0x0f1b('0x3')]();var auth=require(_0x0f1b('0x4'));var interaction=require(_0x0f1b('0x5'));var config=require(_0x0f1b('0x6'));var controller=require(_0x0f1b('0x7'));router[_0x0f1b('0x8')]('/',auth['isAuthenticated'](),controller[_0x0f1b('0x9')]);router['get'](_0x0f1b('0xa'),auth['isAuthenticated'](),controller[_0x0f1b('0xb')]);router[_0x0f1b('0x8')]('/:id',auth[_0x0f1b('0xc')](),controller[_0x0f1b('0xd')]);router['get'](_0x0f1b('0xe'),auth['isAuthenticated'](),controller[_0x0f1b('0xf')]);router[_0x0f1b('0x8')](_0x0f1b('0x10'),auth[_0x0f1b('0xc')](),controller[_0x0f1b('0x11')]);router['get'](_0x0f1b('0x12'),auth[_0x0f1b('0xc')](),controller['getApplications']);router[_0x0f1b('0x8')](_0x0f1b('0x13'),auth[_0x0f1b('0xc')](),controller[_0x0f1b('0x14')]);router[_0x0f1b('0x8')]('/:id/users',auth['isAuthenticated'](),controller[_0x0f1b('0x15')]);router[_0x0f1b('0x16')]('/',auth[_0x0f1b('0xc')](),controller[_0x0f1b('0x17')]);router['post'](_0x0f1b('0xe'),auth['isAuthenticated'](),controller[_0x0f1b('0x18')]);router[_0x0f1b('0x16')](_0x0f1b('0x10'),auth[_0x0f1b('0xc')](),controller[_0x0f1b('0x19')]);router[_0x0f1b('0x16')]('/:id/notify',controller[_0x0f1b('0x1a')]);router[_0x0f1b('0x16')](_0x0f1b('0x12'),auth[_0x0f1b('0xc')](),controller[_0x0f1b('0x1b')]);router['post'](_0x0f1b('0x1c'),auth[_0x0f1b('0xc')](),controller['addAgents']);router[_0x0f1b('0x16')](_0x0f1b('0x1d'),auth[_0x0f1b('0xc')](),controller[_0x0f1b('0x1e')]);router[_0x0f1b('0x1f')](_0x0f1b('0x20'),auth[_0x0f1b('0xc')](),controller[_0x0f1b('0x21')]);router['delete']('/:id',auth['isAuthenticated'](),controller[_0x0f1b('0x22')]);router['delete']('/:id/dispositions',auth[_0x0f1b('0xc')](),controller[_0x0f1b('0x23')]);router[_0x0f1b('0x24')](_0x0f1b('0x10'),auth[_0x0f1b('0xc')](),controller['removeAnswers']);router['delete'](_0x0f1b('0x1c'),auth['isAuthenticated'](),controller['removeAgents']);module[_0x0f1b('0x25')]=router;
\ No newline at end of file
diff --git a/server/api/openchannelAccount/openchannelAccount.attributes.js b/server/api/openchannelAccount/openchannelAccount.attributes.js
index f530cfd..47216aa 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 _0x5148=['sequelize','randomstring','exports','name','STRING','generate','TEXT','Account:\x20{{account.name}} {{#queue}}Queue:\x20{{queue.name}} {{/queue}}From\x20:\x20{{from}}','BOOLEAN','INTEGER','Status\x20to\x20put\x20when\x20mandatory\x20disposition\x20is\x20enabled','Enabled/disables\x20mandatory\x20dispo\x20on\x20a\x20queue','mandatoryDispositionPauseId'];(function(_0x21bfce,_0x4c2c80){var _0x1cd9e0=function(_0x3fb74c){while(--_0x3fb74c){_0x21bfce['push'](_0x21bfce['shift']());}};_0x1cd9e0(++_0x4c2c80);}(_0x5148,0x1ba));var _0x8514=function(_0x419b6a,_0x265b43){_0x419b6a=_0x419b6a-0x0;var _0x229232=_0x5148[_0x419b6a];return _0x229232;};'use strict';var Sequelize=require(_0x8514('0x0'));var rs=require(_0x8514('0x1'));module[_0x8514('0x2')]={'name':{'type':Sequelize['STRING'],'unique':_0x8514('0x3'),'allowNull':![]},'description':{'type':Sequelize[_0x8514('0x4')]},'token':{'type':Sequelize['STRING'],'defaultValue':function(){return rs[_0x8514('0x5')]();}},'replyUri':{'type':Sequelize[_0x8514('0x4')],'validate':{'isUrl':!![]}},'key':{'type':Sequelize[_0x8514('0x4')],'allowNull':![]},'notificationTemplate':{'type':Sequelize[_0x8514('0x6')],'defaultValue':function(){return _0x8514('0x7');}},'notificationSound':{'type':Sequelize[_0x8514('0x8')],'defaultValue':!![]},'notificationShake':{'type':Sequelize[_0x8514('0x8')],'defaultValue':![]},'waitForTheAssignedAgent':{'type':Sequelize[_0x8514('0x9')],'validate':{'min':0x1,'max':0x20c49b},'defaultValue':0xa},'mapKey':{'type':Sequelize[_0x8514('0x4')]},'queueTransfer':{'type':Sequelize[_0x8514('0x8')],'defaultValue':![]},'queueTransferTimeout':{'type':Sequelize[_0x8514('0x9')],'validate':{'min':0x1,'max':0x20c49b},'defaultValue':0x12c},'agentTransfer':{'type':Sequelize[_0x8514('0x8')],'defaultValue':![]},'agentTransferTimeout':{'type':Sequelize[_0x8514('0x9')],'validate':{'min':0x1,'max':0x20c49b},'defaultValue':0x12c},'mandatoryDispositionPauseId':{'type':Sequelize[_0x8514('0x9')],'allowNull':!![],'defaultValue':null,'comment':_0x8514('0xa')},'mandatoryDisposition':{'type':Sequelize['BOOLEAN'],'defaultValue':![],'comment':_0x8514('0xb'),'set':function(_0x307da7){if(!_0x307da7)this['setDataValue'](_0x8514('0xc'),null);this['setDataValue']('mandatoryDisposition',_0x307da7);}}};
\ No newline at end of file
+var _0x5e5b=['mandatoryDispositionPauseId','setDataValue','mandatoryDisposition','sequelize','randomstring','exports','STRING','name','generate','TEXT','BOOLEAN','INTEGER','Status\x20to\x20put\x20when\x20mandatory\x20disposition\x20is\x20enabled','Enabled/disables\x20mandatory\x20dispo\x20on\x20a\x20queue'];(function(_0x17c2ae,_0x27031c){var _0x1216a5=function(_0x1004cf){while(--_0x1004cf){_0x17c2ae['push'](_0x17c2ae['shift']());}};_0x1216a5(++_0x27031c);}(_0x5e5b,0xab));var _0xb5e5=function(_0x2f4336,_0x356087){_0x2f4336=_0x2f4336-0x0;var _0x2c6999=_0x5e5b[_0x2f4336];return _0x2c6999;};'use strict';var Sequelize=require(_0xb5e5('0x0'));var rs=require(_0xb5e5('0x1'));module[_0xb5e5('0x2')]={'name':{'type':Sequelize[_0xb5e5('0x3')],'unique':_0xb5e5('0x4'),'allowNull':![]},'description':{'type':Sequelize[_0xb5e5('0x3')]},'token':{'type':Sequelize[_0xb5e5('0x3')],'defaultValue':function(){return rs[_0xb5e5('0x5')]();}},'replyUri':{'type':Sequelize[_0xb5e5('0x3')],'validate':{'isUrl':!![]}},'key':{'type':Sequelize[_0xb5e5('0x3')],'allowNull':![]},'notificationTemplate':{'type':Sequelize[_0xb5e5('0x6')],'defaultValue':function(){return'Account:\x20{{account.name}} {{#queue}}Queue:\x20{{queue.name}} {{/queue}}From\x20:\x20{{from}}';}},'notificationSound':{'type':Sequelize[_0xb5e5('0x7')],'defaultValue':!![]},'notificationShake':{'type':Sequelize[_0xb5e5('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[_0xb5e5('0x8')],'validate':{'min':0x1,'max':0x20c49b},'defaultValue':0x12c},'agentTransfer':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'agentTransferTimeout':{'type':Sequelize[_0xb5e5('0x8')],'validate':{'min':0x1,'max':0x20c49b},'defaultValue':0x12c},'mandatoryDispositionPauseId':{'type':Sequelize[_0xb5e5('0x8')],'allowNull':!![],'defaultValue':null,'comment':_0xb5e5('0x9')},'mandatoryDisposition':{'type':Sequelize['BOOLEAN'],'defaultValue':![],'comment':_0xb5e5('0xa'),'set':function(_0x26713d){if(!_0x26713d)this['setDataValue'](_0xb5e5('0xb'),null);this[_0xb5e5('0xc')](_0xb5e5('0xd'),_0x26713d);}}};
\ No newline at end of file
diff --git a/server/api/openchannelAccount/openchannelAccount.controller.js b/server/api/openchannelAccount/openchannelAccount.controller.js
index 6aff928..1525b8f 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 _0x3019=['util','path','sox','to-csv','ejs','lodash','desk.js','querystring','papaparse','ioredis','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/utils','../../config/environment','../../mysqldb','redis','defaults','socket.io-emitter','./openchannelAccount.socket','jayson/promise','client','http','Sequelize','ValidationError','OpenchannelAccount,\x20%s,\x20%s','request\x20sent','debug','OpenchannelAccount,\x20%s,\x20%s,\x20%s','error','code','message','info','sendStatus','end','status','json','offset','set','Content-Range','apply','reject','save','update','destroy','then','OpenchannelAccounts','UserProfileResource','stack','name','index','Pause','mandatoryDispositionPause','map','fieldName','type','key','model','query','keys','attributes','intersection','fields','length','hasOwnProperty','nolimit','limit','sort','where','filters','pick','filter','merge','VIRTUAL','options','OpenchannelAccount','count','include','rows','rawAttributes','includeAll','catch','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','params','find','describe','addDisposition','OpnechannelAccountId','Disposition','getDispositions','findOne','order','OpenchannelAccountId','findAll','removeDispositions','ids','addAnswer','CannedAnswer','getAnswers','removeAnswers','notify','openchannel','CmContact','no\x20available\x20attributes','difference','updatedAt','CompanyId','ListId','isNil','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','DESC','OpenchannelApplication','Applications','account','applications','orderBy','priority','asc','contact','firstName','lastName','threadId','OpenchannelInteraction','externalUrl','ContactId','messageId','interaction','created','autoclose','push','unmanaged','AttachmentId','UserId','User','agent','waitForTheAssignedAgent','*,*,*,*','forcedOwnership','startRouting','Start','EventManager','addApplications','sequelize','transaction','bulkCreate','findAndCountAll','getApplications','Contact','Owner','fullname','Tags','color','tag','addAgents','spread','emit','userOpenchannelAccount:save','removeAgents','isArray','userOpenchannelAccount:remove','getAgents','send','out','OpenchannelMessage','dataValues','Messages','html-pdf','rimraf','zip-dir','fast-json-patch','request-promise','moment','bluebird','mustache'];(function(_0x52b922,_0xd70829){var _0x62d6b6=function(_0x174422){while(--_0x174422){_0x52b922['push'](_0x52b922['shift']());}};_0x62d6b6(++_0xd70829);}(_0x3019,0xb8));var _0x9301=function(_0x552746,_0x1d5080){_0x552746=_0x552746-0x0;var _0x428756=_0x3019[_0x552746];return _0x428756;};'use strict';var pdf=require(_0x9301('0x0'));var emlformat=require('eml-format');var rimraf=require(_0x9301('0x1'));var zipdir=require(_0x9301('0x2'));var jsonpatch=require(_0x9301('0x3'));var rp=require(_0x9301('0x4'));var moment=require(_0x9301('0x5'));var BPromise=require(_0x9301('0x6'));var Mustache=require(_0x9301('0x7'));var util=require(_0x9301('0x8'));var path=require(_0x9301('0x9'));var sox=require(_0x9301('0xa'));var csv=require(_0x9301('0xb'));var ejs=require(_0x9301('0xc'));var fs=require('fs');var _=require(_0x9301('0xd'));var squel=require('squel');var crypto=require('crypto');var jsforce=require('jsforce');var deskjs=require(_0x9301('0xe'));var toCsv=require(_0x9301('0xb'));var querystring=require(_0x9301('0xf'));var Papa=require(_0x9301('0x10'));var Redis=require(_0x9301('0x11'));var authService=require('../../components/auth/service');var qs=require(_0x9301('0x12'));var as=require(_0x9301('0x13'));var hardwareService=require(_0x9301('0x14'));var logger=require('../../config/logger')('api');var utils=require(_0x9301('0x15'));var config=require(_0x9301('0x16'));var db=require(_0x9301('0x17'))['db'];config[_0x9301('0x18')]=_[_0x9301('0x19')](config['redis'],{'host':'localhost','port':0x18eb});var socket=require(_0x9301('0x1a'))(new Redis(config['redis']));require(_0x9301('0x1b'))['register'](socket);var jayson=require(_0x9301('0x1c'));var client=jayson[_0x9301('0x1d')][_0x9301('0x1e')]({'port':0x232c});var client9002=jayson['client'][_0x9301('0x1e')]({'port':0x232a});function checkPasswordPattern(_0x2bf81e,_0x5cfcff,_0x7b1fb0){if(_0x7b1fb0){var _0x202ee6=new RegExp(/(?=.*[a-z])(?=.*[A-Z])(?=.*[0-9])(?=.*[?!@#\$%\^&\*~\-_=+[{\]\}])(?=.{8,})/);if(_0x202ee6['test'](_0x5cfcff)){return _0x2bf81e;}else{throw new db[(_0x9301('0x1f'))][(_0x9301('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 _0x2bf81e;}}function respondWithRpcPromise(_0x1e78e3,_0x3b209a,_0x4ffe9e,_0x140b35){return new BPromise(function(_0x30bfbf,_0x3c3c27){var _0x3793f4=_0x140b35||client;return _0x3793f4['request'](_0x1e78e3,_0x4ffe9e)['then'](function(_0x25b81f){logger['info'](_0x9301('0x21'),_0x3b209a,_0x9301('0x22'));logger[_0x9301('0x23')](_0x9301('0x24'),_0x3b209a,_0x9301('0x22'),JSON['stringify'](_0x25b81f));if(_0x25b81f[_0x9301('0x25')]){if(_0x25b81f[_0x9301('0x25')][_0x9301('0x26')]===0x1f4){logger[_0x9301('0x25')](_0x9301('0x21'),_0x3b209a,_0x25b81f[_0x9301('0x25')][_0x9301('0x27')]);return _0x3c3c27(_0x25b81f[_0x9301('0x25')]['message']);}logger['error'](_0x9301('0x21'),_0x3b209a,_0x25b81f[_0x9301('0x25')][_0x9301('0x27')]);return _0x30bfbf(_0x25b81f[_0x9301('0x25')][_0x9301('0x27')]);}else{logger[_0x9301('0x28')](_0x9301('0x21'),_0x3b209a,_0x9301('0x22'));_0x30bfbf(_0x25b81f['result']['message']);}})['catch'](function(_0x32e8e8){logger[_0x9301('0x25')]('OpenchannelAccount,\x20%s,\x20%s',_0x3b209a,_0x32e8e8);_0x3c3c27(_0x32e8e8);});});}function respondWithStatusCode(_0x278f5c,_0x2d361f){_0x2d361f=_0x2d361f||0xcc;return function(_0x33d4c1){if(_0x33d4c1){return _0x278f5c[_0x9301('0x29')](_0x2d361f);}return _0x278f5c['status'](_0x2d361f)[_0x9301('0x2a')]();};}function respondWithResult(_0x56370f,_0x1a831e){_0x1a831e=_0x1a831e||0xc8;return function(_0x1e21a7){if(_0x1e21a7){return _0x56370f[_0x9301('0x2b')](_0x1a831e)[_0x9301('0x2c')](_0x1e21a7);}};}function respondWithFilteredResult(_0x2263a3,_0x553fc2){return function(_0x537b4b){if(_0x537b4b){var _0x438de5=_0x537b4b['count'],_0x54884b=_0x553fc2[_0x9301('0x2d')],_0x4083d1=_0x553fc2[_0x9301('0x2d')]+_0x553fc2['limit'],_0x15fc42;if(_0x4083d1>=_0x438de5){_0x4083d1=_0x438de5;_0x15fc42=0xc8;}else{_0x15fc42=0xce;}_0x2263a3[_0x9301('0x2b')](_0x15fc42);return _0x2263a3[_0x9301('0x2e')](_0x9301('0x2f'),_0x54884b+'-'+_0x4083d1+'/'+_0x438de5)[_0x9301('0x2c')](_0x537b4b);}return null;};}function patchUpdates(_0x310d97){return function(_0x1aebe6){try{jsonpatch[_0x9301('0x30')](_0x1aebe6,_0x310d97,!![]);}catch(_0x3547ed){return BPromise[_0x9301('0x31')](_0x3547ed);}return _0x1aebe6[_0x9301('0x32')]();};}function saveUpdates(_0x50e42f,_0x3703f0){return function(_0x44e4b2){if(_0x44e4b2){return _0x44e4b2[_0x9301('0x33')](_0x50e42f)['then'](function(_0x83f32b){return _0x83f32b;});}return null;};}function removeEntity(_0x40d71e,_0x420db8){return function(_0x3dc96e){if(_0x3dc96e){return _0x3dc96e[_0x9301('0x34')]()[_0x9301('0x35')](function(){var _0x5b7f14=_0x3dc96e['get']({'plain':!![]});var _0x1545b9=_0x9301('0x36');return db[_0x9301('0x37')][_0x9301('0x34')]({'where':{'type':_0x1545b9,'resourceId':_0x5b7f14['id']}})['then'](function(){return _0x3dc96e;});})[_0x9301('0x35')](function(){_0x40d71e['status'](0xcc)[_0x9301('0x2a')]();});}};}function handleEntityNotFound(_0x346747,_0x35bf2c){return function(_0x1f91ea){if(!_0x1f91ea){_0x346747[_0x9301('0x29')](0x194);}return _0x1f91ea;};}function handleError(_0x3c5ce9,_0x17508a){_0x17508a=_0x17508a||0x1f4;return function(_0x4cbc7d){logger[_0x9301('0x25')](_0x4cbc7d[_0x9301('0x38')]);if(_0x4cbc7d['name']){delete _0x4cbc7d[_0x9301('0x39')];}_0x3c5ce9[_0x9301('0x2b')](_0x17508a)['send'](_0x4cbc7d);};}exports[_0x9301('0x3a')]=function(_0x94a9ff,_0x5f5593){var _0x16f875={'include':[{'model':db[_0x9301('0x3b')],'as':_0x9301('0x3c')}]},_0x573d41={},_0x5c6102={'count':0x0,'rows':[]};var _0x1ef8bb=_[_0x9301('0x3d')](db['OpenchannelAccount']['rawAttributes'],function(_0x415173){return{'name':_0x415173[_0x9301('0x3e')],'type':_0x415173[_0x9301('0x3f')][_0x9301('0x40')]};});_0x573d41[_0x9301('0x41')]=_[_0x9301('0x3d')](_0x1ef8bb,'name');_0x573d41[_0x9301('0x42')]=_[_0x9301('0x43')](_0x94a9ff[_0x9301('0x42')]);_0x573d41['filters']=_['intersection'](_0x573d41['model'],_0x573d41['query']);_0x16f875[_0x9301('0x44')]=_[_0x9301('0x45')](_0x573d41['model'],qs[_0x9301('0x46')](_0x94a9ff[_0x9301('0x42')]['fields']));_0x16f875[_0x9301('0x44')]=_0x16f875[_0x9301('0x44')][_0x9301('0x47')]?_0x16f875[_0x9301('0x44')]:_0x573d41['model'];if(!_0x94a9ff[_0x9301('0x42')][_0x9301('0x48')](_0x9301('0x49'))){_0x16f875[_0x9301('0x4a')]=qs[_0x9301('0x4a')](_0x94a9ff['query'][_0x9301('0x4a')]);_0x16f875[_0x9301('0x2d')]=qs['offset'](_0x94a9ff[_0x9301('0x42')]['offset']);}_0x16f875['order']=qs['sort'](_0x94a9ff[_0x9301('0x42')][_0x9301('0x4b')]);_0x16f875[_0x9301('0x4c')]=qs[_0x9301('0x4d')](_[_0x9301('0x4e')](_0x94a9ff[_0x9301('0x42')],_0x573d41[_0x9301('0x4d')]));if(_0x94a9ff[_0x9301('0x42')][_0x9301('0x4f')]){_0x16f875[_0x9301('0x4c')]=_[_0x9301('0x50')](_0x16f875['where'],{'$or':_['map'](_0x1ef8bb,function(_0xcbf6fd){if(_0xcbf6fd[_0x9301('0x3f')]!==_0x9301('0x51')){var _0x437c7a={};_0x437c7a[_0xcbf6fd[_0x9301('0x39')]]={'$like':'%'+_0x94a9ff[_0x9301('0x42')]['filter']+'%'};return _0x437c7a;}})});}_0x16f875=_[_0x9301('0x50')]({},_0x16f875,_0x94a9ff[_0x9301('0x52')]);var _0x177f50={'where':_0x16f875[_0x9301('0x4c')]};return db[_0x9301('0x53')][_0x9301('0x54')](_0x177f50)[_0x9301('0x35')](function(_0x4a0adc){_0x5c6102[_0x9301('0x54')]=_0x4a0adc;if(_0x94a9ff['query']['includeAll']){_0x16f875[_0x9301('0x55')]=[{'all':!![]}];}return db[_0x9301('0x53')]['findAll'](_0x16f875);})[_0x9301('0x35')](function(_0x42ceda){_0x5c6102[_0x9301('0x56')]=_0x42ceda;return _0x5c6102;})[_0x9301('0x35')](respondWithFilteredResult(_0x5f5593,_0x16f875))['catch'](handleError(_0x5f5593,null));};exports['show']=function(_0x26a751,_0x537801){var _0x3bb195={'raw':![],'where':{'id':_0x26a751['params']['id']},'include':[{'model':db[_0x9301('0x3b')],'as':_0x9301('0x3c')}]},_0x5d997b={};_0x5d997b[_0x9301('0x41')]=_['keys'](db[_0x9301('0x53')][_0x9301('0x57')]);_0x5d997b['query']=_[_0x9301('0x43')](_0x26a751['query']);_0x5d997b[_0x9301('0x4d')]=_['intersection'](_0x5d997b[_0x9301('0x41')],_0x5d997b['query']);_0x3bb195['attributes']=_[_0x9301('0x45')](_0x5d997b[_0x9301('0x41')],qs['fields'](_0x26a751[_0x9301('0x42')]['fields']));_0x3bb195[_0x9301('0x44')]=_0x3bb195[_0x9301('0x44')][_0x9301('0x47')]?_0x3bb195[_0x9301('0x44')]:_0x5d997b['model'];if(_0x26a751[_0x9301('0x42')][_0x9301('0x58')]){_0x3bb195[_0x9301('0x55')]=[{'all':!![]}];}_0x3bb195=_[_0x9301('0x50')]({},_0x3bb195,_0x26a751[_0x9301('0x52')]);return db[_0x9301('0x53')]['find'](_0x3bb195)[_0x9301('0x35')](handleEntityNotFound(_0x537801,null))['then'](respondWithResult(_0x537801,null))[_0x9301('0x59')](handleError(_0x537801,null));};exports[_0x9301('0x5a')]=function(_0x592c53,_0x50c18c){return db[_0x9301('0x53')][_0x9301('0x5a')](_0x592c53[_0x9301('0x5b')],{})[_0x9301('0x35')](function(_0x38cd42){var _0x1a94ad=_0x592c53[_0x9301('0x5c')][_0x9301('0x5d')]({'plain':!![]});if(!_0x1a94ad)throw new Error(_0x9301('0x5e'));if(_0x1a94ad[_0x9301('0x5f')]===_0x9301('0x5c')){var _0x1b2e17=_0x38cd42[_0x9301('0x5d')]({'plain':!![]});var _0x522ed9=_0x9301('0x36');return db[_0x9301('0x60')]['find']({'where':{'name':_0x522ed9,'userProfileId':_0x1a94ad[_0x9301('0x61')]},'raw':!![]})[_0x9301('0x35')](function(_0x2c20ee){if(_0x2c20ee&&_0x2c20ee[_0x9301('0x62')]===0x0){return db[_0x9301('0x37')][_0x9301('0x5a')]({'name':_0x1b2e17[_0x9301('0x39')],'resourceId':_0x1b2e17['id'],'type':_0x2c20ee['name'],'sectionId':_0x2c20ee['id']},{})['then'](function(){return _0x38cd42;});}else{return _0x38cd42;}})[_0x9301('0x59')](function(_0x12b706){logger[_0x9301('0x25')](_0x9301('0x63'),_0x12b706);throw _0x12b706;});}return _0x38cd42;})['then'](respondWithResult(_0x50c18c,0xc9))[_0x9301('0x59')](handleError(_0x50c18c,null));};exports['update']=function(_0x496cff,_0xbfcd35){if(_0x496cff[_0x9301('0x5b')]['id']){delete _0x496cff[_0x9301('0x5b')]['id'];}return db['OpenchannelAccount']['find']({'where':{'id':_0x496cff[_0x9301('0x64')]['id']},'include':[{'model':db['Pause'],'as':'mandatoryDispositionPause'}]})[_0x9301('0x35')](handleEntityNotFound(_0xbfcd35,null))['then'](saveUpdates(_0x496cff[_0x9301('0x5b')],null))[_0x9301('0x35')](respondWithResult(_0xbfcd35,null))['catch'](handleError(_0xbfcd35,null));};exports['destroy']=function(_0x5c52b0,_0x3736d2){return db[_0x9301('0x53')][_0x9301('0x65')]({'where':{'id':_0x5c52b0[_0x9301('0x64')]['id']}})['then'](handleEntityNotFound(_0x3736d2,null))['then'](removeEntity(_0x3736d2,null))[_0x9301('0x59')](handleError(_0x3736d2,null));};exports['describe']=function(_0x51cd76,_0x4e918d){return db[_0x9301('0x53')][_0x9301('0x66')]()['then'](respondWithResult(_0x4e918d,null))[_0x9301('0x59')](handleError(_0x4e918d,null));};exports[_0x9301('0x67')]=function(_0x2470c2,_0x8b1bc4,_0xb29797){if(_0x2470c2[_0x9301('0x5b')]['id']){delete _0x2470c2['body']['id'];}return db['OpenchannelAccount'][_0x9301('0x65')]({'where':{'id':_0x2470c2[_0x9301('0x64')]['id']}})[_0x9301('0x35')](handleEntityNotFound(_0x8b1bc4,null))[_0x9301('0x35')](function(_0x3c8b1b){if(_0x3c8b1b){_0x2470c2[_0x9301('0x5b')][_0x9301('0x68')]=_0x3c8b1b['id'];return db[_0x9301('0x69')]['create'](_0x2470c2['body']);}})['then'](respondWithResult(_0x8b1bc4,null))[_0x9301('0x59')](handleError(_0x8b1bc4,null));};exports[_0x9301('0x6a')]=function(_0x4106ac,_0x208679,_0x2960cf){var _0x5a2a62={'raw':![],'where':{}};var _0x54eae5={};var _0x24dec8={'count':0x0,'rows':[]};return db[_0x9301('0x53')][_0x9301('0x6b')]({'where':{'id':_0x4106ac[_0x9301('0x64')]['id']}})['then'](handleEntityNotFound(_0x208679,null))[_0x9301('0x35')](function(_0x5d2403){if(_0x5d2403){_0x54eae5[_0x9301('0x41')]=_['keys'](db[_0x9301('0x69')][_0x9301('0x57')]);_0x54eae5[_0x9301('0x42')]=_[_0x9301('0x43')](_0x4106ac[_0x9301('0x42')]);_0x54eae5[_0x9301('0x4d')]=_['intersection'](_0x54eae5['model'],_0x54eae5[_0x9301('0x42')]);_0x5a2a62['attributes']=_['intersection'](_0x54eae5[_0x9301('0x41')],qs[_0x9301('0x46')](_0x4106ac[_0x9301('0x42')]['fields']));_0x5a2a62[_0x9301('0x44')]=_0x5a2a62[_0x9301('0x44')][_0x9301('0x47')]?_0x5a2a62['attributes']:_0x54eae5[_0x9301('0x41')];if(!_0x4106ac[_0x9301('0x42')][_0x9301('0x48')](_0x9301('0x49'))){_0x5a2a62[_0x9301('0x4a')]=qs['limit'](_0x4106ac[_0x9301('0x42')][_0x9301('0x4a')]);_0x5a2a62[_0x9301('0x2d')]=qs[_0x9301('0x2d')](_0x4106ac[_0x9301('0x42')][_0x9301('0x2d')]);}_0x5a2a62[_0x9301('0x6c')]=qs[_0x9301('0x4b')](_0x4106ac[_0x9301('0x42')]['sort']);_0x5a2a62[_0x9301('0x4c')]=qs['filters'](_[_0x9301('0x4e')](_0x4106ac[_0x9301('0x42')],_0x54eae5['filters']));_0x5a2a62[_0x9301('0x4c')][_0x9301('0x6d')]=_0x5d2403['id'];if(_0x4106ac[_0x9301('0x42')][_0x9301('0x4f')]){_0x5a2a62[_0x9301('0x4c')]=_[_0x9301('0x50')](_0x5a2a62['where'],{'$or':_[_0x9301('0x3d')](_0x5a2a62[_0x9301('0x44')],function(_0xa3592f){var _0x43f144={};_0x43f144[_0xa3592f]={'$like':'%'+_0x4106ac[_0x9301('0x42')][_0x9301('0x4f')]+'%'};return _0x43f144;})});}_0x5a2a62=_[_0x9301('0x50')]({},_0x5a2a62,_0x4106ac[_0x9301('0x52')]);return db['Disposition'][_0x9301('0x54')]({'where':_0x5a2a62[_0x9301('0x4c')]})['then'](function(_0x1cf6d0){_0x24dec8[_0x9301('0x54')]=_0x1cf6d0;if(_0x4106ac[_0x9301('0x42')][_0x9301('0x58')]){_0x5a2a62[_0x9301('0x55')]=[{'all':!![]}];}return db['Disposition'][_0x9301('0x6e')](_0x5a2a62);})[_0x9301('0x35')](function(_0x5537bf){_0x24dec8[_0x9301('0x56')]=_0x5537bf;return _0x24dec8;});}})[_0x9301('0x35')](respondWithFilteredResult(_0x208679,_0x5a2a62))['catch'](handleError(_0x208679,null));};exports[_0x9301('0x6f')]=function(_0x18bfd5,_0x42f6d8,_0x238ffc){return db[_0x9301('0x53')][_0x9301('0x65')]({'where':{'id':_0x18bfd5[_0x9301('0x64')]['id']}})[_0x9301('0x35')](handleEntityNotFound(_0x42f6d8,null))[_0x9301('0x35')](function(_0x48d5c4){if(_0x48d5c4){return _0x48d5c4[_0x9301('0x6f')](_0x18bfd5[_0x9301('0x42')][_0x9301('0x70')]);}})['then'](respondWithStatusCode(_0x42f6d8,null))[_0x9301('0x59')](handleError(_0x42f6d8,null));};exports[_0x9301('0x71')]=function(_0x36f96c,_0x14a449,_0x11a58a){if(_0x36f96c[_0x9301('0x5b')]['id']){delete _0x36f96c[_0x9301('0x5b')]['id'];}return db['OpenchannelAccount'][_0x9301('0x65')]({'where':{'id':_0x36f96c[_0x9301('0x64')]['id']}})[_0x9301('0x35')](handleEntityNotFound(_0x14a449,null))[_0x9301('0x35')](function(_0x389dd3){if(_0x389dd3){_0x36f96c[_0x9301('0x5b')][_0x9301('0x6d')]=_0x389dd3['id'];return db[_0x9301('0x72')][_0x9301('0x5a')](_0x36f96c[_0x9301('0x5b')]);}})['then'](respondWithResult(_0x14a449,null))[_0x9301('0x59')](handleError(_0x14a449,null));};exports[_0x9301('0x73')]=function(_0x20dcd1,_0x37166f,_0xf3058a){var _0x4d2ab5={'raw':![],'where':{}};var _0x16d113={};var _0x519fb1={'count':0x0,'rows':[]};return db[_0x9301('0x53')][_0x9301('0x6b')]({'where':{'id':_0x20dcd1[_0x9301('0x64')]['id']}})['then'](handleEntityNotFound(_0x37166f,null))['then'](function(_0x5cb3e0){if(_0x5cb3e0){_0x16d113[_0x9301('0x41')]=_['keys'](db[_0x9301('0x72')][_0x9301('0x57')]);_0x16d113['query']=_[_0x9301('0x43')](_0x20dcd1[_0x9301('0x42')]);_0x16d113[_0x9301('0x4d')]=_[_0x9301('0x45')](_0x16d113[_0x9301('0x41')],_0x16d113[_0x9301('0x42')]);_0x4d2ab5[_0x9301('0x44')]=_['intersection'](_0x16d113['model'],qs[_0x9301('0x46')](_0x20dcd1[_0x9301('0x42')]['fields']));_0x4d2ab5['attributes']=_0x4d2ab5['attributes'][_0x9301('0x47')]?_0x4d2ab5[_0x9301('0x44')]:_0x16d113[_0x9301('0x41')];if(!_0x20dcd1[_0x9301('0x42')][_0x9301('0x48')](_0x9301('0x49'))){_0x4d2ab5[_0x9301('0x4a')]=qs[_0x9301('0x4a')](_0x20dcd1['query'][_0x9301('0x4a')]);_0x4d2ab5[_0x9301('0x2d')]=qs[_0x9301('0x2d')](_0x20dcd1[_0x9301('0x42')][_0x9301('0x2d')]);}_0x4d2ab5[_0x9301('0x6c')]=qs[_0x9301('0x4b')](_0x20dcd1[_0x9301('0x42')][_0x9301('0x4b')]);_0x4d2ab5[_0x9301('0x4c')]=qs['filters'](_[_0x9301('0x4e')](_0x20dcd1[_0x9301('0x42')],_0x16d113[_0x9301('0x4d')]));_0x4d2ab5[_0x9301('0x4c')][_0x9301('0x6d')]=_0x5cb3e0['id'];if(_0x20dcd1['query'][_0x9301('0x4f')]){_0x4d2ab5[_0x9301('0x4c')]=_['merge'](_0x4d2ab5[_0x9301('0x4c')],{'$or':_[_0x9301('0x3d')](_0x4d2ab5[_0x9301('0x44')],function(_0x357f02){var _0x573672={};_0x573672[_0x357f02]={'$like':'%'+_0x20dcd1[_0x9301('0x42')][_0x9301('0x4f')]+'%'};return _0x573672;})});}_0x4d2ab5=_['merge']({},_0x4d2ab5,_0x20dcd1['options']);return db[_0x9301('0x72')]['count']({'where':_0x4d2ab5[_0x9301('0x4c')]})[_0x9301('0x35')](function(_0x8061f8){_0x519fb1['count']=_0x8061f8;if(_0x20dcd1[_0x9301('0x42')]['includeAll']){_0x4d2ab5[_0x9301('0x55')]=[{'all':!![]}];}return db[_0x9301('0x72')]['findAll'](_0x4d2ab5);})[_0x9301('0x35')](function(_0x4b5e5d){_0x519fb1[_0x9301('0x56')]=_0x4b5e5d;return _0x519fb1;});}})[_0x9301('0x35')](respondWithFilteredResult(_0x37166f,_0x4d2ab5))[_0x9301('0x59')](handleError(_0x37166f,null));};exports[_0x9301('0x74')]=function(_0x1f63d7,_0x18dc77,_0x3d01c2){return db[_0x9301('0x53')][_0x9301('0x65')]({'where':{'id':_0x1f63d7[_0x9301('0x64')]['id']}})[_0x9301('0x35')](handleEntityNotFound(_0x18dc77,null))[_0x9301('0x35')](function(_0x1b3a3f){if(_0x1b3a3f){return _0x1b3a3f[_0x9301('0x74')](_0x1f63d7[_0x9301('0x42')][_0x9301('0x70')]);}})[_0x9301('0x35')](respondWithStatusCode(_0x18dc77,null))[_0x9301('0x59')](handleError(_0x18dc77,null));};exports[_0x9301('0x75')]=function(_0x4b623f,_0x542ef1,_0xbdf819){var _0x4ae52c={'body':_0x4b623f[_0x9301('0x5b')],'channel':_0x9301('0x76')};var _0x3c6fab=[];var _0x1c1f8b=[];var _0x1fc379={};var _0x10b180=![];return db[_0x9301('0x77')][_0x9301('0x66')]()[_0x9301('0x35')](function(_0x4bed9e){if(!_0x4bed9e){throw new db[(_0x9301('0x1f'))]['ValidationError'](_0x9301('0x78'));}_0x3c6fab=_['difference'](_[_0x9301('0x43')](_0x4bed9e),['createdAt','updatedAt']);_0x1c1f8b=_[_0x9301('0x79')](_[_0x9301('0x43')](_0x4bed9e),['createdAt',_0x9301('0x7a'),_0x9301('0x7b'),_0x9301('0x7c')]);if(_0x4b623f[_0x9301('0x5b')]['id']){delete _0x4b623f[_0x9301('0x5b')]['id'];}if(_[_0x9301('0x7d')](_0x4b623f[_0x9301('0x5b')][_0x9301('0x7e')])){throw new db[(_0x9301('0x1f'))]['ValidationError'](_0x9301('0x7f'));}if(_[_0x9301('0x7d')](_0x4b623f[_0x9301('0x5b')][_0x9301('0x5b')])||_0x4b623f[_0x9301('0x5b')][_0x9301('0x5b')]===''){throw new db[(_0x9301('0x1f'))]['ValidationError'](_0x9301('0x80'));}if(_[_0x9301('0x7d')](_0x4b623f[_0x9301('0x5b')][_0x9301('0x81')])){throw new db[(_0x9301('0x1f'))][(_0x9301('0x20'))](_0x9301('0x82')+_0x1c1f8b);}if(!_[_0x9301('0x83')](_0x1c1f8b,_0x4b623f[_0x9301('0x5b')]['mapKey'])){throw new db[(_0x9301('0x1f'))][(_0x9301('0x20'))](_0x9301('0x84')+_0x1c1f8b);}_0x1fc379[_0x4b623f[_0x9301('0x5b')][_0x9301('0x81')]]=_0x4b623f[_0x9301('0x5b')]['from'];})['then'](function(){return db['OpenchannelAccount'][_0x9301('0x65')]({'where':{'id':_0x4b623f['params']['id']},'include':[{'model':db[_0x9301('0x85')],'as':_0x9301('0x86'),'include':[{'model':db[_0x9301('0x77')],'as':_0x9301('0x87'),'where':_0x1fc379,'limit':0x1,'order':[['updatedAt',_0x9301('0x88')]]}]},{'model':db[_0x9301('0x89')],'as':_0x9301('0x8a')}]});})[_0x9301('0x35')](handleEntityNotFound(_0x542ef1,null))[_0x9301('0x35')](function(_0x34b7fa){if(_0x34b7fa&&_0x34b7fa['List']){_0x4ae52c[_0x9301('0x8b')]=_0x34b7fa;_0x4ae52c[_0x9301('0x8c')]=_0x34b7fa[_0x9301('0x8a')];_0x4ae52c['list']=_0x34b7fa[_0x9301('0x86')];_0x4ae52c[_0x9301('0x8c')]=_[_0x9301('0x8d')](_0x4ae52c[_0x9301('0x8c')],[_0x9301('0x8e')],[_0x9301('0x8f')]);if(_0x4ae52c[_0x9301('0x8b')]['Applications']){delete _0x4ae52c[_0x9301('0x8b')][_0x9301('0x8a')];}if(_0x4ae52c[_0x9301('0x8b')][_0x9301('0x86')]&&_0x4ae52c['account']['List']['Contacts'][_0x9301('0x47')]){return _0x4ae52c[_0x9301('0x8b')]['List'][_0x9301('0x87')][0x0];}var _0x355bcd=_[_0x9301('0x19')](_0x4b623f[_0x9301('0x5b')],{'firstName':_0x4b623f[_0x9301('0x5b')]['from'],'ListId':_0x34b7fa[_0x9301('0x7c')]});_0x355bcd[_0x4b623f[_0x9301('0x5b')][_0x9301('0x81')]]=_0x4b623f[_0x9301('0x5b')][_0x9301('0x7e')];return db['CmContact'][_0x9301('0x5a')](_0x355bcd,{'fields':_0x3c6fab,'raw':!![]});}})[_0x9301('0x35')](handleEntityNotFound(_0x542ef1,null))[_0x9301('0x35')](function(_0x5c665f){_0x4ae52c[_0x9301('0x90')]=_0x5c665f;if(_0x5c665f){var _0x142f32={'ContactId':_0x5c665f['id'],'OpenchannelAccountId':_0x4b623f[_0x9301('0x64')]['id'],'from':(_0x5c665f[_0x9301('0x91')]||'')+'\x20'+(_0x5c665f[_0x9301('0x92')]||'')};var _0x4b24ad={'OpenchannelAccountId':_0x4b623f[_0x9301('0x64')]['id'],'closed':![]};if(_0x4b623f[_0x9301('0x5b')][_0x9301('0x93')]){_0x4b24ad[_0x9301('0x93')]=_0x4b623f[_0x9301('0x5b')][_0x9301('0x93')];return db[_0x9301('0x94')][_0x9301('0x65')]({'where':_0x4b24ad})['then'](function(_0x40d03e){if(_0x40d03e){return[_0x40d03e,![]];}_0x142f32[_0x9301('0x93')]=_0x4b623f['body'][_0x9301('0x93')];_0x142f32[_0x9301('0x95')]=_0x4b623f['body'][_0x9301('0x95')];return db[_0x9301('0x94')]['create'](_0x142f32)[_0x9301('0x35')](function(_0x4febf7){return[_0x4febf7,!![]];});});}else{_0x4b24ad[_0x9301('0x93')]=null;}_0x4b24ad[_0x9301('0x96')]=_0x5c665f['id'];return db[_0x9301('0x94')][_0x9301('0x65')]({'where':_0x4b24ad})[_0x9301('0x35')](function(_0x5c8b5d){if(_0x5c8b5d){return[_0x5c8b5d,![]];}return db[_0x9301('0x94')][_0x9301('0x5a')](_0x142f32)[_0x9301('0x35')](function(_0x1ec04d){return[_0x1ec04d,!![]];});});}})['spread'](function(_0xc67028,_0x389acd){if(_0xc67028){_0x10b180=_0x389acd;if(!_0x389acd){var _0x31ced4={'from':(_0x4ae52c[_0x9301('0x90')][_0x9301('0x91')]||'')+'\x20'+(_0x4ae52c[_0x9301('0x90')][_0x9301('0x92')]||'')};if(_0x4b623f[_0x9301('0x5b')][_0x9301('0x93')]&&_0x4b623f[_0x9301('0x5b')][_0x9301('0x97')]&&_0x4b623f['body'][_0x9301('0x93')]!=_0x4b623f[_0x9301('0x5b')]['messageId']){_0x31ced4[_0x9301('0x93')]=_0x4b623f[_0x9301('0x5b')][_0x9301('0x97')];}return _0xc67028[_0x9301('0x33')](_0x31ced4);}else{return _0xc67028;}}})[_0x9301('0x35')](function(_0x27924b){_0x4ae52c[_0x9301('0x98')]=_0x27924b['get']({'plain':!![]});_0x4ae52c[_0x9301('0x98')][_0x9301('0x99')]=_0x10b180;if(_0x4ae52c[_0x9301('0x98')]['created']){if(_0x4ae52c['account'][_0x9301('0x9a')]){_0x4ae52c[_0x9301('0x8c')][_0x9301('0x9b')]({'id':0x0,'priority':_0x4ae52c[_0x9301('0x8c')][_0x9301('0x47')]+0x1,'app':'close','appdata':_0x9301('0x9c'),'interval':'*,*,*,*'});}}return db['OpenchannelMessage'][_0x9301('0x5a')]({'body':_0x4b623f[_0x9301('0x5b')]['body'],'OpenchannelAccountId':_0x4b623f[_0x9301('0x64')]['id'],'OpenchannelInteractionId':_0x27924b['id'],'direction':'in','ContactId':_0x4ae52c['contact']['id'],'AttachmentId':_0x4b623f[_0x9301('0x5b')][_0x9301('0x9d')]});})[_0x9301('0x35')](function(_0xf57682){_0x4ae52c[_0x9301('0x27')]=_0xf57682;if(_0x4ae52c[_0x9301('0x98')][_0x9301('0x9e')]){return db[_0x9301('0x9f')][_0x9301('0x65')]({'attributes':['id',_0x9301('0x39')],'where':{'id':_0x4ae52c[_0x9301('0x98')][_0x9301('0x9e')]}})[_0x9301('0x35')](function(_0x1d2c2e){if(_0x1d2c2e){_0x4ae52c[_0x9301('0x8c')]['unshift']({'id':0x0,'priority':0x0,'app':_0x9301('0xa0'),'appdata':_0x1d2c2e[_0x9301('0x39')]+','+(_0x4ae52c[_0x9301('0x8b')][_0x9301('0xa1')]||0xa),'interval':_0x9301('0xa2')});_0x4ae52c[_0x9301('0xa3')]=![];}return respondWithRpcPromise('Start',_0x9301('0xa4'),_0x4ae52c);});}return respondWithRpcPromise(_0x9301('0xa5'),'startRouting',_0x4ae52c);})[_0x9301('0x35')](function(_0x10b936){respondWithRpcPromise(_0x9301('0xa6'),_0x9301('0xa6'),{'event':_0x9301('0x75'),'message':_0x10b936},client9002);return _0x10b936;})['then'](respondWithResult(_0x542ef1,null))['catch'](handleError(_0x542ef1,null));};exports[_0x9301('0xa7')]=function(_0x5f3010,_0x5c0599,_0x446a6c){return db[_0x9301('0x53')][_0x9301('0x6b')]({'where':{'id':_0x5f3010[_0x9301('0x64')]['id']}})[_0x9301('0x35')](handleEntityNotFound(_0x5c0599,null))[_0x9301('0x35')](function(_0x48fc33){if(_0x48fc33){return db[_0x9301('0xa8')][_0x9301('0xa9')](function(_0x24591d){return db[_0x9301('0x89')][_0x9301('0x34')]({'where':{'OpenchannelAccountId':_0x5f3010[_0x9301('0x64')]['id']},'transaction':_0x24591d})[_0x9301('0x35')](function(_0x169301){var _0x4f3c42=_[_0x9301('0x3d')](_0x5f3010[_0x9301('0x5b')],function(_0x46a4f8){_0x46a4f8[_0x9301('0x6d')]=_0x5f3010[_0x9301('0x64')]['id'];return _0x46a4f8;});return db[_0x9301('0x89')][_0x9301('0xaa')](_0x4f3c42,{'transaction':_0x24591d});});})[_0x9301('0x35')](function(){return db[_0x9301('0x89')][_0x9301('0xab')]({'where':{'OpenchannelAccountId':_0x5f3010[_0x9301('0x64')]['id']},'order':'priority'});});}})['then'](respondWithResult(_0x5c0599,null))[_0x9301('0x59')](handleError(_0x5c0599,null));};exports[_0x9301('0xac')]=function(_0x9d8610,_0x316c7b,_0x54d937){var _0x1184b5={};var _0x488620={};var _0x4046b3;var _0x3e0473;return db[_0x9301('0x53')][_0x9301('0x6b')]({'where':{'id':_0x9d8610['params']['id']}})[_0x9301('0x35')](handleEntityNotFound(_0x316c7b,null))['then'](function(_0xe5c387){if(_0xe5c387){_0x4046b3=_0xe5c387;_0x488620[_0x9301('0x41')]=_[_0x9301('0x43')](db['OpenchannelApplication']['rawAttributes']);_0x488620[_0x9301('0x42')]=_[_0x9301('0x43')](_0x9d8610[_0x9301('0x42')]);_0x488620[_0x9301('0x4d')]=_['intersection'](_0x488620['model'],_0x488620[_0x9301('0x42')]);_0x1184b5[_0x9301('0x44')]=_[_0x9301('0x45')](_0x488620[_0x9301('0x41')],qs[_0x9301('0x46')](_0x9d8610[_0x9301('0x42')]['fields']));_0x1184b5['attributes']=_0x1184b5['attributes']['length']?_0x1184b5[_0x9301('0x44')]:_0x488620[_0x9301('0x41')];_0x1184b5[_0x9301('0x6c')]=qs[_0x9301('0x4b')](_0x9d8610[_0x9301('0x42')]['sort']);_0x1184b5['where']=qs['filters'](_['pick'](_0x9d8610[_0x9301('0x42')],_0x488620[_0x9301('0x4d')]));if(_0x9d8610[_0x9301('0x42')][_0x9301('0x4f')]){_0x1184b5[_0x9301('0x4c')]=_['merge'](_0x1184b5[_0x9301('0x4c')],{'$or':_[_0x9301('0x3d')](_0x1184b5[_0x9301('0x44')],function(_0x1c97ad){var _0x577084={};_0x577084[_0x1c97ad]={'$like':'%'+_0x9d8610[_0x9301('0x42')]['filter']+'%'};return _0x577084;})});}_0x1184b5=_[_0x9301('0x50')]({},_0x1184b5,_0x9d8610[_0x9301('0x52')]);return _0x4046b3[_0x9301('0xac')](_0x1184b5);}})[_0x9301('0x35')](function(_0x2a7b1e){if(_0x2a7b1e){_0x3e0473=_0x2a7b1e[_0x9301('0x47')];if(!_0x9d8610[_0x9301('0x42')][_0x9301('0x48')]('nolimit')){_0x1184b5[_0x9301('0x4a')]=qs[_0x9301('0x4a')](_0x9d8610['query'][_0x9301('0x4a')]);_0x1184b5[_0x9301('0x2d')]=qs[_0x9301('0x2d')](_0x9d8610[_0x9301('0x42')][_0x9301('0x2d')]);}return _0x4046b3[_0x9301('0xac')](_0x1184b5);}})[_0x9301('0x35')](function(_0x4fae1f){if(_0x4fae1f){return _0x4fae1f?{'count':_0x3e0473,'rows':_0x4fae1f}:null;}})[_0x9301('0x35')](respondWithResult(_0x316c7b,null))[_0x9301('0x59')](handleError(_0x316c7b,null));};exports['getInteractions']=function(_0xad55e9,_0x25c599,_0x8e52d3){var _0xfccce5={'raw':![],'where':{}};var _0x2c2aa5={};var _0x56b24e={'count':0x0,'rows':[]};return db[_0x9301('0x53')]['findOne']({'where':{'id':_0xad55e9['params']['id']}})[_0x9301('0x35')](handleEntityNotFound(_0x25c599,null))[_0x9301('0x35')](function(_0x5412e2){if(_0x5412e2){_0x2c2aa5[_0x9301('0x41')]=_['keys'](db[_0x9301('0x94')][_0x9301('0x57')]);_0x2c2aa5['query']=_[_0x9301('0x43')](_0xad55e9[_0x9301('0x42')]);_0x2c2aa5[_0x9301('0x4d')]=_[_0x9301('0x45')](_0x2c2aa5[_0x9301('0x41')],_0x2c2aa5['query']);_0xfccce5['attributes']=_[_0x9301('0x45')](_0x2c2aa5['model'],qs[_0x9301('0x46')](_0xad55e9[_0x9301('0x42')][_0x9301('0x46')]));_0xfccce5['attributes']=_0xfccce5[_0x9301('0x44')]['length']?_0xfccce5[_0x9301('0x44')]:_0x2c2aa5[_0x9301('0x41')];if(!_0xad55e9['query'][_0x9301('0x48')](_0x9301('0x49'))){_0xfccce5[_0x9301('0x4a')]=qs[_0x9301('0x4a')](_0xad55e9[_0x9301('0x42')]['limit']);_0xfccce5['offset']=qs[_0x9301('0x2d')](_0xad55e9[_0x9301('0x42')][_0x9301('0x2d')]);}_0xfccce5[_0x9301('0x6c')]=qs[_0x9301('0x4b')](_0xad55e9['query'][_0x9301('0x4b')]);_0xfccce5['where']=qs[_0x9301('0x4d')](_[_0x9301('0x4e')](_0xad55e9[_0x9301('0x42')],_0x2c2aa5[_0x9301('0x4d')]));_0xfccce5['where'][_0x9301('0x6d')]=_0x5412e2['id'];if(_0xad55e9[_0x9301('0x42')][_0x9301('0x4f')]){_0xfccce5[_0x9301('0x4c')]=_[_0x9301('0x50')](_0xfccce5[_0x9301('0x4c')],{'$or':_[_0x9301('0x3d')](_0xfccce5['attributes'],function(_0x3e205b){var _0x17c324={};_0x17c324[_0x3e205b]={'$like':'%'+_0xad55e9[_0x9301('0x42')][_0x9301('0x4f')]+'%'};return _0x17c324;})});}_0xfccce5=_[_0x9301('0x50')]({},_0xfccce5,_0xad55e9['options']);return db[_0x9301('0x94')][_0x9301('0x54')]({'where':_0xfccce5['where']})['then'](function(_0x1a8486){_0x56b24e[_0x9301('0x54')]=_0x1a8486;if(_0xad55e9[_0x9301('0x42')][_0x9301('0x58')]){_0xfccce5[_0x9301('0x55')]=[{'model':db['CmContact'],'as':_0x9301('0xad'),'required':![]},{'model':db[_0x9301('0x9f')],'as':_0x9301('0xae'),'attributes':[_0x9301('0x39'),_0x9301('0xaf'),'internal'],'required':![]},{'model':db['Tag'],'as':_0x9301('0xb0'),'attributes':['id',_0x9301('0x39'),_0x9301('0xb1')],'where':_0xad55e9['query']['tag']?{'id':_0xad55e9[_0x9301('0x42')][_0x9301('0xb2')]}:undefined,'required':_0xad55e9['query'][_0x9301('0xb2')]?!![]:![]}];}return db[_0x9301('0x94')]['findAll'](_0xfccce5);})[_0x9301('0x35')](function(_0x496a7f){_0x56b24e[_0x9301('0x56')]=_0x496a7f;return _0x56b24e;});}})[_0x9301('0x35')](respondWithFilteredResult(_0x25c599,_0xfccce5))[_0x9301('0x59')](handleError(_0x25c599,null));};exports[_0x9301('0xb3')]=function(_0x50a4fe,_0x54f7ad,_0x316a07){return db['OpenchannelAccount'][_0x9301('0x65')]({'where':{'id':_0x50a4fe[_0x9301('0x64')]['id']}})[_0x9301('0x35')](handleEntityNotFound(_0x54f7ad,null))['then'](function(_0x386416){if(_0x386416){return _0x386416[_0x9301('0xb3')](_0x50a4fe[_0x9301('0x5b')][_0x9301('0x70')],_['omit'](_0x50a4fe['body'],[_0x9301('0x70'),'id'])||{})[_0x9301('0xb4')](function(_0x506c31){for(var _0x2a358f=0x0;_0x2a358f<_0x50a4fe['body'][_0x9301('0x70')][_0x9301('0x47')];_0x2a358f+=0x1){socket[_0x9301('0xb5')](_0x9301('0xb6'),{'UserId':_0x50a4fe['body'][_0x9301('0x70')][_0x2a358f],'OpenchannelAccountId':_0x50a4fe[_0x9301('0x64')]['id']});}return _0x506c31;});}})[_0x9301('0x35')](respondWithResult(_0x54f7ad,null))[_0x9301('0x59')](handleError(_0x54f7ad,null));};exports['removeAgents']=function(_0x144b6f,_0x24ffe7,_0x4289f2){return db[_0x9301('0x53')][_0x9301('0x65')]({'where':{'id':_0x144b6f[_0x9301('0x64')]['id']}})[_0x9301('0x35')](handleEntityNotFound(_0x24ffe7,null))[_0x9301('0x35')](function(_0x4aa071){if(_0x4aa071){return _0x4aa071[_0x9301('0xb7')](_0x144b6f[_0x9301('0x42')][_0x9301('0x70')])[_0x9301('0x35')](function(){if(_[_0x9301('0xb8')](_0x144b6f['query']['ids'])){for(var _0x54b7dc=0x0;_0x54b7dc<_0x144b6f[_0x9301('0x42')][_0x9301('0x70')][_0x9301('0x47')];_0x54b7dc+=0x1){socket[_0x9301('0xb5')](_0x9301('0xb9'),{'UserId':Number(_0x144b6f[_0x9301('0x42')][_0x9301('0x70')][_0x54b7dc]),'OpenchannelAccountId':Number(_0x144b6f['params']['id'])});}}else{socket[_0x9301('0xb5')](_0x9301('0xb9'),{'UserId':Number(_0x144b6f[_0x9301('0x42')][_0x9301('0x70')]),'OpenchannelAccountId':Number(_0x144b6f[_0x9301('0x64')]['id'])});}});}})[_0x9301('0x35')](respondWithStatusCode(_0x24ffe7,null))[_0x9301('0x59')](handleError(_0x24ffe7,null));};exports[_0x9301('0xba')]=function(_0x3fd8d0,_0x23e71d,_0x20c7a0){var _0x3e6b9f={};var _0x5ca198={};var _0x1d1f51;var _0xda78d9;return db['OpenchannelAccount'][_0x9301('0x6b')]({'where':{'id':_0x3fd8d0[_0x9301('0x64')]['id']}})[_0x9301('0x35')](handleEntityNotFound(_0x23e71d,null))[_0x9301('0x35')](function(_0x55fee3){if(_0x55fee3){_0x1d1f51=_0x55fee3;_0x5ca198[_0x9301('0x41')]=_[_0x9301('0x43')](db[_0x9301('0x9f')]['rawAttributes']);_0x5ca198[_0x9301('0x42')]=_[_0x9301('0x43')](_0x3fd8d0['query']);_0x5ca198['filters']=_['intersection'](_0x5ca198[_0x9301('0x41')],_0x5ca198['query']);_0x3e6b9f[_0x9301('0x44')]=_[_0x9301('0x45')](_0x5ca198['model'],qs[_0x9301('0x46')](_0x3fd8d0[_0x9301('0x42')][_0x9301('0x46')]));_0x3e6b9f[_0x9301('0x44')]=_0x3e6b9f[_0x9301('0x44')][_0x9301('0x47')]?_0x3e6b9f[_0x9301('0x44')]:_0x5ca198['model'];_0x3e6b9f[_0x9301('0x6c')]=qs[_0x9301('0x4b')](_0x3fd8d0[_0x9301('0x42')][_0x9301('0x4b')]);_0x3e6b9f['where']=qs[_0x9301('0x4d')](_['pick'](_0x3fd8d0[_0x9301('0x42')],_0x5ca198[_0x9301('0x4d')]));if(_0x3fd8d0['query'][_0x9301('0x4f')]){_0x3e6b9f[_0x9301('0x4c')]=_[_0x9301('0x50')](_0x3e6b9f[_0x9301('0x4c')],{'$or':_[_0x9301('0x3d')](_0x3e6b9f[_0x9301('0x44')],function(_0x5e0daf){var _0x53db81={};_0x53db81[_0x5e0daf]={'$like':'%'+_0x3fd8d0[_0x9301('0x42')][_0x9301('0x4f')]+'%'};return _0x53db81;})});}_0x3e6b9f=_[_0x9301('0x50')]({},_0x3e6b9f,_0x3fd8d0[_0x9301('0x52')]);return _0x1d1f51[_0x9301('0xba')](_0x3e6b9f);}})['then'](function(_0x240485){if(_0x240485){_0xda78d9=_0x240485[_0x9301('0x47')];if(!_0x3fd8d0['query'][_0x9301('0x48')](_0x9301('0x49'))){_0x3e6b9f['limit']=qs[_0x9301('0x4a')](_0x3fd8d0[_0x9301('0x42')][_0x9301('0x4a')]);_0x3e6b9f[_0x9301('0x2d')]=qs[_0x9301('0x2d')](_0x3fd8d0[_0x9301('0x42')][_0x9301('0x2d')]);}return _0x1d1f51[_0x9301('0xba')](_0x3e6b9f);}})[_0x9301('0x35')](function(_0x1fae31){if(_0x1fae31){return _0x1fae31?{'count':_0xda78d9,'rows':_0x1fae31}:null;}})[_0x9301('0x35')](respondWithResult(_0x23e71d,null))[_0x9301('0x59')](handleError(_0x23e71d,null));};exports[_0x9301('0xbb')]=function(_0x202d7b,_0x26b68b,_0x48a854){var _0x40eda5,_0x2d465e,_0x1bcdf9;if(_[_0x9301('0x7d')](_0x202d7b[_0x9301('0x5b')][_0x9301('0x5b')])||_0x202d7b[_0x9301('0x5b')][_0x9301('0x5b')]===''){throw new db[(_0x9301('0x1f'))][(_0x9301('0x20'))](_0x9301('0x80'));}if(_['isNil'](_0x202d7b[_0x9301('0x5b')]['to'])){}_0x40eda5=_0x202d7b[_0x9301('0x5b')]['to'];return db['OpenchannelAccount'][_0x9301('0x6b')]({'where':{'id':_0x202d7b[_0x9301('0x64')]['id']}})[_0x9301('0x35')](handleEntityNotFound(_0x26b68b,null))['then'](function(_0x42a04b){if(_0x42a04b){return db[_0x9301('0x53')][_0x9301('0x65')]({'where':{'id':_0x42a04b['id']},'include':[{'model':db[_0x9301('0x85')],'as':'List','include':[{'model':db[_0x9301('0x77')],'as':_0x9301('0x87'),'where':{[_0x42a04b[_0x9301('0x81')]]:_0x40eda5},'limit':0x1,'order':[[_0x9301('0x7a'),'DESC']]}]}]})[_0x9301('0x35')](handleEntityNotFound(_0x26b68b,null))[_0x9301('0x35')](function(_0x1a2529){if(_0x1a2529&&_0x1a2529[_0x9301('0x86')]){_0x2d465e=_0x1a2529[_0x9301('0x5d')]({'plain':!![]});if(_0x2d465e[_0x9301('0x86')]&&_0x2d465e[_0x9301('0x86')]['Contacts']['length']){return _0x2d465e[_0x9301('0x86')][_0x9301('0x87')][0x0];}return db[_0x9301('0x77')][_0x9301('0x5a')](_['defaults'](_0x202d7b['body'],{'firstName':_0x40eda5,[_0x1a2529['mapKey']]:_0x40eda5,'phone':_0x40eda5,'ListId':_0x2d465e[_0x9301('0x7c')]}));}})[_0x9301('0x35')](handleEntityNotFound(_0x26b68b,null))['then'](function(_0x578643){if(_0x578643){_0x1bcdf9=_0x578643;return db['OpenchannelInteraction'][_0x9301('0x65')]({'where':{'ContactId':_0x1bcdf9['id'],'closed':![],'OpenchannelAccountId':_0x2d465e['id']}})[_0x9301('0x35')](function(_0x5ac7c2){if(_0x5ac7c2){return[_0x5ac7c2,![]];}return db['OpenchannelInteraction'][_0x9301('0x5a')]({'UserId':_0x202d7b['user']['id'],'ContactId':_0x1bcdf9['id'],'OpenchannelAccountId':_0x2d465e['id'],'lastMsgDirection':_0x9301('0xbc'),'Messages':[_['merge'](_0x202d7b[_0x9301('0x5b')],{'read':![],'body':_0x202d7b[_0x9301('0x5b')][_0x9301('0x5b')],'OpenchannelAccountId':_0x2d465e['id'],'UserId':_0x202d7b[_0x9301('0x5c')]['id'],'ContactId':_0x1bcdf9['id']})]},{'include':[{'model':db[_0x9301('0xbd')],'as':'Messages'}]})['then'](function(_0xd23fa0){return[_0xd23fa0,!![]];});});}})['spread'](function(_0x7fe2e0,_0x45203a){if(_0x45203a){return _0x7fe2e0;}return db[_0x9301('0xbd')][_0x9301('0x5a')](_['merge'](_0x202d7b[_0x9301('0x5b')],{'read':![],'body':_0x202d7b[_0x9301('0x5b')][_0x9301('0x5b')],'OpenchannelAccountId':_0x2d465e['id'],'OpenchannelInteractionId':_0x7fe2e0['id'],'UserId':_0x202d7b[_0x9301('0x5c')]['id'],'ContactId':_0x1bcdf9['id']}))[_0x9301('0x35')](function(_0x2482d3){_0x7fe2e0[_0x9301('0xbe')][_0x9301('0xbf')]=[];_0x7fe2e0['dataValues']['Messages']['push'](_0x2482d3['dataValues']);return _0x7fe2e0;});});}})[_0x9301('0x35')](respondWithResult(_0x26b68b,null))[_0x9301('0x59')](handleError(_0x26b68b,null));};
\ No newline at end of file
+var _0xa66b=['request\x20sent','debug','OpenchannelAccount,\x20%s,\x20%s,\x20%s','stringify','error','message','info','result','sendStatus','status','end','json','offset','limit','reject','save','update','destroy','get','UserProfileResource','stack','name','send','index','Pause','map','rawAttributes','fieldName','key','model','query','keys','filters','intersection','attributes','fields','hasOwnProperty','nolimit','order','sort','where','filter','options','OpenchannelAccount','count','includeAll','include','findAll','rows','show','params','mandatoryDispositionPause','length','merge','find','catch','create','body','Unable\x20to\x20retrieve\x20the\x20current\x20user','role','user','OpenchannelAccounts','UserProfileSection','userProfileId','autoAssociation','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','describe','addDisposition','OpnechannelAccountId','Disposition','getDispositions','OpenchannelAccountId','removeDispositions','ids','addAnswer','CannedAnswer','getAnswers','findOne','removeAnswers','notify','openchannel','no\x20available\x20attributes','createdAt','updatedAt','CompanyId','ListId','isNil','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','CmContact','Contacts','Applications','applications','list','orderBy','priority','asc','account','defaults','threadId','externalUrl','OpenchannelInteraction','ContactId','spread','contact','firstName','messageId','interaction','created','close','AttachmentId','UserId','User','agent','waitForTheAssignedAgent','*,*,*,*','forcedOwnership','Start','startRouting','EventManager','transaction','OpenchannelApplication','bulkCreate','findAndCountAll','getApplications','pick','getInteractions','Contact','Owner','fullname','internal','color','tag','addAgents','omit','emit','removeAgents','isArray','userOpenchannelAccount:remove','getAgents','DESC','out','OpenchannelMessage','Messages','dataValues','push','html-pdf','zip-dir','fast-json-patch','request-promise','moment','util','path','sox','to-csv','ejs','lodash','squel','crypto','desk.js','querystring','papaparse','../../components/auth/service','../../components/parsers/advancedSearch','../../config/logger','api','../../config/utils','../../mysqldb','redis','localhost','socket.io-emitter','./openchannelAccount.socket','register','jayson/promise','client','http','test','Sequelize','ValidationError','The\x20password\x20must\x20be\x20at\x20least\x208\x20characters\x20long\x20and\x20have\x201\x20lowercase\x20character,\x201\x20uppercase\x20character,\x201\x20number\x20and\x201\x20special\x20character\x20~!@#$%^&-_=+[{]}.','then','OpenchannelAccount,\x20%s,\x20%s'];(function(_0x1eda20,_0x1149f4){var _0x31b953=function(_0x25f0d8){while(--_0x25f0d8){_0x1eda20['push'](_0x1eda20['shift']());}};_0x31b953(++_0x1149f4);}(_0xa66b,0x156));var _0xba66=function(_0x5e1855,_0x17161e){_0x5e1855=_0x5e1855-0x0;var _0x4faf68=_0xa66b[_0x5e1855];return _0x4faf68;};'use strict';var pdf=require(_0xba66('0x0'));var emlformat=require('eml-format');var rimraf=require('rimraf');var zipdir=require(_0xba66('0x1'));var jsonpatch=require(_0xba66('0x2'));var rp=require(_0xba66('0x3'));var moment=require(_0xba66('0x4'));var BPromise=require('bluebird');var Mustache=require('mustache');var util=require(_0xba66('0x5'));var path=require(_0xba66('0x6'));var sox=require(_0xba66('0x7'));var csv=require(_0xba66('0x8'));var ejs=require(_0xba66('0x9'));var fs=require('fs');var _=require(_0xba66('0xa'));var squel=require(_0xba66('0xb'));var crypto=require(_0xba66('0xc'));var jsforce=require('jsforce');var deskjs=require(_0xba66('0xd'));var toCsv=require('to-csv');var querystring=require(_0xba66('0xe'));var Papa=require(_0xba66('0xf'));var Redis=require('ioredis');var authService=require(_0xba66('0x10'));var qs=require('../../components/parsers/qs');var as=require(_0xba66('0x11'));var hardwareService=require('../../config/license/hardware');var logger=require(_0xba66('0x12'))(_0xba66('0x13'));var utils=require(_0xba66('0x14'));var config=require('../../config/environment');var db=require(_0xba66('0x15'))['db'];config[_0xba66('0x16')]=_['defaults'](config['redis'],{'host':_0xba66('0x17'),'port':0x18eb});var socket=require(_0xba66('0x18'))(new Redis(config[_0xba66('0x16')]));require(_0xba66('0x19'))[_0xba66('0x1a')](socket);var jayson=require(_0xba66('0x1b'));var client=jayson[_0xba66('0x1c')][_0xba66('0x1d')]({'port':0x232c});var client9002=jayson[_0xba66('0x1c')][_0xba66('0x1d')]({'port':0x232a});function checkPasswordPattern(_0x4a2158,_0x26f08e,_0x308cb5){if(_0x308cb5){var _0x12531a=new RegExp(/(?=.*[a-z])(?=.*[A-Z])(?=.*[0-9])(?=.*[?!@#\$%\^&\*~\-_=+[{\]\}])(?=.{8,})/);if(_0x12531a[_0xba66('0x1e')](_0x26f08e)){return _0x4a2158;}else{throw new db[(_0xba66('0x1f'))][(_0xba66('0x20'))](_0xba66('0x21'));}}else{return _0x4a2158;}}function respondWithRpcPromise(_0x2b0b13,_0x49985b,_0xae9cc3,_0x142d6c){return new BPromise(function(_0x594f15,_0x11f1a8){var _0x4d5e0c=_0x142d6c||client;return _0x4d5e0c['request'](_0x2b0b13,_0xae9cc3)[_0xba66('0x22')](function(_0x3309b5){logger['info'](_0xba66('0x23'),_0x49985b,_0xba66('0x24'));logger[_0xba66('0x25')](_0xba66('0x26'),_0x49985b,'request\x20sent',JSON[_0xba66('0x27')](_0x3309b5));if(_0x3309b5[_0xba66('0x28')]){if(_0x3309b5['error']['code']===0x1f4){logger[_0xba66('0x28')](_0xba66('0x23'),_0x49985b,_0x3309b5['error']['message']);return _0x11f1a8(_0x3309b5[_0xba66('0x28')][_0xba66('0x29')]);}logger['error'](_0xba66('0x23'),_0x49985b,_0x3309b5[_0xba66('0x28')][_0xba66('0x29')]);return _0x594f15(_0x3309b5[_0xba66('0x28')][_0xba66('0x29')]);}else{logger[_0xba66('0x2a')]('OpenchannelAccount,\x20%s,\x20%s',_0x49985b,'request\x20sent');_0x594f15(_0x3309b5[_0xba66('0x2b')]['message']);}})['catch'](function(_0x3d248d){logger[_0xba66('0x28')](_0xba66('0x23'),_0x49985b,_0x3d248d);_0x11f1a8(_0x3d248d);});});}function respondWithStatusCode(_0x35708a,_0x4e922b){_0x4e922b=_0x4e922b||0xcc;return function(_0xe08ec3){if(_0xe08ec3){return _0x35708a[_0xba66('0x2c')](_0x4e922b);}return _0x35708a[_0xba66('0x2d')](_0x4e922b)[_0xba66('0x2e')]();};}function respondWithResult(_0x4291f9,_0x35e4dc){_0x35e4dc=_0x35e4dc||0xc8;return function(_0x33aa4e){if(_0x33aa4e){return _0x4291f9['status'](_0x35e4dc)[_0xba66('0x2f')](_0x33aa4e);}};}function respondWithFilteredResult(_0x58e0d2,_0x43941d){return function(_0x2d4e7d){if(_0x2d4e7d){var _0xf4ad02=_0x2d4e7d['count'],_0x100582=_0x43941d[_0xba66('0x30')],_0x1301cc=_0x43941d[_0xba66('0x30')]+_0x43941d[_0xba66('0x31')],_0x5c5856;if(_0x1301cc>=_0xf4ad02){_0x1301cc=_0xf4ad02;_0x5c5856=0xc8;}else{_0x5c5856=0xce;}_0x58e0d2[_0xba66('0x2d')](_0x5c5856);return _0x58e0d2['set']('Content-Range',_0x100582+'-'+_0x1301cc+'/'+_0xf4ad02)[_0xba66('0x2f')](_0x2d4e7d);}return null;};}function patchUpdates(_0x268759){return function(_0x48db89){try{jsonpatch['apply'](_0x48db89,_0x268759,!![]);}catch(_0x3e2b77){return BPromise[_0xba66('0x32')](_0x3e2b77);}return _0x48db89[_0xba66('0x33')]();};}function saveUpdates(_0x3af58b,_0x3bb2d5){return function(_0x4080e8){if(_0x4080e8){return _0x4080e8[_0xba66('0x34')](_0x3af58b)[_0xba66('0x22')](function(_0x198e02){return _0x198e02;});}return null;};}function removeEntity(_0x247098,_0xe63f1c){return function(_0x5a9229){if(_0x5a9229){return _0x5a9229[_0xba66('0x35')]()['then'](function(){var _0x5c2349=_0x5a9229[_0xba66('0x36')]({'plain':!![]});var _0x43b4c2='OpenchannelAccounts';return db[_0xba66('0x37')]['destroy']({'where':{'type':_0x43b4c2,'resourceId':_0x5c2349['id']}})[_0xba66('0x22')](function(){return _0x5a9229;});})[_0xba66('0x22')](function(){_0x247098[_0xba66('0x2d')](0xcc)[_0xba66('0x2e')]();});}};}function handleEntityNotFound(_0x3ce176,_0x390c17){return function(_0x40933c){if(!_0x40933c){_0x3ce176[_0xba66('0x2c')](0x194);}return _0x40933c;};}function handleError(_0x2af1e8,_0x596605){_0x596605=_0x596605||0x1f4;return function(_0x285aae){logger[_0xba66('0x28')](_0x285aae[_0xba66('0x38')]);if(_0x285aae[_0xba66('0x39')]){delete _0x285aae[_0xba66('0x39')];}_0x2af1e8['status'](_0x596605)[_0xba66('0x3a')](_0x285aae);};}exports[_0xba66('0x3b')]=function(_0x5430b9,_0x214f9b){var _0x3ece3f={'include':[{'model':db[_0xba66('0x3c')],'as':'mandatoryDispositionPause'}]},_0x70d0d4={},_0xd6f761={'count':0x0,'rows':[]};var _0x5c4177=_[_0xba66('0x3d')](db['OpenchannelAccount'][_0xba66('0x3e')],function(_0x33ffb3){return{'name':_0x33ffb3[_0xba66('0x3f')],'type':_0x33ffb3['type'][_0xba66('0x40')]};});_0x70d0d4[_0xba66('0x41')]=_['map'](_0x5c4177,_0xba66('0x39'));_0x70d0d4[_0xba66('0x42')]=_[_0xba66('0x43')](_0x5430b9[_0xba66('0x42')]);_0x70d0d4[_0xba66('0x44')]=_[_0xba66('0x45')](_0x70d0d4[_0xba66('0x41')],_0x70d0d4['query']);_0x3ece3f[_0xba66('0x46')]=_['intersection'](_0x70d0d4[_0xba66('0x41')],qs['fields'](_0x5430b9[_0xba66('0x42')][_0xba66('0x47')]));_0x3ece3f['attributes']=_0x3ece3f['attributes']['length']?_0x3ece3f[_0xba66('0x46')]:_0x70d0d4[_0xba66('0x41')];if(!_0x5430b9[_0xba66('0x42')][_0xba66('0x48')](_0xba66('0x49'))){_0x3ece3f[_0xba66('0x31')]=qs['limit'](_0x5430b9[_0xba66('0x42')]['limit']);_0x3ece3f[_0xba66('0x30')]=qs[_0xba66('0x30')](_0x5430b9[_0xba66('0x42')][_0xba66('0x30')]);}_0x3ece3f[_0xba66('0x4a')]=qs['sort'](_0x5430b9[_0xba66('0x42')][_0xba66('0x4b')]);_0x3ece3f[_0xba66('0x4c')]=qs[_0xba66('0x44')](_['pick'](_0x5430b9[_0xba66('0x42')],_0x70d0d4[_0xba66('0x44')]));if(_0x5430b9[_0xba66('0x42')][_0xba66('0x4d')]){_0x3ece3f['where']=_['merge'](_0x3ece3f[_0xba66('0x4c')],{'$or':_['map'](_0x5c4177,function(_0x24c02c){if(_0x24c02c['type']!=='VIRTUAL'){var _0x13515c={};_0x13515c[_0x24c02c[_0xba66('0x39')]]={'$like':'%'+_0x5430b9['query']['filter']+'%'};return _0x13515c;}})});}_0x3ece3f=_['merge']({},_0x3ece3f,_0x5430b9[_0xba66('0x4e')]);var _0x13d871={'where':_0x3ece3f['where']};return db[_0xba66('0x4f')][_0xba66('0x50')](_0x13d871)[_0xba66('0x22')](function(_0x4078cd){_0xd6f761['count']=_0x4078cd;if(_0x5430b9[_0xba66('0x42')][_0xba66('0x51')]){_0x3ece3f[_0xba66('0x52')]=[{'all':!![]}];}return db[_0xba66('0x4f')][_0xba66('0x53')](_0x3ece3f);})[_0xba66('0x22')](function(_0xde01a9){_0xd6f761[_0xba66('0x54')]=_0xde01a9;return _0xd6f761;})[_0xba66('0x22')](respondWithFilteredResult(_0x214f9b,_0x3ece3f))['catch'](handleError(_0x214f9b,null));};exports[_0xba66('0x55')]=function(_0x5dac94,_0x37f283){var _0x5b3d13={'raw':![],'where':{'id':_0x5dac94[_0xba66('0x56')]['id']},'include':[{'model':db[_0xba66('0x3c')],'as':_0xba66('0x57')}]},_0x5760bb={};_0x5760bb[_0xba66('0x41')]=_['keys'](db[_0xba66('0x4f')][_0xba66('0x3e')]);_0x5760bb[_0xba66('0x42')]=_[_0xba66('0x43')](_0x5dac94[_0xba66('0x42')]);_0x5760bb[_0xba66('0x44')]=_[_0xba66('0x45')](_0x5760bb[_0xba66('0x41')],_0x5760bb[_0xba66('0x42')]);_0x5b3d13[_0xba66('0x46')]=_[_0xba66('0x45')](_0x5760bb[_0xba66('0x41')],qs['fields'](_0x5dac94['query'][_0xba66('0x47')]));_0x5b3d13['attributes']=_0x5b3d13[_0xba66('0x46')][_0xba66('0x58')]?_0x5b3d13[_0xba66('0x46')]:_0x5760bb['model'];if(_0x5dac94[_0xba66('0x42')]['includeAll']){_0x5b3d13[_0xba66('0x52')]=[{'all':!![]}];}_0x5b3d13=_[_0xba66('0x59')]({},_0x5b3d13,_0x5dac94[_0xba66('0x4e')]);return db[_0xba66('0x4f')][_0xba66('0x5a')](_0x5b3d13)[_0xba66('0x22')](handleEntityNotFound(_0x37f283,null))[_0xba66('0x22')](respondWithResult(_0x37f283,null))[_0xba66('0x5b')](handleError(_0x37f283,null));};exports[_0xba66('0x5c')]=function(_0x2a30f8,_0x3c8c24){return db[_0xba66('0x4f')][_0xba66('0x5c')](_0x2a30f8[_0xba66('0x5d')],{})['then'](function(_0x5cd13d){var _0x1781a5=_0x2a30f8['user'][_0xba66('0x36')]({'plain':!![]});if(!_0x1781a5)throw new Error(_0xba66('0x5e'));if(_0x1781a5[_0xba66('0x5f')]===_0xba66('0x60')){var _0x2cd338=_0x5cd13d[_0xba66('0x36')]({'plain':!![]});var _0x1b1ea8=_0xba66('0x61');return db[_0xba66('0x62')][_0xba66('0x5a')]({'where':{'name':_0x1b1ea8,'userProfileId':_0x1781a5[_0xba66('0x63')]},'raw':!![]})[_0xba66('0x22')](function(_0x28d8fb){if(_0x28d8fb&&_0x28d8fb[_0xba66('0x64')]===0x0){return db[_0xba66('0x37')][_0xba66('0x5c')]({'name':_0x2cd338[_0xba66('0x39')],'resourceId':_0x2cd338['id'],'type':_0x28d8fb[_0xba66('0x39')],'sectionId':_0x28d8fb['id']},{})[_0xba66('0x22')](function(){return _0x5cd13d;});}else{return _0x5cd13d;}})[_0xba66('0x5b')](function(_0x2030ea){logger[_0xba66('0x28')](_0xba66('0x65'),_0x2030ea);throw _0x2030ea;});}return _0x5cd13d;})['then'](respondWithResult(_0x3c8c24,0xc9))['catch'](handleError(_0x3c8c24,null));};exports['update']=function(_0x5f378f,_0x50b767){if(_0x5f378f['body']['id']){delete _0x5f378f[_0xba66('0x5d')]['id'];}return db[_0xba66('0x4f')][_0xba66('0x5a')]({'where':{'id':_0x5f378f['params']['id']},'include':[{'model':db[_0xba66('0x3c')],'as':_0xba66('0x57')}]})[_0xba66('0x22')](handleEntityNotFound(_0x50b767,null))[_0xba66('0x22')](saveUpdates(_0x5f378f[_0xba66('0x5d')],null))[_0xba66('0x22')](respondWithResult(_0x50b767,null))[_0xba66('0x5b')](handleError(_0x50b767,null));};exports[_0xba66('0x35')]=function(_0x2e55f9,_0x368b4e){return db[_0xba66('0x4f')][_0xba66('0x5a')]({'where':{'id':_0x2e55f9['params']['id']}})[_0xba66('0x22')](handleEntityNotFound(_0x368b4e,null))[_0xba66('0x22')](removeEntity(_0x368b4e,null))[_0xba66('0x5b')](handleError(_0x368b4e,null));};exports[_0xba66('0x66')]=function(_0x18f013,_0x359538){return db[_0xba66('0x4f')][_0xba66('0x66')]()['then'](respondWithResult(_0x359538,null))[_0xba66('0x5b')](handleError(_0x359538,null));};exports[_0xba66('0x67')]=function(_0x18923e,_0x50c0f3,_0x4d4199){if(_0x18923e[_0xba66('0x5d')]['id']){delete _0x18923e[_0xba66('0x5d')]['id'];}return db[_0xba66('0x4f')][_0xba66('0x5a')]({'where':{'id':_0x18923e['params']['id']}})[_0xba66('0x22')](handleEntityNotFound(_0x50c0f3,null))[_0xba66('0x22')](function(_0xdf0015){if(_0xdf0015){_0x18923e[_0xba66('0x5d')][_0xba66('0x68')]=_0xdf0015['id'];return db[_0xba66('0x69')][_0xba66('0x5c')](_0x18923e[_0xba66('0x5d')]);}})[_0xba66('0x22')](respondWithResult(_0x50c0f3,null))[_0xba66('0x5b')](handleError(_0x50c0f3,null));};exports[_0xba66('0x6a')]=function(_0x5b4fa2,_0x2cc1c1,_0x4d95e9){var _0x1f774a={'raw':![],'where':{}};var _0x4a8635={};var _0x248931={'count':0x0,'rows':[]};return db[_0xba66('0x4f')]['findOne']({'where':{'id':_0x5b4fa2[_0xba66('0x56')]['id']}})[_0xba66('0x22')](handleEntityNotFound(_0x2cc1c1,null))['then'](function(_0x552a41){if(_0x552a41){_0x4a8635[_0xba66('0x41')]=_[_0xba66('0x43')](db[_0xba66('0x69')][_0xba66('0x3e')]);_0x4a8635[_0xba66('0x42')]=_[_0xba66('0x43')](_0x5b4fa2['query']);_0x4a8635[_0xba66('0x44')]=_['intersection'](_0x4a8635[_0xba66('0x41')],_0x4a8635[_0xba66('0x42')]);_0x1f774a[_0xba66('0x46')]=_[_0xba66('0x45')](_0x4a8635[_0xba66('0x41')],qs[_0xba66('0x47')](_0x5b4fa2['query']['fields']));_0x1f774a[_0xba66('0x46')]=_0x1f774a['attributes'][_0xba66('0x58')]?_0x1f774a[_0xba66('0x46')]:_0x4a8635[_0xba66('0x41')];if(!_0x5b4fa2[_0xba66('0x42')][_0xba66('0x48')](_0xba66('0x49'))){_0x1f774a['limit']=qs[_0xba66('0x31')](_0x5b4fa2[_0xba66('0x42')][_0xba66('0x31')]);_0x1f774a['offset']=qs[_0xba66('0x30')](_0x5b4fa2[_0xba66('0x42')]['offset']);}_0x1f774a['order']=qs['sort'](_0x5b4fa2['query']['sort']);_0x1f774a[_0xba66('0x4c')]=qs[_0xba66('0x44')](_['pick'](_0x5b4fa2['query'],_0x4a8635['filters']));_0x1f774a[_0xba66('0x4c')][_0xba66('0x6b')]=_0x552a41['id'];if(_0x5b4fa2['query']['filter']){_0x1f774a['where']=_[_0xba66('0x59')](_0x1f774a[_0xba66('0x4c')],{'$or':_[_0xba66('0x3d')](_0x1f774a[_0xba66('0x46')],function(_0x1c4d64){var _0x4313ee={};_0x4313ee[_0x1c4d64]={'$like':'%'+_0x5b4fa2[_0xba66('0x42')][_0xba66('0x4d')]+'%'};return _0x4313ee;})});}_0x1f774a=_['merge']({},_0x1f774a,_0x5b4fa2[_0xba66('0x4e')]);return db[_0xba66('0x69')]['count']({'where':_0x1f774a[_0xba66('0x4c')]})[_0xba66('0x22')](function(_0x451657){_0x248931[_0xba66('0x50')]=_0x451657;if(_0x5b4fa2[_0xba66('0x42')]['includeAll']){_0x1f774a[_0xba66('0x52')]=[{'all':!![]}];}return db[_0xba66('0x69')][_0xba66('0x53')](_0x1f774a);})[_0xba66('0x22')](function(_0x42e327){_0x248931['rows']=_0x42e327;return _0x248931;});}})[_0xba66('0x22')](respondWithFilteredResult(_0x2cc1c1,_0x1f774a))[_0xba66('0x5b')](handleError(_0x2cc1c1,null));};exports[_0xba66('0x6c')]=function(_0x5c64cc,_0x1bbd6c,_0xc92b59){return db[_0xba66('0x4f')][_0xba66('0x5a')]({'where':{'id':_0x5c64cc[_0xba66('0x56')]['id']}})[_0xba66('0x22')](handleEntityNotFound(_0x1bbd6c,null))[_0xba66('0x22')](function(_0x3791b2){if(_0x3791b2){return _0x3791b2[_0xba66('0x6c')](_0x5c64cc[_0xba66('0x42')][_0xba66('0x6d')]);}})['then'](respondWithStatusCode(_0x1bbd6c,null))[_0xba66('0x5b')](handleError(_0x1bbd6c,null));};exports[_0xba66('0x6e')]=function(_0x10b01e,_0x3edf5c,_0x1c075f){if(_0x10b01e[_0xba66('0x5d')]['id']){delete _0x10b01e[_0xba66('0x5d')]['id'];}return db[_0xba66('0x4f')][_0xba66('0x5a')]({'where':{'id':_0x10b01e['params']['id']}})[_0xba66('0x22')](handleEntityNotFound(_0x3edf5c,null))['then'](function(_0x7da772){if(_0x7da772){_0x10b01e[_0xba66('0x5d')][_0xba66('0x6b')]=_0x7da772['id'];return db[_0xba66('0x6f')]['create'](_0x10b01e['body']);}})[_0xba66('0x22')](respondWithResult(_0x3edf5c,null))[_0xba66('0x5b')](handleError(_0x3edf5c,null));};exports[_0xba66('0x70')]=function(_0x3167b8,_0x42beb4,_0x96c51b){var _0x186a97={'raw':![],'where':{}};var _0x46ce34={};var _0x599b15={'count':0x0,'rows':[]};return db['OpenchannelAccount'][_0xba66('0x71')]({'where':{'id':_0x3167b8[_0xba66('0x56')]['id']}})[_0xba66('0x22')](handleEntityNotFound(_0x42beb4,null))[_0xba66('0x22')](function(_0x3d41ce){if(_0x3d41ce){_0x46ce34[_0xba66('0x41')]=_[_0xba66('0x43')](db[_0xba66('0x6f')][_0xba66('0x3e')]);_0x46ce34['query']=_['keys'](_0x3167b8[_0xba66('0x42')]);_0x46ce34[_0xba66('0x44')]=_[_0xba66('0x45')](_0x46ce34['model'],_0x46ce34[_0xba66('0x42')]);_0x186a97['attributes']=_['intersection'](_0x46ce34[_0xba66('0x41')],qs[_0xba66('0x47')](_0x3167b8['query'][_0xba66('0x47')]));_0x186a97[_0xba66('0x46')]=_0x186a97[_0xba66('0x46')][_0xba66('0x58')]?_0x186a97[_0xba66('0x46')]:_0x46ce34['model'];if(!_0x3167b8[_0xba66('0x42')][_0xba66('0x48')](_0xba66('0x49'))){_0x186a97['limit']=qs[_0xba66('0x31')](_0x3167b8[_0xba66('0x42')][_0xba66('0x31')]);_0x186a97[_0xba66('0x30')]=qs[_0xba66('0x30')](_0x3167b8[_0xba66('0x42')][_0xba66('0x30')]);}_0x186a97[_0xba66('0x4a')]=qs[_0xba66('0x4b')](_0x3167b8['query']['sort']);_0x186a97['where']=qs['filters'](_['pick'](_0x3167b8[_0xba66('0x42')],_0x46ce34['filters']));_0x186a97[_0xba66('0x4c')][_0xba66('0x6b')]=_0x3d41ce['id'];if(_0x3167b8[_0xba66('0x42')]['filter']){_0x186a97[_0xba66('0x4c')]=_[_0xba66('0x59')](_0x186a97['where'],{'$or':_[_0xba66('0x3d')](_0x186a97['attributes'],function(_0x4c2fe3){var _0x324903={};_0x324903[_0x4c2fe3]={'$like':'%'+_0x3167b8['query'][_0xba66('0x4d')]+'%'};return _0x324903;})});}_0x186a97=_[_0xba66('0x59')]({},_0x186a97,_0x3167b8[_0xba66('0x4e')]);return db[_0xba66('0x6f')][_0xba66('0x50')]({'where':_0x186a97[_0xba66('0x4c')]})['then'](function(_0x5c8b1c){_0x599b15[_0xba66('0x50')]=_0x5c8b1c;if(_0x3167b8[_0xba66('0x42')][_0xba66('0x51')]){_0x186a97[_0xba66('0x52')]=[{'all':!![]}];}return db[_0xba66('0x6f')]['findAll'](_0x186a97);})['then'](function(_0x2f0249){_0x599b15['rows']=_0x2f0249;return _0x599b15;});}})['then'](respondWithFilteredResult(_0x42beb4,_0x186a97))['catch'](handleError(_0x42beb4,null));};exports[_0xba66('0x72')]=function(_0x4882ad,_0x4580e2,_0x18c798){return db['OpenchannelAccount'][_0xba66('0x5a')]({'where':{'id':_0x4882ad[_0xba66('0x56')]['id']}})[_0xba66('0x22')](handleEntityNotFound(_0x4580e2,null))[_0xba66('0x22')](function(_0x4afc3f){if(_0x4afc3f){return _0x4afc3f[_0xba66('0x72')](_0x4882ad[_0xba66('0x42')][_0xba66('0x6d')]);}})['then'](respondWithStatusCode(_0x4580e2,null))[_0xba66('0x5b')](handleError(_0x4580e2,null));};exports[_0xba66('0x73')]=function(_0x363285,_0xe3503b,_0x50c94b){var _0x3c3637={'body':_0x363285['body'],'channel':_0xba66('0x74')};var _0x3b8d87=[];var _0xca1038=[];var _0x22f1e1={};var _0x214e65=![];return db['CmContact'][_0xba66('0x66')]()['then'](function(_0x46a7de){if(!_0x46a7de){throw new db[(_0xba66('0x1f'))][(_0xba66('0x20'))](_0xba66('0x75'));}_0x3b8d87=_['difference'](_[_0xba66('0x43')](_0x46a7de),['createdAt','updatedAt']);_0xca1038=_['difference'](_[_0xba66('0x43')](_0x46a7de),[_0xba66('0x76'),_0xba66('0x77'),_0xba66('0x78'),_0xba66('0x79')]);if(_0x363285[_0xba66('0x5d')]['id']){delete _0x363285['body']['id'];}if(_[_0xba66('0x7a')](_0x363285[_0xba66('0x5d')][_0xba66('0x7b')])){throw new db[(_0xba66('0x1f'))][(_0xba66('0x20'))](_0xba66('0x7c'));}if(_[_0xba66('0x7a')](_0x363285[_0xba66('0x5d')][_0xba66('0x5d')])||_0x363285['body'][_0xba66('0x5d')]===''){throw new db[(_0xba66('0x1f'))]['ValidationError'](_0xba66('0x7d'));}if(_[_0xba66('0x7a')](_0x363285['body'][_0xba66('0x7e')])){throw new db[(_0xba66('0x1f'))]['ValidationError'](_0xba66('0x7f')+_0xca1038);}if(!_[_0xba66('0x80')](_0xca1038,_0x363285[_0xba66('0x5d')][_0xba66('0x7e')])){throw new db[(_0xba66('0x1f'))][(_0xba66('0x20'))](_0xba66('0x81')+_0xca1038);}_0x22f1e1[_0x363285[_0xba66('0x5d')][_0xba66('0x7e')]]=_0x363285[_0xba66('0x5d')][_0xba66('0x7b')];})[_0xba66('0x22')](function(){return db[_0xba66('0x4f')][_0xba66('0x5a')]({'where':{'id':_0x363285[_0xba66('0x56')]['id']},'include':[{'model':db[_0xba66('0x82')],'as':_0xba66('0x83'),'include':[{'model':db[_0xba66('0x84')],'as':_0xba66('0x85'),'where':_0x22f1e1,'limit':0x1,'order':[['updatedAt','DESC']]}]},{'model':db['OpenchannelApplication'],'as':_0xba66('0x86')}]});})[_0xba66('0x22')](handleEntityNotFound(_0xe3503b,null))[_0xba66('0x22')](function(_0x3247db){if(_0x3247db&&_0x3247db[_0xba66('0x83')]){_0x3c3637['account']=_0x3247db;_0x3c3637[_0xba66('0x87')]=_0x3247db[_0xba66('0x86')];_0x3c3637[_0xba66('0x88')]=_0x3247db[_0xba66('0x83')];_0x3c3637['applications']=_[_0xba66('0x89')](_0x3c3637['applications'],[_0xba66('0x8a')],[_0xba66('0x8b')]);if(_0x3c3637[_0xba66('0x8c')][_0xba66('0x86')]){delete _0x3c3637['account'][_0xba66('0x86')];}if(_0x3c3637[_0xba66('0x8c')][_0xba66('0x83')]&&_0x3c3637[_0xba66('0x8c')][_0xba66('0x83')][_0xba66('0x85')]['length']){return _0x3c3637['account']['List']['Contacts'][0x0];}var _0x1348cd=_[_0xba66('0x8d')](_0x363285['body'],{'firstName':_0x363285[_0xba66('0x5d')][_0xba66('0x7b')],'ListId':_0x3247db['ListId']});_0x1348cd[_0x363285[_0xba66('0x5d')][_0xba66('0x7e')]]=_0x363285['body'][_0xba66('0x7b')];return db[_0xba66('0x84')][_0xba66('0x5c')](_0x1348cd,{'fields':_0x3b8d87,'raw':!![]});}})[_0xba66('0x22')](handleEntityNotFound(_0xe3503b,null))['then'](function(_0x140550){_0x3c3637['contact']=_0x140550;if(_0x140550){var _0x2bf46d={'ContactId':_0x140550['id'],'OpenchannelAccountId':_0x363285['params']['id'],'from':(_0x140550['firstName']||'')+'\x20'+(_0x140550['lastName']||'')};var _0x8e63e5={'OpenchannelAccountId':_0x363285[_0xba66('0x56')]['id'],'closed':![]};if(_0x363285[_0xba66('0x5d')][_0xba66('0x8e')]){_0x8e63e5[_0xba66('0x8e')]=_0x363285[_0xba66('0x5d')]['threadId'];return db['OpenchannelInteraction'][_0xba66('0x5a')]({'where':_0x8e63e5})[_0xba66('0x22')](function(_0x17b657){if(_0x17b657){return[_0x17b657,![]];}_0x2bf46d[_0xba66('0x8e')]=_0x363285[_0xba66('0x5d')][_0xba66('0x8e')];_0x2bf46d[_0xba66('0x8f')]=_0x363285['body'][_0xba66('0x8f')];return db[_0xba66('0x90')][_0xba66('0x5c')](_0x2bf46d)[_0xba66('0x22')](function(_0x751f17){return[_0x751f17,!![]];});});}else{_0x8e63e5[_0xba66('0x8e')]=null;}_0x8e63e5[_0xba66('0x91')]=_0x140550['id'];return db[_0xba66('0x90')][_0xba66('0x5a')]({'where':_0x8e63e5})[_0xba66('0x22')](function(_0x51d44e){if(_0x51d44e){return[_0x51d44e,![]];}return db[_0xba66('0x90')][_0xba66('0x5c')](_0x2bf46d)[_0xba66('0x22')](function(_0x37b34c){return[_0x37b34c,!![]];});});}})[_0xba66('0x92')](function(_0x5ebacf,_0x5bca2f){if(_0x5ebacf){_0x214e65=_0x5bca2f;if(!_0x5bca2f){var _0x42de74={'from':(_0x3c3637[_0xba66('0x93')][_0xba66('0x94')]||'')+'\x20'+(_0x3c3637[_0xba66('0x93')]['lastName']||'')};if(_0x363285[_0xba66('0x5d')][_0xba66('0x8e')]&&_0x363285[_0xba66('0x5d')][_0xba66('0x95')]&&_0x363285[_0xba66('0x5d')]['threadId']!=_0x363285[_0xba66('0x5d')]['messageId']){_0x42de74[_0xba66('0x8e')]=_0x363285['body'][_0xba66('0x95')];}return _0x5ebacf[_0xba66('0x34')](_0x42de74);}else{return _0x5ebacf;}}})[_0xba66('0x22')](function(_0x459e03){_0x3c3637['interaction']=_0x459e03['get']({'plain':!![]});_0x3c3637[_0xba66('0x96')]['created']=_0x214e65;if(_0x3c3637[_0xba66('0x96')][_0xba66('0x97')]){if(_0x3c3637[_0xba66('0x8c')]['autoclose']){_0x3c3637[_0xba66('0x87')]['push']({'id':0x0,'priority':_0x3c3637[_0xba66('0x87')]['length']+0x1,'app':_0xba66('0x98'),'appdata':'unmanaged','interval':'*,*,*,*'});}}return db['OpenchannelMessage'][_0xba66('0x5c')]({'body':_0x363285[_0xba66('0x5d')][_0xba66('0x5d')],'OpenchannelAccountId':_0x363285[_0xba66('0x56')]['id'],'OpenchannelInteractionId':_0x459e03['id'],'direction':'in','ContactId':_0x3c3637[_0xba66('0x93')]['id'],'AttachmentId':_0x363285[_0xba66('0x5d')][_0xba66('0x99')]});})[_0xba66('0x22')](function(_0x1c85eb){_0x3c3637[_0xba66('0x29')]=_0x1c85eb;if(_0x3c3637[_0xba66('0x96')][_0xba66('0x9a')]){return db[_0xba66('0x9b')]['find']({'attributes':['id',_0xba66('0x39')],'where':{'id':_0x3c3637[_0xba66('0x96')][_0xba66('0x9a')]}})[_0xba66('0x22')](function(_0x344627){if(_0x344627){_0x3c3637[_0xba66('0x87')]['unshift']({'id':0x0,'priority':0x0,'app':_0xba66('0x9c'),'appdata':_0x344627[_0xba66('0x39')]+','+(_0x3c3637[_0xba66('0x8c')][_0xba66('0x9d')]||0xa),'interval':_0xba66('0x9e')});_0x3c3637[_0xba66('0x9f')]=![];}return respondWithRpcPromise(_0xba66('0xa0'),_0xba66('0xa1'),_0x3c3637);});}return respondWithRpcPromise('Start',_0xba66('0xa1'),_0x3c3637);})['then'](function(_0x13b2bc){respondWithRpcPromise(_0xba66('0xa2'),_0xba66('0xa2'),{'event':_0xba66('0x73'),'message':_0x13b2bc},client9002);return _0x13b2bc;})[_0xba66('0x22')](respondWithResult(_0xe3503b,null))[_0xba66('0x5b')](handleError(_0xe3503b,null));};exports['addApplications']=function(_0x228000,_0x41ac3b,_0x5b7c01){return db[_0xba66('0x4f')][_0xba66('0x71')]({'where':{'id':_0x228000['params']['id']}})['then'](handleEntityNotFound(_0x41ac3b,null))[_0xba66('0x22')](function(_0x41a2df){if(_0x41a2df){return db['sequelize'][_0xba66('0xa3')](function(_0x34e6c9){return db[_0xba66('0xa4')][_0xba66('0x35')]({'where':{'OpenchannelAccountId':_0x228000[_0xba66('0x56')]['id']},'transaction':_0x34e6c9})[_0xba66('0x22')](function(_0xd6b85e){var _0x265268=_[_0xba66('0x3d')](_0x228000[_0xba66('0x5d')],function(_0x43f0f0){_0x43f0f0['OpenchannelAccountId']=_0x228000[_0xba66('0x56')]['id'];return _0x43f0f0;});return db['OpenchannelApplication'][_0xba66('0xa5')](_0x265268,{'transaction':_0x34e6c9});});})['then'](function(){return db[_0xba66('0xa4')][_0xba66('0xa6')]({'where':{'OpenchannelAccountId':_0x228000[_0xba66('0x56')]['id']},'order':_0xba66('0x8a')});});}})[_0xba66('0x22')](respondWithResult(_0x41ac3b,null))[_0xba66('0x5b')](handleError(_0x41ac3b,null));};exports[_0xba66('0xa7')]=function(_0x1a62f9,_0xdb6dcb,_0x13dd05){var _0x30a036={};var _0x5e8267={};var _0x1eed39;var _0x26573b;return db[_0xba66('0x4f')][_0xba66('0x71')]({'where':{'id':_0x1a62f9[_0xba66('0x56')]['id']}})[_0xba66('0x22')](handleEntityNotFound(_0xdb6dcb,null))['then'](function(_0x3d2813){if(_0x3d2813){_0x1eed39=_0x3d2813;_0x5e8267[_0xba66('0x41')]=_['keys'](db[_0xba66('0xa4')][_0xba66('0x3e')]);_0x5e8267['query']=_[_0xba66('0x43')](_0x1a62f9['query']);_0x5e8267['filters']=_['intersection'](_0x5e8267[_0xba66('0x41')],_0x5e8267[_0xba66('0x42')]);_0x30a036[_0xba66('0x46')]=_['intersection'](_0x5e8267['model'],qs[_0xba66('0x47')](_0x1a62f9[_0xba66('0x42')][_0xba66('0x47')]));_0x30a036['attributes']=_0x30a036[_0xba66('0x46')]['length']?_0x30a036['attributes']:_0x5e8267[_0xba66('0x41')];_0x30a036[_0xba66('0x4a')]=qs[_0xba66('0x4b')](_0x1a62f9['query']['sort']);_0x30a036[_0xba66('0x4c')]=qs[_0xba66('0x44')](_[_0xba66('0xa8')](_0x1a62f9['query'],_0x5e8267[_0xba66('0x44')]));if(_0x1a62f9[_0xba66('0x42')][_0xba66('0x4d')]){_0x30a036[_0xba66('0x4c')]=_[_0xba66('0x59')](_0x30a036['where'],{'$or':_[_0xba66('0x3d')](_0x30a036[_0xba66('0x46')],function(_0x1c8e69){var _0x115b51={};_0x115b51[_0x1c8e69]={'$like':'%'+_0x1a62f9[_0xba66('0x42')]['filter']+'%'};return _0x115b51;})});}_0x30a036=_[_0xba66('0x59')]({},_0x30a036,_0x1a62f9[_0xba66('0x4e')]);return _0x1eed39[_0xba66('0xa7')](_0x30a036);}})[_0xba66('0x22')](function(_0x569a47){if(_0x569a47){_0x26573b=_0x569a47['length'];if(!_0x1a62f9[_0xba66('0x42')][_0xba66('0x48')]('nolimit')){_0x30a036['limit']=qs['limit'](_0x1a62f9[_0xba66('0x42')][_0xba66('0x31')]);_0x30a036[_0xba66('0x30')]=qs['offset'](_0x1a62f9['query']['offset']);}return _0x1eed39[_0xba66('0xa7')](_0x30a036);}})['then'](function(_0x3c578c){if(_0x3c578c){return _0x3c578c?{'count':_0x26573b,'rows':_0x3c578c}:null;}})['then'](respondWithResult(_0xdb6dcb,null))['catch'](handleError(_0xdb6dcb,null));};exports[_0xba66('0xa9')]=function(_0xce161,_0xd34cf,_0x165f1c){var _0x357eac={'raw':![],'where':{}};var _0x3f78e5={};var _0x288e9e={'count':0x0,'rows':[]};return db[_0xba66('0x4f')][_0xba66('0x71')]({'where':{'id':_0xce161[_0xba66('0x56')]['id']}})[_0xba66('0x22')](handleEntityNotFound(_0xd34cf,null))[_0xba66('0x22')](function(_0x27d63d){if(_0x27d63d){_0x3f78e5['model']=_[_0xba66('0x43')](db[_0xba66('0x90')]['rawAttributes']);_0x3f78e5[_0xba66('0x42')]=_[_0xba66('0x43')](_0xce161[_0xba66('0x42')]);_0x3f78e5[_0xba66('0x44')]=_[_0xba66('0x45')](_0x3f78e5[_0xba66('0x41')],_0x3f78e5[_0xba66('0x42')]);_0x357eac['attributes']=_[_0xba66('0x45')](_0x3f78e5[_0xba66('0x41')],qs[_0xba66('0x47')](_0xce161['query'][_0xba66('0x47')]));_0x357eac[_0xba66('0x46')]=_0x357eac[_0xba66('0x46')]['length']?_0x357eac[_0xba66('0x46')]:_0x3f78e5[_0xba66('0x41')];if(!_0xce161['query'][_0xba66('0x48')]('nolimit')){_0x357eac[_0xba66('0x31')]=qs[_0xba66('0x31')](_0xce161['query'][_0xba66('0x31')]);_0x357eac[_0xba66('0x30')]=qs[_0xba66('0x30')](_0xce161[_0xba66('0x42')][_0xba66('0x30')]);}_0x357eac[_0xba66('0x4a')]=qs[_0xba66('0x4b')](_0xce161[_0xba66('0x42')][_0xba66('0x4b')]);_0x357eac[_0xba66('0x4c')]=qs[_0xba66('0x44')](_[_0xba66('0xa8')](_0xce161[_0xba66('0x42')],_0x3f78e5[_0xba66('0x44')]));_0x357eac['where']['OpenchannelAccountId']=_0x27d63d['id'];if(_0xce161[_0xba66('0x42')][_0xba66('0x4d')]){_0x357eac[_0xba66('0x4c')]=_[_0xba66('0x59')](_0x357eac[_0xba66('0x4c')],{'$or':_[_0xba66('0x3d')](_0x357eac[_0xba66('0x46')],function(_0x28c493){var _0x258dbe={};_0x258dbe[_0x28c493]={'$like':'%'+_0xce161['query'][_0xba66('0x4d')]+'%'};return _0x258dbe;})});}_0x357eac=_[_0xba66('0x59')]({},_0x357eac,_0xce161[_0xba66('0x4e')]);return db[_0xba66('0x90')][_0xba66('0x50')]({'where':_0x357eac[_0xba66('0x4c')]})[_0xba66('0x22')](function(_0xfa0c46){_0x288e9e[_0xba66('0x50')]=_0xfa0c46;if(_0xce161[_0xba66('0x42')][_0xba66('0x51')]){_0x357eac[_0xba66('0x52')]=[{'model':db[_0xba66('0x84')],'as':_0xba66('0xaa'),'required':![]},{'model':db[_0xba66('0x9b')],'as':_0xba66('0xab'),'attributes':[_0xba66('0x39'),_0xba66('0xac'),_0xba66('0xad')],'required':![]},{'model':db['Tag'],'as':'Tags','attributes':['id',_0xba66('0x39'),_0xba66('0xae')],'where':_0xce161[_0xba66('0x42')][_0xba66('0xaf')]?{'id':_0xce161[_0xba66('0x42')][_0xba66('0xaf')]}:undefined,'required':_0xce161[_0xba66('0x42')][_0xba66('0xaf')]?!![]:![]}];}return db['OpenchannelInteraction'][_0xba66('0x53')](_0x357eac);})['then'](function(_0xa6d337){_0x288e9e[_0xba66('0x54')]=_0xa6d337;return _0x288e9e;});}})[_0xba66('0x22')](respondWithFilteredResult(_0xd34cf,_0x357eac))['catch'](handleError(_0xd34cf,null));};exports[_0xba66('0xb0')]=function(_0xf6686,_0x762905,_0x165a60){return db[_0xba66('0x4f')][_0xba66('0x5a')]({'where':{'id':_0xf6686[_0xba66('0x56')]['id']}})[_0xba66('0x22')](handleEntityNotFound(_0x762905,null))[_0xba66('0x22')](function(_0x21f449){if(_0x21f449){return _0x21f449[_0xba66('0xb0')](_0xf6686[_0xba66('0x5d')][_0xba66('0x6d')],_[_0xba66('0xb1')](_0xf6686['body'],[_0xba66('0x6d'),'id'])||{})[_0xba66('0x92')](function(_0x23a7e9){for(var _0x3fad47=0x0;_0x3fad47<_0xf6686[_0xba66('0x5d')][_0xba66('0x6d')]['length'];_0x3fad47+=0x1){socket[_0xba66('0xb2')]('userOpenchannelAccount:save',{'UserId':_0xf6686[_0xba66('0x5d')][_0xba66('0x6d')][_0x3fad47],'OpenchannelAccountId':_0xf6686[_0xba66('0x56')]['id']});}return _0x23a7e9;});}})[_0xba66('0x22')](respondWithResult(_0x762905,null))['catch'](handleError(_0x762905,null));};exports[_0xba66('0xb3')]=function(_0x1f45c2,_0xed0981,_0x499238){return db[_0xba66('0x4f')][_0xba66('0x5a')]({'where':{'id':_0x1f45c2['params']['id']}})[_0xba66('0x22')](handleEntityNotFound(_0xed0981,null))[_0xba66('0x22')](function(_0xa6170b){if(_0xa6170b){return _0xa6170b[_0xba66('0xb3')](_0x1f45c2['query'][_0xba66('0x6d')])[_0xba66('0x22')](function(){if(_[_0xba66('0xb4')](_0x1f45c2['query'][_0xba66('0x6d')])){for(var _0x54fe54=0x0;_0x54fe54<_0x1f45c2[_0xba66('0x42')]['ids'][_0xba66('0x58')];_0x54fe54+=0x1){socket['emit'](_0xba66('0xb5'),{'UserId':Number(_0x1f45c2[_0xba66('0x42')][_0xba66('0x6d')][_0x54fe54]),'OpenchannelAccountId':Number(_0x1f45c2[_0xba66('0x56')]['id'])});}}else{socket['emit'](_0xba66('0xb5'),{'UserId':Number(_0x1f45c2[_0xba66('0x42')][_0xba66('0x6d')]),'OpenchannelAccountId':Number(_0x1f45c2[_0xba66('0x56')]['id'])});}});}})['then'](respondWithStatusCode(_0xed0981,null))['catch'](handleError(_0xed0981,null));};exports[_0xba66('0xb6')]=function(_0x1e3727,_0x48d037,_0x410f02){var _0x42affe={};var _0x274e4c={};var _0x120d91;var _0x13feba;return db[_0xba66('0x4f')][_0xba66('0x71')]({'where':{'id':_0x1e3727['params']['id']}})['then'](handleEntityNotFound(_0x48d037,null))[_0xba66('0x22')](function(_0x50190f){if(_0x50190f){_0x120d91=_0x50190f;_0x274e4c[_0xba66('0x41')]=_['keys'](db['User'][_0xba66('0x3e')]);_0x274e4c[_0xba66('0x42')]=_[_0xba66('0x43')](_0x1e3727[_0xba66('0x42')]);_0x274e4c[_0xba66('0x44')]=_[_0xba66('0x45')](_0x274e4c[_0xba66('0x41')],_0x274e4c[_0xba66('0x42')]);_0x42affe[_0xba66('0x46')]=_[_0xba66('0x45')](_0x274e4c['model'],qs[_0xba66('0x47')](_0x1e3727[_0xba66('0x42')][_0xba66('0x47')]));_0x42affe[_0xba66('0x46')]=_0x42affe['attributes'][_0xba66('0x58')]?_0x42affe[_0xba66('0x46')]:_0x274e4c[_0xba66('0x41')];_0x42affe[_0xba66('0x4a')]=qs[_0xba66('0x4b')](_0x1e3727[_0xba66('0x42')][_0xba66('0x4b')]);_0x42affe['where']=qs[_0xba66('0x44')](_[_0xba66('0xa8')](_0x1e3727[_0xba66('0x42')],_0x274e4c[_0xba66('0x44')]));if(_0x1e3727[_0xba66('0x42')][_0xba66('0x4d')]){_0x42affe[_0xba66('0x4c')]=_[_0xba66('0x59')](_0x42affe['where'],{'$or':_[_0xba66('0x3d')](_0x42affe[_0xba66('0x46')],function(_0x1a6221){var _0x5a7384={};_0x5a7384[_0x1a6221]={'$like':'%'+_0x1e3727[_0xba66('0x42')][_0xba66('0x4d')]+'%'};return _0x5a7384;})});}_0x42affe=_[_0xba66('0x59')]({},_0x42affe,_0x1e3727['options']);return _0x120d91['getAgents'](_0x42affe);}})[_0xba66('0x22')](function(_0x4dc0c2){if(_0x4dc0c2){_0x13feba=_0x4dc0c2[_0xba66('0x58')];if(!_0x1e3727[_0xba66('0x42')][_0xba66('0x48')](_0xba66('0x49'))){_0x42affe[_0xba66('0x31')]=qs['limit'](_0x1e3727[_0xba66('0x42')]['limit']);_0x42affe[_0xba66('0x30')]=qs[_0xba66('0x30')](_0x1e3727[_0xba66('0x42')][_0xba66('0x30')]);}return _0x120d91[_0xba66('0xb6')](_0x42affe);}})[_0xba66('0x22')](function(_0x35acbd){if(_0x35acbd){return _0x35acbd?{'count':_0x13feba,'rows':_0x35acbd}:null;}})[_0xba66('0x22')](respondWithResult(_0x48d037,null))[_0xba66('0x5b')](handleError(_0x48d037,null));};exports[_0xba66('0x3a')]=function(_0x75caae,_0x3ec78c,_0x4d8029){var _0x5597b4,_0x5d2572,_0x42907e;if(_[_0xba66('0x7a')](_0x75caae[_0xba66('0x5d')][_0xba66('0x5d')])||_0x75caae[_0xba66('0x5d')][_0xba66('0x5d')]===''){throw new db[(_0xba66('0x1f'))][(_0xba66('0x20'))](_0xba66('0x7d'));}if(_[_0xba66('0x7a')](_0x75caae[_0xba66('0x5d')]['to'])){}_0x5597b4=_0x75caae[_0xba66('0x5d')]['to'];return db[_0xba66('0x4f')][_0xba66('0x71')]({'where':{'id':_0x75caae[_0xba66('0x56')]['id']}})[_0xba66('0x22')](handleEntityNotFound(_0x3ec78c,null))[_0xba66('0x22')](function(_0x331381){if(_0x331381){return db['OpenchannelAccount'][_0xba66('0x5a')]({'where':{'id':_0x331381['id']},'include':[{'model':db[_0xba66('0x82')],'as':_0xba66('0x83'),'include':[{'model':db[_0xba66('0x84')],'as':_0xba66('0x85'),'where':{[_0x331381[_0xba66('0x7e')]]:_0x5597b4},'limit':0x1,'order':[[_0xba66('0x77'),_0xba66('0xb7')]]}]}]})[_0xba66('0x22')](handleEntityNotFound(_0x3ec78c,null))[_0xba66('0x22')](function(_0x1dfc46){if(_0x1dfc46&&_0x1dfc46[_0xba66('0x83')]){_0x5d2572=_0x1dfc46[_0xba66('0x36')]({'plain':!![]});if(_0x5d2572[_0xba66('0x83')]&&_0x5d2572[_0xba66('0x83')][_0xba66('0x85')]['length']){return _0x5d2572[_0xba66('0x83')][_0xba66('0x85')][0x0];}return db[_0xba66('0x84')][_0xba66('0x5c')](_[_0xba66('0x8d')](_0x75caae[_0xba66('0x5d')],{'firstName':_0x5597b4,[_0x1dfc46['mapKey']]:_0x5597b4,'phone':_0x5597b4,'ListId':_0x5d2572[_0xba66('0x79')]}));}})[_0xba66('0x22')](handleEntityNotFound(_0x3ec78c,null))['then'](function(_0x50c3d6){if(_0x50c3d6){_0x42907e=_0x50c3d6;return db['OpenchannelInteraction']['find']({'where':{'ContactId':_0x42907e['id'],'closed':![],'OpenchannelAccountId':_0x5d2572['id']}})[_0xba66('0x22')](function(_0x3ef720){if(_0x3ef720){return[_0x3ef720,![]];}return db[_0xba66('0x90')]['create']({'UserId':_0x75caae[_0xba66('0x60')]['id'],'ContactId':_0x42907e['id'],'OpenchannelAccountId':_0x5d2572['id'],'lastMsgDirection':_0xba66('0xb8'),'Messages':[_[_0xba66('0x59')](_0x75caae[_0xba66('0x5d')],{'read':![],'body':_0x75caae[_0xba66('0x5d')]['body'],'OpenchannelAccountId':_0x5d2572['id'],'UserId':_0x75caae[_0xba66('0x60')]['id'],'ContactId':_0x42907e['id']})]},{'include':[{'model':db[_0xba66('0xb9')],'as':_0xba66('0xba')}]})[_0xba66('0x22')](function(_0x46660c){return[_0x46660c,!![]];});});}})[_0xba66('0x92')](function(_0x5e4d85,_0x27aa8e){if(_0x27aa8e){return _0x5e4d85;}return db[_0xba66('0xb9')]['create'](_[_0xba66('0x59')](_0x75caae[_0xba66('0x5d')],{'read':![],'body':_0x75caae['body']['body'],'OpenchannelAccountId':_0x5d2572['id'],'OpenchannelInteractionId':_0x5e4d85['id'],'UserId':_0x75caae[_0xba66('0x60')]['id'],'ContactId':_0x42907e['id']}))[_0xba66('0x22')](function(_0x11d5cd){_0x5e4d85[_0xba66('0xbb')][_0xba66('0xba')]=[];_0x5e4d85[_0xba66('0xbb')][_0xba66('0xba')][_0xba66('0xbc')](_0x11d5cd['dataValues']);return _0x5e4d85;});});}})[_0xba66('0x22')](respondWithResult(_0x3ec78c,null))[_0xba66('0x5b')](handleError(_0x3ec78c,null));};
\ No newline at end of file
diff --git a/server/api/openchannelAccount/openchannelAccount.events.js b/server/api/openchannelAccount/openchannelAccount.events.js
index 4b95cd4..de37982 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 _0xe0ce=['hook','exports','setMaxListeners','remove','emit'];(function(_0x5487f8,_0x7e5ca8){var _0x390af2=function(_0x3d443b){while(--_0x3d443b){_0x5487f8['push'](_0x5487f8['shift']());}};_0x390af2(++_0x7e5ca8);}(_0xe0ce,0x101));var _0xee0c=function(_0x1ba2e5,_0xbcc3fb){_0x1ba2e5=_0x1ba2e5-0x0;var _0x2b8957=_0xe0ce[_0x1ba2e5];return _0x2b8957;};'use strict';var EventEmitter=require('events');var OpenchannelAccount=require('../../mysqldb')['db']['OpenchannelAccount'];var OpenchannelAccountEvents=new EventEmitter();OpenchannelAccountEvents[_0xee0c('0x0')](0x0);var events={'afterCreate':'save','afterUpdate':'update','afterDestroy':_0xee0c('0x1')};function emitEvent(_0x2d5f2c){return function(_0x2012a0,_0x3494bc,_0x26ea6f){OpenchannelAccountEvents[_0xee0c('0x2')](_0x2d5f2c+':'+_0x2012a0['id'],_0x2012a0);OpenchannelAccountEvents[_0xee0c('0x2')](_0x2d5f2c,_0x2012a0);_0x26ea6f(null);};}for(var e in events){if(events['hasOwnProperty'](e)){var event=events[e];OpenchannelAccount[_0xee0c('0x3')](e,emitEvent(event));}}module[_0xee0c('0x4')]=OpenchannelAccountEvents;
\ No newline at end of file
+var _0x74f7=['events','../../mysqldb','OpenchannelAccount','save','update','emit','hook','exports'];(function(_0x3bae44,_0x1e37be){var _0x269503=function(_0x5d4763){while(--_0x5d4763){_0x3bae44['push'](_0x3bae44['shift']());}};_0x269503(++_0x1e37be);}(_0x74f7,0x1b8));var _0x774f=function(_0x2f2c8a,_0x2e8530){_0x2f2c8a=_0x2f2c8a-0x0;var _0x257dcc=_0x74f7[_0x2f2c8a];return _0x257dcc;};'use strict';var EventEmitter=require(_0x774f('0x0'));var OpenchannelAccount=require(_0x774f('0x1'))['db'][_0x774f('0x2')];var OpenchannelAccountEvents=new EventEmitter();OpenchannelAccountEvents['setMaxListeners'](0x0);var events={'afterCreate':_0x774f('0x3'),'afterUpdate':_0x774f('0x4'),'afterDestroy':'remove'};function emitEvent(_0x1585fb){return function(_0x111fdf,_0x10638e,_0x355eec){OpenchannelAccountEvents[_0x774f('0x5')](_0x1585fb+':'+_0x111fdf['id'],_0x111fdf);OpenchannelAccountEvents[_0x774f('0x5')](_0x1585fb,_0x111fdf);_0x355eec(null);};}for(var e in events){if(events['hasOwnProperty'](e)){var event=events[e];OpenchannelAccount[_0x774f('0x6')](e,emitEvent(event));}}module[_0x774f('0x7')]=OpenchannelAccountEvents;
\ No newline at end of file
diff --git a/server/api/openchannelAccount/openchannelAccount.model.js b/server/api/openchannelAccount/openchannelAccount.model.js
index c49090d..d87318e 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 _0xda63=['openchannel_accounts','lodash','util','../../config/logger','api','moment','bluebird','rimraf','../../config/environment','./openchannelAccount.attributes','exports','define','OpenchannelAccount'];(function(_0x2b49bc,_0x47b636){var _0x43cc65=function(_0x236ec3){while(--_0x236ec3){_0x2b49bc['push'](_0x2b49bc['shift']());}};_0x43cc65(++_0x47b636);}(_0xda63,0x1ae));var _0x3da6=function(_0x33fe50,_0x1464c8){_0x33fe50=_0x33fe50-0x0;var _0x20b544=_0xda63[_0x33fe50];return _0x20b544;};'use strict';var _=require(_0x3da6('0x0'));var util=require(_0x3da6('0x1'));var logger=require(_0x3da6('0x2'))(_0x3da6('0x3'));var moment=require(_0x3da6('0x4'));var BPromise=require(_0x3da6('0x5'));var rp=require('request-promise');var fs=require('fs');var path=require('path');var rimraf=require(_0x3da6('0x6'));var config=require(_0x3da6('0x7'));var attributes=require(_0x3da6('0x8'));module[_0x3da6('0x9')]=function(_0x245247,_0x526c9d){return _0x245247[_0x3da6('0xa')](_0x3da6('0xb'),attributes,{'tableName':_0x3da6('0xc'),'paranoid':![],'indexes':[],'timestamps':!![]});};
\ No newline at end of file
+var _0x2c35=['request-promise','path','rimraf','../../config/environment','exports','define','OpenchannelAccount','openchannel_accounts','lodash','util','../../config/logger','api','bluebird'];(function(_0x3947c9,_0x4d6c97){var _0x2e7871=function(_0x1236cc){while(--_0x1236cc){_0x3947c9['push'](_0x3947c9['shift']());}};_0x2e7871(++_0x4d6c97);}(_0x2c35,0xe5));var _0x52c3=function(_0x3dd15e,_0x1f0015){_0x3dd15e=_0x3dd15e-0x0;var _0x231fd0=_0x2c35[_0x3dd15e];return _0x231fd0;};'use strict';var _=require(_0x52c3('0x0'));var util=require(_0x52c3('0x1'));var logger=require(_0x52c3('0x2'))(_0x52c3('0x3'));var moment=require('moment');var BPromise=require(_0x52c3('0x4'));var rp=require(_0x52c3('0x5'));var fs=require('fs');var path=require(_0x52c3('0x6'));var rimraf=require(_0x52c3('0x7'));var config=require(_0x52c3('0x8'));var attributes=require('./openchannelAccount.attributes');module[_0x52c3('0x9')]=function(_0x16d131,_0x57c982){return _0x16d131[_0x52c3('0xa')](_0x52c3('0xb'),attributes,{'tableName':_0x52c3('0xc'),'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 826097d..1707751 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 _0x59d1=['redis','localhost','./openchannelAccount.socket','register','request','then','request\x20sent','debug','OpenchannelAccount,\x20%s,\x20%s,\x20%s','stringify','error','code','OpenchannelAccount,\x20%s,\x20%s','message','result','catch','util','moment','../../mysqldb','../../config/utils','../../config/environment','jayson/promise','client','http'];(function(_0x1cd8f0,_0x1c8682){var _0xe4fbce=function(_0x596373){while(--_0x596373){_0x1cd8f0['push'](_0x1cd8f0['shift']());}};_0xe4fbce(++_0x1c8682);}(_0x59d1,0xa0));var _0x159d=function(_0x29515a,_0x27303b){_0x29515a=_0x29515a-0x0;var _0x5a5d5a=_0x59d1[_0x29515a];return _0x5a5d5a;};'use strict';var _=require('lodash');var util=require(_0x159d('0x0'));var moment=require(_0x159d('0x1'));var BPromise=require('bluebird');var rs=require('randomstring');var fs=require('fs');var Redis=require('ioredis');var db=require(_0x159d('0x2'))['db'];var utils=require(_0x159d('0x3'));var logger=require('../../config/logger')('rpc');var config=require(_0x159d('0x4'));var jayson=require(_0x159d('0x5'));var client=jayson[_0x159d('0x6')][_0x159d('0x7')]({'port':0x232a});config[_0x159d('0x8')]=_['defaults'](config[_0x159d('0x8')],{'host':_0x159d('0x9'),'port':0x18eb});var socket=require('socket.io-emitter')(new Redis(config[_0x159d('0x8')]));require(_0x159d('0xa'))[_0x159d('0xb')](socket);function respondWithRpcPromise(_0x1f0694,_0xee9fbf,_0x907a96){return new BPromise(function(_0x5d7ab4,_0x39d54a){return client[_0x159d('0xc')](_0x1f0694,_0x907a96)[_0x159d('0xd')](function(_0x1e196d){logger['info']('OpenchannelAccount,\x20%s,\x20%s',_0xee9fbf,_0x159d('0xe'));logger[_0x159d('0xf')](_0x159d('0x10'),_0xee9fbf,'request\x20sent',JSON[_0x159d('0x11')](_0x1e196d));if(_0x1e196d[_0x159d('0x12')]){if(_0x1e196d[_0x159d('0x12')][_0x159d('0x13')]===0x1f4){logger['error'](_0x159d('0x14'),_0xee9fbf,_0x1e196d['error']['message']);return _0x39d54a(_0x1e196d['error'][_0x159d('0x15')]);}logger['error'](_0x159d('0x14'),_0xee9fbf,_0x1e196d[_0x159d('0x12')][_0x159d('0x15')]);return _0x5d7ab4(_0x1e196d[_0x159d('0x12')][_0x159d('0x15')]);}else{logger['info'](_0x159d('0x14'),_0xee9fbf,_0x159d('0xe'));_0x5d7ab4(_0x1e196d[_0x159d('0x16')][_0x159d('0x15')]);}})[_0x159d('0x17')](function(_0x200cec){logger[_0x159d('0x12')]('OpenchannelAccount,\x20%s,\x20%s',_0xee9fbf,_0x200cec);_0x39d54a(_0x200cec);});});}
\ No newline at end of file
+var _0x382e=['info','result','catch','util','bluebird','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','client','defaults','redis','localhost','register','request','then','OpenchannelAccount,\x20%s,\x20%s','request\x20sent','debug','OpenchannelAccount,\x20%s,\x20%s,\x20%s','stringify','error','code','message'];(function(_0x4b7895,_0x3c4f5d){var _0x264180=function(_0xe0e861){while(--_0xe0e861){_0x4b7895['push'](_0x4b7895['shift']());}};_0x264180(++_0x3c4f5d);}(_0x382e,0x12f));var _0xe382=function(_0x4377cb,_0x21d1ca){_0x4377cb=_0x4377cb-0x0;var _0x169fb3=_0x382e[_0x4377cb];return _0x169fb3;};'use strict';var _=require('lodash');var util=require(_0xe382('0x0'));var moment=require('moment');var BPromise=require(_0xe382('0x1'));var rs=require('randomstring');var fs=require('fs');var Redis=require('ioredis');var db=require(_0xe382('0x2'))['db'];var utils=require(_0xe382('0x3'));var logger=require(_0xe382('0x4'))(_0xe382('0x5'));var config=require(_0xe382('0x6'));var jayson=require('jayson/promise');var client=jayson[_0xe382('0x7')]['http']({'port':0x232a});config['redis']=_[_0xe382('0x8')](config[_0xe382('0x9')],{'host':_0xe382('0xa'),'port':0x18eb});var socket=require('socket.io-emitter')(new Redis(config[_0xe382('0x9')]));require('./openchannelAccount.socket')[_0xe382('0xb')](socket);function respondWithRpcPromise(_0x4dbd00,_0x4ad080,_0x27ce60){return new BPromise(function(_0x4527fe,_0x2abe77){return client[_0xe382('0xc')](_0x4dbd00,_0x27ce60)[_0xe382('0xd')](function(_0x371153){logger['info'](_0xe382('0xe'),_0x4ad080,_0xe382('0xf'));logger[_0xe382('0x10')](_0xe382('0x11'),_0x4ad080,_0xe382('0xf'),JSON[_0xe382('0x12')](_0x371153));if(_0x371153[_0xe382('0x13')]){if(_0x371153[_0xe382('0x13')][_0xe382('0x14')]===0x1f4){logger['error']('OpenchannelAccount,\x20%s,\x20%s',_0x4ad080,_0x371153[_0xe382('0x13')][_0xe382('0x15')]);return _0x2abe77(_0x371153[_0xe382('0x13')][_0xe382('0x15')]);}logger['error'](_0xe382('0xe'),_0x4ad080,_0x371153[_0xe382('0x13')]['message']);return _0x4527fe(_0x371153[_0xe382('0x13')][_0xe382('0x15')]);}else{logger[_0xe382('0x16')](_0xe382('0xe'),_0x4ad080,_0xe382('0xf'));_0x4527fe(_0x371153[_0xe382('0x17')][_0xe382('0x15')]);}})[_0xe382('0x18')](function(_0x3ab06f){logger[_0xe382('0x13')](_0xe382('0xe'),_0x4ad080,_0x3ab06f);_0x2abe77(_0x3ab06f);});});}
\ No newline at end of file
diff --git a/server/api/openchannelAccount/openchannelAccount.socket.js b/server/api/openchannelAccount/openchannelAccount.socket.js
index 32782fa..b7f447a 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 _0x11cc=['removeListener','register','./openchannelAccount.events','remove','update','emit'];(function(_0x541ca7,_0x2c2626){var _0x41fc0b=function(_0x218be1){while(--_0x218be1){_0x541ca7['push'](_0x541ca7['shift']());}};_0x41fc0b(++_0x2c2626);}(_0x11cc,0x6e));var _0xc11c=function(_0x3e2465,_0x211e58){_0x3e2465=_0x3e2465-0x0;var _0x12df6c=_0x11cc[_0x3e2465];return _0x12df6c;};'use strict';var OpenchannelAccountEvents=require(_0xc11c('0x0'));var events=['save',_0xc11c('0x1'),_0xc11c('0x2')];function createListener(_0xa22398,_0x12805b){return function(_0x107095){_0x12805b[_0xc11c('0x3')](_0xa22398,_0x107095);};}function removeListener(_0xfecdef,_0x1303a3){return function(){OpenchannelAccountEvents[_0xc11c('0x4')](_0xfecdef,_0x1303a3);};}exports[_0xc11c('0x5')]=function(_0x59a72c){for(var _0x117e62=0x0,_0xe7c273=events['length'];_0x117e62<_0xe7c273;_0x117e62++){var _0xceb25f=events[_0x117e62];var _0x1ef003=createListener('openchannelAccount:'+_0xceb25f,_0x59a72c);OpenchannelAccountEvents['on'](_0xceb25f,_0x1ef003);}};
\ No newline at end of file
+var _0x84a1=['./openchannelAccount.events','update','emit','removeListener','register'];(function(_0x2390a7,_0x44b73e){var _0xaddc20=function(_0x1d29c0){while(--_0x1d29c0){_0x2390a7['push'](_0x2390a7['shift']());}};_0xaddc20(++_0x44b73e);}(_0x84a1,0xc3));var _0x184a=function(_0x4a9a78,_0x5a47d0){_0x4a9a78=_0x4a9a78-0x0;var _0x48e953=_0x84a1[_0x4a9a78];return _0x48e953;};'use strict';var OpenchannelAccountEvents=require(_0x184a('0x0'));var events=['save','remove',_0x184a('0x1')];function createListener(_0x9651d9,_0x45d673){return function(_0x311ef4){_0x45d673[_0x184a('0x2')](_0x9651d9,_0x311ef4);};}function removeListener(_0x15f3df,_0x357631){return function(){OpenchannelAccountEvents[_0x184a('0x3')](_0x15f3df,_0x357631);};}exports[_0x184a('0x4')]=function(_0x104dd4){for(var _0x35a0fd=0x0,_0x3b1b0c=events['length'];_0x35a0fd<_0x3b1b0c;_0x35a0fd++){var _0x22dc15=events[_0x35a0fd];var _0x57a822=createListener('openchannelAccount:'+_0x22dc15,_0x104dd4);OpenchannelAccountEvents['on'](_0x22dc15,_0x57a822);}};
\ No newline at end of file
diff --git a/server/api/openchannelApplication/index.js b/server/api/openchannelApplication/index.js
index ccabe22..e4cfa5c 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 _0x2603=['show','post','put','/:id','update','delete','destroy','multer','util','connect-timeout','express','../../components/auth/service','../../config/environment','get','isAuthenticated','index'];(function(_0x111b12,_0x1877b0){var _0x110244=function(_0x29e250){while(--_0x29e250){_0x111b12['push'](_0x111b12['shift']());}};_0x110244(++_0x1877b0);}(_0x2603,0x157));var _0x3260=function(_0x45ccf6,_0x187595){_0x45ccf6=_0x45ccf6-0x0;var _0x140e18=_0x2603[_0x45ccf6];return _0x140e18;};'use strict';var multer=require(_0x3260('0x0'));var util=require(_0x3260('0x1'));var path=require('path');var timeout=require(_0x3260('0x2'));var express=require(_0x3260('0x3'));var router=express['Router']();var auth=require(_0x3260('0x4'));var interaction=require('../../components/interaction/service');var config=require(_0x3260('0x5'));var controller=require('./openchannelApplication.controller');router[_0x3260('0x6')]('/',auth[_0x3260('0x7')](),controller[_0x3260('0x8')]);router['get']('/:id',auth[_0x3260('0x7')](),controller[_0x3260('0x9')]);router[_0x3260('0xa')]('/',auth[_0x3260('0x7')](),controller['create']);router[_0x3260('0xb')](_0x3260('0xc'),auth[_0x3260('0x7')](),controller[_0x3260('0xd')]);router[_0x3260('0xe')](_0x3260('0xc'),auth[_0x3260('0x7')](),controller[_0x3260('0xf')]);module['exports']=router;
\ No newline at end of file
+var _0x48ad=['index','get','isAuthenticated','show','post','create','put','/:id','update','delete','destroy','exports','multer','util','path','express','Router','../../components/auth/service','./openchannelApplication.controller'];(function(_0x3e2489,_0x41d9dd){var _0x2254ce=function(_0x227e46){while(--_0x227e46){_0x3e2489['push'](_0x3e2489['shift']());}};_0x2254ce(++_0x41d9dd);}(_0x48ad,0x103));var _0xd48a=function(_0x3dd15e,_0x1f0015){_0x3dd15e=_0x3dd15e-0x0;var _0x231fd0=_0x48ad[_0x3dd15e];return _0x231fd0;};'use strict';var multer=require(_0xd48a('0x0'));var util=require(_0xd48a('0x1'));var path=require(_0xd48a('0x2'));var timeout=require('connect-timeout');var express=require(_0xd48a('0x3'));var router=express[_0xd48a('0x4')]();var auth=require(_0xd48a('0x5'));var interaction=require('../../components/interaction/service');var config=require('../../config/environment');var controller=require(_0xd48a('0x6'));router['get']('/',auth['isAuthenticated'](),controller[_0xd48a('0x7')]);router[_0xd48a('0x8')]('/:id',auth[_0xd48a('0x9')](),controller[_0xd48a('0xa')]);router[_0xd48a('0xb')]('/',auth[_0xd48a('0x9')](),controller[_0xd48a('0xc')]);router[_0xd48a('0xd')](_0xd48a('0xe'),auth[_0xd48a('0x9')](),controller[_0xd48a('0xf')]);router[_0xd48a('0x10')](_0xd48a('0xe'),auth[_0xd48a('0x9')](),controller[_0xd48a('0x11')]);module[_0xd48a('0x12')]=router;
\ No newline at end of file
diff --git a/server/api/openchannelApplication/openchannelApplication.attributes.js b/server/api/openchannelApplication/openchannelApplication.attributes.js
index 937662d..69b8393 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 _0x791c=['STRING','noop','TEXT','*,*,*,*','exports','INTEGER'];(function(_0x3d2080,_0x2680d5){var _0x530b6b=function(_0x357811){while(--_0x357811){_0x3d2080['push'](_0x3d2080['shift']());}};_0x530b6b(++_0x2680d5);}(_0x791c,0x76));var _0xc791=function(_0x4ee9cd,_0xd375b0){_0x4ee9cd=_0x4ee9cd-0x0;var _0x328a5b=_0x791c[_0x4ee9cd];return _0x328a5b;};'use strict';var Sequelize=require('sequelize');module[_0xc791('0x0')]={'priority':{'type':Sequelize[_0xc791('0x1')],'allowNull':![]},'app':{'type':Sequelize[_0xc791('0x2')],'allowNull':![],'defaultValue':_0xc791('0x3')},'appdata':{'type':Sequelize[_0xc791('0x4')]()},'description':{'type':Sequelize['STRING']},'interval':{'type':Sequelize[_0xc791('0x2')],'defaultValue':_0xc791('0x5')}};
\ No newline at end of file
+var _0x8409=['STRING','noop','TEXT','*,*,*,*','sequelize','exports','INTEGER'];(function(_0x1e6c87,_0x53e269){var _0x4f0e24=function(_0x1dd1d0){while(--_0x1dd1d0){_0x1e6c87['push'](_0x1e6c87['shift']());}};_0x4f0e24(++_0x53e269);}(_0x8409,0x185));var _0x9840=function(_0xb7fca7,_0x38ca46){_0xb7fca7=_0xb7fca7-0x0;var _0x3c0d34=_0x8409[_0xb7fca7];return _0x3c0d34;};'use strict';var Sequelize=require(_0x9840('0x0'));module[_0x9840('0x1')]={'priority':{'type':Sequelize[_0x9840('0x2')],'allowNull':![]},'app':{'type':Sequelize[_0x9840('0x3')],'allowNull':![],'defaultValue':_0x9840('0x4')},'appdata':{'type':Sequelize[_0x9840('0x5')]()},'description':{'type':Sequelize[_0x9840('0x3')]},'interval':{'type':Sequelize[_0x9840('0x3')],'defaultValue':_0x9840('0x6')}};
\ No newline at end of file
diff --git a/server/api/openchannelApplication/openchannelApplication.controller.js b/server/api/openchannelApplication/openchannelApplication.controller.js
index 5a57def..4203f57 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 _0xf67b=['mustache','path','to-csv','crypto','jsforce','desk.js','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../config/license/hardware','../../config/environment','sendStatus','status','end','json','offset','set','Content-Range','apply','save','update','then','stack','name','send','index','OpenchannelApplication','rawAttributes','fieldName','type','key','model','map','query','keys','filters','intersection','attributes','fields','length','hasOwnProperty','nolimit','limit','sort','pick','filter','merge','where','VIRTUAL','options','count','includeAll','include','findAll','rows','catch','show','params','find','create','body','destroy','rimraf','zip-dir','request-promise'];(function(_0x279248,_0x1aaa03){var _0x33c818=function(_0x32d439){while(--_0x32d439){_0x279248['push'](_0x279248['shift']());}};_0x33c818(++_0x1aaa03);}(_0xf67b,0x1d2));var _0xbf67=function(_0x6f3151,_0x406745){_0x6f3151=_0x6f3151-0x0;var _0x305fb8=_0xf67b[_0x6f3151];return _0x305fb8;};'use strict';var pdf=require('html-pdf');var emlformat=require('eml-format');var rimraf=require(_0xbf67('0x0'));var zipdir=require(_0xbf67('0x1'));var jsonpatch=require('fast-json-patch');var rp=require(_0xbf67('0x2'));var moment=require('moment');var BPromise=require('bluebird');var Mustache=require(_0xbf67('0x3'));var util=require('util');var path=require(_0xbf67('0x4'));var sox=require('sox');var csv=require(_0xbf67('0x5'));var ejs=require('ejs');var fs=require('fs');var _=require('lodash');var squel=require('squel');var crypto=require(_0xbf67('0x6'));var jsforce=require(_0xbf67('0x7'));var deskjs=require(_0xbf67('0x8'));var toCsv=require(_0xbf67('0x5'));var querystring=require(_0xbf67('0x9'));var Papa=require(_0xbf67('0xa'));var Redis=require(_0xbf67('0xb'));var authService=require(_0xbf67('0xc'));var qs=require(_0xbf67('0xd'));var as=require('../../components/parsers/advancedSearch');var hardwareService=require(_0xbf67('0xe'));var logger=require('../../config/logger')('api');var utils=require('../../config/utils');var config=require(_0xbf67('0xf'));var db=require('../../mysqldb')['db'];function respondWithStatusCode(_0x2ee726,_0x1597e6){_0x1597e6=_0x1597e6||0xcc;return function(_0x5a0770){if(_0x5a0770){return _0x2ee726[_0xbf67('0x10')](_0x1597e6);}return _0x2ee726[_0xbf67('0x11')](_0x1597e6)[_0xbf67('0x12')]();};}function respondWithResult(_0x4507b0,_0x508f05){_0x508f05=_0x508f05||0xc8;return function(_0x9248c7){if(_0x9248c7){return _0x4507b0[_0xbf67('0x11')](_0x508f05)[_0xbf67('0x13')](_0x9248c7);}};}function respondWithFilteredResult(_0x53f007,_0x882d4){return function(_0xdbebd9){if(_0xdbebd9){var _0x240884=_0xdbebd9['count'],_0x235dd7=_0x882d4[_0xbf67('0x14')],_0x4f0e96=_0x882d4['offset']+_0x882d4['limit'],_0x532880;if(_0x4f0e96>=_0x240884){_0x4f0e96=_0x240884;_0x532880=0xc8;}else{_0x532880=0xce;}_0x53f007[_0xbf67('0x11')](_0x532880);return _0x53f007[_0xbf67('0x15')](_0xbf67('0x16'),_0x235dd7+'-'+_0x4f0e96+'/'+_0x240884)[_0xbf67('0x13')](_0xdbebd9);}return null;};}function patchUpdates(_0x56be12){return function(_0x40683c){try{jsonpatch[_0xbf67('0x17')](_0x40683c,_0x56be12,!![]);}catch(_0x4da29b){return BPromise['reject'](_0x4da29b);}return _0x40683c[_0xbf67('0x18')]();};}function saveUpdates(_0x2f44bc,_0x184611){return function(_0x15f6f9){if(_0x15f6f9){return _0x15f6f9[_0xbf67('0x19')](_0x2f44bc)['then'](function(_0x317267){return _0x317267;});}return null;};}function removeEntity(_0x3b6c12,_0x50edd4){return function(_0x36d353){if(_0x36d353){return _0x36d353['destroy']()[_0xbf67('0x1a')](function(){_0x3b6c12['status'](0xcc)[_0xbf67('0x12')]();});}};}function handleEntityNotFound(_0x33a6c6,_0x4961a0){return function(_0x30046f){if(!_0x30046f){_0x33a6c6['sendStatus'](0x194);}return _0x30046f;};}function handleError(_0x47859a,_0x40a326){_0x40a326=_0x40a326||0x1f4;return function(_0x50a548){logger['error'](_0x50a548[_0xbf67('0x1b')]);if(_0x50a548[_0xbf67('0x1c')]){delete _0x50a548[_0xbf67('0x1c')];}_0x47859a[_0xbf67('0x11')](_0x40a326)[_0xbf67('0x1d')](_0x50a548);};}exports[_0xbf67('0x1e')]=function(_0x53999c,_0x313111){var _0x439c45={},_0x3552c0={},_0x274c84={'count':0x0,'rows':[]};var _0x21b90b=_['map'](db[_0xbf67('0x1f')][_0xbf67('0x20')],function(_0x3a40d9){return{'name':_0x3a40d9[_0xbf67('0x21')],'type':_0x3a40d9[_0xbf67('0x22')][_0xbf67('0x23')]};});_0x3552c0[_0xbf67('0x24')]=_[_0xbf67('0x25')](_0x21b90b,_0xbf67('0x1c'));_0x3552c0[_0xbf67('0x26')]=_[_0xbf67('0x27')](_0x53999c[_0xbf67('0x26')]);_0x3552c0[_0xbf67('0x28')]=_[_0xbf67('0x29')](_0x3552c0[_0xbf67('0x24')],_0x3552c0[_0xbf67('0x26')]);_0x439c45[_0xbf67('0x2a')]=_['intersection'](_0x3552c0[_0xbf67('0x24')],qs[_0xbf67('0x2b')](_0x53999c['query'][_0xbf67('0x2b')]));_0x439c45[_0xbf67('0x2a')]=_0x439c45[_0xbf67('0x2a')][_0xbf67('0x2c')]?_0x439c45['attributes']:_0x3552c0[_0xbf67('0x24')];if(!_0x53999c['query'][_0xbf67('0x2d')](_0xbf67('0x2e'))){_0x439c45['limit']=qs['limit'](_0x53999c['query'][_0xbf67('0x2f')]);_0x439c45[_0xbf67('0x14')]=qs[_0xbf67('0x14')](_0x53999c[_0xbf67('0x26')]['offset']);}_0x439c45['order']=qs[_0xbf67('0x30')](_0x53999c[_0xbf67('0x26')][_0xbf67('0x30')]);_0x439c45['where']=qs[_0xbf67('0x28')](_[_0xbf67('0x31')](_0x53999c['query'],_0x3552c0[_0xbf67('0x28')]));if(_0x53999c['query'][_0xbf67('0x32')]){_0x439c45['where']=_[_0xbf67('0x33')](_0x439c45[_0xbf67('0x34')],{'$or':_[_0xbf67('0x25')](_0x21b90b,function(_0xc69cf4){if(_0xc69cf4['type']!==_0xbf67('0x35')){var _0x740cd6={};_0x740cd6[_0xc69cf4[_0xbf67('0x1c')]]={'$like':'%'+_0x53999c[_0xbf67('0x26')]['filter']+'%'};return _0x740cd6;}})});}_0x439c45=_[_0xbf67('0x33')]({},_0x439c45,_0x53999c[_0xbf67('0x36')]);var _0x5d67f5={'where':_0x439c45['where']};return db['OpenchannelApplication'][_0xbf67('0x37')](_0x5d67f5)[_0xbf67('0x1a')](function(_0x51101c){_0x274c84['count']=_0x51101c;if(_0x53999c[_0xbf67('0x26')][_0xbf67('0x38')]){_0x439c45[_0xbf67('0x39')]=[{'all':!![]}];}return db[_0xbf67('0x1f')][_0xbf67('0x3a')](_0x439c45);})[_0xbf67('0x1a')](function(_0x3494c0){_0x274c84[_0xbf67('0x3b')]=_0x3494c0;return _0x274c84;})['then'](respondWithFilteredResult(_0x313111,_0x439c45))[_0xbf67('0x3c')](handleError(_0x313111,null));};exports[_0xbf67('0x3d')]=function(_0x11f1fb,_0x23bf8d){var _0x14f40b={'raw':!![],'where':{'id':_0x11f1fb[_0xbf67('0x3e')]['id']}},_0x439713={};_0x439713[_0xbf67('0x24')]=_[_0xbf67('0x27')](db[_0xbf67('0x1f')]['rawAttributes']);_0x439713[_0xbf67('0x26')]=_['keys'](_0x11f1fb[_0xbf67('0x26')]);_0x439713['filters']=_[_0xbf67('0x29')](_0x439713[_0xbf67('0x24')],_0x439713[_0xbf67('0x26')]);_0x14f40b['attributes']=_['intersection'](_0x439713['model'],qs[_0xbf67('0x2b')](_0x11f1fb['query']['fields']));_0x14f40b['attributes']=_0x14f40b[_0xbf67('0x2a')][_0xbf67('0x2c')]?_0x14f40b[_0xbf67('0x2a')]:_0x439713['model'];if(_0x11f1fb['query']['includeAll']){_0x14f40b[_0xbf67('0x39')]=[{'all':!![]}];}_0x14f40b=_[_0xbf67('0x33')]({},_0x14f40b,_0x11f1fb[_0xbf67('0x36')]);return db['OpenchannelApplication'][_0xbf67('0x3f')](_0x14f40b)[_0xbf67('0x1a')](handleEntityNotFound(_0x23bf8d,null))[_0xbf67('0x1a')](respondWithResult(_0x23bf8d,null))['catch'](handleError(_0x23bf8d,null));};exports[_0xbf67('0x40')]=function(_0xb98e5a,_0x2882df){return db[_0xbf67('0x1f')][_0xbf67('0x40')](_0xb98e5a[_0xbf67('0x41')],{})[_0xbf67('0x1a')](respondWithResult(_0x2882df,0xc9))[_0xbf67('0x3c')](handleError(_0x2882df,null));};exports[_0xbf67('0x19')]=function(_0x46149d,_0x10e1ae){if(_0x46149d[_0xbf67('0x41')]['id']){delete _0x46149d[_0xbf67('0x41')]['id'];}return db[_0xbf67('0x1f')][_0xbf67('0x3f')]({'where':{'id':_0x46149d['params']['id']}})[_0xbf67('0x1a')](handleEntityNotFound(_0x10e1ae,null))[_0xbf67('0x1a')](saveUpdates(_0x46149d[_0xbf67('0x41')],null))[_0xbf67('0x1a')](respondWithResult(_0x10e1ae,null))[_0xbf67('0x3c')](handleError(_0x10e1ae,null));};exports[_0xbf67('0x42')]=function(_0x59792b,_0x36d2c5){return db['OpenchannelApplication'][_0xbf67('0x3f')]({'where':{'id':_0x59792b[_0xbf67('0x3e')]['id']}})[_0xbf67('0x1a')](handleEntityNotFound(_0x36d2c5,null))[_0xbf67('0x1a')](removeEntity(_0x36d2c5,null))[_0xbf67('0x3c')](handleError(_0x36d2c5,null));};
\ No newline at end of file
+var _0xce1d=['index','map','OpenchannelApplication','rawAttributes','fieldName','key','model','query','keys','filters','attributes','fields','hasOwnProperty','nolimit','order','sort','where','pick','filter','type','VIRTUAL','includeAll','include','show','params','intersection','length','merge','options','find','create','body','catch','html-pdf','fast-json-patch','moment','bluebird','mustache','util','path','sox','to-csv','ejs','lodash','squel','crypto','desk.js','querystring','papaparse','ioredis','../../components/parsers/qs','../../config/license/hardware','api','../../mysqldb','sendStatus','end','status','json','count','offset','limit','set','apply','reject','save','update','then','destroy','error','stack','name'];(function(_0x3cba27,_0x114ba2){var _0x332365=function(_0x408763){while(--_0x408763){_0x3cba27['push'](_0x3cba27['shift']());}};_0x332365(++_0x114ba2);}(_0xce1d,0xaf));var _0xdce1=function(_0x3dd15e,_0x1f0015){_0x3dd15e=_0x3dd15e-0x0;var _0x231fd0=_0xce1d[_0x3dd15e];return _0x231fd0;};'use strict';var pdf=require(_0xdce1('0x0'));var emlformat=require('eml-format');var rimraf=require('rimraf');var zipdir=require('zip-dir');var jsonpatch=require(_0xdce1('0x1'));var rp=require('request-promise');var moment=require(_0xdce1('0x2'));var BPromise=require(_0xdce1('0x3'));var Mustache=require(_0xdce1('0x4'));var util=require(_0xdce1('0x5'));var path=require(_0xdce1('0x6'));var sox=require(_0xdce1('0x7'));var csv=require(_0xdce1('0x8'));var ejs=require(_0xdce1('0x9'));var fs=require('fs');var _=require(_0xdce1('0xa'));var squel=require(_0xdce1('0xb'));var crypto=require(_0xdce1('0xc'));var jsforce=require('jsforce');var deskjs=require(_0xdce1('0xd'));var toCsv=require(_0xdce1('0x8'));var querystring=require(_0xdce1('0xe'));var Papa=require(_0xdce1('0xf'));var Redis=require(_0xdce1('0x10'));var authService=require('../../components/auth/service');var qs=require(_0xdce1('0x11'));var as=require('../../components/parsers/advancedSearch');var hardwareService=require(_0xdce1('0x12'));var logger=require('../../config/logger')(_0xdce1('0x13'));var utils=require('../../config/utils');var config=require('../../config/environment');var db=require(_0xdce1('0x14'))['db'];function respondWithStatusCode(_0xf0d38e,_0x259845){_0x259845=_0x259845||0xcc;return function(_0x31897d){if(_0x31897d){return _0xf0d38e[_0xdce1('0x15')](_0x259845);}return _0xf0d38e['status'](_0x259845)[_0xdce1('0x16')]();};}function respondWithResult(_0x5bfbcb,_0x27909d){_0x27909d=_0x27909d||0xc8;return function(_0x572a88){if(_0x572a88){return _0x5bfbcb[_0xdce1('0x17')](_0x27909d)[_0xdce1('0x18')](_0x572a88);}};}function respondWithFilteredResult(_0x50d5c9,_0x1511fa){return function(_0x3b872a){if(_0x3b872a){var _0x597a99=_0x3b872a[_0xdce1('0x19')],_0x15185c=_0x1511fa[_0xdce1('0x1a')],_0x1ff759=_0x1511fa['offset']+_0x1511fa[_0xdce1('0x1b')],_0x16eae8;if(_0x1ff759>=_0x597a99){_0x1ff759=_0x597a99;_0x16eae8=0xc8;}else{_0x16eae8=0xce;}_0x50d5c9[_0xdce1('0x17')](_0x16eae8);return _0x50d5c9[_0xdce1('0x1c')]('Content-Range',_0x15185c+'-'+_0x1ff759+'/'+_0x597a99)[_0xdce1('0x18')](_0x3b872a);}return null;};}function patchUpdates(_0xe38ae0){return function(_0x143c3f){try{jsonpatch[_0xdce1('0x1d')](_0x143c3f,_0xe38ae0,!![]);}catch(_0x5349c0){return BPromise[_0xdce1('0x1e')](_0x5349c0);}return _0x143c3f[_0xdce1('0x1f')]();};}function saveUpdates(_0x299b7e,_0x22ef58){return function(_0x3a333a){if(_0x3a333a){return _0x3a333a[_0xdce1('0x20')](_0x299b7e)[_0xdce1('0x21')](function(_0x3f74d6){return _0x3f74d6;});}return null;};}function removeEntity(_0x1ace86,_0x34b435){return function(_0x379d5e){if(_0x379d5e){return _0x379d5e[_0xdce1('0x22')]()['then'](function(){_0x1ace86[_0xdce1('0x17')](0xcc)[_0xdce1('0x16')]();});}};}function handleEntityNotFound(_0x5ed3c2,_0x29fd60){return function(_0x2cb03d){if(!_0x2cb03d){_0x5ed3c2[_0xdce1('0x15')](0x194);}return _0x2cb03d;};}function handleError(_0x41756d,_0x326ce4){_0x326ce4=_0x326ce4||0x1f4;return function(_0x5530ee){logger[_0xdce1('0x23')](_0x5530ee[_0xdce1('0x24')]);if(_0x5530ee[_0xdce1('0x25')]){delete _0x5530ee[_0xdce1('0x25')];}_0x41756d[_0xdce1('0x17')](_0x326ce4)['send'](_0x5530ee);};}exports[_0xdce1('0x26')]=function(_0x49c071,_0xd11296){var _0x57536f={},_0x4e5dd4={},_0x1e38c0={'count':0x0,'rows':[]};var _0x5207c9=_[_0xdce1('0x27')](db[_0xdce1('0x28')][_0xdce1('0x29')],function(_0x6aeeee){return{'name':_0x6aeeee[_0xdce1('0x2a')],'type':_0x6aeeee['type'][_0xdce1('0x2b')]};});_0x4e5dd4[_0xdce1('0x2c')]=_[_0xdce1('0x27')](_0x5207c9,_0xdce1('0x25'));_0x4e5dd4[_0xdce1('0x2d')]=_[_0xdce1('0x2e')](_0x49c071[_0xdce1('0x2d')]);_0x4e5dd4[_0xdce1('0x2f')]=_['intersection'](_0x4e5dd4[_0xdce1('0x2c')],_0x4e5dd4['query']);_0x57536f[_0xdce1('0x30')]=_['intersection'](_0x4e5dd4[_0xdce1('0x2c')],qs[_0xdce1('0x31')](_0x49c071[_0xdce1('0x2d')][_0xdce1('0x31')]));_0x57536f[_0xdce1('0x30')]=_0x57536f[_0xdce1('0x30')]['length']?_0x57536f[_0xdce1('0x30')]:_0x4e5dd4['model'];if(!_0x49c071['query'][_0xdce1('0x32')](_0xdce1('0x33'))){_0x57536f[_0xdce1('0x1b')]=qs[_0xdce1('0x1b')](_0x49c071[_0xdce1('0x2d')][_0xdce1('0x1b')]);_0x57536f[_0xdce1('0x1a')]=qs[_0xdce1('0x1a')](_0x49c071[_0xdce1('0x2d')][_0xdce1('0x1a')]);}_0x57536f[_0xdce1('0x34')]=qs[_0xdce1('0x35')](_0x49c071[_0xdce1('0x2d')][_0xdce1('0x35')]);_0x57536f[_0xdce1('0x36')]=qs['filters'](_[_0xdce1('0x37')](_0x49c071[_0xdce1('0x2d')],_0x4e5dd4[_0xdce1('0x2f')]));if(_0x49c071['query'][_0xdce1('0x38')]){_0x57536f['where']=_['merge'](_0x57536f[_0xdce1('0x36')],{'$or':_[_0xdce1('0x27')](_0x5207c9,function(_0x321b59){if(_0x321b59[_0xdce1('0x39')]!==_0xdce1('0x3a')){var _0x2c3d61={};_0x2c3d61[_0x321b59[_0xdce1('0x25')]]={'$like':'%'+_0x49c071[_0xdce1('0x2d')][_0xdce1('0x38')]+'%'};return _0x2c3d61;}})});}_0x57536f=_['merge']({},_0x57536f,_0x49c071['options']);var _0x51595d={'where':_0x57536f[_0xdce1('0x36')]};return db[_0xdce1('0x28')][_0xdce1('0x19')](_0x51595d)['then'](function(_0x5351b1){_0x1e38c0['count']=_0x5351b1;if(_0x49c071[_0xdce1('0x2d')][_0xdce1('0x3b')]){_0x57536f[_0xdce1('0x3c')]=[{'all':!![]}];}return db[_0xdce1('0x28')]['findAll'](_0x57536f);})[_0xdce1('0x21')](function(_0x58f687){_0x1e38c0['rows']=_0x58f687;return _0x1e38c0;})[_0xdce1('0x21')](respondWithFilteredResult(_0xd11296,_0x57536f))['catch'](handleError(_0xd11296,null));};exports[_0xdce1('0x3d')]=function(_0xf71a81,_0x14a0fd){var _0x2f2780={'raw':!![],'where':{'id':_0xf71a81[_0xdce1('0x3e')]['id']}},_0x297759={};_0x297759['model']=_[_0xdce1('0x2e')](db[_0xdce1('0x28')]['rawAttributes']);_0x297759[_0xdce1('0x2d')]=_[_0xdce1('0x2e')](_0xf71a81['query']);_0x297759[_0xdce1('0x2f')]=_[_0xdce1('0x3f')](_0x297759[_0xdce1('0x2c')],_0x297759[_0xdce1('0x2d')]);_0x2f2780['attributes']=_[_0xdce1('0x3f')](_0x297759[_0xdce1('0x2c')],qs[_0xdce1('0x31')](_0xf71a81[_0xdce1('0x2d')]['fields']));_0x2f2780['attributes']=_0x2f2780[_0xdce1('0x30')][_0xdce1('0x40')]?_0x2f2780[_0xdce1('0x30')]:_0x297759['model'];if(_0xf71a81[_0xdce1('0x2d')]['includeAll']){_0x2f2780[_0xdce1('0x3c')]=[{'all':!![]}];}_0x2f2780=_[_0xdce1('0x41')]({},_0x2f2780,_0xf71a81[_0xdce1('0x42')]);return db[_0xdce1('0x28')][_0xdce1('0x43')](_0x2f2780)[_0xdce1('0x21')](handleEntityNotFound(_0x14a0fd,null))[_0xdce1('0x21')](respondWithResult(_0x14a0fd,null))['catch'](handleError(_0x14a0fd,null));};exports[_0xdce1('0x44')]=function(_0x297389,_0x3364a0){return db[_0xdce1('0x28')][_0xdce1('0x44')](_0x297389[_0xdce1('0x45')],{})[_0xdce1('0x21')](respondWithResult(_0x3364a0,0xc9))[_0xdce1('0x46')](handleError(_0x3364a0,null));};exports['update']=function(_0x114da6,_0x3752fd){if(_0x114da6['body']['id']){delete _0x114da6[_0xdce1('0x45')]['id'];}return db['OpenchannelApplication'][_0xdce1('0x43')]({'where':{'id':_0x114da6[_0xdce1('0x3e')]['id']}})['then'](handleEntityNotFound(_0x3752fd,null))[_0xdce1('0x21')](saveUpdates(_0x114da6[_0xdce1('0x45')],null))['then'](respondWithResult(_0x3752fd,null))[_0xdce1('0x46')](handleError(_0x3752fd,null));};exports[_0xdce1('0x22')]=function(_0x5bf4a9,_0x3b9bc2){return db[_0xdce1('0x28')][_0xdce1('0x43')]({'where':{'id':_0x5bf4a9[_0xdce1('0x3e')]['id']}})[_0xdce1('0x21')](handleEntityNotFound(_0x3b9bc2,null))[_0xdce1('0x21')](removeEntity(_0x3b9bc2,null))[_0xdce1('0x46')](handleError(_0x3b9bc2,null));};
\ No newline at end of file
diff --git a/server/api/openchannelApplication/openchannelApplication.model.js b/server/api/openchannelApplication/openchannelApplication.model.js
index 26cb84b..a16e1ed 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 _0xac00=['rimraf','../../config/environment','./openchannelApplication.attributes','exports','define','OpenchannelApplication','openchannel_applications','utf8mb4','lodash','../../config/logger','api','moment','bluebird','request-promise','path'];(function(_0x53df8f,_0x338fa4){var _0x1e108c=function(_0x1cf598){while(--_0x1cf598){_0x53df8f['push'](_0x53df8f['shift']());}};_0x1e108c(++_0x338fa4);}(_0xac00,0x80));var _0x0ac0=function(_0x4b118e,_0x5eec3d){_0x4b118e=_0x4b118e-0x0;var _0x1d34b1=_0xac00[_0x4b118e];return _0x1d34b1;};'use strict';var _=require(_0x0ac0('0x0'));var util=require('util');var logger=require(_0x0ac0('0x1'))(_0x0ac0('0x2'));var moment=require(_0x0ac0('0x3'));var BPromise=require(_0x0ac0('0x4'));var rp=require(_0x0ac0('0x5'));var fs=require('fs');var path=require(_0x0ac0('0x6'));var rimraf=require(_0x0ac0('0x7'));var config=require(_0x0ac0('0x8'));var attributes=require(_0x0ac0('0x9'));module[_0x0ac0('0xa')]=function(_0x2a7622,_0x380bf4){return _0x2a7622[_0x0ac0('0xb')](_0x0ac0('0xc'),attributes,{'tableName':_0x0ac0('0xd'),'paranoid':![],'indexes':[],'timestamps':!![],'charset':_0x0ac0('0xe'),'collate':'utf8mb4_unicode_ci'});};
\ No newline at end of file
+var _0xc800=['api','moment','bluebird','request-promise','path','rimraf','../../config/environment','./openchannelApplication.attributes','define','OpenchannelApplication','openchannel_applications','utf8mb4','lodash','util','../../config/logger'];(function(_0x2be30b,_0x362c2c){var _0x5c92c3=function(_0x2fa651){while(--_0x2fa651){_0x2be30b['push'](_0x2be30b['shift']());}};_0x5c92c3(++_0x362c2c);}(_0xc800,0x183));var _0x0c80=function(_0x51bb38,_0x4e57a0){_0x51bb38=_0x51bb38-0x0;var _0x51c09b=_0xc800[_0x51bb38];return _0x51c09b;};'use strict';var _=require(_0x0c80('0x0'));var util=require(_0x0c80('0x1'));var logger=require(_0x0c80('0x2'))(_0x0c80('0x3'));var moment=require(_0x0c80('0x4'));var BPromise=require(_0x0c80('0x5'));var rp=require(_0x0c80('0x6'));var fs=require('fs');var path=require(_0x0c80('0x7'));var rimraf=require(_0x0c80('0x8'));var config=require(_0x0c80('0x9'));var attributes=require(_0x0c80('0xa'));module['exports']=function(_0x199d7b,_0x60d04a){return _0x199d7b[_0x0c80('0xb')](_0x0c80('0xc'),attributes,{'tableName':_0x0c80('0xd'),'paranoid':![],'indexes':[],'timestamps':!![],'charset':_0x0c80('0xe'),'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 b901c91..bc49e78 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 _0xd8b0=['OpenchannelApplication','body','options','raw','where','lodash','util','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','client','http','request','then','info','OpenchannelApplication,\x20%s,\x20%s','request\x20sent','debug','OpenchannelApplication,\x20%s,\x20%s,\x20%s','stringify','error','code','message','result','catch','UpdateOpenchannelApplication'];(function(_0x433a86,_0x175b5c){var _0x23000c=function(_0x4b1fa0){while(--_0x4b1fa0){_0x433a86['push'](_0x433a86['shift']());}};_0x23000c(++_0x175b5c);}(_0xd8b0,0xad));var _0x0d8b=function(_0x122ef9,_0x451d2a){_0x122ef9=_0x122ef9-0x0;var _0x42fba0=_0xd8b0[_0x122ef9];return _0x42fba0;};'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')]['update'](_0x5fecbd[_0x0d8b('0x18')],{'raw':_0x5fecbd[_0x0d8b('0x19')]?_0x5fecbd[_0x0d8b('0x19')][_0x0d8b('0x1a')]===undefined?!![]:![]:!![],'individualHooks':!![],'where':_0x5fecbd[_0x0d8b('0x19')]?_0x5fecbd[_0x0d8b('0x19')][_0x0d8b('0x1b')]||null:null,'attributes':_0x5fecbd[_0x0d8b('0x19')]?_0x5fecbd['options']['attributes']||null:null,'limit':_0x5fecbd[_0x0d8b('0x19')]?_0x5fecbd['options']['limit']||null:null})['then'](function(_0x238728){logger[_0x0d8b('0xb')](_0x0d8b('0x16'),_0x5fecbd);logger[_0x0d8b('0xe')](_0x0d8b('0x16'),_0x5fecbd,JSON[_0x0d8b('0x10')](_0x238728));_0x18dd2d(_0x238728);})[_0x0d8b('0x15')](function(_0x4562cb){logger[_0x0d8b('0x11')]('UpdateOpenchannelApplication',_0x4562cb[_0x0d8b('0x13')],_0x5fecbd);_0x264b39(_0x333674[_0x0d8b('0x11')](0x1f4,_0x4562cb['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(_0x139adf,_0x58f868){var _0x2fbf85=function(_0x14403e){while(--_0x14403e){_0x139adf['push'](_0x139adf['shift']());}};_0x2fbf85(++_0x58f868);}(_0xb10b,0x12a));var _0xbb10=function(_0x53aaf8,_0x863bcb){_0x53aaf8=_0x53aaf8-0x0;var _0x1fedb1=_0xb10b[_0x53aaf8];return _0x1fedb1;};'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 5fed0b1..969a91a 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 _0xa928=['removeTags','util','path','express','Router','../../components/auth/service','../../components/interaction/service','../../config/environment','./openchannelInteraction.controller','get','isAuthenticated','index','describe','show','/:id/messages','getMessages','/:id/download','post','create','tracked','openchannel','openchannelinteraction:addtags','addTags','/:id','delete','openchannelinteraction:destroy','destroy'];(function(_0x4a9fb1,_0x273043){var _0x348672=function(_0x142b69){while(--_0x142b69){_0x4a9fb1['push'](_0x4a9fb1['shift']());}};_0x348672(++_0x273043);}(_0xa928,0x17b));var _0x8a92=function(_0x41e75c,_0x4292a0){_0x41e75c=_0x41e75c-0x0;var _0x333a79=_0xa928[_0x41e75c];return _0x333a79;};'use strict';var multer=require('multer');var util=require(_0x8a92('0x0'));var path=require(_0x8a92('0x1'));var timeout=require('connect-timeout');var express=require(_0x8a92('0x2'));var router=express[_0x8a92('0x3')]();var auth=require(_0x8a92('0x4'));var interaction=require(_0x8a92('0x5'));var config=require(_0x8a92('0x6'));var controller=require(_0x8a92('0x7'));router[_0x8a92('0x8')]('/',auth[_0x8a92('0x9')](),controller[_0x8a92('0xa')]);router['get']('/describe',auth['isAuthenticated'](),controller[_0x8a92('0xb')]);router[_0x8a92('0x8')]('/:id',auth[_0x8a92('0x9')](),controller[_0x8a92('0xc')]);router[_0x8a92('0x8')](_0x8a92('0xd'),auth[_0x8a92('0x9')](),controller[_0x8a92('0xe')]);router['get'](_0x8a92('0xf'),auth[_0x8a92('0x9')](),controller['download']);router[_0x8a92('0x10')]('/',auth[_0x8a92('0x9')](),controller[_0x8a92('0x11')]);router[_0x8a92('0x10')]('/:id/messages',auth[_0x8a92('0x9')](),controller['addMessage']);router['post']('/:id/tags',auth[_0x8a92('0x9')](),interaction[_0x8a92('0x12')](_0x8a92('0x13'),_0x8a92('0x14')),controller[_0x8a92('0x15')]);router['put'](_0x8a92('0x16'),auth[_0x8a92('0x9')](),interaction[_0x8a92('0x12')](_0x8a92('0x13'),'openchannelinteraction:update'),controller['update']);router[_0x8a92('0x17')](_0x8a92('0x16'),auth['isAuthenticated'](),interaction[_0x8a92('0x12')]('openchannel',_0x8a92('0x18')),controller[_0x8a92('0x19')]);router[_0x8a92('0x17')]('/:id/tags',auth[_0x8a92('0x9')](),controller[_0x8a92('0x1a')]);module['exports']=router;
\ No newline at end of file
+var _0x52ac=['express','Router','../../components/auth/service','../../components/interaction/service','./openchannelInteraction.controller','get','isAuthenticated','index','/describe','describe','/:id','show','/:id/messages','getMessages','/:id/download','download','create','post','/:id/tags','tracked','openchannelinteraction:addtags','openchannel','openchannelinteraction:update','update','delete','openchannelinteraction:destroy','removeTags','exports','multer','path','connect-timeout'];(function(_0x2a048c,_0x5afcc1){var _0x182f87=function(_0x1df72c){while(--_0x1df72c){_0x2a048c['push'](_0x2a048c['shift']());}};_0x182f87(++_0x5afcc1);}(_0x52ac,0x1af));var _0xc52a=function(_0x261b84,_0x5bda10){_0x261b84=_0x261b84-0x0;var _0x1fcf21=_0x52ac[_0x261b84];return _0x1fcf21;};'use strict';var multer=require(_0xc52a('0x0'));var util=require('util');var path=require(_0xc52a('0x1'));var timeout=require(_0xc52a('0x2'));var express=require(_0xc52a('0x3'));var router=express[_0xc52a('0x4')]();var auth=require(_0xc52a('0x5'));var interaction=require(_0xc52a('0x6'));var config=require('../../config/environment');var controller=require(_0xc52a('0x7'));router[_0xc52a('0x8')]('/',auth[_0xc52a('0x9')](),controller[_0xc52a('0xa')]);router['get'](_0xc52a('0xb'),auth[_0xc52a('0x9')](),controller[_0xc52a('0xc')]);router['get'](_0xc52a('0xd'),auth['isAuthenticated'](),controller[_0xc52a('0xe')]);router[_0xc52a('0x8')](_0xc52a('0xf'),auth[_0xc52a('0x9')](),controller[_0xc52a('0x10')]);router[_0xc52a('0x8')](_0xc52a('0x11'),auth[_0xc52a('0x9')](),controller[_0xc52a('0x12')]);router['post']('/',auth[_0xc52a('0x9')](),controller[_0xc52a('0x13')]);router['post'](_0xc52a('0xf'),auth[_0xc52a('0x9')](),controller['addMessage']);router[_0xc52a('0x14')](_0xc52a('0x15'),auth[_0xc52a('0x9')](),interaction[_0xc52a('0x16')]('openchannel',_0xc52a('0x17')),controller['addTags']);router['put'](_0xc52a('0xd'),auth[_0xc52a('0x9')](),interaction[_0xc52a('0x16')](_0xc52a('0x18'),_0xc52a('0x19')),controller[_0xc52a('0x1a')]);router[_0xc52a('0x1b')](_0xc52a('0xd'),auth['isAuthenticated'](),interaction[_0xc52a('0x16')]('openchannel',_0xc52a('0x1c')),controller['destroy']);router[_0xc52a('0x1b')]('/:id/tags',auth[_0xc52a('0x9')](),controller[_0xc52a('0x1d')]);module[_0xc52a('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 0935aca..9538515 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 _0x26f1=['STRING','ENUM','out','BOOLEAN','DATE'];(function(_0xc0f883,_0x37e9e8){var _0x46c276=function(_0x5fb82d){while(--_0x5fb82d){_0xc0f883['push'](_0xc0f883['shift']());}};_0x46c276(++_0x37e9e8);}(_0x26f1,0x13e));var _0x126f=function(_0x18ab2a,_0x4debcd){_0x18ab2a=_0x18ab2a-0x0;var _0x16dcee=_0x26f1[_0x18ab2a];return _0x16dcee;};'use strict';var Sequelize=require('sequelize');module['exports']={'closed':{'type':Sequelize[_0x126f('0x0')],'defaultValue':![]},'closedAt':{'type':Sequelize[_0x126f('0x1')]},'disposition':{'type':Sequelize[_0x126f('0x2')]},'note':{'type':Sequelize[_0x126f('0x2')]},'read1stAt':{'type':Sequelize[_0x126f('0x1')]},'threadId':{'type':Sequelize[_0x126f('0x2')]},'externalUrl':{'type':Sequelize[_0x126f('0x2')]},'lastMsgAt':{'type':Sequelize[_0x126f('0x1')]},'lastMsgDirection':{'type':Sequelize[_0x126f('0x3')]('in',_0x126f('0x4')),'defaultValue':'in','allowNull':![]},'from':{'type':Sequelize[_0x126f('0x2')]}};
\ No newline at end of file
+var _0x5305=['out','sequelize','exports','BOOLEAN','STRING'];(function(_0x109dec,_0x2b66cd){var _0x482501=function(_0xd08839){while(--_0xd08839){_0x109dec['push'](_0x109dec['shift']());}};_0x482501(++_0x2b66cd);}(_0x5305,0xfb));var _0x5530=function(_0x1facfa,_0x1acf7d){_0x1facfa=_0x1facfa-0x0;var _0x9ec701=_0x5305[_0x1facfa];return _0x9ec701;};'use strict';var Sequelize=require(_0x5530('0x0'));module[_0x5530('0x1')]={'closed':{'type':Sequelize[_0x5530('0x2')],'defaultValue':![]},'closedAt':{'type':Sequelize['DATE']},'disposition':{'type':Sequelize[_0x5530('0x3')]},'note':{'type':Sequelize[_0x5530('0x3')]},'read1stAt':{'type':Sequelize['DATE']},'threadId':{'type':Sequelize[_0x5530('0x3')]},'externalUrl':{'type':Sequelize[_0x5530('0x3')]},'lastMsgAt':{'type':Sequelize['DATE']},'lastMsgDirection':{'type':Sequelize['ENUM']('in',_0x5530('0x4')),'defaultValue':'in','allowNull':![]},'from':{'type':Sequelize[_0x5530('0x3')]}};
\ No newline at end of file
diff --git a/server/api/openchannelInteraction/openchannelInteraction.controller.js b/server/api/openchannelInteraction/openchannelInteraction.controller.js
index 5aba37b..60faa9f 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 _0xfb55=['mkdirSync','10px','40px','%s\x20#%d','Openchannel','YYYY-MM-DD','N.A.','closed','closedAt','threadId','Public','Private','basename','createReadStream','pipe','createWriteStream','out','renderFile','downloadInteraction.html','transcript-','.pdf','download','log','err','unlinkSync','eml-format','rimraf','zip-dir','fast-json-patch','moment','mustache','util','path','sox','lodash','squel','crypto','desk.js','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/environment','redis','defaults','./openchannelInteraction.socket','sendStatus','status','json','count','offset','set','Content-Range','apply','reject','update','then','destroy','end','error','stack','name','Users','map','fullname','TagIds','Tags','split','forEach','catch','index','OpenchannelInteraction','rawAttributes','fieldName','type','key','keys','query','intersection','model','attributes','fields','length','nolimit','limit','order','sort','where','filters','select','field','color','from','tools_tags','u.id','u.fullname','ui.OpenchannelInteractionId','user_has_openchannel_interactions','users','u.id\x20=\x20ui.UserId','openchannel_interactions','left_join','openchannel_accounts','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','`\x20=\x200','having','`\x20>\x200','Contact','$substring','getFullTextValue','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','operator','CONCAT_WS(\x27\x20\x27,\x20o.name,\x20o.fullname)\x20LIKE\x20?','UserId','body','compact','isEmpty','OpenchannelAccountId','concat','createdAt','$gte','parse','$lte','i.createdAt\x20BETWEEN\x20?\x20AND\x20?','\x20IS\x20NULL','\x20=\x20?','read','`unreadMessages`\x20=\x200','isArray','tag','filter','replace','\x27\x27\x27\x27','isNumeric','i.id\x20LIKE\x20?','i.from\x20LIKE\x20?','CONCAT(c.firstName,\x20\x27\x20\x27,\x20c.lastName)\x20LIKE\x20?','group','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.OpenchannelAccountId\x20IS\x20NOT\x20NULL','user','getOpenchannelAccounts','i.OpenchannelAccountId\x20IS\x20NULL','i.OpenchannelAccountId\x20IN\x20?','sequelize','toString','Account.key','a.mandatoryDisposition','Account.mandatoryDisposition','i.*','c.firstName','c.lastName','Contact.lastName','c.email','Contact.email','c.phone','Contact.phone','c.mobile','Contact.mobile','Contact.fax','o.fullname','Owner.fullname','o.internal','Owner.internal','push','rows','show','params','includeAll','include','merge','options','create','describe','addMessage','OpenchannelMessage','omit','getMessages','findOne','pick','OpenchannelInteractionId','format','YYYY-MM-DD\x20HH:mm:ss','addTags','setTags','ids','spread','findAll','openchannelInteractionTags:save','removeTags','unix','join','root','server','files','attachments','transcript-%d-%s.zip','firstName','lastName','Attachment','Messages','direction','secret','OpenchannelAccount','Account','Owner','get'];(function(_0x18a79d,_0x57bd2c){var _0x4f8848=function(_0x28af80){while(--_0x28af80){_0x18a79d['push'](_0x18a79d['shift']());}};_0x4f8848(++_0x57bd2c);}(_0xfb55,0x107));var _0x5fb5=function(_0x4d7798,_0x23b9d7){_0x4d7798=_0x4d7798-0x0;var _0x3fb2f3=_0xfb55[_0x4d7798];return _0x3fb2f3;};'use strict';var pdf=require('html-pdf');var emlformat=require(_0x5fb5('0x0'));var rimraf=require(_0x5fb5('0x1'));var zipdir=require(_0x5fb5('0x2'));var jsonpatch=require(_0x5fb5('0x3'));var rp=require('request-promise');var moment=require(_0x5fb5('0x4'));var BPromise=require('bluebird');var Mustache=require(_0x5fb5('0x5'));var util=require(_0x5fb5('0x6'));var path=require(_0x5fb5('0x7'));var sox=require(_0x5fb5('0x8'));var csv=require('to-csv');var ejs=require('ejs');var fs=require('fs');var _=require(_0x5fb5('0x9'));var squel=require(_0x5fb5('0xa'));var crypto=require(_0x5fb5('0xb'));var jsforce=require('jsforce');var deskjs=require(_0x5fb5('0xc'));var toCsv=require('to-csv');var querystring=require(_0x5fb5('0xd'));var Papa=require(_0x5fb5('0xe'));var Redis=require(_0x5fb5('0xf'));var authService=require(_0x5fb5('0x10'));var qs=require('../../components/parsers/qs');var as=require(_0x5fb5('0x11'));var hardwareService=require(_0x5fb5('0x12'));var logger=require(_0x5fb5('0x13'))(_0x5fb5('0x14'));var utils=require('../../config/utils');var config=require(_0x5fb5('0x15'));var db=require('../../mysqldb')['db'];config[_0x5fb5('0x16')]=_[_0x5fb5('0x17')](config[_0x5fb5('0x16')],{'host':'localhost','port':0x18eb});var socket=require('socket.io-emitter')(new Redis(config[_0x5fb5('0x16')]));require(_0x5fb5('0x18'))['register'](socket);function respondWithStatusCode(_0x4bf809,_0x39baed){_0x39baed=_0x39baed||0xcc;return function(_0x202a3d){if(_0x202a3d){return _0x4bf809[_0x5fb5('0x19')](_0x39baed);}return _0x4bf809[_0x5fb5('0x1a')](_0x39baed)['end']();};}function respondWithResult(_0x2c5db3,_0x4a541e){_0x4a541e=_0x4a541e||0xc8;return function(_0x264487){if(_0x264487){return _0x2c5db3[_0x5fb5('0x1a')](_0x4a541e)[_0x5fb5('0x1b')](_0x264487);}};}function respondWithFilteredResult(_0xddbc21,_0x349ee2){return function(_0x586d19){if(_0x586d19){var _0x2ed855=_0x586d19[_0x5fb5('0x1c')],_0x3ef3f2=_0x349ee2['offset'],_0x585434=_0x349ee2[_0x5fb5('0x1d')]+_0x349ee2['limit'],_0x3b9eb5;if(_0x585434>=_0x2ed855){_0x585434=_0x2ed855;_0x3b9eb5=0xc8;}else{_0x3b9eb5=0xce;}_0xddbc21[_0x5fb5('0x1a')](_0x3b9eb5);return _0xddbc21[_0x5fb5('0x1e')](_0x5fb5('0x1f'),_0x3ef3f2+'-'+_0x585434+'/'+_0x2ed855)['json'](_0x586d19);}return null;};}function patchUpdates(_0x3a9ba4){return function(_0x5cd6c7){try{jsonpatch[_0x5fb5('0x20')](_0x5cd6c7,_0x3a9ba4,!![]);}catch(_0x495c69){return BPromise[_0x5fb5('0x21')](_0x495c69);}return _0x5cd6c7['save']();};}function saveUpdates(_0x202910,_0x1f8ec0){return function(_0x1552bc){if(_0x1552bc){return _0x1552bc[_0x5fb5('0x22')](_0x202910)[_0x5fb5('0x23')](function(_0x455a99){return _0x455a99;});}return null;};}function removeEntity(_0x13c9c7,_0x32321f){return function(_0x22bb54){if(_0x22bb54){return _0x22bb54[_0x5fb5('0x24')]()[_0x5fb5('0x23')](function(){_0x13c9c7['status'](0xcc)[_0x5fb5('0x25')]();});}};}function handleEntityNotFound(_0xf82e55,_0x1f7137){return function(_0x5d8897){if(!_0x5d8897){_0xf82e55[_0x5fb5('0x19')](0x194);}return _0x5d8897;};}function handleError(_0x443152,_0x1839c7){_0x1839c7=_0x1839c7||0x1f4;return function(_0x5db59f){logger[_0x5fb5('0x26')](_0x5db59f[_0x5fb5('0x27')]);if(_0x5db59f[_0x5fb5('0x28')]){delete _0x5db59f[_0x5fb5('0x28')];}_0x443152[_0x5fb5('0x1a')](_0x1839c7)['send'](_0x5db59f);};}function getInteractionUsers(_0x5f3f49,_0x525dfb){return new BPromise(function(_0x55cc9a,_0x34f5fe){try{if(_0x525dfb[_0x5f3f49['id']]){_0x5f3f49[_0x5fb5('0x29')]=_[_0x5fb5('0x2a')](_0x525dfb[_0x5f3f49['id']],function(_0x114793){return{'id':_0x114793['id'],'fullname':_0x114793[_0x5fb5('0x2b')]};});}}catch(_0x54ea00){_0x34f5fe(_0x54ea00);}_0x55cc9a(_0x5f3f49);});}function getInteractionTags(_0x1336fc,_0x3938f5){return new BPromise(function(_0x5c0708,_0x374bc8){try{if(_0x1336fc[_0x5fb5('0x2c')]){_0x1336fc[_0x5fb5('0x2d')]=[];_0x1336fc[_0x5fb5('0x2c')][_0x5fb5('0x2e')](',')[_0x5fb5('0x2f')](function(_0x59777f){_0x1336fc[_0x5fb5('0x2d')]['push'](_0x3938f5[_0x59777f]);});}delete _0x1336fc[_0x5fb5('0x2c')];}catch(_0xd39d5){_0x374bc8(_0xd39d5);}_0x5c0708(_0x1336fc);});}function updateOpenchannelInteraction(_0x6acc65,_0x1fb6dc,_0x504120){return new BPromise(function(_0x1e96ce,_0x35e00e){return getInteractionUsers(_0x6acc65,_0x504120)['then'](function(_0x3fa721){return getInteractionTags(_0x3fa721,_0x1fb6dc);})[_0x5fb5('0x23')](function(_0x4e506a){_0x1e96ce(_0x4e506a);})[_0x5fb5('0x30')](function(_0x527db9){_0x35e00e(_0x527db9);});});}exports[_0x5fb5('0x31')]=function(_0x2ae79a,_0x2c302c){var _0x3c3b79={},_0x2dc828={},_0x54ca96={'count':0x0,'rows':[]};var _0x340cb1=_[_0x5fb5('0x2a')](db[_0x5fb5('0x32')][_0x5fb5('0x33')],function(_0x119054){return{'name':_0x119054[_0x5fb5('0x34')],'type':_0x119054[_0x5fb5('0x35')][_0x5fb5('0x36')]};});_0x2dc828['model']=_[_0x5fb5('0x2a')](_0x340cb1,_0x5fb5('0x28'));_0x2dc828['query']=_[_0x5fb5('0x37')](_0x2ae79a[_0x5fb5('0x38')]);_0x2dc828['filters']=_[_0x5fb5('0x39')](_0x2dc828[_0x5fb5('0x3a')],_0x2dc828[_0x5fb5('0x38')]);_0x3c3b79[_0x5fb5('0x3b')]=_[_0x5fb5('0x39')](_0x2dc828['model'],qs[_0x5fb5('0x3c')](_0x2ae79a[_0x5fb5('0x38')][_0x5fb5('0x3c')]));_0x3c3b79[_0x5fb5('0x3b')]=_0x3c3b79[_0x5fb5('0x3b')][_0x5fb5('0x3d')]?_0x3c3b79[_0x5fb5('0x3b')]:_0x2dc828[_0x5fb5('0x3a')];if(!_0x2ae79a['query']['hasOwnProperty'](_0x5fb5('0x3e'))){_0x3c3b79['limit']=qs[_0x5fb5('0x3f')](_0x2ae79a[_0x5fb5('0x38')]['limit']);_0x3c3b79['offset']=qs[_0x5fb5('0x1d')](_0x2ae79a[_0x5fb5('0x38')][_0x5fb5('0x1d')]);}_0x3c3b79[_0x5fb5('0x40')]=qs[_0x5fb5('0x41')](_0x2ae79a[_0x5fb5('0x38')]['sort']);_0x3c3b79[_0x5fb5('0x42')]=qs[_0x5fb5('0x43')](_['pick'](_0x2ae79a[_0x5fb5('0x38')],_0x2dc828[_0x5fb5('0x43')]));var _0x496222=[];var _0x384aac=squel[_0x5fb5('0x44')]()[_0x5fb5('0x45')]('id')['field']('name')[_0x5fb5('0x45')](_0x5fb5('0x46'))[_0x5fb5('0x47')](_0x5fb5('0x48'));var _0x368b6e=squel['select']()['field'](_0x5fb5('0x49'))['field'](_0x5fb5('0x4a'))[_0x5fb5('0x45')](_0x5fb5('0x4b'))['from'](_0x5fb5('0x4c'),'ui')['left_join'](_0x5fb5('0x4d'),'u',_0x5fb5('0x4e'));var _0x533316=squel[_0x5fb5('0x44')]()['from'](_0x5fb5('0x4f'),'i')[_0x5fb5('0x50')]('cm_contacts','c','c.id\x20=\x20i.ContactId\x20AND\x20c.deletedAt\x20IS\x20NULL')[_0x5fb5('0x50')](_0x5fb5('0x4d'),'o','o.id\x20=\x20i.UserId')['left_join'](_0x5fb5('0x51'),'a',_0x5fb5('0x52'))[_0x5fb5('0x50')](_0x5fb5('0x53'),'me','me.OpenchannelInteractionId\x20=\x20i.id')['left_join']('openchannel_interaction_has_tags','it',_0x5fb5('0x54'))[_0x5fb5('0x50')](_0x5fb5('0x48'),'t',_0x5fb5('0x55'));var _0x3cead5=squel[_0x5fb5('0x56')]();var _0x35a98b=[];var _0x5e1f04=squel[_0x5fb5('0x56')]();var _0x52b3f2;if(_0x2ae79a['query'][_0x5fb5('0x57')]){_0x52b3f2=as[_0x5fb5('0x58')](_0x2ae79a[_0x5fb5('0x38')][_0x5fb5('0x57')]);var _0x420a3b=_0x52b3f2[_0x5fb5('0x59')];for(var _0x2f158f=0x0;_0x2f158f<_0x52b3f2[_0x5fb5('0x5a')]['length'];_0x2f158f++){var _0x47e80e=_0x52b3f2[_0x5fb5('0x5a')][_0x2f158f];var _0x1d2e9d='i';var _0x36c058=_[_0x5fb5('0x5b')](_0x340cb1,['name',_0x47e80e[_0x5fb5('0x45')]]);if(!_0x36c058){switch(_0x47e80e[_0x5fb5('0x45')]){case _0x5fb5('0x5c'):if(_0x47e80e[_0x5fb5('0x5d')]==0x1){_0x533316['having']('`'+_0x47e80e[_0x5fb5('0x45')]+_0x5fb5('0x5e'));}else{_0x533316[_0x5fb5('0x5f')]('`'+_0x47e80e['field']+_0x5fb5('0x60'));}break;case _0x5fb5('0x61'):if(_0x47e80e['operator']===_0x5fb5('0x62')){if(_0x47e80e['value'][_0x5fb5('0x2e')]('\x20')[_0x5fb5('0x3d')]>0x1){_0x3cead5[_0x420a3b]('MATCH\x20(c.firstName,\x20c.lastName,\x20c.phone,\x20c.mobile,\x20c.fax,\x20c.email)\x20AGAINST\x20(?\x20IN\x20BOOLEAN\x20MODE)',qs[_0x5fb5('0x63')](_0x47e80e['value']),null);}else{var _0x58ae95='%'+_0x47e80e[_0x5fb5('0x5d')]+'%';_0x3cead5[_0x420a3b](_0x5fb5('0x64'),_0x58ae95,_0x58ae95,_0x58ae95);}}else{_0x36c058=_[_0x5fb5('0x5b')](_0x340cb1,[_0x5fb5('0x28'),_0x5fb5('0x65')]);_0x47e80e[_0x5fb5('0x45')]=_0x5fb5('0x65');_0x847b99=as[_0x5fb5('0x66')](_0x1d2e9d,_0x36c058[_0x5fb5('0x35')],_0x47e80e);_0x3cead5[_0x420a3b](_0x847b99[_0x5fb5('0x67')],_0x847b99[_0x5fb5('0x5d')]['start'],_0x847b99['value'][_0x5fb5('0x25')]);}break;case _0x5fb5('0x68'):var _0x4d3539=_0x47e80e['value']['split'](',')[_0x5fb5('0x2a')](function(_0x291b84){return Number(_0x291b84);});_0x4d3539[_0x5fb5('0x2f')](function(_0x13a5f2){_0x5e1f04['or'](_0x5fb5('0x69'),'%,'+_0x13a5f2+',%');});_0x35a98b=_[_0x5fb5('0x6a')](_0x35a98b,_0x4d3539);break;case _0x5fb5('0x6b'):if(_0x47e80e[_0x5fb5('0x6c')]==='$substring'){_0x3cead5[_0x420a3b](_0x5fb5('0x6d'),'%'+_0x47e80e[_0x5fb5('0x5d')]+'%',null);}else{_0x36c058=_[_0x5fb5('0x5b')](_0x340cb1,[_0x5fb5('0x28'),_0x5fb5('0x6e')]);_0x47e80e[_0x5fb5('0x45')]=_0x5fb5('0x6e');_0x847b99=as[_0x5fb5('0x66')](_0x1d2e9d,_0x36c058[_0x5fb5('0x35')],_0x47e80e);_0x3cead5[_0x420a3b](_0x847b99['text'],_0x847b99[_0x5fb5('0x5d')]['start'],_0x847b99[_0x5fb5('0x5d')]['end']);}break;case _0x5fb5('0x6f'):_0x847b99=as[_0x5fb5('0x66')]('me',null,_0x47e80e);_0x3cead5[_0x420a3b](_0x847b99['text'],_0x847b99[_0x5fb5('0x5d')]['start'],_0x847b99[_0x5fb5('0x5d')]['end']);break;}}else{var _0x847b99=as['buildExpression'](_0x1d2e9d,_0x36c058[_0x5fb5('0x35')],_0x47e80e);_0x3cead5[_0x420a3b](_0x847b99[_0x5fb5('0x67')],_0x847b99[_0x5fb5('0x5d')]['start'],_0x847b99['value'][_0x5fb5('0x25')]);}}}else{var _0x41549f=_(_0x2ae79a['query'])[_0x5fb5('0x37')]()[_0x5fb5('0x2a')](function(_0x1f7eee){return _['some'](_0x340cb1,[_0x5fb5('0x28'),_0x1f7eee])?_0x1f7eee:undefined;})[_0x5fb5('0x70')]()['value']();if(!_[_0x5fb5('0x71')](_0x41549f)){_0x41549f[_0x5fb5('0x2f')](function(_0x2fb518){if(_0x2fb518===_0x5fb5('0x72')){_0x533316['where']('i.OpenchannelAccountId\x20IN\x20?',[][_0x5fb5('0x73')](_0x2ae79a[_0x5fb5('0x38')][_0x2fb518]));}else if(_0x2fb518===_0x5fb5('0x74')){var _0xe93a39=JSON['parse'](_0x2ae79a[_0x5fb5('0x38')][_0x2fb518])[_0x5fb5('0x75')];var _0x5aeaa6=JSON[_0x5fb5('0x76')](_0x2ae79a[_0x5fb5('0x38')][_0x2fb518])[_0x5fb5('0x77')];_0x533316['where'](_0x5fb5('0x78'),_0xe93a39,_0x5aeaa6);}else{if(_0x2ae79a[_0x5fb5('0x38')][_0x2fb518]==='null'){_0x533316[_0x5fb5('0x42')]('i.'+_0x2fb518+_0x5fb5('0x79'));}else{_0x533316['where']('i.'+_0x2fb518+_0x5fb5('0x7a'),_0x2ae79a[_0x5fb5('0x38')][_0x2fb518]);}}});}if(_0x2ae79a['query'][_0x5fb5('0x7b')]){if(_0x2ae79a['query']['read']==0x1){_0x533316['having'](_0x5fb5('0x7c'));}else{_0x533316[_0x5fb5('0x5f')]('`unreadMessages`\x20>\x200');}}if(_0x2ae79a[_0x5fb5('0x38')]['tag']){_0x35a98b=_[_0x5fb5('0x7d')](_0x2ae79a['query'][_0x5fb5('0x7e')])?_0x2ae79a[_0x5fb5('0x38')][_0x5fb5('0x7e')]:new Array(_0x2ae79a[_0x5fb5('0x38')][_0x5fb5('0x7e')]);_0x35a98b['forEach'](function(_0x3408e6){_0x5e1f04['or']('CONCAT(\x27,\x27,\x20`TagIds`,\x20\x27,\x27)\x20LIKE\x20?','%,'+_0x3408e6+',%');});}if(_0x2ae79a[_0x5fb5('0x38')][_0x5fb5('0x7f')]){var _0x2e2b50=_0x2ae79a[_0x5fb5('0x38')][_0x5fb5('0x7f')][_0x5fb5('0x80')]('\x5c','\x5c\x5c')[_0x5fb5('0x80')]('\x27\x27',_0x5fb5('0x81'));if(qs[_0x5fb5('0x82')](_0x2e2b50)){_0x3cead5['or'](_0x5fb5('0x83'),_0x2e2b50+'%');}else{_0x3cead5['or']('MATCH\x20(me.body)\x20AGAINST\x20(?\x20IN\x20BOOLEAN\x20MODE)',qs[_0x5fb5('0x63')](_0x2e2b50))['or'](_0x5fb5('0x84'),_0x2e2b50+'%')['or'](_0x5fb5('0x85'),_0x2e2b50+'%');}}}_0x533316[_0x5fb5('0x42')](_0x3cead5);_0x533316[_0x5fb5('0x86')](_0x5fb5('0x87'));var _0x913507={'type':db[_0x5fb5('0x88')][_0x5fb5('0x89')][_0x5fb5('0x8a')],'raw':!![]};var _0x15b378=_0x533316[_0x5fb5('0x8b')]();_0x15b378[_0x5fb5('0x45')](_0x5fb5('0x87'));_0x15b378[_0x5fb5('0x45')](_0x5fb5('0x8c'),_0x5fb5('0x5c'));if(_0x3c3b79['order']){_0x3c3b79[_0x5fb5('0x40')][_0x5fb5('0x2f')](function(_0x499fec){_0x533316[_0x5fb5('0x40')]('i.'+_0x499fec[0x0],_0x499fec[0x1]===_0x5fb5('0x8d')?![]:!![]);});}if(!_['isEmpty'](_0x35a98b)){_0x533316[_0x5fb5('0x5f')](_0x5e1f04);_0x15b378[_0x5fb5('0x42')](_0x5fb5('0x8e'),_0x35a98b);}BPromise[_0x5fb5('0x8f')]()[_0x5fb5('0x23')](function(){if(!_0x52b3f2){if(_0x2ae79a[_0x5fb5('0x38')][_0x5fb5('0x72')]||_0x2ae79a[_0x5fb5('0x38')][_0x5fb5('0x90')])return;_0x15b378[_0x5fb5('0x42')]('i.OpenchannelAccountId\x20IS\x20NOT\x20NULL');_0x533316['where'](_0x5fb5('0x91'));return;}return _0x2ae79a[_0x5fb5('0x92')][_0x5fb5('0x93')]({'attributes':['id'],'raw':!![]})[_0x5fb5('0x23')](function(_0x2d44ca){if(_['isEmpty'](_0x2d44ca)){_0x15b378[_0x5fb5('0x42')]('i.OpenchannelAccountId\x20IS\x20NULL');_0x533316['where'](_0x5fb5('0x94'));}else{_0x15b378[_0x5fb5('0x42')]('i.OpenchannelAccountId\x20IN\x20?',_[_0x5fb5('0x2a')](_0x2d44ca,'id'));_0x533316[_0x5fb5('0x42')](_0x5fb5('0x95'),_[_0x5fb5('0x2a')](_0x2d44ca,'id'));}});})['then'](function(){db[_0x5fb5('0x96')][_0x5fb5('0x38')](_0x15b378['toString'](),_0x913507)[_0x5fb5('0x23')](function(_0x207d98){_0x54ca96[_0x5fb5('0x1c')]=_0x207d98[_0x5fb5('0x3d')];if(_0x54ca96[_0x5fb5('0x1c')]===0x0)return[];return db[_0x5fb5('0x96')][_0x5fb5('0x38')](_0x384aac[_0x5fb5('0x97')](),_0x913507)[_0x5fb5('0x23')](function(_0x36c7e8){_0x496222=_['keyBy'](_0x36c7e8,'id');_0x913507=_['merge'](_0x913507,{'model':db[_0x5fb5('0x32')],'mapToModel':!![],'raw':!![],'nest':!![]});if(_0x2ae79a[_0x5fb5('0x38')]['fields']){_0x3c3b79[_0x5fb5('0x3b')][_0x5fb5('0x2f')](function(_0x327cb5){_0x533316[_0x5fb5('0x45')]('i.'+_0x327cb5);});}else{_0x533316[_0x5fb5('0x45')](_0x5fb5('0x8c'),_0x5fb5('0x5c'));_0x533316[_0x5fb5('0x45')]('a.key',_0x5fb5('0x98'));_0x533316[_0x5fb5('0x45')](_0x5fb5('0x99'),_0x5fb5('0x9a'));_0x533316[_0x5fb5('0x45')](_0x5fb5('0x9b'));_0x533316[_0x5fb5('0x45')](_0x5fb5('0x9c'),'Contact.firstName');_0x533316[_0x5fb5('0x45')](_0x5fb5('0x9d'),_0x5fb5('0x9e'));_0x533316[_0x5fb5('0x45')](_0x5fb5('0x9f'),_0x5fb5('0xa0'));_0x533316['field'](_0x5fb5('0xa1'),_0x5fb5('0xa2'));_0x533316[_0x5fb5('0x45')](_0x5fb5('0xa3'),_0x5fb5('0xa4'));_0x533316['field']('c.fax',_0x5fb5('0xa5'));_0x533316['field'](_0x5fb5('0xa6'),_0x5fb5('0xa7'));_0x533316[_0x5fb5('0x45')](_0x5fb5('0xa8'),_0x5fb5('0xa9'));_0x533316[_0x5fb5('0x45')]('GROUP_CONCAT(DISTINCT\x20t.id)',_0x5fb5('0x2c'));}_0x533316['limit'](_0x3c3b79[_0x5fb5('0x3f')]);_0x533316['offset'](_0x3c3b79[_0x5fb5('0x1d')]);return db[_0x5fb5('0x96')]['query'](_0x533316[_0x5fb5('0x97')](),_0x913507);})[_0x5fb5('0x23')](function(_0x225330){_0x368b6e[_0x5fb5('0x42')]('ui.OpenchannelInteractionId\x20IN\x20?',_[_0x5fb5('0x2a')](_0x225330,'id'));return db['sequelize'][_0x5fb5('0x38')](_0x368b6e[_0x5fb5('0x97')](),_0x913507)[_0x5fb5('0x23')](function(_0x5b02f4){var _0x472a2b=_['groupBy'](_0x5b02f4,'OpenchannelInteractionId');var _0xba1cb2=[];_0x225330[_0x5fb5('0x2f')](function(_0x151a37){_0xba1cb2[_0x5fb5('0xaa')](updateOpenchannelInteraction(_0x151a37,_0x496222,_0x472a2b));});return BPromise['all'](_0xba1cb2);});});})[_0x5fb5('0x23')](function(_0x452622){_0x54ca96[_0x5fb5('0xab')]=_0x452622;return _0x54ca96;})[_0x5fb5('0x23')](respondWithFilteredResult(_0x2c302c,_0x3c3b79));})[_0x5fb5('0x30')](handleError(_0x2c302c,null));};exports[_0x5fb5('0xac')]=function(_0x309b3c,_0x4c5f48){var _0x2fa95c={'raw':![],'where':{'id':_0x309b3c[_0x5fb5('0xad')]['id']}},_0x1600ff={};_0x1600ff[_0x5fb5('0x3a')]=_[_0x5fb5('0x37')](db['OpenchannelInteraction'][_0x5fb5('0x33')]);_0x1600ff[_0x5fb5('0x38')]=_[_0x5fb5('0x37')](_0x309b3c[_0x5fb5('0x38')]);_0x1600ff[_0x5fb5('0x43')]=_[_0x5fb5('0x39')](_0x1600ff[_0x5fb5('0x3a')],_0x1600ff[_0x5fb5('0x38')]);_0x2fa95c[_0x5fb5('0x3b')]=_[_0x5fb5('0x39')](_0x1600ff[_0x5fb5('0x3a')],qs[_0x5fb5('0x3c')](_0x309b3c[_0x5fb5('0x38')][_0x5fb5('0x3c')]));_0x2fa95c[_0x5fb5('0x3b')]=_0x2fa95c[_0x5fb5('0x3b')]['length']?_0x2fa95c[_0x5fb5('0x3b')]:_0x1600ff[_0x5fb5('0x3a')];if(_0x309b3c['query'][_0x5fb5('0xae')]){_0x2fa95c[_0x5fb5('0xaf')]=[{'all':!![]}];}_0x2fa95c=_[_0x5fb5('0xb0')]({},_0x2fa95c,_0x309b3c[_0x5fb5('0xb1')]);return db['OpenchannelInteraction'][_0x5fb5('0x5b')](_0x2fa95c)[_0x5fb5('0x23')](handleEntityNotFound(_0x4c5f48,null))[_0x5fb5('0x23')](respondWithResult(_0x4c5f48,null))[_0x5fb5('0x30')](handleError(_0x4c5f48,null));};exports[_0x5fb5('0xb2')]=function(_0x5ae772,_0x5bca14){return db[_0x5fb5('0x32')][_0x5fb5('0xb2')](_0x5ae772[_0x5fb5('0x6f')],{})['then'](respondWithResult(_0x5bca14,0xc9))[_0x5fb5('0x30')](handleError(_0x5bca14,null));};exports[_0x5fb5('0x22')]=function(_0x4572b1,_0x555bff){if(_0x4572b1[_0x5fb5('0x6f')]['id']){delete _0x4572b1[_0x5fb5('0x6f')]['id'];}return db[_0x5fb5('0x32')][_0x5fb5('0x5b')]({'where':{'id':_0x4572b1[_0x5fb5('0xad')]['id']}})[_0x5fb5('0x23')](handleEntityNotFound(_0x555bff,null))[_0x5fb5('0x23')](saveUpdates(_0x4572b1[_0x5fb5('0x6f')],null))['then'](respondWithResult(_0x555bff,null))[_0x5fb5('0x30')](handleError(_0x555bff,null));};exports[_0x5fb5('0x24')]=function(_0x2fbb00,_0x40b691){return db['OpenchannelInteraction'][_0x5fb5('0x5b')]({'where':{'id':_0x2fbb00['params']['id']}})[_0x5fb5('0x23')](handleEntityNotFound(_0x40b691,null))[_0x5fb5('0x23')](removeEntity(_0x40b691,null))[_0x5fb5('0x30')](handleError(_0x40b691,null));};exports['describe']=function(_0x388029,_0x554a6e){return db[_0x5fb5('0x32')][_0x5fb5('0xb3')]()[_0x5fb5('0x23')](respondWithResult(_0x554a6e,null))['catch'](handleError(_0x554a6e,null));};exports[_0x5fb5('0xb4')]=function(_0x47d8dc,_0x428ee9,_0x31ee0b){return db[_0x5fb5('0xb5')][_0x5fb5('0x5b')]({'where':{'id':_0x47d8dc['params']['id']}})['then'](handleEntityNotFound(_0x428ee9,null))[_0x5fb5('0x23')](function(_0x3ba151){if(_0x3ba151){return _0x3ba151['addMessage'](_0x47d8dc[_0x5fb5('0x6f')]['ids'],_[_0x5fb5('0xb6')](_0x47d8dc[_0x5fb5('0x6f')],['ids','id'])||{});}})[_0x5fb5('0x23')](respondWithResult(_0x428ee9,null))[_0x5fb5('0x30')](handleError(_0x428ee9,null));};exports[_0x5fb5('0xb7')]=function(_0x10947e,_0x8d7cb8,_0xeabdc7){var _0x1b106e={'raw':![],'where':{}};var _0x3f8f88={};var _0x44cd24={'count':0x0,'rows':[]};return db[_0x5fb5('0x32')][_0x5fb5('0xb8')]({'where':{'id':_0x10947e[_0x5fb5('0xad')]['id']}})[_0x5fb5('0x23')](handleEntityNotFound(_0x8d7cb8,null))[_0x5fb5('0x23')](function(_0x125ed5){if(_0x125ed5){_0x3f8f88[_0x5fb5('0x3a')]=_['keys'](db[_0x5fb5('0xb5')][_0x5fb5('0x33')]);_0x3f8f88[_0x5fb5('0x38')]=_[_0x5fb5('0x37')](_0x10947e[_0x5fb5('0x38')]);_0x3f8f88[_0x5fb5('0x43')]=_[_0x5fb5('0x39')](_0x3f8f88[_0x5fb5('0x3a')],_0x3f8f88['query']);_0x1b106e['attributes']=_['intersection'](_0x3f8f88[_0x5fb5('0x3a')],qs[_0x5fb5('0x3c')](_0x10947e[_0x5fb5('0x38')][_0x5fb5('0x3c')]));_0x1b106e[_0x5fb5('0x3b')]=_0x1b106e[_0x5fb5('0x3b')][_0x5fb5('0x3d')]?_0x1b106e[_0x5fb5('0x3b')]:_0x3f8f88[_0x5fb5('0x3a')];if(!_0x10947e[_0x5fb5('0x38')]['hasOwnProperty']('nolimit')){_0x1b106e[_0x5fb5('0x3f')]=qs[_0x5fb5('0x3f')](_0x10947e[_0x5fb5('0x38')][_0x5fb5('0x3f')]);_0x1b106e[_0x5fb5('0x1d')]=qs[_0x5fb5('0x1d')](_0x10947e['query'][_0x5fb5('0x1d')]);}_0x1b106e[_0x5fb5('0x40')]=qs[_0x5fb5('0x41')](_0x10947e[_0x5fb5('0x38')][_0x5fb5('0x41')]);_0x1b106e['where']=qs[_0x5fb5('0x43')](_[_0x5fb5('0xb9')](_0x10947e[_0x5fb5('0x38')],_0x3f8f88[_0x5fb5('0x43')]));_0x1b106e[_0x5fb5('0x42')][_0x5fb5('0xba')]=_0x125ed5['id'];if(_0x10947e['query'][_0x5fb5('0x7f')]){_0x1b106e[_0x5fb5('0x42')]=_[_0x5fb5('0xb0')](_0x1b106e[_0x5fb5('0x42')],{'$or':_['map'](_0x1b106e['attributes'],function(_0x487ed4){var _0x2f5aab={};_0x2f5aab[_0x487ed4]={'$like':'%'+_0x10947e[_0x5fb5('0x38')][_0x5fb5('0x7f')]+'%'};return _0x2f5aab;})});}if(_0x10947e[_0x5fb5('0x38')][_0x5fb5('0x75')]){var _0xe385b7=_0x10947e[_0x5fb5('0x38')]['$gte']['split'](',');var _0x32d64f={};_0x32d64f[_0xe385b7[0x0]]={'$gte':moment(_0xe385b7[0x1])[_0x5fb5('0xbb')](_0x5fb5('0xbc'))};_0x1b106e[_0x5fb5('0x42')]=_['merge'](_0x1b106e[_0x5fb5('0x42')],_0x32d64f);}_0x1b106e=_[_0x5fb5('0xb0')]({},_0x1b106e,_0x10947e[_0x5fb5('0xb1')]);return db['OpenchannelMessage']['count']({'where':_0x1b106e['where']})['then'](function(_0x247cf4){_0x44cd24[_0x5fb5('0x1c')]=_0x247cf4;if(_0x10947e[_0x5fb5('0x38')][_0x5fb5('0xae')]){_0x1b106e[_0x5fb5('0xaf')]=[{'all':!![]}];}return db[_0x5fb5('0xb5')]['findAll'](_0x1b106e);})[_0x5fb5('0x23')](function(_0x2f2210){_0x44cd24[_0x5fb5('0xab')]=_0x2f2210;return _0x44cd24;});}})['then'](respondWithFilteredResult(_0x8d7cb8,_0x1b106e))[_0x5fb5('0x30')](handleError(_0x8d7cb8,null));};exports[_0x5fb5('0xbd')]=function(_0x35de83,_0x529a2b,_0x430858){return db[_0x5fb5('0x32')][_0x5fb5('0x5b')]({'where':{'id':_0x35de83[_0x5fb5('0xad')]['id']}})[_0x5fb5('0x23')](handleEntityNotFound(_0x529a2b,null))[_0x5fb5('0x23')](function(_0x4e12e9){if(_0x4e12e9){return _0x4e12e9[_0x5fb5('0xbe')](_0x35de83[_0x5fb5('0x6f')][_0x5fb5('0xbf')],_['omit'](_0x35de83[_0x5fb5('0x6f')],['ids','id'])||{})[_0x5fb5('0xc0')](function(){return db[_0x5fb5('0x68')][_0x5fb5('0xc1')]({'attributes':['id',_0x5fb5('0x28'),_0x5fb5('0x46')],'where':{'id':_0x35de83['body'][_0x5fb5('0xbf')]}});})[_0x5fb5('0x23')](function(_0x1666d2){socket['emit'](_0x5fb5('0xc2'),{'id':Number(_0x35de83[_0x5fb5('0xad')]['id']),'tags':_0x1666d2||[]});return{'id':Number(_0x35de83['params']['id']),'tags':_0x1666d2||[]};});}})[_0x5fb5('0x23')](respondWithResult(_0x529a2b,null))[_0x5fb5('0x30')](handleError(_0x529a2b,null));};exports[_0x5fb5('0xc3')]=function(_0x3f9033,_0x526a72,_0x254501){return db[_0x5fb5('0x32')][_0x5fb5('0x5b')]({'where':{'id':_0x3f9033['params']['id']}})[_0x5fb5('0x23')](handleEntityNotFound(_0x526a72,null))[_0x5fb5('0x23')](function(_0x50e832){if(_0x50e832){return _0x50e832[_0x5fb5('0xc3')](_0x3f9033[_0x5fb5('0x38')][_0x5fb5('0xbf')]);}})[_0x5fb5('0x23')](respondWithStatusCode(_0x526a72,null))['catch'](handleError(_0x526a72,null));};exports['download']=function(_0x1c3522,_0x4bfff7){var _0x3fa96d=moment()[_0x5fb5('0xc4')]()[_0x5fb5('0x97')]();var _0x434099=path[_0x5fb5('0xc5')](config[_0x5fb5('0xc6')],_0x5fb5('0xc7'),_0x5fb5('0xc8'),'tmp');var _0x366ecb=path[_0x5fb5('0xc5')](config[_0x5fb5('0xc6')],_0x5fb5('0xc7'),_0x5fb5('0xc8'),_0x5fb5('0xc9'));var _0x536fc3=path[_0x5fb5('0xc5')](_0x434099,_0x3fa96d);var _0x386ef9=util['format'](_0x5fb5('0xca'),_0x1c3522[_0x5fb5('0xad')]['id'],_0x3fa96d);var _0xd8a9bd=path[_0x5fb5('0xc5')](_0x434099,_0x386ef9);var _0x254e5f=[];_0x254e5f[_0x5fb5('0xaa')]({'model':db['User'],'as':'User','attributes':['id',_0x5fb5('0x2b')],'raw':!![]});_0x254e5f[_0x5fb5('0xaa')]({'model':db['CmContact'],'as':_0x5fb5('0x61'),'attributes':['id',_0x5fb5('0xcb'),_0x5fb5('0xcc')],'raw':!![]});if(_0x1c3522['query']['attachments']){_0x254e5f[_0x5fb5('0xaa')]({'model':db[_0x5fb5('0xcd')],'as':_0x5fb5('0xcd'),'raw':!![]});}var _0x28b1a4=[{'model':db[_0x5fb5('0xb5')],'as':_0x5fb5('0xce'),'attributes':['id','body',_0x5fb5('0x74'),_0x5fb5('0xcf'),_0x5fb5('0xd0'),'read'],'include':_0x254e5f}];_0x28b1a4[_0x5fb5('0xaa')]({'model':db[_0x5fb5('0xd1')],'as':_0x5fb5('0xd2'),'attributes':['id',_0x5fb5('0x28')]});_0x28b1a4[_0x5fb5('0xaa')]({'model':db['User'],'as':_0x5fb5('0xd3'),'attributes':['id',_0x5fb5('0x2b')]});return db[_0x5fb5('0x32')][_0x5fb5('0x5b')]({'where':{'id':_0x1c3522[_0x5fb5('0xad')]['id']},'include':_0x28b1a4})[_0x5fb5('0x23')](handleEntityNotFound(_0x4bfff7,null))['then'](function(_0x2721e9){if(_0x2721e9){var _0x2ab05c=_0x2721e9[_0x5fb5('0xd4')]({'plain':!![]});fs[_0x5fb5('0xd5')](_0x536fc3);var _0x27e443={'format':'A4','border':_0x5fb5('0xd6'),'header':{'height':_0x5fb5('0xd7'),'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[_0x5fb5('0xbb')](' \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[_0x5fb5('0xbb')](_0x5fb5('0xd8'),_0x5fb5('0xd9'),_0x2ab05c['id']),moment()[_0x5fb5('0xbb')](_0x5fb5('0xda'))[_0x5fb5('0x97')]())}}};var _0x1488fa={'channel':_0x5fb5('0xd9'),'account':_0x2ab05c[_0x5fb5('0xd2')]['name'],'agent':_0x2ab05c[_0x5fb5('0xd3')]?_0x2ab05c[_0x5fb5('0xd3')][_0x5fb5('0x2b')]:_0x5fb5('0xdb'),'createdAt':moment(_0x2ab05c[_0x5fb5('0x74')])[_0x5fb5('0xbb')](_0x5fb5('0xbc'))[_0x5fb5('0x97')](),'closedAt':_0x2ab05c[_0x5fb5('0xdc')]?moment(_0x2ab05c[_0x5fb5('0xdd')])[_0x5fb5('0xbb')](_0x5fb5('0xbc'))['toString']():'','disposition':_0x2ab05c['disposition'],'visibility':_0x2ab05c[_0x5fb5('0xde')]?_0x5fb5('0xdf'):_0x5fb5('0xe0'),'messages':_(_0x2ab05c[_0x5fb5('0xce')])[_0x5fb5('0x7f')]({'secret':![]})[_0x5fb5('0x2a')](function(_0x36ab6d){if(_0x36ab6d[_0x5fb5('0xcd')]){var _0x370d55=path[_0x5fb5('0xc5')](_0x366ecb,_0x36ab6d['Attachment'][_0x5fb5('0xe1')]);if(fs['existsSync'](_0x370d55)){fs[_0x5fb5('0xe2')](_0x370d55)[_0x5fb5('0xe3')](fs[_0x5fb5('0xe4')](path[_0x5fb5('0xc5')](_0x536fc3,_0x36ab6d[_0x5fb5('0xcd')][_0x5fb5('0xe1')])));}}return{'date':moment(_0x36ab6d['createdAt'])[_0x5fb5('0xbb')](_0x5fb5('0xbc'))[_0x5fb5('0x97')](),'sender':_0x36ab6d[_0x5fb5('0xcf')]===_0x5fb5('0xe5')?_0x36ab6d[_0x5fb5('0x6b')]?_0x36ab6d[_0x5fb5('0x6b')][_0x5fb5('0x2b')]:'System':_0x36ab6d[_0x5fb5('0x61')][_0x5fb5('0xcb')]+(_0x36ab6d['Contact'][_0x5fb5('0xcc')]?'\x20'+_0x36ab6d[_0x5fb5('0x61')]['lastName']:''),'body':_0x36ab6d[_0x5fb5('0xcd')]?_0x36ab6d['Attachment'][_0x5fb5('0xe1')]:_0x36ab6d[_0x5fb5('0x6f')],'direction':_0x36ab6d[_0x5fb5('0xcf')]===_0x5fb5('0xe5')?'A':'C','secret':_0x36ab6d[_0x5fb5('0xd0')],'read':_0x36ab6d[_0x5fb5('0x7b')],'attachment':_0x36ab6d[_0x5fb5('0xcd')]};})[_0x5fb5('0x5d')]()};return ejs[_0x5fb5('0xe6')](path[_0x5fb5('0xc5')](config[_0x5fb5('0xc6')],_0x5fb5('0xc7'),'views',_0x5fb5('0xe7')),{'interaction':_0x1488fa})[_0x5fb5('0x23')](function(_0x71c36f){return new BPromise(function(_0x198ba6,_0x16ccc2){pdf[_0x5fb5('0xb2')](_0x71c36f,_0x27e443)['toFile'](path['join'](_0x536fc3,_0x5fb5('0xe8')+_0x2ab05c['id']+'-'+_0x3fa96d+_0x5fb5('0xe9')),function(_0x53c77f,_0x3854c7){if(_0x53c77f)return _0x16ccc2(_0x53c77f);_0x198ba6(_0x3854c7);});});})[_0x5fb5('0x23')](function(){return new BPromise(function(_0x247aa4,_0x14407b){zipdir(_0x536fc3,{'saveTo':_0xd8a9bd},function(_0x5d839a,_0x5ea68f){if(_0x5d839a)return _0x14407b(_0x5d839a);return _0x247aa4(_0x5ea68f);});})[_0x5fb5('0x23')](function(){return new BPromise(function(_0x13c5fc,_0x97281){rimraf(_0x536fc3,function(_0x39937b){if(_0x39937b)_0x97281(_0x39937b);return _0x13c5fc();});});})[_0x5fb5('0x23')](function(){return _0x4bfff7[_0x5fb5('0xea')](_0xd8a9bd,_0x386ef9,function(_0xf14c0c){if(_0xf14c0c){console[_0x5fb5('0xeb')](_0x5fb5('0xec'),_0xf14c0c);}else{fs[_0x5fb5('0xed')](_0xd8a9bd);}});});});}else{return _0x4bfff7[_0x5fb5('0x19')](0xc8);}})[_0x5fb5('0x30')](handleError(_0x4bfff7,null));};
\ No newline at end of file
+var _0x4f7e=['offset','limit','apply','reject','save','update','then','stack','map','fullname','TagIds','split','forEach','Tags','catch','index','fieldName','type','name','keys','query','filters','intersection','model','fields','attributes','length','nolimit','order','sort','where','pick','select','field','from','tools_tags','u.id','u.fullname','ui.OpenchannelInteractionId','left_join','u.id\x20=\x20ui.UserId','c.id\x20=\x20i.ContactId\x20AND\x20c.deletedAt\x20IS\x20NULL','users','o.id\x20=\x20i.UserId','openchannel_messages','me.OpenchannelInteractionId\x20=\x20i.id','openchannel_interaction_has_tags','it.OpenchannelInteractionId\x20=\x20i.id','expr','search','parseSearch','sqlOperator','conditions','find','unreadMessages','value','having','`\x20=\x200','Contact','$substring','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','CONCAT(\x27,\x27,\x20`TagIds`,\x20\x27,\x27)\x20LIKE\x20?','union','User','UserId','body','some','compact','isEmpty','OpenchannelAccountId','i.OpenchannelAccountId\x20IN\x20?','concat','createdAt','parse','$gte','$lte','i.createdAt\x20BETWEEN\x20?\x20AND\x20?','null','\x20IS\x20NULL','read','`unreadMessages`\x20=\x200','`unreadMessages`\x20>\x200','tag','isArray','filter','replace','\x27\x27\x27\x27','isNumeric','i.id\x20LIKE\x20?','MATCH\x20(me.body)\x20AGAINST\x20(?\x20IN\x20BOOLEAN\x20MODE)','group','i.id','Sequelize','QueryTypes','SELECT','clone','DESC','t.id\x20IN\x20?','resolve','i.OpenchannelAccountId\x20IS\x20NOT\x20NULL','user','i.OpenchannelAccountId\x20IS\x20NULL','sequelize','toString','count','merge','OpenchannelInteraction','a.key','Account.key','a.mandatoryDisposition','Account.mandatoryDisposition','Contact.firstName','Contact.lastName','Contact.email','c.phone','Contact.phone','c.mobile','Contact.mobile','c.fax','o.fullname','Owner.fullname','Owner.internal','GROUP_CONCAT(DISTINCT\x20t.id)','ui.OpenchannelInteractionId\x20IN\x20?','groupBy','rows','show','rawAttributes','options','create','params','destroy','describe','addMessage','OpenchannelMessage','ids','omit','getMessages','hasOwnProperty','YYYY-MM-DD\x20HH:mm:ss','includeAll','addTags','setTags','spread','findAll','color','emit','removeTags','download','join','root','server','files','tmp','attachments','transcript-%d-%s.zip','push','firstName','lastName','Attachment','Messages','secret','OpenchannelAccount','Owner','get','40px','\x0a\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20
Interaction\x20Transcript \x0a\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20','30px','format','%s\x20#%d','Openchannel','Account','N.A.','closed','Public','Private','basename','existsSync','createReadStream','pipe','createWriteStream','out','direction','renderFile','views','toFile','.pdf','log','sendStatus','eml-format','rimraf','zip-dir','moment','bluebird','mustache','sox','to-csv','lodash','crypto','jsforce','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/environment','../../mysqldb','redis','defaults','socket.io-emitter','./openchannelInteraction.socket','end','status','json'];(function(_0x3dd15e,_0x1f0015){var _0x231fd0=function(_0x4f680a){while(--_0x4f680a){_0x3dd15e['push'](_0x3dd15e['shift']());}};_0x231fd0(++_0x1f0015);}(_0x4f7e,0x1a4));var _0xe4f7=function(_0x437d98,_0x5d844e){_0x437d98=_0x437d98-0x0;var _0x265b77=_0x4f7e[_0x437d98];return _0x265b77;};'use strict';var pdf=require('html-pdf');var emlformat=require(_0xe4f7('0x0'));var rimraf=require(_0xe4f7('0x1'));var zipdir=require(_0xe4f7('0x2'));var jsonpatch=require('fast-json-patch');var rp=require('request-promise');var moment=require(_0xe4f7('0x3'));var BPromise=require(_0xe4f7('0x4'));var Mustache=require(_0xe4f7('0x5'));var util=require('util');var path=require('path');var sox=require(_0xe4f7('0x6'));var csv=require(_0xe4f7('0x7'));var ejs=require('ejs');var fs=require('fs');var _=require(_0xe4f7('0x8'));var squel=require('squel');var crypto=require(_0xe4f7('0x9'));var jsforce=require(_0xe4f7('0xa'));var deskjs=require('desk.js');var toCsv=require(_0xe4f7('0x7'));var querystring=require(_0xe4f7('0xb'));var Papa=require(_0xe4f7('0xc'));var Redis=require(_0xe4f7('0xd'));var authService=require(_0xe4f7('0xe'));var qs=require('../../components/parsers/qs');var as=require(_0xe4f7('0xf'));var hardwareService=require(_0xe4f7('0x10'));var logger=require(_0xe4f7('0x11'))(_0xe4f7('0x12'));var utils=require('../../config/utils');var config=require(_0xe4f7('0x13'));var db=require(_0xe4f7('0x14'))['db'];config[_0xe4f7('0x15')]=_[_0xe4f7('0x16')](config['redis'],{'host':'localhost','port':0x18eb});var socket=require(_0xe4f7('0x17'))(new Redis(config[_0xe4f7('0x15')]));require(_0xe4f7('0x18'))['register'](socket);function respondWithStatusCode(_0x2b6865,_0x299e5e){_0x299e5e=_0x299e5e||0xcc;return function(_0xadada5){if(_0xadada5){return _0x2b6865['sendStatus'](_0x299e5e);}return _0x2b6865['status'](_0x299e5e)[_0xe4f7('0x19')]();};}function respondWithResult(_0x3490f5,_0xdb87ef){_0xdb87ef=_0xdb87ef||0xc8;return function(_0x48e11b){if(_0x48e11b){return _0x3490f5[_0xe4f7('0x1a')](_0xdb87ef)[_0xe4f7('0x1b')](_0x48e11b);}};}function respondWithFilteredResult(_0x1daade,_0x3aca6a){return function(_0x544927){if(_0x544927){var _0xcb6b59=_0x544927['count'],_0x4c8cc5=_0x3aca6a['offset'],_0x4ca80e=_0x3aca6a[_0xe4f7('0x1c')]+_0x3aca6a[_0xe4f7('0x1d')],_0x5c6745;if(_0x4ca80e>=_0xcb6b59){_0x4ca80e=_0xcb6b59;_0x5c6745=0xc8;}else{_0x5c6745=0xce;}_0x1daade[_0xe4f7('0x1a')](_0x5c6745);return _0x1daade['set']('Content-Range',_0x4c8cc5+'-'+_0x4ca80e+'/'+_0xcb6b59)[_0xe4f7('0x1b')](_0x544927);}return null;};}function patchUpdates(_0xff9b80){return function(_0x425fcc){try{jsonpatch[_0xe4f7('0x1e')](_0x425fcc,_0xff9b80,!![]);}catch(_0x247ffc){return BPromise[_0xe4f7('0x1f')](_0x247ffc);}return _0x425fcc[_0xe4f7('0x20')]();};}function saveUpdates(_0x5ab7a6,_0x343363){return function(_0x536162){if(_0x536162){return _0x536162[_0xe4f7('0x21')](_0x5ab7a6)['then'](function(_0x1fbdc2){return _0x1fbdc2;});}return null;};}function removeEntity(_0x31839a,_0x1c9377){return function(_0x2fb93d){if(_0x2fb93d){return _0x2fb93d['destroy']()[_0xe4f7('0x22')](function(){_0x31839a[_0xe4f7('0x1a')](0xcc)[_0xe4f7('0x19')]();});}};}function handleEntityNotFound(_0x1e1cc5,_0x3e3604){return function(_0x5a0154){if(!_0x5a0154){_0x1e1cc5['sendStatus'](0x194);}return _0x5a0154;};}function handleError(_0x84a41d,_0x190fb8){_0x190fb8=_0x190fb8||0x1f4;return function(_0x32bc10){logger['error'](_0x32bc10[_0xe4f7('0x23')]);if(_0x32bc10['name']){delete _0x32bc10['name'];}_0x84a41d[_0xe4f7('0x1a')](_0x190fb8)['send'](_0x32bc10);};}function getInteractionUsers(_0x2730f5,_0x4058d3){return new BPromise(function(_0x488b86,_0x2029e9){try{if(_0x4058d3[_0x2730f5['id']]){_0x2730f5['Users']=_[_0xe4f7('0x24')](_0x4058d3[_0x2730f5['id']],function(_0x541479){return{'id':_0x541479['id'],'fullname':_0x541479[_0xe4f7('0x25')]};});}}catch(_0x141a3c){_0x2029e9(_0x141a3c);}_0x488b86(_0x2730f5);});}function getInteractionTags(_0x33626c,_0x264a06){return new BPromise(function(_0x356e96,_0x5ede21){try{if(_0x33626c[_0xe4f7('0x26')]){_0x33626c['Tags']=[];_0x33626c[_0xe4f7('0x26')][_0xe4f7('0x27')](',')[_0xe4f7('0x28')](function(_0x331bc8){_0x33626c[_0xe4f7('0x29')]['push'](_0x264a06[_0x331bc8]);});}delete _0x33626c[_0xe4f7('0x26')];}catch(_0x3575c0){_0x5ede21(_0x3575c0);}_0x356e96(_0x33626c);});}function updateOpenchannelInteraction(_0x19373a,_0x56bf0b,_0x1fee9f){return new BPromise(function(_0x4bf337,_0x25e005){return getInteractionUsers(_0x19373a,_0x1fee9f)[_0xe4f7('0x22')](function(_0x1ef135){return getInteractionTags(_0x1ef135,_0x56bf0b);})['then'](function(_0x5a8442){_0x4bf337(_0x5a8442);})[_0xe4f7('0x2a')](function(_0x362fa4){_0x25e005(_0x362fa4);});});}exports[_0xe4f7('0x2b')]=function(_0x19dc32,_0x56b405){var _0x2991a0={},_0x2b9daa={},_0x289a1d={'count':0x0,'rows':[]};var _0x1600d1=_[_0xe4f7('0x24')](db['OpenchannelInteraction']['rawAttributes'],function(_0x29aa55){return{'name':_0x29aa55[_0xe4f7('0x2c')],'type':_0x29aa55[_0xe4f7('0x2d')]['key']};});_0x2b9daa['model']=_['map'](_0x1600d1,_0xe4f7('0x2e'));_0x2b9daa['query']=_[_0xe4f7('0x2f')](_0x19dc32[_0xe4f7('0x30')]);_0x2b9daa[_0xe4f7('0x31')]=_[_0xe4f7('0x32')](_0x2b9daa['model'],_0x2b9daa[_0xe4f7('0x30')]);_0x2991a0['attributes']=_[_0xe4f7('0x32')](_0x2b9daa[_0xe4f7('0x33')],qs[_0xe4f7('0x34')](_0x19dc32['query'][_0xe4f7('0x34')]));_0x2991a0[_0xe4f7('0x35')]=_0x2991a0['attributes'][_0xe4f7('0x36')]?_0x2991a0[_0xe4f7('0x35')]:_0x2b9daa['model'];if(!_0x19dc32['query']['hasOwnProperty'](_0xe4f7('0x37'))){_0x2991a0[_0xe4f7('0x1d')]=qs[_0xe4f7('0x1d')](_0x19dc32['query'][_0xe4f7('0x1d')]);_0x2991a0['offset']=qs['offset'](_0x19dc32[_0xe4f7('0x30')][_0xe4f7('0x1c')]);}_0x2991a0[_0xe4f7('0x38')]=qs[_0xe4f7('0x39')](_0x19dc32['query'][_0xe4f7('0x39')]);_0x2991a0[_0xe4f7('0x3a')]=qs['filters'](_[_0xe4f7('0x3b')](_0x19dc32[_0xe4f7('0x30')],_0x2b9daa['filters']));var _0x555a1e=[];var _0x53ccf2=squel[_0xe4f7('0x3c')]()[_0xe4f7('0x3d')]('id')[_0xe4f7('0x3d')](_0xe4f7('0x2e'))[_0xe4f7('0x3d')]('color')[_0xe4f7('0x3e')](_0xe4f7('0x3f'));var _0x52713a=squel[_0xe4f7('0x3c')]()[_0xe4f7('0x3d')](_0xe4f7('0x40'))['field'](_0xe4f7('0x41'))[_0xe4f7('0x3d')](_0xe4f7('0x42'))['from']('user_has_openchannel_interactions','ui')[_0xe4f7('0x43')]('users','u',_0xe4f7('0x44'));var _0x1248d8=squel[_0xe4f7('0x3c')]()['from']('openchannel_interactions','i')[_0xe4f7('0x43')]('cm_contacts','c',_0xe4f7('0x45'))[_0xe4f7('0x43')](_0xe4f7('0x46'),'o',_0xe4f7('0x47'))[_0xe4f7('0x43')]('openchannel_accounts','a','a.id\x20=\x20i.OpenchannelAccountId')[_0xe4f7('0x43')](_0xe4f7('0x48'),'me',_0xe4f7('0x49'))['left_join'](_0xe4f7('0x4a'),'it',_0xe4f7('0x4b'))['left_join'](_0xe4f7('0x3f'),'t','t.id\x20=\x20it.TagId');var _0x1e8980=squel[_0xe4f7('0x4c')]();var _0x26be1f=[];var _0x3b5e34=squel['expr']();var _0x5ca0e4;if(_0x19dc32[_0xe4f7('0x30')][_0xe4f7('0x4d')]){_0x5ca0e4=as[_0xe4f7('0x4e')](_0x19dc32[_0xe4f7('0x30')][_0xe4f7('0x4d')]);var _0x13364b=_0x5ca0e4[_0xe4f7('0x4f')];for(var _0x56c720=0x0;_0x56c720<_0x5ca0e4[_0xe4f7('0x50')]['length'];_0x56c720++){var _0x23068e=_0x5ca0e4[_0xe4f7('0x50')][_0x56c720];var _0xb5160='i';var _0x4da3ae=_[_0xe4f7('0x51')](_0x1600d1,[_0xe4f7('0x2e'),_0x23068e[_0xe4f7('0x3d')]]);if(!_0x4da3ae){switch(_0x23068e[_0xe4f7('0x3d')]){case _0xe4f7('0x52'):if(_0x23068e[_0xe4f7('0x53')]==0x1){_0x1248d8[_0xe4f7('0x54')]('`'+_0x23068e[_0xe4f7('0x3d')]+_0xe4f7('0x55'));}else{_0x1248d8[_0xe4f7('0x54')]('`'+_0x23068e['field']+'`\x20>\x200');}break;case _0xe4f7('0x56'):if(_0x23068e['operator']===_0xe4f7('0x57')){if(_0x23068e[_0xe4f7('0x53')]['split']('\x20')[_0xe4f7('0x36')]>0x1){_0x1e8980[_0x13364b](_0xe4f7('0x58'),qs[_0xe4f7('0x59')](_0x23068e[_0xe4f7('0x53')]),null);}else{var _0x401f86='%'+_0x23068e[_0xe4f7('0x53')]+'%';_0x1e8980[_0x13364b](_0xe4f7('0x5a'),_0x401f86,_0x401f86,_0x401f86);}}else{_0x4da3ae=_[_0xe4f7('0x51')](_0x1600d1,[_0xe4f7('0x2e'),_0xe4f7('0x5b')]);_0x23068e[_0xe4f7('0x3d')]=_0xe4f7('0x5b');_0x5c4d15=as[_0xe4f7('0x5c')](_0xb5160,_0x4da3ae['type'],_0x23068e);_0x1e8980[_0x13364b](_0x5c4d15[_0xe4f7('0x5d')],_0x5c4d15[_0xe4f7('0x53')][_0xe4f7('0x5e')],_0x5c4d15['value']['end']);}break;case _0xe4f7('0x5f'):var _0x102c98=_0x23068e[_0xe4f7('0x53')]['split'](',')[_0xe4f7('0x24')](function(_0x77b952){return Number(_0x77b952);});_0x102c98[_0xe4f7('0x28')](function(_0x21a39f){_0x3b5e34['or'](_0xe4f7('0x60'),'%,'+_0x21a39f+',%');});_0x26be1f=_[_0xe4f7('0x61')](_0x26be1f,_0x102c98);break;case _0xe4f7('0x62'):if(_0x23068e['operator']===_0xe4f7('0x57')){_0x1e8980[_0x13364b]('CONCAT_WS(\x27\x20\x27,\x20o.name,\x20o.fullname)\x20LIKE\x20?','%'+_0x23068e[_0xe4f7('0x53')]+'%',null);}else{_0x4da3ae=_[_0xe4f7('0x51')](_0x1600d1,[_0xe4f7('0x2e'),_0xe4f7('0x63')]);_0x23068e[_0xe4f7('0x3d')]=_0xe4f7('0x63');_0x5c4d15=as[_0xe4f7('0x5c')](_0xb5160,_0x4da3ae[_0xe4f7('0x2d')],_0x23068e);_0x1e8980[_0x13364b](_0x5c4d15[_0xe4f7('0x5d')],_0x5c4d15['value'][_0xe4f7('0x5e')],_0x5c4d15[_0xe4f7('0x53')]['end']);}break;case _0xe4f7('0x64'):_0x5c4d15=as['buildExpression']('me',null,_0x23068e);_0x1e8980[_0x13364b](_0x5c4d15[_0xe4f7('0x5d')],_0x5c4d15[_0xe4f7('0x53')][_0xe4f7('0x5e')],_0x5c4d15[_0xe4f7('0x53')][_0xe4f7('0x19')]);break;}}else{var _0x5c4d15=as['buildExpression'](_0xb5160,_0x4da3ae[_0xe4f7('0x2d')],_0x23068e);_0x1e8980[_0x13364b](_0x5c4d15[_0xe4f7('0x5d')],_0x5c4d15[_0xe4f7('0x53')]['start'],_0x5c4d15[_0xe4f7('0x53')][_0xe4f7('0x19')]);}}}else{var _0xdb4543=_(_0x19dc32[_0xe4f7('0x30')])[_0xe4f7('0x2f')]()[_0xe4f7('0x24')](function(_0xac7808){return _[_0xe4f7('0x65')](_0x1600d1,['name',_0xac7808])?_0xac7808:undefined;})[_0xe4f7('0x66')]()['value']();if(!_[_0xe4f7('0x67')](_0xdb4543)){_0xdb4543[_0xe4f7('0x28')](function(_0x4a7978){if(_0x4a7978===_0xe4f7('0x68')){_0x1248d8[_0xe4f7('0x3a')](_0xe4f7('0x69'),[][_0xe4f7('0x6a')](_0x19dc32[_0xe4f7('0x30')][_0x4a7978]));}else if(_0x4a7978===_0xe4f7('0x6b')){var _0x3efca5=JSON[_0xe4f7('0x6c')](_0x19dc32[_0xe4f7('0x30')][_0x4a7978])[_0xe4f7('0x6d')];var _0x55d05d=JSON[_0xe4f7('0x6c')](_0x19dc32[_0xe4f7('0x30')][_0x4a7978])[_0xe4f7('0x6e')];_0x1248d8[_0xe4f7('0x3a')](_0xe4f7('0x6f'),_0x3efca5,_0x55d05d);}else{if(_0x19dc32[_0xe4f7('0x30')][_0x4a7978]===_0xe4f7('0x70')){_0x1248d8[_0xe4f7('0x3a')]('i.'+_0x4a7978+_0xe4f7('0x71'));}else{_0x1248d8[_0xe4f7('0x3a')]('i.'+_0x4a7978+'\x20=\x20?',_0x19dc32[_0xe4f7('0x30')][_0x4a7978]);}}});}if(_0x19dc32['query'][_0xe4f7('0x72')]){if(_0x19dc32['query'][_0xe4f7('0x72')]==0x1){_0x1248d8[_0xe4f7('0x54')](_0xe4f7('0x73'));}else{_0x1248d8[_0xe4f7('0x54')](_0xe4f7('0x74'));}}if(_0x19dc32[_0xe4f7('0x30')][_0xe4f7('0x75')]){_0x26be1f=_[_0xe4f7('0x76')](_0x19dc32[_0xe4f7('0x30')]['tag'])?_0x19dc32[_0xe4f7('0x30')][_0xe4f7('0x75')]:new Array(_0x19dc32[_0xe4f7('0x30')][_0xe4f7('0x75')]);_0x26be1f[_0xe4f7('0x28')](function(_0x976cec){_0x3b5e34['or'](_0xe4f7('0x60'),'%,'+_0x976cec+',%');});}if(_0x19dc32[_0xe4f7('0x30')]['filter']){var _0x22bcb9=_0x19dc32[_0xe4f7('0x30')][_0xe4f7('0x77')][_0xe4f7('0x78')]('\x5c','\x5c\x5c')['replace']('\x27\x27',_0xe4f7('0x79'));if(qs[_0xe4f7('0x7a')](_0x22bcb9)){_0x1e8980['or'](_0xe4f7('0x7b'),_0x22bcb9+'%');}else{_0x1e8980['or'](_0xe4f7('0x7c'),qs[_0xe4f7('0x59')](_0x22bcb9))['or']('i.from\x20LIKE\x20?',_0x22bcb9+'%')['or']('CONCAT(c.firstName,\x20\x27\x20\x27,\x20c.lastName)\x20LIKE\x20?',_0x22bcb9+'%');}}}_0x1248d8['where'](_0x1e8980);_0x1248d8[_0xe4f7('0x7d')](_0xe4f7('0x7e'));var _0x48cba9={'type':db[_0xe4f7('0x7f')][_0xe4f7('0x80')][_0xe4f7('0x81')],'raw':!![]};var _0x537e30=_0x1248d8[_0xe4f7('0x82')]();_0x537e30[_0xe4f7('0x3d')](_0xe4f7('0x7e'));_0x537e30[_0xe4f7('0x3d')]('SUM(me.read\x20=\x200\x20AND\x20me.direction\x20=\x20\x27in\x27)',_0xe4f7('0x52'));if(_0x2991a0['order']){_0x2991a0[_0xe4f7('0x38')]['forEach'](function(_0x4a44da){_0x1248d8[_0xe4f7('0x38')]('i.'+_0x4a44da[0x0],_0x4a44da[0x1]===_0xe4f7('0x83')?![]:!![]);});}if(!_[_0xe4f7('0x67')](_0x26be1f)){_0x1248d8[_0xe4f7('0x54')](_0x3b5e34);_0x537e30[_0xe4f7('0x3a')](_0xe4f7('0x84'),_0x26be1f);}BPromise[_0xe4f7('0x85')]()[_0xe4f7('0x22')](function(){if(!_0x5ca0e4){if(_0x19dc32[_0xe4f7('0x30')][_0xe4f7('0x68')]||_0x19dc32[_0xe4f7('0x30')]['journey'])return;_0x537e30['where']('i.OpenchannelAccountId\x20IS\x20NOT\x20NULL');_0x1248d8[_0xe4f7('0x3a')](_0xe4f7('0x86'));return;}return _0x19dc32[_0xe4f7('0x87')]['getOpenchannelAccounts']({'attributes':['id'],'raw':!![]})[_0xe4f7('0x22')](function(_0x38a036){if(_[_0xe4f7('0x67')](_0x38a036)){_0x537e30[_0xe4f7('0x3a')]('i.OpenchannelAccountId\x20IS\x20NULL');_0x1248d8[_0xe4f7('0x3a')](_0xe4f7('0x88'));}else{_0x537e30[_0xe4f7('0x3a')](_0xe4f7('0x69'),_[_0xe4f7('0x24')](_0x38a036,'id'));_0x1248d8[_0xe4f7('0x3a')](_0xe4f7('0x69'),_[_0xe4f7('0x24')](_0x38a036,'id'));}});})[_0xe4f7('0x22')](function(){db[_0xe4f7('0x89')][_0xe4f7('0x30')](_0x537e30[_0xe4f7('0x8a')](),_0x48cba9)[_0xe4f7('0x22')](function(_0x4ba558){_0x289a1d['count']=_0x4ba558[_0xe4f7('0x36')];if(_0x289a1d[_0xe4f7('0x8b')]===0x0)return[];return db['sequelize']['query'](_0x53ccf2[_0xe4f7('0x8a')](),_0x48cba9)['then'](function(_0x518486){_0x555a1e=_['keyBy'](_0x518486,'id');_0x48cba9=_[_0xe4f7('0x8c')](_0x48cba9,{'model':db[_0xe4f7('0x8d')],'mapToModel':!![],'raw':!![],'nest':!![]});if(_0x19dc32[_0xe4f7('0x30')][_0xe4f7('0x34')]){_0x2991a0['attributes'][_0xe4f7('0x28')](function(_0x2a600e){_0x1248d8[_0xe4f7('0x3d')]('i.'+_0x2a600e);});}else{_0x1248d8[_0xe4f7('0x3d')]('SUM(me.read\x20=\x200\x20AND\x20me.direction\x20=\x20\x27in\x27)',_0xe4f7('0x52'));_0x1248d8[_0xe4f7('0x3d')](_0xe4f7('0x8e'),_0xe4f7('0x8f'));_0x1248d8[_0xe4f7('0x3d')](_0xe4f7('0x90'),_0xe4f7('0x91'));_0x1248d8['field']('i.*');_0x1248d8['field']('c.firstName',_0xe4f7('0x92'));_0x1248d8[_0xe4f7('0x3d')]('c.lastName',_0xe4f7('0x93'));_0x1248d8[_0xe4f7('0x3d')]('c.email',_0xe4f7('0x94'));_0x1248d8['field'](_0xe4f7('0x95'),_0xe4f7('0x96'));_0x1248d8[_0xe4f7('0x3d')](_0xe4f7('0x97'),_0xe4f7('0x98'));_0x1248d8['field'](_0xe4f7('0x99'),'Contact.fax');_0x1248d8[_0xe4f7('0x3d')](_0xe4f7('0x9a'),_0xe4f7('0x9b'));_0x1248d8[_0xe4f7('0x3d')]('o.internal',_0xe4f7('0x9c'));_0x1248d8['field'](_0xe4f7('0x9d'),_0xe4f7('0x26'));}_0x1248d8['limit'](_0x2991a0[_0xe4f7('0x1d')]);_0x1248d8['offset'](_0x2991a0['offset']);return db['sequelize'][_0xe4f7('0x30')](_0x1248d8[_0xe4f7('0x8a')](),_0x48cba9);})[_0xe4f7('0x22')](function(_0x4ffc68){_0x52713a['where'](_0xe4f7('0x9e'),_[_0xe4f7('0x24')](_0x4ffc68,'id'));return db[_0xe4f7('0x89')]['query'](_0x52713a['toString'](),_0x48cba9)[_0xe4f7('0x22')](function(_0x37419f){var _0x390c9a=_[_0xe4f7('0x9f')](_0x37419f,'OpenchannelInteractionId');var _0x3642ca=[];_0x4ffc68['forEach'](function(_0x40b087){_0x3642ca['push'](updateOpenchannelInteraction(_0x40b087,_0x555a1e,_0x390c9a));});return BPromise['all'](_0x3642ca);});});})['then'](function(_0x3507a0){_0x289a1d[_0xe4f7('0xa0')]=_0x3507a0;return _0x289a1d;})['then'](respondWithFilteredResult(_0x56b405,_0x2991a0));})[_0xe4f7('0x2a')](handleError(_0x56b405,null));};exports[_0xe4f7('0xa1')]=function(_0x3c48e7,_0x328e18){var _0x43ca7a={'raw':![],'where':{'id':_0x3c48e7['params']['id']}},_0x4c9987={};_0x4c9987[_0xe4f7('0x33')]=_[_0xe4f7('0x2f')](db[_0xe4f7('0x8d')][_0xe4f7('0xa2')]);_0x4c9987['query']=_[_0xe4f7('0x2f')](_0x3c48e7[_0xe4f7('0x30')]);_0x4c9987[_0xe4f7('0x31')]=_['intersection'](_0x4c9987[_0xe4f7('0x33')],_0x4c9987[_0xe4f7('0x30')]);_0x43ca7a[_0xe4f7('0x35')]=_[_0xe4f7('0x32')](_0x4c9987['model'],qs['fields'](_0x3c48e7[_0xe4f7('0x30')]['fields']));_0x43ca7a[_0xe4f7('0x35')]=_0x43ca7a['attributes'][_0xe4f7('0x36')]?_0x43ca7a[_0xe4f7('0x35')]:_0x4c9987['model'];if(_0x3c48e7[_0xe4f7('0x30')]['includeAll']){_0x43ca7a['include']=[{'all':!![]}];}_0x43ca7a=_['merge']({},_0x43ca7a,_0x3c48e7[_0xe4f7('0xa3')]);return db['OpenchannelInteraction'][_0xe4f7('0x51')](_0x43ca7a)['then'](handleEntityNotFound(_0x328e18,null))[_0xe4f7('0x22')](respondWithResult(_0x328e18,null))[_0xe4f7('0x2a')](handleError(_0x328e18,null));};exports[_0xe4f7('0xa4')]=function(_0x198be7,_0x4b058d){return db[_0xe4f7('0x8d')]['create'](_0x198be7[_0xe4f7('0x64')],{})[_0xe4f7('0x22')](respondWithResult(_0x4b058d,0xc9))[_0xe4f7('0x2a')](handleError(_0x4b058d,null));};exports[_0xe4f7('0x21')]=function(_0x187b57,_0x8f7832){if(_0x187b57[_0xe4f7('0x64')]['id']){delete _0x187b57[_0xe4f7('0x64')]['id'];}return db[_0xe4f7('0x8d')][_0xe4f7('0x51')]({'where':{'id':_0x187b57[_0xe4f7('0xa5')]['id']}})['then'](handleEntityNotFound(_0x8f7832,null))[_0xe4f7('0x22')](saveUpdates(_0x187b57[_0xe4f7('0x64')],null))[_0xe4f7('0x22')](respondWithResult(_0x8f7832,null))[_0xe4f7('0x2a')](handleError(_0x8f7832,null));};exports[_0xe4f7('0xa6')]=function(_0x4d1adf,_0x442f89){return db[_0xe4f7('0x8d')][_0xe4f7('0x51')]({'where':{'id':_0x4d1adf[_0xe4f7('0xa5')]['id']}})[_0xe4f7('0x22')](handleEntityNotFound(_0x442f89,null))[_0xe4f7('0x22')](removeEntity(_0x442f89,null))[_0xe4f7('0x2a')](handleError(_0x442f89,null));};exports[_0xe4f7('0xa7')]=function(_0xee2342,_0x2025ca){return db[_0xe4f7('0x8d')]['describe']()[_0xe4f7('0x22')](respondWithResult(_0x2025ca,null))['catch'](handleError(_0x2025ca,null));};exports[_0xe4f7('0xa8')]=function(_0x4274ea,_0x1d01f9,_0x5d7831){return db[_0xe4f7('0xa9')][_0xe4f7('0x51')]({'where':{'id':_0x4274ea['params']['id']}})['then'](handleEntityNotFound(_0x1d01f9,null))[_0xe4f7('0x22')](function(_0x5c4edd){if(_0x5c4edd){return _0x5c4edd[_0xe4f7('0xa8')](_0x4274ea[_0xe4f7('0x64')][_0xe4f7('0xaa')],_[_0xe4f7('0xab')](_0x4274ea['body'],[_0xe4f7('0xaa'),'id'])||{});}})[_0xe4f7('0x22')](respondWithResult(_0x1d01f9,null))[_0xe4f7('0x2a')](handleError(_0x1d01f9,null));};exports[_0xe4f7('0xac')]=function(_0x6175f1,_0x1097cb,_0x6ff611){var _0x1d1456={'raw':![],'where':{}};var _0x643578={};var _0x3a754f={'count':0x0,'rows':[]};return db[_0xe4f7('0x8d')]['findOne']({'where':{'id':_0x6175f1[_0xe4f7('0xa5')]['id']}})[_0xe4f7('0x22')](handleEntityNotFound(_0x1097cb,null))[_0xe4f7('0x22')](function(_0x3430a5){if(_0x3430a5){_0x643578[_0xe4f7('0x33')]=_[_0xe4f7('0x2f')](db['OpenchannelMessage'][_0xe4f7('0xa2')]);_0x643578[_0xe4f7('0x30')]=_[_0xe4f7('0x2f')](_0x6175f1[_0xe4f7('0x30')]);_0x643578[_0xe4f7('0x31')]=_[_0xe4f7('0x32')](_0x643578['model'],_0x643578['query']);_0x1d1456[_0xe4f7('0x35')]=_[_0xe4f7('0x32')](_0x643578['model'],qs[_0xe4f7('0x34')](_0x6175f1[_0xe4f7('0x30')][_0xe4f7('0x34')]));_0x1d1456['attributes']=_0x1d1456[_0xe4f7('0x35')][_0xe4f7('0x36')]?_0x1d1456['attributes']:_0x643578[_0xe4f7('0x33')];if(!_0x6175f1['query'][_0xe4f7('0xad')](_0xe4f7('0x37'))){_0x1d1456[_0xe4f7('0x1d')]=qs[_0xe4f7('0x1d')](_0x6175f1[_0xe4f7('0x30')][_0xe4f7('0x1d')]);_0x1d1456[_0xe4f7('0x1c')]=qs[_0xe4f7('0x1c')](_0x6175f1[_0xe4f7('0x30')]['offset']);}_0x1d1456[_0xe4f7('0x38')]=qs[_0xe4f7('0x39')](_0x6175f1['query'][_0xe4f7('0x39')]);_0x1d1456[_0xe4f7('0x3a')]=qs[_0xe4f7('0x31')](_[_0xe4f7('0x3b')](_0x6175f1['query'],_0x643578['filters']));_0x1d1456[_0xe4f7('0x3a')]['OpenchannelInteractionId']=_0x3430a5['id'];if(_0x6175f1[_0xe4f7('0x30')]['filter']){_0x1d1456[_0xe4f7('0x3a')]=_[_0xe4f7('0x8c')](_0x1d1456[_0xe4f7('0x3a')],{'$or':_[_0xe4f7('0x24')](_0x1d1456[_0xe4f7('0x35')],function(_0x375f48){var _0x3b6b43={};_0x3b6b43[_0x375f48]={'$like':'%'+_0x6175f1[_0xe4f7('0x30')][_0xe4f7('0x77')]+'%'};return _0x3b6b43;})});}if(_0x6175f1[_0xe4f7('0x30')][_0xe4f7('0x6d')]){var _0x5d9d3e=_0x6175f1[_0xe4f7('0x30')][_0xe4f7('0x6d')][_0xe4f7('0x27')](',');var _0x15c1f2={};_0x15c1f2[_0x5d9d3e[0x0]]={'$gte':moment(_0x5d9d3e[0x1])['format'](_0xe4f7('0xae'))};_0x1d1456['where']=_[_0xe4f7('0x8c')](_0x1d1456[_0xe4f7('0x3a')],_0x15c1f2);}_0x1d1456=_[_0xe4f7('0x8c')]({},_0x1d1456,_0x6175f1[_0xe4f7('0xa3')]);return db['OpenchannelMessage'][_0xe4f7('0x8b')]({'where':_0x1d1456[_0xe4f7('0x3a')]})['then'](function(_0x13fe6b){_0x3a754f[_0xe4f7('0x8b')]=_0x13fe6b;if(_0x6175f1[_0xe4f7('0x30')][_0xe4f7('0xaf')]){_0x1d1456['include']=[{'all':!![]}];}return db[_0xe4f7('0xa9')]['findAll'](_0x1d1456);})['then'](function(_0x24086d){_0x3a754f[_0xe4f7('0xa0')]=_0x24086d;return _0x3a754f;});}})[_0xe4f7('0x22')](respondWithFilteredResult(_0x1097cb,_0x1d1456))[_0xe4f7('0x2a')](handleError(_0x1097cb,null));};exports[_0xe4f7('0xb0')]=function(_0x114e1d,_0x24bd33,_0x427469){return db[_0xe4f7('0x8d')][_0xe4f7('0x51')]({'where':{'id':_0x114e1d[_0xe4f7('0xa5')]['id']}})['then'](handleEntityNotFound(_0x24bd33,null))[_0xe4f7('0x22')](function(_0x65cd85){if(_0x65cd85){return _0x65cd85[_0xe4f7('0xb1')](_0x114e1d[_0xe4f7('0x64')][_0xe4f7('0xaa')],_[_0xe4f7('0xab')](_0x114e1d[_0xe4f7('0x64')],[_0xe4f7('0xaa'),'id'])||{})[_0xe4f7('0xb2')](function(){return db[_0xe4f7('0x5f')][_0xe4f7('0xb3')]({'attributes':['id',_0xe4f7('0x2e'),_0xe4f7('0xb4')],'where':{'id':_0x114e1d['body'][_0xe4f7('0xaa')]}});})['then'](function(_0x4e9d0c){socket[_0xe4f7('0xb5')]('openchannelInteractionTags:save',{'id':Number(_0x114e1d[_0xe4f7('0xa5')]['id']),'tags':_0x4e9d0c||[]});return{'id':Number(_0x114e1d[_0xe4f7('0xa5')]['id']),'tags':_0x4e9d0c||[]};});}})[_0xe4f7('0x22')](respondWithResult(_0x24bd33,null))[_0xe4f7('0x2a')](handleError(_0x24bd33,null));};exports[_0xe4f7('0xb6')]=function(_0x493416,_0x1bba90,_0xc8e419){return db[_0xe4f7('0x8d')]['find']({'where':{'id':_0x493416[_0xe4f7('0xa5')]['id']}})[_0xe4f7('0x22')](handleEntityNotFound(_0x1bba90,null))[_0xe4f7('0x22')](function(_0x140ccb){if(_0x140ccb){return _0x140ccb[_0xe4f7('0xb6')](_0x493416[_0xe4f7('0x30')][_0xe4f7('0xaa')]);}})[_0xe4f7('0x22')](respondWithStatusCode(_0x1bba90,null))[_0xe4f7('0x2a')](handleError(_0x1bba90,null));};exports[_0xe4f7('0xb7')]=function(_0x1169c2,_0x4edc06){var _0x60cc26=moment()['unix']()[_0xe4f7('0x8a')]();var _0x54ce03=path[_0xe4f7('0xb8')](config[_0xe4f7('0xb9')],_0xe4f7('0xba'),_0xe4f7('0xbb'),_0xe4f7('0xbc'));var _0x2145fb=path[_0xe4f7('0xb8')](config[_0xe4f7('0xb9')],_0xe4f7('0xba'),'files',_0xe4f7('0xbd'));var _0x182aa3=path[_0xe4f7('0xb8')](_0x54ce03,_0x60cc26);var _0x3243b3=util['format'](_0xe4f7('0xbe'),_0x1169c2[_0xe4f7('0xa5')]['id'],_0x60cc26);var _0x3ef19b=path[_0xe4f7('0xb8')](_0x54ce03,_0x3243b3);var _0x3371e8=[];_0x3371e8['push']({'model':db['User'],'as':'User','attributes':['id',_0xe4f7('0x25')],'raw':!![]});_0x3371e8[_0xe4f7('0xbf')]({'model':db['CmContact'],'as':'Contact','attributes':['id',_0xe4f7('0xc0'),_0xe4f7('0xc1')],'raw':!![]});if(_0x1169c2[_0xe4f7('0x30')][_0xe4f7('0xbd')]){_0x3371e8[_0xe4f7('0xbf')]({'model':db[_0xe4f7('0xc2')],'as':_0xe4f7('0xc2'),'raw':!![]});}var _0x8a9be9=[{'model':db[_0xe4f7('0xa9')],'as':_0xe4f7('0xc3'),'attributes':['id',_0xe4f7('0x64'),_0xe4f7('0x6b'),'direction',_0xe4f7('0xc4'),_0xe4f7('0x72')],'include':_0x3371e8}];_0x8a9be9['push']({'model':db[_0xe4f7('0xc5')],'as':'Account','attributes':['id',_0xe4f7('0x2e')]});_0x8a9be9[_0xe4f7('0xbf')]({'model':db['User'],'as':_0xe4f7('0xc6'),'attributes':['id','fullname']});return db['OpenchannelInteraction']['find']({'where':{'id':_0x1169c2[_0xe4f7('0xa5')]['id']},'include':_0x8a9be9})['then'](handleEntityNotFound(_0x4edc06,null))[_0xe4f7('0x22')](function(_0x477e49){if(_0x477e49){var _0x467440=_0x477e49[_0xe4f7('0xc7')]({'plain':!![]});fs['mkdirSync'](_0x182aa3);var _0x29ecdf={'format':'A4','border':'10px','header':{'height':_0xe4f7('0xc8'),'contents':{'first':_0xe4f7('0xc9')}},'footer':{'height':_0xe4f7('0xca'),'contents':{'default':util[_0xe4f7('0xcb')](' \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[_0xe4f7('0xcb')](_0xe4f7('0xcc'),_0xe4f7('0xcd'),_0x467440['id']),moment()[_0xe4f7('0xcb')]('YYYY-MM-DD')[_0xe4f7('0x8a')]())}}};var _0x4f9036={'channel':'Openchannel','account':_0x467440[_0xe4f7('0xce')][_0xe4f7('0x2e')],'agent':_0x467440['Owner']?_0x467440[_0xe4f7('0xc6')]['fullname']:_0xe4f7('0xcf'),'createdAt':moment(_0x467440[_0xe4f7('0x6b')])[_0xe4f7('0xcb')](_0xe4f7('0xae'))[_0xe4f7('0x8a')](),'closedAt':_0x467440[_0xe4f7('0xd0')]?moment(_0x467440['closedAt'])[_0xe4f7('0xcb')](_0xe4f7('0xae'))[_0xe4f7('0x8a')]():'','disposition':_0x467440['disposition'],'visibility':_0x467440['threadId']?_0xe4f7('0xd1'):_0xe4f7('0xd2'),'messages':_(_0x467440[_0xe4f7('0xc3')])[_0xe4f7('0x77')]({'secret':![]})[_0xe4f7('0x24')](function(_0x28a697){if(_0x28a697['Attachment']){var _0x1bb2a1=path[_0xe4f7('0xb8')](_0x2145fb,_0x28a697[_0xe4f7('0xc2')][_0xe4f7('0xd3')]);if(fs[_0xe4f7('0xd4')](_0x1bb2a1)){fs[_0xe4f7('0xd5')](_0x1bb2a1)[_0xe4f7('0xd6')](fs[_0xe4f7('0xd7')](path[_0xe4f7('0xb8')](_0x182aa3,_0x28a697[_0xe4f7('0xc2')]['basename'])));}}return{'date':moment(_0x28a697[_0xe4f7('0x6b')])[_0xe4f7('0xcb')](_0xe4f7('0xae'))[_0xe4f7('0x8a')](),'sender':_0x28a697['direction']===_0xe4f7('0xd8')?_0x28a697[_0xe4f7('0x62')]?_0x28a697[_0xe4f7('0x62')][_0xe4f7('0x25')]:'System':_0x28a697[_0xe4f7('0x56')]['firstName']+(_0x28a697[_0xe4f7('0x56')][_0xe4f7('0xc1')]?'\x20'+_0x28a697['Contact'][_0xe4f7('0xc1')]:''),'body':_0x28a697[_0xe4f7('0xc2')]?_0x28a697[_0xe4f7('0xc2')]['basename']:_0x28a697[_0xe4f7('0x64')],'direction':_0x28a697[_0xe4f7('0xd9')]===_0xe4f7('0xd8')?'A':'C','secret':_0x28a697[_0xe4f7('0xc4')],'read':_0x28a697[_0xe4f7('0x72')],'attachment':_0x28a697['Attachment']};})[_0xe4f7('0x53')]()};return ejs[_0xe4f7('0xda')](path[_0xe4f7('0xb8')](config[_0xe4f7('0xb9')],_0xe4f7('0xba'),_0xe4f7('0xdb'),'downloadInteraction.html'),{'interaction':_0x4f9036})[_0xe4f7('0x22')](function(_0x573a86){return new BPromise(function(_0x4db858,_0x168e4e){pdf['create'](_0x573a86,_0x29ecdf)[_0xe4f7('0xdc')](path[_0xe4f7('0xb8')](_0x182aa3,'transcript-'+_0x467440['id']+'-'+_0x60cc26+_0xe4f7('0xdd')),function(_0xf0a872,_0x34dfa5){if(_0xf0a872)return _0x168e4e(_0xf0a872);_0x4db858(_0x34dfa5);});});})[_0xe4f7('0x22')](function(){return new BPromise(function(_0x57806d,_0x303016){zipdir(_0x182aa3,{'saveTo':_0x3ef19b},function(_0x3f03b2,_0x44c2e6){if(_0x3f03b2)return _0x303016(_0x3f03b2);return _0x57806d(_0x44c2e6);});})['then'](function(){return new BPromise(function(_0x4d4f50,_0x761bee){rimraf(_0x182aa3,function(_0x335541){if(_0x335541)_0x761bee(_0x335541);return _0x4d4f50();});});})[_0xe4f7('0x22')](function(){return _0x4edc06[_0xe4f7('0xb7')](_0x3ef19b,_0x3243b3,function(_0x3ac1f1){if(_0x3ac1f1){console[_0xe4f7('0xde')]('err',_0x3ac1f1);}else{fs['unlinkSync'](_0x3ef19b);}});});});}else{return _0x4edc06[_0xe4f7('0xdf')](0xc8);}})[_0xe4f7('0x2a')](handleError(_0x4edc06,null));};
\ No newline at end of file
diff --git a/server/api/openchannelInteraction/openchannelInteraction.events.js b/server/api/openchannelInteraction/openchannelInteraction.events.js
index 1c73f54..f026d83 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 _0x8eb5=['remove','getUsers','then','Users','map','findAll','setDataValue','unreadMessages','length','emit','catch','hasOwnProperty','hook','exports','../../mysqldb','OpenchannelInteraction','setMaxListeners','save'];(function(_0x355235,_0x58565a){var _0x4cf1b2=function(_0x339e73){while(--_0x339e73){_0x355235['push'](_0x355235['shift']());}};_0x4cf1b2(++_0x58565a);}(_0x8eb5,0x188));var _0x58eb=function(_0xc678d2,_0x24676e){_0xc678d2=_0xc678d2-0x0;var _0x26f63a=_0x8eb5[_0xc678d2];return _0x26f63a;};'use strict';var EventEmitter=require('events');var OpenchannelInteraction=require(_0x58eb('0x0'))['db'][_0x58eb('0x1')];var OpenchannelMessage=require(_0x58eb('0x0'))['db']['OpenchannelMessage'];var OpenchannelInteractionEvents=new EventEmitter();OpenchannelInteractionEvents[_0x58eb('0x2')](0x0);var events={'afterCreate':_0x58eb('0x3'),'afterUpdate':'update','afterDestroy':_0x58eb('0x4')};function emitEvent(_0x45b98c){return function(_0x15849f,_0x5f2651,_0x13be82){_0x15849f[_0x58eb('0x5')]({'attributes':['id'],'raw':!![]})[_0x58eb('0x6')](function(_0x2045bf){_0x15849f['setDataValue'](_0x58eb('0x7'),_0x2045bf[_0x58eb('0x8')](function(_0x44ff3b){return{'id':_0x44ff3b['id']};}));return OpenchannelMessage[_0x58eb('0x9')]({'where':{'OpenchannelInteractionId':_0x15849f['id'],'direction':'in','read':![]},'raw':!![]});})['then'](function(_0x22765e){_0x15849f[_0x58eb('0xa')](_0x58eb('0xb'),_0x22765e[_0x58eb('0xc')]);OpenchannelInteractionEvents[_0x58eb('0xd')](_0x45b98c+':'+_0x15849f['id'],_0x15849f);OpenchannelInteractionEvents[_0x58eb('0xd')](_0x45b98c,_0x15849f);_0x13be82(null);})[_0x58eb('0xe')](_0x13be82(null));};}for(var e in events){if(events[_0x58eb('0xf')](e)){var event=events[e];OpenchannelInteraction[_0x58eb('0x10')](e,emitEvent(event));}}module[_0x58eb('0x11')]=OpenchannelInteractionEvents;
\ No newline at end of file
+var _0x55c6=['save','update','remove','getUsers','Users','map','findAll','then','unreadMessages','length','emit','catch','hook','exports','events','../../mysqldb','OpenchannelInteraction','OpenchannelMessage'];(function(_0x186fee,_0x1ab572){var _0xf8c406=function(_0xb72c2f){while(--_0xb72c2f){_0x186fee['push'](_0x186fee['shift']());}};_0xf8c406(++_0x1ab572);}(_0x55c6,0xc2));var _0x655c=function(_0x560bad,_0x1031c4){_0x560bad=_0x560bad-0x0;var _0x358617=_0x55c6[_0x560bad];return _0x358617;};'use strict';var EventEmitter=require(_0x655c('0x0'));var OpenchannelInteraction=require(_0x655c('0x1'))['db'][_0x655c('0x2')];var OpenchannelMessage=require(_0x655c('0x1'))['db'][_0x655c('0x3')];var OpenchannelInteractionEvents=new EventEmitter();OpenchannelInteractionEvents['setMaxListeners'](0x0);var events={'afterCreate':_0x655c('0x4'),'afterUpdate':_0x655c('0x5'),'afterDestroy':_0x655c('0x6')};function emitEvent(_0x576cbe){return function(_0x1a81b1,_0x2380b9,_0x179551){_0x1a81b1[_0x655c('0x7')]({'attributes':['id'],'raw':!![]})['then'](function(_0x5e5e35){_0x1a81b1['setDataValue'](_0x655c('0x8'),_0x5e5e35[_0x655c('0x9')](function(_0x441713){return{'id':_0x441713['id']};}));return OpenchannelMessage[_0x655c('0xa')]({'where':{'OpenchannelInteractionId':_0x1a81b1['id'],'direction':'in','read':![]},'raw':!![]});})[_0x655c('0xb')](function(_0x23f4d1){_0x1a81b1['setDataValue'](_0x655c('0xc'),_0x23f4d1[_0x655c('0xd')]);OpenchannelInteractionEvents[_0x655c('0xe')](_0x576cbe+':'+_0x1a81b1['id'],_0x1a81b1);OpenchannelInteractionEvents[_0x655c('0xe')](_0x576cbe,_0x1a81b1);_0x179551(null);})[_0x655c('0xf')](_0x179551(null));};}for(var e in events){if(events['hasOwnProperty'](e)){var event=events[e];OpenchannelInteraction[_0x655c('0x10')](e,emitEvent(event));}}module[_0x655c('0x11')]=OpenchannelInteractionEvents;
\ No newline at end of file
diff --git a/server/api/openchannelInteraction/openchannelInteraction.model.js b/server/api/openchannelInteraction/openchannelInteraction.model.js
index 7bc6e34..913123e 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 _0x8d0e=['bluebird','request-promise','path','rimraf','./openchannelInteraction.attributes','define','OpenchannelInteraction','openchannel_interactions','changed','closedAt','format','YYYY-MM-DD\x20HH:mm:ss','lodash','util','../../config/logger','api','moment'];(function(_0x39caaa,_0x1f37bc){var _0x9b9c7d=function(_0x2da02c){while(--_0x2da02c){_0x39caaa['push'](_0x39caaa['shift']());}};_0x9b9c7d(++_0x1f37bc);}(_0x8d0e,0x1d7));var _0xe8d0=function(_0x3a6231,_0x597972){_0x3a6231=_0x3a6231-0x0;var _0x244cd7=_0x8d0e[_0x3a6231];return _0x244cd7;};'use strict';var _=require(_0xe8d0('0x0'));var util=require(_0xe8d0('0x1'));var logger=require(_0xe8d0('0x2'))(_0xe8d0('0x3'));var moment=require(_0xe8d0('0x4'));var BPromise=require(_0xe8d0('0x5'));var rp=require(_0xe8d0('0x6'));var fs=require('fs');var path=require(_0xe8d0('0x7'));var rimraf=require(_0xe8d0('0x8'));var config=require('../../config/environment');var attributes=require(_0xe8d0('0x9'));module['exports']=function(_0x560dab,_0x2e2985){return _0x560dab[_0xe8d0('0xa')](_0xe8d0('0xb'),attributes,{'tableName':_0xe8d0('0xc'),'paranoid':![],'indexes':[],'timestamps':!![],'hooks':{'beforeUpdate':function(_0x2b6dce,_0x13aa63,_0x1b353a){if(_0x2b6dce[_0xe8d0('0xd')]('closed')){_0x2b6dce[_0xe8d0('0xe')]=moment()[_0xe8d0('0xf')](_0xe8d0('0x10'));}_0x1b353a(null,_0x2b6dce);}}});};
\ No newline at end of file
+var _0x4074=['format','YYYY-MM-DD\x20HH:mm:ss','lodash','util','../../config/logger','moment','bluebird','request-promise','path','rimraf','../../config/environment','./openchannelInteraction.attributes','exports','OpenchannelInteraction'];(function(_0x4fb3c8,_0x7a7ba2){var _0x3ffad7=function(_0x342a0c){while(--_0x342a0c){_0x4fb3c8['push'](_0x4fb3c8['shift']());}};_0x3ffad7(++_0x7a7ba2);}(_0x4074,0xf0));var _0x4407=function(_0x585021,_0x754149){_0x585021=_0x585021-0x0;var _0x54489d=_0x4074[_0x585021];return _0x54489d;};'use strict';var _=require(_0x4407('0x0'));var util=require(_0x4407('0x1'));var logger=require(_0x4407('0x2'))('api');var moment=require(_0x4407('0x3'));var BPromise=require(_0x4407('0x4'));var rp=require(_0x4407('0x5'));var fs=require('fs');var path=require(_0x4407('0x6'));var rimraf=require(_0x4407('0x7'));var config=require(_0x4407('0x8'));var attributes=require(_0x4407('0x9'));module[_0x4407('0xa')]=function(_0x3f085d,_0x35899d){return _0x3f085d['define'](_0x4407('0xb'),attributes,{'tableName':'openchannel_interactions','paranoid':![],'indexes':[],'timestamps':!![],'hooks':{'beforeUpdate':function(_0x414f0a,_0x3c1aee,_0x450cd4){if(_0x414f0a['changed']('closed')){_0x414f0a['closedAt']=moment()[_0x4407('0xc')](_0x4407('0xd'));}_0x450cd4(null,_0x414f0a);}}});};
\ No newline at end of file
diff --git a/server/api/openchannelInteraction/openchannelInteraction.rpc.js b/server/api/openchannelInteraction/openchannelInteraction.rpc.js
index dafd309..2598d57 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 _0x9e79=['lodash','moment','bluebird','randomstring','ioredis','../../config/utils','../../config/logger','../../config/environment','jayson/promise','client','http','redis','socket.io-emitter','request','info','OpenchannelInteraction,\x20%s,\x20%s','request\x20sent','debug','OpenchannelInteraction,\x20%s,\x20%s,\x20%s','stringify','error','code','message','result','update','body','options','attributes','limit','then','UpdateOpenchannelInteraction','catch','AddTagsToOpenchannelInteraction','OpenchannelInteraction','find','where','addTags','ids','omit','spread','AddTags'];(function(_0x399546,_0x5598af){var _0x1687a3=function(_0x3f7fc2){while(--_0x3f7fc2){_0x399546['push'](_0x399546['shift']());}};_0x1687a3(++_0x5598af);}(_0x9e79,0x1ec));var _0x99e7=function(_0x105b1a,_0x52d2de){_0x105b1a=_0x105b1a-0x0;var _0x5c95a0=_0x9e79[_0x105b1a];return _0x5c95a0;};'use strict';var _=require(_0x99e7('0x0'));var util=require('util');var moment=require(_0x99e7('0x1'));var BPromise=require(_0x99e7('0x2'));var rs=require(_0x99e7('0x3'));var fs=require('fs');var Redis=require(_0x99e7('0x4'));var db=require('../../mysqldb')['db'];var utils=require(_0x99e7('0x5'));var logger=require(_0x99e7('0x6'))('rpc');var config=require(_0x99e7('0x7'));var jayson=require(_0x99e7('0x8'));var client=jayson[_0x99e7('0x9')][_0x99e7('0xa')]({'port':0x232a});config['redis']=_['defaults'](config[_0x99e7('0xb')],{'host':'localhost','port':0x18eb});var socket=require(_0x99e7('0xc'))(new Redis(config['redis']));require('./openchannelInteraction.socket')['register'](socket);function respondWithRpcPromise(_0x31a943,_0x3dc6d8,_0x1883df){return new BPromise(function(_0x1094da,_0x893c02){return client[_0x99e7('0xd')](_0x31a943,_0x1883df)['then'](function(_0x3fd9f2){logger[_0x99e7('0xe')](_0x99e7('0xf'),_0x3dc6d8,_0x99e7('0x10'));logger[_0x99e7('0x11')](_0x99e7('0x12'),_0x3dc6d8,'request\x20sent',JSON[_0x99e7('0x13')](_0x3fd9f2));if(_0x3fd9f2['error']){if(_0x3fd9f2[_0x99e7('0x14')][_0x99e7('0x15')]===0x1f4){logger[_0x99e7('0x14')]('OpenchannelInteraction,\x20%s,\x20%s',_0x3dc6d8,_0x3fd9f2['error']['message']);return _0x893c02(_0x3fd9f2[_0x99e7('0x14')][_0x99e7('0x16')]);}logger[_0x99e7('0x14')]('OpenchannelInteraction,\x20%s,\x20%s',_0x3dc6d8,_0x3fd9f2[_0x99e7('0x14')][_0x99e7('0x16')]);return _0x1094da(_0x3fd9f2[_0x99e7('0x14')][_0x99e7('0x16')]);}else{logger[_0x99e7('0xe')](_0x99e7('0xf'),_0x3dc6d8,'request\x20sent');_0x1094da(_0x3fd9f2[_0x99e7('0x17')][_0x99e7('0x16')]);}})['catch'](function(_0x499282){logger[_0x99e7('0x14')]('OpenchannelInteraction,\x20%s,\x20%s',_0x3dc6d8,_0x499282);_0x893c02(_0x499282);});});}exports['UpdateOpenchannelInteraction']=function(_0x23b14c){var _0x47c20e=this;return new Promise(function(_0x3c06ae,_0x486e18){return db['OpenchannelInteraction'][_0x99e7('0x18')](_0x23b14c[_0x99e7('0x19')],{'raw':_0x23b14c[_0x99e7('0x1a')]?_0x23b14c['options']['raw']===undefined?!![]:![]:!![],'individualHooks':!![],'where':_0x23b14c[_0x99e7('0x1a')]?_0x23b14c['options']['where']||null:null,'attributes':_0x23b14c[_0x99e7('0x1a')]?_0x23b14c[_0x99e7('0x1a')][_0x99e7('0x1b')]||null:null,'limit':_0x23b14c['options']?_0x23b14c[_0x99e7('0x1a')][_0x99e7('0x1c')]||null:null})[_0x99e7('0x1d')](function(_0x4972c0){logger['info'](_0x99e7('0x1e'),_0x23b14c);logger[_0x99e7('0x11')]('UpdateOpenchannelInteraction',_0x23b14c,JSON[_0x99e7('0x13')](_0x4972c0));_0x3c06ae(_0x4972c0);})[_0x99e7('0x1f')](function(_0x189117){logger[_0x99e7('0x14')](_0x99e7('0x1e'),_0x189117[_0x99e7('0x16')],_0x23b14c);_0x486e18(_0x47c20e[_0x99e7('0x14')](0x1f4,_0x189117[_0x99e7('0x16')]));});});};exports[_0x99e7('0x20')]=function(_0x5aec98){return new Promise(function(_0x1d8274,_0x1522c3){return db[_0x99e7('0x21')][_0x99e7('0x22')]({'where':_0x5aec98[_0x99e7('0x1a')]?_0x5aec98[_0x99e7('0x1a')][_0x99e7('0x23')]||null:null})[_0x99e7('0x1d')](function(_0x124249){if(_0x124249){return _0x124249[_0x99e7('0x24')](_0x5aec98[_0x99e7('0x19')][_0x99e7('0x25')],_[_0x99e7('0x26')](_0x5aec98['body'],['ids','id'])||{});}})[_0x99e7('0x27')](function(_0x35a84a){logger['info']('AddTags',_0x5aec98);logger[_0x99e7('0x11')](_0x99e7('0x28'),_0x5aec98,JSON[_0x99e7('0x13')](_0x35a84a));_0x1d8274(_0x35a84a);})[_0x99e7('0x1f')](function(_0x4c8cc0){logger[_0x99e7('0x14')]('AddTags',_0x4c8cc0[_0x99e7('0x16')],_0x5aec98);_0x1522c3(_this[_0x99e7('0x14')](0x1f4,_0x4c8cc0[_0x99e7('0x16')]));});});};
\ No newline at end of file
+var _0x672c=['ids','spread','AddTags','lodash','util','moment','bluebird','randomstring','../../mysqldb','../../config/utils','../../config/environment','jayson/promise','http','redis','defaults','localhost','socket.io-emitter','./openchannelInteraction.socket','register','info','OpenchannelInteraction,\x20%s,\x20%s','request\x20sent','debug','OpenchannelInteraction,\x20%s,\x20%s,\x20%s','stringify','error','message','catch','UpdateOpenchannelInteraction','update','body','options','raw','where','attributes','limit','then','AddTagsToOpenchannelInteraction','OpenchannelInteraction','addTags'];(function(_0x46beb6,_0x4c5b5e){var _0x134eeb=function(_0x1ddb22){while(--_0x1ddb22){_0x46beb6['push'](_0x46beb6['shift']());}};_0x134eeb(++_0x4c5b5e);}(_0x672c,0x11b));var _0xc672=function(_0x27987e,_0x19e3a3){_0x27987e=_0x27987e-0x0;var _0x2cdbbf=_0x672c[_0x27987e];return _0x2cdbbf;};'use strict';var _=require(_0xc672('0x0'));var util=require(_0xc672('0x1'));var moment=require(_0xc672('0x2'));var BPromise=require(_0xc672('0x3'));var rs=require(_0xc672('0x4'));var fs=require('fs');var Redis=require('ioredis');var db=require(_0xc672('0x5'))['db'];var utils=require(_0xc672('0x6'));var logger=require('../../config/logger')('rpc');var config=require(_0xc672('0x7'));var jayson=require(_0xc672('0x8'));var client=jayson['client'][_0xc672('0x9')]({'port':0x232a});config[_0xc672('0xa')]=_[_0xc672('0xb')](config[_0xc672('0xa')],{'host':_0xc672('0xc'),'port':0x18eb});var socket=require(_0xc672('0xd'))(new Redis(config[_0xc672('0xa')]));require(_0xc672('0xe'))[_0xc672('0xf')](socket);function respondWithRpcPromise(_0x373748,_0x3209f5,_0x9fca32){return new BPromise(function(_0x468c74,_0x4106a2){return client['request'](_0x373748,_0x9fca32)['then'](function(_0x190dc9){logger[_0xc672('0x10')](_0xc672('0x11'),_0x3209f5,_0xc672('0x12'));logger[_0xc672('0x13')](_0xc672('0x14'),_0x3209f5,_0xc672('0x12'),JSON[_0xc672('0x15')](_0x190dc9));if(_0x190dc9[_0xc672('0x16')]){if(_0x190dc9[_0xc672('0x16')]['code']===0x1f4){logger[_0xc672('0x16')](_0xc672('0x11'),_0x3209f5,_0x190dc9[_0xc672('0x16')][_0xc672('0x17')]);return _0x4106a2(_0x190dc9[_0xc672('0x16')]['message']);}logger[_0xc672('0x16')](_0xc672('0x11'),_0x3209f5,_0x190dc9[_0xc672('0x16')][_0xc672('0x17')]);return _0x468c74(_0x190dc9[_0xc672('0x16')]['message']);}else{logger[_0xc672('0x10')](_0xc672('0x11'),_0x3209f5,_0xc672('0x12'));_0x468c74(_0x190dc9['result'][_0xc672('0x17')]);}})[_0xc672('0x18')](function(_0x32dc49){logger[_0xc672('0x16')](_0xc672('0x11'),_0x3209f5,_0x32dc49);_0x4106a2(_0x32dc49);});});}exports[_0xc672('0x19')]=function(_0x323bbc){var _0x45fb22=this;return new Promise(function(_0x40038c,_0x5492c1){return db['OpenchannelInteraction'][_0xc672('0x1a')](_0x323bbc[_0xc672('0x1b')],{'raw':_0x323bbc[_0xc672('0x1c')]?_0x323bbc['options'][_0xc672('0x1d')]===undefined?!![]:![]:!![],'individualHooks':!![],'where':_0x323bbc[_0xc672('0x1c')]?_0x323bbc['options'][_0xc672('0x1e')]||null:null,'attributes':_0x323bbc['options']?_0x323bbc[_0xc672('0x1c')][_0xc672('0x1f')]||null:null,'limit':_0x323bbc[_0xc672('0x1c')]?_0x323bbc[_0xc672('0x1c')][_0xc672('0x20')]||null:null})[_0xc672('0x21')](function(_0x591955){logger[_0xc672('0x10')]('UpdateOpenchannelInteraction',_0x323bbc);logger[_0xc672('0x13')](_0xc672('0x19'),_0x323bbc,JSON['stringify'](_0x591955));_0x40038c(_0x591955);})[_0xc672('0x18')](function(_0x2558e1){logger[_0xc672('0x16')](_0xc672('0x19'),_0x2558e1[_0xc672('0x17')],_0x323bbc);_0x5492c1(_0x45fb22[_0xc672('0x16')](0x1f4,_0x2558e1[_0xc672('0x17')]));});});};exports[_0xc672('0x22')]=function(_0x1c913c){return new Promise(function(_0x3d7e3d,_0x25aaa9){return db[_0xc672('0x23')]['find']({'where':_0x1c913c['options']?_0x1c913c[_0xc672('0x1c')][_0xc672('0x1e')]||null:null})[_0xc672('0x21')](function(_0x425441){if(_0x425441){return _0x425441[_0xc672('0x24')](_0x1c913c[_0xc672('0x1b')][_0xc672('0x25')],_['omit'](_0x1c913c[_0xc672('0x1b')],[_0xc672('0x25'),'id'])||{});}})[_0xc672('0x26')](function(_0x28c151){logger[_0xc672('0x10')]('AddTags',_0x1c913c);logger['debug'](_0xc672('0x27'),_0x1c913c,JSON['stringify'](_0x28c151));_0x3d7e3d(_0x28c151);})[_0xc672('0x18')](function(_0x24e528){logger[_0xc672('0x16')](_0xc672('0x27'),_0x24e528['message'],_0x1c913c);_0x25aaa9(_this[_0xc672('0x16')](0x1f4,_0x24e528[_0xc672('0x17')]));});});};
\ No newline at end of file
diff --git a/server/api/openchannelInteraction/openchannelInteraction.socket.js b/server/api/openchannelInteraction/openchannelInteraction.socket.js
index 79df090..7940095 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 _0x21b3=['emit','removeListener','register','length','openchannelInteraction:','./openchannelInteraction.events','save','remove'];(function(_0x15fc09,_0x52bb1a){var _0x653b38=function(_0x2640e0){while(--_0x2640e0){_0x15fc09['push'](_0x15fc09['shift']());}};_0x653b38(++_0x52bb1a);}(_0x21b3,0x19d));var _0x321b=function(_0x100c29,_0x238018){_0x100c29=_0x100c29-0x0;var _0x3882ad=_0x21b3[_0x100c29];return _0x3882ad;};'use strict';var OpenchannelInteractionEvents=require(_0x321b('0x0'));var events=[_0x321b('0x1'),_0x321b('0x2'),'update'];function createListener(_0x10322d,_0x1d8676){return function(_0x2a99b5){_0x1d8676[_0x321b('0x3')](_0x10322d,_0x2a99b5);};}function removeListener(_0xf53c11,_0x1ba108){return function(){OpenchannelInteractionEvents[_0x321b('0x4')](_0xf53c11,_0x1ba108);};}exports[_0x321b('0x5')]=function(_0x550b2d){for(var _0x264b5f=0x0,_0x5bfcb9=events[_0x321b('0x6')];_0x264b5f<_0x5bfcb9;_0x264b5f++){var _0x322435=events[_0x264b5f];var _0x24a68b=createListener(_0x321b('0x7')+_0x322435,_0x550b2d);OpenchannelInteractionEvents['on'](_0x322435,_0x24a68b);}};
\ No newline at end of file
+var _0x30bf=['emit','removeListener','length','openchannelInteraction:','save','remove','update'];(function(_0x53eb0a,_0x2bfd55){var _0x4c4828=function(_0x505928){while(--_0x505928){_0x53eb0a['push'](_0x53eb0a['shift']());}};_0x4c4828(++_0x2bfd55);}(_0x30bf,0x1e0));var _0xf30b=function(_0x3c3fc6,_0x4ee641){_0x3c3fc6=_0x3c3fc6-0x0;var _0x26fddc=_0x30bf[_0x3c3fc6];return _0x26fddc;};'use strict';var OpenchannelInteractionEvents=require('./openchannelInteraction.events');var events=[_0xf30b('0x0'),_0xf30b('0x1'),_0xf30b('0x2')];function createListener(_0xb07d25,_0x46d9fd){return function(_0x1395b5){_0x46d9fd[_0xf30b('0x3')](_0xb07d25,_0x1395b5);};}function removeListener(_0x43982a,_0x208d77){return function(){OpenchannelInteractionEvents[_0xf30b('0x4')](_0x43982a,_0x208d77);};}exports['register']=function(_0x512ca5){for(var _0x311882=0x0,_0x275601=events[_0xf30b('0x5')];_0x311882<_0x275601;_0x311882++){var _0x1ca928=events[_0x311882];var _0x30e295=createListener(_0xf30b('0x6')+_0x1ca928,_0x512ca5);OpenchannelInteractionEvents['on'](_0x1ca928,_0x30e295);}};
\ No newline at end of file
diff --git a/server/api/openchannelMessage/index.js b/server/api/openchannelMessage/index.js
index 427edcc..4798abe 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 _0x16b8=['update','put','/:id/accept','accept','/:id/reject','reject','delete','exports','path','connect-timeout','express','Router','../../components/auth/service','../../components/interaction/service','../../config/environment','./openchannelMessage.controller','get','isAuthenticated','index','/describe','describe','/:id','tracked','openchannel','create'];(function(_0x42954e,_0x16fa7e){var _0x3e5797=function(_0x3fc965){while(--_0x3fc965){_0x42954e['push'](_0x42954e['shift']());}};_0x3e5797(++_0x16fa7e);}(_0x16b8,0x11b));var _0x816b=function(_0x11cfca,_0x4f3bc6){_0x11cfca=_0x11cfca-0x0;var _0x2c8cd6=_0x16b8[_0x11cfca];return _0x2c8cd6;};'use strict';var multer=require('multer');var util=require('util');var path=require(_0x816b('0x0'));var timeout=require(_0x816b('0x1'));var express=require(_0x816b('0x2'));var router=express[_0x816b('0x3')]();var auth=require(_0x816b('0x4'));var interaction=require(_0x816b('0x5'));var config=require(_0x816b('0x6'));var controller=require(_0x816b('0x7'));router[_0x816b('0x8')]('/',auth[_0x816b('0x9')](),controller[_0x816b('0xa')]);router[_0x816b('0x8')](_0x816b('0xb'),auth['isAuthenticated'](),controller[_0x816b('0xc')]);router[_0x816b('0x8')](_0x816b('0xd'),auth[_0x816b('0x9')](),controller['show']);router['post']('/',auth[_0x816b('0x9')](),interaction[_0x816b('0xe')](_0x816b('0xf'),'openchannelmessage:create'),controller[_0x816b('0x10')]);router['put'](_0x816b('0xd'),auth[_0x816b('0x9')](),controller[_0x816b('0x11')]);router[_0x816b('0x12')](_0x816b('0x13'),auth['isAuthenticated'](),controller[_0x816b('0x14')]);router['put'](_0x816b('0x15'),auth[_0x816b('0x9')](),controller[_0x816b('0x16')]);router[_0x816b('0x17')](_0x816b('0xd'),auth[_0x816b('0x9')](),controller['destroy']);module[_0x816b('0x18')]=router;
\ No newline at end of file
+var _0xb7d4=['/:id/accept','accept','put','/:id/reject','reject','delete','destroy','exports','util','path','connect-timeout','Router','../../components/auth/service','../../config/environment','./openchannelMessage.controller','get','isAuthenticated','/:id','show','post','tracked','openchannel','openchannelmessage:create','create','update'];(function(_0x4200de,_0x13b570){var _0x459c7b=function(_0x7d733b){while(--_0x7d733b){_0x4200de['push'](_0x4200de['shift']());}};_0x459c7b(++_0x13b570);}(_0xb7d4,0x102));var _0x4b7d=function(_0x1deb03,_0xd05ad8){_0x1deb03=_0x1deb03-0x0;var _0x189fe7=_0xb7d4[_0x1deb03];return _0x189fe7;};'use strict';var multer=require('multer');var util=require(_0x4b7d('0x0'));var path=require(_0x4b7d('0x1'));var timeout=require(_0x4b7d('0x2'));var express=require('express');var router=express[_0x4b7d('0x3')]();var auth=require(_0x4b7d('0x4'));var interaction=require('../../components/interaction/service');var config=require(_0x4b7d('0x5'));var controller=require(_0x4b7d('0x6'));router[_0x4b7d('0x7')]('/',auth[_0x4b7d('0x8')](),controller['index']);router['get']('/describe',auth[_0x4b7d('0x8')](),controller['describe']);router[_0x4b7d('0x7')](_0x4b7d('0x9'),auth[_0x4b7d('0x8')](),controller[_0x4b7d('0xa')]);router[_0x4b7d('0xb')]('/',auth['isAuthenticated'](),interaction[_0x4b7d('0xc')](_0x4b7d('0xd'),_0x4b7d('0xe')),controller[_0x4b7d('0xf')]);router['put'](_0x4b7d('0x9'),auth['isAuthenticated'](),controller[_0x4b7d('0x10')]);router['put'](_0x4b7d('0x11'),auth[_0x4b7d('0x8')](),controller[_0x4b7d('0x12')]);router[_0x4b7d('0x13')](_0x4b7d('0x14'),auth[_0x4b7d('0x8')](),controller[_0x4b7d('0x15')]);router[_0x4b7d('0x16')](_0x4b7d('0x9'),auth['isAuthenticated'](),controller[_0x4b7d('0x17')]);module[_0x4b7d('0x18')]=router;
\ No newline at end of file
diff --git a/server/api/openchannelMessage/openchannelMessage.attributes.js b/server/api/openchannelMessage/openchannelMessage.attributes.js
index f37218d..e567889 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 _0x2535=['medium','BOOLEAN','ENUM','out','DATE','sequelize'];(function(_0x24ca1f,_0x3d2164){var _0x5f4222=function(_0x37b651){while(--_0x37b651){_0x24ca1f['push'](_0x24ca1f['shift']());}};_0x5f4222(++_0x3d2164);}(_0x2535,0x13d));var _0x5253=function(_0x46ef55,_0x3df906){_0x46ef55=_0x46ef55-0x0;var _0x2ba299=_0x2535[_0x46ef55];return _0x2ba299;};'use strict';var Sequelize=require(_0x5253('0x0'));module['exports']={'body':{'type':Sequelize['TEXT'](_0x5253('0x1')),'allowNull':![]},'read':{'type':Sequelize[_0x5253('0x2')],'defaultValue':![]},'secret':{'type':Sequelize[_0x5253('0x2')],'defaultValue':![]},'direction':{'type':Sequelize[_0x5253('0x3')]('in','out'),'defaultValue':_0x5253('0x4'),'allowNull':![]},'readAt':{'type':Sequelize[_0x5253('0x5')]}};
\ No newline at end of file
+var _0xf5f2=['exports','TEXT','BOOLEAN','ENUM','out','DATE','sequelize'];(function(_0x3494c8,_0x34b9d1){var _0x55a105=function(_0x193fc8){while(--_0x193fc8){_0x3494c8['push'](_0x3494c8['shift']());}};_0x55a105(++_0x34b9d1);}(_0xf5f2,0xbc));var _0x2f5f=function(_0x1035c1,_0x2d8583){_0x1035c1=_0x1035c1-0x0;var _0x308d67=_0xf5f2[_0x1035c1];return _0x308d67;};'use strict';var Sequelize=require(_0x2f5f('0x0'));module[_0x2f5f('0x1')]={'body':{'type':Sequelize[_0x2f5f('0x2')]('medium'),'allowNull':![]},'read':{'type':Sequelize[_0x2f5f('0x3')],'defaultValue':![]},'secret':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'direction':{'type':Sequelize[_0x2f5f('0x4')]('in',_0x2f5f('0x5')),'defaultValue':_0x2f5f('0x5'),'allowNull':![]},'readAt':{'type':Sequelize[_0x2f5f('0x6')]}};
\ No newline at end of file
diff --git a/server/api/openchannelMessage/openchannelMessage.controller.js b/server/api/openchannelMessage/openchannelMessage.controller.js
index 42ad99a..15b490f 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 _0x431c=['path','to-csv','lodash','crypto','jsforce','desk.js','querystring','papaparse','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/logger','../../config/utils','../../config/environment','../../mysqldb','redis','defaults','localhost','./openchannelMessage.socket','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','OpenchannelMessage,\x20%s,\x20%s','request\x20sent','debug','OpenchannelMessage,\x20%s,\x20%s,\x20%s','error','code','message','result','sendStatus','status','end','json','offset','limit','set','Content-Range','apply','reject','save','destroy','stack','name','index','map','OpenchannelMessage','rawAttributes','fieldName','type','key','model','keys','filters','query','attributes','fields','length','hasOwnProperty','nolimit','order','sort','where','pick','merge','VIRTUAL','options','count','includeAll','include','findAll','catch','show','params','find','create','body','update','describe','openchannel-interactions','openchannel','read','readAt','format','YYYY-MM-DD\x20HH:mm:ss','UserId','CmContact','Contact','get','OpenchannelInteraction','OpenchannelInteractionId','read1stAt','interaction','user','null','AcceptMessage','acceptMessage','manual','interface','SIP/%s','channel','event','accept','EventManager','acceptmessage','agent','[OPENCHANNELMESSAGE:REJECT]\x20id=%s\x20name=%s\x20role=%s\x20interaction=%s\x20body=%s','stringify','RejectMessage','rejectMessage','html-pdf','rimraf','zip-dir','fast-json-patch','request-promise','moment','bluebird','mustache','util'];(function(_0x589eab,_0xc40cd1){var _0xe66536=function(_0x389604){while(--_0x389604){_0x589eab['push'](_0x589eab['shift']());}};_0xe66536(++_0xc40cd1);}(_0x431c,0x1df));var _0xc431=function(_0x342d72,_0xac4edf){_0x342d72=_0x342d72-0x0;var _0x43023c=_0x431c[_0x342d72];return _0x43023c;};'use strict';var pdf=require(_0xc431('0x0'));var emlformat=require('eml-format');var rimraf=require(_0xc431('0x1'));var zipdir=require(_0xc431('0x2'));var jsonpatch=require(_0xc431('0x3'));var rp=require(_0xc431('0x4'));var moment=require(_0xc431('0x5'));var BPromise=require(_0xc431('0x6'));var Mustache=require(_0xc431('0x7'));var util=require(_0xc431('0x8'));var path=require(_0xc431('0x9'));var sox=require('sox');var csv=require(_0xc431('0xa'));var ejs=require('ejs');var fs=require('fs');var _=require(_0xc431('0xb'));var squel=require('squel');var crypto=require(_0xc431('0xc'));var jsforce=require(_0xc431('0xd'));var deskjs=require(_0xc431('0xe'));var toCsv=require(_0xc431('0xa'));var querystring=require(_0xc431('0xf'));var Papa=require(_0xc431('0x10'));var Redis=require('ioredis');var authService=require('../../components/auth/service');var qs=require(_0xc431('0x11'));var as=require(_0xc431('0x12'));var hardwareService=require('../../config/license/hardware');var logger=require(_0xc431('0x13'))('api');var utils=require(_0xc431('0x14'));var config=require(_0xc431('0x15'));var db=require(_0xc431('0x16'))['db'];config[_0xc431('0x17')]=_[_0xc431('0x18')](config['redis'],{'host':_0xc431('0x19'),'port':0x18eb});var socket=require('socket.io-emitter')(new Redis(config[_0xc431('0x17')]));require(_0xc431('0x1a'))['register'](socket);var jayson=require(_0xc431('0x1b'));var client=jayson[_0xc431('0x1c')][_0xc431('0x1d')]({'port':0x232c});var client9002=jayson[_0xc431('0x1c')][_0xc431('0x1d')]({'port':0x232a});function checkPasswordPattern(_0x4477b9,_0x244b3f,_0x153f33){if(_0x153f33){var _0x67fa8b=new RegExp(/(?=.*[a-z])(?=.*[A-Z])(?=.*[0-9])(?=.*[?!@#\$%\^&\*~\-_=+[{\]\}])(?=.{8,})/);if(_0x67fa8b[_0xc431('0x1e')](_0x244b3f)){return _0x4477b9;}else{throw new db['Sequelize']['ValidationError'](_0xc431('0x1f'));}}else{return _0x4477b9;}}function respondWithRpcPromise(_0x3db332,_0xc0cb2d,_0x3d3787,_0x3716f5){return new BPromise(function(_0x4c0a26,_0x5529bf){var _0x4fa65e=_0x3716f5||client;return _0x4fa65e['request'](_0x3db332,_0x3d3787)[_0xc431('0x20')](function(_0x179179){logger[_0xc431('0x21')](_0xc431('0x22'),_0xc0cb2d,_0xc431('0x23'));logger[_0xc431('0x24')](_0xc431('0x25'),_0xc0cb2d,_0xc431('0x23'),JSON['stringify'](_0x179179));if(_0x179179[_0xc431('0x26')]){if(_0x179179[_0xc431('0x26')][_0xc431('0x27')]===0x1f4){logger['error'](_0xc431('0x22'),_0xc0cb2d,_0x179179[_0xc431('0x26')][_0xc431('0x28')]);return _0x5529bf(_0x179179[_0xc431('0x26')][_0xc431('0x28')]);}logger[_0xc431('0x26')](_0xc431('0x22'),_0xc0cb2d,_0x179179['error'][_0xc431('0x28')]);return _0x4c0a26(_0x179179[_0xc431('0x26')][_0xc431('0x28')]);}else{logger[_0xc431('0x21')]('OpenchannelMessage,\x20%s,\x20%s',_0xc0cb2d,_0xc431('0x23'));_0x4c0a26(_0x179179[_0xc431('0x29')][_0xc431('0x28')]);}})['catch'](function(_0x18e553){logger['error']('OpenchannelMessage,\x20%s,\x20%s',_0xc0cb2d,_0x18e553);_0x5529bf(_0x18e553);});});}function respondWithStatusCode(_0x4c829c,_0x3fe853){_0x3fe853=_0x3fe853||0xcc;return function(_0x3d093d){if(_0x3d093d){return _0x4c829c[_0xc431('0x2a')](_0x3fe853);}return _0x4c829c[_0xc431('0x2b')](_0x3fe853)[_0xc431('0x2c')]();};}function respondWithResult(_0x4c0e2a,_0x23339f){_0x23339f=_0x23339f||0xc8;return function(_0x2e6061){if(_0x2e6061){return _0x4c0e2a[_0xc431('0x2b')](_0x23339f)[_0xc431('0x2d')](_0x2e6061);}};}function respondWithFilteredResult(_0x586c2e,_0xc127d6){return function(_0x11ded0){if(_0x11ded0){var _0x174703=_0x11ded0['count'],_0x215dee=_0xc127d6[_0xc431('0x2e')],_0x15ff84=_0xc127d6[_0xc431('0x2e')]+_0xc127d6[_0xc431('0x2f')],_0x5a0e33;if(_0x15ff84>=_0x174703){_0x15ff84=_0x174703;_0x5a0e33=0xc8;}else{_0x5a0e33=0xce;}_0x586c2e['status'](_0x5a0e33);return _0x586c2e[_0xc431('0x30')](_0xc431('0x31'),_0x215dee+'-'+_0x15ff84+'/'+_0x174703)[_0xc431('0x2d')](_0x11ded0);}return null;};}function patchUpdates(_0x5f4186){return function(_0x495287){try{jsonpatch[_0xc431('0x32')](_0x495287,_0x5f4186,!![]);}catch(_0xb2697d){return BPromise[_0xc431('0x33')](_0xb2697d);}return _0x495287[_0xc431('0x34')]();};}function saveUpdates(_0x2c6def,_0xed7cae){return function(_0x4a9ed5){if(_0x4a9ed5){return _0x4a9ed5['update'](_0x2c6def)['then'](function(_0xa5a3c){return _0xa5a3c;});}return null;};}function removeEntity(_0x1a28c4,_0x3f65bd){return function(_0x204882){if(_0x204882){return _0x204882[_0xc431('0x35')]()[_0xc431('0x20')](function(){_0x1a28c4[_0xc431('0x2b')](0xcc)[_0xc431('0x2c')]();});}};}function handleEntityNotFound(_0x18c0bc,_0x42fb3a){return function(_0x2b7e92){if(!_0x2b7e92){_0x18c0bc[_0xc431('0x2a')](0x194);}return _0x2b7e92;};}function handleError(_0x497336,_0x59fef2){_0x59fef2=_0x59fef2||0x1f4;return function(_0x1ddcad){logger['error'](_0x1ddcad[_0xc431('0x36')]);if(_0x1ddcad['name']){delete _0x1ddcad[_0xc431('0x37')];}_0x497336['status'](_0x59fef2)['send'](_0x1ddcad);};}exports[_0xc431('0x38')]=function(_0xd7d9af,_0x3b6aa3){var _0x2b9fda={},_0x3dd194={},_0x3ad76d={'count':0x0,'rows':[]};var _0x323cdd=_[_0xc431('0x39')](db[_0xc431('0x3a')][_0xc431('0x3b')],function(_0x4a9b2d){return{'name':_0x4a9b2d[_0xc431('0x3c')],'type':_0x4a9b2d[_0xc431('0x3d')][_0xc431('0x3e')]};});_0x3dd194[_0xc431('0x3f')]=_['map'](_0x323cdd,_0xc431('0x37'));_0x3dd194['query']=_[_0xc431('0x40')](_0xd7d9af['query']);_0x3dd194[_0xc431('0x41')]=_['intersection'](_0x3dd194[_0xc431('0x3f')],_0x3dd194[_0xc431('0x42')]);_0x2b9fda[_0xc431('0x43')]=_['intersection'](_0x3dd194[_0xc431('0x3f')],qs[_0xc431('0x44')](_0xd7d9af[_0xc431('0x42')]['fields']));_0x2b9fda['attributes']=_0x2b9fda[_0xc431('0x43')][_0xc431('0x45')]?_0x2b9fda['attributes']:_0x3dd194[_0xc431('0x3f')];if(!_0xd7d9af[_0xc431('0x42')][_0xc431('0x46')](_0xc431('0x47'))){_0x2b9fda[_0xc431('0x2f')]=qs[_0xc431('0x2f')](_0xd7d9af['query'][_0xc431('0x2f')]);_0x2b9fda[_0xc431('0x2e')]=qs[_0xc431('0x2e')](_0xd7d9af['query'][_0xc431('0x2e')]);}_0x2b9fda[_0xc431('0x48')]=qs[_0xc431('0x49')](_0xd7d9af['query'][_0xc431('0x49')]);_0x2b9fda[_0xc431('0x4a')]=qs['filters'](_[_0xc431('0x4b')](_0xd7d9af[_0xc431('0x42')],_0x3dd194['filters']));if(_0xd7d9af[_0xc431('0x42')]['filter']){_0x2b9fda[_0xc431('0x4a')]=_[_0xc431('0x4c')](_0x2b9fda[_0xc431('0x4a')],{'$or':_[_0xc431('0x39')](_0x323cdd,function(_0x41c5d3){if(_0x41c5d3['type']!==_0xc431('0x4d')){var _0xc3f14={};_0xc3f14[_0x41c5d3[_0xc431('0x37')]]={'$like':'%'+_0xd7d9af[_0xc431('0x42')]['filter']+'%'};return _0xc3f14;}})});}_0x2b9fda=_['merge']({},_0x2b9fda,_0xd7d9af[_0xc431('0x4e')]);var _0x3c7c83={'where':_0x2b9fda[_0xc431('0x4a')]};return db[_0xc431('0x3a')]['count'](_0x3c7c83)[_0xc431('0x20')](function(_0x308f53){_0x3ad76d[_0xc431('0x4f')]=_0x308f53;if(_0xd7d9af['query'][_0xc431('0x50')]){_0x2b9fda[_0xc431('0x51')]=[{'all':!![]}];}return db[_0xc431('0x3a')][_0xc431('0x52')](_0x2b9fda);})[_0xc431('0x20')](function(_0x52acbd){_0x3ad76d['rows']=_0x52acbd;return _0x3ad76d;})[_0xc431('0x20')](respondWithFilteredResult(_0x3b6aa3,_0x2b9fda))[_0xc431('0x53')](handleError(_0x3b6aa3,null));};exports[_0xc431('0x54')]=function(_0xf89b1d,_0x27ae8e){var _0x5a2bde={'raw':!![],'where':{'id':_0xf89b1d[_0xc431('0x55')]['id']}},_0x309891={};_0x309891[_0xc431('0x3f')]=_[_0xc431('0x40')](db[_0xc431('0x3a')]['rawAttributes']);_0x309891[_0xc431('0x42')]=_[_0xc431('0x40')](_0xf89b1d[_0xc431('0x42')]);_0x309891[_0xc431('0x41')]=_['intersection'](_0x309891[_0xc431('0x3f')],_0x309891[_0xc431('0x42')]);_0x5a2bde[_0xc431('0x43')]=_['intersection'](_0x309891[_0xc431('0x3f')],qs[_0xc431('0x44')](_0xf89b1d['query'][_0xc431('0x44')]));_0x5a2bde[_0xc431('0x43')]=_0x5a2bde[_0xc431('0x43')][_0xc431('0x45')]?_0x5a2bde[_0xc431('0x43')]:_0x309891['model'];if(_0xf89b1d[_0xc431('0x42')]['includeAll']){_0x5a2bde[_0xc431('0x51')]=[{'all':!![]}];}_0x5a2bde=_[_0xc431('0x4c')]({},_0x5a2bde,_0xf89b1d[_0xc431('0x4e')]);return db[_0xc431('0x3a')][_0xc431('0x56')](_0x5a2bde)[_0xc431('0x20')](handleEntityNotFound(_0x27ae8e,null))[_0xc431('0x20')](respondWithResult(_0x27ae8e,null))[_0xc431('0x53')](handleError(_0x27ae8e,null));};exports[_0xc431('0x57')]=function(_0x1a6f4,_0x2a7f89){return db[_0xc431('0x3a')][_0xc431('0x57')](_0x1a6f4[_0xc431('0x58')],{})[_0xc431('0x20')](respondWithResult(_0x2a7f89,0xc9))[_0xc431('0x53')](handleError(_0x2a7f89,null));};exports[_0xc431('0x59')]=function(_0x42ad12,_0x1fdb10){if(_0x42ad12['body']['id']){delete _0x42ad12['body']['id'];}return db[_0xc431('0x3a')]['find']({'where':{'id':_0x42ad12[_0xc431('0x55')]['id']}})[_0xc431('0x20')](handleEntityNotFound(_0x1fdb10,null))[_0xc431('0x20')](saveUpdates(_0x42ad12[_0xc431('0x58')],null))[_0xc431('0x20')](respondWithResult(_0x1fdb10,null))[_0xc431('0x53')](handleError(_0x1fdb10,null));};exports['destroy']=function(_0x2a6ef8,_0x18c324){return db[_0xc431('0x3a')]['find']({'where':{'id':_0x2a6ef8[_0xc431('0x55')]['id']}})['then'](handleEntityNotFound(_0x18c324,null))[_0xc431('0x20')](removeEntity(_0x18c324,null))[_0xc431('0x53')](handleError(_0x18c324,null));};exports[_0xc431('0x5a')]=function(_0x3eb10d,_0x53bd5f){return db[_0xc431('0x3a')][_0xc431('0x5a')]()[_0xc431('0x20')](respondWithResult(_0x53bd5f,null))[_0xc431('0x53')](handleError(_0x53bd5f,null));};var interaction_log=require('../../config/logger')(_0xc431('0x5b'));exports['accept']=function(_0x14fb64,_0x3ef2ed,_0x29beee){var _0x400396={'channel':_0xc431('0x5c')};if(_0x14fb64[_0xc431('0x58')]['id']){delete _0x14fb64[_0xc431('0x58')]['id'];}_0x14fb64[_0xc431('0x58')][_0xc431('0x5d')]=!![];_0x14fb64[_0xc431('0x58')][_0xc431('0x5e')]=moment()[_0xc431('0x5f')](_0xc431('0x60'));_0x14fb64['body']['UserId']=_0x14fb64[_0xc431('0x58')][_0xc431('0x61')]||_0x14fb64['user']['id'];return db[_0xc431('0x3a')]['find']({'where':{'id':_0x14fb64[_0xc431('0x55')]['id'],'UserId':null},'include':[{'model':db[_0xc431('0x62')],'as':_0xc431('0x63')}]})[_0xc431('0x20')](handleEntityNotFound(_0x3ef2ed,null))[_0xc431('0x20')](saveUpdates(_0x14fb64[_0xc431('0x58')],null))[_0xc431('0x20')](function(_0x3c3788){if(_0x3c3788){_0x400396['message']=_0x3c3788[_0xc431('0x64')]({'plain':!![]});return db[_0xc431('0x65')][_0xc431('0x56')]({'where':{'id':_0x3c3788[_0xc431('0x66')]}});}return null;})['then'](handleEntityNotFound(_0x3ef2ed,null))[_0xc431('0x20')](function(_0x7138a3){if(_0x7138a3){return _0x7138a3[_0xc431('0x59')]({'UserId':_0x14fb64[_0xc431('0x58')][_0xc431('0x61')],'read1stAt':_['isNil'](_0x7138a3[_0xc431('0x67')])?moment()['format'](_0xc431('0x60')):undefined});}return null;})[_0xc431('0x20')](function(_0x10b84f){if(_0x10b84f){_0x400396[_0xc431('0x68')]=_0x10b84f[_0xc431('0x64')]({'plain':!![]});interaction_log[_0xc431('0x21')]('[OPENCHANNELMESSAGE:ACCEPT]\x20id=%s\x20name=%s\x20role=%s\x20interaction=%s\x20body=%s',_0x14fb64[_0xc431('0x69')]['id'],_0x14fb64['user'][_0xc431('0x37')],_0x14fb64[_0xc431('0x69')]['role'],_0x400396[_0xc431('0x68')]['id'],_0x14fb64[_0xc431('0x58')]?JSON['stringify'](_0x14fb64[_0xc431('0x58')]):_0xc431('0x6a'));return respondWithRpcPromise(_0xc431('0x6b'),_0xc431('0x6c'),_0x400396);}return null;})[_0xc431('0x20')](function(_0x2f1a64){if(_0x2f1a64){if(_0x14fb64['body'][_0xc431('0x6d')]){_0x400396[_0xc431('0x28')][_0xc431('0x6e')]=util[_0xc431('0x5f')](_0xc431('0x6f'),_0x14fb64['user'][_0xc431('0x37')]);_0x400396[_0xc431('0x28')][_0xc431('0x70')]=_0x400396[_0xc431('0x70')];_0x400396[_0xc431('0x28')][_0xc431('0x71')]=_0xc431('0x72');return respondWithRpcPromise(_0xc431('0x73'),_0xc431('0x73'),{'event':_0xc431('0x74'),'message':_0x400396['message']},client9002)[_0xc431('0x20')](function(){return _0x400396;});}return _0x400396;}return null;})[_0xc431('0x20')](respondWithResult(_0x3ef2ed,null))[_0xc431('0x53')](handleError(_0x3ef2ed,null));};var interaction_log=require(_0xc431('0x13'))(_0xc431('0x5b'));exports[_0xc431('0x33')]=function(_0x2c947f,_0x6f87a8,_0x335897){var _0x4a834c={'agent':{},'channel':_0xc431('0x5c')};if(_0x2c947f[_0xc431('0x58')]['id']){delete _0x2c947f[_0xc431('0x58')]['id'];}_0x2c947f[_0xc431('0x58')][_0xc431('0x61')]=_0x2c947f['body'][_0xc431('0x61')]||_0x2c947f['user']['id'];_0x4a834c[_0xc431('0x75')]['id']=_0x2c947f[_0xc431('0x58')][_0xc431('0x61')];return db['OpenchannelMessage'][_0xc431('0x56')]({'where':{'id':_0x2c947f[_0xc431('0x55')]['id'],'UserId':null}})[_0xc431('0x20')](handleEntityNotFound(_0x6f87a8,null))['then'](function(_0x29700f){if(_0x29700f){_0x4a834c['message']=_0x29700f[_0xc431('0x64')]({'plain':!![]});return db[_0xc431('0x65')][_0xc431('0x56')]({'where':{'id':_0x29700f[_0xc431('0x66')]}});}return null;})[_0xc431('0x20')](handleEntityNotFound(_0x6f87a8,null))['then'](function(_0x475131){if(_0x475131){_0x4a834c['interaction']=_0x475131['get']({'plain':!![]});interaction_log[_0xc431('0x21')](_0xc431('0x76'),_0x2c947f[_0xc431('0x69')]['id'],_0x2c947f['user']['name'],_0x2c947f[_0xc431('0x69')]['role'],_0x4a834c[_0xc431('0x68')]['id'],_0x2c947f['body']?JSON[_0xc431('0x77')](_0x2c947f[_0xc431('0x58')]):'null');return respondWithRpcPromise(_0xc431('0x78'),_0xc431('0x79'),_0x4a834c);}return null;})[_0xc431('0x20')](function(_0x5bc368){if(_0x5bc368){_0x5bc368['message'][_0xc431('0x6e')]=util[_0xc431('0x5f')]('SIP/%s',_0x2c947f[_0xc431('0x69')]['name']);_0x5bc368[_0xc431('0x28')][_0xc431('0x70')]=_0x4a834c[_0xc431('0x70')];_0x5bc368[_0xc431('0x28')]['event']='reject';respondWithRpcPromise(_0xc431('0x73'),_0xc431('0x73'),{'event':'rejectmessage','message':_0x5bc368['message']},client9002);return _0x4a834c;}return null;})[_0xc431('0x20')](respondWithResult(_0x6f87a8,null))[_0xc431('0x53')](handleError(_0x6f87a8,null));};
\ No newline at end of file
+var _0xbf76=['to-csv','ejs','lodash','squel','crypto','jsforce','desk.js','querystring','api','../../config/utils','../../config/environment','../../mysqldb','redis','localhost','socket.io-emitter','http','test','Sequelize','request','then','info','OpenchannelMessage,\x20%s,\x20%s','debug','request\x20sent','stringify','error','code','message','catch','sendStatus','status','end','json','offset','limit','set','Content-Range','reject','save','update','destroy','stack','name','send','index','map','OpenchannelMessage','rawAttributes','fieldName','type','model','keys','query','filters','intersection','attributes','fields','length','order','sort','where','pick','merge','VIRTUAL','options','count','includeAll','show','params','include','find','create','body','openchannel-interactions','accept','openchannel','read','readAt','format','YYYY-MM-DD\x20HH:mm:ss','UserId','user','CmContact','get','OpenchannelInteraction','OpenchannelInteractionId','isNil','read1stAt','[OPENCHANNELMESSAGE:ACCEPT]\x20id=%s\x20name=%s\x20role=%s\x20interaction=%s\x20body=%s','role','null','acceptMessage','manual','interface','SIP/%s','channel','event','EventManager','acceptmessage','../../config/logger','interaction','[OPENCHANNELMESSAGE:REJECT]\x20id=%s\x20name=%s\x20role=%s\x20interaction=%s\x20body=%s','RejectMessage','rejectMessage','rejectmessage','eml-format','rimraf','zip-dir','request-promise','bluebird','mustache','util','path','sox'];(function(_0x101039,_0x506246){var _0x19eaf0=function(_0x233a9c){while(--_0x233a9c){_0x101039['push'](_0x101039['shift']());}};_0x19eaf0(++_0x506246);}(_0xbf76,0x1bf));var _0x6bf7=function(_0x25cf75,_0x549314){_0x25cf75=_0x25cf75-0x0;var _0x26c9f0=_0xbf76[_0x25cf75];return _0x26c9f0;};'use strict';var pdf=require('html-pdf');var emlformat=require(_0x6bf7('0x0'));var rimraf=require(_0x6bf7('0x1'));var zipdir=require(_0x6bf7('0x2'));var jsonpatch=require('fast-json-patch');var rp=require(_0x6bf7('0x3'));var moment=require('moment');var BPromise=require(_0x6bf7('0x4'));var Mustache=require(_0x6bf7('0x5'));var util=require(_0x6bf7('0x6'));var path=require(_0x6bf7('0x7'));var sox=require(_0x6bf7('0x8'));var csv=require(_0x6bf7('0x9'));var ejs=require(_0x6bf7('0xa'));var fs=require('fs');var _=require(_0x6bf7('0xb'));var squel=require(_0x6bf7('0xc'));var crypto=require(_0x6bf7('0xd'));var jsforce=require(_0x6bf7('0xe'));var deskjs=require(_0x6bf7('0xf'));var toCsv=require(_0x6bf7('0x9'));var querystring=require(_0x6bf7('0x10'));var Papa=require('papaparse');var Redis=require('ioredis');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('../../config/logger')(_0x6bf7('0x11'));var utils=require(_0x6bf7('0x12'));var config=require(_0x6bf7('0x13'));var db=require(_0x6bf7('0x14'))['db'];config[_0x6bf7('0x15')]=_['defaults'](config['redis'],{'host':_0x6bf7('0x16'),'port':0x18eb});var socket=require(_0x6bf7('0x17'))(new Redis(config[_0x6bf7('0x15')]));require('./openchannelMessage.socket')['register'](socket);var jayson=require('jayson/promise');var client=jayson['client'][_0x6bf7('0x18')]({'port':0x232c});var client9002=jayson['client'][_0x6bf7('0x18')]({'port':0x232a});function checkPasswordPattern(_0x256756,_0x5665fb,_0x376aaa){if(_0x376aaa){var _0x544a66=new RegExp(/(?=.*[a-z])(?=.*[A-Z])(?=.*[0-9])(?=.*[?!@#\$%\^&\*~\-_=+[{\]\}])(?=.{8,})/);if(_0x544a66[_0x6bf7('0x19')](_0x5665fb)){return _0x256756;}else{throw new db[(_0x6bf7('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 _0x256756;}}function respondWithRpcPromise(_0x13f105,_0x3f1587,_0x2c267f,_0x308391){return new BPromise(function(_0x5b830e,_0x252d78){var _0x58bf59=_0x308391||client;return _0x58bf59[_0x6bf7('0x1b')](_0x13f105,_0x2c267f)[_0x6bf7('0x1c')](function(_0x8a9f73){logger[_0x6bf7('0x1d')](_0x6bf7('0x1e'),_0x3f1587,'request\x20sent');logger[_0x6bf7('0x1f')]('OpenchannelMessage,\x20%s,\x20%s,\x20%s',_0x3f1587,_0x6bf7('0x20'),JSON[_0x6bf7('0x21')](_0x8a9f73));if(_0x8a9f73[_0x6bf7('0x22')]){if(_0x8a9f73[_0x6bf7('0x22')][_0x6bf7('0x23')]===0x1f4){logger[_0x6bf7('0x22')]('OpenchannelMessage,\x20%s,\x20%s',_0x3f1587,_0x8a9f73[_0x6bf7('0x22')]['message']);return _0x252d78(_0x8a9f73[_0x6bf7('0x22')]['message']);}logger[_0x6bf7('0x22')](_0x6bf7('0x1e'),_0x3f1587,_0x8a9f73[_0x6bf7('0x22')][_0x6bf7('0x24')]);return _0x5b830e(_0x8a9f73[_0x6bf7('0x22')][_0x6bf7('0x24')]);}else{logger['info'](_0x6bf7('0x1e'),_0x3f1587,_0x6bf7('0x20'));_0x5b830e(_0x8a9f73['result'][_0x6bf7('0x24')]);}})[_0x6bf7('0x25')](function(_0x31f18b){logger[_0x6bf7('0x22')]('OpenchannelMessage,\x20%s,\x20%s',_0x3f1587,_0x31f18b);_0x252d78(_0x31f18b);});});}function respondWithStatusCode(_0x4597f1,_0x5646ea){_0x5646ea=_0x5646ea||0xcc;return function(_0x6f4986){if(_0x6f4986){return _0x4597f1[_0x6bf7('0x26')](_0x5646ea);}return _0x4597f1[_0x6bf7('0x27')](_0x5646ea)[_0x6bf7('0x28')]();};}function respondWithResult(_0x58c3c7,_0x660b3f){_0x660b3f=_0x660b3f||0xc8;return function(_0xd29323){if(_0xd29323){return _0x58c3c7[_0x6bf7('0x27')](_0x660b3f)[_0x6bf7('0x29')](_0xd29323);}};}function respondWithFilteredResult(_0x392056,_0x2662f3){return function(_0x18d231){if(_0x18d231){var _0x55a959=_0x18d231['count'],_0x18d3c0=_0x2662f3['offset'],_0x5d9898=_0x2662f3[_0x6bf7('0x2a')]+_0x2662f3[_0x6bf7('0x2b')],_0x199e87;if(_0x5d9898>=_0x55a959){_0x5d9898=_0x55a959;_0x199e87=0xc8;}else{_0x199e87=0xce;}_0x392056[_0x6bf7('0x27')](_0x199e87);return _0x392056[_0x6bf7('0x2c')](_0x6bf7('0x2d'),_0x18d3c0+'-'+_0x5d9898+'/'+_0x55a959)['json'](_0x18d231);}return null;};}function patchUpdates(_0x21e66b){return function(_0x284016){try{jsonpatch['apply'](_0x284016,_0x21e66b,!![]);}catch(_0x18da59){return BPromise[_0x6bf7('0x2e')](_0x18da59);}return _0x284016[_0x6bf7('0x2f')]();};}function saveUpdates(_0x294063,_0x45edd4){return function(_0x1887c6){if(_0x1887c6){return _0x1887c6[_0x6bf7('0x30')](_0x294063)['then'](function(_0x514704){return _0x514704;});}return null;};}function removeEntity(_0x390d85,_0x32665a){return function(_0x3bee4e){if(_0x3bee4e){return _0x3bee4e[_0x6bf7('0x31')]()[_0x6bf7('0x1c')](function(){_0x390d85[_0x6bf7('0x27')](0xcc)['end']();});}};}function handleEntityNotFound(_0x333274,_0x3bdb6b){return function(_0x535724){if(!_0x535724){_0x333274[_0x6bf7('0x26')](0x194);}return _0x535724;};}function handleError(_0x1c1257,_0x7661af){_0x7661af=_0x7661af||0x1f4;return function(_0x4dd74d){logger[_0x6bf7('0x22')](_0x4dd74d[_0x6bf7('0x32')]);if(_0x4dd74d[_0x6bf7('0x33')]){delete _0x4dd74d[_0x6bf7('0x33')];}_0x1c1257[_0x6bf7('0x27')](_0x7661af)[_0x6bf7('0x34')](_0x4dd74d);};}exports[_0x6bf7('0x35')]=function(_0x9c1e68,_0x5594ce){var _0x4e643c={},_0x15422e={},_0x4c6305={'count':0x0,'rows':[]};var _0x52411b=_[_0x6bf7('0x36')](db[_0x6bf7('0x37')][_0x6bf7('0x38')],function(_0x10022b){return{'name':_0x10022b[_0x6bf7('0x39')],'type':_0x10022b[_0x6bf7('0x3a')]['key']};});_0x15422e[_0x6bf7('0x3b')]=_[_0x6bf7('0x36')](_0x52411b,'name');_0x15422e['query']=_[_0x6bf7('0x3c')](_0x9c1e68[_0x6bf7('0x3d')]);_0x15422e[_0x6bf7('0x3e')]=_[_0x6bf7('0x3f')](_0x15422e[_0x6bf7('0x3b')],_0x15422e[_0x6bf7('0x3d')]);_0x4e643c[_0x6bf7('0x40')]=_[_0x6bf7('0x3f')](_0x15422e[_0x6bf7('0x3b')],qs[_0x6bf7('0x41')](_0x9c1e68[_0x6bf7('0x3d')][_0x6bf7('0x41')]));_0x4e643c['attributes']=_0x4e643c[_0x6bf7('0x40')][_0x6bf7('0x42')]?_0x4e643c[_0x6bf7('0x40')]:_0x15422e[_0x6bf7('0x3b')];if(!_0x9c1e68['query']['hasOwnProperty']('nolimit')){_0x4e643c['limit']=qs[_0x6bf7('0x2b')](_0x9c1e68['query'][_0x6bf7('0x2b')]);_0x4e643c[_0x6bf7('0x2a')]=qs[_0x6bf7('0x2a')](_0x9c1e68[_0x6bf7('0x3d')][_0x6bf7('0x2a')]);}_0x4e643c[_0x6bf7('0x43')]=qs[_0x6bf7('0x44')](_0x9c1e68[_0x6bf7('0x3d')][_0x6bf7('0x44')]);_0x4e643c[_0x6bf7('0x45')]=qs[_0x6bf7('0x3e')](_[_0x6bf7('0x46')](_0x9c1e68['query'],_0x15422e[_0x6bf7('0x3e')]));if(_0x9c1e68['query']['filter']){_0x4e643c['where']=_[_0x6bf7('0x47')](_0x4e643c[_0x6bf7('0x45')],{'$or':_[_0x6bf7('0x36')](_0x52411b,function(_0x1740a3){if(_0x1740a3['type']!==_0x6bf7('0x48')){var _0x198a13={};_0x198a13[_0x1740a3[_0x6bf7('0x33')]]={'$like':'%'+_0x9c1e68[_0x6bf7('0x3d')]['filter']+'%'};return _0x198a13;}})});}_0x4e643c=_[_0x6bf7('0x47')]({},_0x4e643c,_0x9c1e68[_0x6bf7('0x49')]);var _0x597749={'where':_0x4e643c[_0x6bf7('0x45')]};return db[_0x6bf7('0x37')][_0x6bf7('0x4a')](_0x597749)[_0x6bf7('0x1c')](function(_0xb97118){_0x4c6305[_0x6bf7('0x4a')]=_0xb97118;if(_0x9c1e68[_0x6bf7('0x3d')][_0x6bf7('0x4b')]){_0x4e643c['include']=[{'all':!![]}];}return db[_0x6bf7('0x37')]['findAll'](_0x4e643c);})[_0x6bf7('0x1c')](function(_0x2dbf85){_0x4c6305['rows']=_0x2dbf85;return _0x4c6305;})[_0x6bf7('0x1c')](respondWithFilteredResult(_0x5594ce,_0x4e643c))[_0x6bf7('0x25')](handleError(_0x5594ce,null));};exports[_0x6bf7('0x4c')]=function(_0x41e605,_0x597683){var _0x4b46ef={'raw':!![],'where':{'id':_0x41e605[_0x6bf7('0x4d')]['id']}},_0x241697={};_0x241697['model']=_[_0x6bf7('0x3c')](db[_0x6bf7('0x37')][_0x6bf7('0x38')]);_0x241697[_0x6bf7('0x3d')]=_[_0x6bf7('0x3c')](_0x41e605[_0x6bf7('0x3d')]);_0x241697['filters']=_[_0x6bf7('0x3f')](_0x241697['model'],_0x241697['query']);_0x4b46ef[_0x6bf7('0x40')]=_[_0x6bf7('0x3f')](_0x241697[_0x6bf7('0x3b')],qs[_0x6bf7('0x41')](_0x41e605['query']['fields']));_0x4b46ef[_0x6bf7('0x40')]=_0x4b46ef[_0x6bf7('0x40')]['length']?_0x4b46ef[_0x6bf7('0x40')]:_0x241697['model'];if(_0x41e605[_0x6bf7('0x3d')][_0x6bf7('0x4b')]){_0x4b46ef[_0x6bf7('0x4e')]=[{'all':!![]}];}_0x4b46ef=_[_0x6bf7('0x47')]({},_0x4b46ef,_0x41e605[_0x6bf7('0x49')]);return db[_0x6bf7('0x37')][_0x6bf7('0x4f')](_0x4b46ef)[_0x6bf7('0x1c')](handleEntityNotFound(_0x597683,null))[_0x6bf7('0x1c')](respondWithResult(_0x597683,null))[_0x6bf7('0x25')](handleError(_0x597683,null));};exports['create']=function(_0x927bef,_0x1b199d){return db[_0x6bf7('0x37')][_0x6bf7('0x50')](_0x927bef[_0x6bf7('0x51')],{})[_0x6bf7('0x1c')](respondWithResult(_0x1b199d,0xc9))[_0x6bf7('0x25')](handleError(_0x1b199d,null));};exports['update']=function(_0xe8a4de,_0x2c3ba0){if(_0xe8a4de[_0x6bf7('0x51')]['id']){delete _0xe8a4de[_0x6bf7('0x51')]['id'];}return db[_0x6bf7('0x37')][_0x6bf7('0x4f')]({'where':{'id':_0xe8a4de[_0x6bf7('0x4d')]['id']}})[_0x6bf7('0x1c')](handleEntityNotFound(_0x2c3ba0,null))[_0x6bf7('0x1c')](saveUpdates(_0xe8a4de[_0x6bf7('0x51')],null))[_0x6bf7('0x1c')](respondWithResult(_0x2c3ba0,null))[_0x6bf7('0x25')](handleError(_0x2c3ba0,null));};exports[_0x6bf7('0x31')]=function(_0x23d3a2,_0x323156){return db[_0x6bf7('0x37')]['find']({'where':{'id':_0x23d3a2[_0x6bf7('0x4d')]['id']}})[_0x6bf7('0x1c')](handleEntityNotFound(_0x323156,null))[_0x6bf7('0x1c')](removeEntity(_0x323156,null))['catch'](handleError(_0x323156,null));};exports['describe']=function(_0x13eeda,_0x126291){return db[_0x6bf7('0x37')]['describe']()[_0x6bf7('0x1c')](respondWithResult(_0x126291,null))[_0x6bf7('0x25')](handleError(_0x126291,null));};var interaction_log=require('../../config/logger')(_0x6bf7('0x52'));exports[_0x6bf7('0x53')]=function(_0x1e16ea,_0x480949,_0x566dbb){var _0x103898={'channel':_0x6bf7('0x54')};if(_0x1e16ea[_0x6bf7('0x51')]['id']){delete _0x1e16ea[_0x6bf7('0x51')]['id'];}_0x1e16ea[_0x6bf7('0x51')][_0x6bf7('0x55')]=!![];_0x1e16ea['body'][_0x6bf7('0x56')]=moment()[_0x6bf7('0x57')](_0x6bf7('0x58'));_0x1e16ea['body'][_0x6bf7('0x59')]=_0x1e16ea['body']['UserId']||_0x1e16ea[_0x6bf7('0x5a')]['id'];return db[_0x6bf7('0x37')][_0x6bf7('0x4f')]({'where':{'id':_0x1e16ea[_0x6bf7('0x4d')]['id'],'UserId':null},'include':[{'model':db[_0x6bf7('0x5b')],'as':'Contact'}]})[_0x6bf7('0x1c')](handleEntityNotFound(_0x480949,null))[_0x6bf7('0x1c')](saveUpdates(_0x1e16ea[_0x6bf7('0x51')],null))[_0x6bf7('0x1c')](function(_0x373de2){if(_0x373de2){_0x103898['message']=_0x373de2[_0x6bf7('0x5c')]({'plain':!![]});return db[_0x6bf7('0x5d')][_0x6bf7('0x4f')]({'where':{'id':_0x373de2[_0x6bf7('0x5e')]}});}return null;})[_0x6bf7('0x1c')](handleEntityNotFound(_0x480949,null))['then'](function(_0x353b7c){if(_0x353b7c){return _0x353b7c['update']({'UserId':_0x1e16ea['body'][_0x6bf7('0x59')],'read1stAt':_[_0x6bf7('0x5f')](_0x353b7c[_0x6bf7('0x60')])?moment()[_0x6bf7('0x57')](_0x6bf7('0x58')):undefined});}return null;})[_0x6bf7('0x1c')](function(_0x4c2eb9){if(_0x4c2eb9){_0x103898['interaction']=_0x4c2eb9[_0x6bf7('0x5c')]({'plain':!![]});interaction_log[_0x6bf7('0x1d')](_0x6bf7('0x61'),_0x1e16ea[_0x6bf7('0x5a')]['id'],_0x1e16ea[_0x6bf7('0x5a')][_0x6bf7('0x33')],_0x1e16ea[_0x6bf7('0x5a')][_0x6bf7('0x62')],_0x103898['interaction']['id'],_0x1e16ea[_0x6bf7('0x51')]?JSON[_0x6bf7('0x21')](_0x1e16ea[_0x6bf7('0x51')]):_0x6bf7('0x63'));return respondWithRpcPromise('AcceptMessage',_0x6bf7('0x64'),_0x103898);}return null;})[_0x6bf7('0x1c')](function(_0x4aa8d2){if(_0x4aa8d2){if(_0x1e16ea[_0x6bf7('0x51')][_0x6bf7('0x65')]){_0x103898[_0x6bf7('0x24')][_0x6bf7('0x66')]=util['format'](_0x6bf7('0x67'),_0x1e16ea[_0x6bf7('0x5a')][_0x6bf7('0x33')]);_0x103898['message']['channel']=_0x103898[_0x6bf7('0x68')];_0x103898[_0x6bf7('0x24')][_0x6bf7('0x69')]=_0x6bf7('0x53');return respondWithRpcPromise('EventManager',_0x6bf7('0x6a'),{'event':_0x6bf7('0x6b'),'message':_0x103898[_0x6bf7('0x24')]},client9002)[_0x6bf7('0x1c')](function(){return _0x103898;});}return _0x103898;}return null;})[_0x6bf7('0x1c')](respondWithResult(_0x480949,null))[_0x6bf7('0x25')](handleError(_0x480949,null));};var interaction_log=require(_0x6bf7('0x6c'))('openchannel-interactions');exports[_0x6bf7('0x2e')]=function(_0x2152ab,_0x2f534b,_0x52ed93){var _0x5e3e3f={'agent':{},'channel':_0x6bf7('0x54')};if(_0x2152ab[_0x6bf7('0x51')]['id']){delete _0x2152ab[_0x6bf7('0x51')]['id'];}_0x2152ab[_0x6bf7('0x51')]['UserId']=_0x2152ab['body'][_0x6bf7('0x59')]||_0x2152ab[_0x6bf7('0x5a')]['id'];_0x5e3e3f['agent']['id']=_0x2152ab[_0x6bf7('0x51')][_0x6bf7('0x59')];return db[_0x6bf7('0x37')][_0x6bf7('0x4f')]({'where':{'id':_0x2152ab[_0x6bf7('0x4d')]['id'],'UserId':null}})[_0x6bf7('0x1c')](handleEntityNotFound(_0x2f534b,null))['then'](function(_0x2bf957){if(_0x2bf957){_0x5e3e3f[_0x6bf7('0x24')]=_0x2bf957['get']({'plain':!![]});return db['OpenchannelInteraction'][_0x6bf7('0x4f')]({'where':{'id':_0x2bf957[_0x6bf7('0x5e')]}});}return null;})['then'](handleEntityNotFound(_0x2f534b,null))[_0x6bf7('0x1c')](function(_0x5108ac){if(_0x5108ac){_0x5e3e3f[_0x6bf7('0x6d')]=_0x5108ac['get']({'plain':!![]});interaction_log[_0x6bf7('0x1d')](_0x6bf7('0x6e'),_0x2152ab[_0x6bf7('0x5a')]['id'],_0x2152ab[_0x6bf7('0x5a')][_0x6bf7('0x33')],_0x2152ab['user'][_0x6bf7('0x62')],_0x5e3e3f[_0x6bf7('0x6d')]['id'],_0x2152ab['body']?JSON[_0x6bf7('0x21')](_0x2152ab[_0x6bf7('0x51')]):'null');return respondWithRpcPromise(_0x6bf7('0x6f'),_0x6bf7('0x70'),_0x5e3e3f);}return null;})['then'](function(_0x3f97ed){if(_0x3f97ed){_0x3f97ed[_0x6bf7('0x24')]['interface']=util['format'](_0x6bf7('0x67'),_0x2152ab[_0x6bf7('0x5a')][_0x6bf7('0x33')]);_0x3f97ed[_0x6bf7('0x24')]['channel']=_0x5e3e3f[_0x6bf7('0x68')];_0x3f97ed[_0x6bf7('0x24')][_0x6bf7('0x69')]='reject';respondWithRpcPromise(_0x6bf7('0x6a'),_0x6bf7('0x6a'),{'event':_0x6bf7('0x71'),'message':_0x3f97ed[_0x6bf7('0x24')]},client9002);return _0x5e3e3f;}return null;})[_0x6bf7('0x1c')](respondWithResult(_0x2f534b,null))[_0x6bf7('0x25')](handleError(_0x2f534b,null));};
\ No newline at end of file
diff --git a/server/api/openchannelMessage/openchannelMessage.events.js b/server/api/openchannelMessage/openchannelMessage.events.js
index 559a7e0..18a1ff2 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 _0x0f70=['../../mysqldb','OpenchannelMessage','setMaxListeners','update','remove','emit','hasOwnProperty','hook','exports','events'];(function(_0x3d2012,_0x3d02b9){var _0x53d542=function(_0x8f2be8){while(--_0x8f2be8){_0x3d2012['push'](_0x3d2012['shift']());}};_0x53d542(++_0x3d02b9);}(_0x0f70,0x1d5));var _0x00f7=function(_0x43b88c,_0x46fb04){_0x43b88c=_0x43b88c-0x0;var _0x407299=_0x0f70[_0x43b88c];return _0x407299;};'use strict';var EventEmitter=require(_0x00f7('0x0'));var OpenchannelMessage=require(_0x00f7('0x1'))['db'][_0x00f7('0x2')];var OpenchannelMessageEvents=new EventEmitter();OpenchannelMessageEvents[_0x00f7('0x3')](0x0);var events={'afterCreate':'save','afterUpdate':_0x00f7('0x4'),'afterDestroy':_0x00f7('0x5')};function emitEvent(_0xc5c5c7){return function(_0x50d09d,_0x528c19,_0x493d3e){OpenchannelMessageEvents[_0x00f7('0x6')](_0xc5c5c7+':'+_0x50d09d['id'],_0x50d09d);OpenchannelMessageEvents[_0x00f7('0x6')](_0xc5c5c7,_0x50d09d);_0x493d3e(null);};}for(var e in events){if(events[_0x00f7('0x7')](e)){var event=events[e];OpenchannelMessage[_0x00f7('0x8')](e,emitEvent(event));}}module[_0x00f7('0x9')]=OpenchannelMessageEvents;
\ No newline at end of file
+var _0xb660=['exports','events','../../mysqldb','setMaxListeners','save','update','remove','emit','hasOwnProperty'];(function(_0x435f7c,_0x3c50e5){var _0x11be96=function(_0x4b91e3){while(--_0x4b91e3){_0x435f7c['push'](_0x435f7c['shift']());}};_0x11be96(++_0x3c50e5);}(_0xb660,0xeb));var _0x0b66=function(_0x4bfc64,_0x25976d){_0x4bfc64=_0x4bfc64-0x0;var _0x5d8f2a=_0xb660[_0x4bfc64];return _0x5d8f2a;};'use strict';var EventEmitter=require(_0x0b66('0x0'));var OpenchannelMessage=require(_0x0b66('0x1'))['db']['OpenchannelMessage'];var OpenchannelMessageEvents=new EventEmitter();OpenchannelMessageEvents[_0x0b66('0x2')](0x0);var events={'afterCreate':_0x0b66('0x3'),'afterUpdate':_0x0b66('0x4'),'afterDestroy':_0x0b66('0x5')};function emitEvent(_0x42b9e7){return function(_0x5283c0,_0x5a5c43,_0x13f475){OpenchannelMessageEvents[_0x0b66('0x6')](_0x42b9e7+':'+_0x5283c0['id'],_0x5283c0);OpenchannelMessageEvents[_0x0b66('0x6')](_0x42b9e7,_0x5283c0);_0x13f475(null);};}for(var e in events){if(events[_0x0b66('0x7')](e)){var event=events[e];OpenchannelMessage['hook'](e,emitEvent(event));}}module[_0x0b66('0x8')]=OpenchannelMessageEvents;
\ No newline at end of file
diff --git a/server/api/openchannelMessage/openchannelMessage.model.js b/server/api/openchannelMessage/openchannelMessage.model.js
index a3b8cd9..c8bc2e4 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 _0x951f=['describe','OpenchannelAccount','find','OpenchannelAccountId','OpenchannelInteractionId','keys','get','replyUri','OpenchannelMessage,\x20%s,\x20%s','afterCreate','format','Forwarding\x20message\x20%d\x20to\x20%s','Interactions','length','omit','Contact','method','GET','POST','then','info','threadId','body','inspect','utf8mb4_unicode_ci','lodash','util','../../config/logger','api','bluebird','request-promise','path','rimraf','../../config/environment','exports','OpenchannelMessage','FULLTEXT','models','toLowerCase','direction','secret','UserId','OpenchannelInteraction','findOne','update','createdAt','catch','error','out'];(function(_0x59ee6f,_0x450239){var _0x4c0979=function(_0x565e92){while(--_0x565e92){_0x59ee6f['push'](_0x59ee6f['shift']());}};_0x4c0979(++_0x450239);}(_0x951f,0x13f));var _0xf951=function(_0x344a3f,_0x579a22){_0x344a3f=_0x344a3f-0x0;var _0x264712=_0x951f[_0x344a3f];return _0x264712;};'use strict';var _=require(_0xf951('0x0'));var util=require(_0xf951('0x1'));var logger=require(_0xf951('0x2'))(_0xf951('0x3'));var moment=require('moment');var BPromise=require(_0xf951('0x4'));var rp=require(_0xf951('0x5'));var fs=require('fs');var path=require(_0xf951('0x6'));var rimraf=require(_0xf951('0x7'));var config=require(_0xf951('0x8'));var attributes=require('./openchannelMessage.attributes');module[_0xf951('0x9')]=function(_0x56a7f2,_0x108a38){return _0x56a7f2['define'](_0xf951('0xa'),attributes,{'tableName':'openchannel_messages','paranoid':![],'indexes':[{'name':'fti_openchannel_messages','fields':['body'],'type':_0xf951('0xb')}],'timestamps':!![],'hooks':{'afterCreate':function(_0x209a28,_0x37d0a1,_0x14c2e0){var _0x3aed2d=_0x56a7f2[_0xf951('0xc')];var _0xa3fbcb=_0x209a28['get']({'plain':!![]});if(_0xa3fbcb['direction'][_0xf951('0xd')]()==='in'||_0xa3fbcb[_0xf951('0xe')][_0xf951('0xd')]()==='out'&&!_0xa3fbcb[_0xf951('0xf')]&&!_['isNil'](_0xa3fbcb[_0xf951('0x10')])){_0x3aed2d[_0xf951('0x11')][_0xf951('0x12')]({'where':{'id':_0xa3fbcb['OpenchannelInteractionId']}})['then'](function(_0x24f3d9){if(_0x24f3d9){_0x24f3d9[_0xf951('0x13')]({'lastMsgAt':_0xa3fbcb[_0xf951('0x14')],'lastMsgDirection':_0xa3fbcb[_0xf951('0xe')][_0xf951('0xd')]()});}})[_0xf951('0x15')](function(_0x4bda00){console[_0xf951('0x16')](_0x4bda00);});}if(_0xa3fbcb[_0xf951('0xe')]===_0xf951('0x17')&&!_0xa3fbcb['secret']){var _0x9bf741;_0x3aed2d['CmContact'][_0xf951('0x18')]()['then'](function(_0xd3a90f){return _0x3aed2d[_0xf951('0x19')][_0xf951('0x1a')]({'where':{'id':_0xa3fbcb[_0xf951('0x1b')]},'include':[{'model':_0x3aed2d[_0xf951('0x11')],'as':'Interactions','where':{'id':_0xa3fbcb[_0xf951('0x1c')]},'limit':0x1,'include':[{'model':_0x3aed2d['CmContact'],'as':'Contact','attributes':_[_0xf951('0x1d')](_0xd3a90f)}]}]});})['then'](function(_0x5421f3){_0x9bf741=_0x5421f3[_0xf951('0x1e')]({'plain':!![]});if(_0x9bf741&&_0x9bf741[_0xf951('0x1f')]){logger['info'](_0xf951('0x20'),_0xf951('0x21'),util[_0xf951('0x22')](_0xf951('0x23'),_0xa3fbcb['id'],_0x9bf741[_0xf951('0x1f')]));if(_0x9bf741[_0xf951('0x24')]&&_0x9bf741[_0xf951('0x24')][_0xf951('0x25')]){_0xa3fbcb['Interaction']=_[_0xf951('0x26')](_0x9bf741[_0xf951('0x24')][0x0],_0xf951('0x27'));_0xa3fbcb['Contact']=_0x9bf741[_0xf951('0x24')][0x0][_0xf951('0x27')];}var _0x37d0a1={'method':'POST','uri':encodeURI(_0x9bf741[_0xf951('0x1f')]),'json':!![],'resolveWithFullResponse':!![]};switch(_0x37d0a1[_0xf951('0x28')]){case _0xf951('0x29'):_0x37d0a1['qs']=_0xa3fbcb;break;case _0xf951('0x2a'):_0x37d0a1['body']=_0xa3fbcb;break;}return rp(_0x37d0a1)[_0xf951('0x2b')](function(_0x3cd83a){logger[_0xf951('0x2c')](_0xf951('0x20'),_0xf951('0x21'),util['format']('Message\x20%d\x20forwarded\x20to\x20%s',_0xa3fbcb['id'],_0x9bf741[_0xf951('0x1f')]));if(_0x3cd83a['body'][_0xf951('0x2d')]&&_0x3cd83a[_0xf951('0x2e')][_0xf951('0x2d')]!=_0xa3fbcb['Interaction']['threadId']){return _0x3aed2d[_0xf951('0x11')][_0xf951('0x13')]({'threadId':_0x3cd83a[_0xf951('0x2e')][_0xf951('0x2d')]},{'logging':!![],'where':{'id':_0xa3fbcb['Interaction']['id']}});}else{return;}})['then'](function(){return _0x209a28[_0xf951('0x13')]({'read':!![]});})[_0xf951('0x15')](function(_0x2fc8fc){logger['error'](_0xf951('0x20'),'afterCreate',util[_0xf951('0x2f')](_0x2fc8fc,{'showHidden':![],'depth':null}));_0x14c2e0();});}else{_0x14c2e0();}})['finally'](function(){_0x14c2e0();});}else{_0x14c2e0();}}},'charset':'utf8mb4','collate':_0xf951('0x30')});};
\ No newline at end of file
+var _0x257d=['exports','OpenchannelMessage','openchannel_messages','body','FULLTEXT','models','get','toLowerCase','direction','secret','isNil','UserId','OpenchannelInteraction','then','createdAt','catch','error','out','describe','OpenchannelAccount','find','OpenchannelAccountId','Interactions','OpenchannelInteractionId','CmContact','keys','OpenchannelMessage,\x20%s,\x20%s','afterCreate','format','Forwarding\x20message\x20%d\x20to\x20%s','length','omit','Contact','replyUri','method','GET','POST','info','threadId','Interaction','update','inspect','finally','utf8mb4_unicode_ci','../../config/logger','moment','bluebird','request-promise','path','rimraf','../../config/environment','./openchannelMessage.attributes'];(function(_0x3a3e88,_0x4801a0){var _0x1f4fc8=function(_0x1536a4){while(--_0x1536a4){_0x3a3e88['push'](_0x3a3e88['shift']());}};_0x1f4fc8(++_0x4801a0);}(_0x257d,0x198));var _0xd257=function(_0x4ed10a,_0x1f4a61){_0x4ed10a=_0x4ed10a-0x0;var _0x425f5a=_0x257d[_0x4ed10a];return _0x425f5a;};'use strict';var _=require('lodash');var util=require('util');var logger=require(_0xd257('0x0'))('api');var moment=require(_0xd257('0x1'));var BPromise=require(_0xd257('0x2'));var rp=require(_0xd257('0x3'));var fs=require('fs');var path=require(_0xd257('0x4'));var rimraf=require(_0xd257('0x5'));var config=require(_0xd257('0x6'));var attributes=require(_0xd257('0x7'));module[_0xd257('0x8')]=function(_0x43fdfe,_0x46372b){return _0x43fdfe['define'](_0xd257('0x9'),attributes,{'tableName':_0xd257('0xa'),'paranoid':![],'indexes':[{'name':'fti_openchannel_messages','fields':[_0xd257('0xb')],'type':_0xd257('0xc')}],'timestamps':!![],'hooks':{'afterCreate':function(_0xa01ac2,_0xccde71,_0x19a614){var _0x742ff5=_0x43fdfe[_0xd257('0xd')];var _0x82aa58=_0xa01ac2[_0xd257('0xe')]({'plain':!![]});if(_0x82aa58['direction'][_0xd257('0xf')]()==='in'||_0x82aa58[_0xd257('0x10')][_0xd257('0xf')]()==='out'&&!_0x82aa58[_0xd257('0x11')]&&!_[_0xd257('0x12')](_0x82aa58[_0xd257('0x13')])){_0x742ff5[_0xd257('0x14')]['findOne']({'where':{'id':_0x82aa58['OpenchannelInteractionId']}})[_0xd257('0x15')](function(_0x24148d){if(_0x24148d){_0x24148d['update']({'lastMsgAt':_0x82aa58[_0xd257('0x16')],'lastMsgDirection':_0x82aa58[_0xd257('0x10')]['toLowerCase']()});}})[_0xd257('0x17')](function(_0x2e6815){console[_0xd257('0x18')](_0x2e6815);});}if(_0x82aa58[_0xd257('0x10')]===_0xd257('0x19')&&!_0x82aa58[_0xd257('0x11')]){var _0x5e9c37;_0x742ff5['CmContact'][_0xd257('0x1a')]()[_0xd257('0x15')](function(_0x32fc1a){return _0x742ff5[_0xd257('0x1b')][_0xd257('0x1c')]({'where':{'id':_0x82aa58[_0xd257('0x1d')]},'include':[{'model':_0x742ff5[_0xd257('0x14')],'as':_0xd257('0x1e'),'where':{'id':_0x82aa58[_0xd257('0x1f')]},'limit':0x1,'include':[{'model':_0x742ff5[_0xd257('0x20')],'as':'Contact','attributes':_[_0xd257('0x21')](_0x32fc1a)}]}]});})[_0xd257('0x15')](function(_0x7dec0){_0x5e9c37=_0x7dec0['get']({'plain':!![]});if(_0x5e9c37&&_0x5e9c37['replyUri']){logger['info'](_0xd257('0x22'),_0xd257('0x23'),util[_0xd257('0x24')](_0xd257('0x25'),_0x82aa58['id'],_0x5e9c37['replyUri']));if(_0x5e9c37['Interactions']&&_0x5e9c37[_0xd257('0x1e')][_0xd257('0x26')]){_0x82aa58['Interaction']=_[_0xd257('0x27')](_0x5e9c37[_0xd257('0x1e')][0x0],_0xd257('0x28'));_0x82aa58[_0xd257('0x28')]=_0x5e9c37[_0xd257('0x1e')][0x0][_0xd257('0x28')];}var _0xccde71={'method':'POST','uri':encodeURI(_0x5e9c37[_0xd257('0x29')]),'json':!![],'resolveWithFullResponse':!![]};switch(_0xccde71[_0xd257('0x2a')]){case _0xd257('0x2b'):_0xccde71['qs']=_0x82aa58;break;case _0xd257('0x2c'):_0xccde71['body']=_0x82aa58;break;}return rp(_0xccde71)[_0xd257('0x15')](function(_0x23b1ef){logger[_0xd257('0x2d')](_0xd257('0x22'),_0xd257('0x23'),util[_0xd257('0x24')]('Message\x20%d\x20forwarded\x20to\x20%s',_0x82aa58['id'],_0x5e9c37['replyUri']));if(_0x23b1ef[_0xd257('0xb')][_0xd257('0x2e')]&&_0x23b1ef[_0xd257('0xb')][_0xd257('0x2e')]!=_0x82aa58['Interaction'][_0xd257('0x2e')]){return _0x742ff5['OpenchannelInteraction']['update']({'threadId':_0x23b1ef[_0xd257('0xb')][_0xd257('0x2e')]},{'logging':!![],'where':{'id':_0x82aa58[_0xd257('0x2f')]['id']}});}else{return;}})[_0xd257('0x15')](function(){return _0xa01ac2[_0xd257('0x30')]({'read':!![]});})[_0xd257('0x17')](function(_0x150048){logger[_0xd257('0x18')](_0xd257('0x22'),_0xd257('0x23'),util[_0xd257('0x31')](_0x150048,{'showHidden':![],'depth':null}));_0x19a614();});}else{_0x19a614();}})[_0xd257('0x32')](function(){_0x19a614();});}else{_0x19a614();}}},'charset':'utf8mb4','collate':_0xd257('0x33')});};
\ No newline at end of file
diff --git a/server/api/openchannelMessage/openchannelMessage.rpc.js b/server/api/openchannelMessage/openchannelMessage.rpc.js
index 4f24af4..ea8831f 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 _0x7c1a=['create','body','options','raw','then','lodash','util','moment','bluebird','randomstring','ioredis','../../config/utils','../../config/logger','../../config/environment','client','http','redis','defaults','socket.io-emitter','./openchannelMessage.socket','request','info','request\x20sent','debug','OpenchannelMessage,\x20%s,\x20%s,\x20%s','stringify','error','code','OpenchannelMessage,\x20%s,\x20%s','message','result','catch','CreateOpenchannelMessage','OpenchannelMessage'];(function(_0x4b055c,_0x4b870b){var _0x4b62bb=function(_0x4884c2){while(--_0x4884c2){_0x4b055c['push'](_0x4b055c['shift']());}};_0x4b62bb(++_0x4b870b);}(_0x7c1a,0x159));var _0xa7c1=function(_0x42f423,_0x3249f5){_0x42f423=_0x42f423-0x0;var _0x167993=_0x7c1a[_0x42f423];return _0x167993;};'use strict';var _=require(_0xa7c1('0x0'));var util=require(_0xa7c1('0x1'));var moment=require(_0xa7c1('0x2'));var BPromise=require(_0xa7c1('0x3'));var rs=require(_0xa7c1('0x4'));var fs=require('fs');var Redis=require(_0xa7c1('0x5'));var db=require('../../mysqldb')['db'];var utils=require(_0xa7c1('0x6'));var logger=require(_0xa7c1('0x7'))('rpc');var config=require(_0xa7c1('0x8'));var jayson=require('jayson/promise');var client=jayson[_0xa7c1('0x9')][_0xa7c1('0xa')]({'port':0x232a});config[_0xa7c1('0xb')]=_[_0xa7c1('0xc')](config['redis'],{'host':'localhost','port':0x18eb});var socket=require(_0xa7c1('0xd'))(new Redis(config[_0xa7c1('0xb')]));require(_0xa7c1('0xe'))['register'](socket);function respondWithRpcPromise(_0x3cdeaa,_0x16bf94,_0x359454){return new BPromise(function(_0x4f2957,_0x169d72){return client[_0xa7c1('0xf')](_0x3cdeaa,_0x359454)['then'](function(_0x309790){logger[_0xa7c1('0x10')]('OpenchannelMessage,\x20%s,\x20%s',_0x16bf94,_0xa7c1('0x11'));logger[_0xa7c1('0x12')](_0xa7c1('0x13'),_0x16bf94,_0xa7c1('0x11'),JSON[_0xa7c1('0x14')](_0x309790));if(_0x309790[_0xa7c1('0x15')]){if(_0x309790[_0xa7c1('0x15')][_0xa7c1('0x16')]===0x1f4){logger[_0xa7c1('0x15')](_0xa7c1('0x17'),_0x16bf94,_0x309790[_0xa7c1('0x15')][_0xa7c1('0x18')]);return _0x169d72(_0x309790[_0xa7c1('0x15')]['message']);}logger[_0xa7c1('0x15')](_0xa7c1('0x17'),_0x16bf94,_0x309790[_0xa7c1('0x15')][_0xa7c1('0x18')]);return _0x4f2957(_0x309790[_0xa7c1('0x15')]['message']);}else{logger[_0xa7c1('0x10')]('OpenchannelMessage,\x20%s,\x20%s',_0x16bf94,_0xa7c1('0x11'));_0x4f2957(_0x309790[_0xa7c1('0x19')]['message']);}})[_0xa7c1('0x1a')](function(_0x19198b){logger[_0xa7c1('0x15')]('OpenchannelMessage,\x20%s,\x20%s',_0x16bf94,_0x19198b);_0x169d72(_0x19198b);});});}exports[_0xa7c1('0x1b')]=function(_0x81396e){var _0x2fc1a7=this;return new Promise(function(_0x422447,_0x3b131e){return db[_0xa7c1('0x1c')][_0xa7c1('0x1d')](_0x81396e[_0xa7c1('0x1e')],{'raw':_0x81396e[_0xa7c1('0x1f')]?_0x81396e['options'][_0xa7c1('0x20')]===undefined?!![]:![]:!![]})[_0xa7c1('0x21')](function(_0x1ebcdd){logger['info'](_0xa7c1('0x1b'),_0x81396e);logger[_0xa7c1('0x12')](_0xa7c1('0x1b'),_0x81396e,JSON[_0xa7c1('0x14')](_0x1ebcdd));_0x422447(_0x1ebcdd);})[_0xa7c1('0x1a')](function(_0x37da75){logger[_0xa7c1('0x15')]('CreateOpenchannelMessage',_0x37da75['message'],_0x81396e);_0x3b131e(_0x2fc1a7['error'](0x1f4,_0x37da75[_0xa7c1('0x18')]));});});};
\ No newline at end of file
+var _0xa817=['request','then','info','OpenchannelMessage,\x20%s,\x20%s','debug','OpenchannelMessage,\x20%s,\x20%s,\x20%s','request\x20sent','error','code','message','result','catch','OpenchannelMessage','create','body','options','CreateOpenchannelMessage','stringify','lodash','util','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','../../config/environment','jayson/promise','http','redis','defaults','localhost','socket.io-emitter','./openchannelMessage.socket'];(function(_0x4578da,_0x167447){var _0x10c671=function(_0x40365f){while(--_0x40365f){_0x4578da['push'](_0x4578da['shift']());}};_0x10c671(++_0x167447);}(_0xa817,0x7b));var _0x7a81=function(_0x374d93,_0x3ff575){_0x374d93=_0x374d93-0x0;var _0x2bcde2=_0xa817[_0x374d93];return _0x2bcde2;};'use strict';var _=require(_0x7a81('0x0'));var util=require(_0x7a81('0x1'));var moment=require(_0x7a81('0x2'));var BPromise=require(_0x7a81('0x3'));var rs=require(_0x7a81('0x4'));var fs=require('fs');var Redis=require(_0x7a81('0x5'));var db=require(_0x7a81('0x6'))['db'];var utils=require(_0x7a81('0x7'));var logger=require(_0x7a81('0x8'))('rpc');var config=require(_0x7a81('0x9'));var jayson=require(_0x7a81('0xa'));var client=jayson['client'][_0x7a81('0xb')]({'port':0x232a});config[_0x7a81('0xc')]=_[_0x7a81('0xd')](config[_0x7a81('0xc')],{'host':_0x7a81('0xe'),'port':0x18eb});var socket=require(_0x7a81('0xf'))(new Redis(config['redis']));require(_0x7a81('0x10'))['register'](socket);function respondWithRpcPromise(_0x5ae346,_0x2b8dc7,_0x493b02){return new BPromise(function(_0x41d90b,_0x37fee1){return client[_0x7a81('0x11')](_0x5ae346,_0x493b02)[_0x7a81('0x12')](function(_0x45b768){logger[_0x7a81('0x13')](_0x7a81('0x14'),_0x2b8dc7,'request\x20sent');logger[_0x7a81('0x15')](_0x7a81('0x16'),_0x2b8dc7,_0x7a81('0x17'),JSON['stringify'](_0x45b768));if(_0x45b768[_0x7a81('0x18')]){if(_0x45b768[_0x7a81('0x18')][_0x7a81('0x19')]===0x1f4){logger[_0x7a81('0x18')](_0x7a81('0x14'),_0x2b8dc7,_0x45b768[_0x7a81('0x18')]['message']);return _0x37fee1(_0x45b768['error'][_0x7a81('0x1a')]);}logger[_0x7a81('0x18')]('OpenchannelMessage,\x20%s,\x20%s',_0x2b8dc7,_0x45b768[_0x7a81('0x18')][_0x7a81('0x1a')]);return _0x41d90b(_0x45b768[_0x7a81('0x18')][_0x7a81('0x1a')]);}else{logger[_0x7a81('0x13')](_0x7a81('0x14'),_0x2b8dc7,_0x7a81('0x17'));_0x41d90b(_0x45b768[_0x7a81('0x1b')][_0x7a81('0x1a')]);}})[_0x7a81('0x1c')](function(_0x3c3c59){logger[_0x7a81('0x18')](_0x7a81('0x14'),_0x2b8dc7,_0x3c3c59);_0x37fee1(_0x3c3c59);});});}exports['CreateOpenchannelMessage']=function(_0x13a8a8){var _0x3b17cd=this;return new Promise(function(_0x2c714c,_0x3087c0){return db[_0x7a81('0x1d')][_0x7a81('0x1e')](_0x13a8a8[_0x7a81('0x1f')],{'raw':_0x13a8a8[_0x7a81('0x20')]?_0x13a8a8[_0x7a81('0x20')]['raw']===undefined?!![]:![]:!![]})[_0x7a81('0x12')](function(_0x26b384){logger[_0x7a81('0x13')](_0x7a81('0x21'),_0x13a8a8);logger[_0x7a81('0x15')](_0x7a81('0x21'),_0x13a8a8,JSON[_0x7a81('0x22')](_0x26b384));_0x2c714c(_0x26b384);})[_0x7a81('0x1c')](function(_0x5ac0ae){logger[_0x7a81('0x18')]('CreateOpenchannelMessage',_0x5ac0ae['message'],_0x13a8a8);_0x3087c0(_0x3b17cd[_0x7a81('0x18')](0x1f4,_0x5ac0ae[_0x7a81('0x1a')]));});});};
\ No newline at end of file
diff --git a/server/api/openchannelMessage/openchannelMessage.socket.js b/server/api/openchannelMessage/openchannelMessage.socket.js
index 7a3b9b6..815c7d0 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 _0xb43b=['./openchannelMessage.events','save','update','emit','removeListener','length','openchannelMessage:'];(function(_0x4aa4e6,_0x278c45){var _0x322588=function(_0x19279d){while(--_0x19279d){_0x4aa4e6['push'](_0x4aa4e6['shift']());}};_0x322588(++_0x278c45);}(_0xb43b,0x1b2));var _0xbb43=function(_0x223d14,_0x2638b1){_0x223d14=_0x223d14-0x0;var _0x3d43d6=_0xb43b[_0x223d14];return _0x3d43d6;};'use strict';var OpenchannelMessageEvents=require(_0xbb43('0x0'));var events=[_0xbb43('0x1'),'remove',_0xbb43('0x2')];function createListener(_0x1995f8,_0x22bc86){return function(_0x4cf605){_0x22bc86[_0xbb43('0x3')](_0x1995f8,_0x4cf605);};}function removeListener(_0x41aff6,_0x351254){return function(){OpenchannelMessageEvents[_0xbb43('0x4')](_0x41aff6,_0x351254);};}exports['register']=function(_0x491fb9){for(var _0x378df5=0x0,_0x553520=events[_0xbb43('0x5')];_0x378df5<_0x553520;_0x378df5++){var _0x1ccd49=events[_0x378df5];var _0x2a2f11=createListener(_0xbb43('0x6')+_0x1ccd49,_0x491fb9);OpenchannelMessageEvents['on'](_0x1ccd49,_0x2a2f11);}};
\ No newline at end of file
+var _0x9bde=['openchannelMessage:','save','update','emit','removeListener','register','length'];(function(_0x525c7b,_0x488fcc){var _0x27b33e=function(_0x56d43b){while(--_0x56d43b){_0x525c7b['push'](_0x525c7b['shift']());}};_0x27b33e(++_0x488fcc);}(_0x9bde,0xe1));var _0xe9bd=function(_0x4d7c8f,_0x48877e){_0x4d7c8f=_0x4d7c8f-0x0;var _0x454378=_0x9bde[_0x4d7c8f];return _0x454378;};'use strict';var OpenchannelMessageEvents=require('./openchannelMessage.events');var events=[_0xe9bd('0x0'),'remove',_0xe9bd('0x1')];function createListener(_0x4c63ca,_0x51786f){return function(_0x3005aa){_0x51786f[_0xe9bd('0x2')](_0x4c63ca,_0x3005aa);};}function removeListener(_0x1c1b34,_0x10822d){return function(){OpenchannelMessageEvents[_0xe9bd('0x3')](_0x1c1b34,_0x10822d);};}exports[_0xe9bd('0x4')]=function(_0x4fd7b8){for(var _0x4763e9=0x0,_0x5f18fe=events[_0xe9bd('0x5')];_0x4763e9<_0x5f18fe;_0x4763e9++){var _0xa66ae2=events[_0x4763e9];var _0x2d5c75=createListener(_0xe9bd('0x6')+_0xa66ae2,_0x4fd7b8);OpenchannelMessageEvents['on'](_0xa66ae2,_0x2d5c75);}};
\ No newline at end of file
diff --git a/server/api/openchannelQueue/index.js b/server/api/openchannelQueue/index.js
index 0561a69..e3fc83c 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 _0x4da5=['update','delete','destroy','exports','util','path','connect-timeout','Router','../../components/interaction/service','../../config/environment','./openchannelQueue.controller','get','index','/describe','isAuthenticated','describe','/:id','show','/:id/members','getMembers','getTeams','/:id/users','getAgents','post','create','/:id/teams','addTeams','addAgents','put'];(function(_0x4b6507,_0x5518b5){var _0x2001ec=function(_0x330ddf){while(--_0x330ddf){_0x4b6507['push'](_0x4b6507['shift']());}};_0x2001ec(++_0x5518b5);}(_0x4da5,0x1b7));var _0x54da=function(_0x4c8aa1,_0x1d983f){_0x4c8aa1=_0x4c8aa1-0x0;var _0x462992=_0x4da5[_0x4c8aa1];return _0x462992;};'use strict';var multer=require('multer');var util=require(_0x54da('0x0'));var path=require(_0x54da('0x1'));var timeout=require(_0x54da('0x2'));var express=require('express');var router=express[_0x54da('0x3')]();var auth=require('../../components/auth/service');var interaction=require(_0x54da('0x4'));var config=require(_0x54da('0x5'));var controller=require(_0x54da('0x6'));router[_0x54da('0x7')]('/',auth['isAuthenticated'](),controller[_0x54da('0x8')]);router[_0x54da('0x7')](_0x54da('0x9'),auth[_0x54da('0xa')](),controller[_0x54da('0xb')]);router[_0x54da('0x7')](_0x54da('0xc'),auth['isAuthenticated'](),controller[_0x54da('0xd')]);router[_0x54da('0x7')](_0x54da('0xe'),auth['isAuthenticated'](),controller[_0x54da('0xf')]);router['get']('/:id/teams',auth[_0x54da('0xa')](),controller[_0x54da('0x10')]);router[_0x54da('0x7')](_0x54da('0x11'),auth[_0x54da('0xa')](),controller[_0x54da('0x12')]);router[_0x54da('0x13')]('/',auth[_0x54da('0xa')](),controller[_0x54da('0x14')]);router[_0x54da('0x13')](_0x54da('0x15'),auth[_0x54da('0xa')](),controller[_0x54da('0x16')]);router['post'](_0x54da('0x11'),auth[_0x54da('0xa')](),controller[_0x54da('0x17')]);router[_0x54da('0x18')]('/:id',auth[_0x54da('0xa')](),controller[_0x54da('0x19')]);router[_0x54da('0x1a')](_0x54da('0xc'),auth[_0x54da('0xa')](),controller[_0x54da('0x1b')]);router['delete'](_0x54da('0x15'),auth[_0x54da('0xa')](),controller['removeTeams']);router[_0x54da('0x1a')](_0x54da('0x11'),auth['isAuthenticated'](),controller['removeAgents']);module[_0x54da('0x1c')]=router;
\ No newline at end of file
+var _0xafdd=['../../components/auth/service','../../components/interaction/service','./openchannelQueue.controller','get','isAuthenticated','index','/describe','/:id','/:id/members','getMembers','/:id/teams','getTeams','/:id/users','post','addTeams','addAgents','put','delete','removeAgents','exports','multer','util','path','connect-timeout','express','Router'];(function(_0x1f9f37,_0x18776e){var _0x21c080=function(_0x4acb93){while(--_0x4acb93){_0x1f9f37['push'](_0x1f9f37['shift']());}};_0x21c080(++_0x18776e);}(_0xafdd,0x19a));var _0xdafd=function(_0x2e2a47,_0x43230a){_0x2e2a47=_0x2e2a47-0x0;var _0x45a9e3=_0xafdd[_0x2e2a47];return _0x45a9e3;};'use strict';var multer=require(_0xdafd('0x0'));var util=require(_0xdafd('0x1'));var path=require(_0xdafd('0x2'));var timeout=require(_0xdafd('0x3'));var express=require(_0xdafd('0x4'));var router=express[_0xdafd('0x5')]();var auth=require(_0xdafd('0x6'));var interaction=require(_0xdafd('0x7'));var config=require('../../config/environment');var controller=require(_0xdafd('0x8'));router[_0xdafd('0x9')]('/',auth[_0xdafd('0xa')](),controller[_0xdafd('0xb')]);router[_0xdafd('0x9')](_0xdafd('0xc'),auth[_0xdafd('0xa')](),controller['describe']);router[_0xdafd('0x9')](_0xdafd('0xd'),auth[_0xdafd('0xa')](),controller['show']);router[_0xdafd('0x9')](_0xdafd('0xe'),auth[_0xdafd('0xa')](),controller[_0xdafd('0xf')]);router['get'](_0xdafd('0x10'),auth[_0xdafd('0xa')](),controller[_0xdafd('0x11')]);router[_0xdafd('0x9')](_0xdafd('0x12'),auth[_0xdafd('0xa')](),controller['getAgents']);router[_0xdafd('0x13')]('/',auth['isAuthenticated'](),controller['create']);router[_0xdafd('0x13')](_0xdafd('0x10'),auth['isAuthenticated'](),controller[_0xdafd('0x14')]);router['post']('/:id/users',auth[_0xdafd('0xa')](),controller[_0xdafd('0x15')]);router[_0xdafd('0x16')](_0xdafd('0xd'),auth[_0xdafd('0xa')](),controller['update']);router[_0xdafd('0x17')](_0xdafd('0xd'),auth[_0xdafd('0xa')](),controller['destroy']);router[_0xdafd('0x17')](_0xdafd('0x10'),auth['isAuthenticated'](),controller['removeTeams']);router[_0xdafd('0x17')]('/:id/users',auth[_0xdafd('0xa')](),controller[_0xdafd('0x18')]);module[_0xdafd('0x19')]=router;
\ No newline at end of file
diff --git a/server/api/openchannelQueue/openchannelQueue.attributes.js b/server/api/openchannelQueue/openchannelQueue.attributes.js
index bda3493..5e24b48 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 _0x5009=['ENUM','rrmemory','beepall','roundrobin','sequelize','exports','STRING','name','INTEGER'];(function(_0x5d80de,_0x2cf15d){var _0x1c7556=function(_0x5bd806){while(--_0x5bd806){_0x5d80de['push'](_0x5d80de['shift']());}};_0x1c7556(++_0x2cf15d);}(_0x5009,0x1b4));var _0x9500=function(_0x4c63ee,_0x1f719d){_0x4c63ee=_0x4c63ee-0x0;var _0x172087=_0x5009[_0x4c63ee];return _0x172087;};'use strict';var Sequelize=require(_0x9500('0x0'));module[_0x9500('0x1')]={'name':{'type':Sequelize[_0x9500('0x2')],'unique':_0x9500('0x3'),'validate':{'notEmpty':!![],'is':/^[A-Za-z0-9\.\_]+$/i}},'description':{'type':Sequelize['STRING']},'timeout':{'type':Sequelize[_0x9500('0x4')],'validate':{'min':0x1,'max':0x20c49b}},'strategy':{'type':Sequelize[_0x9500('0x5')](_0x9500('0x6'),_0x9500('0x7'),_0x9500('0x8'))}};
\ No newline at end of file
+var _0x8b0e=['roundrobin','sequelize','exports','STRING','name','INTEGER','rrmemory'];(function(_0x514047,_0xce89e1){var _0x59445f=function(_0x1ce9aa){while(--_0x1ce9aa){_0x514047['push'](_0x514047['shift']());}};_0x59445f(++_0xce89e1);}(_0x8b0e,0x166));var _0xe8b0=function(_0x3333bb,_0x1df222){_0x3333bb=_0x3333bb-0x0;var _0x273d39=_0x8b0e[_0x3333bb];return _0x273d39;};'use strict';var Sequelize=require(_0xe8b0('0x0'));module[_0xe8b0('0x1')]={'name':{'type':Sequelize[_0xe8b0('0x2')],'unique':_0xe8b0('0x3'),'validate':{'notEmpty':!![],'is':/^[A-Za-z0-9\.\_]+$/i}},'description':{'type':Sequelize[_0xe8b0('0x2')]},'timeout':{'type':Sequelize[_0xe8b0('0x4')],'validate':{'min':0x1,'max':0x20c49b}},'strategy':{'type':Sequelize['ENUM'](_0xe8b0('0x5'),'beepall',_0xe8b0('0x6'))}};
\ No newline at end of file
diff --git a/server/api/openchannelQueue/openchannelQueue.controller.js b/server/api/openchannelQueue/openchannelQueue.controller.js
index 3e5d5e0..3c82ec9 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 _0xfdb0=['socket.io-emitter','register','sendStatus','status','end','json','set','apply','reject','update','then','destroy','get','OpenchannelQueues','UserProfileResource','stack','name','send','index','map','query','intersection','attributes','model','fields','length','hasOwnProperty','limit','offset','order','sort','where','filters','filter','merge','OpenchannelQueue','count','findAll','rows','catch','show','params','keys','rawAttributes','includeAll','options','body','user','Unable\x20to\x20retrieve\x20the\x20current\x20user','UserProfileSection','find','userProfileId','autoAssociation','error','describe','getMembers','findOne','UserOpenchannelQueue','nolimit','pick','OpenchannelQueueId','findAndCountAll','UserId','agent','updatedAt','createdAt','%s/%s','SIP','getTeams','Team','ids','User','online','voicePause','interface','flatMap','Agents','sequelize','transaction','each','findOrCreate','forEach','userOpenchannelQueue:save','select','field','join','user_has_teams','ut.TeamId\x20=\x20tq.TeamId','OpenchannelQueueId\x20=\x20?','clone','push','toString','every','TeamId','includes','all','union','compact','value','removeTeams','isEmpty','removeAgents','emit','userOpenchannelQueue:remove','addAgents','omit','spread','isArray','getAgents','html-pdf','eml-format','rimraf','zip-dir','request-promise','mustache','util','sox','to-csv','ejs','lodash','squel','crypto','jsforce','desk.js','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','api','../../config/utils','../../config/environment','../../mysqldb','redis','defaults'];(function(_0x5e7d0c,_0x56ba7b){var _0xc24371=function(_0x1754d4){while(--_0x1754d4){_0x5e7d0c['push'](_0x5e7d0c['shift']());}};_0xc24371(++_0x56ba7b);}(_0xfdb0,0x6d));var _0x0fdb=function(_0x4178af,_0x388652){_0x4178af=_0x4178af-0x0;var _0x20f4b1=_0xfdb0[_0x4178af];return _0x20f4b1;};'use strict';var pdf=require(_0x0fdb('0x0'));var emlformat=require(_0x0fdb('0x1'));var rimraf=require(_0x0fdb('0x2'));var zipdir=require(_0x0fdb('0x3'));var jsonpatch=require('fast-json-patch');var rp=require(_0x0fdb('0x4'));var moment=require('moment');var BPromise=require('bluebird');var Mustache=require(_0x0fdb('0x5'));var util=require(_0x0fdb('0x6'));var path=require('path');var sox=require(_0x0fdb('0x7'));var csv=require(_0x0fdb('0x8'));var ejs=require(_0x0fdb('0x9'));var fs=require('fs');var _=require(_0x0fdb('0xa'));var squel=require(_0x0fdb('0xb'));var crypto=require(_0x0fdb('0xc'));var jsforce=require(_0x0fdb('0xd'));var deskjs=require(_0x0fdb('0xe'));var toCsv=require(_0x0fdb('0x8'));var querystring=require('querystring');var Papa=require(_0x0fdb('0xf'));var Redis=require(_0x0fdb('0x10'));var authService=require(_0x0fdb('0x11'));var qs=require(_0x0fdb('0x12'));var as=require('../../components/parsers/advancedSearch');var hardwareService=require('../../config/license/hardware');var logger=require('../../config/logger')(_0x0fdb('0x13'));var utils=require(_0x0fdb('0x14'));var config=require(_0x0fdb('0x15'));var db=require(_0x0fdb('0x16'))['db'];config[_0x0fdb('0x17')]=_[_0x0fdb('0x18')](config[_0x0fdb('0x17')],{'host':'localhost','port':0x18eb});var socket=require(_0x0fdb('0x19'))(new Redis(config['redis']));require('./openchannelQueue.socket')[_0x0fdb('0x1a')](socket);function respondWithStatusCode(_0x49b89a,_0x161252){_0x161252=_0x161252||0xcc;return function(_0x329515){if(_0x329515){return _0x49b89a[_0x0fdb('0x1b')](_0x161252);}return _0x49b89a[_0x0fdb('0x1c')](_0x161252)[_0x0fdb('0x1d')]();};}function respondWithResult(_0x4c8e98,_0x44b8b8){_0x44b8b8=_0x44b8b8||0xc8;return function(_0x332a2c){if(_0x332a2c){return _0x4c8e98['status'](_0x44b8b8)[_0x0fdb('0x1e')](_0x332a2c);}};}function respondWithFilteredResult(_0x3ca6b5,_0x5adaba){return function(_0x52f323){if(_0x52f323){var _0x2cadbd=_0x52f323['count'],_0x311db0=_0x5adaba['offset'],_0x2658a2=_0x5adaba['offset']+_0x5adaba['limit'],_0x56378b;if(_0x2658a2>=_0x2cadbd){_0x2658a2=_0x2cadbd;_0x56378b=0xc8;}else{_0x56378b=0xce;}_0x3ca6b5['status'](_0x56378b);return _0x3ca6b5[_0x0fdb('0x1f')]('Content-Range',_0x311db0+'-'+_0x2658a2+'/'+_0x2cadbd)[_0x0fdb('0x1e')](_0x52f323);}return null;};}function patchUpdates(_0xf87ab){return function(_0x310df4){try{jsonpatch[_0x0fdb('0x20')](_0x310df4,_0xf87ab,!![]);}catch(_0x22d146){return BPromise[_0x0fdb('0x21')](_0x22d146);}return _0x310df4['save']();};}function saveUpdates(_0x50ac62,_0x1d76f6){return function(_0x44d228){if(_0x44d228){return _0x44d228[_0x0fdb('0x22')](_0x50ac62)[_0x0fdb('0x23')](function(_0x4f58f2){return _0x4f58f2;});}return null;};}function removeEntity(_0x5c558d,_0x5472b3){return function(_0x124871){if(_0x124871){return _0x124871[_0x0fdb('0x24')]()[_0x0fdb('0x23')](function(){var _0x53eb91=_0x124871[_0x0fdb('0x25')]({'plain':!![]});var _0x4d4246=_0x0fdb('0x26');return db[_0x0fdb('0x27')]['destroy']({'where':{'type':_0x4d4246,'resourceId':_0x53eb91['id']}})[_0x0fdb('0x23')](function(){return _0x124871;});})['then'](function(){_0x5c558d[_0x0fdb('0x1c')](0xcc)[_0x0fdb('0x1d')]();});}};}function handleEntityNotFound(_0x4b2fad,_0x36677d){return function(_0x51a792){if(!_0x51a792){_0x4b2fad[_0x0fdb('0x1b')](0x194);}return _0x51a792;};}function handleError(_0x4ee3ac,_0x186517){_0x186517=_0x186517||0x1f4;return function(_0x10a95b){logger['error'](_0x10a95b[_0x0fdb('0x28')]);if(_0x10a95b[_0x0fdb('0x29')]){delete _0x10a95b[_0x0fdb('0x29')];}_0x4ee3ac[_0x0fdb('0x1c')](_0x186517)[_0x0fdb('0x2a')](_0x10a95b);};}exports[_0x0fdb('0x2b')]=function(_0x26898d,_0x376dc5){var _0x139d83={},_0x5f047b={},_0x2f5e6a={'count':0x0,'rows':[]};var _0x29496c=_[_0x0fdb('0x2c')](db['OpenchannelQueue']['rawAttributes'],function(_0x2ca457){return{'name':_0x2ca457['fieldName'],'type':_0x2ca457['type']['key']};});_0x5f047b['model']=_['map'](_0x29496c,_0x0fdb('0x29'));_0x5f047b['query']=_['keys'](_0x26898d[_0x0fdb('0x2d')]);_0x5f047b['filters']=_[_0x0fdb('0x2e')](_0x5f047b['model'],_0x5f047b[_0x0fdb('0x2d')]);_0x139d83[_0x0fdb('0x2f')]=_['intersection'](_0x5f047b[_0x0fdb('0x30')],qs['fields'](_0x26898d[_0x0fdb('0x2d')][_0x0fdb('0x31')]));_0x139d83[_0x0fdb('0x2f')]=_0x139d83['attributes'][_0x0fdb('0x32')]?_0x139d83['attributes']:_0x5f047b[_0x0fdb('0x30')];if(!_0x26898d['query'][_0x0fdb('0x33')]('nolimit')){_0x139d83['limit']=qs[_0x0fdb('0x34')](_0x26898d[_0x0fdb('0x2d')]['limit']);_0x139d83[_0x0fdb('0x35')]=qs[_0x0fdb('0x35')](_0x26898d['query']['offset']);}_0x139d83[_0x0fdb('0x36')]=qs[_0x0fdb('0x37')](_0x26898d['query'][_0x0fdb('0x37')]);_0x139d83[_0x0fdb('0x38')]=qs[_0x0fdb('0x39')](_['pick'](_0x26898d['query'],_0x5f047b[_0x0fdb('0x39')]));if(_0x26898d['query'][_0x0fdb('0x3a')]){_0x139d83[_0x0fdb('0x38')]=_[_0x0fdb('0x3b')](_0x139d83[_0x0fdb('0x38')],{'$or':_['map'](_0x29496c,function(_0x1b2d44){if(_0x1b2d44['type']!=='VIRTUAL'){var _0x128033={};_0x128033[_0x1b2d44[_0x0fdb('0x29')]]={'$like':'%'+_0x26898d[_0x0fdb('0x2d')][_0x0fdb('0x3a')]+'%'};return _0x128033;}})});}_0x139d83=_[_0x0fdb('0x3b')]({},_0x139d83,_0x26898d['options']);var _0x17cb7c={'where':_0x139d83[_0x0fdb('0x38')]};return db[_0x0fdb('0x3c')][_0x0fdb('0x3d')](_0x17cb7c)[_0x0fdb('0x23')](function(_0x473568){_0x2f5e6a[_0x0fdb('0x3d')]=_0x473568;if(_0x26898d[_0x0fdb('0x2d')]['includeAll']){_0x139d83['include']=[{'all':!![]}];}return db[_0x0fdb('0x3c')][_0x0fdb('0x3e')](_0x139d83);})[_0x0fdb('0x23')](function(_0x4d259a){_0x2f5e6a[_0x0fdb('0x3f')]=_0x4d259a;return _0x2f5e6a;})[_0x0fdb('0x23')](respondWithFilteredResult(_0x376dc5,_0x139d83))[_0x0fdb('0x40')](handleError(_0x376dc5,null));};exports[_0x0fdb('0x41')]=function(_0x3dc416,_0x1ce9a9){var _0x390463={'raw':!![],'where':{'id':_0x3dc416[_0x0fdb('0x42')]['id']}},_0x30085e={};_0x30085e[_0x0fdb('0x30')]=_[_0x0fdb('0x43')](db[_0x0fdb('0x3c')][_0x0fdb('0x44')]);_0x30085e[_0x0fdb('0x2d')]=_[_0x0fdb('0x43')](_0x3dc416[_0x0fdb('0x2d')]);_0x30085e[_0x0fdb('0x39')]=_[_0x0fdb('0x2e')](_0x30085e[_0x0fdb('0x30')],_0x30085e[_0x0fdb('0x2d')]);_0x390463[_0x0fdb('0x2f')]=_['intersection'](_0x30085e[_0x0fdb('0x30')],qs[_0x0fdb('0x31')](_0x3dc416['query'][_0x0fdb('0x31')]));_0x390463[_0x0fdb('0x2f')]=_0x390463[_0x0fdb('0x2f')]['length']?_0x390463[_0x0fdb('0x2f')]:_0x30085e[_0x0fdb('0x30')];if(_0x3dc416[_0x0fdb('0x2d')][_0x0fdb('0x45')]){_0x390463['include']=[{'all':!![]}];}_0x390463=_[_0x0fdb('0x3b')]({},_0x390463,_0x3dc416[_0x0fdb('0x46')]);return db[_0x0fdb('0x3c')]['find'](_0x390463)[_0x0fdb('0x23')](handleEntityNotFound(_0x1ce9a9,null))[_0x0fdb('0x23')](respondWithResult(_0x1ce9a9,null))['catch'](handleError(_0x1ce9a9,null));};exports['create']=function(_0x558b58,_0x5ea393){return db[_0x0fdb('0x3c')]['create'](_0x558b58[_0x0fdb('0x47')],{})[_0x0fdb('0x23')](function(_0x10674c){var _0x5e3f07=_0x558b58[_0x0fdb('0x48')]['get']({'plain':!![]});if(!_0x5e3f07)throw new Error(_0x0fdb('0x49'));if(_0x5e3f07['role']===_0x0fdb('0x48')){var _0x16ddf4=_0x10674c[_0x0fdb('0x25')]({'plain':!![]});var _0x5e0422=_0x0fdb('0x26');return db[_0x0fdb('0x4a')][_0x0fdb('0x4b')]({'where':{'name':_0x5e0422,'userProfileId':_0x5e3f07[_0x0fdb('0x4c')]},'raw':!![]})['then'](function(_0x35cfcb){if(_0x35cfcb&&_0x35cfcb[_0x0fdb('0x4d')]===0x0){return db[_0x0fdb('0x27')]['create']({'name':_0x16ddf4[_0x0fdb('0x29')],'resourceId':_0x16ddf4['id'],'type':_0x35cfcb[_0x0fdb('0x29')],'sectionId':_0x35cfcb['id']},{})[_0x0fdb('0x23')](function(){return _0x10674c;});}else{return _0x10674c;}})[_0x0fdb('0x40')](function(_0x5c57ce){logger[_0x0fdb('0x4e')]('Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s',_0x5c57ce);throw _0x5c57ce;});}return _0x10674c;})[_0x0fdb('0x23')](respondWithResult(_0x5ea393,0xc9))[_0x0fdb('0x40')](handleError(_0x5ea393,null));};exports[_0x0fdb('0x22')]=function(_0x49ff12,_0x3d7ff5){if(_0x49ff12[_0x0fdb('0x47')]['id']){delete _0x49ff12[_0x0fdb('0x47')]['id'];}return db['OpenchannelQueue'][_0x0fdb('0x4b')]({'where':{'id':_0x49ff12[_0x0fdb('0x42')]['id']}})[_0x0fdb('0x23')](handleEntityNotFound(_0x3d7ff5,null))[_0x0fdb('0x23')](saveUpdates(_0x49ff12[_0x0fdb('0x47')],null))[_0x0fdb('0x23')](respondWithResult(_0x3d7ff5,null))[_0x0fdb('0x40')](handleError(_0x3d7ff5,null));};exports[_0x0fdb('0x24')]=function(_0x44ea4e,_0xfaa202){return db[_0x0fdb('0x3c')]['find']({'where':{'id':_0x44ea4e[_0x0fdb('0x42')]['id']}})['then'](handleEntityNotFound(_0xfaa202,null))['then'](removeEntity(_0xfaa202,null))[_0x0fdb('0x40')](handleError(_0xfaa202,null));};exports[_0x0fdb('0x4f')]=function(_0x152b4d,_0x118aef){return db[_0x0fdb('0x3c')][_0x0fdb('0x4f')]()['then'](respondWithResult(_0x118aef,null))[_0x0fdb('0x40')](handleError(_0x118aef,null));};exports[_0x0fdb('0x50')]=function(_0x4b36a4,_0x1e1ca1,_0x1d11ba){var _0x47e8f9={'raw':!![],'where':{}},_0x352287={},_0x1a2bee;return db['OpenchannelQueue'][_0x0fdb('0x51')]({'where':{'id':_0x4b36a4[_0x0fdb('0x42')]['id']}})[_0x0fdb('0x23')](handleEntityNotFound(_0x1e1ca1,null))[_0x0fdb('0x23')](function(_0x7b71c6){if(_0x7b71c6){_0x1a2bee=_0x7b71c6[_0x0fdb('0x25')]({'plain':!![]});_0x352287[_0x0fdb('0x30')]=_[_0x0fdb('0x43')](db[_0x0fdb('0x52')]['rawAttributes']);_0x352287[_0x0fdb('0x2d')]=_[_0x0fdb('0x43')](_0x4b36a4[_0x0fdb('0x2d')]);_0x352287[_0x0fdb('0x39')]=_[_0x0fdb('0x2e')](_0x352287[_0x0fdb('0x30')],_0x352287['query']);_0x47e8f9[_0x0fdb('0x2f')]=_['intersection'](_0x352287[_0x0fdb('0x30')],qs[_0x0fdb('0x31')](_0x4b36a4[_0x0fdb('0x2d')]['fields']));_0x47e8f9[_0x0fdb('0x2f')]=_0x47e8f9[_0x0fdb('0x2f')][_0x0fdb('0x32')]?_0x47e8f9['attributes']:_0x352287['model'];if(!_0x4b36a4['query'][_0x0fdb('0x33')](_0x0fdb('0x53'))){_0x47e8f9[_0x0fdb('0x34')]=qs[_0x0fdb('0x34')](_0x4b36a4[_0x0fdb('0x2d')][_0x0fdb('0x34')]);_0x47e8f9[_0x0fdb('0x35')]=qs[_0x0fdb('0x35')](_0x4b36a4[_0x0fdb('0x2d')][_0x0fdb('0x35')]);}_0x47e8f9[_0x0fdb('0x36')]=qs['sort'](_0x4b36a4['query'][_0x0fdb('0x37')]);_0x47e8f9[_0x0fdb('0x38')]=qs[_0x0fdb('0x39')](_[_0x0fdb('0x54')](_0x4b36a4[_0x0fdb('0x2d')],_0x352287[_0x0fdb('0x39')]));_0x47e8f9[_0x0fdb('0x38')][_0x0fdb('0x55')]=_0x7b71c6['id'];if(_0x4b36a4['query'][_0x0fdb('0x3a')]){_0x47e8f9['where']=_[_0x0fdb('0x3b')](_0x47e8f9['where'],{'$or':_['map'](_0x47e8f9[_0x0fdb('0x2f')],function(_0x2c8de0){var _0x313be9={};_0x313be9[_0x2c8de0]={'$like':'%'+_0x4b36a4['query'][_0x0fdb('0x3a')]+'%'};return _0x313be9;})});}_0x47e8f9=_[_0x0fdb('0x3b')]({},_0x47e8f9,_0x4b36a4[_0x0fdb('0x46')]);return db[_0x0fdb('0x52')][_0x0fdb('0x3e')](_0x47e8f9);}})[_0x0fdb('0x23')](function(_0x211786){if(_0x211786){return db['User'][_0x0fdb('0x56')]({'where':{'id':_[_0x0fdb('0x2c')](_0x211786,_0x0fdb('0x57')),'role':_0x0fdb('0x58')},'attributes':['id',_0x0fdb('0x29'),'openchannelPause',_0x0fdb('0x59'),_0x0fdb('0x5a')]});}})['then'](function(_0x28ecc2){if(_0x28ecc2){return{'count':_0x28ecc2[_0x0fdb('0x3d')],'rows':_[_0x0fdb('0x2c')](_0x28ecc2[_0x0fdb('0x3f')],function(_0x1b47b7){return{'membername':_0x1b47b7[_0x0fdb('0x29')],'UserId':_0x1b47b7['id'],'queue_name':_0x1a2bee[_0x0fdb('0x29')],'OpenchannelQueueId':_0x1a2bee['id'],'interface':util['format'](_0x0fdb('0x5b'),_0x0fdb('0x5c'),_0x1b47b7[_0x0fdb('0x29')]),'penalty':0x0,'paused':_0x1b47b7['openchannelPause'],'createdAt':_0x1b47b7[_0x0fdb('0x5a')],'updatedAt':_0x1b47b7[_0x0fdb('0x59')]};})};}else{return{'count':0x0,'rows':[]};}})['then'](respondWithFilteredResult(_0x1e1ca1,_0x47e8f9))[_0x0fdb('0x40')](handleError(_0x1e1ca1,null));};exports[_0x0fdb('0x5d')]=function(_0x115b81,_0x3673e1,_0x184cad){var _0x4024ed={};var _0x2b5187={};var _0x5da835;var _0x17e5ad;return db[_0x0fdb('0x3c')][_0x0fdb('0x51')]({'where':{'id':_0x115b81[_0x0fdb('0x42')]['id']}})[_0x0fdb('0x23')](handleEntityNotFound(_0x3673e1,null))[_0x0fdb('0x23')](function(_0x1341ff){if(_0x1341ff){_0x5da835=_0x1341ff;_0x2b5187[_0x0fdb('0x30')]=_[_0x0fdb('0x43')](db[_0x0fdb('0x5e')]['rawAttributes']);_0x2b5187[_0x0fdb('0x2d')]=_[_0x0fdb('0x43')](_0x115b81[_0x0fdb('0x2d')]);_0x2b5187[_0x0fdb('0x39')]=_[_0x0fdb('0x2e')](_0x2b5187['model'],_0x2b5187[_0x0fdb('0x2d')]);_0x4024ed[_0x0fdb('0x2f')]=_[_0x0fdb('0x2e')](_0x2b5187[_0x0fdb('0x30')],qs[_0x0fdb('0x31')](_0x115b81['query'][_0x0fdb('0x31')]));_0x4024ed[_0x0fdb('0x2f')]=_0x4024ed[_0x0fdb('0x2f')][_0x0fdb('0x32')]?_0x4024ed[_0x0fdb('0x2f')]:_0x2b5187[_0x0fdb('0x30')];_0x4024ed[_0x0fdb('0x36')]=qs[_0x0fdb('0x37')](_0x115b81[_0x0fdb('0x2d')][_0x0fdb('0x37')]);_0x4024ed[_0x0fdb('0x38')]=qs[_0x0fdb('0x39')](_[_0x0fdb('0x54')](_0x115b81[_0x0fdb('0x2d')],_0x2b5187[_0x0fdb('0x39')]));if(_0x115b81[_0x0fdb('0x2d')][_0x0fdb('0x3a')]){_0x4024ed['where']=_['merge'](_0x4024ed[_0x0fdb('0x38')],{'$or':_[_0x0fdb('0x2c')](_0x4024ed[_0x0fdb('0x2f')],function(_0x53b800){var _0x2e77ec={};_0x2e77ec[_0x53b800]={'$like':'%'+_0x115b81[_0x0fdb('0x2d')]['filter']+'%'};return _0x2e77ec;})});}_0x4024ed=_[_0x0fdb('0x3b')]({},_0x4024ed,_0x115b81[_0x0fdb('0x46')]);return _0x5da835[_0x0fdb('0x5d')](_0x4024ed);}})[_0x0fdb('0x23')](function(_0x168ed4){if(_0x168ed4){_0x17e5ad=_0x168ed4[_0x0fdb('0x32')];if(!_0x115b81[_0x0fdb('0x2d')][_0x0fdb('0x33')]('nolimit')){_0x4024ed[_0x0fdb('0x34')]=qs[_0x0fdb('0x34')](_0x115b81[_0x0fdb('0x2d')][_0x0fdb('0x34')]);_0x4024ed[_0x0fdb('0x35')]=qs[_0x0fdb('0x35')](_0x115b81['query'][_0x0fdb('0x35')]);}return _0x5da835[_0x0fdb('0x5d')](_0x4024ed);}})[_0x0fdb('0x23')](function(_0x1fd1ea){if(_0x1fd1ea){return _0x1fd1ea?{'count':_0x17e5ad,'rows':_0x1fd1ea}:null;}})[_0x0fdb('0x23')](respondWithResult(_0x3673e1,null))[_0x0fdb('0x40')](handleError(_0x3673e1,null));};exports['addTeams']=function(_0x138b00,_0x14af93,_0x30bc2c){var _0x35199e=_0x138b00['body'][_0x0fdb('0x5f')];return db['Team']['findAll']({'where':{'id':_0x35199e},'attributes':['id'],'include':[{'model':db[_0x0fdb('0x60')],'as':'Agents','attributes':['id',_0x0fdb('0x29'),_0x0fdb('0x61'),_0x0fdb('0x62'),_0x0fdb('0x63')],'raw':!![]}]})[_0x0fdb('0x23')](function(_0x363ca3){if(_0x363ca3){var _0x1d3b99=_[_0x0fdb('0x64')](_0x363ca3,function(_0x516728){var _0x75fab7=_0x516728[_0x0fdb('0x25')]({'plain':!![]});return _0x75fab7[_0x0fdb('0x65')];});return db[_0x0fdb('0x3c')]['find']({'where':{'id':_0x138b00[_0x0fdb('0x42')]['id']}})[_0x0fdb('0x23')](function(_0x25952f){return db[_0x0fdb('0x66')][_0x0fdb('0x67')](function(_0x385236){return _0x25952f['addTeams'](_0x35199e,{'transaction':_0x385236})[_0x0fdb('0x23')](function(){return BPromise[_0x0fdb('0x68')](_0x1d3b99,function(_0x25266e){return db[_0x0fdb('0x52')][_0x0fdb('0x69')]({'where':{'UserId':_0x25266e['id'],'OpenchannelQueueId':_0x138b00[_0x0fdb('0x42')]['id']},'transaction':_0x385236});});})[_0x0fdb('0x23')](function(){_0x1d3b99[_0x0fdb('0x6a')](function(_0x3cab92){socket['emit'](_0x0fdb('0x6b'),{'UserId':_0x3cab92['id'],'OpenchannelQueueId':_0x25952f['id']});});});});});}})[_0x0fdb('0x23')](respondWithStatusCode(_0x14af93,null))[_0x0fdb('0x40')](handleError(_0x14af93,null));};exports['removeTeams']=function(_0x45c443,_0x5171e1,_0x163056){return db[_0x0fdb('0x5e')][_0x0fdb('0x3e')]({'where':{'id':_0x45c443[_0x0fdb('0x2d')][_0x0fdb('0x5f')]},'attributes':['id'],'include':[{'model':db[_0x0fdb('0x60')],'as':_0x0fdb('0x65'),'attributes':['id'],'raw':!![]}]})['then'](handleEntityNotFound(_0x5171e1,null))[_0x0fdb('0x23')](function(_0x413de3){var _0x1c795e=_[_0x0fdb('0x2c')](_0x413de3,'id');var _0x397914=[];var _0x22de77=[];var _0x4cc378=squel[_0x0fdb('0x6c')]();_0x4cc378[_0x0fdb('0x6d')]('tq.TeamId')['from']('team_has_openchannel_queues','tq')[_0x0fdb('0x6e')](_0x0fdb('0x6f'),'ut',_0x0fdb('0x70'))['where'](_0x0fdb('0x71'),_0x45c443[_0x0fdb('0x42')]['id']);for(var _0xaa2ef9=0x0;_0xaa2ef9<_0x413de3['length'];_0xaa2ef9+=0x1){let _0x3e3a8c=_0x413de3[_0xaa2ef9];for(var _0x4c7f6e=0x0;_0x4c7f6e<_0x3e3a8c[_0x0fdb('0x65')][_0x0fdb('0x32')];_0x4c7f6e+=0x1){let _0x295812=_0x3e3a8c['Agents'][_0x4c7f6e];var _0x22b705=_0x4cc378[_0x0fdb('0x72')]();_0x22b705[_0x0fdb('0x38')]('ut.UserId\x20=\x20?',_0x295812['id']);_0x22de77[_0x0fdb('0x73')](db['sequelize'][_0x0fdb('0x2d')](_0x22b705[_0x0fdb('0x74')](),{'type':db[_0x0fdb('0x66')]['QueryTypes']['SELECT']})[_0x0fdb('0x23')](function(_0x144fcf){if(_0x144fcf[_0x0fdb('0x32')]===0x1){return _0x295812['id'];}else{var _0x447481=_[_0x0fdb('0x75')](_[_0x0fdb('0x2c')](_0x144fcf,_0x0fdb('0x76')),function(_0x58ca62){return _[_0x0fdb('0x77')](_0x1c795e,_0x58ca62);});if(_0x447481){return _0x295812['id'];}}}));}}return BPromise[_0x0fdb('0x78')](_0x22de77)[_0x0fdb('0x23')](function(_0x1f13de){_0x397914=_(_0x397914)[_0x0fdb('0x79')](_0x1f13de)[_0x0fdb('0x7a')]()[_0x0fdb('0x7b')]();return db['OpenchannelQueue'][_0x0fdb('0x4b')]({'where':{'id':_0x45c443[_0x0fdb('0x42')]['id']}})['then'](function(_0x285d61){return db['sequelize'][_0x0fdb('0x67')](function(_0x2d07de){return _0x285d61[_0x0fdb('0x7c')](_0x45c443[_0x0fdb('0x2d')][_0x0fdb('0x5f')],{'transaction':_0x2d07de})['then'](function(){if(!_[_0x0fdb('0x7d')](_0x397914)){return _0x285d61[_0x0fdb('0x7e')](_0x397914,{'transaction':_0x2d07de});}})[_0x0fdb('0x23')](function(){_0x397914[_0x0fdb('0x6a')](function(_0x3ebb6d){socket[_0x0fdb('0x7f')](_0x0fdb('0x80'),{'UserId':_0x3ebb6d,'OpenchannelQueueId':_0x285d61['id']});});});});});});})[_0x0fdb('0x23')](respondWithStatusCode(_0x5171e1,null))[_0x0fdb('0x40')](handleError(_0x5171e1,null));};exports[_0x0fdb('0x81')]=function(_0x59f85f,_0x30f740,_0x187350){return db[_0x0fdb('0x3c')]['find']({'where':{'id':_0x59f85f['params']['id']}})[_0x0fdb('0x23')](handleEntityNotFound(_0x30f740,null))[_0x0fdb('0x23')](function(_0x5c0c14){if(_0x5c0c14){return _0x5c0c14[_0x0fdb('0x81')](_0x59f85f[_0x0fdb('0x47')][_0x0fdb('0x5f')],_[_0x0fdb('0x82')](_0x59f85f[_0x0fdb('0x47')],[_0x0fdb('0x5f'),'id'])||{})[_0x0fdb('0x83')](function(_0x47d31b){for(var _0x49f2a1=0x0;_0x49f2a1<_0x59f85f[_0x0fdb('0x47')][_0x0fdb('0x5f')][_0x0fdb('0x32')];_0x49f2a1+=0x1){socket[_0x0fdb('0x7f')](_0x0fdb('0x6b'),{'UserId':_0x59f85f['body'][_0x0fdb('0x5f')][_0x49f2a1],'OpenchannelQueueId':_0x59f85f[_0x0fdb('0x42')]['id']});}return _0x47d31b;});}})['then'](respondWithResult(_0x30f740,null))[_0x0fdb('0x40')](handleError(_0x30f740,null));};exports[_0x0fdb('0x7e')]=function(_0x514672,_0x227c53,_0x52a058){return db[_0x0fdb('0x3c')][_0x0fdb('0x4b')]({'where':{'id':_0x514672[_0x0fdb('0x42')]['id']}})[_0x0fdb('0x23')](handleEntityNotFound(_0x227c53,null))[_0x0fdb('0x23')](function(_0x4f5013){if(_0x4f5013){return _0x4f5013[_0x0fdb('0x7e')](_0x514672['query'][_0x0fdb('0x5f')])[_0x0fdb('0x23')](function(){if(_[_0x0fdb('0x84')](_0x514672[_0x0fdb('0x2d')][_0x0fdb('0x5f')])){for(var _0x2331e1=0x0;_0x2331e1<_0x514672[_0x0fdb('0x2d')][_0x0fdb('0x5f')]['length'];_0x2331e1+=0x1){socket[_0x0fdb('0x7f')](_0x0fdb('0x80'),{'UserId':Number(_0x514672[_0x0fdb('0x2d')]['ids'][_0x2331e1]),'OpenchannelQueueId':Number(_0x514672[_0x0fdb('0x42')]['id'])});}}else{socket[_0x0fdb('0x7f')](_0x0fdb('0x80'),{'UserId':Number(_0x514672[_0x0fdb('0x2d')][_0x0fdb('0x5f')]),'OpenchannelQueueId':Number(_0x514672[_0x0fdb('0x42')]['id'])});}});}})[_0x0fdb('0x23')](respondWithStatusCode(_0x227c53,null))[_0x0fdb('0x40')](handleError(_0x227c53,null));};exports[_0x0fdb('0x85')]=function(_0x3fbc23,_0xd924f0,_0xdecefa){var _0x7b6ca={};var _0x1cc545={};var _0xbba35e;var _0x53737b;return db[_0x0fdb('0x3c')]['findOne']({'where':{'id':_0x3fbc23[_0x0fdb('0x42')]['id']}})[_0x0fdb('0x23')](handleEntityNotFound(_0xd924f0,null))[_0x0fdb('0x23')](function(_0x11793a){if(_0x11793a){_0xbba35e=_0x11793a;_0x1cc545[_0x0fdb('0x30')]=_[_0x0fdb('0x43')](db[_0x0fdb('0x60')][_0x0fdb('0x44')]);_0x1cc545[_0x0fdb('0x2d')]=_[_0x0fdb('0x43')](_0x3fbc23[_0x0fdb('0x2d')]);_0x1cc545[_0x0fdb('0x39')]=_['intersection'](_0x1cc545[_0x0fdb('0x30')],_0x1cc545[_0x0fdb('0x2d')]);_0x7b6ca[_0x0fdb('0x2f')]=_[_0x0fdb('0x2e')](_0x1cc545[_0x0fdb('0x30')],qs['fields'](_0x3fbc23['query'][_0x0fdb('0x31')]));_0x7b6ca['attributes']=_0x7b6ca[_0x0fdb('0x2f')]['length']?_0x7b6ca[_0x0fdb('0x2f')]:_0x1cc545[_0x0fdb('0x30')];_0x7b6ca['order']=qs[_0x0fdb('0x37')](_0x3fbc23[_0x0fdb('0x2d')][_0x0fdb('0x37')]);_0x7b6ca[_0x0fdb('0x38')]=qs[_0x0fdb('0x39')](_[_0x0fdb('0x54')](_0x3fbc23['query'],_0x1cc545[_0x0fdb('0x39')]));if(_0x3fbc23[_0x0fdb('0x2d')][_0x0fdb('0x3a')]){_0x7b6ca[_0x0fdb('0x38')]=_[_0x0fdb('0x3b')](_0x7b6ca[_0x0fdb('0x38')],{'$or':_[_0x0fdb('0x2c')](_0x7b6ca[_0x0fdb('0x2f')],function(_0x77b7e0){var _0x16a578={};_0x16a578[_0x77b7e0]={'$like':'%'+_0x3fbc23[_0x0fdb('0x2d')]['filter']+'%'};return _0x16a578;})});}_0x7b6ca=_['merge']({},_0x7b6ca,_0x3fbc23[_0x0fdb('0x46')]);return _0xbba35e['getAgents'](_0x7b6ca);}})[_0x0fdb('0x23')](function(_0x30d55d){if(_0x30d55d){_0x53737b=_0x30d55d[_0x0fdb('0x32')];if(!_0x3fbc23[_0x0fdb('0x2d')]['hasOwnProperty'](_0x0fdb('0x53'))){_0x7b6ca[_0x0fdb('0x34')]=qs[_0x0fdb('0x34')](_0x3fbc23[_0x0fdb('0x2d')][_0x0fdb('0x34')]);_0x7b6ca[_0x0fdb('0x35')]=qs['offset'](_0x3fbc23[_0x0fdb('0x2d')][_0x0fdb('0x35')]);}return _0xbba35e[_0x0fdb('0x85')](_0x7b6ca);}})[_0x0fdb('0x23')](function(_0x39a6ad){if(_0x39a6ad){return _0x39a6ad?{'count':_0x53737b,'rows':_0x39a6ad}:null;}})[_0x0fdb('0x23')](respondWithResult(_0xd924f0,null))['catch'](handleError(_0xd924f0,null));};
\ No newline at end of file
+var _0xf74d=['user_has_teams','clone','ut.UserId\x20=\x20?','push','toString','QueryTypes','SELECT','TeamId','union','compact','value','isEmpty','removeAgents','forEach','userOpenchannelQueue:remove','omit','getAgents','html-pdf','rimraf','zip-dir','fast-json-patch','request-promise','bluebird','mustache','util','to-csv','ejs','lodash','squel','crypto','desk.js','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../mysqldb','redis','defaults','localhost','socket.io-emitter','./openchannelQueue.socket','end','status','json','offset','limit','set','Content-Range','reject','save','update','then','destroy','get','OpenchannelQueues','UserProfileResource','sendStatus','error','stack','name','send','map','OpenchannelQueue','fieldName','type','key','query','filters','intersection','attributes','model','fields','length','hasOwnProperty','order','sort','where','pick','filter','merge','VIRTUAL','options','count','includeAll','findAll','rows','catch','show','params','keys','rawAttributes','include','create','user','UserProfileSection','find','userProfileId','autoAssociation','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','body','describe','getMembers','findOne','UserOpenchannelQueue','nolimit','OpenchannelQueueId','User','UserId','agent','updatedAt','createdAt','%s/%s','SIP','openchannelPause','getTeams','Team','addTeams','ids','Agents','online','voicePause','interface','sequelize','transaction','findOrCreate','emit','userOpenchannelQueue:save','removeTeams','select','field','tq.TeamId','from','team_has_openchannel_queues'];(function(_0x5783f4,_0x4a9e0a){var _0x28e380=function(_0x1ffc49){while(--_0x1ffc49){_0x5783f4['push'](_0x5783f4['shift']());}};_0x28e380(++_0x4a9e0a);}(_0xf74d,0x1a6));var _0xdf74=function(_0x1aed33,_0x5cbf7e){_0x1aed33=_0x1aed33-0x0;var _0x50d94c=_0xf74d[_0x1aed33];return _0x50d94c;};'use strict';var pdf=require(_0xdf74('0x0'));var emlformat=require('eml-format');var rimraf=require(_0xdf74('0x1'));var zipdir=require(_0xdf74('0x2'));var jsonpatch=require(_0xdf74('0x3'));var rp=require(_0xdf74('0x4'));var moment=require('moment');var BPromise=require(_0xdf74('0x5'));var Mustache=require(_0xdf74('0x6'));var util=require(_0xdf74('0x7'));var path=require('path');var sox=require('sox');var csv=require(_0xdf74('0x8'));var ejs=require(_0xdf74('0x9'));var fs=require('fs');var _=require(_0xdf74('0xa'));var squel=require(_0xdf74('0xb'));var crypto=require(_0xdf74('0xc'));var jsforce=require('jsforce');var deskjs=require(_0xdf74('0xd'));var toCsv=require('to-csv');var querystring=require(_0xdf74('0xe'));var Papa=require(_0xdf74('0xf'));var Redis=require(_0xdf74('0x10'));var authService=require(_0xdf74('0x11'));var qs=require(_0xdf74('0x12'));var as=require(_0xdf74('0x13'));var hardwareService=require('../../config/license/hardware');var logger=require('../../config/logger')('api');var utils=require('../../config/utils');var config=require('../../config/environment');var db=require(_0xdf74('0x14'))['db'];config[_0xdf74('0x15')]=_[_0xdf74('0x16')](config[_0xdf74('0x15')],{'host':_0xdf74('0x17'),'port':0x18eb});var socket=require(_0xdf74('0x18'))(new Redis(config[_0xdf74('0x15')]));require(_0xdf74('0x19'))['register'](socket);function respondWithStatusCode(_0x55e5a8,_0x494edb){_0x494edb=_0x494edb||0xcc;return function(_0xd5ef07){if(_0xd5ef07){return _0x55e5a8['sendStatus'](_0x494edb);}return _0x55e5a8['status'](_0x494edb)[_0xdf74('0x1a')]();};}function respondWithResult(_0x5af92b,_0x545feb){_0x545feb=_0x545feb||0xc8;return function(_0x3c7b2b){if(_0x3c7b2b){return _0x5af92b[_0xdf74('0x1b')](_0x545feb)[_0xdf74('0x1c')](_0x3c7b2b);}};}function respondWithFilteredResult(_0xa092ef,_0x55696f){return function(_0x1cb205){if(_0x1cb205){var _0x2ff5b9=_0x1cb205['count'],_0x1646cb=_0x55696f[_0xdf74('0x1d')],_0x145a38=_0x55696f[_0xdf74('0x1d')]+_0x55696f[_0xdf74('0x1e')],_0x7f71c8;if(_0x145a38>=_0x2ff5b9){_0x145a38=_0x2ff5b9;_0x7f71c8=0xc8;}else{_0x7f71c8=0xce;}_0xa092ef['status'](_0x7f71c8);return _0xa092ef[_0xdf74('0x1f')](_0xdf74('0x20'),_0x1646cb+'-'+_0x145a38+'/'+_0x2ff5b9)[_0xdf74('0x1c')](_0x1cb205);}return null;};}function patchUpdates(_0x3fafe8){return function(_0x9107a){try{jsonpatch['apply'](_0x9107a,_0x3fafe8,!![]);}catch(_0x23295f){return BPromise[_0xdf74('0x21')](_0x23295f);}return _0x9107a[_0xdf74('0x22')]();};}function saveUpdates(_0x66042e,_0x21787f){return function(_0x2a4773){if(_0x2a4773){return _0x2a4773[_0xdf74('0x23')](_0x66042e)[_0xdf74('0x24')](function(_0xbd7739){return _0xbd7739;});}return null;};}function removeEntity(_0x2ce7cc,_0x442144){return function(_0x269df8){if(_0x269df8){return _0x269df8[_0xdf74('0x25')]()[_0xdf74('0x24')](function(){var _0x2f9302=_0x269df8[_0xdf74('0x26')]({'plain':!![]});var _0x4e5d8e=_0xdf74('0x27');return db[_0xdf74('0x28')][_0xdf74('0x25')]({'where':{'type':_0x4e5d8e,'resourceId':_0x2f9302['id']}})['then'](function(){return _0x269df8;});})[_0xdf74('0x24')](function(){_0x2ce7cc[_0xdf74('0x1b')](0xcc)[_0xdf74('0x1a')]();});}};}function handleEntityNotFound(_0x31885e,_0x20d11c){return function(_0x4df85c){if(!_0x4df85c){_0x31885e[_0xdf74('0x29')](0x194);}return _0x4df85c;};}function handleError(_0x3a9568,_0x255d15){_0x255d15=_0x255d15||0x1f4;return function(_0x449acd){logger[_0xdf74('0x2a')](_0x449acd[_0xdf74('0x2b')]);if(_0x449acd[_0xdf74('0x2c')]){delete _0x449acd[_0xdf74('0x2c')];}_0x3a9568[_0xdf74('0x1b')](_0x255d15)[_0xdf74('0x2d')](_0x449acd);};}exports['index']=function(_0x25f182,_0x5d5427){var _0x155df8={},_0x554d55={},_0x41c900={'count':0x0,'rows':[]};var _0x59016f=_[_0xdf74('0x2e')](db[_0xdf74('0x2f')]['rawAttributes'],function(_0x204e7c){return{'name':_0x204e7c[_0xdf74('0x30')],'type':_0x204e7c[_0xdf74('0x31')][_0xdf74('0x32')]};});_0x554d55['model']=_[_0xdf74('0x2e')](_0x59016f,_0xdf74('0x2c'));_0x554d55[_0xdf74('0x33')]=_['keys'](_0x25f182[_0xdf74('0x33')]);_0x554d55[_0xdf74('0x34')]=_[_0xdf74('0x35')](_0x554d55['model'],_0x554d55['query']);_0x155df8[_0xdf74('0x36')]=_[_0xdf74('0x35')](_0x554d55[_0xdf74('0x37')],qs[_0xdf74('0x38')](_0x25f182['query'][_0xdf74('0x38')]));_0x155df8[_0xdf74('0x36')]=_0x155df8['attributes'][_0xdf74('0x39')]?_0x155df8[_0xdf74('0x36')]:_0x554d55[_0xdf74('0x37')];if(!_0x25f182[_0xdf74('0x33')][_0xdf74('0x3a')]('nolimit')){_0x155df8[_0xdf74('0x1e')]=qs[_0xdf74('0x1e')](_0x25f182[_0xdf74('0x33')][_0xdf74('0x1e')]);_0x155df8[_0xdf74('0x1d')]=qs[_0xdf74('0x1d')](_0x25f182[_0xdf74('0x33')][_0xdf74('0x1d')]);}_0x155df8[_0xdf74('0x3b')]=qs[_0xdf74('0x3c')](_0x25f182[_0xdf74('0x33')]['sort']);_0x155df8[_0xdf74('0x3d')]=qs['filters'](_[_0xdf74('0x3e')](_0x25f182[_0xdf74('0x33')],_0x554d55[_0xdf74('0x34')]));if(_0x25f182[_0xdf74('0x33')][_0xdf74('0x3f')]){_0x155df8[_0xdf74('0x3d')]=_[_0xdf74('0x40')](_0x155df8['where'],{'$or':_[_0xdf74('0x2e')](_0x59016f,function(_0x54957d){if(_0x54957d[_0xdf74('0x31')]!==_0xdf74('0x41')){var _0x555c7e={};_0x555c7e[_0x54957d['name']]={'$like':'%'+_0x25f182['query']['filter']+'%'};return _0x555c7e;}})});}_0x155df8=_['merge']({},_0x155df8,_0x25f182[_0xdf74('0x42')]);var _0x4c67c6={'where':_0x155df8['where']};return db[_0xdf74('0x2f')][_0xdf74('0x43')](_0x4c67c6)['then'](function(_0x3554c5){_0x41c900[_0xdf74('0x43')]=_0x3554c5;if(_0x25f182[_0xdf74('0x33')][_0xdf74('0x44')]){_0x155df8['include']=[{'all':!![]}];}return db['OpenchannelQueue'][_0xdf74('0x45')](_0x155df8);})[_0xdf74('0x24')](function(_0x1407f2){_0x41c900[_0xdf74('0x46')]=_0x1407f2;return _0x41c900;})[_0xdf74('0x24')](respondWithFilteredResult(_0x5d5427,_0x155df8))[_0xdf74('0x47')](handleError(_0x5d5427,null));};exports[_0xdf74('0x48')]=function(_0x365706,_0x4f71de){var _0x2432d3={'raw':!![],'where':{'id':_0x365706[_0xdf74('0x49')]['id']}},_0x5e92df={};_0x5e92df['model']=_[_0xdf74('0x4a')](db[_0xdf74('0x2f')][_0xdf74('0x4b')]);_0x5e92df[_0xdf74('0x33')]=_[_0xdf74('0x4a')](_0x365706[_0xdf74('0x33')]);_0x5e92df['filters']=_[_0xdf74('0x35')](_0x5e92df['model'],_0x5e92df['query']);_0x2432d3[_0xdf74('0x36')]=_[_0xdf74('0x35')](_0x5e92df[_0xdf74('0x37')],qs['fields'](_0x365706[_0xdf74('0x33')]['fields']));_0x2432d3['attributes']=_0x2432d3[_0xdf74('0x36')][_0xdf74('0x39')]?_0x2432d3[_0xdf74('0x36')]:_0x5e92df['model'];if(_0x365706[_0xdf74('0x33')][_0xdf74('0x44')]){_0x2432d3[_0xdf74('0x4c')]=[{'all':!![]}];}_0x2432d3=_['merge']({},_0x2432d3,_0x365706['options']);return db['OpenchannelQueue']['find'](_0x2432d3)[_0xdf74('0x24')](handleEntityNotFound(_0x4f71de,null))[_0xdf74('0x24')](respondWithResult(_0x4f71de,null))[_0xdf74('0x47')](handleError(_0x4f71de,null));};exports[_0xdf74('0x4d')]=function(_0x1f39ca,_0x5413f6){return db[_0xdf74('0x2f')][_0xdf74('0x4d')](_0x1f39ca['body'],{})[_0xdf74('0x24')](function(_0x19c9df){var _0x7cf099=_0x1f39ca[_0xdf74('0x4e')][_0xdf74('0x26')]({'plain':!![]});if(!_0x7cf099)throw new Error('Unable\x20to\x20retrieve\x20the\x20current\x20user');if(_0x7cf099['role']===_0xdf74('0x4e')){var _0x44b16a=_0x19c9df[_0xdf74('0x26')]({'plain':!![]});var _0x335871='OpenchannelQueues';return db[_0xdf74('0x4f')][_0xdf74('0x50')]({'where':{'name':_0x335871,'userProfileId':_0x7cf099[_0xdf74('0x51')]},'raw':!![]})['then'](function(_0xc9d50d){if(_0xc9d50d&&_0xc9d50d[_0xdf74('0x52')]===0x0){return db[_0xdf74('0x28')][_0xdf74('0x4d')]({'name':_0x44b16a[_0xdf74('0x2c')],'resourceId':_0x44b16a['id'],'type':_0xc9d50d[_0xdf74('0x2c')],'sectionId':_0xc9d50d['id']},{})[_0xdf74('0x24')](function(){return _0x19c9df;});}else{return _0x19c9df;}})[_0xdf74('0x47')](function(_0x5c3c40){logger[_0xdf74('0x2a')](_0xdf74('0x53'),_0x5c3c40);throw _0x5c3c40;});}return _0x19c9df;})['then'](respondWithResult(_0x5413f6,0xc9))['catch'](handleError(_0x5413f6,null));};exports[_0xdf74('0x23')]=function(_0x597b2e,_0xd1efa2){if(_0x597b2e[_0xdf74('0x54')]['id']){delete _0x597b2e[_0xdf74('0x54')]['id'];}return db['OpenchannelQueue'][_0xdf74('0x50')]({'where':{'id':_0x597b2e[_0xdf74('0x49')]['id']}})['then'](handleEntityNotFound(_0xd1efa2,null))[_0xdf74('0x24')](saveUpdates(_0x597b2e['body'],null))[_0xdf74('0x24')](respondWithResult(_0xd1efa2,null))[_0xdf74('0x47')](handleError(_0xd1efa2,null));};exports['destroy']=function(_0x361595,_0x351fef){return db[_0xdf74('0x2f')]['find']({'where':{'id':_0x361595['params']['id']}})[_0xdf74('0x24')](handleEntityNotFound(_0x351fef,null))[_0xdf74('0x24')](removeEntity(_0x351fef,null))[_0xdf74('0x47')](handleError(_0x351fef,null));};exports[_0xdf74('0x55')]=function(_0x5440d5,_0x32971e){return db[_0xdf74('0x2f')][_0xdf74('0x55')]()[_0xdf74('0x24')](respondWithResult(_0x32971e,null))[_0xdf74('0x47')](handleError(_0x32971e,null));};exports[_0xdf74('0x56')]=function(_0x231fb3,_0x37bc1c,_0x5f0003){var _0xc1fbe6={'raw':!![],'where':{}},_0x3851c3={},_0x33049e;return db[_0xdf74('0x2f')][_0xdf74('0x57')]({'where':{'id':_0x231fb3[_0xdf74('0x49')]['id']}})[_0xdf74('0x24')](handleEntityNotFound(_0x37bc1c,null))['then'](function(_0x11f95b){if(_0x11f95b){_0x33049e=_0x11f95b[_0xdf74('0x26')]({'plain':!![]});_0x3851c3[_0xdf74('0x37')]=_[_0xdf74('0x4a')](db[_0xdf74('0x58')][_0xdf74('0x4b')]);_0x3851c3[_0xdf74('0x33')]=_[_0xdf74('0x4a')](_0x231fb3[_0xdf74('0x33')]);_0x3851c3['filters']=_[_0xdf74('0x35')](_0x3851c3[_0xdf74('0x37')],_0x3851c3[_0xdf74('0x33')]);_0xc1fbe6[_0xdf74('0x36')]=_[_0xdf74('0x35')](_0x3851c3['model'],qs[_0xdf74('0x38')](_0x231fb3[_0xdf74('0x33')][_0xdf74('0x38')]));_0xc1fbe6[_0xdf74('0x36')]=_0xc1fbe6[_0xdf74('0x36')][_0xdf74('0x39')]?_0xc1fbe6[_0xdf74('0x36')]:_0x3851c3[_0xdf74('0x37')];if(!_0x231fb3['query'][_0xdf74('0x3a')](_0xdf74('0x59'))){_0xc1fbe6[_0xdf74('0x1e')]=qs['limit'](_0x231fb3[_0xdf74('0x33')][_0xdf74('0x1e')]);_0xc1fbe6['offset']=qs[_0xdf74('0x1d')](_0x231fb3[_0xdf74('0x33')][_0xdf74('0x1d')]);}_0xc1fbe6['order']=qs['sort'](_0x231fb3['query'][_0xdf74('0x3c')]);_0xc1fbe6['where']=qs[_0xdf74('0x34')](_[_0xdf74('0x3e')](_0x231fb3[_0xdf74('0x33')],_0x3851c3[_0xdf74('0x34')]));_0xc1fbe6[_0xdf74('0x3d')][_0xdf74('0x5a')]=_0x11f95b['id'];if(_0x231fb3[_0xdf74('0x33')][_0xdf74('0x3f')]){_0xc1fbe6['where']=_[_0xdf74('0x40')](_0xc1fbe6[_0xdf74('0x3d')],{'$or':_[_0xdf74('0x2e')](_0xc1fbe6[_0xdf74('0x36')],function(_0x4f5400){var _0x3b0fb8={};_0x3b0fb8[_0x4f5400]={'$like':'%'+_0x231fb3[_0xdf74('0x33')][_0xdf74('0x3f')]+'%'};return _0x3b0fb8;})});}_0xc1fbe6=_[_0xdf74('0x40')]({},_0xc1fbe6,_0x231fb3[_0xdf74('0x42')]);return db[_0xdf74('0x58')][_0xdf74('0x45')](_0xc1fbe6);}})[_0xdf74('0x24')](function(_0x2ed403){if(_0x2ed403){return db[_0xdf74('0x5b')]['findAndCountAll']({'where':{'id':_[_0xdf74('0x2e')](_0x2ed403,_0xdf74('0x5c')),'role':_0xdf74('0x5d')},'attributes':['id',_0xdf74('0x2c'),'openchannelPause',_0xdf74('0x5e'),_0xdf74('0x5f')]});}})[_0xdf74('0x24')](function(_0x191b9a){if(_0x191b9a){return{'count':_0x191b9a['count'],'rows':_['map'](_0x191b9a['rows'],function(_0x7f1173){return{'membername':_0x7f1173[_0xdf74('0x2c')],'UserId':_0x7f1173['id'],'queue_name':_0x33049e[_0xdf74('0x2c')],'OpenchannelQueueId':_0x33049e['id'],'interface':util['format'](_0xdf74('0x60'),_0xdf74('0x61'),_0x7f1173[_0xdf74('0x2c')]),'penalty':0x0,'paused':_0x7f1173[_0xdf74('0x62')],'createdAt':_0x7f1173['createdAt'],'updatedAt':_0x7f1173[_0xdf74('0x5e')]};})};}else{return{'count':0x0,'rows':[]};}})['then'](respondWithFilteredResult(_0x37bc1c,_0xc1fbe6))[_0xdf74('0x47')](handleError(_0x37bc1c,null));};exports[_0xdf74('0x63')]=function(_0x4a1747,_0xec694b,_0x4ada24){var _0x23bb60={};var _0x2ee0ee={};var _0x89ef0a;var _0x5ef2e0;return db[_0xdf74('0x2f')][_0xdf74('0x57')]({'where':{'id':_0x4a1747[_0xdf74('0x49')]['id']}})[_0xdf74('0x24')](handleEntityNotFound(_0xec694b,null))[_0xdf74('0x24')](function(_0x5bc3b){if(_0x5bc3b){_0x89ef0a=_0x5bc3b;_0x2ee0ee['model']=_['keys'](db[_0xdf74('0x64')][_0xdf74('0x4b')]);_0x2ee0ee[_0xdf74('0x33')]=_['keys'](_0x4a1747[_0xdf74('0x33')]);_0x2ee0ee[_0xdf74('0x34')]=_['intersection'](_0x2ee0ee[_0xdf74('0x37')],_0x2ee0ee['query']);_0x23bb60[_0xdf74('0x36')]=_[_0xdf74('0x35')](_0x2ee0ee[_0xdf74('0x37')],qs['fields'](_0x4a1747[_0xdf74('0x33')]['fields']));_0x23bb60[_0xdf74('0x36')]=_0x23bb60[_0xdf74('0x36')][_0xdf74('0x39')]?_0x23bb60[_0xdf74('0x36')]:_0x2ee0ee['model'];_0x23bb60[_0xdf74('0x3b')]=qs[_0xdf74('0x3c')](_0x4a1747[_0xdf74('0x33')][_0xdf74('0x3c')]);_0x23bb60[_0xdf74('0x3d')]=qs[_0xdf74('0x34')](_[_0xdf74('0x3e')](_0x4a1747[_0xdf74('0x33')],_0x2ee0ee['filters']));if(_0x4a1747[_0xdf74('0x33')][_0xdf74('0x3f')]){_0x23bb60[_0xdf74('0x3d')]=_['merge'](_0x23bb60['where'],{'$or':_['map'](_0x23bb60[_0xdf74('0x36')],function(_0x5d4b96){var _0x17bbed={};_0x17bbed[_0x5d4b96]={'$like':'%'+_0x4a1747[_0xdf74('0x33')][_0xdf74('0x3f')]+'%'};return _0x17bbed;})});}_0x23bb60=_[_0xdf74('0x40')]({},_0x23bb60,_0x4a1747[_0xdf74('0x42')]);return _0x89ef0a['getTeams'](_0x23bb60);}})[_0xdf74('0x24')](function(_0x1d9f1c){if(_0x1d9f1c){_0x5ef2e0=_0x1d9f1c[_0xdf74('0x39')];if(!_0x4a1747[_0xdf74('0x33')][_0xdf74('0x3a')]('nolimit')){_0x23bb60['limit']=qs['limit'](_0x4a1747['query'][_0xdf74('0x1e')]);_0x23bb60[_0xdf74('0x1d')]=qs['offset'](_0x4a1747['query'][_0xdf74('0x1d')]);}return _0x89ef0a[_0xdf74('0x63')](_0x23bb60);}})['then'](function(_0x14a13b){if(_0x14a13b){return _0x14a13b?{'count':_0x5ef2e0,'rows':_0x14a13b}:null;}})[_0xdf74('0x24')](respondWithResult(_0xec694b,null))[_0xdf74('0x47')](handleError(_0xec694b,null));};exports[_0xdf74('0x65')]=function(_0x2e03aa,_0x2cb15c,_0x38c9c0){var _0x35536c=_0x2e03aa[_0xdf74('0x54')][_0xdf74('0x66')];return db[_0xdf74('0x64')]['findAll']({'where':{'id':_0x35536c},'attributes':['id'],'include':[{'model':db['User'],'as':_0xdf74('0x67'),'attributes':['id','name',_0xdf74('0x68'),_0xdf74('0x69'),_0xdf74('0x6a')],'raw':!![]}]})[_0xdf74('0x24')](function(_0x5a0308){if(_0x5a0308){var _0x23769a=_['flatMap'](_0x5a0308,function(_0x15e6cc){var _0x286524=_0x15e6cc[_0xdf74('0x26')]({'plain':!![]});return _0x286524[_0xdf74('0x67')];});return db[_0xdf74('0x2f')]['find']({'where':{'id':_0x2e03aa[_0xdf74('0x49')]['id']}})['then'](function(_0x53d19b){return db[_0xdf74('0x6b')][_0xdf74('0x6c')](function(_0x165166){return _0x53d19b['addTeams'](_0x35536c,{'transaction':_0x165166})[_0xdf74('0x24')](function(){return BPromise['each'](_0x23769a,function(_0x27b4f6){return db['UserOpenchannelQueue'][_0xdf74('0x6d')]({'where':{'UserId':_0x27b4f6['id'],'OpenchannelQueueId':_0x2e03aa[_0xdf74('0x49')]['id']},'transaction':_0x165166});});})[_0xdf74('0x24')](function(){_0x23769a['forEach'](function(_0x331023){socket[_0xdf74('0x6e')](_0xdf74('0x6f'),{'UserId':_0x331023['id'],'OpenchannelQueueId':_0x53d19b['id']});});});});});}})[_0xdf74('0x24')](respondWithStatusCode(_0x2cb15c,null))[_0xdf74('0x47')](handleError(_0x2cb15c,null));};exports[_0xdf74('0x70')]=function(_0x2c04bd,_0x5459f3,_0x59bdcf){return db[_0xdf74('0x64')][_0xdf74('0x45')]({'where':{'id':_0x2c04bd[_0xdf74('0x33')][_0xdf74('0x66')]},'attributes':['id'],'include':[{'model':db[_0xdf74('0x5b')],'as':_0xdf74('0x67'),'attributes':['id'],'raw':!![]}]})[_0xdf74('0x24')](handleEntityNotFound(_0x5459f3,null))['then'](function(_0x58b5be){var _0x431947=_[_0xdf74('0x2e')](_0x58b5be,'id');var _0x5a606c=[];var _0x363a86=[];var _0x4c5643=squel[_0xdf74('0x71')]();_0x4c5643[_0xdf74('0x72')](_0xdf74('0x73'))[_0xdf74('0x74')](_0xdf74('0x75'),'tq')['join'](_0xdf74('0x76'),'ut','ut.TeamId\x20=\x20tq.TeamId')[_0xdf74('0x3d')]('OpenchannelQueueId\x20=\x20?',_0x2c04bd[_0xdf74('0x49')]['id']);for(var _0xfa037b=0x0;_0xfa037b<_0x58b5be['length'];_0xfa037b+=0x1){let _0x49fefa=_0x58b5be[_0xfa037b];for(var _0x3b5b6e=0x0;_0x3b5b6e<_0x49fefa['Agents'][_0xdf74('0x39')];_0x3b5b6e+=0x1){let _0x4d15ae=_0x49fefa['Agents'][_0x3b5b6e];var _0x4c627c=_0x4c5643[_0xdf74('0x77')]();_0x4c627c[_0xdf74('0x3d')](_0xdf74('0x78'),_0x4d15ae['id']);_0x363a86[_0xdf74('0x79')](db[_0xdf74('0x6b')][_0xdf74('0x33')](_0x4c627c[_0xdf74('0x7a')](),{'type':db['sequelize'][_0xdf74('0x7b')][_0xdf74('0x7c')]})[_0xdf74('0x24')](function(_0x3a47c8){if(_0x3a47c8[_0xdf74('0x39')]===0x1){return _0x4d15ae['id'];}else{var _0x4e3aa8=_['every'](_[_0xdf74('0x2e')](_0x3a47c8,_0xdf74('0x7d')),function(_0x12a136){return _['includes'](_0x431947,_0x12a136);});if(_0x4e3aa8){return _0x4d15ae['id'];}}}));}}return BPromise['all'](_0x363a86)[_0xdf74('0x24')](function(_0x1679b4){_0x5a606c=_(_0x5a606c)[_0xdf74('0x7e')](_0x1679b4)[_0xdf74('0x7f')]()[_0xdf74('0x80')]();return db[_0xdf74('0x2f')][_0xdf74('0x50')]({'where':{'id':_0x2c04bd['params']['id']}})['then'](function(_0x4eb57a){return db[_0xdf74('0x6b')]['transaction'](function(_0x13754b){return _0x4eb57a['removeTeams'](_0x2c04bd[_0xdf74('0x33')][_0xdf74('0x66')],{'transaction':_0x13754b})[_0xdf74('0x24')](function(){if(!_[_0xdf74('0x81')](_0x5a606c)){return _0x4eb57a[_0xdf74('0x82')](_0x5a606c,{'transaction':_0x13754b});}})[_0xdf74('0x24')](function(){_0x5a606c[_0xdf74('0x83')](function(_0x169bd0){socket[_0xdf74('0x6e')](_0xdf74('0x84'),{'UserId':_0x169bd0,'OpenchannelQueueId':_0x4eb57a['id']});});});});});});})[_0xdf74('0x24')](respondWithStatusCode(_0x5459f3,null))['catch'](handleError(_0x5459f3,null));};exports['addAgents']=function(_0x26e826,_0x162e2b,_0x2b7872){return db['OpenchannelQueue'][_0xdf74('0x50')]({'where':{'id':_0x26e826[_0xdf74('0x49')]['id']}})['then'](handleEntityNotFound(_0x162e2b,null))[_0xdf74('0x24')](function(_0x317366){if(_0x317366){return _0x317366['addAgents'](_0x26e826[_0xdf74('0x54')][_0xdf74('0x66')],_[_0xdf74('0x85')](_0x26e826[_0xdf74('0x54')],[_0xdf74('0x66'),'id'])||{})['spread'](function(_0x15af04){for(var _0x1f03c5=0x0;_0x1f03c5<_0x26e826[_0xdf74('0x54')][_0xdf74('0x66')][_0xdf74('0x39')];_0x1f03c5+=0x1){socket[_0xdf74('0x6e')](_0xdf74('0x6f'),{'UserId':_0x26e826[_0xdf74('0x54')][_0xdf74('0x66')][_0x1f03c5],'OpenchannelQueueId':_0x26e826[_0xdf74('0x49')]['id']});}return _0x15af04;});}})['then'](respondWithResult(_0x162e2b,null))[_0xdf74('0x47')](handleError(_0x162e2b,null));};exports[_0xdf74('0x82')]=function(_0x53980c,_0x2c1473,_0x62ec12){return db[_0xdf74('0x2f')][_0xdf74('0x50')]({'where':{'id':_0x53980c[_0xdf74('0x49')]['id']}})[_0xdf74('0x24')](handleEntityNotFound(_0x2c1473,null))[_0xdf74('0x24')](function(_0x37ace9){if(_0x37ace9){return _0x37ace9[_0xdf74('0x82')](_0x53980c[_0xdf74('0x33')][_0xdf74('0x66')])[_0xdf74('0x24')](function(){if(_['isArray'](_0x53980c[_0xdf74('0x33')][_0xdf74('0x66')])){for(var _0x145ee9=0x0;_0x145ee9<_0x53980c[_0xdf74('0x33')][_0xdf74('0x66')][_0xdf74('0x39')];_0x145ee9+=0x1){socket[_0xdf74('0x6e')](_0xdf74('0x84'),{'UserId':Number(_0x53980c[_0xdf74('0x33')][_0xdf74('0x66')][_0x145ee9]),'OpenchannelQueueId':Number(_0x53980c[_0xdf74('0x49')]['id'])});}}else{socket[_0xdf74('0x6e')](_0xdf74('0x84'),{'UserId':Number(_0x53980c['query'][_0xdf74('0x66')]),'OpenchannelQueueId':Number(_0x53980c[_0xdf74('0x49')]['id'])});}});}})['then'](respondWithStatusCode(_0x2c1473,null))[_0xdf74('0x47')](handleError(_0x2c1473,null));};exports['getAgents']=function(_0x5768a7,_0xc69b2c,_0x9f37e5){var _0x45dd9e={};var _0x5a3639={};var _0x5d25cd;var _0x3a6d06;return db[_0xdf74('0x2f')][_0xdf74('0x57')]({'where':{'id':_0x5768a7['params']['id']}})[_0xdf74('0x24')](handleEntityNotFound(_0xc69b2c,null))['then'](function(_0x18de96){if(_0x18de96){_0x5d25cd=_0x18de96;_0x5a3639[_0xdf74('0x37')]=_[_0xdf74('0x4a')](db[_0xdf74('0x5b')][_0xdf74('0x4b')]);_0x5a3639[_0xdf74('0x33')]=_['keys'](_0x5768a7[_0xdf74('0x33')]);_0x5a3639[_0xdf74('0x34')]=_[_0xdf74('0x35')](_0x5a3639[_0xdf74('0x37')],_0x5a3639[_0xdf74('0x33')]);_0x45dd9e[_0xdf74('0x36')]=_[_0xdf74('0x35')](_0x5a3639[_0xdf74('0x37')],qs['fields'](_0x5768a7[_0xdf74('0x33')]['fields']));_0x45dd9e[_0xdf74('0x36')]=_0x45dd9e['attributes']['length']?_0x45dd9e['attributes']:_0x5a3639[_0xdf74('0x37')];_0x45dd9e['order']=qs[_0xdf74('0x3c')](_0x5768a7['query'][_0xdf74('0x3c')]);_0x45dd9e[_0xdf74('0x3d')]=qs[_0xdf74('0x34')](_[_0xdf74('0x3e')](_0x5768a7['query'],_0x5a3639['filters']));if(_0x5768a7[_0xdf74('0x33')][_0xdf74('0x3f')]){_0x45dd9e['where']=_[_0xdf74('0x40')](_0x45dd9e[_0xdf74('0x3d')],{'$or':_[_0xdf74('0x2e')](_0x45dd9e['attributes'],function(_0x4afda9){var _0x10daad={};_0x10daad[_0x4afda9]={'$like':'%'+_0x5768a7['query'][_0xdf74('0x3f')]+'%'};return _0x10daad;})});}_0x45dd9e=_[_0xdf74('0x40')]({},_0x45dd9e,_0x5768a7[_0xdf74('0x42')]);return _0x5d25cd[_0xdf74('0x86')](_0x45dd9e);}})[_0xdf74('0x24')](function(_0x1bf0a7){if(_0x1bf0a7){_0x3a6d06=_0x1bf0a7['length'];if(!_0x5768a7[_0xdf74('0x33')][_0xdf74('0x3a')](_0xdf74('0x59'))){_0x45dd9e[_0xdf74('0x1e')]=qs['limit'](_0x5768a7['query'][_0xdf74('0x1e')]);_0x45dd9e[_0xdf74('0x1d')]=qs['offset'](_0x5768a7[_0xdf74('0x33')][_0xdf74('0x1d')]);}return _0x5d25cd[_0xdf74('0x86')](_0x45dd9e);}})[_0xdf74('0x24')](function(_0x46901e){if(_0x46901e){return _0x46901e?{'count':_0x3a6d06,'rows':_0x46901e}:null;}})['then'](respondWithResult(_0xc69b2c,null))[_0xdf74('0x47')](handleError(_0xc69b2c,null));};
\ No newline at end of file
diff --git a/server/api/openchannelQueue/openchannelQueue.events.js b/server/api/openchannelQueue/openchannelQueue.events.js
index b7aa56a..e4b66cc 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 _0x59c7=['OpenchannelQueue','setMaxListeners','save','update','remove','emit','hasOwnProperty','hook','exports','events','../../mysqldb'];(function(_0x3dd15e,_0x1f0015){var _0x231fd0=function(_0x4f680a){while(--_0x4f680a){_0x3dd15e['push'](_0x3dd15e['shift']());}};_0x231fd0(++_0x1f0015);}(_0x59c7,0x1c1));var _0x759c=function(_0x36898f,_0x3d827a){_0x36898f=_0x36898f-0x0;var _0x3b18a7=_0x59c7[_0x36898f];return _0x3b18a7;};'use strict';var EventEmitter=require(_0x759c('0x0'));var OpenchannelQueue=require(_0x759c('0x1'))['db'][_0x759c('0x2')];var OpenchannelQueueEvents=new EventEmitter();OpenchannelQueueEvents[_0x759c('0x3')](0x0);var events={'afterCreate':_0x759c('0x4'),'afterUpdate':_0x759c('0x5'),'afterDestroy':_0x759c('0x6')};function emitEvent(_0x1cc546){return function(_0x5e2bfa,_0x3b8fab,_0x3c8995){OpenchannelQueueEvents[_0x759c('0x7')](_0x1cc546+':'+_0x5e2bfa['id'],_0x5e2bfa);OpenchannelQueueEvents[_0x759c('0x7')](_0x1cc546,_0x5e2bfa);_0x3c8995(null);};}for(var e in events){if(events[_0x759c('0x8')](e)){var event=events[e];OpenchannelQueue[_0x759c('0x9')](e,emitEvent(event));}}module[_0x759c('0xa')]=OpenchannelQueueEvents;
\ No newline at end of file
+var _0xaaf7=['../../mysqldb','OpenchannelQueue','setMaxListeners','update','remove','emit','exports','events'];(function(_0x1deb03,_0xd05ad8){var _0x189fe7=function(_0x321225){while(--_0x321225){_0x1deb03['push'](_0x1deb03['shift']());}};_0x189fe7(++_0xd05ad8);}(_0xaaf7,0xcf));var _0x7aaf=function(_0x341053,_0x310529){_0x341053=_0x341053-0x0;var _0x1a6af4=_0xaaf7[_0x341053];return _0x1a6af4;};'use strict';var EventEmitter=require(_0x7aaf('0x0'));var OpenchannelQueue=require(_0x7aaf('0x1'))['db'][_0x7aaf('0x2')];var OpenchannelQueueEvents=new EventEmitter();OpenchannelQueueEvents[_0x7aaf('0x3')](0x0);var events={'afterCreate':'save','afterUpdate':_0x7aaf('0x4'),'afterDestroy':_0x7aaf('0x5')};function emitEvent(_0x240dfe){return function(_0x13dfb3,_0x3b38a8,_0x3faa50){OpenchannelQueueEvents['emit'](_0x240dfe+':'+_0x13dfb3['id'],_0x13dfb3);OpenchannelQueueEvents[_0x7aaf('0x6')](_0x240dfe,_0x13dfb3);_0x3faa50(null);};}for(var e in events){if(events['hasOwnProperty'](e)){var event=events[e];OpenchannelQueue['hook'](e,emitEvent(event));}}module[_0x7aaf('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 6d47381..1100f1c 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 _0xe3da=['bluebird','request-promise','path','rimraf','../../config/environment','exports','OpenchannelQueue','openchannel_queues','lodash','util','api','moment'];(function(_0x321bb2,_0x202794){var _0x9c12ed=function(_0x263dd3){while(--_0x263dd3){_0x321bb2['push'](_0x321bb2['shift']());}};_0x9c12ed(++_0x202794);}(_0xe3da,0x1e8));var _0xae3d=function(_0xfae23b,_0x2be4ba){_0xfae23b=_0xfae23b-0x0;var _0x200640=_0xe3da[_0xfae23b];return _0x200640;};'use strict';var _=require(_0xae3d('0x0'));var util=require(_0xae3d('0x1'));var logger=require('../../config/logger')(_0xae3d('0x2'));var moment=require(_0xae3d('0x3'));var BPromise=require(_0xae3d('0x4'));var rp=require(_0xae3d('0x5'));var fs=require('fs');var path=require(_0xae3d('0x6'));var rimraf=require(_0xae3d('0x7'));var config=require(_0xae3d('0x8'));var attributes=require('./openchannelQueue.attributes');module[_0xae3d('0x9')]=function(_0x4f06ca,_0x1a78fe){return _0x4f06ca['define'](_0xae3d('0xa'),attributes,{'tableName':_0xae3d('0xb'),'paranoid':![],'indexes':[],'timestamps':!![]});};
\ No newline at end of file
+var _0xa7fa=['exports','openchannel_queues','lodash','api','moment','bluebird','request-promise','rimraf','../../config/environment','./openchannelQueue.attributes'];(function(_0xf973b7,_0x46699f){var _0x499087=function(_0x45b42f){while(--_0x45b42f){_0xf973b7['push'](_0xf973b7['shift']());}};_0x499087(++_0x46699f);}(_0xa7fa,0xfc));var _0xaa7f=function(_0x14add3,_0x13ce8d){_0x14add3=_0x14add3-0x0;var _0x4a174f=_0xa7fa[_0x14add3];return _0x4a174f;};'use strict';var _=require(_0xaa7f('0x0'));var util=require('util');var logger=require('../../config/logger')(_0xaa7f('0x1'));var moment=require(_0xaa7f('0x2'));var BPromise=require(_0xaa7f('0x3'));var rp=require(_0xaa7f('0x4'));var fs=require('fs');var path=require('path');var rimraf=require(_0xaa7f('0x5'));var config=require(_0xaa7f('0x6'));var attributes=require(_0xaa7f('0x7'));module[_0xaa7f('0x8')]=function(_0x48e98f,_0xf79d63){return _0x48e98f['define']('OpenchannelQueue',attributes,{'tableName':_0xaa7f('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 4c8120e..f0d05a2 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 _0x082c=['lodash','util','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/logger','rpc','../../config/environment','jayson/promise','client','redis','localhost','socket.io-emitter','request','info','request\x20sent','debug','stringify','code','error','message','OpenchannelQueue,\x20%s,\x20%s','GetOpenchannelQueue','OpenchannelQueue','findAll','options','raw','where','attributes','map','include','model','then','catch','find','ShowOpenchannelQueue'];(function(_0x2268bb,_0x5be780){var _0x2b570c=function(_0x58b59f){while(--_0x58b59f){_0x2268bb['push'](_0x2268bb['shift']());}};_0x2b570c(++_0x5be780);}(_0x082c,0x98));var _0xc082=function(_0x1537dc,_0x2a6c1c){_0x1537dc=_0x1537dc-0x0;var _0x331ebb=_0x082c[_0x1537dc];return _0x331ebb;};'use strict';var _=require(_0xc082('0x0'));var util=require(_0xc082('0x1'));var moment=require(_0xc082('0x2'));var BPromise=require(_0xc082('0x3'));var rs=require(_0xc082('0x4'));var fs=require('fs');var Redis=require(_0xc082('0x5'));var db=require(_0xc082('0x6'))['db'];var utils=require('../../config/utils');var logger=require(_0xc082('0x7'))(_0xc082('0x8'));var config=require(_0xc082('0x9'));var jayson=require(_0xc082('0xa'));var client=jayson[_0xc082('0xb')]['http']({'port':0x232a});config[_0xc082('0xc')]=_['defaults'](config['redis'],{'host':_0xc082('0xd'),'port':0x18eb});var socket=require(_0xc082('0xe'))(new Redis(config[_0xc082('0xc')]));require('./openchannelQueue.socket')['register'](socket);function respondWithRpcPromise(_0x2803ff,_0x49c2b3,_0x32f5a4){return new BPromise(function(_0x2dfa6d,_0x623c05){return client[_0xc082('0xf')](_0x2803ff,_0x32f5a4)['then'](function(_0x1dd9bc){logger[_0xc082('0x10')]('OpenchannelQueue,\x20%s,\x20%s',_0x49c2b3,_0xc082('0x11'));logger[_0xc082('0x12')]('OpenchannelQueue,\x20%s,\x20%s,\x20%s',_0x49c2b3,_0xc082('0x11'),JSON[_0xc082('0x13')](_0x1dd9bc));if(_0x1dd9bc['error']){if(_0x1dd9bc['error'][_0xc082('0x14')]===0x1f4){logger[_0xc082('0x15')]('OpenchannelQueue,\x20%s,\x20%s',_0x49c2b3,_0x1dd9bc[_0xc082('0x15')][_0xc082('0x16')]);return _0x623c05(_0x1dd9bc[_0xc082('0x15')][_0xc082('0x16')]);}logger[_0xc082('0x15')](_0xc082('0x17'),_0x49c2b3,_0x1dd9bc['error']['message']);return _0x2dfa6d(_0x1dd9bc['error'][_0xc082('0x16')]);}else{logger['info'](_0xc082('0x17'),_0x49c2b3,'request\x20sent');_0x2dfa6d(_0x1dd9bc['result'][_0xc082('0x16')]);}})['catch'](function(_0x43b2f1){logger['error'](_0xc082('0x17'),_0x49c2b3,_0x43b2f1);_0x623c05(_0x43b2f1);});});}exports[_0xc082('0x18')]=function(_0x360c9d){var _0x3e773d=this;return new Promise(function(_0x2788a6,_0x2c4c30){return db[_0xc082('0x19')][_0xc082('0x1a')]({'raw':_0x360c9d[_0xc082('0x1b')]?_0x360c9d[_0xc082('0x1b')][_0xc082('0x1c')]===undefined?!![]:![]:!![],'where':_0x360c9d[_0xc082('0x1b')]?_0x360c9d[_0xc082('0x1b')][_0xc082('0x1d')]||null:null,'attributes':_0x360c9d[_0xc082('0x1b')]?_0x360c9d[_0xc082('0x1b')][_0xc082('0x1e')]||null:null,'limit':_0x360c9d[_0xc082('0x1b')]?_0x360c9d[_0xc082('0x1b')]['limit']||null:null,'include':_0x360c9d[_0xc082('0x1b')]?_0x360c9d[_0xc082('0x1b')]['include']?_[_0xc082('0x1f')](_0x360c9d['options'][_0xc082('0x20')],function(_0x246b4f){return{'model':db[_0x246b4f[_0xc082('0x21')]],'as':_0x246b4f['as'],'attributes':_0x246b4f[_0xc082('0x1e')],'include':_0x246b4f[_0xc082('0x20')]?_[_0xc082('0x1f')](_0x246b4f[_0xc082('0x20')],function(_0x30ee8f){return{'model':db[_0x30ee8f[_0xc082('0x21')]],'as':_0x30ee8f['as'],'attributes':_0x30ee8f['attributes'],'include':_0x30ee8f[_0xc082('0x20')]?_[_0xc082('0x1f')](_0x30ee8f[_0xc082('0x20')],function(_0x2e0648){return{'model':db[_0x2e0648[_0xc082('0x21')]],'as':_0x2e0648['as'],'attributes':_0x2e0648[_0xc082('0x1e')]};}):[]};}):[]};}):[]:[]})[_0xc082('0x22')](function(_0x28c982){logger[_0xc082('0x10')](_0xc082('0x18'),_0x360c9d);logger[_0xc082('0x12')](_0xc082('0x18'),_0x360c9d,JSON[_0xc082('0x13')](_0x28c982));_0x2788a6(_0x28c982);})[_0xc082('0x23')](function(_0x484dc3){logger[_0xc082('0x15')]('GetOpenchannelQueue',_0x484dc3['message'],_0x360c9d);_0x2c4c30(_0x3e773d[_0xc082('0x15')](0x1f4,_0x484dc3[_0xc082('0x16')]));});});};exports['ShowOpenchannelQueue']=function(_0x37b344){var _0x1c85d7=this;return new Promise(function(_0x5b86bd,_0x4634d8){return db[_0xc082('0x19')][_0xc082('0x24')]({'raw':_0x37b344[_0xc082('0x1b')]?_0x37b344['options']['raw']===undefined?!![]:![]:!![],'where':_0x37b344[_0xc082('0x1b')]?_0x37b344['options'][_0xc082('0x1d')]||null:null,'attributes':_0x37b344[_0xc082('0x1b')]?_0x37b344[_0xc082('0x1b')]['attributes']||null:null,'include':_0x37b344['options']?_0x37b344['options'][_0xc082('0x20')]?_['map'](_0x37b344['options'][_0xc082('0x20')],function(_0x13e097){return{'model':db[_0x13e097['model']],'as':_0x13e097['as'],'attributes':_0x13e097[_0xc082('0x1e')],'include':_0x13e097['include']?_[_0xc082('0x1f')](_0x13e097[_0xc082('0x20')],function(_0x5dcecf){return{'model':db[_0x5dcecf[_0xc082('0x21')]],'as':_0x5dcecf['as'],'attributes':_0x5dcecf[_0xc082('0x1e')],'include':_0x5dcecf[_0xc082('0x20')]?_['map'](_0x5dcecf['include'],function(_0x9fae7d){return{'model':db[_0x9fae7d[_0xc082('0x21')]],'as':_0x9fae7d['as'],'attributes':_0x9fae7d[_0xc082('0x1e')]};}):[]};}):[]};}):[]:[]})[_0xc082('0x22')](function(_0x416958){logger[_0xc082('0x10')](_0xc082('0x25'),_0x37b344);logger[_0xc082('0x12')](_0xc082('0x25'),_0x37b344,JSON[_0xc082('0x13')](_0x416958));_0x5b86bd(_0x416958);})['catch'](function(_0x14856d){logger[_0xc082('0x15')](_0xc082('0x25'),_0x14856d[_0xc082('0x16')],_0x37b344);_0x4634d8(_0x1c85d7[_0xc082('0x15')](0x1f4,_0x14856d[_0xc082('0x16')]));});});};
\ No newline at end of file
+var _0xb271=['redis','defaults','localhost','socket.io-emitter','./openchannelQueue.socket','request','then','OpenchannelQueue,\x20%s,\x20%s','debug','OpenchannelQueue,\x20%s,\x20%s,\x20%s','stringify','error','code','message','request\x20sent','result','catch','findAll','options','raw','where','attributes','limit','include','map','model','GetOpenchannelQueue','find','info','ShowOpenchannelQueue','lodash','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/logger','rpc','../../config/environment','jayson/promise','client','http'];(function(_0x2c27f0,_0x51fc6f){var _0x142df6=function(_0x24e70f){while(--_0x24e70f){_0x2c27f0['push'](_0x2c27f0['shift']());}};_0x142df6(++_0x51fc6f);}(_0xb271,0x144));var _0x1b27=function(_0x1a0755,_0x47d93a){_0x1a0755=_0x1a0755-0x0;var _0x2e3a42=_0xb271[_0x1a0755];return _0x2e3a42;};'use strict';var _=require(_0x1b27('0x0'));var util=require('util');var moment=require(_0x1b27('0x1'));var BPromise=require(_0x1b27('0x2'));var rs=require(_0x1b27('0x3'));var fs=require('fs');var Redis=require(_0x1b27('0x4'));var db=require(_0x1b27('0x5'))['db'];var utils=require('../../config/utils');var logger=require(_0x1b27('0x6'))(_0x1b27('0x7'));var config=require(_0x1b27('0x8'));var jayson=require(_0x1b27('0x9'));var client=jayson[_0x1b27('0xa')][_0x1b27('0xb')]({'port':0x232a});config[_0x1b27('0xc')]=_[_0x1b27('0xd')](config[_0x1b27('0xc')],{'host':_0x1b27('0xe'),'port':0x18eb});var socket=require(_0x1b27('0xf'))(new Redis(config['redis']));require(_0x1b27('0x10'))['register'](socket);function respondWithRpcPromise(_0x23fdda,_0x27c4a9,_0x307741){return new BPromise(function(_0x474441,_0x4b88a9){return client[_0x1b27('0x11')](_0x23fdda,_0x307741)[_0x1b27('0x12')](function(_0x531e33){logger['info'](_0x1b27('0x13'),_0x27c4a9,'request\x20sent');logger[_0x1b27('0x14')](_0x1b27('0x15'),_0x27c4a9,'request\x20sent',JSON[_0x1b27('0x16')](_0x531e33));if(_0x531e33['error']){if(_0x531e33[_0x1b27('0x17')][_0x1b27('0x18')]===0x1f4){logger[_0x1b27('0x17')](_0x1b27('0x13'),_0x27c4a9,_0x531e33[_0x1b27('0x17')][_0x1b27('0x19')]);return _0x4b88a9(_0x531e33['error'][_0x1b27('0x19')]);}logger[_0x1b27('0x17')](_0x1b27('0x13'),_0x27c4a9,_0x531e33['error'][_0x1b27('0x19')]);return _0x474441(_0x531e33[_0x1b27('0x17')][_0x1b27('0x19')]);}else{logger['info'](_0x1b27('0x13'),_0x27c4a9,_0x1b27('0x1a'));_0x474441(_0x531e33[_0x1b27('0x1b')][_0x1b27('0x19')]);}})[_0x1b27('0x1c')](function(_0x1eccba){logger['error'](_0x1b27('0x13'),_0x27c4a9,_0x1eccba);_0x4b88a9(_0x1eccba);});});}exports['GetOpenchannelQueue']=function(_0x5638ef){var _0x44e214=this;return new Promise(function(_0x500f83,_0xb8f1c9){return db['OpenchannelQueue'][_0x1b27('0x1d')]({'raw':_0x5638ef[_0x1b27('0x1e')]?_0x5638ef[_0x1b27('0x1e')][_0x1b27('0x1f')]===undefined?!![]:![]:!![],'where':_0x5638ef[_0x1b27('0x1e')]?_0x5638ef[_0x1b27('0x1e')][_0x1b27('0x20')]||null:null,'attributes':_0x5638ef['options']?_0x5638ef[_0x1b27('0x1e')][_0x1b27('0x21')]||null:null,'limit':_0x5638ef[_0x1b27('0x1e')]?_0x5638ef[_0x1b27('0x1e')][_0x1b27('0x22')]||null:null,'include':_0x5638ef['options']?_0x5638ef['options'][_0x1b27('0x23')]?_[_0x1b27('0x24')](_0x5638ef[_0x1b27('0x1e')][_0x1b27('0x23')],function(_0x456484){return{'model':db[_0x456484[_0x1b27('0x25')]],'as':_0x456484['as'],'attributes':_0x456484['attributes'],'include':_0x456484['include']?_[_0x1b27('0x24')](_0x456484[_0x1b27('0x23')],function(_0x4f1f8f){return{'model':db[_0x4f1f8f[_0x1b27('0x25')]],'as':_0x4f1f8f['as'],'attributes':_0x4f1f8f[_0x1b27('0x21')],'include':_0x4f1f8f[_0x1b27('0x23')]?_[_0x1b27('0x24')](_0x4f1f8f[_0x1b27('0x23')],function(_0x1da855){return{'model':db[_0x1da855['model']],'as':_0x1da855['as'],'attributes':_0x1da855[_0x1b27('0x21')]};}):[]};}):[]};}):[]:[]})[_0x1b27('0x12')](function(_0x33bc34){logger['info'](_0x1b27('0x26'),_0x5638ef);logger[_0x1b27('0x14')](_0x1b27('0x26'),_0x5638ef,JSON['stringify'](_0x33bc34));_0x500f83(_0x33bc34);})[_0x1b27('0x1c')](function(_0x361c5d){logger[_0x1b27('0x17')](_0x1b27('0x26'),_0x361c5d[_0x1b27('0x19')],_0x5638ef);_0xb8f1c9(_0x44e214[_0x1b27('0x17')](0x1f4,_0x361c5d[_0x1b27('0x19')]));});});};exports['ShowOpenchannelQueue']=function(_0x5b1aed){var _0x7277d0=this;return new Promise(function(_0x3c4f8e,_0x120d84){return db['OpenchannelQueue'][_0x1b27('0x27')]({'raw':_0x5b1aed[_0x1b27('0x1e')]?_0x5b1aed[_0x1b27('0x1e')][_0x1b27('0x1f')]===undefined?!![]:![]:!![],'where':_0x5b1aed[_0x1b27('0x1e')]?_0x5b1aed[_0x1b27('0x1e')]['where']||null:null,'attributes':_0x5b1aed[_0x1b27('0x1e')]?_0x5b1aed[_0x1b27('0x1e')][_0x1b27('0x21')]||null:null,'include':_0x5b1aed[_0x1b27('0x1e')]?_0x5b1aed[_0x1b27('0x1e')][_0x1b27('0x23')]?_[_0x1b27('0x24')](_0x5b1aed[_0x1b27('0x1e')]['include'],function(_0xff6fbf){return{'model':db[_0xff6fbf['model']],'as':_0xff6fbf['as'],'attributes':_0xff6fbf['attributes'],'include':_0xff6fbf[_0x1b27('0x23')]?_[_0x1b27('0x24')](_0xff6fbf[_0x1b27('0x23')],function(_0x558d6e){return{'model':db[_0x558d6e[_0x1b27('0x25')]],'as':_0x558d6e['as'],'attributes':_0x558d6e[_0x1b27('0x21')],'include':_0x558d6e[_0x1b27('0x23')]?_[_0x1b27('0x24')](_0x558d6e[_0x1b27('0x23')],function(_0x3bf779){return{'model':db[_0x3bf779[_0x1b27('0x25')]],'as':_0x3bf779['as'],'attributes':_0x3bf779[_0x1b27('0x21')]};}):[]};}):[]};}):[]:[]})[_0x1b27('0x12')](function(_0x125780){logger[_0x1b27('0x28')](_0x1b27('0x29'),_0x5b1aed);logger[_0x1b27('0x14')](_0x1b27('0x29'),_0x5b1aed,JSON['stringify'](_0x125780));_0x3c4f8e(_0x125780);})['catch'](function(_0x542b1b){logger[_0x1b27('0x17')](_0x1b27('0x29'),_0x542b1b['message'],_0x5b1aed);_0x120d84(_0x7277d0[_0x1b27('0x17')](0x1f4,_0x542b1b['message']));});});};
\ No newline at end of file
diff --git a/server/api/openchannelQueue/openchannelQueue.socket.js b/server/api/openchannelQueue/openchannelQueue.socket.js
index 9c8b2ba..6644b89 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 _0x1d76=['./openchannelQueue.events','save','remove','update','removeListener','register','length','openchannelQueue:'];(function(_0x38b0fb,_0x3c907a){var _0x414e2d=function(_0x144c53){while(--_0x144c53){_0x38b0fb['push'](_0x38b0fb['shift']());}};_0x414e2d(++_0x3c907a);}(_0x1d76,0x80));var _0x61d7=function(_0x1066a1,_0x10801f){_0x1066a1=_0x1066a1-0x0;var _0x3a5d97=_0x1d76[_0x1066a1];return _0x3a5d97;};'use strict';var OpenchannelQueueEvents=require(_0x61d7('0x0'));var events=[_0x61d7('0x1'),_0x61d7('0x2'),_0x61d7('0x3')];function createListener(_0x45fe10,_0x18f644){return function(_0x6861a3){_0x18f644['emit'](_0x45fe10,_0x6861a3);};}function removeListener(_0x184c42,_0x19524b){return function(){OpenchannelQueueEvents[_0x61d7('0x4')](_0x184c42,_0x19524b);};}exports[_0x61d7('0x5')]=function(_0x587bff){for(var _0x594e17=0x0,_0xa09763=events[_0x61d7('0x6')];_0x594e17<_0xa09763;_0x594e17++){var _0x5ebd8d=events[_0x594e17];var _0x9b25c9=createListener(_0x61d7('0x7')+_0x5ebd8d,_0x587bff);OpenchannelQueueEvents['on'](_0x5ebd8d,_0x9b25c9);}};
\ No newline at end of file
+var _0xddcf=['length','openchannelQueue:','./openchannelQueue.events','remove','update','emit','removeListener','register'];(function(_0x40220a,_0x22feb1){var _0x3903cc=function(_0x33a296){while(--_0x33a296){_0x40220a['push'](_0x40220a['shift']());}};_0x3903cc(++_0x22feb1);}(_0xddcf,0x12a));var _0xfddc=function(_0x59ee6f,_0x450239){_0x59ee6f=_0x59ee6f-0x0;var _0x4c0979=_0xddcf[_0x59ee6f];return _0x4c0979;};'use strict';var OpenchannelQueueEvents=require(_0xfddc('0x0'));var events=['save',_0xfddc('0x1'),_0xfddc('0x2')];function createListener(_0xad090e,_0xea6bcf){return function(_0x339d88){_0xea6bcf[_0xfddc('0x3')](_0xad090e,_0x339d88);};}function removeListener(_0x30c7d9,_0x175f7e){return function(){OpenchannelQueueEvents[_0xfddc('0x4')](_0x30c7d9,_0x175f7e);};}exports[_0xfddc('0x5')]=function(_0x169541){for(var _0x3fc6d3=0x0,_0x1df83a=events[_0xfddc('0x6')];_0x3fc6d3<_0x1df83a;_0x3fc6d3++){var _0xdaa60f=events[_0x3fc6d3];var _0x4ade9d=createListener(_0xfddc('0x7')+_0xdaa60f,_0x169541);OpenchannelQueueEvents['on'](_0xdaa60f,_0x4ade9d);}};
\ No newline at end of file
diff --git a/server/api/openchannelQueueReport/index.js b/server/api/openchannelQueueReport/index.js
index 41ccfbc..b672136 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 _0x04e0=['get','describe','/:id','show','post','isAuthenticated','create','update','delete','exports','util','path','Router','../../components/auth/service','../../components/interaction/service','../../config/environment','./openchannelQueueReport.controller'];(function(_0x12fc8d,_0x19ee33){var _0x3f9d04=function(_0x52e51c){while(--_0x52e51c){_0x12fc8d['push'](_0x12fc8d['shift']());}};_0x3f9d04(++_0x19ee33);}(_0x04e0,0x180));var _0x004e=function(_0xc8e55a,_0x267d6b){_0xc8e55a=_0xc8e55a-0x0;var _0x41ade1=_0x04e0[_0xc8e55a];return _0x41ade1;};'use strict';var multer=require('multer');var util=require(_0x004e('0x0'));var path=require(_0x004e('0x1'));var timeout=require('connect-timeout');var express=require('express');var router=express[_0x004e('0x2')]();var auth=require(_0x004e('0x3'));var interaction=require(_0x004e('0x4'));var config=require(_0x004e('0x5'));var controller=require(_0x004e('0x6'));router[_0x004e('0x7')]('/',auth['isAuthenticated'](),controller['index']);router['get']('/describe',auth['isAuthenticated'](),controller[_0x004e('0x8')]);router[_0x004e('0x7')](_0x004e('0x9'),auth['isAuthenticated'](),controller[_0x004e('0xa')]);router[_0x004e('0xb')]('/',auth[_0x004e('0xc')](),controller[_0x004e('0xd')]);router['put'](_0x004e('0x9'),auth[_0x004e('0xc')](),controller[_0x004e('0xe')]);router[_0x004e('0xf')](_0x004e('0x9'),auth[_0x004e('0xc')](),controller['destroy']);module[_0x004e('0x10')]=router;
\ No newline at end of file
+var _0x0a66=['./openchannelQueueReport.controller','get','isAuthenticated','index','/:id','show','post','create','put','update','destroy','exports','multer','path','express','Router','../../components/interaction/service'];(function(_0xaa0309,_0x1c8008){var _0x5de7ce=function(_0x3aa6ae){while(--_0x3aa6ae){_0xaa0309['push'](_0xaa0309['shift']());}};_0x5de7ce(++_0x1c8008);}(_0x0a66,0x83));var _0x60a6=function(_0x14add3,_0x13ce8d){_0x14add3=_0x14add3-0x0;var _0x4a174f=_0x0a66[_0x14add3];return _0x4a174f;};'use strict';var multer=require(_0x60a6('0x0'));var util=require('util');var path=require(_0x60a6('0x1'));var timeout=require('connect-timeout');var express=require(_0x60a6('0x2'));var router=express[_0x60a6('0x3')]();var auth=require('../../components/auth/service');var interaction=require(_0x60a6('0x4'));var config=require('../../config/environment');var controller=require(_0x60a6('0x5'));router[_0x60a6('0x6')]('/',auth[_0x60a6('0x7')](),controller[_0x60a6('0x8')]);router[_0x60a6('0x6')]('/describe',auth['isAuthenticated'](),controller['describe']);router['get'](_0x60a6('0x9'),auth[_0x60a6('0x7')](),controller[_0x60a6('0xa')]);router[_0x60a6('0xb')]('/',auth[_0x60a6('0x7')](),controller[_0x60a6('0xc')]);router[_0x60a6('0xd')](_0x60a6('0x9'),auth[_0x60a6('0x7')](),controller[_0x60a6('0xe')]);router['delete']('/:id',auth['isAuthenticated'](),controller[_0x60a6('0xf')]);module[_0x60a6('0x10')]=router;
\ No newline at end of file
diff --git a/server/api/openchannelQueueReport/openchannelQueueReport.attributes.js b/server/api/openchannelQueueReport/openchannelQueueReport.attributes.js
index 0865481..881875b 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 _0x6702=['sequelize','STRING','DATE'];(function(_0x254541,_0x44652a){var _0x463645=function(_0x2f490b){while(--_0x2f490b){_0x254541['push'](_0x254541['shift']());}};_0x463645(++_0x44652a);}(_0x6702,0xd8));var _0x2670=function(_0x1da527,_0x2dc953){_0x1da527=_0x1da527-0x0;var _0x40fc7c=_0x6702[_0x1da527];return _0x40fc7c;};'use strict';var moment=require('moment');var Sequelize=require(_0x2670('0x0'));module['exports']={'uniqueid':{'type':Sequelize[_0x2670('0x1')],'allowNull':![]},'from':{'type':Sequelize[_0x2670('0x1')]},'joinAt':{'type':Sequelize['DATE']},'leaveAt':{'type':Sequelize['DATE']},'acceptAt':{'type':Sequelize[_0x2670('0x2')]},'exitAt':{'type':Sequelize[_0x2670('0x2')]},'reason':{'type':Sequelize[_0x2670('0x1')]}};
\ No newline at end of file
+var _0x9411=['exports','STRING','DATE'];(function(_0x3476bb,_0x39ec58){var _0x12151b=function(_0x585dcf){while(--_0x585dcf){_0x3476bb['push'](_0x3476bb['shift']());}};_0x12151b(++_0x39ec58);}(_0x9411,0x1cb));var _0x1941=function(_0x1baf45,_0x34143f){_0x1baf45=_0x1baf45-0x0;var _0x3f961a=_0x9411[_0x1baf45];return _0x3f961a;};'use strict';var moment=require('moment');var Sequelize=require('sequelize');module[_0x1941('0x0')]={'uniqueid':{'type':Sequelize[_0x1941('0x1')],'allowNull':![]},'from':{'type':Sequelize[_0x1941('0x1')]},'joinAt':{'type':Sequelize[_0x1941('0x2')]},'leaveAt':{'type':Sequelize[_0x1941('0x2')]},'acceptAt':{'type':Sequelize['DATE']},'exitAt':{'type':Sequelize[_0x1941('0x2')]},'reason':{'type':Sequelize['STRING']}};
\ No newline at end of file
diff --git a/server/api/openchannelQueueReport/openchannelQueueReport.controller.js b/server/api/openchannelQueueReport/openchannelQueueReport.controller.js
index 1700213..0e35056 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 _0x32b6=['status','json','offset','limit','set','apply','reject','save','then','stack','name','index','map','OpenchannelQueueReport','fieldName','type','key','model','query','keys','filters','intersection','attributes','fields','length','hasOwnProperty','order','sort','pick','filter','where','merge','VIRTUAL','options','count','includeAll','include','params','rawAttributes','find','catch','create','update','body','describe','html-pdf','eml-format','zip-dir','fast-json-patch','bluebird','mustache','util','path','sox','to-csv','ejs','lodash','squel','crypto','desk.js','querystring','papaparse','../../components/parsers/advancedSearch','../../config/logger','api','../../config/utils','../../config/environment','../../mysqldb','sendStatus','end'];(function(_0x321bb2,_0x202794){var _0x9c12ed=function(_0x263dd3){while(--_0x263dd3){_0x321bb2['push'](_0x321bb2['shift']());}};_0x9c12ed(++_0x202794);}(_0x32b6,0x1d1));var _0x632b=function(_0x2167d0,_0x15cef4){_0x2167d0=_0x2167d0-0x0;var _0x127eaa=_0x32b6[_0x2167d0];return _0x127eaa;};'use strict';var pdf=require(_0x632b('0x0'));var emlformat=require(_0x632b('0x1'));var rimraf=require('rimraf');var zipdir=require(_0x632b('0x2'));var jsonpatch=require(_0x632b('0x3'));var rp=require('request-promise');var moment=require('moment');var BPromise=require(_0x632b('0x4'));var Mustache=require(_0x632b('0x5'));var util=require(_0x632b('0x6'));var path=require(_0x632b('0x7'));var sox=require(_0x632b('0x8'));var csv=require(_0x632b('0x9'));var ejs=require(_0x632b('0xa'));var fs=require('fs');var _=require(_0x632b('0xb'));var squel=require(_0x632b('0xc'));var crypto=require(_0x632b('0xd'));var jsforce=require('jsforce');var deskjs=require(_0x632b('0xe'));var toCsv=require(_0x632b('0x9'));var querystring=require(_0x632b('0xf'));var Papa=require(_0x632b('0x10'));var Redis=require('ioredis');var authService=require('../../components/auth/service');var qs=require('../../components/parsers/qs');var as=require(_0x632b('0x11'));var hardwareService=require('../../config/license/hardware');var logger=require(_0x632b('0x12'))(_0x632b('0x13'));var utils=require(_0x632b('0x14'));var config=require(_0x632b('0x15'));var db=require(_0x632b('0x16'))['db'];function respondWithStatusCode(_0x2e1dbc,_0xe81378){_0xe81378=_0xe81378||0xcc;return function(_0x3d8bed){if(_0x3d8bed){return _0x2e1dbc[_0x632b('0x17')](_0xe81378);}return _0x2e1dbc['status'](_0xe81378)[_0x632b('0x18')]();};}function respondWithResult(_0x286f75,_0x9246a6){_0x9246a6=_0x9246a6||0xc8;return function(_0x5a97da){if(_0x5a97da){return _0x286f75[_0x632b('0x19')](_0x9246a6)[_0x632b('0x1a')](_0x5a97da);}};}function respondWithFilteredResult(_0x108249,_0x17ff9b){return function(_0x40d410){if(_0x40d410){var _0x21cdd3=_0x40d410['count'],_0x4efe39=_0x17ff9b[_0x632b('0x1b')],_0x17ddc5=_0x17ff9b['offset']+_0x17ff9b[_0x632b('0x1c')],_0x52f353;if(_0x17ddc5>=_0x21cdd3){_0x17ddc5=_0x21cdd3;_0x52f353=0xc8;}else{_0x52f353=0xce;}_0x108249[_0x632b('0x19')](_0x52f353);return _0x108249[_0x632b('0x1d')]('Content-Range',_0x4efe39+'-'+_0x17ddc5+'/'+_0x21cdd3)[_0x632b('0x1a')](_0x40d410);}return null;};}function patchUpdates(_0x32ca1){return function(_0x366028){try{jsonpatch[_0x632b('0x1e')](_0x366028,_0x32ca1,!![]);}catch(_0x5baa04){return BPromise[_0x632b('0x1f')](_0x5baa04);}return _0x366028[_0x632b('0x20')]();};}function saveUpdates(_0x4f377f,_0x116f62){return function(_0x50b930){if(_0x50b930){return _0x50b930['update'](_0x4f377f)[_0x632b('0x21')](function(_0x5ce3fa){return _0x5ce3fa;});}return null;};}function removeEntity(_0xc9d237,_0x1c4530){return function(_0x2a6833){if(_0x2a6833){return _0x2a6833['destroy']()[_0x632b('0x21')](function(){_0xc9d237[_0x632b('0x19')](0xcc)['end']();});}};}function handleEntityNotFound(_0x1db8f5,_0x379dc2){return function(_0x30ffb9){if(!_0x30ffb9){_0x1db8f5[_0x632b('0x17')](0x194);}return _0x30ffb9;};}function handleError(_0x45d017,_0x183c5c){_0x183c5c=_0x183c5c||0x1f4;return function(_0x5ec5ea){logger['error'](_0x5ec5ea[_0x632b('0x22')]);if(_0x5ec5ea['name']){delete _0x5ec5ea[_0x632b('0x23')];}_0x45d017[_0x632b('0x19')](_0x183c5c)['send'](_0x5ec5ea);};}exports[_0x632b('0x24')]=function(_0x3f4eab,_0x29d9aa){var _0x18dc8c={},_0x4728a8={},_0x515d74={'count':0x0,'rows':[]};var _0xe9d530=_[_0x632b('0x25')](db[_0x632b('0x26')]['rawAttributes'],function(_0x1bb484){return{'name':_0x1bb484[_0x632b('0x27')],'type':_0x1bb484[_0x632b('0x28')][_0x632b('0x29')]};});_0x4728a8[_0x632b('0x2a')]=_[_0x632b('0x25')](_0xe9d530,_0x632b('0x23'));_0x4728a8[_0x632b('0x2b')]=_[_0x632b('0x2c')](_0x3f4eab[_0x632b('0x2b')]);_0x4728a8[_0x632b('0x2d')]=_[_0x632b('0x2e')](_0x4728a8[_0x632b('0x2a')],_0x4728a8[_0x632b('0x2b')]);_0x18dc8c[_0x632b('0x2f')]=_[_0x632b('0x2e')](_0x4728a8[_0x632b('0x2a')],qs[_0x632b('0x30')](_0x3f4eab[_0x632b('0x2b')][_0x632b('0x30')]));_0x18dc8c['attributes']=_0x18dc8c[_0x632b('0x2f')][_0x632b('0x31')]?_0x18dc8c[_0x632b('0x2f')]:_0x4728a8[_0x632b('0x2a')];if(!_0x3f4eab['query'][_0x632b('0x32')]('nolimit')){_0x18dc8c[_0x632b('0x1c')]=qs[_0x632b('0x1c')](_0x3f4eab['query'][_0x632b('0x1c')]);_0x18dc8c[_0x632b('0x1b')]=qs[_0x632b('0x1b')](_0x3f4eab[_0x632b('0x2b')][_0x632b('0x1b')]);}_0x18dc8c[_0x632b('0x33')]=qs[_0x632b('0x34')](_0x3f4eab[_0x632b('0x2b')]['sort']);_0x18dc8c['where']=qs[_0x632b('0x2d')](_[_0x632b('0x35')](_0x3f4eab[_0x632b('0x2b')],_0x4728a8[_0x632b('0x2d')]));if(_0x3f4eab[_0x632b('0x2b')][_0x632b('0x36')]){_0x18dc8c[_0x632b('0x37')]=_[_0x632b('0x38')](_0x18dc8c['where'],{'$or':_['map'](_0xe9d530,function(_0x3a0311){if(_0x3a0311['type']!==_0x632b('0x39')){var _0x31f7bb={};_0x31f7bb[_0x3a0311[_0x632b('0x23')]]={'$like':'%'+_0x3f4eab[_0x632b('0x2b')][_0x632b('0x36')]+'%'};return _0x31f7bb;}})});}_0x18dc8c=_[_0x632b('0x38')]({},_0x18dc8c,_0x3f4eab[_0x632b('0x3a')]);var _0x2d37ac={'where':_0x18dc8c[_0x632b('0x37')]};return db[_0x632b('0x26')][_0x632b('0x3b')](_0x2d37ac)[_0x632b('0x21')](function(_0x381eaa){_0x515d74[_0x632b('0x3b')]=_0x381eaa;if(_0x3f4eab[_0x632b('0x2b')][_0x632b('0x3c')]){_0x18dc8c[_0x632b('0x3d')]=[{'all':!![]}];}return db['OpenchannelQueueReport']['findAll'](_0x18dc8c);})['then'](function(_0x588b90){_0x515d74['rows']=_0x588b90;return _0x515d74;})[_0x632b('0x21')](respondWithFilteredResult(_0x29d9aa,_0x18dc8c))['catch'](handleError(_0x29d9aa,null));};exports['show']=function(_0x55b5f6,_0x472a4f){var _0x4490d4={'raw':!![],'where':{'id':_0x55b5f6[_0x632b('0x3e')]['id']}},_0x417a30={};_0x417a30['model']=_[_0x632b('0x2c')](db[_0x632b('0x26')][_0x632b('0x3f')]);_0x417a30['query']=_[_0x632b('0x2c')](_0x55b5f6[_0x632b('0x2b')]);_0x417a30[_0x632b('0x2d')]=_[_0x632b('0x2e')](_0x417a30[_0x632b('0x2a')],_0x417a30[_0x632b('0x2b')]);_0x4490d4['attributes']=_[_0x632b('0x2e')](_0x417a30[_0x632b('0x2a')],qs[_0x632b('0x30')](_0x55b5f6[_0x632b('0x2b')]['fields']));_0x4490d4['attributes']=_0x4490d4[_0x632b('0x2f')][_0x632b('0x31')]?_0x4490d4[_0x632b('0x2f')]:_0x417a30[_0x632b('0x2a')];if(_0x55b5f6[_0x632b('0x2b')][_0x632b('0x3c')]){_0x4490d4['include']=[{'all':!![]}];}_0x4490d4=_[_0x632b('0x38')]({},_0x4490d4,_0x55b5f6[_0x632b('0x3a')]);return db[_0x632b('0x26')][_0x632b('0x40')](_0x4490d4)[_0x632b('0x21')](handleEntityNotFound(_0x472a4f,null))[_0x632b('0x21')](respondWithResult(_0x472a4f,null))[_0x632b('0x41')](handleError(_0x472a4f,null));};exports[_0x632b('0x42')]=function(_0x53f7f3,_0x876a33){return db['OpenchannelQueueReport'][_0x632b('0x42')](_0x53f7f3['body'],{})[_0x632b('0x21')](respondWithResult(_0x876a33,0xc9))[_0x632b('0x41')](handleError(_0x876a33,null));};exports[_0x632b('0x43')]=function(_0x2c4561,_0x3924db){if(_0x2c4561['body']['id']){delete _0x2c4561[_0x632b('0x44')]['id'];}return db[_0x632b('0x26')][_0x632b('0x40')]({'where':{'id':_0x2c4561['params']['id']}})[_0x632b('0x21')](handleEntityNotFound(_0x3924db,null))[_0x632b('0x21')](saveUpdates(_0x2c4561[_0x632b('0x44')],null))[_0x632b('0x21')](respondWithResult(_0x3924db,null))[_0x632b('0x41')](handleError(_0x3924db,null));};exports['destroy']=function(_0xe51b4f,_0x50adc4){return db[_0x632b('0x26')][_0x632b('0x40')]({'where':{'id':_0xe51b4f[_0x632b('0x3e')]['id']}})[_0x632b('0x21')](handleEntityNotFound(_0x50adc4,null))[_0x632b('0x21')](removeEntity(_0x50adc4,null))['catch'](handleError(_0x50adc4,null));};exports['describe']=function(_0x3726b6,_0x12e1e2){return db[_0x632b('0x26')][_0x632b('0x45')]()[_0x632b('0x21')](respondWithResult(_0x12e1e2,null))[_0x632b('0x41')](handleError(_0x12e1e2,null));};
\ No newline at end of file
+var _0x2ace=['attributes','intersection','fields','hasOwnProperty','nolimit','order','sort','where','filter','merge','options','include','findAll','rows','catch','params','length','includeAll','create','update','body','describe','eml-format','rimraf','zip-dir','request-promise','moment','mustache','util','path','sox','to-csv','ejs','lodash','squel','crypto','jsforce','desk.js','querystring','../../components/auth/service','../../components/parsers/advancedSearch','../../config/license/hardware','api','../../config/utils','../../config/environment','sendStatus','status','json','count','offset','limit','set','Content-Range','apply','reject','save','then','destroy','end','error','name','send','index','map','OpenchannelQueueReport','rawAttributes','fieldName','key','model','query','keys','filters'];(function(_0x4f210d,_0x525c73){var _0x4b4702=function(_0x2703db){while(--_0x2703db){_0x4f210d['push'](_0x4f210d['shift']());}};_0x4b4702(++_0x525c73);}(_0x2ace,0x17e));var _0xe2ac=function(_0x20d73e,_0x39f9ec){_0x20d73e=_0x20d73e-0x0;var _0x52e84b=_0x2ace[_0x20d73e];return _0x52e84b;};'use strict';var pdf=require('html-pdf');var emlformat=require(_0xe2ac('0x0'));var rimraf=require(_0xe2ac('0x1'));var zipdir=require(_0xe2ac('0x2'));var jsonpatch=require('fast-json-patch');var rp=require(_0xe2ac('0x3'));var moment=require(_0xe2ac('0x4'));var BPromise=require('bluebird');var Mustache=require(_0xe2ac('0x5'));var util=require(_0xe2ac('0x6'));var path=require(_0xe2ac('0x7'));var sox=require(_0xe2ac('0x8'));var csv=require(_0xe2ac('0x9'));var ejs=require(_0xe2ac('0xa'));var fs=require('fs');var _=require(_0xe2ac('0xb'));var squel=require(_0xe2ac('0xc'));var crypto=require(_0xe2ac('0xd'));var jsforce=require(_0xe2ac('0xe'));var deskjs=require(_0xe2ac('0xf'));var toCsv=require(_0xe2ac('0x9'));var querystring=require(_0xe2ac('0x10'));var Papa=require('papaparse');var Redis=require('ioredis');var authService=require(_0xe2ac('0x11'));var qs=require('../../components/parsers/qs');var as=require(_0xe2ac('0x12'));var hardwareService=require(_0xe2ac('0x13'));var logger=require('../../config/logger')(_0xe2ac('0x14'));var utils=require(_0xe2ac('0x15'));var config=require(_0xe2ac('0x16'));var db=require('../../mysqldb')['db'];function respondWithStatusCode(_0x37347b,_0x41e1b0){_0x41e1b0=_0x41e1b0||0xcc;return function(_0x199773){if(_0x199773){return _0x37347b[_0xe2ac('0x17')](_0x41e1b0);}return _0x37347b[_0xe2ac('0x18')](_0x41e1b0)['end']();};}function respondWithResult(_0x76dab9,_0x5c3425){_0x5c3425=_0x5c3425||0xc8;return function(_0x4404d7){if(_0x4404d7){return _0x76dab9[_0xe2ac('0x18')](_0x5c3425)[_0xe2ac('0x19')](_0x4404d7);}};}function respondWithFilteredResult(_0x290584,_0x3bec11){return function(_0xbddfba){if(_0xbddfba){var _0x445bca=_0xbddfba[_0xe2ac('0x1a')],_0x2f3caf=_0x3bec11[_0xe2ac('0x1b')],_0x170693=_0x3bec11['offset']+_0x3bec11[_0xe2ac('0x1c')],_0x4e1851;if(_0x170693>=_0x445bca){_0x170693=_0x445bca;_0x4e1851=0xc8;}else{_0x4e1851=0xce;}_0x290584[_0xe2ac('0x18')](_0x4e1851);return _0x290584[_0xe2ac('0x1d')](_0xe2ac('0x1e'),_0x2f3caf+'-'+_0x170693+'/'+_0x445bca)['json'](_0xbddfba);}return null;};}function patchUpdates(_0x5095dd){return function(_0x5bafe4){try{jsonpatch[_0xe2ac('0x1f')](_0x5bafe4,_0x5095dd,!![]);}catch(_0x190983){return BPromise[_0xe2ac('0x20')](_0x190983);}return _0x5bafe4[_0xe2ac('0x21')]();};}function saveUpdates(_0x437195,_0x279a90){return function(_0x54993e){if(_0x54993e){return _0x54993e['update'](_0x437195)[_0xe2ac('0x22')](function(_0x5cc189){return _0x5cc189;});}return null;};}function removeEntity(_0x1b12a1,_0x16dacc){return function(_0x2083b3){if(_0x2083b3){return _0x2083b3[_0xe2ac('0x23')]()[_0xe2ac('0x22')](function(){_0x1b12a1[_0xe2ac('0x18')](0xcc)[_0xe2ac('0x24')]();});}};}function handleEntityNotFound(_0x20a59e,_0xbf5817){return function(_0x4e7597){if(!_0x4e7597){_0x20a59e['sendStatus'](0x194);}return _0x4e7597;};}function handleError(_0x2f6220,_0x4c9981){_0x4c9981=_0x4c9981||0x1f4;return function(_0x1eafd7){logger[_0xe2ac('0x25')](_0x1eafd7['stack']);if(_0x1eafd7[_0xe2ac('0x26')]){delete _0x1eafd7['name'];}_0x2f6220[_0xe2ac('0x18')](_0x4c9981)[_0xe2ac('0x27')](_0x1eafd7);};}exports[_0xe2ac('0x28')]=function(_0x557cb2,_0x2702cd){var _0x2caff4={},_0x57bb2b={},_0x57aa52={'count':0x0,'rows':[]};var _0x3201e8=_[_0xe2ac('0x29')](db[_0xe2ac('0x2a')][_0xe2ac('0x2b')],function(_0x486ee3){return{'name':_0x486ee3[_0xe2ac('0x2c')],'type':_0x486ee3['type'][_0xe2ac('0x2d')]};});_0x57bb2b[_0xe2ac('0x2e')]=_[_0xe2ac('0x29')](_0x3201e8,_0xe2ac('0x26'));_0x57bb2b[_0xe2ac('0x2f')]=_[_0xe2ac('0x30')](_0x557cb2['query']);_0x57bb2b[_0xe2ac('0x31')]=_['intersection'](_0x57bb2b['model'],_0x57bb2b['query']);_0x2caff4[_0xe2ac('0x32')]=_[_0xe2ac('0x33')](_0x57bb2b['model'],qs[_0xe2ac('0x34')](_0x557cb2[_0xe2ac('0x2f')]['fields']));_0x2caff4[_0xe2ac('0x32')]=_0x2caff4[_0xe2ac('0x32')]['length']?_0x2caff4['attributes']:_0x57bb2b[_0xe2ac('0x2e')];if(!_0x557cb2['query'][_0xe2ac('0x35')](_0xe2ac('0x36'))){_0x2caff4[_0xe2ac('0x1c')]=qs[_0xe2ac('0x1c')](_0x557cb2[_0xe2ac('0x2f')][_0xe2ac('0x1c')]);_0x2caff4[_0xe2ac('0x1b')]=qs[_0xe2ac('0x1b')](_0x557cb2[_0xe2ac('0x2f')]['offset']);}_0x2caff4[_0xe2ac('0x37')]=qs[_0xe2ac('0x38')](_0x557cb2[_0xe2ac('0x2f')][_0xe2ac('0x38')]);_0x2caff4[_0xe2ac('0x39')]=qs[_0xe2ac('0x31')](_['pick'](_0x557cb2[_0xe2ac('0x2f')],_0x57bb2b['filters']));if(_0x557cb2[_0xe2ac('0x2f')][_0xe2ac('0x3a')]){_0x2caff4[_0xe2ac('0x39')]=_[_0xe2ac('0x3b')](_0x2caff4['where'],{'$or':_[_0xe2ac('0x29')](_0x3201e8,function(_0x59a4d6){if(_0x59a4d6['type']!=='VIRTUAL'){var _0x5792b0={};_0x5792b0[_0x59a4d6[_0xe2ac('0x26')]]={'$like':'%'+_0x557cb2[_0xe2ac('0x2f')]['filter']+'%'};return _0x5792b0;}})});}_0x2caff4=_[_0xe2ac('0x3b')]({},_0x2caff4,_0x557cb2[_0xe2ac('0x3c')]);var _0x338ad7={'where':_0x2caff4[_0xe2ac('0x39')]};return db[_0xe2ac('0x2a')][_0xe2ac('0x1a')](_0x338ad7)[_0xe2ac('0x22')](function(_0x57770b){_0x57aa52[_0xe2ac('0x1a')]=_0x57770b;if(_0x557cb2['query']['includeAll']){_0x2caff4[_0xe2ac('0x3d')]=[{'all':!![]}];}return db[_0xe2ac('0x2a')][_0xe2ac('0x3e')](_0x2caff4);})[_0xe2ac('0x22')](function(_0x151b12){_0x57aa52[_0xe2ac('0x3f')]=_0x151b12;return _0x57aa52;})[_0xe2ac('0x22')](respondWithFilteredResult(_0x2702cd,_0x2caff4))[_0xe2ac('0x40')](handleError(_0x2702cd,null));};exports['show']=function(_0x4218c1,_0x261d93){var _0x434e7c={'raw':!![],'where':{'id':_0x4218c1[_0xe2ac('0x41')]['id']}},_0x42f248={};_0x42f248['model']=_[_0xe2ac('0x30')](db[_0xe2ac('0x2a')]['rawAttributes']);_0x42f248['query']=_[_0xe2ac('0x30')](_0x4218c1[_0xe2ac('0x2f')]);_0x42f248[_0xe2ac('0x31')]=_[_0xe2ac('0x33')](_0x42f248[_0xe2ac('0x2e')],_0x42f248['query']);_0x434e7c[_0xe2ac('0x32')]=_['intersection'](_0x42f248[_0xe2ac('0x2e')],qs[_0xe2ac('0x34')](_0x4218c1[_0xe2ac('0x2f')]['fields']));_0x434e7c[_0xe2ac('0x32')]=_0x434e7c[_0xe2ac('0x32')][_0xe2ac('0x42')]?_0x434e7c[_0xe2ac('0x32')]:_0x42f248[_0xe2ac('0x2e')];if(_0x4218c1[_0xe2ac('0x2f')][_0xe2ac('0x43')]){_0x434e7c[_0xe2ac('0x3d')]=[{'all':!![]}];}_0x434e7c=_['merge']({},_0x434e7c,_0x4218c1[_0xe2ac('0x3c')]);return db['OpenchannelQueueReport']['find'](_0x434e7c)[_0xe2ac('0x22')](handleEntityNotFound(_0x261d93,null))[_0xe2ac('0x22')](respondWithResult(_0x261d93,null))[_0xe2ac('0x40')](handleError(_0x261d93,null));};exports[_0xe2ac('0x44')]=function(_0x43b7d7,_0x21e7e5){return db[_0xe2ac('0x2a')][_0xe2ac('0x44')](_0x43b7d7['body'],{})[_0xe2ac('0x22')](respondWithResult(_0x21e7e5,0xc9))['catch'](handleError(_0x21e7e5,null));};exports[_0xe2ac('0x45')]=function(_0x41af34,_0x3b1833){if(_0x41af34[_0xe2ac('0x46')]['id']){delete _0x41af34[_0xe2ac('0x46')]['id'];}return db[_0xe2ac('0x2a')]['find']({'where':{'id':_0x41af34['params']['id']}})['then'](handleEntityNotFound(_0x3b1833,null))[_0xe2ac('0x22')](saveUpdates(_0x41af34[_0xe2ac('0x46')],null))[_0xe2ac('0x22')](respondWithResult(_0x3b1833,null))[_0xe2ac('0x40')](handleError(_0x3b1833,null));};exports[_0xe2ac('0x23')]=function(_0x4c67bb,_0x47d301){return db[_0xe2ac('0x2a')]['find']({'where':{'id':_0x4c67bb['params']['id']}})[_0xe2ac('0x22')](handleEntityNotFound(_0x47d301,null))[_0xe2ac('0x22')](removeEntity(_0x47d301,null))[_0xe2ac('0x40')](handleError(_0x47d301,null));};exports[_0xe2ac('0x47')]=function(_0x1f8862,_0x389eb0){return db[_0xe2ac('0x2a')][_0xe2ac('0x47')]()[_0xe2ac('0x22')](respondWithResult(_0x389eb0,null))[_0xe2ac('0x40')](handleError(_0x389eb0,null));};
\ No newline at end of file
diff --git a/server/api/openchannelQueueReport/openchannelQueueReport.model.js b/server/api/openchannelQueueReport/openchannelQueueReport.model.js
index 2f331f6..bcc04d1 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 _0x7da7=['../../config/environment','exports','define','report_openchannel_queue','uniqueid','lodash','util','../../config/logger','bluebird','request-promise','rimraf'];(function(_0x38978c,_0x7412a4){var _0x33a950=function(_0x5178c7){while(--_0x5178c7){_0x38978c['push'](_0x38978c['shift']());}};_0x33a950(++_0x7412a4);}(_0x7da7,0x10d));var _0x77da=function(_0x155c64,_0x26ff95){_0x155c64=_0x155c64-0x0;var _0x1f154a=_0x7da7[_0x155c64];return _0x1f154a;};'use strict';var _=require(_0x77da('0x0'));var util=require(_0x77da('0x1'));var logger=require(_0x77da('0x2'))('api');var moment=require('moment');var BPromise=require(_0x77da('0x3'));var rp=require(_0x77da('0x4'));var fs=require('fs');var path=require('path');var rimraf=require(_0x77da('0x5'));var config=require(_0x77da('0x6'));var attributes=require('./openchannelQueueReport.attributes');module[_0x77da('0x7')]=function(_0xc54a12,_0x47da81){return _0xc54a12[_0x77da('0x8')]('OpenchannelQueueReport',attributes,{'tableName':_0x77da('0x9'),'paranoid':![],'indexes':[{'name':_0x77da('0xa'),'fields':[_0x77da('0xa')]}],'timestamps':!![]});};
\ No newline at end of file
+var _0x3efa=['define','OpenchannelQueueReport','uniqueid','util','api','moment','bluebird','request-promise','path','rimraf','./openchannelQueueReport.attributes','exports'];(function(_0xcf0486,_0x17f1de){var _0x861314=function(_0x2c64d3){while(--_0x2c64d3){_0xcf0486['push'](_0xcf0486['shift']());}};_0x861314(++_0x17f1de);}(_0x3efa,0x147));var _0xa3ef=function(_0x702a97,_0x27141c){_0x702a97=_0x702a97-0x0;var _0x157d0c=_0x3efa[_0x702a97];return _0x157d0c;};'use strict';var _=require('lodash');var util=require(_0xa3ef('0x0'));var logger=require('../../config/logger')(_0xa3ef('0x1'));var moment=require(_0xa3ef('0x2'));var BPromise=require(_0xa3ef('0x3'));var rp=require(_0xa3ef('0x4'));var fs=require('fs');var path=require(_0xa3ef('0x5'));var rimraf=require(_0xa3ef('0x6'));var config=require('../../config/environment');var attributes=require(_0xa3ef('0x7'));module[_0xa3ef('0x8')]=function(_0x381fb1,_0x5d3401){return _0x381fb1[_0xa3ef('0x9')](_0xa3ef('0xa'),attributes,{'tableName':'report_openchannel_queue','paranoid':![],'indexes':[{'name':_0xa3ef('0xb'),'fields':[_0xa3ef('0xb')]}],'timestamps':!![]});};
\ No newline at end of file
diff --git a/server/api/openchannelQueueReport/openchannelQueueReport.rpc.js b/server/api/openchannelQueueReport/openchannelQueueReport.rpc.js
index 99c3fe4..75b59ad 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 _0x3fc6=['result','catch','CreateOpenchannelQueueReport','OpenchannelQueueReport','create','body','options','update','raw','attributes','limit','UpdateOpenchannelQueueReport','debug','lodash','moment','bluebird','randomstring','ioredis','../../config/utils','../../config/logger','rpc','jayson/promise','http','request','then','OpenchannelQueueReport,\x20%s,\x20%s','OpenchannelQueueReport,\x20%s,\x20%s,\x20%s','request\x20sent','stringify','error','code','message','info'];(function(_0x5760c9,_0x3ad606){var _0x6da60c=function(_0x3f8d5a){while(--_0x3f8d5a){_0x5760c9['push'](_0x5760c9['shift']());}};_0x6da60c(++_0x3ad606);}(_0x3fc6,0x115));var _0x63fc=function(_0x422a87,_0x24bde4){_0x422a87=_0x422a87-0x0;var _0x5827d5=_0x3fc6[_0x422a87];return _0x5827d5;};'use strict';var _=require(_0x63fc('0x0'));var util=require('util');var moment=require(_0x63fc('0x1'));var BPromise=require(_0x63fc('0x2'));var rs=require(_0x63fc('0x3'));var fs=require('fs');var Redis=require(_0x63fc('0x4'));var db=require('../../mysqldb')['db'];var utils=require(_0x63fc('0x5'));var logger=require(_0x63fc('0x6'))(_0x63fc('0x7'));var config=require('../../config/environment');var jayson=require(_0x63fc('0x8'));var client=jayson['client'][_0x63fc('0x9')]({'port':0x232a});function respondWithRpcPromise(_0x1c7f72,_0x3e8157,_0x571ab6){return new BPromise(function(_0x3ec832,_0xffe000){return client[_0x63fc('0xa')](_0x1c7f72,_0x571ab6)[_0x63fc('0xb')](function(_0x32749b){logger['info'](_0x63fc('0xc'),_0x3e8157,'request\x20sent');logger['debug'](_0x63fc('0xd'),_0x3e8157,_0x63fc('0xe'),JSON[_0x63fc('0xf')](_0x32749b));if(_0x32749b[_0x63fc('0x10')]){if(_0x32749b[_0x63fc('0x10')][_0x63fc('0x11')]===0x1f4){logger[_0x63fc('0x10')](_0x63fc('0xc'),_0x3e8157,_0x32749b['error'][_0x63fc('0x12')]);return _0xffe000(_0x32749b[_0x63fc('0x10')][_0x63fc('0x12')]);}logger['error'](_0x63fc('0xc'),_0x3e8157,_0x32749b[_0x63fc('0x10')][_0x63fc('0x12')]);return _0x3ec832(_0x32749b['error'][_0x63fc('0x12')]);}else{logger[_0x63fc('0x13')](_0x63fc('0xc'),_0x3e8157,_0x63fc('0xe'));_0x3ec832(_0x32749b[_0x63fc('0x14')][_0x63fc('0x12')]);}})[_0x63fc('0x15')](function(_0x19a3f2){logger[_0x63fc('0x10')](_0x63fc('0xc'),_0x3e8157,_0x19a3f2);_0xffe000(_0x19a3f2);});});}exports[_0x63fc('0x16')]=function(_0x2db18b){var _0x1283f8=this;return new Promise(function(_0x2e1fb8,_0x51b73e){return db[_0x63fc('0x17')][_0x63fc('0x18')](_0x2db18b[_0x63fc('0x19')],{'raw':_0x2db18b[_0x63fc('0x1a')]?_0x2db18b[_0x63fc('0x1a')]['raw']===undefined?!![]:![]:!![]})[_0x63fc('0xb')](function(_0x2c05ef){logger[_0x63fc('0x13')]('CreateOpenchannelQueueReport',_0x2db18b);logger['debug'](_0x63fc('0x16'),_0x2db18b,JSON[_0x63fc('0xf')](_0x2c05ef));_0x2e1fb8(_0x2c05ef);})[_0x63fc('0x15')](function(_0x5810b8){logger[_0x63fc('0x10')](_0x63fc('0x16'),_0x5810b8[_0x63fc('0x12')],_0x2db18b);_0x51b73e(_0x1283f8['error'](0x1f4,_0x5810b8[_0x63fc('0x12')]));});});};exports['UpdateOpenchannelQueueReport']=function(_0x1b012e){var _0x54ebf6=this;return new Promise(function(_0x184e5e,_0x153a1b){return db[_0x63fc('0x17')][_0x63fc('0x1b')](_0x1b012e[_0x63fc('0x19')],{'raw':_0x1b012e[_0x63fc('0x1a')]?_0x1b012e['options'][_0x63fc('0x1c')]===undefined?!![]:![]:!![],'individualHooks':!![],'where':_0x1b012e[_0x63fc('0x1a')]?_0x1b012e[_0x63fc('0x1a')]['where']||null:null,'attributes':_0x1b012e[_0x63fc('0x1a')]?_0x1b012e['options'][_0x63fc('0x1d')]||null:null,'limit':_0x1b012e['options']?_0x1b012e[_0x63fc('0x1a')][_0x63fc('0x1e')]||null:null})['then'](function(_0xc0d30f){logger[_0x63fc('0x13')](_0x63fc('0x1f'),_0x1b012e);logger[_0x63fc('0x20')]('UpdateOpenchannelQueueReport',_0x1b012e,JSON[_0x63fc('0xf')](_0xc0d30f));_0x184e5e(_0xc0d30f);})['catch'](function(_0x251772){logger[_0x63fc('0x10')]('UpdateOpenchannelQueueReport',_0x251772[_0x63fc('0x12')],_0x1b012e);_0x153a1b(_0x54ebf6[_0x63fc('0x10')](0x1f4,_0x251772[_0x63fc('0x12')]));});});};
\ No newline at end of file
+var _0xb96d=['bluebird','ioredis','../../mysqldb','../../config/utils','../../config/environment','jayson/promise','client','http','then','OpenchannelQueueReport,\x20%s,\x20%s','request\x20sent','OpenchannelQueueReport,\x20%s,\x20%s,\x20%s','stringify','error','code','message','info','result','catch','create','options','raw','CreateOpenchannelQueueReport','UpdateOpenchannelQueueReport','update','body','where','attributes','limit','debug','util','moment'];(function(_0x4f00ab,_0x574771){var _0x25d7d4=function(_0x3deb57){while(--_0x3deb57){_0x4f00ab['push'](_0x4f00ab['shift']());}};_0x25d7d4(++_0x574771);}(_0xb96d,0x9e));var _0xdb96=function(_0x445101,_0x2414bf){_0x445101=_0x445101-0x0;var _0x3c3d04=_0xb96d[_0x445101];return _0x3c3d04;};'use strict';var _=require('lodash');var util=require(_0xdb96('0x0'));var moment=require(_0xdb96('0x1'));var BPromise=require(_0xdb96('0x2'));var rs=require('randomstring');var fs=require('fs');var Redis=require(_0xdb96('0x3'));var db=require(_0xdb96('0x4'))['db'];var utils=require(_0xdb96('0x5'));var logger=require('../../config/logger')('rpc');var config=require(_0xdb96('0x6'));var jayson=require(_0xdb96('0x7'));var client=jayson[_0xdb96('0x8')][_0xdb96('0x9')]({'port':0x232a});function respondWithRpcPromise(_0x4f5e6f,_0x294084,_0x571e0e){return new BPromise(function(_0x5e2e95,_0x3384b4){return client['request'](_0x4f5e6f,_0x571e0e)[_0xdb96('0xa')](function(_0xaea492){logger['info'](_0xdb96('0xb'),_0x294084,_0xdb96('0xc'));logger['debug'](_0xdb96('0xd'),_0x294084,_0xdb96('0xc'),JSON[_0xdb96('0xe')](_0xaea492));if(_0xaea492[_0xdb96('0xf')]){if(_0xaea492['error'][_0xdb96('0x10')]===0x1f4){logger[_0xdb96('0xf')](_0xdb96('0xb'),_0x294084,_0xaea492['error'][_0xdb96('0x11')]);return _0x3384b4(_0xaea492[_0xdb96('0xf')][_0xdb96('0x11')]);}logger[_0xdb96('0xf')](_0xdb96('0xb'),_0x294084,_0xaea492[_0xdb96('0xf')][_0xdb96('0x11')]);return _0x5e2e95(_0xaea492[_0xdb96('0xf')][_0xdb96('0x11')]);}else{logger[_0xdb96('0x12')](_0xdb96('0xb'),_0x294084,_0xdb96('0xc'));_0x5e2e95(_0xaea492[_0xdb96('0x13')]['message']);}})[_0xdb96('0x14')](function(_0x2a766e){logger[_0xdb96('0xf')](_0xdb96('0xb'),_0x294084,_0x2a766e);_0x3384b4(_0x2a766e);});});}exports['CreateOpenchannelQueueReport']=function(_0x27fa8e){var _0x33ec8f=this;return new Promise(function(_0x244f66,_0x5946d5){return db['OpenchannelQueueReport'][_0xdb96('0x15')](_0x27fa8e['body'],{'raw':_0x27fa8e['options']?_0x27fa8e[_0xdb96('0x16')][_0xdb96('0x17')]===undefined?!![]:![]:!![]})[_0xdb96('0xa')](function(_0x11b7bd){logger['info'](_0xdb96('0x18'),_0x27fa8e);logger['debug'](_0xdb96('0x18'),_0x27fa8e,JSON[_0xdb96('0xe')](_0x11b7bd));_0x244f66(_0x11b7bd);})['catch'](function(_0x111673){logger[_0xdb96('0xf')](_0xdb96('0x18'),_0x111673[_0xdb96('0x11')],_0x27fa8e);_0x5946d5(_0x33ec8f[_0xdb96('0xf')](0x1f4,_0x111673[_0xdb96('0x11')]));});});};exports[_0xdb96('0x19')]=function(_0x5a1d1c){var _0x4c7558=this;return new Promise(function(_0x18d5a3,_0x350115){return db['OpenchannelQueueReport'][_0xdb96('0x1a')](_0x5a1d1c[_0xdb96('0x1b')],{'raw':_0x5a1d1c[_0xdb96('0x16')]?_0x5a1d1c[_0xdb96('0x16')][_0xdb96('0x17')]===undefined?!![]:![]:!![],'individualHooks':!![],'where':_0x5a1d1c[_0xdb96('0x16')]?_0x5a1d1c[_0xdb96('0x16')][_0xdb96('0x1c')]||null:null,'attributes':_0x5a1d1c[_0xdb96('0x16')]?_0x5a1d1c['options'][_0xdb96('0x1d')]||null:null,'limit':_0x5a1d1c[_0xdb96('0x16')]?_0x5a1d1c['options'][_0xdb96('0x1e')]||null:null})[_0xdb96('0xa')](function(_0x59f07e){logger[_0xdb96('0x12')](_0xdb96('0x19'),_0x5a1d1c);logger[_0xdb96('0x1f')](_0xdb96('0x19'),_0x5a1d1c,JSON[_0xdb96('0xe')](_0x59f07e));_0x18d5a3(_0x59f07e);})[_0xdb96('0x14')](function(_0x301e5f){logger['error'](_0xdb96('0x19'),_0x301e5f[_0xdb96('0x11')],_0x5a1d1c);_0x350115(_0x4c7558[_0xdb96('0xf')](0x1f4,_0x301e5f[_0xdb96('0x11')]));});});};
\ No newline at end of file
diff --git a/server/api/openchannelTransferReport/index.js b/server/api/openchannelTransferReport/index.js
index 81c16b4..645a6cf 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(_0x3cfb0d,_0x4df584){var _0x3486b4=function(_0x1b0939){while(--_0x1b0939){_0x3cfb0d['push'](_0x3cfb0d['shift']());}};_0x3486b4(++_0x4df584);}(_0xa9e0,0x123));var _0x0a9e=function(_0x6c993a,_0x5ea3ab){_0x6c993a=_0x6c993a-0x0;var _0x27f547=_0xa9e0[_0x6c993a];return _0x27f547;};'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(_0x1b64dd,_0x2cf769){var _0xeb464c=function(_0x38272c){while(--_0x38272c){_0x1b64dd['push'](_0x1b64dd['shift']());}};_0xeb464c(++_0x2cf769);}(_0xa9e0,0x123));var _0x0a9e=function(_0x34bf97,_0xc60f9d){_0x34bf97=_0x34bf97-0x0;var _0x292719=_0xa9e0[_0x34bf97];return _0x292719;};'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 16133b5..52804c5 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 _0x73c5=['queue','DATE','NOW','moment','sequelize','exports','STRING','ENUM','account','agent'];(function(_0x4f26ca,_0x3edbd9){var _0x3a495e=function(_0x8728c7){while(--_0x8728c7){_0x4f26ca['push'](_0x4f26ca['shift']());}};_0x3a495e(++_0x3edbd9);}(_0x73c5,0x16b));var _0x573c=function(_0x699711,_0x15f466){_0x699711=_0x699711-0x0;var _0x5884d9=_0x73c5[_0x699711];return _0x5884d9;};'use strict';var moment=require(_0x573c('0x0'));var Sequelize=require(_0x573c('0x1'));module[_0x573c('0x2')]={'uniqueid':{'type':Sequelize[_0x573c('0x3')],'allowNull':![]},'type':{'type':Sequelize[_0x573c('0x4')](_0x573c('0x5'),_0x573c('0x6'),_0x573c('0x7')),'allowNull':![],'defaultValue':_0x573c('0x7')},'transferredAt':{'type':Sequelize[_0x573c('0x8')],'allowNull':![],'defaultValue':Sequelize[_0x573c('0x9')]}};
\ No newline at end of file
+var _0x92d0=['DATE','NOW','moment','sequelize','exports','STRING','ENUM','account','agent','queue'];(function(_0x32067e,_0x17c872){var _0x411a7c=function(_0x60f57f){while(--_0x60f57f){_0x32067e['push'](_0x32067e['shift']());}};_0x411a7c(++_0x17c872);}(_0x92d0,0x11a));var _0x092d=function(_0x2f0244,_0x5c752b){_0x2f0244=_0x2f0244-0x0;var _0x1699a1=_0x92d0[_0x2f0244];return _0x1699a1;};'use strict';var moment=require(_0x092d('0x0'));var Sequelize=require(_0x092d('0x1'));module[_0x092d('0x2')]={'uniqueid':{'type':Sequelize[_0x092d('0x3')],'allowNull':![]},'type':{'type':Sequelize[_0x092d('0x4')](_0x092d('0x5'),_0x092d('0x6'),_0x092d('0x7')),'allowNull':![],'defaultValue':_0x092d('0x7')},'transferredAt':{'type':Sequelize[_0x092d('0x8')],'allowNull':![],'defaultValue':Sequelize[_0x092d('0x9')]}};
\ No newline at end of file
diff --git a/server/api/openchannelTransferReport/openchannelTransferReport.controller.js b/server/api/openchannelTransferReport/openchannelTransferReport.controller.js
index 1ed95d2..e77fec9 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 _0x3eb8=['intersection','model','fields','attributes','length','hasOwnProperty','nolimit','sort','pick','where','filter','merge','options','count','includeAll','include','rows','catch','show','params','find','create','body','destroy','describe','html-pdf','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','bluebird','mustache','util','path','lodash','jsforce','to-csv','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/logger','../../config/utils','../../config/environment','../../mysqldb','sendStatus','status','end','json','offset','limit','Content-Range','apply','save','update','then','error','stack','name','index','map','OpenchannelTransferReport','rawAttributes','fieldName','type','key','query','keys','filters'];(function(_0x2bfe52,_0x43946e){var _0x1cf649=function(_0xc8300c){while(--_0xc8300c){_0x2bfe52['push'](_0x2bfe52['shift']());}};_0x1cf649(++_0x43946e);}(_0x3eb8,0x139));var _0x83eb=function(_0xbd08b4,_0x4790ed){_0xbd08b4=_0xbd08b4-0x0;var _0x314f1e=_0x3eb8[_0xbd08b4];return _0x314f1e;};'use strict';var pdf=require(_0x83eb('0x0'));var emlformat=require(_0x83eb('0x1'));var rimraf=require(_0x83eb('0x2'));var zipdir=require(_0x83eb('0x3'));var jsonpatch=require(_0x83eb('0x4'));var rp=require(_0x83eb('0x5'));var moment=require('moment');var BPromise=require(_0x83eb('0x6'));var Mustache=require(_0x83eb('0x7'));var util=require(_0x83eb('0x8'));var path=require(_0x83eb('0x9'));var sox=require('sox');var csv=require('to-csv');var ejs=require('ejs');var fs=require('fs');var _=require(_0x83eb('0xa'));var squel=require('squel');var crypto=require('crypto');var jsforce=require(_0x83eb('0xb'));var deskjs=require('desk.js');var toCsv=require(_0x83eb('0xc'));var querystring=require(_0x83eb('0xd'));var Papa=require(_0x83eb('0xe'));var Redis=require(_0x83eb('0xf'));var authService=require(_0x83eb('0x10'));var qs=require(_0x83eb('0x11'));var as=require(_0x83eb('0x12'));var hardwareService=require('../../config/license/hardware');var logger=require(_0x83eb('0x13'))('api');var utils=require(_0x83eb('0x14'));var config=require(_0x83eb('0x15'));var db=require(_0x83eb('0x16'))['db'];function respondWithStatusCode(_0x514ed0,_0x13f6be){_0x13f6be=_0x13f6be||0xcc;return function(_0x36f8a1){if(_0x36f8a1){return _0x514ed0[_0x83eb('0x17')](_0x13f6be);}return _0x514ed0[_0x83eb('0x18')](_0x13f6be)[_0x83eb('0x19')]();};}function respondWithResult(_0x47340a,_0x2a34c7){_0x2a34c7=_0x2a34c7||0xc8;return function(_0x50ee5e){if(_0x50ee5e){return _0x47340a[_0x83eb('0x18')](_0x2a34c7)[_0x83eb('0x1a')](_0x50ee5e);}};}function respondWithFilteredResult(_0x2b3625,_0x363b4d){return function(_0x3a2c5b){if(_0x3a2c5b){var _0x215714=_0x3a2c5b['count'],_0x50814d=_0x363b4d[_0x83eb('0x1b')],_0x39fd0c=_0x363b4d[_0x83eb('0x1b')]+_0x363b4d[_0x83eb('0x1c')],_0x1248a0;if(_0x39fd0c>=_0x215714){_0x39fd0c=_0x215714;_0x1248a0=0xc8;}else{_0x1248a0=0xce;}_0x2b3625['status'](_0x1248a0);return _0x2b3625['set'](_0x83eb('0x1d'),_0x50814d+'-'+_0x39fd0c+'/'+_0x215714)[_0x83eb('0x1a')](_0x3a2c5b);}return null;};}function patchUpdates(_0x46fc24){return function(_0x64b330){try{jsonpatch[_0x83eb('0x1e')](_0x64b330,_0x46fc24,!![]);}catch(_0x15232d){return BPromise['reject'](_0x15232d);}return _0x64b330[_0x83eb('0x1f')]();};}function saveUpdates(_0x27165c,_0x57b772){return function(_0x4df4ac){if(_0x4df4ac){return _0x4df4ac[_0x83eb('0x20')](_0x27165c)[_0x83eb('0x21')](function(_0x19b173){return _0x19b173;});}return null;};}function removeEntity(_0x22b605,_0x30da39){return function(_0x34d24f){if(_0x34d24f){return _0x34d24f['destroy']()[_0x83eb('0x21')](function(){_0x22b605[_0x83eb('0x18')](0xcc)[_0x83eb('0x19')]();});}};}function handleEntityNotFound(_0xbd36ab,_0xb4a3f7){return function(_0x41b536){if(!_0x41b536){_0xbd36ab[_0x83eb('0x17')](0x194);}return _0x41b536;};}function handleError(_0x18164d,_0x2a4d01){_0x2a4d01=_0x2a4d01||0x1f4;return function(_0x6848ca){logger[_0x83eb('0x22')](_0x6848ca[_0x83eb('0x23')]);if(_0x6848ca[_0x83eb('0x24')]){delete _0x6848ca['name'];}_0x18164d['status'](_0x2a4d01)['send'](_0x6848ca);};}exports[_0x83eb('0x25')]=function(_0x59fc67,_0x14dd4a){var _0x339555={},_0x191ab1={},_0x35581d={'count':0x0,'rows':[]};var _0x35b2c1=_[_0x83eb('0x26')](db[_0x83eb('0x27')][_0x83eb('0x28')],function(_0x1607b6){return{'name':_0x1607b6[_0x83eb('0x29')],'type':_0x1607b6[_0x83eb('0x2a')][_0x83eb('0x2b')]};});_0x191ab1['model']=_['map'](_0x35b2c1,_0x83eb('0x24'));_0x191ab1[_0x83eb('0x2c')]=_[_0x83eb('0x2d')](_0x59fc67[_0x83eb('0x2c')]);_0x191ab1[_0x83eb('0x2e')]=_[_0x83eb('0x2f')](_0x191ab1[_0x83eb('0x30')],_0x191ab1[_0x83eb('0x2c')]);_0x339555['attributes']=_[_0x83eb('0x2f')](_0x191ab1[_0x83eb('0x30')],qs[_0x83eb('0x31')](_0x59fc67['query']['fields']));_0x339555[_0x83eb('0x32')]=_0x339555['attributes'][_0x83eb('0x33')]?_0x339555['attributes']:_0x191ab1[_0x83eb('0x30')];if(!_0x59fc67[_0x83eb('0x2c')][_0x83eb('0x34')](_0x83eb('0x35'))){_0x339555[_0x83eb('0x1c')]=qs['limit'](_0x59fc67[_0x83eb('0x2c')][_0x83eb('0x1c')]);_0x339555['offset']=qs[_0x83eb('0x1b')](_0x59fc67['query'][_0x83eb('0x1b')]);}_0x339555['order']=qs[_0x83eb('0x36')](_0x59fc67[_0x83eb('0x2c')]['sort']);_0x339555['where']=qs[_0x83eb('0x2e')](_[_0x83eb('0x37')](_0x59fc67[_0x83eb('0x2c')],_0x191ab1['filters']));if(_0x59fc67[_0x83eb('0x2c')]['filter']){_0x339555[_0x83eb('0x38')]=_['merge'](_0x339555['where'],{'$or':_[_0x83eb('0x26')](_0x35b2c1,function(_0x48657c){if(_0x48657c[_0x83eb('0x2a')]!=='VIRTUAL'){var _0x480ab8={};_0x480ab8[_0x48657c['name']]={'$like':'%'+_0x59fc67[_0x83eb('0x2c')][_0x83eb('0x39')]+'%'};return _0x480ab8;}})});}_0x339555=_[_0x83eb('0x3a')]({},_0x339555,_0x59fc67[_0x83eb('0x3b')]);var _0x3a6301={'where':_0x339555[_0x83eb('0x38')]};return db[_0x83eb('0x27')][_0x83eb('0x3c')](_0x3a6301)['then'](function(_0x20accc){_0x35581d[_0x83eb('0x3c')]=_0x20accc;if(_0x59fc67[_0x83eb('0x2c')][_0x83eb('0x3d')]){_0x339555[_0x83eb('0x3e')]=[{'all':!![]}];}return db['OpenchannelTransferReport']['findAll'](_0x339555);})[_0x83eb('0x21')](function(_0x34e16d){_0x35581d[_0x83eb('0x3f')]=_0x34e16d;return _0x35581d;})['then'](respondWithFilteredResult(_0x14dd4a,_0x339555))[_0x83eb('0x40')](handleError(_0x14dd4a,null));};exports[_0x83eb('0x41')]=function(_0x11a2fb,_0x1f7aef){var _0xe449e4={'raw':!![],'where':{'id':_0x11a2fb[_0x83eb('0x42')]['id']}},_0x36282a={};_0x36282a[_0x83eb('0x30')]=_['keys'](db[_0x83eb('0x27')][_0x83eb('0x28')]);_0x36282a[_0x83eb('0x2c')]=_[_0x83eb('0x2d')](_0x11a2fb[_0x83eb('0x2c')]);_0x36282a['filters']=_[_0x83eb('0x2f')](_0x36282a['model'],_0x36282a[_0x83eb('0x2c')]);_0xe449e4[_0x83eb('0x32')]=_['intersection'](_0x36282a[_0x83eb('0x30')],qs[_0x83eb('0x31')](_0x11a2fb['query']['fields']));_0xe449e4[_0x83eb('0x32')]=_0xe449e4[_0x83eb('0x32')]['length']?_0xe449e4[_0x83eb('0x32')]:_0x36282a[_0x83eb('0x30')];if(_0x11a2fb[_0x83eb('0x2c')][_0x83eb('0x3d')]){_0xe449e4[_0x83eb('0x3e')]=[{'all':!![]}];}_0xe449e4=_['merge']({},_0xe449e4,_0x11a2fb['options']);return db[_0x83eb('0x27')][_0x83eb('0x43')](_0xe449e4)[_0x83eb('0x21')](handleEntityNotFound(_0x1f7aef,null))[_0x83eb('0x21')](respondWithResult(_0x1f7aef,null))[_0x83eb('0x40')](handleError(_0x1f7aef,null));};exports[_0x83eb('0x44')]=function(_0x2a2bfd,_0x4f9e1d){return db['OpenchannelTransferReport']['create'](_0x2a2bfd['body'],{})[_0x83eb('0x21')](respondWithResult(_0x4f9e1d,0xc9))[_0x83eb('0x40')](handleError(_0x4f9e1d,null));};exports['update']=function(_0x163d15,_0x348c70){if(_0x163d15[_0x83eb('0x45')]['id']){delete _0x163d15[_0x83eb('0x45')]['id'];}return db['OpenchannelTransferReport'][_0x83eb('0x43')]({'where':{'id':_0x163d15[_0x83eb('0x42')]['id']}})['then'](handleEntityNotFound(_0x348c70,null))[_0x83eb('0x21')](saveUpdates(_0x163d15['body'],null))[_0x83eb('0x21')](respondWithResult(_0x348c70,null))['catch'](handleError(_0x348c70,null));};exports[_0x83eb('0x46')]=function(_0x59efe4,_0x597ca3){return db['OpenchannelTransferReport'][_0x83eb('0x43')]({'where':{'id':_0x59efe4['params']['id']}})[_0x83eb('0x21')](handleEntityNotFound(_0x597ca3,null))[_0x83eb('0x21')](removeEntity(_0x597ca3,null))[_0x83eb('0x40')](handleError(_0x597ca3,null));};exports[_0x83eb('0x47')]=function(_0x28d997,_0x238835){return db[_0x83eb('0x27')][_0x83eb('0x47')]()['then'](respondWithResult(_0x238835,null))['catch'](handleError(_0x238835,null));};
\ No newline at end of file
+var _0xbd40=['api','../../config/environment','../../mysqldb','sendStatus','status','count','offset','limit','set','json','apply','reject','save','update','then','destroy','end','error','stack','name','send','index','map','rawAttributes','fieldName','key','model','query','keys','intersection','attributes','fields','length','hasOwnProperty','nolimit','order','sort','where','filters','filter','merge','type','VIRTUAL','options','OpenchannelTransferReport','include','findAll','catch','show','params','includeAll','find','create','body','describe','zip-dir','request-promise','moment','mustache','path','sox','to-csv','ejs','lodash','squel','crypto','jsforce','querystring','papaparse','ioredis','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger'];(function(_0x1f0724,_0x3a58bf){var _0x253ffb=function(_0x3b4c72){while(--_0x3b4c72){_0x1f0724['push'](_0x1f0724['shift']());}};_0x253ffb(++_0x3a58bf);}(_0xbd40,0x81));var _0x0bd4=function(_0x264341,_0x223016){_0x264341=_0x264341-0x0;var _0x519a44=_0xbd40[_0x264341];return _0x519a44;};'use strict';var pdf=require('html-pdf');var emlformat=require('eml-format');var rimraf=require('rimraf');var zipdir=require(_0x0bd4('0x0'));var jsonpatch=require('fast-json-patch');var rp=require(_0x0bd4('0x1'));var moment=require(_0x0bd4('0x2'));var BPromise=require('bluebird');var Mustache=require(_0x0bd4('0x3'));var util=require('util');var path=require(_0x0bd4('0x4'));var sox=require(_0x0bd4('0x5'));var csv=require(_0x0bd4('0x6'));var ejs=require(_0x0bd4('0x7'));var fs=require('fs');var _=require(_0x0bd4('0x8'));var squel=require(_0x0bd4('0x9'));var crypto=require(_0x0bd4('0xa'));var jsforce=require(_0x0bd4('0xb'));var deskjs=require('desk.js');var toCsv=require(_0x0bd4('0x6'));var querystring=require(_0x0bd4('0xc'));var Papa=require(_0x0bd4('0xd'));var Redis=require(_0x0bd4('0xe'));var authService=require('../../components/auth/service');var qs=require(_0x0bd4('0xf'));var as=require(_0x0bd4('0x10'));var hardwareService=require(_0x0bd4('0x11'));var logger=require(_0x0bd4('0x12'))(_0x0bd4('0x13'));var utils=require('../../config/utils');var config=require(_0x0bd4('0x14'));var db=require(_0x0bd4('0x15'))['db'];function respondWithStatusCode(_0x5c3da1,_0x24b5dc){_0x24b5dc=_0x24b5dc||0xcc;return function(_0x379ed3){if(_0x379ed3){return _0x5c3da1[_0x0bd4('0x16')](_0x24b5dc);}return _0x5c3da1[_0x0bd4('0x17')](_0x24b5dc)['end']();};}function respondWithResult(_0x28efc0,_0x4b1884){_0x4b1884=_0x4b1884||0xc8;return function(_0x405dba){if(_0x405dba){return _0x28efc0[_0x0bd4('0x17')](_0x4b1884)['json'](_0x405dba);}};}function respondWithFilteredResult(_0x3cacde,_0x2d3bba){return function(_0xd271ad){if(_0xd271ad){var _0x8d6f6a=_0xd271ad[_0x0bd4('0x18')],_0x5b864b=_0x2d3bba[_0x0bd4('0x19')],_0x388c81=_0x2d3bba[_0x0bd4('0x19')]+_0x2d3bba[_0x0bd4('0x1a')],_0x267f59;if(_0x388c81>=_0x8d6f6a){_0x388c81=_0x8d6f6a;_0x267f59=0xc8;}else{_0x267f59=0xce;}_0x3cacde['status'](_0x267f59);return _0x3cacde[_0x0bd4('0x1b')]('Content-Range',_0x5b864b+'-'+_0x388c81+'/'+_0x8d6f6a)[_0x0bd4('0x1c')](_0xd271ad);}return null;};}function patchUpdates(_0x514026){return function(_0x525aa1){try{jsonpatch[_0x0bd4('0x1d')](_0x525aa1,_0x514026,!![]);}catch(_0x2f08b2){return BPromise[_0x0bd4('0x1e')](_0x2f08b2);}return _0x525aa1[_0x0bd4('0x1f')]();};}function saveUpdates(_0x15be70,_0x157f27){return function(_0xf75eb7){if(_0xf75eb7){return _0xf75eb7[_0x0bd4('0x20')](_0x15be70)[_0x0bd4('0x21')](function(_0x5b3902){return _0x5b3902;});}return null;};}function removeEntity(_0x3d5b33,_0x27ef36){return function(_0x57bb45){if(_0x57bb45){return _0x57bb45[_0x0bd4('0x22')]()[_0x0bd4('0x21')](function(){_0x3d5b33[_0x0bd4('0x17')](0xcc)[_0x0bd4('0x23')]();});}};}function handleEntityNotFound(_0x4ac5c5,_0x545ff6){return function(_0x2d3224){if(!_0x2d3224){_0x4ac5c5[_0x0bd4('0x16')](0x194);}return _0x2d3224;};}function handleError(_0xf86dd7,_0x40c99a){_0x40c99a=_0x40c99a||0x1f4;return function(_0x494683){logger[_0x0bd4('0x24')](_0x494683[_0x0bd4('0x25')]);if(_0x494683[_0x0bd4('0x26')]){delete _0x494683['name'];}_0xf86dd7[_0x0bd4('0x17')](_0x40c99a)[_0x0bd4('0x27')](_0x494683);};}exports[_0x0bd4('0x28')]=function(_0x38e5d6,_0x592747){var _0x5ac2cd={},_0x26ed7d={},_0x3e5822={'count':0x0,'rows':[]};var _0x1642b8=_[_0x0bd4('0x29')](db['OpenchannelTransferReport'][_0x0bd4('0x2a')],function(_0x5d4b83){return{'name':_0x5d4b83[_0x0bd4('0x2b')],'type':_0x5d4b83['type'][_0x0bd4('0x2c')]};});_0x26ed7d[_0x0bd4('0x2d')]=_[_0x0bd4('0x29')](_0x1642b8,_0x0bd4('0x26'));_0x26ed7d[_0x0bd4('0x2e')]=_[_0x0bd4('0x2f')](_0x38e5d6[_0x0bd4('0x2e')]);_0x26ed7d['filters']=_[_0x0bd4('0x30')](_0x26ed7d[_0x0bd4('0x2d')],_0x26ed7d['query']);_0x5ac2cd[_0x0bd4('0x31')]=_[_0x0bd4('0x30')](_0x26ed7d['model'],qs[_0x0bd4('0x32')](_0x38e5d6['query'][_0x0bd4('0x32')]));_0x5ac2cd[_0x0bd4('0x31')]=_0x5ac2cd[_0x0bd4('0x31')][_0x0bd4('0x33')]?_0x5ac2cd[_0x0bd4('0x31')]:_0x26ed7d[_0x0bd4('0x2d')];if(!_0x38e5d6['query'][_0x0bd4('0x34')](_0x0bd4('0x35'))){_0x5ac2cd[_0x0bd4('0x1a')]=qs['limit'](_0x38e5d6[_0x0bd4('0x2e')]['limit']);_0x5ac2cd[_0x0bd4('0x19')]=qs['offset'](_0x38e5d6[_0x0bd4('0x2e')][_0x0bd4('0x19')]);}_0x5ac2cd[_0x0bd4('0x36')]=qs[_0x0bd4('0x37')](_0x38e5d6['query'][_0x0bd4('0x37')]);_0x5ac2cd[_0x0bd4('0x38')]=qs[_0x0bd4('0x39')](_['pick'](_0x38e5d6[_0x0bd4('0x2e')],_0x26ed7d[_0x0bd4('0x39')]));if(_0x38e5d6[_0x0bd4('0x2e')][_0x0bd4('0x3a')]){_0x5ac2cd[_0x0bd4('0x38')]=_[_0x0bd4('0x3b')](_0x5ac2cd[_0x0bd4('0x38')],{'$or':_[_0x0bd4('0x29')](_0x1642b8,function(_0x3e1eb8){if(_0x3e1eb8[_0x0bd4('0x3c')]!==_0x0bd4('0x3d')){var _0x1ad1b1={};_0x1ad1b1[_0x3e1eb8[_0x0bd4('0x26')]]={'$like':'%'+_0x38e5d6[_0x0bd4('0x2e')][_0x0bd4('0x3a')]+'%'};return _0x1ad1b1;}})});}_0x5ac2cd=_[_0x0bd4('0x3b')]({},_0x5ac2cd,_0x38e5d6[_0x0bd4('0x3e')]);var _0x288530={'where':_0x5ac2cd['where']};return db[_0x0bd4('0x3f')][_0x0bd4('0x18')](_0x288530)[_0x0bd4('0x21')](function(_0x3d6ae7){_0x3e5822[_0x0bd4('0x18')]=_0x3d6ae7;if(_0x38e5d6[_0x0bd4('0x2e')]['includeAll']){_0x5ac2cd[_0x0bd4('0x40')]=[{'all':!![]}];}return db[_0x0bd4('0x3f')][_0x0bd4('0x41')](_0x5ac2cd);})[_0x0bd4('0x21')](function(_0x4e2737){_0x3e5822['rows']=_0x4e2737;return _0x3e5822;})['then'](respondWithFilteredResult(_0x592747,_0x5ac2cd))[_0x0bd4('0x42')](handleError(_0x592747,null));};exports[_0x0bd4('0x43')]=function(_0x10c3ad,_0x49a224){var _0x3417fb={'raw':!![],'where':{'id':_0x10c3ad[_0x0bd4('0x44')]['id']}},_0x452d9d={};_0x452d9d[_0x0bd4('0x2d')]=_[_0x0bd4('0x2f')](db[_0x0bd4('0x3f')][_0x0bd4('0x2a')]);_0x452d9d[_0x0bd4('0x2e')]=_[_0x0bd4('0x2f')](_0x10c3ad[_0x0bd4('0x2e')]);_0x452d9d[_0x0bd4('0x39')]=_['intersection'](_0x452d9d[_0x0bd4('0x2d')],_0x452d9d['query']);_0x3417fb[_0x0bd4('0x31')]=_['intersection'](_0x452d9d[_0x0bd4('0x2d')],qs[_0x0bd4('0x32')](_0x10c3ad['query']['fields']));_0x3417fb[_0x0bd4('0x31')]=_0x3417fb[_0x0bd4('0x31')][_0x0bd4('0x33')]?_0x3417fb[_0x0bd4('0x31')]:_0x452d9d[_0x0bd4('0x2d')];if(_0x10c3ad[_0x0bd4('0x2e')][_0x0bd4('0x45')]){_0x3417fb[_0x0bd4('0x40')]=[{'all':!![]}];}_0x3417fb=_[_0x0bd4('0x3b')]({},_0x3417fb,_0x10c3ad['options']);return db[_0x0bd4('0x3f')][_0x0bd4('0x46')](_0x3417fb)[_0x0bd4('0x21')](handleEntityNotFound(_0x49a224,null))[_0x0bd4('0x21')](respondWithResult(_0x49a224,null))['catch'](handleError(_0x49a224,null));};exports[_0x0bd4('0x47')]=function(_0x1e68e0,_0x4e419b){return db[_0x0bd4('0x3f')][_0x0bd4('0x47')](_0x1e68e0[_0x0bd4('0x48')],{})[_0x0bd4('0x21')](respondWithResult(_0x4e419b,0xc9))[_0x0bd4('0x42')](handleError(_0x4e419b,null));};exports['update']=function(_0x514474,_0x37de5b){if(_0x514474[_0x0bd4('0x48')]['id']){delete _0x514474['body']['id'];}return db['OpenchannelTransferReport'][_0x0bd4('0x46')]({'where':{'id':_0x514474[_0x0bd4('0x44')]['id']}})[_0x0bd4('0x21')](handleEntityNotFound(_0x37de5b,null))[_0x0bd4('0x21')](saveUpdates(_0x514474[_0x0bd4('0x48')],null))[_0x0bd4('0x21')](respondWithResult(_0x37de5b,null))[_0x0bd4('0x42')](handleError(_0x37de5b,null));};exports[_0x0bd4('0x22')]=function(_0x5ea015,_0x2968c2){return db[_0x0bd4('0x3f')]['find']({'where':{'id':_0x5ea015[_0x0bd4('0x44')]['id']}})['then'](handleEntityNotFound(_0x2968c2,null))[_0x0bd4('0x21')](removeEntity(_0x2968c2,null))[_0x0bd4('0x42')](handleError(_0x2968c2,null));};exports['describe']=function(_0x39144b,_0x218bae){return db[_0x0bd4('0x3f')][_0x0bd4('0x49')]()[_0x0bd4('0x21')](respondWithResult(_0x218bae,null))[_0x0bd4('0x42')](handleError(_0x218bae,null));};
\ No newline at end of file
diff --git a/server/api/openchannelTransferReport/openchannelTransferReport.model.js b/server/api/openchannelTransferReport/openchannelTransferReport.model.js
index 52fdf57..8bb2533 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 _0x278a=['../../config/logger','request-promise','path','rimraf','../../config/environment','exports','OpenchannelTransferReport','uniqueid','util'];(function(_0x3fa7c7,_0x5c14c5){var _0x4ef605=function(_0x5d6f10){while(--_0x5d6f10){_0x3fa7c7['push'](_0x3fa7c7['shift']());}};_0x4ef605(++_0x5c14c5);}(_0x278a,0x1a6));var _0xa278=function(_0x2beeca,_0x11c099){_0x2beeca=_0x2beeca-0x0;var _0x445320=_0x278a[_0x2beeca];return _0x445320;};'use strict';var _=require('lodash');var util=require(_0xa278('0x0'));var logger=require(_0xa278('0x1'))('api');var moment=require('moment');var BPromise=require('bluebird');var rp=require(_0xa278('0x2'));var fs=require('fs');var path=require(_0xa278('0x3'));var rimraf=require(_0xa278('0x4'));var config=require(_0xa278('0x5'));var attributes=require('./openchannelTransferReport.attributes');module[_0xa278('0x6')]=function(_0x11c6b4,_0x116c3a){return _0x11c6b4['define'](_0xa278('0x7'),attributes,{'tableName':'report_openchannel_transfer','paranoid':![],'indexes':[{'name':'uniqueid','fields':[_0xa278('0x8')]}],'timestamps':!![]});};
\ No newline at end of file
+var _0x3997=['exports','define','OpenchannelTransferReport','report_openchannel_transfer','uniqueid','util','../../config/logger','api','moment','path','rimraf','../../config/environment','./openchannelTransferReport.attributes'];(function(_0x152fd4,_0x17d023){var _0x258536=function(_0x5b33c1){while(--_0x5b33c1){_0x152fd4['push'](_0x152fd4['shift']());}};_0x258536(++_0x17d023);}(_0x3997,0x1b2));var _0x7399=function(_0x407ec5,_0x48d963){_0x407ec5=_0x407ec5-0x0;var _0x250bf5=_0x3997[_0x407ec5];return _0x250bf5;};'use strict';var _=require('lodash');var util=require(_0x7399('0x0'));var logger=require(_0x7399('0x1'))(_0x7399('0x2'));var moment=require(_0x7399('0x3'));var BPromise=require('bluebird');var rp=require('request-promise');var fs=require('fs');var path=require(_0x7399('0x4'));var rimraf=require(_0x7399('0x5'));var config=require(_0x7399('0x6'));var attributes=require(_0x7399('0x7'));module[_0x7399('0x8')]=function(_0x477ff0,_0x528920){return _0x477ff0[_0x7399('0x9')](_0x7399('0xa'),attributes,{'tableName':_0x7399('0xb'),'paranoid':![],'indexes':[{'name':_0x7399('0xc'),'fields':[_0x7399('0xc')]}],'timestamps':!![]});};
\ No newline at end of file
diff --git a/server/api/openchannelTransferReport/openchannelTransferReport.rpc.js b/server/api/openchannelTransferReport/openchannelTransferReport.rpc.js
index 7d52a82..46933de 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 _0xc519=['jayson/promise','http','request','then','info','request\x20sent','debug','OpenchannelTransferReport,\x20%s,\x20%s,\x20%s','stringify','error','message','OpenchannelTransferReport,\x20%s,\x20%s','result','moment','randomstring','ioredis','../../config/logger','rpc'];(function(_0x2c467e,_0x3cff87){var _0x494c76=function(_0x376810){while(--_0x376810){_0x2c467e['push'](_0x2c467e['shift']());}};_0x494c76(++_0x3cff87);}(_0xc519,0x11b));var _0x9c51=function(_0x2b8fbd,_0x49624a){_0x2b8fbd=_0x2b8fbd-0x0;var _0x6f2b8d=_0xc519[_0x2b8fbd];return _0x6f2b8d;};'use strict';var _=require('lodash');var util=require('util');var moment=require(_0x9c51('0x0'));var BPromise=require('bluebird');var rs=require(_0x9c51('0x1'));var fs=require('fs');var Redis=require(_0x9c51('0x2'));var db=require('../../mysqldb')['db'];var utils=require('../../config/utils');var logger=require(_0x9c51('0x3'))(_0x9c51('0x4'));var config=require('../../config/environment');var jayson=require(_0x9c51('0x5'));var client=jayson['client'][_0x9c51('0x6')]({'port':0x232a});function respondWithRpcPromise(_0x46a370,_0x522d11,_0x2a1834){return new BPromise(function(_0x1813aa,_0x582010){return client[_0x9c51('0x7')](_0x46a370,_0x2a1834)[_0x9c51('0x8')](function(_0x30a642){logger[_0x9c51('0x9')]('OpenchannelTransferReport,\x20%s,\x20%s',_0x522d11,_0x9c51('0xa'));logger[_0x9c51('0xb')](_0x9c51('0xc'),_0x522d11,_0x9c51('0xa'),JSON[_0x9c51('0xd')](_0x30a642));if(_0x30a642[_0x9c51('0xe')]){if(_0x30a642['error']['code']===0x1f4){logger[_0x9c51('0xe')]('OpenchannelTransferReport,\x20%s,\x20%s',_0x522d11,_0x30a642[_0x9c51('0xe')][_0x9c51('0xf')]);return _0x582010(_0x30a642[_0x9c51('0xe')][_0x9c51('0xf')]);}logger[_0x9c51('0xe')](_0x9c51('0x10'),_0x522d11,_0x30a642[_0x9c51('0xe')]['message']);return _0x1813aa(_0x30a642[_0x9c51('0xe')][_0x9c51('0xf')]);}else{logger[_0x9c51('0x9')](_0x9c51('0x10'),_0x522d11,_0x9c51('0xa'));_0x1813aa(_0x30a642[_0x9c51('0x11')][_0x9c51('0xf')]);}})['catch'](function(_0x60a7ed){logger['error']('OpenchannelTransferReport,\x20%s,\x20%s',_0x522d11,_0x60a7ed);_0x582010(_0x60a7ed);});});}
\ No newline at end of file
+var _0xa2a6=['../../config/logger','rpc','jayson/promise','client','http','request','OpenchannelTransferReport,\x20%s,\x20%s','request\x20sent','debug','OpenchannelTransferReport,\x20%s,\x20%s,\x20%s','error','message','result','catch','util','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils'];(function(_0x1e6e4e,_0x2b1b09){var _0x3d746b=function(_0x4483dd){while(--_0x4483dd){_0x1e6e4e['push'](_0x1e6e4e['shift']());}};_0x3d746b(++_0x2b1b09);}(_0xa2a6,0x1b2));var _0x6a2a=function(_0x3831aa,_0x3daa03){_0x3831aa=_0x3831aa-0x0;var _0x4cde14=_0xa2a6[_0x3831aa];return _0x4cde14;};'use strict';var _=require('lodash');var util=require(_0x6a2a('0x0'));var moment=require(_0x6a2a('0x1'));var BPromise=require(_0x6a2a('0x2'));var rs=require(_0x6a2a('0x3'));var fs=require('fs');var Redis=require(_0x6a2a('0x4'));var db=require(_0x6a2a('0x5'))['db'];var utils=require(_0x6a2a('0x6'));var logger=require(_0x6a2a('0x7'))(_0x6a2a('0x8'));var config=require('../../config/environment');var jayson=require(_0x6a2a('0x9'));var client=jayson[_0x6a2a('0xa')][_0x6a2a('0xb')]({'port':0x232a});function respondWithRpcPromise(_0x47e893,_0x3d6fc1,_0x520d4d){return new BPromise(function(_0x5f413b,_0x17f03f){return client[_0x6a2a('0xc')](_0x47e893,_0x520d4d)['then'](function(_0x275f5e){logger['info'](_0x6a2a('0xd'),_0x3d6fc1,_0x6a2a('0xe'));logger[_0x6a2a('0xf')](_0x6a2a('0x10'),_0x3d6fc1,'request\x20sent',JSON['stringify'](_0x275f5e));if(_0x275f5e['error']){if(_0x275f5e[_0x6a2a('0x11')]['code']===0x1f4){logger['error'](_0x6a2a('0xd'),_0x3d6fc1,_0x275f5e[_0x6a2a('0x11')][_0x6a2a('0x12')]);return _0x17f03f(_0x275f5e[_0x6a2a('0x11')]['message']);}logger[_0x6a2a('0x11')](_0x6a2a('0xd'),_0x3d6fc1,_0x275f5e[_0x6a2a('0x11')][_0x6a2a('0x12')]);return _0x5f413b(_0x275f5e['error']['message']);}else{logger['info']('OpenchannelTransferReport,\x20%s,\x20%s',_0x3d6fc1,_0x6a2a('0xe'));_0x5f413b(_0x275f5e[_0x6a2a('0x13')][_0x6a2a('0x12')]);}})[_0x6a2a('0x14')](function(_0x337cc5){logger[_0x6a2a('0x11')](_0x6a2a('0xd'),_0x3d6fc1,_0x337cc5);_0x17f03f(_0x337cc5);});});}
\ No newline at end of file
diff --git a/server/api/pause/index.js b/server/api/pause/index.js
index 447dde2..eb91876 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 _0x1c1b=['destroy','util','path','connect-timeout','express','../../components/interaction/service','../../config/environment','./pause.controller','get','isAuthenticated','/:id','show','post','create','put','update','delete'];(function(_0x179039,_0x1fb713){var _0xeb427=function(_0x307847){while(--_0x307847){_0x179039['push'](_0x179039['shift']());}};_0xeb427(++_0x1fb713);}(_0x1c1b,0x199));var _0xb1c1=function(_0x23defd,_0x4cc995){_0x23defd=_0x23defd-0x0;var _0x416578=_0x1c1b[_0x23defd];return _0x416578;};'use strict';var multer=require('multer');var util=require(_0xb1c1('0x0'));var path=require(_0xb1c1('0x1'));var timeout=require(_0xb1c1('0x2'));var express=require(_0xb1c1('0x3'));var router=express['Router']();var auth=require('../../components/auth/service');var interaction=require(_0xb1c1('0x4'));var config=require(_0xb1c1('0x5'));var controller=require(_0xb1c1('0x6'));router[_0xb1c1('0x7')]('/',auth[_0xb1c1('0x8')](),controller['index']);router[_0xb1c1('0x7')](_0xb1c1('0x9'),auth['isAuthenticated'](),controller[_0xb1c1('0xa')]);router[_0xb1c1('0xb')]('/',auth[_0xb1c1('0x8')](),controller[_0xb1c1('0xc')]);router[_0xb1c1('0xd')](_0xb1c1('0x9'),auth[_0xb1c1('0x8')](),controller[_0xb1c1('0xe')]);router[_0xb1c1('0xf')](_0xb1c1('0x9'),auth['isAuthenticated'](),controller[_0xb1c1('0x10')]);module['exports']=router;
\ No newline at end of file
+var _0x935d=['multer','util','connect-timeout','express','../../components/auth/service','../../components/interaction/service','./pause.controller','get','isAuthenticated','/:id','show','post','create','put','update','delete','destroy','exports'];(function(_0x20a68a,_0x54502e){var _0x56c5d4=function(_0x4ace56){while(--_0x4ace56){_0x20a68a['push'](_0x20a68a['shift']());}};_0x56c5d4(++_0x54502e);}(_0x935d,0x90));var _0xd935=function(_0x3d34da,_0x3abcc1){_0x3d34da=_0x3d34da-0x0;var _0xcf6af8=_0x935d[_0x3d34da];return _0xcf6af8;};'use strict';var multer=require(_0xd935('0x0'));var util=require(_0xd935('0x1'));var path=require('path');var timeout=require(_0xd935('0x2'));var express=require(_0xd935('0x3'));var router=express['Router']();var auth=require(_0xd935('0x4'));var interaction=require(_0xd935('0x5'));var config=require('../../config/environment');var controller=require(_0xd935('0x6'));router[_0xd935('0x7')]('/',auth[_0xd935('0x8')](),controller['index']);router['get'](_0xd935('0x9'),auth[_0xd935('0x8')](),controller[_0xd935('0xa')]);router[_0xd935('0xb')]('/',auth[_0xd935('0x8')](),controller[_0xd935('0xc')]);router[_0xd935('0xd')](_0xd935('0x9'),auth[_0xd935('0x8')](),controller[_0xd935('0xe')]);router[_0xd935('0xf')]('/:id',auth[_0xd935('0x8')](),controller[_0xd935('0x10')]);module[_0xd935('0x11')]=router;
\ No newline at end of file
diff --git a/server/api/pause/pause.attributes.js b/server/api/pause/pause.attributes.js
index 461dd0e..0aacd70 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 _0xb789=['exports','name','STRING','sequelize'];(function(_0x47d2b8,_0x3e1ef5){var _0x2f29d6=function(_0x4c7a08){while(--_0x4c7a08){_0x47d2b8['push'](_0x47d2b8['shift']());}};_0x2f29d6(++_0x3e1ef5);}(_0xb789,0xf7));var _0x9b78=function(_0xeced33,_0x4c447b){_0xeced33=_0xeced33-0x0;var _0x46867c=_0xb789[_0xeced33];return _0x46867c;};'use strict';var Sequelize=require(_0x9b78('0x0'));module[_0x9b78('0x1')]={'name':{'type':Sequelize['STRING'],'unique':_0x9b78('0x2'),'allowNull':![]},'description':{'type':Sequelize[_0x9b78('0x3')]}};
\ No newline at end of file
+var _0xbaf9=['STRING','exports'];(function(_0xdb628e,_0x103e9a){var _0x493aa5=function(_0x48357e){while(--_0x48357e){_0xdb628e['push'](_0xdb628e['shift']());}};_0x493aa5(++_0x103e9a);}(_0xbaf9,0x7f));var _0x9baf=function(_0x1365cb,_0x3d0f80){_0x1365cb=_0x1365cb-0x0;var _0x3bcd03=_0xbaf9[_0x1365cb];return _0x3bcd03;};'use strict';var Sequelize=require('sequelize');module[_0x9baf('0x0')]={'name':{'type':Sequelize[_0x9baf('0x1')],'unique':'name','allowNull':![]},'description':{'type':Sequelize[_0x9baf('0x1')]}};
\ No newline at end of file
diff --git a/server/api/pause/pause.controller.js b/server/api/pause/pause.controller.js
index a812804..8b27ab2 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 _0x9986=['rawAttributes','options','find','create','body','Unable\x20to\x20retrieve\x20the\x20current\x20user','role','get','UserProfileSection','userProfileId','autoAssociation','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','html-pdf','eml-format','rimraf','fast-json-patch','request-promise','moment','bluebird','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','api','../../config/utils','../../config/environment','sendStatus','end','status','json','offset','set','Content-Range','apply','reject','save','update','then','destroy','Pauses','UserProfileResource','error','stack','send','index','map','Pause','fieldName','type','key','model','name','query','keys','intersection','attributes','fields','length','hasOwnProperty','nolimit','limit','order','sort','where','filters','filter','merge','VIRTUAL','count','includeAll','include','rows','catch','show','params'];(function(_0xda464c,_0x26e47d){var _0x19e222=function(_0x1ec605){while(--_0x1ec605){_0xda464c['push'](_0xda464c['shift']());}};_0x19e222(++_0x26e47d);}(_0x9986,0x10e));var _0x6998=function(_0xb0ef6,_0x53cd27){_0xb0ef6=_0xb0ef6-0x0;var _0x30a8ff=_0x9986[_0xb0ef6];return _0x30a8ff;};'use strict';var pdf=require(_0x6998('0x0'));var emlformat=require(_0x6998('0x1'));var rimraf=require(_0x6998('0x2'));var zipdir=require('zip-dir');var jsonpatch=require(_0x6998('0x3'));var rp=require(_0x6998('0x4'));var moment=require(_0x6998('0x5'));var BPromise=require(_0x6998('0x6'));var Mustache=require('mustache');var util=require('util');var path=require(_0x6998('0x7'));var sox=require(_0x6998('0x8'));var csv=require(_0x6998('0x9'));var ejs=require(_0x6998('0xa'));var fs=require('fs');var _=require(_0x6998('0xb'));var squel=require(_0x6998('0xc'));var crypto=require(_0x6998('0xd'));var jsforce=require(_0x6998('0xe'));var deskjs=require(_0x6998('0xf'));var toCsv=require(_0x6998('0x9'));var querystring=require('querystring');var Papa=require(_0x6998('0x10'));var Redis=require(_0x6998('0x11'));var authService=require(_0x6998('0x12'));var qs=require(_0x6998('0x13'));var as=require(_0x6998('0x14'));var hardwareService=require(_0x6998('0x15'));var logger=require('../../config/logger')(_0x6998('0x16'));var utils=require(_0x6998('0x17'));var config=require(_0x6998('0x18'));var db=require('../../mysqldb')['db'];function respondWithStatusCode(_0x42371c,_0x519421){_0x519421=_0x519421||0xcc;return function(_0x10c36e){if(_0x10c36e){return _0x42371c[_0x6998('0x19')](_0x519421);}return _0x42371c['status'](_0x519421)[_0x6998('0x1a')]();};}function respondWithResult(_0x5a9862,_0x6c9f0f){_0x6c9f0f=_0x6c9f0f||0xc8;return function(_0x58ce85){if(_0x58ce85){return _0x5a9862[_0x6998('0x1b')](_0x6c9f0f)[_0x6998('0x1c')](_0x58ce85);}};}function respondWithFilteredResult(_0x3dd198,_0x2cce95){return function(_0x5990a4){if(_0x5990a4){var _0x576787=_0x5990a4['count'],_0x4e5b86=_0x2cce95[_0x6998('0x1d')],_0x4da281=_0x2cce95[_0x6998('0x1d')]+_0x2cce95['limit'],_0x5c0fbf;if(_0x4da281>=_0x576787){_0x4da281=_0x576787;_0x5c0fbf=0xc8;}else{_0x5c0fbf=0xce;}_0x3dd198[_0x6998('0x1b')](_0x5c0fbf);return _0x3dd198[_0x6998('0x1e')](_0x6998('0x1f'),_0x4e5b86+'-'+_0x4da281+'/'+_0x576787)[_0x6998('0x1c')](_0x5990a4);}return null;};}function patchUpdates(_0x53f3fa){return function(_0x2d1ffe){try{jsonpatch[_0x6998('0x20')](_0x2d1ffe,_0x53f3fa,!![]);}catch(_0x569c78){return BPromise[_0x6998('0x21')](_0x569c78);}return _0x2d1ffe[_0x6998('0x22')]();};}function saveUpdates(_0x4485b2,_0x2512dd){return function(_0x142617){if(_0x142617){return _0x142617[_0x6998('0x23')](_0x4485b2)[_0x6998('0x24')](function(_0x2823b5){return _0x2823b5;});}return null;};}function removeEntity(_0x5f46f1,_0x3bd3b2){return function(_0xf3dc1c){if(_0xf3dc1c){return _0xf3dc1c[_0x6998('0x25')]()['then'](function(){var _0x3b6eb4=_0xf3dc1c['get']({'plain':!![]});var _0x41c637=_0x6998('0x26');return db[_0x6998('0x27')][_0x6998('0x25')]({'where':{'type':_0x41c637,'resourceId':_0x3b6eb4['id']}})['then'](function(){return _0xf3dc1c;});})[_0x6998('0x24')](function(){_0x5f46f1[_0x6998('0x1b')](0xcc)[_0x6998('0x1a')]();});}};}function handleEntityNotFound(_0x504489,_0x48bd00){return function(_0x208955){if(!_0x208955){_0x504489[_0x6998('0x19')](0x194);}return _0x208955;};}function handleError(_0x1f651c,_0x21bdda){_0x21bdda=_0x21bdda||0x1f4;return function(_0x40a6b7){logger[_0x6998('0x28')](_0x40a6b7[_0x6998('0x29')]);if(_0x40a6b7['name']){delete _0x40a6b7['name'];}_0x1f651c[_0x6998('0x1b')](_0x21bdda)[_0x6998('0x2a')](_0x40a6b7);};}exports[_0x6998('0x2b')]=function(_0x4e565e,_0x95a51){var _0x2d153b={},_0x2d4a4e={},_0x346b40={'count':0x0,'rows':[]};var _0x3f5045=_[_0x6998('0x2c')](db[_0x6998('0x2d')]['rawAttributes'],function(_0x54b8d2){return{'name':_0x54b8d2[_0x6998('0x2e')],'type':_0x54b8d2[_0x6998('0x2f')][_0x6998('0x30')]};});_0x2d4a4e[_0x6998('0x31')]=_[_0x6998('0x2c')](_0x3f5045,_0x6998('0x32'));_0x2d4a4e[_0x6998('0x33')]=_[_0x6998('0x34')](_0x4e565e[_0x6998('0x33')]);_0x2d4a4e['filters']=_[_0x6998('0x35')](_0x2d4a4e[_0x6998('0x31')],_0x2d4a4e[_0x6998('0x33')]);_0x2d153b[_0x6998('0x36')]=_[_0x6998('0x35')](_0x2d4a4e['model'],qs[_0x6998('0x37')](_0x4e565e[_0x6998('0x33')][_0x6998('0x37')]));_0x2d153b[_0x6998('0x36')]=_0x2d153b['attributes'][_0x6998('0x38')]?_0x2d153b['attributes']:_0x2d4a4e['model'];if(!_0x4e565e['query'][_0x6998('0x39')](_0x6998('0x3a'))){_0x2d153b['limit']=qs[_0x6998('0x3b')](_0x4e565e[_0x6998('0x33')][_0x6998('0x3b')]);_0x2d153b[_0x6998('0x1d')]=qs[_0x6998('0x1d')](_0x4e565e[_0x6998('0x33')]['offset']);}_0x2d153b[_0x6998('0x3c')]=qs[_0x6998('0x3d')](_0x4e565e[_0x6998('0x33')][_0x6998('0x3d')]);_0x2d153b[_0x6998('0x3e')]=qs[_0x6998('0x3f')](_['pick'](_0x4e565e[_0x6998('0x33')],_0x2d4a4e[_0x6998('0x3f')]));if(_0x4e565e[_0x6998('0x33')][_0x6998('0x40')]){_0x2d153b['where']=_[_0x6998('0x41')](_0x2d153b[_0x6998('0x3e')],{'$or':_[_0x6998('0x2c')](_0x3f5045,function(_0x41e0b6){if(_0x41e0b6[_0x6998('0x2f')]!==_0x6998('0x42')){var _0x3a51c7={};_0x3a51c7[_0x41e0b6[_0x6998('0x32')]]={'$like':'%'+_0x4e565e[_0x6998('0x33')]['filter']+'%'};return _0x3a51c7;}})});}_0x2d153b=_[_0x6998('0x41')]({},_0x2d153b,_0x4e565e['options']);var _0x3bd9f6={'where':_0x2d153b[_0x6998('0x3e')]};return db[_0x6998('0x2d')][_0x6998('0x43')](_0x3bd9f6)['then'](function(_0x43096f){_0x346b40[_0x6998('0x43')]=_0x43096f;if(_0x4e565e[_0x6998('0x33')][_0x6998('0x44')]){_0x2d153b[_0x6998('0x45')]=[{'all':!![]}];}return db[_0x6998('0x2d')]['findAll'](_0x2d153b);})[_0x6998('0x24')](function(_0x18af63){_0x346b40[_0x6998('0x46')]=_0x18af63;return _0x346b40;})[_0x6998('0x24')](respondWithFilteredResult(_0x95a51,_0x2d153b))[_0x6998('0x47')](handleError(_0x95a51,null));};exports[_0x6998('0x48')]=function(_0x455a9b,_0x2bb224){var _0x33df4c={'raw':!![],'where':{'id':_0x455a9b[_0x6998('0x49')]['id']}},_0x24449b={};_0x24449b[_0x6998('0x31')]=_['keys'](db[_0x6998('0x2d')][_0x6998('0x4a')]);_0x24449b[_0x6998('0x33')]=_[_0x6998('0x34')](_0x455a9b[_0x6998('0x33')]);_0x24449b[_0x6998('0x3f')]=_[_0x6998('0x35')](_0x24449b['model'],_0x24449b[_0x6998('0x33')]);_0x33df4c['attributes']=_[_0x6998('0x35')](_0x24449b[_0x6998('0x31')],qs[_0x6998('0x37')](_0x455a9b[_0x6998('0x33')][_0x6998('0x37')]));_0x33df4c['attributes']=_0x33df4c['attributes'][_0x6998('0x38')]?_0x33df4c[_0x6998('0x36')]:_0x24449b[_0x6998('0x31')];if(_0x455a9b['query']['includeAll']){_0x33df4c[_0x6998('0x45')]=[{'all':!![]}];}_0x33df4c=_[_0x6998('0x41')]({},_0x33df4c,_0x455a9b[_0x6998('0x4b')]);return db['Pause'][_0x6998('0x4c')](_0x33df4c)[_0x6998('0x24')](handleEntityNotFound(_0x2bb224,null))[_0x6998('0x24')](respondWithResult(_0x2bb224,null))['catch'](handleError(_0x2bb224,null));};exports[_0x6998('0x4d')]=function(_0x11ac7e,_0x58adac){return db[_0x6998('0x2d')][_0x6998('0x4d')](_0x11ac7e[_0x6998('0x4e')],{})[_0x6998('0x24')](function(_0x4451ad){var _0x64e0f1=_0x11ac7e['user']['get']({'plain':!![]});if(!_0x64e0f1)throw new Error(_0x6998('0x4f'));if(_0x64e0f1[_0x6998('0x50')]==='user'){var _0x5cb10c=_0x4451ad[_0x6998('0x51')]({'plain':!![]});var _0x387a20=_0x6998('0x26');return db[_0x6998('0x52')][_0x6998('0x4c')]({'where':{'name':_0x387a20,'userProfileId':_0x64e0f1[_0x6998('0x53')]},'raw':!![]})[_0x6998('0x24')](function(_0x34cf8c){if(_0x34cf8c&&_0x34cf8c[_0x6998('0x54')]===0x0){return db[_0x6998('0x27')]['create']({'name':_0x5cb10c[_0x6998('0x32')],'resourceId':_0x5cb10c['id'],'type':_0x34cf8c[_0x6998('0x32')],'sectionId':_0x34cf8c['id']},{})[_0x6998('0x24')](function(){return _0x4451ad;});}else{return _0x4451ad;}})[_0x6998('0x47')](function(_0x3fd843){logger[_0x6998('0x28')](_0x6998('0x55'),_0x3fd843);throw _0x3fd843;});}return _0x4451ad;})[_0x6998('0x24')](respondWithResult(_0x58adac,0xc9))[_0x6998('0x47')](handleError(_0x58adac,null));};exports[_0x6998('0x23')]=function(_0x13c193,_0x15b3bf){if(_0x13c193[_0x6998('0x4e')]['id']){delete _0x13c193[_0x6998('0x4e')]['id'];}return db['Pause'][_0x6998('0x4c')]({'where':{'id':_0x13c193[_0x6998('0x49')]['id']}})[_0x6998('0x24')](handleEntityNotFound(_0x15b3bf,null))[_0x6998('0x24')](saveUpdates(_0x13c193['body'],null))[_0x6998('0x24')](respondWithResult(_0x15b3bf,null))[_0x6998('0x47')](handleError(_0x15b3bf,null));};exports[_0x6998('0x25')]=function(_0x5e880e,_0x437e53){return db[_0x6998('0x2d')][_0x6998('0x4c')]({'where':{'id':_0x5e880e[_0x6998('0x49')]['id']}})['then'](handleEntityNotFound(_0x437e53,null))[_0x6998('0x24')](removeEntity(_0x437e53,null))['catch'](handleError(_0x437e53,null));};
\ No newline at end of file
+var _0x0169=['../../mysqldb','sendStatus','end','status','json','offset','limit','set','apply','reject','save','update','then','get','Pauses','UserProfileResource','error','name','send','index','map','Pause','rawAttributes','fieldName','key','model','query','keys','filters','attributes','intersection','fields','length','order','sort','where','VIRTUAL','filter','merge','options','count','includeAll','include','findAll','rows','catch','find','body','user','Unable\x20to\x20retrieve\x20the\x20current\x20user','role','UserProfileSection','userProfileId','create','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','params','destroy','eml-format','rimraf','zip-dir','request-promise','moment','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','api','../../config/utils','../../config/environment'];(function(_0x53bddc,_0x6b3b31){var _0x20c033=function(_0x25b207){while(--_0x25b207){_0x53bddc['push'](_0x53bddc['shift']());}};_0x20c033(++_0x6b3b31);}(_0x0169,0x12f));var _0x9016=function(_0x5a04c8,_0xd3d9d){_0x5a04c8=_0x5a04c8-0x0;var _0x797123=_0x0169[_0x5a04c8];return _0x797123;};'use strict';var pdf=require('html-pdf');var emlformat=require(_0x9016('0x0'));var rimraf=require(_0x9016('0x1'));var zipdir=require(_0x9016('0x2'));var jsonpatch=require('fast-json-patch');var rp=require(_0x9016('0x3'));var moment=require(_0x9016('0x4'));var BPromise=require(_0x9016('0x5'));var Mustache=require(_0x9016('0x6'));var util=require(_0x9016('0x7'));var path=require(_0x9016('0x8'));var sox=require(_0x9016('0x9'));var csv=require(_0x9016('0xa'));var ejs=require('ejs');var fs=require('fs');var _=require(_0x9016('0xb'));var squel=require(_0x9016('0xc'));var crypto=require(_0x9016('0xd'));var jsforce=require(_0x9016('0xe'));var deskjs=require(_0x9016('0xf'));var toCsv=require('to-csv');var querystring=require(_0x9016('0x10'));var Papa=require('papaparse');var Redis=require(_0x9016('0x11'));var authService=require(_0x9016('0x12'));var qs=require(_0x9016('0x13'));var as=require(_0x9016('0x14'));var hardwareService=require(_0x9016('0x15'));var logger=require('../../config/logger')(_0x9016('0x16'));var utils=require(_0x9016('0x17'));var config=require(_0x9016('0x18'));var db=require(_0x9016('0x19'))['db'];function respondWithStatusCode(_0x234d1e,_0x5f55b0){_0x5f55b0=_0x5f55b0||0xcc;return function(_0x2f42c6){if(_0x2f42c6){return _0x234d1e[_0x9016('0x1a')](_0x5f55b0);}return _0x234d1e['status'](_0x5f55b0)[_0x9016('0x1b')]();};}function respondWithResult(_0x49d9dc,_0x1d8c6d){_0x1d8c6d=_0x1d8c6d||0xc8;return function(_0x1455ec){if(_0x1455ec){return _0x49d9dc[_0x9016('0x1c')](_0x1d8c6d)[_0x9016('0x1d')](_0x1455ec);}};}function respondWithFilteredResult(_0x250993,_0x173561){return function(_0x29bd3e){if(_0x29bd3e){var _0x1e47e9=_0x29bd3e['count'],_0x3e4786=_0x173561[_0x9016('0x1e')],_0x2b5e41=_0x173561['offset']+_0x173561[_0x9016('0x1f')],_0x3f5ccb;if(_0x2b5e41>=_0x1e47e9){_0x2b5e41=_0x1e47e9;_0x3f5ccb=0xc8;}else{_0x3f5ccb=0xce;}_0x250993[_0x9016('0x1c')](_0x3f5ccb);return _0x250993[_0x9016('0x20')]('Content-Range',_0x3e4786+'-'+_0x2b5e41+'/'+_0x1e47e9)[_0x9016('0x1d')](_0x29bd3e);}return null;};}function patchUpdates(_0x70f9bb){return function(_0x3ad5ab){try{jsonpatch[_0x9016('0x21')](_0x3ad5ab,_0x70f9bb,!![]);}catch(_0x11964c){return BPromise[_0x9016('0x22')](_0x11964c);}return _0x3ad5ab[_0x9016('0x23')]();};}function saveUpdates(_0x1927aa,_0x556a3b){return function(_0xee9dca){if(_0xee9dca){return _0xee9dca[_0x9016('0x24')](_0x1927aa)[_0x9016('0x25')](function(_0x9c57a1){return _0x9c57a1;});}return null;};}function removeEntity(_0x2fc612,_0x2055a6){return function(_0x2b0370){if(_0x2b0370){return _0x2b0370['destroy']()[_0x9016('0x25')](function(){var _0x394d33=_0x2b0370[_0x9016('0x26')]({'plain':!![]});var _0x4ebe98=_0x9016('0x27');return db[_0x9016('0x28')]['destroy']({'where':{'type':_0x4ebe98,'resourceId':_0x394d33['id']}})['then'](function(){return _0x2b0370;});})['then'](function(){_0x2fc612[_0x9016('0x1c')](0xcc)[_0x9016('0x1b')]();});}};}function handleEntityNotFound(_0x4a50f5,_0x4045d9){return function(_0x23fe95){if(!_0x23fe95){_0x4a50f5[_0x9016('0x1a')](0x194);}return _0x23fe95;};}function handleError(_0x3d93c3,_0x451dc8){_0x451dc8=_0x451dc8||0x1f4;return function(_0x55da3f){logger[_0x9016('0x29')](_0x55da3f['stack']);if(_0x55da3f[_0x9016('0x2a')]){delete _0x55da3f[_0x9016('0x2a')];}_0x3d93c3[_0x9016('0x1c')](_0x451dc8)[_0x9016('0x2b')](_0x55da3f);};}exports[_0x9016('0x2c')]=function(_0x53ac54,_0x3ae64b){var _0x4c3ae9={},_0x5b73d4={},_0x4f1e83={'count':0x0,'rows':[]};var _0x55c9ee=_[_0x9016('0x2d')](db[_0x9016('0x2e')][_0x9016('0x2f')],function(_0x4dbdfd){return{'name':_0x4dbdfd[_0x9016('0x30')],'type':_0x4dbdfd['type'][_0x9016('0x31')]};});_0x5b73d4[_0x9016('0x32')]=_[_0x9016('0x2d')](_0x55c9ee,_0x9016('0x2a'));_0x5b73d4[_0x9016('0x33')]=_[_0x9016('0x34')](_0x53ac54[_0x9016('0x33')]);_0x5b73d4[_0x9016('0x35')]=_['intersection'](_0x5b73d4[_0x9016('0x32')],_0x5b73d4[_0x9016('0x33')]);_0x4c3ae9[_0x9016('0x36')]=_[_0x9016('0x37')](_0x5b73d4[_0x9016('0x32')],qs[_0x9016('0x38')](_0x53ac54[_0x9016('0x33')][_0x9016('0x38')]));_0x4c3ae9[_0x9016('0x36')]=_0x4c3ae9['attributes'][_0x9016('0x39')]?_0x4c3ae9[_0x9016('0x36')]:_0x5b73d4['model'];if(!_0x53ac54[_0x9016('0x33')]['hasOwnProperty']('nolimit')){_0x4c3ae9[_0x9016('0x1f')]=qs[_0x9016('0x1f')](_0x53ac54[_0x9016('0x33')][_0x9016('0x1f')]);_0x4c3ae9[_0x9016('0x1e')]=qs[_0x9016('0x1e')](_0x53ac54['query'][_0x9016('0x1e')]);}_0x4c3ae9[_0x9016('0x3a')]=qs[_0x9016('0x3b')](_0x53ac54[_0x9016('0x33')]['sort']);_0x4c3ae9[_0x9016('0x3c')]=qs[_0x9016('0x35')](_['pick'](_0x53ac54[_0x9016('0x33')],_0x5b73d4[_0x9016('0x35')]));if(_0x53ac54['query']['filter']){_0x4c3ae9[_0x9016('0x3c')]=_['merge'](_0x4c3ae9['where'],{'$or':_['map'](_0x55c9ee,function(_0x23f192){if(_0x23f192['type']!==_0x9016('0x3d')){var _0x5bac9d={};_0x5bac9d[_0x23f192[_0x9016('0x2a')]]={'$like':'%'+_0x53ac54[_0x9016('0x33')][_0x9016('0x3e')]+'%'};return _0x5bac9d;}})});}_0x4c3ae9=_[_0x9016('0x3f')]({},_0x4c3ae9,_0x53ac54[_0x9016('0x40')]);var _0x41249c={'where':_0x4c3ae9[_0x9016('0x3c')]};return db[_0x9016('0x2e')][_0x9016('0x41')](_0x41249c)[_0x9016('0x25')](function(_0x3dee02){_0x4f1e83['count']=_0x3dee02;if(_0x53ac54[_0x9016('0x33')][_0x9016('0x42')]){_0x4c3ae9[_0x9016('0x43')]=[{'all':!![]}];}return db['Pause'][_0x9016('0x44')](_0x4c3ae9);})[_0x9016('0x25')](function(_0x5512a4){_0x4f1e83[_0x9016('0x45')]=_0x5512a4;return _0x4f1e83;})[_0x9016('0x25')](respondWithFilteredResult(_0x3ae64b,_0x4c3ae9))[_0x9016('0x46')](handleError(_0x3ae64b,null));};exports['show']=function(_0x1f563f,_0x12ceba){var _0x4c8107={'raw':!![],'where':{'id':_0x1f563f['params']['id']}},_0x1a2016={};_0x1a2016[_0x9016('0x32')]=_[_0x9016('0x34')](db[_0x9016('0x2e')][_0x9016('0x2f')]);_0x1a2016['query']=_[_0x9016('0x34')](_0x1f563f[_0x9016('0x33')]);_0x1a2016[_0x9016('0x35')]=_[_0x9016('0x37')](_0x1a2016[_0x9016('0x32')],_0x1a2016[_0x9016('0x33')]);_0x4c8107[_0x9016('0x36')]=_[_0x9016('0x37')](_0x1a2016['model'],qs['fields'](_0x1f563f['query']['fields']));_0x4c8107['attributes']=_0x4c8107[_0x9016('0x36')][_0x9016('0x39')]?_0x4c8107[_0x9016('0x36')]:_0x1a2016[_0x9016('0x32')];if(_0x1f563f[_0x9016('0x33')][_0x9016('0x42')]){_0x4c8107[_0x9016('0x43')]=[{'all':!![]}];}_0x4c8107=_[_0x9016('0x3f')]({},_0x4c8107,_0x1f563f[_0x9016('0x40')]);return db['Pause'][_0x9016('0x47')](_0x4c8107)[_0x9016('0x25')](handleEntityNotFound(_0x12ceba,null))[_0x9016('0x25')](respondWithResult(_0x12ceba,null))['catch'](handleError(_0x12ceba,null));};exports['create']=function(_0x2ed1f0,_0x193f46){return db['Pause']['create'](_0x2ed1f0[_0x9016('0x48')],{})[_0x9016('0x25')](function(_0x3e1faf){var _0xda7da3=_0x2ed1f0[_0x9016('0x49')][_0x9016('0x26')]({'plain':!![]});if(!_0xda7da3)throw new Error(_0x9016('0x4a'));if(_0xda7da3[_0x9016('0x4b')]===_0x9016('0x49')){var _0x3aec77=_0x3e1faf[_0x9016('0x26')]({'plain':!![]});var _0x2d8f27='Pauses';return db[_0x9016('0x4c')]['find']({'where':{'name':_0x2d8f27,'userProfileId':_0xda7da3[_0x9016('0x4d')]},'raw':!![]})[_0x9016('0x25')](function(_0x2c2da7){if(_0x2c2da7&&_0x2c2da7['autoAssociation']===0x0){return db[_0x9016('0x28')][_0x9016('0x4e')]({'name':_0x3aec77['name'],'resourceId':_0x3aec77['id'],'type':_0x2c2da7[_0x9016('0x2a')],'sectionId':_0x2c2da7['id']},{})[_0x9016('0x25')](function(){return _0x3e1faf;});}else{return _0x3e1faf;}})[_0x9016('0x46')](function(_0xd8bc0b){logger['error'](_0x9016('0x4f'),_0xd8bc0b);throw _0xd8bc0b;});}return _0x3e1faf;})[_0x9016('0x25')](respondWithResult(_0x193f46,0xc9))[_0x9016('0x46')](handleError(_0x193f46,null));};exports[_0x9016('0x24')]=function(_0x54cba5,_0x2b0184){if(_0x54cba5['body']['id']){delete _0x54cba5[_0x9016('0x48')]['id'];}return db[_0x9016('0x2e')][_0x9016('0x47')]({'where':{'id':_0x54cba5[_0x9016('0x50')]['id']}})[_0x9016('0x25')](handleEntityNotFound(_0x2b0184,null))[_0x9016('0x25')](saveUpdates(_0x54cba5[_0x9016('0x48')],null))[_0x9016('0x25')](respondWithResult(_0x2b0184,null))[_0x9016('0x46')](handleError(_0x2b0184,null));};exports[_0x9016('0x51')]=function(_0x172b28,_0xeed312){return db[_0x9016('0x2e')][_0x9016('0x47')]({'where':{'id':_0x172b28[_0x9016('0x50')]['id']}})[_0x9016('0x25')](handleEntityNotFound(_0xeed312,null))[_0x9016('0x25')](removeEntity(_0xeed312,null))['catch'](handleError(_0xeed312,null));};
\ No newline at end of file
diff --git a/server/api/pause/pause.model.js b/server/api/pause/pause.model.js
index 615d8f4..8d79ba3 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 _0x9d5b=['exports','Pause','tools_pauses','util','../../config/logger','api','moment','bluebird','path','../../config/environment','./pause.attributes'];(function(_0x2aecb2,_0x343312){var _0x3ebb80=function(_0x19fab3){while(--_0x19fab3){_0x2aecb2['push'](_0x2aecb2['shift']());}};_0x3ebb80(++_0x343312);}(_0x9d5b,0x14d));var _0xb9d5=function(_0x93ed4a,_0x22775e){_0x93ed4a=_0x93ed4a-0x0;var _0x15d604=_0x9d5b[_0x93ed4a];return _0x15d604;};'use strict';var _=require('lodash');var util=require(_0xb9d5('0x0'));var logger=require(_0xb9d5('0x1'))(_0xb9d5('0x2'));var moment=require(_0xb9d5('0x3'));var BPromise=require(_0xb9d5('0x4'));var rp=require('request-promise');var fs=require('fs');var path=require(_0xb9d5('0x5'));var rimraf=require('rimraf');var config=require(_0xb9d5('0x6'));var attributes=require(_0xb9d5('0x7'));module[_0xb9d5('0x8')]=function(_0x39d8fe,_0x422a92){return _0x39d8fe['define'](_0xb9d5('0x9'),attributes,{'tableName':_0xb9d5('0xa'),'paranoid':![],'indexes':[],'timestamps':!![]});};
\ No newline at end of file
+var _0x15b8=['moment','bluebird','path','rimraf','../../config/environment','./pause.attributes','exports','define','Pause','tools_pauses','util','../../config/logger','api'];(function(_0x4d321a,_0x515ed3){var _0x53914b=function(_0x23f5ab){while(--_0x23f5ab){_0x4d321a['push'](_0x4d321a['shift']());}};_0x53914b(++_0x515ed3);}(_0x15b8,0xcd));var _0x815b=function(_0x23e7c1,_0x35110c){_0x23e7c1=_0x23e7c1-0x0;var _0x1add43=_0x15b8[_0x23e7c1];return _0x1add43;};'use strict';var _=require('lodash');var util=require(_0x815b('0x0'));var logger=require(_0x815b('0x1'))(_0x815b('0x2'));var moment=require(_0x815b('0x3'));var BPromise=require(_0x815b('0x4'));var rp=require('request-promise');var fs=require('fs');var path=require(_0x815b('0x5'));var rimraf=require(_0x815b('0x6'));var config=require(_0x815b('0x7'));var attributes=require(_0x815b('0x8'));module[_0x815b('0x9')]=function(_0x37a503,_0x581869){return _0x37a503[_0x815b('0xa')](_0x815b('0xb'),attributes,{'tableName':_0x815b('0xc'),'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 a1f80de..5c57896 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 _0x319c=['catch','Pause','find','options','raw','where','attributes','include','model','map','ShowPause','lodash','moment','bluebird','randomstring','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','client','http','then','info','Pause,\x20%s,\x20%s','request\x20sent','debug','Pause,\x20%s,\x20%s,\x20%s','stringify','error','code','message'];(function(_0x36a64c,_0x4b784e){var _0x128f87=function(_0x326e7a){while(--_0x326e7a){_0x36a64c['push'](_0x36a64c['shift']());}};_0x128f87(++_0x4b784e);}(_0x319c,0x1d9));var _0xc319=function(_0x1b6c6d,_0x2983b0){_0x1b6c6d=_0x1b6c6d-0x0;var _0x290d9d=_0x319c[_0x1b6c6d];return _0x290d9d;};'use strict';var _=require(_0xc319('0x0'));var util=require('util');var moment=require(_0xc319('0x1'));var BPromise=require(_0xc319('0x2'));var rs=require(_0xc319('0x3'));var fs=require('fs');var Redis=require('ioredis');var db=require(_0xc319('0x4'))['db'];var utils=require(_0xc319('0x5'));var logger=require(_0xc319('0x6'))(_0xc319('0x7'));var config=require(_0xc319('0x8'));var jayson=require(_0xc319('0x9'));var client=jayson[_0xc319('0xa')][_0xc319('0xb')]({'port':0x232a});function respondWithRpcPromise(_0x373ad2,_0x1c6ae2,_0x16f155){return new BPromise(function(_0x7a3e50,_0x3ea00e){return client['request'](_0x373ad2,_0x16f155)[_0xc319('0xc')](function(_0x371c12){logger[_0xc319('0xd')](_0xc319('0xe'),_0x1c6ae2,_0xc319('0xf'));logger[_0xc319('0x10')](_0xc319('0x11'),_0x1c6ae2,_0xc319('0xf'),JSON[_0xc319('0x12')](_0x371c12));if(_0x371c12[_0xc319('0x13')]){if(_0x371c12[_0xc319('0x13')][_0xc319('0x14')]===0x1f4){logger[_0xc319('0x13')](_0xc319('0xe'),_0x1c6ae2,_0x371c12[_0xc319('0x13')][_0xc319('0x15')]);return _0x3ea00e(_0x371c12['error'][_0xc319('0x15')]);}logger[_0xc319('0x13')](_0xc319('0xe'),_0x1c6ae2,_0x371c12[_0xc319('0x13')][_0xc319('0x15')]);return _0x7a3e50(_0x371c12[_0xc319('0x13')][_0xc319('0x15')]);}else{logger['info']('Pause,\x20%s,\x20%s',_0x1c6ae2,_0xc319('0xf'));_0x7a3e50(_0x371c12['result']['message']);}})[_0xc319('0x16')](function(_0x14757b){logger[_0xc319('0x13')](_0xc319('0xe'),_0x1c6ae2,_0x14757b);_0x3ea00e(_0x14757b);});});}exports['ShowPause']=function(_0x43cb3b){var _0x2d352b=this;return new Promise(function(_0x3c0dda,_0x3c0612){return db[_0xc319('0x17')][_0xc319('0x18')]({'raw':_0x43cb3b['options']?_0x43cb3b[_0xc319('0x19')][_0xc319('0x1a')]===undefined?!![]:![]:!![],'where':_0x43cb3b[_0xc319('0x19')]?_0x43cb3b[_0xc319('0x19')][_0xc319('0x1b')]||null:null,'attributes':_0x43cb3b[_0xc319('0x19')]?_0x43cb3b[_0xc319('0x19')][_0xc319('0x1c')]||null:null,'include':_0x43cb3b[_0xc319('0x19')]?_0x43cb3b[_0xc319('0x19')][_0xc319('0x1d')]?_['map'](_0x43cb3b['options'][_0xc319('0x1d')],function(_0x3cbec3){return{'model':db[_0x3cbec3[_0xc319('0x1e')]],'as':_0x3cbec3['as'],'attributes':_0x3cbec3[_0xc319('0x1c')],'include':_0x3cbec3[_0xc319('0x1d')]?_[_0xc319('0x1f')](_0x3cbec3[_0xc319('0x1d')],function(_0x1ed6b7){return{'model':db[_0x1ed6b7[_0xc319('0x1e')]],'as':_0x1ed6b7['as'],'attributes':_0x1ed6b7[_0xc319('0x1c')],'include':_0x1ed6b7[_0xc319('0x1d')]?_['map'](_0x1ed6b7[_0xc319('0x1d')],function(_0x4e5f5b){return{'model':db[_0x4e5f5b[_0xc319('0x1e')]],'as':_0x4e5f5b['as'],'attributes':_0x4e5f5b['attributes']};}):[]};}):[]};}):[]:[]})[_0xc319('0xc')](function(_0x5b122b){logger[_0xc319('0xd')]('ShowPause',_0x43cb3b);logger[_0xc319('0x10')](_0xc319('0x20'),_0x43cb3b,JSON['stringify'](_0x5b122b));_0x3c0dda(_0x5b122b);})[_0xc319('0x16')](function(_0x387caf){logger[_0xc319('0x13')](_0xc319('0x20'),_0x387caf['message'],_0x43cb3b);_0x3c0612(_0x2d352b[_0xc319('0x13')](0x1f4,_0x387caf[_0xc319('0x15')]));});});};
\ No newline at end of file
+var _0xabbe=['http','request','info','Pause,\x20%s,\x20%s','request\x20sent','Pause,\x20%s,\x20%s,\x20%s','stringify','error','code','message','result','catch','Pause','find','options','raw','where','attributes','include','map','model','ShowPause','lodash','moment','randomstring','ioredis','../../mysqldb','rpc','../../config/environment','client'];(function(_0x598680,_0x3d8825){var _0x27bc1a=function(_0x260bcb){while(--_0x260bcb){_0x598680['push'](_0x598680['shift']());}};_0x27bc1a(++_0x3d8825);}(_0xabbe,0x70));var _0xeabb=function(_0xc70b4,_0x55199c){_0xc70b4=_0xc70b4-0x0;var _0x526656=_0xabbe[_0xc70b4];return _0x526656;};'use strict';var _=require(_0xeabb('0x0'));var util=require('util');var moment=require(_0xeabb('0x1'));var BPromise=require('bluebird');var rs=require(_0xeabb('0x2'));var fs=require('fs');var Redis=require(_0xeabb('0x3'));var db=require(_0xeabb('0x4'))['db'];var utils=require('../../config/utils');var logger=require('../../config/logger')(_0xeabb('0x5'));var config=require(_0xeabb('0x6'));var jayson=require('jayson/promise');var client=jayson[_0xeabb('0x7')][_0xeabb('0x8')]({'port':0x232a});function respondWithRpcPromise(_0x534e4d,_0x3867b5,_0x17386a){return new BPromise(function(_0xe64536,_0x3a7a9c){return client[_0xeabb('0x9')](_0x534e4d,_0x17386a)['then'](function(_0x5ea9c9){logger[_0xeabb('0xa')](_0xeabb('0xb'),_0x3867b5,_0xeabb('0xc'));logger['debug'](_0xeabb('0xd'),_0x3867b5,_0xeabb('0xc'),JSON[_0xeabb('0xe')](_0x5ea9c9));if(_0x5ea9c9[_0xeabb('0xf')]){if(_0x5ea9c9[_0xeabb('0xf')][_0xeabb('0x10')]===0x1f4){logger['error'](_0xeabb('0xb'),_0x3867b5,_0x5ea9c9['error'][_0xeabb('0x11')]);return _0x3a7a9c(_0x5ea9c9[_0xeabb('0xf')][_0xeabb('0x11')]);}logger[_0xeabb('0xf')](_0xeabb('0xb'),_0x3867b5,_0x5ea9c9[_0xeabb('0xf')][_0xeabb('0x11')]);return _0xe64536(_0x5ea9c9['error'][_0xeabb('0x11')]);}else{logger['info'](_0xeabb('0xb'),_0x3867b5,'request\x20sent');_0xe64536(_0x5ea9c9[_0xeabb('0x12')][_0xeabb('0x11')]);}})[_0xeabb('0x13')](function(_0x3a5879){logger[_0xeabb('0xf')]('Pause,\x20%s,\x20%s',_0x3867b5,_0x3a5879);_0x3a7a9c(_0x3a5879);});});}exports['ShowPause']=function(_0x153ea4){var _0x368386=this;return new Promise(function(_0x8412c1,_0x4198ad){return db[_0xeabb('0x14')][_0xeabb('0x15')]({'raw':_0x153ea4['options']?_0x153ea4[_0xeabb('0x16')][_0xeabb('0x17')]===undefined?!![]:![]:!![],'where':_0x153ea4['options']?_0x153ea4[_0xeabb('0x16')][_0xeabb('0x18')]||null:null,'attributes':_0x153ea4[_0xeabb('0x16')]?_0x153ea4[_0xeabb('0x16')][_0xeabb('0x19')]||null:null,'include':_0x153ea4['options']?_0x153ea4[_0xeabb('0x16')][_0xeabb('0x1a')]?_[_0xeabb('0x1b')](_0x153ea4[_0xeabb('0x16')][_0xeabb('0x1a')],function(_0x278e37){return{'model':db[_0x278e37[_0xeabb('0x1c')]],'as':_0x278e37['as'],'attributes':_0x278e37[_0xeabb('0x19')],'include':_0x278e37[_0xeabb('0x1a')]?_['map'](_0x278e37['include'],function(_0x4622e9){return{'model':db[_0x4622e9[_0xeabb('0x1c')]],'as':_0x4622e9['as'],'attributes':_0x4622e9[_0xeabb('0x19')],'include':_0x4622e9[_0xeabb('0x1a')]?_[_0xeabb('0x1b')](_0x4622e9[_0xeabb('0x1a')],function(_0x194977){return{'model':db[_0x194977[_0xeabb('0x1c')]],'as':_0x194977['as'],'attributes':_0x194977[_0xeabb('0x19')]};}):[]};}):[]};}):[]:[]})['then'](function(_0x5aa82f){logger['info']('ShowPause',_0x153ea4);logger['debug'](_0xeabb('0x1d'),_0x153ea4,JSON[_0xeabb('0xe')](_0x5aa82f));_0x8412c1(_0x5aa82f);})['catch'](function(_0x443846){logger['error'](_0xeabb('0x1d'),_0x443846[_0xeabb('0x11')],_0x153ea4);_0x4198ad(_0x368386[_0xeabb('0xf')](0x1f4,_0x443846[_0xeabb('0x11')]));});});};
\ No newline at end of file
diff --git a/server/api/plugin/index.js b/server/api/plugin/index.js
index e084b34..1d20f03 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 _0x980c=['Router','../../components/auth/service','../../components/interaction/service','../../config/environment','./plugin.controller','get','isAuthenticated','index','/webhook','webhookGet','show','/:id/download','download','join','root','server/files/plugins','originalname','%s-%s%s','extname','now','post','single','upload','webhookPost','put','/:id','update','delete','exports','multer','path','connect-timeout','express'];(function(_0x25ba6a,_0x4422d6){var _0x1be09a=function(_0x308e7b){while(--_0x308e7b){_0x25ba6a['push'](_0x25ba6a['shift']());}};_0x1be09a(++_0x4422d6);}(_0x980c,0x1a9));var _0xc980=function(_0x344239,_0x516ba2){_0x344239=_0x344239-0x0;var _0x141910=_0x980c[_0x344239];return _0x141910;};'use strict';var multer=require(_0xc980('0x0'));var util=require('util');var path=require(_0xc980('0x1'));var timeout=require(_0xc980('0x2'));var express=require(_0xc980('0x3'));var router=express[_0xc980('0x4')]();var auth=require(_0xc980('0x5'));var interaction=require(_0xc980('0x6'));var config=require(_0xc980('0x7'));var controller=require(_0xc980('0x8'));router[_0xc980('0x9')]('/',auth[_0xc980('0xa')](),controller[_0xc980('0xb')]);router['get'](_0xc980('0xc'),controller[_0xc980('0xd')]);router[_0xc980('0x9')]('/:id',auth[_0xc980('0xa')](),controller[_0xc980('0xe')]);router[_0xc980('0x9')](_0xc980('0xf'),auth[_0xc980('0xa')](),controller[_0xc980('0x10')]);var upload=multer({'storage':multer['diskStorage']({'destination':function(_0x204265,_0x23085b,_0x25f8cb){_0x25f8cb(null,path[_0xc980('0x11')](config[_0xc980('0x12')],_0xc980('0x13')));},'filename':function(_0x33b128,_0x5acd70,_0x179535){_0x5acd70[_0xc980('0x14')]=_0x5acd70[_0xc980('0x14')]['replace'](/[+@&\/\\#,+()$~%'":*?<>{}\s\\|]/g,'-');_0x179535(null,util['format'](_0xc980('0x15'),path['basename'](_0x5acd70['originalname'],path[_0xc980('0x16')](_0x5acd70['originalname'])),Date[_0xc980('0x17')](),path['extname'](_0x5acd70['originalname'])));}})});router[_0xc980('0x18')]('/',upload[_0xc980('0x19')]('file'),controller[_0xc980('0x1a')]);router[_0xc980('0x18')](_0xc980('0xc'),controller[_0xc980('0x1b')]);router[_0xc980('0x1c')](_0xc980('0x1d'),auth[_0xc980('0xa')](),controller[_0xc980('0x1e')]);router[_0xc980('0x1f')](_0xc980('0x1d'),auth['isAuthenticated'](),controller[_0xc980('0x1f')]);module[_0xc980('0x20')]=router;
\ No newline at end of file
+var _0xf62f=['../../components/auth/service','../../config/environment','./plugin.controller','get','isAuthenticated','index','/webhook','webhookGet','/:id','show','/:id/download','download','root','server/files/plugins','originalname','replace','format','basename','post','single','file','upload','put','update','delete','exports','multer','util','path','connect-timeout','express','Router'];(function(_0x384dfd,_0x54bc76){var _0x5e232c=function(_0x218405){while(--_0x218405){_0x384dfd['push'](_0x384dfd['shift']());}};_0x5e232c(++_0x54bc76);}(_0xf62f,0x13a));var _0xff62=function(_0x4039d5,_0x428608){_0x4039d5=_0x4039d5-0x0;var _0x26d423=_0xf62f[_0x4039d5];return _0x26d423;};'use strict';var multer=require(_0xff62('0x0'));var util=require(_0xff62('0x1'));var path=require(_0xff62('0x2'));var timeout=require(_0xff62('0x3'));var express=require(_0xff62('0x4'));var router=express[_0xff62('0x5')]();var auth=require(_0xff62('0x6'));var interaction=require('../../components/interaction/service');var config=require(_0xff62('0x7'));var controller=require(_0xff62('0x8'));router[_0xff62('0x9')]('/',auth[_0xff62('0xa')](),controller[_0xff62('0xb')]);router[_0xff62('0x9')](_0xff62('0xc'),controller[_0xff62('0xd')]);router['get'](_0xff62('0xe'),auth['isAuthenticated'](),controller[_0xff62('0xf')]);router[_0xff62('0x9')](_0xff62('0x10'),auth['isAuthenticated'](),controller[_0xff62('0x11')]);var upload=multer({'storage':multer['diskStorage']({'destination':function(_0x1fa252,_0x58f790,_0x4b8bbd){_0x4b8bbd(null,path['join'](config[_0xff62('0x12')],_0xff62('0x13')));},'filename':function(_0x3258d7,_0x1fa6a8,_0x3d4121){_0x1fa6a8[_0xff62('0x14')]=_0x1fa6a8[_0xff62('0x14')][_0xff62('0x15')](/[+@&\/\\#,+()$~%'":*?<>{}\s\\|]/g,'-');_0x3d4121(null,util[_0xff62('0x16')]('%s-%s%s',path[_0xff62('0x17')](_0x1fa6a8['originalname'],path['extname'](_0x1fa6a8[_0xff62('0x14')])),Date['now'](),path['extname'](_0x1fa6a8['originalname'])));}})});router[_0xff62('0x18')]('/',upload[_0xff62('0x19')](_0xff62('0x1a')),controller[_0xff62('0x1b')]);router[_0xff62('0x18')](_0xff62('0xc'),controller['webhookPost']);router[_0xff62('0x1c')]('/:id',auth[_0xff62('0xa')](),controller[_0xff62('0x1d')]);router[_0xff62('0x1e')](_0xff62('0xe'),auth[_0xff62('0xa')](),controller['delete']);module[_0xff62('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 32953bb..2cff2fb 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 _0xe97b=['BOOLEAN','Indicates\x20whether\x20the\x20plugin\x20is\x20installed.\x20Updated\x20when\x20the\x20plugin\x20is\x20installed/uninstalled.','always','never','Indicates\x20whether\x20to\x20display\x20the\x20plugin\x20in\x20the\x20sidebar.','sequelize','exports','STRING','ENUM','html','script','TEXT','The\x20physical\x20path\x20where\x20the\x20plugin\x20is\x20stored.'];(function(_0x2e6b60,_0x5a2562){var _0x3937cb=function(_0x32104a){while(--_0x32104a){_0x2e6b60['push'](_0x2e6b60['shift']());}};_0x3937cb(++_0x5a2562);}(_0xe97b,0x157));var _0xbe97=function(_0x4fe12e,_0x4e9dfe){_0x4fe12e=_0x4fe12e-0x0;var _0x417f40=_0xe97b[_0x4fe12e];return _0x417f40;};'use strict';var Sequelize=require(_0xbe97('0x0'));module[_0xbe97('0x1')]={'name':{'type':Sequelize[_0xbe97('0x2')]},'type':{'type':Sequelize[_0xbe97('0x3')](_0xbe97('0x4'),_0xbe97('0x5'))},'description':{'type':Sequelize[_0xbe97('0x6')]},'version':{'type':Sequelize[_0xbe97('0x6')]},'path':{'type':Sequelize[_0xbe97('0x2')],'comment':_0xbe97('0x7')},'active':{'type':Sequelize[_0xbe97('0x8')],'defaultValue':0x0,'comment':_0xbe97('0x9')},'sidebar':{'type':Sequelize[_0xbe97('0x3')]('adminOnly','agentOnly',_0xbe97('0xa'),_0xbe97('0xb')),'defaultValue':_0xbe97('0xa'),'comment':_0xbe97('0xc')},'icon':{'type':Sequelize[_0xbe97('0x2')]},'adminUrl':{'type':Sequelize['STRING']},'agentUrl':{'type':Sequelize[_0xbe97('0x2')]},'scriptName':{'type':Sequelize[_0xbe97('0x2')]},'scriptPath':{'type':Sequelize[_0xbe97('0x2')]}};
\ No newline at end of file
+var _0xecf0=['Indicates\x20whether\x20to\x20display\x20the\x20plugin\x20in\x20the\x20sidebar.','exports','STRING','ENUM','script','The\x20physical\x20path\x20where\x20the\x20plugin\x20is\x20stored.','BOOLEAN','Indicates\x20whether\x20the\x20plugin\x20is\x20installed.\x20Updated\x20when\x20the\x20plugin\x20is\x20installed/uninstalled.','agentOnly','always','never'];(function(_0x1391a8,_0x4e2f7f){var _0x1e3519=function(_0x1ad406){while(--_0x1ad406){_0x1391a8['push'](_0x1391a8['shift']());}};_0x1e3519(++_0x4e2f7f);}(_0xecf0,0x1a3));var _0x0ecf=function(_0x11ee94,_0x2f1d8b){_0x11ee94=_0x11ee94-0x0;var _0x3a1623=_0xecf0[_0x11ee94];return _0x3a1623;};'use strict';var Sequelize=require('sequelize');module[_0x0ecf('0x0')]={'name':{'type':Sequelize[_0x0ecf('0x1')]},'type':{'type':Sequelize[_0x0ecf('0x2')]('html',_0x0ecf('0x3'))},'description':{'type':Sequelize['TEXT']},'version':{'type':Sequelize['TEXT']},'path':{'type':Sequelize[_0x0ecf('0x1')],'comment':_0x0ecf('0x4')},'active':{'type':Sequelize[_0x0ecf('0x5')],'defaultValue':0x0,'comment':_0x0ecf('0x6')},'sidebar':{'type':Sequelize[_0x0ecf('0x2')]('adminOnly',_0x0ecf('0x7'),_0x0ecf('0x8'),_0x0ecf('0x9')),'defaultValue':_0x0ecf('0x8'),'comment':_0x0ecf('0xa')},'icon':{'type':Sequelize['STRING']},'adminUrl':{'type':Sequelize[_0x0ecf('0x1')]},'agentUrl':{'type':Sequelize[_0x0ecf('0x1')]},'scriptName':{'type':Sequelize[_0x0ecf('0x1')]},'scriptPath':{'type':Sequelize[_0x0ecf('0x1')]}};
\ No newline at end of file
diff --git a/server/api/plugin/plugin.controller.js b/server/api/plugin/plugin.controller.js
index 5119261..d004b2e 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 _0x352f=['jsforce','querystring','papaparse','extract-zip','ioredis','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','api','../../config/environment','../../mysqldb','defaults','localhost','socket.io-emitter','redis','./plugin.socket','register','sendStatus','status','json','count','offset','set','Content-Range','apply','reject','save','update','then','Plugins','destroy','end','error','name','send','map','Plugin','rawAttributes','type','key','model','query','keys','filters','intersection','attributes','fields','hasOwnProperty','nolimit','limit','order','sort','where','pick','VIRTUAL','merge','includeAll','findAll','catch','show','params','length','include','find','download','join','root','server/files/plugins','format','%s.zip','basename','createWriteStream','zip','warning','ENOENT','Sequelize','Error','Error\x20while\x20generating\x20the\x20zip\x20archive','pipe','glob','dirname','finalize','close','existsSync','Plugin\x20not\x20found','Error\x20while\x20downloading\x20the\x20plugin','unlinkSync','info','Download\x20completed','Temporary\x20file\x20removed','upload','file','filename','extname','Plugin\x20upload\x20filepath:\x20%s','chmodSync','0777','readdirSync','Invalid\x20plugin\x20structure','isFile','some','manifest.json','Plugin\x20manifest\x20missing','parse','undefined','Invalid\x20manifest:\x20name\x20missing','Invalid\x20manifest:\x20type\x20missing','Invalid\x20manifest:\x20version\x20not\x20specified','Invalid\x20manifest:\x20parameters\x20missing','html','parameters','views','admin','agent','Invalid\x20manifest:\x20no\x20view\x20specified','script','scriptName','Invalid\x20manifest:\x20script\x20name\x20missing','Invalid\x20manifest:\x20script\x20path\x20missing','Invalid\x20manifest:\x20invalid\x20type','description','sidebar','always','icon','icon-apps','version','test','plugins','Warning:\x20agent\x20view\x20not\x20specified','scriptPath','create','body','role','userProfileId','Unable\x20to\x20retrieve\x20the\x20current\x20user','user','get','autoAssociation','UserProfileResource','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','Zip\x20archive\x20removed','Extracted\x20folder\x20removed','delete','webhookGet','resolve','hostname','port','encoding','method','%s%s','headers','content-length','content-type','endsWith','statusCode','webhookPost','\x27PORT\x27\x20parameter\x20not\x20specified','html-pdf','eml-format','rimraf','zip-dir','fast-json-patch','moment','bluebird','mustache','util','path','ejs','lodash','squel','crypto'];(function(_0x5ddb1c,_0x5ea4df){var _0x354adc=function(_0x2dfb1f){while(--_0x2dfb1f){_0x5ddb1c['push'](_0x5ddb1c['shift']());}};_0x354adc(++_0x5ea4df);}(_0x352f,0x9d));var _0xf352=function(_0x502c7d,_0x2f1285){_0x502c7d=_0x502c7d-0x0;var _0x30b7ed=_0x352f[_0x502c7d];return _0x30b7ed;};'use strict';var pdf=require(_0xf352('0x0'));var emlformat=require(_0xf352('0x1'));var rimraf=require(_0xf352('0x2'));var zipdir=require(_0xf352('0x3'));var jsonpatch=require(_0xf352('0x4'));var rp=require('request-promise');var moment=require(_0xf352('0x5'));var BPromise=require(_0xf352('0x6'));var Mustache=require(_0xf352('0x7'));var util=require(_0xf352('0x8'));var path=require(_0xf352('0x9'));var sox=require('sox');var csv=require('to-csv');var ejs=require(_0xf352('0xa'));var fs=require('fs');var _=require(_0xf352('0xb'));var squel=require(_0xf352('0xc'));var crypto=require(_0xf352('0xd'));var jsforce=require(_0xf352('0xe'));var deskjs=require('desk.js');var toCsv=require('to-csv');var querystring=require(_0xf352('0xf'));var Papa=require(_0xf352('0x10'));var extract=require(_0xf352('0x11'));var rimraf=require(_0xf352('0x2'));var archiver=require('archiver');var Redis=require(_0xf352('0x12'));var authService=require('../../components/auth/service');var qs=require(_0xf352('0x13'));var as=require(_0xf352('0x14'));var hardwareService=require(_0xf352('0x15'));var logger=require('../../config/logger')(_0xf352('0x16'));var utils=require('../../config/utils');var config=require(_0xf352('0x17'));var db=require(_0xf352('0x18'))['db'];config['redis']=_[_0xf352('0x19')](config['redis'],{'host':_0xf352('0x1a'),'port':0x18eb});var socket=require(_0xf352('0x1b'))(new Redis(config[_0xf352('0x1c')]));require(_0xf352('0x1d'))[_0xf352('0x1e')](socket);function respondWithStatusCode(_0x46af1a,_0x4ebaf1){_0x4ebaf1=_0x4ebaf1||0xcc;return function(_0xb49744){if(_0xb49744){return _0x46af1a[_0xf352('0x1f')](_0x4ebaf1);}return _0x46af1a['status'](_0x4ebaf1)['end']();};}function respondWithResult(_0x2a14b2,_0x5b6e50){_0x5b6e50=_0x5b6e50||0xc8;return function(_0x3e201d){if(_0x3e201d){return _0x2a14b2[_0xf352('0x20')](_0x5b6e50)[_0xf352('0x21')](_0x3e201d);}};}function respondWithFilteredResult(_0x154ccf,_0x230a2d){return function(_0x46862a){if(_0x46862a){var _0x21a055=_0x46862a[_0xf352('0x22')],_0x1e1d3b=_0x230a2d[_0xf352('0x23')],_0x2c3a7e=_0x230a2d['offset']+_0x230a2d['limit'],_0x1165af;if(_0x2c3a7e>=_0x21a055){_0x2c3a7e=_0x21a055;_0x1165af=0xc8;}else{_0x1165af=0xce;}_0x154ccf[_0xf352('0x20')](_0x1165af);return _0x154ccf[_0xf352('0x24')](_0xf352('0x25'),_0x1e1d3b+'-'+_0x2c3a7e+'/'+_0x21a055)[_0xf352('0x21')](_0x46862a);}return null;};}function patchUpdates(_0x48d5e2){return function(_0x1a426e){try{jsonpatch[_0xf352('0x26')](_0x1a426e,_0x48d5e2,!![]);}catch(_0x5c2cad){return BPromise[_0xf352('0x27')](_0x5c2cad);}return _0x1a426e[_0xf352('0x28')]();};}function saveUpdates(_0x371a86,_0x3559fc){return function(_0x27a796){if(_0x27a796){return _0x27a796[_0xf352('0x29')](_0x371a86)['then'](function(_0x195be2){return _0x195be2;});}return null;};}function removeEntity(_0x2bf237,_0x70dc8a){return function(_0x1d7d3f){if(_0x1d7d3f){return _0x1d7d3f['destroy']()[_0xf352('0x2a')](function(){var _0x3412b0=_0x1d7d3f['get']({'plain':!![]});var _0x459276=_0xf352('0x2b');return db['UserProfileResource'][_0xf352('0x2c')]({'where':{'type':_0x459276,'resourceId':_0x3412b0['id']}})[_0xf352('0x2a')](function(){return _0x1d7d3f;});})[_0xf352('0x2a')](function(){_0x2bf237[_0xf352('0x20')](0xcc)[_0xf352('0x2d')]();});}};}function handleEntityNotFound(_0x47c319,_0x419de4){return function(_0x5f51ce){if(!_0x5f51ce){_0x47c319[_0xf352('0x1f')](0x194);}return _0x5f51ce;};}function handleError(_0x205694,_0x355e01){_0x355e01=_0x355e01||0x1f4;return function(_0x28a514){logger[_0xf352('0x2e')](_0x28a514['stack']);if(_0x28a514[_0xf352('0x2f')]){delete _0x28a514[_0xf352('0x2f')];}_0x205694[_0xf352('0x20')](_0x355e01)[_0xf352('0x30')](_0x28a514);};}exports['index']=function(_0x242c02,_0x4f5a33){var _0x255a39={},_0x1f98a5={},_0x3f8dc5={'count':0x0,'rows':[]};var _0x899c69=_[_0xf352('0x31')](db[_0xf352('0x32')][_0xf352('0x33')],function(_0x331eb5){return{'name':_0x331eb5['fieldName'],'type':_0x331eb5[_0xf352('0x34')][_0xf352('0x35')]};});_0x1f98a5[_0xf352('0x36')]=_[_0xf352('0x31')](_0x899c69,'name');_0x1f98a5[_0xf352('0x37')]=_[_0xf352('0x38')](_0x242c02[_0xf352('0x37')]);_0x1f98a5[_0xf352('0x39')]=_[_0xf352('0x3a')](_0x1f98a5['model'],_0x1f98a5[_0xf352('0x37')]);_0x255a39[_0xf352('0x3b')]=_[_0xf352('0x3a')](_0x1f98a5[_0xf352('0x36')],qs[_0xf352('0x3c')](_0x242c02[_0xf352('0x37')]['fields']));_0x255a39[_0xf352('0x3b')]=_0x255a39[_0xf352('0x3b')]['length']?_0x255a39[_0xf352('0x3b')]:_0x1f98a5['model'];if(!_0x242c02[_0xf352('0x37')][_0xf352('0x3d')](_0xf352('0x3e'))){_0x255a39[_0xf352('0x3f')]=qs[_0xf352('0x3f')](_0x242c02[_0xf352('0x37')][_0xf352('0x3f')]);_0x255a39['offset']=qs[_0xf352('0x23')](_0x242c02[_0xf352('0x37')][_0xf352('0x23')]);}_0x255a39[_0xf352('0x40')]=qs[_0xf352('0x41')](_0x242c02[_0xf352('0x37')][_0xf352('0x41')]);_0x255a39[_0xf352('0x42')]=qs['filters'](_[_0xf352('0x43')](_0x242c02[_0xf352('0x37')],_0x1f98a5[_0xf352('0x39')]));if(_0x242c02[_0xf352('0x37')]['filter']){_0x255a39[_0xf352('0x42')]=_['merge'](_0x255a39[_0xf352('0x42')],{'$or':_[_0xf352('0x31')](_0x899c69,function(_0x57103f){if(_0x57103f[_0xf352('0x34')]!==_0xf352('0x44')){var _0x18704a={};_0x18704a[_0x57103f['name']]={'$like':'%'+_0x242c02[_0xf352('0x37')]['filter']+'%'};return _0x18704a;}})});}_0x255a39=_[_0xf352('0x45')]({},_0x255a39,_0x242c02['options']);var _0x423eb6={'where':_0x255a39[_0xf352('0x42')]};return db[_0xf352('0x32')]['count'](_0x423eb6)[_0xf352('0x2a')](function(_0x2b2e7b){_0x3f8dc5[_0xf352('0x22')]=_0x2b2e7b;if(_0x242c02[_0xf352('0x37')][_0xf352('0x46')]){_0x255a39['include']=[{'all':!![]}];}return db[_0xf352('0x32')][_0xf352('0x47')](_0x255a39);})[_0xf352('0x2a')](function(_0x537f8b){_0x3f8dc5['rows']=_0x537f8b;return _0x3f8dc5;})[_0xf352('0x2a')](respondWithFilteredResult(_0x4f5a33,_0x255a39))[_0xf352('0x48')](handleError(_0x4f5a33,null));};exports[_0xf352('0x49')]=function(_0x4ef16f,_0xd12c59){var _0x28ef52={'raw':!![],'where':{'id':_0x4ef16f[_0xf352('0x4a')]['id']}},_0x25f302={};_0x25f302[_0xf352('0x36')]=_[_0xf352('0x38')](db[_0xf352('0x32')]['rawAttributes']);_0x25f302[_0xf352('0x37')]=_[_0xf352('0x38')](_0x4ef16f[_0xf352('0x37')]);_0x25f302[_0xf352('0x39')]=_[_0xf352('0x3a')](_0x25f302[_0xf352('0x36')],_0x25f302[_0xf352('0x37')]);_0x28ef52[_0xf352('0x3b')]=_[_0xf352('0x3a')](_0x25f302['model'],qs['fields'](_0x4ef16f[_0xf352('0x37')][_0xf352('0x3c')]));_0x28ef52[_0xf352('0x3b')]=_0x28ef52[_0xf352('0x3b')][_0xf352('0x4b')]?_0x28ef52[_0xf352('0x3b')]:_0x25f302[_0xf352('0x36')];if(_0x4ef16f[_0xf352('0x37')]['includeAll']){_0x28ef52[_0xf352('0x4c')]=[{'all':!![]}];}_0x28ef52=_[_0xf352('0x45')]({},_0x28ef52,_0x4ef16f['options']);return db[_0xf352('0x32')][_0xf352('0x4d')](_0x28ef52)[_0xf352('0x2a')](handleEntityNotFound(_0xd12c59,null))[_0xf352('0x2a')](respondWithResult(_0xd12c59,null))[_0xf352('0x48')](handleError(_0xd12c59,null));};exports[_0xf352('0x4e')]=function(_0x4e8b89,_0xd108c4,_0x317e03){return db['Plugin']['find']({'where':{'id':_0x4e8b89['params']['id']},'attributes':[_0xf352('0x2f'),'path'],'raw':!![]})['then'](handleEntityNotFound(_0xd108c4,null))[_0xf352('0x2a')](function(_0x1a6ce2){if(_0x1a6ce2){var _0x108732=path[_0xf352('0x4f')](config[_0xf352('0x50')],_0xf352('0x51'),util[_0xf352('0x52')](_0xf352('0x53'),path[_0xf352('0x54')](_0x1a6ce2[_0xf352('0x9')])));var _0x3102cb=fs[_0xf352('0x55')](_0x108732);var _0x4a1710=archiver(_0xf352('0x56'),{'zlib':{'level':0x9}});_0x4a1710['on'](_0xf352('0x57'),function(_0x29aa28){if(_0x29aa28['code']===_0xf352('0x58')){logger[_0xf352('0x2e')](_0x29aa28);}else{throw new db[(_0xf352('0x59'))][(_0xf352('0x5a'))]('Error\x20while\x20generating\x20the\x20zip\x20archive');}});_0x4a1710['on'](_0xf352('0x2e'),function(_0x398fa3){throw new db[(_0xf352('0x59'))]['Error'](_0xf352('0x5b'));});_0x4a1710[_0xf352('0x5c')](_0x3102cb);_0x4a1710[_0xf352('0x5d')]('**/*',{'cwd':path[_0xf352('0x4f')](config[_0xf352('0x50')],_0xf352('0x51'),path[_0xf352('0x5e')](_0x1a6ce2[_0xf352('0x9')])),'ignore':[path[_0xf352('0x4f')](path[_0xf352('0x54')](_0x1a6ce2['path']),'node_modules/**/*'),path[_0xf352('0x4f')](path['basename'](_0x1a6ce2['path']),'attachments/**/*')],'nodir':!![]})[_0xf352('0x5f')]();_0x3102cb['on'](_0xf352('0x60'),function(){if(!fs[_0xf352('0x61')](_0x108732)){throw new db[(_0xf352('0x59'))][(_0xf352('0x5a'))](_0xf352('0x62'));}return _0xd108c4[_0xf352('0x4e')](_0x108732,util[_0xf352('0x52')](_0xf352('0x53'),path[_0xf352('0x54')](_0x1a6ce2[_0xf352('0x9')])),function(_0x1b5d8b){if(_0x1b5d8b){throw new db[(_0xf352('0x59'))][(_0xf352('0x5a'))](_0xf352('0x63'));}fs[_0xf352('0x64')](_0x108732);logger[_0xf352('0x65')](_0xf352('0x66'));logger[_0xf352('0x65')](_0xf352('0x67'));});});}return null;})[_0xf352('0x48')](handleError(_0xd108c4,null));};exports[_0xf352('0x68')]=function(_0x3df50c,_0x25575e,_0x530646){var _0x46fab=path['basename'](_0x3df50c[_0xf352('0x69')][_0xf352('0x6a')],path[_0xf352('0x6b')](_0x3df50c[_0xf352('0x69')][_0xf352('0x6a')]));var _0x5e16e5=path['join'](config[_0xf352('0x50')],_0xf352('0x51'),_0x3df50c[_0xf352('0x69')][_0xf352('0x6a')]);var _0x43abb6=path['join'](config['root'],_0xf352('0x51'),_0x46fab);logger[_0xf352('0x65')](_0xf352('0x6c'),_0x5e16e5);logger[_0xf352('0x65')]('Plugin\x20upload\x20destination:\x20%s',_0x43abb6);try{fs[_0xf352('0x6d')](_0x5e16e5,parseInt(_0xf352('0x6e'),0x8));extract(_0x5e16e5,{'dir':_0x43abb6},function(_0x5e7047){if(_0x5e7047){logger[_0xf352('0x2e')](_0x5e7047);handleError(_0x5e7047,!![]);};var _0x487821=fs[_0xf352('0x6f')](_0x43abb6);if(_0x487821[_0xf352('0x4b')]>0x1){removeReferences(_0x5e16e5,_0x43abb6);logger['error'](_0xf352('0x70'));return _0x530646(new Error('Invalid\x20plugin\x20structure'));}var _0x27714a=fs['lstatSync'](path[_0xf352('0x4f')](_0x43abb6,_0x487821[0x0]));if(_0x27714a[_0xf352('0x71')]()){removeReferences(_0x5e16e5,_0x43abb6);logger[_0xf352('0x2e')]('Invalid\x20plugin\x20structure');return _0x530646(new Error(_0xf352('0x70')));}if(_0x27714a['isDirectory']()){var _0x1941bb=fs[_0xf352('0x6f')](path[_0xf352('0x4f')](_0x43abb6,_0x487821[0x0]));if(_0x1941bb[_0xf352('0x4b')]===0x0){removeReferences(_0x5e16e5,_0x43abb6);logger[_0xf352('0x2e')](_0xf352('0x70'));return _0x530646(new Error(_0xf352('0x70')));}var _0x451e03=_0x1941bb[_0xf352('0x72')](function(_0x443ab2){return _0x443ab2===_0xf352('0x73');});if(!_0x451e03){return _0x530646(new Error(_0xf352('0x74')));}var _0x145d95=fs['readFileSync'](path[_0xf352('0x4f')](_0x43abb6,_0x487821[0x0],_0xf352('0x73')));var _0x34f9f3=JSON[_0xf352('0x75')](_0x145d95);if(_0xf352('0x76')==typeof _0x34f9f3[_0xf352('0x2f')]){return _0x530646(new Error(_0xf352('0x77')));}if(_0xf352('0x76')==typeof _0x34f9f3['type']){return _0x530646(new Error(_0xf352('0x78')));}if(_0xf352('0x76')==typeof _0x34f9f3['version']){return _0x530646(new Error(_0xf352('0x79')));}if('undefined'==typeof _0x34f9f3['parameters']){return _0x530646(new Error(_0xf352('0x7a')));}if(_0x34f9f3[_0xf352('0x34')]===_0xf352('0x7b')){if(_0xf352('0x76')==typeof _0x34f9f3[_0xf352('0x7c')][_0xf352('0x7d')]){return _0x530646(new Error('Invalid\x20manifest:\x20views\x20missing'));}if(_0xf352('0x76')==typeof _0x34f9f3[_0xf352('0x7c')][_0xf352('0x7d')][_0xf352('0x7e')]&&_0xf352('0x76')==typeof _0x34f9f3[_0xf352('0x7c')][_0xf352('0x7d')][_0xf352('0x7f')]){return _0x530646(new Error(_0xf352('0x80')));}}else if(_0x34f9f3[_0xf352('0x34')]===_0xf352('0x81')){if('undefined'==typeof _0x34f9f3[_0xf352('0x7c')][_0xf352('0x82')]){return _0x530646(new Error(_0xf352('0x83')));}if(_0xf352('0x76')==typeof _0x34f9f3[_0xf352('0x7c')]['scriptPath']){return _0x530646(new Error(_0xf352('0x84')));}}else{return _0x530646(new Error(_0xf352('0x85')));}var _0x59ec12=_0x34f9f3['name'];var _0x14ffe4=_0x34f9f3[_0xf352('0x86')];var _0xcf789e=_0x34f9f3[_0xf352('0x34')];var _0x2dd13c=_0x34f9f3[_0xf352('0x87')]?_0x34f9f3[_0xf352('0x87')]:_0xf352('0x88');var _0x5967db=_0x34f9f3['icon']?_0x34f9f3[_0xf352('0x89')]:_0xf352('0x8a');var _0x1f6d02='';var _0x264a63='';var _0x49d906='';var _0x315569='';var _0x178b58=_0x34f9f3[_0xf352('0x8b')];if(_0xcf789e===_0xf352('0x7b')){if(_0xf352('0x76')!=typeof _0x34f9f3[_0xf352('0x7c')][_0xf352('0x7d')][_0xf352('0x7e')]){var _0x448aba=_0x34f9f3[_0xf352('0x7c')][_0xf352('0x7d')][_0xf352('0x7e')];if(!/^(f|ht)tps?:\/\//i[_0xf352('0x8c')](_0x448aba)){_0x1f6d02=path['join'](_0xf352('0x8d'),_0x46fab,_0x487821[0x0],_0x448aba);}else{_0x1f6d02=_0x448aba;}}else{logger['info']('Warning:\x20admin\x20view\x20not\x20specified');}if(_0xf352('0x76')!=typeof _0x34f9f3[_0xf352('0x7c')][_0xf352('0x7d')]['agent']){var _0x2c063d=_0x34f9f3[_0xf352('0x7c')][_0xf352('0x7d')][_0xf352('0x7f')];if(!/^(f|ht)tps?:\/\//i[_0xf352('0x8c')](_0x2c063d)){_0x264a63=path['join'](_0xf352('0x8d'),_0x46fab,_0x487821[0x0],_0x2c063d);}else{_0x264a63=_0x2c063d;}}else{logger['info'](_0xf352('0x8e'));}}else if(_0xcf789e===_0xf352('0x81')){_0x49d906=_0x34f9f3[_0xf352('0x7c')]['scriptName'];_0x315569=_0x34f9f3[_0xf352('0x7c')][_0xf352('0x8f')];if(_0xf352('0x76')!=typeof _0x34f9f3[_0xf352('0x7c')]['views']){if(_0xf352('0x76')!=typeof _0x34f9f3[_0xf352('0x7c')][_0xf352('0x7d')][_0xf352('0x7e')]){var _0x448aba=_0x34f9f3[_0xf352('0x7c')][_0xf352('0x7d')][_0xf352('0x7e')];if(!/^(f|ht)tps?:\/\//i['test'](_0x448aba)){_0x1f6d02=path[_0xf352('0x4f')](_0xf352('0x8d'),_0x46fab,_0x487821[0x0],_0x448aba);}else{_0x1f6d02=_0x448aba;}}if(_0xf352('0x76')!=typeof _0x34f9f3[_0xf352('0x7c')][_0xf352('0x7d')][_0xf352('0x7f')]){var _0x2c063d=_0x34f9f3[_0xf352('0x7c')][_0xf352('0x7d')]['agent'];if(!/^(f|ht)tps?:\/\//i[_0xf352('0x8c')](_0x2c063d)){_0x264a63=path[_0xf352('0x4f')]('plugins',_0x46fab,_0x487821[0x0],_0x2c063d);}else{_0x264a63=_0x2c063d;}}}}var _0x501543={'name':_0x59ec12,'description':_0x14ffe4,'path':path[_0xf352('0x4f')](_0x46fab,_0x487821[0x0]),'type':_0xcf789e,'sidebar':_0x2dd13c,'icon':_0x5967db,'adminUrl':_0x1f6d02,'agentUrl':_0x264a63,'scriptName':_0x49d906,'scriptPath':_0x315569,'version':_0x178b58};removeReferences(_0x5e16e5,null);return db[_0xf352('0x32')][_0xf352('0x90')](_0x501543)['then'](function(_0x33f19b){var _0x507d3d={'role':_0x3df50c[_0xf352('0x91')][_0xf352('0x92')],'userProfileId':_0x3df50c[_0xf352('0x91')][_0xf352('0x93')]};if(!_0x507d3d)throw new Error(_0xf352('0x94'));if(_0x507d3d[_0xf352('0x92')]===_0xf352('0x95')){var _0x82d783=_0x33f19b[_0xf352('0x96')]({'plain':!![]});return db['UserProfileSection'][_0xf352('0x4d')]({'where':{'name':_0xf352('0x2b'),'userProfileId':_0x507d3d[_0xf352('0x93')]},'raw':!![]})[_0xf352('0x2a')](function(_0x1fd592){if(_0x1fd592&&_0x1fd592[_0xf352('0x97')]===0x0){return db[_0xf352('0x98')][_0xf352('0x90')]({'name':_0x82d783[_0xf352('0x2f')],'resourceId':_0x82d783['id'],'type':_0x1fd592['name'],'sectionId':_0x1fd592['id']},{})[_0xf352('0x2a')](function(){return _0x33f19b;});}else{return _0x33f19b;}})['catch'](function(_0x5fd3d7){logger[_0xf352('0x2e')](_0xf352('0x99'),_0x5fd3d7);throw _0x5fd3d7;});}return _0x33f19b;})['then'](respondWithResult(_0x25575e,null))['catch'](handleError(_0x25575e,null));}});}catch(_0x2eab45){_0x25575e['status'](0x1f4)[_0xf352('0x30')](_0x2eab45);}};function removeReferences(_0x46541f,_0xf0fd62){try{if(_0x46541f){fs[_0xf352('0x64')](_0x46541f);logger['info'](_0xf352('0x9a'));}if(_0xf0fd62){rimraf(_0xf0fd62,function(){});logger['info'](_0xf352('0x9b'));}}catch(_0x49b4fc){logger[_0xf352('0x2e')](_0x49b4fc);}}exports[_0xf352('0x29')]=function(_0x45a539,_0x4f8a99,_0x50ca48){return db[_0xf352('0x32')][_0xf352('0x4d')]({'where':{'id':_0x45a539[_0xf352('0x4a')]['id']}})[_0xf352('0x2a')](handleEntityNotFound(_0x4f8a99,null))[_0xf352('0x2a')](saveUpdates(_0x45a539[_0xf352('0x91')],null))[_0xf352('0x2a')](respondWithResult(_0x4f8a99,null))[_0xf352('0x48')](handleError(_0x4f8a99,null));};exports[_0xf352('0x9c')]=function(_0xed04f0,_0xc7ece6,_0x31cb94){return db[_0xf352('0x32')]['find']({'where':{'id':_0xed04f0[_0xf352('0x4a')]['id']}})['then'](function(_0x58372b){if(_0x58372b){return _0x58372b['destroy']();}})[_0xf352('0x2a')](function(_0x3294aa){rimraf(path[_0xf352('0x4f')](config['root'],_0xf352('0x51'),path['dirname'](_0x3294aa[_0xf352('0x9')])),function(){});return _0x3294aa;})[_0xf352('0x2a')](handleEntityNotFound(_0xc7ece6,null))[_0xf352('0x2a')](respondWithStatusCode(_0xc7ece6,null))[_0xf352('0x48')](handleError(_0xc7ece6,null));};exports[_0xf352('0x9d')]=function(_0x40dadf,_0x1b84d8,_0x584b1d){return BPromise[_0xf352('0x9e')]()[_0xf352('0x2a')](function(){if(!_0x40dadf[_0xf352('0x37')][_0xf352('0x9')]){throw new Error('\x27PATH\x27\x20parameter\x20not\x20specified');}if(!_0x40dadf[_0xf352('0x37')]['port']){throw new Error('\x27PORT\x27\x20parameter\x20not\x20specified');}var _0x2a8674=_0x40dadf[_0xf352('0x37')]['hostname']?_0x40dadf[_0xf352('0x37')][_0xf352('0x9f')]+':'+_0x40dadf['query'][_0xf352('0xa0')]:'http://localhost:'+_0x40dadf[_0xf352('0x37')][_0xf352('0xa0')];var _0x1b3d23=_0x40dadf[_0xf352('0x37')][_0xf352('0x21')]?_0x40dadf[_0xf352('0x37')][_0xf352('0x21')]:!![];var _0x4f7bdd=_0x40dadf[_0xf352('0x37')]['encoding']?_0x40dadf[_0xf352('0x37')][_0xf352('0xa1')]:null;var _0xaceeae={'method':_0x40dadf[_0xf352('0xa2')],'uri':util[_0xf352('0x52')](_0xf352('0xa3'),_0x2a8674,_0x40dadf[_0xf352('0x37')][_0xf352('0x9')]),'json':_0x1b3d23,'resolveWithFullResponse':!![],'encoding':_0x4f7bdd,'qs':_0x40dadf[_0xf352('0x37')]};if(_0x40dadf[_0xf352('0xa4')]){_0xaceeae[_0xf352('0xa4')]=_0x40dadf['headers'];if(_0xaceeae['headers'][_0xf352('0xa5')]){delete _0xaceeae[_0xf352('0xa4')][_0xf352('0xa5')];}}if(_0xaceeae[_0xf352('0xa4')][_0xf352('0xa6')]){delete _0xaceeae[_0xf352('0xa4')][_0xf352('0xa6')];}return rp(_0xaceeae);})[_0xf352('0x2a')](function(_0x99a435){if(_0x99a435){_0x1b84d8[_0xf352('0x24')](_0x99a435['headers']);logger[_0xf352('0x65')](_0x99a435['body']);if(_[_0xf352('0xa7')](_0x40dadf[_0xf352('0x37')]['path'],_0xf352('0x4e'))&&_0x99a435['statusCode']==0x1f4){return _0x1b84d8['sendStatus'](_0x99a435[_0xf352('0xa8')]);}else{return _0x1b84d8[_0xf352('0x20')](_0x99a435[_0xf352('0xa8')])[_0xf352('0x30')](_0x99a435[_0xf352('0x91')]);}}else{return _0x1b84d8['sendStatus'](0xc8);}})[_0xf352('0x48')](handleError(_0x1b84d8,null));};exports[_0xf352('0xa9')]=function(_0x4a38bc,_0x4f6733,_0x57c8e4){return BPromise[_0xf352('0x9e')]()[_0xf352('0x2a')](function(){if(!_0x4a38bc[_0xf352('0x37')][_0xf352('0x9')]){throw new Error('\x27PATH\x27\x20parameter\x20not\x20specified');}if(!_0x4a38bc['query'][_0xf352('0xa0')]){throw new Error(_0xf352('0xaa'));}var _0x4f6807=_0x4a38bc[_0xf352('0x37')][_0xf352('0x9f')]?_0x4a38bc[_0xf352('0x37')][_0xf352('0x9f')]+':'+_0x4a38bc[_0xf352('0x37')][_0xf352('0xa0')]:'http://localhost:'+_0x4a38bc['query'][_0xf352('0xa0')];var _0x39712f=_0x4a38bc[_0xf352('0x37')][_0xf352('0x21')]?_0x4a38bc[_0xf352('0x37')][_0xf352('0x21')]:!![];var _0x5eba18=_0x4a38bc[_0xf352('0x37')][_0xf352('0xa1')]?_0x4a38bc[_0xf352('0x37')][_0xf352('0xa1')]:null;var _0x4669ef={'method':_0x4a38bc[_0xf352('0xa2')],'uri':util['format']('%s%s',_0x4f6807,_0x4a38bc[_0xf352('0x37')][_0xf352('0x9')]),'json':_0x39712f,'resolveWithFullResponse':!![],'encoding':_0x5eba18,'body':_0x4a38bc[_0xf352('0x91')]};if(_0x4a38bc[_0xf352('0xa4')]){_0x4669ef[_0xf352('0xa4')]=_0x4a38bc[_0xf352('0xa4')];if(_0x4669ef[_0xf352('0xa4')][_0xf352('0xa5')]){delete _0x4669ef['headers'][_0xf352('0xa5')];}}if(_0x4669ef[_0xf352('0xa4')][_0xf352('0xa6')]){delete _0x4669ef[_0xf352('0xa4')][_0xf352('0xa6')];}return rp(_0x4669ef);})[_0xf352('0x2a')](function(_0x149508){if(_0x149508){_0x4f6733[_0xf352('0x24')](_0x149508['headers']);logger[_0xf352('0x65')](_0x149508[_0xf352('0x91')]);return _0x4f6733[_0xf352('0x20')](_0x149508[_0xf352('0xa8')])[_0xf352('0x30')](_0x149508[_0xf352('0x91')]);}else{return _0x4f6733[_0xf352('0x1f')](0xc8);}})[_0xf352('0x48')](handleError(_0x4f6733,null));};
\ No newline at end of file
+var _0xaddd=['script','scriptName','Invalid\x20manifest:\x20script\x20name\x20missing','scriptPath','Invalid\x20manifest:\x20script\x20path\x20missing','Invalid\x20manifest:\x20invalid\x20type','description','sidebar','icon','html','admin','test','Warning:\x20admin\x20view\x20not\x20specified','plugins','Warning:\x20agent\x20view\x20not\x20specified','create','role','body','Unable\x20to\x20retrieve\x20the\x20current\x20user','UserProfileSection','userProfileId','autoAssociation','UserProfileResource','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','unlinkSync','Extracted\x20folder\x20removed','delete','webhookGet','resolve','\x27PATH\x27\x20parameter\x20not\x20specified','port','\x27PORT\x27\x20parameter\x20not\x20specified','hostname','http://localhost:','encoding','method','%s%s','headers','content-length','content-type','set','endsWith','statusCode','webhookPost','html-pdf','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','moment','bluebird','mustache','path','to-csv','lodash','squel','jsforce','desk.js','papaparse','extract-zip','archiver','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/environment','../../mysqldb','defaults','localhost','./plugin.socket','register','sendStatus','status','count','offset','Content-Range','json','reject','update','then','destroy','get','Plugins','end','error','stack','name','send','index','map','rawAttributes','fieldName','key','model','keys','query','intersection','attributes','fields','length','hasOwnProperty','nolimit','limit','sort','filters','pick','filter','merge','where','type','VIRTUAL','options','includeAll','include','Plugin','findAll','rows','show','params','find','catch','download','join','server/files/plugins','format','%s.zip','basename','createWriteStream','warning','code','ENOENT','Sequelize','Error','Error\x20while\x20generating\x20the\x20zip\x20archive','pipe','glob','dirname','node_modules/**/*','attachments/**/*','finalize','existsSync','Error\x20while\x20downloading\x20the\x20plugin','info','Download\x20completed','Temporary\x20file\x20removed','upload','file','filename','extname','root','Plugin\x20upload\x20filepath:\x20%s','Plugin\x20upload\x20destination:\x20%s','chmodSync','0777','readdirSync','Invalid\x20plugin\x20structure','isDirectory','some','manifest.json','Plugin\x20manifest\x20missing','readFileSync','parse','undefined','Invalid\x20manifest:\x20name\x20missing','Invalid\x20manifest:\x20type\x20missing','version','Invalid\x20manifest:\x20version\x20not\x20specified','parameters','views','Invalid\x20manifest:\x20views\x20missing','agent','Invalid\x20manifest:\x20no\x20view\x20specified'];(function(_0x4fa291,_0x56e289){var _0x506d9b=function(_0x24c31f){while(--_0x24c31f){_0x4fa291['push'](_0x4fa291['shift']());}};_0x506d9b(++_0x56e289);}(_0xaddd,0x18e));var _0xdadd=function(_0x5b311b,_0x3e0280){_0x5b311b=_0x5b311b-0x0;var _0x4fa0de=_0xaddd[_0x5b311b];return _0x4fa0de;};'use strict';var pdf=require(_0xdadd('0x0'));var emlformat=require(_0xdadd('0x1'));var rimraf=require(_0xdadd('0x2'));var zipdir=require(_0xdadd('0x3'));var jsonpatch=require(_0xdadd('0x4'));var rp=require(_0xdadd('0x5'));var moment=require(_0xdadd('0x6'));var BPromise=require(_0xdadd('0x7'));var Mustache=require(_0xdadd('0x8'));var util=require('util');var path=require(_0xdadd('0x9'));var sox=require('sox');var csv=require(_0xdadd('0xa'));var ejs=require('ejs');var fs=require('fs');var _=require(_0xdadd('0xb'));var squel=require(_0xdadd('0xc'));var crypto=require('crypto');var jsforce=require(_0xdadd('0xd'));var deskjs=require(_0xdadd('0xe'));var toCsv=require('to-csv');var querystring=require('querystring');var Papa=require(_0xdadd('0xf'));var extract=require(_0xdadd('0x10'));var rimraf=require(_0xdadd('0x2'));var archiver=require(_0xdadd('0x11'));var Redis=require(_0xdadd('0x12'));var authService=require(_0xdadd('0x13'));var qs=require(_0xdadd('0x14'));var as=require(_0xdadd('0x15'));var hardwareService=require(_0xdadd('0x16'));var logger=require(_0xdadd('0x17'))(_0xdadd('0x18'));var utils=require(_0xdadd('0x19'));var config=require(_0xdadd('0x1a'));var db=require(_0xdadd('0x1b'))['db'];config['redis']=_[_0xdadd('0x1c')](config['redis'],{'host':_0xdadd('0x1d'),'port':0x18eb});var socket=require('socket.io-emitter')(new Redis(config['redis']));require(_0xdadd('0x1e'))[_0xdadd('0x1f')](socket);function respondWithStatusCode(_0x3855a6,_0x55fce5){_0x55fce5=_0x55fce5||0xcc;return function(_0x5536bf){if(_0x5536bf){return _0x3855a6[_0xdadd('0x20')](_0x55fce5);}return _0x3855a6[_0xdadd('0x21')](_0x55fce5)['end']();};}function respondWithResult(_0x236e6d,_0x5f0aeb){_0x5f0aeb=_0x5f0aeb||0xc8;return function(_0x153658){if(_0x153658){return _0x236e6d[_0xdadd('0x21')](_0x5f0aeb)['json'](_0x153658);}};}function respondWithFilteredResult(_0x1560db,_0x51c859){return function(_0x5efb05){if(_0x5efb05){var _0x4169ed=_0x5efb05[_0xdadd('0x22')],_0x5c9edf=_0x51c859[_0xdadd('0x23')],_0x3aa5c3=_0x51c859['offset']+_0x51c859['limit'],_0x322415;if(_0x3aa5c3>=_0x4169ed){_0x3aa5c3=_0x4169ed;_0x322415=0xc8;}else{_0x322415=0xce;}_0x1560db[_0xdadd('0x21')](_0x322415);return _0x1560db['set'](_0xdadd('0x24'),_0x5c9edf+'-'+_0x3aa5c3+'/'+_0x4169ed)[_0xdadd('0x25')](_0x5efb05);}return null;};}function patchUpdates(_0x2aa502){return function(_0x31c9b3){try{jsonpatch['apply'](_0x31c9b3,_0x2aa502,!![]);}catch(_0x23e551){return BPromise[_0xdadd('0x26')](_0x23e551);}return _0x31c9b3['save']();};}function saveUpdates(_0x54a18f,_0x53df88){return function(_0x5aa83f){if(_0x5aa83f){return _0x5aa83f[_0xdadd('0x27')](_0x54a18f)[_0xdadd('0x28')](function(_0x551903){return _0x551903;});}return null;};}function removeEntity(_0x48646d,_0xf72908){return function(_0x11cc9d){if(_0x11cc9d){return _0x11cc9d[_0xdadd('0x29')]()[_0xdadd('0x28')](function(){var _0x29aa89=_0x11cc9d[_0xdadd('0x2a')]({'plain':!![]});var _0x86969b=_0xdadd('0x2b');return db['UserProfileResource'][_0xdadd('0x29')]({'where':{'type':_0x86969b,'resourceId':_0x29aa89['id']}})[_0xdadd('0x28')](function(){return _0x11cc9d;});})[_0xdadd('0x28')](function(){_0x48646d[_0xdadd('0x21')](0xcc)[_0xdadd('0x2c')]();});}};}function handleEntityNotFound(_0x3b39db,_0x2b9eff){return function(_0x2587f7){if(!_0x2587f7){_0x3b39db[_0xdadd('0x20')](0x194);}return _0x2587f7;};}function handleError(_0xe356fb,_0x3d9851){_0x3d9851=_0x3d9851||0x1f4;return function(_0x402e14){logger[_0xdadd('0x2d')](_0x402e14[_0xdadd('0x2e')]);if(_0x402e14[_0xdadd('0x2f')]){delete _0x402e14[_0xdadd('0x2f')];}_0xe356fb[_0xdadd('0x21')](_0x3d9851)[_0xdadd('0x30')](_0x402e14);};}exports[_0xdadd('0x31')]=function(_0x1e487f,_0xdeb687){var _0x1e4cd8={},_0xacc800={},_0x4bc9ed={'count':0x0,'rows':[]};var _0x23b945=_[_0xdadd('0x32')](db['Plugin'][_0xdadd('0x33')],function(_0x116754){return{'name':_0x116754[_0xdadd('0x34')],'type':_0x116754['type'][_0xdadd('0x35')]};});_0xacc800[_0xdadd('0x36')]=_['map'](_0x23b945,_0xdadd('0x2f'));_0xacc800['query']=_[_0xdadd('0x37')](_0x1e487f[_0xdadd('0x38')]);_0xacc800['filters']=_[_0xdadd('0x39')](_0xacc800[_0xdadd('0x36')],_0xacc800[_0xdadd('0x38')]);_0x1e4cd8[_0xdadd('0x3a')]=_['intersection'](_0xacc800[_0xdadd('0x36')],qs['fields'](_0x1e487f[_0xdadd('0x38')][_0xdadd('0x3b')]));_0x1e4cd8[_0xdadd('0x3a')]=_0x1e4cd8[_0xdadd('0x3a')][_0xdadd('0x3c')]?_0x1e4cd8[_0xdadd('0x3a')]:_0xacc800[_0xdadd('0x36')];if(!_0x1e487f[_0xdadd('0x38')][_0xdadd('0x3d')](_0xdadd('0x3e'))){_0x1e4cd8[_0xdadd('0x3f')]=qs[_0xdadd('0x3f')](_0x1e487f[_0xdadd('0x38')][_0xdadd('0x3f')]);_0x1e4cd8[_0xdadd('0x23')]=qs[_0xdadd('0x23')](_0x1e487f['query']['offset']);}_0x1e4cd8['order']=qs[_0xdadd('0x40')](_0x1e487f[_0xdadd('0x38')][_0xdadd('0x40')]);_0x1e4cd8['where']=qs[_0xdadd('0x41')](_[_0xdadd('0x42')](_0x1e487f[_0xdadd('0x38')],_0xacc800['filters']));if(_0x1e487f[_0xdadd('0x38')][_0xdadd('0x43')]){_0x1e4cd8['where']=_[_0xdadd('0x44')](_0x1e4cd8[_0xdadd('0x45')],{'$or':_[_0xdadd('0x32')](_0x23b945,function(_0x3aef49){if(_0x3aef49[_0xdadd('0x46')]!==_0xdadd('0x47')){var _0x6af547={};_0x6af547[_0x3aef49[_0xdadd('0x2f')]]={'$like':'%'+_0x1e487f[_0xdadd('0x38')][_0xdadd('0x43')]+'%'};return _0x6af547;}})});}_0x1e4cd8=_[_0xdadd('0x44')]({},_0x1e4cd8,_0x1e487f[_0xdadd('0x48')]);var _0x36b01d={'where':_0x1e4cd8['where']};return db['Plugin']['count'](_0x36b01d)['then'](function(_0x5c0a21){_0x4bc9ed[_0xdadd('0x22')]=_0x5c0a21;if(_0x1e487f[_0xdadd('0x38')][_0xdadd('0x49')]){_0x1e4cd8[_0xdadd('0x4a')]=[{'all':!![]}];}return db[_0xdadd('0x4b')][_0xdadd('0x4c')](_0x1e4cd8);})[_0xdadd('0x28')](function(_0x167686){_0x4bc9ed[_0xdadd('0x4d')]=_0x167686;return _0x4bc9ed;})['then'](respondWithFilteredResult(_0xdeb687,_0x1e4cd8))['catch'](handleError(_0xdeb687,null));};exports[_0xdadd('0x4e')]=function(_0x2dc3fa,_0x4924a5){var _0x2cbd64={'raw':!![],'where':{'id':_0x2dc3fa[_0xdadd('0x4f')]['id']}},_0x5bbcd6={};_0x5bbcd6[_0xdadd('0x36')]=_[_0xdadd('0x37')](db['Plugin'][_0xdadd('0x33')]);_0x5bbcd6[_0xdadd('0x38')]=_[_0xdadd('0x37')](_0x2dc3fa['query']);_0x5bbcd6[_0xdadd('0x41')]=_[_0xdadd('0x39')](_0x5bbcd6['model'],_0x5bbcd6[_0xdadd('0x38')]);_0x2cbd64[_0xdadd('0x3a')]=_['intersection'](_0x5bbcd6[_0xdadd('0x36')],qs[_0xdadd('0x3b')](_0x2dc3fa[_0xdadd('0x38')][_0xdadd('0x3b')]));_0x2cbd64[_0xdadd('0x3a')]=_0x2cbd64[_0xdadd('0x3a')][_0xdadd('0x3c')]?_0x2cbd64[_0xdadd('0x3a')]:_0x5bbcd6[_0xdadd('0x36')];if(_0x2dc3fa[_0xdadd('0x38')][_0xdadd('0x49')]){_0x2cbd64[_0xdadd('0x4a')]=[{'all':!![]}];}_0x2cbd64=_[_0xdadd('0x44')]({},_0x2cbd64,_0x2dc3fa[_0xdadd('0x48')]);return db['Plugin'][_0xdadd('0x50')](_0x2cbd64)['then'](handleEntityNotFound(_0x4924a5,null))[_0xdadd('0x28')](respondWithResult(_0x4924a5,null))[_0xdadd('0x51')](handleError(_0x4924a5,null));};exports[_0xdadd('0x52')]=function(_0x12e122,_0xd53634,_0x4e8be6){return db['Plugin'][_0xdadd('0x50')]({'where':{'id':_0x12e122[_0xdadd('0x4f')]['id']},'attributes':[_0xdadd('0x2f'),_0xdadd('0x9')],'raw':!![]})[_0xdadd('0x28')](handleEntityNotFound(_0xd53634,null))[_0xdadd('0x28')](function(_0x2216b6){if(_0x2216b6){var _0x21aad7=path[_0xdadd('0x53')](config['root'],_0xdadd('0x54'),util[_0xdadd('0x55')](_0xdadd('0x56'),path[_0xdadd('0x57')](_0x2216b6['path'])));var _0x4d1be6=fs[_0xdadd('0x58')](_0x21aad7);var _0x5593a0=archiver('zip',{'zlib':{'level':0x9}});_0x5593a0['on'](_0xdadd('0x59'),function(_0x49cece){if(_0x49cece[_0xdadd('0x5a')]===_0xdadd('0x5b')){logger[_0xdadd('0x2d')](_0x49cece);}else{throw new db[(_0xdadd('0x5c'))][(_0xdadd('0x5d'))](_0xdadd('0x5e'));}});_0x5593a0['on'](_0xdadd('0x2d'),function(_0xe68082){throw new db[(_0xdadd('0x5c'))][(_0xdadd('0x5d'))](_0xdadd('0x5e'));});_0x5593a0[_0xdadd('0x5f')](_0x4d1be6);_0x5593a0[_0xdadd('0x60')]('**/*',{'cwd':path['join'](config['root'],_0xdadd('0x54'),path[_0xdadd('0x61')](_0x2216b6[_0xdadd('0x9')])),'ignore':[path[_0xdadd('0x53')](path['basename'](_0x2216b6[_0xdadd('0x9')]),_0xdadd('0x62')),path['join'](path[_0xdadd('0x57')](_0x2216b6[_0xdadd('0x9')]),_0xdadd('0x63'))],'nodir':!![]})[_0xdadd('0x64')]();_0x4d1be6['on']('close',function(){if(!fs[_0xdadd('0x65')](_0x21aad7)){throw new db[(_0xdadd('0x5c'))][(_0xdadd('0x5d'))]('Plugin\x20not\x20found');}return _0xd53634['download'](_0x21aad7,util[_0xdadd('0x55')](_0xdadd('0x56'),path[_0xdadd('0x57')](_0x2216b6[_0xdadd('0x9')])),function(_0x435f9b){if(_0x435f9b){throw new db[(_0xdadd('0x5c'))][(_0xdadd('0x5d'))](_0xdadd('0x66'));}fs['unlinkSync'](_0x21aad7);logger[_0xdadd('0x67')](_0xdadd('0x68'));logger[_0xdadd('0x67')](_0xdadd('0x69'));});});}return null;})[_0xdadd('0x51')](handleError(_0xd53634,null));};exports[_0xdadd('0x6a')]=function(_0x2a65cb,_0x1ab718,_0x428dcc){var _0x3419bd=path['basename'](_0x2a65cb[_0xdadd('0x6b')][_0xdadd('0x6c')],path[_0xdadd('0x6d')](_0x2a65cb['file'][_0xdadd('0x6c')]));var _0x4be906=path['join'](config[_0xdadd('0x6e')],_0xdadd('0x54'),_0x2a65cb[_0xdadd('0x6b')][_0xdadd('0x6c')]);var _0x202eaf=path[_0xdadd('0x53')](config[_0xdadd('0x6e')],_0xdadd('0x54'),_0x3419bd);logger[_0xdadd('0x67')](_0xdadd('0x6f'),_0x4be906);logger[_0xdadd('0x67')](_0xdadd('0x70'),_0x202eaf);try{fs[_0xdadd('0x71')](_0x4be906,parseInt(_0xdadd('0x72'),0x8));extract(_0x4be906,{'dir':_0x202eaf},function(_0xa68e30){if(_0xa68e30){logger[_0xdadd('0x2d')](_0xa68e30);handleError(_0xa68e30,!![]);};var _0x54fee0=fs[_0xdadd('0x73')](_0x202eaf);if(_0x54fee0[_0xdadd('0x3c')]>0x1){removeReferences(_0x4be906,_0x202eaf);logger['error']('Invalid\x20plugin\x20structure');return _0x428dcc(new Error(_0xdadd('0x74')));}var _0x3806a5=fs['lstatSync'](path['join'](_0x202eaf,_0x54fee0[0x0]));if(_0x3806a5['isFile']()){removeReferences(_0x4be906,_0x202eaf);logger[_0xdadd('0x2d')]('Invalid\x20plugin\x20structure');return _0x428dcc(new Error(_0xdadd('0x74')));}if(_0x3806a5[_0xdadd('0x75')]()){var _0x145394=fs[_0xdadd('0x73')](path[_0xdadd('0x53')](_0x202eaf,_0x54fee0[0x0]));if(_0x145394[_0xdadd('0x3c')]===0x0){removeReferences(_0x4be906,_0x202eaf);logger[_0xdadd('0x2d')]('Invalid\x20plugin\x20structure');return _0x428dcc(new Error('Invalid\x20plugin\x20structure'));}var _0x11d4de=_0x145394[_0xdadd('0x76')](function(_0x3dc8e6){return _0x3dc8e6===_0xdadd('0x77');});if(!_0x11d4de){return _0x428dcc(new Error(_0xdadd('0x78')));}var _0x325bb1=fs[_0xdadd('0x79')](path['join'](_0x202eaf,_0x54fee0[0x0],_0xdadd('0x77')));var _0x165635=JSON[_0xdadd('0x7a')](_0x325bb1);if(_0xdadd('0x7b')==typeof _0x165635['name']){return _0x428dcc(new Error(_0xdadd('0x7c')));}if('undefined'==typeof _0x165635[_0xdadd('0x46')]){return _0x428dcc(new Error(_0xdadd('0x7d')));}if(_0xdadd('0x7b')==typeof _0x165635[_0xdadd('0x7e')]){return _0x428dcc(new Error(_0xdadd('0x7f')));}if('undefined'==typeof _0x165635[_0xdadd('0x80')]){return _0x428dcc(new Error('Invalid\x20manifest:\x20parameters\x20missing'));}if(_0x165635[_0xdadd('0x46')]==='html'){if('undefined'==typeof _0x165635[_0xdadd('0x80')][_0xdadd('0x81')]){return _0x428dcc(new Error(_0xdadd('0x82')));}if(_0xdadd('0x7b')==typeof _0x165635['parameters']['views']['admin']&&'undefined'==typeof _0x165635[_0xdadd('0x80')][_0xdadd('0x81')][_0xdadd('0x83')]){return _0x428dcc(new Error(_0xdadd('0x84')));}}else if(_0x165635[_0xdadd('0x46')]===_0xdadd('0x85')){if('undefined'==typeof _0x165635[_0xdadd('0x80')][_0xdadd('0x86')]){return _0x428dcc(new Error(_0xdadd('0x87')));}if('undefined'==typeof _0x165635[_0xdadd('0x80')][_0xdadd('0x88')]){return _0x428dcc(new Error(_0xdadd('0x89')));}}else{return _0x428dcc(new Error(_0xdadd('0x8a')));}var _0x40735c=_0x165635[_0xdadd('0x2f')];var _0x489767=_0x165635[_0xdadd('0x8b')];var _0x350c96=_0x165635['type'];var _0x2425c7=_0x165635[_0xdadd('0x8c')]?_0x165635[_0xdadd('0x8c')]:'always';var _0x237050=_0x165635['icon']?_0x165635[_0xdadd('0x8d')]:'icon-apps';var _0x9c9efa='';var _0x491227='';var _0x230e22='';var _0x1477a6='';var _0x4ac079=_0x165635[_0xdadd('0x7e')];if(_0x350c96===_0xdadd('0x8e')){if(_0xdadd('0x7b')!=typeof _0x165635['parameters'][_0xdadd('0x81')][_0xdadd('0x8f')]){var _0x2a642b=_0x165635['parameters']['views']['admin'];if(!/^(f|ht)tps?:\/\//i[_0xdadd('0x90')](_0x2a642b)){_0x9c9efa=path['join']('plugins',_0x3419bd,_0x54fee0[0x0],_0x2a642b);}else{_0x9c9efa=_0x2a642b;}}else{logger[_0xdadd('0x67')](_0xdadd('0x91'));}if(_0xdadd('0x7b')!=typeof _0x165635[_0xdadd('0x80')][_0xdadd('0x81')][_0xdadd('0x83')]){var _0x4bba5f=_0x165635[_0xdadd('0x80')][_0xdadd('0x81')][_0xdadd('0x83')];if(!/^(f|ht)tps?:\/\//i[_0xdadd('0x90')](_0x4bba5f)){_0x491227=path[_0xdadd('0x53')](_0xdadd('0x92'),_0x3419bd,_0x54fee0[0x0],_0x4bba5f);}else{_0x491227=_0x4bba5f;}}else{logger[_0xdadd('0x67')](_0xdadd('0x93'));}}else if(_0x350c96===_0xdadd('0x85')){_0x230e22=_0x165635['parameters']['scriptName'];_0x1477a6=_0x165635[_0xdadd('0x80')][_0xdadd('0x88')];if('undefined'!=typeof _0x165635[_0xdadd('0x80')][_0xdadd('0x81')]){if(_0xdadd('0x7b')!=typeof _0x165635[_0xdadd('0x80')][_0xdadd('0x81')][_0xdadd('0x8f')]){var _0x2a642b=_0x165635[_0xdadd('0x80')][_0xdadd('0x81')][_0xdadd('0x8f')];if(!/^(f|ht)tps?:\/\//i['test'](_0x2a642b)){_0x9c9efa=path[_0xdadd('0x53')](_0xdadd('0x92'),_0x3419bd,_0x54fee0[0x0],_0x2a642b);}else{_0x9c9efa=_0x2a642b;}}if(_0xdadd('0x7b')!=typeof _0x165635[_0xdadd('0x80')][_0xdadd('0x81')][_0xdadd('0x83')]){var _0x4bba5f=_0x165635[_0xdadd('0x80')]['views'][_0xdadd('0x83')];if(!/^(f|ht)tps?:\/\//i['test'](_0x4bba5f)){_0x491227=path['join'](_0xdadd('0x92'),_0x3419bd,_0x54fee0[0x0],_0x4bba5f);}else{_0x491227=_0x4bba5f;}}}}var _0x186320={'name':_0x40735c,'description':_0x489767,'path':path[_0xdadd('0x53')](_0x3419bd,_0x54fee0[0x0]),'type':_0x350c96,'sidebar':_0x2425c7,'icon':_0x237050,'adminUrl':_0x9c9efa,'agentUrl':_0x491227,'scriptName':_0x230e22,'scriptPath':_0x1477a6,'version':_0x4ac079};removeReferences(_0x4be906,null);return db['Plugin'][_0xdadd('0x94')](_0x186320)['then'](function(_0x2faac3){var _0x212e2d={'role':_0x2a65cb['body'][_0xdadd('0x95')],'userProfileId':_0x2a65cb[_0xdadd('0x96')]['userProfileId']};if(!_0x212e2d)throw new Error(_0xdadd('0x97'));if(_0x212e2d[_0xdadd('0x95')]==='user'){var _0x404534=_0x2faac3[_0xdadd('0x2a')]({'plain':!![]});return db[_0xdadd('0x98')]['find']({'where':{'name':'Plugins','userProfileId':_0x212e2d[_0xdadd('0x99')]},'raw':!![]})[_0xdadd('0x28')](function(_0x10751d){if(_0x10751d&&_0x10751d[_0xdadd('0x9a')]===0x0){return db[_0xdadd('0x9b')][_0xdadd('0x94')]({'name':_0x404534[_0xdadd('0x2f')],'resourceId':_0x404534['id'],'type':_0x10751d[_0xdadd('0x2f')],'sectionId':_0x10751d['id']},{})[_0xdadd('0x28')](function(){return _0x2faac3;});}else{return _0x2faac3;}})[_0xdadd('0x51')](function(_0x2551da){logger[_0xdadd('0x2d')](_0xdadd('0x9c'),_0x2551da);throw _0x2551da;});}return _0x2faac3;})['then'](respondWithResult(_0x1ab718,null))[_0xdadd('0x51')](handleError(_0x1ab718,null));}});}catch(_0x3d911a){_0x1ab718[_0xdadd('0x21')](0x1f4)[_0xdadd('0x30')](_0x3d911a);}};function removeReferences(_0x247806,_0xce1b1c){try{if(_0x247806){fs[_0xdadd('0x9d')](_0x247806);logger[_0xdadd('0x67')]('Zip\x20archive\x20removed');}if(_0xce1b1c){rimraf(_0xce1b1c,function(){});logger[_0xdadd('0x67')](_0xdadd('0x9e'));}}catch(_0x4353c6){logger['error'](_0x4353c6);}}exports[_0xdadd('0x27')]=function(_0x547cf9,_0x4a605e,_0x257384){return db[_0xdadd('0x4b')][_0xdadd('0x50')]({'where':{'id':_0x547cf9['params']['id']}})[_0xdadd('0x28')](handleEntityNotFound(_0x4a605e,null))['then'](saveUpdates(_0x547cf9['body'],null))[_0xdadd('0x28')](respondWithResult(_0x4a605e,null))[_0xdadd('0x51')](handleError(_0x4a605e,null));};exports[_0xdadd('0x9f')]=function(_0x486135,_0x53cc9d,_0x432e7d){return db['Plugin'][_0xdadd('0x50')]({'where':{'id':_0x486135[_0xdadd('0x4f')]['id']}})[_0xdadd('0x28')](function(_0x325db6){if(_0x325db6){return _0x325db6['destroy']();}})[_0xdadd('0x28')](function(_0x178282){rimraf(path['join'](config[_0xdadd('0x6e')],_0xdadd('0x54'),path['dirname'](_0x178282[_0xdadd('0x9')])),function(){});return _0x178282;})[_0xdadd('0x28')](handleEntityNotFound(_0x53cc9d,null))[_0xdadd('0x28')](respondWithStatusCode(_0x53cc9d,null))[_0xdadd('0x51')](handleError(_0x53cc9d,null));};exports[_0xdadd('0xa0')]=function(_0xe18685,_0x3ed3bc,_0x663d7b){return BPromise[_0xdadd('0xa1')]()[_0xdadd('0x28')](function(){if(!_0xe18685[_0xdadd('0x38')][_0xdadd('0x9')]){throw new Error(_0xdadd('0xa2'));}if(!_0xe18685[_0xdadd('0x38')][_0xdadd('0xa3')]){throw new Error(_0xdadd('0xa4'));}var _0x582d03=_0xe18685[_0xdadd('0x38')][_0xdadd('0xa5')]?_0xe18685[_0xdadd('0x38')][_0xdadd('0xa5')]+':'+_0xe18685[_0xdadd('0x38')]['port']:_0xdadd('0xa6')+_0xe18685[_0xdadd('0x38')]['port'];var _0x1149ea=_0xe18685[_0xdadd('0x38')][_0xdadd('0x25')]?_0xe18685[_0xdadd('0x38')][_0xdadd('0x25')]:!![];var _0x32a5a9=_0xe18685['query'][_0xdadd('0xa7')]?_0xe18685[_0xdadd('0x38')][_0xdadd('0xa7')]:null;var _0x2749fe={'method':_0xe18685[_0xdadd('0xa8')],'uri':util['format'](_0xdadd('0xa9'),_0x582d03,_0xe18685['query']['path']),'json':_0x1149ea,'resolveWithFullResponse':!![],'encoding':_0x32a5a9,'qs':_0xe18685['query']};if(_0xe18685[_0xdadd('0xaa')]){_0x2749fe[_0xdadd('0xaa')]=_0xe18685[_0xdadd('0xaa')];if(_0x2749fe['headers'][_0xdadd('0xab')]){delete _0x2749fe['headers'][_0xdadd('0xab')];}}if(_0x2749fe['headers'][_0xdadd('0xac')]){delete _0x2749fe[_0xdadd('0xaa')][_0xdadd('0xac')];}return rp(_0x2749fe);})[_0xdadd('0x28')](function(_0x5ac287){if(_0x5ac287){_0x3ed3bc[_0xdadd('0xad')](_0x5ac287[_0xdadd('0xaa')]);logger[_0xdadd('0x67')](_0x5ac287['body']);if(_[_0xdadd('0xae')](_0xe18685[_0xdadd('0x38')][_0xdadd('0x9')],_0xdadd('0x52'))&&_0x5ac287[_0xdadd('0xaf')]==0x1f4){return _0x3ed3bc['sendStatus'](_0x5ac287['statusCode']);}else{return _0x3ed3bc[_0xdadd('0x21')](_0x5ac287['statusCode'])[_0xdadd('0x30')](_0x5ac287[_0xdadd('0x96')]);}}else{return _0x3ed3bc['sendStatus'](0xc8);}})[_0xdadd('0x51')](handleError(_0x3ed3bc,null));};exports[_0xdadd('0xb0')]=function(_0x4c5ae7,_0x405452,_0x49d2b6){return BPromise[_0xdadd('0xa1')]()[_0xdadd('0x28')](function(){if(!_0x4c5ae7[_0xdadd('0x38')][_0xdadd('0x9')]){throw new Error('\x27PATH\x27\x20parameter\x20not\x20specified');}if(!_0x4c5ae7[_0xdadd('0x38')]['port']){throw new Error(_0xdadd('0xa4'));}var _0x5de8a6=_0x4c5ae7[_0xdadd('0x38')][_0xdadd('0xa5')]?_0x4c5ae7[_0xdadd('0x38')][_0xdadd('0xa5')]+':'+_0x4c5ae7[_0xdadd('0x38')][_0xdadd('0xa3')]:_0xdadd('0xa6')+_0x4c5ae7[_0xdadd('0x38')][_0xdadd('0xa3')];var _0x1917e7=_0x4c5ae7['query']['json']?_0x4c5ae7[_0xdadd('0x38')]['json']:!![];var _0x55d5d0=_0x4c5ae7[_0xdadd('0x38')][_0xdadd('0xa7')]?_0x4c5ae7[_0xdadd('0x38')][_0xdadd('0xa7')]:null;var _0x414361={'method':_0x4c5ae7[_0xdadd('0xa8')],'uri':util['format']('%s%s',_0x5de8a6,_0x4c5ae7['query'][_0xdadd('0x9')]),'json':_0x1917e7,'resolveWithFullResponse':!![],'encoding':_0x55d5d0,'body':_0x4c5ae7[_0xdadd('0x96')]};if(_0x4c5ae7['headers']){_0x414361[_0xdadd('0xaa')]=_0x4c5ae7['headers'];if(_0x414361[_0xdadd('0xaa')][_0xdadd('0xab')]){delete _0x414361[_0xdadd('0xaa')][_0xdadd('0xab')];}}if(_0x414361[_0xdadd('0xaa')]['content-type']){delete _0x414361[_0xdadd('0xaa')][_0xdadd('0xac')];}return rp(_0x414361);})[_0xdadd('0x28')](function(_0x40c498){if(_0x40c498){_0x405452[_0xdadd('0xad')](_0x40c498['headers']);logger[_0xdadd('0x67')](_0x40c498[_0xdadd('0x96')]);return _0x405452['status'](_0x40c498[_0xdadd('0xaf')])[_0xdadd('0x30')](_0x40c498[_0xdadd('0x96')]);}else{return _0x405452[_0xdadd('0x20')](0xc8);}})[_0xdadd('0x51')](handleError(_0x405452,null));};
\ No newline at end of file
diff --git a/server/api/plugin/plugin.events.js b/server/api/plugin/plugin.events.js
index 4445eef..7ac548d 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 _0x2a07=['save','remove','emit','hasOwnProperty','hook','exports','events','../../mysqldb','Plugin','setMaxListeners'];(function(_0x3daf2b,_0x1f71bd){var _0x2fc259=function(_0x526527){while(--_0x526527){_0x3daf2b['push'](_0x3daf2b['shift']());}};_0x2fc259(++_0x1f71bd);}(_0x2a07,0x74));var _0x72a0=function(_0x5f35c5,_0x48949c){_0x5f35c5=_0x5f35c5-0x0;var _0x5e5d64=_0x2a07[_0x5f35c5];return _0x5e5d64;};'use strict';var EventEmitter=require(_0x72a0('0x0'));var Plugin=require(_0x72a0('0x1'))['db'][_0x72a0('0x2')];var PluginEvents=new EventEmitter();PluginEvents[_0x72a0('0x3')](0x0);var events={'afterCreate':_0x72a0('0x4'),'afterUpdate':'update','afterDestroy':_0x72a0('0x5')};function emitEvent(_0x5f7f29){return function(_0x135982,_0x45b155,_0x431f65){PluginEvents[_0x72a0('0x6')](_0x5f7f29+':'+_0x135982['id'],_0x135982);PluginEvents[_0x72a0('0x6')](_0x5f7f29,_0x135982);_0x431f65(null);};}for(var e in events){if(events[_0x72a0('0x7')](e)){var event=events[e];Plugin[_0x72a0('0x8')](e,emitEvent(event));}}module[_0x72a0('0x9')]=PluginEvents;
\ No newline at end of file
+var _0x9f0e=['Plugin','setMaxListeners','save','emit','hook','exports','events','../../mysqldb'];(function(_0x20a584,_0xe384a5){var _0x4b41a8=function(_0x2127c6){while(--_0x2127c6){_0x20a584['push'](_0x20a584['shift']());}};_0x4b41a8(++_0xe384a5);}(_0x9f0e,0x116));var _0xe9f0=function(_0x34a631,_0x32428b){_0x34a631=_0x34a631-0x0;var _0x3c8b0f=_0x9f0e[_0x34a631];return _0x3c8b0f;};'use strict';var EventEmitter=require(_0xe9f0('0x0'));var Plugin=require(_0xe9f0('0x1'))['db'][_0xe9f0('0x2')];var PluginEvents=new EventEmitter();PluginEvents[_0xe9f0('0x3')](0x0);var events={'afterCreate':_0xe9f0('0x4'),'afterUpdate':'update','afterDestroy':'remove'};function emitEvent(_0x2325c6){return function(_0x150a03,_0x3c589d,_0x202d69){PluginEvents[_0xe9f0('0x5')](_0x2325c6+':'+_0x150a03['id'],_0x150a03);PluginEvents['emit'](_0x2325c6,_0x150a03);_0x202d69(null);};}for(var e in events){if(events['hasOwnProperty'](e)){var event=events[e];Plugin[_0xe9f0('0x6')](e,emitEvent(event));}}module[_0xe9f0('0x7')]=PluginEvents;
\ No newline at end of file
diff --git a/server/api/plugin/plugin.model.js b/server/api/plugin/plugin.model.js
index 4ac5f64..f96d2d6 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 _0x5c12=['./plugin.attributes','define','util','../../config/logger','moment','bluebird','request-promise','path','rimraf','../../config/environment'];(function(_0x5a4779,_0x414192){var _0xa96b80=function(_0x3a07e5){while(--_0x3a07e5){_0x5a4779['push'](_0x5a4779['shift']());}};_0xa96b80(++_0x414192);}(_0x5c12,0x188));var _0x25c1=function(_0x211632,_0x378e2e){_0x211632=_0x211632-0x0;var _0x5a1da1=_0x5c12[_0x211632];return _0x5a1da1;};'use strict';var _=require('lodash');var util=require(_0x25c1('0x0'));var logger=require(_0x25c1('0x1'))('api');var moment=require(_0x25c1('0x2'));var BPromise=require(_0x25c1('0x3'));var rp=require(_0x25c1('0x4'));var fs=require('fs');var path=require(_0x25c1('0x5'));var rimraf=require(_0x25c1('0x6'));var config=require(_0x25c1('0x7'));var attributes=require(_0x25c1('0x8'));module['exports']=function(_0x204287,_0x42ac16){return _0x204287[_0x25c1('0x9')]('Plugin',attributes,{'tableName':'plugins','paranoid':![],'indexes':[],'timestamps':!![]});};
\ No newline at end of file
+var _0x34e8=['plugins','lodash','util','../../config/logger','api','bluebird','request-promise','path','rimraf','../../config/environment','./plugin.attributes','exports','Plugin'];(function(_0x244005,_0x4f543b){var _0x5b902f=function(_0x1d56b3){while(--_0x1d56b3){_0x244005['push'](_0x244005['shift']());}};_0x5b902f(++_0x4f543b);}(_0x34e8,0x12c));var _0x834e=function(_0x4bd7c3,_0xab8100){_0x4bd7c3=_0x4bd7c3-0x0;var _0x3ad7b2=_0x34e8[_0x4bd7c3];return _0x3ad7b2;};'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':[],'timestamps':!![]});};
\ No newline at end of file
diff --git a/server/api/plugin/plugin.rpc.js b/server/api/plugin/plugin.rpc.js
index 0690f94..10c2039 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 _0x799f=['../../mysqldb','../../config/utils','../../config/logger','../../config/environment','jayson/promise','redis','localhost','socket.io-emitter','./plugin.socket','register','request','then','info','request\x20sent','Plugin,\x20%s,\x20%s,\x20%s','error','code','Plugin,\x20%s,\x20%s','message','result','CreatePlugin','Plugin','options','raw','debug','stringify','catch','util','moment','bluebird','ioredis'];(function(_0x22de84,_0x56142b){var _0x54fc49=function(_0x3be7bc){while(--_0x3be7bc){_0x22de84['push'](_0x22de84['shift']());}};_0x54fc49(++_0x56142b);}(_0x799f,0x1ec));var _0xf799=function(_0x5222d9,_0x12496d){_0x5222d9=_0x5222d9-0x0;var _0x16b0d5=_0x799f[_0x5222d9];return _0x16b0d5;};'use strict';var _=require('lodash');var util=require(_0xf799('0x0'));var moment=require(_0xf799('0x1'));var BPromise=require(_0xf799('0x2'));var rs=require('randomstring');var fs=require('fs');var Redis=require(_0xf799('0x3'));var db=require(_0xf799('0x4'))['db'];var utils=require(_0xf799('0x5'));var logger=require(_0xf799('0x6'))('rpc');var config=require(_0xf799('0x7'));var jayson=require(_0xf799('0x8'));var client=jayson['client']['http']({'port':0x232a});config[_0xf799('0x9')]=_['defaults'](config[_0xf799('0x9')],{'host':_0xf799('0xa'),'port':0x18eb});var socket=require(_0xf799('0xb'))(new Redis(config[_0xf799('0x9')]));require(_0xf799('0xc'))[_0xf799('0xd')](socket);function respondWithRpcPromise(_0x57bd68,_0x57f48c,_0x1c5e66){return new BPromise(function(_0x17da8,_0x14be56){return client[_0xf799('0xe')](_0x57bd68,_0x1c5e66)[_0xf799('0xf')](function(_0x25c7ea){logger[_0xf799('0x10')]('Plugin,\x20%s,\x20%s',_0x57f48c,_0xf799('0x11'));logger['debug'](_0xf799('0x12'),_0x57f48c,_0xf799('0x11'),JSON['stringify'](_0x25c7ea));if(_0x25c7ea[_0xf799('0x13')]){if(_0x25c7ea[_0xf799('0x13')][_0xf799('0x14')]===0x1f4){logger[_0xf799('0x13')](_0xf799('0x15'),_0x57f48c,_0x25c7ea[_0xf799('0x13')][_0xf799('0x16')]);return _0x14be56(_0x25c7ea['error']['message']);}logger[_0xf799('0x13')](_0xf799('0x15'),_0x57f48c,_0x25c7ea[_0xf799('0x13')][_0xf799('0x16')]);return _0x17da8(_0x25c7ea[_0xf799('0x13')][_0xf799('0x16')]);}else{logger[_0xf799('0x10')](_0xf799('0x15'),_0x57f48c,_0xf799('0x11'));_0x17da8(_0x25c7ea[_0xf799('0x17')][_0xf799('0x16')]);}})['catch'](function(_0x199c6a){logger[_0xf799('0x13')](_0xf799('0x15'),_0x57f48c,_0x199c6a);_0x14be56(_0x199c6a);});});}exports[_0xf799('0x18')]=function(_0x15025){var _0x4ec9f2=this;return new Promise(function(_0x541db8,_0x2854a0){return db[_0xf799('0x19')]['create'](_0x15025['body'],{'raw':_0x15025[_0xf799('0x1a')]?_0x15025[_0xf799('0x1a')][_0xf799('0x1b')]===undefined?!![]:![]:!![]})['then'](function(_0x335c9a){logger[_0xf799('0x10')](_0xf799('0x18'),_0x15025);logger[_0xf799('0x1c')]('CreatePlugin',_0x15025,JSON[_0xf799('0x1d')](_0x335c9a));_0x541db8(_0x335c9a);})[_0xf799('0x1e')](function(_0x30275e){logger[_0xf799('0x13')](_0xf799('0x18'),_0x30275e['message'],_0x15025);_0x2854a0(_0x4ec9f2[_0xf799('0x13')](0x1f4,_0x30275e[_0xf799('0x16')]));});});};
\ No newline at end of file
+var _0x17f4=['code','message','result','catch','CreatePlugin','Plugin','create','body','options','raw','util','moment','bluebird','ioredis','../../mysqldb','../../config/logger','rpc','../../config/environment','client','redis','socket.io-emitter','./plugin.socket','register','then','info','Plugin,\x20%s,\x20%s','request\x20sent','debug','Plugin,\x20%s,\x20%s,\x20%s','error'];(function(_0x502c7d,_0x2f1285){var _0x30b7ed=function(_0x2d92f3){while(--_0x2d92f3){_0x502c7d['push'](_0x502c7d['shift']());}};_0x30b7ed(++_0x2f1285);}(_0x17f4,0xa0));var _0x417f=function(_0x9c32df,_0x533254){_0x9c32df=_0x9c32df-0x0;var _0x4edcc2=_0x17f4[_0x9c32df];return _0x4edcc2;};'use strict';var _=require('lodash');var util=require(_0x417f('0x0'));var moment=require(_0x417f('0x1'));var BPromise=require(_0x417f('0x2'));var rs=require('randomstring');var fs=require('fs');var Redis=require(_0x417f('0x3'));var db=require(_0x417f('0x4'))['db'];var utils=require('../../config/utils');var logger=require(_0x417f('0x5'))(_0x417f('0x6'));var config=require(_0x417f('0x7'));var jayson=require('jayson/promise');var client=jayson[_0x417f('0x8')]['http']({'port':0x232a});config[_0x417f('0x9')]=_['defaults'](config['redis'],{'host':'localhost','port':0x18eb});var socket=require(_0x417f('0xa'))(new Redis(config[_0x417f('0x9')]));require(_0x417f('0xb'))[_0x417f('0xc')](socket);function respondWithRpcPromise(_0x11b204,_0x28fd60,_0x16d649){return new BPromise(function(_0x2fba9e,_0x16b373){return client['request'](_0x11b204,_0x16d649)[_0x417f('0xd')](function(_0x158e7e){logger[_0x417f('0xe')](_0x417f('0xf'),_0x28fd60,_0x417f('0x10'));logger[_0x417f('0x11')](_0x417f('0x12'),_0x28fd60,'request\x20sent',JSON['stringify'](_0x158e7e));if(_0x158e7e['error']){if(_0x158e7e[_0x417f('0x13')][_0x417f('0x14')]===0x1f4){logger[_0x417f('0x13')](_0x417f('0xf'),_0x28fd60,_0x158e7e[_0x417f('0x13')][_0x417f('0x15')]);return _0x16b373(_0x158e7e[_0x417f('0x13')][_0x417f('0x15')]);}logger[_0x417f('0x13')](_0x417f('0xf'),_0x28fd60,_0x158e7e[_0x417f('0x13')][_0x417f('0x15')]);return _0x2fba9e(_0x158e7e['error'][_0x417f('0x15')]);}else{logger[_0x417f('0xe')](_0x417f('0xf'),_0x28fd60,_0x417f('0x10'));_0x2fba9e(_0x158e7e[_0x417f('0x16')][_0x417f('0x15')]);}})[_0x417f('0x17')](function(_0x1077f3){logger['error'](_0x417f('0xf'),_0x28fd60,_0x1077f3);_0x16b373(_0x1077f3);});});}exports[_0x417f('0x18')]=function(_0x11565e){var _0x47f37f=this;return new Promise(function(_0x3e2596,_0x5e77d7){return db[_0x417f('0x19')][_0x417f('0x1a')](_0x11565e[_0x417f('0x1b')],{'raw':_0x11565e['options']?_0x11565e[_0x417f('0x1c')][_0x417f('0x1d')]===undefined?!![]:![]:!![]})[_0x417f('0xd')](function(_0x1f2469){logger[_0x417f('0xe')](_0x417f('0x18'),_0x11565e);logger[_0x417f('0x11')]('CreatePlugin',_0x11565e,JSON['stringify'](_0x1f2469));_0x3e2596(_0x1f2469);})[_0x417f('0x17')](function(_0xc77996){logger[_0x417f('0x13')](_0x417f('0x18'),_0xc77996[_0x417f('0x15')],_0x11565e);_0x5e77d7(_0x47f37f[_0x417f('0x13')](0x1f4,_0xc77996[_0x417f('0x15')]));});});};
\ No newline at end of file
diff --git a/server/api/plugin/plugin.socket.js b/server/api/plugin/plugin.socket.js
index 36a669e..1876866 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 _0xd38f=['length','./plugin.events','save','emit','removeListener','register'];(function(_0x382f8e,_0x164e01){var _0x2fe7cb=function(_0x324708){while(--_0x324708){_0x382f8e['push'](_0x382f8e['shift']());}};_0x2fe7cb(++_0x164e01);}(_0xd38f,0xa3));var _0xfd38=function(_0x3c8809,_0x94bcda){_0x3c8809=_0x3c8809-0x0;var _0x3f7c45=_0xd38f[_0x3c8809];return _0x3f7c45;};'use strict';var PluginEvents=require(_0xfd38('0x0'));var events=[_0xfd38('0x1'),'remove','update'];function createListener(_0x4a1676,_0x197eb8){return function(_0x365421){_0x197eb8[_0xfd38('0x2')](_0x4a1676,_0x365421);};}function removeListener(_0x27fc53,_0x19fc62){return function(){PluginEvents[_0xfd38('0x3')](_0x27fc53,_0x19fc62);};}exports[_0xfd38('0x4')]=function(_0x121417){for(var _0x56d5a9=0x0,_0x318785=events[_0xfd38('0x5')];_0x56d5a9<_0x318785;_0x56d5a9++){var _0x433783=events[_0x56d5a9];var _0xd0d6d8=createListener('plugin:'+_0x433783,_0x121417);PluginEvents['on'](_0x433783,_0xd0d6d8);}};
\ No newline at end of file
+var _0xe2dc=['register','plugin:','./plugin.events','update'];(function(_0xf0bcac,_0x531755){var _0x4e4c65=function(_0x35a77a){while(--_0x35a77a){_0xf0bcac['push'](_0xf0bcac['shift']());}};_0x4e4c65(++_0x531755);}(_0xe2dc,0xde));var _0xce2d=function(_0x2d9e27,_0x46b45e){_0x2d9e27=_0x2d9e27-0x0;var _0x4b8667=_0xe2dc[_0x2d9e27];return _0x4b8667;};'use strict';var PluginEvents=require(_0xce2d('0x0'));var events=['save','remove',_0xce2d('0x1')];function createListener(_0x157595,_0x68f4fc){return function(_0x19a3f9){_0x68f4fc['emit'](_0x157595,_0x19a3f9);};}function removeListener(_0x1761e4,_0x58ae63){return function(){PluginEvents['removeListener'](_0x1761e4,_0x58ae63);};}exports[_0xce2d('0x2')]=function(_0x394865){for(var _0x4b014a=0x0,_0x5ed552=events['length'];_0x4b014a<_0x5ed552;_0x4b014a++){var _0xf4225e=events[_0x4b014a];var _0x572837=createListener(_0xce2d('0x3')+_0xf4225e,_0x394865);PluginEvents['on'](_0xf4225e,_0x572837);}};
\ No newline at end of file
diff --git a/server/api/pm2/index.js b/server/api/pm2/index.js
index f907b08..d7f8fdb 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 _0x27c4=['create','put','update','delete','exports','express','Router','../../components/auth/service','./pm2.controller','isAuthenticated','index','/:id','show'];(function(_0x531607,_0x73fa88){var _0x1b1fbb=function(_0x4af491){while(--_0x4af491){_0x531607['push'](_0x531607['shift']());}};_0x1b1fbb(++_0x73fa88);}(_0x27c4,0xbb));var _0x427c=function(_0x1f7dd8,_0x3db18c){_0x1f7dd8=_0x1f7dd8-0x0;var _0x2d1bbd=_0x27c4[_0x1f7dd8];return _0x2d1bbd;};'use strict';var express=require(_0x427c('0x0'));var router=express[_0x427c('0x1')]();var auth=require(_0x427c('0x2'));var controller=require(_0x427c('0x3'));router['get']('/',auth[_0x427c('0x4')](),controller[_0x427c('0x5')]);router['get'](_0x427c('0x6'),auth[_0x427c('0x4')](),controller[_0x427c('0x7')]);router['post']('/',auth[_0x427c('0x4')](),controller[_0x427c('0x8')]);router[_0x427c('0x9')](_0x427c('0x6'),auth[_0x427c('0x4')](),controller[_0x427c('0xa')]);router[_0x427c('0xb')](_0x427c('0x6'),auth[_0x427c('0x4')](),controller['destroy']);module[_0x427c('0xc')]=router;
\ No newline at end of file
+var _0x1e5d=['isAuthenticated','index','show','post','create','put','update','delete','/:id','express','Router','../../components/auth/service','./pm2.controller','get'];(function(_0x505b1,_0x3f2a5d){var _0x6f5380=function(_0x439bda){while(--_0x439bda){_0x505b1['push'](_0x505b1['shift']());}};_0x6f5380(++_0x3f2a5d);}(_0x1e5d,0x113));var _0xd1e5=function(_0x3dd15e,_0x1f0015){_0x3dd15e=_0x3dd15e-0x0;var _0x231fd0=_0x1e5d[_0x3dd15e];return _0x231fd0;};'use strict';var express=require(_0xd1e5('0x0'));var router=express[_0xd1e5('0x1')]();var auth=require(_0xd1e5('0x2'));var controller=require(_0xd1e5('0x3'));router[_0xd1e5('0x4')]('/',auth[_0xd1e5('0x5')](),controller[_0xd1e5('0x6')]);router['get']('/:id',auth[_0xd1e5('0x5')](),controller[_0xd1e5('0x7')]);router[_0xd1e5('0x8')]('/',auth[_0xd1e5('0x5')](),controller[_0xd1e5('0x9')]);router[_0xd1e5('0xa')]('/:id',auth['isAuthenticated'](),controller[_0xd1e5('0xb')]);router[_0xd1e5('0xc')](_0xd1e5('0xd'),auth['isAuthenticated'](),controller['destroy']);module['exports']=router;
\ No newline at end of file
diff --git a/server/api/pm2/pm2.controller.js b/server/api/pm2/pm2.controller.js
index d69d0ee..5e2a227 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 _0xcda1=['params','create','script','join','../../files/plugins','body','cwd','chdir','dirname','start','dump','catch','update','restart','stop','hasOwnProperty','Unknown\x20status','destroy','delete','Unknown\x20id','../../config/pm2','../../config/logger','path','child_process','exec','bluebird','status','error','stack','name','send','index','list','then','express','motion2','length','show','describe'];(function(_0x2433bd,_0x1d908d){var _0x2f0344=function(_0x47de6e){while(--_0x47de6e){_0x2433bd['push'](_0x2433bd['shift']());}};_0x2f0344(++_0x1d908d);}(_0xcda1,0xd7));var _0x1cda=function(_0x3efb5f,_0x377c89){_0x3efb5f=_0x3efb5f-0x0;var _0x285699=_0xcda1[_0x3efb5f];return _0x285699;};'use strict';var _=require('lodash');var pm2=require(_0x1cda('0x0'));var logger=require(_0x1cda('0x1'))('api');var path=require(_0x1cda('0x2'));var exec=require(_0x1cda('0x3'))[_0x1cda('0x4')];var BPromise=require(_0x1cda('0x5'));function handleEntityNotFound(_0xb39c71,_0x2b3a23){return function(_0x2b1284){if(!_0x2b1284){_0xb39c71['sendStatus'](0x194);;}return _0x2b1284;};}function respondWithResult(_0x167965,_0x1ff66d){_0x1ff66d=_0x1ff66d||0xc8;return function(_0x170076){if(_0x170076){return _0x167965[_0x1cda('0x6')](_0x1ff66d)['json'](_0x170076);}return null;};}function handleError(_0x2a6670,_0x359734){_0x359734=_0x359734||0x1f4;return function(_0x482afd){logger[_0x1cda('0x7')](_0x482afd[_0x1cda('0x8')]);if(_0x482afd[_0x1cda('0x9')]){delete _0x482afd[_0x1cda('0x9')];}_0x2a6670[_0x1cda('0x6')](_0x359734)[_0x1cda('0xa')](_0x482afd);};}function execChildProcess(){return new BPromise(function(_0x45149b,_0x310915){exec('npm\x20install',function(_0x3d75a5,_0x4c06ce,_0x361498){logger['info'](_0x4c06ce);logger['info'](_0x361498);if(_0x3d75a5){logger[_0x1cda('0x7')](_0x3d75a5);return _0x310915(_0x3d75a5);}return _0x45149b(_0x4c06ce);});});}exports[_0x1cda('0xb')]=function(_0x175ee1,_0x573872){return pm2[_0x1cda('0xc')]()[_0x1cda('0xd')](function(_0x5142e4){if(_0x5142e4){var _0x5d2d68=_['reject'](_0x5142e4,function(_0x1d8c15){return _0x1d8c15[_0x1cda('0x9')]===_0x1cda('0xe')||_0x1d8c15[_0x1cda('0x9')]===_0x1cda('0xf');});return{'rows':_0x5d2d68,'count':_0x5d2d68[_0x1cda('0x10')]};}return null;})[_0x1cda('0xd')](respondWithResult(_0x573872,null))['catch'](handleError(_0x573872,null));};exports[_0x1cda('0x11')]=function(_0x2e6050,_0x1c5ee9){return pm2[_0x1cda('0x12')](_0x2e6050[_0x1cda('0x13')]['id'])[_0x1cda('0xd')](respondWithResult(_0x1c5ee9,null))[_0x1cda('0xd')](handleEntityNotFound(_0x1c5ee9,null))['catch'](handleError(_0x1c5ee9,null));};exports[_0x1cda('0x14')]=function(_0x1c0403,_0x20e5cb){if(_0x1c0403['body'][_0x1cda('0x9')]&&_0x1c0403['body'][_0x1cda('0x15')]){var _0x20e064=path[_0x1cda('0x16')](__dirname,_0x1cda('0x17'),_0x1c0403[_0x1cda('0x18')][_0x1cda('0x15')]);var _0x25bf8f=process[_0x1cda('0x19')]();process[_0x1cda('0x1a')](path[_0x1cda('0x1b')](_0x20e064));return execChildProcess()[_0x1cda('0xd')](function(_0x469132){process['chdir'](_0x25bf8f);return pm2[_0x1cda('0x1c')]({'name':_0x1c0403[_0x1cda('0x18')][_0x1cda('0x9')],'script':_0x20e064});})[_0x1cda('0xd')](function(_0xb2ab1f){pm2[_0x1cda('0x1d')]();return _0xb2ab1f[0x0];})[_0x1cda('0xd')](respondWithResult(_0x20e5cb,0xc9))[_0x1cda('0x1e')](handleError(_0x20e5cb,null));}else{return _0x20e5cb[_0x1cda('0x6')](0x1f4)[_0x1cda('0xa')]({'message':'Missing\x20name\x20and/or\x20path'});}};exports[_0x1cda('0x1f')]=function(_0x36cefe,_0x3a560d){if(_0x36cefe[_0x1cda('0x18')]['id']){delete _0x36cefe[_0x1cda('0x18')]['id'];}var _0x3bbaf9={'online':_0x1cda('0x20'),'stopped':_0x1cda('0x21')};if(_0x3bbaf9[_0x1cda('0x22')](_0x36cefe[_0x1cda('0x18')][_0x1cda('0x6')])){return pm2[_0x3bbaf9[_0x36cefe[_0x1cda('0x18')]['status']]](_0x36cefe[_0x1cda('0x13')]['id'])[_0x1cda('0xd')](respondWithResult(_0x3a560d,0xc8))[_0x1cda('0x1e')](handleError(_0x3a560d,null));}else{return _0x3a560d[_0x1cda('0x6')](0x1f4)[_0x1cda('0xa')]({'message':_0x1cda('0x23')});}};exports[_0x1cda('0x24')]=function(_0x5ef4d3,_0x2217e7){if(_0x5ef4d3[_0x1cda('0x18')]['id']){delete _0x5ef4d3[_0x1cda('0x18')]['id'];}if(_0x5ef4d3[_0x1cda('0x13')]['id']){return pm2[_0x1cda('0x25')](_0x5ef4d3[_0x1cda('0x13')]['id'])[_0x1cda('0xd')](function(_0xfeb339){pm2['dump']();return _0xfeb339[0x0];})[_0x1cda('0xd')](respondWithResult(_0x2217e7,null))['catch'](handleError(_0x2217e7,null));}else{return _0x2217e7['status'](0x1f4)[_0x1cda('0xa')]({'message':_0x1cda('0x26')});}};
\ No newline at end of file
+var _0x3532=['../../config/logger','path','exec','sendStatus','status','stack','name','npm\x20install','info','index','then','reject','express','motion2','length','catch','show','params','create','script','../../files/plugins','body','cwd','chdir','dirname','start','dump','send','Missing\x20name\x20and/or\x20path','update','restart','hasOwnProperty','Unknown\x20status','destroy','Unknown\x20id','lodash','../../config/pm2'];(function(_0x31fc74,_0x5cdff7){var _0x32b6f7=function(_0x362b71){while(--_0x362b71){_0x31fc74['push'](_0x31fc74['shift']());}};_0x32b6f7(++_0x5cdff7);}(_0x3532,0x6d));var _0x2353=function(_0x92e512,_0x31af50){_0x92e512=_0x92e512-0x0;var _0x3bb5d0=_0x3532[_0x92e512];return _0x3bb5d0;};'use strict';var _=require(_0x2353('0x0'));var pm2=require(_0x2353('0x1'));var logger=require(_0x2353('0x2'))('api');var path=require(_0x2353('0x3'));var exec=require('child_process')[_0x2353('0x4')];var BPromise=require('bluebird');function handleEntityNotFound(_0x42b71a,_0x154be1){return function(_0x305847){if(!_0x305847){_0x42b71a[_0x2353('0x5')](0x194);;}return _0x305847;};}function respondWithResult(_0x49a61f,_0x5f50d2){_0x5f50d2=_0x5f50d2||0xc8;return function(_0x8899a9){if(_0x8899a9){return _0x49a61f[_0x2353('0x6')](_0x5f50d2)['json'](_0x8899a9);}return null;};}function handleError(_0x47be9c,_0x2b6237){_0x2b6237=_0x2b6237||0x1f4;return function(_0xde728f){logger['error'](_0xde728f[_0x2353('0x7')]);if(_0xde728f[_0x2353('0x8')]){delete _0xde728f[_0x2353('0x8')];}_0x47be9c[_0x2353('0x6')](_0x2b6237)['send'](_0xde728f);};}function execChildProcess(){return new BPromise(function(_0x10de94,_0x1fa7b4){exec(_0x2353('0x9'),function(_0x57c2ce,_0x29a03d,_0x23bfc0){logger['info'](_0x29a03d);logger[_0x2353('0xa')](_0x23bfc0);if(_0x57c2ce){logger['error'](_0x57c2ce);return _0x1fa7b4(_0x57c2ce);}return _0x10de94(_0x29a03d);});});}exports[_0x2353('0xb')]=function(_0x3a64ec,_0x4d5d2f){return pm2['list']()[_0x2353('0xc')](function(_0x31f557){if(_0x31f557){var _0x50a155=_[_0x2353('0xd')](_0x31f557,function(_0x72df7d){return _0x72df7d[_0x2353('0x8')]===_0x2353('0xe')||_0x72df7d[_0x2353('0x8')]===_0x2353('0xf');});return{'rows':_0x50a155,'count':_0x50a155[_0x2353('0x10')]};}return null;})[_0x2353('0xc')](respondWithResult(_0x4d5d2f,null))[_0x2353('0x11')](handleError(_0x4d5d2f,null));};exports[_0x2353('0x12')]=function(_0x1eddda,_0x45478b){return pm2['describe'](_0x1eddda[_0x2353('0x13')]['id'])['then'](respondWithResult(_0x45478b,null))[_0x2353('0xc')](handleEntityNotFound(_0x45478b,null))['catch'](handleError(_0x45478b,null));};exports[_0x2353('0x14')]=function(_0xfae35,_0x4fd89a){if(_0xfae35['body'][_0x2353('0x8')]&&_0xfae35['body'][_0x2353('0x15')]){var _0x580ac1=path['join'](__dirname,_0x2353('0x16'),_0xfae35[_0x2353('0x17')]['script']);var _0x447e54=process[_0x2353('0x18')]();process[_0x2353('0x19')](path[_0x2353('0x1a')](_0x580ac1));return execChildProcess()[_0x2353('0xc')](function(_0x5d3bb0){process['chdir'](_0x447e54);return pm2[_0x2353('0x1b')]({'name':_0xfae35['body'][_0x2353('0x8')],'script':_0x580ac1});})[_0x2353('0xc')](function(_0x1f9077){pm2[_0x2353('0x1c')]();return _0x1f9077[0x0];})[_0x2353('0xc')](respondWithResult(_0x4fd89a,0xc9))['catch'](handleError(_0x4fd89a,null));}else{return _0x4fd89a['status'](0x1f4)[_0x2353('0x1d')]({'message':_0x2353('0x1e')});}};exports[_0x2353('0x1f')]=function(_0x191726,_0x4380aa){if(_0x191726[_0x2353('0x17')]['id']){delete _0x191726['body']['id'];}var _0x279224={'online':_0x2353('0x20'),'stopped':'stop'};if(_0x279224[_0x2353('0x21')](_0x191726[_0x2353('0x17')]['status'])){return pm2[_0x279224[_0x191726['body'][_0x2353('0x6')]]](_0x191726['params']['id'])[_0x2353('0xc')](respondWithResult(_0x4380aa,0xc8))[_0x2353('0x11')](handleError(_0x4380aa,null));}else{return _0x4380aa[_0x2353('0x6')](0x1f4)[_0x2353('0x1d')]({'message':_0x2353('0x22')});}};exports[_0x2353('0x23')]=function(_0x4e4f61,_0x139d8f){if(_0x4e4f61['body']['id']){delete _0x4e4f61[_0x2353('0x17')]['id'];}if(_0x4e4f61[_0x2353('0x13')]['id']){return pm2['delete'](_0x4e4f61[_0x2353('0x13')]['id'])[_0x2353('0xc')](function(_0x360b4a){pm2[_0x2353('0x1c')]();return _0x360b4a[0x0];})[_0x2353('0xc')](respondWithResult(_0x139d8f,null))[_0x2353('0x11')](handleError(_0x139d8f,null));}else{return _0x139d8f[_0x2353('0x6')](0x1f4)['send']({'message':_0x2353('0x24')});}};
\ No newline at end of file
diff --git a/server/api/reportAgentPreview/index.js b/server/api/reportAgentPreview/index.js
index 0520e63..c7632cf 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 _0xf23f=['multer','util','path','express','Router','../../config/environment'];(function(_0x2af11c,_0x57da74){var _0x189eb1=function(_0x300c52){while(--_0x300c52){_0x2af11c['push'](_0x2af11c['shift']());}};_0x189eb1(++_0x57da74);}(_0xf23f,0x1da));var _0xff23=function(_0x19c7a8,_0x10508d){_0x19c7a8=_0x19c7a8-0x0;var _0x1462ce=_0xf23f[_0x19c7a8];return _0x1462ce;};'use strict';var multer=require(_0xff23('0x0'));var util=require(_0xff23('0x1'));var path=require(_0xff23('0x2'));var timeout=require('connect-timeout');var express=require(_0xff23('0x3'));var router=express[_0xff23('0x4')]();var auth=require('../../components/auth/service');var interaction=require('../../components/interaction/service');var config=require(_0xff23('0x5'));module['exports']=router;
\ No newline at end of file
+var _0xd0dc=['Router','../../components/auth/service','../../components/interaction/service','../../config/environment','exports','multer','util','path','connect-timeout'];(function(_0x1b6186,_0x1ec7f2){var _0x186121=function(_0x1748a8){while(--_0x1748a8){_0x1b6186['push'](_0x1b6186['shift']());}};_0x186121(++_0x1ec7f2);}(_0xd0dc,0x9e));var _0xcd0d=function(_0x49f19e,_0x1c3aa3){_0x49f19e=_0x49f19e-0x0;var _0x280b5a=_0xd0dc[_0x49f19e];return _0x280b5a;};'use strict';var multer=require(_0xcd0d('0x0'));var util=require(_0xcd0d('0x1'));var path=require(_0xcd0d('0x2'));var timeout=require(_0xcd0d('0x3'));var express=require('express');var router=express[_0xcd0d('0x4')]();var auth=require(_0xcd0d('0x5'));var interaction=require(_0xcd0d('0x6'));var config=require(_0xcd0d('0x7'));module[_0xcd0d('0x8')]=router;
\ No newline at end of file
diff --git a/server/api/reportAgentPreview/reportAgentPreview.attributes.js b/server/api/reportAgentPreview/reportAgentPreview.attributes.js
index 50f5ca7..9d3fd25 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 _0x43eb=['STRING','DATE','INTEGER','sequelize','exports'];(function(_0x5682cd,_0x31285a){var _0x52411f=function(_0x2dae5d){while(--_0x2dae5d){_0x5682cd['push'](_0x5682cd['shift']());}};_0x52411f(++_0x31285a);}(_0x43eb,0x166));var _0xb43e=function(_0x3dd15e,_0x1f0015){_0x3dd15e=_0x3dd15e-0x0;var _0x231fd0=_0x43eb[_0x3dd15e];return _0x231fd0;};'use strict';var Sequelize=require(_0xb43e('0x0'));module[_0xb43e('0x1')]={'state':{'type':Sequelize['INTEGER'](0x2)},'statedesc':{'type':Sequelize[_0xb43e('0x2')]},'scheduledat':{'type':Sequelize[_0xb43e('0x3')]},'uniqueid':{'type':Sequelize[_0xb43e('0x2')]},'starttime':{'type':Sequelize['DATE']},'responsetime':{'type':Sequelize['DATE']},'ringtime':{'type':Sequelize[_0xb43e('0x4')],'defaultValue':0x0},'campaign':{'type':Sequelize[_0xb43e('0x2')]},'campaigntype':{'type':Sequelize['STRING']},'membername':{'type':Sequelize[_0xb43e('0x2')]}};
\ No newline at end of file
+var _0x6cee=['STRING','sequelize','INTEGER','DATE'];(function(_0x1290e4,_0x2c0be2){var _0x82a2aa=function(_0x2bfcb6){while(--_0x2bfcb6){_0x1290e4['push'](_0x1290e4['shift']());}};_0x82a2aa(++_0x2c0be2);}(_0x6cee,0xd1));var _0xe6ce=function(_0x54d4fe,_0x55e869){_0x54d4fe=_0x54d4fe-0x0;var _0x1ab5bb=_0x6cee[_0x54d4fe];return _0x1ab5bb;};'use strict';var Sequelize=require(_0xe6ce('0x0'));module['exports']={'state':{'type':Sequelize[_0xe6ce('0x1')](0x2)},'statedesc':{'type':Sequelize['STRING']},'scheduledat':{'type':Sequelize[_0xe6ce('0x2')]},'uniqueid':{'type':Sequelize[_0xe6ce('0x3')]},'starttime':{'type':Sequelize[_0xe6ce('0x2')]},'responsetime':{'type':Sequelize[_0xe6ce('0x2')]},'ringtime':{'type':Sequelize[_0xe6ce('0x1')],'defaultValue':0x0},'campaign':{'type':Sequelize['STRING']},'campaigntype':{'type':Sequelize[_0xe6ce('0x3')]},'membername':{'type':Sequelize[_0xe6ce('0x3')]}};
\ No newline at end of file
diff --git a/server/api/reportAgentPreview/reportAgentPreview.model.js b/server/api/reportAgentPreview/reportAgentPreview.model.js
index 4d5a4dd..ea53a49 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 _0xaf78=['moment','bluebird','request-promise','path','rimraf','../../config/environment','exports','define','ReportAgentPreview','report_agent_preview','lodash','../../config/logger','api'];(function(_0xade1dd,_0x349b74){var _0x188c16=function(_0x236fb0){while(--_0x236fb0){_0xade1dd['push'](_0xade1dd['shift']());}};_0x188c16(++_0x349b74);}(_0xaf78,0x14f));var _0x8af7=function(_0x57cde2,_0x3359f5){_0x57cde2=_0x57cde2-0x0;var _0x3f5a63=_0xaf78[_0x57cde2];return _0x3f5a63;};'use strict';var _=require(_0x8af7('0x0'));var util=require('util');var logger=require(_0x8af7('0x1'))(_0x8af7('0x2'));var moment=require(_0x8af7('0x3'));var BPromise=require(_0x8af7('0x4'));var rp=require(_0x8af7('0x5'));var fs=require('fs');var path=require(_0x8af7('0x6'));var rimraf=require(_0x8af7('0x7'));var config=require(_0x8af7('0x8'));var attributes=require('./reportAgentPreview.attributes');module[_0x8af7('0x9')]=function(_0x4af901,_0x2cbda7){return _0x4af901[_0x8af7('0xa')](_0x8af7('0xb'),attributes,{'tableName':_0x8af7('0xc'),'paranoid':![],'indexes':[],'timestamps':!![]});};
\ No newline at end of file
+var _0xca1c=['api','moment','request-promise','path','rimraf','../../config/environment','./reportAgentPreview.attributes','exports','ReportAgentPreview','report_agent_preview','lodash'];(function(_0x45783c,_0x49c56d){var _0x1161da=function(_0x3c5d41){while(--_0x3c5d41){_0x45783c['push'](_0x45783c['shift']());}};_0x1161da(++_0x49c56d);}(_0xca1c,0x16a));var _0xcca1=function(_0x44a3db,_0x5b2c73){_0x44a3db=_0x44a3db-0x0;var _0x5e832d=_0xca1c[_0x44a3db];return _0x5e832d;};'use strict';var _=require(_0xcca1('0x0'));var util=require('util');var logger=require('../../config/logger')(_0xcca1('0x1'));var moment=require(_0xcca1('0x2'));var BPromise=require('bluebird');var rp=require(_0xcca1('0x3'));var fs=require('fs');var path=require(_0xcca1('0x4'));var rimraf=require(_0xcca1('0x5'));var config=require(_0xcca1('0x6'));var attributes=require(_0xcca1('0x7'));module[_0xcca1('0x8')]=function(_0x2f5524,_0x508c83){return _0x2f5524['define'](_0xcca1('0x9'),attributes,{'tableName':_0xcca1('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 23adfd1..a8d3929 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 _0xe42f=['error','message','info','result','catch','ReportAgentPreview','create','body','options','raw','CreateReportAgentPreview','util','moment','randomstring','ioredis','../../mysqldb','../../config/logger','../../config/environment','jayson/promise','client','http','request','then','ReportAgentPreview,\x20%s,\x20%s','request\x20sent','debug','ReportAgentPreview,\x20%s,\x20%s,\x20%s','stringify'];(function(_0x176d01,_0x379283){var _0x250e9a=function(_0xf7a3d3){while(--_0xf7a3d3){_0x176d01['push'](_0x176d01['shift']());}};_0x250e9a(++_0x379283);}(_0xe42f,0x15b));var _0xfe42=function(_0x32be82,_0x21b592){_0x32be82=_0x32be82-0x0;var _0x35aa04=_0xe42f[_0x32be82];return _0x35aa04;};'use strict';var _=require('lodash');var util=require(_0xfe42('0x0'));var moment=require(_0xfe42('0x1'));var BPromise=require('bluebird');var rs=require(_0xfe42('0x2'));var fs=require('fs');var Redis=require(_0xfe42('0x3'));var db=require(_0xfe42('0x4'))['db'];var utils=require('../../config/utils');var logger=require(_0xfe42('0x5'))('rpc');var config=require(_0xfe42('0x6'));var jayson=require(_0xfe42('0x7'));var client=jayson[_0xfe42('0x8')][_0xfe42('0x9')]({'port':0x232a});function respondWithRpcPromise(_0x4ddc5e,_0x22d6b0,_0x2cf5ac){return new BPromise(function(_0x5bdd42,_0x519fa5){return client[_0xfe42('0xa')](_0x4ddc5e,_0x2cf5ac)[_0xfe42('0xb')](function(_0x227de5){logger['info'](_0xfe42('0xc'),_0x22d6b0,_0xfe42('0xd'));logger[_0xfe42('0xe')](_0xfe42('0xf'),_0x22d6b0,_0xfe42('0xd'),JSON[_0xfe42('0x10')](_0x227de5));if(_0x227de5[_0xfe42('0x11')]){if(_0x227de5[_0xfe42('0x11')]['code']===0x1f4){logger[_0xfe42('0x11')]('ReportAgentPreview,\x20%s,\x20%s',_0x22d6b0,_0x227de5[_0xfe42('0x11')][_0xfe42('0x12')]);return _0x519fa5(_0x227de5[_0xfe42('0x11')][_0xfe42('0x12')]);}logger[_0xfe42('0x11')](_0xfe42('0xc'),_0x22d6b0,_0x227de5[_0xfe42('0x11')]['message']);return _0x5bdd42(_0x227de5[_0xfe42('0x11')][_0xfe42('0x12')]);}else{logger[_0xfe42('0x13')]('ReportAgentPreview,\x20%s,\x20%s',_0x22d6b0,_0xfe42('0xd'));_0x5bdd42(_0x227de5[_0xfe42('0x14')]['message']);}})[_0xfe42('0x15')](function(_0x32c795){logger[_0xfe42('0x11')](_0xfe42('0xc'),_0x22d6b0,_0x32c795);_0x519fa5(_0x32c795);});});}exports['CreateReportAgentPreview']=function(_0x85f7df){var _0x56d5c4=this;return new Promise(function(_0x51097a,_0x39f962){return db[_0xfe42('0x16')][_0xfe42('0x17')](_0x85f7df[_0xfe42('0x18')],{'raw':_0x85f7df['options']?_0x85f7df[_0xfe42('0x19')][_0xfe42('0x1a')]===undefined?!![]:![]:!![]})[_0xfe42('0xb')](function(_0x1cd437){logger[_0xfe42('0x13')](_0xfe42('0x1b'),_0x85f7df);logger[_0xfe42('0xe')]('CreateReportAgentPreview',_0x85f7df,JSON[_0xfe42('0x10')](_0x1cd437));_0x51097a(_0x1cd437);})[_0xfe42('0x15')](function(_0x2aa47d){logger[_0xfe42('0x11')](_0xfe42('0x1b'),_0x2aa47d[_0xfe42('0x12')],_0x85f7df);_0x39f962(_0x56d5c4[_0xfe42('0x11')](0x1f4,_0x2aa47d[_0xfe42('0x12')]));});});};
\ No newline at end of file
+var _0x4660=['message','catch','CreateReportAgentPreview','ReportAgentPreview','create','body','options','raw','debug','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/logger','../../config/environment','jayson/promise','client','http','request','then','info','ReportAgentPreview,\x20%s,\x20%s','request\x20sent','stringify','error','code'];(function(_0x5f09c5,_0x2bfca0){var _0x426ad9=function(_0x18fe5f){while(--_0x18fe5f){_0x5f09c5['push'](_0x5f09c5['shift']());}};_0x426ad9(++_0x2bfca0);}(_0x4660,0x75));var _0x0466=function(_0x47e0a9,_0x2efea){_0x47e0a9=_0x47e0a9-0x0;var _0x133174=_0x4660[_0x47e0a9];return _0x133174;};'use strict';var _=require('lodash');var util=require('util');var moment=require(_0x0466('0x0'));var BPromise=require(_0x0466('0x1'));var rs=require(_0x0466('0x2'));var fs=require('fs');var Redis=require(_0x0466('0x3'));var db=require(_0x0466('0x4'))['db'];var utils=require('../../config/utils');var logger=require(_0x0466('0x5'))('rpc');var config=require(_0x0466('0x6'));var jayson=require(_0x0466('0x7'));var client=jayson[_0x0466('0x8')][_0x0466('0x9')]({'port':0x232a});function respondWithRpcPromise(_0x212bcd,_0xeb58f3,_0x271a65){return new BPromise(function(_0x592527,_0x381560){return client[_0x0466('0xa')](_0x212bcd,_0x271a65)[_0x0466('0xb')](function(_0x1af7cb){logger[_0x0466('0xc')](_0x0466('0xd'),_0xeb58f3,_0x0466('0xe'));logger['debug']('ReportAgentPreview,\x20%s,\x20%s,\x20%s',_0xeb58f3,_0x0466('0xe'),JSON[_0x0466('0xf')](_0x1af7cb));if(_0x1af7cb[_0x0466('0x10')]){if(_0x1af7cb[_0x0466('0x10')][_0x0466('0x11')]===0x1f4){logger['error'](_0x0466('0xd'),_0xeb58f3,_0x1af7cb['error'][_0x0466('0x12')]);return _0x381560(_0x1af7cb['error'][_0x0466('0x12')]);}logger[_0x0466('0x10')](_0x0466('0xd'),_0xeb58f3,_0x1af7cb[_0x0466('0x10')][_0x0466('0x12')]);return _0x592527(_0x1af7cb[_0x0466('0x10')][_0x0466('0x12')]);}else{logger['info'](_0x0466('0xd'),_0xeb58f3,_0x0466('0xe'));_0x592527(_0x1af7cb['result'][_0x0466('0x12')]);}})[_0x0466('0x13')](function(_0x3c1991){logger[_0x0466('0x10')]('ReportAgentPreview,\x20%s,\x20%s',_0xeb58f3,_0x3c1991);_0x381560(_0x3c1991);});});}exports[_0x0466('0x14')]=function(_0x4a4828){var _0xcfd846=this;return new Promise(function(_0x27affc,_0x27dfa3){return db[_0x0466('0x15')][_0x0466('0x16')](_0x4a4828[_0x0466('0x17')],{'raw':_0x4a4828[_0x0466('0x18')]?_0x4a4828[_0x0466('0x18')][_0x0466('0x19')]===undefined?!![]:![]:!![]})[_0x0466('0xb')](function(_0x222ead){logger['info'](_0x0466('0x14'),_0x4a4828);logger[_0x0466('0x1a')](_0x0466('0x14'),_0x4a4828,JSON[_0x0466('0xf')](_0x222ead));_0x27affc(_0x222ead);})[_0x0466('0x13')](function(_0xe45343){logger[_0x0466('0x10')](_0x0466('0x14'),_0xe45343['message'],_0x4a4828);_0x27dfa3(_0xcfd846[_0x0466('0x10')](0x1f4,_0xe45343[_0x0466('0x12')]));});});};
\ No newline at end of file
diff --git a/server/api/rpc/index.js b/server/api/rpc/index.js
index 8412968..4e571a5 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 _0x1cfc=['chatQueues','/mail/queues','mailQueues','/mail/accounts','openchannelQueues','/sms/queues','smsQueues','/fax/queues','faxQueues','voiceQueuesChannels','/voice/queues/channels/:uniqueid','voiceQueuesChannel','/voice/queues/channels/:uniqueid/hangup','/voice/queues/channels/:uniqueid/redirect/:exten','voiceQueuesChannelRedirect','/voice/queues/:id','showVoiceQueues','outbound','/outbound/channels','/agents','agents','put','agentCapacity','/telephones','telephones','trunks','campaigns','/fax/accounts','faxAccounts','/chat/queues/waitinginteractions','chatQueuesWaitingInteractions','/mail/queues/waitinginteractions','mailQueuesWaitingInteractions','openchannelQueuesWaitingInteractions','/sms/queues/waitinginteractions','smsQueuesWaitingInteractions','/fax/queues/waitinginteractions','faxQueuesWaitingInteractions','/mail/queues/:id/notify','queueNotify','mail','/mail/queues/:id','showMailQueues','post','chat','/chat/queues/:id','showChatQueues','/fax/queues/:id/notify','fax','/fax/queues/:id','showFaxQueues','/openchannel/queues/:id/notify','openchannel','showOpenchannelQueues','sms','showSmsQueues','/agents/:id/notify','exports','multer','util','path','express','Router','../../components/auth/service','./rpc.controller','get','/voice/channels','isAuthenticated','voiceChannels','/voice/channels/:uniqueid/mixmonitor','voiceChannelMixMonitor','/voice/channels/:uniqueid/stopmixmonitor','voiceChannelStopMixMonitor','/voice/queues','/chat/queues'];(function(_0xc4376d,_0x2e6841){var _0x291524=function(_0x235c70){while(--_0x235c70){_0xc4376d['push'](_0xc4376d['shift']());}};_0x291524(++_0x2e6841);}(_0x1cfc,0x85));var _0xc1cf=function(_0x46c9bb,_0x258e59){_0x46c9bb=_0x46c9bb-0x0;var _0x47f189=_0x1cfc[_0x46c9bb];return _0x47f189;};'use strict';var multer=require(_0xc1cf('0x0'));var util=require(_0xc1cf('0x1'));var path=require(_0xc1cf('0x2'));var express=require(_0xc1cf('0x3'));var router=express[_0xc1cf('0x4')]();var auth=require(_0xc1cf('0x5'));var controller=require(_0xc1cf('0x6'));router[_0xc1cf('0x7')](_0xc1cf('0x8'),auth[_0xc1cf('0x9')](),controller[_0xc1cf('0xa')]);router[_0xc1cf('0x7')](_0xc1cf('0xb'),auth['isAuthenticated'](),controller[_0xc1cf('0xc')]);router['get'](_0xc1cf('0xd'),auth[_0xc1cf('0x9')](),controller[_0xc1cf('0xe')]);router['get'](_0xc1cf('0xf'),auth[_0xc1cf('0x9')](),controller['voiceQueues']);router[_0xc1cf('0x7')](_0xc1cf('0x10'),auth['isAuthenticated'](),controller[_0xc1cf('0x11')]);router[_0xc1cf('0x7')](_0xc1cf('0x12'),auth[_0xc1cf('0x9')](),controller[_0xc1cf('0x13')]);router[_0xc1cf('0x7')](_0xc1cf('0x14'),auth[_0xc1cf('0x9')](),controller['mailAccounts']);router[_0xc1cf('0x7')]('/openchannel/queues',auth[_0xc1cf('0x9')](),controller[_0xc1cf('0x15')]);router[_0xc1cf('0x7')](_0xc1cf('0x16'),auth['isAuthenticated'](),controller[_0xc1cf('0x17')]);router[_0xc1cf('0x7')](_0xc1cf('0x18'),auth[_0xc1cf('0x9')](),controller[_0xc1cf('0x19')]);router[_0xc1cf('0x7')]('/voice/queues/preview/:id',auth['isAuthenticated'](),controller['voiceQueuesPreview']);router[_0xc1cf('0x7')]('/voice/queues/channels',auth[_0xc1cf('0x9')](),controller[_0xc1cf('0x1a')]);router['get'](_0xc1cf('0x1b'),auth[_0xc1cf('0x9')](),controller[_0xc1cf('0x1c')]);router[_0xc1cf('0x7')](_0xc1cf('0x1d'),auth[_0xc1cf('0x9')](),controller['voiceQueuesChannelHangup']);router[_0xc1cf('0x7')](_0xc1cf('0x1e'),auth[_0xc1cf('0x9')](),controller[_0xc1cf('0x1f')]);router[_0xc1cf('0x7')](_0xc1cf('0x20'),auth[_0xc1cf('0x9')](),controller[_0xc1cf('0x21')]);router[_0xc1cf('0x7')]('/outbound',auth[_0xc1cf('0x9')](),controller[_0xc1cf('0x22')]);router[_0xc1cf('0x7')](_0xc1cf('0x23'),auth['isAuthenticated'](),controller['outboundChannels']);router[_0xc1cf('0x7')](_0xc1cf('0x24'),auth['isAuthenticated'](),controller[_0xc1cf('0x25')]);router[_0xc1cf('0x26')]('/agents/:id/capacity',auth[_0xc1cf('0x9')](),controller[_0xc1cf('0x27')]);router['get'](_0xc1cf('0x28'),auth[_0xc1cf('0x9')](),controller[_0xc1cf('0x29')]);router[_0xc1cf('0x7')]('/trunks',auth[_0xc1cf('0x9')](),controller[_0xc1cf('0x2a')]);router[_0xc1cf('0x7')]('/campaigns',auth[_0xc1cf('0x9')](),controller[_0xc1cf('0x2b')]);router[_0xc1cf('0x7')](_0xc1cf('0x2c'),auth['isAuthenticated'](),controller[_0xc1cf('0x2d')]);router['get'](_0xc1cf('0x2e'),auth[_0xc1cf('0x9')](),controller[_0xc1cf('0x2f')]);router[_0xc1cf('0x7')](_0xc1cf('0x30'),auth[_0xc1cf('0x9')](),controller[_0xc1cf('0x31')]);router[_0xc1cf('0x7')]('/openchannel/queues/waitinginteractions',auth[_0xc1cf('0x9')](),controller[_0xc1cf('0x32')]);router['get'](_0xc1cf('0x33'),auth[_0xc1cf('0x9')](),controller[_0xc1cf('0x34')]);router[_0xc1cf('0x7')](_0xc1cf('0x35'),auth[_0xc1cf('0x9')](),controller[_0xc1cf('0x36')]);router['post'](_0xc1cf('0x37'),auth[_0xc1cf('0x9')](),controller[_0xc1cf('0x38')](_0xc1cf('0x39')));router[_0xc1cf('0x7')](_0xc1cf('0x3a'),auth[_0xc1cf('0x9')](),controller[_0xc1cf('0x3b')]);router[_0xc1cf('0x3c')]('/chat/queues/:id/notify',auth['isAuthenticated'](),controller[_0xc1cf('0x38')](_0xc1cf('0x3d')));router[_0xc1cf('0x7')](_0xc1cf('0x3e'),auth['isAuthenticated'](),controller[_0xc1cf('0x3f')]);router[_0xc1cf('0x3c')](_0xc1cf('0x40'),auth[_0xc1cf('0x9')](),controller[_0xc1cf('0x38')](_0xc1cf('0x41')));router[_0xc1cf('0x7')](_0xc1cf('0x42'),auth[_0xc1cf('0x9')](),controller[_0xc1cf('0x43')]);router['post'](_0xc1cf('0x44'),auth[_0xc1cf('0x9')](),controller[_0xc1cf('0x38')](_0xc1cf('0x45')));router[_0xc1cf('0x7')]('/openchannel/queues/:id',auth[_0xc1cf('0x9')](),controller[_0xc1cf('0x46')]);router[_0xc1cf('0x3c')]('/sms/queues/:id/notify',auth[_0xc1cf('0x9')](),controller[_0xc1cf('0x38')](_0xc1cf('0x47')));router['get']('/sms/queues/:id',auth['isAuthenticated'](),controller[_0xc1cf('0x48')]);router['post'](_0xc1cf('0x49'),auth[_0xc1cf('0x9')](),controller['agentNotify']);module[_0xc1cf('0x4a')]=router;
\ No newline at end of file
+var _0x1c22=['fax','/fax/queues/:id','showFaxQueues','/openchannel/queues/:id/notify','openchannel','showOpenchannelQueues','/sms/queues/:id/notify','sms','/agents/:id/notify','exports','util','path','express','Router','../../components/auth/service','./rpc.controller','get','/voice/channels','isAuthenticated','voiceChannels','/voice/channels/:uniqueid/mixmonitor','/voice/channels/:uniqueid/stopmixmonitor','/voice/queues','/chat/queues','chatQueues','/mail/queues','mailAccounts','/openchannel/queues','/sms/queues','smsQueues','/fax/queues','faxQueues','/voice/queues/preview/:id','voiceQueuesPreview','/voice/queues/channels','voiceQueuesChannels','/voice/queues/channels/:uniqueid','voiceQueuesChannel','/voice/queues/channels/:uniqueid/hangup','voiceQueuesChannelHangup','/voice/queues/channels/:uniqueid/redirect/:exten','/voice/queues/:id','showVoiceQueues','/outbound','outbound','outboundChannels','put','/agents/:id/capacity','agentCapacity','/telephones','telephones','trunks','/campaigns','chatQueuesWaitingInteractions','mailQueuesWaitingInteractions','/openchannel/queues/waitinginteractions','openchannelQueuesWaitingInteractions','/sms/queues/waitinginteractions','smsQueuesWaitingInteractions','/fax/queues/waitinginteractions','/mail/queues/:id/notify','queueNotify','mail','/mail/queues/:id','showMailQueues','post','/chat/queues/:id/notify','showChatQueues','/fax/queues/:id/notify'];(function(_0x44567b,_0x129b1e){var _0x281110=function(_0x3140af){while(--_0x3140af){_0x44567b['push'](_0x44567b['shift']());}};_0x281110(++_0x129b1e);}(_0x1c22,0x1ed));var _0x21c2=function(_0x5b5027,_0x19faec){_0x5b5027=_0x5b5027-0x0;var _0x17fb7d=_0x1c22[_0x5b5027];return _0x17fb7d;};'use strict';var multer=require('multer');var util=require(_0x21c2('0x0'));var path=require(_0x21c2('0x1'));var express=require(_0x21c2('0x2'));var router=express[_0x21c2('0x3')]();var auth=require(_0x21c2('0x4'));var controller=require(_0x21c2('0x5'));router[_0x21c2('0x6')](_0x21c2('0x7'),auth[_0x21c2('0x8')](),controller[_0x21c2('0x9')]);router[_0x21c2('0x6')](_0x21c2('0xa'),auth[_0x21c2('0x8')](),controller['voiceChannelMixMonitor']);router['get'](_0x21c2('0xb'),auth[_0x21c2('0x8')](),controller['voiceChannelStopMixMonitor']);router[_0x21c2('0x6')](_0x21c2('0xc'),auth[_0x21c2('0x8')](),controller['voiceQueues']);router[_0x21c2('0x6')](_0x21c2('0xd'),auth[_0x21c2('0x8')](),controller[_0x21c2('0xe')]);router[_0x21c2('0x6')](_0x21c2('0xf'),auth[_0x21c2('0x8')](),controller['mailQueues']);router['get']('/mail/accounts',auth['isAuthenticated'](),controller[_0x21c2('0x10')]);router[_0x21c2('0x6')](_0x21c2('0x11'),auth[_0x21c2('0x8')](),controller['openchannelQueues']);router[_0x21c2('0x6')](_0x21c2('0x12'),auth[_0x21c2('0x8')](),controller[_0x21c2('0x13')]);router[_0x21c2('0x6')](_0x21c2('0x14'),auth[_0x21c2('0x8')](),controller[_0x21c2('0x15')]);router[_0x21c2('0x6')](_0x21c2('0x16'),auth[_0x21c2('0x8')](),controller[_0x21c2('0x17')]);router[_0x21c2('0x6')](_0x21c2('0x18'),auth['isAuthenticated'](),controller[_0x21c2('0x19')]);router[_0x21c2('0x6')](_0x21c2('0x1a'),auth[_0x21c2('0x8')](),controller[_0x21c2('0x1b')]);router[_0x21c2('0x6')](_0x21c2('0x1c'),auth[_0x21c2('0x8')](),controller[_0x21c2('0x1d')]);router[_0x21c2('0x6')](_0x21c2('0x1e'),auth[_0x21c2('0x8')](),controller['voiceQueuesChannelRedirect']);router[_0x21c2('0x6')](_0x21c2('0x1f'),auth[_0x21c2('0x8')](),controller[_0x21c2('0x20')]);router['get'](_0x21c2('0x21'),auth[_0x21c2('0x8')](),controller[_0x21c2('0x22')]);router[_0x21c2('0x6')]('/outbound/channels',auth[_0x21c2('0x8')](),controller[_0x21c2('0x23')]);router[_0x21c2('0x6')]('/agents',auth[_0x21c2('0x8')](),controller['agents']);router[_0x21c2('0x24')](_0x21c2('0x25'),auth['isAuthenticated'](),controller[_0x21c2('0x26')]);router[_0x21c2('0x6')](_0x21c2('0x27'),auth[_0x21c2('0x8')](),controller[_0x21c2('0x28')]);router[_0x21c2('0x6')]('/trunks',auth['isAuthenticated'](),controller[_0x21c2('0x29')]);router[_0x21c2('0x6')](_0x21c2('0x2a'),auth[_0x21c2('0x8')](),controller['campaigns']);router[_0x21c2('0x6')]('/fax/accounts',auth['isAuthenticated'](),controller['faxAccounts']);router['get']('/chat/queues/waitinginteractions',auth[_0x21c2('0x8')](),controller[_0x21c2('0x2b')]);router[_0x21c2('0x6')]('/mail/queues/waitinginteractions',auth['isAuthenticated'](),controller[_0x21c2('0x2c')]);router[_0x21c2('0x6')](_0x21c2('0x2d'),auth['isAuthenticated'](),controller[_0x21c2('0x2e')]);router[_0x21c2('0x6')](_0x21c2('0x2f'),auth[_0x21c2('0x8')](),controller[_0x21c2('0x30')]);router[_0x21c2('0x6')](_0x21c2('0x31'),auth[_0x21c2('0x8')](),controller['faxQueuesWaitingInteractions']);router['post'](_0x21c2('0x32'),auth[_0x21c2('0x8')](),controller[_0x21c2('0x33')](_0x21c2('0x34')));router[_0x21c2('0x6')](_0x21c2('0x35'),auth[_0x21c2('0x8')](),controller[_0x21c2('0x36')]);router[_0x21c2('0x37')](_0x21c2('0x38'),auth[_0x21c2('0x8')](),controller[_0x21c2('0x33')]('chat'));router[_0x21c2('0x6')]('/chat/queues/:id',auth['isAuthenticated'](),controller[_0x21c2('0x39')]);router[_0x21c2('0x37')](_0x21c2('0x3a'),auth[_0x21c2('0x8')](),controller['queueNotify'](_0x21c2('0x3b')));router['get'](_0x21c2('0x3c'),auth['isAuthenticated'](),controller[_0x21c2('0x3d')]);router[_0x21c2('0x37')](_0x21c2('0x3e'),auth['isAuthenticated'](),controller['queueNotify'](_0x21c2('0x3f')));router[_0x21c2('0x6')]('/openchannel/queues/:id',auth[_0x21c2('0x8')](),controller[_0x21c2('0x40')]);router[_0x21c2('0x37')](_0x21c2('0x41'),auth['isAuthenticated'](),controller[_0x21c2('0x33')](_0x21c2('0x42')));router[_0x21c2('0x6')]('/sms/queues/:id',auth['isAuthenticated'](),controller['showSmsQueues']);router['post'](_0x21c2('0x43'),auth['isAuthenticated'](),controller['agentNotify']);module[_0x21c2('0x44')]=router;
\ No newline at end of file
diff --git a/server/api/rpc/rpc.controller.js b/server/api/rpc/rpc.controller.js
index 59f1ff5..d89b67c 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 _0x4774=['channel','Channel\x20field\x20is\x20mandatory','Website','Agent\x20not\x20found','update','From','agentTransferTimeout','bluebird','moment','util','../../mysqldb','../../config/logger','api','jayson/promise','client','http','request','error','code','result','catch','status','sendStatus','name','isNil','rows','voiceChannels','then','voiceChannelMixMonitor','VoiceChannelMixMonitor','merge','params','query','voiceQueues','VoiceQueues','voiceQueuesPreview','VoiceQueuesPreview','voiceQueuesChannels','VoiceQueuesChannels','voiceQueuesChannel','VoiceQueuesChannel','voiceQueuesChannelHangup','VoiceQueuesChannelHangup','voiceQueuesChannelRedirect','VoiceQueuesChannelRedirect','Outbound','outboundChannels','agents','Agents','agentCapacity','body','interaction','user','hasOwnProperty','MemberReport','findAll','length','format','YYYY-MM-DD\x20HH:mm:ss','updateAttributes','INTERACTION','interface','SIP/%s','agent','internal','AgentCapacity','capacity','telephones','trunks','Trunks','Campaigns','chatQueues','ChatQueues','showChatQueues','showMailQueues','MailQueues','mailAccounts','MailAccounts','openchannelQueues','OpenchannelQueues','showOpenchannelQueues','SmsQueues','showSmsQueues','faxQueues','FaxQueues','showFaxQueues','faxAccounts','chatQueuesWaitingInteractions','MailQueuesWaitingInteractions','openchannelQueuesWaitingInteractions','smsQueuesWaitingInteractions','SmsQueuesWaitingInteractions','faxQueuesWaitingInteractions','FaxQueuesWaitingInteractions','queueNotify','chat','Account','Queue','findOne','\x20Queue\x20not\x20found','Message','messageId','Interaction','\x20Message\x20not\x20found','queue','MessageId','InteractionId','QueueId','TransferReport','create','Start','queueTransferTimeout','*,*,*,*'];(function(_0x4fcb9d,_0x5c01be){var _0x30101c=function(_0x19ca27){while(--_0x19ca27){_0x4fcb9d['push'](_0x4fcb9d['shift']());}};_0x30101c(++_0x5c01be);}(_0x4774,0xe9));var _0x4477=function(_0x1126e0,_0x4d9753){_0x1126e0=_0x1126e0-0x0;var _0x18e436=_0x4774[_0x1126e0];return _0x18e436;};'use strict';var BPromise=require(_0x4477('0x0'));var moment=require(_0x4477('0x1'));var _=require('lodash');var util=require(_0x4477('0x2'));var db=require(_0x4477('0x3'))['db'];var logger=require(_0x4477('0x4'))(_0x4477('0x5'));var jayson=require(_0x4477('0x6'));var amiClient=jayson[_0x4477('0x7')][_0x4477('0x8')]({'port':0x232a});var mailClient=jayson[_0x4477('0x7')][_0x4477('0x8')]({'port':0x232b});var routingClient=jayson[_0x4477('0x7')][_0x4477('0x8')]({'port':0x232c});function respondWithRpcPromise(_0x362076,_0x2bd580,_0x385285){return new BPromise(function(_0x12d467,_0x17777b){var _0xc7bf2b=_0x385285?_0x385285:amiClient;return _0xc7bf2b[_0x4477('0x9')](_0x362076,_0x2bd580)['then'](function(_0x481651){if(_0x481651['error']){if(_0x481651[_0x4477('0xa')][_0x4477('0xb')]===0x1f4){return _0x17777b(_0x481651[_0x4477('0xa')]['message']);}return _0x12d467(_0x481651[_0x4477('0xa')]['message']);}else{_0x12d467(_0x481651[_0x4477('0xc')]);}})[_0x4477('0xd')](function(_0x2140f9){_0x17777b(_0x2140f9);});});}function respondWithResult(_0xec7a1c,_0x21ee70){_0x21ee70=_0x21ee70||0xc8;return function(_0x2aa6d0){if(_0x2aa6d0){return _0xec7a1c[_0x4477('0xe')](_0x21ee70)['json'](_0x2aa6d0);}return _0xec7a1c[_0x4477('0xf')](0x194);};}function handleError(_0x33267e,_0x1fc3d5){_0x1fc3d5=_0x1fc3d5||0x1f4;return function(_0x552d66){logger['error'](_0x552d66['stack']);if(_0x552d66[_0x4477('0x10')]){delete _0x552d66['name'];}_0x33267e[_0x4477('0xe')](_0x1fc3d5)['send'](_0x552d66);};}function findById(_0x4bc364){return function(_0x9eb658){if(!_[_0x4477('0x11')](_0x4bc364)&&!_[_0x4477('0x11')](_0x9eb658)&&!_[_0x4477('0x11')](_0x9eb658[_0x4477('0x12')])){return _['find'](_0x9eb658['rows'],function(_0x5c0d7c){return _0x5c0d7c['id']==_0x4bc364;});}return null;};}exports[_0x4477('0x13')]=function(_0x1e0c2d,_0x52a537){return respondWithRpcPromise('VoiceChannels',_0x1e0c2d['query'])[_0x4477('0x14')](respondWithResult(_0x52a537,null))['catch'](handleError(_0x52a537,null));};exports[_0x4477('0x15')]=function(_0x47bfab,_0x4af9be){return respondWithRpcPromise(_0x4477('0x16'),_[_0x4477('0x17')](_0x47bfab['query'],_0x47bfab[_0x4477('0x18')]))[_0x4477('0x14')](respondWithResult(_0x4af9be,null))[_0x4477('0xd')](handleError(_0x4af9be,null));};exports['voiceChannelStopMixMonitor']=function(_0x31a9a3,_0x2f2d66){return respondWithRpcPromise('VoiceChannelStopMixMonitor',_['merge'](_0x31a9a3[_0x4477('0x19')],_0x31a9a3[_0x4477('0x18')]))[_0x4477('0x14')](respondWithResult(_0x2f2d66,null))['catch'](handleError(_0x2f2d66,null));};exports[_0x4477('0x1a')]=function(_0x184ade,_0x47eedb){return respondWithRpcPromise('VoiceQueues',_0x184ade[_0x4477('0x19')])[_0x4477('0x14')](respondWithResult(_0x47eedb,null))[_0x4477('0xd')](handleError(_0x47eedb,null));};exports['showVoiceQueues']=function(_0x5104a7,_0x1576da){return respondWithRpcPromise(_0x4477('0x1b'),_0x5104a7[_0x4477('0x19')])['then'](findById(_0x5104a7['params']['id']))[_0x4477('0x14')](respondWithResult(_0x1576da,null))[_0x4477('0xd')](handleError(_0x1576da,null));};exports[_0x4477('0x1c')]=function(_0x365fec,_0x5e543c){return respondWithRpcPromise(_0x4477('0x1d'),_[_0x4477('0x17')](_0x365fec['query'],_0x365fec[_0x4477('0x18')]))['then'](respondWithResult(_0x5e543c,null))[_0x4477('0xd')](handleError(_0x5e543c,null));};exports[_0x4477('0x1e')]=function(_0x2f9233,_0x4b2925){return respondWithRpcPromise(_0x4477('0x1f'),_0x2f9233[_0x4477('0x19')])['then'](respondWithResult(_0x4b2925,null))[_0x4477('0xd')](handleError(_0x4b2925,null));};exports[_0x4477('0x20')]=function(_0x879cf0,_0x582e3){return respondWithRpcPromise(_0x4477('0x21'),_[_0x4477('0x17')](_0x879cf0[_0x4477('0x19')],_0x879cf0[_0x4477('0x18')]))[_0x4477('0x14')](respondWithResult(_0x582e3,null))[_0x4477('0xd')](handleError(_0x582e3,null));};exports[_0x4477('0x22')]=function(_0x3de111,_0x13ffa8){return respondWithRpcPromise(_0x4477('0x23'),_[_0x4477('0x17')](_0x3de111[_0x4477('0x19')],_0x3de111[_0x4477('0x18')]))[_0x4477('0x14')](respondWithResult(_0x13ffa8,null))[_0x4477('0xd')](handleError(_0x13ffa8,null));};exports[_0x4477('0x24')]=function(_0x26f758,_0x44eb29){return respondWithRpcPromise(_0x4477('0x25'),_[_0x4477('0x17')](_0x26f758[_0x4477('0x19')],_0x26f758[_0x4477('0x18')]))['then'](respondWithResult(_0x44eb29,null))[_0x4477('0xd')](handleError(_0x44eb29,null));};exports['outbound']=function(_0x16ebf8,_0x32f1cd){return respondWithRpcPromise(_0x4477('0x26'),_0x16ebf8[_0x4477('0x19')])[_0x4477('0x14')](respondWithResult(_0x32f1cd,null))[_0x4477('0xd')](handleError(_0x32f1cd,null));};exports[_0x4477('0x27')]=function(_0x467d12,_0x4524de){return respondWithRpcPromise('OutboundChannels',_0x467d12[_0x4477('0x19')])['then'](respondWithResult(_0x4524de,null))[_0x4477('0xd')](handleError(_0x4524de,null));};exports[_0x4477('0x28')]=function(_0x19db95,_0x2da919){var _0x9233e8;return respondWithRpcPromise('Agents',_0x19db95[_0x4477('0x19')])[_0x4477('0x14')](function(_0x8d6b87){_0x9233e8=_0x8d6b87;return respondWithRpcPromise(_0x4477('0x29'),_0x19db95[_0x4477('0x19')],routingClient);})['then'](function(_0x2c924e){return _[_0x4477('0x17')]({},_0x2c924e,_0x9233e8);})[_0x4477('0x14')](respondWithResult(_0x2da919,null))[_0x4477('0xd')](handleError(_0x2da919,null));};exports[_0x4477('0x2a')]=function(_0x40a4e6,_0x56c27b){if(_0x40a4e6[_0x4477('0x2b')]&&_0x40a4e6['body'][_0x4477('0x2c')]&&_0x40a4e6[_0x4477('0x2d')]&&_0x40a4e6[_0x4477('0x2d')]['name']){for(var _0x1a7c60 in _0x40a4e6[_0x4477('0x2b')][_0x4477('0x2c')]){if(_0x40a4e6[_0x4477('0x2b')][_0x4477('0x2c')][_0x4477('0x2e')](_0x1a7c60)){db[_0x4477('0x2f')][_0x4477('0x30')]({'where':{'channel':_0x1a7c60,'membername':_0x40a4e6[_0x4477('0x2d')]['name'],'type':'INTERACTION','exitAt':null,'uniqueid':_0x40a4e6[_0x4477('0x2b')][_0x4477('0x2c')][_0x1a7c60]&&_0x40a4e6[_0x4477('0x2b')][_0x4477('0x2c')][_0x1a7c60][_0x4477('0x31')]?{'$notIn':_0x40a4e6['body']['interaction'][_0x1a7c60]}:{'$ne':null}}})[_0x4477('0x14')](function(_0x50900c){var _0x125a0d=moment()[_0x4477('0x32')](_0x4477('0x33'));for(var _0x2cff52=0x0,_0x5d6a65=_0x50900c[_0x4477('0x31')];_0x2cff52<_0x5d6a65;_0x2cff52+=0x1){_0x50900c[_0x2cff52][_0x4477('0x34')]({'exitAt':_0x125a0d});}});for(var _0x475345=0x0;_0x475345<_0x40a4e6[_0x4477('0x2b')][_0x4477('0x2c')][_0x1a7c60]['length'];_0x475345+=0x1){db[_0x4477('0x2f')]['findOrCreate']({'where':{'channel':_0x1a7c60,'membername':_0x40a4e6[_0x4477('0x2d')]['name'],'type':_0x4477('0x35'),'uniqueid':_0x40a4e6['body'][_0x4477('0x2c')][_0x1a7c60][_0x475345],'exitAt':null},'defaults':{'channel':_0x1a7c60,'membername':_0x40a4e6[_0x4477('0x2d')]['name'],'interface':_[_0x4477('0x11')](_0x40a4e6[_0x4477('0x2d')][_0x4477('0x36')])?util[_0x4477('0x32')](_0x4477('0x37'),_0x40a4e6['user']['name']):_0x40a4e6[_0x4477('0x2d')][_0x4477('0x36')],'type':_0x4477('0x35'),'enterAt':moment()[_0x4477('0x32')](_0x4477('0x33')),'role':_0x4477('0x38'),'internal':_0x40a4e6[_0x4477('0x2d')][_0x4477('0x39')],'uniqueid':_0x40a4e6[_0x4477('0x2b')][_0x4477('0x2c')][_0x1a7c60][_0x475345]}});}}}}return respondWithRpcPromise(_0x4477('0x3a'),{'id':_0x40a4e6[_0x4477('0x18')]['id'],'capacity':_0x40a4e6[_0x4477('0x2b')][_0x4477('0x3b')]},routingClient)[_0x4477('0x14')](respondWithResult(_0x56c27b,null))[_0x4477('0xd')](handleError(_0x56c27b,null));};exports[_0x4477('0x3c')]=function(_0x4dd99b,_0x10d6bd){return respondWithRpcPromise('Telephones',_0x4dd99b[_0x4477('0x19')])[_0x4477('0x14')](respondWithResult(_0x10d6bd,null))['catch'](handleError(_0x10d6bd,null));};exports[_0x4477('0x3d')]=function(_0x3a654a,_0x222982){return respondWithRpcPromise(_0x4477('0x3e'),_0x3a654a[_0x4477('0x19')])[_0x4477('0x14')](respondWithResult(_0x222982,null))[_0x4477('0xd')](handleError(_0x222982,null));};exports['campaigns']=function(_0x45895c,_0x32982b){return respondWithRpcPromise(_0x4477('0x3f'),_0x45895c['query'])[_0x4477('0x14')](respondWithResult(_0x32982b,null))[_0x4477('0xd')](handleError(_0x32982b,null));};exports[_0x4477('0x40')]=function(_0x58db7b,_0x281978){return respondWithRpcPromise(_0x4477('0x41'),_0x58db7b[_0x4477('0x19')],routingClient)[_0x4477('0x14')](respondWithResult(_0x281978,null))[_0x4477('0xd')](handleError(_0x281978,null));};exports[_0x4477('0x42')]=function(_0x57f5e5,_0x43428e){return respondWithRpcPromise(_0x4477('0x41'),_0x57f5e5[_0x4477('0x19')],routingClient)[_0x4477('0x14')](findById(_0x57f5e5[_0x4477('0x18')]['id']))['then'](respondWithResult(_0x43428e,null))[_0x4477('0xd')](handleError(_0x43428e,null));};exports['mailQueues']=function(_0x25ef5f,_0x25393b){return respondWithRpcPromise('MailQueues',_0x25ef5f[_0x4477('0x19')],routingClient)[_0x4477('0x14')](respondWithResult(_0x25393b,null))[_0x4477('0xd')](handleError(_0x25393b,null));};exports[_0x4477('0x43')]=function(_0x60597d,_0x3d0817){return respondWithRpcPromise(_0x4477('0x44'),_0x60597d[_0x4477('0x19')],routingClient)[_0x4477('0x14')](findById(_0x60597d['params']['id']))['then'](respondWithResult(_0x3d0817,null))[_0x4477('0xd')](handleError(_0x3d0817,null));};exports[_0x4477('0x45')]=function(_0x4ecb4c,_0x5d2320){return respondWithRpcPromise(_0x4477('0x46'),_0x4ecb4c[_0x4477('0x19')],mailClient)[_0x4477('0x14')](respondWithResult(_0x5d2320,null))['catch'](handleError(_0x5d2320,null));};exports[_0x4477('0x47')]=function(_0x513422,_0xd24229){return respondWithRpcPromise(_0x4477('0x48'),_0x513422[_0x4477('0x19')],routingClient)[_0x4477('0x14')](respondWithResult(_0xd24229,null))[_0x4477('0xd')](handleError(_0xd24229,null));};exports[_0x4477('0x49')]=function(_0xd38b32,_0x524dd4){return respondWithRpcPromise(_0x4477('0x48'),_0xd38b32[_0x4477('0x19')],routingClient)['then'](findById(_0xd38b32[_0x4477('0x18')]['id']))[_0x4477('0x14')](respondWithResult(_0x524dd4,null))['catch'](handleError(_0x524dd4,null));};exports['smsQueues']=function(_0x27dee7,_0x262576){return respondWithRpcPromise(_0x4477('0x4a'),_0x27dee7[_0x4477('0x19')],routingClient)[_0x4477('0x14')](respondWithResult(_0x262576,null))[_0x4477('0xd')](handleError(_0x262576,null));};exports[_0x4477('0x4b')]=function(_0x5e6aa5,_0xc5a979){return respondWithRpcPromise(_0x4477('0x4a'),_0x5e6aa5[_0x4477('0x19')],routingClient)[_0x4477('0x14')](findById(_0x5e6aa5[_0x4477('0x18')]['id']))[_0x4477('0x14')](respondWithResult(_0xc5a979,null))['catch'](handleError(_0xc5a979,null));};exports[_0x4477('0x4c')]=function(_0x1c32a5,_0x17b8d5){return respondWithRpcPromise(_0x4477('0x4d'),_0x1c32a5[_0x4477('0x19')],routingClient)[_0x4477('0x14')](respondWithResult(_0x17b8d5,null))['catch'](handleError(_0x17b8d5,null));};exports[_0x4477('0x4e')]=function(_0x8562fd,_0x1cd6ef){return respondWithRpcPromise(_0x4477('0x4d'),_0x8562fd[_0x4477('0x19')],routingClient)['then'](findById(_0x8562fd[_0x4477('0x18')]['id']))[_0x4477('0x14')](respondWithResult(_0x1cd6ef,null))[_0x4477('0xd')](handleError(_0x1cd6ef,null));};exports[_0x4477('0x4f')]=function(_0x26be4f,_0xcd180e){return respondWithRpcPromise('FaxAccounts',_0x26be4f[_0x4477('0x19')])[_0x4477('0x14')](respondWithResult(_0xcd180e,null))[_0x4477('0xd')](handleError(_0xcd180e,null));};exports[_0x4477('0x50')]=function(_0x58bf45,_0x5c707e){return respondWithRpcPromise('ChatQueuesWaitingInteractions',_0x58bf45[_0x4477('0x19')],routingClient)['then'](respondWithResult(_0x5c707e,null))[_0x4477('0xd')](handleError(_0x5c707e,null));};exports['mailQueuesWaitingInteractions']=function(_0x5704fd,_0x39eb31){return respondWithRpcPromise(_0x4477('0x51'),_0x5704fd[_0x4477('0x19')],routingClient)[_0x4477('0x14')](respondWithResult(_0x39eb31,null))[_0x4477('0xd')](handleError(_0x39eb31,null));};exports[_0x4477('0x52')]=function(_0x4320a8,_0x50c1e1){return respondWithRpcPromise('OpenchannelQueuesWaitingInteractions',_0x4320a8[_0x4477('0x19')],routingClient)[_0x4477('0x14')](respondWithResult(_0x50c1e1,null))['catch'](handleError(_0x50c1e1,null));};exports[_0x4477('0x53')]=function(_0x45a223,_0x27f5e6){return respondWithRpcPromise(_0x4477('0x54'),_0x45a223[_0x4477('0x19')],routingClient)[_0x4477('0x14')](respondWithResult(_0x27f5e6,null))['catch'](handleError(_0x27f5e6,null));};exports[_0x4477('0x55')]=function(_0x5c9125,_0x2c848d){return respondWithRpcPromise(_0x4477('0x56'),_0x5c9125[_0x4477('0x19')],routingClient)[_0x4477('0x14')](respondWithResult(_0x2c848d,null))['catch'](handleError(_0x2c848d,null));};exports[_0x4477('0x57')]=function(_0x22ef4d){return function(_0x40cc71,_0x3683bf){var _0xf65431,_0x264f24;var _0xd8c2e=_['capitalize'](_0x22ef4d);var _0x41e97d=_0x22ef4d===_0x4477('0x58')?'Website':_0x4477('0x59');return db[_0xd8c2e+_0x4477('0x5a')][_0x4477('0x5b')]({'raw':!![],'where':{'id':_0x40cc71['params']['id']}})[_0x4477('0x14')](function(_0x6522f4){if(_['isNil'](_0x6522f4)){throw new Error(_0xd8c2e+_0x4477('0x5c'));}_0xf65431=_0x6522f4;return db[_0xd8c2e+_0x4477('0x5d')][_0x4477('0x5b')]({'where':{'id':_0x40cc71['body'][_0x4477('0x5e')]},'include':[{'model':db[_0xd8c2e+_0x4477('0x5f')],'as':_0x4477('0x5f')},{'model':db[_0xd8c2e+_0x41e97d],'as':_0x4477('0x59')}]});})[_0x4477('0x14')](function(_0x65c6f1){if(_['isNil'](_0x65c6f1)){throw new Error(_0xd8c2e+_0x4477('0x60'));}_0x264f24=_0x65c6f1;return _0x65c6f1['update']({'read':0x0,'readAt':null,'UserId':null});})[_0x4477('0x14')](function(){var _0x1b59fc={'uniqueid':_0x22ef4d+'.'+_0x264f24['id']+'.'+_0x264f24[_0x4477('0x5f')]['id'],'FromUserId':_0x40cc71[_0x4477('0x2d')]['id'],'type':_0x4477('0x61')};_0x1b59fc[_0xd8c2e+_0x4477('0x62')]=_0x264f24['id'];_0x1b59fc[_0xd8c2e+_0x4477('0x63')]=_0x264f24[_0x4477('0x5f')]['id'];_0x1b59fc['From'+_0xd8c2e+_0x41e97d+'Id']=_0x264f24[_0x4477('0x59')]['id'];_0x1b59fc['To'+_0xd8c2e+_0x4477('0x64')]=_0xf65431['id'];return db[_0xd8c2e+_0x4477('0x65')][_0x4477('0x66')](_0x1b59fc);})[_0x4477('0x14')](function(){return respondWithRpcPromise(_0x4477('0x67'),{'channel':_0x22ef4d,'interaction':_0x264f24[_0x4477('0x5f')],'message':_0x264f24,'account':_0x264f24[_0x4477('0x59')],'applications':[{'id':0x0,'priority':0x1,'app':'queue','appdata':_0xf65431[_0x4477('0x10')]+','+(_0x264f24[_0x4477('0x59')][_0x4477('0x68')]||0x12c),'interval':_0x4477('0x69')}]},routingClient);})[_0x4477('0x14')](respondWithResult(_0x3683bf,null))[_0x4477('0xd')](handleError(_0x3683bf,null));};};exports['agentNotify']=function(_0x389530,_0x3839c9){var _0x380719,_0x2c41c5;if(_[_0x4477('0x11')](_0x389530[_0x4477('0x2b')][_0x4477('0x6a')])){throw new Error(_0x4477('0x6b'));}var _0x96f654=_0x389530[_0x4477('0x2b')][_0x4477('0x6a')];var _0x5ca8c5=_['capitalize'](_0x96f654);var _0x31a212=_0x96f654==='chat'?_0x4477('0x6c'):_0x4477('0x59');return db['User'][_0x4477('0x5b')]({'raw':!![],'where':{'id':_0x389530[_0x4477('0x18')]['id'],'role':_0x4477('0x38')}})['then'](function(_0x3f5e0b){if(_['isNil'](_0x3f5e0b)){throw new Error(_0x4477('0x6d'));}_0x380719=_0x3f5e0b;return db[_0x5ca8c5+_0x4477('0x5d')][_0x4477('0x5b')]({'where':{'id':_0x389530[_0x4477('0x2b')]['messageId']},'include':[{'model':db[_0x5ca8c5+_0x4477('0x5f')],'as':_0x4477('0x5f')},{'model':db[_0x5ca8c5+_0x31a212],'as':'Account'}]});})['then'](function(_0x41c4a1){if(_['isNil'](_0x41c4a1)){throw new Error(_0x5ca8c5+_0x4477('0x60'));}_0x2c41c5=_0x41c4a1;return _0x41c4a1[_0x4477('0x6e')]({'read':0x0,'readAt':null,'UserId':null});})[_0x4477('0x14')](function(){var _0x542239={'uniqueid':_0x96f654+'.'+_0x2c41c5['id']+'.'+_0x2c41c5[_0x4477('0x5f')]['id'],'FromUserId':_0x389530['user']['id'],'type':_0x4477('0x61'),'ToUserId':_0x380719['id']};_0x542239[_0x5ca8c5+'MessageId']=_0x2c41c5['id'];_0x542239[_0x5ca8c5+'InteractionId']=_0x2c41c5['Interaction']['id'];_0x542239[_0x4477('0x6f')+_0x5ca8c5+_0x31a212+'Id']=_0x2c41c5[_0x4477('0x59')]['id'];return db[_0x5ca8c5+_0x4477('0x65')]['create'](_0x542239);})[_0x4477('0x14')](function(){return respondWithRpcPromise('Start',{'channel':_0x96f654,'interaction':_0x2c41c5['Interaction'],'message':_0x2c41c5,'account':_0x2c41c5[_0x4477('0x59')],'applications':[{'id':0x0,'priority':0x1,'app':_0x4477('0x38'),'appdata':_0x380719[_0x4477('0x10')]+','+(_0x2c41c5[_0x4477('0x59')][_0x4477('0x70')]||0x12c),'interval':_0x4477('0x69')}]},routingClient);})[_0x4477('0x14')](respondWithResult(_0x3839c9,null))['catch'](handleError(_0x3839c9,null));};
\ No newline at end of file
+var _0xcc5e=['Campaigns','chatQueues','ChatQueues','showChatQueues','mailQueues','MailAccounts','OpenchannelQueues','showOpenchannelQueues','smsQueues','SmsQueues','faxQueues','showFaxQueues','FaxQueues','faxAccounts','FaxAccounts','chatQueuesWaitingInteractions','ChatQueuesWaitingInteractions','mailQueuesWaitingInteractions','MailQueuesWaitingInteractions','openchannelQueuesWaitingInteractions','smsQueuesWaitingInteractions','SmsQueuesWaitingInteractions','faxQueuesWaitingInteractions','FaxQueuesWaitingInteractions','queueNotify','Website','Account','\x20Queue\x20not\x20found','messageId','Interaction','\x20Message\x20not\x20found','update','InteractionId','QueueId','TransferReport','create','Start','queueTransferTimeout','*,*,*,*','agentNotify','channel','capitalize','chat','User','findOne','agent','Agent\x20not\x20found','Message','queue','MessageId','From','agentTransferTimeout','moment','lodash','../../mysqldb','../../config/logger','api','jayson/promise','client','http','then','error','code','message','status','json','sendStatus','stack','name','send','isNil','rows','find','voiceChannels','VoiceChannels','query','catch','voiceChannelStopMixMonitor','VoiceChannelStopMixMonitor','params','VoiceQueues','VoiceQueuesPreview','merge','VoiceQueuesChannels','voiceQueuesChannel','VoiceQueuesChannel','voiceQueuesChannelHangup','VoiceQueuesChannelHangup','outbound','Outbound','outboundChannels','agents','Agents','agentCapacity','body','interaction','user','hasOwnProperty','MemberReport','findAll','length','format','YYYY-MM-DD\x20HH:mm:ss','updateAttributes','findOrCreate','INTERACTION','interface','SIP/%s','internal','capacity','Trunks'];(function(_0x593980,_0x24e0d9){var _0x2f2d0a=function(_0x17fda8){while(--_0x17fda8){_0x593980['push'](_0x593980['shift']());}};_0x2f2d0a(++_0x24e0d9);}(_0xcc5e,0x181));var _0xecc5=function(_0x2da230,_0x5a5dfc){_0x2da230=_0x2da230-0x0;var _0x3504a9=_0xcc5e[_0x2da230];return _0x3504a9;};'use strict';var BPromise=require('bluebird');var moment=require(_0xecc5('0x0'));var _=require(_0xecc5('0x1'));var util=require('util');var db=require(_0xecc5('0x2'))['db'];var logger=require(_0xecc5('0x3'))(_0xecc5('0x4'));var jayson=require(_0xecc5('0x5'));var amiClient=jayson[_0xecc5('0x6')]['http']({'port':0x232a});var mailClient=jayson[_0xecc5('0x6')][_0xecc5('0x7')]({'port':0x232b});var routingClient=jayson[_0xecc5('0x6')][_0xecc5('0x7')]({'port':0x232c});function respondWithRpcPromise(_0x13f2ca,_0x1ac053,_0x44fb2c){return new BPromise(function(_0x4ef694,_0x501691){var _0x5a8b6a=_0x44fb2c?_0x44fb2c:amiClient;return _0x5a8b6a['request'](_0x13f2ca,_0x1ac053)[_0xecc5('0x8')](function(_0x23d00a){if(_0x23d00a[_0xecc5('0x9')]){if(_0x23d00a[_0xecc5('0x9')][_0xecc5('0xa')]===0x1f4){return _0x501691(_0x23d00a['error']['message']);}return _0x4ef694(_0x23d00a['error'][_0xecc5('0xb')]);}else{_0x4ef694(_0x23d00a['result']);}})['catch'](function(_0x470cd3){_0x501691(_0x470cd3);});});}function respondWithResult(_0x2597c0,_0x240ea8){_0x240ea8=_0x240ea8||0xc8;return function(_0x5a777c){if(_0x5a777c){return _0x2597c0[_0xecc5('0xc')](_0x240ea8)[_0xecc5('0xd')](_0x5a777c);}return _0x2597c0[_0xecc5('0xe')](0x194);};}function handleError(_0x345156,_0x28dead){_0x28dead=_0x28dead||0x1f4;return function(_0x3c2618){logger[_0xecc5('0x9')](_0x3c2618[_0xecc5('0xf')]);if(_0x3c2618[_0xecc5('0x10')]){delete _0x3c2618[_0xecc5('0x10')];}_0x345156['status'](_0x28dead)[_0xecc5('0x11')](_0x3c2618);};}function findById(_0x45b72e){return function(_0x447c53){if(!_[_0xecc5('0x12')](_0x45b72e)&&!_[_0xecc5('0x12')](_0x447c53)&&!_['isNil'](_0x447c53[_0xecc5('0x13')])){return _[_0xecc5('0x14')](_0x447c53[_0xecc5('0x13')],function(_0x1bc835){return _0x1bc835['id']==_0x45b72e;});}return null;};}exports[_0xecc5('0x15')]=function(_0x440ab5,_0x46aa3a){return respondWithRpcPromise(_0xecc5('0x16'),_0x440ab5[_0xecc5('0x17')])[_0xecc5('0x8')](respondWithResult(_0x46aa3a,null))[_0xecc5('0x18')](handleError(_0x46aa3a,null));};exports['voiceChannelMixMonitor']=function(_0x2ab063,_0x2d0329){return respondWithRpcPromise('VoiceChannelMixMonitor',_['merge'](_0x2ab063[_0xecc5('0x17')],_0x2ab063['params']))[_0xecc5('0x8')](respondWithResult(_0x2d0329,null))[_0xecc5('0x18')](handleError(_0x2d0329,null));};exports[_0xecc5('0x19')]=function(_0x2b20c9,_0x2c68c2){return respondWithRpcPromise(_0xecc5('0x1a'),_['merge'](_0x2b20c9['query'],_0x2b20c9[_0xecc5('0x1b')]))[_0xecc5('0x8')](respondWithResult(_0x2c68c2,null))['catch'](handleError(_0x2c68c2,null));};exports['voiceQueues']=function(_0x3952b9,_0xe692f2){return respondWithRpcPromise(_0xecc5('0x1c'),_0x3952b9['query'])['then'](respondWithResult(_0xe692f2,null))['catch'](handleError(_0xe692f2,null));};exports['showVoiceQueues']=function(_0x5aa2d7,_0x12e899){return respondWithRpcPromise('VoiceQueues',_0x5aa2d7[_0xecc5('0x17')])[_0xecc5('0x8')](findById(_0x5aa2d7[_0xecc5('0x1b')]['id']))[_0xecc5('0x8')](respondWithResult(_0x12e899,null))['catch'](handleError(_0x12e899,null));};exports['voiceQueuesPreview']=function(_0x30a7b8,_0x206cef){return respondWithRpcPromise(_0xecc5('0x1d'),_[_0xecc5('0x1e')](_0x30a7b8[_0xecc5('0x17')],_0x30a7b8[_0xecc5('0x1b')]))[_0xecc5('0x8')](respondWithResult(_0x206cef,null))['catch'](handleError(_0x206cef,null));};exports['voiceQueuesChannels']=function(_0x3a66f3,_0xe286d0){return respondWithRpcPromise(_0xecc5('0x1f'),_0x3a66f3[_0xecc5('0x17')])[_0xecc5('0x8')](respondWithResult(_0xe286d0,null))[_0xecc5('0x18')](handleError(_0xe286d0,null));};exports[_0xecc5('0x20')]=function(_0x267957,_0x101463){return respondWithRpcPromise(_0xecc5('0x21'),_[_0xecc5('0x1e')](_0x267957[_0xecc5('0x17')],_0x267957[_0xecc5('0x1b')]))[_0xecc5('0x8')](respondWithResult(_0x101463,null))['catch'](handleError(_0x101463,null));};exports[_0xecc5('0x22')]=function(_0x4197f6,_0x3b4792){return respondWithRpcPromise(_0xecc5('0x23'),_['merge'](_0x4197f6[_0xecc5('0x17')],_0x4197f6[_0xecc5('0x1b')]))['then'](respondWithResult(_0x3b4792,null))['catch'](handleError(_0x3b4792,null));};exports['voiceQueuesChannelRedirect']=function(_0x376132,_0x27b50e){return respondWithRpcPromise('VoiceQueuesChannelRedirect',_[_0xecc5('0x1e')](_0x376132[_0xecc5('0x17')],_0x376132[_0xecc5('0x1b')]))[_0xecc5('0x8')](respondWithResult(_0x27b50e,null))[_0xecc5('0x18')](handleError(_0x27b50e,null));};exports[_0xecc5('0x24')]=function(_0x2f0472,_0x1a1b27){return respondWithRpcPromise(_0xecc5('0x25'),_0x2f0472[_0xecc5('0x17')])[_0xecc5('0x8')](respondWithResult(_0x1a1b27,null))[_0xecc5('0x18')](handleError(_0x1a1b27,null));};exports[_0xecc5('0x26')]=function(_0x528711,_0x2d15ff){return respondWithRpcPromise('OutboundChannels',_0x528711[_0xecc5('0x17')])['then'](respondWithResult(_0x2d15ff,null))['catch'](handleError(_0x2d15ff,null));};exports[_0xecc5('0x27')]=function(_0x2e787a,_0x15db54){var _0x350d5d;return respondWithRpcPromise(_0xecc5('0x28'),_0x2e787a[_0xecc5('0x17')])[_0xecc5('0x8')](function(_0x5d9668){_0x350d5d=_0x5d9668;return respondWithRpcPromise('Agents',_0x2e787a[_0xecc5('0x17')],routingClient);})[_0xecc5('0x8')](function(_0x46b031){return _[_0xecc5('0x1e')]({},_0x46b031,_0x350d5d);})[_0xecc5('0x8')](respondWithResult(_0x15db54,null))[_0xecc5('0x18')](handleError(_0x15db54,null));};exports[_0xecc5('0x29')]=function(_0xeb84a,_0x2f73f7){if(_0xeb84a[_0xecc5('0x2a')]&&_0xeb84a[_0xecc5('0x2a')][_0xecc5('0x2b')]&&_0xeb84a[_0xecc5('0x2c')]&&_0xeb84a[_0xecc5('0x2c')]['name']){for(var _0x236ddf in _0xeb84a[_0xecc5('0x2a')][_0xecc5('0x2b')]){if(_0xeb84a['body'][_0xecc5('0x2b')][_0xecc5('0x2d')](_0x236ddf)){db[_0xecc5('0x2e')][_0xecc5('0x2f')]({'where':{'channel':_0x236ddf,'membername':_0xeb84a['user'][_0xecc5('0x10')],'type':'INTERACTION','exitAt':null,'uniqueid':_0xeb84a[_0xecc5('0x2a')][_0xecc5('0x2b')][_0x236ddf]&&_0xeb84a[_0xecc5('0x2a')][_0xecc5('0x2b')][_0x236ddf][_0xecc5('0x30')]?{'$notIn':_0xeb84a[_0xecc5('0x2a')][_0xecc5('0x2b')][_0x236ddf]}:{'$ne':null}}})[_0xecc5('0x8')](function(_0x17f836){var _0x2c13ea=moment()[_0xecc5('0x31')](_0xecc5('0x32'));for(var _0x231582=0x0,_0x47ba75=_0x17f836[_0xecc5('0x30')];_0x231582<_0x47ba75;_0x231582+=0x1){_0x17f836[_0x231582][_0xecc5('0x33')]({'exitAt':_0x2c13ea});}});for(var _0x5386f3=0x0;_0x5386f3<_0xeb84a[_0xecc5('0x2a')][_0xecc5('0x2b')][_0x236ddf]['length'];_0x5386f3+=0x1){db[_0xecc5('0x2e')][_0xecc5('0x34')]({'where':{'channel':_0x236ddf,'membername':_0xeb84a['user']['name'],'type':_0xecc5('0x35'),'uniqueid':_0xeb84a[_0xecc5('0x2a')][_0xecc5('0x2b')][_0x236ddf][_0x5386f3],'exitAt':null},'defaults':{'channel':_0x236ddf,'membername':_0xeb84a['user'][_0xecc5('0x10')],'interface':_[_0xecc5('0x12')](_0xeb84a['user'][_0xecc5('0x36')])?util[_0xecc5('0x31')](_0xecc5('0x37'),_0xeb84a['user'][_0xecc5('0x10')]):_0xeb84a[_0xecc5('0x2c')][_0xecc5('0x36')],'type':_0xecc5('0x35'),'enterAt':moment()[_0xecc5('0x31')](_0xecc5('0x32')),'role':'agent','internal':_0xeb84a['user'][_0xecc5('0x38')],'uniqueid':_0xeb84a[_0xecc5('0x2a')][_0xecc5('0x2b')][_0x236ddf][_0x5386f3]}});}}}}return respondWithRpcPromise('AgentCapacity',{'id':_0xeb84a[_0xecc5('0x1b')]['id'],'capacity':_0xeb84a[_0xecc5('0x2a')][_0xecc5('0x39')]},routingClient)[_0xecc5('0x8')](respondWithResult(_0x2f73f7,null))[_0xecc5('0x18')](handleError(_0x2f73f7,null));};exports['telephones']=function(_0x4cbee1,_0xbe1aa5){return respondWithRpcPromise('Telephones',_0x4cbee1[_0xecc5('0x17')])[_0xecc5('0x8')](respondWithResult(_0xbe1aa5,null))[_0xecc5('0x18')](handleError(_0xbe1aa5,null));};exports['trunks']=function(_0xd8ae60,_0x205fa3){return respondWithRpcPromise(_0xecc5('0x3a'),_0xd8ae60[_0xecc5('0x17')])[_0xecc5('0x8')](respondWithResult(_0x205fa3,null))[_0xecc5('0x18')](handleError(_0x205fa3,null));};exports['campaigns']=function(_0xffbea2,_0x43a3c3){return respondWithRpcPromise(_0xecc5('0x3b'),_0xffbea2[_0xecc5('0x17')])[_0xecc5('0x8')](respondWithResult(_0x43a3c3,null))[_0xecc5('0x18')](handleError(_0x43a3c3,null));};exports[_0xecc5('0x3c')]=function(_0x59d558,_0x34a48e){return respondWithRpcPromise(_0xecc5('0x3d'),_0x59d558['query'],routingClient)[_0xecc5('0x8')](respondWithResult(_0x34a48e,null))[_0xecc5('0x18')](handleError(_0x34a48e,null));};exports[_0xecc5('0x3e')]=function(_0x4e546,_0x8ca294){return respondWithRpcPromise(_0xecc5('0x3d'),_0x4e546['query'],routingClient)[_0xecc5('0x8')](findById(_0x4e546[_0xecc5('0x1b')]['id']))[_0xecc5('0x8')](respondWithResult(_0x8ca294,null))[_0xecc5('0x18')](handleError(_0x8ca294,null));};exports[_0xecc5('0x3f')]=function(_0x2a44e6,_0x4084fa){return respondWithRpcPromise('MailQueues',_0x2a44e6[_0xecc5('0x17')],routingClient)[_0xecc5('0x8')](respondWithResult(_0x4084fa,null))['catch'](handleError(_0x4084fa,null));};exports['showMailQueues']=function(_0x71432d,_0xbbdf06){return respondWithRpcPromise('MailQueues',_0x71432d[_0xecc5('0x17')],routingClient)[_0xecc5('0x8')](findById(_0x71432d[_0xecc5('0x1b')]['id']))[_0xecc5('0x8')](respondWithResult(_0xbbdf06,null))[_0xecc5('0x18')](handleError(_0xbbdf06,null));};exports['mailAccounts']=function(_0x121c34,_0xeff0b8){return respondWithRpcPromise(_0xecc5('0x40'),_0x121c34[_0xecc5('0x17')],mailClient)[_0xecc5('0x8')](respondWithResult(_0xeff0b8,null))['catch'](handleError(_0xeff0b8,null));};exports['openchannelQueues']=function(_0xa8a440,_0x285924){return respondWithRpcPromise(_0xecc5('0x41'),_0xa8a440['query'],routingClient)[_0xecc5('0x8')](respondWithResult(_0x285924,null))['catch'](handleError(_0x285924,null));};exports[_0xecc5('0x42')]=function(_0x556b2a,_0x2e578e){return respondWithRpcPromise(_0xecc5('0x41'),_0x556b2a['query'],routingClient)['then'](findById(_0x556b2a['params']['id']))[_0xecc5('0x8')](respondWithResult(_0x2e578e,null))[_0xecc5('0x18')](handleError(_0x2e578e,null));};exports[_0xecc5('0x43')]=function(_0x3873df,_0x2f8903){return respondWithRpcPromise(_0xecc5('0x44'),_0x3873df[_0xecc5('0x17')],routingClient)[_0xecc5('0x8')](respondWithResult(_0x2f8903,null))[_0xecc5('0x18')](handleError(_0x2f8903,null));};exports['showSmsQueues']=function(_0x537de9,_0x17cc04){return respondWithRpcPromise(_0xecc5('0x44'),_0x537de9[_0xecc5('0x17')],routingClient)['then'](findById(_0x537de9['params']['id']))[_0xecc5('0x8')](respondWithResult(_0x17cc04,null))[_0xecc5('0x18')](handleError(_0x17cc04,null));};exports[_0xecc5('0x45')]=function(_0x5bff32,_0x44b9a9){return respondWithRpcPromise('FaxQueues',_0x5bff32[_0xecc5('0x17')],routingClient)['then'](respondWithResult(_0x44b9a9,null))['catch'](handleError(_0x44b9a9,null));};exports[_0xecc5('0x46')]=function(_0x3cf8b5,_0x4b76d2){return respondWithRpcPromise(_0xecc5('0x47'),_0x3cf8b5['query'],routingClient)[_0xecc5('0x8')](findById(_0x3cf8b5[_0xecc5('0x1b')]['id']))['then'](respondWithResult(_0x4b76d2,null))[_0xecc5('0x18')](handleError(_0x4b76d2,null));};exports[_0xecc5('0x48')]=function(_0x34fd75,_0x1752be){return respondWithRpcPromise(_0xecc5('0x49'),_0x34fd75[_0xecc5('0x17')])[_0xecc5('0x8')](respondWithResult(_0x1752be,null))[_0xecc5('0x18')](handleError(_0x1752be,null));};exports[_0xecc5('0x4a')]=function(_0x170dd5,_0x569333){return respondWithRpcPromise(_0xecc5('0x4b'),_0x170dd5[_0xecc5('0x17')],routingClient)[_0xecc5('0x8')](respondWithResult(_0x569333,null))[_0xecc5('0x18')](handleError(_0x569333,null));};exports[_0xecc5('0x4c')]=function(_0x35a5b1,_0x3acd68){return respondWithRpcPromise(_0xecc5('0x4d'),_0x35a5b1[_0xecc5('0x17')],routingClient)[_0xecc5('0x8')](respondWithResult(_0x3acd68,null))[_0xecc5('0x18')](handleError(_0x3acd68,null));};exports[_0xecc5('0x4e')]=function(_0x30865e,_0x434d75){return respondWithRpcPromise('OpenchannelQueuesWaitingInteractions',_0x30865e['query'],routingClient)['then'](respondWithResult(_0x434d75,null))[_0xecc5('0x18')](handleError(_0x434d75,null));};exports[_0xecc5('0x4f')]=function(_0x3075ab,_0x172e8d){return respondWithRpcPromise(_0xecc5('0x50'),_0x3075ab[_0xecc5('0x17')],routingClient)[_0xecc5('0x8')](respondWithResult(_0x172e8d,null))[_0xecc5('0x18')](handleError(_0x172e8d,null));};exports[_0xecc5('0x51')]=function(_0xca605,_0x4eb6a1){return respondWithRpcPromise(_0xecc5('0x52'),_0xca605['query'],routingClient)[_0xecc5('0x8')](respondWithResult(_0x4eb6a1,null))[_0xecc5('0x18')](handleError(_0x4eb6a1,null));};exports[_0xecc5('0x53')]=function(_0x3ed4d2){return function(_0x48cac9,_0x5ab72a){var _0x1459ca,_0x2a3cb6;var _0x1731e4=_['capitalize'](_0x3ed4d2);var _0x3bf86e=_0x3ed4d2==='chat'?_0xecc5('0x54'):_0xecc5('0x55');return db[_0x1731e4+'Queue']['findOne']({'raw':!![],'where':{'id':_0x48cac9[_0xecc5('0x1b')]['id']}})['then'](function(_0x4b70d0){if(_[_0xecc5('0x12')](_0x4b70d0)){throw new Error(_0x1731e4+_0xecc5('0x56'));}_0x1459ca=_0x4b70d0;return db[_0x1731e4+'Message']['findOne']({'where':{'id':_0x48cac9['body'][_0xecc5('0x57')]},'include':[{'model':db[_0x1731e4+_0xecc5('0x58')],'as':_0xecc5('0x58')},{'model':db[_0x1731e4+_0x3bf86e],'as':'Account'}]});})[_0xecc5('0x8')](function(_0x3ca674){if(_['isNil'](_0x3ca674)){throw new Error(_0x1731e4+_0xecc5('0x59'));}_0x2a3cb6=_0x3ca674;return _0x3ca674[_0xecc5('0x5a')]({'read':0x0,'readAt':null,'UserId':null});})[_0xecc5('0x8')](function(){var _0x241c71={'uniqueid':_0x3ed4d2+'.'+_0x2a3cb6['id']+'.'+_0x2a3cb6[_0xecc5('0x58')]['id'],'FromUserId':_0x48cac9['user']['id'],'type':'queue'};_0x241c71[_0x1731e4+'MessageId']=_0x2a3cb6['id'];_0x241c71[_0x1731e4+_0xecc5('0x5b')]=_0x2a3cb6[_0xecc5('0x58')]['id'];_0x241c71['From'+_0x1731e4+_0x3bf86e+'Id']=_0x2a3cb6['Account']['id'];_0x241c71['To'+_0x1731e4+_0xecc5('0x5c')]=_0x1459ca['id'];return db[_0x1731e4+_0xecc5('0x5d')][_0xecc5('0x5e')](_0x241c71);})[_0xecc5('0x8')](function(){return respondWithRpcPromise(_0xecc5('0x5f'),{'channel':_0x3ed4d2,'interaction':_0x2a3cb6[_0xecc5('0x58')],'message':_0x2a3cb6,'account':_0x2a3cb6[_0xecc5('0x55')],'applications':[{'id':0x0,'priority':0x1,'app':'queue','appdata':_0x1459ca['name']+','+(_0x2a3cb6[_0xecc5('0x55')][_0xecc5('0x60')]||0x12c),'interval':_0xecc5('0x61')}]},routingClient);})[_0xecc5('0x8')](respondWithResult(_0x5ab72a,null))[_0xecc5('0x18')](handleError(_0x5ab72a,null));};};exports[_0xecc5('0x62')]=function(_0x50318f,_0x3a7107){var _0x377030,_0x23d1d7;if(_[_0xecc5('0x12')](_0x50318f[_0xecc5('0x2a')][_0xecc5('0x63')])){throw new Error('Channel\x20field\x20is\x20mandatory');}var _0x54c34a=_0x50318f['body'][_0xecc5('0x63')];var _0x5957b6=_[_0xecc5('0x64')](_0x54c34a);var _0x5999b4=_0x54c34a===_0xecc5('0x65')?_0xecc5('0x54'):_0xecc5('0x55');return db[_0xecc5('0x66')][_0xecc5('0x67')]({'raw':!![],'where':{'id':_0x50318f[_0xecc5('0x1b')]['id'],'role':_0xecc5('0x68')}})[_0xecc5('0x8')](function(_0x5a92b7){if(_[_0xecc5('0x12')](_0x5a92b7)){throw new Error(_0xecc5('0x69'));}_0x377030=_0x5a92b7;return db[_0x5957b6+_0xecc5('0x6a')]['findOne']({'where':{'id':_0x50318f[_0xecc5('0x2a')][_0xecc5('0x57')]},'include':[{'model':db[_0x5957b6+_0xecc5('0x58')],'as':_0xecc5('0x58')},{'model':db[_0x5957b6+_0x5999b4],'as':_0xecc5('0x55')}]});})[_0xecc5('0x8')](function(_0x48cce9){if(_[_0xecc5('0x12')](_0x48cce9)){throw new Error(_0x5957b6+_0xecc5('0x59'));}_0x23d1d7=_0x48cce9;return _0x48cce9[_0xecc5('0x5a')]({'read':0x0,'readAt':null,'UserId':null});})[_0xecc5('0x8')](function(){var _0x18ecdf={'uniqueid':_0x54c34a+'.'+_0x23d1d7['id']+'.'+_0x23d1d7['Interaction']['id'],'FromUserId':_0x50318f[_0xecc5('0x2c')]['id'],'type':_0xecc5('0x6b'),'ToUserId':_0x377030['id']};_0x18ecdf[_0x5957b6+_0xecc5('0x6c')]=_0x23d1d7['id'];_0x18ecdf[_0x5957b6+_0xecc5('0x5b')]=_0x23d1d7[_0xecc5('0x58')]['id'];_0x18ecdf[_0xecc5('0x6d')+_0x5957b6+_0x5999b4+'Id']=_0x23d1d7[_0xecc5('0x55')]['id'];return db[_0x5957b6+_0xecc5('0x5d')]['create'](_0x18ecdf);})[_0xecc5('0x8')](function(){return respondWithRpcPromise(_0xecc5('0x5f'),{'channel':_0x54c34a,'interaction':_0x23d1d7[_0xecc5('0x58')],'message':_0x23d1d7,'account':_0x23d1d7['Account'],'applications':[{'id':0x0,'priority':0x1,'app':_0xecc5('0x68'),'appdata':_0x377030['name']+','+(_0x23d1d7[_0xecc5('0x55')][_0xecc5('0x6e')]||0x12c),'interval':_0xecc5('0x61')}]},routingClient);})[_0xecc5('0x8')](respondWithResult(_0x3a7107,null))[_0xecc5('0x18')](handleError(_0x3a7107,null));};
\ No newline at end of file
diff --git a/server/api/schedule/index.js b/server/api/schedule/index.js
index 3ecf08a..efa1074 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 _0xf746=['connect-timeout','express','Router','../../components/auth/service','../../components/interaction/service','../../config/environment','./schedule.controller','get','isAuthenticated','/:id','/:id/run','post','create','put','update','exports','multer','path'];(function(_0xadde88,_0x58ad47){var _0x3b8eb6=function(_0x15535a){while(--_0x15535a){_0xadde88['push'](_0xadde88['shift']());}};_0x3b8eb6(++_0x58ad47);}(_0xf746,0xa0));var _0x6f74=function(_0x455c6c,_0x1e78b7){_0x455c6c=_0x455c6c-0x0;var _0x488242=_0xf746[_0x455c6c];return _0x488242;};'use strict';var multer=require(_0x6f74('0x0'));var util=require('util');var path=require(_0x6f74('0x1'));var timeout=require(_0x6f74('0x2'));var express=require(_0x6f74('0x3'));var router=express[_0x6f74('0x4')]();var auth=require(_0x6f74('0x5'));var interaction=require(_0x6f74('0x6'));var config=require(_0x6f74('0x7'));var controller=require(_0x6f74('0x8'));router[_0x6f74('0x9')]('/',auth[_0x6f74('0xa')](),controller['index']);router['get'](_0x6f74('0xb'),auth[_0x6f74('0xa')](),controller['show']);router[_0x6f74('0x9')](_0x6f74('0xc'),auth[_0x6f74('0xa')](),controller['run']);router[_0x6f74('0xd')]('/',auth['isAuthenticated'](),controller[_0x6f74('0xe')]);router[_0x6f74('0xf')](_0x6f74('0xb'),auth[_0x6f74('0xa')](),controller[_0x6f74('0x10')]);router['delete']('/:id',auth[_0x6f74('0xa')](),controller['destroy']);module[_0x6f74('0x11')]=router;
\ No newline at end of file
+var _0x3676=['isAuthenticated','index','/:id','show','/:id/run','run','post','put','update','delete','destroy','exports','util','path','connect-timeout','express','Router','../../components/auth/service','./schedule.controller','get'];(function(_0x1395ae,_0x3be5cd){var _0x210e30=function(_0x5b0935){while(--_0x5b0935){_0x1395ae['push'](_0x1395ae['shift']());}};_0x210e30(++_0x3be5cd);}(_0x3676,0x188));var _0x6367=function(_0x1a9204,_0x1c9e00){_0x1a9204=_0x1a9204-0x0;var _0x17ca68=_0x3676[_0x1a9204];return _0x17ca68;};'use strict';var multer=require('multer');var util=require(_0x6367('0x0'));var path=require(_0x6367('0x1'));var timeout=require(_0x6367('0x2'));var express=require(_0x6367('0x3'));var router=express[_0x6367('0x4')]();var auth=require(_0x6367('0x5'));var interaction=require('../../components/interaction/service');var config=require('../../config/environment');var controller=require(_0x6367('0x6'));router[_0x6367('0x7')]('/',auth[_0x6367('0x8')](),controller[_0x6367('0x9')]);router['get'](_0x6367('0xa'),auth['isAuthenticated'](),controller[_0x6367('0xb')]);router[_0x6367('0x7')](_0x6367('0xc'),auth[_0x6367('0x8')](),controller[_0x6367('0xd')]);router[_0x6367('0xe')]('/',auth[_0x6367('0x8')](),controller['create']);router[_0x6367('0xf')](_0x6367('0xa'),auth['isAuthenticated'](),controller[_0x6367('0x10')]);router[_0x6367('0x11')](_0x6367('0xa'),auth[_0x6367('0x8')](),controller[_0x6367('0x12')]);module[_0x6367('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 932d529..c82d920 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 _0xc03e=['csv','xlsx','custom','default','BOOLEAN','TEXT','sequelize','STRING','DATE','INTEGER','ENUM','years','quarters','months','weeks','days','minutes'];(function(_0x37644a,_0x1a223a){var _0x48c516=function(_0x1fa32c){while(--_0x1fa32c){_0x37644a['push'](_0x37644a['shift']());}};_0x48c516(++_0x1a223a);}(_0xc03e,0x15a));var _0xec03=function(_0x22d72b,_0x112e6d){_0x22d72b=_0x22d72b-0x0;var _0x35f65f=_0xc03e[_0x22d72b];return _0x35f65f;};'use strict';var Sequelize=require(_0xec03('0x0'));module['exports']={'name':{'type':Sequelize['STRING'],'allowNull':![]},'description':{'type':Sequelize[_0xec03('0x1')]},'active':{'type':Sequelize['BOOLEAN'],'allowNull':![],'defaultValue':![]},'cron':{'type':Sequelize[_0xec03('0x1')],'allowNull':![],'defaultValue':'0\x200\x20*\x20*\x20*'},'startAt':{'type':Sequelize[_0xec03('0x2')],'allowNull':![]},'endAt':{'type':Sequelize[_0xec03('0x2')],'allowNull':![]},'subtractNumber':{'type':Sequelize[_0xec03('0x3')],'allowNull':![],'defaultValue':0x1,'validate':{'min':0x1}},'subtractUnit':{'type':Sequelize[_0xec03('0x4')](_0xec03('0x5'),_0xec03('0x6'),_0xec03('0x7'),_0xec03('0x8'),_0xec03('0x9'),'hours',_0xec03('0xa')),'allowNull':![],'defaultValue':_0xec03('0x9')},'output':{'type':Sequelize[_0xec03('0x4')](_0xec03('0xb'),'pdf',_0xec03('0xc')),'allowNull':![],'defaultValue':_0xec03('0xb')},'type':{'type':Sequelize[_0xec03('0x4')](_0xec03('0xd'),_0xec03('0xe')),'allowNull':![],'defaultValue':_0xec03('0xd')},'sendMail':{'type':Sequelize[_0xec03('0xf')],'defaultValue':![]},'email':{'type':Sequelize[_0xec03('0x1')]},'cc':{'type':Sequelize['TEXT']},'bcc':{'type':Sequelize[_0xec03('0x10')]},'sendIfEmpty':{'type':Sequelize[_0xec03('0xf')],'defaultValue':!![]}};
\ No newline at end of file
+var _0x26d1=['BOOLEAN','DATE','ENUM','years','quarters','months','weeks','hours','minutes','days','csv','pdf','xlsx','custom','default','TEXT','sequelize','STRING'];(function(_0x9fd887,_0x47f76c){var _0x1a54ab=function(_0xb65c08){while(--_0xb65c08){_0x9fd887['push'](_0x9fd887['shift']());}};_0x1a54ab(++_0x47f76c);}(_0x26d1,0x8e));var _0x126d=function(_0x2c91e9,_0x2fb965){_0x2c91e9=_0x2c91e9-0x0;var _0x13f0ff=_0x26d1[_0x2c91e9];return _0x13f0ff;};'use strict';var Sequelize=require(_0x126d('0x0'));module['exports']={'name':{'type':Sequelize[_0x126d('0x1')],'allowNull':![]},'description':{'type':Sequelize[_0x126d('0x1')]},'active':{'type':Sequelize[_0x126d('0x2')],'allowNull':![],'defaultValue':![]},'cron':{'type':Sequelize[_0x126d('0x1')],'allowNull':![],'defaultValue':'0\x200\x20*\x20*\x20*'},'startAt':{'type':Sequelize['DATE'],'allowNull':![]},'endAt':{'type':Sequelize[_0x126d('0x3')],'allowNull':![]},'subtractNumber':{'type':Sequelize['INTEGER'],'allowNull':![],'defaultValue':0x1,'validate':{'min':0x1}},'subtractUnit':{'type':Sequelize[_0x126d('0x4')](_0x126d('0x5'),_0x126d('0x6'),_0x126d('0x7'),_0x126d('0x8'),'days',_0x126d('0x9'),_0x126d('0xa')),'allowNull':![],'defaultValue':_0x126d('0xb')},'output':{'type':Sequelize[_0x126d('0x4')](_0x126d('0xc'),_0x126d('0xd'),_0x126d('0xe')),'allowNull':![],'defaultValue':'csv'},'type':{'type':Sequelize[_0x126d('0x4')](_0x126d('0xf'),_0x126d('0x10')),'allowNull':![],'defaultValue':_0x126d('0xf')},'sendMail':{'type':Sequelize[_0x126d('0x2')],'defaultValue':![]},'email':{'type':Sequelize['STRING']},'cc':{'type':Sequelize[_0x126d('0x11')]},'bcc':{'type':Sequelize['TEXT']},'sendIfEmpty':{'type':Sequelize[_0x126d('0x2')],'defaultValue':!![]}};
\ No newline at end of file
diff --git a/server/api/schedule/schedule.controller.js b/server/api/schedule/schedule.controller.js
index 58de7f7..9c1fdcc 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 _0xef48=['fields','attributes','length','hasOwnProperty','nolimit','offset','order','sort','pick','filter','where','merge','VIRTUAL','options','includeAll','include','findAll','rows','show','params','rawAttributes','keys','find','catch','create','body','user','Unable\x20to\x20retrieve\x20the\x20current\x20user','role','UserProfileSection','userProfileId','UserProfileResource','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','run','../../config/schedule','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','moment','util','path','sox','to-csv','ejs','crypto','querystring','papaparse','ioredis','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/environment','status','end','json','count','limit','Content-Range','apply','reject','save','then','destroy','Scheduler','sendStatus','error','stack','name','map','Schedule','fieldName','type','key','model','query','filters','intersection'];(function(_0x4ebf9f,_0x143d12){var _0x32f61b=function(_0x2eca1f){while(--_0x2eca1f){_0x4ebf9f['push'](_0x4ebf9f['shift']());}};_0x32f61b(++_0x143d12);}(_0xef48,0xc7));var _0x8ef4=function(_0x521fd9,_0x312a5f){_0x521fd9=_0x521fd9-0x0;var _0x2c1b43=_0xef48[_0x521fd9];return _0x2c1b43;};'use strict';var pdf=require('html-pdf');var emlformat=require(_0x8ef4('0x0'));var rimraf=require(_0x8ef4('0x1'));var zipdir=require(_0x8ef4('0x2'));var jsonpatch=require(_0x8ef4('0x3'));var rp=require(_0x8ef4('0x4'));var moment=require(_0x8ef4('0x5'));var BPromise=require('bluebird');var Mustache=require('mustache');var util=require(_0x8ef4('0x6'));var path=require(_0x8ef4('0x7'));var sox=require(_0x8ef4('0x8'));var csv=require(_0x8ef4('0x9'));var ejs=require(_0x8ef4('0xa'));var fs=require('fs');var _=require('lodash');var squel=require('squel');var crypto=require(_0x8ef4('0xb'));var jsforce=require('jsforce');var deskjs=require('desk.js');var toCsv=require('to-csv');var querystring=require(_0x8ef4('0xc'));var Papa=require(_0x8ef4('0xd'));var Redis=require(_0x8ef4('0xe'));var authService=require('../../components/auth/service');var qs=require(_0x8ef4('0xf'));var as=require(_0x8ef4('0x10'));var hardwareService=require(_0x8ef4('0x11'));var logger=require(_0x8ef4('0x12'))(_0x8ef4('0x13'));var utils=require(_0x8ef4('0x14'));var config=require(_0x8ef4('0x15'));var db=require('../../mysqldb')['db'];function respondWithStatusCode(_0x2a700e,_0x4548fb){_0x4548fb=_0x4548fb||0xcc;return function(_0x9a0ec7){if(_0x9a0ec7){return _0x2a700e['sendStatus'](_0x4548fb);}return _0x2a700e[_0x8ef4('0x16')](_0x4548fb)[_0x8ef4('0x17')]();};}function respondWithResult(_0x3a64b4,_0x3d8d7c){_0x3d8d7c=_0x3d8d7c||0xc8;return function(_0x3a686d){if(_0x3a686d){return _0x3a64b4['status'](_0x3d8d7c)[_0x8ef4('0x18')](_0x3a686d);}};}function respondWithFilteredResult(_0x4835fe,_0x2d0392){return function(_0x3097fe){if(_0x3097fe){var _0x3f2f37=_0x3097fe[_0x8ef4('0x19')],_0x45a943=_0x2d0392['offset'],_0x3754af=_0x2d0392['offset']+_0x2d0392[_0x8ef4('0x1a')],_0xc94e32;if(_0x3754af>=_0x3f2f37){_0x3754af=_0x3f2f37;_0xc94e32=0xc8;}else{_0xc94e32=0xce;}_0x4835fe[_0x8ef4('0x16')](_0xc94e32);return _0x4835fe['set'](_0x8ef4('0x1b'),_0x45a943+'-'+_0x3754af+'/'+_0x3f2f37)[_0x8ef4('0x18')](_0x3097fe);}return null;};}function patchUpdates(_0x3cde7d){return function(_0x11009d){try{jsonpatch[_0x8ef4('0x1c')](_0x11009d,_0x3cde7d,!![]);}catch(_0xeb779c){return BPromise[_0x8ef4('0x1d')](_0xeb779c);}return _0x11009d[_0x8ef4('0x1e')]();};}function saveUpdates(_0x3fdfb2,_0x423d9d){return function(_0x29ef61){if(_0x29ef61){return _0x29ef61['update'](_0x3fdfb2)[_0x8ef4('0x1f')](function(_0x160504){return _0x160504;});}return null;};}function removeEntity(_0x361713,_0x4070a7){return function(_0x383850){if(_0x383850){return _0x383850[_0x8ef4('0x20')]()[_0x8ef4('0x1f')](function(){var _0x4d2dc3=_0x383850['get']({'plain':!![]});var _0x505f30=_0x8ef4('0x21');return db['UserProfileResource']['destroy']({'where':{'type':_0x505f30,'resourceId':_0x4d2dc3['id']}})[_0x8ef4('0x1f')](function(){return _0x383850;});})[_0x8ef4('0x1f')](function(){_0x361713[_0x8ef4('0x16')](0xcc)[_0x8ef4('0x17')]();});}};}function handleEntityNotFound(_0x295492,_0x3dbf29){return function(_0x3ae908){if(!_0x3ae908){_0x295492[_0x8ef4('0x22')](0x194);}return _0x3ae908;};}function handleError(_0x255a3d,_0x10b517){_0x10b517=_0x10b517||0x1f4;return function(_0xb5d7e5){logger[_0x8ef4('0x23')](_0xb5d7e5[_0x8ef4('0x24')]);if(_0xb5d7e5[_0x8ef4('0x25')]){delete _0xb5d7e5[_0x8ef4('0x25')];}_0x255a3d['status'](_0x10b517)['send'](_0xb5d7e5);};}exports['index']=function(_0x15d468,_0x3b0609){var _0x39aba5={},_0x5a0c38={},_0x1a597e={'count':0x0,'rows':[]};var _0x37190d=_[_0x8ef4('0x26')](db[_0x8ef4('0x27')]['rawAttributes'],function(_0x368a2f){return{'name':_0x368a2f[_0x8ef4('0x28')],'type':_0x368a2f[_0x8ef4('0x29')][_0x8ef4('0x2a')]};});_0x5a0c38[_0x8ef4('0x2b')]=_[_0x8ef4('0x26')](_0x37190d,_0x8ef4('0x25'));_0x5a0c38[_0x8ef4('0x2c')]=_['keys'](_0x15d468['query']);_0x5a0c38[_0x8ef4('0x2d')]=_['intersection'](_0x5a0c38[_0x8ef4('0x2b')],_0x5a0c38[_0x8ef4('0x2c')]);_0x39aba5['attributes']=_[_0x8ef4('0x2e')](_0x5a0c38['model'],qs[_0x8ef4('0x2f')](_0x15d468['query']['fields']));_0x39aba5['attributes']=_0x39aba5[_0x8ef4('0x30')][_0x8ef4('0x31')]?_0x39aba5[_0x8ef4('0x30')]:_0x5a0c38[_0x8ef4('0x2b')];if(!_0x15d468[_0x8ef4('0x2c')][_0x8ef4('0x32')](_0x8ef4('0x33'))){_0x39aba5['limit']=qs[_0x8ef4('0x1a')](_0x15d468['query'][_0x8ef4('0x1a')]);_0x39aba5[_0x8ef4('0x34')]=qs['offset'](_0x15d468[_0x8ef4('0x2c')][_0x8ef4('0x34')]);}_0x39aba5[_0x8ef4('0x35')]=qs['sort'](_0x15d468[_0x8ef4('0x2c')][_0x8ef4('0x36')]);_0x39aba5['where']=qs[_0x8ef4('0x2d')](_[_0x8ef4('0x37')](_0x15d468[_0x8ef4('0x2c')],_0x5a0c38[_0x8ef4('0x2d')]));if(_0x15d468['query'][_0x8ef4('0x38')]){_0x39aba5[_0x8ef4('0x39')]=_[_0x8ef4('0x3a')](_0x39aba5['where'],{'$or':_['map'](_0x37190d,function(_0x5033d7){if(_0x5033d7[_0x8ef4('0x29')]!==_0x8ef4('0x3b')){var _0x36d028={};_0x36d028[_0x5033d7['name']]={'$like':'%'+_0x15d468[_0x8ef4('0x2c')][_0x8ef4('0x38')]+'%'};return _0x36d028;}})});}_0x39aba5=_[_0x8ef4('0x3a')]({},_0x39aba5,_0x15d468[_0x8ef4('0x3c')]);var _0x2b571c={'where':_0x39aba5[_0x8ef4('0x39')]};return db[_0x8ef4('0x27')][_0x8ef4('0x19')](_0x2b571c)[_0x8ef4('0x1f')](function(_0x2c556c){_0x1a597e[_0x8ef4('0x19')]=_0x2c556c;if(_0x15d468[_0x8ef4('0x2c')][_0x8ef4('0x3d')]){_0x39aba5[_0x8ef4('0x3e')]=[{'all':!![]}];}return db[_0x8ef4('0x27')][_0x8ef4('0x3f')](_0x39aba5);})[_0x8ef4('0x1f')](function(_0x258474){_0x1a597e[_0x8ef4('0x40')]=_0x258474;return _0x1a597e;})[_0x8ef4('0x1f')](respondWithFilteredResult(_0x3b0609,_0x39aba5))['catch'](handleError(_0x3b0609,null));};exports[_0x8ef4('0x41')]=function(_0x292dcf,_0x1e0bae){var _0x523b55={'raw':![],'where':{'id':_0x292dcf[_0x8ef4('0x42')]['id']}},_0x2832f7={};_0x2832f7[_0x8ef4('0x2b')]=_['keys'](db['Schedule'][_0x8ef4('0x43')]);_0x2832f7[_0x8ef4('0x2c')]=_[_0x8ef4('0x44')](_0x292dcf[_0x8ef4('0x2c')]);_0x2832f7[_0x8ef4('0x2d')]=_[_0x8ef4('0x2e')](_0x2832f7[_0x8ef4('0x2b')],_0x2832f7[_0x8ef4('0x2c')]);_0x523b55[_0x8ef4('0x30')]=_[_0x8ef4('0x2e')](_0x2832f7[_0x8ef4('0x2b')],qs[_0x8ef4('0x2f')](_0x292dcf[_0x8ef4('0x2c')][_0x8ef4('0x2f')]));_0x523b55[_0x8ef4('0x30')]=_0x523b55[_0x8ef4('0x30')]['length']?_0x523b55[_0x8ef4('0x30')]:_0x2832f7['model'];if(_0x292dcf[_0x8ef4('0x2c')]['includeAll']){_0x523b55[_0x8ef4('0x3e')]=[{'all':!![]}];}_0x523b55=_[_0x8ef4('0x3a')]({},_0x523b55,_0x292dcf['options']);return db[_0x8ef4('0x27')][_0x8ef4('0x45')](_0x523b55)[_0x8ef4('0x1f')](handleEntityNotFound(_0x1e0bae,null))['then'](respondWithResult(_0x1e0bae,null))[_0x8ef4('0x46')](handleError(_0x1e0bae,null));};exports[_0x8ef4('0x47')]=function(_0xf26337,_0x5a71c0){return db['Schedule'][_0x8ef4('0x47')](_0xf26337[_0x8ef4('0x48')],{})['then'](function(_0x2393e3){var _0x3b8ad9=_0xf26337[_0x8ef4('0x49')]['get']({'plain':!![]});if(!_0x3b8ad9)throw new Error(_0x8ef4('0x4a'));if(_0x3b8ad9[_0x8ef4('0x4b')]==='user'){var _0x13e9f6=_0x2393e3['get']({'plain':!![]});var _0x1213f9=_0x8ef4('0x21');return db[_0x8ef4('0x4c')][_0x8ef4('0x45')]({'where':{'name':_0x1213f9,'userProfileId':_0x3b8ad9[_0x8ef4('0x4d')]},'raw':!![]})[_0x8ef4('0x1f')](function(_0x482db5){if(_0x482db5&&_0x482db5['autoAssociation']===0x0){return db[_0x8ef4('0x4e')][_0x8ef4('0x47')]({'name':_0x13e9f6['name'],'resourceId':_0x13e9f6['id'],'type':_0x482db5['name'],'sectionId':_0x482db5['id']},{})['then'](function(){return _0x2393e3;});}else{return _0x2393e3;}})[_0x8ef4('0x46')](function(_0x53400f){logger[_0x8ef4('0x23')](_0x8ef4('0x4f'),_0x53400f);throw _0x53400f;});}return _0x2393e3;})[_0x8ef4('0x1f')](respondWithResult(_0x5a71c0,0xc9))['catch'](handleError(_0x5a71c0,null));};exports['update']=function(_0x4088e3,_0x1ab6a6){if(_0x4088e3[_0x8ef4('0x48')]['id']){delete _0x4088e3[_0x8ef4('0x48')]['id'];}return db[_0x8ef4('0x27')][_0x8ef4('0x45')]({'where':{'id':_0x4088e3['params']['id']}})[_0x8ef4('0x1f')](handleEntityNotFound(_0x1ab6a6,null))[_0x8ef4('0x1f')](saveUpdates(_0x4088e3[_0x8ef4('0x48')],null))[_0x8ef4('0x1f')](respondWithResult(_0x1ab6a6,null))[_0x8ef4('0x46')](handleError(_0x1ab6a6,null));};exports[_0x8ef4('0x20')]=function(_0x5a73c1,_0x2df67f){return db['Schedule'][_0x8ef4('0x45')]({'where':{'id':_0x5a73c1['params']['id']}})[_0x8ef4('0x1f')](handleEntityNotFound(_0x2df67f,null))[_0x8ef4('0x1f')](removeEntity(_0x2df67f,null))['catch'](handleError(_0x2df67f,null));};exports[_0x8ef4('0x50')]=function(_0x3909bd,_0x361399,_0x43f3ee){var _0x2fe21f=require(_0x8ef4('0x51'));return db[_0x8ef4('0x27')][_0x8ef4('0x45')]({'where':{'id':_0x3909bd['params']['id']},'raw':!![]})[_0x8ef4('0x1f')](handleEntityNotFound(_0x361399,null))[_0x8ef4('0x1f')](function(){_0x2fe21f[_0x8ef4('0x50')](_0x3909bd[_0x8ef4('0x42')]['id']);})[_0x8ef4('0x1f')](respondWithStatusCode(_0x361399,null))[_0x8ef4('0x46')](handleError(_0x361399,null));};
\ No newline at end of file
+var _0x0183=['catch','show','params','find','user','get','Unable\x20to\x20retrieve\x20the\x20current\x20user','role','UserProfileSection','userProfileId','autoAssociation','create','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','update','body','eml-format','zip-dir','request-promise','mustache','util','path','sox','to-csv','ejs','squel','crypto','desk.js','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/advancedSearch','api','../../config/environment','../../mysqldb','end','json','count','offset','limit','status','set','Content-Range','reject','destroy','then','Scheduler','UserProfileResource','sendStatus','error','stack','name','send','index','Schedule','rawAttributes','fieldName','model','map','query','keys','filters','intersection','attributes','fields','length','hasOwnProperty','nolimit','order','sort','pick','filter','where','merge','type','VIRTUAL','options','includeAll','rows'];(function(_0x462e72,_0x2085e2){var _0x393ca7=function(_0x58488a){while(--_0x58488a){_0x462e72['push'](_0x462e72['shift']());}};_0x393ca7(++_0x2085e2);}(_0x0183,0x19a));var _0x3018=function(_0x24d8d7,_0xb94fdf){_0x24d8d7=_0x24d8d7-0x0;var _0xe0356c=_0x0183[_0x24d8d7];return _0xe0356c;};'use strict';var pdf=require('html-pdf');var emlformat=require(_0x3018('0x0'));var rimraf=require('rimraf');var zipdir=require(_0x3018('0x1'));var jsonpatch=require('fast-json-patch');var rp=require(_0x3018('0x2'));var moment=require('moment');var BPromise=require('bluebird');var Mustache=require(_0x3018('0x3'));var util=require(_0x3018('0x4'));var path=require(_0x3018('0x5'));var sox=require(_0x3018('0x6'));var csv=require(_0x3018('0x7'));var ejs=require(_0x3018('0x8'));var fs=require('fs');var _=require('lodash');var squel=require(_0x3018('0x9'));var crypto=require(_0x3018('0xa'));var jsforce=require('jsforce');var deskjs=require(_0x3018('0xb'));var toCsv=require(_0x3018('0x7'));var querystring=require(_0x3018('0xc'));var Papa=require(_0x3018('0xd'));var Redis=require(_0x3018('0xe'));var authService=require(_0x3018('0xf'));var qs=require('../../components/parsers/qs');var as=require(_0x3018('0x10'));var hardwareService=require('../../config/license/hardware');var logger=require('../../config/logger')(_0x3018('0x11'));var utils=require('../../config/utils');var config=require(_0x3018('0x12'));var db=require(_0x3018('0x13'))['db'];function respondWithStatusCode(_0x5aa323,_0x27297b){_0x27297b=_0x27297b||0xcc;return function(_0x57b7b1){if(_0x57b7b1){return _0x5aa323['sendStatus'](_0x27297b);}return _0x5aa323['status'](_0x27297b)[_0x3018('0x14')]();};}function respondWithResult(_0x35b329,_0x3bbff7){_0x3bbff7=_0x3bbff7||0xc8;return function(_0x55b3a4){if(_0x55b3a4){return _0x35b329['status'](_0x3bbff7)[_0x3018('0x15')](_0x55b3a4);}};}function respondWithFilteredResult(_0x3117f7,_0x4da659){return function(_0x2c3889){if(_0x2c3889){var _0x422f00=_0x2c3889[_0x3018('0x16')],_0x2581be=_0x4da659[_0x3018('0x17')],_0xad54c6=_0x4da659[_0x3018('0x17')]+_0x4da659[_0x3018('0x18')],_0x44f138;if(_0xad54c6>=_0x422f00){_0xad54c6=_0x422f00;_0x44f138=0xc8;}else{_0x44f138=0xce;}_0x3117f7[_0x3018('0x19')](_0x44f138);return _0x3117f7[_0x3018('0x1a')](_0x3018('0x1b'),_0x2581be+'-'+_0xad54c6+'/'+_0x422f00)[_0x3018('0x15')](_0x2c3889);}return null;};}function patchUpdates(_0x14e6f2){return function(_0x24b69f){try{jsonpatch['apply'](_0x24b69f,_0x14e6f2,!![]);}catch(_0x128445){return BPromise[_0x3018('0x1c')](_0x128445);}return _0x24b69f['save']();};}function saveUpdates(_0x1e6b91,_0x55261d){return function(_0x5a7b25){if(_0x5a7b25){return _0x5a7b25['update'](_0x1e6b91)['then'](function(_0x24065a){return _0x24065a;});}return null;};}function removeEntity(_0x16a092,_0x5f4701){return function(_0x1232fd){if(_0x1232fd){return _0x1232fd[_0x3018('0x1d')]()[_0x3018('0x1e')](function(){var _0xc74264=_0x1232fd['get']({'plain':!![]});var _0x3a927c=_0x3018('0x1f');return db[_0x3018('0x20')][_0x3018('0x1d')]({'where':{'type':_0x3a927c,'resourceId':_0xc74264['id']}})['then'](function(){return _0x1232fd;});})[_0x3018('0x1e')](function(){_0x16a092[_0x3018('0x19')](0xcc)[_0x3018('0x14')]();});}};}function handleEntityNotFound(_0x15c616,_0x849d19){return function(_0x2a3565){if(!_0x2a3565){_0x15c616[_0x3018('0x21')](0x194);}return _0x2a3565;};}function handleError(_0xb0143e,_0x269c91){_0x269c91=_0x269c91||0x1f4;return function(_0x4ad99b){logger[_0x3018('0x22')](_0x4ad99b[_0x3018('0x23')]);if(_0x4ad99b[_0x3018('0x24')]){delete _0x4ad99b[_0x3018('0x24')];}_0xb0143e['status'](_0x269c91)[_0x3018('0x25')](_0x4ad99b);};}exports[_0x3018('0x26')]=function(_0x1003da,_0xfd4201){var _0xcfd2e5={},_0x26cdea={},_0x5b1517={'count':0x0,'rows':[]};var _0x6fadd9=_['map'](db[_0x3018('0x27')][_0x3018('0x28')],function(_0x44bca1){return{'name':_0x44bca1[_0x3018('0x29')],'type':_0x44bca1['type']['key']};});_0x26cdea[_0x3018('0x2a')]=_[_0x3018('0x2b')](_0x6fadd9,_0x3018('0x24'));_0x26cdea[_0x3018('0x2c')]=_[_0x3018('0x2d')](_0x1003da[_0x3018('0x2c')]);_0x26cdea[_0x3018('0x2e')]=_[_0x3018('0x2f')](_0x26cdea[_0x3018('0x2a')],_0x26cdea[_0x3018('0x2c')]);_0xcfd2e5[_0x3018('0x30')]=_['intersection'](_0x26cdea[_0x3018('0x2a')],qs[_0x3018('0x31')](_0x1003da[_0x3018('0x2c')][_0x3018('0x31')]));_0xcfd2e5[_0x3018('0x30')]=_0xcfd2e5[_0x3018('0x30')][_0x3018('0x32')]?_0xcfd2e5['attributes']:_0x26cdea[_0x3018('0x2a')];if(!_0x1003da['query'][_0x3018('0x33')](_0x3018('0x34'))){_0xcfd2e5[_0x3018('0x18')]=qs[_0x3018('0x18')](_0x1003da[_0x3018('0x2c')][_0x3018('0x18')]);_0xcfd2e5[_0x3018('0x17')]=qs[_0x3018('0x17')](_0x1003da[_0x3018('0x2c')]['offset']);}_0xcfd2e5[_0x3018('0x35')]=qs['sort'](_0x1003da[_0x3018('0x2c')][_0x3018('0x36')]);_0xcfd2e5['where']=qs[_0x3018('0x2e')](_[_0x3018('0x37')](_0x1003da[_0x3018('0x2c')],_0x26cdea[_0x3018('0x2e')]));if(_0x1003da[_0x3018('0x2c')][_0x3018('0x38')]){_0xcfd2e5[_0x3018('0x39')]=_[_0x3018('0x3a')](_0xcfd2e5['where'],{'$or':_[_0x3018('0x2b')](_0x6fadd9,function(_0x4f8d50){if(_0x4f8d50[_0x3018('0x3b')]!==_0x3018('0x3c')){var _0x46ea86={};_0x46ea86[_0x4f8d50[_0x3018('0x24')]]={'$like':'%'+_0x1003da[_0x3018('0x2c')][_0x3018('0x38')]+'%'};return _0x46ea86;}})});}_0xcfd2e5=_[_0x3018('0x3a')]({},_0xcfd2e5,_0x1003da[_0x3018('0x3d')]);var _0x352ba4={'where':_0xcfd2e5['where']};return db[_0x3018('0x27')][_0x3018('0x16')](_0x352ba4)[_0x3018('0x1e')](function(_0x15f093){_0x5b1517[_0x3018('0x16')]=_0x15f093;if(_0x1003da[_0x3018('0x2c')][_0x3018('0x3e')]){_0xcfd2e5['include']=[{'all':!![]}];}return db['Schedule']['findAll'](_0xcfd2e5);})[_0x3018('0x1e')](function(_0x44b98a){_0x5b1517[_0x3018('0x3f')]=_0x44b98a;return _0x5b1517;})[_0x3018('0x1e')](respondWithFilteredResult(_0xfd4201,_0xcfd2e5))[_0x3018('0x40')](handleError(_0xfd4201,null));};exports[_0x3018('0x41')]=function(_0x37e351,_0x4eca2d){var _0x590c5c={'raw':![],'where':{'id':_0x37e351[_0x3018('0x42')]['id']}},_0x27000e={};_0x27000e[_0x3018('0x2a')]=_[_0x3018('0x2d')](db[_0x3018('0x27')][_0x3018('0x28')]);_0x27000e[_0x3018('0x2c')]=_[_0x3018('0x2d')](_0x37e351['query']);_0x27000e[_0x3018('0x2e')]=_[_0x3018('0x2f')](_0x27000e[_0x3018('0x2a')],_0x27000e['query']);_0x590c5c['attributes']=_['intersection'](_0x27000e['model'],qs[_0x3018('0x31')](_0x37e351[_0x3018('0x2c')][_0x3018('0x31')]));_0x590c5c['attributes']=_0x590c5c[_0x3018('0x30')][_0x3018('0x32')]?_0x590c5c[_0x3018('0x30')]:_0x27000e['model'];if(_0x37e351[_0x3018('0x2c')]['includeAll']){_0x590c5c['include']=[{'all':!![]}];}_0x590c5c=_[_0x3018('0x3a')]({},_0x590c5c,_0x37e351[_0x3018('0x3d')]);return db[_0x3018('0x27')][_0x3018('0x43')](_0x590c5c)[_0x3018('0x1e')](handleEntityNotFound(_0x4eca2d,null))[_0x3018('0x1e')](respondWithResult(_0x4eca2d,null))[_0x3018('0x40')](handleError(_0x4eca2d,null));};exports['create']=function(_0x987bf4,_0x32d432){return db['Schedule']['create'](_0x987bf4['body'],{})[_0x3018('0x1e')](function(_0x375ed9){var _0x46668e=_0x987bf4[_0x3018('0x44')][_0x3018('0x45')]({'plain':!![]});if(!_0x46668e)throw new Error(_0x3018('0x46'));if(_0x46668e[_0x3018('0x47')]===_0x3018('0x44')){var _0x55dcf5=_0x375ed9[_0x3018('0x45')]({'plain':!![]});var _0x3d9a33=_0x3018('0x1f');return db[_0x3018('0x48')]['find']({'where':{'name':_0x3d9a33,'userProfileId':_0x46668e[_0x3018('0x49')]},'raw':!![]})[_0x3018('0x1e')](function(_0xeb007d){if(_0xeb007d&&_0xeb007d[_0x3018('0x4a')]===0x0){return db[_0x3018('0x20')][_0x3018('0x4b')]({'name':_0x55dcf5[_0x3018('0x24')],'resourceId':_0x55dcf5['id'],'type':_0xeb007d[_0x3018('0x24')],'sectionId':_0xeb007d['id']},{})[_0x3018('0x1e')](function(){return _0x375ed9;});}else{return _0x375ed9;}})['catch'](function(_0x744d6a){logger[_0x3018('0x22')](_0x3018('0x4c'),_0x744d6a);throw _0x744d6a;});}return _0x375ed9;})['then'](respondWithResult(_0x32d432,0xc9))[_0x3018('0x40')](handleError(_0x32d432,null));};exports[_0x3018('0x4d')]=function(_0x49db91,_0x484c38){if(_0x49db91[_0x3018('0x4e')]['id']){delete _0x49db91['body']['id'];}return db[_0x3018('0x27')][_0x3018('0x43')]({'where':{'id':_0x49db91[_0x3018('0x42')]['id']}})['then'](handleEntityNotFound(_0x484c38,null))['then'](saveUpdates(_0x49db91[_0x3018('0x4e')],null))['then'](respondWithResult(_0x484c38,null))['catch'](handleError(_0x484c38,null));};exports[_0x3018('0x1d')]=function(_0x400925,_0x54dfd1){return db['Schedule'][_0x3018('0x43')]({'where':{'id':_0x400925[_0x3018('0x42')]['id']}})['then'](handleEntityNotFound(_0x54dfd1,null))[_0x3018('0x1e')](removeEntity(_0x54dfd1,null))[_0x3018('0x40')](handleError(_0x54dfd1,null));};exports['run']=function(_0x41de65,_0x591f9e,_0x82494){var _0x543958=require('../../config/schedule');return db[_0x3018('0x27')][_0x3018('0x43')]({'where':{'id':_0x41de65[_0x3018('0x42')]['id']},'raw':!![]})['then'](handleEntityNotFound(_0x591f9e,null))['then'](function(){_0x543958['run'](_0x41de65[_0x3018('0x42')]['id']);})[_0x3018('0x1e')](respondWithStatusCode(_0x591f9e,null))[_0x3018('0x40')](handleError(_0x591f9e,null));};
\ No newline at end of file
diff --git a/server/api/schedule/schedule.model.js b/server/api/schedule/schedule.model.js
index 495999d..3b5e171 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 _0x6e82=['../../config/environment','./schedule.attributes','define','tools_schedules','lodash','util','../../config/logger','api','moment','bluebird','request-promise','rimraf'];(function(_0x33e79b,_0x1cb0b5){var _0x1ddfaa=function(_0x39adf6){while(--_0x39adf6){_0x33e79b['push'](_0x33e79b['shift']());}};_0x1ddfaa(++_0x1cb0b5);}(_0x6e82,0x1b4));var _0x26e8=function(_0x273d71,_0x11c3a4){_0x273d71=_0x273d71-0x0;var _0x264e15=_0x6e82[_0x273d71];return _0x264e15;};'use strict';var _=require(_0x26e8('0x0'));var util=require(_0x26e8('0x1'));var logger=require(_0x26e8('0x2'))(_0x26e8('0x3'));var moment=require(_0x26e8('0x4'));var BPromise=require(_0x26e8('0x5'));var rp=require(_0x26e8('0x6'));var fs=require('fs');var path=require('path');var rimraf=require(_0x26e8('0x7'));var config=require(_0x26e8('0x8'));var attributes=require(_0x26e8('0x9'));module['exports']=function(_0x504cd2,_0x4adae7){return _0x504cd2[_0x26e8('0xa')]('Schedule',attributes,{'tableName':_0x26e8('0xb'),'paranoid':![],'indexes':[],'timestamps':!![]});};
\ No newline at end of file
+var _0x4030=['request-promise','rimraf','../../config/environment','./schedule.attributes','exports','Schedule','tools_schedules','util','api','moment','bluebird'];(function(_0x3cc32d,_0x1aacff){var _0x327c84=function(_0x5aa199){while(--_0x5aa199){_0x3cc32d['push'](_0x3cc32d['shift']());}};_0x327c84(++_0x1aacff);}(_0x4030,0x80));var _0x0403=function(_0x13c625,_0xc65b8e){_0x13c625=_0x13c625-0x0;var _0x1f2506=_0x4030[_0x13c625];return _0x1f2506;};'use strict';var _=require('lodash');var util=require(_0x0403('0x0'));var logger=require('../../config/logger')(_0x0403('0x1'));var moment=require(_0x0403('0x2'));var BPromise=require(_0x0403('0x3'));var rp=require(_0x0403('0x4'));var fs=require('fs');var path=require('path');var rimraf=require(_0x0403('0x5'));var config=require(_0x0403('0x6'));var attributes=require(_0x0403('0x7'));module[_0x0403('0x8')]=function(_0x14ab7d,_0x3a4b0c){return _0x14ab7d['define'](_0x0403('0x9'),attributes,{'tableName':_0x0403('0xa'),'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 54c7005..1fd3bd2 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 _0x4cf2=['../../config/logger','rpc','../../config/environment','jayson/promise','client','request','then','info','Schedule,\x20%s,\x20%s','request\x20sent','Schedule,\x20%s,\x20%s,\x20%s','error','code','message','result','lodash','util','moment','bluebird','ioredis','../../mysqldb','../../config/utils'];(function(_0x590a5a,_0x406781){var _0x4e384a=function(_0x30969f){while(--_0x30969f){_0x590a5a['push'](_0x590a5a['shift']());}};_0x4e384a(++_0x406781);}(_0x4cf2,0x159));var _0x24cf=function(_0x53ddab,_0x4ada9d){_0x53ddab=_0x53ddab-0x0;var _0x5819ac=_0x4cf2[_0x53ddab];return _0x5819ac;};'use strict';var _=require(_0x24cf('0x0'));var util=require(_0x24cf('0x1'));var moment=require(_0x24cf('0x2'));var BPromise=require(_0x24cf('0x3'));var rs=require('randomstring');var fs=require('fs');var Redis=require(_0x24cf('0x4'));var db=require(_0x24cf('0x5'))['db'];var utils=require(_0x24cf('0x6'));var logger=require(_0x24cf('0x7'))(_0x24cf('0x8'));var config=require(_0x24cf('0x9'));var jayson=require(_0x24cf('0xa'));var client=jayson[_0x24cf('0xb')]['http']({'port':0x232a});function respondWithRpcPromise(_0x272135,_0x168789,_0x142aac){return new BPromise(function(_0x8d1747,_0x514eb9){return client[_0x24cf('0xc')](_0x272135,_0x142aac)[_0x24cf('0xd')](function(_0x4d5282){logger[_0x24cf('0xe')](_0x24cf('0xf'),_0x168789,_0x24cf('0x10'));logger['debug'](_0x24cf('0x11'),_0x168789,_0x24cf('0x10'),JSON['stringify'](_0x4d5282));if(_0x4d5282[_0x24cf('0x12')]){if(_0x4d5282[_0x24cf('0x12')][_0x24cf('0x13')]===0x1f4){logger[_0x24cf('0x12')](_0x24cf('0xf'),_0x168789,_0x4d5282[_0x24cf('0x12')][_0x24cf('0x14')]);return _0x514eb9(_0x4d5282[_0x24cf('0x12')][_0x24cf('0x14')]);}logger[_0x24cf('0x12')](_0x24cf('0xf'),_0x168789,_0x4d5282[_0x24cf('0x12')][_0x24cf('0x14')]);return _0x8d1747(_0x4d5282['error']['message']);}else{logger[_0x24cf('0xe')](_0x24cf('0xf'),_0x168789,_0x24cf('0x10'));_0x8d1747(_0x4d5282[_0x24cf('0x15')][_0x24cf('0x14')]);}})['catch'](function(_0x4d3928){logger[_0x24cf('0x12')]('Schedule,\x20%s,\x20%s',_0x168789,_0x4d3928);_0x514eb9(_0x4d3928);});});}
\ No newline at end of file
+var _0x0ab5=['result','catch','lodash','moment','bluebird','randomstring','ioredis','../../config/utils','../../config/logger','../../config/environment','jayson/promise','client','http','request','info','Schedule,\x20%s,\x20%s','debug','Schedule,\x20%s,\x20%s,\x20%s','request\x20sent','stringify','error','code','message'];(function(_0x563c6a,_0x42b20d){var _0x2eea4d=function(_0x398101){while(--_0x398101){_0x563c6a['push'](_0x563c6a['shift']());}};_0x2eea4d(++_0x42b20d);}(_0x0ab5,0x1e5));var _0x50ab=function(_0x339458,_0x345ea5){_0x339458=_0x339458-0x0;var _0x241a7d=_0x0ab5[_0x339458];return _0x241a7d;};'use strict';var _=require(_0x50ab('0x0'));var util=require('util');var moment=require(_0x50ab('0x1'));var BPromise=require(_0x50ab('0x2'));var rs=require(_0x50ab('0x3'));var fs=require('fs');var Redis=require(_0x50ab('0x4'));var db=require('../../mysqldb')['db'];var utils=require(_0x50ab('0x5'));var logger=require(_0x50ab('0x6'))('rpc');var config=require(_0x50ab('0x7'));var jayson=require(_0x50ab('0x8'));var client=jayson[_0x50ab('0x9')][_0x50ab('0xa')]({'port':0x232a});function respondWithRpcPromise(_0x18a90c,_0x1ed6ec,_0x3eec55){return new BPromise(function(_0x69ba0a,_0x5b3a0c){return client[_0x50ab('0xb')](_0x18a90c,_0x3eec55)['then'](function(_0x5f1887){logger[_0x50ab('0xc')](_0x50ab('0xd'),_0x1ed6ec,'request\x20sent');logger[_0x50ab('0xe')](_0x50ab('0xf'),_0x1ed6ec,_0x50ab('0x10'),JSON[_0x50ab('0x11')](_0x5f1887));if(_0x5f1887[_0x50ab('0x12')]){if(_0x5f1887[_0x50ab('0x12')][_0x50ab('0x13')]===0x1f4){logger[_0x50ab('0x12')]('Schedule,\x20%s,\x20%s',_0x1ed6ec,_0x5f1887['error']['message']);return _0x5b3a0c(_0x5f1887[_0x50ab('0x12')][_0x50ab('0x14')]);}logger[_0x50ab('0x12')](_0x50ab('0xd'),_0x1ed6ec,_0x5f1887[_0x50ab('0x12')]['message']);return _0x69ba0a(_0x5f1887[_0x50ab('0x12')][_0x50ab('0x14')]);}else{logger[_0x50ab('0xc')](_0x50ab('0xd'),_0x1ed6ec,_0x50ab('0x10'));_0x69ba0a(_0x5f1887[_0x50ab('0x15')][_0x50ab('0x14')]);}})[_0x50ab('0x16')](function(_0x26df6c){logger[_0x50ab('0x12')](_0x50ab('0xd'),_0x1ed6ec,_0x26df6c);_0x5b3a0c(_0x26df6c);});});}
\ No newline at end of file
diff --git a/server/api/screenRecording/index.js b/server/api/screenRecording/index.js
index 01e8aff..02511ee 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 _0x8059=['/:id','show','/:id/download','post','put','update','destroy','multer','path','connect-timeout','express','Router','../../components/auth/service','../../components/interaction/service','../../config/environment','./screenRecording.controller','isAuthenticated','get','describe'];(function(_0x136a01,_0x3e0f10){var _0x39ccee=function(_0x1fa530){while(--_0x1fa530){_0x136a01['push'](_0x136a01['shift']());}};_0x39ccee(++_0x3e0f10);}(_0x8059,0x170));var _0x9805=function(_0x5a9c0c,_0x4ec485){_0x5a9c0c=_0x5a9c0c-0x0;var _0x53c77d=_0x8059[_0x5a9c0c];return _0x53c77d;};'use strict';var multer=require(_0x9805('0x0'));var util=require('util');var path=require(_0x9805('0x1'));var timeout=require(_0x9805('0x2'));var express=require(_0x9805('0x3'));var router=express[_0x9805('0x4')]();var auth=require(_0x9805('0x5'));var interaction=require(_0x9805('0x6'));var config=require(_0x9805('0x7'));var controller=require(_0x9805('0x8'));router['get']('/',auth[_0x9805('0x9')](),controller['index']);router[_0x9805('0xa')]('/describe',auth['isAuthenticated'](),controller[_0x9805('0xb')]);router['get'](_0x9805('0xc'),auth['isAuthenticated'](),controller[_0x9805('0xd')]);router['get'](_0x9805('0xe'),auth[_0x9805('0x9')](),controller['download']);router[_0x9805('0xf')]('/',auth['isAuthenticated'](),controller['create']);router[_0x9805('0x10')](_0x9805('0xc'),auth[_0x9805('0x9')](),controller[_0x9805('0x11')]);router['delete'](_0x9805('0xc'),auth[_0x9805('0x9')](),controller[_0x9805('0x12')]);module['exports']=router;
\ No newline at end of file
+var _0x413d=['index','get','/describe','describe','/:id','show','/:id/download','download','post','put','update','delete','destroy','exports','multer','util','path','connect-timeout','express','Router','../../components/auth/service','../../components/interaction/service','../../config/environment','./screenRecording.controller','isAuthenticated'];(function(_0x1eda20,_0x1149f4){var _0x31b953=function(_0x25f0d8){while(--_0x25f0d8){_0x1eda20['push'](_0x1eda20['shift']());}};_0x31b953(++_0x1149f4);}(_0x413d,0x19e));var _0xd413=function(_0x42bc91,_0x41f40a){_0x42bc91=_0x42bc91-0x0;var _0x3f5507=_0x413d[_0x42bc91];return _0x3f5507;};'use strict';var multer=require(_0xd413('0x0'));var util=require(_0xd413('0x1'));var path=require(_0xd413('0x2'));var timeout=require(_0xd413('0x3'));var express=require(_0xd413('0x4'));var router=express[_0xd413('0x5')]();var auth=require(_0xd413('0x6'));var interaction=require(_0xd413('0x7'));var config=require(_0xd413('0x8'));var controller=require(_0xd413('0x9'));router['get']('/',auth[_0xd413('0xa')](),controller[_0xd413('0xb')]);router[_0xd413('0xc')](_0xd413('0xd'),auth[_0xd413('0xa')](),controller[_0xd413('0xe')]);router['get'](_0xd413('0xf'),auth[_0xd413('0xa')](),controller[_0xd413('0x10')]);router[_0xd413('0xc')](_0xd413('0x11'),auth['isAuthenticated'](),controller[_0xd413('0x12')]);router[_0xd413('0x13')]('/',auth[_0xd413('0xa')](),controller['create']);router[_0xd413('0x14')](_0xd413('0xf'),auth[_0xd413('0xa')](),controller[_0xd413('0x15')]);router[_0xd413('0x16')](_0xd413('0xf'),auth['isAuthenticated'](),controller[_0xd413('0x17')]);module[_0xd413('0x18')]=router;
\ No newline at end of file
diff --git a/server/api/screenRecording/screenRecording.attributes.js b/server/api/screenRecording/screenRecording.attributes.js
index 7891e2a..caddda7 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 _0x9f62=['exports','VIRTUAL','extname','getDataValue','value','STRING','replace','setDataValue','startedAt','closedAt','DATE','format','MM-DD-YYYY\x20HH:mm','toString','createdAt','updatedAt','moment','../../config/environment'];(function(_0x412458,_0x8db8d6){var _0x3be5f9=function(_0x599ff1){while(--_0x599ff1){_0x412458['push'](_0x412458['shift']());}};_0x3be5f9(++_0x8db8d6);}(_0x9f62,0x154));var _0x29f6=function(_0x1f9df0,_0x4b0ae6){_0x1f9df0=_0x1f9df0-0x0;var _0x31852c=_0x9f62[_0x1f9df0];return _0x31852c;};'use strict';var Sequelize=require('sequelize');var moment=require(_0x29f6('0x0'));var path=require('path');var config=require(_0x29f6('0x1'));module[_0x29f6('0x2')]={'format':{'type':Sequelize[_0x29f6('0x3')],'get':function(){return this['getDataValue']('value')?path[_0x29f6('0x4')](this[_0x29f6('0x5')](_0x29f6('0x6'))):undefined;}},'interactionid':{'type':Sequelize[_0x29f6('0x7')]},'channel':{'type':Sequelize['STRING']},'value':{'type':Sequelize[_0x29f6('0x7')],'set':function(_0x272876){var _0x9a43fe=_0x272876[_0x29f6('0x8')](/\\/g,'/');this[_0x29f6('0x9')]('value',_0x9a43fe);}},'rating':{'type':Sequelize['INTEGER'],'validate':{'max':0x5,'min':0x0}},'duration':{'type':Sequelize['INTEGER'],'set':function(_0x549f64){this[_0x29f6('0x9')](_0x29f6('0xa'),moment()['subtract'](_0x549f64,'ms'));this['setDataValue'](_0x29f6('0xb'),moment());this[_0x29f6('0x9')]('duration',_0x549f64);}},'startedAt':{'type':Sequelize[_0x29f6('0xc')],'get':function(){return moment(this[_0x29f6('0x5')]('startedAt'))['format']('MM-DD-YYYY\x20HH:mm')['toString']();}},'closedAt':{'type':Sequelize[_0x29f6('0xc')],'get':function(){return moment(this[_0x29f6('0x5')](_0x29f6('0xb')))[_0x29f6('0xd')](_0x29f6('0xe'))[_0x29f6('0xf')]();}},'createdAt':{'type':Sequelize[_0x29f6('0xc')],'get':function(){return moment(this[_0x29f6('0x5')](_0x29f6('0x10')))[_0x29f6('0xd')](_0x29f6('0xe'))[_0x29f6('0xf')]();}},'updatedAt':{'type':Sequelize[_0x29f6('0xc')],'get':function(){return moment(this[_0x29f6('0x5')](_0x29f6('0x11')))[_0x29f6('0xd')](_0x29f6('0xe'))['toString']();}}};
\ 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(_0x2b5782,_0x32c69b){var _0x886822=function(_0x15a257){while(--_0x15a257){_0x2b5782['push'](_0x2b5782['shift']());}};_0x886822(++_0x32c69b);}(_0xac9d,0x14d));var _0xdac9=function(_0x2c4aef,_0x116fe2){_0x2c4aef=_0x2c4aef-0x0;var _0x3deaed=_0xac9d[_0x2c4aef];return _0x3deaed;};'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 ebcf667..8a6f774 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 _0xd317=['then','destroy','sendStatus','error','stack','name','send','index','map','ScreenRecording','rawAttributes','fieldName','type','key','format','query','keys','intersection','model','attributes','fields','length','hasOwnProperty','nolimit','order','sort','filters','pick','filter','where','VIRTUAL','options','includeAll','include','findAll','show','params','merge','find','catch','create','body','duration','describe','../../components/encryptor','uniqueid','value','join','root','%s.cypher','existsSync','decryptFile','secrets','recording','server/files/screen_recordings','Sequelize','ScreenRecording\x20not\x20found','filename','download','extname','unlink','message','Not\x20found','info','cancellazione\x20fisica\x20documento\x20%s','isNil','File:\x20\x22','\x22\x20trovato\x20eseguo\x20la\x20cancellazione','unlinkSync','.cypher','html-pdf','eml-format','rimraf','zip-dir','request-promise','mustache','path','sox','ejs','crypto','jsforce','desk.js','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','api','../../config/environment','../../mysqldb','status','end','json','count','offset','limit','set','Content-Range','apply','save','update'];(function(_0x512124,_0x587620){var _0x46a223=function(_0x46ab45){while(--_0x46ab45){_0x512124['push'](_0x512124['shift']());}};_0x46a223(++_0x587620);}(_0xd317,0x112));var _0x7d31=function(_0x16b9ed,_0x56517a){_0x16b9ed=_0x16b9ed-0x0;var _0x66b1f8=_0xd317[_0x16b9ed];return _0x66b1f8;};'use strict';var pdf=require(_0x7d31('0x0'));var emlformat=require(_0x7d31('0x1'));var rimraf=require(_0x7d31('0x2'));var zipdir=require(_0x7d31('0x3'));var jsonpatch=require('fast-json-patch');var rp=require(_0x7d31('0x4'));var moment=require('moment');var BPromise=require('bluebird');var Mustache=require(_0x7d31('0x5'));var util=require('util');var path=require(_0x7d31('0x6'));var sox=require(_0x7d31('0x7'));var csv=require('to-csv');var ejs=require(_0x7d31('0x8'));var fs=require('fs');var _=require('lodash');var squel=require('squel');var crypto=require(_0x7d31('0x9'));var jsforce=require(_0x7d31('0xa'));var deskjs=require(_0x7d31('0xb'));var toCsv=require('to-csv');var querystring=require(_0x7d31('0xc'));var Papa=require(_0x7d31('0xd'));var Redis=require(_0x7d31('0xe'));var authService=require(_0x7d31('0xf'));var qs=require(_0x7d31('0x10'));var as=require(_0x7d31('0x11'));var hardwareService=require('../../config/license/hardware');var logger=require('../../config/logger')(_0x7d31('0x12'));var utils=require('../../config/utils');var config=require(_0x7d31('0x13'));var db=require(_0x7d31('0x14'))['db'];function respondWithStatusCode(_0x268151,_0x40cea5){_0x40cea5=_0x40cea5||0xcc;return function(_0x10f181){if(_0x10f181){return _0x268151['sendStatus'](_0x40cea5);}return _0x268151[_0x7d31('0x15')](_0x40cea5)[_0x7d31('0x16')]();};}function respondWithResult(_0x2b997c,_0x531100){_0x531100=_0x531100||0xc8;return function(_0x5f03af){if(_0x5f03af){return _0x2b997c[_0x7d31('0x15')](_0x531100)[_0x7d31('0x17')](_0x5f03af);}};}function respondWithFilteredResult(_0x5c491f,_0x56556f){return function(_0x560658){if(_0x560658){var _0x347e38=_0x560658[_0x7d31('0x18')],_0x356293=_0x56556f[_0x7d31('0x19')],_0x1abcda=_0x56556f[_0x7d31('0x19')]+_0x56556f[_0x7d31('0x1a')],_0x1ba9ff;if(_0x1abcda>=_0x347e38){_0x1abcda=_0x347e38;_0x1ba9ff=0xc8;}else{_0x1ba9ff=0xce;}_0x5c491f[_0x7d31('0x15')](_0x1ba9ff);return _0x5c491f[_0x7d31('0x1b')](_0x7d31('0x1c'),_0x356293+'-'+_0x1abcda+'/'+_0x347e38)['json'](_0x560658);}return null;};}function patchUpdates(_0x12c876){return function(_0x1fbcc2){try{jsonpatch[_0x7d31('0x1d')](_0x1fbcc2,_0x12c876,!![]);}catch(_0x378c0f){return BPromise['reject'](_0x378c0f);}return _0x1fbcc2[_0x7d31('0x1e')]();};}function saveUpdates(_0x4262df,_0x112a2b){return function(_0x4bdcfc){if(_0x4bdcfc){return _0x4bdcfc[_0x7d31('0x1f')](_0x4262df)[_0x7d31('0x20')](function(_0x33d6bd){return _0x33d6bd;});}return null;};}function removeEntity(_0x37596f,_0x880515){return function(_0x1aa660){if(_0x1aa660){return _0x1aa660[_0x7d31('0x21')]()['then'](function(){_0x37596f[_0x7d31('0x15')](0xcc)[_0x7d31('0x16')]();});}};}function handleEntityNotFound(_0x161b88,_0x1cc245){return function(_0x50a500){if(!_0x50a500){_0x161b88[_0x7d31('0x22')](0x194);}return _0x50a500;};}function handleError(_0xad05db,_0x189787){_0x189787=_0x189787||0x1f4;return function(_0x3024c7){logger[_0x7d31('0x23')](_0x3024c7[_0x7d31('0x24')]);if(_0x3024c7[_0x7d31('0x25')]){delete _0x3024c7[_0x7d31('0x25')];}_0xad05db[_0x7d31('0x15')](_0x189787)[_0x7d31('0x26')](_0x3024c7);};}exports[_0x7d31('0x27')]=function(_0x1f214f,_0x2c4ad7){var _0x154a4e={},_0x5401b9={},_0x4cd686={'count':0x0,'rows':[]};var _0xadb6fa=_[_0x7d31('0x28')](db[_0x7d31('0x29')][_0x7d31('0x2a')],function(_0xa1a16d){return{'name':_0xa1a16d[_0x7d31('0x2b')],'type':_0xa1a16d[_0x7d31('0x2c')][_0x7d31('0x2d')]};});_0x5401b9['model']=_['differenceBy'](_['map'](_0xadb6fa,'name'),[_0x7d31('0x2e')]);_0x5401b9[_0x7d31('0x2f')]=_[_0x7d31('0x30')](_0x1f214f['query']);_0x5401b9['filters']=_[_0x7d31('0x31')](_0x5401b9[_0x7d31('0x32')],_0x5401b9[_0x7d31('0x2f')]);_0x154a4e[_0x7d31('0x33')]=_['intersection'](_0x5401b9[_0x7d31('0x32')],qs[_0x7d31('0x34')](_0x1f214f[_0x7d31('0x2f')][_0x7d31('0x34')]));_0x154a4e[_0x7d31('0x33')]=_0x154a4e[_0x7d31('0x33')][_0x7d31('0x35')]?_0x154a4e[_0x7d31('0x33')]:_0x5401b9[_0x7d31('0x32')];if(!_0x1f214f[_0x7d31('0x2f')][_0x7d31('0x36')](_0x7d31('0x37'))){_0x154a4e['limit']=qs[_0x7d31('0x1a')](_0x1f214f['query']['limit']);_0x154a4e[_0x7d31('0x19')]=qs[_0x7d31('0x19')](_0x1f214f['query']['offset']);}_0x154a4e[_0x7d31('0x38')]=qs[_0x7d31('0x39')](_0x1f214f['query'][_0x7d31('0x39')]);_0x154a4e['where']=qs[_0x7d31('0x3a')](_[_0x7d31('0x3b')](_0x1f214f[_0x7d31('0x2f')],_0x5401b9[_0x7d31('0x3a')]));if(_0x1f214f[_0x7d31('0x2f')][_0x7d31('0x3c')]){_0x154a4e[_0x7d31('0x3d')]=_['merge'](_0x154a4e[_0x7d31('0x3d')],{'$or':_['map'](_0xadb6fa,function(_0x33b007){if(_0x33b007['type']!==_0x7d31('0x3e')){var _0x112b8c={};_0x112b8c[_0x33b007[_0x7d31('0x25')]]={'$like':'%'+_0x1f214f[_0x7d31('0x2f')][_0x7d31('0x3c')]+'%'};return _0x112b8c;}})});}_0x154a4e=_['merge']({},_0x154a4e,_0x1f214f[_0x7d31('0x3f')]);var _0xf071b4={'where':_0x154a4e[_0x7d31('0x3d')]};return db['ScreenRecording'][_0x7d31('0x18')](_0xf071b4)[_0x7d31('0x20')](function(_0x382a86){_0x4cd686[_0x7d31('0x18')]=_0x382a86;if(_0x1f214f['query'][_0x7d31('0x40')]){_0x154a4e[_0x7d31('0x41')]=[{'all':!![]}];}return db['ScreenRecording'][_0x7d31('0x42')](_0x154a4e);})['then'](function(_0x4ae886){_0x4cd686['rows']=_0x4ae886;return _0x4cd686;})['then'](respondWithFilteredResult(_0x2c4ad7,_0x154a4e))['catch'](handleError(_0x2c4ad7,null));};exports[_0x7d31('0x43')]=function(_0x4ee40d,_0x48e0c4){var _0x1ccb0c={'raw':![],'where':{'id':_0x4ee40d[_0x7d31('0x44')]['id']}},_0x2dae04={};_0x2dae04[_0x7d31('0x32')]=_[_0x7d31('0x30')](db[_0x7d31('0x29')][_0x7d31('0x2a')]);_0x2dae04[_0x7d31('0x2f')]=_['keys'](_0x4ee40d[_0x7d31('0x2f')]);_0x2dae04[_0x7d31('0x3a')]=_['intersection'](_0x2dae04['model'],_0x2dae04[_0x7d31('0x2f')]);_0x1ccb0c['attributes']=_['intersection'](_0x2dae04[_0x7d31('0x32')],qs[_0x7d31('0x34')](_0x4ee40d['query'][_0x7d31('0x34')]));_0x1ccb0c[_0x7d31('0x33')]=_0x1ccb0c[_0x7d31('0x33')][_0x7d31('0x35')]?_0x1ccb0c[_0x7d31('0x33')]:_0x2dae04[_0x7d31('0x32')];if(_0x4ee40d[_0x7d31('0x2f')][_0x7d31('0x40')]){_0x1ccb0c[_0x7d31('0x41')]=[{'all':!![]}];}_0x1ccb0c=_[_0x7d31('0x45')]({},_0x1ccb0c,_0x4ee40d[_0x7d31('0x3f')]);return db[_0x7d31('0x29')][_0x7d31('0x46')](_0x1ccb0c)[_0x7d31('0x20')](handleEntityNotFound(_0x48e0c4,null))[_0x7d31('0x20')](respondWithResult(_0x48e0c4,null))[_0x7d31('0x47')](handleError(_0x48e0c4,null));};exports[_0x7d31('0x48')]=function(_0x57571f,_0x47d780){return db[_0x7d31('0x29')][_0x7d31('0x48')](_0x57571f[_0x7d31('0x49')],{})[_0x7d31('0x20')](respondWithResult(_0x47d780,0xc9))[_0x7d31('0x47')](handleError(_0x47d780,null));};exports['update']=function(_0x16c38e,_0xc04b47){if(_0x16c38e[_0x7d31('0x49')]['id']){delete _0x16c38e['body']['id'];}delete _0x16c38e[_0x7d31('0x49')][_0x7d31('0x4a')];delete _0x16c38e['body']['createdAt'];delete _0x16c38e[_0x7d31('0x49')]['closedAt'];delete _0x16c38e[_0x7d31('0x49')]['value'];return db[_0x7d31('0x29')][_0x7d31('0x46')]({'where':{'id':_0x16c38e['params']['id']}})[_0x7d31('0x20')](handleEntityNotFound(_0xc04b47,null))[_0x7d31('0x20')](saveUpdates(_0x16c38e[_0x7d31('0x49')],null))[_0x7d31('0x20')](respondWithResult(_0xc04b47,null))[_0x7d31('0x47')](handleError(_0xc04b47,null));};exports[_0x7d31('0x4b')]=function(_0x539788,_0x257202){return db['ScreenRecording']['describe']()['then'](respondWithResult(_0x257202,null))[_0x7d31('0x47')](handleError(_0x257202,null));};exports['download']=function(_0x4ef7ca,_0x3435f8,_0x550493){var _0x176cb8=require(_0x7d31('0x4c'));var _0x2c8863=![];var _0x1debcc={};if(_0x4ef7ca[_0x7d31('0x2f')]['type']&&_0x4ef7ca[_0x7d31('0x2f')][_0x7d31('0x2c')]===_0x7d31('0x4d')){_0x1debcc[_0x7d31('0x4d')]=_0x4ef7ca[_0x7d31('0x44')]['id'];}else{_0x1debcc['id']=_0x4ef7ca[_0x7d31('0x44')]['id'];}return db[_0x7d31('0x29')][_0x7d31('0x46')]({'where':_0x1debcc,'attributes':['id',_0x7d31('0x4e')],'raw':!![]})['then'](handleEntityNotFound(_0x3435f8,null))['then'](function(_0x2daa4e){if(_0x2daa4e){var _0x3c94c5=path[_0x7d31('0x4f')](config[_0x7d31('0x50')],'server/files/screen_recordings',_0x2daa4e[_0x7d31('0x4e')]);var _0x43c636=util[_0x7d31('0x2e')](_0x7d31('0x51'),_0x3c94c5);if(fs[_0x7d31('0x52')](_0x43c636)){_0x2c8863=!![];return _0x176cb8[_0x7d31('0x53')](_0x43c636,_0x3c94c5,config[_0x7d31('0x54')][_0x7d31('0x55')])[_0x7d31('0x20')](function(){return _0x2daa4e;});}return _0x2daa4e;}})[_0x7d31('0x20')](function(_0x65cc06){if(_0x65cc06){var _0x562c20=path[_0x7d31('0x4f')](config[_0x7d31('0x50')],_0x7d31('0x56'),_0x65cc06[_0x7d31('0x4e')]);if(!fs[_0x7d31('0x52')](_0x562c20)){throw new db[(_0x7d31('0x57'))]['ValidationError'](_0x7d31('0x58'));}if(_0x65cc06[_0x7d31('0x59')]){return _0x3435f8[_0x7d31('0x5a')](_0x562c20,_0x65cc06['filename']+path[_0x7d31('0x5b')](_0x562c20),function(){if(_0x2c8863){fs[_0x7d31('0x5c')](_0x562c20);}});}else{return _0x3435f8[_0x7d31('0x5a')](_0x562c20,function(_0x34d553){if(_0x2c8863){fs[_0x7d31('0x5c')](_0x562c20);}});}}})[_0x7d31('0x47')](function(_0xeecda4){if(_0xeecda4[_0x7d31('0x5d')]===_0x7d31('0x58')){_0x3435f8[_0x7d31('0x15')](0x194)['send'](_0x7d31('0x5e'));}else{return handleError(_0x3435f8,null);}});};exports[_0x7d31('0x21')]=function(_0x276f19,_0x33e0fa){return db[_0x7d31('0x29')]['find']({'where':{'id':_0x276f19[_0x7d31('0x44')]['id']}})[_0x7d31('0x20')](function(_0x496990){if(!_0x496990)throw new ReferenceError('Entity\x20not\x20found');return _0x496990;})['then'](function(_0x2f539){var _0x584378=path['join'](config['root'],_0x7d31('0x56'),_0x2f539[_0x7d31('0x4e')]);logger[_0x7d31('0x5f')](_0x7d31('0x60'),_0x584378);if(!_[_0x7d31('0x61')](_0x2f539[_0x7d31('0x4e')])&&fs['existsSync'](_0x584378)){logger['info'](_0x7d31('0x62')+_0x584378+_0x7d31('0x63'));fs[_0x7d31('0x64')](_0x584378);}_0x584378=_0x584378+_0x7d31('0x65');if(!_[_0x7d31('0x61')](_0x2f539['value'])&&fs[_0x7d31('0x52')](_0x584378)){logger[_0x7d31('0x5f')](_0x7d31('0x62')+_0x584378+'\x22\x20trovato\x20eseguo\x20la\x20cancellazione');fs[_0x7d31('0x64')](_0x584378);}return _0x2f539;})['then'](function(_0x2cbfe4){if(!_0x2cbfe4)throw new InternalError();return _0x2cbfe4['destroy']();})[_0x7d31('0x20')](function(){_0x33e0fa['status'](0xcc)[_0x7d31('0x16')]();})[_0x7d31('0x47')](handleError(_0x33e0fa,null));};
\ No newline at end of file
+var _0x3941=['filename','extname','unlink','Not\x20found','find','Entity\x20not\x20found','info','isNil','File:\x20\x22','\x22\x20trovato\x20eseguo\x20la\x20cancellazione','unlinkSync','.cypher','eml-format','zip-dir','fast-json-patch','request-promise','moment','mustache','util','path','sox','to-csv','ejs','lodash','crypto','jsforce','querystring','papaparse','../../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','then','destroy','error','stack','name','send','map','ScreenRecording','rawAttributes','fieldName','key','model','differenceBy','format','query','filters','intersection','attributes','fields','hasOwnProperty','nolimit','order','sort','where','VIRTUAL','merge','includeAll','include','findAll','rows','catch','show','params','keys','length','create','body','update','duration','closedAt','value','download','type','uniqueid','join','root','server/files/screen_recordings','%s.cypher','existsSync','decryptFile','secrets','recording','Sequelize','ValidationError','ScreenRecording\x20not\x20found'];(function(_0x42cae2,_0x284ef8){var _0x5f256f=function(_0x41abc8){while(--_0x41abc8){_0x42cae2['push'](_0x42cae2['shift']());}};_0x5f256f(++_0x284ef8);}(_0x3941,0x71));var _0x1394=function(_0x20cfdb,_0x5d0b89){_0x20cfdb=_0x20cfdb-0x0;var _0x42d771=_0x3941[_0x20cfdb];return _0x42d771;};'use strict';var pdf=require('html-pdf');var emlformat=require(_0x1394('0x0'));var rimraf=require('rimraf');var zipdir=require(_0x1394('0x1'));var jsonpatch=require(_0x1394('0x2'));var rp=require(_0x1394('0x3'));var moment=require(_0x1394('0x4'));var BPromise=require('bluebird');var Mustache=require(_0x1394('0x5'));var util=require(_0x1394('0x6'));var path=require(_0x1394('0x7'));var sox=require(_0x1394('0x8'));var csv=require(_0x1394('0x9'));var ejs=require(_0x1394('0xa'));var fs=require('fs');var _=require(_0x1394('0xb'));var squel=require('squel');var crypto=require(_0x1394('0xc'));var jsforce=require(_0x1394('0xd'));var deskjs=require('desk.js');var toCsv=require(_0x1394('0x9'));var querystring=require(_0x1394('0xe'));var Papa=require(_0x1394('0xf'));var Redis=require('ioredis');var authService=require('../../components/auth/service');var qs=require('../../components/parsers/qs');var as=require(_0x1394('0x10'));var hardwareService=require(_0x1394('0x11'));var logger=require(_0x1394('0x12'))(_0x1394('0x13'));var utils=require(_0x1394('0x14'));var config=require('../../config/environment');var db=require(_0x1394('0x15'))['db'];function respondWithStatusCode(_0x36e9d2,_0x5a6405){_0x5a6405=_0x5a6405||0xcc;return function(_0x25a654){if(_0x25a654){return _0x36e9d2[_0x1394('0x16')](_0x5a6405);}return _0x36e9d2[_0x1394('0x17')](_0x5a6405)[_0x1394('0x18')]();};}function respondWithResult(_0x512a3e,_0x38c6dc){_0x38c6dc=_0x38c6dc||0xc8;return function(_0x4b952e){if(_0x4b952e){return _0x512a3e['status'](_0x38c6dc)[_0x1394('0x19')](_0x4b952e);}};}function respondWithFilteredResult(_0x173d7b,_0x5b7a48){return function(_0x19ac5a){if(_0x19ac5a){var _0x48e428=_0x19ac5a[_0x1394('0x1a')],_0x15fbc3=_0x5b7a48[_0x1394('0x1b')],_0x59a5e7=_0x5b7a48[_0x1394('0x1b')]+_0x5b7a48[_0x1394('0x1c')],_0x1e64dc;if(_0x59a5e7>=_0x48e428){_0x59a5e7=_0x48e428;_0x1e64dc=0xc8;}else{_0x1e64dc=0xce;}_0x173d7b['status'](_0x1e64dc);return _0x173d7b[_0x1394('0x1d')](_0x1394('0x1e'),_0x15fbc3+'-'+_0x59a5e7+'/'+_0x48e428)[_0x1394('0x19')](_0x19ac5a);}return null;};}function patchUpdates(_0x3a60c){return function(_0x3bf9c7){try{jsonpatch[_0x1394('0x1f')](_0x3bf9c7,_0x3a60c,!![]);}catch(_0x2d326d){return BPromise[_0x1394('0x20')](_0x2d326d);}return _0x3bf9c7[_0x1394('0x21')]();};}function saveUpdates(_0x164db0,_0x22fe83){return function(_0x1cef43){if(_0x1cef43){return _0x1cef43['update'](_0x164db0)[_0x1394('0x22')](function(_0x51c357){return _0x51c357;});}return null;};}function removeEntity(_0x10e157,_0x386c85){return function(_0x4b206c){if(_0x4b206c){return _0x4b206c[_0x1394('0x23')]()['then'](function(){_0x10e157['status'](0xcc)[_0x1394('0x18')]();});}};}function handleEntityNotFound(_0x417576,_0x1bed57){return function(_0x3ac799){if(!_0x3ac799){_0x417576['sendStatus'](0x194);}return _0x3ac799;};}function handleError(_0x1f31a9,_0x21c513){_0x21c513=_0x21c513||0x1f4;return function(_0x310466){logger[_0x1394('0x24')](_0x310466[_0x1394('0x25')]);if(_0x310466[_0x1394('0x26')]){delete _0x310466[_0x1394('0x26')];}_0x1f31a9[_0x1394('0x17')](_0x21c513)[_0x1394('0x27')](_0x310466);};}exports['index']=function(_0x4095e7,_0x426883){var _0x1e56f1={},_0x4384d5={},_0x38fa82={'count':0x0,'rows':[]};var _0x22f675=_[_0x1394('0x28')](db[_0x1394('0x29')][_0x1394('0x2a')],function(_0x33c665){return{'name':_0x33c665[_0x1394('0x2b')],'type':_0x33c665['type'][_0x1394('0x2c')]};});_0x4384d5[_0x1394('0x2d')]=_[_0x1394('0x2e')](_[_0x1394('0x28')](_0x22f675,_0x1394('0x26')),[_0x1394('0x2f')]);_0x4384d5[_0x1394('0x30')]=_['keys'](_0x4095e7[_0x1394('0x30')]);_0x4384d5[_0x1394('0x31')]=_[_0x1394('0x32')](_0x4384d5['model'],_0x4384d5['query']);_0x1e56f1[_0x1394('0x33')]=_[_0x1394('0x32')](_0x4384d5[_0x1394('0x2d')],qs[_0x1394('0x34')](_0x4095e7[_0x1394('0x30')]['fields']));_0x1e56f1['attributes']=_0x1e56f1[_0x1394('0x33')]['length']?_0x1e56f1[_0x1394('0x33')]:_0x4384d5['model'];if(!_0x4095e7[_0x1394('0x30')][_0x1394('0x35')](_0x1394('0x36'))){_0x1e56f1[_0x1394('0x1c')]=qs['limit'](_0x4095e7['query'][_0x1394('0x1c')]);_0x1e56f1[_0x1394('0x1b')]=qs['offset'](_0x4095e7[_0x1394('0x30')][_0x1394('0x1b')]);}_0x1e56f1[_0x1394('0x37')]=qs[_0x1394('0x38')](_0x4095e7[_0x1394('0x30')][_0x1394('0x38')]);_0x1e56f1[_0x1394('0x39')]=qs[_0x1394('0x31')](_['pick'](_0x4095e7['query'],_0x4384d5[_0x1394('0x31')]));if(_0x4095e7[_0x1394('0x30')]['filter']){_0x1e56f1['where']=_['merge'](_0x1e56f1['where'],{'$or':_['map'](_0x22f675,function(_0x1f81ba){if(_0x1f81ba['type']!==_0x1394('0x3a')){var _0x336395={};_0x336395[_0x1f81ba[_0x1394('0x26')]]={'$like':'%'+_0x4095e7[_0x1394('0x30')]['filter']+'%'};return _0x336395;}})});}_0x1e56f1=_[_0x1394('0x3b')]({},_0x1e56f1,_0x4095e7['options']);var _0x5eaa1c={'where':_0x1e56f1[_0x1394('0x39')]};return db[_0x1394('0x29')][_0x1394('0x1a')](_0x5eaa1c)[_0x1394('0x22')](function(_0x154501){_0x38fa82['count']=_0x154501;if(_0x4095e7[_0x1394('0x30')][_0x1394('0x3c')]){_0x1e56f1[_0x1394('0x3d')]=[{'all':!![]}];}return db['ScreenRecording'][_0x1394('0x3e')](_0x1e56f1);})[_0x1394('0x22')](function(_0x4c26d2){_0x38fa82[_0x1394('0x3f')]=_0x4c26d2;return _0x38fa82;})[_0x1394('0x22')](respondWithFilteredResult(_0x426883,_0x1e56f1))[_0x1394('0x40')](handleError(_0x426883,null));};exports[_0x1394('0x41')]=function(_0x1c7fd8,_0x285602){var _0x23555b={'raw':![],'where':{'id':_0x1c7fd8[_0x1394('0x42')]['id']}},_0x586e44={};_0x586e44['model']=_['keys'](db['ScreenRecording'][_0x1394('0x2a')]);_0x586e44[_0x1394('0x30')]=_[_0x1394('0x43')](_0x1c7fd8[_0x1394('0x30')]);_0x586e44['filters']=_[_0x1394('0x32')](_0x586e44[_0x1394('0x2d')],_0x586e44['query']);_0x23555b['attributes']=_[_0x1394('0x32')](_0x586e44[_0x1394('0x2d')],qs[_0x1394('0x34')](_0x1c7fd8['query']['fields']));_0x23555b[_0x1394('0x33')]=_0x23555b['attributes'][_0x1394('0x44')]?_0x23555b[_0x1394('0x33')]:_0x586e44[_0x1394('0x2d')];if(_0x1c7fd8['query'][_0x1394('0x3c')]){_0x23555b[_0x1394('0x3d')]=[{'all':!![]}];}_0x23555b=_[_0x1394('0x3b')]({},_0x23555b,_0x1c7fd8['options']);return db[_0x1394('0x29')]['find'](_0x23555b)['then'](handleEntityNotFound(_0x285602,null))[_0x1394('0x22')](respondWithResult(_0x285602,null))['catch'](handleError(_0x285602,null));};exports[_0x1394('0x45')]=function(_0x2c292a,_0x45d732){return db[_0x1394('0x29')]['create'](_0x2c292a[_0x1394('0x46')],{})[_0x1394('0x22')](respondWithResult(_0x45d732,0xc9))[_0x1394('0x40')](handleError(_0x45d732,null));};exports[_0x1394('0x47')]=function(_0xd44b47,_0x588a56){if(_0xd44b47[_0x1394('0x46')]['id']){delete _0xd44b47[_0x1394('0x46')]['id'];}delete _0xd44b47[_0x1394('0x46')][_0x1394('0x48')];delete _0xd44b47[_0x1394('0x46')]['createdAt'];delete _0xd44b47[_0x1394('0x46')][_0x1394('0x49')];delete _0xd44b47[_0x1394('0x46')][_0x1394('0x4a')];return db[_0x1394('0x29')]['find']({'where':{'id':_0xd44b47['params']['id']}})['then'](handleEntityNotFound(_0x588a56,null))['then'](saveUpdates(_0xd44b47[_0x1394('0x46')],null))[_0x1394('0x22')](respondWithResult(_0x588a56,null))['catch'](handleError(_0x588a56,null));};exports['describe']=function(_0x39ba88,_0x4ea2e0){return db[_0x1394('0x29')]['describe']()['then'](respondWithResult(_0x4ea2e0,null))[_0x1394('0x40')](handleError(_0x4ea2e0,null));};exports[_0x1394('0x4b')]=function(_0x363d88,_0x123620,_0x3bf19f){var _0x553f05=require('../../components/encryptor');var _0x5e9227=![];var _0x53a947={};if(_0x363d88[_0x1394('0x30')][_0x1394('0x4c')]&&_0x363d88[_0x1394('0x30')][_0x1394('0x4c')]==='uniqueid'){_0x53a947[_0x1394('0x4d')]=_0x363d88[_0x1394('0x42')]['id'];}else{_0x53a947['id']=_0x363d88['params']['id'];}return db['ScreenRecording']['find']({'where':_0x53a947,'attributes':['id',_0x1394('0x4a')],'raw':!![]})[_0x1394('0x22')](handleEntityNotFound(_0x123620,null))[_0x1394('0x22')](function(_0x24d070){if(_0x24d070){var _0x2ee580=path[_0x1394('0x4e')](config[_0x1394('0x4f')],_0x1394('0x50'),_0x24d070[_0x1394('0x4a')]);var _0x3216e1=util[_0x1394('0x2f')](_0x1394('0x51'),_0x2ee580);if(fs[_0x1394('0x52')](_0x3216e1)){_0x5e9227=!![];return _0x553f05[_0x1394('0x53')](_0x3216e1,_0x2ee580,config[_0x1394('0x54')][_0x1394('0x55')])[_0x1394('0x22')](function(){return _0x24d070;});}return _0x24d070;}})[_0x1394('0x22')](function(_0x43823d){if(_0x43823d){var _0x3516a6=path[_0x1394('0x4e')](config[_0x1394('0x4f')],_0x1394('0x50'),_0x43823d[_0x1394('0x4a')]);if(!fs[_0x1394('0x52')](_0x3516a6)){throw new db[(_0x1394('0x56'))][(_0x1394('0x57'))](_0x1394('0x58'));}if(_0x43823d['filename']){return _0x123620[_0x1394('0x4b')](_0x3516a6,_0x43823d[_0x1394('0x59')]+path[_0x1394('0x5a')](_0x3516a6),function(){if(_0x5e9227){fs['unlink'](_0x3516a6);}});}else{return _0x123620['download'](_0x3516a6,function(_0x17793b){if(_0x5e9227){fs[_0x1394('0x5b')](_0x3516a6);}});}}})['catch'](function(_0x204da3){if(_0x204da3['message']===_0x1394('0x58')){_0x123620[_0x1394('0x17')](0x194)[_0x1394('0x27')](_0x1394('0x5c'));}else{return handleError(_0x123620,null);}});};exports['destroy']=function(_0x411209,_0x2990e3){return db[_0x1394('0x29')][_0x1394('0x5d')]({'where':{'id':_0x411209[_0x1394('0x42')]['id']}})[_0x1394('0x22')](function(_0x3cecb5){if(!_0x3cecb5)throw new ReferenceError(_0x1394('0x5e'));return _0x3cecb5;})[_0x1394('0x22')](function(_0x3edbac){var _0x1adf76=path[_0x1394('0x4e')](config[_0x1394('0x4f')],'server/files/screen_recordings',_0x3edbac[_0x1394('0x4a')]);logger[_0x1394('0x5f')]('cancellazione\x20fisica\x20documento\x20%s',_0x1adf76);if(!_[_0x1394('0x60')](_0x3edbac[_0x1394('0x4a')])&&fs[_0x1394('0x52')](_0x1adf76)){logger['info'](_0x1394('0x61')+_0x1adf76+_0x1394('0x62'));fs[_0x1394('0x63')](_0x1adf76);}_0x1adf76=_0x1adf76+_0x1394('0x64');if(!_['isNil'](_0x3edbac[_0x1394('0x4a')])&&fs[_0x1394('0x52')](_0x1adf76)){logger[_0x1394('0x5f')](_0x1394('0x61')+_0x1adf76+'\x22\x20trovato\x20eseguo\x20la\x20cancellazione');fs[_0x1394('0x63')](_0x1adf76);}return _0x3edbac;})[_0x1394('0x22')](function(_0x343606){if(!_0x343606)throw new InternalError();return _0x343606[_0x1394('0x23')]();})[_0x1394('0x22')](function(){_0x2990e3['status'](0xcc)['end']();})['catch'](handleError(_0x2990e3,null));};
\ No newline at end of file
diff --git a/server/api/screenRecording/screenRecording.model.js b/server/api/screenRecording/screenRecording.model.js
index f43ed3a..30e8146 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 _0x2d23=['./screenRecording.attributes','exports','ScreenRecording','interactionid','../../config/logger','api','moment','bluebird','request-promise','rimraf'];(function(_0x29cf40,_0x39a4ec){var _0x300e9b=function(_0x578526){while(--_0x578526){_0x29cf40['push'](_0x29cf40['shift']());}};_0x300e9b(++_0x39a4ec);}(_0x2d23,0xc2));var _0x32d2=function(_0xd65404,_0x31eee){_0xd65404=_0xd65404-0x0;var _0xd1dc70=_0x2d23[_0xd65404];return _0xd1dc70;};'use strict';var _=require('lodash');var util=require('util');var logger=require(_0x32d2('0x0'))(_0x32d2('0x1'));var moment=require(_0x32d2('0x2'));var BPromise=require(_0x32d2('0x3'));var rp=require(_0x32d2('0x4'));var fs=require('fs');var path=require('path');var rimraf=require(_0x32d2('0x5'));var config=require('../../config/environment');var attributes=require(_0x32d2('0x6'));module[_0x32d2('0x7')]=function(_0x7ee341,_0xfc33d1){return _0x7ee341['define'](_0x32d2('0x8'),attributes,{'tableName':'screen_recordings','paranoid':![],'indexes':[{'name':_0x32d2('0x9'),'fields':[_0x32d2('0x9')]}],'timestamps':!![]});};
\ No newline at end of file
+var _0x4223=['../../config/logger','api','bluebird','request-promise','path','../../config/environment','./screenRecording.attributes','exports','define','screen_recordings','interactionid','util'];(function(_0x551b0a,_0x41348c){var _0x5dacb8=function(_0x1123cf){while(--_0x1123cf){_0x551b0a['push'](_0x551b0a['shift']());}};_0x5dacb8(++_0x41348c);}(_0x4223,0x173));var _0x3422=function(_0x49e78b,_0x2c2714){_0x49e78b=_0x49e78b-0x0;var _0x249257=_0x4223[_0x49e78b];return _0x249257;};'use strict';var _=require('lodash');var util=require(_0x3422('0x0'));var logger=require(_0x3422('0x1'))(_0x3422('0x2'));var moment=require('moment');var BPromise=require(_0x3422('0x3'));var rp=require(_0x3422('0x4'));var fs=require('fs');var path=require(_0x3422('0x5'));var rimraf=require('rimraf');var config=require(_0x3422('0x6'));var attributes=require(_0x3422('0x7'));module[_0x3422('0x8')]=function(_0x1360b1,_0x5799e3){return _0x1360b1[_0x3422('0x9')]('ScreenRecording',attributes,{'tableName':_0x3422('0xa'),'paranoid':![],'indexes':[{'name':_0x3422('0xb'),'fields':[_0x3422('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 0cdb2c7..1a13164 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(_0x26175d,_0x51a520){var _0x2f9c0e=function(_0xcb637a){while(--_0xcb637a){_0x26175d['push'](_0x26175d['shift']());}};_0x2f9c0e(++_0x51a520);}(_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 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(_0x1872ef,_0x5c24d9){var _0x30213d=function(_0x5a098a){while(--_0x5a098a){_0x1872ef['push'](_0x1872ef['shift']());}};_0x30213d(++_0x5c24d9);}(_0xa9e0,0x123));var _0x0a9e=function(_0x481bf7,_0x437f69){_0x481bf7=_0x481bf7-0x0;var _0x461787=_0xa9e0[_0x481bf7];return _0x461787;};'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 9884285..b0e1251 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 _0x22a4=['/:id/favicon','getFavicon','diskStorage','join','root','server/files/images/logos/','format','logo','originalname','post','single','file','addLogo','%s%s','logologin','preferred','extname','addPreferred','favicon','addFavicon','put','update','multer','util','express','../../components/auth/service','../../config/environment','./setting.controller','get','index','show','/:id/logo','getLogo','/:id/logo_login','getLogoLogin','/:id/gdpr','gdpr','/:id/preferred'];(function(_0x315b7c,_0x19ff8e){var _0x3a99eb=function(_0x21afc2){while(--_0x21afc2){_0x315b7c['push'](_0x315b7c['shift']());}};_0x3a99eb(++_0x19ff8e);}(_0x22a4,0x1de));var _0x422a=function(_0x7bf6be,_0x3aaffd){_0x7bf6be=_0x7bf6be-0x0;var _0x16f259=_0x22a4[_0x7bf6be];return _0x16f259;};'use strict';var multer=require(_0x422a('0x0'));var util=require(_0x422a('0x1'));var path=require('path');var timeout=require('connect-timeout');var express=require(_0x422a('0x2'));var router=express['Router']();var auth=require(_0x422a('0x3'));var interaction=require('../../components/interaction/service');var config=require(_0x422a('0x4'));var controller=require(_0x422a('0x5'));router[_0x422a('0x6')]('/',auth['isAuthenticated'](),controller[_0x422a('0x7')]);router[_0x422a('0x6')]('/:id',controller[_0x422a('0x8')]);router[_0x422a('0x6')](_0x422a('0x9'),controller[_0x422a('0xa')]);router['get'](_0x422a('0xb'),controller[_0x422a('0xc')]);router[_0x422a('0x6')](_0x422a('0xd'),controller[_0x422a('0xe')]);router[_0x422a('0x6')](_0x422a('0xf'),controller['getPreferred']);router['get'](_0x422a('0x10'),controller[_0x422a('0x11')]);var upload=multer({'storage':multer[_0x422a('0x12')]({'destination':function(_0x55c92c,_0x343fc9,_0x1ddfea){_0x1ddfea(null,path[_0x422a('0x13')](config[_0x422a('0x14')],_0x422a('0x15')));},'filename':function(_0x2faa72,_0x5acd62,_0x212d61){_0x212d61(null,util[_0x422a('0x16')]('%s%s',_0x422a('0x17'),path['extname'](_0x5acd62[_0x422a('0x18')])));}})});router[_0x422a('0x19')]('/:id/logo',upload[_0x422a('0x1a')](_0x422a('0x1b')),controller[_0x422a('0x1c')]);var upload=multer({'storage':multer[_0x422a('0x12')]({'destination':function(_0x31e58a,_0x1576ae,_0x47fd63){_0x47fd63(null,path['join'](config[_0x422a('0x14')],'server/files/images/logos/'));},'filename':function(_0x39a44a,_0x54c4a4,_0x15a04b){_0x15a04b(null,util[_0x422a('0x16')](_0x422a('0x1d'),_0x422a('0x1e'),path['extname'](_0x54c4a4[_0x422a('0x18')])));}})});router[_0x422a('0x19')](_0x422a('0xb'),upload[_0x422a('0x1a')](_0x422a('0x1b')),controller['addLogoLogin']);var upload=multer({'storage':multer[_0x422a('0x12')]({'destination':function(_0x1e70fb,_0xbd601f,_0x1f98ed){_0x1f98ed(null,path[_0x422a('0x13')](config['root'],_0x422a('0x15')));},'filename':function(_0x425b69,_0x289182,_0x4b3413){_0x4b3413(null,util[_0x422a('0x16')](_0x422a('0x1d'),_0x422a('0x1f'),path[_0x422a('0x20')](_0x289182[_0x422a('0x18')])));}})});router[_0x422a('0x19')]('/:id/preferred',upload[_0x422a('0x1a')](_0x422a('0x1b')),controller[_0x422a('0x21')]);var upload=multer({'storage':multer['diskStorage']({'destination':function(_0x2d775a,_0xef684f,_0x687bc5){_0x687bc5(null,path[_0x422a('0x13')](config['root'],_0x422a('0x15')));},'filename':function(_0x343389,_0x276a7,_0x5c83f4){_0x5c83f4(null,util[_0x422a('0x16')](_0x422a('0x1d'),_0x422a('0x22'),path[_0x422a('0x20')](_0x276a7[_0x422a('0x18')])));}})});router[_0x422a('0x19')]('/:id/favicon',upload[_0x422a('0x1a')](_0x422a('0x1b')),controller[_0x422a('0x23')]);router[_0x422a('0x24')]('/:id',auth['isAuthenticated'](),controller[_0x422a('0x25')]);module['exports']=router;
\ No newline at end of file
+var _0xd5e0=['connect-timeout','Router','../../components/auth/service','../../components/interaction/service','../../config/environment','./setting.controller','get','show','/:id/logo','/:id/logo_login','getLogoLogin','/:id/preferred','getPreferred','getFavicon','diskStorage','join','root','format','%s%s','logo','extname','originalname','post','single','server/files/images/logos/','addLogoLogin','preferred','addPreferred','favicon','/:id/favicon','file','addFavicon','/:id','update','exports','path'];(function(_0x3f9340,_0x447b72){var _0x6333ca=function(_0x5aeba2){while(--_0x5aeba2){_0x3f9340['push'](_0x3f9340['shift']());}};_0x6333ca(++_0x447b72);}(_0xd5e0,0xb3));var _0x0d5e=function(_0x377fc7,_0x159b9a){_0x377fc7=_0x377fc7-0x0;var _0x44d3e0=_0xd5e0[_0x377fc7];return _0x44d3e0;};'use strict';var multer=require('multer');var util=require('util');var path=require(_0x0d5e('0x0'));var timeout=require(_0x0d5e('0x1'));var express=require('express');var router=express[_0x0d5e('0x2')]();var auth=require(_0x0d5e('0x3'));var interaction=require(_0x0d5e('0x4'));var config=require(_0x0d5e('0x5'));var controller=require(_0x0d5e('0x6'));router['get']('/',auth['isAuthenticated'](),controller['index']);router[_0x0d5e('0x7')]('/:id',controller[_0x0d5e('0x8')]);router[_0x0d5e('0x7')](_0x0d5e('0x9'),controller['getLogo']);router[_0x0d5e('0x7')](_0x0d5e('0xa'),controller[_0x0d5e('0xb')]);router[_0x0d5e('0x7')]('/:id/gdpr',controller['gdpr']);router[_0x0d5e('0x7')](_0x0d5e('0xc'),controller[_0x0d5e('0xd')]);router[_0x0d5e('0x7')]('/:id/favicon',controller[_0x0d5e('0xe')]);var upload=multer({'storage':multer[_0x0d5e('0xf')]({'destination':function(_0x4b02af,_0x9c5277,_0x2047e0){_0x2047e0(null,path[_0x0d5e('0x10')](config[_0x0d5e('0x11')],'server/files/images/logos/'));},'filename':function(_0x463e59,_0x4acd4e,_0x29708c){_0x29708c(null,util[_0x0d5e('0x12')](_0x0d5e('0x13'),_0x0d5e('0x14'),path[_0x0d5e('0x15')](_0x4acd4e[_0x0d5e('0x16')])));}})});router[_0x0d5e('0x17')](_0x0d5e('0x9'),upload[_0x0d5e('0x18')]('file'),controller['addLogo']);var upload=multer({'storage':multer[_0x0d5e('0xf')]({'destination':function(_0x44ddb0,_0xaa4d2a,_0x466a10){_0x466a10(null,path['join'](config[_0x0d5e('0x11')],_0x0d5e('0x19')));},'filename':function(_0x34d642,_0x180ba2,_0x411580){_0x411580(null,util[_0x0d5e('0x12')](_0x0d5e('0x13'),'logologin',path['extname'](_0x180ba2[_0x0d5e('0x16')])));}})});router['post'](_0x0d5e('0xa'),upload['single']('file'),controller[_0x0d5e('0x1a')]);var upload=multer({'storage':multer[_0x0d5e('0xf')]({'destination':function(_0x583d75,_0x3843aa,_0x14eb85){_0x14eb85(null,path[_0x0d5e('0x10')](config[_0x0d5e('0x11')],_0x0d5e('0x19')));},'filename':function(_0x2660a7,_0x2b8d8b,_0x14b863){_0x14b863(null,util[_0x0d5e('0x12')]('%s%s',_0x0d5e('0x1b'),path[_0x0d5e('0x15')](_0x2b8d8b[_0x0d5e('0x16')])));}})});router[_0x0d5e('0x17')]('/:id/preferred',upload[_0x0d5e('0x18')]('file'),controller[_0x0d5e('0x1c')]);var upload=multer({'storage':multer[_0x0d5e('0xf')]({'destination':function(_0x373d76,_0x21d0bc,_0x2b4a3a){_0x2b4a3a(null,path[_0x0d5e('0x10')](config[_0x0d5e('0x11')],'server/files/images/logos/'));},'filename':function(_0x385b2f,_0x4c6806,_0x79e623){_0x79e623(null,util[_0x0d5e('0x12')](_0x0d5e('0x13'),_0x0d5e('0x1d'),path[_0x0d5e('0x15')](_0x4c6806[_0x0d5e('0x16')])));}})});router[_0x0d5e('0x17')](_0x0d5e('0x1e'),upload[_0x0d5e('0x18')](_0x0d5e('0x1f')),controller[_0x0d5e('0x20')]);router['put'](_0x0d5e('0x21'),auth['isAuthenticated'](),controller[_0x0d5e('0x22')]);module[_0x0d5e('0x23')]=router;
\ No newline at end of file
diff --git a/server/api/setting/setting.attributes.js b/server/api/setting/setting.attributes.js
index 584457c..2a137c0 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 _0xb8f0=['STRING','BOOLEAN','https://www.xcally.com/bar/phonebar/autoupdater.xml','alternate','sequelize','exports','INTEGER','min_internal','min_mailbox'];(function(_0x2c66fc,_0x132b6a){var _0x29ef9e=function(_0x128602){while(--_0x128602){_0x2c66fc['push'](_0x2c66fc['shift']());}};_0x29ef9e(++_0x132b6a);}(_0xb8f0,0x112));var _0x0b8f=function(_0x25196,_0x1dc0a6){_0x25196=_0x25196-0x0;var _0x198d4c=_0xb8f0[_0x25196];return _0x198d4c;};'use strict';var Sequelize=require(_0x0b8f('0x0'));module[_0x0b8f('0x1')]={'min_internal':{'type':Sequelize[_0x0b8f('0x2')](0xb),'unique':_0x0b8f('0x3'),'defaultValue':0x3e8},'min_mailbox':{'type':Sequelize['INTEGER'](0xb),'unique':_0x0b8f('0x4'),'defaultValue':0x3e8},'agi_port':{'type':Sequelize[_0x0b8f('0x2')](0xb),'defaultValue':0x11dd},'soundPath':{'type':Sequelize[_0x0b8f('0x5')],'defaultValue':'/var/opt/motion2/server/files/sounds/converted'},'logo':{'type':Sequelize[_0x0b8f('0x5')]},'defaultLogo':{'type':Sequelize[_0x0b8f('0x6')],'defaultValue':!![]},'loginLogo':{'type':Sequelize[_0x0b8f('0x5')]},'defaultLoginLogo':{'type':Sequelize['BOOLEAN'],'defaultValue':!![]},'headerWhiteLabel':{'type':Sequelize[_0x0b8f('0x5')]},'defaultHeaderWhiteLabel':{'type':Sequelize[_0x0b8f('0x6')],'defaultValue':!![]},'securePassword':{'type':Sequelize[_0x0b8f('0x6')],'defaultValue':!![]},'firstSetup':{'type':Sequelize[_0x0b8f('0x6')],'defaultValue':!![]},'stunaddr':{'type':Sequelize[_0x0b8f('0x5')]},'turnaddr':{'type':Sequelize[_0x0b8f('0x5')]},'turnusername':{'type':Sequelize[_0x0b8f('0x5')]},'turnpassword':{'type':Sequelize['STRING']},'pageTitle':{'type':Sequelize['STRING']},'defaultPageTitle':{'type':Sequelize[_0x0b8f('0x6')],'defaultValue':!![]},'callRecordingEncryption':{'type':Sequelize[_0x0b8f('0x6')],'defaultValue':![]},'passwordExpiresDays':{'type':Sequelize[_0x0b8f('0x2')](0xb),'defaultValue':0x5a},'phoneBarAutoUpdater':{'type':Sequelize[_0x0b8f('0x6')],'defaultValue':!![]},'phoneBarAutoUpdaterUrl':{'type':Sequelize[_0x0b8f('0x5')],'defaultValue':_0x0b8f('0x7')},'enableEmailPreview':{'type':Sequelize[_0x0b8f('0x6')],'defaultValue':![]},'split':{'type':Sequelize[_0x0b8f('0x6')],'defaultValue':!![]},'splitSizeCsv':{'type':Sequelize['INTEGER'],'defaultValue':0x1388},'splitSizePdf':{'type':Sequelize[_0x0b8f('0x2')],'defaultValue':0x1388},'splitSizeXlsx':{'type':Sequelize[_0x0b8f('0x2')],'defaultValue':0x1388},'messagesAlignment':{'type':Sequelize[_0x0b8f('0x5')],'defaultValue':_0x0b8f('0x8')},'chatTimeout':{'type':Sequelize[_0x0b8f('0x2')],'defaultValue':0x1e},'phoneBarRememberMeEnabled':{'type':Sequelize[_0x0b8f('0x6')],'defaultValue':!![]},'preferred':{'type':Sequelize[_0x0b8f('0x5')]},'defaultPreferred':{'type':Sequelize[_0x0b8f('0x6')],'defaultValue':!![]},'rtlSupport':{'type':Sequelize[_0x0b8f('0x6')],'defaultValue':![]},'defaultScreenRecordingPath':{'type':Sequelize[_0x0b8f('0x5')]},'allowedLoginAttempts':{'type':Sequelize[_0x0b8f('0x2')],'defaultValue':0x5},'blockDuration':{'type':Sequelize[_0x0b8f('0x2')],'defaultValue':0xa},'favicon':{'type':Sequelize[_0x0b8f('0x5')]},'defaultFavicon':{'type':Sequelize[_0x0b8f('0x6')],'defaultValue':!![]},'loginMailFrequency':{'type':Sequelize['INTEGER'],'defaultValue':0xa,'validate':{'min':0xa}},'googleSsoEnabled':{'type':Sequelize['BOOLEAN'],'defaultValue':![]}};
\ No newline at end of file
+var _0xcf4a=['exports','INTEGER','min_internal','min_mailbox','STRING','BOOLEAN','https://www.xcally.com/bar/phonebar/autoupdater.xml','alternate','sequelize'];(function(_0x287795,_0x37bc44){var _0x594dde=function(_0xa48627){while(--_0xa48627){_0x287795['push'](_0x287795['shift']());}};_0x594dde(++_0x37bc44);}(_0xcf4a,0x14c));var _0xacf4=function(_0x543c2d,_0x1eb3f7){_0x543c2d=_0x543c2d-0x0;var _0x3cac8a=_0xcf4a[_0x543c2d];return _0x3cac8a;};'use strict';var Sequelize=require(_0xacf4('0x0'));module[_0xacf4('0x1')]={'min_internal':{'type':Sequelize[_0xacf4('0x2')](0xb),'unique':_0xacf4('0x3'),'defaultValue':0x3e8},'min_mailbox':{'type':Sequelize[_0xacf4('0x2')](0xb),'unique':_0xacf4('0x4'),'defaultValue':0x3e8},'agi_port':{'type':Sequelize[_0xacf4('0x2')](0xb),'defaultValue':0x11dd},'soundPath':{'type':Sequelize[_0xacf4('0x5')],'defaultValue':'/var/opt/motion2/server/files/sounds/converted'},'logo':{'type':Sequelize[_0xacf4('0x5')]},'defaultLogo':{'type':Sequelize[_0xacf4('0x6')],'defaultValue':!![]},'loginLogo':{'type':Sequelize['STRING']},'defaultLoginLogo':{'type':Sequelize[_0xacf4('0x6')],'defaultValue':!![]},'headerWhiteLabel':{'type':Sequelize['STRING']},'defaultHeaderWhiteLabel':{'type':Sequelize[_0xacf4('0x6')],'defaultValue':!![]},'securePassword':{'type':Sequelize[_0xacf4('0x6')],'defaultValue':!![]},'firstSetup':{'type':Sequelize['BOOLEAN'],'defaultValue':!![]},'stunaddr':{'type':Sequelize['STRING']},'turnaddr':{'type':Sequelize[_0xacf4('0x5')]},'turnusername':{'type':Sequelize[_0xacf4('0x5')]},'turnpassword':{'type':Sequelize['STRING']},'pageTitle':{'type':Sequelize[_0xacf4('0x5')]},'defaultPageTitle':{'type':Sequelize[_0xacf4('0x6')],'defaultValue':!![]},'callRecordingEncryption':{'type':Sequelize[_0xacf4('0x6')],'defaultValue':![]},'passwordExpiresDays':{'type':Sequelize['INTEGER'](0xb),'defaultValue':0x5a},'phoneBarAutoUpdater':{'type':Sequelize[_0xacf4('0x6')],'defaultValue':!![]},'phoneBarAutoUpdaterUrl':{'type':Sequelize['STRING'],'defaultValue':_0xacf4('0x7')},'enableEmailPreview':{'type':Sequelize[_0xacf4('0x6')],'defaultValue':![]},'split':{'type':Sequelize[_0xacf4('0x6')],'defaultValue':!![]},'splitSizeCsv':{'type':Sequelize['INTEGER'],'defaultValue':0x1388},'splitSizePdf':{'type':Sequelize[_0xacf4('0x2')],'defaultValue':0x1388},'splitSizeXlsx':{'type':Sequelize[_0xacf4('0x2')],'defaultValue':0x1388},'messagesAlignment':{'type':Sequelize['STRING'],'defaultValue':_0xacf4('0x8')},'chatTimeout':{'type':Sequelize['INTEGER'],'defaultValue':0x1e},'phoneBarRememberMeEnabled':{'type':Sequelize[_0xacf4('0x6')],'defaultValue':!![]},'preferred':{'type':Sequelize[_0xacf4('0x5')]},'defaultPreferred':{'type':Sequelize['BOOLEAN'],'defaultValue':!![]},'rtlSupport':{'type':Sequelize[_0xacf4('0x6')],'defaultValue':![]},'defaultScreenRecordingPath':{'type':Sequelize[_0xacf4('0x5')]},'allowedLoginAttempts':{'type':Sequelize[_0xacf4('0x2')],'defaultValue':0x5},'blockDuration':{'type':Sequelize[_0xacf4('0x2')],'defaultValue':0xa},'favicon':{'type':Sequelize[_0xacf4('0x5')]},'defaultFavicon':{'type':Sequelize['BOOLEAN'],'defaultValue':!![]},'loginMailFrequency':{'type':Sequelize['INTEGER'],'defaultValue':0xa,'validate':{'min':0xa}},'googleSsoEnabled':{'type':Sequelize[_0xacf4('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 c32528c..b62daf3 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 _0x6597=['intersection','fields','attributes','nolimit','limit','order','sort','where','pick','merge','filter','options','includeAll','include','findAll','catch','show','params','length','find','body','file','filename','logo','addLogoLogin','loginLogo','getLogo','server/files/images/logos','getLicense','favicon','defaultLogo','defaultLoginLogo','defaultPreferred','defaultFavicon','existsSync','join','root','toLower','default','upperFirst','custom','default_logo.png','Sequelize','\x20not\x20found','download','../../config/license/util','preferred','gdpr','securePassword','addPreferred','getPreferred','default_preferred.png','addFavicon','getFavicon','html-pdf','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','moment','bluebird','mustache','util','path','sox','ejs','lodash','squel','crypto','jsforce','desk.js','to-csv','querystring','papaparse','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/environment','../../mysqldb','jayson/promise','client','http','ValidationError','The\x20password\x20must\x20be\x20at\x20least\x208\x20characters\x20long\x20and\x20have\x201\x20lowercase\x20character,\x201\x20uppercase\x20character,\x201\x20number\x20and\x201\x20special\x20character\x20~!@#$%^&-_=+[{]}.','request','then','info','Setting,\x20%s,\x20%s','request\x20sent','debug','Setting,\x20%s,\x20%s,\x20%s','stringify','error','code','message','result','sendStatus','status','end','json','count','offset','set','Content-Range','apply','reject','save','update','destroy','stack','name','index','Setting','rawAttributes','type','key','model','map','query','keys','filters'];(function(_0x3b899f,_0x2e8183){var _0x497ce2=function(_0x39bca7){while(--_0x39bca7){_0x3b899f['push'](_0x3b899f['shift']());}};_0x497ce2(++_0x2e8183);}(_0x6597,0x12e));var _0x7659=function(_0x506023,_0x46462f){_0x506023=_0x506023-0x0;var _0x235e01=_0x6597[_0x506023];return _0x235e01;};'use strict';var pdf=require(_0x7659('0x0'));var emlformat=require(_0x7659('0x1'));var rimraf=require(_0x7659('0x2'));var zipdir=require(_0x7659('0x3'));var jsonpatch=require(_0x7659('0x4'));var rp=require(_0x7659('0x5'));var moment=require(_0x7659('0x6'));var BPromise=require(_0x7659('0x7'));var Mustache=require(_0x7659('0x8'));var util=require(_0x7659('0x9'));var path=require(_0x7659('0xa'));var sox=require(_0x7659('0xb'));var csv=require('to-csv');var ejs=require(_0x7659('0xc'));var fs=require('fs');var _=require(_0x7659('0xd'));var squel=require(_0x7659('0xe'));var crypto=require(_0x7659('0xf'));var jsforce=require(_0x7659('0x10'));var deskjs=require(_0x7659('0x11'));var toCsv=require(_0x7659('0x12'));var querystring=require(_0x7659('0x13'));var Papa=require(_0x7659('0x14'));var Redis=require('ioredis');var authService=require('../../components/auth/service');var qs=require(_0x7659('0x15'));var as=require(_0x7659('0x16'));var hardwareService=require(_0x7659('0x17'));var logger=require(_0x7659('0x18'))(_0x7659('0x19'));var utils=require('../../config/utils');var config=require(_0x7659('0x1a'));var db=require(_0x7659('0x1b'))['db'];var jayson=require(_0x7659('0x1c'));var client=jayson[_0x7659('0x1d')][_0x7659('0x1e')]({'port':0x232a});function checkPasswordPattern(_0x19b58a,_0x2f3f89,_0x13a5d5){if(_0x13a5d5){var _0x13359c=new RegExp(/(?=.*[a-z])(?=.*[A-Z])(?=.*[0-9])(?=.*[?!@#\$%\^&\*~\-_=+[{\]\}])(?=.{8,})/);if(_0x13359c['test'](_0x2f3f89)){return _0x19b58a;}else{throw new db['Sequelize'][(_0x7659('0x1f'))](_0x7659('0x20'));}}else{return _0x19b58a;}}function respondWithRpcPromise(_0x2b443a,_0x3108b3,_0x99f0ef,_0x4d94e7){return new BPromise(function(_0x55cb90,_0x41fab5){var _0x13a098=_0x4d94e7||client;return _0x13a098[_0x7659('0x21')](_0x2b443a,_0x99f0ef)[_0x7659('0x22')](function(_0x1c571d){logger[_0x7659('0x23')](_0x7659('0x24'),_0x3108b3,_0x7659('0x25'));logger[_0x7659('0x26')](_0x7659('0x27'),_0x3108b3,_0x7659('0x25'),JSON[_0x7659('0x28')](_0x1c571d));if(_0x1c571d[_0x7659('0x29')]){if(_0x1c571d[_0x7659('0x29')][_0x7659('0x2a')]===0x1f4){logger[_0x7659('0x29')](_0x7659('0x24'),_0x3108b3,_0x1c571d['error'][_0x7659('0x2b')]);return _0x41fab5(_0x1c571d['error'][_0x7659('0x2b')]);}logger[_0x7659('0x29')](_0x7659('0x24'),_0x3108b3,_0x1c571d[_0x7659('0x29')][_0x7659('0x2b')]);return _0x55cb90(_0x1c571d['error']['message']);}else{logger[_0x7659('0x23')](_0x7659('0x24'),_0x3108b3,'request\x20sent');_0x55cb90(_0x1c571d[_0x7659('0x2c')][_0x7659('0x2b')]);}})['catch'](function(_0x313399){logger[_0x7659('0x29')](_0x7659('0x24'),_0x3108b3,_0x313399);_0x41fab5(_0x313399);});});}function respondWithStatusCode(_0xcf2d7d,_0x4ba435){_0x4ba435=_0x4ba435||0xcc;return function(_0x487476){if(_0x487476){return _0xcf2d7d[_0x7659('0x2d')](_0x4ba435);}return _0xcf2d7d[_0x7659('0x2e')](_0x4ba435)[_0x7659('0x2f')]();};}function respondWithResult(_0x15f40e,_0x32fbb8){_0x32fbb8=_0x32fbb8||0xc8;return function(_0x158a7d){if(_0x158a7d){return _0x15f40e[_0x7659('0x2e')](_0x32fbb8)[_0x7659('0x30')](_0x158a7d);}};}function respondWithFilteredResult(_0x55092e,_0x15128b){return function(_0x23099c){if(_0x23099c){var _0x38cb7c=_0x23099c[_0x7659('0x31')],_0x3bb55f=_0x15128b[_0x7659('0x32')],_0x2b83af=_0x15128b[_0x7659('0x32')]+_0x15128b['limit'],_0x32e67c;if(_0x2b83af>=_0x38cb7c){_0x2b83af=_0x38cb7c;_0x32e67c=0xc8;}else{_0x32e67c=0xce;}_0x55092e[_0x7659('0x2e')](_0x32e67c);return _0x55092e[_0x7659('0x33')](_0x7659('0x34'),_0x3bb55f+'-'+_0x2b83af+'/'+_0x38cb7c)[_0x7659('0x30')](_0x23099c);}return null;};}function patchUpdates(_0x182308){return function(_0x43aba4){try{jsonpatch[_0x7659('0x35')](_0x43aba4,_0x182308,!![]);}catch(_0x55fa41){return BPromise[_0x7659('0x36')](_0x55fa41);}return _0x43aba4[_0x7659('0x37')]();};}function saveUpdates(_0x435da7,_0x459c7c){return function(_0x32a71c){if(_0x32a71c){return _0x32a71c[_0x7659('0x38')](_0x435da7)[_0x7659('0x22')](function(_0x5c2dcd){return _0x5c2dcd;});}return null;};}function removeEntity(_0x9c3196,_0xa1a812){return function(_0x4a228a){if(_0x4a228a){return _0x4a228a[_0x7659('0x39')]()[_0x7659('0x22')](function(){_0x9c3196[_0x7659('0x2e')](0xcc)[_0x7659('0x2f')]();});}};}function handleEntityNotFound(_0x510449,_0x1d35c1){return function(_0x462da8){if(!_0x462da8){_0x510449[_0x7659('0x2d')](0x194);}return _0x462da8;};}function handleError(_0x4ce029,_0x4a53b9){_0x4a53b9=_0x4a53b9||0x1f4;return function(_0x54686e){logger['error'](_0x54686e[_0x7659('0x3a')]);if(_0x54686e[_0x7659('0x3b')]){delete _0x54686e[_0x7659('0x3b')];}_0x4ce029[_0x7659('0x2e')](_0x4a53b9)['send'](_0x54686e);};}exports[_0x7659('0x3c')]=function(_0x1ff428,_0x57f0f7){var _0x5e545f={},_0x52d859={},_0x5cd61d={'count':0x0,'rows':[]};var _0x223b0d=_['map'](db[_0x7659('0x3d')][_0x7659('0x3e')],function(_0x12e32f){return{'name':_0x12e32f['fieldName'],'type':_0x12e32f[_0x7659('0x3f')][_0x7659('0x40')]};});_0x52d859[_0x7659('0x41')]=_[_0x7659('0x42')](_0x223b0d,'name');_0x52d859[_0x7659('0x43')]=_[_0x7659('0x44')](_0x1ff428[_0x7659('0x43')]);_0x52d859[_0x7659('0x45')]=_[_0x7659('0x46')](_0x52d859[_0x7659('0x41')],_0x52d859[_0x7659('0x43')]);_0x5e545f['attributes']=_[_0x7659('0x46')](_0x52d859[_0x7659('0x41')],qs['fields'](_0x1ff428[_0x7659('0x43')][_0x7659('0x47')]));_0x5e545f['attributes']=_0x5e545f[_0x7659('0x48')]['length']?_0x5e545f[_0x7659('0x48')]:_0x52d859[_0x7659('0x41')];if(!_0x1ff428[_0x7659('0x43')]['hasOwnProperty'](_0x7659('0x49'))){_0x5e545f['limit']=qs['limit'](_0x1ff428[_0x7659('0x43')][_0x7659('0x4a')]);_0x5e545f[_0x7659('0x32')]=qs[_0x7659('0x32')](_0x1ff428[_0x7659('0x43')][_0x7659('0x32')]);}_0x5e545f[_0x7659('0x4b')]=qs[_0x7659('0x4c')](_0x1ff428['query'][_0x7659('0x4c')]);_0x5e545f[_0x7659('0x4d')]=qs[_0x7659('0x45')](_[_0x7659('0x4e')](_0x1ff428['query'],_0x52d859['filters']));if(_0x1ff428[_0x7659('0x43')]['filter']){_0x5e545f[_0x7659('0x4d')]=_[_0x7659('0x4f')](_0x5e545f[_0x7659('0x4d')],{'$or':_[_0x7659('0x42')](_0x223b0d,function(_0x2bdbe8){if(_0x2bdbe8[_0x7659('0x3f')]!=='VIRTUAL'){var _0x1d1767={};_0x1d1767[_0x2bdbe8[_0x7659('0x3b')]]={'$like':'%'+_0x1ff428[_0x7659('0x43')][_0x7659('0x50')]+'%'};return _0x1d1767;}})});}_0x5e545f=_[_0x7659('0x4f')]({},_0x5e545f,_0x1ff428[_0x7659('0x51')]);var _0x41bec1={'where':_0x5e545f[_0x7659('0x4d')]};return db['Setting'][_0x7659('0x31')](_0x41bec1)[_0x7659('0x22')](function(_0x5cf6dd){_0x5cd61d[_0x7659('0x31')]=_0x5cf6dd;if(_0x1ff428[_0x7659('0x43')][_0x7659('0x52')]){_0x5e545f[_0x7659('0x53')]=[{'all':!![]}];}return db['Setting'][_0x7659('0x54')](_0x5e545f);})[_0x7659('0x22')](function(_0xbc40de){_0x5cd61d['rows']=_0xbc40de;return _0x5cd61d;})[_0x7659('0x22')](respondWithFilteredResult(_0x57f0f7,_0x5e545f))[_0x7659('0x55')](handleError(_0x57f0f7,null));};exports[_0x7659('0x56')]=function(_0x374e40,_0x2525ae){var _0x5bba85={'raw':![],'where':{'id':_0x374e40[_0x7659('0x57')]['id']}},_0x1d9be6={};_0x1d9be6[_0x7659('0x41')]=_[_0x7659('0x44')](db['Setting']['rawAttributes']);_0x1d9be6[_0x7659('0x43')]=_[_0x7659('0x44')](_0x374e40['query']);_0x1d9be6['filters']=_[_0x7659('0x46')](_0x1d9be6['model'],_0x1d9be6[_0x7659('0x43')]);_0x5bba85[_0x7659('0x48')]=_[_0x7659('0x46')](_0x1d9be6[_0x7659('0x41')],qs[_0x7659('0x47')](_0x374e40['query'][_0x7659('0x47')]));_0x5bba85[_0x7659('0x48')]=_0x5bba85[_0x7659('0x48')][_0x7659('0x58')]?_0x5bba85[_0x7659('0x48')]:_0x1d9be6[_0x7659('0x41')];if(_0x374e40[_0x7659('0x43')]['includeAll']){_0x5bba85[_0x7659('0x53')]=[{'all':!![]}];}_0x5bba85=_[_0x7659('0x4f')]({},_0x5bba85,_0x374e40[_0x7659('0x51')]);return db[_0x7659('0x3d')][_0x7659('0x59')](_0x5bba85)[_0x7659('0x22')](handleEntityNotFound(_0x2525ae,null))[_0x7659('0x22')](respondWithResult(_0x2525ae,null))[_0x7659('0x55')](handleError(_0x2525ae,null));};exports['update']=function(_0x29e5e5,_0x4d0899){if(_0x29e5e5[_0x7659('0x5a')]['id']){delete _0x29e5e5[_0x7659('0x5a')]['id'];}return db[_0x7659('0x3d')][_0x7659('0x59')]({'where':{'id':_0x29e5e5[_0x7659('0x57')]['id']}})[_0x7659('0x22')](handleEntityNotFound(_0x4d0899,null))[_0x7659('0x22')](saveUpdates(_0x29e5e5[_0x7659('0x5a')],null))[_0x7659('0x22')](respondWithResult(_0x4d0899,null))[_0x7659('0x55')](handleError(_0x4d0899,null));};exports['addLogo']=function(_0x1c0fae,_0xba0372,_0x27e2c0){if(_0x1c0fae[_0x7659('0x5b')]&&_0x1c0fae['file'][_0x7659('0x5c')]){_0x1c0fae[_0x7659('0x5a')][_0x7659('0x5d')]=_0x1c0fae[_0x7659('0x5b')][_0x7659('0x5c')];}return db[_0x7659('0x3d')][_0x7659('0x59')]({'where':{'id':_0x1c0fae[_0x7659('0x57')]['id']}})[_0x7659('0x22')](handleEntityNotFound(_0xba0372,null))['then'](saveUpdates(_0x1c0fae['body'],null))[_0x7659('0x22')](respondWithResult(_0xba0372,null))[_0x7659('0x55')](handleError(_0xba0372,null));};exports[_0x7659('0x5e')]=function(_0x2997af,_0x3ce77c,_0x25c20b){if(_0x2997af[_0x7659('0x5b')]&&_0x2997af[_0x7659('0x5b')][_0x7659('0x5c')]){_0x2997af['body'][_0x7659('0x5f')]=_0x2997af[_0x7659('0x5b')][_0x7659('0x5c')];}return db[_0x7659('0x3d')]['find']({'where':{'id':_0x2997af[_0x7659('0x57')]['id']}})[_0x7659('0x22')](handleEntityNotFound(_0x3ce77c,null))['then'](saveUpdates(_0x2997af[_0x7659('0x5a')],null))['then'](respondWithResult(_0x3ce77c,null))[_0x7659('0x55')](handleError(_0x3ce77c,null));};var utilLicense=require('../../config/license/util');exports[_0x7659('0x60')]=function(_0x570f7a,_0x55796c,_0x7508a6){var _0x99a6a0=_0x7659('0x61');var _0x44a4e6={'custom':![]};return utilLicense[_0x7659('0x62')]()[_0x7659('0x22')](function(_0x57c323){if(_0x57c323){_0x44a4e6=_0x57c323;}return db['Setting']['find']({'where':{'id':_0x570f7a[_0x7659('0x57')]['id']},'attributes':[_0x7659('0x5d'),_0x7659('0x5f'),'preferred',_0x7659('0x63'),_0x7659('0x64'),_0x7659('0x65'),_0x7659('0x66'),_0x7659('0x67')],'raw':!![]});})[_0x7659('0x22')](handleEntityNotFound(_0x55796c,null))['then'](function(_0x45f34b){if(_0x45f34b){var _0x4d18af=_0x45f34b['logo']&&fs[_0x7659('0x68')](path[_0x7659('0x69')](config[_0x7659('0x6a')],_0x99a6a0,_['toLower'](_0x45f34b[_0x7659('0x5d')])))?path[_0x7659('0x69')](config[_0x7659('0x6a')],_0x99a6a0,_[_0x7659('0x6b')](_0x45f34b[_0x7659('0x5d')])):path[_0x7659('0x69')](config['root'],_0x99a6a0,_['toLower']('default_logo.png'));var _0x2a82c0=_0x7659('0x6c')+_[_0x7659('0x6d')](_0x7659('0x5d'));if(_0x45f34b[_0x2a82c0]||!_0x44a4e6[_0x7659('0x6e')]){_0x4d18af=path[_0x7659('0x69')](config['root'],_0x99a6a0,_['toLower'](_0x7659('0x6f')));}if(!fs[_0x7659('0x68')](_0x4d18af)){throw new db[(_0x7659('0x70'))][(_0x7659('0x1f'))](_[_0x7659('0x6d')](_0x7659('0x5d'))+_0x7659('0x71'));}return _0x55796c[_0x7659('0x72')](_0x4d18af);}})['catch'](handleError(_0x55796c,null));};var utilLicense=require(_0x7659('0x73'));exports['getLogoLogin']=function(_0x1e1c57,_0x340a89,_0x3fe3eb){var _0x47ddd3=_0x7659('0x61');var _0x1dd34e={'custom':![]};return utilLicense[_0x7659('0x62')]()[_0x7659('0x22')](function(_0x39cd77){if(_0x39cd77){_0x1dd34e=_0x39cd77;}return db[_0x7659('0x3d')][_0x7659('0x59')]({'where':{'id':_0x1e1c57['params']['id']},'attributes':[_0x7659('0x5d'),_0x7659('0x5f'),_0x7659('0x74'),'favicon',_0x7659('0x64'),_0x7659('0x65'),'defaultPreferred',_0x7659('0x67')],'raw':!![]});})['then'](handleEntityNotFound(_0x340a89,null))[_0x7659('0x22')](function(_0x1905ae){if(_0x1905ae){var _0x1eba41=_0x1905ae['loginLogo']&&fs[_0x7659('0x68')](path[_0x7659('0x69')](config[_0x7659('0x6a')],_0x47ddd3,_['toLower'](_0x1905ae[_0x7659('0x5f')])))?path[_0x7659('0x69')](config[_0x7659('0x6a')],_0x47ddd3,_[_0x7659('0x6b')](_0x1905ae['loginLogo'])):path[_0x7659('0x69')](config[_0x7659('0x6a')],_0x47ddd3,_[_0x7659('0x6b')]('default_loginLogo.png'));var _0x37b3ba='default'+_[_0x7659('0x6d')](_0x7659('0x5f'));if(_0x1905ae[_0x37b3ba]||!_0x1dd34e['custom']){_0x1eba41=path[_0x7659('0x69')](config[_0x7659('0x6a')],_0x47ddd3,_['toLower']('default_loginLogo.png'));}if(!fs[_0x7659('0x68')](_0x1eba41)){throw new db[(_0x7659('0x70'))][(_0x7659('0x1f'))](_[_0x7659('0x6d')](_0x7659('0x5f'))+'\x20not\x20found');}return _0x340a89[_0x7659('0x72')](_0x1eba41);}})['catch'](handleError(_0x340a89,null));};exports[_0x7659('0x75')]=function(_0x4a79be,_0x3980cb){return db['Setting'][_0x7659('0x59')]({'where':{'id':_0x4a79be[_0x7659('0x57')]['id']},'attributes':[_0x7659('0x76')]})[_0x7659('0x22')](respondWithResult(_0x3980cb,null))[_0x7659('0x55')](handleError(_0x3980cb,null));};exports[_0x7659('0x77')]=function(_0x2262f7,_0x19e344,_0x294669){if(_0x2262f7['file']&&_0x2262f7[_0x7659('0x5b')][_0x7659('0x5c')]){_0x2262f7[_0x7659('0x5a')][_0x7659('0x74')]=_0x2262f7[_0x7659('0x5b')][_0x7659('0x5c')];}return db[_0x7659('0x3d')][_0x7659('0x59')]({'where':{'id':_0x2262f7[_0x7659('0x57')]['id']}})[_0x7659('0x22')](handleEntityNotFound(_0x19e344,null))[_0x7659('0x22')](saveUpdates(_0x2262f7['body'],null))[_0x7659('0x22')](respondWithResult(_0x19e344,null))['catch'](handleError(_0x19e344,null));};var utilLicense=require('../../config/license/util');exports[_0x7659('0x78')]=function(_0x36e8e0,_0x2578d8,_0x5a52af){var _0x5057b3='server/files/images/logos';var _0x4cbca6={'custom':![]};return utilLicense[_0x7659('0x62')]()[_0x7659('0x22')](function(_0x55c483){if(_0x55c483){_0x4cbca6=_0x55c483;}return db[_0x7659('0x3d')][_0x7659('0x59')]({'where':{'id':_0x36e8e0['params']['id']},'attributes':[_0x7659('0x5d'),_0x7659('0x5f'),_0x7659('0x74'),_0x7659('0x63'),_0x7659('0x64'),_0x7659('0x65'),_0x7659('0x66'),_0x7659('0x67')],'raw':!![]});})[_0x7659('0x22')](handleEntityNotFound(_0x2578d8,null))[_0x7659('0x22')](function(_0x196926){if(_0x196926){var _0x4382d5=_0x196926[_0x7659('0x74')]&&fs[_0x7659('0x68')](path[_0x7659('0x69')](config['root'],_0x5057b3,_[_0x7659('0x6b')](_0x196926['preferred'])))?path[_0x7659('0x69')](config[_0x7659('0x6a')],_0x5057b3,_['toLower'](_0x196926['preferred'])):path[_0x7659('0x69')](config['root'],_0x5057b3,_[_0x7659('0x6b')](_0x7659('0x79')));var _0x1e26d8=_0x7659('0x6c')+_['upperFirst'](_0x7659('0x74'));if(_0x196926[_0x1e26d8]||!_0x4cbca6['custom']||!_0x4cbca6[_0x7659('0x74')]){_0x4382d5=path[_0x7659('0x69')](config['root'],_0x5057b3,_[_0x7659('0x6b')](_0x7659('0x79')));}if(!fs[_0x7659('0x68')](_0x4382d5)){throw new db[(_0x7659('0x70'))][(_0x7659('0x1f'))](_[_0x7659('0x6d')](_0x7659('0x74'))+'\x20not\x20found');}return _0x2578d8['download'](_0x4382d5);}})[_0x7659('0x55')](handleError(_0x2578d8,null));};exports[_0x7659('0x7a')]=function(_0x3b0649,_0x5795c0,_0x2cb7ce){if(_0x3b0649[_0x7659('0x5b')]&&_0x3b0649['file'][_0x7659('0x5c')]){_0x3b0649[_0x7659('0x5a')][_0x7659('0x63')]=_0x3b0649['file'][_0x7659('0x5c')];}return db[_0x7659('0x3d')]['find']({'where':{'id':_0x3b0649[_0x7659('0x57')]['id']}})[_0x7659('0x22')](handleEntityNotFound(_0x5795c0,null))[_0x7659('0x22')](saveUpdates(_0x3b0649[_0x7659('0x5a')],null))[_0x7659('0x22')](respondWithResult(_0x5795c0,null))[_0x7659('0x55')](handleError(_0x5795c0,null));};var utilLicense=require(_0x7659('0x73'));exports[_0x7659('0x7b')]=function(_0x47207c,_0x47991d,_0xc3d05c){var _0x2f6ada=_0x7659('0x61');var _0x4fc146={'custom':![]};return utilLicense[_0x7659('0x62')]()[_0x7659('0x22')](function(_0x4df3d1){if(_0x4df3d1){_0x4fc146=_0x4df3d1;}return db['Setting'][_0x7659('0x59')]({'where':{'id':_0x47207c[_0x7659('0x57')]['id']},'attributes':[_0x7659('0x5d'),'loginLogo','preferred','favicon',_0x7659('0x64'),_0x7659('0x65'),_0x7659('0x66'),_0x7659('0x67')],'raw':!![]});})[_0x7659('0x22')](handleEntityNotFound(_0x47991d,null))['then'](function(_0x5906e9){if(_0x5906e9){var _0x37718e=_0x5906e9[_0x7659('0x63')]&&fs[_0x7659('0x68')](path[_0x7659('0x69')](config[_0x7659('0x6a')],_0x2f6ada,_[_0x7659('0x6b')](_0x5906e9[_0x7659('0x63')])))?path[_0x7659('0x69')](config['root'],_0x2f6ada,_[_0x7659('0x6b')](_0x5906e9[_0x7659('0x63')])):path[_0x7659('0x69')](config['root'],_0x2f6ada,_[_0x7659('0x6b')]('default_favicon.ico'));var _0x37c049='default'+_[_0x7659('0x6d')](_0x7659('0x63'));if(_0x5906e9[_0x37c049]||!_0x4fc146[_0x7659('0x6e')]){_0x37718e=path[_0x7659('0x69')](config['root'],_0x2f6ada,_[_0x7659('0x6b')]('default_favicon.ico'));}if(!fs[_0x7659('0x68')](_0x37718e)){throw new db[(_0x7659('0x70'))]['ValidationError'](_[_0x7659('0x6d')]('favicon')+_0x7659('0x71'));}return _0x47991d[_0x7659('0x72')](_0x37718e);}})['catch'](handleError(_0x47991d,null));};
\ No newline at end of file
+var _0x48ac=['path','sox','ejs','squel','to-csv','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','../../config/environment','../../mysqldb','jayson/promise','client','http','Sequelize','ValidationError','The\x20password\x20must\x20be\x20at\x20least\x208\x20characters\x20long\x20and\x20have\x201\x20lowercase\x20character,\x201\x20uppercase\x20character,\x201\x20number\x20and\x201\x20special\x20character\x20~!@#$%^&-_=+[{]}.','Setting,\x20%s,\x20%s','request\x20sent','debug','stringify','error','message','info','result','catch','sendStatus','status','offset','limit','json','reject','update','then','end','name','index','map','Setting','fieldName','type','query','filters','model','fields','attributes','length','hasOwnProperty','nolimit','order','sort','where','pick','merge','filter','count','includeAll','include','rows','show','params','keys','intersection','options','find','body','addLogo','file','filename','logo','addLogoLogin','../../config/license/util','getLogo','server/files/images/logos','getLicense','loginLogo','preferred','favicon','defaultLogo','defaultLoginLogo','defaultPreferred','defaultFavicon','existsSync','join','root','toLower','default_logo.png','upperFirst','\x20not\x20found','getLogoLogin','default_loginLogo.png','default','gdpr','securePassword','getPreferred','default_preferred.png','custom','download','default_favicon.ico','rimraf','zip-dir','fast-json-patch','moment','bluebird','mustache','util'];(function(_0x565a40,_0x417e53){var _0x4e1e62=function(_0x1bc2d1){while(--_0x1bc2d1){_0x565a40['push'](_0x565a40['shift']());}};_0x4e1e62(++_0x417e53);}(_0x48ac,0x1ad));var _0xc48a=function(_0x487b25,_0xeb4dda){_0x487b25=_0x487b25-0x0;var _0x2a4fc7=_0x48ac[_0x487b25];return _0x2a4fc7;};'use strict';var pdf=require('html-pdf');var emlformat=require('eml-format');var rimraf=require(_0xc48a('0x0'));var zipdir=require(_0xc48a('0x1'));var jsonpatch=require(_0xc48a('0x2'));var rp=require('request-promise');var moment=require(_0xc48a('0x3'));var BPromise=require(_0xc48a('0x4'));var Mustache=require(_0xc48a('0x5'));var util=require(_0xc48a('0x6'));var path=require(_0xc48a('0x7'));var sox=require(_0xc48a('0x8'));var csv=require('to-csv');var ejs=require(_0xc48a('0x9'));var fs=require('fs');var _=require('lodash');var squel=require(_0xc48a('0xa'));var crypto=require('crypto');var jsforce=require('jsforce');var deskjs=require('desk.js');var toCsv=require(_0xc48a('0xb'));var querystring=require(_0xc48a('0xc'));var Papa=require(_0xc48a('0xd'));var Redis=require(_0xc48a('0xe'));var authService=require(_0xc48a('0xf'));var qs=require('../../components/parsers/qs');var as=require(_0xc48a('0x10'));var hardwareService=require(_0xc48a('0x11'));var logger=require(_0xc48a('0x12'))('api');var utils=require('../../config/utils');var config=require(_0xc48a('0x13'));var db=require(_0xc48a('0x14'))['db'];var jayson=require(_0xc48a('0x15'));var client=jayson[_0xc48a('0x16')][_0xc48a('0x17')]({'port':0x232a});function checkPasswordPattern(_0x1d66d7,_0x6ad547,_0x1c3cd0){if(_0x1c3cd0){var _0x16ff04=new RegExp(/(?=.*[a-z])(?=.*[A-Z])(?=.*[0-9])(?=.*[?!@#\$%\^&\*~\-_=+[{\]\}])(?=.{8,})/);if(_0x16ff04['test'](_0x6ad547)){return _0x1d66d7;}else{throw new db[(_0xc48a('0x18'))][(_0xc48a('0x19'))](_0xc48a('0x1a'));}}else{return _0x1d66d7;}}function respondWithRpcPromise(_0x1c4448,_0x3591df,_0xeccc86,_0x2fe9ba){return new BPromise(function(_0x4e406a,_0x4e5bc9){var _0x437307=_0x2fe9ba||client;return _0x437307['request'](_0x1c4448,_0xeccc86)['then'](function(_0x1bcdf2){logger['info'](_0xc48a('0x1b'),_0x3591df,_0xc48a('0x1c'));logger[_0xc48a('0x1d')]('Setting,\x20%s,\x20%s,\x20%s',_0x3591df,_0xc48a('0x1c'),JSON[_0xc48a('0x1e')](_0x1bcdf2));if(_0x1bcdf2[_0xc48a('0x1f')]){if(_0x1bcdf2[_0xc48a('0x1f')]['code']===0x1f4){logger[_0xc48a('0x1f')](_0xc48a('0x1b'),_0x3591df,_0x1bcdf2[_0xc48a('0x1f')][_0xc48a('0x20')]);return _0x4e5bc9(_0x1bcdf2[_0xc48a('0x1f')][_0xc48a('0x20')]);}logger[_0xc48a('0x1f')](_0xc48a('0x1b'),_0x3591df,_0x1bcdf2['error'][_0xc48a('0x20')]);return _0x4e406a(_0x1bcdf2[_0xc48a('0x1f')][_0xc48a('0x20')]);}else{logger[_0xc48a('0x21')](_0xc48a('0x1b'),_0x3591df,_0xc48a('0x1c'));_0x4e406a(_0x1bcdf2[_0xc48a('0x22')][_0xc48a('0x20')]);}})[_0xc48a('0x23')](function(_0x15d0a1){logger[_0xc48a('0x1f')](_0xc48a('0x1b'),_0x3591df,_0x15d0a1);_0x4e5bc9(_0x15d0a1);});});}function respondWithStatusCode(_0x189210,_0x3122f8){_0x3122f8=_0x3122f8||0xcc;return function(_0x18161e){if(_0x18161e){return _0x189210[_0xc48a('0x24')](_0x3122f8);}return _0x189210[_0xc48a('0x25')](_0x3122f8)['end']();};}function respondWithResult(_0x306827,_0x14d300){_0x14d300=_0x14d300||0xc8;return function(_0x1fcf39){if(_0x1fcf39){return _0x306827[_0xc48a('0x25')](_0x14d300)['json'](_0x1fcf39);}};}function respondWithFilteredResult(_0x4ad138,_0x387773){return function(_0x516c85){if(_0x516c85){var _0x1752c9=_0x516c85['count'],_0x1e8929=_0x387773['offset'],_0x3566fd=_0x387773[_0xc48a('0x26')]+_0x387773[_0xc48a('0x27')],_0x121b6a;if(_0x3566fd>=_0x1752c9){_0x3566fd=_0x1752c9;_0x121b6a=0xc8;}else{_0x121b6a=0xce;}_0x4ad138[_0xc48a('0x25')](_0x121b6a);return _0x4ad138['set']('Content-Range',_0x1e8929+'-'+_0x3566fd+'/'+_0x1752c9)[_0xc48a('0x28')](_0x516c85);}return null;};}function patchUpdates(_0x2d50b3){return function(_0x4dfa6b){try{jsonpatch['apply'](_0x4dfa6b,_0x2d50b3,!![]);}catch(_0x54e6ee){return BPromise[_0xc48a('0x29')](_0x54e6ee);}return _0x4dfa6b['save']();};}function saveUpdates(_0x381862,_0x27cc0d){return function(_0xbfdc72){if(_0xbfdc72){return _0xbfdc72[_0xc48a('0x2a')](_0x381862)[_0xc48a('0x2b')](function(_0x26308a){return _0x26308a;});}return null;};}function removeEntity(_0x68acc3,_0x266b46){return function(_0x4f62cb){if(_0x4f62cb){return _0x4f62cb['destroy']()[_0xc48a('0x2b')](function(){_0x68acc3[_0xc48a('0x25')](0xcc)[_0xc48a('0x2c')]();});}};}function handleEntityNotFound(_0x24bf59,_0x193175){return function(_0x334df2){if(!_0x334df2){_0x24bf59[_0xc48a('0x24')](0x194);}return _0x334df2;};}function handleError(_0xf620c8,_0x511b17){_0x511b17=_0x511b17||0x1f4;return function(_0x30a269){logger['error'](_0x30a269['stack']);if(_0x30a269[_0xc48a('0x2d')]){delete _0x30a269['name'];}_0xf620c8[_0xc48a('0x25')](_0x511b17)['send'](_0x30a269);};}exports[_0xc48a('0x2e')]=function(_0x24bd0d,_0x41623b){var _0x4554a6={},_0x20df2b={},_0x58e2ff={'count':0x0,'rows':[]};var _0x11fd2c=_[_0xc48a('0x2f')](db[_0xc48a('0x30')]['rawAttributes'],function(_0x50b9e0){return{'name':_0x50b9e0[_0xc48a('0x31')],'type':_0x50b9e0[_0xc48a('0x32')]['key']};});_0x20df2b['model']=_['map'](_0x11fd2c,_0xc48a('0x2d'));_0x20df2b[_0xc48a('0x33')]=_['keys'](_0x24bd0d[_0xc48a('0x33')]);_0x20df2b[_0xc48a('0x34')]=_['intersection'](_0x20df2b[_0xc48a('0x35')],_0x20df2b['query']);_0x4554a6['attributes']=_['intersection'](_0x20df2b['model'],qs['fields'](_0x24bd0d['query'][_0xc48a('0x36')]));_0x4554a6[_0xc48a('0x37')]=_0x4554a6[_0xc48a('0x37')][_0xc48a('0x38')]?_0x4554a6[_0xc48a('0x37')]:_0x20df2b['model'];if(!_0x24bd0d[_0xc48a('0x33')][_0xc48a('0x39')](_0xc48a('0x3a'))){_0x4554a6[_0xc48a('0x27')]=qs[_0xc48a('0x27')](_0x24bd0d[_0xc48a('0x33')]['limit']);_0x4554a6[_0xc48a('0x26')]=qs[_0xc48a('0x26')](_0x24bd0d['query'][_0xc48a('0x26')]);}_0x4554a6[_0xc48a('0x3b')]=qs[_0xc48a('0x3c')](_0x24bd0d[_0xc48a('0x33')][_0xc48a('0x3c')]);_0x4554a6[_0xc48a('0x3d')]=qs[_0xc48a('0x34')](_[_0xc48a('0x3e')](_0x24bd0d[_0xc48a('0x33')],_0x20df2b[_0xc48a('0x34')]));if(_0x24bd0d[_0xc48a('0x33')]['filter']){_0x4554a6[_0xc48a('0x3d')]=_[_0xc48a('0x3f')](_0x4554a6[_0xc48a('0x3d')],{'$or':_[_0xc48a('0x2f')](_0x11fd2c,function(_0x46ebed){if(_0x46ebed[_0xc48a('0x32')]!=='VIRTUAL'){var _0xebd9de={};_0xebd9de[_0x46ebed[_0xc48a('0x2d')]]={'$like':'%'+_0x24bd0d[_0xc48a('0x33')][_0xc48a('0x40')]+'%'};return _0xebd9de;}})});}_0x4554a6=_[_0xc48a('0x3f')]({},_0x4554a6,_0x24bd0d['options']);var _0xaea4e5={'where':_0x4554a6['where']};return db[_0xc48a('0x30')][_0xc48a('0x41')](_0xaea4e5)[_0xc48a('0x2b')](function(_0x11ec5d){_0x58e2ff[_0xc48a('0x41')]=_0x11ec5d;if(_0x24bd0d[_0xc48a('0x33')][_0xc48a('0x42')]){_0x4554a6[_0xc48a('0x43')]=[{'all':!![]}];}return db[_0xc48a('0x30')]['findAll'](_0x4554a6);})[_0xc48a('0x2b')](function(_0x14d90a){_0x58e2ff[_0xc48a('0x44')]=_0x14d90a;return _0x58e2ff;})[_0xc48a('0x2b')](respondWithFilteredResult(_0x41623b,_0x4554a6))['catch'](handleError(_0x41623b,null));};exports[_0xc48a('0x45')]=function(_0x240655,_0x3dc013){var _0x34163b={'raw':![],'where':{'id':_0x240655[_0xc48a('0x46')]['id']}},_0x1a8b8e={};_0x1a8b8e[_0xc48a('0x35')]=_[_0xc48a('0x47')](db[_0xc48a('0x30')]['rawAttributes']);_0x1a8b8e[_0xc48a('0x33')]=_[_0xc48a('0x47')](_0x240655[_0xc48a('0x33')]);_0x1a8b8e[_0xc48a('0x34')]=_[_0xc48a('0x48')](_0x1a8b8e[_0xc48a('0x35')],_0x1a8b8e[_0xc48a('0x33')]);_0x34163b[_0xc48a('0x37')]=_[_0xc48a('0x48')](_0x1a8b8e[_0xc48a('0x35')],qs['fields'](_0x240655['query'][_0xc48a('0x36')]));_0x34163b[_0xc48a('0x37')]=_0x34163b[_0xc48a('0x37')][_0xc48a('0x38')]?_0x34163b['attributes']:_0x1a8b8e['model'];if(_0x240655[_0xc48a('0x33')][_0xc48a('0x42')]){_0x34163b['include']=[{'all':!![]}];}_0x34163b=_[_0xc48a('0x3f')]({},_0x34163b,_0x240655[_0xc48a('0x49')]);return db['Setting'][_0xc48a('0x4a')](_0x34163b)[_0xc48a('0x2b')](handleEntityNotFound(_0x3dc013,null))[_0xc48a('0x2b')](respondWithResult(_0x3dc013,null))[_0xc48a('0x23')](handleError(_0x3dc013,null));};exports[_0xc48a('0x2a')]=function(_0x1711e8,_0x5e4612){if(_0x1711e8[_0xc48a('0x4b')]['id']){delete _0x1711e8[_0xc48a('0x4b')]['id'];}return db[_0xc48a('0x30')]['find']({'where':{'id':_0x1711e8['params']['id']}})[_0xc48a('0x2b')](handleEntityNotFound(_0x5e4612,null))[_0xc48a('0x2b')](saveUpdates(_0x1711e8[_0xc48a('0x4b')],null))[_0xc48a('0x2b')](respondWithResult(_0x5e4612,null))[_0xc48a('0x23')](handleError(_0x5e4612,null));};exports[_0xc48a('0x4c')]=function(_0xbfd3e4,_0x5142ce,_0x5f0f55){if(_0xbfd3e4[_0xc48a('0x4d')]&&_0xbfd3e4[_0xc48a('0x4d')][_0xc48a('0x4e')]){_0xbfd3e4['body'][_0xc48a('0x4f')]=_0xbfd3e4[_0xc48a('0x4d')][_0xc48a('0x4e')];}return db[_0xc48a('0x30')][_0xc48a('0x4a')]({'where':{'id':_0xbfd3e4[_0xc48a('0x46')]['id']}})[_0xc48a('0x2b')](handleEntityNotFound(_0x5142ce,null))['then'](saveUpdates(_0xbfd3e4[_0xc48a('0x4b')],null))[_0xc48a('0x2b')](respondWithResult(_0x5142ce,null))[_0xc48a('0x23')](handleError(_0x5142ce,null));};exports[_0xc48a('0x50')]=function(_0x2ab213,_0x591e8b,_0x126888){if(_0x2ab213[_0xc48a('0x4d')]&&_0x2ab213[_0xc48a('0x4d')]['filename']){_0x2ab213['body']['loginLogo']=_0x2ab213[_0xc48a('0x4d')][_0xc48a('0x4e')];}return db[_0xc48a('0x30')][_0xc48a('0x4a')]({'where':{'id':_0x2ab213['params']['id']}})[_0xc48a('0x2b')](handleEntityNotFound(_0x591e8b,null))['then'](saveUpdates(_0x2ab213['body'],null))[_0xc48a('0x2b')](respondWithResult(_0x591e8b,null))[_0xc48a('0x23')](handleError(_0x591e8b,null));};var utilLicense=require(_0xc48a('0x51'));exports[_0xc48a('0x52')]=function(_0x7058cf,_0x480625,_0x284e66){var _0x1a3196=_0xc48a('0x53');var _0x4bbe6d={'custom':![]};return utilLicense[_0xc48a('0x54')]()['then'](function(_0x3435e8){if(_0x3435e8){_0x4bbe6d=_0x3435e8;}return db['Setting'][_0xc48a('0x4a')]({'where':{'id':_0x7058cf[_0xc48a('0x46')]['id']},'attributes':['logo',_0xc48a('0x55'),_0xc48a('0x56'),_0xc48a('0x57'),_0xc48a('0x58'),_0xc48a('0x59'),_0xc48a('0x5a'),_0xc48a('0x5b')],'raw':!![]});})[_0xc48a('0x2b')](handleEntityNotFound(_0x480625,null))[_0xc48a('0x2b')](function(_0x5d1903){if(_0x5d1903){var _0x4e1552=_0x5d1903[_0xc48a('0x4f')]&&fs[_0xc48a('0x5c')](path[_0xc48a('0x5d')](config[_0xc48a('0x5e')],_0x1a3196,_[_0xc48a('0x5f')](_0x5d1903[_0xc48a('0x4f')])))?path[_0xc48a('0x5d')](config[_0xc48a('0x5e')],_0x1a3196,_[_0xc48a('0x5f')](_0x5d1903[_0xc48a('0x4f')])):path[_0xc48a('0x5d')](config[_0xc48a('0x5e')],_0x1a3196,_[_0xc48a('0x5f')](_0xc48a('0x60')));var _0x5687ea='default'+_[_0xc48a('0x61')](_0xc48a('0x4f'));if(_0x5d1903[_0x5687ea]||!_0x4bbe6d['custom']){_0x4e1552=path[_0xc48a('0x5d')](config[_0xc48a('0x5e')],_0x1a3196,_[_0xc48a('0x5f')](_0xc48a('0x60')));}if(!fs['existsSync'](_0x4e1552)){throw new db[(_0xc48a('0x18'))][(_0xc48a('0x19'))](_[_0xc48a('0x61')]('logo')+_0xc48a('0x62'));}return _0x480625['download'](_0x4e1552);}})[_0xc48a('0x23')](handleError(_0x480625,null));};var utilLicense=require(_0xc48a('0x51'));exports[_0xc48a('0x63')]=function(_0x340578,_0x2c6651,_0x2cca8f){var _0x43e3f5=_0xc48a('0x53');var _0x5940fd={'custom':![]};return utilLicense[_0xc48a('0x54')]()[_0xc48a('0x2b')](function(_0x1b73be){if(_0x1b73be){_0x5940fd=_0x1b73be;}return db[_0xc48a('0x30')]['find']({'where':{'id':_0x340578[_0xc48a('0x46')]['id']},'attributes':[_0xc48a('0x4f'),_0xc48a('0x55'),_0xc48a('0x56'),_0xc48a('0x57'),'defaultLogo',_0xc48a('0x59'),_0xc48a('0x5a'),_0xc48a('0x5b')],'raw':!![]});})[_0xc48a('0x2b')](handleEntityNotFound(_0x2c6651,null))['then'](function(_0x1397b4){if(_0x1397b4){var _0x4423e0=_0x1397b4[_0xc48a('0x55')]&&fs[_0xc48a('0x5c')](path['join'](config[_0xc48a('0x5e')],_0x43e3f5,_['toLower'](_0x1397b4['loginLogo'])))?path[_0xc48a('0x5d')](config[_0xc48a('0x5e')],_0x43e3f5,_['toLower'](_0x1397b4[_0xc48a('0x55')])):path[_0xc48a('0x5d')](config[_0xc48a('0x5e')],_0x43e3f5,_[_0xc48a('0x5f')](_0xc48a('0x64')));var _0x5ade3d=_0xc48a('0x65')+_[_0xc48a('0x61')](_0xc48a('0x55'));if(_0x1397b4[_0x5ade3d]||!_0x5940fd['custom']){_0x4423e0=path[_0xc48a('0x5d')](config[_0xc48a('0x5e')],_0x43e3f5,_['toLower'](_0xc48a('0x64')));}if(!fs[_0xc48a('0x5c')](_0x4423e0)){throw new db[(_0xc48a('0x18'))]['ValidationError'](_['upperFirst'](_0xc48a('0x55'))+_0xc48a('0x62'));}return _0x2c6651['download'](_0x4423e0);}})['catch'](handleError(_0x2c6651,null));};exports[_0xc48a('0x66')]=function(_0x7a9765,_0x36af88){return db[_0xc48a('0x30')]['find']({'where':{'id':_0x7a9765['params']['id']},'attributes':[_0xc48a('0x67')]})[_0xc48a('0x2b')](respondWithResult(_0x36af88,null))[_0xc48a('0x23')](handleError(_0x36af88,null));};exports['addPreferred']=function(_0x3d78ac,_0x46fc84,_0x454863){if(_0x3d78ac[_0xc48a('0x4d')]&&_0x3d78ac[_0xc48a('0x4d')][_0xc48a('0x4e')]){_0x3d78ac[_0xc48a('0x4b')][_0xc48a('0x56')]=_0x3d78ac[_0xc48a('0x4d')][_0xc48a('0x4e')];}return db[_0xc48a('0x30')]['find']({'where':{'id':_0x3d78ac[_0xc48a('0x46')]['id']}})[_0xc48a('0x2b')](handleEntityNotFound(_0x46fc84,null))['then'](saveUpdates(_0x3d78ac[_0xc48a('0x4b')],null))['then'](respondWithResult(_0x46fc84,null))[_0xc48a('0x23')](handleError(_0x46fc84,null));};var utilLicense=require(_0xc48a('0x51'));exports[_0xc48a('0x68')]=function(_0x65cc42,_0x2159af,_0x1ae738){var _0x182e1a=_0xc48a('0x53');var _0x244fdf={'custom':![]};return utilLicense[_0xc48a('0x54')]()['then'](function(_0x553049){if(_0x553049){_0x244fdf=_0x553049;}return db['Setting'][_0xc48a('0x4a')]({'where':{'id':_0x65cc42[_0xc48a('0x46')]['id']},'attributes':['logo',_0xc48a('0x55'),'preferred',_0xc48a('0x57'),_0xc48a('0x58'),_0xc48a('0x59'),_0xc48a('0x5a'),'defaultFavicon'],'raw':!![]});})['then'](handleEntityNotFound(_0x2159af,null))[_0xc48a('0x2b')](function(_0x389636){if(_0x389636){var _0x34e395=_0x389636[_0xc48a('0x56')]&&fs[_0xc48a('0x5c')](path[_0xc48a('0x5d')](config[_0xc48a('0x5e')],_0x182e1a,_['toLower'](_0x389636['preferred'])))?path[_0xc48a('0x5d')](config[_0xc48a('0x5e')],_0x182e1a,_[_0xc48a('0x5f')](_0x389636['preferred'])):path['join'](config[_0xc48a('0x5e')],_0x182e1a,_[_0xc48a('0x5f')](_0xc48a('0x69')));var _0x212021='default'+_[_0xc48a('0x61')](_0xc48a('0x56'));if(_0x389636[_0x212021]||!_0x244fdf[_0xc48a('0x6a')]||!_0x244fdf['preferred']){_0x34e395=path[_0xc48a('0x5d')](config[_0xc48a('0x5e')],_0x182e1a,_[_0xc48a('0x5f')](_0xc48a('0x69')));}if(!fs[_0xc48a('0x5c')](_0x34e395)){throw new db[(_0xc48a('0x18'))][(_0xc48a('0x19'))](_[_0xc48a('0x61')](_0xc48a('0x56'))+_0xc48a('0x62'));}return _0x2159af[_0xc48a('0x6b')](_0x34e395);}})[_0xc48a('0x23')](handleError(_0x2159af,null));};exports['addFavicon']=function(_0x43b6e1,_0x3afefd,_0x39595b){if(_0x43b6e1['file']&&_0x43b6e1[_0xc48a('0x4d')][_0xc48a('0x4e')]){_0x43b6e1[_0xc48a('0x4b')][_0xc48a('0x57')]=_0x43b6e1['file'][_0xc48a('0x4e')];}return db[_0xc48a('0x30')][_0xc48a('0x4a')]({'where':{'id':_0x43b6e1[_0xc48a('0x46')]['id']}})[_0xc48a('0x2b')](handleEntityNotFound(_0x3afefd,null))[_0xc48a('0x2b')](saveUpdates(_0x43b6e1['body'],null))[_0xc48a('0x2b')](respondWithResult(_0x3afefd,null))[_0xc48a('0x23')](handleError(_0x3afefd,null));};var utilLicense=require('../../config/license/util');exports['getFavicon']=function(_0x26b886,_0x2b9fcb,_0x569892){var _0x256cd7=_0xc48a('0x53');var _0x2460df={'custom':![]};return utilLicense['getLicense']()[_0xc48a('0x2b')](function(_0x3a88f9){if(_0x3a88f9){_0x2460df=_0x3a88f9;}return db['Setting'][_0xc48a('0x4a')]({'where':{'id':_0x26b886[_0xc48a('0x46')]['id']},'attributes':['logo',_0xc48a('0x55'),'preferred',_0xc48a('0x57'),_0xc48a('0x58'),_0xc48a('0x59'),_0xc48a('0x5a'),'defaultFavicon'],'raw':!![]});})[_0xc48a('0x2b')](handleEntityNotFound(_0x2b9fcb,null))[_0xc48a('0x2b')](function(_0x2dd2f0){if(_0x2dd2f0){var _0x1e9b6a=_0x2dd2f0[_0xc48a('0x57')]&&fs[_0xc48a('0x5c')](path[_0xc48a('0x5d')](config[_0xc48a('0x5e')],_0x256cd7,_[_0xc48a('0x5f')](_0x2dd2f0[_0xc48a('0x57')])))?path[_0xc48a('0x5d')](config['root'],_0x256cd7,_[_0xc48a('0x5f')](_0x2dd2f0[_0xc48a('0x57')])):path[_0xc48a('0x5d')](config[_0xc48a('0x5e')],_0x256cd7,_[_0xc48a('0x5f')](_0xc48a('0x6c')));var _0x1a5940=_0xc48a('0x65')+_[_0xc48a('0x61')](_0xc48a('0x57'));if(_0x2dd2f0[_0x1a5940]||!_0x2460df[_0xc48a('0x6a')]){_0x1e9b6a=path[_0xc48a('0x5d')](config[_0xc48a('0x5e')],_0x256cd7,_['toLower'](_0xc48a('0x6c')));}if(!fs[_0xc48a('0x5c')](_0x1e9b6a)){throw new db[(_0xc48a('0x18'))]['ValidationError'](_['upperFirst'](_0xc48a('0x57'))+_0xc48a('0x62'));}return _0x2b9fcb['download'](_0x1e9b6a);}})[_0xc48a('0x23')](handleError(_0x2b9fcb,null));};
\ No newline at end of file
diff --git a/server/api/setting/setting.model.js b/server/api/setting/setting.model.js
index d1fe689..8e87251 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 _0x9908=['bluebird','request-promise','path','rimraf','../../config/environment','./setting.attributes','exports','define','Setting','settings','lodash','api','moment'];(function(_0xefb4e,_0xe56689){var _0x36c78c=function(_0x158fe3){while(--_0x158fe3){_0xefb4e['push'](_0xefb4e['shift']());}};_0x36c78c(++_0xe56689);}(_0x9908,0xda));var _0x8990=function(_0x27c151,_0x52c49b){_0x27c151=_0x27c151-0x0;var _0x5c4bf9=_0x9908[_0x27c151];return _0x5c4bf9;};'use strict';var _=require(_0x8990('0x0'));var util=require('util');var logger=require('../../config/logger')(_0x8990('0x1'));var moment=require(_0x8990('0x2'));var BPromise=require(_0x8990('0x3'));var rp=require(_0x8990('0x4'));var fs=require('fs');var path=require(_0x8990('0x5'));var rimraf=require(_0x8990('0x6'));var config=require(_0x8990('0x7'));var attributes=require(_0x8990('0x8'));module[_0x8990('0x9')]=function(_0x4ac4d7,_0x167822){return _0x4ac4d7[_0x8990('0xa')](_0x8990('0xb'),attributes,{'tableName':_0x8990('0xc'),'paranoid':![],'indexes':[],'timestamps':!![]});};
\ No newline at end of file
+var _0x4d14=['util','moment','bluebird','rimraf','../../config/environment','./setting.attributes','exports','define','Setting','lodash'];(function(_0x3f0bd0,_0x14f131){var _0x344b80=function(_0x230acf){while(--_0x230acf){_0x3f0bd0['push'](_0x3f0bd0['shift']());}};_0x344b80(++_0x14f131);}(_0x4d14,0x153));var _0x44d1=function(_0x154192,_0x2d360f){_0x154192=_0x154192-0x0;var _0x3c2792=_0x4d14[_0x154192];return _0x3c2792;};'use strict';var _=require(_0x44d1('0x0'));var util=require(_0x44d1('0x1'));var logger=require('../../config/logger')('api');var moment=require(_0x44d1('0x2'));var BPromise=require(_0x44d1('0x3'));var rp=require('request-promise');var fs=require('fs');var path=require('path');var rimraf=require(_0x44d1('0x4'));var config=require(_0x44d1('0x5'));var attributes=require(_0x44d1('0x6'));module[_0x44d1('0x7')]=function(_0x5c8b62,_0x3bbc21){return _0x5c8b62[_0x44d1('0x8')](_0x44d1('0x9'),attributes,{'tableName':'settings','paranoid':![],'indexes':[],'timestamps':!![]});};
\ No newline at end of file
diff --git a/server/api/setting/setting.rpc.js b/server/api/setting/setting.rpc.js
index 32eb027..ba1a5c8 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 _0x9633=['info','request\x20sent','Setting,\x20%s,\x20%s,\x20%s','error','Setting,\x20%s,\x20%s','message','result','util','moment','bluebird','ioredis','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','client','http','request','then'];(function(_0x36c5b0,_0x5001da){var _0xf19333=function(_0x1e880a){while(--_0x1e880a){_0x36c5b0['push'](_0x36c5b0['shift']());}};_0xf19333(++_0x5001da);}(_0x9633,0xe3));var _0x3963=function(_0x456635,_0x467ba6){_0x456635=_0x456635-0x0;var _0x21e3e6=_0x9633[_0x456635];return _0x21e3e6;};'use strict';var _=require('lodash');var util=require(_0x3963('0x0'));var moment=require(_0x3963('0x1'));var BPromise=require(_0x3963('0x2'));var rs=require('randomstring');var fs=require('fs');var Redis=require(_0x3963('0x3'));var db=require('../../mysqldb')['db'];var utils=require(_0x3963('0x4'));var logger=require(_0x3963('0x5'))(_0x3963('0x6'));var config=require(_0x3963('0x7'));var jayson=require(_0x3963('0x8'));var client=jayson[_0x3963('0x9')][_0x3963('0xa')]({'port':0x232a});function respondWithRpcPromise(_0x1a5e66,_0x255c08,_0x303c5c){return new BPromise(function(_0x2ed66c,_0x9c78a1){return client[_0x3963('0xb')](_0x1a5e66,_0x303c5c)[_0x3963('0xc')](function(_0x267cb7){logger[_0x3963('0xd')]('Setting,\x20%s,\x20%s',_0x255c08,_0x3963('0xe'));logger['debug'](_0x3963('0xf'),_0x255c08,_0x3963('0xe'),JSON['stringify'](_0x267cb7));if(_0x267cb7[_0x3963('0x10')]){if(_0x267cb7['error']['code']===0x1f4){logger[_0x3963('0x10')](_0x3963('0x11'),_0x255c08,_0x267cb7['error'][_0x3963('0x12')]);return _0x9c78a1(_0x267cb7[_0x3963('0x10')][_0x3963('0x12')]);}logger[_0x3963('0x10')](_0x3963('0x11'),_0x255c08,_0x267cb7[_0x3963('0x10')][_0x3963('0x12')]);return _0x2ed66c(_0x267cb7[_0x3963('0x10')][_0x3963('0x12')]);}else{logger[_0x3963('0xd')]('Setting,\x20%s,\x20%s',_0x255c08,_0x3963('0xe'));_0x2ed66c(_0x267cb7[_0x3963('0x13')][_0x3963('0x12')]);}})['catch'](function(_0x58334b){logger[_0x3963('0x10')](_0x3963('0x11'),_0x255c08,_0x58334b);_0x9c78a1(_0x58334b);});});}
\ No newline at end of file
+var _0xb926=['moment','randomstring','ioredis','../../mysqldb','../../config/logger','jayson/promise','client','http','request','info','Setting,\x20%s,\x20%s','request\x20sent','debug','Setting,\x20%s,\x20%s,\x20%s','stringify','code','error','message','result','catch','lodash'];(function(_0x4fb930,_0x4141c4){var _0x59adc4=function(_0x540aef){while(--_0x540aef){_0x4fb930['push'](_0x4fb930['shift']());}};_0x59adc4(++_0x4141c4);}(_0xb926,0x1b8));var _0x6b92=function(_0x5c2937,_0x8055c2){_0x5c2937=_0x5c2937-0x0;var _0x3516ee=_0xb926[_0x5c2937];return _0x3516ee;};'use strict';var _=require(_0x6b92('0x0'));var util=require('util');var moment=require(_0x6b92('0x1'));var BPromise=require('bluebird');var rs=require(_0x6b92('0x2'));var fs=require('fs');var Redis=require(_0x6b92('0x3'));var db=require(_0x6b92('0x4'))['db'];var utils=require('../../config/utils');var logger=require(_0x6b92('0x5'))('rpc');var config=require('../../config/environment');var jayson=require(_0x6b92('0x6'));var client=jayson[_0x6b92('0x7')][_0x6b92('0x8')]({'port':0x232a});function respondWithRpcPromise(_0x7031a1,_0x3ff063,_0x5eed37){return new BPromise(function(_0x4ed5bf,_0x4d6be1){return client[_0x6b92('0x9')](_0x7031a1,_0x5eed37)['then'](function(_0x4b2099){logger[_0x6b92('0xa')](_0x6b92('0xb'),_0x3ff063,_0x6b92('0xc'));logger[_0x6b92('0xd')](_0x6b92('0xe'),_0x3ff063,_0x6b92('0xc'),JSON[_0x6b92('0xf')](_0x4b2099));if(_0x4b2099['error']){if(_0x4b2099['error'][_0x6b92('0x10')]===0x1f4){logger[_0x6b92('0x11')](_0x6b92('0xb'),_0x3ff063,_0x4b2099['error'][_0x6b92('0x12')]);return _0x4d6be1(_0x4b2099[_0x6b92('0x11')]['message']);}logger[_0x6b92('0x11')](_0x6b92('0xb'),_0x3ff063,_0x4b2099['error'][_0x6b92('0x12')]);return _0x4ed5bf(_0x4b2099['error'][_0x6b92('0x12')]);}else{logger[_0x6b92('0xa')](_0x6b92('0xb'),_0x3ff063,_0x6b92('0xc'));_0x4ed5bf(_0x4b2099[_0x6b92('0x13')][_0x6b92('0x12')]);}})[_0x6b92('0x14')](function(_0x533a68){logger[_0x6b92('0x11')]('Setting,\x20%s,\x20%s',_0x3ff063,_0x533a68);_0x4d6be1(_0x533a68);});});}
\ No newline at end of file
diff --git a/server/api/smsAccount/index.js b/server/api/smsAccount/index.js
index dc3c489..db9bee7 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 _0xb1c3=['put','update','delete','destroy','removeDispositions','removeAnswers','removeAgents','exports','multer','util','connect-timeout','express','Router','../../components/auth/service','../../components/interaction/service','../../config/environment','isAuthenticated','index','get','/describe','describe','/:id','show','/:id/dispositions','/:id/canned_answers','getAnswers','/:id/applications','getApplications','/:id/interactions','getInteractions','/:id/status','/:id/users','post','addDisposition','addAnswer','notify','/:id/send','send','status','addAgents'];(function(_0x59be39,_0x38558d){var _0x136795=function(_0x5e499f){while(--_0x5e499f){_0x59be39['push'](_0x59be39['shift']());}};_0x136795(++_0x38558d);}(_0xb1c3,0x80));var _0x3b1c=function(_0x23a1f1,_0x17b443){_0x23a1f1=_0x23a1f1-0x0;var _0x2dd422=_0xb1c3[_0x23a1f1];return _0x2dd422;};'use strict';var multer=require(_0x3b1c('0x0'));var util=require(_0x3b1c('0x1'));var path=require('path');var timeout=require(_0x3b1c('0x2'));var express=require(_0x3b1c('0x3'));var router=express[_0x3b1c('0x4')]();var auth=require(_0x3b1c('0x5'));var interaction=require(_0x3b1c('0x6'));var config=require(_0x3b1c('0x7'));var controller=require('./smsAccount.controller');router['get']('/',auth[_0x3b1c('0x8')](),controller[_0x3b1c('0x9')]);router[_0x3b1c('0xa')](_0x3b1c('0xb'),auth[_0x3b1c('0x8')](),controller[_0x3b1c('0xc')]);router[_0x3b1c('0xa')](_0x3b1c('0xd'),auth[_0x3b1c('0x8')](),controller[_0x3b1c('0xe')]);router['get'](_0x3b1c('0xf'),auth[_0x3b1c('0x8')](),controller['getDispositions']);router[_0x3b1c('0xa')](_0x3b1c('0x10'),auth[_0x3b1c('0x8')](),controller[_0x3b1c('0x11')]);router[_0x3b1c('0xa')](_0x3b1c('0x12'),auth[_0x3b1c('0x8')](),controller[_0x3b1c('0x13')]);router[_0x3b1c('0xa')](_0x3b1c('0x14'),auth[_0x3b1c('0x8')](),controller[_0x3b1c('0x15')]);router[_0x3b1c('0xa')](_0x3b1c('0x16'),controller['statusGet']);router[_0x3b1c('0xa')](_0x3b1c('0x17'),auth[_0x3b1c('0x8')](),controller['getAgents']);router[_0x3b1c('0x18')]('/',auth[_0x3b1c('0x8')](),controller['create']);router[_0x3b1c('0x18')](_0x3b1c('0xf'),auth[_0x3b1c('0x8')](),controller[_0x3b1c('0x19')]);router[_0x3b1c('0x18')](_0x3b1c('0x10'),auth['isAuthenticated'](),controller[_0x3b1c('0x1a')]);router[_0x3b1c('0x18')]('/:id/notify',controller[_0x3b1c('0x1b')]);router['post'](_0x3b1c('0x12'),auth[_0x3b1c('0x8')](),controller['addApplications']);router[_0x3b1c('0x18')](_0x3b1c('0x1c'),auth[_0x3b1c('0x8')](),controller[_0x3b1c('0x1d')]);router[_0x3b1c('0x18')](_0x3b1c('0x16'),controller[_0x3b1c('0x1e')]);router[_0x3b1c('0x18')](_0x3b1c('0x17'),auth[_0x3b1c('0x8')](),controller[_0x3b1c('0x1f')]);router[_0x3b1c('0x20')]('/:id',auth[_0x3b1c('0x8')](),controller[_0x3b1c('0x21')]);router[_0x3b1c('0x22')](_0x3b1c('0xd'),auth[_0x3b1c('0x8')](),controller[_0x3b1c('0x23')]);router['delete'](_0x3b1c('0xf'),auth[_0x3b1c('0x8')](),controller[_0x3b1c('0x24')]);router[_0x3b1c('0x22')](_0x3b1c('0x10'),auth['isAuthenticated'](),controller[_0x3b1c('0x25')]);router[_0x3b1c('0x22')](_0x3b1c('0x17'),auth[_0x3b1c('0x8')](),controller[_0x3b1c('0x26')]);module[_0x3b1c('0x27')]=router;
\ No newline at end of file
+var _0x2075=['exports','util','path','connect-timeout','express','Router','../../components/interaction/service','../../config/environment','./smsAccount.controller','get','isAuthenticated','index','/:id','getDispositions','/:id/canned_answers','/:id/applications','getInteractions','/:id/users','getAgents','post','create','/:id/dispositions','addDisposition','/:id/notify','notify','addApplications','send','/:id/status','status','addAgents','put','update','delete','destroy','removeDispositions','removeAnswers','removeAgents'];(function(_0x294569,_0x265330){var _0x246dc3=function(_0x4b5510){while(--_0x4b5510){_0x294569['push'](_0x294569['shift']());}};_0x246dc3(++_0x265330);}(_0x2075,0x70));var _0x5207=function(_0x8962d6,_0x503ed6){_0x8962d6=_0x8962d6-0x0;var _0x566f25=_0x2075[_0x8962d6];return _0x566f25;};'use strict';var multer=require('multer');var util=require(_0x5207('0x0'));var path=require(_0x5207('0x1'));var timeout=require(_0x5207('0x2'));var express=require(_0x5207('0x3'));var router=express[_0x5207('0x4')]();var auth=require('../../components/auth/service');var interaction=require(_0x5207('0x5'));var config=require(_0x5207('0x6'));var controller=require(_0x5207('0x7'));router[_0x5207('0x8')]('/',auth[_0x5207('0x9')](),controller[_0x5207('0xa')]);router['get']('/describe',auth[_0x5207('0x9')](),controller['describe']);router[_0x5207('0x8')](_0x5207('0xb'),auth[_0x5207('0x9')](),controller['show']);router[_0x5207('0x8')]('/:id/dispositions',auth[_0x5207('0x9')](),controller[_0x5207('0xc')]);router[_0x5207('0x8')](_0x5207('0xd'),auth[_0x5207('0x9')](),controller['getAnswers']);router[_0x5207('0x8')](_0x5207('0xe'),auth[_0x5207('0x9')](),controller['getApplications']);router[_0x5207('0x8')]('/:id/interactions',auth['isAuthenticated'](),controller[_0x5207('0xf')]);router['get']('/:id/status',controller['statusGet']);router[_0x5207('0x8')](_0x5207('0x10'),auth[_0x5207('0x9')](),controller[_0x5207('0x11')]);router[_0x5207('0x12')]('/',auth['isAuthenticated'](),controller[_0x5207('0x13')]);router[_0x5207('0x12')](_0x5207('0x14'),auth[_0x5207('0x9')](),controller[_0x5207('0x15')]);router['post'](_0x5207('0xd'),auth[_0x5207('0x9')](),controller['addAnswer']);router[_0x5207('0x12')](_0x5207('0x16'),controller[_0x5207('0x17')]);router['post'](_0x5207('0xe'),auth[_0x5207('0x9')](),controller[_0x5207('0x18')]);router[_0x5207('0x12')]('/:id/send',auth[_0x5207('0x9')](),controller[_0x5207('0x19')]);router[_0x5207('0x12')](_0x5207('0x1a'),controller[_0x5207('0x1b')]);router[_0x5207('0x12')](_0x5207('0x10'),auth[_0x5207('0x9')](),controller[_0x5207('0x1c')]);router[_0x5207('0x1d')](_0x5207('0xb'),auth['isAuthenticated'](),controller[_0x5207('0x1e')]);router[_0x5207('0x1f')](_0x5207('0xb'),auth['isAuthenticated'](),controller[_0x5207('0x20')]);router[_0x5207('0x1f')]('/:id/dispositions',auth[_0x5207('0x9')](),controller[_0x5207('0x21')]);router[_0x5207('0x1f')](_0x5207('0xd'),auth[_0x5207('0x9')](),controller[_0x5207('0x22')]);router['delete'](_0x5207('0x10'),auth[_0x5207('0x9')](),controller[_0x5207('0x23')]);module[_0x5207('0x24')]=router;
\ No newline at end of file
diff --git a/server/api/smsAccount/smsAccount.attributes.js b/server/api/smsAccount/smsAccount.attributes.js
index 4a3aca3..fee6094 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 _0x640c=['mandatoryDisposition','sequelize','randomstring','STRING','name','ENUM','skebby','connectel','clicksend','plivo','clickatell','csc','BOOLEAN','TEXT','INTEGER','Status\x20to\x20put\x20when\x20mandatory\x20disposition\x20is\x20enabled','setDataValue'];(function(_0x2af815,_0x3474fc){var _0x3e7ca2=function(_0x2206ab){while(--_0x2206ab){_0x2af815['push'](_0x2af815['shift']());}};_0x3e7ca2(++_0x3474fc);}(_0x640c,0x100));var _0xc640=function(_0x35021f,_0x451349){_0x35021f=_0x35021f-0x0;var _0x1044e9=_0x640c[_0x35021f];return _0x1044e9;};'use strict';var Sequelize=require(_0xc640('0x0'));var rs=require(_0xc640('0x1'));module['exports']={'name':{'type':Sequelize[_0xc640('0x2')],'unique':_0xc640('0x3'),'allowNull':![]},'key':{'type':Sequelize[_0xc640('0x2')],'allowNull':![]},'remote':{'type':Sequelize['STRING'],'allowNull':![]},'token':{'type':Sequelize[_0xc640('0x2')],'defaultValue':function(){return rs['generate']();}},'phone':{'type':Sequelize[_0xc640('0x2')]},'type':{'type':Sequelize[_0xc640('0x4')]('twilio',_0xc640('0x5'),_0xc640('0x6'),_0xc640('0x7'),_0xc640('0x8'),_0xc640('0x9'),_0xc640('0xa'),'infobip','intelepeer')},'accountSid':{'type':Sequelize[_0xc640('0x2')]},'authId':{'type':Sequelize['STRING']},'authToken':{'type':Sequelize[_0xc640('0x2')]},'smsMethod':{'type':Sequelize['ENUM']('SI','TI','GP')},'username':{'type':Sequelize[_0xc640('0x2')]},'password':{'type':Sequelize[_0xc640('0x2')]},'apiKey':{'type':Sequelize[_0xc640('0x2')]},'senderString':{'type':Sequelize['STRING']},'deliveryReport':{'type':Sequelize[_0xc640('0xb')],'defaultValue':![]},'description':{'type':Sequelize['STRING']},'notificationTemplate':{'type':Sequelize[_0xc640('0xc')],'defaultValue':function(){return'Account:\x20{{account.name}} {{#queue}}Queue:\x20{{queue.name}} {{/queue}}From\x20:\x20{{from}}';}},'notificationSound':{'type':Sequelize[_0xc640('0xb')],'defaultValue':!![]},'notificationShake':{'type':Sequelize[_0xc640('0xb')],'defaultValue':![]},'waitForTheAssignedAgent':{'type':Sequelize[_0xc640('0xd')],'validate':{'min':0x1,'max':0x20c49b},'defaultValue':0xa},'queueTransfer':{'type':Sequelize[_0xc640('0xb')],'defaultValue':![]},'queueTransferTimeout':{'type':Sequelize['INTEGER'],'validate':{'min':0x1,'max':0x20c49b},'defaultValue':0x12c},'agentTransfer':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'agentTransferTimeout':{'type':Sequelize[_0xc640('0xd')],'validate':{'min':0x1,'max':0x20c49b},'defaultValue':0x12c},'baseUrl':{'type':Sequelize[_0xc640('0x2')]},'mandatoryDispositionPauseId':{'type':Sequelize[_0xc640('0xd')],'comment':_0xc640('0xe')},'mandatoryDisposition':{'type':Sequelize[_0xc640('0xb')],'defaultValue':![],'comment':'Enabled/disables\x20mandatory\x20dispo\x20on\x20a\x20queue','set':function(_0x38c793){if(!_0x38c793)this[_0xc640('0xf')]('mandatoryDispositionPauseId',null);this['setDataValue'](_0xc640('0x10'),_0x38c793);}}};
\ No newline at end of file
+var _0x321d=['skebby','clicksend','plivo','clickatell','csc','infobip','intelepeer','BOOLEAN','TEXT','Account:\x20{{account.name}} {{#queue}}Queue:\x20{{queue.name}} {{/queue}}From\x20:\x20{{from}}','INTEGER','Status\x20to\x20put\x20when\x20mandatory\x20disposition\x20is\x20enabled','Enabled/disables\x20mandatory\x20dispo\x20on\x20a\x20queue','mandatoryDispositionPauseId','mandatoryDisposition','sequelize','randomstring','exports','STRING','name','generate','ENUM'];(function(_0x6ca7f4,_0x51a5df){var _0x494fa6=function(_0x359532){while(--_0x359532){_0x6ca7f4['push'](_0x6ca7f4['shift']());}};_0x494fa6(++_0x51a5df);}(_0x321d,0x93));var _0xd321=function(_0x36c0c6,_0xd62883){_0x36c0c6=_0x36c0c6-0x0;var _0x2a5d9c=_0x321d[_0x36c0c6];return _0x2a5d9c;};'use strict';var Sequelize=require(_0xd321('0x0'));var rs=require(_0xd321('0x1'));module[_0xd321('0x2')]={'name':{'type':Sequelize[_0xd321('0x3')],'unique':_0xd321('0x4'),'allowNull':![]},'key':{'type':Sequelize[_0xd321('0x3')],'allowNull':![]},'remote':{'type':Sequelize[_0xd321('0x3')],'allowNull':![]},'token':{'type':Sequelize[_0xd321('0x3')],'defaultValue':function(){return rs[_0xd321('0x5')]();}},'phone':{'type':Sequelize[_0xd321('0x3')]},'type':{'type':Sequelize[_0xd321('0x6')]('twilio',_0xd321('0x7'),'connectel',_0xd321('0x8'),_0xd321('0x9'),_0xd321('0xa'),_0xd321('0xb'),_0xd321('0xc'),_0xd321('0xd'))},'accountSid':{'type':Sequelize[_0xd321('0x3')]},'authId':{'type':Sequelize[_0xd321('0x3')]},'authToken':{'type':Sequelize['STRING']},'smsMethod':{'type':Sequelize[_0xd321('0x6')]('SI','TI','GP')},'username':{'type':Sequelize[_0xd321('0x3')]},'password':{'type':Sequelize['STRING']},'apiKey':{'type':Sequelize[_0xd321('0x3')]},'senderString':{'type':Sequelize[_0xd321('0x3')]},'deliveryReport':{'type':Sequelize[_0xd321('0xe')],'defaultValue':![]},'description':{'type':Sequelize['STRING']},'notificationTemplate':{'type':Sequelize[_0xd321('0xf')],'defaultValue':function(){return _0xd321('0x10');}},'notificationSound':{'type':Sequelize[_0xd321('0xe')],'defaultValue':!![]},'notificationShake':{'type':Sequelize[_0xd321('0xe')],'defaultValue':![]},'waitForTheAssignedAgent':{'type':Sequelize['INTEGER'],'validate':{'min':0x1,'max':0x20c49b},'defaultValue':0xa},'queueTransfer':{'type':Sequelize[_0xd321('0xe')],'defaultValue':![]},'queueTransferTimeout':{'type':Sequelize[_0xd321('0x11')],'validate':{'min':0x1,'max':0x20c49b},'defaultValue':0x12c},'agentTransfer':{'type':Sequelize[_0xd321('0xe')],'defaultValue':![]},'agentTransferTimeout':{'type':Sequelize['INTEGER'],'validate':{'min':0x1,'max':0x20c49b},'defaultValue':0x12c},'baseUrl':{'type':Sequelize[_0xd321('0x3')]},'mandatoryDispositionPauseId':{'type':Sequelize[_0xd321('0x11')],'comment':_0xd321('0x12')},'mandatoryDisposition':{'type':Sequelize[_0xd321('0xe')],'defaultValue':![],'comment':_0xd321('0x13'),'set':function(_0x45ec84){if(!_0x45ec84)this['setDataValue'](_0xd321('0x14'),null);this['setDataValue'](_0xd321('0x15'),_0x45ec84);}}};
\ No newline at end of file
diff --git a/server/api/smsAccount/smsAccount.controller.js b/server/api/smsAccount/smsAccount.controller.js
index 0712c0c..d20e211 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 _0x5713=['status_code','groupName','DELIVERED','redif','update','DELIVERED_TO_GATEWAY','RECEIVED_BY_RECIPIENT','DELIVRD','ACCEPTD','csc','state','message-id','addAgents','emit','userSmsAccount:save','removeAgents','isArray','userSmsAccount:remove','getAgents','html-pdf','eml-format','zip-dir','request-promise','moment','bluebird','mustache','sox','to-csv','ejs','lodash','squel','crypto','desk.js','querystring','papaparse','ioredis','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','redis','defaults','localhost','socket.io-emitter','./smsAccount.socket','register','jayson/promise','client','http','test','request','then','info','request\x20sent','SmsAccount,\x20%s,\x20%s,\x20%s','code','error','SmsAccount,\x20%s,\x20%s','message','catch','sendStatus','status','end','offset','limit','set','Content-Range','json','reject','save','UserProfileResource','destroy','stack','name','send','Pause','mandatoryDispositionPause','map','SmsAccount','fieldName','model','query','keys','intersection','fields','attributes','length','hasOwnProperty','sort','where','filters','pick','filter','type','VIRTUAL','merge','options','count','includeAll','findAll','rows','show','params','rawAttributes','include','find','create','body','user','get','SmsAccounts','UserProfileSection','userProfileId','autoAssociation','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','describe','addDisposition','SmsAccountId','Disposition','getDispositions','findOne','nolimit','order','removeDispositions','ids','addAnswer','CannedAnswer','removeAnswers','SmsApplication','Applications','account','applications','orderBy','priority','CmContact','Sequelize','ValidationError','no\x20available\x20attributes','createdAt','updatedAt','CompanyId','mobile','twilio','from','From','messageId','MessageSid','skebby','sender','connectel','clicksend','message_id','plivo','MessageUUID','infobip','results','text','segmentedMessage','clickatell','replyMessageId','intelepeer','refid','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','ListId','Contacts','DESC','list','contact','SmsInteraction','spread','interaction','created','push','close','SmsMessage','AttachmentId','User','UserId','unshift','waitForTheAssignedAgent','Start','startRouting','receiveMessage','entity\x20found','debug','SmsAccount,\x20%s,\x20%s,\x20%s,\x20%s','stringify','Content-Type','text/xml','\x0a ','addApplications','findAndCountAll','getApplications','getInteractions','Contact','Owner','fullname','internal','Tag','Tags','color','tag','List','out','Messages','dataValues','log','endpoint\x20/status\x20POST\x20/','received\x20delivery\x20report\x20from','inspect','skebby_dispatch_id','requestid','statusInt'];(function(_0x183d84,_0x3e6567){var _0x49da11=function(_0x3f200c){while(--_0x3f200c){_0x183d84['push'](_0x183d84['shift']());}};_0x49da11(++_0x3e6567);}(_0x5713,0x1c7));var _0x3571=function(_0x51c4e9,_0xf04862){_0x51c4e9=_0x51c4e9-0x0;var _0x387d17=_0x5713[_0x51c4e9];return _0x387d17;};'use strict';var pdf=require(_0x3571('0x0'));var emlformat=require(_0x3571('0x1'));var rimraf=require('rimraf');var zipdir=require(_0x3571('0x2'));var jsonpatch=require('fast-json-patch');var rp=require(_0x3571('0x3'));var moment=require(_0x3571('0x4'));var BPromise=require(_0x3571('0x5'));var Mustache=require(_0x3571('0x6'));var util=require('util');var path=require('path');var sox=require(_0x3571('0x7'));var csv=require(_0x3571('0x8'));var ejs=require(_0x3571('0x9'));var fs=require('fs');var _=require(_0x3571('0xa'));var squel=require(_0x3571('0xb'));var crypto=require(_0x3571('0xc'));var jsforce=require('jsforce');var deskjs=require(_0x3571('0xd'));var toCsv=require(_0x3571('0x8'));var querystring=require(_0x3571('0xe'));var Papa=require(_0x3571('0xf'));var Redis=require(_0x3571('0x10'));var authService=require('../../components/auth/service');var qs=require('../../components/parsers/qs');var as=require(_0x3571('0x11'));var hardwareService=require(_0x3571('0x12'));var logger=require(_0x3571('0x13'))('api');var utils=require('../../config/utils');var config=require('../../config/environment');var db=require('../../mysqldb')['db'];config[_0x3571('0x14')]=_[_0x3571('0x15')](config[_0x3571('0x14')],{'host':_0x3571('0x16'),'port':0x18eb});var socket=require(_0x3571('0x17'))(new Redis(config[_0x3571('0x14')]));require(_0x3571('0x18'))[_0x3571('0x19')](socket);var jayson=require(_0x3571('0x1a'));var client=jayson[_0x3571('0x1b')][_0x3571('0x1c')]({'port':0x232c});function checkPasswordPattern(_0x3a51ef,_0x17cf63,_0x2ec0ea){if(_0x2ec0ea){var _0x434379=new RegExp(/(?=.*[a-z])(?=.*[A-Z])(?=.*[0-9])(?=.*[?!@#\$%\^&\*~\-_=+[{\]\}])(?=.{8,})/);if(_0x434379[_0x3571('0x1d')](_0x17cf63)){return _0x3a51ef;}else{throw new db['Sequelize']['ValidationError']('The\x20password\x20must\x20be\x20at\x20least\x208\x20characters\x20long\x20and\x20have\x201\x20lowercase\x20character,\x201\x20uppercase\x20character,\x201\x20number\x20and\x201\x20special\x20character\x20~!@#$%^&-_=+[{]}.');}}else{return _0x3a51ef;}}function respondWithRpcPromise(_0x1e5f22,_0x49e33d,_0x2b5b9c,_0x37881f){return new BPromise(function(_0x4b745a,_0x22a418){var _0xab19b1=_0x37881f||client;return _0xab19b1[_0x3571('0x1e')](_0x1e5f22,_0x2b5b9c)[_0x3571('0x1f')](function(_0x29c048){logger[_0x3571('0x20')]('SmsAccount,\x20%s,\x20%s',_0x49e33d,_0x3571('0x21'));logger['debug'](_0x3571('0x22'),_0x49e33d,_0x3571('0x21'),JSON['stringify'](_0x29c048));if(_0x29c048['error']){if(_0x29c048['error'][_0x3571('0x23')]===0x1f4){logger[_0x3571('0x24')](_0x3571('0x25'),_0x49e33d,_0x29c048[_0x3571('0x24')][_0x3571('0x26')]);return _0x22a418(_0x29c048['error'][_0x3571('0x26')]);}logger[_0x3571('0x24')](_0x3571('0x25'),_0x49e33d,_0x29c048[_0x3571('0x24')][_0x3571('0x26')]);return _0x4b745a(_0x29c048['error'][_0x3571('0x26')]);}else{logger[_0x3571('0x20')]('SmsAccount,\x20%s,\x20%s',_0x49e33d,_0x3571('0x21'));_0x4b745a(_0x29c048['result'][_0x3571('0x26')]);}})[_0x3571('0x27')](function(_0x242382){logger[_0x3571('0x24')](_0x3571('0x25'),_0x49e33d,_0x242382);_0x22a418(_0x242382);});});}function respondWithStatusCode(_0x285d9c,_0x400560){_0x400560=_0x400560||0xcc;return function(_0x4cbaae){if(_0x4cbaae){return _0x285d9c[_0x3571('0x28')](_0x400560);}return _0x285d9c[_0x3571('0x29')](_0x400560)[_0x3571('0x2a')]();};}function respondWithResult(_0x4fbe35,_0x5eded6){_0x5eded6=_0x5eded6||0xc8;return function(_0x5a362c){if(_0x5a362c){return _0x4fbe35[_0x3571('0x29')](_0x5eded6)['json'](_0x5a362c);}};}function respondWithFilteredResult(_0x288191,_0x105dab){return function(_0x2ef1b9){if(_0x2ef1b9){var _0x56e865=_0x2ef1b9['count'],_0x559a26=_0x105dab[_0x3571('0x2b')],_0x7c1c2a=_0x105dab['offset']+_0x105dab[_0x3571('0x2c')],_0x40eea0;if(_0x7c1c2a>=_0x56e865){_0x7c1c2a=_0x56e865;_0x40eea0=0xc8;}else{_0x40eea0=0xce;}_0x288191[_0x3571('0x29')](_0x40eea0);return _0x288191[_0x3571('0x2d')](_0x3571('0x2e'),_0x559a26+'-'+_0x7c1c2a+'/'+_0x56e865)[_0x3571('0x2f')](_0x2ef1b9);}return null;};}function patchUpdates(_0x2ce9c7){return function(_0x1f48ff){try{jsonpatch['apply'](_0x1f48ff,_0x2ce9c7,!![]);}catch(_0x41e823){return BPromise[_0x3571('0x30')](_0x41e823);}return _0x1f48ff[_0x3571('0x31')]();};}function saveUpdates(_0x2202fa,_0x5a98e9){return function(_0x22c0dc){if(_0x22c0dc){return _0x22c0dc['update'](_0x2202fa)[_0x3571('0x1f')](function(_0x16c5a0){return _0x16c5a0;});}return null;};}function removeEntity(_0x3bd657,_0x2328ec){return function(_0x1091d5){if(_0x1091d5){return _0x1091d5['destroy']()['then'](function(){var _0x525842=_0x1091d5['get']({'plain':!![]});var _0x13339b='SmsAccounts';return db[_0x3571('0x32')][_0x3571('0x33')]({'where':{'type':_0x13339b,'resourceId':_0x525842['id']}})[_0x3571('0x1f')](function(){return _0x1091d5;});})[_0x3571('0x1f')](function(){_0x3bd657[_0x3571('0x29')](0xcc)[_0x3571('0x2a')]();});}};}function handleEntityNotFound(_0x356eb1,_0x595fd4){return function(_0xe8ae19){if(!_0xe8ae19){_0x356eb1[_0x3571('0x28')](0x194);}return _0xe8ae19;};}function handleError(_0x28068e,_0x31d8db){_0x31d8db=_0x31d8db||0x1f4;return function(_0x3b4c4d){logger['error'](_0x3b4c4d[_0x3571('0x34')]);if(_0x3b4c4d[_0x3571('0x35')]){delete _0x3b4c4d[_0x3571('0x35')];}_0x28068e[_0x3571('0x29')](_0x31d8db)[_0x3571('0x36')](_0x3b4c4d);};}exports['index']=function(_0x55e18e,_0x5c2d17){var _0x552c91={'include':[{'model':db[_0x3571('0x37')],'as':_0x3571('0x38')}]},_0x5e0b97={},_0xb3ed8={'count':0x0,'rows':[]};var _0x14a132=_[_0x3571('0x39')](db[_0x3571('0x3a')]['rawAttributes'],function(_0x16f6ac){return{'name':_0x16f6ac[_0x3571('0x3b')],'type':_0x16f6ac['type']['key']};});_0x5e0b97[_0x3571('0x3c')]=_[_0x3571('0x39')](_0x14a132,_0x3571('0x35'));_0x5e0b97[_0x3571('0x3d')]=_[_0x3571('0x3e')](_0x55e18e[_0x3571('0x3d')]);_0x5e0b97['filters']=_[_0x3571('0x3f')](_0x5e0b97[_0x3571('0x3c')],_0x5e0b97[_0x3571('0x3d')]);_0x552c91['attributes']=_[_0x3571('0x3f')](_0x5e0b97['model'],qs[_0x3571('0x40')](_0x55e18e['query'][_0x3571('0x40')]));_0x552c91[_0x3571('0x41')]=_0x552c91[_0x3571('0x41')][_0x3571('0x42')]?_0x552c91[_0x3571('0x41')]:_0x5e0b97[_0x3571('0x3c')];if(!_0x55e18e[_0x3571('0x3d')][_0x3571('0x43')]('nolimit')){_0x552c91['limit']=qs[_0x3571('0x2c')](_0x55e18e[_0x3571('0x3d')][_0x3571('0x2c')]);_0x552c91[_0x3571('0x2b')]=qs[_0x3571('0x2b')](_0x55e18e[_0x3571('0x3d')][_0x3571('0x2b')]);}_0x552c91['order']=qs['sort'](_0x55e18e[_0x3571('0x3d')][_0x3571('0x44')]);_0x552c91[_0x3571('0x45')]=qs[_0x3571('0x46')](_[_0x3571('0x47')](_0x55e18e[_0x3571('0x3d')],_0x5e0b97[_0x3571('0x46')]));if(_0x55e18e[_0x3571('0x3d')][_0x3571('0x48')]){_0x552c91[_0x3571('0x45')]=_['merge'](_0x552c91[_0x3571('0x45')],{'$or':_['map'](_0x14a132,function(_0x2758a5){if(_0x2758a5[_0x3571('0x49')]!==_0x3571('0x4a')){var _0x480a3f={};_0x480a3f[_0x2758a5[_0x3571('0x35')]]={'$like':'%'+_0x55e18e[_0x3571('0x3d')][_0x3571('0x48')]+'%'};return _0x480a3f;}})});}_0x552c91=_[_0x3571('0x4b')]({},_0x552c91,_0x55e18e[_0x3571('0x4c')]);var _0x8d850={'where':_0x552c91[_0x3571('0x45')]};return db['SmsAccount'][_0x3571('0x4d')](_0x8d850)['then'](function(_0x721d61){_0xb3ed8['count']=_0x721d61;if(_0x55e18e[_0x3571('0x3d')][_0x3571('0x4e')]){_0x552c91['include']=[{'all':!![]}];}return db[_0x3571('0x3a')][_0x3571('0x4f')](_0x552c91);})['then'](function(_0x4b7800){_0xb3ed8[_0x3571('0x50')]=_0x4b7800;return _0xb3ed8;})[_0x3571('0x1f')](respondWithFilteredResult(_0x5c2d17,_0x552c91))[_0x3571('0x27')](handleError(_0x5c2d17,null));};exports[_0x3571('0x51')]=function(_0x12c0f5,_0x10dbd6){var _0x4fb2a8={'raw':![],'where':{'id':_0x12c0f5[_0x3571('0x52')]['id']},'include':[{'model':db[_0x3571('0x37')],'as':_0x3571('0x38')}]},_0x382d88={};_0x382d88[_0x3571('0x3c')]=_['keys'](db[_0x3571('0x3a')][_0x3571('0x53')]);_0x382d88[_0x3571('0x3d')]=_[_0x3571('0x3e')](_0x12c0f5[_0x3571('0x3d')]);_0x382d88[_0x3571('0x46')]=_['intersection'](_0x382d88[_0x3571('0x3c')],_0x382d88[_0x3571('0x3d')]);_0x4fb2a8[_0x3571('0x41')]=_['intersection'](_0x382d88[_0x3571('0x3c')],qs[_0x3571('0x40')](_0x12c0f5[_0x3571('0x3d')][_0x3571('0x40')]));_0x4fb2a8['attributes']=_0x4fb2a8['attributes'][_0x3571('0x42')]?_0x4fb2a8[_0x3571('0x41')]:_0x382d88[_0x3571('0x3c')];if(_0x12c0f5[_0x3571('0x3d')][_0x3571('0x4e')]){_0x4fb2a8[_0x3571('0x54')]=[{'all':!![]}];}_0x4fb2a8=_['merge']({},_0x4fb2a8,_0x12c0f5['options']);return db[_0x3571('0x3a')][_0x3571('0x55')](_0x4fb2a8)[_0x3571('0x1f')](handleEntityNotFound(_0x10dbd6,null))[_0x3571('0x1f')](respondWithResult(_0x10dbd6,null))[_0x3571('0x27')](handleError(_0x10dbd6,null));};exports[_0x3571('0x56')]=function(_0x3c27b8,_0x3d3ec2){return db[_0x3571('0x3a')]['create'](_0x3c27b8[_0x3571('0x57')],{})[_0x3571('0x1f')](function(_0x30b542){var _0x3340da=_0x3c27b8[_0x3571('0x58')][_0x3571('0x59')]({'plain':!![]});if(!_0x3340da)throw new Error('Unable\x20to\x20retrieve\x20the\x20current\x20user');if(_0x3340da['role']==='user'){var _0xead253=_0x30b542[_0x3571('0x59')]({'plain':!![]});var _0x384578=_0x3571('0x5a');return db[_0x3571('0x5b')][_0x3571('0x55')]({'where':{'name':_0x384578,'userProfileId':_0x3340da[_0x3571('0x5c')]},'raw':!![]})[_0x3571('0x1f')](function(_0x536c3b){if(_0x536c3b&&_0x536c3b[_0x3571('0x5d')]===0x0){return db['UserProfileResource']['create']({'name':_0xead253[_0x3571('0x35')],'resourceId':_0xead253['id'],'type':_0x536c3b['name'],'sectionId':_0x536c3b['id']},{})['then'](function(){return _0x30b542;});}else{return _0x30b542;}})[_0x3571('0x27')](function(_0x55f6e6){logger[_0x3571('0x24')](_0x3571('0x5e'),_0x55f6e6);throw _0x55f6e6;});}return _0x30b542;})[_0x3571('0x1f')](respondWithResult(_0x3d3ec2,0xc9))[_0x3571('0x27')](handleError(_0x3d3ec2,null));};exports['update']=function(_0x212be3,_0x4ce88e){if(_0x212be3[_0x3571('0x57')]['id']){delete _0x212be3[_0x3571('0x57')]['id'];}return db[_0x3571('0x3a')][_0x3571('0x55')]({'where':{'id':_0x212be3[_0x3571('0x52')]['id']},'include':[{'model':db[_0x3571('0x37')],'as':_0x3571('0x38')}]})[_0x3571('0x1f')](handleEntityNotFound(_0x4ce88e,null))[_0x3571('0x1f')](saveUpdates(_0x212be3[_0x3571('0x57')],null))['then'](respondWithResult(_0x4ce88e,null))[_0x3571('0x27')](handleError(_0x4ce88e,null));};exports[_0x3571('0x33')]=function(_0x13fe2c,_0x1ba745){return db[_0x3571('0x3a')][_0x3571('0x55')]({'where':{'id':_0x13fe2c['params']['id']}})[_0x3571('0x1f')](handleEntityNotFound(_0x1ba745,null))['then'](removeEntity(_0x1ba745,null))[_0x3571('0x27')](handleError(_0x1ba745,null));};exports[_0x3571('0x5f')]=function(_0x1cbf13,_0x1b5a8a){return db[_0x3571('0x3a')]['describe']()[_0x3571('0x1f')](respondWithResult(_0x1b5a8a,null))[_0x3571('0x27')](handleError(_0x1b5a8a,null));};exports[_0x3571('0x60')]=function(_0x5133ac,_0x5ed862,_0x2bcd7f){if(_0x5133ac[_0x3571('0x57')]['id']){delete _0x5133ac[_0x3571('0x57')]['id'];}return db['SmsAccount'][_0x3571('0x55')]({'where':{'id':_0x5133ac[_0x3571('0x52')]['id']}})[_0x3571('0x1f')](handleEntityNotFound(_0x5ed862,null))[_0x3571('0x1f')](function(_0x17d9ee){if(_0x17d9ee){_0x5133ac[_0x3571('0x57')][_0x3571('0x61')]=_0x17d9ee['id'];return db[_0x3571('0x62')][_0x3571('0x56')](_0x5133ac[_0x3571('0x57')]);}})[_0x3571('0x1f')](respondWithResult(_0x5ed862,null))[_0x3571('0x27')](handleError(_0x5ed862,null));};exports[_0x3571('0x63')]=function(_0x1ea269,_0x345efb,_0x4dc4c9){var _0x3aa3f3={'raw':![],'where':{}};var _0x5cebbd={};var _0x1b6021={'count':0x0,'rows':[]};return db[_0x3571('0x3a')][_0x3571('0x64')]({'where':{'id':_0x1ea269[_0x3571('0x52')]['id']}})[_0x3571('0x1f')](handleEntityNotFound(_0x345efb,null))[_0x3571('0x1f')](function(_0x5429ac){if(_0x5429ac){_0x5cebbd['model']=_['keys'](db['Disposition']['rawAttributes']);_0x5cebbd[_0x3571('0x3d')]=_['keys'](_0x1ea269['query']);_0x5cebbd[_0x3571('0x46')]=_[_0x3571('0x3f')](_0x5cebbd[_0x3571('0x3c')],_0x5cebbd[_0x3571('0x3d')]);_0x3aa3f3['attributes']=_[_0x3571('0x3f')](_0x5cebbd[_0x3571('0x3c')],qs['fields'](_0x1ea269['query'][_0x3571('0x40')]));_0x3aa3f3[_0x3571('0x41')]=_0x3aa3f3[_0x3571('0x41')][_0x3571('0x42')]?_0x3aa3f3[_0x3571('0x41')]:_0x5cebbd[_0x3571('0x3c')];if(!_0x1ea269['query'][_0x3571('0x43')](_0x3571('0x65'))){_0x3aa3f3['limit']=qs['limit'](_0x1ea269['query'][_0x3571('0x2c')]);_0x3aa3f3[_0x3571('0x2b')]=qs[_0x3571('0x2b')](_0x1ea269[_0x3571('0x3d')]['offset']);}_0x3aa3f3[_0x3571('0x66')]=qs['sort'](_0x1ea269['query'][_0x3571('0x44')]);_0x3aa3f3['where']=qs[_0x3571('0x46')](_[_0x3571('0x47')](_0x1ea269[_0x3571('0x3d')],_0x5cebbd[_0x3571('0x46')]));_0x3aa3f3[_0x3571('0x45')][_0x3571('0x61')]=_0x5429ac['id'];if(_0x1ea269[_0x3571('0x3d')][_0x3571('0x48')]){_0x3aa3f3[_0x3571('0x45')]=_['merge'](_0x3aa3f3['where'],{'$or':_[_0x3571('0x39')](_0x3aa3f3[_0x3571('0x41')],function(_0x58e8c9){var _0x41d9ef={};_0x41d9ef[_0x58e8c9]={'$like':'%'+_0x1ea269[_0x3571('0x3d')]['filter']+'%'};return _0x41d9ef;})});}_0x3aa3f3=_[_0x3571('0x4b')]({},_0x3aa3f3,_0x1ea269['options']);return db['Disposition']['count']({'where':_0x3aa3f3['where']})[_0x3571('0x1f')](function(_0x2e7e7b){_0x1b6021[_0x3571('0x4d')]=_0x2e7e7b;if(_0x1ea269[_0x3571('0x3d')][_0x3571('0x4e')]){_0x3aa3f3[_0x3571('0x54')]=[{'all':!![]}];}return db[_0x3571('0x62')][_0x3571('0x4f')](_0x3aa3f3);})['then'](function(_0xc8cdf){_0x1b6021[_0x3571('0x50')]=_0xc8cdf;return _0x1b6021;});}})[_0x3571('0x1f')](respondWithFilteredResult(_0x345efb,_0x3aa3f3))[_0x3571('0x27')](handleError(_0x345efb,null));};exports['removeDispositions']=function(_0x421995,_0x142b82,_0x46971c){return db[_0x3571('0x3a')]['find']({'where':{'id':_0x421995[_0x3571('0x52')]['id']}})[_0x3571('0x1f')](handleEntityNotFound(_0x142b82,null))[_0x3571('0x1f')](function(_0x182305){if(_0x182305){return _0x182305[_0x3571('0x67')](_0x421995['query'][_0x3571('0x68')]);}})['then'](respondWithStatusCode(_0x142b82,null))[_0x3571('0x27')](handleError(_0x142b82,null));};exports[_0x3571('0x69')]=function(_0x1be481,_0x24747d,_0x58d946){if(_0x1be481[_0x3571('0x57')]['id']){delete _0x1be481[_0x3571('0x57')]['id'];}return db[_0x3571('0x3a')]['find']({'where':{'id':_0x1be481[_0x3571('0x52')]['id']}})['then'](handleEntityNotFound(_0x24747d,null))[_0x3571('0x1f')](function(_0x5bbcd8){if(_0x5bbcd8){_0x1be481[_0x3571('0x57')][_0x3571('0x61')]=_0x5bbcd8['id'];return db['CannedAnswer']['create'](_0x1be481['body']);}})[_0x3571('0x1f')](respondWithResult(_0x24747d,null))[_0x3571('0x27')](handleError(_0x24747d,null));};exports['getAnswers']=function(_0x149c6f,_0x24d73d,_0xfd2613){var _0xf5aa8e={'raw':![],'where':{}};var _0x5d7fe8={};var _0x371ae7={'count':0x0,'rows':[]};return db['SmsAccount'][_0x3571('0x64')]({'where':{'id':_0x149c6f[_0x3571('0x52')]['id']}})[_0x3571('0x1f')](handleEntityNotFound(_0x24d73d,null))[_0x3571('0x1f')](function(_0x1d1915){if(_0x1d1915){_0x5d7fe8[_0x3571('0x3c')]=_[_0x3571('0x3e')](db[_0x3571('0x6a')][_0x3571('0x53')]);_0x5d7fe8[_0x3571('0x3d')]=_[_0x3571('0x3e')](_0x149c6f[_0x3571('0x3d')]);_0x5d7fe8[_0x3571('0x46')]=_[_0x3571('0x3f')](_0x5d7fe8[_0x3571('0x3c')],_0x5d7fe8[_0x3571('0x3d')]);_0xf5aa8e[_0x3571('0x41')]=_[_0x3571('0x3f')](_0x5d7fe8[_0x3571('0x3c')],qs[_0x3571('0x40')](_0x149c6f[_0x3571('0x3d')][_0x3571('0x40')]));_0xf5aa8e[_0x3571('0x41')]=_0xf5aa8e[_0x3571('0x41')][_0x3571('0x42')]?_0xf5aa8e[_0x3571('0x41')]:_0x5d7fe8['model'];if(!_0x149c6f[_0x3571('0x3d')]['hasOwnProperty'](_0x3571('0x65'))){_0xf5aa8e[_0x3571('0x2c')]=qs[_0x3571('0x2c')](_0x149c6f[_0x3571('0x3d')][_0x3571('0x2c')]);_0xf5aa8e[_0x3571('0x2b')]=qs[_0x3571('0x2b')](_0x149c6f[_0x3571('0x3d')]['offset']);}_0xf5aa8e['order']=qs[_0x3571('0x44')](_0x149c6f[_0x3571('0x3d')]['sort']);_0xf5aa8e[_0x3571('0x45')]=qs[_0x3571('0x46')](_[_0x3571('0x47')](_0x149c6f[_0x3571('0x3d')],_0x5d7fe8[_0x3571('0x46')]));_0xf5aa8e['where']['SmsAccountId']=_0x1d1915['id'];if(_0x149c6f[_0x3571('0x3d')][_0x3571('0x48')]){_0xf5aa8e[_0x3571('0x45')]=_[_0x3571('0x4b')](_0xf5aa8e[_0x3571('0x45')],{'$or':_['map'](_0xf5aa8e[_0x3571('0x41')],function(_0x5b50cd){var _0x468808={};_0x468808[_0x5b50cd]={'$like':'%'+_0x149c6f[_0x3571('0x3d')]['filter']+'%'};return _0x468808;})});}_0xf5aa8e=_[_0x3571('0x4b')]({},_0xf5aa8e,_0x149c6f[_0x3571('0x4c')]);return db['CannedAnswer'][_0x3571('0x4d')]({'where':_0xf5aa8e[_0x3571('0x45')]})[_0x3571('0x1f')](function(_0x4a11b0){_0x371ae7[_0x3571('0x4d')]=_0x4a11b0;if(_0x149c6f['query'][_0x3571('0x4e')]){_0xf5aa8e[_0x3571('0x54')]=[{'all':!![]}];}return db['CannedAnswer']['findAll'](_0xf5aa8e);})[_0x3571('0x1f')](function(_0x49509d){_0x371ae7[_0x3571('0x50')]=_0x49509d;return _0x371ae7;});}})['then'](respondWithFilteredResult(_0x24d73d,_0xf5aa8e))['catch'](handleError(_0x24d73d,null));};exports[_0x3571('0x6b')]=function(_0x189116,_0x1d3404,_0x266c85){return db[_0x3571('0x3a')]['find']({'where':{'id':_0x189116[_0x3571('0x52')]['id']}})[_0x3571('0x1f')](handleEntityNotFound(_0x1d3404,null))[_0x3571('0x1f')](function(_0x461e07){if(_0x461e07){return _0x461e07[_0x3571('0x6b')](_0x189116[_0x3571('0x3d')][_0x3571('0x68')]);}})[_0x3571('0x1f')](respondWithStatusCode(_0x1d3404,null))['catch'](handleError(_0x1d3404,null));};exports['notify']=function(_0x58571d,_0x4c6b9d,_0x388202){var _0x213262={'channel':'sms'};var _0x416c93=[];var _0x4eda8b=[];var _0x267f24={};return db['SmsAccount'][_0x3571('0x55')]({'where':{'id':_0x58571d[_0x3571('0x52')]['id']},'include':[{'model':db[_0x3571('0x6c')],'as':_0x3571('0x6d')}]})[_0x3571('0x1f')](handleEntityNotFound(_0x4c6b9d,null))[_0x3571('0x1f')](function(_0xad9455){_0x213262[_0x3571('0x6e')]=_0xad9455;_0x213262[_0x3571('0x6f')]=_[_0x3571('0x70')](_0xad9455['Applications'],[_0x3571('0x71')],['asc']);if(_0x213262['account'][_0x3571('0x6d')]){delete _0x213262[_0x3571('0x6e')][_0x3571('0x6d')];}return db[_0x3571('0x72')][_0x3571('0x5f')]();})[_0x3571('0x1f')](function(_0x475db5){if(!_0x475db5){throw new db[(_0x3571('0x73'))][(_0x3571('0x74'))](_0x3571('0x75'));}_0x416c93=_['difference'](_['keys'](_0x475db5),[_0x3571('0x76'),'updatedAt']);_0x4eda8b=_['difference'](_[_0x3571('0x3e')](_0x475db5),[_0x3571('0x76'),_0x3571('0x77'),_0x3571('0x78'),'ListId']);_0x213262[_0x3571('0x57')]={'mapKey':_0x3571('0x79')};if(_0x213262[_0x3571('0x6e')]['type']){switch(_0x213262['account'][_0x3571('0x49')]){case _0x3571('0x7a'):_0x213262[_0x3571('0x57')][_0x3571('0x7b')]=_0x58571d[_0x3571('0x57')][_0x3571('0x7c')];_0x213262[_0x3571('0x57')]['body']=_0x58571d[_0x3571('0x57')]['Body'];_0x213262[_0x3571('0x57')][_0x3571('0x7d')]=_0x58571d[_0x3571('0x57')][_0x3571('0x7e')];break;case _0x3571('0x7f'):_0x213262[_0x3571('0x57')][_0x3571('0x7b')]='+'+_0x58571d[_0x3571('0x57')][_0x3571('0x80')];_0x213262[_0x3571('0x57')][_0x3571('0x57')]=_0x58571d[_0x3571('0x57')]['text'];break;case _0x3571('0x81'):_0x213262['body'][_0x3571('0x7b')]=_0x58571d[_0x3571('0x57')][_0x3571('0x7b')];_0x213262[_0x3571('0x57')]['body']=_0x58571d[_0x3571('0x57')][_0x3571('0x26')];break;case _0x3571('0x82'):_0x213262[_0x3571('0x57')]['from']=_0x58571d[_0x3571('0x57')][_0x3571('0x7b')];_0x213262[_0x3571('0x57')][_0x3571('0x57')]=_0x58571d[_0x3571('0x57')]['body'];_0x213262[_0x3571('0x57')][_0x3571('0x7d')]=_0x58571d['body'][_0x3571('0x83')];break;case _0x3571('0x84'):_0x213262[_0x3571('0x57')][_0x3571('0x7b')]=_0x58571d[_0x3571('0x57')][_0x3571('0x7c')];_0x213262[_0x3571('0x57')][_0x3571('0x57')]=_0x58571d[_0x3571('0x57')]['Text'];_0x213262[_0x3571('0x57')][_0x3571('0x7d')]=_0x58571d[_0x3571('0x57')][_0x3571('0x85')];break;case _0x3571('0x86'):_0x213262[_0x3571('0x57')]['from']='+'+_0x58571d[_0x3571('0x57')][_0x3571('0x87')][0x0][_0x3571('0x7b')];_0x213262[_0x3571('0x57')][_0x3571('0x57')]=_0x58571d[_0x3571('0x57')]['results'][0x0][_0x3571('0x88')];_0x213262[_0x3571('0x57')][_0x3571('0x7d')]=_0x58571d[_0x3571('0x57')][_0x3571('0x87')][0x0][_0x3571('0x7d')];break;case'csc':_0x213262[_0x3571('0x57')]['from']=_0x58571d[_0x3571('0x57')]['originatingAddress'];_0x213262['body'][_0x3571('0x57')]=_0x58571d[_0x3571('0x57')][_0x3571('0x89')][_0x3571('0x26')];break;case _0x3571('0x8a'):_0x213262[_0x3571('0x57')]['from']=_0x58571d[_0x3571('0x57')]['fromNumber'];_0x213262['body'][_0x3571('0x57')]=_0x58571d[_0x3571('0x57')][_0x3571('0x88')];_0x213262[_0x3571('0x57')]['messageId']=_0x58571d[_0x3571('0x57')][_0x3571('0x8b')];break;case _0x3571('0x8c'):_0x213262[_0x3571('0x57')][_0x3571('0x7b')]=_0x58571d[_0x3571('0x57')][_0x3571('0x7b')];_0x213262[_0x3571('0x57')][_0x3571('0x57')]=_0x58571d[_0x3571('0x57')][_0x3571('0x26')];_0x213262['body'][_0x3571('0x7d')]=_0x58571d['body'][_0x3571('0x8d')];break;}}if(_0x213262[_0x3571('0x57')]['id']){delete _0x213262[_0x3571('0x57')]['id'];}if(_[_0x3571('0x8e')](_0x213262[_0x3571('0x57')][_0x3571('0x7b')])){throw new db[(_0x3571('0x73'))][(_0x3571('0x74'))](_0x3571('0x8f'));}if(_[_0x3571('0x8e')](_0x213262[_0x3571('0x57')][_0x3571('0x57')])||_0x213262[_0x3571('0x57')][_0x3571('0x57')]===''){throw new db['Sequelize'][(_0x3571('0x74'))](_0x3571('0x90'));}if(_[_0x3571('0x8e')](_0x213262[_0x3571('0x57')][_0x3571('0x91')])){throw new db['Sequelize'][(_0x3571('0x74'))](_0x3571('0x92')+_0x4eda8b);}if(!_[_0x3571('0x93')](_0x4eda8b,_0x213262[_0x3571('0x57')][_0x3571('0x91')])){throw new db[(_0x3571('0x73'))]['ValidationError'](_0x3571('0x94')+_0x4eda8b);}_0x267f24[_0x213262[_0x3571('0x57')][_0x3571('0x91')]]=_0x213262[_0x3571('0x57')][_0x3571('0x7b')];return db['CmList'][_0x3571('0x55')]({'where':{'id':_0x213262['account'][_0x3571('0x95')]},'include':[{'model':db[_0x3571('0x72')],'as':_0x3571('0x96'),'where':_0x267f24,'limit':0x1,'order':[['updatedAt',_0x3571('0x97')]]}]});})[_0x3571('0x1f')](handleEntityNotFound(_0x4c6b9d,null))[_0x3571('0x1f')](function(_0x204f93){if(_0x204f93){_0x213262[_0x3571('0x98')]=_['omit'](_0x204f93,[_0x3571('0x96')]);if(_0x204f93[_0x3571('0x96')]['length']){return _0x204f93[_0x3571('0x96')][0x0];}var _0x4926b6=_[_0x3571('0x15')](_0x213262[_0x3571('0x57')],{'firstName':_0x213262[_0x3571('0x57')][_0x3571('0x7b')],'ListId':_0x204f93['id']});_0x4926b6[_0x213262[_0x3571('0x57')][_0x3571('0x91')]]=_0x213262[_0x3571('0x57')]['from'];return db[_0x3571('0x72')][_0x3571('0x56')](_0x4926b6,{'fields':_0x416c93,'raw':!![]});}})['then'](handleEntityNotFound(_0x4c6b9d,null))[_0x3571('0x1f')](function(_0x23d95f){if(_0x23d95f){_0x213262[_0x3571('0x99')]=_0x23d95f;var _0x5504bf={'ContactId':_0x23d95f['id'],'phone':_0x213262[_0x3571('0x57')]['from'],'SmsAccountId':_0x58571d[_0x3571('0x52')]['id']};var _0x41fb03={'ContactId':_0x23d95f['id'],'SmsAccountId':_0x58571d[_0x3571('0x52')]['id'],'closed':![]};return db[_0x3571('0x9a')]['find']({'where':_0x41fb03})[_0x3571('0x1f')](function(_0x4190f4){if(_0x4190f4){return[_0x4190f4,![]];}return db[_0x3571('0x9a')][_0x3571('0x56')](_0x5504bf)[_0x3571('0x1f')](function(_0x1c00cb){return[_0x1c00cb,!![]];});});}})[_0x3571('0x9b')](function(_0x44a7c6,_0x113a33){_0x213262[_0x3571('0x9c')]=_0x44a7c6['get']({'plain':!![]});_0x213262[_0x3571('0x9c')][_0x3571('0x9d')]=![];if(_0x113a33){if(_0x213262[_0x3571('0x6e')]['autoclose']){_0x213262[_0x3571('0x6f')][_0x3571('0x9e')]({'id':0x0,'priority':_0x213262[_0x3571('0x6f')][_0x3571('0x42')]+0x1,'app':_0x3571('0x9f'),'appdata':'unmanaged','interval':'*,*,*,*'});}_0x213262[_0x3571('0x9c')]['created']=!![];}return db[_0x3571('0xa0')]['create']({'phone':_0x213262[_0x3571('0x57')]['from'],'messageId':_0x213262[_0x3571('0x57')][_0x3571('0x7d')],'body':_0x213262[_0x3571('0x57')][_0x3571('0x57')],'SmsAccountId':_0x58571d[_0x3571('0x52')]['id'],'SmsInteractionId':_0x44a7c6['id'],'direction':'in','ContactId':_0x44a7c6['ContactId'],'AttachmentId':_0x213262[_0x3571('0x57')][_0x3571('0xa1')]});})['then'](function(_0x84fa4f){_0x213262[_0x3571('0x26')]=_0x84fa4f;if(_0x213262[_0x3571('0x9c')]['UserId']){return db[_0x3571('0xa2')][_0x3571('0x55')]({'attributes':['id',_0x3571('0x35')],'where':{'id':_0x213262[_0x3571('0x9c')][_0x3571('0xa3')]}})[_0x3571('0x1f')](function(_0x257d78){if(_0x257d78){_0x213262['applications'][_0x3571('0xa4')]({'id':0x0,'priority':0x0,'app':'agent','appdata':_0x257d78[_0x3571('0x35')]+','+(_0x213262[_0x3571('0x6e')][_0x3571('0xa5')]||0xa),'interval':'*,*,*,*'});}return respondWithRpcPromise(_0x3571('0xa6'),_0x3571('0xa7'),_0x213262);});}return respondWithRpcPromise(_0x3571('0xa6'),_0x3571('0xa7'),_0x213262);})[_0x3571('0x1f')](function(_0x359ff7){if(_0x359ff7){var _0x4cd6b2=0xc8;var _0x220f94=_0x3571('0xa8');logger['info'](_0x3571('0x22'),_0x220f94,_0x4cd6b2,_0x3571('0xa9'));logger[_0x3571('0xaa')](_0x3571('0xab'),_0x220f94,_0x4cd6b2,_0x3571('0xa9'),JSON[_0x3571('0xac')](_0x359ff7));if(_0x213262[_0x3571('0x6e')][_0x3571('0x49')]===_0x3571('0x7a')){return _0x4c6b9d['status'](_0x4cd6b2)[_0x3571('0x2d')](_0x3571('0xad'),_0x3571('0xae'))[_0x3571('0x36')](_0x3571('0xaf'));}else{return _0x4c6b9d[_0x3571('0x29')](_0x4cd6b2)[_0x3571('0x2f')](_0x359ff7);}}})[_0x3571('0x27')](handleError(_0x4c6b9d,null));};exports[_0x3571('0xb0')]=function(_0x55f682,_0x351bce,_0x58e8ea){return db[_0x3571('0x3a')][_0x3571('0x64')]({'where':{'id':_0x55f682['params']['id']}})['then'](handleEntityNotFound(_0x351bce,null))[_0x3571('0x1f')](function(_0x96577f){if(_0x96577f){return db['sequelize']['transaction'](function(_0x3b6c65){return db[_0x3571('0x6c')][_0x3571('0x33')]({'where':{'SmsAccountId':_0x55f682[_0x3571('0x52')]['id']},'transaction':_0x3b6c65})['then'](function(_0xf28095){var _0x540e11=_[_0x3571('0x39')](_0x55f682[_0x3571('0x57')],function(_0x573e1a){_0x573e1a[_0x3571('0x61')]=_0x55f682[_0x3571('0x52')]['id'];return _0x573e1a;});return db[_0x3571('0x6c')]['bulkCreate'](_0x540e11,{'transaction':_0x3b6c65});});})['then'](function(){return db['SmsApplication'][_0x3571('0xb1')]({'where':{'SmsAccountId':_0x55f682[_0x3571('0x52')]['id']},'order':'priority'});});}})[_0x3571('0x1f')](respondWithResult(_0x351bce,null))[_0x3571('0x27')](handleError(_0x351bce,null));};exports[_0x3571('0xb2')]=function(_0x359f1a,_0x4fdefe,_0x45fc8f){var _0x5524d3={};var _0x101ac2={};var _0x577b30;var _0x5eed33;return db[_0x3571('0x3a')]['findOne']({'where':{'id':_0x359f1a[_0x3571('0x52')]['id']}})[_0x3571('0x1f')](handleEntityNotFound(_0x4fdefe,null))[_0x3571('0x1f')](function(_0x354eb1){if(_0x354eb1){_0x577b30=_0x354eb1;_0x101ac2[_0x3571('0x3c')]=_['keys'](db[_0x3571('0x6c')][_0x3571('0x53')]);_0x101ac2[_0x3571('0x3d')]=_[_0x3571('0x3e')](_0x359f1a[_0x3571('0x3d')]);_0x101ac2[_0x3571('0x46')]=_[_0x3571('0x3f')](_0x101ac2[_0x3571('0x3c')],_0x101ac2[_0x3571('0x3d')]);_0x5524d3[_0x3571('0x41')]=_[_0x3571('0x3f')](_0x101ac2[_0x3571('0x3c')],qs[_0x3571('0x40')](_0x359f1a[_0x3571('0x3d')][_0x3571('0x40')]));_0x5524d3['attributes']=_0x5524d3[_0x3571('0x41')][_0x3571('0x42')]?_0x5524d3[_0x3571('0x41')]:_0x101ac2['model'];_0x5524d3['order']=qs['sort'](_0x359f1a['query'][_0x3571('0x44')]);_0x5524d3['where']=qs['filters'](_[_0x3571('0x47')](_0x359f1a['query'],_0x101ac2[_0x3571('0x46')]));if(_0x359f1a['query'][_0x3571('0x48')]){_0x5524d3['where']=_[_0x3571('0x4b')](_0x5524d3['where'],{'$or':_[_0x3571('0x39')](_0x5524d3['attributes'],function(_0x2958ae){var _0x42177e={};_0x42177e[_0x2958ae]={'$like':'%'+_0x359f1a[_0x3571('0x3d')]['filter']+'%'};return _0x42177e;})});}_0x5524d3=_[_0x3571('0x4b')]({},_0x5524d3,_0x359f1a[_0x3571('0x4c')]);return _0x577b30[_0x3571('0xb2')](_0x5524d3);}})['then'](function(_0x2c2cd3){if(_0x2c2cd3){_0x5eed33=_0x2c2cd3[_0x3571('0x42')];if(!_0x359f1a[_0x3571('0x3d')][_0x3571('0x43')](_0x3571('0x65'))){_0x5524d3['limit']=qs['limit'](_0x359f1a[_0x3571('0x3d')]['limit']);_0x5524d3[_0x3571('0x2b')]=qs['offset'](_0x359f1a[_0x3571('0x3d')][_0x3571('0x2b')]);}return _0x577b30['getApplications'](_0x5524d3);}})[_0x3571('0x1f')](function(_0x426568){if(_0x426568){return _0x426568?{'count':_0x5eed33,'rows':_0x426568}:null;}})[_0x3571('0x1f')](respondWithResult(_0x4fdefe,null))[_0x3571('0x27')](handleError(_0x4fdefe,null));};exports[_0x3571('0xb3')]=function(_0x42a57a,_0x3a9a61,_0x255b75){var _0x54d897={'raw':![],'where':{}};var _0x20a62c={};var _0x258137={'count':0x0,'rows':[]};return db[_0x3571('0x3a')][_0x3571('0x64')]({'where':{'id':_0x42a57a[_0x3571('0x52')]['id']}})['then'](handleEntityNotFound(_0x3a9a61,null))['then'](function(_0x2233a1){if(_0x2233a1){_0x20a62c[_0x3571('0x3c')]=_[_0x3571('0x3e')](db['SmsInteraction'][_0x3571('0x53')]);_0x20a62c[_0x3571('0x3d')]=_[_0x3571('0x3e')](_0x42a57a['query']);_0x20a62c[_0x3571('0x46')]=_[_0x3571('0x3f')](_0x20a62c[_0x3571('0x3c')],_0x20a62c[_0x3571('0x3d')]);_0x54d897[_0x3571('0x41')]=_[_0x3571('0x3f')](_0x20a62c[_0x3571('0x3c')],qs[_0x3571('0x40')](_0x42a57a[_0x3571('0x3d')][_0x3571('0x40')]));_0x54d897['attributes']=_0x54d897[_0x3571('0x41')][_0x3571('0x42')]?_0x54d897[_0x3571('0x41')]:_0x20a62c[_0x3571('0x3c')];if(!_0x42a57a[_0x3571('0x3d')][_0x3571('0x43')](_0x3571('0x65'))){_0x54d897[_0x3571('0x2c')]=qs[_0x3571('0x2c')](_0x42a57a['query'][_0x3571('0x2c')]);_0x54d897['offset']=qs[_0x3571('0x2b')](_0x42a57a[_0x3571('0x3d')][_0x3571('0x2b')]);}_0x54d897['order']=qs[_0x3571('0x44')](_0x42a57a[_0x3571('0x3d')][_0x3571('0x44')]);_0x54d897[_0x3571('0x45')]=qs['filters'](_[_0x3571('0x47')](_0x42a57a[_0x3571('0x3d')],_0x20a62c['filters']));_0x54d897[_0x3571('0x45')][_0x3571('0x61')]=_0x2233a1['id'];if(_0x42a57a['query'][_0x3571('0x48')]){_0x54d897[_0x3571('0x45')]=_[_0x3571('0x4b')](_0x54d897[_0x3571('0x45')],{'$or':_['map'](_0x54d897[_0x3571('0x41')],function(_0x5f5607){var _0x3f251d={};_0x3f251d[_0x5f5607]={'$like':'%'+_0x42a57a['query'][_0x3571('0x48')]+'%'};return _0x3f251d;})});}_0x54d897=_[_0x3571('0x4b')]({},_0x54d897,_0x42a57a['options']);return db[_0x3571('0x9a')][_0x3571('0x4d')]({'where':_0x54d897[_0x3571('0x45')]})[_0x3571('0x1f')](function(_0x588f8a){_0x258137[_0x3571('0x4d')]=_0x588f8a;if(_0x42a57a[_0x3571('0x3d')][_0x3571('0x4e')]){_0x54d897['include']=[{'model':db[_0x3571('0x72')],'as':_0x3571('0xb4'),'required':![]},{'model':db['User'],'as':_0x3571('0xb5'),'attributes':[_0x3571('0x35'),_0x3571('0xb6'),_0x3571('0xb7')],'required':![]},{'model':db[_0x3571('0xb8')],'as':_0x3571('0xb9'),'attributes':['id','name',_0x3571('0xba')],'where':_0x42a57a[_0x3571('0x3d')][_0x3571('0xbb')]?{'id':_0x42a57a[_0x3571('0x3d')][_0x3571('0xbb')]}:undefined,'required':_0x42a57a[_0x3571('0x3d')][_0x3571('0xbb')]?!![]:![]}];}return db[_0x3571('0x9a')][_0x3571('0x4f')](_0x54d897);})['then'](function(_0x53766b){_0x258137[_0x3571('0x50')]=_0x53766b;return _0x258137;});}})[_0x3571('0x1f')](respondWithFilteredResult(_0x3a9a61,_0x54d897))[_0x3571('0x27')](handleError(_0x3a9a61,null));};exports[_0x3571('0x36')]=function(_0x587943,_0x548031,_0x34f5da){var _0x5d2a90,_0x4f3c8b,_0x25bc67;if(_['isNil'](_0x587943[_0x3571('0x57')][_0x3571('0x57')])||_0x587943[_0x3571('0x57')][_0x3571('0x57')]===''){throw new db[(_0x3571('0x73'))][(_0x3571('0x74'))]('body\x20is\x20mandatory\x20and\x20not\x20empty');}if(_[_0x3571('0x8e')](_0x587943['body']['to'])){throw new db[(_0x3571('0x73'))]['ValidationError']('to\x20is\x20mandatory');}_0x5d2a90=_0x587943[_0x3571('0x57')]['to'];return db['SmsAccount'][_0x3571('0x55')]({'where':{'id':_0x587943['params']['id']},'include':[{'model':db['CmList'],'as':'List','include':[{'model':db['CmContact'],'as':'Contacts','where':{'mobile':_0x5d2a90},'limit':0x1,'order':[[_0x3571('0x77'),_0x3571('0x97')]]}]}]})['then'](handleEntityNotFound(_0x548031,null))['then'](function(_0x424155){if(_0x424155&&_0x424155[_0x3571('0xbc')]){_0x4f3c8b=_0x424155[_0x3571('0x59')]({'plain':!![]});if(_0x4f3c8b[_0x3571('0xbc')]&&_0x4f3c8b[_0x3571('0xbc')][_0x3571('0x96')]['length']){return _0x4f3c8b[_0x3571('0xbc')]['Contacts'][0x0];}return db[_0x3571('0x72')][_0x3571('0x56')](_['defaults'](_0x587943[_0x3571('0x57')],{'firstName':_0x5d2a90,'mobile':_0x5d2a90,'phone':_0x5d2a90,'ListId':_0x4f3c8b[_0x3571('0x95')]}));}})[_0x3571('0x1f')](handleEntityNotFound(_0x548031,null))[_0x3571('0x1f')](function(_0x1df965){if(_0x1df965){_0x25bc67=_0x1df965;return db[_0x3571('0x9a')][_0x3571('0x55')]({'where':{'ContactId':_0x25bc67['id'],'closed':![],'SmsAccountId':_0x4f3c8b['id']}})[_0x3571('0x1f')](function(_0x4fc53c){if(_0x4fc53c){return[_0x4fc53c,![]];}return db[_0x3571('0x9a')][_0x3571('0x56')]({'UserId':_0x587943[_0x3571('0x58')]['id'],'ContactId':_0x25bc67['id'],'SmsAccountId':_0x4f3c8b['id'],'phone':_0x5d2a90,'firstMsgDirection':_0x3571('0xbd'),'Messages':[_[_0x3571('0x4b')](_0x587943['body'],{'read':![],'body':_0x587943[_0x3571('0x57')][_0x3571('0x57')],'phone':_0x5d2a90,'SmsAccountId':_0x4f3c8b['id'],'UserId':_0x587943[_0x3571('0x58')]['id'],'ContactId':_0x25bc67['id']})]},{'include':[{'model':db[_0x3571('0xa0')],'as':_0x3571('0xbe')}]})[_0x3571('0x1f')](function(_0x346b4f){return[_0x346b4f,!![]];});});}})[_0x3571('0x9b')](function(_0x14708b,_0x252674){if(_0x252674){return _0x14708b;}return db[_0x3571('0xa0')][_0x3571('0x56')](_[_0x3571('0x4b')](_0x587943[_0x3571('0x57')],{'read':![],'body':_0x587943[_0x3571('0x57')][_0x3571('0x57')],'phone':_0x5d2a90,'SmsAccountId':_0x4f3c8b['id'],'SmsInteractionId':_0x14708b['id'],'UserId':_0x587943[_0x3571('0x58')]['id'],'ContactId':_0x25bc67['id']}))[_0x3571('0x1f')](function(_0x5dabb8){_0x14708b['dataValues'][_0x3571('0xbe')]=[];_0x14708b[_0x3571('0xbf')]['Messages'][_0x3571('0x9e')](_0x5dabb8[_0x3571('0xbf')]);return _0x14708b;});})[_0x3571('0x1f')](respondWithResult(_0x548031,null))[_0x3571('0x27')](handleError(_0x548031,null));};exports['status']=function(_0x52de50,_0x28f6a7,_0x21d621){if(_0x52de50[_0x3571('0x57')]['id']){delete _0x52de50[_0x3571('0x57')]['id'];}console[_0x3571('0xc0')](_0x3571('0xc1'),_0x52de50[_0x3571('0x57')]);var _0x523ac7,_0x16a382,_0x2c9cc4;return db[_0x3571('0x3a')]['find']({'where':{'id':_0x52de50['params']['id']}})['then'](handleEntityNotFound(_0x28f6a7,null))['then'](function(_0x265b01){if(_0x265b01){_0x2c9cc4=_0x265b01;logger[_0x3571('0xaa')](_0x3571('0x22'),_0x3571('0x29'),_0x3571('0xc2'),_0x265b01[_0x3571('0x49')],util[_0x3571('0xc3')](_0x52de50[_0x3571('0x57')],{'showHidden':![],'depth':null}));switch(_0x265b01[_0x3571('0x49')]){case _0x3571('0x7f'):if(_0x52de50['body'][_0x3571('0xc4')]&&_0x52de50[_0x3571('0x57')][_0x3571('0x29')]){_0x16a382=_0x52de50['body'][_0x3571('0x29')];return db[_0x3571('0xa0')][_0x3571('0x55')]({'where':{'messageId':_0x52de50[_0x3571('0x57')]['skebby_dispatch_id']}});}break;case _0x3571('0x81'):if(_0x52de50[_0x3571('0x57')][_0x3571('0xc5')]&&_0x52de50[_0x3571('0x57')][_0x3571('0xc6')]){_0x16a382=_0x52de50[_0x3571('0x57')]['statusInt'];return db['SmsMessage']['find']({'where':{'messageId':_0x52de50['body'][_0x3571('0xc5')]}});}break;case _0x3571('0x82'):if(_0x52de50[_0x3571('0x57')][_0x3571('0x83')]&&_0x52de50[_0x3571('0x57')][_0x3571('0xc7')]){_0x16a382=_0x52de50[_0x3571('0x57')][_0x3571('0xc7')];return db[_0x3571('0xa0')][_0x3571('0x55')]({'where':{'messageId':_0x52de50[_0x3571('0x57')][_0x3571('0x83')]}});}break;case'infobip':var _0x15fa12=_0x52de50[_0x3571('0x57')]['results'][0x0];if(_0x15fa12[_0x3571('0x7d')]&&_0x15fa12['status'][_0x3571('0xc8')]===_0x3571('0xc9')){_0x16a382=_0x15fa12['status'][_0x3571('0xc8')];return db[_0x3571('0xa0')][_0x3571('0x55')]({'where':{'messageId':_0x15fa12[_0x3571('0x7d')]}});}break;case _0x3571('0x8a'):if(_0x52de50['body'][_0x3571('0x7d')]&&_0x52de50[_0x3571('0x57')][_0x3571('0x29')]){_0x16a382=_0x52de50[_0x3571('0x57')]['status'];return db['SmsMessage'][_0x3571('0x55')]({'where':{'messageId':_0x52de50[_0x3571('0x57')][_0x3571('0x7d')]}});}break;case _0x3571('0x8c'):if(_0x52de50['body'][_0x3571('0xca')]&&_0x52de50[_0x3571('0x57')][_0x3571('0x29')]){_0x16a382=_0x52de50[_0x3571('0x57')]['status'];return db[_0x3571('0xa0')]['find']({'where':{'messageId':_0x52de50[_0x3571('0x57')][_0x3571('0xca')]}});}break;}}})[_0x3571('0x1f')](handleEntityNotFound(_0x28f6a7,null))[_0x3571('0x1f')](function(_0x553355){if(_0x553355){_0x523ac7=_0x553355;switch(_0x2c9cc4[_0x3571('0x49')]){case'skebby':if(_0x16a382===_0x3571('0xc9')){return _0x523ac7[_0x3571('0xcb')]({'read':!![]});}else{logger[_0x3571('0x24')]('SmsAccount,\x20%s,\x20%s,\x20%s','status',_0x3571('0x7f'),util['inspect'](_0x52de50[_0x3571('0x57')],{'showHidden':![],'depth':null}));}break;case _0x3571('0x81'):if(_0x16a382==='1'){return _0x523ac7['update']({'read':!![]});}else{logger['error'](_0x3571('0x22'),_0x3571('0x29'),_0x3571('0x7f'),util['inspect'](_0x52de50[_0x3571('0x57')],{'showHidden':![],'depth':null}));}break;case _0x3571('0x82'):if(!_0x52de50[_0x3571('0x57')]['error_code']&&_0x16a382>=0xc8&&_0x16a382<=0xce){return _0x523ac7['update']({'read':!![]});}else{logger[_0x3571('0x24')](_0x3571('0x22'),_0x3571('0x29'),_0x3571('0x82'),util[_0x3571('0xc3')](_0x52de50[_0x3571('0x57')],{'showHidden':![],'depth':null}));}break;case _0x3571('0x86'):var _0x209033=_0x52de50['body'][_0x3571('0x87')][0x0];if(_0x209033[_0x3571('0x29')]['groupName']==='DELIVERED'){return _0x523ac7[_0x3571('0xcb')]({'read':!![]});}else{logger['error'](_0x3571('0x22'),_0x3571('0x29'),_0x3571('0x86'),util[_0x3571('0xc3')](_0x52de50['body'],{'showHidden':![],'depth':null}));}break;case'clickatell':if(_0x16a382==_0x3571('0xcc')||_0x16a382==_0x3571('0xcd')){return _0x523ac7[_0x3571('0xcb')]({'read':!![]});}else{logger[_0x3571('0x24')](_0x3571('0x22'),_0x3571('0x29'),_0x3571('0x8a'),util[_0x3571('0xc3')](_0x52de50[_0x3571('0x57')],{'showHidden':![],'depth':null}));}break;case _0x3571('0x8c'):if(_0x16a382===_0x3571('0xce')||_0x16a382===_0x3571('0xcf')){return _0x523ac7[_0x3571('0xcb')]({'read':!![]});}else{logger[_0x3571('0x24')](_0x3571('0x22'),'status',_0x3571('0x8c'),util[_0x3571('0xc3')](_0x52de50['body'],{'showHidden':![],'depth':null}));}break;}return _0x523ac7;}})[_0x3571('0x1f')](respondWithResult(_0x28f6a7,null))[_0x3571('0x27')](handleError(_0x28f6a7,null));};exports['statusGet']=function(_0x23fcd0,_0x4d80bc,_0x5760d3){var _0x1e2636,_0x3e3d82,_0x570212;return db[_0x3571('0x3a')]['find']({'where':{'id':_0x23fcd0[_0x3571('0x52')]['id']}})['then'](handleEntityNotFound(_0x4d80bc,null))['then'](function(_0x740926){if(_0x740926){_0x570212=_0x740926;logger[_0x3571('0xaa')](_0x3571('0x22'),'status',_0x3571('0xc2'),_0x740926[_0x3571('0x49')],util[_0x3571('0xc3')](_0x23fcd0['query'],{'showHidden':![],'depth':null}));switch(_0x740926[_0x3571('0x49')]){case _0x3571('0xd0'):if(_0x23fcd0[_0x3571('0x3d')]['message-id']&&_0x23fcd0[_0x3571('0x3d')][_0x3571('0xd1')]){_0x3e3d82=_0x23fcd0[_0x3571('0x3d')][_0x3571('0xd1')];return db[_0x3571('0xa0')][_0x3571('0x55')]({'where':{'messageId':_0x23fcd0[_0x3571('0x3d')][_0x3571('0xd2')]}});}break;}}})['then'](handleEntityNotFound(_0x4d80bc,null))[_0x3571('0x1f')](function(_0x39c51e){if(_0x39c51e){_0x1e2636=_0x39c51e;switch(_0x570212[_0x3571('0x49')]){case _0x3571('0xd0'):if(_0x3e3d82==='2'||_0x3e3d82==='6'){return _0x1e2636[_0x3571('0xcb')]({'read':!![]});}else{logger[_0x3571('0x24')]('SmsAccount,\x20%s,\x20%s,\x20%s',_0x3571('0x29'),'csc',util[_0x3571('0xc3')](_0x23fcd0['query'],{'showHidden':![],'depth':null}));};break;}return _0x1e2636;}})['then'](respondWithResult(_0x4d80bc,null))[_0x3571('0x27')](handleError(_0x4d80bc,null));};exports[_0x3571('0xd3')]=function(_0x3b9312,_0x413f3d,_0x4910d8){return db[_0x3571('0x3a')][_0x3571('0x55')]({'where':{'id':_0x3b9312[_0x3571('0x52')]['id']}})[_0x3571('0x1f')](handleEntityNotFound(_0x413f3d,null))[_0x3571('0x1f')](function(_0x3b76f9){if(_0x3b76f9){return _0x3b76f9[_0x3571('0xd3')](_0x3b9312[_0x3571('0x57')]['ids'],_['omit'](_0x3b9312[_0x3571('0x57')],[_0x3571('0x68'),'id'])||{})['spread'](function(_0x9695e7){for(var _0x463e62=0x0;_0x463e62<_0x3b9312[_0x3571('0x57')]['ids'][_0x3571('0x42')];_0x463e62+=0x1){socket[_0x3571('0xd4')](_0x3571('0xd5'),{'UserId':_0x3b9312[_0x3571('0x57')][_0x3571('0x68')][_0x463e62],'SmsAccountId':_0x3b9312[_0x3571('0x52')]['id']});}return _0x9695e7;});}})[_0x3571('0x1f')](respondWithResult(_0x413f3d,null))[_0x3571('0x27')](handleError(_0x413f3d,null));};exports[_0x3571('0xd6')]=function(_0x3a4115,_0x172b61,_0x15f43f){return db[_0x3571('0x3a')][_0x3571('0x55')]({'where':{'id':_0x3a4115[_0x3571('0x52')]['id']}})['then'](handleEntityNotFound(_0x172b61,null))[_0x3571('0x1f')](function(_0x11bb9d){if(_0x11bb9d){return _0x11bb9d[_0x3571('0xd6')](_0x3a4115['query'][_0x3571('0x68')])[_0x3571('0x1f')](function(){if(_[_0x3571('0xd7')](_0x3a4115[_0x3571('0x3d')][_0x3571('0x68')])){for(var _0x509551=0x0;_0x509551<_0x3a4115['query'][_0x3571('0x68')][_0x3571('0x42')];_0x509551+=0x1){socket[_0x3571('0xd4')](_0x3571('0xd8'),{'UserId':Number(_0x3a4115[_0x3571('0x3d')][_0x3571('0x68')][_0x509551]),'SmsAccountId':Number(_0x3a4115[_0x3571('0x52')]['id'])});}}else{socket['emit'](_0x3571('0xd8'),{'UserId':Number(_0x3a4115[_0x3571('0x3d')][_0x3571('0x68')]),'SmsAccountId':Number(_0x3a4115[_0x3571('0x52')]['id'])});}});}})['then'](respondWithStatusCode(_0x172b61,null))['catch'](handleError(_0x172b61,null));};exports[_0x3571('0xd9')]=function(_0x10c057,_0x340a1f,_0xd45072){var _0xc3464c={};var _0x491ace={};var _0x27dd2f;var _0x5abb2d;return db[_0x3571('0x3a')][_0x3571('0x64')]({'where':{'id':_0x10c057['params']['id']}})[_0x3571('0x1f')](handleEntityNotFound(_0x340a1f,null))[_0x3571('0x1f')](function(_0x1fa89e){if(_0x1fa89e){_0x27dd2f=_0x1fa89e;_0x491ace['model']=_[_0x3571('0x3e')](db['User']['rawAttributes']);_0x491ace[_0x3571('0x3d')]=_['keys'](_0x10c057[_0x3571('0x3d')]);_0x491ace['filters']=_[_0x3571('0x3f')](_0x491ace[_0x3571('0x3c')],_0x491ace[_0x3571('0x3d')]);_0xc3464c[_0x3571('0x41')]=_[_0x3571('0x3f')](_0x491ace[_0x3571('0x3c')],qs[_0x3571('0x40')](_0x10c057[_0x3571('0x3d')][_0x3571('0x40')]));_0xc3464c[_0x3571('0x41')]=_0xc3464c[_0x3571('0x41')][_0x3571('0x42')]?_0xc3464c[_0x3571('0x41')]:_0x491ace['model'];_0xc3464c[_0x3571('0x66')]=qs[_0x3571('0x44')](_0x10c057[_0x3571('0x3d')]['sort']);_0xc3464c[_0x3571('0x45')]=qs[_0x3571('0x46')](_[_0x3571('0x47')](_0x10c057['query'],_0x491ace[_0x3571('0x46')]));if(_0x10c057[_0x3571('0x3d')][_0x3571('0x48')]){_0xc3464c[_0x3571('0x45')]=_['merge'](_0xc3464c[_0x3571('0x45')],{'$or':_[_0x3571('0x39')](_0xc3464c['attributes'],function(_0x3c19bb){var _0x2c9e2e={};_0x2c9e2e[_0x3c19bb]={'$like':'%'+_0x10c057[_0x3571('0x3d')][_0x3571('0x48')]+'%'};return _0x2c9e2e;})});}_0xc3464c=_[_0x3571('0x4b')]({},_0xc3464c,_0x10c057[_0x3571('0x4c')]);return _0x27dd2f[_0x3571('0xd9')](_0xc3464c);}})[_0x3571('0x1f')](function(_0x569f6f){if(_0x569f6f){_0x5abb2d=_0x569f6f[_0x3571('0x42')];if(!_0x10c057[_0x3571('0x3d')][_0x3571('0x43')](_0x3571('0x65'))){_0xc3464c[_0x3571('0x2c')]=qs[_0x3571('0x2c')](_0x10c057[_0x3571('0x3d')][_0x3571('0x2c')]);_0xc3464c[_0x3571('0x2b')]=qs[_0x3571('0x2b')](_0x10c057['query'][_0x3571('0x2b')]);}return _0x27dd2f['getAgents'](_0xc3464c);}})['then'](function(_0x3b103c){if(_0x3b103c){return _0x3b103c?{'count':_0x5abb2d,'rows':_0x3b103c}:null;}})[_0x3571('0x1f')](respondWithResult(_0x340a1f,null))[_0x3571('0x27')](handleError(_0x340a1f,null));};
\ No newline at end of file
+var _0x1280=['UserProfileResource','name','send','index','Pause','mandatoryDispositionPause','map','rawAttributes','fieldName','type','key','model','query','filters','attributes','intersection','fields','length','hasOwnProperty','nolimit','order','sort','where','pick','merge','VIRTUAL','filter','count','include','findAll','rows','catch','params','keys','SmsAccount','includeAll','options','create','body','user','get','Unable\x20to\x20retrieve\x20the\x20current\x20user','role','UserProfileSection','find','autoAssociation','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','describe','addDisposition','SmsAccountId','Disposition','findOne','removeDispositions','ids','addAnswer','getAnswers','CannedAnswer','removeAnswers','notify','Applications','account','applications','orderBy','priority','CmContact','no\x20available\x20attributes','difference','createdAt','updatedAt','CompanyId','ListId','mobile','twilio','from','From','Body','messageId','MessageSid','skebby','sender','text','message_id','plivo','Text','infobip','results','csc','originatingAddress','clickatell','fromNumber','replyMessageId','intelepeer','isNil','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','DESC','list','omit','Contacts','defaults','contact','SmsInteraction','spread','interaction','created','autoclose','push','close','unmanaged','SmsMessage','ContactId','AttachmentId','User','unshift','agent','waitForTheAssignedAgent','*,*,*,*','Start','startRouting','entity\x20found','debug','SmsAccount,\x20%s,\x20%s,\x20%s,\x20%s','set','text/xml','\x0a ','addApplications','sequelize','transaction','SmsApplication','bulkCreate','getApplications','getInteractions','Contact','Owner','fullname','Tag','Tags','color','tag','List','out','Messages','dataValues','log','endpoint\x20/status\x20POST\x20/','received\x20delivery\x20report\x20from','connectel','requestid','statusInt','clicksend','status_code','groupName','DELIVERED','redif','inspect','error_code','DELIVERED_TO_GATEWAY','RECEIVED_BY_RECIPIENT','DELIVRD','ACCEPTD','statusGet','message-id','state','addAgents','emit','userSmsAccount:save','removeAgents','isArray','getAgents','html-pdf','rimraf','zip-dir','fast-json-patch','request-promise','moment','bluebird','util','path','sox','to-csv','squel','crypto','jsforce','desk.js','querystring','papaparse','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','api','../../config/utils','../../config/environment','redis','socket.io-emitter','./smsAccount.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','SmsAccount,\x20%s,\x20%s','SmsAccount,\x20%s,\x20%s,\x20%s','request\x20sent','stringify','error','code','result','message','sendStatus','status','end','offset','limit','Content-Range','json','apply','reject','update','destroy','SmsAccounts'];(function(_0x2f7104,_0x5ecc2e){var _0x282e73=function(_0x22b3ec){while(--_0x22b3ec){_0x2f7104['push'](_0x2f7104['shift']());}};_0x282e73(++_0x5ecc2e);}(_0x1280,0xac));var _0x0128=function(_0x5e2cb4,_0x592c64){_0x5e2cb4=_0x5e2cb4-0x0;var _0x282902=_0x1280[_0x5e2cb4];return _0x282902;};'use strict';var pdf=require(_0x0128('0x0'));var emlformat=require('eml-format');var rimraf=require(_0x0128('0x1'));var zipdir=require(_0x0128('0x2'));var jsonpatch=require(_0x0128('0x3'));var rp=require(_0x0128('0x4'));var moment=require(_0x0128('0x5'));var BPromise=require(_0x0128('0x6'));var Mustache=require('mustache');var util=require(_0x0128('0x7'));var path=require(_0x0128('0x8'));var sox=require(_0x0128('0x9'));var csv=require(_0x0128('0xa'));var ejs=require('ejs');var fs=require('fs');var _=require('lodash');var squel=require(_0x0128('0xb'));var crypto=require(_0x0128('0xc'));var jsforce=require(_0x0128('0xd'));var deskjs=require(_0x0128('0xe'));var toCsv=require('to-csv');var querystring=require(_0x0128('0xf'));var Papa=require(_0x0128('0x10'));var Redis=require('ioredis');var authService=require(_0x0128('0x11'));var qs=require(_0x0128('0x12'));var as=require(_0x0128('0x13'));var hardwareService=require('../../config/license/hardware');var logger=require('../../config/logger')(_0x0128('0x14'));var utils=require(_0x0128('0x15'));var config=require(_0x0128('0x16'));var db=require('../../mysqldb')['db'];config[_0x0128('0x17')]=_['defaults'](config[_0x0128('0x17')],{'host':'localhost','port':0x18eb});var socket=require(_0x0128('0x18'))(new Redis(config['redis']));require(_0x0128('0x19'))['register'](socket);var jayson=require(_0x0128('0x1a'));var client=jayson[_0x0128('0x1b')][_0x0128('0x1c')]({'port':0x232c});function checkPasswordPattern(_0x5a42eb,_0x2046f8,_0x43f107){if(_0x43f107){var _0x59a472=new RegExp(/(?=.*[a-z])(?=.*[A-Z])(?=.*[0-9])(?=.*[?!@#\$%\^&\*~\-_=+[{\]\}])(?=.{8,})/);if(_0x59a472[_0x0128('0x1d')](_0x2046f8)){return _0x5a42eb;}else{throw new db[(_0x0128('0x1e'))][(_0x0128('0x1f'))](_0x0128('0x20'));}}else{return _0x5a42eb;}}function respondWithRpcPromise(_0x10baa,_0x300554,_0x5bdc3e,_0x2524b1){return new BPromise(function(_0x18a955,_0x1a5818){var _0x431b13=_0x2524b1||client;return _0x431b13[_0x0128('0x21')](_0x10baa,_0x5bdc3e)[_0x0128('0x22')](function(_0x5a8a8f){logger[_0x0128('0x23')](_0x0128('0x24'),_0x300554,'request\x20sent');logger['debug'](_0x0128('0x25'),_0x300554,_0x0128('0x26'),JSON[_0x0128('0x27')](_0x5a8a8f));if(_0x5a8a8f[_0x0128('0x28')]){if(_0x5a8a8f[_0x0128('0x28')][_0x0128('0x29')]===0x1f4){logger[_0x0128('0x28')](_0x0128('0x24'),_0x300554,_0x5a8a8f['error']['message']);return _0x1a5818(_0x5a8a8f[_0x0128('0x28')]['message']);}logger[_0x0128('0x28')](_0x0128('0x24'),_0x300554,_0x5a8a8f[_0x0128('0x28')]['message']);return _0x18a955(_0x5a8a8f[_0x0128('0x28')]['message']);}else{logger[_0x0128('0x23')](_0x0128('0x24'),_0x300554,_0x0128('0x26'));_0x18a955(_0x5a8a8f[_0x0128('0x2a')][_0x0128('0x2b')]);}})['catch'](function(_0x14cd68){logger[_0x0128('0x28')]('SmsAccount,\x20%s,\x20%s',_0x300554,_0x14cd68);_0x1a5818(_0x14cd68);});});}function respondWithStatusCode(_0x2b1819,_0x976553){_0x976553=_0x976553||0xcc;return function(_0x4ee634){if(_0x4ee634){return _0x2b1819[_0x0128('0x2c')](_0x976553);}return _0x2b1819[_0x0128('0x2d')](_0x976553)[_0x0128('0x2e')]();};}function respondWithResult(_0x555b25,_0x5b7ab2){_0x5b7ab2=_0x5b7ab2||0xc8;return function(_0x3340ac){if(_0x3340ac){return _0x555b25['status'](_0x5b7ab2)['json'](_0x3340ac);}};}function respondWithFilteredResult(_0x5f07c7,_0x28b27c){return function(_0x4d32e3){if(_0x4d32e3){var _0x4449b9=_0x4d32e3['count'],_0x2b9f40=_0x28b27c[_0x0128('0x2f')],_0x345023=_0x28b27c[_0x0128('0x2f')]+_0x28b27c[_0x0128('0x30')],_0x41f198;if(_0x345023>=_0x4449b9){_0x345023=_0x4449b9;_0x41f198=0xc8;}else{_0x41f198=0xce;}_0x5f07c7[_0x0128('0x2d')](_0x41f198);return _0x5f07c7['set'](_0x0128('0x31'),_0x2b9f40+'-'+_0x345023+'/'+_0x4449b9)[_0x0128('0x32')](_0x4d32e3);}return null;};}function patchUpdates(_0x32d622){return function(_0x20f35f){try{jsonpatch[_0x0128('0x33')](_0x20f35f,_0x32d622,!![]);}catch(_0x1c4fcf){return BPromise[_0x0128('0x34')](_0x1c4fcf);}return _0x20f35f['save']();};}function saveUpdates(_0x4c2903,_0x47d63d){return function(_0xee41c7){if(_0xee41c7){return _0xee41c7[_0x0128('0x35')](_0x4c2903)[_0x0128('0x22')](function(_0x5f161a){return _0x5f161a;});}return null;};}function removeEntity(_0x105080,_0x5bf52c){return function(_0x2883e3){if(_0x2883e3){return _0x2883e3[_0x0128('0x36')]()[_0x0128('0x22')](function(){var _0x46d5a8=_0x2883e3['get']({'plain':!![]});var _0x5b354e=_0x0128('0x37');return db[_0x0128('0x38')][_0x0128('0x36')]({'where':{'type':_0x5b354e,'resourceId':_0x46d5a8['id']}})[_0x0128('0x22')](function(){return _0x2883e3;});})['then'](function(){_0x105080['status'](0xcc)[_0x0128('0x2e')]();});}};}function handleEntityNotFound(_0x313da8,_0x3898a5){return function(_0xc7a20){if(!_0xc7a20){_0x313da8[_0x0128('0x2c')](0x194);}return _0xc7a20;};}function handleError(_0x478d57,_0xe72ce4){_0xe72ce4=_0xe72ce4||0x1f4;return function(_0x39f32d){logger[_0x0128('0x28')](_0x39f32d['stack']);if(_0x39f32d['name']){delete _0x39f32d[_0x0128('0x39')];}_0x478d57[_0x0128('0x2d')](_0xe72ce4)[_0x0128('0x3a')](_0x39f32d);};}exports[_0x0128('0x3b')]=function(_0x29da11,_0x5b3671){var _0x22e60f={'include':[{'model':db[_0x0128('0x3c')],'as':_0x0128('0x3d')}]},_0x394252={},_0x544664={'count':0x0,'rows':[]};var _0x53484b=_[_0x0128('0x3e')](db['SmsAccount'][_0x0128('0x3f')],function(_0x46a27a){return{'name':_0x46a27a[_0x0128('0x40')],'type':_0x46a27a[_0x0128('0x41')][_0x0128('0x42')]};});_0x394252[_0x0128('0x43')]=_['map'](_0x53484b,'name');_0x394252[_0x0128('0x44')]=_['keys'](_0x29da11['query']);_0x394252[_0x0128('0x45')]=_['intersection'](_0x394252[_0x0128('0x43')],_0x394252[_0x0128('0x44')]);_0x22e60f[_0x0128('0x46')]=_[_0x0128('0x47')](_0x394252[_0x0128('0x43')],qs[_0x0128('0x48')](_0x29da11[_0x0128('0x44')][_0x0128('0x48')]));_0x22e60f[_0x0128('0x46')]=_0x22e60f[_0x0128('0x46')][_0x0128('0x49')]?_0x22e60f[_0x0128('0x46')]:_0x394252[_0x0128('0x43')];if(!_0x29da11['query'][_0x0128('0x4a')](_0x0128('0x4b'))){_0x22e60f['limit']=qs[_0x0128('0x30')](_0x29da11[_0x0128('0x44')][_0x0128('0x30')]);_0x22e60f[_0x0128('0x2f')]=qs[_0x0128('0x2f')](_0x29da11['query'][_0x0128('0x2f')]);}_0x22e60f[_0x0128('0x4c')]=qs[_0x0128('0x4d')](_0x29da11[_0x0128('0x44')][_0x0128('0x4d')]);_0x22e60f[_0x0128('0x4e')]=qs[_0x0128('0x45')](_[_0x0128('0x4f')](_0x29da11[_0x0128('0x44')],_0x394252['filters']));if(_0x29da11[_0x0128('0x44')]['filter']){_0x22e60f[_0x0128('0x4e')]=_[_0x0128('0x50')](_0x22e60f[_0x0128('0x4e')],{'$or':_[_0x0128('0x3e')](_0x53484b,function(_0x39be19){if(_0x39be19[_0x0128('0x41')]!==_0x0128('0x51')){var _0x4789b2={};_0x4789b2[_0x39be19['name']]={'$like':'%'+_0x29da11['query'][_0x0128('0x52')]+'%'};return _0x4789b2;}})});}_0x22e60f=_[_0x0128('0x50')]({},_0x22e60f,_0x29da11['options']);var _0x1b4cf3={'where':_0x22e60f[_0x0128('0x4e')]};return db['SmsAccount'][_0x0128('0x53')](_0x1b4cf3)[_0x0128('0x22')](function(_0x3f1b2f){_0x544664[_0x0128('0x53')]=_0x3f1b2f;if(_0x29da11['query']['includeAll']){_0x22e60f[_0x0128('0x54')]=[{'all':!![]}];}return db['SmsAccount'][_0x0128('0x55')](_0x22e60f);})['then'](function(_0x1338d9){_0x544664[_0x0128('0x56')]=_0x1338d9;return _0x544664;})[_0x0128('0x22')](respondWithFilteredResult(_0x5b3671,_0x22e60f))[_0x0128('0x57')](handleError(_0x5b3671,null));};exports['show']=function(_0x3c1ce4,_0x43cbbb){var _0x31c7d1={'raw':![],'where':{'id':_0x3c1ce4[_0x0128('0x58')]['id']},'include':[{'model':db['Pause'],'as':_0x0128('0x3d')}]},_0x2be4aa={};_0x2be4aa[_0x0128('0x43')]=_[_0x0128('0x59')](db[_0x0128('0x5a')][_0x0128('0x3f')]);_0x2be4aa['query']=_['keys'](_0x3c1ce4[_0x0128('0x44')]);_0x2be4aa['filters']=_[_0x0128('0x47')](_0x2be4aa['model'],_0x2be4aa[_0x0128('0x44')]);_0x31c7d1[_0x0128('0x46')]=_['intersection'](_0x2be4aa['model'],qs[_0x0128('0x48')](_0x3c1ce4[_0x0128('0x44')][_0x0128('0x48')]));_0x31c7d1[_0x0128('0x46')]=_0x31c7d1['attributes'][_0x0128('0x49')]?_0x31c7d1[_0x0128('0x46')]:_0x2be4aa[_0x0128('0x43')];if(_0x3c1ce4[_0x0128('0x44')][_0x0128('0x5b')]){_0x31c7d1['include']=[{'all':!![]}];}_0x31c7d1=_['merge']({},_0x31c7d1,_0x3c1ce4[_0x0128('0x5c')]);return db[_0x0128('0x5a')]['find'](_0x31c7d1)[_0x0128('0x22')](handleEntityNotFound(_0x43cbbb,null))[_0x0128('0x22')](respondWithResult(_0x43cbbb,null))['catch'](handleError(_0x43cbbb,null));};exports[_0x0128('0x5d')]=function(_0x1b0b5b,_0xb4cb4f){return db[_0x0128('0x5a')][_0x0128('0x5d')](_0x1b0b5b[_0x0128('0x5e')],{})[_0x0128('0x22')](function(_0x553beb){var _0x5531ec=_0x1b0b5b[_0x0128('0x5f')][_0x0128('0x60')]({'plain':!![]});if(!_0x5531ec)throw new Error(_0x0128('0x61'));if(_0x5531ec[_0x0128('0x62')]===_0x0128('0x5f')){var _0x2036b7=_0x553beb[_0x0128('0x60')]({'plain':!![]});var _0x113439=_0x0128('0x37');return db[_0x0128('0x63')][_0x0128('0x64')]({'where':{'name':_0x113439,'userProfileId':_0x5531ec['userProfileId']},'raw':!![]})[_0x0128('0x22')](function(_0x6808c4){if(_0x6808c4&&_0x6808c4[_0x0128('0x65')]===0x0){return db[_0x0128('0x38')][_0x0128('0x5d')]({'name':_0x2036b7['name'],'resourceId':_0x2036b7['id'],'type':_0x6808c4['name'],'sectionId':_0x6808c4['id']},{})['then'](function(){return _0x553beb;});}else{return _0x553beb;}})[_0x0128('0x57')](function(_0x28db23){logger[_0x0128('0x28')](_0x0128('0x66'),_0x28db23);throw _0x28db23;});}return _0x553beb;})[_0x0128('0x22')](respondWithResult(_0xb4cb4f,0xc9))[_0x0128('0x57')](handleError(_0xb4cb4f,null));};exports['update']=function(_0x46726a,_0x443e05){if(_0x46726a[_0x0128('0x5e')]['id']){delete _0x46726a['body']['id'];}return db['SmsAccount'][_0x0128('0x64')]({'where':{'id':_0x46726a['params']['id']},'include':[{'model':db['Pause'],'as':_0x0128('0x3d')}]})['then'](handleEntityNotFound(_0x443e05,null))['then'](saveUpdates(_0x46726a[_0x0128('0x5e')],null))[_0x0128('0x22')](respondWithResult(_0x443e05,null))[_0x0128('0x57')](handleError(_0x443e05,null));};exports[_0x0128('0x36')]=function(_0x2752d6,_0x22b48d){return db[_0x0128('0x5a')][_0x0128('0x64')]({'where':{'id':_0x2752d6['params']['id']}})[_0x0128('0x22')](handleEntityNotFound(_0x22b48d,null))[_0x0128('0x22')](removeEntity(_0x22b48d,null))[_0x0128('0x57')](handleError(_0x22b48d,null));};exports[_0x0128('0x67')]=function(_0x4e29a6,_0xccaac0){return db[_0x0128('0x5a')][_0x0128('0x67')]()[_0x0128('0x22')](respondWithResult(_0xccaac0,null))['catch'](handleError(_0xccaac0,null));};exports[_0x0128('0x68')]=function(_0x174a03,_0x28dfa8,_0x25183a){if(_0x174a03[_0x0128('0x5e')]['id']){delete _0x174a03[_0x0128('0x5e')]['id'];}return db[_0x0128('0x5a')][_0x0128('0x64')]({'where':{'id':_0x174a03['params']['id']}})[_0x0128('0x22')](handleEntityNotFound(_0x28dfa8,null))['then'](function(_0x5355ad){if(_0x5355ad){_0x174a03[_0x0128('0x5e')][_0x0128('0x69')]=_0x5355ad['id'];return db[_0x0128('0x6a')][_0x0128('0x5d')](_0x174a03[_0x0128('0x5e')]);}})['then'](respondWithResult(_0x28dfa8,null))['catch'](handleError(_0x28dfa8,null));};exports['getDispositions']=function(_0x4bc2b6,_0x36743e,_0x554fa6){var _0x5f44d7={'raw':![],'where':{}};var _0x30e0fe={};var _0x25bb0b={'count':0x0,'rows':[]};return db['SmsAccount'][_0x0128('0x6b')]({'where':{'id':_0x4bc2b6['params']['id']}})['then'](handleEntityNotFound(_0x36743e,null))[_0x0128('0x22')](function(_0x1efe55){if(_0x1efe55){_0x30e0fe['model']=_[_0x0128('0x59')](db['Disposition'][_0x0128('0x3f')]);_0x30e0fe[_0x0128('0x44')]=_['keys'](_0x4bc2b6[_0x0128('0x44')]);_0x30e0fe[_0x0128('0x45')]=_[_0x0128('0x47')](_0x30e0fe['model'],_0x30e0fe[_0x0128('0x44')]);_0x5f44d7[_0x0128('0x46')]=_[_0x0128('0x47')](_0x30e0fe[_0x0128('0x43')],qs[_0x0128('0x48')](_0x4bc2b6[_0x0128('0x44')][_0x0128('0x48')]));_0x5f44d7['attributes']=_0x5f44d7[_0x0128('0x46')][_0x0128('0x49')]?_0x5f44d7[_0x0128('0x46')]:_0x30e0fe[_0x0128('0x43')];if(!_0x4bc2b6[_0x0128('0x44')]['hasOwnProperty'](_0x0128('0x4b'))){_0x5f44d7[_0x0128('0x30')]=qs['limit'](_0x4bc2b6[_0x0128('0x44')]['limit']);_0x5f44d7['offset']=qs[_0x0128('0x2f')](_0x4bc2b6[_0x0128('0x44')][_0x0128('0x2f')]);}_0x5f44d7['order']=qs[_0x0128('0x4d')](_0x4bc2b6['query'][_0x0128('0x4d')]);_0x5f44d7[_0x0128('0x4e')]=qs[_0x0128('0x45')](_[_0x0128('0x4f')](_0x4bc2b6[_0x0128('0x44')],_0x30e0fe[_0x0128('0x45')]));_0x5f44d7['where'][_0x0128('0x69')]=_0x1efe55['id'];if(_0x4bc2b6[_0x0128('0x44')][_0x0128('0x52')]){_0x5f44d7[_0x0128('0x4e')]=_['merge'](_0x5f44d7['where'],{'$or':_[_0x0128('0x3e')](_0x5f44d7[_0x0128('0x46')],function(_0xd35f33){var _0x1631b1={};_0x1631b1[_0xd35f33]={'$like':'%'+_0x4bc2b6[_0x0128('0x44')][_0x0128('0x52')]+'%'};return _0x1631b1;})});}_0x5f44d7=_['merge']({},_0x5f44d7,_0x4bc2b6[_0x0128('0x5c')]);return db['Disposition'][_0x0128('0x53')]({'where':_0x5f44d7[_0x0128('0x4e')]})[_0x0128('0x22')](function(_0x58190b){_0x25bb0b['count']=_0x58190b;if(_0x4bc2b6['query']['includeAll']){_0x5f44d7[_0x0128('0x54')]=[{'all':!![]}];}return db[_0x0128('0x6a')][_0x0128('0x55')](_0x5f44d7);})[_0x0128('0x22')](function(_0x50bef9){_0x25bb0b[_0x0128('0x56')]=_0x50bef9;return _0x25bb0b;});}})[_0x0128('0x22')](respondWithFilteredResult(_0x36743e,_0x5f44d7))['catch'](handleError(_0x36743e,null));};exports[_0x0128('0x6c')]=function(_0x13fdcf,_0x2440bb,_0x2d1851){return db[_0x0128('0x5a')][_0x0128('0x64')]({'where':{'id':_0x13fdcf[_0x0128('0x58')]['id']}})[_0x0128('0x22')](handleEntityNotFound(_0x2440bb,null))[_0x0128('0x22')](function(_0x60368d){if(_0x60368d){return _0x60368d['removeDispositions'](_0x13fdcf[_0x0128('0x44')][_0x0128('0x6d')]);}})[_0x0128('0x22')](respondWithStatusCode(_0x2440bb,null))['catch'](handleError(_0x2440bb,null));};exports[_0x0128('0x6e')]=function(_0x2a06df,_0x4b25df,_0x4d8cca){if(_0x2a06df[_0x0128('0x5e')]['id']){delete _0x2a06df['body']['id'];}return db[_0x0128('0x5a')][_0x0128('0x64')]({'where':{'id':_0x2a06df[_0x0128('0x58')]['id']}})['then'](handleEntityNotFound(_0x4b25df,null))[_0x0128('0x22')](function(_0x973095){if(_0x973095){_0x2a06df[_0x0128('0x5e')]['SmsAccountId']=_0x973095['id'];return db['CannedAnswer'][_0x0128('0x5d')](_0x2a06df[_0x0128('0x5e')]);}})['then'](respondWithResult(_0x4b25df,null))[_0x0128('0x57')](handleError(_0x4b25df,null));};exports[_0x0128('0x6f')]=function(_0x31da4d,_0x108d6f,_0x1ed5e5){var _0x5eb042={'raw':![],'where':{}};var _0x412a88={};var _0x54662d={'count':0x0,'rows':[]};return db[_0x0128('0x5a')][_0x0128('0x6b')]({'where':{'id':_0x31da4d[_0x0128('0x58')]['id']}})['then'](handleEntityNotFound(_0x108d6f,null))[_0x0128('0x22')](function(_0x38b283){if(_0x38b283){_0x412a88[_0x0128('0x43')]=_[_0x0128('0x59')](db['CannedAnswer']['rawAttributes']);_0x412a88[_0x0128('0x44')]=_['keys'](_0x31da4d[_0x0128('0x44')]);_0x412a88[_0x0128('0x45')]=_[_0x0128('0x47')](_0x412a88['model'],_0x412a88[_0x0128('0x44')]);_0x5eb042[_0x0128('0x46')]=_[_0x0128('0x47')](_0x412a88[_0x0128('0x43')],qs[_0x0128('0x48')](_0x31da4d[_0x0128('0x44')][_0x0128('0x48')]));_0x5eb042[_0x0128('0x46')]=_0x5eb042[_0x0128('0x46')][_0x0128('0x49')]?_0x5eb042[_0x0128('0x46')]:_0x412a88[_0x0128('0x43')];if(!_0x31da4d[_0x0128('0x44')][_0x0128('0x4a')](_0x0128('0x4b'))){_0x5eb042[_0x0128('0x30')]=qs[_0x0128('0x30')](_0x31da4d[_0x0128('0x44')][_0x0128('0x30')]);_0x5eb042['offset']=qs[_0x0128('0x2f')](_0x31da4d[_0x0128('0x44')]['offset']);}_0x5eb042[_0x0128('0x4c')]=qs['sort'](_0x31da4d[_0x0128('0x44')]['sort']);_0x5eb042[_0x0128('0x4e')]=qs[_0x0128('0x45')](_[_0x0128('0x4f')](_0x31da4d[_0x0128('0x44')],_0x412a88[_0x0128('0x45')]));_0x5eb042['where']['SmsAccountId']=_0x38b283['id'];if(_0x31da4d[_0x0128('0x44')][_0x0128('0x52')]){_0x5eb042[_0x0128('0x4e')]=_[_0x0128('0x50')](_0x5eb042[_0x0128('0x4e')],{'$or':_[_0x0128('0x3e')](_0x5eb042['attributes'],function(_0x2d2310){var _0x47888c={};_0x47888c[_0x2d2310]={'$like':'%'+_0x31da4d[_0x0128('0x44')][_0x0128('0x52')]+'%'};return _0x47888c;})});}_0x5eb042=_[_0x0128('0x50')]({},_0x5eb042,_0x31da4d[_0x0128('0x5c')]);return db[_0x0128('0x70')][_0x0128('0x53')]({'where':_0x5eb042[_0x0128('0x4e')]})[_0x0128('0x22')](function(_0x580cce){_0x54662d[_0x0128('0x53')]=_0x580cce;if(_0x31da4d[_0x0128('0x44')][_0x0128('0x5b')]){_0x5eb042[_0x0128('0x54')]=[{'all':!![]}];}return db[_0x0128('0x70')][_0x0128('0x55')](_0x5eb042);})[_0x0128('0x22')](function(_0x1046a3){_0x54662d[_0x0128('0x56')]=_0x1046a3;return _0x54662d;});}})[_0x0128('0x22')](respondWithFilteredResult(_0x108d6f,_0x5eb042))[_0x0128('0x57')](handleError(_0x108d6f,null));};exports[_0x0128('0x71')]=function(_0x23d67b,_0x3eaf21,_0x1f7e1a){return db['SmsAccount'][_0x0128('0x64')]({'where':{'id':_0x23d67b['params']['id']}})['then'](handleEntityNotFound(_0x3eaf21,null))[_0x0128('0x22')](function(_0x89f67d){if(_0x89f67d){return _0x89f67d[_0x0128('0x71')](_0x23d67b['query'][_0x0128('0x6d')]);}})[_0x0128('0x22')](respondWithStatusCode(_0x3eaf21,null))[_0x0128('0x57')](handleError(_0x3eaf21,null));};exports[_0x0128('0x72')]=function(_0x34c612,_0x4bf4d8,_0x2a8ddf){var _0x44cab3={'channel':'sms'};var _0x1d5861=[];var _0x4639c0=[];var _0x5ee1ee={};return db['SmsAccount'][_0x0128('0x64')]({'where':{'id':_0x34c612[_0x0128('0x58')]['id']},'include':[{'model':db['SmsApplication'],'as':_0x0128('0x73')}]})[_0x0128('0x22')](handleEntityNotFound(_0x4bf4d8,null))[_0x0128('0x22')](function(_0x4ee7dd){_0x44cab3[_0x0128('0x74')]=_0x4ee7dd;_0x44cab3[_0x0128('0x75')]=_[_0x0128('0x76')](_0x4ee7dd[_0x0128('0x73')],[_0x0128('0x77')],['asc']);if(_0x44cab3[_0x0128('0x74')][_0x0128('0x73')]){delete _0x44cab3[_0x0128('0x74')][_0x0128('0x73')];}return db[_0x0128('0x78')]['describe']();})[_0x0128('0x22')](function(_0x5e3ca9){if(!_0x5e3ca9){throw new db[(_0x0128('0x1e'))][(_0x0128('0x1f'))](_0x0128('0x79'));}_0x1d5861=_[_0x0128('0x7a')](_[_0x0128('0x59')](_0x5e3ca9),[_0x0128('0x7b'),_0x0128('0x7c')]);_0x4639c0=_[_0x0128('0x7a')](_[_0x0128('0x59')](_0x5e3ca9),[_0x0128('0x7b'),_0x0128('0x7c'),_0x0128('0x7d'),_0x0128('0x7e')]);_0x44cab3[_0x0128('0x5e')]={'mapKey':_0x0128('0x7f')};if(_0x44cab3[_0x0128('0x74')][_0x0128('0x41')]){switch(_0x44cab3['account']['type']){case _0x0128('0x80'):_0x44cab3[_0x0128('0x5e')][_0x0128('0x81')]=_0x34c612[_0x0128('0x5e')][_0x0128('0x82')];_0x44cab3[_0x0128('0x5e')][_0x0128('0x5e')]=_0x34c612[_0x0128('0x5e')][_0x0128('0x83')];_0x44cab3['body'][_0x0128('0x84')]=_0x34c612[_0x0128('0x5e')][_0x0128('0x85')];break;case _0x0128('0x86'):_0x44cab3[_0x0128('0x5e')][_0x0128('0x81')]='+'+_0x34c612[_0x0128('0x5e')][_0x0128('0x87')];_0x44cab3[_0x0128('0x5e')][_0x0128('0x5e')]=_0x34c612['body'][_0x0128('0x88')];break;case'connectel':_0x44cab3[_0x0128('0x5e')][_0x0128('0x81')]=_0x34c612[_0x0128('0x5e')]['from'];_0x44cab3[_0x0128('0x5e')][_0x0128('0x5e')]=_0x34c612[_0x0128('0x5e')][_0x0128('0x2b')];break;case'clicksend':_0x44cab3[_0x0128('0x5e')][_0x0128('0x81')]=_0x34c612['body'][_0x0128('0x81')];_0x44cab3[_0x0128('0x5e')]['body']=_0x34c612[_0x0128('0x5e')]['body'];_0x44cab3[_0x0128('0x5e')][_0x0128('0x84')]=_0x34c612[_0x0128('0x5e')][_0x0128('0x89')];break;case _0x0128('0x8a'):_0x44cab3[_0x0128('0x5e')][_0x0128('0x81')]=_0x34c612['body'][_0x0128('0x82')];_0x44cab3['body'][_0x0128('0x5e')]=_0x34c612[_0x0128('0x5e')][_0x0128('0x8b')];_0x44cab3[_0x0128('0x5e')][_0x0128('0x84')]=_0x34c612[_0x0128('0x5e')]['MessageUUID'];break;case _0x0128('0x8c'):_0x44cab3[_0x0128('0x5e')][_0x0128('0x81')]='+'+_0x34c612[_0x0128('0x5e')][_0x0128('0x8d')][0x0][_0x0128('0x81')];_0x44cab3[_0x0128('0x5e')][_0x0128('0x5e')]=_0x34c612[_0x0128('0x5e')][_0x0128('0x8d')][0x0][_0x0128('0x88')];_0x44cab3[_0x0128('0x5e')][_0x0128('0x84')]=_0x34c612['body']['results'][0x0][_0x0128('0x84')];break;case _0x0128('0x8e'):_0x44cab3[_0x0128('0x5e')][_0x0128('0x81')]=_0x34c612[_0x0128('0x5e')][_0x0128('0x8f')];_0x44cab3[_0x0128('0x5e')][_0x0128('0x5e')]=_0x34c612['body']['segmentedMessage'][_0x0128('0x2b')];break;case _0x0128('0x90'):_0x44cab3[_0x0128('0x5e')][_0x0128('0x81')]=_0x34c612[_0x0128('0x5e')][_0x0128('0x91')];_0x44cab3[_0x0128('0x5e')][_0x0128('0x5e')]=_0x34c612[_0x0128('0x5e')]['text'];_0x44cab3[_0x0128('0x5e')][_0x0128('0x84')]=_0x34c612[_0x0128('0x5e')][_0x0128('0x92')];break;case _0x0128('0x93'):_0x44cab3[_0x0128('0x5e')][_0x0128('0x81')]=_0x34c612[_0x0128('0x5e')]['from'];_0x44cab3['body'][_0x0128('0x5e')]=_0x34c612[_0x0128('0x5e')]['message'];_0x44cab3[_0x0128('0x5e')]['messageId']=_0x34c612[_0x0128('0x5e')]['refid'];break;}}if(_0x44cab3[_0x0128('0x5e')]['id']){delete _0x44cab3[_0x0128('0x5e')]['id'];}if(_[_0x0128('0x94')](_0x44cab3[_0x0128('0x5e')]['from'])){throw new db['Sequelize']['ValidationError']('from\x20is\x20mandatory');}if(_['isNil'](_0x44cab3['body'][_0x0128('0x5e')])||_0x44cab3[_0x0128('0x5e')][_0x0128('0x5e')]===''){throw new db[(_0x0128('0x1e'))][(_0x0128('0x1f'))](_0x0128('0x95'));}if(_[_0x0128('0x94')](_0x44cab3[_0x0128('0x5e')][_0x0128('0x96')])){throw new db[(_0x0128('0x1e'))]['ValidationError'](_0x0128('0x97')+_0x4639c0);}if(!_['includes'](_0x4639c0,_0x44cab3[_0x0128('0x5e')][_0x0128('0x96')])){throw new db[(_0x0128('0x1e'))]['ValidationError'](_0x0128('0x98')+_0x4639c0);}_0x5ee1ee[_0x44cab3[_0x0128('0x5e')][_0x0128('0x96')]]=_0x44cab3[_0x0128('0x5e')][_0x0128('0x81')];return db[_0x0128('0x99')][_0x0128('0x64')]({'where':{'id':_0x44cab3[_0x0128('0x74')][_0x0128('0x7e')]},'include':[{'model':db[_0x0128('0x78')],'as':'Contacts','where':_0x5ee1ee,'limit':0x1,'order':[['updatedAt',_0x0128('0x9a')]]}]});})[_0x0128('0x22')](handleEntityNotFound(_0x4bf4d8,null))['then'](function(_0xda67a6){if(_0xda67a6){_0x44cab3[_0x0128('0x9b')]=_[_0x0128('0x9c')](_0xda67a6,[_0x0128('0x9d')]);if(_0xda67a6[_0x0128('0x9d')][_0x0128('0x49')]){return _0xda67a6[_0x0128('0x9d')][0x0];}var _0x31696c=_[_0x0128('0x9e')](_0x44cab3[_0x0128('0x5e')],{'firstName':_0x44cab3[_0x0128('0x5e')][_0x0128('0x81')],'ListId':_0xda67a6['id']});_0x31696c[_0x44cab3[_0x0128('0x5e')][_0x0128('0x96')]]=_0x44cab3[_0x0128('0x5e')][_0x0128('0x81')];return db[_0x0128('0x78')][_0x0128('0x5d')](_0x31696c,{'fields':_0x1d5861,'raw':!![]});}})[_0x0128('0x22')](handleEntityNotFound(_0x4bf4d8,null))[_0x0128('0x22')](function(_0x317d7c){if(_0x317d7c){_0x44cab3[_0x0128('0x9f')]=_0x317d7c;var _0xac850f={'ContactId':_0x317d7c['id'],'phone':_0x44cab3['body']['from'],'SmsAccountId':_0x34c612['params']['id']};var _0x50e5e8={'ContactId':_0x317d7c['id'],'SmsAccountId':_0x34c612['params']['id'],'closed':![]};return db[_0x0128('0xa0')][_0x0128('0x64')]({'where':_0x50e5e8})[_0x0128('0x22')](function(_0x1ef396){if(_0x1ef396){return[_0x1ef396,![]];}return db[_0x0128('0xa0')][_0x0128('0x5d')](_0xac850f)[_0x0128('0x22')](function(_0x1c27c2){return[_0x1c27c2,!![]];});});}})[_0x0128('0xa1')](function(_0x7a67e,_0x2374f3){_0x44cab3[_0x0128('0xa2')]=_0x7a67e[_0x0128('0x60')]({'plain':!![]});_0x44cab3[_0x0128('0xa2')][_0x0128('0xa3')]=![];if(_0x2374f3){if(_0x44cab3[_0x0128('0x74')][_0x0128('0xa4')]){_0x44cab3['applications'][_0x0128('0xa5')]({'id':0x0,'priority':_0x44cab3[_0x0128('0x75')]['length']+0x1,'app':_0x0128('0xa6'),'appdata':_0x0128('0xa7'),'interval':'*,*,*,*'});}_0x44cab3[_0x0128('0xa2')][_0x0128('0xa3')]=!![];}return db[_0x0128('0xa8')]['create']({'phone':_0x44cab3['body']['from'],'messageId':_0x44cab3[_0x0128('0x5e')]['messageId'],'body':_0x44cab3[_0x0128('0x5e')][_0x0128('0x5e')],'SmsAccountId':_0x34c612[_0x0128('0x58')]['id'],'SmsInteractionId':_0x7a67e['id'],'direction':'in','ContactId':_0x7a67e[_0x0128('0xa9')],'AttachmentId':_0x44cab3['body'][_0x0128('0xaa')]});})['then'](function(_0x369122){_0x44cab3[_0x0128('0x2b')]=_0x369122;if(_0x44cab3['interaction']['UserId']){return db[_0x0128('0xab')][_0x0128('0x64')]({'attributes':['id',_0x0128('0x39')],'where':{'id':_0x44cab3[_0x0128('0xa2')]['UserId']}})[_0x0128('0x22')](function(_0x444da5){if(_0x444da5){_0x44cab3[_0x0128('0x75')][_0x0128('0xac')]({'id':0x0,'priority':0x0,'app':_0x0128('0xad'),'appdata':_0x444da5['name']+','+(_0x44cab3[_0x0128('0x74')][_0x0128('0xae')]||0xa),'interval':_0x0128('0xaf')});}return respondWithRpcPromise(_0x0128('0xb0'),_0x0128('0xb1'),_0x44cab3);});}return respondWithRpcPromise(_0x0128('0xb0'),'startRouting',_0x44cab3);})[_0x0128('0x22')](function(_0x284005){if(_0x284005){var _0x3f3848=0xc8;var _0x19c32a='receiveMessage';logger[_0x0128('0x23')](_0x0128('0x25'),_0x19c32a,_0x3f3848,_0x0128('0xb2'));logger[_0x0128('0xb3')](_0x0128('0xb4'),_0x19c32a,_0x3f3848,'entity\x20found',JSON[_0x0128('0x27')](_0x284005));if(_0x44cab3[_0x0128('0x74')][_0x0128('0x41')]===_0x0128('0x80')){return _0x4bf4d8['status'](_0x3f3848)[_0x0128('0xb5')]('Content-Type',_0x0128('0xb6'))[_0x0128('0x3a')](_0x0128('0xb7'));}else{return _0x4bf4d8[_0x0128('0x2d')](_0x3f3848)[_0x0128('0x32')](_0x284005);}}})[_0x0128('0x57')](handleError(_0x4bf4d8,null));};exports[_0x0128('0xb8')]=function(_0x3bb2c4,_0x26d5a3,_0x436b9a){return db[_0x0128('0x5a')][_0x0128('0x6b')]({'where':{'id':_0x3bb2c4[_0x0128('0x58')]['id']}})[_0x0128('0x22')](handleEntityNotFound(_0x26d5a3,null))[_0x0128('0x22')](function(_0x1933c8){if(_0x1933c8){return db[_0x0128('0xb9')][_0x0128('0xba')](function(_0x40b381){return db[_0x0128('0xbb')][_0x0128('0x36')]({'where':{'SmsAccountId':_0x3bb2c4[_0x0128('0x58')]['id']},'transaction':_0x40b381})[_0x0128('0x22')](function(_0x2169f9){var _0x966f1e=_['map'](_0x3bb2c4[_0x0128('0x5e')],function(_0x2dfd73){_0x2dfd73['SmsAccountId']=_0x3bb2c4[_0x0128('0x58')]['id'];return _0x2dfd73;});return db[_0x0128('0xbb')][_0x0128('0xbc')](_0x966f1e,{'transaction':_0x40b381});});})[_0x0128('0x22')](function(){return db[_0x0128('0xbb')]['findAndCountAll']({'where':{'SmsAccountId':_0x3bb2c4[_0x0128('0x58')]['id']},'order':_0x0128('0x77')});});}})[_0x0128('0x22')](respondWithResult(_0x26d5a3,null))[_0x0128('0x57')](handleError(_0x26d5a3,null));};exports[_0x0128('0xbd')]=function(_0x169037,_0x391d2e,_0x3f2846){var _0x1882d9={};var _0xef9949={};var _0x44db3f;var _0x404ada;return db[_0x0128('0x5a')]['findOne']({'where':{'id':_0x169037[_0x0128('0x58')]['id']}})[_0x0128('0x22')](handleEntityNotFound(_0x391d2e,null))['then'](function(_0xf5d7fe){if(_0xf5d7fe){_0x44db3f=_0xf5d7fe;_0xef9949[_0x0128('0x43')]=_[_0x0128('0x59')](db[_0x0128('0xbb')][_0x0128('0x3f')]);_0xef9949['query']=_[_0x0128('0x59')](_0x169037[_0x0128('0x44')]);_0xef9949['filters']=_[_0x0128('0x47')](_0xef9949[_0x0128('0x43')],_0xef9949[_0x0128('0x44')]);_0x1882d9[_0x0128('0x46')]=_[_0x0128('0x47')](_0xef9949[_0x0128('0x43')],qs['fields'](_0x169037[_0x0128('0x44')][_0x0128('0x48')]));_0x1882d9[_0x0128('0x46')]=_0x1882d9['attributes'][_0x0128('0x49')]?_0x1882d9[_0x0128('0x46')]:_0xef9949['model'];_0x1882d9[_0x0128('0x4c')]=qs['sort'](_0x169037[_0x0128('0x44')]['sort']);_0x1882d9[_0x0128('0x4e')]=qs[_0x0128('0x45')](_[_0x0128('0x4f')](_0x169037[_0x0128('0x44')],_0xef9949[_0x0128('0x45')]));if(_0x169037[_0x0128('0x44')][_0x0128('0x52')]){_0x1882d9['where']=_['merge'](_0x1882d9[_0x0128('0x4e')],{'$or':_['map'](_0x1882d9[_0x0128('0x46')],function(_0x4e4e9f){var _0x5f4d75={};_0x5f4d75[_0x4e4e9f]={'$like':'%'+_0x169037[_0x0128('0x44')][_0x0128('0x52')]+'%'};return _0x5f4d75;})});}_0x1882d9=_[_0x0128('0x50')]({},_0x1882d9,_0x169037[_0x0128('0x5c')]);return _0x44db3f[_0x0128('0xbd')](_0x1882d9);}})['then'](function(_0x425cea){if(_0x425cea){_0x404ada=_0x425cea['length'];if(!_0x169037[_0x0128('0x44')][_0x0128('0x4a')](_0x0128('0x4b'))){_0x1882d9['limit']=qs[_0x0128('0x30')](_0x169037[_0x0128('0x44')][_0x0128('0x30')]);_0x1882d9['offset']=qs['offset'](_0x169037[_0x0128('0x44')][_0x0128('0x2f')]);}return _0x44db3f['getApplications'](_0x1882d9);}})[_0x0128('0x22')](function(_0x3e9c9d){if(_0x3e9c9d){return _0x3e9c9d?{'count':_0x404ada,'rows':_0x3e9c9d}:null;}})[_0x0128('0x22')](respondWithResult(_0x391d2e,null))[_0x0128('0x57')](handleError(_0x391d2e,null));};exports[_0x0128('0xbe')]=function(_0x3e4c17,_0x3bf172,_0x353151){var _0x1eed4a={'raw':![],'where':{}};var _0x4f66ff={};var _0x54c891={'count':0x0,'rows':[]};return db['SmsAccount'][_0x0128('0x6b')]({'where':{'id':_0x3e4c17[_0x0128('0x58')]['id']}})[_0x0128('0x22')](handleEntityNotFound(_0x3bf172,null))[_0x0128('0x22')](function(_0x54fba5){if(_0x54fba5){_0x4f66ff['model']=_[_0x0128('0x59')](db[_0x0128('0xa0')][_0x0128('0x3f')]);_0x4f66ff['query']=_['keys'](_0x3e4c17['query']);_0x4f66ff['filters']=_[_0x0128('0x47')](_0x4f66ff['model'],_0x4f66ff['query']);_0x1eed4a[_0x0128('0x46')]=_['intersection'](_0x4f66ff[_0x0128('0x43')],qs[_0x0128('0x48')](_0x3e4c17[_0x0128('0x44')]['fields']));_0x1eed4a[_0x0128('0x46')]=_0x1eed4a['attributes'][_0x0128('0x49')]?_0x1eed4a[_0x0128('0x46')]:_0x4f66ff['model'];if(!_0x3e4c17[_0x0128('0x44')][_0x0128('0x4a')](_0x0128('0x4b'))){_0x1eed4a[_0x0128('0x30')]=qs[_0x0128('0x30')](_0x3e4c17['query'][_0x0128('0x30')]);_0x1eed4a[_0x0128('0x2f')]=qs[_0x0128('0x2f')](_0x3e4c17[_0x0128('0x44')]['offset']);}_0x1eed4a[_0x0128('0x4c')]=qs[_0x0128('0x4d')](_0x3e4c17[_0x0128('0x44')][_0x0128('0x4d')]);_0x1eed4a[_0x0128('0x4e')]=qs['filters'](_[_0x0128('0x4f')](_0x3e4c17[_0x0128('0x44')],_0x4f66ff[_0x0128('0x45')]));_0x1eed4a[_0x0128('0x4e')][_0x0128('0x69')]=_0x54fba5['id'];if(_0x3e4c17[_0x0128('0x44')][_0x0128('0x52')]){_0x1eed4a[_0x0128('0x4e')]=_[_0x0128('0x50')](_0x1eed4a['where'],{'$or':_[_0x0128('0x3e')](_0x1eed4a[_0x0128('0x46')],function(_0x39e3fa){var _0x3a24f7={};_0x3a24f7[_0x39e3fa]={'$like':'%'+_0x3e4c17[_0x0128('0x44')]['filter']+'%'};return _0x3a24f7;})});}_0x1eed4a=_[_0x0128('0x50')]({},_0x1eed4a,_0x3e4c17[_0x0128('0x5c')]);return db[_0x0128('0xa0')]['count']({'where':_0x1eed4a[_0x0128('0x4e')]})[_0x0128('0x22')](function(_0x247441){_0x54c891[_0x0128('0x53')]=_0x247441;if(_0x3e4c17[_0x0128('0x44')][_0x0128('0x5b')]){_0x1eed4a[_0x0128('0x54')]=[{'model':db[_0x0128('0x78')],'as':_0x0128('0xbf'),'required':![]},{'model':db[_0x0128('0xab')],'as':_0x0128('0xc0'),'attributes':['name',_0x0128('0xc1'),'internal'],'required':![]},{'model':db[_0x0128('0xc2')],'as':_0x0128('0xc3'),'attributes':['id','name',_0x0128('0xc4')],'where':_0x3e4c17[_0x0128('0x44')][_0x0128('0xc5')]?{'id':_0x3e4c17[_0x0128('0x44')]['tag']}:undefined,'required':_0x3e4c17[_0x0128('0x44')][_0x0128('0xc5')]?!![]:![]}];}return db[_0x0128('0xa0')][_0x0128('0x55')](_0x1eed4a);})[_0x0128('0x22')](function(_0x1edf80){_0x54c891[_0x0128('0x56')]=_0x1edf80;return _0x54c891;});}})[_0x0128('0x22')](respondWithFilteredResult(_0x3bf172,_0x1eed4a))[_0x0128('0x57')](handleError(_0x3bf172,null));};exports[_0x0128('0x3a')]=function(_0xa93a8f,_0x24010e,_0xc1e36a){var _0x5da48a,_0x136f03,_0x1ebee3;if(_[_0x0128('0x94')](_0xa93a8f['body'][_0x0128('0x5e')])||_0xa93a8f[_0x0128('0x5e')][_0x0128('0x5e')]===''){throw new db['Sequelize'][(_0x0128('0x1f'))](_0x0128('0x95'));}if(_['isNil'](_0xa93a8f['body']['to'])){throw new db[(_0x0128('0x1e'))][(_0x0128('0x1f'))]('to\x20is\x20mandatory');}_0x5da48a=_0xa93a8f[_0x0128('0x5e')]['to'];return db[_0x0128('0x5a')]['find']({'where':{'id':_0xa93a8f[_0x0128('0x58')]['id']},'include':[{'model':db['CmList'],'as':_0x0128('0xc6'),'include':[{'model':db[_0x0128('0x78')],'as':_0x0128('0x9d'),'where':{'mobile':_0x5da48a},'limit':0x1,'order':[[_0x0128('0x7c'),_0x0128('0x9a')]]}]}]})['then'](handleEntityNotFound(_0x24010e,null))[_0x0128('0x22')](function(_0x5c66b6){if(_0x5c66b6&&_0x5c66b6[_0x0128('0xc6')]){_0x136f03=_0x5c66b6[_0x0128('0x60')]({'plain':!![]});if(_0x136f03[_0x0128('0xc6')]&&_0x136f03[_0x0128('0xc6')][_0x0128('0x9d')][_0x0128('0x49')]){return _0x136f03['List'][_0x0128('0x9d')][0x0];}return db[_0x0128('0x78')][_0x0128('0x5d')](_[_0x0128('0x9e')](_0xa93a8f[_0x0128('0x5e')],{'firstName':_0x5da48a,'mobile':_0x5da48a,'phone':_0x5da48a,'ListId':_0x136f03[_0x0128('0x7e')]}));}})[_0x0128('0x22')](handleEntityNotFound(_0x24010e,null))['then'](function(_0x4c019f){if(_0x4c019f){_0x1ebee3=_0x4c019f;return db[_0x0128('0xa0')]['find']({'where':{'ContactId':_0x1ebee3['id'],'closed':![],'SmsAccountId':_0x136f03['id']}})[_0x0128('0x22')](function(_0x3d9a46){if(_0x3d9a46){return[_0x3d9a46,![]];}return db[_0x0128('0xa0')][_0x0128('0x5d')]({'UserId':_0xa93a8f[_0x0128('0x5f')]['id'],'ContactId':_0x1ebee3['id'],'SmsAccountId':_0x136f03['id'],'phone':_0x5da48a,'firstMsgDirection':_0x0128('0xc7'),'Messages':[_[_0x0128('0x50')](_0xa93a8f['body'],{'read':![],'body':_0xa93a8f['body'][_0x0128('0x5e')],'phone':_0x5da48a,'SmsAccountId':_0x136f03['id'],'UserId':_0xa93a8f[_0x0128('0x5f')]['id'],'ContactId':_0x1ebee3['id']})]},{'include':[{'model':db[_0x0128('0xa8')],'as':_0x0128('0xc8')}]})['then'](function(_0x3247c1){return[_0x3247c1,!![]];});});}})[_0x0128('0xa1')](function(_0x1fb40f,_0x5964ed){if(_0x5964ed){return _0x1fb40f;}return db[_0x0128('0xa8')][_0x0128('0x5d')](_[_0x0128('0x50')](_0xa93a8f['body'],{'read':![],'body':_0xa93a8f[_0x0128('0x5e')][_0x0128('0x5e')],'phone':_0x5da48a,'SmsAccountId':_0x136f03['id'],'SmsInteractionId':_0x1fb40f['id'],'UserId':_0xa93a8f[_0x0128('0x5f')]['id'],'ContactId':_0x1ebee3['id']}))[_0x0128('0x22')](function(_0x3b29fd){_0x1fb40f[_0x0128('0xc9')]['Messages']=[];_0x1fb40f[_0x0128('0xc9')][_0x0128('0xc8')][_0x0128('0xa5')](_0x3b29fd['dataValues']);return _0x1fb40f;});})[_0x0128('0x22')](respondWithResult(_0x24010e,null))[_0x0128('0x57')](handleError(_0x24010e,null));};exports[_0x0128('0x2d')]=function(_0xfa7ad9,_0x1783c0,_0x1d76bf){if(_0xfa7ad9['body']['id']){delete _0xfa7ad9['body']['id'];}console[_0x0128('0xca')](_0x0128('0xcb'),_0xfa7ad9[_0x0128('0x5e')]);var _0x1cd134,_0x32ded0,_0xca5b60;return db[_0x0128('0x5a')][_0x0128('0x64')]({'where':{'id':_0xfa7ad9[_0x0128('0x58')]['id']}})['then'](handleEntityNotFound(_0x1783c0,null))['then'](function(_0x1ebb82){if(_0x1ebb82){_0xca5b60=_0x1ebb82;logger['debug'](_0x0128('0x25'),_0x0128('0x2d'),_0x0128('0xcc'),_0x1ebb82[_0x0128('0x41')],util['inspect'](_0xfa7ad9['body'],{'showHidden':![],'depth':null}));switch(_0x1ebb82[_0x0128('0x41')]){case _0x0128('0x86'):if(_0xfa7ad9[_0x0128('0x5e')]['skebby_dispatch_id']&&_0xfa7ad9[_0x0128('0x5e')][_0x0128('0x2d')]){_0x32ded0=_0xfa7ad9[_0x0128('0x5e')][_0x0128('0x2d')];return db[_0x0128('0xa8')][_0x0128('0x64')]({'where':{'messageId':_0xfa7ad9[_0x0128('0x5e')]['skebby_dispatch_id']}});}break;case _0x0128('0xcd'):if(_0xfa7ad9[_0x0128('0x5e')][_0x0128('0xce')]&&_0xfa7ad9[_0x0128('0x5e')][_0x0128('0xcf')]){_0x32ded0=_0xfa7ad9[_0x0128('0x5e')][_0x0128('0xcf')];return db['SmsMessage'][_0x0128('0x64')]({'where':{'messageId':_0xfa7ad9['body']['requestid']}});}break;case _0x0128('0xd0'):if(_0xfa7ad9[_0x0128('0x5e')][_0x0128('0x89')]&&_0xfa7ad9['body'][_0x0128('0xd1')]){_0x32ded0=_0xfa7ad9[_0x0128('0x5e')][_0x0128('0xd1')];return db[_0x0128('0xa8')][_0x0128('0x64')]({'where':{'messageId':_0xfa7ad9['body'][_0x0128('0x89')]}});}break;case _0x0128('0x8c'):var _0x54b11a=_0xfa7ad9[_0x0128('0x5e')][_0x0128('0x8d')][0x0];if(_0x54b11a[_0x0128('0x84')]&&_0x54b11a[_0x0128('0x2d')][_0x0128('0xd2')]===_0x0128('0xd3')){_0x32ded0=_0x54b11a[_0x0128('0x2d')][_0x0128('0xd2')];return db[_0x0128('0xa8')]['find']({'where':{'messageId':_0x54b11a[_0x0128('0x84')]}});}break;case'clickatell':if(_0xfa7ad9[_0x0128('0x5e')][_0x0128('0x84')]&&_0xfa7ad9[_0x0128('0x5e')][_0x0128('0x2d')]){_0x32ded0=_0xfa7ad9['body'][_0x0128('0x2d')];return db[_0x0128('0xa8')][_0x0128('0x64')]({'where':{'messageId':_0xfa7ad9[_0x0128('0x5e')][_0x0128('0x84')]}});}break;case _0x0128('0x93'):if(_0xfa7ad9[_0x0128('0x5e')][_0x0128('0xd4')]&&_0xfa7ad9[_0x0128('0x5e')][_0x0128('0x2d')]){_0x32ded0=_0xfa7ad9[_0x0128('0x5e')][_0x0128('0x2d')];return db[_0x0128('0xa8')][_0x0128('0x64')]({'where':{'messageId':_0xfa7ad9['body'][_0x0128('0xd4')]}});}break;}}})[_0x0128('0x22')](handleEntityNotFound(_0x1783c0,null))[_0x0128('0x22')](function(_0x4d2221){if(_0x4d2221){_0x1cd134=_0x4d2221;switch(_0xca5b60[_0x0128('0x41')]){case _0x0128('0x86'):if(_0x32ded0===_0x0128('0xd3')){return _0x1cd134[_0x0128('0x35')]({'read':!![]});}else{logger[_0x0128('0x28')](_0x0128('0x25'),_0x0128('0x2d'),_0x0128('0x86'),util[_0x0128('0xd5')](_0xfa7ad9[_0x0128('0x5e')],{'showHidden':![],'depth':null}));}break;case _0x0128('0xcd'):if(_0x32ded0==='1'){return _0x1cd134['update']({'read':!![]});}else{logger[_0x0128('0x28')](_0x0128('0x25'),_0x0128('0x2d'),_0x0128('0x86'),util[_0x0128('0xd5')](_0xfa7ad9[_0x0128('0x5e')],{'showHidden':![],'depth':null}));}break;case'clicksend':if(!_0xfa7ad9['body'][_0x0128('0xd6')]&&_0x32ded0>=0xc8&&_0x32ded0<=0xce){return _0x1cd134[_0x0128('0x35')]({'read':!![]});}else{logger['error'](_0x0128('0x25'),_0x0128('0x2d'),_0x0128('0xd0'),util[_0x0128('0xd5')](_0xfa7ad9[_0x0128('0x5e')],{'showHidden':![],'depth':null}));}break;case _0x0128('0x8c'):var _0x29cafd=_0xfa7ad9['body'][_0x0128('0x8d')][0x0];if(_0x29cafd[_0x0128('0x2d')]['groupName']===_0x0128('0xd3')){return _0x1cd134['update']({'read':!![]});}else{logger['error'](_0x0128('0x25'),_0x0128('0x2d'),_0x0128('0x8c'),util[_0x0128('0xd5')](_0xfa7ad9[_0x0128('0x5e')],{'showHidden':![],'depth':null}));}break;case _0x0128('0x90'):if(_0x32ded0==_0x0128('0xd7')||_0x32ded0==_0x0128('0xd8')){return _0x1cd134[_0x0128('0x35')]({'read':!![]});}else{logger['error']('SmsAccount,\x20%s,\x20%s,\x20%s',_0x0128('0x2d'),'clickatell',util[_0x0128('0xd5')](_0xfa7ad9[_0x0128('0x5e')],{'showHidden':![],'depth':null}));}break;case _0x0128('0x93'):if(_0x32ded0===_0x0128('0xd9')||_0x32ded0===_0x0128('0xda')){return _0x1cd134['update']({'read':!![]});}else{logger['error'](_0x0128('0x25'),_0x0128('0x2d'),_0x0128('0x93'),util[_0x0128('0xd5')](_0xfa7ad9[_0x0128('0x5e')],{'showHidden':![],'depth':null}));}break;}return _0x1cd134;}})[_0x0128('0x22')](respondWithResult(_0x1783c0,null))[_0x0128('0x57')](handleError(_0x1783c0,null));};exports[_0x0128('0xdb')]=function(_0x59ccaf,_0x14753d,_0x15a432){var _0x4e03b3,_0x1130c9,_0x52b1f4;return db[_0x0128('0x5a')][_0x0128('0x64')]({'where':{'id':_0x59ccaf[_0x0128('0x58')]['id']}})[_0x0128('0x22')](handleEntityNotFound(_0x14753d,null))[_0x0128('0x22')](function(_0x21f24c){if(_0x21f24c){_0x52b1f4=_0x21f24c;logger[_0x0128('0xb3')]('SmsAccount,\x20%s,\x20%s,\x20%s',_0x0128('0x2d'),_0x0128('0xcc'),_0x21f24c['type'],util[_0x0128('0xd5')](_0x59ccaf[_0x0128('0x44')],{'showHidden':![],'depth':null}));switch(_0x21f24c[_0x0128('0x41')]){case _0x0128('0x8e'):if(_0x59ccaf[_0x0128('0x44')][_0x0128('0xdc')]&&_0x59ccaf['query'][_0x0128('0xdd')]){_0x1130c9=_0x59ccaf[_0x0128('0x44')]['state'];return db[_0x0128('0xa8')][_0x0128('0x64')]({'where':{'messageId':_0x59ccaf['query'][_0x0128('0xdc')]}});}break;}}})['then'](handleEntityNotFound(_0x14753d,null))[_0x0128('0x22')](function(_0x514364){if(_0x514364){_0x4e03b3=_0x514364;switch(_0x52b1f4[_0x0128('0x41')]){case'csc':if(_0x1130c9==='2'||_0x1130c9==='6'){return _0x4e03b3[_0x0128('0x35')]({'read':!![]});}else{logger[_0x0128('0x28')](_0x0128('0x25'),_0x0128('0x2d'),_0x0128('0x8e'),util[_0x0128('0xd5')](_0x59ccaf[_0x0128('0x44')],{'showHidden':![],'depth':null}));};break;}return _0x4e03b3;}})[_0x0128('0x22')](respondWithResult(_0x14753d,null))[_0x0128('0x57')](handleError(_0x14753d,null));};exports[_0x0128('0xde')]=function(_0x395291,_0x2b88ea,_0x19d5ad){return db['SmsAccount']['find']({'where':{'id':_0x395291[_0x0128('0x58')]['id']}})[_0x0128('0x22')](handleEntityNotFound(_0x2b88ea,null))[_0x0128('0x22')](function(_0x30d2ff){if(_0x30d2ff){return _0x30d2ff[_0x0128('0xde')](_0x395291[_0x0128('0x5e')]['ids'],_[_0x0128('0x9c')](_0x395291[_0x0128('0x5e')],['ids','id'])||{})['spread'](function(_0x3e85c8){for(var _0x2d5691=0x0;_0x2d5691<_0x395291[_0x0128('0x5e')]['ids'][_0x0128('0x49')];_0x2d5691+=0x1){socket[_0x0128('0xdf')](_0x0128('0xe0'),{'UserId':_0x395291[_0x0128('0x5e')][_0x0128('0x6d')][_0x2d5691],'SmsAccountId':_0x395291[_0x0128('0x58')]['id']});}return _0x3e85c8;});}})['then'](respondWithResult(_0x2b88ea,null))[_0x0128('0x57')](handleError(_0x2b88ea,null));};exports[_0x0128('0xe1')]=function(_0x4e6419,_0x5bc92f,_0x4e65d9){return db['SmsAccount']['find']({'where':{'id':_0x4e6419['params']['id']}})[_0x0128('0x22')](handleEntityNotFound(_0x5bc92f,null))[_0x0128('0x22')](function(_0x848023){if(_0x848023){return _0x848023['removeAgents'](_0x4e6419[_0x0128('0x44')]['ids'])[_0x0128('0x22')](function(){if(_[_0x0128('0xe2')](_0x4e6419['query']['ids'])){for(var _0x29a6a9=0x0;_0x29a6a9<_0x4e6419[_0x0128('0x44')]['ids'][_0x0128('0x49')];_0x29a6a9+=0x1){socket[_0x0128('0xdf')]('userSmsAccount:remove',{'UserId':Number(_0x4e6419[_0x0128('0x44')][_0x0128('0x6d')][_0x29a6a9]),'SmsAccountId':Number(_0x4e6419[_0x0128('0x58')]['id'])});}}else{socket[_0x0128('0xdf')]('userSmsAccount:remove',{'UserId':Number(_0x4e6419[_0x0128('0x44')][_0x0128('0x6d')]),'SmsAccountId':Number(_0x4e6419[_0x0128('0x58')]['id'])});}});}})[_0x0128('0x22')](respondWithStatusCode(_0x5bc92f,null))['catch'](handleError(_0x5bc92f,null));};exports['getAgents']=function(_0x3ebcda,_0x39b403,_0x1fa1f7){var _0x301f76={};var _0x20994e={};var _0x5ab0f2;var _0x1b9bf2;return db[_0x0128('0x5a')]['findOne']({'where':{'id':_0x3ebcda[_0x0128('0x58')]['id']}})['then'](handleEntityNotFound(_0x39b403,null))[_0x0128('0x22')](function(_0xb350fd){if(_0xb350fd){_0x5ab0f2=_0xb350fd;_0x20994e['model']=_[_0x0128('0x59')](db[_0x0128('0xab')][_0x0128('0x3f')]);_0x20994e[_0x0128('0x44')]=_['keys'](_0x3ebcda[_0x0128('0x44')]);_0x20994e['filters']=_[_0x0128('0x47')](_0x20994e[_0x0128('0x43')],_0x20994e[_0x0128('0x44')]);_0x301f76[_0x0128('0x46')]=_[_0x0128('0x47')](_0x20994e[_0x0128('0x43')],qs[_0x0128('0x48')](_0x3ebcda[_0x0128('0x44')][_0x0128('0x48')]));_0x301f76[_0x0128('0x46')]=_0x301f76[_0x0128('0x46')]['length']?_0x301f76[_0x0128('0x46')]:_0x20994e['model'];_0x301f76[_0x0128('0x4c')]=qs[_0x0128('0x4d')](_0x3ebcda[_0x0128('0x44')][_0x0128('0x4d')]);_0x301f76[_0x0128('0x4e')]=qs[_0x0128('0x45')](_[_0x0128('0x4f')](_0x3ebcda[_0x0128('0x44')],_0x20994e[_0x0128('0x45')]));if(_0x3ebcda['query'][_0x0128('0x52')]){_0x301f76[_0x0128('0x4e')]=_[_0x0128('0x50')](_0x301f76['where'],{'$or':_[_0x0128('0x3e')](_0x301f76[_0x0128('0x46')],function(_0x5711bb){var _0x231ebc={};_0x231ebc[_0x5711bb]={'$like':'%'+_0x3ebcda[_0x0128('0x44')][_0x0128('0x52')]+'%'};return _0x231ebc;})});}_0x301f76=_['merge']({},_0x301f76,_0x3ebcda[_0x0128('0x5c')]);return _0x5ab0f2[_0x0128('0xe3')](_0x301f76);}})[_0x0128('0x22')](function(_0x5c951b){if(_0x5c951b){_0x1b9bf2=_0x5c951b[_0x0128('0x49')];if(!_0x3ebcda[_0x0128('0x44')]['hasOwnProperty']('nolimit')){_0x301f76[_0x0128('0x30')]=qs[_0x0128('0x30')](_0x3ebcda[_0x0128('0x44')][_0x0128('0x30')]);_0x301f76[_0x0128('0x2f')]=qs['offset'](_0x3ebcda['query'][_0x0128('0x2f')]);}return _0x5ab0f2[_0x0128('0xe3')](_0x301f76);}})[_0x0128('0x22')](function(_0x47abc6){if(_0x47abc6){return _0x47abc6?{'count':_0x1b9bf2,'rows':_0x47abc6}:null;}})[_0x0128('0x22')](respondWithResult(_0x39b403,null))['catch'](handleError(_0x39b403,null));};
\ No newline at end of file
diff --git a/server/api/smsAccount/smsAccount.events.js b/server/api/smsAccount/smsAccount.events.js
index 2656f69..c057726 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 _0x938c=['setMaxListeners','save','remove','emit','hasOwnProperty','hook','events','../../mysqldb','SmsAccount'];(function(_0x20c110,_0x40281b){var _0xbf1ee2=function(_0x29d046){while(--_0x29d046){_0x20c110['push'](_0x20c110['shift']());}};_0xbf1ee2(++_0x40281b);}(_0x938c,0x7b));var _0xc938=function(_0x518f83,_0x3321b3){_0x518f83=_0x518f83-0x0;var _0x326c71=_0x938c[_0x518f83];return _0x326c71;};'use strict';var EventEmitter=require(_0xc938('0x0'));var SmsAccount=require(_0xc938('0x1'))['db'][_0xc938('0x2')];var SmsAccountEvents=new EventEmitter();SmsAccountEvents[_0xc938('0x3')](0x0);var events={'afterCreate':_0xc938('0x4'),'afterUpdate':'update','afterDestroy':_0xc938('0x5')};function emitEvent(_0x4f4813){return function(_0x4bfb51,_0x13dd20,_0x2d98c0){SmsAccountEvents[_0xc938('0x6')](_0x4f4813+':'+_0x4bfb51['id'],_0x4bfb51);SmsAccountEvents[_0xc938('0x6')](_0x4f4813,_0x4bfb51);_0x2d98c0(null);};}for(var e in events){if(events[_0xc938('0x7')](e)){var event=events[e];SmsAccount[_0xc938('0x8')](e,emitEvent(event));}}module['exports']=SmsAccountEvents;
\ No newline at end of file
+var _0x2670=['SmsAccount','setMaxListeners','save','emit','hasOwnProperty','hook','exports','../../mysqldb'];(function(_0x4a1dfc,_0x206662){var _0x40c67d=function(_0x4dcb32){while(--_0x4dcb32){_0x4a1dfc['push'](_0x4a1dfc['shift']());}};_0x40c67d(++_0x206662);}(_0x2670,0x67));var _0x0267=function(_0x5dd981,_0x38e6e0){_0x5dd981=_0x5dd981-0x0;var _0x3f0d66=_0x2670[_0x5dd981];return _0x3f0d66;};'use strict';var EventEmitter=require('events');var SmsAccount=require(_0x0267('0x0'))['db'][_0x0267('0x1')];var SmsAccountEvents=new EventEmitter();SmsAccountEvents[_0x0267('0x2')](0x0);var events={'afterCreate':_0x0267('0x3'),'afterUpdate':'update','afterDestroy':'remove'};function emitEvent(_0x3426c6){return function(_0x2c051d,_0x57a36a,_0x1e0a58){SmsAccountEvents[_0x0267('0x4')](_0x3426c6+':'+_0x2c051d['id'],_0x2c051d);SmsAccountEvents[_0x0267('0x4')](_0x3426c6,_0x2c051d);_0x1e0a58(null);};}for(var e in events){if(events[_0x0267('0x5')](e)){var event=events[e];SmsAccount[_0x0267('0x6')](e,emitEvent(event));}}module[_0x0267('0x7')]=SmsAccountEvents;
\ No newline at end of file
diff --git a/server/api/smsAccount/smsAccount.model.js b/server/api/smsAccount/smsAccount.model.js
index 79c10a1..d5c3a48 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 _0xf5d2=['util','../../config/logger','api','moment','bluebird','path','../../config/environment','define','SmsAccount','sms_accounts','lodash'];(function(_0x237a55,_0x5be399){var _0xe9b050=function(_0x2e86c5){while(--_0x2e86c5){_0x237a55['push'](_0x237a55['shift']());}};_0xe9b050(++_0x5be399);}(_0xf5d2,0xba));var _0x2f5d=function(_0x5f1b16,_0x5e7a9c){_0x5f1b16=_0x5f1b16-0x0;var _0x20389d=_0xf5d2[_0x5f1b16];return _0x20389d;};'use strict';var _=require(_0x2f5d('0x0'));var util=require(_0x2f5d('0x1'));var logger=require(_0x2f5d('0x2'))(_0x2f5d('0x3'));var moment=require(_0x2f5d('0x4'));var BPromise=require(_0x2f5d('0x5'));var rp=require('request-promise');var fs=require('fs');var path=require(_0x2f5d('0x6'));var rimraf=require('rimraf');var config=require(_0x2f5d('0x7'));var attributes=require('./smsAccount.attributes');module['exports']=function(_0x1393a0,_0x15ee1e){return _0x1393a0[_0x2f5d('0x8')](_0x2f5d('0x9'),attributes,{'tableName':_0x2f5d('0xa'),'paranoid':![],'indexes':[],'timestamps':!![]});};
\ No newline at end of file
+var _0x3b88=['moment','request-promise','path','rimraf','SmsAccount','sms_accounts','lodash','../../config/logger','api'];(function(_0xa464c9,_0x7c86d8){var _0x3d73c4=function(_0x5c2056){while(--_0x5c2056){_0xa464c9['push'](_0xa464c9['shift']());}};_0x3d73c4(++_0x7c86d8);}(_0x3b88,0xb1));var _0x83b8=function(_0x44f90b,_0x186088){_0x44f90b=_0x44f90b-0x0;var _0x10c90b=_0x3b88[_0x44f90b];return _0x10c90b;};'use strict';var _=require(_0x83b8('0x0'));var util=require('util');var logger=require(_0x83b8('0x1'))(_0x83b8('0x2'));var moment=require(_0x83b8('0x3'));var BPromise=require('bluebird');var rp=require(_0x83b8('0x4'));var fs=require('fs');var path=require(_0x83b8('0x5'));var rimraf=require(_0x83b8('0x6'));var config=require('../../config/environment');var attributes=require('./smsAccount.attributes');module['exports']=function(_0xc13037,_0x5e3de7){return _0xc13037['define'](_0x83b8('0x7'),attributes,{'tableName':_0x83b8('0x8'),'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 e3a4561..33ed64b 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 _0xef3e=['include','map','model','then','stringify','catch','lodash','util','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','rpc','../../config/environment','jayson/promise','client','http','redis','defaults','socket.io-emitter','./smsAccount.socket','register','request','info','SmsAccount,\x20%s,\x20%s','request\x20sent','debug','SmsAccount,\x20%s,\x20%s,\x20%s','error','message','result','ShowSmsAccount','SmsAccount','find','options','raw','where','attributes'];(function(_0x94a5f2,_0x4b447f){var _0x2a405b=function(_0xe598b5){while(--_0xe598b5){_0x94a5f2['push'](_0x94a5f2['shift']());}};_0x2a405b(++_0x4b447f);}(_0xef3e,0x7e));var _0xeef3=function(_0x101e7b,_0x4ef05b){_0x101e7b=_0x101e7b-0x0;var _0x4995c0=_0xef3e[_0x101e7b];return _0x4995c0;};'use strict';var _=require(_0xeef3('0x0'));var util=require(_0xeef3('0x1'));var moment=require(_0xeef3('0x2'));var BPromise=require(_0xeef3('0x3'));var rs=require(_0xeef3('0x4'));var fs=require('fs');var Redis=require(_0xeef3('0x5'));var db=require(_0xeef3('0x6'))['db'];var utils=require(_0xeef3('0x7'));var logger=require('../../config/logger')(_0xeef3('0x8'));var config=require(_0xeef3('0x9'));var jayson=require(_0xeef3('0xa'));var client=jayson[_0xeef3('0xb')][_0xeef3('0xc')]({'port':0x232a});config[_0xeef3('0xd')]=_[_0xeef3('0xe')](config[_0xeef3('0xd')],{'host':'localhost','port':0x18eb});var socket=require(_0xeef3('0xf'))(new Redis(config[_0xeef3('0xd')]));require(_0xeef3('0x10'))[_0xeef3('0x11')](socket);function respondWithRpcPromise(_0x3f10d8,_0x3ae907,_0x1221c0){return new BPromise(function(_0x4391a0,_0x4d2a05){return client[_0xeef3('0x12')](_0x3f10d8,_0x1221c0)['then'](function(_0x33c5f1){logger[_0xeef3('0x13')](_0xeef3('0x14'),_0x3ae907,_0xeef3('0x15'));logger[_0xeef3('0x16')](_0xeef3('0x17'),_0x3ae907,_0xeef3('0x15'),JSON['stringify'](_0x33c5f1));if(_0x33c5f1[_0xeef3('0x18')]){if(_0x33c5f1['error']['code']===0x1f4){logger[_0xeef3('0x18')](_0xeef3('0x14'),_0x3ae907,_0x33c5f1[_0xeef3('0x18')]['message']);return _0x4d2a05(_0x33c5f1['error'][_0xeef3('0x19')]);}logger[_0xeef3('0x18')](_0xeef3('0x14'),_0x3ae907,_0x33c5f1[_0xeef3('0x18')][_0xeef3('0x19')]);return _0x4391a0(_0x33c5f1[_0xeef3('0x18')][_0xeef3('0x19')]);}else{logger[_0xeef3('0x13')](_0xeef3('0x14'),_0x3ae907,'request\x20sent');_0x4391a0(_0x33c5f1[_0xeef3('0x1a')][_0xeef3('0x19')]);}})['catch'](function(_0x180388){logger['error'](_0xeef3('0x14'),_0x3ae907,_0x180388);_0x4d2a05(_0x180388);});});}exports[_0xeef3('0x1b')]=function(_0x304917){var _0x1707fe=this;return new Promise(function(_0x32b9e2,_0xebc36f){return db[_0xeef3('0x1c')][_0xeef3('0x1d')]({'raw':_0x304917[_0xeef3('0x1e')]?_0x304917[_0xeef3('0x1e')][_0xeef3('0x1f')]===undefined?!![]:![]:!![],'where':_0x304917[_0xeef3('0x1e')]?_0x304917['options'][_0xeef3('0x20')]||null:null,'attributes':_0x304917[_0xeef3('0x1e')]?_0x304917[_0xeef3('0x1e')][_0xeef3('0x21')]||null:null,'include':_0x304917['options']?_0x304917[_0xeef3('0x1e')][_0xeef3('0x22')]?_[_0xeef3('0x23')](_0x304917[_0xeef3('0x1e')][_0xeef3('0x22')],function(_0x445a8f){return{'model':db[_0x445a8f[_0xeef3('0x24')]],'as':_0x445a8f['as'],'attributes':_0x445a8f[_0xeef3('0x21')],'include':_0x445a8f['include']?_['map'](_0x445a8f[_0xeef3('0x22')],function(_0x809dc8){return{'model':db[_0x809dc8[_0xeef3('0x24')]],'as':_0x809dc8['as'],'attributes':_0x809dc8[_0xeef3('0x21')],'include':_0x809dc8['include']?_[_0xeef3('0x23')](_0x809dc8[_0xeef3('0x22')],function(_0x265448){return{'model':db[_0x265448[_0xeef3('0x24')]],'as':_0x265448['as'],'attributes':_0x265448[_0xeef3('0x21')]};}):[]};}):[]};}):[]:[]})[_0xeef3('0x25')](function(_0x404d9e){logger[_0xeef3('0x13')](_0xeef3('0x1b'),_0x304917);logger[_0xeef3('0x16')]('ShowSmsAccount',_0x304917,JSON[_0xeef3('0x26')](_0x404d9e));_0x32b9e2(_0x404d9e);})[_0xeef3('0x27')](function(_0x77a2bb){logger[_0xeef3('0x18')]('ShowSmsAccount',_0x77a2bb[_0xeef3('0x19')],_0x304917);_0xebc36f(_0x1707fe[_0xeef3('0x18')](0x1f4,_0x77a2bb[_0xeef3('0x19')]));});});};
\ No newline at end of file
+var _0xbcbf=['model','attributes','ShowSmsAccount','catch','lodash','util','moment','randomstring','ioredis','../../mysqldb','rpc','../../config/environment','jayson/promise','client','redis','localhost','socket.io-emitter','./smsAccount.socket','register','request','then','info','SmsAccount,\x20%s,\x20%s','debug','SmsAccount,\x20%s,\x20%s,\x20%s','stringify','error','code','message','request\x20sent','result','SmsAccount','where','options','include','map'];(function(_0xccfe05,_0x4e9342){var _0x4ad504=function(_0x15da1a){while(--_0x15da1a){_0xccfe05['push'](_0xccfe05['shift']());}};_0x4ad504(++_0x4e9342);}(_0xbcbf,0xb8));var _0xfbcb=function(_0x41568e,_0x5ab27b){_0x41568e=_0x41568e-0x0;var _0x40db40=_0xbcbf[_0x41568e];return _0x40db40;};'use strict';var _=require(_0xfbcb('0x0'));var util=require(_0xfbcb('0x1'));var moment=require(_0xfbcb('0x2'));var BPromise=require('bluebird');var rs=require(_0xfbcb('0x3'));var fs=require('fs');var Redis=require(_0xfbcb('0x4'));var db=require(_0xfbcb('0x5'))['db'];var utils=require('../../config/utils');var logger=require('../../config/logger')(_0xfbcb('0x6'));var config=require(_0xfbcb('0x7'));var jayson=require(_0xfbcb('0x8'));var client=jayson[_0xfbcb('0x9')]['http']({'port':0x232a});config[_0xfbcb('0xa')]=_['defaults'](config[_0xfbcb('0xa')],{'host':_0xfbcb('0xb'),'port':0x18eb});var socket=require(_0xfbcb('0xc'))(new Redis(config[_0xfbcb('0xa')]));require(_0xfbcb('0xd'))[_0xfbcb('0xe')](socket);function respondWithRpcPromise(_0x4920ed,_0x50431e,_0xb9286f){return new BPromise(function(_0x3e61bf,_0x3d8c3c){return client[_0xfbcb('0xf')](_0x4920ed,_0xb9286f)[_0xfbcb('0x10')](function(_0x2c7b88){logger[_0xfbcb('0x11')](_0xfbcb('0x12'),_0x50431e,'request\x20sent');logger[_0xfbcb('0x13')](_0xfbcb('0x14'),_0x50431e,'request\x20sent',JSON[_0xfbcb('0x15')](_0x2c7b88));if(_0x2c7b88[_0xfbcb('0x16')]){if(_0x2c7b88[_0xfbcb('0x16')][_0xfbcb('0x17')]===0x1f4){logger[_0xfbcb('0x16')](_0xfbcb('0x12'),_0x50431e,_0x2c7b88[_0xfbcb('0x16')]['message']);return _0x3d8c3c(_0x2c7b88[_0xfbcb('0x16')][_0xfbcb('0x18')]);}logger['error'](_0xfbcb('0x12'),_0x50431e,_0x2c7b88[_0xfbcb('0x16')]['message']);return _0x3e61bf(_0x2c7b88[_0xfbcb('0x16')][_0xfbcb('0x18')]);}else{logger[_0xfbcb('0x11')](_0xfbcb('0x12'),_0x50431e,_0xfbcb('0x19'));_0x3e61bf(_0x2c7b88[_0xfbcb('0x1a')]['message']);}})['catch'](function(_0x2a4054){logger[_0xfbcb('0x16')](_0xfbcb('0x12'),_0x50431e,_0x2a4054);_0x3d8c3c(_0x2a4054);});});}exports['ShowSmsAccount']=function(_0x101ffe){var _0xe28a9d=this;return new Promise(function(_0x15bc09,_0x46749d){return db[_0xfbcb('0x1b')]['find']({'raw':_0x101ffe['options']?_0x101ffe['options']['raw']===undefined?!![]:![]:!![],'where':_0x101ffe['options']?_0x101ffe['options'][_0xfbcb('0x1c')]||null:null,'attributes':_0x101ffe[_0xfbcb('0x1d')]?_0x101ffe['options']['attributes']||null:null,'include':_0x101ffe[_0xfbcb('0x1d')]?_0x101ffe[_0xfbcb('0x1d')][_0xfbcb('0x1e')]?_[_0xfbcb('0x1f')](_0x101ffe[_0xfbcb('0x1d')]['include'],function(_0x232ef5){return{'model':db[_0x232ef5[_0xfbcb('0x20')]],'as':_0x232ef5['as'],'attributes':_0x232ef5['attributes'],'include':_0x232ef5[_0xfbcb('0x1e')]?_[_0xfbcb('0x1f')](_0x232ef5[_0xfbcb('0x1e')],function(_0x2e2dc1){return{'model':db[_0x2e2dc1[_0xfbcb('0x20')]],'as':_0x2e2dc1['as'],'attributes':_0x2e2dc1[_0xfbcb('0x21')],'include':_0x2e2dc1['include']?_[_0xfbcb('0x1f')](_0x2e2dc1['include'],function(_0x32cdc8){return{'model':db[_0x32cdc8[_0xfbcb('0x20')]],'as':_0x32cdc8['as'],'attributes':_0x32cdc8['attributes']};}):[]};}):[]};}):[]:[]})[_0xfbcb('0x10')](function(_0x559a6d){logger[_0xfbcb('0x11')](_0xfbcb('0x22'),_0x101ffe);logger[_0xfbcb('0x13')]('ShowSmsAccount',_0x101ffe,JSON['stringify'](_0x559a6d));_0x15bc09(_0x559a6d);})[_0xfbcb('0x23')](function(_0x41d5c0){logger['error']('ShowSmsAccount',_0x41d5c0[_0xfbcb('0x18')],_0x101ffe);_0x46749d(_0xe28a9d['error'](0x1f4,_0x41d5c0[_0xfbcb('0x18')]));});});};
\ No newline at end of file
diff --git a/server/api/smsAccount/smsAccount.socket.js b/server/api/smsAccount/smsAccount.socket.js
index 7df1ce2..514f1d0 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 _0x36ee=['register','length','remove','emit','removeListener'];(function(_0x4d047b,_0x497358){var _0x21e770=function(_0x4125ee){while(--_0x4125ee){_0x4d047b['push'](_0x4d047b['shift']());}};_0x21e770(++_0x497358);}(_0x36ee,0xe8));var _0xe36e=function(_0x5b644e,_0x2e5e07){_0x5b644e=_0x5b644e-0x0;var _0x49c6bf=_0x36ee[_0x5b644e];return _0x49c6bf;};'use strict';var SmsAccountEvents=require('./smsAccount.events');var events=['save',_0xe36e('0x0'),'update'];function createListener(_0xf6b517,_0x4018bf){return function(_0x36c9f6){_0x4018bf[_0xe36e('0x1')](_0xf6b517,_0x36c9f6);};}function removeListener(_0x567a84,_0x1118af){return function(){SmsAccountEvents[_0xe36e('0x2')](_0x567a84,_0x1118af);};}exports[_0xe36e('0x3')]=function(_0x25a07d){for(var _0x190404=0x0,_0x21be0b=events[_0xe36e('0x4')];_0x190404<_0x21be0b;_0x190404++){var _0x51b4bd=events[_0x190404];var _0x74b4b7=createListener('smsAccount:'+_0x51b4bd,_0x25a07d);SmsAccountEvents['on'](_0x51b4bd,_0x74b4b7);}};
\ No newline at end of file
+var _0xc610=['smsAccount:','./smsAccount.events','save','remove','update','emit','removeListener','length'];(function(_0x3aaf69,_0x318ff9){var _0x4542c6=function(_0x5d1369){while(--_0x5d1369){_0x3aaf69['push'](_0x3aaf69['shift']());}};_0x4542c6(++_0x318ff9);}(_0xc610,0x1d9));var _0x0c61=function(_0x17a208,_0x5302df){_0x17a208=_0x17a208-0x0;var _0x1f7f67=_0xc610[_0x17a208];return _0x1f7f67;};'use strict';var SmsAccountEvents=require(_0x0c61('0x0'));var events=[_0x0c61('0x1'),_0x0c61('0x2'),_0x0c61('0x3')];function createListener(_0x495f28,_0x2e6a30){return function(_0x31a22e){_0x2e6a30[_0x0c61('0x4')](_0x495f28,_0x31a22e);};}function removeListener(_0x3c48bd,_0x4a13b0){return function(){SmsAccountEvents[_0x0c61('0x5')](_0x3c48bd,_0x4a13b0);};}exports['register']=function(_0x4390bd){for(var _0x1e654c=0x0,_0x1d95ad=events[_0x0c61('0x6')];_0x1e654c<_0x1d95ad;_0x1e654c++){var _0x499cae=events[_0x1e654c];var _0x26f1de=createListener(_0x0c61('0x7')+_0x499cae,_0x4390bd);SmsAccountEvents['on'](_0x499cae,_0x26f1de);}};
\ No newline at end of file
diff --git a/server/api/smsApplication/index.js b/server/api/smsApplication/index.js
index 8dfd02f..9483ad3 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 _0x8f99=['../../components/auth/service','../../components/interaction/service','../../config/environment','get','isAuthenticated','index','show','post','create','put','/:id','update','delete','destroy','exports','multer','util','connect-timeout','express','Router'];(function(_0x4daa44,_0x29bbef){var _0x4d6a6f=function(_0x5ebede){while(--_0x5ebede){_0x4daa44['push'](_0x4daa44['shift']());}};_0x4d6a6f(++_0x29bbef);}(_0x8f99,0xff));var _0x98f9=function(_0x28218d,_0x2b871b){_0x28218d=_0x28218d-0x0;var _0x4cc02c=_0x8f99[_0x28218d];return _0x4cc02c;};'use strict';var multer=require(_0x98f9('0x0'));var util=require(_0x98f9('0x1'));var path=require('path');var timeout=require(_0x98f9('0x2'));var express=require(_0x98f9('0x3'));var router=express[_0x98f9('0x4')]();var auth=require(_0x98f9('0x5'));var interaction=require(_0x98f9('0x6'));var config=require(_0x98f9('0x7'));var controller=require('./smsApplication.controller');router[_0x98f9('0x8')]('/',auth[_0x98f9('0x9')](),controller[_0x98f9('0xa')]);router[_0x98f9('0x8')]('/:id',auth[_0x98f9('0x9')](),controller[_0x98f9('0xb')]);router[_0x98f9('0xc')]('/',auth[_0x98f9('0x9')](),controller[_0x98f9('0xd')]);router[_0x98f9('0xe')](_0x98f9('0xf'),auth[_0x98f9('0x9')](),controller[_0x98f9('0x10')]);router[_0x98f9('0x11')](_0x98f9('0xf'),auth[_0x98f9('0x9')](),controller[_0x98f9('0x12')]);module[_0x98f9('0x13')]=router;
\ No newline at end of file
+var _0x3175=['util','connect-timeout','express','Router','../../components/interaction/service','../../config/environment','./smsApplication.controller','get','isAuthenticated','index','/:id','show','create','put','update','destroy','multer'];(function(_0x2c00e2,_0x4294ad){var _0x58419d=function(_0x233775){while(--_0x233775){_0x2c00e2['push'](_0x2c00e2['shift']());}};_0x58419d(++_0x4294ad);}(_0x3175,0x1ca));var _0x5317=function(_0x45096e,_0x17e82d){_0x45096e=_0x45096e-0x0;var _0xba1fa3=_0x3175[_0x45096e];return _0xba1fa3;};'use strict';var multer=require(_0x5317('0x0'));var util=require(_0x5317('0x1'));var path=require('path');var timeout=require(_0x5317('0x2'));var express=require(_0x5317('0x3'));var router=express[_0x5317('0x4')]();var auth=require('../../components/auth/service');var interaction=require(_0x5317('0x5'));var config=require(_0x5317('0x6'));var controller=require(_0x5317('0x7'));router[_0x5317('0x8')]('/',auth[_0x5317('0x9')](),controller[_0x5317('0xa')]);router[_0x5317('0x8')](_0x5317('0xb'),auth[_0x5317('0x9')](),controller[_0x5317('0xc')]);router['post']('/',auth[_0x5317('0x9')](),controller[_0x5317('0xd')]);router[_0x5317('0xe')](_0x5317('0xb'),auth['isAuthenticated'](),controller[_0x5317('0xf')]);router['delete'](_0x5317('0xb'),auth[_0x5317('0x9')](),controller[_0x5317('0x10')]);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 7bb3c32..47e7104 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 _0x7300=['sequelize','exports','INTEGER','TEXT','STRING'];(function(_0x3dd15e,_0x1f0015){var _0x231fd0=function(_0x4f680a){while(--_0x4f680a){_0x3dd15e['push'](_0x3dd15e['shift']());}};_0x231fd0(++_0x1f0015);}(_0x7300,0x96));var _0x0730=function(_0x598b5f,_0x448926){_0x598b5f=_0x598b5f-0x0;var _0x157e81=_0x7300[_0x598b5f];return _0x157e81;};'use strict';var Sequelize=require(_0x0730('0x0'));module[_0x0730('0x1')]={'priority':{'type':Sequelize[_0x0730('0x2')],'allowNull':![]},'app':{'type':Sequelize['STRING'],'allowNull':![],'defaultValue':'noop'},'appdata':{'type':Sequelize[_0x0730('0x3')]()},'description':{'type':Sequelize[_0x0730('0x4')]},'interval':{'type':Sequelize[_0x0730('0x4')],'defaultValue':'*,*,*,*'}};
\ No newline at end of file
+var _0xe82f=['TEXT','exports','STRING','noop'];(function(_0x5f746f,_0x5b05ab){var _0x198d15=function(_0x58c7e7){while(--_0x58c7e7){_0x5f746f['push'](_0x5f746f['shift']());}};_0x198d15(++_0x5b05ab);}(_0xe82f,0x199));var _0xfe82=function(_0x55bf83,_0x5b2adf){_0x55bf83=_0x55bf83-0x0;var _0x2ed8f7=_0xe82f[_0x55bf83];return _0x2ed8f7;};'use strict';var Sequelize=require('sequelize');module[_0xfe82('0x0')]={'priority':{'type':Sequelize['INTEGER'],'allowNull':![]},'app':{'type':Sequelize[_0xfe82('0x1')],'allowNull':![],'defaultValue':_0xfe82('0x2')},'appdata':{'type':Sequelize[_0xfe82('0x3')]()},'description':{'type':Sequelize['STRING']},'interval':{'type':Sequelize[_0xfe82('0x1')],'defaultValue':'*,*,*,*'}};
\ No newline at end of file
diff --git a/server/api/smsApplication/smsApplication.controller.js b/server/api/smsApplication/smsApplication.controller.js
index ba12e9a..11ae7d3 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 _0xfdc6=['status','set','Content-Range','apply','reject','save','destroy','then','error','stack','name','index','map','key','model','query','keys','filters','attributes','intersection','fields','hasOwnProperty','nolimit','limit','order','sort','where','pick','filter','merge','type','VIRTUAL','options','includeAll','include','SmsApplication','findAll','rows','catch','show','params','length','find','body','update','html-pdf','eml-format','rimraf','fast-json-patch','bluebird','util','path','sox','lodash','jsforce','to-csv','querystring','papaparse','../../components/auth/service','../../components/parsers/qs','../../config/license/hardware','../../config/logger','api','../../config/environment','../../mysqldb','sendStatus','end','json','count','offset'];(function(_0x12d544,_0x2f454f){var _0x8fb9df=function(_0x4140cd){while(--_0x4140cd){_0x12d544['push'](_0x12d544['shift']());}};_0x8fb9df(++_0x2f454f);}(_0xfdc6,0x1d1));var _0x6fdc=function(_0x439662,_0x5defdb){_0x439662=_0x439662-0x0;var _0x251ec4=_0xfdc6[_0x439662];return _0x251ec4;};'use strict';var pdf=require(_0x6fdc('0x0'));var emlformat=require(_0x6fdc('0x1'));var rimraf=require(_0x6fdc('0x2'));var zipdir=require('zip-dir');var jsonpatch=require(_0x6fdc('0x3'));var rp=require('request-promise');var moment=require('moment');var BPromise=require(_0x6fdc('0x4'));var Mustache=require('mustache');var util=require(_0x6fdc('0x5'));var path=require(_0x6fdc('0x6'));var sox=require(_0x6fdc('0x7'));var csv=require('to-csv');var ejs=require('ejs');var fs=require('fs');var _=require(_0x6fdc('0x8'));var squel=require('squel');var crypto=require('crypto');var jsforce=require(_0x6fdc('0x9'));var deskjs=require('desk.js');var toCsv=require(_0x6fdc('0xa'));var querystring=require(_0x6fdc('0xb'));var Papa=require(_0x6fdc('0xc'));var Redis=require('ioredis');var authService=require(_0x6fdc('0xd'));var qs=require(_0x6fdc('0xe'));var as=require('../../components/parsers/advancedSearch');var hardwareService=require(_0x6fdc('0xf'));var logger=require(_0x6fdc('0x10'))(_0x6fdc('0x11'));var utils=require('../../config/utils');var config=require(_0x6fdc('0x12'));var db=require(_0x6fdc('0x13'))['db'];function respondWithStatusCode(_0x4e405e,_0x4e3ba6){_0x4e3ba6=_0x4e3ba6||0xcc;return function(_0xa738a0){if(_0xa738a0){return _0x4e405e[_0x6fdc('0x14')](_0x4e3ba6);}return _0x4e405e['status'](_0x4e3ba6)[_0x6fdc('0x15')]();};}function respondWithResult(_0x25e8ee,_0x454d1a){_0x454d1a=_0x454d1a||0xc8;return function(_0xb8762d){if(_0xb8762d){return _0x25e8ee['status'](_0x454d1a)[_0x6fdc('0x16')](_0xb8762d);}};}function respondWithFilteredResult(_0x28d5f1,_0x496de1){return function(_0x19d6ff){if(_0x19d6ff){var _0x111a77=_0x19d6ff[_0x6fdc('0x17')],_0x3c7e57=_0x496de1['offset'],_0x2b0a0d=_0x496de1[_0x6fdc('0x18')]+_0x496de1['limit'],_0x527aca;if(_0x2b0a0d>=_0x111a77){_0x2b0a0d=_0x111a77;_0x527aca=0xc8;}else{_0x527aca=0xce;}_0x28d5f1[_0x6fdc('0x19')](_0x527aca);return _0x28d5f1[_0x6fdc('0x1a')](_0x6fdc('0x1b'),_0x3c7e57+'-'+_0x2b0a0d+'/'+_0x111a77)['json'](_0x19d6ff);}return null;};}function patchUpdates(_0x3d6610){return function(_0x4be27e){try{jsonpatch[_0x6fdc('0x1c')](_0x4be27e,_0x3d6610,!![]);}catch(_0xee6577){return BPromise[_0x6fdc('0x1d')](_0xee6577);}return _0x4be27e[_0x6fdc('0x1e')]();};}function saveUpdates(_0x9619af,_0x35345e){return function(_0x529b0b){if(_0x529b0b){return _0x529b0b['update'](_0x9619af)['then'](function(_0x5ced56){return _0x5ced56;});}return null;};}function removeEntity(_0x1ffc07,_0x287a09){return function(_0x1a4776){if(_0x1a4776){return _0x1a4776[_0x6fdc('0x1f')]()[_0x6fdc('0x20')](function(){_0x1ffc07[_0x6fdc('0x19')](0xcc)[_0x6fdc('0x15')]();});}};}function handleEntityNotFound(_0x29df30,_0x382f96){return function(_0x2d8675){if(!_0x2d8675){_0x29df30[_0x6fdc('0x14')](0x194);}return _0x2d8675;};}function handleError(_0x3ee871,_0x5e5ae0){_0x5e5ae0=_0x5e5ae0||0x1f4;return function(_0x21f558){logger[_0x6fdc('0x21')](_0x21f558[_0x6fdc('0x22')]);if(_0x21f558[_0x6fdc('0x23')]){delete _0x21f558[_0x6fdc('0x23')];}_0x3ee871[_0x6fdc('0x19')](_0x5e5ae0)['send'](_0x21f558);};}exports[_0x6fdc('0x24')]=function(_0x9e1538,_0x2659dc){var _0x15c1fd={},_0x49eb5b={},_0x1e485c={'count':0x0,'rows':[]};var _0x5f17db=_[_0x6fdc('0x25')](db['SmsApplication']['rawAttributes'],function(_0x25c0bb){return{'name':_0x25c0bb['fieldName'],'type':_0x25c0bb['type'][_0x6fdc('0x26')]};});_0x49eb5b[_0x6fdc('0x27')]=_[_0x6fdc('0x25')](_0x5f17db,_0x6fdc('0x23'));_0x49eb5b[_0x6fdc('0x28')]=_[_0x6fdc('0x29')](_0x9e1538[_0x6fdc('0x28')]);_0x49eb5b[_0x6fdc('0x2a')]=_['intersection'](_0x49eb5b['model'],_0x49eb5b['query']);_0x15c1fd[_0x6fdc('0x2b')]=_[_0x6fdc('0x2c')](_0x49eb5b[_0x6fdc('0x27')],qs[_0x6fdc('0x2d')](_0x9e1538['query'][_0x6fdc('0x2d')]));_0x15c1fd[_0x6fdc('0x2b')]=_0x15c1fd[_0x6fdc('0x2b')]['length']?_0x15c1fd[_0x6fdc('0x2b')]:_0x49eb5b[_0x6fdc('0x27')];if(!_0x9e1538['query'][_0x6fdc('0x2e')](_0x6fdc('0x2f'))){_0x15c1fd[_0x6fdc('0x30')]=qs[_0x6fdc('0x30')](_0x9e1538['query']['limit']);_0x15c1fd['offset']=qs[_0x6fdc('0x18')](_0x9e1538[_0x6fdc('0x28')][_0x6fdc('0x18')]);}_0x15c1fd[_0x6fdc('0x31')]=qs[_0x6fdc('0x32')](_0x9e1538[_0x6fdc('0x28')][_0x6fdc('0x32')]);_0x15c1fd[_0x6fdc('0x33')]=qs[_0x6fdc('0x2a')](_[_0x6fdc('0x34')](_0x9e1538[_0x6fdc('0x28')],_0x49eb5b[_0x6fdc('0x2a')]));if(_0x9e1538[_0x6fdc('0x28')][_0x6fdc('0x35')]){_0x15c1fd[_0x6fdc('0x33')]=_[_0x6fdc('0x36')](_0x15c1fd[_0x6fdc('0x33')],{'$or':_[_0x6fdc('0x25')](_0x5f17db,function(_0x2e1b97){if(_0x2e1b97[_0x6fdc('0x37')]!==_0x6fdc('0x38')){var _0x11654e={};_0x11654e[_0x2e1b97[_0x6fdc('0x23')]]={'$like':'%'+_0x9e1538[_0x6fdc('0x28')][_0x6fdc('0x35')]+'%'};return _0x11654e;}})});}_0x15c1fd=_[_0x6fdc('0x36')]({},_0x15c1fd,_0x9e1538[_0x6fdc('0x39')]);var _0x25e5ef={'where':_0x15c1fd[_0x6fdc('0x33')]};return db['SmsApplication']['count'](_0x25e5ef)['then'](function(_0x43c67d){_0x1e485c[_0x6fdc('0x17')]=_0x43c67d;if(_0x9e1538[_0x6fdc('0x28')][_0x6fdc('0x3a')]){_0x15c1fd[_0x6fdc('0x3b')]=[{'all':!![]}];}return db[_0x6fdc('0x3c')][_0x6fdc('0x3d')](_0x15c1fd);})[_0x6fdc('0x20')](function(_0x11dfef){_0x1e485c[_0x6fdc('0x3e')]=_0x11dfef;return _0x1e485c;})[_0x6fdc('0x20')](respondWithFilteredResult(_0x2659dc,_0x15c1fd))[_0x6fdc('0x3f')](handleError(_0x2659dc,null));};exports[_0x6fdc('0x40')]=function(_0x15434f,_0x69c3ff){var _0x5b466f={'raw':!![],'where':{'id':_0x15434f[_0x6fdc('0x41')]['id']}},_0x787757={};_0x787757['model']=_['keys'](db['SmsApplication']['rawAttributes']);_0x787757['query']=_['keys'](_0x15434f[_0x6fdc('0x28')]);_0x787757['filters']=_[_0x6fdc('0x2c')](_0x787757[_0x6fdc('0x27')],_0x787757[_0x6fdc('0x28')]);_0x5b466f[_0x6fdc('0x2b')]=_[_0x6fdc('0x2c')](_0x787757[_0x6fdc('0x27')],qs[_0x6fdc('0x2d')](_0x15434f[_0x6fdc('0x28')][_0x6fdc('0x2d')]));_0x5b466f['attributes']=_0x5b466f[_0x6fdc('0x2b')][_0x6fdc('0x42')]?_0x5b466f[_0x6fdc('0x2b')]:_0x787757[_0x6fdc('0x27')];if(_0x15434f[_0x6fdc('0x28')][_0x6fdc('0x3a')]){_0x5b466f[_0x6fdc('0x3b')]=[{'all':!![]}];}_0x5b466f=_[_0x6fdc('0x36')]({},_0x5b466f,_0x15434f[_0x6fdc('0x39')]);return db[_0x6fdc('0x3c')][_0x6fdc('0x43')](_0x5b466f)[_0x6fdc('0x20')](handleEntityNotFound(_0x69c3ff,null))[_0x6fdc('0x20')](respondWithResult(_0x69c3ff,null))['catch'](handleError(_0x69c3ff,null));};exports['create']=function(_0x35c0aa,_0x50b900){return db[_0x6fdc('0x3c')]['create'](_0x35c0aa[_0x6fdc('0x44')],{})[_0x6fdc('0x20')](respondWithResult(_0x50b900,0xc9))[_0x6fdc('0x3f')](handleError(_0x50b900,null));};exports[_0x6fdc('0x45')]=function(_0x3262e8,_0x3e0fd4){if(_0x3262e8[_0x6fdc('0x44')]['id']){delete _0x3262e8[_0x6fdc('0x44')]['id'];}return db[_0x6fdc('0x3c')][_0x6fdc('0x43')]({'where':{'id':_0x3262e8[_0x6fdc('0x41')]['id']}})[_0x6fdc('0x20')](handleEntityNotFound(_0x3e0fd4,null))[_0x6fdc('0x20')](saveUpdates(_0x3262e8[_0x6fdc('0x44')],null))[_0x6fdc('0x20')](respondWithResult(_0x3e0fd4,null))[_0x6fdc('0x3f')](handleError(_0x3e0fd4,null));};exports[_0x6fdc('0x1f')]=function(_0x34412d,_0xeec59a){return db['SmsApplication']['find']({'where':{'id':_0x34412d['params']['id']}})[_0x6fdc('0x20')](handleEntityNotFound(_0xeec59a,null))[_0x6fdc('0x20')](removeEntity(_0xeec59a,null))[_0x6fdc('0x3f')](handleError(_0xeec59a,null));};
\ No newline at end of file
+var _0xfb21=['params','find','create','body','catch','html-pdf','rimraf','fast-json-patch','request-promise','bluebird','util','path','sox','to-csv','lodash','squel','crypto','desk.js','querystring','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/logger','api','../../config/environment','../../mysqldb','sendStatus','status','end','offset','set','Content-Range','json','reject','save','update','then','destroy','error','stack','name','send','index','map','rawAttributes','fieldName','type','model','query','keys','filters','intersection','fields','attributes','length','nolimit','limit','order','sort','where','pick','filter','merge','options','SmsApplication','count','includeAll','include','findAll','rows'];(function(_0x5522ef,_0x1282ed){var _0x45083a=function(_0x5f4e31){while(--_0x5f4e31){_0x5522ef['push'](_0x5522ef['shift']());}};_0x45083a(++_0x1282ed);}(_0xfb21,0xda));var _0x1fb2=function(_0x2564ad,_0xcd95a0){_0x2564ad=_0x2564ad-0x0;var _0x5ec4aa=_0xfb21[_0x2564ad];return _0x5ec4aa;};'use strict';var pdf=require(_0x1fb2('0x0'));var emlformat=require('eml-format');var rimraf=require(_0x1fb2('0x1'));var zipdir=require('zip-dir');var jsonpatch=require(_0x1fb2('0x2'));var rp=require(_0x1fb2('0x3'));var moment=require('moment');var BPromise=require(_0x1fb2('0x4'));var Mustache=require('mustache');var util=require(_0x1fb2('0x5'));var path=require(_0x1fb2('0x6'));var sox=require(_0x1fb2('0x7'));var csv=require(_0x1fb2('0x8'));var ejs=require('ejs');var fs=require('fs');var _=require(_0x1fb2('0x9'));var squel=require(_0x1fb2('0xa'));var crypto=require(_0x1fb2('0xb'));var jsforce=require('jsforce');var deskjs=require(_0x1fb2('0xc'));var toCsv=require(_0x1fb2('0x8'));var querystring=require(_0x1fb2('0xd'));var Papa=require('papaparse');var Redis=require(_0x1fb2('0xe'));var authService=require(_0x1fb2('0xf'));var qs=require(_0x1fb2('0x10'));var as=require(_0x1fb2('0x11'));var hardwareService=require('../../config/license/hardware');var logger=require(_0x1fb2('0x12'))(_0x1fb2('0x13'));var utils=require('../../config/utils');var config=require(_0x1fb2('0x14'));var db=require(_0x1fb2('0x15'))['db'];function respondWithStatusCode(_0x1ec5a9,_0x307899){_0x307899=_0x307899||0xcc;return function(_0x17d4c6){if(_0x17d4c6){return _0x1ec5a9[_0x1fb2('0x16')](_0x307899);}return _0x1ec5a9[_0x1fb2('0x17')](_0x307899)[_0x1fb2('0x18')]();};}function respondWithResult(_0x8d521f,_0x27ee4e){_0x27ee4e=_0x27ee4e||0xc8;return function(_0x2cd5dd){if(_0x2cd5dd){return _0x8d521f[_0x1fb2('0x17')](_0x27ee4e)['json'](_0x2cd5dd);}};}function respondWithFilteredResult(_0x3121aa,_0x4be3a9){return function(_0x409edb){if(_0x409edb){var _0x26c415=_0x409edb['count'],_0x1f13e9=_0x4be3a9[_0x1fb2('0x19')],_0x17ff57=_0x4be3a9[_0x1fb2('0x19')]+_0x4be3a9['limit'],_0x14946a;if(_0x17ff57>=_0x26c415){_0x17ff57=_0x26c415;_0x14946a=0xc8;}else{_0x14946a=0xce;}_0x3121aa[_0x1fb2('0x17')](_0x14946a);return _0x3121aa[_0x1fb2('0x1a')](_0x1fb2('0x1b'),_0x1f13e9+'-'+_0x17ff57+'/'+_0x26c415)[_0x1fb2('0x1c')](_0x409edb);}return null;};}function patchUpdates(_0x408385){return function(_0x43e835){try{jsonpatch['apply'](_0x43e835,_0x408385,!![]);}catch(_0x2e57ab){return BPromise[_0x1fb2('0x1d')](_0x2e57ab);}return _0x43e835[_0x1fb2('0x1e')]();};}function saveUpdates(_0x2e654d,_0x5b4954){return function(_0x97316a){if(_0x97316a){return _0x97316a[_0x1fb2('0x1f')](_0x2e654d)[_0x1fb2('0x20')](function(_0x384296){return _0x384296;});}return null;};}function removeEntity(_0x536296,_0x2e1f38){return function(_0x4d6529){if(_0x4d6529){return _0x4d6529[_0x1fb2('0x21')]()[_0x1fb2('0x20')](function(){_0x536296[_0x1fb2('0x17')](0xcc)[_0x1fb2('0x18')]();});}};}function handleEntityNotFound(_0x569a17,_0x2d611c){return function(_0x584d2f){if(!_0x584d2f){_0x569a17[_0x1fb2('0x16')](0x194);}return _0x584d2f;};}function handleError(_0x560c7d,_0xa3071e){_0xa3071e=_0xa3071e||0x1f4;return function(_0x4f226c){logger[_0x1fb2('0x22')](_0x4f226c[_0x1fb2('0x23')]);if(_0x4f226c['name']){delete _0x4f226c[_0x1fb2('0x24')];}_0x560c7d['status'](_0xa3071e)[_0x1fb2('0x25')](_0x4f226c);};}exports[_0x1fb2('0x26')]=function(_0x10d42f,_0x398ba1){var _0x251292={},_0x301ea4={},_0x39024e={'count':0x0,'rows':[]};var _0x44675d=_[_0x1fb2('0x27')](db['SmsApplication'][_0x1fb2('0x28')],function(_0x2a83e1){return{'name':_0x2a83e1[_0x1fb2('0x29')],'type':_0x2a83e1[_0x1fb2('0x2a')]['key']};});_0x301ea4[_0x1fb2('0x2b')]=_['map'](_0x44675d,'name');_0x301ea4[_0x1fb2('0x2c')]=_[_0x1fb2('0x2d')](_0x10d42f['query']);_0x301ea4[_0x1fb2('0x2e')]=_[_0x1fb2('0x2f')](_0x301ea4[_0x1fb2('0x2b')],_0x301ea4['query']);_0x251292['attributes']=_[_0x1fb2('0x2f')](_0x301ea4[_0x1fb2('0x2b')],qs[_0x1fb2('0x30')](_0x10d42f['query'][_0x1fb2('0x30')]));_0x251292['attributes']=_0x251292[_0x1fb2('0x31')][_0x1fb2('0x32')]?_0x251292[_0x1fb2('0x31')]:_0x301ea4['model'];if(!_0x10d42f[_0x1fb2('0x2c')]['hasOwnProperty'](_0x1fb2('0x33'))){_0x251292[_0x1fb2('0x34')]=qs['limit'](_0x10d42f['query'][_0x1fb2('0x34')]);_0x251292[_0x1fb2('0x19')]=qs[_0x1fb2('0x19')](_0x10d42f[_0x1fb2('0x2c')][_0x1fb2('0x19')]);}_0x251292[_0x1fb2('0x35')]=qs[_0x1fb2('0x36')](_0x10d42f[_0x1fb2('0x2c')][_0x1fb2('0x36')]);_0x251292[_0x1fb2('0x37')]=qs[_0x1fb2('0x2e')](_[_0x1fb2('0x38')](_0x10d42f[_0x1fb2('0x2c')],_0x301ea4[_0x1fb2('0x2e')]));if(_0x10d42f[_0x1fb2('0x2c')][_0x1fb2('0x39')]){_0x251292[_0x1fb2('0x37')]=_['merge'](_0x251292[_0x1fb2('0x37')],{'$or':_[_0x1fb2('0x27')](_0x44675d,function(_0x3e5fe2){if(_0x3e5fe2[_0x1fb2('0x2a')]!=='VIRTUAL'){var _0x45078c={};_0x45078c[_0x3e5fe2[_0x1fb2('0x24')]]={'$like':'%'+_0x10d42f[_0x1fb2('0x2c')][_0x1fb2('0x39')]+'%'};return _0x45078c;}})});}_0x251292=_[_0x1fb2('0x3a')]({},_0x251292,_0x10d42f[_0x1fb2('0x3b')]);var _0x1e396d={'where':_0x251292[_0x1fb2('0x37')]};return db[_0x1fb2('0x3c')][_0x1fb2('0x3d')](_0x1e396d)[_0x1fb2('0x20')](function(_0x2647f){_0x39024e[_0x1fb2('0x3d')]=_0x2647f;if(_0x10d42f['query'][_0x1fb2('0x3e')]){_0x251292[_0x1fb2('0x3f')]=[{'all':!![]}];}return db[_0x1fb2('0x3c')][_0x1fb2('0x40')](_0x251292);})[_0x1fb2('0x20')](function(_0x12ca28){_0x39024e[_0x1fb2('0x41')]=_0x12ca28;return _0x39024e;})[_0x1fb2('0x20')](respondWithFilteredResult(_0x398ba1,_0x251292))['catch'](handleError(_0x398ba1,null));};exports['show']=function(_0x1b8f26,_0x3ae669){var _0x206833={'raw':!![],'where':{'id':_0x1b8f26[_0x1fb2('0x42')]['id']}},_0x216f70={};_0x216f70['model']=_[_0x1fb2('0x2d')](db[_0x1fb2('0x3c')]['rawAttributes']);_0x216f70[_0x1fb2('0x2c')]=_[_0x1fb2('0x2d')](_0x1b8f26['query']);_0x216f70[_0x1fb2('0x2e')]=_['intersection'](_0x216f70[_0x1fb2('0x2b')],_0x216f70['query']);_0x206833[_0x1fb2('0x31')]=_[_0x1fb2('0x2f')](_0x216f70[_0x1fb2('0x2b')],qs[_0x1fb2('0x30')](_0x1b8f26[_0x1fb2('0x2c')]['fields']));_0x206833[_0x1fb2('0x31')]=_0x206833['attributes'][_0x1fb2('0x32')]?_0x206833['attributes']:_0x216f70[_0x1fb2('0x2b')];if(_0x1b8f26['query'][_0x1fb2('0x3e')]){_0x206833[_0x1fb2('0x3f')]=[{'all':!![]}];}_0x206833=_[_0x1fb2('0x3a')]({},_0x206833,_0x1b8f26[_0x1fb2('0x3b')]);return db[_0x1fb2('0x3c')][_0x1fb2('0x43')](_0x206833)[_0x1fb2('0x20')](handleEntityNotFound(_0x3ae669,null))['then'](respondWithResult(_0x3ae669,null))['catch'](handleError(_0x3ae669,null));};exports[_0x1fb2('0x44')]=function(_0x154099,_0x337ee8){return db[_0x1fb2('0x3c')][_0x1fb2('0x44')](_0x154099[_0x1fb2('0x45')],{})[_0x1fb2('0x20')](respondWithResult(_0x337ee8,0xc9))['catch'](handleError(_0x337ee8,null));};exports[_0x1fb2('0x1f')]=function(_0x5ec409,_0x1530b5){if(_0x5ec409[_0x1fb2('0x45')]['id']){delete _0x5ec409[_0x1fb2('0x45')]['id'];}return db[_0x1fb2('0x3c')][_0x1fb2('0x43')]({'where':{'id':_0x5ec409[_0x1fb2('0x42')]['id']}})[_0x1fb2('0x20')](handleEntityNotFound(_0x1530b5,null))[_0x1fb2('0x20')](saveUpdates(_0x5ec409['body'],null))[_0x1fb2('0x20')](respondWithResult(_0x1530b5,null))[_0x1fb2('0x46')](handleError(_0x1530b5,null));};exports[_0x1fb2('0x21')]=function(_0x57b88e,_0x3deae2){return db[_0x1fb2('0x3c')][_0x1fb2('0x43')]({'where':{'id':_0x57b88e['params']['id']}})[_0x1fb2('0x20')](handleEntityNotFound(_0x3deae2,null))[_0x1fb2('0x20')](removeEntity(_0x3deae2,null))['catch'](handleError(_0x3deae2,null));};
\ No newline at end of file
diff --git a/server/api/smsApplication/smsApplication.model.js b/server/api/smsApplication/smsApplication.model.js
index f2cb47a..2ad840c 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 _0x5c64=['util','api','moment','bluebird','path','rimraf','../../config/environment','./smsApplication.attributes','exports','sms_applications','utf8mb4','utf8mb4_unicode_ci','lodash'];(function(_0x2c74e2,_0x78daf1){var _0x14e004=function(_0x53ed83){while(--_0x53ed83){_0x2c74e2['push'](_0x2c74e2['shift']());}};_0x14e004(++_0x78daf1);}(_0x5c64,0x192));var _0x45c6=function(_0x97e565,_0x138060){_0x97e565=_0x97e565-0x0;var _0x39031c=_0x5c64[_0x97e565];return _0x39031c;};'use strict';var _=require(_0x45c6('0x0'));var util=require(_0x45c6('0x1'));var logger=require('../../config/logger')(_0x45c6('0x2'));var moment=require(_0x45c6('0x3'));var BPromise=require(_0x45c6('0x4'));var rp=require('request-promise');var fs=require('fs');var path=require(_0x45c6('0x5'));var rimraf=require(_0x45c6('0x6'));var config=require(_0x45c6('0x7'));var attributes=require(_0x45c6('0x8'));module[_0x45c6('0x9')]=function(_0x151e06,_0x50001d){return _0x151e06['define']('SmsApplication',attributes,{'tableName':_0x45c6('0xa'),'paranoid':![],'indexes':[],'timestamps':!![],'charset':_0x45c6('0xb'),'collate':_0x45c6('0xc')});};
\ No newline at end of file
+var _0xd34c=['./smsApplication.attributes','exports','define','SmsApplication','sms_applications','utf8mb4','utf8mb4_unicode_ci','lodash','util','../../config/logger','moment','bluebird','request-promise','rimraf','../../config/environment'];(function(_0xa1f2df,_0x8709bf){var _0x15b99b=function(_0x3dc708){while(--_0x3dc708){_0xa1f2df['push'](_0xa1f2df['shift']());}};_0x15b99b(++_0x8709bf);}(_0xd34c,0x1e7));var _0xcd34=function(_0x1ae481,_0x194bf2){_0x1ae481=_0x1ae481-0x0;var _0x1cb482=_0xd34c[_0x1ae481];return _0x1cb482;};'use strict';var _=require(_0xcd34('0x0'));var util=require(_0xcd34('0x1'));var logger=require(_0xcd34('0x2'))('api');var moment=require(_0xcd34('0x3'));var BPromise=require(_0xcd34('0x4'));var rp=require(_0xcd34('0x5'));var fs=require('fs');var path=require('path');var rimraf=require(_0xcd34('0x6'));var config=require(_0xcd34('0x7'));var attributes=require(_0xcd34('0x8'));module[_0xcd34('0x9')]=function(_0x2ffdb8,_0x72a340){return _0x2ffdb8[_0xcd34('0xa')](_0xcd34('0xb'),attributes,{'tableName':_0xcd34('0xc'),'paranoid':![],'indexes':[],'timestamps':!![],'charset':_0xcd34('0xd'),'collate':_0xcd34('0xe')});};
\ No newline at end of file
diff --git a/server/api/smsApplication/smsApplication.rpc.js b/server/api/smsApplication/smsApplication.rpc.js
index 1b5d952..67d3b4f 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 _0x5577=['moment','bluebird','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','client','http','request','then','info','SmsApplication,\x20%s,\x20%s','request\x20sent','debug','SmsApplication,\x20%s,\x20%s,\x20%s','error','code','message','result','catch','lodash'];(function(_0x3ab51d,_0x2fa01d){var _0x29a04e=function(_0x7807b0){while(--_0x7807b0){_0x3ab51d['push'](_0x3ab51d['shift']());}};_0x29a04e(++_0x2fa01d);}(_0x5577,0x1b4));var _0x7557=function(_0x1d04ac,_0x1575a2){_0x1d04ac=_0x1d04ac-0x0;var _0x21ad0d=_0x5577[_0x1d04ac];return _0x21ad0d;};'use strict';var _=require(_0x7557('0x0'));var util=require('util');var moment=require(_0x7557('0x1'));var BPromise=require(_0x7557('0x2'));var rs=require('randomstring');var fs=require('fs');var Redis=require(_0x7557('0x3'));var db=require(_0x7557('0x4'))['db'];var utils=require(_0x7557('0x5'));var logger=require(_0x7557('0x6'))(_0x7557('0x7'));var config=require(_0x7557('0x8'));var jayson=require('jayson/promise');var client=jayson[_0x7557('0x9')][_0x7557('0xa')]({'port':0x232a});function respondWithRpcPromise(_0x3da895,_0x1446fd,_0x33e9aa){return new BPromise(function(_0x37f335,_0xa4f49a){return client[_0x7557('0xb')](_0x3da895,_0x33e9aa)[_0x7557('0xc')](function(_0x24b592){logger[_0x7557('0xd')](_0x7557('0xe'),_0x1446fd,_0x7557('0xf'));logger[_0x7557('0x10')](_0x7557('0x11'),_0x1446fd,'request\x20sent',JSON['stringify'](_0x24b592));if(_0x24b592[_0x7557('0x12')]){if(_0x24b592[_0x7557('0x12')][_0x7557('0x13')]===0x1f4){logger[_0x7557('0x12')](_0x7557('0xe'),_0x1446fd,_0x24b592[_0x7557('0x12')][_0x7557('0x14')]);return _0xa4f49a(_0x24b592[_0x7557('0x12')][_0x7557('0x14')]);}logger[_0x7557('0x12')]('SmsApplication,\x20%s,\x20%s',_0x1446fd,_0x24b592[_0x7557('0x12')][_0x7557('0x14')]);return _0x37f335(_0x24b592[_0x7557('0x12')]['message']);}else{logger[_0x7557('0xd')](_0x7557('0xe'),_0x1446fd,_0x7557('0xf'));_0x37f335(_0x24b592[_0x7557('0x15')]['message']);}})[_0x7557('0x16')](function(_0x46057c){logger['error']('SmsApplication,\x20%s,\x20%s',_0x1446fd,_0x46057c);_0xa4f49a(_0x46057c);});});}
\ No newline at end of file
+var _0xe9e8=['code','message','result','lodash','util','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/logger','../../config/environment','jayson/promise','client','request','then','SmsApplication,\x20%s,\x20%s','request\x20sent','debug','SmsApplication,\x20%s,\x20%s,\x20%s','stringify','error'];(function(_0x363842,_0x369636){var _0x257bc2=function(_0x2516cf){while(--_0x2516cf){_0x363842['push'](_0x363842['shift']());}};_0x257bc2(++_0x369636);}(_0xe9e8,0x179));var _0x8e9e=function(_0x5f5943,_0x3857f6){_0x5f5943=_0x5f5943-0x0;var _0x4a59f6=_0xe9e8[_0x5f5943];return _0x4a59f6;};'use strict';var _=require(_0x8e9e('0x0'));var util=require(_0x8e9e('0x1'));var moment=require(_0x8e9e('0x2'));var BPromise=require(_0x8e9e('0x3'));var rs=require(_0x8e9e('0x4'));var fs=require('fs');var Redis=require(_0x8e9e('0x5'));var db=require(_0x8e9e('0x6'))['db'];var utils=require('../../config/utils');var logger=require(_0x8e9e('0x7'))('rpc');var config=require(_0x8e9e('0x8'));var jayson=require(_0x8e9e('0x9'));var client=jayson[_0x8e9e('0xa')]['http']({'port':0x232a});function respondWithRpcPromise(_0x4dae01,_0x1613ff,_0x2e00d9){return new BPromise(function(_0x3afd97,_0x2745ef){return client[_0x8e9e('0xb')](_0x4dae01,_0x2e00d9)[_0x8e9e('0xc')](function(_0x50d9a1){logger['info'](_0x8e9e('0xd'),_0x1613ff,_0x8e9e('0xe'));logger[_0x8e9e('0xf')](_0x8e9e('0x10'),_0x1613ff,_0x8e9e('0xe'),JSON[_0x8e9e('0x11')](_0x50d9a1));if(_0x50d9a1[_0x8e9e('0x12')]){if(_0x50d9a1[_0x8e9e('0x12')][_0x8e9e('0x13')]===0x1f4){logger[_0x8e9e('0x12')](_0x8e9e('0xd'),_0x1613ff,_0x50d9a1[_0x8e9e('0x12')][_0x8e9e('0x14')]);return _0x2745ef(_0x50d9a1[_0x8e9e('0x12')]['message']);}logger[_0x8e9e('0x12')](_0x8e9e('0xd'),_0x1613ff,_0x50d9a1[_0x8e9e('0x12')][_0x8e9e('0x14')]);return _0x3afd97(_0x50d9a1['error'][_0x8e9e('0x14')]);}else{logger['info'](_0x8e9e('0xd'),_0x1613ff,_0x8e9e('0xe'));_0x3afd97(_0x50d9a1[_0x8e9e('0x15')]['message']);}})['catch'](function(_0x20220a){logger[_0x8e9e('0x12')]('SmsApplication,\x20%s,\x20%s',_0x1613ff,_0x20220a);_0x2745ef(_0x20220a);});});}
\ No newline at end of file
diff --git a/server/api/smsInteraction/index.js b/server/api/smsInteraction/index.js
index 1839ecb..81493c5 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 _0x3e22=['addTags','put','smsinteraction:update','update','delete','smsinteraction:destroy','destroy','removeTags','util','connect-timeout','express','Router','../../components/auth/service','./smsInteraction.controller','get','index','/describe','isAuthenticated','describe','/:id','show','/:id/messages','getMessages','/:id/download','download','create','post','addMessage','/:id/tags','tracked','sms','smsinteraction:addtags'];(function(_0x4a72a0,_0x2b8292){var _0x143dd3=function(_0x24ed68){while(--_0x24ed68){_0x4a72a0['push'](_0x4a72a0['shift']());}};_0x143dd3(++_0x2b8292);}(_0x3e22,0xa8));var _0x23e2=function(_0x42fd67,_0x5dbdfd){_0x42fd67=_0x42fd67-0x0;var _0x3293f5=_0x3e22[_0x42fd67];return _0x3293f5;};'use strict';var multer=require('multer');var util=require(_0x23e2('0x0'));var path=require('path');var timeout=require(_0x23e2('0x1'));var express=require(_0x23e2('0x2'));var router=express[_0x23e2('0x3')]();var auth=require(_0x23e2('0x4'));var interaction=require('../../components/interaction/service');var config=require('../../config/environment');var controller=require(_0x23e2('0x5'));router[_0x23e2('0x6')]('/',auth['isAuthenticated'](),controller[_0x23e2('0x7')]);router[_0x23e2('0x6')](_0x23e2('0x8'),auth[_0x23e2('0x9')](),controller[_0x23e2('0xa')]);router['get'](_0x23e2('0xb'),auth[_0x23e2('0x9')](),controller[_0x23e2('0xc')]);router[_0x23e2('0x6')](_0x23e2('0xd'),auth['isAuthenticated'](),controller[_0x23e2('0xe')]);router[_0x23e2('0x6')](_0x23e2('0xf'),auth[_0x23e2('0x9')](),controller[_0x23e2('0x10')]);router['post']('/',auth['isAuthenticated'](),controller[_0x23e2('0x11')]);router[_0x23e2('0x12')](_0x23e2('0xd'),auth[_0x23e2('0x9')](),controller[_0x23e2('0x13')]);router[_0x23e2('0x12')](_0x23e2('0x14'),auth[_0x23e2('0x9')](),interaction[_0x23e2('0x15')](_0x23e2('0x16'),_0x23e2('0x17')),controller[_0x23e2('0x18')]);router[_0x23e2('0x19')](_0x23e2('0xb'),auth['isAuthenticated'](),interaction[_0x23e2('0x15')](_0x23e2('0x16'),_0x23e2('0x1a')),controller[_0x23e2('0x1b')]);router[_0x23e2('0x1c')](_0x23e2('0xb'),auth[_0x23e2('0x9')](),interaction[_0x23e2('0x15')](_0x23e2('0x16'),_0x23e2('0x1d')),controller[_0x23e2('0x1e')]);router[_0x23e2('0x1c')]('/:id/tags',auth[_0x23e2('0x9')](),controller[_0x23e2('0x1f')]);module['exports']=router;
\ No newline at end of file
+var _0xa8d9=['exports','multer','util','path','connect-timeout','express','../../components/auth/service','../../components/interaction/service','./smsInteraction.controller','get','isAuthenticated','index','describe','/:id','/:id/messages','getMessages','/:id/download','download','post','addMessage','/:id/tags','sms','smsinteraction:addtags','addTags','put','smsinteraction:update','update','delete','tracked','destroy','removeTags'];(function(_0x1e7701,_0x13fd0f){var _0x3ab707=function(_0x3c5242){while(--_0x3c5242){_0x1e7701['push'](_0x1e7701['shift']());}};_0x3ab707(++_0x13fd0f);}(_0xa8d9,0x1f1));var _0x9a8d=function(_0x2641f9,_0x26715f){_0x2641f9=_0x2641f9-0x0;var _0x585741=_0xa8d9[_0x2641f9];return _0x585741;};'use strict';var multer=require(_0x9a8d('0x0'));var util=require(_0x9a8d('0x1'));var path=require(_0x9a8d('0x2'));var timeout=require(_0x9a8d('0x3'));var express=require(_0x9a8d('0x4'));var router=express['Router']();var auth=require(_0x9a8d('0x5'));var interaction=require(_0x9a8d('0x6'));var config=require('../../config/environment');var controller=require(_0x9a8d('0x7'));router[_0x9a8d('0x8')]('/',auth[_0x9a8d('0x9')](),controller[_0x9a8d('0xa')]);router[_0x9a8d('0x8')]('/describe',auth[_0x9a8d('0x9')](),controller[_0x9a8d('0xb')]);router[_0x9a8d('0x8')](_0x9a8d('0xc'),auth[_0x9a8d('0x9')](),controller['show']);router[_0x9a8d('0x8')](_0x9a8d('0xd'),auth[_0x9a8d('0x9')](),controller[_0x9a8d('0xe')]);router[_0x9a8d('0x8')](_0x9a8d('0xf'),auth[_0x9a8d('0x9')](),controller[_0x9a8d('0x10')]);router[_0x9a8d('0x11')]('/',auth[_0x9a8d('0x9')](),controller['create']);router['post'](_0x9a8d('0xd'),auth[_0x9a8d('0x9')](),controller[_0x9a8d('0x12')]);router[_0x9a8d('0x11')](_0x9a8d('0x13'),auth['isAuthenticated'](),interaction['tracked'](_0x9a8d('0x14'),_0x9a8d('0x15')),controller[_0x9a8d('0x16')]);router[_0x9a8d('0x17')](_0x9a8d('0xc'),auth[_0x9a8d('0x9')](),interaction['tracked'](_0x9a8d('0x14'),_0x9a8d('0x18')),controller[_0x9a8d('0x19')]);router[_0x9a8d('0x1a')](_0x9a8d('0xc'),auth[_0x9a8d('0x9')](),interaction[_0x9a8d('0x1b')](_0x9a8d('0x14'),'smsinteraction:destroy'),controller[_0x9a8d('0x1c')]);router['delete'](_0x9a8d('0x13'),auth[_0x9a8d('0x9')](),controller[_0x9a8d('0x1d')]);module[_0x9a8d('0x1e')]=router;
\ No newline at end of file
diff --git a/server/api/smsInteraction/smsInteraction.attributes.js b/server/api/smsInteraction/smsInteraction.attributes.js
index 9fb8fbd..ef83199 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 _0xd8b0=['moment','STRING','DATE','ENUM','out','sequelize'];(function(_0x10d341,_0x57ff35){var _0xddc36d=function(_0x1c24f0){while(--_0x1c24f0){_0x10d341['push'](_0x10d341['shift']());}};_0xddc36d(++_0x57ff35);}(_0xd8b0,0xad));var _0x0d8b=function(_0x20a584,_0xe384a5){_0x20a584=_0x20a584-0x0;var _0x4b41a8=_0xd8b0[_0x20a584];return _0x4b41a8;};'use strict';var Sequelize=require(_0x0d8b('0x0'));var moment=require(_0x0d8b('0x1'));module['exports']={'closed':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'closedAt':{'type':Sequelize['DATE']},'disposition':{'type':Sequelize[_0x0d8b('0x2')]},'note':{'type':Sequelize[_0x0d8b('0x2')]},'phone':{'type':Sequelize[_0x0d8b('0x2')]},'read1stAt':{'type':Sequelize[_0x0d8b('0x3')]},'firstMsgDirection':{'type':Sequelize[_0x0d8b('0x4')]('in','out'),'defaultValue':'in','allowNull':![]},'lastMsgAt':{'type':Sequelize['DATE']},'lastMsgDirection':{'type':Sequelize[_0x0d8b('0x4')]('in',_0x0d8b('0x5')),'defaultValue':'in','allowNull':![]}};
\ No newline at end of file
+var _0xbaf0=['DATE','STRING','ENUM','out','moment','exports','BOOLEAN'];(function(_0x1c0c16,_0x453ca6){var _0x198367=function(_0x42805b){while(--_0x42805b){_0x1c0c16['push'](_0x1c0c16['shift']());}};_0x198367(++_0x453ca6);}(_0xbaf0,0x12a));var _0x0baf=function(_0x501510,_0x61caa9){_0x501510=_0x501510-0x0;var _0x1e6ee5=_0xbaf0[_0x501510];return _0x1e6ee5;};'use strict';var Sequelize=require('sequelize');var moment=require(_0x0baf('0x0'));module[_0x0baf('0x1')]={'closed':{'type':Sequelize[_0x0baf('0x2')],'defaultValue':![]},'closedAt':{'type':Sequelize[_0x0baf('0x3')]},'disposition':{'type':Sequelize[_0x0baf('0x4')]},'note':{'type':Sequelize[_0x0baf('0x4')]},'phone':{'type':Sequelize['STRING']},'read1stAt':{'type':Sequelize[_0x0baf('0x3')]},'firstMsgDirection':{'type':Sequelize[_0x0baf('0x5')]('in',_0x0baf('0x6')),'defaultValue':'in','allowNull':![]},'lastMsgAt':{'type':Sequelize[_0x0baf('0x3')]},'lastMsgDirection':{'type':Sequelize[_0x0baf('0x5')]('in',_0x0baf('0x6')),'defaultValue':'in','allowNull':![]}};
\ No newline at end of file
diff --git a/server/api/smsInteraction/smsInteraction.controller.js b/server/api/smsInteraction/smsInteraction.controller.js
index c55693c..32a4414 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 _0x6050=['fieldName','type','key','model','query','filters','intersection','fields','attributes','length','hasOwnProperty','order','sort','where','pick','select','color','from','u.id','field','ui.SmsInteractionId','user_has_sms_interactions','u.id\x20=\x20ui.UserId','sms_interactions','left_join','cm_contacts','c.id\x20=\x20i.ContactId\x20AND\x20c.deletedAt\x20IS\x20NULL','users','o.id\x20=\x20i.UserId','a.id\x20=\x20i.SmsAccountId','sms_messages','me.SmsInteractionId\x20=\x20i.id','sms_interaction_has_tags','it.SmsInteractionId\x20=\x20i.id','tools_tags','expr','search','parseSearch','conditions','find','value','having','`\x20>\x200','Contact','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?','buildExpression','text','Tag','CONCAT(\x27,\x27,\x20`TagIds`,\x20\x27,\x27)\x20LIKE\x20?','union','operator','$substring','CONCAT_WS(\x27\x20\x27,\x20o.name,\x20o.fullname)\x20LIKE\x20?','UserId','start','body','keys','some','isEmpty','SmsAccountId','i.SmsAccountId\x20IN\x20?','concat','createdAt','parse','$lte','i.createdAt\x20BETWEEN\x20?\x20AND\x20?','null','\x20IS\x20NULL','read','`unreadMessages`\x20=\x200','`unreadMessages`\x20>\x200','tag','filter','replace','i.id\x20LIKE\x20?','i.phone\x20LIKE\x20?','MATCH\x20(me.body)\x20AGAINST\x20(?\x20IN\x20BOOLEAN\x20MODE)','Sequelize','QueryTypes','SUM(me.read\x20=\x200\x20AND\x20me.direction\x20=\x20\x27in\x27)','unreadMessages','resolve','journey','i.SmsAccountId\x20IS\x20NOT\x20NULL','user','i.SmsAccountId\x20IS\x20NULL','sequelize','toString','keyBy','a.key','Account.key','a.mandatoryDisposition','Account.mandatoryDisposition','i.*','c.firstName','Contact.firstName','c.lastName','Contact.lastName','c.email','Contact.email','c.phone','Contact.phone','c.mobile','Contact.mobile','c.fax','Contact.fax','Owner.fullname','o.internal','GROUP_CONCAT(DISTINCT\x20t.id)','ui.SmsInteractionId\x20IN\x20?','groupBy','rows','show','includeAll','include','merge','options','create','params','describe','addMessage','SmsMessage','ids','getMessages','findOne','nolimit','SmsInteractionId','$gte','omit','spread','findAll','emit','removeTags','download','unix','join','server','tmp','attachments','format','transcript-%d-%s.zip','User','lastName','Messages','direction','Account','Owner','get','mkdirSync','10px','40px','\x0a\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20
Interaction\x20Transcript \x0a\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20',' \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','N.A.','YYYY-MM-DD\x20HH:mm:ss','closed','closedAt','disposition','out','renderFile','root','views','downloadInteraction.html','toFile','transcript-','.pdf','log','err','unlinkSync','html-pdf','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','bluebird','mustache','util','ejs','jsforce','desk.js','to-csv','querystring','papaparse','../../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','./smsInteraction.socket','register','sendStatus','status','end','json','count','offset','limit','set','Content-Range','apply','reject','save','update','then','destroy','stack','name','send','Users','map','fullname','TagIds','Tags','split','forEach','push','catch','index','SmsInteraction','rawAttributes'];(function(_0x588b79,_0x55887c){var _0x344754=function(_0x381d06){while(--_0x381d06){_0x588b79['push'](_0x588b79['shift']());}};_0x344754(++_0x55887c);}(_0x6050,0x196));var _0x0605=function(_0x271c78,_0x2509a3){_0x271c78=_0x271c78-0x0;var _0x5baf38=_0x6050[_0x271c78];return _0x5baf38;};'use strict';var pdf=require(_0x0605('0x0'));var emlformat=require(_0x0605('0x1'));var rimraf=require(_0x0605('0x2'));var zipdir=require(_0x0605('0x3'));var jsonpatch=require(_0x0605('0x4'));var rp=require(_0x0605('0x5'));var moment=require('moment');var BPromise=require(_0x0605('0x6'));var Mustache=require(_0x0605('0x7'));var util=require(_0x0605('0x8'));var path=require('path');var sox=require('sox');var csv=require('to-csv');var ejs=require(_0x0605('0x9'));var fs=require('fs');var _=require('lodash');var squel=require('squel');var crypto=require('crypto');var jsforce=require(_0x0605('0xa'));var deskjs=require(_0x0605('0xb'));var toCsv=require(_0x0605('0xc'));var querystring=require(_0x0605('0xd'));var Papa=require(_0x0605('0xe'));var Redis=require('ioredis');var authService=require(_0x0605('0xf'));var qs=require(_0x0605('0x10'));var as=require(_0x0605('0x11'));var hardwareService=require(_0x0605('0x12'));var logger=require(_0x0605('0x13'))(_0x0605('0x14'));var utils=require(_0x0605('0x15'));var config=require(_0x0605('0x16'));var db=require(_0x0605('0x17'))['db'];config[_0x0605('0x18')]=_[_0x0605('0x19')](config[_0x0605('0x18')],{'host':_0x0605('0x1a'),'port':0x18eb});var socket=require(_0x0605('0x1b'))(new Redis(config[_0x0605('0x18')]));require(_0x0605('0x1c'))[_0x0605('0x1d')](socket);function respondWithStatusCode(_0x65a20b,_0x1b944f){_0x1b944f=_0x1b944f||0xcc;return function(_0x5b08ba){if(_0x5b08ba){return _0x65a20b[_0x0605('0x1e')](_0x1b944f);}return _0x65a20b[_0x0605('0x1f')](_0x1b944f)[_0x0605('0x20')]();};}function respondWithResult(_0x5ce56a,_0x4eefe9){_0x4eefe9=_0x4eefe9||0xc8;return function(_0x12a455){if(_0x12a455){return _0x5ce56a[_0x0605('0x1f')](_0x4eefe9)[_0x0605('0x21')](_0x12a455);}};}function respondWithFilteredResult(_0x2d46ef,_0xefc557){return function(_0x351dbd){if(_0x351dbd){var _0x2b7b5a=_0x351dbd[_0x0605('0x22')],_0x1d57ba=_0xefc557[_0x0605('0x23')],_0x193520=_0xefc557[_0x0605('0x23')]+_0xefc557[_0x0605('0x24')],_0x40abb2;if(_0x193520>=_0x2b7b5a){_0x193520=_0x2b7b5a;_0x40abb2=0xc8;}else{_0x40abb2=0xce;}_0x2d46ef['status'](_0x40abb2);return _0x2d46ef[_0x0605('0x25')](_0x0605('0x26'),_0x1d57ba+'-'+_0x193520+'/'+_0x2b7b5a)[_0x0605('0x21')](_0x351dbd);}return null;};}function patchUpdates(_0x443326){return function(_0x1e8c6d){try{jsonpatch[_0x0605('0x27')](_0x1e8c6d,_0x443326,!![]);}catch(_0x379211){return BPromise[_0x0605('0x28')](_0x379211);}return _0x1e8c6d[_0x0605('0x29')]();};}function saveUpdates(_0x5b0d44,_0xc334b8){return function(_0x4fe293){if(_0x4fe293){return _0x4fe293[_0x0605('0x2a')](_0x5b0d44)[_0x0605('0x2b')](function(_0x110098){return _0x110098;});}return null;};}function removeEntity(_0xf182c4,_0x10c575){return function(_0xb4d805){if(_0xb4d805){return _0xb4d805[_0x0605('0x2c')]()[_0x0605('0x2b')](function(){_0xf182c4[_0x0605('0x1f')](0xcc)[_0x0605('0x20')]();});}};}function handleEntityNotFound(_0x9f2833,_0x1c3722){return function(_0x5a602e){if(!_0x5a602e){_0x9f2833[_0x0605('0x1e')](0x194);}return _0x5a602e;};}function handleError(_0x3c8e36,_0x4b1e0c){_0x4b1e0c=_0x4b1e0c||0x1f4;return function(_0x4d9a31){logger['error'](_0x4d9a31[_0x0605('0x2d')]);if(_0x4d9a31[_0x0605('0x2e')]){delete _0x4d9a31[_0x0605('0x2e')];}_0x3c8e36[_0x0605('0x1f')](_0x4b1e0c)[_0x0605('0x2f')](_0x4d9a31);};}function getInteractionUsers(_0x4554df,_0x4e32ef){return new BPromise(function(_0x34f25d,_0x5daef6){try{if(_0x4e32ef[_0x4554df['id']]){_0x4554df[_0x0605('0x30')]=_[_0x0605('0x31')](_0x4e32ef[_0x4554df['id']],function(_0x421c26){return{'id':_0x421c26['id'],'fullname':_0x421c26[_0x0605('0x32')]};});}}catch(_0x1f65aa){_0x5daef6(_0x1f65aa);}_0x34f25d(_0x4554df);});}function getInteractionTags(_0x352dd6,_0x56dd1a){return new BPromise(function(_0x165a0c,_0xf885cc){try{if(_0x352dd6[_0x0605('0x33')]){_0x352dd6[_0x0605('0x34')]=[];_0x352dd6[_0x0605('0x33')][_0x0605('0x35')](',')[_0x0605('0x36')](function(_0x362551){_0x352dd6[_0x0605('0x34')][_0x0605('0x37')](_0x56dd1a[_0x362551]);});}delete _0x352dd6[_0x0605('0x33')];}catch(_0x1d932f){_0xf885cc(_0x1d932f);}_0x165a0c(_0x352dd6);});}function updateSmsInteraction(_0x2f5993,_0x992e4f,_0x4be5f8){return new BPromise(function(_0x2bee59,_0x10ae69){return getInteractionUsers(_0x2f5993,_0x4be5f8)[_0x0605('0x2b')](function(_0x1637ba){return getInteractionTags(_0x1637ba,_0x992e4f);})[_0x0605('0x2b')](function(_0x3a1c75){_0x2bee59(_0x3a1c75);})[_0x0605('0x38')](function(_0x32a979){_0x10ae69(_0x32a979);});});}exports[_0x0605('0x39')]=function(_0x141604,_0x2454e0){var _0xe7701d={},_0x4a84d7={},_0x259102={'count':0x0,'rows':[]};var _0x111298=_['map'](db[_0x0605('0x3a')][_0x0605('0x3b')],function(_0x4b51fb){return{'name':_0x4b51fb[_0x0605('0x3c')],'type':_0x4b51fb[_0x0605('0x3d')][_0x0605('0x3e')]};});_0x4a84d7[_0x0605('0x3f')]=_[_0x0605('0x31')](_0x111298,_0x0605('0x2e'));_0x4a84d7['query']=_['keys'](_0x141604[_0x0605('0x40')]);_0x4a84d7[_0x0605('0x41')]=_[_0x0605('0x42')](_0x4a84d7['model'],_0x4a84d7[_0x0605('0x40')]);_0xe7701d['attributes']=_[_0x0605('0x42')](_0x4a84d7[_0x0605('0x3f')],qs[_0x0605('0x43')](_0x141604[_0x0605('0x40')][_0x0605('0x43')]));_0xe7701d[_0x0605('0x44')]=_0xe7701d[_0x0605('0x44')][_0x0605('0x45')]?_0xe7701d[_0x0605('0x44')]:_0x4a84d7[_0x0605('0x3f')];if(!_0x141604['query'][_0x0605('0x46')]('nolimit')){_0xe7701d[_0x0605('0x24')]=qs[_0x0605('0x24')](_0x141604[_0x0605('0x40')]['limit']);_0xe7701d['offset']=qs[_0x0605('0x23')](_0x141604['query'][_0x0605('0x23')]);}_0xe7701d[_0x0605('0x47')]=qs[_0x0605('0x48')](_0x141604[_0x0605('0x40')][_0x0605('0x48')]);_0xe7701d[_0x0605('0x49')]=qs[_0x0605('0x41')](_[_0x0605('0x4a')](_0x141604[_0x0605('0x40')],_0x4a84d7[_0x0605('0x41')]));var _0x18d3ce=[];var _0x3616a3=squel[_0x0605('0x4b')]()['field']('id')['field'](_0x0605('0x2e'))['field'](_0x0605('0x4c'))[_0x0605('0x4d')]('tools_tags');var _0x44db50=squel[_0x0605('0x4b')]()['field'](_0x0605('0x4e'))[_0x0605('0x4f')]('u.fullname')[_0x0605('0x4f')](_0x0605('0x50'))['from'](_0x0605('0x51'),'ui')['left_join']('users','u',_0x0605('0x52'));var _0x468a3e=squel[_0x0605('0x4b')]()[_0x0605('0x4d')](_0x0605('0x53'),'i')[_0x0605('0x54')](_0x0605('0x55'),'c',_0x0605('0x56'))['left_join'](_0x0605('0x57'),'o',_0x0605('0x58'))[_0x0605('0x54')]('sms_accounts','a',_0x0605('0x59'))[_0x0605('0x54')](_0x0605('0x5a'),'me',_0x0605('0x5b'))[_0x0605('0x54')](_0x0605('0x5c'),'it',_0x0605('0x5d'))[_0x0605('0x54')](_0x0605('0x5e'),'t','t.id\x20=\x20it.TagId');var _0x3c597c=squel[_0x0605('0x5f')]();var _0x1ee5d1=[];var _0x389bb6=squel[_0x0605('0x5f')]();var _0x434289;if(_0x141604[_0x0605('0x40')][_0x0605('0x60')]){_0x434289=as[_0x0605('0x61')](_0x141604[_0x0605('0x40')]['search']);var _0x5a2c76=_0x434289['sqlOperator'];for(var _0x2687a8=0x0;_0x2687a8<_0x434289[_0x0605('0x62')][_0x0605('0x45')];_0x2687a8++){var _0x30140e=_0x434289[_0x0605('0x62')][_0x2687a8];var _0x203fe9='i';var _0x539ded=_[_0x0605('0x63')](_0x111298,[_0x0605('0x2e'),_0x30140e[_0x0605('0x4f')]]);if(!_0x539ded){switch(_0x30140e[_0x0605('0x4f')]){case'unreadMessages':if(_0x30140e[_0x0605('0x64')]==0x1){_0x468a3e[_0x0605('0x65')]('`'+_0x30140e[_0x0605('0x4f')]+'`\x20=\x200');}else{_0x468a3e['having']('`'+_0x30140e[_0x0605('0x4f')]+_0x0605('0x66'));}break;case _0x0605('0x67'):if(_0x30140e['operator']==='$substring'){if(_0x30140e[_0x0605('0x64')]['split']('\x20')[_0x0605('0x45')]>0x1){_0x3c597c[_0x5a2c76](_0x0605('0x68'),qs[_0x0605('0x69')](_0x30140e[_0x0605('0x64')]),null);}else{var _0x248ecc='%'+_0x30140e[_0x0605('0x64')]+'%';_0x3c597c[_0x5a2c76](_0x0605('0x6a'),_0x248ecc,_0x248ecc,_0x248ecc);}}else{_0x539ded=_['find'](_0x111298,[_0x0605('0x2e'),'ContactId']);_0x30140e[_0x0605('0x4f')]='ContactId';_0x19b55e=as[_0x0605('0x6b')](_0x203fe9,_0x539ded[_0x0605('0x3d')],_0x30140e);_0x3c597c[_0x5a2c76](_0x19b55e[_0x0605('0x6c')],_0x19b55e[_0x0605('0x64')]['start'],_0x19b55e['value'][_0x0605('0x20')]);}break;case _0x0605('0x6d'):var _0x56ae03=_0x30140e['value']['split'](',')[_0x0605('0x31')](function(_0x2b43cf){return Number(_0x2b43cf);});_0x56ae03[_0x0605('0x36')](function(_0xc8f15c){_0x389bb6['or'](_0x0605('0x6e'),'%,'+_0xc8f15c+',%');});_0x1ee5d1=_[_0x0605('0x6f')](_0x1ee5d1,_0x56ae03);break;case'User':if(_0x30140e[_0x0605('0x70')]===_0x0605('0x71')){_0x3c597c[_0x5a2c76](_0x0605('0x72'),'%'+_0x30140e[_0x0605('0x64')]+'%',null);}else{_0x539ded=_[_0x0605('0x63')](_0x111298,[_0x0605('0x2e'),_0x0605('0x73')]);_0x30140e[_0x0605('0x4f')]='UserId';_0x19b55e=as['buildExpression'](_0x203fe9,_0x539ded['type'],_0x30140e);_0x3c597c[_0x5a2c76](_0x19b55e[_0x0605('0x6c')],_0x19b55e[_0x0605('0x64')][_0x0605('0x74')],_0x19b55e['value']['end']);}break;case _0x0605('0x75'):_0x19b55e=as[_0x0605('0x6b')]('me',null,_0x30140e);_0x3c597c[_0x5a2c76](_0x19b55e[_0x0605('0x6c')],_0x19b55e[_0x0605('0x64')][_0x0605('0x74')],_0x19b55e[_0x0605('0x64')][_0x0605('0x20')]);break;}}else{var _0x19b55e=as[_0x0605('0x6b')](_0x203fe9,_0x539ded[_0x0605('0x3d')],_0x30140e);_0x3c597c[_0x5a2c76](_0x19b55e[_0x0605('0x6c')],_0x19b55e[_0x0605('0x64')]['start'],_0x19b55e[_0x0605('0x64')][_0x0605('0x20')]);}}}else{var _0x1a2e3c=_(_0x141604[_0x0605('0x40')])[_0x0605('0x76')]()[_0x0605('0x31')](function(_0x5e61a6){return _[_0x0605('0x77')](_0x111298,['name',_0x5e61a6])?_0x5e61a6:undefined;})['compact']()[_0x0605('0x64')]();if(!_[_0x0605('0x78')](_0x1a2e3c)){_0x1a2e3c[_0x0605('0x36')](function(_0x1d26a3){if(_0x1d26a3===_0x0605('0x79')){_0x468a3e[_0x0605('0x49')](_0x0605('0x7a'),[][_0x0605('0x7b')](_0x141604[_0x0605('0x40')][_0x1d26a3]));}else if(_0x1d26a3===_0x0605('0x7c')){var _0x53c460=JSON['parse'](_0x141604['query'][_0x1d26a3])['$gte'];var _0x5e0b7a=JSON[_0x0605('0x7d')](_0x141604[_0x0605('0x40')][_0x1d26a3])[_0x0605('0x7e')];_0x468a3e['where'](_0x0605('0x7f'),_0x53c460,_0x5e0b7a);}else{if(_0x141604[_0x0605('0x40')][_0x1d26a3]===_0x0605('0x80')){_0x468a3e[_0x0605('0x49')]('i.'+_0x1d26a3+_0x0605('0x81'));}else{_0x468a3e[_0x0605('0x49')]('i.'+_0x1d26a3+'\x20=\x20?',_0x141604[_0x0605('0x40')][_0x1d26a3]);}}});}if(_0x141604[_0x0605('0x40')][_0x0605('0x82')]){if(_0x141604['query']['read']==0x1){_0x468a3e['having'](_0x0605('0x83'));}else{_0x468a3e[_0x0605('0x65')](_0x0605('0x84'));}}if(_0x141604[_0x0605('0x40')]['tag']){_0x1ee5d1=_['isArray'](_0x141604[_0x0605('0x40')][_0x0605('0x85')])?_0x141604['query'][_0x0605('0x85')]:new Array(_0x141604[_0x0605('0x40')][_0x0605('0x85')]);_0x1ee5d1[_0x0605('0x36')](function(_0x8f99){_0x389bb6['or'](_0x0605('0x6e'),'%,'+_0x8f99+',%');});}if(_0x141604[_0x0605('0x40')][_0x0605('0x86')]){var _0x25890a=_0x141604[_0x0605('0x40')][_0x0605('0x86')][_0x0605('0x87')]('\x5c','\x5c\x5c')[_0x0605('0x87')]('\x27\x27','\x27\x27\x27\x27');if(qs['isNumeric'](_0x25890a)){_0x3c597c['or'](_0x0605('0x88'),_0x25890a+'%')['or'](_0x0605('0x89'),_0x25890a+'%');}else{_0x3c597c['or'](_0x0605('0x8a'),qs['getFullTextValue'](_0x25890a))['or']('CONCAT(c.firstName,\x20\x27\x20\x27,\x20c.lastName)\x20LIKE\x20?',_0x25890a+'%');}}}_0x468a3e[_0x0605('0x49')](_0x3c597c);_0x468a3e['group']('i.id');var _0x2dab29={'type':db[_0x0605('0x8b')][_0x0605('0x8c')]['SELECT'],'raw':!![]};var _0x5963c9=_0x468a3e['clone']();_0x5963c9[_0x0605('0x4f')]('i.id');_0x5963c9[_0x0605('0x4f')](_0x0605('0x8d'),_0x0605('0x8e'));if(_0xe7701d[_0x0605('0x47')]){_0xe7701d[_0x0605('0x47')][_0x0605('0x36')](function(_0x24fe36){_0x468a3e[_0x0605('0x47')]('i.'+_0x24fe36[0x0],_0x24fe36[0x1]==='DESC'?![]:!![]);});}if(!_['isEmpty'](_0x1ee5d1)){_0x468a3e[_0x0605('0x65')](_0x389bb6);_0x5963c9[_0x0605('0x49')]('t.id\x20IN\x20?',_0x1ee5d1);}BPromise[_0x0605('0x8f')]()['then'](function(){if(!_0x434289){if(_0x141604[_0x0605('0x40')][_0x0605('0x79')]||_0x141604['query'][_0x0605('0x90')])return;_0x5963c9['where'](_0x0605('0x91'));_0x468a3e[_0x0605('0x49')](_0x0605('0x91'));return;}return _0x141604[_0x0605('0x92')]['getSmsAccounts']({'attributes':['id'],'raw':!![]})[_0x0605('0x2b')](function(_0x4189ba){if(_['isEmpty'](_0x4189ba)){_0x5963c9[_0x0605('0x49')](_0x0605('0x93'));_0x468a3e[_0x0605('0x49')](_0x0605('0x93'));}else{_0x5963c9[_0x0605('0x49')](_0x0605('0x7a'),_['map'](_0x4189ba,'id'));_0x468a3e['where'](_0x0605('0x7a'),_[_0x0605('0x31')](_0x4189ba,'id'));}});})[_0x0605('0x2b')](function(){db[_0x0605('0x94')]['query'](_0x5963c9[_0x0605('0x95')](),_0x2dab29)[_0x0605('0x2b')](function(_0x542597){_0x259102[_0x0605('0x22')]=_0x542597[_0x0605('0x45')];if(_0x259102[_0x0605('0x22')]===0x0)return[];return db[_0x0605('0x94')]['query'](_0x3616a3[_0x0605('0x95')](),_0x2dab29)[_0x0605('0x2b')](function(_0x317b94){_0x18d3ce=_[_0x0605('0x96')](_0x317b94,'id');_0x2dab29=_['merge'](_0x2dab29,{'model':db['SmsInteraction'],'mapToModel':!![],'raw':!![],'nest':!![]});if(_0x141604[_0x0605('0x40')][_0x0605('0x43')]){_0xe7701d['attributes'][_0x0605('0x36')](function(_0x503568){_0x468a3e['field']('i.'+_0x503568);});}else{_0x468a3e[_0x0605('0x4f')](_0x0605('0x8d'),_0x0605('0x8e'));_0x468a3e['field'](_0x0605('0x97'),_0x0605('0x98'));_0x468a3e[_0x0605('0x4f')](_0x0605('0x99'),_0x0605('0x9a'));_0x468a3e[_0x0605('0x4f')](_0x0605('0x9b'));_0x468a3e[_0x0605('0x4f')](_0x0605('0x9c'),_0x0605('0x9d'));_0x468a3e[_0x0605('0x4f')](_0x0605('0x9e'),_0x0605('0x9f'));_0x468a3e[_0x0605('0x4f')](_0x0605('0xa0'),_0x0605('0xa1'));_0x468a3e['field'](_0x0605('0xa2'),_0x0605('0xa3'));_0x468a3e[_0x0605('0x4f')](_0x0605('0xa4'),_0x0605('0xa5'));_0x468a3e['field'](_0x0605('0xa6'),_0x0605('0xa7'));_0x468a3e[_0x0605('0x4f')]('o.fullname',_0x0605('0xa8'));_0x468a3e['field'](_0x0605('0xa9'),'Owner.internal');_0x468a3e['field'](_0x0605('0xaa'),'TagIds');}_0x468a3e['limit'](_0xe7701d[_0x0605('0x24')]);_0x468a3e[_0x0605('0x23')](_0xe7701d[_0x0605('0x23')]);return db[_0x0605('0x94')][_0x0605('0x40')](_0x468a3e[_0x0605('0x95')](),_0x2dab29);})[_0x0605('0x2b')](function(_0x5e5170){_0x44db50[_0x0605('0x49')](_0x0605('0xab'),_[_0x0605('0x31')](_0x5e5170,'id'));return db['sequelize'][_0x0605('0x40')](_0x44db50['toString'](),_0x2dab29)[_0x0605('0x2b')](function(_0x297aa6){var _0x58278d=_[_0x0605('0xac')](_0x297aa6,'SmsInteractionId');var _0x5bc86f=[];_0x5e5170[_0x0605('0x36')](function(_0x36982a){_0x5bc86f[_0x0605('0x37')](updateSmsInteraction(_0x36982a,_0x18d3ce,_0x58278d));});return BPromise['all'](_0x5bc86f);});});})[_0x0605('0x2b')](function(_0x2e47d5){_0x259102[_0x0605('0xad')]=_0x2e47d5;return _0x259102;})[_0x0605('0x2b')](respondWithFilteredResult(_0x2454e0,_0xe7701d));})[_0x0605('0x38')](handleError(_0x2454e0,null));};exports[_0x0605('0xae')]=function(_0x34c660,_0x242836){var _0x329651={'raw':![],'where':{'id':_0x34c660['params']['id']}},_0x307176={};_0x307176[_0x0605('0x3f')]=_[_0x0605('0x76')](db[_0x0605('0x3a')][_0x0605('0x3b')]);_0x307176[_0x0605('0x40')]=_['keys'](_0x34c660[_0x0605('0x40')]);_0x307176['filters']=_[_0x0605('0x42')](_0x307176[_0x0605('0x3f')],_0x307176['query']);_0x329651[_0x0605('0x44')]=_[_0x0605('0x42')](_0x307176[_0x0605('0x3f')],qs[_0x0605('0x43')](_0x34c660[_0x0605('0x40')][_0x0605('0x43')]));_0x329651[_0x0605('0x44')]=_0x329651[_0x0605('0x44')]['length']?_0x329651[_0x0605('0x44')]:_0x307176['model'];if(_0x34c660[_0x0605('0x40')][_0x0605('0xaf')]){_0x329651[_0x0605('0xb0')]=[{'all':!![]}];}_0x329651=_[_0x0605('0xb1')]({},_0x329651,_0x34c660[_0x0605('0xb2')]);return db['SmsInteraction'][_0x0605('0x63')](_0x329651)[_0x0605('0x2b')](handleEntityNotFound(_0x242836,null))[_0x0605('0x2b')](respondWithResult(_0x242836,null))[_0x0605('0x38')](handleError(_0x242836,null));};exports[_0x0605('0xb3')]=function(_0xa940e2,_0x5dd9f3){return db[_0x0605('0x3a')][_0x0605('0xb3')](_0xa940e2[_0x0605('0x75')],{})[_0x0605('0x2b')](respondWithResult(_0x5dd9f3,0xc9))[_0x0605('0x38')](handleError(_0x5dd9f3,null));};exports[_0x0605('0x2a')]=function(_0x8ca49d,_0x52b153){if(_0x8ca49d[_0x0605('0x75')]['id']){delete _0x8ca49d['body']['id'];}return db[_0x0605('0x3a')][_0x0605('0x63')]({'where':{'id':_0x8ca49d['params']['id']}})[_0x0605('0x2b')](handleEntityNotFound(_0x52b153,null))[_0x0605('0x2b')](saveUpdates(_0x8ca49d[_0x0605('0x75')],null))[_0x0605('0x2b')](respondWithResult(_0x52b153,null))[_0x0605('0x38')](handleError(_0x52b153,null));};exports[_0x0605('0x2c')]=function(_0x59bc5d,_0x4aa321){return db[_0x0605('0x3a')]['find']({'where':{'id':_0x59bc5d[_0x0605('0xb4')]['id']}})[_0x0605('0x2b')](handleEntityNotFound(_0x4aa321,null))[_0x0605('0x2b')](removeEntity(_0x4aa321,null))[_0x0605('0x38')](handleError(_0x4aa321,null));};exports[_0x0605('0xb5')]=function(_0x401168,_0x40f96b){return db[_0x0605('0x3a')][_0x0605('0xb5')]()[_0x0605('0x2b')](respondWithResult(_0x40f96b,null))[_0x0605('0x38')](handleError(_0x40f96b,null));};exports[_0x0605('0xb6')]=function(_0x3f34bc,_0x2aca69,_0xbb684a){return db[_0x0605('0xb7')][_0x0605('0x63')]({'where':{'id':_0x3f34bc[_0x0605('0xb4')]['id']}})[_0x0605('0x2b')](handleEntityNotFound(_0x2aca69,null))['then'](function(_0x190bb0){if(_0x190bb0){return _0x190bb0['addMessage'](_0x3f34bc[_0x0605('0x75')][_0x0605('0xb8')],_['omit'](_0x3f34bc[_0x0605('0x75')],[_0x0605('0xb8'),'id'])||{});}})[_0x0605('0x2b')](respondWithResult(_0x2aca69,null))[_0x0605('0x38')](handleError(_0x2aca69,null));};exports[_0x0605('0xb9')]=function(_0xa1577a,_0x14bcbf,_0x58b7ea){var _0x3e2034={'raw':![],'where':{}};var _0x2f0cb5={};var _0x510967={'count':0x0,'rows':[]};return db['SmsInteraction'][_0x0605('0xba')]({'where':{'id':_0xa1577a['params']['id']}})[_0x0605('0x2b')](handleEntityNotFound(_0x14bcbf,null))['then'](function(_0x460753){if(_0x460753){_0x2f0cb5[_0x0605('0x3f')]=_['keys'](db['SmsMessage']['rawAttributes']);_0x2f0cb5[_0x0605('0x40')]=_['keys'](_0xa1577a[_0x0605('0x40')]);_0x2f0cb5['filters']=_[_0x0605('0x42')](_0x2f0cb5[_0x0605('0x3f')],_0x2f0cb5[_0x0605('0x40')]);_0x3e2034[_0x0605('0x44')]=_['intersection'](_0x2f0cb5[_0x0605('0x3f')],qs[_0x0605('0x43')](_0xa1577a[_0x0605('0x40')]['fields']));_0x3e2034['attributes']=_0x3e2034['attributes']['length']?_0x3e2034[_0x0605('0x44')]:_0x2f0cb5[_0x0605('0x3f')];if(!_0xa1577a[_0x0605('0x40')][_0x0605('0x46')](_0x0605('0xbb'))){_0x3e2034[_0x0605('0x24')]=qs[_0x0605('0x24')](_0xa1577a[_0x0605('0x40')][_0x0605('0x24')]);_0x3e2034['offset']=qs[_0x0605('0x23')](_0xa1577a[_0x0605('0x40')][_0x0605('0x23')]);}_0x3e2034[_0x0605('0x47')]=qs['sort'](_0xa1577a[_0x0605('0x40')][_0x0605('0x48')]);_0x3e2034['where']=qs[_0x0605('0x41')](_[_0x0605('0x4a')](_0xa1577a[_0x0605('0x40')],_0x2f0cb5['filters']));_0x3e2034[_0x0605('0x49')][_0x0605('0xbc')]=_0x460753['id'];if(_0xa1577a[_0x0605('0x40')][_0x0605('0x86')]){_0x3e2034[_0x0605('0x49')]=_[_0x0605('0xb1')](_0x3e2034[_0x0605('0x49')],{'$or':_[_0x0605('0x31')](_0x3e2034[_0x0605('0x44')],function(_0x149296){var _0x3b3603={};_0x3b3603[_0x149296]={'$like':'%'+_0xa1577a['query']['filter']+'%'};return _0x3b3603;})});}if(_0xa1577a[_0x0605('0x40')][_0x0605('0xbd')]){var _0x3d3d67=_0xa1577a[_0x0605('0x40')][_0x0605('0xbd')][_0x0605('0x35')](',');var _0x323f07={};_0x323f07[_0x3d3d67[0x0]]={'$gte':moment(_0x3d3d67[0x1])['format']('YYYY-MM-DD\x20HH:mm:ss')};_0x3e2034[_0x0605('0x49')]=_['merge'](_0x3e2034[_0x0605('0x49')],_0x323f07);}_0x3e2034=_['merge']({},_0x3e2034,_0xa1577a[_0x0605('0xb2')]);return db['SmsMessage'][_0x0605('0x22')]({'where':_0x3e2034[_0x0605('0x49')]})[_0x0605('0x2b')](function(_0x3351a7){_0x510967[_0x0605('0x22')]=_0x3351a7;if(_0xa1577a[_0x0605('0x40')][_0x0605('0xaf')]){_0x3e2034[_0x0605('0xb0')]=[{'all':!![]}];}return db[_0x0605('0xb7')]['findAll'](_0x3e2034);})['then'](function(_0x19ccf2){_0x510967[_0x0605('0xad')]=_0x19ccf2;return _0x510967;});}})['then'](respondWithFilteredResult(_0x14bcbf,_0x3e2034))[_0x0605('0x38')](handleError(_0x14bcbf,null));};exports['addTags']=function(_0x4aa8d3,_0x31833f,_0x16a71f){return db[_0x0605('0x3a')][_0x0605('0x63')]({'where':{'id':_0x4aa8d3[_0x0605('0xb4')]['id']}})[_0x0605('0x2b')](handleEntityNotFound(_0x31833f,null))[_0x0605('0x2b')](function(_0xef81ea){if(_0xef81ea){return _0xef81ea['setTags'](_0x4aa8d3[_0x0605('0x75')]['ids'],_[_0x0605('0xbe')](_0x4aa8d3[_0x0605('0x75')],[_0x0605('0xb8'),'id'])||{})[_0x0605('0xbf')](function(){return db[_0x0605('0x6d')][_0x0605('0xc0')]({'attributes':['id',_0x0605('0x2e'),_0x0605('0x4c')],'where':{'id':_0x4aa8d3['body'][_0x0605('0xb8')]}});})[_0x0605('0x2b')](function(_0x4a6fb6){socket[_0x0605('0xc1')]('smsInteractionTags:save',{'id':Number(_0x4aa8d3[_0x0605('0xb4')]['id']),'tags':_0x4a6fb6||[]});return{'id':Number(_0x4aa8d3[_0x0605('0xb4')]['id']),'tags':_0x4a6fb6||[]};});}})[_0x0605('0x2b')](respondWithResult(_0x31833f,null))[_0x0605('0x38')](handleError(_0x31833f,null));};exports[_0x0605('0xc2')]=function(_0x4dffc8,_0x1f91c1,_0x326867){return db[_0x0605('0x3a')]['find']({'where':{'id':_0x4dffc8[_0x0605('0xb4')]['id']}})['then'](handleEntityNotFound(_0x1f91c1,null))[_0x0605('0x2b')](function(_0x1aa8f4){if(_0x1aa8f4){return _0x1aa8f4[_0x0605('0xc2')](_0x4dffc8[_0x0605('0x40')][_0x0605('0xb8')]);}})[_0x0605('0x2b')](respondWithStatusCode(_0x1f91c1,null))[_0x0605('0x38')](handleError(_0x1f91c1,null));};exports[_0x0605('0xc3')]=function(_0x430ec2,_0x244e1f){var _0x3cb5c2=moment()[_0x0605('0xc4')]()[_0x0605('0x95')]();var _0xc7a65b=path[_0x0605('0xc5')](config['root'],_0x0605('0xc6'),'files',_0x0605('0xc7'));var _0x1c4e0=path[_0x0605('0xc5')](config['root'],'server','files',_0x0605('0xc8'));var _0x4525e1=path['join'](_0xc7a65b,_0x3cb5c2);var _0x1c5803=util[_0x0605('0xc9')](_0x0605('0xca'),_0x430ec2[_0x0605('0xb4')]['id'],_0x3cb5c2);var _0x447325=path[_0x0605('0xc5')](_0xc7a65b,_0x1c5803);var _0xa50416=[];_0xa50416[_0x0605('0x37')]({'model':db[_0x0605('0xcb')],'as':_0x0605('0xcb'),'attributes':['id',_0x0605('0x32')],'raw':!![]});_0xa50416['push']({'model':db['CmContact'],'as':'Contact','attributes':['id','firstName',_0x0605('0xcc')],'raw':!![]});var _0x1e60a5=[{'model':db[_0x0605('0xb7')],'as':_0x0605('0xcd'),'attributes':['id',_0x0605('0x75'),_0x0605('0x7c'),_0x0605('0xce'),'secret',_0x0605('0x82')],'include':_0xa50416}];_0x1e60a5['push']({'model':db['SmsAccount'],'as':_0x0605('0xcf'),'attributes':['id',_0x0605('0x2e')]});_0x1e60a5[_0x0605('0x37')]({'model':db[_0x0605('0xcb')],'as':_0x0605('0xd0'),'attributes':['id',_0x0605('0x32')]});return db[_0x0605('0x3a')][_0x0605('0x63')]({'where':{'id':_0x430ec2[_0x0605('0xb4')]['id']},'include':_0x1e60a5})[_0x0605('0x2b')](handleEntityNotFound(_0x244e1f,null))[_0x0605('0x2b')](function(_0xcc3c98){if(_0xcc3c98){var _0x359444=_0xcc3c98[_0x0605('0xd1')]({'plain':!![]});fs[_0x0605('0xd2')](_0x4525e1);var _0x4531cf={'format':'A4','border':_0x0605('0xd3'),'header':{'height':_0x0605('0xd4'),'contents':{'first':_0x0605('0xd5')}},'footer':{'height':'30px','contents':{'default':util['format'](_0x0605('0xd6'),util['format'](_0x0605('0xd7'),'Sms',_0x359444['id']),moment()['format']('YYYY-MM-DD')['toString']())}}};var _0x2f8852={'channel':_0x0605('0xd8'),'account':_0x359444[_0x0605('0xcf')]['name'],'agent':_0x359444['Owner']?_0x359444['Owner']['fullname']:_0x0605('0xd9'),'createdAt':moment(_0x359444[_0x0605('0x7c')])[_0x0605('0xc9')](_0x0605('0xda'))['toString'](),'closedAt':_0x359444[_0x0605('0xdb')]?moment(_0x359444[_0x0605('0xdc')])[_0x0605('0xc9')](_0x0605('0xda'))[_0x0605('0x95')]():'','disposition':_0x359444[_0x0605('0xdd')],'messages':_(_0x359444[_0x0605('0xcd')])[_0x0605('0x86')]({'secret':![]})[_0x0605('0x31')](function(_0x153eeb){return{'date':moment(_0x153eeb[_0x0605('0x7c')])[_0x0605('0xc9')](_0x0605('0xda'))[_0x0605('0x95')](),'sender':_0x153eeb[_0x0605('0xce')]===_0x0605('0xde')?_0x153eeb['User']?_0x153eeb[_0x0605('0xcb')][_0x0605('0x32')]:'System':_0x153eeb[_0x0605('0x67')]['firstName']+(_0x153eeb[_0x0605('0x67')][_0x0605('0xcc')]?'\x20'+_0x153eeb['Contact']['lastName']:''),'body':_0x153eeb[_0x0605('0x75')],'direction':_0x153eeb[_0x0605('0xce')]===_0x0605('0xde')?'A':'C','secret':_0x153eeb['secret'],'read':_0x153eeb['read']};})[_0x0605('0x64')]()};return ejs[_0x0605('0xdf')](path['join'](config[_0x0605('0xe0')],_0x0605('0xc6'),_0x0605('0xe1'),_0x0605('0xe2')),{'interaction':_0x2f8852})[_0x0605('0x2b')](function(_0x453a87){return new BPromise(function(_0x25a7a3,_0x1cf664){pdf[_0x0605('0xb3')](_0x453a87,_0x4531cf)[_0x0605('0xe3')](path[_0x0605('0xc5')](_0x4525e1,_0x0605('0xe4')+_0x359444['id']+'-'+_0x3cb5c2+_0x0605('0xe5')),function(_0x35e6b3,_0x225726){if(_0x35e6b3)return _0x1cf664(_0x35e6b3);_0x25a7a3(_0x225726);});});})[_0x0605('0x2b')](function(){return new BPromise(function(_0x1fe0d9,_0x50b9c0){zipdir(_0x4525e1,{'saveTo':_0x447325},function(_0x30d63d,_0xed4564){if(_0x30d63d)return _0x50b9c0(_0x30d63d);return _0x1fe0d9(_0xed4564);});})[_0x0605('0x2b')](function(){return new BPromise(function(_0x8281b5,_0x2ea5da){rimraf(_0x4525e1,function(_0x1790b4){if(_0x1790b4)_0x2ea5da(_0x1790b4);return _0x8281b5();});});})[_0x0605('0x2b')](function(){return _0x244e1f[_0x0605('0xc3')](_0x447325,_0x1c5803,function(_0x2a513a){if(_0x2a513a){console[_0x0605('0xe6')](_0x0605('0xe7'),_0x2a513a);}else{fs[_0x0605('0xe8')](_0x447325);}});});});}else{return _0x244e1f[_0x0605('0x1e')](0xc8);}})[_0x0605('0x38')](handleError(_0x244e1f,null));};
\ No newline at end of file
+var _0x9536=['i.SmsAccountId\x20IN\x20?','concat','parse','$gte','$lte','i.createdAt\x20BETWEEN\x20?\x20AND\x20?','null','\x20IS\x20NULL','read','`unreadMessages`\x20=\x200','`unreadMessages`\x20>\x200','isArray','tag','CONCAT(\x27,\x27,\x20`TagIds`,\x20\x27,\x27)\x20LIKE\x20?','filter','replace','\x27\x27\x27\x27','isNumeric','i.phone\x20LIKE\x20?','MATCH\x20(me.body)\x20AGAINST\x20(?\x20IN\x20BOOLEAN\x20MODE)','group','i.id','QueryTypes','SELECT','clone','SUM(me.read\x20=\x200\x20AND\x20me.direction\x20=\x20\x27in\x27)','isEmpty','t.id\x20IN\x20?','resolve','journey','i.SmsAccountId\x20IS\x20NOT\x20NULL','user','getSmsAccounts','i.SmsAccountId\x20IS\x20NULL','sequelize','toString','keyBy','merge','SmsInteraction','unreadMessages','a.key','Account.key','a.mandatoryDisposition','Account.mandatoryDisposition','c.firstName','Contact.firstName','c.lastName','c.email','Contact.email','c.phone','Contact.phone','c.mobile','c.fax','Contact.fax','o.fullname','Owner.fullname','o.internal','GROUP_CONCAT(DISTINCT\x20t.id)','ui.SmsInteractionId\x20IN\x20?','groupBy','SmsInteractionId','push','all','rows','catch','show','params','includeAll','include','options','create','update','destroy','describe','addMessage','SmsMessage','ids','omit','getMessages','findOne','pick','format','YYYY-MM-DD\x20HH:mm:ss','findAll','addTags','setTags','color','emit','smsInteractionTags:save','removeTags','download','unix','join','root','server','files','tmp','attachments','transcript-%d-%s.zip','CmContact','lastName','Messages','createdAt','direction','secret','SmsAccount','Account','Owner','get','mkdirSync','10px','40px','\x0a\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20
Interaction\x20Transcript \x0a\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20','30px',' \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','closed','disposition','out','System','firstName','renderFile','views','downloadInteraction.html','toFile','transcript-','.pdf','err','unlinkSync','html-pdf','eml-format','rimraf','zip-dir','request-promise','bluebird','mustache','util','path','sox','ejs','lodash','squel','crypto','jsforce','to-csv','querystring','papaparse','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/environment','../../mysqldb','defaults','localhost','socket.io-emitter','redis','./smsInteraction.socket','register','sendStatus','status','end','json','count','offset','set','Content-Range','apply','save','then','error','name','send','map','fullname','TagIds','Tags','split','forEach','index','rawAttributes','fieldName','type','key','model','query','keys','filters','intersection','attributes','fields','hasOwnProperty','nolimit','limit','order','sort','where','select','field','tools_tags','u.fullname','ui.SmsInteractionId','user_has_sms_interactions','left_join','u.id\x20=\x20ui.UserId','from','sms_interactions','cm_contacts','c.id\x20=\x20i.ContactId\x20AND\x20c.deletedAt\x20IS\x20NULL','users','o.id\x20=\x20i.UserId','sms_accounts','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','conditions','length','find','value','having','`\x20>\x200','Contact','getFullTextValue','c.firstName\x20LIKE\x20?\x20OR\x20c.lastName\x20LIKE\x20?\x20OR\x20c.email\x20LIKE\x20?','ContactId','text','start','Tag','union','User','$substring','CONCAT_WS(\x27\x20\x27,\x20o.name,\x20o.fullname)\x20LIKE\x20?','UserId','body','buildExpression','some','compact'];(function(_0x40a045,_0x516f0e){var _0x1a687c=function(_0x48c9fe){while(--_0x48c9fe){_0x40a045['push'](_0x40a045['shift']());}};_0x1a687c(++_0x516f0e);}(_0x9536,0x179));var _0x6953=function(_0x49fcfb,_0x504dec){_0x49fcfb=_0x49fcfb-0x0;var _0x964926=_0x9536[_0x49fcfb];return _0x964926;};'use strict';var pdf=require(_0x6953('0x0'));var emlformat=require(_0x6953('0x1'));var rimraf=require(_0x6953('0x2'));var zipdir=require(_0x6953('0x3'));var jsonpatch=require('fast-json-patch');var rp=require(_0x6953('0x4'));var moment=require('moment');var BPromise=require(_0x6953('0x5'));var Mustache=require(_0x6953('0x6'));var util=require(_0x6953('0x7'));var path=require(_0x6953('0x8'));var sox=require(_0x6953('0x9'));var csv=require('to-csv');var ejs=require(_0x6953('0xa'));var fs=require('fs');var _=require(_0x6953('0xb'));var squel=require(_0x6953('0xc'));var crypto=require(_0x6953('0xd'));var jsforce=require(_0x6953('0xe'));var deskjs=require('desk.js');var toCsv=require(_0x6953('0xf'));var querystring=require(_0x6953('0x10'));var Papa=require(_0x6953('0x11'));var Redis=require('ioredis');var authService=require(_0x6953('0x12'));var qs=require(_0x6953('0x13'));var as=require(_0x6953('0x14'));var hardwareService=require(_0x6953('0x15'));var logger=require(_0x6953('0x16'))(_0x6953('0x17'));var utils=require(_0x6953('0x18'));var config=require(_0x6953('0x19'));var db=require(_0x6953('0x1a'))['db'];config['redis']=_[_0x6953('0x1b')](config['redis'],{'host':_0x6953('0x1c'),'port':0x18eb});var socket=require(_0x6953('0x1d'))(new Redis(config[_0x6953('0x1e')]));require(_0x6953('0x1f'))[_0x6953('0x20')](socket);function respondWithStatusCode(_0x244713,_0x175fa9){_0x175fa9=_0x175fa9||0xcc;return function(_0x27a57c){if(_0x27a57c){return _0x244713[_0x6953('0x21')](_0x175fa9);}return _0x244713[_0x6953('0x22')](_0x175fa9)[_0x6953('0x23')]();};}function respondWithResult(_0x548473,_0x5f49db){_0x5f49db=_0x5f49db||0xc8;return function(_0x399b9b){if(_0x399b9b){return _0x548473[_0x6953('0x22')](_0x5f49db)[_0x6953('0x24')](_0x399b9b);}};}function respondWithFilteredResult(_0x16251d,_0x510d46){return function(_0x1b6dcb){if(_0x1b6dcb){var _0x2da771=_0x1b6dcb[_0x6953('0x25')],_0x4b43ae=_0x510d46[_0x6953('0x26')],_0x10858a=_0x510d46[_0x6953('0x26')]+_0x510d46['limit'],_0x3207dd;if(_0x10858a>=_0x2da771){_0x10858a=_0x2da771;_0x3207dd=0xc8;}else{_0x3207dd=0xce;}_0x16251d[_0x6953('0x22')](_0x3207dd);return _0x16251d[_0x6953('0x27')](_0x6953('0x28'),_0x4b43ae+'-'+_0x10858a+'/'+_0x2da771)[_0x6953('0x24')](_0x1b6dcb);}return null;};}function patchUpdates(_0x41f021){return function(_0x5e33ec){try{jsonpatch[_0x6953('0x29')](_0x5e33ec,_0x41f021,!![]);}catch(_0x1388b7){return BPromise['reject'](_0x1388b7);}return _0x5e33ec[_0x6953('0x2a')]();};}function saveUpdates(_0x40c9d1,_0xb92529){return function(_0x171dd8){if(_0x171dd8){return _0x171dd8['update'](_0x40c9d1)[_0x6953('0x2b')](function(_0x231cb2){return _0x231cb2;});}return null;};}function removeEntity(_0x2a7f6a,_0x508ea7){return function(_0x495ebd){if(_0x495ebd){return _0x495ebd['destroy']()[_0x6953('0x2b')](function(){_0x2a7f6a[_0x6953('0x22')](0xcc)['end']();});}};}function handleEntityNotFound(_0x1a32f4,_0x587df0){return function(_0x328f67){if(!_0x328f67){_0x1a32f4[_0x6953('0x21')](0x194);}return _0x328f67;};}function handleError(_0xcdbce8,_0x2cc01e){_0x2cc01e=_0x2cc01e||0x1f4;return function(_0x191d80){logger[_0x6953('0x2c')](_0x191d80['stack']);if(_0x191d80[_0x6953('0x2d')]){delete _0x191d80[_0x6953('0x2d')];}_0xcdbce8['status'](_0x2cc01e)[_0x6953('0x2e')](_0x191d80);};}function getInteractionUsers(_0x4af39d,_0x173b3c){return new BPromise(function(_0x3b1175,_0x426c7c){try{if(_0x173b3c[_0x4af39d['id']]){_0x4af39d['Users']=_[_0x6953('0x2f')](_0x173b3c[_0x4af39d['id']],function(_0x3d7b04){return{'id':_0x3d7b04['id'],'fullname':_0x3d7b04[_0x6953('0x30')]};});}}catch(_0x47ed2f){_0x426c7c(_0x47ed2f);}_0x3b1175(_0x4af39d);});}function getInteractionTags(_0x4c49fc,_0x132a71){return new BPromise(function(_0x481c6a,_0x4d856d){try{if(_0x4c49fc[_0x6953('0x31')]){_0x4c49fc[_0x6953('0x32')]=[];_0x4c49fc[_0x6953('0x31')][_0x6953('0x33')](',')[_0x6953('0x34')](function(_0x56ce8e){_0x4c49fc[_0x6953('0x32')]['push'](_0x132a71[_0x56ce8e]);});}delete _0x4c49fc[_0x6953('0x31')];}catch(_0x2e85c7){_0x4d856d(_0x2e85c7);}_0x481c6a(_0x4c49fc);});}function updateSmsInteraction(_0x4ba704,_0x4a4d41,_0x1f77a6){return new BPromise(function(_0x1ad003,_0x34d10b){return getInteractionUsers(_0x4ba704,_0x1f77a6)['then'](function(_0x28cb92){return getInteractionTags(_0x28cb92,_0x4a4d41);})['then'](function(_0x4e95f1){_0x1ad003(_0x4e95f1);})['catch'](function(_0x5c4a8a){_0x34d10b(_0x5c4a8a);});});}exports[_0x6953('0x35')]=function(_0x6c7862,_0x2c7160){var _0x11f316={},_0x1b0c56={},_0x2ce31f={'count':0x0,'rows':[]};var _0x4f6e06=_[_0x6953('0x2f')](db['SmsInteraction'][_0x6953('0x36')],function(_0x5c9a4e){return{'name':_0x5c9a4e[_0x6953('0x37')],'type':_0x5c9a4e[_0x6953('0x38')][_0x6953('0x39')]};});_0x1b0c56[_0x6953('0x3a')]=_['map'](_0x4f6e06,_0x6953('0x2d'));_0x1b0c56[_0x6953('0x3b')]=_[_0x6953('0x3c')](_0x6c7862[_0x6953('0x3b')]);_0x1b0c56[_0x6953('0x3d')]=_[_0x6953('0x3e')](_0x1b0c56[_0x6953('0x3a')],_0x1b0c56[_0x6953('0x3b')]);_0x11f316[_0x6953('0x3f')]=_[_0x6953('0x3e')](_0x1b0c56[_0x6953('0x3a')],qs['fields'](_0x6c7862[_0x6953('0x3b')][_0x6953('0x40')]));_0x11f316[_0x6953('0x3f')]=_0x11f316['attributes']['length']?_0x11f316[_0x6953('0x3f')]:_0x1b0c56['model'];if(!_0x6c7862['query'][_0x6953('0x41')](_0x6953('0x42'))){_0x11f316['limit']=qs[_0x6953('0x43')](_0x6c7862[_0x6953('0x3b')][_0x6953('0x43')]);_0x11f316[_0x6953('0x26')]=qs[_0x6953('0x26')](_0x6c7862[_0x6953('0x3b')]['offset']);}_0x11f316[_0x6953('0x44')]=qs[_0x6953('0x45')](_0x6c7862[_0x6953('0x3b')][_0x6953('0x45')]);_0x11f316[_0x6953('0x46')]=qs[_0x6953('0x3d')](_['pick'](_0x6c7862['query'],_0x1b0c56[_0x6953('0x3d')]));var _0x54d7c2=[];var _0x588ff8=squel[_0x6953('0x47')]()[_0x6953('0x48')]('id')[_0x6953('0x48')](_0x6953('0x2d'))[_0x6953('0x48')]('color')['from'](_0x6953('0x49'));var _0x452b69=squel['select']()[_0x6953('0x48')]('u.id')[_0x6953('0x48')](_0x6953('0x4a'))[_0x6953('0x48')](_0x6953('0x4b'))['from'](_0x6953('0x4c'),'ui')[_0x6953('0x4d')]('users','u',_0x6953('0x4e'));var _0x296d81=squel[_0x6953('0x47')]()[_0x6953('0x4f')](_0x6953('0x50'),'i')[_0x6953('0x4d')](_0x6953('0x51'),'c',_0x6953('0x52'))[_0x6953('0x4d')](_0x6953('0x53'),'o',_0x6953('0x54'))['left_join'](_0x6953('0x55'),'a','a.id\x20=\x20i.SmsAccountId')[_0x6953('0x4d')](_0x6953('0x56'),'me',_0x6953('0x57'))['left_join'](_0x6953('0x58'),'it',_0x6953('0x59'))['left_join']('tools_tags','t',_0x6953('0x5a'));var _0x265b44=squel[_0x6953('0x5b')]();var _0x36d75a=[];var _0x23207e=squel[_0x6953('0x5b')]();var _0x1443f4;if(_0x6c7862[_0x6953('0x3b')][_0x6953('0x5c')]){_0x1443f4=as[_0x6953('0x5d')](_0x6c7862[_0x6953('0x3b')]['search']);var _0x5d3172=_0x1443f4[_0x6953('0x5e')];for(var _0x38e3e8=0x0;_0x38e3e8<_0x1443f4[_0x6953('0x5f')][_0x6953('0x60')];_0x38e3e8++){var _0xd9a3a6=_0x1443f4[_0x6953('0x5f')][_0x38e3e8];var _0x322117='i';var _0x238ab2=_[_0x6953('0x61')](_0x4f6e06,['name',_0xd9a3a6['field']]);if(!_0x238ab2){switch(_0xd9a3a6['field']){case'unreadMessages':if(_0xd9a3a6[_0x6953('0x62')]==0x1){_0x296d81[_0x6953('0x63')]('`'+_0xd9a3a6[_0x6953('0x48')]+'`\x20=\x200');}else{_0x296d81['having']('`'+_0xd9a3a6[_0x6953('0x48')]+_0x6953('0x64'));}break;case _0x6953('0x65'):if(_0xd9a3a6['operator']==='$substring'){if(_0xd9a3a6[_0x6953('0x62')][_0x6953('0x33')]('\x20')['length']>0x1){_0x265b44[_0x5d3172]('MATCH\x20(c.firstName,\x20c.lastName,\x20c.phone,\x20c.mobile,\x20c.fax,\x20c.email)\x20AGAINST\x20(?\x20IN\x20BOOLEAN\x20MODE)',qs[_0x6953('0x66')](_0xd9a3a6[_0x6953('0x62')]),null);}else{var _0x414096='%'+_0xd9a3a6[_0x6953('0x62')]+'%';_0x265b44[_0x5d3172](_0x6953('0x67'),_0x414096,_0x414096,_0x414096);}}else{_0x238ab2=_['find'](_0x4f6e06,[_0x6953('0x2d'),_0x6953('0x68')]);_0xd9a3a6['field']=_0x6953('0x68');_0xe93bf2=as['buildExpression'](_0x322117,_0x238ab2[_0x6953('0x38')],_0xd9a3a6);_0x265b44[_0x5d3172](_0xe93bf2[_0x6953('0x69')],_0xe93bf2[_0x6953('0x62')][_0x6953('0x6a')],_0xe93bf2['value'][_0x6953('0x23')]);}break;case _0x6953('0x6b'):var _0x38b3b1=_0xd9a3a6['value']['split'](',')[_0x6953('0x2f')](function(_0x224ce6){return Number(_0x224ce6);});_0x38b3b1[_0x6953('0x34')](function(_0x482f3b){_0x23207e['or']('CONCAT(\x27,\x27,\x20`TagIds`,\x20\x27,\x27)\x20LIKE\x20?','%,'+_0x482f3b+',%');});_0x36d75a=_[_0x6953('0x6c')](_0x36d75a,_0x38b3b1);break;case _0x6953('0x6d'):if(_0xd9a3a6['operator']===_0x6953('0x6e')){_0x265b44[_0x5d3172](_0x6953('0x6f'),'%'+_0xd9a3a6['value']+'%',null);}else{_0x238ab2=_[_0x6953('0x61')](_0x4f6e06,[_0x6953('0x2d'),_0x6953('0x70')]);_0xd9a3a6[_0x6953('0x48')]=_0x6953('0x70');_0xe93bf2=as['buildExpression'](_0x322117,_0x238ab2[_0x6953('0x38')],_0xd9a3a6);_0x265b44[_0x5d3172](_0xe93bf2[_0x6953('0x69')],_0xe93bf2[_0x6953('0x62')]['start'],_0xe93bf2['value'][_0x6953('0x23')]);}break;case _0x6953('0x71'):_0xe93bf2=as[_0x6953('0x72')]('me',null,_0xd9a3a6);_0x265b44[_0x5d3172](_0xe93bf2[_0x6953('0x69')],_0xe93bf2[_0x6953('0x62')]['start'],_0xe93bf2[_0x6953('0x62')][_0x6953('0x23')]);break;}}else{var _0xe93bf2=as[_0x6953('0x72')](_0x322117,_0x238ab2[_0x6953('0x38')],_0xd9a3a6);_0x265b44[_0x5d3172](_0xe93bf2[_0x6953('0x69')],_0xe93bf2[_0x6953('0x62')][_0x6953('0x6a')],_0xe93bf2[_0x6953('0x62')][_0x6953('0x23')]);}}}else{var _0xb26c63=_(_0x6c7862[_0x6953('0x3b')])[_0x6953('0x3c')]()['map'](function(_0x398e2c){return _[_0x6953('0x73')](_0x4f6e06,[_0x6953('0x2d'),_0x398e2c])?_0x398e2c:undefined;})[_0x6953('0x74')]()[_0x6953('0x62')]();if(!_['isEmpty'](_0xb26c63)){_0xb26c63['forEach'](function(_0x310a90){if(_0x310a90==='SmsAccountId'){_0x296d81[_0x6953('0x46')](_0x6953('0x75'),[][_0x6953('0x76')](_0x6c7862[_0x6953('0x3b')][_0x310a90]));}else if(_0x310a90==='createdAt'){var _0x35c6b8=JSON[_0x6953('0x77')](_0x6c7862[_0x6953('0x3b')][_0x310a90])[_0x6953('0x78')];var _0x1c3190=JSON[_0x6953('0x77')](_0x6c7862[_0x6953('0x3b')][_0x310a90])[_0x6953('0x79')];_0x296d81[_0x6953('0x46')](_0x6953('0x7a'),_0x35c6b8,_0x1c3190);}else{if(_0x6c7862[_0x6953('0x3b')][_0x310a90]===_0x6953('0x7b')){_0x296d81[_0x6953('0x46')]('i.'+_0x310a90+_0x6953('0x7c'));}else{_0x296d81[_0x6953('0x46')]('i.'+_0x310a90+'\x20=\x20?',_0x6c7862[_0x6953('0x3b')][_0x310a90]);}}});}if(_0x6c7862[_0x6953('0x3b')][_0x6953('0x7d')]){if(_0x6c7862[_0x6953('0x3b')][_0x6953('0x7d')]==0x1){_0x296d81[_0x6953('0x63')](_0x6953('0x7e'));}else{_0x296d81['having'](_0x6953('0x7f'));}}if(_0x6c7862[_0x6953('0x3b')]['tag']){_0x36d75a=_[_0x6953('0x80')](_0x6c7862[_0x6953('0x3b')][_0x6953('0x81')])?_0x6c7862['query']['tag']:new Array(_0x6c7862[_0x6953('0x3b')][_0x6953('0x81')]);_0x36d75a[_0x6953('0x34')](function(_0x2d173b){_0x23207e['or'](_0x6953('0x82'),'%,'+_0x2d173b+',%');});}if(_0x6c7862[_0x6953('0x3b')][_0x6953('0x83')]){var _0x1515a9=_0x6c7862[_0x6953('0x3b')]['filter'][_0x6953('0x84')]('\x5c','\x5c\x5c')[_0x6953('0x84')]('\x27\x27',_0x6953('0x85'));if(qs[_0x6953('0x86')](_0x1515a9)){_0x265b44['or']('i.id\x20LIKE\x20?',_0x1515a9+'%')['or'](_0x6953('0x87'),_0x1515a9+'%');}else{_0x265b44['or'](_0x6953('0x88'),qs[_0x6953('0x66')](_0x1515a9))['or']('CONCAT(c.firstName,\x20\x27\x20\x27,\x20c.lastName)\x20LIKE\x20?',_0x1515a9+'%');}}}_0x296d81[_0x6953('0x46')](_0x265b44);_0x296d81[_0x6953('0x89')](_0x6953('0x8a'));var _0x1b9588={'type':db['Sequelize'][_0x6953('0x8b')][_0x6953('0x8c')],'raw':!![]};var _0x328191=_0x296d81[_0x6953('0x8d')]();_0x328191['field']('i.id');_0x328191[_0x6953('0x48')](_0x6953('0x8e'),'unreadMessages');if(_0x11f316['order']){_0x11f316[_0x6953('0x44')][_0x6953('0x34')](function(_0x30fcd5){_0x296d81[_0x6953('0x44')]('i.'+_0x30fcd5[0x0],_0x30fcd5[0x1]==='DESC'?![]:!![]);});}if(!_[_0x6953('0x8f')](_0x36d75a)){_0x296d81[_0x6953('0x63')](_0x23207e);_0x328191['where'](_0x6953('0x90'),_0x36d75a);}BPromise[_0x6953('0x91')]()['then'](function(){if(!_0x1443f4){if(_0x6c7862['query']['SmsAccountId']||_0x6c7862[_0x6953('0x3b')][_0x6953('0x92')])return;_0x328191[_0x6953('0x46')](_0x6953('0x93'));_0x296d81[_0x6953('0x46')](_0x6953('0x93'));return;}return _0x6c7862[_0x6953('0x94')][_0x6953('0x95')]({'attributes':['id'],'raw':!![]})['then'](function(_0x3e74e0){if(_[_0x6953('0x8f')](_0x3e74e0)){_0x328191[_0x6953('0x46')](_0x6953('0x96'));_0x296d81[_0x6953('0x46')](_0x6953('0x96'));}else{_0x328191['where'](_0x6953('0x75'),_['map'](_0x3e74e0,'id'));_0x296d81[_0x6953('0x46')]('i.SmsAccountId\x20IN\x20?',_[_0x6953('0x2f')](_0x3e74e0,'id'));}});})[_0x6953('0x2b')](function(){db[_0x6953('0x97')]['query'](_0x328191[_0x6953('0x98')](),_0x1b9588)[_0x6953('0x2b')](function(_0x6a942a){_0x2ce31f[_0x6953('0x25')]=_0x6a942a[_0x6953('0x60')];if(_0x2ce31f[_0x6953('0x25')]===0x0)return[];return db['sequelize'][_0x6953('0x3b')](_0x588ff8[_0x6953('0x98')](),_0x1b9588)[_0x6953('0x2b')](function(_0x4464d1){_0x54d7c2=_[_0x6953('0x99')](_0x4464d1,'id');_0x1b9588=_[_0x6953('0x9a')](_0x1b9588,{'model':db[_0x6953('0x9b')],'mapToModel':!![],'raw':!![],'nest':!![]});if(_0x6c7862[_0x6953('0x3b')][_0x6953('0x40')]){_0x11f316[_0x6953('0x3f')][_0x6953('0x34')](function(_0x47c935){_0x296d81[_0x6953('0x48')]('i.'+_0x47c935);});}else{_0x296d81[_0x6953('0x48')](_0x6953('0x8e'),_0x6953('0x9c'));_0x296d81[_0x6953('0x48')](_0x6953('0x9d'),_0x6953('0x9e'));_0x296d81[_0x6953('0x48')](_0x6953('0x9f'),_0x6953('0xa0'));_0x296d81[_0x6953('0x48')]('i.*');_0x296d81[_0x6953('0x48')](_0x6953('0xa1'),_0x6953('0xa2'));_0x296d81['field'](_0x6953('0xa3'),'Contact.lastName');_0x296d81['field'](_0x6953('0xa4'),_0x6953('0xa5'));_0x296d81[_0x6953('0x48')](_0x6953('0xa6'),_0x6953('0xa7'));_0x296d81[_0x6953('0x48')](_0x6953('0xa8'),'Contact.mobile');_0x296d81[_0x6953('0x48')](_0x6953('0xa9'),_0x6953('0xaa'));_0x296d81['field'](_0x6953('0xab'),_0x6953('0xac'));_0x296d81['field'](_0x6953('0xad'),'Owner.internal');_0x296d81['field'](_0x6953('0xae'),'TagIds');}_0x296d81['limit'](_0x11f316[_0x6953('0x43')]);_0x296d81[_0x6953('0x26')](_0x11f316[_0x6953('0x26')]);return db['sequelize'][_0x6953('0x3b')](_0x296d81[_0x6953('0x98')](),_0x1b9588);})['then'](function(_0x30de2c){_0x452b69[_0x6953('0x46')](_0x6953('0xaf'),_[_0x6953('0x2f')](_0x30de2c,'id'));return db[_0x6953('0x97')][_0x6953('0x3b')](_0x452b69[_0x6953('0x98')](),_0x1b9588)[_0x6953('0x2b')](function(_0xce6912){var _0x594098=_[_0x6953('0xb0')](_0xce6912,_0x6953('0xb1'));var _0x52ba59=[];_0x30de2c[_0x6953('0x34')](function(_0x4442c7){_0x52ba59[_0x6953('0xb2')](updateSmsInteraction(_0x4442c7,_0x54d7c2,_0x594098));});return BPromise[_0x6953('0xb3')](_0x52ba59);});});})[_0x6953('0x2b')](function(_0x300be9){_0x2ce31f[_0x6953('0xb4')]=_0x300be9;return _0x2ce31f;})['then'](respondWithFilteredResult(_0x2c7160,_0x11f316));})[_0x6953('0xb5')](handleError(_0x2c7160,null));};exports[_0x6953('0xb6')]=function(_0x1481a1,_0x12e2ec){var _0x29e68e={'raw':![],'where':{'id':_0x1481a1[_0x6953('0xb7')]['id']}},_0xa54eb8={};_0xa54eb8[_0x6953('0x3a')]=_[_0x6953('0x3c')](db['SmsInteraction'][_0x6953('0x36')]);_0xa54eb8['query']=_[_0x6953('0x3c')](_0x1481a1['query']);_0xa54eb8[_0x6953('0x3d')]=_[_0x6953('0x3e')](_0xa54eb8[_0x6953('0x3a')],_0xa54eb8[_0x6953('0x3b')]);_0x29e68e[_0x6953('0x3f')]=_['intersection'](_0xa54eb8[_0x6953('0x3a')],qs['fields'](_0x1481a1[_0x6953('0x3b')][_0x6953('0x40')]));_0x29e68e[_0x6953('0x3f')]=_0x29e68e[_0x6953('0x3f')]['length']?_0x29e68e[_0x6953('0x3f')]:_0xa54eb8[_0x6953('0x3a')];if(_0x1481a1[_0x6953('0x3b')][_0x6953('0xb8')]){_0x29e68e[_0x6953('0xb9')]=[{'all':!![]}];}_0x29e68e=_[_0x6953('0x9a')]({},_0x29e68e,_0x1481a1[_0x6953('0xba')]);return db['SmsInteraction'][_0x6953('0x61')](_0x29e68e)[_0x6953('0x2b')](handleEntityNotFound(_0x12e2ec,null))[_0x6953('0x2b')](respondWithResult(_0x12e2ec,null))[_0x6953('0xb5')](handleError(_0x12e2ec,null));};exports[_0x6953('0xbb')]=function(_0x575b5f,_0x5df973){return db['SmsInteraction'][_0x6953('0xbb')](_0x575b5f[_0x6953('0x71')],{})[_0x6953('0x2b')](respondWithResult(_0x5df973,0xc9))['catch'](handleError(_0x5df973,null));};exports[_0x6953('0xbc')]=function(_0x5268ba,_0x2fe7b8){if(_0x5268ba[_0x6953('0x71')]['id']){delete _0x5268ba['body']['id'];}return db[_0x6953('0x9b')]['find']({'where':{'id':_0x5268ba[_0x6953('0xb7')]['id']}})['then'](handleEntityNotFound(_0x2fe7b8,null))['then'](saveUpdates(_0x5268ba[_0x6953('0x71')],null))[_0x6953('0x2b')](respondWithResult(_0x2fe7b8,null))[_0x6953('0xb5')](handleError(_0x2fe7b8,null));};exports[_0x6953('0xbd')]=function(_0x31622e,_0x82389){return db[_0x6953('0x9b')][_0x6953('0x61')]({'where':{'id':_0x31622e['params']['id']}})['then'](handleEntityNotFound(_0x82389,null))['then'](removeEntity(_0x82389,null))[_0x6953('0xb5')](handleError(_0x82389,null));};exports[_0x6953('0xbe')]=function(_0x55ed86,_0x21d751){return db[_0x6953('0x9b')]['describe']()[_0x6953('0x2b')](respondWithResult(_0x21d751,null))[_0x6953('0xb5')](handleError(_0x21d751,null));};exports[_0x6953('0xbf')]=function(_0x20931d,_0x375fdb,_0x30c47d){return db[_0x6953('0xc0')][_0x6953('0x61')]({'where':{'id':_0x20931d['params']['id']}})[_0x6953('0x2b')](handleEntityNotFound(_0x375fdb,null))['then'](function(_0x407d7e){if(_0x407d7e){return _0x407d7e[_0x6953('0xbf')](_0x20931d[_0x6953('0x71')][_0x6953('0xc1')],_[_0x6953('0xc2')](_0x20931d[_0x6953('0x71')],['ids','id'])||{});}})[_0x6953('0x2b')](respondWithResult(_0x375fdb,null))['catch'](handleError(_0x375fdb,null));};exports[_0x6953('0xc3')]=function(_0x19a383,_0x3f4e63,_0x3f9df1){var _0x109ed2={'raw':![],'where':{}};var _0xff4342={};var _0xa5f5d4={'count':0x0,'rows':[]};return db[_0x6953('0x9b')][_0x6953('0xc4')]({'where':{'id':_0x19a383[_0x6953('0xb7')]['id']}})[_0x6953('0x2b')](handleEntityNotFound(_0x3f4e63,null))[_0x6953('0x2b')](function(_0x25e560){if(_0x25e560){_0xff4342[_0x6953('0x3a')]=_['keys'](db[_0x6953('0xc0')]['rawAttributes']);_0xff4342['query']=_['keys'](_0x19a383[_0x6953('0x3b')]);_0xff4342[_0x6953('0x3d')]=_[_0x6953('0x3e')](_0xff4342[_0x6953('0x3a')],_0xff4342[_0x6953('0x3b')]);_0x109ed2[_0x6953('0x3f')]=_[_0x6953('0x3e')](_0xff4342[_0x6953('0x3a')],qs[_0x6953('0x40')](_0x19a383[_0x6953('0x3b')][_0x6953('0x40')]));_0x109ed2[_0x6953('0x3f')]=_0x109ed2[_0x6953('0x3f')]['length']?_0x109ed2[_0x6953('0x3f')]:_0xff4342[_0x6953('0x3a')];if(!_0x19a383[_0x6953('0x3b')][_0x6953('0x41')]('nolimit')){_0x109ed2[_0x6953('0x43')]=qs[_0x6953('0x43')](_0x19a383['query'][_0x6953('0x43')]);_0x109ed2[_0x6953('0x26')]=qs[_0x6953('0x26')](_0x19a383[_0x6953('0x3b')][_0x6953('0x26')]);}_0x109ed2['order']=qs[_0x6953('0x45')](_0x19a383[_0x6953('0x3b')][_0x6953('0x45')]);_0x109ed2[_0x6953('0x46')]=qs[_0x6953('0x3d')](_[_0x6953('0xc5')](_0x19a383[_0x6953('0x3b')],_0xff4342[_0x6953('0x3d')]));_0x109ed2[_0x6953('0x46')][_0x6953('0xb1')]=_0x25e560['id'];if(_0x19a383[_0x6953('0x3b')]['filter']){_0x109ed2['where']=_[_0x6953('0x9a')](_0x109ed2[_0x6953('0x46')],{'$or':_[_0x6953('0x2f')](_0x109ed2[_0x6953('0x3f')],function(_0x12d2cd){var _0x348db8={};_0x348db8[_0x12d2cd]={'$like':'%'+_0x19a383[_0x6953('0x3b')][_0x6953('0x83')]+'%'};return _0x348db8;})});}if(_0x19a383['query']['$gte']){var _0x286119=_0x19a383['query'][_0x6953('0x78')][_0x6953('0x33')](',');var _0x5770e2={};_0x5770e2[_0x286119[0x0]]={'$gte':moment(_0x286119[0x1])[_0x6953('0xc6')](_0x6953('0xc7'))};_0x109ed2[_0x6953('0x46')]=_[_0x6953('0x9a')](_0x109ed2[_0x6953('0x46')],_0x5770e2);}_0x109ed2=_['merge']({},_0x109ed2,_0x19a383[_0x6953('0xba')]);return db['SmsMessage']['count']({'where':_0x109ed2[_0x6953('0x46')]})['then'](function(_0x1a6c15){_0xa5f5d4[_0x6953('0x25')]=_0x1a6c15;if(_0x19a383['query'][_0x6953('0xb8')]){_0x109ed2[_0x6953('0xb9')]=[{'all':!![]}];}return db[_0x6953('0xc0')][_0x6953('0xc8')](_0x109ed2);})[_0x6953('0x2b')](function(_0x321ec8){_0xa5f5d4[_0x6953('0xb4')]=_0x321ec8;return _0xa5f5d4;});}})[_0x6953('0x2b')](respondWithFilteredResult(_0x3f4e63,_0x109ed2))['catch'](handleError(_0x3f4e63,null));};exports[_0x6953('0xc9')]=function(_0x3dfb72,_0x3f4569,_0x2cedc9){return db[_0x6953('0x9b')][_0x6953('0x61')]({'where':{'id':_0x3dfb72[_0x6953('0xb7')]['id']}})[_0x6953('0x2b')](handleEntityNotFound(_0x3f4569,null))['then'](function(_0x2d0702){if(_0x2d0702){return _0x2d0702[_0x6953('0xca')](_0x3dfb72[_0x6953('0x71')][_0x6953('0xc1')],_[_0x6953('0xc2')](_0x3dfb72[_0x6953('0x71')],[_0x6953('0xc1'),'id'])||{})['spread'](function(){return db['Tag'][_0x6953('0xc8')]({'attributes':['id',_0x6953('0x2d'),_0x6953('0xcb')],'where':{'id':_0x3dfb72[_0x6953('0x71')][_0x6953('0xc1')]}});})[_0x6953('0x2b')](function(_0x6b390c){socket[_0x6953('0xcc')](_0x6953('0xcd'),{'id':Number(_0x3dfb72[_0x6953('0xb7')]['id']),'tags':_0x6b390c||[]});return{'id':Number(_0x3dfb72[_0x6953('0xb7')]['id']),'tags':_0x6b390c||[]};});}})[_0x6953('0x2b')](respondWithResult(_0x3f4569,null))[_0x6953('0xb5')](handleError(_0x3f4569,null));};exports[_0x6953('0xce')]=function(_0x1dcbd2,_0x4b582c,_0x1035b5){return db['SmsInteraction']['find']({'where':{'id':_0x1dcbd2[_0x6953('0xb7')]['id']}})['then'](handleEntityNotFound(_0x4b582c,null))[_0x6953('0x2b')](function(_0x128748){if(_0x128748){return _0x128748[_0x6953('0xce')](_0x1dcbd2[_0x6953('0x3b')][_0x6953('0xc1')]);}})[_0x6953('0x2b')](respondWithStatusCode(_0x4b582c,null))['catch'](handleError(_0x4b582c,null));};exports[_0x6953('0xcf')]=function(_0x349b35,_0x7cd620){var _0x4cbf0f=moment()[_0x6953('0xd0')]()[_0x6953('0x98')]();var _0x50bb7f=path[_0x6953('0xd1')](config[_0x6953('0xd2')],_0x6953('0xd3'),_0x6953('0xd4'),_0x6953('0xd5'));var _0x575111=path[_0x6953('0xd1')](config[_0x6953('0xd2')],_0x6953('0xd3'),_0x6953('0xd4'),_0x6953('0xd6'));var _0x396cbf=path[_0x6953('0xd1')](_0x50bb7f,_0x4cbf0f);var _0x2e68d0=util[_0x6953('0xc6')](_0x6953('0xd7'),_0x349b35[_0x6953('0xb7')]['id'],_0x4cbf0f);var _0xb74ca4=path[_0x6953('0xd1')](_0x50bb7f,_0x2e68d0);var _0x5c1f0e=[];_0x5c1f0e[_0x6953('0xb2')]({'model':db[_0x6953('0x6d')],'as':_0x6953('0x6d'),'attributes':['id',_0x6953('0x30')],'raw':!![]});_0x5c1f0e[_0x6953('0xb2')]({'model':db[_0x6953('0xd8')],'as':'Contact','attributes':['id','firstName',_0x6953('0xd9')],'raw':!![]});var _0x548f3e=[{'model':db[_0x6953('0xc0')],'as':_0x6953('0xda'),'attributes':['id',_0x6953('0x71'),_0x6953('0xdb'),_0x6953('0xdc'),_0x6953('0xdd'),'read'],'include':_0x5c1f0e}];_0x548f3e[_0x6953('0xb2')]({'model':db[_0x6953('0xde')],'as':_0x6953('0xdf'),'attributes':['id',_0x6953('0x2d')]});_0x548f3e[_0x6953('0xb2')]({'model':db[_0x6953('0x6d')],'as':_0x6953('0xe0'),'attributes':['id',_0x6953('0x30')]});return db['SmsInteraction'][_0x6953('0x61')]({'where':{'id':_0x349b35[_0x6953('0xb7')]['id']},'include':_0x548f3e})['then'](handleEntityNotFound(_0x7cd620,null))[_0x6953('0x2b')](function(_0x315ec5){if(_0x315ec5){var _0x293d45=_0x315ec5[_0x6953('0xe1')]({'plain':!![]});fs[_0x6953('0xe2')](_0x396cbf);var _0x1ccc08={'format':'A4','border':_0x6953('0xe3'),'header':{'height':_0x6953('0xe4'),'contents':{'first':_0x6953('0xe5')}},'footer':{'height':_0x6953('0xe6'),'contents':{'default':util['format'](_0x6953('0xe7'),util['format']('%s\x20#%d',_0x6953('0xe8'),_0x293d45['id']),moment()[_0x6953('0xc6')](_0x6953('0xe9'))['toString']())}}};var _0x487e1d={'channel':_0x6953('0xe8'),'account':_0x293d45['Account'][_0x6953('0x2d')],'agent':_0x293d45['Owner']?_0x293d45[_0x6953('0xe0')][_0x6953('0x30')]:'N.A.','createdAt':moment(_0x293d45['createdAt'])[_0x6953('0xc6')](_0x6953('0xc7'))[_0x6953('0x98')](),'closedAt':_0x293d45[_0x6953('0xea')]?moment(_0x293d45['closedAt'])['format'](_0x6953('0xc7'))[_0x6953('0x98')]():'','disposition':_0x293d45[_0x6953('0xeb')],'messages':_(_0x293d45[_0x6953('0xda')])[_0x6953('0x83')]({'secret':![]})[_0x6953('0x2f')](function(_0x377c2c){return{'date':moment(_0x377c2c[_0x6953('0xdb')])[_0x6953('0xc6')]('YYYY-MM-DD\x20HH:mm:ss')[_0x6953('0x98')](),'sender':_0x377c2c[_0x6953('0xdc')]===_0x6953('0xec')?_0x377c2c[_0x6953('0x6d')]?_0x377c2c[_0x6953('0x6d')][_0x6953('0x30')]:_0x6953('0xed'):_0x377c2c[_0x6953('0x65')][_0x6953('0xee')]+(_0x377c2c[_0x6953('0x65')][_0x6953('0xd9')]?'\x20'+_0x377c2c[_0x6953('0x65')][_0x6953('0xd9')]:''),'body':_0x377c2c[_0x6953('0x71')],'direction':_0x377c2c[_0x6953('0xdc')]===_0x6953('0xec')?'A':'C','secret':_0x377c2c[_0x6953('0xdd')],'read':_0x377c2c[_0x6953('0x7d')]};})[_0x6953('0x62')]()};return ejs[_0x6953('0xef')](path[_0x6953('0xd1')](config[_0x6953('0xd2')],_0x6953('0xd3'),_0x6953('0xf0'),_0x6953('0xf1')),{'interaction':_0x487e1d})['then'](function(_0x11aece){return new BPromise(function(_0x5a8131,_0x1e8bcd){pdf[_0x6953('0xbb')](_0x11aece,_0x1ccc08)[_0x6953('0xf2')](path[_0x6953('0xd1')](_0x396cbf,_0x6953('0xf3')+_0x293d45['id']+'-'+_0x4cbf0f+_0x6953('0xf4')),function(_0x310fbc,_0x558e86){if(_0x310fbc)return _0x1e8bcd(_0x310fbc);_0x5a8131(_0x558e86);});});})[_0x6953('0x2b')](function(){return new BPromise(function(_0x43a23e,_0x1119cd){zipdir(_0x396cbf,{'saveTo':_0xb74ca4},function(_0x3f5097,_0x1a2525){if(_0x3f5097)return _0x1119cd(_0x3f5097);return _0x43a23e(_0x1a2525);});})[_0x6953('0x2b')](function(){return new BPromise(function(_0x25e138,_0x35a9bc){rimraf(_0x396cbf,function(_0x7bc3ae){if(_0x7bc3ae)_0x35a9bc(_0x7bc3ae);return _0x25e138();});});})[_0x6953('0x2b')](function(){return _0x7cd620[_0x6953('0xcf')](_0xb74ca4,_0x2e68d0,function(_0x25e0f3){if(_0x25e0f3){console['log'](_0x6953('0xf5'),_0x25e0f3);}else{fs[_0x6953('0xf6')](_0xb74ca4);}});});});}else{return _0x7cd620[_0x6953('0x21')](0xc8);}})[_0x6953('0xb5')](handleError(_0x7cd620,null));};
\ No newline at end of file
diff --git a/server/api/smsInteraction/smsInteraction.events.js b/server/api/smsInteraction/smsInteraction.events.js
index 227c339..d05784b 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 _0x7da7=['setMaxListeners','save','remove','then','setDataValue','Users','map','findAll','unreadMessages','emit','catch','hasOwnProperty','exports','events','../../mysqldb','SmsInteraction'];(function(_0x495840,_0xa883f6){var _0x19e97c=function(_0x51bc5a){while(--_0x51bc5a){_0x495840['push'](_0x495840['shift']());}};_0x19e97c(++_0xa883f6);}(_0x7da7,0x10d));var _0x77da=function(_0x75f869,_0x3690d6){_0x75f869=_0x75f869-0x0;var _0x10af8b=_0x7da7[_0x75f869];return _0x10af8b;};'use strict';var EventEmitter=require(_0x77da('0x0'));var SmsInteraction=require(_0x77da('0x1'))['db'][_0x77da('0x2')];var SmsMessage=require('../../mysqldb')['db']['SmsMessage'];var SmsInteractionEvents=new EventEmitter();SmsInteractionEvents[_0x77da('0x3')](0x0);var events={'afterCreate':_0x77da('0x4'),'afterUpdate':'update','afterDestroy':_0x77da('0x5')};function emitEvent(_0x37b3d9){return function(_0x56458c,_0x19331c,_0xc54a12){_0x56458c['getUsers']({'attributes':['id'],'raw':!![]})[_0x77da('0x6')](function(_0x47cf1d){_0x56458c[_0x77da('0x7')](_0x77da('0x8'),_0x47cf1d[_0x77da('0x9')](function(_0x910e5b){return{'id':_0x910e5b['id']};}));return SmsMessage[_0x77da('0xa')]({'where':{'SmsInteractionId':_0x56458c['id'],'direction':'in','read':![]},'raw':!![]});})['then'](function(_0x40c86e){_0x56458c[_0x77da('0x7')](_0x77da('0xb'),_0x40c86e['length']);SmsInteractionEvents[_0x77da('0xc')](_0x37b3d9+':'+_0x56458c['id'],_0x56458c);SmsInteractionEvents[_0x77da('0xc')](_0x37b3d9,_0x56458c);_0xc54a12(null);})[_0x77da('0xd')](_0xc54a12(null));};}for(var e in events){if(events[_0x77da('0xe')](e)){var event=events[e];SmsInteraction['hook'](e,emitEvent(event));}}module[_0x77da('0xf')]=SmsInteractionEvents;
\ No newline at end of file
+var _0xd67b=['map','findAll','emit','catch','hasOwnProperty','hook','exports','../../mysqldb','SmsMessage','setMaxListeners','update','getUsers','then','setDataValue','Users'];(function(_0x4d564f,_0x54dbb5){var _0x12e1fd=function(_0x208f6a){while(--_0x208f6a){_0x4d564f['push'](_0x4d564f['shift']());}};_0x12e1fd(++_0x54dbb5);}(_0xd67b,0x133));var _0xbd67=function(_0x16b297,_0x3348c0){_0x16b297=_0x16b297-0x0;var _0x50a357=_0xd67b[_0x16b297];return _0x50a357;};'use strict';var EventEmitter=require('events');var SmsInteraction=require(_0xbd67('0x0'))['db']['SmsInteraction'];var SmsMessage=require(_0xbd67('0x0'))['db'][_0xbd67('0x1')];var SmsInteractionEvents=new EventEmitter();SmsInteractionEvents[_0xbd67('0x2')](0x0);var events={'afterCreate':'save','afterUpdate':_0xbd67('0x3'),'afterDestroy':'remove'};function emitEvent(_0x1bf96){return function(_0x5a827b,_0x309962,_0xa5c384){_0x5a827b[_0xbd67('0x4')]({'attributes':['id'],'raw':!![]})[_0xbd67('0x5')](function(_0x1860c9){_0x5a827b[_0xbd67('0x6')](_0xbd67('0x7'),_0x1860c9[_0xbd67('0x8')](function(_0x1da7f1){return{'id':_0x1da7f1['id']};}));return SmsMessage[_0xbd67('0x9')]({'where':{'SmsInteractionId':_0x5a827b['id'],'direction':'in','read':![]},'raw':!![]});})[_0xbd67('0x5')](function(_0x3a7f43){_0x5a827b[_0xbd67('0x6')]('unreadMessages',_0x3a7f43['length']);SmsInteractionEvents[_0xbd67('0xa')](_0x1bf96+':'+_0x5a827b['id'],_0x5a827b);SmsInteractionEvents['emit'](_0x1bf96,_0x5a827b);_0xa5c384(null);})[_0xbd67('0xb')](_0xa5c384(null));};}for(var e in events){if(events[_0xbd67('0xc')](e)){var event=events[e];SmsInteraction[_0xbd67('0xd')](e,emitEvent(event));}}module[_0xbd67('0xe')]=SmsInteractionEvents;
\ No newline at end of file
diff --git a/server/api/smsInteraction/smsInteraction.model.js b/server/api/smsInteraction/smsInteraction.model.js
index bbe440b..ddf8729 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 _0x6e01=['closed','closedAt','format','util','moment','bluebird','request-promise','rimraf','../../config/environment','./smsInteraction.attributes','exports','define','SmsInteraction','sms_interactions','changed'];(function(_0x12ce79,_0x193e3a){var _0x4cf9f6=function(_0x19e7e7){while(--_0x19e7e7){_0x12ce79['push'](_0x12ce79['shift']());}};_0x4cf9f6(++_0x193e3a);}(_0x6e01,0x1b6));var _0x16e0=function(_0x54b062,_0x264bb5){_0x54b062=_0x54b062-0x0;var _0x255e41=_0x6e01[_0x54b062];return _0x255e41;};'use strict';var _=require('lodash');var util=require(_0x16e0('0x0'));var logger=require('../../config/logger')('api');var moment=require(_0x16e0('0x1'));var BPromise=require(_0x16e0('0x2'));var rp=require(_0x16e0('0x3'));var fs=require('fs');var path=require('path');var rimraf=require(_0x16e0('0x4'));var config=require(_0x16e0('0x5'));var attributes=require(_0x16e0('0x6'));module[_0x16e0('0x7')]=function(_0x12e42e,_0x1a1847){return _0x12e42e[_0x16e0('0x8')](_0x16e0('0x9'),attributes,{'tableName':_0x16e0('0xa'),'paranoid':![],'indexes':[],'timestamps':!![],'hooks':{'beforeUpdate':function(_0x42d7e2,_0x497fbc,_0x3c540f){if(_0x42d7e2[_0x16e0('0xb')](_0x16e0('0xc'))){_0x42d7e2[_0x16e0('0xd')]=moment()[_0x16e0('0xe')]('YYYY-MM-DD\x20HH:mm:ss');}_0x3c540f(null,_0x42d7e2);}}});};
\ No newline at end of file
+var _0xc38d=['./smsInteraction.attributes','SmsInteraction','changed','closed','closedAt','YYYY-MM-DD\x20HH:mm:ss','lodash','util','moment','bluebird','request-promise','path','rimraf','../../config/environment'];(function(_0x3147a7,_0x56df7a){var _0x1fc991=function(_0x557f23){while(--_0x557f23){_0x3147a7['push'](_0x3147a7['shift']());}};_0x1fc991(++_0x56df7a);}(_0xc38d,0x110));var _0xdc38=function(_0x406f47,_0x2d765a){_0x406f47=_0x406f47-0x0;var _0x5e49cd=_0xc38d[_0x406f47];return _0x5e49cd;};'use strict';var _=require(_0xdc38('0x0'));var util=require(_0xdc38('0x1'));var logger=require('../../config/logger')('api');var moment=require(_0xdc38('0x2'));var BPromise=require(_0xdc38('0x3'));var rp=require(_0xdc38('0x4'));var fs=require('fs');var path=require(_0xdc38('0x5'));var rimraf=require(_0xdc38('0x6'));var config=require(_0xdc38('0x7'));var attributes=require(_0xdc38('0x8'));module['exports']=function(_0x33fa3f,_0x36835d){return _0x33fa3f['define'](_0xdc38('0x9'),attributes,{'tableName':'sms_interactions','paranoid':![],'indexes':[],'timestamps':!![],'hooks':{'beforeUpdate':function(_0x1b952a,_0x81d274,_0x3a60b2){if(_0x1b952a[_0xdc38('0xa')](_0xdc38('0xb'))){_0x1b952a[_0xdc38('0xc')]=moment()['format'](_0xdc38('0xd'));}_0x3a60b2(null,_0x1b952a);}}});};
\ No newline at end of file
diff --git a/server/api/smsInteraction/smsInteraction.rpc.js b/server/api/smsInteraction/smsInteraction.rpc.js
index 343cb41..cbc7b6e 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 _0x5236=['body','options','raw','where','attributes','limit','AddTagsToSmsInteraction','find','addTags','omit','ids','spread','AddTags','lodash','util','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/logger','rpc','../../config/environment','http','redis','defaults','socket.io-emitter','./smsInteraction.socket','register','then','SmsInteraction,\x20%s,\x20%s','request\x20sent','debug','stringify','error','message','info','result','catch','UpdateSmsInteraction','SmsInteraction'];(function(_0x4a9beb,_0x159482){var _0x2d4c58=function(_0x28dabf){while(--_0x28dabf){_0x4a9beb['push'](_0x4a9beb['shift']());}};_0x2d4c58(++_0x159482);}(_0x5236,0x1d0));var _0x6523=function(_0x7984,_0x2b650b){_0x7984=_0x7984-0x0;var _0x5ce27=_0x5236[_0x7984];return _0x5ce27;};'use strict';var _=require(_0x6523('0x0'));var util=require(_0x6523('0x1'));var moment=require(_0x6523('0x2'));var BPromise=require(_0x6523('0x3'));var rs=require(_0x6523('0x4'));var fs=require('fs');var Redis=require(_0x6523('0x5'));var db=require(_0x6523('0x6'))['db'];var utils=require('../../config/utils');var logger=require(_0x6523('0x7'))(_0x6523('0x8'));var config=require(_0x6523('0x9'));var jayson=require('jayson/promise');var client=jayson['client'][_0x6523('0xa')]({'port':0x232a});config[_0x6523('0xb')]=_[_0x6523('0xc')](config[_0x6523('0xb')],{'host':'localhost','port':0x18eb});var socket=require(_0x6523('0xd'))(new Redis(config['redis']));require(_0x6523('0xe'))[_0x6523('0xf')](socket);function respondWithRpcPromise(_0x2705da,_0x343b1b,_0x5ca59d){return new BPromise(function(_0x430df3,_0x51356c){return client['request'](_0x2705da,_0x5ca59d)[_0x6523('0x10')](function(_0x3c0bdf){logger['info'](_0x6523('0x11'),_0x343b1b,_0x6523('0x12'));logger[_0x6523('0x13')]('SmsInteraction,\x20%s,\x20%s,\x20%s',_0x343b1b,_0x6523('0x12'),JSON[_0x6523('0x14')](_0x3c0bdf));if(_0x3c0bdf[_0x6523('0x15')]){if(_0x3c0bdf[_0x6523('0x15')]['code']===0x1f4){logger[_0x6523('0x15')](_0x6523('0x11'),_0x343b1b,_0x3c0bdf[_0x6523('0x15')]['message']);return _0x51356c(_0x3c0bdf['error']['message']);}logger[_0x6523('0x15')](_0x6523('0x11'),_0x343b1b,_0x3c0bdf[_0x6523('0x15')]['message']);return _0x430df3(_0x3c0bdf[_0x6523('0x15')][_0x6523('0x16')]);}else{logger[_0x6523('0x17')]('SmsInteraction,\x20%s,\x20%s',_0x343b1b,_0x6523('0x12'));_0x430df3(_0x3c0bdf[_0x6523('0x18')]['message']);}})[_0x6523('0x19')](function(_0x280dd1){logger['error']('SmsInteraction,\x20%s,\x20%s',_0x343b1b,_0x280dd1);_0x51356c(_0x280dd1);});});}exports[_0x6523('0x1a')]=function(_0x331cc8){var _0x13f261=this;return new Promise(function(_0x37a70e,_0x2298e8){return db[_0x6523('0x1b')]['update'](_0x331cc8[_0x6523('0x1c')],{'raw':_0x331cc8[_0x6523('0x1d')]?_0x331cc8[_0x6523('0x1d')][_0x6523('0x1e')]===undefined?!![]:![]:!![],'individualHooks':!![],'where':_0x331cc8['options']?_0x331cc8['options'][_0x6523('0x1f')]||null:null,'attributes':_0x331cc8[_0x6523('0x1d')]?_0x331cc8['options'][_0x6523('0x20')]||null:null,'limit':_0x331cc8['options']?_0x331cc8[_0x6523('0x1d')][_0x6523('0x21')]||null:null})[_0x6523('0x10')](function(_0x334cbe){logger[_0x6523('0x17')](_0x6523('0x1a'),_0x331cc8);logger[_0x6523('0x13')]('UpdateSmsInteraction',_0x331cc8,JSON[_0x6523('0x14')](_0x334cbe));_0x37a70e(_0x334cbe);})[_0x6523('0x19')](function(_0x4781b4){logger['error'](_0x6523('0x1a'),_0x4781b4[_0x6523('0x16')],_0x331cc8);_0x2298e8(_0x13f261[_0x6523('0x15')](0x1f4,_0x4781b4[_0x6523('0x16')]));});});};exports[_0x6523('0x22')]=function(_0x370479){return new Promise(function(_0x559532,_0x3e73c7){return db[_0x6523('0x1b')][_0x6523('0x23')]({'where':_0x370479[_0x6523('0x1d')]?_0x370479[_0x6523('0x1d')][_0x6523('0x1f')]||null:null})['then'](function(_0x15ec58){if(_0x15ec58){return _0x15ec58[_0x6523('0x24')](_0x370479[_0x6523('0x1c')]['ids'],_[_0x6523('0x25')](_0x370479[_0x6523('0x1c')],[_0x6523('0x26'),'id'])||{});}})[_0x6523('0x27')](function(_0x9f5f19){logger['info']('AddTags',_0x370479);logger[_0x6523('0x13')](_0x6523('0x28'),_0x370479,JSON[_0x6523('0x14')](_0x9f5f19));_0x559532(_0x9f5f19);})[_0x6523('0x19')](function(_0x4c7df0){logger[_0x6523('0x15')](_0x6523('0x28'),_0x4c7df0['message'],_0x370479);_0x3e73c7(_this[_0x6523('0x15')](0x1f4,_0x4c7df0[_0x6523('0x16')]));});});};
\ No newline at end of file
+var _0x4f58=['addTags','ids','AddTags','stringify','lodash','util','moment','bluebird','ioredis','rpc','../../config/environment','jayson/promise','client','http','redis','localhost','./smsInteraction.socket','register','info','SmsInteraction,\x20%s,\x20%s','request\x20sent','debug','SmsInteraction,\x20%s,\x20%s,\x20%s','error','code','message','result','catch','UpdateSmsInteraction','SmsInteraction','body','options','raw','where','limit','AddTagsToSmsInteraction','find','then'];(function(_0x511d17,_0xeeb440){var _0x2cc88c=function(_0x5404a3){while(--_0x5404a3){_0x511d17['push'](_0x511d17['shift']());}};_0x2cc88c(++_0xeeb440);}(_0x4f58,0x15a));var _0x84f5=function(_0x2c95c4,_0x5bb5ff){_0x2c95c4=_0x2c95c4-0x0;var _0x34a46e=_0x4f58[_0x2c95c4];return _0x34a46e;};'use strict';var _=require(_0x84f5('0x0'));var util=require(_0x84f5('0x1'));var moment=require(_0x84f5('0x2'));var BPromise=require(_0x84f5('0x3'));var rs=require('randomstring');var fs=require('fs');var Redis=require(_0x84f5('0x4'));var db=require('../../mysqldb')['db'];var utils=require('../../config/utils');var logger=require('../../config/logger')(_0x84f5('0x5'));var config=require(_0x84f5('0x6'));var jayson=require(_0x84f5('0x7'));var client=jayson[_0x84f5('0x8')][_0x84f5('0x9')]({'port':0x232a});config['redis']=_['defaults'](config[_0x84f5('0xa')],{'host':_0x84f5('0xb'),'port':0x18eb});var socket=require('socket.io-emitter')(new Redis(config['redis']));require(_0x84f5('0xc'))[_0x84f5('0xd')](socket);function respondWithRpcPromise(_0x16d609,_0x20cacb,_0x374f79){return new BPromise(function(_0x241f3b,_0x496589){return client['request'](_0x16d609,_0x374f79)['then'](function(_0x5c7224){logger[_0x84f5('0xe')](_0x84f5('0xf'),_0x20cacb,_0x84f5('0x10'));logger[_0x84f5('0x11')](_0x84f5('0x12'),_0x20cacb,'request\x20sent',JSON['stringify'](_0x5c7224));if(_0x5c7224['error']){if(_0x5c7224[_0x84f5('0x13')][_0x84f5('0x14')]===0x1f4){logger['error'](_0x84f5('0xf'),_0x20cacb,_0x5c7224[_0x84f5('0x13')][_0x84f5('0x15')]);return _0x496589(_0x5c7224[_0x84f5('0x13')][_0x84f5('0x15')]);}logger['error'](_0x84f5('0xf'),_0x20cacb,_0x5c7224['error'][_0x84f5('0x15')]);return _0x241f3b(_0x5c7224['error'][_0x84f5('0x15')]);}else{logger[_0x84f5('0xe')](_0x84f5('0xf'),_0x20cacb,'request\x20sent');_0x241f3b(_0x5c7224[_0x84f5('0x16')][_0x84f5('0x15')]);}})[_0x84f5('0x17')](function(_0x32ce2e){logger[_0x84f5('0x13')](_0x84f5('0xf'),_0x20cacb,_0x32ce2e);_0x496589(_0x32ce2e);});});}exports[_0x84f5('0x18')]=function(_0x380052){var _0x2f0ca4=this;return new Promise(function(_0x5ecb98,_0x7c8239){return db[_0x84f5('0x19')]['update'](_0x380052[_0x84f5('0x1a')],{'raw':_0x380052[_0x84f5('0x1b')]?_0x380052[_0x84f5('0x1b')][_0x84f5('0x1c')]===undefined?!![]:![]:!![],'individualHooks':!![],'where':_0x380052[_0x84f5('0x1b')]?_0x380052[_0x84f5('0x1b')][_0x84f5('0x1d')]||null:null,'attributes':_0x380052[_0x84f5('0x1b')]?_0x380052[_0x84f5('0x1b')]['attributes']||null:null,'limit':_0x380052['options']?_0x380052[_0x84f5('0x1b')][_0x84f5('0x1e')]||null:null})['then'](function(_0xe7ef53){logger[_0x84f5('0xe')]('UpdateSmsInteraction',_0x380052);logger[_0x84f5('0x11')]('UpdateSmsInteraction',_0x380052,JSON['stringify'](_0xe7ef53));_0x5ecb98(_0xe7ef53);})[_0x84f5('0x17')](function(_0x26228e){logger[_0x84f5('0x13')](_0x84f5('0x18'),_0x26228e[_0x84f5('0x15')],_0x380052);_0x7c8239(_0x2f0ca4[_0x84f5('0x13')](0x1f4,_0x26228e[_0x84f5('0x15')]));});});};exports[_0x84f5('0x1f')]=function(_0x20f866){return new Promise(function(_0x2605c0,_0x4aea6f){return db[_0x84f5('0x19')][_0x84f5('0x20')]({'where':_0x20f866['options']?_0x20f866[_0x84f5('0x1b')][_0x84f5('0x1d')]||null:null})[_0x84f5('0x21')](function(_0x96e828){if(_0x96e828){return _0x96e828[_0x84f5('0x22')](_0x20f866['body']['ids'],_['omit'](_0x20f866[_0x84f5('0x1a')],[_0x84f5('0x23'),'id'])||{});}})['spread'](function(_0x12a67f){logger[_0x84f5('0xe')](_0x84f5('0x24'),_0x20f866);logger[_0x84f5('0x11')](_0x84f5('0x24'),_0x20f866,JSON[_0x84f5('0x25')](_0x12a67f));_0x2605c0(_0x12a67f);})[_0x84f5('0x17')](function(_0x2d2909){logger[_0x84f5('0x13')](_0x84f5('0x24'),_0x2d2909[_0x84f5('0x15')],_0x20f866);_0x4aea6f(_this[_0x84f5('0x13')](0x1f4,_0x2d2909[_0x84f5('0x15')]));});});};
\ No newline at end of file
diff --git a/server/api/smsInteraction/smsInteraction.socket.js b/server/api/smsInteraction/smsInteraction.socket.js
index c59272b..32e357a 100644
--- a/server/api/smsInteraction/smsInteraction.socket.js
+++ b/server/api/smsInteraction/smsInteraction.socket.js
@@ -15,4 +15,4 @@
// * treaties. The SOFTWARE PRODUCT is licensed, not sold. *
// * *
// *************************************************************************
-var _0x5f66=['length','smsInteraction:','save','update','emit','register'];(function(_0x57eaec,_0x21680b){var _0x559ca6=function(_0x365146){while(--_0x365146){_0x57eaec['push'](_0x57eaec['shift']());}};_0x559ca6(++_0x21680b);}(_0x5f66,0x1a0));var _0x65f6=function(_0x31e29a,_0x349c9b){_0x31e29a=_0x31e29a-0x0;var _0x32d892=_0x5f66[_0x31e29a];return _0x32d892;};'use strict';var SmsInteractionEvents=require('./smsInteraction.events');var events=[_0x65f6('0x0'),'remove',_0x65f6('0x1')];function createListener(_0x2f06ae,_0x3461cd){return function(_0xbce843){_0x3461cd[_0x65f6('0x2')](_0x2f06ae,_0xbce843);};}function removeListener(_0x5eb9ad,_0x3c5029){return function(){SmsInteractionEvents['removeListener'](_0x5eb9ad,_0x3c5029);};}exports[_0x65f6('0x3')]=function(_0x22b017){for(var _0x4ec221=0x0,_0x4ed98f=events[_0x65f6('0x4')];_0x4ec221<_0x4ed98f;_0x4ec221++){var _0x2c6571=events[_0x4ec221];var _0x112079=createListener(_0x65f6('0x5')+_0x2c6571,_0x22b017);SmsInteractionEvents['on'](_0x2c6571,_0x112079);}};
\ No newline at end of file
+var _0xd8b0=['save','emit','./smsInteraction.events'];(function(_0x67d24d,_0x1b0827){var _0x5ec16a=function(_0x8608e9){while(--_0x8608e9){_0x67d24d['push'](_0x67d24d['shift']());}};_0x5ec16a(++_0x1b0827);}(_0xd8b0,0xad));var _0x0d8b=function(_0x20a584,_0xe384a5){_0x20a584=_0x20a584-0x0;var _0x4b41a8=_0xd8b0[_0x20a584];return _0x4b41a8;};'use strict';var SmsInteractionEvents=require(_0x0d8b('0x0'));var events=[_0x0d8b('0x1'),'remove','update'];function createListener(_0x4b72b0,_0x3ff8df){return function(_0x5b9b89){_0x3ff8df[_0x0d8b('0x2')](_0x4b72b0,_0x5b9b89);};}function removeListener(_0x364286,_0x8196ed){return function(){SmsInteractionEvents['removeListener'](_0x364286,_0x8196ed);};}exports['register']=function(_0x3f8b6f){for(var _0x227c63=0x0,_0x39f43a=events['length'];_0x227c63<_0x39f43a;_0x227c63++){var _0x413284=events[_0x227c63];var _0x284169=createListener('smsInteraction:'+_0x413284,_0x3f8b6f);SmsInteractionEvents['on'](_0x413284,_0x284169);}};
\ No newline at end of file
diff --git a/server/api/smsMessage/index.js b/server/api/smsMessage/index.js
index 30f23e0..58d8ffe 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 _0x9ad1=['show','post','sms','create','/:id/status','status','put','accept','/:id/reject','reject','delete','destroy','exports','multer','util','path','connect-timeout','express','Router','../../components/auth/service','./smsMessage.controller','get','isAuthenticated','describe','/:id'];(function(_0x456fb1,_0x859a1d){var _0x4083d6=function(_0xe1d0f2){while(--_0xe1d0f2){_0x456fb1['push'](_0x456fb1['shift']());}};_0x4083d6(++_0x859a1d);}(_0x9ad1,0x120));var _0x19ad=function(_0x2edfc4,_0x4062c5){_0x2edfc4=_0x2edfc4-0x0;var _0x2c86d1=_0x9ad1[_0x2edfc4];return _0x2c86d1;};'use strict';var multer=require(_0x19ad('0x0'));var util=require(_0x19ad('0x1'));var path=require(_0x19ad('0x2'));var timeout=require(_0x19ad('0x3'));var express=require(_0x19ad('0x4'));var router=express[_0x19ad('0x5')]();var auth=require(_0x19ad('0x6'));var interaction=require('../../components/interaction/service');var config=require('../../config/environment');var controller=require(_0x19ad('0x7'));router[_0x19ad('0x8')]('/',auth[_0x19ad('0x9')](),controller['index']);router[_0x19ad('0x8')]('/describe',auth[_0x19ad('0x9')](),controller[_0x19ad('0xa')]);router[_0x19ad('0x8')](_0x19ad('0xb'),auth[_0x19ad('0x9')](),controller[_0x19ad('0xc')]);router[_0x19ad('0xd')]('/',auth[_0x19ad('0x9')](),interaction['tracked'](_0x19ad('0xe'),'smsmessage:create'),controller[_0x19ad('0xf')]);router[_0x19ad('0xd')](_0x19ad('0x10'),controller[_0x19ad('0x11')]);router[_0x19ad('0x12')](_0x19ad('0xb'),auth[_0x19ad('0x9')](),controller['update']);router[_0x19ad('0x12')]('/:id/accept',auth['isAuthenticated'](),controller[_0x19ad('0x13')]);router[_0x19ad('0x12')](_0x19ad('0x14'),auth[_0x19ad('0x9')](),controller[_0x19ad('0x15')]);router[_0x19ad('0x16')](_0x19ad('0xb'),auth[_0x19ad('0x9')](),controller[_0x19ad('0x17')]);module[_0x19ad('0x18')]=router;
\ No newline at end of file
+var _0xd32b=['../../components/auth/service','../../components/interaction/service','./smsMessage.controller','get','index','/describe','describe','isAuthenticated','show','tracked','sms','smsmessage:create','create','post','/:id/status','status','put','/:id','/:id/accept','accept','/:id/reject','reject','delete','destroy','multer','util','path','connect-timeout','express'];(function(_0x426222,_0x560b21){var _0x19feee=function(_0x440a5e){while(--_0x440a5e){_0x426222['push'](_0x426222['shift']());}};_0x19feee(++_0x560b21);}(_0xd32b,0xe3));var _0xbd32=function(_0x3e59b4,_0x8dde50){_0x3e59b4=_0x3e59b4-0x0;var _0x4f66c6=_0xd32b[_0x3e59b4];return _0x4f66c6;};'use strict';var multer=require(_0xbd32('0x0'));var util=require(_0xbd32('0x1'));var path=require(_0xbd32('0x2'));var timeout=require(_0xbd32('0x3'));var express=require(_0xbd32('0x4'));var router=express['Router']();var auth=require(_0xbd32('0x5'));var interaction=require(_0xbd32('0x6'));var config=require('../../config/environment');var controller=require(_0xbd32('0x7'));router[_0xbd32('0x8')]('/',auth['isAuthenticated'](),controller[_0xbd32('0x9')]);router[_0xbd32('0x8')](_0xbd32('0xa'),auth['isAuthenticated'](),controller[_0xbd32('0xb')]);router['get']('/:id',auth[_0xbd32('0xc')](),controller[_0xbd32('0xd')]);router['post']('/',auth[_0xbd32('0xc')](),interaction[_0xbd32('0xe')](_0xbd32('0xf'),_0xbd32('0x10')),controller[_0xbd32('0x11')]);router[_0xbd32('0x12')](_0xbd32('0x13'),controller[_0xbd32('0x14')]);router[_0xbd32('0x15')](_0xbd32('0x16'),auth[_0xbd32('0xc')](),controller['update']);router[_0xbd32('0x15')](_0xbd32('0x17'),auth['isAuthenticated'](),controller[_0xbd32('0x18')]);router[_0xbd32('0x15')](_0xbd32('0x19'),auth['isAuthenticated'](),controller[_0xbd32('0x1a')]);router[_0xbd32('0x1b')](_0xbd32('0x16'),auth['isAuthenticated'](),controller[_0xbd32('0x1c')]);module['exports']=router;
\ No newline at end of file
diff --git a/server/api/smsMessage/smsMessage.attributes.js b/server/api/smsMessage/smsMessage.attributes.js
index 64d7af8..14e3d02 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 _0xa977=['BOOLEAN','ENUM','out','STRING','DATE','sequelize','exports','TEXT','medium'];(function(_0x147563,_0x4417b5){var _0x85dcc3=function(_0x255e31){while(--_0x255e31){_0x147563['push'](_0x147563['shift']());}};_0x85dcc3(++_0x4417b5);}(_0xa977,0x125));var _0x7a97=function(_0xdb336e,_0x249018){_0xdb336e=_0xdb336e-0x0;var _0x3a02bb=_0xa977[_0xdb336e];return _0x3a02bb;};'use strict';var Sequelize=require(_0x7a97('0x0'));module[_0x7a97('0x1')]={'body':{'type':Sequelize[_0x7a97('0x2')](_0x7a97('0x3')),'allowNull':![]},'read':{'type':Sequelize[_0x7a97('0x4')],'defaultValue':![]},'direction':{'type':Sequelize[_0x7a97('0x5')]('in','out'),'defaultValue':_0x7a97('0x6'),'allowNull':![]},'messageId':{'type':Sequelize[_0x7a97('0x7')](0xbe)},'phone':{'type':Sequelize[_0x7a97('0x7')]},'readAt':{'type':Sequelize[_0x7a97('0x8')]},'secret':{'type':Sequelize[_0x7a97('0x4')],'defaultValue':![]}};
\ No newline at end of file
+var _0x7216=['DATE','sequelize','exports','TEXT','medium','BOOLEAN','ENUM','out','STRING'];(function(_0x20a584,_0xe384a5){var _0x4b41a8=function(_0x2127c6){while(--_0x2127c6){_0x20a584['push'](_0x20a584['shift']());}};_0x4b41a8(++_0xe384a5);}(_0x7216,0xa3));var _0x6721=function(_0x3e1a1,_0xb5e5ed){_0x3e1a1=_0x3e1a1-0x0;var _0x12a909=_0x7216[_0x3e1a1];return _0x12a909;};'use strict';var Sequelize=require(_0x6721('0x0'));module[_0x6721('0x1')]={'body':{'type':Sequelize[_0x6721('0x2')](_0x6721('0x3')),'allowNull':![]},'read':{'type':Sequelize[_0x6721('0x4')],'defaultValue':![]},'direction':{'type':Sequelize[_0x6721('0x5')]('in',_0x6721('0x6')),'defaultValue':_0x6721('0x6'),'allowNull':![]},'messageId':{'type':Sequelize['STRING'](0xbe)},'phone':{'type':Sequelize[_0x6721('0x7')]},'readAt':{'type':Sequelize[_0x6721('0x8')]},'secret':{'type':Sequelize[_0x6721('0x4')],'defaultValue':![]}};
\ No newline at end of file
diff --git a/server/api/smsMessage/smsMessage.controller.js b/server/api/smsMessage/smsMessage.controller.js
index 3e20649..7ebbc06 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 _0x96e8=['SmsAccount','SmsAccountId','received\x20delivery\x20report\x20from','inspect','twilio','MessageSid','SmsAccount,\x20%s,\x20%s,\x20%s','plivo','MessageUUID','messageId','sent','Status','plivio','results','DELIVERED','html-pdf','eml-format','rimraf','request-promise','moment','bluebird','mustache','util','path','sox','to-csv','lodash','squel','crypto','desk.js','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/environment','defaults','redis','./smsMessage.socket','register','jayson/promise','client','http','ValidationError','SmsMessage,\x20%s,\x20%s','request\x20sent','debug','SmsMessage,\x20%s,\x20%s,\x20%s','stringify','error','code','message','info','sendStatus','status','end','json','offset','limit','set','Content-Range','save','update','then','destroy','name','send','SmsMessage','rawAttributes','type','key','map','query','keys','filters','intersection','model','attributes','fields','length','hasOwnProperty','nolimit','order','sort','where','pick','filter','VIRTUAL','merge','options','count','findAll','rows','catch','show','includeAll','include','find','body','params','describe','sms-interactions','accept','sms','read','readAt','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','acceptMessage','manual','SIP/%s','channel','event','EventManager','agent','[SMSMESSAGE:REJECT]\x20id=%s\x20name=%s\x20role=%s\x20interaction=%s\x20body=%s','RejectMessage','rejectMessage','interface','reject','rejectmessage'];(function(_0x4a9fb1,_0x273043){var _0x348672=function(_0x142b69){while(--_0x142b69){_0x4a9fb1['push'](_0x4a9fb1['shift']());}};_0x348672(++_0x273043);}(_0x96e8,0x99));var _0x896e=function(_0xee4bb8,_0x23b2ae){_0xee4bb8=_0xee4bb8-0x0;var _0xa0c0be=_0x96e8[_0xee4bb8];return _0xa0c0be;};'use strict';var pdf=require(_0x896e('0x0'));var emlformat=require(_0x896e('0x1'));var rimraf=require(_0x896e('0x2'));var zipdir=require('zip-dir');var jsonpatch=require('fast-json-patch');var rp=require(_0x896e('0x3'));var moment=require(_0x896e('0x4'));var BPromise=require(_0x896e('0x5'));var Mustache=require(_0x896e('0x6'));var util=require(_0x896e('0x7'));var path=require(_0x896e('0x8'));var sox=require(_0x896e('0x9'));var csv=require(_0x896e('0xa'));var ejs=require('ejs');var fs=require('fs');var _=require(_0x896e('0xb'));var squel=require(_0x896e('0xc'));var crypto=require(_0x896e('0xd'));var jsforce=require('jsforce');var deskjs=require(_0x896e('0xe'));var toCsv=require(_0x896e('0xa'));var querystring=require(_0x896e('0xf'));var Papa=require(_0x896e('0x10'));var Redis=require(_0x896e('0x11'));var authService=require(_0x896e('0x12'));var qs=require('../../components/parsers/qs');var as=require(_0x896e('0x13'));var hardwareService=require(_0x896e('0x14'));var logger=require(_0x896e('0x15'))(_0x896e('0x16'));var utils=require(_0x896e('0x17'));var config=require(_0x896e('0x18'));var db=require('../../mysqldb')['db'];config['redis']=_[_0x896e('0x19')](config[_0x896e('0x1a')],{'host':'localhost','port':0x18eb});var socket=require('socket.io-emitter')(new Redis(config[_0x896e('0x1a')]));require(_0x896e('0x1b'))[_0x896e('0x1c')](socket);var jayson=require(_0x896e('0x1d'));var client=jayson[_0x896e('0x1e')][_0x896e('0x1f')]({'port':0x232c});var client9002=jayson['client'][_0x896e('0x1f')]({'port':0x232a});function checkPasswordPattern(_0x30efcc,_0x4af2b3,_0x3a618d){if(_0x3a618d){var _0x1f1c39=new RegExp(/(?=.*[a-z])(?=.*[A-Z])(?=.*[0-9])(?=.*[?!@#\$%\^&\*~\-_=+[{\]\}])(?=.{8,})/);if(_0x1f1c39['test'](_0x4af2b3)){return _0x30efcc;}else{throw new db['Sequelize'][(_0x896e('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 _0x30efcc;}}function respondWithRpcPromise(_0x2193e1,_0x17a527,_0xe47af6,_0x32d9b9){return new BPromise(function(_0x2493d0,_0x42b550){var _0x176f8a=_0x32d9b9||client;return _0x176f8a['request'](_0x2193e1,_0xe47af6)['then'](function(_0x5f51f3){logger['info'](_0x896e('0x21'),_0x17a527,_0x896e('0x22'));logger[_0x896e('0x23')](_0x896e('0x24'),_0x17a527,'request\x20sent',JSON[_0x896e('0x25')](_0x5f51f3));if(_0x5f51f3[_0x896e('0x26')]){if(_0x5f51f3[_0x896e('0x26')][_0x896e('0x27')]===0x1f4){logger[_0x896e('0x26')](_0x896e('0x21'),_0x17a527,_0x5f51f3[_0x896e('0x26')]['message']);return _0x42b550(_0x5f51f3[_0x896e('0x26')][_0x896e('0x28')]);}logger[_0x896e('0x26')]('SmsMessage,\x20%s,\x20%s',_0x17a527,_0x5f51f3[_0x896e('0x26')][_0x896e('0x28')]);return _0x2493d0(_0x5f51f3[_0x896e('0x26')][_0x896e('0x28')]);}else{logger[_0x896e('0x29')](_0x896e('0x21'),_0x17a527,_0x896e('0x22'));_0x2493d0(_0x5f51f3['result'][_0x896e('0x28')]);}})['catch'](function(_0x3fd35a){logger[_0x896e('0x26')](_0x896e('0x21'),_0x17a527,_0x3fd35a);_0x42b550(_0x3fd35a);});});}function respondWithStatusCode(_0x2ed634,_0x186275){_0x186275=_0x186275||0xcc;return function(_0x3ddc52){if(_0x3ddc52){return _0x2ed634[_0x896e('0x2a')](_0x186275);}return _0x2ed634[_0x896e('0x2b')](_0x186275)[_0x896e('0x2c')]();};}function respondWithResult(_0x1a5d36,_0xabcc67){_0xabcc67=_0xabcc67||0xc8;return function(_0xc50584){if(_0xc50584){return _0x1a5d36[_0x896e('0x2b')](_0xabcc67)[_0x896e('0x2d')](_0xc50584);}};}function respondWithFilteredResult(_0x231e2f,_0x4f9dad){return function(_0x55f4e2){if(_0x55f4e2){var _0x5826dd=_0x55f4e2['count'],_0x4c815e=_0x4f9dad['offset'],_0x57d2b0=_0x4f9dad[_0x896e('0x2e')]+_0x4f9dad[_0x896e('0x2f')],_0x3e6721;if(_0x57d2b0>=_0x5826dd){_0x57d2b0=_0x5826dd;_0x3e6721=0xc8;}else{_0x3e6721=0xce;}_0x231e2f[_0x896e('0x2b')](_0x3e6721);return _0x231e2f[_0x896e('0x30')](_0x896e('0x31'),_0x4c815e+'-'+_0x57d2b0+'/'+_0x5826dd)['json'](_0x55f4e2);}return null;};}function patchUpdates(_0x4c0e91){return function(_0x390f85){try{jsonpatch['apply'](_0x390f85,_0x4c0e91,!![]);}catch(_0x5e4780){return BPromise['reject'](_0x5e4780);}return _0x390f85[_0x896e('0x32')]();};}function saveUpdates(_0x30b7ef,_0x5b17da){return function(_0x1c5b3e){if(_0x1c5b3e){return _0x1c5b3e[_0x896e('0x33')](_0x30b7ef)[_0x896e('0x34')](function(_0x13a9c6){return _0x13a9c6;});}return null;};}function removeEntity(_0x4f09c7,_0x453ffe){return function(_0x52fe2e){if(_0x52fe2e){return _0x52fe2e[_0x896e('0x35')]()[_0x896e('0x34')](function(){_0x4f09c7[_0x896e('0x2b')](0xcc)[_0x896e('0x2c')]();});}};}function handleEntityNotFound(_0x2c739a,_0x34c8af){return function(_0x2d17eb){if(!_0x2d17eb){_0x2c739a['sendStatus'](0x194);}return _0x2d17eb;};}function handleError(_0x3bb273,_0x4358c){_0x4358c=_0x4358c||0x1f4;return function(_0x1d0d2d){logger[_0x896e('0x26')](_0x1d0d2d['stack']);if(_0x1d0d2d['name']){delete _0x1d0d2d[_0x896e('0x36')];}_0x3bb273[_0x896e('0x2b')](_0x4358c)[_0x896e('0x37')](_0x1d0d2d);};}exports['index']=function(_0x376285,_0x4c90a7){var _0x13498c={},_0x2c1a7c={},_0x5d9209={'count':0x0,'rows':[]};var _0x332888=_['map'](db[_0x896e('0x38')][_0x896e('0x39')],function(_0x2d6d57){return{'name':_0x2d6d57['fieldName'],'type':_0x2d6d57[_0x896e('0x3a')][_0x896e('0x3b')]};});_0x2c1a7c['model']=_[_0x896e('0x3c')](_0x332888,_0x896e('0x36'));_0x2c1a7c[_0x896e('0x3d')]=_[_0x896e('0x3e')](_0x376285['query']);_0x2c1a7c[_0x896e('0x3f')]=_[_0x896e('0x40')](_0x2c1a7c[_0x896e('0x41')],_0x2c1a7c[_0x896e('0x3d')]);_0x13498c[_0x896e('0x42')]=_[_0x896e('0x40')](_0x2c1a7c[_0x896e('0x41')],qs[_0x896e('0x43')](_0x376285[_0x896e('0x3d')][_0x896e('0x43')]));_0x13498c[_0x896e('0x42')]=_0x13498c[_0x896e('0x42')][_0x896e('0x44')]?_0x13498c[_0x896e('0x42')]:_0x2c1a7c['model'];if(!_0x376285[_0x896e('0x3d')][_0x896e('0x45')](_0x896e('0x46'))){_0x13498c[_0x896e('0x2f')]=qs[_0x896e('0x2f')](_0x376285[_0x896e('0x3d')][_0x896e('0x2f')]);_0x13498c[_0x896e('0x2e')]=qs[_0x896e('0x2e')](_0x376285['query'][_0x896e('0x2e')]);}_0x13498c[_0x896e('0x47')]=qs[_0x896e('0x48')](_0x376285[_0x896e('0x3d')][_0x896e('0x48')]);_0x13498c[_0x896e('0x49')]=qs[_0x896e('0x3f')](_[_0x896e('0x4a')](_0x376285[_0x896e('0x3d')],_0x2c1a7c[_0x896e('0x3f')]));if(_0x376285[_0x896e('0x3d')][_0x896e('0x4b')]){_0x13498c['where']=_['merge'](_0x13498c[_0x896e('0x49')],{'$or':_['map'](_0x332888,function(_0x1e23b1){if(_0x1e23b1['type']!==_0x896e('0x4c')){var _0x1da6c4={};_0x1da6c4[_0x1e23b1[_0x896e('0x36')]]={'$like':'%'+_0x376285['query'][_0x896e('0x4b')]+'%'};return _0x1da6c4;}})});}_0x13498c=_[_0x896e('0x4d')]({},_0x13498c,_0x376285[_0x896e('0x4e')]);var _0x2f8c9f={'where':_0x13498c[_0x896e('0x49')]};return db[_0x896e('0x38')]['count'](_0x2f8c9f)[_0x896e('0x34')](function(_0x2a7741){_0x5d9209[_0x896e('0x4f')]=_0x2a7741;if(_0x376285['query']['includeAll']){_0x13498c['include']=[{'all':!![]}];}return db[_0x896e('0x38')][_0x896e('0x50')](_0x13498c);})[_0x896e('0x34')](function(_0x273352){_0x5d9209[_0x896e('0x51')]=_0x273352;return _0x5d9209;})[_0x896e('0x34')](respondWithFilteredResult(_0x4c90a7,_0x13498c))[_0x896e('0x52')](handleError(_0x4c90a7,null));};exports[_0x896e('0x53')]=function(_0x4a17fc,_0x2a2352){var _0xdb6364={'raw':!![],'where':{'id':_0x4a17fc['params']['id']}},_0x400f4d={};_0x400f4d[_0x896e('0x41')]=_[_0x896e('0x3e')](db[_0x896e('0x38')][_0x896e('0x39')]);_0x400f4d['query']=_[_0x896e('0x3e')](_0x4a17fc[_0x896e('0x3d')]);_0x400f4d['filters']=_['intersection'](_0x400f4d[_0x896e('0x41')],_0x400f4d['query']);_0xdb6364[_0x896e('0x42')]=_[_0x896e('0x40')](_0x400f4d[_0x896e('0x41')],qs['fields'](_0x4a17fc['query'][_0x896e('0x43')]));_0xdb6364[_0x896e('0x42')]=_0xdb6364[_0x896e('0x42')]['length']?_0xdb6364['attributes']:_0x400f4d[_0x896e('0x41')];if(_0x4a17fc['query'][_0x896e('0x54')]){_0xdb6364[_0x896e('0x55')]=[{'all':!![]}];}_0xdb6364=_['merge']({},_0xdb6364,_0x4a17fc[_0x896e('0x4e')]);return db[_0x896e('0x38')][_0x896e('0x56')](_0xdb6364)[_0x896e('0x34')](handleEntityNotFound(_0x2a2352,null))['then'](respondWithResult(_0x2a2352,null))[_0x896e('0x52')](handleError(_0x2a2352,null));};exports['create']=function(_0x7c4329,_0x4400db){return db[_0x896e('0x38')]['create'](_0x7c4329[_0x896e('0x57')],{})[_0x896e('0x34')](respondWithResult(_0x4400db,0xc9))[_0x896e('0x52')](handleError(_0x4400db,null));};exports[_0x896e('0x33')]=function(_0x3396a3,_0x53a77f){if(_0x3396a3[_0x896e('0x57')]['id']){delete _0x3396a3[_0x896e('0x57')]['id'];}return db['SmsMessage'][_0x896e('0x56')]({'where':{'id':_0x3396a3['params']['id']}})[_0x896e('0x34')](handleEntityNotFound(_0x53a77f,null))['then'](saveUpdates(_0x3396a3['body'],null))[_0x896e('0x34')](respondWithResult(_0x53a77f,null))[_0x896e('0x52')](handleError(_0x53a77f,null));};exports[_0x896e('0x35')]=function(_0x97587f,_0xaf9afc){return db['SmsMessage'][_0x896e('0x56')]({'where':{'id':_0x97587f[_0x896e('0x58')]['id']}})[_0x896e('0x34')](handleEntityNotFound(_0xaf9afc,null))[_0x896e('0x34')](removeEntity(_0xaf9afc,null))['catch'](handleError(_0xaf9afc,null));};exports[_0x896e('0x59')]=function(_0x981684,_0x29cdc9){return db['SmsMessage']['describe']()['then'](respondWithResult(_0x29cdc9,null))[_0x896e('0x52')](handleError(_0x29cdc9,null));};var interaction_log=require('../../config/logger')(_0x896e('0x5a'));exports[_0x896e('0x5b')]=function(_0x2b54ea,_0x42d33b,_0x2fe8b7){var _0x4e33a3={'channel':_0x896e('0x5c')};if(_0x2b54ea[_0x896e('0x57')]['id']){delete _0x2b54ea['body']['id'];}_0x2b54ea[_0x896e('0x57')][_0x896e('0x5d')]=!![];_0x2b54ea[_0x896e('0x57')][_0x896e('0x5e')]=moment()[_0x896e('0x5f')](_0x896e('0x60'));_0x2b54ea[_0x896e('0x57')][_0x896e('0x61')]=_0x2b54ea[_0x896e('0x57')][_0x896e('0x61')]||_0x2b54ea['user']['id'];return db[_0x896e('0x38')][_0x896e('0x56')]({'where':{'id':_0x2b54ea[_0x896e('0x58')]['id'],'UserId':null},'include':[{'model':db[_0x896e('0x62')],'as':'Contact'}]})[_0x896e('0x34')](handleEntityNotFound(_0x42d33b,null))['then'](saveUpdates(_0x2b54ea[_0x896e('0x57')],null))[_0x896e('0x34')](function(_0x1da86d){if(_0x1da86d){_0x4e33a3[_0x896e('0x28')]=_0x1da86d[_0x896e('0x63')]({'plain':!![]});return db[_0x896e('0x64')]['find']({'where':{'id':_0x1da86d[_0x896e('0x65')]}});}return null;})[_0x896e('0x34')](handleEntityNotFound(_0x42d33b,null))['then'](function(_0x38c20e){if(_0x38c20e){return _0x38c20e[_0x896e('0x33')]({'UserId':_0x2b54ea['body'][_0x896e('0x61')],'read1stAt':_[_0x896e('0x66')](_0x38c20e[_0x896e('0x67')])?moment()[_0x896e('0x5f')](_0x896e('0x60')):undefined});}return null;})['then'](function(_0x5a855c){if(_0x5a855c){_0x4e33a3[_0x896e('0x68')]=_0x5a855c[_0x896e('0x63')]({'plain':!![]});interaction_log[_0x896e('0x29')](_0x896e('0x69'),_0x2b54ea[_0x896e('0x6a')]['id'],_0x2b54ea[_0x896e('0x6a')][_0x896e('0x36')],_0x2b54ea['user'][_0x896e('0x6b')],_0x4e33a3[_0x896e('0x68')]['id'],_0x2b54ea['body']?JSON[_0x896e('0x25')](_0x2b54ea['body']):_0x896e('0x6c'));return respondWithRpcPromise(_0x896e('0x6d'),_0x896e('0x6e'),_0x4e33a3);}return null;})[_0x896e('0x34')](function(_0x7de8b5){if(_0x7de8b5){if(_0x2b54ea[_0x896e('0x57')][_0x896e('0x6f')]){_0x4e33a3[_0x896e('0x28')]['interface']=util['format'](_0x896e('0x70'),_0x2b54ea['user']['name']);_0x4e33a3[_0x896e('0x28')][_0x896e('0x71')]=_0x4e33a3['channel'];_0x4e33a3[_0x896e('0x28')][_0x896e('0x72')]='accept';return respondWithRpcPromise(_0x896e('0x73'),_0x896e('0x73'),{'event':'acceptmessage','message':_0x4e33a3[_0x896e('0x28')]},client9002)[_0x896e('0x34')](function(){return _0x4e33a3;});}return _0x4e33a3;}return null;})['then'](respondWithResult(_0x42d33b,null))[_0x896e('0x52')](handleError(_0x42d33b,null));};var interaction_log=require(_0x896e('0x15'))(_0x896e('0x5a'));exports['reject']=function(_0x23a2e7,_0x333308,_0x61b5c9){var _0x16a441={'agent':{},'channel':_0x896e('0x5c')};if(_0x23a2e7[_0x896e('0x57')]['id']){delete _0x23a2e7[_0x896e('0x57')]['id'];}_0x23a2e7[_0x896e('0x57')][_0x896e('0x61')]=_0x23a2e7[_0x896e('0x57')][_0x896e('0x61')]||_0x23a2e7['user']['id'];_0x16a441[_0x896e('0x74')]['id']=_0x23a2e7[_0x896e('0x57')]['UserId'];return db[_0x896e('0x38')][_0x896e('0x56')]({'where':{'id':_0x23a2e7[_0x896e('0x58')]['id'],'UserId':null}})[_0x896e('0x34')](handleEntityNotFound(_0x333308,null))[_0x896e('0x34')](function(_0x5c0e6f){if(_0x5c0e6f){_0x16a441['message']=_0x5c0e6f[_0x896e('0x63')]({'plain':!![]});return db[_0x896e('0x64')][_0x896e('0x56')]({'where':{'id':_0x5c0e6f[_0x896e('0x65')]}});}return null;})[_0x896e('0x34')](handleEntityNotFound(_0x333308,null))[_0x896e('0x34')](function(_0x1d12e6){if(_0x1d12e6){_0x16a441[_0x896e('0x68')]=_0x1d12e6['get']({'plain':!![]});interaction_log[_0x896e('0x29')](_0x896e('0x75'),_0x23a2e7[_0x896e('0x6a')]['id'],_0x23a2e7[_0x896e('0x6a')][_0x896e('0x36')],_0x23a2e7[_0x896e('0x6a')]['role'],_0x16a441[_0x896e('0x68')]['id'],_0x23a2e7['body']?JSON[_0x896e('0x25')](_0x23a2e7[_0x896e('0x57')]):_0x896e('0x6c'));return respondWithRpcPromise(_0x896e('0x76'),_0x896e('0x77'),_0x16a441);}return null;})[_0x896e('0x34')](function(_0x499f93){if(_0x499f93){_0x499f93[_0x896e('0x28')][_0x896e('0x78')]=util[_0x896e('0x5f')]('SIP/%s',_0x23a2e7['user'][_0x896e('0x36')]);_0x499f93[_0x896e('0x28')][_0x896e('0x71')]=_0x16a441[_0x896e('0x71')];_0x499f93[_0x896e('0x28')][_0x896e('0x72')]=_0x896e('0x79');respondWithRpcPromise(_0x896e('0x73'),_0x896e('0x73'),{'event':_0x896e('0x7a'),'message':_0x499f93[_0x896e('0x28')]},client9002);return _0x16a441;}return null;})['then'](respondWithResult(_0x333308,null))[_0x896e('0x52')](handleError(_0x333308,null));};exports[_0x896e('0x2b')]=function(_0x5adf55,_0x5e4fd1,_0x425b8b){if(_0x5adf55[_0x896e('0x57')]['id']){delete _0x5adf55['body']['id'];}var _0x30eab0;return db[_0x896e('0x38')][_0x896e('0x56')]({'where':{'id':_0x5adf55[_0x896e('0x58')]['id']}})[_0x896e('0x34')](handleEntityNotFound(_0x5e4fd1,null))['then'](function(_0x18ad49){if(_0x18ad49){_0x30eab0=_0x18ad49;return db[_0x896e('0x7b')][_0x896e('0x56')]({'where':{'id':_0x18ad49[_0x896e('0x7c')]}});}})['then'](handleEntityNotFound(_0x5e4fd1,null))[_0x896e('0x34')](function(_0x77fbc){if(_0x77fbc){logger['debug'](_0x896e('0x24'),'status',_0x896e('0x7d'),_0x77fbc[_0x896e('0x3a')],util[_0x896e('0x7e')](_0x5adf55[_0x896e('0x57')],{'showHidden':![],'depth':null}));switch(_0x77fbc[_0x896e('0x3a')]){case _0x896e('0x7f'):if(_0x5adf55['body'][_0x896e('0x80')]&&_0x5adf55[_0x896e('0x57')][_0x896e('0x80')]===_0x30eab0['messageId']){return _0x30eab0['update']({'read':!![]});}else{logger[_0x896e('0x26')](_0x896e('0x81'),_0x896e('0x2b'),'twilio',util[_0x896e('0x7e')](_0x5adf55[_0x896e('0x57')],{'showHidden':![],'depth':null}));}break;case _0x896e('0x82'):if(_0x5adf55[_0x896e('0x57')][_0x896e('0x83')]&&_0x5adf55[_0x896e('0x57')][_0x896e('0x83')]===_0x30eab0[_0x896e('0x84')]&&_['indexOf']([_0x896e('0x85'),'delivered'],_0x5adf55[_0x896e('0x57')][_0x896e('0x86')])>=0x0){return _0x30eab0['update']({'read':!![]});}else{logger[_0x896e('0x26')](_0x896e('0x81'),_0x896e('0x2b'),_0x896e('0x87'),util[_0x896e('0x7e')](_0x5adf55['body'],{'showHidden':![],'depth':null}));}break;case'infobip':var _0xa84d75=_0x5adf55[_0x896e('0x57')][_0x896e('0x88')][0x0];if(_0xa84d75[_0x896e('0x2b')]['groupName']===_0x896e('0x89')){return _0x30eab0['update']({'read':!![]});}else{logger[_0x896e('0x26')](_0x896e('0x81'),_0x896e('0x2b'),'infobip',util[_0x896e('0x7e')](_0x5adf55[_0x896e('0x57')],{'showHidden':![],'depth':null}));}break;}return _0x30eab0;}})['then'](respondWithResult(_0x5e4fd1,null))[_0x896e('0x52')](handleError(_0x5e4fd1,null));};
\ No newline at end of file
+var _0xb04a=['create','body','describe','sms-interactions','accept','sms','read','readAt','YYYY-MM-DD\x20HH:mm:ss','UserId','CmContact','Contact','SmsInteraction','isNil','read1stAt','format','interaction','get','[SMSMESSAGE:ACCEPT]\x20id=%s\x20name=%s\x20role=%s\x20interaction=%s\x20body=%s','user','role','AcceptMessage','acceptMessage','manual','interface','SIP/%s','channel','event','EventManager','acceptmessage','agent','[SMSMESSAGE:REJECT]\x20id=%s\x20name=%s\x20role=%s\x20interaction=%s\x20body=%s','RejectMessage','rejectmessage','SmsAccount','SmsAccountId','SmsMessage,\x20%s,\x20%s,\x20%s','received\x20delivery\x20report\x20from','inspect','MessageSid','messageId','SmsAccount,\x20%s,\x20%s,\x20%s','twilio','plivo','MessageUUID','delivered','Status','infobip','results','groupName','DELIVERED','html-pdf','rimraf','zip-dir','fast-json-patch','request-promise','moment','util','path','sox','squel','crypto','desk.js','to-csv','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/environment','../../mysqldb','redis','localhost','./smsMessage.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~!@#$%^&-_=+[{]}.','then','request\x20sent','debug','stringify','error','code','message','SmsMessage,\x20%s,\x20%s','info','catch','sendStatus','end','status','json','count','offset','reject','update','destroy','name','send','index','map','SmsMessage','rawAttributes','fieldName','type','model','query','filters','intersection','attributes','fields','length','hasOwnProperty','nolimit','limit','order','sort','where','pick','filter','merge','VIRTUAL','options','includeAll','include','findAll','params','keys','find'];(function(_0x10f966,_0x2dc56a){var _0xd74755=function(_0xb569ad){while(--_0xb569ad){_0x10f966['push'](_0x10f966['shift']());}};_0xd74755(++_0x2dc56a);}(_0xb04a,0xbb));var _0xab04=function(_0x3dd15e,_0x1f0015){_0x3dd15e=_0x3dd15e-0x0;var _0x231fd0=_0xb04a[_0x3dd15e];return _0x231fd0;};'use strict';var pdf=require(_0xab04('0x0'));var emlformat=require('eml-format');var rimraf=require(_0xab04('0x1'));var zipdir=require(_0xab04('0x2'));var jsonpatch=require(_0xab04('0x3'));var rp=require(_0xab04('0x4'));var moment=require(_0xab04('0x5'));var BPromise=require('bluebird');var Mustache=require('mustache');var util=require(_0xab04('0x6'));var path=require(_0xab04('0x7'));var sox=require(_0xab04('0x8'));var csv=require('to-csv');var ejs=require('ejs');var fs=require('fs');var _=require('lodash');var squel=require(_0xab04('0x9'));var crypto=require(_0xab04('0xa'));var jsforce=require('jsforce');var deskjs=require(_0xab04('0xb'));var toCsv=require(_0xab04('0xc'));var querystring=require('querystring');var Papa=require(_0xab04('0xd'));var Redis=require(_0xab04('0xe'));var authService=require(_0xab04('0xf'));var qs=require(_0xab04('0x10'));var as=require(_0xab04('0x11'));var hardwareService=require(_0xab04('0x12'));var logger=require(_0xab04('0x13'))(_0xab04('0x14'));var utils=require(_0xab04('0x15'));var config=require(_0xab04('0x16'));var db=require(_0xab04('0x17'))['db'];config[_0xab04('0x18')]=_['defaults'](config[_0xab04('0x18')],{'host':_0xab04('0x19'),'port':0x18eb});var socket=require('socket.io-emitter')(new Redis(config[_0xab04('0x18')]));require(_0xab04('0x1a'))[_0xab04('0x1b')](socket);var jayson=require('jayson/promise');var client=jayson[_0xab04('0x1c')][_0xab04('0x1d')]({'port':0x232c});var client9002=jayson[_0xab04('0x1c')]['http']({'port':0x232a});function checkPasswordPattern(_0x2dc3c,_0x3c0d0d,_0x5965e0){if(_0x5965e0){var _0x16b850=new RegExp(/(?=.*[a-z])(?=.*[A-Z])(?=.*[0-9])(?=.*[?!@#\$%\^&\*~\-_=+[{\]\}])(?=.{8,})/);if(_0x16b850[_0xab04('0x1e')](_0x3c0d0d)){return _0x2dc3c;}else{throw new db[(_0xab04('0x1f'))][(_0xab04('0x20'))](_0xab04('0x21'));}}else{return _0x2dc3c;}}function respondWithRpcPromise(_0x37be27,_0x22e627,_0x196207,_0x20070d){return new BPromise(function(_0x4131e6,_0x12c60d){var _0x24962f=_0x20070d||client;return _0x24962f['request'](_0x37be27,_0x196207)[_0xab04('0x22')](function(_0x3e6b8a){logger['info']('SmsMessage,\x20%s,\x20%s',_0x22e627,_0xab04('0x23'));logger[_0xab04('0x24')]('SmsMessage,\x20%s,\x20%s,\x20%s',_0x22e627,'request\x20sent',JSON[_0xab04('0x25')](_0x3e6b8a));if(_0x3e6b8a[_0xab04('0x26')]){if(_0x3e6b8a[_0xab04('0x26')][_0xab04('0x27')]===0x1f4){logger['error']('SmsMessage,\x20%s,\x20%s',_0x22e627,_0x3e6b8a[_0xab04('0x26')][_0xab04('0x28')]);return _0x12c60d(_0x3e6b8a['error']['message']);}logger[_0xab04('0x26')](_0xab04('0x29'),_0x22e627,_0x3e6b8a[_0xab04('0x26')][_0xab04('0x28')]);return _0x4131e6(_0x3e6b8a[_0xab04('0x26')][_0xab04('0x28')]);}else{logger[_0xab04('0x2a')]('SmsMessage,\x20%s,\x20%s',_0x22e627,_0xab04('0x23'));_0x4131e6(_0x3e6b8a['result']['message']);}})[_0xab04('0x2b')](function(_0xbb5aac){logger['error']('SmsMessage,\x20%s,\x20%s',_0x22e627,_0xbb5aac);_0x12c60d(_0xbb5aac);});});}function respondWithStatusCode(_0x3c40f1,_0x4dc196){_0x4dc196=_0x4dc196||0xcc;return function(_0x3631ae){if(_0x3631ae){return _0x3c40f1[_0xab04('0x2c')](_0x4dc196);}return _0x3c40f1['status'](_0x4dc196)[_0xab04('0x2d')]();};}function respondWithResult(_0x73c6b1,_0x3b4c9e){_0x3b4c9e=_0x3b4c9e||0xc8;return function(_0x5ec96b){if(_0x5ec96b){return _0x73c6b1[_0xab04('0x2e')](_0x3b4c9e)[_0xab04('0x2f')](_0x5ec96b);}};}function respondWithFilteredResult(_0x178585,_0x4645ba){return function(_0x5ea450){if(_0x5ea450){var _0x3df98b=_0x5ea450[_0xab04('0x30')],_0x55acfa=_0x4645ba['offset'],_0xb41c94=_0x4645ba[_0xab04('0x31')]+_0x4645ba['limit'],_0x5c9152;if(_0xb41c94>=_0x3df98b){_0xb41c94=_0x3df98b;_0x5c9152=0xc8;}else{_0x5c9152=0xce;}_0x178585[_0xab04('0x2e')](_0x5c9152);return _0x178585['set']('Content-Range',_0x55acfa+'-'+_0xb41c94+'/'+_0x3df98b)[_0xab04('0x2f')](_0x5ea450);}return null;};}function patchUpdates(_0x52f8c0){return function(_0x32a3ef){try{jsonpatch['apply'](_0x32a3ef,_0x52f8c0,!![]);}catch(_0x5032e1){return BPromise[_0xab04('0x32')](_0x5032e1);}return _0x32a3ef['save']();};}function saveUpdates(_0x277d2d,_0x1b39c7){return function(_0x4e2a43){if(_0x4e2a43){return _0x4e2a43[_0xab04('0x33')](_0x277d2d)['then'](function(_0x367f58){return _0x367f58;});}return null;};}function removeEntity(_0x366197,_0x55e07f){return function(_0x1f5430){if(_0x1f5430){return _0x1f5430[_0xab04('0x34')]()[_0xab04('0x22')](function(){_0x366197['status'](0xcc)[_0xab04('0x2d')]();});}};}function handleEntityNotFound(_0x144da2,_0x118ac7){return function(_0x221928){if(!_0x221928){_0x144da2['sendStatus'](0x194);}return _0x221928;};}function handleError(_0x354c0d,_0x28c14e){_0x28c14e=_0x28c14e||0x1f4;return function(_0x24ba49){logger[_0xab04('0x26')](_0x24ba49['stack']);if(_0x24ba49[_0xab04('0x35')]){delete _0x24ba49['name'];}_0x354c0d[_0xab04('0x2e')](_0x28c14e)[_0xab04('0x36')](_0x24ba49);};}exports[_0xab04('0x37')]=function(_0x282303,_0x1bd04e){var _0x46504a={},_0x2272d7={},_0x5b7e97={'count':0x0,'rows':[]};var _0x46a603=_[_0xab04('0x38')](db[_0xab04('0x39')][_0xab04('0x3a')],function(_0x36594c){return{'name':_0x36594c[_0xab04('0x3b')],'type':_0x36594c[_0xab04('0x3c')]['key']};});_0x2272d7[_0xab04('0x3d')]=_[_0xab04('0x38')](_0x46a603,_0xab04('0x35'));_0x2272d7[_0xab04('0x3e')]=_['keys'](_0x282303['query']);_0x2272d7[_0xab04('0x3f')]=_[_0xab04('0x40')](_0x2272d7['model'],_0x2272d7['query']);_0x46504a[_0xab04('0x41')]=_[_0xab04('0x40')](_0x2272d7[_0xab04('0x3d')],qs[_0xab04('0x42')](_0x282303[_0xab04('0x3e')][_0xab04('0x42')]));_0x46504a[_0xab04('0x41')]=_0x46504a[_0xab04('0x41')][_0xab04('0x43')]?_0x46504a[_0xab04('0x41')]:_0x2272d7[_0xab04('0x3d')];if(!_0x282303[_0xab04('0x3e')][_0xab04('0x44')](_0xab04('0x45'))){_0x46504a[_0xab04('0x46')]=qs[_0xab04('0x46')](_0x282303[_0xab04('0x3e')][_0xab04('0x46')]);_0x46504a['offset']=qs['offset'](_0x282303[_0xab04('0x3e')][_0xab04('0x31')]);}_0x46504a[_0xab04('0x47')]=qs[_0xab04('0x48')](_0x282303[_0xab04('0x3e')]['sort']);_0x46504a[_0xab04('0x49')]=qs[_0xab04('0x3f')](_[_0xab04('0x4a')](_0x282303[_0xab04('0x3e')],_0x2272d7[_0xab04('0x3f')]));if(_0x282303[_0xab04('0x3e')][_0xab04('0x4b')]){_0x46504a[_0xab04('0x49')]=_[_0xab04('0x4c')](_0x46504a['where'],{'$or':_['map'](_0x46a603,function(_0x5febb0){if(_0x5febb0[_0xab04('0x3c')]!==_0xab04('0x4d')){var _0x1185ec={};_0x1185ec[_0x5febb0[_0xab04('0x35')]]={'$like':'%'+_0x282303[_0xab04('0x3e')][_0xab04('0x4b')]+'%'};return _0x1185ec;}})});}_0x46504a=_[_0xab04('0x4c')]({},_0x46504a,_0x282303[_0xab04('0x4e')]);var _0x160f30={'where':_0x46504a[_0xab04('0x49')]};return db['SmsMessage']['count'](_0x160f30)[_0xab04('0x22')](function(_0x2b7fc8){_0x5b7e97[_0xab04('0x30')]=_0x2b7fc8;if(_0x282303['query'][_0xab04('0x4f')]){_0x46504a[_0xab04('0x50')]=[{'all':!![]}];}return db['SmsMessage'][_0xab04('0x51')](_0x46504a);})['then'](function(_0xad1dca){_0x5b7e97['rows']=_0xad1dca;return _0x5b7e97;})['then'](respondWithFilteredResult(_0x1bd04e,_0x46504a))[_0xab04('0x2b')](handleError(_0x1bd04e,null));};exports['show']=function(_0x523577,_0x269bc3){var _0x2b3202={'raw':!![],'where':{'id':_0x523577[_0xab04('0x52')]['id']}},_0x5f0826={};_0x5f0826[_0xab04('0x3d')]=_[_0xab04('0x53')](db['SmsMessage'][_0xab04('0x3a')]);_0x5f0826['query']=_[_0xab04('0x53')](_0x523577[_0xab04('0x3e')]);_0x5f0826[_0xab04('0x3f')]=_[_0xab04('0x40')](_0x5f0826[_0xab04('0x3d')],_0x5f0826[_0xab04('0x3e')]);_0x2b3202[_0xab04('0x41')]=_[_0xab04('0x40')](_0x5f0826[_0xab04('0x3d')],qs[_0xab04('0x42')](_0x523577[_0xab04('0x3e')][_0xab04('0x42')]));_0x2b3202[_0xab04('0x41')]=_0x2b3202[_0xab04('0x41')][_0xab04('0x43')]?_0x2b3202['attributes']:_0x5f0826[_0xab04('0x3d')];if(_0x523577['query']['includeAll']){_0x2b3202[_0xab04('0x50')]=[{'all':!![]}];}_0x2b3202=_['merge']({},_0x2b3202,_0x523577[_0xab04('0x4e')]);return db['SmsMessage'][_0xab04('0x54')](_0x2b3202)[_0xab04('0x22')](handleEntityNotFound(_0x269bc3,null))[_0xab04('0x22')](respondWithResult(_0x269bc3,null))['catch'](handleError(_0x269bc3,null));};exports[_0xab04('0x55')]=function(_0x12d940,_0x4858e2){return db[_0xab04('0x39')][_0xab04('0x55')](_0x12d940[_0xab04('0x56')],{})[_0xab04('0x22')](respondWithResult(_0x4858e2,0xc9))[_0xab04('0x2b')](handleError(_0x4858e2,null));};exports[_0xab04('0x33')]=function(_0x78e419,_0xbc377f){if(_0x78e419[_0xab04('0x56')]['id']){delete _0x78e419['body']['id'];}return db[_0xab04('0x39')][_0xab04('0x54')]({'where':{'id':_0x78e419['params']['id']}})[_0xab04('0x22')](handleEntityNotFound(_0xbc377f,null))['then'](saveUpdates(_0x78e419[_0xab04('0x56')],null))[_0xab04('0x22')](respondWithResult(_0xbc377f,null))[_0xab04('0x2b')](handleError(_0xbc377f,null));};exports[_0xab04('0x34')]=function(_0x48359b,_0x49bd7d){return db[_0xab04('0x39')][_0xab04('0x54')]({'where':{'id':_0x48359b[_0xab04('0x52')]['id']}})[_0xab04('0x22')](handleEntityNotFound(_0x49bd7d,null))[_0xab04('0x22')](removeEntity(_0x49bd7d,null))['catch'](handleError(_0x49bd7d,null));};exports[_0xab04('0x57')]=function(_0x4f758d,_0x42fc0f){return db[_0xab04('0x39')][_0xab04('0x57')]()[_0xab04('0x22')](respondWithResult(_0x42fc0f,null))['catch'](handleError(_0x42fc0f,null));};var interaction_log=require('../../config/logger')(_0xab04('0x58'));exports[_0xab04('0x59')]=function(_0x122237,_0x19d1f5,_0x513942){var _0x9902a2={'channel':_0xab04('0x5a')};if(_0x122237[_0xab04('0x56')]['id']){delete _0x122237[_0xab04('0x56')]['id'];}_0x122237[_0xab04('0x56')][_0xab04('0x5b')]=!![];_0x122237['body'][_0xab04('0x5c')]=moment()['format'](_0xab04('0x5d'));_0x122237['body'][_0xab04('0x5e')]=_0x122237[_0xab04('0x56')]['UserId']||_0x122237['user']['id'];return db[_0xab04('0x39')]['find']({'where':{'id':_0x122237[_0xab04('0x52')]['id'],'UserId':null},'include':[{'model':db[_0xab04('0x5f')],'as':_0xab04('0x60')}]})[_0xab04('0x22')](handleEntityNotFound(_0x19d1f5,null))[_0xab04('0x22')](saveUpdates(_0x122237['body'],null))[_0xab04('0x22')](function(_0x1ea9af){if(_0x1ea9af){_0x9902a2[_0xab04('0x28')]=_0x1ea9af['get']({'plain':!![]});return db[_0xab04('0x61')]['find']({'where':{'id':_0x1ea9af['SmsInteractionId']}});}return null;})[_0xab04('0x22')](handleEntityNotFound(_0x19d1f5,null))[_0xab04('0x22')](function(_0x54d831){if(_0x54d831){return _0x54d831[_0xab04('0x33')]({'UserId':_0x122237[_0xab04('0x56')]['UserId'],'read1stAt':_[_0xab04('0x62')](_0x54d831[_0xab04('0x63')])?moment()[_0xab04('0x64')](_0xab04('0x5d')):undefined});}return null;})[_0xab04('0x22')](function(_0x321425){if(_0x321425){_0x9902a2[_0xab04('0x65')]=_0x321425[_0xab04('0x66')]({'plain':!![]});interaction_log[_0xab04('0x2a')](_0xab04('0x67'),_0x122237[_0xab04('0x68')]['id'],_0x122237[_0xab04('0x68')][_0xab04('0x35')],_0x122237['user'][_0xab04('0x69')],_0x9902a2['interaction']['id'],_0x122237[_0xab04('0x56')]?JSON['stringify'](_0x122237[_0xab04('0x56')]):'null');return respondWithRpcPromise(_0xab04('0x6a'),_0xab04('0x6b'),_0x9902a2);}return null;})[_0xab04('0x22')](function(_0x293ba6){if(_0x293ba6){if(_0x122237[_0xab04('0x56')][_0xab04('0x6c')]){_0x9902a2[_0xab04('0x28')][_0xab04('0x6d')]=util[_0xab04('0x64')](_0xab04('0x6e'),_0x122237[_0xab04('0x68')][_0xab04('0x35')]);_0x9902a2[_0xab04('0x28')][_0xab04('0x6f')]=_0x9902a2['channel'];_0x9902a2[_0xab04('0x28')][_0xab04('0x70')]='accept';return respondWithRpcPromise(_0xab04('0x71'),'EventManager',{'event':_0xab04('0x72'),'message':_0x9902a2[_0xab04('0x28')]},client9002)[_0xab04('0x22')](function(){return _0x9902a2;});}return _0x9902a2;}return null;})[_0xab04('0x22')](respondWithResult(_0x19d1f5,null))[_0xab04('0x2b')](handleError(_0x19d1f5,null));};var interaction_log=require(_0xab04('0x13'))('sms-interactions');exports[_0xab04('0x32')]=function(_0x1acb12,_0x385c61,_0x1ca912){var _0x2b5696={'agent':{},'channel':_0xab04('0x5a')};if(_0x1acb12[_0xab04('0x56')]['id']){delete _0x1acb12[_0xab04('0x56')]['id'];}_0x1acb12[_0xab04('0x56')][_0xab04('0x5e')]=_0x1acb12[_0xab04('0x56')][_0xab04('0x5e')]||_0x1acb12[_0xab04('0x68')]['id'];_0x2b5696[_0xab04('0x73')]['id']=_0x1acb12[_0xab04('0x56')]['UserId'];return db['SmsMessage'][_0xab04('0x54')]({'where':{'id':_0x1acb12[_0xab04('0x52')]['id'],'UserId':null}})[_0xab04('0x22')](handleEntityNotFound(_0x385c61,null))[_0xab04('0x22')](function(_0x2d565b){if(_0x2d565b){_0x2b5696[_0xab04('0x28')]=_0x2d565b[_0xab04('0x66')]({'plain':!![]});return db['SmsInteraction']['find']({'where':{'id':_0x2d565b['SmsInteractionId']}});}return null;})[_0xab04('0x22')](handleEntityNotFound(_0x385c61,null))[_0xab04('0x22')](function(_0x273acc){if(_0x273acc){_0x2b5696[_0xab04('0x65')]=_0x273acc[_0xab04('0x66')]({'plain':!![]});interaction_log[_0xab04('0x2a')](_0xab04('0x74'),_0x1acb12['user']['id'],_0x1acb12[_0xab04('0x68')][_0xab04('0x35')],_0x1acb12[_0xab04('0x68')][_0xab04('0x69')],_0x2b5696['interaction']['id'],_0x1acb12[_0xab04('0x56')]?JSON[_0xab04('0x25')](_0x1acb12[_0xab04('0x56')]):'null');return respondWithRpcPromise(_0xab04('0x75'),'rejectMessage',_0x2b5696);}return null;})['then'](function(_0x48f685){if(_0x48f685){_0x48f685[_0xab04('0x28')][_0xab04('0x6d')]=util['format'](_0xab04('0x6e'),_0x1acb12['user'][_0xab04('0x35')]);_0x48f685[_0xab04('0x28')][_0xab04('0x6f')]=_0x2b5696['channel'];_0x48f685[_0xab04('0x28')]['event']=_0xab04('0x32');respondWithRpcPromise(_0xab04('0x71'),_0xab04('0x71'),{'event':_0xab04('0x76'),'message':_0x48f685[_0xab04('0x28')]},client9002);return _0x2b5696;}return null;})[_0xab04('0x22')](respondWithResult(_0x385c61,null))['catch'](handleError(_0x385c61,null));};exports[_0xab04('0x2e')]=function(_0x5edb3a,_0x4340c0,_0x1a4dfa){if(_0x5edb3a['body']['id']){delete _0x5edb3a[_0xab04('0x56')]['id'];}var _0x38f66f;return db[_0xab04('0x39')]['find']({'where':{'id':_0x5edb3a[_0xab04('0x52')]['id']}})[_0xab04('0x22')](handleEntityNotFound(_0x4340c0,null))[_0xab04('0x22')](function(_0xaa8e35){if(_0xaa8e35){_0x38f66f=_0xaa8e35;return db[_0xab04('0x77')][_0xab04('0x54')]({'where':{'id':_0xaa8e35[_0xab04('0x78')]}});}})[_0xab04('0x22')](handleEntityNotFound(_0x4340c0,null))[_0xab04('0x22')](function(_0x3efadf){if(_0x3efadf){logger[_0xab04('0x24')](_0xab04('0x79'),_0xab04('0x2e'),_0xab04('0x7a'),_0x3efadf[_0xab04('0x3c')],util[_0xab04('0x7b')](_0x5edb3a[_0xab04('0x56')],{'showHidden':![],'depth':null}));switch(_0x3efadf[_0xab04('0x3c')]){case'twilio':if(_0x5edb3a[_0xab04('0x56')][_0xab04('0x7c')]&&_0x5edb3a[_0xab04('0x56')]['MessageSid']===_0x38f66f[_0xab04('0x7d')]){return _0x38f66f[_0xab04('0x33')]({'read':!![]});}else{logger['error'](_0xab04('0x7e'),_0xab04('0x2e'),_0xab04('0x7f'),util['inspect'](_0x5edb3a['body'],{'showHidden':![],'depth':null}));}break;case _0xab04('0x80'):if(_0x5edb3a[_0xab04('0x56')][_0xab04('0x81')]&&_0x5edb3a[_0xab04('0x56')][_0xab04('0x81')]===_0x38f66f['messageId']&&_['indexOf'](['sent',_0xab04('0x82')],_0x5edb3a[_0xab04('0x56')][_0xab04('0x83')])>=0x0){return _0x38f66f[_0xab04('0x33')]({'read':!![]});}else{logger[_0xab04('0x26')]('SmsAccount,\x20%s,\x20%s,\x20%s',_0xab04('0x2e'),'plivio',util['inspect'](_0x5edb3a[_0xab04('0x56')],{'showHidden':![],'depth':null}));}break;case _0xab04('0x84'):var _0x1f4463=_0x5edb3a[_0xab04('0x56')][_0xab04('0x85')][0x0];if(_0x1f4463['status'][_0xab04('0x86')]===_0xab04('0x87')){return _0x38f66f[_0xab04('0x33')]({'read':!![]});}else{logger[_0xab04('0x26')]('SmsAccount,\x20%s,\x20%s,\x20%s',_0xab04('0x2e'),_0xab04('0x84'),util[_0xab04('0x7b')](_0x5edb3a['body'],{'showHidden':![],'depth':null}));}break;}return _0x38f66f;}})[_0xab04('0x22')](respondWithResult(_0x4340c0,null))[_0xab04('0x2b')](handleError(_0x4340c0,null));};
\ No newline at end of file
diff --git a/server/api/smsMessage/smsMessage.events.js b/server/api/smsMessage/smsMessage.events.js
index 71fe8b7..72dbc18 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 _0xf2c7=['setMaxListeners','update','remove','emit','hasOwnProperty','hook','exports','events','../../mysqldb'];(function(_0x447db4,_0x22faf5){var _0x200cf7=function(_0x26158f){while(--_0x26158f){_0x447db4['push'](_0x447db4['shift']());}};_0x200cf7(++_0x22faf5);}(_0xf2c7,0x11e));var _0x7f2c=function(_0xffa198,_0x5a8940){_0xffa198=_0xffa198-0x0;var _0x1e4b50=_0xf2c7[_0xffa198];return _0x1e4b50;};'use strict';var EventEmitter=require(_0x7f2c('0x0'));var SmsMessage=require(_0x7f2c('0x1'))['db']['SmsMessage'];var SmsMessageEvents=new EventEmitter();SmsMessageEvents[_0x7f2c('0x2')](0x0);var events={'afterCreate':'save','afterUpdate':_0x7f2c('0x3'),'afterDestroy':_0x7f2c('0x4')};function emitEvent(_0x5b679b){return function(_0x191609,_0x2c455d,_0x1683a1){SmsMessageEvents[_0x7f2c('0x5')](_0x5b679b+':'+_0x191609['id'],_0x191609);SmsMessageEvents[_0x7f2c('0x5')](_0x5b679b,_0x191609);_0x1683a1(null);};}for(var e in events){if(events[_0x7f2c('0x6')](e)){var event=events[e];SmsMessage[_0x7f2c('0x7')](e,emitEvent(event));}}module[_0x7f2c('0x8')]=SmsMessageEvents;
\ No newline at end of file
+var _0xbd58=['SmsMessage','setMaxListeners','save','update','emit','hasOwnProperty','hook','../../mysqldb'];(function(_0x1bcf64,_0x32c029){var _0x1dba72=function(_0x262d9e){while(--_0x262d9e){_0x1bcf64['push'](_0x1bcf64['shift']());}};_0x1dba72(++_0x32c029);}(_0xbd58,0x1a7));var _0x8bd5=function(_0x2737e2,_0x321a59){_0x2737e2=_0x2737e2-0x0;var _0x46b4cc=_0xbd58[_0x2737e2];return _0x46b4cc;};'use strict';var EventEmitter=require('events');var SmsMessage=require(_0x8bd5('0x0'))['db'][_0x8bd5('0x1')];var SmsMessageEvents=new EventEmitter();SmsMessageEvents[_0x8bd5('0x2')](0x0);var events={'afterCreate':_0x8bd5('0x3'),'afterUpdate':_0x8bd5('0x4'),'afterDestroy':'remove'};function emitEvent(_0x349479){return function(_0x23da92,_0x296639,_0x347739){SmsMessageEvents[_0x8bd5('0x5')](_0x349479+':'+_0x23da92['id'],_0x23da92);SmsMessageEvents[_0x8bd5('0x5')](_0x349479,_0x23da92);_0x347739(null);};}for(var e in events){if(events[_0x8bd5('0x6')](e)){var event=events[e];SmsMessage[_0x8bd5('0x7')](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 fa05e55..451f43c 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 _0xa28e=['IBSSO\x20','Missing\x20parameters:\x20base_url','crypto','apiKey','login','sender','timestamp','keys','length','hex','signature=','GET','/external/get/send.php?','id_sms','csc','Missing\x20parameters:\x20apiKey','clickatell','https://platform.clickatell.com/messages','uuid','apiMessageId','Bearer\x20','code','message','https://api.intelepeer.com/_rest/v4/app/sms/mdr','refid','status','intelepeer','Token\x20not\x20received','finally','utf8mb4','utf8mb4_unicode_ci','lodash','util','../../config/logger','api','moment','bluebird','request-promise','path','rimraf','../../config/environment','./smsMessage.attributes','exports','SmsMessage','sms_messages','messageId','fti_sms_messages','body','FULLTEXT','models','get','toLowerCase','direction','out','secret','UserId','SmsInteraction','findOne','SmsInteractionId','then','update','catch','error','SmsAccount','find','SmsAccountId','type','twilio','accountSid','phone','authToken','create','/api/sms/messages/','/status?token=','sid','SmsMessage,\x20%s,\x20%s,\x20%s','inspect','afterCreate','skebby','https://api.skebby.it/API/v1.0/REST/','username','password','smsMethod','login?username=','&password=','split','POST','user_key','internal_order_id','deliveryReport','Missing\x20parameters:\x20username,\x20password','connectel','senderString','https://smsapi.connectel.se/api/send/','requestid','read','Missing\x20parameters:\x20authToken','clicksend','xCALLY\x20Motion','https://rest.clicksend.com/v3/sms/send','base64','http_code','data','queued_count','head','messages','message_id','clickSend','plivo','authId','remote','token','format','%s:%s','Basic\x20%s','toString','message_uuid','infobip','baseUrl','/auth/1/session','/sms/2/text/advanced','application/json'];(function(_0x45186d,_0xe130f8){var _0x4b2697=function(_0x1778e1){while(--_0x1778e1){_0x45186d['push'](_0x45186d['shift']());}};_0x4b2697(++_0xe130f8);}(_0xa28e,0x113));var _0xea28=function(_0x13d4b0,_0x4241e3){_0x13d4b0=_0x13d4b0-0x0;var _0x406b9c=_0xa28e[_0x13d4b0];return _0x406b9c;};'use strict';var _=require(_0xea28('0x0'));var util=require(_0xea28('0x1'));var logger=require(_0xea28('0x2'))(_0xea28('0x3'));var moment=require(_0xea28('0x4'));var BPromise=require(_0xea28('0x5'));var rp=require(_0xea28('0x6'));var fs=require('fs');var path=require(_0xea28('0x7'));var rimraf=require(_0xea28('0x8'));var config=require(_0xea28('0x9'));var attributes=require(_0xea28('0xa'));module[_0xea28('0xb')]=function(_0x328b24,_0x3bf97d){return _0x328b24['define'](_0xea28('0xc'),attributes,{'tableName':_0xea28('0xd'),'paranoid':![],'indexes':[{'name':_0xea28('0xe'),'fields':[_0xea28('0xe')]},{'name':_0xea28('0xf'),'fields':[_0xea28('0x10')],'type':_0xea28('0x11')}],'timestamps':!![],'hooks':{'afterCreate':function(_0x1e8673,_0x41c599,_0x597221){var _0x3705c9=_0x328b24[_0xea28('0x12')];var _0x4dd15e=_0x1e8673[_0xea28('0x13')]({'plain':!![]});if(_0x4dd15e['direction'][_0xea28('0x14')]()==='in'||_0x4dd15e[_0xea28('0x15')]['toLowerCase']()===_0xea28('0x16')&&!_0x4dd15e[_0xea28('0x17')]&&!_['isNil'](_0x4dd15e[_0xea28('0x18')])){_0x3705c9[_0xea28('0x19')][_0xea28('0x1a')]({'where':{'id':_0x4dd15e[_0xea28('0x1b')]}})[_0xea28('0x1c')](function(_0x287ae5){if(_0x287ae5){_0x287ae5[_0xea28('0x1d')]({'lastMsgAt':_0x4dd15e['createdAt'],'lastMsgDirection':_0x4dd15e[_0xea28('0x15')][_0xea28('0x14')]()});}})[_0xea28('0x1e')](function(_0x24d3c2){console[_0xea28('0x1f')](_0x24d3c2);});}if(_0x4dd15e[_0xea28('0x15')]==='out'&&!_0x4dd15e[_0xea28('0x17')]){var _0x2a137e;_0x3705c9[_0xea28('0x20')][_0xea28('0x21')]({'where':{'id':_0x4dd15e[_0xea28('0x22')]},'raw':!![]})[_0xea28('0x1c')](function(_0x43030b){_0x2a137e=_0x43030b;if(_0x2a137e&&_0x2a137e[_0xea28('0x23')]){switch(_0x2a137e[_0xea28('0x23')]){case _0xea28('0x24'):var _0x311e3b=require(_0xea28('0x24'));if(_0x2a137e[_0xea28('0x25')]&&_0x2a137e['authToken']&&_0x2a137e[_0xea28('0x26')]){var _0x5e44e5=new _0x311e3b(_0x2a137e[_0xea28('0x25')],_0x2a137e[_0xea28('0x27')]);_0x5e44e5['messages'][_0xea28('0x28')]({'body':_0x4dd15e[_0xea28('0x10')],'to':_0x4dd15e[_0xea28('0x26')],'from':_0x2a137e[_0xea28('0x26')],'statusCallback':_0x2a137e['remote']+_0xea28('0x29')+_0x4dd15e['id']+_0xea28('0x2a')+_0x2a137e['token']})['then'](function(_0x285913){if(_0x285913[_0xea28('0x2b')]){return _0x1e8673[_0xea28('0x1d')]({'messageId':_0x285913[_0xea28('0x2b')]});}})['catch'](function(_0x5ca0b6){logger[_0xea28('0x1f')](_0xea28('0x2c'),'afterCreate',_0xea28('0x24'),util[_0xea28('0x2d')](_0x5ca0b6,{'showHidden':![],'depth':null}));});}else{logger[_0xea28('0x1f')](_0xea28('0x2c'),_0xea28('0x2e'),_0xea28('0x24'),'Missing\x20parameters:\x20phone,\x20accountSid\x20or\x20authToken');}break;case _0xea28('0x2f'):var _0x25079d=_0xea28('0x30');if(_0x2a137e[_0xea28('0x31')]&&_0x2a137e[_0xea28('0x32')]){var _0x24953a={'recipient':[_0x4dd15e[_0xea28('0x26')]],'message':_0x4dd15e[_0xea28('0x10')],'message_type':_0x2a137e['smsMethod']};if(_0x2a137e[_0xea28('0x33')]&&_0x2a137e[_0xea28('0x33')]!=='SI'){_0x24953a['sender']=_0x2a137e[_0xea28('0x26')];}var _0x5562ef={'url':_0x25079d+_0xea28('0x34')+_0x2a137e[_0xea28('0x31')]+_0xea28('0x35')+_0x2a137e[_0xea28('0x32')],'method':'GET'};rp(_0x5562ef)[_0xea28('0x1c')](function(_0x4b689f){var _0x3f8651=_0x4b689f[_0xea28('0x36')](';');var _0x402acc={'user_key':_0x3f8651[0x0],'session_key':_0x3f8651[0x1]};_0x5562ef={'url':_0x25079d+'sms','method':_0xea28('0x37'),'headers':{'user_key':_0x402acc[_0xea28('0x38')],'Session_key':_0x402acc['session_key']},'json':!![],'body':_0x24953a};return rp(_0x5562ef);})[_0xea28('0x1c')](function(_0x3643ad){if(_0x3643ad['total_sent']>=0x1){var _0x592e7a={'messageId':_0x3643ad[_0xea28('0x39')]};if(_0x2a137e[_0xea28('0x33')]!=='GP'||!_0x2a137e[_0xea28('0x3a')]){_0x592e7a['read']=!![];}return _0x1e8673[_0xea28('0x1d')](_0x592e7a);}else{return logger['error'](_0xea28('0x2c'),'afterCreate',_0xea28('0x2f'),util[_0xea28('0x2d')](_0x3643ad,{'showHidden':![],'depth':null}));}})['catch'](function(_0x99a61a){return logger['error'](_0xea28('0x2c'),_0xea28('0x2e'),_0xea28('0x2f'),util[_0xea28('0x2d')](_0x99a61a,{'showHidden':![],'depth':null}));});}else{logger[_0xea28('0x1f')](_0xea28('0x2c'),_0xea28('0x2e'),_0xea28('0x2f'),_0xea28('0x3b'));}break;case _0xea28('0x3c'):if(_0x2a137e[_0xea28('0x27')]){var _0x4d83f5={'recipient':_0x4dd15e[_0xea28('0x26')],'message':_0x4dd15e[_0xea28('0x10')],'sender':_0x2a137e[_0xea28('0x3d')]||_0x2a137e[_0xea28('0x26')],'authorization':_0x2a137e['authToken']};var _0x41c599={'method':_0xea28('0x37'),'uri':_0xea28('0x3e'),'body':_0x4d83f5,'json':!![]};rp(_0x41c599)[_0xea28('0x1c')](function(_0x216a4e){var _0x1defa0={'messageId':_0x216a4e[_0xea28('0x3f')]};if(!_0x2a137e[_0xea28('0x3a')]){_0x1defa0[_0xea28('0x40')]=!![];}return _0x1e8673[_0xea28('0x1d')](_0x1defa0);})[_0xea28('0x1e')](function(_0x5888ff){logger['error'](_0xea28('0x2c'),_0xea28('0x2e'),_0xea28('0x3c'),util[_0xea28('0x2d')](_0x5888ff,{'showHidden':![],'depth':null}));});}else{logger[_0xea28('0x1f')](_0xea28('0x2c'),'afterCreate','connectel',_0xea28('0x41'));}break;case _0xea28('0x42'):if(_0x2a137e[_0xea28('0x31')]&&_0x2a137e[_0xea28('0x32')]){var _0x4d83f5={'messages':[{'source':_0xea28('0x43'),'to':_0x4dd15e['phone'],'body':_0x4dd15e['body'],'from':_0x2a137e[_0xea28('0x3d')]||_0x2a137e[_0xea28('0x26')]}]};var _0x1801af=util['format']('%s:%s',_0x2a137e[_0xea28('0x31')],_0x2a137e[_0xea28('0x32')]);var _0x41c599={'method':_0xea28('0x37'),'uri':_0xea28('0x44'),'body':_0x4d83f5,'headers':{'Authorization':util['format']('Basic\x20%s',new Buffer(_0x1801af)['toString'](_0xea28('0x45')))},'json':!![]};rp(_0x41c599)[_0xea28('0x1c')](function(_0x17277e){if(_0x17277e[_0xea28('0x46')]>=0xc8&&_0x17277e[_0xea28('0x46')]<=0xce){if(_0x17277e[_0xea28('0x47')]&&_0x17277e[_0xea28('0x47')][_0xea28('0x48')]>0x0){var _0x2916e0=_[_0xea28('0x49')](_0x17277e[_0xea28('0x47')][_0xea28('0x4a')]);var _0x101b11={'messageId':_0x2916e0[_0xea28('0x4b')]};if(!_0x2a137e['deliveryReport']){_0x101b11[_0xea28('0x40')]=!![];}return _0x1e8673[_0xea28('0x1d')](_0x101b11);}else{logger[_0xea28('0x1f')](_0xea28('0x2c'),'afterCreate',_0xea28('0x4c'),util[_0xea28('0x2d')](_0x17277e,{'showHidden':![],'depth':null}));}}else{logger[_0xea28('0x1f')](_0xea28('0x2c'),_0xea28('0x2e'),'clickSend',util[_0xea28('0x2d')](_0x17277e,{'showHidden':![],'depth':null}));}})[_0xea28('0x1e')](function(_0x213746){logger[_0xea28('0x1f')](_0xea28('0x2c'),'afterCreate',_0xea28('0x4c'),util[_0xea28('0x2d')](_0x213746,{'showHidden':![],'depth':null}));});}else{logger[_0xea28('0x1f')]('SmsMessage,\x20%s,\x20%s,\x20%s',_0xea28('0x2e'),'clickSend','Missing\x20parameters:\x20username,\x20password');}break;case _0xea28('0x4d'):if(_0x2a137e[_0xea28('0x4e')]&&_0x2a137e[_0xea28('0x27')]){var _0x4d83f5={'dst':_0x4dd15e[_0xea28('0x26')],'text':_0x4dd15e[_0xea28('0x10')],'src':_0x2a137e['senderString']||_0x2a137e[_0xea28('0x26')],'url':_0x2a137e[_0xea28('0x4f')]+_0xea28('0x29')+_0x4dd15e['id']+_0xea28('0x2a')+_0x2a137e[_0xea28('0x50')]};var _0x1801af=util[_0xea28('0x51')](_0xea28('0x52'),_0x2a137e[_0xea28('0x4e')],_0x2a137e[_0xea28('0x27')]);var _0x41c599={'method':_0xea28('0x37'),'uri':util['format']('https://api.plivo.com/v1/Account/%s/Message/',_0x2a137e[_0xea28('0x4e')]),'body':_0x4d83f5,'headers':{'Authorization':util[_0xea28('0x51')](_0xea28('0x53'),new Buffer(_0x1801af)[_0xea28('0x54')](_0xea28('0x45')))},'json':!![]};rp(_0x41c599)[_0xea28('0x1c')](function(_0x179d5d){var _0x3e4657={'messageId':_0x179d5d[_0xea28('0x55')][0x0]};return _0x1e8673[_0xea28('0x1d')](_0x3e4657);})[_0xea28('0x1e')](function(_0x52566f){logger[_0xea28('0x1f')]('SmsMessage,\x20%s,\x20%s,\x20%s',_0xea28('0x2e'),_0xea28('0x4d'),util[_0xea28('0x2d')](_0x52566f,{'showHidden':![],'depth':null}));});}else{logger[_0xea28('0x1f')]('SmsMessage,\x20%s,\x20%s,\x20%s',_0xea28('0x2e'),_0xea28('0x4d'),'Missing\x20parameters:\x20authId,\x20authToken');}break;case _0xea28('0x56'):if(_0x2a137e['username']&&_0x2a137e[_0xea28('0x32')]){if(_0x2a137e[_0xea28('0x57')]){var _0x12a371={'method':_0xea28('0x37'),'uri':_0x2a137e[_0xea28('0x57')]+_0xea28('0x58'),'body':{'username':_0x2a137e[_0xea28('0x31')],'password':_0x2a137e[_0xea28('0x32')]},'json':!![]};return rp(_0x12a371)[_0xea28('0x1c')](function(_0x3a0e95){var _0x9be9={'method':'POST','uri':_0x2a137e[_0xea28('0x57')]+_0xea28('0x59'),'body':{'messages':[{'from':_0x2a137e[_0xea28('0x26')],'destinations':[{'to':_0x4dd15e[_0xea28('0x26')]}],'text':_0x4dd15e['body'],'notifyUrl':_0x2a137e['remote']+_0xea28('0x29')+_0x4dd15e['id']+_0xea28('0x2a')+_0x2a137e[_0xea28('0x50')],'notifyContentType':_0xea28('0x5a'),'callbackData':_0x2a137e[_0xea28('0x26')]+';'+_0x4dd15e[_0xea28('0x10')]}]},'headers':{'Authorization':_0xea28('0x5b')+_0x3a0e95[_0xea28('0x50')]},'json':!![]};return rp(_0x9be9)[_0xea28('0x1c')](function(_0x355dcb){if(_0x355dcb[_0xea28('0x4a')]){var _0x55fcd2={'messageId':_0x355dcb[_0xea28('0x4a')][0x0][_0xea28('0xe')]};if(!_0x2a137e['deliveryReport']){_0x55fcd2[_0xea28('0x40')]=!![];}return _0x1e8673['update'](_0x55fcd2);}else{return logger[_0xea28('0x1f')](_0xea28('0x2c'),'afterCreate','infobip',util[_0xea28('0x2d')](_0x355dcb,{'showHidden':![],'depth':null}));}});})[_0xea28('0x1e')](function(_0x5cfcbb){return logger['error'](_0xea28('0x2c'),_0xea28('0x2e'),_0xea28('0x56'),util['inspect'](_0x5cfcbb,{'showHidden':![],'depth':null}));});}else{logger['error'](_0xea28('0x2c'),_0xea28('0x2e'),_0xea28('0x56'),_0xea28('0x5c'));}}else{logger[_0xea28('0x1f')](_0xea28('0x2c'),_0xea28('0x2e'),_0xea28('0x56'),_0xea28('0x3b'));}break;case'csc':var _0x3dbdb5=require(_0xea28('0x5d'));if(_0x2a137e[_0xea28('0x5e')]){var _0x331cb1={};_0x331cb1[_0xea28('0x5f')]=_0x2a137e[_0xea28('0x31')];_0x331cb1['phone']=_0x4dd15e[_0xea28('0x26')];_0x331cb1[_0xea28('0x60')]=_0x2a137e[_0xea28('0x26')];_0x331cb1['text']=_0x4dd15e[_0xea28('0x10')];_0x331cb1[_0xea28('0x61')]=+new Date();var _0x12d57d='';var _0x3a672c='';var _0x333140=Object[_0xea28('0x62')](_0x331cb1);_0x333140['sort']();for(var _0x5b5fc7=0x0;_0x5b5fc7<_0x333140[_0xea28('0x63')];_0x5b5fc7++){if(_0x12d57d!=''){_0x12d57d+='&';}_0x12d57d+=_0x333140[_0x5b5fc7]+'='+encodeURIComponent(_0x331cb1[_0x333140[_0x5b5fc7]]);_0x3a672c+=_0x331cb1[_0x333140[_0x5b5fc7]];}_0x3a672c+=_0x2a137e[_0xea28('0x5e')];_0x3a672c=_0x3dbdb5['createHash']('md5')[_0xea28('0x1d')](_0x3a672c)['digest'](_0xea28('0x64'));if(_0x12d57d!==''){_0x12d57d+='&';}_0x12d57d+=_0xea28('0x65')+_0x3a672c;var _0x5562ef={'method':_0xea28('0x66'),'uri':_0x2a137e[_0xea28('0x57')]+_0xea28('0x67')+_0x12d57d,'json':!![]};return rp(_0x5562ef)[_0xea28('0x1c')](function(_0x3897ef){var _0x2b214b=Object[_0xea28('0x62')](_0x3897ef);if(_0x3897ef[_0x2b214b[0x0]]['error']&&parseInt(_0x3897ef[_0x2b214b[0x0]][_0xea28('0x1f')])===0x0){var _0x4eb8fb={'messageId':_0x3897ef[_0x2b214b[0x0]][_0xea28('0x68')]};if(!_0x2a137e[_0xea28('0x3a')]){_0x4eb8fb[_0xea28('0x40')]=!![];}return _0x1e8673[_0xea28('0x1d')](_0x4eb8fb);}else{return logger['error']('SmsMessage,\x20%s,\x20%s,\x20%s',_0xea28('0x2e'),'csc',util['inspect'](_0x3897ef[_0xea28('0x1f')],{'showHidden':![],'depth':null}));}})[_0xea28('0x1e')](function(_0x43162d){return logger[_0xea28('0x1f')](_0xea28('0x2c'),'afterCreate',_0xea28('0x69'),util[_0xea28('0x2d')](_0x43162d,{'showHidden':![],'depth':null}));});}else{logger[_0xea28('0x1f')](_0xea28('0x2c'),_0xea28('0x2e'),_0xea28('0x69'),_0xea28('0x6a'));}break;case _0xea28('0x6b'):if(_0x2a137e[_0xea28('0x5e')]){var _0x314430={'method':_0xea28('0x37'),'uri':_0xea28('0x6c'),'headers':{'Authorization':_0x2a137e[_0xea28('0x5e')]},'body':{'content':_0x4dd15e[_0xea28('0x10')],'to':[_0x4dd15e[_0xea28('0x26')]],'from':_0x2a137e[_0xea28('0x26')],'binary':![],'clientMessageId':_0xea28('0x6d'),'charset':'UTF-8'},'json':!![]};rp(_0x314430)[_0xea28('0x1c')](function(_0x5f52f4){if(!_0x5f52f4['error']){var _0x5b4b5c={'messageId':_0x5f52f4[_0xea28('0x4a')][0x0][_0xea28('0x6e')]};if(!_0x2a137e[_0xea28('0x3a')]){_0x5b4b5c[_0xea28('0x40')]=!![];}return _0x1e8673[_0xea28('0x1d')](_0x5b4b5c);}else{return logger[_0xea28('0x1f')](_0xea28('0x2c'),_0xea28('0x2e'),_0xea28('0x6b'),util[_0xea28('0x2d')](_0x5f52f4[_0xea28('0x1f')],{'showHidden':![],'depth':null}));}})[_0xea28('0x1e')](function(_0x55d3e9){return logger[_0xea28('0x1f')](_0xea28('0x2c'),_0xea28('0x2e'),_0xea28('0x6b'),util[_0xea28('0x2d')](_0x55d3e9,{'showHidden':![],'depth':null}));});}else{logger[_0xea28('0x1f')](_0xea28('0x2c'),'afterCreate','clickatell','Missing\x20parameters:\x20apiKey');}break;case'intelepeer':if(_0x2a137e[_0xea28('0x5e')]){var _0xff496d={};var _0x5562ef={'method':_0xea28('0x37'),'uri':'https://api.intelepeer.com/_rest/v4/app/sms/send','headers':{'Authorization':_0xea28('0x6f')+_0x2a137e[_0xea28('0x5e')],'Content-Type':_0xea28('0x5a')},'body':{'from':_0x2a137e[_0xea28('0x26')],'to':_0x4dd15e[_0xea28('0x26')],'text':_0x4dd15e['body']},'json':!![]};return rp(_0x5562ef)[_0xea28('0x1c')](function(_0xdf090c){if(_0xdf090c[_0xea28('0x70')]==0xca){_0xff496d[_0xea28('0x71')]=_0xdf090c;var _0xaaf5cb={'method':_0xea28('0x37'),'uri':_0xea28('0x72'),'headers':{'Authorization':_0xea28('0x6f')+_0x2a137e[_0xea28('0x5e')],'Content-Type':_0xea28('0x5a')},'body':{'refid':_0xff496d['message'][_0xea28('0x73')]},'json':!![]};return rp(_0xaaf5cb)[_0xea28('0x1c')](function(_0x18632a){_0xff496d[_0xea28('0x74')]=_0x18632a;var _0x1df667={'messageId':_0xff496d[_0xea28('0x71')][_0xea28('0x73')],'read':!![]};return _0x1e8673[_0xea28('0x1d')](_0x1df667);});}else{return logger[_0xea28('0x1f')](_0xea28('0x2c'),_0xea28('0x2e'),_0xea28('0x75'),util[_0xea28('0x2d')](_0xdf090c,{'showHidden':![],'depth':null}));}})[_0xea28('0x1e')](function(_0x2b6de6){return logger['error'](_0xea28('0x2c'),_0xea28('0x2e'),'intelepeer',util['inspect'](_0x2b6de6,{'showHidden':![],'depth':null}));});}else{return logger[_0xea28('0x1f')](_0xea28('0x2c'),'afterCreate','intelepeer',_0xea28('0x76'));}break;}}})[_0xea28('0x77')](function(){_0x597221();});}else{_0x597221();}}},'charset':_0xea28('0x78'),'collate':_0xea28('0x79')});};
\ No newline at end of file
+var _0x2003=['Missing\x20parameters:\x20phone,\x20accountSid\x20or\x20authToken','https://api.skebby.it/API/v1.0/REST/','username','password','smsMethod','sender','login?username=','split','total_sent','internal_order_id','deliveryReport','catch','SmsMessage,\x20%s,\x20%s,\x20%s','skebby','connectel','senderString','https://smsapi.connectel.se/api/send/','requestid','read','Missing\x20parameters:\x20authToken','clicksend','xCALLY\x20Motion','format','%s:%s','POST','Basic\x20%s','toString','base64','http_code','data','queued_count','head','clickSend','plivo','message_uuid','infobip','baseUrl','/auth/1/session','/sms/2/text/advanced','application/json','IBSSO\x20','Missing\x20parameters:\x20base_url','csc','crypto','apiKey','login','text','keys','sort','length','createHash','digest','signature=','GET','/external/get/send.php?','id_sms','Missing\x20parameters:\x20apiKey','clickatell','https://platform.clickatell.com/messages','Bearer\x20','code','message','https://api.intelepeer.com/_rest/v4/app/sms/mdr','refid','status','intelepeer','Token\x20not\x20received','finally','utf8mb4','lodash','api','bluebird','path','rimraf','./smsMessage.attributes','exports','define','SmsMessage','sms_messages','messageId','fti_sms_messages','body','FULLTEXT','models','direction','secret','isNil','UserId','SmsInteraction','findOne','SmsInteractionId','then','update','toLowerCase','error','out','find','type','twilio','accountSid','authToken','messages','create','phone','remote','/api/sms/messages/','token','sid','afterCreate','inspect'];(function(_0x445b21,_0x31a745){var _0x23a9ca=function(_0x17f3ba){while(--_0x17f3ba){_0x445b21['push'](_0x445b21['shift']());}};_0x23a9ca(++_0x31a745);}(_0x2003,0xb3));var _0x3200=function(_0x425b19,_0x2dcf14){_0x425b19=_0x425b19-0x0;var _0x15ecab=_0x2003[_0x425b19];return _0x15ecab;};'use strict';var _=require(_0x3200('0x0'));var util=require('util');var logger=require('../../config/logger')(_0x3200('0x1'));var moment=require('moment');var BPromise=require(_0x3200('0x2'));var rp=require('request-promise');var fs=require('fs');var path=require(_0x3200('0x3'));var rimraf=require(_0x3200('0x4'));var config=require('../../config/environment');var attributes=require(_0x3200('0x5'));module[_0x3200('0x6')]=function(_0x165959,_0x15bad6){return _0x165959[_0x3200('0x7')](_0x3200('0x8'),attributes,{'tableName':_0x3200('0x9'),'paranoid':![],'indexes':[{'name':_0x3200('0xa'),'fields':[_0x3200('0xa')]},{'name':_0x3200('0xb'),'fields':[_0x3200('0xc')],'type':_0x3200('0xd')}],'timestamps':!![],'hooks':{'afterCreate':function(_0x58def9,_0x3d5933,_0x3b8171){var _0x2c17ff=_0x165959[_0x3200('0xe')];var _0x3e83e7=_0x58def9['get']({'plain':!![]});if(_0x3e83e7[_0x3200('0xf')]['toLowerCase']()==='in'||_0x3e83e7[_0x3200('0xf')]['toLowerCase']()==='out'&&!_0x3e83e7[_0x3200('0x10')]&&!_[_0x3200('0x11')](_0x3e83e7[_0x3200('0x12')])){_0x2c17ff[_0x3200('0x13')][_0x3200('0x14')]({'where':{'id':_0x3e83e7[_0x3200('0x15')]}})[_0x3200('0x16')](function(_0xf2ec52){if(_0xf2ec52){_0xf2ec52[_0x3200('0x17')]({'lastMsgAt':_0x3e83e7['createdAt'],'lastMsgDirection':_0x3e83e7[_0x3200('0xf')][_0x3200('0x18')]()});}})['catch'](function(_0x4eccbd){console[_0x3200('0x19')](_0x4eccbd);});}if(_0x3e83e7[_0x3200('0xf')]===_0x3200('0x1a')&&!_0x3e83e7[_0x3200('0x10')]){var _0x2f5802;_0x2c17ff['SmsAccount'][_0x3200('0x1b')]({'where':{'id':_0x3e83e7['SmsAccountId']},'raw':!![]})[_0x3200('0x16')](function(_0xea9aee){_0x2f5802=_0xea9aee;if(_0x2f5802&&_0x2f5802[_0x3200('0x1c')]){switch(_0x2f5802['type']){case _0x3200('0x1d'):var _0x3cce49=require(_0x3200('0x1d'));if(_0x2f5802[_0x3200('0x1e')]&&_0x2f5802[_0x3200('0x1f')]&&_0x2f5802['phone']){var _0x29b39d=new _0x3cce49(_0x2f5802[_0x3200('0x1e')],_0x2f5802[_0x3200('0x1f')]);_0x29b39d[_0x3200('0x20')][_0x3200('0x21')]({'body':_0x3e83e7[_0x3200('0xc')],'to':_0x3e83e7[_0x3200('0x22')],'from':_0x2f5802[_0x3200('0x22')],'statusCallback':_0x2f5802[_0x3200('0x23')]+_0x3200('0x24')+_0x3e83e7['id']+'/status?token='+_0x2f5802[_0x3200('0x25')]})[_0x3200('0x16')](function(_0x5a0a86){if(_0x5a0a86['sid']){return _0x58def9[_0x3200('0x17')]({'messageId':_0x5a0a86[_0x3200('0x26')]});}})['catch'](function(_0x406328){logger[_0x3200('0x19')]('SmsMessage,\x20%s,\x20%s,\x20%s',_0x3200('0x27'),_0x3200('0x1d'),util[_0x3200('0x28')](_0x406328,{'showHidden':![],'depth':null}));});}else{logger[_0x3200('0x19')]('SmsMessage,\x20%s,\x20%s,\x20%s',_0x3200('0x27'),_0x3200('0x1d'),_0x3200('0x29'));}break;case'skebby':var _0x5dd234=_0x3200('0x2a');if(_0x2f5802[_0x3200('0x2b')]&&_0x2f5802[_0x3200('0x2c')]){var _0x961b47={'recipient':[_0x3e83e7[_0x3200('0x22')]],'message':_0x3e83e7['body'],'message_type':_0x2f5802[_0x3200('0x2d')]};if(_0x2f5802['smsMethod']&&_0x2f5802[_0x3200('0x2d')]!=='SI'){_0x961b47[_0x3200('0x2e')]=_0x2f5802['phone'];}var _0x2d6073={'url':_0x5dd234+_0x3200('0x2f')+_0x2f5802[_0x3200('0x2b')]+'&password='+_0x2f5802[_0x3200('0x2c')],'method':'GET'};rp(_0x2d6073)[_0x3200('0x16')](function(_0x189bbb){var _0x5304cf=_0x189bbb[_0x3200('0x30')](';');var _0x183734={'user_key':_0x5304cf[0x0],'session_key':_0x5304cf[0x1]};_0x2d6073={'url':_0x5dd234+'sms','method':'POST','headers':{'user_key':_0x183734['user_key'],'Session_key':_0x183734['session_key']},'json':!![],'body':_0x961b47};return rp(_0x2d6073);})[_0x3200('0x16')](function(_0x556dc3){if(_0x556dc3[_0x3200('0x31')]>=0x1){var _0x43f21d={'messageId':_0x556dc3[_0x3200('0x32')]};if(_0x2f5802[_0x3200('0x2d')]!=='GP'||!_0x2f5802[_0x3200('0x33')]){_0x43f21d['read']=!![];}return _0x58def9[_0x3200('0x17')](_0x43f21d);}else{return logger['error']('SmsMessage,\x20%s,\x20%s,\x20%s',_0x3200('0x27'),'skebby',util[_0x3200('0x28')](_0x556dc3,{'showHidden':![],'depth':null}));}})[_0x3200('0x34')](function(_0x866572){return logger[_0x3200('0x19')](_0x3200('0x35'),_0x3200('0x27'),'skebby',util['inspect'](_0x866572,{'showHidden':![],'depth':null}));});}else{logger[_0x3200('0x19')](_0x3200('0x35'),'afterCreate',_0x3200('0x36'),'Missing\x20parameters:\x20username,\x20password');}break;case _0x3200('0x37'):if(_0x2f5802[_0x3200('0x1f')]){var _0x452801={'recipient':_0x3e83e7['phone'],'message':_0x3e83e7[_0x3200('0xc')],'sender':_0x2f5802[_0x3200('0x38')]||_0x2f5802[_0x3200('0x22')],'authorization':_0x2f5802[_0x3200('0x1f')]};var _0x3d5933={'method':'POST','uri':_0x3200('0x39'),'body':_0x452801,'json':!![]};rp(_0x3d5933)[_0x3200('0x16')](function(_0x4fdb76){var _0x1ec1d2={'messageId':_0x4fdb76[_0x3200('0x3a')]};if(!_0x2f5802[_0x3200('0x33')]){_0x1ec1d2[_0x3200('0x3b')]=!![];}return _0x58def9[_0x3200('0x17')](_0x1ec1d2);})['catch'](function(_0x233cf0){logger[_0x3200('0x19')](_0x3200('0x35'),'afterCreate','connectel',util[_0x3200('0x28')](_0x233cf0,{'showHidden':![],'depth':null}));});}else{logger[_0x3200('0x19')](_0x3200('0x35'),_0x3200('0x27'),_0x3200('0x37'),_0x3200('0x3c'));}break;case _0x3200('0x3d'):if(_0x2f5802[_0x3200('0x2b')]&&_0x2f5802[_0x3200('0x2c')]){var _0x452801={'messages':[{'source':_0x3200('0x3e'),'to':_0x3e83e7['phone'],'body':_0x3e83e7[_0x3200('0xc')],'from':_0x2f5802[_0x3200('0x38')]||_0x2f5802[_0x3200('0x22')]}]};var _0x2e69a8=util[_0x3200('0x3f')](_0x3200('0x40'),_0x2f5802[_0x3200('0x2b')],_0x2f5802[_0x3200('0x2c')]);var _0x3d5933={'method':_0x3200('0x41'),'uri':'https://rest.clicksend.com/v3/sms/send','body':_0x452801,'headers':{'Authorization':util['format'](_0x3200('0x42'),new Buffer(_0x2e69a8)[_0x3200('0x43')](_0x3200('0x44')))},'json':!![]};rp(_0x3d5933)['then'](function(_0x5f10eb){if(_0x5f10eb[_0x3200('0x45')]>=0xc8&&_0x5f10eb[_0x3200('0x45')]<=0xce){if(_0x5f10eb[_0x3200('0x46')]&&_0x5f10eb[_0x3200('0x46')][_0x3200('0x47')]>0x0){var _0x5bc0c8=_[_0x3200('0x48')](_0x5f10eb[_0x3200('0x46')][_0x3200('0x20')]);var _0x430fdc={'messageId':_0x5bc0c8['message_id']};if(!_0x2f5802['deliveryReport']){_0x430fdc[_0x3200('0x3b')]=!![];}return _0x58def9[_0x3200('0x17')](_0x430fdc);}else{logger[_0x3200('0x19')](_0x3200('0x35'),_0x3200('0x27'),_0x3200('0x49'),util['inspect'](_0x5f10eb,{'showHidden':![],'depth':null}));}}else{logger['error'](_0x3200('0x35'),_0x3200('0x27'),_0x3200('0x49'),util[_0x3200('0x28')](_0x5f10eb,{'showHidden':![],'depth':null}));}})['catch'](function(_0x3de294){logger[_0x3200('0x19')]('SmsMessage,\x20%s,\x20%s,\x20%s',_0x3200('0x27'),_0x3200('0x49'),util[_0x3200('0x28')](_0x3de294,{'showHidden':![],'depth':null}));});}else{logger[_0x3200('0x19')](_0x3200('0x35'),'afterCreate','clickSend','Missing\x20parameters:\x20username,\x20password');}break;case _0x3200('0x4a'):if(_0x2f5802['authId']&&_0x2f5802[_0x3200('0x1f')]){var _0x452801={'dst':_0x3e83e7[_0x3200('0x22')],'text':_0x3e83e7[_0x3200('0xc')],'src':_0x2f5802['senderString']||_0x2f5802['phone'],'url':_0x2f5802[_0x3200('0x23')]+_0x3200('0x24')+_0x3e83e7['id']+'/status?token='+_0x2f5802[_0x3200('0x25')]};var _0x2e69a8=util[_0x3200('0x3f')](_0x3200('0x40'),_0x2f5802['authId'],_0x2f5802[_0x3200('0x1f')]);var _0x3d5933={'method':_0x3200('0x41'),'uri':util[_0x3200('0x3f')]('https://api.plivo.com/v1/Account/%s/Message/',_0x2f5802['authId']),'body':_0x452801,'headers':{'Authorization':util[_0x3200('0x3f')](_0x3200('0x42'),new Buffer(_0x2e69a8)[_0x3200('0x43')]('base64'))},'json':!![]};rp(_0x3d5933)[_0x3200('0x16')](function(_0x1739a7){var _0x5c3639={'messageId':_0x1739a7[_0x3200('0x4b')][0x0]};return _0x58def9[_0x3200('0x17')](_0x5c3639);})[_0x3200('0x34')](function(_0x1e4419){logger['error']('SmsMessage,\x20%s,\x20%s,\x20%s','afterCreate',_0x3200('0x4a'),util['inspect'](_0x1e4419,{'showHidden':![],'depth':null}));});}else{logger['error'](_0x3200('0x35'),'afterCreate',_0x3200('0x4a'),'Missing\x20parameters:\x20authId,\x20authToken');}break;case _0x3200('0x4c'):if(_0x2f5802[_0x3200('0x2b')]&&_0x2f5802['password']){if(_0x2f5802[_0x3200('0x4d')]){var _0x378fc9={'method':'POST','uri':_0x2f5802[_0x3200('0x4d')]+_0x3200('0x4e'),'body':{'username':_0x2f5802[_0x3200('0x2b')],'password':_0x2f5802['password']},'json':!![]};return rp(_0x378fc9)[_0x3200('0x16')](function(_0x10847f){var _0x41d826={'method':_0x3200('0x41'),'uri':_0x2f5802[_0x3200('0x4d')]+_0x3200('0x4f'),'body':{'messages':[{'from':_0x2f5802['phone'],'destinations':[{'to':_0x3e83e7[_0x3200('0x22')]}],'text':_0x3e83e7['body'],'notifyUrl':_0x2f5802[_0x3200('0x23')]+_0x3200('0x24')+_0x3e83e7['id']+'/status?token='+_0x2f5802[_0x3200('0x25')],'notifyContentType':_0x3200('0x50'),'callbackData':_0x2f5802[_0x3200('0x22')]+';'+_0x3e83e7[_0x3200('0xc')]}]},'headers':{'Authorization':_0x3200('0x51')+_0x10847f[_0x3200('0x25')]},'json':!![]};return rp(_0x41d826)[_0x3200('0x16')](function(_0x5708d5){if(_0x5708d5[_0x3200('0x20')]){var _0x1eb7a3={'messageId':_0x5708d5[_0x3200('0x20')][0x0][_0x3200('0xa')]};if(!_0x2f5802['deliveryReport']){_0x1eb7a3[_0x3200('0x3b')]=!![];}return _0x58def9['update'](_0x1eb7a3);}else{return logger[_0x3200('0x19')](_0x3200('0x35'),_0x3200('0x27'),_0x3200('0x4c'),util[_0x3200('0x28')](_0x5708d5,{'showHidden':![],'depth':null}));}});})[_0x3200('0x34')](function(_0x361de0){return logger[_0x3200('0x19')](_0x3200('0x35'),_0x3200('0x27'),_0x3200('0x4c'),util[_0x3200('0x28')](_0x361de0,{'showHidden':![],'depth':null}));});}else{logger['error'](_0x3200('0x35'),_0x3200('0x27'),_0x3200('0x4c'),_0x3200('0x52'));}}else{logger['error']('SmsMessage,\x20%s,\x20%s,\x20%s',_0x3200('0x27'),_0x3200('0x4c'),'Missing\x20parameters:\x20username,\x20password');}break;case _0x3200('0x53'):var _0x3067c9=require(_0x3200('0x54'));if(_0x2f5802[_0x3200('0x55')]){var _0x3220e9={};_0x3220e9[_0x3200('0x56')]=_0x2f5802[_0x3200('0x2b')];_0x3220e9[_0x3200('0x22')]=_0x3e83e7[_0x3200('0x22')];_0x3220e9[_0x3200('0x2e')]=_0x2f5802[_0x3200('0x22')];_0x3220e9[_0x3200('0x57')]=_0x3e83e7['body'];_0x3220e9['timestamp']=+new Date();var _0xe90cd='';var _0x1fd609='';var _0x2f6a12=Object[_0x3200('0x58')](_0x3220e9);_0x2f6a12[_0x3200('0x59')]();for(var _0x315362=0x0;_0x315362<_0x2f6a12[_0x3200('0x5a')];_0x315362++){if(_0xe90cd!=''){_0xe90cd+='&';}_0xe90cd+=_0x2f6a12[_0x315362]+'='+encodeURIComponent(_0x3220e9[_0x2f6a12[_0x315362]]);_0x1fd609+=_0x3220e9[_0x2f6a12[_0x315362]];}_0x1fd609+=_0x2f5802['apiKey'];_0x1fd609=_0x3067c9[_0x3200('0x5b')]('md5')['update'](_0x1fd609)[_0x3200('0x5c')]('hex');if(_0xe90cd!==''){_0xe90cd+='&';}_0xe90cd+=_0x3200('0x5d')+_0x1fd609;var _0x2d6073={'method':_0x3200('0x5e'),'uri':_0x2f5802[_0x3200('0x4d')]+_0x3200('0x5f')+_0xe90cd,'json':!![]};return rp(_0x2d6073)[_0x3200('0x16')](function(_0x164a27){var _0x542bea=Object['keys'](_0x164a27);if(_0x164a27[_0x542bea[0x0]]['error']&&parseInt(_0x164a27[_0x542bea[0x0]][_0x3200('0x19')])===0x0){var _0x2c1a7f={'messageId':_0x164a27[_0x542bea[0x0]][_0x3200('0x60')]};if(!_0x2f5802[_0x3200('0x33')]){_0x2c1a7f[_0x3200('0x3b')]=!![];}return _0x58def9[_0x3200('0x17')](_0x2c1a7f);}else{return logger[_0x3200('0x19')](_0x3200('0x35'),_0x3200('0x27'),'csc',util[_0x3200('0x28')](_0x164a27['error'],{'showHidden':![],'depth':null}));}})[_0x3200('0x34')](function(_0x54ed28){return logger['error']('SmsMessage,\x20%s,\x20%s,\x20%s',_0x3200('0x27'),_0x3200('0x53'),util[_0x3200('0x28')](_0x54ed28,{'showHidden':![],'depth':null}));});}else{logger[_0x3200('0x19')]('SmsMessage,\x20%s,\x20%s,\x20%s',_0x3200('0x27'),'csc',_0x3200('0x61'));}break;case _0x3200('0x62'):if(_0x2f5802[_0x3200('0x55')]){var _0x311a10={'method':_0x3200('0x41'),'uri':_0x3200('0x63'),'headers':{'Authorization':_0x2f5802[_0x3200('0x55')]},'body':{'content':_0x3e83e7[_0x3200('0xc')],'to':[_0x3e83e7[_0x3200('0x22')]],'from':_0x2f5802[_0x3200('0x22')],'binary':![],'clientMessageId':'uuid','charset':'UTF-8'},'json':!![]};rp(_0x311a10)['then'](function(_0x5023b2){if(!_0x5023b2['error']){var _0x338420={'messageId':_0x5023b2[_0x3200('0x20')][0x0]['apiMessageId']};if(!_0x2f5802['deliveryReport']){_0x338420[_0x3200('0x3b')]=!![];}return _0x58def9[_0x3200('0x17')](_0x338420);}else{return logger['error'](_0x3200('0x35'),_0x3200('0x27'),_0x3200('0x62'),util[_0x3200('0x28')](_0x5023b2[_0x3200('0x19')],{'showHidden':![],'depth':null}));}})[_0x3200('0x34')](function(_0x16d663){return logger[_0x3200('0x19')](_0x3200('0x35'),'afterCreate',_0x3200('0x62'),util[_0x3200('0x28')](_0x16d663,{'showHidden':![],'depth':null}));});}else{logger[_0x3200('0x19')](_0x3200('0x35'),'afterCreate',_0x3200('0x62'),_0x3200('0x61'));}break;case'intelepeer':if(_0x2f5802[_0x3200('0x55')]){var _0x2fc65b={};var _0x2d6073={'method':_0x3200('0x41'),'uri':'https://api.intelepeer.com/_rest/v4/app/sms/send','headers':{'Authorization':_0x3200('0x64')+_0x2f5802[_0x3200('0x55')],'Content-Type':_0x3200('0x50')},'body':{'from':_0x2f5802[_0x3200('0x22')],'to':_0x3e83e7[_0x3200('0x22')],'text':_0x3e83e7[_0x3200('0xc')]},'json':!![]};return rp(_0x2d6073)['then'](function(_0x36c6a4){if(_0x36c6a4[_0x3200('0x65')]==0xca){_0x2fc65b[_0x3200('0x66')]=_0x36c6a4;var _0x40e69a={'method':_0x3200('0x41'),'uri':_0x3200('0x67'),'headers':{'Authorization':_0x3200('0x64')+_0x2f5802['apiKey'],'Content-Type':_0x3200('0x50')},'body':{'refid':_0x2fc65b[_0x3200('0x66')][_0x3200('0x68')]},'json':!![]};return rp(_0x40e69a)[_0x3200('0x16')](function(_0x523f4f){_0x2fc65b[_0x3200('0x69')]=_0x523f4f;var _0x4eb3c1={'messageId':_0x2fc65b[_0x3200('0x66')][_0x3200('0x68')],'read':!![]};return _0x58def9[_0x3200('0x17')](_0x4eb3c1);});}else{return logger[_0x3200('0x19')](_0x3200('0x35'),'afterCreate',_0x3200('0x6a'),util['inspect'](_0x36c6a4,{'showHidden':![],'depth':null}));}})['catch'](function(_0x57f6a0){return logger[_0x3200('0x19')](_0x3200('0x35'),_0x3200('0x27'),'intelepeer',util['inspect'](_0x57f6a0,{'showHidden':![],'depth':null}));});}else{return logger[_0x3200('0x19')](_0x3200('0x35'),_0x3200('0x27'),_0x3200('0x6a'),_0x3200('0x6b'));}break;}}})[_0x3200('0x6c')](function(){_0x3b8171();});}else{_0x3b8171();}}},'charset':_0x3200('0x6d'),'collate':'utf8mb4_unicode_ci'});};
\ No newline at end of file
diff --git a/server/api/smsMessage/smsMessage.rpc.js b/server/api/smsMessage/smsMessage.rpc.js
index 17b77fd..209f989 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 _0x66fa=['lodash','util','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','client','http','redis','defaults','socket.io-emitter','./smsMessage.socket','request','SmsMessage,\x20%s,\x20%s','debug','SmsMessage,\x20%s,\x20%s,\x20%s','request\x20sent','error','message','info','catch','CreateSmsMessage','SmsMessage','create','body','options','raw','stringify'];(function(_0x48a296,_0x555af6){var _0x1374b=function(_0x52d16c){while(--_0x52d16c){_0x48a296['push'](_0x48a296['shift']());}};_0x1374b(++_0x555af6);}(_0x66fa,0x117));var _0xa66f=function(_0x36a5db,_0x59f491){_0x36a5db=_0x36a5db-0x0;var _0x2e9735=_0x66fa[_0x36a5db];return _0x2e9735;};'use strict';var _=require(_0xa66f('0x0'));var util=require(_0xa66f('0x1'));var moment=require('moment');var BPromise=require(_0xa66f('0x2'));var rs=require(_0xa66f('0x3'));var fs=require('fs');var Redis=require(_0xa66f('0x4'));var db=require(_0xa66f('0x5'))['db'];var utils=require(_0xa66f('0x6'));var logger=require(_0xa66f('0x7'))(_0xa66f('0x8'));var config=require('../../config/environment');var jayson=require('jayson/promise');var client=jayson[_0xa66f('0x9')][_0xa66f('0xa')]({'port':0x232a});config[_0xa66f('0xb')]=_[_0xa66f('0xc')](config[_0xa66f('0xb')],{'host':'localhost','port':0x18eb});var socket=require(_0xa66f('0xd'))(new Redis(config['redis']));require(_0xa66f('0xe'))['register'](socket);function respondWithRpcPromise(_0x101e10,_0x53ca76,_0x52d802){return new BPromise(function(_0x55e6dc,_0x1e1997){return client[_0xa66f('0xf')](_0x101e10,_0x52d802)['then'](function(_0x14d31e){logger['info'](_0xa66f('0x10'),_0x53ca76,'request\x20sent');logger[_0xa66f('0x11')](_0xa66f('0x12'),_0x53ca76,_0xa66f('0x13'),JSON['stringify'](_0x14d31e));if(_0x14d31e['error']){if(_0x14d31e[_0xa66f('0x14')]['code']===0x1f4){logger['error']('SmsMessage,\x20%s,\x20%s',_0x53ca76,_0x14d31e[_0xa66f('0x14')][_0xa66f('0x15')]);return _0x1e1997(_0x14d31e[_0xa66f('0x14')][_0xa66f('0x15')]);}logger[_0xa66f('0x14')]('SmsMessage,\x20%s,\x20%s',_0x53ca76,_0x14d31e['error'][_0xa66f('0x15')]);return _0x55e6dc(_0x14d31e[_0xa66f('0x14')][_0xa66f('0x15')]);}else{logger[_0xa66f('0x16')]('SmsMessage,\x20%s,\x20%s',_0x53ca76,_0xa66f('0x13'));_0x55e6dc(_0x14d31e['result']['message']);}})[_0xa66f('0x17')](function(_0x413e80){logger[_0xa66f('0x14')](_0xa66f('0x10'),_0x53ca76,_0x413e80);_0x1e1997(_0x413e80);});});}exports[_0xa66f('0x18')]=function(_0x408bc7){var _0x251f60=this;return new Promise(function(_0x150291,_0x2033a4){return db[_0xa66f('0x19')][_0xa66f('0x1a')](_0x408bc7[_0xa66f('0x1b')],{'raw':_0x408bc7[_0xa66f('0x1c')]?_0x408bc7[_0xa66f('0x1c')][_0xa66f('0x1d')]===undefined?!![]:![]:!![]})['then'](function(_0x27f570){logger[_0xa66f('0x16')](_0xa66f('0x18'),_0x408bc7);logger[_0xa66f('0x11')]('CreateSmsMessage',_0x408bc7,JSON[_0xa66f('0x1e')](_0x27f570));_0x150291(_0x27f570);})[_0xa66f('0x17')](function(_0x209f4d){logger[_0xa66f('0x14')]('CreateSmsMessage',_0x209f4d['message'],_0x408bc7);_0x2033a4(_0x251f60[_0xa66f('0x14')](0x1f4,_0x209f4d['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(_0x1f689e,_0x1c3e0d){var _0x535029=function(_0x42fb3c){while(--_0x42fb3c){_0x1f689e['push'](_0x1f689e['shift']());}};_0x535029(++_0x1c3e0d);}(_0xb10b,0x12a));var _0xbb10=function(_0x41ef02,_0x101e1a){_0x41ef02=_0x41ef02-0x0;var _0x5e6995=_0xb10b[_0x41ef02];return _0x5e6995;};'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 d2fbf36..402280b 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 _0xdcb6=['remove','emit','removeListener','register','length','smsMessage:','save'];(function(_0x5528bc,_0x3fbeca){var _0x592eea=function(_0x3a2801){while(--_0x3a2801){_0x5528bc['push'](_0x5528bc['shift']());}};_0x592eea(++_0x3fbeca);}(_0xdcb6,0x1f0));var _0x6dcb=function(_0x167cc1,_0x56ef5a){_0x167cc1=_0x167cc1-0x0;var _0x10bc4b=_0xdcb6[_0x167cc1];return _0x10bc4b;};'use strict';var SmsMessageEvents=require('./smsMessage.events');var events=[_0x6dcb('0x0'),_0x6dcb('0x1'),'update'];function createListener(_0x38b256,_0x51c7d8){return function(_0x487216){_0x51c7d8[_0x6dcb('0x2')](_0x38b256,_0x487216);};}function removeListener(_0x4e25be,_0x3a5a3c){return function(){SmsMessageEvents[_0x6dcb('0x3')](_0x4e25be,_0x3a5a3c);};}exports[_0x6dcb('0x4')]=function(_0x2f6924){for(var _0x5bc6cd=0x0,_0x58465b=events[_0x6dcb('0x5')];_0x5bc6cd<_0x58465b;_0x5bc6cd++){var _0x331dec=events[_0x5bc6cd];var _0x37fbdd=createListener(_0x6dcb('0x6')+_0x331dec,_0x2f6924);SmsMessageEvents['on'](_0x331dec,_0x37fbdd);}};
\ No newline at end of file
+var _0xf0cd=['update','emit','register','length','smsMessage:','./smsMessage.events','save','remove'];(function(_0x5eced8,_0x380622){var _0xd013fa=function(_0x266d41){while(--_0x266d41){_0x5eced8['push'](_0x5eced8['shift']());}};_0xd013fa(++_0x380622);}(_0xf0cd,0x8d));var _0xdf0c=function(_0x5de0a2,_0x58c8e2){_0x5de0a2=_0x5de0a2-0x0;var _0x2afc43=_0xf0cd[_0x5de0a2];return _0x2afc43;};'use strict';var SmsMessageEvents=require(_0xdf0c('0x0'));var events=[_0xdf0c('0x1'),_0xdf0c('0x2'),_0xdf0c('0x3')];function createListener(_0x36af5b,_0x542643){return function(_0x439892){_0x542643[_0xdf0c('0x4')](_0x36af5b,_0x439892);};}function removeListener(_0x413eb7,_0x4b40e7){return function(){SmsMessageEvents['removeListener'](_0x413eb7,_0x4b40e7);};}exports[_0xdf0c('0x5')]=function(_0x250466){for(var _0xfce832=0x0,_0x353a7e=events[_0xdf0c('0x6')];_0xfce832<_0x353a7e;_0xfce832++){var _0x5944a9=events[_0xfce832];var _0x58651f=createListener(_0xdf0c('0x7')+_0x5944a9,_0x250466);SmsMessageEvents['on'](_0x5944a9,_0x58651f);}};
\ No newline at end of file
diff --git a/server/api/smsQueue/index.js b/server/api/smsQueue/index.js
index f607176..8090ab4 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 _0x5549=['addAgents','put','update','delete','removeTeams','removeAgents','exports','multer','util','path','connect-timeout','express','../../components/auth/service','../../components/interaction/service','../../config/environment','./smsQueue.controller','get','index','/describe','isAuthenticated','describe','/:id','getMembers','/:id/teams','/:id/users','getAgents','create','post','addTeams'];(function(_0x3b3336,_0x4eaab7){var _0x5460b0=function(_0x5c0a95){while(--_0x5c0a95){_0x3b3336['push'](_0x3b3336['shift']());}};_0x5460b0(++_0x4eaab7);}(_0x5549,0x1f4));var _0x9554=function(_0x4bfd6f,_0x38f446){_0x4bfd6f=_0x4bfd6f-0x0;var _0x121c4f=_0x5549[_0x4bfd6f];return _0x121c4f;};'use strict';var multer=require(_0x9554('0x0'));var util=require(_0x9554('0x1'));var path=require(_0x9554('0x2'));var timeout=require(_0x9554('0x3'));var express=require(_0x9554('0x4'));var router=express['Router']();var auth=require(_0x9554('0x5'));var interaction=require(_0x9554('0x6'));var config=require(_0x9554('0x7'));var controller=require(_0x9554('0x8'));router[_0x9554('0x9')]('/',auth['isAuthenticated'](),controller[_0x9554('0xa')]);router['get'](_0x9554('0xb'),auth[_0x9554('0xc')](),controller[_0x9554('0xd')]);router['get'](_0x9554('0xe'),auth['isAuthenticated'](),controller['show']);router[_0x9554('0x9')]('/:id/members',auth[_0x9554('0xc')](),controller[_0x9554('0xf')]);router[_0x9554('0x9')](_0x9554('0x10'),auth[_0x9554('0xc')](),controller['getTeams']);router['get'](_0x9554('0x11'),auth[_0x9554('0xc')](),controller[_0x9554('0x12')]);router['post']('/',auth[_0x9554('0xc')](),controller[_0x9554('0x13')]);router[_0x9554('0x14')]('/:id/teams',auth[_0x9554('0xc')](),controller[_0x9554('0x15')]);router['post'](_0x9554('0x11'),auth[_0x9554('0xc')](),controller[_0x9554('0x16')]);router[_0x9554('0x17')]('/:id',auth[_0x9554('0xc')](),controller[_0x9554('0x18')]);router[_0x9554('0x19')]('/:id',auth[_0x9554('0xc')](),controller['destroy']);router[_0x9554('0x19')](_0x9554('0x10'),auth['isAuthenticated'](),controller[_0x9554('0x1a')]);router[_0x9554('0x19')](_0x9554('0x11'),auth[_0x9554('0xc')](),controller[_0x9554('0x1b')]);module[_0x9554('0x1c')]=router;
\ No newline at end of file
+var _0x535d=['post','create','put','update','destroy','delete','exports','multer','util','connect-timeout','express','../../components/interaction/service','../../config/environment','./smsQueue.controller','get','isAuthenticated','index','describe','/:id','show','/:id/members','/:id/teams','getTeams','/:id/users','getAgents'];(function(_0x29d36a,_0x3d9af5){var _0x1b8775=function(_0x235368){while(--_0x235368){_0x29d36a['push'](_0x29d36a['shift']());}};_0x1b8775(++_0x3d9af5);}(_0x535d,0xe8));var _0xd535=function(_0x1ca5a9,_0x2a61f4){_0x1ca5a9=_0x1ca5a9-0x0;var _0x23fb3f=_0x535d[_0x1ca5a9];return _0x23fb3f;};'use strict';var multer=require(_0xd535('0x0'));var util=require(_0xd535('0x1'));var path=require('path');var timeout=require(_0xd535('0x2'));var express=require(_0xd535('0x3'));var router=express['Router']();var auth=require('../../components/auth/service');var interaction=require(_0xd535('0x4'));var config=require(_0xd535('0x5'));var controller=require(_0xd535('0x6'));router[_0xd535('0x7')]('/',auth[_0xd535('0x8')](),controller[_0xd535('0x9')]);router['get']('/describe',auth[_0xd535('0x8')](),controller[_0xd535('0xa')]);router['get'](_0xd535('0xb'),auth['isAuthenticated'](),controller[_0xd535('0xc')]);router[_0xd535('0x7')](_0xd535('0xd'),auth[_0xd535('0x8')](),controller['getMembers']);router[_0xd535('0x7')](_0xd535('0xe'),auth[_0xd535('0x8')](),controller[_0xd535('0xf')]);router['get'](_0xd535('0x10'),auth[_0xd535('0x8')](),controller[_0xd535('0x11')]);router[_0xd535('0x12')]('/',auth[_0xd535('0x8')](),controller[_0xd535('0x13')]);router[_0xd535('0x12')]('/:id/teams',auth[_0xd535('0x8')](),controller['addTeams']);router['post'](_0xd535('0x10'),auth[_0xd535('0x8')](),controller['addAgents']);router[_0xd535('0x14')](_0xd535('0xb'),auth[_0xd535('0x8')](),controller[_0xd535('0x15')]);router['delete'](_0xd535('0xb'),auth[_0xd535('0x8')](),controller[_0xd535('0x16')]);router[_0xd535('0x17')]('/:id/teams',auth[_0xd535('0x8')](),controller['removeTeams']);router[_0xd535('0x17')]('/:id/users',auth[_0xd535('0x8')](),controller['removeAgents']);module[_0xd535('0x18')]=router;
\ No newline at end of file
diff --git a/server/api/smsQueue/smsQueue.attributes.js b/server/api/smsQueue/smsQueue.attributes.js
index dbb88cd..d7ecb10 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 _0x1a08=['ENUM','rrmemory','roundrobin','sequelize','exports','STRING','name','INTEGER'];(function(_0x5c8d37,_0x333207){var _0x40900f=function(_0x423cd6){while(--_0x423cd6){_0x5c8d37['push'](_0x5c8d37['shift']());}};_0x40900f(++_0x333207);}(_0x1a08,0x11b));var _0x81a0=function(_0x1fafa5,_0x1aa281){_0x1fafa5=_0x1fafa5-0x0;var _0xcf08c9=_0x1a08[_0x1fafa5];return _0xcf08c9;};'use strict';var Sequelize=require(_0x81a0('0x0'));module[_0x81a0('0x1')]={'name':{'type':Sequelize[_0x81a0('0x2')],'unique':_0x81a0('0x3'),'validate':{'notEmpty':!![],'is':/^[A-Za-z0-9\.\_]+$/i}},'description':{'type':Sequelize[_0x81a0('0x2')]},'timeout':{'type':Sequelize[_0x81a0('0x4')],'validate':{'min':0x1,'max':0x20c49b}},'strategy':{'type':Sequelize[_0x81a0('0x5')](_0x81a0('0x6'),'beepall',_0x81a0('0x7'))}};
\ No newline at end of file
+var _0x544a=['STRING','name','INTEGER','ENUM','rrmemory','roundrobin','sequelize','exports'];(function(_0x409ef4,_0x435589){var _0x50036b=function(_0x4d12ff){while(--_0x4d12ff){_0x409ef4['push'](_0x409ef4['shift']());}};_0x50036b(++_0x435589);}(_0x544a,0x156));var _0xa544=function(_0x481bdf,_0x231538){_0x481bdf=_0x481bdf-0x0;var _0x281a12=_0x544a[_0x481bdf];return _0x281a12;};'use strict';var Sequelize=require(_0xa544('0x0'));module[_0xa544('0x1')]={'name':{'type':Sequelize[_0xa544('0x2')],'unique':_0xa544('0x3'),'validate':{'notEmpty':!![],'is':/^[A-Za-z0-9\.\_]+$/i}},'description':{'type':Sequelize[_0xa544('0x2')]},'timeout':{'type':Sequelize[_0xa544('0x4')],'validate':{'min':0x1,'max':0x20c49b}},'strategy':{'type':Sequelize[_0xa544('0x5')](_0xa544('0x6'),'beepall',_0xa544('0x7'))}};
\ No newline at end of file
diff --git a/server/api/smsQueue/smsQueue.controller.js b/server/api/smsQueue/smsQueue.controller.js
index de8759f..522ebe8 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 _0x1a85=['../../config/logger','api','../../config/utils','../../config/environment','../../mysqldb','redis','defaults','localhost','socket.io-emitter','register','sendStatus','end','status','json','count','offset','limit','set','Content-Range','save','then','destroy','get','SmsQueues','UserProfileResource','error','stack','name','send','index','map','SmsQueue','rawAttributes','fieldName','key','model','query','intersection','fields','attributes','hasOwnProperty','order','where','filters','pick','filter','VIRTUAL','merge','includeAll','findAll','rows','catch','show','params','keys','length','options','find','create','body','user','role','userProfileId','autoAssociation','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','update','describe','findOne','UserSmsQueue','sort','User','agent','smsPause','updatedAt','createdAt','format','%s/%s','SIP','getTeams','nolimit','addTeams','ids','Team','Agents','online','sequelize','transaction','each','findOrCreate','forEach','removeTeams','select','field','from','team_has_sms_queues','join','ut.TeamId\x20=\x20tq.TeamId','ut.UserId\x20=\x20?','push','QueryTypes','SELECT','every','TeamId','all','union','compact','value','removeAgents','emit','userSmsQueue:remove','addAgents','userSmsQueue:save','isArray','getAgents','rimraf','zip-dir','fast-json-patch','bluebird','mustache','util','sox','ejs','squel','crypto','desk.js','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware'];(function(_0x30f639,_0xadb59e){var _0xaf6fe8=function(_0x305a74){while(--_0x305a74){_0x30f639['push'](_0x30f639['shift']());}};_0xaf6fe8(++_0xadb59e);}(_0x1a85,0x178));var _0x51a8=function(_0x545bed,_0x221e96){_0x545bed=_0x545bed-0x0;var _0x16c79c=_0x1a85[_0x545bed];return _0x16c79c;};'use strict';var pdf=require('html-pdf');var emlformat=require('eml-format');var rimraf=require(_0x51a8('0x0'));var zipdir=require(_0x51a8('0x1'));var jsonpatch=require(_0x51a8('0x2'));var rp=require('request-promise');var moment=require('moment');var BPromise=require(_0x51a8('0x3'));var Mustache=require(_0x51a8('0x4'));var util=require(_0x51a8('0x5'));var path=require('path');var sox=require(_0x51a8('0x6'));var csv=require('to-csv');var ejs=require(_0x51a8('0x7'));var fs=require('fs');var _=require('lodash');var squel=require(_0x51a8('0x8'));var crypto=require(_0x51a8('0x9'));var jsforce=require('jsforce');var deskjs=require(_0x51a8('0xa'));var toCsv=require('to-csv');var querystring=require('querystring');var Papa=require(_0x51a8('0xb'));var Redis=require(_0x51a8('0xc'));var authService=require(_0x51a8('0xd'));var qs=require(_0x51a8('0xe'));var as=require(_0x51a8('0xf'));var hardwareService=require(_0x51a8('0x10'));var logger=require(_0x51a8('0x11'))(_0x51a8('0x12'));var utils=require(_0x51a8('0x13'));var config=require(_0x51a8('0x14'));var db=require(_0x51a8('0x15'))['db'];config[_0x51a8('0x16')]=_[_0x51a8('0x17')](config[_0x51a8('0x16')],{'host':_0x51a8('0x18'),'port':0x18eb});var socket=require(_0x51a8('0x19'))(new Redis(config[_0x51a8('0x16')]));require('./smsQueue.socket')[_0x51a8('0x1a')](socket);function respondWithStatusCode(_0x7a4c36,_0xaec066){_0xaec066=_0xaec066||0xcc;return function(_0x50d992){if(_0x50d992){return _0x7a4c36[_0x51a8('0x1b')](_0xaec066);}return _0x7a4c36['status'](_0xaec066)[_0x51a8('0x1c')]();};}function respondWithResult(_0x2b8d37,_0x39cd45){_0x39cd45=_0x39cd45||0xc8;return function(_0x2b0521){if(_0x2b0521){return _0x2b8d37[_0x51a8('0x1d')](_0x39cd45)[_0x51a8('0x1e')](_0x2b0521);}};}function respondWithFilteredResult(_0x1f49ee,_0x516abc){return function(_0x1c2f25){if(_0x1c2f25){var _0x45a433=_0x1c2f25[_0x51a8('0x1f')],_0xd52230=_0x516abc['offset'],_0x23539e=_0x516abc[_0x51a8('0x20')]+_0x516abc[_0x51a8('0x21')],_0x3bc1a2;if(_0x23539e>=_0x45a433){_0x23539e=_0x45a433;_0x3bc1a2=0xc8;}else{_0x3bc1a2=0xce;}_0x1f49ee[_0x51a8('0x1d')](_0x3bc1a2);return _0x1f49ee[_0x51a8('0x22')](_0x51a8('0x23'),_0xd52230+'-'+_0x23539e+'/'+_0x45a433)[_0x51a8('0x1e')](_0x1c2f25);}return null;};}function patchUpdates(_0x28aea0){return function(_0x3bf5b6){try{jsonpatch['apply'](_0x3bf5b6,_0x28aea0,!![]);}catch(_0xf80fa9){return BPromise['reject'](_0xf80fa9);}return _0x3bf5b6[_0x51a8('0x24')]();};}function saveUpdates(_0x12c029,_0x8bda40){return function(_0x3759d6){if(_0x3759d6){return _0x3759d6['update'](_0x12c029)[_0x51a8('0x25')](function(_0x4b9cdd){return _0x4b9cdd;});}return null;};}function removeEntity(_0x47f063,_0x23d26a){return function(_0x52e503){if(_0x52e503){return _0x52e503[_0x51a8('0x26')]()[_0x51a8('0x25')](function(){var _0x20ef8b=_0x52e503[_0x51a8('0x27')]({'plain':!![]});var _0x157554=_0x51a8('0x28');return db[_0x51a8('0x29')][_0x51a8('0x26')]({'where':{'type':_0x157554,'resourceId':_0x20ef8b['id']}})['then'](function(){return _0x52e503;});})[_0x51a8('0x25')](function(){_0x47f063[_0x51a8('0x1d')](0xcc)[_0x51a8('0x1c')]();});}};}function handleEntityNotFound(_0x3da187,_0x1c150d){return function(_0x11aefc){if(!_0x11aefc){_0x3da187[_0x51a8('0x1b')](0x194);}return _0x11aefc;};}function handleError(_0x2742f5,_0xec08ae){_0xec08ae=_0xec08ae||0x1f4;return function(_0x4b5cda){logger[_0x51a8('0x2a')](_0x4b5cda[_0x51a8('0x2b')]);if(_0x4b5cda['name']){delete _0x4b5cda[_0x51a8('0x2c')];}_0x2742f5['status'](_0xec08ae)[_0x51a8('0x2d')](_0x4b5cda);};}exports[_0x51a8('0x2e')]=function(_0x143f46,_0x41df56){var _0x2136b4={},_0x4ea271={},_0x10c19b={'count':0x0,'rows':[]};var _0x4c67ff=_[_0x51a8('0x2f')](db[_0x51a8('0x30')][_0x51a8('0x31')],function(_0x4b19c8){return{'name':_0x4b19c8[_0x51a8('0x32')],'type':_0x4b19c8['type'][_0x51a8('0x33')]};});_0x4ea271[_0x51a8('0x34')]=_[_0x51a8('0x2f')](_0x4c67ff,_0x51a8('0x2c'));_0x4ea271[_0x51a8('0x35')]=_['keys'](_0x143f46[_0x51a8('0x35')]);_0x4ea271['filters']=_[_0x51a8('0x36')](_0x4ea271[_0x51a8('0x34')],_0x4ea271[_0x51a8('0x35')]);_0x2136b4['attributes']=_[_0x51a8('0x36')](_0x4ea271[_0x51a8('0x34')],qs[_0x51a8('0x37')](_0x143f46[_0x51a8('0x35')][_0x51a8('0x37')]));_0x2136b4['attributes']=_0x2136b4['attributes']['length']?_0x2136b4[_0x51a8('0x38')]:_0x4ea271[_0x51a8('0x34')];if(!_0x143f46['query'][_0x51a8('0x39')]('nolimit')){_0x2136b4[_0x51a8('0x21')]=qs[_0x51a8('0x21')](_0x143f46[_0x51a8('0x35')][_0x51a8('0x21')]);_0x2136b4[_0x51a8('0x20')]=qs[_0x51a8('0x20')](_0x143f46['query']['offset']);}_0x2136b4[_0x51a8('0x3a')]=qs['sort'](_0x143f46['query']['sort']);_0x2136b4[_0x51a8('0x3b')]=qs[_0x51a8('0x3c')](_[_0x51a8('0x3d')](_0x143f46['query'],_0x4ea271[_0x51a8('0x3c')]));if(_0x143f46[_0x51a8('0x35')][_0x51a8('0x3e')]){_0x2136b4[_0x51a8('0x3b')]=_['merge'](_0x2136b4[_0x51a8('0x3b')],{'$or':_[_0x51a8('0x2f')](_0x4c67ff,function(_0x1b0333){if(_0x1b0333['type']!==_0x51a8('0x3f')){var _0x51d7bd={};_0x51d7bd[_0x1b0333[_0x51a8('0x2c')]]={'$like':'%'+_0x143f46[_0x51a8('0x35')][_0x51a8('0x3e')]+'%'};return _0x51d7bd;}})});}_0x2136b4=_[_0x51a8('0x40')]({},_0x2136b4,_0x143f46['options']);var _0x8e248={'where':_0x2136b4[_0x51a8('0x3b')]};return db[_0x51a8('0x30')][_0x51a8('0x1f')](_0x8e248)[_0x51a8('0x25')](function(_0x35c1c9){_0x10c19b[_0x51a8('0x1f')]=_0x35c1c9;if(_0x143f46[_0x51a8('0x35')][_0x51a8('0x41')]){_0x2136b4['include']=[{'all':!![]}];}return db[_0x51a8('0x30')][_0x51a8('0x42')](_0x2136b4);})['then'](function(_0x53409d){_0x10c19b[_0x51a8('0x43')]=_0x53409d;return _0x10c19b;})[_0x51a8('0x25')](respondWithFilteredResult(_0x41df56,_0x2136b4))[_0x51a8('0x44')](handleError(_0x41df56,null));};exports[_0x51a8('0x45')]=function(_0x311574,_0x157a51){var _0x28f5b3={'raw':!![],'where':{'id':_0x311574[_0x51a8('0x46')]['id']}},_0x18c697={};_0x18c697[_0x51a8('0x34')]=_['keys'](db[_0x51a8('0x30')][_0x51a8('0x31')]);_0x18c697[_0x51a8('0x35')]=_[_0x51a8('0x47')](_0x311574[_0x51a8('0x35')]);_0x18c697[_0x51a8('0x3c')]=_['intersection'](_0x18c697[_0x51a8('0x34')],_0x18c697['query']);_0x28f5b3[_0x51a8('0x38')]=_[_0x51a8('0x36')](_0x18c697[_0x51a8('0x34')],qs[_0x51a8('0x37')](_0x311574[_0x51a8('0x35')]['fields']));_0x28f5b3['attributes']=_0x28f5b3[_0x51a8('0x38')][_0x51a8('0x48')]?_0x28f5b3[_0x51a8('0x38')]:_0x18c697[_0x51a8('0x34')];if(_0x311574[_0x51a8('0x35')]['includeAll']){_0x28f5b3['include']=[{'all':!![]}];}_0x28f5b3=_[_0x51a8('0x40')]({},_0x28f5b3,_0x311574[_0x51a8('0x49')]);return db[_0x51a8('0x30')][_0x51a8('0x4a')](_0x28f5b3)[_0x51a8('0x25')](handleEntityNotFound(_0x157a51,null))[_0x51a8('0x25')](respondWithResult(_0x157a51,null))[_0x51a8('0x44')](handleError(_0x157a51,null));};exports[_0x51a8('0x4b')]=function(_0x301578,_0x4d29ab){return db['SmsQueue']['create'](_0x301578[_0x51a8('0x4c')],{})[_0x51a8('0x25')](function(_0x103897){var _0x5259f3=_0x301578[_0x51a8('0x4d')][_0x51a8('0x27')]({'plain':!![]});if(!_0x5259f3)throw new Error('Unable\x20to\x20retrieve\x20the\x20current\x20user');if(_0x5259f3[_0x51a8('0x4e')]==='user'){var _0x50a2f8=_0x103897[_0x51a8('0x27')]({'plain':!![]});var _0x4393c9=_0x51a8('0x28');return db['UserProfileSection']['find']({'where':{'name':_0x4393c9,'userProfileId':_0x5259f3[_0x51a8('0x4f')]},'raw':!![]})['then'](function(_0x21c4da){if(_0x21c4da&&_0x21c4da[_0x51a8('0x50')]===0x0){return db[_0x51a8('0x29')][_0x51a8('0x4b')]({'name':_0x50a2f8[_0x51a8('0x2c')],'resourceId':_0x50a2f8['id'],'type':_0x21c4da[_0x51a8('0x2c')],'sectionId':_0x21c4da['id']},{})[_0x51a8('0x25')](function(){return _0x103897;});}else{return _0x103897;}})[_0x51a8('0x44')](function(_0x29d31e){logger['error'](_0x51a8('0x51'),_0x29d31e);throw _0x29d31e;});}return _0x103897;})[_0x51a8('0x25')](respondWithResult(_0x4d29ab,0xc9))[_0x51a8('0x44')](handleError(_0x4d29ab,null));};exports[_0x51a8('0x52')]=function(_0x533cfa,_0x13b7ba){if(_0x533cfa['body']['id']){delete _0x533cfa[_0x51a8('0x4c')]['id'];}return db[_0x51a8('0x30')]['find']({'where':{'id':_0x533cfa['params']['id']}})[_0x51a8('0x25')](handleEntityNotFound(_0x13b7ba,null))[_0x51a8('0x25')](saveUpdates(_0x533cfa[_0x51a8('0x4c')],null))[_0x51a8('0x25')](respondWithResult(_0x13b7ba,null))[_0x51a8('0x44')](handleError(_0x13b7ba,null));};exports['destroy']=function(_0x43b79a,_0xd1ddd5){return db[_0x51a8('0x30')][_0x51a8('0x4a')]({'where':{'id':_0x43b79a[_0x51a8('0x46')]['id']}})['then'](handleEntityNotFound(_0xd1ddd5,null))[_0x51a8('0x25')](removeEntity(_0xd1ddd5,null))[_0x51a8('0x44')](handleError(_0xd1ddd5,null));};exports[_0x51a8('0x53')]=function(_0x3e43cc,_0x62966a){return db[_0x51a8('0x30')]['describe']()['then'](respondWithResult(_0x62966a,null))['catch'](handleError(_0x62966a,null));};exports['getMembers']=function(_0x2048c6,_0x1df9cc,_0x51f9f7){var _0x7ac0ae={'raw':!![],'where':{}},_0x56d3d7={},_0x41cc00;return db['SmsQueue'][_0x51a8('0x54')]({'where':{'id':_0x2048c6[_0x51a8('0x46')]['id']}})['then'](handleEntityNotFound(_0x1df9cc,null))['then'](function(_0x5eb540){if(_0x5eb540){_0x41cc00=_0x5eb540[_0x51a8('0x27')]({'plain':!![]});_0x56d3d7[_0x51a8('0x34')]=_[_0x51a8('0x47')](db[_0x51a8('0x55')][_0x51a8('0x31')]);_0x56d3d7[_0x51a8('0x35')]=_[_0x51a8('0x47')](_0x2048c6[_0x51a8('0x35')]);_0x56d3d7['filters']=_[_0x51a8('0x36')](_0x56d3d7[_0x51a8('0x34')],_0x56d3d7['query']);_0x7ac0ae[_0x51a8('0x38')]=_[_0x51a8('0x36')](_0x56d3d7[_0x51a8('0x34')],qs[_0x51a8('0x37')](_0x2048c6[_0x51a8('0x35')][_0x51a8('0x37')]));_0x7ac0ae['attributes']=_0x7ac0ae['attributes'][_0x51a8('0x48')]?_0x7ac0ae['attributes']:_0x56d3d7['model'];if(!_0x2048c6['query']['hasOwnProperty']('nolimit')){_0x7ac0ae[_0x51a8('0x21')]=qs['limit'](_0x2048c6[_0x51a8('0x35')][_0x51a8('0x21')]);_0x7ac0ae[_0x51a8('0x20')]=qs[_0x51a8('0x20')](_0x2048c6[_0x51a8('0x35')][_0x51a8('0x20')]);}_0x7ac0ae[_0x51a8('0x3a')]=qs[_0x51a8('0x56')](_0x2048c6[_0x51a8('0x35')][_0x51a8('0x56')]);_0x7ac0ae['where']=qs[_0x51a8('0x3c')](_[_0x51a8('0x3d')](_0x2048c6[_0x51a8('0x35')],_0x56d3d7['filters']));_0x7ac0ae['where']['SmsQueueId']=_0x5eb540['id'];if(_0x2048c6[_0x51a8('0x35')][_0x51a8('0x3e')]){_0x7ac0ae[_0x51a8('0x3b')]=_[_0x51a8('0x40')](_0x7ac0ae[_0x51a8('0x3b')],{'$or':_[_0x51a8('0x2f')](_0x7ac0ae[_0x51a8('0x38')],function(_0x418445){var _0x2813eb={};_0x2813eb[_0x418445]={'$like':'%'+_0x2048c6[_0x51a8('0x35')][_0x51a8('0x3e')]+'%'};return _0x2813eb;})});}_0x7ac0ae=_[_0x51a8('0x40')]({},_0x7ac0ae,_0x2048c6[_0x51a8('0x49')]);return db['UserSmsQueue'][_0x51a8('0x42')](_0x7ac0ae);}})[_0x51a8('0x25')](function(_0x52077e){if(_0x52077e){return db[_0x51a8('0x57')]['findAndCountAll']({'where':{'id':_['map'](_0x52077e,'UserId'),'role':_0x51a8('0x58')},'attributes':['id',_0x51a8('0x2c'),_0x51a8('0x59'),_0x51a8('0x5a'),_0x51a8('0x5b')]});}})[_0x51a8('0x25')](function(_0x8fe514){if(_0x8fe514){return{'count':_0x8fe514['count'],'rows':_['map'](_0x8fe514['rows'],function(_0x44e496){return{'membername':_0x44e496[_0x51a8('0x2c')],'UserId':_0x44e496['id'],'queue_name':_0x41cc00[_0x51a8('0x2c')],'SmsQueueId':_0x41cc00['id'],'interface':util[_0x51a8('0x5c')](_0x51a8('0x5d'),_0x51a8('0x5e'),_0x44e496['name']),'penalty':0x0,'paused':_0x44e496[_0x51a8('0x59')],'createdAt':_0x44e496['createdAt'],'updatedAt':_0x44e496[_0x51a8('0x5a')]};})};}else{return{'count':0x0,'rows':[]};}})[_0x51a8('0x25')](respondWithFilteredResult(_0x1df9cc,_0x7ac0ae))[_0x51a8('0x44')](handleError(_0x1df9cc,null));};exports[_0x51a8('0x5f')]=function(_0x149a40,_0x3aca4a,_0x895b42){var _0xc751c3={};var _0x3540cd={};var _0x39fcef;var _0x2289d9;return db['SmsQueue']['findOne']({'where':{'id':_0x149a40[_0x51a8('0x46')]['id']}})[_0x51a8('0x25')](handleEntityNotFound(_0x3aca4a,null))[_0x51a8('0x25')](function(_0x226ca4){if(_0x226ca4){_0x39fcef=_0x226ca4;_0x3540cd['model']=_[_0x51a8('0x47')](db['Team'][_0x51a8('0x31')]);_0x3540cd[_0x51a8('0x35')]=_[_0x51a8('0x47')](_0x149a40[_0x51a8('0x35')]);_0x3540cd[_0x51a8('0x3c')]=_[_0x51a8('0x36')](_0x3540cd[_0x51a8('0x34')],_0x3540cd[_0x51a8('0x35')]);_0xc751c3[_0x51a8('0x38')]=_['intersection'](_0x3540cd[_0x51a8('0x34')],qs[_0x51a8('0x37')](_0x149a40[_0x51a8('0x35')][_0x51a8('0x37')]));_0xc751c3['attributes']=_0xc751c3['attributes'][_0x51a8('0x48')]?_0xc751c3['attributes']:_0x3540cd['model'];_0xc751c3['order']=qs[_0x51a8('0x56')](_0x149a40['query']['sort']);_0xc751c3[_0x51a8('0x3b')]=qs[_0x51a8('0x3c')](_[_0x51a8('0x3d')](_0x149a40['query'],_0x3540cd[_0x51a8('0x3c')]));if(_0x149a40[_0x51a8('0x35')][_0x51a8('0x3e')]){_0xc751c3['where']=_[_0x51a8('0x40')](_0xc751c3[_0x51a8('0x3b')],{'$or':_[_0x51a8('0x2f')](_0xc751c3[_0x51a8('0x38')],function(_0xac2108){var _0x30dd7b={};_0x30dd7b[_0xac2108]={'$like':'%'+_0x149a40[_0x51a8('0x35')][_0x51a8('0x3e')]+'%'};return _0x30dd7b;})});}_0xc751c3=_[_0x51a8('0x40')]({},_0xc751c3,_0x149a40['options']);return _0x39fcef[_0x51a8('0x5f')](_0xc751c3);}})[_0x51a8('0x25')](function(_0x4e2c5d){if(_0x4e2c5d){_0x2289d9=_0x4e2c5d[_0x51a8('0x48')];if(!_0x149a40[_0x51a8('0x35')]['hasOwnProperty'](_0x51a8('0x60'))){_0xc751c3[_0x51a8('0x21')]=qs[_0x51a8('0x21')](_0x149a40[_0x51a8('0x35')][_0x51a8('0x21')]);_0xc751c3['offset']=qs[_0x51a8('0x20')](_0x149a40[_0x51a8('0x35')][_0x51a8('0x20')]);}return _0x39fcef[_0x51a8('0x5f')](_0xc751c3);}})['then'](function(_0x3db2b8){if(_0x3db2b8){return _0x3db2b8?{'count':_0x2289d9,'rows':_0x3db2b8}:null;}})[_0x51a8('0x25')](respondWithResult(_0x3aca4a,null))[_0x51a8('0x44')](handleError(_0x3aca4a,null));};exports[_0x51a8('0x61')]=function(_0x6cd464,_0x1f0587,_0xf718e){var _0xd22e7b=_0x6cd464['body'][_0x51a8('0x62')];return db[_0x51a8('0x63')]['findAll']({'where':{'id':_0xd22e7b},'attributes':['id'],'include':[{'model':db[_0x51a8('0x57')],'as':_0x51a8('0x64'),'attributes':['id','name',_0x51a8('0x65'),'voicePause','interface'],'raw':!![]}]})[_0x51a8('0x25')](function(_0xf2325b){if(_0xf2325b){var _0x41e0b9=_['flatMap'](_0xf2325b,function(_0x585d4e){var _0x73ecd7=_0x585d4e['get']({'plain':!![]});return _0x73ecd7[_0x51a8('0x64')];});return db[_0x51a8('0x30')][_0x51a8('0x4a')]({'where':{'id':_0x6cd464[_0x51a8('0x46')]['id']}})[_0x51a8('0x25')](function(_0x28acb8){return db[_0x51a8('0x66')][_0x51a8('0x67')](function(_0x23d98c){return _0x28acb8[_0x51a8('0x61')](_0xd22e7b,{'transaction':_0x23d98c})[_0x51a8('0x25')](function(){return BPromise[_0x51a8('0x68')](_0x41e0b9,function(_0x1b7381){return db[_0x51a8('0x55')][_0x51a8('0x69')]({'where':{'UserId':_0x1b7381['id'],'SmsQueueId':_0x6cd464['params']['id']},'transaction':_0x23d98c});});})['then'](function(){_0x41e0b9[_0x51a8('0x6a')](function(_0x4e25d7){socket['emit']('userSmsQueue:save',{'UserId':_0x4e25d7['id'],'SmsQueueId':_0x28acb8['id']});});});});});}})[_0x51a8('0x25')](respondWithStatusCode(_0x1f0587,null))[_0x51a8('0x44')](handleError(_0x1f0587,null));};exports[_0x51a8('0x6b')]=function(_0x125a28,_0x4d5f37,_0x975b8){return db[_0x51a8('0x63')]['findAll']({'where':{'id':_0x125a28[_0x51a8('0x35')][_0x51a8('0x62')]},'attributes':['id'],'include':[{'model':db['User'],'as':'Agents','attributes':['id'],'raw':!![]}]})[_0x51a8('0x25')](handleEntityNotFound(_0x4d5f37,null))[_0x51a8('0x25')](function(_0x8587b9){var _0x429363=_[_0x51a8('0x2f')](_0x8587b9,'id');var _0x1c7691=[];var _0x4e566a=[];var _0x13dab3=squel[_0x51a8('0x6c')]();_0x13dab3[_0x51a8('0x6d')]('tq.TeamId')[_0x51a8('0x6e')](_0x51a8('0x6f'),'tq')[_0x51a8('0x70')]('user_has_teams','ut',_0x51a8('0x71'))[_0x51a8('0x3b')]('SmsQueueId\x20=\x20?',_0x125a28[_0x51a8('0x46')]['id']);for(var _0x529916=0x0;_0x529916<_0x8587b9[_0x51a8('0x48')];_0x529916+=0x1){let _0x2d4c2b=_0x8587b9[_0x529916];for(var _0xfb059=0x0;_0xfb059<_0x2d4c2b[_0x51a8('0x64')][_0x51a8('0x48')];_0xfb059+=0x1){let _0x700df1=_0x2d4c2b[_0x51a8('0x64')][_0xfb059];var _0x42d0ad=_0x13dab3['clone']();_0x42d0ad[_0x51a8('0x3b')](_0x51a8('0x72'),_0x700df1['id']);_0x4e566a[_0x51a8('0x73')](db[_0x51a8('0x66')][_0x51a8('0x35')](_0x42d0ad['toString'](),{'type':db['sequelize'][_0x51a8('0x74')][_0x51a8('0x75')]})[_0x51a8('0x25')](function(_0x2e354f){if(_0x2e354f[_0x51a8('0x48')]===0x1){return _0x700df1['id'];}else{var _0x54ef0e=_[_0x51a8('0x76')](_['map'](_0x2e354f,_0x51a8('0x77')),function(_0x1a0f3f){return _['includes'](_0x429363,_0x1a0f3f);});if(_0x54ef0e){return _0x700df1['id'];}}}));}}return BPromise[_0x51a8('0x78')](_0x4e566a)['then'](function(_0x3b7e30){_0x1c7691=_(_0x1c7691)[_0x51a8('0x79')](_0x3b7e30)[_0x51a8('0x7a')]()[_0x51a8('0x7b')]();return db[_0x51a8('0x30')]['find']({'where':{'id':_0x125a28[_0x51a8('0x46')]['id']}})[_0x51a8('0x25')](function(_0x5d00c3){return db[_0x51a8('0x66')][_0x51a8('0x67')](function(_0x54e006){return _0x5d00c3['removeTeams'](_0x125a28[_0x51a8('0x35')][_0x51a8('0x62')],{'transaction':_0x54e006})[_0x51a8('0x25')](function(){if(!_['isEmpty'](_0x1c7691)){return _0x5d00c3[_0x51a8('0x7c')](_0x1c7691,{'transaction':_0x54e006});}})[_0x51a8('0x25')](function(){_0x1c7691[_0x51a8('0x6a')](function(_0x11aab9){socket[_0x51a8('0x7d')](_0x51a8('0x7e'),{'UserId':_0x11aab9,'SmsQueueId':_0x5d00c3['id']});});});});});});})[_0x51a8('0x25')](respondWithStatusCode(_0x4d5f37,null))['catch'](handleError(_0x4d5f37,null));};exports[_0x51a8('0x7f')]=function(_0xa5074c,_0xa29735,_0x3f97bd){return db['SmsQueue']['find']({'where':{'id':_0xa5074c[_0x51a8('0x46')]['id']}})[_0x51a8('0x25')](handleEntityNotFound(_0xa29735,null))['then'](function(_0x4ea00f){if(_0x4ea00f){return _0x4ea00f['addAgents'](_0xa5074c[_0x51a8('0x4c')]['ids'],_['omit'](_0xa5074c['body'],[_0x51a8('0x62'),'id'])||{})['spread'](function(_0x2cea3f){for(var _0x2d820c=0x0;_0x2d820c<_0xa5074c['body']['ids'][_0x51a8('0x48')];_0x2d820c+=0x1){socket['emit'](_0x51a8('0x80'),{'UserId':_0xa5074c[_0x51a8('0x4c')]['ids'][_0x2d820c],'SmsQueueId':_0xa5074c[_0x51a8('0x46')]['id']});}return _0x2cea3f;});}})[_0x51a8('0x25')](respondWithResult(_0xa29735,null))['catch'](handleError(_0xa29735,null));};exports[_0x51a8('0x7c')]=function(_0x3bcc82,_0x223bd7,_0x5d2e4f){return db[_0x51a8('0x30')][_0x51a8('0x4a')]({'where':{'id':_0x3bcc82[_0x51a8('0x46')]['id']}})['then'](handleEntityNotFound(_0x223bd7,null))['then'](function(_0x1a64f4){if(_0x1a64f4){return _0x1a64f4[_0x51a8('0x7c')](_0x3bcc82[_0x51a8('0x35')][_0x51a8('0x62')])[_0x51a8('0x25')](function(){if(_[_0x51a8('0x81')](_0x3bcc82[_0x51a8('0x35')][_0x51a8('0x62')])){for(var _0x1482ff=0x0;_0x1482ff<_0x3bcc82[_0x51a8('0x35')][_0x51a8('0x62')][_0x51a8('0x48')];_0x1482ff+=0x1){socket[_0x51a8('0x7d')]('userSmsQueue:remove',{'UserId':Number(_0x3bcc82['query'][_0x51a8('0x62')][_0x1482ff]),'SmsQueueId':Number(_0x3bcc82[_0x51a8('0x46')]['id'])});}}else{socket[_0x51a8('0x7d')](_0x51a8('0x7e'),{'UserId':Number(_0x3bcc82[_0x51a8('0x35')]['ids']),'SmsQueueId':Number(_0x3bcc82['params']['id'])});}});}})[_0x51a8('0x25')](respondWithStatusCode(_0x223bd7,null))[_0x51a8('0x44')](handleError(_0x223bd7,null));};exports['getAgents']=function(_0x682828,_0x2e1d8e,_0x2bb024){var _0x19ffd8={};var _0x121944={};var _0x4ee800;var _0x4df6b7;return db[_0x51a8('0x30')]['findOne']({'where':{'id':_0x682828[_0x51a8('0x46')]['id']}})['then'](handleEntityNotFound(_0x2e1d8e,null))[_0x51a8('0x25')](function(_0xcc76ac){if(_0xcc76ac){_0x4ee800=_0xcc76ac;_0x121944['model']=_[_0x51a8('0x47')](db[_0x51a8('0x57')][_0x51a8('0x31')]);_0x121944[_0x51a8('0x35')]=_['keys'](_0x682828['query']);_0x121944[_0x51a8('0x3c')]=_[_0x51a8('0x36')](_0x121944[_0x51a8('0x34')],_0x121944[_0x51a8('0x35')]);_0x19ffd8['attributes']=_[_0x51a8('0x36')](_0x121944['model'],qs[_0x51a8('0x37')](_0x682828['query'][_0x51a8('0x37')]));_0x19ffd8[_0x51a8('0x38')]=_0x19ffd8[_0x51a8('0x38')][_0x51a8('0x48')]?_0x19ffd8['attributes']:_0x121944[_0x51a8('0x34')];_0x19ffd8['order']=qs[_0x51a8('0x56')](_0x682828[_0x51a8('0x35')][_0x51a8('0x56')]);_0x19ffd8['where']=qs[_0x51a8('0x3c')](_[_0x51a8('0x3d')](_0x682828[_0x51a8('0x35')],_0x121944['filters']));if(_0x682828['query'][_0x51a8('0x3e')]){_0x19ffd8[_0x51a8('0x3b')]=_[_0x51a8('0x40')](_0x19ffd8[_0x51a8('0x3b')],{'$or':_['map'](_0x19ffd8['attributes'],function(_0x46c310){var _0x4f0b3b={};_0x4f0b3b[_0x46c310]={'$like':'%'+_0x682828[_0x51a8('0x35')][_0x51a8('0x3e')]+'%'};return _0x4f0b3b;})});}_0x19ffd8=_[_0x51a8('0x40')]({},_0x19ffd8,_0x682828[_0x51a8('0x49')]);return _0x4ee800[_0x51a8('0x82')](_0x19ffd8);}})[_0x51a8('0x25')](function(_0x2b0888){if(_0x2b0888){_0x4df6b7=_0x2b0888['length'];if(!_0x682828['query']['hasOwnProperty'](_0x51a8('0x60'))){_0x19ffd8[_0x51a8('0x21')]=qs[_0x51a8('0x21')](_0x682828[_0x51a8('0x35')][_0x51a8('0x21')]);_0x19ffd8['offset']=qs[_0x51a8('0x20')](_0x682828['query'][_0x51a8('0x20')]);}return _0x4ee800[_0x51a8('0x82')](_0x19ffd8);}})[_0x51a8('0x25')](function(_0xb9dad5){if(_0xb9dad5){return _0xb9dad5?{'count':_0x4df6b7,'rows':_0xb9dad5}:null;}})['then'](respondWithResult(_0x2e1d8e,null))['catch'](handleError(_0x2e1d8e,null));};
\ No newline at end of file
+var _0x1a85=['../../config/logger','api','../../config/utils','../../config/environment','../../mysqldb','redis','defaults','localhost','socket.io-emitter','register','sendStatus','end','status','json','count','offset','limit','set','Content-Range','save','then','destroy','get','SmsQueues','UserProfileResource','error','stack','name','send','index','map','SmsQueue','rawAttributes','fieldName','key','model','query','intersection','fields','attributes','hasOwnProperty','order','where','filters','pick','filter','VIRTUAL','merge','includeAll','findAll','rows','catch','show','params','keys','length','options','find','create','body','user','role','userProfileId','autoAssociation','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','update','describe','findOne','UserSmsQueue','sort','User','agent','smsPause','updatedAt','createdAt','format','%s/%s','SIP','getTeams','nolimit','addTeams','ids','Team','Agents','online','sequelize','transaction','each','findOrCreate','forEach','removeTeams','select','field','from','team_has_sms_queues','join','ut.TeamId\x20=\x20tq.TeamId','ut.UserId\x20=\x20?','push','QueryTypes','SELECT','every','TeamId','all','union','compact','value','removeAgents','emit','userSmsQueue:remove','addAgents','userSmsQueue:save','isArray','getAgents','rimraf','zip-dir','fast-json-patch','bluebird','mustache','util','sox','ejs','squel','crypto','desk.js','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware'];(function(_0xf99391,_0x1d9384){var _0x3703e=function(_0x277e5c){while(--_0x277e5c){_0xf99391['push'](_0xf99391['shift']());}};_0x3703e(++_0x1d9384);}(_0x1a85,0x178));var _0x51a8=function(_0x5d6238,_0xe6992b){_0x5d6238=_0x5d6238-0x0;var _0x46ac6b=_0x1a85[_0x5d6238];return _0x46ac6b;};'use strict';var pdf=require('html-pdf');var emlformat=require('eml-format');var rimraf=require(_0x51a8('0x0'));var zipdir=require(_0x51a8('0x1'));var jsonpatch=require(_0x51a8('0x2'));var rp=require('request-promise');var moment=require('moment');var BPromise=require(_0x51a8('0x3'));var Mustache=require(_0x51a8('0x4'));var util=require(_0x51a8('0x5'));var path=require('path');var sox=require(_0x51a8('0x6'));var csv=require('to-csv');var ejs=require(_0x51a8('0x7'));var fs=require('fs');var _=require('lodash');var squel=require(_0x51a8('0x8'));var crypto=require(_0x51a8('0x9'));var jsforce=require('jsforce');var deskjs=require(_0x51a8('0xa'));var toCsv=require('to-csv');var querystring=require('querystring');var Papa=require(_0x51a8('0xb'));var Redis=require(_0x51a8('0xc'));var authService=require(_0x51a8('0xd'));var qs=require(_0x51a8('0xe'));var as=require(_0x51a8('0xf'));var hardwareService=require(_0x51a8('0x10'));var logger=require(_0x51a8('0x11'))(_0x51a8('0x12'));var utils=require(_0x51a8('0x13'));var config=require(_0x51a8('0x14'));var db=require(_0x51a8('0x15'))['db'];config[_0x51a8('0x16')]=_[_0x51a8('0x17')](config[_0x51a8('0x16')],{'host':_0x51a8('0x18'),'port':0x18eb});var socket=require(_0x51a8('0x19'))(new Redis(config[_0x51a8('0x16')]));require('./smsQueue.socket')[_0x51a8('0x1a')](socket);function respondWithStatusCode(_0x7a4c36,_0xaec066){_0xaec066=_0xaec066||0xcc;return function(_0x50d992){if(_0x50d992){return _0x7a4c36[_0x51a8('0x1b')](_0xaec066);}return _0x7a4c36['status'](_0xaec066)[_0x51a8('0x1c')]();};}function respondWithResult(_0x2b8d37,_0x39cd45){_0x39cd45=_0x39cd45||0xc8;return function(_0x2b0521){if(_0x2b0521){return _0x2b8d37[_0x51a8('0x1d')](_0x39cd45)[_0x51a8('0x1e')](_0x2b0521);}};}function respondWithFilteredResult(_0x1f49ee,_0x516abc){return function(_0x1c2f25){if(_0x1c2f25){var _0x45a433=_0x1c2f25[_0x51a8('0x1f')],_0xd52230=_0x516abc['offset'],_0x23539e=_0x516abc[_0x51a8('0x20')]+_0x516abc[_0x51a8('0x21')],_0x3bc1a2;if(_0x23539e>=_0x45a433){_0x23539e=_0x45a433;_0x3bc1a2=0xc8;}else{_0x3bc1a2=0xce;}_0x1f49ee[_0x51a8('0x1d')](_0x3bc1a2);return _0x1f49ee[_0x51a8('0x22')](_0x51a8('0x23'),_0xd52230+'-'+_0x23539e+'/'+_0x45a433)[_0x51a8('0x1e')](_0x1c2f25);}return null;};}function patchUpdates(_0x28aea0){return function(_0x3bf5b6){try{jsonpatch['apply'](_0x3bf5b6,_0x28aea0,!![]);}catch(_0xf80fa9){return BPromise['reject'](_0xf80fa9);}return _0x3bf5b6[_0x51a8('0x24')]();};}function saveUpdates(_0x12c029,_0x8bda40){return function(_0x3759d6){if(_0x3759d6){return _0x3759d6['update'](_0x12c029)[_0x51a8('0x25')](function(_0x4b9cdd){return _0x4b9cdd;});}return null;};}function removeEntity(_0x47f063,_0x23d26a){return function(_0x52e503){if(_0x52e503){return _0x52e503[_0x51a8('0x26')]()[_0x51a8('0x25')](function(){var _0x20ef8b=_0x52e503[_0x51a8('0x27')]({'plain':!![]});var _0x157554=_0x51a8('0x28');return db[_0x51a8('0x29')][_0x51a8('0x26')]({'where':{'type':_0x157554,'resourceId':_0x20ef8b['id']}})['then'](function(){return _0x52e503;});})[_0x51a8('0x25')](function(){_0x47f063[_0x51a8('0x1d')](0xcc)[_0x51a8('0x1c')]();});}};}function handleEntityNotFound(_0x3da187,_0x1c150d){return function(_0x11aefc){if(!_0x11aefc){_0x3da187[_0x51a8('0x1b')](0x194);}return _0x11aefc;};}function handleError(_0x2742f5,_0xec08ae){_0xec08ae=_0xec08ae||0x1f4;return function(_0x4b5cda){logger[_0x51a8('0x2a')](_0x4b5cda[_0x51a8('0x2b')]);if(_0x4b5cda['name']){delete _0x4b5cda[_0x51a8('0x2c')];}_0x2742f5['status'](_0xec08ae)[_0x51a8('0x2d')](_0x4b5cda);};}exports[_0x51a8('0x2e')]=function(_0x143f46,_0x41df56){var _0x2136b4={},_0x4ea271={},_0x10c19b={'count':0x0,'rows':[]};var _0x4c67ff=_[_0x51a8('0x2f')](db[_0x51a8('0x30')][_0x51a8('0x31')],function(_0x4b19c8){return{'name':_0x4b19c8[_0x51a8('0x32')],'type':_0x4b19c8['type'][_0x51a8('0x33')]};});_0x4ea271[_0x51a8('0x34')]=_[_0x51a8('0x2f')](_0x4c67ff,_0x51a8('0x2c'));_0x4ea271[_0x51a8('0x35')]=_['keys'](_0x143f46[_0x51a8('0x35')]);_0x4ea271['filters']=_[_0x51a8('0x36')](_0x4ea271[_0x51a8('0x34')],_0x4ea271[_0x51a8('0x35')]);_0x2136b4['attributes']=_[_0x51a8('0x36')](_0x4ea271[_0x51a8('0x34')],qs[_0x51a8('0x37')](_0x143f46[_0x51a8('0x35')][_0x51a8('0x37')]));_0x2136b4['attributes']=_0x2136b4['attributes']['length']?_0x2136b4[_0x51a8('0x38')]:_0x4ea271[_0x51a8('0x34')];if(!_0x143f46['query'][_0x51a8('0x39')]('nolimit')){_0x2136b4[_0x51a8('0x21')]=qs[_0x51a8('0x21')](_0x143f46[_0x51a8('0x35')][_0x51a8('0x21')]);_0x2136b4[_0x51a8('0x20')]=qs[_0x51a8('0x20')](_0x143f46['query']['offset']);}_0x2136b4[_0x51a8('0x3a')]=qs['sort'](_0x143f46['query']['sort']);_0x2136b4[_0x51a8('0x3b')]=qs[_0x51a8('0x3c')](_[_0x51a8('0x3d')](_0x143f46['query'],_0x4ea271[_0x51a8('0x3c')]));if(_0x143f46[_0x51a8('0x35')][_0x51a8('0x3e')]){_0x2136b4[_0x51a8('0x3b')]=_['merge'](_0x2136b4[_0x51a8('0x3b')],{'$or':_[_0x51a8('0x2f')](_0x4c67ff,function(_0x1b0333){if(_0x1b0333['type']!==_0x51a8('0x3f')){var _0x51d7bd={};_0x51d7bd[_0x1b0333[_0x51a8('0x2c')]]={'$like':'%'+_0x143f46[_0x51a8('0x35')][_0x51a8('0x3e')]+'%'};return _0x51d7bd;}})});}_0x2136b4=_[_0x51a8('0x40')]({},_0x2136b4,_0x143f46['options']);var _0x8e248={'where':_0x2136b4[_0x51a8('0x3b')]};return db[_0x51a8('0x30')][_0x51a8('0x1f')](_0x8e248)[_0x51a8('0x25')](function(_0x35c1c9){_0x10c19b[_0x51a8('0x1f')]=_0x35c1c9;if(_0x143f46[_0x51a8('0x35')][_0x51a8('0x41')]){_0x2136b4['include']=[{'all':!![]}];}return db[_0x51a8('0x30')][_0x51a8('0x42')](_0x2136b4);})['then'](function(_0x53409d){_0x10c19b[_0x51a8('0x43')]=_0x53409d;return _0x10c19b;})[_0x51a8('0x25')](respondWithFilteredResult(_0x41df56,_0x2136b4))[_0x51a8('0x44')](handleError(_0x41df56,null));};exports[_0x51a8('0x45')]=function(_0x311574,_0x157a51){var _0x28f5b3={'raw':!![],'where':{'id':_0x311574[_0x51a8('0x46')]['id']}},_0x18c697={};_0x18c697[_0x51a8('0x34')]=_['keys'](db[_0x51a8('0x30')][_0x51a8('0x31')]);_0x18c697[_0x51a8('0x35')]=_[_0x51a8('0x47')](_0x311574[_0x51a8('0x35')]);_0x18c697[_0x51a8('0x3c')]=_['intersection'](_0x18c697[_0x51a8('0x34')],_0x18c697['query']);_0x28f5b3[_0x51a8('0x38')]=_[_0x51a8('0x36')](_0x18c697[_0x51a8('0x34')],qs[_0x51a8('0x37')](_0x311574[_0x51a8('0x35')]['fields']));_0x28f5b3['attributes']=_0x28f5b3[_0x51a8('0x38')][_0x51a8('0x48')]?_0x28f5b3[_0x51a8('0x38')]:_0x18c697[_0x51a8('0x34')];if(_0x311574[_0x51a8('0x35')]['includeAll']){_0x28f5b3['include']=[{'all':!![]}];}_0x28f5b3=_[_0x51a8('0x40')]({},_0x28f5b3,_0x311574[_0x51a8('0x49')]);return db[_0x51a8('0x30')][_0x51a8('0x4a')](_0x28f5b3)[_0x51a8('0x25')](handleEntityNotFound(_0x157a51,null))[_0x51a8('0x25')](respondWithResult(_0x157a51,null))[_0x51a8('0x44')](handleError(_0x157a51,null));};exports[_0x51a8('0x4b')]=function(_0x301578,_0x4d29ab){return db['SmsQueue']['create'](_0x301578[_0x51a8('0x4c')],{})[_0x51a8('0x25')](function(_0x103897){var _0x5259f3=_0x301578[_0x51a8('0x4d')][_0x51a8('0x27')]({'plain':!![]});if(!_0x5259f3)throw new Error('Unable\x20to\x20retrieve\x20the\x20current\x20user');if(_0x5259f3[_0x51a8('0x4e')]==='user'){var _0x50a2f8=_0x103897[_0x51a8('0x27')]({'plain':!![]});var _0x4393c9=_0x51a8('0x28');return db['UserProfileSection']['find']({'where':{'name':_0x4393c9,'userProfileId':_0x5259f3[_0x51a8('0x4f')]},'raw':!![]})['then'](function(_0x21c4da){if(_0x21c4da&&_0x21c4da[_0x51a8('0x50')]===0x0){return db[_0x51a8('0x29')][_0x51a8('0x4b')]({'name':_0x50a2f8[_0x51a8('0x2c')],'resourceId':_0x50a2f8['id'],'type':_0x21c4da[_0x51a8('0x2c')],'sectionId':_0x21c4da['id']},{})[_0x51a8('0x25')](function(){return _0x103897;});}else{return _0x103897;}})[_0x51a8('0x44')](function(_0x29d31e){logger['error'](_0x51a8('0x51'),_0x29d31e);throw _0x29d31e;});}return _0x103897;})[_0x51a8('0x25')](respondWithResult(_0x4d29ab,0xc9))[_0x51a8('0x44')](handleError(_0x4d29ab,null));};exports[_0x51a8('0x52')]=function(_0x533cfa,_0x13b7ba){if(_0x533cfa['body']['id']){delete _0x533cfa[_0x51a8('0x4c')]['id'];}return db[_0x51a8('0x30')]['find']({'where':{'id':_0x533cfa['params']['id']}})[_0x51a8('0x25')](handleEntityNotFound(_0x13b7ba,null))[_0x51a8('0x25')](saveUpdates(_0x533cfa[_0x51a8('0x4c')],null))[_0x51a8('0x25')](respondWithResult(_0x13b7ba,null))[_0x51a8('0x44')](handleError(_0x13b7ba,null));};exports['destroy']=function(_0x43b79a,_0xd1ddd5){return db[_0x51a8('0x30')][_0x51a8('0x4a')]({'where':{'id':_0x43b79a[_0x51a8('0x46')]['id']}})['then'](handleEntityNotFound(_0xd1ddd5,null))[_0x51a8('0x25')](removeEntity(_0xd1ddd5,null))[_0x51a8('0x44')](handleError(_0xd1ddd5,null));};exports[_0x51a8('0x53')]=function(_0x3e43cc,_0x62966a){return db[_0x51a8('0x30')]['describe']()['then'](respondWithResult(_0x62966a,null))['catch'](handleError(_0x62966a,null));};exports['getMembers']=function(_0x2048c6,_0x1df9cc,_0x51f9f7){var _0x7ac0ae={'raw':!![],'where':{}},_0x56d3d7={},_0x41cc00;return db['SmsQueue'][_0x51a8('0x54')]({'where':{'id':_0x2048c6[_0x51a8('0x46')]['id']}})['then'](handleEntityNotFound(_0x1df9cc,null))['then'](function(_0x5eb540){if(_0x5eb540){_0x41cc00=_0x5eb540[_0x51a8('0x27')]({'plain':!![]});_0x56d3d7[_0x51a8('0x34')]=_[_0x51a8('0x47')](db[_0x51a8('0x55')][_0x51a8('0x31')]);_0x56d3d7[_0x51a8('0x35')]=_[_0x51a8('0x47')](_0x2048c6[_0x51a8('0x35')]);_0x56d3d7['filters']=_[_0x51a8('0x36')](_0x56d3d7[_0x51a8('0x34')],_0x56d3d7['query']);_0x7ac0ae[_0x51a8('0x38')]=_[_0x51a8('0x36')](_0x56d3d7[_0x51a8('0x34')],qs[_0x51a8('0x37')](_0x2048c6[_0x51a8('0x35')][_0x51a8('0x37')]));_0x7ac0ae['attributes']=_0x7ac0ae['attributes'][_0x51a8('0x48')]?_0x7ac0ae['attributes']:_0x56d3d7['model'];if(!_0x2048c6['query']['hasOwnProperty']('nolimit')){_0x7ac0ae[_0x51a8('0x21')]=qs['limit'](_0x2048c6[_0x51a8('0x35')][_0x51a8('0x21')]);_0x7ac0ae[_0x51a8('0x20')]=qs[_0x51a8('0x20')](_0x2048c6[_0x51a8('0x35')][_0x51a8('0x20')]);}_0x7ac0ae[_0x51a8('0x3a')]=qs[_0x51a8('0x56')](_0x2048c6[_0x51a8('0x35')][_0x51a8('0x56')]);_0x7ac0ae['where']=qs[_0x51a8('0x3c')](_[_0x51a8('0x3d')](_0x2048c6[_0x51a8('0x35')],_0x56d3d7['filters']));_0x7ac0ae['where']['SmsQueueId']=_0x5eb540['id'];if(_0x2048c6[_0x51a8('0x35')][_0x51a8('0x3e')]){_0x7ac0ae[_0x51a8('0x3b')]=_[_0x51a8('0x40')](_0x7ac0ae[_0x51a8('0x3b')],{'$or':_[_0x51a8('0x2f')](_0x7ac0ae[_0x51a8('0x38')],function(_0x418445){var _0x2813eb={};_0x2813eb[_0x418445]={'$like':'%'+_0x2048c6[_0x51a8('0x35')][_0x51a8('0x3e')]+'%'};return _0x2813eb;})});}_0x7ac0ae=_[_0x51a8('0x40')]({},_0x7ac0ae,_0x2048c6[_0x51a8('0x49')]);return db['UserSmsQueue'][_0x51a8('0x42')](_0x7ac0ae);}})[_0x51a8('0x25')](function(_0x52077e){if(_0x52077e){return db[_0x51a8('0x57')]['findAndCountAll']({'where':{'id':_['map'](_0x52077e,'UserId'),'role':_0x51a8('0x58')},'attributes':['id',_0x51a8('0x2c'),_0x51a8('0x59'),_0x51a8('0x5a'),_0x51a8('0x5b')]});}})[_0x51a8('0x25')](function(_0x8fe514){if(_0x8fe514){return{'count':_0x8fe514['count'],'rows':_['map'](_0x8fe514['rows'],function(_0x44e496){return{'membername':_0x44e496[_0x51a8('0x2c')],'UserId':_0x44e496['id'],'queue_name':_0x41cc00[_0x51a8('0x2c')],'SmsQueueId':_0x41cc00['id'],'interface':util[_0x51a8('0x5c')](_0x51a8('0x5d'),_0x51a8('0x5e'),_0x44e496['name']),'penalty':0x0,'paused':_0x44e496[_0x51a8('0x59')],'createdAt':_0x44e496['createdAt'],'updatedAt':_0x44e496[_0x51a8('0x5a')]};})};}else{return{'count':0x0,'rows':[]};}})[_0x51a8('0x25')](respondWithFilteredResult(_0x1df9cc,_0x7ac0ae))[_0x51a8('0x44')](handleError(_0x1df9cc,null));};exports[_0x51a8('0x5f')]=function(_0x149a40,_0x3aca4a,_0x895b42){var _0xc751c3={};var _0x3540cd={};var _0x39fcef;var _0x2289d9;return db['SmsQueue']['findOne']({'where':{'id':_0x149a40[_0x51a8('0x46')]['id']}})[_0x51a8('0x25')](handleEntityNotFound(_0x3aca4a,null))[_0x51a8('0x25')](function(_0x226ca4){if(_0x226ca4){_0x39fcef=_0x226ca4;_0x3540cd['model']=_[_0x51a8('0x47')](db['Team'][_0x51a8('0x31')]);_0x3540cd[_0x51a8('0x35')]=_[_0x51a8('0x47')](_0x149a40[_0x51a8('0x35')]);_0x3540cd[_0x51a8('0x3c')]=_[_0x51a8('0x36')](_0x3540cd[_0x51a8('0x34')],_0x3540cd[_0x51a8('0x35')]);_0xc751c3[_0x51a8('0x38')]=_['intersection'](_0x3540cd[_0x51a8('0x34')],qs[_0x51a8('0x37')](_0x149a40[_0x51a8('0x35')][_0x51a8('0x37')]));_0xc751c3['attributes']=_0xc751c3['attributes'][_0x51a8('0x48')]?_0xc751c3['attributes']:_0x3540cd['model'];_0xc751c3['order']=qs[_0x51a8('0x56')](_0x149a40['query']['sort']);_0xc751c3[_0x51a8('0x3b')]=qs[_0x51a8('0x3c')](_[_0x51a8('0x3d')](_0x149a40['query'],_0x3540cd[_0x51a8('0x3c')]));if(_0x149a40[_0x51a8('0x35')][_0x51a8('0x3e')]){_0xc751c3['where']=_[_0x51a8('0x40')](_0xc751c3[_0x51a8('0x3b')],{'$or':_[_0x51a8('0x2f')](_0xc751c3[_0x51a8('0x38')],function(_0xac2108){var _0x30dd7b={};_0x30dd7b[_0xac2108]={'$like':'%'+_0x149a40[_0x51a8('0x35')][_0x51a8('0x3e')]+'%'};return _0x30dd7b;})});}_0xc751c3=_[_0x51a8('0x40')]({},_0xc751c3,_0x149a40['options']);return _0x39fcef[_0x51a8('0x5f')](_0xc751c3);}})[_0x51a8('0x25')](function(_0x4e2c5d){if(_0x4e2c5d){_0x2289d9=_0x4e2c5d[_0x51a8('0x48')];if(!_0x149a40[_0x51a8('0x35')]['hasOwnProperty'](_0x51a8('0x60'))){_0xc751c3[_0x51a8('0x21')]=qs[_0x51a8('0x21')](_0x149a40[_0x51a8('0x35')][_0x51a8('0x21')]);_0xc751c3['offset']=qs[_0x51a8('0x20')](_0x149a40[_0x51a8('0x35')][_0x51a8('0x20')]);}return _0x39fcef[_0x51a8('0x5f')](_0xc751c3);}})['then'](function(_0x3db2b8){if(_0x3db2b8){return _0x3db2b8?{'count':_0x2289d9,'rows':_0x3db2b8}:null;}})[_0x51a8('0x25')](respondWithResult(_0x3aca4a,null))[_0x51a8('0x44')](handleError(_0x3aca4a,null));};exports[_0x51a8('0x61')]=function(_0x6cd464,_0x1f0587,_0xf718e){var _0xd22e7b=_0x6cd464['body'][_0x51a8('0x62')];return db[_0x51a8('0x63')]['findAll']({'where':{'id':_0xd22e7b},'attributes':['id'],'include':[{'model':db[_0x51a8('0x57')],'as':_0x51a8('0x64'),'attributes':['id','name',_0x51a8('0x65'),'voicePause','interface'],'raw':!![]}]})[_0x51a8('0x25')](function(_0xf2325b){if(_0xf2325b){var _0x41e0b9=_['flatMap'](_0xf2325b,function(_0x585d4e){var _0x73ecd7=_0x585d4e['get']({'plain':!![]});return _0x73ecd7[_0x51a8('0x64')];});return db[_0x51a8('0x30')][_0x51a8('0x4a')]({'where':{'id':_0x6cd464[_0x51a8('0x46')]['id']}})[_0x51a8('0x25')](function(_0x28acb8){return db[_0x51a8('0x66')][_0x51a8('0x67')](function(_0x23d98c){return _0x28acb8[_0x51a8('0x61')](_0xd22e7b,{'transaction':_0x23d98c})[_0x51a8('0x25')](function(){return BPromise[_0x51a8('0x68')](_0x41e0b9,function(_0x1b7381){return db[_0x51a8('0x55')][_0x51a8('0x69')]({'where':{'UserId':_0x1b7381['id'],'SmsQueueId':_0x6cd464['params']['id']},'transaction':_0x23d98c});});})['then'](function(){_0x41e0b9[_0x51a8('0x6a')](function(_0x4e25d7){socket['emit']('userSmsQueue:save',{'UserId':_0x4e25d7['id'],'SmsQueueId':_0x28acb8['id']});});});});});}})[_0x51a8('0x25')](respondWithStatusCode(_0x1f0587,null))[_0x51a8('0x44')](handleError(_0x1f0587,null));};exports[_0x51a8('0x6b')]=function(_0x125a28,_0x4d5f37,_0x975b8){return db[_0x51a8('0x63')]['findAll']({'where':{'id':_0x125a28[_0x51a8('0x35')][_0x51a8('0x62')]},'attributes':['id'],'include':[{'model':db['User'],'as':'Agents','attributes':['id'],'raw':!![]}]})[_0x51a8('0x25')](handleEntityNotFound(_0x4d5f37,null))[_0x51a8('0x25')](function(_0x8587b9){var _0x429363=_[_0x51a8('0x2f')](_0x8587b9,'id');var _0x1c7691=[];var _0x4e566a=[];var _0x13dab3=squel[_0x51a8('0x6c')]();_0x13dab3[_0x51a8('0x6d')]('tq.TeamId')[_0x51a8('0x6e')](_0x51a8('0x6f'),'tq')[_0x51a8('0x70')]('user_has_teams','ut',_0x51a8('0x71'))[_0x51a8('0x3b')]('SmsQueueId\x20=\x20?',_0x125a28[_0x51a8('0x46')]['id']);for(var _0x529916=0x0;_0x529916<_0x8587b9[_0x51a8('0x48')];_0x529916+=0x1){let _0x2d4c2b=_0x8587b9[_0x529916];for(var _0xfb059=0x0;_0xfb059<_0x2d4c2b[_0x51a8('0x64')][_0x51a8('0x48')];_0xfb059+=0x1){let _0x700df1=_0x2d4c2b[_0x51a8('0x64')][_0xfb059];var _0x42d0ad=_0x13dab3['clone']();_0x42d0ad[_0x51a8('0x3b')](_0x51a8('0x72'),_0x700df1['id']);_0x4e566a[_0x51a8('0x73')](db[_0x51a8('0x66')][_0x51a8('0x35')](_0x42d0ad['toString'](),{'type':db['sequelize'][_0x51a8('0x74')][_0x51a8('0x75')]})[_0x51a8('0x25')](function(_0x2e354f){if(_0x2e354f[_0x51a8('0x48')]===0x1){return _0x700df1['id'];}else{var _0x54ef0e=_[_0x51a8('0x76')](_['map'](_0x2e354f,_0x51a8('0x77')),function(_0x1a0f3f){return _['includes'](_0x429363,_0x1a0f3f);});if(_0x54ef0e){return _0x700df1['id'];}}}));}}return BPromise[_0x51a8('0x78')](_0x4e566a)['then'](function(_0x3b7e30){_0x1c7691=_(_0x1c7691)[_0x51a8('0x79')](_0x3b7e30)[_0x51a8('0x7a')]()[_0x51a8('0x7b')]();return db[_0x51a8('0x30')]['find']({'where':{'id':_0x125a28[_0x51a8('0x46')]['id']}})[_0x51a8('0x25')](function(_0x5d00c3){return db[_0x51a8('0x66')][_0x51a8('0x67')](function(_0x54e006){return _0x5d00c3['removeTeams'](_0x125a28[_0x51a8('0x35')][_0x51a8('0x62')],{'transaction':_0x54e006})[_0x51a8('0x25')](function(){if(!_['isEmpty'](_0x1c7691)){return _0x5d00c3[_0x51a8('0x7c')](_0x1c7691,{'transaction':_0x54e006});}})[_0x51a8('0x25')](function(){_0x1c7691[_0x51a8('0x6a')](function(_0x11aab9){socket[_0x51a8('0x7d')](_0x51a8('0x7e'),{'UserId':_0x11aab9,'SmsQueueId':_0x5d00c3['id']});});});});});});})[_0x51a8('0x25')](respondWithStatusCode(_0x4d5f37,null))['catch'](handleError(_0x4d5f37,null));};exports[_0x51a8('0x7f')]=function(_0xa5074c,_0xa29735,_0x3f97bd){return db['SmsQueue']['find']({'where':{'id':_0xa5074c[_0x51a8('0x46')]['id']}})[_0x51a8('0x25')](handleEntityNotFound(_0xa29735,null))['then'](function(_0x4ea00f){if(_0x4ea00f){return _0x4ea00f['addAgents'](_0xa5074c[_0x51a8('0x4c')]['ids'],_['omit'](_0xa5074c['body'],[_0x51a8('0x62'),'id'])||{})['spread'](function(_0x2cea3f){for(var _0x2d820c=0x0;_0x2d820c<_0xa5074c['body']['ids'][_0x51a8('0x48')];_0x2d820c+=0x1){socket['emit'](_0x51a8('0x80'),{'UserId':_0xa5074c[_0x51a8('0x4c')]['ids'][_0x2d820c],'SmsQueueId':_0xa5074c[_0x51a8('0x46')]['id']});}return _0x2cea3f;});}})[_0x51a8('0x25')](respondWithResult(_0xa29735,null))['catch'](handleError(_0xa29735,null));};exports[_0x51a8('0x7c')]=function(_0x3bcc82,_0x223bd7,_0x5d2e4f){return db[_0x51a8('0x30')][_0x51a8('0x4a')]({'where':{'id':_0x3bcc82[_0x51a8('0x46')]['id']}})['then'](handleEntityNotFound(_0x223bd7,null))['then'](function(_0x1a64f4){if(_0x1a64f4){return _0x1a64f4[_0x51a8('0x7c')](_0x3bcc82[_0x51a8('0x35')][_0x51a8('0x62')])[_0x51a8('0x25')](function(){if(_[_0x51a8('0x81')](_0x3bcc82[_0x51a8('0x35')][_0x51a8('0x62')])){for(var _0x1482ff=0x0;_0x1482ff<_0x3bcc82[_0x51a8('0x35')][_0x51a8('0x62')][_0x51a8('0x48')];_0x1482ff+=0x1){socket[_0x51a8('0x7d')]('userSmsQueue:remove',{'UserId':Number(_0x3bcc82['query'][_0x51a8('0x62')][_0x1482ff]),'SmsQueueId':Number(_0x3bcc82[_0x51a8('0x46')]['id'])});}}else{socket[_0x51a8('0x7d')](_0x51a8('0x7e'),{'UserId':Number(_0x3bcc82[_0x51a8('0x35')]['ids']),'SmsQueueId':Number(_0x3bcc82['params']['id'])});}});}})[_0x51a8('0x25')](respondWithStatusCode(_0x223bd7,null))[_0x51a8('0x44')](handleError(_0x223bd7,null));};exports['getAgents']=function(_0x682828,_0x2e1d8e,_0x2bb024){var _0x19ffd8={};var _0x121944={};var _0x4ee800;var _0x4df6b7;return db[_0x51a8('0x30')]['findOne']({'where':{'id':_0x682828[_0x51a8('0x46')]['id']}})['then'](handleEntityNotFound(_0x2e1d8e,null))[_0x51a8('0x25')](function(_0xcc76ac){if(_0xcc76ac){_0x4ee800=_0xcc76ac;_0x121944['model']=_[_0x51a8('0x47')](db[_0x51a8('0x57')][_0x51a8('0x31')]);_0x121944[_0x51a8('0x35')]=_['keys'](_0x682828['query']);_0x121944[_0x51a8('0x3c')]=_[_0x51a8('0x36')](_0x121944[_0x51a8('0x34')],_0x121944[_0x51a8('0x35')]);_0x19ffd8['attributes']=_[_0x51a8('0x36')](_0x121944['model'],qs[_0x51a8('0x37')](_0x682828['query'][_0x51a8('0x37')]));_0x19ffd8[_0x51a8('0x38')]=_0x19ffd8[_0x51a8('0x38')][_0x51a8('0x48')]?_0x19ffd8['attributes']:_0x121944[_0x51a8('0x34')];_0x19ffd8['order']=qs[_0x51a8('0x56')](_0x682828[_0x51a8('0x35')][_0x51a8('0x56')]);_0x19ffd8['where']=qs[_0x51a8('0x3c')](_[_0x51a8('0x3d')](_0x682828[_0x51a8('0x35')],_0x121944['filters']));if(_0x682828['query'][_0x51a8('0x3e')]){_0x19ffd8[_0x51a8('0x3b')]=_[_0x51a8('0x40')](_0x19ffd8[_0x51a8('0x3b')],{'$or':_['map'](_0x19ffd8['attributes'],function(_0x46c310){var _0x4f0b3b={};_0x4f0b3b[_0x46c310]={'$like':'%'+_0x682828[_0x51a8('0x35')][_0x51a8('0x3e')]+'%'};return _0x4f0b3b;})});}_0x19ffd8=_[_0x51a8('0x40')]({},_0x19ffd8,_0x682828[_0x51a8('0x49')]);return _0x4ee800[_0x51a8('0x82')](_0x19ffd8);}})[_0x51a8('0x25')](function(_0x2b0888){if(_0x2b0888){_0x4df6b7=_0x2b0888['length'];if(!_0x682828['query']['hasOwnProperty'](_0x51a8('0x60'))){_0x19ffd8[_0x51a8('0x21')]=qs[_0x51a8('0x21')](_0x682828[_0x51a8('0x35')][_0x51a8('0x21')]);_0x19ffd8['offset']=qs[_0x51a8('0x20')](_0x682828['query'][_0x51a8('0x20')]);}return _0x4ee800[_0x51a8('0x82')](_0x19ffd8);}})[_0x51a8('0x25')](function(_0xb9dad5){if(_0xb9dad5){return _0xb9dad5?{'count':_0x4df6b7,'rows':_0xb9dad5}:null;}})['then'](respondWithResult(_0x2e1d8e,null))['catch'](handleError(_0x2e1d8e,null));};
\ No newline at end of file
diff --git a/server/api/smsQueue/smsQueue.events.js b/server/api/smsQueue/smsQueue.events.js
index c9002cc..4e576ca 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 _0x6be1=['hook','exports','events','../../mysqldb','remove','emit','hasOwnProperty'];(function(_0x563dfd,_0x54098b){var _0x3c0fb2=function(_0xad68dd){while(--_0xad68dd){_0x563dfd['push'](_0x563dfd['shift']());}};_0x3c0fb2(++_0x54098b);}(_0x6be1,0x12f));var _0x16be=function(_0x146d7b,_0x211916){_0x146d7b=_0x146d7b-0x0;var _0x3f5017=_0x6be1[_0x146d7b];return _0x3f5017;};'use strict';var EventEmitter=require(_0x16be('0x0'));var SmsQueue=require(_0x16be('0x1'))['db']['SmsQueue'];var SmsQueueEvents=new EventEmitter();SmsQueueEvents['setMaxListeners'](0x0);var events={'afterCreate':'save','afterUpdate':'update','afterDestroy':_0x16be('0x2')};function emitEvent(_0x688136){return function(_0x579ab9,_0x18fafc,_0x8e7a1){SmsQueueEvents[_0x16be('0x3')](_0x688136+':'+_0x579ab9['id'],_0x579ab9);SmsQueueEvents[_0x16be('0x3')](_0x688136,_0x579ab9);_0x8e7a1(null);};}for(var e in events){if(events[_0x16be('0x4')](e)){var event=events[e];SmsQueue[_0x16be('0x5')](e,emitEvent(event));}}module[_0x16be('0x6')]=SmsQueueEvents;
\ No newline at end of file
+var _0x1c5f=['hasOwnProperty','hook','exports','../../mysqldb','SmsQueue','setMaxListeners','save','remove','emit'];(function(_0x321bb2,_0x202794){var _0x9c12ed=function(_0x263dd3){while(--_0x263dd3){_0x321bb2['push'](_0x321bb2['shift']());}};_0x9c12ed(++_0x202794);}(_0x1c5f,0x18f));var _0xf1c5=function(_0x37a93e,_0xf40cc9){_0x37a93e=_0x37a93e-0x0;var _0x5d6c18=_0x1c5f[_0x37a93e];return _0x5d6c18;};'use strict';var EventEmitter=require('events');var SmsQueue=require(_0xf1c5('0x0'))['db'][_0xf1c5('0x1')];var SmsQueueEvents=new EventEmitter();SmsQueueEvents[_0xf1c5('0x2')](0x0);var events={'afterCreate':_0xf1c5('0x3'),'afterUpdate':'update','afterDestroy':_0xf1c5('0x4')};function emitEvent(_0xa229bd){return function(_0x50a3c3,_0x4ab6c0,_0x1e4fb8){SmsQueueEvents[_0xf1c5('0x5')](_0xa229bd+':'+_0x50a3c3['id'],_0x50a3c3);SmsQueueEvents[_0xf1c5('0x5')](_0xa229bd,_0x50a3c3);_0x1e4fb8(null);};}for(var e in events){if(events[_0xf1c5('0x6')](e)){var event=events[e];SmsQueue[_0xf1c5('0x7')](e,emitEvent(event));}}module[_0xf1c5('0x8')]=SmsQueueEvents;
\ No newline at end of file
diff --git a/server/api/smsQueue/smsQueue.model.js b/server/api/smsQueue/smsQueue.model.js
index 23267bb..8242dcd 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 _0x13c2=['lodash','util','api','moment','request-promise','path','rimraf','../../config/environment','./smsQueue.attributes','exports','SmsQueue','sms_queues'];(function(_0x3dd15e,_0x1f0015){var _0x231fd0=function(_0x4f680a){while(--_0x4f680a){_0x3dd15e['push'](_0x3dd15e['shift']());}};_0x231fd0(++_0x1f0015);}(_0x13c2,0x180));var _0x213c=function(_0x24237f,_0x4cf32c){_0x24237f=_0x24237f-0x0;var _0x48298e=_0x13c2[_0x24237f];return _0x48298e;};'use strict';var _=require(_0x213c('0x0'));var util=require(_0x213c('0x1'));var logger=require('../../config/logger')(_0x213c('0x2'));var moment=require(_0x213c('0x3'));var BPromise=require('bluebird');var rp=require(_0x213c('0x4'));var fs=require('fs');var path=require(_0x213c('0x5'));var rimraf=require(_0x213c('0x6'));var config=require(_0x213c('0x7'));var attributes=require(_0x213c('0x8'));module[_0x213c('0x9')]=function(_0x3955c4,_0x3c9d66){return _0x3955c4['define'](_0x213c('0xa'),attributes,{'tableName':_0x213c('0xb'),'paranoid':![],'indexes':[],'timestamps':!![]});};
\ No newline at end of file
+var _0x1b4f=['bluebird','request-promise','rimraf','./smsQueue.attributes','exports','define','SmsQueue','sms_queues','lodash','util','../../config/logger','api','moment'];(function(_0x5a5f06,_0x18fb01){var _0x3e43ae=function(_0x4b73f7){while(--_0x4b73f7){_0x5a5f06['push'](_0x5a5f06['shift']());}};_0x3e43ae(++_0x18fb01);}(_0x1b4f,0xd8));var _0xf1b4=function(_0x2ebcef,_0x21714e){_0x2ebcef=_0x2ebcef-0x0;var _0x5d3d8d=_0x1b4f[_0x2ebcef];return _0x5d3d8d;};'use strict';var _=require(_0xf1b4('0x0'));var util=require(_0xf1b4('0x1'));var logger=require(_0xf1b4('0x2'))(_0xf1b4('0x3'));var moment=require(_0xf1b4('0x4'));var BPromise=require(_0xf1b4('0x5'));var rp=require(_0xf1b4('0x6'));var fs=require('fs');var path=require('path');var rimraf=require(_0xf1b4('0x7'));var config=require('../../config/environment');var attributes=require(_0xf1b4('0x8'));module[_0xf1b4('0x9')]=function(_0x19c337,_0x242430){return _0x19c337[_0xf1b4('0xa')](_0xf1b4('0xb'),attributes,{'tableName':_0xf1b4('0xc'),'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 77cb8b1..bc4b17e 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 _0x13b5=['http','redis','defaults','socket.io-emitter','./smsQueue.socket','register','request','then','info','SmsQueue,\x20%s,\x20%s','request\x20sent','error','message','findAll','options','limit','include','map','attributes','GetSmsQueue','debug','stringify','catch','SmsQueue','where','model','ShowSmsQueue','util','moment','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','client'];(function(_0x39d1bf,_0x52106a){var _0x42fca1=function(_0x267bed){while(--_0x267bed){_0x39d1bf['push'](_0x39d1bf['shift']());}};_0x42fca1(++_0x52106a);}(_0x13b5,0xaf));var _0x513b=function(_0xaa1b3e,_0x47d976){_0xaa1b3e=_0xaa1b3e-0x0;var _0x454d7d=_0x13b5[_0xaa1b3e];return _0x454d7d;};'use strict';var _=require('lodash');var util=require(_0x513b('0x0'));var moment=require(_0x513b('0x1'));var BPromise=require('bluebird');var rs=require('randomstring');var fs=require('fs');var Redis=require(_0x513b('0x2'));var db=require(_0x513b('0x3'))['db'];var utils=require(_0x513b('0x4'));var logger=require(_0x513b('0x5'))(_0x513b('0x6'));var config=require(_0x513b('0x7'));var jayson=require(_0x513b('0x8'));var client=jayson[_0x513b('0x9')][_0x513b('0xa')]({'port':0x232a});config[_0x513b('0xb')]=_[_0x513b('0xc')](config[_0x513b('0xb')],{'host':'localhost','port':0x18eb});var socket=require(_0x513b('0xd'))(new Redis(config[_0x513b('0xb')]));require(_0x513b('0xe'))[_0x513b('0xf')](socket);function respondWithRpcPromise(_0x2aaf86,_0xadce57,_0x4e111e){return new BPromise(function(_0x3d9730,_0x4fb240){return client[_0x513b('0x10')](_0x2aaf86,_0x4e111e)[_0x513b('0x11')](function(_0x4a22c0){logger[_0x513b('0x12')](_0x513b('0x13'),_0xadce57,_0x513b('0x14'));logger['debug']('SmsQueue,\x20%s,\x20%s,\x20%s',_0xadce57,_0x513b('0x14'),JSON['stringify'](_0x4a22c0));if(_0x4a22c0[_0x513b('0x15')]){if(_0x4a22c0[_0x513b('0x15')]['code']===0x1f4){logger[_0x513b('0x15')](_0x513b('0x13'),_0xadce57,_0x4a22c0[_0x513b('0x15')][_0x513b('0x16')]);return _0x4fb240(_0x4a22c0['error']['message']);}logger['error']('SmsQueue,\x20%s,\x20%s',_0xadce57,_0x4a22c0[_0x513b('0x15')][_0x513b('0x16')]);return _0x3d9730(_0x4a22c0['error']['message']);}else{logger[_0x513b('0x12')]('SmsQueue,\x20%s,\x20%s',_0xadce57,_0x513b('0x14'));_0x3d9730(_0x4a22c0['result'][_0x513b('0x16')]);}})['catch'](function(_0x256af3){logger[_0x513b('0x15')](_0x513b('0x13'),_0xadce57,_0x256af3);_0x4fb240(_0x256af3);});});}exports['GetSmsQueue']=function(_0x3d810a){var _0x5c384a=this;return new Promise(function(_0x35cce9,_0xafe512){return db['SmsQueue'][_0x513b('0x17')]({'raw':_0x3d810a['options']?_0x3d810a[_0x513b('0x18')]['raw']===undefined?!![]:![]:!![],'where':_0x3d810a[_0x513b('0x18')]?_0x3d810a[_0x513b('0x18')]['where']||null:null,'attributes':_0x3d810a[_0x513b('0x18')]?_0x3d810a[_0x513b('0x18')]['attributes']||null:null,'limit':_0x3d810a[_0x513b('0x18')]?_0x3d810a['options'][_0x513b('0x19')]||null:null,'include':_0x3d810a['options']?_0x3d810a[_0x513b('0x18')][_0x513b('0x1a')]?_[_0x513b('0x1b')](_0x3d810a[_0x513b('0x18')][_0x513b('0x1a')],function(_0x22d2cb){return{'model':db[_0x22d2cb['model']],'as':_0x22d2cb['as'],'attributes':_0x22d2cb[_0x513b('0x1c')],'include':_0x22d2cb[_0x513b('0x1a')]?_['map'](_0x22d2cb[_0x513b('0x1a')],function(_0x456ee0){return{'model':db[_0x456ee0['model']],'as':_0x456ee0['as'],'attributes':_0x456ee0[_0x513b('0x1c')],'include':_0x456ee0[_0x513b('0x1a')]?_[_0x513b('0x1b')](_0x456ee0[_0x513b('0x1a')],function(_0x4a1afa){return{'model':db[_0x4a1afa['model']],'as':_0x4a1afa['as'],'attributes':_0x4a1afa['attributes']};}):[]};}):[]};}):[]:[]})[_0x513b('0x11')](function(_0x5e6385){logger[_0x513b('0x12')](_0x513b('0x1d'),_0x3d810a);logger[_0x513b('0x1e')](_0x513b('0x1d'),_0x3d810a,JSON[_0x513b('0x1f')](_0x5e6385));_0x35cce9(_0x5e6385);})[_0x513b('0x20')](function(_0x1f6d2d){logger['error'](_0x513b('0x1d'),_0x1f6d2d[_0x513b('0x16')],_0x3d810a);_0xafe512(_0x5c384a[_0x513b('0x15')](0x1f4,_0x1f6d2d[_0x513b('0x16')]));});});};exports['ShowSmsQueue']=function(_0x22b23c){var _0x22d870=this;return new Promise(function(_0x286d9b,_0x225136){return db[_0x513b('0x21')]['find']({'raw':_0x22b23c[_0x513b('0x18')]?_0x22b23c['options']['raw']===undefined?!![]:![]:!![],'where':_0x22b23c['options']?_0x22b23c[_0x513b('0x18')][_0x513b('0x22')]||null:null,'attributes':_0x22b23c['options']?_0x22b23c[_0x513b('0x18')][_0x513b('0x1c')]||null:null,'include':_0x22b23c[_0x513b('0x18')]?_0x22b23c['options'][_0x513b('0x1a')]?_['map'](_0x22b23c[_0x513b('0x18')]['include'],function(_0x40c560){return{'model':db[_0x40c560[_0x513b('0x23')]],'as':_0x40c560['as'],'attributes':_0x40c560[_0x513b('0x1c')],'include':_0x40c560[_0x513b('0x1a')]?_['map'](_0x40c560[_0x513b('0x1a')],function(_0x48cf22){return{'model':db[_0x48cf22[_0x513b('0x23')]],'as':_0x48cf22['as'],'attributes':_0x48cf22[_0x513b('0x1c')],'include':_0x48cf22[_0x513b('0x1a')]?_[_0x513b('0x1b')](_0x48cf22[_0x513b('0x1a')],function(_0x227c87){return{'model':db[_0x227c87[_0x513b('0x23')]],'as':_0x227c87['as'],'attributes':_0x227c87[_0x513b('0x1c')]};}):[]};}):[]};}):[]:[]})[_0x513b('0x11')](function(_0x1d4911){logger[_0x513b('0x12')](_0x513b('0x24'),_0x22b23c);logger['debug'](_0x513b('0x24'),_0x22b23c,JSON[_0x513b('0x1f')](_0x1d4911));_0x286d9b(_0x1d4911);})[_0x513b('0x20')](function(_0x45322e){logger['error'](_0x513b('0x24'),_0x45322e['message'],_0x22b23c);_0x225136(_0x22d870[_0x513b('0x15')](0x1f4,_0x45322e[_0x513b('0x16')]));});});};
\ No newline at end of file
+var _0xb939=['stringify','error','message','SmsQueue,\x20%s,\x20%s','result','catch','SmsQueue','findAll','options','raw','where','attributes','limit','include','map','model','GetSmsQueue','ShowSmsQueue','lodash','util','moment','bluebird','randomstring','ioredis','../../config/utils','rpc','../../config/environment','jayson/promise','redis','localhost','socket.io-emitter','register','request','then','info','request\x20sent','debug'];(function(_0x48cc05,_0x99c831){var _0x5aa91f=function(_0x64b452){while(--_0x64b452){_0x48cc05['push'](_0x48cc05['shift']());}};_0x5aa91f(++_0x99c831);}(_0xb939,0x15f));var _0x9b93=function(_0x5e386a,_0xa6d3a2){_0x5e386a=_0x5e386a-0x0;var _0x253e1a=_0xb939[_0x5e386a];return _0x253e1a;};'use strict';var _=require(_0x9b93('0x0'));var util=require(_0x9b93('0x1'));var moment=require(_0x9b93('0x2'));var BPromise=require(_0x9b93('0x3'));var rs=require(_0x9b93('0x4'));var fs=require('fs');var Redis=require(_0x9b93('0x5'));var db=require('../../mysqldb')['db'];var utils=require(_0x9b93('0x6'));var logger=require('../../config/logger')(_0x9b93('0x7'));var config=require(_0x9b93('0x8'));var jayson=require(_0x9b93('0x9'));var client=jayson['client']['http']({'port':0x232a});config[_0x9b93('0xa')]=_['defaults'](config[_0x9b93('0xa')],{'host':_0x9b93('0xb'),'port':0x18eb});var socket=require(_0x9b93('0xc'))(new Redis(config[_0x9b93('0xa')]));require('./smsQueue.socket')[_0x9b93('0xd')](socket);function respondWithRpcPromise(_0x31f5c4,_0x9c486e,_0x1da0d6){return new BPromise(function(_0x9609fa,_0x17185f){return client[_0x9b93('0xe')](_0x31f5c4,_0x1da0d6)[_0x9b93('0xf')](function(_0x39dbf4){logger[_0x9b93('0x10')]('SmsQueue,\x20%s,\x20%s',_0x9c486e,_0x9b93('0x11'));logger[_0x9b93('0x12')]('SmsQueue,\x20%s,\x20%s,\x20%s',_0x9c486e,_0x9b93('0x11'),JSON[_0x9b93('0x13')](_0x39dbf4));if(_0x39dbf4[_0x9b93('0x14')]){if(_0x39dbf4['error']['code']===0x1f4){logger[_0x9b93('0x14')]('SmsQueue,\x20%s,\x20%s',_0x9c486e,_0x39dbf4[_0x9b93('0x14')][_0x9b93('0x15')]);return _0x17185f(_0x39dbf4[_0x9b93('0x14')][_0x9b93('0x15')]);}logger['error']('SmsQueue,\x20%s,\x20%s',_0x9c486e,_0x39dbf4['error'][_0x9b93('0x15')]);return _0x9609fa(_0x39dbf4[_0x9b93('0x14')][_0x9b93('0x15')]);}else{logger[_0x9b93('0x10')](_0x9b93('0x16'),_0x9c486e,_0x9b93('0x11'));_0x9609fa(_0x39dbf4[_0x9b93('0x17')][_0x9b93('0x15')]);}})[_0x9b93('0x18')](function(_0x5b9f63){logger[_0x9b93('0x14')](_0x9b93('0x16'),_0x9c486e,_0x5b9f63);_0x17185f(_0x5b9f63);});});}exports['GetSmsQueue']=function(_0x380eeb){var _0x57ce8f=this;return new Promise(function(_0x1340fb,_0xb6d522){return db[_0x9b93('0x19')][_0x9b93('0x1a')]({'raw':_0x380eeb[_0x9b93('0x1b')]?_0x380eeb['options'][_0x9b93('0x1c')]===undefined?!![]:![]:!![],'where':_0x380eeb[_0x9b93('0x1b')]?_0x380eeb['options'][_0x9b93('0x1d')]||null:null,'attributes':_0x380eeb[_0x9b93('0x1b')]?_0x380eeb[_0x9b93('0x1b')][_0x9b93('0x1e')]||null:null,'limit':_0x380eeb['options']?_0x380eeb[_0x9b93('0x1b')][_0x9b93('0x1f')]||null:null,'include':_0x380eeb[_0x9b93('0x1b')]?_0x380eeb[_0x9b93('0x1b')][_0x9b93('0x20')]?_[_0x9b93('0x21')](_0x380eeb[_0x9b93('0x1b')][_0x9b93('0x20')],function(_0x120d5a){return{'model':db[_0x120d5a[_0x9b93('0x22')]],'as':_0x120d5a['as'],'attributes':_0x120d5a['attributes'],'include':_0x120d5a[_0x9b93('0x20')]?_['map'](_0x120d5a[_0x9b93('0x20')],function(_0x54913f){return{'model':db[_0x54913f[_0x9b93('0x22')]],'as':_0x54913f['as'],'attributes':_0x54913f[_0x9b93('0x1e')],'include':_0x54913f['include']?_[_0x9b93('0x21')](_0x54913f[_0x9b93('0x20')],function(_0x4a36e5){return{'model':db[_0x4a36e5['model']],'as':_0x4a36e5['as'],'attributes':_0x4a36e5[_0x9b93('0x1e')]};}):[]};}):[]};}):[]:[]})[_0x9b93('0xf')](function(_0x2adfe5){logger[_0x9b93('0x10')](_0x9b93('0x23'),_0x380eeb);logger[_0x9b93('0x12')](_0x9b93('0x23'),_0x380eeb,JSON[_0x9b93('0x13')](_0x2adfe5));_0x1340fb(_0x2adfe5);})[_0x9b93('0x18')](function(_0x34b554){logger['error']('GetSmsQueue',_0x34b554[_0x9b93('0x15')],_0x380eeb);_0xb6d522(_0x57ce8f[_0x9b93('0x14')](0x1f4,_0x34b554[_0x9b93('0x15')]));});});};exports[_0x9b93('0x24')]=function(_0x583687){var _0x40b2cc=this;return new Promise(function(_0x75bc0f,_0x536d79){return db[_0x9b93('0x19')]['find']({'raw':_0x583687[_0x9b93('0x1b')]?_0x583687[_0x9b93('0x1b')][_0x9b93('0x1c')]===undefined?!![]:![]:!![],'where':_0x583687[_0x9b93('0x1b')]?_0x583687[_0x9b93('0x1b')][_0x9b93('0x1d')]||null:null,'attributes':_0x583687[_0x9b93('0x1b')]?_0x583687[_0x9b93('0x1b')][_0x9b93('0x1e')]||null:null,'include':_0x583687[_0x9b93('0x1b')]?_0x583687[_0x9b93('0x1b')]['include']?_[_0x9b93('0x21')](_0x583687['options'][_0x9b93('0x20')],function(_0x28a3a7){return{'model':db[_0x28a3a7[_0x9b93('0x22')]],'as':_0x28a3a7['as'],'attributes':_0x28a3a7['attributes'],'include':_0x28a3a7['include']?_[_0x9b93('0x21')](_0x28a3a7[_0x9b93('0x20')],function(_0x412404){return{'model':db[_0x412404[_0x9b93('0x22')]],'as':_0x412404['as'],'attributes':_0x412404['attributes'],'include':_0x412404[_0x9b93('0x20')]?_[_0x9b93('0x21')](_0x412404[_0x9b93('0x20')],function(_0x1e3b7d){return{'model':db[_0x1e3b7d['model']],'as':_0x1e3b7d['as'],'attributes':_0x1e3b7d[_0x9b93('0x1e')]};}):[]};}):[]};}):[]:[]})['then'](function(_0x34f046){logger[_0x9b93('0x10')](_0x9b93('0x24'),_0x583687);logger[_0x9b93('0x12')]('ShowSmsQueue',_0x583687,JSON['stringify'](_0x34f046));_0x75bc0f(_0x34f046);})[_0x9b93('0x18')](function(_0x12a654){logger['error'](_0x9b93('0x24'),_0x12a654[_0x9b93('0x15')],_0x583687);_0x536d79(_0x40b2cc['error'](0x1f4,_0x12a654[_0x9b93('0x15')]));});});};
\ No newline at end of file
diff --git a/server/api/smsQueue/smsQueue.socket.js b/server/api/smsQueue/smsQueue.socket.js
index df57f5e..9fa721b 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 _0x80ee=['remove','update','emit','removeListener','register','./smsQueue.events','save'];(function(_0x12f688,_0x585c25){var _0x59c3de=function(_0x4ac301){while(--_0x4ac301){_0x12f688['push'](_0x12f688['shift']());}};_0x59c3de(++_0x585c25);}(_0x80ee,0x108));var _0xe80e=function(_0x36f37b,_0x36ea03){_0x36f37b=_0x36f37b-0x0;var _0x249634=_0x80ee[_0x36f37b];return _0x249634;};'use strict';var SmsQueueEvents=require(_0xe80e('0x0'));var events=[_0xe80e('0x1'),_0xe80e('0x2'),_0xe80e('0x3')];function createListener(_0x488cc5,_0x5c012c){return function(_0x46ec2f){_0x5c012c[_0xe80e('0x4')](_0x488cc5,_0x46ec2f);};}function removeListener(_0x41baf7,_0x4c8329){return function(){SmsQueueEvents[_0xe80e('0x5')](_0x41baf7,_0x4c8329);};}exports[_0xe80e('0x6')]=function(_0xac7adb){for(var _0x47900c=0x0,_0x14686f=events['length'];_0x47900c<_0x14686f;_0x47900c++){var _0x1a3ca6=events[_0x47900c];var _0x4f5179=createListener('smsQueue:'+_0x1a3ca6,_0xac7adb);SmsQueueEvents['on'](_0x1a3ca6,_0x4f5179);}};
\ No newline at end of file
+var _0xdff9=['remove','update','emit','length','smsQueue:','./smsQueue.events','save'];(function(_0x53a81e,_0x2d7c3d){var _0x4a7dd4=function(_0xd69b49){while(--_0xd69b49){_0x53a81e['push'](_0x53a81e['shift']());}};_0x4a7dd4(++_0x2d7c3d);}(_0xdff9,0x1be));var _0x9dff=function(_0x125134,_0x42ce88){_0x125134=_0x125134-0x0;var _0xde3491=_0xdff9[_0x125134];return _0xde3491;};'use strict';var SmsQueueEvents=require(_0x9dff('0x0'));var events=[_0x9dff('0x1'),_0x9dff('0x2'),_0x9dff('0x3')];function createListener(_0x2bd684,_0x2a9981){return function(_0x5aaa76){_0x2a9981[_0x9dff('0x4')](_0x2bd684,_0x5aaa76);};}function removeListener(_0x446ec8,_0x3bfe7e){return function(){SmsQueueEvents['removeListener'](_0x446ec8,_0x3bfe7e);};}exports['register']=function(_0x46ac3d){for(var _0xad1e4d=0x0,_0xee67cb=events[_0x9dff('0x5')];_0xad1e4d<_0xee67cb;_0xad1e4d++){var _0x52f42e=events[_0xad1e4d];var _0x4b03f9=createListener(_0x9dff('0x6')+_0x52f42e,_0x46ac3d);SmsQueueEvents['on'](_0x52f42e,_0x4b03f9);}};
\ No newline at end of file
diff --git a/server/api/smsQueueReport/index.js b/server/api/smsQueueReport/index.js
index 3e05af2..f0489a5 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 _0xf05e=['../../components/interaction/service','get','isAuthenticated','index','/describe','describe','show','post','create','put','update','delete','/:id','destroy','exports','multer','util','connect-timeout','../../components/auth/service'];(function(_0x810e4d,_0x909ef4){var _0x13f01c=function(_0x12fd89){while(--_0x12fd89){_0x810e4d['push'](_0x810e4d['shift']());}};_0x13f01c(++_0x909ef4);}(_0xf05e,0x6e));var _0xef05=function(_0x11ddae,_0x4b8ae4){_0x11ddae=_0x11ddae-0x0;var _0x437c1a=_0xf05e[_0x11ddae];return _0x437c1a;};'use strict';var multer=require(_0xef05('0x0'));var util=require(_0xef05('0x1'));var path=require('path');var timeout=require(_0xef05('0x2'));var express=require('express');var router=express['Router']();var auth=require(_0xef05('0x3'));var interaction=require(_0xef05('0x4'));var config=require('../../config/environment');var controller=require('./smsQueueReport.controller');router[_0xef05('0x5')]('/',auth[_0xef05('0x6')](),controller[_0xef05('0x7')]);router[_0xef05('0x5')](_0xef05('0x8'),auth['isAuthenticated'](),controller[_0xef05('0x9')]);router[_0xef05('0x5')]('/:id',auth[_0xef05('0x6')](),controller[_0xef05('0xa')]);router[_0xef05('0xb')]('/',auth['isAuthenticated'](),controller[_0xef05('0xc')]);router[_0xef05('0xd')]('/:id',auth[_0xef05('0x6')](),controller[_0xef05('0xe')]);router[_0xef05('0xf')](_0xef05('0x10'),auth[_0xef05('0x6')](),controller[_0xef05('0x11')]);module[_0xef05('0x12')]=router;
\ No newline at end of file
+var _0x6660=['show','create','put','update','delete','destroy','exports','multer','util','path','connect-timeout','express','../../components/interaction/service','../../config/environment','./smsQueueReport.controller','get','isAuthenticated','index','/describe','describe','/:id'];(function(_0x3a34c8,_0x543716){var _0x5ecd80=function(_0x266a9c){while(--_0x266a9c){_0x3a34c8['push'](_0x3a34c8['shift']());}};_0x5ecd80(++_0x543716);}(_0x6660,0xaf));var _0x0666=function(_0x36333f,_0x17bd3a){_0x36333f=_0x36333f-0x0;var _0x51e163=_0x6660[_0x36333f];return _0x51e163;};'use strict';var multer=require(_0x0666('0x0'));var util=require(_0x0666('0x1'));var path=require(_0x0666('0x2'));var timeout=require(_0x0666('0x3'));var express=require(_0x0666('0x4'));var router=express['Router']();var auth=require('../../components/auth/service');var interaction=require(_0x0666('0x5'));var config=require(_0x0666('0x6'));var controller=require(_0x0666('0x7'));router[_0x0666('0x8')]('/',auth[_0x0666('0x9')](),controller[_0x0666('0xa')]);router[_0x0666('0x8')](_0x0666('0xb'),auth[_0x0666('0x9')](),controller[_0x0666('0xc')]);router[_0x0666('0x8')](_0x0666('0xd'),auth[_0x0666('0x9')](),controller[_0x0666('0xe')]);router['post']('/',auth['isAuthenticated'](),controller[_0x0666('0xf')]);router[_0x0666('0x10')]('/:id',auth[_0x0666('0x9')](),controller[_0x0666('0x11')]);router[_0x0666('0x12')]('/:id',auth[_0x0666('0x9')](),controller[_0x0666('0x13')]);module[_0x0666('0x14')]=router;
\ No newline at end of file
diff --git a/server/api/smsQueueReport/smsQueueReport.attributes.js b/server/api/smsQueueReport/smsQueueReport.attributes.js
index 7e86ce7..0c66c09 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 _0x00df=['moment','sequelize','exports','STRING','DATE'];(function(_0x4ec866,_0x32f1bc){var _0x5c25eb=function(_0x31e7a8){while(--_0x31e7a8){_0x4ec866['push'](_0x4ec866['shift']());}};_0x5c25eb(++_0x32f1bc);}(_0x00df,0xa0));var _0xf00d=function(_0x4e3663,_0x29156e){_0x4e3663=_0x4e3663-0x0;var _0x182db9=_0x00df[_0x4e3663];return _0x182db9;};'use strict';var moment=require(_0xf00d('0x0'));var Sequelize=require(_0xf00d('0x1'));module[_0xf00d('0x2')]={'uniqueid':{'type':Sequelize[_0xf00d('0x3')],'allowNull':![]},'from':{'type':Sequelize[_0xf00d('0x3')]},'joinAt':{'type':Sequelize[_0xf00d('0x4')]},'leaveAt':{'type':Sequelize[_0xf00d('0x4')]},'acceptAt':{'type':Sequelize['DATE']},'exitAt':{'type':Sequelize[_0xf00d('0x4')]},'reason':{'type':Sequelize[_0xf00d('0x3')]}};
\ No newline at end of file
+var _0x5a54=['moment','exports','STRING','DATE'];(function(_0x3d3ea9,_0x2c4750){var _0xa875e8=function(_0x36b29c){while(--_0x36b29c){_0x3d3ea9['push'](_0x3d3ea9['shift']());}};_0xa875e8(++_0x2c4750);}(_0x5a54,0xb8));var _0x45a5=function(_0x5f4c9c,_0x1550df){_0x5f4c9c=_0x5f4c9c-0x0;var _0x3de71b=_0x5a54[_0x5f4c9c];return _0x3de71b;};'use strict';var moment=require(_0x45a5('0x0'));var Sequelize=require('sequelize');module[_0x45a5('0x1')]={'uniqueid':{'type':Sequelize[_0x45a5('0x2')],'allowNull':![]},'from':{'type':Sequelize[_0x45a5('0x2')]},'joinAt':{'type':Sequelize['DATE']},'leaveAt':{'type':Sequelize['DATE']},'acceptAt':{'type':Sequelize[_0x45a5('0x3')]},'exitAt':{'type':Sequelize[_0x45a5('0x3')]},'reason':{'type':Sequelize[_0x45a5('0x2')]}};
\ No newline at end of file
diff --git a/server/api/smsQueueReport/smsQueueReport.controller.js b/server/api/smsQueueReport/smsQueueReport.controller.js
index d941b47..a0f36fa 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 _0x29fa=['params','keys','create','body','catch','find','describe','html-pdf','rimraf','fast-json-patch','moment','mustache','sox','to-csv','lodash','jsforce','querystring','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/logger','api','../../config/utils','sendStatus','status','end','json','count','offset','set','Content-Range','apply','reject','save','update','destroy','then','error','stack','name','send','index','map','SmsQueueReport','fieldName','key','model','query','filters','attributes','intersection','fields','length','hasOwnProperty','nolimit','limit','order','sort','pick','where','type','VIRTUAL','merge','options','includeAll','include','findAll','rows','show'];(function(_0x5000a8,_0x5a27e2){var _0x25fbed=function(_0x293f85){while(--_0x293f85){_0x5000a8['push'](_0x5000a8['shift']());}};_0x25fbed(++_0x5a27e2);}(_0x29fa,0x91));var _0xa29f=function(_0x5951e8,_0x42b9a7){_0x5951e8=_0x5951e8-0x0;var _0x20a1f5=_0x29fa[_0x5951e8];return _0x20a1f5;};'use strict';var pdf=require(_0xa29f('0x0'));var emlformat=require('eml-format');var rimraf=require(_0xa29f('0x1'));var zipdir=require('zip-dir');var jsonpatch=require(_0xa29f('0x2'));var rp=require('request-promise');var moment=require(_0xa29f('0x3'));var BPromise=require('bluebird');var Mustache=require(_0xa29f('0x4'));var util=require('util');var path=require('path');var sox=require(_0xa29f('0x5'));var csv=require(_0xa29f('0x6'));var ejs=require('ejs');var fs=require('fs');var _=require(_0xa29f('0x7'));var squel=require('squel');var crypto=require('crypto');var jsforce=require(_0xa29f('0x8'));var deskjs=require('desk.js');var toCsv=require(_0xa29f('0x6'));var querystring=require(_0xa29f('0x9'));var Papa=require('papaparse');var Redis=require('ioredis');var authService=require(_0xa29f('0xa'));var qs=require(_0xa29f('0xb'));var as=require(_0xa29f('0xc'));var hardwareService=require('../../config/license/hardware');var logger=require(_0xa29f('0xd'))(_0xa29f('0xe'));var utils=require(_0xa29f('0xf'));var config=require('../../config/environment');var db=require('../../mysqldb')['db'];function respondWithStatusCode(_0xbccd44,_0x58a281){_0x58a281=_0x58a281||0xcc;return function(_0x56415e){if(_0x56415e){return _0xbccd44[_0xa29f('0x10')](_0x58a281);}return _0xbccd44[_0xa29f('0x11')](_0x58a281)[_0xa29f('0x12')]();};}function respondWithResult(_0x27d3cc,_0x1e27a6){_0x1e27a6=_0x1e27a6||0xc8;return function(_0x2045d6){if(_0x2045d6){return _0x27d3cc['status'](_0x1e27a6)[_0xa29f('0x13')](_0x2045d6);}};}function respondWithFilteredResult(_0x247660,_0x242551){return function(_0x2c301b){if(_0x2c301b){var _0x290487=_0x2c301b[_0xa29f('0x14')],_0x30d385=_0x242551[_0xa29f('0x15')],_0x285cf7=_0x242551['offset']+_0x242551['limit'],_0x32c233;if(_0x285cf7>=_0x290487){_0x285cf7=_0x290487;_0x32c233=0xc8;}else{_0x32c233=0xce;}_0x247660['status'](_0x32c233);return _0x247660[_0xa29f('0x16')](_0xa29f('0x17'),_0x30d385+'-'+_0x285cf7+'/'+_0x290487)[_0xa29f('0x13')](_0x2c301b);}return null;};}function patchUpdates(_0x35794c){return function(_0x150b5d){try{jsonpatch[_0xa29f('0x18')](_0x150b5d,_0x35794c,!![]);}catch(_0x5cac64){return BPromise[_0xa29f('0x19')](_0x5cac64);}return _0x150b5d[_0xa29f('0x1a')]();};}function saveUpdates(_0x469ae0,_0x4983c3){return function(_0x5e7aa5){if(_0x5e7aa5){return _0x5e7aa5[_0xa29f('0x1b')](_0x469ae0)['then'](function(_0x585d8d){return _0x585d8d;});}return null;};}function removeEntity(_0x1c1e52,_0x16c5bf){return function(_0x4d65f){if(_0x4d65f){return _0x4d65f[_0xa29f('0x1c')]()[_0xa29f('0x1d')](function(){_0x1c1e52[_0xa29f('0x11')](0xcc)[_0xa29f('0x12')]();});}};}function handleEntityNotFound(_0x2e8283,_0x4803c2){return function(_0x329328){if(!_0x329328){_0x2e8283[_0xa29f('0x10')](0x194);}return _0x329328;};}function handleError(_0x537357,_0x462c0c){_0x462c0c=_0x462c0c||0x1f4;return function(_0x378cf1){logger[_0xa29f('0x1e')](_0x378cf1[_0xa29f('0x1f')]);if(_0x378cf1[_0xa29f('0x20')]){delete _0x378cf1[_0xa29f('0x20')];}_0x537357['status'](_0x462c0c)[_0xa29f('0x21')](_0x378cf1);};}exports[_0xa29f('0x22')]=function(_0x1bc73c,_0x25e1e4){var _0x4984c4={},_0x3d0230={},_0x1318a8={'count':0x0,'rows':[]};var _0x37748d=_[_0xa29f('0x23')](db[_0xa29f('0x24')]['rawAttributes'],function(_0x3fbcec){return{'name':_0x3fbcec[_0xa29f('0x25')],'type':_0x3fbcec['type'][_0xa29f('0x26')]};});_0x3d0230[_0xa29f('0x27')]=_['map'](_0x37748d,'name');_0x3d0230['query']=_['keys'](_0x1bc73c[_0xa29f('0x28')]);_0x3d0230[_0xa29f('0x29')]=_['intersection'](_0x3d0230[_0xa29f('0x27')],_0x3d0230[_0xa29f('0x28')]);_0x4984c4[_0xa29f('0x2a')]=_[_0xa29f('0x2b')](_0x3d0230['model'],qs['fields'](_0x1bc73c[_0xa29f('0x28')][_0xa29f('0x2c')]));_0x4984c4[_0xa29f('0x2a')]=_0x4984c4[_0xa29f('0x2a')][_0xa29f('0x2d')]?_0x4984c4[_0xa29f('0x2a')]:_0x3d0230[_0xa29f('0x27')];if(!_0x1bc73c[_0xa29f('0x28')][_0xa29f('0x2e')](_0xa29f('0x2f'))){_0x4984c4[_0xa29f('0x30')]=qs[_0xa29f('0x30')](_0x1bc73c['query'][_0xa29f('0x30')]);_0x4984c4['offset']=qs[_0xa29f('0x15')](_0x1bc73c[_0xa29f('0x28')]['offset']);}_0x4984c4[_0xa29f('0x31')]=qs['sort'](_0x1bc73c[_0xa29f('0x28')][_0xa29f('0x32')]);_0x4984c4['where']=qs['filters'](_[_0xa29f('0x33')](_0x1bc73c[_0xa29f('0x28')],_0x3d0230['filters']));if(_0x1bc73c['query']['filter']){_0x4984c4[_0xa29f('0x34')]=_['merge'](_0x4984c4[_0xa29f('0x34')],{'$or':_['map'](_0x37748d,function(_0x6ba36f){if(_0x6ba36f[_0xa29f('0x35')]!==_0xa29f('0x36')){var _0x21c5d0={};_0x21c5d0[_0x6ba36f[_0xa29f('0x20')]]={'$like':'%'+_0x1bc73c[_0xa29f('0x28')]['filter']+'%'};return _0x21c5d0;}})});}_0x4984c4=_[_0xa29f('0x37')]({},_0x4984c4,_0x1bc73c[_0xa29f('0x38')]);var _0xf66ae9={'where':_0x4984c4[_0xa29f('0x34')]};return db[_0xa29f('0x24')][_0xa29f('0x14')](_0xf66ae9)[_0xa29f('0x1d')](function(_0x25ffd7){_0x1318a8[_0xa29f('0x14')]=_0x25ffd7;if(_0x1bc73c['query'][_0xa29f('0x39')]){_0x4984c4[_0xa29f('0x3a')]=[{'all':!![]}];}return db['SmsQueueReport'][_0xa29f('0x3b')](_0x4984c4);})['then'](function(_0x47d0d0){_0x1318a8[_0xa29f('0x3c')]=_0x47d0d0;return _0x1318a8;})['then'](respondWithFilteredResult(_0x25e1e4,_0x4984c4))['catch'](handleError(_0x25e1e4,null));};exports[_0xa29f('0x3d')]=function(_0xf0b325,_0x47ecbc){var _0x2bd232={'raw':!![],'where':{'id':_0xf0b325[_0xa29f('0x3e')]['id']}},_0x193fbd={};_0x193fbd[_0xa29f('0x27')]=_[_0xa29f('0x3f')](db[_0xa29f('0x24')]['rawAttributes']);_0x193fbd['query']=_[_0xa29f('0x3f')](_0xf0b325[_0xa29f('0x28')]);_0x193fbd[_0xa29f('0x29')]=_[_0xa29f('0x2b')](_0x193fbd[_0xa29f('0x27')],_0x193fbd[_0xa29f('0x28')]);_0x2bd232[_0xa29f('0x2a')]=_['intersection'](_0x193fbd['model'],qs['fields'](_0xf0b325[_0xa29f('0x28')]['fields']));_0x2bd232[_0xa29f('0x2a')]=_0x2bd232[_0xa29f('0x2a')][_0xa29f('0x2d')]?_0x2bd232[_0xa29f('0x2a')]:_0x193fbd[_0xa29f('0x27')];if(_0xf0b325[_0xa29f('0x28')][_0xa29f('0x39')]){_0x2bd232[_0xa29f('0x3a')]=[{'all':!![]}];}_0x2bd232=_[_0xa29f('0x37')]({},_0x2bd232,_0xf0b325[_0xa29f('0x38')]);return db[_0xa29f('0x24')]['find'](_0x2bd232)[_0xa29f('0x1d')](handleEntityNotFound(_0x47ecbc,null))[_0xa29f('0x1d')](respondWithResult(_0x47ecbc,null))['catch'](handleError(_0x47ecbc,null));};exports[_0xa29f('0x40')]=function(_0x58bc5a,_0x2ec715){return db[_0xa29f('0x24')][_0xa29f('0x40')](_0x58bc5a[_0xa29f('0x41')],{})[_0xa29f('0x1d')](respondWithResult(_0x2ec715,0xc9))[_0xa29f('0x42')](handleError(_0x2ec715,null));};exports[_0xa29f('0x1b')]=function(_0x11c77a,_0x318cd6){if(_0x11c77a[_0xa29f('0x41')]['id']){delete _0x11c77a[_0xa29f('0x41')]['id'];}return db['SmsQueueReport'][_0xa29f('0x43')]({'where':{'id':_0x11c77a[_0xa29f('0x3e')]['id']}})[_0xa29f('0x1d')](handleEntityNotFound(_0x318cd6,null))[_0xa29f('0x1d')](saveUpdates(_0x11c77a[_0xa29f('0x41')],null))[_0xa29f('0x1d')](respondWithResult(_0x318cd6,null))[_0xa29f('0x42')](handleError(_0x318cd6,null));};exports[_0xa29f('0x1c')]=function(_0x52e53f,_0x5b65ea){return db[_0xa29f('0x24')][_0xa29f('0x43')]({'where':{'id':_0x52e53f[_0xa29f('0x3e')]['id']}})[_0xa29f('0x1d')](handleEntityNotFound(_0x5b65ea,null))[_0xa29f('0x1d')](removeEntity(_0x5b65ea,null))['catch'](handleError(_0x5b65ea,null));};exports[_0xa29f('0x44')]=function(_0xc8d794,_0x30d0db){return db[_0xa29f('0x24')]['describe']()[_0xa29f('0x1d')](respondWithResult(_0x30d0db,null))[_0xa29f('0x42')](handleError(_0x30d0db,null));};
\ No newline at end of file
+var _0xb638=['../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/environment','../../mysqldb','sendStatus','status','json','count','offset','Content-Range','apply','reject','save','update','then','destroy','end','error','name','send','index','map','SmsQueueReport','rawAttributes','fieldName','type','model','query','keys','filters','intersection','fields','attributes','length','hasOwnProperty','limit','order','sort','where','pick','filter','VIRTUAL','merge','options','include','findAll','rows','catch','show','params','find','create','body','describe','html-pdf','eml-format','rimraf','request-promise','moment','util','path','sox','to-csv','ejs','lodash','crypto','jsforce','querystring','ioredis','../../components/auth/service','../../components/parsers/qs'];(function(_0x4388ee,_0x3d7dda){var _0x54fb43=function(_0x470704){while(--_0x470704){_0x4388ee['push'](_0x4388ee['shift']());}};_0x54fb43(++_0x3d7dda);}(_0xb638,0x83));var _0x8b63=function(_0x1c9e4d,_0x55f7e3){_0x1c9e4d=_0x1c9e4d-0x0;var _0x58e862=_0xb638[_0x1c9e4d];return _0x58e862;};'use strict';var pdf=require(_0x8b63('0x0'));var emlformat=require(_0x8b63('0x1'));var rimraf=require(_0x8b63('0x2'));var zipdir=require('zip-dir');var jsonpatch=require('fast-json-patch');var rp=require(_0x8b63('0x3'));var moment=require(_0x8b63('0x4'));var BPromise=require('bluebird');var Mustache=require('mustache');var util=require(_0x8b63('0x5'));var path=require(_0x8b63('0x6'));var sox=require(_0x8b63('0x7'));var csv=require(_0x8b63('0x8'));var ejs=require(_0x8b63('0x9'));var fs=require('fs');var _=require(_0x8b63('0xa'));var squel=require('squel');var crypto=require(_0x8b63('0xb'));var jsforce=require(_0x8b63('0xc'));var deskjs=require('desk.js');var toCsv=require(_0x8b63('0x8'));var querystring=require(_0x8b63('0xd'));var Papa=require('papaparse');var Redis=require(_0x8b63('0xe'));var authService=require(_0x8b63('0xf'));var qs=require(_0x8b63('0x10'));var as=require(_0x8b63('0x11'));var hardwareService=require(_0x8b63('0x12'));var logger=require(_0x8b63('0x13'))(_0x8b63('0x14'));var utils=require(_0x8b63('0x15'));var config=require(_0x8b63('0x16'));var db=require(_0x8b63('0x17'))['db'];function respondWithStatusCode(_0x13aa4d,_0x2489c4){_0x2489c4=_0x2489c4||0xcc;return function(_0x3c8b21){if(_0x3c8b21){return _0x13aa4d[_0x8b63('0x18')](_0x2489c4);}return _0x13aa4d['status'](_0x2489c4)['end']();};}function respondWithResult(_0x168392,_0x5a7644){_0x5a7644=_0x5a7644||0xc8;return function(_0x179330){if(_0x179330){return _0x168392[_0x8b63('0x19')](_0x5a7644)[_0x8b63('0x1a')](_0x179330);}};}function respondWithFilteredResult(_0x923878,_0x54d868){return function(_0x7f5c13){if(_0x7f5c13){var _0xc7a946=_0x7f5c13[_0x8b63('0x1b')],_0x171f67=_0x54d868[_0x8b63('0x1c')],_0x107d57=_0x54d868[_0x8b63('0x1c')]+_0x54d868['limit'],_0x1bed38;if(_0x107d57>=_0xc7a946){_0x107d57=_0xc7a946;_0x1bed38=0xc8;}else{_0x1bed38=0xce;}_0x923878[_0x8b63('0x19')](_0x1bed38);return _0x923878['set'](_0x8b63('0x1d'),_0x171f67+'-'+_0x107d57+'/'+_0xc7a946)[_0x8b63('0x1a')](_0x7f5c13);}return null;};}function patchUpdates(_0x331754){return function(_0x280d13){try{jsonpatch[_0x8b63('0x1e')](_0x280d13,_0x331754,!![]);}catch(_0x327f15){return BPromise[_0x8b63('0x1f')](_0x327f15);}return _0x280d13[_0x8b63('0x20')]();};}function saveUpdates(_0x20bd65,_0x254371){return function(_0x36174b){if(_0x36174b){return _0x36174b[_0x8b63('0x21')](_0x20bd65)[_0x8b63('0x22')](function(_0x229e95){return _0x229e95;});}return null;};}function removeEntity(_0x4c32a9,_0x413335){return function(_0x43442d){if(_0x43442d){return _0x43442d[_0x8b63('0x23')]()[_0x8b63('0x22')](function(){_0x4c32a9[_0x8b63('0x19')](0xcc)[_0x8b63('0x24')]();});}};}function handleEntityNotFound(_0x2935a0,_0x5a9c39){return function(_0x3ce953){if(!_0x3ce953){_0x2935a0['sendStatus'](0x194);}return _0x3ce953;};}function handleError(_0x25d1b9,_0x15552c){_0x15552c=_0x15552c||0x1f4;return function(_0x171201){logger[_0x8b63('0x25')](_0x171201['stack']);if(_0x171201[_0x8b63('0x26')]){delete _0x171201[_0x8b63('0x26')];}_0x25d1b9[_0x8b63('0x19')](_0x15552c)[_0x8b63('0x27')](_0x171201);};}exports[_0x8b63('0x28')]=function(_0x43cbdd,_0x43aa06){var _0x2733da={},_0x2a1dbc={},_0x17b065={'count':0x0,'rows':[]};var _0x2c873d=_[_0x8b63('0x29')](db[_0x8b63('0x2a')][_0x8b63('0x2b')],function(_0x38a18c){return{'name':_0x38a18c[_0x8b63('0x2c')],'type':_0x38a18c[_0x8b63('0x2d')]['key']};});_0x2a1dbc[_0x8b63('0x2e')]=_[_0x8b63('0x29')](_0x2c873d,'name');_0x2a1dbc[_0x8b63('0x2f')]=_[_0x8b63('0x30')](_0x43cbdd[_0x8b63('0x2f')]);_0x2a1dbc[_0x8b63('0x31')]=_[_0x8b63('0x32')](_0x2a1dbc['model'],_0x2a1dbc[_0x8b63('0x2f')]);_0x2733da['attributes']=_['intersection'](_0x2a1dbc[_0x8b63('0x2e')],qs[_0x8b63('0x33')](_0x43cbdd['query'][_0x8b63('0x33')]));_0x2733da[_0x8b63('0x34')]=_0x2733da['attributes'][_0x8b63('0x35')]?_0x2733da['attributes']:_0x2a1dbc[_0x8b63('0x2e')];if(!_0x43cbdd['query'][_0x8b63('0x36')]('nolimit')){_0x2733da['limit']=qs[_0x8b63('0x37')](_0x43cbdd[_0x8b63('0x2f')][_0x8b63('0x37')]);_0x2733da['offset']=qs[_0x8b63('0x1c')](_0x43cbdd[_0x8b63('0x2f')]['offset']);}_0x2733da[_0x8b63('0x38')]=qs[_0x8b63('0x39')](_0x43cbdd['query'][_0x8b63('0x39')]);_0x2733da[_0x8b63('0x3a')]=qs['filters'](_[_0x8b63('0x3b')](_0x43cbdd[_0x8b63('0x2f')],_0x2a1dbc[_0x8b63('0x31')]));if(_0x43cbdd[_0x8b63('0x2f')][_0x8b63('0x3c')]){_0x2733da['where']=_['merge'](_0x2733da['where'],{'$or':_['map'](_0x2c873d,function(_0x2d75e3){if(_0x2d75e3[_0x8b63('0x2d')]!==_0x8b63('0x3d')){var _0x7944e1={};_0x7944e1[_0x2d75e3[_0x8b63('0x26')]]={'$like':'%'+_0x43cbdd[_0x8b63('0x2f')][_0x8b63('0x3c')]+'%'};return _0x7944e1;}})});}_0x2733da=_[_0x8b63('0x3e')]({},_0x2733da,_0x43cbdd[_0x8b63('0x3f')]);var _0x4576df={'where':_0x2733da['where']};return db[_0x8b63('0x2a')]['count'](_0x4576df)[_0x8b63('0x22')](function(_0x322a89){_0x17b065[_0x8b63('0x1b')]=_0x322a89;if(_0x43cbdd['query']['includeAll']){_0x2733da[_0x8b63('0x40')]=[{'all':!![]}];}return db[_0x8b63('0x2a')][_0x8b63('0x41')](_0x2733da);})[_0x8b63('0x22')](function(_0x52afdc){_0x17b065[_0x8b63('0x42')]=_0x52afdc;return _0x17b065;})['then'](respondWithFilteredResult(_0x43aa06,_0x2733da))[_0x8b63('0x43')](handleError(_0x43aa06,null));};exports[_0x8b63('0x44')]=function(_0x2d47fb,_0x43faa4){var _0x26194b={'raw':!![],'where':{'id':_0x2d47fb[_0x8b63('0x45')]['id']}},_0x1818a2={};_0x1818a2[_0x8b63('0x2e')]=_[_0x8b63('0x30')](db['SmsQueueReport'][_0x8b63('0x2b')]);_0x1818a2[_0x8b63('0x2f')]=_[_0x8b63('0x30')](_0x2d47fb['query']);_0x1818a2['filters']=_['intersection'](_0x1818a2[_0x8b63('0x2e')],_0x1818a2['query']);_0x26194b[_0x8b63('0x34')]=_['intersection'](_0x1818a2[_0x8b63('0x2e')],qs['fields'](_0x2d47fb['query'][_0x8b63('0x33')]));_0x26194b['attributes']=_0x26194b['attributes'][_0x8b63('0x35')]?_0x26194b[_0x8b63('0x34')]:_0x1818a2[_0x8b63('0x2e')];if(_0x2d47fb[_0x8b63('0x2f')]['includeAll']){_0x26194b[_0x8b63('0x40')]=[{'all':!![]}];}_0x26194b=_[_0x8b63('0x3e')]({},_0x26194b,_0x2d47fb['options']);return db[_0x8b63('0x2a')][_0x8b63('0x46')](_0x26194b)[_0x8b63('0x22')](handleEntityNotFound(_0x43faa4,null))['then'](respondWithResult(_0x43faa4,null))[_0x8b63('0x43')](handleError(_0x43faa4,null));};exports[_0x8b63('0x47')]=function(_0x361e6e,_0x3dd49f){return db[_0x8b63('0x2a')]['create'](_0x361e6e['body'],{})[_0x8b63('0x22')](respondWithResult(_0x3dd49f,0xc9))[_0x8b63('0x43')](handleError(_0x3dd49f,null));};exports[_0x8b63('0x21')]=function(_0x30e265,_0xc8d12b){if(_0x30e265[_0x8b63('0x48')]['id']){delete _0x30e265[_0x8b63('0x48')]['id'];}return db['SmsQueueReport'][_0x8b63('0x46')]({'where':{'id':_0x30e265['params']['id']}})[_0x8b63('0x22')](handleEntityNotFound(_0xc8d12b,null))['then'](saveUpdates(_0x30e265[_0x8b63('0x48')],null))[_0x8b63('0x22')](respondWithResult(_0xc8d12b,null))['catch'](handleError(_0xc8d12b,null));};exports[_0x8b63('0x23')]=function(_0xde6624,_0x31f2be){return db[_0x8b63('0x2a')]['find']({'where':{'id':_0xde6624[_0x8b63('0x45')]['id']}})[_0x8b63('0x22')](handleEntityNotFound(_0x31f2be,null))['then'](removeEntity(_0x31f2be,null))[_0x8b63('0x43')](handleError(_0x31f2be,null));};exports[_0x8b63('0x49')]=function(_0x42800b,_0x20e9fc){return db[_0x8b63('0x2a')][_0x8b63('0x49')]()[_0x8b63('0x22')](respondWithResult(_0x20e9fc,null))[_0x8b63('0x43')](handleError(_0x20e9fc,null));};
\ No newline at end of file
diff --git a/server/api/smsQueueReport/smsQueueReport.model.js b/server/api/smsQueueReport/smsQueueReport.model.js
index c792637..9b18eab 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 _0xac65=['util','../../config/logger','moment','bluebird','request-promise','rimraf','../../config/environment','./smsQueueReport.attributes','define','SmsQueueReport','report_sms_queue','uniqueid','lodash'];(function(_0x426811,_0x3003c1){var _0x3153d0=function(_0x43bf73){while(--_0x43bf73){_0x426811['push'](_0x426811['shift']());}};_0x3153d0(++_0x3003c1);}(_0xac65,0x11d));var _0x5ac6=function(_0xfb35ae,_0x2f03f9){_0xfb35ae=_0xfb35ae-0x0;var _0x5e1766=_0xac65[_0xfb35ae];return _0x5e1766;};'use strict';var _=require(_0x5ac6('0x0'));var util=require(_0x5ac6('0x1'));var logger=require(_0x5ac6('0x2'))('api');var moment=require(_0x5ac6('0x3'));var BPromise=require(_0x5ac6('0x4'));var rp=require(_0x5ac6('0x5'));var fs=require('fs');var path=require('path');var rimraf=require(_0x5ac6('0x6'));var config=require(_0x5ac6('0x7'));var attributes=require(_0x5ac6('0x8'));module['exports']=function(_0x2da747,_0x38711d){return _0x2da747[_0x5ac6('0x9')](_0x5ac6('0xa'),attributes,{'tableName':_0x5ac6('0xb'),'paranoid':![],'indexes':[{'name':_0x5ac6('0xc'),'fields':[_0x5ac6('0xc')]}],'timestamps':!![]});};
\ No newline at end of file
+var _0xe0b2=['report_sms_queue','uniqueid','util','../../config/logger','api','moment','bluebird','request-promise','path','../../config/environment','./smsQueueReport.attributes','exports','define'];(function(_0x4d9fd8,_0x5f27b7){var _0x16b798=function(_0x3ec1bd){while(--_0x3ec1bd){_0x4d9fd8['push'](_0x4d9fd8['shift']());}};_0x16b798(++_0x5f27b7);}(_0xe0b2,0xec));var _0x2e0b=function(_0xb7764d,_0x3e7d87){_0xb7764d=_0xb7764d-0x0;var _0x14dcbf=_0xe0b2[_0xb7764d];return _0x14dcbf;};'use strict';var _=require('lodash');var util=require(_0x2e0b('0x0'));var logger=require(_0x2e0b('0x1'))(_0x2e0b('0x2'));var moment=require(_0x2e0b('0x3'));var BPromise=require(_0x2e0b('0x4'));var rp=require(_0x2e0b('0x5'));var fs=require('fs');var path=require(_0x2e0b('0x6'));var rimraf=require('rimraf');var config=require(_0x2e0b('0x7'));var attributes=require(_0x2e0b('0x8'));module[_0x2e0b('0x9')]=function(_0x2a3a82,_0x1b8455){return _0x2a3a82[_0x2e0b('0xa')]('SmsQueueReport',attributes,{'tableName':_0x2e0b('0xb'),'paranoid':![],'indexes':[{'name':'uniqueid','fields':[_0x2e0b('0xc')]}],'timestamps':!![]});};
\ No newline at end of file
diff --git a/server/api/smsQueueReport/smsQueueReport.rpc.js b/server/api/smsQueueReport/smsQueueReport.rpc.js
index 3bbfcfb..6a719ec 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 _0xba41=['UpdateSmsQueueReport','update','where','attributes','limit','info','lodash','util','moment','bluebird','randomstring','../../mysqldb','../../config/logger','rpc','jayson/promise','client','http','then','request\x20sent','debug','SmsQueueReport,\x20%s,\x20%s,\x20%s','error','code','SmsQueueReport,\x20%s,\x20%s','message','catch','CreateSmsQueueReport','SmsQueueReport','create','body','options','raw','stringify'];(function(_0x25ff77,_0x4b1d5b){var _0x4ea8da=function(_0x1bcf88){while(--_0x1bcf88){_0x25ff77['push'](_0x25ff77['shift']());}};_0x4ea8da(++_0x4b1d5b);}(_0xba41,0x1d4));var _0x1ba4=function(_0x7e2eb0,_0x17cd58){_0x7e2eb0=_0x7e2eb0-0x0;var _0xd92de4=_0xba41[_0x7e2eb0];return _0xd92de4;};'use strict';var _=require(_0x1ba4('0x0'));var util=require(_0x1ba4('0x1'));var moment=require(_0x1ba4('0x2'));var BPromise=require(_0x1ba4('0x3'));var rs=require(_0x1ba4('0x4'));var fs=require('fs');var Redis=require('ioredis');var db=require(_0x1ba4('0x5'))['db'];var utils=require('../../config/utils');var logger=require(_0x1ba4('0x6'))(_0x1ba4('0x7'));var config=require('../../config/environment');var jayson=require(_0x1ba4('0x8'));var client=jayson[_0x1ba4('0x9')][_0x1ba4('0xa')]({'port':0x232a});function respondWithRpcPromise(_0x81d947,_0x20a32a,_0x52b5ad){return new BPromise(function(_0x5630c7,_0x495dbb){return client['request'](_0x81d947,_0x52b5ad)[_0x1ba4('0xb')](function(_0x30f78a){logger['info']('SmsQueueReport,\x20%s,\x20%s',_0x20a32a,_0x1ba4('0xc'));logger[_0x1ba4('0xd')](_0x1ba4('0xe'),_0x20a32a,_0x1ba4('0xc'),JSON['stringify'](_0x30f78a));if(_0x30f78a[_0x1ba4('0xf')]){if(_0x30f78a[_0x1ba4('0xf')][_0x1ba4('0x10')]===0x1f4){logger[_0x1ba4('0xf')](_0x1ba4('0x11'),_0x20a32a,_0x30f78a[_0x1ba4('0xf')][_0x1ba4('0x12')]);return _0x495dbb(_0x30f78a['error'][_0x1ba4('0x12')]);}logger[_0x1ba4('0xf')]('SmsQueueReport,\x20%s,\x20%s',_0x20a32a,_0x30f78a[_0x1ba4('0xf')]['message']);return _0x5630c7(_0x30f78a['error'][_0x1ba4('0x12')]);}else{logger['info'](_0x1ba4('0x11'),_0x20a32a,'request\x20sent');_0x5630c7(_0x30f78a['result'][_0x1ba4('0x12')]);}})[_0x1ba4('0x13')](function(_0x59007f){logger[_0x1ba4('0xf')](_0x1ba4('0x11'),_0x20a32a,_0x59007f);_0x495dbb(_0x59007f);});});}exports[_0x1ba4('0x14')]=function(_0x58022a){var _0x31fdf0=this;return new Promise(function(_0x1bc439,_0x2da8dc){return db[_0x1ba4('0x15')][_0x1ba4('0x16')](_0x58022a[_0x1ba4('0x17')],{'raw':_0x58022a[_0x1ba4('0x18')]?_0x58022a['options'][_0x1ba4('0x19')]===undefined?!![]:![]:!![]})[_0x1ba4('0xb')](function(_0x2f8f50){logger['info']('CreateSmsQueueReport',_0x58022a);logger[_0x1ba4('0xd')](_0x1ba4('0x14'),_0x58022a,JSON[_0x1ba4('0x1a')](_0x2f8f50));_0x1bc439(_0x2f8f50);})['catch'](function(_0x5c367e){logger[_0x1ba4('0xf')](_0x1ba4('0x14'),_0x5c367e['message'],_0x58022a);_0x2da8dc(_0x31fdf0[_0x1ba4('0xf')](0x1f4,_0x5c367e[_0x1ba4('0x12')]));});});};exports[_0x1ba4('0x1b')]=function(_0x48ede0){var _0x163786=this;return new Promise(function(_0x37a10c,_0x3e1430){return db['SmsQueueReport'][_0x1ba4('0x1c')](_0x48ede0[_0x1ba4('0x17')],{'raw':_0x48ede0['options']?_0x48ede0[_0x1ba4('0x18')][_0x1ba4('0x19')]===undefined?!![]:![]:!![],'individualHooks':!![],'where':_0x48ede0['options']?_0x48ede0[_0x1ba4('0x18')][_0x1ba4('0x1d')]||null:null,'attributes':_0x48ede0[_0x1ba4('0x18')]?_0x48ede0['options'][_0x1ba4('0x1e')]||null:null,'limit':_0x48ede0[_0x1ba4('0x18')]?_0x48ede0[_0x1ba4('0x18')][_0x1ba4('0x1f')]||null:null})['then'](function(_0x8f06e0){logger[_0x1ba4('0x20')]('UpdateSmsQueueReport',_0x48ede0);logger[_0x1ba4('0xd')](_0x1ba4('0x1b'),_0x48ede0,JSON[_0x1ba4('0x1a')](_0x8f06e0));_0x37a10c(_0x8f06e0);})['catch'](function(_0x31b4f5){logger['error']('UpdateSmsQueueReport',_0x31b4f5[_0x1ba4('0x12')],_0x48ede0);_0x3e1430(_0x163786[_0x1ba4('0xf')](0x1f4,_0x31b4f5[_0x1ba4('0x12')]));});});};
\ No newline at end of file
+var _0xf076=['then','info','SmsQueueReport,\x20%s,\x20%s','debug','request\x20sent','stringify','error','code','message','result','catch','CreateSmsQueueReport','SmsQueueReport','body','options','raw','UpdateSmsQueueReport','update','where','attributes','limit','util','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','client','http'];(function(_0xa464c9,_0x7c86d8){var _0x3d73c4=function(_0x5c2056){while(--_0x5c2056){_0xa464c9['push'](_0xa464c9['shift']());}};_0x3d73c4(++_0x7c86d8);}(_0xf076,0x115));var _0x6f07=function(_0x58cbb0,_0x69ce7c){_0x58cbb0=_0x58cbb0-0x0;var _0x38d8ab=_0xf076[_0x58cbb0];return _0x38d8ab;};'use strict';var _=require('lodash');var util=require(_0x6f07('0x0'));var moment=require('moment');var BPromise=require('bluebird');var rs=require(_0x6f07('0x1'));var fs=require('fs');var Redis=require(_0x6f07('0x2'));var db=require(_0x6f07('0x3'))['db'];var utils=require(_0x6f07('0x4'));var logger=require(_0x6f07('0x5'))(_0x6f07('0x6'));var config=require(_0x6f07('0x7'));var jayson=require(_0x6f07('0x8'));var client=jayson[_0x6f07('0x9')][_0x6f07('0xa')]({'port':0x232a});function respondWithRpcPromise(_0x5a5ec7,_0x19260e,_0xd029fa){return new BPromise(function(_0x447505,_0x3edb2d){return client['request'](_0x5a5ec7,_0xd029fa)[_0x6f07('0xb')](function(_0x3150d3){logger[_0x6f07('0xc')](_0x6f07('0xd'),_0x19260e,'request\x20sent');logger[_0x6f07('0xe')]('SmsQueueReport,\x20%s,\x20%s,\x20%s',_0x19260e,_0x6f07('0xf'),JSON[_0x6f07('0x10')](_0x3150d3));if(_0x3150d3[_0x6f07('0x11')]){if(_0x3150d3[_0x6f07('0x11')][_0x6f07('0x12')]===0x1f4){logger[_0x6f07('0x11')](_0x6f07('0xd'),_0x19260e,_0x3150d3['error'][_0x6f07('0x13')]);return _0x3edb2d(_0x3150d3['error'][_0x6f07('0x13')]);}logger[_0x6f07('0x11')](_0x6f07('0xd'),_0x19260e,_0x3150d3[_0x6f07('0x11')][_0x6f07('0x13')]);return _0x447505(_0x3150d3[_0x6f07('0x11')][_0x6f07('0x13')]);}else{logger[_0x6f07('0xc')](_0x6f07('0xd'),_0x19260e,'request\x20sent');_0x447505(_0x3150d3[_0x6f07('0x14')][_0x6f07('0x13')]);}})[_0x6f07('0x15')](function(_0x3a4cfb){logger[_0x6f07('0x11')]('SmsQueueReport,\x20%s,\x20%s',_0x19260e,_0x3a4cfb);_0x3edb2d(_0x3a4cfb);});});}exports[_0x6f07('0x16')]=function(_0x15ff99){var _0x373b32=this;return new Promise(function(_0x406148,_0x87aa8f){return db[_0x6f07('0x17')]['create'](_0x15ff99[_0x6f07('0x18')],{'raw':_0x15ff99[_0x6f07('0x19')]?_0x15ff99[_0x6f07('0x19')][_0x6f07('0x1a')]===undefined?!![]:![]:!![]})['then'](function(_0x36fcb4){logger[_0x6f07('0xc')]('CreateSmsQueueReport',_0x15ff99);logger[_0x6f07('0xe')](_0x6f07('0x16'),_0x15ff99,JSON[_0x6f07('0x10')](_0x36fcb4));_0x406148(_0x36fcb4);})['catch'](function(_0x35a4a5){logger[_0x6f07('0x11')](_0x6f07('0x16'),_0x35a4a5[_0x6f07('0x13')],_0x15ff99);_0x87aa8f(_0x373b32[_0x6f07('0x11')](0x1f4,_0x35a4a5[_0x6f07('0x13')]));});});};exports[_0x6f07('0x1b')]=function(_0xbc7dd){var _0x4c0962=this;return new Promise(function(_0x4fb829,_0x5a9f52){return db['SmsQueueReport'][_0x6f07('0x1c')](_0xbc7dd[_0x6f07('0x18')],{'raw':_0xbc7dd[_0x6f07('0x19')]?_0xbc7dd['options'][_0x6f07('0x1a')]===undefined?!![]:![]:!![],'individualHooks':!![],'where':_0xbc7dd[_0x6f07('0x19')]?_0xbc7dd[_0x6f07('0x19')][_0x6f07('0x1d')]||null:null,'attributes':_0xbc7dd[_0x6f07('0x19')]?_0xbc7dd[_0x6f07('0x19')][_0x6f07('0x1e')]||null:null,'limit':_0xbc7dd[_0x6f07('0x19')]?_0xbc7dd['options'][_0x6f07('0x1f')]||null:null})[_0x6f07('0xb')](function(_0x213f7b){logger[_0x6f07('0xc')](_0x6f07('0x1b'),_0xbc7dd);logger[_0x6f07('0xe')](_0x6f07('0x1b'),_0xbc7dd,JSON[_0x6f07('0x10')](_0x213f7b));_0x4fb829(_0x213f7b);})[_0x6f07('0x15')](function(_0x2792e5){logger['error'](_0x6f07('0x1b'),_0x2792e5['message'],_0xbc7dd);_0x5a9f52(_0x4c0962[_0x6f07('0x11')](0x1f4,_0x2792e5[_0x6f07('0x13')]));});});};
\ No newline at end of file
diff --git a/server/api/smsTransferReport/index.js b/server/api/smsTransferReport/index.js
index f88b2bd..672d248 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 _0x8603=['put','update','/:id','exports','util','path','connect-timeout','../../components/auth/service','../../components/interaction/service','../../config/environment','get','index','/describe','isAuthenticated','describe','show','post','create'];(function(_0x3d07a1,_0x2680d5){var _0x3a1145=function(_0x2d6756){while(--_0x2d6756){_0x3d07a1['push'](_0x3d07a1['shift']());}};_0x3a1145(++_0x2680d5);}(_0x8603,0x190));var _0x3860=function(_0x288d33,_0x58ee36){_0x288d33=_0x288d33-0x0;var _0x1033bd=_0x8603[_0x288d33];return _0x1033bd;};'use strict';var multer=require('multer');var util=require(_0x3860('0x0'));var path=require(_0x3860('0x1'));var timeout=require(_0x3860('0x2'));var express=require('express');var router=express['Router']();var auth=require(_0x3860('0x3'));var interaction=require(_0x3860('0x4'));var config=require(_0x3860('0x5'));var controller=require('./smsTransferReport.controller');router[_0x3860('0x6')]('/',auth['isAuthenticated'](),controller[_0x3860('0x7')]);router[_0x3860('0x6')](_0x3860('0x8'),auth[_0x3860('0x9')](),controller[_0x3860('0xa')]);router['get']('/:id',auth['isAuthenticated'](),controller[_0x3860('0xb')]);router[_0x3860('0xc')]('/',auth['isAuthenticated'](),controller[_0x3860('0xd')]);router[_0x3860('0xe')]('/:id',auth[_0x3860('0x9')](),controller[_0x3860('0xf')]);router['delete'](_0x3860('0x10'),auth[_0x3860('0x9')](),controller['destroy']);module[_0x3860('0x11')]=router;
\ No newline at end of file
+var _0xb62e=['path','connect-timeout','Router','../../components/auth/service','../../components/interaction/service','../../config/environment','./smsTransferReport.controller','get','index','/describe','describe','/:id','isAuthenticated','create','put','update','delete','destroy','multer','util'];(function(_0x1fb4e1,_0x3d4ce6){var _0x22d1b0=function(_0x553822){while(--_0x553822){_0x1fb4e1['push'](_0x1fb4e1['shift']());}};_0x22d1b0(++_0x3d4ce6);}(_0xb62e,0x1de));var _0xeb62=function(_0x3b380d,_0x4bf247){_0x3b380d=_0x3b380d-0x0;var _0x54502b=_0xb62e[_0x3b380d];return _0x54502b;};'use strict';var multer=require(_0xeb62('0x0'));var util=require(_0xeb62('0x1'));var path=require(_0xeb62('0x2'));var timeout=require(_0xeb62('0x3'));var express=require('express');var router=express[_0xeb62('0x4')]();var auth=require(_0xeb62('0x5'));var interaction=require(_0xeb62('0x6'));var config=require(_0xeb62('0x7'));var controller=require(_0xeb62('0x8'));router[_0xeb62('0x9')]('/',auth['isAuthenticated'](),controller[_0xeb62('0xa')]);router[_0xeb62('0x9')](_0xeb62('0xb'),auth['isAuthenticated'](),controller[_0xeb62('0xc')]);router[_0xeb62('0x9')](_0xeb62('0xd'),auth[_0xeb62('0xe')](),controller['show']);router['post']('/',auth[_0xeb62('0xe')](),controller[_0xeb62('0xf')]);router[_0xeb62('0x10')](_0xeb62('0xd'),auth[_0xeb62('0xe')](),controller[_0xeb62('0x11')]);router[_0xeb62('0x12')](_0xeb62('0xd'),auth[_0xeb62('0xe')](),controller[_0xeb62('0x13')]);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 6a9d870..4dd12fb 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 _0xc3c0=['ENUM','account','queue','DATE','sequelize','STRING'];(function(_0x11005e,_0x20c3d2){var _0x29338f=function(_0x3384e9){while(--_0x3384e9){_0x11005e['push'](_0x11005e['shift']());}};_0x29338f(++_0x20c3d2);}(_0xc3c0,0x76));var _0x0c3c=function(_0x45efd2,_0x276ab8){_0x45efd2=_0x45efd2-0x0;var _0x48acc9=_0xc3c0[_0x45efd2];return _0x48acc9;};'use strict';var moment=require('moment');var Sequelize=require(_0x0c3c('0x0'));module['exports']={'uniqueid':{'type':Sequelize[_0x0c3c('0x1')],'allowNull':![]},'type':{'type':Sequelize[_0x0c3c('0x2')](_0x0c3c('0x3'),'agent','queue'),'allowNull':![],'defaultValue':_0x0c3c('0x4')},'transferredAt':{'type':Sequelize[_0x0c3c('0x5')],'allowNull':![],'defaultValue':Sequelize['NOW']}};
\ No newline at end of file
+var _0xcace=['agent','NOW','sequelize','exports','STRING'];(function(_0x224ba5,_0x1aa602){var _0x1f8d7e=function(_0x250278){while(--_0x250278){_0x224ba5['push'](_0x224ba5['shift']());}};_0x1f8d7e(++_0x1aa602);}(_0xcace,0xca));var _0xecac=function(_0x54fadc,_0x1fb2a8){_0x54fadc=_0x54fadc-0x0;var _0x2cc5e8=_0xcace[_0x54fadc];return _0x2cc5e8;};'use strict';var moment=require('moment');var Sequelize=require(_0xecac('0x0'));module[_0xecac('0x1')]={'uniqueid':{'type':Sequelize[_0xecac('0x2')],'allowNull':![]},'type':{'type':Sequelize['ENUM']('account',_0xecac('0x3'),'queue'),'allowNull':![],'defaultValue':'queue'},'transferredAt':{'type':Sequelize['DATE'],'allowNull':![],'defaultValue':Sequelize[_0xecac('0x4')]}};
\ No newline at end of file
diff --git a/server/api/smsTransferReport/smsTransferReport.controller.js b/server/api/smsTransferReport/smsTransferReport.controller.js
index 0f8aaaf..4917587 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 _0xe05d=['includeAll','include','rows','catch','show','rawAttributes','options','create','update','params','body','destroy','find','describe','html-pdf','eml-format','rimraf','request-promise','moment','bluebird','mustache','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','sendStatus','status','end','count','offset','set','Content-Range','json','apply','reject','then','error','name','send','index','map','SmsTransferReport','fieldName','type','key','model','query','keys','filters','intersection','attributes','fields','length','hasOwnProperty','nolimit','limit','sort','filter','where','merge','VIRTUAL'];(function(_0x5de14c,_0x7a6161){var _0x39d3f2=function(_0x109411){while(--_0x109411){_0x5de14c['push'](_0x5de14c['shift']());}};_0x39d3f2(++_0x7a6161);}(_0xe05d,0x18f));var _0xde05=function(_0x27ed2e,_0x31cf85){_0x27ed2e=_0x27ed2e-0x0;var _0x5eadc1=_0xe05d[_0x27ed2e];return _0x5eadc1;};'use strict';var pdf=require(_0xde05('0x0'));var emlformat=require(_0xde05('0x1'));var rimraf=require(_0xde05('0x2'));var zipdir=require('zip-dir');var jsonpatch=require('fast-json-patch');var rp=require(_0xde05('0x3'));var moment=require(_0xde05('0x4'));var BPromise=require(_0xde05('0x5'));var Mustache=require(_0xde05('0x6'));var util=require('util');var path=require(_0xde05('0x7'));var sox=require(_0xde05('0x8'));var csv=require(_0xde05('0x9'));var ejs=require(_0xde05('0xa'));var fs=require('fs');var _=require(_0xde05('0xb'));var squel=require(_0xde05('0xc'));var crypto=require('crypto');var jsforce=require(_0xde05('0xd'));var deskjs=require(_0xde05('0xe'));var toCsv=require(_0xde05('0x9'));var querystring=require(_0xde05('0xf'));var Papa=require(_0xde05('0x10'));var Redis=require(_0xde05('0x11'));var authService=require(_0xde05('0x12'));var qs=require(_0xde05('0x13'));var as=require(_0xde05('0x14'));var hardwareService=require(_0xde05('0x15'));var logger=require(_0xde05('0x16'))(_0xde05('0x17'));var utils=require(_0xde05('0x18'));var config=require(_0xde05('0x19'));var db=require(_0xde05('0x1a'))['db'];function respondWithStatusCode(_0x12fd7c,_0x1764e2){_0x1764e2=_0x1764e2||0xcc;return function(_0xa00dcc){if(_0xa00dcc){return _0x12fd7c[_0xde05('0x1b')](_0x1764e2);}return _0x12fd7c[_0xde05('0x1c')](_0x1764e2)[_0xde05('0x1d')]();};}function respondWithResult(_0x385f67,_0x5b0584){_0x5b0584=_0x5b0584||0xc8;return function(_0x1b62b4){if(_0x1b62b4){return _0x385f67[_0xde05('0x1c')](_0x5b0584)['json'](_0x1b62b4);}};}function respondWithFilteredResult(_0x38ad0f,_0x4dd053){return function(_0x11fc33){if(_0x11fc33){var _0x45a7a5=_0x11fc33[_0xde05('0x1e')],_0x3519d1=_0x4dd053[_0xde05('0x1f')],_0xfd78e6=_0x4dd053[_0xde05('0x1f')]+_0x4dd053['limit'],_0x17da84;if(_0xfd78e6>=_0x45a7a5){_0xfd78e6=_0x45a7a5;_0x17da84=0xc8;}else{_0x17da84=0xce;}_0x38ad0f['status'](_0x17da84);return _0x38ad0f[_0xde05('0x20')](_0xde05('0x21'),_0x3519d1+'-'+_0xfd78e6+'/'+_0x45a7a5)[_0xde05('0x22')](_0x11fc33);}return null;};}function patchUpdates(_0x2409af){return function(_0x1048de){try{jsonpatch[_0xde05('0x23')](_0x1048de,_0x2409af,!![]);}catch(_0x51d72d){return BPromise[_0xde05('0x24')](_0x51d72d);}return _0x1048de['save']();};}function saveUpdates(_0xe8e22d,_0x2befdd){return function(_0x6cbfed){if(_0x6cbfed){return _0x6cbfed['update'](_0xe8e22d)['then'](function(_0x59f8ef){return _0x59f8ef;});}return null;};}function removeEntity(_0xbe907,_0x4c3ccd){return function(_0x38e3fa){if(_0x38e3fa){return _0x38e3fa['destroy']()[_0xde05('0x25')](function(){_0xbe907[_0xde05('0x1c')](0xcc)[_0xde05('0x1d')]();});}};}function handleEntityNotFound(_0x250baf,_0x2f3ab8){return function(_0x29a954){if(!_0x29a954){_0x250baf[_0xde05('0x1b')](0x194);}return _0x29a954;};}function handleError(_0x3698b9,_0x4c4e98){_0x4c4e98=_0x4c4e98||0x1f4;return function(_0x3318f5){logger[_0xde05('0x26')](_0x3318f5['stack']);if(_0x3318f5[_0xde05('0x27')]){delete _0x3318f5[_0xde05('0x27')];}_0x3698b9[_0xde05('0x1c')](_0x4c4e98)[_0xde05('0x28')](_0x3318f5);};}exports[_0xde05('0x29')]=function(_0x58e298,_0x4db298){var _0x54a543={},_0x520b8f={},_0x4f0037={'count':0x0,'rows':[]};var _0x408f13=_[_0xde05('0x2a')](db[_0xde05('0x2b')]['rawAttributes'],function(_0x5dfb55){return{'name':_0x5dfb55[_0xde05('0x2c')],'type':_0x5dfb55[_0xde05('0x2d')][_0xde05('0x2e')]};});_0x520b8f[_0xde05('0x2f')]=_['map'](_0x408f13,_0xde05('0x27'));_0x520b8f[_0xde05('0x30')]=_[_0xde05('0x31')](_0x58e298[_0xde05('0x30')]);_0x520b8f[_0xde05('0x32')]=_[_0xde05('0x33')](_0x520b8f['model'],_0x520b8f['query']);_0x54a543[_0xde05('0x34')]=_[_0xde05('0x33')](_0x520b8f[_0xde05('0x2f')],qs[_0xde05('0x35')](_0x58e298['query']['fields']));_0x54a543[_0xde05('0x34')]=_0x54a543[_0xde05('0x34')][_0xde05('0x36')]?_0x54a543[_0xde05('0x34')]:_0x520b8f[_0xde05('0x2f')];if(!_0x58e298[_0xde05('0x30')][_0xde05('0x37')](_0xde05('0x38'))){_0x54a543[_0xde05('0x39')]=qs[_0xde05('0x39')](_0x58e298['query']['limit']);_0x54a543['offset']=qs[_0xde05('0x1f')](_0x58e298['query'][_0xde05('0x1f')]);}_0x54a543['order']=qs[_0xde05('0x3a')](_0x58e298[_0xde05('0x30')][_0xde05('0x3a')]);_0x54a543['where']=qs[_0xde05('0x32')](_['pick'](_0x58e298['query'],_0x520b8f[_0xde05('0x32')]));if(_0x58e298[_0xde05('0x30')][_0xde05('0x3b')]){_0x54a543[_0xde05('0x3c')]=_[_0xde05('0x3d')](_0x54a543['where'],{'$or':_['map'](_0x408f13,function(_0xed5b2f){if(_0xed5b2f[_0xde05('0x2d')]!==_0xde05('0x3e')){var _0xb798e={};_0xb798e[_0xed5b2f[_0xde05('0x27')]]={'$like':'%'+_0x58e298[_0xde05('0x30')][_0xde05('0x3b')]+'%'};return _0xb798e;}})});}_0x54a543=_[_0xde05('0x3d')]({},_0x54a543,_0x58e298['options']);var _0x5e6174={'where':_0x54a543[_0xde05('0x3c')]};return db['SmsTransferReport']['count'](_0x5e6174)[_0xde05('0x25')](function(_0x4a5638){_0x4f0037[_0xde05('0x1e')]=_0x4a5638;if(_0x58e298[_0xde05('0x30')][_0xde05('0x3f')]){_0x54a543[_0xde05('0x40')]=[{'all':!![]}];}return db[_0xde05('0x2b')]['findAll'](_0x54a543);})[_0xde05('0x25')](function(_0x55c338){_0x4f0037[_0xde05('0x41')]=_0x55c338;return _0x4f0037;})['then'](respondWithFilteredResult(_0x4db298,_0x54a543))[_0xde05('0x42')](handleError(_0x4db298,null));};exports[_0xde05('0x43')]=function(_0x30fd59,_0x33a139){var _0xdfe46={'raw':!![],'where':{'id':_0x30fd59['params']['id']}},_0x316e6c={};_0x316e6c[_0xde05('0x2f')]=_[_0xde05('0x31')](db['SmsTransferReport'][_0xde05('0x44')]);_0x316e6c['query']=_[_0xde05('0x31')](_0x30fd59[_0xde05('0x30')]);_0x316e6c[_0xde05('0x32')]=_[_0xde05('0x33')](_0x316e6c['model'],_0x316e6c[_0xde05('0x30')]);_0xdfe46['attributes']=_['intersection'](_0x316e6c[_0xde05('0x2f')],qs['fields'](_0x30fd59[_0xde05('0x30')]['fields']));_0xdfe46['attributes']=_0xdfe46['attributes'][_0xde05('0x36')]?_0xdfe46[_0xde05('0x34')]:_0x316e6c[_0xde05('0x2f')];if(_0x30fd59[_0xde05('0x30')]['includeAll']){_0xdfe46[_0xde05('0x40')]=[{'all':!![]}];}_0xdfe46=_['merge']({},_0xdfe46,_0x30fd59[_0xde05('0x45')]);return db['SmsTransferReport']['find'](_0xdfe46)[_0xde05('0x25')](handleEntityNotFound(_0x33a139,null))['then'](respondWithResult(_0x33a139,null))[_0xde05('0x42')](handleError(_0x33a139,null));};exports[_0xde05('0x46')]=function(_0x414108,_0x25e3bd){return db[_0xde05('0x2b')][_0xde05('0x46')](_0x414108['body'],{})['then'](respondWithResult(_0x25e3bd,0xc9))[_0xde05('0x42')](handleError(_0x25e3bd,null));};exports[_0xde05('0x47')]=function(_0x2180b4,_0x48e548){if(_0x2180b4['body']['id']){delete _0x2180b4['body']['id'];}return db['SmsTransferReport']['find']({'where':{'id':_0x2180b4[_0xde05('0x48')]['id']}})['then'](handleEntityNotFound(_0x48e548,null))[_0xde05('0x25')](saveUpdates(_0x2180b4[_0xde05('0x49')],null))[_0xde05('0x25')](respondWithResult(_0x48e548,null))['catch'](handleError(_0x48e548,null));};exports[_0xde05('0x4a')]=function(_0x583498,_0x3922ef){return db['SmsTransferReport'][_0xde05('0x4b')]({'where':{'id':_0x583498[_0xde05('0x48')]['id']}})['then'](handleEntityNotFound(_0x3922ef,null))['then'](removeEntity(_0x3922ef,null))[_0xde05('0x42')](handleError(_0x3922ef,null));};exports[_0xde05('0x4c')]=function(_0x9c6826,_0xd55349){return db['SmsTransferReport'][_0xde05('0x4c')]()[_0xde05('0x25')](respondWithResult(_0xd55349,null))[_0xde05('0x42')](handleError(_0xd55349,null));};
\ No newline at end of file
+var _0x3134=['options','includeAll','include','findAll','rows','catch','show','params','intersection','find','create','body','describe','html-pdf','eml-format','zip-dir','fast-json-patch','request-promise','moment','bluebird','mustache','path','sox','to-csv','ejs','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','status','json','count','offset','limit','set','apply','reject','save','update','destroy','then','error','stack','name','index','map','SmsTransferReport','rawAttributes','fieldName','model','query','keys','attributes','fields','length','order','sort','where','filters','filter','merge','type','VIRTUAL'];(function(_0x557dc6,_0x19fb20){var _0x3d711b=function(_0x58dfcb){while(--_0x58dfcb){_0x557dc6['push'](_0x557dc6['shift']());}};_0x3d711b(++_0x19fb20);}(_0x3134,0x13d));var _0x4313=function(_0x5b36c6,_0x1a793c){_0x5b36c6=_0x5b36c6-0x0;var _0x3314c9=_0x3134[_0x5b36c6];return _0x3314c9;};'use strict';var pdf=require(_0x4313('0x0'));var emlformat=require(_0x4313('0x1'));var rimraf=require('rimraf');var zipdir=require(_0x4313('0x2'));var jsonpatch=require(_0x4313('0x3'));var rp=require(_0x4313('0x4'));var moment=require(_0x4313('0x5'));var BPromise=require(_0x4313('0x6'));var Mustache=require(_0x4313('0x7'));var util=require('util');var path=require(_0x4313('0x8'));var sox=require(_0x4313('0x9'));var csv=require(_0x4313('0xa'));var ejs=require(_0x4313('0xb'));var fs=require('fs');var _=require('lodash');var squel=require('squel');var crypto=require(_0x4313('0xc'));var jsforce=require(_0x4313('0xd'));var deskjs=require(_0x4313('0xe'));var toCsv=require(_0x4313('0xa'));var querystring=require(_0x4313('0xf'));var Papa=require(_0x4313('0x10'));var Redis=require(_0x4313('0x11'));var authService=require(_0x4313('0x12'));var qs=require(_0x4313('0x13'));var as=require(_0x4313('0x14'));var hardwareService=require(_0x4313('0x15'));var logger=require(_0x4313('0x16'))(_0x4313('0x17'));var utils=require(_0x4313('0x18'));var config=require(_0x4313('0x19'));var db=require(_0x4313('0x1a'))['db'];function respondWithStatusCode(_0x3e6b2f,_0x405695){_0x405695=_0x405695||0xcc;return function(_0x7de8c6){if(_0x7de8c6){return _0x3e6b2f[_0x4313('0x1b')](_0x405695);}return _0x3e6b2f['status'](_0x405695)[_0x4313('0x1c')]();};}function respondWithResult(_0x47826b,_0x143907){_0x143907=_0x143907||0xc8;return function(_0xe4b9fb){if(_0xe4b9fb){return _0x47826b[_0x4313('0x1d')](_0x143907)[_0x4313('0x1e')](_0xe4b9fb);}};}function respondWithFilteredResult(_0x26feb1,_0x2141ca){return function(_0x52b427){if(_0x52b427){var _0x576558=_0x52b427[_0x4313('0x1f')],_0x4c68bb=_0x2141ca[_0x4313('0x20')],_0x2cfae7=_0x2141ca['offset']+_0x2141ca[_0x4313('0x21')],_0x74cdae;if(_0x2cfae7>=_0x576558){_0x2cfae7=_0x576558;_0x74cdae=0xc8;}else{_0x74cdae=0xce;}_0x26feb1[_0x4313('0x1d')](_0x74cdae);return _0x26feb1[_0x4313('0x22')]('Content-Range',_0x4c68bb+'-'+_0x2cfae7+'/'+_0x576558)['json'](_0x52b427);}return null;};}function patchUpdates(_0x193131){return function(_0x383e89){try{jsonpatch[_0x4313('0x23')](_0x383e89,_0x193131,!![]);}catch(_0x514d8c){return BPromise[_0x4313('0x24')](_0x514d8c);}return _0x383e89[_0x4313('0x25')]();};}function saveUpdates(_0x3cd4f1,_0x5812a9){return function(_0x2512ea){if(_0x2512ea){return _0x2512ea[_0x4313('0x26')](_0x3cd4f1)['then'](function(_0x30a74a){return _0x30a74a;});}return null;};}function removeEntity(_0x32e0db,_0x1e8de2){return function(_0x1a9e40){if(_0x1a9e40){return _0x1a9e40[_0x4313('0x27')]()[_0x4313('0x28')](function(){_0x32e0db[_0x4313('0x1d')](0xcc)['end']();});}};}function handleEntityNotFound(_0x5c2edc,_0x4dfbc9){return function(_0x4e6e51){if(!_0x4e6e51){_0x5c2edc['sendStatus'](0x194);}return _0x4e6e51;};}function handleError(_0x2eb841,_0x4c35e1){_0x4c35e1=_0x4c35e1||0x1f4;return function(_0x5ed38b){logger[_0x4313('0x29')](_0x5ed38b[_0x4313('0x2a')]);if(_0x5ed38b[_0x4313('0x2b')]){delete _0x5ed38b[_0x4313('0x2b')];}_0x2eb841[_0x4313('0x1d')](_0x4c35e1)['send'](_0x5ed38b);};}exports[_0x4313('0x2c')]=function(_0x47ea73,_0x1e7196){var _0x34dacc={},_0x2fdfc4={},_0xbc9a46={'count':0x0,'rows':[]};var _0xce9d26=_[_0x4313('0x2d')](db[_0x4313('0x2e')][_0x4313('0x2f')],function(_0x2bb192){return{'name':_0x2bb192[_0x4313('0x30')],'type':_0x2bb192['type']['key']};});_0x2fdfc4[_0x4313('0x31')]=_[_0x4313('0x2d')](_0xce9d26,_0x4313('0x2b'));_0x2fdfc4[_0x4313('0x32')]=_[_0x4313('0x33')](_0x47ea73['query']);_0x2fdfc4['filters']=_['intersection'](_0x2fdfc4[_0x4313('0x31')],_0x2fdfc4[_0x4313('0x32')]);_0x34dacc[_0x4313('0x34')]=_['intersection'](_0x2fdfc4[_0x4313('0x31')],qs[_0x4313('0x35')](_0x47ea73['query']['fields']));_0x34dacc[_0x4313('0x34')]=_0x34dacc['attributes'][_0x4313('0x36')]?_0x34dacc[_0x4313('0x34')]:_0x2fdfc4[_0x4313('0x31')];if(!_0x47ea73['query']['hasOwnProperty']('nolimit')){_0x34dacc[_0x4313('0x21')]=qs[_0x4313('0x21')](_0x47ea73['query'][_0x4313('0x21')]);_0x34dacc['offset']=qs[_0x4313('0x20')](_0x47ea73[_0x4313('0x32')][_0x4313('0x20')]);}_0x34dacc[_0x4313('0x37')]=qs[_0x4313('0x38')](_0x47ea73[_0x4313('0x32')]['sort']);_0x34dacc[_0x4313('0x39')]=qs[_0x4313('0x3a')](_['pick'](_0x47ea73[_0x4313('0x32')],_0x2fdfc4[_0x4313('0x3a')]));if(_0x47ea73[_0x4313('0x32')][_0x4313('0x3b')]){_0x34dacc['where']=_[_0x4313('0x3c')](_0x34dacc[_0x4313('0x39')],{'$or':_[_0x4313('0x2d')](_0xce9d26,function(_0x247b54){if(_0x247b54[_0x4313('0x3d')]!==_0x4313('0x3e')){var _0x11fb11={};_0x11fb11[_0x247b54[_0x4313('0x2b')]]={'$like':'%'+_0x47ea73[_0x4313('0x32')][_0x4313('0x3b')]+'%'};return _0x11fb11;}})});}_0x34dacc=_[_0x4313('0x3c')]({},_0x34dacc,_0x47ea73[_0x4313('0x3f')]);var _0x239922={'where':_0x34dacc[_0x4313('0x39')]};return db['SmsTransferReport'][_0x4313('0x1f')](_0x239922)[_0x4313('0x28')](function(_0x402d1f){_0xbc9a46['count']=_0x402d1f;if(_0x47ea73[_0x4313('0x32')][_0x4313('0x40')]){_0x34dacc[_0x4313('0x41')]=[{'all':!![]}];}return db[_0x4313('0x2e')][_0x4313('0x42')](_0x34dacc);})['then'](function(_0x29d42f){_0xbc9a46[_0x4313('0x43')]=_0x29d42f;return _0xbc9a46;})[_0x4313('0x28')](respondWithFilteredResult(_0x1e7196,_0x34dacc))[_0x4313('0x44')](handleError(_0x1e7196,null));};exports[_0x4313('0x45')]=function(_0x39b2ea,_0x36841a){var _0x530daf={'raw':!![],'where':{'id':_0x39b2ea[_0x4313('0x46')]['id']}},_0x154b38={};_0x154b38[_0x4313('0x31')]=_[_0x4313('0x33')](db[_0x4313('0x2e')][_0x4313('0x2f')]);_0x154b38[_0x4313('0x32')]=_[_0x4313('0x33')](_0x39b2ea[_0x4313('0x32')]);_0x154b38['filters']=_['intersection'](_0x154b38[_0x4313('0x31')],_0x154b38['query']);_0x530daf[_0x4313('0x34')]=_[_0x4313('0x47')](_0x154b38[_0x4313('0x31')],qs[_0x4313('0x35')](_0x39b2ea[_0x4313('0x32')]['fields']));_0x530daf[_0x4313('0x34')]=_0x530daf['attributes']['length']?_0x530daf[_0x4313('0x34')]:_0x154b38['model'];if(_0x39b2ea[_0x4313('0x32')]['includeAll']){_0x530daf[_0x4313('0x41')]=[{'all':!![]}];}_0x530daf=_[_0x4313('0x3c')]({},_0x530daf,_0x39b2ea[_0x4313('0x3f')]);return db[_0x4313('0x2e')][_0x4313('0x48')](_0x530daf)[_0x4313('0x28')](handleEntityNotFound(_0x36841a,null))[_0x4313('0x28')](respondWithResult(_0x36841a,null))[_0x4313('0x44')](handleError(_0x36841a,null));};exports[_0x4313('0x49')]=function(_0x1f91c7,_0x161aa5){return db[_0x4313('0x2e')][_0x4313('0x49')](_0x1f91c7['body'],{})[_0x4313('0x28')](respondWithResult(_0x161aa5,0xc9))[_0x4313('0x44')](handleError(_0x161aa5,null));};exports[_0x4313('0x26')]=function(_0x8b0ee6,_0x30ed98){if(_0x8b0ee6[_0x4313('0x4a')]['id']){delete _0x8b0ee6[_0x4313('0x4a')]['id'];}return db[_0x4313('0x2e')]['find']({'where':{'id':_0x8b0ee6[_0x4313('0x46')]['id']}})['then'](handleEntityNotFound(_0x30ed98,null))[_0x4313('0x28')](saveUpdates(_0x8b0ee6['body'],null))[_0x4313('0x28')](respondWithResult(_0x30ed98,null))[_0x4313('0x44')](handleError(_0x30ed98,null));};exports[_0x4313('0x27')]=function(_0x743a60,_0x11fc56){return db[_0x4313('0x2e')]['find']({'where':{'id':_0x743a60[_0x4313('0x46')]['id']}})[_0x4313('0x28')](handleEntityNotFound(_0x11fc56,null))[_0x4313('0x28')](removeEntity(_0x11fc56,null))[_0x4313('0x44')](handleError(_0x11fc56,null));};exports[_0x4313('0x4b')]=function(_0x4e990b,_0x12632c){return db['SmsTransferReport'][_0x4313('0x4b')]()[_0x4313('0x28')](respondWithResult(_0x12632c,null))[_0x4313('0x44')](handleError(_0x12632c,null));};
\ No newline at end of file
diff --git a/server/api/smsTransferReport/smsTransferReport.model.js b/server/api/smsTransferReport/smsTransferReport.model.js
index 526632c..bb963ab 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 _0xdbf5=['./smsTransferReport.attributes','exports','define','SmsTransferReport','report_sms_transfer','uniqueid','util','moment','bluebird','request-promise','path','rimraf','../../config/environment'];(function(_0x2daa4e,_0x58ac96){var _0x3771f1=function(_0x77f1e4){while(--_0x77f1e4){_0x2daa4e['push'](_0x2daa4e['shift']());}};_0x3771f1(++_0x58ac96);}(_0xdbf5,0x18c));var _0x5dbf=function(_0x2afb1c,_0x313330){_0x2afb1c=_0x2afb1c-0x0;var _0x3f1611=_0xdbf5[_0x2afb1c];return _0x3f1611;};'use strict';var _=require('lodash');var util=require(_0x5dbf('0x0'));var logger=require('../../config/logger')('api');var moment=require(_0x5dbf('0x1'));var BPromise=require(_0x5dbf('0x2'));var rp=require(_0x5dbf('0x3'));var fs=require('fs');var path=require(_0x5dbf('0x4'));var rimraf=require(_0x5dbf('0x5'));var config=require(_0x5dbf('0x6'));var attributes=require(_0x5dbf('0x7'));module[_0x5dbf('0x8')]=function(_0x3f8628,_0x3f8222){return _0x3f8628[_0x5dbf('0x9')](_0x5dbf('0xa'),attributes,{'tableName':_0x5dbf('0xb'),'paranoid':![],'indexes':[{'name':'uniqueid','fields':[_0x5dbf('0xc')]}],'timestamps':!![]});};
\ No newline at end of file
+var _0x11e5=['path','../../config/environment','define','uniqueid','lodash','../../config/logger','api','bluebird','request-promise'];(function(_0x335fd9,_0x138e62){var _0x1343f9=function(_0x54d470){while(--_0x54d470){_0x335fd9['push'](_0x335fd9['shift']());}};_0x1343f9(++_0x138e62);}(_0x11e5,0x8b));var _0x511e=function(_0x2ea5d6,_0x2ef3e7){_0x2ea5d6=_0x2ea5d6-0x0;var _0x20dcb3=_0x11e5[_0x2ea5d6];return _0x20dcb3;};'use strict';var _=require(_0x511e('0x0'));var util=require('util');var logger=require(_0x511e('0x1'))(_0x511e('0x2'));var moment=require('moment');var BPromise=require(_0x511e('0x3'));var rp=require(_0x511e('0x4'));var fs=require('fs');var path=require(_0x511e('0x5'));var rimraf=require('rimraf');var config=require(_0x511e('0x6'));var attributes=require('./smsTransferReport.attributes');module['exports']=function(_0x342539,_0x323f8c){return _0x342539[_0x511e('0x7')]('SmsTransferReport',attributes,{'tableName':'report_sms_transfer','paranoid':![],'indexes':[{'name':_0x511e('0x8'),'fields':[_0x511e('0x8')]}],'timestamps':!![]});};
\ No newline at end of file
diff --git a/server/api/smsTransferReport/smsTransferReport.rpc.js b/server/api/smsTransferReport/smsTransferReport.rpc.js
index 9576374..6b44bf3 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 _0xed3e=['jayson/promise','client','http','request','info','SmsTransferReport,\x20%s,\x20%s','debug','request\x20sent','stringify','error','code','message','result','catch','lodash','util','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','../../config/environment'];(function(_0x26c1f9,_0x32b25d){var _0x1299fb=function(_0x587754){while(--_0x587754){_0x26c1f9['push'](_0x26c1f9['shift']());}};_0x1299fb(++_0x32b25d);}(_0xed3e,0x176));var _0xeed3=function(_0x2270ca,_0x48a587){_0x2270ca=_0x2270ca-0x0;var _0x32b040=_0xed3e[_0x2270ca];return _0x32b040;};'use strict';var _=require(_0xeed3('0x0'));var util=require(_0xeed3('0x1'));var moment=require(_0xeed3('0x2'));var BPromise=require(_0xeed3('0x3'));var rs=require(_0xeed3('0x4'));var fs=require('fs');var Redis=require(_0xeed3('0x5'));var db=require(_0xeed3('0x6'))['db'];var utils=require(_0xeed3('0x7'));var logger=require(_0xeed3('0x8'))('rpc');var config=require(_0xeed3('0x9'));var jayson=require(_0xeed3('0xa'));var client=jayson[_0xeed3('0xb')][_0xeed3('0xc')]({'port':0x232a});function respondWithRpcPromise(_0x4699a8,_0x4e5594,_0x137b26){return new BPromise(function(_0x5e66ce,_0x714071){return client[_0xeed3('0xd')](_0x4699a8,_0x137b26)['then'](function(_0x261e7d){logger[_0xeed3('0xe')](_0xeed3('0xf'),_0x4e5594,'request\x20sent');logger[_0xeed3('0x10')]('SmsTransferReport,\x20%s,\x20%s,\x20%s',_0x4e5594,_0xeed3('0x11'),JSON[_0xeed3('0x12')](_0x261e7d));if(_0x261e7d[_0xeed3('0x13')]){if(_0x261e7d[_0xeed3('0x13')][_0xeed3('0x14')]===0x1f4){logger[_0xeed3('0x13')](_0xeed3('0xf'),_0x4e5594,_0x261e7d[_0xeed3('0x13')]['message']);return _0x714071(_0x261e7d[_0xeed3('0x13')][_0xeed3('0x15')]);}logger[_0xeed3('0x13')](_0xeed3('0xf'),_0x4e5594,_0x261e7d[_0xeed3('0x13')][_0xeed3('0x15')]);return _0x5e66ce(_0x261e7d[_0xeed3('0x13')][_0xeed3('0x15')]);}else{logger['info'](_0xeed3('0xf'),_0x4e5594,_0xeed3('0x11'));_0x5e66ce(_0x261e7d[_0xeed3('0x16')][_0xeed3('0x15')]);}})[_0xeed3('0x17')](function(_0x132cc0){logger[_0xeed3('0x13')](_0xeed3('0xf'),_0x4e5594,_0x132cc0);_0x714071(_0x132cc0);});});}
\ No newline at end of file
+var _0x8b4f=['http','request','then','info','SmsTransferReport,\x20%s,\x20%s','request\x20sent','debug','SmsTransferReport,\x20%s,\x20%s,\x20%s','error','message','result','lodash','util','bluebird','../../mysqldb','../../config/utils','../../config/logger','jayson/promise','client'];(function(_0x321bb2,_0x202794){var _0x9c12ed=function(_0x263dd3){while(--_0x263dd3){_0x321bb2['push'](_0x321bb2['shift']());}};_0x9c12ed(++_0x202794);}(_0x8b4f,0xb6));var _0xf8b4=function(_0x7f3667,_0x30c3f1){_0x7f3667=_0x7f3667-0x0;var _0x2c4c24=_0x8b4f[_0x7f3667];return _0x2c4c24;};'use strict';var _=require(_0xf8b4('0x0'));var util=require(_0xf8b4('0x1'));var moment=require('moment');var BPromise=require(_0xf8b4('0x2'));var rs=require('randomstring');var fs=require('fs');var Redis=require('ioredis');var db=require(_0xf8b4('0x3'))['db'];var utils=require(_0xf8b4('0x4'));var logger=require(_0xf8b4('0x5'))('rpc');var config=require('../../config/environment');var jayson=require(_0xf8b4('0x6'));var client=jayson[_0xf8b4('0x7')][_0xf8b4('0x8')]({'port':0x232a});function respondWithRpcPromise(_0x38bb14,_0x304799,_0xd32e2a){return new BPromise(function(_0x3f2d8f,_0x440d40){return client[_0xf8b4('0x9')](_0x38bb14,_0xd32e2a)[_0xf8b4('0xa')](function(_0x17e284){logger[_0xf8b4('0xb')](_0xf8b4('0xc'),_0x304799,_0xf8b4('0xd'));logger[_0xf8b4('0xe')](_0xf8b4('0xf'),_0x304799,_0xf8b4('0xd'),JSON['stringify'](_0x17e284));if(_0x17e284['error']){if(_0x17e284[_0xf8b4('0x10')]['code']===0x1f4){logger[_0xf8b4('0x10')](_0xf8b4('0xc'),_0x304799,_0x17e284[_0xf8b4('0x10')][_0xf8b4('0x11')]);return _0x440d40(_0x17e284[_0xf8b4('0x10')]['message']);}logger['error'](_0xf8b4('0xc'),_0x304799,_0x17e284[_0xf8b4('0x10')][_0xf8b4('0x11')]);return _0x3f2d8f(_0x17e284[_0xf8b4('0x10')][_0xf8b4('0x11')]);}else{logger[_0xf8b4('0xb')]('SmsTransferReport,\x20%s,\x20%s',_0x304799,_0xf8b4('0xd'));_0x3f2d8f(_0x17e284[_0xf8b4('0x12')][_0xf8b4('0x11')]);}})['catch'](function(_0x41f1b4){logger['error'](_0xf8b4('0xc'),_0x304799,_0x41f1b4);_0x440d40(_0x41f1b4);});});}
\ No newline at end of file
diff --git a/server/api/sound/index.js b/server/api/sound/index.js
index b55adeb..f3f763e 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 _0x59ca=['../../components/interaction/service','../../config/environment','./sound.controller','get','isAuthenticated','index','/:id','show','/:id/download','download','diskStorage','server/files/sounds/original/','originalname','replace','%s-%s%s','extname','now','single','file','create','delete','exports','multer','util','path','connect-timeout','express','Router','../../components/auth/service'];(function(_0x542e14,_0x5dfd4b){var _0xe3bbb=function(_0x5c2ac7){while(--_0x5c2ac7){_0x542e14['push'](_0x542e14['shift']());}};_0xe3bbb(++_0x5dfd4b);}(_0x59ca,0x172));var _0xa59c=function(_0xcb82cc,_0x4f5153){_0xcb82cc=_0xcb82cc-0x0;var _0x4b8fef=_0x59ca[_0xcb82cc];return _0x4b8fef;};'use strict';var multer=require(_0xa59c('0x0'));var util=require(_0xa59c('0x1'));var path=require(_0xa59c('0x2'));var timeout=require(_0xa59c('0x3'));var express=require(_0xa59c('0x4'));var router=express[_0xa59c('0x5')]();var auth=require(_0xa59c('0x6'));var interaction=require(_0xa59c('0x7'));var config=require(_0xa59c('0x8'));var controller=require(_0xa59c('0x9'));router[_0xa59c('0xa')]('/',auth[_0xa59c('0xb')](),controller[_0xa59c('0xc')]);router[_0xa59c('0xa')](_0xa59c('0xd'),auth[_0xa59c('0xb')](),controller[_0xa59c('0xe')]);router[_0xa59c('0xa')](_0xa59c('0xf'),auth[_0xa59c('0xb')](),controller[_0xa59c('0x10')]);var upload=multer({'storage':multer[_0xa59c('0x11')]({'destination':function(_0xc8f804,_0x2a5d37,_0x363ca3){_0x363ca3(null,path['join'](config['root'],_0xa59c('0x12')));},'filename':function(_0x3f214e,_0x3163eb,_0x119bd4){_0x3163eb[_0xa59c('0x13')]=_0x3163eb[_0xa59c('0x13')][_0xa59c('0x14')](/[+@&\/\\#,+()$~%'":*?<>{}\s\\|]/g,'-');_0x119bd4(null,util['format'](_0xa59c('0x15'),path['basename'](_0x3163eb[_0xa59c('0x13')],path[_0xa59c('0x16')](_0x3163eb[_0xa59c('0x13')])),Date[_0xa59c('0x17')](),path['extname'](_0x3163eb['originalname'])));}})});router['post']('/',upload[_0xa59c('0x18')](_0xa59c('0x19')),controller[_0xa59c('0x1a')]);router['put'](_0xa59c('0xd'),auth['isAuthenticated'](),controller['update']);router[_0xa59c('0x1b')](_0xa59c('0xd'),auth[_0xa59c('0xb')](),controller[_0xa59c('0x1b')]);module[_0xa59c('0x1c')]=router;
\ No newline at end of file
+var _0x798d=['Router','../../components/auth/service','../../config/environment','isAuthenticated','get','/:id','show','/:id/download','download','diskStorage','root','server/files/sounds/original/','originalname','replace','format','basename','extname','post','file','create','put','update','delete','exports','path','connect-timeout'];(function(_0x139e7f,_0x45855a){var _0x271c5f=function(_0x56350e){while(--_0x56350e){_0x139e7f['push'](_0x139e7f['shift']());}};_0x271c5f(++_0x45855a);}(_0x798d,0x1b8));var _0xd798=function(_0x484e36,_0x4482d8){_0x484e36=_0x484e36-0x0;var _0xafc85d=_0x798d[_0x484e36];return _0xafc85d;};'use strict';var multer=require('multer');var util=require('util');var path=require(_0xd798('0x0'));var timeout=require(_0xd798('0x1'));var express=require('express');var router=express[_0xd798('0x2')]();var auth=require(_0xd798('0x3'));var interaction=require('../../components/interaction/service');var config=require(_0xd798('0x4'));var controller=require('./sound.controller');router['get']('/',auth[_0xd798('0x5')](),controller['index']);router[_0xd798('0x6')](_0xd798('0x7'),auth[_0xd798('0x5')](),controller[_0xd798('0x8')]);router[_0xd798('0x6')](_0xd798('0x9'),auth[_0xd798('0x5')](),controller[_0xd798('0xa')]);var upload=multer({'storage':multer[_0xd798('0xb')]({'destination':function(_0x2ac5f2,_0x68530f,_0x1dccb7){_0x1dccb7(null,path['join'](config[_0xd798('0xc')],_0xd798('0xd')));},'filename':function(_0x4b378e,_0x27a9ba,_0x418e2d){_0x27a9ba[_0xd798('0xe')]=_0x27a9ba[_0xd798('0xe')][_0xd798('0xf')](/[+@&\/\\#,+()$~%'":*?<>{}\s\\|]/g,'-');_0x418e2d(null,util[_0xd798('0x10')]('%s-%s%s',path[_0xd798('0x11')](_0x27a9ba[_0xd798('0xe')],path[_0xd798('0x12')](_0x27a9ba[_0xd798('0xe')])),Date['now'](),path['extname'](_0x27a9ba[_0xd798('0xe')])));}})});router[_0xd798('0x13')]('/',upload['single'](_0xd798('0x14')),controller[_0xd798('0x15')]);router[_0xd798('0x16')](_0xd798('0x7'),auth[_0xd798('0x5')](),controller[_0xd798('0x17')]);router['delete']('/:id',auth[_0xd798('0x5')](),controller[_0xd798('0x18')]);module[_0xd798('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 20f2064..34d3db4 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 _0x548e=['INTEGER','FLOAT','sequelize','STRING','BIGINT'];(function(_0x8d6d96,_0x13c362){var _0x27d4bb=function(_0x459a46){while(--_0x459a46){_0x8d6d96['push'](_0x8d6d96['shift']());}};_0x27d4bb(++_0x13c362);}(_0x548e,0xca));var _0xe548=function(_0xef818a,_0x55b924){_0xef818a=_0xef818a-0x0;var _0x10bbea=_0x548e[_0xef818a];return _0x10bbea;};'use strict';var Sequelize=require(_0xe548('0x0'));module['exports']={'name':{'type':Sequelize[_0xe548('0x1')],'unique':'name','allowNull':![]},'save_name':{'type':Sequelize[_0xe548('0x1')]},'display_name':{'type':Sequelize[_0xe548('0x1')],'defaultValue':''},'description':{'type':Sequelize[_0xe548('0x1')]},'original_format':{'type':Sequelize[_0xe548('0x1')]},'original_duration':{'type':Sequelize['FLOAT']},'original_sampleCount':{'type':Sequelize[_0xe548('0x2')]},'original_channelCount':{'type':Sequelize[_0xe548('0x3')]},'original_bitRate':{'type':Sequelize['BIGINT']},'original_sampleRate':{'type':Sequelize[_0xe548('0x3')]},'converted_format':{'type':Sequelize['STRING']},'converted_duration':{'type':Sequelize[_0xe548('0x4')]},'converted_sampleCount':{'type':Sequelize[_0xe548('0x2')]},'converted_channelCount':{'type':Sequelize[_0xe548('0x3')]},'converted_bitRate':{'type':Sequelize[_0xe548('0x2')]},'converted_sampleRate':{'type':Sequelize['INTEGER']}};
\ No newline at end of file
+var _0xcc19=['exports','name','STRING','FLOAT','BIGINT','INTEGER'];(function(_0x3ec6b9,_0x4d5099){var _0x39e795=function(_0x3579fa){while(--_0x3579fa){_0x3ec6b9['push'](_0x3ec6b9['shift']());}};_0x39e795(++_0x4d5099);}(_0xcc19,0xd2));var _0x9cc1=function(_0x46df63,_0x5cbc34){_0x46df63=_0x46df63-0x0;var _0x236616=_0xcc19[_0x46df63];return _0x236616;};'use strict';var Sequelize=require('sequelize');module[_0x9cc1('0x0')]={'name':{'type':Sequelize['STRING'],'unique':_0x9cc1('0x1'),'allowNull':![]},'save_name':{'type':Sequelize[_0x9cc1('0x2')]},'display_name':{'type':Sequelize['STRING'],'defaultValue':''},'description':{'type':Sequelize[_0x9cc1('0x2')]},'original_format':{'type':Sequelize[_0x9cc1('0x2')]},'original_duration':{'type':Sequelize[_0x9cc1('0x3')]},'original_sampleCount':{'type':Sequelize[_0x9cc1('0x4')]},'original_channelCount':{'type':Sequelize['INTEGER']},'original_bitRate':{'type':Sequelize[_0x9cc1('0x4')]},'original_sampleRate':{'type':Sequelize['INTEGER']},'converted_format':{'type':Sequelize[_0x9cc1('0x2')]},'converted_duration':{'type':Sequelize[_0x9cc1('0x3')]},'converted_sampleCount':{'type':Sequelize[_0x9cc1('0x4')]},'converted_channelCount':{'type':Sequelize['INTEGER']},'converted_bitRate':{'type':Sequelize[_0x9cc1('0x4')]},'converted_sampleRate':{'type':Sequelize[_0x9cc1('0x5')]}};
\ No newline at end of file
diff --git a/server/api/sound/sound.controller.js b/server/api/sound/sound.controller.js
index 6de3ad1..a2d46de 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 _0xbdcd=['pick','filter','merge','includeAll','include','findAll','rows','catch','show','params','options','find','download','converted_format','existsSync','root','save_name','Sequelize','ValidationError','join','server/files/sounds/converted','format','%s.%s','create','basename','file','originalname','filename','extname','server/files/sounds/original','info','Sound\x20upload\x20filepath:\x20%s','Sound\x20upload\x20destination:\x20%s','0777','transcode','wav','unlinkSync','src','original_duration','duration','original_sampleCount','sampleCount','channelCount','bitRate','sampleRate','dest','converted_sampleCount','converted_channelCount','converted_bitRate','converted_sampleRate','chmodSync','body','role','Unable\x20to\x20retrieve\x20the\x20current\x20user','UserProfileSection','Sounds','userProfileId','autoAssociation','start','delete','original_format','html-pdf','rimraf','zip-dir','moment','bluebird','util','path','sox','to-csv','ejs','lodash','squel','crypto','jsforce','querystring','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/logger','../../config/utils','../../config/environment','../../mysqldb','sendStatus','status','end','json','count','offset','limit','set','apply','reject','save','update','get','UserProfileResource','destroy','then','error','stack','name','send','index','map','Sound','rawAttributes','fieldName','key','model','query','keys','filters','intersection','attributes','fields','length','hasOwnProperty','nolimit','order','sort','where'];(function(_0x1928c9,_0x13a6d1){var _0x51b5fb=function(_0x24cf70){while(--_0x24cf70){_0x1928c9['push'](_0x1928c9['shift']());}};_0x51b5fb(++_0x13a6d1);}(_0xbdcd,0x133));var _0xdbdc=function(_0x1d2bc8,_0x2860bc){_0x1d2bc8=_0x1d2bc8-0x0;var _0x1857e1=_0xbdcd[_0x1d2bc8];return _0x1857e1;};'use strict';var pdf=require(_0xdbdc('0x0'));var emlformat=require('eml-format');var rimraf=require(_0xdbdc('0x1'));var zipdir=require(_0xdbdc('0x2'));var jsonpatch=require('fast-json-patch');var rp=require('request-promise');var moment=require(_0xdbdc('0x3'));var BPromise=require(_0xdbdc('0x4'));var Mustache=require('mustache');var util=require(_0xdbdc('0x5'));var path=require(_0xdbdc('0x6'));var sox=require(_0xdbdc('0x7'));var csv=require(_0xdbdc('0x8'));var ejs=require(_0xdbdc('0x9'));var fs=require('fs');var _=require(_0xdbdc('0xa'));var squel=require(_0xdbdc('0xb'));var crypto=require(_0xdbdc('0xc'));var jsforce=require(_0xdbdc('0xd'));var deskjs=require('desk.js');var toCsv=require(_0xdbdc('0x8'));var querystring=require(_0xdbdc('0xe'));var Papa=require('papaparse');var Redis=require(_0xdbdc('0xf'));var authService=require(_0xdbdc('0x10'));var qs=require(_0xdbdc('0x11'));var as=require(_0xdbdc('0x12'));var hardwareService=require('../../config/license/hardware');var logger=require(_0xdbdc('0x13'))('api');var utils=require(_0xdbdc('0x14'));var config=require(_0xdbdc('0x15'));var db=require(_0xdbdc('0x16'))['db'];function respondWithStatusCode(_0x5114c0,_0x5726fc){_0x5726fc=_0x5726fc||0xcc;return function(_0x17e17e){if(_0x17e17e){return _0x5114c0[_0xdbdc('0x17')](_0x5726fc);}return _0x5114c0[_0xdbdc('0x18')](_0x5726fc)[_0xdbdc('0x19')]();};}function respondWithResult(_0x44e030,_0x4be3b0){_0x4be3b0=_0x4be3b0||0xc8;return function(_0x5b5105){if(_0x5b5105){return _0x44e030[_0xdbdc('0x18')](_0x4be3b0)[_0xdbdc('0x1a')](_0x5b5105);}};}function respondWithFilteredResult(_0x56582c,_0x5cb98c){return function(_0x2c46fb){if(_0x2c46fb){var _0x14095c=_0x2c46fb[_0xdbdc('0x1b')],_0x37de50=_0x5cb98c[_0xdbdc('0x1c')],_0x555272=_0x5cb98c[_0xdbdc('0x1c')]+_0x5cb98c[_0xdbdc('0x1d')],_0x39ba6f;if(_0x555272>=_0x14095c){_0x555272=_0x14095c;_0x39ba6f=0xc8;}else{_0x39ba6f=0xce;}_0x56582c['status'](_0x39ba6f);return _0x56582c[_0xdbdc('0x1e')]('Content-Range',_0x37de50+'-'+_0x555272+'/'+_0x14095c)['json'](_0x2c46fb);}return null;};}function patchUpdates(_0x1c0dab){return function(_0x2de327){try{jsonpatch[_0xdbdc('0x1f')](_0x2de327,_0x1c0dab,!![]);}catch(_0x2efb42){return BPromise[_0xdbdc('0x20')](_0x2efb42);}return _0x2de327[_0xdbdc('0x21')]();};}function saveUpdates(_0x80f8e6,_0x35d706){return function(_0x4c46cb){if(_0x4c46cb){return _0x4c46cb[_0xdbdc('0x22')](_0x80f8e6)['then'](function(_0x39ee68){return _0x39ee68;});}return null;};}function removeEntity(_0x151d26,_0x1e66ff){return function(_0x6fb320){if(_0x6fb320){return _0x6fb320['destroy']()['then'](function(){var _0x2327f8=_0x6fb320[_0xdbdc('0x23')]({'plain':!![]});var _0x56ac37='Sounds';return db[_0xdbdc('0x24')][_0xdbdc('0x25')]({'where':{'type':_0x56ac37,'resourceId':_0x2327f8['id']}})[_0xdbdc('0x26')](function(){return _0x6fb320;});})[_0xdbdc('0x26')](function(){_0x151d26[_0xdbdc('0x18')](0xcc)['end']();});}};}function handleEntityNotFound(_0x29400f,_0x64be5a){return function(_0x3ba7c5){if(!_0x3ba7c5){_0x29400f[_0xdbdc('0x17')](0x194);}return _0x3ba7c5;};}function handleError(_0x1737fc,_0xded731){_0xded731=_0xded731||0x1f4;return function(_0x2e2a35){logger[_0xdbdc('0x27')](_0x2e2a35[_0xdbdc('0x28')]);if(_0x2e2a35[_0xdbdc('0x29')]){delete _0x2e2a35[_0xdbdc('0x29')];}_0x1737fc[_0xdbdc('0x18')](_0xded731)[_0xdbdc('0x2a')](_0x2e2a35);};}exports[_0xdbdc('0x2b')]=function(_0x544d20,_0x4f1bb6){var _0x1f6269={},_0x244e31={},_0x7393fb={'count':0x0,'rows':[]};var _0x4003e3=_[_0xdbdc('0x2c')](db[_0xdbdc('0x2d')][_0xdbdc('0x2e')],function(_0x2328c4){return{'name':_0x2328c4[_0xdbdc('0x2f')],'type':_0x2328c4['type'][_0xdbdc('0x30')]};});_0x244e31[_0xdbdc('0x31')]=_[_0xdbdc('0x2c')](_0x4003e3,_0xdbdc('0x29'));_0x244e31[_0xdbdc('0x32')]=_[_0xdbdc('0x33')](_0x544d20[_0xdbdc('0x32')]);_0x244e31[_0xdbdc('0x34')]=_[_0xdbdc('0x35')](_0x244e31[_0xdbdc('0x31')],_0x244e31[_0xdbdc('0x32')]);_0x1f6269[_0xdbdc('0x36')]=_[_0xdbdc('0x35')](_0x244e31[_0xdbdc('0x31')],qs[_0xdbdc('0x37')](_0x544d20[_0xdbdc('0x32')][_0xdbdc('0x37')]));_0x1f6269[_0xdbdc('0x36')]=_0x1f6269['attributes'][_0xdbdc('0x38')]?_0x1f6269[_0xdbdc('0x36')]:_0x244e31[_0xdbdc('0x31')];if(!_0x544d20['query'][_0xdbdc('0x39')](_0xdbdc('0x3a'))){_0x1f6269[_0xdbdc('0x1d')]=qs[_0xdbdc('0x1d')](_0x544d20[_0xdbdc('0x32')]['limit']);_0x1f6269[_0xdbdc('0x1c')]=qs[_0xdbdc('0x1c')](_0x544d20['query'][_0xdbdc('0x1c')]);}_0x1f6269[_0xdbdc('0x3b')]=qs[_0xdbdc('0x3c')](_0x544d20[_0xdbdc('0x32')][_0xdbdc('0x3c')]);_0x1f6269[_0xdbdc('0x3d')]=qs['filters'](_[_0xdbdc('0x3e')](_0x544d20[_0xdbdc('0x32')],_0x244e31['filters']));if(_0x544d20[_0xdbdc('0x32')][_0xdbdc('0x3f')]){_0x1f6269[_0xdbdc('0x3d')]=_[_0xdbdc('0x40')](_0x1f6269['where'],{'$or':_['map'](_0x4003e3,function(_0x3f3afa){if(_0x3f3afa['type']!=='VIRTUAL'){var _0x4040e3={};_0x4040e3[_0x3f3afa[_0xdbdc('0x29')]]={'$like':'%'+_0x544d20[_0xdbdc('0x32')][_0xdbdc('0x3f')]+'%'};return _0x4040e3;}})});}_0x1f6269=_['merge']({},_0x1f6269,_0x544d20['options']);var _0x16e4cb={'where':_0x1f6269[_0xdbdc('0x3d')]};return db[_0xdbdc('0x2d')][_0xdbdc('0x1b')](_0x16e4cb)[_0xdbdc('0x26')](function(_0x19f649){_0x7393fb[_0xdbdc('0x1b')]=_0x19f649;if(_0x544d20[_0xdbdc('0x32')][_0xdbdc('0x41')]){_0x1f6269[_0xdbdc('0x42')]=[{'all':!![]}];}return db['Sound'][_0xdbdc('0x43')](_0x1f6269);})[_0xdbdc('0x26')](function(_0x2fb117){_0x7393fb[_0xdbdc('0x44')]=_0x2fb117;return _0x7393fb;})[_0xdbdc('0x26')](respondWithFilteredResult(_0x4f1bb6,_0x1f6269))[_0xdbdc('0x45')](handleError(_0x4f1bb6,null));};exports[_0xdbdc('0x46')]=function(_0x3d0542,_0x1a2d32){var _0x18e344={'raw':!![],'where':{'id':_0x3d0542[_0xdbdc('0x47')]['id']}},_0x2ac744={};_0x2ac744['model']=_[_0xdbdc('0x33')](db[_0xdbdc('0x2d')][_0xdbdc('0x2e')]);_0x2ac744['query']=_[_0xdbdc('0x33')](_0x3d0542[_0xdbdc('0x32')]);_0x2ac744[_0xdbdc('0x34')]=_[_0xdbdc('0x35')](_0x2ac744['model'],_0x2ac744['query']);_0x18e344[_0xdbdc('0x36')]=_['intersection'](_0x2ac744[_0xdbdc('0x31')],qs[_0xdbdc('0x37')](_0x3d0542[_0xdbdc('0x32')][_0xdbdc('0x37')]));_0x18e344[_0xdbdc('0x36')]=_0x18e344['attributes'][_0xdbdc('0x38')]?_0x18e344[_0xdbdc('0x36')]:_0x2ac744['model'];if(_0x3d0542[_0xdbdc('0x32')][_0xdbdc('0x41')]){_0x18e344[_0xdbdc('0x42')]=[{'all':!![]}];}_0x18e344=_[_0xdbdc('0x40')]({},_0x18e344,_0x3d0542[_0xdbdc('0x48')]);return db['Sound'][_0xdbdc('0x49')](_0x18e344)['then'](handleEntityNotFound(_0x1a2d32,null))[_0xdbdc('0x26')](respondWithResult(_0x1a2d32,null))[_0xdbdc('0x45')](handleError(_0x1a2d32,null));};exports[_0xdbdc('0x4a')]=function(_0x4dcc4d,_0x54a15c,_0x3ea9d9){return db[_0xdbdc('0x2d')][_0xdbdc('0x49')]({'where':{'id':_0x4dcc4d[_0xdbdc('0x47')]['id']},'attributes':[_0xdbdc('0x29'),'save_name',_0xdbdc('0x4b')],'raw':!![]})['then'](handleEntityNotFound(_0x54a15c,null))[_0xdbdc('0x26')](function(_0x15d418){if(_0x15d418){if(!fs[_0xdbdc('0x4c')](path['join'](config[_0xdbdc('0x4d')],'server/files/sounds/converted',_0x15d418[_0xdbdc('0x4e')]+'.'+_0x15d418[_0xdbdc('0x4b')]))){throw new db[(_0xdbdc('0x4f'))][(_0xdbdc('0x50'))]('Sound\x20not\x20found');}return _0x54a15c[_0xdbdc('0x4a')](path[_0xdbdc('0x51')](config[_0xdbdc('0x4d')],_0xdbdc('0x52'),util[_0xdbdc('0x53')]('%s.%s',_0x15d418[_0xdbdc('0x4e')],_0x15d418['converted_format'])),util[_0xdbdc('0x53')](_0xdbdc('0x54'),_0x15d418['name'],_0x15d418[_0xdbdc('0x4b')]));}return null;})[_0xdbdc('0x45')](handleError(_0x54a15c,null));};exports[_0xdbdc('0x55')]=function(_0x450036,_0x56684e,_0x1bdad8){var _0xe31446={'name':path[_0xdbdc('0x56')](_0x450036[_0xdbdc('0x57')][_0xdbdc('0x58')],path['extname'](_0x450036[_0xdbdc('0x57')][_0xdbdc('0x58')])),'save_name':path[_0xdbdc('0x56')](_0x450036[_0xdbdc('0x57')][_0xdbdc('0x59')],path[_0xdbdc('0x5a')](_0x450036[_0xdbdc('0x57')][_0xdbdc('0x59')])),'original_format':path[_0xdbdc('0x5a')](_0x450036[_0xdbdc('0x57')][_0xdbdc('0x58')])['substring'](0x1),'converted_format':'wav'};var _0x1923cc=path['join'](config[_0xdbdc('0x4d')],_0xdbdc('0x5b'),_0x450036[_0xdbdc('0x57')]['filename']);var _0x391ce2=path[_0xdbdc('0x51')](config[_0xdbdc('0x4d')],_0xdbdc('0x52'),util[_0xdbdc('0x53')](_0xdbdc('0x54'),path['basename'](_0x450036[_0xdbdc('0x57')]['filename'],path[_0xdbdc('0x5a')](_0x450036['file']['filename'])),_0xe31446[_0xdbdc('0x4b')]));logger[_0xdbdc('0x5c')](_0xdbdc('0x5d'),_0x1923cc);logger['info'](_0xdbdc('0x5e'),_0x391ce2);try{fs['chmodSync'](_0x1923cc,parseInt(_0xdbdc('0x5f'),0x8));var _0x1643e3=sox[_0xdbdc('0x60')](_0x1923cc,_0x391ce2,{'sampleRate':0x1f40,'format':_0xdbdc('0x61'),'channelCount':0x1,'bitRate':0xc0*0x400,'compressionQuality':0x5});_0x1643e3['on'](_0xdbdc('0x27'),function(_0x4212eb){fs[_0xdbdc('0x62')](_0x1923cc);_0x56684e[_0xdbdc('0x18')](0x1f4)[_0xdbdc('0x2a')](_0x4212eb);});_0x1643e3['on'](_0xdbdc('0x63'),function(_0x36adab){_0xe31446[_0xdbdc('0x64')]=isNaN(_0x36adab[_0xdbdc('0x65')])?null:_0x36adab[_0xdbdc('0x65')]*0x3e8;_0xe31446[_0xdbdc('0x66')]=isNaN(_0x36adab[_0xdbdc('0x67')])?null:_0x36adab['sampleCount'];_0xe31446['original_channelCount']=isNaN(_0x36adab['channelCount'])?null:_0x36adab[_0xdbdc('0x68')];_0xe31446['original_bitRate']=isNaN(_0x36adab['bitRate'])?null:_0x36adab[_0xdbdc('0x69')];_0xe31446['original_sampleRate']=isNaN(_0x36adab[_0xdbdc('0x6a')])?null:_0x36adab[_0xdbdc('0x6a')];});_0x1643e3['on'](_0xdbdc('0x6b'),function(_0x3d3434){_0xe31446['converted_duration']=isNaN(_0x3d3434[_0xdbdc('0x65')])?null:_0x3d3434['duration']*0x3e8;_0xe31446[_0xdbdc('0x6c')]=isNaN(_0x3d3434[_0xdbdc('0x67')])?null:_0x3d3434[_0xdbdc('0x67')];_0xe31446[_0xdbdc('0x6d')]=isNaN(_0x3d3434[_0xdbdc('0x68')])?null:_0x3d3434[_0xdbdc('0x68')];_0xe31446[_0xdbdc('0x6e')]=isNaN(_0x3d3434[_0xdbdc('0x69')])?null:_0x3d3434[_0xdbdc('0x69')];_0xe31446[_0xdbdc('0x6f')]=isNaN(_0x3d3434['sampleRate'])?null:_0x3d3434[_0xdbdc('0x6a')];});_0x1643e3['on'](_0xdbdc('0x19'),function(){fs[_0xdbdc('0x70')](_0x391ce2,parseInt(_0xdbdc('0x5f'),0x8));return db[_0xdbdc('0x2d')][_0xdbdc('0x55')](_0xe31446)[_0xdbdc('0x26')](function(_0x221829){var _0x3443c9={'role':_0x450036[_0xdbdc('0x71')][_0xdbdc('0x72')],'userProfileId':_0x450036[_0xdbdc('0x71')]['userProfileId']};if(!_0x3443c9)throw new Error(_0xdbdc('0x73'));if(_0x3443c9[_0xdbdc('0x72')]==='user'){var _0x55c986=_0x221829['get']({'plain':!![]});return db[_0xdbdc('0x74')][_0xdbdc('0x49')]({'where':{'name':_0xdbdc('0x75'),'userProfileId':_0x3443c9[_0xdbdc('0x76')]},'raw':!![]})[_0xdbdc('0x26')](function(_0x1406d6){if(_0x1406d6&&_0x1406d6[_0xdbdc('0x77')]===0x0){return db[_0xdbdc('0x24')][_0xdbdc('0x55')]({'name':_0x55c986[_0xdbdc('0x29')],'resourceId':_0x55c986['id'],'type':_0x1406d6[_0xdbdc('0x29')],'sectionId':_0x1406d6['id']},{})['then'](function(){return _0x221829;});}else{return _0x221829;}})[_0xdbdc('0x45')](function(_0x2e528c){logger[_0xdbdc('0x27')]('Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s',_0x2e528c);throw _0x2e528c;});}return _0x221829;})[_0xdbdc('0x26')](respondWithResult(_0x56684e,null))[_0xdbdc('0x45')](handleError(_0x56684e,null));});_0x1643e3[_0xdbdc('0x78')]();}catch(_0x51e738){_0x56684e['status'](0x1f4)[_0xdbdc('0x2a')](_0x51e738);}};exports[_0xdbdc('0x22')]=function(_0x4fb7c4,_0x3d8581,_0x229fef){return db[_0xdbdc('0x2d')][_0xdbdc('0x49')]({'where':{'id':_0x4fb7c4[_0xdbdc('0x47')]['id']}})[_0xdbdc('0x26')](handleEntityNotFound(_0x3d8581,null))[_0xdbdc('0x26')](saveUpdates(_[_0xdbdc('0x3e')](_0x4fb7c4[_0xdbdc('0x71')],[_0xdbdc('0x29'),'description']),null))['then'](respondWithResult(_0x3d8581,null))[_0xdbdc('0x45')](handleError(_0x3d8581,null));};exports[_0xdbdc('0x79')]=function(_0x10f3df,_0x1462b1,_0x11fbcd){return db[_0xdbdc('0x2d')][_0xdbdc('0x49')]({'where':{'id':_0x10f3df[_0xdbdc('0x47')]['id']}})[_0xdbdc('0x26')](function(_0x9281dd){if(_0x9281dd){return _0x9281dd[_0xdbdc('0x25')]();}})[_0xdbdc('0x26')](function(_0x1c0728){var _0x503a33=path['join'](config[_0xdbdc('0x4d')],_0xdbdc('0x5b'),util[_0xdbdc('0x53')](_0xdbdc('0x54'),_0x1c0728[_0xdbdc('0x4e')],_0x1c0728[_0xdbdc('0x7a')]));var _0x1a5243=path[_0xdbdc('0x51')](config[_0xdbdc('0x4d')],_0xdbdc('0x52'),util[_0xdbdc('0x53')]('%s.%s',_0x1c0728[_0xdbdc('0x4e')],_0x1c0728[_0xdbdc('0x4b')]));fs['unlinkSync'](_0x503a33);fs[_0xdbdc('0x62')](_0x1a5243);return _0x1c0728;})[_0xdbdc('0x26')](function(_0x5ae3a6){if(_0x5ae3a6){return _0x1462b1['status'](0xcc)['end']();}})[_0xdbdc('0x26')](handleEntityNotFound(_0x1462b1,null))[_0xdbdc('0x45')](handleError(_0x1462b1,null));};
\ No newline at end of file
+var _0x2597=['create','basename','file','originalname','extname','filename','wav','root','server/files/sounds/original','info','Sound\x20upload\x20destination:\x20%s','chmodSync','0777','transcode','unlinkSync','src','original_duration','duration','original_sampleCount','sampleCount','original_channelCount','channelCount','original_bitRate','original_sampleRate','dest','converted_duration','converted_bitRate','bitRate','converted_sampleRate','body','userProfileId','Unable\x20to\x20retrieve\x20the\x20current\x20user','role','user','UserProfileSection','autoAssociation','start','description','delete','destroy','original_format','html-pdf','eml-format','rimraf','zip-dir','request-promise','moment','mustache','util','to-csv','ejs','lodash','jsforce','desk.js','querystring','papaparse','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/utils','../../config/environment','../../mysqldb','sendStatus','status','end','count','offset','limit','set','Content-Range','reject','save','update','then','get','Sounds','UserProfileResource','error','stack','name','send','index','map','fieldName','type','model','query','keys','intersection','attributes','fields','length','nolimit','order','sort','filters','pick','filter','where','merge','VIRTUAL','options','Sound','includeAll','include','findAll','rows','catch','show','rawAttributes','find','params','converted_format','server/files/sounds/converted','save_name','ValidationError','download','join','format','%s.%s'];(function(_0x57b54c,_0x54ce0d){var _0x59cc19=function(_0xa33bc6){while(--_0xa33bc6){_0x57b54c['push'](_0x57b54c['shift']());}};_0x59cc19(++_0x54ce0d);}(_0x2597,0xa2));var _0x7259=function(_0xf73c09,_0x4e424e){_0xf73c09=_0xf73c09-0x0;var _0xa8923c=_0x2597[_0xf73c09];return _0xa8923c;};'use strict';var pdf=require(_0x7259('0x0'));var emlformat=require(_0x7259('0x1'));var rimraf=require(_0x7259('0x2'));var zipdir=require(_0x7259('0x3'));var jsonpatch=require('fast-json-patch');var rp=require(_0x7259('0x4'));var moment=require(_0x7259('0x5'));var BPromise=require('bluebird');var Mustache=require(_0x7259('0x6'));var util=require(_0x7259('0x7'));var path=require('path');var sox=require('sox');var csv=require(_0x7259('0x8'));var ejs=require(_0x7259('0x9'));var fs=require('fs');var _=require(_0x7259('0xa'));var squel=require('squel');var crypto=require('crypto');var jsforce=require(_0x7259('0xb'));var deskjs=require(_0x7259('0xc'));var toCsv=require(_0x7259('0x8'));var querystring=require(_0x7259('0xd'));var Papa=require(_0x7259('0xe'));var Redis=require('ioredis');var authService=require(_0x7259('0xf'));var qs=require(_0x7259('0x10'));var as=require(_0x7259('0x11'));var hardwareService=require(_0x7259('0x12'));var logger=require('../../config/logger')('api');var utils=require(_0x7259('0x13'));var config=require(_0x7259('0x14'));var db=require(_0x7259('0x15'))['db'];function respondWithStatusCode(_0x1eda26,_0x45ef67){_0x45ef67=_0x45ef67||0xcc;return function(_0x157c38){if(_0x157c38){return _0x1eda26[_0x7259('0x16')](_0x45ef67);}return _0x1eda26[_0x7259('0x17')](_0x45ef67)[_0x7259('0x18')]();};}function respondWithResult(_0x480401,_0x57d1a9){_0x57d1a9=_0x57d1a9||0xc8;return function(_0xfaf268){if(_0xfaf268){return _0x480401['status'](_0x57d1a9)['json'](_0xfaf268);}};}function respondWithFilteredResult(_0x1d0936,_0x56a1e6){return function(_0x2c808a){if(_0x2c808a){var _0x7c0f59=_0x2c808a[_0x7259('0x19')],_0x3549af=_0x56a1e6[_0x7259('0x1a')],_0x28cdfa=_0x56a1e6[_0x7259('0x1a')]+_0x56a1e6[_0x7259('0x1b')],_0x124c45;if(_0x28cdfa>=_0x7c0f59){_0x28cdfa=_0x7c0f59;_0x124c45=0xc8;}else{_0x124c45=0xce;}_0x1d0936[_0x7259('0x17')](_0x124c45);return _0x1d0936[_0x7259('0x1c')](_0x7259('0x1d'),_0x3549af+'-'+_0x28cdfa+'/'+_0x7c0f59)['json'](_0x2c808a);}return null;};}function patchUpdates(_0x25a157){return function(_0x274e1c){try{jsonpatch['apply'](_0x274e1c,_0x25a157,!![]);}catch(_0x2e7d70){return BPromise[_0x7259('0x1e')](_0x2e7d70);}return _0x274e1c[_0x7259('0x1f')]();};}function saveUpdates(_0x164eb7,_0x5296b6){return function(_0x45f443){if(_0x45f443){return _0x45f443[_0x7259('0x20')](_0x164eb7)[_0x7259('0x21')](function(_0x4741a9){return _0x4741a9;});}return null;};}function removeEntity(_0x56ea03,_0x3256a6){return function(_0x3e6d5b){if(_0x3e6d5b){return _0x3e6d5b['destroy']()[_0x7259('0x21')](function(){var _0x14e62b=_0x3e6d5b[_0x7259('0x22')]({'plain':!![]});var _0x3106b4=_0x7259('0x23');return db[_0x7259('0x24')]['destroy']({'where':{'type':_0x3106b4,'resourceId':_0x14e62b['id']}})[_0x7259('0x21')](function(){return _0x3e6d5b;});})[_0x7259('0x21')](function(){_0x56ea03[_0x7259('0x17')](0xcc)[_0x7259('0x18')]();});}};}function handleEntityNotFound(_0x196134,_0x558037){return function(_0x2393f6){if(!_0x2393f6){_0x196134[_0x7259('0x16')](0x194);}return _0x2393f6;};}function handleError(_0x4d70e3,_0x4dc42e){_0x4dc42e=_0x4dc42e||0x1f4;return function(_0x573576){logger[_0x7259('0x25')](_0x573576[_0x7259('0x26')]);if(_0x573576[_0x7259('0x27')]){delete _0x573576[_0x7259('0x27')];}_0x4d70e3[_0x7259('0x17')](_0x4dc42e)[_0x7259('0x28')](_0x573576);};}exports[_0x7259('0x29')]=function(_0x3e61ff,_0x56f613){var _0x487d1f={},_0x1aa869={},_0x3a2fdb={'count':0x0,'rows':[]};var _0xdfba1a=_[_0x7259('0x2a')](db['Sound']['rawAttributes'],function(_0x5eb18a){return{'name':_0x5eb18a[_0x7259('0x2b')],'type':_0x5eb18a[_0x7259('0x2c')]['key']};});_0x1aa869[_0x7259('0x2d')]=_['map'](_0xdfba1a,_0x7259('0x27'));_0x1aa869[_0x7259('0x2e')]=_[_0x7259('0x2f')](_0x3e61ff['query']);_0x1aa869['filters']=_[_0x7259('0x30')](_0x1aa869['model'],_0x1aa869['query']);_0x487d1f[_0x7259('0x31')]=_['intersection'](_0x1aa869['model'],qs[_0x7259('0x32')](_0x3e61ff[_0x7259('0x2e')]['fields']));_0x487d1f['attributes']=_0x487d1f['attributes'][_0x7259('0x33')]?_0x487d1f[_0x7259('0x31')]:_0x1aa869[_0x7259('0x2d')];if(!_0x3e61ff[_0x7259('0x2e')]['hasOwnProperty'](_0x7259('0x34'))){_0x487d1f[_0x7259('0x1b')]=qs[_0x7259('0x1b')](_0x3e61ff['query'][_0x7259('0x1b')]);_0x487d1f[_0x7259('0x1a')]=qs[_0x7259('0x1a')](_0x3e61ff['query']['offset']);}_0x487d1f[_0x7259('0x35')]=qs[_0x7259('0x36')](_0x3e61ff[_0x7259('0x2e')]['sort']);_0x487d1f['where']=qs[_0x7259('0x37')](_[_0x7259('0x38')](_0x3e61ff[_0x7259('0x2e')],_0x1aa869[_0x7259('0x37')]));if(_0x3e61ff[_0x7259('0x2e')][_0x7259('0x39')]){_0x487d1f[_0x7259('0x3a')]=_[_0x7259('0x3b')](_0x487d1f[_0x7259('0x3a')],{'$or':_['map'](_0xdfba1a,function(_0x1323c0){if(_0x1323c0[_0x7259('0x2c')]!==_0x7259('0x3c')){var _0x47c391={};_0x47c391[_0x1323c0['name']]={'$like':'%'+_0x3e61ff[_0x7259('0x2e')][_0x7259('0x39')]+'%'};return _0x47c391;}})});}_0x487d1f=_[_0x7259('0x3b')]({},_0x487d1f,_0x3e61ff[_0x7259('0x3d')]);var _0x120487={'where':_0x487d1f[_0x7259('0x3a')]};return db[_0x7259('0x3e')][_0x7259('0x19')](_0x120487)['then'](function(_0x26a452){_0x3a2fdb[_0x7259('0x19')]=_0x26a452;if(_0x3e61ff[_0x7259('0x2e')][_0x7259('0x3f')]){_0x487d1f[_0x7259('0x40')]=[{'all':!![]}];}return db[_0x7259('0x3e')][_0x7259('0x41')](_0x487d1f);})[_0x7259('0x21')](function(_0x2074d7){_0x3a2fdb[_0x7259('0x42')]=_0x2074d7;return _0x3a2fdb;})[_0x7259('0x21')](respondWithFilteredResult(_0x56f613,_0x487d1f))[_0x7259('0x43')](handleError(_0x56f613,null));};exports[_0x7259('0x44')]=function(_0x3267b4,_0x457cd3){var _0x3b01d5={'raw':!![],'where':{'id':_0x3267b4['params']['id']}},_0x2ba88d={};_0x2ba88d[_0x7259('0x2d')]=_[_0x7259('0x2f')](db[_0x7259('0x3e')][_0x7259('0x45')]);_0x2ba88d[_0x7259('0x2e')]=_[_0x7259('0x2f')](_0x3267b4[_0x7259('0x2e')]);_0x2ba88d[_0x7259('0x37')]=_[_0x7259('0x30')](_0x2ba88d['model'],_0x2ba88d[_0x7259('0x2e')]);_0x3b01d5[_0x7259('0x31')]=_[_0x7259('0x30')](_0x2ba88d[_0x7259('0x2d')],qs['fields'](_0x3267b4[_0x7259('0x2e')]['fields']));_0x3b01d5[_0x7259('0x31')]=_0x3b01d5[_0x7259('0x31')][_0x7259('0x33')]?_0x3b01d5[_0x7259('0x31')]:_0x2ba88d['model'];if(_0x3267b4[_0x7259('0x2e')][_0x7259('0x3f')]){_0x3b01d5[_0x7259('0x40')]=[{'all':!![]}];}_0x3b01d5=_[_0x7259('0x3b')]({},_0x3b01d5,_0x3267b4[_0x7259('0x3d')]);return db[_0x7259('0x3e')][_0x7259('0x46')](_0x3b01d5)[_0x7259('0x21')](handleEntityNotFound(_0x457cd3,null))[_0x7259('0x21')](respondWithResult(_0x457cd3,null))[_0x7259('0x43')](handleError(_0x457cd3,null));};exports['download']=function(_0x430552,_0x14babb,_0x22cd2e){return db[_0x7259('0x3e')][_0x7259('0x46')]({'where':{'id':_0x430552[_0x7259('0x47')]['id']},'attributes':[_0x7259('0x27'),'save_name',_0x7259('0x48')],'raw':!![]})[_0x7259('0x21')](handleEntityNotFound(_0x14babb,null))[_0x7259('0x21')](function(_0x87c373){if(_0x87c373){if(!fs['existsSync'](path['join'](config['root'],_0x7259('0x49'),_0x87c373[_0x7259('0x4a')]+'.'+_0x87c373['converted_format']))){throw new db['Sequelize'][(_0x7259('0x4b'))]('Sound\x20not\x20found');}return _0x14babb[_0x7259('0x4c')](path[_0x7259('0x4d')](config['root'],_0x7259('0x49'),util[_0x7259('0x4e')](_0x7259('0x4f'),_0x87c373[_0x7259('0x4a')],_0x87c373[_0x7259('0x48')])),util[_0x7259('0x4e')](_0x7259('0x4f'),_0x87c373[_0x7259('0x27')],_0x87c373[_0x7259('0x48')]));}return null;})[_0x7259('0x43')](handleError(_0x14babb,null));};exports[_0x7259('0x50')]=function(_0x313363,_0x2605a9,_0x24a912){var _0x2dd70d={'name':path[_0x7259('0x51')](_0x313363[_0x7259('0x52')][_0x7259('0x53')],path[_0x7259('0x54')](_0x313363[_0x7259('0x52')][_0x7259('0x53')])),'save_name':path['basename'](_0x313363[_0x7259('0x52')]['filename'],path[_0x7259('0x54')](_0x313363['file'][_0x7259('0x55')])),'original_format':path['extname'](_0x313363[_0x7259('0x52')][_0x7259('0x53')])['substring'](0x1),'converted_format':_0x7259('0x56')};var _0x508dbd=path[_0x7259('0x4d')](config[_0x7259('0x57')],_0x7259('0x58'),_0x313363[_0x7259('0x52')][_0x7259('0x55')]);var _0x100767=path[_0x7259('0x4d')](config[_0x7259('0x57')],_0x7259('0x49'),util[_0x7259('0x4e')]('%s.%s',path[_0x7259('0x51')](_0x313363[_0x7259('0x52')][_0x7259('0x55')],path[_0x7259('0x54')](_0x313363[_0x7259('0x52')][_0x7259('0x55')])),_0x2dd70d[_0x7259('0x48')]));logger[_0x7259('0x59')]('Sound\x20upload\x20filepath:\x20%s',_0x508dbd);logger[_0x7259('0x59')](_0x7259('0x5a'),_0x100767);try{fs[_0x7259('0x5b')](_0x508dbd,parseInt(_0x7259('0x5c'),0x8));var _0x1aa53b=sox[_0x7259('0x5d')](_0x508dbd,_0x100767,{'sampleRate':0x1f40,'format':_0x7259('0x56'),'channelCount':0x1,'bitRate':0xc0*0x400,'compressionQuality':0x5});_0x1aa53b['on'](_0x7259('0x25'),function(_0x53923a){fs[_0x7259('0x5e')](_0x508dbd);_0x2605a9[_0x7259('0x17')](0x1f4)[_0x7259('0x28')](_0x53923a);});_0x1aa53b['on'](_0x7259('0x5f'),function(_0x5c0aed){_0x2dd70d[_0x7259('0x60')]=isNaN(_0x5c0aed[_0x7259('0x61')])?null:_0x5c0aed['duration']*0x3e8;_0x2dd70d[_0x7259('0x62')]=isNaN(_0x5c0aed['sampleCount'])?null:_0x5c0aed[_0x7259('0x63')];_0x2dd70d[_0x7259('0x64')]=isNaN(_0x5c0aed[_0x7259('0x65')])?null:_0x5c0aed[_0x7259('0x65')];_0x2dd70d[_0x7259('0x66')]=isNaN(_0x5c0aed['bitRate'])?null:_0x5c0aed['bitRate'];_0x2dd70d[_0x7259('0x67')]=isNaN(_0x5c0aed['sampleRate'])?null:_0x5c0aed['sampleRate'];});_0x1aa53b['on'](_0x7259('0x68'),function(_0x518512){_0x2dd70d[_0x7259('0x69')]=isNaN(_0x518512[_0x7259('0x61')])?null:_0x518512['duration']*0x3e8;_0x2dd70d['converted_sampleCount']=isNaN(_0x518512['sampleCount'])?null:_0x518512[_0x7259('0x63')];_0x2dd70d['converted_channelCount']=isNaN(_0x518512[_0x7259('0x65')])?null:_0x518512[_0x7259('0x65')];_0x2dd70d[_0x7259('0x6a')]=isNaN(_0x518512[_0x7259('0x6b')])?null:_0x518512[_0x7259('0x6b')];_0x2dd70d[_0x7259('0x6c')]=isNaN(_0x518512['sampleRate'])?null:_0x518512['sampleRate'];});_0x1aa53b['on'](_0x7259('0x18'),function(){fs[_0x7259('0x5b')](_0x100767,parseInt(_0x7259('0x5c'),0x8));return db[_0x7259('0x3e')][_0x7259('0x50')](_0x2dd70d)[_0x7259('0x21')](function(_0x22054b){var _0x31c83a={'role':_0x313363[_0x7259('0x6d')]['role'],'userProfileId':_0x313363[_0x7259('0x6d')][_0x7259('0x6e')]};if(!_0x31c83a)throw new Error(_0x7259('0x6f'));if(_0x31c83a[_0x7259('0x70')]===_0x7259('0x71')){var _0x1b91c9=_0x22054b[_0x7259('0x22')]({'plain':!![]});return db[_0x7259('0x72')][_0x7259('0x46')]({'where':{'name':_0x7259('0x23'),'userProfileId':_0x31c83a['userProfileId']},'raw':!![]})[_0x7259('0x21')](function(_0x22ab67){if(_0x22ab67&&_0x22ab67[_0x7259('0x73')]===0x0){return db['UserProfileResource'][_0x7259('0x50')]({'name':_0x1b91c9[_0x7259('0x27')],'resourceId':_0x1b91c9['id'],'type':_0x22ab67[_0x7259('0x27')],'sectionId':_0x22ab67['id']},{})[_0x7259('0x21')](function(){return _0x22054b;});}else{return _0x22054b;}})[_0x7259('0x43')](function(_0x31fd43){logger['error']('Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s',_0x31fd43);throw _0x31fd43;});}return _0x22054b;})[_0x7259('0x21')](respondWithResult(_0x2605a9,null))['catch'](handleError(_0x2605a9,null));});_0x1aa53b[_0x7259('0x74')]();}catch(_0x45e824){_0x2605a9[_0x7259('0x17')](0x1f4)[_0x7259('0x28')](_0x45e824);}};exports['update']=function(_0x228650,_0x429f21,_0x49b45e){return db[_0x7259('0x3e')][_0x7259('0x46')]({'where':{'id':_0x228650[_0x7259('0x47')]['id']}})['then'](handleEntityNotFound(_0x429f21,null))[_0x7259('0x21')](saveUpdates(_[_0x7259('0x38')](_0x228650['body'],['name',_0x7259('0x75')]),null))['then'](respondWithResult(_0x429f21,null))[_0x7259('0x43')](handleError(_0x429f21,null));};exports[_0x7259('0x76')]=function(_0x3cbf1e,_0x232ade,_0x249174){return db['Sound'][_0x7259('0x46')]({'where':{'id':_0x3cbf1e[_0x7259('0x47')]['id']}})['then'](function(_0x1e91bc){if(_0x1e91bc){return _0x1e91bc[_0x7259('0x77')]();}})[_0x7259('0x21')](function(_0x32a398){var _0x135a69=path[_0x7259('0x4d')](config[_0x7259('0x57')],_0x7259('0x58'),util[_0x7259('0x4e')]('%s.%s',_0x32a398[_0x7259('0x4a')],_0x32a398[_0x7259('0x78')]));var _0x1a259f=path[_0x7259('0x4d')](config[_0x7259('0x57')],_0x7259('0x49'),util[_0x7259('0x4e')]('%s.%s',_0x32a398['save_name'],_0x32a398[_0x7259('0x48')]));fs[_0x7259('0x5e')](_0x135a69);fs['unlinkSync'](_0x1a259f);return _0x32a398;})[_0x7259('0x21')](function(_0x21d307){if(_0x21d307){return _0x232ade[_0x7259('0x17')](0xcc)[_0x7259('0x18')]();}})[_0x7259('0x21')](handleEntityNotFound(_0x232ade,null))['catch'](handleError(_0x232ade,null));};
\ No newline at end of file
diff --git a/server/api/sound/sound.model.js b/server/api/sound/sound.model.js
index b5c567a..dde7530 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 _0x2979=['rimraf','../../config/environment','./sound.attributes','define','tools_sounds','lodash','util','../../config/logger','api','request-promise'];(function(_0xc4001c,_0x1bf8f0){var _0x49f7bc=function(_0x1059b8){while(--_0x1059b8){_0xc4001c['push'](_0xc4001c['shift']());}};_0x49f7bc(++_0x1bf8f0);}(_0x2979,0x1e5));var _0x9297=function(_0x411bd1,_0x416106){_0x411bd1=_0x411bd1-0x0;var _0x320464=_0x2979[_0x411bd1];return _0x320464;};'use strict';var _=require(_0x9297('0x0'));var util=require(_0x9297('0x1'));var logger=require(_0x9297('0x2'))(_0x9297('0x3'));var moment=require('moment');var BPromise=require('bluebird');var rp=require(_0x9297('0x4'));var fs=require('fs');var path=require('path');var rimraf=require(_0x9297('0x5'));var config=require(_0x9297('0x6'));var attributes=require(_0x9297('0x7'));module['exports']=function(_0x501b99,_0x258b47){return _0x501b99[_0x9297('0x8')]('Sound',attributes,{'tableName':_0x9297('0x9'),'paranoid':![],'indexes':[],'timestamps':!![]});};
\ No newline at end of file
+var _0x1545=['exports','Sound','tools_sounds','../../config/logger','api','bluebird','path','rimraf','../../config/environment','./sound.attributes'];(function(_0x56e1f1,_0x433412){var _0x5a7b9d=function(_0x13248b){while(--_0x13248b){_0x56e1f1['push'](_0x56e1f1['shift']());}};_0x5a7b9d(++_0x433412);}(_0x1545,0xd5));var _0x5154=function(_0x23e207,_0x34850b){_0x23e207=_0x23e207-0x0;var _0x2e25fa=_0x1545[_0x23e207];return _0x2e25fa;};'use strict';var _=require('lodash');var util=require('util');var logger=require(_0x5154('0x0'))(_0x5154('0x1'));var moment=require('moment');var BPromise=require(_0x5154('0x2'));var rp=require('request-promise');var fs=require('fs');var path=require(_0x5154('0x3'));var rimraf=require(_0x5154('0x4'));var config=require(_0x5154('0x5'));var attributes=require(_0x5154('0x6'));module[_0x5154('0x7')]=function(_0x1c30ed,_0x843f2c){return _0x1c30ed['define'](_0x5154('0x8'),attributes,{'tableName':_0x5154('0x9'),'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 5628e3e..3ac1376 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 _0x865e=['find','options','where','attributes','map','include','model','ShowSound','catch','lodash','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','client','request','then','info','Sound,\x20%s,\x20%s','debug','Sound,\x20%s,\x20%s,\x20%s','stringify','error','message','Sound'];(function(_0x8854f2,_0x79542c){var _0x38505d=function(_0x5af02b){while(--_0x5af02b){_0x8854f2['push'](_0x8854f2['shift']());}};_0x38505d(++_0x79542c);}(_0x865e,0x19c));var _0xe865=function(_0xc4001c,_0x1bf8f0){_0xc4001c=_0xc4001c-0x0;var _0x49f7bc=_0x865e[_0xc4001c];return _0x49f7bc;};'use strict';var _=require(_0xe865('0x0'));var util=require('util');var moment=require(_0xe865('0x1'));var BPromise=require(_0xe865('0x2'));var rs=require(_0xe865('0x3'));var fs=require('fs');var Redis=require(_0xe865('0x4'));var db=require(_0xe865('0x5'))['db'];var utils=require(_0xe865('0x6'));var logger=require(_0xe865('0x7'))(_0xe865('0x8'));var config=require(_0xe865('0x9'));var jayson=require(_0xe865('0xa'));var client=jayson[_0xe865('0xb')]['http']({'port':0x232a});function respondWithRpcPromise(_0x1bc92e,_0x28954f,_0x3c5bb1){return new BPromise(function(_0x2f27f8,_0x3d18af){return client[_0xe865('0xc')](_0x1bc92e,_0x3c5bb1)[_0xe865('0xd')](function(_0x49f3f1){logger[_0xe865('0xe')](_0xe865('0xf'),_0x28954f,'request\x20sent');logger[_0xe865('0x10')](_0xe865('0x11'),_0x28954f,'request\x20sent',JSON[_0xe865('0x12')](_0x49f3f1));if(_0x49f3f1['error']){if(_0x49f3f1[_0xe865('0x13')]['code']===0x1f4){logger['error'](_0xe865('0xf'),_0x28954f,_0x49f3f1['error'][_0xe865('0x14')]);return _0x3d18af(_0x49f3f1[_0xe865('0x13')]['message']);}logger[_0xe865('0x13')](_0xe865('0xf'),_0x28954f,_0x49f3f1[_0xe865('0x13')][_0xe865('0x14')]);return _0x2f27f8(_0x49f3f1[_0xe865('0x13')]['message']);}else{logger['info'](_0xe865('0xf'),_0x28954f,'request\x20sent');_0x2f27f8(_0x49f3f1['result']['message']);}})['catch'](function(_0x4a0055){logger['error'](_0xe865('0xf'),_0x28954f,_0x4a0055);_0x3d18af(_0x4a0055);});});}exports['ShowSound']=function(_0x118def){var _0x1e9510=this;return new Promise(function(_0x392a86,_0x192657){return db[_0xe865('0x15')][_0xe865('0x16')]({'raw':_0x118def[_0xe865('0x17')]?_0x118def[_0xe865('0x17')]['raw']===undefined?!![]:![]:!![],'where':_0x118def[_0xe865('0x17')]?_0x118def[_0xe865('0x17')][_0xe865('0x18')]||null:null,'attributes':_0x118def[_0xe865('0x17')]?_0x118def[_0xe865('0x17')][_0xe865('0x19')]||null:null,'include':_0x118def[_0xe865('0x17')]?_0x118def[_0xe865('0x17')]['include']?_[_0xe865('0x1a')](_0x118def[_0xe865('0x17')][_0xe865('0x1b')],function(_0xeee315){return{'model':db[_0xeee315[_0xe865('0x1c')]],'as':_0xeee315['as'],'attributes':_0xeee315[_0xe865('0x19')],'include':_0xeee315['include']?_['map'](_0xeee315[_0xe865('0x1b')],function(_0x4ed4e4){return{'model':db[_0x4ed4e4['model']],'as':_0x4ed4e4['as'],'attributes':_0x4ed4e4[_0xe865('0x19')],'include':_0x4ed4e4[_0xe865('0x1b')]?_[_0xe865('0x1a')](_0x4ed4e4[_0xe865('0x1b')],function(_0x13bc00){return{'model':db[_0x13bc00['model']],'as':_0x13bc00['as'],'attributes':_0x13bc00[_0xe865('0x19')]};}):[]};}):[]};}):[]:[]})[_0xe865('0xd')](function(_0x5b22b5){logger[_0xe865('0xe')](_0xe865('0x1d'),_0x118def);logger[_0xe865('0x10')](_0xe865('0x1d'),_0x118def,JSON[_0xe865('0x12')](_0x5b22b5));_0x392a86(_0x5b22b5);})[_0xe865('0x1e')](function(_0x12e07e){logger[_0xe865('0x13')]('ShowSound',_0x12e07e['message'],_0x118def);_0x192657(_0x1e9510['error'](0x1f4,_0x12e07e[_0xe865('0x14')]));});});};
\ No newline at end of file
+var _0x8892=['Sound,\x20%s,\x20%s','request\x20sent','debug','Sound,\x20%s,\x20%s,\x20%s','code','error','message','result','catch','find','options','raw','where','include','map','model','attributes','ShowSound','stringify','lodash','util','randomstring','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','client','request','then','info'];(function(_0x1f8715,_0x4e4551){var _0x3d0f3e=function(_0x4008eb){while(--_0x4008eb){_0x1f8715['push'](_0x1f8715['shift']());}};_0x3d0f3e(++_0x4e4551);}(_0x8892,0xcd));var _0x2889=function(_0x2adf22,_0x3d015a){_0x2adf22=_0x2adf22-0x0;var _0x5ac621=_0x8892[_0x2adf22];return _0x5ac621;};'use strict';var _=require(_0x2889('0x0'));var util=require(_0x2889('0x1'));var moment=require('moment');var BPromise=require('bluebird');var rs=require(_0x2889('0x2'));var fs=require('fs');var Redis=require('ioredis');var db=require('../../mysqldb')['db'];var utils=require(_0x2889('0x3'));var logger=require(_0x2889('0x4'))(_0x2889('0x5'));var config=require(_0x2889('0x6'));var jayson=require(_0x2889('0x7'));var client=jayson[_0x2889('0x8')]['http']({'port':0x232a});function respondWithRpcPromise(_0x3d472e,_0x247048,_0x2d1f32){return new BPromise(function(_0x238c45,_0x599906){return client[_0x2889('0x9')](_0x3d472e,_0x2d1f32)[_0x2889('0xa')](function(_0x26db1d){logger[_0x2889('0xb')](_0x2889('0xc'),_0x247048,_0x2889('0xd'));logger[_0x2889('0xe')](_0x2889('0xf'),_0x247048,_0x2889('0xd'),JSON['stringify'](_0x26db1d));if(_0x26db1d['error']){if(_0x26db1d['error'][_0x2889('0x10')]===0x1f4){logger[_0x2889('0x11')]('Sound,\x20%s,\x20%s',_0x247048,_0x26db1d[_0x2889('0x11')][_0x2889('0x12')]);return _0x599906(_0x26db1d['error'][_0x2889('0x12')]);}logger['error']('Sound,\x20%s,\x20%s',_0x247048,_0x26db1d[_0x2889('0x11')]['message']);return _0x238c45(_0x26db1d[_0x2889('0x11')][_0x2889('0x12')]);}else{logger['info'](_0x2889('0xc'),_0x247048,_0x2889('0xd'));_0x238c45(_0x26db1d[_0x2889('0x13')]['message']);}})[_0x2889('0x14')](function(_0x42aa2c){logger[_0x2889('0x11')](_0x2889('0xc'),_0x247048,_0x42aa2c);_0x599906(_0x42aa2c);});});}exports['ShowSound']=function(_0x37ef53){var _0xcfb599=this;return new Promise(function(_0x39d85a,_0x24cafc){return db['Sound'][_0x2889('0x15')]({'raw':_0x37ef53[_0x2889('0x16')]?_0x37ef53[_0x2889('0x16')][_0x2889('0x17')]===undefined?!![]:![]:!![],'where':_0x37ef53['options']?_0x37ef53[_0x2889('0x16')][_0x2889('0x18')]||null:null,'attributes':_0x37ef53['options']?_0x37ef53['options']['attributes']||null:null,'include':_0x37ef53[_0x2889('0x16')]?_0x37ef53[_0x2889('0x16')][_0x2889('0x19')]?_[_0x2889('0x1a')](_0x37ef53[_0x2889('0x16')][_0x2889('0x19')],function(_0x46a92c){return{'model':db[_0x46a92c[_0x2889('0x1b')]],'as':_0x46a92c['as'],'attributes':_0x46a92c[_0x2889('0x1c')],'include':_0x46a92c['include']?_[_0x2889('0x1a')](_0x46a92c[_0x2889('0x19')],function(_0x40a43c){return{'model':db[_0x40a43c[_0x2889('0x1b')]],'as':_0x40a43c['as'],'attributes':_0x40a43c[_0x2889('0x1c')],'include':_0x40a43c[_0x2889('0x19')]?_['map'](_0x40a43c[_0x2889('0x19')],function(_0x4739cd){return{'model':db[_0x4739cd[_0x2889('0x1b')]],'as':_0x4739cd['as'],'attributes':_0x4739cd[_0x2889('0x1c')]};}):[]};}):[]};}):[]:[]})[_0x2889('0xa')](function(_0x1aa67d){logger['info'](_0x2889('0x1d'),_0x37ef53);logger['debug'](_0x2889('0x1d'),_0x37ef53,JSON[_0x2889('0x1e')](_0x1aa67d));_0x39d85a(_0x1aa67d);})['catch'](function(_0x127511){logger[_0x2889('0x11')](_0x2889('0x1d'),_0x127511[_0x2889('0x12')],_0x37ef53);_0x24cafc(_0xcfb599[_0x2889('0x11')](0x1f4,_0x127511[_0x2889('0x12')]));});});};
\ No newline at end of file
diff --git a/server/api/squareMessage/index.js b/server/api/squareMessage/index.js
index fc39209..b6f7270 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 _0x4ebd=['express','Router','../../components/auth/service','../../config/environment','get','index','show','post','/:id','isAuthenticated','update','delete','destroy','exports','multer','util','connect-timeout'];(function(_0x1613fe,_0x90d87){var _0x4f1cd7=function(_0x48b739){while(--_0x48b739){_0x1613fe['push'](_0x1613fe['shift']());}};_0x4f1cd7(++_0x90d87);}(_0x4ebd,0xeb));var _0xd4eb=function(_0x45f236,_0x565a8b){_0x45f236=_0x45f236-0x0;var _0x1e575b=_0x4ebd[_0x45f236];return _0x1e575b;};'use strict';var multer=require(_0xd4eb('0x0'));var util=require(_0xd4eb('0x1'));var path=require('path');var timeout=require(_0xd4eb('0x2'));var express=require(_0xd4eb('0x3'));var router=express[_0xd4eb('0x4')]();var auth=require(_0xd4eb('0x5'));var interaction=require('../../components/interaction/service');var config=require(_0xd4eb('0x6'));var controller=require('./squareMessage.controller');router[_0xd4eb('0x7')]('/',auth['isAuthenticated'](),controller[_0xd4eb('0x8')]);router['get']('/:id',auth['isAuthenticated'](),controller[_0xd4eb('0x9')]);router[_0xd4eb('0xa')]('/',auth['isAuthenticated'](),controller['create']);router['put'](_0xd4eb('0xb'),auth[_0xd4eb('0xc')](),controller[_0xd4eb('0xd')]);router[_0xd4eb('0xe')](_0xd4eb('0xb'),auth[_0xd4eb('0xc')](),controller[_0xd4eb('0xf')]);module[_0xd4eb('0x10')]=router;
\ No newline at end of file
+var _0x109e=['index','/:id','isAuthenticated','show','post','create','put','delete','destroy','exports','multer','util','path','connect-timeout','../../components/auth/service','../../components/interaction/service','../../config/environment','./squareMessage.controller','get'];(function(_0x4e28ab,_0x56e54d){var _0x4f3307=function(_0x30f822){while(--_0x30f822){_0x4e28ab['push'](_0x4e28ab['shift']());}};_0x4f3307(++_0x56e54d);}(_0x109e,0xb5));var _0xe109=function(_0x28e6f6,_0x17d049){_0x28e6f6=_0x28e6f6-0x0;var _0x210cf6=_0x109e[_0x28e6f6];return _0x210cf6;};'use strict';var multer=require(_0xe109('0x0'));var util=require(_0xe109('0x1'));var path=require(_0xe109('0x2'));var timeout=require(_0xe109('0x3'));var express=require('express');var router=express['Router']();var auth=require(_0xe109('0x4'));var interaction=require(_0xe109('0x5'));var config=require(_0xe109('0x6'));var controller=require(_0xe109('0x7'));router[_0xe109('0x8')]('/',auth['isAuthenticated'](),controller[_0xe109('0x9')]);router[_0xe109('0x8')](_0xe109('0xa'),auth[_0xe109('0xb')](),controller[_0xe109('0xc')]);router[_0xe109('0xd')]('/',auth[_0xe109('0xb')](),controller[_0xe109('0xe')]);router[_0xe109('0xf')](_0xe109('0xa'),auth[_0xe109('0xb')](),controller['update']);router[_0xe109('0x10')]('/:id',auth['isAuthenticated'](),controller[_0xe109('0x11')]);module[_0xe109('0x12')]=router;
\ No newline at end of file
diff --git a/server/api/squareMessage/squareMessage.attributes.js b/server/api/squareMessage/squareMessage.attributes.js
index 7996c7d..d9efb36 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 _0x8185=['out','sequelize','exports','STRING','medium'];(function(_0x48dad3,_0x143c09){var _0x13eabc=function(_0x5e7bc3){while(--_0x5e7bc3){_0x48dad3['push'](_0x48dad3['shift']());}};_0x13eabc(++_0x143c09);}(_0x8185,0xa6));var _0x5818=function(_0x5d2803,_0xf375bd){_0x5d2803=_0x5d2803-0x0;var _0xdcad2c=_0x8185[_0x5d2803];return _0xdcad2c;};'use strict';var Sequelize=require(_0x5818('0x0'));module[_0x5818('0x1')]={'uniqueid':{'type':Sequelize[_0x5818('0x2')]},'body':{'type':Sequelize['TEXT'](_0x5818('0x3')),'allowNull':![]},'direction':{'type':Sequelize['ENUM']('in',_0x5818('0x4')),'defaultValue':_0x5818('0x4'),'allowNull':![]}};
\ No newline at end of file
+var _0x9d9e=['medium','ENUM','out','sequelize','exports','TEXT'];(function(_0x3ea6e8,_0x2b1edf){var _0x1acb28=function(_0x2eb386){while(--_0x2eb386){_0x3ea6e8['push'](_0x3ea6e8['shift']());}};_0x1acb28(++_0x2b1edf);}(_0x9d9e,0x189));var _0xe9d9=function(_0x20352e,_0x1ee2ac){_0x20352e=_0x20352e-0x0;var _0x5a9319=_0x9d9e[_0x20352e];return _0x5a9319;};'use strict';var Sequelize=require(_0xe9d9('0x0'));module[_0xe9d9('0x1')]={'uniqueid':{'type':Sequelize['STRING']},'body':{'type':Sequelize[_0xe9d9('0x2')](_0xe9d9('0x3')),'allowNull':![]},'direction':{'type':Sequelize[_0xe9d9('0x4')]('in',_0xe9d9('0x5')),'defaultValue':_0xe9d9('0x5'),'allowNull':![]}};
\ No newline at end of file
diff --git a/server/api/squareMessage/squareMessage.controller.js b/server/api/squareMessage/squareMessage.controller.js
index 3954dd2..f4c5d94 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 _0x1f93=['../../components/auth/service','../../components/parsers/qs','../../config/license/hardware','api','../../config/utils','../../mysqldb','sendStatus','end','status','json','count','offset','limit','Content-Range','apply','reject','update','then','error','stack','name','send','index','map','SquareMessage','rawAttributes','type','key','model','query','keys','filters','intersection','attributes','fields','length','hasOwnProperty','order','sort','pick','where','VIRTUAL','filter','merge','options','includeAll','include','findAll','rows','show','params','catch','create','body','find','html-pdf','zip-dir','fast-json-patch','request-promise','moment','bluebird','mustache','util','to-csv','ejs','lodash','squel','crypto','jsforce','desk.js','querystring','papaparse','ioredis'];(function(_0x126558,_0x143c9a){var _0x1f6d14=function(_0x2b0eea){while(--_0x2b0eea){_0x126558['push'](_0x126558['shift']());}};_0x1f6d14(++_0x143c9a);}(_0x1f93,0x112));var _0x31f9=function(_0x2fced0,_0x1c89c9){_0x2fced0=_0x2fced0-0x0;var _0x35acd9=_0x1f93[_0x2fced0];return _0x35acd9;};'use strict';var pdf=require(_0x31f9('0x0'));var emlformat=require('eml-format');var rimraf=require('rimraf');var zipdir=require(_0x31f9('0x1'));var jsonpatch=require(_0x31f9('0x2'));var rp=require(_0x31f9('0x3'));var moment=require(_0x31f9('0x4'));var BPromise=require(_0x31f9('0x5'));var Mustache=require(_0x31f9('0x6'));var util=require(_0x31f9('0x7'));var path=require('path');var sox=require('sox');var csv=require(_0x31f9('0x8'));var ejs=require(_0x31f9('0x9'));var fs=require('fs');var _=require(_0x31f9('0xa'));var squel=require(_0x31f9('0xb'));var crypto=require(_0x31f9('0xc'));var jsforce=require(_0x31f9('0xd'));var deskjs=require(_0x31f9('0xe'));var toCsv=require(_0x31f9('0x8'));var querystring=require(_0x31f9('0xf'));var Papa=require(_0x31f9('0x10'));var Redis=require(_0x31f9('0x11'));var authService=require(_0x31f9('0x12'));var qs=require(_0x31f9('0x13'));var as=require('../../components/parsers/advancedSearch');var hardwareService=require(_0x31f9('0x14'));var logger=require('../../config/logger')(_0x31f9('0x15'));var utils=require(_0x31f9('0x16'));var config=require('../../config/environment');var db=require(_0x31f9('0x17'))['db'];function respondWithStatusCode(_0x523d6b,_0x3600a0){_0x3600a0=_0x3600a0||0xcc;return function(_0x3e1dc6){if(_0x3e1dc6){return _0x523d6b[_0x31f9('0x18')](_0x3600a0);}return _0x523d6b['status'](_0x3600a0)[_0x31f9('0x19')]();};}function respondWithResult(_0x110db4,_0x5d2a67){_0x5d2a67=_0x5d2a67||0xc8;return function(_0x56ff1d){if(_0x56ff1d){return _0x110db4[_0x31f9('0x1a')](_0x5d2a67)[_0x31f9('0x1b')](_0x56ff1d);}};}function respondWithFilteredResult(_0x2464ac,_0x46aabd){return function(_0x176118){if(_0x176118){var _0xecd017=_0x176118[_0x31f9('0x1c')],_0xf25a76=_0x46aabd[_0x31f9('0x1d')],_0x523af8=_0x46aabd[_0x31f9('0x1d')]+_0x46aabd[_0x31f9('0x1e')],_0x2ea8e2;if(_0x523af8>=_0xecd017){_0x523af8=_0xecd017;_0x2ea8e2=0xc8;}else{_0x2ea8e2=0xce;}_0x2464ac[_0x31f9('0x1a')](_0x2ea8e2);return _0x2464ac['set'](_0x31f9('0x1f'),_0xf25a76+'-'+_0x523af8+'/'+_0xecd017)['json'](_0x176118);}return null;};}function patchUpdates(_0x538de6){return function(_0x2346de){try{jsonpatch[_0x31f9('0x20')](_0x2346de,_0x538de6,!![]);}catch(_0x3f7d0a){return BPromise[_0x31f9('0x21')](_0x3f7d0a);}return _0x2346de['save']();};}function saveUpdates(_0x1dfa5f,_0x34e8de){return function(_0x5cf27c){if(_0x5cf27c){return _0x5cf27c[_0x31f9('0x22')](_0x1dfa5f)[_0x31f9('0x23')](function(_0x519a87){return _0x519a87;});}return null;};}function removeEntity(_0x5b7c31,_0x4a0c28){return function(_0x266485){if(_0x266485){return _0x266485['destroy']()[_0x31f9('0x23')](function(){_0x5b7c31[_0x31f9('0x1a')](0xcc)[_0x31f9('0x19')]();});}};}function handleEntityNotFound(_0x8d5a3a,_0x196089){return function(_0x25df48){if(!_0x25df48){_0x8d5a3a[_0x31f9('0x18')](0x194);}return _0x25df48;};}function handleError(_0x1e1146,_0x3b9907){_0x3b9907=_0x3b9907||0x1f4;return function(_0x199aca){logger[_0x31f9('0x24')](_0x199aca[_0x31f9('0x25')]);if(_0x199aca[_0x31f9('0x26')]){delete _0x199aca[_0x31f9('0x26')];}_0x1e1146[_0x31f9('0x1a')](_0x3b9907)[_0x31f9('0x27')](_0x199aca);};}exports[_0x31f9('0x28')]=function(_0x51ae6f,_0x4f92bf){var _0x2c0377={},_0x1f2e95={},_0x178d8d={'count':0x0,'rows':[]};var _0x5c0f72=_[_0x31f9('0x29')](db[_0x31f9('0x2a')][_0x31f9('0x2b')],function(_0x3cb6b1){return{'name':_0x3cb6b1['fieldName'],'type':_0x3cb6b1[_0x31f9('0x2c')][_0x31f9('0x2d')]};});_0x1f2e95[_0x31f9('0x2e')]=_[_0x31f9('0x29')](_0x5c0f72,_0x31f9('0x26'));_0x1f2e95[_0x31f9('0x2f')]=_[_0x31f9('0x30')](_0x51ae6f[_0x31f9('0x2f')]);_0x1f2e95[_0x31f9('0x31')]=_[_0x31f9('0x32')](_0x1f2e95['model'],_0x1f2e95['query']);_0x2c0377[_0x31f9('0x33')]=_[_0x31f9('0x32')](_0x1f2e95[_0x31f9('0x2e')],qs[_0x31f9('0x34')](_0x51ae6f[_0x31f9('0x2f')]['fields']));_0x2c0377['attributes']=_0x2c0377[_0x31f9('0x33')][_0x31f9('0x35')]?_0x2c0377[_0x31f9('0x33')]:_0x1f2e95[_0x31f9('0x2e')];if(!_0x51ae6f[_0x31f9('0x2f')][_0x31f9('0x36')]('nolimit')){_0x2c0377['limit']=qs['limit'](_0x51ae6f[_0x31f9('0x2f')][_0x31f9('0x1e')]);_0x2c0377['offset']=qs['offset'](_0x51ae6f[_0x31f9('0x2f')][_0x31f9('0x1d')]);}_0x2c0377[_0x31f9('0x37')]=qs[_0x31f9('0x38')](_0x51ae6f[_0x31f9('0x2f')][_0x31f9('0x38')]);_0x2c0377['where']=qs['filters'](_[_0x31f9('0x39')](_0x51ae6f[_0x31f9('0x2f')],_0x1f2e95['filters']));if(_0x51ae6f[_0x31f9('0x2f')]['filter']){_0x2c0377[_0x31f9('0x3a')]=_['merge'](_0x2c0377[_0x31f9('0x3a')],{'$or':_['map'](_0x5c0f72,function(_0x43f111){if(_0x43f111[_0x31f9('0x2c')]!==_0x31f9('0x3b')){var _0x13049e={};_0x13049e[_0x43f111[_0x31f9('0x26')]]={'$like':'%'+_0x51ae6f[_0x31f9('0x2f')][_0x31f9('0x3c')]+'%'};return _0x13049e;}})});}_0x2c0377=_[_0x31f9('0x3d')]({},_0x2c0377,_0x51ae6f[_0x31f9('0x3e')]);var _0x3abd2a={'where':_0x2c0377[_0x31f9('0x3a')]};return db[_0x31f9('0x2a')][_0x31f9('0x1c')](_0x3abd2a)[_0x31f9('0x23')](function(_0x3a7c9e){_0x178d8d['count']=_0x3a7c9e;if(_0x51ae6f[_0x31f9('0x2f')][_0x31f9('0x3f')]){_0x2c0377[_0x31f9('0x40')]=[{'all':!![]}];}return db[_0x31f9('0x2a')][_0x31f9('0x41')](_0x2c0377);})['then'](function(_0x1cdba4){_0x178d8d[_0x31f9('0x42')]=_0x1cdba4;return _0x178d8d;})[_0x31f9('0x23')](respondWithFilteredResult(_0x4f92bf,_0x2c0377))['catch'](handleError(_0x4f92bf,null));};exports[_0x31f9('0x43')]=function(_0x21525a,_0x448a4e){var _0x224825={'raw':!![],'where':{'id':_0x21525a[_0x31f9('0x44')]['id']}},_0x49bd30={};_0x49bd30['model']=_[_0x31f9('0x30')](db['SquareMessage']['rawAttributes']);_0x49bd30[_0x31f9('0x2f')]=_[_0x31f9('0x30')](_0x21525a[_0x31f9('0x2f')]);_0x49bd30[_0x31f9('0x31')]=_['intersection'](_0x49bd30['model'],_0x49bd30[_0x31f9('0x2f')]);_0x224825[_0x31f9('0x33')]=_[_0x31f9('0x32')](_0x49bd30['model'],qs[_0x31f9('0x34')](_0x21525a['query'][_0x31f9('0x34')]));_0x224825[_0x31f9('0x33')]=_0x224825[_0x31f9('0x33')]['length']?_0x224825['attributes']:_0x49bd30[_0x31f9('0x2e')];if(_0x21525a[_0x31f9('0x2f')]['includeAll']){_0x224825[_0x31f9('0x40')]=[{'all':!![]}];}_0x224825=_[_0x31f9('0x3d')]({},_0x224825,_0x21525a['options']);return db['SquareMessage']['find'](_0x224825)[_0x31f9('0x23')](handleEntityNotFound(_0x448a4e,null))[_0x31f9('0x23')](respondWithResult(_0x448a4e,null))[_0x31f9('0x45')](handleError(_0x448a4e,null));};exports['create']=function(_0x1a8ab9,_0x424e51){return db['SquareMessage'][_0x31f9('0x46')](_0x1a8ab9[_0x31f9('0x47')],{})[_0x31f9('0x23')](respondWithResult(_0x424e51,0xc9))[_0x31f9('0x45')](handleError(_0x424e51,null));};exports['update']=function(_0x42469c,_0x2de088){if(_0x42469c[_0x31f9('0x47')]['id']){delete _0x42469c[_0x31f9('0x47')]['id'];}return db[_0x31f9('0x2a')]['find']({'where':{'id':_0x42469c['params']['id']}})[_0x31f9('0x23')](handleEntityNotFound(_0x2de088,null))[_0x31f9('0x23')](saveUpdates(_0x42469c[_0x31f9('0x47')],null))[_0x31f9('0x23')](respondWithResult(_0x2de088,null))[_0x31f9('0x45')](handleError(_0x2de088,null));};exports['destroy']=function(_0x3b2006,_0x297a7f){return db[_0x31f9('0x2a')][_0x31f9('0x48')]({'where':{'id':_0x3b2006[_0x31f9('0x44')]['id']}})['then'](handleEntityNotFound(_0x297a7f,null))['then'](removeEntity(_0x297a7f,null))[_0x31f9('0x45')](handleError(_0x297a7f,null));};
\ No newline at end of file
+var _0xd0cf=['error','stack','name','send','index','map','SquareMessage','type','key','model','query','intersection','attributes','hasOwnProperty','nolimit','order','sort','where','filters','pick','filter','merge','VIRTUAL','options','includeAll','include','findAll','rows','catch','show','params','keys','rawAttributes','fields','length','create','body','find','html-pdf','eml-format','rimraf','zip-dir','fast-json-patch','moment','bluebird','mustache','util','path','sox','to-csv','ejs','lodash','squel','crypto','jsforce','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/logger','api','../../config/utils','../../config/environment','../../mysqldb','sendStatus','status','end','json','count','offset','limit','set','Content-Range','apply','reject','save','update','destroy','then'];(function(_0x2964e5,_0x363898){var _0x33072c=function(_0x4e4cc7){while(--_0x4e4cc7){_0x2964e5['push'](_0x2964e5['shift']());}};_0x33072c(++_0x363898);}(_0xd0cf,0x77));var _0xfd0c=function(_0x166e96,_0x55191d){_0x166e96=_0x166e96-0x0;var _0x553d73=_0xd0cf[_0x166e96];return _0x553d73;};'use strict';var pdf=require(_0xfd0c('0x0'));var emlformat=require(_0xfd0c('0x1'));var rimraf=require(_0xfd0c('0x2'));var zipdir=require(_0xfd0c('0x3'));var jsonpatch=require(_0xfd0c('0x4'));var rp=require('request-promise');var moment=require(_0xfd0c('0x5'));var BPromise=require(_0xfd0c('0x6'));var Mustache=require(_0xfd0c('0x7'));var util=require(_0xfd0c('0x8'));var path=require(_0xfd0c('0x9'));var sox=require(_0xfd0c('0xa'));var csv=require(_0xfd0c('0xb'));var ejs=require(_0xfd0c('0xc'));var fs=require('fs');var _=require(_0xfd0c('0xd'));var squel=require(_0xfd0c('0xe'));var crypto=require(_0xfd0c('0xf'));var jsforce=require(_0xfd0c('0x10'));var deskjs=require('desk.js');var toCsv=require('to-csv');var querystring=require(_0xfd0c('0x11'));var Papa=require(_0xfd0c('0x12'));var Redis=require(_0xfd0c('0x13'));var authService=require(_0xfd0c('0x14'));var qs=require(_0xfd0c('0x15'));var as=require(_0xfd0c('0x16'));var hardwareService=require('../../config/license/hardware');var logger=require(_0xfd0c('0x17'))(_0xfd0c('0x18'));var utils=require(_0xfd0c('0x19'));var config=require(_0xfd0c('0x1a'));var db=require(_0xfd0c('0x1b'))['db'];function respondWithStatusCode(_0x54620a,_0x10ec2f){_0x10ec2f=_0x10ec2f||0xcc;return function(_0x298560){if(_0x298560){return _0x54620a[_0xfd0c('0x1c')](_0x10ec2f);}return _0x54620a[_0xfd0c('0x1d')](_0x10ec2f)[_0xfd0c('0x1e')]();};}function respondWithResult(_0xdfbe4d,_0x2c5d39){_0x2c5d39=_0x2c5d39||0xc8;return function(_0x2e330d){if(_0x2e330d){return _0xdfbe4d[_0xfd0c('0x1d')](_0x2c5d39)[_0xfd0c('0x1f')](_0x2e330d);}};}function respondWithFilteredResult(_0x1efa36,_0x28a100){return function(_0x5506b0){if(_0x5506b0){var _0x18798a=_0x5506b0[_0xfd0c('0x20')],_0x55c470=_0x28a100[_0xfd0c('0x21')],_0x51b61b=_0x28a100[_0xfd0c('0x21')]+_0x28a100[_0xfd0c('0x22')],_0x4b4569;if(_0x51b61b>=_0x18798a){_0x51b61b=_0x18798a;_0x4b4569=0xc8;}else{_0x4b4569=0xce;}_0x1efa36[_0xfd0c('0x1d')](_0x4b4569);return _0x1efa36[_0xfd0c('0x23')](_0xfd0c('0x24'),_0x55c470+'-'+_0x51b61b+'/'+_0x18798a)[_0xfd0c('0x1f')](_0x5506b0);}return null;};}function patchUpdates(_0x168f75){return function(_0x10108e){try{jsonpatch[_0xfd0c('0x25')](_0x10108e,_0x168f75,!![]);}catch(_0x1df080){return BPromise[_0xfd0c('0x26')](_0x1df080);}return _0x10108e[_0xfd0c('0x27')]();};}function saveUpdates(_0x3094ec,_0x111c38){return function(_0xaeda13){if(_0xaeda13){return _0xaeda13[_0xfd0c('0x28')](_0x3094ec)['then'](function(_0x504420){return _0x504420;});}return null;};}function removeEntity(_0x4f0b84,_0x41f1c7){return function(_0x51348d){if(_0x51348d){return _0x51348d[_0xfd0c('0x29')]()[_0xfd0c('0x2a')](function(){_0x4f0b84[_0xfd0c('0x1d')](0xcc)[_0xfd0c('0x1e')]();});}};}function handleEntityNotFound(_0x3bdd37,_0x232cbe){return function(_0x5600bd){if(!_0x5600bd){_0x3bdd37[_0xfd0c('0x1c')](0x194);}return _0x5600bd;};}function handleError(_0x2c44a5,_0x8e8fdf){_0x8e8fdf=_0x8e8fdf||0x1f4;return function(_0x373523){logger[_0xfd0c('0x2b')](_0x373523[_0xfd0c('0x2c')]);if(_0x373523[_0xfd0c('0x2d')]){delete _0x373523[_0xfd0c('0x2d')];}_0x2c44a5['status'](_0x8e8fdf)[_0xfd0c('0x2e')](_0x373523);};}exports[_0xfd0c('0x2f')]=function(_0x462f75,_0x55fd91){var _0x1bda37={},_0xa5ab3b={},_0x47090b={'count':0x0,'rows':[]};var _0x316841=_[_0xfd0c('0x30')](db[_0xfd0c('0x31')]['rawAttributes'],function(_0x506b7d){return{'name':_0x506b7d['fieldName'],'type':_0x506b7d[_0xfd0c('0x32')][_0xfd0c('0x33')]};});_0xa5ab3b[_0xfd0c('0x34')]=_[_0xfd0c('0x30')](_0x316841,_0xfd0c('0x2d'));_0xa5ab3b[_0xfd0c('0x35')]=_['keys'](_0x462f75[_0xfd0c('0x35')]);_0xa5ab3b['filters']=_[_0xfd0c('0x36')](_0xa5ab3b[_0xfd0c('0x34')],_0xa5ab3b[_0xfd0c('0x35')]);_0x1bda37[_0xfd0c('0x37')]=_[_0xfd0c('0x36')](_0xa5ab3b['model'],qs['fields'](_0x462f75['query']['fields']));_0x1bda37[_0xfd0c('0x37')]=_0x1bda37[_0xfd0c('0x37')]['length']?_0x1bda37[_0xfd0c('0x37')]:_0xa5ab3b[_0xfd0c('0x34')];if(!_0x462f75['query'][_0xfd0c('0x38')](_0xfd0c('0x39'))){_0x1bda37[_0xfd0c('0x22')]=qs['limit'](_0x462f75[_0xfd0c('0x35')][_0xfd0c('0x22')]);_0x1bda37['offset']=qs[_0xfd0c('0x21')](_0x462f75['query'][_0xfd0c('0x21')]);}_0x1bda37[_0xfd0c('0x3a')]=qs[_0xfd0c('0x3b')](_0x462f75['query'][_0xfd0c('0x3b')]);_0x1bda37[_0xfd0c('0x3c')]=qs[_0xfd0c('0x3d')](_[_0xfd0c('0x3e')](_0x462f75[_0xfd0c('0x35')],_0xa5ab3b['filters']));if(_0x462f75['query'][_0xfd0c('0x3f')]){_0x1bda37['where']=_[_0xfd0c('0x40')](_0x1bda37['where'],{'$or':_[_0xfd0c('0x30')](_0x316841,function(_0x2a4d55){if(_0x2a4d55[_0xfd0c('0x32')]!==_0xfd0c('0x41')){var _0x1cce34={};_0x1cce34[_0x2a4d55[_0xfd0c('0x2d')]]={'$like':'%'+_0x462f75[_0xfd0c('0x35')][_0xfd0c('0x3f')]+'%'};return _0x1cce34;}})});}_0x1bda37=_[_0xfd0c('0x40')]({},_0x1bda37,_0x462f75[_0xfd0c('0x42')]);var _0x367949={'where':_0x1bda37[_0xfd0c('0x3c')]};return db[_0xfd0c('0x31')]['count'](_0x367949)[_0xfd0c('0x2a')](function(_0x70fc34){_0x47090b[_0xfd0c('0x20')]=_0x70fc34;if(_0x462f75[_0xfd0c('0x35')][_0xfd0c('0x43')]){_0x1bda37[_0xfd0c('0x44')]=[{'all':!![]}];}return db[_0xfd0c('0x31')][_0xfd0c('0x45')](_0x1bda37);})[_0xfd0c('0x2a')](function(_0x1b50bd){_0x47090b[_0xfd0c('0x46')]=_0x1b50bd;return _0x47090b;})['then'](respondWithFilteredResult(_0x55fd91,_0x1bda37))[_0xfd0c('0x47')](handleError(_0x55fd91,null));};exports[_0xfd0c('0x48')]=function(_0x41a990,_0x5877ff){var _0x5f02b6={'raw':!![],'where':{'id':_0x41a990[_0xfd0c('0x49')]['id']}},_0x12966c={};_0x12966c['model']=_[_0xfd0c('0x4a')](db[_0xfd0c('0x31')][_0xfd0c('0x4b')]);_0x12966c['query']=_[_0xfd0c('0x4a')](_0x41a990[_0xfd0c('0x35')]);_0x12966c[_0xfd0c('0x3d')]=_[_0xfd0c('0x36')](_0x12966c['model'],_0x12966c['query']);_0x5f02b6[_0xfd0c('0x37')]=_[_0xfd0c('0x36')](_0x12966c[_0xfd0c('0x34')],qs[_0xfd0c('0x4c')](_0x41a990[_0xfd0c('0x35')][_0xfd0c('0x4c')]));_0x5f02b6['attributes']=_0x5f02b6['attributes'][_0xfd0c('0x4d')]?_0x5f02b6['attributes']:_0x12966c[_0xfd0c('0x34')];if(_0x41a990[_0xfd0c('0x35')][_0xfd0c('0x43')]){_0x5f02b6[_0xfd0c('0x44')]=[{'all':!![]}];}_0x5f02b6=_[_0xfd0c('0x40')]({},_0x5f02b6,_0x41a990[_0xfd0c('0x42')]);return db[_0xfd0c('0x31')]['find'](_0x5f02b6)['then'](handleEntityNotFound(_0x5877ff,null))['then'](respondWithResult(_0x5877ff,null))[_0xfd0c('0x47')](handleError(_0x5877ff,null));};exports[_0xfd0c('0x4e')]=function(_0x56662a,_0x493e9b){return db[_0xfd0c('0x31')]['create'](_0x56662a[_0xfd0c('0x4f')],{})[_0xfd0c('0x2a')](respondWithResult(_0x493e9b,0xc9))[_0xfd0c('0x47')](handleError(_0x493e9b,null));};exports[_0xfd0c('0x28')]=function(_0x202b0d,_0x41791b){if(_0x202b0d[_0xfd0c('0x4f')]['id']){delete _0x202b0d['body']['id'];}return db['SquareMessage'][_0xfd0c('0x50')]({'where':{'id':_0x202b0d['params']['id']}})[_0xfd0c('0x2a')](handleEntityNotFound(_0x41791b,null))[_0xfd0c('0x2a')](saveUpdates(_0x202b0d[_0xfd0c('0x4f')],null))[_0xfd0c('0x2a')](respondWithResult(_0x41791b,null))[_0xfd0c('0x47')](handleError(_0x41791b,null));};exports[_0xfd0c('0x29')]=function(_0x5d2749,_0x2a9f24){return db[_0xfd0c('0x31')][_0xfd0c('0x50')]({'where':{'id':_0x5d2749['params']['id']}})[_0xfd0c('0x2a')](handleEntityNotFound(_0x2a9f24,null))[_0xfd0c('0x2a')](removeEntity(_0x2a9f24,null))['catch'](handleError(_0x2a9f24,null));};
\ No newline at end of file
diff --git a/server/api/squareMessage/squareMessage.model.js b/server/api/squareMessage/squareMessage.model.js
index afabf6a..1b0bd5e 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 _0xcb41=['../../config/logger','api','moment','bluebird','request-promise','rimraf','../../config/environment','./squareMessage.attributes','exports','define','SquareMessage','square_messages','lodash','util'];(function(_0x10f100,_0x20f3d3){var _0x51546e=function(_0x488217){while(--_0x488217){_0x10f100['push'](_0x10f100['shift']());}};_0x51546e(++_0x20f3d3);}(_0xcb41,0xfa));var _0x1cb4=function(_0x426ce3,_0x36ea00){_0x426ce3=_0x426ce3-0x0;var _0x23bce6=_0xcb41[_0x426ce3];return _0x23bce6;};'use strict';var _=require(_0x1cb4('0x0'));var util=require(_0x1cb4('0x1'));var logger=require(_0x1cb4('0x2'))(_0x1cb4('0x3'));var moment=require(_0x1cb4('0x4'));var BPromise=require(_0x1cb4('0x5'));var rp=require(_0x1cb4('0x6'));var fs=require('fs');var path=require('path');var rimraf=require(_0x1cb4('0x7'));var config=require(_0x1cb4('0x8'));var attributes=require(_0x1cb4('0x9'));module[_0x1cb4('0xa')]=function(_0x54c792,_0x4f404f){return _0x54c792[_0x1cb4('0xb')](_0x1cb4('0xc'),attributes,{'tableName':_0x1cb4('0xd'),'paranoid':![],'indexes':[],'timestamps':!![]});};
\ No newline at end of file
+var _0x6e7e=['define','SquareMessage','lodash','util','../../config/logger','api','moment','bluebird','path','rimraf','../../config/environment','./squareMessage.attributes','exports'];(function(_0x4210ed,_0x1ab215){var _0x394e18=function(_0xfd404c){while(--_0xfd404c){_0x4210ed['push'](_0x4210ed['shift']());}};_0x394e18(++_0x1ab215);}(_0x6e7e,0x147));var _0xe6e7=function(_0x2ff5c6,_0x248fe2){_0x2ff5c6=_0x2ff5c6-0x0;var _0x5605f2=_0x6e7e[_0x2ff5c6];return _0x5605f2;};'use strict';var _=require(_0xe6e7('0x0'));var util=require(_0xe6e7('0x1'));var logger=require(_0xe6e7('0x2'))(_0xe6e7('0x3'));var moment=require(_0xe6e7('0x4'));var BPromise=require(_0xe6e7('0x5'));var rp=require('request-promise');var fs=require('fs');var path=require(_0xe6e7('0x6'));var rimraf=require(_0xe6e7('0x7'));var config=require(_0xe6e7('0x8'));var attributes=require(_0xe6e7('0x9'));module[_0xe6e7('0xa')]=function(_0x34ee67,_0x517482){return _0x34ee67[_0xe6e7('0xb')](_0xe6e7('0xc'),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 cd70870..236b8d6 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 _0xf072=['../../config/utils','../../config/logger','../../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','message','catch','CreateSquareMessage','create','body','options','raw','lodash','util','moment','randomstring','../../mysqldb'];(function(_0x2f831f,_0x412036){var _0x245a02=function(_0x178487){while(--_0x178487){_0x2f831f['push'](_0x2f831f['shift']());}};_0x245a02(++_0x412036);}(_0xf072,0x1cf));var _0x2f07=function(_0x28af3c,_0x2d6abf){_0x28af3c=_0x28af3c-0x0;var _0x2fcdc8=_0xf072[_0x28af3c];return _0x2fcdc8;};'use strict';var _=require(_0x2f07('0x0'));var util=require(_0x2f07('0x1'));var moment=require(_0x2f07('0x2'));var BPromise=require('bluebird');var rs=require(_0x2f07('0x3'));var fs=require('fs');var Redis=require('ioredis');var db=require(_0x2f07('0x4'))['db'];var utils=require(_0x2f07('0x5'));var logger=require(_0x2f07('0x6'))('rpc');var config=require(_0x2f07('0x7'));var jayson=require(_0x2f07('0x8'));var client=jayson[_0x2f07('0x9')][_0x2f07('0xa')]({'port':0x232a});function respondWithRpcPromise(_0x235418,_0xf73d1a,_0x33b99c){return new BPromise(function(_0x379b2e,_0x4746c2){return client[_0x2f07('0xb')](_0x235418,_0x33b99c)[_0x2f07('0xc')](function(_0x2e372c){logger[_0x2f07('0xd')](_0x2f07('0xe'),_0xf73d1a,_0x2f07('0xf'));logger['debug'](_0x2f07('0x10'),_0xf73d1a,_0x2f07('0xf'),JSON[_0x2f07('0x11')](_0x2e372c));if(_0x2e372c[_0x2f07('0x12')]){if(_0x2e372c['error']['code']===0x1f4){logger[_0x2f07('0x12')](_0x2f07('0xe'),_0xf73d1a,_0x2e372c['error'][_0x2f07('0x13')]);return _0x4746c2(_0x2e372c[_0x2f07('0x12')][_0x2f07('0x13')]);}logger['error'](_0x2f07('0xe'),_0xf73d1a,_0x2e372c[_0x2f07('0x12')][_0x2f07('0x13')]);return _0x379b2e(_0x2e372c[_0x2f07('0x12')][_0x2f07('0x13')]);}else{logger[_0x2f07('0xd')]('SquareMessage,\x20%s,\x20%s',_0xf73d1a,_0x2f07('0xf'));_0x379b2e(_0x2e372c['result'][_0x2f07('0x13')]);}})[_0x2f07('0x14')](function(_0x1dace4){logger[_0x2f07('0x12')](_0x2f07('0xe'),_0xf73d1a,_0x1dace4);_0x4746c2(_0x1dace4);});});}exports[_0x2f07('0x15')]=function(_0x1a6135){var _0xe3ed0=this;return new Promise(function(_0x55bd60,_0x15c3dd){return db['SquareMessage'][_0x2f07('0x16')](_0x1a6135[_0x2f07('0x17')],{'raw':_0x1a6135[_0x2f07('0x18')]?_0x1a6135[_0x2f07('0x18')][_0x2f07('0x19')]===undefined?!![]:![]:!![]})['then'](function(_0x45df73){logger['info']('CreateSquareMessage',_0x1a6135);logger['debug'](_0x2f07('0x15'),_0x1a6135,JSON['stringify'](_0x45df73));_0x55bd60(_0x45df73);})[_0x2f07('0x14')](function(_0x5e6ac6){logger[_0x2f07('0x12')](_0x2f07('0x15'),_0x5e6ac6[_0x2f07('0x13')],_0x1a6135);_0x15c3dd(_0xe3ed0[_0x2f07('0x12')](0x1f4,_0x5e6ac6['message']));});});};
\ No newline at end of file
+var _0xc1c6=['../../config/logger','jayson/promise','http','then','SquareMessage,\x20%s,\x20%s','request\x20sent','debug','SquareMessage,\x20%s,\x20%s,\x20%s','stringify','error','message','info','catch','create','options','raw','CreateSquareMessage','lodash','util','moment','randomstring','../../mysqldb','../../config/utils'];(function(_0x461c5b,_0x5caa70){var _0x378d98=function(_0x249167){while(--_0x249167){_0x461c5b['push'](_0x461c5b['shift']());}};_0x378d98(++_0x5caa70);}(_0xc1c6,0xf7));var _0x6c1c=function(_0x56c246,_0x24032e){_0x56c246=_0x56c246-0x0;var _0x55cf30=_0xc1c6[_0x56c246];return _0x55cf30;};'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});function respondWithRpcPromise(_0x582bec,_0xe510ca,_0x2eb1ba){return new BPromise(function(_0x38369d,_0x2cec58){return client['request'](_0x582bec,_0x2eb1ba)[_0x6c1c('0x9')](function(_0x3ca985){logger['info'](_0x6c1c('0xa'),_0xe510ca,_0x6c1c('0xb'));logger[_0x6c1c('0xc')](_0x6c1c('0xd'),_0xe510ca,'request\x20sent',JSON[_0x6c1c('0xe')](_0x3ca985));if(_0x3ca985[_0x6c1c('0xf')]){if(_0x3ca985[_0x6c1c('0xf')]['code']===0x1f4){logger[_0x6c1c('0xf')](_0x6c1c('0xa'),_0xe510ca,_0x3ca985[_0x6c1c('0xf')]['message']);return _0x2cec58(_0x3ca985[_0x6c1c('0xf')]['message']);}logger[_0x6c1c('0xf')](_0x6c1c('0xa'),_0xe510ca,_0x3ca985[_0x6c1c('0xf')][_0x6c1c('0x10')]);return _0x38369d(_0x3ca985[_0x6c1c('0xf')][_0x6c1c('0x10')]);}else{logger[_0x6c1c('0x11')](_0x6c1c('0xa'),_0xe510ca,_0x6c1c('0xb'));_0x38369d(_0x3ca985['result'][_0x6c1c('0x10')]);}})[_0x6c1c('0x12')](function(_0x5214ee){logger[_0x6c1c('0xf')](_0x6c1c('0xa'),_0xe510ca,_0x5214ee);_0x2cec58(_0x5214ee);});});}exports['CreateSquareMessage']=function(_0x137770){var _0x4ede06=this;return new Promise(function(_0x338dc2,_0x1a0ab9){return db['SquareMessage'][_0x6c1c('0x13')](_0x137770['body'],{'raw':_0x137770[_0x6c1c('0x14')]?_0x137770[_0x6c1c('0x14')][_0x6c1c('0x15')]===undefined?!![]:![]:!![]})[_0x6c1c('0x9')](function(_0x1acf7f){logger[_0x6c1c('0x11')](_0x6c1c('0x16'),_0x137770);logger[_0x6c1c('0xc')](_0x6c1c('0x16'),_0x137770,JSON[_0x6c1c('0xe')](_0x1acf7f));_0x338dc2(_0x1acf7f);})[_0x6c1c('0x12')](function(_0x450b1f){logger[_0x6c1c('0xf')](_0x6c1c('0x16'),_0x450b1f[_0x6c1c('0x10')],_0x137770);_0x1a0ab9(_0x4ede06[_0x6c1c('0xf')](0x1f4,_0x450b1f[_0x6c1c('0x10')]));});});};
\ No newline at end of file
diff --git a/server/api/squareOdbc/index.js b/server/api/squareOdbc/index.js
index b3507d1..1d3155c 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 _0x569b=['express','Router','../../components/interaction/service','../../config/environment','get','isAuthenticated','index','/:id','show','test','post','put','destroy','exports','multer','util','connect-timeout'];(function(_0x5c6b17,_0x5a2467){var _0x29ea47=function(_0x3a2a37){while(--_0x3a2a37){_0x5c6b17['push'](_0x5c6b17['shift']());}};_0x29ea47(++_0x5a2467);}(_0x569b,0x173));var _0xb569=function(_0xaa0309,_0x1c8008){_0xaa0309=_0xaa0309-0x0;var _0x5de7ce=_0x569b[_0xaa0309];return _0x5de7ce;};'use strict';var multer=require(_0xb569('0x0'));var util=require(_0xb569('0x1'));var path=require('path');var timeout=require(_0xb569('0x2'));var express=require(_0xb569('0x3'));var router=express[_0xb569('0x4')]();var auth=require('../../components/auth/service');var interaction=require(_0xb569('0x5'));var config=require(_0xb569('0x6'));var controller=require('./squareOdbc.controller');router[_0xb569('0x7')]('/',auth[_0xb569('0x8')](),controller[_0xb569('0x9')]);router['get'](_0xb569('0xa'),auth[_0xb569('0x8')](),controller[_0xb569('0xb')]);router[_0xb569('0x7')]('/:id/test',auth[_0xb569('0x8')](),timeout('15s'),controller[_0xb569('0xc')]);router[_0xb569('0xd')]('/',auth['isAuthenticated'](),controller['create']);router[_0xb569('0xe')](_0xb569('0xa'),auth[_0xb569('0x8')](),controller['update']);router['delete']('/:id',auth[_0xb569('0x8')](),controller[_0xb569('0xf')]);module[_0xb569('0x10')]=router;
\ No newline at end of file
+var _0x9464=['show','/:id/test','15s','test','post','create','update','destroy','exports','multer','util','path','express','Router','../../components/interaction/service','../../config/environment','./squareOdbc.controller','index','/:id','isAuthenticated'];(function(_0x461886,_0x4fc171){var _0x295e0a=function(_0x451524){while(--_0x451524){_0x461886['push'](_0x461886['shift']());}};_0x295e0a(++_0x4fc171);}(_0x9464,0x10d));var _0x4946=function(_0x45161c,_0x5494fc){_0x45161c=_0x45161c-0x0;var _0x186581=_0x9464[_0x45161c];return _0x186581;};'use strict';var multer=require(_0x4946('0x0'));var util=require(_0x4946('0x1'));var path=require(_0x4946('0x2'));var timeout=require('connect-timeout');var express=require(_0x4946('0x3'));var router=express[_0x4946('0x4')]();var auth=require('../../components/auth/service');var interaction=require(_0x4946('0x5'));var config=require(_0x4946('0x6'));var controller=require(_0x4946('0x7'));router['get']('/',auth['isAuthenticated'](),controller[_0x4946('0x8')]);router['get'](_0x4946('0x9'),auth[_0x4946('0xa')](),controller[_0x4946('0xb')]);router['get'](_0x4946('0xc'),auth[_0x4946('0xa')](),timeout(_0x4946('0xd')),controller[_0x4946('0xe')]);router[_0x4946('0xf')]('/',auth[_0x4946('0xa')](),controller[_0x4946('0x10')]);router['put'](_0x4946('0x9'),auth[_0x4946('0xa')](),controller[_0x4946('0x11')]);router['delete'](_0x4946('0x9'),auth[_0x4946('0xa')](),controller[_0x4946('0x12')]);module[_0x4946('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 a038e9c..8bd0201 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 _0xef4a=['STRING','exports'];(function(_0xe5fe8,_0xc0ab63){var _0x452cde=function(_0x49ac5e){while(--_0x49ac5e){_0xe5fe8['push'](_0xe5fe8['shift']());}};_0x452cde(++_0xc0ab63);}(_0xef4a,0xb9));var _0xaef4=function(_0x353623,_0xefa737){_0x353623=_0x353623-0x0;var _0x11aba6=_0xef4a[_0x353623];return _0x11aba6;};'use strict';var Sequelize=require('sequelize');module[_0xaef4('0x0')]={'name':{'type':Sequelize[_0xaef4('0x1')],'unique':'name','allowNull':![]},'dsn':{'type':Sequelize[_0xaef4('0x1')]},'description':{'type':Sequelize['STRING']}};
\ No newline at end of file
+var _0xa802=['sequelize','exports','STRING'];(function(_0x1cb18a,_0x33167a){var _0x22442e=function(_0x46c611){while(--_0x46c611){_0x1cb18a['push'](_0x1cb18a['shift']());}};_0x22442e(++_0x33167a);}(_0xa802,0xb1));var _0x2a80=function(_0x48c30c,_0x2f75fa){_0x48c30c=_0x48c30c-0x0;var _0x2bbd83=_0xa802[_0x48c30c];return _0x2bbd83;};'use strict';var Sequelize=require(_0x2a80('0x0'));module[_0x2a80('0x1')]={'name':{'type':Sequelize[_0x2a80('0x2')],'unique':'name','allowNull':![]},'dsn':{'type':Sequelize[_0x2a80('0x2')]},'description':{'type':Sequelize[_0x2a80('0x2')]}};
\ No newline at end of file
diff --git a/server/api/squareOdbc/squareOdbc.controller.js b/server/api/squareOdbc/squareOdbc.controller.js
index 0c41ff6..4bd4d7c 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 _0x8d85=['name','send','index','map','SquareOdbc','rawAttributes','fieldName','type','key','model','keys','filters','intersection','attributes','query','fields','hasOwnProperty','nolimit','order','sort','where','pick','merge','options','count','includeAll','include','findAll','rows','params','find','catch','create','body','user','Unable\x20to\x20retrieve\x20the\x20current\x20user','role','ODBC','UserProfileSection','autoAssociation','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','update','destroy','test','dsn','odbc','openSync','closeSync','rimraf','fast-json-patch','request-promise','moment','sox','crypto','jsforce','to-csv','querystring','../../components/parsers/qs','../../config/license/hardware','../../config/logger','../../config/utils','../../mysqldb','sendStatus','status','end','json','offset','limit','set','Content-Range','apply','save','then','get','UserProfileResource','error','stack'];(function(_0x282e37,_0x38c643){var _0x50c2b8=function(_0x58103f){while(--_0x58103f){_0x282e37['push'](_0x282e37['shift']());}};_0x50c2b8(++_0x38c643);}(_0x8d85,0x7d));var _0x58d8=function(_0xb9bca6,_0x3653df){_0xb9bca6=_0xb9bca6-0x0;var _0x1bc527=_0x8d85[_0xb9bca6];return _0x1bc527;};'use strict';var pdf=require('html-pdf');var emlformat=require('eml-format');var rimraf=require(_0x58d8('0x0'));var zipdir=require('zip-dir');var jsonpatch=require(_0x58d8('0x1'));var rp=require(_0x58d8('0x2'));var moment=require(_0x58d8('0x3'));var BPromise=require('bluebird');var Mustache=require('mustache');var util=require('util');var path=require('path');var sox=require(_0x58d8('0x4'));var csv=require('to-csv');var ejs=require('ejs');var fs=require('fs');var _=require('lodash');var squel=require('squel');var crypto=require(_0x58d8('0x5'));var jsforce=require(_0x58d8('0x6'));var deskjs=require('desk.js');var toCsv=require(_0x58d8('0x7'));var querystring=require(_0x58d8('0x8'));var Papa=require('papaparse');var Redis=require('ioredis');var authService=require('../../components/auth/service');var qs=require(_0x58d8('0x9'));var as=require('../../components/parsers/advancedSearch');var hardwareService=require(_0x58d8('0xa'));var logger=require(_0x58d8('0xb'))('api');var utils=require(_0x58d8('0xc'));var config=require('../../config/environment');var db=require(_0x58d8('0xd'))['db'];function respondWithStatusCode(_0xe1b416,_0x5c2f86){_0x5c2f86=_0x5c2f86||0xcc;return function(_0x467c32){if(_0x467c32){return _0xe1b416[_0x58d8('0xe')](_0x5c2f86);}return _0xe1b416[_0x58d8('0xf')](_0x5c2f86)[_0x58d8('0x10')]();};}function respondWithResult(_0x1cf162,_0x77e069){_0x77e069=_0x77e069||0xc8;return function(_0x415732){if(_0x415732){return _0x1cf162[_0x58d8('0xf')](_0x77e069)[_0x58d8('0x11')](_0x415732);}};}function respondWithFilteredResult(_0x4d91a1,_0x18f882){return function(_0x301ec0){if(_0x301ec0){var _0x4856f8=_0x301ec0['count'],_0x42619b=_0x18f882[_0x58d8('0x12')],_0x591106=_0x18f882['offset']+_0x18f882[_0x58d8('0x13')],_0x1f8435;if(_0x591106>=_0x4856f8){_0x591106=_0x4856f8;_0x1f8435=0xc8;}else{_0x1f8435=0xce;}_0x4d91a1[_0x58d8('0xf')](_0x1f8435);return _0x4d91a1[_0x58d8('0x14')](_0x58d8('0x15'),_0x42619b+'-'+_0x591106+'/'+_0x4856f8)[_0x58d8('0x11')](_0x301ec0);}return null;};}function patchUpdates(_0x57b732){return function(_0x3a9ac1){try{jsonpatch[_0x58d8('0x16')](_0x3a9ac1,_0x57b732,!![]);}catch(_0x80e467){return BPromise['reject'](_0x80e467);}return _0x3a9ac1[_0x58d8('0x17')]();};}function saveUpdates(_0x3afafc,_0x49c837){return function(_0x188cbe){if(_0x188cbe){return _0x188cbe['update'](_0x3afafc)[_0x58d8('0x18')](function(_0x4bce86){return _0x4bce86;});}return null;};}function removeEntity(_0x2cf44a,_0x509c89){return function(_0x5d7ee7){if(_0x5d7ee7){return _0x5d7ee7['destroy']()[_0x58d8('0x18')](function(){var _0x194413=_0x5d7ee7[_0x58d8('0x19')]({'plain':!![]});var _0x5cda0f='ODBC';return db[_0x58d8('0x1a')]['destroy']({'where':{'type':_0x5cda0f,'resourceId':_0x194413['id']}})[_0x58d8('0x18')](function(){return _0x5d7ee7;});})[_0x58d8('0x18')](function(){_0x2cf44a[_0x58d8('0xf')](0xcc)['end']();});}};}function handleEntityNotFound(_0x4bec40,_0x3c79bb){return function(_0x279aa0){if(!_0x279aa0){_0x4bec40[_0x58d8('0xe')](0x194);}return _0x279aa0;};}function handleError(_0x4a2bf3,_0x4b4e50){_0x4b4e50=_0x4b4e50||0x1f4;return function(_0x38a6c3){logger[_0x58d8('0x1b')](_0x38a6c3[_0x58d8('0x1c')]);if(_0x38a6c3['name']){delete _0x38a6c3[_0x58d8('0x1d')];}_0x4a2bf3['status'](_0x4b4e50)[_0x58d8('0x1e')](_0x38a6c3);};}exports[_0x58d8('0x1f')]=function(_0x1638f3,_0x3a108f){var _0x31a909={},_0x113058={},_0x5dcb70={'count':0x0,'rows':[]};var _0x4caf32=_[_0x58d8('0x20')](db[_0x58d8('0x21')][_0x58d8('0x22')],function(_0x4b4cbf){return{'name':_0x4b4cbf[_0x58d8('0x23')],'type':_0x4b4cbf[_0x58d8('0x24')][_0x58d8('0x25')]};});_0x113058[_0x58d8('0x26')]=_[_0x58d8('0x20')](_0x4caf32,_0x58d8('0x1d'));_0x113058['query']=_[_0x58d8('0x27')](_0x1638f3['query']);_0x113058[_0x58d8('0x28')]=_[_0x58d8('0x29')](_0x113058[_0x58d8('0x26')],_0x113058['query']);_0x31a909[_0x58d8('0x2a')]=_[_0x58d8('0x29')](_0x113058['model'],qs['fields'](_0x1638f3[_0x58d8('0x2b')][_0x58d8('0x2c')]));_0x31a909[_0x58d8('0x2a')]=_0x31a909[_0x58d8('0x2a')]['length']?_0x31a909[_0x58d8('0x2a')]:_0x113058[_0x58d8('0x26')];if(!_0x1638f3[_0x58d8('0x2b')][_0x58d8('0x2d')](_0x58d8('0x2e'))){_0x31a909['limit']=qs[_0x58d8('0x13')](_0x1638f3[_0x58d8('0x2b')][_0x58d8('0x13')]);_0x31a909[_0x58d8('0x12')]=qs['offset'](_0x1638f3[_0x58d8('0x2b')][_0x58d8('0x12')]);}_0x31a909[_0x58d8('0x2f')]=qs['sort'](_0x1638f3[_0x58d8('0x2b')][_0x58d8('0x30')]);_0x31a909[_0x58d8('0x31')]=qs[_0x58d8('0x28')](_[_0x58d8('0x32')](_0x1638f3[_0x58d8('0x2b')],_0x113058[_0x58d8('0x28')]));if(_0x1638f3[_0x58d8('0x2b')]['filter']){_0x31a909[_0x58d8('0x31')]=_[_0x58d8('0x33')](_0x31a909[_0x58d8('0x31')],{'$or':_[_0x58d8('0x20')](_0x4caf32,function(_0x2f7fed){if(_0x2f7fed[_0x58d8('0x24')]!=='VIRTUAL'){var _0x3ff358={};_0x3ff358[_0x2f7fed[_0x58d8('0x1d')]]={'$like':'%'+_0x1638f3[_0x58d8('0x2b')]['filter']+'%'};return _0x3ff358;}})});}_0x31a909=_[_0x58d8('0x33')]({},_0x31a909,_0x1638f3[_0x58d8('0x34')]);var _0x41d7ae={'where':_0x31a909[_0x58d8('0x31')]};return db[_0x58d8('0x21')][_0x58d8('0x35')](_0x41d7ae)[_0x58d8('0x18')](function(_0x169069){_0x5dcb70[_0x58d8('0x35')]=_0x169069;if(_0x1638f3['query'][_0x58d8('0x36')]){_0x31a909[_0x58d8('0x37')]=[{'all':!![]}];}return db[_0x58d8('0x21')][_0x58d8('0x38')](_0x31a909);})[_0x58d8('0x18')](function(_0x5a13bb){_0x5dcb70[_0x58d8('0x39')]=_0x5a13bb;return _0x5dcb70;})[_0x58d8('0x18')](respondWithFilteredResult(_0x3a108f,_0x31a909))['catch'](handleError(_0x3a108f,null));};exports['show']=function(_0x45d817,_0x3a82a8){var _0x1b21df={'raw':!![],'where':{'id':_0x45d817[_0x58d8('0x3a')]['id']}},_0x3a77e0={};_0x3a77e0['model']=_['keys'](db['SquareOdbc']['rawAttributes']);_0x3a77e0[_0x58d8('0x2b')]=_[_0x58d8('0x27')](_0x45d817['query']);_0x3a77e0['filters']=_[_0x58d8('0x29')](_0x3a77e0[_0x58d8('0x26')],_0x3a77e0['query']);_0x1b21df[_0x58d8('0x2a')]=_[_0x58d8('0x29')](_0x3a77e0['model'],qs[_0x58d8('0x2c')](_0x45d817[_0x58d8('0x2b')][_0x58d8('0x2c')]));_0x1b21df['attributes']=_0x1b21df[_0x58d8('0x2a')]['length']?_0x1b21df[_0x58d8('0x2a')]:_0x3a77e0['model'];if(_0x45d817[_0x58d8('0x2b')][_0x58d8('0x36')]){_0x1b21df[_0x58d8('0x37')]=[{'all':!![]}];}_0x1b21df=_[_0x58d8('0x33')]({},_0x1b21df,_0x45d817['options']);return db[_0x58d8('0x21')][_0x58d8('0x3b')](_0x1b21df)['then'](handleEntityNotFound(_0x3a82a8,null))[_0x58d8('0x18')](respondWithResult(_0x3a82a8,null))[_0x58d8('0x3c')](handleError(_0x3a82a8,null));};exports[_0x58d8('0x3d')]=function(_0x3608ba,_0x216946){return db[_0x58d8('0x21')][_0x58d8('0x3d')](_0x3608ba[_0x58d8('0x3e')],{})['then'](function(_0x3ae589){var _0x454859=_0x3608ba[_0x58d8('0x3f')][_0x58d8('0x19')]({'plain':!![]});if(!_0x454859)throw new Error(_0x58d8('0x40'));if(_0x454859[_0x58d8('0x41')]==='user'){var _0x15c9e1=_0x3ae589['get']({'plain':!![]});var _0x2bcc2d=_0x58d8('0x42');return db[_0x58d8('0x43')][_0x58d8('0x3b')]({'where':{'name':_0x2bcc2d,'userProfileId':_0x454859['userProfileId']},'raw':!![]})['then'](function(_0x3794e5){if(_0x3794e5&&_0x3794e5[_0x58d8('0x44')]===0x0){return db[_0x58d8('0x1a')][_0x58d8('0x3d')]({'name':_0x15c9e1['name'],'resourceId':_0x15c9e1['id'],'type':_0x3794e5[_0x58d8('0x1d')],'sectionId':_0x3794e5['id']},{})['then'](function(){return _0x3ae589;});}else{return _0x3ae589;}})[_0x58d8('0x3c')](function(_0x27ebb3){logger['error'](_0x58d8('0x45'),_0x27ebb3);throw _0x27ebb3;});}return _0x3ae589;})[_0x58d8('0x18')](respondWithResult(_0x216946,0xc9))[_0x58d8('0x3c')](handleError(_0x216946,null));};exports[_0x58d8('0x46')]=function(_0x42e039,_0x59531d){if(_0x42e039[_0x58d8('0x3e')]['id']){delete _0x42e039['body']['id'];}return db[_0x58d8('0x21')][_0x58d8('0x3b')]({'where':{'id':_0x42e039['params']['id']}})[_0x58d8('0x18')](handleEntityNotFound(_0x59531d,null))[_0x58d8('0x18')](saveUpdates(_0x42e039[_0x58d8('0x3e')],null))[_0x58d8('0x18')](respondWithResult(_0x59531d,null))[_0x58d8('0x3c')](handleError(_0x59531d,null));};exports[_0x58d8('0x47')]=function(_0x268a79,_0x3bdbf1){return db[_0x58d8('0x21')][_0x58d8('0x3b')]({'where':{'id':_0x268a79[_0x58d8('0x3a')]['id']}})[_0x58d8('0x18')](handleEntityNotFound(_0x3bdbf1,null))[_0x58d8('0x18')](removeEntity(_0x3bdbf1,null))['catch'](handleError(_0x3bdbf1,null));};exports[_0x58d8('0x48')]=function(_0x501c46,_0x595b00,_0x293d4e){var _0x459cb6;return db[_0x58d8('0x21')]['find']({'where':{'id':_0x501c46[_0x58d8('0x3a')]['id']},'attributes':['id',_0x58d8('0x49')]})['then'](handleEntityNotFound(_0x595b00,null))[_0x58d8('0x18')](function(_0x26c589){if(_0x26c589){var _0x4174be=require(_0x58d8('0x4a'))();_0x4174be[_0x58d8('0x4b')](_0x26c589[_0x58d8('0x49')]);_0x4174be[_0x58d8('0x4c')]();return _0x26c589;}})[_0x58d8('0x18')](respondWithResult(_0x595b00,null))[_0x58d8('0x3c')](handleError(_0x595b00,null));};
\ No newline at end of file
+var _0x1d0f=['options','includeAll','findAll','rows','show','params','filters','catch','body','user','get','Unable\x20to\x20retrieve\x20the\x20current\x20user','role','UserProfileSection','find','create','error','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','test','openSync','dsn','closeSync','html-pdf','eml-format','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/logger','api','../../config/utils','../../config/environment','../../mysqldb','sendStatus','status','end','json','count','offset','limit','set','Content-Range','apply','update','then','ODBC','UserProfileResource','destroy','stack','name','send','index','map','SquareOdbc','rawAttributes','fieldName','type','key','model','keys','query','intersection','attributes','fields','length','hasOwnProperty','nolimit','order','sort','where','pick','filter','merge','VIRTUAL'];(function(_0x50ea05,_0x97c6a0){var _0x571752=function(_0x384fcd){while(--_0x384fcd){_0x50ea05['push'](_0x50ea05['shift']());}};_0x571752(++_0x97c6a0);}(_0x1d0f,0x1d3));var _0xf1d0=function(_0x2dd769,_0x539226){_0x2dd769=_0x2dd769-0x0;var _0x38d1e2=_0x1d0f[_0x2dd769];return _0x38d1e2;};'use strict';var pdf=require(_0xf1d0('0x0'));var emlformat=require(_0xf1d0('0x1'));var rimraf=require(_0xf1d0('0x2'));var zipdir=require(_0xf1d0('0x3'));var jsonpatch=require(_0xf1d0('0x4'));var rp=require('request-promise');var moment=require('moment');var BPromise=require(_0xf1d0('0x5'));var Mustache=require(_0xf1d0('0x6'));var util=require(_0xf1d0('0x7'));var path=require(_0xf1d0('0x8'));var sox=require(_0xf1d0('0x9'));var csv=require(_0xf1d0('0xa'));var ejs=require(_0xf1d0('0xb'));var fs=require('fs');var _=require(_0xf1d0('0xc'));var squel=require('squel');var crypto=require(_0xf1d0('0xd'));var jsforce=require(_0xf1d0('0xe'));var deskjs=require(_0xf1d0('0xf'));var toCsv=require('to-csv');var querystring=require(_0xf1d0('0x10'));var Papa=require(_0xf1d0('0x11'));var Redis=require(_0xf1d0('0x12'));var authService=require('../../components/auth/service');var qs=require(_0xf1d0('0x13'));var as=require(_0xf1d0('0x14'));var hardwareService=require('../../config/license/hardware');var logger=require(_0xf1d0('0x15'))(_0xf1d0('0x16'));var utils=require(_0xf1d0('0x17'));var config=require(_0xf1d0('0x18'));var db=require(_0xf1d0('0x19'))['db'];function respondWithStatusCode(_0x445012,_0x5ed04d){_0x5ed04d=_0x5ed04d||0xcc;return function(_0x211317){if(_0x211317){return _0x445012[_0xf1d0('0x1a')](_0x5ed04d);}return _0x445012[_0xf1d0('0x1b')](_0x5ed04d)[_0xf1d0('0x1c')]();};}function respondWithResult(_0x5194ae,_0x3136ac){_0x3136ac=_0x3136ac||0xc8;return function(_0x25ff25){if(_0x25ff25){return _0x5194ae['status'](_0x3136ac)[_0xf1d0('0x1d')](_0x25ff25);}};}function respondWithFilteredResult(_0x1d016e,_0x460a8b){return function(_0x30d20d){if(_0x30d20d){var _0x4e44ce=_0x30d20d[_0xf1d0('0x1e')],_0x19d728=_0x460a8b[_0xf1d0('0x1f')],_0x230505=_0x460a8b[_0xf1d0('0x1f')]+_0x460a8b[_0xf1d0('0x20')],_0x59fa9c;if(_0x230505>=_0x4e44ce){_0x230505=_0x4e44ce;_0x59fa9c=0xc8;}else{_0x59fa9c=0xce;}_0x1d016e['status'](_0x59fa9c);return _0x1d016e[_0xf1d0('0x21')](_0xf1d0('0x22'),_0x19d728+'-'+_0x230505+'/'+_0x4e44ce)[_0xf1d0('0x1d')](_0x30d20d);}return null;};}function patchUpdates(_0x276953){return function(_0x434e76){try{jsonpatch[_0xf1d0('0x23')](_0x434e76,_0x276953,!![]);}catch(_0x4a6192){return BPromise['reject'](_0x4a6192);}return _0x434e76['save']();};}function saveUpdates(_0x582475,_0x4e2d53){return function(_0x14160d){if(_0x14160d){return _0x14160d[_0xf1d0('0x24')](_0x582475)[_0xf1d0('0x25')](function(_0x16a0f5){return _0x16a0f5;});}return null;};}function removeEntity(_0x22b2d0,_0x18d930){return function(_0x47b649){if(_0x47b649){return _0x47b649['destroy']()[_0xf1d0('0x25')](function(){var _0x44062a=_0x47b649['get']({'plain':!![]});var _0x295e26=_0xf1d0('0x26');return db[_0xf1d0('0x27')][_0xf1d0('0x28')]({'where':{'type':_0x295e26,'resourceId':_0x44062a['id']}})['then'](function(){return _0x47b649;});})['then'](function(){_0x22b2d0['status'](0xcc)['end']();});}};}function handleEntityNotFound(_0x1e3346,_0x20d4c2){return function(_0xd367ff){if(!_0xd367ff){_0x1e3346[_0xf1d0('0x1a')](0x194);}return _0xd367ff;};}function handleError(_0x4d9e6c,_0x57e6a4){_0x57e6a4=_0x57e6a4||0x1f4;return function(_0x46f825){logger['error'](_0x46f825[_0xf1d0('0x29')]);if(_0x46f825[_0xf1d0('0x2a')]){delete _0x46f825[_0xf1d0('0x2a')];}_0x4d9e6c[_0xf1d0('0x1b')](_0x57e6a4)[_0xf1d0('0x2b')](_0x46f825);};}exports[_0xf1d0('0x2c')]=function(_0x97a4de,_0x156914){var _0x13143f={},_0x1759a5={},_0x2b3e8f={'count':0x0,'rows':[]};var _0x5f43e8=_[_0xf1d0('0x2d')](db[_0xf1d0('0x2e')][_0xf1d0('0x2f')],function(_0x4c57d8){return{'name':_0x4c57d8[_0xf1d0('0x30')],'type':_0x4c57d8[_0xf1d0('0x31')][_0xf1d0('0x32')]};});_0x1759a5[_0xf1d0('0x33')]=_['map'](_0x5f43e8,_0xf1d0('0x2a'));_0x1759a5['query']=_[_0xf1d0('0x34')](_0x97a4de[_0xf1d0('0x35')]);_0x1759a5['filters']=_[_0xf1d0('0x36')](_0x1759a5[_0xf1d0('0x33')],_0x1759a5[_0xf1d0('0x35')]);_0x13143f[_0xf1d0('0x37')]=_[_0xf1d0('0x36')](_0x1759a5[_0xf1d0('0x33')],qs[_0xf1d0('0x38')](_0x97a4de[_0xf1d0('0x35')][_0xf1d0('0x38')]));_0x13143f[_0xf1d0('0x37')]=_0x13143f[_0xf1d0('0x37')][_0xf1d0('0x39')]?_0x13143f[_0xf1d0('0x37')]:_0x1759a5[_0xf1d0('0x33')];if(!_0x97a4de[_0xf1d0('0x35')][_0xf1d0('0x3a')](_0xf1d0('0x3b'))){_0x13143f[_0xf1d0('0x20')]=qs[_0xf1d0('0x20')](_0x97a4de[_0xf1d0('0x35')][_0xf1d0('0x20')]);_0x13143f['offset']=qs['offset'](_0x97a4de[_0xf1d0('0x35')][_0xf1d0('0x1f')]);}_0x13143f[_0xf1d0('0x3c')]=qs[_0xf1d0('0x3d')](_0x97a4de[_0xf1d0('0x35')][_0xf1d0('0x3d')]);_0x13143f[_0xf1d0('0x3e')]=qs['filters'](_[_0xf1d0('0x3f')](_0x97a4de['query'],_0x1759a5['filters']));if(_0x97a4de[_0xf1d0('0x35')][_0xf1d0('0x40')]){_0x13143f[_0xf1d0('0x3e')]=_[_0xf1d0('0x41')](_0x13143f['where'],{'$or':_[_0xf1d0('0x2d')](_0x5f43e8,function(_0x2fdc89){if(_0x2fdc89[_0xf1d0('0x31')]!==_0xf1d0('0x42')){var _0x54cce7={};_0x54cce7[_0x2fdc89[_0xf1d0('0x2a')]]={'$like':'%'+_0x97a4de[_0xf1d0('0x35')]['filter']+'%'};return _0x54cce7;}})});}_0x13143f=_[_0xf1d0('0x41')]({},_0x13143f,_0x97a4de[_0xf1d0('0x43')]);var _0x50859f={'where':_0x13143f[_0xf1d0('0x3e')]};return db['SquareOdbc'][_0xf1d0('0x1e')](_0x50859f)[_0xf1d0('0x25')](function(_0x14f8e6){_0x2b3e8f['count']=_0x14f8e6;if(_0x97a4de['query'][_0xf1d0('0x44')]){_0x13143f['include']=[{'all':!![]}];}return db[_0xf1d0('0x2e')][_0xf1d0('0x45')](_0x13143f);})[_0xf1d0('0x25')](function(_0x1ec8ab){_0x2b3e8f[_0xf1d0('0x46')]=_0x1ec8ab;return _0x2b3e8f;})[_0xf1d0('0x25')](respondWithFilteredResult(_0x156914,_0x13143f))['catch'](handleError(_0x156914,null));};exports[_0xf1d0('0x47')]=function(_0x1c3c27,_0x4368c8){var _0x236ec0={'raw':!![],'where':{'id':_0x1c3c27[_0xf1d0('0x48')]['id']}},_0x5e8a8b={};_0x5e8a8b[_0xf1d0('0x33')]=_[_0xf1d0('0x34')](db[_0xf1d0('0x2e')]['rawAttributes']);_0x5e8a8b[_0xf1d0('0x35')]=_[_0xf1d0('0x34')](_0x1c3c27[_0xf1d0('0x35')]);_0x5e8a8b[_0xf1d0('0x49')]=_['intersection'](_0x5e8a8b['model'],_0x5e8a8b[_0xf1d0('0x35')]);_0x236ec0[_0xf1d0('0x37')]=_['intersection'](_0x5e8a8b[_0xf1d0('0x33')],qs[_0xf1d0('0x38')](_0x1c3c27['query'][_0xf1d0('0x38')]));_0x236ec0[_0xf1d0('0x37')]=_0x236ec0[_0xf1d0('0x37')]['length']?_0x236ec0[_0xf1d0('0x37')]:_0x5e8a8b[_0xf1d0('0x33')];if(_0x1c3c27[_0xf1d0('0x35')][_0xf1d0('0x44')]){_0x236ec0['include']=[{'all':!![]}];}_0x236ec0=_[_0xf1d0('0x41')]({},_0x236ec0,_0x1c3c27['options']);return db[_0xf1d0('0x2e')]['find'](_0x236ec0)[_0xf1d0('0x25')](handleEntityNotFound(_0x4368c8,null))[_0xf1d0('0x25')](respondWithResult(_0x4368c8,null))[_0xf1d0('0x4a')](handleError(_0x4368c8,null));};exports['create']=function(_0x2c705e,_0x173fa3){return db[_0xf1d0('0x2e')]['create'](_0x2c705e[_0xf1d0('0x4b')],{})[_0xf1d0('0x25')](function(_0x216b17){var _0x33b1c2=_0x2c705e[_0xf1d0('0x4c')][_0xf1d0('0x4d')]({'plain':!![]});if(!_0x33b1c2)throw new Error(_0xf1d0('0x4e'));if(_0x33b1c2[_0xf1d0('0x4f')]===_0xf1d0('0x4c')){var _0x45ea70=_0x216b17[_0xf1d0('0x4d')]({'plain':!![]});var _0x20cf7e=_0xf1d0('0x26');return db[_0xf1d0('0x50')][_0xf1d0('0x51')]({'where':{'name':_0x20cf7e,'userProfileId':_0x33b1c2['userProfileId']},'raw':!![]})[_0xf1d0('0x25')](function(_0x1c1038){if(_0x1c1038&&_0x1c1038['autoAssociation']===0x0){return db['UserProfileResource'][_0xf1d0('0x52')]({'name':_0x45ea70[_0xf1d0('0x2a')],'resourceId':_0x45ea70['id'],'type':_0x1c1038[_0xf1d0('0x2a')],'sectionId':_0x1c1038['id']},{})[_0xf1d0('0x25')](function(){return _0x216b17;});}else{return _0x216b17;}})[_0xf1d0('0x4a')](function(_0x110e9e){logger[_0xf1d0('0x53')](_0xf1d0('0x54'),_0x110e9e);throw _0x110e9e;});}return _0x216b17;})[_0xf1d0('0x25')](respondWithResult(_0x173fa3,0xc9))[_0xf1d0('0x4a')](handleError(_0x173fa3,null));};exports[_0xf1d0('0x24')]=function(_0x5e3452,_0x521201){if(_0x5e3452[_0xf1d0('0x4b')]['id']){delete _0x5e3452[_0xf1d0('0x4b')]['id'];}return db[_0xf1d0('0x2e')]['find']({'where':{'id':_0x5e3452[_0xf1d0('0x48')]['id']}})[_0xf1d0('0x25')](handleEntityNotFound(_0x521201,null))[_0xf1d0('0x25')](saveUpdates(_0x5e3452[_0xf1d0('0x4b')],null))[_0xf1d0('0x25')](respondWithResult(_0x521201,null))[_0xf1d0('0x4a')](handleError(_0x521201,null));};exports['destroy']=function(_0x5efb17,_0x3d8968){return db['SquareOdbc'][_0xf1d0('0x51')]({'where':{'id':_0x5efb17[_0xf1d0('0x48')]['id']}})[_0xf1d0('0x25')](handleEntityNotFound(_0x3d8968,null))[_0xf1d0('0x25')](removeEntity(_0x3d8968,null))[_0xf1d0('0x4a')](handleError(_0x3d8968,null));};exports[_0xf1d0('0x55')]=function(_0x1115e7,_0x433320,_0x13e0d4){var _0x4e0cb9;return db[_0xf1d0('0x2e')]['find']({'where':{'id':_0x1115e7[_0xf1d0('0x48')]['id']},'attributes':['id','dsn']})[_0xf1d0('0x25')](handleEntityNotFound(_0x433320,null))[_0xf1d0('0x25')](function(_0x5848d7){if(_0x5848d7){var _0x53f4d9=require('odbc')();_0x53f4d9[_0xf1d0('0x56')](_0x5848d7[_0xf1d0('0x57')]);_0x53f4d9[_0xf1d0('0x58')]();return _0x5848d7;}})[_0xf1d0('0x25')](respondWithResult(_0x433320,null))[_0xf1d0('0x4a')](handleError(_0x433320,null));};
\ No newline at end of file
diff --git a/server/api/squareOdbc/squareOdbc.model.js b/server/api/squareOdbc/squareOdbc.model.js
index 279f298..e4d5ca0 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 _0xdf79=['api','moment','bluebird','request-promise','exports','define','square_odbc','../../config/logger'];(function(_0x38136b,_0x35c34e){var _0x3b10b9=function(_0x27fdfe){while(--_0x27fdfe){_0x38136b['push'](_0x38136b['shift']());}};_0x3b10b9(++_0x35c34e);}(_0xdf79,0xa7));var _0x9df7=function(_0x14add3,_0x13ce8d){_0x14add3=_0x14add3-0x0;var _0x4a174f=_0xdf79[_0x14add3];return _0x4a174f;};'use strict';var _=require('lodash');var util=require('util');var logger=require(_0x9df7('0x0'))(_0x9df7('0x1'));var moment=require(_0x9df7('0x2'));var BPromise=require(_0x9df7('0x3'));var rp=require(_0x9df7('0x4'));var fs=require('fs');var path=require('path');var rimraf=require('rimraf');var config=require('../../config/environment');var attributes=require('./squareOdbc.attributes');module[_0x9df7('0x5')]=function(_0x23c80b,_0x3350cd){return _0x23c80b[_0x9df7('0x6')]('SquareOdbc',attributes,{'tableName':_0x9df7('0x7'),'paranoid':![],'indexes':[],'timestamps':!![]});};
\ No newline at end of file
+var _0xf4d6=['./squareOdbc.attributes','define','square_odbc','lodash','util','../../config/logger','api','moment','bluebird','request-promise','path','rimraf','../../config/environment'];(function(_0x3d3acb,_0xc9fb78){var _0xf5aff=function(_0x3f697a){while(--_0x3f697a){_0x3d3acb['push'](_0x3d3acb['shift']());}};_0xf5aff(++_0xc9fb78);}(_0xf4d6,0xc6));var _0x6f4d=function(_0x2c4429,_0x318b72){_0x2c4429=_0x2c4429-0x0;var _0x577c9a=_0xf4d6[_0x2c4429];return _0x577c9a;};'use strict';var _=require(_0x6f4d('0x0'));var util=require(_0x6f4d('0x1'));var logger=require(_0x6f4d('0x2'))(_0x6f4d('0x3'));var moment=require(_0x6f4d('0x4'));var BPromise=require(_0x6f4d('0x5'));var rp=require(_0x6f4d('0x6'));var fs=require('fs');var path=require(_0x6f4d('0x7'));var rimraf=require(_0x6f4d('0x8'));var config=require(_0x6f4d('0x9'));var attributes=require(_0x6f4d('0xa'));module['exports']=function(_0x23b041,_0x21de03){return _0x23b041[_0x6f4d('0xb')]('SquareOdbc',attributes,{'tableName':_0x6f4d('0xc'),'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 41e890d..473f830 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 _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(_0x4cc3a4,_0x219374){var _0x3f64c2=function(_0x5772fa){while(--_0x5772fa){_0x4cc3a4['push'](_0x4cc3a4['shift']());}};_0x3f64c2(++_0x219374);}(_0xe14b,0x93));var _0xbe14=function(_0xfc4ce3,_0x417f0d){_0xfc4ce3=_0xfc4ce3-0x0;var _0x2fb706=_0xe14b[_0xfc4ce3];return _0x2fb706;};'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
+var _0x008c=['stringify','ShowSquareOdbc','lodash','util','moment','bluebird','randomstring','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','client','http','info','SquareOdbc,\x20%s,\x20%s,\x20%s','request\x20sent','error','code','SquareOdbc,\x20%s,\x20%s','message','catch','find','options','include','map','attributes','model','then'];(function(_0x222c59,_0x40783f){var _0x1b9ee3=function(_0x3d7100){while(--_0x3d7100){_0x222c59['push'](_0x222c59['shift']());}};_0x1b9ee3(++_0x40783f);}(_0x008c,0x188));var _0xc008=function(_0x21774b,_0x4a6d2b){_0x21774b=_0x21774b-0x0;var _0x4675b2=_0x008c[_0x21774b];return _0x4675b2;};'use strict';var _=require(_0xc008('0x0'));var util=require(_0xc008('0x1'));var moment=require(_0xc008('0x2'));var BPromise=require(_0xc008('0x3'));var rs=require(_0xc008('0x4'));var fs=require('fs');var Redis=require('ioredis');var db=require(_0xc008('0x5'))['db'];var utils=require(_0xc008('0x6'));var logger=require(_0xc008('0x7'))(_0xc008('0x8'));var config=require(_0xc008('0x9'));var jayson=require(_0xc008('0xa'));var client=jayson[_0xc008('0xb')][_0xc008('0xc')]({'port':0x232a});function respondWithRpcPromise(_0x9c8cb2,_0x4af530,_0x428fa9){return new BPromise(function(_0x5aa09b,_0x30be38){return client['request'](_0x9c8cb2,_0x428fa9)['then'](function(_0x27830d){logger[_0xc008('0xd')]('SquareOdbc,\x20%s,\x20%s',_0x4af530,'request\x20sent');logger['debug'](_0xc008('0xe'),_0x4af530,_0xc008('0xf'),JSON['stringify'](_0x27830d));if(_0x27830d[_0xc008('0x10')]){if(_0x27830d[_0xc008('0x10')][_0xc008('0x11')]===0x1f4){logger[_0xc008('0x10')](_0xc008('0x12'),_0x4af530,_0x27830d[_0xc008('0x10')][_0xc008('0x13')]);return _0x30be38(_0x27830d['error']['message']);}logger[_0xc008('0x10')]('SquareOdbc,\x20%s,\x20%s',_0x4af530,_0x27830d[_0xc008('0x10')][_0xc008('0x13')]);return _0x5aa09b(_0x27830d[_0xc008('0x10')][_0xc008('0x13')]);}else{logger[_0xc008('0xd')]('SquareOdbc,\x20%s,\x20%s',_0x4af530,'request\x20sent');_0x5aa09b(_0x27830d['result'][_0xc008('0x13')]);}})[_0xc008('0x14')](function(_0x3cafe3){logger[_0xc008('0x10')]('SquareOdbc,\x20%s,\x20%s',_0x4af530,_0x3cafe3);_0x30be38(_0x3cafe3);});});}exports['ShowSquareOdbc']=function(_0x540e45){var _0x5c2668=this;return new Promise(function(_0x46042b,_0x462af5){return db['SquareOdbc'][_0xc008('0x15')]({'raw':_0x540e45['options']?_0x540e45['options']['raw']===undefined?!![]:![]:!![],'where':_0x540e45['options']?_0x540e45[_0xc008('0x16')]['where']||null:null,'attributes':_0x540e45['options']?_0x540e45['options']['attributes']||null:null,'include':_0x540e45['options']?_0x540e45[_0xc008('0x16')][_0xc008('0x17')]?_[_0xc008('0x18')](_0x540e45[_0xc008('0x16')][_0xc008('0x17')],function(_0x110128){return{'model':db[_0x110128['model']],'as':_0x110128['as'],'attributes':_0x110128[_0xc008('0x19')],'include':_0x110128['include']?_['map'](_0x110128[_0xc008('0x17')],function(_0x36f358){return{'model':db[_0x36f358[_0xc008('0x1a')]],'as':_0x36f358['as'],'attributes':_0x36f358[_0xc008('0x19')],'include':_0x36f358['include']?_['map'](_0x36f358['include'],function(_0x3f7b07){return{'model':db[_0x3f7b07[_0xc008('0x1a')]],'as':_0x3f7b07['as'],'attributes':_0x3f7b07[_0xc008('0x19')]};}):[]};}):[]};}):[]:[]})[_0xc008('0x1b')](function(_0x5bebd9){logger['info']('ShowSquareOdbc',_0x540e45);logger['debug']('ShowSquareOdbc',_0x540e45,JSON[_0xc008('0x1c')](_0x5bebd9));_0x46042b(_0x5bebd9);})[_0xc008('0x14')](function(_0x25eae4){logger['error'](_0xc008('0x1d'),_0x25eae4[_0xc008('0x13')],_0x540e45);_0x462af5(_0x5c2668[_0xc008('0x10')](0x1f4,_0x25eae4[_0xc008('0x13')]));});});};
\ No newline at end of file
diff --git a/server/api/squareProject/index.js b/server/api/squareProject/index.js
index 9f28573..4786145 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 _0x9ffd=['destroy','removeUsers','multer','util','path','express','Router','../../components/auth/service','../../components/interaction/service','./squareProject.controller','get','index','/:id','isAuthenticated','show','/:id/users','getUsers','addUsers','put','update','delete'];(function(_0x15457c,_0x4a1230){var _0x418505=function(_0x43b34c){while(--_0x43b34c){_0x15457c['push'](_0x15457c['shift']());}};_0x418505(++_0x4a1230);}(_0x9ffd,0xaa));var _0xd9ff=function(_0x2dc7e9,_0x30e2f2){_0x2dc7e9=_0x2dc7e9-0x0;var _0x529a09=_0x9ffd[_0x2dc7e9];return _0x529a09;};'use strict';var multer=require(_0xd9ff('0x0'));var util=require(_0xd9ff('0x1'));var path=require(_0xd9ff('0x2'));var timeout=require('connect-timeout');var express=require(_0xd9ff('0x3'));var router=express[_0xd9ff('0x4')]();var auth=require(_0xd9ff('0x5'));var interaction=require(_0xd9ff('0x6'));var config=require('../../config/environment');var controller=require(_0xd9ff('0x7'));router[_0xd9ff('0x8')]('/',auth['isAuthenticated'](),controller[_0xd9ff('0x9')]);router[_0xd9ff('0x8')](_0xd9ff('0xa'),auth[_0xd9ff('0xb')](),controller[_0xd9ff('0xc')]);router[_0xd9ff('0x8')](_0xd9ff('0xd'),auth[_0xd9ff('0xb')](),controller[_0xd9ff('0xe')]);router['post']('/',auth['isAuthenticated'](),controller['create']);router['post'](_0xd9ff('0xd'),auth[_0xd9ff('0xb')](),controller[_0xd9ff('0xf')]);router[_0xd9ff('0x10')](_0xd9ff('0xa'),auth[_0xd9ff('0xb')](),controller[_0xd9ff('0x11')]);router[_0xd9ff('0x12')]('/:id',auth['isAuthenticated'](),controller[_0xd9ff('0x13')]);router[_0xd9ff('0x12')](_0xd9ff('0xd'),auth[_0xd9ff('0xb')](),controller[_0xd9ff('0x14')]);module['exports']=router;
\ No newline at end of file
+var _0x36ee=['removeUsers','path','express','Router','../../components/auth/service','../../components/interaction/service','../../config/environment','./squareProject.controller','get','isAuthenticated','index','/:id','getUsers','post','create','/:id/users','addUsers','put','update','delete','destroy'];(function(_0x26537d,_0x5a374d){var _0x4feddf=function(_0x3df025){while(--_0x3df025){_0x26537d['push'](_0x26537d['shift']());}};_0x4feddf(++_0x5a374d);}(_0x36ee,0xe8));var _0xe36e=function(_0x1facfa,_0x1acf7d){_0x1facfa=_0x1facfa-0x0;var _0x9ec701=_0x36ee[_0x1facfa];return _0x9ec701;};'use strict';var multer=require('multer');var util=require('util');var path=require(_0xe36e('0x0'));var timeout=require('connect-timeout');var express=require(_0xe36e('0x1'));var router=express[_0xe36e('0x2')]();var auth=require(_0xe36e('0x3'));var interaction=require(_0xe36e('0x4'));var config=require(_0xe36e('0x5'));var controller=require(_0xe36e('0x6'));router[_0xe36e('0x7')]('/',auth[_0xe36e('0x8')](),controller[_0xe36e('0x9')]);router[_0xe36e('0x7')](_0xe36e('0xa'),auth[_0xe36e('0x8')](),controller['show']);router[_0xe36e('0x7')]('/:id/users',auth[_0xe36e('0x8')](),controller[_0xe36e('0xb')]);router[_0xe36e('0xc')]('/',auth['isAuthenticated'](),controller[_0xe36e('0xd')]);router['post'](_0xe36e('0xe'),auth[_0xe36e('0x8')](),controller[_0xe36e('0xf')]);router[_0xe36e('0x10')](_0xe36e('0xa'),auth[_0xe36e('0x8')](),controller[_0xe36e('0x11')]);router[_0xe36e('0x12')]('/:id',auth[_0xe36e('0x8')](),controller[_0xe36e('0x13')]);router[_0xe36e('0x12')](_0xe36e('0xe'),auth['isAuthenticated'](),controller[_0xe36e('0x14')]);module['exports']=router;
\ No newline at end of file
diff --git a/server/api/squareProject/squareProject.attributes.js b/server/api/squareProject/squareProject.attributes.js
index 320ee7e..368b9d2 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 _0x066a=['long','getDataValue','preproduction','toString','utf8','production','exports','STRING','BLOB'];(function(_0x1284b2,_0x9996e2){var _0x5bf52e=function(_0x4cb6fb){while(--_0x4cb6fb){_0x1284b2['push'](_0x1284b2['shift']());}};_0x5bf52e(++_0x9996e2);}(_0x066a,0x96));var _0xa066=function(_0x2a75c8,_0x1e2cbd){_0x2a75c8=_0x2a75c8-0x0;var _0x20bd31=_0x066a[_0x2a75c8];return _0x20bd31;};'use strict';var Sequelize=require('sequelize');module[_0xa066('0x0')]={'name':{'type':Sequelize[_0xa066('0x1')],'unique':'name','allowNull':![]},'description':{'type':Sequelize[_0xa066('0x1')]},'notes':{'type':Sequelize['TEXT']},'preproduction':{'type':Sequelize[_0xa066('0x2')](_0xa066('0x3')),'get':function(){if(this[_0xa066('0x4')](_0xa066('0x5'))){return this[_0xa066('0x4')]('preproduction')[_0xa066('0x6')](_0xa066('0x7'));}}},'production':{'type':Sequelize['BLOB']('long'),'get':function(){if(this['getDataValue'](_0xa066('0x8'))){return this[_0xa066('0x4')]('production')[_0xa066('0x6')](_0xa066('0x7'));}}}};
\ No newline at end of file
+var _0x6281=['TEXT','BLOB','long','getDataValue','preproduction','toString','utf8','sequelize','exports','name','STRING'];(function(_0x72db6b,_0x5aec13){var _0x43a957=function(_0x3d2608){while(--_0x3d2608){_0x72db6b['push'](_0x72db6b['shift']());}};_0x43a957(++_0x5aec13);}(_0x6281,0x13b));var _0x1628=function(_0x11824c,_0x2a27b7){_0x11824c=_0x11824c-0x0;var _0x3b9344=_0x6281[_0x11824c];return _0x3b9344;};'use strict';var Sequelize=require(_0x1628('0x0'));module[_0x1628('0x1')]={'name':{'type':Sequelize['STRING'],'unique':_0x1628('0x2'),'allowNull':![]},'description':{'type':Sequelize[_0x1628('0x3')]},'notes':{'type':Sequelize[_0x1628('0x4')]},'preproduction':{'type':Sequelize[_0x1628('0x5')](_0x1628('0x6')),'get':function(){if(this[_0x1628('0x7')]('preproduction')){return this[_0x1628('0x7')](_0x1628('0x8'))[_0x1628('0x9')](_0x1628('0xa'));}}},'production':{'type':Sequelize[_0x1628('0x5')](_0x1628('0x6')),'get':function(){if(this['getDataValue']('production')){return this['getDataValue']('production')[_0x1628('0x9')](_0x1628('0xa'));}}}};
\ No newline at end of file
diff --git a/server/api/squareProject/squareProject.controller.js b/server/api/squareProject/squareProject.controller.js
index f3c49a3..4e62766 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 _0x6f7a=['intersection','query','attributes','fields','nolimit','order','sort','where','merge','VIRTUAL','filter','options','includeAll','include','findAll','rows','show','params','create','body','get','role','SquareProjects','UserProfileSection','find','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','catch','update','addUsers','ids','omit','removeUsers','isArray','length','userSquareProject:remove','emit','getUsers','findOne','User','rawAttributes','pick','hasOwnProperty','html-pdf','eml-format','rimraf','zip-dir','request-promise','moment','bluebird','mustache','util','path','sox','to-csv','ejs','lodash','squel','desk.js','querystring','papaparse','ioredis','../../components/parsers/advancedSearch','../../config/license/hardware','api','../../config/environment','../../mysqldb','redis','defaults','localhost','./squareProject.socket','register','sendStatus','end','status','json','count','offset','limit','set','Content-Range','apply','then','UserProfileResource','destroy','error','stack','name','send','index','map','SquareProject','fieldName','type','key','model','keys','filters'];(function(_0x4f749f,_0x27cc25){var _0x4d7344=function(_0x4942ab){while(--_0x4942ab){_0x4f749f['push'](_0x4f749f['shift']());}};_0x4d7344(++_0x27cc25);}(_0x6f7a,0x1ae));var _0xa6f7=function(_0x492e0c,_0xdf39c3){_0x492e0c=_0x492e0c-0x0;var _0x213585=_0x6f7a[_0x492e0c];return _0x213585;};'use strict';var pdf=require(_0xa6f7('0x0'));var emlformat=require(_0xa6f7('0x1'));var rimraf=require(_0xa6f7('0x2'));var zipdir=require(_0xa6f7('0x3'));var jsonpatch=require('fast-json-patch');var rp=require(_0xa6f7('0x4'));var moment=require(_0xa6f7('0x5'));var BPromise=require(_0xa6f7('0x6'));var Mustache=require(_0xa6f7('0x7'));var util=require(_0xa6f7('0x8'));var path=require(_0xa6f7('0x9'));var sox=require(_0xa6f7('0xa'));var csv=require(_0xa6f7('0xb'));var ejs=require(_0xa6f7('0xc'));var fs=require('fs');var _=require(_0xa6f7('0xd'));var squel=require(_0xa6f7('0xe'));var crypto=require('crypto');var jsforce=require('jsforce');var deskjs=require(_0xa6f7('0xf'));var toCsv=require(_0xa6f7('0xb'));var querystring=require(_0xa6f7('0x10'));var Papa=require(_0xa6f7('0x11'));var Redis=require(_0xa6f7('0x12'));var authService=require('../../components/auth/service');var qs=require('../../components/parsers/qs');var as=require(_0xa6f7('0x13'));var hardwareService=require(_0xa6f7('0x14'));var logger=require('../../config/logger')(_0xa6f7('0x15'));var utils=require('../../config/utils');var config=require(_0xa6f7('0x16'));var db=require(_0xa6f7('0x17'))['db'];config[_0xa6f7('0x18')]=_[_0xa6f7('0x19')](config['redis'],{'host':_0xa6f7('0x1a'),'port':0x18eb});var socket=require('socket.io-emitter')(new Redis(config[_0xa6f7('0x18')]));require(_0xa6f7('0x1b'))[_0xa6f7('0x1c')](socket);function respondWithStatusCode(_0x4d3d59,_0x34c02d){_0x34c02d=_0x34c02d||0xcc;return function(_0x491fae){if(_0x491fae){return _0x4d3d59[_0xa6f7('0x1d')](_0x34c02d);}return _0x4d3d59['status'](_0x34c02d)[_0xa6f7('0x1e')]();};}function respondWithResult(_0x17f9c5,_0x6efd38){_0x6efd38=_0x6efd38||0xc8;return function(_0x47e664){if(_0x47e664){return _0x17f9c5[_0xa6f7('0x1f')](_0x6efd38)[_0xa6f7('0x20')](_0x47e664);}};}function respondWithFilteredResult(_0x131959,_0x2401b9){return function(_0x5681d5){if(_0x5681d5){var _0x4a8827=_0x5681d5[_0xa6f7('0x21')],_0xba7755=_0x2401b9['offset'],_0x5298ba=_0x2401b9[_0xa6f7('0x22')]+_0x2401b9[_0xa6f7('0x23')],_0x378967;if(_0x5298ba>=_0x4a8827){_0x5298ba=_0x4a8827;_0x378967=0xc8;}else{_0x378967=0xce;}_0x131959[_0xa6f7('0x1f')](_0x378967);return _0x131959[_0xa6f7('0x24')](_0xa6f7('0x25'),_0xba7755+'-'+_0x5298ba+'/'+_0x4a8827)[_0xa6f7('0x20')](_0x5681d5);}return null;};}function patchUpdates(_0x4887ad){return function(_0x3c0c55){try{jsonpatch[_0xa6f7('0x26')](_0x3c0c55,_0x4887ad,!![]);}catch(_0x58b6a1){return BPromise['reject'](_0x58b6a1);}return _0x3c0c55['save']();};}function saveUpdates(_0x1de6c9,_0x119950){return function(_0x566b63){if(_0x566b63){return _0x566b63['update'](_0x1de6c9)['then'](function(_0x2b6a84){return _0x2b6a84;});}return null;};}function removeEntity(_0xc77e8e,_0x28263e){return function(_0x5baaa9){if(_0x5baaa9){return _0x5baaa9['destroy']()[_0xa6f7('0x27')](function(){var _0x53b3c2=_0x5baaa9['get']({'plain':!![]});var _0x402d25='SquareProjects';return db[_0xa6f7('0x28')][_0xa6f7('0x29')]({'where':{'type':_0x402d25,'resourceId':_0x53b3c2['id']}})[_0xa6f7('0x27')](function(){return _0x5baaa9;});})[_0xa6f7('0x27')](function(){_0xc77e8e[_0xa6f7('0x1f')](0xcc)['end']();});}};}function handleEntityNotFound(_0x51db47,_0x1c419b){return function(_0x2ad0d9){if(!_0x2ad0d9){_0x51db47['sendStatus'](0x194);}return _0x2ad0d9;};}function handleError(_0x267917,_0x27babb){_0x27babb=_0x27babb||0x1f4;return function(_0x87bccc){logger[_0xa6f7('0x2a')](_0x87bccc[_0xa6f7('0x2b')]);if(_0x87bccc[_0xa6f7('0x2c')]){delete _0x87bccc[_0xa6f7('0x2c')];}_0x267917[_0xa6f7('0x1f')](_0x27babb)[_0xa6f7('0x2d')](_0x87bccc);};}exports[_0xa6f7('0x2e')]=function(_0x40b0f8,_0x278bad){var _0x52f9c1={},_0x442ccf={},_0x42dc49={'count':0x0,'rows':[]};var _0x5bf8e3=_[_0xa6f7('0x2f')](db[_0xa6f7('0x30')]['rawAttributes'],function(_0x55179e){return{'name':_0x55179e[_0xa6f7('0x31')],'type':_0x55179e[_0xa6f7('0x32')][_0xa6f7('0x33')]};});_0x442ccf[_0xa6f7('0x34')]=_[_0xa6f7('0x2f')](_0x5bf8e3,'name');_0x442ccf['query']=_[_0xa6f7('0x35')](_0x40b0f8['query']);_0x442ccf[_0xa6f7('0x36')]=_[_0xa6f7('0x37')](_0x442ccf[_0xa6f7('0x34')],_0x442ccf[_0xa6f7('0x38')]);_0x52f9c1[_0xa6f7('0x39')]=_[_0xa6f7('0x37')](_0x442ccf['model'],qs[_0xa6f7('0x3a')](_0x40b0f8[_0xa6f7('0x38')][_0xa6f7('0x3a')]));_0x52f9c1['attributes']=_0x52f9c1[_0xa6f7('0x39')]['length']?_0x52f9c1[_0xa6f7('0x39')]:_0x442ccf[_0xa6f7('0x34')];if(!_0x40b0f8[_0xa6f7('0x38')]['hasOwnProperty'](_0xa6f7('0x3b'))){_0x52f9c1[_0xa6f7('0x23')]=qs[_0xa6f7('0x23')](_0x40b0f8[_0xa6f7('0x38')][_0xa6f7('0x23')]);_0x52f9c1[_0xa6f7('0x22')]=qs['offset'](_0x40b0f8[_0xa6f7('0x38')][_0xa6f7('0x22')]);}_0x52f9c1[_0xa6f7('0x3c')]=qs[_0xa6f7('0x3d')](_0x40b0f8[_0xa6f7('0x38')][_0xa6f7('0x3d')]);_0x52f9c1[_0xa6f7('0x3e')]=qs[_0xa6f7('0x36')](_['pick'](_0x40b0f8[_0xa6f7('0x38')],_0x442ccf[_0xa6f7('0x36')]));if(_0x40b0f8[_0xa6f7('0x38')]['filter']){_0x52f9c1[_0xa6f7('0x3e')]=_[_0xa6f7('0x3f')](_0x52f9c1['where'],{'$or':_[_0xa6f7('0x2f')](_0x5bf8e3,function(_0x13c7c4){if(_0x13c7c4[_0xa6f7('0x32')]!==_0xa6f7('0x40')){var _0x40aaf5={};_0x40aaf5[_0x13c7c4['name']]={'$like':'%'+_0x40b0f8[_0xa6f7('0x38')][_0xa6f7('0x41')]+'%'};return _0x40aaf5;}})});}_0x52f9c1=_[_0xa6f7('0x3f')]({},_0x52f9c1,_0x40b0f8[_0xa6f7('0x42')]);var _0x3998fd={'where':_0x52f9c1[_0xa6f7('0x3e')]};return db[_0xa6f7('0x30')][_0xa6f7('0x21')](_0x3998fd)['then'](function(_0x5ac005){_0x42dc49[_0xa6f7('0x21')]=_0x5ac005;if(_0x40b0f8[_0xa6f7('0x38')][_0xa6f7('0x43')]){_0x52f9c1[_0xa6f7('0x44')]=[{'all':!![]}];}return db[_0xa6f7('0x30')][_0xa6f7('0x45')](_0x52f9c1);})[_0xa6f7('0x27')](function(_0x404552){_0x42dc49[_0xa6f7('0x46')]=_0x404552;return _0x42dc49;})[_0xa6f7('0x27')](respondWithFilteredResult(_0x278bad,_0x52f9c1))['catch'](handleError(_0x278bad,null));};exports[_0xa6f7('0x47')]=function(_0x30be3b,_0x4d5846){var _0x22d500={'raw':![],'where':{'id':_0x30be3b[_0xa6f7('0x48')]['id']}},_0x28778f={};_0x28778f[_0xa6f7('0x34')]=_['keys'](db[_0xa6f7('0x30')]['rawAttributes']);_0x28778f['query']=_[_0xa6f7('0x35')](_0x30be3b[_0xa6f7('0x38')]);_0x28778f[_0xa6f7('0x36')]=_[_0xa6f7('0x37')](_0x28778f[_0xa6f7('0x34')],_0x28778f[_0xa6f7('0x38')]);_0x22d500[_0xa6f7('0x39')]=_['intersection'](_0x28778f[_0xa6f7('0x34')],qs[_0xa6f7('0x3a')](_0x30be3b['query'][_0xa6f7('0x3a')]));_0x22d500[_0xa6f7('0x39')]=_0x22d500[_0xa6f7('0x39')]['length']?_0x22d500[_0xa6f7('0x39')]:_0x28778f['model'];if(_0x30be3b[_0xa6f7('0x38')][_0xa6f7('0x43')]){_0x22d500[_0xa6f7('0x44')]=[{'all':!![]}];}_0x22d500=_['merge']({},_0x22d500,_0x30be3b['options']);return db[_0xa6f7('0x30')]['find'](_0x22d500)[_0xa6f7('0x27')](handleEntityNotFound(_0x4d5846,null))['then'](respondWithResult(_0x4d5846,null))['catch'](handleError(_0x4d5846,null));};exports[_0xa6f7('0x49')]=function(_0x2e3a04,_0x350071){return db[_0xa6f7('0x30')][_0xa6f7('0x49')](_0x2e3a04[_0xa6f7('0x4a')],{})['then'](function(_0x4032fc){var _0x328b47=_0x2e3a04['user'][_0xa6f7('0x4b')]({'plain':!![]});if(!_0x328b47)throw new Error('Unable\x20to\x20retrieve\x20the\x20current\x20user');if(_0x328b47[_0xa6f7('0x4c')]==='user'){var _0x488efc=_0x4032fc[_0xa6f7('0x4b')]({'plain':!![]});var _0x158af5=_0xa6f7('0x4d');return db[_0xa6f7('0x4e')][_0xa6f7('0x4f')]({'where':{'name':_0x158af5,'userProfileId':_0x328b47['userProfileId']},'raw':!![]})[_0xa6f7('0x27')](function(_0x34de29){if(_0x34de29&&_0x34de29['autoAssociation']===0x0){return db[_0xa6f7('0x28')]['create']({'name':_0x488efc[_0xa6f7('0x2c')],'resourceId':_0x488efc['id'],'type':_0x34de29[_0xa6f7('0x2c')],'sectionId':_0x34de29['id']},{})[_0xa6f7('0x27')](function(){return _0x4032fc;});}else{return _0x4032fc;}})['catch'](function(_0x287b4a){logger['error'](_0xa6f7('0x50'),_0x287b4a);throw _0x287b4a;});}return _0x4032fc;})[_0xa6f7('0x27')](respondWithResult(_0x350071,0xc9))[_0xa6f7('0x51')](handleError(_0x350071,null));};exports[_0xa6f7('0x52')]=function(_0xa6bff9,_0x5628a0){if(_0xa6bff9['body']['id']){delete _0xa6bff9[_0xa6f7('0x4a')]['id'];}return db[_0xa6f7('0x30')][_0xa6f7('0x4f')]({'where':{'id':_0xa6bff9[_0xa6f7('0x48')]['id']}})['then'](handleEntityNotFound(_0x5628a0,null))[_0xa6f7('0x27')](saveUpdates(_0xa6bff9[_0xa6f7('0x4a')],null))[_0xa6f7('0x27')](respondWithResult(_0x5628a0,null))[_0xa6f7('0x51')](handleError(_0x5628a0,null));};exports[_0xa6f7('0x29')]=function(_0x39538e,_0x5794a6){return db[_0xa6f7('0x30')][_0xa6f7('0x4f')]({'where':{'id':_0x39538e[_0xa6f7('0x48')]['id']}})['then'](handleEntityNotFound(_0x5794a6,null))[_0xa6f7('0x27')](removeEntity(_0x5794a6,null))[_0xa6f7('0x51')](handleError(_0x5794a6,null));};exports[_0xa6f7('0x53')]=function(_0x4496f1,_0x5908e3,_0x4ec005){return db[_0xa6f7('0x30')][_0xa6f7('0x4f')]({'where':{'id':_0x4496f1[_0xa6f7('0x48')]['id']}})[_0xa6f7('0x27')](handleEntityNotFound(_0x5908e3,null))[_0xa6f7('0x27')](function(_0x269249){if(_0x269249){return _0x269249[_0xa6f7('0x53')](_0x4496f1['body'][_0xa6f7('0x54')],_[_0xa6f7('0x55')](_0x4496f1[_0xa6f7('0x4a')],[_0xa6f7('0x54'),'id'])||{});}})[_0xa6f7('0x27')](respondWithResult(_0x5908e3,null))[_0xa6f7('0x51')](handleError(_0x5908e3,null));};exports[_0xa6f7('0x56')]=function(_0x3bc870,_0x444177,_0x186956){return db[_0xa6f7('0x30')]['find']({'where':{'id':_0x3bc870[_0xa6f7('0x48')]['id']}})['then'](handleEntityNotFound(_0x444177,null))[_0xa6f7('0x27')](function(_0x47a2b1){if(_0x47a2b1){return _0x47a2b1[_0xa6f7('0x56')](_0x3bc870[_0xa6f7('0x38')]['ids'])[_0xa6f7('0x27')](function(){if(_[_0xa6f7('0x57')](_0x3bc870[_0xa6f7('0x38')]['ids'])){for(var _0x3e30df=0x0;_0x3e30df<_0x3bc870['query'][_0xa6f7('0x54')][_0xa6f7('0x58')];_0x3e30df+=0x1){socket['emit'](_0xa6f7('0x59'),{'UserId':Number(_0x3bc870['query'][_0xa6f7('0x54')][_0x3e30df]),'SquareProjectId':Number(_0x3bc870['params']['id'])});}}else{socket[_0xa6f7('0x5a')](_0xa6f7('0x59'),{'UserId':Number(_0x3bc870[_0xa6f7('0x38')][_0xa6f7('0x54')]),'SquareProjectId':Number(_0x3bc870[_0xa6f7('0x48')]['id'])});}});}})[_0xa6f7('0x27')](respondWithStatusCode(_0x444177,null))[_0xa6f7('0x51')](handleError(_0x444177,null));};exports[_0xa6f7('0x5b')]=function(_0x153635,_0x16ef40,_0x110ea5){var _0x41545e={};var _0x4b0434={};var _0x2bd05c;var _0x3c0c6e;return db[_0xa6f7('0x30')][_0xa6f7('0x5c')]({'where':{'id':_0x153635[_0xa6f7('0x48')]['id']}})[_0xa6f7('0x27')](handleEntityNotFound(_0x16ef40,null))[_0xa6f7('0x27')](function(_0x3a5700){if(_0x3a5700){_0x2bd05c=_0x3a5700;_0x4b0434['model']=_[_0xa6f7('0x35')](db[_0xa6f7('0x5d')][_0xa6f7('0x5e')]);_0x4b0434['query']=_[_0xa6f7('0x35')](_0x153635[_0xa6f7('0x38')]);_0x4b0434[_0xa6f7('0x36')]=_[_0xa6f7('0x37')](_0x4b0434[_0xa6f7('0x34')],_0x4b0434[_0xa6f7('0x38')]);_0x41545e[_0xa6f7('0x39')]=_[_0xa6f7('0x37')](_0x4b0434['model'],qs['fields'](_0x153635[_0xa6f7('0x38')][_0xa6f7('0x3a')]));_0x41545e['attributes']=_0x41545e[_0xa6f7('0x39')][_0xa6f7('0x58')]?_0x41545e[_0xa6f7('0x39')]:_0x4b0434['model'];_0x41545e[_0xa6f7('0x3c')]=qs['sort'](_0x153635['query']['sort']);_0x41545e['where']=qs['filters'](_[_0xa6f7('0x5f')](_0x153635[_0xa6f7('0x38')],_0x4b0434[_0xa6f7('0x36')]));if(_0x153635['query'][_0xa6f7('0x41')]){_0x41545e[_0xa6f7('0x3e')]=_[_0xa6f7('0x3f')](_0x41545e[_0xa6f7('0x3e')],{'$or':_[_0xa6f7('0x2f')](_0x41545e[_0xa6f7('0x39')],function(_0x473d40){var _0x137145={};_0x137145[_0x473d40]={'$like':'%'+_0x153635[_0xa6f7('0x38')][_0xa6f7('0x41')]+'%'};return _0x137145;})});}_0x41545e=_['merge']({},_0x41545e,_0x153635[_0xa6f7('0x42')]);return _0x2bd05c[_0xa6f7('0x5b')](_0x41545e);}})[_0xa6f7('0x27')](function(_0x380b79){if(_0x380b79){_0x3c0c6e=_0x380b79[_0xa6f7('0x58')];if(!_0x153635[_0xa6f7('0x38')][_0xa6f7('0x60')](_0xa6f7('0x3b'))){_0x41545e[_0xa6f7('0x23')]=qs[_0xa6f7('0x23')](_0x153635[_0xa6f7('0x38')]['limit']);_0x41545e['offset']=qs[_0xa6f7('0x22')](_0x153635[_0xa6f7('0x38')][_0xa6f7('0x22')]);}return _0x2bd05c['getUsers'](_0x41545e);}})[_0xa6f7('0x27')](function(_0x36decb){if(_0x36decb){return _0x36decb?{'count':_0x3c0c6e,'rows':_0x36decb}:null;}})['then'](respondWithResult(_0x16ef40,null))[_0xa6f7('0x51')](handleError(_0x16ef40,null));};
\ No newline at end of file
+var _0x9b9b=['to-csv','ejs','lodash','squel','crypto','jsforce','desk.js','ioredis','../../components/auth/service','../../components/parsers/qs','../../config/license/hardware','../../config/logger','api','../../config/environment','../../mysqldb','redis','defaults','localhost','./squareProject.socket','sendStatus','status','end','count','offset','limit','set','Content-Range','json','apply','reject','then','destroy','SquareProjects','UserProfileResource','error','stack','name','send','index','map','SquareProject','rawAttributes','fieldName','type','key','model','query','filters','intersection','attributes','fields','nolimit','order','sort','where','pick','filter','merge','VIRTUAL','options','include','catch','show','params','keys','length','includeAll','find','create','body','user','get','UserProfileSection','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','update','addUsers','omit','ids','removeUsers','isArray','emit','userSquareProject:remove','getUsers','findOne','User','hasOwnProperty','eml-format','fast-json-patch','request-promise','moment','bluebird','mustache','util','path','sox'];(function(_0x4d191c,_0x171ee1){var _0x2bd7ca=function(_0x3b5af0){while(--_0x3b5af0){_0x4d191c['push'](_0x4d191c['shift']());}};_0x2bd7ca(++_0x171ee1);}(_0x9b9b,0x114));var _0xb9b9=function(_0x43077b,_0x2e8274){_0x43077b=_0x43077b-0x0;var _0x429348=_0x9b9b[_0x43077b];return _0x429348;};'use strict';var pdf=require('html-pdf');var emlformat=require(_0xb9b9('0x0'));var rimraf=require('rimraf');var zipdir=require('zip-dir');var jsonpatch=require(_0xb9b9('0x1'));var rp=require(_0xb9b9('0x2'));var moment=require(_0xb9b9('0x3'));var BPromise=require(_0xb9b9('0x4'));var Mustache=require(_0xb9b9('0x5'));var util=require(_0xb9b9('0x6'));var path=require(_0xb9b9('0x7'));var sox=require(_0xb9b9('0x8'));var csv=require(_0xb9b9('0x9'));var ejs=require(_0xb9b9('0xa'));var fs=require('fs');var _=require(_0xb9b9('0xb'));var squel=require(_0xb9b9('0xc'));var crypto=require(_0xb9b9('0xd'));var jsforce=require(_0xb9b9('0xe'));var deskjs=require(_0xb9b9('0xf'));var toCsv=require(_0xb9b9('0x9'));var querystring=require('querystring');var Papa=require('papaparse');var Redis=require(_0xb9b9('0x10'));var authService=require(_0xb9b9('0x11'));var qs=require(_0xb9b9('0x12'));var as=require('../../components/parsers/advancedSearch');var hardwareService=require(_0xb9b9('0x13'));var logger=require(_0xb9b9('0x14'))(_0xb9b9('0x15'));var utils=require('../../config/utils');var config=require(_0xb9b9('0x16'));var db=require(_0xb9b9('0x17'))['db'];config[_0xb9b9('0x18')]=_[_0xb9b9('0x19')](config[_0xb9b9('0x18')],{'host':_0xb9b9('0x1a'),'port':0x18eb});var socket=require('socket.io-emitter')(new Redis(config['redis']));require(_0xb9b9('0x1b'))['register'](socket);function respondWithStatusCode(_0xe78d58,_0x50e5d6){_0x50e5d6=_0x50e5d6||0xcc;return function(_0x2ba838){if(_0x2ba838){return _0xe78d58[_0xb9b9('0x1c')](_0x50e5d6);}return _0xe78d58[_0xb9b9('0x1d')](_0x50e5d6)[_0xb9b9('0x1e')]();};}function respondWithResult(_0x177ad9,_0x3fd09c){_0x3fd09c=_0x3fd09c||0xc8;return function(_0x42a55f){if(_0x42a55f){return _0x177ad9[_0xb9b9('0x1d')](_0x3fd09c)['json'](_0x42a55f);}};}function respondWithFilteredResult(_0x29689a,_0x48d9ae){return function(_0x403a5b){if(_0x403a5b){var _0x3e6d23=_0x403a5b[_0xb9b9('0x1f')],_0x3a2fed=_0x48d9ae[_0xb9b9('0x20')],_0x11bb05=_0x48d9ae[_0xb9b9('0x20')]+_0x48d9ae[_0xb9b9('0x21')],_0x49b412;if(_0x11bb05>=_0x3e6d23){_0x11bb05=_0x3e6d23;_0x49b412=0xc8;}else{_0x49b412=0xce;}_0x29689a[_0xb9b9('0x1d')](_0x49b412);return _0x29689a[_0xb9b9('0x22')](_0xb9b9('0x23'),_0x3a2fed+'-'+_0x11bb05+'/'+_0x3e6d23)[_0xb9b9('0x24')](_0x403a5b);}return null;};}function patchUpdates(_0xb16391){return function(_0x47d3e3){try{jsonpatch[_0xb9b9('0x25')](_0x47d3e3,_0xb16391,!![]);}catch(_0x1246b9){return BPromise[_0xb9b9('0x26')](_0x1246b9);}return _0x47d3e3['save']();};}function saveUpdates(_0x10b7e1,_0xe1e1d7){return function(_0x1cb58a){if(_0x1cb58a){return _0x1cb58a['update'](_0x10b7e1)[_0xb9b9('0x27')](function(_0x46525d){return _0x46525d;});}return null;};}function removeEntity(_0x5efa01,_0x18e2ca){return function(_0x20e260){if(_0x20e260){return _0x20e260[_0xb9b9('0x28')]()[_0xb9b9('0x27')](function(){var _0x660f18=_0x20e260['get']({'plain':!![]});var _0x4dfa3f=_0xb9b9('0x29');return db[_0xb9b9('0x2a')]['destroy']({'where':{'type':_0x4dfa3f,'resourceId':_0x660f18['id']}})[_0xb9b9('0x27')](function(){return _0x20e260;});})[_0xb9b9('0x27')](function(){_0x5efa01[_0xb9b9('0x1d')](0xcc)[_0xb9b9('0x1e')]();});}};}function handleEntityNotFound(_0x125f6c,_0x54bf18){return function(_0x388042){if(!_0x388042){_0x125f6c['sendStatus'](0x194);}return _0x388042;};}function handleError(_0x1e0c5e,_0xe28f3c){_0xe28f3c=_0xe28f3c||0x1f4;return function(_0x4f47da){logger[_0xb9b9('0x2b')](_0x4f47da[_0xb9b9('0x2c')]);if(_0x4f47da[_0xb9b9('0x2d')]){delete _0x4f47da['name'];}_0x1e0c5e[_0xb9b9('0x1d')](_0xe28f3c)[_0xb9b9('0x2e')](_0x4f47da);};}exports[_0xb9b9('0x2f')]=function(_0x300453,_0x4f002a){var _0xc40dda={},_0xdbc1f1={},_0x49757e={'count':0x0,'rows':[]};var _0x42b31f=_[_0xb9b9('0x30')](db[_0xb9b9('0x31')][_0xb9b9('0x32')],function(_0x5a7f6d){return{'name':_0x5a7f6d[_0xb9b9('0x33')],'type':_0x5a7f6d[_0xb9b9('0x34')][_0xb9b9('0x35')]};});_0xdbc1f1[_0xb9b9('0x36')]=_['map'](_0x42b31f,_0xb9b9('0x2d'));_0xdbc1f1[_0xb9b9('0x37')]=_['keys'](_0x300453[_0xb9b9('0x37')]);_0xdbc1f1[_0xb9b9('0x38')]=_[_0xb9b9('0x39')](_0xdbc1f1[_0xb9b9('0x36')],_0xdbc1f1[_0xb9b9('0x37')]);_0xc40dda[_0xb9b9('0x3a')]=_['intersection'](_0xdbc1f1[_0xb9b9('0x36')],qs[_0xb9b9('0x3b')](_0x300453['query'][_0xb9b9('0x3b')]));_0xc40dda[_0xb9b9('0x3a')]=_0xc40dda[_0xb9b9('0x3a')]['length']?_0xc40dda[_0xb9b9('0x3a')]:_0xdbc1f1['model'];if(!_0x300453[_0xb9b9('0x37')]['hasOwnProperty'](_0xb9b9('0x3c'))){_0xc40dda[_0xb9b9('0x21')]=qs[_0xb9b9('0x21')](_0x300453[_0xb9b9('0x37')][_0xb9b9('0x21')]);_0xc40dda[_0xb9b9('0x20')]=qs[_0xb9b9('0x20')](_0x300453['query']['offset']);}_0xc40dda[_0xb9b9('0x3d')]=qs[_0xb9b9('0x3e')](_0x300453[_0xb9b9('0x37')]['sort']);_0xc40dda[_0xb9b9('0x3f')]=qs['filters'](_[_0xb9b9('0x40')](_0x300453[_0xb9b9('0x37')],_0xdbc1f1[_0xb9b9('0x38')]));if(_0x300453[_0xb9b9('0x37')][_0xb9b9('0x41')]){_0xc40dda[_0xb9b9('0x3f')]=_[_0xb9b9('0x42')](_0xc40dda[_0xb9b9('0x3f')],{'$or':_[_0xb9b9('0x30')](_0x42b31f,function(_0x40058c){if(_0x40058c['type']!==_0xb9b9('0x43')){var _0x2fd1bc={};_0x2fd1bc[_0x40058c[_0xb9b9('0x2d')]]={'$like':'%'+_0x300453[_0xb9b9('0x37')][_0xb9b9('0x41')]+'%'};return _0x2fd1bc;}})});}_0xc40dda=_[_0xb9b9('0x42')]({},_0xc40dda,_0x300453[_0xb9b9('0x44')]);var _0x1f61b9={'where':_0xc40dda[_0xb9b9('0x3f')]};return db[_0xb9b9('0x31')]['count'](_0x1f61b9)[_0xb9b9('0x27')](function(_0x221ded){_0x49757e[_0xb9b9('0x1f')]=_0x221ded;if(_0x300453[_0xb9b9('0x37')]['includeAll']){_0xc40dda[_0xb9b9('0x45')]=[{'all':!![]}];}return db['SquareProject']['findAll'](_0xc40dda);})[_0xb9b9('0x27')](function(_0x2641ec){_0x49757e['rows']=_0x2641ec;return _0x49757e;})['then'](respondWithFilteredResult(_0x4f002a,_0xc40dda))[_0xb9b9('0x46')](handleError(_0x4f002a,null));};exports[_0xb9b9('0x47')]=function(_0x375543,_0x3f4388){var _0x493786={'raw':![],'where':{'id':_0x375543[_0xb9b9('0x48')]['id']}},_0x114782={};_0x114782[_0xb9b9('0x36')]=_['keys'](db['SquareProject'][_0xb9b9('0x32')]);_0x114782['query']=_[_0xb9b9('0x49')](_0x375543[_0xb9b9('0x37')]);_0x114782[_0xb9b9('0x38')]=_[_0xb9b9('0x39')](_0x114782['model'],_0x114782[_0xb9b9('0x37')]);_0x493786[_0xb9b9('0x3a')]=_[_0xb9b9('0x39')](_0x114782[_0xb9b9('0x36')],qs[_0xb9b9('0x3b')](_0x375543[_0xb9b9('0x37')][_0xb9b9('0x3b')]));_0x493786[_0xb9b9('0x3a')]=_0x493786[_0xb9b9('0x3a')][_0xb9b9('0x4a')]?_0x493786[_0xb9b9('0x3a')]:_0x114782[_0xb9b9('0x36')];if(_0x375543['query'][_0xb9b9('0x4b')]){_0x493786['include']=[{'all':!![]}];}_0x493786=_[_0xb9b9('0x42')]({},_0x493786,_0x375543[_0xb9b9('0x44')]);return db[_0xb9b9('0x31')][_0xb9b9('0x4c')](_0x493786)['then'](handleEntityNotFound(_0x3f4388,null))[_0xb9b9('0x27')](respondWithResult(_0x3f4388,null))['catch'](handleError(_0x3f4388,null));};exports[_0xb9b9('0x4d')]=function(_0x576c06,_0x41dfa0){return db[_0xb9b9('0x31')][_0xb9b9('0x4d')](_0x576c06[_0xb9b9('0x4e')],{})[_0xb9b9('0x27')](function(_0x1a406c){var _0x1c2f19=_0x576c06[_0xb9b9('0x4f')][_0xb9b9('0x50')]({'plain':!![]});if(!_0x1c2f19)throw new Error('Unable\x20to\x20retrieve\x20the\x20current\x20user');if(_0x1c2f19['role']==='user'){var _0x124b54=_0x1a406c['get']({'plain':!![]});var _0x2089bd=_0xb9b9('0x29');return db[_0xb9b9('0x51')][_0xb9b9('0x4c')]({'where':{'name':_0x2089bd,'userProfileId':_0x1c2f19['userProfileId']},'raw':!![]})[_0xb9b9('0x27')](function(_0x1f4e9a){if(_0x1f4e9a&&_0x1f4e9a['autoAssociation']===0x0){return db[_0xb9b9('0x2a')][_0xb9b9('0x4d')]({'name':_0x124b54['name'],'resourceId':_0x124b54['id'],'type':_0x1f4e9a['name'],'sectionId':_0x1f4e9a['id']},{})[_0xb9b9('0x27')](function(){return _0x1a406c;});}else{return _0x1a406c;}})[_0xb9b9('0x46')](function(_0xc50f00){logger['error'](_0xb9b9('0x52'),_0xc50f00);throw _0xc50f00;});}return _0x1a406c;})[_0xb9b9('0x27')](respondWithResult(_0x41dfa0,0xc9))['catch'](handleError(_0x41dfa0,null));};exports[_0xb9b9('0x53')]=function(_0xb0b883,_0x2d052d){if(_0xb0b883[_0xb9b9('0x4e')]['id']){delete _0xb0b883['body']['id'];}return db[_0xb9b9('0x31')][_0xb9b9('0x4c')]({'where':{'id':_0xb0b883[_0xb9b9('0x48')]['id']}})['then'](handleEntityNotFound(_0x2d052d,null))[_0xb9b9('0x27')](saveUpdates(_0xb0b883[_0xb9b9('0x4e')],null))[_0xb9b9('0x27')](respondWithResult(_0x2d052d,null))[_0xb9b9('0x46')](handleError(_0x2d052d,null));};exports[_0xb9b9('0x28')]=function(_0x49956d,_0x5b6016){return db[_0xb9b9('0x31')][_0xb9b9('0x4c')]({'where':{'id':_0x49956d[_0xb9b9('0x48')]['id']}})[_0xb9b9('0x27')](handleEntityNotFound(_0x5b6016,null))[_0xb9b9('0x27')](removeEntity(_0x5b6016,null))['catch'](handleError(_0x5b6016,null));};exports[_0xb9b9('0x54')]=function(_0x30e19e,_0x184f9b,_0x340c73){return db[_0xb9b9('0x31')]['find']({'where':{'id':_0x30e19e[_0xb9b9('0x48')]['id']}})[_0xb9b9('0x27')](handleEntityNotFound(_0x184f9b,null))[_0xb9b9('0x27')](function(_0x1e38f5){if(_0x1e38f5){return _0x1e38f5['addUsers'](_0x30e19e[_0xb9b9('0x4e')]['ids'],_[_0xb9b9('0x55')](_0x30e19e[_0xb9b9('0x4e')],[_0xb9b9('0x56'),'id'])||{});}})[_0xb9b9('0x27')](respondWithResult(_0x184f9b,null))[_0xb9b9('0x46')](handleError(_0x184f9b,null));};exports[_0xb9b9('0x57')]=function(_0x1f19b2,_0x24ae48,_0x30e795){return db[_0xb9b9('0x31')]['find']({'where':{'id':_0x1f19b2[_0xb9b9('0x48')]['id']}})[_0xb9b9('0x27')](handleEntityNotFound(_0x24ae48,null))[_0xb9b9('0x27')](function(_0x578383){if(_0x578383){return _0x578383[_0xb9b9('0x57')](_0x1f19b2[_0xb9b9('0x37')][_0xb9b9('0x56')])[_0xb9b9('0x27')](function(){if(_[_0xb9b9('0x58')](_0x1f19b2[_0xb9b9('0x37')]['ids'])){for(var _0x45bbc4=0x0;_0x45bbc4<_0x1f19b2[_0xb9b9('0x37')][_0xb9b9('0x56')][_0xb9b9('0x4a')];_0x45bbc4+=0x1){socket[_0xb9b9('0x59')](_0xb9b9('0x5a'),{'UserId':Number(_0x1f19b2[_0xb9b9('0x37')][_0xb9b9('0x56')][_0x45bbc4]),'SquareProjectId':Number(_0x1f19b2['params']['id'])});}}else{socket[_0xb9b9('0x59')](_0xb9b9('0x5a'),{'UserId':Number(_0x1f19b2[_0xb9b9('0x37')]['ids']),'SquareProjectId':Number(_0x1f19b2[_0xb9b9('0x48')]['id'])});}});}})[_0xb9b9('0x27')](respondWithStatusCode(_0x24ae48,null))['catch'](handleError(_0x24ae48,null));};exports[_0xb9b9('0x5b')]=function(_0x35c05b,_0x34d7e0,_0x2b7aa9){var _0x3e9eb2={};var _0x4715d3={};var _0x59fc75;var _0x2be3c7;return db[_0xb9b9('0x31')][_0xb9b9('0x5c')]({'where':{'id':_0x35c05b[_0xb9b9('0x48')]['id']}})[_0xb9b9('0x27')](handleEntityNotFound(_0x34d7e0,null))['then'](function(_0x4a7536){if(_0x4a7536){_0x59fc75=_0x4a7536;_0x4715d3[_0xb9b9('0x36')]=_[_0xb9b9('0x49')](db[_0xb9b9('0x5d')]['rawAttributes']);_0x4715d3[_0xb9b9('0x37')]=_['keys'](_0x35c05b[_0xb9b9('0x37')]);_0x4715d3[_0xb9b9('0x38')]=_[_0xb9b9('0x39')](_0x4715d3[_0xb9b9('0x36')],_0x4715d3[_0xb9b9('0x37')]);_0x3e9eb2[_0xb9b9('0x3a')]=_[_0xb9b9('0x39')](_0x4715d3['model'],qs['fields'](_0x35c05b['query']['fields']));_0x3e9eb2['attributes']=_0x3e9eb2[_0xb9b9('0x3a')][_0xb9b9('0x4a')]?_0x3e9eb2[_0xb9b9('0x3a')]:_0x4715d3[_0xb9b9('0x36')];_0x3e9eb2[_0xb9b9('0x3d')]=qs[_0xb9b9('0x3e')](_0x35c05b[_0xb9b9('0x37')]['sort']);_0x3e9eb2[_0xb9b9('0x3f')]=qs[_0xb9b9('0x38')](_[_0xb9b9('0x40')](_0x35c05b[_0xb9b9('0x37')],_0x4715d3['filters']));if(_0x35c05b['query'][_0xb9b9('0x41')]){_0x3e9eb2[_0xb9b9('0x3f')]=_[_0xb9b9('0x42')](_0x3e9eb2[_0xb9b9('0x3f')],{'$or':_[_0xb9b9('0x30')](_0x3e9eb2['attributes'],function(_0x4f6eda){var _0x23955b={};_0x23955b[_0x4f6eda]={'$like':'%'+_0x35c05b[_0xb9b9('0x37')][_0xb9b9('0x41')]+'%'};return _0x23955b;})});}_0x3e9eb2=_[_0xb9b9('0x42')]({},_0x3e9eb2,_0x35c05b[_0xb9b9('0x44')]);return _0x59fc75['getUsers'](_0x3e9eb2);}})[_0xb9b9('0x27')](function(_0x68330e){if(_0x68330e){_0x2be3c7=_0x68330e[_0xb9b9('0x4a')];if(!_0x35c05b[_0xb9b9('0x37')][_0xb9b9('0x5e')]('nolimit')){_0x3e9eb2['limit']=qs[_0xb9b9('0x21')](_0x35c05b[_0xb9b9('0x37')][_0xb9b9('0x21')]);_0x3e9eb2[_0xb9b9('0x20')]=qs['offset'](_0x35c05b[_0xb9b9('0x37')][_0xb9b9('0x20')]);}return _0x59fc75[_0xb9b9('0x5b')](_0x3e9eb2);}})[_0xb9b9('0x27')](function(_0x59e789){if(_0x59e789){return _0x59e789?{'count':_0x2be3c7,'rows':_0x59e789}:null;}})[_0xb9b9('0x27')](respondWithResult(_0x34d7e0,null))[_0xb9b9('0x46')](handleError(_0x34d7e0,null));};
\ No newline at end of file
diff --git a/server/api/squareProject/squareProject.events.js b/server/api/squareProject/squareProject.events.js
index 6166993..1c18d51 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 _0x5391=['save','emit','hasOwnProperty','hook','exports','events','../../mysqldb','SquareProject','setMaxListeners'];(function(_0x19442a,_0x114737){var _0x5c132b=function(_0x457e4){while(--_0x457e4){_0x19442a['push'](_0x19442a['shift']());}};_0x5c132b(++_0x114737);}(_0x5391,0x11c));var _0x1539=function(_0x4eb577,_0x5cc520){_0x4eb577=_0x4eb577-0x0;var _0x1d4b9d=_0x5391[_0x4eb577];return _0x1d4b9d;};'use strict';var EventEmitter=require(_0x1539('0x0'));var SquareProject=require(_0x1539('0x1'))['db'][_0x1539('0x2')];var SquareProjectEvents=new EventEmitter();SquareProjectEvents[_0x1539('0x3')](0x0);var events={'afterCreate':_0x1539('0x4'),'afterUpdate':'update','afterDestroy':'remove'};function emitEvent(_0x2afaf9){return function(_0x473161,_0x4be81b,_0x25870a){SquareProjectEvents[_0x1539('0x5')](_0x2afaf9+':'+_0x473161['id'],_0x473161);SquareProjectEvents[_0x1539('0x5')](_0x2afaf9,_0x473161);_0x25870a(null);};}for(var e in events){if(events[_0x1539('0x6')](e)){var event=events[e];SquareProject[_0x1539('0x7')](e,emitEvent(event));}}module[_0x1539('0x8')]=SquareProjectEvents;
\ No newline at end of file
+var _0xefe7=['events','SquareProject','setMaxListeners','remove','emit','hasOwnProperty','hook','exports'];(function(_0x1e5357,_0x104159){var _0x4f11e6=function(_0x32dfca){while(--_0x32dfca){_0x1e5357['push'](_0x1e5357['shift']());}};_0x4f11e6(++_0x104159);}(_0xefe7,0x168));var _0x7efe=function(_0x155d40,_0x591fd0){_0x155d40=_0x155d40-0x0;var _0x1b9b51=_0xefe7[_0x155d40];return _0x1b9b51;};'use strict';var EventEmitter=require(_0x7efe('0x0'));var SquareProject=require('../../mysqldb')['db'][_0x7efe('0x1')];var SquareProjectEvents=new EventEmitter();SquareProjectEvents[_0x7efe('0x2')](0x0);var events={'afterCreate':'save','afterUpdate':'update','afterDestroy':_0x7efe('0x3')};function emitEvent(_0x15dd18){return function(_0x5044d0,_0x1e380e,_0x50e8a2){SquareProjectEvents['emit'](_0x15dd18+':'+_0x5044d0['id'],_0x5044d0);SquareProjectEvents[_0x7efe('0x4')](_0x15dd18,_0x5044d0);_0x50e8a2(null);};}for(var e in events){if(events[_0x7efe('0x5')](e)){var event=events[e];SquareProject[_0x7efe('0x6')](e,emitEvent(event));}}module[_0x7efe('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 4f22dd9..71b85db 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 _0x3222=['request-promise','path','rimraf','../../config/environment','exports','define','SquareProject','lodash','api','moment','bluebird'];(function(_0x1b4480,_0x12fd9b){var _0xb93034=function(_0x4b8749){while(--_0x4b8749){_0x1b4480['push'](_0x1b4480['shift']());}};_0xb93034(++_0x12fd9b);}(_0x3222,0x1b4));var _0x2322=function(_0x913256,_0x1d092a){_0x913256=_0x913256-0x0;var _0x39a1dd=_0x3222[_0x913256];return _0x39a1dd;};'use strict';var _=require(_0x2322('0x0'));var util=require('util');var logger=require('../../config/logger')(_0x2322('0x1'));var moment=require(_0x2322('0x2'));var BPromise=require(_0x2322('0x3'));var rp=require(_0x2322('0x4'));var fs=require('fs');var path=require(_0x2322('0x5'));var rimraf=require(_0x2322('0x6'));var config=require(_0x2322('0x7'));var attributes=require('./squareProject.attributes');module[_0x2322('0x8')]=function(_0x50d729,_0x4966ce){return _0x50d729[_0x2322('0x9')](_0x2322('0xa'),attributes,{'tableName':'square_projects','paranoid':![],'indexes':[],'timestamps':!![]});};
\ No newline at end of file
+var _0x0fbe=['lodash','util','../../config/logger','api','moment','request-promise','path','rimraf','../../config/environment','exports','define','square_projects'];(function(_0x26c7a8,_0x44c210){var _0x3fd89d=function(_0x2a63cd){while(--_0x2a63cd){_0x26c7a8['push'](_0x26c7a8['shift']());}};_0x3fd89d(++_0x44c210);}(_0x0fbe,0xfc));var _0xe0fb=function(_0x9c4cf9,_0x2af64e){_0x9c4cf9=_0x9c4cf9-0x0;var _0x553f99=_0x0fbe[_0x9c4cf9];return _0x553f99;};'use strict';var _=require(_0xe0fb('0x0'));var util=require(_0xe0fb('0x1'));var logger=require(_0xe0fb('0x2'))(_0xe0fb('0x3'));var moment=require(_0xe0fb('0x4'));var BPromise=require('bluebird');var rp=require(_0xe0fb('0x5'));var fs=require('fs');var path=require(_0xe0fb('0x6'));var rimraf=require(_0xe0fb('0x7'));var config=require(_0xe0fb('0x8'));var attributes=require('./squareProject.attributes');module[_0xe0fb('0x9')]=function(_0x378834,_0x5e3bac){return _0x378834[_0xe0fb('0xa')]('SquareProject',attributes,{'tableName':_0xe0fb('0xb'),'paranoid':![],'indexes':[],'timestamps':!![]});};
\ No newline at end of file
diff --git a/server/api/squareProject/squareProject.rpc.js b/server/api/squareProject/squareProject.rpc.js
index 137af4e..4021c87 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 _0xbe26=['raw','where','attributes','map','model','include','ShowSquareProject','stringify','lodash','util','bluebird','ioredis','../../mysqldb','../../config/utils','rpc','../../config/environment','jayson/promise','client','http','redis','defaults','localhost','socket.io-emitter','./squareProject.socket','register','request','then','SquareProject,\x20%s,\x20%s','request\x20sent','debug','SquareProject,\x20%s,\x20%s,\x20%s','error','code','message','info','result','catch','SquareProject','find','options'];(function(_0x36c6eb,_0x4fb127){var _0x30675b=function(_0x3a788b){while(--_0x3a788b){_0x36c6eb['push'](_0x36c6eb['shift']());}};_0x30675b(++_0x4fb127);}(_0xbe26,0x1e8));var _0x6be2=function(_0x558277,_0xa66dd){_0x558277=_0x558277-0x0;var _0xabf022=_0xbe26[_0x558277];return _0xabf022;};'use strict';var _=require(_0x6be2('0x0'));var util=require(_0x6be2('0x1'));var moment=require('moment');var BPromise=require(_0x6be2('0x2'));var rs=require('randomstring');var fs=require('fs');var Redis=require(_0x6be2('0x3'));var db=require(_0x6be2('0x4'))['db'];var utils=require(_0x6be2('0x5'));var logger=require('../../config/logger')(_0x6be2('0x6'));var config=require(_0x6be2('0x7'));var jayson=require(_0x6be2('0x8'));var client=jayson[_0x6be2('0x9')][_0x6be2('0xa')]({'port':0x232a});config[_0x6be2('0xb')]=_[_0x6be2('0xc')](config[_0x6be2('0xb')],{'host':_0x6be2('0xd'),'port':0x18eb});var socket=require(_0x6be2('0xe'))(new Redis(config[_0x6be2('0xb')]));require(_0x6be2('0xf'))[_0x6be2('0x10')](socket);function respondWithRpcPromise(_0x177c49,_0x41d81b,_0x522833){return new BPromise(function(_0x54b3fe,_0x31031e){return client[_0x6be2('0x11')](_0x177c49,_0x522833)[_0x6be2('0x12')](function(_0x595fac){logger['info'](_0x6be2('0x13'),_0x41d81b,_0x6be2('0x14'));logger[_0x6be2('0x15')](_0x6be2('0x16'),_0x41d81b,_0x6be2('0x14'),JSON['stringify'](_0x595fac));if(_0x595fac[_0x6be2('0x17')]){if(_0x595fac[_0x6be2('0x17')][_0x6be2('0x18')]===0x1f4){logger[_0x6be2('0x17')](_0x6be2('0x13'),_0x41d81b,_0x595fac[_0x6be2('0x17')][_0x6be2('0x19')]);return _0x31031e(_0x595fac[_0x6be2('0x17')][_0x6be2('0x19')]);}logger['error'](_0x6be2('0x13'),_0x41d81b,_0x595fac['error'][_0x6be2('0x19')]);return _0x54b3fe(_0x595fac[_0x6be2('0x17')][_0x6be2('0x19')]);}else{logger[_0x6be2('0x1a')]('SquareProject,\x20%s,\x20%s',_0x41d81b,_0x6be2('0x14'));_0x54b3fe(_0x595fac[_0x6be2('0x1b')][_0x6be2('0x19')]);}})[_0x6be2('0x1c')](function(_0x53d691){logger[_0x6be2('0x17')](_0x6be2('0x13'),_0x41d81b,_0x53d691);_0x31031e(_0x53d691);});});}exports['ShowSquareProject']=function(_0x1bf847){var _0x32119b=this;return new Promise(function(_0x4262a8,_0x2bc73e){return db[_0x6be2('0x1d')][_0x6be2('0x1e')]({'raw':_0x1bf847[_0x6be2('0x1f')]?_0x1bf847['options'][_0x6be2('0x20')]===undefined?!![]:![]:!![],'where':_0x1bf847[_0x6be2('0x1f')]?_0x1bf847[_0x6be2('0x1f')][_0x6be2('0x21')]||null:null,'attributes':_0x1bf847['options']?_0x1bf847[_0x6be2('0x1f')][_0x6be2('0x22')]||null:null,'include':_0x1bf847['options']?_0x1bf847['options']['include']?_[_0x6be2('0x23')](_0x1bf847[_0x6be2('0x1f')]['include'],function(_0x3cef47){return{'model':db[_0x3cef47[_0x6be2('0x24')]],'as':_0x3cef47['as'],'attributes':_0x3cef47[_0x6be2('0x22')],'include':_0x3cef47[_0x6be2('0x25')]?_['map'](_0x3cef47[_0x6be2('0x25')],function(_0x17b801){return{'model':db[_0x17b801['model']],'as':_0x17b801['as'],'attributes':_0x17b801['attributes'],'include':_0x17b801[_0x6be2('0x25')]?_[_0x6be2('0x23')](_0x17b801['include'],function(_0x5e09a2){return{'model':db[_0x5e09a2[_0x6be2('0x24')]],'as':_0x5e09a2['as'],'attributes':_0x5e09a2[_0x6be2('0x22')]};}):[]};}):[]};}):[]:[]})[_0x6be2('0x12')](function(_0xda896){logger[_0x6be2('0x1a')](_0x6be2('0x26'),_0x1bf847);logger[_0x6be2('0x15')](_0x6be2('0x26'),_0x1bf847,JSON[_0x6be2('0x27')](_0xda896));_0x4262a8(_0xda896);})[_0x6be2('0x1c')](function(_0x356b91){logger[_0x6be2('0x17')](_0x6be2('0x26'),_0x356b91['message'],_0x1bf847);_0x2bc73e(_0x32119b[_0x6be2('0x17')](0x1f4,_0x356b91[_0x6be2('0x19')]));});});};
\ No newline at end of file
+var _0x724a=['options','where','attributes','include','model','map','catch','util','moment','bluebird','ioredis','../../mysqldb','../../config/utils','../../config/logger','../../config/environment','jayson/promise','client','localhost','socket.io-emitter','redis','./squareProject.socket','register','request','then','info','SquareProject,\x20%s,\x20%s','debug','SquareProject,\x20%s,\x20%s,\x20%s','request\x20sent','stringify','error','message','result','ShowSquareProject','SquareProject','find'];(function(_0x58be4b,_0x29217c){var _0x4621c0=function(_0x3759bd){while(--_0x3759bd){_0x58be4b['push'](_0x58be4b['shift']());}};_0x4621c0(++_0x29217c);}(_0x724a,0x103));var _0xa724=function(_0x22490e,_0x4935bd){_0x22490e=_0x22490e-0x0;var _0x5b6459=_0x724a[_0x22490e];return _0x5b6459;};'use strict';var _=require('lodash');var util=require(_0xa724('0x0'));var moment=require(_0xa724('0x1'));var BPromise=require(_0xa724('0x2'));var rs=require('randomstring');var fs=require('fs');var Redis=require(_0xa724('0x3'));var db=require(_0xa724('0x4'))['db'];var utils=require(_0xa724('0x5'));var logger=require(_0xa724('0x6'))('rpc');var config=require(_0xa724('0x7'));var jayson=require(_0xa724('0x8'));var client=jayson[_0xa724('0x9')]['http']({'port':0x232a});config['redis']=_['defaults'](config['redis'],{'host':_0xa724('0xa'),'port':0x18eb});var socket=require(_0xa724('0xb'))(new Redis(config[_0xa724('0xc')]));require(_0xa724('0xd'))[_0xa724('0xe')](socket);function respondWithRpcPromise(_0x110c10,_0x24562f,_0x2518b7){return new BPromise(function(_0x4cde43,_0x43b2fb){return client[_0xa724('0xf')](_0x110c10,_0x2518b7)[_0xa724('0x10')](function(_0x26bbb0){logger[_0xa724('0x11')](_0xa724('0x12'),_0x24562f,'request\x20sent');logger[_0xa724('0x13')](_0xa724('0x14'),_0x24562f,_0xa724('0x15'),JSON[_0xa724('0x16')](_0x26bbb0));if(_0x26bbb0['error']){if(_0x26bbb0[_0xa724('0x17')]['code']===0x1f4){logger['error'](_0xa724('0x12'),_0x24562f,_0x26bbb0['error'][_0xa724('0x18')]);return _0x43b2fb(_0x26bbb0[_0xa724('0x17')]['message']);}logger[_0xa724('0x17')](_0xa724('0x12'),_0x24562f,_0x26bbb0['error'][_0xa724('0x18')]);return _0x4cde43(_0x26bbb0[_0xa724('0x17')][_0xa724('0x18')]);}else{logger[_0xa724('0x11')](_0xa724('0x12'),_0x24562f,_0xa724('0x15'));_0x4cde43(_0x26bbb0[_0xa724('0x19')]['message']);}})['catch'](function(_0x675de9){logger[_0xa724('0x17')](_0xa724('0x12'),_0x24562f,_0x675de9);_0x43b2fb(_0x675de9);});});}exports[_0xa724('0x1a')]=function(_0x3644c4){var _0x4ea643=this;return new Promise(function(_0x5b7e57,_0x44f413){return db[_0xa724('0x1b')][_0xa724('0x1c')]({'raw':_0x3644c4[_0xa724('0x1d')]?_0x3644c4[_0xa724('0x1d')]['raw']===undefined?!![]:![]:!![],'where':_0x3644c4[_0xa724('0x1d')]?_0x3644c4[_0xa724('0x1d')][_0xa724('0x1e')]||null:null,'attributes':_0x3644c4[_0xa724('0x1d')]?_0x3644c4['options'][_0xa724('0x1f')]||null:null,'include':_0x3644c4['options']?_0x3644c4[_0xa724('0x1d')][_0xa724('0x20')]?_['map'](_0x3644c4[_0xa724('0x1d')]['include'],function(_0x3cbfa7){return{'model':db[_0x3cbfa7[_0xa724('0x21')]],'as':_0x3cbfa7['as'],'attributes':_0x3cbfa7['attributes'],'include':_0x3cbfa7[_0xa724('0x20')]?_[_0xa724('0x22')](_0x3cbfa7[_0xa724('0x20')],function(_0x430c86){return{'model':db[_0x430c86[_0xa724('0x21')]],'as':_0x430c86['as'],'attributes':_0x430c86[_0xa724('0x1f')],'include':_0x430c86['include']?_[_0xa724('0x22')](_0x430c86['include'],function(_0x2b365f){return{'model':db[_0x2b365f[_0xa724('0x21')]],'as':_0x2b365f['as'],'attributes':_0x2b365f[_0xa724('0x1f')]};}):[]};}):[]};}):[]:[]})[_0xa724('0x10')](function(_0x58f5cf){logger['info'](_0xa724('0x1a'),_0x3644c4);logger['debug'](_0xa724('0x1a'),_0x3644c4,JSON[_0xa724('0x16')](_0x58f5cf));_0x5b7e57(_0x58f5cf);})[_0xa724('0x23')](function(_0x4fb30f){logger[_0xa724('0x17')](_0xa724('0x1a'),_0x4fb30f[_0xa724('0x18')],_0x3644c4);_0x44f413(_0x4ea643[_0xa724('0x17')](0x1f4,_0x4fb30f[_0xa724('0x18')]));});});};
\ No newline at end of file
diff --git a/server/api/squareProject/squareProject.socket.js b/server/api/squareProject/squareProject.socket.js
index d9cd887..8b55728 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 _0x53ec=['length','squareProject:','./squareProject.events','save','remove','update','emit','removeListener'];(function(_0x39cc53,_0x178597){var _0x36de76=function(_0x413d8c){while(--_0x413d8c){_0x39cc53['push'](_0x39cc53['shift']());}};_0x36de76(++_0x178597);}(_0x53ec,0x192));var _0xc53e=function(_0x50068c,_0x38a87a){_0x50068c=_0x50068c-0x0;var _0x11826a=_0x53ec[_0x50068c];return _0x11826a;};'use strict';var SquareProjectEvents=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(){SquareProjectEvents[_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);SquareProjectEvents['on'](_0x5d3b28,_0x1616ac);}};
\ No newline at end of file
+var _0xbd51=['removeListener','register','length','squareProject:','./squareProject.events','remove','update'];(function(_0x528f3a,_0x21338f){var _0x21eb76=function(_0x3a4b6d){while(--_0x3a4b6d){_0x528f3a['push'](_0x528f3a['shift']());}};_0x21eb76(++_0x21338f);}(_0xbd51,0x1a8));var _0x1bd5=function(_0x1e7e25,_0x1c6700){_0x1e7e25=_0x1e7e25-0x0;var _0x4e323b=_0xbd51[_0x1e7e25];return _0x4e323b;};'use strict';var SquareProjectEvents=require(_0x1bd5('0x0'));var events=['save',_0x1bd5('0x1'),_0x1bd5('0x2')];function createListener(_0x3b9f71,_0x1a9dcc){return function(_0x545aac){_0x1a9dcc['emit'](_0x3b9f71,_0x545aac);};}function removeListener(_0x58af16,_0x531028){return function(){SquareProjectEvents[_0x1bd5('0x3')](_0x58af16,_0x531028);};}exports[_0x1bd5('0x4')]=function(_0x43e6b6){for(var _0x59ddfb=0x0,_0x29abea=events[_0x1bd5('0x5')];_0x59ddfb<_0x29abea;_0x59ddfb++){var _0x19077c=events[_0x59ddfb];var _0x27d58f=createListener(_0x1bd5('0x6')+_0x19077c,_0x43e6b6);SquareProjectEvents['on'](_0x19077c,_0x27d58f);}};
\ No newline at end of file
diff --git a/server/api/squareRecording/index.js b/server/api/squareRecording/index.js
index e6917ac..f36eb01 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 _0x4837=['show','download','put','delete','/:id/delete','destroy','util','path','connect-timeout','express','Router','../../components/auth/service','../../config/environment','./squareRecording.controller','isAuthenticated','index','get','/:id'];(function(_0x24febe,_0x46c66a){var _0x456865=function(_0x16e90f){while(--_0x16e90f){_0x24febe['push'](_0x24febe['shift']());}};_0x456865(++_0x46c66a);}(_0x4837,0x15c));var _0x7483=function(_0x52abf0,_0x5546d8){_0x52abf0=_0x52abf0-0x0;var _0x1df381=_0x4837[_0x52abf0];return _0x1df381;};'use strict';var multer=require('multer');var util=require(_0x7483('0x0'));var path=require(_0x7483('0x1'));var timeout=require(_0x7483('0x2'));var express=require(_0x7483('0x3'));var router=express[_0x7483('0x4')]();var auth=require(_0x7483('0x5'));var interaction=require('../../components/interaction/service');var config=require(_0x7483('0x6'));var controller=require(_0x7483('0x7'));router['get']('/',auth[_0x7483('0x8')](),controller[_0x7483('0x9')]);router[_0x7483('0xa')](_0x7483('0xb'),auth[_0x7483('0x8')](),controller[_0x7483('0xc')]);router['get']('/:id/download',auth[_0x7483('0x8')](),controller[_0x7483('0xd')]);router['post']('/',auth[_0x7483('0x8')](),controller['create']);router[_0x7483('0xe')](_0x7483('0xb'),auth[_0x7483('0x8')](),controller['update']);router[_0x7483('0xf')](_0x7483('0x10'),auth['isAuthenticated'](),controller[_0x7483('0x11')]);module['exports']=router;
\ No newline at end of file
+var _0x0a1d=['../../config/environment','./squareRecording.controller','isAuthenticated','index','get','/:id','show','download','post','create','put','delete','/:id/delete','exports','util','path','connect-timeout','express','../../components/auth/service','../../components/interaction/service'];(function(_0x133851,_0x4d6780){var _0x188215=function(_0x1aa541){while(--_0x1aa541){_0x133851['push'](_0x133851['shift']());}};_0x188215(++_0x4d6780);}(_0x0a1d,0xea));var _0xd0a1=function(_0xfa77cc,_0x13b817){_0xfa77cc=_0xfa77cc-0x0;var _0x3a2a42=_0x0a1d[_0xfa77cc];return _0x3a2a42;};'use strict';var multer=require('multer');var util=require(_0xd0a1('0x0'));var path=require(_0xd0a1('0x1'));var timeout=require(_0xd0a1('0x2'));var express=require(_0xd0a1('0x3'));var router=express['Router']();var auth=require(_0xd0a1('0x4'));var interaction=require(_0xd0a1('0x5'));var config=require(_0xd0a1('0x6'));var controller=require(_0xd0a1('0x7'));router['get']('/',auth[_0xd0a1('0x8')](),controller[_0xd0a1('0x9')]);router[_0xd0a1('0xa')](_0xd0a1('0xb'),auth[_0xd0a1('0x8')](),controller[_0xd0a1('0xc')]);router['get']('/:id/download',auth[_0xd0a1('0x8')](),controller[_0xd0a1('0xd')]);router[_0xd0a1('0xe')]('/',auth[_0xd0a1('0x8')](),controller[_0xd0a1('0xf')]);router[_0xd0a1('0x10')]('/:id',auth['isAuthenticated'](),controller['update']);router[_0xd0a1('0x11')](_0xd0a1('0x12'),auth[_0xd0a1('0x8')](),controller['destroy']);module[_0xd0a1('0x13')]=router;
\ No newline at end of file
diff --git a/server/api/squareRecording/squareRecording.attributes.js b/server/api/squareRecording/squareRecording.attributes.js
index 2289eb0..f3b9b20 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 _0xa46e=['substring','lastIndexOf','sequelize','exports','STRING','VIRTUAL','getDataValue','savePath'];(function(_0x45356c,_0x9941c9){var _0x38a11a=function(_0x410640){while(--_0x410640){_0x45356c['push'](_0x45356c['shift']());}};_0x38a11a(++_0x9941c9);}(_0xa46e,0x8a));var _0xea46=function(_0x389832,_0x10a4a9){_0x389832=_0x389832-0x0;var _0x59429e=_0xa46e[_0x389832];return _0x59429e;};'use strict';var Sequelize=require(_0xea46('0x0'));module[_0xea46('0x1')]={'uniqueid':{'type':Sequelize['STRING']},'callerid':{'type':Sequelize[_0xea46('0x2')]},'calleridname':{'type':Sequelize[_0xea46('0x2')]},'context':{'type':Sequelize[_0xea46('0x2')]},'extension':{'type':Sequelize['STRING']},'priority':{'type':Sequelize[_0xea46('0x2')]},'accountcode':{'type':Sequelize['STRING']},'dnid':{'type':Sequelize[_0xea46('0x2')]},'projectName':{'type':Sequelize['STRING']},'saveName':{'type':Sequelize[_0xea46('0x2')]},'filename':{'type':Sequelize['STRING']},'savePath':{'type':Sequelize[_0xea46('0x2')]},'format':{'type':Sequelize[_0xea46('0x3')],'get':function(){var _0x5f1cd1='';var _0x2d1b30=this[_0xea46('0x4')](_0xea46('0x5'));if(_0x2d1b30){_0x5f1cd1=_0x2d1b30[_0xea46('0x6')](_0x2d1b30[_0xea46('0x7')]('.'));}return _0x5f1cd1;}}};
\ No newline at end of file
+var _0x7008=['VIRTUAL','getDataValue','savePath','substring','lastIndexOf','sequelize','exports','STRING'];(function(_0x1e05c1,_0x3cffa3){var _0x15f1ca=function(_0x3a9594){while(--_0x3a9594){_0x1e05c1['push'](_0x1e05c1['shift']());}};_0x15f1ca(++_0x3cffa3);}(_0x7008,0x185));var _0x8700=function(_0x209ce6,_0x2cdc20){_0x209ce6=_0x209ce6-0x0;var _0x39d768=_0x7008[_0x209ce6];return _0x39d768;};'use strict';var Sequelize=require(_0x8700('0x0'));module[_0x8700('0x1')]={'uniqueid':{'type':Sequelize[_0x8700('0x2')]},'callerid':{'type':Sequelize[_0x8700('0x2')]},'calleridname':{'type':Sequelize['STRING']},'context':{'type':Sequelize[_0x8700('0x2')]},'extension':{'type':Sequelize[_0x8700('0x2')]},'priority':{'type':Sequelize['STRING']},'accountcode':{'type':Sequelize[_0x8700('0x2')]},'dnid':{'type':Sequelize[_0x8700('0x2')]},'projectName':{'type':Sequelize[_0x8700('0x2')]},'saveName':{'type':Sequelize[_0x8700('0x2')]},'filename':{'type':Sequelize[_0x8700('0x2')]},'savePath':{'type':Sequelize[_0x8700('0x2')]},'format':{'type':Sequelize[_0x8700('0x3')],'get':function(){var _0x56a501='';var _0x60252a=this[_0x8700('0x4')](_0x8700('0x5'));if(_0x60252a){_0x56a501=_0x60252a[_0x8700('0x6')](_0x60252a[_0x8700('0x7')]('.'));}return _0x56a501;}}};
\ No newline at end of file
diff --git a/server/api/squareRecording/squareRecording.controller.js b/server/api/squareRecording/squareRecording.controller.js
index b4807de..0c12925 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 _0xcbb2=['body','find','download','../../components/encryptor','uniqueid','format','%s.cypher','existsSync','decryptFile','secrets','recording','savePath','Sequelize','ValidationError','filename','unlink','Not\x20found','Entity\x20not\x20found','info','isNil','File:\x20\x22','\x22\x20trovato\x20eseguo\x20la\x20cancellazione','unlinkSync','.cypher','html-pdf','eml-format','zip-dir','fast-json-patch','request-promise','moment','bluebird','mustache','util','path','sox','to-csv','ejs','squel','crypto','jsforce','desk.js','querystring','papaparse','../../components/parsers/advancedSearch','../../config/license/hardware','api','../../config/environment','../../mysqldb','sendStatus','status','end','json','offset','set','Content-Range','apply','reject','save','update','then','destroy','error','stack','name','send','index','map','SquareRecording','rawAttributes','type','query','keys','filters','intersection','model','attributes','fields','nolimit','limit','order','sort','pick','filter','where','VIRTUAL','merge','options','count','includeAll','include','findAll','catch','params','length','create'];(function(_0x23b22e,_0x32fcea){var _0x4b058d=function(_0x39d718){while(--_0x39d718){_0x23b22e['push'](_0x23b22e['shift']());}};_0x4b058d(++_0x32fcea);}(_0xcbb2,0xd6));var _0x2cbb=function(_0x5a9950,_0x138e55){_0x5a9950=_0x5a9950-0x0;var _0x10a37f=_0xcbb2[_0x5a9950];return _0x10a37f;};'use strict';var pdf=require(_0x2cbb('0x0'));var emlformat=require(_0x2cbb('0x1'));var rimraf=require('rimraf');var zipdir=require(_0x2cbb('0x2'));var jsonpatch=require(_0x2cbb('0x3'));var rp=require(_0x2cbb('0x4'));var moment=require(_0x2cbb('0x5'));var BPromise=require(_0x2cbb('0x6'));var Mustache=require(_0x2cbb('0x7'));var util=require(_0x2cbb('0x8'));var path=require(_0x2cbb('0x9'));var sox=require(_0x2cbb('0xa'));var csv=require(_0x2cbb('0xb'));var ejs=require(_0x2cbb('0xc'));var fs=require('fs');var _=require('lodash');var squel=require(_0x2cbb('0xd'));var crypto=require(_0x2cbb('0xe'));var jsforce=require(_0x2cbb('0xf'));var deskjs=require(_0x2cbb('0x10'));var toCsv=require(_0x2cbb('0xb'));var querystring=require(_0x2cbb('0x11'));var Papa=require(_0x2cbb('0x12'));var Redis=require('ioredis');var authService=require('../../components/auth/service');var qs=require('../../components/parsers/qs');var as=require(_0x2cbb('0x13'));var hardwareService=require(_0x2cbb('0x14'));var logger=require('../../config/logger')(_0x2cbb('0x15'));var utils=require('../../config/utils');var config=require(_0x2cbb('0x16'));var db=require(_0x2cbb('0x17'))['db'];function respondWithStatusCode(_0x2e8c36,_0x3cafa3){_0x3cafa3=_0x3cafa3||0xcc;return function(_0x206796){if(_0x206796){return _0x2e8c36[_0x2cbb('0x18')](_0x3cafa3);}return _0x2e8c36[_0x2cbb('0x19')](_0x3cafa3)[_0x2cbb('0x1a')]();};}function respondWithResult(_0x4fd7da,_0x5f16e9){_0x5f16e9=_0x5f16e9||0xc8;return function(_0x18ae7c){if(_0x18ae7c){return _0x4fd7da[_0x2cbb('0x19')](_0x5f16e9)[_0x2cbb('0x1b')](_0x18ae7c);}};}function respondWithFilteredResult(_0x4a5f96,_0x1e3097){return function(_0x7f38ac){if(_0x7f38ac){var _0x1bc1d4=_0x7f38ac['count'],_0x2d4a34=_0x1e3097['offset'],_0x1b0391=_0x1e3097[_0x2cbb('0x1c')]+_0x1e3097['limit'],_0x4279b5;if(_0x1b0391>=_0x1bc1d4){_0x1b0391=_0x1bc1d4;_0x4279b5=0xc8;}else{_0x4279b5=0xce;}_0x4a5f96['status'](_0x4279b5);return _0x4a5f96[_0x2cbb('0x1d')](_0x2cbb('0x1e'),_0x2d4a34+'-'+_0x1b0391+'/'+_0x1bc1d4)[_0x2cbb('0x1b')](_0x7f38ac);}return null;};}function patchUpdates(_0x3b1ad3){return function(_0x3c2576){try{jsonpatch[_0x2cbb('0x1f')](_0x3c2576,_0x3b1ad3,!![]);}catch(_0x28b41e){return BPromise[_0x2cbb('0x20')](_0x28b41e);}return _0x3c2576[_0x2cbb('0x21')]();};}function saveUpdates(_0xa7b4a7,_0x261d11){return function(_0x21292a){if(_0x21292a){return _0x21292a[_0x2cbb('0x22')](_0xa7b4a7)[_0x2cbb('0x23')](function(_0x462bd4){return _0x462bd4;});}return null;};}function removeEntity(_0x9f7e5f,_0x864d72){return function(_0xf57f6a){if(_0xf57f6a){return _0xf57f6a[_0x2cbb('0x24')]()['then'](function(){_0x9f7e5f[_0x2cbb('0x19')](0xcc)['end']();});}};}function handleEntityNotFound(_0x37cbf1,_0x46c7a2){return function(_0x1d6a50){if(!_0x1d6a50){_0x37cbf1[_0x2cbb('0x18')](0x194);}return _0x1d6a50;};}function handleError(_0x1bc9f0,_0x4e16ec){_0x4e16ec=_0x4e16ec||0x1f4;return function(_0x2c6888){logger[_0x2cbb('0x25')](_0x2c6888[_0x2cbb('0x26')]);if(_0x2c6888['name']){delete _0x2c6888[_0x2cbb('0x27')];}_0x1bc9f0[_0x2cbb('0x19')](_0x4e16ec)[_0x2cbb('0x28')](_0x2c6888);};}exports[_0x2cbb('0x29')]=function(_0x908273,_0x558172){var _0x4375a6={},_0x102e1b={},_0x50cc22={'count':0x0,'rows':[]};var _0x45f0e8=_[_0x2cbb('0x2a')](db[_0x2cbb('0x2b')][_0x2cbb('0x2c')],function(_0x205ed3){return{'name':_0x205ed3['fieldName'],'type':_0x205ed3[_0x2cbb('0x2d')]['key']};});_0x102e1b['model']=_[_0x2cbb('0x2a')](_0x45f0e8,_0x2cbb('0x27'));_0x102e1b[_0x2cbb('0x2e')]=_[_0x2cbb('0x2f')](_0x908273[_0x2cbb('0x2e')]);_0x102e1b[_0x2cbb('0x30')]=_[_0x2cbb('0x31')](_0x102e1b[_0x2cbb('0x32')],_0x102e1b[_0x2cbb('0x2e')]);_0x4375a6[_0x2cbb('0x33')]=_['intersection'](_0x102e1b[_0x2cbb('0x32')],qs[_0x2cbb('0x34')](_0x908273[_0x2cbb('0x2e')][_0x2cbb('0x34')]));_0x4375a6[_0x2cbb('0x33')]=_0x4375a6[_0x2cbb('0x33')]['length']?_0x4375a6['attributes']:_0x102e1b['model'];if(!_0x908273[_0x2cbb('0x2e')]['hasOwnProperty'](_0x2cbb('0x35'))){_0x4375a6[_0x2cbb('0x36')]=qs[_0x2cbb('0x36')](_0x908273[_0x2cbb('0x2e')][_0x2cbb('0x36')]);_0x4375a6[_0x2cbb('0x1c')]=qs[_0x2cbb('0x1c')](_0x908273['query'][_0x2cbb('0x1c')]);}_0x4375a6[_0x2cbb('0x37')]=qs[_0x2cbb('0x38')](_0x908273['query'][_0x2cbb('0x38')]);_0x4375a6['where']=qs['filters'](_[_0x2cbb('0x39')](_0x908273[_0x2cbb('0x2e')],_0x102e1b[_0x2cbb('0x30')]));if(_0x908273[_0x2cbb('0x2e')][_0x2cbb('0x3a')]){_0x4375a6[_0x2cbb('0x3b')]=_['merge'](_0x4375a6['where'],{'$or':_[_0x2cbb('0x2a')](_0x45f0e8,function(_0x4d641a){if(_0x4d641a[_0x2cbb('0x2d')]!==_0x2cbb('0x3c')){var _0x39bb3d={};_0x39bb3d[_0x4d641a[_0x2cbb('0x27')]]={'$like':'%'+_0x908273[_0x2cbb('0x2e')]['filter']+'%'};return _0x39bb3d;}})});}_0x4375a6=_[_0x2cbb('0x3d')]({},_0x4375a6,_0x908273[_0x2cbb('0x3e')]);var _0x555508={'where':_0x4375a6['where']};return db[_0x2cbb('0x2b')]['count'](_0x555508)[_0x2cbb('0x23')](function(_0x3ddcb1){_0x50cc22[_0x2cbb('0x3f')]=_0x3ddcb1;if(_0x908273[_0x2cbb('0x2e')][_0x2cbb('0x40')]){_0x4375a6[_0x2cbb('0x41')]=[{'all':!![]}];}return db[_0x2cbb('0x2b')][_0x2cbb('0x42')](_0x4375a6);})['then'](function(_0x3dbc3c){_0x50cc22['rows']=_0x3dbc3c;return _0x50cc22;})[_0x2cbb('0x23')](respondWithFilteredResult(_0x558172,_0x4375a6))[_0x2cbb('0x43')](handleError(_0x558172,null));};exports['show']=function(_0x9e9878,_0x876fb6){var _0x2564c8={'raw':!![],'where':{'id':_0x9e9878[_0x2cbb('0x44')]['id']}},_0x239628={};_0x239628[_0x2cbb('0x32')]=_[_0x2cbb('0x2f')](db[_0x2cbb('0x2b')][_0x2cbb('0x2c')]);_0x239628['query']=_[_0x2cbb('0x2f')](_0x9e9878['query']);_0x239628[_0x2cbb('0x30')]=_[_0x2cbb('0x31')](_0x239628[_0x2cbb('0x32')],_0x239628['query']);_0x2564c8['attributes']=_[_0x2cbb('0x31')](_0x239628[_0x2cbb('0x32')],qs[_0x2cbb('0x34')](_0x9e9878['query'][_0x2cbb('0x34')]));_0x2564c8[_0x2cbb('0x33')]=_0x2564c8[_0x2cbb('0x33')][_0x2cbb('0x45')]?_0x2564c8[_0x2cbb('0x33')]:_0x239628['model'];if(_0x9e9878[_0x2cbb('0x2e')]['includeAll']){_0x2564c8[_0x2cbb('0x41')]=[{'all':!![]}];}_0x2564c8=_[_0x2cbb('0x3d')]({},_0x2564c8,_0x9e9878[_0x2cbb('0x3e')]);return db[_0x2cbb('0x2b')]['find'](_0x2564c8)[_0x2cbb('0x23')](handleEntityNotFound(_0x876fb6,null))[_0x2cbb('0x23')](respondWithResult(_0x876fb6,null))[_0x2cbb('0x43')](handleError(_0x876fb6,null));};exports[_0x2cbb('0x46')]=function(_0x213838,_0x548d10){return db[_0x2cbb('0x2b')]['create'](_0x213838[_0x2cbb('0x47')],{})[_0x2cbb('0x23')](respondWithResult(_0x548d10,0xc9))[_0x2cbb('0x43')](handleError(_0x548d10,null));};exports[_0x2cbb('0x22')]=function(_0x153e5a,_0x404d66){if(_0x153e5a[_0x2cbb('0x47')]['id']){delete _0x153e5a[_0x2cbb('0x47')]['id'];}return db['SquareRecording'][_0x2cbb('0x48')]({'where':{'id':_0x153e5a['params']['id']}})[_0x2cbb('0x23')](handleEntityNotFound(_0x404d66,null))['then'](saveUpdates(_0x153e5a[_0x2cbb('0x47')],null))['then'](respondWithResult(_0x404d66,null))[_0x2cbb('0x43')](handleError(_0x404d66,null));};exports[_0x2cbb('0x49')]=function(_0x3a3033,_0x334b7e,_0x3f1cb3){var _0x459b01=require(_0x2cbb('0x4a'));var _0x3675f0=![];var _0x31b377={};if(_0x3a3033['query'][_0x2cbb('0x2d')]&&_0x3a3033['query'][_0x2cbb('0x2d')]===_0x2cbb('0x4b')){_0x31b377[_0x2cbb('0x4b')]=_0x3a3033[_0x2cbb('0x44')]['id'];}else{_0x31b377['id']=_0x3a3033['params']['id'];}return db[_0x2cbb('0x2b')][_0x2cbb('0x48')]({'where':_0x31b377,'attributes':['id','savePath','filename'],'raw':!![]})[_0x2cbb('0x23')](handleEntityNotFound(_0x334b7e,null))[_0x2cbb('0x23')](function(_0x11b811){if(_0x11b811){var _0x53c896=_0x11b811['savePath'];var _0x3f5cde=util[_0x2cbb('0x4c')](_0x2cbb('0x4d'),_0x53c896);if(fs[_0x2cbb('0x4e')](_0x3f5cde)){_0x3675f0=!![];return _0x459b01[_0x2cbb('0x4f')](_0x3f5cde,_0x53c896,config[_0x2cbb('0x50')][_0x2cbb('0x51')])[_0x2cbb('0x23')](function(){return _0x11b811;});}return _0x11b811;}})[_0x2cbb('0x23')](function(_0x541738){if(_0x541738){var _0x2a72e8=_0x541738[_0x2cbb('0x52')];if(!fs[_0x2cbb('0x4e')](_0x2a72e8)){throw new db[(_0x2cbb('0x53'))][(_0x2cbb('0x54'))]('SquareRecording\x20not\x20found');}if(_0x541738[_0x2cbb('0x55')]){return _0x334b7e[_0x2cbb('0x49')](_0x2a72e8,_0x541738[_0x2cbb('0x55')]+path['extname'](_0x2a72e8),function(){if(_0x3675f0){fs['unlink'](_0x2a72e8);}});}else{return _0x334b7e[_0x2cbb('0x49')](_0x2a72e8,function(_0xabe4df){if(_0x3675f0){fs[_0x2cbb('0x56')](_0x2a72e8);}});}}})[_0x2cbb('0x43')](function(_0x5be631){if(_0x5be631['message']==='SquareRecording\x20not\x20found'){_0x334b7e[_0x2cbb('0x19')](0x194)['send'](_0x2cbb('0x57'));}else{return handleError(_0x334b7e,null);}});};exports[_0x2cbb('0x24')]=function(_0x4f45af,_0x202f17){return db['SquareRecording'][_0x2cbb('0x48')]({'where':{'id':_0x4f45af[_0x2cbb('0x44')]['id']}})[_0x2cbb('0x23')](function(_0x45aa61){if(!_0x45aa61)throw new ReferenceError(_0x2cbb('0x58'));return _0x45aa61;})[_0x2cbb('0x23')](function(_0x3b4a5a){var _0xdc3004=_0x3b4a5a[_0x2cbb('0x52')];logger[_0x2cbb('0x59')]('cancellazione\x20fisica\x20documento\x20%s',_0xdc3004);if(!_[_0x2cbb('0x5a')](_0x3b4a5a[_0x2cbb('0x52')])&&fs['existsSync'](_0xdc3004)){logger[_0x2cbb('0x59')](_0x2cbb('0x5b')+_0xdc3004+_0x2cbb('0x5c'));fs[_0x2cbb('0x5d')](_0xdc3004);}_0xdc3004=_0xdc3004+_0x2cbb('0x5e');if(!_[_0x2cbb('0x5a')](_0x3b4a5a[_0x2cbb('0x52')])&&fs[_0x2cbb('0x4e')](_0xdc3004)){logger[_0x2cbb('0x59')]('File:\x20\x22'+_0xdc3004+_0x2cbb('0x5c'));fs[_0x2cbb('0x5d')](_0xdc3004);}return _0x3b4a5a;})['then'](function(_0x187269){if(!_0x187269)throw new InternalError();return _0x187269[_0x2cbb('0x24')]();})[_0x2cbb('0x23')](function(){_0x202f17[_0x2cbb('0x19')](0xcc)[_0x2cbb('0x1a')]();})[_0x2cbb('0x43')](handleError(_0x202f17,null));};
\ No newline at end of file
+var _0xd1ae=['to-csv','ejs','squel','desk.js','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/utils','../../config/environment','../../mysqldb','sendStatus','end','json','count','offset','status','apply','reject','save','update','then','error','stack','name','send','index','map','SquareRecording','fieldName','type','key','model','query','attributes','intersection','fields','length','hasOwnProperty','nolimit','limit','order','sort','where','filters','pick','filter','merge','VIRTUAL','options','include','catch','params','rawAttributes','keys','includeAll','find','body','download','../../components/encryptor','uniqueid','filename','savePath','format','recording','existsSync','Sequelize','ValidationError','SquareRecording\x20not\x20found','extname','unlink','message','Not\x20found','destroy','cancellazione\x20fisica\x20documento\x20%s','isNil','File:\x20\x22','\x22\x20trovato\x20eseguo\x20la\x20cancellazione','.cypher','info','eml-format','rimraf','fast-json-patch','request-promise','moment','mustache','util'];(function(_0x3dd15e,_0x1f0015){var _0x231fd0=function(_0x4f680a){while(--_0x4f680a){_0x3dd15e['push'](_0x3dd15e['shift']());}};_0x231fd0(++_0x1f0015);}(_0xd1ae,0x1b1));var _0xed1a=function(_0x3c0efa,_0x248ecd){_0x3c0efa=_0x3c0efa-0x0;var _0x1d50fd=_0xd1ae[_0x3c0efa];return _0x1d50fd;};'use strict';var pdf=require('html-pdf');var emlformat=require(_0xed1a('0x0'));var rimraf=require(_0xed1a('0x1'));var zipdir=require('zip-dir');var jsonpatch=require(_0xed1a('0x2'));var rp=require(_0xed1a('0x3'));var moment=require(_0xed1a('0x4'));var BPromise=require('bluebird');var Mustache=require(_0xed1a('0x5'));var util=require(_0xed1a('0x6'));var path=require('path');var sox=require('sox');var csv=require(_0xed1a('0x7'));var ejs=require(_0xed1a('0x8'));var fs=require('fs');var _=require('lodash');var squel=require(_0xed1a('0x9'));var crypto=require('crypto');var jsforce=require('jsforce');var deskjs=require(_0xed1a('0xa'));var toCsv=require('to-csv');var querystring=require('querystring');var Papa=require('papaparse');var Redis=require(_0xed1a('0xb'));var authService=require(_0xed1a('0xc'));var qs=require(_0xed1a('0xd'));var as=require(_0xed1a('0xe'));var hardwareService=require(_0xed1a('0xf'));var logger=require('../../config/logger')('api');var utils=require(_0xed1a('0x10'));var config=require(_0xed1a('0x11'));var db=require(_0xed1a('0x12'))['db'];function respondWithStatusCode(_0x1c757b,_0x6ed9c9){_0x6ed9c9=_0x6ed9c9||0xcc;return function(_0xed749d){if(_0xed749d){return _0x1c757b[_0xed1a('0x13')](_0x6ed9c9);}return _0x1c757b['status'](_0x6ed9c9)[_0xed1a('0x14')]();};}function respondWithResult(_0x3e8af9,_0x2f94f2){_0x2f94f2=_0x2f94f2||0xc8;return function(_0x40c2de){if(_0x40c2de){return _0x3e8af9['status'](_0x2f94f2)[_0xed1a('0x15')](_0x40c2de);}};}function respondWithFilteredResult(_0x5b74bc,_0x319e7e){return function(_0x558f59){if(_0x558f59){var _0x2a6b28=_0x558f59[_0xed1a('0x16')],_0x2996a4=_0x319e7e[_0xed1a('0x17')],_0x49f6bb=_0x319e7e['offset']+_0x319e7e['limit'],_0x2cc184;if(_0x49f6bb>=_0x2a6b28){_0x49f6bb=_0x2a6b28;_0x2cc184=0xc8;}else{_0x2cc184=0xce;}_0x5b74bc[_0xed1a('0x18')](_0x2cc184);return _0x5b74bc['set']('Content-Range',_0x2996a4+'-'+_0x49f6bb+'/'+_0x2a6b28)[_0xed1a('0x15')](_0x558f59);}return null;};}function patchUpdates(_0x424241){return function(_0x47d135){try{jsonpatch[_0xed1a('0x19')](_0x47d135,_0x424241,!![]);}catch(_0x4ea508){return BPromise[_0xed1a('0x1a')](_0x4ea508);}return _0x47d135[_0xed1a('0x1b')]();};}function saveUpdates(_0x45988b,_0x288f40){return function(_0x5664ca){if(_0x5664ca){return _0x5664ca[_0xed1a('0x1c')](_0x45988b)[_0xed1a('0x1d')](function(_0x426fad){return _0x426fad;});}return null;};}function removeEntity(_0x5d780b,_0x390bf1){return function(_0x2d101b){if(_0x2d101b){return _0x2d101b['destroy']()['then'](function(){_0x5d780b['status'](0xcc)[_0xed1a('0x14')]();});}};}function handleEntityNotFound(_0x7c996,_0x3a7676){return function(_0xdefe9e){if(!_0xdefe9e){_0x7c996[_0xed1a('0x13')](0x194);}return _0xdefe9e;};}function handleError(_0x4a316b,_0x46b3e3){_0x46b3e3=_0x46b3e3||0x1f4;return function(_0x2b3f26){logger[_0xed1a('0x1e')](_0x2b3f26[_0xed1a('0x1f')]);if(_0x2b3f26[_0xed1a('0x20')]){delete _0x2b3f26['name'];}_0x4a316b[_0xed1a('0x18')](_0x46b3e3)[_0xed1a('0x21')](_0x2b3f26);};}exports[_0xed1a('0x22')]=function(_0x56bdd6,_0x1f26c0){var _0x4b1974={},_0x592d81={},_0x19b08b={'count':0x0,'rows':[]};var _0x39cfa9=_[_0xed1a('0x23')](db[_0xed1a('0x24')]['rawAttributes'],function(_0x4a1503){return{'name':_0x4a1503[_0xed1a('0x25')],'type':_0x4a1503[_0xed1a('0x26')][_0xed1a('0x27')]};});_0x592d81[_0xed1a('0x28')]=_[_0xed1a('0x23')](_0x39cfa9,_0xed1a('0x20'));_0x592d81['query']=_['keys'](_0x56bdd6['query']);_0x592d81['filters']=_['intersection'](_0x592d81[_0xed1a('0x28')],_0x592d81[_0xed1a('0x29')]);_0x4b1974[_0xed1a('0x2a')]=_[_0xed1a('0x2b')](_0x592d81['model'],qs['fields'](_0x56bdd6[_0xed1a('0x29')][_0xed1a('0x2c')]));_0x4b1974['attributes']=_0x4b1974[_0xed1a('0x2a')][_0xed1a('0x2d')]?_0x4b1974[_0xed1a('0x2a')]:_0x592d81['model'];if(!_0x56bdd6[_0xed1a('0x29')][_0xed1a('0x2e')](_0xed1a('0x2f'))){_0x4b1974[_0xed1a('0x30')]=qs[_0xed1a('0x30')](_0x56bdd6['query'][_0xed1a('0x30')]);_0x4b1974[_0xed1a('0x17')]=qs['offset'](_0x56bdd6[_0xed1a('0x29')][_0xed1a('0x17')]);}_0x4b1974[_0xed1a('0x31')]=qs[_0xed1a('0x32')](_0x56bdd6[_0xed1a('0x29')][_0xed1a('0x32')]);_0x4b1974[_0xed1a('0x33')]=qs[_0xed1a('0x34')](_[_0xed1a('0x35')](_0x56bdd6[_0xed1a('0x29')],_0x592d81['filters']));if(_0x56bdd6[_0xed1a('0x29')][_0xed1a('0x36')]){_0x4b1974[_0xed1a('0x33')]=_[_0xed1a('0x37')](_0x4b1974[_0xed1a('0x33')],{'$or':_[_0xed1a('0x23')](_0x39cfa9,function(_0x537583){if(_0x537583['type']!==_0xed1a('0x38')){var _0x9df12f={};_0x9df12f[_0x537583[_0xed1a('0x20')]]={'$like':'%'+_0x56bdd6[_0xed1a('0x29')][_0xed1a('0x36')]+'%'};return _0x9df12f;}})});}_0x4b1974=_[_0xed1a('0x37')]({},_0x4b1974,_0x56bdd6[_0xed1a('0x39')]);var _0xaa71ed={'where':_0x4b1974[_0xed1a('0x33')]};return db['SquareRecording'][_0xed1a('0x16')](_0xaa71ed)['then'](function(_0x4f9939){_0x19b08b['count']=_0x4f9939;if(_0x56bdd6[_0xed1a('0x29')]['includeAll']){_0x4b1974[_0xed1a('0x3a')]=[{'all':!![]}];}return db[_0xed1a('0x24')]['findAll'](_0x4b1974);})[_0xed1a('0x1d')](function(_0x1a33a3){_0x19b08b['rows']=_0x1a33a3;return _0x19b08b;})[_0xed1a('0x1d')](respondWithFilteredResult(_0x1f26c0,_0x4b1974))[_0xed1a('0x3b')](handleError(_0x1f26c0,null));};exports['show']=function(_0x38a5f5,_0x5afc5f){var _0x2fb1fe={'raw':!![],'where':{'id':_0x38a5f5[_0xed1a('0x3c')]['id']}},_0x1157ef={};_0x1157ef[_0xed1a('0x28')]=_['keys'](db[_0xed1a('0x24')][_0xed1a('0x3d')]);_0x1157ef['query']=_[_0xed1a('0x3e')](_0x38a5f5['query']);_0x1157ef[_0xed1a('0x34')]=_[_0xed1a('0x2b')](_0x1157ef['model'],_0x1157ef[_0xed1a('0x29')]);_0x2fb1fe[_0xed1a('0x2a')]=_[_0xed1a('0x2b')](_0x1157ef[_0xed1a('0x28')],qs[_0xed1a('0x2c')](_0x38a5f5[_0xed1a('0x29')][_0xed1a('0x2c')]));_0x2fb1fe[_0xed1a('0x2a')]=_0x2fb1fe[_0xed1a('0x2a')][_0xed1a('0x2d')]?_0x2fb1fe[_0xed1a('0x2a')]:_0x1157ef['model'];if(_0x38a5f5[_0xed1a('0x29')][_0xed1a('0x3f')]){_0x2fb1fe[_0xed1a('0x3a')]=[{'all':!![]}];}_0x2fb1fe=_[_0xed1a('0x37')]({},_0x2fb1fe,_0x38a5f5[_0xed1a('0x39')]);return db[_0xed1a('0x24')][_0xed1a('0x40')](_0x2fb1fe)[_0xed1a('0x1d')](handleEntityNotFound(_0x5afc5f,null))[_0xed1a('0x1d')](respondWithResult(_0x5afc5f,null))[_0xed1a('0x3b')](handleError(_0x5afc5f,null));};exports['create']=function(_0x30b8d4,_0x4ac7d4){return db[_0xed1a('0x24')]['create'](_0x30b8d4[_0xed1a('0x41')],{})[_0xed1a('0x1d')](respondWithResult(_0x4ac7d4,0xc9))[_0xed1a('0x3b')](handleError(_0x4ac7d4,null));};exports[_0xed1a('0x1c')]=function(_0x43b67f,_0x98b094){if(_0x43b67f[_0xed1a('0x41')]['id']){delete _0x43b67f[_0xed1a('0x41')]['id'];}return db[_0xed1a('0x24')][_0xed1a('0x40')]({'where':{'id':_0x43b67f['params']['id']}})[_0xed1a('0x1d')](handleEntityNotFound(_0x98b094,null))['then'](saveUpdates(_0x43b67f['body'],null))[_0xed1a('0x1d')](respondWithResult(_0x98b094,null))['catch'](handleError(_0x98b094,null));};exports[_0xed1a('0x42')]=function(_0x291ac0,_0x58717f,_0x5609d3){var _0x36b171=require(_0xed1a('0x43'));var _0x57e7ec=![];var _0x900187={};if(_0x291ac0['query'][_0xed1a('0x26')]&&_0x291ac0[_0xed1a('0x29')][_0xed1a('0x26')]===_0xed1a('0x44')){_0x900187['uniqueid']=_0x291ac0[_0xed1a('0x3c')]['id'];}else{_0x900187['id']=_0x291ac0[_0xed1a('0x3c')]['id'];}return db[_0xed1a('0x24')]['find']({'where':_0x900187,'attributes':['id','savePath',_0xed1a('0x45')],'raw':!![]})[_0xed1a('0x1d')](handleEntityNotFound(_0x58717f,null))[_0xed1a('0x1d')](function(_0x4c951a){if(_0x4c951a){var _0x48b440=_0x4c951a[_0xed1a('0x46')];var _0x13540f=util[_0xed1a('0x47')]('%s.cypher',_0x48b440);if(fs['existsSync'](_0x13540f)){_0x57e7ec=!![];return _0x36b171['decryptFile'](_0x13540f,_0x48b440,config['secrets'][_0xed1a('0x48')])['then'](function(){return _0x4c951a;});}return _0x4c951a;}})[_0xed1a('0x1d')](function(_0x4d95f5){if(_0x4d95f5){var _0x5cd148=_0x4d95f5[_0xed1a('0x46')];if(!fs[_0xed1a('0x49')](_0x5cd148)){throw new db[(_0xed1a('0x4a'))][(_0xed1a('0x4b'))](_0xed1a('0x4c'));}if(_0x4d95f5[_0xed1a('0x45')]){return _0x58717f[_0xed1a('0x42')](_0x5cd148,_0x4d95f5['filename']+path[_0xed1a('0x4d')](_0x5cd148),function(){if(_0x57e7ec){fs[_0xed1a('0x4e')](_0x5cd148);}});}else{return _0x58717f['download'](_0x5cd148,function(_0x3e1e30){if(_0x57e7ec){fs['unlink'](_0x5cd148);}});}}})[_0xed1a('0x3b')](function(_0x5a2c5e){if(_0x5a2c5e[_0xed1a('0x4f')]===_0xed1a('0x4c')){_0x58717f[_0xed1a('0x18')](0x194)['send'](_0xed1a('0x50'));}else{return handleError(_0x58717f,null);}});};exports[_0xed1a('0x51')]=function(_0x2405bb,_0x37951b){return db['SquareRecording'][_0xed1a('0x40')]({'where':{'id':_0x2405bb[_0xed1a('0x3c')]['id']}})[_0xed1a('0x1d')](function(_0x116caa){if(!_0x116caa)throw new ReferenceError('Entity\x20not\x20found');return _0x116caa;})['then'](function(_0x3dd471){var _0x27bd4c=_0x3dd471['savePath'];logger['info'](_0xed1a('0x52'),_0x27bd4c);if(!_[_0xed1a('0x53')](_0x3dd471[_0xed1a('0x46')])&&fs[_0xed1a('0x49')](_0x27bd4c)){logger['info'](_0xed1a('0x54')+_0x27bd4c+_0xed1a('0x55'));fs['unlinkSync'](_0x27bd4c);}_0x27bd4c=_0x27bd4c+_0xed1a('0x56');if(!_[_0xed1a('0x53')](_0x3dd471[_0xed1a('0x46')])&&fs['existsSync'](_0x27bd4c)){logger[_0xed1a('0x57')]('File:\x20\x22'+_0x27bd4c+'\x22\x20trovato\x20eseguo\x20la\x20cancellazione');fs['unlinkSync'](_0x27bd4c);}return _0x3dd471;})[_0xed1a('0x1d')](function(_0x1174c1){if(!_0x1174c1)throw new InternalError();return _0x1174c1[_0xed1a('0x51')]();})[_0xed1a('0x1d')](function(){_0x37951b[_0xed1a('0x18')](0xcc)[_0xed1a('0x14')]();})[_0xed1a('0x3b')](handleError(_0x37951b,null));};
\ No newline at end of file
diff --git a/server/api/squareRecording/squareRecording.model.js b/server/api/squareRecording/squareRecording.model.js
index affb22d..7af9041 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 _0x6582=['lodash','util','../../config/logger','api','moment','request-promise','path','rimraf','define','SquareRecording','square_recordings'];(function(_0x3dd15e,_0x1f0015){var _0x231fd0=function(_0x4f680a){while(--_0x4f680a){_0x3dd15e['push'](_0x3dd15e['shift']());}};_0x231fd0(++_0x1f0015);}(_0x6582,0x108));var _0x2658=function(_0x24259d,_0x64a194){_0x24259d=_0x24259d-0x0;var _0x5a701=_0x6582[_0x24259d];return _0x5a701;};'use strict';var _=require(_0x2658('0x0'));var util=require(_0x2658('0x1'));var logger=require(_0x2658('0x2'))(_0x2658('0x3'));var moment=require(_0x2658('0x4'));var BPromise=require('bluebird');var rp=require(_0x2658('0x5'));var fs=require('fs');var path=require(_0x2658('0x6'));var rimraf=require(_0x2658('0x7'));var config=require('../../config/environment');var attributes=require('./squareRecording.attributes');module['exports']=function(_0x2ef520,_0x1702bd){return _0x2ef520[_0x2658('0x8')](_0x2658('0x9'),attributes,{'tableName':_0x2658('0xa'),'paranoid':![],'indexes':[],'timestamps':!![]});};
\ No newline at end of file
+var _0xabad=['lodash','../../config/logger','api','moment','request-promise','path','../../config/environment','./squareRecording.attributes','exports','define','SquareRecording','square_recordings'];(function(_0x3dd15e,_0x1f0015){var _0x231fd0=function(_0x4f680a){while(--_0x4f680a){_0x3dd15e['push'](_0x3dd15e['shift']());}};_0x231fd0(++_0x1f0015);}(_0xabad,0x150));var _0xdaba=function(_0x5da398,_0x13a526){_0x5da398=_0x5da398-0x0;var _0x4db43a=_0xabad[_0x5da398];return _0x4db43a;};'use strict';var _=require(_0xdaba('0x0'));var util=require('util');var logger=require(_0xdaba('0x1'))(_0xdaba('0x2'));var moment=require(_0xdaba('0x3'));var BPromise=require('bluebird');var rp=require(_0xdaba('0x4'));var fs=require('fs');var path=require(_0xdaba('0x5'));var rimraf=require('rimraf');var config=require(_0xdaba('0x6'));var attributes=require(_0xdaba('0x7'));module[_0xdaba('0x8')]=function(_0x387d02,_0x20fd9f){return _0x387d02[_0xdaba('0x9')](_0xdaba('0xa'),attributes,{'tableName':_0xdaba('0xb'),'paranoid':![],'indexes':[],'timestamps':!![]});};
\ No newline at end of file
diff --git a/server/api/squareRecording/squareRecording.rpc.js b/server/api/squareRecording/squareRecording.rpc.js
index a51107f..1145d97 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 _0x46c0=['result','catch','SquareRecording','create','body','options','raw','CreateSquareRecording','lodash','moment','bluebird','randomstring','../../mysqldb','../../config/utils','../../config/logger','rpc','jayson/promise','client','http','request','then','info','SquareRecording,\x20%s,\x20%s','request\x20sent','debug','SquareRecording,\x20%s,\x20%s,\x20%s','stringify','error','code','message'];(function(_0x114edd,_0x50d2fe){var _0x784065=function(_0xf3b759){while(--_0xf3b759){_0x114edd['push'](_0x114edd['shift']());}};_0x784065(++_0x50d2fe);}(_0x46c0,0xda));var _0x046c=function(_0x571d85,_0xda439c){_0x571d85=_0x571d85-0x0;var _0x3c2e07=_0x46c0[_0x571d85];return _0x3c2e07;};'use strict';var _=require(_0x046c('0x0'));var util=require('util');var moment=require(_0x046c('0x1'));var BPromise=require(_0x046c('0x2'));var rs=require(_0x046c('0x3'));var fs=require('fs');var Redis=require('ioredis');var db=require(_0x046c('0x4'))['db'];var utils=require(_0x046c('0x5'));var logger=require(_0x046c('0x6'))(_0x046c('0x7'));var config=require('../../config/environment');var jayson=require(_0x046c('0x8'));var client=jayson[_0x046c('0x9')][_0x046c('0xa')]({'port':0x232a});function respondWithRpcPromise(_0x50884f,_0x518909,_0x21bc57){return new BPromise(function(_0x4f878f,_0x859f3c){return client[_0x046c('0xb')](_0x50884f,_0x21bc57)[_0x046c('0xc')](function(_0x5329be){logger[_0x046c('0xd')](_0x046c('0xe'),_0x518909,_0x046c('0xf'));logger[_0x046c('0x10')](_0x046c('0x11'),_0x518909,_0x046c('0xf'),JSON[_0x046c('0x12')](_0x5329be));if(_0x5329be[_0x046c('0x13')]){if(_0x5329be[_0x046c('0x13')][_0x046c('0x14')]===0x1f4){logger[_0x046c('0x13')](_0x046c('0xe'),_0x518909,_0x5329be['error'][_0x046c('0x15')]);return _0x859f3c(_0x5329be['error'][_0x046c('0x15')]);}logger[_0x046c('0x13')](_0x046c('0xe'),_0x518909,_0x5329be['error'][_0x046c('0x15')]);return _0x4f878f(_0x5329be['error']['message']);}else{logger[_0x046c('0xd')](_0x046c('0xe'),_0x518909,_0x046c('0xf'));_0x4f878f(_0x5329be[_0x046c('0x16')][_0x046c('0x15')]);}})[_0x046c('0x17')](function(_0x56bc2b){logger['error'](_0x046c('0xe'),_0x518909,_0x56bc2b);_0x859f3c(_0x56bc2b);});});}exports['CreateSquareRecording']=function(_0x54292d){var _0x199832=this;return new Promise(function(_0x1909f2,_0x376f62){return db[_0x046c('0x18')][_0x046c('0x19')](_0x54292d[_0x046c('0x1a')],{'raw':_0x54292d['options']?_0x54292d[_0x046c('0x1b')][_0x046c('0x1c')]===undefined?!![]:![]:!![]})['then'](function(_0x5c65b7){logger['info']('CreateSquareRecording',_0x54292d);logger['debug'](_0x046c('0x1d'),_0x54292d,JSON[_0x046c('0x12')](_0x5c65b7));_0x1909f2(_0x5c65b7);})[_0x046c('0x17')](function(_0x1a5d94){logger[_0x046c('0x13')](_0x046c('0x1d'),_0x1a5d94[_0x046c('0x15')],_0x54292d);_0x376f62(_0x199832[_0x046c('0x13')](0x1f4,_0x1a5d94[_0x046c('0x15')]));});});};
\ No newline at end of file
+var _0xa4ef=['options','raw','lodash','util','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','rpc','../../config/environment','jayson/promise','request','then','SquareRecording,\x20%s,\x20%s','debug','SquareRecording,\x20%s,\x20%s,\x20%s','request\x20sent','stringify','error','message','info','result','catch','CreateSquareRecording','SquareRecording','create','body'];(function(_0x50c70a,_0x4fcd5c){var _0x1f388a=function(_0xfe9d58){while(--_0xfe9d58){_0x50c70a['push'](_0x50c70a['shift']());}};_0x1f388a(++_0x4fcd5c);}(_0xa4ef,0xcd));var _0xfa4e=function(_0x46e363,_0x45d7e2){_0x46e363=_0x46e363-0x0;var _0x3fb059=_0xa4ef[_0x46e363];return _0x3fb059;};'use strict';var _=require(_0xfa4e('0x0'));var util=require(_0xfa4e('0x1'));var moment=require(_0xfa4e('0x2'));var BPromise=require(_0xfa4e('0x3'));var rs=require(_0xfa4e('0x4'));var fs=require('fs');var Redis=require(_0xfa4e('0x5'));var db=require(_0xfa4e('0x6'))['db'];var utils=require(_0xfa4e('0x7'));var logger=require('../../config/logger')(_0xfa4e('0x8'));var config=require(_0xfa4e('0x9'));var jayson=require(_0xfa4e('0xa'));var client=jayson['client']['http']({'port':0x232a});function respondWithRpcPromise(_0x396be5,_0x8a3d25,_0x4d6b92){return new BPromise(function(_0x4cb448,_0x51610f){return client[_0xfa4e('0xb')](_0x396be5,_0x4d6b92)[_0xfa4e('0xc')](function(_0x302f9c){logger['info'](_0xfa4e('0xd'),_0x8a3d25,'request\x20sent');logger[_0xfa4e('0xe')](_0xfa4e('0xf'),_0x8a3d25,_0xfa4e('0x10'),JSON[_0xfa4e('0x11')](_0x302f9c));if(_0x302f9c[_0xfa4e('0x12')]){if(_0x302f9c[_0xfa4e('0x12')]['code']===0x1f4){logger['error']('SquareRecording,\x20%s,\x20%s',_0x8a3d25,_0x302f9c[_0xfa4e('0x12')][_0xfa4e('0x13')]);return _0x51610f(_0x302f9c['error']['message']);}logger[_0xfa4e('0x12')]('SquareRecording,\x20%s,\x20%s',_0x8a3d25,_0x302f9c[_0xfa4e('0x12')][_0xfa4e('0x13')]);return _0x4cb448(_0x302f9c[_0xfa4e('0x12')][_0xfa4e('0x13')]);}else{logger[_0xfa4e('0x14')](_0xfa4e('0xd'),_0x8a3d25,'request\x20sent');_0x4cb448(_0x302f9c[_0xfa4e('0x15')][_0xfa4e('0x13')]);}})[_0xfa4e('0x16')](function(_0x1f12c4){logger['error'](_0xfa4e('0xd'),_0x8a3d25,_0x1f12c4);_0x51610f(_0x1f12c4);});});}exports[_0xfa4e('0x17')]=function(_0xe5cf22){var _0x61be02=this;return new Promise(function(_0x536ee3,_0x57460a){return db[_0xfa4e('0x18')][_0xfa4e('0x19')](_0xe5cf22[_0xfa4e('0x1a')],{'raw':_0xe5cf22['options']?_0xe5cf22[_0xfa4e('0x1b')][_0xfa4e('0x1c')]===undefined?!![]:![]:!![]})[_0xfa4e('0xc')](function(_0x2621d8){logger['info'](_0xfa4e('0x17'),_0xe5cf22);logger[_0xfa4e('0xe')](_0xfa4e('0x17'),_0xe5cf22,JSON[_0xfa4e('0x11')](_0x2621d8));_0x536ee3(_0x2621d8);})['catch'](function(_0x293815){logger[_0xfa4e('0x12')](_0xfa4e('0x17'),_0x293815[_0xfa4e('0x13')],_0xe5cf22);_0x57460a(_0x61be02[_0xfa4e('0x12')](0x1f4,_0x293815['message']));});});};
\ No newline at end of file
diff --git a/server/api/squareReport/index.js b/server/api/squareReport/index.js
index d095dc7..0590f25 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 _0x6e45=['connect-timeout','Router','../../components/auth/service','../../components/interaction/service','../../config/environment','get','isAuthenticated','index','/describe','/:id','show','post','put','update','delete','exports','multer','util','path'];(function(_0x4a9fb1,_0x273043){var _0x348672=function(_0x142b69){while(--_0x142b69){_0x4a9fb1['push'](_0x4a9fb1['shift']());}};_0x348672(++_0x273043);}(_0x6e45,0x1c5));var _0x56e4=function(_0x259e42,_0x1739f2){_0x259e42=_0x259e42-0x0;var _0x5997ba=_0x6e45[_0x259e42];return _0x5997ba;};'use strict';var multer=require(_0x56e4('0x0'));var util=require(_0x56e4('0x1'));var path=require(_0x56e4('0x2'));var timeout=require(_0x56e4('0x3'));var express=require('express');var router=express[_0x56e4('0x4')]();var auth=require(_0x56e4('0x5'));var interaction=require(_0x56e4('0x6'));var config=require(_0x56e4('0x7'));var controller=require('./squareReport.controller');router[_0x56e4('0x8')]('/',auth[_0x56e4('0x9')](),controller[_0x56e4('0xa')]);router[_0x56e4('0x8')](_0x56e4('0xb'),auth[_0x56e4('0x9')](),controller['describe']);router['get'](_0x56e4('0xc'),auth[_0x56e4('0x9')](),controller[_0x56e4('0xd')]);router[_0x56e4('0xe')]('/',auth['isAuthenticated'](),controller['create']);router[_0x56e4('0xf')](_0x56e4('0xc'),auth[_0x56e4('0x9')](),controller[_0x56e4('0x10')]);router[_0x56e4('0x11')](_0x56e4('0xc'),auth[_0x56e4('0x9')](),controller['destroy']);module[_0x56e4('0x12')]=router;
\ No newline at end of file
+var _0xb11c=['get','isAuthenticated','index','post','create','put','/:id','exports','util','path','connect-timeout','express','../../components/auth/service','../../components/interaction/service'];(function(_0x36d5ea,_0x3d7352){var _0xc47766=function(_0x5b036f){while(--_0x5b036f){_0x36d5ea['push'](_0x36d5ea['shift']());}};_0xc47766(++_0x3d7352);}(_0xb11c,0x104));var _0xcb11=function(_0x1bc3ef,_0x21e693){_0x1bc3ef=_0x1bc3ef-0x0;var _0x19703a=_0xb11c[_0x1bc3ef];return _0x19703a;};'use strict';var multer=require('multer');var util=require(_0xcb11('0x0'));var path=require(_0xcb11('0x1'));var timeout=require(_0xcb11('0x2'));var express=require(_0xcb11('0x3'));var router=express['Router']();var auth=require(_0xcb11('0x4'));var interaction=require(_0xcb11('0x5'));var config=require('../../config/environment');var controller=require('./squareReport.controller');router[_0xcb11('0x6')]('/',auth[_0xcb11('0x7')](),controller[_0xcb11('0x8')]);router['get']('/describe',auth['isAuthenticated'](),controller['describe']);router[_0xcb11('0x6')]('/:id',auth[_0xcb11('0x7')](),controller['show']);router[_0xcb11('0x9')]('/',auth[_0xcb11('0x7')](),controller[_0xcb11('0xa')]);router[_0xcb11('0xb')](_0xcb11('0xc'),auth[_0xcb11('0x7')](),controller['update']);router['delete'](_0xcb11('0xc'),auth['isAuthenticated'](),controller['destroy']);module[_0xcb11('0xd')]=router;
\ No newline at end of file
diff --git a/server/api/squareReport/squareReport.attributes.js b/server/api/squareReport/squareReport.attributes.js
index 52ee6ea..6446c2e 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 _0x9c9e=['STRING','DATE','BOOLEAN','sequelize','exports'];(function(_0x521a32,_0x10dcf2){var _0x184b72=function(_0x323c8e){while(--_0x323c8e){_0x521a32['push'](_0x521a32['shift']());}};_0x184b72(++_0x10dcf2);}(_0x9c9e,0x1de));var _0xe9c9=function(_0x2b122d,_0x2d8526){_0x2b122d=_0x2b122d-0x0;var _0x515e68=_0x9c9e[_0x2b122d];return _0x515e68;};'use strict';var Sequelize=require(_0xe9c9('0x0'));module[_0xe9c9('0x1')]={'network':{'type':Sequelize[_0xe9c9('0x2')]},'network_script':{'type':Sequelize[_0xe9c9('0x2')]},'request':{'type':Sequelize[_0xe9c9('0x2')]},'channel':{'type':Sequelize[_0xe9c9('0x2')]},'language':{'type':Sequelize[_0xe9c9('0x2')]},'type':{'type':Sequelize[_0xe9c9('0x2')]},'uniqueid':{'type':Sequelize[_0xe9c9('0x2')]},'version':{'type':Sequelize['STRING']},'callerid':{'type':Sequelize['STRING']},'calleridname':{'type':Sequelize[_0xe9c9('0x2')]},'callingpres':{'type':Sequelize[_0xe9c9('0x2')]},'callingani2':{'type':Sequelize[_0xe9c9('0x2')]},'callington':{'type':Sequelize[_0xe9c9('0x2')]},'callingtns':{'type':Sequelize[_0xe9c9('0x2')]},'dnid':{'type':Sequelize[_0xe9c9('0x2')]},'rdnis':{'type':Sequelize[_0xe9c9('0x2')]},'context':{'type':Sequelize[_0xe9c9('0x2')]},'extension':{'type':Sequelize[_0xe9c9('0x2')]},'priority':{'type':Sequelize['STRING']},'enhanced':{'type':Sequelize[_0xe9c9('0x2')]},'accountcode':{'type':Sequelize[_0xe9c9('0x2')]},'threadid':{'type':Sequelize[_0xe9c9('0x2')]},'project_name':{'type':Sequelize[_0xe9c9('0x2')]},'joinAt':{'type':Sequelize['DATE']},'leaveAt':{'type':Sequelize[_0xe9c9('0x3')]},'bot':{'type':Sequelize[_0xe9c9('0x4')],'defaultValue':![]}};
\ No newline at end of file
+var _0xa199=['DATE','BOOLEAN','sequelize','exports','STRING'];(function(_0x1d061e,_0x3bbfed){var _0x4d725f=function(_0x3afc14){while(--_0x3afc14){_0x1d061e['push'](_0x1d061e['shift']());}};_0x4d725f(++_0x3bbfed);}(_0xa199,0x124));var _0x9a19=function(_0x9ea6de,_0x3df9a4){_0x9ea6de=_0x9ea6de-0x0;var _0x16a563=_0xa199[_0x9ea6de];return _0x16a563;};'use strict';var Sequelize=require(_0x9a19('0x0'));module[_0x9a19('0x1')]={'network':{'type':Sequelize[_0x9a19('0x2')]},'network_script':{'type':Sequelize[_0x9a19('0x2')]},'request':{'type':Sequelize['STRING']},'channel':{'type':Sequelize[_0x9a19('0x2')]},'language':{'type':Sequelize[_0x9a19('0x2')]},'type':{'type':Sequelize[_0x9a19('0x2')]},'uniqueid':{'type':Sequelize[_0x9a19('0x2')]},'version':{'type':Sequelize[_0x9a19('0x2')]},'callerid':{'type':Sequelize['STRING']},'calleridname':{'type':Sequelize['STRING']},'callingpres':{'type':Sequelize[_0x9a19('0x2')]},'callingani2':{'type':Sequelize[_0x9a19('0x2')]},'callington':{'type':Sequelize[_0x9a19('0x2')]},'callingtns':{'type':Sequelize['STRING']},'dnid':{'type':Sequelize[_0x9a19('0x2')]},'rdnis':{'type':Sequelize[_0x9a19('0x2')]},'context':{'type':Sequelize[_0x9a19('0x2')]},'extension':{'type':Sequelize[_0x9a19('0x2')]},'priority':{'type':Sequelize[_0x9a19('0x2')]},'enhanced':{'type':Sequelize['STRING']},'accountcode':{'type':Sequelize[_0x9a19('0x2')]},'threadid':{'type':Sequelize['STRING']},'project_name':{'type':Sequelize[_0x9a19('0x2')]},'joinAt':{'type':Sequelize['DATE']},'leaveAt':{'type':Sequelize[_0x9a19('0x3')]},'bot':{'type':Sequelize[_0x9a19('0x4')],'defaultValue':![]}};
\ No newline at end of file
diff --git a/server/api/squareReport/squareReport.controller.js b/server/api/squareReport/squareReport.controller.js
index 41be2fa..e93255e 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 _0x1cb9=['end','json','count','offset','limit','set','apply','save','then','destroy','error','stack','index','map','SquareReport','rawAttributes','type','model','name','keys','query','filters','intersection','attributes','fields','length','hasOwnProperty','nolimit','order','sort','where','pick','filter','merge','include','rows','catch','show','params','includeAll','options','find','create','body','update','describe','html-pdf','rimraf','zip-dir','fast-json-patch','request-promise','bluebird','mustache','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','sendStatus','status'];(function(_0x43a38f,_0x4a2146){var _0x3385d7=function(_0x477f20){while(--_0x477f20){_0x43a38f['push'](_0x43a38f['shift']());}};_0x3385d7(++_0x4a2146);}(_0x1cb9,0x14e));var _0x91cb=function(_0x149a64,_0x3caa0c){_0x149a64=_0x149a64-0x0;var _0x3c1607=_0x1cb9[_0x149a64];return _0x3c1607;};'use strict';var pdf=require(_0x91cb('0x0'));var emlformat=require('eml-format');var rimraf=require(_0x91cb('0x1'));var zipdir=require(_0x91cb('0x2'));var jsonpatch=require(_0x91cb('0x3'));var rp=require(_0x91cb('0x4'));var moment=require('moment');var BPromise=require(_0x91cb('0x5'));var Mustache=require(_0x91cb('0x6'));var util=require('util');var path=require(_0x91cb('0x7'));var sox=require(_0x91cb('0x8'));var csv=require(_0x91cb('0x9'));var ejs=require(_0x91cb('0xa'));var fs=require('fs');var _=require(_0x91cb('0xb'));var squel=require(_0x91cb('0xc'));var crypto=require('crypto');var jsforce=require(_0x91cb('0xd'));var deskjs=require('desk.js');var toCsv=require(_0x91cb('0x9'));var querystring=require('querystring');var Papa=require(_0x91cb('0xe'));var Redis=require(_0x91cb('0xf'));var authService=require(_0x91cb('0x10'));var qs=require(_0x91cb('0x11'));var as=require(_0x91cb('0x12'));var hardwareService=require(_0x91cb('0x13'));var logger=require(_0x91cb('0x14'))(_0x91cb('0x15'));var utils=require(_0x91cb('0x16'));var config=require(_0x91cb('0x17'));var db=require('../../mysqldb')['db'];function respondWithStatusCode(_0x3c1f56,_0x366f09){_0x366f09=_0x366f09||0xcc;return function(_0x4ba2f2){if(_0x4ba2f2){return _0x3c1f56[_0x91cb('0x18')](_0x366f09);}return _0x3c1f56[_0x91cb('0x19')](_0x366f09)[_0x91cb('0x1a')]();};}function respondWithResult(_0x2c7d40,_0x4a7d45){_0x4a7d45=_0x4a7d45||0xc8;return function(_0x4cc6ef){if(_0x4cc6ef){return _0x2c7d40[_0x91cb('0x19')](_0x4a7d45)[_0x91cb('0x1b')](_0x4cc6ef);}};}function respondWithFilteredResult(_0x585470,_0x528f73){return function(_0x576369){if(_0x576369){var _0xc3629e=_0x576369[_0x91cb('0x1c')],_0x347980=_0x528f73['offset'],_0x5ea796=_0x528f73[_0x91cb('0x1d')]+_0x528f73[_0x91cb('0x1e')],_0x238f11;if(_0x5ea796>=_0xc3629e){_0x5ea796=_0xc3629e;_0x238f11=0xc8;}else{_0x238f11=0xce;}_0x585470[_0x91cb('0x19')](_0x238f11);return _0x585470[_0x91cb('0x1f')]('Content-Range',_0x347980+'-'+_0x5ea796+'/'+_0xc3629e)[_0x91cb('0x1b')](_0x576369);}return null;};}function patchUpdates(_0x7dcf60){return function(_0x4ca8e8){try{jsonpatch[_0x91cb('0x20')](_0x4ca8e8,_0x7dcf60,!![]);}catch(_0x4c9fb2){return BPromise['reject'](_0x4c9fb2);}return _0x4ca8e8[_0x91cb('0x21')]();};}function saveUpdates(_0x160ded,_0x56e409){return function(_0x51a1d5){if(_0x51a1d5){return _0x51a1d5['update'](_0x160ded)[_0x91cb('0x22')](function(_0x18827b){return _0x18827b;});}return null;};}function removeEntity(_0x20aff5,_0x1dbee2){return function(_0x5c6a15){if(_0x5c6a15){return _0x5c6a15[_0x91cb('0x23')]()[_0x91cb('0x22')](function(){_0x20aff5[_0x91cb('0x19')](0xcc)['end']();});}};}function handleEntityNotFound(_0x26f18f,_0x1a7a54){return function(_0x2447e7){if(!_0x2447e7){_0x26f18f[_0x91cb('0x18')](0x194);}return _0x2447e7;};}function handleError(_0x3ca500,_0x7ad361){_0x7ad361=_0x7ad361||0x1f4;return function(_0x414e60){logger[_0x91cb('0x24')](_0x414e60[_0x91cb('0x25')]);if(_0x414e60['name']){delete _0x414e60['name'];}_0x3ca500[_0x91cb('0x19')](_0x7ad361)['send'](_0x414e60);};}exports[_0x91cb('0x26')]=function(_0x34d372,_0x318031){var _0x5595c5={},_0x9b26a6={},_0x4f5a7b={'count':0x0,'rows':[]};var _0x4572f6=_[_0x91cb('0x27')](db[_0x91cb('0x28')][_0x91cb('0x29')],function(_0x468908){return{'name':_0x468908['fieldName'],'type':_0x468908[_0x91cb('0x2a')]['key']};});_0x9b26a6[_0x91cb('0x2b')]=_[_0x91cb('0x27')](_0x4572f6,_0x91cb('0x2c'));_0x9b26a6['query']=_[_0x91cb('0x2d')](_0x34d372[_0x91cb('0x2e')]);_0x9b26a6[_0x91cb('0x2f')]=_[_0x91cb('0x30')](_0x9b26a6[_0x91cb('0x2b')],_0x9b26a6[_0x91cb('0x2e')]);_0x5595c5[_0x91cb('0x31')]=_[_0x91cb('0x30')](_0x9b26a6[_0x91cb('0x2b')],qs['fields'](_0x34d372[_0x91cb('0x2e')][_0x91cb('0x32')]));_0x5595c5[_0x91cb('0x31')]=_0x5595c5[_0x91cb('0x31')][_0x91cb('0x33')]?_0x5595c5['attributes']:_0x9b26a6[_0x91cb('0x2b')];if(!_0x34d372[_0x91cb('0x2e')][_0x91cb('0x34')](_0x91cb('0x35'))){_0x5595c5[_0x91cb('0x1e')]=qs['limit'](_0x34d372[_0x91cb('0x2e')]['limit']);_0x5595c5['offset']=qs['offset'](_0x34d372[_0x91cb('0x2e')]['offset']);}_0x5595c5[_0x91cb('0x36')]=qs['sort'](_0x34d372['query'][_0x91cb('0x37')]);_0x5595c5[_0x91cb('0x38')]=qs[_0x91cb('0x2f')](_[_0x91cb('0x39')](_0x34d372[_0x91cb('0x2e')],_0x9b26a6['filters']));if(_0x34d372[_0x91cb('0x2e')][_0x91cb('0x3a')]){_0x5595c5[_0x91cb('0x38')]=_[_0x91cb('0x3b')](_0x5595c5['where'],{'$or':_['map'](_0x4572f6,function(_0x1eed21){if(_0x1eed21[_0x91cb('0x2a')]!=='VIRTUAL'){var _0x39bd64={};_0x39bd64[_0x1eed21[_0x91cb('0x2c')]]={'$like':'%'+_0x34d372['query'][_0x91cb('0x3a')]+'%'};return _0x39bd64;}})});}_0x5595c5=_[_0x91cb('0x3b')]({},_0x5595c5,_0x34d372['options']);var _0x43d4fe={'where':_0x5595c5['where']};return db[_0x91cb('0x28')][_0x91cb('0x1c')](_0x43d4fe)[_0x91cb('0x22')](function(_0x279ad5){_0x4f5a7b[_0x91cb('0x1c')]=_0x279ad5;if(_0x34d372[_0x91cb('0x2e')]['includeAll']){_0x5595c5[_0x91cb('0x3c')]=[{'all':!![]}];}return db[_0x91cb('0x28')]['findAll'](_0x5595c5);})[_0x91cb('0x22')](function(_0x4ecbd7){_0x4f5a7b[_0x91cb('0x3d')]=_0x4ecbd7;return _0x4f5a7b;})[_0x91cb('0x22')](respondWithFilteredResult(_0x318031,_0x5595c5))[_0x91cb('0x3e')](handleError(_0x318031,null));};exports[_0x91cb('0x3f')]=function(_0x5e98c4,_0x435fff){var _0x5af0e6={'raw':!![],'where':{'id':_0x5e98c4[_0x91cb('0x40')]['id']}},_0x2cf27e={};_0x2cf27e[_0x91cb('0x2b')]=_[_0x91cb('0x2d')](db[_0x91cb('0x28')][_0x91cb('0x29')]);_0x2cf27e[_0x91cb('0x2e')]=_[_0x91cb('0x2d')](_0x5e98c4['query']);_0x2cf27e[_0x91cb('0x2f')]=_['intersection'](_0x2cf27e[_0x91cb('0x2b')],_0x2cf27e['query']);_0x5af0e6[_0x91cb('0x31')]=_['intersection'](_0x2cf27e[_0x91cb('0x2b')],qs[_0x91cb('0x32')](_0x5e98c4[_0x91cb('0x2e')][_0x91cb('0x32')]));_0x5af0e6['attributes']=_0x5af0e6[_0x91cb('0x31')][_0x91cb('0x33')]?_0x5af0e6['attributes']:_0x2cf27e[_0x91cb('0x2b')];if(_0x5e98c4[_0x91cb('0x2e')][_0x91cb('0x41')]){_0x5af0e6[_0x91cb('0x3c')]=[{'all':!![]}];}_0x5af0e6=_[_0x91cb('0x3b')]({},_0x5af0e6,_0x5e98c4[_0x91cb('0x42')]);return db[_0x91cb('0x28')][_0x91cb('0x43')](_0x5af0e6)[_0x91cb('0x22')](handleEntityNotFound(_0x435fff,null))['then'](respondWithResult(_0x435fff,null))[_0x91cb('0x3e')](handleError(_0x435fff,null));};exports[_0x91cb('0x44')]=function(_0x2b7323,_0x470996){return db[_0x91cb('0x28')][_0x91cb('0x44')](_0x2b7323[_0x91cb('0x45')],{})[_0x91cb('0x22')](respondWithResult(_0x470996,0xc9))['catch'](handleError(_0x470996,null));};exports[_0x91cb('0x46')]=function(_0x46caf1,_0x2b8b7f){if(_0x46caf1[_0x91cb('0x45')]['id']){delete _0x46caf1['body']['id'];}return db[_0x91cb('0x28')][_0x91cb('0x43')]({'where':{'id':_0x46caf1['params']['id']}})[_0x91cb('0x22')](handleEntityNotFound(_0x2b8b7f,null))['then'](saveUpdates(_0x46caf1[_0x91cb('0x45')],null))['then'](respondWithResult(_0x2b8b7f,null))['catch'](handleError(_0x2b8b7f,null));};exports['destroy']=function(_0x98245b,_0xff3d11){return db[_0x91cb('0x28')][_0x91cb('0x43')]({'where':{'id':_0x98245b[_0x91cb('0x40')]['id']}})['then'](handleEntityNotFound(_0xff3d11,null))['then'](removeEntity(_0xff3d11,null))[_0x91cb('0x3e')](handleError(_0xff3d11,null));};exports[_0x91cb('0x47')]=function(_0x140994,_0x14eaab){return db['SquareReport']['describe']()['then'](respondWithResult(_0x14eaab,null))[_0x91cb('0x3e')](handleError(_0x14eaab,null));};
\ No newline at end of file
+var _0x326f=['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','status','end','count','offset','limit','set','Content-Range','json','reject','save','destroy','then','sendStatus','stack','name','send','index','rawAttributes','fieldName','key','model','query','keys','filters','intersection','attributes','fields','length','hasOwnProperty','nolimit','order','where','merge','type','filter','options','SquareReport','include','rows','catch','show','params','includeAll','create','body','update','find','describe','html-pdf','zip-dir','fast-json-patch','request-promise'];(function(_0x2ce7c6,_0x556e37){var _0x163ee4=function(_0x44d075){while(--_0x44d075){_0x2ce7c6['push'](_0x2ce7c6['shift']());}};_0x163ee4(++_0x556e37);}(_0x326f,0xd1));var _0xf326=function(_0x331e71,_0x20c629){_0x331e71=_0x331e71-0x0;var _0x484785=_0x326f[_0x331e71];return _0x484785;};'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'];function respondWithStatusCode(_0x518ab5,_0x3162f9){_0x3162f9=_0x3162f9||0xcc;return function(_0x9ed463){if(_0x9ed463){return _0x518ab5['sendStatus'](_0x3162f9);}return _0x518ab5[_0xf326('0x17')](_0x3162f9)[_0xf326('0x18')]();};}function respondWithResult(_0x3504eb,_0x17a098){_0x17a098=_0x17a098||0xc8;return function(_0x5c8483){if(_0x5c8483){return _0x3504eb[_0xf326('0x17')](_0x17a098)['json'](_0x5c8483);}};}function respondWithFilteredResult(_0x54bd1a,_0xdf21d9){return function(_0x11f6d2){if(_0x11f6d2){var _0x1f2e5a=_0x11f6d2[_0xf326('0x19')],_0xa63d1a=_0xdf21d9[_0xf326('0x1a')],_0x292f4b=_0xdf21d9['offset']+_0xdf21d9[_0xf326('0x1b')],_0x287a2a;if(_0x292f4b>=_0x1f2e5a){_0x292f4b=_0x1f2e5a;_0x287a2a=0xc8;}else{_0x287a2a=0xce;}_0x54bd1a[_0xf326('0x17')](_0x287a2a);return _0x54bd1a[_0xf326('0x1c')](_0xf326('0x1d'),_0xa63d1a+'-'+_0x292f4b+'/'+_0x1f2e5a)[_0xf326('0x1e')](_0x11f6d2);}return null;};}function patchUpdates(_0x311af0){return function(_0x4d3d41){try{jsonpatch['apply'](_0x4d3d41,_0x311af0,!![]);}catch(_0x56ad41){return BPromise[_0xf326('0x1f')](_0x56ad41);}return _0x4d3d41[_0xf326('0x20')]();};}function saveUpdates(_0x484cbe,_0x4cabce){return function(_0x128c68){if(_0x128c68){return _0x128c68['update'](_0x484cbe)['then'](function(_0x448b92){return _0x448b92;});}return null;};}function removeEntity(_0x18ead3,_0x549b46){return function(_0x5aa184){if(_0x5aa184){return _0x5aa184[_0xf326('0x21')]()[_0xf326('0x22')](function(){_0x18ead3['status'](0xcc)[_0xf326('0x18')]();});}};}function handleEntityNotFound(_0x1b9039,_0x43c53e){return function(_0x295752){if(!_0x295752){_0x1b9039[_0xf326('0x23')](0x194);}return _0x295752;};}function handleError(_0x2049ec,_0x5ce532){_0x5ce532=_0x5ce532||0x1f4;return function(_0x55b9f4){logger['error'](_0x55b9f4[_0xf326('0x24')]);if(_0x55b9f4[_0xf326('0x25')]){delete _0x55b9f4[_0xf326('0x25')];}_0x2049ec[_0xf326('0x17')](_0x5ce532)[_0xf326('0x26')](_0x55b9f4);};}exports[_0xf326('0x27')]=function(_0x5217d4,_0x201d28){var _0xa3c0b={},_0x212d5d={},_0x581531={'count':0x0,'rows':[]};var _0x1617d2=_['map'](db['SquareReport'][_0xf326('0x28')],function(_0x1ae23a){return{'name':_0x1ae23a[_0xf326('0x29')],'type':_0x1ae23a['type'][_0xf326('0x2a')]};});_0x212d5d[_0xf326('0x2b')]=_['map'](_0x1617d2,_0xf326('0x25'));_0x212d5d[_0xf326('0x2c')]=_[_0xf326('0x2d')](_0x5217d4[_0xf326('0x2c')]);_0x212d5d[_0xf326('0x2e')]=_[_0xf326('0x2f')](_0x212d5d[_0xf326('0x2b')],_0x212d5d[_0xf326('0x2c')]);_0xa3c0b[_0xf326('0x30')]=_[_0xf326('0x2f')](_0x212d5d['model'],qs[_0xf326('0x31')](_0x5217d4[_0xf326('0x2c')][_0xf326('0x31')]));_0xa3c0b['attributes']=_0xa3c0b[_0xf326('0x30')][_0xf326('0x32')]?_0xa3c0b[_0xf326('0x30')]:_0x212d5d['model'];if(!_0x5217d4['query'][_0xf326('0x33')](_0xf326('0x34'))){_0xa3c0b[_0xf326('0x1b')]=qs[_0xf326('0x1b')](_0x5217d4[_0xf326('0x2c')][_0xf326('0x1b')]);_0xa3c0b[_0xf326('0x1a')]=qs[_0xf326('0x1a')](_0x5217d4['query'][_0xf326('0x1a')]);}_0xa3c0b[_0xf326('0x35')]=qs['sort'](_0x5217d4[_0xf326('0x2c')]['sort']);_0xa3c0b[_0xf326('0x36')]=qs['filters'](_['pick'](_0x5217d4[_0xf326('0x2c')],_0x212d5d['filters']));if(_0x5217d4[_0xf326('0x2c')]['filter']){_0xa3c0b[_0xf326('0x36')]=_[_0xf326('0x37')](_0xa3c0b[_0xf326('0x36')],{'$or':_['map'](_0x1617d2,function(_0x3dcc7e){if(_0x3dcc7e[_0xf326('0x38')]!=='VIRTUAL'){var _0x13932b={};_0x13932b[_0x3dcc7e[_0xf326('0x25')]]={'$like':'%'+_0x5217d4[_0xf326('0x2c')][_0xf326('0x39')]+'%'};return _0x13932b;}})});}_0xa3c0b=_['merge']({},_0xa3c0b,_0x5217d4[_0xf326('0x3a')]);var _0xb1ef35={'where':_0xa3c0b[_0xf326('0x36')]};return db[_0xf326('0x3b')][_0xf326('0x19')](_0xb1ef35)['then'](function(_0x3e830d){_0x581531[_0xf326('0x19')]=_0x3e830d;if(_0x5217d4['query']['includeAll']){_0xa3c0b[_0xf326('0x3c')]=[{'all':!![]}];}return db['SquareReport']['findAll'](_0xa3c0b);})[_0xf326('0x22')](function(_0x5d6ae2){_0x581531[_0xf326('0x3d')]=_0x5d6ae2;return _0x581531;})[_0xf326('0x22')](respondWithFilteredResult(_0x201d28,_0xa3c0b))[_0xf326('0x3e')](handleError(_0x201d28,null));};exports[_0xf326('0x3f')]=function(_0x49112d,_0x9dda89){var _0x45d344={'raw':!![],'where':{'id':_0x49112d[_0xf326('0x40')]['id']}},_0x347e7b={};_0x347e7b[_0xf326('0x2b')]=_[_0xf326('0x2d')](db[_0xf326('0x3b')][_0xf326('0x28')]);_0x347e7b[_0xf326('0x2c')]=_[_0xf326('0x2d')](_0x49112d[_0xf326('0x2c')]);_0x347e7b[_0xf326('0x2e')]=_['intersection'](_0x347e7b[_0xf326('0x2b')],_0x347e7b[_0xf326('0x2c')]);_0x45d344[_0xf326('0x30')]=_[_0xf326('0x2f')](_0x347e7b[_0xf326('0x2b')],qs[_0xf326('0x31')](_0x49112d['query'][_0xf326('0x31')]));_0x45d344[_0xf326('0x30')]=_0x45d344['attributes'][_0xf326('0x32')]?_0x45d344[_0xf326('0x30')]:_0x347e7b[_0xf326('0x2b')];if(_0x49112d[_0xf326('0x2c')][_0xf326('0x41')]){_0x45d344['include']=[{'all':!![]}];}_0x45d344=_['merge']({},_0x45d344,_0x49112d[_0xf326('0x3a')]);return db[_0xf326('0x3b')]['find'](_0x45d344)['then'](handleEntityNotFound(_0x9dda89,null))[_0xf326('0x22')](respondWithResult(_0x9dda89,null))[_0xf326('0x3e')](handleError(_0x9dda89,null));};exports[_0xf326('0x42')]=function(_0x5b3705,_0x301e65){return db[_0xf326('0x3b')][_0xf326('0x42')](_0x5b3705[_0xf326('0x43')],{})[_0xf326('0x22')](respondWithResult(_0x301e65,0xc9))[_0xf326('0x3e')](handleError(_0x301e65,null));};exports[_0xf326('0x44')]=function(_0x3b90dc,_0x3df9a8){if(_0x3b90dc[_0xf326('0x43')]['id']){delete _0x3b90dc[_0xf326('0x43')]['id'];}return db[_0xf326('0x3b')][_0xf326('0x45')]({'where':{'id':_0x3b90dc[_0xf326('0x40')]['id']}})[_0xf326('0x22')](handleEntityNotFound(_0x3df9a8,null))['then'](saveUpdates(_0x3b90dc[_0xf326('0x43')],null))[_0xf326('0x22')](respondWithResult(_0x3df9a8,null))[_0xf326('0x3e')](handleError(_0x3df9a8,null));};exports[_0xf326('0x21')]=function(_0x5f1829,_0x10f437){return db[_0xf326('0x3b')][_0xf326('0x45')]({'where':{'id':_0x5f1829[_0xf326('0x40')]['id']}})['then'](handleEntityNotFound(_0x10f437,null))[_0xf326('0x22')](removeEntity(_0x10f437,null))[_0xf326('0x3e')](handleError(_0x10f437,null));};exports[_0xf326('0x46')]=function(_0x451ac7,_0x39ba25){return db['SquareReport']['describe']()[_0xf326('0x22')](respondWithResult(_0x39ba25,null))[_0xf326('0x3e')](handleError(_0x39ba25,null));};
\ No newline at end of file
diff --git a/server/api/squareReport/squareReport.model.js b/server/api/squareReport/squareReport.model.js
index d27f282..dcb1f2d 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 _0x6df1=['SquareReport','uid_pname','uniqueid','leaveAt','lodash','util','api','bluebird','../../config/environment','./squareReport.attributes','exports'];(function(_0x4ca8e6,_0x11c2bf){var _0x2236ed=function(_0x455925){while(--_0x455925){_0x4ca8e6['push'](_0x4ca8e6['shift']());}};_0x2236ed(++_0x11c2bf);}(_0x6df1,0xa9));var _0x16df=function(_0x151ed4,_0x23cfb8){_0x151ed4=_0x151ed4-0x0;var _0x1c6f7e=_0x6df1[_0x151ed4];return _0x1c6f7e;};'use strict';var _=require(_0x16df('0x0'));var util=require(_0x16df('0x1'));var logger=require('../../config/logger')(_0x16df('0x2'));var moment=require('moment');var BPromise=require(_0x16df('0x3'));var rp=require('request-promise');var fs=require('fs');var path=require('path');var rimraf=require('rimraf');var config=require(_0x16df('0x4'));var attributes=require(_0x16df('0x5'));module[_0x16df('0x6')]=function(_0x1b41af,_0x502de3){return _0x1b41af['define'](_0x16df('0x7'),attributes,{'tableName':'report_square','paranoid':![],'indexes':[{'name':_0x16df('0x8'),'fields':[_0x16df('0x9'),'project_name']},{'name':_0x16df('0xa'),'fields':[_0x16df('0xa')]}],'timestamps':!![]});};
\ No newline at end of file
+var _0xd5ef=['define','SquareReport','report_square','uid_pname','uniqueid','project_name','leaveAt','lodash','util','../../config/logger','api','moment','bluebird','path','../../config/environment','exports'];(function(_0x266adb,_0x6ac6e1){var _0x39ad47=function(_0x38c924){while(--_0x38c924){_0x266adb['push'](_0x266adb['shift']());}};_0x39ad47(++_0x6ac6e1);}(_0xd5ef,0xf7));var _0xfd5e=function(_0x47172b,_0x191fe0){_0x47172b=_0x47172b-0x0;var _0x1c812d=_0xd5ef[_0x47172b];return _0x1c812d;};'use strict';var _=require(_0xfd5e('0x0'));var util=require(_0xfd5e('0x1'));var logger=require(_0xfd5e('0x2'))(_0xfd5e('0x3'));var moment=require(_0xfd5e('0x4'));var BPromise=require(_0xfd5e('0x5'));var rp=require('request-promise');var fs=require('fs');var path=require(_0xfd5e('0x6'));var rimraf=require('rimraf');var config=require(_0xfd5e('0x7'));var attributes=require('./squareReport.attributes');module[_0xfd5e('0x8')]=function(_0x185717,_0x35e6b6){return _0x185717[_0xfd5e('0x9')](_0xfd5e('0xa'),attributes,{'tableName':_0xfd5e('0xb'),'paranoid':![],'indexes':[{'name':_0xfd5e('0xc'),'fields':[_0xfd5e('0xd'),_0xfd5e('0xe')]},{'name':_0xfd5e('0xf'),'fields':[_0xfd5e('0xf')]}],'timestamps':!![]});};
\ No newline at end of file
diff --git a/server/api/squareReport/squareReport.rpc.js b/server/api/squareReport/squareReport.rpc.js
index fc375bb..d88279e 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 _0x9ec7=['UpdateSquareReport','lodash','moment','randomstring','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','client','http','request','then','info','debug','SquareReport,\x20%s,\x20%s,\x20%s','stringify','error','SquareReport,\x20%s,\x20%s','message','result','catch','CreateSquareReport','SquareReport','create','body','options','raw','update','where','attributes','limit'];(function(_0x3ccdf8,_0x584ceb){var _0x243dab=function(_0x1a90d1){while(--_0x1a90d1){_0x3ccdf8['push'](_0x3ccdf8['shift']());}};_0x243dab(++_0x584ceb);}(_0x9ec7,0x161));var _0x79ec=function(_0x5b9a3f,_0x56697d){_0x5b9a3f=_0x5b9a3f-0x0;var _0x3ff951=_0x9ec7[_0x5b9a3f];return _0x3ff951;};'use strict';var _=require(_0x79ec('0x0'));var util=require('util');var moment=require(_0x79ec('0x1'));var BPromise=require('bluebird');var rs=require(_0x79ec('0x2'));var fs=require('fs');var Redis=require('ioredis');var db=require(_0x79ec('0x3'))['db'];var utils=require(_0x79ec('0x4'));var logger=require(_0x79ec('0x5'))(_0x79ec('0x6'));var config=require(_0x79ec('0x7'));var jayson=require('jayson/promise');var client=jayson[_0x79ec('0x8')][_0x79ec('0x9')]({'port':0x232a});function respondWithRpcPromise(_0x11d0d8,_0x1df8b1,_0x15510e){return new BPromise(function(_0x4d6620,_0x303f50){return client[_0x79ec('0xa')](_0x11d0d8,_0x15510e)[_0x79ec('0xb')](function(_0xb23dfe){logger[_0x79ec('0xc')]('SquareReport,\x20%s,\x20%s',_0x1df8b1,'request\x20sent');logger[_0x79ec('0xd')](_0x79ec('0xe'),_0x1df8b1,'request\x20sent',JSON[_0x79ec('0xf')](_0xb23dfe));if(_0xb23dfe[_0x79ec('0x10')]){if(_0xb23dfe[_0x79ec('0x10')]['code']===0x1f4){logger[_0x79ec('0x10')](_0x79ec('0x11'),_0x1df8b1,_0xb23dfe[_0x79ec('0x10')][_0x79ec('0x12')]);return _0x303f50(_0xb23dfe[_0x79ec('0x10')][_0x79ec('0x12')]);}logger[_0x79ec('0x10')](_0x79ec('0x11'),_0x1df8b1,_0xb23dfe[_0x79ec('0x10')][_0x79ec('0x12')]);return _0x4d6620(_0xb23dfe[_0x79ec('0x10')][_0x79ec('0x12')]);}else{logger[_0x79ec('0xc')](_0x79ec('0x11'),_0x1df8b1,'request\x20sent');_0x4d6620(_0xb23dfe[_0x79ec('0x13')][_0x79ec('0x12')]);}})[_0x79ec('0x14')](function(_0x5d2607){logger[_0x79ec('0x10')](_0x79ec('0x11'),_0x1df8b1,_0x5d2607);_0x303f50(_0x5d2607);});});}exports[_0x79ec('0x15')]=function(_0x1946d3){var _0x4efa03=this;return new Promise(function(_0x3d3d37,_0x24beb4){return db[_0x79ec('0x16')][_0x79ec('0x17')](_0x1946d3[_0x79ec('0x18')],{'raw':_0x1946d3['options']?_0x1946d3[_0x79ec('0x19')][_0x79ec('0x1a')]===undefined?!![]:![]:!![]})[_0x79ec('0xb')](function(_0x1cc5ad){logger[_0x79ec('0xc')]('CreateSquareReport',_0x1946d3);logger[_0x79ec('0xd')](_0x79ec('0x15'),_0x1946d3,JSON[_0x79ec('0xf')](_0x1cc5ad));_0x3d3d37(_0x1cc5ad);})[_0x79ec('0x14')](function(_0xc7a34f){logger['error'](_0x79ec('0x15'),_0xc7a34f[_0x79ec('0x12')],_0x1946d3);_0x24beb4(_0x4efa03[_0x79ec('0x10')](0x1f4,_0xc7a34f[_0x79ec('0x12')]));});});};exports['UpdateSquareReport']=function(_0x723fb9){var _0xff2ec7=this;return new Promise(function(_0x5bf80b,_0x526d85){return db[_0x79ec('0x16')][_0x79ec('0x1b')](_0x723fb9[_0x79ec('0x18')],{'raw':_0x723fb9[_0x79ec('0x19')]?_0x723fb9[_0x79ec('0x19')][_0x79ec('0x1a')]===undefined?!![]:![]:!![],'individualHooks':!![],'where':_0x723fb9[_0x79ec('0x19')]?_0x723fb9[_0x79ec('0x19')][_0x79ec('0x1c')]||null:null,'attributes':_0x723fb9[_0x79ec('0x19')]?_0x723fb9[_0x79ec('0x19')][_0x79ec('0x1d')]||null:null,'limit':_0x723fb9[_0x79ec('0x19')]?_0x723fb9['options'][_0x79ec('0x1e')]||null:null})['then'](function(_0x3243b2){logger[_0x79ec('0xc')](_0x79ec('0x1f'),_0x723fb9);logger['debug'](_0x79ec('0x1f'),_0x723fb9,JSON[_0x79ec('0xf')](_0x3243b2));_0x5bf80b(_0x3243b2);})[_0x79ec('0x14')](function(_0x23260e){logger['error'](_0x79ec('0x1f'),_0x23260e[_0x79ec('0x12')],_0x723fb9);_0x526d85(_0xff2ec7[_0x79ec('0x10')](0x1f4,_0x23260e[_0x79ec('0x12')]));});});};
\ No newline at end of file
+var _0xb5fb=['lodash','util','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','jayson/promise','client','request','info','SquareReport,\x20%s,\x20%s','request\x20sent','SquareReport,\x20%s,\x20%s,\x20%s','stringify','error','code','message','CreateSquareReport','SquareReport','create','options','raw','then','debug','catch','UpdateSquareReport','update','where','limit'];(function(_0x2b91c5,_0x3b6db5){var _0xbd5531=function(_0x54783d){while(--_0x54783d){_0x2b91c5['push'](_0x2b91c5['shift']());}};_0xbd5531(++_0x3b6db5);}(_0xb5fb,0x108));var _0xbb5f=function(_0xfb9aaa,_0x37935d){_0xfb9aaa=_0xfb9aaa-0x0;var _0x103bf7=_0xb5fb[_0xfb9aaa];return _0x103bf7;};'use strict';var _=require(_0xbb5f('0x0'));var util=require(_0xbb5f('0x1'));var moment=require(_0xbb5f('0x2'));var BPromise=require(_0xbb5f('0x3'));var rs=require(_0xbb5f('0x4'));var fs=require('fs');var Redis=require(_0xbb5f('0x5'));var db=require(_0xbb5f('0x6'))['db'];var utils=require(_0xbb5f('0x7'));var logger=require(_0xbb5f('0x8'))(_0xbb5f('0x9'));var config=require('../../config/environment');var jayson=require(_0xbb5f('0xa'));var client=jayson[_0xbb5f('0xb')]['http']({'port':0x232a});function respondWithRpcPromise(_0x1f91a8,_0x3a0ef7,_0x621a72){return new BPromise(function(_0x266232,_0xc1c5d){return client[_0xbb5f('0xc')](_0x1f91a8,_0x621a72)['then'](function(_0x20ae43){logger[_0xbb5f('0xd')](_0xbb5f('0xe'),_0x3a0ef7,_0xbb5f('0xf'));logger['debug'](_0xbb5f('0x10'),_0x3a0ef7,'request\x20sent',JSON[_0xbb5f('0x11')](_0x20ae43));if(_0x20ae43['error']){if(_0x20ae43[_0xbb5f('0x12')][_0xbb5f('0x13')]===0x1f4){logger['error']('SquareReport,\x20%s,\x20%s',_0x3a0ef7,_0x20ae43[_0xbb5f('0x12')][_0xbb5f('0x14')]);return _0xc1c5d(_0x20ae43[_0xbb5f('0x12')]['message']);}logger[_0xbb5f('0x12')](_0xbb5f('0xe'),_0x3a0ef7,_0x20ae43['error'][_0xbb5f('0x14')]);return _0x266232(_0x20ae43['error'][_0xbb5f('0x14')]);}else{logger[_0xbb5f('0xd')](_0xbb5f('0xe'),_0x3a0ef7,'request\x20sent');_0x266232(_0x20ae43['result'][_0xbb5f('0x14')]);}})['catch'](function(_0x5adf98){logger['error'](_0xbb5f('0xe'),_0x3a0ef7,_0x5adf98);_0xc1c5d(_0x5adf98);});});}exports[_0xbb5f('0x15')]=function(_0x2bfa9b){var _0xdc025=this;return new Promise(function(_0x603607,_0x2fd314){return db[_0xbb5f('0x16')][_0xbb5f('0x17')](_0x2bfa9b['body'],{'raw':_0x2bfa9b['options']?_0x2bfa9b[_0xbb5f('0x18')][_0xbb5f('0x19')]===undefined?!![]:![]:!![]})[_0xbb5f('0x1a')](function(_0x437218){logger['info'](_0xbb5f('0x15'),_0x2bfa9b);logger[_0xbb5f('0x1b')]('CreateSquareReport',_0x2bfa9b,JSON[_0xbb5f('0x11')](_0x437218));_0x603607(_0x437218);})[_0xbb5f('0x1c')](function(_0x4eb478){logger[_0xbb5f('0x12')]('CreateSquareReport',_0x4eb478[_0xbb5f('0x14')],_0x2bfa9b);_0x2fd314(_0xdc025[_0xbb5f('0x12')](0x1f4,_0x4eb478[_0xbb5f('0x14')]));});});};exports[_0xbb5f('0x1d')]=function(_0x222396){var _0x2b2dde=this;return new Promise(function(_0x48e74d,_0x4e7b8f){return db['SquareReport'][_0xbb5f('0x1e')](_0x222396['body'],{'raw':_0x222396[_0xbb5f('0x18')]?_0x222396[_0xbb5f('0x18')][_0xbb5f('0x19')]===undefined?!![]:![]:!![],'individualHooks':!![],'where':_0x222396[_0xbb5f('0x18')]?_0x222396[_0xbb5f('0x18')][_0xbb5f('0x1f')]||null:null,'attributes':_0x222396[_0xbb5f('0x18')]?_0x222396['options']['attributes']||null:null,'limit':_0x222396[_0xbb5f('0x18')]?_0x222396['options'][_0xbb5f('0x20')]||null:null})[_0xbb5f('0x1a')](function(_0x39265f){logger[_0xbb5f('0xd')]('UpdateSquareReport',_0x222396);logger[_0xbb5f('0x1b')](_0xbb5f('0x1d'),_0x222396,JSON['stringify'](_0x39265f));_0x48e74d(_0x39265f);})[_0xbb5f('0x1c')](function(_0x447890){logger[_0xbb5f('0x12')](_0xbb5f('0x1d'),_0x447890['message'],_0x222396);_0x4e7b8f(_0x2b2dde[_0xbb5f('0x12')](0x1f4,_0x447890[_0xbb5f('0x14')]));});});};
\ No newline at end of file
diff --git a/server/api/squareReportDetail/index.js b/server/api/squareReportDetail/index.js
index 12bcc0d..d9686e6 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(_0x53bf98,_0x5483b0){var _0x27ceb9=function(_0x626edb){while(--_0x626edb){_0x53bf98['push'](_0x53bf98['shift']());}};_0x27ceb9(++_0x5483b0);}(_0x5f2f,0x73));var _0xf5f2=function(_0x572e4f,_0x5b1bc9){_0x572e4f=_0x572e4f-0x0;var _0x5de6fb=_0x5f2f[_0x572e4f];return _0x5de6fb;};'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 _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(_0x35eb86,_0x45c7e1){var _0x4fa469=function(_0x226281){while(--_0x226281){_0x35eb86['push'](_0x35eb86['shift']());}};_0x4fa469(++_0x45c7e1);}(_0x5f2f,0x73));var _0xf5f2=function(_0x5239d8,_0x393685){_0x5239d8=_0x5239d8-0x0;var _0x1b73ba=_0x5f2f[_0x5239d8];return _0x1b73ba;};'use strict';var multer=require(_0xf5f2('0x0'));var util=require(_0xf5f2('0x1'));var path=require(_0xf5f2('0x2'));var timeout=require(_0xf5f2('0x3'));var express=require(_0xf5f2('0x4'));var router=express[_0xf5f2('0x5')]();var auth=require(_0xf5f2('0x6'));var interaction=require(_0xf5f2('0x7'));var config=require('../../config/environment');var controller=require('./squareReportDetail.controller');router[_0xf5f2('0x8')]('/',auth[_0xf5f2('0x9')](),controller[_0xf5f2('0xa')]);router[_0xf5f2('0x8')](_0xf5f2('0xb'),auth[_0xf5f2('0x9')](),controller['describe']);router[_0xf5f2('0x8')](_0xf5f2('0xc'),auth[_0xf5f2('0x9')](),controller['show']);router[_0xf5f2('0xd')]('/',auth[_0xf5f2('0x9')](),controller[_0xf5f2('0xe')]);router['put'](_0xf5f2('0xc'),auth['isAuthenticated'](),controller['update']);router[_0xf5f2('0xf')](_0xf5f2('0xc'),auth['isAuthenticated'](),controller[_0xf5f2('0x10')]);module[_0xf5f2('0x11')]=router;
\ No newline at end of file
diff --git a/server/api/squareReportDetail/squareReportDetail.attributes.js b/server/api/squareReportDetail/squareReportDetail.attributes.js
index eec8f98..de1a1ae 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 _0x9369=['STRING','TEXT','exports'];(function(_0x2f1ac1,_0x30ff76){var _0x9f8fa4=function(_0x1eaf25){while(--_0x1eaf25){_0x2f1ac1['push'](_0x2f1ac1['shift']());}};_0x9f8fa4(++_0x30ff76);}(_0x9369,0x1be));var _0x9936=function(_0x2d85a8,_0xbf9244){_0x2d85a8=_0x2d85a8-0x0;var _0x31f2fa=_0x9369[_0x2d85a8];return _0x31f2fa;};'use strict';var Sequelize=require('sequelize');module[_0x9936('0x0')]={'uniqueid':{'type':Sequelize[_0x9936('0x1')]},'node':{'type':Sequelize[_0x9936('0x1')]},'application':{'type':Sequelize[_0x9936('0x1')]},'data':{'type':Sequelize[_0x9936('0x2')]},'project_name':{'type':Sequelize[_0x9936('0x1')]},'callerid':{'type':Sequelize['STRING']}};
\ No newline at end of file
+var _0x309e=['TEXT','STRING'];(function(_0x27af45,_0x1b57aa){var _0x18df21=function(_0x4b7679){while(--_0x4b7679){_0x27af45['push'](_0x27af45['shift']());}};_0x18df21(++_0x1b57aa);}(_0x309e,0xe5));var _0xe309=function(_0x16b9ed,_0x56517a){_0x16b9ed=_0x16b9ed-0x0;var _0x66b1f8=_0x309e[_0x16b9ed];return _0x66b1f8;};'use strict';var Sequelize=require('sequelize');module['exports']={'uniqueid':{'type':Sequelize[_0xe309('0x0')]},'node':{'type':Sequelize['STRING']},'application':{'type':Sequelize[_0xe309('0x0')]},'data':{'type':Sequelize[_0xe309('0x1')]},'project_name':{'type':Sequelize[_0xe309('0x0')]},'callerid':{'type':Sequelize[_0xe309('0x0')]}};
\ No newline at end of file
diff --git a/server/api/squareReportDetail/squareReportDetail.controller.js b/server/api/squareReportDetail/squareReportDetail.controller.js
index 303c3c2..3e1cd01 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 _0x8f7b=['where','pick','filter','VIRTUAL','merge','includeAll','include','findAll','catch','show','params','options','create','body','find','describe','rimraf','fast-json-patch','request-promise','moment','bluebird','mustache','path','sox','ejs','squel','crypto','jsforce','desk.js','to-csv','../../components/auth/service','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/utils','../../mysqldb','status','count','offset','limit','set','Content-Range','json','apply','reject','save','update','then','destroy','end','error','name','send','map','SquareDetailsReport','rawAttributes','fieldName','type','model','keys','query','filters','intersection','fields','length','attributes','hasOwnProperty','nolimit','sort'];(function(_0x26b77f,_0x199be1){var _0x5ebab0=function(_0x3c21c3){while(--_0x3c21c3){_0x26b77f['push'](_0x26b77f['shift']());}};_0x5ebab0(++_0x199be1);}(_0x8f7b,0x16e));var _0xb8f7=function(_0x6131cd,_0x4c26a1){_0x6131cd=_0x6131cd-0x0;var _0x47e916=_0x8f7b[_0x6131cd];return _0x47e916;};'use strict';var pdf=require('html-pdf');var emlformat=require('eml-format');var rimraf=require(_0xb8f7('0x0'));var zipdir=require('zip-dir');var jsonpatch=require(_0xb8f7('0x1'));var rp=require(_0xb8f7('0x2'));var moment=require(_0xb8f7('0x3'));var BPromise=require(_0xb8f7('0x4'));var Mustache=require(_0xb8f7('0x5'));var util=require('util');var path=require(_0xb8f7('0x6'));var sox=require(_0xb8f7('0x7'));var csv=require('to-csv');var ejs=require(_0xb8f7('0x8'));var fs=require('fs');var _=require('lodash');var squel=require(_0xb8f7('0x9'));var crypto=require(_0xb8f7('0xa'));var jsforce=require(_0xb8f7('0xb'));var deskjs=require(_0xb8f7('0xc'));var toCsv=require(_0xb8f7('0xd'));var querystring=require('querystring');var Papa=require('papaparse');var Redis=require('ioredis');var authService=require(_0xb8f7('0xe'));var qs=require('../../components/parsers/qs');var as=require(_0xb8f7('0xf'));var hardwareService=require(_0xb8f7('0x10'));var logger=require(_0xb8f7('0x11'))(_0xb8f7('0x12'));var utils=require(_0xb8f7('0x13'));var config=require('../../config/environment');var db=require(_0xb8f7('0x14'))['db'];function respondWithStatusCode(_0x1d220e,_0xbed87f){_0xbed87f=_0xbed87f||0xcc;return function(_0x1dad2c){if(_0x1dad2c){return _0x1d220e['sendStatus'](_0xbed87f);}return _0x1d220e[_0xb8f7('0x15')](_0xbed87f)['end']();};}function respondWithResult(_0x1cdfe6,_0xdbc63e){_0xdbc63e=_0xdbc63e||0xc8;return function(_0x1bada5){if(_0x1bada5){return _0x1cdfe6[_0xb8f7('0x15')](_0xdbc63e)['json'](_0x1bada5);}};}function respondWithFilteredResult(_0x541124,_0xe96ba){return function(_0x2e9cf8){if(_0x2e9cf8){var _0x4f9e4c=_0x2e9cf8[_0xb8f7('0x16')],_0x441c7d=_0xe96ba[_0xb8f7('0x17')],_0x3e8db4=_0xe96ba[_0xb8f7('0x17')]+_0xe96ba[_0xb8f7('0x18')],_0x1ab6ab;if(_0x3e8db4>=_0x4f9e4c){_0x3e8db4=_0x4f9e4c;_0x1ab6ab=0xc8;}else{_0x1ab6ab=0xce;}_0x541124[_0xb8f7('0x15')](_0x1ab6ab);return _0x541124[_0xb8f7('0x19')](_0xb8f7('0x1a'),_0x441c7d+'-'+_0x3e8db4+'/'+_0x4f9e4c)[_0xb8f7('0x1b')](_0x2e9cf8);}return null;};}function patchUpdates(_0x484bf3){return function(_0x418d45){try{jsonpatch[_0xb8f7('0x1c')](_0x418d45,_0x484bf3,!![]);}catch(_0xd398b0){return BPromise[_0xb8f7('0x1d')](_0xd398b0);}return _0x418d45[_0xb8f7('0x1e')]();};}function saveUpdates(_0x45bd42,_0x117843){return function(_0x14dcce){if(_0x14dcce){return _0x14dcce[_0xb8f7('0x1f')](_0x45bd42)[_0xb8f7('0x20')](function(_0x4ae3e5){return _0x4ae3e5;});}return null;};}function removeEntity(_0x2bcd10,_0x1ca746){return function(_0x404dc0){if(_0x404dc0){return _0x404dc0[_0xb8f7('0x21')]()[_0xb8f7('0x20')](function(){_0x2bcd10[_0xb8f7('0x15')](0xcc)[_0xb8f7('0x22')]();});}};}function handleEntityNotFound(_0x1f9d65,_0x53eef1){return function(_0x1faac6){if(!_0x1faac6){_0x1f9d65['sendStatus'](0x194);}return _0x1faac6;};}function handleError(_0x318746,_0x24e037){_0x24e037=_0x24e037||0x1f4;return function(_0x5beeeb){logger[_0xb8f7('0x23')](_0x5beeeb['stack']);if(_0x5beeeb['name']){delete _0x5beeeb[_0xb8f7('0x24')];}_0x318746[_0xb8f7('0x15')](_0x24e037)[_0xb8f7('0x25')](_0x5beeeb);};}exports['index']=function(_0x4467f7,_0x436234){var _0x16f1ac={},_0x3a1803={},_0x22ca00={'count':0x0,'rows':[]};var _0x26bd67=_[_0xb8f7('0x26')](db[_0xb8f7('0x27')][_0xb8f7('0x28')],function(_0x22a805){return{'name':_0x22a805[_0xb8f7('0x29')],'type':_0x22a805[_0xb8f7('0x2a')]['key']};});_0x3a1803[_0xb8f7('0x2b')]=_[_0xb8f7('0x26')](_0x26bd67,_0xb8f7('0x24'));_0x3a1803['query']=_[_0xb8f7('0x2c')](_0x4467f7[_0xb8f7('0x2d')]);_0x3a1803[_0xb8f7('0x2e')]=_['intersection'](_0x3a1803['model'],_0x3a1803['query']);_0x16f1ac['attributes']=_[_0xb8f7('0x2f')](_0x3a1803['model'],qs['fields'](_0x4467f7[_0xb8f7('0x2d')][_0xb8f7('0x30')]));_0x16f1ac['attributes']=_0x16f1ac['attributes'][_0xb8f7('0x31')]?_0x16f1ac[_0xb8f7('0x32')]:_0x3a1803[_0xb8f7('0x2b')];if(!_0x4467f7['query'][_0xb8f7('0x33')](_0xb8f7('0x34'))){_0x16f1ac[_0xb8f7('0x18')]=qs[_0xb8f7('0x18')](_0x4467f7[_0xb8f7('0x2d')]['limit']);_0x16f1ac['offset']=qs[_0xb8f7('0x17')](_0x4467f7[_0xb8f7('0x2d')]['offset']);}_0x16f1ac['order']=qs[_0xb8f7('0x35')](_0x4467f7[_0xb8f7('0x2d')][_0xb8f7('0x35')]);_0x16f1ac[_0xb8f7('0x36')]=qs[_0xb8f7('0x2e')](_[_0xb8f7('0x37')](_0x4467f7[_0xb8f7('0x2d')],_0x3a1803[_0xb8f7('0x2e')]));if(_0x4467f7[_0xb8f7('0x2d')][_0xb8f7('0x38')]){_0x16f1ac[_0xb8f7('0x36')]=_['merge'](_0x16f1ac[_0xb8f7('0x36')],{'$or':_['map'](_0x26bd67,function(_0x4e22ec){if(_0x4e22ec[_0xb8f7('0x2a')]!==_0xb8f7('0x39')){var _0x3a58d5={};_0x3a58d5[_0x4e22ec[_0xb8f7('0x24')]]={'$like':'%'+_0x4467f7[_0xb8f7('0x2d')][_0xb8f7('0x38')]+'%'};return _0x3a58d5;}})});}_0x16f1ac=_[_0xb8f7('0x3a')]({},_0x16f1ac,_0x4467f7['options']);var _0x498a7f={'where':_0x16f1ac[_0xb8f7('0x36')]};return db[_0xb8f7('0x27')][_0xb8f7('0x16')](_0x498a7f)[_0xb8f7('0x20')](function(_0x324c45){_0x22ca00[_0xb8f7('0x16')]=_0x324c45;if(_0x4467f7['query'][_0xb8f7('0x3b')]){_0x16f1ac[_0xb8f7('0x3c')]=[{'all':!![]}];}return db[_0xb8f7('0x27')][_0xb8f7('0x3d')](_0x16f1ac);})[_0xb8f7('0x20')](function(_0x326de5){_0x22ca00['rows']=_0x326de5;return _0x22ca00;})['then'](respondWithFilteredResult(_0x436234,_0x16f1ac))[_0xb8f7('0x3e')](handleError(_0x436234,null));};exports[_0xb8f7('0x3f')]=function(_0x5e7499,_0x36e514){var _0x13ddb9={'raw':!![],'where':{'id':_0x5e7499[_0xb8f7('0x40')]['id']}},_0x2d79c3={};_0x2d79c3[_0xb8f7('0x2b')]=_[_0xb8f7('0x2c')](db[_0xb8f7('0x27')][_0xb8f7('0x28')]);_0x2d79c3[_0xb8f7('0x2d')]=_[_0xb8f7('0x2c')](_0x5e7499[_0xb8f7('0x2d')]);_0x2d79c3[_0xb8f7('0x2e')]=_[_0xb8f7('0x2f')](_0x2d79c3[_0xb8f7('0x2b')],_0x2d79c3[_0xb8f7('0x2d')]);_0x13ddb9[_0xb8f7('0x32')]=_[_0xb8f7('0x2f')](_0x2d79c3[_0xb8f7('0x2b')],qs[_0xb8f7('0x30')](_0x5e7499[_0xb8f7('0x2d')]['fields']));_0x13ddb9[_0xb8f7('0x32')]=_0x13ddb9[_0xb8f7('0x32')]['length']?_0x13ddb9[_0xb8f7('0x32')]:_0x2d79c3['model'];if(_0x5e7499[_0xb8f7('0x2d')][_0xb8f7('0x3b')]){_0x13ddb9[_0xb8f7('0x3c')]=[{'all':!![]}];}_0x13ddb9=_['merge']({},_0x13ddb9,_0x5e7499[_0xb8f7('0x41')]);return db[_0xb8f7('0x27')]['find'](_0x13ddb9)[_0xb8f7('0x20')](handleEntityNotFound(_0x36e514,null))[_0xb8f7('0x20')](respondWithResult(_0x36e514,null))[_0xb8f7('0x3e')](handleError(_0x36e514,null));};exports[_0xb8f7('0x42')]=function(_0x1fca84,_0x5eb7f8){return db[_0xb8f7('0x27')][_0xb8f7('0x42')](_0x1fca84[_0xb8f7('0x43')],{})['then'](respondWithResult(_0x5eb7f8,0xc9))[_0xb8f7('0x3e')](handleError(_0x5eb7f8,null));};exports[_0xb8f7('0x1f')]=function(_0x3dfd5c,_0x3660eb){if(_0x3dfd5c[_0xb8f7('0x43')]['id']){delete _0x3dfd5c['body']['id'];}return db[_0xb8f7('0x27')][_0xb8f7('0x44')]({'where':{'id':_0x3dfd5c[_0xb8f7('0x40')]['id']}})[_0xb8f7('0x20')](handleEntityNotFound(_0x3660eb,null))[_0xb8f7('0x20')](saveUpdates(_0x3dfd5c[_0xb8f7('0x43')],null))[_0xb8f7('0x20')](respondWithResult(_0x3660eb,null))[_0xb8f7('0x3e')](handleError(_0x3660eb,null));};exports['destroy']=function(_0x499ba5,_0x546187){return db[_0xb8f7('0x27')][_0xb8f7('0x44')]({'where':{'id':_0x499ba5[_0xb8f7('0x40')]['id']}})[_0xb8f7('0x20')](handleEntityNotFound(_0x546187,null))[_0xb8f7('0x20')](removeEntity(_0x546187,null))['catch'](handleError(_0x546187,null));};exports[_0xb8f7('0x45')]=function(_0xadd32,_0x3abfe1){return db[_0xb8f7('0x27')][_0xb8f7('0x45')]()[_0xb8f7('0x20')](respondWithResult(_0x3abfe1,null))[_0xb8f7('0x3e')](handleError(_0x3abfe1,null));};
\ No newline at end of file
+var _0x807d=['body','update','describe','html-pdf','eml-format','zip-dir','fast-json-patch','request-promise','moment','bluebird','mustache','util','path','sox','to-csv','ejs','squel','crypto','jsforce','desk.js','querystring','papaparse','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/environment','../../mysqldb','sendStatus','status','json','count','offset','limit','apply','save','destroy','then','error','stack','name','send','index','map','fieldName','type','key','model','query','keys','attributes','fields','length','hasOwnProperty','nolimit','order','sort','pick','filters','where','VIRTUAL','filter','merge','options','SquareDetailsReport','include','findAll','catch','show','params','rawAttributes','intersection','includeAll','find','create'];(function(_0x5e204b,_0x1a67b2){var _0x576446=function(_0x1cf6d6){while(--_0x1cf6d6){_0x5e204b['push'](_0x5e204b['shift']());}};_0x576446(++_0x1a67b2);}(_0x807d,0x133));var _0xd807=function(_0x1c6f7b,_0x3ea04d){_0x1c6f7b=_0x1c6f7b-0x0;var _0x2267a8=_0x807d[_0x1c6f7b];return _0x2267a8;};'use strict';var pdf=require(_0xd807('0x0'));var emlformat=require(_0xd807('0x1'));var rimraf=require('rimraf');var zipdir=require(_0xd807('0x2'));var jsonpatch=require(_0xd807('0x3'));var rp=require(_0xd807('0x4'));var moment=require(_0xd807('0x5'));var BPromise=require(_0xd807('0x6'));var Mustache=require(_0xd807('0x7'));var util=require(_0xd807('0x8'));var path=require(_0xd807('0x9'));var sox=require(_0xd807('0xa'));var csv=require(_0xd807('0xb'));var ejs=require(_0xd807('0xc'));var fs=require('fs');var _=require('lodash');var squel=require(_0xd807('0xd'));var crypto=require(_0xd807('0xe'));var jsforce=require(_0xd807('0xf'));var deskjs=require(_0xd807('0x10'));var toCsv=require(_0xd807('0xb'));var querystring=require(_0xd807('0x11'));var Papa=require(_0xd807('0x12'));var Redis=require('ioredis');var authService=require('../../components/auth/service');var qs=require(_0xd807('0x13'));var as=require(_0xd807('0x14'));var hardwareService=require(_0xd807('0x15'));var logger=require(_0xd807('0x16'))(_0xd807('0x17'));var utils=require('../../config/utils');var config=require(_0xd807('0x18'));var db=require(_0xd807('0x19'))['db'];function respondWithStatusCode(_0x2b88fc,_0x217a1a){_0x217a1a=_0x217a1a||0xcc;return function(_0x24e5a0){if(_0x24e5a0){return _0x2b88fc[_0xd807('0x1a')](_0x217a1a);}return _0x2b88fc['status'](_0x217a1a)['end']();};}function respondWithResult(_0x47bb45,_0x1e94a4){_0x1e94a4=_0x1e94a4||0xc8;return function(_0x35007a){if(_0x35007a){return _0x47bb45[_0xd807('0x1b')](_0x1e94a4)[_0xd807('0x1c')](_0x35007a);}};}function respondWithFilteredResult(_0x1bba8e,_0x4458e2){return function(_0x3c2048){if(_0x3c2048){var _0x5656bd=_0x3c2048[_0xd807('0x1d')],_0x385e5d=_0x4458e2[_0xd807('0x1e')],_0x438d76=_0x4458e2['offset']+_0x4458e2[_0xd807('0x1f')],_0x3a8a77;if(_0x438d76>=_0x5656bd){_0x438d76=_0x5656bd;_0x3a8a77=0xc8;}else{_0x3a8a77=0xce;}_0x1bba8e[_0xd807('0x1b')](_0x3a8a77);return _0x1bba8e['set']('Content-Range',_0x385e5d+'-'+_0x438d76+'/'+_0x5656bd)[_0xd807('0x1c')](_0x3c2048);}return null;};}function patchUpdates(_0x4bc66c){return function(_0x59b4f7){try{jsonpatch[_0xd807('0x20')](_0x59b4f7,_0x4bc66c,!![]);}catch(_0x566237){return BPromise['reject'](_0x566237);}return _0x59b4f7[_0xd807('0x21')]();};}function saveUpdates(_0x463b06,_0x42f860){return function(_0x5702da){if(_0x5702da){return _0x5702da['update'](_0x463b06)['then'](function(_0x70eef7){return _0x70eef7;});}return null;};}function removeEntity(_0x3f9d7d,_0x33f0b0){return function(_0x421123){if(_0x421123){return _0x421123[_0xd807('0x22')]()[_0xd807('0x23')](function(){_0x3f9d7d['status'](0xcc)['end']();});}};}function handleEntityNotFound(_0x539c9b,_0x1dabce){return function(_0x47c84a){if(!_0x47c84a){_0x539c9b[_0xd807('0x1a')](0x194);}return _0x47c84a;};}function handleError(_0x3b48d0,_0x14553b){_0x14553b=_0x14553b||0x1f4;return function(_0x3d711a){logger[_0xd807('0x24')](_0x3d711a[_0xd807('0x25')]);if(_0x3d711a[_0xd807('0x26')]){delete _0x3d711a[_0xd807('0x26')];}_0x3b48d0[_0xd807('0x1b')](_0x14553b)[_0xd807('0x27')](_0x3d711a);};}exports[_0xd807('0x28')]=function(_0x3132c6,_0x4bca9f){var _0x2b5995={},_0xf1efd6={},_0x3442a7={'count':0x0,'rows':[]};var _0x4776cf=_[_0xd807('0x29')](db['SquareDetailsReport']['rawAttributes'],function(_0x182a7d){return{'name':_0x182a7d[_0xd807('0x2a')],'type':_0x182a7d[_0xd807('0x2b')][_0xd807('0x2c')]};});_0xf1efd6[_0xd807('0x2d')]=_[_0xd807('0x29')](_0x4776cf,_0xd807('0x26'));_0xf1efd6[_0xd807('0x2e')]=_[_0xd807('0x2f')](_0x3132c6[_0xd807('0x2e')]);_0xf1efd6['filters']=_['intersection'](_0xf1efd6[_0xd807('0x2d')],_0xf1efd6[_0xd807('0x2e')]);_0x2b5995[_0xd807('0x30')]=_['intersection'](_0xf1efd6[_0xd807('0x2d')],qs['fields'](_0x3132c6[_0xd807('0x2e')][_0xd807('0x31')]));_0x2b5995['attributes']=_0x2b5995[_0xd807('0x30')][_0xd807('0x32')]?_0x2b5995[_0xd807('0x30')]:_0xf1efd6[_0xd807('0x2d')];if(!_0x3132c6[_0xd807('0x2e')][_0xd807('0x33')](_0xd807('0x34'))){_0x2b5995['limit']=qs[_0xd807('0x1f')](_0x3132c6[_0xd807('0x2e')][_0xd807('0x1f')]);_0x2b5995[_0xd807('0x1e')]=qs['offset'](_0x3132c6[_0xd807('0x2e')][_0xd807('0x1e')]);}_0x2b5995[_0xd807('0x35')]=qs[_0xd807('0x36')](_0x3132c6[_0xd807('0x2e')][_0xd807('0x36')]);_0x2b5995['where']=qs['filters'](_[_0xd807('0x37')](_0x3132c6[_0xd807('0x2e')],_0xf1efd6[_0xd807('0x38')]));if(_0x3132c6['query']['filter']){_0x2b5995[_0xd807('0x39')]=_['merge'](_0x2b5995[_0xd807('0x39')],{'$or':_['map'](_0x4776cf,function(_0x4c4eac){if(_0x4c4eac[_0xd807('0x2b')]!==_0xd807('0x3a')){var _0x474d86={};_0x474d86[_0x4c4eac[_0xd807('0x26')]]={'$like':'%'+_0x3132c6[_0xd807('0x2e')][_0xd807('0x3b')]+'%'};return _0x474d86;}})});}_0x2b5995=_[_0xd807('0x3c')]({},_0x2b5995,_0x3132c6[_0xd807('0x3d')]);var _0x3ddbfe={'where':_0x2b5995[_0xd807('0x39')]};return db[_0xd807('0x3e')][_0xd807('0x1d')](_0x3ddbfe)['then'](function(_0x2a3608){_0x3442a7[_0xd807('0x1d')]=_0x2a3608;if(_0x3132c6['query']['includeAll']){_0x2b5995[_0xd807('0x3f')]=[{'all':!![]}];}return db[_0xd807('0x3e')][_0xd807('0x40')](_0x2b5995);})['then'](function(_0x33323d){_0x3442a7['rows']=_0x33323d;return _0x3442a7;})[_0xd807('0x23')](respondWithFilteredResult(_0x4bca9f,_0x2b5995))[_0xd807('0x41')](handleError(_0x4bca9f,null));};exports[_0xd807('0x42')]=function(_0x4acc57,_0x3eff5f){var _0x3e4ea6={'raw':!![],'where':{'id':_0x4acc57[_0xd807('0x43')]['id']}},_0x5da786={};_0x5da786[_0xd807('0x2d')]=_[_0xd807('0x2f')](db[_0xd807('0x3e')][_0xd807('0x44')]);_0x5da786[_0xd807('0x2e')]=_[_0xd807('0x2f')](_0x4acc57['query']);_0x5da786[_0xd807('0x38')]=_[_0xd807('0x45')](_0x5da786[_0xd807('0x2d')],_0x5da786[_0xd807('0x2e')]);_0x3e4ea6[_0xd807('0x30')]=_[_0xd807('0x45')](_0x5da786[_0xd807('0x2d')],qs[_0xd807('0x31')](_0x4acc57[_0xd807('0x2e')][_0xd807('0x31')]));_0x3e4ea6[_0xd807('0x30')]=_0x3e4ea6[_0xd807('0x30')]['length']?_0x3e4ea6[_0xd807('0x30')]:_0x5da786[_0xd807('0x2d')];if(_0x4acc57['query'][_0xd807('0x46')]){_0x3e4ea6[_0xd807('0x3f')]=[{'all':!![]}];}_0x3e4ea6=_[_0xd807('0x3c')]({},_0x3e4ea6,_0x4acc57[_0xd807('0x3d')]);return db[_0xd807('0x3e')][_0xd807('0x47')](_0x3e4ea6)[_0xd807('0x23')](handleEntityNotFound(_0x3eff5f,null))[_0xd807('0x23')](respondWithResult(_0x3eff5f,null))[_0xd807('0x41')](handleError(_0x3eff5f,null));};exports[_0xd807('0x48')]=function(_0x38c68b,_0x33e2a1){return db['SquareDetailsReport'][_0xd807('0x48')](_0x38c68b[_0xd807('0x49')],{})[_0xd807('0x23')](respondWithResult(_0x33e2a1,0xc9))[_0xd807('0x41')](handleError(_0x33e2a1,null));};exports[_0xd807('0x4a')]=function(_0x2109c8,_0x48a1eb){if(_0x2109c8[_0xd807('0x49')]['id']){delete _0x2109c8[_0xd807('0x49')]['id'];}return db[_0xd807('0x3e')]['find']({'where':{'id':_0x2109c8['params']['id']}})[_0xd807('0x23')](handleEntityNotFound(_0x48a1eb,null))['then'](saveUpdates(_0x2109c8[_0xd807('0x49')],null))[_0xd807('0x23')](respondWithResult(_0x48a1eb,null))['catch'](handleError(_0x48a1eb,null));};exports[_0xd807('0x22')]=function(_0x356826,_0x65c3f8){return db[_0xd807('0x3e')][_0xd807('0x47')]({'where':{'id':_0x356826['params']['id']}})[_0xd807('0x23')](handleEntityNotFound(_0x65c3f8,null))[_0xd807('0x23')](removeEntity(_0x65c3f8,null))['catch'](handleError(_0x65c3f8,null));};exports[_0xd807('0x4b')]=function(_0x178cc1,_0x73a6c2){return db[_0xd807('0x3e')][_0xd807('0x4b')]()[_0xd807('0x23')](respondWithResult(_0x73a6c2,null))[_0xd807('0x41')](handleError(_0x73a6c2,null));};
\ No newline at end of file
diff --git a/server/api/squareReportDetail/squareReportDetail.model.js b/server/api/squareReportDetail/squareReportDetail.model.js
index f5fc7d5..47c7236 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 _0x0216=['util','api','moment','bluebird','request-promise','rimraf','../../config/environment','./squareReportDetail.attributes','SquareDetailsReport','lodash'];(function(_0x36bf75,_0x34b46a){var _0x49660f=function(_0x1602d3){while(--_0x1602d3){_0x36bf75['push'](_0x36bf75['shift']());}};_0x49660f(++_0x34b46a);}(_0x0216,0x149));var _0x6021=function(_0x26318c,_0x3a868b){_0x26318c=_0x26318c-0x0;var _0x119932=_0x0216[_0x26318c];return _0x119932;};'use strict';var _=require(_0x6021('0x0'));var util=require(_0x6021('0x1'));var logger=require('../../config/logger')(_0x6021('0x2'));var moment=require(_0x6021('0x3'));var BPromise=require(_0x6021('0x4'));var rp=require(_0x6021('0x5'));var fs=require('fs');var path=require('path');var rimraf=require(_0x6021('0x6'));var config=require(_0x6021('0x7'));var attributes=require(_0x6021('0x8'));module['exports']=function(_0xd9c39,_0x159a2e){return _0xd9c39['define'](_0x6021('0x9'),attributes,{'tableName':'report_square_details','paranoid':![],'indexes':[],'timestamps':!![]});};
\ No newline at end of file
+var _0x4a42=['../../config/environment','./squareReportDetail.attributes','exports','define','SquareDetailsReport','report_square_details','lodash','util','../../config/logger','api','request-promise','path','rimraf'];(function(_0x2f77b6,_0xc0a2f2){var _0x54864b=function(_0x2f0c5b){while(--_0x2f0c5b){_0x2f77b6['push'](_0x2f77b6['shift']());}};_0x54864b(++_0xc0a2f2);}(_0x4a42,0x158));var _0x24a4=function(_0x40107b,_0x2127a0){_0x40107b=_0x40107b-0x0;var _0x45e780=_0x4a42[_0x40107b];return _0x45e780;};'use strict';var _=require(_0x24a4('0x0'));var util=require(_0x24a4('0x1'));var logger=require(_0x24a4('0x2'))(_0x24a4('0x3'));var moment=require('moment');var BPromise=require('bluebird');var rp=require(_0x24a4('0x4'));var fs=require('fs');var path=require(_0x24a4('0x5'));var rimraf=require(_0x24a4('0x6'));var config=require(_0x24a4('0x7'));var attributes=require(_0x24a4('0x8'));module[_0x24a4('0x9')]=function(_0x22c4c2,_0x55f8cb){return _0x22c4c2[_0x24a4('0xa')](_0x24a4('0xb'),attributes,{'tableName':_0x24a4('0xc'),'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 7a13d31..7c9ec0b 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 _0xbfd7=['../../mysqldb','../../config/utils','../../config/logger','../../config/environment','jayson/promise','client','request','info','SquareDetailsReport,\x20%s,\x20%s','SquareDetailsReport,\x20%s,\x20%s,\x20%s','request\x20sent','stringify','error','message','result','CreateSquareDetailsReport','create','body','options','raw','then','debug','catch','lodash','util','moment','randomstring'];(function(_0x122ef9,_0x451d2a){var _0x42fba0=function(_0x17c9d3){while(--_0x17c9d3){_0x122ef9['push'](_0x122ef9['shift']());}};_0x42fba0(++_0x451d2a);}(_0xbfd7,0x1ac));var _0x7bfd=function(_0x254695,_0x551920){_0x254695=_0x254695-0x0;var _0x4ba29d=_0xbfd7[_0x254695];return _0x4ba29d;};'use strict';var _=require(_0x7bfd('0x0'));var util=require(_0x7bfd('0x1'));var moment=require(_0x7bfd('0x2'));var BPromise=require('bluebird');var rs=require(_0x7bfd('0x3'));var fs=require('fs');var Redis=require('ioredis');var db=require(_0x7bfd('0x4'))['db'];var utils=require(_0x7bfd('0x5'));var logger=require(_0x7bfd('0x6'))('rpc');var config=require(_0x7bfd('0x7'));var jayson=require(_0x7bfd('0x8'));var client=jayson[_0x7bfd('0x9')]['http']({'port':0x232a});function respondWithRpcPromise(_0x373065,_0xaa8e0e,_0x1acc0b){return new BPromise(function(_0x3d8aa3,_0x1bc828){return client[_0x7bfd('0xa')](_0x373065,_0x1acc0b)['then'](function(_0x5ea583){logger[_0x7bfd('0xb')](_0x7bfd('0xc'),_0xaa8e0e,'request\x20sent');logger['debug'](_0x7bfd('0xd'),_0xaa8e0e,_0x7bfd('0xe'),JSON[_0x7bfd('0xf')](_0x5ea583));if(_0x5ea583['error']){if(_0x5ea583[_0x7bfd('0x10')]['code']===0x1f4){logger[_0x7bfd('0x10')](_0x7bfd('0xc'),_0xaa8e0e,_0x5ea583['error'][_0x7bfd('0x11')]);return _0x1bc828(_0x5ea583[_0x7bfd('0x10')]['message']);}logger[_0x7bfd('0x10')]('SquareDetailsReport,\x20%s,\x20%s',_0xaa8e0e,_0x5ea583[_0x7bfd('0x10')][_0x7bfd('0x11')]);return _0x3d8aa3(_0x5ea583[_0x7bfd('0x10')][_0x7bfd('0x11')]);}else{logger[_0x7bfd('0xb')](_0x7bfd('0xc'),_0xaa8e0e,_0x7bfd('0xe'));_0x3d8aa3(_0x5ea583[_0x7bfd('0x12')][_0x7bfd('0x11')]);}})['catch'](function(_0x3541a2){logger[_0x7bfd('0x10')](_0x7bfd('0xc'),_0xaa8e0e,_0x3541a2);_0x1bc828(_0x3541a2);});});}exports[_0x7bfd('0x13')]=function(_0x57653f){var _0x39e249=this;return new Promise(function(_0x2f5227,_0xf4cafe){return db['SquareDetailsReport'][_0x7bfd('0x14')](_0x57653f[_0x7bfd('0x15')],{'raw':_0x57653f[_0x7bfd('0x16')]?_0x57653f['options'][_0x7bfd('0x17')]===undefined?!![]:![]:!![]})[_0x7bfd('0x18')](function(_0x1f8254){logger['info'](_0x7bfd('0x13'),_0x57653f);logger[_0x7bfd('0x19')](_0x7bfd('0x13'),_0x57653f,JSON[_0x7bfd('0xf')](_0x1f8254));_0x2f5227(_0x1f8254);})[_0x7bfd('0x1a')](function(_0x52f118){logger[_0x7bfd('0x10')]('CreateSquareDetailsReport',_0x52f118[_0x7bfd('0x11')],_0x57653f);_0xf4cafe(_0x39e249[_0x7bfd('0x10')](0x1f4,_0x52f118[_0x7bfd('0x11')]));});});};
\ No newline at end of file
+var _0x5f09=['result','CreateSquareDetailsReport','create','body','options','catch','lodash','moment','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','client','http','request','then','SquareDetailsReport,\x20%s,\x20%s','request\x20sent','debug','SquareDetailsReport,\x20%s,\x20%s,\x20%s','stringify','error','code','message','info'];(function(_0x2dafbe,_0x5d04de){var _0x58a45a=function(_0x50ac96){while(--_0x50ac96){_0x2dafbe['push'](_0x2dafbe['shift']());}};_0x58a45a(++_0x5d04de);}(_0x5f09,0x145));var _0x95f0=function(_0x3d839a,_0x2f6ff9){_0x3d839a=_0x3d839a-0x0;var _0x136e1a=_0x5f09[_0x3d839a];return _0x136e1a;};'use strict';var _=require(_0x95f0('0x0'));var util=require('util');var moment=require(_0x95f0('0x1'));var BPromise=require('bluebird');var rs=require(_0x95f0('0x2'));var fs=require('fs');var Redis=require(_0x95f0('0x3'));var db=require(_0x95f0('0x4'))['db'];var utils=require(_0x95f0('0x5'));var logger=require(_0x95f0('0x6'))(_0x95f0('0x7'));var config=require(_0x95f0('0x8'));var jayson=require(_0x95f0('0x9'));var client=jayson[_0x95f0('0xa')][_0x95f0('0xb')]({'port':0x232a});function respondWithRpcPromise(_0x4c0258,_0x47df34,_0x13c5f7){return new BPromise(function(_0x46d0a5,_0x305a86){return client[_0x95f0('0xc')](_0x4c0258,_0x13c5f7)[_0x95f0('0xd')](function(_0x3d85fa){logger['info'](_0x95f0('0xe'),_0x47df34,_0x95f0('0xf'));logger[_0x95f0('0x10')](_0x95f0('0x11'),_0x47df34,_0x95f0('0xf'),JSON[_0x95f0('0x12')](_0x3d85fa));if(_0x3d85fa[_0x95f0('0x13')]){if(_0x3d85fa[_0x95f0('0x13')][_0x95f0('0x14')]===0x1f4){logger['error'](_0x95f0('0xe'),_0x47df34,_0x3d85fa[_0x95f0('0x13')][_0x95f0('0x15')]);return _0x305a86(_0x3d85fa['error']['message']);}logger['error'](_0x95f0('0xe'),_0x47df34,_0x3d85fa[_0x95f0('0x13')][_0x95f0('0x15')]);return _0x46d0a5(_0x3d85fa[_0x95f0('0x13')][_0x95f0('0x15')]);}else{logger[_0x95f0('0x16')](_0x95f0('0xe'),_0x47df34,_0x95f0('0xf'));_0x46d0a5(_0x3d85fa[_0x95f0('0x17')][_0x95f0('0x15')]);}})['catch'](function(_0x49aaaa){logger[_0x95f0('0x13')](_0x95f0('0xe'),_0x47df34,_0x49aaaa);_0x305a86(_0x49aaaa);});});}exports[_0x95f0('0x18')]=function(_0x22ac8d){var _0x23a5cb=this;return new Promise(function(_0x243b2e,_0x2d3804){return db['SquareDetailsReport'][_0x95f0('0x19')](_0x22ac8d[_0x95f0('0x1a')],{'raw':_0x22ac8d[_0x95f0('0x1b')]?_0x22ac8d[_0x95f0('0x1b')]['raw']===undefined?!![]:![]:!![]})[_0x95f0('0xd')](function(_0x2472e2){logger[_0x95f0('0x16')]('CreateSquareDetailsReport',_0x22ac8d);logger[_0x95f0('0x10')](_0x95f0('0x18'),_0x22ac8d,JSON[_0x95f0('0x12')](_0x2472e2));_0x243b2e(_0x2472e2);})[_0x95f0('0x1c')](function(_0x40cd3e){logger[_0x95f0('0x13')]('CreateSquareDetailsReport',_0x40cd3e[_0x95f0('0x15')],_0x22ac8d);_0x2d3804(_0x23a5cb['error'](0x1f4,_0x40cd3e[_0x95f0('0x15')]));});});};
\ No newline at end of file
diff --git a/server/api/system/index.js b/server/api/system/index.js
index d96f9f2..9bea039 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 _0x21f8=['get','isAuthenticated','index','killProcess','exports','express','Router','../../components/auth/service','./system.controller'];(function(_0x59ec44,_0xd2147e){var _0x37b047=function(_0x2a12ad){while(--_0x2a12ad){_0x59ec44['push'](_0x59ec44['shift']());}};_0x37b047(++_0xd2147e);}(_0x21f8,0x71));var _0x821f=function(_0x243b59,_0x3f9495){_0x243b59=_0x243b59-0x0;var _0x3e1676=_0x21f8[_0x243b59];return _0x3e1676;};'use strict';var express=require(_0x821f('0x0'));var router=express[_0x821f('0x1')]();var auth=require(_0x821f('0x2'));var controller=require(_0x821f('0x3'));router[_0x821f('0x4')]('/',auth[_0x821f('0x5')](),controller[_0x821f('0x6')]);router['get']('/process/:pid/kill',auth['isAuthenticated'](),controller[_0x821f('0x7')]);module[_0x821f('0x8')]=router;
\ No newline at end of file
+var _0x7e22=['isAuthenticated','index','exports','express','../../components/auth/service','./system.controller','get'];(function(_0x47320b,_0xda39dd){var _0x19ba71=function(_0x2bf322){while(--_0x2bf322){_0x47320b['push'](_0x47320b['shift']());}};_0x19ba71(++_0xda39dd);}(_0x7e22,0x1d8));var _0x27e2=function(_0x1bfc07,_0x52e1df){_0x1bfc07=_0x1bfc07-0x0;var _0x29a97f=_0x7e22[_0x1bfc07];return _0x29a97f;};'use strict';var express=require(_0x27e2('0x0'));var router=express['Router']();var auth=require(_0x27e2('0x1'));var controller=require(_0x27e2('0x2'));router[_0x27e2('0x3')]('/',auth[_0x27e2('0x4')](),controller[_0x27e2('0x5')]);router[_0x27e2('0x3')]('/process/:pid/kill',auth[_0x27e2('0x4')](),controller['killProcess']);module[_0x27e2('0x6')]=router;
\ No newline at end of file
diff --git a/server/api/system/system.controller.js b/server/api/system/system.controller.js
index d757588..3d0cfa9 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 _0xad08=['inspect','index','then','status','catch','json','killProcess','components/import/cm','format','ps\x20-p\x20%s\x20-ww\x20-o\x20args','params','split','indexOf','pid','kill','SIGINT','Process\x20with\x20pid\x20%s\x20killed\x20correctly','systeminformation','exec','api','util','bluebird','error'];(function(_0x590ef3,_0x3b2dd2){var _0x4502be=function(_0x2c8011){while(--_0x2c8011){_0x590ef3['push'](_0x590ef3['shift']());}};_0x4502be(++_0x3b2dd2);}(_0xad08,0x1c6));var _0x8ad0=function(_0x6c993a,_0x5ea3ab){_0x6c993a=_0x6c993a-0x0;var _0x27f547=_0xad08[_0x6c993a];return _0x27f547;};'use strict';var info=require(_0x8ad0('0x0'));var exec=require('child_process')[_0x8ad0('0x1')];var logger=require('../../config/logger')(_0x8ad0('0x2'));var util=require(_0x8ad0('0x3'));var BPromise=require(_0x8ad0('0x4'));var _=require('lodash');function handleError(_0x1c233d,_0xb35f8,_0x15e573){_0xb35f8=_0xb35f8||0x1f4;return function(_0x3d8a2a){logger[_0x8ad0('0x5')]('<%-\x20name\x20%>,\x20%s,\x20%s,\x20%s',_0x15e573,_0xb35f8,util[_0x8ad0('0x6')](_0x3d8a2a,{'showHidden':![],'depth':null}));delete _0x3d8a2a['name'];_0x1c233d['status'](_0xb35f8)['send'](_0x3d8a2a);};}exports[_0x8ad0('0x7')]=function(_0x37796c,_0x46be45){return info['getAllData']()[_0x8ad0('0x8')](function(_0x1bdabb){return _0x46be45[_0x8ad0('0x9')](0xc8)['json'](_0x1bdabb);})[_0x8ad0('0xa')](function(_0x284543){return _0x46be45['status'](0x1f4)[_0x8ad0('0xb')](_0x284543);});};exports[_0x8ad0('0xc')]=function(_0x338ddd,_0x5195a8){var _0x13f38f=[_0x8ad0('0xd')];return new BPromise(function(_0x20356a,_0x92fc6e){return exec(util[_0x8ad0('0xe')](_0x8ad0('0xf'),_0x338ddd[_0x8ad0('0x10')]['pid']),function(_0x43a35b,_0x129de9,_0x2c0000){if(_0x43a35b){return _0x92fc6e(_0x43a35b);}return _0x20356a(_0x129de9);});})['then'](function(_0x45708c){var _0x4b833d=![];var _0x3fe6fb=_0x45708c[_0x8ad0('0x11')](/\n/);for(var _0x33423d=0x0,_0x5a4e0b=_0x13f38f['length'];_0x33423d<_0x5a4e0b,_0x4b833d===![];_0x33423d+=0x1){if(_0x45708c[_0x8ad0('0x12')](_0x13f38f[_0x33423d])>=0x0){_0x4b833d=!![];}}if(!_0x4b833d){throw new Error(util[_0x8ad0('0xe')]('Process\x20with\x20pid\x20%s\x20not\x20found!',_0x338ddd['params'][_0x8ad0('0x13')]));}process[_0x8ad0('0x14')](_0x338ddd[_0x8ad0('0x10')]['pid'],_0x8ad0('0x15'));return _0x5195a8['status'](0xc8)[_0x8ad0('0xb')]({'message':util[_0x8ad0('0xe')](_0x8ad0('0x16'),_0x338ddd[_0x8ad0('0x10')][_0x8ad0('0x13')])});})[_0x8ad0('0xa')](handleError(_0x5195a8,null,_0x8ad0('0xc')));};
\ No newline at end of file
+var _0x8f85=['systeminformation','child_process','../../config/logger','bluebird','error','<%-\x20name\x20%>,\x20%s,\x20%s,\x20%s','inspect','status','send','getAllData','then','catch','json','killProcess','ps\x20-p\x20%s\x20-ww\x20-o\x20args','params','pid','split','length','format','kill','SIGINT','Process\x20with\x20pid\x20%s\x20killed\x20correctly'];(function(_0xd852b3,_0x5f477f){var _0x457b7c=function(_0x4296d8){while(--_0x4296d8){_0xd852b3['push'](_0xd852b3['shift']());}};_0x457b7c(++_0x5f477f);}(_0x8f85,0x1b5));var _0x58f8=function(_0x2641f9,_0x26715f){_0x2641f9=_0x2641f9-0x0;var _0x585741=_0x8f85[_0x2641f9];return _0x585741;};'use strict';var info=require(_0x58f8('0x0'));var exec=require(_0x58f8('0x1'))['exec'];var logger=require(_0x58f8('0x2'))('api');var util=require('util');var BPromise=require(_0x58f8('0x3'));var _=require('lodash');function handleError(_0x1c847e,_0x1d9562,_0x1b8d0e){_0x1d9562=_0x1d9562||0x1f4;return function(_0x3e1299){logger[_0x58f8('0x4')](_0x58f8('0x5'),_0x1b8d0e,_0x1d9562,util[_0x58f8('0x6')](_0x3e1299,{'showHidden':![],'depth':null}));delete _0x3e1299['name'];_0x1c847e[_0x58f8('0x7')](_0x1d9562)[_0x58f8('0x8')](_0x3e1299);};}exports['index']=function(_0x26d730,_0x45d1f8){return info[_0x58f8('0x9')]()[_0x58f8('0xa')](function(_0x4ef018){return _0x45d1f8[_0x58f8('0x7')](0xc8)['json'](_0x4ef018);})[_0x58f8('0xb')](function(_0x3e70a6){return _0x45d1f8[_0x58f8('0x7')](0x1f4)[_0x58f8('0xc')](_0x3e70a6);});};exports[_0x58f8('0xd')]=function(_0xf1f6dd,_0x3de4c1){var _0x449cca=['components/import/cm'];return new BPromise(function(_0x204933,_0x139912){return exec(util['format'](_0x58f8('0xe'),_0xf1f6dd[_0x58f8('0xf')][_0x58f8('0x10')]),function(_0xd7cec,_0x4046e5,_0x1edba6){if(_0xd7cec){return _0x139912(_0xd7cec);}return _0x204933(_0x4046e5);});})['then'](function(_0x28bdcd){var _0x11a2b8=![];var _0x114327=_0x28bdcd[_0x58f8('0x11')](/\n/);for(var _0x40f680=0x0,_0x57a0a4=_0x449cca[_0x58f8('0x12')];_0x40f680<_0x57a0a4,_0x11a2b8===![];_0x40f680+=0x1){if(_0x28bdcd['indexOf'](_0x449cca[_0x40f680])>=0x0){_0x11a2b8=!![];}}if(!_0x11a2b8){throw new Error(util[_0x58f8('0x13')]('Process\x20with\x20pid\x20%s\x20not\x20found!',_0xf1f6dd[_0x58f8('0xf')][_0x58f8('0x10')]));}process[_0x58f8('0x14')](_0xf1f6dd['params'][_0x58f8('0x10')],_0x58f8('0x15'));return _0x3de4c1[_0x58f8('0x7')](0xc8)['json']({'message':util['format'](_0x58f8('0x16'),_0xf1f6dd[_0x58f8('0xf')]['pid'])});})['catch'](handleError(_0x3de4c1,null,'killProcess'));};
\ No newline at end of file
diff --git a/server/api/tag/index.js b/server/api/tag/index.js
index 2b22c3c..649c677 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 _0x4bc3=['connect-timeout','express','../../components/auth/service','../../components/interaction/service','../../config/environment','./tag.controller','get','isAuthenticated','index','/:id','post','create','put','destroy','multer','util'];(function(_0x356834,_0x512789){var _0x53bc04=function(_0x5d4cb1){while(--_0x5d4cb1){_0x356834['push'](_0x356834['shift']());}};_0x53bc04(++_0x512789);}(_0x4bc3,0x16e));var _0x34bc=function(_0x565ed7,_0x398228){_0x565ed7=_0x565ed7-0x0;var _0x183ad7=_0x4bc3[_0x565ed7];return _0x183ad7;};'use strict';var multer=require(_0x34bc('0x0'));var util=require(_0x34bc('0x1'));var path=require('path');var timeout=require(_0x34bc('0x2'));var express=require(_0x34bc('0x3'));var router=express['Router']();var auth=require(_0x34bc('0x4'));var interaction=require(_0x34bc('0x5'));var config=require(_0x34bc('0x6'));var controller=require(_0x34bc('0x7'));router[_0x34bc('0x8')]('/',auth[_0x34bc('0x9')](),controller[_0x34bc('0xa')]);router['get'](_0x34bc('0xb'),auth['isAuthenticated'](),controller['show']);router[_0x34bc('0xc')]('/',auth[_0x34bc('0x9')](),controller[_0x34bc('0xd')]);router[_0x34bc('0xe')](_0x34bc('0xb'),auth[_0x34bc('0x9')](),controller['update']);router['delete'](_0x34bc('0xb'),auth[_0x34bc('0x9')](),controller[_0x34bc('0xf')]);module['exports']=router;
\ No newline at end of file
+var _0x2dae=['put','update','delete','destroy','exports','multer','path','connect-timeout','express','Router','../../components/auth/service','../../config/environment','./tag.controller','get','isAuthenticated','/:id','show','post','create'];(function(_0xfbc9be,_0x3ba158){var _0x3862b6=function(_0x5b84c5){while(--_0x5b84c5){_0xfbc9be['push'](_0xfbc9be['shift']());}};_0x3862b6(++_0x3ba158);}(_0x2dae,0xc3));var _0xe2da=function(_0x3b380d,_0x4bf247){_0x3b380d=_0x3b380d-0x0;var _0x54502b=_0x2dae[_0x3b380d];return _0x54502b;};'use strict';var multer=require(_0xe2da('0x0'));var util=require('util');var path=require(_0xe2da('0x1'));var timeout=require(_0xe2da('0x2'));var express=require(_0xe2da('0x3'));var router=express[_0xe2da('0x4')]();var auth=require(_0xe2da('0x5'));var interaction=require('../../components/interaction/service');var config=require(_0xe2da('0x6'));var controller=require(_0xe2da('0x7'));router[_0xe2da('0x8')]('/',auth[_0xe2da('0x9')](),controller['index']);router[_0xe2da('0x8')](_0xe2da('0xa'),auth[_0xe2da('0x9')](),controller[_0xe2da('0xb')]);router[_0xe2da('0xc')]('/',auth[_0xe2da('0x9')](),controller[_0xe2da('0xd')]);router[_0xe2da('0xe')](_0xe2da('0xa'),auth['isAuthenticated'](),controller[_0xe2da('0xf')]);router[_0xe2da('0x10')](_0xe2da('0xa'),auth[_0xe2da('0x9')](),controller[_0xe2da('0x11')]);module[_0xe2da('0x12')]=router;
\ No newline at end of file
diff --git a/server/api/tag/tag.attributes.js b/server/api/tag/tag.attributes.js
index 9c7ef77..78a7cc7 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 _0xb688=['STRING','name','#0091EA','exports'];(function(_0x19b22f,_0x1af08a){var _0x28f9a7=function(_0x2fdbb0){while(--_0x2fdbb0){_0x19b22f['push'](_0x19b22f['shift']());}};_0x28f9a7(++_0x1af08a);}(_0xb688,0xcf));var _0x8b68=function(_0x61ace2,_0x26fb3e){_0x61ace2=_0x61ace2-0x0;var _0x26c9a7=_0xb688[_0x61ace2];return _0x26c9a7;};'use strict';var Sequelize=require('sequelize');module[_0x8b68('0x0')]={'name':{'type':Sequelize[_0x8b68('0x1')],'unique':_0x8b68('0x2'),'allowNull':![],'validate':{'is':/[A-Za-z0-9._\\+*!-]+/,'notEmpty':!![]}},'color':{'type':Sequelize[_0x8b68('0x1')],'defaultValue':_0x8b68('0x3')},'description':{'type':Sequelize[_0x8b68('0x1')]}};
\ No newline at end of file
+var _0xea28=['exports','STRING','name','#0091EA','sequelize'];(function(_0x25aa75,_0x4a0cc0){var _0x29cd29=function(_0xf8093f){while(--_0xf8093f){_0x25aa75['push'](_0x25aa75['shift']());}};_0x29cd29(++_0x4a0cc0);}(_0xea28,0x13a));var _0x8ea2=function(_0x4040af,_0x45c288){_0x4040af=_0x4040af-0x0;var _0x4536b6=_0xea28[_0x4040af];return _0x4536b6;};'use strict';var Sequelize=require(_0x8ea2('0x0'));module[_0x8ea2('0x1')]={'name':{'type':Sequelize[_0x8ea2('0x2')],'unique':_0x8ea2('0x3'),'allowNull':![],'validate':{'is':/[A-Za-z0-9._\\+*!-]+/,'notEmpty':!![]}},'color':{'type':Sequelize[_0x8ea2('0x2')],'defaultValue':_0x8ea2('0x4')},'description':{'type':Sequelize[_0x8ea2('0x2')]}};
\ No newline at end of file
diff --git a/server/api/tag/tag.controller.js b/server/api/tag/tag.controller.js
index 57a3330..6ee195f 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 _0xdf4e=['zip-dir','moment','bluebird','mustache','util','path','sox','to-csv','squel','crypto','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/utils','../../mysqldb','end','status','json','count','offset','Content-Range','apply','reject','update','destroy','Tags','UserProfileResource','then','sendStatus','error','send','index','Tag','rawAttributes','fieldName','type','key','model','map','name','query','intersection','attributes','hasOwnProperty','nolimit','limit','order','where','filters','pick','filter','merge','VIRTUAL','options','include','findAll','catch','show','keys','fields','length','includeAll','find','create','body','user','get','Unable\x20to\x20retrieve\x20the\x20current\x20user','role','userProfileId','autoAssociation','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','params','html-pdf','eml-format','rimraf'];(function(_0x3d32f0,_0x2c77b7){var _0x5b4650=function(_0x1f633e){while(--_0x1f633e){_0x3d32f0['push'](_0x3d32f0['shift']());}};_0x5b4650(++_0x2c77b7);}(_0xdf4e,0x1e9));var _0xedf4=function(_0x5bb4e8,_0x44b756){_0x5bb4e8=_0x5bb4e8-0x0;var _0x2a86f2=_0xdf4e[_0x5bb4e8];return _0x2a86f2;};'use strict';var pdf=require(_0xedf4('0x0'));var emlformat=require(_0xedf4('0x1'));var rimraf=require(_0xedf4('0x2'));var zipdir=require(_0xedf4('0x3'));var jsonpatch=require('fast-json-patch');var rp=require('request-promise');var moment=require(_0xedf4('0x4'));var BPromise=require(_0xedf4('0x5'));var Mustache=require(_0xedf4('0x6'));var util=require(_0xedf4('0x7'));var path=require(_0xedf4('0x8'));var sox=require(_0xedf4('0x9'));var csv=require(_0xedf4('0xa'));var ejs=require('ejs');var fs=require('fs');var _=require('lodash');var squel=require(_0xedf4('0xb'));var crypto=require(_0xedf4('0xc'));var jsforce=require('jsforce');var deskjs=require('desk.js');var toCsv=require(_0xedf4('0xa'));var querystring=require(_0xedf4('0xd'));var Papa=require(_0xedf4('0xe'));var Redis=require(_0xedf4('0xf'));var authService=require(_0xedf4('0x10'));var qs=require(_0xedf4('0x11'));var as=require(_0xedf4('0x12'));var hardwareService=require(_0xedf4('0x13'));var logger=require(_0xedf4('0x14'))(_0xedf4('0x15'));var utils=require(_0xedf4('0x16'));var config=require('../../config/environment');var db=require(_0xedf4('0x17'))['db'];function respondWithStatusCode(_0x755c0f,_0x393400){_0x393400=_0x393400||0xcc;return function(_0x34fb23){if(_0x34fb23){return _0x755c0f['sendStatus'](_0x393400);}return _0x755c0f['status'](_0x393400)[_0xedf4('0x18')]();};}function respondWithResult(_0x1d0aae,_0x184a17){_0x184a17=_0x184a17||0xc8;return function(_0x2ff544){if(_0x2ff544){return _0x1d0aae[_0xedf4('0x19')](_0x184a17)[_0xedf4('0x1a')](_0x2ff544);}};}function respondWithFilteredResult(_0x52865f,_0x3ec28c){return function(_0x4ac0a5){if(_0x4ac0a5){var _0xeb8771=_0x4ac0a5[_0xedf4('0x1b')],_0x47fc98=_0x3ec28c[_0xedf4('0x1c')],_0x3d12f6=_0x3ec28c['offset']+_0x3ec28c['limit'],_0x1ef266;if(_0x3d12f6>=_0xeb8771){_0x3d12f6=_0xeb8771;_0x1ef266=0xc8;}else{_0x1ef266=0xce;}_0x52865f['status'](_0x1ef266);return _0x52865f['set'](_0xedf4('0x1d'),_0x47fc98+'-'+_0x3d12f6+'/'+_0xeb8771)[_0xedf4('0x1a')](_0x4ac0a5);}return null;};}function patchUpdates(_0x3578c5){return function(_0x331739){try{jsonpatch[_0xedf4('0x1e')](_0x331739,_0x3578c5,!![]);}catch(_0x3bb580){return BPromise[_0xedf4('0x1f')](_0x3bb580);}return _0x331739['save']();};}function saveUpdates(_0x1e3b71,_0x51d63d){return function(_0x89924b){if(_0x89924b){return _0x89924b[_0xedf4('0x20')](_0x1e3b71)['then'](function(_0x28dcb6){return _0x28dcb6;});}return null;};}function removeEntity(_0x13ddba,_0x15483d){return function(_0x2af04c){if(_0x2af04c){return _0x2af04c[_0xedf4('0x21')]()['then'](function(){var _0x1094b8=_0x2af04c['get']({'plain':!![]});var _0x4ccea7=_0xedf4('0x22');return db[_0xedf4('0x23')][_0xedf4('0x21')]({'where':{'type':_0x4ccea7,'resourceId':_0x1094b8['id']}})[_0xedf4('0x24')](function(){return _0x2af04c;});})[_0xedf4('0x24')](function(){_0x13ddba['status'](0xcc)['end']();});}};}function handleEntityNotFound(_0x3517e5,_0xa10fd3){return function(_0x195518){if(!_0x195518){_0x3517e5[_0xedf4('0x25')](0x194);}return _0x195518;};}function handleError(_0x1bde03,_0x6f40d2){_0x6f40d2=_0x6f40d2||0x1f4;return function(_0xa7bbae){logger[_0xedf4('0x26')](_0xa7bbae['stack']);if(_0xa7bbae['name']){delete _0xa7bbae['name'];}_0x1bde03[_0xedf4('0x19')](_0x6f40d2)[_0xedf4('0x27')](_0xa7bbae);};}exports[_0xedf4('0x28')]=function(_0x4990fc,_0x10b309){var _0x3f003e={},_0x58795b={},_0x292b2b={'count':0x0,'rows':[]};var _0x5c6e96=_['map'](db[_0xedf4('0x29')][_0xedf4('0x2a')],function(_0x44872e){return{'name':_0x44872e[_0xedf4('0x2b')],'type':_0x44872e[_0xedf4('0x2c')][_0xedf4('0x2d')]};});_0x58795b[_0xedf4('0x2e')]=_[_0xedf4('0x2f')](_0x5c6e96,_0xedf4('0x30'));_0x58795b[_0xedf4('0x31')]=_['keys'](_0x4990fc['query']);_0x58795b['filters']=_[_0xedf4('0x32')](_0x58795b['model'],_0x58795b[_0xedf4('0x31')]);_0x3f003e['attributes']=_['intersection'](_0x58795b['model'],qs['fields'](_0x4990fc[_0xedf4('0x31')]['fields']));_0x3f003e[_0xedf4('0x33')]=_0x3f003e[_0xedf4('0x33')]['length']?_0x3f003e[_0xedf4('0x33')]:_0x58795b[_0xedf4('0x2e')];if(!_0x4990fc[_0xedf4('0x31')][_0xedf4('0x34')](_0xedf4('0x35'))){_0x3f003e[_0xedf4('0x36')]=qs[_0xedf4('0x36')](_0x4990fc[_0xedf4('0x31')][_0xedf4('0x36')]);_0x3f003e[_0xedf4('0x1c')]=qs[_0xedf4('0x1c')](_0x4990fc[_0xedf4('0x31')]['offset']);}_0x3f003e[_0xedf4('0x37')]=qs['sort'](_0x4990fc[_0xedf4('0x31')]['sort']);_0x3f003e[_0xedf4('0x38')]=qs[_0xedf4('0x39')](_[_0xedf4('0x3a')](_0x4990fc['query'],_0x58795b[_0xedf4('0x39')]));if(_0x4990fc[_0xedf4('0x31')][_0xedf4('0x3b')]){_0x3f003e[_0xedf4('0x38')]=_[_0xedf4('0x3c')](_0x3f003e[_0xedf4('0x38')],{'$or':_[_0xedf4('0x2f')](_0x5c6e96,function(_0x3760ca){if(_0x3760ca[_0xedf4('0x2c')]!==_0xedf4('0x3d')){var _0x4769a1={};_0x4769a1[_0x3760ca[_0xedf4('0x30')]]={'$like':'%'+_0x4990fc['query']['filter']+'%'};return _0x4769a1;}})});}_0x3f003e=_[_0xedf4('0x3c')]({},_0x3f003e,_0x4990fc[_0xedf4('0x3e')]);var _0x20927b={'where':_0x3f003e[_0xedf4('0x38')]};return db[_0xedf4('0x29')]['count'](_0x20927b)[_0xedf4('0x24')](function(_0x54b6dc){_0x292b2b['count']=_0x54b6dc;if(_0x4990fc[_0xedf4('0x31')]['includeAll']){_0x3f003e[_0xedf4('0x3f')]=[{'all':!![]}];}return db[_0xedf4('0x29')][_0xedf4('0x40')](_0x3f003e);})['then'](function(_0x215b59){_0x292b2b['rows']=_0x215b59;return _0x292b2b;})[_0xedf4('0x24')](respondWithFilteredResult(_0x10b309,_0x3f003e))[_0xedf4('0x41')](handleError(_0x10b309,null));};exports[_0xedf4('0x42')]=function(_0x843303,_0x566e07){var _0x542526={'raw':!![],'where':{'id':_0x843303['params']['id']}},_0x15ee41={};_0x15ee41[_0xedf4('0x2e')]=_['keys'](db[_0xedf4('0x29')][_0xedf4('0x2a')]);_0x15ee41['query']=_[_0xedf4('0x43')](_0x843303[_0xedf4('0x31')]);_0x15ee41[_0xedf4('0x39')]=_[_0xedf4('0x32')](_0x15ee41['model'],_0x15ee41['query']);_0x542526['attributes']=_['intersection'](_0x15ee41['model'],qs[_0xedf4('0x44')](_0x843303[_0xedf4('0x31')][_0xedf4('0x44')]));_0x542526[_0xedf4('0x33')]=_0x542526[_0xedf4('0x33')][_0xedf4('0x45')]?_0x542526[_0xedf4('0x33')]:_0x15ee41[_0xedf4('0x2e')];if(_0x843303[_0xedf4('0x31')][_0xedf4('0x46')]){_0x542526[_0xedf4('0x3f')]=[{'all':!![]}];}_0x542526=_[_0xedf4('0x3c')]({},_0x542526,_0x843303['options']);return db['Tag'][_0xedf4('0x47')](_0x542526)[_0xedf4('0x24')](handleEntityNotFound(_0x566e07,null))[_0xedf4('0x24')](respondWithResult(_0x566e07,null))[_0xedf4('0x41')](handleError(_0x566e07,null));};exports[_0xedf4('0x48')]=function(_0x1087e2,_0x5aa605){return db[_0xedf4('0x29')][_0xedf4('0x48')](_0x1087e2[_0xedf4('0x49')],{})[_0xedf4('0x24')](function(_0x2e47b8){var _0x1a9a0f=_0x1087e2[_0xedf4('0x4a')][_0xedf4('0x4b')]({'plain':!![]});if(!_0x1a9a0f)throw new Error(_0xedf4('0x4c'));if(_0x1a9a0f[_0xedf4('0x4d')]==='user'){var _0x42afff=_0x2e47b8[_0xedf4('0x4b')]({'plain':!![]});var _0x97ba30=_0xedf4('0x22');return db['UserProfileSection']['find']({'where':{'name':_0x97ba30,'userProfileId':_0x1a9a0f[_0xedf4('0x4e')]},'raw':!![]})[_0xedf4('0x24')](function(_0x4162b2){if(_0x4162b2&&_0x4162b2[_0xedf4('0x4f')]===0x0){return db[_0xedf4('0x23')][_0xedf4('0x48')]({'name':_0x42afff[_0xedf4('0x30')],'resourceId':_0x42afff['id'],'type':_0x4162b2[_0xedf4('0x30')],'sectionId':_0x4162b2['id']},{})[_0xedf4('0x24')](function(){return _0x2e47b8;});}else{return _0x2e47b8;}})[_0xedf4('0x41')](function(_0x2f9f19){logger[_0xedf4('0x26')](_0xedf4('0x50'),_0x2f9f19);throw _0x2f9f19;});}return _0x2e47b8;})['then'](respondWithResult(_0x5aa605,0xc9))['catch'](handleError(_0x5aa605,null));};exports[_0xedf4('0x20')]=function(_0x4284ab,_0x175286){if(_0x4284ab[_0xedf4('0x49')]['id']){delete _0x4284ab[_0xedf4('0x49')]['id'];}return db['Tag'][_0xedf4('0x47')]({'where':{'id':_0x4284ab[_0xedf4('0x51')]['id']}})['then'](handleEntityNotFound(_0x175286,null))[_0xedf4('0x24')](saveUpdates(_0x4284ab['body'],null))[_0xedf4('0x24')](respondWithResult(_0x175286,null))['catch'](handleError(_0x175286,null));};exports[_0xedf4('0x21')]=function(_0x2753f4,_0x691e04){return db[_0xedf4('0x29')]['find']({'where':{'id':_0x2753f4[_0xedf4('0x51')]['id']}})[_0xedf4('0x24')](handleEntityNotFound(_0x691e04,null))['then'](removeEntity(_0x691e04,null))['catch'](handleError(_0x691e04,null));};
\ No newline at end of file
+var _0x9b86=['apply','save','update','destroy','then','Tags','error','name','send','index','map','Tag','type','key','model','query','filters','intersection','attributes','fields','length','order','sort','filter','where','merge','VIRTUAL','options','count','include','rows','catch','params','keys','includeAll','find','create','body','get','Unable\x20to\x20retrieve\x20the\x20current\x20user','role','UserProfileSection','autoAssociation','UserProfileResource','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','html-pdf','zip-dir','fast-json-patch','request-promise','bluebird','sox','to-csv','lodash','squel','crypto','desk.js','querystring','../../components/auth/service','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/environment','../../mysqldb','sendStatus','status','end','json','offset','limit','set','Content-Range'];(function(_0x503162,_0x25ea26){var _0x23495d=function(_0x16193b){while(--_0x16193b){_0x503162['push'](_0x503162['shift']());}};_0x23495d(++_0x25ea26);}(_0x9b86,0x1dd));var _0x69b8=function(_0x1d9500,_0x515539){_0x1d9500=_0x1d9500-0x0;var _0x1f5190=_0x9b86[_0x1d9500];return _0x1f5190;};'use strict';var pdf=require(_0x69b8('0x0'));var emlformat=require('eml-format');var rimraf=require('rimraf');var zipdir=require(_0x69b8('0x1'));var jsonpatch=require(_0x69b8('0x2'));var rp=require(_0x69b8('0x3'));var moment=require('moment');var BPromise=require(_0x69b8('0x4'));var Mustache=require('mustache');var util=require('util');var path=require('path');var sox=require(_0x69b8('0x5'));var csv=require(_0x69b8('0x6'));var ejs=require('ejs');var fs=require('fs');var _=require(_0x69b8('0x7'));var squel=require(_0x69b8('0x8'));var crypto=require(_0x69b8('0x9'));var jsforce=require('jsforce');var deskjs=require(_0x69b8('0xa'));var toCsv=require(_0x69b8('0x6'));var querystring=require(_0x69b8('0xb'));var Papa=require('papaparse');var Redis=require('ioredis');var authService=require(_0x69b8('0xc'));var qs=require('../../components/parsers/qs');var as=require(_0x69b8('0xd'));var hardwareService=require(_0x69b8('0xe'));var logger=require(_0x69b8('0xf'))(_0x69b8('0x10'));var utils=require('../../config/utils');var config=require(_0x69b8('0x11'));var db=require(_0x69b8('0x12'))['db'];function respondWithStatusCode(_0x27f88d,_0x54aa3c){_0x54aa3c=_0x54aa3c||0xcc;return function(_0x4fbc61){if(_0x4fbc61){return _0x27f88d[_0x69b8('0x13')](_0x54aa3c);}return _0x27f88d[_0x69b8('0x14')](_0x54aa3c)[_0x69b8('0x15')]();};}function respondWithResult(_0x2ae538,_0x4c1e21){_0x4c1e21=_0x4c1e21||0xc8;return function(_0x401e35){if(_0x401e35){return _0x2ae538[_0x69b8('0x14')](_0x4c1e21)[_0x69b8('0x16')](_0x401e35);}};}function respondWithFilteredResult(_0x2ee253,_0xe2a636){return function(_0x2b6c06){if(_0x2b6c06){var _0x1e400b=_0x2b6c06['count'],_0x189630=_0xe2a636['offset'],_0x4b54af=_0xe2a636[_0x69b8('0x17')]+_0xe2a636[_0x69b8('0x18')],_0x4f0426;if(_0x4b54af>=_0x1e400b){_0x4b54af=_0x1e400b;_0x4f0426=0xc8;}else{_0x4f0426=0xce;}_0x2ee253['status'](_0x4f0426);return _0x2ee253[_0x69b8('0x19')](_0x69b8('0x1a'),_0x189630+'-'+_0x4b54af+'/'+_0x1e400b)[_0x69b8('0x16')](_0x2b6c06);}return null;};}function patchUpdates(_0x3efd6d){return function(_0x181b51){try{jsonpatch[_0x69b8('0x1b')](_0x181b51,_0x3efd6d,!![]);}catch(_0x1045ff){return BPromise['reject'](_0x1045ff);}return _0x181b51[_0x69b8('0x1c')]();};}function saveUpdates(_0x5c31e0,_0x392dfc){return function(_0x29274f){if(_0x29274f){return _0x29274f[_0x69b8('0x1d')](_0x5c31e0)['then'](function(_0x5c636f){return _0x5c636f;});}return null;};}function removeEntity(_0xad24f1,_0x100fa0){return function(_0x24c4b1){if(_0x24c4b1){return _0x24c4b1[_0x69b8('0x1e')]()[_0x69b8('0x1f')](function(){var _0x9fd824=_0x24c4b1['get']({'plain':!![]});var _0x4c4dfa=_0x69b8('0x20');return db['UserProfileResource'][_0x69b8('0x1e')]({'where':{'type':_0x4c4dfa,'resourceId':_0x9fd824['id']}})[_0x69b8('0x1f')](function(){return _0x24c4b1;});})['then'](function(){_0xad24f1[_0x69b8('0x14')](0xcc)['end']();});}};}function handleEntityNotFound(_0x5244ad,_0x90b18d){return function(_0x2941ab){if(!_0x2941ab){_0x5244ad['sendStatus'](0x194);}return _0x2941ab;};}function handleError(_0x4ce715,_0x4ea214){_0x4ea214=_0x4ea214||0x1f4;return function(_0x9ea1f2){logger[_0x69b8('0x21')](_0x9ea1f2['stack']);if(_0x9ea1f2[_0x69b8('0x22')]){delete _0x9ea1f2[_0x69b8('0x22')];}_0x4ce715[_0x69b8('0x14')](_0x4ea214)[_0x69b8('0x23')](_0x9ea1f2);};}exports[_0x69b8('0x24')]=function(_0x4083a7,_0x5b3e03){var _0x32638e={},_0x17d608={},_0x53f64a={'count':0x0,'rows':[]};var _0xe6aac0=_[_0x69b8('0x25')](db[_0x69b8('0x26')]['rawAttributes'],function(_0x47707e){return{'name':_0x47707e['fieldName'],'type':_0x47707e[_0x69b8('0x27')][_0x69b8('0x28')]};});_0x17d608[_0x69b8('0x29')]=_[_0x69b8('0x25')](_0xe6aac0,'name');_0x17d608[_0x69b8('0x2a')]=_['keys'](_0x4083a7['query']);_0x17d608[_0x69b8('0x2b')]=_[_0x69b8('0x2c')](_0x17d608[_0x69b8('0x29')],_0x17d608[_0x69b8('0x2a')]);_0x32638e[_0x69b8('0x2d')]=_[_0x69b8('0x2c')](_0x17d608[_0x69b8('0x29')],qs[_0x69b8('0x2e')](_0x4083a7['query'][_0x69b8('0x2e')]));_0x32638e[_0x69b8('0x2d')]=_0x32638e['attributes'][_0x69b8('0x2f')]?_0x32638e[_0x69b8('0x2d')]:_0x17d608[_0x69b8('0x29')];if(!_0x4083a7[_0x69b8('0x2a')]['hasOwnProperty']('nolimit')){_0x32638e[_0x69b8('0x18')]=qs[_0x69b8('0x18')](_0x4083a7['query']['limit']);_0x32638e[_0x69b8('0x17')]=qs[_0x69b8('0x17')](_0x4083a7['query'][_0x69b8('0x17')]);}_0x32638e[_0x69b8('0x30')]=qs[_0x69b8('0x31')](_0x4083a7[_0x69b8('0x2a')][_0x69b8('0x31')]);_0x32638e['where']=qs['filters'](_['pick'](_0x4083a7[_0x69b8('0x2a')],_0x17d608[_0x69b8('0x2b')]));if(_0x4083a7[_0x69b8('0x2a')][_0x69b8('0x32')]){_0x32638e[_0x69b8('0x33')]=_[_0x69b8('0x34')](_0x32638e[_0x69b8('0x33')],{'$or':_['map'](_0xe6aac0,function(_0xe5ff7d){if(_0xe5ff7d[_0x69b8('0x27')]!==_0x69b8('0x35')){var _0x1c1146={};_0x1c1146[_0xe5ff7d[_0x69b8('0x22')]]={'$like':'%'+_0x4083a7[_0x69b8('0x2a')][_0x69b8('0x32')]+'%'};return _0x1c1146;}})});}_0x32638e=_['merge']({},_0x32638e,_0x4083a7[_0x69b8('0x36')]);var _0x3d9ca4={'where':_0x32638e['where']};return db[_0x69b8('0x26')][_0x69b8('0x37')](_0x3d9ca4)[_0x69b8('0x1f')](function(_0x87209b){_0x53f64a[_0x69b8('0x37')]=_0x87209b;if(_0x4083a7[_0x69b8('0x2a')]['includeAll']){_0x32638e[_0x69b8('0x38')]=[{'all':!![]}];}return db[_0x69b8('0x26')]['findAll'](_0x32638e);})[_0x69b8('0x1f')](function(_0x568e77){_0x53f64a[_0x69b8('0x39')]=_0x568e77;return _0x53f64a;})['then'](respondWithFilteredResult(_0x5b3e03,_0x32638e))[_0x69b8('0x3a')](handleError(_0x5b3e03,null));};exports['show']=function(_0x3eed49,_0x3ccb02){var _0x3e28a0={'raw':!![],'where':{'id':_0x3eed49[_0x69b8('0x3b')]['id']}},_0xf25959={};_0xf25959['model']=_['keys'](db[_0x69b8('0x26')]['rawAttributes']);_0xf25959[_0x69b8('0x2a')]=_[_0x69b8('0x3c')](_0x3eed49[_0x69b8('0x2a')]);_0xf25959[_0x69b8('0x2b')]=_['intersection'](_0xf25959[_0x69b8('0x29')],_0xf25959[_0x69b8('0x2a')]);_0x3e28a0[_0x69b8('0x2d')]=_[_0x69b8('0x2c')](_0xf25959[_0x69b8('0x29')],qs[_0x69b8('0x2e')](_0x3eed49[_0x69b8('0x2a')][_0x69b8('0x2e')]));_0x3e28a0[_0x69b8('0x2d')]=_0x3e28a0[_0x69b8('0x2d')][_0x69b8('0x2f')]?_0x3e28a0[_0x69b8('0x2d')]:_0xf25959[_0x69b8('0x29')];if(_0x3eed49[_0x69b8('0x2a')][_0x69b8('0x3d')]){_0x3e28a0['include']=[{'all':!![]}];}_0x3e28a0=_[_0x69b8('0x34')]({},_0x3e28a0,_0x3eed49[_0x69b8('0x36')]);return db[_0x69b8('0x26')][_0x69b8('0x3e')](_0x3e28a0)[_0x69b8('0x1f')](handleEntityNotFound(_0x3ccb02,null))[_0x69b8('0x1f')](respondWithResult(_0x3ccb02,null))[_0x69b8('0x3a')](handleError(_0x3ccb02,null));};exports[_0x69b8('0x3f')]=function(_0x194b51,_0x13b956){return db[_0x69b8('0x26')][_0x69b8('0x3f')](_0x194b51[_0x69b8('0x40')],{})[_0x69b8('0x1f')](function(_0xd76e4f){var _0x460b60=_0x194b51['user'][_0x69b8('0x41')]({'plain':!![]});if(!_0x460b60)throw new Error(_0x69b8('0x42'));if(_0x460b60[_0x69b8('0x43')]==='user'){var _0x1cd8b2=_0xd76e4f['get']({'plain':!![]});var _0x1e8859='Tags';return db[_0x69b8('0x44')][_0x69b8('0x3e')]({'where':{'name':_0x1e8859,'userProfileId':_0x460b60['userProfileId']},'raw':!![]})[_0x69b8('0x1f')](function(_0x57e2ee){if(_0x57e2ee&&_0x57e2ee[_0x69b8('0x45')]===0x0){return db[_0x69b8('0x46')][_0x69b8('0x3f')]({'name':_0x1cd8b2[_0x69b8('0x22')],'resourceId':_0x1cd8b2['id'],'type':_0x57e2ee[_0x69b8('0x22')],'sectionId':_0x57e2ee['id']},{})[_0x69b8('0x1f')](function(){return _0xd76e4f;});}else{return _0xd76e4f;}})[_0x69b8('0x3a')](function(_0x4573a8){logger[_0x69b8('0x21')](_0x69b8('0x47'),_0x4573a8);throw _0x4573a8;});}return _0xd76e4f;})['then'](respondWithResult(_0x13b956,0xc9))[_0x69b8('0x3a')](handleError(_0x13b956,null));};exports[_0x69b8('0x1d')]=function(_0xeed320,_0x5eb7d7){if(_0xeed320[_0x69b8('0x40')]['id']){delete _0xeed320[_0x69b8('0x40')]['id'];}return db[_0x69b8('0x26')][_0x69b8('0x3e')]({'where':{'id':_0xeed320['params']['id']}})[_0x69b8('0x1f')](handleEntityNotFound(_0x5eb7d7,null))[_0x69b8('0x1f')](saveUpdates(_0xeed320[_0x69b8('0x40')],null))[_0x69b8('0x1f')](respondWithResult(_0x5eb7d7,null))[_0x69b8('0x3a')](handleError(_0x5eb7d7,null));};exports[_0x69b8('0x1e')]=function(_0x40919e,_0x2ae2fb){return db[_0x69b8('0x26')][_0x69b8('0x3e')]({'where':{'id':_0x40919e[_0x69b8('0x3b')]['id']}})[_0x69b8('0x1f')](handleEntityNotFound(_0x2ae2fb,null))['then'](removeEntity(_0x2ae2fb,null))[_0x69b8('0x3a')](handleError(_0x2ae2fb,null));};
\ No newline at end of file
diff --git a/server/api/tag/tag.model.js b/server/api/tag/tag.model.js
index 0ae5f17..9b43e42 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 _0x9672=['api','moment','bluebird','request-promise','rimraf','../../config/environment','./tag.attributes','define','Tag','tools_tags','lodash','util'];(function(_0x4fcf41,_0x979bd7){var _0x5ebe15=function(_0x13e308){while(--_0x13e308){_0x4fcf41['push'](_0x4fcf41['shift']());}};_0x5ebe15(++_0x979bd7);}(_0x9672,0xee));var _0x2967=function(_0x5b3e2f,_0x530f11){_0x5b3e2f=_0x5b3e2f-0x0;var _0x1d1e8f=_0x9672[_0x5b3e2f];return _0x1d1e8f;};'use strict';var _=require(_0x2967('0x0'));var util=require(_0x2967('0x1'));var logger=require('../../config/logger')(_0x2967('0x2'));var moment=require(_0x2967('0x3'));var BPromise=require(_0x2967('0x4'));var rp=require(_0x2967('0x5'));var fs=require('fs');var path=require('path');var rimraf=require(_0x2967('0x6'));var config=require(_0x2967('0x7'));var attributes=require(_0x2967('0x8'));module['exports']=function(_0x4baad7,_0x24424d){return _0x4baad7[_0x2967('0x9')](_0x2967('0xa'),attributes,{'tableName':_0x2967('0xb'),'paranoid':![],'indexes':[],'timestamps':!![]});};
\ No newline at end of file
+var _0x8dd1=['../../config/environment','exports','define','Tag','tools_tags','lodash','util','../../config/logger','moment','request-promise','path','rimraf'];(function(_0x3381ec,_0x4d6e65){var _0x51b797=function(_0x583ea5){while(--_0x583ea5){_0x3381ec['push'](_0x3381ec['shift']());}};_0x51b797(++_0x4d6e65);}(_0x8dd1,0x1e5));var _0x18dd=function(_0x2d43b4,_0xa4ee8f){_0x2d43b4=_0x2d43b4-0x0;var _0x3a387c=_0x8dd1[_0x2d43b4];return _0x3a387c;};'use strict';var _=require(_0x18dd('0x0'));var util=require(_0x18dd('0x1'));var logger=require(_0x18dd('0x2'))('api');var moment=require(_0x18dd('0x3'));var BPromise=require('bluebird');var rp=require(_0x18dd('0x4'));var fs=require('fs');var path=require(_0x18dd('0x5'));var rimraf=require(_0x18dd('0x6'));var config=require(_0x18dd('0x7'));var attributes=require('./tag.attributes');module[_0x18dd('0x8')]=function(_0x2cb51e,_0x43c5b5){return _0x2cb51e[_0x18dd('0x9')](_0x18dd('0xa'),attributes,{'tableName':_0x18dd('0xb'),'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 fbe14f1..fdb8d99 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 _0x8ce3=['randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','client','http','request','Tag,\x20%s,\x20%s','request\x20sent','debug','Tag,\x20%s,\x20%s,\x20%s','stringify','error','code','message','result','lodash','util','bluebird'];(function(_0x4399d8,_0x43258d){var _0x1a08cf=function(_0x1ecae7){while(--_0x1ecae7){_0x4399d8['push'](_0x4399d8['shift']());}};_0x1a08cf(++_0x43258d);}(_0x8ce3,0xc3));var _0x38ce=function(_0x587ac3,_0x2cf4be){_0x587ac3=_0x587ac3-0x0;var _0x4364f3=_0x8ce3[_0x587ac3];return _0x4364f3;};'use strict';var _=require(_0x38ce('0x0'));var util=require(_0x38ce('0x1'));var moment=require('moment');var BPromise=require(_0x38ce('0x2'));var rs=require(_0x38ce('0x3'));var fs=require('fs');var Redis=require(_0x38ce('0x4'));var db=require(_0x38ce('0x5'))['db'];var utils=require(_0x38ce('0x6'));var logger=require(_0x38ce('0x7'))(_0x38ce('0x8'));var config=require(_0x38ce('0x9'));var jayson=require('jayson/promise');var client=jayson[_0x38ce('0xa')][_0x38ce('0xb')]({'port':0x232a});function respondWithRpcPromise(_0x58074c,_0x262b13,_0xbe7332){return new BPromise(function(_0x3f8011,_0x482955){return client[_0x38ce('0xc')](_0x58074c,_0xbe7332)['then'](function(_0x725d27){logger['info'](_0x38ce('0xd'),_0x262b13,_0x38ce('0xe'));logger[_0x38ce('0xf')](_0x38ce('0x10'),_0x262b13,_0x38ce('0xe'),JSON[_0x38ce('0x11')](_0x725d27));if(_0x725d27[_0x38ce('0x12')]){if(_0x725d27[_0x38ce('0x12')][_0x38ce('0x13')]===0x1f4){logger[_0x38ce('0x12')](_0x38ce('0xd'),_0x262b13,_0x725d27[_0x38ce('0x12')][_0x38ce('0x14')]);return _0x482955(_0x725d27[_0x38ce('0x12')][_0x38ce('0x14')]);}logger[_0x38ce('0x12')]('Tag,\x20%s,\x20%s',_0x262b13,_0x725d27['error'][_0x38ce('0x14')]);return _0x3f8011(_0x725d27[_0x38ce('0x12')][_0x38ce('0x14')]);}else{logger['info'](_0x38ce('0xd'),_0x262b13,'request\x20sent');_0x3f8011(_0x725d27[_0x38ce('0x15')][_0x38ce('0x14')]);}})['catch'](function(_0x5fc115){logger[_0x38ce('0x12')](_0x38ce('0xd'),_0x262b13,_0x5fc115);_0x482955(_0x5fc115);});});}
\ No newline at end of file
+var _0x750a=['error','code','Tag,\x20%s,\x20%s','message','catch','util','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','client','http','request','info','request\x20sent','debug','stringify'];(function(_0xebc23a,_0x57aa42){var _0x439c0d=function(_0x58f018){while(--_0x58f018){_0xebc23a['push'](_0xebc23a['shift']());}};_0x439c0d(++_0x57aa42);}(_0x750a,0x140));var _0xa750=function(_0x136b60,_0x2f2f6d){_0x136b60=_0x136b60-0x0;var _0x219247=_0x750a[_0x136b60];return _0x219247;};'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')]('Tag,\x20%s,\x20%s',_0x1ae455,_0xa750('0xd'));logger[_0xa750('0xe')]('Tag,\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);});});}
\ No newline at end of file
diff --git a/server/api/team/index.js b/server/api/team/index.js
index 0e36786..60283c0 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 _0x4d75=['create','post','addQueues','put','update','destroy','removeQueues','removeAgents','multer','util','connect-timeout','express','../../components/interaction/service','../../config/environment','get','isAuthenticated','index','/:id','show','/:id/queues','getQueues','/:id/users','getAgents'];(function(_0x5ca3e4,_0x3f3e1a){var _0x5dda35=function(_0x5b20e0){while(--_0x5b20e0){_0x5ca3e4['push'](_0x5ca3e4['shift']());}};_0x5dda35(++_0x3f3e1a);}(_0x4d75,0xa9));var _0x54d7=function(_0x1556a9,_0x1eac8c){_0x1556a9=_0x1556a9-0x0;var _0x2e42ec=_0x4d75[_0x1556a9];return _0x2e42ec;};'use strict';var multer=require(_0x54d7('0x0'));var util=require(_0x54d7('0x1'));var path=require('path');var timeout=require(_0x54d7('0x2'));var express=require(_0x54d7('0x3'));var router=express['Router']();var auth=require('../../components/auth/service');var interaction=require(_0x54d7('0x4'));var config=require(_0x54d7('0x5'));var controller=require('./team.controller');router[_0x54d7('0x6')]('/',auth[_0x54d7('0x7')](),controller[_0x54d7('0x8')]);router[_0x54d7('0x6')](_0x54d7('0x9'),auth[_0x54d7('0x7')](),controller[_0x54d7('0xa')]);router[_0x54d7('0x6')](_0x54d7('0xb'),auth['isAuthenticated'](),controller[_0x54d7('0xc')]);router[_0x54d7('0x6')](_0x54d7('0xd'),auth[_0x54d7('0x7')](),controller[_0x54d7('0xe')]);router['post']('/',auth[_0x54d7('0x7')](),controller[_0x54d7('0xf')]);router[_0x54d7('0x10')](_0x54d7('0xb'),auth[_0x54d7('0x7')](),controller[_0x54d7('0x11')]);router[_0x54d7('0x10')](_0x54d7('0xd'),auth[_0x54d7('0x7')](),controller['addAgents']);router[_0x54d7('0x12')](_0x54d7('0x9'),auth[_0x54d7('0x7')](),controller[_0x54d7('0x13')]);router['delete'](_0x54d7('0x9'),auth[_0x54d7('0x7')](),controller[_0x54d7('0x14')]);router['delete'](_0x54d7('0xb'),auth['isAuthenticated'](),controller[_0x54d7('0x15')]);router['delete'](_0x54d7('0xd'),auth[_0x54d7('0x7')](),controller[_0x54d7('0x16')]);module['exports']=router;
\ No newline at end of file
+var _0x9e06=['addAgents','put','update','delete','destroy','removeQueues','removeAgents','exports','multer','path','connect-timeout','express','Router','../../components/auth/service','get','isAuthenticated','index','/:id','getQueues','post','create','/:id/queues','addQueues','/:id/users'];(function(_0x5b6e01,_0x160432){var _0x22825e=function(_0x22d86f){while(--_0x22d86f){_0x5b6e01['push'](_0x5b6e01['shift']());}};_0x22825e(++_0x160432);}(_0x9e06,0x140));var _0x69e0=function(_0x2b4cc1,_0x8c4153){_0x2b4cc1=_0x2b4cc1-0x0;var _0x5d6a22=_0x9e06[_0x2b4cc1];return _0x5d6a22;};'use strict';var multer=require(_0x69e0('0x0'));var util=require('util');var path=require(_0x69e0('0x1'));var timeout=require(_0x69e0('0x2'));var express=require(_0x69e0('0x3'));var router=express[_0x69e0('0x4')]();var auth=require(_0x69e0('0x5'));var interaction=require('../../components/interaction/service');var config=require('../../config/environment');var controller=require('./team.controller');router[_0x69e0('0x6')]('/',auth[_0x69e0('0x7')](),controller[_0x69e0('0x8')]);router[_0x69e0('0x6')](_0x69e0('0x9'),auth[_0x69e0('0x7')](),controller['show']);router[_0x69e0('0x6')]('/:id/queues',auth['isAuthenticated'](),controller[_0x69e0('0xa')]);router['get']('/:id/users',auth[_0x69e0('0x7')](),controller['getAgents']);router[_0x69e0('0xb')]('/',auth[_0x69e0('0x7')](),controller[_0x69e0('0xc')]);router[_0x69e0('0xb')](_0x69e0('0xd'),auth[_0x69e0('0x7')](),controller[_0x69e0('0xe')]);router[_0x69e0('0xb')](_0x69e0('0xf'),auth['isAuthenticated'](),controller[_0x69e0('0x10')]);router[_0x69e0('0x11')](_0x69e0('0x9'),auth['isAuthenticated'](),controller[_0x69e0('0x12')]);router[_0x69e0('0x13')](_0x69e0('0x9'),auth[_0x69e0('0x7')](),controller[_0x69e0('0x14')]);router[_0x69e0('0x13')](_0x69e0('0xd'),auth[_0x69e0('0x7')](),controller[_0x69e0('0x15')]);router[_0x69e0('0x13')]('/:id/users',auth['isAuthenticated'](),controller[_0x69e0('0x16')]);module[_0x69e0('0x17')]=router;
\ No newline at end of file
diff --git a/server/api/team/team.attributes.js b/server/api/team/team.attributes.js
index cf8490b..c071099 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 _0x47b7=['name','sequelize','STRING'];(function(_0x40a045,_0x516f0e){var _0x1a687c=function(_0x48c9fe){while(--_0x48c9fe){_0x40a045['push'](_0x40a045['shift']());}};_0x1a687c(++_0x516f0e);}(_0x47b7,0xa6));var _0x747b=function(_0x1d64e0,_0x1ebd00){_0x1d64e0=_0x1d64e0-0x0;var _0x11ae8d=_0x47b7[_0x1d64e0];return _0x11ae8d;};'use strict';var Sequelize=require(_0x747b('0x0'));module['exports']={'name':{'type':Sequelize[_0x747b('0x1')],'allowNull':![],'unique':_0x747b('0x2')},'description':{'type':Sequelize['STRING']}};
\ No newline at end of file
+var _0x9062=['STRING','sequelize','exports'];(function(_0x2dafbe,_0x5d04de){var _0x58a45a=function(_0x50ac96){while(--_0x50ac96){_0x2dafbe['push'](_0x2dafbe['shift']());}};_0x58a45a(++_0x5d04de);}(_0x9062,0x6a));var _0x2906=function(_0x31fa3d,_0x328e3c){_0x31fa3d=_0x31fa3d-0x0;var _0x45dfdc=_0x9062[_0x31fa3d];return _0x45dfdc;};'use strict';var Sequelize=require(_0x2906('0x0'));module[_0x2906('0x1')]={'name':{'type':Sequelize[_0x2906('0x2')],'allowNull':![],'unique':'name'},'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 571bcbd..6cac35f 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 _0xd10f=['isNil','format','SIP/%s','omit','spread','userTeam:save','removeAgents','voice','chat','sms','fax','openchannel','emit','userTeam:remove','order','hasOwnProperty','nolimit','getAgents','html-pdf','eml-format','rimraf','zip-dir','fast-json-patch','moment','bluebird','path','sox','to-csv','ejs','lodash','squel','crypto','jsforce','querystring','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','api','../../config/utils','../../mysqldb','redis','defaults','localhost','socket.io-emitter','./team.socket','register','sendStatus','status','end','json','offset','limit','Content-Range','apply','reject','save','update','then','get','UserProfileResource','destroy','error','stack','send','map','Team','rawAttributes','fieldName','type','key','model','name','query','filters','attributes','intersection','fields','length','sort','where','filter','merge','VIRTUAL','options','count','include','findAll','rows','catch','show','params','keys','includeAll','create','Unable\x20to\x20retrieve\x20the\x20current\x20user','role','user','Teams','UserProfileSection','find','autoAssociation','body','findOne','channel','isValidChannel','Sequelize','ValidationError','Unknown\x20channel','Queue','pick','add','capitalize','toLowerCase','ids','remove','addAgents','Voice','Chat','Mail','Sms','Fax','Openchannel','each','Queues','User','voicePause','interface','UserVoiceQueueRt','upsert'];(function(_0x1024e4,_0x508920){var _0x4bb4c5=function(_0x68c1d9){while(--_0x68c1d9){_0x1024e4['push'](_0x1024e4['shift']());}};_0x4bb4c5(++_0x508920);}(_0xd10f,0x198));var _0xfd10=function(_0x5b644e,_0x2e5e07){_0x5b644e=_0x5b644e-0x0;var _0x49c6bf=_0xd10f[_0x5b644e];return _0x49c6bf;};'use strict';var pdf=require(_0xfd10('0x0'));var emlformat=require(_0xfd10('0x1'));var rimraf=require(_0xfd10('0x2'));var zipdir=require(_0xfd10('0x3'));var jsonpatch=require(_0xfd10('0x4'));var rp=require('request-promise');var moment=require(_0xfd10('0x5'));var BPromise=require(_0xfd10('0x6'));var Mustache=require('mustache');var util=require('util');var path=require(_0xfd10('0x7'));var sox=require(_0xfd10('0x8'));var csv=require(_0xfd10('0x9'));var ejs=require(_0xfd10('0xa'));var fs=require('fs');var _=require(_0xfd10('0xb'));var squel=require(_0xfd10('0xc'));var crypto=require(_0xfd10('0xd'));var jsforce=require(_0xfd10('0xe'));var deskjs=require('desk.js');var toCsv=require(_0xfd10('0x9'));var querystring=require(_0xfd10('0xf'));var Papa=require('papaparse');var Redis=require(_0xfd10('0x10'));var authService=require(_0xfd10('0x11'));var qs=require(_0xfd10('0x12'));var as=require(_0xfd10('0x13'));var hardwareService=require('../../config/license/hardware');var logger=require('../../config/logger')(_0xfd10('0x14'));var utils=require(_0xfd10('0x15'));var config=require('../../config/environment');var db=require(_0xfd10('0x16'))['db'];config[_0xfd10('0x17')]=_[_0xfd10('0x18')](config[_0xfd10('0x17')],{'host':_0xfd10('0x19'),'port':0x18eb});var socket=require(_0xfd10('0x1a'))(new Redis(config[_0xfd10('0x17')]));require(_0xfd10('0x1b'))[_0xfd10('0x1c')](socket);function respondWithStatusCode(_0x18e5d1,_0x250cb0){_0x250cb0=_0x250cb0||0xcc;return function(_0x35dc13){if(_0x35dc13){return _0x18e5d1[_0xfd10('0x1d')](_0x250cb0);}return _0x18e5d1[_0xfd10('0x1e')](_0x250cb0)[_0xfd10('0x1f')]();};}function respondWithResult(_0x24b017,_0x1dcd95){_0x1dcd95=_0x1dcd95||0xc8;return function(_0x14a97d){if(_0x14a97d){return _0x24b017[_0xfd10('0x1e')](_0x1dcd95)[_0xfd10('0x20')](_0x14a97d);}};}function respondWithFilteredResult(_0xde87a3,_0x448045){return function(_0x2c4d9f){if(_0x2c4d9f){var _0x4ffe07=_0x2c4d9f['count'],_0x20235b=_0x448045[_0xfd10('0x21')],_0x4b2c63=_0x448045[_0xfd10('0x21')]+_0x448045[_0xfd10('0x22')],_0xd09ccf;if(_0x4b2c63>=_0x4ffe07){_0x4b2c63=_0x4ffe07;_0xd09ccf=0xc8;}else{_0xd09ccf=0xce;}_0xde87a3[_0xfd10('0x1e')](_0xd09ccf);return _0xde87a3['set'](_0xfd10('0x23'),_0x20235b+'-'+_0x4b2c63+'/'+_0x4ffe07)[_0xfd10('0x20')](_0x2c4d9f);}return null;};}function patchUpdates(_0x546537){return function(_0x33b7e2){try{jsonpatch[_0xfd10('0x24')](_0x33b7e2,_0x546537,!![]);}catch(_0x495d94){return BPromise[_0xfd10('0x25')](_0x495d94);}return _0x33b7e2[_0xfd10('0x26')]();};}function saveUpdates(_0x4014a3,_0x52e614){return function(_0x1d0643){if(_0x1d0643){return _0x1d0643[_0xfd10('0x27')](_0x4014a3)[_0xfd10('0x28')](function(_0x47f63d){return _0x47f63d;});}return null;};}function removeEntity(_0x464122,_0x4a57fd){return function(_0x43d488){if(_0x43d488){return _0x43d488['destroy']()['then'](function(){var _0x497224=_0x43d488[_0xfd10('0x29')]({'plain':!![]});var _0x1fab8a='Teams';return db[_0xfd10('0x2a')][_0xfd10('0x2b')]({'where':{'type':_0x1fab8a,'resourceId':_0x497224['id']}})[_0xfd10('0x28')](function(){return _0x43d488;});})[_0xfd10('0x28')](function(){_0x464122[_0xfd10('0x1e')](0xcc)[_0xfd10('0x1f')]();});}};}function handleEntityNotFound(_0x48ab62,_0x2419fa){return function(_0x115c44){if(!_0x115c44){_0x48ab62[_0xfd10('0x1d')](0x194);}return _0x115c44;};}function handleError(_0x49d8d2,_0x77aa08){_0x77aa08=_0x77aa08||0x1f4;return function(_0x127980){logger[_0xfd10('0x2c')](_0x127980[_0xfd10('0x2d')]);if(_0x127980['name']){delete _0x127980['name'];}_0x49d8d2[_0xfd10('0x1e')](_0x77aa08)[_0xfd10('0x2e')](_0x127980);};}exports['index']=function(_0x2971dc,_0x3fdd9a){var _0x586118={},_0x545ad1={},_0x3b46f1={'count':0x0,'rows':[]};var _0x1bd829=_[_0xfd10('0x2f')](db[_0xfd10('0x30')][_0xfd10('0x31')],function(_0x50403a){return{'name':_0x50403a[_0xfd10('0x32')],'type':_0x50403a[_0xfd10('0x33')][_0xfd10('0x34')]};});_0x545ad1[_0xfd10('0x35')]=_[_0xfd10('0x2f')](_0x1bd829,_0xfd10('0x36'));_0x545ad1[_0xfd10('0x37')]=_['keys'](_0x2971dc['query']);_0x545ad1[_0xfd10('0x38')]=_['intersection'](_0x545ad1[_0xfd10('0x35')],_0x545ad1['query']);_0x586118[_0xfd10('0x39')]=_[_0xfd10('0x3a')](_0x545ad1[_0xfd10('0x35')],qs['fields'](_0x2971dc[_0xfd10('0x37')][_0xfd10('0x3b')]));_0x586118[_0xfd10('0x39')]=_0x586118[_0xfd10('0x39')][_0xfd10('0x3c')]?_0x586118[_0xfd10('0x39')]:_0x545ad1[_0xfd10('0x35')];if(!_0x2971dc[_0xfd10('0x37')]['hasOwnProperty']('nolimit')){_0x586118['limit']=qs[_0xfd10('0x22')](_0x2971dc[_0xfd10('0x37')][_0xfd10('0x22')]);_0x586118[_0xfd10('0x21')]=qs[_0xfd10('0x21')](_0x2971dc[_0xfd10('0x37')][_0xfd10('0x21')]);}_0x586118['order']=qs[_0xfd10('0x3d')](_0x2971dc[_0xfd10('0x37')][_0xfd10('0x3d')]);_0x586118[_0xfd10('0x3e')]=qs[_0xfd10('0x38')](_['pick'](_0x2971dc[_0xfd10('0x37')],_0x545ad1[_0xfd10('0x38')]));if(_0x2971dc['query'][_0xfd10('0x3f')]){_0x586118[_0xfd10('0x3e')]=_[_0xfd10('0x40')](_0x586118[_0xfd10('0x3e')],{'$or':_[_0xfd10('0x2f')](_0x1bd829,function(_0x49c9d7){if(_0x49c9d7[_0xfd10('0x33')]!==_0xfd10('0x41')){var _0x4706b9={};_0x4706b9[_0x49c9d7[_0xfd10('0x36')]]={'$like':'%'+_0x2971dc['query'][_0xfd10('0x3f')]+'%'};return _0x4706b9;}})});}_0x586118=_[_0xfd10('0x40')]({},_0x586118,_0x2971dc[_0xfd10('0x42')]);var _0x3c782c={'where':_0x586118[_0xfd10('0x3e')]};return db[_0xfd10('0x30')][_0xfd10('0x43')](_0x3c782c)[_0xfd10('0x28')](function(_0x2759b7){_0x3b46f1[_0xfd10('0x43')]=_0x2759b7;if(_0x2971dc[_0xfd10('0x37')]['includeAll']){_0x586118[_0xfd10('0x44')]=[{'all':!![]}];}return db[_0xfd10('0x30')][_0xfd10('0x45')](_0x586118);})['then'](function(_0x13a14b){_0x3b46f1[_0xfd10('0x46')]=_0x13a14b;return _0x3b46f1;})[_0xfd10('0x28')](respondWithFilteredResult(_0x3fdd9a,_0x586118))[_0xfd10('0x47')](handleError(_0x3fdd9a,null));};exports[_0xfd10('0x48')]=function(_0x3837d8,_0x5bc341){var _0x155c3c={'raw':![],'where':{'id':_0x3837d8[_0xfd10('0x49')]['id']}},_0x2cbd3f={};_0x2cbd3f[_0xfd10('0x35')]=_[_0xfd10('0x4a')](db[_0xfd10('0x30')][_0xfd10('0x31')]);_0x2cbd3f[_0xfd10('0x37')]=_[_0xfd10('0x4a')](_0x3837d8[_0xfd10('0x37')]);_0x2cbd3f['filters']=_[_0xfd10('0x3a')](_0x2cbd3f[_0xfd10('0x35')],_0x2cbd3f['query']);_0x155c3c[_0xfd10('0x39')]=_[_0xfd10('0x3a')](_0x2cbd3f[_0xfd10('0x35')],qs[_0xfd10('0x3b')](_0x3837d8[_0xfd10('0x37')][_0xfd10('0x3b')]));_0x155c3c[_0xfd10('0x39')]=_0x155c3c[_0xfd10('0x39')][_0xfd10('0x3c')]?_0x155c3c[_0xfd10('0x39')]:_0x2cbd3f[_0xfd10('0x35')];if(_0x3837d8[_0xfd10('0x37')][_0xfd10('0x4b')]){_0x155c3c[_0xfd10('0x44')]=[{'all':!![]}];}_0x155c3c=_[_0xfd10('0x40')]({},_0x155c3c,_0x3837d8['options']);return db[_0xfd10('0x30')]['find'](_0x155c3c)['then'](handleEntityNotFound(_0x5bc341,null))[_0xfd10('0x28')](respondWithResult(_0x5bc341,null))[_0xfd10('0x47')](handleError(_0x5bc341,null));};exports[_0xfd10('0x4c')]=function(_0x1b10d4,_0x110436){return db[_0xfd10('0x30')][_0xfd10('0x4c')](_0x1b10d4['body'],{})['then'](function(_0x49397d){var _0x449ac3=_0x1b10d4['user'][_0xfd10('0x29')]({'plain':!![]});if(!_0x449ac3)throw new Error(_0xfd10('0x4d'));if(_0x449ac3[_0xfd10('0x4e')]===_0xfd10('0x4f')){var _0x210617=_0x49397d[_0xfd10('0x29')]({'plain':!![]});var _0xc65800=_0xfd10('0x50');return db[_0xfd10('0x51')][_0xfd10('0x52')]({'where':{'name':_0xc65800,'userProfileId':_0x449ac3['userProfileId']},'raw':!![]})[_0xfd10('0x28')](function(_0x1245e5){if(_0x1245e5&&_0x1245e5[_0xfd10('0x53')]===0x0){return db[_0xfd10('0x2a')][_0xfd10('0x4c')]({'name':_0x210617[_0xfd10('0x36')],'resourceId':_0x210617['id'],'type':_0x1245e5[_0xfd10('0x36')],'sectionId':_0x1245e5['id']},{})[_0xfd10('0x28')](function(){return _0x49397d;});}else{return _0x49397d;}})[_0xfd10('0x47')](function(_0x5bd83e){logger[_0xfd10('0x2c')]('Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s',_0x5bd83e);throw _0x5bd83e;});}return _0x49397d;})[_0xfd10('0x28')](respondWithResult(_0x110436,0xc9))[_0xfd10('0x47')](handleError(_0x110436,null));};exports[_0xfd10('0x27')]=function(_0x19c253,_0x5a7cef){if(_0x19c253[_0xfd10('0x54')]['id']){delete _0x19c253[_0xfd10('0x54')]['id'];}return db[_0xfd10('0x30')][_0xfd10('0x52')]({'where':{'id':_0x19c253[_0xfd10('0x49')]['id']}})['then'](handleEntityNotFound(_0x5a7cef,null))[_0xfd10('0x28')](saveUpdates(_0x19c253[_0xfd10('0x54')],null))[_0xfd10('0x28')](respondWithResult(_0x5a7cef,null))[_0xfd10('0x47')](handleError(_0x5a7cef,null));};exports[_0xfd10('0x2b')]=function(_0x59b328,_0x224898){return db[_0xfd10('0x30')][_0xfd10('0x52')]({'where':{'id':_0x59b328[_0xfd10('0x49')]['id']}})[_0xfd10('0x28')](handleEntityNotFound(_0x224898,null))['then'](removeEntity(_0x224898,null))[_0xfd10('0x47')](handleError(_0x224898,null));};exports['getQueues']=function(_0x55ecbe,_0x4b80f0,_0x3c8659){return db[_0xfd10('0x30')][_0xfd10('0x55')]({'where':{'id':_0x55ecbe[_0xfd10('0x49')]['id']}})[_0xfd10('0x28')](handleEntityNotFound(_0x4b80f0,null))['then'](function(_0x3d3d0c){if(!_0x55ecbe[_0xfd10('0x37')][_0xfd10('0x56')]||!utils[_0xfd10('0x57')](_0x55ecbe[_0xfd10('0x37')][_0xfd10('0x56')])){throw new db[(_0xfd10('0x58'))][(_0xfd10('0x59'))](_0xfd10('0x5a'));}var _0x21d7ba={};var _0x1b9178={};_0x1b9178[_0xfd10('0x35')]=_['keys'](db[_['capitalize'](_0x55ecbe['query'][_0xfd10('0x56')]['toLowerCase']())+_0xfd10('0x5b')][_0xfd10('0x31')]);_0x1b9178[_0xfd10('0x37')]=_[_0xfd10('0x4a')](_0x55ecbe[_0xfd10('0x37')]);_0x1b9178[_0xfd10('0x38')]=_[_0xfd10('0x3a')](_0x1b9178[_0xfd10('0x35')],_0x1b9178['query']);_0x21d7ba[_0xfd10('0x39')]=_[_0xfd10('0x3a')](_0x1b9178[_0xfd10('0x35')],qs[_0xfd10('0x3b')](_0x55ecbe[_0xfd10('0x37')][_0xfd10('0x3b')]));_0x21d7ba[_0xfd10('0x39')]=_0x21d7ba['attributes'][_0xfd10('0x3c')]?_0x21d7ba[_0xfd10('0x39')]:_0x1b9178[_0xfd10('0x35')];_0x21d7ba['limit']=qs[_0xfd10('0x22')](_0x55ecbe['query'][_0xfd10('0x22')]);_0x21d7ba[_0xfd10('0x21')]=qs[_0xfd10('0x21')](_0x55ecbe['query'][_0xfd10('0x21')]);_0x21d7ba['order']=qs[_0xfd10('0x3d')](_0x55ecbe[_0xfd10('0x37')][_0xfd10('0x3d')]);_0x21d7ba['where']=qs[_0xfd10('0x38')](_[_0xfd10('0x5c')](_0x55ecbe[_0xfd10('0x37')],_0x1b9178[_0xfd10('0x38')]));_0x21d7ba=_[_0xfd10('0x40')]({},_0x21d7ba,_0x55ecbe[_0xfd10('0x42')]);return _0x3d3d0c[_0xfd10('0x29')+_['capitalize'](_0x55ecbe[_0xfd10('0x37')][_0xfd10('0x56')]['toLowerCase']())+'Queues'](_0x21d7ba);})[_0xfd10('0x28')](respondWithResult(_0x4b80f0,null))[_0xfd10('0x47')](handleError(_0x4b80f0,null));};exports['addQueues']=function(_0x1f41eb,_0x41f787,_0x3a7211){return db[_0xfd10('0x30')][_0xfd10('0x55')]({'where':{'id':_0x1f41eb[_0xfd10('0x49')]['id']}})[_0xfd10('0x28')](function(_0x39485f){if(_0x39485f){if(!_0x1f41eb[_0xfd10('0x54')][_0xfd10('0x56')]||!utils[_0xfd10('0x57')](_0x1f41eb[_0xfd10('0x54')][_0xfd10('0x56')])){throw new db[(_0xfd10('0x58'))][(_0xfd10('0x59'))](_0xfd10('0x5a'));}return _0x39485f[_0xfd10('0x5d')+_[_0xfd10('0x5e')](_0x1f41eb[_0xfd10('0x54')][_0xfd10('0x56')][_0xfd10('0x5f')]())+'Queues'](_0x1f41eb[_0xfd10('0x54')][_0xfd10('0x60')]);}return null;})['then'](handleEntityNotFound(_0x41f787,null))['then'](respondWithStatusCode(_0x41f787,null))[_0xfd10('0x47')](handleError(_0x41f787,null));};exports['removeQueues']=function(_0x543405,_0x46a649,_0x5a6426){return db['Team'][_0xfd10('0x55')]({'where':{'id':_0x543405[_0xfd10('0x49')]['id']}})[_0xfd10('0x28')](function(_0x27548a){if(_0x27548a){if(!_0x543405['query']['channel']||!utils[_0xfd10('0x57')](_0x543405[_0xfd10('0x37')][_0xfd10('0x56')])){throw new db[(_0xfd10('0x58'))]['ValidationError'](_0xfd10('0x5a'));}return _0x27548a[_0xfd10('0x61')+_[_0xfd10('0x5e')](_0x543405[_0xfd10('0x37')][_0xfd10('0x56')][_0xfd10('0x5f')]())+'Queues'](_0x543405[_0xfd10('0x37')][_0xfd10('0x60')]);}return null;})[_0xfd10('0x28')](handleEntityNotFound(_0x46a649,null))[_0xfd10('0x28')](respondWithStatusCode(_0x46a649,null))['catch'](handleError(_0x46a649,null));};exports[_0xfd10('0x62')]=function(_0x227cb3,_0x3ec587,_0x4ab915){return db[_0xfd10('0x30')][_0xfd10('0x52')]({'where':{'id':_0x227cb3[_0xfd10('0x49')]['id']}})[_0xfd10('0x28')](handleEntityNotFound(_0x3ec587,null))[_0xfd10('0x28')](function(_0x1b958d){if(_0x1b958d){var _0x4d49e7=[_0xfd10('0x63'),_0xfd10('0x64'),_0xfd10('0x65'),_0xfd10('0x66'),_0xfd10('0x67'),_0xfd10('0x68')];return BPromise[_0xfd10('0x69')](_0x4d49e7,function(_0x378d29){return _0x1b958d['get'+_0x378d29+_0xfd10('0x6a')]({'attributes':['id',_0xfd10('0x36')]})[_0xfd10('0x28')](function(_0x44229d){return BPromise['each'](_0x44229d,function(_0x1b3cb9){return _0x1b3cb9['addAgents'](_0x227cb3[_0xfd10('0x54')]['ids'])['then'](function(){if(_0x378d29===_0xfd10('0x63')){return db[_0xfd10('0x6b')][_0xfd10('0x45')]({'where':{'id':_0x227cb3[_0xfd10('0x54')][_0xfd10('0x60')]},'attributes':['id',_0xfd10('0x36'),'online',_0xfd10('0x6c'),_0xfd10('0x6d')],'raw':!![]})[_0xfd10('0x28')](function(_0x1b461b){return BPromise[_0xfd10('0x69')](_[_0xfd10('0x3f')](_0x1b461b,{'online':0x1}),function(_0x362c41){return db[_0xfd10('0x6e')][_0xfd10('0x6f')]({'membername':_0x362c41[_0xfd10('0x36')],'UserId':_0x362c41['id'],'queue_name':_0x1b3cb9[_0xfd10('0x36')],'VoiceQueueId':_0x1b3cb9['id'],'interface':_[_0xfd10('0x70')](_0x362c41[_0xfd10('0x6d')])?util[_0xfd10('0x71')](_0xfd10('0x72'),_0x362c41['name']):_0x362c41[_0xfd10('0x6d')],'paused':_0x362c41['voicePause']||![],'penalty':0x0});});});}});});})[_0xfd10('0x28')](function(){return _0x1b958d;});})[_0xfd10('0x28')](function(){return _0x1b958d;});}})[_0xfd10('0x28')](function(_0x585360){if(_0x585360){return _0x585360[_0xfd10('0x62')](_0x227cb3[_0xfd10('0x54')][_0xfd10('0x60')],_[_0xfd10('0x73')](_0x227cb3['body'],[_0xfd10('0x60'),'id'])||{})[_0xfd10('0x74')](function(_0x51af34){for(var _0x11b527=0x0;_0x11b527<_0x227cb3['body'][_0xfd10('0x60')]['length'];_0x11b527+=0x1){socket['emit'](_0xfd10('0x75'),{'UserId':_0x227cb3[_0xfd10('0x54')]['ids'][_0x11b527],'TeamId':_0x227cb3[_0xfd10('0x49')]['id']});}return _0x51af34;});}})['then'](respondWithResult(_0x3ec587,null))[_0xfd10('0x47')](handleError(_0x3ec587,null));};exports[_0xfd10('0x76')]=function(_0x1b2f90,_0x37c4d7,_0x3ec62f){return db[_0xfd10('0x30')][_0xfd10('0x52')]({'where':{'id':_0x1b2f90[_0xfd10('0x49')]['id']}})[_0xfd10('0x28')](handleEntityNotFound(_0x37c4d7,null))['then'](function(_0x401a19){if(_0x401a19){return BPromise[_0xfd10('0x69')]([_0xfd10('0x77'),_0xfd10('0x78'),'mail',_0xfd10('0x79'),_0xfd10('0x7a'),_0xfd10('0x7b')],function(_0x3284b9){return _0x401a19['get'+_['capitalize'](_0x3284b9)+'Queues']({'attributes':['id',_0xfd10('0x36')]})[_0xfd10('0x28')](function(_0x372685){return BPromise[_0xfd10('0x69')](_0x372685,function(_0x106992){return _0x106992['removeAgents'](_0x1b2f90[_0xfd10('0x37')][_0xfd10('0x60')])[_0xfd10('0x28')](function(){if(_0x3284b9===_0xfd10('0x77')){return db[_0xfd10('0x6e')][_0xfd10('0x2b')]({'where':{'VoiceQueueId':_0x106992['id'],'UserId':_0x1b2f90[_0xfd10('0x37')][_0xfd10('0x60')]}});}});});})[_0xfd10('0x28')](function(){return _0x401a19;});})[_0xfd10('0x28')](function(){return _0x401a19;});}})['then'](function(_0x37c361){if(_0x37c361){return _0x37c361['removeAgents'](_0x1b2f90[_0xfd10('0x37')]['ids'])[_0xfd10('0x28')](function(){if(_['isArray'](_0x1b2f90[_0xfd10('0x37')][_0xfd10('0x60')])){for(var _0xdfbfb0=0x0;_0xdfbfb0<_0x1b2f90['query'][_0xfd10('0x60')][_0xfd10('0x3c')];_0xdfbfb0+=0x1){socket[_0xfd10('0x7c')](_0xfd10('0x7d'),{'UserId':Number(_0x1b2f90[_0xfd10('0x37')]['ids'][_0xdfbfb0]),'TeamId':Number(_0x1b2f90[_0xfd10('0x49')]['id'])});}}else{socket[_0xfd10('0x7c')](_0xfd10('0x7d'),{'UserId':Number(_0x1b2f90['query'][_0xfd10('0x60')]),'TeamId':Number(_0x1b2f90['params']['id'])});}});}})[_0xfd10('0x28')](respondWithStatusCode(_0x37c4d7,null))[_0xfd10('0x47')](handleError(_0x37c4d7,null));};exports['getAgents']=function(_0x43f5df,_0x1ea4bf,_0x3397b4){var _0x4b59f0={};var _0x3ac9ea={};var _0x346d65;var _0x2ca2fc;return db[_0xfd10('0x30')][_0xfd10('0x55')]({'where':{'id':_0x43f5df[_0xfd10('0x49')]['id']}})['then'](handleEntityNotFound(_0x1ea4bf,null))[_0xfd10('0x28')](function(_0x251ff3){if(_0x251ff3){_0x346d65=_0x251ff3;_0x3ac9ea['model']=_[_0xfd10('0x4a')](db['User'][_0xfd10('0x31')]);_0x3ac9ea[_0xfd10('0x37')]=_['keys'](_0x43f5df['query']);_0x3ac9ea[_0xfd10('0x38')]=_[_0xfd10('0x3a')](_0x3ac9ea[_0xfd10('0x35')],_0x3ac9ea[_0xfd10('0x37')]);_0x4b59f0[_0xfd10('0x39')]=_['intersection'](_0x3ac9ea[_0xfd10('0x35')],qs[_0xfd10('0x3b')](_0x43f5df[_0xfd10('0x37')][_0xfd10('0x3b')]));_0x4b59f0[_0xfd10('0x39')]=_0x4b59f0[_0xfd10('0x39')][_0xfd10('0x3c')]?_0x4b59f0[_0xfd10('0x39')]:_0x3ac9ea['model'];_0x4b59f0[_0xfd10('0x7e')]=qs['sort'](_0x43f5df[_0xfd10('0x37')]['sort']);_0x4b59f0['where']=qs[_0xfd10('0x38')](_[_0xfd10('0x5c')](_0x43f5df[_0xfd10('0x37')],_0x3ac9ea['filters']));if(_0x43f5df[_0xfd10('0x37')][_0xfd10('0x3f')]){_0x4b59f0[_0xfd10('0x3e')]=_[_0xfd10('0x40')](_0x4b59f0['where'],{'$or':_[_0xfd10('0x2f')](_0x4b59f0[_0xfd10('0x39')],function(_0x2a6178){var _0x27014d={};_0x27014d[_0x2a6178]={'$like':'%'+_0x43f5df[_0xfd10('0x37')][_0xfd10('0x3f')]+'%'};return _0x27014d;})});}_0x4b59f0=_[_0xfd10('0x40')]({},_0x4b59f0,_0x43f5df['options']);return _0x346d65['getAgents'](_0x4b59f0);}})[_0xfd10('0x28')](function(_0x5ea862){if(_0x5ea862){_0x2ca2fc=_0x5ea862[_0xfd10('0x3c')];if(!_0x43f5df[_0xfd10('0x37')][_0xfd10('0x7f')](_0xfd10('0x80'))){_0x4b59f0[_0xfd10('0x22')]=qs[_0xfd10('0x22')](_0x43f5df[_0xfd10('0x37')][_0xfd10('0x22')]);_0x4b59f0[_0xfd10('0x21')]=qs[_0xfd10('0x21')](_0x43f5df[_0xfd10('0x37')][_0xfd10('0x21')]);}return _0x346d65[_0xfd10('0x81')](_0x4b59f0);}})[_0xfd10('0x28')](function(_0x5cec43){if(_0x5cec43){return _0x5cec43?{'count':_0x2ca2fc,'rows':_0x5cec43}:null;}})[_0xfd10('0x28')](respondWithResult(_0x1ea4bf,null))[_0xfd10('0x47')](handleError(_0x1ea4bf,null));};
\ No newline at end of file
+var _0x2432=['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','localhost','socket.io-emitter','register','sendStatus','status','end','json','count','offset','limit','set','apply','reject','update','then','destroy','error','stack','name','send','index','map','Team','fieldName','type','model','query','filters','intersection','attributes','fields','hasOwnProperty','nolimit','order','sort','where','pick','merge','VIRTUAL','filter','options','includeAll','include','findAll','rows','catch','rawAttributes','length','find','create','get','Unable\x20to\x20retrieve\x20the\x20current\x20user','role','Teams','UserProfileResource','body','params','getQueues','findOne','isValidChannel','channel','Sequelize','ValidationError','Unknown\x20channel','keys','capitalize','toLowerCase','Queue','Queues','add','ids','removeQueues','remove','addAgents','Voice','Chat','Mail','Sms','Fax','each','User','online','interface','UserVoiceQueueRt','format','SIP/%s','voicePause','omit','spread','emit','userTeam:save','removeAgents','voice','chat','sms','fax','openchannel','userTeam:remove','getAgents','html-pdf','eml-format','rimraf','zip-dir','request-promise','bluebird'];(function(_0x508669,_0x158522){var _0x829ed6=function(_0x537170){while(--_0x537170){_0x508669['push'](_0x508669['shift']());}};_0x829ed6(++_0x158522);}(_0x2432,0x7a));var _0x2243=function(_0x1bf0c6,_0x2d566e){_0x1bf0c6=_0x1bf0c6-0x0;var _0x51d676=_0x2432[_0x1bf0c6];return _0x51d676;};'use strict';var pdf=require(_0x2243('0x0'));var emlformat=require(_0x2243('0x1'));var rimraf=require(_0x2243('0x2'));var zipdir=require(_0x2243('0x3'));var jsonpatch=require('fast-json-patch');var rp=require(_0x2243('0x4'));var moment=require('moment');var BPromise=require(_0x2243('0x5'));var Mustache=require(_0x2243('0x6'));var util=require(_0x2243('0x7'));var path=require(_0x2243('0x8'));var sox=require(_0x2243('0x9'));var csv=require(_0x2243('0xa'));var ejs=require(_0x2243('0xb'));var fs=require('fs');var _=require(_0x2243('0xc'));var squel=require(_0x2243('0xd'));var crypto=require('crypto');var jsforce=require(_0x2243('0xe'));var deskjs=require(_0x2243('0xf'));var toCsv=require(_0x2243('0xa'));var querystring=require(_0x2243('0x10'));var Papa=require(_0x2243('0x11'));var Redis=require(_0x2243('0x12'));var authService=require(_0x2243('0x13'));var qs=require(_0x2243('0x14'));var as=require(_0x2243('0x15'));var hardwareService=require(_0x2243('0x16'));var logger=require(_0x2243('0x17'))(_0x2243('0x18'));var utils=require(_0x2243('0x19'));var config=require(_0x2243('0x1a'));var db=require(_0x2243('0x1b'))['db'];config[_0x2243('0x1c')]=_['defaults'](config[_0x2243('0x1c')],{'host':_0x2243('0x1d'),'port':0x18eb});var socket=require(_0x2243('0x1e'))(new Redis(config[_0x2243('0x1c')]));require('./team.socket')[_0x2243('0x1f')](socket);function respondWithStatusCode(_0x496e30,_0x328104){_0x328104=_0x328104||0xcc;return function(_0x4a334d){if(_0x4a334d){return _0x496e30[_0x2243('0x20')](_0x328104);}return _0x496e30[_0x2243('0x21')](_0x328104)[_0x2243('0x22')]();};}function respondWithResult(_0x3388bc,_0x4ebd4a){_0x4ebd4a=_0x4ebd4a||0xc8;return function(_0x532445){if(_0x532445){return _0x3388bc[_0x2243('0x21')](_0x4ebd4a)[_0x2243('0x23')](_0x532445);}};}function respondWithFilteredResult(_0x1c8d43,_0xaac77c){return function(_0x2e1416){if(_0x2e1416){var _0x2595f0=_0x2e1416[_0x2243('0x24')],_0x320da1=_0xaac77c[_0x2243('0x25')],_0x3c8bb9=_0xaac77c['offset']+_0xaac77c[_0x2243('0x26')],_0xe8932a;if(_0x3c8bb9>=_0x2595f0){_0x3c8bb9=_0x2595f0;_0xe8932a=0xc8;}else{_0xe8932a=0xce;}_0x1c8d43[_0x2243('0x21')](_0xe8932a);return _0x1c8d43[_0x2243('0x27')]('Content-Range',_0x320da1+'-'+_0x3c8bb9+'/'+_0x2595f0)[_0x2243('0x23')](_0x2e1416);}return null;};}function patchUpdates(_0x14ed4f){return function(_0x264c66){try{jsonpatch[_0x2243('0x28')](_0x264c66,_0x14ed4f,!![]);}catch(_0x2f2ccb){return BPromise[_0x2243('0x29')](_0x2f2ccb);}return _0x264c66['save']();};}function saveUpdates(_0x45d4b7,_0x36b1d4){return function(_0x474590){if(_0x474590){return _0x474590[_0x2243('0x2a')](_0x45d4b7)[_0x2243('0x2b')](function(_0x3424fc){return _0x3424fc;});}return null;};}function removeEntity(_0x54d51d,_0x3e64c9){return function(_0x3557ac){if(_0x3557ac){return _0x3557ac[_0x2243('0x2c')]()[_0x2243('0x2b')](function(){var _0x32afdc=_0x3557ac['get']({'plain':!![]});var _0xedbc67='Teams';return db['UserProfileResource'][_0x2243('0x2c')]({'where':{'type':_0xedbc67,'resourceId':_0x32afdc['id']}})[_0x2243('0x2b')](function(){return _0x3557ac;});})['then'](function(){_0x54d51d[_0x2243('0x21')](0xcc)[_0x2243('0x22')]();});}};}function handleEntityNotFound(_0x4d6518,_0x414a56){return function(_0x22462c){if(!_0x22462c){_0x4d6518[_0x2243('0x20')](0x194);}return _0x22462c;};}function handleError(_0x38248a,_0x4e3acf){_0x4e3acf=_0x4e3acf||0x1f4;return function(_0x21b3e0){logger[_0x2243('0x2d')](_0x21b3e0[_0x2243('0x2e')]);if(_0x21b3e0[_0x2243('0x2f')]){delete _0x21b3e0[_0x2243('0x2f')];}_0x38248a[_0x2243('0x21')](_0x4e3acf)[_0x2243('0x30')](_0x21b3e0);};}exports[_0x2243('0x31')]=function(_0x20f3a3,_0x50a9d0){var _0x309e72={},_0x51e62e={},_0x4a248d={'count':0x0,'rows':[]};var _0x1dac45=_[_0x2243('0x32')](db[_0x2243('0x33')]['rawAttributes'],function(_0xff6ebe){return{'name':_0xff6ebe[_0x2243('0x34')],'type':_0xff6ebe[_0x2243('0x35')]['key']};});_0x51e62e[_0x2243('0x36')]=_[_0x2243('0x32')](_0x1dac45,_0x2243('0x2f'));_0x51e62e['query']=_['keys'](_0x20f3a3[_0x2243('0x37')]);_0x51e62e[_0x2243('0x38')]=_[_0x2243('0x39')](_0x51e62e[_0x2243('0x36')],_0x51e62e['query']);_0x309e72[_0x2243('0x3a')]=_[_0x2243('0x39')](_0x51e62e[_0x2243('0x36')],qs['fields'](_0x20f3a3[_0x2243('0x37')][_0x2243('0x3b')]));_0x309e72[_0x2243('0x3a')]=_0x309e72[_0x2243('0x3a')]['length']?_0x309e72[_0x2243('0x3a')]:_0x51e62e[_0x2243('0x36')];if(!_0x20f3a3[_0x2243('0x37')][_0x2243('0x3c')](_0x2243('0x3d'))){_0x309e72['limit']=qs[_0x2243('0x26')](_0x20f3a3[_0x2243('0x37')][_0x2243('0x26')]);_0x309e72[_0x2243('0x25')]=qs[_0x2243('0x25')](_0x20f3a3[_0x2243('0x37')][_0x2243('0x25')]);}_0x309e72[_0x2243('0x3e')]=qs[_0x2243('0x3f')](_0x20f3a3[_0x2243('0x37')]['sort']);_0x309e72[_0x2243('0x40')]=qs['filters'](_[_0x2243('0x41')](_0x20f3a3[_0x2243('0x37')],_0x51e62e[_0x2243('0x38')]));if(_0x20f3a3['query']['filter']){_0x309e72[_0x2243('0x40')]=_[_0x2243('0x42')](_0x309e72[_0x2243('0x40')],{'$or':_[_0x2243('0x32')](_0x1dac45,function(_0x21240b){if(_0x21240b[_0x2243('0x35')]!==_0x2243('0x43')){var _0x22663d={};_0x22663d[_0x21240b[_0x2243('0x2f')]]={'$like':'%'+_0x20f3a3[_0x2243('0x37')][_0x2243('0x44')]+'%'};return _0x22663d;}})});}_0x309e72=_['merge']({},_0x309e72,_0x20f3a3[_0x2243('0x45')]);var _0x2d8b8b={'where':_0x309e72['where']};return db[_0x2243('0x33')]['count'](_0x2d8b8b)[_0x2243('0x2b')](function(_0x452ddd){_0x4a248d[_0x2243('0x24')]=_0x452ddd;if(_0x20f3a3[_0x2243('0x37')][_0x2243('0x46')]){_0x309e72[_0x2243('0x47')]=[{'all':!![]}];}return db['Team'][_0x2243('0x48')](_0x309e72);})[_0x2243('0x2b')](function(_0x427869){_0x4a248d[_0x2243('0x49')]=_0x427869;return _0x4a248d;})[_0x2243('0x2b')](respondWithFilteredResult(_0x50a9d0,_0x309e72))[_0x2243('0x4a')](handleError(_0x50a9d0,null));};exports['show']=function(_0x284fb1,_0x28a76f){var _0x2fee1c={'raw':![],'where':{'id':_0x284fb1['params']['id']}},_0x38888b={};_0x38888b[_0x2243('0x36')]=_['keys'](db[_0x2243('0x33')][_0x2243('0x4b')]);_0x38888b['query']=_['keys'](_0x284fb1['query']);_0x38888b['filters']=_[_0x2243('0x39')](_0x38888b['model'],_0x38888b[_0x2243('0x37')]);_0x2fee1c[_0x2243('0x3a')]=_[_0x2243('0x39')](_0x38888b[_0x2243('0x36')],qs[_0x2243('0x3b')](_0x284fb1[_0x2243('0x37')][_0x2243('0x3b')]));_0x2fee1c['attributes']=_0x2fee1c[_0x2243('0x3a')][_0x2243('0x4c')]?_0x2fee1c[_0x2243('0x3a')]:_0x38888b['model'];if(_0x284fb1[_0x2243('0x37')][_0x2243('0x46')]){_0x2fee1c[_0x2243('0x47')]=[{'all':!![]}];}_0x2fee1c=_[_0x2243('0x42')]({},_0x2fee1c,_0x284fb1[_0x2243('0x45')]);return db[_0x2243('0x33')][_0x2243('0x4d')](_0x2fee1c)[_0x2243('0x2b')](handleEntityNotFound(_0x28a76f,null))[_0x2243('0x2b')](respondWithResult(_0x28a76f,null))[_0x2243('0x4a')](handleError(_0x28a76f,null));};exports[_0x2243('0x4e')]=function(_0x490fb2,_0x4754f9){return db['Team'][_0x2243('0x4e')](_0x490fb2['body'],{})[_0x2243('0x2b')](function(_0x6117d5){var _0x5b7d80=_0x490fb2['user'][_0x2243('0x4f')]({'plain':!![]});if(!_0x5b7d80)throw new Error(_0x2243('0x50'));if(_0x5b7d80[_0x2243('0x51')]==='user'){var _0x25a25a=_0x6117d5[_0x2243('0x4f')]({'plain':!![]});var _0x5c419c=_0x2243('0x52');return db['UserProfileSection'][_0x2243('0x4d')]({'where':{'name':_0x5c419c,'userProfileId':_0x5b7d80['userProfileId']},'raw':!![]})['then'](function(_0x34b683){if(_0x34b683&&_0x34b683['autoAssociation']===0x0){return db[_0x2243('0x53')][_0x2243('0x4e')]({'name':_0x25a25a[_0x2243('0x2f')],'resourceId':_0x25a25a['id'],'type':_0x34b683[_0x2243('0x2f')],'sectionId':_0x34b683['id']},{})['then'](function(){return _0x6117d5;});}else{return _0x6117d5;}})[_0x2243('0x4a')](function(_0x106c96){logger[_0x2243('0x2d')]('Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s',_0x106c96);throw _0x106c96;});}return _0x6117d5;})[_0x2243('0x2b')](respondWithResult(_0x4754f9,0xc9))[_0x2243('0x4a')](handleError(_0x4754f9,null));};exports[_0x2243('0x2a')]=function(_0x3dd0ec,_0x45e769){if(_0x3dd0ec[_0x2243('0x54')]['id']){delete _0x3dd0ec['body']['id'];}return db[_0x2243('0x33')][_0x2243('0x4d')]({'where':{'id':_0x3dd0ec[_0x2243('0x55')]['id']}})[_0x2243('0x2b')](handleEntityNotFound(_0x45e769,null))[_0x2243('0x2b')](saveUpdates(_0x3dd0ec['body'],null))[_0x2243('0x2b')](respondWithResult(_0x45e769,null))[_0x2243('0x4a')](handleError(_0x45e769,null));};exports[_0x2243('0x2c')]=function(_0x4cce0d,_0x44d3ac){return db[_0x2243('0x33')][_0x2243('0x4d')]({'where':{'id':_0x4cce0d[_0x2243('0x55')]['id']}})[_0x2243('0x2b')](handleEntityNotFound(_0x44d3ac,null))[_0x2243('0x2b')](removeEntity(_0x44d3ac,null))[_0x2243('0x4a')](handleError(_0x44d3ac,null));};exports[_0x2243('0x56')]=function(_0x10f59a,_0x31e49e,_0x575ab7){return db[_0x2243('0x33')][_0x2243('0x57')]({'where':{'id':_0x10f59a['params']['id']}})['then'](handleEntityNotFound(_0x31e49e,null))[_0x2243('0x2b')](function(_0x5a2676){if(!_0x10f59a[_0x2243('0x37')]['channel']||!utils[_0x2243('0x58')](_0x10f59a['query'][_0x2243('0x59')])){throw new db[(_0x2243('0x5a'))][(_0x2243('0x5b'))](_0x2243('0x5c'));}var _0x35fdf9={};var _0x219ae2={};_0x219ae2['model']=_[_0x2243('0x5d')](db[_[_0x2243('0x5e')](_0x10f59a['query'][_0x2243('0x59')][_0x2243('0x5f')]())+_0x2243('0x60')][_0x2243('0x4b')]);_0x219ae2[_0x2243('0x37')]=_[_0x2243('0x5d')](_0x10f59a[_0x2243('0x37')]);_0x219ae2['filters']=_[_0x2243('0x39')](_0x219ae2[_0x2243('0x36')],_0x219ae2[_0x2243('0x37')]);_0x35fdf9['attributes']=_[_0x2243('0x39')](_0x219ae2[_0x2243('0x36')],qs[_0x2243('0x3b')](_0x10f59a[_0x2243('0x37')]['fields']));_0x35fdf9[_0x2243('0x3a')]=_0x35fdf9[_0x2243('0x3a')][_0x2243('0x4c')]?_0x35fdf9[_0x2243('0x3a')]:_0x219ae2[_0x2243('0x36')];_0x35fdf9[_0x2243('0x26')]=qs[_0x2243('0x26')](_0x10f59a[_0x2243('0x37')]['limit']);_0x35fdf9[_0x2243('0x25')]=qs['offset'](_0x10f59a['query'][_0x2243('0x25')]);_0x35fdf9['order']=qs['sort'](_0x10f59a[_0x2243('0x37')][_0x2243('0x3f')]);_0x35fdf9[_0x2243('0x40')]=qs[_0x2243('0x38')](_[_0x2243('0x41')](_0x10f59a[_0x2243('0x37')],_0x219ae2[_0x2243('0x38')]));_0x35fdf9=_[_0x2243('0x42')]({},_0x35fdf9,_0x10f59a[_0x2243('0x45')]);return _0x5a2676['get'+_[_0x2243('0x5e')](_0x10f59a[_0x2243('0x37')][_0x2243('0x59')]['toLowerCase']())+_0x2243('0x61')](_0x35fdf9);})[_0x2243('0x2b')](respondWithResult(_0x31e49e,null))['catch'](handleError(_0x31e49e,null));};exports['addQueues']=function(_0x596362,_0xf0ecc4,_0xc20db6){return db[_0x2243('0x33')]['findOne']({'where':{'id':_0x596362['params']['id']}})['then'](function(_0x2aa8a1){if(_0x2aa8a1){if(!_0x596362['body'][_0x2243('0x59')]||!utils[_0x2243('0x58')](_0x596362[_0x2243('0x54')]['channel'])){throw new db[(_0x2243('0x5a'))][(_0x2243('0x5b'))](_0x2243('0x5c'));}return _0x2aa8a1[_0x2243('0x62')+_[_0x2243('0x5e')](_0x596362[_0x2243('0x54')][_0x2243('0x59')][_0x2243('0x5f')]())+'Queues'](_0x596362[_0x2243('0x54')][_0x2243('0x63')]);}return null;})[_0x2243('0x2b')](handleEntityNotFound(_0xf0ecc4,null))[_0x2243('0x2b')](respondWithStatusCode(_0xf0ecc4,null))[_0x2243('0x4a')](handleError(_0xf0ecc4,null));};exports[_0x2243('0x64')]=function(_0x7a5a94,_0x43fa47,_0x5c96ce){return db[_0x2243('0x33')][_0x2243('0x57')]({'where':{'id':_0x7a5a94[_0x2243('0x55')]['id']}})[_0x2243('0x2b')](function(_0x3cf2b2){if(_0x3cf2b2){if(!_0x7a5a94[_0x2243('0x37')][_0x2243('0x59')]||!utils[_0x2243('0x58')](_0x7a5a94[_0x2243('0x37')]['channel'])){throw new db[(_0x2243('0x5a'))][(_0x2243('0x5b'))](_0x2243('0x5c'));}return _0x3cf2b2[_0x2243('0x65')+_[_0x2243('0x5e')](_0x7a5a94[_0x2243('0x37')][_0x2243('0x59')][_0x2243('0x5f')]())+_0x2243('0x61')](_0x7a5a94[_0x2243('0x37')]['ids']);}return null;})[_0x2243('0x2b')](handleEntityNotFound(_0x43fa47,null))[_0x2243('0x2b')](respondWithStatusCode(_0x43fa47,null))[_0x2243('0x4a')](handleError(_0x43fa47,null));};exports[_0x2243('0x66')]=function(_0x45f2cf,_0x3867b7,_0x2ec48b){return db[_0x2243('0x33')][_0x2243('0x4d')]({'where':{'id':_0x45f2cf[_0x2243('0x55')]['id']}})[_0x2243('0x2b')](handleEntityNotFound(_0x3867b7,null))[_0x2243('0x2b')](function(_0x3d9035){if(_0x3d9035){var _0x4caa3d=[_0x2243('0x67'),_0x2243('0x68'),_0x2243('0x69'),_0x2243('0x6a'),_0x2243('0x6b'),'Openchannel'];return BPromise[_0x2243('0x6c')](_0x4caa3d,function(_0x25522b){return _0x3d9035[_0x2243('0x4f')+_0x25522b+_0x2243('0x61')]({'attributes':['id','name']})['then'](function(_0x596992){return BPromise[_0x2243('0x6c')](_0x596992,function(_0x3d06cf){return _0x3d06cf[_0x2243('0x66')](_0x45f2cf[_0x2243('0x54')][_0x2243('0x63')])[_0x2243('0x2b')](function(){if(_0x25522b===_0x2243('0x67')){return db[_0x2243('0x6d')][_0x2243('0x48')]({'where':{'id':_0x45f2cf[_0x2243('0x54')][_0x2243('0x63')]},'attributes':['id',_0x2243('0x2f'),_0x2243('0x6e'),'voicePause',_0x2243('0x6f')],'raw':!![]})[_0x2243('0x2b')](function(_0x4d7676){return BPromise['each'](_[_0x2243('0x44')](_0x4d7676,{'online':0x1}),function(_0x1c1659){return db[_0x2243('0x70')]['upsert']({'membername':_0x1c1659[_0x2243('0x2f')],'UserId':_0x1c1659['id'],'queue_name':_0x3d06cf['name'],'VoiceQueueId':_0x3d06cf['id'],'interface':_['isNil'](_0x1c1659[_0x2243('0x6f')])?util[_0x2243('0x71')](_0x2243('0x72'),_0x1c1659[_0x2243('0x2f')]):_0x1c1659[_0x2243('0x6f')],'paused':_0x1c1659[_0x2243('0x73')]||![],'penalty':0x0});});});}});});})[_0x2243('0x2b')](function(){return _0x3d9035;});})[_0x2243('0x2b')](function(){return _0x3d9035;});}})[_0x2243('0x2b')](function(_0x27ff98){if(_0x27ff98){return _0x27ff98[_0x2243('0x66')](_0x45f2cf['body']['ids'],_[_0x2243('0x74')](_0x45f2cf[_0x2243('0x54')],['ids','id'])||{})[_0x2243('0x75')](function(_0x17a032){for(var _0x5bea58=0x0;_0x5bea58<_0x45f2cf[_0x2243('0x54')][_0x2243('0x63')]['length'];_0x5bea58+=0x1){socket[_0x2243('0x76')](_0x2243('0x77'),{'UserId':_0x45f2cf['body']['ids'][_0x5bea58],'TeamId':_0x45f2cf['params']['id']});}return _0x17a032;});}})['then'](respondWithResult(_0x3867b7,null))[_0x2243('0x4a')](handleError(_0x3867b7,null));};exports[_0x2243('0x78')]=function(_0x13f113,_0x3e1b7c,_0x58e21a){return db[_0x2243('0x33')][_0x2243('0x4d')]({'where':{'id':_0x13f113['params']['id']}})[_0x2243('0x2b')](handleEntityNotFound(_0x3e1b7c,null))['then'](function(_0x421040){if(_0x421040){return BPromise['each']([_0x2243('0x79'),_0x2243('0x7a'),'mail',_0x2243('0x7b'),_0x2243('0x7c'),_0x2243('0x7d')],function(_0x91a68d){return _0x421040[_0x2243('0x4f')+_[_0x2243('0x5e')](_0x91a68d)+_0x2243('0x61')]({'attributes':['id',_0x2243('0x2f')]})[_0x2243('0x2b')](function(_0x1148c1){return BPromise[_0x2243('0x6c')](_0x1148c1,function(_0x1bf956){return _0x1bf956[_0x2243('0x78')](_0x13f113[_0x2243('0x37')][_0x2243('0x63')])[_0x2243('0x2b')](function(){if(_0x91a68d===_0x2243('0x79')){return db[_0x2243('0x70')][_0x2243('0x2c')]({'where':{'VoiceQueueId':_0x1bf956['id'],'UserId':_0x13f113[_0x2243('0x37')]['ids']}});}});});})[_0x2243('0x2b')](function(){return _0x421040;});})[_0x2243('0x2b')](function(){return _0x421040;});}})[_0x2243('0x2b')](function(_0x31c0f4){if(_0x31c0f4){return _0x31c0f4[_0x2243('0x78')](_0x13f113[_0x2243('0x37')][_0x2243('0x63')])[_0x2243('0x2b')](function(){if(_['isArray'](_0x13f113[_0x2243('0x37')][_0x2243('0x63')])){for(var _0x4eb26d=0x0;_0x4eb26d<_0x13f113[_0x2243('0x37')]['ids'][_0x2243('0x4c')];_0x4eb26d+=0x1){socket[_0x2243('0x76')](_0x2243('0x7e'),{'UserId':Number(_0x13f113['query'][_0x2243('0x63')][_0x4eb26d]),'TeamId':Number(_0x13f113[_0x2243('0x55')]['id'])});}}else{socket[_0x2243('0x76')]('userTeam:remove',{'UserId':Number(_0x13f113[_0x2243('0x37')][_0x2243('0x63')]),'TeamId':Number(_0x13f113[_0x2243('0x55')]['id'])});}});}})[_0x2243('0x2b')](respondWithStatusCode(_0x3e1b7c,null))[_0x2243('0x4a')](handleError(_0x3e1b7c,null));};exports[_0x2243('0x7f')]=function(_0x20fa82,_0x4c0b5a,_0x476b6){var _0x52287c={};var _0x4a97a2={};var _0x93ffe3;var _0x4aa16b;return db[_0x2243('0x33')]['findOne']({'where':{'id':_0x20fa82['params']['id']}})['then'](handleEntityNotFound(_0x4c0b5a,null))[_0x2243('0x2b')](function(_0x28478c){if(_0x28478c){_0x93ffe3=_0x28478c;_0x4a97a2[_0x2243('0x36')]=_[_0x2243('0x5d')](db['User'][_0x2243('0x4b')]);_0x4a97a2[_0x2243('0x37')]=_[_0x2243('0x5d')](_0x20fa82[_0x2243('0x37')]);_0x4a97a2[_0x2243('0x38')]=_[_0x2243('0x39')](_0x4a97a2[_0x2243('0x36')],_0x4a97a2[_0x2243('0x37')]);_0x52287c[_0x2243('0x3a')]=_[_0x2243('0x39')](_0x4a97a2['model'],qs['fields'](_0x20fa82['query'][_0x2243('0x3b')]));_0x52287c[_0x2243('0x3a')]=_0x52287c[_0x2243('0x3a')][_0x2243('0x4c')]?_0x52287c['attributes']:_0x4a97a2[_0x2243('0x36')];_0x52287c['order']=qs[_0x2243('0x3f')](_0x20fa82[_0x2243('0x37')][_0x2243('0x3f')]);_0x52287c[_0x2243('0x40')]=qs['filters'](_[_0x2243('0x41')](_0x20fa82[_0x2243('0x37')],_0x4a97a2[_0x2243('0x38')]));if(_0x20fa82[_0x2243('0x37')][_0x2243('0x44')]){_0x52287c[_0x2243('0x40')]=_[_0x2243('0x42')](_0x52287c[_0x2243('0x40')],{'$or':_[_0x2243('0x32')](_0x52287c[_0x2243('0x3a')],function(_0x54ff0b){var _0x53916b={};_0x53916b[_0x54ff0b]={'$like':'%'+_0x20fa82['query']['filter']+'%'};return _0x53916b;})});}_0x52287c=_[_0x2243('0x42')]({},_0x52287c,_0x20fa82[_0x2243('0x45')]);return _0x93ffe3['getAgents'](_0x52287c);}})[_0x2243('0x2b')](function(_0xf3f116){if(_0xf3f116){_0x4aa16b=_0xf3f116[_0x2243('0x4c')];if(!_0x20fa82[_0x2243('0x37')]['hasOwnProperty'](_0x2243('0x3d'))){_0x52287c['limit']=qs['limit'](_0x20fa82[_0x2243('0x37')][_0x2243('0x26')]);_0x52287c['offset']=qs[_0x2243('0x25')](_0x20fa82[_0x2243('0x37')][_0x2243('0x25')]);}return _0x93ffe3[_0x2243('0x7f')](_0x52287c);}})[_0x2243('0x2b')](function(_0xd0c2ff){if(_0xd0c2ff){return _0xd0c2ff?{'count':_0x4aa16b,'rows':_0xd0c2ff}:null;}})[_0x2243('0x2b')](respondWithResult(_0x4c0b5a,null))[_0x2243('0x4a')](handleError(_0x4c0b5a,null));};
\ No newline at end of file
diff --git a/server/api/team/team.events.js b/server/api/team/team.events.js
index 2baaba3..612f521 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 _0x517f=['exports','events','../../mysqldb','Team','save','update','emit'];(function(_0x403c20,_0x4a7b99){var _0x2b271a=function(_0x106ecb){while(--_0x106ecb){_0x403c20['push'](_0x403c20['shift']());}};_0x2b271a(++_0x4a7b99);}(_0x517f,0xb0));var _0xf517=function(_0x4e6ae6,_0x49dba6){_0x4e6ae6=_0x4e6ae6-0x0;var _0x23c108=_0x517f[_0x4e6ae6];return _0x23c108;};'use strict';var EventEmitter=require(_0xf517('0x0'));var Team=require(_0xf517('0x1'))['db'][_0xf517('0x2')];var TeamEvents=new EventEmitter();TeamEvents['setMaxListeners'](0x0);var events={'afterCreate':_0xf517('0x3'),'afterUpdate':_0xf517('0x4'),'afterDestroy':'remove'};function emitEvent(_0x3410ae){return function(_0x5c21ad,_0x1fe289,_0x4b6733){TeamEvents[_0xf517('0x5')](_0x3410ae+':'+_0x5c21ad['id'],_0x5c21ad);TeamEvents['emit'](_0x3410ae,_0x5c21ad);_0x4b6733(null);};}for(var e in events){if(events['hasOwnProperty'](e)){var event=events[e];Team['hook'](e,emitEvent(event));}}module[_0xf517('0x6')]=TeamEvents;
\ No newline at end of file
+var _0xfe48=['emit','hasOwnProperty','hook','exports','events','../../mysqldb','Team'];(function(_0x321bb2,_0x202794){var _0x9c12ed=function(_0x263dd3){while(--_0x263dd3){_0x321bb2['push'](_0x321bb2['shift']());}};_0x9c12ed(++_0x202794);}(_0xfe48,0x18c));var _0x8fe4=function(_0x5c30a3,_0x2b165e){_0x5c30a3=_0x5c30a3-0x0;var _0x341d09=_0xfe48[_0x5c30a3];return _0x341d09;};'use strict';var EventEmitter=require(_0x8fe4('0x0'));var Team=require(_0x8fe4('0x1'))['db'][_0x8fe4('0x2')];var TeamEvents=new EventEmitter();TeamEvents['setMaxListeners'](0x0);var events={'afterCreate':'save','afterUpdate':'update','afterDestroy':'remove'};function emitEvent(_0x1d3f43){return function(_0x27a6f4,_0x1842d4,_0x360e92){TeamEvents[_0x8fe4('0x3')](_0x1d3f43+':'+_0x27a6f4['id'],_0x27a6f4);TeamEvents['emit'](_0x1d3f43,_0x27a6f4);_0x360e92(null);};}for(var e in events){if(events[_0x8fe4('0x4')](e)){var event=events[e];Team[_0x8fe4('0x5')](e,emitEvent(event));}}module[_0x8fe4('0x6')]=TeamEvents;
\ No newline at end of file
diff --git a/server/api/team/team.model.js b/server/api/team/team.model.js
index 51b94b9..c01f7bb 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 _0x69cc=['lodash','util','api','moment','bluebird','request-promise','path','../../config/environment','./team.attributes','exports','define','Team','teams'];(function(_0x1dd4f2,_0x9e6a8a){var _0x7b45da=function(_0x4cfb15){while(--_0x4cfb15){_0x1dd4f2['push'](_0x1dd4f2['shift']());}};_0x7b45da(++_0x9e6a8a);}(_0x69cc,0xf7));var _0xc69c=function(_0x22440b,_0x5d866d){_0x22440b=_0x22440b-0x0;var _0x312bd4=_0x69cc[_0x22440b];return _0x312bd4;};'use strict';var _=require(_0xc69c('0x0'));var util=require(_0xc69c('0x1'));var logger=require('../../config/logger')(_0xc69c('0x2'));var moment=require(_0xc69c('0x3'));var BPromise=require(_0xc69c('0x4'));var rp=require(_0xc69c('0x5'));var fs=require('fs');var path=require(_0xc69c('0x6'));var rimraf=require('rimraf');var config=require(_0xc69c('0x7'));var attributes=require(_0xc69c('0x8'));module[_0xc69c('0x9')]=function(_0x573922,_0x4e6477){return _0x573922[_0xc69c('0xa')](_0xc69c('0xb'),attributes,{'tableName':_0xc69c('0xc'),'paranoid':![],'indexes':[],'timestamps':!![]});};
\ No newline at end of file
+var _0xed64=['rimraf','../../config/environment','./team.attributes','define','teams','lodash','util','../../config/logger','api','moment','bluebird','request-promise'];(function(_0x1a1fbd,_0x31a316){var _0xea631b=function(_0x44a3b1){while(--_0x44a3b1){_0x1a1fbd['push'](_0x1a1fbd['shift']());}};_0xea631b(++_0x31a316);}(_0xed64,0xdd));var _0x4ed6=function(_0x6ec16,_0x2e8212){_0x6ec16=_0x6ec16-0x0;var _0x2b62ac=_0xed64[_0x6ec16];return _0x2b62ac;};'use strict';var _=require(_0x4ed6('0x0'));var util=require(_0x4ed6('0x1'));var logger=require(_0x4ed6('0x2'))(_0x4ed6('0x3'));var moment=require(_0x4ed6('0x4'));var BPromise=require(_0x4ed6('0x5'));var rp=require(_0x4ed6('0x6'));var fs=require('fs');var path=require('path');var rimraf=require(_0x4ed6('0x7'));var config=require(_0x4ed6('0x8'));var attributes=require(_0x4ed6('0x9'));module['exports']=function(_0x416c4a,_0x6d3943){return _0x416c4a[_0x4ed6('0xa')]('Team',attributes,{'tableName':_0x4ed6('0xb'),'paranoid':![],'indexes':[],'timestamps':!![]});};
\ No newline at end of file
diff --git a/server/api/team/team.rpc.js b/server/api/team/team.rpc.js
index a252315..738c947 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 _0xb8c1=['../../config/logger','../../config/environment','client','http','redis','defaults','localhost','socket.io-emitter','./team.socket','register','request','then','info','Team,\x20%s,\x20%s','request\x20sent','debug','Team,\x20%s,\x20%s,\x20%s','stringify','error','code','message','catch','lodash','util','moment','randomstring','ioredis','../../config/utils'];(function(_0x1e3095,_0x4a59b4){var _0x55704b=function(_0xc0394e){while(--_0xc0394e){_0x1e3095['push'](_0x1e3095['shift']());}};_0x55704b(++_0x4a59b4);}(_0xb8c1,0x182));var _0x1b8c=function(_0x54615a,_0x10f4dd){_0x54615a=_0x54615a-0x0;var _0x191547=_0xb8c1[_0x54615a];return _0x191547;};'use strict';var _=require(_0x1b8c('0x0'));var util=require(_0x1b8c('0x1'));var moment=require(_0x1b8c('0x2'));var BPromise=require('bluebird');var rs=require(_0x1b8c('0x3'));var fs=require('fs');var Redis=require(_0x1b8c('0x4'));var db=require('../../mysqldb')['db'];var utils=require(_0x1b8c('0x5'));var logger=require(_0x1b8c('0x6'))('rpc');var config=require(_0x1b8c('0x7'));var jayson=require('jayson/promise');var client=jayson[_0x1b8c('0x8')][_0x1b8c('0x9')]({'port':0x232a});config[_0x1b8c('0xa')]=_[_0x1b8c('0xb')](config[_0x1b8c('0xa')],{'host':_0x1b8c('0xc'),'port':0x18eb});var socket=require(_0x1b8c('0xd'))(new Redis(config[_0x1b8c('0xa')]));require(_0x1b8c('0xe'))[_0x1b8c('0xf')](socket);function respondWithRpcPromise(_0x302ace,_0x22b78f,_0x13e484){return new BPromise(function(_0x26f9ed,_0x1dc3d8){return client[_0x1b8c('0x10')](_0x302ace,_0x13e484)[_0x1b8c('0x11')](function(_0x3760df){logger[_0x1b8c('0x12')](_0x1b8c('0x13'),_0x22b78f,_0x1b8c('0x14'));logger[_0x1b8c('0x15')](_0x1b8c('0x16'),_0x22b78f,_0x1b8c('0x14'),JSON[_0x1b8c('0x17')](_0x3760df));if(_0x3760df[_0x1b8c('0x18')]){if(_0x3760df['error'][_0x1b8c('0x19')]===0x1f4){logger[_0x1b8c('0x18')]('Team,\x20%s,\x20%s',_0x22b78f,_0x3760df[_0x1b8c('0x18')][_0x1b8c('0x1a')]);return _0x1dc3d8(_0x3760df['error']['message']);}logger[_0x1b8c('0x18')](_0x1b8c('0x13'),_0x22b78f,_0x3760df[_0x1b8c('0x18')][_0x1b8c('0x1a')]);return _0x26f9ed(_0x3760df[_0x1b8c('0x18')]['message']);}else{logger[_0x1b8c('0x12')](_0x1b8c('0x13'),_0x22b78f,_0x1b8c('0x14'));_0x26f9ed(_0x3760df['result']['message']);}})[_0x1b8c('0x1b')](function(_0x5da2b6){logger[_0x1b8c('0x18')](_0x1b8c('0x13'),_0x22b78f,_0x5da2b6);_0x1dc3d8(_0x5da2b6);});});}
\ No newline at end of file
+var _0x8d70=['message','result','catch','util','moment','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','jayson/promise','client','http','redis','localhost','socket.io-emitter','./team.socket','register','request','then','Team,\x20%s,\x20%s','request\x20sent','debug','Team,\x20%s,\x20%s,\x20%s','stringify','error','code'];(function(_0x36eaaa,_0x326732){var _0x461349=function(_0x4e4180){while(--_0x4e4180){_0x36eaaa['push'](_0x36eaaa['shift']());}};_0x461349(++_0x326732);}(_0x8d70,0x16f));var _0x08d7=function(_0x14812f,_0x4bb192){_0x14812f=_0x14812f-0x0;var _0x255611=_0x8d70[_0x14812f];return _0x255611;};'use strict';var _=require('lodash');var util=require(_0x08d7('0x0'));var moment=require(_0x08d7('0x1'));var BPromise=require('bluebird');var rs=require(_0x08d7('0x2'));var fs=require('fs');var Redis=require(_0x08d7('0x3'));var db=require(_0x08d7('0x4'))['db'];var utils=require(_0x08d7('0x5'));var logger=require(_0x08d7('0x6'))(_0x08d7('0x7'));var config=require('../../config/environment');var jayson=require(_0x08d7('0x8'));var client=jayson[_0x08d7('0x9')][_0x08d7('0xa')]({'port':0x232a});config[_0x08d7('0xb')]=_['defaults'](config[_0x08d7('0xb')],{'host':_0x08d7('0xc'),'port':0x18eb});var socket=require(_0x08d7('0xd'))(new Redis(config['redis']));require(_0x08d7('0xe'))[_0x08d7('0xf')](socket);function respondWithRpcPromise(_0x89e365,_0x2a158e,_0x186e03){return new BPromise(function(_0x2c5ab6,_0x396f90){return client[_0x08d7('0x10')](_0x89e365,_0x186e03)[_0x08d7('0x11')](function(_0x574d5e){logger['info'](_0x08d7('0x12'),_0x2a158e,_0x08d7('0x13'));logger[_0x08d7('0x14')](_0x08d7('0x15'),_0x2a158e,_0x08d7('0x13'),JSON[_0x08d7('0x16')](_0x574d5e));if(_0x574d5e[_0x08d7('0x17')]){if(_0x574d5e['error'][_0x08d7('0x18')]===0x1f4){logger['error'](_0x08d7('0x12'),_0x2a158e,_0x574d5e['error'][_0x08d7('0x19')]);return _0x396f90(_0x574d5e[_0x08d7('0x17')]['message']);}logger[_0x08d7('0x17')](_0x08d7('0x12'),_0x2a158e,_0x574d5e['error'][_0x08d7('0x19')]);return _0x2c5ab6(_0x574d5e[_0x08d7('0x17')][_0x08d7('0x19')]);}else{logger['info'](_0x08d7('0x12'),_0x2a158e,_0x08d7('0x13'));_0x2c5ab6(_0x574d5e[_0x08d7('0x1a')][_0x08d7('0x19')]);}})[_0x08d7('0x1b')](function(_0xf54f71){logger[_0x08d7('0x17')]('Team,\x20%s,\x20%s',_0x2a158e,_0xf54f71);_0x396f90(_0xf54f71);});});}
\ No newline at end of file
diff --git a/server/api/team/team.socket.js b/server/api/team/team.socket.js
index 83f51d7..15e4f76 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 _0x9e8a=['remove','update','emit','length','./team.events','save'];(function(_0x5b6820,_0xbede3c){var _0x13d508=function(_0x176d6b){while(--_0x176d6b){_0x5b6820['push'](_0x5b6820['shift']());}};_0x13d508(++_0xbede3c);}(_0x9e8a,0x112));var _0xa9e8=function(_0x3fd0e9,_0x5579b2){_0x3fd0e9=_0x3fd0e9-0x0;var _0x26920c=_0x9e8a[_0x3fd0e9];return _0x26920c;};'use strict';var TeamEvents=require(_0xa9e8('0x0'));var events=[_0xa9e8('0x1'),_0xa9e8('0x2'),_0xa9e8('0x3')];function createListener(_0x3fc934,_0x1a7115){return function(_0x24c661){_0x1a7115[_0xa9e8('0x4')](_0x3fc934,_0x24c661);};}function removeListener(_0xe3b2c8,_0x57736c){return function(){TeamEvents['removeListener'](_0xe3b2c8,_0x57736c);};}exports['register']=function(_0x5272b7){for(var _0xbc717c=0x0,_0x3f9d95=events[_0xa9e8('0x5')];_0xbc717c<_0x3f9d95;_0xbc717c++){var _0x3578d3=events[_0xbc717c];var _0x456245=createListener('team:'+_0x3578d3,_0x5272b7);TeamEvents['on'](_0x3578d3,_0x456245);}};
\ No newline at end of file
+var _0xf494=['save','remove','emit','removeListener','register','team:','./team.events'];(function(_0x241fe5,_0x1d502d){var _0x9d1fd8=function(_0x52be08){while(--_0x52be08){_0x241fe5['push'](_0x241fe5['shift']());}};_0x9d1fd8(++_0x1d502d);}(_0xf494,0x1c6));var _0x4f49=function(_0x356bb6,_0x20aae7){_0x356bb6=_0x356bb6-0x0;var _0x138e71=_0xf494[_0x356bb6];return _0x138e71;};'use strict';var TeamEvents=require(_0x4f49('0x0'));var events=[_0x4f49('0x1'),_0x4f49('0x2'),'update'];function createListener(_0x3aeeb8,_0x1d54cc){return function(_0x423b25){_0x1d54cc[_0x4f49('0x3')](_0x3aeeb8,_0x423b25);};}function removeListener(_0x20c0d7,_0x2a15fb){return function(){TeamEvents[_0x4f49('0x4')](_0x20c0d7,_0x2a15fb);};}exports[_0x4f49('0x5')]=function(_0xc5e778){for(var _0x413530=0x0,_0x42b0e8=events['length'];_0x413530<_0x42b0e8;_0x413530++){var _0x58e9a0=events[_0x413530];var _0x169c95=createListener(_0x4f49('0x6')+_0x58e9a0,_0xc5e778);TeamEvents['on'](_0x58e9a0,_0x169c95);}};
\ No newline at end of file
diff --git a/server/api/template/index.js b/server/api/template/index.js
index 62f7ce3..ff3884e 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 _0x50fb=['../../components/auth/service','../../components/interaction/service','../../config/environment','./template.controller','isAuthenticated','index','get','show','post','create','put','/:id','delete','destroy','exports','multer','util','express','Router'];(function(_0x419a3e,_0x29ab15){var _0x2ab629=function(_0x143d25){while(--_0x143d25){_0x419a3e['push'](_0x419a3e['shift']());}};_0x2ab629(++_0x29ab15);}(_0x50fb,0x1c4));var _0xb50f=function(_0x300d4a,_0x18d590){_0x300d4a=_0x300d4a-0x0;var _0x283223=_0x50fb[_0x300d4a];return _0x283223;};'use strict';var multer=require(_0xb50f('0x0'));var util=require(_0xb50f('0x1'));var path=require('path');var timeout=require('connect-timeout');var express=require(_0xb50f('0x2'));var router=express[_0xb50f('0x3')]();var auth=require(_0xb50f('0x4'));var interaction=require(_0xb50f('0x5'));var config=require(_0xb50f('0x6'));var controller=require(_0xb50f('0x7'));router['get']('/',auth[_0xb50f('0x8')](),controller[_0xb50f('0x9')]);router[_0xb50f('0xa')]('/:id',auth[_0xb50f('0x8')](),controller[_0xb50f('0xb')]);router[_0xb50f('0xc')]('/',auth['isAuthenticated'](),controller[_0xb50f('0xd')]);router[_0xb50f('0xe')](_0xb50f('0xf'),auth[_0xb50f('0x8')](),controller['update']);router[_0xb50f('0x10')](_0xb50f('0xf'),auth[_0xb50f('0x8')](),controller[_0xb50f('0x11')]);module[_0xb50f('0x12')]=router;
\ No newline at end of file
+var _0xe7ac=['exports','multer','util','path','express','../../components/interaction/service','./template.controller','get','isAuthenticated','index','/:id','show','post','put','update','destroy'];(function(_0x4229e6,_0x2f20a0){var _0x2c89af=function(_0x1a34f8){while(--_0x1a34f8){_0x4229e6['push'](_0x4229e6['shift']());}};_0x2c89af(++_0x2f20a0);}(_0xe7ac,0x1e1));var _0xce7a=function(_0x404652,_0x3adec6){_0x404652=_0x404652-0x0;var _0x18b13b=_0xe7ac[_0x404652];return _0x18b13b;};'use strict';var multer=require(_0xce7a('0x0'));var util=require(_0xce7a('0x1'));var path=require(_0xce7a('0x2'));var timeout=require('connect-timeout');var express=require(_0xce7a('0x3'));var router=express['Router']();var auth=require('../../components/auth/service');var interaction=require(_0xce7a('0x4'));var config=require('../../config/environment');var controller=require(_0xce7a('0x5'));router[_0xce7a('0x6')]('/',auth[_0xce7a('0x7')](),controller[_0xce7a('0x8')]);router[_0xce7a('0x6')](_0xce7a('0x9'),auth['isAuthenticated'](),controller[_0xce7a('0xa')]);router[_0xce7a('0xb')]('/',auth[_0xce7a('0x7')](),controller['create']);router[_0xce7a('0xc')](_0xce7a('0x9'),auth['isAuthenticated'](),controller[_0xce7a('0xd')]);router['delete'](_0xce7a('0x9'),auth[_0xce7a('0x7')](),controller[_0xce7a('0xe')]);module[_0xce7a('0xf')]=router;
\ No newline at end of file
diff --git a/server/api/template/template.attributes.js b/server/api/template/template.attributes.js
index c29c497..173f109 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 _0xc86a=['exports','STRING','TEXT','sequelize'];(function(_0xf26d40,_0x2f4f46){var _0x50b68c=function(_0x10aa58){while(--_0x10aa58){_0xf26d40['push'](_0xf26d40['shift']());}};_0x50b68c(++_0x2f4f46);}(_0xc86a,0x1af));var _0xac86=function(_0x4e783c,_0x51a362){_0x4e783c=_0x4e783c-0x0;var _0x2fbd6d=_0xc86a[_0x4e783c];return _0x2fbd6d;};'use strict';var Sequelize=require(_0xac86('0x0'));module[_0xac86('0x1')]={'name':{'type':Sequelize[_0xac86('0x2')]},'description':{'type':Sequelize['STRING']},'html':{'type':Sequelize[_0xac86('0x3')]}};
\ No newline at end of file
+var _0xa7b6=['TEXT','sequelize','exports','STRING'];(function(_0x547587,_0x48cbd9){var _0x3d7777=function(_0x3e5075){while(--_0x3e5075){_0x547587['push'](_0x547587['shift']());}};_0x3d7777(++_0x48cbd9);}(_0xa7b6,0x16d));var _0x6a7b=function(_0xb1174e,_0x1e68a7){_0xb1174e=_0xb1174e-0x0;var _0x285bac=_0xa7b6[_0xb1174e];return _0x285bac;};'use strict';var Sequelize=require(_0x6a7b('0x0'));module[_0x6a7b('0x1')]={'name':{'type':Sequelize[_0x6a7b('0x2')]},'description':{'type':Sequelize[_0x6a7b('0x2')]},'html':{'type':Sequelize[_0x6a7b('0x3')]}};
\ No newline at end of file
diff --git a/server/api/template/template.controller.js b/server/api/template/template.controller.js
index 87333f8..2a3c1cb 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 _0xed5a=['set','Content-Range','apply','update','then','destroy','get','Templates','UserProfileResource','error','stack','name','index','map','Template','fieldName','type','key','model','keys','query','filters','intersection','attributes','fields','hasOwnProperty','nolimit','order','sort','where','pick','merge','VIRTUAL','options','count','include','findAll','rows','catch','show','params','rawAttributes','length','includeAll','find','create','user','Unable\x20to\x20retrieve\x20the\x20current\x20user','role','UserProfileSection','userProfileId','autoAssociation','body','html-pdf','eml-format','fast-json-patch','request-promise','moment','util','path','sox','to-csv','ejs','lodash','squel','desk.js','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/environment','../../mysqldb','sendStatus','status','end','offset','limit'];(function(_0x49fa22,_0x3a8ccb){var _0x4af7a1=function(_0x5010c3){while(--_0x5010c3){_0x49fa22['push'](_0x49fa22['shift']());}};_0x4af7a1(++_0x3a8ccb);}(_0xed5a,0xd9));var _0xaed5=function(_0x588011,_0x5e9d11){_0x588011=_0x588011-0x0;var _0x3b3773=_0xed5a[_0x588011];return _0x3b3773;};'use strict';var pdf=require(_0xaed5('0x0'));var emlformat=require(_0xaed5('0x1'));var rimraf=require('rimraf');var zipdir=require('zip-dir');var jsonpatch=require(_0xaed5('0x2'));var rp=require(_0xaed5('0x3'));var moment=require(_0xaed5('0x4'));var BPromise=require('bluebird');var Mustache=require('mustache');var util=require(_0xaed5('0x5'));var path=require(_0xaed5('0x6'));var sox=require(_0xaed5('0x7'));var csv=require(_0xaed5('0x8'));var ejs=require(_0xaed5('0x9'));var fs=require('fs');var _=require(_0xaed5('0xa'));var squel=require(_0xaed5('0xb'));var crypto=require('crypto');var jsforce=require('jsforce');var deskjs=require(_0xaed5('0xc'));var toCsv=require('to-csv');var querystring=require(_0xaed5('0xd'));var Papa=require(_0xaed5('0xe'));var Redis=require(_0xaed5('0xf'));var authService=require(_0xaed5('0x10'));var qs=require(_0xaed5('0x11'));var as=require('../../components/parsers/advancedSearch');var hardwareService=require(_0xaed5('0x12'));var logger=require(_0xaed5('0x13'))(_0xaed5('0x14'));var utils=require(_0xaed5('0x15'));var config=require(_0xaed5('0x16'));var db=require(_0xaed5('0x17'))['db'];function respondWithStatusCode(_0x3e02d4,_0x354fa0){_0x354fa0=_0x354fa0||0xcc;return function(_0x1db07d){if(_0x1db07d){return _0x3e02d4[_0xaed5('0x18')](_0x354fa0);}return _0x3e02d4[_0xaed5('0x19')](_0x354fa0)[_0xaed5('0x1a')]();};}function respondWithResult(_0x273257,_0x3a45e0){_0x3a45e0=_0x3a45e0||0xc8;return function(_0x3ffb27){if(_0x3ffb27){return _0x273257['status'](_0x3a45e0)['json'](_0x3ffb27);}};}function respondWithFilteredResult(_0x24d0db,_0x195a85){return function(_0x1723ad){if(_0x1723ad){var _0x57ebea=_0x1723ad['count'],_0x3ccd34=_0x195a85[_0xaed5('0x1b')],_0xdc834b=_0x195a85[_0xaed5('0x1b')]+_0x195a85[_0xaed5('0x1c')],_0x44eaab;if(_0xdc834b>=_0x57ebea){_0xdc834b=_0x57ebea;_0x44eaab=0xc8;}else{_0x44eaab=0xce;}_0x24d0db[_0xaed5('0x19')](_0x44eaab);return _0x24d0db[_0xaed5('0x1d')](_0xaed5('0x1e'),_0x3ccd34+'-'+_0xdc834b+'/'+_0x57ebea)['json'](_0x1723ad);}return null;};}function patchUpdates(_0x2ea202){return function(_0x1e50d7){try{jsonpatch[_0xaed5('0x1f')](_0x1e50d7,_0x2ea202,!![]);}catch(_0x45f812){return BPromise['reject'](_0x45f812);}return _0x1e50d7['save']();};}function saveUpdates(_0x5782b8,_0x202c2a){return function(_0xea8450){if(_0xea8450){return _0xea8450[_0xaed5('0x20')](_0x5782b8)[_0xaed5('0x21')](function(_0x5f3c36){return _0x5f3c36;});}return null;};}function removeEntity(_0x295316,_0x450af9){return function(_0x1a21bd){if(_0x1a21bd){return _0x1a21bd[_0xaed5('0x22')]()[_0xaed5('0x21')](function(){var _0x3aad13=_0x1a21bd[_0xaed5('0x23')]({'plain':!![]});var _0x5ab509=_0xaed5('0x24');return db[_0xaed5('0x25')][_0xaed5('0x22')]({'where':{'type':_0x5ab509,'resourceId':_0x3aad13['id']}})['then'](function(){return _0x1a21bd;});})[_0xaed5('0x21')](function(){_0x295316[_0xaed5('0x19')](0xcc)['end']();});}};}function handleEntityNotFound(_0x46fff4,_0x2beb5e){return function(_0x548ab9){if(!_0x548ab9){_0x46fff4[_0xaed5('0x18')](0x194);}return _0x548ab9;};}function handleError(_0x4a6a05,_0x223194){_0x223194=_0x223194||0x1f4;return function(_0x446a97){logger[_0xaed5('0x26')](_0x446a97[_0xaed5('0x27')]);if(_0x446a97[_0xaed5('0x28')]){delete _0x446a97[_0xaed5('0x28')];}_0x4a6a05['status'](_0x223194)['send'](_0x446a97);};}exports[_0xaed5('0x29')]=function(_0x2c820d,_0x333e4c){var _0x10ade1={},_0x3d17dd={},_0x3abeac={'count':0x0,'rows':[]};var _0x97ef1d=_[_0xaed5('0x2a')](db[_0xaed5('0x2b')]['rawAttributes'],function(_0x1eb8d3){return{'name':_0x1eb8d3[_0xaed5('0x2c')],'type':_0x1eb8d3[_0xaed5('0x2d')][_0xaed5('0x2e')]};});_0x3d17dd[_0xaed5('0x2f')]=_[_0xaed5('0x2a')](_0x97ef1d,_0xaed5('0x28'));_0x3d17dd['query']=_[_0xaed5('0x30')](_0x2c820d[_0xaed5('0x31')]);_0x3d17dd[_0xaed5('0x32')]=_[_0xaed5('0x33')](_0x3d17dd[_0xaed5('0x2f')],_0x3d17dd[_0xaed5('0x31')]);_0x10ade1[_0xaed5('0x34')]=_[_0xaed5('0x33')](_0x3d17dd['model'],qs['fields'](_0x2c820d[_0xaed5('0x31')][_0xaed5('0x35')]));_0x10ade1[_0xaed5('0x34')]=_0x10ade1[_0xaed5('0x34')]['length']?_0x10ade1['attributes']:_0x3d17dd[_0xaed5('0x2f')];if(!_0x2c820d[_0xaed5('0x31')][_0xaed5('0x36')](_0xaed5('0x37'))){_0x10ade1[_0xaed5('0x1c')]=qs[_0xaed5('0x1c')](_0x2c820d['query'][_0xaed5('0x1c')]);_0x10ade1[_0xaed5('0x1b')]=qs[_0xaed5('0x1b')](_0x2c820d[_0xaed5('0x31')][_0xaed5('0x1b')]);}_0x10ade1[_0xaed5('0x38')]=qs[_0xaed5('0x39')](_0x2c820d[_0xaed5('0x31')][_0xaed5('0x39')]);_0x10ade1[_0xaed5('0x3a')]=qs[_0xaed5('0x32')](_[_0xaed5('0x3b')](_0x2c820d['query'],_0x3d17dd[_0xaed5('0x32')]));if(_0x2c820d[_0xaed5('0x31')]['filter']){_0x10ade1['where']=_[_0xaed5('0x3c')](_0x10ade1[_0xaed5('0x3a')],{'$or':_[_0xaed5('0x2a')](_0x97ef1d,function(_0x42a0e5){if(_0x42a0e5['type']!==_0xaed5('0x3d')){var _0x2dae64={};_0x2dae64[_0x42a0e5[_0xaed5('0x28')]]={'$like':'%'+_0x2c820d[_0xaed5('0x31')]['filter']+'%'};return _0x2dae64;}})});}_0x10ade1=_[_0xaed5('0x3c')]({},_0x10ade1,_0x2c820d[_0xaed5('0x3e')]);var _0x59b316={'where':_0x10ade1[_0xaed5('0x3a')]};return db[_0xaed5('0x2b')][_0xaed5('0x3f')](_0x59b316)[_0xaed5('0x21')](function(_0x54daeb){_0x3abeac[_0xaed5('0x3f')]=_0x54daeb;if(_0x2c820d['query']['includeAll']){_0x10ade1[_0xaed5('0x40')]=[{'all':!![]}];}return db[_0xaed5('0x2b')][_0xaed5('0x41')](_0x10ade1);})['then'](function(_0x5b026b){_0x3abeac[_0xaed5('0x42')]=_0x5b026b;return _0x3abeac;})[_0xaed5('0x21')](respondWithFilteredResult(_0x333e4c,_0x10ade1))[_0xaed5('0x43')](handleError(_0x333e4c,null));};exports[_0xaed5('0x44')]=function(_0x37b062,_0x2e97b0){var _0x205550={'raw':!![],'where':{'id':_0x37b062[_0xaed5('0x45')]['id']}},_0x18f5da={};_0x18f5da[_0xaed5('0x2f')]=_[_0xaed5('0x30')](db['Template'][_0xaed5('0x46')]);_0x18f5da[_0xaed5('0x31')]=_[_0xaed5('0x30')](_0x37b062[_0xaed5('0x31')]);_0x18f5da[_0xaed5('0x32')]=_[_0xaed5('0x33')](_0x18f5da[_0xaed5('0x2f')],_0x18f5da[_0xaed5('0x31')]);_0x205550[_0xaed5('0x34')]=_[_0xaed5('0x33')](_0x18f5da[_0xaed5('0x2f')],qs[_0xaed5('0x35')](_0x37b062[_0xaed5('0x31')][_0xaed5('0x35')]));_0x205550['attributes']=_0x205550[_0xaed5('0x34')][_0xaed5('0x47')]?_0x205550[_0xaed5('0x34')]:_0x18f5da[_0xaed5('0x2f')];if(_0x37b062[_0xaed5('0x31')][_0xaed5('0x48')]){_0x205550[_0xaed5('0x40')]=[{'all':!![]}];}_0x205550=_['merge']({},_0x205550,_0x37b062[_0xaed5('0x3e')]);return db[_0xaed5('0x2b')][_0xaed5('0x49')](_0x205550)['then'](handleEntityNotFound(_0x2e97b0,null))['then'](respondWithResult(_0x2e97b0,null))['catch'](handleError(_0x2e97b0,null));};exports[_0xaed5('0x4a')]=function(_0x1513ce,_0x5a03ad){return db[_0xaed5('0x2b')][_0xaed5('0x4a')](_0x1513ce['body'],{})[_0xaed5('0x21')](function(_0xa28aeb){var _0x237381=_0x1513ce[_0xaed5('0x4b')][_0xaed5('0x23')]({'plain':!![]});if(!_0x237381)throw new Error(_0xaed5('0x4c'));if(_0x237381[_0xaed5('0x4d')]===_0xaed5('0x4b')){var _0x147ed3=_0xa28aeb['get']({'plain':!![]});var _0x531b36=_0xaed5('0x24');return db[_0xaed5('0x4e')][_0xaed5('0x49')]({'where':{'name':_0x531b36,'userProfileId':_0x237381[_0xaed5('0x4f')]},'raw':!![]})[_0xaed5('0x21')](function(_0x216c39){if(_0x216c39&&_0x216c39[_0xaed5('0x50')]===0x0){return db[_0xaed5('0x25')][_0xaed5('0x4a')]({'name':_0x147ed3[_0xaed5('0x28')],'resourceId':_0x147ed3['id'],'type':_0x216c39[_0xaed5('0x28')],'sectionId':_0x216c39['id']},{})[_0xaed5('0x21')](function(){return _0xa28aeb;});}else{return _0xa28aeb;}})[_0xaed5('0x43')](function(_0x4efafc){logger[_0xaed5('0x26')]('Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s',_0x4efafc);throw _0x4efafc;});}return _0xa28aeb;})['then'](respondWithResult(_0x5a03ad,0xc9))['catch'](handleError(_0x5a03ad,null));};exports[_0xaed5('0x20')]=function(_0x479008,_0x31fc9c){if(_0x479008[_0xaed5('0x51')]['id']){delete _0x479008[_0xaed5('0x51')]['id'];}return db[_0xaed5('0x2b')][_0xaed5('0x49')]({'where':{'id':_0x479008[_0xaed5('0x45')]['id']}})[_0xaed5('0x21')](handleEntityNotFound(_0x31fc9c,null))[_0xaed5('0x21')](saveUpdates(_0x479008[_0xaed5('0x51')],null))[_0xaed5('0x21')](respondWithResult(_0x31fc9c,null))[_0xaed5('0x43')](handleError(_0x31fc9c,null));};exports['destroy']=function(_0x221190,_0x448971){return db['Template'][_0xaed5('0x49')]({'where':{'id':_0x221190[_0xaed5('0x45')]['id']}})[_0xaed5('0x21')](handleEntityNotFound(_0x448971,null))[_0xaed5('0x21')](removeEntity(_0x448971,null))[_0xaed5('0x43')](handleError(_0x448971,null));};
\ No newline at end of file
+var _0xa4ab=['status','json','count','offset','limit','set','apply','reject','update','then','destroy','Templates','UserProfileResource','error','stack','name','send','map','rawAttributes','fieldName','type','key','model','query','keys','intersection','attributes','fields','length','hasOwnProperty','order','sort','where','filters','pick','filter','merge','options','Template','includeAll','include','findAll','rows','catch','show','params','find','body','get','Unable\x20to\x20retrieve\x20the\x20current\x20user','role','user','UserProfileSection','userProfileId','autoAssociation','create','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','moment','mustache','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/utils','../../mysqldb','sendStatus','end'];(function(_0x17caca,_0x2bc731){var _0x1d9b18=function(_0x1c7190){while(--_0x1c7190){_0x17caca['push'](_0x17caca['shift']());}};_0x1d9b18(++_0x2bc731);}(_0xa4ab,0x8d));var _0xba4a=function(_0x4f3242,_0x391954){_0x4f3242=_0x4f3242-0x0;var _0x49844f=_0xa4ab[_0x4f3242];return _0x49844f;};'use strict';var pdf=require('html-pdf');var emlformat=require(_0xba4a('0x0'));var rimraf=require(_0xba4a('0x1'));var zipdir=require(_0xba4a('0x2'));var jsonpatch=require(_0xba4a('0x3'));var rp=require(_0xba4a('0x4'));var moment=require(_0xba4a('0x5'));var BPromise=require('bluebird');var Mustache=require(_0xba4a('0x6'));var util=require('util');var path=require(_0xba4a('0x7'));var sox=require(_0xba4a('0x8'));var csv=require(_0xba4a('0x9'));var ejs=require(_0xba4a('0xa'));var fs=require('fs');var _=require('lodash');var squel=require(_0xba4a('0xb'));var crypto=require(_0xba4a('0xc'));var jsforce=require(_0xba4a('0xd'));var deskjs=require(_0xba4a('0xe'));var toCsv=require(_0xba4a('0x9'));var querystring=require(_0xba4a('0xf'));var Papa=require(_0xba4a('0x10'));var Redis=require(_0xba4a('0x11'));var authService=require(_0xba4a('0x12'));var qs=require(_0xba4a('0x13'));var as=require(_0xba4a('0x14'));var hardwareService=require('../../config/license/hardware');var logger=require(_0xba4a('0x15'))(_0xba4a('0x16'));var utils=require(_0xba4a('0x17'));var config=require('../../config/environment');var db=require(_0xba4a('0x18'))['db'];function respondWithStatusCode(_0x4e29ba,_0x408bd3){_0x408bd3=_0x408bd3||0xcc;return function(_0x172b13){if(_0x172b13){return _0x4e29ba[_0xba4a('0x19')](_0x408bd3);}return _0x4e29ba['status'](_0x408bd3)[_0xba4a('0x1a')]();};}function respondWithResult(_0x1ac3ba,_0x5be6cb){_0x5be6cb=_0x5be6cb||0xc8;return function(_0x4404b7){if(_0x4404b7){return _0x1ac3ba[_0xba4a('0x1b')](_0x5be6cb)[_0xba4a('0x1c')](_0x4404b7);}};}function respondWithFilteredResult(_0x26200d,_0x1c71e0){return function(_0x2af42e){if(_0x2af42e){var _0x1a2c21=_0x2af42e[_0xba4a('0x1d')],_0x3e95b2=_0x1c71e0[_0xba4a('0x1e')],_0x3567de=_0x1c71e0[_0xba4a('0x1e')]+_0x1c71e0[_0xba4a('0x1f')],_0x3a3c13;if(_0x3567de>=_0x1a2c21){_0x3567de=_0x1a2c21;_0x3a3c13=0xc8;}else{_0x3a3c13=0xce;}_0x26200d[_0xba4a('0x1b')](_0x3a3c13);return _0x26200d[_0xba4a('0x20')]('Content-Range',_0x3e95b2+'-'+_0x3567de+'/'+_0x1a2c21)[_0xba4a('0x1c')](_0x2af42e);}return null;};}function patchUpdates(_0x4d92b5){return function(_0x6c8d03){try{jsonpatch[_0xba4a('0x21')](_0x6c8d03,_0x4d92b5,!![]);}catch(_0x52510a){return BPromise[_0xba4a('0x22')](_0x52510a);}return _0x6c8d03['save']();};}function saveUpdates(_0x3416ea,_0x11c966){return function(_0x5aeb14){if(_0x5aeb14){return _0x5aeb14[_0xba4a('0x23')](_0x3416ea)[_0xba4a('0x24')](function(_0x10ade2){return _0x10ade2;});}return null;};}function removeEntity(_0xb63e25,_0x869714){return function(_0x1dba60){if(_0x1dba60){return _0x1dba60[_0xba4a('0x25')]()['then'](function(){var _0x316e5c=_0x1dba60['get']({'plain':!![]});var _0x4d8b5e=_0xba4a('0x26');return db[_0xba4a('0x27')][_0xba4a('0x25')]({'where':{'type':_0x4d8b5e,'resourceId':_0x316e5c['id']}})['then'](function(){return _0x1dba60;});})['then'](function(){_0xb63e25[_0xba4a('0x1b')](0xcc)[_0xba4a('0x1a')]();});}};}function handleEntityNotFound(_0x16bcf3,_0x1f41bd){return function(_0x243ccc){if(!_0x243ccc){_0x16bcf3[_0xba4a('0x19')](0x194);}return _0x243ccc;};}function handleError(_0x2fc768,_0x2e7399){_0x2e7399=_0x2e7399||0x1f4;return function(_0x2ad155){logger[_0xba4a('0x28')](_0x2ad155[_0xba4a('0x29')]);if(_0x2ad155[_0xba4a('0x2a')]){delete _0x2ad155['name'];}_0x2fc768[_0xba4a('0x1b')](_0x2e7399)[_0xba4a('0x2b')](_0x2ad155);};}exports['index']=function(_0x42f4c1,_0x567670){var _0x1c1bc0={},_0x160d87={},_0x3f0486={'count':0x0,'rows':[]};var _0x166e1e=_[_0xba4a('0x2c')](db['Template'][_0xba4a('0x2d')],function(_0x46d02e){return{'name':_0x46d02e[_0xba4a('0x2e')],'type':_0x46d02e[_0xba4a('0x2f')][_0xba4a('0x30')]};});_0x160d87[_0xba4a('0x31')]=_['map'](_0x166e1e,'name');_0x160d87[_0xba4a('0x32')]=_[_0xba4a('0x33')](_0x42f4c1[_0xba4a('0x32')]);_0x160d87['filters']=_[_0xba4a('0x34')](_0x160d87['model'],_0x160d87[_0xba4a('0x32')]);_0x1c1bc0[_0xba4a('0x35')]=_[_0xba4a('0x34')](_0x160d87[_0xba4a('0x31')],qs[_0xba4a('0x36')](_0x42f4c1[_0xba4a('0x32')][_0xba4a('0x36')]));_0x1c1bc0[_0xba4a('0x35')]=_0x1c1bc0[_0xba4a('0x35')][_0xba4a('0x37')]?_0x1c1bc0[_0xba4a('0x35')]:_0x160d87[_0xba4a('0x31')];if(!_0x42f4c1[_0xba4a('0x32')][_0xba4a('0x38')]('nolimit')){_0x1c1bc0[_0xba4a('0x1f')]=qs[_0xba4a('0x1f')](_0x42f4c1['query'][_0xba4a('0x1f')]);_0x1c1bc0[_0xba4a('0x1e')]=qs[_0xba4a('0x1e')](_0x42f4c1['query'][_0xba4a('0x1e')]);}_0x1c1bc0[_0xba4a('0x39')]=qs[_0xba4a('0x3a')](_0x42f4c1['query'][_0xba4a('0x3a')]);_0x1c1bc0[_0xba4a('0x3b')]=qs[_0xba4a('0x3c')](_[_0xba4a('0x3d')](_0x42f4c1['query'],_0x160d87['filters']));if(_0x42f4c1[_0xba4a('0x32')][_0xba4a('0x3e')]){_0x1c1bc0[_0xba4a('0x3b')]=_[_0xba4a('0x3f')](_0x1c1bc0[_0xba4a('0x3b')],{'$or':_['map'](_0x166e1e,function(_0x2de212){if(_0x2de212[_0xba4a('0x2f')]!=='VIRTUAL'){var _0x2a551a={};_0x2a551a[_0x2de212[_0xba4a('0x2a')]]={'$like':'%'+_0x42f4c1[_0xba4a('0x32')][_0xba4a('0x3e')]+'%'};return _0x2a551a;}})});}_0x1c1bc0=_[_0xba4a('0x3f')]({},_0x1c1bc0,_0x42f4c1[_0xba4a('0x40')]);var _0x1ae585={'where':_0x1c1bc0[_0xba4a('0x3b')]};return db[_0xba4a('0x41')][_0xba4a('0x1d')](_0x1ae585)[_0xba4a('0x24')](function(_0x1687b9){_0x3f0486['count']=_0x1687b9;if(_0x42f4c1[_0xba4a('0x32')][_0xba4a('0x42')]){_0x1c1bc0[_0xba4a('0x43')]=[{'all':!![]}];}return db[_0xba4a('0x41')][_0xba4a('0x44')](_0x1c1bc0);})['then'](function(_0x2fdee6){_0x3f0486[_0xba4a('0x45')]=_0x2fdee6;return _0x3f0486;})[_0xba4a('0x24')](respondWithFilteredResult(_0x567670,_0x1c1bc0))[_0xba4a('0x46')](handleError(_0x567670,null));};exports[_0xba4a('0x47')]=function(_0x1088c3,_0x58f98e){var _0xce7821={'raw':!![],'where':{'id':_0x1088c3[_0xba4a('0x48')]['id']}},_0x745f09={};_0x745f09[_0xba4a('0x31')]=_[_0xba4a('0x33')](db[_0xba4a('0x41')][_0xba4a('0x2d')]);_0x745f09[_0xba4a('0x32')]=_['keys'](_0x1088c3['query']);_0x745f09['filters']=_[_0xba4a('0x34')](_0x745f09['model'],_0x745f09[_0xba4a('0x32')]);_0xce7821[_0xba4a('0x35')]=_[_0xba4a('0x34')](_0x745f09[_0xba4a('0x31')],qs['fields'](_0x1088c3[_0xba4a('0x32')]['fields']));_0xce7821['attributes']=_0xce7821['attributes'][_0xba4a('0x37')]?_0xce7821[_0xba4a('0x35')]:_0x745f09[_0xba4a('0x31')];if(_0x1088c3[_0xba4a('0x32')][_0xba4a('0x42')]){_0xce7821[_0xba4a('0x43')]=[{'all':!![]}];}_0xce7821=_['merge']({},_0xce7821,_0x1088c3[_0xba4a('0x40')]);return db[_0xba4a('0x41')][_0xba4a('0x49')](_0xce7821)[_0xba4a('0x24')](handleEntityNotFound(_0x58f98e,null))[_0xba4a('0x24')](respondWithResult(_0x58f98e,null))[_0xba4a('0x46')](handleError(_0x58f98e,null));};exports['create']=function(_0x41e5ec,_0x1a0bf7){return db[_0xba4a('0x41')]['create'](_0x41e5ec[_0xba4a('0x4a')],{})[_0xba4a('0x24')](function(_0x5cd5cf){var _0x57a4f6=_0x41e5ec['user'][_0xba4a('0x4b')]({'plain':!![]});if(!_0x57a4f6)throw new Error(_0xba4a('0x4c'));if(_0x57a4f6[_0xba4a('0x4d')]===_0xba4a('0x4e')){var _0xcfcc92=_0x5cd5cf[_0xba4a('0x4b')]({'plain':!![]});var _0x1daadf=_0xba4a('0x26');return db[_0xba4a('0x4f')]['find']({'where':{'name':_0x1daadf,'userProfileId':_0x57a4f6[_0xba4a('0x50')]},'raw':!![]})[_0xba4a('0x24')](function(_0x225ce3){if(_0x225ce3&&_0x225ce3[_0xba4a('0x51')]===0x0){return db[_0xba4a('0x27')][_0xba4a('0x52')]({'name':_0xcfcc92[_0xba4a('0x2a')],'resourceId':_0xcfcc92['id'],'type':_0x225ce3[_0xba4a('0x2a')],'sectionId':_0x225ce3['id']},{})['then'](function(){return _0x5cd5cf;});}else{return _0x5cd5cf;}})[_0xba4a('0x46')](function(_0x317420){logger[_0xba4a('0x28')](_0xba4a('0x53'),_0x317420);throw _0x317420;});}return _0x5cd5cf;})[_0xba4a('0x24')](respondWithResult(_0x1a0bf7,0xc9))[_0xba4a('0x46')](handleError(_0x1a0bf7,null));};exports[_0xba4a('0x23')]=function(_0x5120f3,_0x5320ff){if(_0x5120f3[_0xba4a('0x4a')]['id']){delete _0x5120f3[_0xba4a('0x4a')]['id'];}return db[_0xba4a('0x41')][_0xba4a('0x49')]({'where':{'id':_0x5120f3[_0xba4a('0x48')]['id']}})[_0xba4a('0x24')](handleEntityNotFound(_0x5320ff,null))['then'](saveUpdates(_0x5120f3[_0xba4a('0x4a')],null))[_0xba4a('0x24')](respondWithResult(_0x5320ff,null))[_0xba4a('0x46')](handleError(_0x5320ff,null));};exports[_0xba4a('0x25')]=function(_0x153f26,_0x476ea1){return db['Template'][_0xba4a('0x49')]({'where':{'id':_0x153f26[_0xba4a('0x48')]['id']}})[_0xba4a('0x24')](handleEntityNotFound(_0x476ea1,null))[_0xba4a('0x24')](removeEntity(_0x476ea1,null))[_0xba4a('0x46')](handleError(_0x476ea1,null));};
\ No newline at end of file
diff --git a/server/api/template/template.model.js b/server/api/template/template.model.js
index 4216d4a..dec10f7 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 _0x4552=['request-promise','path','rimraf','../../config/environment','./template.attributes','exports','define','Template','lodash','util','../../config/logger','api','bluebird'];(function(_0x443547,_0x21d7a8){var _0x1423a8=function(_0x2f8d47){while(--_0x2f8d47){_0x443547['push'](_0x443547['shift']());}};_0x1423a8(++_0x21d7a8);}(_0x4552,0xff));var _0x2455=function(_0x28994f,_0xcfdec9){_0x28994f=_0x28994f-0x0;var _0x3c590f=_0x4552[_0x28994f];return _0x3c590f;};'use strict';var _=require(_0x2455('0x0'));var util=require(_0x2455('0x1'));var logger=require(_0x2455('0x2'))(_0x2455('0x3'));var moment=require('moment');var BPromise=require(_0x2455('0x4'));var rp=require(_0x2455('0x5'));var fs=require('fs');var path=require(_0x2455('0x6'));var rimraf=require(_0x2455('0x7'));var config=require(_0x2455('0x8'));var attributes=require(_0x2455('0x9'));module[_0x2455('0xa')]=function(_0x5cb50a,_0x8ad0c){return _0x5cb50a[_0x2455('0xb')](_0x2455('0xc'),attributes,{'tableName':'tools_templates','paranoid':![],'indexes':[],'timestamps':!![]});};
\ No newline at end of file
+var _0x06f9=['request-promise','path','rimraf','./template.attributes','Template','tools_templates','util','../../config/logger','moment','bluebird'];(function(_0x2c3c8e,_0x4330df){var _0x41debd=function(_0x474ba1){while(--_0x474ba1){_0x2c3c8e['push'](_0x2c3c8e['shift']());}};_0x41debd(++_0x4330df);}(_0x06f9,0x1dc));var _0x906f=function(_0x50a0c2,_0x4befab){_0x50a0c2=_0x50a0c2-0x0;var _0x5ebadd=_0x06f9[_0x50a0c2];return _0x5ebadd;};'use strict';var _=require('lodash');var util=require(_0x906f('0x0'));var logger=require(_0x906f('0x1'))('api');var moment=require(_0x906f('0x2'));var BPromise=require(_0x906f('0x3'));var rp=require(_0x906f('0x4'));var fs=require('fs');var path=require(_0x906f('0x5'));var rimraf=require(_0x906f('0x6'));var config=require('../../config/environment');var attributes=require(_0x906f('0x7'));module['exports']=function(_0x21e114,_0x372b18){return _0x21e114['define'](_0x906f('0x8'),attributes,{'tableName':_0x906f('0x9'),'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 6b1f009..79cc9e2 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 _0xb123=['GetTemplate','Template','findAll','options','raw','attributes','include','map','model','stringify','lodash','moment','bluebird','ioredis','../../config/utils','../../config/logger','rpc','../../config/environment','client','request','info','Template,\x20%s,\x20%s','request\x20sent','debug','error','code','message','result','catch'];(function(_0xa016f6,_0x3a8863){var _0x313949=function(_0x570eeb){while(--_0x570eeb){_0xa016f6['push'](_0xa016f6['shift']());}};_0x313949(++_0x3a8863);}(_0xb123,0xd5));var _0x3b12=function(_0xf55e73,_0x3fecc5){_0xf55e73=_0xf55e73-0x0;var _0x116b99=_0xb123[_0xf55e73];return _0x116b99;};'use strict';var _=require(_0x3b12('0x0'));var util=require('util');var moment=require(_0x3b12('0x1'));var BPromise=require(_0x3b12('0x2'));var rs=require('randomstring');var fs=require('fs');var Redis=require(_0x3b12('0x3'));var db=require('../../mysqldb')['db'];var utils=require(_0x3b12('0x4'));var logger=require(_0x3b12('0x5'))(_0x3b12('0x6'));var config=require(_0x3b12('0x7'));var jayson=require('jayson/promise');var client=jayson[_0x3b12('0x8')]['http']({'port':0x232a});function respondWithRpcPromise(_0x3359ba,_0x30c900,_0x875f3c){return new BPromise(function(_0x29fad8,_0xe0c048){return client[_0x3b12('0x9')](_0x3359ba,_0x875f3c)['then'](function(_0x1c23c6){logger[_0x3b12('0xa')](_0x3b12('0xb'),_0x30c900,_0x3b12('0xc'));logger[_0x3b12('0xd')]('Template,\x20%s,\x20%s,\x20%s',_0x30c900,_0x3b12('0xc'),JSON['stringify'](_0x1c23c6));if(_0x1c23c6[_0x3b12('0xe')]){if(_0x1c23c6['error'][_0x3b12('0xf')]===0x1f4){logger[_0x3b12('0xe')](_0x3b12('0xb'),_0x30c900,_0x1c23c6[_0x3b12('0xe')][_0x3b12('0x10')]);return _0xe0c048(_0x1c23c6['error'][_0x3b12('0x10')]);}logger[_0x3b12('0xe')](_0x3b12('0xb'),_0x30c900,_0x1c23c6['error'][_0x3b12('0x10')]);return _0x29fad8(_0x1c23c6[_0x3b12('0xe')][_0x3b12('0x10')]);}else{logger[_0x3b12('0xa')](_0x3b12('0xb'),_0x30c900,_0x3b12('0xc'));_0x29fad8(_0x1c23c6[_0x3b12('0x11')][_0x3b12('0x10')]);}})[_0x3b12('0x12')](function(_0x2f0cc4){logger[_0x3b12('0xe')](_0x3b12('0xb'),_0x30c900,_0x2f0cc4);_0xe0c048(_0x2f0cc4);});});}exports[_0x3b12('0x13')]=function(_0x1f9a0e){var _0x50b180=this;return new Promise(function(_0x4f18ba,_0x4db4a1){return db[_0x3b12('0x14')][_0x3b12('0x15')]({'raw':_0x1f9a0e[_0x3b12('0x16')]?_0x1f9a0e[_0x3b12('0x16')][_0x3b12('0x17')]===undefined?!![]:![]:!![],'where':_0x1f9a0e[_0x3b12('0x16')]?_0x1f9a0e[_0x3b12('0x16')]['where']||null:null,'attributes':_0x1f9a0e[_0x3b12('0x16')]?_0x1f9a0e[_0x3b12('0x16')][_0x3b12('0x18')]||null:null,'limit':_0x1f9a0e[_0x3b12('0x16')]?_0x1f9a0e[_0x3b12('0x16')]['limit']||null:null,'include':_0x1f9a0e[_0x3b12('0x16')]?_0x1f9a0e['options'][_0x3b12('0x19')]?_[_0x3b12('0x1a')](_0x1f9a0e['options'][_0x3b12('0x19')],function(_0x1f0cf9){return{'model':db[_0x1f0cf9[_0x3b12('0x1b')]],'as':_0x1f0cf9['as'],'attributes':_0x1f0cf9[_0x3b12('0x18')],'include':_0x1f0cf9['include']?_[_0x3b12('0x1a')](_0x1f0cf9[_0x3b12('0x19')],function(_0x31f8f2){return{'model':db[_0x31f8f2[_0x3b12('0x1b')]],'as':_0x31f8f2['as'],'attributes':_0x31f8f2['attributes'],'include':_0x31f8f2[_0x3b12('0x19')]?_[_0x3b12('0x1a')](_0x31f8f2[_0x3b12('0x19')],function(_0x31ade3){return{'model':db[_0x31ade3[_0x3b12('0x1b')]],'as':_0x31ade3['as'],'attributes':_0x31ade3['attributes']};}):[]};}):[]};}):[]:[]})['then'](function(_0x4c6bc2){logger[_0x3b12('0xa')](_0x3b12('0x13'),_0x1f9a0e);logger[_0x3b12('0xd')](_0x3b12('0x13'),_0x1f9a0e,JSON[_0x3b12('0x1c')](_0x4c6bc2));_0x4f18ba(_0x4c6bc2);})[_0x3b12('0x12')](function(_0x339e3b){logger[_0x3b12('0xe')](_0x3b12('0x13'),_0x339e3b[_0x3b12('0x10')],_0x1f9a0e);_0x4db4a1(_0x50b180[_0x3b12('0xe')](0x1f4,_0x339e3b['message']));});});};
\ No newline at end of file
+var _0x1b30=['result','catch','GetTemplate','Template','findAll','options','raw','where','attributes','limit','include','map','model','lodash','util','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','rpc','../../config/environment','jayson/promise','http','request','then','info','Template,\x20%s,\x20%s','debug','Template,\x20%s,\x20%s,\x20%s','request\x20sent','stringify','error','code','message'];(function(_0x2cd0c0,_0x2aa090){var _0x4cacc9=function(_0x28820b){while(--_0x28820b){_0x2cd0c0['push'](_0x2cd0c0['shift']());}};_0x4cacc9(++_0x2aa090);}(_0x1b30,0x199));var _0x01b3=function(_0x4f0bca,_0x4aeac0){_0x4f0bca=_0x4f0bca-0x0;var _0x39be11=_0x1b30[_0x4f0bca];return _0x39be11;};'use strict';var _=require(_0x01b3('0x0'));var util=require(_0x01b3('0x1'));var moment=require(_0x01b3('0x2'));var BPromise=require(_0x01b3('0x3'));var rs=require(_0x01b3('0x4'));var fs=require('fs');var Redis=require(_0x01b3('0x5'));var db=require(_0x01b3('0x6'))['db'];var utils=require(_0x01b3('0x7'));var logger=require('../../config/logger')(_0x01b3('0x8'));var config=require(_0x01b3('0x9'));var jayson=require(_0x01b3('0xa'));var client=jayson['client'][_0x01b3('0xb')]({'port':0x232a});function respondWithRpcPromise(_0x17e241,_0x3ae346,_0x2e998c){return new BPromise(function(_0x1bacfc,_0x4ed3f2){return client[_0x01b3('0xc')](_0x17e241,_0x2e998c)[_0x01b3('0xd')](function(_0x49e180){logger[_0x01b3('0xe')](_0x01b3('0xf'),_0x3ae346,'request\x20sent');logger[_0x01b3('0x10')](_0x01b3('0x11'),_0x3ae346,_0x01b3('0x12'),JSON[_0x01b3('0x13')](_0x49e180));if(_0x49e180[_0x01b3('0x14')]){if(_0x49e180[_0x01b3('0x14')][_0x01b3('0x15')]===0x1f4){logger[_0x01b3('0x14')](_0x01b3('0xf'),_0x3ae346,_0x49e180[_0x01b3('0x14')][_0x01b3('0x16')]);return _0x4ed3f2(_0x49e180['error'][_0x01b3('0x16')]);}logger[_0x01b3('0x14')](_0x01b3('0xf'),_0x3ae346,_0x49e180[_0x01b3('0x14')][_0x01b3('0x16')]);return _0x1bacfc(_0x49e180['error'][_0x01b3('0x16')]);}else{logger[_0x01b3('0xe')](_0x01b3('0xf'),_0x3ae346,_0x01b3('0x12'));_0x1bacfc(_0x49e180[_0x01b3('0x17')]['message']);}})[_0x01b3('0x18')](function(_0x27ce7d){logger[_0x01b3('0x14')](_0x01b3('0xf'),_0x3ae346,_0x27ce7d);_0x4ed3f2(_0x27ce7d);});});}exports[_0x01b3('0x19')]=function(_0x4032b4){var _0x417b1b=this;return new Promise(function(_0x40acb0,_0x58588b){return db[_0x01b3('0x1a')][_0x01b3('0x1b')]({'raw':_0x4032b4[_0x01b3('0x1c')]?_0x4032b4[_0x01b3('0x1c')][_0x01b3('0x1d')]===undefined?!![]:![]:!![],'where':_0x4032b4['options']?_0x4032b4[_0x01b3('0x1c')][_0x01b3('0x1e')]||null:null,'attributes':_0x4032b4['options']?_0x4032b4[_0x01b3('0x1c')][_0x01b3('0x1f')]||null:null,'limit':_0x4032b4[_0x01b3('0x1c')]?_0x4032b4[_0x01b3('0x1c')][_0x01b3('0x20')]||null:null,'include':_0x4032b4[_0x01b3('0x1c')]?_0x4032b4[_0x01b3('0x1c')][_0x01b3('0x21')]?_[_0x01b3('0x22')](_0x4032b4['options']['include'],function(_0x4a6324){return{'model':db[_0x4a6324[_0x01b3('0x23')]],'as':_0x4a6324['as'],'attributes':_0x4a6324['attributes'],'include':_0x4a6324[_0x01b3('0x21')]?_['map'](_0x4a6324[_0x01b3('0x21')],function(_0x22e5c7){return{'model':db[_0x22e5c7[_0x01b3('0x23')]],'as':_0x22e5c7['as'],'attributes':_0x22e5c7[_0x01b3('0x1f')],'include':_0x22e5c7[_0x01b3('0x21')]?_['map'](_0x22e5c7[_0x01b3('0x21')],function(_0x1ea17e){return{'model':db[_0x1ea17e[_0x01b3('0x23')]],'as':_0x1ea17e['as'],'attributes':_0x1ea17e[_0x01b3('0x1f')]};}):[]};}):[]};}):[]:[]})['then'](function(_0x14f892){logger[_0x01b3('0xe')]('GetTemplate',_0x4032b4);logger['debug']('GetTemplate',_0x4032b4,JSON['stringify'](_0x14f892));_0x40acb0(_0x14f892);})[_0x01b3('0x18')](function(_0x142c11){logger['error']('GetTemplate',_0x142c11[_0x01b3('0x16')],_0x4032b4);_0x58588b(_0x417b1b[_0x01b3('0x14')](0x1f4,_0x142c11['message']));});});};
\ No newline at end of file
diff --git a/server/api/trigger/index.js b/server/api/trigger/index.js
index b5dec0f..912d40d 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 _0x8272=['../../components/interaction/service','./trigger.controller','get','isAuthenticated','show','getAnyConditions','/:id/actions','getActions','create','/:id/all_conditions','post','addAction','/:id','update','destroy','exports','multer','util','path','connect-timeout','Router'];(function(_0x53e888,_0x8a491){var _0x10d581=function(_0x4a6e5b){while(--_0x4a6e5b){_0x53e888['push'](_0x53e888['shift']());}};_0x10d581(++_0x8a491);}(_0x8272,0x8e));var _0x2827=function(_0x46242d,_0x1b08eb){_0x46242d=_0x46242d-0x0;var _0x142654=_0x8272[_0x46242d];return _0x142654;};'use strict';var multer=require(_0x2827('0x0'));var util=require(_0x2827('0x1'));var path=require(_0x2827('0x2'));var timeout=require(_0x2827('0x3'));var express=require('express');var router=express[_0x2827('0x4')]();var auth=require('../../components/auth/service');var interaction=require(_0x2827('0x5'));var config=require('../../config/environment');var controller=require(_0x2827('0x6'));router['get']('/',auth['isAuthenticated'](),controller['index']);router[_0x2827('0x7')]('/:id',auth[_0x2827('0x8')](),controller[_0x2827('0x9')]);router['get']('/:id/all_conditions',auth[_0x2827('0x8')](),controller['getAllConditions']);router['get']('/:id/any_conditions',auth[_0x2827('0x8')](),controller[_0x2827('0xa')]);router[_0x2827('0x7')](_0x2827('0xb'),auth['isAuthenticated'](),controller[_0x2827('0xc')]);router['post']('/',auth['isAuthenticated'](),controller[_0x2827('0xd')]);router['post'](_0x2827('0xe'),auth['isAuthenticated'](),controller['addAllCondition']);router['post']('/:id/any_conditions',auth[_0x2827('0x8')](),controller['addAnyCondition']);router[_0x2827('0xf')]('/:id/actions',auth[_0x2827('0x8')](),controller[_0x2827('0x10')]);router['put'](_0x2827('0x11'),auth[_0x2827('0x8')](),controller[_0x2827('0x12')]);router['delete']('/:id',auth[_0x2827('0x8')](),controller[_0x2827('0x13')]);module[_0x2827('0x14')]=router;
\ No newline at end of file
+var _0xa805=['../../components/auth/service','../../config/environment','./trigger.controller','get','isAuthenticated','index','/:id','getAllConditions','/:id/any_conditions','getAnyConditions','getActions','post','/:id/all_conditions','addAllCondition','addAnyCondition','/:id/actions','addAction','update','delete','destroy','exports','multer','path','express','Router'];(function(_0x4c02ad,_0x49e293){var _0x158889=function(_0x5649d9){while(--_0x5649d9){_0x4c02ad['push'](_0x4c02ad['shift']());}};_0x158889(++_0x49e293);}(_0xa805,0x79));var _0x5a80=function(_0x387c44,_0x5c8a93){_0x387c44=_0x387c44-0x0;var _0x74fe0e=_0xa805[_0x387c44];return _0x74fe0e;};'use strict';var multer=require(_0x5a80('0x0'));var util=require('util');var path=require(_0x5a80('0x1'));var timeout=require('connect-timeout');var express=require(_0x5a80('0x2'));var router=express[_0x5a80('0x3')]();var auth=require(_0x5a80('0x4'));var interaction=require('../../components/interaction/service');var config=require(_0x5a80('0x5'));var controller=require(_0x5a80('0x6'));router[_0x5a80('0x7')]('/',auth[_0x5a80('0x8')](),controller[_0x5a80('0x9')]);router[_0x5a80('0x7')](_0x5a80('0xa'),auth[_0x5a80('0x8')](),controller['show']);router[_0x5a80('0x7')]('/:id/all_conditions',auth[_0x5a80('0x8')](),controller[_0x5a80('0xb')]);router['get'](_0x5a80('0xc'),auth[_0x5a80('0x8')](),controller[_0x5a80('0xd')]);router[_0x5a80('0x7')]('/:id/actions',auth['isAuthenticated'](),controller[_0x5a80('0xe')]);router[_0x5a80('0xf')]('/',auth['isAuthenticated'](),controller['create']);router['post'](_0x5a80('0x10'),auth[_0x5a80('0x8')](),controller[_0x5a80('0x11')]);router[_0x5a80('0xf')](_0x5a80('0xc'),auth[_0x5a80('0x8')](),controller[_0x5a80('0x12')]);router[_0x5a80('0xf')](_0x5a80('0x13'),auth[_0x5a80('0x8')](),controller[_0x5a80('0x14')]);router['put'](_0x5a80('0xa'),auth[_0x5a80('0x8')](),controller[_0x5a80('0x15')]);router[_0x5a80('0x16')]('/:id',auth[_0x5a80('0x8')](),controller[_0x5a80('0x17')]);module[_0x5a80('0x18')]=router;
\ No newline at end of file
diff --git a/server/api/trigger/trigger.attributes.js b/server/api/trigger/trigger.attributes.js
index 5eb6091..67ca10a 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 _0x1a86=['STRING','exports'];(function(_0xec074c,_0x9a77f3){var _0x183aa3=function(_0x18e133){while(--_0x18e133){_0xec074c['push'](_0xec074c['shift']());}};_0x183aa3(++_0x9a77f3);}(_0x1a86,0x1d9));var _0x61a8=function(_0x3ba44e,_0x31ef0d){_0x3ba44e=_0x3ba44e-0x0;var _0x4b4653=_0x1a86[_0x3ba44e];return _0x4b4653;};'use strict';var Sequelize=require('sequelize');module[_0x61a8('0x0')]={'name':{'type':Sequelize[_0x61a8('0x1')]},'channel':{'type':Sequelize[_0x61a8('0x1')]},'description':{'type':Sequelize['STRING']},'status':{'type':Sequelize['BOOLEAN'],'defaultValue':![]}};
\ No newline at end of file
+var _0xcccf=['BOOLEAN','sequelize','STRING'];(function(_0x376f71,_0x384413){var _0x12b30c=function(_0x18c2c3){while(--_0x18c2c3){_0x376f71['push'](_0x376f71['shift']());}};_0x12b30c(++_0x384413);}(_0xcccf,0x6a));var _0xfccc=function(_0x2b8e73,_0x29fec6){_0x2b8e73=_0x2b8e73-0x0;var _0x14fdfd=_0xcccf[_0x2b8e73];return _0x14fdfd;};'use strict';var Sequelize=require(_0xfccc('0x0'));module['exports']={'name':{'type':Sequelize[_0xfccc('0x1')]},'channel':{'type':Sequelize[_0xfccc('0x1')]},'description':{'type':Sequelize[_0xfccc('0x1')]},'status':{'type':Sequelize[_0xfccc('0x2')],'defaultValue':![]}};
\ No newline at end of file
diff --git a/server/api/trigger/trigger.controller.js b/server/api/trigger/trigger.controller.js
index 65da877..82957b7 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 _0x246b=['addAllCondition','Condition','TriggerAnyId','getAllConditions','findOne','hasOwnProperty','getAnyConditions','addAction','Action','getActions','html-pdf','eml-format','rimraf','zip-dir','fast-json-patch','moment','bluebird','mustache','util','to-csv','ejs','lodash','desk.js','querystring','papaparse','../../components/auth/service','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/environment','../../mysqldb','sendStatus','end','status','json','count','offset','limit','Content-Range','apply','reject','save','update','then','destroy','Triggers','error','name','send','index','Trigger','fieldName','type','model','map','keys','query','filters','intersection','attributes','fields','length','nolimit','order','sort','pick','filter','merge','where','options','includeAll','findAll','rows','catch','show','params','rawAttributes','include','find','create','body','user','get','Unable\x20to\x20retrieve\x20the\x20current\x20user','role','UserProfileSection','autoAssociation','UserProfileResource','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s'];(function(_0x287daf,_0x183d33){var _0x3a9326=function(_0x4d2cfa){while(--_0x4d2cfa){_0x287daf['push'](_0x287daf['shift']());}};_0x3a9326(++_0x183d33);}(_0x246b,0x176));var _0xb246=function(_0x261b9d,_0x23ce5d){_0x261b9d=_0x261b9d-0x0;var _0x5a2132=_0x246b[_0x261b9d];return _0x5a2132;};'use strict';var pdf=require(_0xb246('0x0'));var emlformat=require(_0xb246('0x1'));var rimraf=require(_0xb246('0x2'));var zipdir=require(_0xb246('0x3'));var jsonpatch=require(_0xb246('0x4'));var rp=require('request-promise');var moment=require(_0xb246('0x5'));var BPromise=require(_0xb246('0x6'));var Mustache=require(_0xb246('0x7'));var util=require(_0xb246('0x8'));var path=require('path');var sox=require('sox');var csv=require(_0xb246('0x9'));var ejs=require(_0xb246('0xa'));var fs=require('fs');var _=require(_0xb246('0xb'));var squel=require('squel');var crypto=require('crypto');var jsforce=require('jsforce');var deskjs=require(_0xb246('0xc'));var toCsv=require('to-csv');var querystring=require(_0xb246('0xd'));var Papa=require(_0xb246('0xe'));var Redis=require('ioredis');var authService=require(_0xb246('0xf'));var qs=require('../../components/parsers/qs');var as=require(_0xb246('0x10'));var hardwareService=require(_0xb246('0x11'));var logger=require(_0xb246('0x12'))(_0xb246('0x13'));var utils=require(_0xb246('0x14'));var config=require(_0xb246('0x15'));var db=require(_0xb246('0x16'))['db'];function respondWithStatusCode(_0x4b5102,_0x3e7010){_0x3e7010=_0x3e7010||0xcc;return function(_0x5b9fa8){if(_0x5b9fa8){return _0x4b5102[_0xb246('0x17')](_0x3e7010);}return _0x4b5102['status'](_0x3e7010)[_0xb246('0x18')]();};}function respondWithResult(_0x382fd8,_0x410d33){_0x410d33=_0x410d33||0xc8;return function(_0x36691f){if(_0x36691f){return _0x382fd8[_0xb246('0x19')](_0x410d33)[_0xb246('0x1a')](_0x36691f);}};}function respondWithFilteredResult(_0x10aafa,_0x1b4a88){return function(_0x2329a9){if(_0x2329a9){var _0x4082e9=_0x2329a9[_0xb246('0x1b')],_0x136db6=_0x1b4a88['offset'],_0xc09749=_0x1b4a88[_0xb246('0x1c')]+_0x1b4a88[_0xb246('0x1d')],_0x42a5aa;if(_0xc09749>=_0x4082e9){_0xc09749=_0x4082e9;_0x42a5aa=0xc8;}else{_0x42a5aa=0xce;}_0x10aafa[_0xb246('0x19')](_0x42a5aa);return _0x10aafa['set'](_0xb246('0x1e'),_0x136db6+'-'+_0xc09749+'/'+_0x4082e9)['json'](_0x2329a9);}return null;};}function patchUpdates(_0x1759a4){return function(_0x5303b9){try{jsonpatch[_0xb246('0x1f')](_0x5303b9,_0x1759a4,!![]);}catch(_0x20fc61){return BPromise[_0xb246('0x20')](_0x20fc61);}return _0x5303b9[_0xb246('0x21')]();};}function saveUpdates(_0x5c28c7,_0x3f85dd){return function(_0x5dd8c1){if(_0x5dd8c1){return _0x5dd8c1[_0xb246('0x22')](_0x5c28c7)[_0xb246('0x23')](function(_0x31a8ae){return _0x31a8ae;});}return null;};}function removeEntity(_0x21ba55,_0x4f50d5){return function(_0x29bac0){if(_0x29bac0){return _0x29bac0[_0xb246('0x24')]()[_0xb246('0x23')](function(){var _0x102d31=_0x29bac0['get']({'plain':!![]});var _0x4f4bdf=_0xb246('0x25');return db['UserProfileResource'][_0xb246('0x24')]({'where':{'type':_0x4f4bdf,'resourceId':_0x102d31['id']}})[_0xb246('0x23')](function(){return _0x29bac0;});})['then'](function(){_0x21ba55[_0xb246('0x19')](0xcc)[_0xb246('0x18')]();});}};}function handleEntityNotFound(_0x1bd13e,_0x365a4d){return function(_0x52933a){if(!_0x52933a){_0x1bd13e['sendStatus'](0x194);}return _0x52933a;};}function handleError(_0x5d4a32,_0x17d5d1){_0x17d5d1=_0x17d5d1||0x1f4;return function(_0x3ec695){logger[_0xb246('0x26')](_0x3ec695['stack']);if(_0x3ec695['name']){delete _0x3ec695[_0xb246('0x27')];}_0x5d4a32[_0xb246('0x19')](_0x17d5d1)[_0xb246('0x28')](_0x3ec695);};}exports[_0xb246('0x29')]=function(_0xafb0aa,_0x24c3d8){var _0x1ce36f={},_0x2410fc={},_0x2dce59={'count':0x0,'rows':[]};var _0x309fea=_['map'](db[_0xb246('0x2a')]['rawAttributes'],function(_0x1bfa06){return{'name':_0x1bfa06[_0xb246('0x2b')],'type':_0x1bfa06[_0xb246('0x2c')]['key']};});_0x2410fc[_0xb246('0x2d')]=_[_0xb246('0x2e')](_0x309fea,'name');_0x2410fc['query']=_[_0xb246('0x2f')](_0xafb0aa[_0xb246('0x30')]);_0x2410fc[_0xb246('0x31')]=_[_0xb246('0x32')](_0x2410fc[_0xb246('0x2d')],_0x2410fc[_0xb246('0x30')]);_0x1ce36f[_0xb246('0x33')]=_['intersection'](_0x2410fc[_0xb246('0x2d')],qs[_0xb246('0x34')](_0xafb0aa[_0xb246('0x30')][_0xb246('0x34')]));_0x1ce36f[_0xb246('0x33')]=_0x1ce36f['attributes'][_0xb246('0x35')]?_0x1ce36f[_0xb246('0x33')]:_0x2410fc[_0xb246('0x2d')];if(!_0xafb0aa[_0xb246('0x30')]['hasOwnProperty'](_0xb246('0x36'))){_0x1ce36f[_0xb246('0x1d')]=qs[_0xb246('0x1d')](_0xafb0aa[_0xb246('0x30')][_0xb246('0x1d')]);_0x1ce36f[_0xb246('0x1c')]=qs['offset'](_0xafb0aa['query'][_0xb246('0x1c')]);}_0x1ce36f[_0xb246('0x37')]=qs[_0xb246('0x38')](_0xafb0aa[_0xb246('0x30')][_0xb246('0x38')]);_0x1ce36f['where']=qs[_0xb246('0x31')](_[_0xb246('0x39')](_0xafb0aa['query'],_0x2410fc[_0xb246('0x31')]));if(_0xafb0aa['query'][_0xb246('0x3a')]){_0x1ce36f['where']=_[_0xb246('0x3b')](_0x1ce36f[_0xb246('0x3c')],{'$or':_[_0xb246('0x2e')](_0x309fea,function(_0x5e4821){if(_0x5e4821[_0xb246('0x2c')]!=='VIRTUAL'){var _0x111e30={};_0x111e30[_0x5e4821[_0xb246('0x27')]]={'$like':'%'+_0xafb0aa[_0xb246('0x30')]['filter']+'%'};return _0x111e30;}})});}_0x1ce36f=_[_0xb246('0x3b')]({},_0x1ce36f,_0xafb0aa[_0xb246('0x3d')]);var _0x30f0c4={'where':_0x1ce36f[_0xb246('0x3c')]};return db[_0xb246('0x2a')][_0xb246('0x1b')](_0x30f0c4)['then'](function(_0x19f325){_0x2dce59[_0xb246('0x1b')]=_0x19f325;if(_0xafb0aa['query'][_0xb246('0x3e')]){_0x1ce36f['include']=[{'all':!![]}];}return db[_0xb246('0x2a')][_0xb246('0x3f')](_0x1ce36f);})[_0xb246('0x23')](function(_0x5eafc9){_0x2dce59[_0xb246('0x40')]=_0x5eafc9;return _0x2dce59;})[_0xb246('0x23')](respondWithFilteredResult(_0x24c3d8,_0x1ce36f))[_0xb246('0x41')](handleError(_0x24c3d8,null));};exports[_0xb246('0x42')]=function(_0x54c910,_0x195916){var _0x24a08e={'raw':![],'where':{'id':_0x54c910[_0xb246('0x43')]['id']}},_0xc9fc12={};_0xc9fc12[_0xb246('0x2d')]=_[_0xb246('0x2f')](db[_0xb246('0x2a')][_0xb246('0x44')]);_0xc9fc12[_0xb246('0x30')]=_[_0xb246('0x2f')](_0x54c910[_0xb246('0x30')]);_0xc9fc12['filters']=_[_0xb246('0x32')](_0xc9fc12[_0xb246('0x2d')],_0xc9fc12['query']);_0x24a08e[_0xb246('0x33')]=_[_0xb246('0x32')](_0xc9fc12[_0xb246('0x2d')],qs[_0xb246('0x34')](_0x54c910[_0xb246('0x30')][_0xb246('0x34')]));_0x24a08e['attributes']=_0x24a08e[_0xb246('0x33')][_0xb246('0x35')]?_0x24a08e['attributes']:_0xc9fc12['model'];if(_0x54c910['query'][_0xb246('0x3e')]){_0x24a08e[_0xb246('0x45')]=[{'all':!![]}];}_0x24a08e=_[_0xb246('0x3b')]({},_0x24a08e,_0x54c910[_0xb246('0x3d')]);return db[_0xb246('0x2a')][_0xb246('0x46')](_0x24a08e)[_0xb246('0x23')](handleEntityNotFound(_0x195916,null))[_0xb246('0x23')](respondWithResult(_0x195916,null))[_0xb246('0x41')](handleError(_0x195916,null));};exports[_0xb246('0x47')]=function(_0x43a4ea,_0x31443c){return db[_0xb246('0x2a')][_0xb246('0x47')](_0x43a4ea[_0xb246('0x48')],{})['then'](function(_0x1ad16a){var _0x332aae=_0x43a4ea[_0xb246('0x49')][_0xb246('0x4a')]({'plain':!![]});if(!_0x332aae)throw new Error(_0xb246('0x4b'));if(_0x332aae[_0xb246('0x4c')]==='user'){var _0x256760=_0x1ad16a[_0xb246('0x4a')]({'plain':!![]});var _0x494a44='Triggers';return db[_0xb246('0x4d')]['find']({'where':{'name':_0x494a44,'userProfileId':_0x332aae['userProfileId']},'raw':!![]})[_0xb246('0x23')](function(_0x332190){if(_0x332190&&_0x332190[_0xb246('0x4e')]===0x0){return db[_0xb246('0x4f')][_0xb246('0x47')]({'name':_0x256760['name'],'resourceId':_0x256760['id'],'type':_0x332190[_0xb246('0x27')],'sectionId':_0x332190['id']},{})[_0xb246('0x23')](function(){return _0x1ad16a;});}else{return _0x1ad16a;}})[_0xb246('0x41')](function(_0x1ac164){logger['error'](_0xb246('0x50'),_0x1ac164);throw _0x1ac164;});}return _0x1ad16a;})[_0xb246('0x23')](respondWithResult(_0x31443c,0xc9))[_0xb246('0x41')](handleError(_0x31443c,null));};exports[_0xb246('0x22')]=function(_0x551157,_0x49e7b3){if(_0x551157[_0xb246('0x48')]['id']){delete _0x551157[_0xb246('0x48')]['id'];}return db[_0xb246('0x2a')][_0xb246('0x46')]({'where':{'id':_0x551157[_0xb246('0x43')]['id']}})[_0xb246('0x23')](handleEntityNotFound(_0x49e7b3,null))[_0xb246('0x23')](saveUpdates(_0x551157[_0xb246('0x48')],null))[_0xb246('0x23')](respondWithResult(_0x49e7b3,null))[_0xb246('0x41')](handleError(_0x49e7b3,null));};exports[_0xb246('0x24')]=function(_0x2bf3ce,_0x501869){return db[_0xb246('0x2a')][_0xb246('0x46')]({'where':{'id':_0x2bf3ce[_0xb246('0x43')]['id']}})[_0xb246('0x23')](handleEntityNotFound(_0x501869,null))[_0xb246('0x23')](removeEntity(_0x501869,null))[_0xb246('0x41')](handleError(_0x501869,null));};exports[_0xb246('0x51')]=function(_0x520714,_0x585361,_0x50c28d){if(_0x520714[_0xb246('0x48')]['id']){delete _0x520714['body']['id'];}return db[_0xb246('0x2a')][_0xb246('0x46')]({'where':{'id':_0x520714[_0xb246('0x43')]['id']}})[_0xb246('0x23')](handleEntityNotFound(_0x585361,null))['then'](function(_0x1ce70b){if(_0x1ce70b){_0x520714[_0xb246('0x48')]['TriggerAllId']=_0x1ce70b['id'];return db[_0xb246('0x52')][_0xb246('0x47')](_0x520714[_0xb246('0x48')]);}})[_0xb246('0x23')](respondWithResult(_0x585361,null))[_0xb246('0x41')](handleError(_0x585361,null));};exports['addAnyCondition']=function(_0xb6e93a,_0x9db27a,_0x3b5fc8){if(_0xb6e93a['body']['id']){delete _0xb6e93a['body']['id'];}return db[_0xb246('0x2a')][_0xb246('0x46')]({'where':{'id':_0xb6e93a[_0xb246('0x43')]['id']}})[_0xb246('0x23')](handleEntityNotFound(_0x9db27a,null))['then'](function(_0x1b645c){if(_0x1b645c){_0xb6e93a[_0xb246('0x48')][_0xb246('0x53')]=_0x1b645c['id'];return db[_0xb246('0x52')][_0xb246('0x47')](_0xb6e93a[_0xb246('0x48')]);}})['then'](respondWithResult(_0x9db27a,null))[_0xb246('0x41')](handleError(_0x9db27a,null));};exports[_0xb246('0x54')]=function(_0x4f7f68,_0x5b8dc7,_0x12c7ef){var _0x1cc805={};var _0x2f990e={};var _0x13f29e;var _0x5c4414;return db['Trigger'][_0xb246('0x55')]({'where':{'id':_0x4f7f68[_0xb246('0x43')]['id']}})[_0xb246('0x23')](handleEntityNotFound(_0x5b8dc7,null))['then'](function(_0x1bb34a){if(_0x1bb34a){_0x13f29e=_0x1bb34a;_0x2f990e[_0xb246('0x2d')]=_[_0xb246('0x2f')](db[_0xb246('0x52')][_0xb246('0x44')]);_0x2f990e[_0xb246('0x30')]=_[_0xb246('0x2f')](_0x4f7f68[_0xb246('0x30')]);_0x2f990e[_0xb246('0x31')]=_[_0xb246('0x32')](_0x2f990e[_0xb246('0x2d')],_0x2f990e[_0xb246('0x30')]);_0x1cc805[_0xb246('0x33')]=_['intersection'](_0x2f990e['model'],qs[_0xb246('0x34')](_0x4f7f68[_0xb246('0x30')][_0xb246('0x34')]));_0x1cc805[_0xb246('0x33')]=_0x1cc805['attributes'][_0xb246('0x35')]?_0x1cc805[_0xb246('0x33')]:_0x2f990e[_0xb246('0x2d')];_0x1cc805[_0xb246('0x37')]=qs[_0xb246('0x38')](_0x4f7f68['query']['sort']);_0x1cc805['where']=qs[_0xb246('0x31')](_[_0xb246('0x39')](_0x4f7f68[_0xb246('0x30')],_0x2f990e['filters']));if(_0x4f7f68[_0xb246('0x30')][_0xb246('0x3a')]){_0x1cc805[_0xb246('0x3c')]=_[_0xb246('0x3b')](_0x1cc805['where'],{'$or':_[_0xb246('0x2e')](_0x1cc805['attributes'],function(_0x38e691){var _0x53e028={};_0x53e028[_0x38e691]={'$like':'%'+_0x4f7f68[_0xb246('0x30')][_0xb246('0x3a')]+'%'};return _0x53e028;})});}_0x1cc805=_['merge']({},_0x1cc805,_0x4f7f68[_0xb246('0x3d')]);return _0x13f29e['getAllConditions'](_0x1cc805);}})[_0xb246('0x23')](function(_0x1e4ee5){if(_0x1e4ee5){_0x5c4414=_0x1e4ee5[_0xb246('0x35')];if(!_0x4f7f68[_0xb246('0x30')][_0xb246('0x56')](_0xb246('0x36'))){_0x1cc805['limit']=qs['limit'](_0x4f7f68[_0xb246('0x30')]['limit']);_0x1cc805[_0xb246('0x1c')]=qs[_0xb246('0x1c')](_0x4f7f68[_0xb246('0x30')][_0xb246('0x1c')]);}return _0x13f29e[_0xb246('0x54')](_0x1cc805);}})[_0xb246('0x23')](function(_0x5f24e9){if(_0x5f24e9){return _0x5f24e9?{'count':_0x5c4414,'rows':_0x5f24e9}:null;}})[_0xb246('0x23')](respondWithResult(_0x5b8dc7,null))[_0xb246('0x41')](handleError(_0x5b8dc7,null));};exports['getAnyConditions']=function(_0xf6d988,_0x5754a1,_0x2ea7f1){var _0x5834e7={};var _0x453f3c={};var _0x1b2f82;var _0x24fab1;return db[_0xb246('0x2a')]['findOne']({'where':{'id':_0xf6d988['params']['id']}})[_0xb246('0x23')](handleEntityNotFound(_0x5754a1,null))['then'](function(_0x70f3a3){if(_0x70f3a3){_0x1b2f82=_0x70f3a3;_0x453f3c['model']=_[_0xb246('0x2f')](db[_0xb246('0x52')][_0xb246('0x44')]);_0x453f3c[_0xb246('0x30')]=_[_0xb246('0x2f')](_0xf6d988[_0xb246('0x30')]);_0x453f3c[_0xb246('0x31')]=_['intersection'](_0x453f3c[_0xb246('0x2d')],_0x453f3c['query']);_0x5834e7[_0xb246('0x33')]=_[_0xb246('0x32')](_0x453f3c[_0xb246('0x2d')],qs[_0xb246('0x34')](_0xf6d988[_0xb246('0x30')][_0xb246('0x34')]));_0x5834e7[_0xb246('0x33')]=_0x5834e7['attributes'][_0xb246('0x35')]?_0x5834e7[_0xb246('0x33')]:_0x453f3c['model'];_0x5834e7['order']=qs[_0xb246('0x38')](_0xf6d988['query'][_0xb246('0x38')]);_0x5834e7[_0xb246('0x3c')]=qs[_0xb246('0x31')](_[_0xb246('0x39')](_0xf6d988[_0xb246('0x30')],_0x453f3c[_0xb246('0x31')]));if(_0xf6d988['query']['filter']){_0x5834e7['where']=_[_0xb246('0x3b')](_0x5834e7[_0xb246('0x3c')],{'$or':_[_0xb246('0x2e')](_0x5834e7[_0xb246('0x33')],function(_0x4c80dc){var _0x628583={};_0x628583[_0x4c80dc]={'$like':'%'+_0xf6d988[_0xb246('0x30')][_0xb246('0x3a')]+'%'};return _0x628583;})});}_0x5834e7=_[_0xb246('0x3b')]({},_0x5834e7,_0xf6d988[_0xb246('0x3d')]);return _0x1b2f82['getAnyConditions'](_0x5834e7);}})[_0xb246('0x23')](function(_0x1f3990){if(_0x1f3990){_0x24fab1=_0x1f3990['length'];if(!_0xf6d988[_0xb246('0x30')][_0xb246('0x56')]('nolimit')){_0x5834e7[_0xb246('0x1d')]=qs[_0xb246('0x1d')](_0xf6d988[_0xb246('0x30')]['limit']);_0x5834e7[_0xb246('0x1c')]=qs[_0xb246('0x1c')](_0xf6d988[_0xb246('0x30')][_0xb246('0x1c')]);}return _0x1b2f82[_0xb246('0x57')](_0x5834e7);}})['then'](function(_0x505d36){if(_0x505d36){return _0x505d36?{'count':_0x24fab1,'rows':_0x505d36}:null;}})[_0xb246('0x23')](respondWithResult(_0x5754a1,null))[_0xb246('0x41')](handleError(_0x5754a1,null));};exports[_0xb246('0x58')]=function(_0x1890d6,_0x46981a,_0x5c1782){if(_0x1890d6['body']['id']){delete _0x1890d6[_0xb246('0x48')]['id'];}return db[_0xb246('0x2a')][_0xb246('0x46')]({'where':{'id':_0x1890d6[_0xb246('0x43')]['id']}})[_0xb246('0x23')](handleEntityNotFound(_0x46981a,null))['then'](function(_0xfa6c51){if(_0xfa6c51){_0x1890d6['body']['TriggerId']=_0xfa6c51['id'];return db[_0xb246('0x59')][_0xb246('0x47')](_0x1890d6[_0xb246('0x48')]);}})[_0xb246('0x23')](respondWithResult(_0x46981a,null))['catch'](handleError(_0x46981a,null));};exports['getActions']=function(_0x45e479,_0x5ee983,_0x1b0f0){var _0x3029d6={};var _0x59e6cf={};var _0x45e8ef;var _0x4e76dc;return db[_0xb246('0x2a')][_0xb246('0x55')]({'where':{'id':_0x45e479[_0xb246('0x43')]['id']}})[_0xb246('0x23')](handleEntityNotFound(_0x5ee983,null))[_0xb246('0x23')](function(_0x32a324){if(_0x32a324){_0x45e8ef=_0x32a324;_0x59e6cf[_0xb246('0x2d')]=_[_0xb246('0x2f')](db['Action'][_0xb246('0x44')]);_0x59e6cf[_0xb246('0x30')]=_[_0xb246('0x2f')](_0x45e479['query']);_0x59e6cf[_0xb246('0x31')]=_[_0xb246('0x32')](_0x59e6cf[_0xb246('0x2d')],_0x59e6cf[_0xb246('0x30')]);_0x3029d6[_0xb246('0x33')]=_[_0xb246('0x32')](_0x59e6cf[_0xb246('0x2d')],qs['fields'](_0x45e479[_0xb246('0x30')][_0xb246('0x34')]));_0x3029d6[_0xb246('0x33')]=_0x3029d6[_0xb246('0x33')][_0xb246('0x35')]?_0x3029d6[_0xb246('0x33')]:_0x59e6cf[_0xb246('0x2d')];_0x3029d6[_0xb246('0x37')]=qs['sort'](_0x45e479[_0xb246('0x30')]['sort']);_0x3029d6[_0xb246('0x3c')]=qs[_0xb246('0x31')](_[_0xb246('0x39')](_0x45e479[_0xb246('0x30')],_0x59e6cf['filters']));if(_0x45e479[_0xb246('0x30')][_0xb246('0x3a')]){_0x3029d6[_0xb246('0x3c')]=_[_0xb246('0x3b')](_0x3029d6[_0xb246('0x3c')],{'$or':_[_0xb246('0x2e')](_0x3029d6[_0xb246('0x33')],function(_0x17fbff){var _0x5864cf={};_0x5864cf[_0x17fbff]={'$like':'%'+_0x45e479['query'][_0xb246('0x3a')]+'%'};return _0x5864cf;})});}_0x3029d6=_['merge']({},_0x3029d6,_0x45e479[_0xb246('0x3d')]);return _0x45e8ef['getActions'](_0x3029d6);}})[_0xb246('0x23')](function(_0x12da91){if(_0x12da91){_0x4e76dc=_0x12da91[_0xb246('0x35')];if(!_0x45e479[_0xb246('0x30')][_0xb246('0x56')](_0xb246('0x36'))){_0x3029d6[_0xb246('0x1d')]=qs[_0xb246('0x1d')](_0x45e479[_0xb246('0x30')][_0xb246('0x1d')]);_0x3029d6['offset']=qs[_0xb246('0x1c')](_0x45e479[_0xb246('0x30')][_0xb246('0x1c')]);}return _0x45e8ef[_0xb246('0x5a')](_0x3029d6);}})['then'](function(_0x1ea878){if(_0x1ea878){return _0x1ea878?{'count':_0x4e76dc,'rows':_0x1ea878}:null;}})[_0xb246('0x23')](respondWithResult(_0x5ee983,null))[_0xb246('0x41')](handleError(_0x5ee983,null));};
\ No newline at end of file
+var _0x314f=['moment','bluebird','path','sox','to-csv','lodash','jsforce','desk.js','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/environment','../../mysqldb','status','json','offset','limit','set','apply','reject','save','update','then','destroy','get','UserProfileResource','end','sendStatus','error','stack','name','send','Trigger','rawAttributes','fieldName','type','key','model','map','query','keys','filters','intersection','fields','length','attributes','hasOwnProperty','nolimit','order','sort','where','filter','count','includeAll','include','findAll','rows','catch','show','params','merge','options','create','body','Unable\x20to\x20retrieve\x20the\x20current\x20user','user','UserProfileSection','find','userProfileId','autoAssociation','addAllCondition','TriggerAllId','Condition','addAnyCondition','TriggerAnyId','findOne','pick','getAllConditions','getAnyConditions','addAction','Action','getActions','html-pdf','eml-format','rimraf','zip-dir','fast-json-patch','request-promise'];(function(_0x2b3188,_0x50205a){var _0x103783=function(_0x21fac7){while(--_0x21fac7){_0x2b3188['push'](_0x2b3188['shift']());}};_0x103783(++_0x50205a);}(_0x314f,0x114));var _0xf314=function(_0x4e01c9,_0x43cca6){_0x4e01c9=_0x4e01c9-0x0;var _0x26979f=_0x314f[_0x4e01c9];return _0x26979f;};'use strict';var pdf=require(_0xf314('0x0'));var emlformat=require(_0xf314('0x1'));var rimraf=require(_0xf314('0x2'));var zipdir=require(_0xf314('0x3'));var jsonpatch=require(_0xf314('0x4'));var rp=require(_0xf314('0x5'));var moment=require(_0xf314('0x6'));var BPromise=require(_0xf314('0x7'));var Mustache=require('mustache');var util=require('util');var path=require(_0xf314('0x8'));var sox=require(_0xf314('0x9'));var csv=require(_0xf314('0xa'));var ejs=require('ejs');var fs=require('fs');var _=require(_0xf314('0xb'));var squel=require('squel');var crypto=require('crypto');var jsforce=require(_0xf314('0xc'));var deskjs=require(_0xf314('0xd'));var toCsv=require(_0xf314('0xa'));var querystring=require(_0xf314('0xe'));var Papa=require(_0xf314('0xf'));var Redis=require(_0xf314('0x10'));var authService=require(_0xf314('0x11'));var qs=require('../../components/parsers/qs');var as=require(_0xf314('0x12'));var hardwareService=require(_0xf314('0x13'));var logger=require(_0xf314('0x14'))(_0xf314('0x15'));var utils=require(_0xf314('0x16'));var config=require(_0xf314('0x17'));var db=require(_0xf314('0x18'))['db'];function respondWithStatusCode(_0x475332,_0x2ff587){_0x2ff587=_0x2ff587||0xcc;return function(_0x1686ea){if(_0x1686ea){return _0x475332['sendStatus'](_0x2ff587);}return _0x475332[_0xf314('0x19')](_0x2ff587)['end']();};}function respondWithResult(_0xf6d85d,_0x14123b){_0x14123b=_0x14123b||0xc8;return function(_0x56e180){if(_0x56e180){return _0xf6d85d[_0xf314('0x19')](_0x14123b)[_0xf314('0x1a')](_0x56e180);}};}function respondWithFilteredResult(_0x50afff,_0xf8c2d7){return function(_0x3468d2){if(_0x3468d2){var _0x5f3443=_0x3468d2['count'],_0x2c3481=_0xf8c2d7[_0xf314('0x1b')],_0x3b2a88=_0xf8c2d7['offset']+_0xf8c2d7[_0xf314('0x1c')],_0x5b492f;if(_0x3b2a88>=_0x5f3443){_0x3b2a88=_0x5f3443;_0x5b492f=0xc8;}else{_0x5b492f=0xce;}_0x50afff[_0xf314('0x19')](_0x5b492f);return _0x50afff[_0xf314('0x1d')]('Content-Range',_0x2c3481+'-'+_0x3b2a88+'/'+_0x5f3443)[_0xf314('0x1a')](_0x3468d2);}return null;};}function patchUpdates(_0x4dd658){return function(_0x3284f6){try{jsonpatch[_0xf314('0x1e')](_0x3284f6,_0x4dd658,!![]);}catch(_0x564aec){return BPromise[_0xf314('0x1f')](_0x564aec);}return _0x3284f6[_0xf314('0x20')]();};}function saveUpdates(_0x38af8a,_0x5aa370){return function(_0x47deab){if(_0x47deab){return _0x47deab[_0xf314('0x21')](_0x38af8a)[_0xf314('0x22')](function(_0x597548){return _0x597548;});}return null;};}function removeEntity(_0x4eea85,_0x547e13){return function(_0x15251e){if(_0x15251e){return _0x15251e[_0xf314('0x23')]()[_0xf314('0x22')](function(){var _0x23d769=_0x15251e[_0xf314('0x24')]({'plain':!![]});var _0x4025da='Triggers';return db[_0xf314('0x25')][_0xf314('0x23')]({'where':{'type':_0x4025da,'resourceId':_0x23d769['id']}})[_0xf314('0x22')](function(){return _0x15251e;});})[_0xf314('0x22')](function(){_0x4eea85[_0xf314('0x19')](0xcc)[_0xf314('0x26')]();});}};}function handleEntityNotFound(_0x5b91de,_0x2fcb5f){return function(_0x3d9297){if(!_0x3d9297){_0x5b91de[_0xf314('0x27')](0x194);}return _0x3d9297;};}function handleError(_0x2b2b8a,_0x3ae30c){_0x3ae30c=_0x3ae30c||0x1f4;return function(_0x434f37){logger[_0xf314('0x28')](_0x434f37[_0xf314('0x29')]);if(_0x434f37[_0xf314('0x2a')]){delete _0x434f37[_0xf314('0x2a')];}_0x2b2b8a['status'](_0x3ae30c)[_0xf314('0x2b')](_0x434f37);};}exports['index']=function(_0x4da23a,_0x7473cb){var _0x1d1b2f={},_0x351969={},_0xc7d305={'count':0x0,'rows':[]};var _0x4bc0e5=_['map'](db[_0xf314('0x2c')][_0xf314('0x2d')],function(_0x319dad){return{'name':_0x319dad[_0xf314('0x2e')],'type':_0x319dad[_0xf314('0x2f')][_0xf314('0x30')]};});_0x351969[_0xf314('0x31')]=_[_0xf314('0x32')](_0x4bc0e5,_0xf314('0x2a'));_0x351969[_0xf314('0x33')]=_[_0xf314('0x34')](_0x4da23a[_0xf314('0x33')]);_0x351969[_0xf314('0x35')]=_[_0xf314('0x36')](_0x351969[_0xf314('0x31')],_0x351969[_0xf314('0x33')]);_0x1d1b2f['attributes']=_[_0xf314('0x36')](_0x351969[_0xf314('0x31')],qs[_0xf314('0x37')](_0x4da23a[_0xf314('0x33')][_0xf314('0x37')]));_0x1d1b2f['attributes']=_0x1d1b2f['attributes'][_0xf314('0x38')]?_0x1d1b2f[_0xf314('0x39')]:_0x351969[_0xf314('0x31')];if(!_0x4da23a[_0xf314('0x33')][_0xf314('0x3a')](_0xf314('0x3b'))){_0x1d1b2f['limit']=qs[_0xf314('0x1c')](_0x4da23a['query']['limit']);_0x1d1b2f[_0xf314('0x1b')]=qs[_0xf314('0x1b')](_0x4da23a[_0xf314('0x33')][_0xf314('0x1b')]);}_0x1d1b2f[_0xf314('0x3c')]=qs[_0xf314('0x3d')](_0x4da23a['query'][_0xf314('0x3d')]);_0x1d1b2f[_0xf314('0x3e')]=qs[_0xf314('0x35')](_['pick'](_0x4da23a[_0xf314('0x33')],_0x351969['filters']));if(_0x4da23a[_0xf314('0x33')][_0xf314('0x3f')]){_0x1d1b2f[_0xf314('0x3e')]=_['merge'](_0x1d1b2f[_0xf314('0x3e')],{'$or':_[_0xf314('0x32')](_0x4bc0e5,function(_0x13ec72){if(_0x13ec72[_0xf314('0x2f')]!=='VIRTUAL'){var _0x1e8745={};_0x1e8745[_0x13ec72['name']]={'$like':'%'+_0x4da23a[_0xf314('0x33')][_0xf314('0x3f')]+'%'};return _0x1e8745;}})});}_0x1d1b2f=_['merge']({},_0x1d1b2f,_0x4da23a['options']);var _0x2ca4e8={'where':_0x1d1b2f[_0xf314('0x3e')]};return db[_0xf314('0x2c')][_0xf314('0x40')](_0x2ca4e8)[_0xf314('0x22')](function(_0x386768){_0xc7d305[_0xf314('0x40')]=_0x386768;if(_0x4da23a[_0xf314('0x33')][_0xf314('0x41')]){_0x1d1b2f[_0xf314('0x42')]=[{'all':!![]}];}return db[_0xf314('0x2c')][_0xf314('0x43')](_0x1d1b2f);})['then'](function(_0x3e5b74){_0xc7d305[_0xf314('0x44')]=_0x3e5b74;return _0xc7d305;})[_0xf314('0x22')](respondWithFilteredResult(_0x7473cb,_0x1d1b2f))[_0xf314('0x45')](handleError(_0x7473cb,null));};exports[_0xf314('0x46')]=function(_0x912c98,_0x1b60ef){var _0x4b17c8={'raw':![],'where':{'id':_0x912c98[_0xf314('0x47')]['id']}},_0x21fe76={};_0x21fe76[_0xf314('0x31')]=_['keys'](db[_0xf314('0x2c')][_0xf314('0x2d')]);_0x21fe76['query']=_['keys'](_0x912c98[_0xf314('0x33')]);_0x21fe76[_0xf314('0x35')]=_[_0xf314('0x36')](_0x21fe76[_0xf314('0x31')],_0x21fe76[_0xf314('0x33')]);_0x4b17c8[_0xf314('0x39')]=_[_0xf314('0x36')](_0x21fe76['model'],qs[_0xf314('0x37')](_0x912c98['query'][_0xf314('0x37')]));_0x4b17c8[_0xf314('0x39')]=_0x4b17c8[_0xf314('0x39')][_0xf314('0x38')]?_0x4b17c8[_0xf314('0x39')]:_0x21fe76[_0xf314('0x31')];if(_0x912c98[_0xf314('0x33')][_0xf314('0x41')]){_0x4b17c8[_0xf314('0x42')]=[{'all':!![]}];}_0x4b17c8=_[_0xf314('0x48')]({},_0x4b17c8,_0x912c98[_0xf314('0x49')]);return db[_0xf314('0x2c')]['find'](_0x4b17c8)[_0xf314('0x22')](handleEntityNotFound(_0x1b60ef,null))[_0xf314('0x22')](respondWithResult(_0x1b60ef,null))['catch'](handleError(_0x1b60ef,null));};exports[_0xf314('0x4a')]=function(_0x1d2603,_0x4463c6){return db[_0xf314('0x2c')][_0xf314('0x4a')](_0x1d2603[_0xf314('0x4b')],{})[_0xf314('0x22')](function(_0x1209d2){var _0x2d4c9e=_0x1d2603['user'][_0xf314('0x24')]({'plain':!![]});if(!_0x2d4c9e)throw new Error(_0xf314('0x4c'));if(_0x2d4c9e['role']===_0xf314('0x4d')){var _0x1c1b15=_0x1209d2[_0xf314('0x24')]({'plain':!![]});var _0x41bf65='Triggers';return db[_0xf314('0x4e')][_0xf314('0x4f')]({'where':{'name':_0x41bf65,'userProfileId':_0x2d4c9e[_0xf314('0x50')]},'raw':!![]})[_0xf314('0x22')](function(_0x39a4c4){if(_0x39a4c4&&_0x39a4c4[_0xf314('0x51')]===0x0){return db[_0xf314('0x25')]['create']({'name':_0x1c1b15[_0xf314('0x2a')],'resourceId':_0x1c1b15['id'],'type':_0x39a4c4[_0xf314('0x2a')],'sectionId':_0x39a4c4['id']},{})[_0xf314('0x22')](function(){return _0x1209d2;});}else{return _0x1209d2;}})[_0xf314('0x45')](function(_0x2108e0){logger['error']('Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s',_0x2108e0);throw _0x2108e0;});}return _0x1209d2;})[_0xf314('0x22')](respondWithResult(_0x4463c6,0xc9))['catch'](handleError(_0x4463c6,null));};exports[_0xf314('0x21')]=function(_0x1d49c4,_0x1bea6a){if(_0x1d49c4['body']['id']){delete _0x1d49c4[_0xf314('0x4b')]['id'];}return db[_0xf314('0x2c')][_0xf314('0x4f')]({'where':{'id':_0x1d49c4[_0xf314('0x47')]['id']}})[_0xf314('0x22')](handleEntityNotFound(_0x1bea6a,null))['then'](saveUpdates(_0x1d49c4[_0xf314('0x4b')],null))[_0xf314('0x22')](respondWithResult(_0x1bea6a,null))['catch'](handleError(_0x1bea6a,null));};exports['destroy']=function(_0xcc0a1b,_0x1104ba){return db[_0xf314('0x2c')][_0xf314('0x4f')]({'where':{'id':_0xcc0a1b[_0xf314('0x47')]['id']}})[_0xf314('0x22')](handleEntityNotFound(_0x1104ba,null))[_0xf314('0x22')](removeEntity(_0x1104ba,null))['catch'](handleError(_0x1104ba,null));};exports[_0xf314('0x52')]=function(_0xaf5d4f,_0x1666f0,_0x3cdd06){if(_0xaf5d4f[_0xf314('0x4b')]['id']){delete _0xaf5d4f['body']['id'];}return db[_0xf314('0x2c')]['find']({'where':{'id':_0xaf5d4f[_0xf314('0x47')]['id']}})[_0xf314('0x22')](handleEntityNotFound(_0x1666f0,null))[_0xf314('0x22')](function(_0x1892f8){if(_0x1892f8){_0xaf5d4f[_0xf314('0x4b')][_0xf314('0x53')]=_0x1892f8['id'];return db[_0xf314('0x54')][_0xf314('0x4a')](_0xaf5d4f[_0xf314('0x4b')]);}})['then'](respondWithResult(_0x1666f0,null))[_0xf314('0x45')](handleError(_0x1666f0,null));};exports[_0xf314('0x55')]=function(_0x17126d,_0x321ec5,_0x8951b4){if(_0x17126d['body']['id']){delete _0x17126d[_0xf314('0x4b')]['id'];}return db['Trigger'][_0xf314('0x4f')]({'where':{'id':_0x17126d[_0xf314('0x47')]['id']}})[_0xf314('0x22')](handleEntityNotFound(_0x321ec5,null))[_0xf314('0x22')](function(_0x5a0e16){if(_0x5a0e16){_0x17126d[_0xf314('0x4b')][_0xf314('0x56')]=_0x5a0e16['id'];return db[_0xf314('0x54')]['create'](_0x17126d[_0xf314('0x4b')]);}})[_0xf314('0x22')](respondWithResult(_0x321ec5,null))[_0xf314('0x45')](handleError(_0x321ec5,null));};exports['getAllConditions']=function(_0x5af0a0,_0x1f0c29,_0x3d8acd){var _0x5118d6={};var _0x4d6af4={};var _0x40a7df;var _0x5cd6f4;return db['Trigger'][_0xf314('0x57')]({'where':{'id':_0x5af0a0[_0xf314('0x47')]['id']}})[_0xf314('0x22')](handleEntityNotFound(_0x1f0c29,null))[_0xf314('0x22')](function(_0x53b8ee){if(_0x53b8ee){_0x40a7df=_0x53b8ee;_0x4d6af4['model']=_['keys'](db[_0xf314('0x54')][_0xf314('0x2d')]);_0x4d6af4[_0xf314('0x33')]=_[_0xf314('0x34')](_0x5af0a0[_0xf314('0x33')]);_0x4d6af4[_0xf314('0x35')]=_[_0xf314('0x36')](_0x4d6af4['model'],_0x4d6af4['query']);_0x5118d6[_0xf314('0x39')]=_['intersection'](_0x4d6af4[_0xf314('0x31')],qs['fields'](_0x5af0a0[_0xf314('0x33')][_0xf314('0x37')]));_0x5118d6[_0xf314('0x39')]=_0x5118d6[_0xf314('0x39')]['length']?_0x5118d6[_0xf314('0x39')]:_0x4d6af4['model'];_0x5118d6[_0xf314('0x3c')]=qs[_0xf314('0x3d')](_0x5af0a0[_0xf314('0x33')][_0xf314('0x3d')]);_0x5118d6[_0xf314('0x3e')]=qs[_0xf314('0x35')](_[_0xf314('0x58')](_0x5af0a0[_0xf314('0x33')],_0x4d6af4[_0xf314('0x35')]));if(_0x5af0a0[_0xf314('0x33')][_0xf314('0x3f')]){_0x5118d6[_0xf314('0x3e')]=_[_0xf314('0x48')](_0x5118d6[_0xf314('0x3e')],{'$or':_[_0xf314('0x32')](_0x5118d6['attributes'],function(_0x366045){var _0x44a153={};_0x44a153[_0x366045]={'$like':'%'+_0x5af0a0['query'][_0xf314('0x3f')]+'%'};return _0x44a153;})});}_0x5118d6=_['merge']({},_0x5118d6,_0x5af0a0[_0xf314('0x49')]);return _0x40a7df[_0xf314('0x59')](_0x5118d6);}})['then'](function(_0x30d869){if(_0x30d869){_0x5cd6f4=_0x30d869[_0xf314('0x38')];if(!_0x5af0a0[_0xf314('0x33')]['hasOwnProperty'](_0xf314('0x3b'))){_0x5118d6[_0xf314('0x1c')]=qs[_0xf314('0x1c')](_0x5af0a0[_0xf314('0x33')][_0xf314('0x1c')]);_0x5118d6[_0xf314('0x1b')]=qs['offset'](_0x5af0a0[_0xf314('0x33')][_0xf314('0x1b')]);}return _0x40a7df[_0xf314('0x59')](_0x5118d6);}})[_0xf314('0x22')](function(_0x791afa){if(_0x791afa){return _0x791afa?{'count':_0x5cd6f4,'rows':_0x791afa}:null;}})[_0xf314('0x22')](respondWithResult(_0x1f0c29,null))[_0xf314('0x45')](handleError(_0x1f0c29,null));};exports[_0xf314('0x5a')]=function(_0x5e97b6,_0x30cb05,_0x5965f7){var _0x2ba5fa={};var _0x788e13={};var _0x214963;var _0x17386e;return db[_0xf314('0x2c')][_0xf314('0x57')]({'where':{'id':_0x5e97b6['params']['id']}})['then'](handleEntityNotFound(_0x30cb05,null))[_0xf314('0x22')](function(_0x102c45){if(_0x102c45){_0x214963=_0x102c45;_0x788e13[_0xf314('0x31')]=_[_0xf314('0x34')](db['Condition'][_0xf314('0x2d')]);_0x788e13[_0xf314('0x33')]=_[_0xf314('0x34')](_0x5e97b6[_0xf314('0x33')]);_0x788e13['filters']=_[_0xf314('0x36')](_0x788e13[_0xf314('0x31')],_0x788e13['query']);_0x2ba5fa[_0xf314('0x39')]=_[_0xf314('0x36')](_0x788e13[_0xf314('0x31')],qs['fields'](_0x5e97b6[_0xf314('0x33')]['fields']));_0x2ba5fa[_0xf314('0x39')]=_0x2ba5fa[_0xf314('0x39')][_0xf314('0x38')]?_0x2ba5fa[_0xf314('0x39')]:_0x788e13[_0xf314('0x31')];_0x2ba5fa['order']=qs[_0xf314('0x3d')](_0x5e97b6['query'][_0xf314('0x3d')]);_0x2ba5fa[_0xf314('0x3e')]=qs[_0xf314('0x35')](_[_0xf314('0x58')](_0x5e97b6[_0xf314('0x33')],_0x788e13['filters']));if(_0x5e97b6[_0xf314('0x33')][_0xf314('0x3f')]){_0x2ba5fa['where']=_[_0xf314('0x48')](_0x2ba5fa[_0xf314('0x3e')],{'$or':_[_0xf314('0x32')](_0x2ba5fa[_0xf314('0x39')],function(_0x1362e4){var _0x49f960={};_0x49f960[_0x1362e4]={'$like':'%'+_0x5e97b6[_0xf314('0x33')][_0xf314('0x3f')]+'%'};return _0x49f960;})});}_0x2ba5fa=_[_0xf314('0x48')]({},_0x2ba5fa,_0x5e97b6[_0xf314('0x49')]);return _0x214963[_0xf314('0x5a')](_0x2ba5fa);}})[_0xf314('0x22')](function(_0x483a3c){if(_0x483a3c){_0x17386e=_0x483a3c[_0xf314('0x38')];if(!_0x5e97b6[_0xf314('0x33')]['hasOwnProperty'](_0xf314('0x3b'))){_0x2ba5fa['limit']=qs[_0xf314('0x1c')](_0x5e97b6[_0xf314('0x33')][_0xf314('0x1c')]);_0x2ba5fa['offset']=qs[_0xf314('0x1b')](_0x5e97b6[_0xf314('0x33')][_0xf314('0x1b')]);}return _0x214963[_0xf314('0x5a')](_0x2ba5fa);}})[_0xf314('0x22')](function(_0x2d3629){if(_0x2d3629){return _0x2d3629?{'count':_0x17386e,'rows':_0x2d3629}:null;}})[_0xf314('0x22')](respondWithResult(_0x30cb05,null))['catch'](handleError(_0x30cb05,null));};exports[_0xf314('0x5b')]=function(_0x483b89,_0x200962,_0x55bb24){if(_0x483b89['body']['id']){delete _0x483b89[_0xf314('0x4b')]['id'];}return db[_0xf314('0x2c')][_0xf314('0x4f')]({'where':{'id':_0x483b89['params']['id']}})['then'](handleEntityNotFound(_0x200962,null))[_0xf314('0x22')](function(_0x28e8a1){if(_0x28e8a1){_0x483b89[_0xf314('0x4b')]['TriggerId']=_0x28e8a1['id'];return db[_0xf314('0x5c')][_0xf314('0x4a')](_0x483b89[_0xf314('0x4b')]);}})['then'](respondWithResult(_0x200962,null))['catch'](handleError(_0x200962,null));};exports[_0xf314('0x5d')]=function(_0x132b94,_0x204e5d,_0xa7f238){var _0x44153c={};var _0x1119f1={};var _0xf1ac3a;var _0x564440;return db['Trigger'][_0xf314('0x57')]({'where':{'id':_0x132b94[_0xf314('0x47')]['id']}})[_0xf314('0x22')](handleEntityNotFound(_0x204e5d,null))[_0xf314('0x22')](function(_0x37670a){if(_0x37670a){_0xf1ac3a=_0x37670a;_0x1119f1[_0xf314('0x31')]=_[_0xf314('0x34')](db[_0xf314('0x5c')][_0xf314('0x2d')]);_0x1119f1[_0xf314('0x33')]=_[_0xf314('0x34')](_0x132b94[_0xf314('0x33')]);_0x1119f1[_0xf314('0x35')]=_[_0xf314('0x36')](_0x1119f1['model'],_0x1119f1[_0xf314('0x33')]);_0x44153c[_0xf314('0x39')]=_[_0xf314('0x36')](_0x1119f1['model'],qs['fields'](_0x132b94['query'][_0xf314('0x37')]));_0x44153c[_0xf314('0x39')]=_0x44153c[_0xf314('0x39')][_0xf314('0x38')]?_0x44153c[_0xf314('0x39')]:_0x1119f1['model'];_0x44153c[_0xf314('0x3c')]=qs[_0xf314('0x3d')](_0x132b94[_0xf314('0x33')][_0xf314('0x3d')]);_0x44153c[_0xf314('0x3e')]=qs[_0xf314('0x35')](_['pick'](_0x132b94[_0xf314('0x33')],_0x1119f1['filters']));if(_0x132b94[_0xf314('0x33')][_0xf314('0x3f')]){_0x44153c['where']=_['merge'](_0x44153c[_0xf314('0x3e')],{'$or':_[_0xf314('0x32')](_0x44153c[_0xf314('0x39')],function(_0x15e608){var _0x475136={};_0x475136[_0x15e608]={'$like':'%'+_0x132b94[_0xf314('0x33')][_0xf314('0x3f')]+'%'};return _0x475136;})});}_0x44153c=_['merge']({},_0x44153c,_0x132b94[_0xf314('0x49')]);return _0xf1ac3a[_0xf314('0x5d')](_0x44153c);}})['then'](function(_0x2c1fb7){if(_0x2c1fb7){_0x564440=_0x2c1fb7[_0xf314('0x38')];if(!_0x132b94[_0xf314('0x33')][_0xf314('0x3a')](_0xf314('0x3b'))){_0x44153c[_0xf314('0x1c')]=qs[_0xf314('0x1c')](_0x132b94[_0xf314('0x33')]['limit']);_0x44153c[_0xf314('0x1b')]=qs[_0xf314('0x1b')](_0x132b94['query'][_0xf314('0x1b')]);}return _0xf1ac3a[_0xf314('0x5d')](_0x44153c);}})['then'](function(_0x13b0cc){if(_0x13b0cc){return _0x13b0cc?{'count':_0x564440,'rows':_0x13b0cc}:null;}})['then'](respondWithResult(_0x204e5d,null))['catch'](handleError(_0x204e5d,null));};
\ No newline at end of file
diff --git a/server/api/trigger/trigger.model.js b/server/api/trigger/trigger.model.js
index efd6dae..f75b928 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 _0x048d=['tools_triggers','util','../../config/logger','api','moment','bluebird','request-promise','path','./trigger.attributes','define'];(function(_0x1e510d,_0x290d81){var _0x3c48e7=function(_0x6ed9ff){while(--_0x6ed9ff){_0x1e510d['push'](_0x1e510d['shift']());}};_0x3c48e7(++_0x290d81);}(_0x048d,0x1c3));var _0xd048=function(_0x5b0c6b,_0x47fb73){_0x5b0c6b=_0x5b0c6b-0x0;var _0x1d55a6=_0x048d[_0x5b0c6b];return _0x1d55a6;};'use strict';var _=require('lodash');var util=require(_0xd048('0x0'));var logger=require(_0xd048('0x1'))(_0xd048('0x2'));var moment=require(_0xd048('0x3'));var BPromise=require(_0xd048('0x4'));var rp=require(_0xd048('0x5'));var fs=require('fs');var path=require(_0xd048('0x6'));var rimraf=require('rimraf');var config=require('../../config/environment');var attributes=require(_0xd048('0x7'));module['exports']=function(_0x617ca7,_0x344785){return _0x617ca7[_0xd048('0x8')]('Trigger',attributes,{'tableName':_0xd048('0x9'),'paranoid':![],'indexes':[],'timestamps':!![]});};
\ No newline at end of file
+var _0x4dbf=['Trigger','tools_triggers','lodash','moment','path','./trigger.attributes','exports','define'];(function(_0x1928c9,_0x13a6d1){var _0x51b5fb=function(_0x24cf70){while(--_0x24cf70){_0x1928c9['push'](_0x1928c9['shift']());}};_0x51b5fb(++_0x13a6d1);}(_0x4dbf,0x7a));var _0xf4db=function(_0x4d6bfd,_0x8d79ff){_0x4d6bfd=_0x4d6bfd-0x0;var _0x243a46=_0x4dbf[_0x4d6bfd];return _0x243a46;};'use strict';var _=require(_0xf4db('0x0'));var util=require('util');var logger=require('../../config/logger')('api');var moment=require(_0xf4db('0x1'));var BPromise=require('bluebird');var rp=require('request-promise');var fs=require('fs');var path=require(_0xf4db('0x2'));var rimraf=require('rimraf');var config=require('../../config/environment');var attributes=require(_0xf4db('0x3'));module[_0xf4db('0x4')]=function(_0x5f3d35,_0x3e75fc){return _0x5f3d35[_0xf4db('0x5')](_0xf4db('0x6'),attributes,{'tableName':_0xf4db('0x7'),'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 55682ae..4bdb046 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 _0x4e81=['find','raw','lodash','util','moment','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','request','then','info','request\x20sent','debug','Trigger,\x20%s,\x20%s,\x20%s','stringify','error','code','Trigger,\x20%s,\x20%s','message','catch','GetTrigger','Trigger','findAll','options','where','limit','map','include','model','attributes','ShowTrigger'];(function(_0x20d9c4,_0x5c5f2d){var _0x31decb=function(_0x1d8c86){while(--_0x1d8c86){_0x20d9c4['push'](_0x20d9c4['shift']());}};_0x31decb(++_0x5c5f2d);}(_0x4e81,0x1bc));var _0x14e8=function(_0x5b5cde,_0x1f7c5f){_0x5b5cde=_0x5b5cde-0x0;var _0x364ad2=_0x4e81[_0x5b5cde];return _0x364ad2;};'use strict';var _=require(_0x14e8('0x0'));var util=require(_0x14e8('0x1'));var moment=require(_0x14e8('0x2'));var BPromise=require('bluebird');var rs=require('randomstring');var fs=require('fs');var Redis=require('ioredis');var db=require(_0x14e8('0x3'))['db'];var utils=require(_0x14e8('0x4'));var logger=require(_0x14e8('0x5'))(_0x14e8('0x6'));var config=require(_0x14e8('0x7'));var jayson=require(_0x14e8('0x8'));var client=jayson['client']['http']({'port':0x232a});function respondWithRpcPromise(_0x3e73d2,_0x449fa3,_0x21f860){return new BPromise(function(_0x3c1b93,_0x11ec3b){return client[_0x14e8('0x9')](_0x3e73d2,_0x21f860)[_0x14e8('0xa')](function(_0x1d8402){logger[_0x14e8('0xb')]('Trigger,\x20%s,\x20%s',_0x449fa3,_0x14e8('0xc'));logger[_0x14e8('0xd')](_0x14e8('0xe'),_0x449fa3,_0x14e8('0xc'),JSON[_0x14e8('0xf')](_0x1d8402));if(_0x1d8402[_0x14e8('0x10')]){if(_0x1d8402[_0x14e8('0x10')][_0x14e8('0x11')]===0x1f4){logger['error'](_0x14e8('0x12'),_0x449fa3,_0x1d8402['error'][_0x14e8('0x13')]);return _0x11ec3b(_0x1d8402[_0x14e8('0x10')][_0x14e8('0x13')]);}logger['error'](_0x14e8('0x12'),_0x449fa3,_0x1d8402['error'][_0x14e8('0x13')]);return _0x3c1b93(_0x1d8402['error'][_0x14e8('0x13')]);}else{logger[_0x14e8('0xb')](_0x14e8('0x12'),_0x449fa3,_0x14e8('0xc'));_0x3c1b93(_0x1d8402['result'][_0x14e8('0x13')]);}})[_0x14e8('0x14')](function(_0x30581){logger[_0x14e8('0x10')](_0x14e8('0x12'),_0x449fa3,_0x30581);_0x11ec3b(_0x30581);});});}exports[_0x14e8('0x15')]=function(_0x10dc8b){var _0x462259=this;return new Promise(function(_0x5a38c1,_0x328c5a){return db[_0x14e8('0x16')][_0x14e8('0x17')]({'raw':_0x10dc8b[_0x14e8('0x18')]?_0x10dc8b[_0x14e8('0x18')]['raw']===undefined?!![]:![]:!![],'where':_0x10dc8b[_0x14e8('0x18')]?_0x10dc8b[_0x14e8('0x18')][_0x14e8('0x19')]||null:null,'attributes':_0x10dc8b['options']?_0x10dc8b[_0x14e8('0x18')]['attributes']||null:null,'limit':_0x10dc8b[_0x14e8('0x18')]?_0x10dc8b[_0x14e8('0x18')][_0x14e8('0x1a')]||null:null,'include':_0x10dc8b[_0x14e8('0x18')]?_0x10dc8b[_0x14e8('0x18')]['include']?_[_0x14e8('0x1b')](_0x10dc8b['options'][_0x14e8('0x1c')],function(_0x185a0e){return{'model':db[_0x185a0e['model']],'as':_0x185a0e['as'],'attributes':_0x185a0e['attributes'],'include':_0x185a0e['include']?_[_0x14e8('0x1b')](_0x185a0e[_0x14e8('0x1c')],function(_0x3eae0b){return{'model':db[_0x3eae0b[_0x14e8('0x1d')]],'as':_0x3eae0b['as'],'attributes':_0x3eae0b[_0x14e8('0x1e')],'include':_0x3eae0b['include']?_[_0x14e8('0x1b')](_0x3eae0b[_0x14e8('0x1c')],function(_0x3c09cb){return{'model':db[_0x3c09cb[_0x14e8('0x1d')]],'as':_0x3c09cb['as'],'attributes':_0x3c09cb[_0x14e8('0x1e')]};}):[]};}):[]};}):[]:[]})[_0x14e8('0xa')](function(_0x2813ae){logger['info'](_0x14e8('0x15'),_0x10dc8b);logger[_0x14e8('0xd')](_0x14e8('0x15'),_0x10dc8b,JSON['stringify'](_0x2813ae));_0x5a38c1(_0x2813ae);})['catch'](function(_0x5cacd7){logger[_0x14e8('0x10')](_0x14e8('0x15'),_0x5cacd7['message'],_0x10dc8b);_0x328c5a(_0x462259[_0x14e8('0x10')](0x1f4,_0x5cacd7[_0x14e8('0x13')]));});});};exports[_0x14e8('0x1f')]=function(_0xa83433){var _0x5c2635=this;return new Promise(function(_0x1f1259,_0x260d51){return db[_0x14e8('0x16')][_0x14e8('0x20')]({'raw':_0xa83433[_0x14e8('0x18')]?_0xa83433['options'][_0x14e8('0x21')]===undefined?!![]:![]:!![],'where':_0xa83433[_0x14e8('0x18')]?_0xa83433[_0x14e8('0x18')][_0x14e8('0x19')]||null:null,'attributes':_0xa83433['options']?_0xa83433[_0x14e8('0x18')]['attributes']||null:null,'include':_0xa83433[_0x14e8('0x18')]?_0xa83433[_0x14e8('0x18')][_0x14e8('0x1c')]?_[_0x14e8('0x1b')](_0xa83433[_0x14e8('0x18')][_0x14e8('0x1c')],function(_0xbe9eab){return{'model':db[_0xbe9eab[_0x14e8('0x1d')]],'as':_0xbe9eab['as'],'attributes':_0xbe9eab[_0x14e8('0x1e')],'include':_0xbe9eab[_0x14e8('0x1c')]?_[_0x14e8('0x1b')](_0xbe9eab[_0x14e8('0x1c')],function(_0x54e624){return{'model':db[_0x54e624['model']],'as':_0x54e624['as'],'attributes':_0x54e624['attributes'],'include':_0x54e624[_0x14e8('0x1c')]?_['map'](_0x54e624[_0x14e8('0x1c')],function(_0x5bdf42){return{'model':db[_0x5bdf42[_0x14e8('0x1d')]],'as':_0x5bdf42['as'],'attributes':_0x5bdf42[_0x14e8('0x1e')]};}):[]};}):[]};}):[]:[]})[_0x14e8('0xa')](function(_0x2fc030){logger['info'](_0x14e8('0x1f'),_0xa83433);logger['debug'](_0x14e8('0x1f'),_0xa83433,JSON[_0x14e8('0xf')](_0x2fc030));_0x1f1259(_0x2fc030);})[_0x14e8('0x14')](function(_0x1fda35){logger[_0x14e8('0x10')](_0x14e8('0x1f'),_0x1fda35['message'],_0xa83433);_0x260d51(_0x5c2635[_0x14e8('0x10')](0x1f4,_0x1fda35['message']));});});};
\ No newline at end of file
+var _0x0972=['rpc','../../config/environment','jayson/promise','client','http','request','then','info','Trigger,\x20%s,\x20%s','request\x20sent','debug','Trigger,\x20%s,\x20%s,\x20%s','stringify','error','code','message','GetTrigger','Trigger','findAll','options','raw','attributes','limit','include','map','model','catch','find','where','ShowTrigger','util','bluebird','ioredis','../../mysqldb','../../config/logger'];(function(_0xdfd9c5,_0x4a8422){var _0x53669e=function(_0x425e3a){while(--_0x425e3a){_0xdfd9c5['push'](_0xdfd9c5['shift']());}};_0x53669e(++_0x4a8422);}(_0x0972,0x64));var _0x2097=function(_0x555de1,_0x2133ef){_0x555de1=_0x555de1-0x0;var _0x360a74=_0x0972[_0x555de1];return _0x360a74;};'use strict';var _=require('lodash');var util=require(_0x2097('0x0'));var moment=require('moment');var BPromise=require(_0x2097('0x1'));var rs=require('randomstring');var fs=require('fs');var Redis=require(_0x2097('0x2'));var db=require(_0x2097('0x3'))['db'];var utils=require('../../config/utils');var logger=require(_0x2097('0x4'))(_0x2097('0x5'));var config=require(_0x2097('0x6'));var jayson=require(_0x2097('0x7'));var client=jayson[_0x2097('0x8')][_0x2097('0x9')]({'port':0x232a});function respondWithRpcPromise(_0x2b4f21,_0x59739f,_0x332aac){return new BPromise(function(_0x1e661a,_0x11d263){return client[_0x2097('0xa')](_0x2b4f21,_0x332aac)[_0x2097('0xb')](function(_0x59d947){logger[_0x2097('0xc')](_0x2097('0xd'),_0x59739f,_0x2097('0xe'));logger[_0x2097('0xf')](_0x2097('0x10'),_0x59739f,_0x2097('0xe'),JSON[_0x2097('0x11')](_0x59d947));if(_0x59d947[_0x2097('0x12')]){if(_0x59d947[_0x2097('0x12')][_0x2097('0x13')]===0x1f4){logger[_0x2097('0x12')](_0x2097('0xd'),_0x59739f,_0x59d947[_0x2097('0x12')][_0x2097('0x14')]);return _0x11d263(_0x59d947[_0x2097('0x12')][_0x2097('0x14')]);}logger[_0x2097('0x12')](_0x2097('0xd'),_0x59739f,_0x59d947[_0x2097('0x12')][_0x2097('0x14')]);return _0x1e661a(_0x59d947['error'][_0x2097('0x14')]);}else{logger[_0x2097('0xc')]('Trigger,\x20%s,\x20%s',_0x59739f,'request\x20sent');_0x1e661a(_0x59d947['result'][_0x2097('0x14')]);}})['catch'](function(_0x28c35c){logger[_0x2097('0x12')](_0x2097('0xd'),_0x59739f,_0x28c35c);_0x11d263(_0x28c35c);});});}exports[_0x2097('0x15')]=function(_0x44c584){var _0x53e2b4=this;return new Promise(function(_0x324652,_0x140094){return db[_0x2097('0x16')][_0x2097('0x17')]({'raw':_0x44c584[_0x2097('0x18')]?_0x44c584[_0x2097('0x18')][_0x2097('0x19')]===undefined?!![]:![]:!![],'where':_0x44c584[_0x2097('0x18')]?_0x44c584['options']['where']||null:null,'attributes':_0x44c584[_0x2097('0x18')]?_0x44c584['options'][_0x2097('0x1a')]||null:null,'limit':_0x44c584[_0x2097('0x18')]?_0x44c584['options'][_0x2097('0x1b')]||null:null,'include':_0x44c584['options']?_0x44c584[_0x2097('0x18')][_0x2097('0x1c')]?_[_0x2097('0x1d')](_0x44c584[_0x2097('0x18')][_0x2097('0x1c')],function(_0x35047b){return{'model':db[_0x35047b['model']],'as':_0x35047b['as'],'attributes':_0x35047b[_0x2097('0x1a')],'include':_0x35047b['include']?_[_0x2097('0x1d')](_0x35047b[_0x2097('0x1c')],function(_0x345875){return{'model':db[_0x345875[_0x2097('0x1e')]],'as':_0x345875['as'],'attributes':_0x345875['attributes'],'include':_0x345875[_0x2097('0x1c')]?_[_0x2097('0x1d')](_0x345875['include'],function(_0x1229fc){return{'model':db[_0x1229fc['model']],'as':_0x1229fc['as'],'attributes':_0x1229fc[_0x2097('0x1a')]};}):[]};}):[]};}):[]:[]})['then'](function(_0xbc0339){logger[_0x2097('0xc')](_0x2097('0x15'),_0x44c584);logger[_0x2097('0xf')](_0x2097('0x15'),_0x44c584,JSON[_0x2097('0x11')](_0xbc0339));_0x324652(_0xbc0339);})[_0x2097('0x1f')](function(_0x4b443d){logger[_0x2097('0x12')](_0x2097('0x15'),_0x4b443d['message'],_0x44c584);_0x140094(_0x53e2b4[_0x2097('0x12')](0x1f4,_0x4b443d[_0x2097('0x14')]));});});};exports['ShowTrigger']=function(_0x4d0916){var _0x312c77=this;return new Promise(function(_0x11b051,_0x1649c8){return db[_0x2097('0x16')][_0x2097('0x20')]({'raw':_0x4d0916[_0x2097('0x18')]?_0x4d0916['options'][_0x2097('0x19')]===undefined?!![]:![]:!![],'where':_0x4d0916['options']?_0x4d0916[_0x2097('0x18')][_0x2097('0x21')]||null:null,'attributes':_0x4d0916[_0x2097('0x18')]?_0x4d0916[_0x2097('0x18')][_0x2097('0x1a')]||null:null,'include':_0x4d0916[_0x2097('0x18')]?_0x4d0916[_0x2097('0x18')][_0x2097('0x1c')]?_[_0x2097('0x1d')](_0x4d0916['options'][_0x2097('0x1c')],function(_0x40baed){return{'model':db[_0x40baed[_0x2097('0x1e')]],'as':_0x40baed['as'],'attributes':_0x40baed['attributes'],'include':_0x40baed[_0x2097('0x1c')]?_[_0x2097('0x1d')](_0x40baed[_0x2097('0x1c')],function(_0x396162){return{'model':db[_0x396162['model']],'as':_0x396162['as'],'attributes':_0x396162['attributes'],'include':_0x396162['include']?_[_0x2097('0x1d')](_0x396162[_0x2097('0x1c')],function(_0x4123b7){return{'model':db[_0x4123b7[_0x2097('0x1e')]],'as':_0x4123b7['as'],'attributes':_0x4123b7[_0x2097('0x1a')]};}):[]};}):[]};}):[]:[]})[_0x2097('0xb')](function(_0x49b724){logger[_0x2097('0xc')](_0x2097('0x22'),_0x4d0916);logger[_0x2097('0xf')](_0x2097('0x22'),_0x4d0916,JSON[_0x2097('0x11')](_0x49b724));_0x11b051(_0x49b724);})[_0x2097('0x1f')](function(_0x52b937){logger[_0x2097('0x12')](_0x2097('0x22'),_0x52b937[_0x2097('0x14')],_0x4d0916);_0x1649c8(_0x312c77['error'](0x1f4,_0x52b937['message']));});});};
\ No newline at end of file
diff --git a/server/api/trunk/index.js b/server/api/trunk/index.js
index cbbc76c..2c44446 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 _0x2d17=['destroy','exports','multer','util','connect-timeout','express','../../components/auth/service','../../components/interaction/service','./trunk.controller','isAuthenticated','get','/:id','show','post','/:id/clone','clone','put','update','delete'];(function(_0x404931,_0x34f843){var _0x3e657e=function(_0x253a51){while(--_0x253a51){_0x404931['push'](_0x404931['shift']());}};_0x3e657e(++_0x34f843);}(_0x2d17,0x17e));var _0x72d1=function(_0x4873cd,_0x140991){_0x4873cd=_0x4873cd-0x0;var _0x4c06cf=_0x2d17[_0x4873cd];return _0x4c06cf;};'use strict';var multer=require(_0x72d1('0x0'));var util=require(_0x72d1('0x1'));var path=require('path');var timeout=require(_0x72d1('0x2'));var express=require(_0x72d1('0x3'));var router=express['Router']();var auth=require(_0x72d1('0x4'));var interaction=require(_0x72d1('0x5'));var config=require('../../config/environment');var controller=require(_0x72d1('0x6'));router['get']('/',auth[_0x72d1('0x7')](),controller['index']);router[_0x72d1('0x8')](_0x72d1('0x9'),auth['isAuthenticated'](),controller[_0x72d1('0xa')]);router[_0x72d1('0xb')](_0x72d1('0xc'),auth['isAuthenticated'](),controller[_0x72d1('0xd')]);router[_0x72d1('0xb')]('/',auth[_0x72d1('0x7')](),controller['create']);router[_0x72d1('0xe')](_0x72d1('0x9'),auth[_0x72d1('0x7')](),controller[_0x72d1('0xf')]);router[_0x72d1('0x10')](_0x72d1('0x9'),auth[_0x72d1('0x7')](),controller[_0x72d1('0x11')]);module[_0x72d1('0x12')]=router;
\ No newline at end of file
+var _0xb458=['create','destroy','exports','multer','util','path','Router','../../components/auth/service','../../components/interaction/service','../../config/environment','get','/:id','isAuthenticated','show','post','clone'];(function(_0x17d408,_0x2c12ca){var _0x40ffda=function(_0x4b9199){while(--_0x4b9199){_0x17d408['push'](_0x17d408['shift']());}};_0x40ffda(++_0x2c12ca);}(_0xb458,0x103));var _0x8b45=function(_0xd036b9,_0x3aa8e1){_0xd036b9=_0xd036b9-0x0;var _0x532634=_0xb458[_0xd036b9];return _0x532634;};'use strict';var multer=require(_0x8b45('0x0'));var util=require(_0x8b45('0x1'));var path=require(_0x8b45('0x2'));var timeout=require('connect-timeout');var express=require('express');var router=express[_0x8b45('0x3')]();var auth=require(_0x8b45('0x4'));var interaction=require(_0x8b45('0x5'));var config=require(_0x8b45('0x6'));var controller=require('./trunk.controller');router[_0x8b45('0x7')]('/',auth['isAuthenticated'](),controller['index']);router[_0x8b45('0x7')](_0x8b45('0x8'),auth[_0x8b45('0x9')](),controller[_0x8b45('0xa')]);router[_0x8b45('0xb')]('/:id/clone',auth[_0x8b45('0x9')](),controller[_0x8b45('0xc')]);router[_0x8b45('0xb')]('/',auth[_0x8b45('0x9')](),controller[_0x8b45('0xd')]);router['put'](_0x8b45('0x8'),auth[_0x8b45('0x9')](),controller['update']);router['delete']('/:id',auth['isAuthenticated'](),controller[_0x8b45('0xe')]);module[_0x8b45('0xf')]=router;
\ No newline at end of file
diff --git a/server/api/trunk/trunk.attributes.js b/server/api/trunk/trunk.attributes.js
index 18786c7..d6903ba 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 _0xc824=['split','rfc2833','info','shortinfo','inband','yes','update','join','nat','String\x20is\x20deprecated.\x20Please\x20use\x20an\x20Array\x20as\x20[\x22force_rport\x22,\x20\x22comedia\x22]','all','ulaw;alaw;gsm','setDataValue','allow','String\x20is\x20deprecated.\x20Please\x20use\x20an\x20Array\x20as\x20[\x22ulaw\x22,\x20\x22alaw\x22,\x20\x22alaw\x22]','port,invite','insecure','INTEGER','always','accept','refuse','originate','uac','uas','pai','fingerprint','certificate','active','passive','actpass','nonat','BOOLEAN','sequelize','exports','STRING','name','user','peer','friend','from-voip-provider','ENUM','ALLOWED_NOT_SCREENED','ALLOWED_PASSED_SCREEN','ALLOWED_FAILED_SCREEN','ALLOWED','PROHIB_FAILED_SCREEN','PROHIB','udp','getDataValue','transport'];(function(_0x1bfe2b,_0x34856e){var _0x1477d4=function(_0x1d558c){while(--_0x1d558c){_0x1bfe2b['push'](_0x1bfe2b['shift']());}};_0x1477d4(++_0x34856e);}(_0xc824,0x84));var _0x4c82=function(_0x3c91eb,_0x2fde65){_0x3c91eb=_0x3c91eb-0x0;var _0x16d680=_0xc824[_0x3c91eb];return _0x16d680;};'use strict';var Sequelize=require(_0x4c82('0x0'));module[_0x4c82('0x1')]={'name':{'type':Sequelize[_0x4c82('0x2')],'allowNull':![],'unique':_0x4c82('0x3'),'validate':{'notEmpty':!![],'is':/^[A-Za-z0-9\.\_]+$/i}},'type':{'type':Sequelize['ENUM']('friend',_0x4c82('0x4'),_0x4c82('0x5')),'allowNull':![],'defaultValue':_0x4c82('0x6')},'context':{'type':Sequelize['STRING'],'allowNull':![],'defaultValue':_0x4c82('0x7')},'callingpres':{'type':Sequelize[_0x4c82('0x8')](_0x4c82('0x9'),_0x4c82('0xa'),_0x4c82('0xb'),_0x4c82('0xc'),'PROHIB_NOT_SCREENED','PROHIB_PASSED_SCREEN',_0x4c82('0xd'),_0x4c82('0xe'))},'deny':{'type':Sequelize[_0x4c82('0x2')]},'permit':{'type':Sequelize['STRING']},'secret':{'type':Sequelize[_0x4c82('0x2')]},'md5secret':{'type':Sequelize[_0x4c82('0x2')]},'remotesecret':{'type':Sequelize[_0x4c82('0x2')]},'transport':{'type':Sequelize[_0x4c82('0x2')],'defaultValue':_0x4c82('0xf'),'set':function(_0x2c90d6){this['setDataValue']('transport',_0x2c90d6?_0x2c90d6['join'](','):null);},'get':function(){return this[_0x4c82('0x10')](_0x4c82('0x11'))?this[_0x4c82('0x10')](_0x4c82('0x11'))[_0x4c82('0x12')](','):null;},'comment':'String\x20is\x20deprecated.\x20Please\x20use\x20an\x20Array\x20as\x20[\x22udp\x22,\x20\x22tcp\x22]'},'dtmfmode':{'type':Sequelize[_0x4c82('0x8')](_0x4c82('0x13'),_0x4c82('0x14'),_0x4c82('0x15'),_0x4c82('0x16'),'auto'),'defaultValue':_0x4c82('0x13')},'directmedia':{'type':Sequelize[_0x4c82('0x8')](_0x4c82('0x17'),'no','nonat',_0x4c82('0x18'),'outgoing'),'defaultValue':'no'},'directrtpsetup':{'type':Sequelize[_0x4c82('0x8')](_0x4c82('0x17'),'no'),'defaultValue':'no'},'directmediapermit':{'type':Sequelize[_0x4c82('0x2')]},'directmediadeny':{'type':Sequelize['STRING']},'nat':{'type':Sequelize[_0x4c82('0x2')],'defaultValue':'force_rport,comedia','set':function(_0x2ccf00){this['setDataValue']('nat',_0x2ccf00?_0x2ccf00[_0x4c82('0x19')](','):null);},'get':function(){return this[_0x4c82('0x10')](_0x4c82('0x1a'))?this[_0x4c82('0x10')](_0x4c82('0x1a'))['split'](','):null;},'comment':_0x4c82('0x1b')},'callgroup':{'type':Sequelize[_0x4c82('0x2')]},'namedcallgroup':{'type':Sequelize[_0x4c82('0x2')]},'pickupgroup':{'type':Sequelize[_0x4c82('0x2')]},'namedpickupgroup':{'type':Sequelize[_0x4c82('0x2')]},'language':{'type':Sequelize[_0x4c82('0x2')],'defaultValue':'en'},'tonezone':{'type':Sequelize['STRING'],'allowNull':!![]},'disallow':{'type':Sequelize[_0x4c82('0x2')],'defaultValue':_0x4c82('0x1c')},'allow':{'type':Sequelize[_0x4c82('0x2')],'allowNull':![],'defaultValue':_0x4c82('0x1d'),'set':function(_0x451789){this[_0x4c82('0x1e')]('allow',_0x451789?_0x451789[_0x4c82('0x19')](';'):_0x4c82('0x1d'));},'get':function(){return this[_0x4c82('0x10')](_0x4c82('0x1f'))?this[_0x4c82('0x10')]('allow')['split'](';'):null;},'comment':_0x4c82('0x20')},'autoframing':{'type':Sequelize[_0x4c82('0x8')](_0x4c82('0x17'),'no')},'insecure':{'type':Sequelize[_0x4c82('0x2')],'defaultValue':_0x4c82('0x21'),'set':function(_0xe172eb){this[_0x4c82('0x1e')](_0x4c82('0x22'),_0xe172eb?_0xe172eb[_0x4c82('0x19')](','):null);},'get':function(){return this['getDataValue'](_0x4c82('0x22'))?this[_0x4c82('0x10')](_0x4c82('0x22'))[_0x4c82('0x12')](','):null;},'comment':'String\x20is\x20deprecated.\x20Please\x20use\x20an\x20Array\x20as\x20[\x22port\x22,\x20\x22invite\x22]'},'trustrpid':{'type':Sequelize[_0x4c82('0x8')]('yes','no'),'defaultValue':'no'},'trust_id_outbound':{'type':Sequelize[_0x4c82('0x8')](_0x4c82('0x17'),'no'),'defaultValue':'no'},'progressinband':{'type':Sequelize['ENUM']('yes','no','never')},'promiscredir':{'type':Sequelize['ENUM'](_0x4c82('0x17'),'no')},'useclientcode':{'type':Sequelize[_0x4c82('0x8')]('yes','no')},'accountcode':{'type':Sequelize[_0x4c82('0x23')](0xb)},'setvar':{'type':Sequelize[_0x4c82('0x2')]},'callerid':{'type':Sequelize[_0x4c82('0x2')],'defaultValue':'\x22\x22\x20<>'},'amaflags':{'type':Sequelize[_0x4c82('0x2')]},'callcounter':{'type':Sequelize['ENUM']('yes','no'),'defaultValue':'yes'},'busylevel':{'type':Sequelize['INTEGER'](0xb)},'allowoverlap':{'type':Sequelize[_0x4c82('0x8')](_0x4c82('0x17'),'no')},'allowsubscribe':{'type':Sequelize[_0x4c82('0x8')](_0x4c82('0x17'),'no')},'allowtransfer':{'type':Sequelize['ENUM'](_0x4c82('0x17'),'no')},'ignoresdpversion':{'type':Sequelize[_0x4c82('0x8')](_0x4c82('0x17'),'no')},'subscribecontext':{'type':Sequelize[_0x4c82('0x2')]},'template':{'type':Sequelize[_0x4c82('0x2')]},'videosupport':{'type':Sequelize[_0x4c82('0x8')](_0x4c82('0x17'),'no',_0x4c82('0x24')),'defaultValue':'no'},'maxcallbitrate':{'type':Sequelize[_0x4c82('0x23')](0xb)},'rfc2833compensate':{'type':Sequelize['ENUM'](_0x4c82('0x17'),'no')},'mailbox':{'type':Sequelize['STRING']},'session_timers':{'type':Sequelize[_0x4c82('0x8')](_0x4c82('0x25'),_0x4c82('0x26'),_0x4c82('0x27'))},'session_expires':{'type':Sequelize[_0x4c82('0x23')](0xb)},'session_minse':{'type':Sequelize[_0x4c82('0x23')](0xb)},'session_refresher':{'type':Sequelize[_0x4c82('0x8')](_0x4c82('0x28'),_0x4c82('0x29')),'defaultValue':_0x4c82('0x29')},'t38pt_usertpsource':{'type':Sequelize[_0x4c82('0x2')]},'regexten':{'type':Sequelize[_0x4c82('0x2')]},'fromdomain':{'type':Sequelize['STRING']},'fromuser':{'type':Sequelize[_0x4c82('0x2')]},'port':{'type':Sequelize[_0x4c82('0x23')](0x5)},'qualify':{'type':Sequelize[_0x4c82('0x8')](_0x4c82('0x17'),'no'),'defaultValue':'yes'},'keepalive':{'type':Sequelize['INTEGER'](0xb)},'defaultip':{'type':Sequelize[_0x4c82('0x2')]},'defaultuser':{'type':Sequelize['STRING']},'rtptimeout':{'type':Sequelize[_0x4c82('0x23')](0xb)},'rtpholdtimeout':{'type':Sequelize[_0x4c82('0x23')](0xb)},'rtpkeepalive':{'type':Sequelize[_0x4c82('0x23')](0xb)},'sendrpid':{'type':Sequelize[_0x4c82('0x8')](_0x4c82('0x17'),'no',_0x4c82('0x2a')),'defaultValue':'no'},'outboundproxy':{'type':Sequelize[_0x4c82('0x2')]},'callbackextension':{'type':Sequelize['STRING']},'timert1':{'type':Sequelize[_0x4c82('0x23')](0xb)},'timerb':{'type':Sequelize['INTEGER'](0xb)},'qualifyfreq':{'type':Sequelize[_0x4c82('0x23')](0xb)},'contactpermit':{'type':Sequelize[_0x4c82('0x2')]},'contactdeny':{'type':Sequelize[_0x4c82('0x2')]},'contactacl':{'type':Sequelize[_0x4c82('0x2')]},'unsolicited_mailbox':{'type':Sequelize[_0x4c82('0x2')]},'use_q850_reason':{'type':Sequelize[_0x4c82('0x2')]},'maxforwards':{'type':Sequelize[_0x4c82('0x23')](0xb)},'encryption':{'type':Sequelize['ENUM'](_0x4c82('0x17'),'no'),'defaultValue':'no'},'avpf':{'type':Sequelize[_0x4c82('0x8')]('yes','no')},'force_avp':{'type':Sequelize[_0x4c82('0x8')]('yes','no')},'icesupport':{'type':Sequelize[_0x4c82('0x8')](_0x4c82('0x17'),'no')},'dtlsenable':{'type':Sequelize['ENUM'](_0x4c82('0x17'),'no')},'dtlsverify':{'type':Sequelize[_0x4c82('0x8')]('yes','no',_0x4c82('0x2b'),_0x4c82('0x2c'))},'dtlsrekey':{'type':Sequelize[_0x4c82('0x23')](0xb)},'dtlscertfile':{'type':Sequelize[_0x4c82('0x2')]},'dtlsprivatekey':{'type':Sequelize[_0x4c82('0x2')]},'dtlscipher':{'type':Sequelize[_0x4c82('0x2')]},'dtlscafile':{'type':Sequelize['STRING']},'dtlscapath':{'type':Sequelize[_0x4c82('0x2')]},'dtlssetup':{'type':Sequelize[_0x4c82('0x8')](_0x4c82('0x2d'),_0x4c82('0x2e'),_0x4c82('0x2f')),'allowNull':!![]},'dtlsfingerprint':{'type':Sequelize['STRING']},'usereqphone':{'type':Sequelize[_0x4c82('0x8')](_0x4c82('0x17'),'no'),'defaultValue':'no'},'recordonfeature':{'type':Sequelize[_0x4c82('0x2')]},'recordofffeature':{'type':Sequelize['STRING']},'call_limit':{'type':Sequelize[_0x4c82('0x23')](0xb),'defaultValue':0x3e8},'registertrying':{'type':Sequelize[_0x4c82('0x8')](_0x4c82('0x17'),'no')},'subscribemwi':{'type':Sequelize[_0x4c82('0x8')](_0x4c82('0x17'),'no')},'vmexten':{'type':Sequelize[_0x4c82('0x2')]},'mohinterpret':{'type':Sequelize[_0x4c82('0x2')]},'mohsuggest':{'type':Sequelize[_0x4c82('0x2')]},'parkinglot':{'type':Sequelize[_0x4c82('0x2')]},'description':{'type':Sequelize[_0x4c82('0x2')]},'host':{'type':Sequelize[_0x4c82('0x2')],'defaultValue':'dynamic'},'canreinvite':{'type':Sequelize['ENUM'](_0x4c82('0x17'),'no',_0x4c82('0x30'),_0x4c82('0x18'),'update,nonat'),'defaultValue':'no'},'registry':{'type':Sequelize[_0x4c82('0x2')]},'otherFields':{'type':Sequelize[_0x4c82('0x2')]},'active':{'type':Sequelize[_0x4c82('0x31')],'allowNull':![],'defaultValue':!![]},'t38pt_udptl':{'type':Sequelize[_0x4c82('0x2')],'defaultValue':'no'}};
\ No newline at end of file
+var _0x5a0f=['uas','pai','certificate','actpass','dynamic','update,nonat','sequelize','exports','name','ENUM','friend','user','peer','STRING','from-voip-provider','ALLOWED_PASSED_SCREEN','ALLOWED','PROHIB_NOT_SCREENED','PROHIB_PASSED_SCREEN','PROHIB_FAILED_SCREEN','udp','setDataValue','transport','join','getDataValue','String\x20is\x20deprecated.\x20Please\x20use\x20an\x20Array\x20as\x20[\x22udp\x22,\x20\x22tcp\x22]','rfc2833','shortinfo','inband','auto','yes','nonat','outgoing','force_rport,comedia','nat','split','String\x20is\x20deprecated.\x20Please\x20use\x20an\x20Array\x20as\x20[\x22force_rport\x22,\x20\x22comedia\x22]','all','ulaw;alaw;gsm','allow','String\x20is\x20deprecated.\x20Please\x20use\x20an\x20Array\x20as\x20[\x22ulaw\x22,\x20\x22alaw\x22,\x20\x22alaw\x22]','insecure','String\x20is\x20deprecated.\x20Please\x20use\x20an\x20Array\x20as\x20[\x22port\x22,\x20\x22invite\x22]','never','INTEGER','\x22\x22\x20<>','accept','refuse','originate','uac'];(function(_0x147004,_0x15e6a2){var _0x3f3c4f=function(_0xc72b63){while(--_0xc72b63){_0x147004['push'](_0x147004['shift']());}};_0x3f3c4f(++_0x15e6a2);}(_0x5a0f,0x9c));var _0xf5a0=function(_0x5e0eac,_0x1728eb){_0x5e0eac=_0x5e0eac-0x0;var _0xd0f574=_0x5a0f[_0x5e0eac];return _0xd0f574;};'use strict';var Sequelize=require(_0xf5a0('0x0'));module[_0xf5a0('0x1')]={'name':{'type':Sequelize['STRING'],'allowNull':![],'unique':_0xf5a0('0x2'),'validate':{'notEmpty':!![],'is':/^[A-Za-z0-9\.\_]+$/i}},'type':{'type':Sequelize[_0xf5a0('0x3')](_0xf5a0('0x4'),_0xf5a0('0x5'),_0xf5a0('0x6')),'allowNull':![],'defaultValue':'friend'},'context':{'type':Sequelize[_0xf5a0('0x7')],'allowNull':![],'defaultValue':_0xf5a0('0x8')},'callingpres':{'type':Sequelize[_0xf5a0('0x3')]('ALLOWED_NOT_SCREENED',_0xf5a0('0x9'),'ALLOWED_FAILED_SCREEN',_0xf5a0('0xa'),_0xf5a0('0xb'),_0xf5a0('0xc'),_0xf5a0('0xd'),'PROHIB')},'deny':{'type':Sequelize[_0xf5a0('0x7')]},'permit':{'type':Sequelize[_0xf5a0('0x7')]},'secret':{'type':Sequelize['STRING']},'md5secret':{'type':Sequelize[_0xf5a0('0x7')]},'remotesecret':{'type':Sequelize[_0xf5a0('0x7')]},'transport':{'type':Sequelize['STRING'],'defaultValue':_0xf5a0('0xe'),'set':function(_0x48a0df){this[_0xf5a0('0xf')](_0xf5a0('0x10'),_0x48a0df?_0x48a0df[_0xf5a0('0x11')](','):null);},'get':function(){return this[_0xf5a0('0x12')](_0xf5a0('0x10'))?this['getDataValue'](_0xf5a0('0x10'))['split'](','):null;},'comment':_0xf5a0('0x13')},'dtmfmode':{'type':Sequelize[_0xf5a0('0x3')](_0xf5a0('0x14'),'info',_0xf5a0('0x15'),_0xf5a0('0x16'),_0xf5a0('0x17')),'defaultValue':_0xf5a0('0x14')},'directmedia':{'type':Sequelize[_0xf5a0('0x3')](_0xf5a0('0x18'),'no',_0xf5a0('0x19'),'update',_0xf5a0('0x1a')),'defaultValue':'no'},'directrtpsetup':{'type':Sequelize['ENUM'](_0xf5a0('0x18'),'no'),'defaultValue':'no'},'directmediapermit':{'type':Sequelize[_0xf5a0('0x7')]},'directmediadeny':{'type':Sequelize['STRING']},'nat':{'type':Sequelize['STRING'],'defaultValue':_0xf5a0('0x1b'),'set':function(_0x5234f5){this[_0xf5a0('0xf')](_0xf5a0('0x1c'),_0x5234f5?_0x5234f5[_0xf5a0('0x11')](','):null);},'get':function(){return this[_0xf5a0('0x12')](_0xf5a0('0x1c'))?this[_0xf5a0('0x12')]('nat')[_0xf5a0('0x1d')](','):null;},'comment':_0xf5a0('0x1e')},'callgroup':{'type':Sequelize[_0xf5a0('0x7')]},'namedcallgroup':{'type':Sequelize[_0xf5a0('0x7')]},'pickupgroup':{'type':Sequelize[_0xf5a0('0x7')]},'namedpickupgroup':{'type':Sequelize[_0xf5a0('0x7')]},'language':{'type':Sequelize['STRING'],'defaultValue':'en'},'tonezone':{'type':Sequelize[_0xf5a0('0x7')],'allowNull':!![]},'disallow':{'type':Sequelize[_0xf5a0('0x7')],'defaultValue':_0xf5a0('0x1f')},'allow':{'type':Sequelize[_0xf5a0('0x7')],'allowNull':![],'defaultValue':_0xf5a0('0x20'),'set':function(_0x364881){this[_0xf5a0('0xf')]('allow',_0x364881?_0x364881[_0xf5a0('0x11')](';'):_0xf5a0('0x20'));},'get':function(){return this[_0xf5a0('0x12')](_0xf5a0('0x21'))?this[_0xf5a0('0x12')](_0xf5a0('0x21'))[_0xf5a0('0x1d')](';'):null;},'comment':_0xf5a0('0x22')},'autoframing':{'type':Sequelize[_0xf5a0('0x3')](_0xf5a0('0x18'),'no')},'insecure':{'type':Sequelize[_0xf5a0('0x7')],'defaultValue':'port,invite','set':function(_0x15f10a){this[_0xf5a0('0xf')](_0xf5a0('0x23'),_0x15f10a?_0x15f10a[_0xf5a0('0x11')](','):null);},'get':function(){return this[_0xf5a0('0x12')]('insecure')?this[_0xf5a0('0x12')](_0xf5a0('0x23'))[_0xf5a0('0x1d')](','):null;},'comment':_0xf5a0('0x24')},'trustrpid':{'type':Sequelize[_0xf5a0('0x3')](_0xf5a0('0x18'),'no'),'defaultValue':'no'},'trust_id_outbound':{'type':Sequelize[_0xf5a0('0x3')](_0xf5a0('0x18'),'no'),'defaultValue':'no'},'progressinband':{'type':Sequelize[_0xf5a0('0x3')](_0xf5a0('0x18'),'no',_0xf5a0('0x25'))},'promiscredir':{'type':Sequelize[_0xf5a0('0x3')](_0xf5a0('0x18'),'no')},'useclientcode':{'type':Sequelize[_0xf5a0('0x3')](_0xf5a0('0x18'),'no')},'accountcode':{'type':Sequelize[_0xf5a0('0x26')](0xb)},'setvar':{'type':Sequelize[_0xf5a0('0x7')]},'callerid':{'type':Sequelize[_0xf5a0('0x7')],'defaultValue':_0xf5a0('0x27')},'amaflags':{'type':Sequelize[_0xf5a0('0x7')]},'callcounter':{'type':Sequelize[_0xf5a0('0x3')](_0xf5a0('0x18'),'no'),'defaultValue':_0xf5a0('0x18')},'busylevel':{'type':Sequelize['INTEGER'](0xb)},'allowoverlap':{'type':Sequelize[_0xf5a0('0x3')](_0xf5a0('0x18'),'no')},'allowsubscribe':{'type':Sequelize['ENUM'](_0xf5a0('0x18'),'no')},'allowtransfer':{'type':Sequelize[_0xf5a0('0x3')](_0xf5a0('0x18'),'no')},'ignoresdpversion':{'type':Sequelize['ENUM']('yes','no')},'subscribecontext':{'type':Sequelize[_0xf5a0('0x7')]},'template':{'type':Sequelize[_0xf5a0('0x7')]},'videosupport':{'type':Sequelize[_0xf5a0('0x3')](_0xf5a0('0x18'),'no','always'),'defaultValue':'no'},'maxcallbitrate':{'type':Sequelize[_0xf5a0('0x26')](0xb)},'rfc2833compensate':{'type':Sequelize[_0xf5a0('0x3')](_0xf5a0('0x18'),'no')},'mailbox':{'type':Sequelize[_0xf5a0('0x7')]},'session_timers':{'type':Sequelize['ENUM'](_0xf5a0('0x28'),_0xf5a0('0x29'),_0xf5a0('0x2a'))},'session_expires':{'type':Sequelize[_0xf5a0('0x26')](0xb)},'session_minse':{'type':Sequelize[_0xf5a0('0x26')](0xb)},'session_refresher':{'type':Sequelize[_0xf5a0('0x3')](_0xf5a0('0x2b'),'uas'),'defaultValue':_0xf5a0('0x2c')},'t38pt_usertpsource':{'type':Sequelize[_0xf5a0('0x7')]},'regexten':{'type':Sequelize[_0xf5a0('0x7')]},'fromdomain':{'type':Sequelize[_0xf5a0('0x7')]},'fromuser':{'type':Sequelize['STRING']},'port':{'type':Sequelize[_0xf5a0('0x26')](0x5)},'qualify':{'type':Sequelize[_0xf5a0('0x3')](_0xf5a0('0x18'),'no'),'defaultValue':_0xf5a0('0x18')},'keepalive':{'type':Sequelize[_0xf5a0('0x26')](0xb)},'defaultip':{'type':Sequelize['STRING']},'defaultuser':{'type':Sequelize[_0xf5a0('0x7')]},'rtptimeout':{'type':Sequelize[_0xf5a0('0x26')](0xb)},'rtpholdtimeout':{'type':Sequelize['INTEGER'](0xb)},'rtpkeepalive':{'type':Sequelize[_0xf5a0('0x26')](0xb)},'sendrpid':{'type':Sequelize[_0xf5a0('0x3')](_0xf5a0('0x18'),'no',_0xf5a0('0x2d')),'defaultValue':'no'},'outboundproxy':{'type':Sequelize[_0xf5a0('0x7')]},'callbackextension':{'type':Sequelize[_0xf5a0('0x7')]},'timert1':{'type':Sequelize[_0xf5a0('0x26')](0xb)},'timerb':{'type':Sequelize[_0xf5a0('0x26')](0xb)},'qualifyfreq':{'type':Sequelize['INTEGER'](0xb)},'contactpermit':{'type':Sequelize['STRING']},'contactdeny':{'type':Sequelize[_0xf5a0('0x7')]},'contactacl':{'type':Sequelize[_0xf5a0('0x7')]},'unsolicited_mailbox':{'type':Sequelize[_0xf5a0('0x7')]},'use_q850_reason':{'type':Sequelize['STRING']},'maxforwards':{'type':Sequelize['INTEGER'](0xb)},'encryption':{'type':Sequelize[_0xf5a0('0x3')](_0xf5a0('0x18'),'no'),'defaultValue':'no'},'avpf':{'type':Sequelize['ENUM'](_0xf5a0('0x18'),'no')},'force_avp':{'type':Sequelize[_0xf5a0('0x3')](_0xf5a0('0x18'),'no')},'icesupport':{'type':Sequelize['ENUM']('yes','no')},'dtlsenable':{'type':Sequelize[_0xf5a0('0x3')](_0xf5a0('0x18'),'no')},'dtlsverify':{'type':Sequelize['ENUM'](_0xf5a0('0x18'),'no','fingerprint',_0xf5a0('0x2e'))},'dtlsrekey':{'type':Sequelize[_0xf5a0('0x26')](0xb)},'dtlscertfile':{'type':Sequelize[_0xf5a0('0x7')]},'dtlsprivatekey':{'type':Sequelize['STRING']},'dtlscipher':{'type':Sequelize['STRING']},'dtlscafile':{'type':Sequelize[_0xf5a0('0x7')]},'dtlscapath':{'type':Sequelize['STRING']},'dtlssetup':{'type':Sequelize['ENUM']('active','passive',_0xf5a0('0x2f')),'allowNull':!![]},'dtlsfingerprint':{'type':Sequelize[_0xf5a0('0x7')]},'usereqphone':{'type':Sequelize[_0xf5a0('0x3')](_0xf5a0('0x18'),'no'),'defaultValue':'no'},'recordonfeature':{'type':Sequelize['STRING']},'recordofffeature':{'type':Sequelize['STRING']},'call_limit':{'type':Sequelize[_0xf5a0('0x26')](0xb),'defaultValue':0x3e8},'registertrying':{'type':Sequelize[_0xf5a0('0x3')]('yes','no')},'subscribemwi':{'type':Sequelize[_0xf5a0('0x3')]('yes','no')},'vmexten':{'type':Sequelize[_0xf5a0('0x7')]},'mohinterpret':{'type':Sequelize[_0xf5a0('0x7')]},'mohsuggest':{'type':Sequelize[_0xf5a0('0x7')]},'parkinglot':{'type':Sequelize[_0xf5a0('0x7')]},'description':{'type':Sequelize['STRING']},'host':{'type':Sequelize['STRING'],'defaultValue':_0xf5a0('0x30')},'canreinvite':{'type':Sequelize[_0xf5a0('0x3')](_0xf5a0('0x18'),'no',_0xf5a0('0x19'),'update',_0xf5a0('0x31')),'defaultValue':'no'},'registry':{'type':Sequelize['STRING']},'otherFields':{'type':Sequelize[_0xf5a0('0x7')]},'active':{'type':Sequelize['BOOLEAN'],'allowNull':![],'defaultValue':!![]},'t38pt_udptl':{'type':Sequelize[_0xf5a0('0x7')],'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 c9422ae..fddcccd 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 _0xc091=['attributes','fields','length','hasOwnProperty','nolimit','order','sort','where','pick','filter','merge','options','includeAll','include','findAll','show','rawAttributes','find','catch','clone','params','omit','createdAt','updatedAt','body','create','Unable\x20to\x20retrieve\x20the\x20current\x20user','user','userProfileId','autoAssociation','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','readFileSync','utf8','render','writeFileSync','/etc/asterisk/sip_xcally_trunks.conf','registry','/etc/asterisk/sip_xcally_registers.conf','Reload','chan_sip.so','root','join','server/files/templates/registry.ejs','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','../../components/parsers/qs','../../config/license/hardware','api','../../config/utils','jayson/promise','client','http','test','Sequelize','ValidationError','then','Trunk,\x20%s,\x20%s','request\x20sent','Trunk,\x20%s,\x20%s,\x20%s','stringify','error','message','info','result','sendStatus','status','end','json','count','offset','limit','set','Content-Range','apply','reject','update','destroy','get','Trunks','UserProfileResource','stack','name','send','Trunk','fieldName','type','key','model','map','query','keys','filters','intersection'];(function(_0x2641f9,_0x26715f){var _0x585741=function(_0x2d1462){while(--_0x2d1462){_0x2641f9['push'](_0x2641f9['shift']());}};_0x585741(++_0x26715f);}(_0xc091,0x9c));var _0x1c09=function(_0x1003f8,_0x5575d7){_0x1003f8=_0x1003f8-0x0;var _0x1ded69=_0xc091[_0x1003f8];return _0x1ded69;};'use strict';var pdf=require(_0x1c09('0x0'));var emlformat=require(_0x1c09('0x1'));var rimraf=require(_0x1c09('0x2'));var zipdir=require(_0x1c09('0x3'));var jsonpatch=require(_0x1c09('0x4'));var rp=require(_0x1c09('0x5'));var moment=require(_0x1c09('0x6'));var BPromise=require(_0x1c09('0x7'));var Mustache=require(_0x1c09('0x8'));var util=require(_0x1c09('0x9'));var path=require(_0x1c09('0xa'));var sox=require(_0x1c09('0xb'));var csv=require(_0x1c09('0xc'));var ejs=require(_0x1c09('0xd'));var fs=require('fs');var _=require(_0x1c09('0xe'));var squel=require(_0x1c09('0xf'));var crypto=require(_0x1c09('0x10'));var jsforce=require('jsforce');var deskjs=require(_0x1c09('0x11'));var toCsv=require(_0x1c09('0xc'));var querystring=require(_0x1c09('0x12'));var Papa=require(_0x1c09('0x13'));var Redis=require(_0x1c09('0x14'));var authService=require(_0x1c09('0x15'));var qs=require(_0x1c09('0x16'));var as=require('../../components/parsers/advancedSearch');var hardwareService=require(_0x1c09('0x17'));var logger=require('../../config/logger')(_0x1c09('0x18'));var utils=require(_0x1c09('0x19'));var config=require('../../config/environment');var db=require('../../mysqldb')['db'];var jayson=require(_0x1c09('0x1a'));var client=jayson[_0x1c09('0x1b')][_0x1c09('0x1c')]({'port':0x232a});function checkPasswordPattern(_0x3f238f,_0x5f42f5,_0x11c3f1){if(_0x11c3f1){var _0x18c10f=new RegExp(/(?=.*[a-z])(?=.*[A-Z])(?=.*[0-9])(?=.*[?!@#\$%\^&\*~\-_=+[{\]\}])(?=.{8,})/);if(_0x18c10f[_0x1c09('0x1d')](_0x5f42f5)){return _0x3f238f;}else{throw new db[(_0x1c09('0x1e'))][(_0x1c09('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 _0x3f238f;}}function respondWithRpcPromise(_0x3abebd,_0x5ecfae,_0x1b04d7,_0x4d1f56){return new BPromise(function(_0x27b47b,_0x18e2ce){var _0x39df1f=_0x4d1f56||client;return _0x39df1f['request'](_0x3abebd,_0x1b04d7)[_0x1c09('0x20')](function(_0x1f977c){logger['info'](_0x1c09('0x21'),_0x5ecfae,_0x1c09('0x22'));logger['debug'](_0x1c09('0x23'),_0x5ecfae,_0x1c09('0x22'),JSON[_0x1c09('0x24')](_0x1f977c));if(_0x1f977c[_0x1c09('0x25')]){if(_0x1f977c[_0x1c09('0x25')]['code']===0x1f4){logger['error'](_0x1c09('0x21'),_0x5ecfae,_0x1f977c['error']['message']);return _0x18e2ce(_0x1f977c[_0x1c09('0x25')]['message']);}logger[_0x1c09('0x25')](_0x1c09('0x21'),_0x5ecfae,_0x1f977c[_0x1c09('0x25')][_0x1c09('0x26')]);return _0x27b47b(_0x1f977c[_0x1c09('0x25')][_0x1c09('0x26')]);}else{logger[_0x1c09('0x27')](_0x1c09('0x21'),_0x5ecfae,_0x1c09('0x22'));_0x27b47b(_0x1f977c[_0x1c09('0x28')][_0x1c09('0x26')]);}})['catch'](function(_0x4d8cfe){logger['error'](_0x1c09('0x21'),_0x5ecfae,_0x4d8cfe);_0x18e2ce(_0x4d8cfe);});});}function respondWithStatusCode(_0x23af53,_0x9a815f){_0x9a815f=_0x9a815f||0xcc;return function(_0x40ab10){if(_0x40ab10){return _0x23af53[_0x1c09('0x29')](_0x9a815f);}return _0x23af53[_0x1c09('0x2a')](_0x9a815f)[_0x1c09('0x2b')]();};}function respondWithResult(_0x2dd23d,_0x237d57){_0x237d57=_0x237d57||0xc8;return function(_0x3653cb){if(_0x3653cb){return _0x2dd23d[_0x1c09('0x2a')](_0x237d57)[_0x1c09('0x2c')](_0x3653cb);}};}function respondWithFilteredResult(_0x558d58,_0xd8c715){return function(_0x91015c){if(_0x91015c){var _0x304dea=_0x91015c[_0x1c09('0x2d')],_0x29c5df=_0xd8c715[_0x1c09('0x2e')],_0x248f1c=_0xd8c715['offset']+_0xd8c715[_0x1c09('0x2f')],_0x47c57b;if(_0x248f1c>=_0x304dea){_0x248f1c=_0x304dea;_0x47c57b=0xc8;}else{_0x47c57b=0xce;}_0x558d58[_0x1c09('0x2a')](_0x47c57b);return _0x558d58[_0x1c09('0x30')](_0x1c09('0x31'),_0x29c5df+'-'+_0x248f1c+'/'+_0x304dea)[_0x1c09('0x2c')](_0x91015c);}return null;};}function patchUpdates(_0x5d808d){return function(_0x3206e1){try{jsonpatch[_0x1c09('0x32')](_0x3206e1,_0x5d808d,!![]);}catch(_0x16761d){return BPromise[_0x1c09('0x33')](_0x16761d);}return _0x3206e1['save']();};}function saveUpdates(_0xc04ba7,_0x1f0939){return function(_0x43d695){if(_0x43d695){return _0x43d695[_0x1c09('0x34')](_0xc04ba7)['then'](function(_0x255fcc){return _0x255fcc;});}return null;};}function removeEntity(_0x119dcf,_0x493bfd){return function(_0x58e8aa){if(_0x58e8aa){return _0x58e8aa[_0x1c09('0x35')]()[_0x1c09('0x20')](function(){var _0x39e965=_0x58e8aa[_0x1c09('0x36')]({'plain':!![]});var _0x5e4480=_0x1c09('0x37');return db[_0x1c09('0x38')][_0x1c09('0x35')]({'where':{'type':_0x5e4480,'resourceId':_0x39e965['id']}})[_0x1c09('0x20')](function(){return _0x58e8aa;});})[_0x1c09('0x20')](function(){_0x119dcf['status'](0xcc)['end']();});}};}function handleEntityNotFound(_0x1139d3,_0x23ed32){return function(_0x117ca5){if(!_0x117ca5){_0x1139d3[_0x1c09('0x29')](0x194);}return _0x117ca5;};}function handleError(_0xc824a6,_0x32a860){_0x32a860=_0x32a860||0x1f4;return function(_0x20173f){logger[_0x1c09('0x25')](_0x20173f[_0x1c09('0x39')]);if(_0x20173f[_0x1c09('0x3a')]){delete _0x20173f[_0x1c09('0x3a')];}_0xc824a6[_0x1c09('0x2a')](_0x32a860)[_0x1c09('0x3b')](_0x20173f);};}exports['index']=function(_0x44bd21,_0x5013c3){var _0x10ce28={},_0x4f68af={},_0x110c5e={'count':0x0,'rows':[]};var _0x2c8416=_['map'](db[_0x1c09('0x3c')]['rawAttributes'],function(_0x147d46){return{'name':_0x147d46[_0x1c09('0x3d')],'type':_0x147d46[_0x1c09('0x3e')][_0x1c09('0x3f')]};});_0x4f68af[_0x1c09('0x40')]=_[_0x1c09('0x41')](_0x2c8416,'name');_0x4f68af[_0x1c09('0x42')]=_[_0x1c09('0x43')](_0x44bd21['query']);_0x4f68af[_0x1c09('0x44')]=_[_0x1c09('0x45')](_0x4f68af[_0x1c09('0x40')],_0x4f68af[_0x1c09('0x42')]);_0x10ce28[_0x1c09('0x46')]=_[_0x1c09('0x45')](_0x4f68af[_0x1c09('0x40')],qs['fields'](_0x44bd21[_0x1c09('0x42')][_0x1c09('0x47')]));_0x10ce28[_0x1c09('0x46')]=_0x10ce28[_0x1c09('0x46')][_0x1c09('0x48')]?_0x10ce28['attributes']:_0x4f68af[_0x1c09('0x40')];if(!_0x44bd21[_0x1c09('0x42')][_0x1c09('0x49')](_0x1c09('0x4a'))){_0x10ce28[_0x1c09('0x2f')]=qs[_0x1c09('0x2f')](_0x44bd21['query'][_0x1c09('0x2f')]);_0x10ce28[_0x1c09('0x2e')]=qs[_0x1c09('0x2e')](_0x44bd21['query'][_0x1c09('0x2e')]);}_0x10ce28[_0x1c09('0x4b')]=qs[_0x1c09('0x4c')](_0x44bd21[_0x1c09('0x42')][_0x1c09('0x4c')]);_0x10ce28[_0x1c09('0x4d')]=qs[_0x1c09('0x44')](_[_0x1c09('0x4e')](_0x44bd21[_0x1c09('0x42')],_0x4f68af[_0x1c09('0x44')]));if(_0x44bd21['query'][_0x1c09('0x4f')]){_0x10ce28[_0x1c09('0x4d')]=_[_0x1c09('0x50')](_0x10ce28[_0x1c09('0x4d')],{'$or':_[_0x1c09('0x41')](_0x2c8416,function(_0x52dfbf){if(_0x52dfbf[_0x1c09('0x3e')]!=='VIRTUAL'){var _0x52d1ce={};_0x52d1ce[_0x52dfbf[_0x1c09('0x3a')]]={'$like':'%'+_0x44bd21['query'][_0x1c09('0x4f')]+'%'};return _0x52d1ce;}})});}_0x10ce28=_['merge']({},_0x10ce28,_0x44bd21[_0x1c09('0x51')]);var _0x106651={'where':_0x10ce28['where']};return db['Trunk']['count'](_0x106651)[_0x1c09('0x20')](function(_0x471e69){_0x110c5e[_0x1c09('0x2d')]=_0x471e69;if(_0x44bd21['query'][_0x1c09('0x52')]){_0x10ce28[_0x1c09('0x53')]=[{'all':!![]}];}return db[_0x1c09('0x3c')][_0x1c09('0x54')](_0x10ce28);})[_0x1c09('0x20')](function(_0x49cafe){_0x110c5e['rows']=_0x49cafe;return _0x110c5e;})['then'](respondWithFilteredResult(_0x5013c3,_0x10ce28))['catch'](handleError(_0x5013c3,null));};exports[_0x1c09('0x55')]=function(_0x418628,_0x1f365f){var _0xb8f071={'raw':![],'where':{'id':_0x418628['params']['id']}},_0x57de9b={};_0x57de9b[_0x1c09('0x40')]=_['keys'](db[_0x1c09('0x3c')][_0x1c09('0x56')]);_0x57de9b[_0x1c09('0x42')]=_['keys'](_0x418628[_0x1c09('0x42')]);_0x57de9b[_0x1c09('0x44')]=_['intersection'](_0x57de9b[_0x1c09('0x40')],_0x57de9b[_0x1c09('0x42')]);_0xb8f071[_0x1c09('0x46')]=_['intersection'](_0x57de9b['model'],qs[_0x1c09('0x47')](_0x418628[_0x1c09('0x42')][_0x1c09('0x47')]));_0xb8f071[_0x1c09('0x46')]=_0xb8f071[_0x1c09('0x46')]['length']?_0xb8f071[_0x1c09('0x46')]:_0x57de9b[_0x1c09('0x40')];if(_0x418628['query']['includeAll']){_0xb8f071[_0x1c09('0x53')]=[{'all':!![]}];}_0xb8f071=_['merge']({},_0xb8f071,_0x418628[_0x1c09('0x51')]);return db['Trunk'][_0x1c09('0x57')](_0xb8f071)[_0x1c09('0x20')](handleEntityNotFound(_0x1f365f,null))['then'](respondWithResult(_0x1f365f,null))[_0x1c09('0x58')](handleError(_0x1f365f,null));};exports[_0x1c09('0x59')]=function(_0x1b828b,_0x26e0ef){var _0x1da96c={'where':{'id':_0x1b828b[_0x1c09('0x5a')]['id']}},_0x49f20e={};_0x49f20e[_0x1c09('0x40')]=_[_0x1c09('0x43')](db['Trunk'][_0x1c09('0x56')]);_0x1da96c[_0x1c09('0x46')]=_[_0x1c09('0x45')](_0x49f20e['model'],qs[_0x1c09('0x47')](_0x1b828b[_0x1c09('0x42')][_0x1c09('0x47')]));_0x1da96c['attributes']=_0x1da96c[_0x1c09('0x46')]['length']?_0x1da96c[_0x1c09('0x46')]:_0x49f20e[_0x1c09('0x40')];if(_0x1b828b[_0x1c09('0x42')][_0x1c09('0x52')]){_0x1da96c[_0x1c09('0x53')]=[{'all':!![]}];}_0x1da96c=_['merge']({},_0x1da96c,_0x1b828b[_0x1c09('0x51')]);return db[_0x1c09('0x3c')][_0x1c09('0x57')](_0x1da96c)[_0x1c09('0x20')](handleEntityNotFound(_0x26e0ef,null))[_0x1c09('0x20')](function(_0x188408){if(_0x188408){var _0x26028c=_0x188408[_0x1c09('0x36')]({'plain':!![]});_0x26028c=qs[_0x1c09('0x5b')](_0x26028c,['id',_0x1c09('0x5c'),_0x1c09('0x5d')]);_0x1b828b['body']=_[_0x1c09('0x5b')](_0x1b828b[_0x1c09('0x5e')],['id',_0x1c09('0x5c'),_0x1c09('0x5d')]);return db[_0x1c09('0x3c')][_0x1c09('0x5f')](_[_0x1c09('0x50')](_0x26028c,_0x1b828b[_0x1c09('0x5e')]),{'include':_0x1b828b[_0x1c09('0x42')][_0x1c09('0x52')]?[{'all':!![]}]:undefined})[_0x1c09('0x20')](function(_0x575873){var _0x4dbee0=_0x1b828b['user'][_0x1c09('0x36')]({'plain':!![]});if(!_0x4dbee0)throw new Error(_0x1c09('0x60'));if(_0x4dbee0['role']===_0x1c09('0x61')){var _0x18e9c9=_0x575873[_0x1c09('0x36')]({'plain':!![]});var _0xb4d8c4=_0x1c09('0x37');return db['UserProfileSection'][_0x1c09('0x57')]({'where':{'name':_0xb4d8c4,'userProfileId':_0x4dbee0[_0x1c09('0x62')]},'raw':!![]})[_0x1c09('0x20')](function(_0x32258a){if(_0x32258a&&_0x32258a[_0x1c09('0x63')]===0x0){return db[_0x1c09('0x38')][_0x1c09('0x5f')]({'name':_0x18e9c9[_0x1c09('0x3a')],'resourceId':_0x18e9c9['id'],'type':_0x32258a['name'],'sectionId':_0x32258a['id']},{})[_0x1c09('0x20')](function(){return _0x575873;});}else{return _0x575873;}})[_0x1c09('0x58')](function(_0x1c8168){logger['error'](_0x1c09('0x64'),_0x1c8168);throw _0x1c8168;});}return _0x575873;});}})['then'](respondWithResult(_0x26e0ef,0xc9))['catch'](handleError(_0x26e0ef,null));};exports['create']=function(_0x9b143b,_0xf11028,_0x1a5f1a){var _0x1e928b;return db[_0x1c09('0x3c')][_0x1c09('0x5f')](_0x9b143b[_0x1c09('0x5e')],{'raw':!![]})['then'](function(_0x416ac6){_0x1e928b=_0x416ac6;return db[_0x1c09('0x3c')][_0x1c09('0x54')]({'raw':!![]});})[_0x1c09('0x20')](function(_0x2c3bf0){var _0x1dd961=fs[_0x1c09('0x65')](path['join'](config['root'],'server/files/templates/trunk.ejs'),_0x1c09('0x66'));var _0x38d329=fs[_0x1c09('0x65')](path['join'](config['root'],'server/files/templates/registry.ejs'),_0x1c09('0x66'));var _0x36291f=ejs[_0x1c09('0x67')](_0x1dd961,{'trunks':_0x2c3bf0||[]});fs[_0x1c09('0x68')](_0x1c09('0x69'),_0x36291f);if(_0x1e928b[_0x1c09('0x6a')]){var _0x2cd0ab=ejs[_0x1c09('0x67')](_0x38d329,{'trunks':_0x2c3bf0||[]});fs['writeFileSync'](_0x1c09('0x6b'),_0x2cd0ab);}})['then'](function(){return respondWithRpcPromise(_0x1c09('0x6c'),'create',{'module':_0x1c09('0x6d')});})[_0x1c09('0x20')](function(){var _0x3898d0=_0x9b143b[_0x1c09('0x61')][_0x1c09('0x36')]({'plain':!![]});if(!_0x3898d0)throw new Error(_0x1c09('0x60'));if(_0x3898d0['role']===_0x1c09('0x61')){var _0x122182=_0x1e928b[_0x1c09('0x36')]({'plain':!![]});return db['UserProfileSection'][_0x1c09('0x57')]({'where':{'name':_0x1c09('0x37'),'userProfileId':_0x3898d0['userProfileId']},'raw':!![]})[_0x1c09('0x20')](function(_0x594a1d){if(_0x594a1d&&_0x594a1d[_0x1c09('0x63')]===0x0){return db[_0x1c09('0x38')][_0x1c09('0x5f')]({'name':_0x122182['name'],'resourceId':_0x122182['id'],'type':_0x594a1d[_0x1c09('0x3a')],'sectionId':_0x594a1d['id']},{})[_0x1c09('0x20')](function(){return _0x1e928b;});}else{return _0x1e928b;}})[_0x1c09('0x58')](function(_0xa77c54){logger['error']('Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s',_0xa77c54);throw _0xa77c54;});}return _0x1e928b;})[_0x1c09('0x20')](respondWithResult(_0xf11028,0xc9))[_0x1c09('0x58')](handleError(_0xf11028,null));};exports['update']=function(_0x23bd66,_0xa23704,_0x449e28){var _0x1d1131;return db[_0x1c09('0x3c')]['find']({'where':{'id':_0x23bd66[_0x1c09('0x5a')]['id']}})[_0x1c09('0x20')](handleEntityNotFound(_0xa23704,null))['then'](saveUpdates(_0x23bd66['body'],null))[_0x1c09('0x20')](function(_0x5a9f03){if(_0x5a9f03){_0x1d1131=_0x5a9f03;return db[_0x1c09('0x3c')][_0x1c09('0x54')]({'raw':!![]});}})[_0x1c09('0x20')](function(_0xba6c53){if(_0xba6c53){var _0x500bf8=fs[_0x1c09('0x65')](path['join'](config[_0x1c09('0x6e')],'server/files/templates/trunk.ejs'),'utf8');var _0x422029=fs[_0x1c09('0x65')](path[_0x1c09('0x6f')](config[_0x1c09('0x6e')],'server/files/templates/registry.ejs'),_0x1c09('0x66'));var _0x527b88=ejs[_0x1c09('0x67')](_0x500bf8,{'trunks':_0xba6c53||[]});fs[_0x1c09('0x68')](_0x1c09('0x69'),_0x527b88);var _0x514854=ejs[_0x1c09('0x67')](_0x422029,{'trunks':_0xba6c53||[]});fs['writeFileSync']('/etc/asterisk/sip_xcally_registers.conf',_0x514854);return respondWithRpcPromise(_0x1c09('0x6c'),_0x1c09('0x34'),{'module':_0x1c09('0x6d')});}return null;})['then'](function(_0x14495a){if(_0x14495a){return _0x1d1131;}})[_0x1c09('0x20')](respondWithResult(_0xa23704,null))[_0x1c09('0x58')](handleError(_0xa23704,null));};exports[_0x1c09('0x35')]=function(_0x45e236,_0x173e83,_0x388495){var _0x1ad8b7;return db[_0x1c09('0x3c')][_0x1c09('0x57')]({'where':{'id':_0x45e236[_0x1c09('0x5a')]['id']}})[_0x1c09('0x20')](handleEntityNotFound(_0x173e83,null))[_0x1c09('0x20')](removeEntity(_0x173e83,null))[_0x1c09('0x20')](function(){return db[_0x1c09('0x3c')][_0x1c09('0x54')]({'raw':!![]});})[_0x1c09('0x20')](function(_0x3ed2f8){var _0x1ac9e4=fs[_0x1c09('0x65')](path[_0x1c09('0x6f')](config['root'],'server/files/templates/trunk.ejs'),_0x1c09('0x66'));var _0x1428b4=fs[_0x1c09('0x65')](path[_0x1c09('0x6f')](config[_0x1c09('0x6e')],_0x1c09('0x70')),_0x1c09('0x66'));var _0x167dd6=ejs[_0x1c09('0x67')](_0x1ac9e4,{'trunks':_0x3ed2f8});var _0x534b3a=ejs[_0x1c09('0x67')](_0x1428b4,{'trunks':_0x3ed2f8});fs['writeFileSync'](_0x1c09('0x69'),_0x167dd6);fs[_0x1c09('0x68')](_0x1c09('0x6b'),_0x534b3a);return respondWithRpcPromise(_0x1c09('0x6c'),_0x1c09('0x35'),{'module':_0x1c09('0x6d')});})[_0x1c09('0x58')](handleError(_0x173e83,null));};
\ No newline at end of file
+var _0x9c0d=['zip-dir','fast-json-patch','request-promise','moment','path','sox','to-csv','ejs','lodash','crypto','jsforce','querystring','../../components/auth/service','../../config/license/hardware','../../config/logger','api','../../config/utils','../../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~!@#$%^&-_=+[{]}.','then','info','Trunk,\x20%s,\x20%s','request\x20sent','Trunk,\x20%s,\x20%s,\x20%s','stringify','error','message','result','catch','sendStatus','status','end','json','count','offset','limit','set','Content-Range','apply','reject','save','destroy','Trunks','UserProfileResource','stack','name','send','index','Trunk','rawAttributes','type','key','model','map','query','keys','attributes','intersection','fields','length','hasOwnProperty','nolimit','order','filters','pick','filter','where','merge','includeAll','include','findAll','rows','show','params','options','find','get','omit','createdAt','body','updatedAt','create','role','UserProfileSection','autoAssociation','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','readFileSync','root','utf8','join','server/files/templates/registry.ejs','render','writeFileSync','/etc/asterisk/sip_xcally_trunks.conf','chan_sip.so','user','Unable\x20to\x20retrieve\x20the\x20current\x20user','update','server/files/templates/trunk.ejs','/etc/asterisk/sip_xcally_registers.conf','Reload','eml-format','rimraf'];(function(_0x14cb3d,_0x550c62){var _0x1d0f2f=function(_0x18de67){while(--_0x18de67){_0x14cb3d['push'](_0x14cb3d['shift']());}};_0x1d0f2f(++_0x550c62);}(_0x9c0d,0x145));var _0xd9c0=function(_0x54b78c,_0x598009){_0x54b78c=_0x54b78c-0x0;var _0x5039e4=_0x9c0d[_0x54b78c];return _0x5039e4;};'use strict';var pdf=require('html-pdf');var emlformat=require(_0xd9c0('0x0'));var rimraf=require(_0xd9c0('0x1'));var zipdir=require(_0xd9c0('0x2'));var jsonpatch=require(_0xd9c0('0x3'));var rp=require(_0xd9c0('0x4'));var moment=require(_0xd9c0('0x5'));var BPromise=require('bluebird');var Mustache=require('mustache');var util=require('util');var path=require(_0xd9c0('0x6'));var sox=require(_0xd9c0('0x7'));var csv=require(_0xd9c0('0x8'));var ejs=require(_0xd9c0('0x9'));var fs=require('fs');var _=require(_0xd9c0('0xa'));var squel=require('squel');var crypto=require(_0xd9c0('0xb'));var jsforce=require(_0xd9c0('0xc'));var deskjs=require('desk.js');var toCsv=require(_0xd9c0('0x8'));var querystring=require(_0xd9c0('0xd'));var Papa=require('papaparse');var Redis=require('ioredis');var authService=require(_0xd9c0('0xe'));var qs=require('../../components/parsers/qs');var as=require('../../components/parsers/advancedSearch');var hardwareService=require(_0xd9c0('0xf'));var logger=require(_0xd9c0('0x10'))(_0xd9c0('0x11'));var utils=require(_0xd9c0('0x12'));var config=require('../../config/environment');var db=require(_0xd9c0('0x13'))['db'];var jayson=require(_0xd9c0('0x14'));var client=jayson[_0xd9c0('0x15')][_0xd9c0('0x16')]({'port':0x232a});function checkPasswordPattern(_0x321066,_0xa18b2,_0x30ba7f){if(_0x30ba7f){var _0x45c657=new RegExp(/(?=.*[a-z])(?=.*[A-Z])(?=.*[0-9])(?=.*[?!@#\$%\^&\*~\-_=+[{\]\}])(?=.{8,})/);if(_0x45c657[_0xd9c0('0x17')](_0xa18b2)){return _0x321066;}else{throw new db[(_0xd9c0('0x18'))][(_0xd9c0('0x19'))](_0xd9c0('0x1a'));}}else{return _0x321066;}}function respondWithRpcPromise(_0x396e6a,_0x23daf6,_0x18925c,_0x2adb0d){return new BPromise(function(_0x3d2b8d,_0x24bcda){var _0x43c11f=_0x2adb0d||client;return _0x43c11f['request'](_0x396e6a,_0x18925c)[_0xd9c0('0x1b')](function(_0x260837){logger[_0xd9c0('0x1c')](_0xd9c0('0x1d'),_0x23daf6,_0xd9c0('0x1e'));logger['debug'](_0xd9c0('0x1f'),_0x23daf6,'request\x20sent',JSON[_0xd9c0('0x20')](_0x260837));if(_0x260837[_0xd9c0('0x21')]){if(_0x260837[_0xd9c0('0x21')]['code']===0x1f4){logger[_0xd9c0('0x21')]('Trunk,\x20%s,\x20%s',_0x23daf6,_0x260837[_0xd9c0('0x21')][_0xd9c0('0x22')]);return _0x24bcda(_0x260837['error'][_0xd9c0('0x22')]);}logger[_0xd9c0('0x21')](_0xd9c0('0x1d'),_0x23daf6,_0x260837['error'][_0xd9c0('0x22')]);return _0x3d2b8d(_0x260837['error'][_0xd9c0('0x22')]);}else{logger[_0xd9c0('0x1c')](_0xd9c0('0x1d'),_0x23daf6,_0xd9c0('0x1e'));_0x3d2b8d(_0x260837[_0xd9c0('0x23')]['message']);}})[_0xd9c0('0x24')](function(_0x256100){logger[_0xd9c0('0x21')]('Trunk,\x20%s,\x20%s',_0x23daf6,_0x256100);_0x24bcda(_0x256100);});});}function respondWithStatusCode(_0x435047,_0x36266f){_0x36266f=_0x36266f||0xcc;return function(_0x20c664){if(_0x20c664){return _0x435047[_0xd9c0('0x25')](_0x36266f);}return _0x435047[_0xd9c0('0x26')](_0x36266f)[_0xd9c0('0x27')]();};}function respondWithResult(_0x184c84,_0x11ad26){_0x11ad26=_0x11ad26||0xc8;return function(_0x245f3e){if(_0x245f3e){return _0x184c84[_0xd9c0('0x26')](_0x11ad26)[_0xd9c0('0x28')](_0x245f3e);}};}function respondWithFilteredResult(_0x14602b,_0x35dcda){return function(_0xc5b6e9){if(_0xc5b6e9){var _0x1ac1ff=_0xc5b6e9[_0xd9c0('0x29')],_0x5b6f53=_0x35dcda['offset'],_0x4b8bf5=_0x35dcda[_0xd9c0('0x2a')]+_0x35dcda[_0xd9c0('0x2b')],_0x3f14af;if(_0x4b8bf5>=_0x1ac1ff){_0x4b8bf5=_0x1ac1ff;_0x3f14af=0xc8;}else{_0x3f14af=0xce;}_0x14602b[_0xd9c0('0x26')](_0x3f14af);return _0x14602b[_0xd9c0('0x2c')](_0xd9c0('0x2d'),_0x5b6f53+'-'+_0x4b8bf5+'/'+_0x1ac1ff)[_0xd9c0('0x28')](_0xc5b6e9);}return null;};}function patchUpdates(_0x5346f4){return function(_0x55668d){try{jsonpatch[_0xd9c0('0x2e')](_0x55668d,_0x5346f4,!![]);}catch(_0x58d1ad){return BPromise[_0xd9c0('0x2f')](_0x58d1ad);}return _0x55668d[_0xd9c0('0x30')]();};}function saveUpdates(_0x2aaeba,_0x2c21f8){return function(_0x409187){if(_0x409187){return _0x409187['update'](_0x2aaeba)[_0xd9c0('0x1b')](function(_0x7b304c){return _0x7b304c;});}return null;};}function removeEntity(_0x53f9a4,_0x22fc01){return function(_0x4802f6){if(_0x4802f6){return _0x4802f6[_0xd9c0('0x31')]()[_0xd9c0('0x1b')](function(){var _0x16ac9f=_0x4802f6['get']({'plain':!![]});var _0x315614=_0xd9c0('0x32');return db[_0xd9c0('0x33')][_0xd9c0('0x31')]({'where':{'type':_0x315614,'resourceId':_0x16ac9f['id']}})['then'](function(){return _0x4802f6;});})['then'](function(){_0x53f9a4[_0xd9c0('0x26')](0xcc)['end']();});}};}function handleEntityNotFound(_0x7454ef,_0xcffe23){return function(_0x2249c2){if(!_0x2249c2){_0x7454ef[_0xd9c0('0x25')](0x194);}return _0x2249c2;};}function handleError(_0x17ecd6,_0x140bdd){_0x140bdd=_0x140bdd||0x1f4;return function(_0x25552c){logger[_0xd9c0('0x21')](_0x25552c[_0xd9c0('0x34')]);if(_0x25552c[_0xd9c0('0x35')]){delete _0x25552c[_0xd9c0('0x35')];}_0x17ecd6[_0xd9c0('0x26')](_0x140bdd)[_0xd9c0('0x36')](_0x25552c);};}exports[_0xd9c0('0x37')]=function(_0x4c33ad,_0x3ed869){var _0x1373d6={},_0x25b161={},_0x3abe2c={'count':0x0,'rows':[]};var _0xe1c02=_['map'](db[_0xd9c0('0x38')][_0xd9c0('0x39')],function(_0x2f1379){return{'name':_0x2f1379['fieldName'],'type':_0x2f1379[_0xd9c0('0x3a')][_0xd9c0('0x3b')]};});_0x25b161[_0xd9c0('0x3c')]=_[_0xd9c0('0x3d')](_0xe1c02,_0xd9c0('0x35'));_0x25b161[_0xd9c0('0x3e')]=_[_0xd9c0('0x3f')](_0x4c33ad[_0xd9c0('0x3e')]);_0x25b161['filters']=_['intersection'](_0x25b161[_0xd9c0('0x3c')],_0x25b161['query']);_0x1373d6[_0xd9c0('0x40')]=_[_0xd9c0('0x41')](_0x25b161[_0xd9c0('0x3c')],qs[_0xd9c0('0x42')](_0x4c33ad['query'][_0xd9c0('0x42')]));_0x1373d6['attributes']=_0x1373d6[_0xd9c0('0x40')][_0xd9c0('0x43')]?_0x1373d6[_0xd9c0('0x40')]:_0x25b161[_0xd9c0('0x3c')];if(!_0x4c33ad['query'][_0xd9c0('0x44')](_0xd9c0('0x45'))){_0x1373d6[_0xd9c0('0x2b')]=qs['limit'](_0x4c33ad['query']['limit']);_0x1373d6[_0xd9c0('0x2a')]=qs[_0xd9c0('0x2a')](_0x4c33ad[_0xd9c0('0x3e')][_0xd9c0('0x2a')]);}_0x1373d6[_0xd9c0('0x46')]=qs['sort'](_0x4c33ad[_0xd9c0('0x3e')]['sort']);_0x1373d6['where']=qs[_0xd9c0('0x47')](_[_0xd9c0('0x48')](_0x4c33ad['query'],_0x25b161['filters']));if(_0x4c33ad[_0xd9c0('0x3e')][_0xd9c0('0x49')]){_0x1373d6[_0xd9c0('0x4a')]=_[_0xd9c0('0x4b')](_0x1373d6[_0xd9c0('0x4a')],{'$or':_[_0xd9c0('0x3d')](_0xe1c02,function(_0x3139de){if(_0x3139de['type']!=='VIRTUAL'){var _0x2657eb={};_0x2657eb[_0x3139de[_0xd9c0('0x35')]]={'$like':'%'+_0x4c33ad[_0xd9c0('0x3e')][_0xd9c0('0x49')]+'%'};return _0x2657eb;}})});}_0x1373d6=_['merge']({},_0x1373d6,_0x4c33ad['options']);var _0x48f4a0={'where':_0x1373d6[_0xd9c0('0x4a')]};return db[_0xd9c0('0x38')]['count'](_0x48f4a0)[_0xd9c0('0x1b')](function(_0xa2086f){_0x3abe2c['count']=_0xa2086f;if(_0x4c33ad[_0xd9c0('0x3e')][_0xd9c0('0x4c')]){_0x1373d6[_0xd9c0('0x4d')]=[{'all':!![]}];}return db[_0xd9c0('0x38')][_0xd9c0('0x4e')](_0x1373d6);})[_0xd9c0('0x1b')](function(_0x2082fd){_0x3abe2c[_0xd9c0('0x4f')]=_0x2082fd;return _0x3abe2c;})[_0xd9c0('0x1b')](respondWithFilteredResult(_0x3ed869,_0x1373d6))['catch'](handleError(_0x3ed869,null));};exports[_0xd9c0('0x50')]=function(_0x49260f,_0x290386){var _0x2ab022={'raw':![],'where':{'id':_0x49260f[_0xd9c0('0x51')]['id']}},_0x388118={};_0x388118['model']=_['keys'](db['Trunk'][_0xd9c0('0x39')]);_0x388118[_0xd9c0('0x3e')]=_[_0xd9c0('0x3f')](_0x49260f[_0xd9c0('0x3e')]);_0x388118[_0xd9c0('0x47')]=_[_0xd9c0('0x41')](_0x388118[_0xd9c0('0x3c')],_0x388118['query']);_0x2ab022[_0xd9c0('0x40')]=_[_0xd9c0('0x41')](_0x388118[_0xd9c0('0x3c')],qs[_0xd9c0('0x42')](_0x49260f['query']['fields']));_0x2ab022[_0xd9c0('0x40')]=_0x2ab022[_0xd9c0('0x40')][_0xd9c0('0x43')]?_0x2ab022[_0xd9c0('0x40')]:_0x388118[_0xd9c0('0x3c')];if(_0x49260f['query'][_0xd9c0('0x4c')]){_0x2ab022[_0xd9c0('0x4d')]=[{'all':!![]}];}_0x2ab022=_[_0xd9c0('0x4b')]({},_0x2ab022,_0x49260f[_0xd9c0('0x52')]);return db[_0xd9c0('0x38')]['find'](_0x2ab022)[_0xd9c0('0x1b')](handleEntityNotFound(_0x290386,null))[_0xd9c0('0x1b')](respondWithResult(_0x290386,null))[_0xd9c0('0x24')](handleError(_0x290386,null));};exports['clone']=function(_0x3fb0b4,_0x1eb071){var _0x12bb9b={'where':{'id':_0x3fb0b4[_0xd9c0('0x51')]['id']}},_0x12692e={};_0x12692e['model']=_[_0xd9c0('0x3f')](db['Trunk'][_0xd9c0('0x39')]);_0x12bb9b[_0xd9c0('0x40')]=_[_0xd9c0('0x41')](_0x12692e[_0xd9c0('0x3c')],qs[_0xd9c0('0x42')](_0x3fb0b4[_0xd9c0('0x3e')][_0xd9c0('0x42')]));_0x12bb9b[_0xd9c0('0x40')]=_0x12bb9b[_0xd9c0('0x40')]['length']?_0x12bb9b[_0xd9c0('0x40')]:_0x12692e[_0xd9c0('0x3c')];if(_0x3fb0b4[_0xd9c0('0x3e')][_0xd9c0('0x4c')]){_0x12bb9b[_0xd9c0('0x4d')]=[{'all':!![]}];}_0x12bb9b=_[_0xd9c0('0x4b')]({},_0x12bb9b,_0x3fb0b4[_0xd9c0('0x52')]);return db['Trunk'][_0xd9c0('0x53')](_0x12bb9b)[_0xd9c0('0x1b')](handleEntityNotFound(_0x1eb071,null))[_0xd9c0('0x1b')](function(_0x33bba1){if(_0x33bba1){var _0x4b706c=_0x33bba1[_0xd9c0('0x54')]({'plain':!![]});_0x4b706c=qs[_0xd9c0('0x55')](_0x4b706c,['id',_0xd9c0('0x56'),'updatedAt']);_0x3fb0b4[_0xd9c0('0x57')]=_['omit'](_0x3fb0b4[_0xd9c0('0x57')],['id',_0xd9c0('0x56'),_0xd9c0('0x58')]);return db[_0xd9c0('0x38')][_0xd9c0('0x59')](_['merge'](_0x4b706c,_0x3fb0b4[_0xd9c0('0x57')]),{'include':_0x3fb0b4[_0xd9c0('0x3e')][_0xd9c0('0x4c')]?[{'all':!![]}]:undefined})[_0xd9c0('0x1b')](function(_0x51f650){var _0x1b7764=_0x3fb0b4['user'][_0xd9c0('0x54')]({'plain':!![]});if(!_0x1b7764)throw new Error('Unable\x20to\x20retrieve\x20the\x20current\x20user');if(_0x1b7764[_0xd9c0('0x5a')]==='user'){var _0x57e845=_0x51f650[_0xd9c0('0x54')]({'plain':!![]});var _0x13e1a1='Trunks';return db[_0xd9c0('0x5b')][_0xd9c0('0x53')]({'where':{'name':_0x13e1a1,'userProfileId':_0x1b7764['userProfileId']},'raw':!![]})[_0xd9c0('0x1b')](function(_0x139c9d){if(_0x139c9d&&_0x139c9d[_0xd9c0('0x5c')]===0x0){return db['UserProfileResource'][_0xd9c0('0x59')]({'name':_0x57e845[_0xd9c0('0x35')],'resourceId':_0x57e845['id'],'type':_0x139c9d[_0xd9c0('0x35')],'sectionId':_0x139c9d['id']},{})[_0xd9c0('0x1b')](function(){return _0x51f650;});}else{return _0x51f650;}})[_0xd9c0('0x24')](function(_0x5403a2){logger[_0xd9c0('0x21')](_0xd9c0('0x5d'),_0x5403a2);throw _0x5403a2;});}return _0x51f650;});}})[_0xd9c0('0x1b')](respondWithResult(_0x1eb071,0xc9))[_0xd9c0('0x24')](handleError(_0x1eb071,null));};exports[_0xd9c0('0x59')]=function(_0x31ba71,_0x288bcd,_0x299bb3){var _0x49d3c0;return db['Trunk'][_0xd9c0('0x59')](_0x31ba71[_0xd9c0('0x57')],{'raw':!![]})[_0xd9c0('0x1b')](function(_0x116a1c){_0x49d3c0=_0x116a1c;return db[_0xd9c0('0x38')][_0xd9c0('0x4e')]({'raw':!![]});})['then'](function(_0x13a5f7){var _0x43e93e=fs[_0xd9c0('0x5e')](path['join'](config[_0xd9c0('0x5f')],'server/files/templates/trunk.ejs'),_0xd9c0('0x60'));var _0x3a74a3=fs[_0xd9c0('0x5e')](path[_0xd9c0('0x61')](config[_0xd9c0('0x5f')],_0xd9c0('0x62')),_0xd9c0('0x60'));var _0x1774fa=ejs[_0xd9c0('0x63')](_0x43e93e,{'trunks':_0x13a5f7||[]});fs[_0xd9c0('0x64')](_0xd9c0('0x65'),_0x1774fa);if(_0x49d3c0['registry']){var _0xf34c11=ejs[_0xd9c0('0x63')](_0x3a74a3,{'trunks':_0x13a5f7||[]});fs['writeFileSync']('/etc/asterisk/sip_xcally_registers.conf',_0xf34c11);}})['then'](function(){return respondWithRpcPromise('Reload',_0xd9c0('0x59'),{'module':_0xd9c0('0x66')});})[_0xd9c0('0x1b')](function(){var _0x543081=_0x31ba71[_0xd9c0('0x67')][_0xd9c0('0x54')]({'plain':!![]});if(!_0x543081)throw new Error(_0xd9c0('0x68'));if(_0x543081[_0xd9c0('0x5a')]===_0xd9c0('0x67')){var _0x5c18e7=_0x49d3c0[_0xd9c0('0x54')]({'plain':!![]});return db[_0xd9c0('0x5b')]['find']({'where':{'name':_0xd9c0('0x32'),'userProfileId':_0x543081['userProfileId']},'raw':!![]})[_0xd9c0('0x1b')](function(_0x1a5020){if(_0x1a5020&&_0x1a5020[_0xd9c0('0x5c')]===0x0){return db[_0xd9c0('0x33')][_0xd9c0('0x59')]({'name':_0x5c18e7[_0xd9c0('0x35')],'resourceId':_0x5c18e7['id'],'type':_0x1a5020[_0xd9c0('0x35')],'sectionId':_0x1a5020['id']},{})[_0xd9c0('0x1b')](function(){return _0x49d3c0;});}else{return _0x49d3c0;}})[_0xd9c0('0x24')](function(_0x3b934d){logger['error'](_0xd9c0('0x5d'),_0x3b934d);throw _0x3b934d;});}return _0x49d3c0;})[_0xd9c0('0x1b')](respondWithResult(_0x288bcd,0xc9))[_0xd9c0('0x24')](handleError(_0x288bcd,null));};exports[_0xd9c0('0x69')]=function(_0x53f6aa,_0x3786f1,_0x5e1207){var _0x233452;return db[_0xd9c0('0x38')]['find']({'where':{'id':_0x53f6aa[_0xd9c0('0x51')]['id']}})['then'](handleEntityNotFound(_0x3786f1,null))[_0xd9c0('0x1b')](saveUpdates(_0x53f6aa['body'],null))['then'](function(_0x1141f9){if(_0x1141f9){_0x233452=_0x1141f9;return db[_0xd9c0('0x38')][_0xd9c0('0x4e')]({'raw':!![]});}})[_0xd9c0('0x1b')](function(_0x3c1e7b){if(_0x3c1e7b){var _0x45ac78=fs[_0xd9c0('0x5e')](path[_0xd9c0('0x61')](config[_0xd9c0('0x5f')],_0xd9c0('0x6a')),_0xd9c0('0x60'));var _0x2b7508=fs[_0xd9c0('0x5e')](path[_0xd9c0('0x61')](config[_0xd9c0('0x5f')],'server/files/templates/registry.ejs'),_0xd9c0('0x60'));var _0x2efe31=ejs[_0xd9c0('0x63')](_0x45ac78,{'trunks':_0x3c1e7b||[]});fs[_0xd9c0('0x64')](_0xd9c0('0x65'),_0x2efe31);var _0x115b95=ejs['render'](_0x2b7508,{'trunks':_0x3c1e7b||[]});fs[_0xd9c0('0x64')](_0xd9c0('0x6b'),_0x115b95);return respondWithRpcPromise(_0xd9c0('0x6c'),_0xd9c0('0x69'),{'module':_0xd9c0('0x66')});}return null;})[_0xd9c0('0x1b')](function(_0x300d0a){if(_0x300d0a){return _0x233452;}})[_0xd9c0('0x1b')](respondWithResult(_0x3786f1,null))['catch'](handleError(_0x3786f1,null));};exports[_0xd9c0('0x31')]=function(_0x578083,_0x1b7497,_0x46e26f){var _0x209240;return db[_0xd9c0('0x38')][_0xd9c0('0x53')]({'where':{'id':_0x578083[_0xd9c0('0x51')]['id']}})[_0xd9c0('0x1b')](handleEntityNotFound(_0x1b7497,null))[_0xd9c0('0x1b')](removeEntity(_0x1b7497,null))['then'](function(){return db['Trunk'][_0xd9c0('0x4e')]({'raw':!![]});})[_0xd9c0('0x1b')](function(_0x3f6a6d){var _0x107ffd=fs['readFileSync'](path[_0xd9c0('0x61')](config[_0xd9c0('0x5f')],'server/files/templates/trunk.ejs'),_0xd9c0('0x60'));var _0x585a63=fs[_0xd9c0('0x5e')](path[_0xd9c0('0x61')](config[_0xd9c0('0x5f')],_0xd9c0('0x62')),'utf8');var _0x3f2f11=ejs['render'](_0x107ffd,{'trunks':_0x3f6a6d});var _0xc5cf0=ejs['render'](_0x585a63,{'trunks':_0x3f6a6d});fs[_0xd9c0('0x64')]('/etc/asterisk/sip_xcally_trunks.conf',_0x3f2f11);fs['writeFileSync'](_0xd9c0('0x6b'),_0xc5cf0);return respondWithRpcPromise(_0xd9c0('0x6c'),_0xd9c0('0x31'),{'module':_0xd9c0('0x66')});})[_0xd9c0('0x24')](handleError(_0x1b7497,null));};
\ No newline at end of file
diff --git a/server/api/trunk/trunk.model.js b/server/api/trunk/trunk.model.js
index 75ae32e..1dea456 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 _0x2d8a=['exports','define','tools_trunks','lodash','util','api','request-promise','rimraf','./trunk.attributes'];(function(_0x56deb5,_0x58ee16){var _0x463975=function(_0x31bd63){while(--_0x31bd63){_0x56deb5['push'](_0x56deb5['shift']());}};_0x463975(++_0x58ee16);}(_0x2d8a,0xe4));var _0xa2d8=function(_0x1d0630,_0x643443){_0x1d0630=_0x1d0630-0x0;var _0x390871=_0x2d8a[_0x1d0630];return _0x390871;};'use strict';var _=require(_0xa2d8('0x0'));var util=require(_0xa2d8('0x1'));var logger=require('../../config/logger')(_0xa2d8('0x2'));var moment=require('moment');var BPromise=require('bluebird');var rp=require(_0xa2d8('0x3'));var fs=require('fs');var path=require('path');var rimraf=require(_0xa2d8('0x4'));var config=require('../../config/environment');var attributes=require(_0xa2d8('0x5'));module[_0xa2d8('0x6')]=function(_0x58347d,_0x514fd8){return _0x58347d[_0xa2d8('0x7')]('Trunk',attributes,{'tableName':_0xa2d8('0x8'),'paranoid':![],'indexes':[],'timestamps':!![]});};
\ No newline at end of file
+var _0x1996=['tools_trunks','lodash','../../config/logger','api','moment','bluebird','request-promise','path','rimraf','../../config/environment','./trunk.attributes','exports','define','Trunk'];(function(_0x3d8b22,_0x28e0f6){var _0x177f4b=function(_0x13629f){while(--_0x13629f){_0x3d8b22['push'](_0x3d8b22['shift']());}};_0x177f4b(++_0x28e0f6);}(_0x1996,0x119));var _0x6199=function(_0x1c56fc,_0x706580){_0x1c56fc=_0x1c56fc-0x0;var _0x3e7f43=_0x1996[_0x1c56fc];return _0x3e7f43;};'use strict';var _=require(_0x6199('0x0'));var util=require('util');var logger=require(_0x6199('0x1'))(_0x6199('0x2'));var moment=require(_0x6199('0x3'));var BPromise=require(_0x6199('0x4'));var rp=require(_0x6199('0x5'));var fs=require('fs');var path=require(_0x6199('0x6'));var rimraf=require(_0x6199('0x7'));var config=require(_0x6199('0x8'));var attributes=require(_0x6199('0x9'));module[_0x6199('0xa')]=function(_0x5262ca,_0x240610){return _0x5262ca[_0x6199('0xb')](_0x6199('0xc'),attributes,{'tableName':_0x6199('0xd'),'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 d6f86ee..5d7dfda 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 _0x9ffd=['lodash','util','moment','randomstring','ioredis','../../mysqldb','../../config/utils','rpc','../../config/environment','client','http','request','then','debug','Trunk,\x20%s,\x20%s,\x20%s','request\x20sent','stringify','error','code','message','Trunk,\x20%s,\x20%s','info','catch','GetTrunk','Trunk','findAll','options','raw','include','map','model','attributes','where','ShowTrunk'];(function(_0x2cc2ee,_0x2fef80){var _0x1a82d1=function(_0x5d07c9){while(--_0x5d07c9){_0x2cc2ee['push'](_0x2cc2ee['shift']());}};_0x1a82d1(++_0x2fef80);}(_0x9ffd,0xaa));var _0xd9ff=function(_0x2659c4,_0x41054a){_0x2659c4=_0x2659c4-0x0;var _0x5af1ba=_0x9ffd[_0x2659c4];return _0x5af1ba;};'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']('Trunk,\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')]('Trunk,\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')]('Trunk,\x20%s,\x20%s',_0x270eb2,'request\x20sent');_0x66282d(_0x58e728['result']['message']);}})[_0xd9ff('0x16')](function(_0x4f9d6d){logger[_0xd9ff('0x11')](_0xd9ff('0x14'),_0x270eb2,_0x4f9d6d);_0x13954e(_0x4f9d6d);});});}exports[_0xd9ff('0x17')]=function(_0x3afd19){var _0x5f45c4=this;return new Promise(function(_0x2d4df1,_0x3ccf15){return db[_0xd9ff('0x18')][_0xd9ff('0x19')]({'raw':_0x3afd19[_0xd9ff('0x1a')]?_0x3afd19[_0xd9ff('0x1a')][_0xd9ff('0x1b')]===undefined?!![]:![]:!![],'where':_0x3afd19[_0xd9ff('0x1a')]?_0x3afd19['options']['where']||null:null,'attributes':_0x3afd19[_0xd9ff('0x1a')]?_0x3afd19[_0xd9ff('0x1a')]['attributes']||null:null,'limit':_0x3afd19['options']?_0x3afd19['options']['limit']||null:null,'include':_0x3afd19[_0xd9ff('0x1a')]?_0x3afd19['options'][_0xd9ff('0x1c')]?_[_0xd9ff('0x1d')](_0x3afd19[_0xd9ff('0x1a')][_0xd9ff('0x1c')],function(_0x278b66){return{'model':db[_0x278b66[_0xd9ff('0x1e')]],'as':_0x278b66['as'],'attributes':_0x278b66['attributes'],'include':_0x278b66['include']?_[_0xd9ff('0x1d')](_0x278b66['include'],function(_0x3ca906){return{'model':db[_0x3ca906['model']],'as':_0x3ca906['as'],'attributes':_0x3ca906[_0xd9ff('0x1f')],'include':_0x3ca906['include']?_[_0xd9ff('0x1d')](_0x3ca906[_0xd9ff('0x1c')],function(_0x2138b4){return{'model':db[_0x2138b4[_0xd9ff('0x1e')]],'as':_0x2138b4['as'],'attributes':_0x2138b4['attributes']};}):[]};}):[]};}):[]:[]})[_0xd9ff('0xc')](function(_0xe11f88){logger[_0xd9ff('0x15')](_0xd9ff('0x17'),_0x3afd19);logger['debug'](_0xd9ff('0x17'),_0x3afd19,JSON[_0xd9ff('0x10')](_0xe11f88));_0x2d4df1(_0xe11f88);})[_0xd9ff('0x16')](function(_0x45fb63){logger[_0xd9ff('0x11')](_0xd9ff('0x17'),_0x45fb63[_0xd9ff('0x13')],_0x3afd19);_0x3ccf15(_0x5f45c4[_0xd9ff('0x11')](0x1f4,_0x45fb63[_0xd9ff('0x13')]));});});};exports['ShowTrunk']=function(_0xcea5db){var _0x4ba2be=this;return new Promise(function(_0x1d55fd,_0x29c532){return db[_0xd9ff('0x18')]['find']({'raw':_0xcea5db[_0xd9ff('0x1a')]?_0xcea5db[_0xd9ff('0x1a')][_0xd9ff('0x1b')]===undefined?!![]:![]:!![],'where':_0xcea5db[_0xd9ff('0x1a')]?_0xcea5db['options'][_0xd9ff('0x20')]||null:null,'attributes':_0xcea5db['options']?_0xcea5db[_0xd9ff('0x1a')][_0xd9ff('0x1f')]||null:null,'include':_0xcea5db[_0xd9ff('0x1a')]?_0xcea5db[_0xd9ff('0x1a')][_0xd9ff('0x1c')]?_[_0xd9ff('0x1d')](_0xcea5db[_0xd9ff('0x1a')][_0xd9ff('0x1c')],function(_0x36749c){return{'model':db[_0x36749c[_0xd9ff('0x1e')]],'as':_0x36749c['as'],'attributes':_0x36749c[_0xd9ff('0x1f')],'include':_0x36749c[_0xd9ff('0x1c')]?_[_0xd9ff('0x1d')](_0x36749c[_0xd9ff('0x1c')],function(_0x498025){return{'model':db[_0x498025[_0xd9ff('0x1e')]],'as':_0x498025['as'],'attributes':_0x498025[_0xd9ff('0x1f')],'include':_0x498025[_0xd9ff('0x1c')]?_['map'](_0x498025[_0xd9ff('0x1c')],function(_0x5e3ff9){return{'model':db[_0x5e3ff9[_0xd9ff('0x1e')]],'as':_0x5e3ff9['as'],'attributes':_0x5e3ff9['attributes']};}):[]};}):[]};}):[]:[]})[_0xd9ff('0xc')](function(_0x5db498){logger[_0xd9ff('0x15')](_0xd9ff('0x21'),_0xcea5db);logger[_0xd9ff('0xd')]('ShowTrunk',_0xcea5db,JSON['stringify'](_0x5db498));_0x1d55fd(_0x5db498);})['catch'](function(_0x7ac3d1){logger[_0xd9ff('0x11')](_0xd9ff('0x21'),_0x7ac3d1[_0xd9ff('0x13')],_0xcea5db);_0x29c532(_0x4ba2be[_0xd9ff('0x11')](0x1f4,_0x7ac3d1[_0xd9ff('0x13')]));});});};
\ No newline at end of file
+var _0x5f66=['debug','Trunk,\x20%s,\x20%s,\x20%s','stringify','code','message','error','info','catch','GetTrunk','findAll','options','attributes','limit','include','model','map','ShowTrunk','Trunk','raw','where','util','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','rpc','jayson/promise','client','request','then','Trunk,\x20%s,\x20%s','request\x20sent'];(function(_0x2e0724,_0x4a3aa5){var _0x46bf1c=function(_0x19e2d4){while(--_0x19e2d4){_0x2e0724['push'](_0x2e0724['shift']());}};_0x46bf1c(++_0x4a3aa5);}(_0x5f66,0x1a0));var _0x65f6=function(_0x5d4607,_0x6b5e7b){_0x5d4607=_0x5d4607-0x0;var _0x5e4a86=_0x5f66[_0x5d4607];return _0x5e4a86;};'use strict';var _=require('lodash');var util=require(_0x65f6('0x0'));var moment=require('moment');var BPromise=require(_0x65f6('0x1'));var rs=require(_0x65f6('0x2'));var fs=require('fs');var Redis=require(_0x65f6('0x3'));var db=require(_0x65f6('0x4'))['db'];var utils=require(_0x65f6('0x5'));var logger=require('../../config/logger')(_0x65f6('0x6'));var config=require('../../config/environment');var jayson=require(_0x65f6('0x7'));var client=jayson[_0x65f6('0x8')]['http']({'port':0x232a});function respondWithRpcPromise(_0x4ed98f,_0x1c0e12,_0x2c6571){return new BPromise(function(_0x112079,_0x8f6451){return client[_0x65f6('0x9')](_0x4ed98f,_0x2c6571)[_0x65f6('0xa')](function(_0x48d85c){logger['info'](_0x65f6('0xb'),_0x1c0e12,_0x65f6('0xc'));logger[_0x65f6('0xd')](_0x65f6('0xe'),_0x1c0e12,'request\x20sent',JSON[_0x65f6('0xf')](_0x48d85c));if(_0x48d85c['error']){if(_0x48d85c['error'][_0x65f6('0x10')]===0x1f4){logger['error'](_0x65f6('0xb'),_0x1c0e12,_0x48d85c['error'][_0x65f6('0x11')]);return _0x8f6451(_0x48d85c[_0x65f6('0x12')][_0x65f6('0x11')]);}logger[_0x65f6('0x12')](_0x65f6('0xb'),_0x1c0e12,_0x48d85c[_0x65f6('0x12')][_0x65f6('0x11')]);return _0x112079(_0x48d85c[_0x65f6('0x12')][_0x65f6('0x11')]);}else{logger[_0x65f6('0x13')]('Trunk,\x20%s,\x20%s',_0x1c0e12,_0x65f6('0xc'));_0x112079(_0x48d85c['result']['message']);}})[_0x65f6('0x14')](function(_0x5c69f8){logger[_0x65f6('0x12')](_0x65f6('0xb'),_0x1c0e12,_0x5c69f8);_0x8f6451(_0x5c69f8);});});}exports[_0x65f6('0x15')]=function(_0x1f974c){var _0xc8660c=this;return new Promise(function(_0x18380e,_0x495dd6){return db['Trunk'][_0x65f6('0x16')]({'raw':_0x1f974c['options']?_0x1f974c['options']['raw']===undefined?!![]:![]:!![],'where':_0x1f974c[_0x65f6('0x17')]?_0x1f974c[_0x65f6('0x17')]['where']||null:null,'attributes':_0x1f974c[_0x65f6('0x17')]?_0x1f974c[_0x65f6('0x17')][_0x65f6('0x18')]||null:null,'limit':_0x1f974c[_0x65f6('0x17')]?_0x1f974c[_0x65f6('0x17')][_0x65f6('0x19')]||null:null,'include':_0x1f974c['options']?_0x1f974c[_0x65f6('0x17')]['include']?_['map'](_0x1f974c[_0x65f6('0x17')][_0x65f6('0x1a')],function(_0x524e42){return{'model':db[_0x524e42[_0x65f6('0x1b')]],'as':_0x524e42['as'],'attributes':_0x524e42[_0x65f6('0x18')],'include':_0x524e42[_0x65f6('0x1a')]?_[_0x65f6('0x1c')](_0x524e42['include'],function(_0x9d7bb0){return{'model':db[_0x9d7bb0[_0x65f6('0x1b')]],'as':_0x9d7bb0['as'],'attributes':_0x9d7bb0[_0x65f6('0x18')],'include':_0x9d7bb0['include']?_['map'](_0x9d7bb0['include'],function(_0x29abdb){return{'model':db[_0x29abdb[_0x65f6('0x1b')]],'as':_0x29abdb['as'],'attributes':_0x29abdb['attributes']};}):[]};}):[]};}):[]:[]})[_0x65f6('0xa')](function(_0x28f710){logger['info'](_0x65f6('0x15'),_0x1f974c);logger[_0x65f6('0xd')](_0x65f6('0x15'),_0x1f974c,JSON['stringify'](_0x28f710));_0x18380e(_0x28f710);})['catch'](function(_0x488d36){logger[_0x65f6('0x12')](_0x65f6('0x15'),_0x488d36[_0x65f6('0x11')],_0x1f974c);_0x495dd6(_0xc8660c[_0x65f6('0x12')](0x1f4,_0x488d36[_0x65f6('0x11')]));});});};exports[_0x65f6('0x1d')]=function(_0x144e55){var _0x4ace4c=this;return new Promise(function(_0x4ea23d,_0x154cbd){return db[_0x65f6('0x1e')]['find']({'raw':_0x144e55['options']?_0x144e55[_0x65f6('0x17')][_0x65f6('0x1f')]===undefined?!![]:![]:!![],'where':_0x144e55[_0x65f6('0x17')]?_0x144e55[_0x65f6('0x17')][_0x65f6('0x20')]||null:null,'attributes':_0x144e55[_0x65f6('0x17')]?_0x144e55['options'][_0x65f6('0x18')]||null:null,'include':_0x144e55[_0x65f6('0x17')]?_0x144e55[_0x65f6('0x17')]['include']?_[_0x65f6('0x1c')](_0x144e55[_0x65f6('0x17')][_0x65f6('0x1a')],function(_0x45510a){return{'model':db[_0x45510a[_0x65f6('0x1b')]],'as':_0x45510a['as'],'attributes':_0x45510a[_0x65f6('0x18')],'include':_0x45510a['include']?_[_0x65f6('0x1c')](_0x45510a[_0x65f6('0x1a')],function(_0x4f3e22){return{'model':db[_0x4f3e22[_0x65f6('0x1b')]],'as':_0x4f3e22['as'],'attributes':_0x4f3e22['attributes'],'include':_0x4f3e22[_0x65f6('0x1a')]?_['map'](_0x4f3e22[_0x65f6('0x1a')],function(_0x24f7fd){return{'model':db[_0x24f7fd['model']],'as':_0x24f7fd['as'],'attributes':_0x24f7fd[_0x65f6('0x18')]};}):[]};}):[]};}):[]:[]})[_0x65f6('0xa')](function(_0x3b261d){logger['info']('ShowTrunk',_0x144e55);logger[_0x65f6('0xd')]('ShowTrunk',_0x144e55,JSON[_0x65f6('0xf')](_0x3b261d));_0x4ea23d(_0x3b261d);})['catch'](function(_0x22d760){logger[_0x65f6('0x12')]('ShowTrunk',_0x22d760[_0x65f6('0x11')],_0x144e55);_0x154cbd(_0x4ace4c['error'](0x1f4,_0x22d760['message']));});});};
\ No newline at end of file
diff --git a/server/api/user/index.js b/server/api/user/index.js
index e2d20a9..9f89cad 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 _0x7a54=['getChatInteractions','/:id/openchannel/interactions','getOpenchannelInteractions','/:id/mail/interactions','getMailInteractions','/:id/sms/interactions','/:id/fax/interactions','/:id/teams','getTeams','/:id/lists','/:id/agents','getAgents','getVoicePrefixes','/:id/fax_accounts','getFaxAccounts','/:id/mail_accounts','getMailAccounts','/:id/openchannel_accounts','getOpenchannelAccounts','/:id/sms_accounts','getSmsAccounts','/:id/chat_websites','getChatWebsites','/:id/square_projects','getSquareProjects','/:id/scheduled_calls','/:id/api_key','/create_many','post','addContacts','create','addQueues','join','server/files/images/','format','%s-%s','now','originalname','/:id/avatar','single','addAvatar','login','logout','/:id/pause','addTeams','/:id/chat_interactions','addChatInteractions','/:id/mail_interactions','addMailInteractions','addFaxInteractions','/:id/sms_interactions','addSmsInteractions','addFaxAccounts','addMailAccounts','addSmsAccounts','addChatWebsites','addSquareProjects','createApiKey','/:id/password','changePassword','delete','removeQueues','removeTeams','destroy','removeChatInteractions','removeMailInteractions','removeFaxInteractions','/:id/openchannel_interactions','removeOpenchannelInteractions','removeFaxAccounts','removeMailAccounts','removeOpenchannelAccounts','multer','util','path','express','Router','../../components/interaction/service','../../config/environment','./user.controller','get','isAuthenticated','describe','/whoami','/:id','/:id/contacts','getContacts','/:id/queues','/:id/queues_rt','getVoiceQueuesRt','/:id/groups','getGroups','/:id/recordings','getRecordings','/:id/screen_recordings'];(function(_0x2b521b,_0x109d81){var _0x525d45=function(_0x4bb0f7){while(--_0x4bb0f7){_0x2b521b['push'](_0x2b521b['shift']());}};_0x525d45(++_0x109d81);}(_0x7a54,0x106));var _0x47a5=function(_0x2dba34,_0x5e758c){_0x2dba34=_0x2dba34-0x0;var _0x501c81=_0x7a54[_0x2dba34];return _0x501c81;};'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['whoami']);router['get'](_0x47a5('0xc'),auth[_0x47a5('0x9')](),controller['show']);router[_0x47a5('0x8')]('/:id/avatar',controller['getAvatar']);router[_0x47a5('0x8')](_0x47a5('0xd'),auth[_0x47a5('0x9')](),controller[_0x47a5('0xe')]);router[_0x47a5('0x8')](_0x47a5('0xf'),auth[_0x47a5('0x9')](),controller['getQueues']);router[_0x47a5('0x8')](_0x47a5('0x10'),auth[_0x47a5('0x9')](),controller[_0x47a5('0x11')]);router[_0x47a5('0x8')](_0x47a5('0x12'),auth[_0x47a5('0x9')](),controller[_0x47a5('0x13')]);router['get'](_0x47a5('0x14'),auth[_0x47a5('0x9')](),controller[_0x47a5('0x15')]);router[_0x47a5('0x8')](_0x47a5('0x16'),auth['isAuthenticated'](),controller['getScreenRecordings']);router[_0x47a5('0x8')]('/:id/chat/interactions',auth['isAuthenticated'](),controller[_0x47a5('0x17')]);router[_0x47a5('0x8')](_0x47a5('0x18'),auth[_0x47a5('0x9')](),controller[_0x47a5('0x19')]);router[_0x47a5('0x8')](_0x47a5('0x1a'),auth[_0x47a5('0x9')](),controller[_0x47a5('0x1b')]);router['get'](_0x47a5('0x1c'),auth[_0x47a5('0x9')](),controller['getSmsInteractions']);router[_0x47a5('0x8')](_0x47a5('0x1d'),auth[_0x47a5('0x9')](),controller['getFaxInteractions']);router[_0x47a5('0x8')](_0x47a5('0x1e'),auth[_0x47a5('0x9')](),controller[_0x47a5('0x1f')]);router['get'](_0x47a5('0x20'),auth[_0x47a5('0x9')](),controller['getLists']);router[_0x47a5('0x8')](_0x47a5('0x21'),auth[_0x47a5('0x9')](),controller[_0x47a5('0x22')]);router[_0x47a5('0x8')]('/:id/prefixes',auth['isAuthenticated'](),controller[_0x47a5('0x23')]);router['get'](_0x47a5('0x24'),auth['isAuthenticated'](),controller[_0x47a5('0x25')]);router[_0x47a5('0x8')](_0x47a5('0x26'),auth[_0x47a5('0x9')](),controller[_0x47a5('0x27')]);router[_0x47a5('0x8')](_0x47a5('0x28'),auth[_0x47a5('0x9')](),controller[_0x47a5('0x29')]);router[_0x47a5('0x8')](_0x47a5('0x2a'),auth[_0x47a5('0x9')](),controller[_0x47a5('0x2b')]);router['get'](_0x47a5('0x2c'),auth['isAuthenticated'](),controller[_0x47a5('0x2d')]);router[_0x47a5('0x8')](_0x47a5('0x2e'),auth['isAuthenticated'](),controller[_0x47a5('0x2f')]);router[_0x47a5('0x8')](_0x47a5('0x30'),auth[_0x47a5('0x9')](),controller['getScheduledCalls']);router['get'](_0x47a5('0x31'),auth[_0x47a5('0x9')](),controller['getApiKey']);router['post'](_0x47a5('0x32'),auth[_0x47a5('0x9')](),controller['bulkCreate']);router[_0x47a5('0x33')]('/:id/contacts',auth[_0x47a5('0x9')](),controller[_0x47a5('0x34')]);router['post']('/',auth['isAuthenticated'](),controller[_0x47a5('0x35')]);router['post'](_0x47a5('0xf'),auth[_0x47a5('0x9')](),controller[_0x47a5('0x36')]);var upload=multer({'storage':multer['diskStorage']({'destination':function(_0x18f7e9,_0x50c086,_0x53c754){_0x53c754(null,path[_0x47a5('0x37')](config['root'],_0x47a5('0x38')));},'filename':function(_0x5ef577,_0x21ad34,_0x3534cb){_0x3534cb(null,util[_0x47a5('0x39')](_0x47a5('0x3a'),Date[_0x47a5('0x3b')](),_0x21ad34[_0x47a5('0x3c')]));}})});router[_0x47a5('0x33')](_0x47a5('0x3d'),upload[_0x47a5('0x3e')]('file'),controller[_0x47a5('0x3f')]);router[_0x47a5('0x33')]('/:id/login',auth[_0x47a5('0x9')](),controller[_0x47a5('0x40')]);router[_0x47a5('0x33')]('/:id/logout',auth[_0x47a5('0x9')](),controller[_0x47a5('0x41')]);router['post'](_0x47a5('0x42'),auth[_0x47a5('0x9')](),controller['pause']);router['post']('/:id/unpause',auth[_0x47a5('0x9')](),controller['unpause']);router[_0x47a5('0x33')](_0x47a5('0x1e'),auth[_0x47a5('0x9')](),controller[_0x47a5('0x43')]);router[_0x47a5('0x33')](_0x47a5('0x44'),auth[_0x47a5('0x9')](),controller[_0x47a5('0x45')]);router[_0x47a5('0x33')](_0x47a5('0x46'),auth[_0x47a5('0x9')](),controller[_0x47a5('0x47')]);router[_0x47a5('0x33')]('/:id/fax_interactions',auth[_0x47a5('0x9')](),controller[_0x47a5('0x48')]);router[_0x47a5('0x33')](_0x47a5('0x49'),auth['isAuthenticated'](),controller[_0x47a5('0x4a')]);router['post']('/:id/openchannel_interactions',auth['isAuthenticated'](),controller['addOpenchannelInteractions']);router[_0x47a5('0x33')]('/:id/fax_accounts',auth[_0x47a5('0x9')](),controller[_0x47a5('0x4b')]);router[_0x47a5('0x33')]('/:id/mail_accounts',auth[_0x47a5('0x9')](),controller[_0x47a5('0x4c')]);router['post']('/:id/openchannel_accounts',auth[_0x47a5('0x9')](),controller['addOpenchannelAccounts']);router[_0x47a5('0x33')](_0x47a5('0x2a'),auth[_0x47a5('0x9')](),controller[_0x47a5('0x4d')]);router[_0x47a5('0x33')](_0x47a5('0x2c'),auth[_0x47a5('0x9')](),controller[_0x47a5('0x4e')]);router[_0x47a5('0x33')](_0x47a5('0x2e'),auth[_0x47a5('0x9')](),controller[_0x47a5('0x4f')]);router[_0x47a5('0x33')](_0x47a5('0x31'),auth[_0x47a5('0x9')](),controller[_0x47a5('0x50')]);router['put'](_0x47a5('0xc'),auth[_0x47a5('0x9')](),controller['update']);router['put'](_0x47a5('0x51'),auth['isAuthenticated'](),controller[_0x47a5('0x52')]);router[_0x47a5('0x53')]('/:id/queues',auth['isAuthenticated'](),controller[_0x47a5('0x54')]);router['delete'](_0x47a5('0x1e'),auth[_0x47a5('0x9')](),controller[_0x47a5('0x55')]);router[_0x47a5('0x53')](_0x47a5('0xc'),auth[_0x47a5('0x9')](),controller[_0x47a5('0x56')]);router['delete']('/:id/chat_interactions',auth[_0x47a5('0x9')](),controller[_0x47a5('0x57')]);router[_0x47a5('0x53')](_0x47a5('0x46'),auth[_0x47a5('0x9')](),controller[_0x47a5('0x58')]);router[_0x47a5('0x53')]('/:id/fax_interactions',auth[_0x47a5('0x9')](),controller[_0x47a5('0x59')]);router[_0x47a5('0x53')]('/:id/sms_interactions',auth[_0x47a5('0x9')](),controller['removeSmsInteractions']);router[_0x47a5('0x53')](_0x47a5('0x5a'),auth[_0x47a5('0x9')](),controller[_0x47a5('0x5b')]);router['delete'](_0x47a5('0x24'),auth[_0x47a5('0x9')](),controller[_0x47a5('0x5c')]);router[_0x47a5('0x53')](_0x47a5('0x26'),auth[_0x47a5('0x9')](),controller[_0x47a5('0x5d')]);router['delete'](_0x47a5('0x28'),auth[_0x47a5('0x9')](),controller[_0x47a5('0x5e')]);router[_0x47a5('0x53')](_0x47a5('0x2a'),auth[_0x47a5('0x9')](),controller['removeSmsAccounts']);router[_0x47a5('0x53')](_0x47a5('0x2c'),auth[_0x47a5('0x9')](),controller['removeChatWebsites']);router[_0x47a5('0x53')](_0x47a5('0x2e'),auth[_0x47a5('0x9')](),controller['removeSquareProjects']);router['delete'](_0x47a5('0x31'),auth[_0x47a5('0x9')](),controller['removeApiKey']);module['exports']=router;
\ No newline at end of file
+var _0x2ef3=['getAvatar','/:id/contacts','getContacts','/:id/queues','getQueues','getVoiceQueuesRt','/:id/groups','getGroups','/:id/screen_recordings','/:id/chat/interactions','getChatInteractions','/:id/openchannel/interactions','/:id/mail/interactions','getMailInteractions','/:id/sms/interactions','getSmsInteractions','/:id/fax/interactions','/:id/teams','/:id/lists','getLists','/:id/prefixes','getVoicePrefixes','/:id/fax_accounts','getFaxAccounts','/:id/mail_accounts','getMailAccounts','getOpenchannelAccounts','/:id/sms_accounts','getSmsAccounts','getChatWebsites','/:id/square_projects','getSquareProjects','/:id/api_key','getApiKey','post','/create_many','bulkCreate','create','join','now','originalname','single','file','addAvatar','/:id/login','login','/:id/logout','logout','/:id/pause','pause','/:id/unpause','unpause','/:id/chat_interactions','addChatInteractions','/:id/mail_interactions','/:id/fax_interactions','addFaxInteractions','addSmsInteractions','/:id/openchannel_interactions','addOpenchannelInteractions','addFaxAccounts','addMailAccounts','/:id/chat_websites','addChatWebsites','createApiKey','put','update','/:id/password','changePassword','delete','removeQueues','removeTeams','destroy','removeChatInteractions','removeMailInteractions','removeFaxInteractions','/:id/sms_interactions','removeSmsInteractions','removeOpenchannelInteractions','removeFaxAccounts','removeMailAccounts','removeOpenchannelAccounts','removeChatWebsites','removeSquareProjects','removeApiKey','multer','util','path','connect-timeout','express','Router','../../components/interaction/service','../../config/environment','get','isAuthenticated','/describe','describe','/whoami','whoami','/:id','/:id/avatar'];(function(_0x33fa74,_0x5b5235){var _0x287610=function(_0x520df9){while(--_0x520df9){_0x33fa74['push'](_0x33fa74['shift']());}};_0x287610(++_0x5b5235);}(_0x2ef3,0xba));var _0x32ef=function(_0x1fd256,_0x359abb){_0x1fd256=_0x1fd256-0x0;var _0x3a28c1=_0x2ef3[_0x1fd256];return _0x3a28c1;};'use strict';var multer=require(_0x32ef('0x0'));var util=require(_0x32ef('0x1'));var path=require(_0x32ef('0x2'));var timeout=require(_0x32ef('0x3'));var express=require(_0x32ef('0x4'));var router=express[_0x32ef('0x5')]();var auth=require('../../components/auth/service');var interaction=require(_0x32ef('0x6'));var config=require(_0x32ef('0x7'));var controller=require('./user.controller');router[_0x32ef('0x8')]('/',auth[_0x32ef('0x9')](),controller['index']);router['get'](_0x32ef('0xa'),auth[_0x32ef('0x9')](),controller[_0x32ef('0xb')]);router[_0x32ef('0x8')](_0x32ef('0xc'),auth[_0x32ef('0x9')](),controller[_0x32ef('0xd')]);router[_0x32ef('0x8')](_0x32ef('0xe'),auth[_0x32ef('0x9')](),controller['show']);router['get'](_0x32ef('0xf'),controller[_0x32ef('0x10')]);router[_0x32ef('0x8')](_0x32ef('0x11'),auth['isAuthenticated'](),controller[_0x32ef('0x12')]);router['get'](_0x32ef('0x13'),auth['isAuthenticated'](),controller[_0x32ef('0x14')]);router[_0x32ef('0x8')]('/:id/queues_rt',auth['isAuthenticated'](),controller[_0x32ef('0x15')]);router['get'](_0x32ef('0x16'),auth[_0x32ef('0x9')](),controller[_0x32ef('0x17')]);router[_0x32ef('0x8')]('/:id/recordings',auth['isAuthenticated'](),controller['getRecordings']);router[_0x32ef('0x8')](_0x32ef('0x18'),auth[_0x32ef('0x9')](),controller['getScreenRecordings']);router['get'](_0x32ef('0x19'),auth[_0x32ef('0x9')](),controller[_0x32ef('0x1a')]);router['get'](_0x32ef('0x1b'),auth[_0x32ef('0x9')](),controller['getOpenchannelInteractions']);router[_0x32ef('0x8')](_0x32ef('0x1c'),auth[_0x32ef('0x9')](),controller[_0x32ef('0x1d')]);router[_0x32ef('0x8')](_0x32ef('0x1e'),auth['isAuthenticated'](),controller[_0x32ef('0x1f')]);router['get'](_0x32ef('0x20'),auth[_0x32ef('0x9')](),controller['getFaxInteractions']);router[_0x32ef('0x8')](_0x32ef('0x21'),auth[_0x32ef('0x9')](),controller['getTeams']);router['get'](_0x32ef('0x22'),auth[_0x32ef('0x9')](),controller[_0x32ef('0x23')]);router['get']('/:id/agents',auth[_0x32ef('0x9')](),controller['getAgents']);router['get'](_0x32ef('0x24'),auth[_0x32ef('0x9')](),controller[_0x32ef('0x25')]);router[_0x32ef('0x8')](_0x32ef('0x26'),auth[_0x32ef('0x9')](),controller[_0x32ef('0x27')]);router[_0x32ef('0x8')](_0x32ef('0x28'),auth[_0x32ef('0x9')](),controller[_0x32ef('0x29')]);router[_0x32ef('0x8')]('/:id/openchannel_accounts',auth[_0x32ef('0x9')](),controller[_0x32ef('0x2a')]);router['get'](_0x32ef('0x2b'),auth[_0x32ef('0x9')](),controller[_0x32ef('0x2c')]);router[_0x32ef('0x8')]('/:id/chat_websites',auth[_0x32ef('0x9')](),controller[_0x32ef('0x2d')]);router[_0x32ef('0x8')](_0x32ef('0x2e'),auth[_0x32ef('0x9')](),controller[_0x32ef('0x2f')]);router[_0x32ef('0x8')]('/:id/scheduled_calls',auth[_0x32ef('0x9')](),controller['getScheduledCalls']);router[_0x32ef('0x8')](_0x32ef('0x30'),auth['isAuthenticated'](),controller[_0x32ef('0x31')]);router[_0x32ef('0x32')](_0x32ef('0x33'),auth[_0x32ef('0x9')](),controller[_0x32ef('0x34')]);router['post']('/:id/contacts',auth[_0x32ef('0x9')](),controller['addContacts']);router[_0x32ef('0x32')]('/',auth[_0x32ef('0x9')](),controller[_0x32ef('0x35')]);router[_0x32ef('0x32')](_0x32ef('0x13'),auth[_0x32ef('0x9')](),controller['addQueues']);var upload=multer({'storage':multer['diskStorage']({'destination':function(_0x484ad7,_0x2261a6,_0x3c4651){_0x3c4651(null,path[_0x32ef('0x36')](config['root'],'server/files/images/'));},'filename':function(_0x1c3633,_0x2bd8a9,_0x410334){_0x410334(null,util['format']('%s-%s',Date[_0x32ef('0x37')](),_0x2bd8a9[_0x32ef('0x38')]));}})});router[_0x32ef('0x32')](_0x32ef('0xf'),upload[_0x32ef('0x39')](_0x32ef('0x3a')),controller[_0x32ef('0x3b')]);router[_0x32ef('0x32')](_0x32ef('0x3c'),auth['isAuthenticated'](),controller[_0x32ef('0x3d')]);router[_0x32ef('0x32')](_0x32ef('0x3e'),auth['isAuthenticated'](),controller[_0x32ef('0x3f')]);router[_0x32ef('0x32')](_0x32ef('0x40'),auth[_0x32ef('0x9')](),controller[_0x32ef('0x41')]);router[_0x32ef('0x32')](_0x32ef('0x42'),auth[_0x32ef('0x9')](),controller[_0x32ef('0x43')]);router[_0x32ef('0x32')](_0x32ef('0x21'),auth[_0x32ef('0x9')](),controller['addTeams']);router[_0x32ef('0x32')](_0x32ef('0x44'),auth[_0x32ef('0x9')](),controller[_0x32ef('0x45')]);router[_0x32ef('0x32')](_0x32ef('0x46'),auth[_0x32ef('0x9')](),controller['addMailInteractions']);router['post'](_0x32ef('0x47'),auth[_0x32ef('0x9')](),controller[_0x32ef('0x48')]);router[_0x32ef('0x32')]('/:id/sms_interactions',auth[_0x32ef('0x9')](),controller[_0x32ef('0x49')]);router['post'](_0x32ef('0x4a'),auth['isAuthenticated'](),controller[_0x32ef('0x4b')]);router[_0x32ef('0x32')](_0x32ef('0x26'),auth[_0x32ef('0x9')](),controller[_0x32ef('0x4c')]);router[_0x32ef('0x32')](_0x32ef('0x28'),auth[_0x32ef('0x9')](),controller[_0x32ef('0x4d')]);router[_0x32ef('0x32')]('/:id/openchannel_accounts',auth[_0x32ef('0x9')](),controller['addOpenchannelAccounts']);router[_0x32ef('0x32')](_0x32ef('0x2b'),auth[_0x32ef('0x9')](),controller['addSmsAccounts']);router[_0x32ef('0x32')](_0x32ef('0x4e'),auth[_0x32ef('0x9')](),controller[_0x32ef('0x4f')]);router[_0x32ef('0x32')](_0x32ef('0x2e'),auth[_0x32ef('0x9')](),controller['addSquareProjects']);router['post'](_0x32ef('0x30'),auth[_0x32ef('0x9')](),controller[_0x32ef('0x50')]);router[_0x32ef('0x51')](_0x32ef('0xe'),auth[_0x32ef('0x9')](),controller[_0x32ef('0x52')]);router[_0x32ef('0x51')](_0x32ef('0x53'),auth[_0x32ef('0x9')](),controller[_0x32ef('0x54')]);router[_0x32ef('0x55')](_0x32ef('0x13'),auth['isAuthenticated'](),controller[_0x32ef('0x56')]);router[_0x32ef('0x55')](_0x32ef('0x21'),auth[_0x32ef('0x9')](),controller[_0x32ef('0x57')]);router[_0x32ef('0x55')](_0x32ef('0xe'),auth[_0x32ef('0x9')](),controller[_0x32ef('0x58')]);router[_0x32ef('0x55')](_0x32ef('0x44'),auth[_0x32ef('0x9')](),controller[_0x32ef('0x59')]);router[_0x32ef('0x55')](_0x32ef('0x46'),auth[_0x32ef('0x9')](),controller[_0x32ef('0x5a')]);router[_0x32ef('0x55')]('/:id/fax_interactions',auth['isAuthenticated'](),controller[_0x32ef('0x5b')]);router[_0x32ef('0x55')](_0x32ef('0x5c'),auth[_0x32ef('0x9')](),controller[_0x32ef('0x5d')]);router[_0x32ef('0x55')](_0x32ef('0x4a'),auth[_0x32ef('0x9')](),controller[_0x32ef('0x5e')]);router[_0x32ef('0x55')](_0x32ef('0x26'),auth['isAuthenticated'](),controller[_0x32ef('0x5f')]);router[_0x32ef('0x55')](_0x32ef('0x28'),auth[_0x32ef('0x9')](),controller[_0x32ef('0x60')]);router[_0x32ef('0x55')]('/:id/openchannel_accounts',auth[_0x32ef('0x9')](),controller[_0x32ef('0x61')]);router[_0x32ef('0x55')]('/:id/sms_accounts',auth[_0x32ef('0x9')](),controller['removeSmsAccounts']);router[_0x32ef('0x55')](_0x32ef('0x4e'),auth['isAuthenticated'](),controller[_0x32ef('0x62')]);router['delete'](_0x32ef('0x2e'),auth[_0x32ef('0x9')](),controller[_0x32ef('0x63')]);router[_0x32ef('0x55')](_0x32ef('0x30'),auth[_0x32ef('0x9')](),controller[_0x32ef('0x64')]);module['exports']=router;
\ No newline at end of file
diff --git a/server/api/user/user.attributes.js b/server/api/user/user.attributes.js
index aaa5685..139cf3e 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 _0xa9e0=['\x22\x22\x20<>','always','accept','refuse','originate','uac','uas','fingerprint','certificate','passive','update,nonat','showWebBar','get','wss','force_avp','dtlsenable','dtlsverify','dtlssetup','dtlsprivatekey','rtcp_mux','encryption','icesupport','actpass','dtlscertfile','/etc/pki/tls/certs/motion.crt','/etc/pki/tls/private/motion.key','permissions','phoneBarEnableScreenRecordingByAgent','string','true','false','screenrecording','blockedAt','sequelize','moment','util','STRING','setDataValue','name','defaultuser','callerid','getDataValue','internal','email','admin','user','agent','telephone','INTEGER','format','fullname','BOOLEAN','DATE','DEFAULT\x20PAUSE','ENUM','peer','friend','from-sip','ALLOWED_NOT_SCREENED','ALLOWED_PASSED_SCREEN','ALLOWED','PROHIB_NOT_SCREENED','PROHIB_PASSED_SCREEN','PROHIB_FAILED_SCREEN','udp','join','transport','split','String\x20is\x20deprecated.\x20Please\x20use\x20an\x20Array\x20as\x20[\x22udp\x22,\x20\x22tcp\x22]','rfc2833','info','shortinfo','inband','auto','yes','update','force_rport,comedia','nat','String\x20is\x20deprecated.\x20Please\x20use\x20an\x20Array\x20as\x20[\x22force_rport\x22,\x20\x22comedia\x22]','all','allow','ulaw;alaw;gsm','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'];(function(_0x4d70ca,_0x36d6df){var _0x334ac1=function(_0x151cbb){while(--_0x151cbb){_0x4d70ca['push'](_0x4d70ca['shift']());}};_0x334ac1(++_0x36d6df);}(_0xa9e0,0x123));var _0x0a9e=function(_0xbca1b1,_0x33f0ce){_0xbca1b1=_0xbca1b1-0x0;var _0x4e1686=_0xa9e0[_0xbca1b1];return _0x4e1686;};'use strict';var Sequelize=require(_0x0a9e('0x0'));var moment=require(_0x0a9e('0x1'));var util=require(_0x0a9e('0x2'));var _=require('lodash');module['exports']={'name':{'type':Sequelize[_0x0a9e('0x3')],'allowNull':![],'unique':'name','validate':{'notEmpty':!![],'is':/^[A-Za-z0-9\.\_]+$/i},'set':function(_0x333808){this[_0x0a9e('0x4')](_0x0a9e('0x5'),_0x333808);this[_0x0a9e('0x4')](_0x0a9e('0x6'),_0x333808);},'comment':'The\x20name\x20of\x20the\x20user'},'fullname':{'type':Sequelize[_0x0a9e('0x3')],'allowNull':![],'set':function(_0x441e3a){this[_0x0a9e('0x4')]('fullname',_0x441e3a);this['setDataValue'](_0x0a9e('0x7'),util['format']('\x22%s\x22\x20<%s>',_0x441e3a,this[_0x0a9e('0x8')](_0x0a9e('0x9'))));}},'alias':{'type':Sequelize[_0x0a9e('0x3')]},'email':{'type':Sequelize[_0x0a9e('0x3')],'allowNull':![],'unique':_0x0a9e('0xa'),'validate':{'isEmail':!![]},'set':function(_0xbd1168){if(_0xbd1168){this['setDataValue']('email',_0xbd1168['toLowerCase']());}}},'role':{'type':Sequelize['ENUM'](_0x0a9e('0xb'),_0x0a9e('0xc'),_0x0a9e('0xd'),_0x0a9e('0xe')),'allowNull':![]},'password':{'type':Sequelize[_0x0a9e('0x3')],'allowNull':![],'validate':{'notEmpty':!![]}},'provider':{'type':Sequelize[_0x0a9e('0x3')],'defaultValue':'local'},'internal':{'type':Sequelize[_0x0a9e('0xf')](0xb),'allowNull':![],'unique':_0x0a9e('0x9'),'set':function(_0x2b4227){this[_0x0a9e('0x4')](_0x0a9e('0x9'),_0x2b4227);this[_0x0a9e('0x4')]('accountcode',_0x2b4227);this[_0x0a9e('0x4')]('callerid',util[_0x0a9e('0x10')]('\x22%s\x22\x20<%s>',this[_0x0a9e('0x8')](_0x0a9e('0x11')),_0x2b4227));}},'salt':{'type':Sequelize['STRING']},'phone':{'type':Sequelize[_0x0a9e('0x3')]},'mobile':{'type':Sequelize['STRING']},'address':{'type':Sequelize[_0x0a9e('0x3')]},'zipcode':{'type':Sequelize[_0x0a9e('0x3')]},'userpic':{'type':Sequelize[_0x0a9e('0x3')]},'city':{'type':Sequelize[_0x0a9e('0x3')]},'country':{'type':Sequelize[_0x0a9e('0x3')]},'online':{'type':Sequelize[_0x0a9e('0x12')],'defaultValue':![]},'lastLoginAt':{'type':Sequelize[_0x0a9e('0x13')]},'voicePause':{'type':Sequelize[_0x0a9e('0x12')],'defaultValue':![]},'chatPause':{'type':Sequelize[_0x0a9e('0x12')],'defaultValue':![]},'mailPause':{'type':Sequelize[_0x0a9e('0x12')],'defaultValue':![]},'faxPause':{'type':Sequelize[_0x0a9e('0x12')],'defaultValue':![]},'smsPause':{'type':Sequelize[_0x0a9e('0x12')],'defaultValue':![]},'openchannelPause':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'pauseType':{'type':Sequelize[_0x0a9e('0x3')],'defaultValue':_0x0a9e('0x14')},'lastPauseAt':{'type':Sequelize['DATE']},'chatCapacity':{'type':Sequelize[_0x0a9e('0xf')],'defaultValue':0x0},'mailCapacity':{'type':Sequelize['INTEGER'],'defaultValue':0x0},'faxCapacity':{'type':Sequelize['INTEGER'],'defaultValue':0x0},'smsCapacity':{'type':Sequelize[_0x0a9e('0xf')],'defaultValue':0x0},'openchannelCapacity':{'type':Sequelize[_0x0a9e('0xf')],'defaultValue':0x0},'phoneBarAutoAnswer':{'type':Sequelize[_0x0a9e('0x12')],'defaultValue':![]},'phoneBarEnableSettings':{'type':Sequelize[_0x0a9e('0x12')],'defaultValue':!![]},'phoneBarListenPort':{'type':Sequelize['INTEGER'](0x5),'defaultValue':0x1428},'phoneBarExpires':{'type':Sequelize[_0x0a9e('0xf')](0x5),'defaultValue':0x78},'phoneBarRemoteControl':{'type':Sequelize[_0x0a9e('0x12')],'defaultValue':![]},'phoneBarRemoteControlPort':{'type':Sequelize[_0x0a9e('0xf')],'defaultValue':0x26a0},'phoneBarEnableRecording':{'type':Sequelize[_0x0a9e('0x12')],'defaultValue':![]},'phoneBarRingInUse':{'type':Sequelize[_0x0a9e('0x12')],'defaultValue':![]},'chanspy':{'type':Sequelize[_0x0a9e('0x12')],'defaultValue':![]},'description':{'type':Sequelize[_0x0a9e('0x3')],'allowNull':!![]},'host':{'type':Sequelize['STRING'],'allowNull':!![],'defaultValue':'dynamic'},'ipaddr':{'type':Sequelize[_0x0a9e('0x3')],'allowNull':!![]},'port':{'type':Sequelize[_0x0a9e('0xf')](0x5),'allowNull':!![]},'regseconds':{'type':Sequelize[_0x0a9e('0xf')](0xb),'allowNull':!![]},'fullcontact':{'type':Sequelize[_0x0a9e('0x3')],'allowNull':!![]},'regserver':{'type':Sequelize['STRING'],'allowNull':!![]},'useragent':{'type':Sequelize[_0x0a9e('0x3')],'allowNull':!![]},'lastms':{'type':Sequelize['INTEGER'](0xb),'allowNull':!![]},'type':{'type':Sequelize[_0x0a9e('0x15')]('friend',_0x0a9e('0xc'),_0x0a9e('0x16')),'allowNull':!![],'defaultValue':_0x0a9e('0x17')},'context':{'type':Sequelize[_0x0a9e('0x3')],'allowNull':!![],'defaultValue':_0x0a9e('0x18')},'callingpres':{'type':Sequelize[_0x0a9e('0x15')](_0x0a9e('0x19'),_0x0a9e('0x1a'),'ALLOWED_FAILED_SCREEN',_0x0a9e('0x1b'),_0x0a9e('0x1c'),_0x0a9e('0x1d'),_0x0a9e('0x1e'),'PROHIB'),'allowNull':!![]},'deny':{'type':Sequelize[_0x0a9e('0x3')],'allowNull':!![]},'permit':{'type':Sequelize[_0x0a9e('0x3')],'allowNull':!![]},'secret':{'type':Sequelize[_0x0a9e('0x3')],'allowNull':!![]},'md5secret':{'type':Sequelize[_0x0a9e('0x3')],'allowNull':!![]},'remotesecret':{'type':Sequelize[_0x0a9e('0x3')],'allowNull':!![]},'transport':{'type':Sequelize[_0x0a9e('0x3')],'allowNull':!![],'defaultValue':_0x0a9e('0x1f'),'set':function(_0x2e8759){this[_0x0a9e('0x4')]('transport',_0x2e8759?_0x2e8759[_0x0a9e('0x20')](','):null);},'get':function(){return this['getDataValue'](_0x0a9e('0x21'))?this[_0x0a9e('0x8')](_0x0a9e('0x21'))[_0x0a9e('0x22')](','):null;},'comment':_0x0a9e('0x23')},'dtmfmode':{'type':Sequelize['ENUM'](_0x0a9e('0x24'),_0x0a9e('0x25'),_0x0a9e('0x26'),_0x0a9e('0x27'),_0x0a9e('0x28')),'allowNull':!![],'defaultValue':_0x0a9e('0x24')},'directmedia':{'type':Sequelize[_0x0a9e('0x15')](_0x0a9e('0x29'),'no','nonat',_0x0a9e('0x2a'),'outgoing'),'allowNull':!![],'defaultValue':'no'},'directrtpsetup':{'type':Sequelize[_0x0a9e('0x15')](_0x0a9e('0x29'),'no'),'allowNull':!![],'defaultValue':'no'},'directmediapermit':{'type':Sequelize[_0x0a9e('0x3')],'allowNull':!![]},'directmediadeny':{'type':Sequelize[_0x0a9e('0x3')],'allowNull':!![]},'nat':{'type':Sequelize['STRING'],'allowNull':!![],'defaultValue':_0x0a9e('0x2b'),'set':function(_0xd1836d){this[_0x0a9e('0x4')](_0x0a9e('0x2c'),_0xd1836d?_0xd1836d['join'](','):null);},'get':function(){return this['getDataValue'](_0x0a9e('0x2c'))?this['getDataValue'](_0x0a9e('0x2c'))[_0x0a9e('0x22')](','):null;},'comment':_0x0a9e('0x2d')},'callgroup':{'type':Sequelize[_0x0a9e('0x3')]},'namedcallgroup':{'type':Sequelize['STRING']},'pickupgroup':{'type':Sequelize[_0x0a9e('0x3')]},'namedpickupgroup':{'type':Sequelize[_0x0a9e('0x3')]},'language':{'type':Sequelize[_0x0a9e('0x3')],'defaultValue':'en'},'tonezone':{'type':Sequelize['STRING']},'disallow':{'type':Sequelize[_0x0a9e('0x3')],'allowNull':![],'defaultValue':_0x0a9e('0x2e')},'allow':{'type':Sequelize[_0x0a9e('0x3')],'allowNull':![],'defaultValue':'ulaw;alaw;gsm','set':function(_0x546ef8){this[_0x0a9e('0x4')](_0x0a9e('0x2f'),_0x546ef8?_0x546ef8['join'](';'):_0x0a9e('0x30'));},'get':function(){return this[_0x0a9e('0x8')](_0x0a9e('0x2f'))?this[_0x0a9e('0x8')]('allow')['split'](';'):null;},'comment':_0x0a9e('0x31')},'autoframing':{'type':Sequelize[_0x0a9e('0x15')]('yes','no'),'allowNull':!![]},'insecure':{'type':Sequelize[_0x0a9e('0x3')],'allowNull':!![],'set':function(_0x1dec2e){this[_0x0a9e('0x4')]('insecure',_0x1dec2e?_0x1dec2e[_0x0a9e('0x20')](','):null);},'get':function(){return this[_0x0a9e('0x8')](_0x0a9e('0x32'))?this[_0x0a9e('0x8')](_0x0a9e('0x32'))[_0x0a9e('0x22')](','):null;},'comment':_0x0a9e('0x33')},'trustrpid':{'type':Sequelize[_0x0a9e('0x15')](_0x0a9e('0x29'),'no'),'allowNull':!![],'defaultValue':'no'},'trust_id_outbound':{'type':Sequelize[_0x0a9e('0x15')](_0x0a9e('0x29'),'no'),'allowNull':!![],'defaultValue':'no'},'progressinband':{'type':Sequelize[_0x0a9e('0x15')](_0x0a9e('0x29'),'no',_0x0a9e('0x34')),'allowNull':!![]},'promiscredir':{'type':Sequelize[_0x0a9e('0x15')]('yes','no'),'allowNull':!![]},'useclientcode':{'type':Sequelize['ENUM'](_0x0a9e('0x29'),'no'),'allowNull':!![]},'accountcode':{'type':Sequelize[_0x0a9e('0xf')](0xb),'allowNull':!![]},'setvar':{'type':Sequelize[_0x0a9e('0x3')],'allowNull':!![]},'callerid':{'type':Sequelize[_0x0a9e('0x3')],'allowNull':!![],'defaultValue':_0x0a9e('0x35')},'amaflags':{'type':Sequelize[_0x0a9e('0x3')],'allowNull':!![]},'callcounter':{'type':Sequelize[_0x0a9e('0x15')](_0x0a9e('0x29'),'no'),'allowNull':!![],'defaultValue':_0x0a9e('0x29')},'busylevel':{'type':Sequelize[_0x0a9e('0xf')](0xb),'allowNull':!![]},'allowoverlap':{'type':Sequelize[_0x0a9e('0x15')](_0x0a9e('0x29'),'no'),'allowNull':!![]},'allowsubscribe':{'type':Sequelize['ENUM'](_0x0a9e('0x29'),'no'),'allowNull':!![]},'allowtransfer':{'type':Sequelize[_0x0a9e('0x15')](_0x0a9e('0x29'),'no'),'allowNull':!![]},'ignoresdpversion':{'type':Sequelize[_0x0a9e('0x15')](_0x0a9e('0x29'),'no'),'allowNull':!![]},'subscribecontext':{'type':Sequelize[_0x0a9e('0x3')],'allowNull':!![]},'template':{'type':Sequelize[_0x0a9e('0x3')],'allowNull':!![]},'videosupport':{'type':Sequelize[_0x0a9e('0x15')]('yes','no',_0x0a9e('0x36')),'allowNull':!![],'defaultValue':'no'},'maxcallbitrate':{'type':Sequelize['INTEGER'](0xb),'allowNull':!![]},'rfc2833compensate':{'type':Sequelize[_0x0a9e('0x15')](_0x0a9e('0x29'),'no'),'allowNull':!![]},'mailbox':{'type':Sequelize[_0x0a9e('0x3')],'allowNull':!![]},'session_timers':{'type':Sequelize['ENUM'](_0x0a9e('0x37'),_0x0a9e('0x38'),_0x0a9e('0x39')),'allowNull':!![]},'session_expires':{'type':Sequelize[_0x0a9e('0xf')](0xb),'allowNull':!![]},'session_minse':{'type':Sequelize[_0x0a9e('0xf')](0xb),'allowNull':!![]},'session_refresher':{'type':Sequelize[_0x0a9e('0x15')](_0x0a9e('0x3a'),'uas'),'allowNull':!![],'defaultValue':_0x0a9e('0x3b')},'t38pt_usertpsource':{'type':Sequelize[_0x0a9e('0x3')],'allowNull':!![]},'regexten':{'type':Sequelize[_0x0a9e('0x3')],'allowNull':!![]},'fromdomain':{'type':Sequelize[_0x0a9e('0x3')],'allowNull':!![]},'fromuser':{'type':Sequelize[_0x0a9e('0x3')],'allowNull':!![]},'qualify':{'type':Sequelize[_0x0a9e('0x15')](_0x0a9e('0x29'),'no'),'allowNull':!![],'defaultValue':_0x0a9e('0x29')},'keepalive':{'type':Sequelize[_0x0a9e('0xf')](0xb),'allowNull':!![]},'defaultip':{'type':Sequelize['STRING'],'allowNull':!![]},'defaultuser':{'type':Sequelize[_0x0a9e('0x3')],'allowNull':!![]},'rtptimeout':{'type':Sequelize[_0x0a9e('0xf')](0xb),'allowNull':!![]},'rtpholdtimeout':{'type':Sequelize['INTEGER'](0xb),'allowNull':!![]},'rtpkeepalive':{'type':Sequelize['INTEGER'](0xb),'allowNull':!![]},'sendrpid':{'type':Sequelize['ENUM'](_0x0a9e('0x29'),'no'),'allowNull':!![],'defaultValue':'no'},'outboundproxy':{'type':Sequelize[_0x0a9e('0x3')],'allowNull':!![]},'callbackextension':{'type':Sequelize[_0x0a9e('0x3')],'allowNull':!![]},'timert1':{'type':Sequelize[_0x0a9e('0xf')](0xb),'allowNull':!![]},'timerb':{'type':Sequelize[_0x0a9e('0xf')](0xb),'allowNull':!![]},'qualifyfreq':{'type':Sequelize[_0x0a9e('0xf')](0xb),'allowNull':!![]},'contactpermit':{'type':Sequelize[_0x0a9e('0x3')],'allowNull':!![]},'contactdeny':{'type':Sequelize[_0x0a9e('0x3')],'allowNull':!![]},'contactacl':{'type':Sequelize['STRING'],'allowNull':!![]},'unsolicited_mailbox':{'type':Sequelize['STRING'],'allowNull':!![]},'use_q850_reason':{'type':Sequelize['STRING'],'allowNull':!![]},'maxforwards':{'type':Sequelize[_0x0a9e('0xf')](0xb),'allowNull':!![]},'encryption':{'type':Sequelize[_0x0a9e('0x15')](_0x0a9e('0x29'),'no'),'allowNull':!![],'defaultValue':'no'},'avpf':{'type':Sequelize['ENUM'](_0x0a9e('0x29'),'no'),'allowNull':!![]},'force_avp':{'type':Sequelize[_0x0a9e('0x15')]('yes','no'),'allowNull':!![]},'icesupport':{'type':Sequelize['ENUM'](_0x0a9e('0x29'),'no'),'allowNull':!![]},'dtlsenable':{'type':Sequelize['ENUM'](_0x0a9e('0x29'),'no'),'allowNull':!![]},'dtlsverify':{'type':Sequelize['ENUM'](_0x0a9e('0x29'),'no',_0x0a9e('0x3c'),_0x0a9e('0x3d')),'allowNull':!![]},'dtlsrekey':{'type':Sequelize['INTEGER'](0xb),'allowNull':!![]},'dtlscertfile':{'type':Sequelize[_0x0a9e('0x3')],'allowNull':!![]},'dtlsprivatekey':{'type':Sequelize[_0x0a9e('0x3')],'allowNull':!![]},'dtlscipher':{'type':Sequelize['STRING'],'allowNull':!![]},'dtlscafile':{'type':Sequelize['STRING'],'allowNull':!![]},'dtlscapath':{'type':Sequelize[_0x0a9e('0x3')],'allowNull':!![]},'dtlssetup':{'type':Sequelize[_0x0a9e('0x15')]('active',_0x0a9e('0x3e'),'actpass'),'allowNull':!![]},'dtlsfingerprint':{'type':Sequelize[_0x0a9e('0x3')],'allowNull':!![]},'usereqphone':{'type':Sequelize['ENUM'](_0x0a9e('0x29'),'no'),'allowNull':!![],'defaultValue':'no'},'recordonfeature':{'type':Sequelize['STRING'],'allowNull':!![]},'recordofffeature':{'type':Sequelize['STRING'],'allowNull':!![]},'call_limit':{'type':Sequelize['INTEGER'](0xb),'allowNull':!![],'defaultValue':0xa},'registertrying':{'type':Sequelize[_0x0a9e('0x15')]('yes','no'),'allowNull':!![]},'subscribemwi':{'type':Sequelize[_0x0a9e('0x15')](_0x0a9e('0x29'),'no'),'allowNull':!![]},'vmexten':{'type':Sequelize[_0x0a9e('0x3')],'allowNull':!![]},'mohinterpret':{'type':Sequelize[_0x0a9e('0x3')],'allowNull':!![]},'mohsuggest':{'type':Sequelize[_0x0a9e('0x3')],'allowNull':!![]},'parkinglot':{'type':Sequelize[_0x0a9e('0x3')],'allowNull':!![]},'canreinvite':{'type':Sequelize[_0x0a9e('0x15')](_0x0a9e('0x29'),'no','nonat',_0x0a9e('0x2a'),_0x0a9e('0x3f')),'allowNull':!![],'defaultValue':'no'},'loginInPause':{'type':Sequelize[_0x0a9e('0x12')],'defaultValue':![]},'resetPasswordToken':{'type':Sequelize[_0x0a9e('0x3')]},'resetPasswordExpires':{'type':Sequelize[_0x0a9e('0x13')]},'showWebBar':{'type':Sequelize[_0x0a9e('0xf')],'defaultValue':0x0,'set':function(_0x5d86e9){this[_0x0a9e('0x4')](_0x0a9e('0x40'),_0x5d86e9);var _0x5239ef=this[_0x0a9e('0x41')]({'plain':!![]});switch(_0x5d86e9){case 0x0:case 0x1:var _0x5cc8fb=_0x5239ef[_0x0a9e('0x21')]?_['isArray'](_0x5239ef['transport'])?_0x5239ef['transport'][_0x0a9e('0x20')]():_0x5239ef['transport']:_0x0a9e('0x1f');if(_0x5cc8fb===_0x0a9e('0x42')){_0x5cc8fb=_0x0a9e('0x1f');}this[_0x0a9e('0x4')](_0x0a9e('0x21'),_0x5cc8fb);this[_0x0a9e('0x4')]('encryption','no');this[_0x0a9e('0x4')]('avpf',null);this[_0x0a9e('0x4')](_0x0a9e('0x43'),null);this[_0x0a9e('0x4')]('icesupport',null);this[_0x0a9e('0x4')](_0x0a9e('0x44'),null);this[_0x0a9e('0x4')](_0x0a9e('0x45'),null);this['setDataValue'](_0x0a9e('0x46'),null);this[_0x0a9e('0x4')]('dtlscertfile',null);this[_0x0a9e('0x4')](_0x0a9e('0x47'),null);this[_0x0a9e('0x4')](_0x0a9e('0x48'),'no');break;case 0x2:this[_0x0a9e('0x4')]('transport',_0x0a9e('0x42'));this[_0x0a9e('0x4')](_0x0a9e('0x49'),'yes');this[_0x0a9e('0x4')]('avpf','yes');this[_0x0a9e('0x4')](_0x0a9e('0x43'),_0x0a9e('0x29'));this[_0x0a9e('0x4')](_0x0a9e('0x4a'),_0x0a9e('0x29'));this[_0x0a9e('0x4')](_0x0a9e('0x44'),_0x0a9e('0x29'));this[_0x0a9e('0x4')](_0x0a9e('0x45'),'no');this[_0x0a9e('0x4')](_0x0a9e('0x46'),_0x0a9e('0x4b'));this[_0x0a9e('0x4')](_0x0a9e('0x4c'),_0x5239ef[_0x0a9e('0x4c')]||_0x0a9e('0x4d'));this['setDataValue'](_0x0a9e('0x47'),_0x5239ef[_0x0a9e('0x47')]||_0x0a9e('0x4e'));this['setDataValue'](_0x0a9e('0x48'),_0x0a9e('0x29'));break;default:}}},'permissions':{'type':Sequelize['TEXT'],'set':function(_0x83f0b2){this[_0x0a9e('0x4')](_0x0a9e('0x4f'),_0x83f0b2?_0x83f0b2[_0x0a9e('0x20')](','):[]);},'get':function(){return this[_0x0a9e('0x8')]('permissions')?_['map'](this['getDataValue'](_0x0a9e('0x4f'))[_0x0a9e('0x22')](','),function(_0x1104ad){return parseInt(_0x1104ad,0xa);}):[];}},'phoneBarUnconditionalNumber':{'type':Sequelize[_0x0a9e('0x3')]},'phoneBarNoReplyNumber':{'type':Sequelize[_0x0a9e('0x3')]},'phoneBarBusyNumber':{'type':Sequelize[_0x0a9e('0x3')]},'phoneBarUnconditional':{'type':Sequelize[_0x0a9e('0x12')],'defaultValue':![]},'phoneBarNoReply':{'type':Sequelize[_0x0a9e('0x12')],'defaultValue':![]},'phoneBarBusy':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'phoneBarDnd':{'type':Sequelize[_0x0a9e('0x12')],'defaultValue':!![]},'phoneBarUnansweredCallBadge':{'type':Sequelize[_0x0a9e('0x12')],'defaultValue':!![]},'phoneBarEnableDtmfTone':{'type':Sequelize[_0x0a9e('0x12')],'defaultValue':![]},'phoneBarAutoAnswerDelay':{'type':Sequelize['INTEGER'],'defaultValue':0x0},'extensionMonitor':{'type':Sequelize[_0x0a9e('0x3')],'defaultValue':''},'crudPermissions':{'type':Sequelize['INTEGER'],'defaultValue':0x0},'rtcp_mux':{'type':Sequelize[_0x0a9e('0x15')](_0x0a9e('0x29'),'no'),'defaultValue':'no'},'allowmessenger':{'type':Sequelize['BOOLEAN'],'defaultValue':!![]},'phoneBarOutboundProxy':{'type':Sequelize[_0x0a9e('0x3')]},'passwordResetAt':{'type':Sequelize[_0x0a9e('0x13')],'defaultValue':null},'phoneBarEnableJaws':{'type':Sequelize[_0x0a9e('0x12')],'defaultValue':![]},'phoneBarEnableScreenRecordingByAgent':{'type':Sequelize[_0x0a9e('0x12')],'defaultValue':![]},'phoneBarEnableVideoRecording':{'type':Sequelize['VIRTUAL'],'get':function(){return this[_0x0a9e('0x8')](_0x0a9e('0x50'))?this[_0x0a9e('0x8')](_0x0a9e('0x50')):![];}},'phoneBarEnableAutomaticScreenRecording':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'phoneBarPrefixRequired':{'type':Sequelize[_0x0a9e('0x12')],'defaultValue':![]},'hotdesk':{'type':Sequelize[_0x0a9e('0x12')],'defaultValue':![]},'interface':{'type':Sequelize[_0x0a9e('0x3')],'defaultValue':null},'privacyEnabled':{'type':Sequelize[_0x0a9e('0x12')],'defaultValue':![]},'apiKeyNonce':{'type':Sequelize['STRING'],'allowNull':!![]},'apiKeyIat':{'type':Sequelize[_0x0a9e('0x3')],'allowNull':!![]},'screenrecording':{'type':Sequelize[_0x0a9e('0x12')],'defaultValue':![],'set':function(_0x30a4c7){if(typeof _0x30a4c7===_0x0a9e('0x51')){var _0x332367=_0x30a4c7==='1'?!![]:_0x30a4c7==='0'?![]:_0x30a4c7===_0x0a9e('0x52')?!![]:_0x30a4c7===_0x0a9e('0x53')?![]:![];this[_0x0a9e('0x4')](_0x0a9e('0x54'),_0x332367);}else{this[_0x0a9e('0x4')](_0x0a9e('0x54'),_0x30a4c7);}}},'blocked':{'type':Sequelize[_0x0a9e('0x12')],'defaultValue':![],'set':function(_0x25744a){this[_0x0a9e('0x4')]('blocked',_0x25744a);if(_0x25744a===!![]){this[_0x0a9e('0x4')](_0x0a9e('0x55'),moment());this[_0x0a9e('0x4')]('loginAttempts',0x0);}else{this[_0x0a9e('0x4')](_0x0a9e('0x55'),null);}}},'blockedAt':{'type':Sequelize[_0x0a9e('0x13')],'defaultValue':null},'loginAttempts':{'type':Sequelize[_0x0a9e('0xf')],'defaultValue':0x0},'disabled':{'type':Sequelize['BOOLEAN'],'defaultValue':![]}};
\ No newline at end of file
+var _0xa9e0=['\x22\x22\x20<>','always','accept','refuse','originate','uac','uas','fingerprint','certificate','passive','update,nonat','showWebBar','get','wss','force_avp','dtlsenable','dtlsverify','dtlssetup','dtlsprivatekey','rtcp_mux','encryption','icesupport','actpass','dtlscertfile','/etc/pki/tls/certs/motion.crt','/etc/pki/tls/private/motion.key','permissions','phoneBarEnableScreenRecordingByAgent','string','true','false','screenrecording','blockedAt','sequelize','moment','util','STRING','setDataValue','name','defaultuser','callerid','getDataValue','internal','email','admin','user','agent','telephone','INTEGER','format','fullname','BOOLEAN','DATE','DEFAULT\x20PAUSE','ENUM','peer','friend','from-sip','ALLOWED_NOT_SCREENED','ALLOWED_PASSED_SCREEN','ALLOWED','PROHIB_NOT_SCREENED','PROHIB_PASSED_SCREEN','PROHIB_FAILED_SCREEN','udp','join','transport','split','String\x20is\x20deprecated.\x20Please\x20use\x20an\x20Array\x20as\x20[\x22udp\x22,\x20\x22tcp\x22]','rfc2833','info','shortinfo','inband','auto','yes','update','force_rport,comedia','nat','String\x20is\x20deprecated.\x20Please\x20use\x20an\x20Array\x20as\x20[\x22force_rport\x22,\x20\x22comedia\x22]','all','allow','ulaw;alaw;gsm','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'];(function(_0x18b73b,_0x1ee017){var _0x7b279a=function(_0x108d65){while(--_0x108d65){_0x18b73b['push'](_0x18b73b['shift']());}};_0x7b279a(++_0x1ee017);}(_0xa9e0,0x123));var _0x0a9e=function(_0x5037ab,_0x43209e){_0x5037ab=_0x5037ab-0x0;var _0x512adb=_0xa9e0[_0x5037ab];return _0x512adb;};'use strict';var Sequelize=require(_0x0a9e('0x0'));var moment=require(_0x0a9e('0x1'));var util=require(_0x0a9e('0x2'));var _=require('lodash');module['exports']={'name':{'type':Sequelize[_0x0a9e('0x3')],'allowNull':![],'unique':'name','validate':{'notEmpty':!![],'is':/^[A-Za-z0-9\.\_]+$/i},'set':function(_0x333808){this[_0x0a9e('0x4')](_0x0a9e('0x5'),_0x333808);this[_0x0a9e('0x4')](_0x0a9e('0x6'),_0x333808);},'comment':'The\x20name\x20of\x20the\x20user'},'fullname':{'type':Sequelize[_0x0a9e('0x3')],'allowNull':![],'set':function(_0x441e3a){this[_0x0a9e('0x4')]('fullname',_0x441e3a);this['setDataValue'](_0x0a9e('0x7'),util['format']('\x22%s\x22\x20<%s>',_0x441e3a,this[_0x0a9e('0x8')](_0x0a9e('0x9'))));}},'alias':{'type':Sequelize[_0x0a9e('0x3')]},'email':{'type':Sequelize[_0x0a9e('0x3')],'allowNull':![],'unique':_0x0a9e('0xa'),'validate':{'isEmail':!![]},'set':function(_0xbd1168){if(_0xbd1168){this['setDataValue']('email',_0xbd1168['toLowerCase']());}}},'role':{'type':Sequelize['ENUM'](_0x0a9e('0xb'),_0x0a9e('0xc'),_0x0a9e('0xd'),_0x0a9e('0xe')),'allowNull':![]},'password':{'type':Sequelize[_0x0a9e('0x3')],'allowNull':![],'validate':{'notEmpty':!![]}},'provider':{'type':Sequelize[_0x0a9e('0x3')],'defaultValue':'local'},'internal':{'type':Sequelize[_0x0a9e('0xf')](0xb),'allowNull':![],'unique':_0x0a9e('0x9'),'set':function(_0x2b4227){this[_0x0a9e('0x4')](_0x0a9e('0x9'),_0x2b4227);this[_0x0a9e('0x4')]('accountcode',_0x2b4227);this[_0x0a9e('0x4')]('callerid',util[_0x0a9e('0x10')]('\x22%s\x22\x20<%s>',this[_0x0a9e('0x8')](_0x0a9e('0x11')),_0x2b4227));}},'salt':{'type':Sequelize['STRING']},'phone':{'type':Sequelize[_0x0a9e('0x3')]},'mobile':{'type':Sequelize['STRING']},'address':{'type':Sequelize[_0x0a9e('0x3')]},'zipcode':{'type':Sequelize[_0x0a9e('0x3')]},'userpic':{'type':Sequelize[_0x0a9e('0x3')]},'city':{'type':Sequelize[_0x0a9e('0x3')]},'country':{'type':Sequelize[_0x0a9e('0x3')]},'online':{'type':Sequelize[_0x0a9e('0x12')],'defaultValue':![]},'lastLoginAt':{'type':Sequelize[_0x0a9e('0x13')]},'voicePause':{'type':Sequelize[_0x0a9e('0x12')],'defaultValue':![]},'chatPause':{'type':Sequelize[_0x0a9e('0x12')],'defaultValue':![]},'mailPause':{'type':Sequelize[_0x0a9e('0x12')],'defaultValue':![]},'faxPause':{'type':Sequelize[_0x0a9e('0x12')],'defaultValue':![]},'smsPause':{'type':Sequelize[_0x0a9e('0x12')],'defaultValue':![]},'openchannelPause':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'pauseType':{'type':Sequelize[_0x0a9e('0x3')],'defaultValue':_0x0a9e('0x14')},'lastPauseAt':{'type':Sequelize['DATE']},'chatCapacity':{'type':Sequelize[_0x0a9e('0xf')],'defaultValue':0x0},'mailCapacity':{'type':Sequelize['INTEGER'],'defaultValue':0x0},'faxCapacity':{'type':Sequelize['INTEGER'],'defaultValue':0x0},'smsCapacity':{'type':Sequelize[_0x0a9e('0xf')],'defaultValue':0x0},'openchannelCapacity':{'type':Sequelize[_0x0a9e('0xf')],'defaultValue':0x0},'phoneBarAutoAnswer':{'type':Sequelize[_0x0a9e('0x12')],'defaultValue':![]},'phoneBarEnableSettings':{'type':Sequelize[_0x0a9e('0x12')],'defaultValue':!![]},'phoneBarListenPort':{'type':Sequelize['INTEGER'](0x5),'defaultValue':0x1428},'phoneBarExpires':{'type':Sequelize[_0x0a9e('0xf')](0x5),'defaultValue':0x78},'phoneBarRemoteControl':{'type':Sequelize[_0x0a9e('0x12')],'defaultValue':![]},'phoneBarRemoteControlPort':{'type':Sequelize[_0x0a9e('0xf')],'defaultValue':0x26a0},'phoneBarEnableRecording':{'type':Sequelize[_0x0a9e('0x12')],'defaultValue':![]},'phoneBarRingInUse':{'type':Sequelize[_0x0a9e('0x12')],'defaultValue':![]},'chanspy':{'type':Sequelize[_0x0a9e('0x12')],'defaultValue':![]},'description':{'type':Sequelize[_0x0a9e('0x3')],'allowNull':!![]},'host':{'type':Sequelize['STRING'],'allowNull':!![],'defaultValue':'dynamic'},'ipaddr':{'type':Sequelize[_0x0a9e('0x3')],'allowNull':!![]},'port':{'type':Sequelize[_0x0a9e('0xf')](0x5),'allowNull':!![]},'regseconds':{'type':Sequelize[_0x0a9e('0xf')](0xb),'allowNull':!![]},'fullcontact':{'type':Sequelize[_0x0a9e('0x3')],'allowNull':!![]},'regserver':{'type':Sequelize['STRING'],'allowNull':!![]},'useragent':{'type':Sequelize[_0x0a9e('0x3')],'allowNull':!![]},'lastms':{'type':Sequelize['INTEGER'](0xb),'allowNull':!![]},'type':{'type':Sequelize[_0x0a9e('0x15')]('friend',_0x0a9e('0xc'),_0x0a9e('0x16')),'allowNull':!![],'defaultValue':_0x0a9e('0x17')},'context':{'type':Sequelize[_0x0a9e('0x3')],'allowNull':!![],'defaultValue':_0x0a9e('0x18')},'callingpres':{'type':Sequelize[_0x0a9e('0x15')](_0x0a9e('0x19'),_0x0a9e('0x1a'),'ALLOWED_FAILED_SCREEN',_0x0a9e('0x1b'),_0x0a9e('0x1c'),_0x0a9e('0x1d'),_0x0a9e('0x1e'),'PROHIB'),'allowNull':!![]},'deny':{'type':Sequelize[_0x0a9e('0x3')],'allowNull':!![]},'permit':{'type':Sequelize[_0x0a9e('0x3')],'allowNull':!![]},'secret':{'type':Sequelize[_0x0a9e('0x3')],'allowNull':!![]},'md5secret':{'type':Sequelize[_0x0a9e('0x3')],'allowNull':!![]},'remotesecret':{'type':Sequelize[_0x0a9e('0x3')],'allowNull':!![]},'transport':{'type':Sequelize[_0x0a9e('0x3')],'allowNull':!![],'defaultValue':_0x0a9e('0x1f'),'set':function(_0x2e8759){this[_0x0a9e('0x4')]('transport',_0x2e8759?_0x2e8759[_0x0a9e('0x20')](','):null);},'get':function(){return this['getDataValue'](_0x0a9e('0x21'))?this[_0x0a9e('0x8')](_0x0a9e('0x21'))[_0x0a9e('0x22')](','):null;},'comment':_0x0a9e('0x23')},'dtmfmode':{'type':Sequelize['ENUM'](_0x0a9e('0x24'),_0x0a9e('0x25'),_0x0a9e('0x26'),_0x0a9e('0x27'),_0x0a9e('0x28')),'allowNull':!![],'defaultValue':_0x0a9e('0x24')},'directmedia':{'type':Sequelize[_0x0a9e('0x15')](_0x0a9e('0x29'),'no','nonat',_0x0a9e('0x2a'),'outgoing'),'allowNull':!![],'defaultValue':'no'},'directrtpsetup':{'type':Sequelize[_0x0a9e('0x15')](_0x0a9e('0x29'),'no'),'allowNull':!![],'defaultValue':'no'},'directmediapermit':{'type':Sequelize[_0x0a9e('0x3')],'allowNull':!![]},'directmediadeny':{'type':Sequelize[_0x0a9e('0x3')],'allowNull':!![]},'nat':{'type':Sequelize['STRING'],'allowNull':!![],'defaultValue':_0x0a9e('0x2b'),'set':function(_0xd1836d){this[_0x0a9e('0x4')](_0x0a9e('0x2c'),_0xd1836d?_0xd1836d['join'](','):null);},'get':function(){return this['getDataValue'](_0x0a9e('0x2c'))?this['getDataValue'](_0x0a9e('0x2c'))[_0x0a9e('0x22')](','):null;},'comment':_0x0a9e('0x2d')},'callgroup':{'type':Sequelize[_0x0a9e('0x3')]},'namedcallgroup':{'type':Sequelize['STRING']},'pickupgroup':{'type':Sequelize[_0x0a9e('0x3')]},'namedpickupgroup':{'type':Sequelize[_0x0a9e('0x3')]},'language':{'type':Sequelize[_0x0a9e('0x3')],'defaultValue':'en'},'tonezone':{'type':Sequelize['STRING']},'disallow':{'type':Sequelize[_0x0a9e('0x3')],'allowNull':![],'defaultValue':_0x0a9e('0x2e')},'allow':{'type':Sequelize[_0x0a9e('0x3')],'allowNull':![],'defaultValue':'ulaw;alaw;gsm','set':function(_0x546ef8){this[_0x0a9e('0x4')](_0x0a9e('0x2f'),_0x546ef8?_0x546ef8['join'](';'):_0x0a9e('0x30'));},'get':function(){return this[_0x0a9e('0x8')](_0x0a9e('0x2f'))?this[_0x0a9e('0x8')]('allow')['split'](';'):null;},'comment':_0x0a9e('0x31')},'autoframing':{'type':Sequelize[_0x0a9e('0x15')]('yes','no'),'allowNull':!![]},'insecure':{'type':Sequelize[_0x0a9e('0x3')],'allowNull':!![],'set':function(_0x1dec2e){this[_0x0a9e('0x4')]('insecure',_0x1dec2e?_0x1dec2e[_0x0a9e('0x20')](','):null);},'get':function(){return this[_0x0a9e('0x8')](_0x0a9e('0x32'))?this[_0x0a9e('0x8')](_0x0a9e('0x32'))[_0x0a9e('0x22')](','):null;},'comment':_0x0a9e('0x33')},'trustrpid':{'type':Sequelize[_0x0a9e('0x15')](_0x0a9e('0x29'),'no'),'allowNull':!![],'defaultValue':'no'},'trust_id_outbound':{'type':Sequelize[_0x0a9e('0x15')](_0x0a9e('0x29'),'no'),'allowNull':!![],'defaultValue':'no'},'progressinband':{'type':Sequelize[_0x0a9e('0x15')](_0x0a9e('0x29'),'no',_0x0a9e('0x34')),'allowNull':!![]},'promiscredir':{'type':Sequelize[_0x0a9e('0x15')]('yes','no'),'allowNull':!![]},'useclientcode':{'type':Sequelize['ENUM'](_0x0a9e('0x29'),'no'),'allowNull':!![]},'accountcode':{'type':Sequelize[_0x0a9e('0xf')](0xb),'allowNull':!![]},'setvar':{'type':Sequelize[_0x0a9e('0x3')],'allowNull':!![]},'callerid':{'type':Sequelize[_0x0a9e('0x3')],'allowNull':!![],'defaultValue':_0x0a9e('0x35')},'amaflags':{'type':Sequelize[_0x0a9e('0x3')],'allowNull':!![]},'callcounter':{'type':Sequelize[_0x0a9e('0x15')](_0x0a9e('0x29'),'no'),'allowNull':!![],'defaultValue':_0x0a9e('0x29')},'busylevel':{'type':Sequelize[_0x0a9e('0xf')](0xb),'allowNull':!![]},'allowoverlap':{'type':Sequelize[_0x0a9e('0x15')](_0x0a9e('0x29'),'no'),'allowNull':!![]},'allowsubscribe':{'type':Sequelize['ENUM'](_0x0a9e('0x29'),'no'),'allowNull':!![]},'allowtransfer':{'type':Sequelize[_0x0a9e('0x15')](_0x0a9e('0x29'),'no'),'allowNull':!![]},'ignoresdpversion':{'type':Sequelize[_0x0a9e('0x15')](_0x0a9e('0x29'),'no'),'allowNull':!![]},'subscribecontext':{'type':Sequelize[_0x0a9e('0x3')],'allowNull':!![]},'template':{'type':Sequelize[_0x0a9e('0x3')],'allowNull':!![]},'videosupport':{'type':Sequelize[_0x0a9e('0x15')]('yes','no',_0x0a9e('0x36')),'allowNull':!![],'defaultValue':'no'},'maxcallbitrate':{'type':Sequelize['INTEGER'](0xb),'allowNull':!![]},'rfc2833compensate':{'type':Sequelize[_0x0a9e('0x15')](_0x0a9e('0x29'),'no'),'allowNull':!![]},'mailbox':{'type':Sequelize[_0x0a9e('0x3')],'allowNull':!![]},'session_timers':{'type':Sequelize['ENUM'](_0x0a9e('0x37'),_0x0a9e('0x38'),_0x0a9e('0x39')),'allowNull':!![]},'session_expires':{'type':Sequelize[_0x0a9e('0xf')](0xb),'allowNull':!![]},'session_minse':{'type':Sequelize[_0x0a9e('0xf')](0xb),'allowNull':!![]},'session_refresher':{'type':Sequelize[_0x0a9e('0x15')](_0x0a9e('0x3a'),'uas'),'allowNull':!![],'defaultValue':_0x0a9e('0x3b')},'t38pt_usertpsource':{'type':Sequelize[_0x0a9e('0x3')],'allowNull':!![]},'regexten':{'type':Sequelize[_0x0a9e('0x3')],'allowNull':!![]},'fromdomain':{'type':Sequelize[_0x0a9e('0x3')],'allowNull':!![]},'fromuser':{'type':Sequelize[_0x0a9e('0x3')],'allowNull':!![]},'qualify':{'type':Sequelize[_0x0a9e('0x15')](_0x0a9e('0x29'),'no'),'allowNull':!![],'defaultValue':_0x0a9e('0x29')},'keepalive':{'type':Sequelize[_0x0a9e('0xf')](0xb),'allowNull':!![]},'defaultip':{'type':Sequelize['STRING'],'allowNull':!![]},'defaultuser':{'type':Sequelize[_0x0a9e('0x3')],'allowNull':!![]},'rtptimeout':{'type':Sequelize[_0x0a9e('0xf')](0xb),'allowNull':!![]},'rtpholdtimeout':{'type':Sequelize['INTEGER'](0xb),'allowNull':!![]},'rtpkeepalive':{'type':Sequelize['INTEGER'](0xb),'allowNull':!![]},'sendrpid':{'type':Sequelize['ENUM'](_0x0a9e('0x29'),'no'),'allowNull':!![],'defaultValue':'no'},'outboundproxy':{'type':Sequelize[_0x0a9e('0x3')],'allowNull':!![]},'callbackextension':{'type':Sequelize[_0x0a9e('0x3')],'allowNull':!![]},'timert1':{'type':Sequelize[_0x0a9e('0xf')](0xb),'allowNull':!![]},'timerb':{'type':Sequelize[_0x0a9e('0xf')](0xb),'allowNull':!![]},'qualifyfreq':{'type':Sequelize[_0x0a9e('0xf')](0xb),'allowNull':!![]},'contactpermit':{'type':Sequelize[_0x0a9e('0x3')],'allowNull':!![]},'contactdeny':{'type':Sequelize[_0x0a9e('0x3')],'allowNull':!![]},'contactacl':{'type':Sequelize['STRING'],'allowNull':!![]},'unsolicited_mailbox':{'type':Sequelize['STRING'],'allowNull':!![]},'use_q850_reason':{'type':Sequelize['STRING'],'allowNull':!![]},'maxforwards':{'type':Sequelize[_0x0a9e('0xf')](0xb),'allowNull':!![]},'encryption':{'type':Sequelize[_0x0a9e('0x15')](_0x0a9e('0x29'),'no'),'allowNull':!![],'defaultValue':'no'},'avpf':{'type':Sequelize['ENUM'](_0x0a9e('0x29'),'no'),'allowNull':!![]},'force_avp':{'type':Sequelize[_0x0a9e('0x15')]('yes','no'),'allowNull':!![]},'icesupport':{'type':Sequelize['ENUM'](_0x0a9e('0x29'),'no'),'allowNull':!![]},'dtlsenable':{'type':Sequelize['ENUM'](_0x0a9e('0x29'),'no'),'allowNull':!![]},'dtlsverify':{'type':Sequelize['ENUM'](_0x0a9e('0x29'),'no',_0x0a9e('0x3c'),_0x0a9e('0x3d')),'allowNull':!![]},'dtlsrekey':{'type':Sequelize['INTEGER'](0xb),'allowNull':!![]},'dtlscertfile':{'type':Sequelize[_0x0a9e('0x3')],'allowNull':!![]},'dtlsprivatekey':{'type':Sequelize[_0x0a9e('0x3')],'allowNull':!![]},'dtlscipher':{'type':Sequelize['STRING'],'allowNull':!![]},'dtlscafile':{'type':Sequelize['STRING'],'allowNull':!![]},'dtlscapath':{'type':Sequelize[_0x0a9e('0x3')],'allowNull':!![]},'dtlssetup':{'type':Sequelize[_0x0a9e('0x15')]('active',_0x0a9e('0x3e'),'actpass'),'allowNull':!![]},'dtlsfingerprint':{'type':Sequelize[_0x0a9e('0x3')],'allowNull':!![]},'usereqphone':{'type':Sequelize['ENUM'](_0x0a9e('0x29'),'no'),'allowNull':!![],'defaultValue':'no'},'recordonfeature':{'type':Sequelize['STRING'],'allowNull':!![]},'recordofffeature':{'type':Sequelize['STRING'],'allowNull':!![]},'call_limit':{'type':Sequelize['INTEGER'](0xb),'allowNull':!![],'defaultValue':0xa},'registertrying':{'type':Sequelize[_0x0a9e('0x15')]('yes','no'),'allowNull':!![]},'subscribemwi':{'type':Sequelize[_0x0a9e('0x15')](_0x0a9e('0x29'),'no'),'allowNull':!![]},'vmexten':{'type':Sequelize[_0x0a9e('0x3')],'allowNull':!![]},'mohinterpret':{'type':Sequelize[_0x0a9e('0x3')],'allowNull':!![]},'mohsuggest':{'type':Sequelize[_0x0a9e('0x3')],'allowNull':!![]},'parkinglot':{'type':Sequelize[_0x0a9e('0x3')],'allowNull':!![]},'canreinvite':{'type':Sequelize[_0x0a9e('0x15')](_0x0a9e('0x29'),'no','nonat',_0x0a9e('0x2a'),_0x0a9e('0x3f')),'allowNull':!![],'defaultValue':'no'},'loginInPause':{'type':Sequelize[_0x0a9e('0x12')],'defaultValue':![]},'resetPasswordToken':{'type':Sequelize[_0x0a9e('0x3')]},'resetPasswordExpires':{'type':Sequelize[_0x0a9e('0x13')]},'showWebBar':{'type':Sequelize[_0x0a9e('0xf')],'defaultValue':0x0,'set':function(_0x5d86e9){this[_0x0a9e('0x4')](_0x0a9e('0x40'),_0x5d86e9);var _0x5239ef=this[_0x0a9e('0x41')]({'plain':!![]});switch(_0x5d86e9){case 0x0:case 0x1:var _0x5cc8fb=_0x5239ef[_0x0a9e('0x21')]?_['isArray'](_0x5239ef['transport'])?_0x5239ef['transport'][_0x0a9e('0x20')]():_0x5239ef['transport']:_0x0a9e('0x1f');if(_0x5cc8fb===_0x0a9e('0x42')){_0x5cc8fb=_0x0a9e('0x1f');}this[_0x0a9e('0x4')](_0x0a9e('0x21'),_0x5cc8fb);this[_0x0a9e('0x4')]('encryption','no');this[_0x0a9e('0x4')]('avpf',null);this[_0x0a9e('0x4')](_0x0a9e('0x43'),null);this[_0x0a9e('0x4')]('icesupport',null);this[_0x0a9e('0x4')](_0x0a9e('0x44'),null);this[_0x0a9e('0x4')](_0x0a9e('0x45'),null);this['setDataValue'](_0x0a9e('0x46'),null);this[_0x0a9e('0x4')]('dtlscertfile',null);this[_0x0a9e('0x4')](_0x0a9e('0x47'),null);this[_0x0a9e('0x4')](_0x0a9e('0x48'),'no');break;case 0x2:this[_0x0a9e('0x4')]('transport',_0x0a9e('0x42'));this[_0x0a9e('0x4')](_0x0a9e('0x49'),'yes');this[_0x0a9e('0x4')]('avpf','yes');this[_0x0a9e('0x4')](_0x0a9e('0x43'),_0x0a9e('0x29'));this[_0x0a9e('0x4')](_0x0a9e('0x4a'),_0x0a9e('0x29'));this[_0x0a9e('0x4')](_0x0a9e('0x44'),_0x0a9e('0x29'));this[_0x0a9e('0x4')](_0x0a9e('0x45'),'no');this[_0x0a9e('0x4')](_0x0a9e('0x46'),_0x0a9e('0x4b'));this[_0x0a9e('0x4')](_0x0a9e('0x4c'),_0x5239ef[_0x0a9e('0x4c')]||_0x0a9e('0x4d'));this['setDataValue'](_0x0a9e('0x47'),_0x5239ef[_0x0a9e('0x47')]||_0x0a9e('0x4e'));this['setDataValue'](_0x0a9e('0x48'),_0x0a9e('0x29'));break;default:}}},'permissions':{'type':Sequelize['TEXT'],'set':function(_0x83f0b2){this[_0x0a9e('0x4')](_0x0a9e('0x4f'),_0x83f0b2?_0x83f0b2[_0x0a9e('0x20')](','):[]);},'get':function(){return this[_0x0a9e('0x8')]('permissions')?_['map'](this['getDataValue'](_0x0a9e('0x4f'))[_0x0a9e('0x22')](','),function(_0x1104ad){return parseInt(_0x1104ad,0xa);}):[];}},'phoneBarUnconditionalNumber':{'type':Sequelize[_0x0a9e('0x3')]},'phoneBarNoReplyNumber':{'type':Sequelize[_0x0a9e('0x3')]},'phoneBarBusyNumber':{'type':Sequelize[_0x0a9e('0x3')]},'phoneBarUnconditional':{'type':Sequelize[_0x0a9e('0x12')],'defaultValue':![]},'phoneBarNoReply':{'type':Sequelize[_0x0a9e('0x12')],'defaultValue':![]},'phoneBarBusy':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'phoneBarDnd':{'type':Sequelize[_0x0a9e('0x12')],'defaultValue':!![]},'phoneBarUnansweredCallBadge':{'type':Sequelize[_0x0a9e('0x12')],'defaultValue':!![]},'phoneBarEnableDtmfTone':{'type':Sequelize[_0x0a9e('0x12')],'defaultValue':![]},'phoneBarAutoAnswerDelay':{'type':Sequelize['INTEGER'],'defaultValue':0x0},'extensionMonitor':{'type':Sequelize[_0x0a9e('0x3')],'defaultValue':''},'crudPermissions':{'type':Sequelize['INTEGER'],'defaultValue':0x0},'rtcp_mux':{'type':Sequelize[_0x0a9e('0x15')](_0x0a9e('0x29'),'no'),'defaultValue':'no'},'allowmessenger':{'type':Sequelize['BOOLEAN'],'defaultValue':!![]},'phoneBarOutboundProxy':{'type':Sequelize[_0x0a9e('0x3')]},'passwordResetAt':{'type':Sequelize[_0x0a9e('0x13')],'defaultValue':null},'phoneBarEnableJaws':{'type':Sequelize[_0x0a9e('0x12')],'defaultValue':![]},'phoneBarEnableScreenRecordingByAgent':{'type':Sequelize[_0x0a9e('0x12')],'defaultValue':![]},'phoneBarEnableVideoRecording':{'type':Sequelize['VIRTUAL'],'get':function(){return this[_0x0a9e('0x8')](_0x0a9e('0x50'))?this[_0x0a9e('0x8')](_0x0a9e('0x50')):![];}},'phoneBarEnableAutomaticScreenRecording':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'phoneBarPrefixRequired':{'type':Sequelize[_0x0a9e('0x12')],'defaultValue':![]},'hotdesk':{'type':Sequelize[_0x0a9e('0x12')],'defaultValue':![]},'interface':{'type':Sequelize[_0x0a9e('0x3')],'defaultValue':null},'privacyEnabled':{'type':Sequelize[_0x0a9e('0x12')],'defaultValue':![]},'apiKeyNonce':{'type':Sequelize['STRING'],'allowNull':!![]},'apiKeyIat':{'type':Sequelize[_0x0a9e('0x3')],'allowNull':!![]},'screenrecording':{'type':Sequelize[_0x0a9e('0x12')],'defaultValue':![],'set':function(_0x30a4c7){if(typeof _0x30a4c7===_0x0a9e('0x51')){var _0x332367=_0x30a4c7==='1'?!![]:_0x30a4c7==='0'?![]:_0x30a4c7===_0x0a9e('0x52')?!![]:_0x30a4c7===_0x0a9e('0x53')?![]:![];this[_0x0a9e('0x4')](_0x0a9e('0x54'),_0x332367);}else{this[_0x0a9e('0x4')](_0x0a9e('0x54'),_0x30a4c7);}}},'blocked':{'type':Sequelize[_0x0a9e('0x12')],'defaultValue':![],'set':function(_0x25744a){this[_0x0a9e('0x4')]('blocked',_0x25744a);if(_0x25744a===!![]){this[_0x0a9e('0x4')](_0x0a9e('0x55'),moment());this[_0x0a9e('0x4')]('loginAttempts',0x0);}else{this[_0x0a9e('0x4')](_0x0a9e('0x55'),null);}}},'blockedAt':{'type':Sequelize[_0x0a9e('0x13')],'defaultValue':null},'loginAttempts':{'type':Sequelize[_0x0a9e('0xf')],'defaultValue':0x0},'disabled':{'type':Sequelize['BOOLEAN'],'defaultValue':![]}};
\ No newline at end of file
diff --git a/server/api/user/user.controller.js b/server/api/user/user.controller.js
index 6932502..b54666d 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 _0x3f96=['Mail','getSmsQueues','Sms','getOpenchannelQueues','Openchannel','transaction','addAgent','Queue:save','removeTeams','getMailQueues','getFaxQueues','Fax','flatten','removeAgent','getDataValue','getLists','values','send','You\x20can\x27t\x20delete\x20yourself','addChatInteractions','user_has_chat_interactions:save','removeChatInteractions','isArray','user_has_chat_interactions:remove','spread','user_has_mail_interactions:save','removeMailInteractions','addFaxInteractions','user_has_fax_interactions:save','removeFaxInteractions','user_has_fax_interactions:remove','addSmsInteractions','user_has_sms_interactions:save','removeSmsInteractions','user_has_sms_interactions:remove','addOpenchannelInteractions','removeOpenchannelInteractions','user_has_openchannel_interactions:remove','VoicePrefix','getFaxAccounts','FaxAccount','addFaxAccounts','removeFaxAccounts','getMailAccounts','MailAccount','addMailAccounts','removeMailAccounts','getOpenchannelAccounts','addOpenchannelAccounts','removeOpenchannelAccounts','getSmsAccounts','SmsAccount','addSmsAccounts','removeSmsAccounts','getChatWebsites','ChatWebsite','addChatWebsites','removeChatWebsites','getSquareProjects','SquareProject','addSquareProjects','removeSquareProjects','getScheduledCalls','CmHopper','$and','$or','$gt','$lt','$lte','$ne','$eq','$not','$between','$notBetween','$in','$notIn','$like','$notLike','$notILike','$overlap','$contains','$contained','$any','firstName','lastName','phone','Contact','dialActive','getApiKey','retrieveApiKey','token','No\x20API\x20access\x20key\x20found!','You\x20don\x27t\x20have\x20sufficient\x20privileges\x20to\x20access\x20this\x20resource.','createApiKey','generateApiKey','iat','removeApiKey','apiKeyNonce','apiKeyIat','API\x20key\x20not\x20available','whoami','html-pdf','eml-format','rimraf','zip-dir','fast-json-patch','moment','bluebird','mustache','util','path','to-csv','ejs','lodash','squel','jsforce','desk.js','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../config/license/hardware','../../config/logger','../../config/utils','../../config/environment','../../mysqldb','defaults','redis','localhost','socket.io-emitter','./user.socket','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','debug','User,\x20%s,\x20%s,\x20%s','stringify','code','error','User,\x20%s,\x20%s','message','result','status','end','json','count','offset','limit','set','apply','reject','save','get','user','Agents','agent','Telephones','filter','ignore','map','value','includes','role','find','name','UserProfileResource','sendStatus','stack','User','rawAttributes','type','model','password','query','keys','attributes','intersection','fields','length','nolimit','order','sort','filters','merge','where','VIRTUAL','sequelize','lower','options','includeAll','show','params','salt','include','bulkCreate','update','body','catch','describe','addContacts','ids','telephone','admin','../../config/license/util','getLicense','users','License\x20limit\x20reached','format','count\x20%s:\x20%s','create','internal','Setting','findById','securePassword','min_internal','max','isNil','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','VoiceMail','fullname','email','permissions','101','102','103','110','104','105','106','107','108','109','100','111','Unable\x20to\x20retrieve\x20the\x20current\x20user','userProfileId','autoAssociation','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','changePassword','findOne','oldPassword','authenticate','New\x20password\x20must\x20be\x20different\x20from\x20old\x20password','newPassword','Invalid\x20body\x20format.\x20Use\x20newPassword','Unauthorized','addQueues','online','voicePause','interface','isValidChannel','Unknown\x20channel','add','toLowerCase','Queues','penalty','capitalize','QueueId','emit','voice','VoiceQueue','findAll','push','SIP/%s','upsert','removeQueues','channel','remove','Queue:remove','UserVoiceQueueRt','destroy','addAvatar','file','filename','getAvatar','join','server/files/images/logos/default_profile.png','userpic','download','server/files/images/','getContacts','CmContact','pick','hasOwnProperty','CmList','color','tag','getQueues','Queue','getVoiceQueuesRt','getGroups','getRecordings','VoiceRecording','UserId','rows','getScreenRecordings','ScreenRecording','ChatInteraction','getChatInteractions','getOpenchannelInteractions','getMailInteractions','MailInteraction','SmsInteraction','getSmsInteractions','FaxInteraction','getFaxInteractions','login','mobile','loginInPause','LOCAL/%s@from-sip/n','intrf','user:forcelogout','remoteAddress','socket','connection','User\x20not\x20found\x20or\x20not\x20allowed\x20to\x20perform\x20login\x20method','each','forEach','YYYY-MM-DD\x20HH:mm:ss','all','LOGIN','device','PAUSE','LOGININPAUSE','MemberReport','concat','resolve','logout','pause','updateAttributes','getChannels','DEFAULT\x20PAUSE','mailPause','chatPause','faxPause','openchannelPause','smsPause','QueuePause','manual','mail','chat','sms','openchannel','%s%s','Pause','getTeams','Team','addTeams','omit','getVoiceQueues','setDataValue','Voice','getChatQueues','Chat'];(function(_0x106da6,_0x46b581){var _0x54ed5b=function(_0x522b8c){while(--_0x522b8c){_0x106da6['push'](_0x106da6['shift']());}};_0x54ed5b(++_0x46b581);}(_0x3f96,0x1d3));var _0x63f9=function(_0x409117,_0x39f5ae){_0x409117=_0x409117-0x0;var _0x4edcc7=_0x3f96[_0x409117];return _0x4edcc7;};'use strict';var pdf=require(_0x63f9('0x0'));var emlformat=require(_0x63f9('0x1'));var rimraf=require(_0x63f9('0x2'));var zipdir=require(_0x63f9('0x3'));var jsonpatch=require(_0x63f9('0x4'));var rp=require('request-promise');var moment=require(_0x63f9('0x5'));var BPromise=require(_0x63f9('0x6'));var Mustache=require(_0x63f9('0x7'));var util=require(_0x63f9('0x8'));var path=require(_0x63f9('0x9'));var sox=require('sox');var csv=require(_0x63f9('0xa'));var ejs=require(_0x63f9('0xb'));var fs=require('fs');var _=require(_0x63f9('0xc'));var squel=require(_0x63f9('0xd'));var crypto=require('crypto');var jsforce=require(_0x63f9('0xe'));var deskjs=require(_0x63f9('0xf'));var toCsv=require(_0x63f9('0xa'));var querystring=require(_0x63f9('0x10'));var Papa=require(_0x63f9('0x11'));var Redis=require(_0x63f9('0x12'));var authService=require(_0x63f9('0x13'));var qs=require(_0x63f9('0x14'));var as=require('../../components/parsers/advancedSearch');var hardwareService=require(_0x63f9('0x15'));var logger=require(_0x63f9('0x16'))('api');var utils=require(_0x63f9('0x17'));var config=require(_0x63f9('0x18'));var db=require(_0x63f9('0x19'))['db'];config['redis']=_[_0x63f9('0x1a')](config[_0x63f9('0x1b')],{'host':_0x63f9('0x1c'),'port':0x18eb});var socket=require(_0x63f9('0x1d'))(new Redis(config[_0x63f9('0x1b')]));require(_0x63f9('0x1e'))[_0x63f9('0x1f')](socket);var jayson=require('jayson/promise');var client=jayson[_0x63f9('0x20')]['http']({'port':0x232a});function checkPasswordPattern(_0x1b874d,_0x52be5e,_0x47050b){if(_0x47050b){var _0x1fa6dd=new RegExp(/(?=.*[a-z])(?=.*[A-Z])(?=.*[0-9])(?=.*[?!@#\$%\^&\*~\-_=+[{\]\}])(?=.{8,})/);if(_0x1fa6dd[_0x63f9('0x21')](_0x52be5e)){return _0x1b874d;}else{throw new db[(_0x63f9('0x22'))][(_0x63f9('0x23'))](_0x63f9('0x24'));}}else{return _0x1b874d;}}function respondWithRpcPromise(_0x40dc35,_0x5e25ae,_0xc302eb,_0x4475d9){return new BPromise(function(_0x44c937,_0x41d3a3){var _0x2e46a3=_0x4475d9||client;return _0x2e46a3['request'](_0x40dc35,_0xc302eb)[_0x63f9('0x25')](function(_0x30aa4d){logger[_0x63f9('0x26')]('User,\x20%s,\x20%s',_0x5e25ae,_0x63f9('0x27'));logger[_0x63f9('0x28')](_0x63f9('0x29'),_0x5e25ae,_0x63f9('0x27'),JSON[_0x63f9('0x2a')](_0x30aa4d));if(_0x30aa4d['error']){if(_0x30aa4d['error'][_0x63f9('0x2b')]===0x1f4){logger[_0x63f9('0x2c')](_0x63f9('0x2d'),_0x5e25ae,_0x30aa4d[_0x63f9('0x2c')][_0x63f9('0x2e')]);return _0x41d3a3(_0x30aa4d[_0x63f9('0x2c')][_0x63f9('0x2e')]);}logger['error']('User,\x20%s,\x20%s',_0x5e25ae,_0x30aa4d[_0x63f9('0x2c')][_0x63f9('0x2e')]);return _0x44c937(_0x30aa4d[_0x63f9('0x2c')][_0x63f9('0x2e')]);}else{logger[_0x63f9('0x26')](_0x63f9('0x2d'),_0x5e25ae,_0x63f9('0x27'));_0x44c937(_0x30aa4d[_0x63f9('0x2f')]['message']);}})['catch'](function(_0x5cf43d){logger[_0x63f9('0x2c')](_0x63f9('0x2d'),_0x5e25ae,_0x5cf43d);_0x41d3a3(_0x5cf43d);});});}function respondWithStatusCode(_0x14d708,_0x4bc6fd){_0x4bc6fd=_0x4bc6fd||0xcc;return function(_0x1a43e5){if(_0x1a43e5){return _0x14d708['sendStatus'](_0x4bc6fd);}return _0x14d708[_0x63f9('0x30')](_0x4bc6fd)[_0x63f9('0x31')]();};}function respondWithResult(_0x25f5f0,_0x51c84b){_0x51c84b=_0x51c84b||0xc8;return function(_0x1b56bd){if(_0x1b56bd){return _0x25f5f0[_0x63f9('0x30')](_0x51c84b)[_0x63f9('0x32')](_0x1b56bd);}};}function respondWithFilteredResult(_0x22a82a,_0xbbcd99){return function(_0x921ebf){if(_0x921ebf){var _0x4817bc=_0x921ebf[_0x63f9('0x33')],_0x32f2d5=_0xbbcd99[_0x63f9('0x34')],_0x345337=_0xbbcd99[_0x63f9('0x34')]+_0xbbcd99[_0x63f9('0x35')],_0x1018a5;if(_0x345337>=_0x4817bc){_0x345337=_0x4817bc;_0x1018a5=0xc8;}else{_0x1018a5=0xce;}_0x22a82a[_0x63f9('0x30')](_0x1018a5);return _0x22a82a[_0x63f9('0x36')]('Content-Range',_0x32f2d5+'-'+_0x345337+'/'+_0x4817bc)[_0x63f9('0x32')](_0x921ebf);}return null;};}function patchUpdates(_0x58a788){return function(_0x419ac8){try{jsonpatch[_0x63f9('0x37')](_0x419ac8,_0x58a788,!![]);}catch(_0x522f77){return BPromise[_0x63f9('0x38')](_0x522f77);}return _0x419ac8[_0x63f9('0x39')]();};}function saveUpdates(_0x5a7d46,_0xc7d23a){return function(_0x53e06c){if(_0x53e06c){return _0x53e06c['update'](_0x5a7d46)[_0x63f9('0x25')](function(_0x3d7bd1){return _0x3d7bd1;});}return null;};}function removeEntity(_0x100561,_0x5d90ea){return function(_0x27d6da){if(_0x27d6da){return _0x27d6da['destroy']()[_0x63f9('0x25')](function(){var _0x1050d3=_0x27d6da[_0x63f9('0x3a')]({'plain':!![]});var _0x5814e6=[{'name':'Users','value':_0x63f9('0x3b'),'ignore':!![]},{'name':_0x63f9('0x3c'),'value':_0x63f9('0x3d'),'ignore':![]},{'name':_0x63f9('0x3e'),'value':'telephone','ignore':![]}];var _0x133cd6=_(_0x5814e6)[_0x63f9('0x3f')](_0x63f9('0x40'))[_0x63f9('0x41')]('value')[_0x63f9('0x42')]();if(_[_0x63f9('0x43')](_0x133cd6,_0x1050d3[_0x63f9('0x44')])){return;}var _0x21a633=_[_0x63f9('0x45')](_0x5814e6,[_0x63f9('0x42'),_0x1050d3[_0x63f9('0x44')]])[_0x63f9('0x46')];return db[_0x63f9('0x47')]['destroy']({'where':{'type':_0x21a633,'resourceId':_0x1050d3['id']}})[_0x63f9('0x25')](function(){return _0x27d6da;});})[_0x63f9('0x25')](function(){_0x100561[_0x63f9('0x30')](0xcc)[_0x63f9('0x31')]();});}};}function handleEntityNotFound(_0x39c6df,_0x33d96a){return function(_0x5c78a8){if(!_0x5c78a8){_0x39c6df[_0x63f9('0x48')](0x194);}return _0x5c78a8;};}function handleError(_0x2f1202,_0x3b49a6){_0x3b49a6=_0x3b49a6||0x1f4;return function(_0x46cac9){logger[_0x63f9('0x2c')](_0x46cac9[_0x63f9('0x49')]);if(_0x46cac9[_0x63f9('0x46')]){delete _0x46cac9[_0x63f9('0x46')];}_0x2f1202['status'](_0x3b49a6)['send'](_0x46cac9);};}exports['index']=function(_0x4b90ba,_0xd37f1b){var _0x1c599e={},_0x19a603={},_0x2cdb7e={'count':0x0,'rows':[]};var _0x3aa5e0=_[_0x63f9('0x41')](db[_0x63f9('0x4a')][_0x63f9('0x4b')],function(_0x388261){return{'name':_0x388261['fieldName'],'type':_0x388261[_0x63f9('0x4c')]['key']};});_0x19a603[_0x63f9('0x4d')]=_['differenceBy'](_[_0x63f9('0x41')](_0x3aa5e0,_0x63f9('0x46')),[_0x63f9('0x4e'),'salt']);_0x19a603[_0x63f9('0x4f')]=_[_0x63f9('0x50')](_0x4b90ba[_0x63f9('0x4f')]);_0x19a603['filters']=_['intersection'](_0x19a603[_0x63f9('0x4d')],_0x19a603[_0x63f9('0x4f')]);_0x1c599e[_0x63f9('0x51')]=_[_0x63f9('0x52')](_0x19a603[_0x63f9('0x4d')],qs[_0x63f9('0x53')](_0x4b90ba['query'][_0x63f9('0x53')]));_0x1c599e[_0x63f9('0x51')]=_0x1c599e['attributes'][_0x63f9('0x54')]?_0x1c599e[_0x63f9('0x51')]:_0x19a603[_0x63f9('0x4d')];if(!_0x4b90ba['query']['hasOwnProperty'](_0x63f9('0x55'))){_0x1c599e[_0x63f9('0x35')]=qs['limit'](_0x4b90ba[_0x63f9('0x4f')][_0x63f9('0x35')]);_0x1c599e[_0x63f9('0x34')]=qs[_0x63f9('0x34')](_0x4b90ba[_0x63f9('0x4f')]['offset']);}_0x1c599e[_0x63f9('0x56')]=qs[_0x63f9('0x57')](_0x4b90ba[_0x63f9('0x4f')]['sort']);_0x1c599e['where']=qs['filters'](_['pick'](_0x4b90ba[_0x63f9('0x4f')],_0x19a603[_0x63f9('0x58')]));if(_0x4b90ba[_0x63f9('0x4f')]['filter']){_0x1c599e['where']=_[_0x63f9('0x59')](_0x1c599e[_0x63f9('0x5a')],{'$or':_[_0x63f9('0x41')](_0x3aa5e0,function(_0x803b18){if(_0x803b18[_0x63f9('0x4c')]!==_0x63f9('0x5b')){return db[_0x63f9('0x5c')][_0x63f9('0x5a')](db['sequelize']['fn'](_0x63f9('0x5d'),db[_0x63f9('0x5c')]['col'](_0x803b18[_0x63f9('0x46')])),{'$like':db[_0x63f9('0x5c')]['fn']('lower','%'+_0x4b90ba[_0x63f9('0x4f')]['filter']+'%')});}})});}_0x1c599e=_[_0x63f9('0x59')]({},_0x1c599e,_0x4b90ba[_0x63f9('0x5e')]);var _0xf3650d={'where':_0x1c599e[_0x63f9('0x5a')]};return db[_0x63f9('0x4a')][_0x63f9('0x33')](_0xf3650d)['then'](function(_0x3c32e4){_0x2cdb7e['count']=_0x3c32e4;if(_0x4b90ba[_0x63f9('0x4f')][_0x63f9('0x5f')]){_0x1c599e['include']=[{'all':!![]}];}return db[_0x63f9('0x4a')]['findAll'](_0x1c599e);})[_0x63f9('0x25')](function(_0x25b471){_0x2cdb7e['rows']=_0x25b471;return _0x2cdb7e;})[_0x63f9('0x25')](respondWithFilteredResult(_0xd37f1b,_0x1c599e))['catch'](handleError(_0xd37f1b,null));};exports[_0x63f9('0x60')]=function(_0x3a35a2,_0x537512){var _0x2557ac={'raw':![],'where':{'id':_0x3a35a2[_0x63f9('0x61')]['id']}},_0x4601d3={};_0x4601d3['model']=_['differenceBy'](_[_0x63f9('0x50')](db[_0x63f9('0x4a')]['rawAttributes']),[_0x63f9('0x4e'),_0x63f9('0x62')]);_0x4601d3['query']=_[_0x63f9('0x50')](_0x3a35a2[_0x63f9('0x4f')]);_0x4601d3[_0x63f9('0x58')]=_['intersection'](_0x4601d3[_0x63f9('0x4d')],_0x4601d3[_0x63f9('0x4f')]);_0x2557ac['attributes']=_[_0x63f9('0x52')](_0x4601d3['model'],qs[_0x63f9('0x53')](_0x3a35a2['query'][_0x63f9('0x53')]));_0x2557ac[_0x63f9('0x51')]=_0x2557ac[_0x63f9('0x51')][_0x63f9('0x54')]?_0x2557ac[_0x63f9('0x51')]:_0x4601d3['model'];if(_0x3a35a2['query'][_0x63f9('0x5f')]){_0x2557ac[_0x63f9('0x63')]=[{'all':!![]}];}_0x2557ac=_[_0x63f9('0x59')]({},_0x2557ac,_0x3a35a2[_0x63f9('0x5e')]);return db['User'][_0x63f9('0x45')](_0x2557ac)[_0x63f9('0x25')](handleEntityNotFound(_0x537512,null))['then'](respondWithResult(_0x537512,null))['catch'](handleError(_0x537512,null));};exports[_0x63f9('0x64')]=function(_0x59c9e0,_0x40f42c){return db[_0x63f9('0x4a')][_0x63f9('0x64')](_0x59c9e0['body'],{'raw':![],'individualHooks':!![]})[_0x63f9('0x25')](respondWithResult(_0x40f42c,0xc9))['catch'](handleError(_0x40f42c,null));};exports[_0x63f9('0x65')]=function(_0x4579bf,_0xa38d1c){if(_0x4579bf[_0x63f9('0x66')]['id']){delete _0x4579bf[_0x63f9('0x66')]['id'];}delete _0x4579bf[_0x63f9('0x66')][_0x63f9('0x44')];return db[_0x63f9('0x4a')][_0x63f9('0x45')]({'where':{'id':_0x4579bf['params']['id']}})[_0x63f9('0x25')](handleEntityNotFound(_0xa38d1c,null))['then'](saveUpdates(_0x4579bf[_0x63f9('0x66')],null))[_0x63f9('0x25')](respondWithResult(_0xa38d1c,null))[_0x63f9('0x67')](handleError(_0xa38d1c,null));};exports[_0x63f9('0x68')]=function(_0x5f1294,_0x1f5326){return db[_0x63f9('0x4a')]['describe']()[_0x63f9('0x25')](respondWithResult(_0x1f5326,null))[_0x63f9('0x67')](handleError(_0x1f5326,null));};exports[_0x63f9('0x69')]=function(_0x4a5a70,_0x15b930,_0x5916b9){return db['User'][_0x63f9('0x45')]({'where':{'id':_0x4a5a70[_0x63f9('0x61')]['id']}})[_0x63f9('0x25')](handleEntityNotFound(_0x15b930,null))[_0x63f9('0x25')](function(_0x3b32ff){if(_0x3b32ff){return _0x3b32ff[_0x63f9('0x69')](_0x4a5a70['body'][_0x63f9('0x6a')],_['omit'](_0x4a5a70[_0x63f9('0x66')],[_0x63f9('0x6a'),'id'])||{});}})[_0x63f9('0x25')](respondWithResult(_0x15b930,null))['catch'](handleError(_0x15b930,null));};var getLicense=function(_0x59d31b){return new BPromise(function(_0x3387a5,_0x22aa83){var _0x2f613f=0x0;_0x59d31b['body']['role']===_0x63f9('0x3d')&&_0x3387a5('agent\x20role');return db[_0x63f9('0x4a')][_0x63f9('0x33')]({'where':{'$or':[{'role':_0x59d31b[_0x63f9('0x66')][_0x63f9('0x44')]===_0x63f9('0x6b')?_0x63f9('0x6b'):[_0x63f9('0x6c'),_0x63f9('0x3b')]}]}})['then'](function(_0x32cc10){_0x2f613f=_0x32cc10;return require(_0x63f9('0x6d'))[_0x63f9('0x6e')]();})[_0x63f9('0x25')](function(_0x210fbb){var _0x3339f8=_0x59d31b['body'][_0x63f9('0x44')]===_0x63f9('0x6b')?'telephones':_0x63f9('0x6f');if(!_['isNil'](_0x210fbb[_0x3339f8])&&_0x2f613f>=_0x210fbb[_0x3339f8]){return _0x22aa83({'message':_0x63f9('0x70')});}return _0x3387a5(util[_0x63f9('0x71')](_0x63f9('0x72'),_0x3339f8,_0x2f613f));})[_0x63f9('0x67')](function(_0x14aa70){return _0x22aa83(_0x14aa70);});});};exports[_0x63f9('0x73')]=function(_0x674bde,_0x37bee9){return getLicense(_0x674bde)[_0x63f9('0x25')](function(_0x573c8d){if(!_0x674bde[_0x63f9('0x66')][_0x63f9('0x74')]){var _0x50f293;return db[_0x63f9('0x75')][_0x63f9('0x76')](0x1)[_0x63f9('0x25')](function(_0x134063){return checkPasswordPattern(_0x134063,_0x674bde['body'][_0x63f9('0x4e')],_0x134063[_0x63f9('0x77')]);})['then'](function(_0xee5ccf){_0x50f293=_0xee5ccf[_0x63f9('0x78')];return db[_0x63f9('0x4a')][_0x63f9('0x79')](_0x63f9('0x74'));})[_0x63f9('0x25')](function(_0xf243cd){if(_['isNil'](_0xf243cd)){if(_0x50f293){_0x674bde[_0x63f9('0x66')][_0x63f9('0x74')]=_0x50f293;}else{_0x674bde[_0x63f9('0x66')]['internal']=0x1;}}else{if(_[_0x63f9('0x7a')](_0x50f293)||_0x50f293==_0xf243cd){_0x674bde['body'][_0x63f9('0x74')]=_0xf243cd+0x1;}else if(_0x50f293>_0xf243cd){_0x674bde[_0x63f9('0x66')][_0x63f9('0x74')]=_0x50f293;}else{return db[_0x63f9('0x5c')][_0x63f9('0x4f')](_0x63f9('0x7b'),{'type':db[_0x63f9('0x5c')][_0x63f9('0x7c')][_0x63f9('0x7d')]})[_0x63f9('0x25')](function(_0xd79f59){if(_0xd79f59&&_0xd79f59[_0x63f9('0x54')]){for(var _0x26df56=0x0,_0x2274af=_0xd79f59[_0x63f9('0x54')];_0x26df56<_0x2274af&&_[_0x63f9('0x7a')](_0x674bde[_0x63f9('0x66')][_0x63f9('0x74')]);_0x26df56++){if(_0x50f293<=_0xd79f59[_0x26df56][_0x63f9('0x7e')]){_0x674bde[_0x63f9('0x66')][_0x63f9('0x74')]=_0xd79f59[_0x26df56]['from'];}else if(_0x50f293>_0xd79f59[_0x26df56]['from']&&_0x50f293<=_0xd79f59[_0x26df56]['to']){_0x674bde[_0x63f9('0x66')]['internal']=_0x50f293;}}}if(_['isNil'](_0x674bde[_0x63f9('0x66')][_0x63f9('0x74')])){_0x674bde[_0x63f9('0x66')][_0x63f9('0x74')]=_0xf243cd+0x1;}});}}});}})['then'](function(){if(_0x674bde[_0x63f9('0x66')][_0x63f9('0x7f')]){_0x674bde[_0x63f9('0x66')][_0x63f9('0x80')]=_0x674bde[_0x63f9('0x66')][_0x63f9('0x74')];_0x674bde[_0x63f9('0x66')][_0x63f9('0x81')]={'mailbox':_0x674bde[_0x63f9('0x66')][_0x63f9('0x74')],'password':_0x674bde[_0x63f9('0x66')][_0x63f9('0x4e')],'fullname':_0x674bde['body'][_0x63f9('0x82')],'email':_0x674bde[_0x63f9('0x66')][_0x63f9('0x83')]};}if(_0x674bde[_0x63f9('0x66')]&&_0x674bde[_0x63f9('0x66')][_0x63f9('0x44')]===_0x63f9('0x3d')){_0x674bde[_0x63f9('0x66')][_0x63f9('0x84')]=[_0x63f9('0x85'),_0x63f9('0x86'),_0x63f9('0x87'),_0x63f9('0x88'),_0x63f9('0x89'),_0x63f9('0x8a'),_0x63f9('0x8b'),_0x63f9('0x8c'),_0x63f9('0x8d'),_0x63f9('0x8e'),_0x63f9('0x8f'),_0x63f9('0x90')];}return db[_0x63f9('0x4a')][_0x63f9('0x73')](_0x674bde[_0x63f9('0x66')],{'include':[{'model':db[_0x63f9('0x81')],'as':_0x63f9('0x81')}]});})[_0x63f9('0x25')](function(_0x327bf5){if(_0x674bde[_0x63f9('0x66')][_0x63f9('0x44')]===_0x63f9('0x3b'))return _0x327bf5;var _0x4a08a1=_0x674bde['user']['get']({'plain':!![]});if(!_0x4a08a1)throw new Error(_0x63f9('0x91'));if(_0x4a08a1[_0x63f9('0x44')]===_0x63f9('0x3b')){var _0x52a9ae=_0x327bf5[_0x63f9('0x3a')]({'plain':!![]});var _0x10d034=[{'name':'Agents','value':_0x63f9('0x3d')},{'name':_0x63f9('0x3e'),'value':_0x63f9('0x6b')}];var _0x1df4a7=_['find'](_0x10d034,[_0x63f9('0x42'),_0x52a9ae[_0x63f9('0x44')]])[_0x63f9('0x46')];return db['UserProfileSection']['find']({'where':{'name':_0x1df4a7,'userProfileId':_0x4a08a1[_0x63f9('0x92')]},'raw':!![]})[_0x63f9('0x25')](function(_0x51aa8f){if(_0x51aa8f&&_0x51aa8f[_0x63f9('0x93')]===0x0){return db['UserProfileResource'][_0x63f9('0x73')]({'name':_0x52a9ae[_0x63f9('0x46')],'resourceId':_0x52a9ae['id'],'type':_0x51aa8f[_0x63f9('0x46')],'sectionId':_0x51aa8f['id']},{})[_0x63f9('0x25')](function(){return _0x327bf5;});}else{return _0x327bf5;}})[_0x63f9('0x67')](function(_0x53f52d){logger[_0x63f9('0x2c')](_0x63f9('0x94'),_0x53f52d);throw _0x53f52d;});}return _0x327bf5;})[_0x63f9('0x25')](respondWithResult(_0x37bee9,0xc9))['catch'](handleError(_0x37bee9,null));};exports[_0x63f9('0x95')]=function(_0x50e5fd,_0x496376,_0x131597){var _0x3633dd=![];if(_0x50e5fd[_0x63f9('0x66')]['id']){delete _0x50e5fd['body']['id'];}return db['Setting'][_0x63f9('0x96')]({'attributes':['id','securePassword']})[_0x63f9('0x25')](function(_0x645b79){_0x3633dd=_0x645b79[_0x63f9('0x77')];return db['User']['find']({'where':{'id':_0x50e5fd[_0x63f9('0x61')]['id']}});})[_0x63f9('0x25')](function(_0x46c1eb){if(_0x46c1eb){if(_0x46c1eb['id']==_0x50e5fd['user']['id']){if(!_0x50e5fd[_0x63f9('0x66')][_0x63f9('0x97')]||!_0x50e5fd['body']['newPassword']){throw new db['Sequelize']['ValidationError']('Invalid\x20body\x20format.\x20Use\x20oldPassord\x20and\x20newPassword');}if(!_0x46c1eb[_0x63f9('0x98')](_0x50e5fd[_0x63f9('0x66')][_0x63f9('0x97')])){throw new db[(_0x63f9('0x22'))][(_0x63f9('0x23'))]('Wrong\x20credentials');}if(_0x50e5fd[_0x63f9('0x66')]['oldPassword']==_0x50e5fd[_0x63f9('0x66')]['newPassword']){throw new db['Sequelize'][(_0x63f9('0x23'))](_0x63f9('0x99'));}return _0x46c1eb;}else if(_0x50e5fd['user'][_0x63f9('0x44')]==_0x63f9('0x6c')){if(!_0x50e5fd[_0x63f9('0x66')][_0x63f9('0x9a')]){throw new db[(_0x63f9('0x22'))][(_0x63f9('0x23'))](_0x63f9('0x9b'));}return _0x46c1eb;}else if(_0x50e5fd[_0x63f9('0x3b')][_0x63f9('0x44')]==_0x63f9('0x3b')){if(!_0x50e5fd['body'][_0x63f9('0x9a')]){throw new db['Sequelize'][(_0x63f9('0x23'))]('Invalid\x20body\x20format.\x20Use\x20newPassword');}if(_0x46c1eb[_0x63f9('0x44')]!=_0x63f9('0x3d')){throw new db['Sequelize'][(_0x63f9('0x23'))]('Unauthorized');}return _0x46c1eb;}else{throw new db[(_0x63f9('0x22'))]['ValidationError'](_0x63f9('0x9c'));}}return null;})['then'](handleEntityNotFound(_0x496376,null))[_0x63f9('0x25')](function(_0x5ee759){return checkPasswordPattern(_0x5ee759,_0x50e5fd[_0x63f9('0x66')][_0x63f9('0x9a')],_0x3633dd);})[_0x63f9('0x25')](saveUpdates({'password':_0x50e5fd[_0x63f9('0x66')][_0x63f9('0x9a')],'passwordResetAt':_0x50e5fd['user']['id']==_0x50e5fd[_0x63f9('0x61')]['id']?moment():null},null))[_0x63f9('0x25')](respondWithResult(_0x496376,null))[_0x63f9('0x67')](handleError(_0x496376,null));};exports[_0x63f9('0x9d')]=function(_0xf35202,_0x244015,_0x464bca){var _0x450d85=_0xf35202[_0x63f9('0x66')]['channel'];return db[_0x63f9('0x4a')][_0x63f9('0x45')]({'where':{'id':_0xf35202[_0x63f9('0x61')]['id']},'attributes':['id',_0x63f9('0x46'),_0x63f9('0x44'),_0x63f9('0x9e'),'loginInPause',_0x63f9('0x9f'),_0x63f9('0xa0')]})[_0x63f9('0x25')](handleEntityNotFound(_0x244015,null))[_0x63f9('0x25')](function(_0x1d9b86){if(_0x1d9b86){if(!utils[_0x63f9('0xa1')](_0x450d85)){throw new db[(_0x63f9('0x22'))][(_0x63f9('0x23'))](_0x63f9('0xa2'));}return _0x1d9b86[_0x63f9('0xa3')+_['capitalize'](_0x450d85[_0x63f9('0xa4')]())+_0x63f9('0xa5')](_0xf35202['body'][_0x63f9('0x6a')],{'penalty':_0xf35202[_0x63f9('0x66')][_0x63f9('0xa6')]||0x0})['spread'](function(_0x37b139){for(var _0x1a083d=0x0;_0x1a083d<_0xf35202[_0x63f9('0x66')][_0x63f9('0x6a')][_0x63f9('0x54')];_0x1a083d+=0x1){var _0x4744b9={'UserId':_0xf35202[_0x63f9('0x61')]['id']};_0x4744b9[_[_0x63f9('0xa7')](_0x450d85['toLowerCase']())+_0x63f9('0xa8')]=_0xf35202[_0x63f9('0x66')][_0x63f9('0x6a')][_0x1a083d];socket[_0x63f9('0xa9')](_0x63f9('0x3b')+_[_0x63f9('0xa7')](_0x450d85['toLowerCase']())+'Queue:save',_0x4744b9);}return _0x37b139;})['then'](function(){if(_0x450d85===_0x63f9('0xaa')){return db[_0x63f9('0xab')][_0x63f9('0xac')]({'where':{'id':_0xf35202['body'][_0x63f9('0x6a')]||[]},'raw':!![],'attributes':['id',_0x63f9('0x46')]});}})[_0x63f9('0x25')](function(_0x2a3bed){var _0x118314=_0x1d9b86['get']({'plain':!![]});var _0x28fd9a=[];if(_0x450d85===_0x63f9('0xaa')&&_0x118314[_0x63f9('0x44')]===_0x63f9('0x3d')&&_0x118314[_0x63f9('0x9e')]){for(var _0x303c1f=0x0;_0x303c1f<_0x2a3bed[_0x63f9('0x54')];_0x303c1f+=0x1){_0x28fd9a[_0x63f9('0xad')]({'membername':_0x118314[_0x63f9('0x46')],'UserId':_0x118314['id'],'queue_name':_0x2a3bed[_0x303c1f]['name'],'VoiceQueueId':_0x2a3bed[_0x303c1f]['id'],'interface':_[_0x63f9('0x7a')](_0x118314['interface'])?util[_0x63f9('0x71')](_0x63f9('0xae'),_0x118314[_0x63f9('0x46')]):_0x118314[_0x63f9('0xa0')],'paused':_0x118314[_0x63f9('0x9f')]||![],'penalty':_0xf35202[_0x63f9('0x66')][_0x63f9('0xa6')]||0x0});}return BPromise['each'](_0x28fd9a,function(_0x1c890b){return db['UserVoiceQueueRt'][_0x63f9('0xaf')](_0x1c890b);});}return _0x1d9b86;});}})[_0x63f9('0x25')](respondWithStatusCode(_0x244015,null))['catch'](handleError(_0x244015,null));};exports[_0x63f9('0xb0')]=function(_0x2bf15e,_0x744329,_0x47c1d8){var _0x35a2bf;return db[_0x63f9('0x4a')][_0x63f9('0x45')]({'where':{'id':_0x2bf15e[_0x63f9('0x61')]['id']},'attributes':['id',_0x63f9('0x46'),'role']})['then'](handleEntityNotFound(_0x744329,null))[_0x63f9('0x25')](function(_0x15d29d){if(_0x15d29d){_0x35a2bf=_0x15d29d;if(!_0x2bf15e[_0x63f9('0x4f')][_0x63f9('0xb1')]||!utils[_0x63f9('0xa1')](_0x2bf15e[_0x63f9('0x4f')]['channel'])){throw new db[(_0x63f9('0x22'))][(_0x63f9('0x23'))](_0x63f9('0xa2'));}return _0x15d29d[_0x63f9('0xb2')+_['capitalize'](_0x2bf15e['query'][_0x63f9('0xb1')]['toLowerCase']())+_0x63f9('0xa5')](_0x2bf15e[_0x63f9('0x4f')][_0x63f9('0x6a')]);}})[_0x63f9('0x25')](function(_0x138e5d){for(var _0x3ca3d9=0x0;_0x3ca3d9<_0x2bf15e['query'][_0x63f9('0x6a')][_0x63f9('0x54')];_0x3ca3d9+=0x1){var _0x1133c8={'UserId':_0x2bf15e['params']['id']};_0x1133c8[_['capitalize'](_0x2bf15e[_0x63f9('0x4f')]['channel'][_0x63f9('0xa4')]())+_0x63f9('0xa8')]=_0x2bf15e['query'][_0x63f9('0x6a')][_0x3ca3d9];socket['emit']('user'+_[_0x63f9('0xa7')](_0x2bf15e[_0x63f9('0x4f')][_0x63f9('0xb1')][_0x63f9('0xa4')]())+_0x63f9('0xb3'),_0x1133c8);}return _0x138e5d;})[_0x63f9('0x25')](function(){if(_0x2bf15e[_0x63f9('0x4f')][_0x63f9('0xb1')]===_0x63f9('0xaa')){return db[_0x63f9('0xb4')][_0x63f9('0xb5')]({'where':{'UserId':_0x2bf15e['params']['id'],'VoiceQueueId':_0x2bf15e[_0x63f9('0x4f')][_0x63f9('0x6a')]},'individualHooks':!![]})[_0x63f9('0x25')](function(){return _0x35a2bf;});}return _0x35a2bf;})[_0x63f9('0x25')](respondWithStatusCode(_0x744329,null))[_0x63f9('0x67')](handleError(_0x744329,null));};exports[_0x63f9('0xb6')]=function(_0x836b82,_0x172fd1,_0x5955f0){_0x836b82[_0x63f9('0x66')]['userpic']=_0x836b82[_0x63f9('0xb7')][_0x63f9('0xb8')];return db['User'][_0x63f9('0x45')]({'where':{'id':_0x836b82[_0x63f9('0x61')]['id']}})[_0x63f9('0x25')](handleEntityNotFound(_0x172fd1,null))[_0x63f9('0x25')](saveUpdates(_0x836b82[_0x63f9('0x66')],null))[_0x63f9('0x25')](respondWithResult(_0x172fd1,null))[_0x63f9('0x67')](handleError(_0x172fd1,null));};exports[_0x63f9('0xb9')]=function(_0x51d1a2,_0x33a960,_0x1d1ec3){var _0x54e4ed=path[_0x63f9('0xba')](config['root'],_0x63f9('0xbb'));return db[_0x63f9('0x4a')][_0x63f9('0x45')]({'where':{'id':_0x51d1a2['params']['id']},'attributes':['id',_0x63f9('0xbc')],'raw':!![]})[_0x63f9('0x25')](handleEntityNotFound(_0x33a960,null))[_0x63f9('0x25')](function(_0x3c4d44){if(_0x3c4d44){if(_[_0x63f9('0x7a')](_0x3c4d44[_0x63f9('0xbc')])){return _0x33a960[_0x63f9('0xbd')](_0x54e4ed);}else{if(!fs['existsSync'](path[_0x63f9('0xba')](config['root'],_0x63f9('0xbe'),_0x3c4d44[_0x63f9('0xbc')]))){return _0x33a960[_0x63f9('0xbd')](_0x54e4ed);}return _0x33a960[_0x63f9('0xbd')](path[_0x63f9('0xba')](config['root'],_0x63f9('0xbe'),_0x3c4d44[_0x63f9('0xbc')]));}}})['catch'](handleError(_0x33a960,null));};exports[_0x63f9('0xbf')]=function(_0x98f877,_0xf7377f,_0x12c20e){var _0x4ed5ba={};var _0x2b9b2c={};var _0x2db27c;var _0x2ee840;return db[_0x63f9('0x4a')]['findOne']({'where':{'id':_0x98f877[_0x63f9('0x61')]['id']}})[_0x63f9('0x25')](handleEntityNotFound(_0xf7377f,null))[_0x63f9('0x25')](function(_0x41a189){if(_0x41a189){_0x2db27c=_0x41a189;_0x2b9b2c['model']=_[_0x63f9('0x50')](db[_0x63f9('0xc0')][_0x63f9('0x4b')]);_0x2b9b2c[_0x63f9('0x4f')]=_[_0x63f9('0x50')](_0x98f877[_0x63f9('0x4f')]);_0x2b9b2c[_0x63f9('0x58')]=_['intersection'](_0x2b9b2c[_0x63f9('0x4d')],_0x2b9b2c[_0x63f9('0x4f')]);_0x4ed5ba[_0x63f9('0x51')]=_[_0x63f9('0x52')](_0x2b9b2c[_0x63f9('0x4d')],qs[_0x63f9('0x53')](_0x98f877[_0x63f9('0x4f')][_0x63f9('0x53')]));_0x4ed5ba['attributes']=_0x4ed5ba['attributes'][_0x63f9('0x54')]?_0x4ed5ba[_0x63f9('0x51')]:_0x2b9b2c['model'];_0x4ed5ba['order']=qs[_0x63f9('0x57')](_0x98f877[_0x63f9('0x4f')][_0x63f9('0x57')]);_0x4ed5ba['where']=qs[_0x63f9('0x58')](_[_0x63f9('0xc1')](_0x98f877[_0x63f9('0x4f')],_0x2b9b2c[_0x63f9('0x58')]));if(_0x98f877[_0x63f9('0x4f')][_0x63f9('0x3f')]){_0x4ed5ba[_0x63f9('0x5a')]=_[_0x63f9('0x59')](_0x4ed5ba[_0x63f9('0x5a')],{'$or':_[_0x63f9('0x41')](_0x4ed5ba[_0x63f9('0x51')],function(_0x22a68f){var _0xa5a56f={};_0xa5a56f[_0x22a68f]={'$like':'%'+_0x98f877[_0x63f9('0x4f')]['filter']+'%'};return _0xa5a56f;})});}_0x4ed5ba=_[_0x63f9('0x59')]({},_0x4ed5ba,_0x98f877[_0x63f9('0x5e')]);return _0x2db27c[_0x63f9('0xbf')](_0x4ed5ba);}})[_0x63f9('0x25')](function(_0x996ba9){if(_0x996ba9){_0x2ee840=_0x996ba9[_0x63f9('0x54')];if(_0x98f877[_0x63f9('0x4f')][_0x63f9('0xc2')](_0x63f9('0x5f'))){_0x4ed5ba[_0x63f9('0x63')]=[{'model':db[_0x63f9('0xc3')],'as':'List','required':![]},{'model':db['Tag'],'as':'Tags','attributes':['id',_0x63f9('0x46'),_0x63f9('0xc4')],'where':_0x98f877[_0x63f9('0x4f')][_0x63f9('0xc5')]?{'id':_0x98f877[_0x63f9('0x4f')][_0x63f9('0xc5')]}:undefined,'required':_0x98f877['query'][_0x63f9('0xc5')]?!![]:![]}];}if(!_0x98f877[_0x63f9('0x4f')][_0x63f9('0xc2')]('nolimit')){_0x4ed5ba[_0x63f9('0x35')]=qs['limit'](_0x98f877['query']['limit']);_0x4ed5ba[_0x63f9('0x34')]=qs['offset'](_0x98f877[_0x63f9('0x4f')]['offset']);}return _0x2db27c[_0x63f9('0xbf')](_0x4ed5ba);}})[_0x63f9('0x25')](function(_0x3a8b71){if(_0x3a8b71){return _0x3a8b71?{'count':_0x2ee840,'rows':_0x3a8b71}:null;}})[_0x63f9('0x25')](respondWithResult(_0xf7377f,null))[_0x63f9('0x67')](handleError(_0xf7377f,null));};exports[_0x63f9('0xc6')]=function(_0x593ed3,_0x21efc9,_0x2b56eb){var _0x50ceb8;var _0x86dbb9;var _0x2df344={};var _0x4a08a2;return db[_0x63f9('0x4a')][_0x63f9('0x96')]({'where':{'id':_0x593ed3[_0x63f9('0x61')]['id']},'attributes':['id','name','role']})[_0x63f9('0x25')](handleEntityNotFound(_0x21efc9,null))[_0x63f9('0x25')](function(_0x14a825){if(!utils['isValidChannel'](_0x593ed3[_0x63f9('0x4f')]['channel'])){throw new db[(_0x63f9('0x22'))][(_0x63f9('0x23'))](_0x63f9('0xa2'));}_0x50ceb8=_0x14a825;var _0x13569e={};_0x13569e[_0x63f9('0x4d')]=_[_0x63f9('0x50')](db[_[_0x63f9('0xa7')](_0x593ed3[_0x63f9('0x4f')][_0x63f9('0xb1')])+'Queue'][_0x63f9('0x4b')]);_0x13569e[_0x63f9('0x4f')]=_[_0x63f9('0x50')](_0x593ed3[_0x63f9('0x4f')]);_0x13569e['filters']=_[_0x63f9('0x52')](_0x13569e[_0x63f9('0x4d')],_0x13569e['query']);_0x2df344[_0x63f9('0x51')]=_['intersection'](_0x13569e[_0x63f9('0x4d')],qs[_0x63f9('0x53')](_0x593ed3[_0x63f9('0x4f')]['fields']));_0x2df344[_0x63f9('0x51')]=_0x2df344[_0x63f9('0x51')][_0x63f9('0x54')]?_0x2df344[_0x63f9('0x51')]:_0x13569e[_0x63f9('0x4d')];_0x2df344[_0x63f9('0x56')]=qs[_0x63f9('0x57')](_0x593ed3['query']['sort']);_0x2df344[_0x63f9('0x5a')]=qs[_0x63f9('0x58')](_[_0x63f9('0xc1')](_0x593ed3[_0x63f9('0x4f')],_0x13569e['filters']));if(_0x593ed3['query']['filter']){_0x2df344[_0x63f9('0x5a')]=_['merge'](_0x2df344['where'],{'$or':_[_0x63f9('0x41')](_0x2df344[_0x63f9('0x51')],function(_0x424550){var _0x14d403={};_0x14d403[_0x424550]={'$like':'%'+_0x593ed3['query'][_0x63f9('0x3f')]+'%'};return _0x14d403;})});}_0x2df344=_[_0x63f9('0x59')]({},_0x2df344,_0x593ed3['options']);switch(_0x50ceb8[_0x63f9('0x44')]){case _0x63f9('0x6c'):return db[_[_0x63f9('0xa7')](_0x593ed3[_0x63f9('0x4f')][_0x63f9('0xb1')])+_0x63f9('0xc7')]['findAll'](_0x2df344);case _0x63f9('0x3b'):case _0x63f9('0x3d'):return _0x50ceb8[_0x63f9('0x3a')+_['capitalize'](_0x593ed3[_0x63f9('0x4f')][_0x63f9('0xb1')])+_0x63f9('0xa5')](_0x2df344);default:throw new db[(_0x63f9('0x22'))][(_0x63f9('0x23'))]('Unknown\x20role');}})[_0x63f9('0x25')](function(_0x11bf78){_0x4a08a2=_0x11bf78[_0x63f9('0x54')];if(!_0x593ed3[_0x63f9('0x4f')][_0x63f9('0xc2')]('nolimit')){_0x2df344[_0x63f9('0x35')]=qs[_0x63f9('0x35')](_0x593ed3['query']['limit']);_0x2df344['offset']=qs['offset'](_0x593ed3[_0x63f9('0x4f')][_0x63f9('0x34')]);}switch(_0x50ceb8[_0x63f9('0x44')]){case'admin':return db[_[_0x63f9('0xa7')](_0x593ed3['query'][_0x63f9('0xb1')])+'Queue'][_0x63f9('0xac')](_0x2df344);case _0x63f9('0x3b'):case _0x63f9('0x3d'):return _0x50ceb8[_0x63f9('0x3a')+_[_0x63f9('0xa7')](_0x593ed3['query'][_0x63f9('0xb1')])+'Queues'](_0x2df344);}})[_0x63f9('0x25')](function(_0x17f30b){return{'count':_0x4a08a2,'rows':_0x17f30b};})['then'](respondWithResult(_0x21efc9,null))[_0x63f9('0x67')](handleError(_0x21efc9,null));};exports[_0x63f9('0xc8')]=function(_0x2e19fb,_0x217c4d,_0x4abb20){var _0x402fc7={};var _0x43be0f={};var _0x18695c;var _0x147381;return db[_0x63f9('0x4a')][_0x63f9('0x96')]({'where':{'id':_0x2e19fb[_0x63f9('0x61')]['id']}})[_0x63f9('0x25')](handleEntityNotFound(_0x217c4d,null))[_0x63f9('0x25')](function(_0x45d882){if(_0x45d882){_0x18695c=_0x45d882;_0x43be0f[_0x63f9('0x4d')]=_['keys'](db[_0x63f9('0xb4')][_0x63f9('0x4b')]);_0x43be0f[_0x63f9('0x4f')]=_[_0x63f9('0x50')](_0x2e19fb[_0x63f9('0x4f')]);_0x43be0f['filters']=_['intersection'](_0x43be0f['model'],_0x43be0f[_0x63f9('0x4f')]);_0x402fc7[_0x63f9('0x51')]=_['intersection'](_0x43be0f[_0x63f9('0x4d')],qs[_0x63f9('0x53')](_0x2e19fb[_0x63f9('0x4f')]['fields']));_0x402fc7[_0x63f9('0x51')]=_0x402fc7['attributes'][_0x63f9('0x54')]?_0x402fc7[_0x63f9('0x51')]:_0x43be0f['model'];_0x402fc7[_0x63f9('0x56')]=qs[_0x63f9('0x57')](_0x2e19fb[_0x63f9('0x4f')][_0x63f9('0x57')]);_0x402fc7[_0x63f9('0x5a')]=qs[_0x63f9('0x58')](_['pick'](_0x2e19fb[_0x63f9('0x4f')],_0x43be0f['filters']));if(_0x2e19fb[_0x63f9('0x4f')][_0x63f9('0x3f')]){_0x402fc7[_0x63f9('0x5a')]=_['merge'](_0x402fc7[_0x63f9('0x5a')],{'$or':_['map'](_0x402fc7['attributes'],function(_0x30d283){var _0x4ff895={};_0x4ff895[_0x30d283]={'$like':'%'+_0x2e19fb[_0x63f9('0x4f')]['filter']+'%'};return _0x4ff895;})});}_0x402fc7=_['merge']({},_0x402fc7,_0x2e19fb[_0x63f9('0x5e')]);return _0x18695c['getVoiceQueuesRt'](_0x402fc7);}})['then'](function(_0x46a7ed){if(_0x46a7ed){_0x147381=_0x46a7ed[_0x63f9('0x54')];if(!_0x2e19fb['query'][_0x63f9('0xc2')](_0x63f9('0x55'))){_0x402fc7[_0x63f9('0x35')]=qs[_0x63f9('0x35')](_0x2e19fb[_0x63f9('0x4f')][_0x63f9('0x35')]);_0x402fc7[_0x63f9('0x34')]=qs['offset'](_0x2e19fb[_0x63f9('0x4f')][_0x63f9('0x34')]);}return _0x18695c['getVoiceQueuesRt'](_0x402fc7);}})['then'](function(_0x2aa2b4){if(_0x2aa2b4){return _0x2aa2b4?{'count':_0x147381,'rows':_0x2aa2b4}:null;}})[_0x63f9('0x25')](respondWithResult(_0x217c4d,null))[_0x63f9('0x67')](handleError(_0x217c4d,null));};exports[_0x63f9('0xc9')]=function(_0x43a065,_0x4ea1a0,_0x64ced){var _0x4c7d0b={};var _0x4d22fc={};var _0x1e90c3;var _0xfb5a93;return db[_0x63f9('0x4a')][_0x63f9('0x96')]({'where':{'id':_0x43a065[_0x63f9('0x61')]['id']}})[_0x63f9('0x25')](handleEntityNotFound(_0x4ea1a0,null))['then'](function(_0x2515fa){if(_0x2515fa){_0x1e90c3=_0x2515fa;_0x4d22fc[_0x63f9('0x4d')]=_[_0x63f9('0x50')](db['ChatGroup']['rawAttributes']);_0x4d22fc[_0x63f9('0x4f')]=_[_0x63f9('0x50')](_0x43a065[_0x63f9('0x4f')]);_0x4d22fc[_0x63f9('0x58')]=_[_0x63f9('0x52')](_0x4d22fc[_0x63f9('0x4d')],_0x4d22fc['query']);_0x4c7d0b[_0x63f9('0x51')]=_[_0x63f9('0x52')](_0x4d22fc[_0x63f9('0x4d')],qs[_0x63f9('0x53')](_0x43a065[_0x63f9('0x4f')][_0x63f9('0x53')]));_0x4c7d0b['attributes']=_0x4c7d0b['attributes'][_0x63f9('0x54')]?_0x4c7d0b[_0x63f9('0x51')]:_0x4d22fc[_0x63f9('0x4d')];_0x4c7d0b[_0x63f9('0x56')]=qs[_0x63f9('0x57')](_0x43a065[_0x63f9('0x4f')][_0x63f9('0x57')]);_0x4c7d0b[_0x63f9('0x5a')]=qs[_0x63f9('0x58')](_['pick'](_0x43a065[_0x63f9('0x4f')],_0x4d22fc[_0x63f9('0x58')]));if(_0x43a065[_0x63f9('0x4f')][_0x63f9('0x3f')]){_0x4c7d0b[_0x63f9('0x5a')]=_['merge'](_0x4c7d0b[_0x63f9('0x5a')],{'$or':_[_0x63f9('0x41')](_0x4c7d0b[_0x63f9('0x51')],function(_0x2b6345){var _0x9035a={};_0x9035a[_0x2b6345]={'$like':'%'+_0x43a065[_0x63f9('0x4f')][_0x63f9('0x3f')]+'%'};return _0x9035a;})});}_0x4c7d0b=_['merge']({},_0x4c7d0b,_0x43a065[_0x63f9('0x5e')]);return _0x1e90c3[_0x63f9('0xc9')](_0x4c7d0b);}})[_0x63f9('0x25')](function(_0xbf189c){if(_0xbf189c){_0xfb5a93=_0xbf189c[_0x63f9('0x54')];if(!_0x43a065['query']['hasOwnProperty']('nolimit')){_0x4c7d0b[_0x63f9('0x35')]=qs['limit'](_0x43a065['query'][_0x63f9('0x35')]);_0x4c7d0b[_0x63f9('0x34')]=qs[_0x63f9('0x34')](_0x43a065[_0x63f9('0x4f')]['offset']);}return _0x1e90c3[_0x63f9('0xc9')](_0x4c7d0b);}})[_0x63f9('0x25')](function(_0x4e788d){if(_0x4e788d){return _0x4e788d?{'count':_0xfb5a93,'rows':_0x4e788d}:null;}})[_0x63f9('0x25')](respondWithResult(_0x4ea1a0,null))['catch'](handleError(_0x4ea1a0,null));};exports[_0x63f9('0xca')]=function(_0x26876a,_0x3abe90,_0x234a38){var _0x237715={'raw':!![],'where':{}};var _0x41d0af={};var _0x297609={'count':0x0,'rows':[]};return db[_0x63f9('0x4a')][_0x63f9('0x96')]({'where':{'id':_0x26876a[_0x63f9('0x61')]['id']}})[_0x63f9('0x25')](handleEntityNotFound(_0x3abe90,null))['then'](function(_0x3dac1c){if(_0x3dac1c){_0x41d0af[_0x63f9('0x4d')]=_[_0x63f9('0x50')](db[_0x63f9('0xcb')][_0x63f9('0x4b')]);_0x41d0af[_0x63f9('0x4f')]=_['keys'](_0x26876a[_0x63f9('0x4f')]);_0x41d0af['filters']=_[_0x63f9('0x52')](_0x41d0af[_0x63f9('0x4d')],_0x41d0af['query']);_0x237715['attributes']=_[_0x63f9('0x52')](_0x41d0af[_0x63f9('0x4d')],qs[_0x63f9('0x53')](_0x26876a[_0x63f9('0x4f')][_0x63f9('0x53')]));_0x237715[_0x63f9('0x51')]=_0x237715[_0x63f9('0x51')][_0x63f9('0x54')]?_0x237715['attributes']:_0x41d0af[_0x63f9('0x4d')];if(!_0x26876a[_0x63f9('0x4f')][_0x63f9('0xc2')](_0x63f9('0x55'))){_0x237715[_0x63f9('0x35')]=qs[_0x63f9('0x35')](_0x26876a[_0x63f9('0x4f')][_0x63f9('0x35')]);_0x237715[_0x63f9('0x34')]=qs['offset'](_0x26876a[_0x63f9('0x4f')][_0x63f9('0x34')]);}_0x237715['order']=qs['sort'](_0x26876a['query'][_0x63f9('0x57')]);_0x237715[_0x63f9('0x5a')]=qs[_0x63f9('0x58')](_['pick'](_0x26876a[_0x63f9('0x4f')],_0x41d0af[_0x63f9('0x58')]));_0x237715[_0x63f9('0x5a')][_0x63f9('0xcc')]=_0x3dac1c['id'];if(_0x26876a[_0x63f9('0x4f')][_0x63f9('0x3f')]){_0x237715[_0x63f9('0x5a')]=_[_0x63f9('0x59')](_0x237715[_0x63f9('0x5a')],{'$or':_[_0x63f9('0x41')](_0x237715['attributes'],function(_0x1b32c3){var _0x9eabaa={};_0x9eabaa[_0x1b32c3]={'$like':'%'+_0x26876a[_0x63f9('0x4f')][_0x63f9('0x3f')]+'%'};return _0x9eabaa;})});}_0x237715=_[_0x63f9('0x59')]({},_0x237715,_0x26876a['options']);return db[_0x63f9('0xcb')][_0x63f9('0x33')]({'where':_0x237715['where']})[_0x63f9('0x25')](function(_0x305e3c){_0x297609[_0x63f9('0x33')]=_0x305e3c;if(_0x26876a[_0x63f9('0x4f')][_0x63f9('0x5f')]){_0x237715[_0x63f9('0x63')]=[{'all':!![]}];}return db[_0x63f9('0xcb')]['findAll'](_0x237715);})[_0x63f9('0x25')](function(_0x16654a){_0x297609[_0x63f9('0xcd')]=_0x16654a;return _0x297609;});}})['then'](respondWithFilteredResult(_0x3abe90,_0x237715))[_0x63f9('0x67')](handleError(_0x3abe90,null));};exports[_0x63f9('0xce')]=function(_0x48fd84,_0x330125,_0x40918d){var _0x4e4544={'raw':!![],'where':{}};var _0x48a9d7={};var _0x55031d={'count':0x0,'rows':[]};return db[_0x63f9('0x4a')][_0x63f9('0x96')]({'where':{'id':_0x48fd84['params']['id']}})['then'](handleEntityNotFound(_0x330125,null))['then'](function(_0x17b77c){if(_0x17b77c){_0x48a9d7['model']=_[_0x63f9('0x50')](db[_0x63f9('0xcf')][_0x63f9('0x4b')]);_0x48a9d7['query']=_['keys'](_0x48fd84[_0x63f9('0x4f')]);_0x48a9d7[_0x63f9('0x58')]=_[_0x63f9('0x52')](_0x48a9d7[_0x63f9('0x4d')],_0x48a9d7[_0x63f9('0x4f')]);_0x4e4544[_0x63f9('0x51')]=_[_0x63f9('0x52')](_0x48a9d7[_0x63f9('0x4d')],qs[_0x63f9('0x53')](_0x48fd84['query'][_0x63f9('0x53')]));_0x4e4544[_0x63f9('0x51')]=_0x4e4544['attributes'][_0x63f9('0x54')]?_0x4e4544[_0x63f9('0x51')]:_0x48a9d7['model'];if(!_0x48fd84[_0x63f9('0x4f')][_0x63f9('0xc2')](_0x63f9('0x55'))){_0x4e4544[_0x63f9('0x35')]=qs[_0x63f9('0x35')](_0x48fd84[_0x63f9('0x4f')]['limit']);_0x4e4544[_0x63f9('0x34')]=qs[_0x63f9('0x34')](_0x48fd84[_0x63f9('0x4f')][_0x63f9('0x34')]);}_0x4e4544[_0x63f9('0x56')]=qs[_0x63f9('0x57')](_0x48fd84[_0x63f9('0x4f')][_0x63f9('0x57')]);_0x4e4544[_0x63f9('0x5a')]=qs[_0x63f9('0x58')](_['pick'](_0x48fd84['query'],_0x48a9d7[_0x63f9('0x58')]));_0x4e4544[_0x63f9('0x5a')][_0x63f9('0xcc')]=_0x17b77c['id'];if(_0x48fd84[_0x63f9('0x4f')][_0x63f9('0x3f')]){_0x4e4544[_0x63f9('0x5a')]=_[_0x63f9('0x59')](_0x4e4544['where'],{'$or':_[_0x63f9('0x41')](_0x4e4544[_0x63f9('0x51')],function(_0xfcff9f){var _0x34f439={};_0x34f439[_0xfcff9f]={'$like':'%'+_0x48fd84[_0x63f9('0x4f')][_0x63f9('0x3f')]+'%'};return _0x34f439;})});}_0x4e4544=_[_0x63f9('0x59')]({},_0x4e4544,_0x48fd84[_0x63f9('0x5e')]);return db['ScreenRecording'][_0x63f9('0x33')]({'where':_0x4e4544[_0x63f9('0x5a')]})[_0x63f9('0x25')](function(_0x23e89b){_0x55031d['count']=_0x23e89b;if(_0x48fd84[_0x63f9('0x4f')]['includeAll']){_0x4e4544['include']=[{'all':!![]}];}return db[_0x63f9('0xcf')]['findAll'](_0x4e4544);})[_0x63f9('0x25')](function(_0x4a379e){_0x55031d['rows']=_0x4a379e;return _0x55031d;});}})['then'](respondWithFilteredResult(_0x330125,_0x4e4544))[_0x63f9('0x67')](handleError(_0x330125,null));};exports['getChatInteractions']=function(_0x57c529,_0xea7abd,_0x36f747){var _0x41122a={};var _0x26c4c0={};var _0x8da500;var _0x44c093;return db['User'][_0x63f9('0x96')]({'where':{'id':_0x57c529['params']['id']}})[_0x63f9('0x25')](handleEntityNotFound(_0xea7abd,null))['then'](function(_0x521513){if(_0x521513){_0x8da500=_0x521513;_0x26c4c0['model']=_[_0x63f9('0x50')](db[_0x63f9('0xd0')][_0x63f9('0x4b')]);_0x26c4c0['query']=_['keys'](_0x57c529[_0x63f9('0x4f')]);_0x26c4c0['filters']=_['intersection'](_0x26c4c0[_0x63f9('0x4d')],_0x26c4c0[_0x63f9('0x4f')]);_0x41122a[_0x63f9('0x51')]=_[_0x63f9('0x52')](_0x26c4c0[_0x63f9('0x4d')],qs[_0x63f9('0x53')](_0x57c529[_0x63f9('0x4f')][_0x63f9('0x53')]));_0x41122a[_0x63f9('0x51')]=_0x41122a[_0x63f9('0x51')][_0x63f9('0x54')]?_0x41122a['attributes']:_0x26c4c0['model'];_0x41122a[_0x63f9('0x56')]=qs[_0x63f9('0x57')](_0x57c529[_0x63f9('0x4f')][_0x63f9('0x57')]);_0x41122a[_0x63f9('0x5a')]=qs[_0x63f9('0x58')](_[_0x63f9('0xc1')](_0x57c529[_0x63f9('0x4f')],_0x26c4c0[_0x63f9('0x58')]));if(_0x57c529[_0x63f9('0x4f')]['filter']){_0x41122a['where']=_[_0x63f9('0x59')](_0x41122a['where'],{'$or':_[_0x63f9('0x41')](_0x41122a['attributes'],function(_0x4557f0){var _0x329aaf={};_0x329aaf[_0x4557f0]={'$like':'%'+_0x57c529[_0x63f9('0x4f')][_0x63f9('0x3f')]+'%'};return _0x329aaf;})});}_0x41122a=_[_0x63f9('0x59')]({},_0x41122a,_0x57c529[_0x63f9('0x5e')]);return _0x8da500[_0x63f9('0xd1')](_0x41122a);}})[_0x63f9('0x25')](function(_0x566a98){if(_0x566a98){_0x44c093=_0x566a98[_0x63f9('0x54')];if(!_0x57c529[_0x63f9('0x4f')][_0x63f9('0xc2')]('nolimit')){_0x41122a['limit']=qs[_0x63f9('0x35')](_0x57c529[_0x63f9('0x4f')]['limit']);_0x41122a[_0x63f9('0x34')]=qs[_0x63f9('0x34')](_0x57c529[_0x63f9('0x4f')][_0x63f9('0x34')]);}return _0x8da500[_0x63f9('0xd1')](_0x41122a);}})[_0x63f9('0x25')](function(_0x593d24){if(_0x593d24){return _0x593d24?{'count':_0x44c093,'rows':_0x593d24}:null;}})[_0x63f9('0x25')](respondWithResult(_0xea7abd,null))['catch'](handleError(_0xea7abd,null));};exports[_0x63f9('0xd2')]=function(_0x3aac79,_0x101940,_0x596b34){var _0x22f9bc={};var _0x8e1c12={};var _0x3ddefd;var _0x3797cc;return db[_0x63f9('0x4a')][_0x63f9('0x96')]({'where':{'id':_0x3aac79[_0x63f9('0x61')]['id']}})[_0x63f9('0x25')](handleEntityNotFound(_0x101940,null))[_0x63f9('0x25')](function(_0x454f51){if(_0x454f51){_0x3ddefd=_0x454f51;_0x8e1c12[_0x63f9('0x4d')]=_['keys'](db['OpenchannelInteraction'][_0x63f9('0x4b')]);_0x8e1c12[_0x63f9('0x4f')]=_[_0x63f9('0x50')](_0x3aac79[_0x63f9('0x4f')]);_0x8e1c12[_0x63f9('0x58')]=_['intersection'](_0x8e1c12[_0x63f9('0x4d')],_0x8e1c12[_0x63f9('0x4f')]);_0x22f9bc[_0x63f9('0x51')]=_['intersection'](_0x8e1c12[_0x63f9('0x4d')],qs[_0x63f9('0x53')](_0x3aac79[_0x63f9('0x4f')][_0x63f9('0x53')]));_0x22f9bc['attributes']=_0x22f9bc[_0x63f9('0x51')][_0x63f9('0x54')]?_0x22f9bc[_0x63f9('0x51')]:_0x8e1c12[_0x63f9('0x4d')];_0x22f9bc[_0x63f9('0x56')]=qs[_0x63f9('0x57')](_0x3aac79[_0x63f9('0x4f')][_0x63f9('0x57')]);_0x22f9bc[_0x63f9('0x5a')]=qs[_0x63f9('0x58')](_[_0x63f9('0xc1')](_0x3aac79[_0x63f9('0x4f')],_0x8e1c12[_0x63f9('0x58')]));if(_0x3aac79[_0x63f9('0x4f')][_0x63f9('0x3f')]){_0x22f9bc[_0x63f9('0x5a')]=_[_0x63f9('0x59')](_0x22f9bc[_0x63f9('0x5a')],{'$or':_[_0x63f9('0x41')](_0x22f9bc[_0x63f9('0x51')],function(_0x1f734c){var _0x2d6892={};_0x2d6892[_0x1f734c]={'$like':'%'+_0x3aac79[_0x63f9('0x4f')][_0x63f9('0x3f')]+'%'};return _0x2d6892;})});}_0x22f9bc=_[_0x63f9('0x59')]({},_0x22f9bc,_0x3aac79[_0x63f9('0x5e')]);return _0x3ddefd[_0x63f9('0xd2')](_0x22f9bc);}})['then'](function(_0x44359e){if(_0x44359e){_0x3797cc=_0x44359e['length'];if(!_0x3aac79[_0x63f9('0x4f')][_0x63f9('0xc2')](_0x63f9('0x55'))){_0x22f9bc[_0x63f9('0x35')]=qs[_0x63f9('0x35')](_0x3aac79[_0x63f9('0x4f')][_0x63f9('0x35')]);_0x22f9bc[_0x63f9('0x34')]=qs[_0x63f9('0x34')](_0x3aac79['query']['offset']);}return _0x3ddefd[_0x63f9('0xd2')](_0x22f9bc);}})[_0x63f9('0x25')](function(_0x224c9f){if(_0x224c9f){return _0x224c9f?{'count':_0x3797cc,'rows':_0x224c9f}:null;}})[_0x63f9('0x25')](respondWithResult(_0x101940,null))[_0x63f9('0x67')](handleError(_0x101940,null));};exports[_0x63f9('0xd3')]=function(_0x34e021,_0x4d25bc,_0x21929f){var _0x5cd523={'raw':!![],'where':{}};var _0x1a1469={};var _0x7a019a={'count':0x0,'rows':[]};return db[_0x63f9('0x4a')][_0x63f9('0x96')]({'where':{'id':_0x34e021[_0x63f9('0x61')]['id']}})[_0x63f9('0x25')](handleEntityNotFound(_0x4d25bc,null))[_0x63f9('0x25')](function(_0x80209f){if(_0x80209f){_0x1a1469[_0x63f9('0x4d')]=_[_0x63f9('0x50')](db[_0x63f9('0xd4')][_0x63f9('0x4b')]);_0x1a1469[_0x63f9('0x4f')]=_[_0x63f9('0x50')](_0x34e021[_0x63f9('0x4f')]);_0x1a1469['filters']=_['intersection'](_0x1a1469['model'],_0x1a1469[_0x63f9('0x4f')]);_0x5cd523[_0x63f9('0x51')]=_[_0x63f9('0x52')](_0x1a1469[_0x63f9('0x4d')],qs[_0x63f9('0x53')](_0x34e021[_0x63f9('0x4f')][_0x63f9('0x53')]));_0x5cd523[_0x63f9('0x51')]=_0x5cd523[_0x63f9('0x51')][_0x63f9('0x54')]?_0x5cd523[_0x63f9('0x51')]:_0x1a1469[_0x63f9('0x4d')];if(!_0x34e021[_0x63f9('0x4f')]['hasOwnProperty']('nolimit')){_0x5cd523[_0x63f9('0x35')]=qs[_0x63f9('0x35')](_0x34e021[_0x63f9('0x4f')]['limit']);_0x5cd523[_0x63f9('0x34')]=qs[_0x63f9('0x34')](_0x34e021[_0x63f9('0x4f')]['offset']);}_0x5cd523[_0x63f9('0x56')]=qs['sort'](_0x34e021[_0x63f9('0x4f')][_0x63f9('0x57')]);_0x5cd523[_0x63f9('0x5a')]=qs[_0x63f9('0x58')](_[_0x63f9('0xc1')](_0x34e021[_0x63f9('0x4f')],_0x1a1469[_0x63f9('0x58')]));_0x5cd523[_0x63f9('0x5a')][_0x63f9('0xcc')]=_0x80209f['id'];if(_0x34e021['query'][_0x63f9('0x3f')]){_0x5cd523[_0x63f9('0x5a')]=_[_0x63f9('0x59')](_0x5cd523[_0x63f9('0x5a')],{'$or':_[_0x63f9('0x41')](_0x5cd523[_0x63f9('0x51')],function(_0x339e98){var _0x1b59f9={};_0x1b59f9[_0x339e98]={'$like':'%'+_0x34e021[_0x63f9('0x4f')][_0x63f9('0x3f')]+'%'};return _0x1b59f9;})});}_0x5cd523=_['merge']({},_0x5cd523,_0x34e021[_0x63f9('0x5e')]);return db['MailInteraction'][_0x63f9('0x33')]({'where':_0x5cd523[_0x63f9('0x5a')]})[_0x63f9('0x25')](function(_0x9a99cd){_0x7a019a[_0x63f9('0x33')]=_0x9a99cd;if(_0x34e021['query'][_0x63f9('0x5f')]){_0x5cd523[_0x63f9('0x63')]=[{'all':!![]}];}return db[_0x63f9('0xd4')][_0x63f9('0xac')](_0x5cd523);})[_0x63f9('0x25')](function(_0x18686c){_0x7a019a['rows']=_0x18686c;return _0x7a019a;});}})[_0x63f9('0x25')](respondWithFilteredResult(_0x4d25bc,_0x5cd523))[_0x63f9('0x67')](handleError(_0x4d25bc,null));};exports['getSmsInteractions']=function(_0x5ed8fa,_0x40b463,_0x396208){var _0x44ad03={};var _0x5d4f39={};var _0x21b012;var _0x5c1f4c;return db['User'][_0x63f9('0x96')]({'where':{'id':_0x5ed8fa[_0x63f9('0x61')]['id']}})['then'](handleEntityNotFound(_0x40b463,null))[_0x63f9('0x25')](function(_0x4b3271){if(_0x4b3271){_0x21b012=_0x4b3271;_0x5d4f39[_0x63f9('0x4d')]=_['keys'](db[_0x63f9('0xd5')][_0x63f9('0x4b')]);_0x5d4f39[_0x63f9('0x4f')]=_[_0x63f9('0x50')](_0x5ed8fa['query']);_0x5d4f39[_0x63f9('0x58')]=_['intersection'](_0x5d4f39[_0x63f9('0x4d')],_0x5d4f39[_0x63f9('0x4f')]);_0x44ad03['attributes']=_[_0x63f9('0x52')](_0x5d4f39[_0x63f9('0x4d')],qs[_0x63f9('0x53')](_0x5ed8fa[_0x63f9('0x4f')]['fields']));_0x44ad03[_0x63f9('0x51')]=_0x44ad03[_0x63f9('0x51')]['length']?_0x44ad03[_0x63f9('0x51')]:_0x5d4f39[_0x63f9('0x4d')];_0x44ad03[_0x63f9('0x56')]=qs[_0x63f9('0x57')](_0x5ed8fa[_0x63f9('0x4f')][_0x63f9('0x57')]);_0x44ad03[_0x63f9('0x5a')]=qs['filters'](_[_0x63f9('0xc1')](_0x5ed8fa[_0x63f9('0x4f')],_0x5d4f39[_0x63f9('0x58')]));if(_0x5ed8fa[_0x63f9('0x4f')][_0x63f9('0x3f')]){_0x44ad03[_0x63f9('0x5a')]=_[_0x63f9('0x59')](_0x44ad03[_0x63f9('0x5a')],{'$or':_[_0x63f9('0x41')](_0x44ad03[_0x63f9('0x51')],function(_0x5613a3){var _0x186179={};_0x186179[_0x5613a3]={'$like':'%'+_0x5ed8fa[_0x63f9('0x4f')]['filter']+'%'};return _0x186179;})});}_0x44ad03=_[_0x63f9('0x59')]({},_0x44ad03,_0x5ed8fa[_0x63f9('0x5e')]);return _0x21b012[_0x63f9('0xd6')](_0x44ad03);}})[_0x63f9('0x25')](function(_0x9a16a0){if(_0x9a16a0){_0x5c1f4c=_0x9a16a0['length'];if(!_0x5ed8fa[_0x63f9('0x4f')][_0x63f9('0xc2')](_0x63f9('0x55'))){_0x44ad03[_0x63f9('0x35')]=qs[_0x63f9('0x35')](_0x5ed8fa[_0x63f9('0x4f')][_0x63f9('0x35')]);_0x44ad03[_0x63f9('0x34')]=qs['offset'](_0x5ed8fa[_0x63f9('0x4f')]['offset']);}return _0x21b012['getSmsInteractions'](_0x44ad03);}})[_0x63f9('0x25')](function(_0x359527){if(_0x359527){return _0x359527?{'count':_0x5c1f4c,'rows':_0x359527}:null;}})[_0x63f9('0x25')](respondWithResult(_0x40b463,null))[_0x63f9('0x67')](handleError(_0x40b463,null));};exports['getFaxInteractions']=function(_0x58977a,_0x1fed30,_0x8a4017){var _0x32d8b5={};var _0x438c6b={};var _0x2b9c64;var _0x4650e0;return db[_0x63f9('0x4a')][_0x63f9('0x96')]({'where':{'id':_0x58977a[_0x63f9('0x61')]['id']}})['then'](handleEntityNotFound(_0x1fed30,null))[_0x63f9('0x25')](function(_0x50f184){if(_0x50f184){_0x2b9c64=_0x50f184;_0x438c6b[_0x63f9('0x4d')]=_[_0x63f9('0x50')](db[_0x63f9('0xd7')]['rawAttributes']);_0x438c6b[_0x63f9('0x4f')]=_[_0x63f9('0x50')](_0x58977a[_0x63f9('0x4f')]);_0x438c6b[_0x63f9('0x58')]=_['intersection'](_0x438c6b[_0x63f9('0x4d')],_0x438c6b[_0x63f9('0x4f')]);_0x32d8b5[_0x63f9('0x51')]=_[_0x63f9('0x52')](_0x438c6b['model'],qs[_0x63f9('0x53')](_0x58977a['query']['fields']));_0x32d8b5[_0x63f9('0x51')]=_0x32d8b5[_0x63f9('0x51')][_0x63f9('0x54')]?_0x32d8b5[_0x63f9('0x51')]:_0x438c6b[_0x63f9('0x4d')];_0x32d8b5['order']=qs[_0x63f9('0x57')](_0x58977a[_0x63f9('0x4f')][_0x63f9('0x57')]);_0x32d8b5['where']=qs['filters'](_['pick'](_0x58977a[_0x63f9('0x4f')],_0x438c6b[_0x63f9('0x58')]));if(_0x58977a[_0x63f9('0x4f')][_0x63f9('0x3f')]){_0x32d8b5['where']=_[_0x63f9('0x59')](_0x32d8b5[_0x63f9('0x5a')],{'$or':_[_0x63f9('0x41')](_0x32d8b5[_0x63f9('0x51')],function(_0x3c33d1){var _0x45533a={};_0x45533a[_0x3c33d1]={'$like':'%'+_0x58977a['query']['filter']+'%'};return _0x45533a;})});}_0x32d8b5=_[_0x63f9('0x59')]({},_0x32d8b5,_0x58977a[_0x63f9('0x5e')]);return _0x2b9c64[_0x63f9('0xd8')](_0x32d8b5);}})[_0x63f9('0x25')](function(_0x16162e){if(_0x16162e){_0x4650e0=_0x16162e[_0x63f9('0x54')];if(!_0x58977a[_0x63f9('0x4f')][_0x63f9('0xc2')](_0x63f9('0x55'))){_0x32d8b5[_0x63f9('0x35')]=qs[_0x63f9('0x35')](_0x58977a[_0x63f9('0x4f')][_0x63f9('0x35')]);_0x32d8b5[_0x63f9('0x34')]=qs[_0x63f9('0x34')](_0x58977a[_0x63f9('0x4f')][_0x63f9('0x34')]);}return _0x2b9c64[_0x63f9('0xd8')](_0x32d8b5);}})['then'](function(_0x36f2b5){if(_0x36f2b5){return _0x36f2b5?{'count':_0x4650e0,'rows':_0x36f2b5}:null;}})[_0x63f9('0x25')](respondWithResult(_0x1fed30,null))[_0x63f9('0x67')](handleError(_0x1fed30,null));};exports[_0x63f9('0xd9')]=function(_0x221035,_0x48abbe,_0x354836){var _0x5ca85c;var _0x5d091e;var _0x24e032;var _0x194770=!_['isNil'](_0x221035[_0x63f9('0x61')]['id'])?_0x221035[_0x63f9('0x61')]['id']:!_[_0x63f9('0x7a')](_0x221035['user']['id'])?_0x221035[_0x63f9('0x3b')]['id']:null;return db['User'][_0x63f9('0x45')]({'where':{'id':_0x194770,'role':{'$or':['admin','user',_0x63f9('0x3d')]}},'attributes':['id',_0x63f9('0x46'),'phone',_0x63f9('0xda'),_0x63f9('0x44'),_0x63f9('0x74'),_0x63f9('0xdb')]})['then'](function(_0x434ed0){if(_0x434ed0){if(_0x434ed0[_0x63f9('0x44')]===_0x63f9('0x3d')){_0x5ca85c=_0x434ed0;if(_0x221035[_0x63f9('0x66')][_0x63f9('0xa0')]){_0x24e032=util['format'](_0x63f9('0xdc'),_0x5ca85c[_0x221035[_0x63f9('0x66')][_0x63f9('0xa0')]]);}else if(_0x221035[_0x63f9('0x66')][_0x63f9('0xdd')]){_0x24e032=util[_0x63f9('0x71')](_0x63f9('0xae'),_0x221035[_0x63f9('0x66')][_0x63f9('0xdd')]);}else{_0x24e032=util[_0x63f9('0x71')](_0x63f9('0xae'),_0x5ca85c[_0x63f9('0x46')]);}socket['to'](util[_0x63f9('0x71')]('user:%s',_0x5ca85c[_0x63f9('0x46')]))[_0x63f9('0xa9')](_0x63f9('0xde'),{'ip':_0x221035['headers']['x-forwarded-for']||_0x221035['connection'][_0x63f9('0xdf')]||_0x221035[_0x63f9('0xe0')][_0x63f9('0xdf')]||_0x221035[_0x63f9('0xe1')][_0x63f9('0xe0')]['remoteAddress']});return db[_0x63f9('0xb4')][_0x63f9('0xb5')]({'where':{'membername':_0x5ca85c[_0x63f9('0x46')]},'individualHooks':!![]});}}else{throw new db[(_0x63f9('0x22'))][(_0x63f9('0x23'))](_0x63f9('0xe2'));}})[_0x63f9('0x25')](function(){if(_0x5ca85c){return _0x5ca85c['getVoiceQueues']({'raw':!![]});}})[_0x63f9('0x25')](function(_0x4ac2db){if(_0x5ca85c){var _0x3109f0=[];if(_0x4ac2db){_0x5d091e=_0x4ac2db;if(_0x5d091e['length']){for(var _0x5ea477=0x0;_0x5ea477<_0x5d091e[_0x63f9('0x54')];_0x5ea477++){_0x3109f0[_0x63f9('0xad')]({'membername':_0x5ca85c['name'],'UserId':_0x5ca85c['id'],'queue_name':_0x5d091e[_0x5ea477][_0x63f9('0x46')],'VoiceQueueId':_0x5d091e[_0x5ea477]['id'],'interface':_0x24e032,'paused':_0x5ca85c[_0x63f9('0xdb')]||![],'penalty':_0x5d091e[_0x5ea477]['UserVoiceQueue.penalty']||0x0});}return BPromise[_0x63f9('0xe3')](_0x3109f0,function(_0x1dff80){return db[_0x63f9('0xb4')][_0x63f9('0xaf')](_0x1dff80);});}}}})[_0x63f9('0x25')](function(){if(_0x5ca85c){return db['MemberReport'][_0x63f9('0xac')]({'where':{'membername':_0x5ca85c[_0x63f9('0x46')],'exitAt':null}});}})['then'](function(_0x59170c){if(_0x5ca85c){var _0x4ed5cd=[];_0x59170c[_0x63f9('0xe4')](function(_0x29bcda){_0x4ed5cd['push'](_0x29bcda[_0x63f9('0x65')]({'exitAt':moment()[_0x63f9('0x71')](_0x63f9('0xe5'))}));});return BPromise[_0x63f9('0xe6')](_0x4ed5cd);}})[_0x63f9('0x25')](function(){if(_0x5ca85c){var _0x4fd077=[];var _0x7e3091=[];var _0x36393a=utils['getChannels']();var _0x4157f2={'membername':_0x5ca85c[_0x63f9('0x46')],'interface':_0x24e032,'enterAt':moment()[_0x63f9('0x71')](_0x63f9('0xe5')),'role':_0x5ca85c[_0x63f9('0x44')],'internal':_0x5ca85c['internal']};_0x36393a[_0x63f9('0xe4')](function(_0x5d4763){_0x4fd077[_0x63f9('0xad')](_[_0x63f9('0x59')]({'channel':_0x5d4763,'type':_0x63f9('0xe7'),'data1':_0x221035[_0x63f9('0x66')][_0x63f9('0xe8')],'data2':_0x24e032},_0x4157f2));if(_0x5ca85c[_0x63f9('0xdb')]){_0x7e3091[_0x63f9('0xad')](_[_0x63f9('0x59')]({'channel':_0x5d4763,'type':_0x63f9('0xe9'),'data1':_0x63f9('0xea')},_0x4157f2));}});return db[_0x63f9('0xeb')]['bulkCreate'](_0x4fd077[_0x63f9('0xec')](_0x7e3091),{'individualHooks':!![]});}})[_0x63f9('0x25')](function(){if(_0x5ca85c){return _0x5ca85c['update']({'online':!![],'lastLoginAt':moment()[_0x63f9('0x71')]('YYYY-MM-DD\x20HH:mm:ss'),'voicePause':_0x5ca85c[_0x63f9('0xdb')]||![],'mailPause':_0x5ca85c[_0x63f9('0xdb')]||![],'chatPause':_0x5ca85c[_0x63f9('0xdb')]||![],'faxPause':_0x5ca85c[_0x63f9('0xdb')]||![],'smsPause':_0x5ca85c['loginInPause']||![],'openchannelPause':_0x5ca85c[_0x63f9('0xdb')]||![],'pauseType':_0x5ca85c[_0x63f9('0xdb')]?_0x63f9('0xea'):null,'interface':_0x24e032,'lastPauseAt':moment()['format']('YYYY-MM-DD\x20HH:mm:ss')});}})[_0x63f9('0x25')](function(_0x86da30){if(_0x221035['isMiddleware']){return _0x354836();}else{return BPromise[_0x63f9('0xed')](_0x86da30)['then'](respondWithResult(_0x48abbe,null));}})[_0x63f9('0x67')](handleError(_0x48abbe,null));};exports[_0x63f9('0xee')]=function(_0x56554c,_0x54470c,_0x4ce21b){var _0x491531;return db[_0x63f9('0x4a')][_0x63f9('0x45')]({'where':{'id':_0x56554c[_0x63f9('0x61')]['id'],'role':_0x63f9('0x3d')},'attributes':['id',_0x63f9('0x46'),_0x63f9('0x44')]})['then'](handleEntityNotFound(_0x54470c,null))[_0x63f9('0x25')](function(_0x584e9b){if(_0x584e9b){_0x491531=_0x584e9b;return db[_0x63f9('0xb4')][_0x63f9('0xb5')]({'where':{'membername':_0x491531[_0x63f9('0x46')]},'individualHooks':!![]});}})[_0x63f9('0x25')](function(){return db[_0x63f9('0xeb')][_0x63f9('0xac')]({'where':{'membername':_0x491531[_0x63f9('0x46')],'exitAt':null}});})[_0x63f9('0x25')](function(_0x3ad107){var _0x20b1b8=[];_0x3ad107[_0x63f9('0xe4')](function(_0x243df5){_0x20b1b8[_0x63f9('0xad')](_0x243df5[_0x63f9('0x65')]({'exitAt':moment()[_0x63f9('0x71')]('YYYY-MM-DD\x20HH:mm:ss')}));});return BPromise[_0x63f9('0xe6')](_0x20b1b8);})[_0x63f9('0x25')](function(){return _0x491531[_0x63f9('0x65')]({'online':![],'lastLoginAt':null,'voicePause':![],'mailPause':![],'chatPause':![],'faxPause':![],'smsPause':![],'openchannelPause':![],'interface':null});})[_0x63f9('0x25')](respondWithResult(_0x54470c,null))['catch'](handleError(_0x54470c,null));};exports['pause']=function(_0x2aa376,_0x231223,_0x174d04){var _0x434ed7;return db[_0x63f9('0xb4')][_0x63f9('0x65')]({'paused':0x1},{'where':{'UserId':_0x2aa376['params']['id']},'individualHooks':!![]})[_0x63f9('0x25')](function(){return db[_0x63f9('0x4a')][_0x63f9('0x45')]({'where':{'id':_0x2aa376[_0x63f9('0x61')]['id'],'role':_0x63f9('0x3d')},'attributes':['id','name',_0x63f9('0x44'),_0x63f9('0x74'),_0x63f9('0xa0')]});})[_0x63f9('0x25')](handleEntityNotFound(_0x231223,null))[_0x63f9('0x25')](function(_0x135099){if(_0x135099){_0x434ed7=_0x135099;return respondWithRpcPromise('QueuePause',_0x63f9('0xef'),{'id':_0x434ed7['id'],'name':_0x434ed7[_0x63f9('0x46')],'pause':!![]});}})[_0x63f9('0x25')](function(){if(_0x434ed7){return db['MemberReport']['findAll']({'where':{'membername':_0x434ed7[_0x63f9('0x46')],'type':'PAUSE','exitAt':null}});}})[_0x63f9('0x25')](function(_0xb6243e){if(_0xb6243e[_0x63f9('0x54')]){var _0x3f003a=moment()[_0x63f9('0x71')](_0x63f9('0xe5'));for(var _0x5c8b78=0x0,_0x5d8f4f=_0xb6243e[_0x63f9('0x54')];_0x5c8b78<_0x5d8f4f;_0x5c8b78++){_0xb6243e[_0x5c8b78][_0x63f9('0xf0')]({'exitAt':_0x3f003a});}}})[_0x63f9('0x25')](function(){var _0x4f794c=[];var _0x25859b=utils[_0x63f9('0xf1')]();_0x25859b[_0x63f9('0xe4')](function(_0x4d1285){_0x4f794c[_0x63f9('0xad')]({'channel':_0x4d1285,'membername':_0x434ed7[_0x63f9('0x46')],'interface':_['isNil'](_0x434ed7['interface'])?util[_0x63f9('0x71')]('SIP/%s',_0x434ed7[_0x63f9('0x46')]):_0x434ed7[_0x63f9('0xa0')],'type':_0x63f9('0xe9'),'enterAt':moment()[_0x63f9('0x71')](_0x63f9('0xe5')),'data1':_0x2aa376['body'][_0x63f9('0x4c')]||_0x63f9('0xf2'),'role':_0x434ed7[_0x63f9('0x44')],'internal':_0x434ed7[_0x63f9('0x74')]});});return db[_0x63f9('0xeb')][_0x63f9('0x64')](_0x4f794c,{'individualHooks':!![]});})['then'](function(){return _0x434ed7[_0x63f9('0x65')]({'voicePause':!![],'mailPause':!![],'chatPause':!![],'faxPause':!![],'smsPause':!![],'openchannelPause':!![],'pauseType':_0x2aa376['body'][_0x63f9('0x4c')]||_0x63f9('0xf2'),'lastPauseAt':moment()['format'](_0x63f9('0xe5'))});})[_0x63f9('0x25')](respondWithResult(_0x231223,null))[_0x63f9('0x67')](handleError(_0x231223,null));};exports['unpause']=function(_0x9a8667,_0x3fd6b0,_0x3e8128){var _0xcbfde1;return db[_0x63f9('0x4a')]['find']({'where':{'id':_0x9a8667[_0x63f9('0x61')]['id']},'attributes':['id',_0x63f9('0x46'),'role','voicePause',_0x63f9('0xf3'),_0x63f9('0xf4'),_0x63f9('0xf5'),_0x63f9('0xf6'),_0x63f9('0xf7'),'pauseType','lastPauseAt']})[_0x63f9('0x25')](handleEntityNotFound(_0x3fd6b0,null))['then'](function(_0x50fc8c){if(_0x50fc8c){_0xcbfde1=_0x50fc8c;if(_0x9a8667[_0x63f9('0x66')][_0x63f9('0xb1')]&&!utils[_0x63f9('0xa1')](_0x9a8667[_0x63f9('0x66')][_0x63f9('0xb1')])){throw new db[(_0x63f9('0x22'))]['ValidationError'](_0x63f9('0xa2'));}switch(_0x9a8667[_0x63f9('0x66')]['channel']){case _0x63f9('0xaa'):return respondWithRpcPromise(_0x63f9('0xf8'),'unpause',{'id':_0xcbfde1['id'],'name':_0xcbfde1[_0x63f9('0x46')],'pause':![]})['then'](function(){return db[_0x63f9('0xb4')]['update']({'paused':0x0},{'where':{'UserId':_0xcbfde1['id']},'individualHooks':!![]});})[_0x63f9('0x25')](function(){return db[_0x63f9('0xeb')]['find']({'where':{'channel':_0x9a8667[_0x63f9('0x66')][_0x63f9('0xb1')],'membername':_0xcbfde1['name'],'type':_0x63f9('0xe9'),'exitAt':null}});})['then'](function(_0x34ce01){if(_0x34ce01){return _0x34ce01['update']({'exitAt':moment()[_0x63f9('0x71')](_0x63f9('0xe5')),'data2':_0x63f9('0xf9')},{'individualHooks':!![]});}return null;})[_0x63f9('0x25')](function(){return _0xcbfde1[_0x63f9('0x65')]({'voicePause':![]});});case _0x63f9('0xfa'):case _0x63f9('0xfb'):case'fax':case _0x63f9('0xfc'):case _0x63f9('0xfd'):return db['MemberReport'][_0x63f9('0x45')]({'where':{'channel':_0x9a8667[_0x63f9('0x66')][_0x63f9('0xb1')],'membername':_0xcbfde1[_0x63f9('0x46')],'type':_0x63f9('0xe9'),'exitAt':null}})[_0x63f9('0x25')](function(_0x9186b7){if(_0x9186b7){return _0x9186b7[_0x63f9('0x65')]({'exitAt':moment()[_0x63f9('0x71')](_0x63f9('0xe5')),'data2':_0x63f9('0xf9')},{'individualHooks':!![]});}return null;})['then'](function(){var _0x1a9eab={};_['set'](_0x1a9eab,util['format'](_0x63f9('0xfe'),_0x9a8667[_0x63f9('0x66')][_0x63f9('0xb1')],_0x63f9('0xff')),![]);return _0xcbfde1[_0x63f9('0x65')](_0x1a9eab);});default:return respondWithRpcPromise('QueuePause','unpause',{'id':_0xcbfde1['id'],'name':_0xcbfde1[_0x63f9('0x46')],'pause':![]})[_0x63f9('0x25')](function(){return db['UserVoiceQueueRt']['update']({'paused':0x0},{'where':{'UserId':_0xcbfde1['id']}});})['then'](function(){return db[_0x63f9('0xeb')]['findAll']({'where':{'membername':_0xcbfde1[_0x63f9('0x46')],'type':_0x63f9('0xe9'),'exitAt':null}});})[_0x63f9('0x25')](function(_0x4b8ee3){var _0x17832c=[];_0x4b8ee3[_0x63f9('0xe4')](function(_0x29995b){_0x17832c[_0x63f9('0xad')](_0x29995b[_0x63f9('0x65')]({'exitAt':moment()[_0x63f9('0x71')]('YYYY-MM-DD\x20HH:mm:ss'),'data2':_0x63f9('0xf9')}));});return BPromise[_0x63f9('0xe6')](_0x17832c);})[_0x63f9('0x25')](function(){return _0xcbfde1[_0x63f9('0x65')]({'voicePause':![],'mailPause':![],'chatPause':![],'faxPause':![],'smsPause':![],'openchannelPause':![]});});}}})[_0x63f9('0x25')](respondWithResult(_0x3fd6b0,null))[_0x63f9('0x67')](handleError(_0x3fd6b0,null));};exports[_0x63f9('0x100')]=function(_0x1b6248,_0xefa417,_0x378a83){var _0x289a0b={};var _0x19ccbf={};var _0x496dea;var _0x4e153f;return db[_0x63f9('0x4a')][_0x63f9('0x96')]({'where':{'id':_0x1b6248[_0x63f9('0x61')]['id']}})[_0x63f9('0x25')](handleEntityNotFound(_0xefa417,null))[_0x63f9('0x25')](function(_0x30331c){if(_0x30331c){_0x496dea=_0x30331c;_0x19ccbf[_0x63f9('0x4d')]=_['keys'](db[_0x63f9('0x101')]['rawAttributes']);_0x19ccbf[_0x63f9('0x4f')]=_[_0x63f9('0x50')](_0x1b6248[_0x63f9('0x4f')]);_0x19ccbf[_0x63f9('0x58')]=_[_0x63f9('0x52')](_0x19ccbf[_0x63f9('0x4d')],_0x19ccbf['query']);_0x289a0b[_0x63f9('0x51')]=_[_0x63f9('0x52')](_0x19ccbf[_0x63f9('0x4d')],qs[_0x63f9('0x53')](_0x1b6248[_0x63f9('0x4f')][_0x63f9('0x53')]));_0x289a0b['attributes']=_0x289a0b[_0x63f9('0x51')][_0x63f9('0x54')]?_0x289a0b[_0x63f9('0x51')]:_0x19ccbf[_0x63f9('0x4d')];_0x289a0b[_0x63f9('0x56')]=qs[_0x63f9('0x57')](_0x1b6248[_0x63f9('0x4f')][_0x63f9('0x57')]);_0x289a0b[_0x63f9('0x5a')]=qs[_0x63f9('0x58')](_['pick'](_0x1b6248[_0x63f9('0x4f')],_0x19ccbf[_0x63f9('0x58')]));if(_0x1b6248[_0x63f9('0x4f')][_0x63f9('0x3f')]){_0x289a0b['where']=_[_0x63f9('0x59')](_0x289a0b[_0x63f9('0x5a')],{'$or':_[_0x63f9('0x41')](_0x289a0b['attributes'],function(_0x36fb6b){var _0x4ff864={};_0x4ff864[_0x36fb6b]={'$like':'%'+_0x1b6248['query'][_0x63f9('0x3f')]+'%'};return _0x4ff864;})});}_0x289a0b=_[_0x63f9('0x59')]({},_0x289a0b,_0x1b6248[_0x63f9('0x5e')]);return _0x496dea[_0x63f9('0x100')](_0x289a0b);}})['then'](function(_0x5cb0d5){if(_0x5cb0d5){_0x4e153f=_0x5cb0d5[_0x63f9('0x54')];if(!_0x1b6248[_0x63f9('0x4f')][_0x63f9('0xc2')](_0x63f9('0x55'))){_0x289a0b[_0x63f9('0x35')]=qs[_0x63f9('0x35')](_0x1b6248[_0x63f9('0x4f')][_0x63f9('0x35')]);_0x289a0b[_0x63f9('0x34')]=qs[_0x63f9('0x34')](_0x1b6248['query']['offset']);}return _0x496dea[_0x63f9('0x100')](_0x289a0b);}})['then'](function(_0x1cdaf9){if(_0x1cdaf9){return _0x1cdaf9?{'count':_0x4e153f,'rows':_0x1cdaf9}:null;}})[_0x63f9('0x25')](respondWithResult(_0xefa417,null))['catch'](handleError(_0xefa417,null));};exports[_0x63f9('0x102')]=function(_0xef99e2,_0x1ab7fb){return db[_0x63f9('0x4a')][_0x63f9('0x45')]({'where':{'id':_0xef99e2[_0x63f9('0x61')]['id']}})[_0x63f9('0x25')](handleEntityNotFound(_0x1ab7fb,null))[_0x63f9('0x25')](function(_0x11a71e){if(_0x11a71e){var _0x4b4fb5=_0x11a71e[_0x63f9('0x3a')]({'plain':!![]});return _0x11a71e[_0x63f9('0x102')](_0xef99e2[_0x63f9('0x66')][_0x63f9('0x6a')],_[_0x63f9('0x103')](_0xef99e2['body'],[_0x63f9('0x6a'),'id'])||{})['then'](function(){for(var _0x22b387=0x0;_0x22b387<_0xef99e2[_0x63f9('0x66')][_0x63f9('0x6a')][_0x63f9('0x54')];_0x22b387++){var _0x311201=[];db[_0x63f9('0x101')]['findOne']({'where':{'id':_0xef99e2[_0x63f9('0x66')][_0x63f9('0x6a')][_0x22b387]}})[_0x63f9('0x25')](function(_0x506035){_0x311201[_0x63f9('0xad')](_0x506035[_0x63f9('0x104')]()[_0x63f9('0x25')](function(_0x3b871f){for(var _0x412f95=0x0;_0x412f95<_0x3b871f[_0x63f9('0x54')];_0x412f95++){_0x3b871f[_0x412f95][_0x63f9('0x105')](_0x63f9('0xb1'),_0x63f9('0x106'));}return _0x3b871f;}));_0x311201[_0x63f9('0xad')](_0x506035[_0x63f9('0x107')]()['then'](function(_0x25f6c2){for(var _0x110cd3=0x0;_0x110cd3<_0x25f6c2[_0x63f9('0x54')];_0x110cd3++){_0x25f6c2[_0x110cd3][_0x63f9('0x105')](_0x63f9('0xb1'),_0x63f9('0x108'));}return _0x25f6c2;}));_0x311201[_0x63f9('0xad')](_0x506035['getMailQueues']()[_0x63f9('0x25')](function(_0x1c171f){for(var _0x4ce690=0x0;_0x4ce690<_0x1c171f[_0x63f9('0x54')];_0x4ce690++){_0x1c171f[_0x4ce690][_0x63f9('0x105')](_0x63f9('0xb1'),_0x63f9('0x109'));}return _0x1c171f;}));_0x311201[_0x63f9('0xad')](_0x506035[_0x63f9('0x10a')]()[_0x63f9('0x25')](function(_0xec66d7){for(var _0x4867a4=0x0;_0x4867a4<_0xec66d7[_0x63f9('0x54')];_0x4867a4++){_0xec66d7[_0x4867a4][_0x63f9('0x105')](_0x63f9('0xb1'),_0x63f9('0x10b'));}return _0xec66d7;}));_0x311201[_0x63f9('0xad')](_0x506035['getFaxQueues']()[_0x63f9('0x25')](function(_0x3d85cc){for(var _0x217b25=0x0;_0x217b25<_0x3d85cc['length'];_0x217b25++){_0x3d85cc[_0x217b25][_0x63f9('0x105')]('channel','Fax');}return _0x3d85cc;}));_0x311201['push'](_0x506035[_0x63f9('0x10c')]()[_0x63f9('0x25')](function(_0x4e841d){for(var _0x13279b=0x0;_0x13279b<_0x4e841d[_0x63f9('0x54')];_0x13279b++){_0x4e841d[_0x13279b][_0x63f9('0x105')]('channel',_0x63f9('0x10d'));}return _0x4e841d;}));return BPromise[_0x63f9('0xe6')](_0x311201);})[_0x63f9('0x25')](function(_0x3acbb8){var _0x4fc7be=_['flatten'](_0x3acbb8);_0x311201=[];return db['sequelize'][_0x63f9('0x10e')](function(_0x4510ca){for(var _0x23d62d=0x0;_0x23d62d<_0x4fc7be[_0x63f9('0x54')];_0x23d62d++){_0x311201[_0x63f9('0xad')](_0x4fc7be[_0x23d62d][_0x63f9('0x10f')](_0x4b4fb5['id']),{'transaction':_0x4510ca});}return BPromise[_0x63f9('0xe6')](_0x311201)[_0x63f9('0x25')](function(){if(_0x4b4fb5['online']){return BPromise[_0x63f9('0xe3')](_[_0x63f9('0x3f')](_0x4fc7be,function(_0x3cfc0a){return _0x3cfc0a['getDataValue'](_0x63f9('0xb1'))===_0x63f9('0x106');}),function(_0x473cfe){return db[_0x63f9('0xb4')]['upsert']({'membername':_0x4b4fb5[_0x63f9('0x46')],'UserId':_0x4b4fb5['id'],'queue_name':_0x473cfe[_0x63f9('0x46')],'VoiceQueueId':_0x473cfe['id'],'interface':_[_0x63f9('0x7a')](_0x4b4fb5['interface'])?util[_0x63f9('0x71')](_0x63f9('0xae'),_0x4b4fb5[_0x63f9('0x46')]):_0x4b4fb5[_0x63f9('0xa0')],'paused':_0x4b4fb5[_0x63f9('0x9f')]||![],'penalty':_0x4b4fb5[_0x63f9('0xa6')]},{'transaction':_0x4510ca});});}else{return;}})[_0x63f9('0x25')](function(){for(var _0x5ab764=0x0;_0x5ab764<_0x4fc7be[_0x63f9('0x54')];_0x5ab764++){var _0x18847b=_0x4fc7be[_0x5ab764]['getDataValue']('channel');var _0x3fb443=_0x18847b+_0x63f9('0xa8');socket[_0x63f9('0xa9')](_0x63f9('0x3b')+_0x18847b+_0x63f9('0x110'),{'UserId':_0x4b4fb5['id'],['queueField']:_0x4fc7be[_0x5ab764]['id']});}});});});}});}})[_0x63f9('0x25')](respondWithStatusCode(_0x1ab7fb,null))[_0x63f9('0x67')](handleError(_0x1ab7fb,null));};exports['removeTeams']=function(_0x5a3c18,_0x35942e){return db[_0x63f9('0x4a')][_0x63f9('0x96')]({'where':{'id':_0x5a3c18[_0x63f9('0x61')]['id']}})[_0x63f9('0x25')](handleEntityNotFound(_0x35942e,null))[_0x63f9('0x25')](function(_0x11b24){if(_0x11b24){var _0x225a9e=_0x11b24['get']({'plain':!![]});var _0x116062=_0x5a3c18['query'][_0x63f9('0x6a')];return _0x11b24[_0x63f9('0x111')](_0x116062)[_0x63f9('0x25')](function(){for(var _0x21b2f9=0x0;_0x21b2f9<_0x116062['length'];_0x21b2f9++){var _0x24dcec=[];db['Team'][_0x63f9('0x96')]({'where':{'id':_0x116062[_0x21b2f9]}})[_0x63f9('0x25')](function(_0x2a4079){_0x24dcec[_0x63f9('0xad')](_0x2a4079['getVoiceQueues']()['then'](function(_0x740f25){for(var _0x3e3544=0x0;_0x3e3544<_0x740f25[_0x63f9('0x54')];_0x3e3544++){_0x740f25[_0x3e3544][_0x63f9('0x105')](_0x63f9('0xb1'),_0x63f9('0x106'));}return _0x740f25;}));_0x24dcec[_0x63f9('0xad')](_0x2a4079[_0x63f9('0x107')]()[_0x63f9('0x25')](function(_0x34f739){for(var _0x66c89=0x0;_0x66c89<_0x34f739[_0x63f9('0x54')];_0x66c89++){_0x34f739[_0x66c89][_0x63f9('0x105')]('channel',_0x63f9('0x108'));}return _0x34f739;}));_0x24dcec[_0x63f9('0xad')](_0x2a4079[_0x63f9('0x112')]()[_0x63f9('0x25')](function(_0x277142){for(var _0x3a4799=0x0;_0x3a4799<_0x277142['length'];_0x3a4799++){_0x277142[_0x3a4799][_0x63f9('0x105')](_0x63f9('0xb1'),_0x63f9('0x109'));}return _0x277142;}));_0x24dcec[_0x63f9('0xad')](_0x2a4079[_0x63f9('0x10a')]()[_0x63f9('0x25')](function(_0x41be4e){for(var _0x261227=0x0;_0x261227<_0x41be4e[_0x63f9('0x54')];_0x261227++){_0x41be4e[_0x261227][_0x63f9('0x105')](_0x63f9('0xb1'),_0x63f9('0x10b'));}return _0x41be4e;}));_0x24dcec[_0x63f9('0xad')](_0x2a4079[_0x63f9('0x113')]()[_0x63f9('0x25')](function(_0x26aedb){for(var _0x4e1d52=0x0;_0x4e1d52<_0x26aedb[_0x63f9('0x54')];_0x4e1d52++){_0x26aedb[_0x4e1d52][_0x63f9('0x105')](_0x63f9('0xb1'),_0x63f9('0x114'));}return _0x26aedb;}));_0x24dcec[_0x63f9('0xad')](_0x2a4079[_0x63f9('0x10c')]()[_0x63f9('0x25')](function(_0x4489cc){for(var _0x2f7df6=0x0;_0x2f7df6<_0x4489cc[_0x63f9('0x54')];_0x2f7df6++){_0x4489cc[_0x2f7df6][_0x63f9('0x105')](_0x63f9('0xb1'),_0x63f9('0x10d'));}return _0x4489cc;}));return BPromise[_0x63f9('0xe6')](_0x24dcec);})[_0x63f9('0x25')](function(_0x48a651){var _0x4b4567=_[_0x63f9('0x115')](_0x48a651);_0x24dcec=[];return db[_0x63f9('0x5c')][_0x63f9('0x10e')](function(_0x1e2a2e){for(var _0x19fd00=0x0;_0x19fd00<_0x4b4567[_0x63f9('0x54')];_0x19fd00++){_0x24dcec[_0x63f9('0xad')](_0x4b4567[_0x19fd00][_0x63f9('0x116')](_0x225a9e['id']),{'transaction':_0x1e2a2e});}return BPromise[_0x63f9('0xe6')](_0x24dcec)[_0x63f9('0x25')](function(){if(_0x225a9e['online']){return BPromise[_0x63f9('0xe3')](_['filter'](_0x4b4567,function(_0x4ea0e5){return _0x4ea0e5[_0x63f9('0x117')](_0x63f9('0xb1'))===_0x63f9('0x106');}),function(_0x5423c3){return db[_0x63f9('0xb4')][_0x63f9('0xb5')]({'where':{'VoiceQueueId':_0x5423c3['id'],'UserId':_0x225a9e['id']},'transaction':_0x1e2a2e});});}else{return;}})['then'](function(){for(var _0x5b36eb=0x0;_0x5b36eb<_0x4b4567[_0x63f9('0x54')];_0x5b36eb++){var _0xee167d=_0x4b4567[_0x5b36eb][_0x63f9('0x117')]('channel');var _0x2e6b5b=_0xee167d+_0x63f9('0xa8');socket['emit'](_0x63f9('0x3b')+_0xee167d+'Queue:remove',{'UserId':_0x225a9e['id'],['queueField']:_0x4b4567[_0x5b36eb]['id']});}});});});}});}})['then'](respondWithStatusCode(_0x35942e,null))[_0x63f9('0x67')](handleError(_0x35942e,null));};exports[_0x63f9('0x118')]=function(_0x4cc254,_0x3a43df,_0x48f299){var _0x4eda19={};var _0x474b20={};var _0x1be624;var _0x58baf0;return db[_0x63f9('0x4a')][_0x63f9('0x96')]({'where':{'id':_0x4cc254['params']['id']}})[_0x63f9('0x25')](handleEntityNotFound(_0x3a43df,null))[_0x63f9('0x25')](function(_0x2d8c5a){if(_0x2d8c5a){_0x1be624=_0x2d8c5a;_0x474b20[_0x63f9('0x4d')]=_[_0x63f9('0x50')](db[_0x63f9('0xc3')][_0x63f9('0x4b')]);_0x474b20[_0x63f9('0x4f')]=_[_0x63f9('0x50')](_0x4cc254[_0x63f9('0x4f')]);_0x474b20['filters']=_[_0x63f9('0x52')](_0x474b20['model'],_0x474b20[_0x63f9('0x4f')]);_0x4eda19['attributes']=_['intersection'](_0x474b20[_0x63f9('0x4d')],qs['fields'](_0x4cc254[_0x63f9('0x4f')][_0x63f9('0x53')]));_0x4eda19[_0x63f9('0x51')]=_0x4eda19[_0x63f9('0x51')][_0x63f9('0x54')]?_0x4eda19['attributes']:_0x474b20[_0x63f9('0x4d')];_0x4eda19[_0x63f9('0x56')]=qs[_0x63f9('0x57')](_0x4cc254['query'][_0x63f9('0x57')]);_0x4eda19[_0x63f9('0x5a')]=qs['filters'](_[_0x63f9('0xc1')](_0x4cc254[_0x63f9('0x4f')],_0x474b20[_0x63f9('0x58')]));if(_0x4cc254[_0x63f9('0x4f')][_0x63f9('0x3f')]){_0x4eda19['where']=_['merge'](_0x4eda19[_0x63f9('0x5a')],{'$or':_['map'](_0x4eda19[_0x63f9('0x51')],function(_0x51c229){var _0x3f7862={};_0x3f7862[_0x51c229]={'$like':'%'+_0x4cc254['query'][_0x63f9('0x3f')]+'%'};return _0x3f7862;})});}_0x4eda19=_[_0x63f9('0x59')]({},_0x4eda19,_0x4cc254['options']);return _0x1be624[_0x63f9('0x118')](_0x4eda19);}})[_0x63f9('0x25')](function(_0x59cfa3){if(_0x59cfa3){_0x58baf0=_0x59cfa3[_0x63f9('0x54')];if(!_0x4cc254[_0x63f9('0x4f')][_0x63f9('0xc2')]('nolimit')){_0x4eda19['limit']=qs['limit'](_0x4cc254['query'][_0x63f9('0x35')]);_0x4eda19[_0x63f9('0x34')]=qs['offset'](_0x4cc254[_0x63f9('0x4f')][_0x63f9('0x34')]);}return _0x1be624['getLists'](_0x4eda19);}})[_0x63f9('0x25')](function(_0x41cb82){if(_0x41cb82){return _0x41cb82?{'count':_0x58baf0,'rows':_0x41cb82}:null;}})[_0x63f9('0x25')](respondWithResult(_0x3a43df,null))['catch'](handleError(_0x3a43df,null));};exports['getAgents']=function(_0x177c56,_0x44873e,_0x1b0954){var _0x50298c={};var _0x204b2b={};var _0x29f699;var _0x52048b;return db[_0x63f9('0x4a')]['findOne']({'where':{'id':_0x177c56[_0x63f9('0x61')]['id']}})['then'](handleEntityNotFound(_0x44873e,null))[_0x63f9('0x25')](function(_0x20c9eb){if(_0x20c9eb){_0x29f699=_0x20c9eb;_0x204b2b[_0x63f9('0x4d')]=_['keys'](db[_0x63f9('0x4a')]['rawAttributes']);_0x204b2b[_0x63f9('0x4f')]=_[_0x63f9('0x50')](_0x177c56['query']);_0x204b2b[_0x63f9('0x58')]=_['intersection'](_0x204b2b[_0x63f9('0x4d')],_0x204b2b[_0x63f9('0x4f')]);_0x50298c['attributes']=_[_0x63f9('0x52')](_0x204b2b[_0x63f9('0x4d')],qs[_0x63f9('0x53')](_0x177c56[_0x63f9('0x4f')][_0x63f9('0x53')]));_0x50298c['attributes']=_0x50298c[_0x63f9('0x51')]['length']?_0x50298c[_0x63f9('0x51')]:_0x204b2b[_0x63f9('0x4d')];_0x50298c[_0x63f9('0x56')]=qs[_0x63f9('0x57')](_0x177c56['query'][_0x63f9('0x57')]);_0x50298c['where']=qs[_0x63f9('0x58')](_[_0x63f9('0xc1')](_0x177c56[_0x63f9('0x4f')],_0x204b2b[_0x63f9('0x58')]));if(_0x177c56[_0x63f9('0x4f')][_0x63f9('0x3f')]){_0x50298c[_0x63f9('0x5a')]=_[_0x63f9('0x59')](_0x50298c[_0x63f9('0x5a')],{'$or':_[_0x63f9('0x41')](_0x50298c['attributes'],function(_0x5b344b){var _0x5ee25={};_0x5ee25[_0x5b344b]={'$like':'%'+_0x177c56['query']['filter']+'%'};return _0x5ee25;})});}_0x50298c[_0x63f9('0x4d')]=db['User'];_0x50298c['as']='Agents';_0x50298c=_[_0x63f9('0x59')]({},_0x50298c,_0x177c56[_0x63f9('0x5e')]);return _0x29f699[_0x63f9('0x104')]({'include':[_0x50298c]});}})[_0x63f9('0x25')](function(_0x447b8b){if(_0x447b8b){var _0x19dcec={},_0x317218=[],_0x21a16d=0x0;for(var _0x34c21b=0x0;_0x34c21b<_0x447b8b['length'];_0x34c21b+=0x1){for(var _0x426f0c=0x0,_0xd61721;_0x426f0c<_0x447b8b[_0x34c21b][_0x63f9('0x3c')][_0x63f9('0x54')];_0x426f0c+=0x1){_0xd61721=_0x447b8b[_0x34c21b][_0x63f9('0x3c')][_0x426f0c]['get']({'plain':!![]});_0x19dcec[_0xd61721['id']]=_0xd61721;}}_0x19dcec=_[_0x63f9('0x119')](_0x19dcec);for(var _0x3857be=qs[_0x63f9('0x34')](_0x177c56['query'][_0x63f9('0x34')]);_0x3857be<_0x19dcec[_0x63f9('0x54')]&&_0x317218['length']=_0x36002c){_0x19aee2=_0x36002c;_0xd782cd=0xc8;}else{_0xd782cd=0xce;}_0x44f489[_0x1f0f('0x2b')](_0xd782cd);return _0x44f489[_0x1f0f('0x30')](_0x1f0f('0x31'),_0xf6cb9d+'-'+_0x19aee2+'/'+_0x36002c)['json'](_0x50c0c3);}return null;};}function patchUpdates(_0x17bb6c){return function(_0x29788e){try{jsonpatch[_0x1f0f('0x32')](_0x29788e,_0x17bb6c,!![]);}catch(_0xb515a5){return BPromise[_0x1f0f('0x33')](_0xb515a5);}return _0x29788e['save']();};}function saveUpdates(_0x40a645,_0x5d2285){return function(_0x2c5319){if(_0x2c5319){return _0x2c5319[_0x1f0f('0x34')](_0x40a645)['then'](function(_0x500121){return _0x500121;});}return null;};}function removeEntity(_0x4d6975,_0x5941b5){return function(_0x463432){if(_0x463432){return _0x463432[_0x1f0f('0x35')]()[_0x1f0f('0x20')](function(){var _0x5cbe80=_0x463432['get']({'plain':!![]});var _0x1d9867=[{'name':_0x1f0f('0x36'),'value':_0x1f0f('0x37'),'ignore':!![]},{'name':_0x1f0f('0x38'),'value':'agent','ignore':![]},{'name':_0x1f0f('0x39'),'value':_0x1f0f('0x3a'),'ignore':![]}];var _0xa91d4d=_(_0x1d9867)[_0x1f0f('0x3b')](_0x1f0f('0x3c'))[_0x1f0f('0x3d')](_0x1f0f('0x3e'))[_0x1f0f('0x3e')]();if(_[_0x1f0f('0x3f')](_0xa91d4d,_0x5cbe80[_0x1f0f('0x40')])){return;}var _0x5f31a9=_[_0x1f0f('0x41')](_0x1d9867,[_0x1f0f('0x3e'),_0x5cbe80['role']])[_0x1f0f('0x42')];return db[_0x1f0f('0x43')]['destroy']({'where':{'type':_0x5f31a9,'resourceId':_0x5cbe80['id']}})['then'](function(){return _0x463432;});})[_0x1f0f('0x20')](function(){_0x4d6975[_0x1f0f('0x2b')](0xcc)['end']();});}};}function handleEntityNotFound(_0x330386,_0x14f7a1){return function(_0x3d0fe8){if(!_0x3d0fe8){_0x330386[_0x1f0f('0x44')](0x194);}return _0x3d0fe8;};}function handleError(_0x51fa0c,_0xb9e939){_0xb9e939=_0xb9e939||0x1f4;return function(_0x3584c9){logger[_0x1f0f('0x25')](_0x3584c9[_0x1f0f('0x45')]);if(_0x3584c9[_0x1f0f('0x42')]){delete _0x3584c9[_0x1f0f('0x42')];}_0x51fa0c['status'](_0xb9e939)['send'](_0x3584c9);};}exports['index']=function(_0x1509d3,_0x48efc8){var _0x36941d={},_0x1053e1={},_0x521396={'count':0x0,'rows':[]};var _0x259a9d=_['map'](db[_0x1f0f('0x46')][_0x1f0f('0x47')],function(_0x346cd5){return{'name':_0x346cd5[_0x1f0f('0x48')],'type':_0x346cd5[_0x1f0f('0x49')][_0x1f0f('0x4a')]};});_0x1053e1[_0x1f0f('0x4b')]=_[_0x1f0f('0x4c')](_[_0x1f0f('0x3d')](_0x259a9d,'name'),[_0x1f0f('0x4d'),_0x1f0f('0x4e')]);_0x1053e1[_0x1f0f('0x4f')]=_[_0x1f0f('0x50')](_0x1509d3[_0x1f0f('0x4f')]);_0x1053e1['filters']=_['intersection'](_0x1053e1['model'],_0x1053e1['query']);_0x36941d[_0x1f0f('0x51')]=_['intersection'](_0x1053e1[_0x1f0f('0x4b')],qs[_0x1f0f('0x52')](_0x1509d3[_0x1f0f('0x4f')]['fields']));_0x36941d[_0x1f0f('0x51')]=_0x36941d[_0x1f0f('0x51')][_0x1f0f('0x53')]?_0x36941d['attributes']:_0x1053e1[_0x1f0f('0x4b')];if(!_0x1509d3[_0x1f0f('0x4f')][_0x1f0f('0x54')]('nolimit')){_0x36941d[_0x1f0f('0x2f')]=qs[_0x1f0f('0x2f')](_0x1509d3[_0x1f0f('0x4f')][_0x1f0f('0x2f')]);_0x36941d[_0x1f0f('0x2e')]=qs[_0x1f0f('0x2e')](_0x1509d3[_0x1f0f('0x4f')][_0x1f0f('0x2e')]);}_0x36941d[_0x1f0f('0x55')]=qs[_0x1f0f('0x56')](_0x1509d3[_0x1f0f('0x4f')][_0x1f0f('0x56')]);_0x36941d[_0x1f0f('0x57')]=qs[_0x1f0f('0x58')](_[_0x1f0f('0x59')](_0x1509d3[_0x1f0f('0x4f')],_0x1053e1['filters']));if(_0x1509d3['query'][_0x1f0f('0x3b')]){_0x36941d[_0x1f0f('0x57')]=_[_0x1f0f('0x5a')](_0x36941d[_0x1f0f('0x57')],{'$or':_[_0x1f0f('0x3d')](_0x259a9d,function(_0x2c2c86){if(_0x2c2c86[_0x1f0f('0x49')]!==_0x1f0f('0x5b')){return db[_0x1f0f('0x5c')][_0x1f0f('0x57')](db[_0x1f0f('0x5c')]['fn'](_0x1f0f('0x5d'),db[_0x1f0f('0x5c')][_0x1f0f('0x5e')](_0x2c2c86[_0x1f0f('0x42')])),{'$like':db[_0x1f0f('0x5c')]['fn'](_0x1f0f('0x5d'),'%'+_0x1509d3['query'][_0x1f0f('0x3b')]+'%')});}})});}_0x36941d=_['merge']({},_0x36941d,_0x1509d3['options']);var _0x481040={'where':_0x36941d[_0x1f0f('0x57')]};return db[_0x1f0f('0x46')][_0x1f0f('0x5f')](_0x481040)[_0x1f0f('0x20')](function(_0x2c16bb){_0x521396[_0x1f0f('0x5f')]=_0x2c16bb;if(_0x1509d3[_0x1f0f('0x4f')][_0x1f0f('0x60')]){_0x36941d[_0x1f0f('0x61')]=[{'all':!![]}];}return db['User']['findAll'](_0x36941d);})[_0x1f0f('0x20')](function(_0x12f739){_0x521396[_0x1f0f('0x62')]=_0x12f739;return _0x521396;})[_0x1f0f('0x20')](respondWithFilteredResult(_0x48efc8,_0x36941d))[_0x1f0f('0x2a')](handleError(_0x48efc8,null));};exports['show']=function(_0x13ae17,_0x29f914){var _0x15f90c={'raw':![],'where':{'id':_0x13ae17[_0x1f0f('0x63')]['id']}},_0x144f36={};_0x144f36[_0x1f0f('0x4b')]=_['differenceBy'](_[_0x1f0f('0x50')](db['User'][_0x1f0f('0x47')]),['password',_0x1f0f('0x4e')]);_0x144f36[_0x1f0f('0x4f')]=_['keys'](_0x13ae17[_0x1f0f('0x4f')]);_0x144f36[_0x1f0f('0x58')]=_[_0x1f0f('0x64')](_0x144f36[_0x1f0f('0x4b')],_0x144f36[_0x1f0f('0x4f')]);_0x15f90c['attributes']=_['intersection'](_0x144f36[_0x1f0f('0x4b')],qs[_0x1f0f('0x52')](_0x13ae17['query']['fields']));_0x15f90c[_0x1f0f('0x51')]=_0x15f90c['attributes'][_0x1f0f('0x53')]?_0x15f90c[_0x1f0f('0x51')]:_0x144f36[_0x1f0f('0x4b')];if(_0x13ae17['query'][_0x1f0f('0x60')]){_0x15f90c['include']=[{'all':!![]}];}_0x15f90c=_['merge']({},_0x15f90c,_0x13ae17['options']);return db['User']['find'](_0x15f90c)[_0x1f0f('0x20')](handleEntityNotFound(_0x29f914,null))['then'](respondWithResult(_0x29f914,null))[_0x1f0f('0x2a')](handleError(_0x29f914,null));};exports[_0x1f0f('0x65')]=function(_0x2ed12d,_0x3ef5cd){return db[_0x1f0f('0x46')][_0x1f0f('0x65')](_0x2ed12d[_0x1f0f('0x66')],{'raw':![],'individualHooks':!![]})[_0x1f0f('0x20')](respondWithResult(_0x3ef5cd,0xc9))[_0x1f0f('0x2a')](handleError(_0x3ef5cd,null));};exports[_0x1f0f('0x34')]=function(_0x38c23b,_0xf84cad){if(_0x38c23b['body']['id']){delete _0x38c23b[_0x1f0f('0x66')]['id'];}delete _0x38c23b[_0x1f0f('0x66')]['role'];return db['User'][_0x1f0f('0x41')]({'where':{'id':_0x38c23b[_0x1f0f('0x63')]['id']}})[_0x1f0f('0x20')](handleEntityNotFound(_0xf84cad,null))['then'](saveUpdates(_0x38c23b[_0x1f0f('0x66')],null))[_0x1f0f('0x20')](respondWithResult(_0xf84cad,null))[_0x1f0f('0x2a')](handleError(_0xf84cad,null));};exports[_0x1f0f('0x67')]=function(_0xfad31,_0x88ffbd){return db['User'][_0x1f0f('0x67')]()[_0x1f0f('0x20')](respondWithResult(_0x88ffbd,null))[_0x1f0f('0x2a')](handleError(_0x88ffbd,null));};exports[_0x1f0f('0x68')]=function(_0x591d99,_0x980ea4,_0x506e89){return db['User']['find']({'where':{'id':_0x591d99[_0x1f0f('0x63')]['id']}})[_0x1f0f('0x20')](handleEntityNotFound(_0x980ea4,null))[_0x1f0f('0x20')](function(_0x2e891b){if(_0x2e891b){return _0x2e891b[_0x1f0f('0x68')](_0x591d99[_0x1f0f('0x66')][_0x1f0f('0x69')],_['omit'](_0x591d99[_0x1f0f('0x66')],[_0x1f0f('0x69'),'id'])||{});}})[_0x1f0f('0x20')](respondWithResult(_0x980ea4,null))[_0x1f0f('0x2a')](handleError(_0x980ea4,null));};var getLicense=function(_0x144f20){return new BPromise(function(_0x842cf,_0x5915b8){var _0x22eb19=0x0;_0x144f20[_0x1f0f('0x66')][_0x1f0f('0x40')]===_0x1f0f('0x6a')&&_0x842cf(_0x1f0f('0x6b'));return db['User']['count']({'where':{'$or':[{'role':_0x144f20[_0x1f0f('0x66')][_0x1f0f('0x40')]===_0x1f0f('0x3a')?'telephone':[_0x1f0f('0x6c'),'user']}]}})[_0x1f0f('0x20')](function(_0x5aa2eb){_0x22eb19=_0x5aa2eb;return require(_0x1f0f('0x6d'))[_0x1f0f('0x6e')]();})[_0x1f0f('0x20')](function(_0x402563){var _0x1a2c71=_0x144f20[_0x1f0f('0x66')]['role']===_0x1f0f('0x3a')?_0x1f0f('0x6f'):_0x1f0f('0x70');if(!_[_0x1f0f('0x71')](_0x402563[_0x1a2c71])&&_0x22eb19>=_0x402563[_0x1a2c71]){return _0x5915b8({'message':_0x1f0f('0x72')});}return _0x842cf(util['format']('count\x20%s:\x20%s',_0x1a2c71,_0x22eb19));})[_0x1f0f('0x2a')](function(_0x270e5a){return _0x5915b8(_0x270e5a);});});};exports[_0x1f0f('0x73')]=function(_0x5470e1,_0x2d3987){return getLicense(_0x5470e1)[_0x1f0f('0x20')](function(_0x35124c){if(!_0x5470e1['body'][_0x1f0f('0x74')]){var _0x212701;return db[_0x1f0f('0x75')][_0x1f0f('0x76')](0x1)[_0x1f0f('0x20')](function(_0xcacbaf){return checkPasswordPattern(_0xcacbaf,_0x5470e1['body'][_0x1f0f('0x4d')],_0xcacbaf[_0x1f0f('0x77')]);})[_0x1f0f('0x20')](function(_0x37b2c2){_0x212701=_0x37b2c2['min_internal'];return db[_0x1f0f('0x46')][_0x1f0f('0x78')]('internal');})['then'](function(_0x4fa556){if(_[_0x1f0f('0x71')](_0x4fa556)){if(_0x212701){_0x5470e1[_0x1f0f('0x66')]['internal']=_0x212701;}else{_0x5470e1[_0x1f0f('0x66')]['internal']=0x1;}}else{if(_[_0x1f0f('0x71')](_0x212701)||_0x212701==_0x4fa556){_0x5470e1[_0x1f0f('0x66')][_0x1f0f('0x74')]=_0x4fa556+0x1;}else if(_0x212701>_0x4fa556){_0x5470e1[_0x1f0f('0x66')][_0x1f0f('0x74')]=_0x212701;}else{return db['sequelize'][_0x1f0f('0x4f')]('select\x20(select\x20IFNULL(max(internal)+1,1)\x20from\x20users\x20where\x20internal\x20<\x20md.internal)\x20as\x20\x27from\x27,\x20md.internal\x20-\x201\x20as\x20\x27to\x27\x20from\x20users\x20md\x20where\x20md.internal\x20!=\x201\x20and\x20not\x20exists\x20(select\x201\x20from\x20users\x20md2\x20where\x20md2.internal\x20=\x20md.internal\x20-\x201)',{'type':db[_0x1f0f('0x5c')][_0x1f0f('0x79')][_0x1f0f('0x7a')]})['then'](function(_0x113f0a){if(_0x113f0a&&_0x113f0a[_0x1f0f('0x53')]){for(var _0x4c8cfe=0x0,_0x51ed46=_0x113f0a['length'];_0x4c8cfe<_0x51ed46&&_['isNil'](_0x5470e1[_0x1f0f('0x66')][_0x1f0f('0x74')]);_0x4c8cfe++){if(_0x212701<=_0x113f0a[_0x4c8cfe][_0x1f0f('0x7b')]){_0x5470e1[_0x1f0f('0x66')][_0x1f0f('0x74')]=_0x113f0a[_0x4c8cfe][_0x1f0f('0x7b')];}else if(_0x212701>_0x113f0a[_0x4c8cfe][_0x1f0f('0x7b')]&&_0x212701<=_0x113f0a[_0x4c8cfe]['to']){_0x5470e1['body'][_0x1f0f('0x74')]=_0x212701;}}}if(_['isNil'](_0x5470e1[_0x1f0f('0x66')]['internal'])){_0x5470e1[_0x1f0f('0x66')][_0x1f0f('0x74')]=_0x4fa556+0x1;}});}}});}})['then'](function(){if(_0x5470e1['body']['voicemail']){_0x5470e1[_0x1f0f('0x66')][_0x1f0f('0x7c')]=_0x5470e1[_0x1f0f('0x66')]['internal'];_0x5470e1[_0x1f0f('0x66')][_0x1f0f('0x7d')]={'mailbox':_0x5470e1[_0x1f0f('0x66')]['internal'],'password':_0x5470e1[_0x1f0f('0x66')][_0x1f0f('0x4d')],'fullname':_0x5470e1[_0x1f0f('0x66')]['fullname'],'email':_0x5470e1['body'][_0x1f0f('0x7e')]};}if(_0x5470e1[_0x1f0f('0x66')]&&_0x5470e1[_0x1f0f('0x66')][_0x1f0f('0x40')]===_0x1f0f('0x6a')){_0x5470e1['body'][_0x1f0f('0x7f')]=[_0x1f0f('0x80'),_0x1f0f('0x81'),_0x1f0f('0x82'),'110',_0x1f0f('0x83'),_0x1f0f('0x84'),'106',_0x1f0f('0x85'),_0x1f0f('0x86'),_0x1f0f('0x87'),'100',_0x1f0f('0x88')];}return db['User'][_0x1f0f('0x73')](_0x5470e1[_0x1f0f('0x66')],{'include':[{'model':db[_0x1f0f('0x7d')],'as':_0x1f0f('0x7d')}]});})[_0x1f0f('0x20')](function(_0xd72448){if(_0x5470e1[_0x1f0f('0x66')][_0x1f0f('0x40')]==='user')return _0xd72448;var _0x356655=_0x5470e1['user']['get']({'plain':!![]});if(!_0x356655)throw new Error(_0x1f0f('0x89'));if(_0x356655[_0x1f0f('0x40')]===_0x1f0f('0x37')){var _0x17dcf7=_0xd72448[_0x1f0f('0x8a')]({'plain':!![]});var _0x121915=[{'name':_0x1f0f('0x38'),'value':_0x1f0f('0x6a')},{'name':_0x1f0f('0x39'),'value':_0x1f0f('0x3a')}];var _0x1f60ff=_[_0x1f0f('0x41')](_0x121915,['value',_0x17dcf7[_0x1f0f('0x40')]])[_0x1f0f('0x42')];return db[_0x1f0f('0x8b')][_0x1f0f('0x41')]({'where':{'name':_0x1f60ff,'userProfileId':_0x356655['userProfileId']},'raw':!![]})[_0x1f0f('0x20')](function(_0x45f25d){if(_0x45f25d&&_0x45f25d[_0x1f0f('0x8c')]===0x0){return db['UserProfileResource'][_0x1f0f('0x73')]({'name':_0x17dcf7[_0x1f0f('0x42')],'resourceId':_0x17dcf7['id'],'type':_0x45f25d['name'],'sectionId':_0x45f25d['id']},{})[_0x1f0f('0x20')](function(){return _0xd72448;});}else{return _0xd72448;}})[_0x1f0f('0x2a')](function(_0x591701){logger['error'](_0x1f0f('0x8d'),_0x591701);throw _0x591701;});}return _0xd72448;})['then'](respondWithResult(_0x2d3987,0xc9))[_0x1f0f('0x2a')](handleError(_0x2d3987,null));};exports[_0x1f0f('0x8e')]=function(_0x5259f1,_0x504666,_0x498653){var _0x196c89=![];if(_0x5259f1[_0x1f0f('0x66')]['id']){delete _0x5259f1[_0x1f0f('0x66')]['id'];}return db[_0x1f0f('0x75')][_0x1f0f('0x8f')]({'attributes':['id',_0x1f0f('0x77')]})[_0x1f0f('0x20')](function(_0x4931b9){_0x196c89=_0x4931b9[_0x1f0f('0x77')];return db[_0x1f0f('0x46')][_0x1f0f('0x41')]({'where':{'id':_0x5259f1[_0x1f0f('0x63')]['id']}});})[_0x1f0f('0x20')](function(_0xc6f912){if(_0xc6f912){if(_0xc6f912['id']==_0x5259f1['user']['id']){if(!_0x5259f1[_0x1f0f('0x66')][_0x1f0f('0x90')]||!_0x5259f1['body'][_0x1f0f('0x91')]){throw new db[(_0x1f0f('0x92'))][(_0x1f0f('0x1e'))](_0x1f0f('0x93'));}if(!_0xc6f912[_0x1f0f('0x94')](_0x5259f1[_0x1f0f('0x66')][_0x1f0f('0x90')])){throw new db[(_0x1f0f('0x92'))][(_0x1f0f('0x1e'))](_0x1f0f('0x95'));}if(_0x5259f1['body'][_0x1f0f('0x90')]==_0x5259f1[_0x1f0f('0x66')]['newPassword']){throw new db[(_0x1f0f('0x92'))]['ValidationError'](_0x1f0f('0x96'));}return _0xc6f912;}else if(_0x5259f1[_0x1f0f('0x37')][_0x1f0f('0x40')]==_0x1f0f('0x6c')){if(!_0x5259f1[_0x1f0f('0x66')][_0x1f0f('0x91')]){throw new db[(_0x1f0f('0x92'))][(_0x1f0f('0x1e'))](_0x1f0f('0x97'));}return _0xc6f912;}else if(_0x5259f1[_0x1f0f('0x37')][_0x1f0f('0x40')]==_0x1f0f('0x37')){if(!_0x5259f1[_0x1f0f('0x66')][_0x1f0f('0x91')]){throw new db[(_0x1f0f('0x92'))][(_0x1f0f('0x1e'))](_0x1f0f('0x97'));}if(_0xc6f912[_0x1f0f('0x40')]!=_0x1f0f('0x6a')){throw new db[(_0x1f0f('0x92'))]['ValidationError'](_0x1f0f('0x98'));}return _0xc6f912;}else{throw new db['Sequelize']['ValidationError'](_0x1f0f('0x98'));}}return null;})[_0x1f0f('0x20')](handleEntityNotFound(_0x504666,null))[_0x1f0f('0x20')](function(_0x56ba73){return checkPasswordPattern(_0x56ba73,_0x5259f1[_0x1f0f('0x66')][_0x1f0f('0x91')],_0x196c89);})['then'](saveUpdates({'password':_0x5259f1[_0x1f0f('0x66')][_0x1f0f('0x91')],'passwordResetAt':_0x5259f1['user']['id']==_0x5259f1[_0x1f0f('0x63')]['id']?moment():null},null))[_0x1f0f('0x20')](respondWithResult(_0x504666,null))[_0x1f0f('0x2a')](handleError(_0x504666,null));};exports[_0x1f0f('0x99')]=function(_0x228328,_0x2f0808,_0x2d1371){var _0x8dc003=_0x228328[_0x1f0f('0x66')][_0x1f0f('0x9a')];return db['User'][_0x1f0f('0x41')]({'where':{'id':_0x228328[_0x1f0f('0x63')]['id']},'attributes':['id',_0x1f0f('0x42'),_0x1f0f('0x40'),_0x1f0f('0x9b'),_0x1f0f('0x9c'),_0x1f0f('0x9d'),'interface']})['then'](handleEntityNotFound(_0x2f0808,null))[_0x1f0f('0x20')](function(_0x40454d){if(_0x40454d){if(!utils['isValidChannel'](_0x8dc003)){throw new db[(_0x1f0f('0x92'))]['ValidationError'](_0x1f0f('0x9e'));}return _0x40454d[_0x1f0f('0x9f')+_[_0x1f0f('0xa0')](_0x8dc003[_0x1f0f('0xa1')]())+_0x1f0f('0xa2')](_0x228328[_0x1f0f('0x66')][_0x1f0f('0x69')],{'penalty':_0x228328['body'][_0x1f0f('0xa3')]||0x0})[_0x1f0f('0xa4')](function(_0x17c8d7){for(var _0x439eb3=0x0;_0x439eb3<_0x228328[_0x1f0f('0x66')][_0x1f0f('0x69')][_0x1f0f('0x53')];_0x439eb3+=0x1){var _0x1ff7c1={'UserId':_0x228328[_0x1f0f('0x63')]['id']};_0x1ff7c1[_[_0x1f0f('0xa0')](_0x8dc003[_0x1f0f('0xa1')]())+_0x1f0f('0xa5')]=_0x228328['body'][_0x1f0f('0x69')][_0x439eb3];socket[_0x1f0f('0xa6')]('user'+_['capitalize'](_0x8dc003[_0x1f0f('0xa1')]())+_0x1f0f('0xa7'),_0x1ff7c1);}return _0x17c8d7;})[_0x1f0f('0x20')](function(){if(_0x8dc003===_0x1f0f('0xa8')){return db[_0x1f0f('0xa9')][_0x1f0f('0xaa')]({'where':{'id':_0x228328[_0x1f0f('0x66')][_0x1f0f('0x69')]||[]},'raw':!![],'attributes':['id',_0x1f0f('0x42')]});}})[_0x1f0f('0x20')](function(_0x285ae6){var _0x2ceb52=_0x40454d['get']({'plain':!![]});var _0x53c69a=[];if(_0x8dc003===_0x1f0f('0xa8')&&_0x2ceb52['role']===_0x1f0f('0x6a')&&_0x2ceb52[_0x1f0f('0x9b')]){for(var _0x41532f=0x0;_0x41532f<_0x285ae6['length'];_0x41532f+=0x1){_0x53c69a[_0x1f0f('0xab')]({'membername':_0x2ceb52[_0x1f0f('0x42')],'UserId':_0x2ceb52['id'],'queue_name':_0x285ae6[_0x41532f][_0x1f0f('0x42')],'VoiceQueueId':_0x285ae6[_0x41532f]['id'],'interface':_['isNil'](_0x2ceb52['interface'])?util['format'](_0x1f0f('0xac'),_0x2ceb52[_0x1f0f('0x42')]):_0x2ceb52[_0x1f0f('0xad')],'paused':_0x2ceb52[_0x1f0f('0x9d')]||![],'penalty':_0x228328[_0x1f0f('0x66')]['penalty']||0x0});}return BPromise['each'](_0x53c69a,function(_0x56c5d1){return db['UserVoiceQueueRt'][_0x1f0f('0xae')](_0x56c5d1);});}return _0x40454d;});}})[_0x1f0f('0x20')](respondWithStatusCode(_0x2f0808,null))[_0x1f0f('0x2a')](handleError(_0x2f0808,null));};exports[_0x1f0f('0xaf')]=function(_0x454891,_0x18b972,_0x5a42d8){var _0x338b28;return db[_0x1f0f('0x46')][_0x1f0f('0x41')]({'where':{'id':_0x454891[_0x1f0f('0x63')]['id']},'attributes':['id',_0x1f0f('0x42'),_0x1f0f('0x40')]})[_0x1f0f('0x20')](handleEntityNotFound(_0x18b972,null))[_0x1f0f('0x20')](function(_0x2dacea){if(_0x2dacea){_0x338b28=_0x2dacea;if(!_0x454891[_0x1f0f('0x4f')]['channel']||!utils['isValidChannel'](_0x454891[_0x1f0f('0x4f')][_0x1f0f('0x9a')])){throw new db['Sequelize'][(_0x1f0f('0x1e'))](_0x1f0f('0x9e'));}return _0x2dacea['remove'+_[_0x1f0f('0xa0')](_0x454891[_0x1f0f('0x4f')]['channel'][_0x1f0f('0xa1')]())+_0x1f0f('0xa2')](_0x454891[_0x1f0f('0x4f')][_0x1f0f('0x69')]);}})[_0x1f0f('0x20')](function(_0x3ce70a){for(var _0x53cf7f=0x0;_0x53cf7f<_0x454891[_0x1f0f('0x4f')]['ids'][_0x1f0f('0x53')];_0x53cf7f+=0x1){var _0x5df072={'UserId':_0x454891[_0x1f0f('0x63')]['id']};_0x5df072[_[_0x1f0f('0xa0')](_0x454891['query'][_0x1f0f('0x9a')][_0x1f0f('0xa1')]())+_0x1f0f('0xa5')]=_0x454891['query'][_0x1f0f('0x69')][_0x53cf7f];socket[_0x1f0f('0xa6')](_0x1f0f('0x37')+_[_0x1f0f('0xa0')](_0x454891[_0x1f0f('0x4f')][_0x1f0f('0x9a')][_0x1f0f('0xa1')]())+_0x1f0f('0xb0'),_0x5df072);}return _0x3ce70a;})[_0x1f0f('0x20')](function(){if(_0x454891[_0x1f0f('0x4f')][_0x1f0f('0x9a')]==='voice'){return db[_0x1f0f('0xb1')][_0x1f0f('0x35')]({'where':{'UserId':_0x454891['params']['id'],'VoiceQueueId':_0x454891[_0x1f0f('0x4f')][_0x1f0f('0x69')]},'individualHooks':!![]})[_0x1f0f('0x20')](function(){return _0x338b28;});}return _0x338b28;})[_0x1f0f('0x20')](respondWithStatusCode(_0x18b972,null))[_0x1f0f('0x2a')](handleError(_0x18b972,null));};exports[_0x1f0f('0xb2')]=function(_0x4b8e20,_0x1bf9cc,_0x43e08e){_0x4b8e20[_0x1f0f('0x66')][_0x1f0f('0xb3')]=_0x4b8e20[_0x1f0f('0xb4')][_0x1f0f('0xb5')];return db[_0x1f0f('0x46')][_0x1f0f('0x41')]({'where':{'id':_0x4b8e20[_0x1f0f('0x63')]['id']}})[_0x1f0f('0x20')](handleEntityNotFound(_0x1bf9cc,null))[_0x1f0f('0x20')](saveUpdates(_0x4b8e20[_0x1f0f('0x66')],null))[_0x1f0f('0x20')](respondWithResult(_0x1bf9cc,null))[_0x1f0f('0x2a')](handleError(_0x1bf9cc,null));};exports['getAvatar']=function(_0x49c830,_0x32a9ef,_0x3c27f0){var _0x16ca49=path[_0x1f0f('0xb6')](config['root'],'server/files/images/logos/default_profile.png');return db[_0x1f0f('0x46')][_0x1f0f('0x41')]({'where':{'id':_0x49c830[_0x1f0f('0x63')]['id']},'attributes':['id','userpic'],'raw':!![]})[_0x1f0f('0x20')](handleEntityNotFound(_0x32a9ef,null))['then'](function(_0x2cec75){if(_0x2cec75){if(_['isNil'](_0x2cec75[_0x1f0f('0xb3')])){return _0x32a9ef['download'](_0x16ca49);}else{if(!fs[_0x1f0f('0xb7')](path[_0x1f0f('0xb6')](config[_0x1f0f('0xb8')],_0x1f0f('0xb9'),_0x2cec75['userpic']))){return _0x32a9ef[_0x1f0f('0xba')](_0x16ca49);}return _0x32a9ef[_0x1f0f('0xba')](path[_0x1f0f('0xb6')](config[_0x1f0f('0xb8')],_0x1f0f('0xb9'),_0x2cec75['userpic']));}}})[_0x1f0f('0x2a')](handleError(_0x32a9ef,null));};exports[_0x1f0f('0xbb')]=function(_0x4b3b1b,_0x272991,_0x2a9b1){var _0x20d45d={};var _0xd93e49={};var _0x5db452;var _0x18f458;return db[_0x1f0f('0x46')][_0x1f0f('0x8f')]({'where':{'id':_0x4b3b1b[_0x1f0f('0x63')]['id']}})[_0x1f0f('0x20')](handleEntityNotFound(_0x272991,null))[_0x1f0f('0x20')](function(_0x21f99d){if(_0x21f99d){_0x5db452=_0x21f99d;_0xd93e49[_0x1f0f('0x4b')]=_['keys'](db[_0x1f0f('0xbc')][_0x1f0f('0x47')]);_0xd93e49['query']=_[_0x1f0f('0x50')](_0x4b3b1b['query']);_0xd93e49[_0x1f0f('0x58')]=_[_0x1f0f('0x64')](_0xd93e49[_0x1f0f('0x4b')],_0xd93e49[_0x1f0f('0x4f')]);_0x20d45d[_0x1f0f('0x51')]=_[_0x1f0f('0x64')](_0xd93e49[_0x1f0f('0x4b')],qs[_0x1f0f('0x52')](_0x4b3b1b[_0x1f0f('0x4f')][_0x1f0f('0x52')]));_0x20d45d[_0x1f0f('0x51')]=_0x20d45d['attributes'][_0x1f0f('0x53')]?_0x20d45d[_0x1f0f('0x51')]:_0xd93e49[_0x1f0f('0x4b')];_0x20d45d[_0x1f0f('0x55')]=qs[_0x1f0f('0x56')](_0x4b3b1b['query'][_0x1f0f('0x56')]);_0x20d45d[_0x1f0f('0x57')]=qs['filters'](_[_0x1f0f('0x59')](_0x4b3b1b['query'],_0xd93e49[_0x1f0f('0x58')]));if(_0x4b3b1b['query'][_0x1f0f('0x3b')]){_0x20d45d[_0x1f0f('0x57')]=_['merge'](_0x20d45d[_0x1f0f('0x57')],{'$or':_[_0x1f0f('0x3d')](_0x20d45d[_0x1f0f('0x51')],function(_0x5a3726){var _0x17e191={};_0x17e191[_0x5a3726]={'$like':'%'+_0x4b3b1b[_0x1f0f('0x4f')]['filter']+'%'};return _0x17e191;})});}_0x20d45d=_[_0x1f0f('0x5a')]({},_0x20d45d,_0x4b3b1b[_0x1f0f('0xbd')]);return _0x5db452[_0x1f0f('0xbb')](_0x20d45d);}})[_0x1f0f('0x20')](function(_0xebf18d){if(_0xebf18d){_0x18f458=_0xebf18d[_0x1f0f('0x53')];if(_0x4b3b1b[_0x1f0f('0x4f')]['hasOwnProperty']('includeAll')){_0x20d45d[_0x1f0f('0x61')]=[{'model':db[_0x1f0f('0xbe')],'as':_0x1f0f('0xbf'),'required':![]},{'model':db[_0x1f0f('0xc0')],'as':'Tags','attributes':['id','name',_0x1f0f('0xc1')],'where':_0x4b3b1b[_0x1f0f('0x4f')][_0x1f0f('0xc2')]?{'id':_0x4b3b1b[_0x1f0f('0x4f')]['tag']}:undefined,'required':_0x4b3b1b[_0x1f0f('0x4f')][_0x1f0f('0xc2')]?!![]:![]}];}if(!_0x4b3b1b['query']['hasOwnProperty'](_0x1f0f('0xc3'))){_0x20d45d['limit']=qs[_0x1f0f('0x2f')](_0x4b3b1b[_0x1f0f('0x4f')][_0x1f0f('0x2f')]);_0x20d45d[_0x1f0f('0x2e')]=qs[_0x1f0f('0x2e')](_0x4b3b1b[_0x1f0f('0x4f')]['offset']);}return _0x5db452['getContacts'](_0x20d45d);}})[_0x1f0f('0x20')](function(_0x44cb3b){if(_0x44cb3b){return _0x44cb3b?{'count':_0x18f458,'rows':_0x44cb3b}:null;}})[_0x1f0f('0x20')](respondWithResult(_0x272991,null))[_0x1f0f('0x2a')](handleError(_0x272991,null));};exports[_0x1f0f('0xc4')]=function(_0x13a4d9,_0xd142b2,_0x5eba90){var _0x58a1af;var _0x18e856;var _0x19592b={};var _0x45d5c3;return db['User']['findOne']({'where':{'id':_0x13a4d9['params']['id']},'attributes':['id',_0x1f0f('0x42'),'role']})[_0x1f0f('0x20')](handleEntityNotFound(_0xd142b2,null))[_0x1f0f('0x20')](function(_0x5c1ae6){if(!utils[_0x1f0f('0xc5')](_0x13a4d9[_0x1f0f('0x4f')][_0x1f0f('0x9a')])){throw new db[(_0x1f0f('0x92'))][(_0x1f0f('0x1e'))](_0x1f0f('0x9e'));}_0x58a1af=_0x5c1ae6;var _0x28107d={};_0x28107d[_0x1f0f('0x4b')]=_[_0x1f0f('0x50')](db[_[_0x1f0f('0xa0')](_0x13a4d9['query'][_0x1f0f('0x9a')])+_0x1f0f('0xc6')]['rawAttributes']);_0x28107d[_0x1f0f('0x4f')]=_['keys'](_0x13a4d9[_0x1f0f('0x4f')]);_0x28107d[_0x1f0f('0x58')]=_[_0x1f0f('0x64')](_0x28107d[_0x1f0f('0x4b')],_0x28107d['query']);_0x19592b[_0x1f0f('0x51')]=_[_0x1f0f('0x64')](_0x28107d[_0x1f0f('0x4b')],qs[_0x1f0f('0x52')](_0x13a4d9['query']['fields']));_0x19592b[_0x1f0f('0x51')]=_0x19592b[_0x1f0f('0x51')][_0x1f0f('0x53')]?_0x19592b[_0x1f0f('0x51')]:_0x28107d[_0x1f0f('0x4b')];_0x19592b[_0x1f0f('0x55')]=qs[_0x1f0f('0x56')](_0x13a4d9[_0x1f0f('0x4f')]['sort']);_0x19592b[_0x1f0f('0x57')]=qs[_0x1f0f('0x58')](_['pick'](_0x13a4d9[_0x1f0f('0x4f')],_0x28107d[_0x1f0f('0x58')]));if(_0x13a4d9['query'][_0x1f0f('0x3b')]){_0x19592b[_0x1f0f('0x57')]=_[_0x1f0f('0x5a')](_0x19592b[_0x1f0f('0x57')],{'$or':_[_0x1f0f('0x3d')](_0x19592b['attributes'],function(_0x3066d9){var _0x13b729={};_0x13b729[_0x3066d9]={'$like':'%'+_0x13a4d9['query']['filter']+'%'};return _0x13b729;})});}_0x19592b=_['merge']({},_0x19592b,_0x13a4d9['options']);switch(_0x58a1af[_0x1f0f('0x40')]){case _0x1f0f('0x6c'):return db[_['capitalize'](_0x13a4d9[_0x1f0f('0x4f')]['channel'])+_0x1f0f('0xc6')][_0x1f0f('0xaa')](_0x19592b);case _0x1f0f('0x37'):case _0x1f0f('0x6a'):return _0x58a1af['get'+_[_0x1f0f('0xa0')](_0x13a4d9[_0x1f0f('0x4f')][_0x1f0f('0x9a')])+_0x1f0f('0xa2')](_0x19592b);default:throw new db['Sequelize'][(_0x1f0f('0x1e'))]('Unknown\x20role');}})[_0x1f0f('0x20')](function(_0xd47dcb){_0x45d5c3=_0xd47dcb['length'];if(!_0x13a4d9['query']['hasOwnProperty'](_0x1f0f('0xc3'))){_0x19592b[_0x1f0f('0x2f')]=qs['limit'](_0x13a4d9[_0x1f0f('0x4f')][_0x1f0f('0x2f')]);_0x19592b['offset']=qs[_0x1f0f('0x2e')](_0x13a4d9[_0x1f0f('0x4f')][_0x1f0f('0x2e')]);}switch(_0x58a1af[_0x1f0f('0x40')]){case'admin':return db[_[_0x1f0f('0xa0')](_0x13a4d9['query'][_0x1f0f('0x9a')])+_0x1f0f('0xc6')][_0x1f0f('0xaa')](_0x19592b);case _0x1f0f('0x37'):case _0x1f0f('0x6a'):return _0x58a1af[_0x1f0f('0x8a')+_[_0x1f0f('0xa0')](_0x13a4d9[_0x1f0f('0x4f')][_0x1f0f('0x9a')])+_0x1f0f('0xa2')](_0x19592b);}})['then'](function(_0x3684da){return{'count':_0x45d5c3,'rows':_0x3684da};})['then'](respondWithResult(_0xd142b2,null))['catch'](handleError(_0xd142b2,null));};exports['getVoiceQueuesRt']=function(_0x1a381c,_0x884065,_0x1f3700){var _0x444d4e={};var _0x58307f={};var _0x199301;var _0x4a92cd;return db[_0x1f0f('0x46')]['findOne']({'where':{'id':_0x1a381c[_0x1f0f('0x63')]['id']}})[_0x1f0f('0x20')](handleEntityNotFound(_0x884065,null))['then'](function(_0x328dc9){if(_0x328dc9){_0x199301=_0x328dc9;_0x58307f[_0x1f0f('0x4b')]=_['keys'](db[_0x1f0f('0xb1')][_0x1f0f('0x47')]);_0x58307f['query']=_[_0x1f0f('0x50')](_0x1a381c[_0x1f0f('0x4f')]);_0x58307f['filters']=_['intersection'](_0x58307f[_0x1f0f('0x4b')],_0x58307f[_0x1f0f('0x4f')]);_0x444d4e[_0x1f0f('0x51')]=_[_0x1f0f('0x64')](_0x58307f[_0x1f0f('0x4b')],qs['fields'](_0x1a381c['query'][_0x1f0f('0x52')]));_0x444d4e[_0x1f0f('0x51')]=_0x444d4e['attributes'][_0x1f0f('0x53')]?_0x444d4e['attributes']:_0x58307f[_0x1f0f('0x4b')];_0x444d4e[_0x1f0f('0x55')]=qs[_0x1f0f('0x56')](_0x1a381c[_0x1f0f('0x4f')][_0x1f0f('0x56')]);_0x444d4e[_0x1f0f('0x57')]=qs[_0x1f0f('0x58')](_[_0x1f0f('0x59')](_0x1a381c[_0x1f0f('0x4f')],_0x58307f[_0x1f0f('0x58')]));if(_0x1a381c[_0x1f0f('0x4f')]['filter']){_0x444d4e[_0x1f0f('0x57')]=_['merge'](_0x444d4e['where'],{'$or':_['map'](_0x444d4e[_0x1f0f('0x51')],function(_0x1d151c){var _0xdf4392={};_0xdf4392[_0x1d151c]={'$like':'%'+_0x1a381c[_0x1f0f('0x4f')][_0x1f0f('0x3b')]+'%'};return _0xdf4392;})});}_0x444d4e=_[_0x1f0f('0x5a')]({},_0x444d4e,_0x1a381c[_0x1f0f('0xbd')]);return _0x199301['getVoiceQueuesRt'](_0x444d4e);}})[_0x1f0f('0x20')](function(_0x391680){if(_0x391680){_0x4a92cd=_0x391680[_0x1f0f('0x53')];if(!_0x1a381c[_0x1f0f('0x4f')][_0x1f0f('0x54')](_0x1f0f('0xc3'))){_0x444d4e[_0x1f0f('0x2f')]=qs[_0x1f0f('0x2f')](_0x1a381c['query'][_0x1f0f('0x2f')]);_0x444d4e[_0x1f0f('0x2e')]=qs['offset'](_0x1a381c[_0x1f0f('0x4f')][_0x1f0f('0x2e')]);}return _0x199301[_0x1f0f('0xc7')](_0x444d4e);}})[_0x1f0f('0x20')](function(_0x28a142){if(_0x28a142){return _0x28a142?{'count':_0x4a92cd,'rows':_0x28a142}:null;}})[_0x1f0f('0x20')](respondWithResult(_0x884065,null))[_0x1f0f('0x2a')](handleError(_0x884065,null));};exports['getGroups']=function(_0x2a8692,_0x206687,_0x1f5385){var _0x406a50={};var _0x20143a={};var _0x4d0f53;var _0x2f34e5;return db[_0x1f0f('0x46')][_0x1f0f('0x8f')]({'where':{'id':_0x2a8692['params']['id']}})[_0x1f0f('0x20')](handleEntityNotFound(_0x206687,null))[_0x1f0f('0x20')](function(_0x1e88ff){if(_0x1e88ff){_0x4d0f53=_0x1e88ff;_0x20143a[_0x1f0f('0x4b')]=_[_0x1f0f('0x50')](db[_0x1f0f('0xc8')][_0x1f0f('0x47')]);_0x20143a[_0x1f0f('0x4f')]=_[_0x1f0f('0x50')](_0x2a8692[_0x1f0f('0x4f')]);_0x20143a[_0x1f0f('0x58')]=_[_0x1f0f('0x64')](_0x20143a[_0x1f0f('0x4b')],_0x20143a[_0x1f0f('0x4f')]);_0x406a50[_0x1f0f('0x51')]=_[_0x1f0f('0x64')](_0x20143a['model'],qs[_0x1f0f('0x52')](_0x2a8692[_0x1f0f('0x4f')][_0x1f0f('0x52')]));_0x406a50[_0x1f0f('0x51')]=_0x406a50[_0x1f0f('0x51')][_0x1f0f('0x53')]?_0x406a50[_0x1f0f('0x51')]:_0x20143a[_0x1f0f('0x4b')];_0x406a50['order']=qs[_0x1f0f('0x56')](_0x2a8692[_0x1f0f('0x4f')][_0x1f0f('0x56')]);_0x406a50[_0x1f0f('0x57')]=qs[_0x1f0f('0x58')](_[_0x1f0f('0x59')](_0x2a8692[_0x1f0f('0x4f')],_0x20143a[_0x1f0f('0x58')]));if(_0x2a8692[_0x1f0f('0x4f')][_0x1f0f('0x3b')]){_0x406a50[_0x1f0f('0x57')]=_[_0x1f0f('0x5a')](_0x406a50[_0x1f0f('0x57')],{'$or':_[_0x1f0f('0x3d')](_0x406a50['attributes'],function(_0x3500de){var _0x19e998={};_0x19e998[_0x3500de]={'$like':'%'+_0x2a8692[_0x1f0f('0x4f')][_0x1f0f('0x3b')]+'%'};return _0x19e998;})});}_0x406a50=_[_0x1f0f('0x5a')]({},_0x406a50,_0x2a8692[_0x1f0f('0xbd')]);return _0x4d0f53[_0x1f0f('0xc9')](_0x406a50);}})[_0x1f0f('0x20')](function(_0xad2450){if(_0xad2450){_0x2f34e5=_0xad2450[_0x1f0f('0x53')];if(!_0x2a8692[_0x1f0f('0x4f')][_0x1f0f('0x54')](_0x1f0f('0xc3'))){_0x406a50['limit']=qs['limit'](_0x2a8692[_0x1f0f('0x4f')][_0x1f0f('0x2f')]);_0x406a50['offset']=qs[_0x1f0f('0x2e')](_0x2a8692[_0x1f0f('0x4f')][_0x1f0f('0x2e')]);}return _0x4d0f53[_0x1f0f('0xc9')](_0x406a50);}})[_0x1f0f('0x20')](function(_0x1bf5eb){if(_0x1bf5eb){return _0x1bf5eb?{'count':_0x2f34e5,'rows':_0x1bf5eb}:null;}})[_0x1f0f('0x20')](respondWithResult(_0x206687,null))[_0x1f0f('0x2a')](handleError(_0x206687,null));};exports[_0x1f0f('0xca')]=function(_0x1dfe2c,_0x53ff96,_0x32fa49){var _0x2efff2={'raw':!![],'where':{}};var _0x4f30cb={};var _0x1b8ec1={'count':0x0,'rows':[]};return db[_0x1f0f('0x46')][_0x1f0f('0x8f')]({'where':{'id':_0x1dfe2c[_0x1f0f('0x63')]['id']}})[_0x1f0f('0x20')](handleEntityNotFound(_0x53ff96,null))['then'](function(_0x51950f){if(_0x51950f){_0x4f30cb[_0x1f0f('0x4b')]=_[_0x1f0f('0x50')](db[_0x1f0f('0xcb')][_0x1f0f('0x47')]);_0x4f30cb[_0x1f0f('0x4f')]=_[_0x1f0f('0x50')](_0x1dfe2c['query']);_0x4f30cb[_0x1f0f('0x58')]=_[_0x1f0f('0x64')](_0x4f30cb[_0x1f0f('0x4b')],_0x4f30cb[_0x1f0f('0x4f')]);_0x2efff2[_0x1f0f('0x51')]=_[_0x1f0f('0x64')](_0x4f30cb[_0x1f0f('0x4b')],qs[_0x1f0f('0x52')](_0x1dfe2c['query'][_0x1f0f('0x52')]));_0x2efff2[_0x1f0f('0x51')]=_0x2efff2[_0x1f0f('0x51')][_0x1f0f('0x53')]?_0x2efff2[_0x1f0f('0x51')]:_0x4f30cb[_0x1f0f('0x4b')];if(!_0x1dfe2c[_0x1f0f('0x4f')][_0x1f0f('0x54')](_0x1f0f('0xc3'))){_0x2efff2[_0x1f0f('0x2f')]=qs['limit'](_0x1dfe2c['query']['limit']);_0x2efff2['offset']=qs[_0x1f0f('0x2e')](_0x1dfe2c[_0x1f0f('0x4f')]['offset']);}_0x2efff2[_0x1f0f('0x55')]=qs[_0x1f0f('0x56')](_0x1dfe2c['query'][_0x1f0f('0x56')]);_0x2efff2[_0x1f0f('0x57')]=qs[_0x1f0f('0x58')](_[_0x1f0f('0x59')](_0x1dfe2c['query'],_0x4f30cb[_0x1f0f('0x58')]));_0x2efff2[_0x1f0f('0x57')][_0x1f0f('0xcc')]=_0x51950f['id'];if(_0x1dfe2c[_0x1f0f('0x4f')]['filter']){_0x2efff2[_0x1f0f('0x57')]=_['merge'](_0x2efff2['where'],{'$or':_['map'](_0x2efff2[_0x1f0f('0x51')],function(_0x5a2ec1){var _0x3d22ed={};_0x3d22ed[_0x5a2ec1]={'$like':'%'+_0x1dfe2c[_0x1f0f('0x4f')][_0x1f0f('0x3b')]+'%'};return _0x3d22ed;})});}_0x2efff2=_[_0x1f0f('0x5a')]({},_0x2efff2,_0x1dfe2c[_0x1f0f('0xbd')]);return db['VoiceRecording'][_0x1f0f('0x5f')]({'where':_0x2efff2[_0x1f0f('0x57')]})[_0x1f0f('0x20')](function(_0x124024){_0x1b8ec1['count']=_0x124024;if(_0x1dfe2c[_0x1f0f('0x4f')][_0x1f0f('0x60')]){_0x2efff2[_0x1f0f('0x61')]=[{'all':!![]}];}return db[_0x1f0f('0xcb')][_0x1f0f('0xaa')](_0x2efff2);})['then'](function(_0x36b4d5){_0x1b8ec1[_0x1f0f('0x62')]=_0x36b4d5;return _0x1b8ec1;});}})[_0x1f0f('0x20')](respondWithFilteredResult(_0x53ff96,_0x2efff2))[_0x1f0f('0x2a')](handleError(_0x53ff96,null));};exports[_0x1f0f('0xcd')]=function(_0x2bdfaa,_0x3700f9,_0x55ab9b){var _0x2a7571={'raw':!![],'where':{}};var _0x2ceac4={};var _0x4cee55={'count':0x0,'rows':[]};return db[_0x1f0f('0x46')]['findOne']({'where':{'id':_0x2bdfaa[_0x1f0f('0x63')]['id']}})[_0x1f0f('0x20')](handleEntityNotFound(_0x3700f9,null))['then'](function(_0x2eddc4){if(_0x2eddc4){_0x2ceac4['model']=_['keys'](db[_0x1f0f('0xce')][_0x1f0f('0x47')]);_0x2ceac4[_0x1f0f('0x4f')]=_[_0x1f0f('0x50')](_0x2bdfaa['query']);_0x2ceac4['filters']=_[_0x1f0f('0x64')](_0x2ceac4[_0x1f0f('0x4b')],_0x2ceac4[_0x1f0f('0x4f')]);_0x2a7571[_0x1f0f('0x51')]=_[_0x1f0f('0x64')](_0x2ceac4[_0x1f0f('0x4b')],qs[_0x1f0f('0x52')](_0x2bdfaa[_0x1f0f('0x4f')][_0x1f0f('0x52')]));_0x2a7571[_0x1f0f('0x51')]=_0x2a7571['attributes']['length']?_0x2a7571[_0x1f0f('0x51')]:_0x2ceac4['model'];if(!_0x2bdfaa[_0x1f0f('0x4f')][_0x1f0f('0x54')](_0x1f0f('0xc3'))){_0x2a7571[_0x1f0f('0x2f')]=qs[_0x1f0f('0x2f')](_0x2bdfaa[_0x1f0f('0x4f')][_0x1f0f('0x2f')]);_0x2a7571[_0x1f0f('0x2e')]=qs['offset'](_0x2bdfaa[_0x1f0f('0x4f')]['offset']);}_0x2a7571[_0x1f0f('0x55')]=qs[_0x1f0f('0x56')](_0x2bdfaa[_0x1f0f('0x4f')][_0x1f0f('0x56')]);_0x2a7571[_0x1f0f('0x57')]=qs['filters'](_['pick'](_0x2bdfaa['query'],_0x2ceac4[_0x1f0f('0x58')]));_0x2a7571[_0x1f0f('0x57')][_0x1f0f('0xcc')]=_0x2eddc4['id'];if(_0x2bdfaa[_0x1f0f('0x4f')][_0x1f0f('0x3b')]){_0x2a7571['where']=_[_0x1f0f('0x5a')](_0x2a7571['where'],{'$or':_[_0x1f0f('0x3d')](_0x2a7571[_0x1f0f('0x51')],function(_0x5a8518){var _0x18be84={};_0x18be84[_0x5a8518]={'$like':'%'+_0x2bdfaa['query']['filter']+'%'};return _0x18be84;})});}_0x2a7571=_['merge']({},_0x2a7571,_0x2bdfaa[_0x1f0f('0xbd')]);return db[_0x1f0f('0xce')][_0x1f0f('0x5f')]({'where':_0x2a7571['where']})[_0x1f0f('0x20')](function(_0x346a4b){_0x4cee55[_0x1f0f('0x5f')]=_0x346a4b;if(_0x2bdfaa[_0x1f0f('0x4f')]['includeAll']){_0x2a7571[_0x1f0f('0x61')]=[{'all':!![]}];}return db[_0x1f0f('0xce')]['findAll'](_0x2a7571);})[_0x1f0f('0x20')](function(_0x2bcb52){_0x4cee55[_0x1f0f('0x62')]=_0x2bcb52;return _0x4cee55;});}})[_0x1f0f('0x20')](respondWithFilteredResult(_0x3700f9,_0x2a7571))['catch'](handleError(_0x3700f9,null));};exports[_0x1f0f('0xcf')]=function(_0x55eb01,_0x23c8a9,_0x286d70){var _0x48d7ea={};var _0x437f63={};var _0x49bdee;var _0x4b7a58;return db[_0x1f0f('0x46')][_0x1f0f('0x8f')]({'where':{'id':_0x55eb01[_0x1f0f('0x63')]['id']}})[_0x1f0f('0x20')](handleEntityNotFound(_0x23c8a9,null))['then'](function(_0x2af6d1){if(_0x2af6d1){_0x49bdee=_0x2af6d1;_0x437f63[_0x1f0f('0x4b')]=_[_0x1f0f('0x50')](db[_0x1f0f('0xd0')][_0x1f0f('0x47')]);_0x437f63[_0x1f0f('0x4f')]=_['keys'](_0x55eb01[_0x1f0f('0x4f')]);_0x437f63['filters']=_[_0x1f0f('0x64')](_0x437f63['model'],_0x437f63['query']);_0x48d7ea[_0x1f0f('0x51')]=_[_0x1f0f('0x64')](_0x437f63[_0x1f0f('0x4b')],qs[_0x1f0f('0x52')](_0x55eb01[_0x1f0f('0x4f')]['fields']));_0x48d7ea['attributes']=_0x48d7ea['attributes'][_0x1f0f('0x53')]?_0x48d7ea[_0x1f0f('0x51')]:_0x437f63['model'];_0x48d7ea[_0x1f0f('0x55')]=qs[_0x1f0f('0x56')](_0x55eb01[_0x1f0f('0x4f')][_0x1f0f('0x56')]);_0x48d7ea[_0x1f0f('0x57')]=qs['filters'](_['pick'](_0x55eb01[_0x1f0f('0x4f')],_0x437f63[_0x1f0f('0x58')]));if(_0x55eb01[_0x1f0f('0x4f')][_0x1f0f('0x3b')]){_0x48d7ea['where']=_['merge'](_0x48d7ea[_0x1f0f('0x57')],{'$or':_[_0x1f0f('0x3d')](_0x48d7ea['attributes'],function(_0x320e57){var _0x5c53d5={};_0x5c53d5[_0x320e57]={'$like':'%'+_0x55eb01[_0x1f0f('0x4f')][_0x1f0f('0x3b')]+'%'};return _0x5c53d5;})});}_0x48d7ea=_[_0x1f0f('0x5a')]({},_0x48d7ea,_0x55eb01[_0x1f0f('0xbd')]);return _0x49bdee['getChatInteractions'](_0x48d7ea);}})[_0x1f0f('0x20')](function(_0x23de74){if(_0x23de74){_0x4b7a58=_0x23de74[_0x1f0f('0x53')];if(!_0x55eb01['query']['hasOwnProperty'](_0x1f0f('0xc3'))){_0x48d7ea[_0x1f0f('0x2f')]=qs['limit'](_0x55eb01[_0x1f0f('0x4f')][_0x1f0f('0x2f')]);_0x48d7ea['offset']=qs['offset'](_0x55eb01[_0x1f0f('0x4f')]['offset']);}return _0x49bdee['getChatInteractions'](_0x48d7ea);}})[_0x1f0f('0x20')](function(_0x4df28d){if(_0x4df28d){return _0x4df28d?{'count':_0x4b7a58,'rows':_0x4df28d}:null;}})[_0x1f0f('0x20')](respondWithResult(_0x23c8a9,null))['catch'](handleError(_0x23c8a9,null));};exports[_0x1f0f('0xd1')]=function(_0x4c9eb9,_0x4ded78,_0x2be563){var _0x539489={};var _0x294de8={};var _0x2afced;var _0x5859c4;return db[_0x1f0f('0x46')]['findOne']({'where':{'id':_0x4c9eb9[_0x1f0f('0x63')]['id']}})[_0x1f0f('0x20')](handleEntityNotFound(_0x4ded78,null))['then'](function(_0x3a9fb3){if(_0x3a9fb3){_0x2afced=_0x3a9fb3;_0x294de8['model']=_[_0x1f0f('0x50')](db[_0x1f0f('0xd2')][_0x1f0f('0x47')]);_0x294de8[_0x1f0f('0x4f')]=_['keys'](_0x4c9eb9[_0x1f0f('0x4f')]);_0x294de8['filters']=_['intersection'](_0x294de8['model'],_0x294de8[_0x1f0f('0x4f')]);_0x539489[_0x1f0f('0x51')]=_[_0x1f0f('0x64')](_0x294de8[_0x1f0f('0x4b')],qs[_0x1f0f('0x52')](_0x4c9eb9['query'][_0x1f0f('0x52')]));_0x539489['attributes']=_0x539489[_0x1f0f('0x51')][_0x1f0f('0x53')]?_0x539489[_0x1f0f('0x51')]:_0x294de8[_0x1f0f('0x4b')];_0x539489[_0x1f0f('0x55')]=qs[_0x1f0f('0x56')](_0x4c9eb9[_0x1f0f('0x4f')]['sort']);_0x539489[_0x1f0f('0x57')]=qs['filters'](_[_0x1f0f('0x59')](_0x4c9eb9[_0x1f0f('0x4f')],_0x294de8[_0x1f0f('0x58')]));if(_0x4c9eb9['query'][_0x1f0f('0x3b')]){_0x539489[_0x1f0f('0x57')]=_[_0x1f0f('0x5a')](_0x539489[_0x1f0f('0x57')],{'$or':_['map'](_0x539489['attributes'],function(_0x43d9c2){var _0x21866f={};_0x21866f[_0x43d9c2]={'$like':'%'+_0x4c9eb9['query'][_0x1f0f('0x3b')]+'%'};return _0x21866f;})});}_0x539489=_['merge']({},_0x539489,_0x4c9eb9[_0x1f0f('0xbd')]);return _0x2afced[_0x1f0f('0xd1')](_0x539489);}})[_0x1f0f('0x20')](function(_0x2f9a41){if(_0x2f9a41){_0x5859c4=_0x2f9a41['length'];if(!_0x4c9eb9[_0x1f0f('0x4f')]['hasOwnProperty'](_0x1f0f('0xc3'))){_0x539489[_0x1f0f('0x2f')]=qs['limit'](_0x4c9eb9['query'][_0x1f0f('0x2f')]);_0x539489[_0x1f0f('0x2e')]=qs['offset'](_0x4c9eb9['query']['offset']);}return _0x2afced[_0x1f0f('0xd1')](_0x539489);}})[_0x1f0f('0x20')](function(_0xee3d86){if(_0xee3d86){return _0xee3d86?{'count':_0x5859c4,'rows':_0xee3d86}:null;}})[_0x1f0f('0x20')](respondWithResult(_0x4ded78,null))['catch'](handleError(_0x4ded78,null));};exports[_0x1f0f('0xd3')]=function(_0x2e0cb6,_0x14ce61,_0x1fe0ec){var _0x289b22={'raw':!![],'where':{}};var _0x15662f={};var _0x490a66={'count':0x0,'rows':[]};return db[_0x1f0f('0x46')][_0x1f0f('0x8f')]({'where':{'id':_0x2e0cb6[_0x1f0f('0x63')]['id']}})[_0x1f0f('0x20')](handleEntityNotFound(_0x14ce61,null))['then'](function(_0x9c487b){if(_0x9c487b){_0x15662f[_0x1f0f('0x4b')]=_[_0x1f0f('0x50')](db[_0x1f0f('0xd4')][_0x1f0f('0x47')]);_0x15662f[_0x1f0f('0x4f')]=_[_0x1f0f('0x50')](_0x2e0cb6[_0x1f0f('0x4f')]);_0x15662f[_0x1f0f('0x58')]=_[_0x1f0f('0x64')](_0x15662f[_0x1f0f('0x4b')],_0x15662f[_0x1f0f('0x4f')]);_0x289b22[_0x1f0f('0x51')]=_[_0x1f0f('0x64')](_0x15662f[_0x1f0f('0x4b')],qs[_0x1f0f('0x52')](_0x2e0cb6[_0x1f0f('0x4f')][_0x1f0f('0x52')]));_0x289b22[_0x1f0f('0x51')]=_0x289b22[_0x1f0f('0x51')][_0x1f0f('0x53')]?_0x289b22['attributes']:_0x15662f[_0x1f0f('0x4b')];if(!_0x2e0cb6[_0x1f0f('0x4f')][_0x1f0f('0x54')](_0x1f0f('0xc3'))){_0x289b22[_0x1f0f('0x2f')]=qs['limit'](_0x2e0cb6['query'][_0x1f0f('0x2f')]);_0x289b22[_0x1f0f('0x2e')]=qs['offset'](_0x2e0cb6[_0x1f0f('0x4f')]['offset']);}_0x289b22['order']=qs[_0x1f0f('0x56')](_0x2e0cb6[_0x1f0f('0x4f')][_0x1f0f('0x56')]);_0x289b22[_0x1f0f('0x57')]=qs[_0x1f0f('0x58')](_['pick'](_0x2e0cb6[_0x1f0f('0x4f')],_0x15662f[_0x1f0f('0x58')]));_0x289b22[_0x1f0f('0x57')][_0x1f0f('0xcc')]=_0x9c487b['id'];if(_0x2e0cb6['query'][_0x1f0f('0x3b')]){_0x289b22[_0x1f0f('0x57')]=_[_0x1f0f('0x5a')](_0x289b22['where'],{'$or':_[_0x1f0f('0x3d')](_0x289b22[_0x1f0f('0x51')],function(_0x1fe3b8){var _0x28a441={};_0x28a441[_0x1fe3b8]={'$like':'%'+_0x2e0cb6[_0x1f0f('0x4f')][_0x1f0f('0x3b')]+'%'};return _0x28a441;})});}_0x289b22=_[_0x1f0f('0x5a')]({},_0x289b22,_0x2e0cb6[_0x1f0f('0xbd')]);return db[_0x1f0f('0xd4')][_0x1f0f('0x5f')]({'where':_0x289b22['where']})['then'](function(_0xb8021c){_0x490a66[_0x1f0f('0x5f')]=_0xb8021c;if(_0x2e0cb6[_0x1f0f('0x4f')]['includeAll']){_0x289b22[_0x1f0f('0x61')]=[{'all':!![]}];}return db[_0x1f0f('0xd4')]['findAll'](_0x289b22);})['then'](function(_0x4087ea){_0x490a66['rows']=_0x4087ea;return _0x490a66;});}})['then'](respondWithFilteredResult(_0x14ce61,_0x289b22))[_0x1f0f('0x2a')](handleError(_0x14ce61,null));};exports[_0x1f0f('0xd5')]=function(_0x4fe40c,_0x2a7e61,_0xea2a1e){var _0x44ddc5={};var _0x238377={};var _0x19a728;var _0x571f9a;return db[_0x1f0f('0x46')]['findOne']({'where':{'id':_0x4fe40c[_0x1f0f('0x63')]['id']}})[_0x1f0f('0x20')](handleEntityNotFound(_0x2a7e61,null))[_0x1f0f('0x20')](function(_0x1907c9){if(_0x1907c9){_0x19a728=_0x1907c9;_0x238377[_0x1f0f('0x4b')]=_[_0x1f0f('0x50')](db[_0x1f0f('0xd6')][_0x1f0f('0x47')]);_0x238377['query']=_['keys'](_0x4fe40c[_0x1f0f('0x4f')]);_0x238377[_0x1f0f('0x58')]=_['intersection'](_0x238377[_0x1f0f('0x4b')],_0x238377[_0x1f0f('0x4f')]);_0x44ddc5[_0x1f0f('0x51')]=_[_0x1f0f('0x64')](_0x238377[_0x1f0f('0x4b')],qs[_0x1f0f('0x52')](_0x4fe40c['query'][_0x1f0f('0x52')]));_0x44ddc5['attributes']=_0x44ddc5[_0x1f0f('0x51')][_0x1f0f('0x53')]?_0x44ddc5[_0x1f0f('0x51')]:_0x238377[_0x1f0f('0x4b')];_0x44ddc5[_0x1f0f('0x55')]=qs[_0x1f0f('0x56')](_0x4fe40c[_0x1f0f('0x4f')][_0x1f0f('0x56')]);_0x44ddc5['where']=qs[_0x1f0f('0x58')](_['pick'](_0x4fe40c[_0x1f0f('0x4f')],_0x238377['filters']));if(_0x4fe40c['query'][_0x1f0f('0x3b')]){_0x44ddc5[_0x1f0f('0x57')]=_[_0x1f0f('0x5a')](_0x44ddc5[_0x1f0f('0x57')],{'$or':_[_0x1f0f('0x3d')](_0x44ddc5[_0x1f0f('0x51')],function(_0x101638){var _0x1f551={};_0x1f551[_0x101638]={'$like':'%'+_0x4fe40c[_0x1f0f('0x4f')][_0x1f0f('0x3b')]+'%'};return _0x1f551;})});}_0x44ddc5=_[_0x1f0f('0x5a')]({},_0x44ddc5,_0x4fe40c['options']);return _0x19a728[_0x1f0f('0xd5')](_0x44ddc5);}})[_0x1f0f('0x20')](function(_0x4c2100){if(_0x4c2100){_0x571f9a=_0x4c2100[_0x1f0f('0x53')];if(!_0x4fe40c[_0x1f0f('0x4f')][_0x1f0f('0x54')](_0x1f0f('0xc3'))){_0x44ddc5[_0x1f0f('0x2f')]=qs[_0x1f0f('0x2f')](_0x4fe40c[_0x1f0f('0x4f')][_0x1f0f('0x2f')]);_0x44ddc5[_0x1f0f('0x2e')]=qs[_0x1f0f('0x2e')](_0x4fe40c[_0x1f0f('0x4f')][_0x1f0f('0x2e')]);}return _0x19a728[_0x1f0f('0xd5')](_0x44ddc5);}})[_0x1f0f('0x20')](function(_0xfb2f68){if(_0xfb2f68){return _0xfb2f68?{'count':_0x571f9a,'rows':_0xfb2f68}:null;}})[_0x1f0f('0x20')](respondWithResult(_0x2a7e61,null))[_0x1f0f('0x2a')](handleError(_0x2a7e61,null));};exports[_0x1f0f('0xd7')]=function(_0xa18deb,_0x537b75,_0x12f271){var _0x8647a4={};var _0x13240f={};var _0x4f2480;var _0x48aefc;return db[_0x1f0f('0x46')][_0x1f0f('0x8f')]({'where':{'id':_0xa18deb[_0x1f0f('0x63')]['id']}})[_0x1f0f('0x20')](handleEntityNotFound(_0x537b75,null))[_0x1f0f('0x20')](function(_0x2a9228){if(_0x2a9228){_0x4f2480=_0x2a9228;_0x13240f[_0x1f0f('0x4b')]=_[_0x1f0f('0x50')](db[_0x1f0f('0xd8')]['rawAttributes']);_0x13240f[_0x1f0f('0x4f')]=_[_0x1f0f('0x50')](_0xa18deb[_0x1f0f('0x4f')]);_0x13240f[_0x1f0f('0x58')]=_[_0x1f0f('0x64')](_0x13240f[_0x1f0f('0x4b')],_0x13240f[_0x1f0f('0x4f')]);_0x8647a4[_0x1f0f('0x51')]=_[_0x1f0f('0x64')](_0x13240f[_0x1f0f('0x4b')],qs[_0x1f0f('0x52')](_0xa18deb['query']['fields']));_0x8647a4[_0x1f0f('0x51')]=_0x8647a4[_0x1f0f('0x51')][_0x1f0f('0x53')]?_0x8647a4[_0x1f0f('0x51')]:_0x13240f[_0x1f0f('0x4b')];_0x8647a4[_0x1f0f('0x55')]=qs[_0x1f0f('0x56')](_0xa18deb[_0x1f0f('0x4f')][_0x1f0f('0x56')]);_0x8647a4[_0x1f0f('0x57')]=qs[_0x1f0f('0x58')](_[_0x1f0f('0x59')](_0xa18deb[_0x1f0f('0x4f')],_0x13240f[_0x1f0f('0x58')]));if(_0xa18deb[_0x1f0f('0x4f')]['filter']){_0x8647a4[_0x1f0f('0x57')]=_[_0x1f0f('0x5a')](_0x8647a4[_0x1f0f('0x57')],{'$or':_[_0x1f0f('0x3d')](_0x8647a4[_0x1f0f('0x51')],function(_0x4e4688){var _0x216846={};_0x216846[_0x4e4688]={'$like':'%'+_0xa18deb[_0x1f0f('0x4f')][_0x1f0f('0x3b')]+'%'};return _0x216846;})});}_0x8647a4=_[_0x1f0f('0x5a')]({},_0x8647a4,_0xa18deb[_0x1f0f('0xbd')]);return _0x4f2480['getFaxInteractions'](_0x8647a4);}})[_0x1f0f('0x20')](function(_0x3700a1){if(_0x3700a1){_0x48aefc=_0x3700a1[_0x1f0f('0x53')];if(!_0xa18deb['query'][_0x1f0f('0x54')](_0x1f0f('0xc3'))){_0x8647a4[_0x1f0f('0x2f')]=qs[_0x1f0f('0x2f')](_0xa18deb[_0x1f0f('0x4f')]['limit']);_0x8647a4[_0x1f0f('0x2e')]=qs['offset'](_0xa18deb[_0x1f0f('0x4f')][_0x1f0f('0x2e')]);}return _0x4f2480[_0x1f0f('0xd7')](_0x8647a4);}})['then'](function(_0x5b6dd5){if(_0x5b6dd5){return _0x5b6dd5?{'count':_0x48aefc,'rows':_0x5b6dd5}:null;}})[_0x1f0f('0x20')](respondWithResult(_0x537b75,null))['catch'](handleError(_0x537b75,null));};exports['login']=function(_0x3d4166,_0x159ae1,_0x4f464e){var _0x2cedc1;var _0x745d9b;var _0x2f8660;var _0x4d70ba=!_[_0x1f0f('0x71')](_0x3d4166[_0x1f0f('0x63')]['id'])?_0x3d4166[_0x1f0f('0x63')]['id']:!_[_0x1f0f('0x71')](_0x3d4166['user']['id'])?_0x3d4166[_0x1f0f('0x37')]['id']:null;return db[_0x1f0f('0x46')]['find']({'where':{'id':_0x4d70ba,'role':{'$or':['admin','user',_0x1f0f('0x6a')]}},'attributes':['id',_0x1f0f('0x42'),_0x1f0f('0xd9'),_0x1f0f('0xda'),'role',_0x1f0f('0x74'),_0x1f0f('0x9c')]})[_0x1f0f('0x20')](function(_0x39d922){if(_0x39d922){if(_0x39d922[_0x1f0f('0x40')]===_0x1f0f('0x6a')){_0x2cedc1=_0x39d922;if(_0x3d4166[_0x1f0f('0x66')][_0x1f0f('0xad')]){_0x2f8660=util[_0x1f0f('0xdb')](_0x1f0f('0xdc'),_0x2cedc1[_0x3d4166[_0x1f0f('0x66')][_0x1f0f('0xad')]]);}else if(_0x3d4166[_0x1f0f('0x66')][_0x1f0f('0xdd')]){_0x2f8660=util['format'](_0x1f0f('0xac'),_0x3d4166['body']['intrf']);}else{_0x2f8660=util[_0x1f0f('0xdb')]('SIP/%s',_0x2cedc1[_0x1f0f('0x42')]);}socket['to'](util[_0x1f0f('0xdb')](_0x1f0f('0xde'),_0x2cedc1[_0x1f0f('0x42')]))[_0x1f0f('0xa6')](_0x1f0f('0xdf'),{'ip':_0x3d4166[_0x1f0f('0xe0')][_0x1f0f('0xe1')]||_0x3d4166['connection'][_0x1f0f('0xe2')]||_0x3d4166[_0x1f0f('0xe3')][_0x1f0f('0xe2')]||_0x3d4166[_0x1f0f('0xe4')][_0x1f0f('0xe3')][_0x1f0f('0xe2')]});return db[_0x1f0f('0xb1')][_0x1f0f('0x35')]({'where':{'membername':_0x2cedc1[_0x1f0f('0x42')]},'individualHooks':!![]});}}else{throw new db[(_0x1f0f('0x92'))]['ValidationError'](_0x1f0f('0xe5'));}})['then'](function(){if(_0x2cedc1){return _0x2cedc1['getVoiceQueues']({'raw':!![]});}})[_0x1f0f('0x20')](function(_0x179fa7){if(_0x2cedc1){var _0x2bbc35=[];if(_0x179fa7){_0x745d9b=_0x179fa7;if(_0x745d9b[_0x1f0f('0x53')]){for(var _0x40c30c=0x0;_0x40c30c<_0x745d9b[_0x1f0f('0x53')];_0x40c30c++){_0x2bbc35[_0x1f0f('0xab')]({'membername':_0x2cedc1[_0x1f0f('0x42')],'UserId':_0x2cedc1['id'],'queue_name':_0x745d9b[_0x40c30c][_0x1f0f('0x42')],'VoiceQueueId':_0x745d9b[_0x40c30c]['id'],'interface':_0x2f8660,'paused':_0x2cedc1[_0x1f0f('0x9c')]||![],'penalty':_0x745d9b[_0x40c30c][_0x1f0f('0xe6')]||0x0});}return BPromise[_0x1f0f('0xe7')](_0x2bbc35,function(_0x57bec4){return db[_0x1f0f('0xb1')][_0x1f0f('0xae')](_0x57bec4);});}}}})['then'](function(){if(_0x2cedc1){return db[_0x1f0f('0xe8')]['findAll']({'where':{'membername':_0x2cedc1['name'],'exitAt':null}});}})['then'](function(_0x9ec3f4){if(_0x2cedc1){var _0x3c4694=[];_0x9ec3f4['forEach'](function(_0x23edc8){_0x3c4694[_0x1f0f('0xab')](_0x23edc8['update']({'exitAt':moment()[_0x1f0f('0xdb')](_0x1f0f('0xe9'))}));});return BPromise['all'](_0x3c4694);}})[_0x1f0f('0x20')](function(){if(_0x2cedc1){var _0x2a5b40=[];var _0x155763=[];var _0x2b8a0a=utils[_0x1f0f('0xea')]();var _0x170e55={'membername':_0x2cedc1[_0x1f0f('0x42')],'interface':_0x2f8660,'enterAt':moment()[_0x1f0f('0xdb')](_0x1f0f('0xe9')),'role':_0x2cedc1[_0x1f0f('0x40')],'internal':_0x2cedc1['internal']};_0x2b8a0a[_0x1f0f('0xeb')](function(_0x2eb962){_0x2a5b40['push'](_[_0x1f0f('0x5a')]({'channel':_0x2eb962,'type':_0x1f0f('0xec'),'data1':_0x3d4166[_0x1f0f('0x66')][_0x1f0f('0xed')],'data2':_0x2f8660},_0x170e55));if(_0x2cedc1[_0x1f0f('0x9c')]){_0x155763[_0x1f0f('0xab')](_[_0x1f0f('0x5a')]({'channel':_0x2eb962,'type':'PAUSE','data1':_0x1f0f('0xee')},_0x170e55));}});return db[_0x1f0f('0xe8')][_0x1f0f('0x65')](_0x2a5b40[_0x1f0f('0xef')](_0x155763),{'individualHooks':!![]});}})['then'](function(){if(_0x2cedc1){return _0x2cedc1[_0x1f0f('0x34')]({'online':!![],'lastLoginAt':moment()[_0x1f0f('0xdb')]('YYYY-MM-DD\x20HH:mm:ss'),'voicePause':_0x2cedc1[_0x1f0f('0x9c')]||![],'mailPause':_0x2cedc1[_0x1f0f('0x9c')]||![],'chatPause':_0x2cedc1[_0x1f0f('0x9c')]||![],'faxPause':_0x2cedc1[_0x1f0f('0x9c')]||![],'smsPause':_0x2cedc1[_0x1f0f('0x9c')]||![],'openchannelPause':_0x2cedc1[_0x1f0f('0x9c')]||![],'pauseType':_0x2cedc1[_0x1f0f('0x9c')]?_0x1f0f('0xee'):null,'interface':_0x2f8660,'lastPauseAt':moment()[_0x1f0f('0xdb')](_0x1f0f('0xe9'))});}})['then'](function(_0x1ee1b2){if(_0x3d4166[_0x1f0f('0xf0')]){return _0x4f464e();}else{return BPromise[_0x1f0f('0xf1')](_0x1ee1b2)[_0x1f0f('0x20')](respondWithResult(_0x159ae1,null));}})['catch'](handleError(_0x159ae1,null));};exports['logout']=function(_0x45da57,_0x34b854,_0x34b7f5){var _0x3b8dfc;return db[_0x1f0f('0x46')][_0x1f0f('0x41')]({'where':{'id':_0x45da57[_0x1f0f('0x63')]['id'],'role':_0x1f0f('0x6a')},'attributes':['id',_0x1f0f('0x42'),'role']})['then'](handleEntityNotFound(_0x34b854,null))[_0x1f0f('0x20')](function(_0x2190f7){if(_0x2190f7){_0x3b8dfc=_0x2190f7;return db[_0x1f0f('0xb1')][_0x1f0f('0x35')]({'where':{'membername':_0x3b8dfc[_0x1f0f('0x42')]},'individualHooks':!![]});}})[_0x1f0f('0x20')](function(){return db[_0x1f0f('0xe8')][_0x1f0f('0xaa')]({'where':{'membername':_0x3b8dfc[_0x1f0f('0x42')],'exitAt':null}});})['then'](function(_0xfd8641){var _0x1205ef=[];_0xfd8641[_0x1f0f('0xeb')](function(_0x1bf5f8){_0x1205ef[_0x1f0f('0xab')](_0x1bf5f8[_0x1f0f('0x34')]({'exitAt':moment()[_0x1f0f('0xdb')]('YYYY-MM-DD\x20HH:mm:ss')}));});return BPromise[_0x1f0f('0xf2')](_0x1205ef);})[_0x1f0f('0x20')](function(){return _0x3b8dfc[_0x1f0f('0x34')]({'online':![],'lastLoginAt':null,'voicePause':![],'mailPause':![],'chatPause':![],'faxPause':![],'smsPause':![],'openchannelPause':![],'interface':null});})['then'](respondWithResult(_0x34b854,null))[_0x1f0f('0x2a')](handleError(_0x34b854,null));};exports[_0x1f0f('0xf3')]=function(_0x4e2e9d,_0x2e401c,_0x2ea8ab){var _0x1bd78e;return db['UserVoiceQueueRt'][_0x1f0f('0x34')]({'paused':0x1},{'where':{'UserId':_0x4e2e9d[_0x1f0f('0x63')]['id']},'individualHooks':!![]})[_0x1f0f('0x20')](function(){return db[_0x1f0f('0x46')][_0x1f0f('0x41')]({'where':{'id':_0x4e2e9d[_0x1f0f('0x63')]['id'],'role':'agent'},'attributes':['id',_0x1f0f('0x42'),_0x1f0f('0x40'),_0x1f0f('0x74'),_0x1f0f('0xad')]});})[_0x1f0f('0x20')](handleEntityNotFound(_0x2e401c,null))['then'](function(_0x28729d){if(_0x28729d){_0x1bd78e=_0x28729d;return respondWithRpcPromise('QueuePause',_0x1f0f('0xf3'),{'id':_0x1bd78e['id'],'name':_0x1bd78e['name'],'pause':!![]});}})['then'](function(){if(_0x1bd78e){return db[_0x1f0f('0xe8')]['findAll']({'where':{'membername':_0x1bd78e[_0x1f0f('0x42')],'type':'PAUSE','exitAt':null}});}})[_0x1f0f('0x20')](function(_0x289399){if(_0x289399[_0x1f0f('0x53')]){var _0x1ede79=moment()[_0x1f0f('0xdb')](_0x1f0f('0xe9'));for(var _0x382cf9=0x0,_0x4a16ac=_0x289399[_0x1f0f('0x53')];_0x382cf9<_0x4a16ac;_0x382cf9++){_0x289399[_0x382cf9][_0x1f0f('0xf4')]({'exitAt':_0x1ede79});}}})['then'](function(){var _0x4ea9d1=[];var _0x23be51=utils[_0x1f0f('0xea')]();_0x23be51[_0x1f0f('0xeb')](function(_0x293b8a){_0x4ea9d1[_0x1f0f('0xab')]({'channel':_0x293b8a,'membername':_0x1bd78e[_0x1f0f('0x42')],'interface':_[_0x1f0f('0x71')](_0x1bd78e[_0x1f0f('0xad')])?util[_0x1f0f('0xdb')](_0x1f0f('0xac'),_0x1bd78e[_0x1f0f('0x42')]):_0x1bd78e['interface'],'type':_0x1f0f('0xf5'),'enterAt':moment()[_0x1f0f('0xdb')](_0x1f0f('0xe9')),'data1':_0x4e2e9d[_0x1f0f('0x66')][_0x1f0f('0x49')]||_0x1f0f('0xf6'),'role':_0x1bd78e['role'],'internal':_0x1bd78e[_0x1f0f('0x74')]});});return db[_0x1f0f('0xe8')][_0x1f0f('0x65')](_0x4ea9d1,{'individualHooks':!![]});})[_0x1f0f('0x20')](function(){return _0x1bd78e[_0x1f0f('0x34')]({'voicePause':!![],'mailPause':!![],'chatPause':!![],'faxPause':!![],'smsPause':!![],'openchannelPause':!![],'pauseType':_0x4e2e9d[_0x1f0f('0x66')][_0x1f0f('0x49')]||'DEFAULT\x20PAUSE','lastPauseAt':moment()[_0x1f0f('0xdb')]('YYYY-MM-DD\x20HH:mm:ss')});})[_0x1f0f('0x20')](respondWithResult(_0x2e401c,null))[_0x1f0f('0x2a')](handleError(_0x2e401c,null));};exports[_0x1f0f('0xf7')]=function(_0x41c63c,_0x27e9a0,_0x15d212){var _0x34062d;return db['User'][_0x1f0f('0x41')]({'where':{'id':_0x41c63c['params']['id']},'attributes':['id','name',_0x1f0f('0x40'),'voicePause',_0x1f0f('0xf8'),'chatPause',_0x1f0f('0xf9'),_0x1f0f('0xfa'),'smsPause','pauseType',_0x1f0f('0xfb')]})[_0x1f0f('0x20')](handleEntityNotFound(_0x27e9a0,null))[_0x1f0f('0x20')](function(_0x2918a2){if(_0x2918a2){_0x34062d=_0x2918a2;if(_0x41c63c[_0x1f0f('0x66')]['channel']&&!utils[_0x1f0f('0xc5')](_0x41c63c['body']['channel'])){throw new db['Sequelize'][(_0x1f0f('0x1e'))](_0x1f0f('0x9e'));}switch(_0x41c63c[_0x1f0f('0x66')][_0x1f0f('0x9a')]){case _0x1f0f('0xa8'):return respondWithRpcPromise('QueuePause',_0x1f0f('0xf7'),{'id':_0x34062d['id'],'name':_0x34062d[_0x1f0f('0x42')],'pause':![]})[_0x1f0f('0x20')](function(){return db[_0x1f0f('0xb1')][_0x1f0f('0x34')]({'paused':0x0},{'where':{'UserId':_0x34062d['id']},'individualHooks':!![]});})[_0x1f0f('0x20')](function(){return db[_0x1f0f('0xe8')][_0x1f0f('0x41')]({'where':{'channel':_0x41c63c[_0x1f0f('0x66')][_0x1f0f('0x9a')],'membername':_0x34062d[_0x1f0f('0x42')],'type':_0x1f0f('0xf5'),'exitAt':null}});})[_0x1f0f('0x20')](function(_0x75d66){if(_0x75d66){return _0x75d66[_0x1f0f('0x34')]({'exitAt':moment()[_0x1f0f('0xdb')]('YYYY-MM-DD\x20HH:mm:ss'),'data2':_0x1f0f('0xfc')},{'individualHooks':!![]});}return null;})['then'](function(){return _0x34062d[_0x1f0f('0x34')]({'voicePause':![]});});case _0x1f0f('0xfd'):case'chat':case _0x1f0f('0xfe'):case _0x1f0f('0xff'):case _0x1f0f('0x100'):return db['MemberReport'][_0x1f0f('0x41')]({'where':{'channel':_0x41c63c['body']['channel'],'membername':_0x34062d[_0x1f0f('0x42')],'type':'PAUSE','exitAt':null}})[_0x1f0f('0x20')](function(_0x49e695){if(_0x49e695){return _0x49e695[_0x1f0f('0x34')]({'exitAt':moment()[_0x1f0f('0xdb')](_0x1f0f('0xe9')),'data2':_0x1f0f('0xfc')},{'individualHooks':!![]});}return null;})['then'](function(){var _0x281255={};_[_0x1f0f('0x30')](_0x281255,util['format']('%s%s',_0x41c63c['body'][_0x1f0f('0x9a')],'Pause'),![]);return _0x34062d['update'](_0x281255);});default:return respondWithRpcPromise(_0x1f0f('0x101'),_0x1f0f('0xf7'),{'id':_0x34062d['id'],'name':_0x34062d[_0x1f0f('0x42')],'pause':![]})[_0x1f0f('0x20')](function(){return db[_0x1f0f('0xb1')][_0x1f0f('0x34')]({'paused':0x0},{'where':{'UserId':_0x34062d['id']}});})['then'](function(){return db['MemberReport']['findAll']({'where':{'membername':_0x34062d['name'],'type':_0x1f0f('0xf5'),'exitAt':null}});})[_0x1f0f('0x20')](function(_0x4dae0c){var _0x2fdca6=[];_0x4dae0c[_0x1f0f('0xeb')](function(_0x49afc7){_0x2fdca6['push'](_0x49afc7['update']({'exitAt':moment()[_0x1f0f('0xdb')](_0x1f0f('0xe9')),'data2':'manual'}));});return BPromise[_0x1f0f('0xf2')](_0x2fdca6);})['then'](function(){return _0x34062d[_0x1f0f('0x34')]({'voicePause':![],'mailPause':![],'chatPause':![],'faxPause':![],'smsPause':![],'openchannelPause':![]});});}}})[_0x1f0f('0x20')](respondWithResult(_0x27e9a0,null))[_0x1f0f('0x2a')](handleError(_0x27e9a0,null));};exports[_0x1f0f('0x102')]=function(_0x3a69a2,_0x57b805,_0x551c8b){var _0x446e87={};var _0x45e9c9={};var _0x431b7e;var _0x2cc472;return db['User'][_0x1f0f('0x8f')]({'where':{'id':_0x3a69a2[_0x1f0f('0x63')]['id']}})[_0x1f0f('0x20')](handleEntityNotFound(_0x57b805,null))[_0x1f0f('0x20')](function(_0x8ba10a){if(_0x8ba10a){_0x431b7e=_0x8ba10a;_0x45e9c9[_0x1f0f('0x4b')]=_[_0x1f0f('0x50')](db[_0x1f0f('0x103')][_0x1f0f('0x47')]);_0x45e9c9[_0x1f0f('0x4f')]=_[_0x1f0f('0x50')](_0x3a69a2[_0x1f0f('0x4f')]);_0x45e9c9['filters']=_[_0x1f0f('0x64')](_0x45e9c9['model'],_0x45e9c9[_0x1f0f('0x4f')]);_0x446e87[_0x1f0f('0x51')]=_['intersection'](_0x45e9c9[_0x1f0f('0x4b')],qs[_0x1f0f('0x52')](_0x3a69a2[_0x1f0f('0x4f')][_0x1f0f('0x52')]));_0x446e87[_0x1f0f('0x51')]=_0x446e87['attributes'][_0x1f0f('0x53')]?_0x446e87['attributes']:_0x45e9c9[_0x1f0f('0x4b')];_0x446e87['order']=qs['sort'](_0x3a69a2[_0x1f0f('0x4f')][_0x1f0f('0x56')]);_0x446e87[_0x1f0f('0x57')]=qs[_0x1f0f('0x58')](_[_0x1f0f('0x59')](_0x3a69a2[_0x1f0f('0x4f')],_0x45e9c9[_0x1f0f('0x58')]));if(_0x3a69a2['query']['filter']){_0x446e87[_0x1f0f('0x57')]=_[_0x1f0f('0x5a')](_0x446e87['where'],{'$or':_[_0x1f0f('0x3d')](_0x446e87[_0x1f0f('0x51')],function(_0x55a54f){var _0x168920={};_0x168920[_0x55a54f]={'$like':'%'+_0x3a69a2['query'][_0x1f0f('0x3b')]+'%'};return _0x168920;})});}_0x446e87=_[_0x1f0f('0x5a')]({},_0x446e87,_0x3a69a2[_0x1f0f('0xbd')]);return _0x431b7e['getTeams'](_0x446e87);}})[_0x1f0f('0x20')](function(_0xc479a1){if(_0xc479a1){_0x2cc472=_0xc479a1['length'];if(!_0x3a69a2[_0x1f0f('0x4f')][_0x1f0f('0x54')](_0x1f0f('0xc3'))){_0x446e87['limit']=qs[_0x1f0f('0x2f')](_0x3a69a2[_0x1f0f('0x4f')][_0x1f0f('0x2f')]);_0x446e87[_0x1f0f('0x2e')]=qs[_0x1f0f('0x2e')](_0x3a69a2[_0x1f0f('0x4f')][_0x1f0f('0x2e')]);}return _0x431b7e[_0x1f0f('0x102')](_0x446e87);}})[_0x1f0f('0x20')](function(_0x3cfef3){if(_0x3cfef3){return _0x3cfef3?{'count':_0x2cc472,'rows':_0x3cfef3}:null;}})[_0x1f0f('0x20')](respondWithResult(_0x57b805,null))[_0x1f0f('0x2a')](handleError(_0x57b805,null));};exports[_0x1f0f('0x104')]=function(_0x4419c1,_0x2e0b14){return db['User'][_0x1f0f('0x41')]({'where':{'id':_0x4419c1[_0x1f0f('0x63')]['id']}})[_0x1f0f('0x20')](handleEntityNotFound(_0x2e0b14,null))[_0x1f0f('0x20')](function(_0x5ceb45){if(_0x5ceb45){var _0x582e91=_0x5ceb45['get']({'plain':!![]});return _0x5ceb45[_0x1f0f('0x104')](_0x4419c1[_0x1f0f('0x66')][_0x1f0f('0x69')],_[_0x1f0f('0x105')](_0x4419c1[_0x1f0f('0x66')],[_0x1f0f('0x69'),'id'])||{})['then'](function(){for(var _0x102ae7=0x0;_0x102ae7<_0x4419c1['body'][_0x1f0f('0x69')][_0x1f0f('0x53')];_0x102ae7++){var _0x1824a7=[];db[_0x1f0f('0x103')]['findOne']({'where':{'id':_0x4419c1[_0x1f0f('0x66')][_0x1f0f('0x69')][_0x102ae7]}})['then'](function(_0x4ada73){_0x1824a7[_0x1f0f('0xab')](_0x4ada73[_0x1f0f('0x106')]()['then'](function(_0x23c2a0){for(var _0x1b76cc=0x0;_0x1b76cc<_0x23c2a0[_0x1f0f('0x53')];_0x1b76cc++){_0x23c2a0[_0x1b76cc][_0x1f0f('0x107')]('channel',_0x1f0f('0x108'));}return _0x23c2a0;}));_0x1824a7['push'](_0x4ada73['getChatQueues']()[_0x1f0f('0x20')](function(_0x5f3e86){for(var _0x1cac03=0x0;_0x1cac03<_0x5f3e86[_0x1f0f('0x53')];_0x1cac03++){_0x5f3e86[_0x1cac03]['setDataValue'](_0x1f0f('0x9a'),'Chat');}return _0x5f3e86;}));_0x1824a7[_0x1f0f('0xab')](_0x4ada73[_0x1f0f('0x109')]()[_0x1f0f('0x20')](function(_0x683c94){for(var _0x5d6c41=0x0;_0x5d6c41<_0x683c94['length'];_0x5d6c41++){_0x683c94[_0x5d6c41][_0x1f0f('0x107')](_0x1f0f('0x9a'),'Mail');}return _0x683c94;}));_0x1824a7[_0x1f0f('0xab')](_0x4ada73['getSmsQueues']()[_0x1f0f('0x20')](function(_0x439dec){for(var _0x41e042=0x0;_0x41e042<_0x439dec[_0x1f0f('0x53')];_0x41e042++){_0x439dec[_0x41e042][_0x1f0f('0x107')](_0x1f0f('0x9a'),'Sms');}return _0x439dec;}));_0x1824a7[_0x1f0f('0xab')](_0x4ada73[_0x1f0f('0x10a')]()[_0x1f0f('0x20')](function(_0x9dc904){for(var _0x58d6fc=0x0;_0x58d6fc<_0x9dc904[_0x1f0f('0x53')];_0x58d6fc++){_0x9dc904[_0x58d6fc][_0x1f0f('0x107')](_0x1f0f('0x9a'),_0x1f0f('0x10b'));}return _0x9dc904;}));_0x1824a7[_0x1f0f('0xab')](_0x4ada73[_0x1f0f('0x10c')]()[_0x1f0f('0x20')](function(_0x3912ba){for(var _0x733b12=0x0;_0x733b12<_0x3912ba[_0x1f0f('0x53')];_0x733b12++){_0x3912ba[_0x733b12][_0x1f0f('0x107')](_0x1f0f('0x9a'),'Openchannel');}return _0x3912ba;}));return BPromise[_0x1f0f('0xf2')](_0x1824a7);})[_0x1f0f('0x20')](function(_0x434f85){var _0x206193=_[_0x1f0f('0x10d')](_0x434f85);_0x1824a7=[];return db[_0x1f0f('0x5c')][_0x1f0f('0x10e')](function(_0x567570){for(var _0x142862=0x0;_0x142862<_0x206193[_0x1f0f('0x53')];_0x142862++){_0x1824a7[_0x1f0f('0xab')](_0x206193[_0x142862]['addAgent'](_0x582e91['id']),{'transaction':_0x567570});}return BPromise[_0x1f0f('0xf2')](_0x1824a7)[_0x1f0f('0x20')](function(){if(_0x582e91[_0x1f0f('0x9b')]){return BPromise[_0x1f0f('0xe7')](_[_0x1f0f('0x3b')](_0x206193,function(_0x3cf2e8){return _0x3cf2e8[_0x1f0f('0x10f')](_0x1f0f('0x9a'))==='Voice';}),function(_0x123033){return db[_0x1f0f('0xb1')]['upsert']({'membername':_0x582e91[_0x1f0f('0x42')],'UserId':_0x582e91['id'],'queue_name':_0x123033[_0x1f0f('0x42')],'VoiceQueueId':_0x123033['id'],'interface':_[_0x1f0f('0x71')](_0x582e91[_0x1f0f('0xad')])?util['format'](_0x1f0f('0xac'),_0x582e91[_0x1f0f('0x42')]):_0x582e91[_0x1f0f('0xad')],'paused':_0x582e91[_0x1f0f('0x9d')]||![],'penalty':_0x582e91['penalty']},{'transaction':_0x567570});});}else{return;}})[_0x1f0f('0x20')](function(){for(var _0x5478b9=0x0;_0x5478b9<_0x206193[_0x1f0f('0x53')];_0x5478b9++){var _0x481378=_0x206193[_0x5478b9][_0x1f0f('0x10f')](_0x1f0f('0x9a'));var _0x5acddd=_0x481378+_0x1f0f('0xa5');socket['emit']('user'+_0x481378+_0x1f0f('0xa7'),{'UserId':_0x582e91['id'],['queueField']:_0x206193[_0x5478b9]['id']});}});});});}});}})['then'](respondWithStatusCode(_0x2e0b14,null))['catch'](handleError(_0x2e0b14,null));};exports[_0x1f0f('0x110')]=function(_0x1fa8cd,_0xb09183){return db[_0x1f0f('0x46')][_0x1f0f('0x8f')]({'where':{'id':_0x1fa8cd[_0x1f0f('0x63')]['id']}})[_0x1f0f('0x20')](handleEntityNotFound(_0xb09183,null))[_0x1f0f('0x20')](function(_0x8a4457){if(_0x8a4457){var _0x16a377=_0x8a4457['get']({'plain':!![]});var _0x1eea3b=_0x1fa8cd[_0x1f0f('0x4f')][_0x1f0f('0x69')];return _0x8a4457[_0x1f0f('0x110')](_0x1eea3b)['then'](function(){for(var _0x266a47=0x0;_0x266a47<_0x1eea3b[_0x1f0f('0x53')];_0x266a47++){var _0x3f342d=[];db[_0x1f0f('0x103')]['findOne']({'where':{'id':_0x1eea3b[_0x266a47]}})['then'](function(_0x16eb0e){_0x3f342d[_0x1f0f('0xab')](_0x16eb0e[_0x1f0f('0x106')]()[_0x1f0f('0x20')](function(_0x344453){for(var _0x5f026f=0x0;_0x5f026f<_0x344453[_0x1f0f('0x53')];_0x5f026f++){_0x344453[_0x5f026f]['setDataValue'](_0x1f0f('0x9a'),_0x1f0f('0x108'));}return _0x344453;}));_0x3f342d[_0x1f0f('0xab')](_0x16eb0e[_0x1f0f('0x111')]()[_0x1f0f('0x20')](function(_0x527fc6){for(var _0x551386=0x0;_0x551386<_0x527fc6[_0x1f0f('0x53')];_0x551386++){_0x527fc6[_0x551386][_0x1f0f('0x107')](_0x1f0f('0x9a'),_0x1f0f('0x112'));}return _0x527fc6;}));_0x3f342d[_0x1f0f('0xab')](_0x16eb0e[_0x1f0f('0x109')]()[_0x1f0f('0x20')](function(_0x2c643e){for(var _0x3b410e=0x0;_0x3b410e<_0x2c643e[_0x1f0f('0x53')];_0x3b410e++){_0x2c643e[_0x3b410e]['setDataValue'](_0x1f0f('0x9a'),'Mail');}return _0x2c643e;}));_0x3f342d['push'](_0x16eb0e[_0x1f0f('0x113')]()[_0x1f0f('0x20')](function(_0x10b88f){for(var _0x47c885=0x0;_0x47c885<_0x10b88f[_0x1f0f('0x53')];_0x47c885++){_0x10b88f[_0x47c885][_0x1f0f('0x107')](_0x1f0f('0x9a'),_0x1f0f('0x114'));}return _0x10b88f;}));_0x3f342d['push'](_0x16eb0e[_0x1f0f('0x10a')]()[_0x1f0f('0x20')](function(_0x542f0a){for(var _0x51481a=0x0;_0x51481a<_0x542f0a['length'];_0x51481a++){_0x542f0a[_0x51481a][_0x1f0f('0x107')](_0x1f0f('0x9a'),_0x1f0f('0x10b'));}return _0x542f0a;}));_0x3f342d[_0x1f0f('0xab')](_0x16eb0e[_0x1f0f('0x10c')]()[_0x1f0f('0x20')](function(_0xfb6fd5){for(var _0x5692eb=0x0;_0x5692eb<_0xfb6fd5[_0x1f0f('0x53')];_0x5692eb++){_0xfb6fd5[_0x5692eb][_0x1f0f('0x107')](_0x1f0f('0x9a'),_0x1f0f('0x115'));}return _0xfb6fd5;}));return BPromise[_0x1f0f('0xf2')](_0x3f342d);})[_0x1f0f('0x20')](function(_0xd76ea4){var _0x2010a8=_[_0x1f0f('0x10d')](_0xd76ea4);_0x3f342d=[];return db['sequelize']['transaction'](function(_0x777c9b){for(var _0x545e10=0x0;_0x545e10<_0x2010a8[_0x1f0f('0x53')];_0x545e10++){_0x3f342d[_0x1f0f('0xab')](_0x2010a8[_0x545e10][_0x1f0f('0x116')](_0x16a377['id']),{'transaction':_0x777c9b});}return BPromise[_0x1f0f('0xf2')](_0x3f342d)[_0x1f0f('0x20')](function(){if(_0x16a377[_0x1f0f('0x9b')]){return BPromise[_0x1f0f('0xe7')](_['filter'](_0x2010a8,function(_0xf3d1a7){return _0xf3d1a7[_0x1f0f('0x10f')](_0x1f0f('0x9a'))===_0x1f0f('0x108');}),function(_0x32d01e){return db[_0x1f0f('0xb1')][_0x1f0f('0x35')]({'where':{'VoiceQueueId':_0x32d01e['id'],'UserId':_0x16a377['id']},'transaction':_0x777c9b});});}else{return;}})[_0x1f0f('0x20')](function(){for(var _0x478a99=0x0;_0x478a99<_0x2010a8[_0x1f0f('0x53')];_0x478a99++){var _0x199ddb=_0x2010a8[_0x478a99][_0x1f0f('0x10f')]('channel');var _0x42fee5=_0x199ddb+_0x1f0f('0xa5');socket['emit'](_0x1f0f('0x37')+_0x199ddb+'Queue:remove',{'UserId':_0x16a377['id'],['queueField']:_0x2010a8[_0x478a99]['id']});}});});});}});}})['then'](respondWithStatusCode(_0xb09183,null))['catch'](handleError(_0xb09183,null));};exports[_0x1f0f('0x117')]=function(_0x32e621,_0x486d48,_0x4de71a){var _0x191a4c={};var _0x5486b1={};var _0x4255a6;var _0x51d958;return db['User'][_0x1f0f('0x8f')]({'where':{'id':_0x32e621['params']['id']}})[_0x1f0f('0x20')](handleEntityNotFound(_0x486d48,null))[_0x1f0f('0x20')](function(_0x288576){if(_0x288576){_0x4255a6=_0x288576;_0x5486b1[_0x1f0f('0x4b')]=_[_0x1f0f('0x50')](db[_0x1f0f('0xbe')][_0x1f0f('0x47')]);_0x5486b1[_0x1f0f('0x4f')]=_[_0x1f0f('0x50')](_0x32e621[_0x1f0f('0x4f')]);_0x5486b1['filters']=_[_0x1f0f('0x64')](_0x5486b1[_0x1f0f('0x4b')],_0x5486b1[_0x1f0f('0x4f')]);_0x191a4c[_0x1f0f('0x51')]=_[_0x1f0f('0x64')](_0x5486b1['model'],qs[_0x1f0f('0x52')](_0x32e621[_0x1f0f('0x4f')]['fields']));_0x191a4c['attributes']=_0x191a4c[_0x1f0f('0x51')][_0x1f0f('0x53')]?_0x191a4c['attributes']:_0x5486b1['model'];_0x191a4c[_0x1f0f('0x55')]=qs[_0x1f0f('0x56')](_0x32e621[_0x1f0f('0x4f')]['sort']);_0x191a4c[_0x1f0f('0x57')]=qs[_0x1f0f('0x58')](_[_0x1f0f('0x59')](_0x32e621['query'],_0x5486b1[_0x1f0f('0x58')]));if(_0x32e621[_0x1f0f('0x4f')][_0x1f0f('0x3b')]){_0x191a4c[_0x1f0f('0x57')]=_[_0x1f0f('0x5a')](_0x191a4c['where'],{'$or':_[_0x1f0f('0x3d')](_0x191a4c[_0x1f0f('0x51')],function(_0x56a824){var _0xebfac0={};_0xebfac0[_0x56a824]={'$like':'%'+_0x32e621['query'][_0x1f0f('0x3b')]+'%'};return _0xebfac0;})});}_0x191a4c=_['merge']({},_0x191a4c,_0x32e621[_0x1f0f('0xbd')]);return _0x4255a6[_0x1f0f('0x117')](_0x191a4c);}})[_0x1f0f('0x20')](function(_0x509671){if(_0x509671){_0x51d958=_0x509671[_0x1f0f('0x53')];if(!_0x32e621[_0x1f0f('0x4f')]['hasOwnProperty'](_0x1f0f('0xc3'))){_0x191a4c[_0x1f0f('0x2f')]=qs[_0x1f0f('0x2f')](_0x32e621[_0x1f0f('0x4f')][_0x1f0f('0x2f')]);_0x191a4c[_0x1f0f('0x2e')]=qs['offset'](_0x32e621[_0x1f0f('0x4f')][_0x1f0f('0x2e')]);}return _0x4255a6[_0x1f0f('0x117')](_0x191a4c);}})['then'](function(_0x2c8807){if(_0x2c8807){return _0x2c8807?{'count':_0x51d958,'rows':_0x2c8807}:null;}})['then'](respondWithResult(_0x486d48,null))[_0x1f0f('0x2a')](handleError(_0x486d48,null));};exports[_0x1f0f('0x118')]=function(_0x2cef58,_0x3e2727,_0x4e0f86){var _0x241922={};var _0x1c08c0={};var _0x1595fe;var _0x4c62a2;return db[_0x1f0f('0x46')][_0x1f0f('0x8f')]({'where':{'id':_0x2cef58[_0x1f0f('0x63')]['id']}})['then'](handleEntityNotFound(_0x3e2727,null))[_0x1f0f('0x20')](function(_0x360d3a){if(_0x360d3a){_0x1595fe=_0x360d3a;_0x1c08c0[_0x1f0f('0x4b')]=_['keys'](db[_0x1f0f('0x46')][_0x1f0f('0x47')]);_0x1c08c0[_0x1f0f('0x4f')]=_[_0x1f0f('0x50')](_0x2cef58[_0x1f0f('0x4f')]);_0x1c08c0[_0x1f0f('0x58')]=_[_0x1f0f('0x64')](_0x1c08c0[_0x1f0f('0x4b')],_0x1c08c0['query']);_0x241922['attributes']=_[_0x1f0f('0x64')](_0x1c08c0[_0x1f0f('0x4b')],qs['fields'](_0x2cef58[_0x1f0f('0x4f')][_0x1f0f('0x52')]));_0x241922['attributes']=_0x241922[_0x1f0f('0x51')][_0x1f0f('0x53')]?_0x241922[_0x1f0f('0x51')]:_0x1c08c0[_0x1f0f('0x4b')];_0x241922['order']=qs[_0x1f0f('0x56')](_0x2cef58[_0x1f0f('0x4f')][_0x1f0f('0x56')]);_0x241922[_0x1f0f('0x57')]=qs[_0x1f0f('0x58')](_[_0x1f0f('0x59')](_0x2cef58[_0x1f0f('0x4f')],_0x1c08c0[_0x1f0f('0x58')]));if(_0x2cef58['query']['filter']){_0x241922['where']=_['merge'](_0x241922[_0x1f0f('0x57')],{'$or':_[_0x1f0f('0x3d')](_0x241922['attributes'],function(_0x34fba2){var _0x2c8021={};_0x2c8021[_0x34fba2]={'$like':'%'+_0x2cef58[_0x1f0f('0x4f')]['filter']+'%'};return _0x2c8021;})});}_0x241922[_0x1f0f('0x4b')]=db[_0x1f0f('0x46')];_0x241922['as']='Agents';_0x241922=_[_0x1f0f('0x5a')]({},_0x241922,_0x2cef58[_0x1f0f('0xbd')]);return _0x1595fe['getVoiceQueues']({'include':[_0x241922]});}})[_0x1f0f('0x20')](function(_0xf35df5){if(_0xf35df5){var _0x5a715d={},_0x5c9cbf=[],_0x36eeae=0x0;for(var _0x24285d=0x0;_0x24285d<_0xf35df5[_0x1f0f('0x53')];_0x24285d+=0x1){for(var _0x3c7f0e=0x0,_0xa23ea7;_0x3c7f0e<_0xf35df5[_0x24285d][_0x1f0f('0x38')][_0x1f0f('0x53')];_0x3c7f0e+=0x1){_0xa23ea7=_0xf35df5[_0x24285d][_0x1f0f('0x38')][_0x3c7f0e][_0x1f0f('0x8a')]({'plain':!![]});_0x5a715d[_0xa23ea7['id']]=_0xa23ea7;}}_0x5a715d=_[_0x1f0f('0x119')](_0x5a715d);for(var _0x42dbc1=qs[_0x1f0f('0x2e')](_0x2cef58[_0x1f0f('0x4f')][_0x1f0f('0x2e')]);_0x42dbc1<_0x5a715d[_0x1f0f('0x53')]&&_0x5c9cbf['length']=_0x38fc7d[_0x66a7('0x4b')]){throw new Error('Maximum\x20login\x20has\x20been\x20reached');}})['then'](function(){if(_0x2469b4){return db[_0x66a7('0x29')][_0x66a7('0x46')]({'where':{'membername':_0x2469b4[_0x66a7('0x25')]},'individualHooks':!![]});}})[_0x66a7('0xc')](function(){if(_0x2469b4){return _0x2469b4[_0x66a7('0x4c')]({'raw':!![]});}})[_0x66a7('0xc')](function(_0x40eb8d){if(_0x2469b4){if(_0x40eb8d){var _0x256d9c=[];_0xc0ce84=_0x40eb8d;if(_0xc0ce84[_0x66a7('0x2d')]){for(var _0xa05c9c=0x0;_0xa05c9c<_0xc0ce84[_0x66a7('0x2d')];_0xa05c9c++){_0x256d9c[_0x66a7('0x42')](db[_0x66a7('0x29')]['upsert']({'membername':_0x2469b4['name'],'UserId':_0x2469b4['id'],'queue_name':_0xc0ce84[_0xa05c9c][_0x66a7('0x25')],'VoiceQueueId':_0xc0ce84[_0xa05c9c]['id'],'interface':_0x485680,'paused':_0x2469b4['loginInPause']||![],'penalty':_0xc0ce84[_0xa05c9c][_0x66a7('0x4d')]||0x0}));}return BPromise['all'](_0x256d9c);}}}})['then'](function(){if(_0x2469b4){return db[_0x66a7('0x2b')][_0x66a7('0x17')]({'where':{'membername':_0x2469b4['name'],'exitAt':null}});}})[_0x66a7('0xc')](function(_0x536970){if(_0x2469b4){if(_0x536970&&_0x536970[_0x66a7('0x2d')]){var _0x59ab67=[];_0x536970[_0x66a7('0x31')](function(_0x4c4eb9){_0x59ab67[_0x66a7('0x42')](_0x4c4eb9['update']({'exitAt':moment()[_0x66a7('0x2e')]('YYYY-MM-DD\x20HH:mm:ss')}));});return BPromise[_0x66a7('0x43')](_0x59ab67);}}})[_0x66a7('0xc')](function(_0x1fd23f){if(_0x2469b4){var _0x20700b=[];var _0xd12191=[];var _0x4b4f4b=utils['getChannels']();var _0x20bebb={'membername':_0x2469b4[_0x66a7('0x25')],'interface':_0x485680,'enterAt':moment()[_0x66a7('0x2e')]('YYYY-MM-DD\x20HH:mm:ss'),'role':_0x2469b4[_0x66a7('0x26')],'internal':_0x2469b4[_0x66a7('0x27')]};_0x4b4f4b['forEach'](function(_0x21b8f5){_0x20700b['push'](_['merge']({'channel':_0x21b8f5,'type':_0x66a7('0x4e'),'data1':_0x66a7('0x4f'),'data2':_0x485680},_0x20bebb));if(_0x2469b4[_0x66a7('0x50')]){_0xd12191[_0x66a7('0x42')](_[_0x66a7('0x51')]({'channel':_0x21b8f5,'type':_0x66a7('0x2c'),'data1':_0x66a7('0x52')},_0x20bebb));}});return db[_0x66a7('0x2b')][_0x66a7('0x39')](_0x20700b[_0x66a7('0x53')](_0xd12191),{'individualHooks':!![]});}})[_0x66a7('0xc')](function(){if(_0x2469b4){return _0x2469b4[_0x66a7('0x2a')]({'online':!![],'lastLoginAt':moment()[_0x66a7('0x2e')](_0x66a7('0x34')),'voicePause':_0x2469b4[_0x66a7('0x50')]||![],'mailPause':_0x2469b4[_0x66a7('0x50')]||![],'chatPause':_0x2469b4[_0x66a7('0x50')]||![],'faxPause':_0x2469b4[_0x66a7('0x50')]||![],'smsPause':_0x2469b4[_0x66a7('0x50')]||![],'openchannelPause':_0x2469b4['loginInPause']||![],'pauseType':_0x2469b4[_0x66a7('0x50')]?_0x66a7('0x52'):null,'lastPauseAt':moment()['format']('YYYY-MM-DD\x20HH:mm:ss'),'interface':_0x485680});}})['then'](function(_0x24cb7b){_0x250a68(_0x24cb7b);})['catch'](function(_0x2592e3){_0x200f80(_0x5bca42[_0x66a7('0x10')](0x1f4,_0x2592e3[_0x66a7('0x13')]));});});};
\ No newline at end of file
+var _0xa302=['find','name','internal','interface','UserVoiceQueueRt','MemberReport','PAUSE','length','format','YYYY-MM-DD\x20HH:mm:ss','updateAttributes','getChannels','forEach','push','isNil','SIP/%s','body','type','DEFAULT\x20PAUSE','role','bulkCreate','update','channel','Unknown\x20channel','voice','system','mail','chat','fax','openchannel','set','%s%s','Pause','all','LogoutUser','findOne','destroy','LoginUser','mobile','phone','loginInPause','count','agent','../../config/license/util','getLicense','agents','upsert','UserVoiceQueue.penalty','merge','callysquare','concat','LOGININPAUSE','lodash','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','rpc','../../config/environment','client','http','redis','localhost','./user.socket','register','request','then','info','User,\x20%s,\x20%s','request\x20sent','debug','code','error','message','result','catch','GetUser','User','findAll','options','raw','where','attributes','map','include','model','stringify','ShowUser'];(function(_0xf3120,_0x80a54c){var _0x5aa549=function(_0x17ba5b){while(--_0x17ba5b){_0xf3120['push'](_0xf3120['shift']());}};_0x5aa549(++_0x80a54c);}(_0xa302,0x19c));var _0x2a30=function(_0x2070da,_0x45e586){_0x2070da=_0x2070da-0x0;var _0x4f9fe1=_0xa302[_0x2070da];return _0x4f9fe1;};'use strict';var _=require(_0x2a30('0x0'));var util=require('util');var moment=require(_0x2a30('0x1'));var BPromise=require(_0x2a30('0x2'));var rs=require(_0x2a30('0x3'));var fs=require('fs');var Redis=require(_0x2a30('0x4'));var db=require(_0x2a30('0x5'))['db'];var utils=require(_0x2a30('0x6'));var logger=require('../../config/logger')(_0x2a30('0x7'));var config=require(_0x2a30('0x8'));var jayson=require('jayson/promise');var client=jayson[_0x2a30('0x9')][_0x2a30('0xa')]({'port':0x232a});config[_0x2a30('0xb')]=_['defaults'](config['redis'],{'host':_0x2a30('0xc'),'port':0x18eb});var socket=require('socket.io-emitter')(new Redis(config[_0x2a30('0xb')]));require(_0x2a30('0xd'))[_0x2a30('0xe')](socket);function respondWithRpcPromise(_0x48400d,_0xf054d4,_0x36eed4){return new BPromise(function(_0x4f9a45,_0x40ceba){return client[_0x2a30('0xf')](_0x48400d,_0x36eed4)[_0x2a30('0x10')](function(_0x3e72a7){logger[_0x2a30('0x11')](_0x2a30('0x12'),_0xf054d4,_0x2a30('0x13'));logger[_0x2a30('0x14')]('User,\x20%s,\x20%s,\x20%s',_0xf054d4,_0x2a30('0x13'),JSON['stringify'](_0x3e72a7));if(_0x3e72a7['error']){if(_0x3e72a7['error'][_0x2a30('0x15')]===0x1f4){logger[_0x2a30('0x16')](_0x2a30('0x12'),_0xf054d4,_0x3e72a7[_0x2a30('0x16')][_0x2a30('0x17')]);return _0x40ceba(_0x3e72a7[_0x2a30('0x16')][_0x2a30('0x17')]);}logger[_0x2a30('0x16')](_0x2a30('0x12'),_0xf054d4,_0x3e72a7['error']['message']);return _0x4f9a45(_0x3e72a7['error']['message']);}else{logger[_0x2a30('0x11')](_0x2a30('0x12'),_0xf054d4,'request\x20sent');_0x4f9a45(_0x3e72a7[_0x2a30('0x18')][_0x2a30('0x17')]);}})[_0x2a30('0x19')](function(_0x3f860e){logger[_0x2a30('0x16')](_0x2a30('0x12'),_0xf054d4,_0x3f860e);_0x40ceba(_0x3f860e);});});}exports[_0x2a30('0x1a')]=function(_0xdfcee){var _0x47c707=this;return new Promise(function(_0x3afe3b,_0x3608b3){return db[_0x2a30('0x1b')][_0x2a30('0x1c')]({'raw':_0xdfcee[_0x2a30('0x1d')]?_0xdfcee[_0x2a30('0x1d')][_0x2a30('0x1e')]===undefined?!![]:![]:!![],'where':_0xdfcee['options']?_0xdfcee[_0x2a30('0x1d')][_0x2a30('0x1f')]||null:null,'attributes':_0xdfcee[_0x2a30('0x1d')]?_0xdfcee[_0x2a30('0x1d')][_0x2a30('0x20')]||null:null,'limit':_0xdfcee[_0x2a30('0x1d')]?_0xdfcee['options']['limit']||null:null,'include':_0xdfcee[_0x2a30('0x1d')]?_0xdfcee[_0x2a30('0x1d')]['include']?_[_0x2a30('0x21')](_0xdfcee['options']['include'],function(_0x35ad89){return{'model':db[_0x35ad89['model']],'as':_0x35ad89['as'],'attributes':_0x35ad89['attributes'],'include':_0x35ad89[_0x2a30('0x22')]?_[_0x2a30('0x21')](_0x35ad89[_0x2a30('0x22')],function(_0x5c3ddf){return{'model':db[_0x5c3ddf[_0x2a30('0x23')]],'as':_0x5c3ddf['as'],'attributes':_0x5c3ddf[_0x2a30('0x20')],'include':_0x5c3ddf[_0x2a30('0x22')]?_[_0x2a30('0x21')](_0x5c3ddf['include'],function(_0x4762b4){return{'model':db[_0x4762b4['model']],'as':_0x4762b4['as'],'attributes':_0x4762b4[_0x2a30('0x20')]};}):[]};}):[]};}):[]:[]})[_0x2a30('0x10')](function(_0x352a72){logger[_0x2a30('0x11')](_0x2a30('0x1a'),_0xdfcee);logger['debug'](_0x2a30('0x1a'),_0xdfcee,JSON[_0x2a30('0x24')](_0x352a72));_0x3afe3b(_0x352a72);})[_0x2a30('0x19')](function(_0x455ba2){logger[_0x2a30('0x16')](_0x2a30('0x1a'),_0x455ba2[_0x2a30('0x17')],_0xdfcee);_0x3608b3(_0x47c707['error'](0x1f4,_0x455ba2[_0x2a30('0x17')]));});});};exports[_0x2a30('0x25')]=function(_0x257db8){var _0x25de91=this;return new Promise(function(_0x27b478,_0x308c93){return db[_0x2a30('0x1b')][_0x2a30('0x26')]({'raw':_0x257db8[_0x2a30('0x1d')]?_0x257db8['options'][_0x2a30('0x1e')]===undefined?!![]:![]:!![],'where':_0x257db8['options']?_0x257db8[_0x2a30('0x1d')][_0x2a30('0x1f')]||null:null,'attributes':_0x257db8[_0x2a30('0x1d')]?_0x257db8[_0x2a30('0x1d')][_0x2a30('0x20')]||null:null,'include':_0x257db8['options']?_0x257db8[_0x2a30('0x1d')][_0x2a30('0x22')]?_[_0x2a30('0x21')](_0x257db8[_0x2a30('0x1d')]['include'],function(_0x13288f){return{'model':db[_0x13288f[_0x2a30('0x23')]],'as':_0x13288f['as'],'attributes':_0x13288f[_0x2a30('0x20')],'include':_0x13288f[_0x2a30('0x22')]?_['map'](_0x13288f[_0x2a30('0x22')],function(_0x5c3d87){return{'model':db[_0x5c3d87['model']],'as':_0x5c3d87['as'],'attributes':_0x5c3d87[_0x2a30('0x20')],'include':_0x5c3d87[_0x2a30('0x22')]?_[_0x2a30('0x21')](_0x5c3d87[_0x2a30('0x22')],function(_0x40449f){return{'model':db[_0x40449f[_0x2a30('0x23')]],'as':_0x40449f['as'],'attributes':_0x40449f[_0x2a30('0x20')]};}):[]};}):[]};}):[]:[]})[_0x2a30('0x10')](function(_0x2647ce){logger['info']('ShowUser',_0x257db8);logger['debug']('ShowUser',_0x257db8,JSON[_0x2a30('0x24')](_0x2647ce));_0x27b478(_0x2647ce);})[_0x2a30('0x19')](function(_0x308229){logger[_0x2a30('0x16')](_0x2a30('0x25'),_0x308229[_0x2a30('0x17')],_0x257db8);_0x308c93(_0x25de91[_0x2a30('0x16')](0x1f4,_0x308229['message']));});});};exports['PauseUser']=function(_0xf0fe73){var _0x33943f=this;return new Promise(function(_0x1ecae4,_0x474670){var _0x443093;return db['User'][_0x2a30('0x26')]({'where':_0xf0fe73[_0x2a30('0x1d')]['where']||{},'attributes':['id',_0x2a30('0x27'),'role',_0x2a30('0x28'),_0x2a30('0x29')]})[_0x2a30('0x10')](function(_0x969cdd){if(_0x969cdd){_0x443093=_0x969cdd;return db[_0x2a30('0x2a')]['update']({'paused':0x1},{'where':{'UserId':_0x443093['id']},'individualHooks':!![]});}})['then'](function(){if(_0x443093){return db[_0x2a30('0x2b')][_0x2a30('0x1c')]({'where':{'membername':_0x443093[_0x2a30('0x27')],'type':_0x2a30('0x2c'),'exitAt':null}});}})['then'](function(_0x167919){if(_0x443093){if(_0x167919&&_0x167919[_0x2a30('0x2d')]){var _0x273346=moment()[_0x2a30('0x2e')](_0x2a30('0x2f'));for(var _0x4ad2b3=0x0,_0x3e4040=_0x167919[_0x2a30('0x2d')];_0x4ad2b3<_0x3e4040;_0x4ad2b3++){_0x167919[_0x4ad2b3][_0x2a30('0x30')]({'exitAt':_0x273346});}}}})[_0x2a30('0x10')](function(){if(_0x443093){var _0x9ffa2a=[];var _0x837db1=utils[_0x2a30('0x31')]();_0x837db1[_0x2a30('0x32')](function(_0x154a8d){_0x9ffa2a[_0x2a30('0x33')]({'channel':_0x154a8d,'membername':_0x443093[_0x2a30('0x27')],'interface':_[_0x2a30('0x34')](_0x443093[_0x2a30('0x29')])?util[_0x2a30('0x2e')](_0x2a30('0x35'),_0x443093[_0x2a30('0x27')]):_0x443093[_0x2a30('0x29')],'type':_0x2a30('0x2c'),'enterAt':moment()[_0x2a30('0x2e')](_0x2a30('0x2f')),'data1':_0xf0fe73[_0x2a30('0x36')][_0x2a30('0x37')]||_0x2a30('0x38'),'role':_0x443093[_0x2a30('0x39')],'internal':_0x443093[_0x2a30('0x28')],'uniqueid':_0xf0fe73[_0x2a30('0x36')]['uniqueid']||null});});return db[_0x2a30('0x2b')][_0x2a30('0x3a')](_0x9ffa2a,{'individualHooks':!![]});}})[_0x2a30('0x10')](function(){if(_0x443093){return _0x443093[_0x2a30('0x3b')]({'voicePause':!![],'mailPause':!![],'chatPause':!![],'faxPause':!![],'smsPause':!![],'openchannelPause':!![],'pauseType':_0xf0fe73[_0x2a30('0x36')][_0x2a30('0x37')]||_0x2a30('0x38'),'lastPauseAt':moment()[_0x2a30('0x2e')](_0x2a30('0x2f'))});}})[_0x2a30('0x10')](function(_0x2c53a3){_0x1ecae4(_0x2c53a3);})[_0x2a30('0x19')](function(_0x8276d7){_0x474670(_0x33943f[_0x2a30('0x16')](0x1f4,_0x8276d7[_0x2a30('0x17')]));});});};exports['UnpauseUser']=function(_0x569f70){var _0x29141b=this;return new Promise(function(_0x4c999e,_0x5d73f1){var _0x580184;return db[_0x2a30('0x1b')]['findOne']({'where':_0x569f70[_0x2a30('0x1d')][_0x2a30('0x1f')]||{},'attributes':['id','name']})[_0x2a30('0x10')](function(_0x1e12e9){if(_0x1e12e9){_0x580184=_0x1e12e9;if(_0x569f70['body'][_0x2a30('0x3c')]&&!utils['isValidChannel'](_0x569f70[_0x2a30('0x36')][_0x2a30('0x3c')])){throw new Error(_0x2a30('0x3d'));}switch(_0x569f70[_0x2a30('0x36')][_0x2a30('0x3c')]){case _0x2a30('0x3e'):return db[_0x2a30('0x2a')][_0x2a30('0x3b')]({'paused':0x0},{'where':{'UserId':_0x580184['id']}})[_0x2a30('0x10')](function(){return db[_0x2a30('0x2b')][_0x2a30('0x26')]({'where':{'channel':_0x569f70[_0x2a30('0x36')][_0x2a30('0x3c')],'membername':_0x580184['name'],'type':_0x2a30('0x2c'),'exitAt':null}});})[_0x2a30('0x10')](function(_0x3ee719){if(_0x3ee719){return _0x3ee719[_0x2a30('0x3b')]({'exitAt':moment()[_0x2a30('0x2e')](_0x2a30('0x2f')),'data2':_0x2a30('0x3f')},{'individualHooks':!![]});}return null;})[_0x2a30('0x10')](function(){return _0x580184['update']({'voicePause':![]});});case _0x2a30('0x40'):case _0x2a30('0x41'):case _0x2a30('0x42'):case'sms':case _0x2a30('0x43'):return db[_0x2a30('0x2b')][_0x2a30('0x26')]({'where':{'channel':_0x569f70['body'][_0x2a30('0x3c')],'membername':_0x580184['name'],'type':_0x2a30('0x2c'),'exitAt':null}})[_0x2a30('0x10')](function(_0x1a8266){return _0x1a8266[_0x2a30('0x3b')]({'exitAt':moment()[_0x2a30('0x2e')]('YYYY-MM-DD\x20HH:mm:ss'),'data2':'system'},{'individualHooks':!![]});})[_0x2a30('0x10')](function(){var _0x2aac30={};_[_0x2a30('0x44')](_0x2aac30,util[_0x2a30('0x2e')](_0x2a30('0x45'),_0x569f70['body']['channel'],_0x2a30('0x46')),![]);return _0x580184['update'](_0x2aac30);});default:return db[_0x2a30('0x2a')][_0x2a30('0x3b')]({'paused':0x0},{'where':{'UserId':_0x580184['id']}})[_0x2a30('0x10')](function(){return db[_0x2a30('0x2b')][_0x2a30('0x1c')]({'where':{'membername':_0x580184['name'],'type':_0x2a30('0x2c'),'exitAt':null}});})[_0x2a30('0x10')](function(_0x32ccd1){var _0x4d3bec=[];_0x32ccd1['forEach'](function(_0x46823f){_0x4d3bec['push'](_0x46823f[_0x2a30('0x3b')]({'exitAt':moment()[_0x2a30('0x2e')](_0x2a30('0x2f')),'data2':_0x2a30('0x3f')}));});return BPromise[_0x2a30('0x47')](_0x4d3bec);})['then'](function(){return _0x580184[_0x2a30('0x3b')]({'voicePause':![],'mailPause':![],'chatPause':![],'faxPause':![],'smsPause':![],'openchannelPause':![]});});}}})['then'](function(_0x4b0bed){_0x4c999e(_0x4b0bed);})[_0x2a30('0x19')](function(_0x445b80){_0x5d73f1(_0x29141b['error'](0x1f4,_0x445b80[_0x2a30('0x17')]));});});};exports[_0x2a30('0x48')]=function(_0x520d4e){var _0x3ab1e2=this;return new Promise(function(_0x1bc2c4,_0x535e4f){var _0x4bf897;return db['User'][_0x2a30('0x49')]({'where':_0x520d4e[_0x2a30('0x1d')][_0x2a30('0x1f')]||{},'attributes':['id','name']})[_0x2a30('0x10')](function(_0xd38b60){if(_0xd38b60){_0x4bf897=_0xd38b60;return db[_0x2a30('0x2a')][_0x2a30('0x4a')]({'where':{'membername':_0x4bf897['name']},'individualHooks':!![]});}})['then'](function(){if(_0x4bf897){return db[_0x2a30('0x2b')][_0x2a30('0x1c')]({'where':{'membername':_0x4bf897[_0x2a30('0x27')],'exitAt':null}});}})[_0x2a30('0x10')](function(_0xc64eb){if(_0x4bf897){if(_0xc64eb&&_0xc64eb['length']){var _0x24f1e1=[];_0xc64eb[_0x2a30('0x32')](function(_0x52076d){_0x24f1e1['push'](_0x52076d['update']({'exitAt':moment()['format'](_0x2a30('0x2f'))}));});return BPromise['all'](_0x24f1e1);}}})[_0x2a30('0x10')](function(){if(_0x4bf897){return _0x4bf897[_0x2a30('0x3b')]({'online':![],'lastLoginAt':null,'voicePause':![],'mailPause':![],'chatPause':![],'faxPause':![],'smsPause':![],'openchannelPause':![]});}})['then'](function(_0x46b182){_0x1bc2c4(_0x46b182);})[_0x2a30('0x19')](function(_0x11cc92){_0x535e4f(_0x3ab1e2['error'](0x1f4,_0x11cc92['message']));});});};exports[_0x2a30('0x4b')]=function(_0x1322d1){var _0x3a3edc=this;return new Promise(function(_0x57c0ac,_0x2feb30){var _0x11b6b0;var _0x3f22c4;var _0x44ccf4;var _0x3e02e2;return db[_0x2a30('0x1b')]['findOne']({'where':_0x1322d1['options']['where']||{},'attributes':['id',_0x2a30('0x27'),_0x2a30('0x39'),_0x2a30('0x4c'),_0x2a30('0x4d'),'internal',_0x2a30('0x4e'),_0x2a30('0x29')]})[_0x2a30('0x10')](function(_0x358afe){if(_0x358afe){_0x11b6b0=_0x358afe;_0x3e02e2=_0x1322d1['body'][_0x2a30('0x29')]?_0x1322d1[_0x2a30('0x36')][_0x2a30('0x29')]:util[_0x2a30('0x2e')](_0x2a30('0x35'),_0x11b6b0['name']);return db[_0x2a30('0x1b')][_0x2a30('0x4f')]({'where':{'role':_0x2a30('0x50'),'online':!![],'id':{'$ne':_0x11b6b0['id']}}});}})[_0x2a30('0x10')](function(_0x18a058){if(_0x18a058){_0x44ccf4=_0x18a058;return require(_0x2a30('0x51'))[_0x2a30('0x52')]();}})[_0x2a30('0x10')](function(_0x43e086){if(_0x43e086&&_0x43e086[_0x2a30('0x53')]&&_0x44ccf4>=_0x43e086[_0x2a30('0x53')]){throw new Error('Maximum\x20login\x20has\x20been\x20reached');}})['then'](function(){if(_0x11b6b0){return db[_0x2a30('0x2a')]['destroy']({'where':{'membername':_0x11b6b0[_0x2a30('0x27')]},'individualHooks':!![]});}})[_0x2a30('0x10')](function(){if(_0x11b6b0){return _0x11b6b0['getVoiceQueues']({'raw':!![]});}})[_0x2a30('0x10')](function(_0x33e051){if(_0x11b6b0){if(_0x33e051){var _0x422820=[];_0x3f22c4=_0x33e051;if(_0x3f22c4[_0x2a30('0x2d')]){for(var _0x45fecd=0x0;_0x45fecd<_0x3f22c4[_0x2a30('0x2d')];_0x45fecd++){_0x422820[_0x2a30('0x33')](db[_0x2a30('0x2a')][_0x2a30('0x54')]({'membername':_0x11b6b0[_0x2a30('0x27')],'UserId':_0x11b6b0['id'],'queue_name':_0x3f22c4[_0x45fecd][_0x2a30('0x27')],'VoiceQueueId':_0x3f22c4[_0x45fecd]['id'],'interface':_0x3e02e2,'paused':_0x11b6b0['loginInPause']||![],'penalty':_0x3f22c4[_0x45fecd][_0x2a30('0x55')]||0x0}));}return BPromise['all'](_0x422820);}}}})[_0x2a30('0x10')](function(){if(_0x11b6b0){return db['MemberReport'][_0x2a30('0x1c')]({'where':{'membername':_0x11b6b0[_0x2a30('0x27')],'exitAt':null}});}})[_0x2a30('0x10')](function(_0x5b042a){if(_0x11b6b0){if(_0x5b042a&&_0x5b042a[_0x2a30('0x2d')]){var _0x50ff5c=[];_0x5b042a['forEach'](function(_0x1befec){_0x50ff5c[_0x2a30('0x33')](_0x1befec[_0x2a30('0x3b')]({'exitAt':moment()[_0x2a30('0x2e')]('YYYY-MM-DD\x20HH:mm:ss')}));});return BPromise[_0x2a30('0x47')](_0x50ff5c);}}})['then'](function(_0x585bd3){if(_0x11b6b0){var _0xfad588=[];var _0x32c6ba=[];var _0x2df851=utils[_0x2a30('0x31')]();var _0x1f395c={'membername':_0x11b6b0[_0x2a30('0x27')],'interface':_0x3e02e2,'enterAt':moment()['format'](_0x2a30('0x2f')),'role':_0x11b6b0['role'],'internal':_0x11b6b0['internal']};_0x2df851[_0x2a30('0x32')](function(_0x117cba){_0xfad588[_0x2a30('0x33')](_[_0x2a30('0x56')]({'channel':_0x117cba,'type':'LOGIN','data1':_0x2a30('0x57'),'data2':_0x3e02e2},_0x1f395c));if(_0x11b6b0[_0x2a30('0x4e')]){_0x32c6ba[_0x2a30('0x33')](_['merge']({'channel':_0x117cba,'type':_0x2a30('0x2c'),'data1':'LOGININPAUSE'},_0x1f395c));}});return db[_0x2a30('0x2b')]['bulkCreate'](_0xfad588[_0x2a30('0x58')](_0x32c6ba),{'individualHooks':!![]});}})[_0x2a30('0x10')](function(){if(_0x11b6b0){return _0x11b6b0[_0x2a30('0x3b')]({'online':!![],'lastLoginAt':moment()[_0x2a30('0x2e')]('YYYY-MM-DD\x20HH:mm:ss'),'voicePause':_0x11b6b0['loginInPause']||![],'mailPause':_0x11b6b0[_0x2a30('0x4e')]||![],'chatPause':_0x11b6b0[_0x2a30('0x4e')]||![],'faxPause':_0x11b6b0[_0x2a30('0x4e')]||![],'smsPause':_0x11b6b0[_0x2a30('0x4e')]||![],'openchannelPause':_0x11b6b0[_0x2a30('0x4e')]||![],'pauseType':_0x11b6b0[_0x2a30('0x4e')]?_0x2a30('0x59'):null,'lastPauseAt':moment()['format']('YYYY-MM-DD\x20HH:mm:ss'),'interface':_0x3e02e2});}})[_0x2a30('0x10')](function(_0x163f96){_0x57c0ac(_0x163f96);})[_0x2a30('0x19')](function(_0x589e10){_0x2feb30(_0x3a3edc[_0x2a30('0x16')](0x1f4,_0x589e10['message']));});});};
\ No newline at end of file
diff --git a/server/api/user/user.socket.js b/server/api/user/user.socket.js
index 3ed5fc6..a8178b0 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 _0xfb04=['emit','register','./user.events','remove','update'];(function(_0x483b53,_0xdbea74){var _0x2cbe76=function(_0xf0527f){while(--_0xf0527f){_0x483b53['push'](_0x483b53['shift']());}};_0x2cbe76(++_0xdbea74);}(_0xfb04,0xe8));var _0x4fb0=function(_0x13f167,_0x129213){_0x13f167=_0x13f167-0x0;var _0x337c02=_0xfb04[_0x13f167];return _0x337c02;};'use strict';var UserEvents=require(_0x4fb0('0x0'));var events=['save',_0x4fb0('0x1'),_0x4fb0('0x2')];function createListener(_0x5cc727,_0x1ed495){return function(_0x3ad5ed){_0x1ed495[_0x4fb0('0x3')](_0x5cc727,_0x3ad5ed);};}function removeListener(_0x30175c,_0x51098d){return function(){UserEvents['removeListener'](_0x30175c,_0x51098d);};}exports[_0x4fb0('0x4')]=function(_0x309b12){for(var _0x3d51c2=0x0,_0x4e5677=events['length'];_0x3d51c2<_0x4e5677;_0x3d51c2++){var _0x511c46=events[_0x3d51c2];var _0x14b5ec=createListener('user:'+_0x511c46,_0x309b12);UserEvents['on'](_0x511c46,_0x14b5ec);}};
\ No newline at end of file
+var _0x4fdc=['update','removeListener','register','length','user:','./user.events','save','remove'];(function(_0x20a584,_0xe384a5){var _0x4b41a8=function(_0x2127c6){while(--_0x2127c6){_0x20a584['push'](_0x20a584['shift']());}};_0x4b41a8(++_0xe384a5);}(_0x4fdc,0xf5));var _0xc4fd=function(_0x32414b,_0xfad5a8){_0x32414b=_0x32414b-0x0;var _0x5187e3=_0x4fdc[_0x32414b];return _0x5187e3;};'use strict';var UserEvents=require(_0xc4fd('0x0'));var events=[_0xc4fd('0x1'),_0xc4fd('0x2'),_0xc4fd('0x3')];function createListener(_0x25e040,_0x5085c9){return function(_0x1ca307){_0x5085c9['emit'](_0x25e040,_0x1ca307);};}function removeListener(_0x1f0b82,_0x271daa){return function(){UserEvents[_0xc4fd('0x4')](_0x1f0b82,_0x271daa);};}exports[_0xc4fd('0x5')]=function(_0x132cab){for(var _0x1219e7=0x0,_0x44a301=events[_0xc4fd('0x6')];_0x1219e7<_0x44a301;_0x1219e7++){var _0x1d8a38=events[_0x1219e7];var _0x52c1fa=createListener(_0xc4fd('0x7')+_0x1d8a38,_0x132cab);UserEvents['on'](_0x1d8a38,_0x52c1fa);}};
\ No newline at end of file
diff --git a/server/api/userChatQueue/index.js b/server/api/userChatQueue/index.js
index 468e495..eea3655 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 _0x4a34=['../../components/interaction/service','../../config/environment','exports','multer','path','Router','../../components/auth/service'];(function(_0x1064bc,_0x206f12){var _0x5edc45=function(_0x5087bd){while(--_0x5087bd){_0x1064bc['push'](_0x1064bc['shift']());}};_0x5edc45(++_0x206f12);}(_0x4a34,0xe3));var _0x44a3=function(_0x18d95b,_0x179697){_0x18d95b=_0x18d95b-0x0;var _0x31c97c=_0x4a34[_0x18d95b];return _0x31c97c;};'use strict';var multer=require(_0x44a3('0x0'));var util=require('util');var path=require(_0x44a3('0x1'));var timeout=require('connect-timeout');var express=require('express');var router=express[_0x44a3('0x2')]();var auth=require(_0x44a3('0x3'));var interaction=require(_0x44a3('0x4'));var config=require(_0x44a3('0x5'));module[_0x44a3('0x6')]=router;
\ No newline at end of file
+var _0x74f2=['Router','../../components/auth/service','exports','multer','util','path','connect-timeout','express'];(function(_0x5fa488,_0x116911){var _0x481878=function(_0x2bbcc9){while(--_0x2bbcc9){_0x5fa488['push'](_0x5fa488['shift']());}};_0x481878(++_0x116911);}(_0x74f2,0x10b));var _0x274f=function(_0xcf235b,_0x4df6a3){_0xcf235b=_0xcf235b-0x0;var _0x2aa0e8=_0x74f2[_0xcf235b];return _0x2aa0e8;};'use strict';var multer=require(_0x274f('0x0'));var util=require(_0x274f('0x1'));var path=require(_0x274f('0x2'));var timeout=require(_0x274f('0x3'));var express=require(_0x274f('0x4'));var router=express[_0x274f('0x5')]();var auth=require(_0x274f('0x6'));var interaction=require('../../components/interaction/service');var config=require('../../config/environment');module[_0x274f('0x7')]=router;
\ No newline at end of file
diff --git a/server/api/userChatQueue/userChatQueue.attributes.js b/server/api/userChatQueue/userChatQueue.attributes.js
index 58bed73..11c53cd 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 _0xbaf0=['exports','INTEGER'];(function(_0x44cb92,_0x59afa3){var _0x56b9e6=function(_0x2841e0){while(--_0x2841e0){_0x44cb92['push'](_0x44cb92['shift']());}};_0x56b9e6(++_0x59afa3);}(_0xbaf0,0x12a));var _0x0baf=function(_0x2b4411,_0x2625ed){_0x2b4411=_0x2b4411-0x0;var _0x8e41ef=_0xbaf0[_0x2b4411];return _0x8e41ef;};'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(_0x1e2291,_0x1a2e3d){var _0x28734c=function(_0x7ef8fe){while(--_0x7ef8fe){_0x1e2291['push'](_0x1e2291['shift']());}};_0x28734c(++_0x1a2e3d);}(_0xe706,0xa3));var _0x6e70=function(_0x236912,_0x4167cd){_0x236912=_0x236912-0x0;var _0x582904=_0xe706[_0x236912];return _0x582904;};'use strict';var Sequelize=require(_0x6e70('0x0'));module[_0x6e70('0x1')]={'penalty':{'type':Sequelize[_0x6e70('0x2')],'defaultValue':0x0}};
\ No newline at end of file
diff --git a/server/api/userChatQueue/userChatQueue.model.js b/server/api/userChatQueue/userChatQueue.model.js
index 290fc02..1357a2e 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 _0x3421=['exports','define','user_has_chat_queues','../../config/logger','bluebird','request-promise','path','rimraf','./userChatQueue.attributes'];(function(_0x4083f0,_0x17c4e3){var _0x29c1c4=function(_0x566d64){while(--_0x566d64){_0x4083f0['push'](_0x4083f0['shift']());}};_0x29c1c4(++_0x17c4e3);}(_0x3421,0xff));var _0x1342=function(_0x4efc6e,_0x3a02ae){_0x4efc6e=_0x4efc6e-0x0;var _0x15a24c=_0x3421[_0x4efc6e];return _0x15a24c;};'use strict';var _=require('lodash');var util=require('util');var logger=require(_0x1342('0x0'))('api');var moment=require('moment');var BPromise=require(_0x1342('0x1'));var rp=require(_0x1342('0x2'));var fs=require('fs');var path=require(_0x1342('0x3'));var rimraf=require(_0x1342('0x4'));var config=require('../../config/environment');var attributes=require(_0x1342('0x5'));module[_0x1342('0x6')]=function(_0x517850,_0x5c129c){return _0x517850[_0x1342('0x7')]('UserChatQueue',attributes,{'tableName':_0x1342('0x8'),'paranoid':![],'indexes':[],'timestamps':!![]});};
\ No newline at end of file
+var _0xa5d9=['api','moment','rimraf','../../config/environment','exports','define','UserChatQueue','user_has_chat_queues','lodash','util','../../config/logger'];(function(_0x50576c,_0x502d9c){var _0x22c1ef=function(_0x4067e7){while(--_0x4067e7){_0x50576c['push'](_0x50576c['shift']());}};_0x22c1ef(++_0x502d9c);}(_0xa5d9,0xb8));var _0x9a5d=function(_0x3b2249,_0x1815d4){_0x3b2249=_0x3b2249-0x0;var _0x11d36b=_0xa5d9[_0x3b2249];return _0x11d36b;};'use strict';var _=require(_0x9a5d('0x0'));var util=require(_0x9a5d('0x1'));var logger=require(_0x9a5d('0x2'))(_0x9a5d('0x3'));var moment=require(_0x9a5d('0x4'));var BPromise=require('bluebird');var rp=require('request-promise');var fs=require('fs');var path=require('path');var rimraf=require(_0x9a5d('0x5'));var config=require(_0x9a5d('0x6'));var attributes=require('./userChatQueue.attributes');module[_0x9a5d('0x7')]=function(_0x194752,_0x13898c){return _0x194752[_0x9a5d('0x8')](_0x9a5d('0x9'),attributes,{'tableName':_0x9a5d('0xa'),'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 1af6b69..8366231 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 _0x060c=['info','UserChatQueue,\x20%s,\x20%s','request\x20sent','UserChatQueue,\x20%s,\x20%s,\x20%s','stringify','error','code','message','result','catch','moment','randomstring','ioredis','../../mysqldb','../../config/logger','../../config/environment','jayson/promise','request'];(function(_0xcb7bc6,_0x2bed38){var _0x1c678e=function(_0x65e4a0){while(--_0x65e4a0){_0xcb7bc6['push'](_0xcb7bc6['shift']());}};_0x1c678e(++_0x2bed38);}(_0x060c,0x88));var _0xc060=function(_0x472869,_0x3e467d){_0x472869=_0x472869-0x0;var _0x107aae=_0x060c[_0x472869];return _0x107aae;};'use strict';var _=require('lodash');var util=require('util');var moment=require(_0xc060('0x0'));var BPromise=require('bluebird');var rs=require(_0xc060('0x1'));var fs=require('fs');var Redis=require(_0xc060('0x2'));var db=require(_0xc060('0x3'))['db'];var utils=require('../../config/utils');var logger=require(_0xc060('0x4'))('rpc');var config=require(_0xc060('0x5'));var jayson=require(_0xc060('0x6'));var client=jayson['client']['http']({'port':0x232a});function respondWithRpcPromise(_0xda37ba,_0x153d67,_0x3113f1){return new BPromise(function(_0x223172,_0xa51f43){return client[_0xc060('0x7')](_0xda37ba,_0x3113f1)['then'](function(_0x453e70){logger[_0xc060('0x8')](_0xc060('0x9'),_0x153d67,_0xc060('0xa'));logger['debug'](_0xc060('0xb'),_0x153d67,_0xc060('0xa'),JSON[_0xc060('0xc')](_0x453e70));if(_0x453e70['error']){if(_0x453e70[_0xc060('0xd')][_0xc060('0xe')]===0x1f4){logger[_0xc060('0xd')](_0xc060('0x9'),_0x153d67,_0x453e70[_0xc060('0xd')][_0xc060('0xf')]);return _0xa51f43(_0x453e70[_0xc060('0xd')][_0xc060('0xf')]);}logger['error'](_0xc060('0x9'),_0x153d67,_0x453e70[_0xc060('0xd')]['message']);return _0x223172(_0x453e70[_0xc060('0xd')]['message']);}else{logger[_0xc060('0x8')]('UserChatQueue,\x20%s,\x20%s',_0x153d67,_0xc060('0xa'));_0x223172(_0x453e70[_0xc060('0x10')][_0xc060('0xf')]);}})[_0xc060('0x11')](function(_0x1ccddb){logger[_0xc060('0xd')](_0xc060('0x9'),_0x153d67,_0x1ccddb);_0xa51f43(_0x1ccddb);});});}
\ No newline at end of file
+var _0xaae6=['UserChatQueue,\x20%s,\x20%s','request\x20sent','debug','UserChatQueue,\x20%s,\x20%s,\x20%s','stringify','error','code','message','result','catch','lodash','moment','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','jayson/promise','client','request','then'];(function(_0x5c3ae9,_0x450f9a){var _0x3f5950=function(_0x594c1f){while(--_0x594c1f){_0x5c3ae9['push'](_0x5c3ae9['shift']());}};_0x3f5950(++_0x450f9a);}(_0xaae6,0x1d8));var _0x6aae=function(_0x2d8b5d,_0x417b82){_0x2d8b5d=_0x2d8b5d-0x0;var _0x5185ea=_0xaae6[_0x2d8b5d];return _0x5185ea;};'use strict';var _=require(_0x6aae('0x0'));var util=require('util');var moment=require(_0x6aae('0x1'));var BPromise=require('bluebird');var rs=require('randomstring');var fs=require('fs');var Redis=require(_0x6aae('0x2'));var db=require(_0x6aae('0x3'))['db'];var utils=require(_0x6aae('0x4'));var logger=require(_0x6aae('0x5'))(_0x6aae('0x6'));var config=require('../../config/environment');var jayson=require(_0x6aae('0x7'));var client=jayson[_0x6aae('0x8')]['http']({'port':0x232a});function respondWithRpcPromise(_0x26edac,_0x21e4f3,_0x203860){return new BPromise(function(_0x2f5247,_0x15a8ca){return client[_0x6aae('0x9')](_0x26edac,_0x203860)[_0x6aae('0xa')](function(_0xb8b13c){logger['info'](_0x6aae('0xb'),_0x21e4f3,_0x6aae('0xc'));logger[_0x6aae('0xd')](_0x6aae('0xe'),_0x21e4f3,'request\x20sent',JSON[_0x6aae('0xf')](_0xb8b13c));if(_0xb8b13c[_0x6aae('0x10')]){if(_0xb8b13c[_0x6aae('0x10')][_0x6aae('0x11')]===0x1f4){logger['error'](_0x6aae('0xb'),_0x21e4f3,_0xb8b13c[_0x6aae('0x10')]['message']);return _0x15a8ca(_0xb8b13c[_0x6aae('0x10')]['message']);}logger[_0x6aae('0x10')](_0x6aae('0xb'),_0x21e4f3,_0xb8b13c[_0x6aae('0x10')][_0x6aae('0x12')]);return _0x2f5247(_0xb8b13c[_0x6aae('0x10')][_0x6aae('0x12')]);}else{logger['info']('UserChatQueue,\x20%s,\x20%s',_0x21e4f3,_0x6aae('0xc'));_0x2f5247(_0xb8b13c[_0x6aae('0x13')][_0x6aae('0x12')]);}})[_0x6aae('0x14')](function(_0x1ccb9e){logger['error'](_0x6aae('0xb'),_0x21e4f3,_0x1ccb9e);_0x15a8ca(_0x1ccb9e);});});}
\ No newline at end of file
diff --git a/server/api/userFaxQueue/index.js b/server/api/userFaxQueue/index.js
index 9cccf8c..206da5a 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 _0x8143=['connect-timeout','Router','../../components/interaction/service','exports','multer','util','path'];(function(_0x2641f9,_0x26715f){var _0x585741=function(_0x2d1462){while(--_0x2d1462){_0x2641f9['push'](_0x2641f9['shift']());}};_0x585741(++_0x26715f);}(_0x8143,0x9e));var _0x3814=function(_0x57b54c,_0x54ce0d){_0x57b54c=_0x57b54c-0x0;var _0x59cc19=_0x8143[_0x57b54c];return _0x59cc19;};'use strict';var multer=require(_0x3814('0x0'));var util=require(_0x3814('0x1'));var path=require(_0x3814('0x2'));var timeout=require(_0x3814('0x3'));var express=require('express');var router=express[_0x3814('0x4')]();var auth=require('../../components/auth/service');var interaction=require(_0x3814('0x5'));var config=require('../../config/environment');module[_0x3814('0x6')]=router;
\ No newline at end of file
+var _0xc6cc=['../../components/interaction/service','exports','express','../../components/auth/service'];(function(_0x5c351c,_0x2046d8){var _0x26f3b3=function(_0x47ac18){while(--_0x47ac18){_0x5c351c['push'](_0x5c351c['shift']());}};_0x26f3b3(++_0x2046d8);}(_0xc6cc,0xda));var _0xcc6c=function(_0x3babda,_0x2156fb){_0x3babda=_0x3babda-0x0;var _0x43198d=_0xc6cc[_0x3babda];return _0x43198d;};'use strict';var multer=require('multer');var util=require('util');var path=require('path');var timeout=require('connect-timeout');var express=require(_0xcc6c('0x0'));var router=express['Router']();var auth=require(_0xcc6c('0x1'));var interaction=require(_0xcc6c('0x2'));var config=require('../../config/environment');module[_0xcc6c('0x3')]=router;
\ No newline at end of file
diff --git a/server/api/userFaxQueue/userFaxQueue.attributes.js b/server/api/userFaxQueue/userFaxQueue.attributes.js
index ac36343..9e64e56 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 _0xd4a2=['INTEGER','sequelize'];(function(_0x5c0a92,_0x7bec73){var _0x5279db=function(_0x488785){while(--_0x488785){_0x5c0a92['push'](_0x5c0a92['shift']());}};_0x5279db(++_0x7bec73);}(_0xd4a2,0x173));var _0x2d4a=function(_0x289f41,_0x234df6){_0x289f41=_0x289f41-0x0;var _0x1b1973=_0xd4a2[_0x289f41];return _0x1b1973;};'use strict';var Sequelize=require(_0x2d4a('0x0'));module['exports']={'penalty':{'type':Sequelize['INTEGER'],'defaultValue':0x0},'assigned':{'type':Sequelize[_0x2d4a('0x1')],'defaultValue':0x0},'queue':{'type':Sequelize['STRING']}};
\ No newline at end of file
+var _0xda2d=['exports','INTEGER','STRING'];(function(_0x2c66dc,_0x38040c){var _0x133d8e=function(_0x4decce){while(--_0x4decce){_0x2c66dc['push'](_0x2c66dc['shift']());}};_0x133d8e(++_0x38040c);}(_0xda2d,0x102));var _0xdda2=function(_0x3602ea,_0x7ddcf0){_0x3602ea=_0x3602ea-0x0;var _0x291332=_0xda2d[_0x3602ea];return _0x291332;};'use strict';var Sequelize=require('sequelize');module[_0xdda2('0x0')]={'penalty':{'type':Sequelize[_0xdda2('0x1')],'defaultValue':0x0},'assigned':{'type':Sequelize[_0xdda2('0x1')],'defaultValue':0x0},'queue':{'type':Sequelize[_0xdda2('0x2')]}};
\ No newline at end of file
diff --git a/server/api/userFaxQueue/userFaxQueue.model.js b/server/api/userFaxQueue/userFaxQueue.model.js
index bde7c3c..a935f2f 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 _0x0bd7=['bluebird','request-promise','rimraf','../../config/environment','./userFaxQueue.attributes','exports','define','user_has_fax_queues','lodash','util','../../config/logger','moment'];(function(_0x4ab6ed,_0x5581e5){var _0x1aeda4=function(_0x23e15c){while(--_0x23e15c){_0x4ab6ed['push'](_0x4ab6ed['shift']());}};_0x1aeda4(++_0x5581e5);}(_0x0bd7,0x1dc));var _0x70bd=function(_0x20a822,_0x5dc295){_0x20a822=_0x20a822-0x0;var _0x3775d1=_0x0bd7[_0x20a822];return _0x3775d1;};'use strict';var _=require(_0x70bd('0x0'));var util=require(_0x70bd('0x1'));var logger=require(_0x70bd('0x2'))('api');var moment=require(_0x70bd('0x3'));var BPromise=require(_0x70bd('0x4'));var rp=require(_0x70bd('0x5'));var fs=require('fs');var path=require('path');var rimraf=require(_0x70bd('0x6'));var config=require(_0x70bd('0x7'));var attributes=require(_0x70bd('0x8'));module[_0x70bd('0x9')]=function(_0x226ef0,_0x5e5dca){return _0x226ef0[_0x70bd('0xa')]('UserFaxQueue',attributes,{'tableName':_0x70bd('0xb'),'paranoid':![],'indexes':[],'timestamps':!![]});};
\ No newline at end of file
+var _0x3c67=['moment','bluebird','request-promise','path','rimraf','../../config/environment','./userFaxQueue.attributes','define','util','../../config/logger','api'];(function(_0x1ddb32,_0x42f48b){var _0x5b5036=function(_0x51f50e){while(--_0x51f50e){_0x1ddb32['push'](_0x1ddb32['shift']());}};_0x5b5036(++_0x42f48b);}(_0x3c67,0x131));var _0x73c6=function(_0x82129b,_0x484ae9){_0x82129b=_0x82129b-0x0;var _0x2ae5dc=_0x3c67[_0x82129b];return _0x2ae5dc;};'use strict';var _=require('lodash');var util=require(_0x73c6('0x0'));var logger=require(_0x73c6('0x1'))(_0x73c6('0x2'));var moment=require(_0x73c6('0x3'));var BPromise=require(_0x73c6('0x4'));var rp=require(_0x73c6('0x5'));var fs=require('fs');var path=require(_0x73c6('0x6'));var rimraf=require(_0x73c6('0x7'));var config=require(_0x73c6('0x8'));var attributes=require(_0x73c6('0x9'));module['exports']=function(_0x3355eb,_0x401f19){return _0x3355eb[_0x73c6('0xa')]('UserFaxQueue',attributes,{'tableName':'user_has_fax_queues','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 ed43a99..ca794ee 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 _0xc713=['ioredis','../../mysqldb','../../config/utils','../../config/logger','client','request','then','UserFaxQueue,\x20%s,\x20%s','request\x20sent','debug','UserFaxQueue,\x20%s,\x20%s,\x20%s','stringify','error','message','info','catch','lodash','util','moment','randomstring'];(function(_0x167cc1,_0x56ef5a){var _0x10bc4b=function(_0xd6a255){while(--_0xd6a255){_0x167cc1['push'](_0x167cc1['shift']());}};_0x10bc4b(++_0x56ef5a);}(_0xc713,0xec));var _0x3c71=function(_0x64ac46,_0x29a347){_0x64ac46=_0x64ac46-0x0;var _0x1a8b52=_0xc713[_0x64ac46];return _0x1a8b52;};'use strict';var _=require(_0x3c71('0x0'));var util=require(_0x3c71('0x1'));var moment=require(_0x3c71('0x2'));var BPromise=require('bluebird');var rs=require(_0x3c71('0x3'));var fs=require('fs');var Redis=require(_0x3c71('0x4'));var db=require(_0x3c71('0x5'))['db'];var utils=require(_0x3c71('0x6'));var logger=require(_0x3c71('0x7'))('rpc');var config=require('../../config/environment');var jayson=require('jayson/promise');var client=jayson[_0x3c71('0x8')]['http']({'port':0x232a});function respondWithRpcPromise(_0xe748f2,_0x4d7888,_0xce392b){return new BPromise(function(_0x43a43f,_0x1bb2f8){return client[_0x3c71('0x9')](_0xe748f2,_0xce392b)[_0x3c71('0xa')](function(_0xab16c){logger['info'](_0x3c71('0xb'),_0x4d7888,_0x3c71('0xc'));logger[_0x3c71('0xd')](_0x3c71('0xe'),_0x4d7888,_0x3c71('0xc'),JSON[_0x3c71('0xf')](_0xab16c));if(_0xab16c[_0x3c71('0x10')]){if(_0xab16c[_0x3c71('0x10')]['code']===0x1f4){logger[_0x3c71('0x10')]('UserFaxQueue,\x20%s,\x20%s',_0x4d7888,_0xab16c['error']['message']);return _0x1bb2f8(_0xab16c[_0x3c71('0x10')]['message']);}logger[_0x3c71('0x10')](_0x3c71('0xb'),_0x4d7888,_0xab16c[_0x3c71('0x10')][_0x3c71('0x11')]);return _0x43a43f(_0xab16c['error'][_0x3c71('0x11')]);}else{logger[_0x3c71('0x12')]('UserFaxQueue,\x20%s,\x20%s',_0x4d7888,_0x3c71('0xc'));_0x43a43f(_0xab16c['result'][_0x3c71('0x11')]);}})[_0x3c71('0x13')](function(_0x54f752){logger[_0x3c71('0x10')](_0x3c71('0xb'),_0x4d7888,_0x54f752);_0x1bb2f8(_0x54f752);});});}
\ No newline at end of file
+var _0xba38=['catch','util','moment','bluebird','ioredis','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','client','http','then','UserFaxQueue,\x20%s,\x20%s','debug','UserFaxQueue,\x20%s,\x20%s,\x20%s','request\x20sent','stringify','error','code','message'];(function(_0x10004e,_0xd701e6){var _0x5af990=function(_0x4bab6a){while(--_0x4bab6a){_0x10004e['push'](_0x10004e['shift']());}};_0x5af990(++_0xd701e6);}(_0xba38,0x190));var _0x8ba3=function(_0x35fa5a,_0x58693b){_0x35fa5a=_0x35fa5a-0x0;var _0x12f78d=_0xba38[_0x35fa5a];return _0x12f78d;};'use strict';var _=require('lodash');var util=require(_0x8ba3('0x0'));var moment=require(_0x8ba3('0x1'));var BPromise=require(_0x8ba3('0x2'));var rs=require('randomstring');var fs=require('fs');var Redis=require(_0x8ba3('0x3'));var db=require('../../mysqldb')['db'];var utils=require(_0x8ba3('0x4'));var logger=require(_0x8ba3('0x5'))(_0x8ba3('0x6'));var config=require(_0x8ba3('0x7'));var jayson=require(_0x8ba3('0x8'));var client=jayson[_0x8ba3('0x9')][_0x8ba3('0xa')]({'port':0x232a});function respondWithRpcPromise(_0x17276c,_0x193e7e,_0x1dab1f){return new BPromise(function(_0x1b02f3,_0x1be1c3){return client['request'](_0x17276c,_0x1dab1f)[_0x8ba3('0xb')](function(_0x3041b5){logger['info'](_0x8ba3('0xc'),_0x193e7e,'request\x20sent');logger[_0x8ba3('0xd')](_0x8ba3('0xe'),_0x193e7e,_0x8ba3('0xf'),JSON[_0x8ba3('0x10')](_0x3041b5));if(_0x3041b5[_0x8ba3('0x11')]){if(_0x3041b5[_0x8ba3('0x11')][_0x8ba3('0x12')]===0x1f4){logger[_0x8ba3('0x11')](_0x8ba3('0xc'),_0x193e7e,_0x3041b5['error'][_0x8ba3('0x13')]);return _0x1be1c3(_0x3041b5[_0x8ba3('0x11')]['message']);}logger[_0x8ba3('0x11')]('UserFaxQueue,\x20%s,\x20%s',_0x193e7e,_0x3041b5[_0x8ba3('0x11')]['message']);return _0x1b02f3(_0x3041b5[_0x8ba3('0x11')][_0x8ba3('0x13')]);}else{logger['info'](_0x8ba3('0xc'),_0x193e7e,_0x8ba3('0xf'));_0x1b02f3(_0x3041b5['result'][_0x8ba3('0x13')]);}})[_0x8ba3('0x14')](function(_0x4c0818){logger['error'](_0x8ba3('0xc'),_0x193e7e,_0x4c0818);_0x1be1c3(_0x4c0818);});});}
\ No newline at end of file
diff --git a/server/api/userMailQueue/index.js b/server/api/userMailQueue/index.js
index 191607f..7e2b799 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 _0xc11c=['Router','../../components/auth/service','../../components/interaction/service','../../config/environment','exports','multer','util','express'];(function(_0x4e1a49,_0x4da738){var _0x136aae=function(_0x3ffd93){while(--_0x3ffd93){_0x4e1a49['push'](_0x4e1a49['shift']());}};_0x136aae(++_0x4da738);}(_0xc11c,0x195));var _0xcc11=function(_0x566ce0,_0x3fd9fd){_0x566ce0=_0x566ce0-0x0;var _0xac3743=_0xc11c[_0x566ce0];return _0xac3743;};'use strict';var multer=require(_0xcc11('0x0'));var util=require(_0xcc11('0x1'));var path=require('path');var timeout=require('connect-timeout');var express=require(_0xcc11('0x2'));var router=express[_0xcc11('0x3')]();var auth=require(_0xcc11('0x4'));var interaction=require(_0xcc11('0x5'));var config=require(_0xcc11('0x6'));module[_0xcc11('0x7')]=router;
\ No newline at end of file
+var _0x8472=['express','Router','../../components/auth/service','exports','multer','util','path','connect-timeout'];(function(_0x4cbdb7,_0x1b82f6){var _0x4ecb18=function(_0x48271f){while(--_0x48271f){_0x4cbdb7['push'](_0x4cbdb7['shift']());}};_0x4ecb18(++_0x1b82f6);}(_0x8472,0x13c));var _0x2847=function(_0x19e000,_0x5599d7){_0x19e000=_0x19e000-0x0;var _0x3ab816=_0x8472[_0x19e000];return _0x3ab816;};'use strict';var multer=require(_0x2847('0x0'));var util=require(_0x2847('0x1'));var path=require(_0x2847('0x2'));var timeout=require(_0x2847('0x3'));var express=require(_0x2847('0x4'));var router=express[_0x2847('0x5')]();var auth=require(_0x2847('0x6'));var interaction=require('../../components/interaction/service');var config=require('../../config/environment');module[_0x2847('0x7')]=router;
\ No newline at end of file
diff --git a/server/api/userMailQueue/userMailQueue.attributes.js b/server/api/userMailQueue/userMailQueue.attributes.js
index 3529d1d..dd8e6ac 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(_0x124128,_0x1934dd){var _0x25079e=function(_0x5836b9){while(--_0x5836b9){_0x124128['push'](_0x124128['shift']());}};_0x25079e(++_0x1934dd);}(_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(_0x198ba4,_0x4a5340){var _0x31e9ed=function(_0xfab10b){while(--_0xfab10b){_0x198ba4['push'](_0x198ba4['shift']());}};_0x31e9ed(++_0x4a5340);}(_0xe706,0xa3));var _0x6e70=function(_0x4c5a52,_0x59ef62){_0x4c5a52=_0x4c5a52-0x0;var _0x5b40f5=_0xe706[_0x4c5a52];return _0x5b40f5;};'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 448d029..02c2b10 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 _0xb10b=['api','moment','request-promise','path','rimraf','../../config/environment','./userMailQueue.attributes','exports','define','user_has_mail_queues','lodash','../../config/logger'];(function(_0x434804,_0x415f68){var _0x573fc8=function(_0x3ce265){while(--_0x3ce265){_0x434804['push'](_0x434804['shift']());}};_0x573fc8(++_0x415f68);}(_0xb10b,0x12a));var _0xbb10=function(_0x3612d5,_0xba7292){_0x3612d5=_0x3612d5-0x0;var _0x2febbf=_0xb10b[_0x3612d5];return _0x2febbf;};'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')]('UserMailQueue',attributes,{'tableName':_0xbb10('0xb'),'paranoid':![],'indexes':[],'timestamps':!![]});};
\ No newline at end of file
+var _0xb10b=['api','moment','request-promise','path','rimraf','../../config/environment','./userMailQueue.attributes','exports','define','user_has_mail_queues','lodash','../../config/logger'];(function(_0x2a723e,_0x61bb43){var _0x48a0e1=function(_0x470e57){while(--_0x470e57){_0x2a723e['push'](_0x2a723e['shift']());}};_0x48a0e1(++_0x61bb43);}(_0xb10b,0x12a));var _0xbb10=function(_0x4a93e9,_0x5b569f){_0x4a93e9=_0x4a93e9-0x0;var _0x4b3ba7=_0xb10b[_0x4a93e9];return _0x4b3ba7;};'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')]('UserMailQueue',attributes,{'tableName':_0xbb10('0xb'),'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 9ad328d..12aa664 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 _0x46fa=['error','message','result','catch','lodash','moment','bluebird','randomstring','../../mysqldb','../../config/utils','../../config/logger','rpc','jayson/promise','request','info','UserMailQueue,\x20%s,\x20%s','debug','UserMailQueue,\x20%s,\x20%s,\x20%s','stringify'];(function(_0x3ab51d,_0x2fa01d){var _0x29a04e=function(_0x7807b0){while(--_0x7807b0){_0x3ab51d['push'](_0x3ab51d['shift']());}};_0x29a04e(++_0x2fa01d);}(_0x46fa,0x76));var _0xa46f=function(_0x1d9787,_0x3d872f){_0x1d9787=_0x1d9787-0x0;var _0x202204=_0x46fa[_0x1d9787];return _0x202204;};'use strict';var _=require(_0xa46f('0x0'));var util=require('util');var moment=require(_0xa46f('0x1'));var BPromise=require(_0xa46f('0x2'));var rs=require(_0xa46f('0x3'));var fs=require('fs');var Redis=require('ioredis');var db=require(_0xa46f('0x4'))['db'];var utils=require(_0xa46f('0x5'));var logger=require(_0xa46f('0x6'))(_0xa46f('0x7'));var config=require('../../config/environment');var jayson=require(_0xa46f('0x8'));var client=jayson['client']['http']({'port':0x232a});function respondWithRpcPromise(_0x43b2cf,_0x39bdd3,_0x52dd73){return new BPromise(function(_0x5a23a3,_0xfd3fb5){return client[_0xa46f('0x9')](_0x43b2cf,_0x52dd73)['then'](function(_0x47969e){logger[_0xa46f('0xa')](_0xa46f('0xb'),_0x39bdd3,'request\x20sent');logger[_0xa46f('0xc')](_0xa46f('0xd'),_0x39bdd3,'request\x20sent',JSON[_0xa46f('0xe')](_0x47969e));if(_0x47969e[_0xa46f('0xf')]){if(_0x47969e[_0xa46f('0xf')]['code']===0x1f4){logger[_0xa46f('0xf')](_0xa46f('0xb'),_0x39bdd3,_0x47969e[_0xa46f('0xf')][_0xa46f('0x10')]);return _0xfd3fb5(_0x47969e['error'][_0xa46f('0x10')]);}logger[_0xa46f('0xf')]('UserMailQueue,\x20%s,\x20%s',_0x39bdd3,_0x47969e[_0xa46f('0xf')]['message']);return _0x5a23a3(_0x47969e['error']['message']);}else{logger[_0xa46f('0xa')](_0xa46f('0xb'),_0x39bdd3,'request\x20sent');_0x5a23a3(_0x47969e[_0xa46f('0x11')]['message']);}})[_0xa46f('0x12')](function(_0x3bc71b){logger[_0xa46f('0xf')](_0xa46f('0xb'),_0x39bdd3,_0x3bc71b);_0xfd3fb5(_0x3bc71b);});});}
\ No newline at end of file
+var _0x10dc=['message','result','catch','lodash','util','bluebird','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','client','info','UserMailQueue,\x20%s,\x20%s','request\x20sent','debug','stringify','error'];(function(_0x5b2b28,_0xfcf44e){var _0x52e491=function(_0xb9faee){while(--_0xb9faee){_0x5b2b28['push'](_0x5b2b28['shift']());}};_0x52e491(++_0xfcf44e);}(_0x10dc,0x107));var _0xc10d=function(_0x80b6a,_0x1b138c){_0x80b6a=_0x80b6a-0x0;var _0x58de9b=_0x10dc[_0x80b6a];return _0x58de9b;};'use strict';var _=require(_0xc10d('0x0'));var util=require(_0xc10d('0x1'));var moment=require('moment');var BPromise=require(_0xc10d('0x2'));var rs=require('randomstring');var fs=require('fs');var Redis=require(_0xc10d('0x3'));var db=require(_0xc10d('0x4'))['db'];var utils=require(_0xc10d('0x5'));var logger=require(_0xc10d('0x6'))(_0xc10d('0x7'));var config=require(_0xc10d('0x8'));var jayson=require(_0xc10d('0x9'));var client=jayson[_0xc10d('0xa')]['http']({'port':0x232a});function respondWithRpcPromise(_0x266240,_0x58c6ec,_0x591e4d){return new BPromise(function(_0x315fff,_0x175e39){return client['request'](_0x266240,_0x591e4d)['then'](function(_0x28b2e9){logger[_0xc10d('0xb')](_0xc10d('0xc'),_0x58c6ec,_0xc10d('0xd'));logger[_0xc10d('0xe')]('UserMailQueue,\x20%s,\x20%s,\x20%s',_0x58c6ec,'request\x20sent',JSON[_0xc10d('0xf')](_0x28b2e9));if(_0x28b2e9['error']){if(_0x28b2e9[_0xc10d('0x10')]['code']===0x1f4){logger[_0xc10d('0x10')]('UserMailQueue,\x20%s,\x20%s',_0x58c6ec,_0x28b2e9[_0xc10d('0x10')][_0xc10d('0x11')]);return _0x175e39(_0x28b2e9[_0xc10d('0x10')][_0xc10d('0x11')]);}logger[_0xc10d('0x10')]('UserMailQueue,\x20%s,\x20%s',_0x58c6ec,_0x28b2e9[_0xc10d('0x10')]['message']);return _0x315fff(_0x28b2e9[_0xc10d('0x10')][_0xc10d('0x11')]);}else{logger[_0xc10d('0xb')](_0xc10d('0xc'),_0x58c6ec,_0xc10d('0xd'));_0x315fff(_0x28b2e9[_0xc10d('0x12')][_0xc10d('0x11')]);}})[_0xc10d('0x13')](function(_0x4f6352){logger['error'](_0xc10d('0xc'),_0x58c6ec,_0x4f6352);_0x175e39(_0x4f6352);});});}
\ No newline at end of file
diff --git a/server/api/userOpenchannelQueue/index.js b/server/api/userOpenchannelQueue/index.js
index d51bc3d..9e86940 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 _0xf008=['util','path','connect-timeout','express','../../components/interaction/service'];(function(_0x257495,_0x18269b){var _0x3849aa=function(_0x1ca94e){while(--_0x1ca94e){_0x257495['push'](_0x257495['shift']());}};_0x3849aa(++_0x18269b);}(_0xf008,0xd2));var _0x8f00=function(_0x28455c,_0x2575d1){_0x28455c=_0x28455c-0x0;var _0x563629=_0xf008[_0x28455c];return _0x563629;};'use strict';var multer=require('multer');var util=require(_0x8f00('0x0'));var path=require(_0x8f00('0x1'));var timeout=require(_0x8f00('0x2'));var express=require(_0x8f00('0x3'));var router=express['Router']();var auth=require('../../components/auth/service');var interaction=require(_0x8f00('0x4'));var config=require('../../config/environment');module['exports']=router;
\ No newline at end of file
+var _0xfc52=['util','path','connect-timeout','Router','../../components/auth/service','../../components/interaction/service','../../config/environment'];(function(_0x3dd15e,_0x1f0015){var _0x231fd0=function(_0x4f680a){while(--_0x4f680a){_0x3dd15e['push'](_0x3dd15e['shift']());}};_0x231fd0(++_0x1f0015);}(_0xfc52,0x77));var _0x2fc5=function(_0x100332,_0x4296e1){_0x100332=_0x100332-0x0;var _0x308ffc=_0xfc52[_0x100332];return _0x308ffc;};'use strict';var multer=require('multer');var util=require(_0x2fc5('0x0'));var path=require(_0x2fc5('0x1'));var timeout=require(_0x2fc5('0x2'));var express=require('express');var router=express[_0x2fc5('0x3')]();var auth=require(_0x2fc5('0x4'));var interaction=require(_0x2fc5('0x5'));var config=require(_0x2fc5('0x6'));module['exports']=router;
\ No newline at end of file
diff --git a/server/api/userOpenchannelQueue/userOpenchannelQueue.attributes.js b/server/api/userOpenchannelQueue/userOpenchannelQueue.attributes.js
index 1670c61..6f206d2 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 _0xd8b0=['exports','sequelize'];(function(_0x1d05b5,_0x3d0835){var _0x58ffdc=function(_0xd4187e){while(--_0xd4187e){_0x1d05b5['push'](_0x1d05b5['shift']());}};_0x58ffdc(++_0x3d0835);}(_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 _0xd8b0=['exports','sequelize'];(function(_0x18e0e7,_0xafa137){var _0x4c758d=function(_0x52252a){while(--_0x52252a){_0x18e0e7['push'](_0x18e0e7['shift']());}};_0x4c758d(++_0xafa137);}(_0xd8b0,0xad));var _0x0d8b=function(_0x20a584,_0xe384a5){_0x20a584=_0x20a584-0x0;var _0x4b41a8=_0xd8b0[_0x20a584];return _0x4b41a8;};'use strict';var Sequelize=require(_0x0d8b('0x0'));module[_0x0d8b('0x1')]={'penalty':{'type':Sequelize['INTEGER'],'defaultValue':0x0}};
\ No newline at end of file
diff --git a/server/api/userOpenchannelQueue/userOpenchannelQueue.model.js b/server/api/userOpenchannelQueue/userOpenchannelQueue.model.js
index b2aa1fc..55b2cca 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 _0x0e1f=['../../config/logger','moment','bluebird','request-promise','path','rimraf','../../config/environment','./userOpenchannelQueue.attributes','exports','define','UserOpenchannelQueue','user_has_openchannel_queues'];(function(_0x15a8e1,_0x21e63d){var _0x185130=function(_0x53fa48){while(--_0x53fa48){_0x15a8e1['push'](_0x15a8e1['shift']());}};_0x185130(++_0x21e63d);}(_0x0e1f,0x108));var _0xf0e1=function(_0x502c7d,_0x2f1285){_0x502c7d=_0x502c7d-0x0;var _0x30b7ed=_0x0e1f[_0x502c7d];return _0x30b7ed;};'use strict';var _=require('lodash');var util=require('util');var logger=require(_0xf0e1('0x0'))('api');var moment=require(_0xf0e1('0x1'));var BPromise=require(_0xf0e1('0x2'));var rp=require(_0xf0e1('0x3'));var fs=require('fs');var path=require(_0xf0e1('0x4'));var rimraf=require(_0xf0e1('0x5'));var config=require(_0xf0e1('0x6'));var attributes=require(_0xf0e1('0x7'));module[_0xf0e1('0x8')]=function(_0x129079,_0x2e837d){return _0x129079[_0xf0e1('0x9')](_0xf0e1('0xa'),attributes,{'tableName':_0xf0e1('0xb'),'paranoid':![],'indexes':[],'timestamps':!![]});};
\ No newline at end of file
+var _0xc3b9=['exports','define','UserOpenchannelQueue','lodash','../../config/logger','api','bluebird','request-promise','path','rimraf','../../config/environment','./userOpenchannelQueue.attributes'];(function(_0x103d5f,_0x3dd186){var _0x1f1b0c=function(_0x438b1c){while(--_0x438b1c){_0x103d5f['push'](_0x103d5f['shift']());}};_0x1f1b0c(++_0x3dd186);}(_0xc3b9,0x9f));var _0x9c3b=function(_0x54ef43,_0x308497){_0x54ef43=_0x54ef43-0x0;var _0x4e3816=_0xc3b9[_0x54ef43];return _0x4e3816;};'use strict';var _=require(_0x9c3b('0x0'));var util=require('util');var logger=require(_0x9c3b('0x1'))(_0x9c3b('0x2'));var moment=require('moment');var BPromise=require(_0x9c3b('0x3'));var rp=require(_0x9c3b('0x4'));var fs=require('fs');var path=require(_0x9c3b('0x5'));var rimraf=require(_0x9c3b('0x6'));var config=require(_0x9c3b('0x7'));var attributes=require(_0x9c3b('0x8'));module[_0x9c3b('0x9')]=function(_0x5a339e,_0x1b08f9){return _0x5a339e[_0x9c3b('0xa')](_0x9c3b('0xb'),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 e3db515..5789f14 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 _0xc693=['UserOpenchannelQueue,\x20%s,\x20%s,\x20%s','error','code','message','catch','lodash','util','moment','bluebird','randomstring','../../mysqldb','../../config/utils','rpc','../../config/environment','jayson/promise','client','http','request','info','UserOpenchannelQueue,\x20%s,\x20%s','request\x20sent','debug'];(function(_0x2520f9,_0x14310d){var _0x431455=function(_0xdb60dd){while(--_0xdb60dd){_0x2520f9['push'](_0x2520f9['shift']());}};_0x431455(++_0x14310d);}(_0xc693,0xe1));var _0x3c69=function(_0x1bbf50,_0x2b97e7){_0x1bbf50=_0x1bbf50-0x0;var _0x21a64d=_0xc693[_0x1bbf50];return _0x21a64d;};'use strict';var _=require(_0x3c69('0x0'));var util=require(_0x3c69('0x1'));var moment=require(_0x3c69('0x2'));var BPromise=require(_0x3c69('0x3'));var rs=require(_0x3c69('0x4'));var fs=require('fs');var Redis=require('ioredis');var db=require(_0x3c69('0x5'))['db'];var utils=require(_0x3c69('0x6'));var logger=require('../../config/logger')(_0x3c69('0x7'));var config=require(_0x3c69('0x8'));var jayson=require(_0x3c69('0x9'));var client=jayson[_0x3c69('0xa')][_0x3c69('0xb')]({'port':0x232a});function respondWithRpcPromise(_0x1f90e6,_0x2acccf,_0x1fa5d4){return new BPromise(function(_0x5e3d27,_0x179ce0){return client[_0x3c69('0xc')](_0x1f90e6,_0x1fa5d4)['then'](function(_0x21b9c2){logger[_0x3c69('0xd')](_0x3c69('0xe'),_0x2acccf,_0x3c69('0xf'));logger[_0x3c69('0x10')](_0x3c69('0x11'),_0x2acccf,'request\x20sent',JSON['stringify'](_0x21b9c2));if(_0x21b9c2['error']){if(_0x21b9c2[_0x3c69('0x12')][_0x3c69('0x13')]===0x1f4){logger[_0x3c69('0x12')](_0x3c69('0xe'),_0x2acccf,_0x21b9c2[_0x3c69('0x12')]['message']);return _0x179ce0(_0x21b9c2[_0x3c69('0x12')][_0x3c69('0x14')]);}logger[_0x3c69('0x12')](_0x3c69('0xe'),_0x2acccf,_0x21b9c2[_0x3c69('0x12')][_0x3c69('0x14')]);return _0x5e3d27(_0x21b9c2[_0x3c69('0x12')]['message']);}else{logger[_0x3c69('0xd')](_0x3c69('0xe'),_0x2acccf,_0x3c69('0xf'));_0x5e3d27(_0x21b9c2['result']['message']);}})[_0x3c69('0x15')](function(_0x5d6b7f){logger[_0x3c69('0x12')]('UserOpenchannelQueue,\x20%s,\x20%s',_0x2acccf,_0x5d6b7f);_0x179ce0(_0x5d6b7f);});});}
\ No newline at end of file
+var _0x8767=['jayson/promise','client','http','request','then','info','request\x20sent','error','UserOpenchannelQueue,\x20%s,\x20%s','message','result','catch','lodash','util','moment','randomstring','../../config/utils','../../config/logger','rpc'];(function(_0x4fadaf,_0x179d85){var _0x4738a8=function(_0x34ce7b){while(--_0x34ce7b){_0x4fadaf['push'](_0x4fadaf['shift']());}};_0x4738a8(++_0x179d85);}(_0x8767,0x116));var _0x7876=function(_0x3dd15e,_0x1f0015){_0x3dd15e=_0x3dd15e-0x0;var _0x231fd0=_0x8767[_0x3dd15e];return _0x231fd0;};'use strict';var _=require(_0x7876('0x0'));var util=require(_0x7876('0x1'));var moment=require(_0x7876('0x2'));var BPromise=require('bluebird');var rs=require(_0x7876('0x3'));var fs=require('fs');var Redis=require('ioredis');var db=require('../../mysqldb')['db'];var utils=require(_0x7876('0x4'));var logger=require(_0x7876('0x5'))(_0x7876('0x6'));var config=require('../../config/environment');var jayson=require(_0x7876('0x7'));var client=jayson[_0x7876('0x8')][_0x7876('0x9')]({'port':0x232a});function respondWithRpcPromise(_0x4bcc2a,_0x1fd389,_0x544979){return new BPromise(function(_0xc1d1b8,_0x27d11c){return client[_0x7876('0xa')](_0x4bcc2a,_0x544979)[_0x7876('0xb')](function(_0x46af42){logger[_0x7876('0xc')]('UserOpenchannelQueue,\x20%s,\x20%s',_0x1fd389,_0x7876('0xd'));logger['debug']('UserOpenchannelQueue,\x20%s,\x20%s,\x20%s',_0x1fd389,_0x7876('0xd'),JSON['stringify'](_0x46af42));if(_0x46af42[_0x7876('0xe')]){if(_0x46af42[_0x7876('0xe')]['code']===0x1f4){logger[_0x7876('0xe')](_0x7876('0xf'),_0x1fd389,_0x46af42[_0x7876('0xe')][_0x7876('0x10')]);return _0x27d11c(_0x46af42[_0x7876('0xe')][_0x7876('0x10')]);}logger[_0x7876('0xe')](_0x7876('0xf'),_0x1fd389,_0x46af42['error'][_0x7876('0x10')]);return _0xc1d1b8(_0x46af42[_0x7876('0xe')][_0x7876('0x10')]);}else{logger[_0x7876('0xc')](_0x7876('0xf'),_0x1fd389,_0x7876('0xd'));_0xc1d1b8(_0x46af42[_0x7876('0x11')][_0x7876('0x10')]);}})[_0x7876('0x12')](function(_0x4e1316){logger['error']('UserOpenchannelQueue,\x20%s,\x20%s',_0x1fd389,_0x4e1316);_0x27d11c(_0x4e1316);});});}
\ No newline at end of file
diff --git a/server/api/userProfile/index.js b/server/api/userProfile/index.js
index 1c31316..4626fd9 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 _0x0b68=['addSections','addResources','put','/:id','update','delete','destroy','removeSections','exports','multer','connect-timeout','express','Router','../../components/auth/service','../../config/environment','./userProfile.controller','get','isAuthenticated','index','/describe','show','getSections','/:id/resources','getResources','post','clone','/:id/sections'];(function(_0x3b407d,_0x19cbdb){var _0x1fec09=function(_0x50c9e4){while(--_0x50c9e4){_0x3b407d['push'](_0x3b407d['shift']());}};_0x1fec09(++_0x19cbdb);}(_0x0b68,0x90));var _0x80b6=function(_0x1398ea,_0x3420b3){_0x1398ea=_0x1398ea-0x0;var _0x4b6d54=_0x0b68[_0x1398ea];return _0x4b6d54;};'use strict';var multer=require(_0x80b6('0x0'));var util=require('util');var path=require('path');var timeout=require(_0x80b6('0x1'));var express=require(_0x80b6('0x2'));var router=express[_0x80b6('0x3')]();var auth=require(_0x80b6('0x4'));var interaction=require('../../components/interaction/service');var config=require(_0x80b6('0x5'));var controller=require(_0x80b6('0x6'));router[_0x80b6('0x7')]('/',auth[_0x80b6('0x8')](),controller[_0x80b6('0x9')]);router['get'](_0x80b6('0xa'),auth[_0x80b6('0x8')](),controller['describe']);router[_0x80b6('0x7')]('/:id',auth[_0x80b6('0x8')](),controller[_0x80b6('0xb')]);router['get']('/:id/sections',auth[_0x80b6('0x8')](),controller[_0x80b6('0xc')]);router[_0x80b6('0x7')](_0x80b6('0xd'),auth[_0x80b6('0x8')](),controller[_0x80b6('0xe')]);router[_0x80b6('0xf')]('/',auth[_0x80b6('0x8')](),controller['create']);router[_0x80b6('0xf')]('/:id/clone',auth['isAuthenticated'](),controller[_0x80b6('0x10')]);router['post'](_0x80b6('0x11'),auth[_0x80b6('0x8')](),controller[_0x80b6('0x12')]);router[_0x80b6('0xf')](_0x80b6('0xd'),auth['isAuthenticated'](),controller[_0x80b6('0x13')]);router[_0x80b6('0x14')](_0x80b6('0x15'),auth['isAuthenticated'](),controller[_0x80b6('0x16')]);router[_0x80b6('0x17')](_0x80b6('0x15'),auth[_0x80b6('0x8')](),controller[_0x80b6('0x18')]);router[_0x80b6('0x17')]('/:id/sections',auth[_0x80b6('0x8')](),controller[_0x80b6('0x19')]);router[_0x80b6('0x17')](_0x80b6('0xd'),auth[_0x80b6('0x8')](),controller['removeResources']);module[_0x80b6('0x1a')]=router;
\ No newline at end of file
+var _0x38b1=['destroy','delete','removeSections','exports','multer','util','path','connect-timeout','../../components/auth/service','../../components/interaction/service','isAuthenticated','index','get','/describe','describe','/:id','show','/:id/sections','getSections','getResources','post','/:id/clone','clone','addSections','/:id/resources','addResources','put','update'];(function(_0x4c70c4,_0x963969){var _0x437865=function(_0x54e323){while(--_0x54e323){_0x4c70c4['push'](_0x4c70c4['shift']());}};_0x437865(++_0x963969);}(_0x38b1,0x18c));var _0x138b=function(_0x14add3,_0x13ce8d){_0x14add3=_0x14add3-0x0;var _0x4a174f=_0x38b1[_0x14add3];return _0x4a174f;};'use strict';var multer=require(_0x138b('0x0'));var util=require(_0x138b('0x1'));var path=require(_0x138b('0x2'));var timeout=require(_0x138b('0x3'));var express=require('express');var router=express['Router']();var auth=require(_0x138b('0x4'));var interaction=require(_0x138b('0x5'));var config=require('../../config/environment');var controller=require('./userProfile.controller');router['get']('/',auth[_0x138b('0x6')](),controller[_0x138b('0x7')]);router[_0x138b('0x8')](_0x138b('0x9'),auth['isAuthenticated'](),controller[_0x138b('0xa')]);router[_0x138b('0x8')](_0x138b('0xb'),auth[_0x138b('0x6')](),controller[_0x138b('0xc')]);router['get'](_0x138b('0xd'),auth['isAuthenticated'](),controller[_0x138b('0xe')]);router[_0x138b('0x8')]('/:id/resources',auth[_0x138b('0x6')](),controller[_0x138b('0xf')]);router[_0x138b('0x10')]('/',auth['isAuthenticated'](),controller['create']);router[_0x138b('0x10')](_0x138b('0x11'),auth['isAuthenticated'](),controller[_0x138b('0x12')]);router[_0x138b('0x10')]('/:id/sections',auth[_0x138b('0x6')](),controller[_0x138b('0x13')]);router[_0x138b('0x10')](_0x138b('0x14'),auth[_0x138b('0x6')](),controller[_0x138b('0x15')]);router[_0x138b('0x16')](_0x138b('0xb'),auth[_0x138b('0x6')](),controller[_0x138b('0x17')]);router['delete'](_0x138b('0xb'),auth['isAuthenticated'](),controller[_0x138b('0x18')]);router[_0x138b('0x19')](_0x138b('0xd'),auth[_0x138b('0x6')](),controller[_0x138b('0x1a')]);router['delete'](_0x138b('0x14'),auth[_0x138b('0x6')](),controller['removeResources']);module[_0x138b('0x1b')]=router;
\ No newline at end of file
diff --git a/server/api/userProfile/userProfile.attributes.js b/server/api/userProfile/userProfile.attributes.js
index 4161566..80526d2 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 _0x1683=['STRING','setDataValue','crudPermissions','join','getDataValue','exports','name'];(function(_0x227706,_0x23240f){var _0x12a894=function(_0x4657ae){while(--_0x4657ae){_0x227706['push'](_0x227706['shift']());}};_0x12a894(++_0x23240f);}(_0x1683,0x7c));var _0x3168=function(_0x3dd15e,_0x1f0015){_0x3dd15e=_0x3dd15e-0x0;var _0x231fd0=_0x1683[_0x3dd15e];return _0x231fd0;};'use strict';var Sequelize=require('sequelize');module[_0x3168('0x0')]={'name':{'type':Sequelize['STRING'],'allowNull':![],'unique':_0x3168('0x1')},'crudPermissions':{'type':Sequelize[_0x3168('0x2')],'set':function(_0x3173fa){this[_0x3168('0x3')](_0x3168('0x4'),_0x3173fa?_0x3173fa[_0x3168('0x5')](''):[]);},'get':function(){return this[_0x3168('0x6')](_0x3168('0x4'))?this['getDataValue'](_0x3168('0x4'))['split'](''):[];},'allowNull':![],'defaultValue':'r'},'description':{'type':Sequelize['STRING'],'allowNull':!![]}};
\ No newline at end of file
+var _0x9aa8=['getDataValue','sequelize','exports','STRING','join'];(function(_0x145b3c,_0x31ea4a){var _0x1b6e36=function(_0xfccee6){while(--_0xfccee6){_0x145b3c['push'](_0x145b3c['shift']());}};_0x1b6e36(++_0x31ea4a);}(_0x9aa8,0x155));var _0x89aa=function(_0xdfe71f,_0x3d6df1){_0xdfe71f=_0xdfe71f-0x0;var _0x5f4e40=_0x9aa8[_0xdfe71f];return _0x5f4e40;};'use strict';var Sequelize=require(_0x89aa('0x0'));module[_0x89aa('0x1')]={'name':{'type':Sequelize[_0x89aa('0x2')],'allowNull':![],'unique':'name'},'crudPermissions':{'type':Sequelize[_0x89aa('0x2')],'set':function(_0x4cff8a){this['setDataValue']('crudPermissions',_0x4cff8a?_0x4cff8a[_0x89aa('0x3')](''):[]);},'get':function(){return this[_0x89aa('0x4')]('crudPermissions')?this[_0x89aa('0x4')]('crudPermissions')['split'](''):[];},'allowNull':![],'defaultValue':'r'},'description':{'type':Sequelize[_0x89aa('0x2')],'allowNull':!![]}};
\ No newline at end of file
diff --git a/server/api/userProfile/userProfile.controller.js b/server/api/userProfile/userProfile.controller.js
index ea4c65d..ab5e36a 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 _0x3170=['CannedAnswer','dispositions','customdashboards','intervals','Interval','pauses','sounds','Sound','templates','Template','triggers','Trigger','trunks','Trunk','Variable','plugins','Reports','AnalyticMetric','eml-format','rimraf','fast-json-patch','request-promise','moment','bluebird','util','path','sox','lodash','squel','crypto','to-csv','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/environment','redis','defaults','socket.io-emitter','./userProfile.socket','sendStatus','status','json','count','offset','limit','set','Content-Range','apply','reject','then','destroy','end','stack','name','send','index','map','UserProfile','rawAttributes','fieldName','type','key','model','query','keys','filters','intersection','fields','attributes','hasOwnProperty','nolimit','order','sort','where','filter','merge','options','includeAll','include','findAll','rows','catch','show','params','find','create','body','clone','length','get','omit','createdAt','crudPermissions','sequelize','transaction','each','autoAssociation','UserProfileResource','Resources','UserProfileSection','update','describe','addSections','sectionId','userProfileId','push','removeSections','ids','getSections','enabled','includes','isEmpty','subsections','findOne','Dashboard','forEach','resourceId','bulkCreate','removeResources','getResources','section','undefined','Sequelize','ValidationError','Unknown\x20section','mergeResources','childModel','Invalid\x20section\x20\x27','parentSections','all','ignore','union','pick','VIRTUAL','field','AnalyticExtractedReport','foreignKey','associatedResources','reportType','default','custom','reportId','CustomReports','CmContact','Tag','Tags','color','ThroughTags','tag','toLowerCase','squareprojects','SquareProject','odbc','squarerecordings','SquareRecording','projectName','projects','JscriptyProject','Lists','ListId','CmList','companies','CmCompany','CmCustomField','chatqueues','chatwebsites','ChatWebsite','faxqueues','FaxQueue','faxaccounts','FaxAccount','internalroutes','outboundroutes','VoiceExtension','contexts','voicemails','VoiceMail','voicerecordings','VoiceRecording','Agents','membername','User','role','agent','telephone','VoiceQueue','inbound','QueueCampaigns','queue','outbound','VoiceMusicOnHold','chanspies','voiceprefixes','ivrcampaigns','Campaign','mailqueues','mailaccounts','MailAccount','MailSubstatus','openchannelqueues','openchannelaccounts','OpenchannelAccount','SmsQueue','smsaccounts','teams','Team','users','agents','telephones','Users','user','ZendeskAccount','salesforceaccounts','SalesforceAccount','freshdeskaccounts','FreshdeskAccount','sugarcrmaccounts','SugarcrmAccount','deskaccounts','DeskAccount','zohoaccounts','ZohoAccount','vtigeraccounts','cannedanswers'];(function(_0x26fe63,_0x323d92){var _0x1fd23b=function(_0x2af2e6){while(--_0x2af2e6){_0x26fe63['push'](_0x26fe63['shift']());}};_0x1fd23b(++_0x323d92);}(_0x3170,0x1de));var _0x0317=function(_0x1b0452,_0x3c69a5){_0x1b0452=_0x1b0452-0x0;var _0x140bb1=_0x3170[_0x1b0452];return _0x140bb1;};'use strict';var pdf=require('html-pdf');var emlformat=require(_0x0317('0x0'));var rimraf=require(_0x0317('0x1'));var zipdir=require('zip-dir');var jsonpatch=require(_0x0317('0x2'));var rp=require(_0x0317('0x3'));var moment=require(_0x0317('0x4'));var BPromise=require(_0x0317('0x5'));var Mustache=require('mustache');var util=require(_0x0317('0x6'));var path=require(_0x0317('0x7'));var sox=require(_0x0317('0x8'));var csv=require('to-csv');var ejs=require('ejs');var fs=require('fs');var _=require(_0x0317('0x9'));var squel=require(_0x0317('0xa'));var crypto=require(_0x0317('0xb'));var jsforce=require('jsforce');var deskjs=require('desk.js');var toCsv=require(_0x0317('0xc'));var querystring=require('querystring');var Papa=require(_0x0317('0xd'));var Redis=require(_0x0317('0xe'));var authService=require(_0x0317('0xf'));var qs=require(_0x0317('0x10'));var as=require(_0x0317('0x11'));var hardwareService=require(_0x0317('0x12'));var logger=require(_0x0317('0x13'))(_0x0317('0x14'));var utils=require(_0x0317('0x15'));var config=require(_0x0317('0x16'));var db=require('../../mysqldb')['db'];config[_0x0317('0x17')]=_[_0x0317('0x18')](config['redis'],{'host':'localhost','port':0x18eb});var socket=require(_0x0317('0x19'))(new Redis(config[_0x0317('0x17')]));require(_0x0317('0x1a'))['register'](socket);function respondWithStatusCode(_0x48b4ec,_0x1bfcc0){_0x1bfcc0=_0x1bfcc0||0xcc;return function(_0x151ac7){if(_0x151ac7){return _0x48b4ec[_0x0317('0x1b')](_0x1bfcc0);}return _0x48b4ec[_0x0317('0x1c')](_0x1bfcc0)['end']();};}function respondWithResult(_0x5bb54c,_0x5c16f9){_0x5c16f9=_0x5c16f9||0xc8;return function(_0x267277){if(_0x267277){return _0x5bb54c[_0x0317('0x1c')](_0x5c16f9)[_0x0317('0x1d')](_0x267277);}};}function respondWithFilteredResult(_0xdf0d17,_0x3aa509){return function(_0x24bd62){if(_0x24bd62){var _0x259510=_0x24bd62[_0x0317('0x1e')],_0x1b9673=_0x3aa509[_0x0317('0x1f')],_0x11870c=_0x3aa509['offset']+_0x3aa509[_0x0317('0x20')],_0x445018;if(_0x11870c>=_0x259510){_0x11870c=_0x259510;_0x445018=0xc8;}else{_0x445018=0xce;}_0xdf0d17[_0x0317('0x1c')](_0x445018);return _0xdf0d17[_0x0317('0x21')](_0x0317('0x22'),_0x1b9673+'-'+_0x11870c+'/'+_0x259510)[_0x0317('0x1d')](_0x24bd62);}return null;};}function patchUpdates(_0x6eda9c){return function(_0x151dd0){try{jsonpatch[_0x0317('0x23')](_0x151dd0,_0x6eda9c,!![]);}catch(_0x1e2c58){return BPromise[_0x0317('0x24')](_0x1e2c58);}return _0x151dd0['save']();};}function saveUpdates(_0x5a6988,_0x4b7a46){return function(_0x19cc78){if(_0x19cc78){return _0x19cc78['update'](_0x5a6988)[_0x0317('0x25')](function(_0x5c4b86){return _0x5c4b86;});}return null;};}function removeEntity(_0x524fcc,_0x4280f3){return function(_0x356242){if(_0x356242){return _0x356242[_0x0317('0x26')]()[_0x0317('0x25')](function(){_0x524fcc['status'](0xcc)[_0x0317('0x27')]();});}};}function handleEntityNotFound(_0x5963d5,_0x148126){return function(_0x40a807){if(!_0x40a807){_0x5963d5[_0x0317('0x1b')](0x194);}return _0x40a807;};}function handleError(_0xd49a08,_0x19780e){_0x19780e=_0x19780e||0x1f4;return function(_0x4fec12){logger['error'](_0x4fec12[_0x0317('0x28')]);if(_0x4fec12[_0x0317('0x29')]){delete _0x4fec12[_0x0317('0x29')];}_0xd49a08['status'](_0x19780e)[_0x0317('0x2a')](_0x4fec12);};}exports[_0x0317('0x2b')]=function(_0x204303,_0x22e109){var _0x43c6f1={},_0x6ffb4d={},_0x12cb10={'count':0x0,'rows':[]};var _0x4f2ca6=_[_0x0317('0x2c')](db[_0x0317('0x2d')][_0x0317('0x2e')],function(_0x5089ee){return{'name':_0x5089ee[_0x0317('0x2f')],'type':_0x5089ee[_0x0317('0x30')][_0x0317('0x31')]};});_0x6ffb4d[_0x0317('0x32')]=_[_0x0317('0x2c')](_0x4f2ca6,_0x0317('0x29'));_0x6ffb4d[_0x0317('0x33')]=_[_0x0317('0x34')](_0x204303['query']);_0x6ffb4d[_0x0317('0x35')]=_[_0x0317('0x36')](_0x6ffb4d['model'],_0x6ffb4d[_0x0317('0x33')]);_0x43c6f1['attributes']=_[_0x0317('0x36')](_0x6ffb4d[_0x0317('0x32')],qs['fields'](_0x204303['query'][_0x0317('0x37')]));_0x43c6f1[_0x0317('0x38')]=_0x43c6f1[_0x0317('0x38')]['length']?_0x43c6f1[_0x0317('0x38')]:_0x6ffb4d[_0x0317('0x32')];if(!_0x204303[_0x0317('0x33')][_0x0317('0x39')](_0x0317('0x3a'))){_0x43c6f1[_0x0317('0x20')]=qs[_0x0317('0x20')](_0x204303[_0x0317('0x33')][_0x0317('0x20')]);_0x43c6f1[_0x0317('0x1f')]=qs[_0x0317('0x1f')](_0x204303[_0x0317('0x33')][_0x0317('0x1f')]);}_0x43c6f1[_0x0317('0x3b')]=qs[_0x0317('0x3c')](_0x204303['query'][_0x0317('0x3c')]);_0x43c6f1[_0x0317('0x3d')]=qs[_0x0317('0x35')](_['pick'](_0x204303[_0x0317('0x33')],_0x6ffb4d[_0x0317('0x35')]));if(_0x204303[_0x0317('0x33')]['filter']){_0x43c6f1[_0x0317('0x3d')]=_['merge'](_0x43c6f1[_0x0317('0x3d')],{'$or':_['map'](_0x4f2ca6,function(_0x2fd9fa){if(_0x2fd9fa[_0x0317('0x30')]!=='VIRTUAL'){var _0x139ac4={};_0x139ac4[_0x2fd9fa['name']]={'$like':'%'+_0x204303[_0x0317('0x33')][_0x0317('0x3e')]+'%'};return _0x139ac4;}})});}_0x43c6f1=_[_0x0317('0x3f')]({},_0x43c6f1,_0x204303[_0x0317('0x40')]);var _0x126e16={'where':_0x43c6f1['where']};return db[_0x0317('0x2d')][_0x0317('0x1e')](_0x126e16)[_0x0317('0x25')](function(_0x1b983e){_0x12cb10[_0x0317('0x1e')]=_0x1b983e;if(_0x204303['query'][_0x0317('0x41')]){_0x43c6f1[_0x0317('0x42')]=[{'all':!![]}];}return db[_0x0317('0x2d')][_0x0317('0x43')](_0x43c6f1);})[_0x0317('0x25')](function(_0x4d11fc){_0x12cb10[_0x0317('0x44')]=_0x4d11fc;return _0x12cb10;})[_0x0317('0x25')](respondWithFilteredResult(_0x22e109,_0x43c6f1))[_0x0317('0x45')](handleError(_0x22e109,null));};exports[_0x0317('0x46')]=function(_0x20e837,_0x3fcd60){var _0x3bd709={'raw':![],'where':{'id':_0x20e837[_0x0317('0x47')]['id']}},_0x35d910={};_0x35d910[_0x0317('0x32')]=_[_0x0317('0x34')](db[_0x0317('0x2d')]['rawAttributes']);_0x35d910[_0x0317('0x33')]=_['keys'](_0x20e837['query']);_0x35d910['filters']=_[_0x0317('0x36')](_0x35d910[_0x0317('0x32')],_0x35d910[_0x0317('0x33')]);_0x3bd709[_0x0317('0x38')]=_['intersection'](_0x35d910[_0x0317('0x32')],qs['fields'](_0x20e837[_0x0317('0x33')][_0x0317('0x37')]));_0x3bd709[_0x0317('0x38')]=_0x3bd709['attributes']['length']?_0x3bd709[_0x0317('0x38')]:_0x35d910[_0x0317('0x32')];if(_0x20e837[_0x0317('0x33')][_0x0317('0x41')]){_0x3bd709['include']=[{'all':!![]}];}_0x3bd709=_[_0x0317('0x3f')]({},_0x3bd709,_0x20e837['options']);return db['UserProfile'][_0x0317('0x48')](_0x3bd709)[_0x0317('0x25')](handleEntityNotFound(_0x3fcd60,null))[_0x0317('0x25')](respondWithResult(_0x3fcd60,null))[_0x0317('0x45')](handleError(_0x3fcd60,null));};exports[_0x0317('0x49')]=function(_0xd86805,_0x2b86ca){return db[_0x0317('0x2d')][_0x0317('0x49')](_0xd86805[_0x0317('0x4a')],{})['then'](respondWithResult(_0x2b86ca,0xc9))[_0x0317('0x45')](handleError(_0x2b86ca,null));};exports[_0x0317('0x4b')]=function(_0x52d6b1,_0x84c2a8){var _0x3b54f8={'where':{'id':_0x52d6b1[_0x0317('0x47')]['id']}},_0x162f7b={};_0x162f7b[_0x0317('0x32')]=_['keys'](db[_0x0317('0x2d')][_0x0317('0x2e')]);_0x3b54f8['attributes']=_[_0x0317('0x36')](_0x162f7b[_0x0317('0x32')],qs[_0x0317('0x37')](_0x52d6b1[_0x0317('0x33')]['fields']));_0x3b54f8[_0x0317('0x38')]=_0x3b54f8[_0x0317('0x38')][_0x0317('0x4c')]?_0x3b54f8['attributes']:_0x162f7b[_0x0317('0x32')];if(_0x52d6b1[_0x0317('0x33')]['includeAll']){_0x3b54f8['include']=[{'all':!![]}];}_0x3b54f8=_[_0x0317('0x3f')]({},_0x3b54f8,_0x52d6b1['options']);return db[_0x0317('0x2d')][_0x0317('0x48')](_0x3b54f8)[_0x0317('0x25')](handleEntityNotFound(_0x84c2a8,null))[_0x0317('0x25')](function(_0xde4844){if(_0xde4844){var _0x530aab=_0xde4844[_0x0317('0x4d')]({'plain':!![]});_0x530aab=qs[_0x0317('0x4e')](_0x530aab,['id',_0x0317('0x4f'),'updatedAt',_0x0317('0x50')]);_0x52d6b1[_0x0317('0x4a')]=_[_0x0317('0x4e')](_0x52d6b1[_0x0317('0x4a')],['id',_0x0317('0x4f'),'updatedAt']);return db[_0x0317('0x51')][_0x0317('0x52')](function(_0x5e1c1a){return db[_0x0317('0x2d')][_0x0317('0x49')](_[_0x0317('0x3f')](_0x530aab,_0x52d6b1['body']),{'include':_0x52d6b1[_0x0317('0x33')][_0x0317('0x41')]?[{'all':!![]}]:undefined,'transaction':_0x5e1c1a})[_0x0317('0x25')](function(_0x25012e){var _0x2dc994=_0x25012e[_0x0317('0x4d')]({'plain':!![]});return db['UserProfileSection'][_0x0317('0x43')]({'where':{'userProfileId':_0x52d6b1['params']['id']},'raw':!![]})[_0x0317('0x25')](function(_0x3c43ec){if(_0x3c43ec){return BPromise[_0x0317('0x53')](_0x3c43ec,function(_0x5486e5){return new BPromise(function(_0x3cef23,_0x3925cb){if(_0x5486e5[_0x0317('0x54')]===null||_0x5486e5[_0x0317('0x54')]===0x1)_0x3cef23(null);return db[_0x0317('0x55')][_0x0317('0x43')]({'where':{'sectionId':_0x5486e5['id']},'raw':!![]})[_0x0317('0x25')](function(_0x2aa4d0){var _0x4ae154=_['map'](_0x2aa4d0,function(_0x4e4526){return qs[_0x0317('0x4e')](_0x4e4526,['id',_0x0317('0x4f'),'updatedAt','sectionId']);});_0x3cef23(_0x4ae154);})[_0x0317('0x45')](function(_0x4fd39d){_0x3925cb(_0x4fd39d);});})[_0x0317('0x25')](function(_0x13dcb9){var _0x2ac22e=qs[_0x0317('0x4e')](_0x5486e5,['id',_0x0317('0x4f'),'updatedAt']);_0x2ac22e['userProfileId']=_0x2dc994['id'];if(_0x13dcb9)_0x2ac22e[_0x0317('0x56')]=_0x13dcb9;return _0x2ac22e;})['then'](function(_0x52392e){return db[_0x0317('0x57')][_0x0317('0x49')](_0x52392e,{'include':[{'model':db[_0x0317('0x55')],'as':_0x0317('0x56')}],'raw':!![],'transaction':_0x5e1c1a});});})[_0x0317('0x25')](function(){return _0x2dc994;});}});});});}})['then'](respondWithResult(_0x84c2a8,0xc9))[_0x0317('0x45')](handleError(_0x84c2a8,null));};exports[_0x0317('0x58')]=function(_0x4a5e38,_0x1d080d){if(_0x4a5e38['body']['id']){delete _0x4a5e38[_0x0317('0x4a')]['id'];}return db[_0x0317('0x2d')]['find']({'where':{'id':_0x4a5e38[_0x0317('0x47')]['id']}})[_0x0317('0x25')](handleEntityNotFound(_0x1d080d,null))[_0x0317('0x25')](saveUpdates(_0x4a5e38[_0x0317('0x4a')],null))['then'](respondWithResult(_0x1d080d,null))[_0x0317('0x45')](handleError(_0x1d080d,null));};exports[_0x0317('0x26')]=function(_0x9bc58c,_0xe80e40){return db[_0x0317('0x2d')][_0x0317('0x48')]({'where':{'id':_0x9bc58c['params']['id']}})[_0x0317('0x25')](handleEntityNotFound(_0xe80e40,null))[_0x0317('0x25')](removeEntity(_0xe80e40,null))[_0x0317('0x45')](handleError(_0xe80e40,null));};exports[_0x0317('0x59')]=function(_0x42871e,_0x33471e){return db[_0x0317('0x2d')][_0x0317('0x59')]()[_0x0317('0x25')](respondWithResult(_0x33471e,null))[_0x0317('0x45')](handleError(_0x33471e,null));};exports[_0x0317('0x5a')]=function(_0x5e0de7,_0x22d300){var _0x1458b9=_0x5e0de7[_0x0317('0x4a')];return db[_0x0317('0x2d')][_0x0317('0x48')]({'where':{'id':_0x5e0de7['params']['id']}})[_0x0317('0x25')](handleEntityNotFound(_0x22d300,null))['then'](function(_0x1e9aa7){if(_0x1e9aa7){return db[_0x0317('0x51')][_0x0317('0x52')](function(_0x5b25c2){return db[_0x0317('0x57')][_0x0317('0x26')]({'where':{'userProfileId':_0x5e0de7['params']['id'],'sectionId':_['map'](_0x1458b9,function(_0x2fac59){return _0x2fac59[_0x0317('0x5b')];})},'transaction':_0x5b25c2})[_0x0317('0x25')](function(){var _0x29b28d=_[_0x0317('0x2c')](_0x1458b9,function(_0x44fd65){_0x44fd65[_0x0317('0x5c')]=_0x5e0de7[_0x0317('0x47')]['id'];return _0x44fd65;});var _0x5f1c32=[];return BPromise[_0x0317('0x53')](_0x29b28d,function(_0x2ff9ab){return db['UserProfileSection'][_0x0317('0x49')](_0x2ff9ab,{'include':[{'model':db['UserProfileResource'],'as':_0x0317('0x56')}],'raw':!![],'transaction':_0x5b25c2})[_0x0317('0x25')](function(_0x95ae3f){_0x5f1c32[_0x0317('0x5d')](_0x95ae3f['get']({'plain':!![]}));});})[_0x0317('0x25')](function(){return _0x5f1c32;});});});}})[_0x0317('0x25')](function(_0x58278a){return _0x58278a;})[_0x0317('0x25')](respondWithResult(_0x22d300,null))['catch'](handleError(_0x22d300,null));};exports[_0x0317('0x5e')]=function(_0x61fc5d,_0x4d31d0){var _0xf9e2cd;return db[_0x0317('0x2d')]['find']({'where':{'id':_0x61fc5d[_0x0317('0x47')]['id']},'attributes':['id',_0x0317('0x29')]})[_0x0317('0x25')](handleEntityNotFound(_0x4d31d0,null))[_0x0317('0x25')](function(_0x2610d4){if(_0x2610d4){_0xf9e2cd=_0x2610d4;return db[_0x0317('0x57')]['destroy']({'where':{'userProfileId':_0x61fc5d[_0x0317('0x47')]['id'],'sectionId':_0x61fc5d[_0x0317('0x33')][_0x0317('0x5f')]}});}})[_0x0317('0x25')](function(){return _0xf9e2cd;})[_0x0317('0x25')](respondWithStatusCode(_0x4d31d0,null))[_0x0317('0x45')](handleError(_0x4d31d0,null));};exports[_0x0317('0x60')]=function(_0x56f7a4,_0x46d012){var _0x32c60a=[];var _0x1311af=[];return db[_0x0317('0x57')][_0x0317('0x43')]({'where':{'userProfileId':_0x56f7a4[_0x0317('0x47')]['id']},'raw':!![]})[_0x0317('0x25')](function(_0x4ac4d5){_0x32c60a=_['filter'](_0x4ac4d5,function(_0x3383b8){return _0x3383b8[_0x0317('0x61')]===0x1||_[_0x0317('0x62')]([0x3eb,0x709],_0x3383b8[_0x0317('0x5b')]);});if(!_[_0x0317('0x63')](_0x32c60a)){return _[_0x0317('0x2c')](_0x32c60a,function(_0x21fc26){return _0x21fc26[_0x0317('0x5b')];});}else{return;}})['then'](function(_0x53e792){if(_0x53e792)_0x1311af=_0x53e792;if(_['includes'](_0x1311af,0x64)){var _0x29cbc7=_[_0x0317('0x48')](_0x32c60a,{'sectionId':0x64});return hasDefaultDashboard(_0x29cbc7)[_0x0317('0x25')](function(_0x4367b){return _[_0x0317('0x2c')](_0x32c60a,function(_0x1923b9){if(_0x1923b9['sectionId']===0x64){_0x1923b9[_0x0317('0x64')]=_0x4367b;}return _0x1923b9;});});}else{return;}})['then'](function(_0x577132){if(_0x577132)_0x32c60a=_0x577132;if(_[_0x0317('0x62')](_0x1311af,0x3eb)){var _0x2c1fc1=_[_0x0317('0x48')](_0x32c60a,{'sectionId':0x3eb});return getCustomDashboards(_0x2c1fc1)['then'](function(_0x17946a){return _[_0x0317('0x2c')](_0x32c60a,function(_0x3e3956){if(_0x2c1fc1['enabled']){if(_0x3e3956['sectionId']===0x3eb){_0x3e3956['subsections']=_0x17946a;}}else{if(_0x3e3956[_0x0317('0x5b')]===0x64){_0x3e3956[_0x0317('0x64')]=_0x17946a;}}return _0x3e3956;});});}else{return;}})[_0x0317('0x25')](function(_0x3efce8){if(_0x3efce8)_0x32c60a=_0x3efce8;if(_[_0x0317('0x62')](_0x1311af,0x709)){var _0x4b7d00=_[_0x0317('0x48')](_0x32c60a,{'sectionId':0x709});return getPlugins(_0x4b7d00)['then'](function(_0x27c26b){if(_0x4b7d00[_0x0317('0x61')]){return _[_0x0317('0x2c')](_0x32c60a,function(_0x298d24){if(_0x298d24[_0x0317('0x5b')]===0x709){_0x298d24[_0x0317('0x64')]=_0x27c26b;}return _0x298d24;});}else{var _0x163bba={'sectionId':0x76c,'enabled':0x1,'subsections':_0x27c26b};var _0x56c1a3=_[_0x0317('0x2c')](_0x32c60a);_0x56c1a3[_0x0317('0x5d')](_0x163bba);return _0x56c1a3;}});}else{return;}})[_0x0317('0x25')](function(_0x58ef83){if(_0x58ef83)_0x32c60a=_0x58ef83;return _[_0x0317('0x3e')](_0x32c60a,[_0x0317('0x61'),0x1]);})['then'](respondWithResult(_0x46d012,null))['catch'](handleError(_0x46d012,null));};function hasDefaultDashboard(_0x39626b){var _0x370845=[0x65];return new BPromise(function(_0xb93e39,_0x6fa505){try{if(_0x39626b[_0x0317('0x54')]){_0xb93e39(_0x370845);}else{return db[_0x0317('0x55')][_0x0317('0x65')]({'where':{'sectionId':_0x39626b['id']},'raw':!![]})['then'](function(_0x5a3b07){_0x5a3b07?_0xb93e39(_0x370845):_0xb93e39();});}}catch(_0x1d783c){_0x6fa505(_0x1d783c);}});}function getCustomDashboards(_0x726f7e){var _0x572924=[];return new BPromise(function(_0x5283b1,_0x37ce44){try{if(_0x726f7e['autoAssociation']){return db[_0x0317('0x66')][_0x0317('0x43')]({'raw':!![]})['then'](function(_0x46c386){_0x46c386['forEach'](function(_0x20e938){_0x572924[_0x0317('0x5d')](_0x20e938['id']+0x1869f);});_0x5283b1(_0x572924);});}else{return db[_0x0317('0x55')][_0x0317('0x43')]({'where':{'sectionId':_0x726f7e['id']},'raw':!![]})[_0x0317('0x25')](function(_0x92c411){_0x92c411[_0x0317('0x67')](function(_0x5d1e21){_0x572924[_0x0317('0x5d')](_0x5d1e21[_0x0317('0x68')]+0x1869f);});_0x5283b1(_0x572924);});}}catch(_0x1bd621){_0x37ce44(_0x1bd621);}});}function getPlugins(_0xa0fc7b){var _0x45f4c8=[];return new BPromise(function(_0x2a7246,_0x5e43f8){try{if(_0xa0fc7b['autoAssociation']){return db['Plugin'][_0x0317('0x43')]({'raw':!![]})[_0x0317('0x25')](function(_0x5c8600){_0x5c8600[_0x0317('0x67')](function(_0x11aa0c){_0x45f4c8['push'](_0x11aa0c['id']+0x15b38);});_0x2a7246(_0x45f4c8);});}else{return db[_0x0317('0x55')][_0x0317('0x43')]({'where':{'sectionId':_0xa0fc7b['id']},'raw':!![]})[_0x0317('0x25')](function(_0x5d16dc){_0x5d16dc['forEach'](function(_0x55fe25){_0x45f4c8[_0x0317('0x5d')](_0x55fe25[_0x0317('0x68')]+0x15b38);});_0x2a7246(_0x45f4c8);});}}catch(_0x12d407){_0x5e43f8(_0x12d407);}});}exports['addResources']=function(_0x2d1e1e,_0x2e61aa){return db[_0x0317('0x2d')][_0x0317('0x48')]({'where':{'id':_0x2d1e1e[_0x0317('0x47')]['id']}})[_0x0317('0x25')](handleEntityNotFound(_0x2e61aa,null))[_0x0317('0x25')](function(_0x17329f){if(_0x17329f){return db[_0x0317('0x51')]['transaction'](function(_0x262dc1){return db[_0x0317('0x57')][_0x0317('0x43')]({'where':{'userProfileId':_0x2d1e1e['params']['id']},'attributes':['id'],'raw':!![]})['then'](function(_0x73c4bf){if(_0x73c4bf){return db[_0x0317('0x57')]['destroy']({'where':{'userProfileId':_0x2d1e1e[_0x0317('0x47')]['id'],'id':_[_0x0317('0x2c')](_0x73c4bf,function(_0x3ad14c){return _0x3ad14c['id'];})},'transaction':_0x262dc1});}})['then'](function(_0x33ce4c){var _0x517db4=_[_0x0317('0x2c')](_0x2d1e1e[_0x0317('0x4a')],function(_0x365986){_0x365986['userProfileId']=_0x2d1e1e[_0x0317('0x47')]['id'];return _0x365986;});return db[_0x0317('0x57')][_0x0317('0x69')](_0x517db4,{'raw':!![],'transaction':_0x262dc1});})[_0x0317('0x25')](function(_0x203268){var _0x1c2097=_[_0x0317('0x3e')](_[_0x0317('0x2c')](_0x203268,function(_0x2bc06c){return _0x2bc06c['get']({'plain':!![]});}),{'includeAll':![]});if(_0x1c2097){return db[_0x0317('0x57')][_0x0317('0x43')]({'where':{'userProfileId':_0x2d1e1e['params']['id'],'sectionId':_['map'](_0x1c2097,function(_0xb8495c){return _0xb8495c['sectionId'];})},'attributes':['id',_0x0317('0x5b')],'raw':!![]})[_0x0317('0x25')](function(_0x59ead7){var _0x4c8a83=_[_0x0317('0x2c')](_0x2d1e1e[_0x0317('0x4a')],function(_0x4fc82e){_0x4fc82e[_0x0317('0x5c')]=_0x2d1e1e['params']['id'];return _0x4fc82e;});return db[_0x0317('0x55')][_0x0317('0x69')](_0x4c8a83,{'raw':!![],'transaction':_0x262dc1});});}})[_0x0317('0x45')](handleError(_0x2e61aa,null));});}})[_0x0317('0x25')](function(_0x3e8e88){var _0x2d617c=_[_0x0317('0x2c')](_0x3e8e88,function(_0x1d3ad5){return _0x1d3ad5[_0x0317('0x4d')]({'plain':!![]});});})[_0x0317('0x25')](respondWithResult(_0x2e61aa,null))[_0x0317('0x45')](handleError(_0x2e61aa,null));};exports[_0x0317('0x6a')]=function(_0x51c72e,_0x5b99c5,_0xaab3e){return db[_0x0317('0x2d')][_0x0317('0x48')]({'where':{'id':_0x51c72e[_0x0317('0x47')]['id']}})[_0x0317('0x25')](handleEntityNotFound(_0x5b99c5,null))[_0x0317('0x25')](function(_0x50d600){if(_0x50d600){return _0x50d600[_0x0317('0x6a')](_0x51c72e['query']['ids']);}})[_0x0317('0x25')](respondWithStatusCode(_0x5b99c5,null))['catch'](handleError(_0x5b99c5,null));};exports[_0x0317('0x6b')]=function(_0x245574,_0x49891c){var _0x4ce0bb={'raw':![],'where':{}};var _0x580aed={};var _0x202ad6={'count':0x0,'rows':[]};var _0x58d093=_0x245574[_0x0317('0x33')][_0x0317('0x6c')];if(typeof _0x58d093===_0x0317('0x6d')){throw new db[(_0x0317('0x6e'))][(_0x0317('0x6f'))](_0x0317('0x70'));}var _0x4abe0a=_0x245574[_0x0317('0x33')][_0x0317('0x71')]||![];var _0x2ab8a8=getQueryModels(_0x58d093,_0x4abe0a);if(typeof _0x2ab8a8[_0x0317('0x72')]==='undefined'){throw new db[(_0x0317('0x6e'))][(_0x0317('0x6f'))](_0x0317('0x73')+_0x58d093+'\x27');}var _0x3cb2a1=[];if(!_[_0x0317('0x63')](_0x2ab8a8[_0x0317('0x74')])){_0x3cb2a1=_0x2ab8a8[_0x0317('0x74')];}else{_0x3cb2a1=[{'name':_0x58d093}];}return db[_0x0317('0x2d')]['findOne']({'where':{'id':_0x245574[_0x0317('0x47')]['id']}})[_0x0317('0x25')](handleEntityNotFound(_0x49891c,null))[_0x0317('0x25')](function(_0x61333d){if(_0x61333d){var _0x323dd4=[];for(var _0x2e51c4=0x0;_0x2e51c4<_0x3cb2a1[_0x0317('0x4c')];_0x2e51c4++){_0x323dd4[_0x0317('0x5d')](db[_0x0317('0x57')][_0x0317('0x65')]({'where':{'userProfileId':_0x61333d['id'],'name':_0x3cb2a1[_0x2e51c4][_0x0317('0x29')]},'raw':!![]}));}return BPromise[_0x0317('0x75')](_0x323dd4);}})[_0x0317('0x25')](function(_0x381175){var _0x4515d7=_['filter'](_0x381175,function(_0x438251){return _0x438251?_0x438251:undefined;});var _0x431776=_[_0x0317('0x3e')](_0x3cb2a1,[_0x0317('0x76'),!![]]);var _0x389434=_[_0x0317('0x63')](_0x4515d7)&&_[_0x0317('0x63')](_0x431776)?null:_[_0x0317('0x77')](_0x431776,_0x4515d7);if(_0x389434){var _0x5a6939=[];for(var _0x251ee1=0x0;_0x251ee1<_0x389434[_0x0317('0x4c')];_0x251ee1++){var _0x432772=_[_0x0317('0x48')](_0x3cb2a1,function(_0x5f4c64){return _0x389434[_0x251ee1]?_0x5f4c64['name']===_0x389434[_0x251ee1][_0x0317('0x29')]:null;});if(_0x432772){if(_0x389434[_0x251ee1]['ignore']){_0x5a6939['push'](getAllResources(_0x2ab8a8[_0x0317('0x72')],_0x389434[_0x251ee1]));}else{if(!_0x389434[_0x251ee1][_0x0317('0x54')]){_0x5a6939[_0x0317('0x5d')](getAllowedResources(_0x432772,_0x389434[_0x251ee1],_0x2ab8a8[_0x0317('0x72')]));}else{if(_0x432772['model']){_0x5a6939[_0x0317('0x5d')](getAllFilteredResources(_0x432772,_0x389434[_0x251ee1]));}}}}}return BPromise['all'](_0x5a6939);}else{return null;}})[_0x0317('0x25')](function(_0x444832){var _0xdb989c=_0x444832;var _0x21fcab=null;if(_0xdb989c){_0x21fcab=_0xdb989c['length']===0x1?_0xdb989c[0x0]:null;}if(_0x21fcab||_0xdb989c){var _0x2cb508=db[_0x2ab8a8[_0x0317('0x72')]][_0x0317('0x2e')];_0x580aed[_0x0317('0x32')]=_[_0x0317('0x34')](_0x2cb508);_0x580aed[_0x0317('0x33')]=_[_0x0317('0x34')](_0x245574['query']);_0x580aed[_0x0317('0x35')]=_[_0x0317('0x36')](_0x580aed[_0x0317('0x32')],_0x580aed[_0x0317('0x33')]);_0x4ce0bb['attributes']=_['intersection'](_0x580aed['model'],qs[_0x0317('0x37')](_0x245574[_0x0317('0x33')][_0x0317('0x37')]));_0x4ce0bb[_0x0317('0x38')]=_0x4ce0bb['attributes'][_0x0317('0x4c')]?_0x4ce0bb[_0x0317('0x38')]:_0x580aed[_0x0317('0x32')];if(!_0x245574['query'][_0x0317('0x39')](_0x0317('0x3a'))){_0x4ce0bb[_0x0317('0x20')]=qs[_0x0317('0x20')](_0x245574[_0x0317('0x33')][_0x0317('0x20')]);_0x4ce0bb[_0x0317('0x1f')]=qs[_0x0317('0x1f')](_0x245574['query']['offset']);}_0x4ce0bb[_0x0317('0x3b')]=qs[_0x0317('0x3c')](_0x245574['query'][_0x0317('0x3c')]);_0x4ce0bb[_0x0317('0x3d')]=qs[_0x0317('0x35')](_[_0x0317('0x78')](_0x245574[_0x0317('0x33')],_0x580aed[_0x0317('0x35')]));if(_0x245574['query'][_0x0317('0x3e')]){_0x4ce0bb['where']=_[_0x0317('0x3f')](_0x4ce0bb[_0x0317('0x3d')],{'$or':_[_0x0317('0x2c')](_0x2cb508,function(_0x506a3a){if(_0x506a3a[_0x0317('0x30')][_0x0317('0x31')]!==_0x0317('0x79')){var _0x2bcaa8={};_0x2bcaa8[_0x506a3a['field']]={'$like':'%'+_0x245574['query']['filter']+'%'};return _0x2bcaa8;}})});}var _0x5535cc=[];if(_0x21fcab){var _0x3e8b2c=_[_0x0317('0x48')](_0x3cb2a1,['name',_0x21fcab['name']]);if(_0x3e8b2c[_0x0317('0x7a')]){var _0x40c52d={};if(_0x2ab8a8[_0x0317('0x72')]===_0x0317('0x7b')){_0x40c52d[_0x3e8b2c[_0x0317('0x7c')]]=_[_0x0317('0x2c')](_0x21fcab[_0x0317('0x7d')],'id');}else{_0x40c52d[_0x3e8b2c[_0x0317('0x7c')]]=_0x21fcab[_0x0317('0x7d')];}_0x5535cc[_0x0317('0x5d')](_0x40c52d);}else{_0x4ce0bb[_0x0317('0x3d')]['id']=_0x21fcab['associatedResources'];}}else{for(var _0x2ece2b=0x0;_0x2ece2b<_0xdb989c[_0x0317('0x4c')];_0x2ece2b++){var _0x3e8b2c=_[_0x0317('0x48')](_0x3cb2a1,[_0x0317('0x29'),_0xdb989c[_0x2ece2b]['name']]);if(_0x3e8b2c[_0x0317('0x7a')]){var _0x40c52d={};_0x40c52d[_0x3e8b2c[_0x0317('0x7c')]]=_0xdb989c[_0x2ece2b][_0x0317('0x7d')];_0x5535cc[_0x0317('0x5d')](_0x40c52d);}else{if(!_0x4ce0bb['where']['id'])_0x4ce0bb[_0x0317('0x3d')]['id']=[];_0xdb989c[_0x2ece2b][_0x0317('0x7d')][_0x0317('0x67')](function(_0x18b6b7){_0x4ce0bb[_0x0317('0x3d')]['id'][_0x0317('0x5d')](_0x18b6b7);});}}}if(!_[_0x0317('0x63')](_0x5535cc)){_0x4ce0bb[_0x0317('0x3d')]=_[_0x0317('0x3f')](_0x4ce0bb[_0x0317('0x3d')],{'$and':{'$or':_0x5535cc}});}_0x4ce0bb=_[_0x0317('0x3f')]({},_0x4ce0bb,_0x245574[_0x0317('0x40')]);if(_0x21fcab&&!_0x21fcab[_0x0317('0x54')]&&_0x2ab8a8[_0x0317('0x72')]===_0x0317('0x7b')){if(_0x245574[_0x0317('0x33')][_0x0317('0x41')]){_0x4ce0bb[_0x0317('0x42')]=[{'all':!![]}];}return db[_0x2ab8a8[_0x0317('0x72')]][_0x0317('0x43')](_0x4ce0bb)[_0x0317('0x25')](function(_0x565d3d){var _0x46ef9e=[];_0x565d3d[_0x0317('0x67')](function(_0x4e35d1){var _0x2b5be4;switch(_0x4e35d1[_0x0317('0x7e')]){case _0x0317('0x7f'):_0x2b5be4=_['find'](_0x21fcab[_0x0317('0x7d')],function(_0x2ae30c){return _0x2ae30c['id']===_0x4e35d1['reportId']&&_0x2ae30c['type']==='DefaultReports';});break;case _0x0317('0x80'):_0x2b5be4=_[_0x0317('0x48')](_0x21fcab[_0x0317('0x7d')],function(_0x397349){return _0x397349['id']===_0x4e35d1[_0x0317('0x81')]&&_0x397349[_0x0317('0x30')]===_0x0317('0x82');});break;}if(_0x2b5be4)_0x46ef9e[_0x0317('0x5d')](_0x4e35d1);});_0x202ad6[_0x0317('0x1e')]=_0x46ef9e[_0x0317('0x4c')];_0x202ad6['rows']=_0x46ef9e;return _0x202ad6;});}else{return db[_0x2ab8a8[_0x0317('0x72')]][_0x0317('0x1e')]({'where':_0x4ce0bb['where']})[_0x0317('0x25')](function(_0x1ab414){_0x202ad6['count']=_0x1ab414;if(_0x245574[_0x0317('0x33')][_0x0317('0x41')]){if(_0x2ab8a8[_0x0317('0x72')]===_0x0317('0x83')){_0x4ce0bb['include']=[{'model':db[_0x0317('0x84')],'as':_0x0317('0x85'),'attributes':['id',_0x0317('0x29'),_0x0317('0x86')],'required':_0x245574[_0x0317('0x33')]['tag']?!![]:![]},{'model':db[_0x0317('0x84')],'as':_0x0317('0x87'),'attributes':['id',_0x0317('0x29'),_0x0317('0x86')],'through':_0x245574['query'][_0x0317('0x88')]?{'attributes':[],'where':{'TagId':_0x245574[_0x0317('0x33')][_0x0317('0x88')]||undefined}}:{},'required':_0x245574[_0x0317('0x33')][_0x0317('0x88')]?!![]:![]}];}else{_0x4ce0bb['include']=[{'all':!![]}];}}return db[_0x2ab8a8[_0x0317('0x72')]][_0x0317('0x43')](_0x4ce0bb);})[_0x0317('0x25')](function(_0x3abedd){_0x202ad6[_0x0317('0x44')]=_0x3abedd;return _0x202ad6;});}}else{return _0x202ad6;}})[_0x0317('0x25')](respondWithFilteredResult(_0x49891c,_0x4ce0bb))[_0x0317('0x45')](handleError(_0x49891c,null));};function getAllResources(_0x12636b,_0x572ce4){return new BPromise(function(_0x8e2fa1,_0xaaa81a){if(_0x572ce4){var _0x30ea0c=_0x572ce4['filter']?{[_0x572ce4[_0x0317('0x3e')]['field']]:_0x572ce4[_0x0317('0x3e')]['value']}:undefined;return db[_0x12636b][_0x0317('0x43')]({'where':_0x30ea0c,'raw':!![]})[_0x0317('0x25')](function(_0x4d5c8e){_0x572ce4[_0x0317('0x7d')]=_[_0x0317('0x2c')](_0x4d5c8e,'id');_0x8e2fa1(_0x572ce4);})[_0x0317('0x45')](function(_0x4da42c){_0xaaa81a(_0x4da42c);});}else{_0x8e2fa1(null);}});}function getAllFilteredResources(_0x546bcf,_0x4a82ef){return new BPromise(function(_0x47f938,_0x3014f){var _0x51ecc7=_0x546bcf[_0x0317('0x3e')]?{[_0x546bcf[_0x0317('0x3e')][_0x0317('0x7a')]]:_0x546bcf['filter']['value']}:undefined;return db[_0x546bcf['model']][_0x0317('0x43')]({'where':_0x51ecc7,'raw':!![]})['then'](function(_0x215424){_0x4a82ef[_0x0317('0x7d')]=_[_0x0317('0x2c')](_0x215424,function(_0x2abc16){return _0x2abc16[_0x0317('0x29')];});_0x47f938(_0x4a82ef);})[_0x0317('0x45')](function(_0x28c2b3){_0x3014f(_0x28c2b3);});});}function getAllowedResources(_0x481c6f,_0x2fbbd9,_0x567e94){return new BPromise(function(_0x5a25f9,_0xb4ffa5){if(_0x2fbbd9){return db[_0x0317('0x55')][_0x0317('0x43')]({'where':{'sectionId':_0x2fbbd9['id']},'raw':!![]})[_0x0317('0x25')](function(_0x54c1df){if(_0x481c6f[_0x0317('0x7a')]&&_0x481c6f['field']!=='id'){_0x2fbbd9[_0x0317('0x7d')]=_[_0x0317('0x2c')](_0x54c1df,function(_0x267eb0){return _0x267eb0[_0x481c6f[_0x0317('0x7a')]];});}else{if(_0x567e94===_0x0317('0x7b')){_0x2fbbd9['associatedResources']=_[_0x0317('0x2c')](_0x54c1df,function(_0x5c0325){return{'id':_0x5c0325[_0x0317('0x68')],'type':_0x5c0325['type']};});}else{_0x2fbbd9[_0x0317('0x7d')]=_[_0x0317('0x2c')](_0x54c1df,function(_0x54e33b){return _0x54e33b[_0x0317('0x68')];});}}_0x5a25f9(_0x2fbbd9);})[_0x0317('0x45')](function(_0x49262c){_0xb4ffa5(_0x49262c);});}else{_0x5a25f9(null);}});}function getQueryModels(_0x164b79,_0x4ee25f){var _0x241fab=_0x164b79[_0x0317('0x89')]();var _0x5c87bb={'childModel':undefined,'parentSections':[]};switch(_0x241fab){case _0x0317('0x8a'):_0x5c87bb[_0x0317('0x72')]=_0x0317('0x8b');break;case _0x0317('0x8c'):_0x5c87bb[_0x0317('0x72')]='SquareOdbc';break;case _0x0317('0x8d'):_0x5c87bb[_0x0317('0x72')]=_0x0317('0x8e');_0x5c87bb[_0x0317('0x74')]=[{'name':'SquareProjects','field':_0x0317('0x29'),'foreignKey':_0x0317('0x8f')}];break;case _0x0317('0x90'):_0x5c87bb[_0x0317('0x72')]=_0x0317('0x91');break;case'contacts':_0x5c87bb[_0x0317('0x72')]=_0x0317('0x83');_0x5c87bb[_0x0317('0x74')]=[{'name':_0x0317('0x92'),'field':'id','foreignKey':_0x0317('0x93')}];break;case'lists':_0x5c87bb[_0x0317('0x72')]=_0x0317('0x94');break;case _0x0317('0x95'):_0x5c87bb[_0x0317('0x72')]=_0x0317('0x96');break;case'globalcustomfields':_0x5c87bb[_0x0317('0x72')]=_0x0317('0x97');break;case _0x0317('0x98'):_0x5c87bb['childModel']='ChatQueue';break;case _0x0317('0x99'):_0x5c87bb[_0x0317('0x72')]=_0x0317('0x9a');break;case _0x0317('0x9b'):_0x5c87bb[_0x0317('0x72')]=_0x0317('0x9c');break;case _0x0317('0x9d'):_0x5c87bb['childModel']=_0x0317('0x9e');break;case'inboundroutes':case _0x0317('0x9f'):case _0x0317('0xa0'):_0x5c87bb['childModel']=_0x0317('0xa1');break;case _0x0317('0xa2'):_0x5c87bb[_0x0317('0x72')]='VoiceContext';break;case _0x0317('0xa3'):_0x5c87bb[_0x0317('0x72')]=_0x0317('0xa4');break;case _0x0317('0xa5'):_0x5c87bb[_0x0317('0x72')]=_0x0317('0xa6');_0x5c87bb['parentSections']=[{'name':_0x0317('0xa7'),'field':_0x0317('0x29'),'foreignKey':_0x0317('0xa8'),'model':_0x0317('0xa9'),'filter':{'field':_0x0317('0xaa'),'value':[_0x0317('0xab')]}},{'name':'Telephones','field':_0x0317('0x29'),'foreignKey':'membername','model':_0x0317('0xa9'),'filter':{'field':'role','value':[_0x0317('0xac')]}},{'name':'VoiceQueues','field':_0x0317('0x29'),'foreignKey':'queue','model':_0x0317('0xad'),'filter':{'field':_0x0317('0x30'),'value':[_0x0317('0xae')]}},{'name':_0x0317('0xaf'),'field':_0x0317('0x29'),'foreignKey':_0x0317('0xb0'),'model':_0x0317('0xad'),'filter':{'field':'type','value':[_0x0317('0xb1')]}}];break;case'musiconholds':_0x5c87bb[_0x0317('0x72')]=_0x0317('0xb2');break;case _0x0317('0xb3'):_0x5c87bb[_0x0317('0x72')]='VoiceChanSpy';break;case _0x0317('0xb4'):_0x5c87bb[_0x0317('0x72')]='VoicePrefix';break;case _0x0317('0xb5'):_0x5c87bb['childModel']=_0x0317('0xb6');break;case _0x0317('0xb7'):_0x5c87bb[_0x0317('0x72')]='MailQueue';break;case _0x0317('0xb8'):_0x5c87bb[_0x0317('0x72')]=_0x0317('0xb9');break;case'mailsubstatuses':_0x5c87bb[_0x0317('0x72')]=_0x0317('0xba');break;case _0x0317('0xbb'):_0x5c87bb[_0x0317('0x72')]='OpenchannelQueue';break;case _0x0317('0xbc'):_0x5c87bb[_0x0317('0x72')]=_0x0317('0xbd');break;case'smsqueues':_0x5c87bb[_0x0317('0x72')]=_0x0317('0xbe');break;case _0x0317('0xbf'):_0x5c87bb[_0x0317('0x72')]='SmsAccount';break;case _0x0317('0xc0'):_0x5c87bb[_0x0317('0x72')]=_0x0317('0xc1');break;case'voicequeues':case'queuecampaigns':_0x5c87bb[_0x0317('0x72')]=_0x0317('0xad');if(_0x4ee25f){_0x5c87bb[_0x0317('0x74')]=[{'name':'VoiceQueues'},{'name':_0x0317('0xaf')}];}break;case _0x0317('0xc2'):case _0x0317('0xc3'):case _0x0317('0xc4'):_0x5c87bb[_0x0317('0x72')]=_0x0317('0xa9');if(_0x4ee25f){_0x5c87bb[_0x0317('0x74')]=[{'name':_0x0317('0xc5'),'filter':{'field':'role','value':['admin',_0x0317('0xc6')]},'ignore':!![]},{'name':_0x0317('0xa7')},{'name':'Telephones'}];}break;case'zendeskaccounts':_0x5c87bb[_0x0317('0x72')]=_0x0317('0xc7');break;case _0x0317('0xc8'):_0x5c87bb[_0x0317('0x72')]=_0x0317('0xc9');break;case _0x0317('0xca'):_0x5c87bb[_0x0317('0x72')]=_0x0317('0xcb');break;case _0x0317('0xcc'):_0x5c87bb['childModel']=_0x0317('0xcd');break;case _0x0317('0xce'):_0x5c87bb[_0x0317('0x72')]=_0x0317('0xcf');break;case _0x0317('0xd0'):_0x5c87bb['childModel']=_0x0317('0xd1');break;case _0x0317('0xd2'):_0x5c87bb[_0x0317('0x72')]=_0x0317('0xa9');break;case _0x0317('0xd3'):_0x5c87bb[_0x0317('0x72')]=_0x0317('0xd4');break;case _0x0317('0xd5'):_0x5c87bb['childModel']='Disposition';break;case _0x0317('0xd6'):_0x5c87bb['childModel']='Dashboard';break;case _0x0317('0xd7'):_0x5c87bb['childModel']=_0x0317('0xd8');break;case _0x0317('0xd9'):_0x5c87bb['childModel']='Pause';break;case'scheduler':_0x5c87bb['childModel']='Schedule';break;case _0x0317('0xda'):_0x5c87bb[_0x0317('0x72')]=_0x0317('0xdb');break;case'tags':_0x5c87bb[_0x0317('0x72')]=_0x0317('0x84');break;case _0x0317('0xdc'):_0x5c87bb[_0x0317('0x72')]=_0x0317('0xdd');break;case _0x0317('0xde'):_0x5c87bb[_0x0317('0x72')]=_0x0317('0xdf');break;case _0x0317('0xe0'):_0x5c87bb[_0x0317('0x72')]=_0x0317('0xe1');break;case'variables':_0x5c87bb[_0x0317('0x72')]=_0x0317('0xe2');break;case _0x0317('0xe3'):_0x5c87bb[_0x0317('0x72')]='Plugin';break;case'extractedreports':_0x5c87bb[_0x0317('0x72')]=_0x0317('0x7b');_0x5c87bb[_0x0317('0x74')]=[{'name':_0x0317('0xe4'),'field':'id','foreignKey':_0x0317('0x81')}];break;case'metrics':_0x5c87bb[_0x0317('0x72')]=_0x0317('0xe5');break;default:return _0x5c87bb;}return _0x5c87bb;}
\ No newline at end of file
+var _0x5920=['queuecampaigns','QueueCampaigns','users','agents','Users','admin','Agents','zendeskaccounts','SalesforceAccount','freshdeskaccounts','sugarcrmaccounts','SugarcrmAccount','DeskAccount','ZohoAccount','vtigeraccounts','cannedanswers','CannedAnswer','dispositions','Disposition','customdashboards','intervals','Interval','pauses','scheduler','Schedule','Sound','tags','templates','Template','triggers','Trigger','trunks','Trunk','variables','Variable','extractedreports','Reports','metrics','html-pdf','eml-format','zip-dir','fast-json-patch','request-promise','bluebird','sox','ejs','lodash','squel','crypto','jsforce','desk.js','querystring','papaparse','../../components/auth/service','../../config/logger','api','../../config/utils','../../config/environment','../../mysqldb','redis','defaults','localhost','socket.io-emitter','./userProfile.socket','sendStatus','status','end','count','offset','limit','set','Content-Range','json','reject','save','update','destroy','error','stack','name','send','index','map','UserProfile','rawAttributes','type','query','keys','filters','intersection','model','attributes','fields','length','hasOwnProperty','nolimit','sort','where','pick','merge','VIRTUAL','filter','options','then','includeAll','include','findAll','rows','catch','show','create','body','clone','find','get','omit','updatedAt','createdAt','sequelize','transaction','each','autoAssociation','UserProfileResource','sectionId','userProfileId','Resources','UserProfileSection','params','describe','addSections','push','removeSections','ids','getSections','enabled','includes','isEmpty','subsections','findOne','Dashboard','forEach','Plugin','bulkCreate','removeResources','getResources','section','undefined','Sequelize','Unknown\x20section','mergeResources','childModel','ValidationError','Invalid\x20section\x20\x27','parentSections','all','union','ignore','order','key','field','foreignKey','associatedResources','AnalyticExtractedReport','default','reportId','DefaultReports','CustomReports','CmContact','Tags','color','tag','Tag','ThroughTags','value','resourceId','toLowerCase','squareprojects','SquareProject','odbc','SquareOdbc','squarerecordings','SquareRecording','SquareProjects','projects','JscriptyProject','contacts','ListId','lists','CmCompany','globalcustomfields','CmCustomField','chatqueues','chatwebsites','ChatWebsite','faxqueues','FaxQueue','FaxAccount','inboundroutes','outboundroutes','VoiceContext','voicemails','VoiceMail','VoiceRecording','membername','User','role','agent','Telephones','telephone','VoiceQueues','queue','VoiceQueue','inbound','outbound','musiconholds','VoiceMusicOnHold','chanspies','MailQueue','mailaccounts','MailAccount','mailsubstatuses','MailSubstatus','OpenchannelQueue','smsqueues','SmsQueue','SmsAccount','voicequeues'];(function(_0x3c6dab,_0x18e012){var _0x77a3f2=function(_0x5679a7){while(--_0x5679a7){_0x3c6dab['push'](_0x3c6dab['shift']());}};_0x77a3f2(++_0x18e012);}(_0x5920,0x1ec));var _0x0592=function(_0xc1daf0,_0x507040){_0xc1daf0=_0xc1daf0-0x0;var _0x509e2a=_0x5920[_0xc1daf0];return _0x509e2a;};'use strict';var pdf=require(_0x0592('0x0'));var emlformat=require(_0x0592('0x1'));var rimraf=require('rimraf');var zipdir=require(_0x0592('0x2'));var jsonpatch=require(_0x0592('0x3'));var rp=require(_0x0592('0x4'));var moment=require('moment');var BPromise=require(_0x0592('0x5'));var Mustache=require('mustache');var util=require('util');var path=require('path');var sox=require(_0x0592('0x6'));var csv=require('to-csv');var ejs=require(_0x0592('0x7'));var fs=require('fs');var _=require(_0x0592('0x8'));var squel=require(_0x0592('0x9'));var crypto=require(_0x0592('0xa'));var jsforce=require(_0x0592('0xb'));var deskjs=require(_0x0592('0xc'));var toCsv=require('to-csv');var querystring=require(_0x0592('0xd'));var Papa=require(_0x0592('0xe'));var Redis=require('ioredis');var authService=require(_0x0592('0xf'));var qs=require('../../components/parsers/qs');var as=require('../../components/parsers/advancedSearch');var hardwareService=require('../../config/license/hardware');var logger=require(_0x0592('0x10'))(_0x0592('0x11'));var utils=require(_0x0592('0x12'));var config=require(_0x0592('0x13'));var db=require(_0x0592('0x14'))['db'];config[_0x0592('0x15')]=_[_0x0592('0x16')](config[_0x0592('0x15')],{'host':_0x0592('0x17'),'port':0x18eb});var socket=require(_0x0592('0x18'))(new Redis(config[_0x0592('0x15')]));require(_0x0592('0x19'))['register'](socket);function respondWithStatusCode(_0x55dad8,_0x45384c){_0x45384c=_0x45384c||0xcc;return function(_0x29f51b){if(_0x29f51b){return _0x55dad8[_0x0592('0x1a')](_0x45384c);}return _0x55dad8[_0x0592('0x1b')](_0x45384c)[_0x0592('0x1c')]();};}function respondWithResult(_0x45b032,_0x511848){_0x511848=_0x511848||0xc8;return function(_0x268ef6){if(_0x268ef6){return _0x45b032[_0x0592('0x1b')](_0x511848)['json'](_0x268ef6);}};}function respondWithFilteredResult(_0x42ec7c,_0xf84a8e){return function(_0x25ad6d){if(_0x25ad6d){var _0x326d32=_0x25ad6d[_0x0592('0x1d')],_0x5a3d1e=_0xf84a8e[_0x0592('0x1e')],_0xbf85e7=_0xf84a8e['offset']+_0xf84a8e[_0x0592('0x1f')],_0x2f4170;if(_0xbf85e7>=_0x326d32){_0xbf85e7=_0x326d32;_0x2f4170=0xc8;}else{_0x2f4170=0xce;}_0x42ec7c['status'](_0x2f4170);return _0x42ec7c[_0x0592('0x20')](_0x0592('0x21'),_0x5a3d1e+'-'+_0xbf85e7+'/'+_0x326d32)[_0x0592('0x22')](_0x25ad6d);}return null;};}function patchUpdates(_0x23325f){return function(_0x31475f){try{jsonpatch['apply'](_0x31475f,_0x23325f,!![]);}catch(_0x25d92f){return BPromise[_0x0592('0x23')](_0x25d92f);}return _0x31475f[_0x0592('0x24')]();};}function saveUpdates(_0xa1343f,_0x18319e){return function(_0x466110){if(_0x466110){return _0x466110[_0x0592('0x25')](_0xa1343f)['then'](function(_0xbc67cb){return _0xbc67cb;});}return null;};}function removeEntity(_0x2e659,_0x1d3a0b){return function(_0x592fb0){if(_0x592fb0){return _0x592fb0[_0x0592('0x26')]()['then'](function(){_0x2e659[_0x0592('0x1b')](0xcc)[_0x0592('0x1c')]();});}};}function handleEntityNotFound(_0x2306d1,_0x15292e){return function(_0x240b12){if(!_0x240b12){_0x2306d1[_0x0592('0x1a')](0x194);}return _0x240b12;};}function handleError(_0x30d57f,_0x320f01){_0x320f01=_0x320f01||0x1f4;return function(_0x574c72){logger[_0x0592('0x27')](_0x574c72[_0x0592('0x28')]);if(_0x574c72[_0x0592('0x29')]){delete _0x574c72[_0x0592('0x29')];}_0x30d57f[_0x0592('0x1b')](_0x320f01)[_0x0592('0x2a')](_0x574c72);};}exports[_0x0592('0x2b')]=function(_0x4035ef,_0x273576){var _0x126525={},_0x572145={},_0x41d4a7={'count':0x0,'rows':[]};var _0x4ed202=_[_0x0592('0x2c')](db[_0x0592('0x2d')][_0x0592('0x2e')],function(_0x280bf5){return{'name':_0x280bf5['fieldName'],'type':_0x280bf5[_0x0592('0x2f')]['key']};});_0x572145['model']=_['map'](_0x4ed202,'name');_0x572145[_0x0592('0x30')]=_[_0x0592('0x31')](_0x4035ef[_0x0592('0x30')]);_0x572145[_0x0592('0x32')]=_[_0x0592('0x33')](_0x572145[_0x0592('0x34')],_0x572145[_0x0592('0x30')]);_0x126525[_0x0592('0x35')]=_['intersection'](_0x572145[_0x0592('0x34')],qs[_0x0592('0x36')](_0x4035ef[_0x0592('0x30')]['fields']));_0x126525[_0x0592('0x35')]=_0x126525[_0x0592('0x35')][_0x0592('0x37')]?_0x126525[_0x0592('0x35')]:_0x572145['model'];if(!_0x4035ef[_0x0592('0x30')][_0x0592('0x38')](_0x0592('0x39'))){_0x126525[_0x0592('0x1f')]=qs[_0x0592('0x1f')](_0x4035ef[_0x0592('0x30')][_0x0592('0x1f')]);_0x126525[_0x0592('0x1e')]=qs[_0x0592('0x1e')](_0x4035ef[_0x0592('0x30')][_0x0592('0x1e')]);}_0x126525['order']=qs[_0x0592('0x3a')](_0x4035ef[_0x0592('0x30')]['sort']);_0x126525[_0x0592('0x3b')]=qs[_0x0592('0x32')](_[_0x0592('0x3c')](_0x4035ef['query'],_0x572145[_0x0592('0x32')]));if(_0x4035ef[_0x0592('0x30')]['filter']){_0x126525['where']=_[_0x0592('0x3d')](_0x126525[_0x0592('0x3b')],{'$or':_[_0x0592('0x2c')](_0x4ed202,function(_0x3eac3c){if(_0x3eac3c['type']!==_0x0592('0x3e')){var _0x3b7949={};_0x3b7949[_0x3eac3c[_0x0592('0x29')]]={'$like':'%'+_0x4035ef[_0x0592('0x30')][_0x0592('0x3f')]+'%'};return _0x3b7949;}})});}_0x126525=_['merge']({},_0x126525,_0x4035ef[_0x0592('0x40')]);var _0x56d4ef={'where':_0x126525['where']};return db['UserProfile'][_0x0592('0x1d')](_0x56d4ef)[_0x0592('0x41')](function(_0x2970ba){_0x41d4a7[_0x0592('0x1d')]=_0x2970ba;if(_0x4035ef[_0x0592('0x30')][_0x0592('0x42')]){_0x126525[_0x0592('0x43')]=[{'all':!![]}];}return db[_0x0592('0x2d')][_0x0592('0x44')](_0x126525);})['then'](function(_0x1b8224){_0x41d4a7[_0x0592('0x45')]=_0x1b8224;return _0x41d4a7;})['then'](respondWithFilteredResult(_0x273576,_0x126525))[_0x0592('0x46')](handleError(_0x273576,null));};exports[_0x0592('0x47')]=function(_0x409d1f,_0x484ac8){var _0xcb14b6={'raw':![],'where':{'id':_0x409d1f['params']['id']}},_0x33c7aa={};_0x33c7aa[_0x0592('0x34')]=_['keys'](db[_0x0592('0x2d')][_0x0592('0x2e')]);_0x33c7aa[_0x0592('0x30')]=_[_0x0592('0x31')](_0x409d1f['query']);_0x33c7aa[_0x0592('0x32')]=_[_0x0592('0x33')](_0x33c7aa[_0x0592('0x34')],_0x33c7aa[_0x0592('0x30')]);_0xcb14b6['attributes']=_[_0x0592('0x33')](_0x33c7aa[_0x0592('0x34')],qs['fields'](_0x409d1f[_0x0592('0x30')][_0x0592('0x36')]));_0xcb14b6[_0x0592('0x35')]=_0xcb14b6[_0x0592('0x35')][_0x0592('0x37')]?_0xcb14b6[_0x0592('0x35')]:_0x33c7aa[_0x0592('0x34')];if(_0x409d1f[_0x0592('0x30')][_0x0592('0x42')]){_0xcb14b6[_0x0592('0x43')]=[{'all':!![]}];}_0xcb14b6=_[_0x0592('0x3d')]({},_0xcb14b6,_0x409d1f['options']);return db[_0x0592('0x2d')]['find'](_0xcb14b6)[_0x0592('0x41')](handleEntityNotFound(_0x484ac8,null))[_0x0592('0x41')](respondWithResult(_0x484ac8,null))[_0x0592('0x46')](handleError(_0x484ac8,null));};exports[_0x0592('0x48')]=function(_0x337142,_0x26f0ab){return db['UserProfile'][_0x0592('0x48')](_0x337142[_0x0592('0x49')],{})[_0x0592('0x41')](respondWithResult(_0x26f0ab,0xc9))[_0x0592('0x46')](handleError(_0x26f0ab,null));};exports[_0x0592('0x4a')]=function(_0x1b3178,_0x11ce36){var _0x37884c={'where':{'id':_0x1b3178['params']['id']}},_0x4bf831={};_0x4bf831['model']=_[_0x0592('0x31')](db[_0x0592('0x2d')][_0x0592('0x2e')]);_0x37884c[_0x0592('0x35')]=_[_0x0592('0x33')](_0x4bf831['model'],qs[_0x0592('0x36')](_0x1b3178['query'][_0x0592('0x36')]));_0x37884c[_0x0592('0x35')]=_0x37884c[_0x0592('0x35')]['length']?_0x37884c[_0x0592('0x35')]:_0x4bf831[_0x0592('0x34')];if(_0x1b3178[_0x0592('0x30')][_0x0592('0x42')]){_0x37884c['include']=[{'all':!![]}];}_0x37884c=_['merge']({},_0x37884c,_0x1b3178[_0x0592('0x40')]);return db[_0x0592('0x2d')][_0x0592('0x4b')](_0x37884c)[_0x0592('0x41')](handleEntityNotFound(_0x11ce36,null))[_0x0592('0x41')](function(_0x5c9ddd){if(_0x5c9ddd){var _0x344339=_0x5c9ddd[_0x0592('0x4c')]({'plain':!![]});_0x344339=qs[_0x0592('0x4d')](_0x344339,['id','createdAt',_0x0592('0x4e'),'crudPermissions']);_0x1b3178[_0x0592('0x49')]=_[_0x0592('0x4d')](_0x1b3178[_0x0592('0x49')],['id',_0x0592('0x4f'),_0x0592('0x4e')]);return db[_0x0592('0x50')][_0x0592('0x51')](function(_0x48a026){return db[_0x0592('0x2d')][_0x0592('0x48')](_[_0x0592('0x3d')](_0x344339,_0x1b3178['body']),{'include':_0x1b3178[_0x0592('0x30')][_0x0592('0x42')]?[{'all':!![]}]:undefined,'transaction':_0x48a026})[_0x0592('0x41')](function(_0x5eb4f9){var _0x221f53=_0x5eb4f9[_0x0592('0x4c')]({'plain':!![]});return db['UserProfileSection']['findAll']({'where':{'userProfileId':_0x1b3178['params']['id']},'raw':!![]})['then'](function(_0x325d30){if(_0x325d30){return BPromise[_0x0592('0x52')](_0x325d30,function(_0x30f8ea){return new BPromise(function(_0x2286db,_0x464629){if(_0x30f8ea[_0x0592('0x53')]===null||_0x30f8ea[_0x0592('0x53')]===0x1)_0x2286db(null);return db[_0x0592('0x54')][_0x0592('0x44')]({'where':{'sectionId':_0x30f8ea['id']},'raw':!![]})[_0x0592('0x41')](function(_0xcd13fa){var _0x1663f7=_['map'](_0xcd13fa,function(_0x2436ff){return qs['omit'](_0x2436ff,['id','createdAt','updatedAt',_0x0592('0x55')]);});_0x2286db(_0x1663f7);})[_0x0592('0x46')](function(_0x2318b1){_0x464629(_0x2318b1);});})['then'](function(_0x8cc2f7){var _0x3ac96c=qs['omit'](_0x30f8ea,['id',_0x0592('0x4f'),_0x0592('0x4e')]);_0x3ac96c[_0x0592('0x56')]=_0x221f53['id'];if(_0x8cc2f7)_0x3ac96c[_0x0592('0x57')]=_0x8cc2f7;return _0x3ac96c;})['then'](function(_0x1719f0){return db[_0x0592('0x58')]['create'](_0x1719f0,{'include':[{'model':db[_0x0592('0x54')],'as':_0x0592('0x57')}],'raw':!![],'transaction':_0x48a026});});})[_0x0592('0x41')](function(){return _0x221f53;});}});});});}})[_0x0592('0x41')](respondWithResult(_0x11ce36,0xc9))[_0x0592('0x46')](handleError(_0x11ce36,null));};exports[_0x0592('0x25')]=function(_0x1eb993,_0x5462ad){if(_0x1eb993[_0x0592('0x49')]['id']){delete _0x1eb993[_0x0592('0x49')]['id'];}return db[_0x0592('0x2d')][_0x0592('0x4b')]({'where':{'id':_0x1eb993[_0x0592('0x59')]['id']}})[_0x0592('0x41')](handleEntityNotFound(_0x5462ad,null))[_0x0592('0x41')](saveUpdates(_0x1eb993[_0x0592('0x49')],null))[_0x0592('0x41')](respondWithResult(_0x5462ad,null))['catch'](handleError(_0x5462ad,null));};exports[_0x0592('0x26')]=function(_0x3d6b1b,_0x4df0cd){return db[_0x0592('0x2d')]['find']({'where':{'id':_0x3d6b1b[_0x0592('0x59')]['id']}})[_0x0592('0x41')](handleEntityNotFound(_0x4df0cd,null))[_0x0592('0x41')](removeEntity(_0x4df0cd,null))[_0x0592('0x46')](handleError(_0x4df0cd,null));};exports[_0x0592('0x5a')]=function(_0x1e291a,_0x34f1bc){return db[_0x0592('0x2d')][_0x0592('0x5a')]()[_0x0592('0x41')](respondWithResult(_0x34f1bc,null))[_0x0592('0x46')](handleError(_0x34f1bc,null));};exports[_0x0592('0x5b')]=function(_0x1756e7,_0x533717){var _0x3778df=_0x1756e7[_0x0592('0x49')];return db[_0x0592('0x2d')][_0x0592('0x4b')]({'where':{'id':_0x1756e7[_0x0592('0x59')]['id']}})[_0x0592('0x41')](handleEntityNotFound(_0x533717,null))[_0x0592('0x41')](function(_0x3a63b0){if(_0x3a63b0){return db[_0x0592('0x50')]['transaction'](function(_0x44fe23){return db[_0x0592('0x58')][_0x0592('0x26')]({'where':{'userProfileId':_0x1756e7[_0x0592('0x59')]['id'],'sectionId':_[_0x0592('0x2c')](_0x3778df,function(_0xb690bd){return _0xb690bd[_0x0592('0x55')];})},'transaction':_0x44fe23})[_0x0592('0x41')](function(){var _0x5550cd=_[_0x0592('0x2c')](_0x3778df,function(_0x570863){_0x570863['userProfileId']=_0x1756e7[_0x0592('0x59')]['id'];return _0x570863;});var _0x20a84c=[];return BPromise[_0x0592('0x52')](_0x5550cd,function(_0x50fd48){return db[_0x0592('0x58')][_0x0592('0x48')](_0x50fd48,{'include':[{'model':db[_0x0592('0x54')],'as':_0x0592('0x57')}],'raw':!![],'transaction':_0x44fe23})[_0x0592('0x41')](function(_0x278760){_0x20a84c[_0x0592('0x5c')](_0x278760[_0x0592('0x4c')]({'plain':!![]}));});})[_0x0592('0x41')](function(){return _0x20a84c;});});});}})[_0x0592('0x41')](function(_0x2be27d){return _0x2be27d;})[_0x0592('0x41')](respondWithResult(_0x533717,null))[_0x0592('0x46')](handleError(_0x533717,null));};exports[_0x0592('0x5d')]=function(_0x22d569,_0xd897d2){var _0x22c163;return db[_0x0592('0x2d')][_0x0592('0x4b')]({'where':{'id':_0x22d569['params']['id']},'attributes':['id',_0x0592('0x29')]})[_0x0592('0x41')](handleEntityNotFound(_0xd897d2,null))[_0x0592('0x41')](function(_0x153770){if(_0x153770){_0x22c163=_0x153770;return db[_0x0592('0x58')]['destroy']({'where':{'userProfileId':_0x22d569[_0x0592('0x59')]['id'],'sectionId':_0x22d569['query'][_0x0592('0x5e')]}});}})[_0x0592('0x41')](function(){return _0x22c163;})[_0x0592('0x41')](respondWithStatusCode(_0xd897d2,null))[_0x0592('0x46')](handleError(_0xd897d2,null));};exports[_0x0592('0x5f')]=function(_0x3148ff,_0x23d175){var _0x167f4a=[];var _0x5ab3e0=[];return db[_0x0592('0x58')][_0x0592('0x44')]({'where':{'userProfileId':_0x3148ff[_0x0592('0x59')]['id']},'raw':!![]})[_0x0592('0x41')](function(_0x133d10){_0x167f4a=_[_0x0592('0x3f')](_0x133d10,function(_0x4b60f8){return _0x4b60f8[_0x0592('0x60')]===0x1||_[_0x0592('0x61')]([0x3eb,0x709],_0x4b60f8[_0x0592('0x55')]);});if(!_[_0x0592('0x62')](_0x167f4a)){return _[_0x0592('0x2c')](_0x167f4a,function(_0xe70836){return _0xe70836[_0x0592('0x55')];});}else{return;}})[_0x0592('0x41')](function(_0xc48177){if(_0xc48177)_0x5ab3e0=_0xc48177;if(_[_0x0592('0x61')](_0x5ab3e0,0x64)){var _0x407cd1=_[_0x0592('0x4b')](_0x167f4a,{'sectionId':0x64});return hasDefaultDashboard(_0x407cd1)[_0x0592('0x41')](function(_0x3ee1bb){return _['map'](_0x167f4a,function(_0x4d3c37){if(_0x4d3c37[_0x0592('0x55')]===0x64){_0x4d3c37[_0x0592('0x63')]=_0x3ee1bb;}return _0x4d3c37;});});}else{return;}})[_0x0592('0x41')](function(_0x3427a7){if(_0x3427a7)_0x167f4a=_0x3427a7;if(_['includes'](_0x5ab3e0,0x3eb)){var _0x3653a7=_[_0x0592('0x4b')](_0x167f4a,{'sectionId':0x3eb});return getCustomDashboards(_0x3653a7)[_0x0592('0x41')](function(_0x4e9a88){return _[_0x0592('0x2c')](_0x167f4a,function(_0x59e54f){if(_0x3653a7[_0x0592('0x60')]){if(_0x59e54f[_0x0592('0x55')]===0x3eb){_0x59e54f['subsections']=_0x4e9a88;}}else{if(_0x59e54f['sectionId']===0x64){_0x59e54f[_0x0592('0x63')]=_0x4e9a88;}}return _0x59e54f;});});}else{return;}})[_0x0592('0x41')](function(_0x58dd78){if(_0x58dd78)_0x167f4a=_0x58dd78;if(_[_0x0592('0x61')](_0x5ab3e0,0x709)){var _0xc2b36b=_['find'](_0x167f4a,{'sectionId':0x709});return getPlugins(_0xc2b36b)[_0x0592('0x41')](function(_0x2369d3){if(_0xc2b36b[_0x0592('0x60')]){return _[_0x0592('0x2c')](_0x167f4a,function(_0x5b3a98){if(_0x5b3a98[_0x0592('0x55')]===0x709){_0x5b3a98[_0x0592('0x63')]=_0x2369d3;}return _0x5b3a98;});}else{var _0x48a974={'sectionId':0x76c,'enabled':0x1,'subsections':_0x2369d3};var _0x3ac545=_[_0x0592('0x2c')](_0x167f4a);_0x3ac545[_0x0592('0x5c')](_0x48a974);return _0x3ac545;}});}else{return;}})[_0x0592('0x41')](function(_0x117d07){if(_0x117d07)_0x167f4a=_0x117d07;return _[_0x0592('0x3f')](_0x167f4a,[_0x0592('0x60'),0x1]);})[_0x0592('0x41')](respondWithResult(_0x23d175,null))[_0x0592('0x46')](handleError(_0x23d175,null));};function hasDefaultDashboard(_0x1c9154){var _0x597be2=[0x65];return new BPromise(function(_0x124f56,_0x5e5cc9){try{if(_0x1c9154[_0x0592('0x53')]){_0x124f56(_0x597be2);}else{return db[_0x0592('0x54')][_0x0592('0x64')]({'where':{'sectionId':_0x1c9154['id']},'raw':!![]})['then'](function(_0x453410){_0x453410?_0x124f56(_0x597be2):_0x124f56();});}}catch(_0x3d5681){_0x5e5cc9(_0x3d5681);}});}function getCustomDashboards(_0x33e6ae){var _0x4c707d=[];return new BPromise(function(_0x2b105e,_0x177d71){try{if(_0x33e6ae[_0x0592('0x53')]){return db[_0x0592('0x65')][_0x0592('0x44')]({'raw':!![]})[_0x0592('0x41')](function(_0x3c317e){_0x3c317e[_0x0592('0x66')](function(_0x2c37c5){_0x4c707d[_0x0592('0x5c')](_0x2c37c5['id']+0x1869f);});_0x2b105e(_0x4c707d);});}else{return db[_0x0592('0x54')]['findAll']({'where':{'sectionId':_0x33e6ae['id']},'raw':!![]})[_0x0592('0x41')](function(_0x105304){_0x105304[_0x0592('0x66')](function(_0x3a5b0f){_0x4c707d[_0x0592('0x5c')](_0x3a5b0f['resourceId']+0x1869f);});_0x2b105e(_0x4c707d);});}}catch(_0x3fa1fc){_0x177d71(_0x3fa1fc);}});}function getPlugins(_0x17e38a){var _0x304ab9=[];return new BPromise(function(_0x1ee3d7,_0x16a439){try{if(_0x17e38a[_0x0592('0x53')]){return db[_0x0592('0x67')][_0x0592('0x44')]({'raw':!![]})[_0x0592('0x41')](function(_0xa04bbc){_0xa04bbc['forEach'](function(_0x350b36){_0x304ab9[_0x0592('0x5c')](_0x350b36['id']+0x15b38);});_0x1ee3d7(_0x304ab9);});}else{return db['UserProfileResource'][_0x0592('0x44')]({'where':{'sectionId':_0x17e38a['id']},'raw':!![]})[_0x0592('0x41')](function(_0xe05229){_0xe05229[_0x0592('0x66')](function(_0x588abd){_0x304ab9[_0x0592('0x5c')](_0x588abd['resourceId']+0x15b38);});_0x1ee3d7(_0x304ab9);});}}catch(_0x582399){_0x16a439(_0x582399);}});}exports['addResources']=function(_0x4f58c1,_0x12d6e0){return db['UserProfile'][_0x0592('0x4b')]({'where':{'id':_0x4f58c1[_0x0592('0x59')]['id']}})[_0x0592('0x41')](handleEntityNotFound(_0x12d6e0,null))[_0x0592('0x41')](function(_0xd05739){if(_0xd05739){return db[_0x0592('0x50')][_0x0592('0x51')](function(_0x51c964){return db[_0x0592('0x58')]['findAll']({'where':{'userProfileId':_0x4f58c1[_0x0592('0x59')]['id']},'attributes':['id'],'raw':!![]})[_0x0592('0x41')](function(_0x2059bf){if(_0x2059bf){return db['UserProfileSection']['destroy']({'where':{'userProfileId':_0x4f58c1[_0x0592('0x59')]['id'],'id':_[_0x0592('0x2c')](_0x2059bf,function(_0xb4df6){return _0xb4df6['id'];})},'transaction':_0x51c964});}})[_0x0592('0x41')](function(_0x69ba08){var _0x30589c=_['map'](_0x4f58c1['body'],function(_0x5bf78a){_0x5bf78a['userProfileId']=_0x4f58c1[_0x0592('0x59')]['id'];return _0x5bf78a;});return db[_0x0592('0x58')][_0x0592('0x68')](_0x30589c,{'raw':!![],'transaction':_0x51c964});})[_0x0592('0x41')](function(_0xb4c4dc){var _0x22df08=_[_0x0592('0x3f')](_[_0x0592('0x2c')](_0xb4c4dc,function(_0x56dd6d){return _0x56dd6d['get']({'plain':!![]});}),{'includeAll':![]});if(_0x22df08){return db['UserProfileSection']['findAll']({'where':{'userProfileId':_0x4f58c1[_0x0592('0x59')]['id'],'sectionId':_[_0x0592('0x2c')](_0x22df08,function(_0xd08eac){return _0xd08eac[_0x0592('0x55')];})},'attributes':['id','sectionId'],'raw':!![]})['then'](function(_0x5e7855){var _0x496f73=_[_0x0592('0x2c')](_0x4f58c1[_0x0592('0x49')],function(_0x399b77){_0x399b77['userProfileId']=_0x4f58c1[_0x0592('0x59')]['id'];return _0x399b77;});return db[_0x0592('0x54')][_0x0592('0x68')](_0x496f73,{'raw':!![],'transaction':_0x51c964});});}})[_0x0592('0x46')](handleError(_0x12d6e0,null));});}})[_0x0592('0x41')](function(_0x30774b){var _0x2b1ed5=_[_0x0592('0x2c')](_0x30774b,function(_0x544bf0){return _0x544bf0['get']({'plain':!![]});});})[_0x0592('0x41')](respondWithResult(_0x12d6e0,null))['catch'](handleError(_0x12d6e0,null));};exports[_0x0592('0x69')]=function(_0x331b19,_0x44881e,_0x44da74){return db[_0x0592('0x2d')]['find']({'where':{'id':_0x331b19[_0x0592('0x59')]['id']}})[_0x0592('0x41')](handleEntityNotFound(_0x44881e,null))[_0x0592('0x41')](function(_0x27a7fe){if(_0x27a7fe){return _0x27a7fe[_0x0592('0x69')](_0x331b19[_0x0592('0x30')][_0x0592('0x5e')]);}})['then'](respondWithStatusCode(_0x44881e,null))[_0x0592('0x46')](handleError(_0x44881e,null));};exports[_0x0592('0x6a')]=function(_0x479347,_0x484e7f){var _0x3f9cf0={'raw':![],'where':{}};var _0x5680e3={};var _0x5e90ac={'count':0x0,'rows':[]};var _0x80e41a=_0x479347[_0x0592('0x30')][_0x0592('0x6b')];if(typeof _0x80e41a===_0x0592('0x6c')){throw new db[(_0x0592('0x6d'))]['ValidationError'](_0x0592('0x6e'));}var _0x299186=_0x479347[_0x0592('0x30')][_0x0592('0x6f')]||![];var _0x2e8bac=getQueryModels(_0x80e41a,_0x299186);if(typeof _0x2e8bac[_0x0592('0x70')]===_0x0592('0x6c')){throw new db['Sequelize'][(_0x0592('0x71'))](_0x0592('0x72')+_0x80e41a+'\x27');}var _0x2521b2=[];if(!_[_0x0592('0x62')](_0x2e8bac[_0x0592('0x73')])){_0x2521b2=_0x2e8bac[_0x0592('0x73')];}else{_0x2521b2=[{'name':_0x80e41a}];}return db[_0x0592('0x2d')][_0x0592('0x64')]({'where':{'id':_0x479347[_0x0592('0x59')]['id']}})[_0x0592('0x41')](handleEntityNotFound(_0x484e7f,null))[_0x0592('0x41')](function(_0xc29132){if(_0xc29132){var _0x57b55b=[];for(var _0x58ec04=0x0;_0x58ec04<_0x2521b2[_0x0592('0x37')];_0x58ec04++){_0x57b55b['push'](db[_0x0592('0x58')][_0x0592('0x64')]({'where':{'userProfileId':_0xc29132['id'],'name':_0x2521b2[_0x58ec04]['name']},'raw':!![]}));}return BPromise[_0x0592('0x74')](_0x57b55b);}})[_0x0592('0x41')](function(_0x1a8fde){var _0x46938a=_['filter'](_0x1a8fde,function(_0x1453ae){return _0x1453ae?_0x1453ae:undefined;});var _0xdaba23=_[_0x0592('0x3f')](_0x2521b2,['ignore',!![]]);var _0x299995=_[_0x0592('0x62')](_0x46938a)&&_[_0x0592('0x62')](_0xdaba23)?null:_[_0x0592('0x75')](_0xdaba23,_0x46938a);if(_0x299995){var _0x1eb4af=[];for(var _0x30303b=0x0;_0x30303b<_0x299995[_0x0592('0x37')];_0x30303b++){var _0x505ee7=_[_0x0592('0x4b')](_0x2521b2,function(_0x2cf7c8){return _0x299995[_0x30303b]?_0x2cf7c8['name']===_0x299995[_0x30303b][_0x0592('0x29')]:null;});if(_0x505ee7){if(_0x299995[_0x30303b][_0x0592('0x76')]){_0x1eb4af['push'](getAllResources(_0x2e8bac['childModel'],_0x299995[_0x30303b]));}else{if(!_0x299995[_0x30303b][_0x0592('0x53')]){_0x1eb4af[_0x0592('0x5c')](getAllowedResources(_0x505ee7,_0x299995[_0x30303b],_0x2e8bac[_0x0592('0x70')]));}else{if(_0x505ee7['model']){_0x1eb4af[_0x0592('0x5c')](getAllFilteredResources(_0x505ee7,_0x299995[_0x30303b]));}}}}}return BPromise[_0x0592('0x74')](_0x1eb4af);}else{return null;}})[_0x0592('0x41')](function(_0x488989){var _0x498f25=_0x488989;var _0x4676e6=null;if(_0x498f25){_0x4676e6=_0x498f25[_0x0592('0x37')]===0x1?_0x498f25[0x0]:null;}if(_0x4676e6||_0x498f25){var _0x5b9390=db[_0x2e8bac[_0x0592('0x70')]][_0x0592('0x2e')];_0x5680e3['model']=_[_0x0592('0x31')](_0x5b9390);_0x5680e3[_0x0592('0x30')]=_[_0x0592('0x31')](_0x479347[_0x0592('0x30')]);_0x5680e3['filters']=_[_0x0592('0x33')](_0x5680e3['model'],_0x5680e3[_0x0592('0x30')]);_0x3f9cf0[_0x0592('0x35')]=_[_0x0592('0x33')](_0x5680e3[_0x0592('0x34')],qs['fields'](_0x479347[_0x0592('0x30')]['fields']));_0x3f9cf0[_0x0592('0x35')]=_0x3f9cf0[_0x0592('0x35')]['length']?_0x3f9cf0[_0x0592('0x35')]:_0x5680e3['model'];if(!_0x479347['query'][_0x0592('0x38')]('nolimit')){_0x3f9cf0[_0x0592('0x1f')]=qs[_0x0592('0x1f')](_0x479347['query'][_0x0592('0x1f')]);_0x3f9cf0[_0x0592('0x1e')]=qs['offset'](_0x479347['query'][_0x0592('0x1e')]);}_0x3f9cf0[_0x0592('0x77')]=qs[_0x0592('0x3a')](_0x479347['query'][_0x0592('0x3a')]);_0x3f9cf0[_0x0592('0x3b')]=qs[_0x0592('0x32')](_['pick'](_0x479347[_0x0592('0x30')],_0x5680e3[_0x0592('0x32')]));if(_0x479347['query'][_0x0592('0x3f')]){_0x3f9cf0[_0x0592('0x3b')]=_[_0x0592('0x3d')](_0x3f9cf0[_0x0592('0x3b')],{'$or':_[_0x0592('0x2c')](_0x5b9390,function(_0x45db61){if(_0x45db61[_0x0592('0x2f')][_0x0592('0x78')]!==_0x0592('0x3e')){var _0x49598b={};_0x49598b[_0x45db61[_0x0592('0x79')]]={'$like':'%'+_0x479347[_0x0592('0x30')]['filter']+'%'};return _0x49598b;}})});}var _0xf0cd3c=[];if(_0x4676e6){var _0x40f58c=_['find'](_0x2521b2,['name',_0x4676e6['name']]);if(_0x40f58c[_0x0592('0x79')]){var _0x109679={};if(_0x2e8bac['childModel']==='AnalyticExtractedReport'){_0x109679[_0x40f58c[_0x0592('0x7a')]]=_[_0x0592('0x2c')](_0x4676e6[_0x0592('0x7b')],'id');}else{_0x109679[_0x40f58c[_0x0592('0x7a')]]=_0x4676e6['associatedResources'];}_0xf0cd3c[_0x0592('0x5c')](_0x109679);}else{_0x3f9cf0[_0x0592('0x3b')]['id']=_0x4676e6[_0x0592('0x7b')];}}else{for(var _0x573d67=0x0;_0x573d67<_0x498f25[_0x0592('0x37')];_0x573d67++){var _0x40f58c=_[_0x0592('0x4b')](_0x2521b2,[_0x0592('0x29'),_0x498f25[_0x573d67]['name']]);if(_0x40f58c['field']){var _0x109679={};_0x109679[_0x40f58c['foreignKey']]=_0x498f25[_0x573d67][_0x0592('0x7b')];_0xf0cd3c[_0x0592('0x5c')](_0x109679);}else{if(!_0x3f9cf0['where']['id'])_0x3f9cf0[_0x0592('0x3b')]['id']=[];_0x498f25[_0x573d67]['associatedResources'][_0x0592('0x66')](function(_0xe6eaa0){_0x3f9cf0[_0x0592('0x3b')]['id'][_0x0592('0x5c')](_0xe6eaa0);});}}}if(!_[_0x0592('0x62')](_0xf0cd3c)){_0x3f9cf0[_0x0592('0x3b')]=_[_0x0592('0x3d')](_0x3f9cf0[_0x0592('0x3b')],{'$and':{'$or':_0xf0cd3c}});}_0x3f9cf0=_[_0x0592('0x3d')]({},_0x3f9cf0,_0x479347[_0x0592('0x40')]);if(_0x4676e6&&!_0x4676e6[_0x0592('0x53')]&&_0x2e8bac[_0x0592('0x70')]===_0x0592('0x7c')){if(_0x479347[_0x0592('0x30')]['includeAll']){_0x3f9cf0[_0x0592('0x43')]=[{'all':!![]}];}return db[_0x2e8bac['childModel']][_0x0592('0x44')](_0x3f9cf0)[_0x0592('0x41')](function(_0x11879b){var _0x3880db=[];_0x11879b[_0x0592('0x66')](function(_0x2a6f8c){var _0x268069;switch(_0x2a6f8c['reportType']){case _0x0592('0x7d'):_0x268069=_['find'](_0x4676e6[_0x0592('0x7b')],function(_0x173d0f){return _0x173d0f['id']===_0x2a6f8c[_0x0592('0x7e')]&&_0x173d0f[_0x0592('0x2f')]===_0x0592('0x7f');});break;case'custom':_0x268069=_[_0x0592('0x4b')](_0x4676e6[_0x0592('0x7b')],function(_0x598d84){return _0x598d84['id']===_0x2a6f8c['reportId']&&_0x598d84[_0x0592('0x2f')]===_0x0592('0x80');});break;}if(_0x268069)_0x3880db['push'](_0x2a6f8c);});_0x5e90ac['count']=_0x3880db['length'];_0x5e90ac[_0x0592('0x45')]=_0x3880db;return _0x5e90ac;});}else{return db[_0x2e8bac[_0x0592('0x70')]][_0x0592('0x1d')]({'where':_0x3f9cf0['where']})[_0x0592('0x41')](function(_0x1caea4){_0x5e90ac['count']=_0x1caea4;if(_0x479347['query'][_0x0592('0x42')]){if(_0x2e8bac[_0x0592('0x70')]===_0x0592('0x81')){_0x3f9cf0[_0x0592('0x43')]=[{'model':db['Tag'],'as':_0x0592('0x82'),'attributes':['id',_0x0592('0x29'),_0x0592('0x83')],'required':_0x479347['query'][_0x0592('0x84')]?!![]:![]},{'model':db[_0x0592('0x85')],'as':_0x0592('0x86'),'attributes':['id',_0x0592('0x29'),_0x0592('0x83')],'through':_0x479347[_0x0592('0x30')][_0x0592('0x84')]?{'attributes':[],'where':{'TagId':_0x479347[_0x0592('0x30')][_0x0592('0x84')]||undefined}}:{},'required':_0x479347[_0x0592('0x30')][_0x0592('0x84')]?!![]:![]}];}else{_0x3f9cf0[_0x0592('0x43')]=[{'all':!![]}];}}return db[_0x2e8bac[_0x0592('0x70')]][_0x0592('0x44')](_0x3f9cf0);})[_0x0592('0x41')](function(_0x1dbec2){_0x5e90ac['rows']=_0x1dbec2;return _0x5e90ac;});}}else{return _0x5e90ac;}})[_0x0592('0x41')](respondWithFilteredResult(_0x484e7f,_0x3f9cf0))[_0x0592('0x46')](handleError(_0x484e7f,null));};function getAllResources(_0x1cfea2,_0x14dce4){return new BPromise(function(_0x498dc5,_0x90b3c9){if(_0x14dce4){var _0x50da0b=_0x14dce4[_0x0592('0x3f')]?{[_0x14dce4[_0x0592('0x3f')][_0x0592('0x79')]]:_0x14dce4[_0x0592('0x3f')][_0x0592('0x87')]}:undefined;return db[_0x1cfea2]['findAll']({'where':_0x50da0b,'raw':!![]})[_0x0592('0x41')](function(_0x180f3a){_0x14dce4[_0x0592('0x7b')]=_[_0x0592('0x2c')](_0x180f3a,'id');_0x498dc5(_0x14dce4);})[_0x0592('0x46')](function(_0x1753b6){_0x90b3c9(_0x1753b6);});}else{_0x498dc5(null);}});}function getAllFilteredResources(_0x5ac827,_0x126779){return new BPromise(function(_0x1a3d7e,_0x3feb2b){var _0x3513ed=_0x5ac827[_0x0592('0x3f')]?{[_0x5ac827[_0x0592('0x3f')][_0x0592('0x79')]]:_0x5ac827['filter'][_0x0592('0x87')]}:undefined;return db[_0x5ac827[_0x0592('0x34')]][_0x0592('0x44')]({'where':_0x3513ed,'raw':!![]})['then'](function(_0x1b7549){_0x126779['associatedResources']=_[_0x0592('0x2c')](_0x1b7549,function(_0x4d6a70){return _0x4d6a70[_0x0592('0x29')];});_0x1a3d7e(_0x126779);})[_0x0592('0x46')](function(_0x25e553){_0x3feb2b(_0x25e553);});});}function getAllowedResources(_0x3f5a1f,_0x2dea72,_0x3f60d6){return new BPromise(function(_0x26b7c7,_0x3e1a22){if(_0x2dea72){return db[_0x0592('0x54')][_0x0592('0x44')]({'where':{'sectionId':_0x2dea72['id']},'raw':!![]})[_0x0592('0x41')](function(_0x241ae8){if(_0x3f5a1f[_0x0592('0x79')]&&_0x3f5a1f['field']!=='id'){_0x2dea72[_0x0592('0x7b')]=_['map'](_0x241ae8,function(_0x545a5a){return _0x545a5a[_0x3f5a1f[_0x0592('0x79')]];});}else{if(_0x3f60d6===_0x0592('0x7c')){_0x2dea72['associatedResources']=_[_0x0592('0x2c')](_0x241ae8,function(_0xb9aa6e){return{'id':_0xb9aa6e[_0x0592('0x88')],'type':_0xb9aa6e[_0x0592('0x2f')]};});}else{_0x2dea72[_0x0592('0x7b')]=_[_0x0592('0x2c')](_0x241ae8,function(_0x1b0f03){return _0x1b0f03[_0x0592('0x88')];});}}_0x26b7c7(_0x2dea72);})[_0x0592('0x46')](function(_0x4584eb){_0x3e1a22(_0x4584eb);});}else{_0x26b7c7(null);}});}function getQueryModels(_0x5b332e,_0x52e2e1){var _0xdea4be=_0x5b332e[_0x0592('0x89')]();var _0x2c56ea={'childModel':undefined,'parentSections':[]};switch(_0xdea4be){case _0x0592('0x8a'):_0x2c56ea[_0x0592('0x70')]=_0x0592('0x8b');break;case _0x0592('0x8c'):_0x2c56ea[_0x0592('0x70')]=_0x0592('0x8d');break;case _0x0592('0x8e'):_0x2c56ea['childModel']=_0x0592('0x8f');_0x2c56ea[_0x0592('0x73')]=[{'name':_0x0592('0x90'),'field':_0x0592('0x29'),'foreignKey':'projectName'}];break;case _0x0592('0x91'):_0x2c56ea[_0x0592('0x70')]=_0x0592('0x92');break;case _0x0592('0x93'):_0x2c56ea[_0x0592('0x70')]=_0x0592('0x81');_0x2c56ea[_0x0592('0x73')]=[{'name':'Lists','field':'id','foreignKey':_0x0592('0x94')}];break;case _0x0592('0x95'):_0x2c56ea['childModel']='CmList';break;case'companies':_0x2c56ea['childModel']=_0x0592('0x96');break;case _0x0592('0x97'):_0x2c56ea[_0x0592('0x70')]=_0x0592('0x98');break;case _0x0592('0x99'):_0x2c56ea['childModel']='ChatQueue';break;case _0x0592('0x9a'):_0x2c56ea[_0x0592('0x70')]=_0x0592('0x9b');break;case _0x0592('0x9c'):_0x2c56ea['childModel']=_0x0592('0x9d');break;case'faxaccounts':_0x2c56ea['childModel']=_0x0592('0x9e');break;case _0x0592('0x9f'):case'internalroutes':case _0x0592('0xa0'):_0x2c56ea[_0x0592('0x70')]='VoiceExtension';break;case'contexts':_0x2c56ea[_0x0592('0x70')]=_0x0592('0xa1');break;case _0x0592('0xa2'):_0x2c56ea[_0x0592('0x70')]=_0x0592('0xa3');break;case'voicerecordings':_0x2c56ea[_0x0592('0x70')]=_0x0592('0xa4');_0x2c56ea['parentSections']=[{'name':'Agents','field':_0x0592('0x29'),'foreignKey':_0x0592('0xa5'),'model':_0x0592('0xa6'),'filter':{'field':_0x0592('0xa7'),'value':[_0x0592('0xa8')]}},{'name':_0x0592('0xa9'),'field':_0x0592('0x29'),'foreignKey':'membername','model':_0x0592('0xa6'),'filter':{'field':_0x0592('0xa7'),'value':[_0x0592('0xaa')]}},{'name':_0x0592('0xab'),'field':_0x0592('0x29'),'foreignKey':_0x0592('0xac'),'model':_0x0592('0xad'),'filter':{'field':'type','value':[_0x0592('0xae')]}},{'name':'QueueCampaigns','field':_0x0592('0x29'),'foreignKey':_0x0592('0xac'),'model':_0x0592('0xad'),'filter':{'field':_0x0592('0x2f'),'value':[_0x0592('0xaf')]}}];break;case _0x0592('0xb0'):_0x2c56ea[_0x0592('0x70')]=_0x0592('0xb1');break;case _0x0592('0xb2'):_0x2c56ea[_0x0592('0x70')]='VoiceChanSpy';break;case'voiceprefixes':_0x2c56ea[_0x0592('0x70')]='VoicePrefix';break;case'ivrcampaigns':_0x2c56ea['childModel']='Campaign';break;case'mailqueues':_0x2c56ea[_0x0592('0x70')]=_0x0592('0xb3');break;case _0x0592('0xb4'):_0x2c56ea[_0x0592('0x70')]=_0x0592('0xb5');break;case _0x0592('0xb6'):_0x2c56ea['childModel']=_0x0592('0xb7');break;case'openchannelqueues':_0x2c56ea[_0x0592('0x70')]=_0x0592('0xb8');break;case'openchannelaccounts':_0x2c56ea[_0x0592('0x70')]='OpenchannelAccount';break;case _0x0592('0xb9'):_0x2c56ea[_0x0592('0x70')]=_0x0592('0xba');break;case'smsaccounts':_0x2c56ea[_0x0592('0x70')]=_0x0592('0xbb');break;case'teams':_0x2c56ea[_0x0592('0x70')]='Team';break;case _0x0592('0xbc'):case _0x0592('0xbd'):_0x2c56ea['childModel']=_0x0592('0xad');if(_0x52e2e1){_0x2c56ea[_0x0592('0x73')]=[{'name':_0x0592('0xab')},{'name':_0x0592('0xbe')}];}break;case _0x0592('0xbf'):case _0x0592('0xc0'):case'telephones':_0x2c56ea['childModel']='User';if(_0x52e2e1){_0x2c56ea[_0x0592('0x73')]=[{'name':_0x0592('0xc1'),'filter':{'field':'role','value':[_0x0592('0xc2'),'user']},'ignore':!![]},{'name':_0x0592('0xc3')},{'name':_0x0592('0xa9')}];}break;case _0x0592('0xc4'):_0x2c56ea[_0x0592('0x70')]='ZendeskAccount';break;case'salesforceaccounts':_0x2c56ea['childModel']=_0x0592('0xc5');break;case _0x0592('0xc6'):_0x2c56ea[_0x0592('0x70')]='FreshdeskAccount';break;case _0x0592('0xc7'):_0x2c56ea[_0x0592('0x70')]=_0x0592('0xc8');break;case'deskaccounts':_0x2c56ea[_0x0592('0x70')]=_0x0592('0xc9');break;case'zohoaccounts':_0x2c56ea[_0x0592('0x70')]=_0x0592('0xca');break;case _0x0592('0xcb'):_0x2c56ea[_0x0592('0x70')]=_0x0592('0xa6');break;case _0x0592('0xcc'):_0x2c56ea[_0x0592('0x70')]=_0x0592('0xcd');break;case _0x0592('0xce'):_0x2c56ea[_0x0592('0x70')]=_0x0592('0xcf');break;case _0x0592('0xd0'):_0x2c56ea[_0x0592('0x70')]=_0x0592('0x65');break;case _0x0592('0xd1'):_0x2c56ea['childModel']=_0x0592('0xd2');break;case _0x0592('0xd3'):_0x2c56ea[_0x0592('0x70')]='Pause';break;case _0x0592('0xd4'):_0x2c56ea[_0x0592('0x70')]=_0x0592('0xd5');break;case'sounds':_0x2c56ea[_0x0592('0x70')]=_0x0592('0xd6');break;case _0x0592('0xd7'):_0x2c56ea['childModel']=_0x0592('0x85');break;case _0x0592('0xd8'):_0x2c56ea['childModel']=_0x0592('0xd9');break;case _0x0592('0xda'):_0x2c56ea[_0x0592('0x70')]=_0x0592('0xdb');break;case _0x0592('0xdc'):_0x2c56ea[_0x0592('0x70')]=_0x0592('0xdd');break;case _0x0592('0xde'):_0x2c56ea[_0x0592('0x70')]=_0x0592('0xdf');break;case'plugins':_0x2c56ea[_0x0592('0x70')]='Plugin';break;case _0x0592('0xe0'):_0x2c56ea[_0x0592('0x70')]=_0x0592('0x7c');_0x2c56ea[_0x0592('0x73')]=[{'name':_0x0592('0xe1'),'field':'id','foreignKey':_0x0592('0x7e')}];break;case _0x0592('0xe2'):_0x2c56ea[_0x0592('0x70')]='AnalyticMetric';break;default:return _0x2c56ea;}return _0x2c56ea;}
\ No newline at end of file
diff --git a/server/api/userProfile/userProfile.events.js b/server/api/userProfile/userProfile.events.js
index 37675da..1e09ae8 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 _0x7153=['UserProfile','update','remove','emit','events','../../mysqldb'];(function(_0x59ee41,_0xaf7db8){var _0x3ecd3e=function(_0x2f9291){while(--_0x2f9291){_0x59ee41['push'](_0x59ee41['shift']());}};_0x3ecd3e(++_0xaf7db8);}(_0x7153,0x118));var _0x3715=function(_0x38db3a,_0x244702){_0x38db3a=_0x38db3a-0x0;var _0x2ead95=_0x7153[_0x38db3a];return _0x2ead95;};'use strict';var EventEmitter=require(_0x3715('0x0'));var UserProfile=require(_0x3715('0x1'))['db'][_0x3715('0x2')];var UserProfileEvents=new EventEmitter();UserProfileEvents['setMaxListeners'](0x0);var events={'afterCreate':'save','afterUpdate':_0x3715('0x3'),'afterDestroy':_0x3715('0x4')};function emitEvent(_0x4d22b8){return function(_0x42a38f,_0x29c5bb,_0x297de0){UserProfileEvents[_0x3715('0x5')](_0x4d22b8+':'+_0x42a38f['id'],_0x42a38f);UserProfileEvents[_0x3715('0x5')](_0x4d22b8,_0x42a38f);_0x297de0(null);};}for(var e in events){if(events['hasOwnProperty'](e)){var event=events[e];UserProfile['hook'](e,emitEvent(event));}}module['exports']=UserProfileEvents;
\ No newline at end of file
+var _0x780e=['setMaxListeners','save','remove','emit','hasOwnProperty','hook','events','../../mysqldb','UserProfile'];(function(_0x2641f9,_0x26715f){var _0x585741=function(_0x2d1462){while(--_0x2d1462){_0x2641f9['push'](_0x2641f9['shift']());}};_0x585741(++_0x26715f);}(_0x780e,0xde));var _0xe780=function(_0x2641f9,_0x26715f){_0x2641f9=_0x2641f9-0x0;var _0x585741=_0x780e[_0x2641f9];return _0x585741;};'use strict';var EventEmitter=require(_0xe780('0x0'));var UserProfile=require(_0xe780('0x1'))['db'][_0xe780('0x2')];var UserProfileEvents=new EventEmitter();UserProfileEvents[_0xe780('0x3')](0x0);var events={'afterCreate':_0xe780('0x4'),'afterUpdate':'update','afterDestroy':_0xe780('0x5')};function emitEvent(_0x125904){return function(_0x5b7e49,_0x48fc09,_0x29e077){UserProfileEvents[_0xe780('0x6')](_0x125904+':'+_0x5b7e49['id'],_0x5b7e49);UserProfileEvents[_0xe780('0x6')](_0x125904,_0x5b7e49);_0x29e077(null);};}for(var e in events){if(events[_0xe780('0x7')](e)){var event=events[e];UserProfile[_0xe780('0x8')](e,emitEvent(event));}}module['exports']=UserProfileEvents;
\ No newline at end of file
diff --git a/server/api/userProfile/userProfile.model.js b/server/api/userProfile/userProfile.model.js
index 002b773..9baa1de 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 _0x0eb8=['define','UserProfile','user_profiles','lodash','../../config/logger','path','rimraf','../../config/environment','./userProfile.attributes'];(function(_0x14add3,_0x13ce8d){var _0x4a174f=function(_0x2b3ed7){while(--_0x2b3ed7){_0x14add3['push'](_0x14add3['shift']());}};_0x4a174f(++_0x13ce8d);}(_0x0eb8,0x13e));var _0x80eb=function(_0x4e3392,_0x5997d8){_0x4e3392=_0x4e3392-0x0;var _0x2a0760=_0x0eb8[_0x4e3392];return _0x2a0760;};'use strict';var _=require(_0x80eb('0x0'));var util=require('util');var logger=require(_0x80eb('0x1'))('api');var moment=require('moment');var BPromise=require('bluebird');var rp=require('request-promise');var fs=require('fs');var path=require(_0x80eb('0x2'));var rimraf=require(_0x80eb('0x3'));var config=require(_0x80eb('0x4'));var attributes=require(_0x80eb('0x5'));module['exports']=function(_0x576981,_0x441ea8){return _0x576981[_0x80eb('0x6')](_0x80eb('0x7'),attributes,{'tableName':_0x80eb('0x8'),'paranoid':![],'indexes':[],'timestamps':!![]});};
\ No newline at end of file
+var _0x6a04=['rimraf','../../config/environment','./userProfile.attributes','UserProfile','user_profiles','lodash','util','api','request-promise','path'];(function(_0x5b6fe5,_0x5ddf47){var _0x5928d4=function(_0x3e0846){while(--_0x3e0846){_0x5b6fe5['push'](_0x5b6fe5['shift']());}};_0x5928d4(++_0x5ddf47);}(_0x6a04,0x18b));var _0x46a0=function(_0x43d943,_0x1a30b8){_0x43d943=_0x43d943-0x0;var _0x512ffb=_0x6a04[_0x43d943];return _0x512ffb;};'use strict';var _=require(_0x46a0('0x0'));var util=require(_0x46a0('0x1'));var logger=require('../../config/logger')(_0x46a0('0x2'));var moment=require('moment');var BPromise=require('bluebird');var rp=require(_0x46a0('0x3'));var fs=require('fs');var path=require(_0x46a0('0x4'));var rimraf=require(_0x46a0('0x5'));var config=require(_0x46a0('0x6'));var attributes=require(_0x46a0('0x7'));module['exports']=function(_0x5068cc,_0x4a009b){return _0x5068cc['define'](_0x46a0('0x8'),attributes,{'tableName':_0x46a0('0x9'),'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 f92c177..9b81b33 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 _0xda19=['localhost','register','request','then','request\x20sent','UserProfile,\x20%s,\x20%s,\x20%s','stringify','error','code','message','UserProfile,\x20%s,\x20%s','info','result','util','moment','randomstring','../../mysqldb','../../config/logger','rpc','../../config/environment','jayson/promise','client','http','redis','defaults'];(function(_0x240353,_0x3ee0e5){var _0x535096=function(_0x10a80a){while(--_0x10a80a){_0x240353['push'](_0x240353['shift']());}};_0x535096(++_0x3ee0e5);}(_0xda19,0xd5));var _0x9da1=function(_0x920484,_0x2fa14b){_0x920484=_0x920484-0x0;var _0x383cd7=_0xda19[_0x920484];return _0x383cd7;};'use strict';var _=require('lodash');var util=require(_0x9da1('0x0'));var moment=require(_0x9da1('0x1'));var BPromise=require('bluebird');var rs=require(_0x9da1('0x2'));var fs=require('fs');var Redis=require('ioredis');var db=require(_0x9da1('0x3'))['db'];var utils=require('../../config/utils');var logger=require(_0x9da1('0x4'))(_0x9da1('0x5'));var config=require(_0x9da1('0x6'));var jayson=require(_0x9da1('0x7'));var client=jayson[_0x9da1('0x8')][_0x9da1('0x9')]({'port':0x232a});config[_0x9da1('0xa')]=_[_0x9da1('0xb')](config[_0x9da1('0xa')],{'host':_0x9da1('0xc'),'port':0x18eb});var socket=require('socket.io-emitter')(new Redis(config['redis']));require('./userProfile.socket')[_0x9da1('0xd')](socket);function respondWithRpcPromise(_0x493d0b,_0x33cfe5,_0x1cca84){return new BPromise(function(_0x3ba3d3,_0x1ab988){return client[_0x9da1('0xe')](_0x493d0b,_0x1cca84)[_0x9da1('0xf')](function(_0x9fd032){logger['info']('UserProfile,\x20%s,\x20%s',_0x33cfe5,_0x9da1('0x10'));logger['debug'](_0x9da1('0x11'),_0x33cfe5,_0x9da1('0x10'),JSON[_0x9da1('0x12')](_0x9fd032));if(_0x9fd032[_0x9da1('0x13')]){if(_0x9fd032['error'][_0x9da1('0x14')]===0x1f4){logger['error']('UserProfile,\x20%s,\x20%s',_0x33cfe5,_0x9fd032[_0x9da1('0x13')]['message']);return _0x1ab988(_0x9fd032[_0x9da1('0x13')][_0x9da1('0x15')]);}logger[_0x9da1('0x13')](_0x9da1('0x16'),_0x33cfe5,_0x9fd032[_0x9da1('0x13')]['message']);return _0x3ba3d3(_0x9fd032[_0x9da1('0x13')][_0x9da1('0x15')]);}else{logger[_0x9da1('0x17')](_0x9da1('0x16'),_0x33cfe5,_0x9da1('0x10'));_0x3ba3d3(_0x9fd032[_0x9da1('0x18')]['message']);}})['catch'](function(_0x17205d){logger[_0x9da1('0x13')](_0x9da1('0x16'),_0x33cfe5,_0x17205d);_0x1ab988(_0x17205d);});});}
\ No newline at end of file
+var _0xeec6=['localhost','socket.io-emitter','./userProfile.socket','register','request','info','request\x20sent','debug','UserProfile,\x20%s,\x20%s,\x20%s','stringify','error','code','UserProfile,\x20%s,\x20%s','message','result','lodash','util','moment','bluebird','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','client','http','defaults','redis'];(function(_0x18b4f6,_0x1025e4){var _0x4f58f2=function(_0x43eb22){while(--_0x43eb22){_0x18b4f6['push'](_0x18b4f6['shift']());}};_0x4f58f2(++_0x1025e4);}(_0xeec6,0x1c2));var _0x6eec=function(_0x13a8cc,_0x45b4fc){_0x13a8cc=_0x13a8cc-0x0;var _0x31b53c=_0xeec6[_0x13a8cc];return _0x31b53c;};'use strict';var _=require(_0x6eec('0x0'));var util=require(_0x6eec('0x1'));var moment=require(_0x6eec('0x2'));var BPromise=require(_0x6eec('0x3'));var rs=require('randomstring');var fs=require('fs');var Redis=require(_0x6eec('0x4'));var db=require(_0x6eec('0x5'))['db'];var utils=require(_0x6eec('0x6'));var logger=require(_0x6eec('0x7'))(_0x6eec('0x8'));var config=require(_0x6eec('0x9'));var jayson=require('jayson/promise');var client=jayson[_0x6eec('0xa')][_0x6eec('0xb')]({'port':0x232a});config['redis']=_[_0x6eec('0xc')](config[_0x6eec('0xd')],{'host':_0x6eec('0xe'),'port':0x18eb});var socket=require(_0x6eec('0xf'))(new Redis(config['redis']));require(_0x6eec('0x10'))[_0x6eec('0x11')](socket);function respondWithRpcPromise(_0x1c774d,_0x49ad4c,_0x595dd4){return new BPromise(function(_0x5e8aba,_0x295cae){return client[_0x6eec('0x12')](_0x1c774d,_0x595dd4)['then'](function(_0x4b8de1){logger[_0x6eec('0x13')]('UserProfile,\x20%s,\x20%s',_0x49ad4c,_0x6eec('0x14'));logger[_0x6eec('0x15')](_0x6eec('0x16'),_0x49ad4c,_0x6eec('0x14'),JSON[_0x6eec('0x17')](_0x4b8de1));if(_0x4b8de1['error']){if(_0x4b8de1[_0x6eec('0x18')][_0x6eec('0x19')]===0x1f4){logger[_0x6eec('0x18')](_0x6eec('0x1a'),_0x49ad4c,_0x4b8de1[_0x6eec('0x18')][_0x6eec('0x1b')]);return _0x295cae(_0x4b8de1[_0x6eec('0x18')][_0x6eec('0x1b')]);}logger[_0x6eec('0x18')](_0x6eec('0x1a'),_0x49ad4c,_0x4b8de1['error'][_0x6eec('0x1b')]);return _0x5e8aba(_0x4b8de1['error'][_0x6eec('0x1b')]);}else{logger[_0x6eec('0x13')]('UserProfile,\x20%s,\x20%s',_0x49ad4c,_0x6eec('0x14'));_0x5e8aba(_0x4b8de1[_0x6eec('0x1c')][_0x6eec('0x1b')]);}})['catch'](function(_0x87f3be){logger[_0x6eec('0x18')](_0x6eec('0x1a'),_0x49ad4c,_0x87f3be);_0x295cae(_0x87f3be);});});}
\ No newline at end of file
diff --git a/server/api/userProfile/userProfile.socket.js b/server/api/userProfile/userProfile.socket.js
index 35a226c..62738b9 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 _0x1173=['update','removeListener','register','./userProfile.events','save','remove'];(function(_0x33221d,_0x119ea3){var _0x161fdb=function(_0xd90343){while(--_0xd90343){_0x33221d['push'](_0x33221d['shift']());}};_0x161fdb(++_0x119ea3);}(_0x1173,0x1ef));var _0x3117=function(_0x490b05,_0x7f0934){_0x490b05=_0x490b05-0x0;var _0x37ad3c=_0x1173[_0x490b05];return _0x37ad3c;};'use strict';var UserProfileEvents=require(_0x3117('0x0'));var events=[_0x3117('0x1'),_0x3117('0x2'),_0x3117('0x3')];function createListener(_0x3918fe,_0x266992){return function(_0x2ed10f){_0x266992['emit'](_0x3918fe,_0x2ed10f);};}function removeListener(_0x855769,_0x5367c8){return function(){UserProfileEvents[_0x3117('0x4')](_0x855769,_0x5367c8);};}exports[_0x3117('0x5')]=function(_0x23cde9){for(var _0x37653f=0x0,_0x2ec377=events['length'];_0x37653f<_0x2ec377;_0x37653f++){var _0x5d256d=events[_0x37653f];var _0x519733=createListener('userProfile:'+_0x5d256d,_0x23cde9);UserProfileEvents['on'](_0x5d256d,_0x519733);}};
\ No newline at end of file
+var _0xbacd=['remove','removeListener','register','length','userProfile:','save'];(function(_0x558e1e,_0x3fd803){var _0x5ba193=function(_0x1c2975){while(--_0x1c2975){_0x558e1e['push'](_0x558e1e['shift']());}};_0x5ba193(++_0x3fd803);}(_0xbacd,0xcb));var _0xdbac=function(_0x497c6d,_0x1b491e){_0x497c6d=_0x497c6d-0x0;var _0x813a7b=_0xbacd[_0x497c6d];return _0x813a7b;};'use strict';var UserProfileEvents=require('./userProfile.events');var events=[_0xdbac('0x0'),_0xdbac('0x1'),'update'];function createListener(_0x219a58,_0x5982b1){return function(_0xa4c1f3){_0x5982b1['emit'](_0x219a58,_0xa4c1f3);};}function removeListener(_0x59ae57,_0x469114){return function(){UserProfileEvents[_0xdbac('0x2')](_0x59ae57,_0x469114);};}exports[_0xdbac('0x3')]=function(_0x8f7a5a){for(var _0x38b724=0x0,_0x33a8bc=events[_0xdbac('0x4')];_0x38b724<_0x33a8bc;_0x38b724++){var _0x9a1f4f=events[_0x38b724];var _0x3a995=createListener(_0xdbac('0x5')+_0x9a1f4f,_0x8f7a5a);UserProfileEvents['on'](_0x9a1f4f,_0x3a995);}};
\ No newline at end of file
diff --git a/server/api/userProfileResource/index.js b/server/api/userProfileResource/index.js
index b80cf2e..6cd1a51 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 _0x23d2=['./userProfileResource.controller','get','isAuthenticated','index','/describe','describe','/:id','show','post','put','update','delete','destroy','exports','multer','util','connect-timeout','express','../../components/auth/service','../../config/environment'];(function(_0x3e406c,_0x23d3f6){var _0x5cc0be=function(_0x2f68fa){while(--_0x2f68fa){_0x3e406c['push'](_0x3e406c['shift']());}};_0x5cc0be(++_0x23d3f6);}(_0x23d2,0x18a));var _0x223d=function(_0x13ee6e,_0x1f19c7){_0x13ee6e=_0x13ee6e-0x0;var _0x6fabd4=_0x23d2[_0x13ee6e];return _0x6fabd4;};'use strict';var multer=require(_0x223d('0x0'));var util=require(_0x223d('0x1'));var path=require('path');var timeout=require(_0x223d('0x2'));var express=require(_0x223d('0x3'));var router=express['Router']();var auth=require(_0x223d('0x4'));var interaction=require('../../components/interaction/service');var config=require(_0x223d('0x5'));var controller=require(_0x223d('0x6'));router[_0x223d('0x7')]('/',auth[_0x223d('0x8')](),controller[_0x223d('0x9')]);router[_0x223d('0x7')](_0x223d('0xa'),auth[_0x223d('0x8')](),controller[_0x223d('0xb')]);router['get'](_0x223d('0xc'),auth['isAuthenticated'](),controller[_0x223d('0xd')]);router[_0x223d('0xe')]('/',auth[_0x223d('0x8')](),controller['create']);router[_0x223d('0xf')](_0x223d('0xc'),auth['isAuthenticated'](),controller[_0x223d('0x10')]);router[_0x223d('0x11')]('/:id',auth[_0x223d('0x8')](),controller[_0x223d('0x12')]);module[_0x223d('0x13')]=router;
\ No newline at end of file
+var _0x9443=['../../components/interaction/service','../../config/environment','./userProfileResource.controller','get','isAuthenticated','/describe','describe','/:id','show','post','create','put','update','delete','destroy','multer','util','express','Router','../../components/auth/service'];(function(_0x4409e7,_0x307f17){var _0x24c751=function(_0x3a7d33){while(--_0x3a7d33){_0x4409e7['push'](_0x4409e7['shift']());}};_0x24c751(++_0x307f17);}(_0x9443,0xc3));var _0x3944=function(_0x3a4f18,_0x1af741){_0x3a4f18=_0x3a4f18-0x0;var _0x4c20fc=_0x9443[_0x3a4f18];return _0x4c20fc;};'use strict';var multer=require(_0x3944('0x0'));var util=require(_0x3944('0x1'));var path=require('path');var timeout=require('connect-timeout');var express=require(_0x3944('0x2'));var router=express[_0x3944('0x3')]();var auth=require(_0x3944('0x4'));var interaction=require(_0x3944('0x5'));var config=require(_0x3944('0x6'));var controller=require(_0x3944('0x7'));router[_0x3944('0x8')]('/',auth[_0x3944('0x9')](),controller['index']);router[_0x3944('0x8')](_0x3944('0xa'),auth['isAuthenticated'](),controller[_0x3944('0xb')]);router['get'](_0x3944('0xc'),auth[_0x3944('0x9')](),controller[_0x3944('0xd')]);router[_0x3944('0xe')]('/',auth['isAuthenticated'](),controller[_0x3944('0xf')]);router[_0x3944('0x10')](_0x3944('0xc'),auth[_0x3944('0x9')](),controller[_0x3944('0x11')]);router[_0x3944('0x12')](_0x3944('0xc'),auth[_0x3944('0x9')](),controller[_0x3944('0x13')]);module['exports']=router;
\ No newline at end of file
diff --git a/server/api/userProfileResource/userProfileResource.attributes.js b/server/api/userProfileResource/userProfileResource.attributes.js
index 5f48202..9d40df9 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 _0x0297=['sequelize','exports','STRING','INTEGER'];(function(_0x4e9f1c,_0x1ab979){var _0x23817d=function(_0x5717d2){while(--_0x5717d2){_0x4e9f1c['push'](_0x4e9f1c['shift']());}};_0x23817d(++_0x1ab979);}(_0x0297,0xf0));var _0x7029=function(_0x3d8865,_0x208ca7){_0x3d8865=_0x3d8865-0x0;var _0xe69545=_0x0297[_0x3d8865];return _0xe69545;};'use strict';var Sequelize=require(_0x7029('0x0'));module[_0x7029('0x1')]={'name':{'type':Sequelize[_0x7029('0x2')],'allowNull':![]},'resourceId':{'type':Sequelize[_0x7029('0x3')],'allowNull':![]},'type':{'type':Sequelize[_0x7029('0x2')],'allowNull':![]}};
\ No newline at end of file
+var _0x0080=['INTEGER','sequelize','STRING'];(function(_0x579a56,_0x207fc7){var _0x32c458=function(_0x2206e7){while(--_0x2206e7){_0x579a56['push'](_0x579a56['shift']());}};_0x32c458(++_0x207fc7);}(_0x0080,0x9a));var _0x0008=function(_0x3b5711,_0x36eb53){_0x3b5711=_0x3b5711-0x0;var _0x4857dd=_0x0080[_0x3b5711];return _0x4857dd;};'use strict';var Sequelize=require(_0x0008('0x0'));module['exports']={'name':{'type':Sequelize[_0x0008('0x1')],'allowNull':![]},'resourceId':{'type':Sequelize[_0x0008('0x2')],'allowNull':![]},'type':{'type':Sequelize[_0x0008('0x1')],'allowNull':![]}};
\ No newline at end of file
diff --git a/server/api/userProfileResource/userProfileResource.controller.js b/server/api/userProfileResource/userProfileResource.controller.js
index 7a459a5..ed075c8 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 _0x752b=['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','status','json','count','offset','limit','set','Content-Range','apply','reject','save','update','then','end','sendStatus','error','stack','name','send','index','map','UserProfileResource','rawAttributes','fieldName','type','key','model','keys','filters','intersection','query','fields','attributes','length','hasOwnProperty','nolimit','sort','where','pick','filter','merge','includeAll','include','findAll','rows','catch','params','options','body','destroy','find','describe','html-pdf','eml-format','rimraf','fast-json-patch','request-promise','moment','mustache','util'];(function(_0x3f477c,_0x52b7ff){var _0x4c36b3=function(_0x3b47bb){while(--_0x3b47bb){_0x3f477c['push'](_0x3f477c['shift']());}};_0x4c36b3(++_0x52b7ff);}(_0x752b,0x1c0));var _0xb752=function(_0x451d9b,_0x3e5f74){_0x451d9b=_0x451d9b-0x0;var _0x1964fb=_0x752b[_0x451d9b];return _0x1964fb;};'use strict';var pdf=require(_0xb752('0x0'));var emlformat=require(_0xb752('0x1'));var rimraf=require(_0xb752('0x2'));var zipdir=require('zip-dir');var jsonpatch=require(_0xb752('0x3'));var rp=require(_0xb752('0x4'));var moment=require(_0xb752('0x5'));var BPromise=require('bluebird');var Mustache=require(_0xb752('0x6'));var util=require(_0xb752('0x7'));var path=require('path');var sox=require(_0xb752('0x8'));var csv=require(_0xb752('0x9'));var ejs=require(_0xb752('0xa'));var fs=require('fs');var _=require(_0xb752('0xb'));var squel=require(_0xb752('0xc'));var crypto=require(_0xb752('0xd'));var jsforce=require(_0xb752('0xe'));var deskjs=require(_0xb752('0xf'));var toCsv=require(_0xb752('0x9'));var querystring=require('querystring');var Papa=require(_0xb752('0x10'));var Redis=require(_0xb752('0x11'));var authService=require(_0xb752('0x12'));var qs=require(_0xb752('0x13'));var as=require(_0xb752('0x14'));var hardwareService=require(_0xb752('0x15'));var logger=require(_0xb752('0x16'))(_0xb752('0x17'));var utils=require(_0xb752('0x18'));var config=require('../../config/environment');var db=require('../../mysqldb')['db'];function respondWithStatusCode(_0x4686cb,_0x452a11){_0x452a11=_0x452a11||0xcc;return function(_0x238ff8){if(_0x238ff8){return _0x4686cb['sendStatus'](_0x452a11);}return _0x4686cb[_0xb752('0x19')](_0x452a11)['end']();};}function respondWithResult(_0x2a5607,_0x593946){_0x593946=_0x593946||0xc8;return function(_0x3f1be4){if(_0x3f1be4){return _0x2a5607[_0xb752('0x19')](_0x593946)[_0xb752('0x1a')](_0x3f1be4);}};}function respondWithFilteredResult(_0x564efc,_0x3c148f){return function(_0x9ab3da){if(_0x9ab3da){var _0x1663de=_0x9ab3da[_0xb752('0x1b')],_0x1cfc62=_0x3c148f[_0xb752('0x1c')],_0xa2bb83=_0x3c148f[_0xb752('0x1c')]+_0x3c148f[_0xb752('0x1d')],_0x1f5902;if(_0xa2bb83>=_0x1663de){_0xa2bb83=_0x1663de;_0x1f5902=0xc8;}else{_0x1f5902=0xce;}_0x564efc['status'](_0x1f5902);return _0x564efc[_0xb752('0x1e')](_0xb752('0x1f'),_0x1cfc62+'-'+_0xa2bb83+'/'+_0x1663de)[_0xb752('0x1a')](_0x9ab3da);}return null;};}function patchUpdates(_0x44c753){return function(_0x2e1ca5){try{jsonpatch[_0xb752('0x20')](_0x2e1ca5,_0x44c753,!![]);}catch(_0x30f86f){return BPromise[_0xb752('0x21')](_0x30f86f);}return _0x2e1ca5[_0xb752('0x22')]();};}function saveUpdates(_0x4155cf,_0x1e7e45){return function(_0x383224){if(_0x383224){return _0x383224[_0xb752('0x23')](_0x4155cf)['then'](function(_0x3ea715){return _0x3ea715;});}return null;};}function removeEntity(_0x522ee4,_0xa7d2d8){return function(_0x4f6f94){if(_0x4f6f94){return _0x4f6f94['destroy']()[_0xb752('0x24')](function(){_0x522ee4[_0xb752('0x19')](0xcc)[_0xb752('0x25')]();});}};}function handleEntityNotFound(_0x36c882,_0xf42a6b){return function(_0x46f669){if(!_0x46f669){_0x36c882[_0xb752('0x26')](0x194);}return _0x46f669;};}function handleError(_0x34bb1e,_0x2ff404){_0x2ff404=_0x2ff404||0x1f4;return function(_0x3f9b8d){logger[_0xb752('0x27')](_0x3f9b8d[_0xb752('0x28')]);if(_0x3f9b8d[_0xb752('0x29')]){delete _0x3f9b8d['name'];}_0x34bb1e[_0xb752('0x19')](_0x2ff404)[_0xb752('0x2a')](_0x3f9b8d);};}exports[_0xb752('0x2b')]=function(_0x3225a4,_0x503521){var _0x26977c={},_0x4a7a83={},_0x1cfcb1={'count':0x0,'rows':[]};var _0x41d24b=_[_0xb752('0x2c')](db[_0xb752('0x2d')][_0xb752('0x2e')],function(_0x3ebec0){return{'name':_0x3ebec0[_0xb752('0x2f')],'type':_0x3ebec0[_0xb752('0x30')][_0xb752('0x31')]};});_0x4a7a83[_0xb752('0x32')]=_['map'](_0x41d24b,_0xb752('0x29'));_0x4a7a83['query']=_[_0xb752('0x33')](_0x3225a4['query']);_0x4a7a83[_0xb752('0x34')]=_[_0xb752('0x35')](_0x4a7a83[_0xb752('0x32')],_0x4a7a83[_0xb752('0x36')]);_0x26977c['attributes']=_[_0xb752('0x35')](_0x4a7a83['model'],qs[_0xb752('0x37')](_0x3225a4[_0xb752('0x36')][_0xb752('0x37')]));_0x26977c[_0xb752('0x38')]=_0x26977c[_0xb752('0x38')][_0xb752('0x39')]?_0x26977c['attributes']:_0x4a7a83[_0xb752('0x32')];if(!_0x3225a4['query'][_0xb752('0x3a')](_0xb752('0x3b'))){_0x26977c['limit']=qs['limit'](_0x3225a4['query']['limit']);_0x26977c['offset']=qs['offset'](_0x3225a4['query'][_0xb752('0x1c')]);}_0x26977c['order']=qs[_0xb752('0x3c')](_0x3225a4['query'][_0xb752('0x3c')]);_0x26977c[_0xb752('0x3d')]=qs[_0xb752('0x34')](_[_0xb752('0x3e')](_0x3225a4['query'],_0x4a7a83[_0xb752('0x34')]));if(_0x3225a4[_0xb752('0x36')][_0xb752('0x3f')]){_0x26977c[_0xb752('0x3d')]=_['merge'](_0x26977c[_0xb752('0x3d')],{'$or':_[_0xb752('0x2c')](_0x41d24b,function(_0x5adb1d){if(_0x5adb1d[_0xb752('0x30')]!=='VIRTUAL'){var _0xbef444={};_0xbef444[_0x5adb1d[_0xb752('0x29')]]={'$like':'%'+_0x3225a4[_0xb752('0x36')][_0xb752('0x3f')]+'%'};return _0xbef444;}})});}_0x26977c=_[_0xb752('0x40')]({},_0x26977c,_0x3225a4['options']);var _0x3f2880={'where':_0x26977c[_0xb752('0x3d')]};return db['UserProfileResource'][_0xb752('0x1b')](_0x3f2880)[_0xb752('0x24')](function(_0x3a5cfb){_0x1cfcb1[_0xb752('0x1b')]=_0x3a5cfb;if(_0x3225a4[_0xb752('0x36')][_0xb752('0x41')]){_0x26977c[_0xb752('0x42')]=[{'all':!![]}];}return db[_0xb752('0x2d')][_0xb752('0x43')](_0x26977c);})['then'](function(_0x51b08e){_0x1cfcb1[_0xb752('0x44')]=_0x51b08e;return _0x1cfcb1;})[_0xb752('0x24')](respondWithFilteredResult(_0x503521,_0x26977c))[_0xb752('0x45')](handleError(_0x503521,null));};exports['show']=function(_0x197b7a,_0x149f90){var _0x45f862={'raw':![],'where':{'id':_0x197b7a[_0xb752('0x46')]['id']}},_0x37b112={};_0x37b112[_0xb752('0x32')]=_[_0xb752('0x33')](db['UserProfileResource']['rawAttributes']);_0x37b112[_0xb752('0x36')]=_[_0xb752('0x33')](_0x197b7a[_0xb752('0x36')]);_0x37b112[_0xb752('0x34')]=_['intersection'](_0x37b112[_0xb752('0x32')],_0x37b112[_0xb752('0x36')]);_0x45f862[_0xb752('0x38')]=_[_0xb752('0x35')](_0x37b112[_0xb752('0x32')],qs[_0xb752('0x37')](_0x197b7a[_0xb752('0x36')][_0xb752('0x37')]));_0x45f862[_0xb752('0x38')]=_0x45f862[_0xb752('0x38')][_0xb752('0x39')]?_0x45f862[_0xb752('0x38')]:_0x37b112[_0xb752('0x32')];if(_0x197b7a[_0xb752('0x36')]['includeAll']){_0x45f862[_0xb752('0x42')]=[{'all':!![]}];}_0x45f862=_[_0xb752('0x40')]({},_0x45f862,_0x197b7a[_0xb752('0x47')]);return db[_0xb752('0x2d')]['find'](_0x45f862)[_0xb752('0x24')](handleEntityNotFound(_0x149f90,null))[_0xb752('0x24')](respondWithResult(_0x149f90,null))[_0xb752('0x45')](handleError(_0x149f90,null));};exports['create']=function(_0x1e08ef,_0x2ed355){return db[_0xb752('0x2d')]['create'](_0x1e08ef[_0xb752('0x48')],{})[_0xb752('0x24')](respondWithResult(_0x2ed355,0xc9))[_0xb752('0x45')](handleError(_0x2ed355,null));};exports[_0xb752('0x23')]=function(_0x54bfbc,_0x24d2d4){if(_0x54bfbc[_0xb752('0x48')]['id']){delete _0x54bfbc[_0xb752('0x48')]['id'];}return db[_0xb752('0x2d')]['find']({'where':{'id':_0x54bfbc[_0xb752('0x46')]['id']}})[_0xb752('0x24')](handleEntityNotFound(_0x24d2d4,null))[_0xb752('0x24')](saveUpdates(_0x54bfbc[_0xb752('0x48')],null))[_0xb752('0x24')](respondWithResult(_0x24d2d4,null))['catch'](handleError(_0x24d2d4,null));};exports[_0xb752('0x49')]=function(_0x4a67d2,_0x3a2417){return db['UserProfileResource'][_0xb752('0x4a')]({'where':{'id':_0x4a67d2[_0xb752('0x46')]['id']}})[_0xb752('0x24')](handleEntityNotFound(_0x3a2417,null))[_0xb752('0x24')](removeEntity(_0x3a2417,null))[_0xb752('0x45')](handleError(_0x3a2417,null));};exports[_0xb752('0x4b')]=function(_0x300b51,_0x463f5b){return db[_0xb752('0x2d')][_0xb752('0x4b')]()[_0xb752('0x24')](respondWithResult(_0x463f5b,null))[_0xb752('0x45')](handleError(_0x463f5b,null));};
\ No newline at end of file
+var _0xf1c9=['fields','attributes','length','hasOwnProperty','nolimit','sort','where','pick','filters','filter','merge','type','VIRTUAL','options','includeAll','include','findAll','catch','show','params','find','create','body','describe','html-pdf','rimraf','zip-dir','fast-json-patch','request-promise','moment','mustache','util','path','sox','to-csv','lodash','squel','crypto','../../components/auth/service','../../components/parsers/advancedSearch','../../config/license/hardware','api','../../config/utils','../../config/environment','../../mysqldb','sendStatus','status','end','json','count','offset','limit','Content-Range','apply','reject','save','update','then','destroy','error','stack','name','send','index','map','UserProfileResource','rawAttributes','fieldName','key','model','query','keys','intersection'];(function(_0x37943c,_0x51fa61){var _0x34260c=function(_0x4b9617){while(--_0x4b9617){_0x37943c['push'](_0x37943c['shift']());}};_0x34260c(++_0x51fa61);}(_0xf1c9,0xf3));var _0x9f1c=function(_0x3b11c9,_0x30b465){_0x3b11c9=_0x3b11c9-0x0;var _0x42bd04=_0xf1c9[_0x3b11c9];return _0x42bd04;};'use strict';var pdf=require(_0x9f1c('0x0'));var emlformat=require('eml-format');var rimraf=require(_0x9f1c('0x1'));var zipdir=require(_0x9f1c('0x2'));var jsonpatch=require(_0x9f1c('0x3'));var rp=require(_0x9f1c('0x4'));var moment=require(_0x9f1c('0x5'));var BPromise=require('bluebird');var Mustache=require(_0x9f1c('0x6'));var util=require(_0x9f1c('0x7'));var path=require(_0x9f1c('0x8'));var sox=require(_0x9f1c('0x9'));var csv=require(_0x9f1c('0xa'));var ejs=require('ejs');var fs=require('fs');var _=require(_0x9f1c('0xb'));var squel=require(_0x9f1c('0xc'));var crypto=require(_0x9f1c('0xd'));var jsforce=require('jsforce');var deskjs=require('desk.js');var toCsv=require(_0x9f1c('0xa'));var querystring=require('querystring');var Papa=require('papaparse');var Redis=require('ioredis');var authService=require(_0x9f1c('0xe'));var qs=require('../../components/parsers/qs');var as=require(_0x9f1c('0xf'));var hardwareService=require(_0x9f1c('0x10'));var logger=require('../../config/logger')(_0x9f1c('0x11'));var utils=require(_0x9f1c('0x12'));var config=require(_0x9f1c('0x13'));var db=require(_0x9f1c('0x14'))['db'];function respondWithStatusCode(_0x4238c7,_0x4911de){_0x4911de=_0x4911de||0xcc;return function(_0x12223c){if(_0x12223c){return _0x4238c7[_0x9f1c('0x15')](_0x4911de);}return _0x4238c7[_0x9f1c('0x16')](_0x4911de)[_0x9f1c('0x17')]();};}function respondWithResult(_0x2a9569,_0x5c8cf8){_0x5c8cf8=_0x5c8cf8||0xc8;return function(_0xf5034f){if(_0xf5034f){return _0x2a9569[_0x9f1c('0x16')](_0x5c8cf8)[_0x9f1c('0x18')](_0xf5034f);}};}function respondWithFilteredResult(_0x539290,_0x4ba123){return function(_0x307925){if(_0x307925){var _0x344005=_0x307925[_0x9f1c('0x19')],_0x5d6a8d=_0x4ba123[_0x9f1c('0x1a')],_0x3bf734=_0x4ba123[_0x9f1c('0x1a')]+_0x4ba123[_0x9f1c('0x1b')],_0x3f6084;if(_0x3bf734>=_0x344005){_0x3bf734=_0x344005;_0x3f6084=0xc8;}else{_0x3f6084=0xce;}_0x539290[_0x9f1c('0x16')](_0x3f6084);return _0x539290['set'](_0x9f1c('0x1c'),_0x5d6a8d+'-'+_0x3bf734+'/'+_0x344005)['json'](_0x307925);}return null;};}function patchUpdates(_0x58b598){return function(_0x1eb169){try{jsonpatch[_0x9f1c('0x1d')](_0x1eb169,_0x58b598,!![]);}catch(_0x4502dd){return BPromise[_0x9f1c('0x1e')](_0x4502dd);}return _0x1eb169[_0x9f1c('0x1f')]();};}function saveUpdates(_0x373193,_0x5d6720){return function(_0x356050){if(_0x356050){return _0x356050[_0x9f1c('0x20')](_0x373193)[_0x9f1c('0x21')](function(_0x427d6f){return _0x427d6f;});}return null;};}function removeEntity(_0x18d03c,_0x4da51f){return function(_0x5e6af0){if(_0x5e6af0){return _0x5e6af0[_0x9f1c('0x22')]()[_0x9f1c('0x21')](function(){_0x18d03c[_0x9f1c('0x16')](0xcc)[_0x9f1c('0x17')]();});}};}function handleEntityNotFound(_0x5ab9bb,_0x2246ac){return function(_0x173864){if(!_0x173864){_0x5ab9bb['sendStatus'](0x194);}return _0x173864;};}function handleError(_0xbe6637,_0xe8545b){_0xe8545b=_0xe8545b||0x1f4;return function(_0x404380){logger[_0x9f1c('0x23')](_0x404380[_0x9f1c('0x24')]);if(_0x404380[_0x9f1c('0x25')]){delete _0x404380[_0x9f1c('0x25')];}_0xbe6637[_0x9f1c('0x16')](_0xe8545b)[_0x9f1c('0x26')](_0x404380);};}exports[_0x9f1c('0x27')]=function(_0x697dcc,_0x3e8579){var _0x472b09={},_0x3f6b9f={},_0x3f0f89={'count':0x0,'rows':[]};var _0xacab34=_[_0x9f1c('0x28')](db[_0x9f1c('0x29')][_0x9f1c('0x2a')],function(_0x4f85d5){return{'name':_0x4f85d5[_0x9f1c('0x2b')],'type':_0x4f85d5['type'][_0x9f1c('0x2c')]};});_0x3f6b9f[_0x9f1c('0x2d')]=_[_0x9f1c('0x28')](_0xacab34,_0x9f1c('0x25'));_0x3f6b9f[_0x9f1c('0x2e')]=_[_0x9f1c('0x2f')](_0x697dcc[_0x9f1c('0x2e')]);_0x3f6b9f['filters']=_[_0x9f1c('0x30')](_0x3f6b9f[_0x9f1c('0x2d')],_0x3f6b9f['query']);_0x472b09['attributes']=_[_0x9f1c('0x30')](_0x3f6b9f[_0x9f1c('0x2d')],qs[_0x9f1c('0x31')](_0x697dcc[_0x9f1c('0x2e')][_0x9f1c('0x31')]));_0x472b09[_0x9f1c('0x32')]=_0x472b09[_0x9f1c('0x32')][_0x9f1c('0x33')]?_0x472b09[_0x9f1c('0x32')]:_0x3f6b9f['model'];if(!_0x697dcc[_0x9f1c('0x2e')][_0x9f1c('0x34')](_0x9f1c('0x35'))){_0x472b09[_0x9f1c('0x1b')]=qs[_0x9f1c('0x1b')](_0x697dcc[_0x9f1c('0x2e')][_0x9f1c('0x1b')]);_0x472b09['offset']=qs[_0x9f1c('0x1a')](_0x697dcc['query']['offset']);}_0x472b09['order']=qs[_0x9f1c('0x36')](_0x697dcc[_0x9f1c('0x2e')][_0x9f1c('0x36')]);_0x472b09[_0x9f1c('0x37')]=qs['filters'](_[_0x9f1c('0x38')](_0x697dcc[_0x9f1c('0x2e')],_0x3f6b9f[_0x9f1c('0x39')]));if(_0x697dcc['query'][_0x9f1c('0x3a')]){_0x472b09['where']=_[_0x9f1c('0x3b')](_0x472b09[_0x9f1c('0x37')],{'$or':_[_0x9f1c('0x28')](_0xacab34,function(_0x18f5d3){if(_0x18f5d3[_0x9f1c('0x3c')]!==_0x9f1c('0x3d')){var _0x51cfe3={};_0x51cfe3[_0x18f5d3['name']]={'$like':'%'+_0x697dcc[_0x9f1c('0x2e')][_0x9f1c('0x3a')]+'%'};return _0x51cfe3;}})});}_0x472b09=_['merge']({},_0x472b09,_0x697dcc[_0x9f1c('0x3e')]);var _0x8605d4={'where':_0x472b09['where']};return db[_0x9f1c('0x29')][_0x9f1c('0x19')](_0x8605d4)['then'](function(_0x50b0b7){_0x3f0f89[_0x9f1c('0x19')]=_0x50b0b7;if(_0x697dcc[_0x9f1c('0x2e')][_0x9f1c('0x3f')]){_0x472b09[_0x9f1c('0x40')]=[{'all':!![]}];}return db[_0x9f1c('0x29')][_0x9f1c('0x41')](_0x472b09);})['then'](function(_0x5510d2){_0x3f0f89['rows']=_0x5510d2;return _0x3f0f89;})['then'](respondWithFilteredResult(_0x3e8579,_0x472b09))[_0x9f1c('0x42')](handleError(_0x3e8579,null));};exports[_0x9f1c('0x43')]=function(_0x35b45c,_0x29020e){var _0x5c7ed1={'raw':![],'where':{'id':_0x35b45c[_0x9f1c('0x44')]['id']}},_0x2779d7={};_0x2779d7[_0x9f1c('0x2d')]=_[_0x9f1c('0x2f')](db[_0x9f1c('0x29')][_0x9f1c('0x2a')]);_0x2779d7[_0x9f1c('0x2e')]=_[_0x9f1c('0x2f')](_0x35b45c['query']);_0x2779d7['filters']=_['intersection'](_0x2779d7[_0x9f1c('0x2d')],_0x2779d7[_0x9f1c('0x2e')]);_0x5c7ed1[_0x9f1c('0x32')]=_[_0x9f1c('0x30')](_0x2779d7[_0x9f1c('0x2d')],qs['fields'](_0x35b45c['query'][_0x9f1c('0x31')]));_0x5c7ed1[_0x9f1c('0x32')]=_0x5c7ed1['attributes']['length']?_0x5c7ed1[_0x9f1c('0x32')]:_0x2779d7[_0x9f1c('0x2d')];if(_0x35b45c[_0x9f1c('0x2e')][_0x9f1c('0x3f')]){_0x5c7ed1['include']=[{'all':!![]}];}_0x5c7ed1=_[_0x9f1c('0x3b')]({},_0x5c7ed1,_0x35b45c[_0x9f1c('0x3e')]);return db[_0x9f1c('0x29')][_0x9f1c('0x45')](_0x5c7ed1)['then'](handleEntityNotFound(_0x29020e,null))[_0x9f1c('0x21')](respondWithResult(_0x29020e,null))[_0x9f1c('0x42')](handleError(_0x29020e,null));};exports[_0x9f1c('0x46')]=function(_0xbaeb6f,_0x480080){return db[_0x9f1c('0x29')][_0x9f1c('0x46')](_0xbaeb6f[_0x9f1c('0x47')],{})[_0x9f1c('0x21')](respondWithResult(_0x480080,0xc9))[_0x9f1c('0x42')](handleError(_0x480080,null));};exports[_0x9f1c('0x20')]=function(_0x5ea197,_0x3cd57a){if(_0x5ea197[_0x9f1c('0x47')]['id']){delete _0x5ea197['body']['id'];}return db[_0x9f1c('0x29')][_0x9f1c('0x45')]({'where':{'id':_0x5ea197[_0x9f1c('0x44')]['id']}})[_0x9f1c('0x21')](handleEntityNotFound(_0x3cd57a,null))[_0x9f1c('0x21')](saveUpdates(_0x5ea197[_0x9f1c('0x47')],null))[_0x9f1c('0x21')](respondWithResult(_0x3cd57a,null))[_0x9f1c('0x42')](handleError(_0x3cd57a,null));};exports[_0x9f1c('0x22')]=function(_0x4038a3,_0x5aa23b){return db[_0x9f1c('0x29')][_0x9f1c('0x45')]({'where':{'id':_0x4038a3[_0x9f1c('0x44')]['id']}})[_0x9f1c('0x21')](handleEntityNotFound(_0x5aa23b,null))['then'](removeEntity(_0x5aa23b,null))[_0x9f1c('0x42')](handleError(_0x5aa23b,null));};exports[_0x9f1c('0x48')]=function(_0x44e4f9,_0x5e41bd){return db[_0x9f1c('0x29')][_0x9f1c('0x48')]()['then'](respondWithResult(_0x5e41bd,null))['catch'](handleError(_0x5e41bd,null));};
\ No newline at end of file
diff --git a/server/api/userProfileResource/userProfileResource.model.js b/server/api/userProfileResource/userProfileResource.model.js
index a01c621..d551afb 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 _0x1514=['compositeIndex','resourceId','sectionId','lodash','api','moment','bluebird','request-promise','rimraf','../../config/environment','./userProfileResource.attributes','exports','define','UserProfileResource'];(function(_0x4a9fb1,_0x273043){var _0x348672=function(_0x142b69){while(--_0x142b69){_0x4a9fb1['push'](_0x4a9fb1['shift']());}};_0x348672(++_0x273043);}(_0x1514,0xab));var _0x4151=function(_0x4853e6,_0x3c1273){_0x4853e6=_0x4853e6-0x0;var _0x4ad222=_0x1514[_0x4853e6];return _0x4ad222;};'use strict';var _=require(_0x4151('0x0'));var util=require('util');var logger=require('../../config/logger')(_0x4151('0x1'));var moment=require(_0x4151('0x2'));var BPromise=require(_0x4151('0x3'));var rp=require(_0x4151('0x4'));var fs=require('fs');var path=require('path');var rimraf=require(_0x4151('0x5'));var config=require(_0x4151('0x6'));var attributes=require(_0x4151('0x7'));module[_0x4151('0x8')]=function(_0x220986,_0x1e8d3b){return _0x220986[_0x4151('0x9')](_0x4151('0xa'),attributes,{'tableName':'user_profile_has_resources','paranoid':![],'indexes':[{'name':_0x4151('0xb'),'fields':[_0x4151('0xc'),_0x4151('0xd')]}],'timestamps':!![]});};
\ No newline at end of file
+var _0xae5f=['request-promise','../../config/environment','exports','define','compositeIndex','resourceId','sectionId','lodash','util','api','moment','bluebird'];(function(_0x1f37b8,_0x2f4072){var _0x452ead=function(_0x43ca00){while(--_0x43ca00){_0x1f37b8['push'](_0x1f37b8['shift']());}};_0x452ead(++_0x2f4072);}(_0xae5f,0x163));var _0xfae5=function(_0x5a5abc,_0x1247d1){_0x5a5abc=_0x5a5abc-0x0;var _0x5e77b6=_0xae5f[_0x5a5abc];return _0x5e77b6;};'use strict';var _=require(_0xfae5('0x0'));var util=require(_0xfae5('0x1'));var logger=require('../../config/logger')(_0xfae5('0x2'));var moment=require(_0xfae5('0x3'));var BPromise=require(_0xfae5('0x4'));var rp=require(_0xfae5('0x5'));var fs=require('fs');var path=require('path');var rimraf=require('rimraf');var config=require(_0xfae5('0x6'));var attributes=require('./userProfileResource.attributes');module[_0xfae5('0x7')]=function(_0x575231,_0x1d4114){return _0x575231[_0xfae5('0x8')]('UserProfileResource',attributes,{'tableName':'user_profile_has_resources','paranoid':![],'indexes':[{'name':_0xfae5('0x9'),'fields':[_0xfae5('0xa'),_0xfae5('0xb')]}],'timestamps':!![]});};
\ No newline at end of file
diff --git a/server/api/userProfileResource/userProfileResource.rpc.js b/server/api/userProfileResource/userProfileResource.rpc.js
index 4d7853e..80163f8 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 _0x55c0=['result','lodash','util','moment','randomstring','ioredis','../../config/utils','../../config/logger','jayson/promise','client','http','then','UserProfileResource,\x20%s,\x20%s','request\x20sent','debug','UserProfileResource,\x20%s,\x20%s,\x20%s','stringify','error','code','message','info'];(function(_0x345307,_0x11b6f3){var _0x1e07a7=function(_0x76bed3){while(--_0x76bed3){_0x345307['push'](_0x345307['shift']());}};_0x1e07a7(++_0x11b6f3);}(_0x55c0,0x1a5));var _0x055c=function(_0x35ef7a,_0x2b3df3){_0x35ef7a=_0x35ef7a-0x0;var _0x3e1c56=_0x55c0[_0x35ef7a];return _0x3e1c56;};'use strict';var _=require(_0x055c('0x0'));var util=require(_0x055c('0x1'));var moment=require(_0x055c('0x2'));var BPromise=require('bluebird');var rs=require(_0x055c('0x3'));var fs=require('fs');var Redis=require(_0x055c('0x4'));var db=require('../../mysqldb')['db'];var utils=require(_0x055c('0x5'));var logger=require(_0x055c('0x6'))('rpc');var config=require('../../config/environment');var jayson=require(_0x055c('0x7'));var client=jayson[_0x055c('0x8')][_0x055c('0x9')]({'port':0x232a});function respondWithRpcPromise(_0x14bbd6,_0x2370ca,_0x4db737){return new BPromise(function(_0x37f54b,_0x598a03){return client['request'](_0x14bbd6,_0x4db737)[_0x055c('0xa')](function(_0x1d9616){logger['info'](_0x055c('0xb'),_0x2370ca,_0x055c('0xc'));logger[_0x055c('0xd')](_0x055c('0xe'),_0x2370ca,_0x055c('0xc'),JSON[_0x055c('0xf')](_0x1d9616));if(_0x1d9616['error']){if(_0x1d9616[_0x055c('0x10')][_0x055c('0x11')]===0x1f4){logger[_0x055c('0x10')](_0x055c('0xb'),_0x2370ca,_0x1d9616['error'][_0x055c('0x12')]);return _0x598a03(_0x1d9616['error'][_0x055c('0x12')]);}logger[_0x055c('0x10')](_0x055c('0xb'),_0x2370ca,_0x1d9616['error'][_0x055c('0x12')]);return _0x37f54b(_0x1d9616[_0x055c('0x10')][_0x055c('0x12')]);}else{logger[_0x055c('0x13')]('UserProfileResource,\x20%s,\x20%s',_0x2370ca,'request\x20sent');_0x37f54b(_0x1d9616[_0x055c('0x14')]['message']);}})['catch'](function(_0x37a9e3){logger[_0x055c('0x10')](_0x055c('0xb'),_0x2370ca,_0x37a9e3);_0x598a03(_0x37a9e3);});});}
\ No newline at end of file
+var _0x33aa=['../../mysqldb','../../config/utils','rpc','../../config/environment','jayson/promise','client','request','then','info','UserProfileResource,\x20%s,\x20%s','request\x20sent','debug','UserProfileResource,\x20%s,\x20%s,\x20%s','stringify','code','error','message','result','catch','lodash','bluebird','ioredis'];(function(_0xdd7ad9,_0x19562a){var _0x66e8d0=function(_0x3fa391){while(--_0x3fa391){_0xdd7ad9['push'](_0xdd7ad9['shift']());}};_0x66e8d0(++_0x19562a);}(_0x33aa,0x147));var _0xa33a=function(_0x5906da,_0x1feebb){_0x5906da=_0x5906da-0x0;var _0x4af80c=_0x33aa[_0x5906da];return _0x4af80c;};'use strict';var _=require(_0xa33a('0x0'));var util=require('util');var moment=require('moment');var BPromise=require(_0xa33a('0x1'));var rs=require('randomstring');var fs=require('fs');var Redis=require(_0xa33a('0x2'));var db=require(_0xa33a('0x3'))['db'];var utils=require(_0xa33a('0x4'));var logger=require('../../config/logger')(_0xa33a('0x5'));var config=require(_0xa33a('0x6'));var jayson=require(_0xa33a('0x7'));var client=jayson[_0xa33a('0x8')]['http']({'port':0x232a});function respondWithRpcPromise(_0x49daa0,_0x3c2083,_0x3f2c2c){return new BPromise(function(_0x56417b,_0x343bb6){return client[_0xa33a('0x9')](_0x49daa0,_0x3f2c2c)[_0xa33a('0xa')](function(_0x299246){logger[_0xa33a('0xb')](_0xa33a('0xc'),_0x3c2083,_0xa33a('0xd'));logger[_0xa33a('0xe')](_0xa33a('0xf'),_0x3c2083,'request\x20sent',JSON[_0xa33a('0x10')](_0x299246));if(_0x299246['error']){if(_0x299246['error'][_0xa33a('0x11')]===0x1f4){logger[_0xa33a('0x12')](_0xa33a('0xc'),_0x3c2083,_0x299246[_0xa33a('0x12')]['message']);return _0x343bb6(_0x299246[_0xa33a('0x12')][_0xa33a('0x13')]);}logger[_0xa33a('0x12')](_0xa33a('0xc'),_0x3c2083,_0x299246[_0xa33a('0x12')][_0xa33a('0x13')]);return _0x56417b(_0x299246[_0xa33a('0x12')][_0xa33a('0x13')]);}else{logger[_0xa33a('0xb')](_0xa33a('0xc'),_0x3c2083,_0xa33a('0xd'));_0x56417b(_0x299246[_0xa33a('0x14')][_0xa33a('0x13')]);}})[_0xa33a('0x15')](function(_0x5559f3){logger[_0xa33a('0x12')](_0xa33a('0xc'),_0x3c2083,_0x5559f3);_0x343bb6(_0x5559f3);});});}
\ No newline at end of file
diff --git a/server/api/userProfileSection/index.js b/server/api/userProfileSection/index.js
index a9dee87..7c19c39 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 _0x3c2d=['../../components/interaction/service','./userProfileSection.controller','get','isAuthenticated','index','/describe','describe','/:id','show','create','update','delete','destroy','multer','util','express','Router','../../components/auth/service'];(function(_0x3b491a,_0x2705bc){var _0x20a004=function(_0x355b3c){while(--_0x355b3c){_0x3b491a['push'](_0x3b491a['shift']());}};_0x20a004(++_0x2705bc);}(_0x3c2d,0x11b));var _0xd3c2=function(_0x59ee6f,_0x450239){_0x59ee6f=_0x59ee6f-0x0;var _0x4c0979=_0x3c2d[_0x59ee6f];return _0x4c0979;};'use strict';var multer=require(_0xd3c2('0x0'));var util=require(_0xd3c2('0x1'));var path=require('path');var timeout=require('connect-timeout');var express=require(_0xd3c2('0x2'));var router=express[_0xd3c2('0x3')]();var auth=require(_0xd3c2('0x4'));var interaction=require(_0xd3c2('0x5'));var config=require('../../config/environment');var controller=require(_0xd3c2('0x6'));router[_0xd3c2('0x7')]('/',auth[_0xd3c2('0x8')](),controller[_0xd3c2('0x9')]);router[_0xd3c2('0x7')](_0xd3c2('0xa'),auth[_0xd3c2('0x8')](),controller[_0xd3c2('0xb')]);router[_0xd3c2('0x7')](_0xd3c2('0xc'),auth[_0xd3c2('0x8')](),controller[_0xd3c2('0xd')]);router['post']('/',auth[_0xd3c2('0x8')](),controller[_0xd3c2('0xe')]);router['put']('/:id',auth[_0xd3c2('0x8')](),controller[_0xd3c2('0xf')]);router[_0xd3c2('0x10')](_0xd3c2('0xc'),auth[_0xd3c2('0x8')](),controller[_0xd3c2('0x11')]);module['exports']=router;
\ No newline at end of file
+var _0x1120=['multer','path','connect-timeout','express','Router','../../components/auth/service','../../config/environment','./userProfileSection.controller','get','isAuthenticated','/describe','describe','/:id','show','create','put','update','exports'];(function(_0x48fb55,_0xf6d384){var _0x2df42d=function(_0x3849dc){while(--_0x3849dc){_0x48fb55['push'](_0x48fb55['shift']());}};_0x2df42d(++_0xf6d384);}(_0x1120,0x90));var _0x0112=function(_0x359bbe,_0x5b7fcc){_0x359bbe=_0x359bbe-0x0;var _0x1b3353=_0x1120[_0x359bbe];return _0x1b3353;};'use strict';var multer=require(_0x0112('0x0'));var util=require('util');var path=require(_0x0112('0x1'));var timeout=require(_0x0112('0x2'));var express=require(_0x0112('0x3'));var router=express[_0x0112('0x4')]();var auth=require(_0x0112('0x5'));var interaction=require('../../components/interaction/service');var config=require(_0x0112('0x6'));var controller=require(_0x0112('0x7'));router[_0x0112('0x8')]('/',auth[_0x0112('0x9')](),controller['index']);router[_0x0112('0x8')](_0x0112('0xa'),auth['isAuthenticated'](),controller[_0x0112('0xb')]);router['get'](_0x0112('0xc'),auth[_0x0112('0x9')](),controller[_0x0112('0xd')]);router['post']('/',auth[_0x0112('0x9')](),controller[_0x0112('0xe')]);router[_0x0112('0xf')](_0x0112('0xc'),auth['isAuthenticated'](),controller[_0x0112('0x10')]);router['delete'](_0x0112('0xc'),auth['isAuthenticated'](),controller['destroy']);module[_0x0112('0x11')]=router;
\ No newline at end of file
diff --git a/server/api/userProfileSection/userProfileSection.attributes.js b/server/api/userProfileSection/userProfileSection.attributes.js
index a992e8c..dd342fa 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 _0xc3d6=['INTEGER','BOOLEAN','setDataValue','join','crudPermissions','split','sequelize','exports','STRING'];(function(_0x24355a,_0x401e18){var _0x5df365=function(_0x3a6fa7){while(--_0x3a6fa7){_0x24355a['push'](_0x24355a['shift']());}};_0x5df365(++_0x401e18);}(_0xc3d6,0x153));var _0x6c3d=function(_0x4d4a56,_0xbecc68){_0x4d4a56=_0x4d4a56-0x0;var _0x2a8068=_0xc3d6[_0x4d4a56];return _0x2a8068;};'use strict';var Sequelize=require(_0x6c3d('0x0'));module[_0x6c3d('0x1')]={'name':{'type':Sequelize[_0x6c3d('0x2')],'allowNull':![]},'category':{'type':Sequelize[_0x6c3d('0x2')],'allowNull':![]},'sectionId':{'type':Sequelize[_0x6c3d('0x3')],'allowNull':![]},'enabled':{'type':Sequelize[_0x6c3d('0x4')],'defaultValue':null},'autoAssociation':{'type':Sequelize[_0x6c3d('0x4')],'defaultValue':null},'crudPermissions':{'type':Sequelize[_0x6c3d('0x2')],'set':function(_0x73fb46){this[_0x6c3d('0x5')]('crudPermissions',_0x73fb46?_0x73fb46[_0x6c3d('0x6')](''):[]);},'get':function(){return this['getDataValue'](_0x6c3d('0x7'))?this['getDataValue'](_0x6c3d('0x7'))[_0x6c3d('0x8')](''):[];}}};
\ No newline at end of file
+var _0x9dbe=['join','getDataValue','sequelize','exports','STRING','INTEGER','BOOLEAN','setDataValue','crudPermissions'];(function(_0x2d2c16,_0x4e88b6){var _0x53f2fb=function(_0x6b6dac){while(--_0x6b6dac){_0x2d2c16['push'](_0x2d2c16['shift']());}};_0x53f2fb(++_0x4e88b6);}(_0x9dbe,0x1c4));var _0xe9db=function(_0x21331a,_0x57fc48){_0x21331a=_0x21331a-0x0;var _0x325c55=_0x9dbe[_0x21331a];return _0x325c55;};'use strict';var Sequelize=require(_0xe9db('0x0'));module[_0xe9db('0x1')]={'name':{'type':Sequelize[_0xe9db('0x2')],'allowNull':![]},'category':{'type':Sequelize[_0xe9db('0x2')],'allowNull':![]},'sectionId':{'type':Sequelize[_0xe9db('0x3')],'allowNull':![]},'enabled':{'type':Sequelize[_0xe9db('0x4')],'defaultValue':null},'autoAssociation':{'type':Sequelize[_0xe9db('0x4')],'defaultValue':null},'crudPermissions':{'type':Sequelize[_0xe9db('0x2')],'set':function(_0x4acec4){this[_0xe9db('0x5')](_0xe9db('0x6'),_0x4acec4?_0x4acec4[_0xe9db('0x7')](''):[]);},'get':function(){return this['getDataValue'](_0xe9db('0x6'))?this[_0xe9db('0x8')]('crudPermissions')['split'](''):[];}}};
\ No newline at end of file
diff --git a/server/api/userProfileSection/userProfileSection.controller.js b/server/api/userProfileSection/userProfileSection.controller.js
index f0f4a8a..fbbc792 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 _0x09a0=['count','set','save','destroy','then','error','stack','name','index','map','UserProfileSection','rawAttributes','fieldName','type','key','model','query','keys','intersection','attributes','fields','length','limit','offset','sort','filters','pick','filter','where','merge','options','includeAll','rows','catch','params','include','create','body','find','describe','html-pdf','eml-format','rimraf','zip-dir','fast-json-patch','moment','bluebird','mustache','util','path','sox','lodash','squel','crypto','jsforce','to-csv','querystring','papaparse','ioredis','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','../../config/utils','../../config/environment','../../mysqldb','sendStatus','status','end'];(function(_0x24f31b,_0x44b8f3){var _0x488401=function(_0x204caf){while(--_0x204caf){_0x24f31b['push'](_0x24f31b['shift']());}};_0x488401(++_0x44b8f3);}(_0x09a0,0x13c));var _0x009a=function(_0x42e435,_0x27dc76){_0x42e435=_0x42e435-0x0;var _0x12608d=_0x09a0[_0x42e435];return _0x12608d;};'use strict';var pdf=require(_0x009a('0x0'));var emlformat=require(_0x009a('0x1'));var rimraf=require(_0x009a('0x2'));var zipdir=require(_0x009a('0x3'));var jsonpatch=require(_0x009a('0x4'));var rp=require('request-promise');var moment=require(_0x009a('0x5'));var BPromise=require(_0x009a('0x6'));var Mustache=require(_0x009a('0x7'));var util=require(_0x009a('0x8'));var path=require(_0x009a('0x9'));var sox=require(_0x009a('0xa'));var csv=require('to-csv');var ejs=require('ejs');var fs=require('fs');var _=require(_0x009a('0xb'));var squel=require(_0x009a('0xc'));var crypto=require(_0x009a('0xd'));var jsforce=require(_0x009a('0xe'));var deskjs=require('desk.js');var toCsv=require(_0x009a('0xf'));var querystring=require(_0x009a('0x10'));var Papa=require(_0x009a('0x11'));var Redis=require(_0x009a('0x12'));var authService=require('../../components/auth/service');var qs=require(_0x009a('0x13'));var as=require(_0x009a('0x14'));var hardwareService=require(_0x009a('0x15'));var logger=require(_0x009a('0x16'))('api');var utils=require(_0x009a('0x17'));var config=require(_0x009a('0x18'));var db=require(_0x009a('0x19'))['db'];function respondWithStatusCode(_0xe54b34,_0xa264c8){_0xa264c8=_0xa264c8||0xcc;return function(_0x2f373d){if(_0x2f373d){return _0xe54b34[_0x009a('0x1a')](_0xa264c8);}return _0xe54b34[_0x009a('0x1b')](_0xa264c8)[_0x009a('0x1c')]();};}function respondWithResult(_0x5b2a67,_0x55c455){_0x55c455=_0x55c455||0xc8;return function(_0x47c379){if(_0x47c379){return _0x5b2a67[_0x009a('0x1b')](_0x55c455)['json'](_0x47c379);}};}function respondWithFilteredResult(_0x59aa0b,_0x40b66a){return function(_0x1b221a){if(_0x1b221a){var _0x453579=_0x1b221a[_0x009a('0x1d')],_0x4fb6f8=_0x40b66a['offset'],_0x38231c=_0x40b66a['offset']+_0x40b66a['limit'],_0x2405a9;if(_0x38231c>=_0x453579){_0x38231c=_0x453579;_0x2405a9=0xc8;}else{_0x2405a9=0xce;}_0x59aa0b[_0x009a('0x1b')](_0x2405a9);return _0x59aa0b[_0x009a('0x1e')]('Content-Range',_0x4fb6f8+'-'+_0x38231c+'/'+_0x453579)['json'](_0x1b221a);}return null;};}function patchUpdates(_0xc9d8ba){return function(_0x3167c4){try{jsonpatch['apply'](_0x3167c4,_0xc9d8ba,!![]);}catch(_0xf7ef3d){return BPromise['reject'](_0xf7ef3d);}return _0x3167c4[_0x009a('0x1f')]();};}function saveUpdates(_0x22012e,_0x4dceee){return function(_0x74c15c){if(_0x74c15c){return _0x74c15c['update'](_0x22012e)['then'](function(_0x5287c7){return _0x5287c7;});}return null;};}function removeEntity(_0x274b83,_0x37e5f3){return function(_0x10b1a3){if(_0x10b1a3){return _0x10b1a3[_0x009a('0x20')]()[_0x009a('0x21')](function(){_0x274b83[_0x009a('0x1b')](0xcc)[_0x009a('0x1c')]();});}};}function handleEntityNotFound(_0x46bfe6,_0x2c69cd){return function(_0x516013){if(!_0x516013){_0x46bfe6[_0x009a('0x1a')](0x194);}return _0x516013;};}function handleError(_0x2b2aa2,_0x3e50dc){_0x3e50dc=_0x3e50dc||0x1f4;return function(_0x74fb47){logger[_0x009a('0x22')](_0x74fb47[_0x009a('0x23')]);if(_0x74fb47[_0x009a('0x24')]){delete _0x74fb47['name'];}_0x2b2aa2[_0x009a('0x1b')](_0x3e50dc)['send'](_0x74fb47);};}exports[_0x009a('0x25')]=function(_0x279a24,_0x4cb45d){var _0x23db40={},_0x10f640={},_0x564ee5={'count':0x0,'rows':[]};var _0x84c96f=_[_0x009a('0x26')](db[_0x009a('0x27')][_0x009a('0x28')],function(_0x147e91){return{'name':_0x147e91[_0x009a('0x29')],'type':_0x147e91[_0x009a('0x2a')][_0x009a('0x2b')]};});_0x10f640[_0x009a('0x2c')]=_[_0x009a('0x26')](_0x84c96f,_0x009a('0x24'));_0x10f640[_0x009a('0x2d')]=_[_0x009a('0x2e')](_0x279a24['query']);_0x10f640['filters']=_[_0x009a('0x2f')](_0x10f640[_0x009a('0x2c')],_0x10f640[_0x009a('0x2d')]);_0x23db40[_0x009a('0x30')]=_[_0x009a('0x2f')](_0x10f640['model'],qs['fields'](_0x279a24[_0x009a('0x2d')][_0x009a('0x31')]));_0x23db40['attributes']=_0x23db40[_0x009a('0x30')][_0x009a('0x32')]?_0x23db40['attributes']:_0x10f640['model'];if(!_0x279a24[_0x009a('0x2d')]['hasOwnProperty']('nolimit')){_0x23db40[_0x009a('0x33')]=qs[_0x009a('0x33')](_0x279a24[_0x009a('0x2d')][_0x009a('0x33')]);_0x23db40[_0x009a('0x34')]=qs[_0x009a('0x34')](_0x279a24[_0x009a('0x2d')][_0x009a('0x34')]);}_0x23db40['order']=qs[_0x009a('0x35')](_0x279a24[_0x009a('0x2d')][_0x009a('0x35')]);_0x23db40['where']=qs[_0x009a('0x36')](_[_0x009a('0x37')](_0x279a24['query'],_0x10f640[_0x009a('0x36')]));if(_0x279a24['query'][_0x009a('0x38')]){_0x23db40['where']=_['merge'](_0x23db40[_0x009a('0x39')],{'$or':_[_0x009a('0x26')](_0x84c96f,function(_0x2e2ac9){if(_0x2e2ac9[_0x009a('0x2a')]!=='VIRTUAL'){var _0x5e777a={};_0x5e777a[_0x2e2ac9[_0x009a('0x24')]]={'$like':'%'+_0x279a24['query'][_0x009a('0x38')]+'%'};return _0x5e777a;}})});}_0x23db40=_[_0x009a('0x3a')]({},_0x23db40,_0x279a24[_0x009a('0x3b')]);var _0x494263={'where':_0x23db40[_0x009a('0x39')]};return db['UserProfileSection']['count'](_0x494263)['then'](function(_0x21bc3e){_0x564ee5[_0x009a('0x1d')]=_0x21bc3e;if(_0x279a24[_0x009a('0x2d')][_0x009a('0x3c')]){_0x23db40['include']=[{'all':!![]}];}return db[_0x009a('0x27')]['findAll'](_0x23db40);})[_0x009a('0x21')](function(_0x34931e){_0x564ee5[_0x009a('0x3d')]=_0x34931e;return _0x564ee5;})[_0x009a('0x21')](respondWithFilteredResult(_0x4cb45d,_0x23db40))[_0x009a('0x3e')](handleError(_0x4cb45d,null));};exports['show']=function(_0x3041a5,_0x50cb4b){var _0xf0ab8e={'raw':![],'where':{'id':_0x3041a5[_0x009a('0x3f')]['id']}},_0x1a102b={};_0x1a102b['model']=_[_0x009a('0x2e')](db['UserProfileSection']['rawAttributes']);_0x1a102b[_0x009a('0x2d')]=_[_0x009a('0x2e')](_0x3041a5[_0x009a('0x2d')]);_0x1a102b[_0x009a('0x36')]=_[_0x009a('0x2f')](_0x1a102b[_0x009a('0x2c')],_0x1a102b[_0x009a('0x2d')]);_0xf0ab8e['attributes']=_[_0x009a('0x2f')](_0x1a102b[_0x009a('0x2c')],qs['fields'](_0x3041a5[_0x009a('0x2d')][_0x009a('0x31')]));_0xf0ab8e['attributes']=_0xf0ab8e[_0x009a('0x30')]['length']?_0xf0ab8e[_0x009a('0x30')]:_0x1a102b[_0x009a('0x2c')];if(_0x3041a5['query'][_0x009a('0x3c')]){_0xf0ab8e[_0x009a('0x40')]=[{'all':!![]}];}_0xf0ab8e=_[_0x009a('0x3a')]({},_0xf0ab8e,_0x3041a5[_0x009a('0x3b')]);return db[_0x009a('0x27')]['find'](_0xf0ab8e)[_0x009a('0x21')](handleEntityNotFound(_0x50cb4b,null))[_0x009a('0x21')](respondWithResult(_0x50cb4b,null))[_0x009a('0x3e')](handleError(_0x50cb4b,null));};exports[_0x009a('0x41')]=function(_0x2a2634,_0x454e79){return db[_0x009a('0x27')][_0x009a('0x41')](_0x2a2634[_0x009a('0x42')],{})[_0x009a('0x21')](respondWithResult(_0x454e79,0xc9))[_0x009a('0x3e')](handleError(_0x454e79,null));};exports['update']=function(_0x5f3f6f,_0x355e6f){if(_0x5f3f6f[_0x009a('0x42')]['id']){delete _0x5f3f6f['body']['id'];}return db[_0x009a('0x27')]['find']({'where':{'id':_0x5f3f6f['params']['id']}})['then'](handleEntityNotFound(_0x355e6f,null))[_0x009a('0x21')](saveUpdates(_0x5f3f6f[_0x009a('0x42')],null))[_0x009a('0x21')](respondWithResult(_0x355e6f,null))[_0x009a('0x3e')](handleError(_0x355e6f,null));};exports[_0x009a('0x20')]=function(_0x5ad479,_0x1281ff){return db[_0x009a('0x27')][_0x009a('0x43')]({'where':{'id':_0x5ad479[_0x009a('0x3f')]['id']}})[_0x009a('0x21')](handleEntityNotFound(_0x1281ff,null))[_0x009a('0x21')](removeEntity(_0x1281ff,null))['catch'](handleError(_0x1281ff,null));};exports[_0x009a('0x44')]=function(_0x598884,_0x386b11){return db[_0x009a('0x27')][_0x009a('0x44')]()[_0x009a('0x21')](respondWithResult(_0x386b11,null))[_0x009a('0x3e')](handleError(_0x386b11,null));};
\ No newline at end of file
+var _0xaeb3=['create','body','catch','update','params','describe','html-pdf','eml-format','zip-dir','fast-json-patch','request-promise','moment','bluebird','mustache','util','sox','to-csv','lodash','squel','jsforce','querystring','ioredis','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/environment','../../mysqldb','sendStatus','status','end','json','count','offset','limit','set','Content-Range','reject','save','destroy','then','stack','name','send','index','fieldName','model','map','keys','query','filters','intersection','attributes','fields','nolimit','order','sort','where','pick','filter','type','VIRTUAL','merge','UserProfileSection','includeAll','findAll','rows','show','rawAttributes','include','find'];(function(_0x5b2241,_0x58dff9){var _0x3f834c=function(_0x1d70a6){while(--_0x1d70a6){_0x5b2241['push'](_0x5b2241['shift']());}};_0x3f834c(++_0x58dff9);}(_0xaeb3,0x16e));var _0x3aeb=function(_0x3c5e71,_0xfc0c07){_0x3c5e71=_0x3c5e71-0x0;var _0x71b974=_0xaeb3[_0x3c5e71];return _0x71b974;};'use strict';var pdf=require(_0x3aeb('0x0'));var emlformat=require(_0x3aeb('0x1'));var rimraf=require('rimraf');var zipdir=require(_0x3aeb('0x2'));var jsonpatch=require(_0x3aeb('0x3'));var rp=require(_0x3aeb('0x4'));var moment=require(_0x3aeb('0x5'));var BPromise=require(_0x3aeb('0x6'));var Mustache=require(_0x3aeb('0x7'));var util=require(_0x3aeb('0x8'));var path=require('path');var sox=require(_0x3aeb('0x9'));var csv=require(_0x3aeb('0xa'));var ejs=require('ejs');var fs=require('fs');var _=require(_0x3aeb('0xb'));var squel=require(_0x3aeb('0xc'));var crypto=require('crypto');var jsforce=require(_0x3aeb('0xd'));var deskjs=require('desk.js');var toCsv=require(_0x3aeb('0xa'));var querystring=require(_0x3aeb('0xe'));var Papa=require('papaparse');var Redis=require(_0x3aeb('0xf'));var authService=require('../../components/auth/service');var qs=require('../../components/parsers/qs');var as=require(_0x3aeb('0x10'));var hardwareService=require(_0x3aeb('0x11'));var logger=require(_0x3aeb('0x12'))(_0x3aeb('0x13'));var utils=require(_0x3aeb('0x14'));var config=require(_0x3aeb('0x15'));var db=require(_0x3aeb('0x16'))['db'];function respondWithStatusCode(_0x4ac2e4,_0x39ec35){_0x39ec35=_0x39ec35||0xcc;return function(_0x56b38b){if(_0x56b38b){return _0x4ac2e4[_0x3aeb('0x17')](_0x39ec35);}return _0x4ac2e4[_0x3aeb('0x18')](_0x39ec35)[_0x3aeb('0x19')]();};}function respondWithResult(_0x564acc,_0x124962){_0x124962=_0x124962||0xc8;return function(_0xa67485){if(_0xa67485){return _0x564acc[_0x3aeb('0x18')](_0x124962)[_0x3aeb('0x1a')](_0xa67485);}};}function respondWithFilteredResult(_0x3751e8,_0x5b2c3e){return function(_0x5f3118){if(_0x5f3118){var _0xef7d80=_0x5f3118[_0x3aeb('0x1b')],_0x7329c6=_0x5b2c3e[_0x3aeb('0x1c')],_0x4740ef=_0x5b2c3e['offset']+_0x5b2c3e[_0x3aeb('0x1d')],_0x9abbc8;if(_0x4740ef>=_0xef7d80){_0x4740ef=_0xef7d80;_0x9abbc8=0xc8;}else{_0x9abbc8=0xce;}_0x3751e8[_0x3aeb('0x18')](_0x9abbc8);return _0x3751e8[_0x3aeb('0x1e')](_0x3aeb('0x1f'),_0x7329c6+'-'+_0x4740ef+'/'+_0xef7d80)[_0x3aeb('0x1a')](_0x5f3118);}return null;};}function patchUpdates(_0x23278d){return function(_0x53c94f){try{jsonpatch['apply'](_0x53c94f,_0x23278d,!![]);}catch(_0x547396){return BPromise[_0x3aeb('0x20')](_0x547396);}return _0x53c94f[_0x3aeb('0x21')]();};}function saveUpdates(_0x17f466,_0xa98f7b){return function(_0x43a0c9){if(_0x43a0c9){return _0x43a0c9['update'](_0x17f466)['then'](function(_0x22cb8d){return _0x22cb8d;});}return null;};}function removeEntity(_0x4ad6c6,_0x3746b4){return function(_0x4c3006){if(_0x4c3006){return _0x4c3006[_0x3aeb('0x22')]()[_0x3aeb('0x23')](function(){_0x4ad6c6[_0x3aeb('0x18')](0xcc)[_0x3aeb('0x19')]();});}};}function handleEntityNotFound(_0x5ee0dc,_0x4b8d01){return function(_0x5824dd){if(!_0x5824dd){_0x5ee0dc[_0x3aeb('0x17')](0x194);}return _0x5824dd;};}function handleError(_0x1b1b45,_0x560521){_0x560521=_0x560521||0x1f4;return function(_0x2656af){logger['error'](_0x2656af[_0x3aeb('0x24')]);if(_0x2656af[_0x3aeb('0x25')]){delete _0x2656af[_0x3aeb('0x25')];}_0x1b1b45['status'](_0x560521)[_0x3aeb('0x26')](_0x2656af);};}exports[_0x3aeb('0x27')]=function(_0xc91b8,_0x4f0ecc){var _0x8bb8f6={},_0x233a01={},_0x408e45={'count':0x0,'rows':[]};var _0x3793af=_['map'](db['UserProfileSection']['rawAttributes'],function(_0x269d86){return{'name':_0x269d86[_0x3aeb('0x28')],'type':_0x269d86['type']['key']};});_0x233a01[_0x3aeb('0x29')]=_[_0x3aeb('0x2a')](_0x3793af,'name');_0x233a01['query']=_[_0x3aeb('0x2b')](_0xc91b8[_0x3aeb('0x2c')]);_0x233a01[_0x3aeb('0x2d')]=_[_0x3aeb('0x2e')](_0x233a01[_0x3aeb('0x29')],_0x233a01[_0x3aeb('0x2c')]);_0x8bb8f6[_0x3aeb('0x2f')]=_[_0x3aeb('0x2e')](_0x233a01[_0x3aeb('0x29')],qs[_0x3aeb('0x30')](_0xc91b8[_0x3aeb('0x2c')]['fields']));_0x8bb8f6['attributes']=_0x8bb8f6['attributes']['length']?_0x8bb8f6[_0x3aeb('0x2f')]:_0x233a01[_0x3aeb('0x29')];if(!_0xc91b8[_0x3aeb('0x2c')]['hasOwnProperty'](_0x3aeb('0x31'))){_0x8bb8f6[_0x3aeb('0x1d')]=qs[_0x3aeb('0x1d')](_0xc91b8[_0x3aeb('0x2c')][_0x3aeb('0x1d')]);_0x8bb8f6[_0x3aeb('0x1c')]=qs[_0x3aeb('0x1c')](_0xc91b8[_0x3aeb('0x2c')][_0x3aeb('0x1c')]);}_0x8bb8f6[_0x3aeb('0x32')]=qs[_0x3aeb('0x33')](_0xc91b8[_0x3aeb('0x2c')][_0x3aeb('0x33')]);_0x8bb8f6[_0x3aeb('0x34')]=qs[_0x3aeb('0x2d')](_[_0x3aeb('0x35')](_0xc91b8[_0x3aeb('0x2c')],_0x233a01[_0x3aeb('0x2d')]));if(_0xc91b8[_0x3aeb('0x2c')][_0x3aeb('0x36')]){_0x8bb8f6['where']=_['merge'](_0x8bb8f6[_0x3aeb('0x34')],{'$or':_[_0x3aeb('0x2a')](_0x3793af,function(_0x3c3479){if(_0x3c3479[_0x3aeb('0x37')]!==_0x3aeb('0x38')){var _0x2da015={};_0x2da015[_0x3c3479['name']]={'$like':'%'+_0xc91b8[_0x3aeb('0x2c')][_0x3aeb('0x36')]+'%'};return _0x2da015;}})});}_0x8bb8f6=_[_0x3aeb('0x39')]({},_0x8bb8f6,_0xc91b8['options']);var _0x10ecf9={'where':_0x8bb8f6[_0x3aeb('0x34')]};return db[_0x3aeb('0x3a')][_0x3aeb('0x1b')](_0x10ecf9)['then'](function(_0x391746){_0x408e45[_0x3aeb('0x1b')]=_0x391746;if(_0xc91b8[_0x3aeb('0x2c')][_0x3aeb('0x3b')]){_0x8bb8f6['include']=[{'all':!![]}];}return db['UserProfileSection'][_0x3aeb('0x3c')](_0x8bb8f6);})[_0x3aeb('0x23')](function(_0xc14eae){_0x408e45[_0x3aeb('0x3d')]=_0xc14eae;return _0x408e45;})[_0x3aeb('0x23')](respondWithFilteredResult(_0x4f0ecc,_0x8bb8f6))['catch'](handleError(_0x4f0ecc,null));};exports[_0x3aeb('0x3e')]=function(_0x1b4831,_0x18953f){var _0x11617d={'raw':![],'where':{'id':_0x1b4831['params']['id']}},_0x2d68d5={};_0x2d68d5[_0x3aeb('0x29')]=_[_0x3aeb('0x2b')](db[_0x3aeb('0x3a')][_0x3aeb('0x3f')]);_0x2d68d5[_0x3aeb('0x2c')]=_[_0x3aeb('0x2b')](_0x1b4831[_0x3aeb('0x2c')]);_0x2d68d5['filters']=_[_0x3aeb('0x2e')](_0x2d68d5[_0x3aeb('0x29')],_0x2d68d5['query']);_0x11617d['attributes']=_[_0x3aeb('0x2e')](_0x2d68d5[_0x3aeb('0x29')],qs['fields'](_0x1b4831[_0x3aeb('0x2c')][_0x3aeb('0x30')]));_0x11617d[_0x3aeb('0x2f')]=_0x11617d['attributes']['length']?_0x11617d[_0x3aeb('0x2f')]:_0x2d68d5['model'];if(_0x1b4831[_0x3aeb('0x2c')][_0x3aeb('0x3b')]){_0x11617d[_0x3aeb('0x40')]=[{'all':!![]}];}_0x11617d=_['merge']({},_0x11617d,_0x1b4831['options']);return db[_0x3aeb('0x3a')][_0x3aeb('0x41')](_0x11617d)[_0x3aeb('0x23')](handleEntityNotFound(_0x18953f,null))[_0x3aeb('0x23')](respondWithResult(_0x18953f,null))['catch'](handleError(_0x18953f,null));};exports[_0x3aeb('0x42')]=function(_0x4644ff,_0x3147e4){return db[_0x3aeb('0x3a')][_0x3aeb('0x42')](_0x4644ff[_0x3aeb('0x43')],{})[_0x3aeb('0x23')](respondWithResult(_0x3147e4,0xc9))[_0x3aeb('0x44')](handleError(_0x3147e4,null));};exports[_0x3aeb('0x45')]=function(_0x269561,_0x29f870){if(_0x269561['body']['id']){delete _0x269561['body']['id'];}return db[_0x3aeb('0x3a')]['find']({'where':{'id':_0x269561[_0x3aeb('0x46')]['id']}})[_0x3aeb('0x23')](handleEntityNotFound(_0x29f870,null))[_0x3aeb('0x23')](saveUpdates(_0x269561['body'],null))[_0x3aeb('0x23')](respondWithResult(_0x29f870,null))['catch'](handleError(_0x29f870,null));};exports[_0x3aeb('0x22')]=function(_0x188828,_0x498199){return db[_0x3aeb('0x3a')][_0x3aeb('0x41')]({'where':{'id':_0x188828[_0x3aeb('0x46')]['id']}})[_0x3aeb('0x23')](handleEntityNotFound(_0x498199,null))[_0x3aeb('0x23')](removeEntity(_0x498199,null))['catch'](handleError(_0x498199,null));};exports[_0x3aeb('0x47')]=function(_0x252f78,_0x4a711f){return db[_0x3aeb('0x3a')][_0x3aeb('0x47')]()[_0x3aeb('0x23')](respondWithResult(_0x4a711f,null))[_0x3aeb('0x44')](handleError(_0x4a711f,null));};
\ No newline at end of file
diff --git a/server/api/userProfileSection/userProfileSection.model.js b/server/api/userProfileSection/userProfileSection.model.js
index 4d30fc4..b945bcf 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 _0xa42e=['path','../../config/environment','./userProfileSection.attributes','UserProfileSection','sectionId','userProfileId','lodash','../../config/logger','api'];(function(_0x2b015c,_0x43ba23){var _0x5c02ea=function(_0x20f48b){while(--_0x20f48b){_0x2b015c['push'](_0x2b015c['shift']());}};_0x5c02ea(++_0x43ba23);}(_0xa42e,0xba));var _0xea42=function(_0x43bc38,_0x3cbf71){_0x43bc38=_0x43bc38-0x0;var _0x5d960b=_0xa42e[_0x43bc38];return _0x5d960b;};'use strict';var _=require(_0xea42('0x0'));var util=require('util');var logger=require(_0xea42('0x1'))(_0xea42('0x2'));var moment=require('moment');var BPromise=require('bluebird');var rp=require('request-promise');var fs=require('fs');var path=require(_0xea42('0x3'));var rimraf=require('rimraf');var config=require(_0xea42('0x4'));var attributes=require(_0xea42('0x5'));module['exports']=function(_0x193d30,_0x5437fa){return _0x193d30['define'](_0xea42('0x6'),attributes,{'tableName':'user_profile_has_sections','paranoid':![],'indexes':[{'name':'compositeIndex','fields':[_0xea42('0x7'),_0xea42('0x8')]}],'timestamps':!![]});};
\ No newline at end of file
+var _0x59c4=['userProfileId','lodash','../../config/logger','api','moment','bluebird','request-promise','rimraf','../../config/environment','./userProfileSection.attributes','exports','define','UserProfileSection','user_profile_has_sections','sectionId'];(function(_0x2e303c,_0x15b8d3){var _0x46b892=function(_0xb196cb){while(--_0xb196cb){_0x2e303c['push'](_0x2e303c['shift']());}};_0x46b892(++_0x15b8d3);}(_0x59c4,0x79));var _0x459c=function(_0x18a976,_0x297652){_0x18a976=_0x18a976-0x0;var _0x2571f2=_0x59c4[_0x18a976];return _0x2571f2;};'use strict';var _=require(_0x459c('0x0'));var util=require('util');var logger=require(_0x459c('0x1'))(_0x459c('0x2'));var moment=require(_0x459c('0x3'));var BPromise=require(_0x459c('0x4'));var rp=require(_0x459c('0x5'));var fs=require('fs');var path=require('path');var rimraf=require(_0x459c('0x6'));var config=require(_0x459c('0x7'));var attributes=require(_0x459c('0x8'));module[_0x459c('0x9')]=function(_0x313c02,_0x335f12){return _0x313c02[_0x459c('0xa')](_0x459c('0xb'),attributes,{'tableName':_0x459c('0xc'),'paranoid':![],'indexes':[{'name':'compositeIndex','fields':[_0x459c('0xd'),_0x459c('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 3eaae98..923c3e6 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 _0xef6a=['stringify','error','code','message','info','result','lodash','util','moment','bluebird','randomstring','../../mysqldb','../../config/logger','rpc','../../config/environment','jayson/promise','client','http','request','then','UserProfileSection,\x20%s,\x20%s','request\x20sent','debug','UserProfileSection,\x20%s,\x20%s,\x20%s'];(function(_0x2e2861,_0x244dab){var _0x4c6b8a=function(_0x233223){while(--_0x233223){_0x2e2861['push'](_0x2e2861['shift']());}};_0x4c6b8a(++_0x244dab);}(_0xef6a,0x10e));var _0xaef6=function(_0x3511d3,_0x4107ae){_0x3511d3=_0x3511d3-0x0;var _0x5d6321=_0xef6a[_0x3511d3];return _0x5d6321;};'use strict';var _=require(_0xaef6('0x0'));var util=require(_0xaef6('0x1'));var moment=require(_0xaef6('0x2'));var BPromise=require(_0xaef6('0x3'));var rs=require(_0xaef6('0x4'));var fs=require('fs');var Redis=require('ioredis');var db=require(_0xaef6('0x5'))['db'];var utils=require('../../config/utils');var logger=require(_0xaef6('0x6'))(_0xaef6('0x7'));var config=require(_0xaef6('0x8'));var jayson=require(_0xaef6('0x9'));var client=jayson[_0xaef6('0xa')][_0xaef6('0xb')]({'port':0x232a});function respondWithRpcPromise(_0x155b1f,_0x6d1db6,_0x3d7303){return new BPromise(function(_0x4fafb9,_0x26d771){return client[_0xaef6('0xc')](_0x155b1f,_0x3d7303)[_0xaef6('0xd')](function(_0x8cac1){logger['info'](_0xaef6('0xe'),_0x6d1db6,_0xaef6('0xf'));logger[_0xaef6('0x10')](_0xaef6('0x11'),_0x6d1db6,_0xaef6('0xf'),JSON[_0xaef6('0x12')](_0x8cac1));if(_0x8cac1[_0xaef6('0x13')]){if(_0x8cac1[_0xaef6('0x13')][_0xaef6('0x14')]===0x1f4){logger[_0xaef6('0x13')](_0xaef6('0xe'),_0x6d1db6,_0x8cac1[_0xaef6('0x13')][_0xaef6('0x15')]);return _0x26d771(_0x8cac1[_0xaef6('0x13')][_0xaef6('0x15')]);}logger[_0xaef6('0x13')](_0xaef6('0xe'),_0x6d1db6,_0x8cac1[_0xaef6('0x13')][_0xaef6('0x15')]);return _0x4fafb9(_0x8cac1['error'][_0xaef6('0x15')]);}else{logger[_0xaef6('0x16')](_0xaef6('0xe'),_0x6d1db6,'request\x20sent');_0x4fafb9(_0x8cac1[_0xaef6('0x17')][_0xaef6('0x15')]);}})['catch'](function(_0x4d47ba){logger[_0xaef6('0x13')](_0xaef6('0xe'),_0x6d1db6,_0x4d47ba);_0x26d771(_0x4d47ba);});});}
\ No newline at end of file
+var _0x4e38=['request','then','info','request\x20sent','UserProfileSection,\x20%s,\x20%s,\x20%s','stringify','error','code','message','UserProfileSection,\x20%s,\x20%s','result','catch','lodash','util','moment','bluebird','../../config/utils','rpc','../../config/environment','jayson/promise','http'];(function(_0x50c2cd,_0x4256ed){var _0x24d02e=function(_0x4be970){while(--_0x4be970){_0x50c2cd['push'](_0x50c2cd['shift']());}};_0x24d02e(++_0x4256ed);}(_0x4e38,0x108));var _0x84e3=function(_0x5d53ed,_0x2d7182){_0x5d53ed=_0x5d53ed-0x0;var _0x21c36d=_0x4e38[_0x5d53ed];return _0x21c36d;};'use strict';var _=require(_0x84e3('0x0'));var util=require(_0x84e3('0x1'));var moment=require(_0x84e3('0x2'));var BPromise=require(_0x84e3('0x3'));var rs=require('randomstring');var fs=require('fs');var Redis=require('ioredis');var db=require('../../mysqldb')['db'];var utils=require(_0x84e3('0x4'));var logger=require('../../config/logger')(_0x84e3('0x5'));var config=require(_0x84e3('0x6'));var jayson=require(_0x84e3('0x7'));var client=jayson['client'][_0x84e3('0x8')]({'port':0x232a});function respondWithRpcPromise(_0x38a9a5,_0x185c49,_0x2bb496){return new BPromise(function(_0xab0ba6,_0x1b77e6){return client[_0x84e3('0x9')](_0x38a9a5,_0x2bb496)[_0x84e3('0xa')](function(_0x5d99fe){logger[_0x84e3('0xb')]('UserProfileSection,\x20%s,\x20%s',_0x185c49,_0x84e3('0xc'));logger['debug'](_0x84e3('0xd'),_0x185c49,_0x84e3('0xc'),JSON[_0x84e3('0xe')](_0x5d99fe));if(_0x5d99fe[_0x84e3('0xf')]){if(_0x5d99fe[_0x84e3('0xf')][_0x84e3('0x10')]===0x1f4){logger[_0x84e3('0xf')]('UserProfileSection,\x20%s,\x20%s',_0x185c49,_0x5d99fe[_0x84e3('0xf')][_0x84e3('0x11')]);return _0x1b77e6(_0x5d99fe[_0x84e3('0xf')][_0x84e3('0x11')]);}logger[_0x84e3('0xf')](_0x84e3('0x12'),_0x185c49,_0x5d99fe[_0x84e3('0xf')][_0x84e3('0x11')]);return _0xab0ba6(_0x5d99fe[_0x84e3('0xf')][_0x84e3('0x11')]);}else{logger['info']('UserProfileSection,\x20%s,\x20%s',_0x185c49,_0x84e3('0xc'));_0xab0ba6(_0x5d99fe[_0x84e3('0x13')][_0x84e3('0x11')]);}})[_0x84e3('0x14')](function(_0x5d3b5c){logger[_0x84e3('0xf')]('UserProfileSection,\x20%s,\x20%s',_0x185c49,_0x5d3b5c);_0x1b77e6(_0x5d3b5c);});});}
\ No newline at end of file
diff --git a/server/api/userSmsQueue/index.js b/server/api/userSmsQueue/index.js
index 9916221..05d1854 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 _0x16a1=['../../components/auth/service','../../components/interaction/service','exports','multer','util','path','connect-timeout','Router'];(function(_0x40220a,_0x22feb1){var _0x3903cc=function(_0x33a296){while(--_0x33a296){_0x40220a['push'](_0x40220a['shift']());}};_0x3903cc(++_0x22feb1);}(_0x16a1,0xeb));var _0x116a=function(_0x6131cd,_0x4c26a1){_0x6131cd=_0x6131cd-0x0;var _0x47e916=_0x16a1[_0x6131cd];return _0x47e916;};'use strict';var multer=require(_0x116a('0x0'));var util=require(_0x116a('0x1'));var path=require(_0x116a('0x2'));var timeout=require(_0x116a('0x3'));var express=require('express');var router=express[_0x116a('0x4')]();var auth=require(_0x116a('0x5'));var interaction=require(_0x116a('0x6'));var config=require('../../config/environment');module[_0x116a('0x7')]=router;
\ No newline at end of file
+var _0x3c70=['exports','multer','util','path','connect-timeout','express','../../components/auth/service'];(function(_0x3054be,_0x1bdc8b){var _0x3df150=function(_0x56cfbf){while(--_0x56cfbf){_0x3054be['push'](_0x3054be['shift']());}};_0x3df150(++_0x1bdc8b);}(_0x3c70,0x7f));var _0x03c7=function(_0x5b644e,_0x2e5e07){_0x5b644e=_0x5b644e-0x0;var _0x49c6bf=_0x3c70[_0x5b644e];return _0x49c6bf;};'use strict';var multer=require(_0x03c7('0x0'));var util=require(_0x03c7('0x1'));var path=require(_0x03c7('0x2'));var timeout=require(_0x03c7('0x3'));var express=require(_0x03c7('0x4'));var router=express['Router']();var auth=require(_0x03c7('0x5'));var interaction=require('../../components/interaction/service');var config=require('../../config/environment');module[_0x03c7('0x6')]=router;
\ No newline at end of file
diff --git a/server/api/userSmsQueue/userSmsQueue.attributes.js b/server/api/userSmsQueue/userSmsQueue.attributes.js
index d898c21..2eee2dc 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 _0xd8b0=['exports','sequelize'];(function(_0x2b7675,_0x5969c9){var _0x4c4f97=function(_0x233188){while(--_0x233188){_0x2b7675['push'](_0x2b7675['shift']());}};_0x4c4f97(++_0x5969c9);}(_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 _0xd8b0=['exports','sequelize'];(function(_0x3ab0ac,_0x1ea9cf){var _0x1f743d=function(_0x45fb92){while(--_0x45fb92){_0x3ab0ac['push'](_0x3ab0ac['shift']());}};_0x1f743d(++_0x1ea9cf);}(_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/userSmsQueue/userSmsQueue.model.js b/server/api/userSmsQueue/userSmsQueue.model.js
index 663f4e3..0300c30 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 _0x2805=['user_has_sms_queues','lodash','util','../../config/logger','bluebird','request-promise','rimraf','./userSmsQueue.attributes','exports','UserSmsQueue'];(function(_0x26c402,_0x250d4f){var _0x4b3dec=function(_0x441a36){while(--_0x441a36){_0x26c402['push'](_0x26c402['shift']());}};_0x4b3dec(++_0x250d4f);}(_0x2805,0x6f));var _0x5280=function(_0xd09668,_0x1435b2){_0xd09668=_0xd09668-0x0;var _0x68726=_0x2805[_0xd09668];return _0x68726;};'use strict';var _=require(_0x5280('0x0'));var util=require(_0x5280('0x1'));var logger=require(_0x5280('0x2'))('api');var moment=require('moment');var BPromise=require(_0x5280('0x3'));var rp=require(_0x5280('0x4'));var fs=require('fs');var path=require('path');var rimraf=require(_0x5280('0x5'));var config=require('../../config/environment');var attributes=require(_0x5280('0x6'));module[_0x5280('0x7')]=function(_0x497ed0,_0x35dd77){return _0x497ed0['define'](_0x5280('0x8'),attributes,{'tableName':_0x5280('0x9'),'paranoid':![],'indexes':[],'timestamps':!![]});};
\ No newline at end of file
+var _0xfaf8=['lodash','util','api','moment','bluebird','request-promise','rimraf','./userSmsQueue.attributes','exports','UserSmsQueue','user_has_sms_queues'];(function(_0x285f68,_0x4cf1c8){var _0x79a01c=function(_0x25c50d){while(--_0x25c50d){_0x285f68['push'](_0x285f68['shift']());}};_0x79a01c(++_0x4cf1c8);}(_0xfaf8,0x18c));var _0x8faf=function(_0x42bbeb,_0x4618bd){_0x42bbeb=_0x42bbeb-0x0;var _0x5894e4=_0xfaf8[_0x42bbeb];return _0x5894e4;};'use strict';var _=require(_0x8faf('0x0'));var util=require(_0x8faf('0x1'));var logger=require('../../config/logger')(_0x8faf('0x2'));var moment=require(_0x8faf('0x3'));var BPromise=require(_0x8faf('0x4'));var rp=require(_0x8faf('0x5'));var fs=require('fs');var path=require('path');var rimraf=require(_0x8faf('0x6'));var config=require('../../config/environment');var attributes=require(_0x8faf('0x7'));module[_0x8faf('0x8')]=function(_0x2e244c,_0x2fbe15){return _0x2e244c['define'](_0x8faf('0x9'),attributes,{'tableName':_0x8faf('0xa'),'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 16b8b98..db7920e 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 _0xba53=['error','code','message','result','catch','lodash','util','moment','bluebird','../../mysqldb','rpc','../../config/environment','jayson/promise','client','http','then','info','UserSmsQueue,\x20%s,\x20%s','request\x20sent','UserSmsQueue,\x20%s,\x20%s,\x20%s','stringify'];(function(_0x91d019,_0x5223c4){var _0x19de1f=function(_0x3e1311){while(--_0x3e1311){_0x91d019['push'](_0x91d019['shift']());}};_0x19de1f(++_0x5223c4);}(_0xba53,0x1d3));var _0x3ba5=function(_0xefd519,_0xc62635){_0xefd519=_0xefd519-0x0;var _0x4bb882=_0xba53[_0xefd519];return _0x4bb882;};'use strict';var _=require(_0x3ba5('0x0'));var util=require(_0x3ba5('0x1'));var moment=require(_0x3ba5('0x2'));var BPromise=require(_0x3ba5('0x3'));var rs=require('randomstring');var fs=require('fs');var Redis=require('ioredis');var db=require(_0x3ba5('0x4'))['db'];var utils=require('../../config/utils');var logger=require('../../config/logger')(_0x3ba5('0x5'));var config=require(_0x3ba5('0x6'));var jayson=require(_0x3ba5('0x7'));var client=jayson[_0x3ba5('0x8')][_0x3ba5('0x9')]({'port':0x232a});function respondWithRpcPromise(_0x26247a,_0x3fcfb5,_0x548d23){return new BPromise(function(_0x4e63cf,_0x4bc2d1){return client['request'](_0x26247a,_0x548d23)[_0x3ba5('0xa')](function(_0x53ba4d){logger[_0x3ba5('0xb')](_0x3ba5('0xc'),_0x3fcfb5,_0x3ba5('0xd'));logger['debug'](_0x3ba5('0xe'),_0x3fcfb5,_0x3ba5('0xd'),JSON[_0x3ba5('0xf')](_0x53ba4d));if(_0x53ba4d[_0x3ba5('0x10')]){if(_0x53ba4d['error'][_0x3ba5('0x11')]===0x1f4){logger[_0x3ba5('0x10')]('UserSmsQueue,\x20%s,\x20%s',_0x3fcfb5,_0x53ba4d[_0x3ba5('0x10')][_0x3ba5('0x12')]);return _0x4bc2d1(_0x53ba4d[_0x3ba5('0x10')][_0x3ba5('0x12')]);}logger['error'](_0x3ba5('0xc'),_0x3fcfb5,_0x53ba4d['error']['message']);return _0x4e63cf(_0x53ba4d['error'][_0x3ba5('0x12')]);}else{logger[_0x3ba5('0xb')](_0x3ba5('0xc'),_0x3fcfb5,_0x3ba5('0xd'));_0x4e63cf(_0x53ba4d[_0x3ba5('0x13')][_0x3ba5('0x12')]);}})[_0x3ba5('0x14')](function(_0x4de4da){logger[_0x3ba5('0x10')](_0x3ba5('0xc'),_0x3fcfb5,_0x4de4da);_0x4bc2d1(_0x4de4da);});});}
\ No newline at end of file
+var _0x4db0=['../../config/logger','rpc','jayson/promise','client','request','then','info','UserSmsQueue,\x20%s,\x20%s','request\x20sent','debug','UserSmsQueue,\x20%s,\x20%s,\x20%s','stringify','error','code','message','result','util','moment','ioredis','../../mysqldb','../../config/utils'];(function(_0x27af45,_0x1b57aa){var _0x18df21=function(_0x4b7679){while(--_0x4b7679){_0x27af45['push'](_0x27af45['shift']());}};_0x18df21(++_0x1b57aa);}(_0x4db0,0x1c9));var _0x04db=function(_0x1e0846,_0x4aea1b){_0x1e0846=_0x1e0846-0x0;var _0x57e5d7=_0x4db0[_0x1e0846];return _0x57e5d7;};'use strict';var _=require('lodash');var util=require(_0x04db('0x0'));var moment=require(_0x04db('0x1'));var BPromise=require('bluebird');var rs=require('randomstring');var fs=require('fs');var Redis=require(_0x04db('0x2'));var db=require(_0x04db('0x3'))['db'];var utils=require(_0x04db('0x4'));var logger=require(_0x04db('0x5'))(_0x04db('0x6'));var config=require('../../config/environment');var jayson=require(_0x04db('0x7'));var client=jayson[_0x04db('0x8')]['http']({'port':0x232a});function respondWithRpcPromise(_0x3c1cc4,_0xf56c54,_0x42d812){return new BPromise(function(_0x5683ec,_0x4bd2d8){return client[_0x04db('0x9')](_0x3c1cc4,_0x42d812)[_0x04db('0xa')](function(_0x24c414){logger[_0x04db('0xb')](_0x04db('0xc'),_0xf56c54,_0x04db('0xd'));logger[_0x04db('0xe')](_0x04db('0xf'),_0xf56c54,_0x04db('0xd'),JSON[_0x04db('0x10')](_0x24c414));if(_0x24c414[_0x04db('0x11')]){if(_0x24c414[_0x04db('0x11')][_0x04db('0x12')]===0x1f4){logger[_0x04db('0x11')]('UserSmsQueue,\x20%s,\x20%s',_0xf56c54,_0x24c414[_0x04db('0x11')]['message']);return _0x4bd2d8(_0x24c414[_0x04db('0x11')][_0x04db('0x13')]);}logger[_0x04db('0x11')]('UserSmsQueue,\x20%s,\x20%s',_0xf56c54,_0x24c414[_0x04db('0x11')][_0x04db('0x13')]);return _0x5683ec(_0x24c414[_0x04db('0x11')][_0x04db('0x13')]);}else{logger['info'](_0x04db('0xc'),_0xf56c54,'request\x20sent');_0x5683ec(_0x24c414[_0x04db('0x14')][_0x04db('0x13')]);}})['catch'](function(_0x2820c4){logger['error'](_0x04db('0xc'),_0xf56c54,_0x2820c4);_0x4bd2d8(_0x2820c4);});});}
\ No newline at end of file
diff --git a/server/api/userVoiceQueue/index.js b/server/api/userVoiceQueue/index.js
index 6691cbc..1bd1439 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 _0xc369=['util','path','connect-timeout','express','Router','../../components/auth/service','../../components/interaction/service','exports','multer'];(function(_0x5a776b,_0x46f785){var _0xbbef59=function(_0x38313e){while(--_0x38313e){_0x5a776b['push'](_0x5a776b['shift']());}};_0xbbef59(++_0x46f785);}(_0xc369,0x1a6));var _0x9c36=function(_0x3d7442,_0x11476b){_0x3d7442=_0x3d7442-0x0;var _0x23191d=_0xc369[_0x3d7442];return _0x23191d;};'use strict';var multer=require(_0x9c36('0x0'));var util=require(_0x9c36('0x1'));var path=require(_0x9c36('0x2'));var timeout=require(_0x9c36('0x3'));var express=require(_0x9c36('0x4'));var router=express[_0x9c36('0x5')]();var auth=require(_0x9c36('0x6'));var interaction=require(_0x9c36('0x7'));var config=require('../../config/environment');module[_0x9c36('0x8')]=router;
\ No newline at end of file
+var _0xdbaa=['express','../../components/auth/service','../../components/interaction/service','../../config/environment','exports','multer','path','connect-timeout'];(function(_0x4a2a23,_0x3fdc2b){var _0x1747f7=function(_0x3c0a2d){while(--_0x3c0a2d){_0x4a2a23['push'](_0x4a2a23['shift']());}};_0x1747f7(++_0x3fdc2b);}(_0xdbaa,0x175));var _0xadba=function(_0xb24a3e,_0x4a3594){_0xb24a3e=_0xb24a3e-0x0;var _0x4038d7=_0xdbaa[_0xb24a3e];return _0x4038d7;};'use strict';var multer=require(_0xadba('0x0'));var util=require('util');var path=require(_0xadba('0x1'));var timeout=require(_0xadba('0x2'));var express=require(_0xadba('0x3'));var router=express['Router']();var auth=require(_0xadba('0x4'));var interaction=require(_0xadba('0x5'));var config=require(_0xadba('0x6'));module[_0xadba('0x7')]=router;
\ No newline at end of file
diff --git a/server/api/userVoiceQueue/userVoiceQueue.attributes.js b/server/api/userVoiceQueue/userVoiceQueue.attributes.js
index ffee14b..0a035c1 100644
--- a/server/api/userVoiceQueue/userVoiceQueue.attributes.js
+++ b/server/api/userVoiceQueue/userVoiceQueue.attributes.js
@@ -15,4 +15,4 @@
// * treaties. The SOFTWARE PRODUCT is licensed, not sold. *
// * *
// *************************************************************************
-var _0xbaf0=['exports','INTEGER'];(function(_0x42d1f8,_0x22e529){var _0x40d234=function(_0xd59b57){while(--_0xd59b57){_0x42d1f8['push'](_0x42d1f8['shift']());}};_0x40d234(++_0x22e529);}(_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
+var _0xe706=['INTEGER','sequelize','exports'];(function(_0x1d4a9c,_0x296180){var _0x2ae3d2=function(_0x3ee04e){while(--_0x3ee04e){_0x1d4a9c['push'](_0x1d4a9c['shift']());}};_0x2ae3d2(++_0x296180);}(_0xe706,0xa3));var _0x6e70=function(_0x441981,_0x12a3eb){_0x441981=_0x441981-0x0;var _0x19ce77=_0xe706[_0x441981];return _0x19ce77;};'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/userVoiceQueue/userVoiceQueue.model.js b/server/api/userVoiceQueue/userVoiceQueue.model.js
index 7bcbc11..fdf7c81 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 _0x4b84=['moment','path','rimraf','../../config/environment','UserVoiceQueue','lodash','util'];(function(_0x14add3,_0x13ce8d){var _0x4a174f=function(_0x2b3ed7){while(--_0x2b3ed7){_0x14add3['push'](_0x14add3['shift']());}};_0x4a174f(++_0x13ce8d);}(_0x4b84,0x1cc));var _0x44b8=function(_0x56740a,_0x568894){_0x56740a=_0x56740a-0x0;var _0x257144=_0x4b84[_0x56740a];return _0x257144;};'use strict';var _=require(_0x44b8('0x0'));var util=require(_0x44b8('0x1'));var logger=require('../../config/logger')('api');var moment=require(_0x44b8('0x2'));var BPromise=require('bluebird');var rp=require('request-promise');var fs=require('fs');var path=require(_0x44b8('0x3'));var rimraf=require(_0x44b8('0x4'));var config=require(_0x44b8('0x5'));var attributes=require('./userVoiceQueue.attributes');module['exports']=function(_0x55f25d,_0x996a8b){return _0x55f25d['define'](_0x44b8('0x6'),attributes,{'tableName':'user_has_voice_queues','paranoid':![],'indexes':[],'timestamps':!![]});};
\ No newline at end of file
+var _0x6334=['rimraf','../../config/environment','./userVoiceQueue.attributes','exports','UserVoiceQueue','lodash','util','../../config/logger','api','moment','bluebird','path'];(function(_0x5c1f91,_0x492909){var _0x16b4b9=function(_0x3dfc84){while(--_0x3dfc84){_0x5c1f91['push'](_0x5c1f91['shift']());}};_0x16b4b9(++_0x492909);}(_0x6334,0x119));var _0x4633=function(_0x3efe9b,_0x5b41a8){_0x3efe9b=_0x3efe9b-0x0;var _0x132073=_0x6334[_0x3efe9b];return _0x132073;};'use strict';var _=require(_0x4633('0x0'));var util=require(_0x4633('0x1'));var logger=require(_0x4633('0x2'))(_0x4633('0x3'));var moment=require(_0x4633('0x4'));var BPromise=require(_0x4633('0x5'));var rp=require('request-promise');var fs=require('fs');var path=require(_0x4633('0x6'));var rimraf=require(_0x4633('0x7'));var config=require(_0x4633('0x8'));var attributes=require(_0x4633('0x9'));module[_0x4633('0xa')]=function(_0x6493dc,_0x175e14){return _0x6493dc['define'](_0x4633('0xb'),attributes,{'tableName':'user_has_voice_queues','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 3a80f17..b08e7a8 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 _0x325e=['message','result','lodash','util','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','client','http','request','then','info','UserVoiceQueue,\x20%s,\x20%s','request\x20sent','debug','UserVoiceQueue,\x20%s,\x20%s,\x20%s','stringify','error','code'];(function(_0x5e95c2,_0x590f01){var _0x2d5855=function(_0x2f984a){while(--_0x2f984a){_0x5e95c2['push'](_0x5e95c2['shift']());}};_0x2d5855(++_0x590f01);}(_0x325e,0x14c));var _0xe325=function(_0x3dd15e,_0x1f0015){_0x3dd15e=_0x3dd15e-0x0;var _0x231fd0=_0x325e[_0x3dd15e];return _0x231fd0;};'use strict';var _=require(_0xe325('0x0'));var util=require(_0xe325('0x1'));var moment=require(_0xe325('0x2'));var BPromise=require(_0xe325('0x3'));var rs=require(_0xe325('0x4'));var fs=require('fs');var Redis=require(_0xe325('0x5'));var db=require(_0xe325('0x6'))['db'];var utils=require(_0xe325('0x7'));var logger=require('../../config/logger')('rpc');var config=require('../../config/environment');var jayson=require('jayson/promise');var client=jayson[_0xe325('0x8')][_0xe325('0x9')]({'port':0x232a});function respondWithRpcPromise(_0x54df7d,_0x189196,_0x5cbe38){return new BPromise(function(_0xcc3139,_0x199caa){return client[_0xe325('0xa')](_0x54df7d,_0x5cbe38)[_0xe325('0xb')](function(_0x500cdd){logger[_0xe325('0xc')](_0xe325('0xd'),_0x189196,_0xe325('0xe'));logger[_0xe325('0xf')](_0xe325('0x10'),_0x189196,_0xe325('0xe'),JSON[_0xe325('0x11')](_0x500cdd));if(_0x500cdd[_0xe325('0x12')]){if(_0x500cdd[_0xe325('0x12')][_0xe325('0x13')]===0x1f4){logger['error']('UserVoiceQueue,\x20%s,\x20%s',_0x189196,_0x500cdd[_0xe325('0x12')][_0xe325('0x14')]);return _0x199caa(_0x500cdd[_0xe325('0x12')][_0xe325('0x14')]);}logger[_0xe325('0x12')](_0xe325('0xd'),_0x189196,_0x500cdd['error'][_0xe325('0x14')]);return _0xcc3139(_0x500cdd[_0xe325('0x12')][_0xe325('0x14')]);}else{logger[_0xe325('0xc')](_0xe325('0xd'),_0x189196,'request\x20sent');_0xcc3139(_0x500cdd[_0xe325('0x15')]['message']);}})['catch'](function(_0x22ced0){logger[_0xe325('0x12')](_0xe325('0xd'),_0x189196,_0x22ced0);_0x199caa(_0x22ced0);});});}
\ No newline at end of file
+var _0x5809=['request\x20sent','stringify','error','message','result','catch','lodash','util','moment','bluebird','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','client','request','then','info','UserVoiceQueue,\x20%s,\x20%s','debug','UserVoiceQueue,\x20%s,\x20%s,\x20%s'];(function(_0x4565bf,_0x5ad9d6){var _0x5610ba=function(_0x170988){while(--_0x170988){_0x4565bf['push'](_0x4565bf['shift']());}};_0x5610ba(++_0x5ad9d6);}(_0x5809,0x166));var _0x9580=function(_0x4a9fb1,_0x273043){_0x4a9fb1=_0x4a9fb1-0x0;var _0x348672=_0x5809[_0x4a9fb1];return _0x348672;};'use strict';var _=require(_0x9580('0x0'));var util=require(_0x9580('0x1'));var moment=require(_0x9580('0x2'));var BPromise=require(_0x9580('0x3'));var rs=require('randomstring');var fs=require('fs');var Redis=require('ioredis');var db=require(_0x9580('0x4'))['db'];var utils=require(_0x9580('0x5'));var logger=require(_0x9580('0x6'))(_0x9580('0x7'));var config=require(_0x9580('0x8'));var jayson=require('jayson/promise');var client=jayson[_0x9580('0x9')]['http']({'port':0x232a});function respondWithRpcPromise(_0x243ea6,_0x318ac4,_0x5acc81){return new BPromise(function(_0x4974f4,_0x19d7df){return client[_0x9580('0xa')](_0x243ea6,_0x5acc81)[_0x9580('0xb')](function(_0x461be9){logger[_0x9580('0xc')](_0x9580('0xd'),_0x318ac4,'request\x20sent');logger[_0x9580('0xe')](_0x9580('0xf'),_0x318ac4,_0x9580('0x10'),JSON[_0x9580('0x11')](_0x461be9));if(_0x461be9[_0x9580('0x12')]){if(_0x461be9['error']['code']===0x1f4){logger[_0x9580('0x12')]('UserVoiceQueue,\x20%s,\x20%s',_0x318ac4,_0x461be9[_0x9580('0x12')][_0x9580('0x13')]);return _0x19d7df(_0x461be9[_0x9580('0x12')][_0x9580('0x13')]);}logger[_0x9580('0x12')]('UserVoiceQueue,\x20%s,\x20%s',_0x318ac4,_0x461be9[_0x9580('0x12')]['message']);return _0x4974f4(_0x461be9['error'][_0x9580('0x13')]);}else{logger[_0x9580('0xc')](_0x9580('0xd'),_0x318ac4,_0x9580('0x10'));_0x4974f4(_0x461be9[_0x9580('0x14')]['message']);}})[_0x9580('0x15')](function(_0x233e34){logger[_0x9580('0x12')](_0x9580('0xd'),_0x318ac4,_0x233e34);_0x19d7df(_0x233e34);});});}
\ No newline at end of file
diff --git a/server/api/userVoiceQueueRt/index.js b/server/api/userVoiceQueueRt/index.js
index 2ae2ea4..c628a3b 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 _0x2823=['exports','path','connect-timeout','express','Router','../../components/auth/service','../../components/interaction/service','../../config/environment'];(function(_0x28c9cd,_0x2db166){var _0x3f0082=function(_0x537215){while(--_0x537215){_0x28c9cd['push'](_0x28c9cd['shift']());}};_0x3f0082(++_0x2db166);}(_0x2823,0x129));var _0x3282=function(_0x1d527e,_0x5987d8){_0x1d527e=_0x1d527e-0x0;var _0x220b0a=_0x2823[_0x1d527e];return _0x220b0a;};'use strict';var multer=require('multer');var util=require('util');var path=require(_0x3282('0x0'));var timeout=require(_0x3282('0x1'));var express=require(_0x3282('0x2'));var router=express[_0x3282('0x3')]();var auth=require(_0x3282('0x4'));var interaction=require(_0x3282('0x5'));var config=require(_0x3282('0x6'));module[_0x3282('0x7')]=router;
\ No newline at end of file
+var _0x4aa2=['exports','multer','util','connect-timeout','express','Router','../../components/auth/service','../../components/interaction/service','../../config/environment'];(function(_0x431970,_0x3d390b){var _0x3a347a=function(_0x44cb66){while(--_0x44cb66){_0x431970['push'](_0x431970['shift']());}};_0x3a347a(++_0x3d390b);}(_0x4aa2,0x76));var _0x24aa=function(_0x2bf22d,_0x34479c){_0x2bf22d=_0x2bf22d-0x0;var _0x417874=_0x4aa2[_0x2bf22d];return _0x417874;};'use strict';var multer=require(_0x24aa('0x0'));var util=require(_0x24aa('0x1'));var path=require('path');var timeout=require(_0x24aa('0x2'));var express=require(_0x24aa('0x3'));var router=express[_0x24aa('0x4')]();var auth=require(_0x24aa('0x5'));var interaction=require(_0x24aa('0x6'));var config=require(_0x24aa('0x7'));module[_0x24aa('0x8')]=router;
\ No newline at end of file
diff --git a/server/api/userVoiceQueueRt/userVoiceQueueRt.attributes.js b/server/api/userVoiceQueueRt/userVoiceQueueRt.attributes.js
index 2b52e66..3b61b49 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 _0x8a80=['INTEGER','Required\x20by\x20Asterisk','STRING','queue_interface','sequelize'];(function(_0x3b1c96,_0x1f4575){var _0x214f66=function(_0xb5389a){while(--_0xb5389a){_0x3b1c96['push'](_0x3b1c96['shift']());}};_0x214f66(++_0x1f4575);}(_0x8a80,0x90));var _0x08a8=function(_0x64c81d,_0x510da4){_0x64c81d=_0x64c81d-0x0;var _0x178f2d=_0x8a80[_0x64c81d];return _0x178f2d;};'use strict';var Sequelize=require(_0x08a8('0x0'));module['exports']={'uniqueid':{'type':Sequelize[_0x08a8('0x1')],'primaryKey':!![],'autoIncrement':!![],'comment':_0x08a8('0x2')},'membername':{'type':Sequelize[_0x08a8('0x3')],'allowNull':![],'comment':_0x08a8('0x2')},'UserId':{'type':Sequelize[_0x08a8('0x1')],'allowNull':![]},'queue_name':{'type':Sequelize[_0x08a8('0x3')],'allowNull':![],'unique':_0x08a8('0x4'),'comment':'Required\x20by\x20Asterisk'},'VoiceQueueId':{'type':Sequelize[_0x08a8('0x1')],'allowNull':![]},'interface':{'type':Sequelize['STRING'],'allowNull':![],'unique':_0x08a8('0x4'),'comment':_0x08a8('0x2')},'penalty':{'type':Sequelize[_0x08a8('0x1')](0xb),'defaultValue':0x0,'comment':_0x08a8('0x2')},'paused':{'type':Sequelize[_0x08a8('0x1')](0xb),'defaultValue':0x0,'comment':_0x08a8('0x2')}};
\ No newline at end of file
+var _0xaee7=['exports','INTEGER','Required\x20by\x20Asterisk','STRING','queue_interface'];(function(_0xa0d0af,_0xda0936){var _0x488454=function(_0x4097c8){while(--_0x4097c8){_0xa0d0af['push'](_0xa0d0af['shift']());}};_0x488454(++_0xda0936);}(_0xaee7,0x136));var _0x7aee=function(_0x21171a,_0x125ebd){_0x21171a=_0x21171a-0x0;var _0x4acd86=_0xaee7[_0x21171a];return _0x4acd86;};'use strict';var Sequelize=require('sequelize');module[_0x7aee('0x0')]={'uniqueid':{'type':Sequelize[_0x7aee('0x1')],'primaryKey':!![],'autoIncrement':!![],'comment':_0x7aee('0x2')},'membername':{'type':Sequelize[_0x7aee('0x3')],'allowNull':![],'comment':_0x7aee('0x2')},'UserId':{'type':Sequelize[_0x7aee('0x1')],'allowNull':![]},'queue_name':{'type':Sequelize['STRING'],'allowNull':![],'unique':_0x7aee('0x4'),'comment':_0x7aee('0x2')},'VoiceQueueId':{'type':Sequelize[_0x7aee('0x1')],'allowNull':![]},'interface':{'type':Sequelize[_0x7aee('0x3')],'allowNull':![],'unique':_0x7aee('0x4'),'comment':_0x7aee('0x2')},'penalty':{'type':Sequelize[_0x7aee('0x1')](0xb),'defaultValue':0x0,'comment':'Required\x20by\x20Asterisk'},'paused':{'type':Sequelize[_0x7aee('0x1')](0xb),'defaultValue':0x0,'comment':'Required\x20by\x20Asterisk'}};
\ No newline at end of file
diff --git a/server/api/userVoiceQueueRt/userVoiceQueueRt.events.js b/server/api/userVoiceQueueRt/userVoiceQueueRt.events.js
index 3335bc9..fb15dcc 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 _0x979a=['hook','exports','events','UserVoiceQueueRt','setMaxListeners','remove','emit'];(function(_0x1a6260,_0x2d7813){var _0x1350c1=function(_0x4494f3){while(--_0x4494f3){_0x1a6260['push'](_0x1a6260['shift']());}};_0x1350c1(++_0x2d7813);}(_0x979a,0x17c));var _0xa979=function(_0x43e1e6,_0x399da){_0x43e1e6=_0x43e1e6-0x0;var _0x58753d=_0x979a[_0x43e1e6];return _0x58753d;};'use strict';var EventEmitter=require(_0xa979('0x0'));var UserVoiceQueueRt=require('../../mysqldb')['db'][_0xa979('0x1')];var UserVoiceQueueRtEvents=new EventEmitter();UserVoiceQueueRtEvents[_0xa979('0x2')](0x0);var events={'afterCreate':'save','afterUpdate':'update','afterDestroy':_0xa979('0x3')};function emitEvent(_0x5c18e6){return function(_0x2bc9a4,_0x412e0c,_0x39801e){UserVoiceQueueRtEvents[_0xa979('0x4')](_0x5c18e6+':'+_0x2bc9a4['id'],_0x2bc9a4);UserVoiceQueueRtEvents[_0xa979('0x4')](_0x5c18e6,_0x2bc9a4);_0x39801e(null);};}for(var e in events){if(events['hasOwnProperty'](e)){var event=events[e];UserVoiceQueueRt[_0xa979('0x5')](e,emitEvent(event));}}module[_0xa979('0x6')]=UserVoiceQueueRtEvents;
\ No newline at end of file
+var _0x33e6=['hook','events','../../mysqldb','UserVoiceQueueRt','setMaxListeners','save','update','remove'];(function(_0x37b624,_0x28c3aa){var _0x44abd9=function(_0x40c152){while(--_0x40c152){_0x37b624['push'](_0x37b624['shift']());}};_0x44abd9(++_0x28c3aa);}(_0x33e6,0x149));var _0x633e=function(_0x42ee86,_0x6edb51){_0x42ee86=_0x42ee86-0x0;var _0x18ee15=_0x33e6[_0x42ee86];return _0x18ee15;};'use strict';var EventEmitter=require(_0x633e('0x0'));var UserVoiceQueueRt=require(_0x633e('0x1'))['db'][_0x633e('0x2')];var UserVoiceQueueRtEvents=new EventEmitter();UserVoiceQueueRtEvents[_0x633e('0x3')](0x0);var events={'afterCreate':_0x633e('0x4'),'afterUpdate':_0x633e('0x5'),'afterDestroy':_0x633e('0x6')};function emitEvent(_0x563f39){return function(_0x96c4e2,_0x185148,_0x2e2e0c){UserVoiceQueueRtEvents['emit'](_0x563f39+':'+_0x96c4e2['id'],_0x96c4e2);UserVoiceQueueRtEvents['emit'](_0x563f39,_0x96c4e2);_0x2e2e0c(null);};}for(var e in events){if(events['hasOwnProperty'](e)){var event=events[e];UserVoiceQueueRt[_0x633e('0x7')](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 56ae725..84c5dc1 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 _0xfe5e=['./userVoiceQueueRt.attributes','exports','define','UserVoiceQueueRt','user_has_voice_queues_rt','lodash','util','../../config/logger','api','moment','bluebird','request-promise','path','rimraf','../../config/environment'];(function(_0xbb091,_0x3fe7ee){var _0x467a04=function(_0x3a978d){while(--_0x3a978d){_0xbb091['push'](_0xbb091['shift']());}};_0x467a04(++_0x3fe7ee);}(_0xfe5e,0xc8));var _0xefe5=function(_0x3c6dce,_0x5424dd){_0x3c6dce=_0x3c6dce-0x0;var _0x1450e9=_0xfe5e[_0x3c6dce];return _0x1450e9;};'use strict';var _=require(_0xefe5('0x0'));var util=require(_0xefe5('0x1'));var logger=require(_0xefe5('0x2'))(_0xefe5('0x3'));var moment=require(_0xefe5('0x4'));var BPromise=require(_0xefe5('0x5'));var rp=require(_0xefe5('0x6'));var fs=require('fs');var path=require(_0xefe5('0x7'));var rimraf=require(_0xefe5('0x8'));var config=require(_0xefe5('0x9'));var attributes=require(_0xefe5('0xa'));module[_0xefe5('0xb')]=function(_0x3dc598,_0x56bc7c){return _0x3dc598[_0xefe5('0xc')](_0xefe5('0xd'),attributes,{'tableName':_0xefe5('0xe'),'paranoid':![],'indexes':[],'timestamps':!![]});};
\ No newline at end of file
+var _0x951c=['user_has_voice_queues_rt','lodash','util','api','moment','bluebird','rimraf','exports','define'];(function(_0x4566c9,_0x280505){var _0x5405c2=function(_0x20e7a6){while(--_0x20e7a6){_0x4566c9['push'](_0x4566c9['shift']());}};_0x5405c2(++_0x280505);}(_0x951c,0x88));var _0xc951=function(_0x571afc,_0x3977c3){_0x571afc=_0x571afc-0x0;var _0x25a305=_0x951c[_0x571afc];return _0x25a305;};'use strict';var _=require(_0xc951('0x0'));var util=require(_0xc951('0x1'));var logger=require('../../config/logger')(_0xc951('0x2'));var moment=require(_0xc951('0x3'));var BPromise=require(_0xc951('0x4'));var rp=require('request-promise');var fs=require('fs');var path=require('path');var rimraf=require(_0xc951('0x5'));var config=require('../../config/environment');var attributes=require('./userVoiceQueueRt.attributes');module[_0xc951('0x6')]=function(_0x1d273b,_0xb5129){return _0x1d273b[_0xc951('0x7')]('UserVoiceQueueRt',attributes,{'tableName':_0xc951('0x8'),'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 0066b13..f1ef929 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 _0x74a2=['error','code','message','info','request\x20sent','result','findAll','options','raw','where','sequelize','COUNT','`paused`\x20=\x201,\x201,\x20null','outboundQueuePauses','GetVoiceQueueRtPauses','util','moment','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','client','http','redis','defaults','localhost','socket.io-emitter','register','then','UserVoiceQueueRt,\x20%s,\x20%s','debug','UserVoiceQueueRt,\x20%s,\x20%s,\x20%s','stringify'];(function(_0x19388f,_0x44fbe2){var _0x22328f=function(_0x9316bd){while(--_0x9316bd){_0x19388f['push'](_0x19388f['shift']());}};_0x22328f(++_0x44fbe2);}(_0x74a2,0x1bf));var _0x274a=function(_0x1ae31c,_0x8dcd2d){_0x1ae31c=_0x1ae31c-0x0;var _0x19519d=_0x74a2[_0x1ae31c];return _0x19519d;};'use strict';var _=require('lodash');var util=require(_0x274a('0x0'));var moment=require(_0x274a('0x1'));var BPromise=require('bluebird');var rs=require('randomstring');var fs=require('fs');var Redis=require(_0x274a('0x2'));var db=require(_0x274a('0x3'))['db'];var utils=require(_0x274a('0x4'));var logger=require(_0x274a('0x5'))(_0x274a('0x6'));var config=require(_0x274a('0x7'));var jayson=require(_0x274a('0x8'));var client=jayson[_0x274a('0x9')][_0x274a('0xa')]({'port':0x232a});config[_0x274a('0xb')]=_[_0x274a('0xc')](config[_0x274a('0xb')],{'host':_0x274a('0xd'),'port':0x18eb});var socket=require(_0x274a('0xe'))(new Redis(config[_0x274a('0xb')]));require('./userVoiceQueueRt.socket')[_0x274a('0xf')](socket);function respondWithRpcPromise(_0x2cb635,_0x59ebf3,_0xceb105){return new BPromise(function(_0x3fda9f,_0x1b4679){return client['request'](_0x2cb635,_0xceb105)[_0x274a('0x10')](function(_0x3c7855){logger['info'](_0x274a('0x11'),_0x59ebf3,'request\x20sent');logger[_0x274a('0x12')](_0x274a('0x13'),_0x59ebf3,'request\x20sent',JSON[_0x274a('0x14')](_0x3c7855));if(_0x3c7855[_0x274a('0x15')]){if(_0x3c7855['error'][_0x274a('0x16')]===0x1f4){logger['error']('UserVoiceQueueRt,\x20%s,\x20%s',_0x59ebf3,_0x3c7855[_0x274a('0x15')]['message']);return _0x1b4679(_0x3c7855[_0x274a('0x15')][_0x274a('0x17')]);}logger[_0x274a('0x15')]('UserVoiceQueueRt,\x20%s,\x20%s',_0x59ebf3,_0x3c7855['error']['message']);return _0x3fda9f(_0x3c7855[_0x274a('0x15')][_0x274a('0x17')]);}else{logger[_0x274a('0x18')](_0x274a('0x11'),_0x59ebf3,_0x274a('0x19'));_0x3fda9f(_0x3c7855[_0x274a('0x1a')][_0x274a('0x17')]);}})['catch'](function(_0xdec7a2){logger[_0x274a('0x15')](_0x274a('0x11'),_0x59ebf3,_0xdec7a2);_0x1b4679(_0xdec7a2);});});}exports['GetVoiceQueueRtPauses']=function(_0x9f6695){var _0x4b954e=this;return new Promise(function(_0x48466b,_0x4bc3a0){return db['UserVoiceQueueRt'][_0x274a('0x1b')]({'raw':_0x9f6695[_0x274a('0x1c')]?_0x9f6695['options'][_0x274a('0x1d')]===undefined?!![]:![]:!![],'where':_0x9f6695[_0x274a('0x1c')]?_0x9f6695[_0x274a('0x1c')][_0x274a('0x1e')]||null:null,'attributes':[[db[_0x274a('0x1f')]['fn'](_0x274a('0x20'),db[_0x274a('0x1f')]['fn']('IF',db[_0x274a('0x1f')]['literal'](_0x274a('0x21')))),_0x274a('0x22')]]})[_0x274a('0x10')](function(_0x13c5ce){logger['info'](_0x274a('0x23'),_0x9f6695);logger[_0x274a('0x12')](_0x274a('0x23'),_0x9f6695,JSON[_0x274a('0x14')](_0x13c5ce));_0x48466b(_0x13c5ce);})['catch'](function(_0x1788d6){logger[_0x274a('0x15')](_0x274a('0x23'),_0x1788d6[_0x274a('0x17')],_0x9f6695);_0x4bc3a0(_0x4b954e[_0x274a('0x15')](0x1f4,_0x1788d6[_0x274a('0x17')]));});});};
\ No newline at end of file
+var _0xf8a8=['UserVoiceQueueRt,\x20%s,\x20%s','request\x20sent','debug','UserVoiceQueueRt,\x20%s,\x20%s,\x20%s','error','code','message','result','UserVoiceQueueRt','options','raw','where','sequelize','literal','`paused`\x20=\x201,\x201,\x20null','outboundQueuePauses','GetVoiceQueueRtPauses','catch','lodash','moment','randomstring','ioredis','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','http','defaults','redis','localhost','socket.io-emitter','./userVoiceQueueRt.socket','register','request','then','info'];(function(_0x1b80da,_0x156fef){var _0x59c408=function(_0x273559){while(--_0x273559){_0x1b80da['push'](_0x1b80da['shift']());}};_0x59c408(++_0x156fef);}(_0xf8a8,0x115));var _0x8f8a=function(_0x4bfac3,_0x58324d){_0x4bfac3=_0x4bfac3-0x0;var _0x15f0f2=_0xf8a8[_0x4bfac3];return _0x15f0f2;};'use strict';var _=require(_0x8f8a('0x0'));var util=require('util');var moment=require(_0x8f8a('0x1'));var BPromise=require('bluebird');var rs=require(_0x8f8a('0x2'));var fs=require('fs');var Redis=require(_0x8f8a('0x3'));var db=require('../../mysqldb')['db'];var utils=require(_0x8f8a('0x4'));var logger=require(_0x8f8a('0x5'))(_0x8f8a('0x6'));var config=require(_0x8f8a('0x7'));var jayson=require(_0x8f8a('0x8'));var client=jayson['client'][_0x8f8a('0x9')]({'port':0x232a});config['redis']=_[_0x8f8a('0xa')](config[_0x8f8a('0xb')],{'host':_0x8f8a('0xc'),'port':0x18eb});var socket=require(_0x8f8a('0xd'))(new Redis(config[_0x8f8a('0xb')]));require(_0x8f8a('0xe'))[_0x8f8a('0xf')](socket);function respondWithRpcPromise(_0x5d7ab1,_0x1781af,_0xf97465){return new BPromise(function(_0x4a2bcb,_0x13748d){return client[_0x8f8a('0x10')](_0x5d7ab1,_0xf97465)[_0x8f8a('0x11')](function(_0x4415cd){logger[_0x8f8a('0x12')](_0x8f8a('0x13'),_0x1781af,_0x8f8a('0x14'));logger[_0x8f8a('0x15')](_0x8f8a('0x16'),_0x1781af,'request\x20sent',JSON['stringify'](_0x4415cd));if(_0x4415cd[_0x8f8a('0x17')]){if(_0x4415cd[_0x8f8a('0x17')][_0x8f8a('0x18')]===0x1f4){logger[_0x8f8a('0x17')](_0x8f8a('0x13'),_0x1781af,_0x4415cd[_0x8f8a('0x17')][_0x8f8a('0x19')]);return _0x13748d(_0x4415cd[_0x8f8a('0x17')]['message']);}logger[_0x8f8a('0x17')](_0x8f8a('0x13'),_0x1781af,_0x4415cd[_0x8f8a('0x17')]['message']);return _0x4a2bcb(_0x4415cd[_0x8f8a('0x17')][_0x8f8a('0x19')]);}else{logger[_0x8f8a('0x12')](_0x8f8a('0x13'),_0x1781af,_0x8f8a('0x14'));_0x4a2bcb(_0x4415cd[_0x8f8a('0x1a')][_0x8f8a('0x19')]);}})['catch'](function(_0x1747ba){logger[_0x8f8a('0x17')](_0x8f8a('0x13'),_0x1781af,_0x1747ba);_0x13748d(_0x1747ba);});});}exports['GetVoiceQueueRtPauses']=function(_0x1963cd){var _0x2668c3=this;return new Promise(function(_0x235eb5,_0x7750db){return db[_0x8f8a('0x1b')]['findAll']({'raw':_0x1963cd[_0x8f8a('0x1c')]?_0x1963cd[_0x8f8a('0x1c')][_0x8f8a('0x1d')]===undefined?!![]:![]:!![],'where':_0x1963cd[_0x8f8a('0x1c')]?_0x1963cd[_0x8f8a('0x1c')][_0x8f8a('0x1e')]||null:null,'attributes':[[db[_0x8f8a('0x1f')]['fn']('COUNT',db[_0x8f8a('0x1f')]['fn']('IF',db[_0x8f8a('0x1f')][_0x8f8a('0x20')](_0x8f8a('0x21')))),_0x8f8a('0x22')]]})[_0x8f8a('0x11')](function(_0x167402){logger[_0x8f8a('0x12')](_0x8f8a('0x23'),_0x1963cd);logger[_0x8f8a('0x15')]('GetVoiceQueueRtPauses',_0x1963cd,JSON['stringify'](_0x167402));_0x235eb5(_0x167402);})[_0x8f8a('0x24')](function(_0x10a2d5){logger[_0x8f8a('0x17')]('GetVoiceQueueRtPauses',_0x10a2d5[_0x8f8a('0x19')],_0x1963cd);_0x7750db(_0x2668c3[_0x8f8a('0x17')](0x1f4,_0x10a2d5['message']));});});};
\ No newline at end of file
diff --git a/server/api/userVoiceQueueRt/userVoiceQueueRt.socket.js b/server/api/userVoiceQueueRt/userVoiceQueueRt.socket.js
index ec11150..eaf3ce3 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 _0x914f=['emit','removeListener','./userVoiceQueueRt.events','save','remove','update'];(function(_0x33521,_0x5a6aeb){var _0x32403b=function(_0x159ebf){while(--_0x159ebf){_0x33521['push'](_0x33521['shift']());}};_0x32403b(++_0x5a6aeb);}(_0x914f,0x7a));var _0xf914=function(_0x21e06a,_0x2df1f1){_0x21e06a=_0x21e06a-0x0;var _0xd41c69=_0x914f[_0x21e06a];return _0xd41c69;};'use strict';var UserVoiceQueueRtEvents=require(_0xf914('0x0'));var events=[_0xf914('0x1'),_0xf914('0x2'),_0xf914('0x3')];function createListener(_0x4ddea1,_0x4b6513){return function(_0x55b9a7){_0x4b6513[_0xf914('0x4')](_0x4ddea1,_0x55b9a7);};}function removeListener(_0x30c569,_0x306e1e){return function(){UserVoiceQueueRtEvents[_0xf914('0x5')](_0x30c569,_0x306e1e);};}exports['register']=function(_0x1da4f0){for(var _0x595d62=0x0,_0x595da8=events['length'];_0x595d62<_0x595da8;_0x595d62++){var _0x185470=events[_0x595d62];var _0x4a18e3=createListener('userVoiceQueueRt:'+_0x185470,_0x1da4f0);UserVoiceQueueRtEvents['on'](_0x185470,_0x4a18e3);}};
\ No newline at end of file
+var _0x3458=['userVoiceQueueRt:','save','update','removeListener'];(function(_0x2c9de0,_0xe928bd){var _0x9ceb47=function(_0x4451e6){while(--_0x4451e6){_0x2c9de0['push'](_0x2c9de0['shift']());}};_0x9ceb47(++_0xe928bd);}(_0x3458,0x1a9));var _0x8345=function(_0x1561bd,_0x4c76ad){_0x1561bd=_0x1561bd-0x0;var _0x2df80d=_0x3458[_0x1561bd];return _0x2df80d;};'use strict';var UserVoiceQueueRtEvents=require('./userVoiceQueueRt.events');var events=[_0x8345('0x0'),'remove',_0x8345('0x1')];function createListener(_0x1743b1,_0x33f6b3){return function(_0x272353){_0x33f6b3['emit'](_0x1743b1,_0x272353);};}function removeListener(_0x15209c,_0x516a48){return function(){UserVoiceQueueRtEvents[_0x8345('0x2')](_0x15209c,_0x516a48);};}exports['register']=function(_0x3bffc2){for(var _0x1522ea=0x0,_0x5f0fc9=events['length'];_0x1522ea<_0x5f0fc9;_0x1522ea++){var _0xa98a6c=events[_0x1522ea];var _0xbb45df=createListener(_0x8345('0x3')+_0xa98a6c,_0x3bffc2);UserVoiceQueueRtEvents['on'](_0xa98a6c,_0xbb45df);}};
\ No newline at end of file
diff --git a/server/api/variable/index.js b/server/api/variable/index.js
index e256721..fb62b14 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 _0x7c85=['./variable.controller','get','isAuthenticated','index','/:id','post','create','put','update','destroy','exports','multer','util','path','connect-timeout','../../components/auth/service','../../components/interaction/service','../../config/environment'];(function(_0x368e09,_0x2c1517){var _0x14b7df=function(_0x5002af){while(--_0x5002af){_0x368e09['push'](_0x368e09['shift']());}};_0x14b7df(++_0x2c1517);}(_0x7c85,0x12b));var _0x57c8=function(_0x4da690,_0x12d136){_0x4da690=_0x4da690-0x0;var _0x263c53=_0x7c85[_0x4da690];return _0x263c53;};'use strict';var multer=require(_0x57c8('0x0'));var util=require(_0x57c8('0x1'));var path=require(_0x57c8('0x2'));var timeout=require(_0x57c8('0x3'));var express=require('express');var router=express['Router']();var auth=require(_0x57c8('0x4'));var interaction=require(_0x57c8('0x5'));var config=require(_0x57c8('0x6'));var controller=require(_0x57c8('0x7'));router[_0x57c8('0x8')]('/',auth[_0x57c8('0x9')](),controller[_0x57c8('0xa')]);router[_0x57c8('0x8')](_0x57c8('0xb'),auth['isAuthenticated'](),controller['show']);router[_0x57c8('0xc')]('/',auth[_0x57c8('0x9')](),controller[_0x57c8('0xd')]);router[_0x57c8('0xe')]('/:id',auth[_0x57c8('0x9')](),controller[_0x57c8('0xf')]);router['delete'](_0x57c8('0xb'),auth[_0x57c8('0x9')](),controller[_0x57c8('0x10')]);module[_0x57c8('0x11')]=router;
\ No newline at end of file
+var _0x42f7=['isAuthenticated','post','create','put','update','delete','multer','path','connect-timeout','express','Router','../../components/interaction/service','../../config/environment','./variable.controller','index','get','/:id'];(function(_0x5cbcbd,_0x3447ce){var _0xac7209=function(_0x55af33){while(--_0x55af33){_0x5cbcbd['push'](_0x5cbcbd['shift']());}};_0xac7209(++_0x3447ce);}(_0x42f7,0x19e));var _0x742f=function(_0xfae23b,_0x2be4ba){_0xfae23b=_0xfae23b-0x0;var _0x200640=_0x42f7[_0xfae23b];return _0x200640;};'use strict';var multer=require(_0x742f('0x0'));var util=require('util');var path=require(_0x742f('0x1'));var timeout=require(_0x742f('0x2'));var express=require(_0x742f('0x3'));var router=express[_0x742f('0x4')]();var auth=require('../../components/auth/service');var interaction=require(_0x742f('0x5'));var config=require(_0x742f('0x6'));var controller=require(_0x742f('0x7'));router['get']('/',auth['isAuthenticated'](),controller[_0x742f('0x8')]);router[_0x742f('0x9')](_0x742f('0xa'),auth[_0x742f('0xb')](),controller['show']);router[_0x742f('0xc')]('/',auth[_0x742f('0xb')](),controller[_0x742f('0xd')]);router[_0x742f('0xe')](_0x742f('0xa'),auth[_0x742f('0xb')](),controller[_0x742f('0xf')]);router[_0x742f('0x10')](_0x742f('0xa'),auth[_0x742f('0xb')](),controller['destroy']);module['exports']=router;
\ No newline at end of file
diff --git a/server/api/variable/variable.attributes.js b/server/api/variable/variable.attributes.js
index f1d49ce..bb3d8c5 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 _0x8f18=['exports','STRING','name','sequelize'];(function(_0xd2d9a8,_0x36915d){var _0x2b776a=function(_0x2bc071){while(--_0x2bc071){_0xd2d9a8['push'](_0xd2d9a8['shift']());}};_0x2b776a(++_0x36915d);}(_0x8f18,0x1f3));var _0x88f1=function(_0x58a970,_0x4d98af){_0x58a970=_0x58a970-0x0;var _0x100fd9=_0x8f18[_0x58a970];return _0x100fd9;};'use strict';var Sequelize=require(_0x88f1('0x0'));module[_0x88f1('0x1')]={'name':{'type':Sequelize[_0x88f1('0x2')],'unique':_0x88f1('0x3'),'allowNull':![],'validate':{'notEmpty':!![]}},'description':{'type':Sequelize[_0x88f1('0x2')]}};
\ No newline at end of file
+var _0x3ac7=['exports','STRING','name'];(function(_0xf5a67f,_0x14428c){var _0x1da154=function(_0x2748c0){while(--_0x2748c0){_0xf5a67f['push'](_0xf5a67f['shift']());}};_0x1da154(++_0x14428c);}(_0x3ac7,0xe4));var _0x73ac=function(_0x3ab51d,_0x2fa01d){_0x3ab51d=_0x3ab51d-0x0;var _0x29a04e=_0x3ac7[_0x3ab51d];return _0x29a04e;};'use strict';var Sequelize=require('sequelize');module[_0x73ac('0x0')]={'name':{'type':Sequelize[_0x73ac('0x1')],'unique':_0x73ac('0x2'),'allowNull':![],'validate':{'notEmpty':!![]}},'description':{'type':Sequelize[_0x73ac('0x1')]}};
\ No newline at end of file
diff --git a/server/api/variable/variable.controller.js b/server/api/variable/variable.controller.js
index 69a6f9d..764a538 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 _0xc3d6=['body','user','Unable\x20to\x20retrieve\x20the\x20current\x20user','role','UserProfileSection','userProfileId','UserProfileResource','html-pdf','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','moment','bluebird','mustache','util','sox','ejs','squel','crypto','jsforce','desk.js','to-csv','querystring','papaparse','ioredis','../../components/auth/service','../../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','get','error','name','send','index','map','Variable','rawAttributes','fieldName','type','key','model','keys','query','filters','intersection','fields','attributes','hasOwnProperty','nolimit','sort','where','pick','filter','merge','options','count','includeAll','findAll','catch','show','params','length','include','find','create'];(function(_0x178e48,_0x3c9509){var _0x440d7e=function(_0xc2f8a0){while(--_0xc2f8a0){_0x178e48['push'](_0x178e48['shift']());}};_0x440d7e(++_0x3c9509);}(_0xc3d6,0x153));var _0x6c3d=function(_0x51ff80,_0x36a011){_0x51ff80=_0x51ff80-0x0;var _0x231e5f=_0xc3d6[_0x51ff80];return _0x231e5f;};'use strict';var pdf=require(_0x6c3d('0x0'));var emlformat=require(_0x6c3d('0x1'));var rimraf=require(_0x6c3d('0x2'));var zipdir=require(_0x6c3d('0x3'));var jsonpatch=require(_0x6c3d('0x4'));var rp=require(_0x6c3d('0x5'));var moment=require(_0x6c3d('0x6'));var BPromise=require(_0x6c3d('0x7'));var Mustache=require(_0x6c3d('0x8'));var util=require(_0x6c3d('0x9'));var path=require('path');var sox=require(_0x6c3d('0xa'));var csv=require('to-csv');var ejs=require(_0x6c3d('0xb'));var fs=require('fs');var _=require('lodash');var squel=require(_0x6c3d('0xc'));var crypto=require(_0x6c3d('0xd'));var jsforce=require(_0x6c3d('0xe'));var deskjs=require(_0x6c3d('0xf'));var toCsv=require(_0x6c3d('0x10'));var querystring=require(_0x6c3d('0x11'));var Papa=require(_0x6c3d('0x12'));var Redis=require(_0x6c3d('0x13'));var authService=require(_0x6c3d('0x14'));var qs=require('../../components/parsers/qs');var as=require(_0x6c3d('0x15'));var hardwareService=require(_0x6c3d('0x16'));var logger=require('../../config/logger')(_0x6c3d('0x17'));var utils=require(_0x6c3d('0x18'));var config=require(_0x6c3d('0x19'));var db=require(_0x6c3d('0x1a'))['db'];function respondWithStatusCode(_0xa608b6,_0x2e1d50){_0x2e1d50=_0x2e1d50||0xcc;return function(_0x451326){if(_0x451326){return _0xa608b6[_0x6c3d('0x1b')](_0x2e1d50);}return _0xa608b6[_0x6c3d('0x1c')](_0x2e1d50)[_0x6c3d('0x1d')]();};}function respondWithResult(_0x57f277,_0x2b0ec3){_0x2b0ec3=_0x2b0ec3||0xc8;return function(_0x306341){if(_0x306341){return _0x57f277[_0x6c3d('0x1c')](_0x2b0ec3)[_0x6c3d('0x1e')](_0x306341);}};}function respondWithFilteredResult(_0x26e828,_0x3567e9){return function(_0x4454c8){if(_0x4454c8){var _0x141186=_0x4454c8['count'],_0xb3aa1b=_0x3567e9[_0x6c3d('0x1f')],_0x460484=_0x3567e9[_0x6c3d('0x1f')]+_0x3567e9[_0x6c3d('0x20')],_0x2b1f18;if(_0x460484>=_0x141186){_0x460484=_0x141186;_0x2b1f18=0xc8;}else{_0x2b1f18=0xce;}_0x26e828[_0x6c3d('0x1c')](_0x2b1f18);return _0x26e828['set'](_0x6c3d('0x21'),_0xb3aa1b+'-'+_0x460484+'/'+_0x141186)[_0x6c3d('0x1e')](_0x4454c8);}return null;};}function patchUpdates(_0x588a51){return function(_0x30094a){try{jsonpatch[_0x6c3d('0x22')](_0x30094a,_0x588a51,!![]);}catch(_0x330835){return BPromise[_0x6c3d('0x23')](_0x330835);}return _0x30094a[_0x6c3d('0x24')]();};}function saveUpdates(_0x36d51b,_0x5df765){return function(_0x17451b){if(_0x17451b){return _0x17451b[_0x6c3d('0x25')](_0x36d51b)[_0x6c3d('0x26')](function(_0x526a8e){return _0x526a8e;});}return null;};}function removeEntity(_0x5c3abf,_0x455ef9){return function(_0x357281){if(_0x357281){return _0x357281[_0x6c3d('0x27')]()[_0x6c3d('0x26')](function(){var _0x5af449=_0x357281[_0x6c3d('0x28')]({'plain':!![]});var _0xb1b565='Variables';return db['UserProfileResource'][_0x6c3d('0x27')]({'where':{'type':_0xb1b565,'resourceId':_0x5af449['id']}})['then'](function(){return _0x357281;});})['then'](function(){_0x5c3abf[_0x6c3d('0x1c')](0xcc)[_0x6c3d('0x1d')]();});}};}function handleEntityNotFound(_0x40b4c4,_0x7c8460){return function(_0x301ed9){if(!_0x301ed9){_0x40b4c4[_0x6c3d('0x1b')](0x194);}return _0x301ed9;};}function handleError(_0x9ae845,_0x1f4846){_0x1f4846=_0x1f4846||0x1f4;return function(_0x4e9eda){logger[_0x6c3d('0x29')](_0x4e9eda['stack']);if(_0x4e9eda[_0x6c3d('0x2a')]){delete _0x4e9eda[_0x6c3d('0x2a')];}_0x9ae845[_0x6c3d('0x1c')](_0x1f4846)[_0x6c3d('0x2b')](_0x4e9eda);};}exports[_0x6c3d('0x2c')]=function(_0x46885e,_0x3253df){var _0x5e1422={},_0x5953b4={},_0x8359b7={'count':0x0,'rows':[]};var _0x469c65=_[_0x6c3d('0x2d')](db[_0x6c3d('0x2e')][_0x6c3d('0x2f')],function(_0x1b3ddd){return{'name':_0x1b3ddd[_0x6c3d('0x30')],'type':_0x1b3ddd[_0x6c3d('0x31')][_0x6c3d('0x32')]};});_0x5953b4[_0x6c3d('0x33')]=_[_0x6c3d('0x2d')](_0x469c65,'name');_0x5953b4['query']=_[_0x6c3d('0x34')](_0x46885e[_0x6c3d('0x35')]);_0x5953b4[_0x6c3d('0x36')]=_['intersection'](_0x5953b4['model'],_0x5953b4['query']);_0x5e1422['attributes']=_[_0x6c3d('0x37')](_0x5953b4[_0x6c3d('0x33')],qs[_0x6c3d('0x38')](_0x46885e['query'][_0x6c3d('0x38')]));_0x5e1422[_0x6c3d('0x39')]=_0x5e1422[_0x6c3d('0x39')]['length']?_0x5e1422[_0x6c3d('0x39')]:_0x5953b4[_0x6c3d('0x33')];if(!_0x46885e[_0x6c3d('0x35')][_0x6c3d('0x3a')](_0x6c3d('0x3b'))){_0x5e1422['limit']=qs[_0x6c3d('0x20')](_0x46885e[_0x6c3d('0x35')][_0x6c3d('0x20')]);_0x5e1422['offset']=qs[_0x6c3d('0x1f')](_0x46885e[_0x6c3d('0x35')][_0x6c3d('0x1f')]);}_0x5e1422['order']=qs['sort'](_0x46885e[_0x6c3d('0x35')][_0x6c3d('0x3c')]);_0x5e1422[_0x6c3d('0x3d')]=qs[_0x6c3d('0x36')](_[_0x6c3d('0x3e')](_0x46885e[_0x6c3d('0x35')],_0x5953b4['filters']));if(_0x46885e['query'][_0x6c3d('0x3f')]){_0x5e1422[_0x6c3d('0x3d')]=_[_0x6c3d('0x40')](_0x5e1422[_0x6c3d('0x3d')],{'$or':_[_0x6c3d('0x2d')](_0x469c65,function(_0x312fb3){if(_0x312fb3['type']!=='VIRTUAL'){var _0x42decb={};_0x42decb[_0x312fb3[_0x6c3d('0x2a')]]={'$like':'%'+_0x46885e['query']['filter']+'%'};return _0x42decb;}})});}_0x5e1422=_['merge']({},_0x5e1422,_0x46885e[_0x6c3d('0x41')]);var _0x43e816={'where':_0x5e1422[_0x6c3d('0x3d')]};return db[_0x6c3d('0x2e')][_0x6c3d('0x42')](_0x43e816)['then'](function(_0x5d7b8a){_0x8359b7['count']=_0x5d7b8a;if(_0x46885e[_0x6c3d('0x35')][_0x6c3d('0x43')]){_0x5e1422['include']=[{'all':!![]}];}return db[_0x6c3d('0x2e')][_0x6c3d('0x44')](_0x5e1422);})[_0x6c3d('0x26')](function(_0x522bc7){_0x8359b7['rows']=_0x522bc7;return _0x8359b7;})['then'](respondWithFilteredResult(_0x3253df,_0x5e1422))[_0x6c3d('0x45')](handleError(_0x3253df,null));};exports[_0x6c3d('0x46')]=function(_0x328db2,_0x3016fd){var _0x5c04ea={'raw':!![],'where':{'id':_0x328db2[_0x6c3d('0x47')]['id']}},_0x51ec0c={};_0x51ec0c[_0x6c3d('0x33')]=_['keys'](db['Variable'][_0x6c3d('0x2f')]);_0x51ec0c['query']=_[_0x6c3d('0x34')](_0x328db2[_0x6c3d('0x35')]);_0x51ec0c[_0x6c3d('0x36')]=_[_0x6c3d('0x37')](_0x51ec0c[_0x6c3d('0x33')],_0x51ec0c[_0x6c3d('0x35')]);_0x5c04ea['attributes']=_['intersection'](_0x51ec0c['model'],qs[_0x6c3d('0x38')](_0x328db2[_0x6c3d('0x35')][_0x6c3d('0x38')]));_0x5c04ea['attributes']=_0x5c04ea['attributes'][_0x6c3d('0x48')]?_0x5c04ea['attributes']:_0x51ec0c[_0x6c3d('0x33')];if(_0x328db2[_0x6c3d('0x35')][_0x6c3d('0x43')]){_0x5c04ea[_0x6c3d('0x49')]=[{'all':!![]}];}_0x5c04ea=_[_0x6c3d('0x40')]({},_0x5c04ea,_0x328db2['options']);return db[_0x6c3d('0x2e')][_0x6c3d('0x4a')](_0x5c04ea)[_0x6c3d('0x26')](handleEntityNotFound(_0x3016fd,null))[_0x6c3d('0x26')](respondWithResult(_0x3016fd,null))['catch'](handleError(_0x3016fd,null));};exports[_0x6c3d('0x4b')]=function(_0x2377bb,_0x19bc88){return db[_0x6c3d('0x2e')][_0x6c3d('0x4b')](_0x2377bb[_0x6c3d('0x4c')],{})['then'](function(_0x399bcd){var _0x1ad558=_0x2377bb[_0x6c3d('0x4d')][_0x6c3d('0x28')]({'plain':!![]});if(!_0x1ad558)throw new Error(_0x6c3d('0x4e'));if(_0x1ad558[_0x6c3d('0x4f')]===_0x6c3d('0x4d')){var _0x42754c=_0x399bcd[_0x6c3d('0x28')]({'plain':!![]});var _0x4c4e55='Variables';return db[_0x6c3d('0x50')][_0x6c3d('0x4a')]({'where':{'name':_0x4c4e55,'userProfileId':_0x1ad558[_0x6c3d('0x51')]},'raw':!![]})[_0x6c3d('0x26')](function(_0x27968b){if(_0x27968b&&_0x27968b['autoAssociation']===0x0){return db[_0x6c3d('0x52')][_0x6c3d('0x4b')]({'name':_0x42754c[_0x6c3d('0x2a')],'resourceId':_0x42754c['id'],'type':_0x27968b[_0x6c3d('0x2a')],'sectionId':_0x27968b['id']},{})[_0x6c3d('0x26')](function(){return _0x399bcd;});}else{return _0x399bcd;}})[_0x6c3d('0x45')](function(_0x56e1a7){logger[_0x6c3d('0x29')]('Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s',_0x56e1a7);throw _0x56e1a7;});}return _0x399bcd;})[_0x6c3d('0x26')](respondWithResult(_0x19bc88,0xc9))[_0x6c3d('0x45')](handleError(_0x19bc88,null));};exports['update']=function(_0x49b3bd,_0x503dbe){if(_0x49b3bd[_0x6c3d('0x4c')]['id']){delete _0x49b3bd[_0x6c3d('0x4c')]['id'];}return db[_0x6c3d('0x2e')]['find']({'where':{'id':_0x49b3bd[_0x6c3d('0x47')]['id']}})[_0x6c3d('0x26')](handleEntityNotFound(_0x503dbe,null))[_0x6c3d('0x26')](saveUpdates(_0x49b3bd[_0x6c3d('0x4c')],null))[_0x6c3d('0x26')](respondWithResult(_0x503dbe,null))[_0x6c3d('0x45')](handleError(_0x503dbe,null));};exports[_0x6c3d('0x27')]=function(_0x4b71d3,_0x51e987){return db[_0x6c3d('0x2e')][_0x6c3d('0x4a')]({'where':{'id':_0x4b71d3[_0x6c3d('0x47')]['id']}})[_0x6c3d('0x26')](handleEntityNotFound(_0x51e987,null))[_0x6c3d('0x26')](removeEntity(_0x51e987,null))[_0x6c3d('0x45')](handleError(_0x51e987,null));};
\ No newline at end of file
+var _0x90c2=['apply','reject','save','update','destroy','then','get','Variables','UserProfileResource','stack','name','send','map','fieldName','type','query','filters','intersection','model','attributes','fields','length','nolimit','order','sort','where','filter','merge','VIRTUAL','options','Variable','count','includeAll','include','rows','show','params','keys','rawAttributes','find','catch','create','body','user','Unable\x20to\x20retrieve\x20the\x20current\x20user','role','UserProfileSection','userProfileId','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','mustache','util','path','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','sendStatus','status','end','json','offset','limit','set','Content-Range'];(function(_0x2bfcb2,_0xc59cdb){var _0xe4b8ca=function(_0x372ac7){while(--_0x372ac7){_0x2bfcb2['push'](_0x2bfcb2['shift']());}};_0xe4b8ca(++_0xc59cdb);}(_0x90c2,0x12e));var _0x290c=function(_0x5d878a,_0x133c99){_0x5d878a=_0x5d878a-0x0;var _0xefbbec=_0x90c2[_0x5d878a];return _0xefbbec;};'use strict';var pdf=require(_0x290c('0x0'));var emlformat=require(_0x290c('0x1'));var rimraf=require(_0x290c('0x2'));var zipdir=require(_0x290c('0x3'));var jsonpatch=require(_0x290c('0x4'));var rp=require(_0x290c('0x5'));var moment=require(_0x290c('0x6'));var BPromise=require('bluebird');var Mustache=require(_0x290c('0x7'));var util=require(_0x290c('0x8'));var path=require(_0x290c('0x9'));var sox=require('sox');var csv=require(_0x290c('0xa'));var ejs=require(_0x290c('0xb'));var fs=require('fs');var _=require('lodash');var squel=require(_0x290c('0xc'));var crypto=require(_0x290c('0xd'));var jsforce=require(_0x290c('0xe'));var deskjs=require(_0x290c('0xf'));var toCsv=require(_0x290c('0xa'));var querystring=require(_0x290c('0x10'));var Papa=require(_0x290c('0x11'));var Redis=require(_0x290c('0x12'));var authService=require(_0x290c('0x13'));var qs=require(_0x290c('0x14'));var as=require(_0x290c('0x15'));var hardwareService=require(_0x290c('0x16'));var logger=require(_0x290c('0x17'))('api');var utils=require(_0x290c('0x18'));var config=require(_0x290c('0x19'));var db=require('../../mysqldb')['db'];function respondWithStatusCode(_0x31dce8,_0x4ba4b3){_0x4ba4b3=_0x4ba4b3||0xcc;return function(_0x11f950){if(_0x11f950){return _0x31dce8[_0x290c('0x1a')](_0x4ba4b3);}return _0x31dce8[_0x290c('0x1b')](_0x4ba4b3)[_0x290c('0x1c')]();};}function respondWithResult(_0x24f172,_0x1a17e2){_0x1a17e2=_0x1a17e2||0xc8;return function(_0x4c7ca1){if(_0x4c7ca1){return _0x24f172[_0x290c('0x1b')](_0x1a17e2)[_0x290c('0x1d')](_0x4c7ca1);}};}function respondWithFilteredResult(_0xae0a09,_0x407602){return function(_0x392060){if(_0x392060){var _0x3ffb32=_0x392060['count'],_0xc318b1=_0x407602[_0x290c('0x1e')],_0xe718db=_0x407602['offset']+_0x407602[_0x290c('0x1f')],_0x379e4f;if(_0xe718db>=_0x3ffb32){_0xe718db=_0x3ffb32;_0x379e4f=0xc8;}else{_0x379e4f=0xce;}_0xae0a09[_0x290c('0x1b')](_0x379e4f);return _0xae0a09[_0x290c('0x20')](_0x290c('0x21'),_0xc318b1+'-'+_0xe718db+'/'+_0x3ffb32)[_0x290c('0x1d')](_0x392060);}return null;};}function patchUpdates(_0x296813){return function(_0x7ad0e0){try{jsonpatch[_0x290c('0x22')](_0x7ad0e0,_0x296813,!![]);}catch(_0x340f87){return BPromise[_0x290c('0x23')](_0x340f87);}return _0x7ad0e0[_0x290c('0x24')]();};}function saveUpdates(_0x46bfc2,_0x4cbd38){return function(_0x10453e){if(_0x10453e){return _0x10453e[_0x290c('0x25')](_0x46bfc2)['then'](function(_0x4e4077){return _0x4e4077;});}return null;};}function removeEntity(_0x595690,_0x531131){return function(_0x35c86c){if(_0x35c86c){return _0x35c86c[_0x290c('0x26')]()[_0x290c('0x27')](function(){var _0x38c704=_0x35c86c[_0x290c('0x28')]({'plain':!![]});var _0x5ce862=_0x290c('0x29');return db[_0x290c('0x2a')]['destroy']({'where':{'type':_0x5ce862,'resourceId':_0x38c704['id']}})[_0x290c('0x27')](function(){return _0x35c86c;});})[_0x290c('0x27')](function(){_0x595690[_0x290c('0x1b')](0xcc)[_0x290c('0x1c')]();});}};}function handleEntityNotFound(_0x5a1bb2,_0x747b9b){return function(_0x1abb87){if(!_0x1abb87){_0x5a1bb2[_0x290c('0x1a')](0x194);}return _0x1abb87;};}function handleError(_0x155157,_0xa41570){_0xa41570=_0xa41570||0x1f4;return function(_0xe44394){logger['error'](_0xe44394[_0x290c('0x2b')]);if(_0xe44394[_0x290c('0x2c')]){delete _0xe44394['name'];}_0x155157['status'](_0xa41570)[_0x290c('0x2d')](_0xe44394);};}exports['index']=function(_0x1d763f,_0x9b5892){var _0x79b89f={},_0x40bda2={},_0x542d69={'count':0x0,'rows':[]};var _0x321dd1=_[_0x290c('0x2e')](db['Variable']['rawAttributes'],function(_0x1d78a4){return{'name':_0x1d78a4[_0x290c('0x2f')],'type':_0x1d78a4[_0x290c('0x30')]['key']};});_0x40bda2['model']=_[_0x290c('0x2e')](_0x321dd1,_0x290c('0x2c'));_0x40bda2['query']=_['keys'](_0x1d763f[_0x290c('0x31')]);_0x40bda2[_0x290c('0x32')]=_[_0x290c('0x33')](_0x40bda2[_0x290c('0x34')],_0x40bda2[_0x290c('0x31')]);_0x79b89f[_0x290c('0x35')]=_[_0x290c('0x33')](_0x40bda2['model'],qs[_0x290c('0x36')](_0x1d763f[_0x290c('0x31')][_0x290c('0x36')]));_0x79b89f[_0x290c('0x35')]=_0x79b89f['attributes'][_0x290c('0x37')]?_0x79b89f[_0x290c('0x35')]:_0x40bda2[_0x290c('0x34')];if(!_0x1d763f['query']['hasOwnProperty'](_0x290c('0x38'))){_0x79b89f[_0x290c('0x1f')]=qs[_0x290c('0x1f')](_0x1d763f[_0x290c('0x31')][_0x290c('0x1f')]);_0x79b89f[_0x290c('0x1e')]=qs[_0x290c('0x1e')](_0x1d763f['query'][_0x290c('0x1e')]);}_0x79b89f[_0x290c('0x39')]=qs[_0x290c('0x3a')](_0x1d763f[_0x290c('0x31')][_0x290c('0x3a')]);_0x79b89f[_0x290c('0x3b')]=qs['filters'](_['pick'](_0x1d763f[_0x290c('0x31')],_0x40bda2[_0x290c('0x32')]));if(_0x1d763f[_0x290c('0x31')][_0x290c('0x3c')]){_0x79b89f['where']=_[_0x290c('0x3d')](_0x79b89f[_0x290c('0x3b')],{'$or':_['map'](_0x321dd1,function(_0x49e798){if(_0x49e798[_0x290c('0x30')]!==_0x290c('0x3e')){var _0x2f6220={};_0x2f6220[_0x49e798[_0x290c('0x2c')]]={'$like':'%'+_0x1d763f[_0x290c('0x31')][_0x290c('0x3c')]+'%'};return _0x2f6220;}})});}_0x79b89f=_[_0x290c('0x3d')]({},_0x79b89f,_0x1d763f[_0x290c('0x3f')]);var _0x78096={'where':_0x79b89f[_0x290c('0x3b')]};return db[_0x290c('0x40')][_0x290c('0x41')](_0x78096)['then'](function(_0x2f2c34){_0x542d69[_0x290c('0x41')]=_0x2f2c34;if(_0x1d763f['query'][_0x290c('0x42')]){_0x79b89f[_0x290c('0x43')]=[{'all':!![]}];}return db[_0x290c('0x40')]['findAll'](_0x79b89f);})[_0x290c('0x27')](function(_0x3cd792){_0x542d69[_0x290c('0x44')]=_0x3cd792;return _0x542d69;})[_0x290c('0x27')](respondWithFilteredResult(_0x9b5892,_0x79b89f))['catch'](handleError(_0x9b5892,null));};exports[_0x290c('0x45')]=function(_0x27724a,_0x4d4f11){var _0x2a0ec7={'raw':!![],'where':{'id':_0x27724a[_0x290c('0x46')]['id']}},_0x5d69f7={};_0x5d69f7[_0x290c('0x34')]=_[_0x290c('0x47')](db[_0x290c('0x40')][_0x290c('0x48')]);_0x5d69f7[_0x290c('0x31')]=_['keys'](_0x27724a[_0x290c('0x31')]);_0x5d69f7[_0x290c('0x32')]=_[_0x290c('0x33')](_0x5d69f7[_0x290c('0x34')],_0x5d69f7[_0x290c('0x31')]);_0x2a0ec7[_0x290c('0x35')]=_[_0x290c('0x33')](_0x5d69f7[_0x290c('0x34')],qs[_0x290c('0x36')](_0x27724a['query'][_0x290c('0x36')]));_0x2a0ec7[_0x290c('0x35')]=_0x2a0ec7[_0x290c('0x35')]['length']?_0x2a0ec7[_0x290c('0x35')]:_0x5d69f7['model'];if(_0x27724a['query']['includeAll']){_0x2a0ec7[_0x290c('0x43')]=[{'all':!![]}];}_0x2a0ec7=_[_0x290c('0x3d')]({},_0x2a0ec7,_0x27724a[_0x290c('0x3f')]);return db[_0x290c('0x40')][_0x290c('0x49')](_0x2a0ec7)[_0x290c('0x27')](handleEntityNotFound(_0x4d4f11,null))['then'](respondWithResult(_0x4d4f11,null))[_0x290c('0x4a')](handleError(_0x4d4f11,null));};exports[_0x290c('0x4b')]=function(_0x307d86,_0x12176f){return db[_0x290c('0x40')][_0x290c('0x4b')](_0x307d86[_0x290c('0x4c')],{})[_0x290c('0x27')](function(_0x3fb455){var _0x19c9a7=_0x307d86[_0x290c('0x4d')][_0x290c('0x28')]({'plain':!![]});if(!_0x19c9a7)throw new Error(_0x290c('0x4e'));if(_0x19c9a7[_0x290c('0x4f')]===_0x290c('0x4d')){var _0x5a3916=_0x3fb455['get']({'plain':!![]});var _0x585db1=_0x290c('0x29');return db[_0x290c('0x50')][_0x290c('0x49')]({'where':{'name':_0x585db1,'userProfileId':_0x19c9a7[_0x290c('0x51')]},'raw':!![]})[_0x290c('0x27')](function(_0x3eb24a){if(_0x3eb24a&&_0x3eb24a['autoAssociation']===0x0){return db['UserProfileResource'][_0x290c('0x4b')]({'name':_0x5a3916[_0x290c('0x2c')],'resourceId':_0x5a3916['id'],'type':_0x3eb24a['name'],'sectionId':_0x3eb24a['id']},{})[_0x290c('0x27')](function(){return _0x3fb455;});}else{return _0x3fb455;}})[_0x290c('0x4a')](function(_0x896077){logger[_0x290c('0x52')](_0x290c('0x53'),_0x896077);throw _0x896077;});}return _0x3fb455;})['then'](respondWithResult(_0x12176f,0xc9))[_0x290c('0x4a')](handleError(_0x12176f,null));};exports['update']=function(_0x58a040,_0x3e2b84){if(_0x58a040['body']['id']){delete _0x58a040[_0x290c('0x4c')]['id'];}return db['Variable']['find']({'where':{'id':_0x58a040[_0x290c('0x46')]['id']}})[_0x290c('0x27')](handleEntityNotFound(_0x3e2b84,null))[_0x290c('0x27')](saveUpdates(_0x58a040[_0x290c('0x4c')],null))['then'](respondWithResult(_0x3e2b84,null))[_0x290c('0x4a')](handleError(_0x3e2b84,null));};exports[_0x290c('0x26')]=function(_0x33fa96,_0x355c93){return db[_0x290c('0x40')][_0x290c('0x49')]({'where':{'id':_0x33fa96[_0x290c('0x46')]['id']}})[_0x290c('0x27')](handleEntityNotFound(_0x355c93,null))[_0x290c('0x27')](removeEntity(_0x355c93,null))[_0x290c('0x4a')](handleError(_0x355c93,null));};
\ No newline at end of file
diff --git a/server/api/variable/variable.model.js b/server/api/variable/variable.model.js
index c202904..a352462 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 _0x2bbb=['tools_variables','util','../../config/logger','api','bluebird','request-promise','path','rimraf','../../config/environment','./variable.attributes','Variable'];(function(_0xfff577,_0x36b4c5){var _0x28b947=function(_0x1d7a85){while(--_0x1d7a85){_0xfff577['push'](_0xfff577['shift']());}};_0x28b947(++_0x36b4c5);}(_0x2bbb,0x85));var _0xb2bb=function(_0x12fd29,_0x5ea2d7){_0x12fd29=_0x12fd29-0x0;var _0x5b4788=_0x2bbb[_0x12fd29];return _0x5b4788;};'use strict';var _=require('lodash');var util=require(_0xb2bb('0x0'));var logger=require(_0xb2bb('0x1'))(_0xb2bb('0x2'));var moment=require('moment');var BPromise=require(_0xb2bb('0x3'));var rp=require(_0xb2bb('0x4'));var fs=require('fs');var path=require(_0xb2bb('0x5'));var rimraf=require(_0xb2bb('0x6'));var config=require(_0xb2bb('0x7'));var attributes=require(_0xb2bb('0x8'));module['exports']=function(_0x3581e2,_0x5bee47){return _0x3581e2['define'](_0xb2bb('0x9'),attributes,{'tableName':_0xb2bb('0xa'),'paranoid':![],'indexes':[],'timestamps':!![]});};
\ No newline at end of file
+var _0x10dc=['lodash','util','../../config/logger','api','rimraf','../../config/environment','./variable.attributes','exports','define','Variable','tools_variables'];(function(_0x5e991d,_0x47f3d6){var _0x4c5b56=function(_0x12be46){while(--_0x12be46){_0x5e991d['push'](_0x5e991d['shift']());}};_0x4c5b56(++_0x47f3d6);}(_0x10dc,0x13f));var _0xc10d=function(_0x582ccd,_0xa9ab43){_0x582ccd=_0x582ccd-0x0;var _0x11545d=_0x10dc[_0x582ccd];return _0x11545d;};'use strict';var _=require(_0xc10d('0x0'));var util=require(_0xc10d('0x1'));var logger=require(_0xc10d('0x2'))(_0xc10d('0x3'));var moment=require('moment');var BPromise=require('bluebird');var rp=require('request-promise');var fs=require('fs');var path=require('path');var rimraf=require(_0xc10d('0x4'));var config=require(_0xc10d('0x5'));var attributes=require(_0xc10d('0x6'));module[_0xc10d('0x7')]=function(_0x59f835,_0x313755){return _0x59f835[_0xc10d('0x8')](_0xc10d('0x9'),attributes,{'tableName':_0xc10d('0xa'),'paranoid':![],'indexes':[],'timestamps':!![]});};
\ No newline at end of file
diff --git a/server/api/variable/variable.rpc.js b/server/api/variable/variable.rpc.js
index edb5587..abd4728 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 _0xf01c=['Variable','find','options','raw','include','map','model','attributes','debug','lodash','util','moment','ioredis','../../mysqldb','rpc','jayson/promise','client','http','request','then','Variable,\x20%s,\x20%s','request\x20sent','Variable,\x20%s,\x20%s,\x20%s','stringify','error','code','message','info','catch','ShowVariable'];(function(_0xc31458,_0x45ee76){var _0x1b4a90=function(_0x1a49b0){while(--_0x1a49b0){_0xc31458['push'](_0xc31458['shift']());}};_0x1b4a90(++_0x45ee76);}(_0xf01c,0xf9));var _0xcf01=function(_0x399dc9,_0x7d695){_0x399dc9=_0x399dc9-0x0;var _0x20e94b=_0xf01c[_0x399dc9];return _0x20e94b;};'use strict';var _=require(_0xcf01('0x0'));var util=require(_0xcf01('0x1'));var moment=require(_0xcf01('0x2'));var BPromise=require('bluebird');var rs=require('randomstring');var fs=require('fs');var Redis=require(_0xcf01('0x3'));var db=require(_0xcf01('0x4'))['db'];var utils=require('../../config/utils');var logger=require('../../config/logger')(_0xcf01('0x5'));var config=require('../../config/environment');var jayson=require(_0xcf01('0x6'));var client=jayson[_0xcf01('0x7')][_0xcf01('0x8')]({'port':0x232a});function respondWithRpcPromise(_0x1940b7,_0x4dba14,_0x4543a3){return new BPromise(function(_0x5a2aaf,_0x1595cb){return client[_0xcf01('0x9')](_0x1940b7,_0x4543a3)[_0xcf01('0xa')](function(_0x2d0f25){logger['info'](_0xcf01('0xb'),_0x4dba14,_0xcf01('0xc'));logger['debug'](_0xcf01('0xd'),_0x4dba14,_0xcf01('0xc'),JSON[_0xcf01('0xe')](_0x2d0f25));if(_0x2d0f25['error']){if(_0x2d0f25[_0xcf01('0xf')][_0xcf01('0x10')]===0x1f4){logger['error'](_0xcf01('0xb'),_0x4dba14,_0x2d0f25[_0xcf01('0xf')][_0xcf01('0x11')]);return _0x1595cb(_0x2d0f25['error']['message']);}logger[_0xcf01('0xf')](_0xcf01('0xb'),_0x4dba14,_0x2d0f25[_0xcf01('0xf')][_0xcf01('0x11')]);return _0x5a2aaf(_0x2d0f25[_0xcf01('0xf')]['message']);}else{logger[_0xcf01('0x12')](_0xcf01('0xb'),_0x4dba14,'request\x20sent');_0x5a2aaf(_0x2d0f25['result'][_0xcf01('0x11')]);}})[_0xcf01('0x13')](function(_0x585cec){logger[_0xcf01('0xf')](_0xcf01('0xb'),_0x4dba14,_0x585cec);_0x1595cb(_0x585cec);});});}exports[_0xcf01('0x14')]=function(_0x54f109){var _0x5f0b3d=this;return new Promise(function(_0x38e6a1,_0x36d714){return db[_0xcf01('0x15')][_0xcf01('0x16')]({'raw':_0x54f109[_0xcf01('0x17')]?_0x54f109[_0xcf01('0x17')][_0xcf01('0x18')]===undefined?!![]:![]:!![],'where':_0x54f109[_0xcf01('0x17')]?_0x54f109[_0xcf01('0x17')]['where']||null:null,'attributes':_0x54f109['options']?_0x54f109[_0xcf01('0x17')]['attributes']||null:null,'include':_0x54f109[_0xcf01('0x17')]?_0x54f109[_0xcf01('0x17')][_0xcf01('0x19')]?_[_0xcf01('0x1a')](_0x54f109[_0xcf01('0x17')]['include'],function(_0x5026dd){return{'model':db[_0x5026dd[_0xcf01('0x1b')]],'as':_0x5026dd['as'],'attributes':_0x5026dd[_0xcf01('0x1c')],'include':_0x5026dd[_0xcf01('0x19')]?_['map'](_0x5026dd['include'],function(_0x2aceab){return{'model':db[_0x2aceab[_0xcf01('0x1b')]],'as':_0x2aceab['as'],'attributes':_0x2aceab['attributes'],'include':_0x2aceab[_0xcf01('0x19')]?_[_0xcf01('0x1a')](_0x2aceab[_0xcf01('0x19')],function(_0x1762d0){return{'model':db[_0x1762d0['model']],'as':_0x1762d0['as'],'attributes':_0x1762d0[_0xcf01('0x1c')]};}):[]};}):[]};}):[]:[]})[_0xcf01('0xa')](function(_0x4c075e){logger['info'](_0xcf01('0x14'),_0x54f109);logger[_0xcf01('0x1d')](_0xcf01('0x14'),_0x54f109,JSON[_0xcf01('0xe')](_0x4c075e));_0x38e6a1(_0x4c075e);})[_0xcf01('0x13')](function(_0x5000c6){logger[_0xcf01('0xf')]('ShowVariable',_0x5000c6[_0xcf01('0x11')],_0x54f109);_0x36d714(_0x5f0b3d[_0xcf01('0xf')](0x1f4,_0x5000c6[_0xcf01('0x11')]));});});};
\ No newline at end of file
+var _0xfab9=['where','map','include','model','attributes','debug','ShowVariable','stringify','lodash','util','randomstring','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','client','http','request','then','info','Variable,\x20%s,\x20%s,\x20%s','error','Variable,\x20%s,\x20%s','message','request\x20sent','result','Variable','find','options','raw'];(function(_0x50d12d,_0x50d101){var _0x3db94f=function(_0x12744b){while(--_0x12744b){_0x50d12d['push'](_0x50d12d['shift']());}};_0x3db94f(++_0x50d101);}(_0xfab9,0xc8));var _0x9fab=function(_0x321bb2,_0x202794){_0x321bb2=_0x321bb2-0x0;var _0x9c12ed=_0xfab9[_0x321bb2];return _0x9c12ed;};'use strict';var _=require(_0x9fab('0x0'));var util=require(_0x9fab('0x1'));var moment=require('moment');var BPromise=require('bluebird');var rs=require(_0x9fab('0x2'));var fs=require('fs');var Redis=require('ioredis');var db=require(_0x9fab('0x3'))['db'];var utils=require(_0x9fab('0x4'));var logger=require(_0x9fab('0x5'))(_0x9fab('0x6'));var config=require(_0x9fab('0x7'));var jayson=require(_0x9fab('0x8'));var client=jayson[_0x9fab('0x9')][_0x9fab('0xa')]({'port':0x232a});function respondWithRpcPromise(_0x1e57ba,_0x33b993,_0x290476){return new BPromise(function(_0x57c861,_0x128cba){return client[_0x9fab('0xb')](_0x1e57ba,_0x290476)[_0x9fab('0xc')](function(_0x34031f){logger[_0x9fab('0xd')]('Variable,\x20%s,\x20%s',_0x33b993,'request\x20sent');logger['debug'](_0x9fab('0xe'),_0x33b993,'request\x20sent',JSON['stringify'](_0x34031f));if(_0x34031f[_0x9fab('0xf')]){if(_0x34031f[_0x9fab('0xf')]['code']===0x1f4){logger[_0x9fab('0xf')](_0x9fab('0x10'),_0x33b993,_0x34031f[_0x9fab('0xf')][_0x9fab('0x11')]);return _0x128cba(_0x34031f[_0x9fab('0xf')][_0x9fab('0x11')]);}logger[_0x9fab('0xf')](_0x9fab('0x10'),_0x33b993,_0x34031f[_0x9fab('0xf')]['message']);return _0x57c861(_0x34031f['error']['message']);}else{logger[_0x9fab('0xd')]('Variable,\x20%s,\x20%s',_0x33b993,_0x9fab('0x12'));_0x57c861(_0x34031f[_0x9fab('0x13')][_0x9fab('0x11')]);}})['catch'](function(_0x3682a4){logger[_0x9fab('0xf')](_0x9fab('0x10'),_0x33b993,_0x3682a4);_0x128cba(_0x3682a4);});});}exports['ShowVariable']=function(_0x111de8){var _0x359d01=this;return new Promise(function(_0x22ade0,_0x2c132b){return db[_0x9fab('0x14')][_0x9fab('0x15')]({'raw':_0x111de8['options']?_0x111de8[_0x9fab('0x16')][_0x9fab('0x17')]===undefined?!![]:![]:!![],'where':_0x111de8[_0x9fab('0x16')]?_0x111de8[_0x9fab('0x16')][_0x9fab('0x18')]||null:null,'attributes':_0x111de8[_0x9fab('0x16')]?_0x111de8['options']['attributes']||null:null,'include':_0x111de8[_0x9fab('0x16')]?_0x111de8[_0x9fab('0x16')]['include']?_[_0x9fab('0x19')](_0x111de8[_0x9fab('0x16')][_0x9fab('0x1a')],function(_0x402dda){return{'model':db[_0x402dda[_0x9fab('0x1b')]],'as':_0x402dda['as'],'attributes':_0x402dda['attributes'],'include':_0x402dda[_0x9fab('0x1a')]?_['map'](_0x402dda['include'],function(_0x19dd6d){return{'model':db[_0x19dd6d[_0x9fab('0x1b')]],'as':_0x19dd6d['as'],'attributes':_0x19dd6d['attributes'],'include':_0x19dd6d['include']?_['map'](_0x19dd6d[_0x9fab('0x1a')],function(_0x5db946){return{'model':db[_0x5db946[_0x9fab('0x1b')]],'as':_0x5db946['as'],'attributes':_0x5db946[_0x9fab('0x1c')]};}):[]};}):[]};}):[]:[]})[_0x9fab('0xc')](function(_0x40e938){logger[_0x9fab('0xd')]('ShowVariable',_0x111de8);logger[_0x9fab('0x1d')](_0x9fab('0x1e'),_0x111de8,JSON[_0x9fab('0x1f')](_0x40e938));_0x22ade0(_0x40e938);})['catch'](function(_0x25a5a2){logger[_0x9fab('0xf')](_0x9fab('0x1e'),_0x25a5a2['message'],_0x111de8);_0x2c132b(_0x359d01[_0x9fab('0xf')](0x1f4,_0x25a5a2[_0x9fab('0x11')]));});});};
\ No newline at end of file
diff --git a/server/api/version/index.js b/server/api/version/index.js
index 21ad902..1fdb042 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 _0x44f1=['fetch','/reset','isAuthenticated','reset','/pull','/restart','restart','migrations','exports','express','Router','../../components/auth/service','./version.controller','get','index','canUpdate'];(function(_0x27e9b3,_0x1b17af){var _0x553cac=function(_0x5c368e){while(--_0x5c368e){_0x27e9b3['push'](_0x27e9b3['shift']());}};_0x553cac(++_0x1b17af);}(_0x44f1,0x169));var _0x144f=function(_0x47a7d0,_0x4e182d){_0x47a7d0=_0x47a7d0-0x0;var _0xb9bd08=_0x44f1[_0x47a7d0];return _0xb9bd08;};'use strict';var express=require(_0x144f('0x0'));var router=express[_0x144f('0x1')]();var auth=require(_0x144f('0x2'));var controller=require(_0x144f('0x3'));router[_0x144f('0x4')]('/',controller[_0x144f('0x5')]);router[_0x144f('0x4')]('/fetch',auth['isAuthenticated'](),auth[_0x144f('0x6')](),controller[_0x144f('0x7')]);router['get'](_0x144f('0x8'),auth[_0x144f('0x9')](),auth[_0x144f('0x6')](),controller[_0x144f('0xa')]);router[_0x144f('0x4')](_0x144f('0xb'),auth[_0x144f('0x9')](),auth[_0x144f('0x6')](),controller['pull']);router[_0x144f('0x4')](_0x144f('0xc'),auth['isAuthenticated'](),controller[_0x144f('0xd')]);router[_0x144f('0x4')]('/migrations',controller[_0x144f('0xe')]);module[_0x144f('0xf')]=router;
\ No newline at end of file
+var _0x08fd=['exports','express','Router','../../components/auth/service','./version.controller','index','isAuthenticated','canUpdate','fetch','get','/reset','reset','pull','/restart','/migrations'];(function(_0x544ad9,_0x8c5af8){var _0x54165b=function(_0x266756){while(--_0x266756){_0x544ad9['push'](_0x544ad9['shift']());}};_0x54165b(++_0x8c5af8);}(_0x08fd,0xa6));var _0xd08f=function(_0x55887f,_0x130da1){_0x55887f=_0x55887f-0x0;var _0x4b2ba7=_0x08fd[_0x55887f];return _0x4b2ba7;};'use strict';var express=require(_0xd08f('0x0'));var router=express[_0xd08f('0x1')]();var auth=require(_0xd08f('0x2'));var controller=require(_0xd08f('0x3'));router['get']('/',controller[_0xd08f('0x4')]);router['get']('/fetch',auth[_0xd08f('0x5')](),auth[_0xd08f('0x6')](),controller[_0xd08f('0x7')]);router[_0xd08f('0x8')](_0xd08f('0x9'),auth[_0xd08f('0x5')](),auth['canUpdate'](),controller[_0xd08f('0xa')]);router[_0xd08f('0x8')]('/pull',auth['isAuthenticated'](),auth[_0xd08f('0x6')](),controller[_0xd08f('0xb')]);router[_0xd08f('0x8')](_0xd08f('0xc'),auth[_0xd08f('0x5')](),controller['restart']);router['get'](_0xd08f('0xd'),controller['migrations']);module[_0xd08f('0xe')]=router;
\ No newline at end of file
diff --git a/server/api/version/version.controller.js b/server/api/version/version.controller.js
index ca6c2b0..195f35d 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 _0xe978=['lodash','compare-versions','child_process','exec','../../mysqldb','../../config/environment','../../config/logger','update','simple-git','root','index','exports','version','query','latest','fetch','tags','2.0.0','status','json','info','git\x20fetch','git\x20fetch\x20origin\x20master','reset','--hard','FETCH_HEAD','error','git\x20reset\x20--hard\x20FETCH_HEAD','git\x20reset\x20--hard','pull','npm\x20install\x20--production','restart','motion2','then','pm2\x20restart\x20motion\x20%s','Your\x20system\x20has\x20been\x20restart\x20successfully','catch','migrations','readdirSync','join','length','replace','.js','push','sort','sequelize','Migration','getQueryInterface','constructor','Migration\x20tried\x20to\x20use\x20old\x20style\x20\x22done\x22\x20callback.\x20Please\x20upgrade\x20to\x20\x22umzug\x22\x20and\x20return\x20a\x20promise\x20instead.','server','Database\x20migrated\x20successfully\x20from\x20version\x20','\x20to\x20','last','UniqueConstraintError','umzug','path'];(function(_0x146cd0,_0x18741b){var _0x4a4eac=function(_0x4eff00){while(--_0x4eff00){_0x146cd0['push'](_0x146cd0['shift']());}};_0x4a4eac(++_0x18741b);}(_0xe978,0x70));var _0x8e97=function(_0x4a4953,_0x1897b2){_0x4a4953=_0x4a4953-0x0;var _0xde4eba=_0xe978[_0x4a4953];return _0xde4eba;};'use strict';var Umzug=require(_0x8e97('0x0'));var path=require(_0x8e97('0x1'));var fs=require('fs');var _=require(_0x8e97('0x2'));var pkginfo=require('pkginfo')(module,'version');var compareVersions=require(_0x8e97('0x3'));var exec=require(_0x8e97('0x4'))[_0x8e97('0x5')];var db=require(_0x8e97('0x6'))['db'];var config=require(_0x8e97('0x7'));var pm2=require('../../config/pm2');var logger=require(_0x8e97('0x8'))(_0x8e97('0x9'));var git=require(_0x8e97('0xa'))(config[_0x8e97('0xb')]);exports[_0x8e97('0xc')]=function(_0x539b76,_0x641dc2){var _0x5d727e={'current':module[_0x8e97('0xd')][_0x8e97('0xe')],'phonebar':0x2};if(_0x539b76[_0x8e97('0xf')]&&_0x539b76['query'][_0x8e97('0x10')]){return git[_0x8e97('0x11')]()[_0x8e97('0x12')](function(_0x37b212,_0x1e84d1){_0x5d727e[_0x8e97('0x10')]=(_0x37b212?module[_0x8e97('0xd')][_0x8e97('0xe')]:_0x1e84d1[_0x8e97('0x10')])||_0x8e97('0x13');return _0x641dc2[_0x8e97('0x14')](0xc8)['json'](_0x5d727e);});}else{return _0x641dc2[_0x8e97('0x14')](0xc8)[_0x8e97('0x15')](_0x5d727e);}};exports[_0x8e97('0x11')]=function(_0x2b1680,_0x4df8d3){return git['fetch'](['origin','master'],function(_0x5d78c5){if(_0x5d78c5){logger['error'](_0x5d78c5);return _0x4df8d3[_0x8e97('0x14')](0x1f4)['json'](_0x5d78c5);}logger[_0x8e97('0x16')](_0x8e97('0x17'));return _0x4df8d3['status'](0xc8)['json']({'output':_0x8e97('0x18')});});};exports[_0x8e97('0x19')]=function(_0xb779ed,_0x2f475c){return git[_0x8e97('0x19')]([_0x8e97('0x1a'),_0x8e97('0x1b')],function(_0x2a0800){if(_0x2a0800){logger[_0x8e97('0x1c')](_0x2a0800);return _0x2f475c['status'](0x1f4)[_0x8e97('0x15')](_0x2a0800);}logger[_0x8e97('0x16')](_0x8e97('0x1d'));return _0x2f475c[_0x8e97('0x14')](0xc8)[_0x8e97('0x15')]({'output':_0x8e97('0x1e')});});};exports[_0x8e97('0x1f')]=function(_0x5a5c99,_0xe8f225){exec(_0x8e97('0x20'),function(_0x2b1b01,_0x305686,_0x387748){logger[_0x8e97('0x16')](_0x305686);logger[_0x8e97('0x16')](_0x387748);if(_0x2b1b01){logger[_0x8e97('0x1c')](_0x2b1b01);return _0xe8f225[_0x8e97('0x14')](0x1f4)[_0x8e97('0x15')](_0x2b1b01);}return _0xe8f225['status'](0xc8)['json']({'output':_0x305686});});};exports['restart']=function(_0x3d8440,_0x238938){return pm2[_0x8e97('0x21')](_0x8e97('0x22'))[_0x8e97('0x23')](function(_0x10f327){logger[_0x8e97('0x16')](_0x8e97('0x24'),_0x10f327);return _0x238938['status'](0xc8)[_0x8e97('0x15')]({'output':_0x8e97('0x25')});})[_0x8e97('0x26')](function(_0x5bb338){logger[_0x8e97('0x1c')](_0x5bb338);return _0x238938['status'](0x1f4)[_0x8e97('0x15')](_0x5bb338);});};exports[_0x8e97('0x27')]=function(_0xa5b3de,_0x2f7919){var _0xb1ce05=fs[_0x8e97('0x28')](path[_0x8e97('0x29')](config['root'],'server',_0x8e97('0x27')));var _0x364296=[];for(var _0x19d800=0x0;_0x19d800<_0xb1ce05[_0x8e97('0x2a')];_0x19d800++){var _0x5818b0=_0xb1ce05[_0x19d800][_0x8e97('0x2b')](_0x8e97('0x2c'),'');if(compareVersions(module[_0x8e97('0xd')][_0x8e97('0xe')],_0x5818b0)===-0x1){_0x364296[_0x8e97('0x2d')](_0x5818b0);}}if(_0x364296['length']){var _0x1a79de=_0x364296[_0x8e97('0x2e')](compareVersions);var _0x3c0e12=new Umzug({'storage':_0x8e97('0x2f'),'storageOptions':{'model':db[_0x8e97('0x30')],'modelName':'Migration','columnName':_0x8e97('0xe')},'migrations':{'params':[db['sequelize'][_0x8e97('0x31')](),db[_0x8e97('0x2f')][_0x8e97('0x32')],function(){throw new Error(_0x8e97('0x33'));}],'path':path[_0x8e97('0x29')](config['root'],_0x8e97('0x34'),_0x8e97('0x27')),'pattern':/\.js$/}});_0x3c0e12['up']({'migrations':_['map'](_0x1a79de,function(_0x5349ed){return _0x5349ed+_0x8e97('0x2c');})})[_0x8e97('0x23')](function(){return _0x2f7919[_0x8e97('0x14')](0xc8)['json']({'output':_0x8e97('0x35')+module[_0x8e97('0xd')][_0x8e97('0xe')]+_0x8e97('0x36')+_[_0x8e97('0x37')](_0x1a79de),'migrations':_['join'](_0x1a79de)});})[_0x8e97('0x26')](function(_0x5302ee){if(_0x5302ee instanceof db[_0x8e97('0x2f')][_0x8e97('0x38')]){return _0x2f7919[_0x8e97('0x14')](0xc8)['json']({'output':'Database\x20already\x20up-to-date'});}else{return _0x2f7919[_0x8e97('0x14')](0x1f4)[_0x8e97('0x15')](_0x5302ee);}});}else{return _0x2f7919[_0x8e97('0x14')](0xc8)['json']({'output':'Database\x20already\x20up-to-date'});}};
\ No newline at end of file
+var _0xa30a=['Migration\x20tried\x20to\x20use\x20old\x20style\x20\x22done\x22\x20callback.\x20Please\x20upgrade\x20to\x20\x22umzug\x22\x20and\x20return\x20a\x20promise\x20instead.','map','Database\x20migrated\x20successfully\x20from\x20version\x20','\x20to\x20','last','UniqueConstraintError','Database\x20already\x20up-to-date','umzug','path','lodash','version','compare-versions','child_process','exec','../../mysqldb','../../config/environment','../../config/pm2','update','root','index','exports','query','latest','status','json','fetch','origin','master','error','git\x20fetch','git\x20fetch\x20origin\x20master','reset','FETCH_HEAD','git\x20reset\x20--hard','pull','npm\x20install\x20--production','info','restart','motion2','then','pm2\x20restart\x20motion\x20%s','catch','migrations','readdirSync','join','server','length','.js','push','Migration','sequelize','getQueryInterface'];(function(_0xb0f7c3,_0x4eae95){var _0x28ea68=function(_0x4395a7){while(--_0x4395a7){_0xb0f7c3['push'](_0xb0f7c3['shift']());}};_0x28ea68(++_0x4eae95);}(_0xa30a,0xd7));var _0xaa30=function(_0x14add3,_0x13ce8d){_0x14add3=_0x14add3-0x0;var _0x4a174f=_0xa30a[_0x14add3];return _0x4a174f;};'use strict';var Umzug=require(_0xaa30('0x0'));var path=require(_0xaa30('0x1'));var fs=require('fs');var _=require(_0xaa30('0x2'));var pkginfo=require('pkginfo')(module,_0xaa30('0x3'));var compareVersions=require(_0xaa30('0x4'));var exec=require(_0xaa30('0x5'))[_0xaa30('0x6')];var db=require(_0xaa30('0x7'))['db'];var config=require(_0xaa30('0x8'));var pm2=require(_0xaa30('0x9'));var logger=require('../../config/logger')(_0xaa30('0xa'));var git=require('simple-git')(config[_0xaa30('0xb')]);exports[_0xaa30('0xc')]=function(_0x42dc22,_0x5d076a){var _0xedbc45={'current':module[_0xaa30('0xd')][_0xaa30('0x3')],'phonebar':0x2};if(_0x42dc22[_0xaa30('0xe')]&&_0x42dc22[_0xaa30('0xe')][_0xaa30('0xf')]){return git['fetch']()['tags'](function(_0x12a8ce,_0x4874fe){_0xedbc45[_0xaa30('0xf')]=(_0x12a8ce?module[_0xaa30('0xd')][_0xaa30('0x3')]:_0x4874fe[_0xaa30('0xf')])||'2.0.0';return _0x5d076a[_0xaa30('0x10')](0xc8)[_0xaa30('0x11')](_0xedbc45);});}else{return _0x5d076a[_0xaa30('0x10')](0xc8)['json'](_0xedbc45);}};exports[_0xaa30('0x12')]=function(_0xdea23a,_0x25c02e){return git[_0xaa30('0x12')]([_0xaa30('0x13'),_0xaa30('0x14')],function(_0x3240e9){if(_0x3240e9){logger[_0xaa30('0x15')](_0x3240e9);return _0x25c02e[_0xaa30('0x10')](0x1f4)[_0xaa30('0x11')](_0x3240e9);}logger['info'](_0xaa30('0x16'));return _0x25c02e['status'](0xc8)['json']({'output':_0xaa30('0x17')});});};exports[_0xaa30('0x18')]=function(_0x130606,_0x540e36){return git['reset'](['--hard',_0xaa30('0x19')],function(_0x4acdfa){if(_0x4acdfa){logger[_0xaa30('0x15')](_0x4acdfa);return _0x540e36[_0xaa30('0x10')](0x1f4)['json'](_0x4acdfa);}logger['info']('git\x20reset\x20--hard\x20FETCH_HEAD');return _0x540e36[_0xaa30('0x10')](0xc8)[_0xaa30('0x11')]({'output':_0xaa30('0x1a')});});};exports[_0xaa30('0x1b')]=function(_0x43a526,_0x4aacfd){exec(_0xaa30('0x1c'),function(_0x24bb25,_0x2e16e7,_0x2d9e35){logger[_0xaa30('0x1d')](_0x2e16e7);logger['info'](_0x2d9e35);if(_0x24bb25){logger[_0xaa30('0x15')](_0x24bb25);return _0x4aacfd[_0xaa30('0x10')](0x1f4)[_0xaa30('0x11')](_0x24bb25);}return _0x4aacfd[_0xaa30('0x10')](0xc8)['json']({'output':_0x2e16e7});});};exports[_0xaa30('0x1e')]=function(_0x1be54c,_0x19ba52){return pm2[_0xaa30('0x1e')](_0xaa30('0x1f'))[_0xaa30('0x20')](function(_0x55cccb){logger[_0xaa30('0x1d')](_0xaa30('0x21'),_0x55cccb);return _0x19ba52['status'](0xc8)[_0xaa30('0x11')]({'output':'Your\x20system\x20has\x20been\x20restart\x20successfully'});})[_0xaa30('0x22')](function(_0x33a0c9){logger[_0xaa30('0x15')](_0x33a0c9);return _0x19ba52[_0xaa30('0x10')](0x1f4)[_0xaa30('0x11')](_0x33a0c9);});};exports[_0xaa30('0x23')]=function(_0x6ff09a,_0x39f708){var _0x1f288c=fs[_0xaa30('0x24')](path[_0xaa30('0x25')](config[_0xaa30('0xb')],_0xaa30('0x26'),_0xaa30('0x23')));var _0x40e4ee=[];for(var _0x1a3f64=0x0;_0x1a3f64<_0x1f288c[_0xaa30('0x27')];_0x1a3f64++){var _0x1fa8d4=_0x1f288c[_0x1a3f64]['replace'](_0xaa30('0x28'),'');if(compareVersions(module[_0xaa30('0xd')][_0xaa30('0x3')],_0x1fa8d4)===-0x1){_0x40e4ee[_0xaa30('0x29')](_0x1fa8d4);}}if(_0x40e4ee[_0xaa30('0x27')]){var _0x1dce4a=_0x40e4ee['sort'](compareVersions);var _0x5addbf=new Umzug({'storage':'sequelize','storageOptions':{'model':db[_0xaa30('0x2a')],'modelName':_0xaa30('0x2a'),'columnName':_0xaa30('0x3')},'migrations':{'params':[db[_0xaa30('0x2b')][_0xaa30('0x2c')](),db['sequelize']['constructor'],function(){throw new Error(_0xaa30('0x2d'));}],'path':path[_0xaa30('0x25')](config['root'],_0xaa30('0x26'),'migrations'),'pattern':/\.js$/}});_0x5addbf['up']({'migrations':_[_0xaa30('0x2e')](_0x1dce4a,function(_0x5241d2){return _0x5241d2+_0xaa30('0x28');})})[_0xaa30('0x20')](function(){return _0x39f708['status'](0xc8)[_0xaa30('0x11')]({'output':_0xaa30('0x2f')+module[_0xaa30('0xd')][_0xaa30('0x3')]+_0xaa30('0x30')+_[_0xaa30('0x31')](_0x1dce4a),'migrations':_['join'](_0x1dce4a)});})[_0xaa30('0x22')](function(_0x1a2af6){if(_0x1a2af6 instanceof db['sequelize'][_0xaa30('0x32')]){return _0x39f708[_0xaa30('0x10')](0xc8)[_0xaa30('0x11')]({'output':'Database\x20already\x20up-to-date'});}else{return _0x39f708['status'](0x1f4)[_0xaa30('0x11')](_0x1a2af6);}});}else{return _0x39f708[_0xaa30('0x10')](0xc8)[_0xaa30('0x11')]({'output':_0xaa30('0x33')});}};
\ No newline at end of file
diff --git a/server/api/voiceAgentReport/index.js b/server/api/voiceAgentReport/index.js
index e601fa0..22b2ee1 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 _0xc2ee=['isAuthenticated','index','/describe','describe','/:id','post','create','put','update','delete','destroy','exports','util','path','../../components/auth/service','../../components/interaction/service','../../config/environment','./voiceAgentReport.controller','get'];(function(_0x48ec91,_0x212edc){var _0x22766c=function(_0x136751){while(--_0x136751){_0x48ec91['push'](_0x48ec91['shift']());}};_0x22766c(++_0x212edc);}(_0xc2ee,0xca));var _0xec2e=function(_0x3b1705,_0x17bf2e){_0x3b1705=_0x3b1705-0x0;var _0x5157a3=_0xc2ee[_0x3b1705];return _0x5157a3;};'use strict';var multer=require('multer');var util=require(_0xec2e('0x0'));var path=require(_0xec2e('0x1'));var timeout=require('connect-timeout');var express=require('express');var router=express['Router']();var auth=require(_0xec2e('0x2'));var interaction=require(_0xec2e('0x3'));var config=require(_0xec2e('0x4'));var controller=require(_0xec2e('0x5'));router[_0xec2e('0x6')]('/',auth[_0xec2e('0x7')](),controller[_0xec2e('0x8')]);router['get'](_0xec2e('0x9'),auth[_0xec2e('0x7')](),controller[_0xec2e('0xa')]);router[_0xec2e('0x6')](_0xec2e('0xb'),auth['isAuthenticated'](),controller['show']);router[_0xec2e('0xc')]('/',auth['isAuthenticated'](),controller[_0xec2e('0xd')]);router[_0xec2e('0xe')](_0xec2e('0xb'),auth[_0xec2e('0x7')](),controller[_0xec2e('0xf')]);router[_0xec2e('0x10')](_0xec2e('0xb'),auth[_0xec2e('0x7')](),controller[_0xec2e('0x11')]);module[_0xec2e('0x12')]=router;
\ No newline at end of file
+var _0x4d47=['../../components/auth/service','../../config/environment','get','isAuthenticated','index','describe','/:id','show','post','create','put','update','delete','destroy','util','path','connect-timeout','Router'];(function(_0x5c81f8,_0x11e954){var _0x5176c9=function(_0xc9a50f){while(--_0xc9a50f){_0x5c81f8['push'](_0x5c81f8['shift']());}};_0x5176c9(++_0x11e954);}(_0x4d47,0x7a));var _0x74d4=function(_0x286325,_0x4d5b65){_0x286325=_0x286325-0x0;var _0x4c8939=_0x4d47[_0x286325];return _0x4c8939;};'use strict';var multer=require('multer');var util=require(_0x74d4('0x0'));var path=require(_0x74d4('0x1'));var timeout=require(_0x74d4('0x2'));var express=require('express');var router=express[_0x74d4('0x3')]();var auth=require(_0x74d4('0x4'));var interaction=require('../../components/interaction/service');var config=require(_0x74d4('0x5'));var controller=require('./voiceAgentReport.controller');router[_0x74d4('0x6')]('/',auth[_0x74d4('0x7')](),controller[_0x74d4('0x8')]);router[_0x74d4('0x6')]('/describe',auth['isAuthenticated'](),controller[_0x74d4('0x9')]);router[_0x74d4('0x6')](_0x74d4('0xa'),auth[_0x74d4('0x7')](),controller[_0x74d4('0xb')]);router[_0x74d4('0xc')]('/',auth[_0x74d4('0x7')](),controller[_0x74d4('0xd')]);router[_0x74d4('0xe')](_0x74d4('0xa'),auth[_0x74d4('0x7')](),controller[_0x74d4('0xf')]);router[_0x74d4('0x10')]('/:id',auth[_0x74d4('0x7')](),controller[_0x74d4('0x11')]);module['exports']=router;
\ No newline at end of file
diff --git a/server/api/voiceAgentReport/voiceAgentReport.attributes.js b/server/api/voiceAgentReport/voiceAgentReport.attributes.js
index 281a7e1..d6104b1 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 _0x8ef6=['INTEGER','BOOLEAN','sequelize','exports','STRING','DATE'];(function(_0x4400f7,_0xe6e042){var _0x158216=function(_0x1b7e14){while(--_0x1b7e14){_0x4400f7['push'](_0x4400f7['shift']());}};_0x158216(++_0xe6e042);}(_0x8ef6,0xf2));var _0x68ef=function(_0x45e075,_0x2c13d1){_0x45e075=_0x45e075-0x0;var _0x5aab0f=_0x8ef6[_0x45e075];return _0x5aab0f;};'use strict';var Sequelize=require(_0x68ef('0x0'));module[_0x68ef('0x1')]={'type':{'type':Sequelize[_0x68ef('0x2')]},'uniqueid':{'type':Sequelize[_0x68ef('0x2')]},'calleridnum':{'type':Sequelize[_0x68ef('0x2')]},'calleridname':{'type':Sequelize[_0x68ef('0x2')]},'queue':{'type':Sequelize[_0x68ef('0x2')]},'interface':{'type':Sequelize['STRING']},'membername':{'type':Sequelize[_0x68ef('0x2')]},'agentcalledAt':{'type':Sequelize[_0x68ef('0x3')]},'agentconnectAt':{'type':Sequelize[_0x68ef('0x3')]},'agentcompleteAt':{'type':Sequelize[_0x68ef('0x3')]},'agentringnoanswerAt':{'type':Sequelize['DATE']},'agentdumpAt':{'type':Sequelize['DATE']},'holdtime':{'type':Sequelize[_0x68ef('0x4')]},'agentcomplete':{'type':Sequelize[_0x68ef('0x5')],'defaultValue':![]},'agentringnoanswer':{'type':Sequelize[_0x68ef('0x5')],'defaultValue':![]},'agentdump':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'talktime':{'type':Sequelize[_0x68ef('0x4')]},'agentacw':{'type':Sequelize[_0x68ef('0x5')],'defaultValue':![]},'acwtime':{'type':Sequelize[_0x68ef('0x4')]},'reason':{'type':Sequelize[_0x68ef('0x2')]},'lastevent':{'type':Sequelize[_0x68ef('0x2')]},'channel':{'type':Sequelize[_0x68ef('0x2')]},'channelstate':{'type':Sequelize[_0x68ef('0x4')]},'channelstatedesc':{'type':Sequelize[_0x68ef('0x2')]},'connectedlinenum':{'type':Sequelize[_0x68ef('0x2')]},'connectedlinename':{'type':Sequelize[_0x68ef('0x2')]},'language':{'type':Sequelize[_0x68ef('0x2')]},'accountcode':{'type':Sequelize[_0x68ef('0x2')]},'context':{'type':Sequelize['STRING']},'exten':{'type':Sequelize[_0x68ef('0x2')]},'priority':{'type':Sequelize[_0x68ef('0x2')]},'destchannel':{'type':Sequelize[_0x68ef('0x2')]},'destchannelstate':{'type':Sequelize[_0x68ef('0x4')]},'destchannelstatedesc':{'type':Sequelize[_0x68ef('0x2')]},'destcalleridnum':{'type':Sequelize[_0x68ef('0x2')]},'destcalleridname':{'type':Sequelize['STRING']},'destconnectedlinenum':{'type':Sequelize[_0x68ef('0x2')]},'destconnectedlinename':{'type':Sequelize[_0x68ef('0x2')]},'destlanguage':{'type':Sequelize[_0x68ef('0x2')]},'destaccountcode':{'type':Sequelize['STRING']},'destcontext':{'type':Sequelize[_0x68ef('0x2')]},'destexten':{'type':Sequelize[_0x68ef('0x2')]},'destpriority':{'type':Sequelize[_0x68ef('0x2')]},'destuniqueid':{'type':Sequelize['STRING']},'answeredelsewheredestinationuniqueid':{'type':Sequelize[_0x68ef('0x2')]},'answeredelsewheremembername':{'type':Sequelize[_0x68ef('0x2')]},'transfer':{'type':Sequelize[_0x68ef('0x5')],'defaultValue':![]},'transfertype':{'type':Sequelize[_0x68ef('0x2')],'comment':'FORWARD,\x20BLIND,\x20ATTENDED'},'transferexten':{'type':Sequelize[_0x68ef('0x2')]},'transferuniqueid':{'type':Sequelize['STRING']},'agententerreason':{'type':Sequelize['INTEGER'],'defaultValue':0x0}};
\ No newline at end of file
+var _0x8d0e=['BOOLEAN','FORWARD,\x20BLIND,\x20ATTENDED','sequelize','exports','STRING','DATE','INTEGER'];(function(_0x2f1952,_0x553d55){var _0x3e14d5=function(_0x18e80c){while(--_0x18e80c){_0x2f1952['push'](_0x2f1952['shift']());}};_0x3e14d5(++_0x553d55);}(_0x8d0e,0x1d7));var _0xe8d0=function(_0x51109f,_0x4e720d){_0x51109f=_0x51109f-0x0;var _0x16ae0a=_0x8d0e[_0x51109f];return _0x16ae0a;};'use strict';var Sequelize=require(_0xe8d0('0x0'));module[_0xe8d0('0x1')]={'type':{'type':Sequelize[_0xe8d0('0x2')]},'uniqueid':{'type':Sequelize[_0xe8d0('0x2')]},'calleridnum':{'type':Sequelize[_0xe8d0('0x2')]},'calleridname':{'type':Sequelize[_0xe8d0('0x2')]},'queue':{'type':Sequelize[_0xe8d0('0x2')]},'interface':{'type':Sequelize[_0xe8d0('0x2')]},'membername':{'type':Sequelize[_0xe8d0('0x2')]},'agentcalledAt':{'type':Sequelize['DATE']},'agentconnectAt':{'type':Sequelize[_0xe8d0('0x3')]},'agentcompleteAt':{'type':Sequelize['DATE']},'agentringnoanswerAt':{'type':Sequelize['DATE']},'agentdumpAt':{'type':Sequelize[_0xe8d0('0x3')]},'holdtime':{'type':Sequelize[_0xe8d0('0x4')]},'agentcomplete':{'type':Sequelize[_0xe8d0('0x5')],'defaultValue':![]},'agentringnoanswer':{'type':Sequelize[_0xe8d0('0x5')],'defaultValue':![]},'agentdump':{'type':Sequelize[_0xe8d0('0x5')],'defaultValue':![]},'talktime':{'type':Sequelize[_0xe8d0('0x4')]},'agentacw':{'type':Sequelize[_0xe8d0('0x5')],'defaultValue':![]},'acwtime':{'type':Sequelize[_0xe8d0('0x4')]},'reason':{'type':Sequelize['STRING']},'lastevent':{'type':Sequelize[_0xe8d0('0x2')]},'channel':{'type':Sequelize[_0xe8d0('0x2')]},'channelstate':{'type':Sequelize[_0xe8d0('0x4')]},'channelstatedesc':{'type':Sequelize['STRING']},'connectedlinenum':{'type':Sequelize['STRING']},'connectedlinename':{'type':Sequelize[_0xe8d0('0x2')]},'language':{'type':Sequelize[_0xe8d0('0x2')]},'accountcode':{'type':Sequelize[_0xe8d0('0x2')]},'context':{'type':Sequelize[_0xe8d0('0x2')]},'exten':{'type':Sequelize[_0xe8d0('0x2')]},'priority':{'type':Sequelize[_0xe8d0('0x2')]},'destchannel':{'type':Sequelize['STRING']},'destchannelstate':{'type':Sequelize[_0xe8d0('0x4')]},'destchannelstatedesc':{'type':Sequelize[_0xe8d0('0x2')]},'destcalleridnum':{'type':Sequelize['STRING']},'destcalleridname':{'type':Sequelize[_0xe8d0('0x2')]},'destconnectedlinenum':{'type':Sequelize['STRING']},'destconnectedlinename':{'type':Sequelize['STRING']},'destlanguage':{'type':Sequelize[_0xe8d0('0x2')]},'destaccountcode':{'type':Sequelize[_0xe8d0('0x2')]},'destcontext':{'type':Sequelize[_0xe8d0('0x2')]},'destexten':{'type':Sequelize[_0xe8d0('0x2')]},'destpriority':{'type':Sequelize[_0xe8d0('0x2')]},'destuniqueid':{'type':Sequelize[_0xe8d0('0x2')]},'answeredelsewheredestinationuniqueid':{'type':Sequelize['STRING']},'answeredelsewheremembername':{'type':Sequelize[_0xe8d0('0x2')]},'transfer':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'transfertype':{'type':Sequelize[_0xe8d0('0x2')],'comment':_0xe8d0('0x6')},'transferexten':{'type':Sequelize[_0xe8d0('0x2')]},'transferuniqueid':{'type':Sequelize['STRING']},'agententerreason':{'type':Sequelize['INTEGER'],'defaultValue':0x0}};
\ No newline at end of file
diff --git a/server/api/voiceAgentReport/voiceAgentReport.controller.js b/server/api/voiceAgentReport/voiceAgentReport.controller.js
index 3d25cea..8cec5cf 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 _0x6f74=['body','params','describe','html-pdf','eml-format','fast-json-patch','request-promise','moment','bluebird','mustache','util','path','sox','to-csv','ejs','squel','jsforce','desk.js','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/environment','../../mysqldb','sendStatus','status','count','offset','limit','json','apply','save','update','then','destroy','end','error','stack','name','send','index','map','fieldName','type','key','model','query','keys','filters','intersection','attributes','fields','length','hasOwnProperty','nolimit','order','sort','filter','where','merge','VIRTUAL','options','VoiceAgentReport','include','findAll','rows','show','rawAttributes','includeAll','find','catch','create'];(function(_0x289985,_0x144b4c){var _0x166bc5=function(_0x3e5a09){while(--_0x3e5a09){_0x289985['push'](_0x289985['shift']());}};_0x166bc5(++_0x144b4c);}(_0x6f74,0x184));var _0x46f7=function(_0x22cfdc,_0xe97df4){_0x22cfdc=_0x22cfdc-0x0;var _0x396bc2=_0x6f74[_0x22cfdc];return _0x396bc2;};'use strict';var pdf=require(_0x46f7('0x0'));var emlformat=require(_0x46f7('0x1'));var rimraf=require('rimraf');var zipdir=require('zip-dir');var jsonpatch=require(_0x46f7('0x2'));var rp=require(_0x46f7('0x3'));var moment=require(_0x46f7('0x4'));var BPromise=require(_0x46f7('0x5'));var Mustache=require(_0x46f7('0x6'));var util=require(_0x46f7('0x7'));var path=require(_0x46f7('0x8'));var sox=require(_0x46f7('0x9'));var csv=require(_0x46f7('0xa'));var ejs=require(_0x46f7('0xb'));var fs=require('fs');var _=require('lodash');var squel=require(_0x46f7('0xc'));var crypto=require('crypto');var jsforce=require(_0x46f7('0xd'));var deskjs=require(_0x46f7('0xe'));var toCsv=require('to-csv');var querystring=require(_0x46f7('0xf'));var Papa=require(_0x46f7('0x10'));var Redis=require(_0x46f7('0x11'));var authService=require(_0x46f7('0x12'));var qs=require(_0x46f7('0x13'));var as=require(_0x46f7('0x14'));var hardwareService=require(_0x46f7('0x15'));var logger=require(_0x46f7('0x16'))(_0x46f7('0x17'));var utils=require('../../config/utils');var config=require(_0x46f7('0x18'));var db=require(_0x46f7('0x19'))['db'];function respondWithStatusCode(_0x5ce139,_0x441f99){_0x441f99=_0x441f99||0xcc;return function(_0x29e385){if(_0x29e385){return _0x5ce139[_0x46f7('0x1a')](_0x441f99);}return _0x5ce139[_0x46f7('0x1b')](_0x441f99)['end']();};}function respondWithResult(_0x310116,_0xab2092){_0xab2092=_0xab2092||0xc8;return function(_0x2a14ed){if(_0x2a14ed){return _0x310116[_0x46f7('0x1b')](_0xab2092)['json'](_0x2a14ed);}};}function respondWithFilteredResult(_0x51cee0,_0x4010f3){return function(_0x421b0e){if(_0x421b0e){var _0x440427=_0x421b0e[_0x46f7('0x1c')],_0x229d0b=_0x4010f3[_0x46f7('0x1d')],_0x442424=_0x4010f3['offset']+_0x4010f3[_0x46f7('0x1e')],_0x51001a;if(_0x442424>=_0x440427){_0x442424=_0x440427;_0x51001a=0xc8;}else{_0x51001a=0xce;}_0x51cee0[_0x46f7('0x1b')](_0x51001a);return _0x51cee0['set']('Content-Range',_0x229d0b+'-'+_0x442424+'/'+_0x440427)[_0x46f7('0x1f')](_0x421b0e);}return null;};}function patchUpdates(_0x1375fa){return function(_0x2b4de4){try{jsonpatch[_0x46f7('0x20')](_0x2b4de4,_0x1375fa,!![]);}catch(_0x4f4176){return BPromise['reject'](_0x4f4176);}return _0x2b4de4[_0x46f7('0x21')]();};}function saveUpdates(_0x4e0cf8,_0x2c8baa){return function(_0x387b99){if(_0x387b99){return _0x387b99[_0x46f7('0x22')](_0x4e0cf8)[_0x46f7('0x23')](function(_0x5bbc00){return _0x5bbc00;});}return null;};}function removeEntity(_0x40c8a4,_0x586245){return function(_0x40f500){if(_0x40f500){return _0x40f500[_0x46f7('0x24')]()[_0x46f7('0x23')](function(){_0x40c8a4[_0x46f7('0x1b')](0xcc)[_0x46f7('0x25')]();});}};}function handleEntityNotFound(_0x33f85d,_0x57fe60){return function(_0x10cd13){if(!_0x10cd13){_0x33f85d['sendStatus'](0x194);}return _0x10cd13;};}function handleError(_0x16842d,_0x2e1226){_0x2e1226=_0x2e1226||0x1f4;return function(_0x452371){logger[_0x46f7('0x26')](_0x452371[_0x46f7('0x27')]);if(_0x452371['name']){delete _0x452371[_0x46f7('0x28')];}_0x16842d[_0x46f7('0x1b')](_0x2e1226)[_0x46f7('0x29')](_0x452371);};}exports[_0x46f7('0x2a')]=function(_0xf915fd,_0x120e3c){var _0x39ec53={},_0x19000b={},_0x4691f9={'count':0x0,'rows':[]};var _0x587441=_[_0x46f7('0x2b')](db['VoiceAgentReport']['rawAttributes'],function(_0x212925){return{'name':_0x212925[_0x46f7('0x2c')],'type':_0x212925[_0x46f7('0x2d')][_0x46f7('0x2e')]};});_0x19000b[_0x46f7('0x2f')]=_[_0x46f7('0x2b')](_0x587441,'name');_0x19000b[_0x46f7('0x30')]=_[_0x46f7('0x31')](_0xf915fd[_0x46f7('0x30')]);_0x19000b[_0x46f7('0x32')]=_[_0x46f7('0x33')](_0x19000b[_0x46f7('0x2f')],_0x19000b[_0x46f7('0x30')]);_0x39ec53[_0x46f7('0x34')]=_[_0x46f7('0x33')](_0x19000b[_0x46f7('0x2f')],qs[_0x46f7('0x35')](_0xf915fd['query'][_0x46f7('0x35')]));_0x39ec53[_0x46f7('0x34')]=_0x39ec53[_0x46f7('0x34')][_0x46f7('0x36')]?_0x39ec53[_0x46f7('0x34')]:_0x19000b[_0x46f7('0x2f')];if(!_0xf915fd[_0x46f7('0x30')][_0x46f7('0x37')](_0x46f7('0x38'))){_0x39ec53[_0x46f7('0x1e')]=qs['limit'](_0xf915fd[_0x46f7('0x30')][_0x46f7('0x1e')]);_0x39ec53[_0x46f7('0x1d')]=qs[_0x46f7('0x1d')](_0xf915fd[_0x46f7('0x30')][_0x46f7('0x1d')]);}_0x39ec53[_0x46f7('0x39')]=qs[_0x46f7('0x3a')](_0xf915fd['query'][_0x46f7('0x3a')]);_0x39ec53['where']=qs[_0x46f7('0x32')](_['pick'](_0xf915fd[_0x46f7('0x30')],_0x19000b['filters']));if(_0xf915fd[_0x46f7('0x30')][_0x46f7('0x3b')]){_0x39ec53[_0x46f7('0x3c')]=_[_0x46f7('0x3d')](_0x39ec53[_0x46f7('0x3c')],{'$or':_[_0x46f7('0x2b')](_0x587441,function(_0x23e237){if(_0x23e237[_0x46f7('0x2d')]!==_0x46f7('0x3e')){var _0x7ea77c={};_0x7ea77c[_0x23e237[_0x46f7('0x28')]]={'$like':'%'+_0xf915fd[_0x46f7('0x30')][_0x46f7('0x3b')]+'%'};return _0x7ea77c;}})});}_0x39ec53=_[_0x46f7('0x3d')]({},_0x39ec53,_0xf915fd[_0x46f7('0x3f')]);var _0x1ae766={'where':_0x39ec53[_0x46f7('0x3c')]};return db[_0x46f7('0x40')]['count'](_0x1ae766)[_0x46f7('0x23')](function(_0x482bd4){_0x4691f9['count']=_0x482bd4;if(_0xf915fd[_0x46f7('0x30')]['includeAll']){_0x39ec53[_0x46f7('0x41')]=[{'all':!![]}];}return db[_0x46f7('0x40')][_0x46f7('0x42')](_0x39ec53);})[_0x46f7('0x23')](function(_0x290366){_0x4691f9[_0x46f7('0x43')]=_0x290366;return _0x4691f9;})[_0x46f7('0x23')](respondWithFilteredResult(_0x120e3c,_0x39ec53))['catch'](handleError(_0x120e3c,null));};exports[_0x46f7('0x44')]=function(_0x35d2ee,_0x406607){var _0xf813e3={'raw':![],'where':{'id':_0x35d2ee['params']['id']}},_0x5e63c0={};_0x5e63c0[_0x46f7('0x2f')]=_[_0x46f7('0x31')](db[_0x46f7('0x40')][_0x46f7('0x45')]);_0x5e63c0[_0x46f7('0x30')]=_['keys'](_0x35d2ee[_0x46f7('0x30')]);_0x5e63c0[_0x46f7('0x32')]=_[_0x46f7('0x33')](_0x5e63c0['model'],_0x5e63c0[_0x46f7('0x30')]);_0xf813e3[_0x46f7('0x34')]=_[_0x46f7('0x33')](_0x5e63c0[_0x46f7('0x2f')],qs[_0x46f7('0x35')](_0x35d2ee[_0x46f7('0x30')][_0x46f7('0x35')]));_0xf813e3[_0x46f7('0x34')]=_0xf813e3[_0x46f7('0x34')]['length']?_0xf813e3[_0x46f7('0x34')]:_0x5e63c0[_0x46f7('0x2f')];if(_0x35d2ee[_0x46f7('0x30')][_0x46f7('0x46')]){_0xf813e3[_0x46f7('0x41')]=[{'all':!![]}];}_0xf813e3=_['merge']({},_0xf813e3,_0x35d2ee['options']);return db[_0x46f7('0x40')][_0x46f7('0x47')](_0xf813e3)[_0x46f7('0x23')](handleEntityNotFound(_0x406607,null))[_0x46f7('0x23')](respondWithResult(_0x406607,null))[_0x46f7('0x48')](handleError(_0x406607,null));};exports[_0x46f7('0x49')]=function(_0x14f217,_0x21e1a5){return db[_0x46f7('0x40')][_0x46f7('0x49')](_0x14f217[_0x46f7('0x4a')],{})[_0x46f7('0x23')](respondWithResult(_0x21e1a5,0xc9))['catch'](handleError(_0x21e1a5,null));};exports[_0x46f7('0x22')]=function(_0x4da519,_0x5d9b93){if(_0x4da519[_0x46f7('0x4a')]['id']){delete _0x4da519[_0x46f7('0x4a')]['id'];}return db[_0x46f7('0x40')][_0x46f7('0x47')]({'where':{'id':_0x4da519[_0x46f7('0x4b')]['id']}})[_0x46f7('0x23')](handleEntityNotFound(_0x5d9b93,null))['then'](saveUpdates(_0x4da519[_0x46f7('0x4a')],null))[_0x46f7('0x23')](respondWithResult(_0x5d9b93,null))[_0x46f7('0x48')](handleError(_0x5d9b93,null));};exports['destroy']=function(_0xddb219,_0x298ea2){return db[_0x46f7('0x40')][_0x46f7('0x47')]({'where':{'id':_0xddb219[_0x46f7('0x4b')]['id']}})[_0x46f7('0x23')](handleEntityNotFound(_0x298ea2,null))[_0x46f7('0x23')](removeEntity(_0x298ea2,null))['catch'](handleError(_0x298ea2,null));};exports[_0x46f7('0x4c')]=function(_0x43bd9d,_0x219379){return db[_0x46f7('0x40')][_0x46f7('0x4c')]()[_0x46f7('0x23')](respondWithResult(_0x219379,null))[_0x46f7('0x48')](handleError(_0x219379,null));};
\ No newline at end of file
+var _0x5976=['fieldName','type','model','query','keys','filters','intersection','attributes','fields','length','hasOwnProperty','nolimit','sort','where','pick','filter','merge','VIRTUAL','include','catch','show','params','rawAttributes','includeAll','options','find','body','describe','rimraf','zip-dir','fast-json-patch','request-promise','bluebird','util','sox','lodash','crypto','jsforce','to-csv','querystring','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/environment','sendStatus','status','end','count','offset','limit','set','json','apply','reject','save','update','then','destroy','stack','name','send','index','map','VoiceAgentReport'];(function(_0x48602a,_0x36bb27){var _0x561495=function(_0x34855a){while(--_0x34855a){_0x48602a['push'](_0x48602a['shift']());}};_0x561495(++_0x36bb27);}(_0x5976,0x1b4));var _0x6597=function(_0x4fe38c,_0x336a7a){_0x4fe38c=_0x4fe38c-0x0;var _0x2133c4=_0x5976[_0x4fe38c];return _0x2133c4;};'use strict';var pdf=require('html-pdf');var emlformat=require('eml-format');var rimraf=require(_0x6597('0x0'));var zipdir=require(_0x6597('0x1'));var jsonpatch=require(_0x6597('0x2'));var rp=require(_0x6597('0x3'));var moment=require('moment');var BPromise=require(_0x6597('0x4'));var Mustache=require('mustache');var util=require(_0x6597('0x5'));var path=require('path');var sox=require(_0x6597('0x6'));var csv=require('to-csv');var ejs=require('ejs');var fs=require('fs');var _=require(_0x6597('0x7'));var squel=require('squel');var crypto=require(_0x6597('0x8'));var jsforce=require(_0x6597('0x9'));var deskjs=require('desk.js');var toCsv=require(_0x6597('0xa'));var querystring=require(_0x6597('0xb'));var Papa=require('papaparse');var Redis=require('ioredis');var authService=require(_0x6597('0xc'));var qs=require(_0x6597('0xd'));var as=require(_0x6597('0xe'));var hardwareService=require(_0x6597('0xf'));var logger=require(_0x6597('0x10'))(_0x6597('0x11'));var utils=require(_0x6597('0x12'));var config=require(_0x6597('0x13'));var db=require('../../mysqldb')['db'];function respondWithStatusCode(_0x575e24,_0x11524d){_0x11524d=_0x11524d||0xcc;return function(_0x52987c){if(_0x52987c){return _0x575e24[_0x6597('0x14')](_0x11524d);}return _0x575e24[_0x6597('0x15')](_0x11524d)[_0x6597('0x16')]();};}function respondWithResult(_0x1a8f9b,_0x2ec51c){_0x2ec51c=_0x2ec51c||0xc8;return function(_0x1064aa){if(_0x1064aa){return _0x1a8f9b[_0x6597('0x15')](_0x2ec51c)['json'](_0x1064aa);}};}function respondWithFilteredResult(_0x31b487,_0x57b299){return function(_0x440e9d){if(_0x440e9d){var _0x58a073=_0x440e9d[_0x6597('0x17')],_0x3c8265=_0x57b299[_0x6597('0x18')],_0xc4f7f3=_0x57b299[_0x6597('0x18')]+_0x57b299[_0x6597('0x19')],_0x2a0dfd;if(_0xc4f7f3>=_0x58a073){_0xc4f7f3=_0x58a073;_0x2a0dfd=0xc8;}else{_0x2a0dfd=0xce;}_0x31b487[_0x6597('0x15')](_0x2a0dfd);return _0x31b487[_0x6597('0x1a')]('Content-Range',_0x3c8265+'-'+_0xc4f7f3+'/'+_0x58a073)[_0x6597('0x1b')](_0x440e9d);}return null;};}function patchUpdates(_0x160f66){return function(_0x4ef25c){try{jsonpatch[_0x6597('0x1c')](_0x4ef25c,_0x160f66,!![]);}catch(_0x3a33f9){return BPromise[_0x6597('0x1d')](_0x3a33f9);}return _0x4ef25c[_0x6597('0x1e')]();};}function saveUpdates(_0x31b6e3,_0xef731c){return function(_0xc74712){if(_0xc74712){return _0xc74712[_0x6597('0x1f')](_0x31b6e3)[_0x6597('0x20')](function(_0x4538c1){return _0x4538c1;});}return null;};}function removeEntity(_0x34bcaf,_0x3edbfe){return function(_0x28eb2e){if(_0x28eb2e){return _0x28eb2e[_0x6597('0x21')]()[_0x6597('0x20')](function(){_0x34bcaf['status'](0xcc)[_0x6597('0x16')]();});}};}function handleEntityNotFound(_0x989464,_0x6779ac){return function(_0x3370d4){if(!_0x3370d4){_0x989464[_0x6597('0x14')](0x194);}return _0x3370d4;};}function handleError(_0x47b225,_0x274c8c){_0x274c8c=_0x274c8c||0x1f4;return function(_0x168439){logger['error'](_0x168439[_0x6597('0x22')]);if(_0x168439[_0x6597('0x23')]){delete _0x168439['name'];}_0x47b225[_0x6597('0x15')](_0x274c8c)[_0x6597('0x24')](_0x168439);};}exports[_0x6597('0x25')]=function(_0x5e1efd,_0x5ea042){var _0x1bb1c5={},_0x217bb5={},_0x314130={'count':0x0,'rows':[]};var _0x2e5071=_[_0x6597('0x26')](db[_0x6597('0x27')]['rawAttributes'],function(_0x210a7e){return{'name':_0x210a7e[_0x6597('0x28')],'type':_0x210a7e[_0x6597('0x29')]['key']};});_0x217bb5[_0x6597('0x2a')]=_[_0x6597('0x26')](_0x2e5071,'name');_0x217bb5[_0x6597('0x2b')]=_[_0x6597('0x2c')](_0x5e1efd[_0x6597('0x2b')]);_0x217bb5[_0x6597('0x2d')]=_[_0x6597('0x2e')](_0x217bb5[_0x6597('0x2a')],_0x217bb5[_0x6597('0x2b')]);_0x1bb1c5[_0x6597('0x2f')]=_[_0x6597('0x2e')](_0x217bb5[_0x6597('0x2a')],qs['fields'](_0x5e1efd[_0x6597('0x2b')][_0x6597('0x30')]));_0x1bb1c5[_0x6597('0x2f')]=_0x1bb1c5['attributes'][_0x6597('0x31')]?_0x1bb1c5[_0x6597('0x2f')]:_0x217bb5[_0x6597('0x2a')];if(!_0x5e1efd[_0x6597('0x2b')][_0x6597('0x32')](_0x6597('0x33'))){_0x1bb1c5[_0x6597('0x19')]=qs['limit'](_0x5e1efd[_0x6597('0x2b')][_0x6597('0x19')]);_0x1bb1c5['offset']=qs[_0x6597('0x18')](_0x5e1efd[_0x6597('0x2b')][_0x6597('0x18')]);}_0x1bb1c5['order']=qs[_0x6597('0x34')](_0x5e1efd['query'][_0x6597('0x34')]);_0x1bb1c5[_0x6597('0x35')]=qs[_0x6597('0x2d')](_[_0x6597('0x36')](_0x5e1efd[_0x6597('0x2b')],_0x217bb5[_0x6597('0x2d')]));if(_0x5e1efd[_0x6597('0x2b')][_0x6597('0x37')]){_0x1bb1c5['where']=_[_0x6597('0x38')](_0x1bb1c5[_0x6597('0x35')],{'$or':_[_0x6597('0x26')](_0x2e5071,function(_0x410b2a){if(_0x410b2a[_0x6597('0x29')]!==_0x6597('0x39')){var _0x39d307={};_0x39d307[_0x410b2a['name']]={'$like':'%'+_0x5e1efd['query'][_0x6597('0x37')]+'%'};return _0x39d307;}})});}_0x1bb1c5=_[_0x6597('0x38')]({},_0x1bb1c5,_0x5e1efd['options']);var _0x5db948={'where':_0x1bb1c5['where']};return db[_0x6597('0x27')][_0x6597('0x17')](_0x5db948)[_0x6597('0x20')](function(_0x5f3984){_0x314130[_0x6597('0x17')]=_0x5f3984;if(_0x5e1efd['query']['includeAll']){_0x1bb1c5[_0x6597('0x3a')]=[{'all':!![]}];}return db['VoiceAgentReport']['findAll'](_0x1bb1c5);})[_0x6597('0x20')](function(_0x5a095a){_0x314130['rows']=_0x5a095a;return _0x314130;})[_0x6597('0x20')](respondWithFilteredResult(_0x5ea042,_0x1bb1c5))[_0x6597('0x3b')](handleError(_0x5ea042,null));};exports[_0x6597('0x3c')]=function(_0x2ee565,_0x3c4a34){var _0x284d03={'raw':![],'where':{'id':_0x2ee565[_0x6597('0x3d')]['id']}},_0x3d4e77={};_0x3d4e77['model']=_['keys'](db['VoiceAgentReport'][_0x6597('0x3e')]);_0x3d4e77[_0x6597('0x2b')]=_['keys'](_0x2ee565[_0x6597('0x2b')]);_0x3d4e77[_0x6597('0x2d')]=_[_0x6597('0x2e')](_0x3d4e77[_0x6597('0x2a')],_0x3d4e77[_0x6597('0x2b')]);_0x284d03[_0x6597('0x2f')]=_[_0x6597('0x2e')](_0x3d4e77[_0x6597('0x2a')],qs[_0x6597('0x30')](_0x2ee565[_0x6597('0x2b')]['fields']));_0x284d03[_0x6597('0x2f')]=_0x284d03[_0x6597('0x2f')]['length']?_0x284d03[_0x6597('0x2f')]:_0x3d4e77['model'];if(_0x2ee565[_0x6597('0x2b')][_0x6597('0x3f')]){_0x284d03[_0x6597('0x3a')]=[{'all':!![]}];}_0x284d03=_['merge']({},_0x284d03,_0x2ee565[_0x6597('0x40')]);return db[_0x6597('0x27')][_0x6597('0x41')](_0x284d03)[_0x6597('0x20')](handleEntityNotFound(_0x3c4a34,null))[_0x6597('0x20')](respondWithResult(_0x3c4a34,null))[_0x6597('0x3b')](handleError(_0x3c4a34,null));};exports['create']=function(_0x50150e,_0x45cdcf){return db[_0x6597('0x27')]['create'](_0x50150e[_0x6597('0x42')],{})[_0x6597('0x20')](respondWithResult(_0x45cdcf,0xc9))[_0x6597('0x3b')](handleError(_0x45cdcf,null));};exports[_0x6597('0x1f')]=function(_0x33fb37,_0x5bb108){if(_0x33fb37[_0x6597('0x42')]['id']){delete _0x33fb37['body']['id'];}return db[_0x6597('0x27')][_0x6597('0x41')]({'where':{'id':_0x33fb37[_0x6597('0x3d')]['id']}})[_0x6597('0x20')](handleEntityNotFound(_0x5bb108,null))[_0x6597('0x20')](saveUpdates(_0x33fb37[_0x6597('0x42')],null))['then'](respondWithResult(_0x5bb108,null))[_0x6597('0x3b')](handleError(_0x5bb108,null));};exports[_0x6597('0x21')]=function(_0x248852,_0x3c1d90){return db[_0x6597('0x27')][_0x6597('0x41')]({'where':{'id':_0x248852['params']['id']}})['then'](handleEntityNotFound(_0x3c1d90,null))['then'](removeEntity(_0x3c1d90,null))[_0x6597('0x3b')](handleError(_0x3c1d90,null));};exports[_0x6597('0x43')]=function(_0x3cffaa,_0xee9f59){return db[_0x6597('0x27')][_0x6597('0x43')]()[_0x6597('0x20')](respondWithResult(_0xee9f59,null))['catch'](handleError(_0xee9f59,null));};
\ No newline at end of file
diff --git a/server/api/voiceAgentReport/voiceAgentReport.model.js b/server/api/voiceAgentReport/voiceAgentReport.model.js
index e4afabd..f0562ca 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 _0x9c49=['bluebird','path','../../config/environment','VoiceAgentReport','report_agent','destuniqueid','lodash','util','api'];(function(_0x180b10,_0x183483){var _0x41eaf6=function(_0x1d5f17){while(--_0x1d5f17){_0x180b10['push'](_0x180b10['shift']());}};_0x41eaf6(++_0x183483);}(_0x9c49,0x1c8));var _0x99c4=function(_0x15ed46,_0x1aefa7){_0x15ed46=_0x15ed46-0x0;var _0x1c280f=_0x9c49[_0x15ed46];return _0x1c280f;};'use strict';var _=require(_0x99c4('0x0'));var util=require(_0x99c4('0x1'));var logger=require('../../config/logger')(_0x99c4('0x2'));var moment=require('moment');var BPromise=require(_0x99c4('0x3'));var rp=require('request-promise');var fs=require('fs');var path=require(_0x99c4('0x4'));var rimraf=require('rimraf');var config=require(_0x99c4('0x5'));var attributes=require('./voiceAgentReport.attributes');module['exports']=function(_0x433661,_0x7640b){return _0x433661['define'](_0x99c4('0x6'),attributes,{'tableName':_0x99c4('0x7'),'paranoid':![],'indexes':[{'fields':['uniqueid',_0x99c4('0x8')]}],'timestamps':!![]});};
\ No newline at end of file
+var _0x27ff=['lodash','../../config/logger','api','moment','bluebird','request-promise','path','rimraf','../../config/environment','./voiceAgentReport.attributes','exports','define','VoiceAgentReport','report_agent','uniqueid'];(function(_0x102e37,_0x14a181){var _0x35a07c=function(_0x16577f){while(--_0x16577f){_0x102e37['push'](_0x102e37['shift']());}};_0x35a07c(++_0x14a181);}(_0x27ff,0x78));var _0xf27f=function(_0x3564d6,_0x37d1cb){_0x3564d6=_0x3564d6-0x0;var _0x1f2267=_0x27ff[_0x3564d6];return _0x1f2267;};'use strict';var _=require(_0xf27f('0x0'));var util=require('util');var logger=require(_0xf27f('0x1'))(_0xf27f('0x2'));var moment=require(_0xf27f('0x3'));var BPromise=require(_0xf27f('0x4'));var rp=require(_0xf27f('0x5'));var fs=require('fs');var path=require(_0xf27f('0x6'));var rimraf=require(_0xf27f('0x7'));var config=require(_0xf27f('0x8'));var attributes=require(_0xf27f('0x9'));module[_0xf27f('0xa')]=function(_0x10f950,_0x262024){return _0x10f950[_0xf27f('0xb')](_0xf27f('0xc'),attributes,{'tableName':_0xf27f('0xd'),'paranoid':![],'indexes':[{'fields':[_0xf27f('0xe'),'destuniqueid']}],'timestamps':!![]});};
\ No newline at end of file
diff --git a/server/api/voiceAgentReport/voiceAgentReport.rpc.js b/server/api/voiceAgentReport/voiceAgentReport.rpc.js
index d16942a..ae2e277 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 _0xcee0=['catch','CreateVoiceAgentReport','VoiceAgentReport','create','body','options','raw','update','where','attributes','limit','UpdateVoiceAgentReport','util','moment','bluebird','randomstring','ioredis','../../config/utils','rpc','../../config/environment','jayson/promise','client','http','request','then','info','VoiceAgentReport,\x20%s,\x20%s','request\x20sent','debug','VoiceAgentReport,\x20%s,\x20%s,\x20%s','stringify','error','code','message'];(function(_0x3b32d3,_0x3cbafb){var _0x2bebcd=function(_0x45397b){while(--_0x45397b){_0x3b32d3['push'](_0x3b32d3['shift']());}};_0x2bebcd(++_0x3cbafb);}(_0xcee0,0x1a4));var _0x0cee=function(_0x533110,_0x20937f){_0x533110=_0x533110-0x0;var _0xc3c866=_0xcee0[_0x533110];return _0xc3c866;};'use strict';var _=require('lodash');var util=require(_0x0cee('0x0'));var moment=require(_0x0cee('0x1'));var BPromise=require(_0x0cee('0x2'));var rs=require(_0x0cee('0x3'));var fs=require('fs');var Redis=require(_0x0cee('0x4'));var db=require('../../mysqldb')['db'];var utils=require(_0x0cee('0x5'));var logger=require('../../config/logger')(_0x0cee('0x6'));var config=require(_0x0cee('0x7'));var jayson=require(_0x0cee('0x8'));var client=jayson[_0x0cee('0x9')][_0x0cee('0xa')]({'port':0x232a});function respondWithRpcPromise(_0x59aa45,_0x280ab1,_0xbf8553){return new BPromise(function(_0x2163df,_0x445ddd){return client[_0x0cee('0xb')](_0x59aa45,_0xbf8553)[_0x0cee('0xc')](function(_0xf94c7e){logger[_0x0cee('0xd')](_0x0cee('0xe'),_0x280ab1,_0x0cee('0xf'));logger[_0x0cee('0x10')](_0x0cee('0x11'),_0x280ab1,'request\x20sent',JSON[_0x0cee('0x12')](_0xf94c7e));if(_0xf94c7e[_0x0cee('0x13')]){if(_0xf94c7e[_0x0cee('0x13')][_0x0cee('0x14')]===0x1f4){logger[_0x0cee('0x13')](_0x0cee('0xe'),_0x280ab1,_0xf94c7e[_0x0cee('0x13')][_0x0cee('0x15')]);return _0x445ddd(_0xf94c7e['error'][_0x0cee('0x15')]);}logger['error']('VoiceAgentReport,\x20%s,\x20%s',_0x280ab1,_0xf94c7e['error'][_0x0cee('0x15')]);return _0x2163df(_0xf94c7e['error']['message']);}else{logger[_0x0cee('0xd')](_0x0cee('0xe'),_0x280ab1,_0x0cee('0xf'));_0x2163df(_0xf94c7e['result'][_0x0cee('0x15')]);}})[_0x0cee('0x16')](function(_0x175e91){logger[_0x0cee('0x13')](_0x0cee('0xe'),_0x280ab1,_0x175e91);_0x445ddd(_0x175e91);});});}exports[_0x0cee('0x17')]=function(_0x55188e){var _0x2a9d06=this;return new Promise(function(_0x3b6726,_0x31ccf8){return db[_0x0cee('0x18')][_0x0cee('0x19')](_0x55188e[_0x0cee('0x1a')],{'raw':_0x55188e[_0x0cee('0x1b')]?_0x55188e['options'][_0x0cee('0x1c')]===undefined?!![]:![]:!![]})['then'](function(_0x182bfe){logger[_0x0cee('0xd')](_0x0cee('0x17'),_0x55188e);logger[_0x0cee('0x10')](_0x0cee('0x17'),_0x55188e,JSON[_0x0cee('0x12')](_0x182bfe));_0x3b6726(_0x182bfe);})['catch'](function(_0x2d9ef9){logger[_0x0cee('0x13')](_0x0cee('0x17'),_0x2d9ef9[_0x0cee('0x15')],_0x55188e);_0x31ccf8(_0x2a9d06['error'](0x1f4,_0x2d9ef9[_0x0cee('0x15')]));});});};exports['UpdateVoiceAgentReport']=function(_0x659350){var _0x47b771=this;return new Promise(function(_0x395cd3,_0x5ee37d){return db[_0x0cee('0x18')][_0x0cee('0x1d')](_0x659350[_0x0cee('0x1a')],{'raw':_0x659350[_0x0cee('0x1b')]?_0x659350[_0x0cee('0x1b')][_0x0cee('0x1c')]===undefined?!![]:![]:!![],'individualHooks':!![],'where':_0x659350[_0x0cee('0x1b')]?_0x659350[_0x0cee('0x1b')][_0x0cee('0x1e')]||null:null,'attributes':_0x659350[_0x0cee('0x1b')]?_0x659350['options'][_0x0cee('0x1f')]||null:null,'limit':_0x659350[_0x0cee('0x1b')]?_0x659350[_0x0cee('0x1b')][_0x0cee('0x20')]||null:null})[_0x0cee('0xc')](function(_0x55bb0f){logger[_0x0cee('0xd')](_0x0cee('0x21'),_0x659350);logger[_0x0cee('0x10')](_0x0cee('0x21'),_0x659350,JSON['stringify'](_0x55bb0f));_0x395cd3(_0x55bb0f);})[_0x0cee('0x16')](function(_0x176a0b){logger[_0x0cee('0x13')](_0x0cee('0x21'),_0x176a0b['message'],_0x659350);_0x5ee37d(_0x47b771['error'](0x1f4,_0x176a0b['message']));});});};
\ No newline at end of file
+var _0x96b1=['moment','ioredis','../../config/utils','../../config/logger','jayson/promise','then','info','request\x20sent','debug','VoiceAgentReport,\x20%s,\x20%s,\x20%s','stringify','error','code','VoiceAgentReport,\x20%s,\x20%s','message','result','catch','CreateVoiceAgentReport','VoiceAgentReport','create','body','options','raw','UpdateVoiceAgentReport','update','attributes','lodash','util'];(function(_0x432682,_0x253044){var _0x463d05=function(_0xa73403){while(--_0xa73403){_0x432682['push'](_0x432682['shift']());}};_0x463d05(++_0x253044);}(_0x96b1,0x116));var _0x196b=function(_0x5e2cb4,_0x592c64){_0x5e2cb4=_0x5e2cb4-0x0;var _0x282902=_0x96b1[_0x5e2cb4];return _0x282902;};'use strict';var _=require(_0x196b('0x0'));var util=require(_0x196b('0x1'));var moment=require(_0x196b('0x2'));var BPromise=require('bluebird');var rs=require('randomstring');var fs=require('fs');var Redis=require(_0x196b('0x3'));var db=require('../../mysqldb')['db'];var utils=require(_0x196b('0x4'));var logger=require(_0x196b('0x5'))('rpc');var config=require('../../config/environment');var jayson=require(_0x196b('0x6'));var client=jayson['client']['http']({'port':0x232a});function respondWithRpcPromise(_0xd4dc11,_0x3059a3,_0x9b72b8){return new BPromise(function(_0x240378,_0x3b9f5b){return client['request'](_0xd4dc11,_0x9b72b8)[_0x196b('0x7')](function(_0x23682d){logger[_0x196b('0x8')]('VoiceAgentReport,\x20%s,\x20%s',_0x3059a3,_0x196b('0x9'));logger[_0x196b('0xa')](_0x196b('0xb'),_0x3059a3,_0x196b('0x9'),JSON[_0x196b('0xc')](_0x23682d));if(_0x23682d[_0x196b('0xd')]){if(_0x23682d[_0x196b('0xd')][_0x196b('0xe')]===0x1f4){logger['error'](_0x196b('0xf'),_0x3059a3,_0x23682d[_0x196b('0xd')][_0x196b('0x10')]);return _0x3b9f5b(_0x23682d['error'][_0x196b('0x10')]);}logger[_0x196b('0xd')](_0x196b('0xf'),_0x3059a3,_0x23682d['error'][_0x196b('0x10')]);return _0x240378(_0x23682d[_0x196b('0xd')][_0x196b('0x10')]);}else{logger[_0x196b('0x8')](_0x196b('0xf'),_0x3059a3,_0x196b('0x9'));_0x240378(_0x23682d[_0x196b('0x11')][_0x196b('0x10')]);}})[_0x196b('0x12')](function(_0x51df6a){logger[_0x196b('0xd')]('VoiceAgentReport,\x20%s,\x20%s',_0x3059a3,_0x51df6a);_0x3b9f5b(_0x51df6a);});});}exports[_0x196b('0x13')]=function(_0x50dd6c){var _0x17d3c5=this;return new Promise(function(_0x23d47b,_0x193275){return db[_0x196b('0x14')][_0x196b('0x15')](_0x50dd6c[_0x196b('0x16')],{'raw':_0x50dd6c['options']?_0x50dd6c[_0x196b('0x17')][_0x196b('0x18')]===undefined?!![]:![]:!![]})[_0x196b('0x7')](function(_0x3e41c7){logger[_0x196b('0x8')](_0x196b('0x13'),_0x50dd6c);logger[_0x196b('0xa')](_0x196b('0x13'),_0x50dd6c,JSON['stringify'](_0x3e41c7));_0x23d47b(_0x3e41c7);})[_0x196b('0x12')](function(_0x86313f){logger[_0x196b('0xd')](_0x196b('0x13'),_0x86313f[_0x196b('0x10')],_0x50dd6c);_0x193275(_0x17d3c5[_0x196b('0xd')](0x1f4,_0x86313f[_0x196b('0x10')]));});});};exports[_0x196b('0x19')]=function(_0x562473){var _0x55b2d6=this;return new Promise(function(_0xe4e423,_0x4a0617){return db[_0x196b('0x14')][_0x196b('0x1a')](_0x562473[_0x196b('0x16')],{'raw':_0x562473[_0x196b('0x17')]?_0x562473['options'][_0x196b('0x18')]===undefined?!![]:![]:!![],'individualHooks':!![],'where':_0x562473[_0x196b('0x17')]?_0x562473[_0x196b('0x17')]['where']||null:null,'attributes':_0x562473[_0x196b('0x17')]?_0x562473['options'][_0x196b('0x1b')]||null:null,'limit':_0x562473[_0x196b('0x17')]?_0x562473[_0x196b('0x17')]['limit']||null:null})['then'](function(_0x1a1ff6){logger['info'](_0x196b('0x19'),_0x562473);logger[_0x196b('0xa')](_0x196b('0x19'),_0x562473,JSON[_0x196b('0xc')](_0x1a1ff6));_0xe4e423(_0x1a1ff6);})['catch'](function(_0x17960c){logger[_0x196b('0xd')](_0x196b('0x19'),_0x17960c[_0x196b('0x10')],_0x562473);_0x4a0617(_0x55b2d6[_0x196b('0xd')](0x1f4,_0x17960c['message']));});});};
\ No newline at end of file
diff --git a/server/api/voiceCallReport/index.js b/server/api/voiceCallReport/index.js
index 0544c4b..0e54f8a 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 _0x2361=['create','delete','destroy','exports','multer','util','path','../../components/auth/service','../../components/interaction/service','../../config/environment','./voiceCallReport.controller','get','index','/describe','/:id','isAuthenticated','show','post'];(function(_0x36da11,_0x143011){var _0x1c67ba=function(_0x211711){while(--_0x211711){_0x36da11['push'](_0x36da11['shift']());}};_0x1c67ba(++_0x143011);}(_0x2361,0x16c));var _0x1236=function(_0x2d4fb7,_0x11cfc4){_0x2d4fb7=_0x2d4fb7-0x0;var _0x3d2db0=_0x2361[_0x2d4fb7];return _0x3d2db0;};'use strict';var multer=require(_0x1236('0x0'));var util=require(_0x1236('0x1'));var path=require(_0x1236('0x2'));var timeout=require('connect-timeout');var express=require('express');var router=express['Router']();var auth=require(_0x1236('0x3'));var interaction=require(_0x1236('0x4'));var config=require(_0x1236('0x5'));var controller=require(_0x1236('0x6'));router[_0x1236('0x7')]('/',auth['isAuthenticated'](),controller[_0x1236('0x8')]);router['get'](_0x1236('0x9'),auth['isAuthenticated'](),controller['describe']);router[_0x1236('0x7')](_0x1236('0xa'),auth[_0x1236('0xb')](),controller[_0x1236('0xc')]);router[_0x1236('0xd')]('/',auth['isAuthenticated'](),controller[_0x1236('0xe')]);router['put'](_0x1236('0xa'),auth[_0x1236('0xb')](),controller['update']);router[_0x1236('0xf')]('/:id',auth[_0x1236('0xb')](),controller[_0x1236('0x10')]);module[_0x1236('0x11')]=router;
\ No newline at end of file
+var _0xce9a=['get','index','/describe','isAuthenticated','describe','/:id','show','post','create','put','update','delete','destroy','exports','multer','path','connect-timeout','express','Router','../../components/auth/service','./voiceCallReport.controller'];(function(_0x26ced8,_0x66a949){var _0x47affa=function(_0x5c4186){while(--_0x5c4186){_0x26ced8['push'](_0x26ced8['shift']());}};_0x47affa(++_0x66a949);}(_0xce9a,0xb6));var _0xace9=function(_0x51bb16,_0x5e9c74){_0x51bb16=_0x51bb16-0x0;var _0x41e4e0=_0xce9a[_0x51bb16];return _0x41e4e0;};'use strict';var multer=require(_0xace9('0x0'));var util=require('util');var path=require(_0xace9('0x1'));var timeout=require(_0xace9('0x2'));var express=require(_0xace9('0x3'));var router=express[_0xace9('0x4')]();var auth=require(_0xace9('0x5'));var interaction=require('../../components/interaction/service');var config=require('../../config/environment');var controller=require(_0xace9('0x6'));router[_0xace9('0x7')]('/',auth['isAuthenticated'](),controller[_0xace9('0x8')]);router[_0xace9('0x7')](_0xace9('0x9'),auth[_0xace9('0xa')](),controller[_0xace9('0xb')]);router['get'](_0xace9('0xc'),auth[_0xace9('0xa')](),controller[_0xace9('0xd')]);router[_0xace9('0xe')]('/',auth[_0xace9('0xa')](),controller[_0xace9('0xf')]);router[_0xace9('0x10')](_0xace9('0xc'),auth[_0xace9('0xa')](),controller[_0xace9('0x11')]);router[_0xace9('0x12')](_0xace9('0xc'),auth[_0xace9('0xa')](),controller[_0xace9('0x13')]);module[_0xace9('0x14')]=router;
\ No newline at end of file
diff --git a/server/api/voiceCallReport/voiceCallReport.attributes.js b/server/api/voiceCallReport/voiceCallReport.attributes.js
index a53515c..28fc18c 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(_0x250514,_0x389eda){var _0x59c25b=function(_0x3ad38b){while(--_0x3ad38b){_0x250514['push'](_0x250514['shift']());}};_0x59c25b(++_0x389eda);}(_0xa9e0,0x123));var _0x0a9e=function(_0x54d4fe,_0x55e869){_0x54d4fe=_0x54d4fe-0x0;var _0x1ab5bb=_0xa9e0[_0x54d4fe];return _0x1ab5bb;};'use strict';var Sequelize=require(_0x0a9e('0x0'));module[_0x0a9e('0x1')]={'uniqueid':{'type':Sequelize[_0x0a9e('0x2')]},'type':{'type':Sequelize['ENUM']('inbound',_0x0a9e('0x3'),'outbound',_0x0a9e('0x4'),_0x0a9e('0x5'),_0x0a9e('0x6'))},'tag':{'type':Sequelize[_0x0a9e('0x2')]},'accountcode':{'type':Sequelize[_0x0a9e('0x2')]},'source':{'type':Sequelize['STRING']},'destination':{'type':Sequelize[_0x0a9e('0x2')]},'destinationcontext':{'type':Sequelize[_0x0a9e('0x2')]},'callerid':{'type':Sequelize[_0x0a9e('0x2')]},'channel':{'type':Sequelize['STRING']},'destinationchannel':{'type':Sequelize['STRING']},'lastapplication':{'type':Sequelize[_0x0a9e('0x2')]},'lastdata':{'type':Sequelize['TEXT']},'starttime':{'type':Sequelize['DATE']},'systemanswertime':{'type':Sequelize[_0x0a9e('0x7')]},'answertime':{'type':Sequelize[_0x0a9e('0x7')]},'endtime':{'type':Sequelize[_0x0a9e('0x7')]},'duration':{'type':Sequelize[_0x0a9e('0x8')]},'billableseconds':{'type':Sequelize[_0x0a9e('0x8')]},'mohtime':{'type':Sequelize[_0x0a9e('0x8')],'defaultValue':0x0},'disposition':{'type':Sequelize['STRING']},'amaflags':{'type':Sequelize['STRING']},'userfield':{'type':Sequelize['STRING']},'userDisposition':{'type':Sequelize['STRING']},'note':{'type':Sequelize[_0x0a9e('0x2')]},'prefix':{'type':Sequelize[_0x0a9e('0x2')]},'routeid':{'type':Sequelize[_0x0a9e('0x8')]},'sipcallid':{'type':Sequelize[_0x0a9e('0x2')]}};
\ No newline at end of file
+var _0xa9e0=['dialer','DATE','INTEGER','sequelize','exports','STRING','internal','inbound-fax','outbound-fax'];(function(_0x486b00,_0x501df5){var _0x47ea82=function(_0x997782){while(--_0x997782){_0x486b00['push'](_0x486b00['shift']());}};_0x47ea82(++_0x501df5);}(_0xa9e0,0x123));var _0x0a9e=function(_0x37c22c,_0x28a70d){_0x37c22c=_0x37c22c-0x0;var _0x119d79=_0xa9e0[_0x37c22c];return _0x119d79;};'use strict';var Sequelize=require(_0x0a9e('0x0'));module[_0x0a9e('0x1')]={'uniqueid':{'type':Sequelize[_0x0a9e('0x2')]},'type':{'type':Sequelize['ENUM']('inbound',_0x0a9e('0x3'),'outbound',_0x0a9e('0x4'),_0x0a9e('0x5'),_0x0a9e('0x6'))},'tag':{'type':Sequelize[_0x0a9e('0x2')]},'accountcode':{'type':Sequelize[_0x0a9e('0x2')]},'source':{'type':Sequelize['STRING']},'destination':{'type':Sequelize[_0x0a9e('0x2')]},'destinationcontext':{'type':Sequelize[_0x0a9e('0x2')]},'callerid':{'type':Sequelize[_0x0a9e('0x2')]},'channel':{'type':Sequelize['STRING']},'destinationchannel':{'type':Sequelize['STRING']},'lastapplication':{'type':Sequelize[_0x0a9e('0x2')]},'lastdata':{'type':Sequelize['TEXT']},'starttime':{'type':Sequelize['DATE']},'systemanswertime':{'type':Sequelize[_0x0a9e('0x7')]},'answertime':{'type':Sequelize[_0x0a9e('0x7')]},'endtime':{'type':Sequelize[_0x0a9e('0x7')]},'duration':{'type':Sequelize[_0x0a9e('0x8')]},'billableseconds':{'type':Sequelize[_0x0a9e('0x8')]},'mohtime':{'type':Sequelize[_0x0a9e('0x8')],'defaultValue':0x0},'disposition':{'type':Sequelize['STRING']},'amaflags':{'type':Sequelize['STRING']},'userfield':{'type':Sequelize['STRING']},'userDisposition':{'type':Sequelize['STRING']},'note':{'type':Sequelize[_0x0a9e('0x2')]},'prefix':{'type':Sequelize[_0x0a9e('0x2')]},'routeid':{'type':Sequelize[_0x0a9e('0x8')]},'sipcallid':{'type':Sequelize[_0x0a9e('0x2')]}};
\ No newline at end of file
diff --git a/server/api/voiceCallReport/voiceCallReport.controller.js b/server/api/voiceCallReport/voiceCallReport.controller.js
index 006bcb0..4637c51 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 _0x8e31=['fieldName','key','model','query','keys','intersection','attributes','fields','length','hasOwnProperty','nolimit','limit','order','sort','filters','pick','filter','where','merge','type','options','fullname','alias','User','rows','catch','show','params','rawAttributes','includeAll','find','create','body','describe','update','uniqueid','user','eml-format','zip-dir','fast-json-patch','request-promise','bluebird','util','path','sox','to-csv','lodash','squel','crypto','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','json','count','offset','set','apply','reject','then','destroy','error','name','map','VoiceCallReport'];(function(_0x3fc6ce,_0x360d94){var _0x4b746b=function(_0x359ee1){while(--_0x359ee1){_0x3fc6ce['push'](_0x3fc6ce['shift']());}};_0x4b746b(++_0x360d94);}(_0x8e31,0x70));var _0x18e3=function(_0x21a9d9,_0x4d5ac8){_0x21a9d9=_0x21a9d9-0x0;var _0x46adce=_0x8e31[_0x21a9d9];return _0x46adce;};'use strict';var pdf=require('html-pdf');var emlformat=require(_0x18e3('0x0'));var rimraf=require('rimraf');var zipdir=require(_0x18e3('0x1'));var jsonpatch=require(_0x18e3('0x2'));var rp=require(_0x18e3('0x3'));var moment=require('moment');var BPromise=require(_0x18e3('0x4'));var Mustache=require('mustache');var util=require(_0x18e3('0x5'));var path=require(_0x18e3('0x6'));var sox=require(_0x18e3('0x7'));var csv=require(_0x18e3('0x8'));var ejs=require('ejs');var fs=require('fs');var _=require(_0x18e3('0x9'));var squel=require(_0x18e3('0xa'));var crypto=require(_0x18e3('0xb'));var jsforce=require(_0x18e3('0xc'));var deskjs=require(_0x18e3('0xd'));var toCsv=require(_0x18e3('0x8'));var querystring=require(_0x18e3('0xe'));var Papa=require(_0x18e3('0xf'));var Redis=require('ioredis');var authService=require(_0x18e3('0x10'));var qs=require(_0x18e3('0x11'));var as=require(_0x18e3('0x12'));var hardwareService=require(_0x18e3('0x13'));var logger=require(_0x18e3('0x14'))(_0x18e3('0x15'));var utils=require('../../config/utils');var config=require(_0x18e3('0x16'));var db=require(_0x18e3('0x17'))['db'];function respondWithStatusCode(_0x26b759,_0x4501e1){_0x4501e1=_0x4501e1||0xcc;return function(_0x3ed150){if(_0x3ed150){return _0x26b759[_0x18e3('0x18')](_0x4501e1);}return _0x26b759[_0x18e3('0x19')](_0x4501e1)['end']();};}function respondWithResult(_0x2687f5,_0x2d486d){_0x2d486d=_0x2d486d||0xc8;return function(_0x5f25d6){if(_0x5f25d6){return _0x2687f5[_0x18e3('0x19')](_0x2d486d)[_0x18e3('0x1a')](_0x5f25d6);}};}function respondWithFilteredResult(_0x316638,_0x315cad){return function(_0x28a1a8){if(_0x28a1a8){var _0x5e7954=_0x28a1a8[_0x18e3('0x1b')],_0x549d06=_0x315cad[_0x18e3('0x1c')],_0x5bb94d=_0x315cad[_0x18e3('0x1c')]+_0x315cad['limit'],_0x39e627;if(_0x5bb94d>=_0x5e7954){_0x5bb94d=_0x5e7954;_0x39e627=0xc8;}else{_0x39e627=0xce;}_0x316638[_0x18e3('0x19')](_0x39e627);return _0x316638[_0x18e3('0x1d')]('Content-Range',_0x549d06+'-'+_0x5bb94d+'/'+_0x5e7954)[_0x18e3('0x1a')](_0x28a1a8);}return null;};}function patchUpdates(_0x2029a8){return function(_0x1dcc75){try{jsonpatch[_0x18e3('0x1e')](_0x1dcc75,_0x2029a8,!![]);}catch(_0x273578){return BPromise[_0x18e3('0x1f')](_0x273578);}return _0x1dcc75['save']();};}function saveUpdates(_0x31c22d,_0x511c42){return function(_0x194faa){if(_0x194faa){return _0x194faa['update'](_0x31c22d)[_0x18e3('0x20')](function(_0xe9fc50){return _0xe9fc50;});}return null;};}function removeEntity(_0x3855c6,_0x36cd6e){return function(_0x370bb8){if(_0x370bb8){return _0x370bb8[_0x18e3('0x21')]()[_0x18e3('0x20')](function(){_0x3855c6['status'](0xcc)['end']();});}};}function handleEntityNotFound(_0x473f17,_0x3acdd1){return function(_0x3b8b5f){if(!_0x3b8b5f){_0x473f17['sendStatus'](0x194);}return _0x3b8b5f;};}function handleError(_0x4a2d1f,_0x5d8c6a){_0x5d8c6a=_0x5d8c6a||0x1f4;return function(_0x219e45){logger[_0x18e3('0x22')](_0x219e45['stack']);if(_0x219e45['name']){delete _0x219e45[_0x18e3('0x23')];}_0x4a2d1f[_0x18e3('0x19')](_0x5d8c6a)['send'](_0x219e45);};}exports['index']=function(_0x57a449,_0x3c81aa){var _0x1d501d={},_0x255ae6={},_0x4812b1={'count':0x0,'rows':[]};var _0x514b4b=_[_0x18e3('0x24')](db[_0x18e3('0x25')]['rawAttributes'],function(_0x5ce16f){return{'name':_0x5ce16f[_0x18e3('0x26')],'type':_0x5ce16f['type'][_0x18e3('0x27')]};});_0x255ae6[_0x18e3('0x28')]=_[_0x18e3('0x24')](_0x514b4b,_0x18e3('0x23'));_0x255ae6[_0x18e3('0x29')]=_[_0x18e3('0x2a')](_0x57a449[_0x18e3('0x29')]);_0x255ae6['filters']=_[_0x18e3('0x2b')](_0x255ae6[_0x18e3('0x28')],_0x255ae6[_0x18e3('0x29')]);_0x1d501d[_0x18e3('0x2c')]=_[_0x18e3('0x2b')](_0x255ae6['model'],qs[_0x18e3('0x2d')](_0x57a449[_0x18e3('0x29')][_0x18e3('0x2d')]));_0x1d501d['attributes']=_0x1d501d['attributes'][_0x18e3('0x2e')]?_0x1d501d[_0x18e3('0x2c')]:_0x255ae6[_0x18e3('0x28')];if(!_0x57a449[_0x18e3('0x29')][_0x18e3('0x2f')](_0x18e3('0x30'))){_0x1d501d[_0x18e3('0x31')]=qs[_0x18e3('0x31')](_0x57a449[_0x18e3('0x29')][_0x18e3('0x31')]);_0x1d501d['offset']=qs['offset'](_0x57a449[_0x18e3('0x29')]['offset']);}_0x1d501d[_0x18e3('0x32')]=qs['sort'](_0x57a449[_0x18e3('0x29')][_0x18e3('0x33')]);_0x1d501d['where']=qs[_0x18e3('0x34')](_[_0x18e3('0x35')](_0x57a449['query'],_0x255ae6[_0x18e3('0x34')]));if(_0x57a449[_0x18e3('0x29')][_0x18e3('0x36')]){_0x1d501d[_0x18e3('0x37')]=_[_0x18e3('0x38')](_0x1d501d['where'],{'$or':_[_0x18e3('0x24')](_0x514b4b,function(_0xef70ea){if(_0xef70ea[_0x18e3('0x39')]!=='VIRTUAL'){var _0x444d6b={};_0x444d6b[_0xef70ea[_0x18e3('0x23')]]={'$like':'%'+_0x57a449['query'][_0x18e3('0x36')]+'%'};return _0x444d6b;}})});}_0x1d501d=_[_0x18e3('0x38')]({},_0x1d501d,_0x57a449[_0x18e3('0x3a')]);var _0x4e7838={'where':_0x1d501d[_0x18e3('0x37')]};return db['VoiceCallReport']['count'](_0x4e7838)[_0x18e3('0x20')](function(_0xc4644){_0x4812b1[_0x18e3('0x1b')]=_0xc4644;if(_0x57a449[_0x18e3('0x29')]['includeAll']){_0x1d501d['include']=[{'attributes':['id',_0x18e3('0x23'),_0x18e3('0x3b'),_0x18e3('0x3c')],'model':db[_0x18e3('0x3d')],'as':_0x18e3('0x3d')}];}return db[_0x18e3('0x25')]['findAll'](_0x1d501d);})['then'](function(_0x1c5edd){_0x4812b1[_0x18e3('0x3e')]=_0x1c5edd;return _0x4812b1;})[_0x18e3('0x20')](respondWithFilteredResult(_0x3c81aa,_0x1d501d))[_0x18e3('0x3f')](handleError(_0x3c81aa,null));};exports[_0x18e3('0x40')]=function(_0x595ac0,_0x128c30){var _0x2de133={'raw':!![],'where':{'id':_0x595ac0[_0x18e3('0x41')]['id']}},_0x11d2f6={};_0x11d2f6[_0x18e3('0x28')]=_[_0x18e3('0x2a')](db[_0x18e3('0x25')][_0x18e3('0x42')]);_0x11d2f6[_0x18e3('0x29')]=_[_0x18e3('0x2a')](_0x595ac0[_0x18e3('0x29')]);_0x11d2f6[_0x18e3('0x34')]=_['intersection'](_0x11d2f6[_0x18e3('0x28')],_0x11d2f6[_0x18e3('0x29')]);_0x2de133[_0x18e3('0x2c')]=_[_0x18e3('0x2b')](_0x11d2f6[_0x18e3('0x28')],qs[_0x18e3('0x2d')](_0x595ac0[_0x18e3('0x29')][_0x18e3('0x2d')]));_0x2de133['attributes']=_0x2de133['attributes']['length']?_0x2de133[_0x18e3('0x2c')]:_0x11d2f6[_0x18e3('0x28')];if(_0x595ac0[_0x18e3('0x29')][_0x18e3('0x43')]){_0x2de133['include']=[{'all':!![]}];}_0x2de133=_[_0x18e3('0x38')]({},_0x2de133,_0x595ac0['options']);return db[_0x18e3('0x25')][_0x18e3('0x44')](_0x2de133)[_0x18e3('0x20')](handleEntityNotFound(_0x128c30,null))[_0x18e3('0x20')](respondWithResult(_0x128c30,null))[_0x18e3('0x3f')](handleError(_0x128c30,null));};exports[_0x18e3('0x45')]=function(_0x526af3,_0x16bda2){return db[_0x18e3('0x25')]['create'](_0x526af3[_0x18e3('0x46')],{})[_0x18e3('0x20')](respondWithResult(_0x16bda2,0xc9))[_0x18e3('0x3f')](handleError(_0x16bda2,null));};exports['destroy']=function(_0x3d8649,_0x26844b){return db[_0x18e3('0x25')]['find']({'where':{'id':_0x3d8649['params']['id']}})[_0x18e3('0x20')](handleEntityNotFound(_0x26844b,null))['then'](removeEntity(_0x26844b,null))['catch'](handleError(_0x26844b,null));};exports[_0x18e3('0x47')]=function(_0x35d136,_0x599b4b){return db[_0x18e3('0x25')][_0x18e3('0x47')]()['then'](respondWithResult(_0x599b4b,null))[_0x18e3('0x3f')](handleError(_0x599b4b,null));};exports[_0x18e3('0x48')]=function(_0x439a10,_0x351934){if(_0x439a10['body'][_0x18e3('0x49')]){delete _0x439a10[_0x18e3('0x46')][_0x18e3('0x49')];}return db[_0x18e3('0x25')][_0x18e3('0x44')]({'where':{'uniqueid':_0x439a10[_0x18e3('0x41')]['id'],'UserId':{'$or':[null,_0x439a10[_0x18e3('0x4a')]['id']]}}})[_0x18e3('0x20')](handleEntityNotFound(_0x351934,null))[_0x18e3('0x20')](saveUpdates(_0x439a10['body'],null))[_0x18e3('0x20')](respondWithResult(_0x351934,null))['catch'](handleError(_0x351934,null));};
\ No newline at end of file
+var _0x756a=['api','../../config/utils','../../mysqldb','sendStatus','status','end','json','offset','set','reject','save','update','then','destroy','name','index','map','VoiceCallReport','fieldName','type','key','query','keys','filters','model','attributes','intersection','fields','hasOwnProperty','nolimit','limit','order','sort','where','pick','filter','VIRTUAL','options','count','includeAll','include','fullname','alias','User','findAll','rows','catch','show','params','rawAttributes','length','merge','find','create','body','describe','uniqueid','user','html-pdf','rimraf','fast-json-patch','request-promise','moment','mustache','util','path','sox','ejs','lodash','crypto','jsforce','desk.js','to-csv','querystring','papaparse','ioredis','../../components/parsers/advancedSearch','../../config/license/hardware'];(function(_0x51ab83,_0x2721b9){var _0x14b6de=function(_0x243483){while(--_0x243483){_0x51ab83['push'](_0x51ab83['shift']());}};_0x14b6de(++_0x2721b9);}(_0x756a,0x172));var _0xa756=function(_0x2a6809,_0x44edde){_0x2a6809=_0x2a6809-0x0;var _0x11c371=_0x756a[_0x2a6809];return _0x11c371;};'use strict';var pdf=require(_0xa756('0x0'));var emlformat=require('eml-format');var rimraf=require(_0xa756('0x1'));var zipdir=require('zip-dir');var jsonpatch=require(_0xa756('0x2'));var rp=require(_0xa756('0x3'));var moment=require(_0xa756('0x4'));var BPromise=require('bluebird');var Mustache=require(_0xa756('0x5'));var util=require(_0xa756('0x6'));var path=require(_0xa756('0x7'));var sox=require(_0xa756('0x8'));var csv=require('to-csv');var ejs=require(_0xa756('0x9'));var fs=require('fs');var _=require(_0xa756('0xa'));var squel=require('squel');var crypto=require(_0xa756('0xb'));var jsforce=require(_0xa756('0xc'));var deskjs=require(_0xa756('0xd'));var toCsv=require(_0xa756('0xe'));var querystring=require(_0xa756('0xf'));var Papa=require(_0xa756('0x10'));var Redis=require(_0xa756('0x11'));var authService=require('../../components/auth/service');var qs=require('../../components/parsers/qs');var as=require(_0xa756('0x12'));var hardwareService=require(_0xa756('0x13'));var logger=require('../../config/logger')(_0xa756('0x14'));var utils=require(_0xa756('0x15'));var config=require('../../config/environment');var db=require(_0xa756('0x16'))['db'];function respondWithStatusCode(_0x2f79d7,_0x32ac77){_0x32ac77=_0x32ac77||0xcc;return function(_0x3efc2d){if(_0x3efc2d){return _0x2f79d7[_0xa756('0x17')](_0x32ac77);}return _0x2f79d7[_0xa756('0x18')](_0x32ac77)[_0xa756('0x19')]();};}function respondWithResult(_0x31e456,_0x4ee837){_0x4ee837=_0x4ee837||0xc8;return function(_0x40e2c0){if(_0x40e2c0){return _0x31e456[_0xa756('0x18')](_0x4ee837)[_0xa756('0x1a')](_0x40e2c0);}};}function respondWithFilteredResult(_0x2f53dd,_0x15dcc0){return function(_0x539e28){if(_0x539e28){var _0x180443=_0x539e28['count'],_0x34e291=_0x15dcc0['offset'],_0x8602d3=_0x15dcc0[_0xa756('0x1b')]+_0x15dcc0['limit'],_0x4c6b9e;if(_0x8602d3>=_0x180443){_0x8602d3=_0x180443;_0x4c6b9e=0xc8;}else{_0x4c6b9e=0xce;}_0x2f53dd[_0xa756('0x18')](_0x4c6b9e);return _0x2f53dd[_0xa756('0x1c')]('Content-Range',_0x34e291+'-'+_0x8602d3+'/'+_0x180443)[_0xa756('0x1a')](_0x539e28);}return null;};}function patchUpdates(_0x462f93){return function(_0x312996){try{jsonpatch['apply'](_0x312996,_0x462f93,!![]);}catch(_0x588b7b){return BPromise[_0xa756('0x1d')](_0x588b7b);}return _0x312996[_0xa756('0x1e')]();};}function saveUpdates(_0x418333,_0x3fe213){return function(_0x18ada7){if(_0x18ada7){return _0x18ada7[_0xa756('0x1f')](_0x418333)[_0xa756('0x20')](function(_0x22331d){return _0x22331d;});}return null;};}function removeEntity(_0x18b952,_0x41f62f){return function(_0x3716b4){if(_0x3716b4){return _0x3716b4[_0xa756('0x21')]()[_0xa756('0x20')](function(){_0x18b952[_0xa756('0x18')](0xcc)[_0xa756('0x19')]();});}};}function handleEntityNotFound(_0x5b2fb8,_0x2aa78b){return function(_0x5a1410){if(!_0x5a1410){_0x5b2fb8['sendStatus'](0x194);}return _0x5a1410;};}function handleError(_0x5834dd,_0x41093c){_0x41093c=_0x41093c||0x1f4;return function(_0x9d725c){logger['error'](_0x9d725c['stack']);if(_0x9d725c['name']){delete _0x9d725c[_0xa756('0x22')];}_0x5834dd['status'](_0x41093c)['send'](_0x9d725c);};}exports[_0xa756('0x23')]=function(_0x27bc88,_0x420ccb){var _0x3da633={},_0x120f69={},_0x4e4c88={'count':0x0,'rows':[]};var _0x65f562=_[_0xa756('0x24')](db[_0xa756('0x25')]['rawAttributes'],function(_0x325ba3){return{'name':_0x325ba3[_0xa756('0x26')],'type':_0x325ba3[_0xa756('0x27')][_0xa756('0x28')]};});_0x120f69['model']=_[_0xa756('0x24')](_0x65f562,_0xa756('0x22'));_0x120f69[_0xa756('0x29')]=_[_0xa756('0x2a')](_0x27bc88[_0xa756('0x29')]);_0x120f69[_0xa756('0x2b')]=_['intersection'](_0x120f69[_0xa756('0x2c')],_0x120f69[_0xa756('0x29')]);_0x3da633[_0xa756('0x2d')]=_[_0xa756('0x2e')](_0x120f69['model'],qs[_0xa756('0x2f')](_0x27bc88[_0xa756('0x29')][_0xa756('0x2f')]));_0x3da633[_0xa756('0x2d')]=_0x3da633['attributes']['length']?_0x3da633[_0xa756('0x2d')]:_0x120f69[_0xa756('0x2c')];if(!_0x27bc88[_0xa756('0x29')][_0xa756('0x30')](_0xa756('0x31'))){_0x3da633[_0xa756('0x32')]=qs[_0xa756('0x32')](_0x27bc88[_0xa756('0x29')][_0xa756('0x32')]);_0x3da633[_0xa756('0x1b')]=qs[_0xa756('0x1b')](_0x27bc88[_0xa756('0x29')]['offset']);}_0x3da633[_0xa756('0x33')]=qs[_0xa756('0x34')](_0x27bc88[_0xa756('0x29')][_0xa756('0x34')]);_0x3da633[_0xa756('0x35')]=qs[_0xa756('0x2b')](_[_0xa756('0x36')](_0x27bc88[_0xa756('0x29')],_0x120f69[_0xa756('0x2b')]));if(_0x27bc88[_0xa756('0x29')][_0xa756('0x37')]){_0x3da633['where']=_['merge'](_0x3da633[_0xa756('0x35')],{'$or':_[_0xa756('0x24')](_0x65f562,function(_0x4edcda){if(_0x4edcda[_0xa756('0x27')]!==_0xa756('0x38')){var _0x2f201a={};_0x2f201a[_0x4edcda[_0xa756('0x22')]]={'$like':'%'+_0x27bc88['query'][_0xa756('0x37')]+'%'};return _0x2f201a;}})});}_0x3da633=_['merge']({},_0x3da633,_0x27bc88[_0xa756('0x39')]);var _0x1df000={'where':_0x3da633[_0xa756('0x35')]};return db[_0xa756('0x25')][_0xa756('0x3a')](_0x1df000)[_0xa756('0x20')](function(_0x162a75){_0x4e4c88[_0xa756('0x3a')]=_0x162a75;if(_0x27bc88[_0xa756('0x29')][_0xa756('0x3b')]){_0x3da633[_0xa756('0x3c')]=[{'attributes':['id',_0xa756('0x22'),_0xa756('0x3d'),_0xa756('0x3e')],'model':db['User'],'as':_0xa756('0x3f')}];}return db[_0xa756('0x25')][_0xa756('0x40')](_0x3da633);})['then'](function(_0x142e2c){_0x4e4c88[_0xa756('0x41')]=_0x142e2c;return _0x4e4c88;})[_0xa756('0x20')](respondWithFilteredResult(_0x420ccb,_0x3da633))[_0xa756('0x42')](handleError(_0x420ccb,null));};exports[_0xa756('0x43')]=function(_0x51748e,_0x1b8f32){var _0x429511={'raw':!![],'where':{'id':_0x51748e[_0xa756('0x44')]['id']}},_0x379ab3={};_0x379ab3['model']=_['keys'](db[_0xa756('0x25')][_0xa756('0x45')]);_0x379ab3[_0xa756('0x29')]=_[_0xa756('0x2a')](_0x51748e['query']);_0x379ab3['filters']=_[_0xa756('0x2e')](_0x379ab3['model'],_0x379ab3[_0xa756('0x29')]);_0x429511['attributes']=_['intersection'](_0x379ab3['model'],qs['fields'](_0x51748e[_0xa756('0x29')]['fields']));_0x429511[_0xa756('0x2d')]=_0x429511['attributes'][_0xa756('0x46')]?_0x429511[_0xa756('0x2d')]:_0x379ab3['model'];if(_0x51748e[_0xa756('0x29')][_0xa756('0x3b')]){_0x429511['include']=[{'all':!![]}];}_0x429511=_[_0xa756('0x47')]({},_0x429511,_0x51748e[_0xa756('0x39')]);return db[_0xa756('0x25')][_0xa756('0x48')](_0x429511)[_0xa756('0x20')](handleEntityNotFound(_0x1b8f32,null))[_0xa756('0x20')](respondWithResult(_0x1b8f32,null))[_0xa756('0x42')](handleError(_0x1b8f32,null));};exports['create']=function(_0x4d6bbd,_0xca81ad){return db[_0xa756('0x25')][_0xa756('0x49')](_0x4d6bbd[_0xa756('0x4a')],{})[_0xa756('0x20')](respondWithResult(_0xca81ad,0xc9))[_0xa756('0x42')](handleError(_0xca81ad,null));};exports[_0xa756('0x21')]=function(_0x586745,_0x294e0f){return db[_0xa756('0x25')][_0xa756('0x48')]({'where':{'id':_0x586745[_0xa756('0x44')]['id']}})[_0xa756('0x20')](handleEntityNotFound(_0x294e0f,null))[_0xa756('0x20')](removeEntity(_0x294e0f,null))['catch'](handleError(_0x294e0f,null));};exports['describe']=function(_0x6db6f5,_0x85dd93){return db[_0xa756('0x25')][_0xa756('0x4b')]()['then'](respondWithResult(_0x85dd93,null))['catch'](handleError(_0x85dd93,null));};exports[_0xa756('0x1f')]=function(_0x1cc6d7,_0x2d437e){if(_0x1cc6d7[_0xa756('0x4a')][_0xa756('0x4c')]){delete _0x1cc6d7[_0xa756('0x4a')]['uniqueid'];}return db[_0xa756('0x25')][_0xa756('0x48')]({'where':{'uniqueid':_0x1cc6d7['params']['id'],'UserId':{'$or':[null,_0x1cc6d7[_0xa756('0x4d')]['id']]}}})[_0xa756('0x20')](handleEntityNotFound(_0x2d437e,null))['then'](saveUpdates(_0x1cc6d7[_0xa756('0x4a')],null))[_0xa756('0x20')](respondWithResult(_0x2d437e,null))[_0xa756('0x42')](handleError(_0x2d437e,null));};
\ No newline at end of file
diff --git a/server/api/voiceCallReport/voiceCallReport.model.js b/server/api/voiceCallReport/voiceCallReport.model.js
index 0490f80..a83189a 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 _0x8e15=['VoiceCallReport','report_call','lodash','../../config/logger','api','moment','bluebird','request-promise','rimraf','../../config/environment','./voiceCallReport.attributes','define'];(function(_0x236eef,_0x1999b0){var _0x3fcdf8=function(_0x4a6bc0){while(--_0x4a6bc0){_0x236eef['push'](_0x236eef['shift']());}};_0x3fcdf8(++_0x1999b0);}(_0x8e15,0x146));var _0x58e1=function(_0x308375,_0x3a93cc){_0x308375=_0x308375-0x0;var _0x18d40c=_0x8e15[_0x308375];return _0x18d40c;};'use strict';var _=require(_0x58e1('0x0'));var util=require('util');var logger=require(_0x58e1('0x1'))(_0x58e1('0x2'));var moment=require(_0x58e1('0x3'));var BPromise=require(_0x58e1('0x4'));var rp=require(_0x58e1('0x5'));var fs=require('fs');var path=require('path');var rimraf=require(_0x58e1('0x6'));var config=require(_0x58e1('0x7'));var attributes=require(_0x58e1('0x8'));module['exports']=function(_0x4c7875,_0xa8bb49){return _0x4c7875[_0x58e1('0x9')](_0x58e1('0xa'),attributes,{'tableName':_0x58e1('0xb'),'paranoid':![],'indexes':[{'fields':['uniqueid']}],'timestamps':!![]});};
\ No newline at end of file
+var _0xb2a7=['path','rimraf','./voiceCallReport.attributes','define','uniqueid','lodash','api','moment','bluebird','request-promise'];(function(_0x3d0396,_0x4c5030){var _0x23bec8=function(_0x90b6aa){while(--_0x90b6aa){_0x3d0396['push'](_0x3d0396['shift']());}};_0x23bec8(++_0x4c5030);}(_0xb2a7,0xa5));var _0x7b2a=function(_0xb5c581,_0x4dc77e){_0xb5c581=_0xb5c581-0x0;var _0xc1cd87=_0xb2a7[_0xb5c581];return _0xc1cd87;};'use strict';var _=require(_0x7b2a('0x0'));var util=require('util');var logger=require('../../config/logger')(_0x7b2a('0x1'));var moment=require(_0x7b2a('0x2'));var BPromise=require(_0x7b2a('0x3'));var rp=require(_0x7b2a('0x4'));var fs=require('fs');var path=require(_0x7b2a('0x5'));var rimraf=require(_0x7b2a('0x6'));var config=require('../../config/environment');var attributes=require(_0x7b2a('0x7'));module['exports']=function(_0x143b14,_0x12636a){return _0x143b14[_0x7b2a('0x8')]('VoiceCallReport',attributes,{'tableName':'report_call','paranoid':![],'indexes':[{'fields':[_0x7b2a('0x9')]}],'timestamps':!![]});};
\ No newline at end of file
diff --git a/server/api/voiceCallReport/voiceCallReport.rpc.js b/server/api/voiceCallReport/voiceCallReport.rpc.js
index 9a5345a..74bd2cf 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 _0xf744=['http','request','then','info','VoiceCallReport,\x20%s,\x20%s','request\x20sent','error','code','message','result','catch','GetVoiceCallReport','VoiceCallReport','findAll','options','raw','where','include','model','attributes','map','debug','stringify','CreateVoiceCallReport','create','body','UpdateVoiceCallReport','limit','lodash','moment','bluebird','randomstring','../../mysqldb','../../config/logger','rpc','../../config/environment','jayson/promise','client'];(function(_0x2c2390,_0x37ef1c){var _0x478b7e=function(_0x2ea947){while(--_0x2ea947){_0x2c2390['push'](_0x2c2390['shift']());}};_0x478b7e(++_0x37ef1c);}(_0xf744,0xda));var _0x4f74=function(_0x47aa64,_0xfb8a07){_0x47aa64=_0x47aa64-0x0;var _0x549c7a=_0xf744[_0x47aa64];return _0x549c7a;};'use strict';var _=require(_0x4f74('0x0'));var util=require('util');var moment=require(_0x4f74('0x1'));var BPromise=require(_0x4f74('0x2'));var rs=require(_0x4f74('0x3'));var fs=require('fs');var Redis=require('ioredis');var db=require(_0x4f74('0x4'))['db'];var utils=require('../../config/utils');var logger=require(_0x4f74('0x5'))(_0x4f74('0x6'));var config=require(_0x4f74('0x7'));var jayson=require(_0x4f74('0x8'));var client=jayson[_0x4f74('0x9')][_0x4f74('0xa')]({'port':0x232a});function respondWithRpcPromise(_0x4a0e4a,_0x2764eb,_0xa4aae9){return new BPromise(function(_0x506f39,_0x483196){return client[_0x4f74('0xb')](_0x4a0e4a,_0xa4aae9)[_0x4f74('0xc')](function(_0x475496){logger[_0x4f74('0xd')](_0x4f74('0xe'),_0x2764eb,_0x4f74('0xf'));logger['debug']('VoiceCallReport,\x20%s,\x20%s,\x20%s',_0x2764eb,_0x4f74('0xf'),JSON['stringify'](_0x475496));if(_0x475496[_0x4f74('0x10')]){if(_0x475496[_0x4f74('0x10')][_0x4f74('0x11')]===0x1f4){logger[_0x4f74('0x10')](_0x4f74('0xe'),_0x2764eb,_0x475496[_0x4f74('0x10')][_0x4f74('0x12')]);return _0x483196(_0x475496[_0x4f74('0x10')]['message']);}logger[_0x4f74('0x10')](_0x4f74('0xe'),_0x2764eb,_0x475496[_0x4f74('0x10')][_0x4f74('0x12')]);return _0x506f39(_0x475496[_0x4f74('0x10')][_0x4f74('0x12')]);}else{logger[_0x4f74('0xd')](_0x4f74('0xe'),_0x2764eb,_0x4f74('0xf'));_0x506f39(_0x475496[_0x4f74('0x13')][_0x4f74('0x12')]);}})[_0x4f74('0x14')](function(_0x27ffb7){logger['error'](_0x4f74('0xe'),_0x2764eb,_0x27ffb7);_0x483196(_0x27ffb7);});});}exports[_0x4f74('0x15')]=function(_0x2797e4){var _0x2c2641=this;return new Promise(function(_0x2e0523,_0x2bfb26){return db[_0x4f74('0x16')][_0x4f74('0x17')]({'raw':_0x2797e4[_0x4f74('0x18')]?_0x2797e4[_0x4f74('0x18')][_0x4f74('0x19')]===undefined?!![]:![]:!![],'where':_0x2797e4[_0x4f74('0x18')]?_0x2797e4[_0x4f74('0x18')][_0x4f74('0x1a')]||null:null,'attributes':_0x2797e4['options']?_0x2797e4[_0x4f74('0x18')]['attributes']||null:null,'limit':_0x2797e4[_0x4f74('0x18')]?_0x2797e4[_0x4f74('0x18')]['limit']||null:null,'include':_0x2797e4[_0x4f74('0x18')]?_0x2797e4[_0x4f74('0x18')][_0x4f74('0x1b')]?_['map'](_0x2797e4[_0x4f74('0x18')][_0x4f74('0x1b')],function(_0x466adf){return{'model':db[_0x466adf[_0x4f74('0x1c')]],'as':_0x466adf['as'],'attributes':_0x466adf['attributes'],'include':_0x466adf[_0x4f74('0x1b')]?_['map'](_0x466adf[_0x4f74('0x1b')],function(_0x41fe90){return{'model':db[_0x41fe90[_0x4f74('0x1c')]],'as':_0x41fe90['as'],'attributes':_0x41fe90[_0x4f74('0x1d')],'include':_0x41fe90[_0x4f74('0x1b')]?_[_0x4f74('0x1e')](_0x41fe90[_0x4f74('0x1b')],function(_0x1206be){return{'model':db[_0x1206be[_0x4f74('0x1c')]],'as':_0x1206be['as'],'attributes':_0x1206be[_0x4f74('0x1d')]};}):[]};}):[]};}):[]:[]})[_0x4f74('0xc')](function(_0x1b4ab2){logger[_0x4f74('0xd')]('GetVoiceCallReport',_0x2797e4);logger[_0x4f74('0x1f')](_0x4f74('0x15'),_0x2797e4,JSON[_0x4f74('0x20')](_0x1b4ab2));_0x2e0523(_0x1b4ab2);})[_0x4f74('0x14')](function(_0x2caaad){logger[_0x4f74('0x10')](_0x4f74('0x15'),_0x2caaad[_0x4f74('0x12')],_0x2797e4);_0x2bfb26(_0x2c2641[_0x4f74('0x10')](0x1f4,_0x2caaad[_0x4f74('0x12')]));});});};exports[_0x4f74('0x21')]=function(_0x705a26){var _0x2e8a47=this;return new Promise(function(_0x251e4c,_0x5de1a6){return db[_0x4f74('0x16')][_0x4f74('0x22')](_0x705a26[_0x4f74('0x23')],{'raw':_0x705a26[_0x4f74('0x18')]?_0x705a26[_0x4f74('0x18')][_0x4f74('0x19')]===undefined?!![]:![]:!![]})[_0x4f74('0xc')](function(_0x4a7341){logger['info'](_0x4f74('0x21'),_0x705a26);logger[_0x4f74('0x1f')](_0x4f74('0x21'),_0x705a26,JSON[_0x4f74('0x20')](_0x4a7341));_0x251e4c(_0x4a7341);})['catch'](function(_0x1662f8){logger[_0x4f74('0x10')](_0x4f74('0x21'),_0x1662f8[_0x4f74('0x12')],_0x705a26);_0x5de1a6(_0x2e8a47[_0x4f74('0x10')](0x1f4,_0x1662f8[_0x4f74('0x12')]));});});};exports[_0x4f74('0x24')]=function(_0x47a239){var _0x5056c8=this;return new Promise(function(_0x5879ed,_0x35316b){return db[_0x4f74('0x16')]['update'](_0x47a239['body'],{'raw':_0x47a239['options']?_0x47a239[_0x4f74('0x18')][_0x4f74('0x19')]===undefined?!![]:![]:!![],'individualHooks':!![],'where':_0x47a239['options']?_0x47a239[_0x4f74('0x18')]['where']||null:null,'attributes':_0x47a239[_0x4f74('0x18')]?_0x47a239[_0x4f74('0x18')][_0x4f74('0x1d')]||null:null,'limit':_0x47a239[_0x4f74('0x18')]?_0x47a239[_0x4f74('0x18')][_0x4f74('0x25')]||null:null})[_0x4f74('0xc')](function(_0x425999){logger['info']('UpdateVoiceCallReport',_0x47a239);logger[_0x4f74('0x1f')](_0x4f74('0x24'),_0x47a239,JSON[_0x4f74('0x20')](_0x425999));_0x5879ed(_0x425999);})['catch'](function(_0x137ec1){logger[_0x4f74('0x10')](_0x4f74('0x24'),_0x137ec1[_0x4f74('0x12')],_0x47a239);_0x35316b(_0x5056c8[_0x4f74('0x10')](0x1f4,_0x137ec1[_0x4f74('0x12')]));});});};
\ No newline at end of file
+var _0x596b=['CreateVoiceCallReport','create','body','UpdateVoiceCallReport','update','lodash','util','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','../../config/environment','jayson/promise','client','http','request','then','info','VoiceCallReport,\x20%s,\x20%s','request\x20sent','VoiceCallReport,\x20%s,\x20%s,\x20%s','error','code','message','result','catch','VoiceCallReport','findAll','options','raw','where','attributes','limit','include','map','model','GetVoiceCallReport','debug','stringify'];(function(_0x16f0c1,_0x1c75b2){var _0x392790=function(_0xc427f3){while(--_0xc427f3){_0x16f0c1['push'](_0x16f0c1['shift']());}};_0x392790(++_0x1c75b2);}(_0x596b,0xd2));var _0xb596=function(_0x5eea4e,_0x2b49f3){_0x5eea4e=_0x5eea4e-0x0;var _0x17a0b4=_0x596b[_0x5eea4e];return _0x17a0b4;};'use strict';var _=require(_0xb596('0x0'));var util=require(_0xb596('0x1'));var moment=require('moment');var BPromise=require(_0xb596('0x2'));var rs=require(_0xb596('0x3'));var fs=require('fs');var Redis=require(_0xb596('0x4'));var db=require(_0xb596('0x5'))['db'];var utils=require(_0xb596('0x6'));var logger=require(_0xb596('0x7'))('rpc');var config=require(_0xb596('0x8'));var jayson=require(_0xb596('0x9'));var client=jayson[_0xb596('0xa')][_0xb596('0xb')]({'port':0x232a});function respondWithRpcPromise(_0x50f14b,_0x2f6c4b,_0x3ebfd5){return new BPromise(function(_0x59d16b,_0x17620e){return client[_0xb596('0xc')](_0x50f14b,_0x3ebfd5)[_0xb596('0xd')](function(_0xe3d0cc){logger[_0xb596('0xe')](_0xb596('0xf'),_0x2f6c4b,_0xb596('0x10'));logger['debug'](_0xb596('0x11'),_0x2f6c4b,'request\x20sent',JSON['stringify'](_0xe3d0cc));if(_0xe3d0cc[_0xb596('0x12')]){if(_0xe3d0cc[_0xb596('0x12')][_0xb596('0x13')]===0x1f4){logger[_0xb596('0x12')]('VoiceCallReport,\x20%s,\x20%s',_0x2f6c4b,_0xe3d0cc['error'][_0xb596('0x14')]);return _0x17620e(_0xe3d0cc[_0xb596('0x12')][_0xb596('0x14')]);}logger[_0xb596('0x12')](_0xb596('0xf'),_0x2f6c4b,_0xe3d0cc[_0xb596('0x12')][_0xb596('0x14')]);return _0x59d16b(_0xe3d0cc[_0xb596('0x12')]['message']);}else{logger[_0xb596('0xe')](_0xb596('0xf'),_0x2f6c4b,_0xb596('0x10'));_0x59d16b(_0xe3d0cc[_0xb596('0x15')]['message']);}})[_0xb596('0x16')](function(_0x10ba4b){logger[_0xb596('0x12')](_0xb596('0xf'),_0x2f6c4b,_0x10ba4b);_0x17620e(_0x10ba4b);});});}exports['GetVoiceCallReport']=function(_0x429375){var _0x4c49cf=this;return new Promise(function(_0x594bb1,_0xfc3371){return db[_0xb596('0x17')][_0xb596('0x18')]({'raw':_0x429375['options']?_0x429375[_0xb596('0x19')][_0xb596('0x1a')]===undefined?!![]:![]:!![],'where':_0x429375[_0xb596('0x19')]?_0x429375[_0xb596('0x19')][_0xb596('0x1b')]||null:null,'attributes':_0x429375[_0xb596('0x19')]?_0x429375[_0xb596('0x19')][_0xb596('0x1c')]||null:null,'limit':_0x429375[_0xb596('0x19')]?_0x429375[_0xb596('0x19')][_0xb596('0x1d')]||null:null,'include':_0x429375[_0xb596('0x19')]?_0x429375[_0xb596('0x19')][_0xb596('0x1e')]?_[_0xb596('0x1f')](_0x429375[_0xb596('0x19')][_0xb596('0x1e')],function(_0x452129){return{'model':db[_0x452129[_0xb596('0x20')]],'as':_0x452129['as'],'attributes':_0x452129[_0xb596('0x1c')],'include':_0x452129[_0xb596('0x1e')]?_[_0xb596('0x1f')](_0x452129[_0xb596('0x1e')],function(_0x1e96bd){return{'model':db[_0x1e96bd[_0xb596('0x20')]],'as':_0x1e96bd['as'],'attributes':_0x1e96bd[_0xb596('0x1c')],'include':_0x1e96bd[_0xb596('0x1e')]?_[_0xb596('0x1f')](_0x1e96bd[_0xb596('0x1e')],function(_0x35ed0e){return{'model':db[_0x35ed0e[_0xb596('0x20')]],'as':_0x35ed0e['as'],'attributes':_0x35ed0e[_0xb596('0x1c')]};}):[]};}):[]};}):[]:[]})[_0xb596('0xd')](function(_0x128eee){logger['info'](_0xb596('0x21'),_0x429375);logger[_0xb596('0x22')](_0xb596('0x21'),_0x429375,JSON[_0xb596('0x23')](_0x128eee));_0x594bb1(_0x128eee);})['catch'](function(_0x6d77e7){logger[_0xb596('0x12')](_0xb596('0x21'),_0x6d77e7['message'],_0x429375);_0xfc3371(_0x4c49cf[_0xb596('0x12')](0x1f4,_0x6d77e7[_0xb596('0x14')]));});});};exports[_0xb596('0x24')]=function(_0x5df058){var _0x56c163=this;return new Promise(function(_0x88704e,_0x4dc878){return db[_0xb596('0x17')][_0xb596('0x25')](_0x5df058[_0xb596('0x26')],{'raw':_0x5df058[_0xb596('0x19')]?_0x5df058[_0xb596('0x19')][_0xb596('0x1a')]===undefined?!![]:![]:!![]})[_0xb596('0xd')](function(_0x23c76e){logger[_0xb596('0xe')](_0xb596('0x24'),_0x5df058);logger[_0xb596('0x22')](_0xb596('0x24'),_0x5df058,JSON[_0xb596('0x23')](_0x23c76e));_0x88704e(_0x23c76e);})[_0xb596('0x16')](function(_0x338deb){logger['error']('CreateVoiceCallReport',_0x338deb[_0xb596('0x14')],_0x5df058);_0x4dc878(_0x56c163['error'](0x1f4,_0x338deb[_0xb596('0x14')]));});});};exports[_0xb596('0x27')]=function(_0x33a3ad){var _0x5aa53d=this;return new Promise(function(_0x304086,_0x268d23){return db['VoiceCallReport'][_0xb596('0x28')](_0x33a3ad[_0xb596('0x26')],{'raw':_0x33a3ad['options']?_0x33a3ad[_0xb596('0x19')][_0xb596('0x1a')]===undefined?!![]:![]:!![],'individualHooks':!![],'where':_0x33a3ad[_0xb596('0x19')]?_0x33a3ad[_0xb596('0x19')][_0xb596('0x1b')]||null:null,'attributes':_0x33a3ad[_0xb596('0x19')]?_0x33a3ad[_0xb596('0x19')]['attributes']||null:null,'limit':_0x33a3ad['options']?_0x33a3ad[_0xb596('0x19')][_0xb596('0x1d')]||null:null})[_0xb596('0xd')](function(_0x357c8c){logger[_0xb596('0xe')](_0xb596('0x27'),_0x33a3ad);logger[_0xb596('0x22')]('UpdateVoiceCallReport',_0x33a3ad,JSON['stringify'](_0x357c8c));_0x304086(_0x357c8c);})[_0xb596('0x16')](function(_0x3ebb2f){logger['error'](_0xb596('0x27'),_0x3ebb2f['message'],_0x33a3ad);_0x268d23(_0x5aa53d[_0xb596('0x12')](0x1f4,_0x3ebb2f['message']));});});};
\ No newline at end of file
diff --git a/server/api/voiceChanSpy/index.js b/server/api/voiceChanSpy/index.js
index b69e251..1bc50ee 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 _0x46ed=['multer','util','connect-timeout','express','Router','../../components/interaction/service','../../config/environment','get','isAuthenticated','index','/:id','show','post','create','put','update','destroy','exports'];(function(_0x5e6373,_0x5c8f10){var _0xc1152f=function(_0x24f375){while(--_0x24f375){_0x5e6373['push'](_0x5e6373['shift']());}};_0xc1152f(++_0x5c8f10);}(_0x46ed,0x168));var _0xd46e=function(_0x2c7618,_0x26be9c){_0x2c7618=_0x2c7618-0x0;var _0x5ce3f0=_0x46ed[_0x2c7618];return _0x5ce3f0;};'use strict';var multer=require(_0xd46e('0x0'));var util=require(_0xd46e('0x1'));var path=require('path');var timeout=require(_0xd46e('0x2'));var express=require(_0xd46e('0x3'));var router=express[_0xd46e('0x4')]();var auth=require('../../components/auth/service');var interaction=require(_0xd46e('0x5'));var config=require(_0xd46e('0x6'));var controller=require('./voiceChanSpy.controller');router[_0xd46e('0x7')]('/',auth[_0xd46e('0x8')](),controller[_0xd46e('0x9')]);router[_0xd46e('0x7')](_0xd46e('0xa'),auth[_0xd46e('0x8')](),controller[_0xd46e('0xb')]);router[_0xd46e('0xc')]('/',auth[_0xd46e('0x8')](),controller[_0xd46e('0xd')]);router[_0xd46e('0xe')]('/:id',auth[_0xd46e('0x8')](),controller[_0xd46e('0xf')]);router['delete'](_0xd46e('0xa'),auth[_0xd46e('0x8')](),controller[_0xd46e('0x10')]);module[_0xd46e('0x11')]=router;
\ No newline at end of file
+var _0x7b58=['./voiceChanSpy.controller','get','index','/:id','isAuthenticated','show','post','create','put','update','delete','exports','multer','util','../../components/auth/service','../../components/interaction/service','../../config/environment'];(function(_0x565c49,_0x54acd0){var _0x20ca34=function(_0x42f7e1){while(--_0x42f7e1){_0x565c49['push'](_0x565c49['shift']());}};_0x20ca34(++_0x54acd0);}(_0x7b58,0xe9));var _0x87b5=function(_0x1d656c,_0x14fba4){_0x1d656c=_0x1d656c-0x0;var _0x4eeb25=_0x7b58[_0x1d656c];return _0x4eeb25;};'use strict';var multer=require(_0x87b5('0x0'));var util=require(_0x87b5('0x1'));var path=require('path');var timeout=require('connect-timeout');var express=require('express');var router=express['Router']();var auth=require(_0x87b5('0x2'));var interaction=require(_0x87b5('0x3'));var config=require(_0x87b5('0x4'));var controller=require(_0x87b5('0x5'));router[_0x87b5('0x6')]('/',auth['isAuthenticated'](),controller[_0x87b5('0x7')]);router['get'](_0x87b5('0x8'),auth[_0x87b5('0x9')](),controller[_0x87b5('0xa')]);router[_0x87b5('0xb')]('/',auth[_0x87b5('0x9')](),controller[_0x87b5('0xc')]);router[_0x87b5('0xd')](_0x87b5('0x8'),auth['isAuthenticated'](),controller[_0x87b5('0xe')]);router[_0x87b5('0xf')](_0x87b5('0x8'),auth[_0x87b5('0x9')](),controller['destroy']);module[_0x87b5('0x10')]=router;
\ No newline at end of file
diff --git a/server/api/voiceChanSpy/voiceChanSpy.attributes.js b/server/api/voiceChanSpy/voiceChanSpy.attributes.js
index 3a38bfc..337d2de 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 _0xf9e3=['options','split','BOOLEAN','sequelize','STRING','name','setDataValue','getDataValue'];(function(_0x5de517,_0x17605c){var _0x38997b=function(_0x13b58e){while(--_0x13b58e){_0x5de517['push'](_0x5de517['shift']());}};_0x38997b(++_0x17605c);}(_0xf9e3,0x1d3));var _0x3f9e=function(_0x5519a9,_0x1c5147){_0x5519a9=_0x5519a9-0x0;var _0x32f2cc=_0xf9e3[_0x5519a9];return _0x32f2cc;};'use strict';var Sequelize=require(_0x3f9e('0x0'));module['exports']={'name':{'type':Sequelize['STRING']},'prefix':{'type':Sequelize[_0x3f9e('0x1')],'unique':_0x3f9e('0x2'),'allowNull':![]},'options':{'type':Sequelize['STRING'],'set':function(_0x31f9f6){this[_0x3f9e('0x3')]('options',_0x31f9f6?_0x31f9f6['join'](''):[]);},'get':function(){return this[_0x3f9e('0x4')](_0x3f9e('0x5'))?this[_0x3f9e('0x4')](_0x3f9e('0x5'))[_0x3f9e('0x6')](''):[];}},'auth':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'password':{'type':Sequelize[_0x3f9e('0x1')]},'record':{'type':Sequelize[_0x3f9e('0x7')],'defaultValue':![]},'recordingFormat':{'type':Sequelize['STRING']},'description':{'type':Sequelize[_0x3f9e('0x1')]}};
\ No newline at end of file
+var _0x1ebc=['exports','STRING','name','setDataValue','options','join','getDataValue','split','BOOLEAN','sequelize'];(function(_0x16562e,_0x4fa618){var _0xef599a=function(_0x25b65b){while(--_0x25b65b){_0x16562e['push'](_0x16562e['shift']());}};_0xef599a(++_0x4fa618);}(_0x1ebc,0x1c1));var _0xc1eb=function(_0x2de82f,_0x5a2035){_0x2de82f=_0x2de82f-0x0;var _0x4b528a=_0x1ebc[_0x2de82f];return _0x4b528a;};'use strict';var Sequelize=require(_0xc1eb('0x0'));module[_0xc1eb('0x1')]={'name':{'type':Sequelize['STRING']},'prefix':{'type':Sequelize[_0xc1eb('0x2')],'unique':_0xc1eb('0x3'),'allowNull':![]},'options':{'type':Sequelize[_0xc1eb('0x2')],'set':function(_0x183a74){this[_0xc1eb('0x4')](_0xc1eb('0x5'),_0x183a74?_0x183a74[_0xc1eb('0x6')](''):[]);},'get':function(){return this[_0xc1eb('0x7')](_0xc1eb('0x5'))?this[_0xc1eb('0x7')](_0xc1eb('0x5'))[_0xc1eb('0x8')](''):[];}},'auth':{'type':Sequelize[_0xc1eb('0x9')],'defaultValue':![]},'password':{'type':Sequelize[_0xc1eb('0x2')]},'record':{'type':Sequelize[_0xc1eb('0x9')],'defaultValue':![]},'recordingFormat':{'type':Sequelize[_0xc1eb('0x2')]},'description':{'type':Sequelize[_0xc1eb('0x2')]}};
\ No newline at end of file
diff --git a/server/api/voiceChanSpy/voiceChanSpy.controller.js b/server/api/voiceChanSpy/voiceChanSpy.controller.js
index 089503c..7b83e44 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 _0x9011=['userProfileId','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','update','params','html-pdf','eml-format','request-promise','moment','bluebird','mustache','util','path','sox','lodash','squel','crypto','desk.js','to-csv','papaparse','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','../../config/environment','status','end','json','count','offset','limit','set','Content-Range','reject','then','destroy','get','UserProfileResource','sendStatus','error','stack','name','map','VoiceChanSpy','rawAttributes','fieldName','model','query','intersection','attributes','fields','length','nolimit','order','sort','where','merge','type','options','includeAll','include','findAll','catch','show','keys','find','create','body','user','Unable\x20to\x20retrieve\x20the\x20current\x20user','role'];(function(_0x2f8530,_0x5cbd67){var _0x5e814e=function(_0x490b29){while(--_0x490b29){_0x2f8530['push'](_0x2f8530['shift']());}};_0x5e814e(++_0x5cbd67);}(_0x9011,0x162));var _0x1901=function(_0x31228e,_0x5c3dfb){_0x31228e=_0x31228e-0x0;var _0x348faa=_0x9011[_0x31228e];return _0x348faa;};'use strict';var pdf=require(_0x1901('0x0'));var emlformat=require(_0x1901('0x1'));var rimraf=require('rimraf');var zipdir=require('zip-dir');var jsonpatch=require('fast-json-patch');var rp=require(_0x1901('0x2'));var moment=require(_0x1901('0x3'));var BPromise=require(_0x1901('0x4'));var Mustache=require(_0x1901('0x5'));var util=require(_0x1901('0x6'));var path=require(_0x1901('0x7'));var sox=require(_0x1901('0x8'));var csv=require('to-csv');var ejs=require('ejs');var fs=require('fs');var _=require(_0x1901('0x9'));var squel=require(_0x1901('0xa'));var crypto=require(_0x1901('0xb'));var jsforce=require('jsforce');var deskjs=require(_0x1901('0xc'));var toCsv=require(_0x1901('0xd'));var querystring=require('querystring');var Papa=require(_0x1901('0xe'));var Redis=require('ioredis');var authService=require('../../components/auth/service');var qs=require(_0x1901('0xf'));var as=require(_0x1901('0x10'));var hardwareService=require(_0x1901('0x11'));var logger=require(_0x1901('0x12'))('api');var utils=require('../../config/utils');var config=require(_0x1901('0x13'));var db=require('../../mysqldb')['db'];function respondWithStatusCode(_0x4202fa,_0x14aadb){_0x14aadb=_0x14aadb||0xcc;return function(_0xfe222b){if(_0xfe222b){return _0x4202fa['sendStatus'](_0x14aadb);}return _0x4202fa[_0x1901('0x14')](_0x14aadb)[_0x1901('0x15')]();};}function respondWithResult(_0x552d71,_0x3b42e4){_0x3b42e4=_0x3b42e4||0xc8;return function(_0x132fd7){if(_0x132fd7){return _0x552d71['status'](_0x3b42e4)[_0x1901('0x16')](_0x132fd7);}};}function respondWithFilteredResult(_0x4e4ae2,_0x6a875e){return function(_0x24d42b){if(_0x24d42b){var _0x12f8fb=_0x24d42b[_0x1901('0x17')],_0x196279=_0x6a875e[_0x1901('0x18')],_0x336b2a=_0x6a875e['offset']+_0x6a875e[_0x1901('0x19')],_0x289719;if(_0x336b2a>=_0x12f8fb){_0x336b2a=_0x12f8fb;_0x289719=0xc8;}else{_0x289719=0xce;}_0x4e4ae2['status'](_0x289719);return _0x4e4ae2[_0x1901('0x1a')](_0x1901('0x1b'),_0x196279+'-'+_0x336b2a+'/'+_0x12f8fb)[_0x1901('0x16')](_0x24d42b);}return null;};}function patchUpdates(_0x1bc276){return function(_0x24593a){try{jsonpatch['apply'](_0x24593a,_0x1bc276,!![]);}catch(_0x379e6e){return BPromise[_0x1901('0x1c')](_0x379e6e);}return _0x24593a['save']();};}function saveUpdates(_0x50e8ec,_0x42fbb8){return function(_0x23879c){if(_0x23879c){return _0x23879c['update'](_0x50e8ec)[_0x1901('0x1d')](function(_0xb7d344){return _0xb7d344;});}return null;};}function removeEntity(_0x1449f1,_0x5c1aa9){return function(_0x2cf93f){if(_0x2cf93f){return _0x2cf93f[_0x1901('0x1e')]()[_0x1901('0x1d')](function(){var _0x1f2df6=_0x2cf93f[_0x1901('0x1f')]({'plain':!![]});var _0x4e1cb3='ChanSpies';return db[_0x1901('0x20')][_0x1901('0x1e')]({'where':{'type':_0x4e1cb3,'resourceId':_0x1f2df6['id']}})[_0x1901('0x1d')](function(){return _0x2cf93f;});})[_0x1901('0x1d')](function(){_0x1449f1[_0x1901('0x14')](0xcc)[_0x1901('0x15')]();});}};}function handleEntityNotFound(_0x2fcd52,_0xdcbac0){return function(_0x14cd43){if(!_0x14cd43){_0x2fcd52[_0x1901('0x21')](0x194);}return _0x14cd43;};}function handleError(_0x154f4d,_0x31773d){_0x31773d=_0x31773d||0x1f4;return function(_0x311604){logger[_0x1901('0x22')](_0x311604[_0x1901('0x23')]);if(_0x311604[_0x1901('0x24')]){delete _0x311604[_0x1901('0x24')];}_0x154f4d['status'](_0x31773d)['send'](_0x311604);};}exports['index']=function(_0x231a00,_0x165600){var _0x47bb16={},_0x4c2e56={},_0x42ead4={'count':0x0,'rows':[]};var _0x54cd4e=_[_0x1901('0x25')](db[_0x1901('0x26')][_0x1901('0x27')],function(_0x1c2272){return{'name':_0x1c2272[_0x1901('0x28')],'type':_0x1c2272['type']['key']};});_0x4c2e56[_0x1901('0x29')]=_[_0x1901('0x25')](_0x54cd4e,'name');_0x4c2e56[_0x1901('0x2a')]=_['keys'](_0x231a00[_0x1901('0x2a')]);_0x4c2e56['filters']=_[_0x1901('0x2b')](_0x4c2e56[_0x1901('0x29')],_0x4c2e56[_0x1901('0x2a')]);_0x47bb16[_0x1901('0x2c')]=_[_0x1901('0x2b')](_0x4c2e56['model'],qs['fields'](_0x231a00[_0x1901('0x2a')][_0x1901('0x2d')]));_0x47bb16[_0x1901('0x2c')]=_0x47bb16['attributes'][_0x1901('0x2e')]?_0x47bb16[_0x1901('0x2c')]:_0x4c2e56[_0x1901('0x29')];if(!_0x231a00[_0x1901('0x2a')]['hasOwnProperty'](_0x1901('0x2f'))){_0x47bb16[_0x1901('0x19')]=qs['limit'](_0x231a00['query'][_0x1901('0x19')]);_0x47bb16[_0x1901('0x18')]=qs[_0x1901('0x18')](_0x231a00[_0x1901('0x2a')]['offset']);}_0x47bb16[_0x1901('0x30')]=qs[_0x1901('0x31')](_0x231a00[_0x1901('0x2a')]['sort']);_0x47bb16['where']=qs['filters'](_['pick'](_0x231a00['query'],_0x4c2e56['filters']));if(_0x231a00[_0x1901('0x2a')]['filter']){_0x47bb16[_0x1901('0x32')]=_[_0x1901('0x33')](_0x47bb16[_0x1901('0x32')],{'$or':_[_0x1901('0x25')](_0x54cd4e,function(_0x37d005){if(_0x37d005[_0x1901('0x34')]!=='VIRTUAL'){var _0x1947b6={};_0x1947b6[_0x37d005[_0x1901('0x24')]]={'$like':'%'+_0x231a00[_0x1901('0x2a')]['filter']+'%'};return _0x1947b6;}})});}_0x47bb16=_['merge']({},_0x47bb16,_0x231a00[_0x1901('0x35')]);var _0x50b748={'where':_0x47bb16['where']};return db[_0x1901('0x26')]['count'](_0x50b748)[_0x1901('0x1d')](function(_0x1378b0){_0x42ead4[_0x1901('0x17')]=_0x1378b0;if(_0x231a00[_0x1901('0x2a')][_0x1901('0x36')]){_0x47bb16[_0x1901('0x37')]=[{'all':!![]}];}return db['VoiceChanSpy'][_0x1901('0x38')](_0x47bb16);})[_0x1901('0x1d')](function(_0x47e7b2){_0x42ead4['rows']=_0x47e7b2;return _0x42ead4;})[_0x1901('0x1d')](respondWithFilteredResult(_0x165600,_0x47bb16))[_0x1901('0x39')](handleError(_0x165600,null));};exports[_0x1901('0x3a')]=function(_0x1cfb44,_0x355cda){var _0x4745cd={'raw':![],'where':{'id':_0x1cfb44['params']['id']}},_0x16c55e={};_0x16c55e[_0x1901('0x29')]=_[_0x1901('0x3b')](db[_0x1901('0x26')][_0x1901('0x27')]);_0x16c55e['query']=_[_0x1901('0x3b')](_0x1cfb44[_0x1901('0x2a')]);_0x16c55e['filters']=_[_0x1901('0x2b')](_0x16c55e[_0x1901('0x29')],_0x16c55e[_0x1901('0x2a')]);_0x4745cd[_0x1901('0x2c')]=_[_0x1901('0x2b')](_0x16c55e[_0x1901('0x29')],qs['fields'](_0x1cfb44[_0x1901('0x2a')][_0x1901('0x2d')]));_0x4745cd[_0x1901('0x2c')]=_0x4745cd[_0x1901('0x2c')][_0x1901('0x2e')]?_0x4745cd[_0x1901('0x2c')]:_0x16c55e[_0x1901('0x29')];if(_0x1cfb44['query'][_0x1901('0x36')]){_0x4745cd[_0x1901('0x37')]=[{'all':!![]}];}_0x4745cd=_[_0x1901('0x33')]({},_0x4745cd,_0x1cfb44[_0x1901('0x35')]);return db[_0x1901('0x26')][_0x1901('0x3c')](_0x4745cd)[_0x1901('0x1d')](handleEntityNotFound(_0x355cda,null))[_0x1901('0x1d')](respondWithResult(_0x355cda,null))[_0x1901('0x39')](handleError(_0x355cda,null));};exports[_0x1901('0x3d')]=function(_0x15b6ba,_0xed5c73){return db['VoiceChanSpy'][_0x1901('0x3d')](_0x15b6ba[_0x1901('0x3e')],{})[_0x1901('0x1d')](function(_0x576b3f){var _0x36beee=_0x15b6ba[_0x1901('0x3f')]['get']({'plain':!![]});if(!_0x36beee)throw new Error(_0x1901('0x40'));if(_0x36beee[_0x1901('0x41')]===_0x1901('0x3f')){var _0x364dbd=_0x576b3f['get']({'plain':!![]});var _0x3d0ab1='ChanSpies';return db['UserProfileSection'][_0x1901('0x3c')]({'where':{'name':_0x3d0ab1,'userProfileId':_0x36beee[_0x1901('0x42')]},'raw':!![]})[_0x1901('0x1d')](function(_0x469b89){if(_0x469b89&&_0x469b89['autoAssociation']===0x0){return db[_0x1901('0x20')]['create']({'name':_0x364dbd[_0x1901('0x24')],'resourceId':_0x364dbd['id'],'type':_0x469b89[_0x1901('0x24')],'sectionId':_0x469b89['id']},{})[_0x1901('0x1d')](function(){return _0x576b3f;});}else{return _0x576b3f;}})[_0x1901('0x39')](function(_0x2dd2b6){logger[_0x1901('0x22')](_0x1901('0x43'),_0x2dd2b6);throw _0x2dd2b6;});}return _0x576b3f;})[_0x1901('0x1d')](respondWithResult(_0xed5c73,0xc9))[_0x1901('0x39')](handleError(_0xed5c73,null));};exports[_0x1901('0x44')]=function(_0x3a12af,_0x3d90d8){if(_0x3a12af['body']['id']){delete _0x3a12af[_0x1901('0x3e')]['id'];}return db[_0x1901('0x26')][_0x1901('0x3c')]({'where':{'id':_0x3a12af['params']['id']}})[_0x1901('0x1d')](handleEntityNotFound(_0x3d90d8,null))[_0x1901('0x1d')](saveUpdates(_0x3a12af[_0x1901('0x3e')],null))[_0x1901('0x1d')](respondWithResult(_0x3d90d8,null))['catch'](handleError(_0x3d90d8,null));};exports[_0x1901('0x1e')]=function(_0x38bdec,_0x475b4a){return db['VoiceChanSpy'][_0x1901('0x3c')]({'where':{'id':_0x38bdec[_0x1901('0x45')]['id']}})[_0x1901('0x1d')](handleEntityNotFound(_0x475b4a,null))[_0x1901('0x1d')](removeEntity(_0x475b4a,null))[_0x1901('0x39')](handleError(_0x475b4a,null));};
\ No newline at end of file
+var _0xc8c8=['send','index','map','VoiceChanSpy','rawAttributes','fieldName','type','key','query','keys','filters','model','fields','attributes','length','hasOwnProperty','nolimit','order','sort','where','pick','filter','merge','VIRTUAL','options','count','rows','catch','show','params','intersection','includeAll','include','create','user','Unable\x20to\x20retrieve\x20the\x20current\x20user','role','UserProfileSection','find','userProfileId','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','body','html-pdf','rimraf','zip-dir','fast-json-patch','mustache','util','path','to-csv','ejs','squel','crypto','jsforce','desk.js','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','../../config/environment','../../mysqldb','sendStatus','status','end','json','offset','limit','set','Content-Range','apply','reject','save','update','destroy','then','get','ChanSpies','UserProfileResource','error','stack','name'];(function(_0x3aebea,_0x179fb3){var _0x10ee36=function(_0x1658b0){while(--_0x1658b0){_0x3aebea['push'](_0x3aebea['shift']());}};_0x10ee36(++_0x179fb3);}(_0xc8c8,0xd2));var _0x8c8c=function(_0x5301b8,_0x2c6250){_0x5301b8=_0x5301b8-0x0;var _0x402796=_0xc8c8[_0x5301b8];return _0x402796;};'use strict';var pdf=require(_0x8c8c('0x0'));var emlformat=require('eml-format');var rimraf=require(_0x8c8c('0x1'));var zipdir=require(_0x8c8c('0x2'));var jsonpatch=require(_0x8c8c('0x3'));var rp=require('request-promise');var moment=require('moment');var BPromise=require('bluebird');var Mustache=require(_0x8c8c('0x4'));var util=require(_0x8c8c('0x5'));var path=require(_0x8c8c('0x6'));var sox=require('sox');var csv=require(_0x8c8c('0x7'));var ejs=require(_0x8c8c('0x8'));var fs=require('fs');var _=require('lodash');var squel=require(_0x8c8c('0x9'));var crypto=require(_0x8c8c('0xa'));var jsforce=require(_0x8c8c('0xb'));var deskjs=require(_0x8c8c('0xc'));var toCsv=require(_0x8c8c('0x7'));var querystring=require(_0x8c8c('0xd'));var Papa=require(_0x8c8c('0xe'));var Redis=require(_0x8c8c('0xf'));var authService=require(_0x8c8c('0x10'));var qs=require('../../components/parsers/qs');var as=require(_0x8c8c('0x11'));var hardwareService=require(_0x8c8c('0x12'));var logger=require(_0x8c8c('0x13'))('api');var utils=require('../../config/utils');var config=require(_0x8c8c('0x14'));var db=require(_0x8c8c('0x15'))['db'];function respondWithStatusCode(_0x2dbf25,_0x4d741f){_0x4d741f=_0x4d741f||0xcc;return function(_0x117124){if(_0x117124){return _0x2dbf25[_0x8c8c('0x16')](_0x4d741f);}return _0x2dbf25[_0x8c8c('0x17')](_0x4d741f)[_0x8c8c('0x18')]();};}function respondWithResult(_0x20b6cf,_0x250965){_0x250965=_0x250965||0xc8;return function(_0x4c7b1f){if(_0x4c7b1f){return _0x20b6cf[_0x8c8c('0x17')](_0x250965)[_0x8c8c('0x19')](_0x4c7b1f);}};}function respondWithFilteredResult(_0x551aa6,_0x3b1240){return function(_0x2506f7){if(_0x2506f7){var _0x8afddc=_0x2506f7['count'],_0x507611=_0x3b1240[_0x8c8c('0x1a')],_0x16a430=_0x3b1240['offset']+_0x3b1240[_0x8c8c('0x1b')],_0x430f9e;if(_0x16a430>=_0x8afddc){_0x16a430=_0x8afddc;_0x430f9e=0xc8;}else{_0x430f9e=0xce;}_0x551aa6['status'](_0x430f9e);return _0x551aa6[_0x8c8c('0x1c')](_0x8c8c('0x1d'),_0x507611+'-'+_0x16a430+'/'+_0x8afddc)['json'](_0x2506f7);}return null;};}function patchUpdates(_0x41d3c9){return function(_0x36e4f7){try{jsonpatch[_0x8c8c('0x1e')](_0x36e4f7,_0x41d3c9,!![]);}catch(_0x224be3){return BPromise[_0x8c8c('0x1f')](_0x224be3);}return _0x36e4f7[_0x8c8c('0x20')]();};}function saveUpdates(_0x5e0efd,_0x11f1bc){return function(_0x18c275){if(_0x18c275){return _0x18c275[_0x8c8c('0x21')](_0x5e0efd)['then'](function(_0x3536b0){return _0x3536b0;});}return null;};}function removeEntity(_0x5022c6,_0x5f5ad8){return function(_0x4e6221){if(_0x4e6221){return _0x4e6221[_0x8c8c('0x22')]()[_0x8c8c('0x23')](function(){var _0x19e66f=_0x4e6221[_0x8c8c('0x24')]({'plain':!![]});var _0x1a47d8=_0x8c8c('0x25');return db[_0x8c8c('0x26')][_0x8c8c('0x22')]({'where':{'type':_0x1a47d8,'resourceId':_0x19e66f['id']}})['then'](function(){return _0x4e6221;});})[_0x8c8c('0x23')](function(){_0x5022c6['status'](0xcc)[_0x8c8c('0x18')]();});}};}function handleEntityNotFound(_0x3c21b5,_0x33bc21){return function(_0xff933){if(!_0xff933){_0x3c21b5[_0x8c8c('0x16')](0x194);}return _0xff933;};}function handleError(_0x4a0bed,_0x7f8001){_0x7f8001=_0x7f8001||0x1f4;return function(_0x16b893){logger[_0x8c8c('0x27')](_0x16b893[_0x8c8c('0x28')]);if(_0x16b893[_0x8c8c('0x29')]){delete _0x16b893[_0x8c8c('0x29')];}_0x4a0bed[_0x8c8c('0x17')](_0x7f8001)[_0x8c8c('0x2a')](_0x16b893);};}exports[_0x8c8c('0x2b')]=function(_0x2d6dc3,_0x9730e7){var _0x7a2f35={},_0x533da8={},_0xce9e41={'count':0x0,'rows':[]};var _0x1ea226=_[_0x8c8c('0x2c')](db[_0x8c8c('0x2d')][_0x8c8c('0x2e')],function(_0x2e9695){return{'name':_0x2e9695[_0x8c8c('0x2f')],'type':_0x2e9695[_0x8c8c('0x30')][_0x8c8c('0x31')]};});_0x533da8['model']=_[_0x8c8c('0x2c')](_0x1ea226,_0x8c8c('0x29'));_0x533da8[_0x8c8c('0x32')]=_[_0x8c8c('0x33')](_0x2d6dc3['query']);_0x533da8[_0x8c8c('0x34')]=_['intersection'](_0x533da8['model'],_0x533da8[_0x8c8c('0x32')]);_0x7a2f35['attributes']=_['intersection'](_0x533da8[_0x8c8c('0x35')],qs[_0x8c8c('0x36')](_0x2d6dc3[_0x8c8c('0x32')][_0x8c8c('0x36')]));_0x7a2f35[_0x8c8c('0x37')]=_0x7a2f35[_0x8c8c('0x37')][_0x8c8c('0x38')]?_0x7a2f35[_0x8c8c('0x37')]:_0x533da8['model'];if(!_0x2d6dc3[_0x8c8c('0x32')][_0x8c8c('0x39')](_0x8c8c('0x3a'))){_0x7a2f35[_0x8c8c('0x1b')]=qs[_0x8c8c('0x1b')](_0x2d6dc3[_0x8c8c('0x32')]['limit']);_0x7a2f35[_0x8c8c('0x1a')]=qs[_0x8c8c('0x1a')](_0x2d6dc3[_0x8c8c('0x32')][_0x8c8c('0x1a')]);}_0x7a2f35[_0x8c8c('0x3b')]=qs[_0x8c8c('0x3c')](_0x2d6dc3[_0x8c8c('0x32')][_0x8c8c('0x3c')]);_0x7a2f35[_0x8c8c('0x3d')]=qs[_0x8c8c('0x34')](_[_0x8c8c('0x3e')](_0x2d6dc3[_0x8c8c('0x32')],_0x533da8[_0x8c8c('0x34')]));if(_0x2d6dc3[_0x8c8c('0x32')][_0x8c8c('0x3f')]){_0x7a2f35[_0x8c8c('0x3d')]=_[_0x8c8c('0x40')](_0x7a2f35['where'],{'$or':_[_0x8c8c('0x2c')](_0x1ea226,function(_0x592341){if(_0x592341[_0x8c8c('0x30')]!==_0x8c8c('0x41')){var _0x5e5c42={};_0x5e5c42[_0x592341[_0x8c8c('0x29')]]={'$like':'%'+_0x2d6dc3[_0x8c8c('0x32')]['filter']+'%'};return _0x5e5c42;}})});}_0x7a2f35=_[_0x8c8c('0x40')]({},_0x7a2f35,_0x2d6dc3[_0x8c8c('0x42')]);var _0x22d007={'where':_0x7a2f35[_0x8c8c('0x3d')]};return db[_0x8c8c('0x2d')]['count'](_0x22d007)[_0x8c8c('0x23')](function(_0x1fca7c){_0xce9e41[_0x8c8c('0x43')]=_0x1fca7c;if(_0x2d6dc3[_0x8c8c('0x32')]['includeAll']){_0x7a2f35['include']=[{'all':!![]}];}return db[_0x8c8c('0x2d')]['findAll'](_0x7a2f35);})[_0x8c8c('0x23')](function(_0x4cb301){_0xce9e41[_0x8c8c('0x44')]=_0x4cb301;return _0xce9e41;})[_0x8c8c('0x23')](respondWithFilteredResult(_0x9730e7,_0x7a2f35))[_0x8c8c('0x45')](handleError(_0x9730e7,null));};exports[_0x8c8c('0x46')]=function(_0x1f5f20,_0x16e370){var _0x207485={'raw':![],'where':{'id':_0x1f5f20[_0x8c8c('0x47')]['id']}},_0x42446b={};_0x42446b[_0x8c8c('0x35')]=_[_0x8c8c('0x33')](db[_0x8c8c('0x2d')][_0x8c8c('0x2e')]);_0x42446b[_0x8c8c('0x32')]=_[_0x8c8c('0x33')](_0x1f5f20[_0x8c8c('0x32')]);_0x42446b[_0x8c8c('0x34')]=_[_0x8c8c('0x48')](_0x42446b['model'],_0x42446b[_0x8c8c('0x32')]);_0x207485[_0x8c8c('0x37')]=_[_0x8c8c('0x48')](_0x42446b[_0x8c8c('0x35')],qs[_0x8c8c('0x36')](_0x1f5f20[_0x8c8c('0x32')][_0x8c8c('0x36')]));_0x207485[_0x8c8c('0x37')]=_0x207485[_0x8c8c('0x37')][_0x8c8c('0x38')]?_0x207485['attributes']:_0x42446b[_0x8c8c('0x35')];if(_0x1f5f20[_0x8c8c('0x32')][_0x8c8c('0x49')]){_0x207485[_0x8c8c('0x4a')]=[{'all':!![]}];}_0x207485=_[_0x8c8c('0x40')]({},_0x207485,_0x1f5f20[_0x8c8c('0x42')]);return db[_0x8c8c('0x2d')]['find'](_0x207485)[_0x8c8c('0x23')](handleEntityNotFound(_0x16e370,null))[_0x8c8c('0x23')](respondWithResult(_0x16e370,null))[_0x8c8c('0x45')](handleError(_0x16e370,null));};exports[_0x8c8c('0x4b')]=function(_0x136622,_0x2411c6){return db['VoiceChanSpy'][_0x8c8c('0x4b')](_0x136622['body'],{})[_0x8c8c('0x23')](function(_0x7520a5){var _0x40eca8=_0x136622[_0x8c8c('0x4c')][_0x8c8c('0x24')]({'plain':!![]});if(!_0x40eca8)throw new Error(_0x8c8c('0x4d'));if(_0x40eca8[_0x8c8c('0x4e')]===_0x8c8c('0x4c')){var _0x25fe61=_0x7520a5[_0x8c8c('0x24')]({'plain':!![]});var _0x222384='ChanSpies';return db[_0x8c8c('0x4f')][_0x8c8c('0x50')]({'where':{'name':_0x222384,'userProfileId':_0x40eca8[_0x8c8c('0x51')]},'raw':!![]})[_0x8c8c('0x23')](function(_0x5438a0){if(_0x5438a0&&_0x5438a0['autoAssociation']===0x0){return db[_0x8c8c('0x26')]['create']({'name':_0x25fe61['name'],'resourceId':_0x25fe61['id'],'type':_0x5438a0['name'],'sectionId':_0x5438a0['id']},{})[_0x8c8c('0x23')](function(){return _0x7520a5;});}else{return _0x7520a5;}})['catch'](function(_0x634c9c){logger[_0x8c8c('0x27')](_0x8c8c('0x52'),_0x634c9c);throw _0x634c9c;});}return _0x7520a5;})[_0x8c8c('0x23')](respondWithResult(_0x2411c6,0xc9))['catch'](handleError(_0x2411c6,null));};exports[_0x8c8c('0x21')]=function(_0x363f98,_0x2a9c3c){if(_0x363f98[_0x8c8c('0x53')]['id']){delete _0x363f98['body']['id'];}return db[_0x8c8c('0x2d')][_0x8c8c('0x50')]({'where':{'id':_0x363f98[_0x8c8c('0x47')]['id']}})[_0x8c8c('0x23')](handleEntityNotFound(_0x2a9c3c,null))['then'](saveUpdates(_0x363f98[_0x8c8c('0x53')],null))[_0x8c8c('0x23')](respondWithResult(_0x2a9c3c,null))[_0x8c8c('0x45')](handleError(_0x2a9c3c,null));};exports[_0x8c8c('0x22')]=function(_0x1bf463,_0x2bad54){return db['VoiceChanSpy']['find']({'where':{'id':_0x1bf463[_0x8c8c('0x47')]['id']}})[_0x8c8c('0x23')](handleEntityNotFound(_0x2bad54,null))['then'](removeEntity(_0x2bad54,null))[_0x8c8c('0x45')](handleError(_0x2bad54,null));};
\ No newline at end of file
diff --git a/server/api/voiceChanSpy/voiceChanSpy.model.js b/server/api/voiceChanSpy/voiceChanSpy.model.js
index f7d7cdd..8b6e91f 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 _0xe065=['ChanSpy','SIP/%s,%s','options','StopMixMonitor','length','internal','name','findAll','agent','then','catch','exports','models','define','VoiceChanSpy','voice_chanspy','VoiceExtension','destroy','bulkCreate','lodash','util','bluebird','./voiceChanSpy.attributes','context','from-sip','format','%s%s','prefix','system','push','merge','Set','CDR(type)=%s','record','MixMonitor','${UNIQUEID}.%s,ab','recordingFormat','Authenticate'];(function(_0x517f0f,_0x5a95b7){var _0x226e4e=function(_0x15feb8){while(--_0x15feb8){_0x517f0f['push'](_0x517f0f['shift']());}};_0x226e4e(++_0x5a95b7);}(_0xe065,0x169));var _0x5e06=function(_0x5ef23d,_0x2dbadb){_0x5ef23d=_0x5ef23d-0x0;var _0x453a7a=_0xe065[_0x5ef23d];return _0x453a7a;};'use strict';var _=require(_0x5e06('0x0'));var util=require(_0x5e06('0x1'));var BPromise=require(_0x5e06('0x2'));var attributes=require(_0x5e06('0x3'));var getUserApplications=function(_0x81b1d3,_0x2f0c90,_0x1760d0){var _0x4f3a43=0x1;var _0x1eebca=[];var _0x555c50={'context':_0x2f0c90[_0x5e06('0x4')]||_0x5e06('0x5'),'exten':util[_0x5e06('0x6')](_0x5e06('0x7'),_0x81b1d3[_0x5e06('0x8')],_0x1760d0),'type':_0x5e06('0x9'),'isApp':![],'ChanSpyId':_0x81b1d3['id'],'UserId':_0x2f0c90['id']};_0x1eebca[_0x5e06('0xa')](_[_0x5e06('0xb')]({'app':_0x5e06('0xc'),'appdata':util[_0x5e06('0x6')](_0x5e06('0xd'),'chanspy'),'priority':_0x4f3a43++},_0x555c50));if(_0x81b1d3[_0x5e06('0xe')]){_0x1eebca[_0x5e06('0xa')](_[_0x5e06('0xb')]({'app':_0x5e06('0xf'),'appdata':util['format'](_0x5e06('0x10'),_0x81b1d3[_0x5e06('0x11')]),'priority':_0x4f3a43++},_0x555c50));}if(_0x81b1d3['auth']){_0x1eebca['push'](_['merge']({'app':_0x5e06('0x12'),'appdata':_0x81b1d3['password'],'priority':_0x4f3a43++},_0x555c50));}_0x1eebca[_0x5e06('0xa')](_[_0x5e06('0xb')]({'app':_0x5e06('0x13'),'appdata':util['format'](_0x5e06('0x14'),_0x2f0c90['name'],_0x81b1d3[_0x5e06('0x15')]?_0x81b1d3[_0x5e06('0x15')]['join'](''):''),'priority':_0x4f3a43++},_0x555c50));if(_0x81b1d3[_0x5e06('0xe')]){_0x1eebca[_0x5e06('0xa')](_['merge']({'app':_0x5e06('0x16'),'priority':_0x4f3a43++},_0x555c50));}return _0x1eebca;};var getChanSpyApplications=function(_0x2e9953,_0x3c5402){var _0x5ee8a6=[];for(var _0x373c13=0x0,_0x1f05be=0x1;_0x373c13<_0x3c5402[_0x5e06('0x17')];_0x373c13++,_0x1f05be=0x1){_0x5ee8a6=_0x5ee8a6['concat'](getUserApplications(_0x2e9953,_0x3c5402[_0x373c13],_0x3c5402[_0x373c13]['internal']));if(_0x3c5402[_0x373c13][_0x5e06('0x18')]!=_0x3c5402[_0x373c13][_0x5e06('0x19')]){_0x5ee8a6=_0x5ee8a6['concat'](getUserApplications(_0x2e9953,_0x3c5402[_0x373c13],_0x3c5402[_0x373c13][_0x5e06('0x19')]));}}return _0x5ee8a6;};var getChanSpyPromise=function(_0x20ed82,_0x486350){return new BPromise(function(_0x4a15a9,_0x1a6871){return _0x20ed82['User'][_0x5e06('0x1a')]({'attributes':['id',_0x5e06('0x19'),'internal'],'where':{'role':_0x5e06('0x1b'),'chanspy':!![]},'raw':!![]})[_0x5e06('0x1c')](function(_0x4cc8ab){if(_0x4cc8ab){return _0x4a15a9(getChanSpyApplications(_0x486350,_0x4cc8ab));}return _0x4a15a9([]);})[_0x5e06('0x1d')](function(_0x138300){_0x1a6871(_0x138300);});});};module[_0x5e06('0x1e')]=function(_0x33fab5,_0x4244d9){var _0x4ce41c=_0x33fab5[_0x5e06('0x1f')];return _0x33fab5[_0x5e06('0x20')](_0x5e06('0x21'),attributes,{'tableName':_0x5e06('0x22'),'paranoid':![],'indexes':[],'timestamps':!![],'hooks':{'afterCreate':function(_0x379fc9,_0x18c6c2,_0x545b9d){return getChanSpyPromise(_0x4ce41c,_0x379fc9)[_0x5e06('0x1c')](function(_0x1ebddd){if(_0x1ebddd&&_0x1ebddd[_0x5e06('0x17')]){return _0x4ce41c[_0x5e06('0x23')]['bulkCreate'](_0x1ebddd);}})[_0x5e06('0x1c')](function(){_0x545b9d();})['catch'](function(_0x310d63){_0x545b9d(_0x310d63);});},'afterUpdate':function(_0x587086,_0x3f34a2,_0x5633a0){return _0x4ce41c[_0x5e06('0x23')][_0x5e06('0x24')]({'where':{'ChanSpyId':_0x587086['id']}})[_0x5e06('0x1c')](function(){return getChanSpyPromise(_0x4ce41c,_0x587086);})[_0x5e06('0x1c')](function(_0x4968d4){if(_0x4968d4&&_0x4968d4[_0x5e06('0x17')]){return _0x4ce41c[_0x5e06('0x23')][_0x5e06('0x25')](_0x4968d4);}})[_0x5e06('0x1c')](function(){_0x5633a0();})['catch'](function(_0x51061a){_0x5633a0(_0x51061a);});},'afterDestroy':function(_0x3cac24,_0x2bfbab,_0x39f677){return _0x4ce41c[_0x5e06('0x23')]['destroy']({'where':{'ChanSpyId':_0x3cac24['id']}})[_0x5e06('0x1c')](function(){_0x39f677();})[_0x5e06('0x1d')](function(_0x26a480){_0x39f677(_0x26a480);});}}});};
\ No newline at end of file
+var _0xe7ea=['then','VoiceExtension','bulkCreate','destroy','lodash','bluebird','./voiceChanSpy.attributes','from-sip','format','%s%s','prefix','system','merge','Set','chanspy','push','MixMonitor','${UNIQUEID}.%s,ab','recordingFormat','password','ChanSpy','SIP/%s,%s','options','join','StopMixMonitor','length','concat','internal','name','User','agent','catch','exports','VoiceChanSpy','voice_chanspy'];(function(_0x57a50f,_0x1cdd39){var _0x142447=function(_0x498f9f){while(--_0x498f9f){_0x57a50f['push'](_0x57a50f['shift']());}};_0x142447(++_0x1cdd39);}(_0xe7ea,0x185));var _0xae7e=function(_0x167b19,_0x56081a){_0x167b19=_0x167b19-0x0;var _0x1fcca2=_0xe7ea[_0x167b19];return _0x1fcca2;};'use strict';var _=require(_0xae7e('0x0'));var util=require('util');var BPromise=require(_0xae7e('0x1'));var attributes=require(_0xae7e('0x2'));var getUserApplications=function(_0x5b0c1f,_0x150cc1,_0x127b37){var _0x1af791=0x1;var _0x4fcc5a=[];var _0x26728c={'context':_0x150cc1['context']||_0xae7e('0x3'),'exten':util[_0xae7e('0x4')](_0xae7e('0x5'),_0x5b0c1f[_0xae7e('0x6')],_0x127b37),'type':_0xae7e('0x7'),'isApp':![],'ChanSpyId':_0x5b0c1f['id'],'UserId':_0x150cc1['id']};_0x4fcc5a['push'](_[_0xae7e('0x8')]({'app':_0xae7e('0x9'),'appdata':util[_0xae7e('0x4')]('CDR(type)=%s',_0xae7e('0xa')),'priority':_0x1af791++},_0x26728c));if(_0x5b0c1f['record']){_0x4fcc5a[_0xae7e('0xb')](_[_0xae7e('0x8')]({'app':_0xae7e('0xc'),'appdata':util[_0xae7e('0x4')](_0xae7e('0xd'),_0x5b0c1f[_0xae7e('0xe')]),'priority':_0x1af791++},_0x26728c));}if(_0x5b0c1f['auth']){_0x4fcc5a[_0xae7e('0xb')](_[_0xae7e('0x8')]({'app':'Authenticate','appdata':_0x5b0c1f[_0xae7e('0xf')],'priority':_0x1af791++},_0x26728c));}_0x4fcc5a[_0xae7e('0xb')](_[_0xae7e('0x8')]({'app':_0xae7e('0x10'),'appdata':util[_0xae7e('0x4')](_0xae7e('0x11'),_0x150cc1['name'],_0x5b0c1f[_0xae7e('0x12')]?_0x5b0c1f[_0xae7e('0x12')][_0xae7e('0x13')](''):''),'priority':_0x1af791++},_0x26728c));if(_0x5b0c1f['record']){_0x4fcc5a['push'](_[_0xae7e('0x8')]({'app':_0xae7e('0x14'),'priority':_0x1af791++},_0x26728c));}return _0x4fcc5a;};var getChanSpyApplications=function(_0x4df021,_0x12e164){var _0x43f185=[];for(var _0xf3312e=0x0,_0x58a964=0x1;_0xf3312e<_0x12e164[_0xae7e('0x15')];_0xf3312e++,_0x58a964=0x1){_0x43f185=_0x43f185[_0xae7e('0x16')](getUserApplications(_0x4df021,_0x12e164[_0xf3312e],_0x12e164[_0xf3312e]['internal']));if(_0x12e164[_0xf3312e][_0xae7e('0x17')]!=_0x12e164[_0xf3312e]['name']){_0x43f185=_0x43f185[_0xae7e('0x16')](getUserApplications(_0x4df021,_0x12e164[_0xf3312e],_0x12e164[_0xf3312e][_0xae7e('0x18')]));}}return _0x43f185;};var getChanSpyPromise=function(_0x58bca5,_0x3c58a4){return new BPromise(function(_0x52fb21,_0x4b5db4){return _0x58bca5[_0xae7e('0x19')]['findAll']({'attributes':['id',_0xae7e('0x18'),_0xae7e('0x17')],'where':{'role':_0xae7e('0x1a'),'chanspy':!![]},'raw':!![]})['then'](function(_0x24bdd4){if(_0x24bdd4){return _0x52fb21(getChanSpyApplications(_0x3c58a4,_0x24bdd4));}return _0x52fb21([]);})[_0xae7e('0x1b')](function(_0x2aaa77){_0x4b5db4(_0x2aaa77);});});};module[_0xae7e('0x1c')]=function(_0x1478af,_0x527118){var _0x1f18d9=_0x1478af['models'];return _0x1478af['define'](_0xae7e('0x1d'),attributes,{'tableName':_0xae7e('0x1e'),'paranoid':![],'indexes':[],'timestamps':!![],'hooks':{'afterCreate':function(_0x1a54a0,_0x84bc70,_0x456ce1){return getChanSpyPromise(_0x1f18d9,_0x1a54a0)[_0xae7e('0x1f')](function(_0x3c6d37){if(_0x3c6d37&&_0x3c6d37['length']){return _0x1f18d9[_0xae7e('0x20')][_0xae7e('0x21')](_0x3c6d37);}})['then'](function(){_0x456ce1();})['catch'](function(_0x4f38c3){_0x456ce1(_0x4f38c3);});},'afterUpdate':function(_0x1ad41b,_0x4aa87e,_0x285a6d){return _0x1f18d9[_0xae7e('0x20')][_0xae7e('0x22')]({'where':{'ChanSpyId':_0x1ad41b['id']}})['then'](function(){return getChanSpyPromise(_0x1f18d9,_0x1ad41b);})['then'](function(_0xb93ae1){if(_0xb93ae1&&_0xb93ae1['length']){return _0x1f18d9[_0xae7e('0x20')][_0xae7e('0x21')](_0xb93ae1);}})[_0xae7e('0x1f')](function(){_0x285a6d();})[_0xae7e('0x1b')](function(_0x1e7414){_0x285a6d(_0x1e7414);});},'afterDestroy':function(_0x538d61,_0x2dc160,_0x5de795){return _0x1f18d9['VoiceExtension'][_0xae7e('0x22')]({'where':{'ChanSpyId':_0x538d61['id']}})['then'](function(){_0x5de795();})[_0xae7e('0x1b')](function(_0x118f56){_0x5de795(_0x118f56);});}}});};
\ No newline at end of file
diff --git a/server/api/voiceChanSpy/voiceChanSpy.rpc.js b/server/api/voiceChanSpy/voiceChanSpy.rpc.js
index c955c57..fcf7581 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 _0x9725=['stringify','error','VoiceChanSpy,\x20%s,\x20%s','message','info','result','catch','moment','randomstring','ioredis','../../mysqldb','../../config/utils','rpc','../../config/environment','jayson/promise','client','http','request','then','debug','VoiceChanSpy,\x20%s,\x20%s,\x20%s','request\x20sent'];(function(_0x3dd15e,_0x1f0015){var _0x231fd0=function(_0x4f680a){while(--_0x4f680a){_0x3dd15e['push'](_0x3dd15e['shift']());}};_0x231fd0(++_0x1f0015);}(_0x9725,0x1d5));var _0x5972=function(_0x54a41c,_0x1280a){_0x54a41c=_0x54a41c-0x0;var _0x3cc610=_0x9725[_0x54a41c];return _0x3cc610;};'use strict';var _=require('lodash');var util=require('util');var moment=require(_0x5972('0x0'));var BPromise=require('bluebird');var rs=require(_0x5972('0x1'));var fs=require('fs');var Redis=require(_0x5972('0x2'));var db=require(_0x5972('0x3'))['db'];var utils=require(_0x5972('0x4'));var logger=require('../../config/logger')(_0x5972('0x5'));var config=require(_0x5972('0x6'));var jayson=require(_0x5972('0x7'));var client=jayson[_0x5972('0x8')][_0x5972('0x9')]({'port':0x232a});function respondWithRpcPromise(_0x352a62,_0x328c43,_0x3db25a){return new BPromise(function(_0x180980,_0x4aaf3b){return client[_0x5972('0xa')](_0x352a62,_0x3db25a)[_0x5972('0xb')](function(_0x8dde53){logger['info']('VoiceChanSpy,\x20%s,\x20%s',_0x328c43,'request\x20sent');logger[_0x5972('0xc')](_0x5972('0xd'),_0x328c43,_0x5972('0xe'),JSON[_0x5972('0xf')](_0x8dde53));if(_0x8dde53[_0x5972('0x10')]){if(_0x8dde53[_0x5972('0x10')]['code']===0x1f4){logger[_0x5972('0x10')](_0x5972('0x11'),_0x328c43,_0x8dde53[_0x5972('0x10')][_0x5972('0x12')]);return _0x4aaf3b(_0x8dde53[_0x5972('0x10')]['message']);}logger[_0x5972('0x10')](_0x5972('0x11'),_0x328c43,_0x8dde53[_0x5972('0x10')][_0x5972('0x12')]);return _0x180980(_0x8dde53[_0x5972('0x10')][_0x5972('0x12')]);}else{logger[_0x5972('0x13')]('VoiceChanSpy,\x20%s,\x20%s',_0x328c43,_0x5972('0xe'));_0x180980(_0x8dde53[_0x5972('0x14')]['message']);}})[_0x5972('0x15')](function(_0x542c79){logger[_0x5972('0x10')](_0x5972('0x11'),_0x328c43,_0x542c79);_0x4aaf3b(_0x542c79);});});}
\ No newline at end of file
+var _0xe0c1=['client','http','request','info','request\x20sent','debug','VoiceChanSpy,\x20%s,\x20%s,\x20%s','stringify','error','code','VoiceChanSpy,\x20%s,\x20%s','message','result','catch','lodash','util','moment','randomstring','ioredis','../../config/environment'];(function(_0x2ce1f7,_0x2b2478){var _0x3630fe=function(_0x5419e5){while(--_0x5419e5){_0x2ce1f7['push'](_0x2ce1f7['shift']());}};_0x3630fe(++_0x2b2478);}(_0xe0c1,0x1c6));var _0x1e0c=function(_0x4a159d,_0x28db19){_0x4a159d=_0x4a159d-0x0;var _0x1e4caa=_0xe0c1[_0x4a159d];return _0x1e4caa;};'use strict';var _=require(_0x1e0c('0x0'));var util=require(_0x1e0c('0x1'));var moment=require(_0x1e0c('0x2'));var BPromise=require('bluebird');var rs=require(_0x1e0c('0x3'));var fs=require('fs');var Redis=require(_0x1e0c('0x4'));var db=require('../../mysqldb')['db'];var utils=require('../../config/utils');var logger=require('../../config/logger')('rpc');var config=require(_0x1e0c('0x5'));var jayson=require('jayson/promise');var client=jayson[_0x1e0c('0x6')][_0x1e0c('0x7')]({'port':0x232a});function respondWithRpcPromise(_0x19c36c,_0x487a0d,_0x50f1d1){return new BPromise(function(_0x5dd605,_0x5d21ec){return client[_0x1e0c('0x8')](_0x19c36c,_0x50f1d1)['then'](function(_0x58328d){logger[_0x1e0c('0x9')]('VoiceChanSpy,\x20%s,\x20%s',_0x487a0d,_0x1e0c('0xa'));logger[_0x1e0c('0xb')](_0x1e0c('0xc'),_0x487a0d,'request\x20sent',JSON[_0x1e0c('0xd')](_0x58328d));if(_0x58328d[_0x1e0c('0xe')]){if(_0x58328d['error'][_0x1e0c('0xf')]===0x1f4){logger[_0x1e0c('0xe')](_0x1e0c('0x10'),_0x487a0d,_0x58328d[_0x1e0c('0xe')][_0x1e0c('0x11')]);return _0x5d21ec(_0x58328d[_0x1e0c('0xe')][_0x1e0c('0x11')]);}logger[_0x1e0c('0xe')](_0x1e0c('0x10'),_0x487a0d,_0x58328d[_0x1e0c('0xe')][_0x1e0c('0x11')]);return _0x5dd605(_0x58328d['error'][_0x1e0c('0x11')]);}else{logger['info'](_0x1e0c('0x10'),_0x487a0d,_0x1e0c('0xa'));_0x5dd605(_0x58328d[_0x1e0c('0x12')]['message']);}})[_0x1e0c('0x13')](function(_0x37dbb3){logger[_0x1e0c('0xe')](_0x1e0c('0x10'),_0x487a0d,_0x37dbb3);_0x5d21ec(_0x37dbb3);});});}
\ No newline at end of file
diff --git a/server/api/voiceContext/index.js b/server/api/voiceContext/index.js
index a675943..b0d8c5b 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 _0x66cd=['./voiceContext.controller','isAuthenticated','get','/:id','show','post','update','destroy','exports','multer','path','connect-timeout','Router','../../components/interaction/service','../../config/environment'];(function(_0x1b558b,_0x82f953){var _0x54ce8d=function(_0x216bae){while(--_0x216bae){_0x1b558b['push'](_0x1b558b['shift']());}};_0x54ce8d(++_0x82f953);}(_0x66cd,0xae));var _0xd66c=function(_0x5ddb1c,_0x5ea4df){_0x5ddb1c=_0x5ddb1c-0x0;var _0x354adc=_0x66cd[_0x5ddb1c];return _0x354adc;};'use strict';var multer=require(_0xd66c('0x0'));var util=require('util');var path=require(_0xd66c('0x1'));var timeout=require(_0xd66c('0x2'));var express=require('express');var router=express[_0xd66c('0x3')]();var auth=require('../../components/auth/service');var interaction=require(_0xd66c('0x4'));var config=require(_0xd66c('0x5'));var controller=require(_0xd66c('0x6'));router['get']('/',auth[_0xd66c('0x7')](),controller['index']);router[_0xd66c('0x8')](_0xd66c('0x9'),auth['isAuthenticated'](),controller[_0xd66c('0xa')]);router[_0xd66c('0xb')]('/',auth[_0xd66c('0x7')](),controller['create']);router['put'](_0xd66c('0x9'),auth[_0xd66c('0x7')](),controller[_0xd66c('0xc')]);router['delete'](_0xd66c('0x9'),auth[_0xd66c('0x7')](),controller[_0xd66c('0xd')]);module[_0xd66c('0xe')]=router;
\ No newline at end of file
+var _0x25ba=['destroy','exports','multer','connect-timeout','express','../../components/interaction/service','../../config/environment','isAuthenticated','index','get','/:id','show','post','create','put','update'];(function(_0x146eff,_0x361bcd){var _0x36209e=function(_0x9c6dda){while(--_0x9c6dda){_0x146eff['push'](_0x146eff['shift']());}};_0x36209e(++_0x361bcd);}(_0x25ba,0x162));var _0xa25b=function(_0x989175,_0x334788){_0x989175=_0x989175-0x0;var _0x2e5dac=_0x25ba[_0x989175];return _0x2e5dac;};'use strict';var multer=require(_0xa25b('0x0'));var util=require('util');var path=require('path');var timeout=require(_0xa25b('0x1'));var express=require(_0xa25b('0x2'));var router=express['Router']();var auth=require('../../components/auth/service');var interaction=require(_0xa25b('0x3'));var config=require(_0xa25b('0x4'));var controller=require('./voiceContext.controller');router['get']('/',auth[_0xa25b('0x5')](),controller[_0xa25b('0x6')]);router[_0xa25b('0x7')](_0xa25b('0x8'),auth[_0xa25b('0x5')](),controller[_0xa25b('0x9')]);router[_0xa25b('0xa')]('/',auth[_0xa25b('0x5')](),controller[_0xa25b('0xb')]);router[_0xa25b('0xc')](_0xa25b('0x8'),auth['isAuthenticated'](),controller[_0xa25b('0xd')]);router['delete'](_0xa25b('0x8'),auth[_0xa25b('0x5')](),controller[_0xa25b('0xe')]);module[_0xa25b('0xf')]=router;
\ No newline at end of file
diff --git a/server/api/voiceContext/voiceContext.attributes.js b/server/api/voiceContext/voiceContext.attributes.js
index f7a2b8e..9e1384f 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(_0x419e17,_0x7fe78c){var _0x1f2044=function(_0x3723e6){while(--_0x3723e6){_0x419e17['push'](_0x419e17['shift']());}};_0x1f2044(++_0x7fe78c);}(_0x3e74,0x175));var _0x43e7=function(_0x43c0d4,_0x35cc4c){_0x43c0d4=_0x43c0d4-0x0;var _0x9fb3b6=_0x3e74[_0x43c0d4];return _0x9fb3b6;};'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(_0x25261f,_0x1787c5){var _0x3bcc56=function(_0x219b74){while(--_0x219b74){_0x25261f['push'](_0x25261f['shift']());}};_0x3bcc56(++_0x1787c5);}(_0x34e8,0x12c));var _0x834e=function(_0x2d603d,_0x1f79d3){_0x2d603d=_0x2d603d-0x0;var _0x41e79e=_0x34e8[_0x2d603d];return _0x41e79e;};'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 a37b1f8..895755c 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 _0xd70c=['../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/environment','../../mysqldb','jayson/promise','client','http','Sequelize','ValidationError','The\x20password\x20must\x20be\x20at\x20least\x208\x20characters\x20long\x20and\x20have\x201\x20lowercase\x20character,\x201\x20uppercase\x20character,\x201\x20number\x20and\x201\x20special\x20character\x20~!@#$%^&-_=+[{]}.','request','then','debug','stringify','error','code','VoiceContext,\x20%s,\x20%s','message','info','request\x20sent','result','sendStatus','status','end','json','count','offset','limit','apply','reject','save','update','Contexts','UserProfileResource','destroy','stack','name','index','map','VoiceContext','rawAttributes','type','key','model','query','keys','filters','attributes','intersection','fields','order','sort','where','pick','filter','merge','VIRTUAL','includeAll','findAll','rows','catch','show','params','include','options','find','create','body','root','utf8','render','/etc/asterisk/extensions_xcally_contexts.conf','chan_sip.so','user','get','Unable\x20to\x20retrieve\x20the\x20current\x20user','role','UserProfileSection','userProfileId','autoAssociation','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','readFileSync','join','server/files/templates/context.ejs','writeFileSync','Reload','eml-format','zip-dir','fast-json-patch','request-promise','moment','util','path','sox','to-csv','squel','crypto','jsforce','desk.js','papaparse','ioredis'];(function(_0x1035c1,_0x2d8583){var _0x308d67=function(_0x58ddb6){while(--_0x58ddb6){_0x1035c1['push'](_0x1035c1['shift']());}};_0x308d67(++_0x2d8583);}(_0xd70c,0x199));var _0xcd70=function(_0x36e8d1,_0x295f3f){_0x36e8d1=_0x36e8d1-0x0;var _0x7ce127=_0xd70c[_0x36e8d1];return _0x7ce127;};'use strict';var pdf=require('html-pdf');var emlformat=require(_0xcd70('0x0'));var rimraf=require('rimraf');var zipdir=require(_0xcd70('0x1'));var jsonpatch=require(_0xcd70('0x2'));var rp=require(_0xcd70('0x3'));var moment=require(_0xcd70('0x4'));var BPromise=require('bluebird');var Mustache=require('mustache');var util=require(_0xcd70('0x5'));var path=require(_0xcd70('0x6'));var sox=require(_0xcd70('0x7'));var csv=require(_0xcd70('0x8'));var ejs=require('ejs');var fs=require('fs');var _=require('lodash');var squel=require(_0xcd70('0x9'));var crypto=require(_0xcd70('0xa'));var jsforce=require(_0xcd70('0xb'));var deskjs=require(_0xcd70('0xc'));var toCsv=require('to-csv');var querystring=require('querystring');var Papa=require(_0xcd70('0xd'));var Redis=require(_0xcd70('0xe'));var authService=require(_0xcd70('0xf'));var qs=require(_0xcd70('0x10'));var as=require(_0xcd70('0x11'));var hardwareService=require(_0xcd70('0x12'));var logger=require(_0xcd70('0x13'))(_0xcd70('0x14'));var utils=require(_0xcd70('0x15'));var config=require(_0xcd70('0x16'));var db=require(_0xcd70('0x17'))['db'];var jayson=require(_0xcd70('0x18'));var client=jayson[_0xcd70('0x19')][_0xcd70('0x1a')]({'port':0x232a});function checkPasswordPattern(_0x1f947,_0x537863,_0x3f43db){if(_0x3f43db){var _0x31cfc0=new RegExp(/(?=.*[a-z])(?=.*[A-Z])(?=.*[0-9])(?=.*[?!@#\$%\^&\*~\-_=+[{\]\}])(?=.{8,})/);if(_0x31cfc0['test'](_0x537863)){return _0x1f947;}else{throw new db[(_0xcd70('0x1b'))][(_0xcd70('0x1c'))](_0xcd70('0x1d'));}}else{return _0x1f947;}}function respondWithRpcPromise(_0x27a0db,_0x463451,_0x55d6bb,_0x5d57f3){return new BPromise(function(_0x43b615,_0xa8c414){var _0x17109a=_0x5d57f3||client;return _0x17109a[_0xcd70('0x1e')](_0x27a0db,_0x55d6bb)[_0xcd70('0x1f')](function(_0x445a54){logger['info']('VoiceContext,\x20%s,\x20%s',_0x463451,'request\x20sent');logger[_0xcd70('0x20')]('VoiceContext,\x20%s,\x20%s,\x20%s',_0x463451,'request\x20sent',JSON[_0xcd70('0x21')](_0x445a54));if(_0x445a54[_0xcd70('0x22')]){if(_0x445a54['error'][_0xcd70('0x23')]===0x1f4){logger[_0xcd70('0x22')](_0xcd70('0x24'),_0x463451,_0x445a54[_0xcd70('0x22')][_0xcd70('0x25')]);return _0xa8c414(_0x445a54[_0xcd70('0x22')][_0xcd70('0x25')]);}logger[_0xcd70('0x22')](_0xcd70('0x24'),_0x463451,_0x445a54[_0xcd70('0x22')][_0xcd70('0x25')]);return _0x43b615(_0x445a54[_0xcd70('0x22')][_0xcd70('0x25')]);}else{logger[_0xcd70('0x26')](_0xcd70('0x24'),_0x463451,_0xcd70('0x27'));_0x43b615(_0x445a54[_0xcd70('0x28')][_0xcd70('0x25')]);}})['catch'](function(_0x33ed6a){logger[_0xcd70('0x22')](_0xcd70('0x24'),_0x463451,_0x33ed6a);_0xa8c414(_0x33ed6a);});});}function respondWithStatusCode(_0x452e27,_0x5184c5){_0x5184c5=_0x5184c5||0xcc;return function(_0x3cf285){if(_0x3cf285){return _0x452e27[_0xcd70('0x29')](_0x5184c5);}return _0x452e27[_0xcd70('0x2a')](_0x5184c5)[_0xcd70('0x2b')]();};}function respondWithResult(_0x4b765e,_0x16455d){_0x16455d=_0x16455d||0xc8;return function(_0xec91e){if(_0xec91e){return _0x4b765e['status'](_0x16455d)[_0xcd70('0x2c')](_0xec91e);}};}function respondWithFilteredResult(_0xd3e632,_0x1c3329){return function(_0x1ff079){if(_0x1ff079){var _0x25c7f7=_0x1ff079[_0xcd70('0x2d')],_0x3cdacb=_0x1c3329[_0xcd70('0x2e')],_0x3df6bf=_0x1c3329['offset']+_0x1c3329[_0xcd70('0x2f')],_0x4aa375;if(_0x3df6bf>=_0x25c7f7){_0x3df6bf=_0x25c7f7;_0x4aa375=0xc8;}else{_0x4aa375=0xce;}_0xd3e632[_0xcd70('0x2a')](_0x4aa375);return _0xd3e632['set']('Content-Range',_0x3cdacb+'-'+_0x3df6bf+'/'+_0x25c7f7)[_0xcd70('0x2c')](_0x1ff079);}return null;};}function patchUpdates(_0x8c8f40){return function(_0x3f9e3b){try{jsonpatch[_0xcd70('0x30')](_0x3f9e3b,_0x8c8f40,!![]);}catch(_0x507075){return BPromise[_0xcd70('0x31')](_0x507075);}return _0x3f9e3b[_0xcd70('0x32')]();};}function saveUpdates(_0x1d4265,_0x100931){return function(_0x45dbac){if(_0x45dbac){return _0x45dbac[_0xcd70('0x33')](_0x1d4265)['then'](function(_0x49b57c){return _0x49b57c;});}return null;};}function removeEntity(_0x3092b6,_0x5739f2){return function(_0x3dfbd6){if(_0x3dfbd6){return _0x3dfbd6['destroy']()['then'](function(){var _0x204b4f=_0x3dfbd6['get']({'plain':!![]});var _0x59a401=_0xcd70('0x34');return db[_0xcd70('0x35')][_0xcd70('0x36')]({'where':{'type':_0x59a401,'resourceId':_0x204b4f['id']}})[_0xcd70('0x1f')](function(){return _0x3dfbd6;});})[_0xcd70('0x1f')](function(){_0x3092b6[_0xcd70('0x2a')](0xcc)[_0xcd70('0x2b')]();});}};}function handleEntityNotFound(_0x1e6292,_0x539e23){return function(_0x421012){if(!_0x421012){_0x1e6292[_0xcd70('0x29')](0x194);}return _0x421012;};}function handleError(_0x43a9f2,_0x1d6398){_0x1d6398=_0x1d6398||0x1f4;return function(_0x30e97f){logger[_0xcd70('0x22')](_0x30e97f[_0xcd70('0x37')]);if(_0x30e97f[_0xcd70('0x38')]){delete _0x30e97f['name'];}_0x43a9f2[_0xcd70('0x2a')](_0x1d6398)['send'](_0x30e97f);};}exports[_0xcd70('0x39')]=function(_0x12b9ea,_0x1d42c3){var _0x147f7d={},_0xdae6a6={},_0x444fb1={'count':0x0,'rows':[]};var _0x5aabf3=_[_0xcd70('0x3a')](db[_0xcd70('0x3b')][_0xcd70('0x3c')],function(_0x19cc8e){return{'name':_0x19cc8e['fieldName'],'type':_0x19cc8e[_0xcd70('0x3d')][_0xcd70('0x3e')]};});_0xdae6a6[_0xcd70('0x3f')]=_[_0xcd70('0x3a')](_0x5aabf3,_0xcd70('0x38'));_0xdae6a6[_0xcd70('0x40')]=_[_0xcd70('0x41')](_0x12b9ea[_0xcd70('0x40')]);_0xdae6a6[_0xcd70('0x42')]=_['intersection'](_0xdae6a6[_0xcd70('0x3f')],_0xdae6a6[_0xcd70('0x40')]);_0x147f7d[_0xcd70('0x43')]=_[_0xcd70('0x44')](_0xdae6a6[_0xcd70('0x3f')],qs[_0xcd70('0x45')](_0x12b9ea[_0xcd70('0x40')][_0xcd70('0x45')]));_0x147f7d[_0xcd70('0x43')]=_0x147f7d[_0xcd70('0x43')]['length']?_0x147f7d[_0xcd70('0x43')]:_0xdae6a6[_0xcd70('0x3f')];if(!_0x12b9ea[_0xcd70('0x40')]['hasOwnProperty']('nolimit')){_0x147f7d['limit']=qs['limit'](_0x12b9ea[_0xcd70('0x40')][_0xcd70('0x2f')]);_0x147f7d['offset']=qs[_0xcd70('0x2e')](_0x12b9ea['query'][_0xcd70('0x2e')]);}_0x147f7d[_0xcd70('0x46')]=qs[_0xcd70('0x47')](_0x12b9ea[_0xcd70('0x40')]['sort']);_0x147f7d[_0xcd70('0x48')]=qs[_0xcd70('0x42')](_[_0xcd70('0x49')](_0x12b9ea[_0xcd70('0x40')],_0xdae6a6[_0xcd70('0x42')]));if(_0x12b9ea[_0xcd70('0x40')][_0xcd70('0x4a')]){_0x147f7d[_0xcd70('0x48')]=_[_0xcd70('0x4b')](_0x147f7d[_0xcd70('0x48')],{'$or':_[_0xcd70('0x3a')](_0x5aabf3,function(_0x56c7f9){if(_0x56c7f9[_0xcd70('0x3d')]!==_0xcd70('0x4c')){var _0x198939={};_0x198939[_0x56c7f9[_0xcd70('0x38')]]={'$like':'%'+_0x12b9ea[_0xcd70('0x40')][_0xcd70('0x4a')]+'%'};return _0x198939;}})});}_0x147f7d=_[_0xcd70('0x4b')]({},_0x147f7d,_0x12b9ea['options']);var _0x261f70={'where':_0x147f7d['where']};return db[_0xcd70('0x3b')][_0xcd70('0x2d')](_0x261f70)['then'](function(_0x26e31f){_0x444fb1[_0xcd70('0x2d')]=_0x26e31f;if(_0x12b9ea['query'][_0xcd70('0x4d')]){_0x147f7d['include']=[{'all':!![]}];}return db[_0xcd70('0x3b')][_0xcd70('0x4e')](_0x147f7d);})[_0xcd70('0x1f')](function(_0xa62ac5){_0x444fb1[_0xcd70('0x4f')]=_0xa62ac5;return _0x444fb1;})['then'](respondWithFilteredResult(_0x1d42c3,_0x147f7d))[_0xcd70('0x50')](handleError(_0x1d42c3,null));};exports[_0xcd70('0x51')]=function(_0x480970,_0x28f44d){var _0x69bd96={'raw':![],'where':{'id':_0x480970[_0xcd70('0x52')]['id']}},_0x482ecb={};_0x482ecb['model']=_[_0xcd70('0x41')](db[_0xcd70('0x3b')][_0xcd70('0x3c')]);_0x482ecb[_0xcd70('0x40')]=_[_0xcd70('0x41')](_0x480970['query']);_0x482ecb['filters']=_[_0xcd70('0x44')](_0x482ecb[_0xcd70('0x3f')],_0x482ecb[_0xcd70('0x40')]);_0x69bd96[_0xcd70('0x43')]=_[_0xcd70('0x44')](_0x482ecb[_0xcd70('0x3f')],qs[_0xcd70('0x45')](_0x480970['query'][_0xcd70('0x45')]));_0x69bd96[_0xcd70('0x43')]=_0x69bd96[_0xcd70('0x43')]['length']?_0x69bd96[_0xcd70('0x43')]:_0x482ecb[_0xcd70('0x3f')];if(_0x480970[_0xcd70('0x40')][_0xcd70('0x4d')]){_0x69bd96[_0xcd70('0x53')]=[{'all':!![]}];}_0x69bd96=_[_0xcd70('0x4b')]({},_0x69bd96,_0x480970[_0xcd70('0x54')]);return db[_0xcd70('0x3b')][_0xcd70('0x55')](_0x69bd96)[_0xcd70('0x1f')](handleEntityNotFound(_0x28f44d,null))[_0xcd70('0x1f')](respondWithResult(_0x28f44d,null))[_0xcd70('0x50')](handleError(_0x28f44d,null));};exports[_0xcd70('0x56')]=function(_0x2ca451,_0x52e890,_0x2e8ecb){var _0x12de6c;return db[_0xcd70('0x3b')][_0xcd70('0x56')](_0x2ca451[_0xcd70('0x57')],{'raw':!![]})['then'](function(_0xfbc6bb){_0x12de6c=_0xfbc6bb;return db[_0xcd70('0x3b')]['findAll']({'raw':!![]});})[_0xcd70('0x1f')](function(_0x53fb4b){var _0x588c37=fs['readFileSync'](path['join'](config[_0xcd70('0x58')],'server/files/templates/context.ejs'),_0xcd70('0x59'));var _0x4d43e8=ejs[_0xcd70('0x5a')](_0x588c37,{'contexts':_0x53fb4b||[]});fs['writeFileSync'](_0xcd70('0x5b'),_0x4d43e8);})[_0xcd70('0x1f')](function(){return respondWithRpcPromise('Reload','create',{'module':_0xcd70('0x5c')});})['then'](function(){var _0x395373=_0x2ca451[_0xcd70('0x5d')][_0xcd70('0x5e')]({'plain':!![]});if(!_0x395373)throw new Error(_0xcd70('0x5f'));if(_0x395373[_0xcd70('0x60')]==='user'){var _0x774375=_0x12de6c[_0xcd70('0x5e')]({'plain':!![]});return db[_0xcd70('0x61')][_0xcd70('0x55')]({'where':{'name':_0xcd70('0x34'),'userProfileId':_0x395373[_0xcd70('0x62')]},'raw':!![]})[_0xcd70('0x1f')](function(_0x36a2b4){if(_0x36a2b4&&_0x36a2b4[_0xcd70('0x63')]===0x0){return db['UserProfileResource'][_0xcd70('0x56')]({'name':_0x774375['name'],'resourceId':_0x774375['id'],'type':_0x36a2b4['name'],'sectionId':_0x36a2b4['id']},{})[_0xcd70('0x1f')](function(){return _0x12de6c;});}else{return _0x12de6c;}})['catch'](function(_0x2fe06e){logger[_0xcd70('0x22')](_0xcd70('0x64'),_0x2fe06e);throw _0x2fe06e;});}return _0x12de6c;})[_0xcd70('0x1f')](respondWithResult(_0x52e890,0xc9))['catch'](handleError(_0x52e890,null));};exports[_0xcd70('0x33')]=function(_0x36b7e8,_0x35c414,_0x67d46c){var _0x105ac8;return db[_0xcd70('0x3b')][_0xcd70('0x55')]({'where':{'id':_0x36b7e8[_0xcd70('0x52')]['id']}})[_0xcd70('0x1f')](handleEntityNotFound(_0x35c414,null))[_0xcd70('0x1f')](saveUpdates(_0x36b7e8[_0xcd70('0x57')],null))['then'](function(_0x43ac50){if(_0x43ac50){_0x105ac8=_0x43ac50;return db['VoiceContext'][_0xcd70('0x4e')]({'raw':!![]});}})[_0xcd70('0x1f')](function(_0x5dbb86){var _0x29d054=fs[_0xcd70('0x65')](path[_0xcd70('0x66')](config['root'],_0xcd70('0x67')),_0xcd70('0x59'));var _0x201428=ejs[_0xcd70('0x5a')](_0x29d054,{'contexts':_0x5dbb86||[]});fs[_0xcd70('0x68')](_0xcd70('0x5b'),_0x201428);})['then'](function(){return respondWithRpcPromise(_0xcd70('0x69'),_0xcd70('0x33'),{'module':_0xcd70('0x5c')});})['then'](function(){return _0x105ac8;})[_0xcd70('0x1f')](respondWithResult(_0x35c414,null))['catch'](handleError(_0x35c414,null));};exports['destroy']=function(_0x30a44b,_0x2f3a5d,_0x2a404e){var _0x29bac3;return db[_0xcd70('0x3b')][_0xcd70('0x55')]({'where':{'id':_0x30a44b[_0xcd70('0x52')]['id']}})[_0xcd70('0x1f')](handleEntityNotFound(_0x2f3a5d,null))[_0xcd70('0x1f')](removeEntity(_0x2f3a5d,null))[_0xcd70('0x1f')](function(){return db[_0xcd70('0x3b')]['findAll']({'raw':!![]});})[_0xcd70('0x1f')](function(_0x59fc9f){var _0x5035c=fs['readFileSync'](path['join'](config[_0xcd70('0x58')],_0xcd70('0x67')),_0xcd70('0x59'));var _0x46892c=ejs[_0xcd70('0x5a')](_0x5035c,{'contexts':_0x59fc9f});fs[_0xcd70('0x68')]('/etc/asterisk/extensions_xcally_contexts.conf',_0x46892c);return respondWithRpcPromise(_0xcd70('0x69'),_0xcd70('0x36'),{'module':_0xcd70('0x5c')});})[_0xcd70('0x50')](handleError(_0x2f3a5d,null));};
\ No newline at end of file
+var _0xc6de=['path','sox','to-csv','ejs','lodash','squel','crypto','desk.js','papaparse','ioredis','../../components/auth/service','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/environment','../../mysqldb','jayson/promise','client','test','then','VoiceContext,\x20%s,\x20%s','VoiceContext,\x20%s,\x20%s,\x20%s','request\x20sent','error','message','info','result','catch','sendStatus','status','end','count','offset','set','Content-Range','json','apply','reject','save','update','destroy','get','stack','name','send','index','map','VoiceContext','rawAttributes','fieldName','type','model','query','keys','filters','attributes','intersection','fields','hasOwnProperty','nolimit','limit','order','sort','filter','merge','VIRTUAL','where','include','findAll','show','params','includeAll','options','find','create','body','readFileSync','join','root','server/files/templates/context.ejs','/etc/asterisk/extensions_xcally_contexts.conf','Reload','user','Unable\x20to\x20retrieve\x20the\x20current\x20user','UserProfileSection','userProfileId','autoAssociation','UserProfileResource','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','utf8','render','chan_sip.so','html-pdf','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','bluebird','mustache','util'];(function(_0x22416b,_0x57990d){var _0x28367d=function(_0x355d01){while(--_0x355d01){_0x22416b['push'](_0x22416b['shift']());}};_0x28367d(++_0x57990d);}(_0xc6de,0x193));var _0xec6d=function(_0x16ed87,_0x1be1a2){_0x16ed87=_0x16ed87-0x0;var _0xc1a1d8=_0xc6de[_0x16ed87];return _0xc1a1d8;};'use strict';var pdf=require(_0xec6d('0x0'));var emlformat=require(_0xec6d('0x1'));var rimraf=require(_0xec6d('0x2'));var zipdir=require(_0xec6d('0x3'));var jsonpatch=require(_0xec6d('0x4'));var rp=require(_0xec6d('0x5'));var moment=require('moment');var BPromise=require(_0xec6d('0x6'));var Mustache=require(_0xec6d('0x7'));var util=require(_0xec6d('0x8'));var path=require(_0xec6d('0x9'));var sox=require(_0xec6d('0xa'));var csv=require(_0xec6d('0xb'));var ejs=require(_0xec6d('0xc'));var fs=require('fs');var _=require(_0xec6d('0xd'));var squel=require(_0xec6d('0xe'));var crypto=require(_0xec6d('0xf'));var jsforce=require('jsforce');var deskjs=require(_0xec6d('0x10'));var toCsv=require(_0xec6d('0xb'));var querystring=require('querystring');var Papa=require(_0xec6d('0x11'));var Redis=require(_0xec6d('0x12'));var authService=require(_0xec6d('0x13'));var qs=require('../../components/parsers/qs');var as=require(_0xec6d('0x14'));var hardwareService=require(_0xec6d('0x15'));var logger=require(_0xec6d('0x16'))(_0xec6d('0x17'));var utils=require(_0xec6d('0x18'));var config=require(_0xec6d('0x19'));var db=require(_0xec6d('0x1a'))['db'];var jayson=require(_0xec6d('0x1b'));var client=jayson[_0xec6d('0x1c')]['http']({'port':0x232a});function checkPasswordPattern(_0x121361,_0x48e8d1,_0x4e7c95){if(_0x4e7c95){var _0x5cd358=new RegExp(/(?=.*[a-z])(?=.*[A-Z])(?=.*[0-9])(?=.*[?!@#\$%\^&\*~\-_=+[{\]\}])(?=.{8,})/);if(_0x5cd358[_0xec6d('0x1d')](_0x48e8d1)){return _0x121361;}else{throw new db['Sequelize']['ValidationError']('The\x20password\x20must\x20be\x20at\x20least\x208\x20characters\x20long\x20and\x20have\x201\x20lowercase\x20character,\x201\x20uppercase\x20character,\x201\x20number\x20and\x201\x20special\x20character\x20~!@#$%^&-_=+[{]}.');}}else{return _0x121361;}}function respondWithRpcPromise(_0x245101,_0x37fb69,_0x56bba6,_0x3d34f4){return new BPromise(function(_0x2f2ea8,_0x1484b7){var _0x4d8dba=_0x3d34f4||client;return _0x4d8dba['request'](_0x245101,_0x56bba6)[_0xec6d('0x1e')](function(_0x25c72d){logger['info'](_0xec6d('0x1f'),_0x37fb69,'request\x20sent');logger['debug'](_0xec6d('0x20'),_0x37fb69,_0xec6d('0x21'),JSON['stringify'](_0x25c72d));if(_0x25c72d[_0xec6d('0x22')]){if(_0x25c72d[_0xec6d('0x22')]['code']===0x1f4){logger[_0xec6d('0x22')]('VoiceContext,\x20%s,\x20%s',_0x37fb69,_0x25c72d['error'][_0xec6d('0x23')]);return _0x1484b7(_0x25c72d[_0xec6d('0x22')][_0xec6d('0x23')]);}logger['error'](_0xec6d('0x1f'),_0x37fb69,_0x25c72d[_0xec6d('0x22')][_0xec6d('0x23')]);return _0x2f2ea8(_0x25c72d[_0xec6d('0x22')]['message']);}else{logger[_0xec6d('0x24')](_0xec6d('0x1f'),_0x37fb69,_0xec6d('0x21'));_0x2f2ea8(_0x25c72d[_0xec6d('0x25')][_0xec6d('0x23')]);}})[_0xec6d('0x26')](function(_0x273068){logger['error']('VoiceContext,\x20%s,\x20%s',_0x37fb69,_0x273068);_0x1484b7(_0x273068);});});}function respondWithStatusCode(_0x33a7cd,_0x4a6da1){_0x4a6da1=_0x4a6da1||0xcc;return function(_0x7443b0){if(_0x7443b0){return _0x33a7cd[_0xec6d('0x27')](_0x4a6da1);}return _0x33a7cd[_0xec6d('0x28')](_0x4a6da1)[_0xec6d('0x29')]();};}function respondWithResult(_0x48690d,_0x465f88){_0x465f88=_0x465f88||0xc8;return function(_0x80ece){if(_0x80ece){return _0x48690d[_0xec6d('0x28')](_0x465f88)['json'](_0x80ece);}};}function respondWithFilteredResult(_0x1dfbeb,_0x1a524c){return function(_0x31709a){if(_0x31709a){var _0x1f1b9f=_0x31709a[_0xec6d('0x2a')],_0x1c6652=_0x1a524c['offset'],_0x50ea54=_0x1a524c[_0xec6d('0x2b')]+_0x1a524c['limit'],_0x19eef1;if(_0x50ea54>=_0x1f1b9f){_0x50ea54=_0x1f1b9f;_0x19eef1=0xc8;}else{_0x19eef1=0xce;}_0x1dfbeb['status'](_0x19eef1);return _0x1dfbeb[_0xec6d('0x2c')](_0xec6d('0x2d'),_0x1c6652+'-'+_0x50ea54+'/'+_0x1f1b9f)[_0xec6d('0x2e')](_0x31709a);}return null;};}function patchUpdates(_0x4d05d9){return function(_0x25b0e5){try{jsonpatch[_0xec6d('0x2f')](_0x25b0e5,_0x4d05d9,!![]);}catch(_0x27ae5c){return BPromise[_0xec6d('0x30')](_0x27ae5c);}return _0x25b0e5[_0xec6d('0x31')]();};}function saveUpdates(_0x5e925b,_0x23bcbb){return function(_0x505fa4){if(_0x505fa4){return _0x505fa4[_0xec6d('0x32')](_0x5e925b)[_0xec6d('0x1e')](function(_0x533ff1){return _0x533ff1;});}return null;};}function removeEntity(_0x4adcc2,_0x22d6b7){return function(_0x3fb571){if(_0x3fb571){return _0x3fb571[_0xec6d('0x33')]()[_0xec6d('0x1e')](function(){var _0x1a13a9=_0x3fb571[_0xec6d('0x34')]({'plain':!![]});var _0xfe1a4a='Contexts';return db['UserProfileResource'][_0xec6d('0x33')]({'where':{'type':_0xfe1a4a,'resourceId':_0x1a13a9['id']}})[_0xec6d('0x1e')](function(){return _0x3fb571;});})['then'](function(){_0x4adcc2['status'](0xcc)[_0xec6d('0x29')]();});}};}function handleEntityNotFound(_0x2c9f3c,_0x4631e9){return function(_0x2cd6a6){if(!_0x2cd6a6){_0x2c9f3c[_0xec6d('0x27')](0x194);}return _0x2cd6a6;};}function handleError(_0x1d12c1,_0x1980e3){_0x1980e3=_0x1980e3||0x1f4;return function(_0x55854a){logger[_0xec6d('0x22')](_0x55854a[_0xec6d('0x35')]);if(_0x55854a[_0xec6d('0x36')]){delete _0x55854a['name'];}_0x1d12c1[_0xec6d('0x28')](_0x1980e3)[_0xec6d('0x37')](_0x55854a);};}exports[_0xec6d('0x38')]=function(_0x3d56c6,_0x37aa26){var _0x17f13c={},_0x19edf6={},_0x846107={'count':0x0,'rows':[]};var _0x3ee0fe=_[_0xec6d('0x39')](db[_0xec6d('0x3a')][_0xec6d('0x3b')],function(_0x24fe87){return{'name':_0x24fe87[_0xec6d('0x3c')],'type':_0x24fe87[_0xec6d('0x3d')]['key']};});_0x19edf6[_0xec6d('0x3e')]=_[_0xec6d('0x39')](_0x3ee0fe,_0xec6d('0x36'));_0x19edf6[_0xec6d('0x3f')]=_[_0xec6d('0x40')](_0x3d56c6['query']);_0x19edf6[_0xec6d('0x41')]=_['intersection'](_0x19edf6[_0xec6d('0x3e')],_0x19edf6[_0xec6d('0x3f')]);_0x17f13c[_0xec6d('0x42')]=_[_0xec6d('0x43')](_0x19edf6['model'],qs[_0xec6d('0x44')](_0x3d56c6['query'][_0xec6d('0x44')]));_0x17f13c['attributes']=_0x17f13c[_0xec6d('0x42')]['length']?_0x17f13c[_0xec6d('0x42')]:_0x19edf6[_0xec6d('0x3e')];if(!_0x3d56c6[_0xec6d('0x3f')][_0xec6d('0x45')](_0xec6d('0x46'))){_0x17f13c['limit']=qs[_0xec6d('0x47')](_0x3d56c6['query'][_0xec6d('0x47')]);_0x17f13c[_0xec6d('0x2b')]=qs[_0xec6d('0x2b')](_0x3d56c6[_0xec6d('0x3f')][_0xec6d('0x2b')]);}_0x17f13c[_0xec6d('0x48')]=qs[_0xec6d('0x49')](_0x3d56c6['query']['sort']);_0x17f13c['where']=qs[_0xec6d('0x41')](_['pick'](_0x3d56c6['query'],_0x19edf6[_0xec6d('0x41')]));if(_0x3d56c6[_0xec6d('0x3f')][_0xec6d('0x4a')]){_0x17f13c['where']=_[_0xec6d('0x4b')](_0x17f13c['where'],{'$or':_[_0xec6d('0x39')](_0x3ee0fe,function(_0x51cc35){if(_0x51cc35[_0xec6d('0x3d')]!==_0xec6d('0x4c')){var _0xc845b5={};_0xc845b5[_0x51cc35['name']]={'$like':'%'+_0x3d56c6[_0xec6d('0x3f')][_0xec6d('0x4a')]+'%'};return _0xc845b5;}})});}_0x17f13c=_[_0xec6d('0x4b')]({},_0x17f13c,_0x3d56c6['options']);var _0x3d4407={'where':_0x17f13c[_0xec6d('0x4d')]};return db[_0xec6d('0x3a')][_0xec6d('0x2a')](_0x3d4407)[_0xec6d('0x1e')](function(_0xb4dfe0){_0x846107['count']=_0xb4dfe0;if(_0x3d56c6[_0xec6d('0x3f')]['includeAll']){_0x17f13c[_0xec6d('0x4e')]=[{'all':!![]}];}return db['VoiceContext'][_0xec6d('0x4f')](_0x17f13c);})[_0xec6d('0x1e')](function(_0x721f09){_0x846107['rows']=_0x721f09;return _0x846107;})['then'](respondWithFilteredResult(_0x37aa26,_0x17f13c))[_0xec6d('0x26')](handleError(_0x37aa26,null));};exports[_0xec6d('0x50')]=function(_0x36cbce,_0x4bd51c){var _0x25fa34={'raw':![],'where':{'id':_0x36cbce[_0xec6d('0x51')]['id']}},_0x77bbc6={};_0x77bbc6[_0xec6d('0x3e')]=_[_0xec6d('0x40')](db[_0xec6d('0x3a')][_0xec6d('0x3b')]);_0x77bbc6[_0xec6d('0x3f')]=_['keys'](_0x36cbce[_0xec6d('0x3f')]);_0x77bbc6[_0xec6d('0x41')]=_[_0xec6d('0x43')](_0x77bbc6[_0xec6d('0x3e')],_0x77bbc6['query']);_0x25fa34[_0xec6d('0x42')]=_[_0xec6d('0x43')](_0x77bbc6[_0xec6d('0x3e')],qs[_0xec6d('0x44')](_0x36cbce[_0xec6d('0x3f')][_0xec6d('0x44')]));_0x25fa34['attributes']=_0x25fa34[_0xec6d('0x42')]['length']?_0x25fa34[_0xec6d('0x42')]:_0x77bbc6['model'];if(_0x36cbce[_0xec6d('0x3f')][_0xec6d('0x52')]){_0x25fa34['include']=[{'all':!![]}];}_0x25fa34=_[_0xec6d('0x4b')]({},_0x25fa34,_0x36cbce[_0xec6d('0x53')]);return db[_0xec6d('0x3a')][_0xec6d('0x54')](_0x25fa34)[_0xec6d('0x1e')](handleEntityNotFound(_0x4bd51c,null))[_0xec6d('0x1e')](respondWithResult(_0x4bd51c,null))[_0xec6d('0x26')](handleError(_0x4bd51c,null));};exports[_0xec6d('0x55')]=function(_0xf30335,_0x2c63f2,_0x44c971){var _0x16b68d;return db[_0xec6d('0x3a')][_0xec6d('0x55')](_0xf30335[_0xec6d('0x56')],{'raw':!![]})[_0xec6d('0x1e')](function(_0x3c9991){_0x16b68d=_0x3c9991;return db[_0xec6d('0x3a')][_0xec6d('0x4f')]({'raw':!![]});})['then'](function(_0x613972){var _0x5a890f=fs[_0xec6d('0x57')](path[_0xec6d('0x58')](config[_0xec6d('0x59')],_0xec6d('0x5a')),'utf8');var _0x17ae55=ejs['render'](_0x5a890f,{'contexts':_0x613972||[]});fs['writeFileSync'](_0xec6d('0x5b'),_0x17ae55);})[_0xec6d('0x1e')](function(){return respondWithRpcPromise(_0xec6d('0x5c'),_0xec6d('0x55'),{'module':'chan_sip.so'});})['then'](function(){var _0x21ad74=_0xf30335[_0xec6d('0x5d')]['get']({'plain':!![]});if(!_0x21ad74)throw new Error(_0xec6d('0x5e'));if(_0x21ad74['role']==='user'){var _0x13c4c7=_0x16b68d['get']({'plain':!![]});return db[_0xec6d('0x5f')][_0xec6d('0x54')]({'where':{'name':'Contexts','userProfileId':_0x21ad74[_0xec6d('0x60')]},'raw':!![]})[_0xec6d('0x1e')](function(_0x514508){if(_0x514508&&_0x514508[_0xec6d('0x61')]===0x0){return db[_0xec6d('0x62')][_0xec6d('0x55')]({'name':_0x13c4c7[_0xec6d('0x36')],'resourceId':_0x13c4c7['id'],'type':_0x514508[_0xec6d('0x36')],'sectionId':_0x514508['id']},{})[_0xec6d('0x1e')](function(){return _0x16b68d;});}else{return _0x16b68d;}})['catch'](function(_0x4215b2){logger[_0xec6d('0x22')](_0xec6d('0x63'),_0x4215b2);throw _0x4215b2;});}return _0x16b68d;})[_0xec6d('0x1e')](respondWithResult(_0x2c63f2,0xc9))[_0xec6d('0x26')](handleError(_0x2c63f2,null));};exports['update']=function(_0x36bf35,_0x2c6c4d,_0x145aaa){var _0x2f5def;return db[_0xec6d('0x3a')][_0xec6d('0x54')]({'where':{'id':_0x36bf35[_0xec6d('0x51')]['id']}})['then'](handleEntityNotFound(_0x2c6c4d,null))[_0xec6d('0x1e')](saveUpdates(_0x36bf35['body'],null))[_0xec6d('0x1e')](function(_0x4aef96){if(_0x4aef96){_0x2f5def=_0x4aef96;return db[_0xec6d('0x3a')][_0xec6d('0x4f')]({'raw':!![]});}})[_0xec6d('0x1e')](function(_0x22d4db){var _0x7885c4=fs[_0xec6d('0x57')](path[_0xec6d('0x58')](config[_0xec6d('0x59')],_0xec6d('0x5a')),_0xec6d('0x64'));var _0xde0567=ejs[_0xec6d('0x65')](_0x7885c4,{'contexts':_0x22d4db||[]});fs['writeFileSync']('/etc/asterisk/extensions_xcally_contexts.conf',_0xde0567);})[_0xec6d('0x1e')](function(){return respondWithRpcPromise(_0xec6d('0x5c'),_0xec6d('0x32'),{'module':_0xec6d('0x66')});})['then'](function(){return _0x2f5def;})['then'](respondWithResult(_0x2c6c4d,null))[_0xec6d('0x26')](handleError(_0x2c6c4d,null));};exports[_0xec6d('0x33')]=function(_0x3b8f6b,_0x4ae649,_0xd68b63){var _0x32041e;return db[_0xec6d('0x3a')][_0xec6d('0x54')]({'where':{'id':_0x3b8f6b[_0xec6d('0x51')]['id']}})[_0xec6d('0x1e')](handleEntityNotFound(_0x4ae649,null))[_0xec6d('0x1e')](removeEntity(_0x4ae649,null))[_0xec6d('0x1e')](function(){return db[_0xec6d('0x3a')][_0xec6d('0x4f')]({'raw':!![]});})['then'](function(_0x3e192a){var _0x26188f=fs[_0xec6d('0x57')](path['join'](config[_0xec6d('0x59')],_0xec6d('0x5a')),_0xec6d('0x64'));var _0x7aa978=ejs[_0xec6d('0x65')](_0x26188f,{'contexts':_0x3e192a});fs['writeFileSync'](_0xec6d('0x5b'),_0x7aa978);return respondWithRpcPromise(_0xec6d('0x5c'),'destroy',{'module':'chan_sip.so'});})[_0xec6d('0x26')](handleError(_0x4ae649,null));};
\ No newline at end of file
diff --git a/server/api/voiceContext/voiceContext.model.js b/server/api/voiceContext/voiceContext.model.js
index 7955490..b7fc1ef 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 _0x54bd=['request-promise','path','../../config/environment','./voiceContext.attributes','exports','VoiceContext','util','../../config/logger','api','moment','bluebird'];(function(_0x5b644e,_0x2e5e07){var _0x49c6bf=function(_0x3032d9){while(--_0x3032d9){_0x5b644e['push'](_0x5b644e['shift']());}};_0x49c6bf(++_0x2e5e07);}(_0x54bd,0x10e));var _0xd54b=function(_0xd6ea6a,_0xebcf57){_0xd6ea6a=_0xd6ea6a-0x0;var _0xc242f8=_0x54bd[_0xd6ea6a];return _0xc242f8;};'use strict';var _=require('lodash');var util=require(_0xd54b('0x0'));var logger=require(_0xd54b('0x1'))(_0xd54b('0x2'));var moment=require(_0xd54b('0x3'));var BPromise=require(_0xd54b('0x4'));var rp=require(_0xd54b('0x5'));var fs=require('fs');var path=require(_0xd54b('0x6'));var rimraf=require('rimraf');var config=require(_0xd54b('0x7'));var attributes=require(_0xd54b('0x8'));module[_0xd54b('0x9')]=function(_0x4284a5,_0x376e54){return _0x4284a5['define'](_0xd54b('0xa'),attributes,{'tableName':'voice_contexts','paranoid':![],'indexes':[],'timestamps':!![]});};
\ No newline at end of file
+var _0x9397=['lodash','../../config/logger','api','moment','rimraf','../../config/environment','./voiceContext.attributes','define','VoiceContext','voice_contexts'];(function(_0x2a5794,_0x39ccc6){var _0x1f4925=function(_0x3d74d6){while(--_0x3d74d6){_0x2a5794['push'](_0x2a5794['shift']());}};_0x1f4925(++_0x39ccc6);}(_0x9397,0xbe));var _0x7939=function(_0x2867d8,_0xef3ee0){_0x2867d8=_0x2867d8-0x0;var _0x3b8176=_0x9397[_0x2867d8];return _0x3b8176;};'use strict';var _=require(_0x7939('0x0'));var util=require('util');var logger=require(_0x7939('0x1'))(_0x7939('0x2'));var moment=require(_0x7939('0x3'));var BPromise=require('bluebird');var rp=require('request-promise');var fs=require('fs');var path=require('path');var rimraf=require(_0x7939('0x4'));var config=require(_0x7939('0x5'));var attributes=require(_0x7939('0x6'));module['exports']=function(_0x20ba84,_0x8be80e){return _0x20ba84[_0x7939('0x7')](_0x7939('0x8'),attributes,{'tableName':_0x7939('0x9'),'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 db0ce42..3a4d354 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 _0xa109=['lodash','util','moment','bluebird','randomstring','../../mysqldb','../../config/utils','../../config/logger','rpc','client','request','then','info','VoiceContext,\x20%s,\x20%s','request\x20sent','VoiceContext,\x20%s,\x20%s,\x20%s','stringify','error','code','message','result'];(function(_0x1b828b,_0x344400){var _0x98da1a=function(_0x1a0f5b){while(--_0x1a0f5b){_0x1b828b['push'](_0x1b828b['shift']());}};_0x98da1a(++_0x344400);}(_0xa109,0x1b9));var _0x9a10=function(_0x3947c9,_0x4d6c97){_0x3947c9=_0x3947c9-0x0;var _0x2e7871=_0xa109[_0x3947c9];return _0x2e7871;};'use strict';var _=require(_0x9a10('0x0'));var util=require(_0x9a10('0x1'));var moment=require(_0x9a10('0x2'));var BPromise=require(_0x9a10('0x3'));var rs=require(_0x9a10('0x4'));var fs=require('fs');var Redis=require('ioredis');var db=require(_0x9a10('0x5'))['db'];var utils=require(_0x9a10('0x6'));var logger=require(_0x9a10('0x7'))(_0x9a10('0x8'));var config=require('../../config/environment');var jayson=require('jayson/promise');var client=jayson[_0x9a10('0x9')]['http']({'port':0x232a});function respondWithRpcPromise(_0x5d682a,_0x190247,_0x365bb6){return new BPromise(function(_0x1774e9,_0x23fa33){return client[_0x9a10('0xa')](_0x5d682a,_0x365bb6)[_0x9a10('0xb')](function(_0x393480){logger[_0x9a10('0xc')](_0x9a10('0xd'),_0x190247,_0x9a10('0xe'));logger['debug'](_0x9a10('0xf'),_0x190247,'request\x20sent',JSON[_0x9a10('0x10')](_0x393480));if(_0x393480[_0x9a10('0x11')]){if(_0x393480[_0x9a10('0x11')][_0x9a10('0x12')]===0x1f4){logger[_0x9a10('0x11')](_0x9a10('0xd'),_0x190247,_0x393480['error'][_0x9a10('0x13')]);return _0x23fa33(_0x393480[_0x9a10('0x11')][_0x9a10('0x13')]);}logger[_0x9a10('0x11')](_0x9a10('0xd'),_0x190247,_0x393480[_0x9a10('0x11')]['message']);return _0x1774e9(_0x393480[_0x9a10('0x11')]['message']);}else{logger['info'](_0x9a10('0xd'),_0x190247,'request\x20sent');_0x1774e9(_0x393480[_0x9a10('0x14')][_0x9a10('0x13')]);}})['catch'](function(_0x23d9d5){logger[_0x9a10('0x11')](_0x9a10('0xd'),_0x190247,_0x23d9d5);_0x23fa33(_0x23d9d5);});});}
\ No newline at end of file
+var _0x5635=['randomstring','ioredis','../../mysqldb','../../config/logger','rpc','../../config/environment','jayson/promise','client','http','then','info','VoiceContext,\x20%s,\x20%s','debug','VoiceContext,\x20%s,\x20%s,\x20%s','stringify','error','code','message','request\x20sent','util','bluebird'];(function(_0xaa2c62,_0x1626a4){var _0x3cd23e=function(_0x510a36){while(--_0x510a36){_0xaa2c62['push'](_0xaa2c62['shift']());}};_0x3cd23e(++_0x1626a4);}(_0x5635,0xbb));var _0x5563=function(_0x409f0d,_0xfc9d08){_0x409f0d=_0x409f0d-0x0;var _0x1dcec2=_0x5635[_0x409f0d];return _0x1dcec2;};'use strict';var _=require('lodash');var util=require(_0x5563('0x0'));var moment=require('moment');var BPromise=require(_0x5563('0x1'));var rs=require(_0x5563('0x2'));var fs=require('fs');var Redis=require(_0x5563('0x3'));var db=require(_0x5563('0x4'))['db'];var utils=require('../../config/utils');var logger=require(_0x5563('0x5'))(_0x5563('0x6'));var config=require(_0x5563('0x7'));var jayson=require(_0x5563('0x8'));var client=jayson[_0x5563('0x9')][_0x5563('0xa')]({'port':0x232a});function respondWithRpcPromise(_0x477c7b,_0x307f1a,_0x2dcf5b){return new BPromise(function(_0x36d77f,_0x479c2f){return client['request'](_0x477c7b,_0x2dcf5b)[_0x5563('0xb')](function(_0x89306f){logger[_0x5563('0xc')](_0x5563('0xd'),_0x307f1a,'request\x20sent');logger[_0x5563('0xe')](_0x5563('0xf'),_0x307f1a,'request\x20sent',JSON[_0x5563('0x10')](_0x89306f));if(_0x89306f[_0x5563('0x11')]){if(_0x89306f[_0x5563('0x11')][_0x5563('0x12')]===0x1f4){logger[_0x5563('0x11')]('VoiceContext,\x20%s,\x20%s',_0x307f1a,_0x89306f[_0x5563('0x11')][_0x5563('0x13')]);return _0x479c2f(_0x89306f['error'][_0x5563('0x13')]);}logger[_0x5563('0x11')](_0x5563('0xd'),_0x307f1a,_0x89306f[_0x5563('0x11')][_0x5563('0x13')]);return _0x36d77f(_0x89306f[_0x5563('0x11')][_0x5563('0x13')]);}else{logger[_0x5563('0xc')](_0x5563('0xd'),_0x307f1a,_0x5563('0x14'));_0x36d77f(_0x89306f['result'][_0x5563('0x13')]);}})['catch'](function(_0x211b09){logger[_0x5563('0x11')](_0x5563('0xd'),_0x307f1a,_0x211b09);_0x479c2f(_0x211b09);});});}
\ No newline at end of file
diff --git a/server/api/voiceDialReport/index.js b/server/api/voiceDialReport/index.js
index 7de63ed..6e5fba0 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 _0xd74f=['get','isAuthenticated','index','/describe','describe','/:id','post','put','update','delete','destroy','exports','path','connect-timeout','express','Router','../../components/auth/service','../../components/interaction/service','../../config/environment'];(function(_0x27401f,_0x4f19ef){var _0xf7095c=function(_0x99c7c6){while(--_0x99c7c6){_0x27401f['push'](_0x27401f['shift']());}};_0xf7095c(++_0x4f19ef);}(_0xd74f,0x188));var _0xfd74=function(_0x393e11,_0x1f5799){_0x393e11=_0x393e11-0x0;var _0x34731e=_0xd74f[_0x393e11];return _0x34731e;};'use strict';var multer=require('multer');var util=require('util');var path=require(_0xfd74('0x0'));var timeout=require(_0xfd74('0x1'));var express=require(_0xfd74('0x2'));var router=express[_0xfd74('0x3')]();var auth=require(_0xfd74('0x4'));var interaction=require(_0xfd74('0x5'));var config=require(_0xfd74('0x6'));var controller=require('./voiceDialReport.controller');router[_0xfd74('0x7')]('/',auth[_0xfd74('0x8')](),controller[_0xfd74('0x9')]);router['get'](_0xfd74('0xa'),auth['isAuthenticated'](),controller[_0xfd74('0xb')]);router[_0xfd74('0x7')](_0xfd74('0xc'),auth[_0xfd74('0x8')](),controller['show']);router[_0xfd74('0xd')]('/',auth[_0xfd74('0x8')](),controller['create']);router[_0xfd74('0xe')]('/:id',auth[_0xfd74('0x8')](),controller[_0xfd74('0xf')]);router[_0xfd74('0x10')](_0xfd74('0xc'),auth['isAuthenticated'](),controller[_0xfd74('0x11')]);module[_0xfd74('0x12')]=router;
\ No newline at end of file
+var _0xcea7=['/:id','update','multer','util','path','connect-timeout','express','Router','../../components/auth/service','../../config/environment','./voiceDialReport.controller','get','isAuthenticated','index','/describe','describe','show','create'];(function(_0x41ad07,_0x41bf12){var _0x3bcff1=function(_0x2f191a){while(--_0x2f191a){_0x41ad07['push'](_0x41ad07['shift']());}};_0x3bcff1(++_0x41bf12);}(_0xcea7,0x122));var _0x7cea=function(_0x198e0c,_0x38581d){_0x198e0c=_0x198e0c-0x0;var _0x5c7387=_0xcea7[_0x198e0c];return _0x5c7387;};'use strict';var multer=require(_0x7cea('0x0'));var util=require(_0x7cea('0x1'));var path=require(_0x7cea('0x2'));var timeout=require(_0x7cea('0x3'));var express=require(_0x7cea('0x4'));var router=express[_0x7cea('0x5')]();var auth=require(_0x7cea('0x6'));var interaction=require('../../components/interaction/service');var config=require(_0x7cea('0x7'));var controller=require(_0x7cea('0x8'));router[_0x7cea('0x9')]('/',auth[_0x7cea('0xa')](),controller[_0x7cea('0xb')]);router[_0x7cea('0x9')](_0x7cea('0xc'),auth['isAuthenticated'](),controller[_0x7cea('0xd')]);router[_0x7cea('0x9')]('/:id',auth[_0x7cea('0xa')](),controller[_0x7cea('0xe')]);router['post']('/',auth['isAuthenticated'](),controller[_0x7cea('0xf')]);router['put'](_0x7cea('0x10'),auth['isAuthenticated'](),controller[_0x7cea('0x11')]);router['delete'](_0x7cea('0x10'),auth[_0x7cea('0xa')](),controller['destroy']);module['exports']=router;
\ No newline at end of file
diff --git a/server/api/voiceDialReport/voiceDialReport.attributes.js b/server/api/voiceDialReport/voiceDialReport.attributes.js
index b8dfde2..ce47dde 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 _0x5cc7=['called,connect,complete','sequelize','exports','STRING','INTEGER','DATE'];(function(_0x533da2,_0x4c41bb){var _0x552050=function(_0x3aeea2){while(--_0x3aeea2){_0x533da2['push'](_0x533da2['shift']());}};_0x552050(++_0x4c41bb);}(_0x5cc7,0x1e1));var _0x75cc=function(_0x3356f0,_0x5bd0ec){_0x3356f0=_0x3356f0-0x0;var _0x4a911b=_0x5cc7[_0x3356f0];return _0x4a911b;};'use strict';var Sequelize=require(_0x75cc('0x0'));module[_0x75cc('0x1')]={'privilege':{'type':Sequelize[_0x75cc('0x2')]},'channel':{'type':Sequelize[_0x75cc('0x2')]},'channelstate':{'type':Sequelize[_0x75cc('0x3')]},'channelstatedesc':{'type':Sequelize['STRING']},'calleridnum':{'type':Sequelize['STRING']},'calleridname':{'type':Sequelize[_0x75cc('0x2')]},'connectedlinenum':{'type':Sequelize['STRING']},'connectedlinename':{'type':Sequelize[_0x75cc('0x2')]},'language':{'type':Sequelize[_0x75cc('0x2')]},'accountcode':{'type':Sequelize[_0x75cc('0x2')]},'context':{'type':Sequelize[_0x75cc('0x2')]},'exten':{'type':Sequelize[_0x75cc('0x2')]},'priority':{'type':Sequelize[_0x75cc('0x3')]},'uniqueid':{'type':Sequelize['STRING']},'linkedid':{'type':Sequelize[_0x75cc('0x2')]},'destchannel':{'type':Sequelize[_0x75cc('0x2')]},'destchannelstate':{'type':Sequelize[_0x75cc('0x3')]},'destchannelstatedesc':{'type':Sequelize['STRING']},'destcalleridnum':{'type':Sequelize['STRING']},'destcalleridname':{'type':Sequelize['STRING']},'destconnectedlinenum':{'type':Sequelize[_0x75cc('0x2')]},'destconnectedlinename':{'type':Sequelize[_0x75cc('0x2')]},'destlanguage':{'type':Sequelize[_0x75cc('0x2')]},'destaccountcode':{'type':Sequelize['STRING']},'destcontext':{'type':Sequelize[_0x75cc('0x2')]},'destexten':{'type':Sequelize['STRING']},'destpriority':{'type':Sequelize['INTEGER']},'destuniqueid':{'type':Sequelize[_0x75cc('0x2')]},'destlinkedid':{'type':Sequelize['STRING']},'dialstring':{'type':Sequelize[_0x75cc('0x2')]},'dialstatus':{'type':Sequelize[_0x75cc('0x2')]},'starttime':{'type':Sequelize['DATE']},'answertime':{'type':Sequelize[_0x75cc('0x4')]},'endtime':{'type':Sequelize[_0x75cc('0x4')]},'lastevent':{'type':Sequelize[_0x75cc('0x2')],'comment':_0x75cc('0x5')},'routeId':{'type':Sequelize['INTEGER']},'duration':{'type':Sequelize[_0x75cc('0x3')]},'holdtime':{'type':Sequelize[_0x75cc('0x3')]},'billableseconds':{'type':Sequelize[_0x75cc('0x3')]}};
\ No newline at end of file
+var _0xf759=['exports','STRING','INTEGER','DATE','called,connect,complete','sequelize'];(function(_0x32baad,_0x4a3ed5){var _0x525d14=function(_0x125a7c){while(--_0x125a7c){_0x32baad['push'](_0x32baad['shift']());}};_0x525d14(++_0x4a3ed5);}(_0xf759,0x1c1));var _0x9f75=function(_0x3955a2,_0x3bcf09){_0x3955a2=_0x3955a2-0x0;var _0x4bf579=_0xf759[_0x3955a2];return _0x4bf579;};'use strict';var Sequelize=require(_0x9f75('0x0'));module[_0x9f75('0x1')]={'privilege':{'type':Sequelize['STRING']},'channel':{'type':Sequelize[_0x9f75('0x2')]},'channelstate':{'type':Sequelize['INTEGER']},'channelstatedesc':{'type':Sequelize[_0x9f75('0x2')]},'calleridnum':{'type':Sequelize[_0x9f75('0x2')]},'calleridname':{'type':Sequelize['STRING']},'connectedlinenum':{'type':Sequelize[_0x9f75('0x2')]},'connectedlinename':{'type':Sequelize[_0x9f75('0x2')]},'language':{'type':Sequelize[_0x9f75('0x2')]},'accountcode':{'type':Sequelize[_0x9f75('0x2')]},'context':{'type':Sequelize[_0x9f75('0x2')]},'exten':{'type':Sequelize[_0x9f75('0x2')]},'priority':{'type':Sequelize['INTEGER']},'uniqueid':{'type':Sequelize[_0x9f75('0x2')]},'linkedid':{'type':Sequelize[_0x9f75('0x2')]},'destchannel':{'type':Sequelize[_0x9f75('0x2')]},'destchannelstate':{'type':Sequelize['INTEGER']},'destchannelstatedesc':{'type':Sequelize[_0x9f75('0x2')]},'destcalleridnum':{'type':Sequelize[_0x9f75('0x2')]},'destcalleridname':{'type':Sequelize[_0x9f75('0x2')]},'destconnectedlinenum':{'type':Sequelize[_0x9f75('0x2')]},'destconnectedlinename':{'type':Sequelize['STRING']},'destlanguage':{'type':Sequelize['STRING']},'destaccountcode':{'type':Sequelize[_0x9f75('0x2')]},'destcontext':{'type':Sequelize['STRING']},'destexten':{'type':Sequelize[_0x9f75('0x2')]},'destpriority':{'type':Sequelize[_0x9f75('0x3')]},'destuniqueid':{'type':Sequelize[_0x9f75('0x2')]},'destlinkedid':{'type':Sequelize[_0x9f75('0x2')]},'dialstring':{'type':Sequelize[_0x9f75('0x2')]},'dialstatus':{'type':Sequelize['STRING']},'starttime':{'type':Sequelize[_0x9f75('0x4')]},'answertime':{'type':Sequelize[_0x9f75('0x4')]},'endtime':{'type':Sequelize[_0x9f75('0x4')]},'lastevent':{'type':Sequelize[_0x9f75('0x2')],'comment':_0x9f75('0x5')},'routeId':{'type':Sequelize['INTEGER']},'duration':{'type':Sequelize[_0x9f75('0x3')]},'holdtime':{'type':Sequelize[_0x9f75('0x3')]},'billableseconds':{'type':Sequelize[_0x9f75('0x3')]}};
\ No newline at end of file
diff --git a/server/api/voiceDialReport/voiceDialReport.controller.js b/server/api/voiceDialReport/voiceDialReport.controller.js
index f4fd751..14f9cb0 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 _0xb615=['to-csv','ejs','lodash','squel','crypto','jsforce','querystring','papaparse','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/utils','../../mysqldb','sendStatus','end','status','json','offset','limit','Content-Range','apply','save','update','destroy','then','name','send','map','VoiceDialReport','fieldName','type','keys','filters','intersection','model','query','attributes','fields','length','hasOwnProperty','nolimit','order','sort','where','pick','filter','merge','VIRTUAL','options','count','includeAll','include','findAll','rows','show','rawAttributes','find','catch','create','body','params','describe','html-pdf','eml-format','rimraf','zip-dir','request-promise','moment','bluebird','mustache','path','sox'];(function(_0x1b25c1,_0x2c6ce6){var _0x1e4447=function(_0xaaafca){while(--_0xaaafca){_0x1b25c1['push'](_0x1b25c1['shift']());}};_0x1e4447(++_0x2c6ce6);}(_0xb615,0x1b2));var _0x5b61=function(_0x3ac75f,_0x358d95){_0x3ac75f=_0x3ac75f-0x0;var _0x404c1e=_0xb615[_0x3ac75f];return _0x404c1e;};'use strict';var pdf=require(_0x5b61('0x0'));var emlformat=require(_0x5b61('0x1'));var rimraf=require(_0x5b61('0x2'));var zipdir=require(_0x5b61('0x3'));var jsonpatch=require('fast-json-patch');var rp=require(_0x5b61('0x4'));var moment=require(_0x5b61('0x5'));var BPromise=require(_0x5b61('0x6'));var Mustache=require(_0x5b61('0x7'));var util=require('util');var path=require(_0x5b61('0x8'));var sox=require(_0x5b61('0x9'));var csv=require(_0x5b61('0xa'));var ejs=require(_0x5b61('0xb'));var fs=require('fs');var _=require(_0x5b61('0xc'));var squel=require(_0x5b61('0xd'));var crypto=require(_0x5b61('0xe'));var jsforce=require(_0x5b61('0xf'));var deskjs=require('desk.js');var toCsv=require(_0x5b61('0xa'));var querystring=require(_0x5b61('0x10'));var Papa=require(_0x5b61('0x11'));var Redis=require('ioredis');var authService=require('../../components/auth/service');var qs=require(_0x5b61('0x12'));var as=require(_0x5b61('0x13'));var hardwareService=require(_0x5b61('0x14'));var logger=require(_0x5b61('0x15'))(_0x5b61('0x16'));var utils=require(_0x5b61('0x17'));var config=require('../../config/environment');var db=require(_0x5b61('0x18'))['db'];function respondWithStatusCode(_0x29c3cd,_0x39d469){_0x39d469=_0x39d469||0xcc;return function(_0x3da834){if(_0x3da834){return _0x29c3cd[_0x5b61('0x19')](_0x39d469);}return _0x29c3cd['status'](_0x39d469)[_0x5b61('0x1a')]();};}function respondWithResult(_0x2e0a13,_0x553f4e){_0x553f4e=_0x553f4e||0xc8;return function(_0x47672b){if(_0x47672b){return _0x2e0a13[_0x5b61('0x1b')](_0x553f4e)[_0x5b61('0x1c')](_0x47672b);}};}function respondWithFilteredResult(_0x48ec70,_0x11c9ae){return function(_0x107f09){if(_0x107f09){var _0x566f2c=_0x107f09['count'],_0x4e9e8f=_0x11c9ae[_0x5b61('0x1d')],_0x5c9e67=_0x11c9ae[_0x5b61('0x1d')]+_0x11c9ae[_0x5b61('0x1e')],_0x34fa34;if(_0x5c9e67>=_0x566f2c){_0x5c9e67=_0x566f2c;_0x34fa34=0xc8;}else{_0x34fa34=0xce;}_0x48ec70['status'](_0x34fa34);return _0x48ec70['set'](_0x5b61('0x1f'),_0x4e9e8f+'-'+_0x5c9e67+'/'+_0x566f2c)[_0x5b61('0x1c')](_0x107f09);}return null;};}function patchUpdates(_0x1f073f){return function(_0x5e4996){try{jsonpatch[_0x5b61('0x20')](_0x5e4996,_0x1f073f,!![]);}catch(_0x535e45){return BPromise['reject'](_0x535e45);}return _0x5e4996[_0x5b61('0x21')]();};}function saveUpdates(_0x20818b,_0x330977){return function(_0x3a0cee){if(_0x3a0cee){return _0x3a0cee[_0x5b61('0x22')](_0x20818b)['then'](function(_0xa98a9f){return _0xa98a9f;});}return null;};}function removeEntity(_0x21da6c,_0x5ca315){return function(_0x93ff92){if(_0x93ff92){return _0x93ff92[_0x5b61('0x23')]()[_0x5b61('0x24')](function(){_0x21da6c[_0x5b61('0x1b')](0xcc)[_0x5b61('0x1a')]();});}};}function handleEntityNotFound(_0x2e9703,_0x50a68b){return function(_0x1117b7){if(!_0x1117b7){_0x2e9703['sendStatus'](0x194);}return _0x1117b7;};}function handleError(_0x1b73f7,_0x45e5a5){_0x45e5a5=_0x45e5a5||0x1f4;return function(_0x228066){logger['error'](_0x228066['stack']);if(_0x228066[_0x5b61('0x25')]){delete _0x228066[_0x5b61('0x25')];}_0x1b73f7[_0x5b61('0x1b')](_0x45e5a5)[_0x5b61('0x26')](_0x228066);};}exports['index']=function(_0x8d5e4,_0x2cd046){var _0x17a776={},_0x8cdc0d={},_0x494cf8={'count':0x0,'rows':[]};var _0x5e5d43=_[_0x5b61('0x27')](db[_0x5b61('0x28')]['rawAttributes'],function(_0x35d2a2){return{'name':_0x35d2a2[_0x5b61('0x29')],'type':_0x35d2a2[_0x5b61('0x2a')]['key']};});_0x8cdc0d['model']=_[_0x5b61('0x27')](_0x5e5d43,_0x5b61('0x25'));_0x8cdc0d['query']=_[_0x5b61('0x2b')](_0x8d5e4['query']);_0x8cdc0d[_0x5b61('0x2c')]=_[_0x5b61('0x2d')](_0x8cdc0d[_0x5b61('0x2e')],_0x8cdc0d[_0x5b61('0x2f')]);_0x17a776[_0x5b61('0x30')]=_[_0x5b61('0x2d')](_0x8cdc0d['model'],qs[_0x5b61('0x31')](_0x8d5e4[_0x5b61('0x2f')][_0x5b61('0x31')]));_0x17a776[_0x5b61('0x30')]=_0x17a776[_0x5b61('0x30')][_0x5b61('0x32')]?_0x17a776[_0x5b61('0x30')]:_0x8cdc0d['model'];if(!_0x8d5e4[_0x5b61('0x2f')][_0x5b61('0x33')](_0x5b61('0x34'))){_0x17a776[_0x5b61('0x1e')]=qs[_0x5b61('0x1e')](_0x8d5e4[_0x5b61('0x2f')]['limit']);_0x17a776[_0x5b61('0x1d')]=qs['offset'](_0x8d5e4[_0x5b61('0x2f')][_0x5b61('0x1d')]);}_0x17a776[_0x5b61('0x35')]=qs[_0x5b61('0x36')](_0x8d5e4[_0x5b61('0x2f')][_0x5b61('0x36')]);_0x17a776[_0x5b61('0x37')]=qs['filters'](_[_0x5b61('0x38')](_0x8d5e4[_0x5b61('0x2f')],_0x8cdc0d[_0x5b61('0x2c')]));if(_0x8d5e4[_0x5b61('0x2f')][_0x5b61('0x39')]){_0x17a776[_0x5b61('0x37')]=_[_0x5b61('0x3a')](_0x17a776[_0x5b61('0x37')],{'$or':_[_0x5b61('0x27')](_0x5e5d43,function(_0x540497){if(_0x540497[_0x5b61('0x2a')]!==_0x5b61('0x3b')){var _0x2aac2b={};_0x2aac2b[_0x540497[_0x5b61('0x25')]]={'$like':'%'+_0x8d5e4[_0x5b61('0x2f')][_0x5b61('0x39')]+'%'};return _0x2aac2b;}})});}_0x17a776=_[_0x5b61('0x3a')]({},_0x17a776,_0x8d5e4[_0x5b61('0x3c')]);var _0x3ef326={'where':_0x17a776[_0x5b61('0x37')]};return db[_0x5b61('0x28')]['count'](_0x3ef326)[_0x5b61('0x24')](function(_0x11dcea){_0x494cf8[_0x5b61('0x3d')]=_0x11dcea;if(_0x8d5e4[_0x5b61('0x2f')][_0x5b61('0x3e')]){_0x17a776[_0x5b61('0x3f')]=[{'all':!![]}];}return db[_0x5b61('0x28')][_0x5b61('0x40')](_0x17a776);})[_0x5b61('0x24')](function(_0x5b44fb){_0x494cf8[_0x5b61('0x41')]=_0x5b44fb;return _0x494cf8;})[_0x5b61('0x24')](respondWithFilteredResult(_0x2cd046,_0x17a776))['catch'](handleError(_0x2cd046,null));};exports[_0x5b61('0x42')]=function(_0x5cca13,_0x569650){var _0x276292={'raw':!![],'where':{'id':_0x5cca13['params']['id']}},_0xec1361={};_0xec1361[_0x5b61('0x2e')]=_[_0x5b61('0x2b')](db[_0x5b61('0x28')][_0x5b61('0x43')]);_0xec1361[_0x5b61('0x2f')]=_[_0x5b61('0x2b')](_0x5cca13[_0x5b61('0x2f')]);_0xec1361[_0x5b61('0x2c')]=_[_0x5b61('0x2d')](_0xec1361['model'],_0xec1361[_0x5b61('0x2f')]);_0x276292[_0x5b61('0x30')]=_[_0x5b61('0x2d')](_0xec1361[_0x5b61('0x2e')],qs[_0x5b61('0x31')](_0x5cca13[_0x5b61('0x2f')][_0x5b61('0x31')]));_0x276292[_0x5b61('0x30')]=_0x276292[_0x5b61('0x30')][_0x5b61('0x32')]?_0x276292[_0x5b61('0x30')]:_0xec1361['model'];if(_0x5cca13[_0x5b61('0x2f')][_0x5b61('0x3e')]){_0x276292['include']=[{'all':!![]}];}_0x276292=_[_0x5b61('0x3a')]({},_0x276292,_0x5cca13[_0x5b61('0x3c')]);return db['VoiceDialReport'][_0x5b61('0x44')](_0x276292)['then'](handleEntityNotFound(_0x569650,null))[_0x5b61('0x24')](respondWithResult(_0x569650,null))[_0x5b61('0x45')](handleError(_0x569650,null));};exports[_0x5b61('0x46')]=function(_0x10d73c,_0x2b2084){return db[_0x5b61('0x28')][_0x5b61('0x46')](_0x10d73c[_0x5b61('0x47')],{})['then'](respondWithResult(_0x2b2084,0xc9))[_0x5b61('0x45')](handleError(_0x2b2084,null));};exports[_0x5b61('0x22')]=function(_0x635dcd,_0x357613){if(_0x635dcd[_0x5b61('0x47')]['id']){delete _0x635dcd[_0x5b61('0x47')]['id'];}return db[_0x5b61('0x28')]['find']({'where':{'id':_0x635dcd[_0x5b61('0x48')]['id']}})[_0x5b61('0x24')](handleEntityNotFound(_0x357613,null))[_0x5b61('0x24')](saveUpdates(_0x635dcd[_0x5b61('0x47')],null))['then'](respondWithResult(_0x357613,null))['catch'](handleError(_0x357613,null));};exports[_0x5b61('0x23')]=function(_0x3c70c6,_0x30f340){return db[_0x5b61('0x28')]['find']({'where':{'id':_0x3c70c6['params']['id']}})[_0x5b61('0x24')](handleEntityNotFound(_0x30f340,null))[_0x5b61('0x24')](removeEntity(_0x30f340,null))['catch'](handleError(_0x30f340,null));};exports[_0x5b61('0x49')]=function(_0x16fb52,_0x412213){return db['VoiceDialReport'][_0x5b61('0x49')]()[_0x5b61('0x24')](respondWithResult(_0x412213,null))[_0x5b61('0x45')](handleError(_0x412213,null));};
\ No newline at end of file
+var _0x29fd=['jsforce','desk.js','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','api','../../config/utils','../../config/environment','sendStatus','status','end','json','count','offset','limit','set','apply','reject','save','update','then','destroy','error','name','send','index','map','fieldName','type','key','query','keys','filters','intersection','attributes','fields','length','nolimit','order','sort','where','pick','filter','VIRTUAL','merge','options','VoiceDialReport','includeAll','include','rows','catch','show','model','rawAttributes','find','create','body','params','describe','html-pdf','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','moment','mustache','path','sox','to-csv','ejs','lodash','squel','crypto'];(function(_0x19b3f9,_0xade753){var _0x18c3f6=function(_0x21439f){while(--_0x21439f){_0x19b3f9['push'](_0x19b3f9['shift']());}};_0x18c3f6(++_0xade753);}(_0x29fd,0x8d));var _0xd29f=function(_0x1db97,_0x5b1528){_0x1db97=_0x1db97-0x0;var _0x37948d=_0x29fd[_0x1db97];return _0x37948d;};'use strict';var pdf=require(_0xd29f('0x0'));var emlformat=require(_0xd29f('0x1'));var rimraf=require(_0xd29f('0x2'));var zipdir=require(_0xd29f('0x3'));var jsonpatch=require(_0xd29f('0x4'));var rp=require(_0xd29f('0x5'));var moment=require(_0xd29f('0x6'));var BPromise=require('bluebird');var Mustache=require(_0xd29f('0x7'));var util=require('util');var path=require(_0xd29f('0x8'));var sox=require(_0xd29f('0x9'));var csv=require(_0xd29f('0xa'));var ejs=require(_0xd29f('0xb'));var fs=require('fs');var _=require(_0xd29f('0xc'));var squel=require(_0xd29f('0xd'));var crypto=require(_0xd29f('0xe'));var jsforce=require(_0xd29f('0xf'));var deskjs=require(_0xd29f('0x10'));var toCsv=require(_0xd29f('0xa'));var querystring=require(_0xd29f('0x11'));var Papa=require(_0xd29f('0x12'));var Redis=require(_0xd29f('0x13'));var authService=require(_0xd29f('0x14'));var qs=require(_0xd29f('0x15'));var as=require(_0xd29f('0x16'));var hardwareService=require(_0xd29f('0x17'));var logger=require('../../config/logger')(_0xd29f('0x18'));var utils=require(_0xd29f('0x19'));var config=require(_0xd29f('0x1a'));var db=require('../../mysqldb')['db'];function respondWithStatusCode(_0x1d9025,_0x1abb30){_0x1abb30=_0x1abb30||0xcc;return function(_0x4a001f){if(_0x4a001f){return _0x1d9025[_0xd29f('0x1b')](_0x1abb30);}return _0x1d9025[_0xd29f('0x1c')](_0x1abb30)[_0xd29f('0x1d')]();};}function respondWithResult(_0x78011a,_0x7b7690){_0x7b7690=_0x7b7690||0xc8;return function(_0x86de6f){if(_0x86de6f){return _0x78011a[_0xd29f('0x1c')](_0x7b7690)[_0xd29f('0x1e')](_0x86de6f);}};}function respondWithFilteredResult(_0x5d503f,_0x3da37c){return function(_0x5aa072){if(_0x5aa072){var _0x163282=_0x5aa072[_0xd29f('0x1f')],_0x1f19cc=_0x3da37c[_0xd29f('0x20')],_0x502f85=_0x3da37c[_0xd29f('0x20')]+_0x3da37c[_0xd29f('0x21')],_0x2bba85;if(_0x502f85>=_0x163282){_0x502f85=_0x163282;_0x2bba85=0xc8;}else{_0x2bba85=0xce;}_0x5d503f[_0xd29f('0x1c')](_0x2bba85);return _0x5d503f[_0xd29f('0x22')]('Content-Range',_0x1f19cc+'-'+_0x502f85+'/'+_0x163282)[_0xd29f('0x1e')](_0x5aa072);}return null;};}function patchUpdates(_0x21fe83){return function(_0x144b5d){try{jsonpatch[_0xd29f('0x23')](_0x144b5d,_0x21fe83,!![]);}catch(_0x3ae0d4){return BPromise[_0xd29f('0x24')](_0x3ae0d4);}return _0x144b5d[_0xd29f('0x25')]();};}function saveUpdates(_0x584f82,_0x49106d){return function(_0x59bdd9){if(_0x59bdd9){return _0x59bdd9[_0xd29f('0x26')](_0x584f82)[_0xd29f('0x27')](function(_0x2373c3){return _0x2373c3;});}return null;};}function removeEntity(_0x4bc9bc,_0x2f1bfe){return function(_0xd37bf5){if(_0xd37bf5){return _0xd37bf5[_0xd29f('0x28')]()[_0xd29f('0x27')](function(){_0x4bc9bc[_0xd29f('0x1c')](0xcc)['end']();});}};}function handleEntityNotFound(_0x1c574a,_0x494a5d){return function(_0x43b43a){if(!_0x43b43a){_0x1c574a[_0xd29f('0x1b')](0x194);}return _0x43b43a;};}function handleError(_0x549519,_0x25a1a1){_0x25a1a1=_0x25a1a1||0x1f4;return function(_0x51c04a){logger[_0xd29f('0x29')](_0x51c04a['stack']);if(_0x51c04a['name']){delete _0x51c04a[_0xd29f('0x2a')];}_0x549519[_0xd29f('0x1c')](_0x25a1a1)[_0xd29f('0x2b')](_0x51c04a);};}exports[_0xd29f('0x2c')]=function(_0x38ca87,_0x5014d8){var _0x506092={},_0x1c789c={},_0xe4d15c={'count':0x0,'rows':[]};var _0x2231ac=_[_0xd29f('0x2d')](db['VoiceDialReport']['rawAttributes'],function(_0x44942b){return{'name':_0x44942b[_0xd29f('0x2e')],'type':_0x44942b[_0xd29f('0x2f')][_0xd29f('0x30')]};});_0x1c789c['model']=_['map'](_0x2231ac,_0xd29f('0x2a'));_0x1c789c[_0xd29f('0x31')]=_[_0xd29f('0x32')](_0x38ca87['query']);_0x1c789c[_0xd29f('0x33')]=_[_0xd29f('0x34')](_0x1c789c['model'],_0x1c789c['query']);_0x506092[_0xd29f('0x35')]=_[_0xd29f('0x34')](_0x1c789c['model'],qs[_0xd29f('0x36')](_0x38ca87[_0xd29f('0x31')][_0xd29f('0x36')]));_0x506092[_0xd29f('0x35')]=_0x506092[_0xd29f('0x35')][_0xd29f('0x37')]?_0x506092['attributes']:_0x1c789c['model'];if(!_0x38ca87[_0xd29f('0x31')]['hasOwnProperty'](_0xd29f('0x38'))){_0x506092[_0xd29f('0x21')]=qs['limit'](_0x38ca87[_0xd29f('0x31')][_0xd29f('0x21')]);_0x506092[_0xd29f('0x20')]=qs[_0xd29f('0x20')](_0x38ca87[_0xd29f('0x31')]['offset']);}_0x506092[_0xd29f('0x39')]=qs[_0xd29f('0x3a')](_0x38ca87[_0xd29f('0x31')][_0xd29f('0x3a')]);_0x506092[_0xd29f('0x3b')]=qs[_0xd29f('0x33')](_[_0xd29f('0x3c')](_0x38ca87['query'],_0x1c789c[_0xd29f('0x33')]));if(_0x38ca87['query'][_0xd29f('0x3d')]){_0x506092[_0xd29f('0x3b')]=_['merge'](_0x506092[_0xd29f('0x3b')],{'$or':_[_0xd29f('0x2d')](_0x2231ac,function(_0x2a759d){if(_0x2a759d['type']!==_0xd29f('0x3e')){var _0x458d77={};_0x458d77[_0x2a759d['name']]={'$like':'%'+_0x38ca87['query']['filter']+'%'};return _0x458d77;}})});}_0x506092=_[_0xd29f('0x3f')]({},_0x506092,_0x38ca87[_0xd29f('0x40')]);var _0x31319f={'where':_0x506092[_0xd29f('0x3b')]};return db[_0xd29f('0x41')]['count'](_0x31319f)['then'](function(_0x2919b7){_0xe4d15c[_0xd29f('0x1f')]=_0x2919b7;if(_0x38ca87['query'][_0xd29f('0x42')]){_0x506092[_0xd29f('0x43')]=[{'all':!![]}];}return db[_0xd29f('0x41')]['findAll'](_0x506092);})[_0xd29f('0x27')](function(_0x52d640){_0xe4d15c[_0xd29f('0x44')]=_0x52d640;return _0xe4d15c;})[_0xd29f('0x27')](respondWithFilteredResult(_0x5014d8,_0x506092))[_0xd29f('0x45')](handleError(_0x5014d8,null));};exports[_0xd29f('0x46')]=function(_0x4c3697,_0x165637){var _0x3a4e93={'raw':!![],'where':{'id':_0x4c3697['params']['id']}},_0x4b38d9={};_0x4b38d9[_0xd29f('0x47')]=_['keys'](db[_0xd29f('0x41')][_0xd29f('0x48')]);_0x4b38d9[_0xd29f('0x31')]=_['keys'](_0x4c3697['query']);_0x4b38d9['filters']=_[_0xd29f('0x34')](_0x4b38d9[_0xd29f('0x47')],_0x4b38d9[_0xd29f('0x31')]);_0x3a4e93[_0xd29f('0x35')]=_[_0xd29f('0x34')](_0x4b38d9['model'],qs[_0xd29f('0x36')](_0x4c3697[_0xd29f('0x31')][_0xd29f('0x36')]));_0x3a4e93[_0xd29f('0x35')]=_0x3a4e93[_0xd29f('0x35')][_0xd29f('0x37')]?_0x3a4e93[_0xd29f('0x35')]:_0x4b38d9['model'];if(_0x4c3697[_0xd29f('0x31')]['includeAll']){_0x3a4e93[_0xd29f('0x43')]=[{'all':!![]}];}_0x3a4e93=_[_0xd29f('0x3f')]({},_0x3a4e93,_0x4c3697[_0xd29f('0x40')]);return db[_0xd29f('0x41')][_0xd29f('0x49')](_0x3a4e93)[_0xd29f('0x27')](handleEntityNotFound(_0x165637,null))[_0xd29f('0x27')](respondWithResult(_0x165637,null))[_0xd29f('0x45')](handleError(_0x165637,null));};exports[_0xd29f('0x4a')]=function(_0x2e35ad,_0x4ce11a){return db['VoiceDialReport'][_0xd29f('0x4a')](_0x2e35ad[_0xd29f('0x4b')],{})['then'](respondWithResult(_0x4ce11a,0xc9))[_0xd29f('0x45')](handleError(_0x4ce11a,null));};exports[_0xd29f('0x26')]=function(_0x32f56e,_0x1a9c71){if(_0x32f56e[_0xd29f('0x4b')]['id']){delete _0x32f56e['body']['id'];}return db[_0xd29f('0x41')][_0xd29f('0x49')]({'where':{'id':_0x32f56e[_0xd29f('0x4c')]['id']}})['then'](handleEntityNotFound(_0x1a9c71,null))[_0xd29f('0x27')](saveUpdates(_0x32f56e['body'],null))[_0xd29f('0x27')](respondWithResult(_0x1a9c71,null))[_0xd29f('0x45')](handleError(_0x1a9c71,null));};exports['destroy']=function(_0x4870b0,_0x38451d){return db['VoiceDialReport']['find']({'where':{'id':_0x4870b0['params']['id']}})[_0xd29f('0x27')](handleEntityNotFound(_0x38451d,null))[_0xd29f('0x27')](removeEntity(_0x38451d,null))['catch'](handleError(_0x38451d,null));};exports[_0xd29f('0x4d')]=function(_0x9430ce,_0x599fc1){return db['VoiceDialReport']['describe']()[_0xd29f('0x27')](respondWithResult(_0x599fc1,null))[_0xd29f('0x45')](handleError(_0x599fc1,null));};
\ No newline at end of file
diff --git a/server/api/voiceDialReport/voiceDialReport.model.js b/server/api/voiceDialReport/voiceDialReport.model.js
index 98e4341..f32b83a 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 _0xe398=['lodash','util','../../config/logger','bluebird','request-promise','path','../../config/environment','./voiceDialReport.attributes','define','VoiceDialReport','report_dial','uniqueid'];(function(_0x25afd4,_0x40d7ad){var _0x16da5f=function(_0x554e0e){while(--_0x554e0e){_0x25afd4['push'](_0x25afd4['shift']());}};_0x16da5f(++_0x40d7ad);}(_0xe398,0x12c));var _0x8e39=function(_0x25da26,_0x3455e1){_0x25da26=_0x25da26-0x0;var _0x2cd42a=_0xe398[_0x25da26];return _0x2cd42a;};'use strict';var _=require(_0x8e39('0x0'));var util=require(_0x8e39('0x1'));var logger=require(_0x8e39('0x2'))('api');var moment=require('moment');var BPromise=require(_0x8e39('0x3'));var rp=require(_0x8e39('0x4'));var fs=require('fs');var path=require(_0x8e39('0x5'));var rimraf=require('rimraf');var config=require(_0x8e39('0x6'));var attributes=require(_0x8e39('0x7'));module['exports']=function(_0x1a16f3,_0x9f3944){return _0x1a16f3[_0x8e39('0x8')](_0x8e39('0x9'),attributes,{'tableName':_0x8e39('0xa'),'paranoid':![],'indexes':[{'fields':[_0x8e39('0xb')]}],'timestamps':!![]});};
\ No newline at end of file
+var _0xfd0b=['./voiceDialReport.attributes','exports','define','VoiceDialReport','lodash','../../config/logger','api','bluebird','request-promise','path','rimraf','../../config/environment'];(function(_0x20a584,_0xe384a5){var _0x4b41a8=function(_0x2127c6){while(--_0x2127c6){_0x20a584['push'](_0x20a584['shift']());}};_0x4b41a8(++_0xe384a5);}(_0xfd0b,0x118));var _0xbfd0=function(_0x1935fd,_0x3f4938){_0x1935fd=_0x1935fd-0x0;var _0x25f25f=_0xfd0b[_0x1935fd];return _0x25f25f;};'use strict';var _=require(_0xbfd0('0x0'));var util=require('util');var logger=require(_0xbfd0('0x1'))(_0xbfd0('0x2'));var moment=require('moment');var BPromise=require(_0xbfd0('0x3'));var rp=require(_0xbfd0('0x4'));var fs=require('fs');var path=require(_0xbfd0('0x5'));var rimraf=require(_0xbfd0('0x6'));var config=require(_0xbfd0('0x7'));var attributes=require(_0xbfd0('0x8'));module[_0xbfd0('0x9')]=function(_0x12e463,_0x40e2dc){return _0x12e463[_0xbfd0('0xa')](_0xbfd0('0xb'),attributes,{'tableName':'report_dial','paranoid':![],'indexes':[{'fields':['uniqueid']}],'timestamps':!![]});};
\ No newline at end of file
diff --git a/server/api/voiceDialReport/voiceDialReport.rpc.js b/server/api/voiceDialReport/voiceDialReport.rpc.js
index b0086fd..d8704cb 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 _0x097c=['update','body','raw','where','attributes','limit','UpdateVoiceDialReport','lodash','util','moment','randomstring','ioredis','../../mysqldb','../../config/utils','rpc','jayson/promise','client','http','request','then','info','VoiceDialReport,\x20%s,\x20%s','request\x20sent','debug','VoiceDialReport,\x20%s,\x20%s,\x20%s','error','message','CreateVoiceDialReport','VoiceDialReport','create','options','stringify','catch'];(function(_0x3b3a82,_0x53b5e0){var _0x267063=function(_0x5aaf3d){while(--_0x5aaf3d){_0x3b3a82['push'](_0x3b3a82['shift']());}};_0x267063(++_0x53b5e0);}(_0x097c,0x1d5));var _0xc097=function(_0x1f5989,_0x53c2d7){_0x1f5989=_0x1f5989-0x0;var _0x51330=_0x097c[_0x1f5989];return _0x51330;};'use strict';var _=require(_0xc097('0x0'));var util=require(_0xc097('0x1'));var moment=require(_0xc097('0x2'));var BPromise=require('bluebird');var rs=require(_0xc097('0x3'));var fs=require('fs');var Redis=require(_0xc097('0x4'));var db=require(_0xc097('0x5'))['db'];var utils=require(_0xc097('0x6'));var logger=require('../../config/logger')(_0xc097('0x7'));var config=require('../../config/environment');var jayson=require(_0xc097('0x8'));var client=jayson[_0xc097('0x9')][_0xc097('0xa')]({'port':0x232a});function respondWithRpcPromise(_0x32493e,_0x582476,_0x3f67a4){return new BPromise(function(_0x4d95d9,_0x57b782){return client[_0xc097('0xb')](_0x32493e,_0x3f67a4)[_0xc097('0xc')](function(_0x26e257){logger[_0xc097('0xd')](_0xc097('0xe'),_0x582476,_0xc097('0xf'));logger[_0xc097('0x10')](_0xc097('0x11'),_0x582476,_0xc097('0xf'),JSON['stringify'](_0x26e257));if(_0x26e257[_0xc097('0x12')]){if(_0x26e257[_0xc097('0x12')]['code']===0x1f4){logger[_0xc097('0x12')](_0xc097('0xe'),_0x582476,_0x26e257[_0xc097('0x12')][_0xc097('0x13')]);return _0x57b782(_0x26e257[_0xc097('0x12')][_0xc097('0x13')]);}logger['error']('VoiceDialReport,\x20%s,\x20%s',_0x582476,_0x26e257[_0xc097('0x12')][_0xc097('0x13')]);return _0x4d95d9(_0x26e257[_0xc097('0x12')][_0xc097('0x13')]);}else{logger[_0xc097('0xd')]('VoiceDialReport,\x20%s,\x20%s',_0x582476,_0xc097('0xf'));_0x4d95d9(_0x26e257['result'][_0xc097('0x13')]);}})['catch'](function(_0x1a2a3a){logger[_0xc097('0x12')](_0xc097('0xe'),_0x582476,_0x1a2a3a);_0x57b782(_0x1a2a3a);});});}exports[_0xc097('0x14')]=function(_0xd7cd88){var _0x560cbb=this;return new Promise(function(_0x5a3317,_0x3aec7e){return db[_0xc097('0x15')][_0xc097('0x16')](_0xd7cd88['body'],{'raw':_0xd7cd88[_0xc097('0x17')]?_0xd7cd88['options']['raw']===undefined?!![]:![]:!![]})['then'](function(_0x1d137e){logger['info']('CreateVoiceDialReport',_0xd7cd88);logger[_0xc097('0x10')](_0xc097('0x14'),_0xd7cd88,JSON[_0xc097('0x18')](_0x1d137e));_0x5a3317(_0x1d137e);})[_0xc097('0x19')](function(_0x2eff2f){logger[_0xc097('0x12')](_0xc097('0x14'),_0x2eff2f[_0xc097('0x13')],_0xd7cd88);_0x3aec7e(_0x560cbb[_0xc097('0x12')](0x1f4,_0x2eff2f['message']));});});};exports['UpdateVoiceDialReport']=function(_0x516177){var _0x5ec2d7=this;return new Promise(function(_0x2fdecf,_0xca7a19){return db[_0xc097('0x15')][_0xc097('0x1a')](_0x516177[_0xc097('0x1b')],{'raw':_0x516177[_0xc097('0x17')]?_0x516177[_0xc097('0x17')][_0xc097('0x1c')]===undefined?!![]:![]:!![],'individualHooks':!![],'where':_0x516177[_0xc097('0x17')]?_0x516177[_0xc097('0x17')][_0xc097('0x1d')]||null:null,'attributes':_0x516177[_0xc097('0x17')]?_0x516177[_0xc097('0x17')][_0xc097('0x1e')]||null:null,'limit':_0x516177['options']?_0x516177[_0xc097('0x17')][_0xc097('0x1f')]||null:null})['then'](function(_0x4943e2){logger[_0xc097('0xd')](_0xc097('0x20'),_0x516177);logger[_0xc097('0x10')]('UpdateVoiceDialReport',_0x516177,JSON[_0xc097('0x18')](_0x4943e2));_0x2fdecf(_0x4943e2);})[_0xc097('0x19')](function(_0x35fb36){logger['error']('UpdateVoiceDialReport',_0x35fb36[_0xc097('0x13')],_0x516177);_0xca7a19(_0x5ec2d7['error'](0x1f4,_0x35fb36[_0xc097('0x13')]));});});};
\ No newline at end of file
+var _0x8a55=['../../config/utils','rpc','../../config/environment','jayson/promise','client','http','request','then','info','VoiceDialReport,\x20%s,\x20%s','request\x20sent','debug','VoiceDialReport,\x20%s,\x20%s,\x20%s','stringify','error','code','message','result','CreateVoiceDialReport','options','catch','VoiceDialReport','update','body','limit','UpdateVoiceDialReport','lodash','util','moment','bluebird','randomstring','ioredis','../../mysqldb'];(function(_0x1c2a5d,_0x3ce7aa){var _0x43ca69=function(_0x12b795){while(--_0x12b795){_0x1c2a5d['push'](_0x1c2a5d['shift']());}};_0x43ca69(++_0x3ce7aa);}(_0x8a55,0x185));var _0x58a5=function(_0x282558,_0x2fcf63){_0x282558=_0x282558-0x0;var _0x396941=_0x8a55[_0x282558];return _0x396941;};'use strict';var _=require(_0x58a5('0x0'));var util=require(_0x58a5('0x1'));var moment=require(_0x58a5('0x2'));var BPromise=require(_0x58a5('0x3'));var rs=require(_0x58a5('0x4'));var fs=require('fs');var Redis=require(_0x58a5('0x5'));var db=require(_0x58a5('0x6'))['db'];var utils=require(_0x58a5('0x7'));var logger=require('../../config/logger')(_0x58a5('0x8'));var config=require(_0x58a5('0x9'));var jayson=require(_0x58a5('0xa'));var client=jayson[_0x58a5('0xb')][_0x58a5('0xc')]({'port':0x232a});function respondWithRpcPromise(_0x1690bc,_0x1f135e,_0xd63fc7){return new BPromise(function(_0x36d8a4,_0x59860d){return client[_0x58a5('0xd')](_0x1690bc,_0xd63fc7)[_0x58a5('0xe')](function(_0x2cca61){logger[_0x58a5('0xf')](_0x58a5('0x10'),_0x1f135e,_0x58a5('0x11'));logger[_0x58a5('0x12')](_0x58a5('0x13'),_0x1f135e,_0x58a5('0x11'),JSON[_0x58a5('0x14')](_0x2cca61));if(_0x2cca61[_0x58a5('0x15')]){if(_0x2cca61[_0x58a5('0x15')][_0x58a5('0x16')]===0x1f4){logger[_0x58a5('0x15')]('VoiceDialReport,\x20%s,\x20%s',_0x1f135e,_0x2cca61[_0x58a5('0x15')][_0x58a5('0x17')]);return _0x59860d(_0x2cca61[_0x58a5('0x15')][_0x58a5('0x17')]);}logger[_0x58a5('0x15')]('VoiceDialReport,\x20%s,\x20%s',_0x1f135e,_0x2cca61['error'][_0x58a5('0x17')]);return _0x36d8a4(_0x2cca61[_0x58a5('0x15')][_0x58a5('0x17')]);}else{logger[_0x58a5('0xf')](_0x58a5('0x10'),_0x1f135e,'request\x20sent');_0x36d8a4(_0x2cca61[_0x58a5('0x18')][_0x58a5('0x17')]);}})['catch'](function(_0x2594e3){logger[_0x58a5('0x15')]('VoiceDialReport,\x20%s,\x20%s',_0x1f135e,_0x2594e3);_0x59860d(_0x2594e3);});});}exports[_0x58a5('0x19')]=function(_0x32203a){var _0x59c170=this;return new Promise(function(_0x5dfadd,_0x24aa8f){return db['VoiceDialReport']['create'](_0x32203a['body'],{'raw':_0x32203a[_0x58a5('0x1a')]?_0x32203a[_0x58a5('0x1a')]['raw']===undefined?!![]:![]:!![]})[_0x58a5('0xe')](function(_0x8860d7){logger[_0x58a5('0xf')]('CreateVoiceDialReport',_0x32203a);logger[_0x58a5('0x12')](_0x58a5('0x19'),_0x32203a,JSON[_0x58a5('0x14')](_0x8860d7));_0x5dfadd(_0x8860d7);})[_0x58a5('0x1b')](function(_0x4b0df7){logger['error'](_0x58a5('0x19'),_0x4b0df7[_0x58a5('0x17')],_0x32203a);_0x24aa8f(_0x59c170[_0x58a5('0x15')](0x1f4,_0x4b0df7['message']));});});};exports['UpdateVoiceDialReport']=function(_0x2da18b){var _0x48e5cf=this;return new Promise(function(_0x206eea,_0xf1b3fc){return db[_0x58a5('0x1c')][_0x58a5('0x1d')](_0x2da18b[_0x58a5('0x1e')],{'raw':_0x2da18b['options']?_0x2da18b[_0x58a5('0x1a')]['raw']===undefined?!![]:![]:!![],'individualHooks':!![],'where':_0x2da18b[_0x58a5('0x1a')]?_0x2da18b[_0x58a5('0x1a')]['where']||null:null,'attributes':_0x2da18b[_0x58a5('0x1a')]?_0x2da18b[_0x58a5('0x1a')]['attributes']||null:null,'limit':_0x2da18b[_0x58a5('0x1a')]?_0x2da18b[_0x58a5('0x1a')][_0x58a5('0x1f')]||null:null})['then'](function(_0x34bd7a){logger[_0x58a5('0xf')](_0x58a5('0x20'),_0x2da18b);logger[_0x58a5('0x12')](_0x58a5('0x20'),_0x2da18b,JSON['stringify'](_0x34bd7a));_0x206eea(_0x34bd7a);})[_0x58a5('0x1b')](function(_0x2912bc){logger[_0x58a5('0x15')](_0x58a5('0x20'),_0x2912bc[_0x58a5('0x17')],_0x2da18b);_0xf1b3fc(_0x48e5cf[_0x58a5('0x15')](0x1f4,_0x2912bc['message']));});});};
\ No newline at end of file
diff --git a/server/api/voiceExtension/index.js b/server/api/voiceExtension/index.js
index ec93e2f..aabdbbf 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 _0x5040=['get','isAuthenticated','/:id','post','create','addApplications','put','update','delete','destroy','util','path','express','../../components/auth/service','../../components/interaction/service','../../config/environment','./voiceExtension.controller'];(function(_0x5d6270,_0x83b57a){var _0x168f26=function(_0x258a27){while(--_0x258a27){_0x5d6270['push'](_0x5d6270['shift']());}};_0x168f26(++_0x83b57a);}(_0x5040,0x70));var _0x0504=function(_0x58cee7,_0x7d7c06){_0x58cee7=_0x58cee7-0x0;var _0x494a4e=_0x5040[_0x58cee7];return _0x494a4e;};'use strict';var multer=require('multer');var util=require(_0x0504('0x0'));var path=require(_0x0504('0x1'));var timeout=require('connect-timeout');var express=require(_0x0504('0x2'));var router=express['Router']();var auth=require(_0x0504('0x3'));var interaction=require(_0x0504('0x4'));var config=require(_0x0504('0x5'));var controller=require(_0x0504('0x6'));router[_0x0504('0x7')]('/',auth[_0x0504('0x8')](),controller['index']);router[_0x0504('0x7')](_0x0504('0x9'),auth['isAuthenticated'](),controller['show']);router[_0x0504('0xa')]('/',auth[_0x0504('0x8')](),controller[_0x0504('0xb')]);router[_0x0504('0xa')]('/:id/applications',auth[_0x0504('0x8')](),controller[_0x0504('0xc')]);router[_0x0504('0xd')](_0x0504('0x9'),auth[_0x0504('0x8')](),controller[_0x0504('0xe')]);router[_0x0504('0xf')](_0x0504('0x9'),auth[_0x0504('0x8')](),controller[_0x0504('0x10')]);module['exports']=router;
\ No newline at end of file
+var _0x3c75=['express','Router','../../components/auth/service','../../config/environment','./voiceExtension.controller','get','isAuthenticated','index','/:id','show','post','create','/:id/applications','addApplications','put','destroy','exports','multer','util','path','connect-timeout'];(function(_0x37695c,_0x222432){var _0x50e5b1=function(_0x592a11){while(--_0x592a11){_0x37695c['push'](_0x37695c['shift']());}};_0x50e5b1(++_0x222432);}(_0x3c75,0x1f4));var _0x53c7=function(_0x14a45a,_0x3d9e16){_0x14a45a=_0x14a45a-0x0;var _0x370f90=_0x3c75[_0x14a45a];return _0x370f90;};'use strict';var multer=require(_0x53c7('0x0'));var util=require(_0x53c7('0x1'));var path=require(_0x53c7('0x2'));var timeout=require(_0x53c7('0x3'));var express=require(_0x53c7('0x4'));var router=express[_0x53c7('0x5')]();var auth=require(_0x53c7('0x6'));var interaction=require('../../components/interaction/service');var config=require(_0x53c7('0x7'));var controller=require(_0x53c7('0x8'));router[_0x53c7('0x9')]('/',auth[_0x53c7('0xa')](),controller[_0x53c7('0xb')]);router[_0x53c7('0x9')](_0x53c7('0xc'),auth[_0x53c7('0xa')](),controller[_0x53c7('0xd')]);router[_0x53c7('0xe')]('/',auth['isAuthenticated'](),controller[_0x53c7('0xf')]);router[_0x53c7('0xe')](_0x53c7('0x10'),auth['isAuthenticated'](),controller[_0x53c7('0x11')]);router[_0x53c7('0x12')](_0x53c7('0xc'),auth['isAuthenticated'](),controller['update']);router['delete'](_0x53c7('0xc'),auth['isAuthenticated'](),controller[_0x53c7('0x13')]);module[_0x53c7('0x14')]=router;
\ No newline at end of file
diff --git a/server/api/voiceExtension/voiceExtension.attributes.js b/server/api/voiceExtension/voiceExtension.attributes.js
index bcf8cf9..e2e7687 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(_0x367db8,_0xd21da0){var _0x553f0b=function(_0x4acb7c){while(--_0x4acb7c){_0x367db8['push'](_0x367db8['shift']());}};_0x553f0b(++_0xd21da0);}(_0xa9e0,0x123));var _0x0a9e=function(_0x2a6809,_0x44edde){_0x2a6809=_0x2a6809-0x0;var _0x11c371=_0xa9e0[_0x2a6809];return _0x11c371;};'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(_0x57fd59,_0x49ff36){var _0x29e757=function(_0x451738){while(--_0x451738){_0x57fd59['push'](_0x57fd59['shift']());}};_0x29e757(++_0x49ff36);}(_0xa9e0,0x123));var _0x0a9e=function(_0x134c2e,_0x3573c4){_0x134c2e=_0x134c2e-0x0;var _0x2825db=_0xa9e0[_0x134c2e];return _0x2825db;};'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 364fc05..5c97555 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 _0xafe6=['ignore','map','value','includes','find','name','end','error','send','index','rawAttributes','type','key','model','query','intersection','fields','attributes','length','hasOwnProperty','nolimit','sort','filters','pick','filter','where','merge','VIRTUAL','options','VoiceExtension','include','findAll','catch','show','params','keys','create','body','outbound','startsWith','exten','concat','user','get','role','UserProfileSection','autoAssociation','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','description','recordingFormat','mandatoryDisposition','context','addApplications','findOne','sequelize','transaction','bulkCreate','findAndCountAll','cast(priority\x20as\x20unsigned)','html-pdf','eml-format','rimraf','zip-dir','fast-json-patch','moment','bluebird','mustache','path','sox','to-csv','ejs','lodash','squel','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','defaults','redis','localhost','socket.io-emitter','./voiceExtension.socket','sendStatus','json','count','offset','limit','status','set','Content-Range','reject','save','update','then','destroy','InboundRoutes','inbound','InternalRoutes','internal'];(function(_0x40378a,_0x52309f){var _0x50fcb9=function(_0x3a325e){while(--_0x3a325e){_0x40378a['push'](_0x40378a['shift']());}};_0x50fcb9(++_0x52309f);}(_0xafe6,0xa7));var _0x6afe=function(_0x2d1d10,_0x2336d8){_0x2d1d10=_0x2d1d10-0x0;var _0x4183ea=_0xafe6[_0x2d1d10];return _0x4183ea;};'use strict';var pdf=require(_0x6afe('0x0'));var emlformat=require(_0x6afe('0x1'));var rimraf=require(_0x6afe('0x2'));var zipdir=require(_0x6afe('0x3'));var jsonpatch=require(_0x6afe('0x4'));var rp=require('request-promise');var moment=require(_0x6afe('0x5'));var BPromise=require(_0x6afe('0x6'));var Mustache=require(_0x6afe('0x7'));var util=require('util');var path=require(_0x6afe('0x8'));var sox=require(_0x6afe('0x9'));var csv=require(_0x6afe('0xa'));var ejs=require(_0x6afe('0xb'));var fs=require('fs');var _=require(_0x6afe('0xc'));var squel=require(_0x6afe('0xd'));var crypto=require('crypto');var jsforce=require(_0x6afe('0xe'));var deskjs=require(_0x6afe('0xf'));var toCsv=require(_0x6afe('0xa'));var querystring=require(_0x6afe('0x10'));var Papa=require(_0x6afe('0x11'));var Redis=require('ioredis');var authService=require(_0x6afe('0x12'));var qs=require(_0x6afe('0x13'));var as=require(_0x6afe('0x14'));var hardwareService=require(_0x6afe('0x15'));var logger=require(_0x6afe('0x16'))(_0x6afe('0x17'));var utils=require(_0x6afe('0x18'));var config=require(_0x6afe('0x19'));var db=require(_0x6afe('0x1a'))['db'];config['redis']=_[_0x6afe('0x1b')](config[_0x6afe('0x1c')],{'host':_0x6afe('0x1d'),'port':0x18eb});var socket=require(_0x6afe('0x1e'))(new Redis(config[_0x6afe('0x1c')]));require(_0x6afe('0x1f'))['register'](socket);function respondWithStatusCode(_0x52ec9f,_0x39c21a){_0x39c21a=_0x39c21a||0xcc;return function(_0xee8db1){if(_0xee8db1){return _0x52ec9f[_0x6afe('0x20')](_0x39c21a);}return _0x52ec9f['status'](_0x39c21a)['end']();};}function respondWithResult(_0x2f4b8f,_0x1a2388){_0x1a2388=_0x1a2388||0xc8;return function(_0x1e4e65){if(_0x1e4e65){return _0x2f4b8f['status'](_0x1a2388)[_0x6afe('0x21')](_0x1e4e65);}};}function respondWithFilteredResult(_0x4e481b,_0x3088c6){return function(_0x292c3e){if(_0x292c3e){var _0x52d032=_0x292c3e[_0x6afe('0x22')],_0x3cbd57=_0x3088c6['offset'],_0x5a07bc=_0x3088c6[_0x6afe('0x23')]+_0x3088c6[_0x6afe('0x24')],_0x25ec7b;if(_0x5a07bc>=_0x52d032){_0x5a07bc=_0x52d032;_0x25ec7b=0xc8;}else{_0x25ec7b=0xce;}_0x4e481b[_0x6afe('0x25')](_0x25ec7b);return _0x4e481b[_0x6afe('0x26')](_0x6afe('0x27'),_0x3cbd57+'-'+_0x5a07bc+'/'+_0x52d032)['json'](_0x292c3e);}return null;};}function patchUpdates(_0x1d3cfb){return function(_0x284b9f){try{jsonpatch['apply'](_0x284b9f,_0x1d3cfb,!![]);}catch(_0x2df83f){return BPromise[_0x6afe('0x28')](_0x2df83f);}return _0x284b9f[_0x6afe('0x29')]();};}function saveUpdates(_0x240b60,_0x4e2ff3){return function(_0xb05ba8){if(_0xb05ba8){return _0xb05ba8[_0x6afe('0x2a')](_0x240b60)[_0x6afe('0x2b')](function(_0x4c92f8){return _0x4c92f8;});}return null;};}function removeEntity(_0x5da91a,_0x5aa226){return function(_0x2fb514){if(_0x2fb514){return _0x2fb514[_0x6afe('0x2c')]()[_0x6afe('0x2b')](function(){var _0xf774cd=_0x2fb514['get']({'plain':!![]});var _0x53138e=[{'name':_0x6afe('0x2d'),'value':_0x6afe('0x2e'),'ignore':![]},{'name':'OutboundRoutes','value':'outbound','ignore':![]},{'name':_0x6afe('0x2f'),'value':_0x6afe('0x30'),'ignore':![]}];var _0x36823f=_(_0x53138e)['filter'](_0x6afe('0x31'))[_0x6afe('0x32')](_0x6afe('0x33'))[_0x6afe('0x33')]();if(_[_0x6afe('0x34')](_0x36823f,_0xf774cd['type'])){return;}var _0x227cc8=_[_0x6afe('0x35')](_0x53138e,[_0x6afe('0x33'),_0xf774cd['type']])[_0x6afe('0x36')];return db['UserProfileResource'][_0x6afe('0x2c')]({'where':{'type':_0x227cc8,'resourceId':_0xf774cd['id']}})['then'](function(){return _0x2fb514;});})[_0x6afe('0x2b')](function(){_0x5da91a['status'](0xcc)[_0x6afe('0x37')]();});}};}function handleEntityNotFound(_0x3cc4d5,_0x311700){return function(_0x955d63){if(!_0x955d63){_0x3cc4d5['sendStatus'](0x194);}return _0x955d63;};}function handleError(_0x21d83,_0x4f3ede){_0x4f3ede=_0x4f3ede||0x1f4;return function(_0x21851f){logger[_0x6afe('0x38')](_0x21851f['stack']);if(_0x21851f['name']){delete _0x21851f[_0x6afe('0x36')];}_0x21d83[_0x6afe('0x25')](_0x4f3ede)[_0x6afe('0x39')](_0x21851f);};}exports[_0x6afe('0x3a')]=function(_0x16738b,_0x4fd3b2){var _0x1c7521={},_0xeecabf={},_0x10a7c3={'count':0x0,'rows':[]};var _0xa803aa=_[_0x6afe('0x32')](db['VoiceExtension'][_0x6afe('0x3b')],function(_0x54e2cc){return{'name':_0x54e2cc['fieldName'],'type':_0x54e2cc[_0x6afe('0x3c')][_0x6afe('0x3d')]};});_0xeecabf[_0x6afe('0x3e')]=_[_0x6afe('0x32')](_0xa803aa,'name');_0xeecabf[_0x6afe('0x3f')]=_['keys'](_0x16738b[_0x6afe('0x3f')]);_0xeecabf['filters']=_['intersection'](_0xeecabf[_0x6afe('0x3e')],_0xeecabf[_0x6afe('0x3f')]);_0x1c7521['attributes']=_[_0x6afe('0x40')](_0xeecabf[_0x6afe('0x3e')],qs['fields'](_0x16738b[_0x6afe('0x3f')][_0x6afe('0x41')]));_0x1c7521[_0x6afe('0x42')]=_0x1c7521[_0x6afe('0x42')][_0x6afe('0x43')]?_0x1c7521[_0x6afe('0x42')]:_0xeecabf['model'];if(!_0x16738b[_0x6afe('0x3f')][_0x6afe('0x44')](_0x6afe('0x45'))){_0x1c7521[_0x6afe('0x24')]=qs[_0x6afe('0x24')](_0x16738b[_0x6afe('0x3f')][_0x6afe('0x24')]);_0x1c7521['offset']=qs[_0x6afe('0x23')](_0x16738b[_0x6afe('0x3f')][_0x6afe('0x23')]);}_0x1c7521['order']=qs[_0x6afe('0x46')](_0x16738b['query'][_0x6afe('0x46')]);_0x1c7521['where']=qs[_0x6afe('0x47')](_[_0x6afe('0x48')](_0x16738b[_0x6afe('0x3f')],_0xeecabf[_0x6afe('0x47')]));if(_0x16738b[_0x6afe('0x3f')][_0x6afe('0x49')]){_0x1c7521[_0x6afe('0x4a')]=_[_0x6afe('0x4b')](_0x1c7521[_0x6afe('0x4a')],{'$or':_[_0x6afe('0x32')](_0xa803aa,function(_0x1f92a2){if(_0x1f92a2[_0x6afe('0x3c')]!==_0x6afe('0x4c')){var _0x1f859d={};_0x1f859d[_0x1f92a2['name']]={'$like':'%'+_0x16738b[_0x6afe('0x3f')][_0x6afe('0x49')]+'%'};return _0x1f859d;}})});}_0x1c7521=_[_0x6afe('0x4b')]({},_0x1c7521,_0x16738b[_0x6afe('0x4d')]);var _0x2b3dab={'where':_0x1c7521[_0x6afe('0x4a')]};return db[_0x6afe('0x4e')][_0x6afe('0x22')](_0x2b3dab)[_0x6afe('0x2b')](function(_0x100e4c){_0x10a7c3['count']=_0x100e4c;if(_0x16738b[_0x6afe('0x3f')]['includeAll']){_0x1c7521[_0x6afe('0x4f')]=[{'all':!![]}];}return db['VoiceExtension'][_0x6afe('0x50')](_0x1c7521);})[_0x6afe('0x2b')](function(_0x5b6b11){_0x10a7c3['rows']=_0x5b6b11;return _0x10a7c3;})[_0x6afe('0x2b')](respondWithFilteredResult(_0x4fd3b2,_0x1c7521))[_0x6afe('0x51')](handleError(_0x4fd3b2,null));};exports[_0x6afe('0x52')]=function(_0x759ab7,_0xbe267a){var _0x1d0214={'raw':![],'where':{'id':_0x759ab7[_0x6afe('0x53')]['id']}},_0x1b9a5d={};_0x1b9a5d[_0x6afe('0x3e')]=_[_0x6afe('0x54')](db['VoiceExtension'][_0x6afe('0x3b')]);_0x1b9a5d[_0x6afe('0x3f')]=_[_0x6afe('0x54')](_0x759ab7[_0x6afe('0x3f')]);_0x1b9a5d[_0x6afe('0x47')]=_['intersection'](_0x1b9a5d[_0x6afe('0x3e')],_0x1b9a5d[_0x6afe('0x3f')]);_0x1d0214[_0x6afe('0x42')]=_[_0x6afe('0x40')](_0x1b9a5d[_0x6afe('0x3e')],qs[_0x6afe('0x41')](_0x759ab7[_0x6afe('0x3f')][_0x6afe('0x41')]));_0x1d0214['attributes']=_0x1d0214['attributes']['length']?_0x1d0214[_0x6afe('0x42')]:_0x1b9a5d[_0x6afe('0x3e')];if(_0x759ab7[_0x6afe('0x3f')]['includeAll']){_0x1d0214[_0x6afe('0x4f')]=[{'all':!![]}];}_0x1d0214=_[_0x6afe('0x4b')]({},_0x1d0214,_0x759ab7['options']);return db['VoiceExtension'][_0x6afe('0x35')](_0x1d0214)[_0x6afe('0x2b')](handleEntityNotFound(_0xbe267a,null))['then'](respondWithResult(_0xbe267a,null))[_0x6afe('0x51')](handleError(_0xbe267a,null));};exports[_0x6afe('0x2c')]=function(_0x43fd74,_0x121a5f){return db[_0x6afe('0x4e')][_0x6afe('0x35')]({'where':{'id':_0x43fd74[_0x6afe('0x53')]['id']}})[_0x6afe('0x2b')](handleEntityNotFound(_0x121a5f,null))['then'](removeEntity(_0x121a5f,null))[_0x6afe('0x51')](handleError(_0x121a5f,null));};exports[_0x6afe('0x55')]=function(_0x42a4c9,_0x3a3869){if(_0x42a4c9[_0x6afe('0x56')][_0x6afe('0x3c')]===_0x6afe('0x57')&&!_[_0x6afe('0x58')](_0x42a4c9[_0x6afe('0x56')][_0x6afe('0x59')],'_')){_0x42a4c9[_0x6afe('0x56')][_0x6afe('0x59')]='_'[_0x6afe('0x5a')](_0x42a4c9[_0x6afe('0x56')][_0x6afe('0x59')]);}return db[_0x6afe('0x4e')]['create'](_0x42a4c9['body'],{'raw':![]})[_0x6afe('0x2b')](function(_0x1a81e3){var _0x459d62=_0x42a4c9[_0x6afe('0x5b')][_0x6afe('0x5c')]({'plain':!![]});if(!_0x459d62)throw new Error('Unable\x20to\x20retrieve\x20the\x20current\x20user');if(_0x459d62[_0x6afe('0x5d')]===_0x6afe('0x5b')){var _0x3c143a=_0x1a81e3['get']({'plain':!![]});var _0x53c3f6=[{'name':_0x6afe('0x2d'),'value':_0x6afe('0x2e')},{'name':'OutboundRoutes','value':_0x6afe('0x57')},{'name':_0x6afe('0x2f'),'value':_0x6afe('0x30')}];var _0x2fc3be=_[_0x6afe('0x35')](_0x53c3f6,[_0x6afe('0x33'),_0x3c143a[_0x6afe('0x3c')]])[_0x6afe('0x36')];return db[_0x6afe('0x5e')][_0x6afe('0x35')]({'where':{'name':_0x2fc3be,'userProfileId':_0x459d62['userProfileId']},'raw':!![]})[_0x6afe('0x2b')](function(_0x284be3){if(_0x284be3&&_0x284be3[_0x6afe('0x5f')]===0x0){return db['UserProfileResource']['create']({'name':_0x3c143a[_0x6afe('0x36')],'resourceId':_0x3c143a['id'],'type':_0x284be3[_0x6afe('0x36')],'sectionId':_0x284be3['id']},{})['then'](function(){return _0x1a81e3;});}else{return _0x1a81e3;}})['catch'](function(_0x59623e){logger['error'](_0x6afe('0x60'),_0x59623e);throw _0x59623e;});}return _0x1a81e3;})[_0x6afe('0x2b')](respondWithResult(_0x3a3869,0xc9))['catch'](handleError(_0x3a3869,null));};exports['update']=function(_0x34463f,_0x908a5b){if(_0x34463f[_0x6afe('0x56')]['id']){delete _0x34463f[_0x6afe('0x56')]['id'];}return db[_0x6afe('0x4e')]['find']({'where':{'id':_0x34463f[_0x6afe('0x53')]['id']}})[_0x6afe('0x2b')](handleEntityNotFound(_0x908a5b,null))[_0x6afe('0x2b')](function(_0x565cb4){if(_0x565cb4){return db[_0x6afe('0x4e')][_0x6afe('0x2a')](_[_0x6afe('0x48')](_0x34463f['body'],['exten','context',_0x6afe('0x61'),_0x6afe('0x62'),'cutdigits',_0x6afe('0x63')]),{'where':{'context':_0x565cb4[_0x6afe('0x64')],'exten':_0x565cb4[_0x6afe('0x59')]},'individualHooks':!![]})[_0x6afe('0x2b')](function(_0x326295){return _0x326295;});}return null;})['then'](respondWithStatusCode(_0x908a5b,null))[_0x6afe('0x51')](handleError(_0x908a5b,null));};exports[_0x6afe('0x65')]=function(_0x350bf4,_0x3fe5b4,_0x20c3ba){return db[_0x6afe('0x4e')][_0x6afe('0x66')]({'where':{'id':_0x350bf4[_0x6afe('0x53')]['id']}})[_0x6afe('0x2b')](handleEntityNotFound(_0x3fe5b4,null))[_0x6afe('0x2b')](function(_0x1cd932){if(_0x1cd932){return db[_0x6afe('0x67')][_0x6afe('0x68')](function(_0x477853){return db['VoiceExtension']['destroy']({'where':{'VoiceExtensionId':_0x350bf4['params']['id']},'transaction':_0x477853})['then'](function(_0x5a1f8e){var _0x663a32=_[_0x6afe('0x32')](_0x350bf4[_0x6afe('0x56')],function(_0x3342b8){_0x3342b8['VoiceExtensionId']=_0x350bf4['params']['id'];return _0x3342b8;});return db[_0x6afe('0x4e')][_0x6afe('0x69')](_0x663a32,{'transaction':_0x477853});});})[_0x6afe('0x2b')](function(){return db[_0x6afe('0x4e')][_0x6afe('0x6a')]({'where':{'isApp':!![],'VoiceExtensionId':_0x350bf4[_0x6afe('0x53')]['id']},'order':_0x6afe('0x6b')});});}})['then'](respondWithResult(_0x3fe5b4,null))[_0x6afe('0x51')](handleError(_0x3fe5b4,null));};
\ No newline at end of file
+var _0x0406=['model','attributes','fields','length','hasOwnProperty','nolimit','sort','where','pick','merge','VIRTUAL','options','VoiceExtension','count','includeAll','include','findAll','rows','catch','show','params','create','body','startsWith','exten','concat','user','role','InboundRoutes','InternalRoutes','UserProfileSection','userProfileId','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','context','description','cutdigits','mandatoryDisposition','findOne','transaction','VoiceExtensionId','findAndCountAll','cast(priority\x20as\x20unsigned)','html-pdf','eml-format','rimraf','zip-dir','request-promise','moment','bluebird','mustache','util','path','sox','squel','crypto','jsforce','desk.js','to-csv','papaparse','../../components/auth/service','../../components/parsers/qs','../../config/license/hardware','api','../../config/utils','../../mysqldb','redis','defaults','localhost','socket.io-emitter','./voiceExtension.socket','register','sendStatus','status','end','json','offset','limit','set','apply','reject','save','update','then','destroy','get','inbound','OutboundRoutes','outbound','internal','filter','value','includes','find','type','UserProfileResource','error','name','send','index','map','rawAttributes','query','keys','filters','intersection'];(function(_0x5c58ae,_0x5af158){var _0x49a91f=function(_0x3ea453){while(--_0x3ea453){_0x5c58ae['push'](_0x5c58ae['shift']());}};_0x49a91f(++_0x5af158);}(_0x0406,0x165));var _0x6040=function(_0x20a584,_0xe384a5){_0x20a584=_0x20a584-0x0;var _0x4b41a8=_0x0406[_0x20a584];return _0x4b41a8;};'use strict';var pdf=require(_0x6040('0x0'));var emlformat=require(_0x6040('0x1'));var rimraf=require(_0x6040('0x2'));var zipdir=require(_0x6040('0x3'));var jsonpatch=require('fast-json-patch');var rp=require(_0x6040('0x4'));var moment=require(_0x6040('0x5'));var BPromise=require(_0x6040('0x6'));var Mustache=require(_0x6040('0x7'));var util=require(_0x6040('0x8'));var path=require(_0x6040('0x9'));var sox=require(_0x6040('0xa'));var csv=require('to-csv');var ejs=require('ejs');var fs=require('fs');var _=require('lodash');var squel=require(_0x6040('0xb'));var crypto=require(_0x6040('0xc'));var jsforce=require(_0x6040('0xd'));var deskjs=require(_0x6040('0xe'));var toCsv=require(_0x6040('0xf'));var querystring=require('querystring');var Papa=require(_0x6040('0x10'));var Redis=require('ioredis');var authService=require(_0x6040('0x11'));var qs=require(_0x6040('0x12'));var as=require('../../components/parsers/advancedSearch');var hardwareService=require(_0x6040('0x13'));var logger=require('../../config/logger')(_0x6040('0x14'));var utils=require(_0x6040('0x15'));var config=require('../../config/environment');var db=require(_0x6040('0x16'))['db'];config[_0x6040('0x17')]=_[_0x6040('0x18')](config[_0x6040('0x17')],{'host':_0x6040('0x19'),'port':0x18eb});var socket=require(_0x6040('0x1a'))(new Redis(config[_0x6040('0x17')]));require(_0x6040('0x1b'))[_0x6040('0x1c')](socket);function respondWithStatusCode(_0xf97f33,_0x3769d4){_0x3769d4=_0x3769d4||0xcc;return function(_0x3c0508){if(_0x3c0508){return _0xf97f33[_0x6040('0x1d')](_0x3769d4);}return _0xf97f33[_0x6040('0x1e')](_0x3769d4)[_0x6040('0x1f')]();};}function respondWithResult(_0x45b626,_0x1b3f58){_0x1b3f58=_0x1b3f58||0xc8;return function(_0x10852e){if(_0x10852e){return _0x45b626[_0x6040('0x1e')](_0x1b3f58)[_0x6040('0x20')](_0x10852e);}};}function respondWithFilteredResult(_0x360586,_0x374e5c){return function(_0x29052f){if(_0x29052f){var _0x78a3fb=_0x29052f['count'],_0x49620f=_0x374e5c[_0x6040('0x21')],_0x28b4a5=_0x374e5c['offset']+_0x374e5c[_0x6040('0x22')],_0x471903;if(_0x28b4a5>=_0x78a3fb){_0x28b4a5=_0x78a3fb;_0x471903=0xc8;}else{_0x471903=0xce;}_0x360586[_0x6040('0x1e')](_0x471903);return _0x360586[_0x6040('0x23')]('Content-Range',_0x49620f+'-'+_0x28b4a5+'/'+_0x78a3fb)[_0x6040('0x20')](_0x29052f);}return null;};}function patchUpdates(_0x48ff5b){return function(_0x5bbe3a){try{jsonpatch[_0x6040('0x24')](_0x5bbe3a,_0x48ff5b,!![]);}catch(_0x48d189){return BPromise[_0x6040('0x25')](_0x48d189);}return _0x5bbe3a[_0x6040('0x26')]();};}function saveUpdates(_0x32816c,_0x3837f5){return function(_0x35132e){if(_0x35132e){return _0x35132e[_0x6040('0x27')](_0x32816c)[_0x6040('0x28')](function(_0x10a0f0){return _0x10a0f0;});}return null;};}function removeEntity(_0x49e0d2,_0x25832b){return function(_0x58f51a){if(_0x58f51a){return _0x58f51a[_0x6040('0x29')]()[_0x6040('0x28')](function(){var _0xae7d39=_0x58f51a[_0x6040('0x2a')]({'plain':!![]});var _0x32ffa4=[{'name':'InboundRoutes','value':_0x6040('0x2b'),'ignore':![]},{'name':_0x6040('0x2c'),'value':_0x6040('0x2d'),'ignore':![]},{'name':'InternalRoutes','value':_0x6040('0x2e'),'ignore':![]}];var _0x908636=_(_0x32ffa4)[_0x6040('0x2f')]('ignore')['map'](_0x6040('0x30'))['value']();if(_[_0x6040('0x31')](_0x908636,_0xae7d39['type'])){return;}var _0x3263c8=_[_0x6040('0x32')](_0x32ffa4,[_0x6040('0x30'),_0xae7d39[_0x6040('0x33')]])['name'];return db[_0x6040('0x34')]['destroy']({'where':{'type':_0x3263c8,'resourceId':_0xae7d39['id']}})[_0x6040('0x28')](function(){return _0x58f51a;});})[_0x6040('0x28')](function(){_0x49e0d2[_0x6040('0x1e')](0xcc)[_0x6040('0x1f')]();});}};}function handleEntityNotFound(_0x13dca3,_0x2445bb){return function(_0x8a5f99){if(!_0x8a5f99){_0x13dca3['sendStatus'](0x194);}return _0x8a5f99;};}function handleError(_0x5269c8,_0x37c4d8){_0x37c4d8=_0x37c4d8||0x1f4;return function(_0xcb35e3){logger[_0x6040('0x35')](_0xcb35e3['stack']);if(_0xcb35e3[_0x6040('0x36')]){delete _0xcb35e3[_0x6040('0x36')];}_0x5269c8[_0x6040('0x1e')](_0x37c4d8)[_0x6040('0x37')](_0xcb35e3);};}exports[_0x6040('0x38')]=function(_0x24809a,_0x7fabfb){var _0x2f103b={},_0x4ccc20={},_0x3f8cfe={'count':0x0,'rows':[]};var _0xd7f6f0=_[_0x6040('0x39')](db['VoiceExtension'][_0x6040('0x3a')],function(_0x9a6f24){return{'name':_0x9a6f24['fieldName'],'type':_0x9a6f24[_0x6040('0x33')]['key']};});_0x4ccc20['model']=_[_0x6040('0x39')](_0xd7f6f0,_0x6040('0x36'));_0x4ccc20[_0x6040('0x3b')]=_[_0x6040('0x3c')](_0x24809a[_0x6040('0x3b')]);_0x4ccc20[_0x6040('0x3d')]=_[_0x6040('0x3e')](_0x4ccc20[_0x6040('0x3f')],_0x4ccc20['query']);_0x2f103b[_0x6040('0x40')]=_[_0x6040('0x3e')](_0x4ccc20[_0x6040('0x3f')],qs['fields'](_0x24809a[_0x6040('0x3b')][_0x6040('0x41')]));_0x2f103b[_0x6040('0x40')]=_0x2f103b['attributes'][_0x6040('0x42')]?_0x2f103b[_0x6040('0x40')]:_0x4ccc20[_0x6040('0x3f')];if(!_0x24809a['query'][_0x6040('0x43')](_0x6040('0x44'))){_0x2f103b[_0x6040('0x22')]=qs[_0x6040('0x22')](_0x24809a[_0x6040('0x3b')][_0x6040('0x22')]);_0x2f103b[_0x6040('0x21')]=qs['offset'](_0x24809a[_0x6040('0x3b')][_0x6040('0x21')]);}_0x2f103b['order']=qs[_0x6040('0x45')](_0x24809a[_0x6040('0x3b')][_0x6040('0x45')]);_0x2f103b[_0x6040('0x46')]=qs[_0x6040('0x3d')](_[_0x6040('0x47')](_0x24809a[_0x6040('0x3b')],_0x4ccc20[_0x6040('0x3d')]));if(_0x24809a[_0x6040('0x3b')][_0x6040('0x2f')]){_0x2f103b[_0x6040('0x46')]=_[_0x6040('0x48')](_0x2f103b[_0x6040('0x46')],{'$or':_[_0x6040('0x39')](_0xd7f6f0,function(_0x591dff){if(_0x591dff[_0x6040('0x33')]!==_0x6040('0x49')){var _0x33857d={};_0x33857d[_0x591dff[_0x6040('0x36')]]={'$like':'%'+_0x24809a[_0x6040('0x3b')]['filter']+'%'};return _0x33857d;}})});}_0x2f103b=_[_0x6040('0x48')]({},_0x2f103b,_0x24809a[_0x6040('0x4a')]);var _0x26e797={'where':_0x2f103b[_0x6040('0x46')]};return db[_0x6040('0x4b')][_0x6040('0x4c')](_0x26e797)[_0x6040('0x28')](function(_0x5d56ce){_0x3f8cfe[_0x6040('0x4c')]=_0x5d56ce;if(_0x24809a[_0x6040('0x3b')][_0x6040('0x4d')]){_0x2f103b[_0x6040('0x4e')]=[{'all':!![]}];}return db[_0x6040('0x4b')][_0x6040('0x4f')](_0x2f103b);})['then'](function(_0xf7c989){_0x3f8cfe[_0x6040('0x50')]=_0xf7c989;return _0x3f8cfe;})[_0x6040('0x28')](respondWithFilteredResult(_0x7fabfb,_0x2f103b))[_0x6040('0x51')](handleError(_0x7fabfb,null));};exports[_0x6040('0x52')]=function(_0x5afb4e,_0x4449d4){var _0x3ab86b={'raw':![],'where':{'id':_0x5afb4e['params']['id']}},_0x339b8b={};_0x339b8b[_0x6040('0x3f')]=_[_0x6040('0x3c')](db[_0x6040('0x4b')][_0x6040('0x3a')]);_0x339b8b[_0x6040('0x3b')]=_[_0x6040('0x3c')](_0x5afb4e[_0x6040('0x3b')]);_0x339b8b[_0x6040('0x3d')]=_[_0x6040('0x3e')](_0x339b8b['model'],_0x339b8b[_0x6040('0x3b')]);_0x3ab86b[_0x6040('0x40')]=_[_0x6040('0x3e')](_0x339b8b[_0x6040('0x3f')],qs['fields'](_0x5afb4e[_0x6040('0x3b')][_0x6040('0x41')]));_0x3ab86b[_0x6040('0x40')]=_0x3ab86b['attributes']['length']?_0x3ab86b[_0x6040('0x40')]:_0x339b8b['model'];if(_0x5afb4e[_0x6040('0x3b')][_0x6040('0x4d')]){_0x3ab86b[_0x6040('0x4e')]=[{'all':!![]}];}_0x3ab86b=_[_0x6040('0x48')]({},_0x3ab86b,_0x5afb4e[_0x6040('0x4a')]);return db[_0x6040('0x4b')][_0x6040('0x32')](_0x3ab86b)['then'](handleEntityNotFound(_0x4449d4,null))['then'](respondWithResult(_0x4449d4,null))['catch'](handleError(_0x4449d4,null));};exports[_0x6040('0x29')]=function(_0x2a1bb9,_0x52284f){return db[_0x6040('0x4b')][_0x6040('0x32')]({'where':{'id':_0x2a1bb9[_0x6040('0x53')]['id']}})[_0x6040('0x28')](handleEntityNotFound(_0x52284f,null))[_0x6040('0x28')](removeEntity(_0x52284f,null))[_0x6040('0x51')](handleError(_0x52284f,null));};exports[_0x6040('0x54')]=function(_0x238422,_0x2c311f){if(_0x238422[_0x6040('0x55')][_0x6040('0x33')]===_0x6040('0x2d')&&!_[_0x6040('0x56')](_0x238422[_0x6040('0x55')][_0x6040('0x57')],'_')){_0x238422[_0x6040('0x55')]['exten']='_'[_0x6040('0x58')](_0x238422['body'][_0x6040('0x57')]);}return db['VoiceExtension'][_0x6040('0x54')](_0x238422['body'],{'raw':![]})[_0x6040('0x28')](function(_0x2c7f37){var _0x642504=_0x238422[_0x6040('0x59')]['get']({'plain':!![]});if(!_0x642504)throw new Error('Unable\x20to\x20retrieve\x20the\x20current\x20user');if(_0x642504[_0x6040('0x5a')]===_0x6040('0x59')){var _0x3cfb50=_0x2c7f37[_0x6040('0x2a')]({'plain':!![]});var _0x2f2b8e=[{'name':_0x6040('0x5b'),'value':_0x6040('0x2b')},{'name':_0x6040('0x2c'),'value':'outbound'},{'name':_0x6040('0x5c'),'value':_0x6040('0x2e')}];var _0x4e5588=_['find'](_0x2f2b8e,['value',_0x3cfb50[_0x6040('0x33')]])[_0x6040('0x36')];return db[_0x6040('0x5d')][_0x6040('0x32')]({'where':{'name':_0x4e5588,'userProfileId':_0x642504[_0x6040('0x5e')]},'raw':!![]})[_0x6040('0x28')](function(_0x560f66){if(_0x560f66&&_0x560f66['autoAssociation']===0x0){return db[_0x6040('0x34')]['create']({'name':_0x3cfb50[_0x6040('0x36')],'resourceId':_0x3cfb50['id'],'type':_0x560f66[_0x6040('0x36')],'sectionId':_0x560f66['id']},{})[_0x6040('0x28')](function(){return _0x2c7f37;});}else{return _0x2c7f37;}})[_0x6040('0x51')](function(_0xce0a00){logger['error'](_0x6040('0x5f'),_0xce0a00);throw _0xce0a00;});}return _0x2c7f37;})[_0x6040('0x28')](respondWithResult(_0x2c311f,0xc9))[_0x6040('0x51')](handleError(_0x2c311f,null));};exports[_0x6040('0x27')]=function(_0x18891b,_0x3753e8){if(_0x18891b[_0x6040('0x55')]['id']){delete _0x18891b[_0x6040('0x55')]['id'];}return db[_0x6040('0x4b')][_0x6040('0x32')]({'where':{'id':_0x18891b[_0x6040('0x53')]['id']}})[_0x6040('0x28')](handleEntityNotFound(_0x3753e8,null))[_0x6040('0x28')](function(_0x47576b){if(_0x47576b){return db[_0x6040('0x4b')][_0x6040('0x27')](_['pick'](_0x18891b['body'],[_0x6040('0x57'),_0x6040('0x60'),_0x6040('0x61'),'recordingFormat',_0x6040('0x62'),_0x6040('0x63')]),{'where':{'context':_0x47576b[_0x6040('0x60')],'exten':_0x47576b[_0x6040('0x57')]},'individualHooks':!![]})['then'](function(_0x1f48c6){return _0x1f48c6;});}return null;})[_0x6040('0x28')](respondWithStatusCode(_0x3753e8,null))[_0x6040('0x51')](handleError(_0x3753e8,null));};exports['addApplications']=function(_0x5dbb03,_0x30b55a,_0x405190){return db['VoiceExtension'][_0x6040('0x64')]({'where':{'id':_0x5dbb03['params']['id']}})['then'](handleEntityNotFound(_0x30b55a,null))[_0x6040('0x28')](function(_0x3d7118){if(_0x3d7118){return db['sequelize'][_0x6040('0x65')](function(_0x14974a){return db['VoiceExtension'][_0x6040('0x29')]({'where':{'VoiceExtensionId':_0x5dbb03[_0x6040('0x53')]['id']},'transaction':_0x14974a})[_0x6040('0x28')](function(_0x20b0e1){var _0x3d1a4d=_[_0x6040('0x39')](_0x5dbb03[_0x6040('0x55')],function(_0x556813){_0x556813[_0x6040('0x66')]=_0x5dbb03[_0x6040('0x53')]['id'];return _0x556813;});return db[_0x6040('0x4b')]['bulkCreate'](_0x3d1a4d,{'transaction':_0x14974a});});})[_0x6040('0x28')](function(){return db[_0x6040('0x4b')][_0x6040('0x67')]({'where':{'isApp':!![],'VoiceExtensionId':_0x5dbb03[_0x6040('0x53')]['id']},'order':_0x6040('0x68')});});}})[_0x6040('0x28')](respondWithResult(_0x30b55a,null))['catch'](handleError(_0x30b55a,null));};
\ No newline at end of file
diff --git a/server/api/voiceExtension/voiceExtension.events.js b/server/api/voiceExtension/voiceExtension.events.js
index 67461b7..15d7522 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 _0xd28f=['hook','exports','../../mysqldb','update','emit','hasOwnProperty'];(function(_0x31302b,_0x29c87c){var _0x4a49f8=function(_0x274e73){while(--_0x274e73){_0x31302b['push'](_0x31302b['shift']());}};_0x4a49f8(++_0x29c87c);}(_0xd28f,0x134));var _0xfd28=function(_0x151a26,_0x23ec58){_0x151a26=_0x151a26-0x0;var _0x6e99=_0xd28f[_0x151a26];return _0x6e99;};'use strict';var EventEmitter=require('events');var VoiceExtension=require(_0xfd28('0x0'))['db']['VoiceExtension'];var VoiceExtensionEvents=new EventEmitter();VoiceExtensionEvents['setMaxListeners'](0x0);var events={'afterCreate':'save','afterUpdate':_0xfd28('0x1'),'afterDestroy':'remove'};function emitEvent(_0x952a2d){return function(_0x275aa3,_0x4b4a5f,_0x1fab67){VoiceExtensionEvents['emit'](_0x952a2d+':'+_0x275aa3['id'],_0x275aa3);VoiceExtensionEvents[_0xfd28('0x2')](_0x952a2d,_0x275aa3);_0x1fab67(null);};}for(var e in events){if(events[_0xfd28('0x3')](e)){var event=events[e];VoiceExtension[_0xfd28('0x4')](e,emitEvent(event));}}module[_0xfd28('0x5')]=VoiceExtensionEvents;
\ No newline at end of file
+var _0xb4e4=['exports','VoiceExtension','setMaxListeners','update','remove','emit','hasOwnProperty','hook'];(function(_0x5f09c5,_0x2bfca0){var _0x426ad9=function(_0x18fe5f){while(--_0x18fe5f){_0x5f09c5['push'](_0x5f09c5['shift']());}};_0x426ad9(++_0x2bfca0);}(_0xb4e4,0x119));var _0x4b4e=function(_0x3abd00,_0xa7acfa){_0x3abd00=_0x3abd00-0x0;var _0x2bfad7=_0xb4e4[_0x3abd00];return _0x2bfad7;};'use strict';var EventEmitter=require('events');var VoiceExtension=require('../../mysqldb')['db'][_0x4b4e('0x0')];var VoiceExtensionEvents=new EventEmitter();VoiceExtensionEvents[_0x4b4e('0x1')](0x0);var events={'afterCreate':'save','afterUpdate':_0x4b4e('0x2'),'afterDestroy':_0x4b4e('0x3')};function emitEvent(_0x8eeddd){return function(_0x5a5adc,_0xc0fb91,_0xb84768){VoiceExtensionEvents['emit'](_0x8eeddd+':'+_0x5a5adc['id'],_0x5a5adc);VoiceExtensionEvents[_0x4b4e('0x4')](_0x8eeddd,_0x5a5adc);_0xb84768(null);};}for(var e in events){if(events[_0x4b4e('0x5')](e)){var event=events[e];VoiceExtension[_0x4b4e('0x6')](e,emitEvent(event));}}module[_0x4b4e('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 2b2fccd..061ff55 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 _0x38ac=['util','../../config/logger','api','moment','bluebird','request-promise','rimraf','../../config/environment','exports','VoiceExtension','lodash'];(function(_0x1beef3,_0x57c4b8){var _0x5af964=function(_0x36f463){while(--_0x36f463){_0x1beef3['push'](_0x1beef3['shift']());}};_0x5af964(++_0x57c4b8);}(_0x38ac,0x154));var _0xc38a=function(_0x5d6456,_0x58ecc7){_0x5d6456=_0x5d6456-0x0;var _0x4d66c1=_0x38ac[_0x5d6456];return _0x4d66c1;};'use strict';var _=require(_0xc38a('0x0'));var util=require(_0xc38a('0x1'));var logger=require(_0xc38a('0x2'))(_0xc38a('0x3'));var moment=require(_0xc38a('0x4'));var BPromise=require(_0xc38a('0x5'));var rp=require(_0xc38a('0x6'));var fs=require('fs');var path=require('path');var rimraf=require(_0xc38a('0x7'));var config=require(_0xc38a('0x8'));var attributes=require('./voiceExtension.attributes');module[_0xc38a('0x9')]=function(_0x52b63d,_0x31e90b){return _0x52b63d['define'](_0xc38a('0xa'),attributes,{'tableName':'voice_extensions','paranoid':![],'indexes':[],'timestamps':!![]});};
\ No newline at end of file
+var _0x59f1=['VoiceExtension','util','api','bluebird','request-promise','path','../../config/environment','./voiceExtension.attributes','exports','define'];(function(_0x3f8d25,_0x59a9d2){var _0x387dde=function(_0x3ab4ed){while(--_0x3ab4ed){_0x3f8d25['push'](_0x3f8d25['shift']());}};_0x387dde(++_0x59a9d2);}(_0x59f1,0x6f));var _0x159f=function(_0x1909bc,_0x37aa8e){_0x1909bc=_0x1909bc-0x0;var _0x47a10b=_0x59f1[_0x1909bc];return _0x47a10b;};'use strict';var _=require('lodash');var util=require(_0x159f('0x0'));var logger=require('../../config/logger')(_0x159f('0x1'));var moment=require('moment');var BPromise=require(_0x159f('0x2'));var rp=require(_0x159f('0x3'));var fs=require('fs');var path=require(_0x159f('0x4'));var rimraf=require('rimraf');var config=require(_0x159f('0x5'));var attributes=require(_0x159f('0x6'));module[_0x159f('0x7')]=function(_0x391977,_0x45adfa){return _0x391977[_0x159f('0x8')](_0x159f('0x9'),attributes,{'tableName':'voice_extensions','paranoid':![],'indexes':[],'timestamps':!![]});};
\ No newline at end of file
diff --git a/server/api/voiceExtension/voiceExtension.rpc.js b/server/api/voiceExtension/voiceExtension.rpc.js
index a7c8dc8..1166d5d 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 _0x50ec=['defaults','localhost','./voiceExtension.socket','register','request','then','info','VoiceExtension,\x20%s,\x20%s','debug','VoiceExtension,\x20%s,\x20%s,\x20%s','request\x20sent','stringify','error','code','message','catch','GetVoiceExtension','VoiceExtension','findAll','options','raw','where','include','map','model','attributes','util','moment','bluebird','randomstring','ioredis','../../config/utils','rpc','../../config/environment','client','http','redis'];(function(_0x3ab51d,_0x2fa01d){var _0x29a04e=function(_0x7807b0){while(--_0x7807b0){_0x3ab51d['push'](_0x3ab51d['shift']());}};_0x29a04e(++_0x2fa01d);}(_0x50ec,0xd3));var _0xc50e=function(_0x358d3b,_0x552163){_0x358d3b=_0x358d3b-0x0;var _0x181acc=_0x50ec[_0x358d3b];return _0x181acc;};'use strict';var _=require('lodash');var util=require(_0xc50e('0x0'));var moment=require(_0xc50e('0x1'));var BPromise=require(_0xc50e('0x2'));var rs=require(_0xc50e('0x3'));var fs=require('fs');var Redis=require(_0xc50e('0x4'));var db=require('../../mysqldb')['db'];var utils=require(_0xc50e('0x5'));var logger=require('../../config/logger')(_0xc50e('0x6'));var config=require(_0xc50e('0x7'));var jayson=require('jayson/promise');var client=jayson[_0xc50e('0x8')][_0xc50e('0x9')]({'port':0x232a});config[_0xc50e('0xa')]=_[_0xc50e('0xb')](config[_0xc50e('0xa')],{'host':_0xc50e('0xc'),'port':0x18eb});var socket=require('socket.io-emitter')(new Redis(config[_0xc50e('0xa')]));require(_0xc50e('0xd'))[_0xc50e('0xe')](socket);function respondWithRpcPromise(_0xdc1361,_0x488144,_0x141d9a){return new BPromise(function(_0x51f0c1,_0x1fcceb){return client[_0xc50e('0xf')](_0xdc1361,_0x141d9a)[_0xc50e('0x10')](function(_0x37a230){logger[_0xc50e('0x11')](_0xc50e('0x12'),_0x488144,'request\x20sent');logger[_0xc50e('0x13')](_0xc50e('0x14'),_0x488144,_0xc50e('0x15'),JSON[_0xc50e('0x16')](_0x37a230));if(_0x37a230[_0xc50e('0x17')]){if(_0x37a230[_0xc50e('0x17')][_0xc50e('0x18')]===0x1f4){logger[_0xc50e('0x17')](_0xc50e('0x12'),_0x488144,_0x37a230['error'][_0xc50e('0x19')]);return _0x1fcceb(_0x37a230[_0xc50e('0x17')][_0xc50e('0x19')]);}logger[_0xc50e('0x17')](_0xc50e('0x12'),_0x488144,_0x37a230[_0xc50e('0x17')][_0xc50e('0x19')]);return _0x51f0c1(_0x37a230[_0xc50e('0x17')][_0xc50e('0x19')]);}else{logger[_0xc50e('0x11')]('VoiceExtension,\x20%s,\x20%s',_0x488144,_0xc50e('0x15'));_0x51f0c1(_0x37a230['result'][_0xc50e('0x19')]);}})[_0xc50e('0x1a')](function(_0x13235e){logger[_0xc50e('0x17')](_0xc50e('0x12'),_0x488144,_0x13235e);_0x1fcceb(_0x13235e);});});}exports[_0xc50e('0x1b')]=function(_0x3952c5){var _0x5b76ad=this;return new Promise(function(_0x1f7d88,_0x3ba26f){return db[_0xc50e('0x1c')][_0xc50e('0x1d')]({'raw':_0x3952c5['options']?_0x3952c5[_0xc50e('0x1e')][_0xc50e('0x1f')]===undefined?!![]:![]:!![],'where':_0x3952c5[_0xc50e('0x1e')]?_0x3952c5['options'][_0xc50e('0x20')]||null:null,'attributes':_0x3952c5[_0xc50e('0x1e')]?_0x3952c5[_0xc50e('0x1e')]['attributes']||null:null,'limit':_0x3952c5[_0xc50e('0x1e')]?_0x3952c5['options']['limit']||null:null,'include':_0x3952c5['options']?_0x3952c5['options'][_0xc50e('0x21')]?_[_0xc50e('0x22')](_0x3952c5[_0xc50e('0x1e')]['include'],function(_0x2f8dfd){return{'model':db[_0x2f8dfd[_0xc50e('0x23')]],'as':_0x2f8dfd['as'],'attributes':_0x2f8dfd[_0xc50e('0x24')],'include':_0x2f8dfd[_0xc50e('0x21')]?_[_0xc50e('0x22')](_0x2f8dfd[_0xc50e('0x21')],function(_0x43d6c3){return{'model':db[_0x43d6c3['model']],'as':_0x43d6c3['as'],'attributes':_0x43d6c3[_0xc50e('0x24')],'include':_0x43d6c3[_0xc50e('0x21')]?_['map'](_0x43d6c3[_0xc50e('0x21')],function(_0x40b216){return{'model':db[_0x40b216[_0xc50e('0x23')]],'as':_0x40b216['as'],'attributes':_0x40b216[_0xc50e('0x24')]};}):[]};}):[]};}):[]:[]})[_0xc50e('0x10')](function(_0x1f73b4){logger[_0xc50e('0x11')](_0xc50e('0x1b'),_0x3952c5);logger['debug'](_0xc50e('0x1b'),_0x3952c5,JSON['stringify'](_0x1f73b4));_0x1f7d88(_0x1f73b4);})[_0xc50e('0x1a')](function(_0x114f38){logger[_0xc50e('0x17')](_0xc50e('0x1b'),_0x114f38[_0xc50e('0x19')],_0x3952c5);_0x3ba26f(_0x5b76ad[_0xc50e('0x17')](0x1f4,_0x114f38[_0xc50e('0x19')]));});});};
\ No newline at end of file
+var _0xe36f=['client','http','redis','localhost','socket.io-emitter','register','info','debug','VoiceExtension,\x20%s,\x20%s,\x20%s','request\x20sent','stringify','error','code','message','VoiceExtension,\x20%s,\x20%s','result','catch','GetVoiceExtension','VoiceExtension','findAll','options','raw','where','limit','include','map','model','attributes','then','util','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise'];(function(_0x1ed944,_0x4d4caa){var _0x2f8d62=function(_0x31ef35){while(--_0x31ef35){_0x1ed944['push'](_0x1ed944['shift']());}};_0x2f8d62(++_0x4d4caa);}(_0xe36f,0x119));var _0xfe36=function(_0x3dd15e,_0x1f0015){_0x3dd15e=_0x3dd15e-0x0;var _0x231fd0=_0xe36f[_0x3dd15e];return _0x231fd0;};'use strict';var _=require('lodash');var util=require(_0xfe36('0x0'));var moment=require('moment');var BPromise=require('bluebird');var rs=require('randomstring');var fs=require('fs');var Redis=require('ioredis');var db=require(_0xfe36('0x1'))['db'];var utils=require(_0xfe36('0x2'));var logger=require(_0xfe36('0x3'))(_0xfe36('0x4'));var config=require(_0xfe36('0x5'));var jayson=require(_0xfe36('0x6'));var client=jayson[_0xfe36('0x7')][_0xfe36('0x8')]({'port':0x232a});config[_0xfe36('0x9')]=_['defaults'](config[_0xfe36('0x9')],{'host':_0xfe36('0xa'),'port':0x18eb});var socket=require(_0xfe36('0xb'))(new Redis(config[_0xfe36('0x9')]));require('./voiceExtension.socket')[_0xfe36('0xc')](socket);function respondWithRpcPromise(_0x41639e,_0x991b93,_0x2c930d){return new BPromise(function(_0x618ce6,_0x1f7f87){return client['request'](_0x41639e,_0x2c930d)['then'](function(_0x4c4fed){logger[_0xfe36('0xd')]('VoiceExtension,\x20%s,\x20%s',_0x991b93,'request\x20sent');logger[_0xfe36('0xe')](_0xfe36('0xf'),_0x991b93,_0xfe36('0x10'),JSON[_0xfe36('0x11')](_0x4c4fed));if(_0x4c4fed[_0xfe36('0x12')]){if(_0x4c4fed[_0xfe36('0x12')][_0xfe36('0x13')]===0x1f4){logger[_0xfe36('0x12')]('VoiceExtension,\x20%s,\x20%s',_0x991b93,_0x4c4fed[_0xfe36('0x12')][_0xfe36('0x14')]);return _0x1f7f87(_0x4c4fed[_0xfe36('0x12')][_0xfe36('0x14')]);}logger[_0xfe36('0x12')](_0xfe36('0x15'),_0x991b93,_0x4c4fed[_0xfe36('0x12')][_0xfe36('0x14')]);return _0x618ce6(_0x4c4fed['error'][_0xfe36('0x14')]);}else{logger['info'](_0xfe36('0x15'),_0x991b93,_0xfe36('0x10'));_0x618ce6(_0x4c4fed[_0xfe36('0x16')][_0xfe36('0x14')]);}})[_0xfe36('0x17')](function(_0x412d56){logger[_0xfe36('0x12')](_0xfe36('0x15'),_0x991b93,_0x412d56);_0x1f7f87(_0x412d56);});});}exports[_0xfe36('0x18')]=function(_0x35928f){var _0x504c6c=this;return new Promise(function(_0x390a1b,_0x3f3263){return db[_0xfe36('0x19')][_0xfe36('0x1a')]({'raw':_0x35928f[_0xfe36('0x1b')]?_0x35928f[_0xfe36('0x1b')][_0xfe36('0x1c')]===undefined?!![]:![]:!![],'where':_0x35928f[_0xfe36('0x1b')]?_0x35928f[_0xfe36('0x1b')][_0xfe36('0x1d')]||null:null,'attributes':_0x35928f[_0xfe36('0x1b')]?_0x35928f[_0xfe36('0x1b')]['attributes']||null:null,'limit':_0x35928f['options']?_0x35928f[_0xfe36('0x1b')][_0xfe36('0x1e')]||null:null,'include':_0x35928f['options']?_0x35928f[_0xfe36('0x1b')][_0xfe36('0x1f')]?_[_0xfe36('0x20')](_0x35928f['options']['include'],function(_0x5321a9){return{'model':db[_0x5321a9[_0xfe36('0x21')]],'as':_0x5321a9['as'],'attributes':_0x5321a9[_0xfe36('0x22')],'include':_0x5321a9['include']?_[_0xfe36('0x20')](_0x5321a9[_0xfe36('0x1f')],function(_0x777bf4){return{'model':db[_0x777bf4[_0xfe36('0x21')]],'as':_0x777bf4['as'],'attributes':_0x777bf4[_0xfe36('0x22')],'include':_0x777bf4[_0xfe36('0x1f')]?_[_0xfe36('0x20')](_0x777bf4[_0xfe36('0x1f')],function(_0x386d71){return{'model':db[_0x386d71[_0xfe36('0x21')]],'as':_0x386d71['as'],'attributes':_0x386d71[_0xfe36('0x22')]};}):[]};}):[]};}):[]:[]})[_0xfe36('0x23')](function(_0x19e92c){logger[_0xfe36('0xd')](_0xfe36('0x18'),_0x35928f);logger['debug']('GetVoiceExtension',_0x35928f,JSON[_0xfe36('0x11')](_0x19e92c));_0x390a1b(_0x19e92c);})['catch'](function(_0x56bbc0){logger[_0xfe36('0x12')](_0xfe36('0x18'),_0x56bbc0[_0xfe36('0x14')],_0x35928f);_0x3f3263(_0x504c6c[_0xfe36('0x12')](0x1f4,_0x56bbc0[_0xfe36('0x14')]));});});};
\ No newline at end of file
diff --git a/server/api/voiceExtension/voiceExtension.socket.js b/server/api/voiceExtension/voiceExtension.socket.js
index dd894f1..a2a90d3 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 _0x6e23=['save','update','emit','removeListener','register','length','voiceExtension:'];(function(_0x2c6d5a,_0x51903f){var _0x5ec196=function(_0x52e45a){while(--_0x52e45a){_0x2c6d5a['push'](_0x2c6d5a['shift']());}};_0x5ec196(++_0x51903f);}(_0x6e23,0xf5));var _0x36e2=function(_0x4163ef,_0x15980d){_0x4163ef=_0x4163ef-0x0;var _0x4c16d3=_0x6e23[_0x4163ef];return _0x4c16d3;};'use strict';var VoiceExtensionEvents=require('./voiceExtension.events');var events=[_0x36e2('0x0'),'remove',_0x36e2('0x1')];function createListener(_0xbc9e29,_0x30905f){return function(_0x1e3548){_0x30905f[_0x36e2('0x2')](_0xbc9e29,_0x1e3548);};}function removeListener(_0x164cc3,_0x2a07f7){return function(){VoiceExtensionEvents[_0x36e2('0x3')](_0x164cc3,_0x2a07f7);};}exports[_0x36e2('0x4')]=function(_0x379c34){for(var _0x49263f=0x0,_0x199d0e=events[_0x36e2('0x5')];_0x49263f<_0x199d0e;_0x49263f++){var _0x45e35b=events[_0x49263f];var _0x24c662=createListener(_0x36e2('0x6')+_0x45e35b,_0x379c34);VoiceExtensionEvents['on'](_0x45e35b,_0x24c662);}};
\ No newline at end of file
+var _0x7d60=['./voiceExtension.events','save','remove','update','removeListener','register','length','voiceExtension:'];(function(_0x236d24,_0x29e80a){var _0x1574cf=function(_0x5d1dad){while(--_0x5d1dad){_0x236d24['push'](_0x236d24['shift']());}};_0x1574cf(++_0x29e80a);}(_0x7d60,0x138));var _0x07d6=function(_0x44538c,_0x223671){_0x44538c=_0x44538c-0x0;var _0x3d283a=_0x7d60[_0x44538c];return _0x3d283a;};'use strict';var VoiceExtensionEvents=require(_0x07d6('0x0'));var events=[_0x07d6('0x1'),_0x07d6('0x2'),_0x07d6('0x3')];function createListener(_0x543a75,_0x469126){return function(_0x2b7c13){_0x469126['emit'](_0x543a75,_0x2b7c13);};}function removeListener(_0x390520,_0x56ae0d){return function(){VoiceExtensionEvents[_0x07d6('0x4')](_0x390520,_0x56ae0d);};}exports[_0x07d6('0x5')]=function(_0x52ad74){for(var _0x2fd56f=0x0,_0x14ade0=events[_0x07d6('0x6')];_0x2fd56f<_0x14ade0;_0x2fd56f++){var _0x132519=events[_0x2fd56f];var _0x174bc2=createListener(_0x07d6('0x7')+_0x132519,_0x52ad74);VoiceExtensionEvents['on'](_0x132519,_0x174bc2);}};
\ No newline at end of file
diff --git a/server/api/voiceMail/index.js b/server/api/voiceMail/index.js
index c37631f..9eb4db3 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 _0xea17=['destroy','exports','multer','util','path','connect-timeout','Router','../../components/interaction/service','get','isAuthenticated','/:id','show','/:id/messages','getMessages','post','create','put','update','delete'];(function(_0x57ab3b,_0x5501da){var _0x1ea5ae=function(_0x5cf040){while(--_0x5cf040){_0x57ab3b['push'](_0x57ab3b['shift']());}};_0x1ea5ae(++_0x5501da);}(_0xea17,0x17e));var _0x7ea1=function(_0x412f7e,_0x452aa5){_0x412f7e=_0x412f7e-0x0;var _0x1fe5c7=_0xea17[_0x412f7e];return _0x1fe5c7;};'use strict';var multer=require(_0x7ea1('0x0'));var util=require(_0x7ea1('0x1'));var path=require(_0x7ea1('0x2'));var timeout=require(_0x7ea1('0x3'));var express=require('express');var router=express[_0x7ea1('0x4')]();var auth=require('../../components/auth/service');var interaction=require(_0x7ea1('0x5'));var config=require('../../config/environment');var controller=require('./voiceMail.controller');router[_0x7ea1('0x6')]('/',auth[_0x7ea1('0x7')](),controller['index']);router[_0x7ea1('0x6')](_0x7ea1('0x8'),auth[_0x7ea1('0x7')](),controller[_0x7ea1('0x9')]);router[_0x7ea1('0x6')](_0x7ea1('0xa'),auth[_0x7ea1('0x7')](),controller[_0x7ea1('0xb')]);router[_0x7ea1('0xc')]('/',auth['isAuthenticated'](),controller[_0x7ea1('0xd')]);router[_0x7ea1('0xe')](_0x7ea1('0x8'),auth[_0x7ea1('0x7')](),controller[_0x7ea1('0xf')]);router[_0x7ea1('0x10')](_0x7ea1('0x8'),auth[_0x7ea1('0x7')](),controller[_0x7ea1('0x11')]);module[_0x7ea1('0x12')]=router;
\ No newline at end of file
+var _0x21f3=['update','delete','exports','util','path','connect-timeout','express','Router','../../components/auth/service','../../config/environment','./voiceMail.controller','isAuthenticated','index','get','/:id','show','/:id/messages','post'];(function(_0x4cf8d4,_0x5aee73){var _0x2c1beb=function(_0x39b0a4){while(--_0x39b0a4){_0x4cf8d4['push'](_0x4cf8d4['shift']());}};_0x2c1beb(++_0x5aee73);}(_0x21f3,0x18f));var _0x321f=function(_0x6b213c,_0x4d0f2f){_0x6b213c=_0x6b213c-0x0;var _0x3e1179=_0x21f3[_0x6b213c];return _0x3e1179;};'use strict';var multer=require('multer');var util=require(_0x321f('0x0'));var path=require(_0x321f('0x1'));var timeout=require(_0x321f('0x2'));var express=require(_0x321f('0x3'));var router=express[_0x321f('0x4')]();var auth=require(_0x321f('0x5'));var interaction=require('../../components/interaction/service');var config=require(_0x321f('0x6'));var controller=require(_0x321f('0x7'));router['get']('/',auth[_0x321f('0x8')](),controller[_0x321f('0x9')]);router[_0x321f('0xa')](_0x321f('0xb'),auth[_0x321f('0x8')](),controller[_0x321f('0xc')]);router[_0x321f('0xa')](_0x321f('0xd'),auth['isAuthenticated'](),controller['getMessages']);router[_0x321f('0xe')]('/',auth['isAuthenticated'](),controller['create']);router['put'](_0x321f('0xb'),auth[_0x321f('0x8')](),controller[_0x321f('0xf')]);router[_0x321f('0x10')](_0x321f('0xb'),auth[_0x321f('0x8')](),controller['destroy']);module[_0x321f('0x11')]=router;
\ No newline at end of file
diff --git a/server/api/voiceMail/voiceMail.attributes.js b/server/api/voiceMail/voiceMail.attributes.js
index 74c7bd4..98ec9e7 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 _0xb03e=['VIRTUAL','getDataValue','fullname','\x20-\x20','mailbox','exports','STRING','from-voicemail','contest_mailbox','setDataValue','string','trim','central','yes','ENUM','TINYINT(4)','TIMESTAMP','INTEGER'];(function(_0x1de3d6,_0x57ab52){var _0x50a0ec=function(_0x45e330){while(--_0x45e330){_0x1de3d6['push'](_0x1de3d6['shift']());}};_0x50a0ec(++_0x57ab52);}(_0xb03e,0x1eb));var _0xeb03=function(_0x10960c,_0x41ffd2){_0x10960c=_0x10960c-0x0;var _0x5977a0=_0xb03e[_0x10960c];return _0x5977a0;};'use strict';var Sequelize=require('sequelize');module[_0xeb03('0x0')]={'customer_id':{'type':Sequelize[_0xeb03('0x1')]},'context':{'type':Sequelize[_0xeb03('0x1')],'defaultValue':_0xeb03('0x2'),'unique':_0xeb03('0x3')},'mailbox':{'type':Sequelize[_0xeb03('0x1')],'defaultValue':'','allowNull':![],'unique':_0xeb03('0x3')},'password':{'type':Sequelize[_0xeb03('0x1')]},'fullname':{'type':Sequelize[_0xeb03('0x1')]},'email':{'type':Sequelize[_0xeb03('0x1')],'validate':{'isEmail':!![]},'set':function(_0x88925b){this[_0xeb03('0x4')]('email',typeof _0x88925b===_0xeb03('0x5')&&_0x88925b[_0xeb03('0x6')]()?_0x88925b[_0xeb03('0x6')]():null);}},'pager':{'type':Sequelize[_0xeb03('0x1')]},'tz':{'type':Sequelize[_0xeb03('0x1')],'defaultValue':_0xeb03('0x7')},'attach':{'type':Sequelize['ENUM'](_0xeb03('0x8'),'no'),'defaultValue':_0xeb03('0x8'),'allowNull':![]},'saycid':{'type':Sequelize[_0xeb03('0x9')]('yes','no'),'defaultValue':_0xeb03('0x8'),'allowNull':![]},'dialout':{'type':Sequelize['STRING']},'callback':{'type':Sequelize[_0xeb03('0x1')]},'review':{'type':Sequelize[_0xeb03('0x9')](_0xeb03('0x8'),'no'),'defaultValue':'no','allowNull':![]},'operator':{'type':Sequelize[_0xeb03('0x9')](_0xeb03('0x8'),'no'),'defaultValue':'no','allowNull':![]},'envelope':{'type':Sequelize[_0xeb03('0x9')](_0xeb03('0x8'),'no'),'defaultValue':'no','allowNull':![]},'sayduration':{'type':Sequelize[_0xeb03('0x9')](_0xeb03('0x8'),'no'),'defaultValue':'no','allowNull':![]},'saydurationm':{'type':_0xeb03('0xa'),'defaultValue':0x1,'allowNull':![]},'sendvoicemail':{'type':Sequelize[_0xeb03('0x9')](_0xeb03('0x8'),'no'),'defaultValue':'no','allowNull':![]},'delete':{'type':Sequelize['ENUM'](_0xeb03('0x8'),'no'),'defaultValue':'no','allowNull':![]},'nextaftercmd':{'type':Sequelize[_0xeb03('0x9')](_0xeb03('0x8'),'no'),'defaultValue':_0xeb03('0x8'),'allowNull':![]},'forcename':{'type':Sequelize['ENUM'](_0xeb03('0x8'),'no'),'defaultValue':'no','allowNull':![]},'forcegreetings':{'type':Sequelize[_0xeb03('0x9')](_0xeb03('0x8'),'no'),'defaultValue':'no','allowNull':![]},'hidefromdir':{'type':Sequelize['ENUM'](_0xeb03('0x8'),'no'),'defaultValue':_0xeb03('0x8'),'allowNull':![]},'stamp':{'type':_0xeb03('0xb')},'emailsubject':{'type':Sequelize[_0xeb03('0x1')]},'emailbody':{'type':Sequelize[_0xeb03('0x1')]},'maxsecs':{'type':Sequelize[_0xeb03('0xc')](0xff),'defaultValue':0xb4,'allowNull':![]},'maxmsg':{'type':Sequelize[_0xeb03('0xc')](0xff),'defaultValue':0x64,'allowNull':![]},'name':{'type':Sequelize[_0xeb03('0xd')],'get':function(){return this[_0xeb03('0xe')](_0xeb03('0xf'))+_0xeb03('0x10')+this[_0xeb03('0xe')](_0xeb03('0x11'));}}};
\ No newline at end of file
+var _0xd7d1=['\x20-\x20','getDataValue','mailbox','sequelize','exports','STRING','from-voicemail','contest_mailbox','setDataValue','string','trim','central','ENUM','yes','TINYINT(4)','TIMESTAMP','INTEGER','VIRTUAL'];(function(_0x2c1dcd,_0x350452){var _0x158ce5=function(_0x5c1c57){while(--_0x5c1c57){_0x2c1dcd['push'](_0x2c1dcd['shift']());}};_0x158ce5(++_0x350452);}(_0xd7d1,0x1b3));var _0x1d7d=function(_0x51aceb,_0x21fda6){_0x51aceb=_0x51aceb-0x0;var _0x42aac4=_0xd7d1[_0x51aceb];return _0x42aac4;};'use strict';var Sequelize=require(_0x1d7d('0x0'));module[_0x1d7d('0x1')]={'customer_id':{'type':Sequelize[_0x1d7d('0x2')]},'context':{'type':Sequelize[_0x1d7d('0x2')],'defaultValue':_0x1d7d('0x3'),'unique':_0x1d7d('0x4')},'mailbox':{'type':Sequelize[_0x1d7d('0x2')],'defaultValue':'','allowNull':![],'unique':_0x1d7d('0x4')},'password':{'type':Sequelize[_0x1d7d('0x2')]},'fullname':{'type':Sequelize[_0x1d7d('0x2')]},'email':{'type':Sequelize[_0x1d7d('0x2')],'validate':{'isEmail':!![]},'set':function(_0x1a2564){this[_0x1d7d('0x5')]('email',typeof _0x1a2564===_0x1d7d('0x6')&&_0x1a2564[_0x1d7d('0x7')]()?_0x1a2564[_0x1d7d('0x7')]():null);}},'pager':{'type':Sequelize[_0x1d7d('0x2')]},'tz':{'type':Sequelize[_0x1d7d('0x2')],'defaultValue':_0x1d7d('0x8')},'attach':{'type':Sequelize[_0x1d7d('0x9')](_0x1d7d('0xa'),'no'),'defaultValue':_0x1d7d('0xa'),'allowNull':![]},'saycid':{'type':Sequelize[_0x1d7d('0x9')](_0x1d7d('0xa'),'no'),'defaultValue':'yes','allowNull':![]},'dialout':{'type':Sequelize[_0x1d7d('0x2')]},'callback':{'type':Sequelize['STRING']},'review':{'type':Sequelize[_0x1d7d('0x9')](_0x1d7d('0xa'),'no'),'defaultValue':'no','allowNull':![]},'operator':{'type':Sequelize[_0x1d7d('0x9')](_0x1d7d('0xa'),'no'),'defaultValue':'no','allowNull':![]},'envelope':{'type':Sequelize['ENUM'](_0x1d7d('0xa'),'no'),'defaultValue':'no','allowNull':![]},'sayduration':{'type':Sequelize['ENUM']('yes','no'),'defaultValue':'no','allowNull':![]},'saydurationm':{'type':_0x1d7d('0xb'),'defaultValue':0x1,'allowNull':![]},'sendvoicemail':{'type':Sequelize[_0x1d7d('0x9')]('yes','no'),'defaultValue':'no','allowNull':![]},'delete':{'type':Sequelize['ENUM'](_0x1d7d('0xa'),'no'),'defaultValue':'no','allowNull':![]},'nextaftercmd':{'type':Sequelize[_0x1d7d('0x9')](_0x1d7d('0xa'),'no'),'defaultValue':_0x1d7d('0xa'),'allowNull':![]},'forcename':{'type':Sequelize[_0x1d7d('0x9')]('yes','no'),'defaultValue':'no','allowNull':![]},'forcegreetings':{'type':Sequelize[_0x1d7d('0x9')](_0x1d7d('0xa'),'no'),'defaultValue':'no','allowNull':![]},'hidefromdir':{'type':Sequelize['ENUM'](_0x1d7d('0xa'),'no'),'defaultValue':_0x1d7d('0xa'),'allowNull':![]},'stamp':{'type':_0x1d7d('0xc')},'emailsubject':{'type':Sequelize[_0x1d7d('0x2')]},'emailbody':{'type':Sequelize[_0x1d7d('0x2')]},'maxsecs':{'type':Sequelize['INTEGER'](0xff),'defaultValue':0xb4,'allowNull':![]},'maxmsg':{'type':Sequelize[_0x1d7d('0xd')](0xff),'defaultValue':0x64,'allowNull':![]},'name':{'type':Sequelize[_0x1d7d('0xe')],'get':function(){return this['getDataValue']('fullname')+_0x1d7d('0xf')+this[_0x1d7d('0x10')](_0x1d7d('0x11'));}}};
\ No newline at end of file
diff --git a/server/api/voiceMail/voiceMail.controller.js b/server/api/voiceMail/voiceMail.controller.js
index 8b8ba57..535818e 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 _0x00cd=['findAll','rows','catch','show','params','include','find','create','body','user','get','Unable\x20to\x20retrieve\x20the\x20current\x20user','role','userProfileId','autoAssociation','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','getMessages','findOne','order','pick','VoiceMailMessage','html-pdf','rimraf','zip-dir','fast-json-patch','moment','bluebird','mustache','path','sox','to-csv','ejs','squel','jsforce','desk.js','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','../../config/utils','../../config/environment','../../mysqldb','sendStatus','end','status','json','offset','set','Content-Range','apply','reject','save','update','then','destroy','Voicemails','UserProfileResource','error','name','send','index','map','VoiceMail','rawAttributes','type','key','query','keys','intersection','model','attributes','fields','length','hasOwnProperty','nolimit','limit','sort','where','filters','filter','merge','VIRTUAL','options','count','includeAll'];(function(_0x1261b6,_0x5b67df){var _0x1789e1=function(_0x526b1c){while(--_0x526b1c){_0x1261b6['push'](_0x1261b6['shift']());}};_0x1789e1(++_0x5b67df);}(_0x00cd,0x1cd));var _0xd00c=function(_0x374ada,_0x27b3a5){_0x374ada=_0x374ada-0x0;var _0x449ed8=_0x00cd[_0x374ada];return _0x449ed8;};'use strict';var pdf=require(_0xd00c('0x0'));var emlformat=require('eml-format');var rimraf=require(_0xd00c('0x1'));var zipdir=require(_0xd00c('0x2'));var jsonpatch=require(_0xd00c('0x3'));var rp=require('request-promise');var moment=require(_0xd00c('0x4'));var BPromise=require(_0xd00c('0x5'));var Mustache=require(_0xd00c('0x6'));var util=require('util');var path=require(_0xd00c('0x7'));var sox=require(_0xd00c('0x8'));var csv=require(_0xd00c('0x9'));var ejs=require(_0xd00c('0xa'));var fs=require('fs');var _=require('lodash');var squel=require(_0xd00c('0xb'));var crypto=require('crypto');var jsforce=require(_0xd00c('0xc'));var deskjs=require(_0xd00c('0xd'));var toCsv=require(_0xd00c('0x9'));var querystring=require(_0xd00c('0xe'));var Papa=require(_0xd00c('0xf'));var Redis=require(_0xd00c('0x10'));var authService=require(_0xd00c('0x11'));var qs=require('../../components/parsers/qs');var as=require(_0xd00c('0x12'));var hardwareService=require(_0xd00c('0x13'));var logger=require(_0xd00c('0x14'))('api');var utils=require(_0xd00c('0x15'));var config=require(_0xd00c('0x16'));var db=require(_0xd00c('0x17'))['db'];function respondWithStatusCode(_0x783b3f,_0x2348cc){_0x2348cc=_0x2348cc||0xcc;return function(_0x5837c3){if(_0x5837c3){return _0x783b3f[_0xd00c('0x18')](_0x2348cc);}return _0x783b3f['status'](_0x2348cc)[_0xd00c('0x19')]();};}function respondWithResult(_0x58f460,_0x1c0e08){_0x1c0e08=_0x1c0e08||0xc8;return function(_0xffc9b3){if(_0xffc9b3){return _0x58f460[_0xd00c('0x1a')](_0x1c0e08)[_0xd00c('0x1b')](_0xffc9b3);}};}function respondWithFilteredResult(_0x47daad,_0x6d8237){return function(_0x15d86f){if(_0x15d86f){var _0x3d7f47=_0x15d86f['count'],_0x3272c8=_0x6d8237['offset'],_0x5a01b7=_0x6d8237[_0xd00c('0x1c')]+_0x6d8237['limit'],_0x393431;if(_0x5a01b7>=_0x3d7f47){_0x5a01b7=_0x3d7f47;_0x393431=0xc8;}else{_0x393431=0xce;}_0x47daad[_0xd00c('0x1a')](_0x393431);return _0x47daad[_0xd00c('0x1d')](_0xd00c('0x1e'),_0x3272c8+'-'+_0x5a01b7+'/'+_0x3d7f47)[_0xd00c('0x1b')](_0x15d86f);}return null;};}function patchUpdates(_0xd6b048){return function(_0x5af265){try{jsonpatch[_0xd00c('0x1f')](_0x5af265,_0xd6b048,!![]);}catch(_0x54e9c5){return BPromise[_0xd00c('0x20')](_0x54e9c5);}return _0x5af265[_0xd00c('0x21')]();};}function saveUpdates(_0x3adb19,_0x4c76d9){return function(_0x2117ea){if(_0x2117ea){return _0x2117ea[_0xd00c('0x22')](_0x3adb19)[_0xd00c('0x23')](function(_0x109292){return _0x109292;});}return null;};}function removeEntity(_0x361d21,_0x4f55f9){return function(_0x2ac402){if(_0x2ac402){return _0x2ac402[_0xd00c('0x24')]()['then'](function(){var _0x49b9ab=_0x2ac402['get']({'plain':!![]});var _0x36311e=_0xd00c('0x25');return db[_0xd00c('0x26')][_0xd00c('0x24')]({'where':{'type':_0x36311e,'resourceId':_0x49b9ab['id']}})[_0xd00c('0x23')](function(){return _0x2ac402;});})[_0xd00c('0x23')](function(){_0x361d21[_0xd00c('0x1a')](0xcc)['end']();});}};}function handleEntityNotFound(_0xaeea84,_0x553ed6){return function(_0x5d0581){if(!_0x5d0581){_0xaeea84[_0xd00c('0x18')](0x194);}return _0x5d0581;};}function handleError(_0x54dcb2,_0x51781a){_0x51781a=_0x51781a||0x1f4;return function(_0x316340){logger[_0xd00c('0x27')](_0x316340['stack']);if(_0x316340[_0xd00c('0x28')]){delete _0x316340[_0xd00c('0x28')];}_0x54dcb2['status'](_0x51781a)[_0xd00c('0x29')](_0x316340);};}exports[_0xd00c('0x2a')]=function(_0x17c33b,_0x31d074){var _0x1be742={},_0x3d2249={},_0x1a891f={'count':0x0,'rows':[]};var _0x17805c=_[_0xd00c('0x2b')](db[_0xd00c('0x2c')][_0xd00c('0x2d')],function(_0x547983){return{'name':_0x547983['fieldName'],'type':_0x547983[_0xd00c('0x2e')][_0xd00c('0x2f')]};});_0x3d2249['model']=_[_0xd00c('0x2b')](_0x17805c,_0xd00c('0x28'));_0x3d2249[_0xd00c('0x30')]=_[_0xd00c('0x31')](_0x17c33b['query']);_0x3d2249['filters']=_[_0xd00c('0x32')](_0x3d2249[_0xd00c('0x33')],_0x3d2249[_0xd00c('0x30')]);_0x1be742[_0xd00c('0x34')]=_[_0xd00c('0x32')](_0x3d2249['model'],qs[_0xd00c('0x35')](_0x17c33b['query'][_0xd00c('0x35')]));_0x1be742[_0xd00c('0x34')]=_0x1be742[_0xd00c('0x34')][_0xd00c('0x36')]?_0x1be742[_0xd00c('0x34')]:_0x3d2249['model'];if(!_0x17c33b[_0xd00c('0x30')][_0xd00c('0x37')](_0xd00c('0x38'))){_0x1be742[_0xd00c('0x39')]=qs['limit'](_0x17c33b[_0xd00c('0x30')][_0xd00c('0x39')]);_0x1be742[_0xd00c('0x1c')]=qs[_0xd00c('0x1c')](_0x17c33b[_0xd00c('0x30')]['offset']);}_0x1be742['order']=qs['sort'](_0x17c33b['query'][_0xd00c('0x3a')]);_0x1be742[_0xd00c('0x3b')]=qs[_0xd00c('0x3c')](_['pick'](_0x17c33b[_0xd00c('0x30')],_0x3d2249[_0xd00c('0x3c')]));if(_0x17c33b[_0xd00c('0x30')][_0xd00c('0x3d')]){_0x1be742[_0xd00c('0x3b')]=_[_0xd00c('0x3e')](_0x1be742[_0xd00c('0x3b')],{'$or':_['map'](_0x17805c,function(_0x45b0d4){if(_0x45b0d4[_0xd00c('0x2e')]!==_0xd00c('0x3f')){var _0x50c027={};_0x50c027[_0x45b0d4[_0xd00c('0x28')]]={'$like':'%'+_0x17c33b[_0xd00c('0x30')][_0xd00c('0x3d')]+'%'};return _0x50c027;}})});}_0x1be742=_[_0xd00c('0x3e')]({},_0x1be742,_0x17c33b[_0xd00c('0x40')]);var _0x2f6fbd={'where':_0x1be742[_0xd00c('0x3b')]};return db[_0xd00c('0x2c')]['count'](_0x2f6fbd)[_0xd00c('0x23')](function(_0x233eab){_0x1a891f[_0xd00c('0x41')]=_0x233eab;if(_0x17c33b[_0xd00c('0x30')][_0xd00c('0x42')]){_0x1be742['include']=[{'all':!![]}];}return db[_0xd00c('0x2c')][_0xd00c('0x43')](_0x1be742);})[_0xd00c('0x23')](function(_0x4d35cc){_0x1a891f[_0xd00c('0x44')]=_0x4d35cc;return _0x1a891f;})[_0xd00c('0x23')](respondWithFilteredResult(_0x31d074,_0x1be742))[_0xd00c('0x45')](handleError(_0x31d074,null));};exports[_0xd00c('0x46')]=function(_0x382616,_0x97f795){var _0x49ffc6={'raw':!![],'where':{'id':_0x382616[_0xd00c('0x47')]['id']}},_0x3f2a93={};_0x3f2a93[_0xd00c('0x33')]=_[_0xd00c('0x31')](db[_0xd00c('0x2c')][_0xd00c('0x2d')]);_0x3f2a93[_0xd00c('0x30')]=_[_0xd00c('0x31')](_0x382616[_0xd00c('0x30')]);_0x3f2a93['filters']=_[_0xd00c('0x32')](_0x3f2a93['model'],_0x3f2a93[_0xd00c('0x30')]);_0x49ffc6['attributes']=_['intersection'](_0x3f2a93[_0xd00c('0x33')],qs[_0xd00c('0x35')](_0x382616[_0xd00c('0x30')][_0xd00c('0x35')]));_0x49ffc6[_0xd00c('0x34')]=_0x49ffc6[_0xd00c('0x34')][_0xd00c('0x36')]?_0x49ffc6[_0xd00c('0x34')]:_0x3f2a93[_0xd00c('0x33')];if(_0x382616[_0xd00c('0x30')][_0xd00c('0x42')]){_0x49ffc6[_0xd00c('0x48')]=[{'all':!![]}];}_0x49ffc6=_['merge']({},_0x49ffc6,_0x382616['options']);return db[_0xd00c('0x2c')][_0xd00c('0x49')](_0x49ffc6)[_0xd00c('0x23')](handleEntityNotFound(_0x97f795,null))[_0xd00c('0x23')](respondWithResult(_0x97f795,null))[_0xd00c('0x45')](handleError(_0x97f795,null));};exports['create']=function(_0x4de5e0,_0x3c4c1f){return db[_0xd00c('0x2c')][_0xd00c('0x4a')](_0x4de5e0[_0xd00c('0x4b')],{})[_0xd00c('0x23')](function(_0x8b8de0){var _0x402c09=_0x4de5e0[_0xd00c('0x4c')][_0xd00c('0x4d')]({'plain':!![]});if(!_0x402c09)throw new Error(_0xd00c('0x4e'));if(_0x402c09[_0xd00c('0x4f')]==='user'){var _0x209a8f=_0x8b8de0[_0xd00c('0x4d')]({'plain':!![]});var _0xfdbf6b='Voicemails';return db['UserProfileSection']['find']({'where':{'name':_0xfdbf6b,'userProfileId':_0x402c09[_0xd00c('0x50')]},'raw':!![]})['then'](function(_0x3e137b){if(_0x3e137b&&_0x3e137b[_0xd00c('0x51')]===0x0){return db[_0xd00c('0x26')][_0xd00c('0x4a')]({'name':_0x209a8f[_0xd00c('0x28')],'resourceId':_0x209a8f['id'],'type':_0x3e137b[_0xd00c('0x28')],'sectionId':_0x3e137b['id']},{})[_0xd00c('0x23')](function(){return _0x8b8de0;});}else{return _0x8b8de0;}})[_0xd00c('0x45')](function(_0x215614){logger[_0xd00c('0x27')](_0xd00c('0x52'),_0x215614);throw _0x215614;});}return _0x8b8de0;})[_0xd00c('0x23')](respondWithResult(_0x3c4c1f,0xc9))[_0xd00c('0x45')](handleError(_0x3c4c1f,null));};exports[_0xd00c('0x22')]=function(_0x43deb4,_0x1e5b13){if(_0x43deb4[_0xd00c('0x4b')]['id']){delete _0x43deb4[_0xd00c('0x4b')]['id'];}return db[_0xd00c('0x2c')]['find']({'where':{'id':_0x43deb4[_0xd00c('0x47')]['id']}})['then'](handleEntityNotFound(_0x1e5b13,null))['then'](saveUpdates(_0x43deb4[_0xd00c('0x4b')],null))['then'](respondWithResult(_0x1e5b13,null))['catch'](handleError(_0x1e5b13,null));};exports[_0xd00c('0x24')]=function(_0x588413,_0x60bc77){return db[_0xd00c('0x2c')][_0xd00c('0x49')]({'where':{'id':_0x588413[_0xd00c('0x47')]['id']}})['then'](handleEntityNotFound(_0x60bc77,null))[_0xd00c('0x23')](removeEntity(_0x60bc77,null))[_0xd00c('0x45')](handleError(_0x60bc77,null));};exports[_0xd00c('0x53')]=function(_0x1d7c79,_0x2d1c6d,_0x46d251){return db[_0xd00c('0x2c')][_0xd00c('0x54')]({'where':{'id':_0x1d7c79[_0xd00c('0x47')]['id']}})[_0xd00c('0x23')](handleEntityNotFound(_0x2d1c6d,null))['then'](function(_0x124093){var _0x750846;var _0x4668c6={},_0x330a9a={};_0x330a9a[_0xd00c('0x33')]=_[_0xd00c('0x31')](db['VoiceMailMessage'][_0xd00c('0x2d')]);_0x330a9a[_0xd00c('0x30')]=_[_0xd00c('0x31')](_0x1d7c79[_0xd00c('0x30')]);_0x330a9a[_0xd00c('0x3c')]=_['intersection'](_0x330a9a[_0xd00c('0x33')],_0x330a9a['query']);_0x4668c6[_0xd00c('0x34')]=_[_0xd00c('0x32')](_0x330a9a[_0xd00c('0x33')],qs[_0xd00c('0x35')](_0x1d7c79[_0xd00c('0x30')][_0xd00c('0x35')]));_0x4668c6['attributes']=_0x4668c6[_0xd00c('0x34')][_0xd00c('0x36')]?_0x4668c6[_0xd00c('0x34')]:_0x330a9a[_0xd00c('0x33')];if(!_0x1d7c79[_0xd00c('0x30')][_0xd00c('0x37')](_0xd00c('0x38'))){_0x4668c6[_0xd00c('0x39')]=qs[_0xd00c('0x39')](_0x1d7c79[_0xd00c('0x30')][_0xd00c('0x39')]);_0x4668c6[_0xd00c('0x1c')]=qs[_0xd00c('0x1c')](_0x1d7c79['query'][_0xd00c('0x1c')]);}_0x4668c6[_0xd00c('0x55')]=qs[_0xd00c('0x3a')](_0x1d7c79[_0xd00c('0x30')]['sort']);_0x4668c6[_0xd00c('0x3b')]=qs['filters'](_[_0xd00c('0x56')](_0x1d7c79['query'],_0x330a9a[_0xd00c('0x3c')]));if(_0x1d7c79[_0xd00c('0x30')]['filter']){_0x4668c6[_0xd00c('0x3b')]=_[_0xd00c('0x3e')](_0x4668c6['where'],{'$or':_[_0xd00c('0x2b')](_0x4668c6[_0xd00c('0x34')],function(_0x293b3b){var _0x2d6169={};_0x2d6169[_0x293b3b]={'$like':'%'+_0x1d7c79[_0xd00c('0x30')][_0xd00c('0x3d')]+'%'};return _0x2d6169;})});}_0x4668c6[_0xd00c('0x3b')]=_['merge'](_0x4668c6['where'],{'mailboxuser':_0x124093['mailbox']});_0x4668c6=_[_0xd00c('0x3e')]({},_0x4668c6,_0x1d7c79[_0xd00c('0x40')]);return db[_0xd00c('0x57')]['findAndCountAll'](_0x4668c6)[_0xd00c('0x23')](respondWithFilteredResult(_0x2d1c6d,_0x4668c6));})['catch'](handleError(_0x2d1c6d,null));};
\ No newline at end of file
+var _0x193f=['../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','api','../../config/utils','../../config/environment','../../mysqldb','sendStatus','status','json','count','offset','limit','apply','reject','save','update','then','destroy','get','Voicemails','UserProfileResource','end','error','stack','name','send','index','map','VoiceMail','rawAttributes','fieldName','key','model','query','filters','intersection','attributes','fields','length','hasOwnProperty','order','sort','where','pick','merge','VIRTUAL','filter','options','includeAll','include','rows','catch','show','params','keys','find','create','Unable\x20to\x20retrieve\x20the\x20current\x20user','role','user','UserProfileSection','userProfileId','autoAssociation','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','body','VoiceMailMessage','nolimit','mailbox','findAndCountAll','html-pdf','eml-format','rimraf','zip-dir','request-promise','moment','bluebird','path','sox','to-csv','ejs','lodash','squel','crypto','jsforce','querystring','ioredis'];(function(_0xa464c9,_0x7c86d8){var _0x3d73c4=function(_0x5c2056){while(--_0x5c2056){_0xa464c9['push'](_0xa464c9['shift']());}};_0x3d73c4(++_0x7c86d8);}(_0x193f,0x9f));var _0xf193=function(_0x49052b,_0x3ba709){_0x49052b=_0x49052b-0x0;var _0x48c045=_0x193f[_0x49052b];return _0x48c045;};'use strict';var pdf=require(_0xf193('0x0'));var emlformat=require(_0xf193('0x1'));var rimraf=require(_0xf193('0x2'));var zipdir=require(_0xf193('0x3'));var jsonpatch=require('fast-json-patch');var rp=require(_0xf193('0x4'));var moment=require(_0xf193('0x5'));var BPromise=require(_0xf193('0x6'));var Mustache=require('mustache');var util=require('util');var path=require(_0xf193('0x7'));var sox=require(_0xf193('0x8'));var csv=require(_0xf193('0x9'));var ejs=require(_0xf193('0xa'));var fs=require('fs');var _=require(_0xf193('0xb'));var squel=require(_0xf193('0xc'));var crypto=require(_0xf193('0xd'));var jsforce=require(_0xf193('0xe'));var deskjs=require('desk.js');var toCsv=require(_0xf193('0x9'));var querystring=require(_0xf193('0xf'));var Papa=require('papaparse');var Redis=require(_0xf193('0x10'));var authService=require(_0xf193('0x11'));var qs=require(_0xf193('0x12'));var as=require(_0xf193('0x13'));var hardwareService=require(_0xf193('0x14'));var logger=require('../../config/logger')(_0xf193('0x15'));var utils=require(_0xf193('0x16'));var config=require(_0xf193('0x17'));var db=require(_0xf193('0x18'))['db'];function respondWithStatusCode(_0x115b07,_0x597513){_0x597513=_0x597513||0xcc;return function(_0x88205a){if(_0x88205a){return _0x115b07[_0xf193('0x19')](_0x597513);}return _0x115b07[_0xf193('0x1a')](_0x597513)['end']();};}function respondWithResult(_0x2a9398,_0x2ef0d9){_0x2ef0d9=_0x2ef0d9||0xc8;return function(_0x40a581){if(_0x40a581){return _0x2a9398[_0xf193('0x1a')](_0x2ef0d9)[_0xf193('0x1b')](_0x40a581);}};}function respondWithFilteredResult(_0x230a6a,_0x4b8226){return function(_0x296d6e){if(_0x296d6e){var _0x27d488=_0x296d6e[_0xf193('0x1c')],_0x3cdfa9=_0x4b8226[_0xf193('0x1d')],_0x15148f=_0x4b8226['offset']+_0x4b8226[_0xf193('0x1e')],_0x2ae0b7;if(_0x15148f>=_0x27d488){_0x15148f=_0x27d488;_0x2ae0b7=0xc8;}else{_0x2ae0b7=0xce;}_0x230a6a['status'](_0x2ae0b7);return _0x230a6a['set']('Content-Range',_0x3cdfa9+'-'+_0x15148f+'/'+_0x27d488)[_0xf193('0x1b')](_0x296d6e);}return null;};}function patchUpdates(_0x106094){return function(_0x2a09b7){try{jsonpatch[_0xf193('0x1f')](_0x2a09b7,_0x106094,!![]);}catch(_0x27a8c9){return BPromise[_0xf193('0x20')](_0x27a8c9);}return _0x2a09b7[_0xf193('0x21')]();};}function saveUpdates(_0x2be34b,_0x5167cc){return function(_0x2b1fdd){if(_0x2b1fdd){return _0x2b1fdd[_0xf193('0x22')](_0x2be34b)[_0xf193('0x23')](function(_0x3ac69d){return _0x3ac69d;});}return null;};}function removeEntity(_0x9e6979,_0x544111){return function(_0x40baa8){if(_0x40baa8){return _0x40baa8[_0xf193('0x24')]()[_0xf193('0x23')](function(){var _0x3d4404=_0x40baa8[_0xf193('0x25')]({'plain':!![]});var _0x79e4d2=_0xf193('0x26');return db[_0xf193('0x27')][_0xf193('0x24')]({'where':{'type':_0x79e4d2,'resourceId':_0x3d4404['id']}})['then'](function(){return _0x40baa8;});})[_0xf193('0x23')](function(){_0x9e6979[_0xf193('0x1a')](0xcc)[_0xf193('0x28')]();});}};}function handleEntityNotFound(_0x2d3c1d,_0x42f7c2){return function(_0x2aa2ba){if(!_0x2aa2ba){_0x2d3c1d[_0xf193('0x19')](0x194);}return _0x2aa2ba;};}function handleError(_0x195ee1,_0x212582){_0x212582=_0x212582||0x1f4;return function(_0x3c5d39){logger[_0xf193('0x29')](_0x3c5d39[_0xf193('0x2a')]);if(_0x3c5d39[_0xf193('0x2b')]){delete _0x3c5d39[_0xf193('0x2b')];}_0x195ee1[_0xf193('0x1a')](_0x212582)[_0xf193('0x2c')](_0x3c5d39);};}exports[_0xf193('0x2d')]=function(_0x1a85f3,_0x505ce5){var _0x187254={},_0x4cef97={},_0x29c826={'count':0x0,'rows':[]};var _0x35fc96=_[_0xf193('0x2e')](db[_0xf193('0x2f')][_0xf193('0x30')],function(_0x3749ae){return{'name':_0x3749ae[_0xf193('0x31')],'type':_0x3749ae['type'][_0xf193('0x32')]};});_0x4cef97[_0xf193('0x33')]=_[_0xf193('0x2e')](_0x35fc96,'name');_0x4cef97[_0xf193('0x34')]=_['keys'](_0x1a85f3[_0xf193('0x34')]);_0x4cef97[_0xf193('0x35')]=_[_0xf193('0x36')](_0x4cef97['model'],_0x4cef97[_0xf193('0x34')]);_0x187254[_0xf193('0x37')]=_[_0xf193('0x36')](_0x4cef97[_0xf193('0x33')],qs[_0xf193('0x38')](_0x1a85f3['query'][_0xf193('0x38')]));_0x187254[_0xf193('0x37')]=_0x187254[_0xf193('0x37')][_0xf193('0x39')]?_0x187254['attributes']:_0x4cef97['model'];if(!_0x1a85f3[_0xf193('0x34')][_0xf193('0x3a')]('nolimit')){_0x187254[_0xf193('0x1e')]=qs[_0xf193('0x1e')](_0x1a85f3['query']['limit']);_0x187254[_0xf193('0x1d')]=qs[_0xf193('0x1d')](_0x1a85f3[_0xf193('0x34')][_0xf193('0x1d')]);}_0x187254[_0xf193('0x3b')]=qs[_0xf193('0x3c')](_0x1a85f3[_0xf193('0x34')][_0xf193('0x3c')]);_0x187254[_0xf193('0x3d')]=qs[_0xf193('0x35')](_[_0xf193('0x3e')](_0x1a85f3[_0xf193('0x34')],_0x4cef97['filters']));if(_0x1a85f3[_0xf193('0x34')]['filter']){_0x187254[_0xf193('0x3d')]=_[_0xf193('0x3f')](_0x187254['where'],{'$or':_[_0xf193('0x2e')](_0x35fc96,function(_0x4d955a){if(_0x4d955a['type']!==_0xf193('0x40')){var _0x89cc51={};_0x89cc51[_0x4d955a[_0xf193('0x2b')]]={'$like':'%'+_0x1a85f3[_0xf193('0x34')][_0xf193('0x41')]+'%'};return _0x89cc51;}})});}_0x187254=_[_0xf193('0x3f')]({},_0x187254,_0x1a85f3[_0xf193('0x42')]);var _0x59c10a={'where':_0x187254[_0xf193('0x3d')]};return db[_0xf193('0x2f')][_0xf193('0x1c')](_0x59c10a)[_0xf193('0x23')](function(_0x53f4d5){_0x29c826[_0xf193('0x1c')]=_0x53f4d5;if(_0x1a85f3[_0xf193('0x34')][_0xf193('0x43')]){_0x187254[_0xf193('0x44')]=[{'all':!![]}];}return db[_0xf193('0x2f')]['findAll'](_0x187254);})[_0xf193('0x23')](function(_0x3b5057){_0x29c826[_0xf193('0x45')]=_0x3b5057;return _0x29c826;})[_0xf193('0x23')](respondWithFilteredResult(_0x505ce5,_0x187254))[_0xf193('0x46')](handleError(_0x505ce5,null));};exports[_0xf193('0x47')]=function(_0x179ab1,_0x2b173b){var _0xa79f6b={'raw':!![],'where':{'id':_0x179ab1[_0xf193('0x48')]['id']}},_0x37418f={};_0x37418f[_0xf193('0x33')]=_[_0xf193('0x49')](db[_0xf193('0x2f')][_0xf193('0x30')]);_0x37418f[_0xf193('0x34')]=_[_0xf193('0x49')](_0x179ab1[_0xf193('0x34')]);_0x37418f[_0xf193('0x35')]=_[_0xf193('0x36')](_0x37418f[_0xf193('0x33')],_0x37418f['query']);_0xa79f6b[_0xf193('0x37')]=_['intersection'](_0x37418f[_0xf193('0x33')],qs[_0xf193('0x38')](_0x179ab1[_0xf193('0x34')][_0xf193('0x38')]));_0xa79f6b['attributes']=_0xa79f6b[_0xf193('0x37')][_0xf193('0x39')]?_0xa79f6b[_0xf193('0x37')]:_0x37418f[_0xf193('0x33')];if(_0x179ab1[_0xf193('0x34')][_0xf193('0x43')]){_0xa79f6b['include']=[{'all':!![]}];}_0xa79f6b=_[_0xf193('0x3f')]({},_0xa79f6b,_0x179ab1[_0xf193('0x42')]);return db[_0xf193('0x2f')][_0xf193('0x4a')](_0xa79f6b)[_0xf193('0x23')](handleEntityNotFound(_0x2b173b,null))['then'](respondWithResult(_0x2b173b,null))['catch'](handleError(_0x2b173b,null));};exports['create']=function(_0x5861fd,_0x43cce2){return db[_0xf193('0x2f')][_0xf193('0x4b')](_0x5861fd['body'],{})[_0xf193('0x23')](function(_0x2eed7f){var _0x4f95e4=_0x5861fd['user']['get']({'plain':!![]});if(!_0x4f95e4)throw new Error(_0xf193('0x4c'));if(_0x4f95e4[_0xf193('0x4d')]===_0xf193('0x4e')){var _0x151fcf=_0x2eed7f[_0xf193('0x25')]({'plain':!![]});var _0x35f19e='Voicemails';return db[_0xf193('0x4f')][_0xf193('0x4a')]({'where':{'name':_0x35f19e,'userProfileId':_0x4f95e4[_0xf193('0x50')]},'raw':!![]})[_0xf193('0x23')](function(_0x8908dd){if(_0x8908dd&&_0x8908dd[_0xf193('0x51')]===0x0){return db[_0xf193('0x27')][_0xf193('0x4b')]({'name':_0x151fcf[_0xf193('0x2b')],'resourceId':_0x151fcf['id'],'type':_0x8908dd[_0xf193('0x2b')],'sectionId':_0x8908dd['id']},{})[_0xf193('0x23')](function(){return _0x2eed7f;});}else{return _0x2eed7f;}})[_0xf193('0x46')](function(_0xf484df){logger[_0xf193('0x29')](_0xf193('0x52'),_0xf484df);throw _0xf484df;});}return _0x2eed7f;})[_0xf193('0x23')](respondWithResult(_0x43cce2,0xc9))[_0xf193('0x46')](handleError(_0x43cce2,null));};exports['update']=function(_0x39e912,_0x122ae9){if(_0x39e912['body']['id']){delete _0x39e912[_0xf193('0x53')]['id'];}return db['VoiceMail'][_0xf193('0x4a')]({'where':{'id':_0x39e912[_0xf193('0x48')]['id']}})[_0xf193('0x23')](handleEntityNotFound(_0x122ae9,null))[_0xf193('0x23')](saveUpdates(_0x39e912[_0xf193('0x53')],null))[_0xf193('0x23')](respondWithResult(_0x122ae9,null))['catch'](handleError(_0x122ae9,null));};exports[_0xf193('0x24')]=function(_0x4c03c4,_0x576e40){return db['VoiceMail'][_0xf193('0x4a')]({'where':{'id':_0x4c03c4['params']['id']}})[_0xf193('0x23')](handleEntityNotFound(_0x576e40,null))[_0xf193('0x23')](removeEntity(_0x576e40,null))[_0xf193('0x46')](handleError(_0x576e40,null));};exports['getMessages']=function(_0x4fafb8,_0x346465,_0x108046){return db[_0xf193('0x2f')]['findOne']({'where':{'id':_0x4fafb8['params']['id']}})['then'](handleEntityNotFound(_0x346465,null))[_0xf193('0x23')](function(_0x125e93){var _0x223c5f;var _0x46ccab={},_0x1c52d3={};_0x1c52d3[_0xf193('0x33')]=_[_0xf193('0x49')](db[_0xf193('0x54')][_0xf193('0x30')]);_0x1c52d3['query']=_[_0xf193('0x49')](_0x4fafb8[_0xf193('0x34')]);_0x1c52d3[_0xf193('0x35')]=_['intersection'](_0x1c52d3[_0xf193('0x33')],_0x1c52d3['query']);_0x46ccab[_0xf193('0x37')]=_['intersection'](_0x1c52d3[_0xf193('0x33')],qs[_0xf193('0x38')](_0x4fafb8['query'][_0xf193('0x38')]));_0x46ccab[_0xf193('0x37')]=_0x46ccab[_0xf193('0x37')][_0xf193('0x39')]?_0x46ccab['attributes']:_0x1c52d3['model'];if(!_0x4fafb8[_0xf193('0x34')][_0xf193('0x3a')](_0xf193('0x55'))){_0x46ccab['limit']=qs[_0xf193('0x1e')](_0x4fafb8[_0xf193('0x34')]['limit']);_0x46ccab[_0xf193('0x1d')]=qs[_0xf193('0x1d')](_0x4fafb8[_0xf193('0x34')][_0xf193('0x1d')]);}_0x46ccab[_0xf193('0x3b')]=qs[_0xf193('0x3c')](_0x4fafb8['query'][_0xf193('0x3c')]);_0x46ccab[_0xf193('0x3d')]=qs[_0xf193('0x35')](_[_0xf193('0x3e')](_0x4fafb8[_0xf193('0x34')],_0x1c52d3['filters']));if(_0x4fafb8['query'][_0xf193('0x41')]){_0x46ccab[_0xf193('0x3d')]=_[_0xf193('0x3f')](_0x46ccab['where'],{'$or':_[_0xf193('0x2e')](_0x46ccab[_0xf193('0x37')],function(_0x1fc326){var _0x175ad0={};_0x175ad0[_0x1fc326]={'$like':'%'+_0x4fafb8['query'][_0xf193('0x41')]+'%'};return _0x175ad0;})});}_0x46ccab[_0xf193('0x3d')]=_['merge'](_0x46ccab[_0xf193('0x3d')],{'mailboxuser':_0x125e93[_0xf193('0x56')]});_0x46ccab=_[_0xf193('0x3f')]({},_0x46ccab,_0x4fafb8[_0xf193('0x42')]);return db[_0xf193('0x54')][_0xf193('0x57')](_0x46ccab)[_0xf193('0x23')](respondWithFilteredResult(_0x346465,_0x46ccab));})[_0xf193('0x46')](handleError(_0x346465,null));};
\ No newline at end of file
diff --git a/server/api/voiceMail/voiceMail.model.js b/server/api/voiceMail/voiceMail.model.js
index 1cddf53..e8b9d1b 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 _0x7d29=['moment','bluebird','rimraf','../../config/environment','./voiceMail.attributes','exports','define','VoiceMail','voice_voicemail','mailbox','context','lodash','util','../../config/logger','api'];(function(_0x21d36e,_0x5dc096){var _0x4cc307=function(_0x4ae995){while(--_0x4ae995){_0x21d36e['push'](_0x21d36e['shift']());}};_0x4cc307(++_0x5dc096);}(_0x7d29,0x1a0));var _0x97d2=function(_0x502c7d,_0x2f1285){_0x502c7d=_0x502c7d-0x0;var _0x30b7ed=_0x7d29[_0x502c7d];return _0x30b7ed;};'use strict';var _=require(_0x97d2('0x0'));var util=require(_0x97d2('0x1'));var logger=require(_0x97d2('0x2'))(_0x97d2('0x3'));var moment=require(_0x97d2('0x4'));var BPromise=require(_0x97d2('0x5'));var rp=require('request-promise');var fs=require('fs');var path=require('path');var rimraf=require(_0x97d2('0x6'));var config=require(_0x97d2('0x7'));var attributes=require(_0x97d2('0x8'));module[_0x97d2('0x9')]=function(_0x2d57aa,_0x19f93d){return _0x2d57aa[_0x97d2('0xa')](_0x97d2('0xb'),attributes,{'tableName':_0x97d2('0xc'),'paranoid':![],'indexes':[{'name':'mailbox_context','fields':[_0x97d2('0xd'),_0x97d2('0xe')]}],'timestamps':!![]});};
\ No newline at end of file
+var _0x03fa=['VoiceMail','mailbox_context','mailbox','context','lodash','api','moment','bluebird','request-promise','rimraf','define'];(function(_0x3c97e3,_0x321677){var _0x9bb0ed=function(_0x3a0cb6){while(--_0x3a0cb6){_0x3c97e3['push'](_0x3c97e3['shift']());}};_0x9bb0ed(++_0x321677);}(_0x03fa,0x117));var _0xa03f=function(_0x3a7fea,_0x23ace8){_0x3a7fea=_0x3a7fea-0x0;var _0x473d0c=_0x03fa[_0x3a7fea];return _0x473d0c;};'use strict';var _=require(_0xa03f('0x0'));var util=require('util');var logger=require('../../config/logger')(_0xa03f('0x1'));var moment=require(_0xa03f('0x2'));var BPromise=require(_0xa03f('0x3'));var rp=require(_0xa03f('0x4'));var fs=require('fs');var path=require('path');var rimraf=require(_0xa03f('0x5'));var config=require('../../config/environment');var attributes=require('./voiceMail.attributes');module['exports']=function(_0x40108a,_0x1bb9e6){return _0x40108a[_0xa03f('0x6')](_0xa03f('0x7'),attributes,{'tableName':'voice_voicemail','paranoid':![],'indexes':[{'name':_0xa03f('0x8'),'fields':[_0xa03f('0x9'),_0xa03f('0xa')]}],'timestamps':!![]});};
\ No newline at end of file
diff --git a/server/api/voiceMail/voiceMail.rpc.js b/server/api/voiceMail/voiceMail.rpc.js
index ba29897..55d3b6b 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 _0x75a8=['../../config/logger','rpc','../../config/environment','jayson/promise','http','then','info','request\x20sent','debug','stringify','error','code','VoiceMail,\x20%s,\x20%s','message','catch','lodash','util','moment','bluebird','randomstring','ioredis','../../mysqldb'];(function(_0x20eba8,_0x23768a){var _0xc119a9=function(_0x51ee8e){while(--_0x51ee8e){_0x20eba8['push'](_0x20eba8['shift']());}};_0xc119a9(++_0x23768a);}(_0x75a8,0x159));var _0x875a=function(_0x404b74,_0x3f5e75){_0x404b74=_0x404b74-0x0;var _0xd076a4=_0x75a8[_0x404b74];return _0xd076a4;};'use strict';var _=require(_0x875a('0x0'));var util=require(_0x875a('0x1'));var moment=require(_0x875a('0x2'));var BPromise=require(_0x875a('0x3'));var rs=require(_0x875a('0x4'));var fs=require('fs');var Redis=require(_0x875a('0x5'));var db=require(_0x875a('0x6'))['db'];var utils=require('../../config/utils');var logger=require(_0x875a('0x7'))(_0x875a('0x8'));var config=require(_0x875a('0x9'));var jayson=require(_0x875a('0xa'));var client=jayson['client'][_0x875a('0xb')]({'port':0x232a});function respondWithRpcPromise(_0x3a23d6,_0x19d171,_0xe0c5fc){return new BPromise(function(_0xdf8200,_0x433476){return client['request'](_0x3a23d6,_0xe0c5fc)[_0x875a('0xc')](function(_0x56fe14){logger[_0x875a('0xd')]('VoiceMail,\x20%s,\x20%s',_0x19d171,_0x875a('0xe'));logger[_0x875a('0xf')]('VoiceMail,\x20%s,\x20%s,\x20%s',_0x19d171,_0x875a('0xe'),JSON[_0x875a('0x10')](_0x56fe14));if(_0x56fe14[_0x875a('0x11')]){if(_0x56fe14[_0x875a('0x11')][_0x875a('0x12')]===0x1f4){logger[_0x875a('0x11')](_0x875a('0x13'),_0x19d171,_0x56fe14[_0x875a('0x11')][_0x875a('0x14')]);return _0x433476(_0x56fe14[_0x875a('0x11')]['message']);}logger[_0x875a('0x11')](_0x875a('0x13'),_0x19d171,_0x56fe14['error'][_0x875a('0x14')]);return _0xdf8200(_0x56fe14[_0x875a('0x11')]['message']);}else{logger['info'](_0x875a('0x13'),_0x19d171,_0x875a('0xe'));_0xdf8200(_0x56fe14['result']['message']);}})[_0x875a('0x15')](function(_0x34e310){logger[_0x875a('0x11')]('VoiceMail,\x20%s,\x20%s',_0x19d171,_0x34e310);_0x433476(_0x34e310);});});}
\ No newline at end of file
+var _0x69af=['stringify','error','message','result','catch','lodash','util','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','client','then','info','VoiceMail,\x20%s,\x20%s','debug','request\x20sent'];(function(_0x3744b3,_0x4a3423){var _0x4ed7b4=function(_0x343e9a){while(--_0x343e9a){_0x3744b3['push'](_0x3744b3['shift']());}};_0x4ed7b4(++_0x4a3423);}(_0x69af,0x102));var _0xf69a=function(_0x5289d2,_0x4e0154){_0x5289d2=_0x5289d2-0x0;var _0x31ace6=_0x69af[_0x5289d2];return _0x31ace6;};'use strict';var _=require(_0xf69a('0x0'));var util=require(_0xf69a('0x1'));var moment=require(_0xf69a('0x2'));var BPromise=require(_0xf69a('0x3'));var rs=require(_0xf69a('0x4'));var fs=require('fs');var Redis=require(_0xf69a('0x5'));var db=require(_0xf69a('0x6'))['db'];var utils=require(_0xf69a('0x7'));var logger=require(_0xf69a('0x8'))(_0xf69a('0x9'));var config=require(_0xf69a('0xa'));var jayson=require(_0xf69a('0xb'));var client=jayson[_0xf69a('0xc')]['http']({'port':0x232a});function respondWithRpcPromise(_0x5607a8,_0x39f7d5,_0x186b48){return new BPromise(function(_0x31741d,_0x505e49){return client['request'](_0x5607a8,_0x186b48)[_0xf69a('0xd')](function(_0x42fd7d){logger[_0xf69a('0xe')](_0xf69a('0xf'),_0x39f7d5,'request\x20sent');logger[_0xf69a('0x10')]('VoiceMail,\x20%s,\x20%s,\x20%s',_0x39f7d5,_0xf69a('0x11'),JSON[_0xf69a('0x12')](_0x42fd7d));if(_0x42fd7d['error']){if(_0x42fd7d[_0xf69a('0x13')]['code']===0x1f4){logger[_0xf69a('0x13')]('VoiceMail,\x20%s,\x20%s',_0x39f7d5,_0x42fd7d[_0xf69a('0x13')][_0xf69a('0x14')]);return _0x505e49(_0x42fd7d[_0xf69a('0x13')][_0xf69a('0x14')]);}logger[_0xf69a('0x13')](_0xf69a('0xf'),_0x39f7d5,_0x42fd7d[_0xf69a('0x13')][_0xf69a('0x14')]);return _0x31741d(_0x42fd7d[_0xf69a('0x13')]['message']);}else{logger['info'](_0xf69a('0xf'),_0x39f7d5,_0xf69a('0x11'));_0x31741d(_0x42fd7d[_0xf69a('0x15')]['message']);}})[_0xf69a('0x16')](function(_0x43a212){logger[_0xf69a('0x13')]('VoiceMail,\x20%s,\x20%s',_0x39f7d5,_0x43a212);_0x505e49(_0x43a212);});});}
\ No newline at end of file
diff --git a/server/api/voiceMailMessage/index.js b/server/api/voiceMailMessage/index.js
index 07728c0..1b51b58 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 _0x687b=['../../config/environment','./voiceMailMessage.controller','get','isAuthenticated','index','/:id','/:id/download','download','post','create','put','update','delete','destroy','exports','multer','util','path','connect-timeout','../../components/auth/service','../../components/interaction/service'];(function(_0x4ae829,_0x2c842c){var _0x256b31=function(_0x34f104){while(--_0x34f104){_0x4ae829['push'](_0x4ae829['shift']());}};_0x256b31(++_0x2c842c);}(_0x687b,0x14a));var _0xb687=function(_0x1e381c,_0x47b5b9){_0x1e381c=_0x1e381c-0x0;var _0x9b5ea9=_0x687b[_0x1e381c];return _0x9b5ea9;};'use strict';var multer=require(_0xb687('0x0'));var util=require(_0xb687('0x1'));var path=require(_0xb687('0x2'));var timeout=require(_0xb687('0x3'));var express=require('express');var router=express['Router']();var auth=require(_0xb687('0x4'));var interaction=require(_0xb687('0x5'));var config=require(_0xb687('0x6'));var controller=require(_0xb687('0x7'));router[_0xb687('0x8')]('/',auth[_0xb687('0x9')](),controller[_0xb687('0xa')]);router[_0xb687('0x8')](_0xb687('0xb'),auth[_0xb687('0x9')](),controller['show']);router[_0xb687('0x8')](_0xb687('0xc'),auth['isAuthenticated'](),controller[_0xb687('0xd')]);router[_0xb687('0xe')]('/',auth[_0xb687('0x9')](),controller[_0xb687('0xf')]);router[_0xb687('0x10')](_0xb687('0xb'),auth[_0xb687('0x9')](),controller[_0xb687('0x11')]);router[_0xb687('0x12')]('/:id',auth[_0xb687('0x9')](),controller[_0xb687('0x13')]);module[_0xb687('0x14')]=router;
\ No newline at end of file
+var _0x3f8a=['download','post','create','put','delete','destroy','exports','multer','util','path','connect-timeout','Router','../../components/auth/service','../../components/interaction/service','../../config/environment','./voiceMailMessage.controller','get','isAuthenticated','index','/:id','show','/:id/download'];(function(_0x87bec4,_0x5560b3){var _0x591d16=function(_0x2258ca){while(--_0x2258ca){_0x87bec4['push'](_0x87bec4['shift']());}};_0x591d16(++_0x5560b3);}(_0x3f8a,0x1d5));var _0xa3f8=function(_0xf03bd9,_0x240cc6){_0xf03bd9=_0xf03bd9-0x0;var _0x2900cc=_0x3f8a[_0xf03bd9];return _0x2900cc;};'use strict';var multer=require(_0xa3f8('0x0'));var util=require(_0xa3f8('0x1'));var path=require(_0xa3f8('0x2'));var timeout=require(_0xa3f8('0x3'));var express=require('express');var router=express[_0xa3f8('0x4')]();var auth=require(_0xa3f8('0x5'));var interaction=require(_0xa3f8('0x6'));var config=require(_0xa3f8('0x7'));var controller=require(_0xa3f8('0x8'));router[_0xa3f8('0x9')]('/',auth[_0xa3f8('0xa')](),controller[_0xa3f8('0xb')]);router[_0xa3f8('0x9')](_0xa3f8('0xc'),auth[_0xa3f8('0xa')](),controller[_0xa3f8('0xd')]);router[_0xa3f8('0x9')](_0xa3f8('0xe'),auth[_0xa3f8('0xa')](),controller[_0xa3f8('0xf')]);router[_0xa3f8('0x10')]('/',auth['isAuthenticated'](),controller[_0xa3f8('0x11')]);router[_0xa3f8('0x12')](_0xa3f8('0xc'),auth[_0xa3f8('0xa')](),controller['update']);router[_0xa3f8('0x13')](_0xa3f8('0xc'),auth[_0xa3f8('0xa')](),controller[_0xa3f8('0x14')]);module[_0xa3f8('0x15')]=router;
\ No newline at end of file
diff --git a/server/api/voiceMailMessage/voiceMailMessage.attributes.js b/server/api/voiceMailMessage/voiceMailMessage.attributes.js
index 5ba19e6..608cbdf 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 _0xeb7b=['TIMESTAMP','VIRTUAL','getDataValue','INTEGER','STRING','BLOB'];(function(_0x416103,_0x11ed8b){var _0x63d657=function(_0x4340cc){while(--_0x4340cc){_0x416103['push'](_0x416103['shift']());}};_0x63d657(++_0x11ed8b);}(_0xeb7b,0x19f));var _0xbeb7=function(_0xa464c9,_0x7c86d8){_0xa464c9=_0xa464c9-0x0;var _0x3d73c4=_0xeb7b[_0xa464c9];return _0x3d73c4;};'use strict';var Sequelize=require('sequelize');module['exports']={'name':{'type':Sequelize[_0xbeb7('0x0')],'get':function(_0x186d32){return this[_0xbeb7('0x1')]('id');}},'msgnum':{'type':Sequelize[_0xbeb7('0x2')](0xb),'defaultValue':0x0,'allowNull':![]},'dir':{'type':Sequelize[_0xbeb7('0x3')],'defaultValue':''},'context':{'type':Sequelize[_0xbeb7('0x3')],'defaultValue':''},'macrocontext':{'type':Sequelize[_0xbeb7('0x3')],'defaultValue':''},'callerid':{'type':Sequelize[_0xbeb7('0x3')],'defaultValue':''},'origtime':{'type':Sequelize[_0xbeb7('0x3')],'defaultValue':''},'duration':{'type':Sequelize[_0xbeb7('0x3')],'defaultValue':''},'mailboxuser':{'type':Sequelize[_0xbeb7('0x3')],'defaultValue':''},'mailboxcontext':{'type':Sequelize[_0xbeb7('0x3')],'defaultValue':''},'recording':{'type':Sequelize[_0xbeb7('0x4')]('long'),'defaultValue':null},'flag':{'type':Sequelize[_0xbeb7('0x3')],'defaultValue':''},'msg_id':{'type':Sequelize[_0xbeb7('0x3')],'defaultValue':''},'stamp':{'type':_0xbeb7('0x5'),'allowNull':![]}};
\ No newline at end of file
+var _0x463b=['getDataValue','STRING','BLOB','TIMESTAMP','sequelize','VIRTUAL'];(function(_0x2b4411,_0x2625ed){var _0x8e41ef=function(_0x2aa8c1){while(--_0x2aa8c1){_0x2b4411['push'](_0x2b4411['shift']());}};_0x8e41ef(++_0x2625ed);}(_0x463b,0x1cc));var _0xb463=function(_0x1e506e,_0x456653){_0x1e506e=_0x1e506e-0x0;var _0x3eeb60=_0x463b[_0x1e506e];return _0x3eeb60;};'use strict';var Sequelize=require(_0xb463('0x0'));module['exports']={'name':{'type':Sequelize[_0xb463('0x1')],'get':function(_0x3300be){return this[_0xb463('0x2')]('id');}},'msgnum':{'type':Sequelize['INTEGER'](0xb),'defaultValue':0x0,'allowNull':![]},'dir':{'type':Sequelize[_0xb463('0x3')],'defaultValue':''},'context':{'type':Sequelize[_0xb463('0x3')],'defaultValue':''},'macrocontext':{'type':Sequelize[_0xb463('0x3')],'defaultValue':''},'callerid':{'type':Sequelize[_0xb463('0x3')],'defaultValue':''},'origtime':{'type':Sequelize[_0xb463('0x3')],'defaultValue':''},'duration':{'type':Sequelize['STRING'],'defaultValue':''},'mailboxuser':{'type':Sequelize[_0xb463('0x3')],'defaultValue':''},'mailboxcontext':{'type':Sequelize[_0xb463('0x3')],'defaultValue':''},'recording':{'type':Sequelize[_0xb463('0x4')]('long'),'defaultValue':null},'flag':{'type':Sequelize['STRING'],'defaultValue':''},'msg_id':{'type':Sequelize[_0xb463('0x3')],'defaultValue':''},'stamp':{'type':_0xb463('0x5'),'allowNull':![]}};
\ No newline at end of file
diff --git a/server/api/voiceMailMessage/voiceMailMessage.controller.js b/server/api/voiceMailMessage/voiceMailMessage.controller.js
index 6edaadd..f7900ed 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 _0x8d0e=['end','status','json','count','offset','set','Content-Range','reject','update','then','destroy','error','stack','name','send','VoiceMailMessage','rawAttributes','fieldName','type','model','query','keys','intersection','attributes','fields','length','nolimit','limit','order','sort','where','pick','filters','filter','merge','map','VIRTUAL','options','includeAll','findAll','rows','params','include','find','catch','create','body','download','recording','Sequelize','ValidationError','audio/wav','attachment','msg_id','Content-Disposition','.wav\x22','html-pdf','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','moment','bluebird','mustache','path','ejs','lodash','squel','crypto','jsforce','desk.js','to-csv','querystring','ioredis','../../components/auth/service','../../components/parsers/qs','../../config/logger','api','../../config/utils','../../config/environment','../../mysqldb','sendStatus'];(function(_0x5c22b0,_0x330534){var _0x1d5a5b=function(_0x45f263){while(--_0x45f263){_0x5c22b0['push'](_0x5c22b0['shift']());}};_0x1d5a5b(++_0x330534);}(_0x8d0e,0x1d7));var _0xe8d0=function(_0x5be6f,_0xc7b6d9){_0x5be6f=_0x5be6f-0x0;var _0x6d2585=_0x8d0e[_0x5be6f];return _0x6d2585;};'use strict';var pdf=require(_0xe8d0('0x0'));var emlformat=require(_0xe8d0('0x1'));var rimraf=require(_0xe8d0('0x2'));var zipdir=require(_0xe8d0('0x3'));var jsonpatch=require(_0xe8d0('0x4'));var rp=require(_0xe8d0('0x5'));var moment=require(_0xe8d0('0x6'));var BPromise=require(_0xe8d0('0x7'));var Mustache=require(_0xe8d0('0x8'));var util=require('util');var path=require(_0xe8d0('0x9'));var sox=require('sox');var csv=require('to-csv');var ejs=require(_0xe8d0('0xa'));var fs=require('fs');var _=require(_0xe8d0('0xb'));var squel=require(_0xe8d0('0xc'));var crypto=require(_0xe8d0('0xd'));var jsforce=require(_0xe8d0('0xe'));var deskjs=require(_0xe8d0('0xf'));var toCsv=require(_0xe8d0('0x10'));var querystring=require(_0xe8d0('0x11'));var Papa=require('papaparse');var Redis=require(_0xe8d0('0x12'));var authService=require(_0xe8d0('0x13'));var qs=require(_0xe8d0('0x14'));var as=require('../../components/parsers/advancedSearch');var hardwareService=require('../../config/license/hardware');var logger=require(_0xe8d0('0x15'))(_0xe8d0('0x16'));var utils=require(_0xe8d0('0x17'));var config=require(_0xe8d0('0x18'));var db=require(_0xe8d0('0x19'))['db'];function respondWithStatusCode(_0x41de69,_0x5934b2){_0x5934b2=_0x5934b2||0xcc;return function(_0x38fac0){if(_0x38fac0){return _0x41de69[_0xe8d0('0x1a')](_0x5934b2);}return _0x41de69['status'](_0x5934b2)[_0xe8d0('0x1b')]();};}function respondWithResult(_0x4cbd26,_0x59b4b7){_0x59b4b7=_0x59b4b7||0xc8;return function(_0x90a1ea){if(_0x90a1ea){return _0x4cbd26[_0xe8d0('0x1c')](_0x59b4b7)[_0xe8d0('0x1d')](_0x90a1ea);}};}function respondWithFilteredResult(_0x291b49,_0x15d3a1){return function(_0x7151c6){if(_0x7151c6){var _0x52818a=_0x7151c6[_0xe8d0('0x1e')],_0x6ccffa=_0x15d3a1[_0xe8d0('0x1f')],_0x49554d=_0x15d3a1['offset']+_0x15d3a1['limit'],_0x6d932b;if(_0x49554d>=_0x52818a){_0x49554d=_0x52818a;_0x6d932b=0xc8;}else{_0x6d932b=0xce;}_0x291b49['status'](_0x6d932b);return _0x291b49[_0xe8d0('0x20')](_0xe8d0('0x21'),_0x6ccffa+'-'+_0x49554d+'/'+_0x52818a)[_0xe8d0('0x1d')](_0x7151c6);}return null;};}function patchUpdates(_0x44bbe4){return function(_0x83177b){try{jsonpatch['apply'](_0x83177b,_0x44bbe4,!![]);}catch(_0x105861){return BPromise[_0xe8d0('0x22')](_0x105861);}return _0x83177b['save']();};}function saveUpdates(_0x5ce284,_0x554402){return function(_0x384a60){if(_0x384a60){return _0x384a60[_0xe8d0('0x23')](_0x5ce284)[_0xe8d0('0x24')](function(_0x1fbfe8){return _0x1fbfe8;});}return null;};}function removeEntity(_0x25f764,_0x23a945){return function(_0x1bd25c){if(_0x1bd25c){return _0x1bd25c[_0xe8d0('0x25')]()[_0xe8d0('0x24')](function(){_0x25f764['status'](0xcc)[_0xe8d0('0x1b')]();});}};}function handleEntityNotFound(_0x9f747,_0x572c25){return function(_0x106614){if(!_0x106614){_0x9f747[_0xe8d0('0x1a')](0x194);}return _0x106614;};}function handleError(_0x274cac,_0xd86c76){_0xd86c76=_0xd86c76||0x1f4;return function(_0x146783){logger[_0xe8d0('0x26')](_0x146783[_0xe8d0('0x27')]);if(_0x146783[_0xe8d0('0x28')]){delete _0x146783[_0xe8d0('0x28')];}_0x274cac[_0xe8d0('0x1c')](_0xd86c76)[_0xe8d0('0x29')](_0x146783);};}exports['index']=function(_0x24982c,_0x26dd52){var _0x10dec2={},_0x486f49={},_0x10a30b={'count':0x0,'rows':[]};var _0x343b08=_['map'](db[_0xe8d0('0x2a')][_0xe8d0('0x2b')],function(_0x11fcf2){return{'name':_0x11fcf2[_0xe8d0('0x2c')],'type':_0x11fcf2[_0xe8d0('0x2d')]['key']};});_0x486f49[_0xe8d0('0x2e')]=_['differenceBy'](_['map'](_0x343b08,'name'),[_0xe8d0('0x28')]);_0x486f49[_0xe8d0('0x2f')]=_[_0xe8d0('0x30')](_0x24982c['query']);_0x486f49['filters']=_[_0xe8d0('0x31')](_0x486f49['model'],_0x486f49[_0xe8d0('0x2f')]);_0x10dec2[_0xe8d0('0x32')]=_[_0xe8d0('0x31')](_0x486f49[_0xe8d0('0x2e')],qs[_0xe8d0('0x33')](_0x24982c['query'][_0xe8d0('0x33')]));_0x10dec2[_0xe8d0('0x32')]=_0x10dec2[_0xe8d0('0x32')][_0xe8d0('0x34')]?_0x10dec2['attributes']:_0x486f49[_0xe8d0('0x2e')];if(!_0x24982c[_0xe8d0('0x2f')]['hasOwnProperty'](_0xe8d0('0x35'))){_0x10dec2['limit']=qs[_0xe8d0('0x36')](_0x24982c['query'][_0xe8d0('0x36')]);_0x10dec2['offset']=qs[_0xe8d0('0x1f')](_0x24982c[_0xe8d0('0x2f')][_0xe8d0('0x1f')]);}_0x10dec2[_0xe8d0('0x37')]=qs['sort'](_0x24982c[_0xe8d0('0x2f')][_0xe8d0('0x38')]);_0x10dec2[_0xe8d0('0x39')]=qs['filters'](_[_0xe8d0('0x3a')](_0x24982c[_0xe8d0('0x2f')],_0x486f49[_0xe8d0('0x3b')]));if(_0x24982c[_0xe8d0('0x2f')][_0xe8d0('0x3c')]){_0x10dec2['where']=_[_0xe8d0('0x3d')](_0x10dec2[_0xe8d0('0x39')],{'$or':_[_0xe8d0('0x3e')](_0x343b08,function(_0x3d76d5){if(_0x3d76d5[_0xe8d0('0x2d')]!==_0xe8d0('0x3f')){var _0xbb9620={};_0xbb9620[_0x3d76d5[_0xe8d0('0x28')]]={'$like':'%'+_0x24982c['query']['filter']+'%'};return _0xbb9620;}})});}_0x10dec2=_[_0xe8d0('0x3d')]({},_0x10dec2,_0x24982c[_0xe8d0('0x40')]);var _0x45e2dc={'where':_0x10dec2[_0xe8d0('0x39')]};return db[_0xe8d0('0x2a')]['count'](_0x45e2dc)[_0xe8d0('0x24')](function(_0x4bd7a2){_0x10a30b[_0xe8d0('0x1e')]=_0x4bd7a2;if(_0x24982c[_0xe8d0('0x2f')][_0xe8d0('0x41')]){_0x10dec2['include']=[{'all':!![]}];}return db[_0xe8d0('0x2a')][_0xe8d0('0x42')](_0x10dec2);})[_0xe8d0('0x24')](function(_0x230a90){_0x10a30b[_0xe8d0('0x43')]=_0x230a90;return _0x10a30b;})['then'](respondWithFilteredResult(_0x26dd52,_0x10dec2))['catch'](handleError(_0x26dd52,null));};exports['show']=function(_0x4cf0da,_0x14ffb6){var _0x52f288={'raw':!![],'where':{'id':_0x4cf0da[_0xe8d0('0x44')]['id']}},_0x1e6e8f={};_0x1e6e8f[_0xe8d0('0x2e')]=_[_0xe8d0('0x30')](db[_0xe8d0('0x2a')][_0xe8d0('0x2b')]);_0x1e6e8f[_0xe8d0('0x2f')]=_[_0xe8d0('0x30')](_0x4cf0da['query']);_0x1e6e8f[_0xe8d0('0x3b')]=_[_0xe8d0('0x31')](_0x1e6e8f['model'],_0x1e6e8f['query']);_0x52f288[_0xe8d0('0x32')]=_[_0xe8d0('0x31')](_0x1e6e8f[_0xe8d0('0x2e')],qs['fields'](_0x4cf0da[_0xe8d0('0x2f')][_0xe8d0('0x33')]));_0x52f288['attributes']=_0x52f288[_0xe8d0('0x32')][_0xe8d0('0x34')]?_0x52f288['attributes']:_0x1e6e8f[_0xe8d0('0x2e')];if(_0x4cf0da[_0xe8d0('0x2f')][_0xe8d0('0x41')]){_0x52f288[_0xe8d0('0x45')]=[{'all':!![]}];}_0x52f288=_[_0xe8d0('0x3d')]({},_0x52f288,_0x4cf0da[_0xe8d0('0x40')]);return db[_0xe8d0('0x2a')][_0xe8d0('0x46')](_0x52f288)['then'](handleEntityNotFound(_0x14ffb6,null))[_0xe8d0('0x24')](respondWithResult(_0x14ffb6,null))[_0xe8d0('0x47')](handleError(_0x14ffb6,null));};exports[_0xe8d0('0x48')]=function(_0x2278ef,_0x28d38b){return db[_0xe8d0('0x2a')][_0xe8d0('0x48')](_0x2278ef[_0xe8d0('0x49')],{})[_0xe8d0('0x24')](respondWithResult(_0x28d38b,0xc9))[_0xe8d0('0x47')](handleError(_0x28d38b,null));};exports[_0xe8d0('0x23')]=function(_0x3a5987,_0x596303){if(_0x3a5987[_0xe8d0('0x49')]['id']){delete _0x3a5987[_0xe8d0('0x49')]['id'];}return db[_0xe8d0('0x2a')][_0xe8d0('0x46')]({'where':{'id':_0x3a5987[_0xe8d0('0x44')]['id']}})[_0xe8d0('0x24')](handleEntityNotFound(_0x596303,null))[_0xe8d0('0x24')](saveUpdates(_0x3a5987['body'],null))[_0xe8d0('0x24')](respondWithResult(_0x596303,null))[_0xe8d0('0x47')](handleError(_0x596303,null));};exports[_0xe8d0('0x25')]=function(_0x205933,_0x4ed47f){return db[_0xe8d0('0x2a')]['find']({'where':{'id':_0x205933[_0xe8d0('0x44')]['id']}})[_0xe8d0('0x24')](handleEntityNotFound(_0x4ed47f,null))[_0xe8d0('0x24')](removeEntity(_0x4ed47f,null))[_0xe8d0('0x47')](handleError(_0x4ed47f,null));};exports[_0xe8d0('0x4a')]=function(_0x34efb0,_0x1646fb,_0x52b8b2){return db[_0xe8d0('0x2a')]['find']({'where':{'id':_0x34efb0['params']['id']},'attributes':['id',_0xe8d0('0x4b'),'msg_id']})[_0xe8d0('0x24')](handleEntityNotFound(_0x1646fb,null))['then'](function(_0x1f8fcc){if(_0x1f8fcc){if(!_0x1f8fcc[_0xe8d0('0x4b')]){throw new db[(_0xe8d0('0x4c'))][(_0xe8d0('0x4d'))]('VoiceMailMessage\x20not\x20found');}var _0x3088b1={'Content-Type':_0xe8d0('0x4e'),'Content-Disposition':_0xe8d0('0x4f')};if(_0x1f8fcc[_0xe8d0('0x50')]){_0x3088b1[_0xe8d0('0x51')]='attachment;\x20filename=\x22'+_0x1f8fcc[_0xe8d0('0x50')]+_0xe8d0('0x52');}_0x1646fb[_0xe8d0('0x20')](_0x3088b1);return _0x1646fb['send'](new Buffer(_0x1f8fcc[_0xe8d0('0x4b')]));}})['catch'](handleError(_0x1646fb,null));};
\ No newline at end of file
+var _0x5c12=['../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','../../config/utils','../../config/environment','sendStatus','status','json','count','offset','Content-Range','reject','save','update','then','destroy','end','error','name','send','index','map','VoiceMailMessage','type','key','model','differenceBy','query','keys','filters','attributes','length','hasOwnProperty','nolimit','limit','order','sort','where','pick','filter','merge','options','include','findAll','catch','show','params','intersection','fields','includeAll','find','create','body','download','recording','Sequelize','ValidationError','VoiceMailMessage\x20not\x20found','audio/wav','msg_id','Content-Disposition','attachment;\x20filename=\x22','.wav\x22','set','eml-format','rimraf','fast-json-patch','request-promise','moment','bluebird','mustache','util','path','to-csv','ejs','lodash','jsforce','desk.js','querystring','papaparse','../../components/auth/service','../../components/parsers/qs'];(function(_0xfb42e6,_0x5f5d4b){var _0x27265b=function(_0x163e81){while(--_0x163e81){_0xfb42e6['push'](_0xfb42e6['shift']());}};_0x27265b(++_0x5f5d4b);}(_0x5c12,0x188));var _0x25c1=function(_0x503306,_0x356f2f){_0x503306=_0x503306-0x0;var _0x44a99d=_0x5c12[_0x503306];return _0x44a99d;};'use strict';var pdf=require('html-pdf');var emlformat=require(_0x25c1('0x0'));var rimraf=require(_0x25c1('0x1'));var zipdir=require('zip-dir');var jsonpatch=require(_0x25c1('0x2'));var rp=require(_0x25c1('0x3'));var moment=require(_0x25c1('0x4'));var BPromise=require(_0x25c1('0x5'));var Mustache=require(_0x25c1('0x6'));var util=require(_0x25c1('0x7'));var path=require(_0x25c1('0x8'));var sox=require('sox');var csv=require(_0x25c1('0x9'));var ejs=require(_0x25c1('0xa'));var fs=require('fs');var _=require(_0x25c1('0xb'));var squel=require('squel');var crypto=require('crypto');var jsforce=require(_0x25c1('0xc'));var deskjs=require(_0x25c1('0xd'));var toCsv=require(_0x25c1('0x9'));var querystring=require(_0x25c1('0xe'));var Papa=require(_0x25c1('0xf'));var Redis=require('ioredis');var authService=require(_0x25c1('0x10'));var qs=require(_0x25c1('0x11'));var as=require(_0x25c1('0x12'));var hardwareService=require(_0x25c1('0x13'));var logger=require(_0x25c1('0x14'))('api');var utils=require(_0x25c1('0x15'));var config=require(_0x25c1('0x16'));var db=require('../../mysqldb')['db'];function respondWithStatusCode(_0x256ecd,_0x209af5){_0x209af5=_0x209af5||0xcc;return function(_0x323d3c){if(_0x323d3c){return _0x256ecd[_0x25c1('0x17')](_0x209af5);}return _0x256ecd['status'](_0x209af5)['end']();};}function respondWithResult(_0x4ef5d7,_0x54f6f4){_0x54f6f4=_0x54f6f4||0xc8;return function(_0x3ef429){if(_0x3ef429){return _0x4ef5d7[_0x25c1('0x18')](_0x54f6f4)[_0x25c1('0x19')](_0x3ef429);}};}function respondWithFilteredResult(_0x6eba15,_0x17a032){return function(_0x4ea926){if(_0x4ea926){var _0x4638f0=_0x4ea926[_0x25c1('0x1a')],_0x55b62d=_0x17a032[_0x25c1('0x1b')],_0x5d631e=_0x17a032['offset']+_0x17a032['limit'],_0x5b852a;if(_0x5d631e>=_0x4638f0){_0x5d631e=_0x4638f0;_0x5b852a=0xc8;}else{_0x5b852a=0xce;}_0x6eba15[_0x25c1('0x18')](_0x5b852a);return _0x6eba15['set'](_0x25c1('0x1c'),_0x55b62d+'-'+_0x5d631e+'/'+_0x4638f0)[_0x25c1('0x19')](_0x4ea926);}return null;};}function patchUpdates(_0x5c3c5d){return function(_0x4dd4f3){try{jsonpatch['apply'](_0x4dd4f3,_0x5c3c5d,!![]);}catch(_0x2ce1ce){return BPromise[_0x25c1('0x1d')](_0x2ce1ce);}return _0x4dd4f3[_0x25c1('0x1e')]();};}function saveUpdates(_0x1bf95d,_0x481c12){return function(_0x119639){if(_0x119639){return _0x119639[_0x25c1('0x1f')](_0x1bf95d)[_0x25c1('0x20')](function(_0x29e637){return _0x29e637;});}return null;};}function removeEntity(_0x517a46,_0x4c3259){return function(_0x2a8a84){if(_0x2a8a84){return _0x2a8a84[_0x25c1('0x21')]()[_0x25c1('0x20')](function(){_0x517a46[_0x25c1('0x18')](0xcc)[_0x25c1('0x22')]();});}};}function handleEntityNotFound(_0x1a4b89,_0x2ba595){return function(_0x324ea9){if(!_0x324ea9){_0x1a4b89[_0x25c1('0x17')](0x194);}return _0x324ea9;};}function handleError(_0x261604,_0x2f78dd){_0x2f78dd=_0x2f78dd||0x1f4;return function(_0x284daa){logger[_0x25c1('0x23')](_0x284daa['stack']);if(_0x284daa[_0x25c1('0x24')]){delete _0x284daa[_0x25c1('0x24')];}_0x261604[_0x25c1('0x18')](_0x2f78dd)[_0x25c1('0x25')](_0x284daa);};}exports[_0x25c1('0x26')]=function(_0x326a5f,_0x5ad776){var _0x17c924={},_0x428ce8={},_0x6cb14f={'count':0x0,'rows':[]};var _0x38c1d5=_[_0x25c1('0x27')](db[_0x25c1('0x28')]['rawAttributes'],function(_0x1e498){return{'name':_0x1e498['fieldName'],'type':_0x1e498[_0x25c1('0x29')][_0x25c1('0x2a')]};});_0x428ce8[_0x25c1('0x2b')]=_[_0x25c1('0x2c')](_[_0x25c1('0x27')](_0x38c1d5,_0x25c1('0x24')),[_0x25c1('0x24')]);_0x428ce8[_0x25c1('0x2d')]=_[_0x25c1('0x2e')](_0x326a5f['query']);_0x428ce8[_0x25c1('0x2f')]=_['intersection'](_0x428ce8['model'],_0x428ce8[_0x25c1('0x2d')]);_0x17c924[_0x25c1('0x30')]=_['intersection'](_0x428ce8[_0x25c1('0x2b')],qs['fields'](_0x326a5f[_0x25c1('0x2d')]['fields']));_0x17c924[_0x25c1('0x30')]=_0x17c924[_0x25c1('0x30')][_0x25c1('0x31')]?_0x17c924[_0x25c1('0x30')]:_0x428ce8[_0x25c1('0x2b')];if(!_0x326a5f[_0x25c1('0x2d')][_0x25c1('0x32')](_0x25c1('0x33'))){_0x17c924['limit']=qs[_0x25c1('0x34')](_0x326a5f['query'][_0x25c1('0x34')]);_0x17c924['offset']=qs[_0x25c1('0x1b')](_0x326a5f[_0x25c1('0x2d')][_0x25c1('0x1b')]);}_0x17c924[_0x25c1('0x35')]=qs[_0x25c1('0x36')](_0x326a5f[_0x25c1('0x2d')][_0x25c1('0x36')]);_0x17c924[_0x25c1('0x37')]=qs[_0x25c1('0x2f')](_[_0x25c1('0x38')](_0x326a5f[_0x25c1('0x2d')],_0x428ce8[_0x25c1('0x2f')]));if(_0x326a5f[_0x25c1('0x2d')][_0x25c1('0x39')]){_0x17c924[_0x25c1('0x37')]=_[_0x25c1('0x3a')](_0x17c924[_0x25c1('0x37')],{'$or':_[_0x25c1('0x27')](_0x38c1d5,function(_0x12cdee){if(_0x12cdee[_0x25c1('0x29')]!=='VIRTUAL'){var _0x32cc49={};_0x32cc49[_0x12cdee[_0x25c1('0x24')]]={'$like':'%'+_0x326a5f['query'][_0x25c1('0x39')]+'%'};return _0x32cc49;}})});}_0x17c924=_['merge']({},_0x17c924,_0x326a5f[_0x25c1('0x3b')]);var _0x4f978c={'where':_0x17c924[_0x25c1('0x37')]};return db[_0x25c1('0x28')][_0x25c1('0x1a')](_0x4f978c)[_0x25c1('0x20')](function(_0xbc20a3){_0x6cb14f['count']=_0xbc20a3;if(_0x326a5f[_0x25c1('0x2d')]['includeAll']){_0x17c924[_0x25c1('0x3c')]=[{'all':!![]}];}return db[_0x25c1('0x28')][_0x25c1('0x3d')](_0x17c924);})[_0x25c1('0x20')](function(_0x57c65a){_0x6cb14f['rows']=_0x57c65a;return _0x6cb14f;})['then'](respondWithFilteredResult(_0x5ad776,_0x17c924))[_0x25c1('0x3e')](handleError(_0x5ad776,null));};exports[_0x25c1('0x3f')]=function(_0x530967,_0x198dfa){var _0x58792d={'raw':!![],'where':{'id':_0x530967[_0x25c1('0x40')]['id']}},_0x3d5172={};_0x3d5172[_0x25c1('0x2b')]=_['keys'](db['VoiceMailMessage']['rawAttributes']);_0x3d5172[_0x25c1('0x2d')]=_[_0x25c1('0x2e')](_0x530967['query']);_0x3d5172[_0x25c1('0x2f')]=_[_0x25c1('0x41')](_0x3d5172[_0x25c1('0x2b')],_0x3d5172['query']);_0x58792d['attributes']=_['intersection'](_0x3d5172['model'],qs[_0x25c1('0x42')](_0x530967[_0x25c1('0x2d')]['fields']));_0x58792d[_0x25c1('0x30')]=_0x58792d[_0x25c1('0x30')][_0x25c1('0x31')]?_0x58792d[_0x25c1('0x30')]:_0x3d5172[_0x25c1('0x2b')];if(_0x530967[_0x25c1('0x2d')][_0x25c1('0x43')]){_0x58792d['include']=[{'all':!![]}];}_0x58792d=_['merge']({},_0x58792d,_0x530967[_0x25c1('0x3b')]);return db[_0x25c1('0x28')][_0x25c1('0x44')](_0x58792d)['then'](handleEntityNotFound(_0x198dfa,null))[_0x25c1('0x20')](respondWithResult(_0x198dfa,null))[_0x25c1('0x3e')](handleError(_0x198dfa,null));};exports[_0x25c1('0x45')]=function(_0xa009d1,_0x557ca3){return db[_0x25c1('0x28')][_0x25c1('0x45')](_0xa009d1[_0x25c1('0x46')],{})[_0x25c1('0x20')](respondWithResult(_0x557ca3,0xc9))['catch'](handleError(_0x557ca3,null));};exports['update']=function(_0x13ac06,_0x2cd055){if(_0x13ac06[_0x25c1('0x46')]['id']){delete _0x13ac06[_0x25c1('0x46')]['id'];}return db['VoiceMailMessage'][_0x25c1('0x44')]({'where':{'id':_0x13ac06[_0x25c1('0x40')]['id']}})['then'](handleEntityNotFound(_0x2cd055,null))[_0x25c1('0x20')](saveUpdates(_0x13ac06[_0x25c1('0x46')],null))[_0x25c1('0x20')](respondWithResult(_0x2cd055,null))[_0x25c1('0x3e')](handleError(_0x2cd055,null));};exports['destroy']=function(_0x4b2e06,_0x5034ba){return db[_0x25c1('0x28')][_0x25c1('0x44')]({'where':{'id':_0x4b2e06['params']['id']}})[_0x25c1('0x20')](handleEntityNotFound(_0x5034ba,null))[_0x25c1('0x20')](removeEntity(_0x5034ba,null))['catch'](handleError(_0x5034ba,null));};exports[_0x25c1('0x47')]=function(_0x1b938e,_0x2b58a3,_0x2b3bcb){return db[_0x25c1('0x28')][_0x25c1('0x44')]({'where':{'id':_0x1b938e[_0x25c1('0x40')]['id']},'attributes':['id','recording','msg_id']})['then'](handleEntityNotFound(_0x2b58a3,null))[_0x25c1('0x20')](function(_0x5c588c){if(_0x5c588c){if(!_0x5c588c[_0x25c1('0x48')]){throw new db[(_0x25c1('0x49'))][(_0x25c1('0x4a'))](_0x25c1('0x4b'));}var _0x40fe57={'Content-Type':_0x25c1('0x4c'),'Content-Disposition':'attachment'};if(_0x5c588c[_0x25c1('0x4d')]){_0x40fe57[_0x25c1('0x4e')]=_0x25c1('0x4f')+_0x5c588c[_0x25c1('0x4d')]+_0x25c1('0x50');}_0x2b58a3[_0x25c1('0x51')](_0x40fe57);return _0x2b58a3['send'](new Buffer(_0x5c588c[_0x25c1('0x48')]));}})[_0x25c1('0x3e')](handleError(_0x2b58a3,null));};
\ No newline at end of file
diff --git a/server/api/voiceMailMessage/voiceMailMessage.model.js b/server/api/voiceMailMessage/voiceMailMessage.model.js
index bf62b15..841021a 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 _0x4c6c=['api','moment','rimraf','../../config/environment','./voiceMailMessage.attributes','dir','lodash','../../config/logger'];(function(_0x46738c,_0x2c8b9b){var _0x2bfe32=function(_0x3d4f6c){while(--_0x3d4f6c){_0x46738c['push'](_0x46738c['shift']());}};_0x2bfe32(++_0x2c8b9b);}(_0x4c6c,0x96));var _0xc4c6=function(_0x49f276,_0x398e6b){_0x49f276=_0x49f276-0x0;var _0x39b081=_0x4c6c[_0x49f276];return _0x39b081;};'use strict';var _=require(_0xc4c6('0x0'));var util=require('util');var logger=require(_0xc4c6('0x1'))(_0xc4c6('0x2'));var moment=require(_0xc4c6('0x3'));var BPromise=require('bluebird');var rp=require('request-promise');var fs=require('fs');var path=require('path');var rimraf=require(_0xc4c6('0x4'));var config=require(_0xc4c6('0x5'));var attributes=require(_0xc4c6('0x6'));module['exports']=function(_0x8190fd,_0x107f98){return _0x8190fd['define']('VoiceMailMessage',attributes,{'tableName':'voice_voicemail_messages','paranoid':![],'indexes':[{'name':_0xc4c6('0x7'),'fields':[_0xc4c6('0x7')]}],'timestamps':![]});};
\ No newline at end of file
+var _0x79b8=['dir','util','api','request-promise','path','rimraf','./voiceMailMessage.attributes','define'];(function(_0x5c7a85,_0x41dd19){var _0x35290f=function(_0x26215b){while(--_0x26215b){_0x5c7a85['push'](_0x5c7a85['shift']());}};_0x35290f(++_0x41dd19);}(_0x79b8,0xb1));var _0x879b=function(_0x17b287,_0x4bed1c){_0x17b287=_0x17b287-0x0;var _0x177054=_0x79b8[_0x17b287];return _0x177054;};'use strict';var _=require('lodash');var util=require(_0x879b('0x0'));var logger=require('../../config/logger')(_0x879b('0x1'));var moment=require('moment');var BPromise=require('bluebird');var rp=require(_0x879b('0x2'));var fs=require('fs');var path=require(_0x879b('0x3'));var rimraf=require(_0x879b('0x4'));var config=require('../../config/environment');var attributes=require(_0x879b('0x5'));module['exports']=function(_0x4cf1dc,_0x15b363){return _0x4cf1dc[_0x879b('0x6')]('VoiceMailMessage',attributes,{'tableName':'voice_voicemail_messages','paranoid':![],'indexes':[{'name':_0x879b('0x7'),'fields':[_0x879b('0x7')]}],'timestamps':![]});};
\ No newline at end of file
diff --git a/server/api/voiceMailMessage/voiceMailMessage.rpc.js b/server/api/voiceMailMessage/voiceMailMessage.rpc.js
index 01e3c93..d17e266 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 _0x2032=['ioredis','../../mysqldb','../../config/logger','rpc','../../config/environment','jayson/promise','client','http','VoiceMailMessage,\x20%s,\x20%s','request\x20sent','debug','error','code','message','info','result','catch','util','moment','bluebird'];(function(_0x54c742,_0xfb009f){var _0x2e10c2=function(_0x314640){while(--_0x314640){_0x54c742['push'](_0x54c742['shift']());}};_0x2e10c2(++_0xfb009f);}(_0x2032,0xd9));var _0x2203=function(_0x1b0d59,_0x14c5de){_0x1b0d59=_0x1b0d59-0x0;var _0x4b87b4=_0x2032[_0x1b0d59];return _0x4b87b4;};'use strict';var _=require('lodash');var util=require(_0x2203('0x0'));var moment=require(_0x2203('0x1'));var BPromise=require(_0x2203('0x2'));var rs=require('randomstring');var fs=require('fs');var Redis=require(_0x2203('0x3'));var db=require(_0x2203('0x4'))['db'];var utils=require('../../config/utils');var logger=require(_0x2203('0x5'))(_0x2203('0x6'));var config=require(_0x2203('0x7'));var jayson=require(_0x2203('0x8'));var client=jayson[_0x2203('0x9')][_0x2203('0xa')]({'port':0x232a});function respondWithRpcPromise(_0x2e0f63,_0x2676aa,_0x18c4d6){return new BPromise(function(_0x2049ff,_0x2999ed){return client['request'](_0x2e0f63,_0x18c4d6)['then'](function(_0x10f055){logger['info'](_0x2203('0xb'),_0x2676aa,_0x2203('0xc'));logger[_0x2203('0xd')]('VoiceMailMessage,\x20%s,\x20%s,\x20%s',_0x2676aa,_0x2203('0xc'),JSON['stringify'](_0x10f055));if(_0x10f055[_0x2203('0xe')]){if(_0x10f055['error'][_0x2203('0xf')]===0x1f4){logger[_0x2203('0xe')]('VoiceMailMessage,\x20%s,\x20%s',_0x2676aa,_0x10f055['error']['message']);return _0x2999ed(_0x10f055['error']['message']);}logger[_0x2203('0xe')]('VoiceMailMessage,\x20%s,\x20%s',_0x2676aa,_0x10f055['error'][_0x2203('0x10')]);return _0x2049ff(_0x10f055[_0x2203('0xe')][_0x2203('0x10')]);}else{logger[_0x2203('0x11')](_0x2203('0xb'),_0x2676aa,_0x2203('0xc'));_0x2049ff(_0x10f055[_0x2203('0x12')][_0x2203('0x10')]);}})[_0x2203('0x13')](function(_0x3053f3){logger['error'](_0x2203('0xb'),_0x2676aa,_0x3053f3);_0x2999ed(_0x3053f3);});});}
\ No newline at end of file
+var _0xdb28=['moment','bluebird','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','jayson/promise','client','request','then','VoiceMailMessage,\x20%s,\x20%s','request\x20sent','debug','stringify','error','code','message','info','catch','lodash','util'];(function(_0x35b6e7,_0x5246ce){var _0x1e8948=function(_0xa1adcc){while(--_0xa1adcc){_0x35b6e7['push'](_0x35b6e7['shift']());}};_0x1e8948(++_0x5246ce);}(_0xdb28,0x106));var _0x8db2=function(_0xfd62e8,_0x590655){_0xfd62e8=_0xfd62e8-0x0;var _0x4450d3=_0xdb28[_0xfd62e8];return _0x4450d3;};'use strict';var _=require(_0x8db2('0x0'));var util=require(_0x8db2('0x1'));var moment=require(_0x8db2('0x2'));var BPromise=require(_0x8db2('0x3'));var rs=require('randomstring');var fs=require('fs');var Redis=require(_0x8db2('0x4'));var db=require(_0x8db2('0x5'))['db'];var utils=require(_0x8db2('0x6'));var logger=require(_0x8db2('0x7'))(_0x8db2('0x8'));var config=require('../../config/environment');var jayson=require(_0x8db2('0x9'));var client=jayson[_0x8db2('0xa')]['http']({'port':0x232a});function respondWithRpcPromise(_0x494b40,_0x477f50,_0x46932f){return new BPromise(function(_0x131537,_0x29f698){return client[_0x8db2('0xb')](_0x494b40,_0x46932f)[_0x8db2('0xc')](function(_0x126c78){logger['info'](_0x8db2('0xd'),_0x477f50,_0x8db2('0xe'));logger[_0x8db2('0xf')]('VoiceMailMessage,\x20%s,\x20%s,\x20%s',_0x477f50,_0x8db2('0xe'),JSON[_0x8db2('0x10')](_0x126c78));if(_0x126c78['error']){if(_0x126c78[_0x8db2('0x11')][_0x8db2('0x12')]===0x1f4){logger[_0x8db2('0x11')](_0x8db2('0xd'),_0x477f50,_0x126c78[_0x8db2('0x11')]['message']);return _0x29f698(_0x126c78['error'][_0x8db2('0x13')]);}logger[_0x8db2('0x11')](_0x8db2('0xd'),_0x477f50,_0x126c78[_0x8db2('0x11')][_0x8db2('0x13')]);return _0x131537(_0x126c78[_0x8db2('0x11')][_0x8db2('0x13')]);}else{logger[_0x8db2('0x14')](_0x8db2('0xd'),_0x477f50,_0x8db2('0xe'));_0x131537(_0x126c78['result'][_0x8db2('0x13')]);}})[_0x8db2('0x15')](function(_0x48101e){logger[_0x8db2('0x11')](_0x8db2('0xd'),_0x477f50,_0x48101e);_0x29f698(_0x48101e);});});}
\ No newline at end of file
diff --git a/server/api/voiceMusicOnHold/index.js b/server/api/voiceMusicOnHold/index.js
index c88faa2..30cf44e 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 _0x7acf=['put','update','destroy','delete','/:id/sounds/:id2','removeSound','exports','multer','path','connect-timeout','express','../../config/environment','./voiceMusicOnHold.controller','get','isAuthenticated','index','/:id','show','/:id/sounds','getSounds','post','addSound'];(function(_0x3dd15e,_0x1f0015){var _0x231fd0=function(_0x4f680a){while(--_0x4f680a){_0x3dd15e['push'](_0x3dd15e['shift']());}};_0x231fd0(++_0x1f0015);}(_0x7acf,0xb7));var _0xf7ac=function(_0x521485,_0x4598e9){_0x521485=_0x521485-0x0;var _0x576686=_0x7acf[_0x521485];return _0x576686;};'use strict';var multer=require(_0xf7ac('0x0'));var util=require('util');var path=require(_0xf7ac('0x1'));var timeout=require(_0xf7ac('0x2'));var express=require(_0xf7ac('0x3'));var router=express['Router']();var auth=require('../../components/auth/service');var interaction=require('../../components/interaction/service');var config=require(_0xf7ac('0x4'));var controller=require(_0xf7ac('0x5'));router[_0xf7ac('0x6')]('/',auth[_0xf7ac('0x7')](),controller[_0xf7ac('0x8')]);router['get'](_0xf7ac('0x9'),auth[_0xf7ac('0x7')](),controller[_0xf7ac('0xa')]);router['get'](_0xf7ac('0xb'),auth[_0xf7ac('0x7')](),controller[_0xf7ac('0xc')]);router[_0xf7ac('0xd')]('/',auth[_0xf7ac('0x7')](),controller['create']);router['post'](_0xf7ac('0xb'),auth[_0xf7ac('0x7')](),controller[_0xf7ac('0xe')]);router[_0xf7ac('0xf')](_0xf7ac('0x9'),auth[_0xf7ac('0x7')](),controller[_0xf7ac('0x10')]);router['delete']('/:id',auth[_0xf7ac('0x7')](),controller[_0xf7ac('0x11')]);router[_0xf7ac('0x12')](_0xf7ac('0x13'),auth['isAuthenticated'](),controller[_0xf7ac('0x14')]);module[_0xf7ac('0x15')]=router;
\ No newline at end of file
+var _0x22db=['put','delete','destroy','removeSound','exports','multer','util','path','connect-timeout','Router','../../components/auth/service','../../components/interaction/service','../../config/environment','./voiceMusicOnHold.controller','isAuthenticated','index','/:id','show','get','/:id/sounds','getSounds','post','addSound'];(function(_0x6a427f,_0x338fa5){var _0x18c497=function(_0x3a6dcd){while(--_0x3a6dcd){_0x6a427f['push'](_0x6a427f['shift']());}};_0x18c497(++_0x338fa5);}(_0x22db,0x15e));var _0xb22d=function(_0x4704dc,_0x575a5f){_0x4704dc=_0x4704dc-0x0;var _0x254d81=_0x22db[_0x4704dc];return _0x254d81;};'use strict';var multer=require(_0xb22d('0x0'));var util=require(_0xb22d('0x1'));var path=require(_0xb22d('0x2'));var timeout=require(_0xb22d('0x3'));var express=require('express');var router=express[_0xb22d('0x4')]();var auth=require(_0xb22d('0x5'));var interaction=require(_0xb22d('0x6'));var config=require(_0xb22d('0x7'));var controller=require(_0xb22d('0x8'));router['get']('/',auth[_0xb22d('0x9')](),controller[_0xb22d('0xa')]);router['get'](_0xb22d('0xb'),auth[_0xb22d('0x9')](),controller[_0xb22d('0xc')]);router[_0xb22d('0xd')](_0xb22d('0xe'),auth[_0xb22d('0x9')](),controller[_0xb22d('0xf')]);router[_0xb22d('0x10')]('/',auth[_0xb22d('0x9')](),controller['create']);router[_0xb22d('0x10')](_0xb22d('0xe'),auth[_0xb22d('0x9')](),controller[_0xb22d('0x11')]);router[_0xb22d('0x12')](_0xb22d('0xb'),auth[_0xb22d('0x9')](),controller['update']);router[_0xb22d('0x13')](_0xb22d('0xb'),auth[_0xb22d('0x9')](),controller[_0xb22d('0x14')]);router[_0xb22d('0x13')]('/:id/sounds/:id2',auth[_0xb22d('0x9')](),controller[_0xb22d('0x15')]);module[_0xb22d('0x16')]=router;
\ No newline at end of file
diff --git a/server/api/voiceMusicOnHold/voiceMusicOnHold.attributes.js b/server/api/voiceMusicOnHold/voiceMusicOnHold.attributes.js
index bb149b7..423a44b 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 _0x17f0=['mp3','BOOLEAN','sequelize','exports','STRING','mp3nb','quietmp3nb'];(function(_0x53bd19,_0x5ac623){var _0x5e856c=function(_0x60ae3f){while(--_0x60ae3f){_0x53bd19['push'](_0x53bd19['shift']());}};_0x5e856c(++_0x5ac623);}(_0x17f0,0x12f));var _0x017f=function(_0x565ed7,_0x398228){_0x565ed7=_0x565ed7-0x0;var _0x183ad7=_0x17f0[_0x565ed7];return _0x183ad7;};'use strict';var Sequelize=require(_0x017f('0x0'));module[_0x017f('0x1')]={'name':{'type':Sequelize[_0x017f('0x2')],'allowNull':![],'unique':'name'},'mode':{'type':Sequelize['ENUM']('custom','files',_0x017f('0x3'),_0x017f('0x4'),'quietmp3',_0x017f('0x5')),'allowNull':!![],'defaultValue':'files'},'directory':{'type':Sequelize[_0x017f('0x2')],'allowNull':!![]},'application':{'type':Sequelize['STRING'],'allowNull':!![]},'digit':{'type':Sequelize[_0x017f('0x2')],'allowNull':!![]},'sort':{'type':Sequelize[_0x017f('0x2')],'allowNull':!![],'defaultValue':'alpha'},'format':{'type':Sequelize[_0x017f('0x2')],'allowNull':!![]},'stamp':{'type':'TIMESTAMP'},'defaultEntry':{'type':Sequelize[_0x017f('0x6')],'defaultValue':0x0}};
\ No newline at end of file
+var _0x1331=['ENUM','custom','mp3nb','quietmp3','mp3','files','alpha','TIMESTAMP','BOOLEAN','sequelize','STRING'];(function(_0x3dd15e,_0x1f0015){var _0x231fd0=function(_0x4f680a){while(--_0x4f680a){_0x3dd15e['push'](_0x3dd15e['shift']());}};_0x231fd0(++_0x1f0015);}(_0x1331,0xae));var _0x1133=function(_0x398633,_0x34906d){_0x398633=_0x398633-0x0;var _0x3a7998=_0x1331[_0x398633];return _0x3a7998;};'use strict';var Sequelize=require(_0x1133('0x0'));module['exports']={'name':{'type':Sequelize[_0x1133('0x1')],'allowNull':![],'unique':'name'},'mode':{'type':Sequelize[_0x1133('0x2')](_0x1133('0x3'),'files',_0x1133('0x4'),'quietmp3nb',_0x1133('0x5'),_0x1133('0x6')),'allowNull':!![],'defaultValue':_0x1133('0x7')},'directory':{'type':Sequelize[_0x1133('0x1')],'allowNull':!![]},'application':{'type':Sequelize['STRING'],'allowNull':!![]},'digit':{'type':Sequelize['STRING'],'allowNull':!![]},'sort':{'type':Sequelize[_0x1133('0x1')],'allowNull':!![],'defaultValue':_0x1133('0x8')},'format':{'type':Sequelize[_0x1133('0x1')],'allowNull':!![]},'stamp':{'type':_0x1133('0x9')},'defaultEntry':{'type':Sequelize[_0x1133('0xa')],'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 c68b9dc..5f9f405 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 _0x18f1=['options','includeAll','findAll','rows','show','params','rawAttributes','include','find','catch','body','create','transaction','files','directory','join','root','mode','mkdirSync','0777','user','UserProfileSection','MusicOnHolds','userProfileId','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','readdirSync','forEach','unlinkSync','Sequelize','message','addSound','sequelize','Sound','findOne','save_name','converted_format','createdAt','server/files/sounds/converted','format','%s.%s','basename','extname','server/files/moh','removeSound','ValidationError','getSounds','html-pdf','eml-format','rimraf','fast-json-patch','request-promise','moment','bluebird','mustache','util','sox','to-csv','ejs','crypto','desk.js','querystring','papaparse','../../components/auth/service','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/utils','../../mysqldb','sendStatus','end','status','count','offset','set','Content-Range','apply','reject','update','then','destroy','get','UserProfileResource','error','stack','name','send','map','VoiceMusicOnHold','fieldName','key','model','query','keys','filters','intersection','attributes','fields','length','hasOwnProperty','nolimit','limit','order','sort','where','pick','filter','merge','type','VIRTUAL'];(function(_0x35a70a,_0x338e9e){var _0x254132=function(_0x3d09f6){while(--_0x3d09f6){_0x35a70a['push'](_0x35a70a['shift']());}};_0x254132(++_0x338e9e);}(_0x18f1,0x178));var _0x118f=function(_0x2be8c2,_0x14a4b5){_0x2be8c2=_0x2be8c2-0x0;var _0x97f531=_0x18f1[_0x2be8c2];return _0x97f531;};'use strict';var pdf=require(_0x118f('0x0'));var emlformat=require(_0x118f('0x1'));var rimraf=require(_0x118f('0x2'));var zipdir=require('zip-dir');var jsonpatch=require(_0x118f('0x3'));var rp=require(_0x118f('0x4'));var moment=require(_0x118f('0x5'));var BPromise=require(_0x118f('0x6'));var Mustache=require(_0x118f('0x7'));var util=require(_0x118f('0x8'));var path=require('path');var sox=require(_0x118f('0x9'));var csv=require(_0x118f('0xa'));var ejs=require(_0x118f('0xb'));var fs=require('fs');var _=require('lodash');var squel=require('squel');var crypto=require(_0x118f('0xc'));var jsforce=require('jsforce');var deskjs=require(_0x118f('0xd'));var toCsv=require(_0x118f('0xa'));var querystring=require(_0x118f('0xe'));var Papa=require(_0x118f('0xf'));var Redis=require('ioredis');var authService=require(_0x118f('0x10'));var qs=require('../../components/parsers/qs');var as=require(_0x118f('0x11'));var hardwareService=require(_0x118f('0x12'));var logger=require(_0x118f('0x13'))(_0x118f('0x14'));var utils=require(_0x118f('0x15'));var config=require('../../config/environment');var db=require(_0x118f('0x16'))['db'];function respondWithStatusCode(_0x34980f,_0x1f0cb1){_0x1f0cb1=_0x1f0cb1||0xcc;return function(_0x561cd4){if(_0x561cd4){return _0x34980f[_0x118f('0x17')](_0x1f0cb1);}return _0x34980f['status'](_0x1f0cb1)[_0x118f('0x18')]();};}function respondWithResult(_0x207a31,_0x4d87fd){_0x4d87fd=_0x4d87fd||0xc8;return function(_0xa9d87d){if(_0xa9d87d){return _0x207a31[_0x118f('0x19')](_0x4d87fd)['json'](_0xa9d87d);}};}function respondWithFilteredResult(_0x4121d6,_0x243a1a){return function(_0x3d6b62){if(_0x3d6b62){var _0x127537=_0x3d6b62[_0x118f('0x1a')],_0x3111d0=_0x243a1a[_0x118f('0x1b')],_0x39acb3=_0x243a1a[_0x118f('0x1b')]+_0x243a1a['limit'],_0x29e9d0;if(_0x39acb3>=_0x127537){_0x39acb3=_0x127537;_0x29e9d0=0xc8;}else{_0x29e9d0=0xce;}_0x4121d6[_0x118f('0x19')](_0x29e9d0);return _0x4121d6[_0x118f('0x1c')](_0x118f('0x1d'),_0x3111d0+'-'+_0x39acb3+'/'+_0x127537)['json'](_0x3d6b62);}return null;};}function patchUpdates(_0x5e5e41){return function(_0x3b3a0d){try{jsonpatch[_0x118f('0x1e')](_0x3b3a0d,_0x5e5e41,!![]);}catch(_0x453fda){return BPromise[_0x118f('0x1f')](_0x453fda);}return _0x3b3a0d['save']();};}function saveUpdates(_0x495ebd,_0x2e86b8){return function(_0x3585f4){if(_0x3585f4){return _0x3585f4[_0x118f('0x20')](_0x495ebd)[_0x118f('0x21')](function(_0x15ad41){return _0x15ad41;});}return null;};}function removeEntity(_0x551a3b,_0xdefb65){return function(_0x18b479){if(_0x18b479){return _0x18b479[_0x118f('0x22')]()[_0x118f('0x21')](function(){var _0xb47683=_0x18b479[_0x118f('0x23')]({'plain':!![]});var _0x5a3f00='MusicOnHolds';return db[_0x118f('0x24')][_0x118f('0x22')]({'where':{'type':_0x5a3f00,'resourceId':_0xb47683['id']}})[_0x118f('0x21')](function(){return _0x18b479;});})[_0x118f('0x21')](function(){_0x551a3b[_0x118f('0x19')](0xcc)['end']();});}};}function handleEntityNotFound(_0x4a3325,_0x554b6d){return function(_0x2e65ad){if(!_0x2e65ad){_0x4a3325['sendStatus'](0x194);}return _0x2e65ad;};}function handleError(_0x1ac6b0,_0x51acf4){_0x51acf4=_0x51acf4||0x1f4;return function(_0xcaa05b){logger[_0x118f('0x25')](_0xcaa05b[_0x118f('0x26')]);if(_0xcaa05b[_0x118f('0x27')]){delete _0xcaa05b[_0x118f('0x27')];}_0x1ac6b0[_0x118f('0x19')](_0x51acf4)[_0x118f('0x28')](_0xcaa05b);};}exports['index']=function(_0x231780,_0x15e8ba){var _0x22e4bd={},_0x28ff58={},_0x1b224b={'count':0x0,'rows':[]};var _0x358c58=_[_0x118f('0x29')](db[_0x118f('0x2a')]['rawAttributes'],function(_0x3b6f0d){return{'name':_0x3b6f0d[_0x118f('0x2b')],'type':_0x3b6f0d['type'][_0x118f('0x2c')]};});_0x28ff58[_0x118f('0x2d')]=_[_0x118f('0x29')](_0x358c58,_0x118f('0x27'));_0x28ff58[_0x118f('0x2e')]=_[_0x118f('0x2f')](_0x231780[_0x118f('0x2e')]);_0x28ff58[_0x118f('0x30')]=_[_0x118f('0x31')](_0x28ff58[_0x118f('0x2d')],_0x28ff58[_0x118f('0x2e')]);_0x22e4bd[_0x118f('0x32')]=_[_0x118f('0x31')](_0x28ff58[_0x118f('0x2d')],qs[_0x118f('0x33')](_0x231780['query'][_0x118f('0x33')]));_0x22e4bd['attributes']=_0x22e4bd['attributes'][_0x118f('0x34')]?_0x22e4bd['attributes']:_0x28ff58[_0x118f('0x2d')];if(!_0x231780['query'][_0x118f('0x35')](_0x118f('0x36'))){_0x22e4bd[_0x118f('0x37')]=qs[_0x118f('0x37')](_0x231780[_0x118f('0x2e')][_0x118f('0x37')]);_0x22e4bd[_0x118f('0x1b')]=qs[_0x118f('0x1b')](_0x231780[_0x118f('0x2e')][_0x118f('0x1b')]);}_0x22e4bd[_0x118f('0x38')]=qs[_0x118f('0x39')](_0x231780['query'][_0x118f('0x39')]);_0x22e4bd[_0x118f('0x3a')]=qs['filters'](_[_0x118f('0x3b')](_0x231780[_0x118f('0x2e')],_0x28ff58[_0x118f('0x30')]));if(_0x231780[_0x118f('0x2e')][_0x118f('0x3c')]){_0x22e4bd[_0x118f('0x3a')]=_[_0x118f('0x3d')](_0x22e4bd[_0x118f('0x3a')],{'$or':_['map'](_0x358c58,function(_0x7618c0){if(_0x7618c0[_0x118f('0x3e')]!==_0x118f('0x3f')){var _0x2b86b8={};_0x2b86b8[_0x7618c0[_0x118f('0x27')]]={'$like':'%'+_0x231780[_0x118f('0x2e')]['filter']+'%'};return _0x2b86b8;}})});}_0x22e4bd=_['merge']({},_0x22e4bd,_0x231780[_0x118f('0x40')]);var _0x29c50d={'where':_0x22e4bd[_0x118f('0x3a')]};return db[_0x118f('0x2a')][_0x118f('0x1a')](_0x29c50d)[_0x118f('0x21')](function(_0x4f3454){_0x1b224b[_0x118f('0x1a')]=_0x4f3454;if(_0x231780[_0x118f('0x2e')][_0x118f('0x41')]){_0x22e4bd['include']=[{'all':!![]}];}return db[_0x118f('0x2a')][_0x118f('0x42')](_0x22e4bd);})[_0x118f('0x21')](function(_0x3dc733){_0x1b224b[_0x118f('0x43')]=_0x3dc733;return _0x1b224b;})[_0x118f('0x21')](respondWithFilteredResult(_0x15e8ba,_0x22e4bd))['catch'](handleError(_0x15e8ba,null));};exports[_0x118f('0x44')]=function(_0x2f4732,_0x1078a4){var _0x23826c={'raw':![],'where':{'id':_0x2f4732[_0x118f('0x45')]['id']}},_0x51f931={};_0x51f931[_0x118f('0x2d')]=_[_0x118f('0x2f')](db['VoiceMusicOnHold'][_0x118f('0x46')]);_0x51f931['query']=_[_0x118f('0x2f')](_0x2f4732[_0x118f('0x2e')]);_0x51f931['filters']=_['intersection'](_0x51f931[_0x118f('0x2d')],_0x51f931['query']);_0x23826c['attributes']=_['intersection'](_0x51f931[_0x118f('0x2d')],qs['fields'](_0x2f4732[_0x118f('0x2e')][_0x118f('0x33')]));_0x23826c['attributes']=_0x23826c[_0x118f('0x32')]['length']?_0x23826c[_0x118f('0x32')]:_0x51f931[_0x118f('0x2d')];if(_0x2f4732[_0x118f('0x2e')]['includeAll']){_0x23826c[_0x118f('0x47')]=[{'all':!![]}];}_0x23826c=_[_0x118f('0x3d')]({},_0x23826c,_0x2f4732[_0x118f('0x40')]);return db[_0x118f('0x2a')][_0x118f('0x48')](_0x23826c)[_0x118f('0x21')](handleEntityNotFound(_0x1078a4,null))[_0x118f('0x21')](respondWithResult(_0x1078a4,null))[_0x118f('0x49')](handleError(_0x1078a4,null));};exports['update']=function(_0x501a07,_0x2164d1){if(_0x501a07[_0x118f('0x4a')]['id']){delete _0x501a07[_0x118f('0x4a')]['id'];}return db['VoiceMusicOnHold'][_0x118f('0x48')]({'where':{'id':_0x501a07[_0x118f('0x45')]['id']}})[_0x118f('0x21')](handleEntityNotFound(_0x2164d1,null))[_0x118f('0x21')](saveUpdates(_0x501a07[_0x118f('0x4a')],null))[_0x118f('0x21')](respondWithResult(_0x2164d1,null))[_0x118f('0x49')](handleError(_0x2164d1,null));};exports[_0x118f('0x4b')]=function(_0x31442f,_0x173074,_0x1e9395){return db['sequelize'][_0x118f('0x4c')](function(_0x2abea2){if(_0x31442f['body']['mode']===_0x118f('0x4d')){_0x31442f[_0x118f('0x4a')][_0x118f('0x4e')]=path[_0x118f('0x4f')](config[_0x118f('0x50')],'server/files/moh',_0x31442f[_0x118f('0x4a')][_0x118f('0x27')]);}return db[_0x118f('0x2a')][_0x118f('0x4b')](_0x31442f[_0x118f('0x4a')],{'transaction':_0x2abea2})[_0x118f('0x21')](function(_0x1330bd){if(_0x31442f[_0x118f('0x4a')][_0x118f('0x51')]===_0x118f('0x4d')){fs[_0x118f('0x52')](_0x1330bd['directory'],parseInt(_0x118f('0x53'),0x8));}var _0x25e084=_0x31442f['user'][_0x118f('0x23')]({'plain':!![]});if(!_0x25e084)throw new Error('Unable\x20to\x20retrieve\x20the\x20current\x20user');if(_0x25e084['role']===_0x118f('0x54')){var _0x493fbb=_0x1330bd['get']({'plain':!![]});return db[_0x118f('0x55')][_0x118f('0x48')]({'where':{'name':_0x118f('0x56'),'userProfileId':_0x25e084[_0x118f('0x57')]},'raw':!![]})[_0x118f('0x21')](function(_0x1cf90d){if(_0x1cf90d&&_0x1cf90d['autoAssociation']===0x0){return db[_0x118f('0x24')][_0x118f('0x4b')]({'name':_0x493fbb[_0x118f('0x27')],'resourceId':_0x493fbb['id'],'type':_0x1cf90d[_0x118f('0x27')],'sectionId':_0x1cf90d['id']},{})[_0x118f('0x21')](function(){return _0x1330bd;});}else{return _0x1330bd;}})[_0x118f('0x49')](function(_0x24174e){logger[_0x118f('0x25')](_0x118f('0x58'),_0x24174e);});}return _0x1330bd;});})[_0x118f('0x21')](respondWithResult(_0x173074,0xc9))['catch'](handleError(_0x173074,null));};exports['destroy']=function(_0x3fa111,_0x36d1a8,_0x5fb785){var _0x276b4e;return db[_0x118f('0x2a')][_0x118f('0x48')]({'where':{'id':_0x3fa111[_0x118f('0x45')]['id']}})['then'](function(_0x2c2aa5){if(_0x2c2aa5){return db['sequelize'][_0x118f('0x4c')](function(_0x330d7a){return _0x2c2aa5[_0x118f('0x22')]({'transaction':_0x330d7a,'raw':!![]})['then'](function(_0x3378d9){if(_0x3378d9[_0x118f('0x4e')]){fs[_0x118f('0x59')](_0x3378d9[_0x118f('0x4e')])[_0x118f('0x5a')](function(_0x14f1c8){fs[_0x118f('0x5b')](path[_0x118f('0x4f')](_0x3378d9[_0x118f('0x4e')],_0x14f1c8));});fs['rmdirSync'](_0x3378d9['directory']);}return _0x3378d9;});})[_0x118f('0x49')](function(_0x2e9aaa){throw new db[(_0x118f('0x5c'))]['ValidationError'](_0x2e9aaa[_0x118f('0x5d')]);});}})[_0x118f('0x21')](handleEntityNotFound(_0x36d1a8,null))[_0x118f('0x21')](removeEntity(_0x36d1a8,null))[_0x118f('0x49')](handleError(_0x36d1a8,null));};exports[_0x118f('0x5e')]=function(_0x49fd79,_0x1556f0,_0x210acc){return db[_0x118f('0x5f')]['transaction'](function(_0x171e45){var _0x55b458;return db[_0x118f('0x2a')][_0x118f('0x48')]({'where':{'id':_0x49fd79['params']['id']}})['then'](function(_0x117d12){if(_0x117d12){_0x55b458=_0x117d12;return _0x117d12[_0x118f('0x5e')](_0x49fd79[_0x118f('0x4a')]['id'],{'transaction':_0x171e45});}})[_0x118f('0x21')](function(_0x1ccda3){if(_0x1ccda3){return db[_0x118f('0x60')][_0x118f('0x61')]({'where':{'id':_0x49fd79[_0x118f('0x4a')]['id']},'attributes':['id','name',_0x118f('0x62'),_0x118f('0x63'),_0x118f('0x64')],'raw':!![]});}})[_0x118f('0x21')](function(_0x1295d5){if(_0x1295d5){var _0x23f0df=path['join'](config[_0x118f('0x50')],_0x118f('0x65'),util[_0x118f('0x66')](_0x118f('0x67'),path[_0x118f('0x68')](_0x1295d5[_0x118f('0x62')],path[_0x118f('0x69')](_0x1295d5[_0x118f('0x62')])),_0x1295d5['converted_format']));var _0x535075=path['join'](config[_0x118f('0x50')],_0x118f('0x6a'),_0x55b458[_0x118f('0x27')],util['format'](_0x118f('0x67'),_0x1295d5[_0x118f('0x27')],_0x1295d5[_0x118f('0x63')]));fs['symlinkSync'](_0x23f0df,_0x535075);return _0x1295d5;}})['catch'](function(_0x161c48){throw new db['Sequelize']['ValidationError'](_0x161c48[_0x118f('0x5d')]);});})[_0x118f('0x21')](handleEntityNotFound(_0x1556f0,null))['then'](respondWithResult(_0x1556f0,0xc9))[_0x118f('0x49')](handleError(_0x1556f0,null));};exports['removeSound']=function(_0x5bddb8,_0x580b89,_0x334558){return db[_0x118f('0x5f')][_0x118f('0x4c')](function(_0xe0f365){var _0x2c7510;return db['VoiceMusicOnHold'][_0x118f('0x61')]({'where':{'id':_0x5bddb8[_0x118f('0x45')]['id']}})[_0x118f('0x21')](handleEntityNotFound(_0x580b89,null))[_0x118f('0x21')](function(_0x230797){if(_0x230797){_0x2c7510=_0x230797;return _0x230797[_0x118f('0x6b')](_0x5bddb8['params']['id2']);}})[_0x118f('0x21')](function(_0x3746e1){if(_0x3746e1){return db[_0x118f('0x60')]['findOne']({'where':{'id':_0x5bddb8[_0x118f('0x45')]['id2']},'attributes':['id',_0x118f('0x27'),'save_name',_0x118f('0x63'),'createdAt'],'raw':!![]});}})[_0x118f('0x21')](function(_0x4a8ce2){if(_0x4a8ce2){fs[_0x118f('0x5b')](path[_0x118f('0x4f')](_0x2c7510['directory'],util[_0x118f('0x66')](_0x118f('0x67'),_0x4a8ce2['name'],_0x4a8ce2[_0x118f('0x63')])));return _0x4a8ce2;}})[_0x118f('0x49')](function(_0x4e4f54){throw new db[(_0x118f('0x5c'))][(_0x118f('0x6c'))](_0x4e4f54[_0x118f('0x5d')]);});})['then'](handleEntityNotFound(_0x580b89,null))[_0x118f('0x21')](respondWithStatusCode(_0x580b89,0xcc))[_0x118f('0x49')](handleError(_0x580b89,null));};exports[_0x118f('0x6d')]=function(_0x5da750,_0x4a1f3b,_0x4afa83){var _0x2310fe={};var _0x2d6705={};var _0x14b725;var _0x2ffa12;return db[_0x118f('0x2a')]['findOne']({'where':{'id':_0x5da750[_0x118f('0x45')]['id']}})[_0x118f('0x21')](handleEntityNotFound(_0x4a1f3b,null))[_0x118f('0x21')](function(_0x143162){if(_0x143162){_0x14b725=_0x143162;_0x2d6705[_0x118f('0x2d')]=_[_0x118f('0x2f')](db['Sound'][_0x118f('0x46')]);_0x2d6705['query']=_[_0x118f('0x2f')](_0x5da750[_0x118f('0x2e')]);_0x2d6705[_0x118f('0x30')]=_[_0x118f('0x31')](_0x2d6705['model'],_0x2d6705[_0x118f('0x2e')]);_0x2310fe[_0x118f('0x32')]=_['intersection'](_0x2d6705[_0x118f('0x2d')],qs[_0x118f('0x33')](_0x5da750[_0x118f('0x2e')]['fields']));_0x2310fe['attributes']=_0x2310fe[_0x118f('0x32')][_0x118f('0x34')]?_0x2310fe[_0x118f('0x32')]:_0x2d6705[_0x118f('0x2d')];_0x2310fe[_0x118f('0x38')]=qs['sort'](_0x5da750[_0x118f('0x2e')][_0x118f('0x39')]);_0x2310fe['where']=qs['filters'](_['pick'](_0x5da750[_0x118f('0x2e')],_0x2d6705[_0x118f('0x30')]));if(_0x5da750[_0x118f('0x2e')][_0x118f('0x3c')]){_0x2310fe[_0x118f('0x3a')]=_[_0x118f('0x3d')](_0x2310fe['where'],{'$or':_[_0x118f('0x29')](_0x2310fe[_0x118f('0x32')],function(_0x5c2ad8){var _0x4b4b40={};_0x4b4b40[_0x5c2ad8]={'$like':'%'+_0x5da750[_0x118f('0x2e')][_0x118f('0x3c')]+'%'};return _0x4b4b40;})});}_0x2310fe=_[_0x118f('0x3d')]({},_0x2310fe,_0x5da750[_0x118f('0x40')]);return _0x14b725[_0x118f('0x6d')](_0x2310fe);}})[_0x118f('0x21')](function(_0x890e5){if(_0x890e5){_0x2ffa12=_0x890e5[_0x118f('0x34')];if(!_0x5da750[_0x118f('0x2e')][_0x118f('0x35')]('nolimit')){_0x2310fe[_0x118f('0x37')]=qs[_0x118f('0x37')](_0x5da750[_0x118f('0x2e')]['limit']);_0x2310fe['offset']=qs['offset'](_0x5da750['query'][_0x118f('0x1b')]);}return _0x14b725[_0x118f('0x6d')](_0x2310fe);}})[_0x118f('0x21')](function(_0x31ea4b){if(_0x31ea4b){return _0x31ea4b?{'count':_0x2ffa12,'rows':_0x31ea4b}:null;}})[_0x118f('0x21')](respondWithResult(_0x4a1f3b,null))['catch'](handleError(_0x4a1f3b,null));};
\ No newline at end of file
+var _0x46bc=['query','attributes','fields','hasOwnProperty','nolimit','order','sort','where','pick','merge','type','VIRTUAL','options','include','findAll','rows','show','params','length','includeAll','find','catch','body','create','sequelize','mode','files','directory','root','server/files/moh','mkdirSync','0777','user','get','Unable\x20to\x20retrieve\x20the\x20current\x20user','UserProfileSection','userProfileId','autoAssociation','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','transaction','readdirSync','forEach','unlinkSync','join','rmdirSync','Sequelize','ValidationError','message','addSound','findOne','save_name','createdAt','server/files/sounds/converted','%s.%s','basename','extname','converted_format','format','symlinkSync','removeSound','id2','Sound','filter','getSounds','html-pdf','rimraf','fast-json-patch','request-promise','moment','bluebird','util','sox','to-csv','ejs','crypto','jsforce','querystring','papaparse','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/logger','api','../../config/environment','sendStatus','status','count','offset','limit','set','Content-Range','apply','reject','save','update','then','destroy','MusicOnHolds','UserProfileResource','end','error','stack','name','send','index','VoiceMusicOnHold','rawAttributes','fieldName','key','model','map','keys','filters','intersection'];(function(_0x26c9d2,_0x1186f5){var _0x305623=function(_0x2c64cc){while(--_0x2c64cc){_0x26c9d2['push'](_0x26c9d2['shift']());}};_0x305623(++_0x1186f5);}(_0x46bc,0x196));var _0xc46b=function(_0x4702ee,_0xaf6a45){_0x4702ee=_0x4702ee-0x0;var _0x62ca7d=_0x46bc[_0x4702ee];return _0x62ca7d;};'use strict';var pdf=require(_0xc46b('0x0'));var emlformat=require('eml-format');var rimraf=require(_0xc46b('0x1'));var zipdir=require('zip-dir');var jsonpatch=require(_0xc46b('0x2'));var rp=require(_0xc46b('0x3'));var moment=require(_0xc46b('0x4'));var BPromise=require(_0xc46b('0x5'));var Mustache=require('mustache');var util=require(_0xc46b('0x6'));var path=require('path');var sox=require(_0xc46b('0x7'));var csv=require(_0xc46b('0x8'));var ejs=require(_0xc46b('0x9'));var fs=require('fs');var _=require('lodash');var squel=require('squel');var crypto=require(_0xc46b('0xa'));var jsforce=require(_0xc46b('0xb'));var deskjs=require('desk.js');var toCsv=require(_0xc46b('0x8'));var querystring=require(_0xc46b('0xc'));var Papa=require(_0xc46b('0xd'));var Redis=require('ioredis');var authService=require(_0xc46b('0xe'));var qs=require(_0xc46b('0xf'));var as=require(_0xc46b('0x10'));var hardwareService=require('../../config/license/hardware');var logger=require(_0xc46b('0x11'))(_0xc46b('0x12'));var utils=require('../../config/utils');var config=require(_0xc46b('0x13'));var db=require('../../mysqldb')['db'];function respondWithStatusCode(_0x7cdf80,_0xa039b1){_0xa039b1=_0xa039b1||0xcc;return function(_0xcf66ce){if(_0xcf66ce){return _0x7cdf80[_0xc46b('0x14')](_0xa039b1);}return _0x7cdf80['status'](_0xa039b1)['end']();};}function respondWithResult(_0x3a008d,_0x25a01d){_0x25a01d=_0x25a01d||0xc8;return function(_0x68aafb){if(_0x68aafb){return _0x3a008d[_0xc46b('0x15')](_0x25a01d)['json'](_0x68aafb);}};}function respondWithFilteredResult(_0x547350,_0x6ffa80){return function(_0x31e2b5){if(_0x31e2b5){var _0xa5cebb=_0x31e2b5[_0xc46b('0x16')],_0x1e223a=_0x6ffa80[_0xc46b('0x17')],_0xd4b513=_0x6ffa80[_0xc46b('0x17')]+_0x6ffa80[_0xc46b('0x18')],_0xe22a36;if(_0xd4b513>=_0xa5cebb){_0xd4b513=_0xa5cebb;_0xe22a36=0xc8;}else{_0xe22a36=0xce;}_0x547350[_0xc46b('0x15')](_0xe22a36);return _0x547350[_0xc46b('0x19')](_0xc46b('0x1a'),_0x1e223a+'-'+_0xd4b513+'/'+_0xa5cebb)['json'](_0x31e2b5);}return null;};}function patchUpdates(_0x1efe17){return function(_0x1f01db){try{jsonpatch[_0xc46b('0x1b')](_0x1f01db,_0x1efe17,!![]);}catch(_0x4e61b6){return BPromise[_0xc46b('0x1c')](_0x4e61b6);}return _0x1f01db[_0xc46b('0x1d')]();};}function saveUpdates(_0x52f2c4,_0x34a32a){return function(_0x1aba5f){if(_0x1aba5f){return _0x1aba5f[_0xc46b('0x1e')](_0x52f2c4)[_0xc46b('0x1f')](function(_0x4bfd16){return _0x4bfd16;});}return null;};}function removeEntity(_0x4cd1f9,_0xb0f04c){return function(_0x5cf486){if(_0x5cf486){return _0x5cf486[_0xc46b('0x20')]()[_0xc46b('0x1f')](function(){var _0x30c356=_0x5cf486['get']({'plain':!![]});var _0x4aa401=_0xc46b('0x21');return db[_0xc46b('0x22')][_0xc46b('0x20')]({'where':{'type':_0x4aa401,'resourceId':_0x30c356['id']}})[_0xc46b('0x1f')](function(){return _0x5cf486;});})['then'](function(){_0x4cd1f9['status'](0xcc)[_0xc46b('0x23')]();});}};}function handleEntityNotFound(_0x12eea3,_0x43cb8f){return function(_0x2d0b36){if(!_0x2d0b36){_0x12eea3['sendStatus'](0x194);}return _0x2d0b36;};}function handleError(_0x2610c9,_0x56defe){_0x56defe=_0x56defe||0x1f4;return function(_0x37f0ea){logger[_0xc46b('0x24')](_0x37f0ea[_0xc46b('0x25')]);if(_0x37f0ea[_0xc46b('0x26')]){delete _0x37f0ea[_0xc46b('0x26')];}_0x2610c9[_0xc46b('0x15')](_0x56defe)[_0xc46b('0x27')](_0x37f0ea);};}exports[_0xc46b('0x28')]=function(_0x38371d,_0x525fc7){var _0x16b251={},_0x366639={},_0x66c65f={'count':0x0,'rows':[]};var _0x5a121e=_['map'](db[_0xc46b('0x29')][_0xc46b('0x2a')],function(_0x2f35e0){return{'name':_0x2f35e0[_0xc46b('0x2b')],'type':_0x2f35e0['type'][_0xc46b('0x2c')]};});_0x366639[_0xc46b('0x2d')]=_[_0xc46b('0x2e')](_0x5a121e,_0xc46b('0x26'));_0x366639['query']=_[_0xc46b('0x2f')](_0x38371d['query']);_0x366639[_0xc46b('0x30')]=_[_0xc46b('0x31')](_0x366639[_0xc46b('0x2d')],_0x366639[_0xc46b('0x32')]);_0x16b251[_0xc46b('0x33')]=_['intersection'](_0x366639[_0xc46b('0x2d')],qs[_0xc46b('0x34')](_0x38371d['query'][_0xc46b('0x34')]));_0x16b251[_0xc46b('0x33')]=_0x16b251[_0xc46b('0x33')]['length']?_0x16b251[_0xc46b('0x33')]:_0x366639[_0xc46b('0x2d')];if(!_0x38371d[_0xc46b('0x32')][_0xc46b('0x35')](_0xc46b('0x36'))){_0x16b251[_0xc46b('0x18')]=qs[_0xc46b('0x18')](_0x38371d[_0xc46b('0x32')]['limit']);_0x16b251[_0xc46b('0x17')]=qs[_0xc46b('0x17')](_0x38371d[_0xc46b('0x32')]['offset']);}_0x16b251[_0xc46b('0x37')]=qs[_0xc46b('0x38')](_0x38371d[_0xc46b('0x32')][_0xc46b('0x38')]);_0x16b251[_0xc46b('0x39')]=qs[_0xc46b('0x30')](_[_0xc46b('0x3a')](_0x38371d['query'],_0x366639[_0xc46b('0x30')]));if(_0x38371d['query']['filter']){_0x16b251['where']=_[_0xc46b('0x3b')](_0x16b251[_0xc46b('0x39')],{'$or':_[_0xc46b('0x2e')](_0x5a121e,function(_0x5c4783){if(_0x5c4783[_0xc46b('0x3c')]!==_0xc46b('0x3d')){var _0x4c50b5={};_0x4c50b5[_0x5c4783[_0xc46b('0x26')]]={'$like':'%'+_0x38371d[_0xc46b('0x32')]['filter']+'%'};return _0x4c50b5;}})});}_0x16b251=_[_0xc46b('0x3b')]({},_0x16b251,_0x38371d[_0xc46b('0x3e')]);var _0x319cf8={'where':_0x16b251['where']};return db[_0xc46b('0x29')][_0xc46b('0x16')](_0x319cf8)[_0xc46b('0x1f')](function(_0x870448){_0x66c65f[_0xc46b('0x16')]=_0x870448;if(_0x38371d[_0xc46b('0x32')]['includeAll']){_0x16b251[_0xc46b('0x3f')]=[{'all':!![]}];}return db['VoiceMusicOnHold'][_0xc46b('0x40')](_0x16b251);})['then'](function(_0x411a44){_0x66c65f[_0xc46b('0x41')]=_0x411a44;return _0x66c65f;})['then'](respondWithFilteredResult(_0x525fc7,_0x16b251))['catch'](handleError(_0x525fc7,null));};exports[_0xc46b('0x42')]=function(_0x2e1b4b,_0x2e0082){var _0x131997={'raw':![],'where':{'id':_0x2e1b4b[_0xc46b('0x43')]['id']}},_0x875947={};_0x875947['model']=_[_0xc46b('0x2f')](db['VoiceMusicOnHold'][_0xc46b('0x2a')]);_0x875947[_0xc46b('0x32')]=_[_0xc46b('0x2f')](_0x2e1b4b['query']);_0x875947['filters']=_['intersection'](_0x875947['model'],_0x875947['query']);_0x131997[_0xc46b('0x33')]=_[_0xc46b('0x31')](_0x875947[_0xc46b('0x2d')],qs[_0xc46b('0x34')](_0x2e1b4b[_0xc46b('0x32')][_0xc46b('0x34')]));_0x131997['attributes']=_0x131997[_0xc46b('0x33')][_0xc46b('0x44')]?_0x131997[_0xc46b('0x33')]:_0x875947[_0xc46b('0x2d')];if(_0x2e1b4b['query'][_0xc46b('0x45')]){_0x131997['include']=[{'all':!![]}];}_0x131997=_[_0xc46b('0x3b')]({},_0x131997,_0x2e1b4b[_0xc46b('0x3e')]);return db[_0xc46b('0x29')][_0xc46b('0x46')](_0x131997)['then'](handleEntityNotFound(_0x2e0082,null))[_0xc46b('0x1f')](respondWithResult(_0x2e0082,null))[_0xc46b('0x47')](handleError(_0x2e0082,null));};exports[_0xc46b('0x1e')]=function(_0x2a82dc,_0x17e83a){if(_0x2a82dc[_0xc46b('0x48')]['id']){delete _0x2a82dc[_0xc46b('0x48')]['id'];}return db[_0xc46b('0x29')][_0xc46b('0x46')]({'where':{'id':_0x2a82dc['params']['id']}})['then'](handleEntityNotFound(_0x17e83a,null))[_0xc46b('0x1f')](saveUpdates(_0x2a82dc[_0xc46b('0x48')],null))[_0xc46b('0x1f')](respondWithResult(_0x17e83a,null))[_0xc46b('0x47')](handleError(_0x17e83a,null));};exports[_0xc46b('0x49')]=function(_0xb1c548,_0x3b9f69,_0x47ac44){return db[_0xc46b('0x4a')]['transaction'](function(_0x550f17){if(_0xb1c548[_0xc46b('0x48')][_0xc46b('0x4b')]===_0xc46b('0x4c')){_0xb1c548[_0xc46b('0x48')][_0xc46b('0x4d')]=path['join'](config[_0xc46b('0x4e')],_0xc46b('0x4f'),_0xb1c548[_0xc46b('0x48')][_0xc46b('0x26')]);}return db['VoiceMusicOnHold']['create'](_0xb1c548['body'],{'transaction':_0x550f17})[_0xc46b('0x1f')](function(_0x57c547){if(_0xb1c548[_0xc46b('0x48')][_0xc46b('0x4b')]===_0xc46b('0x4c')){fs[_0xc46b('0x50')](_0x57c547['directory'],parseInt(_0xc46b('0x51'),0x8));}var _0x103a3f=_0xb1c548[_0xc46b('0x52')][_0xc46b('0x53')]({'plain':!![]});if(!_0x103a3f)throw new Error(_0xc46b('0x54'));if(_0x103a3f['role']===_0xc46b('0x52')){var _0x5bcef4=_0x57c547[_0xc46b('0x53')]({'plain':!![]});return db[_0xc46b('0x55')][_0xc46b('0x46')]({'where':{'name':_0xc46b('0x21'),'userProfileId':_0x103a3f[_0xc46b('0x56')]},'raw':!![]})[_0xc46b('0x1f')](function(_0x2d90df){if(_0x2d90df&&_0x2d90df[_0xc46b('0x57')]===0x0){return db['UserProfileResource']['create']({'name':_0x5bcef4[_0xc46b('0x26')],'resourceId':_0x5bcef4['id'],'type':_0x2d90df[_0xc46b('0x26')],'sectionId':_0x2d90df['id']},{})[_0xc46b('0x1f')](function(){return _0x57c547;});}else{return _0x57c547;}})[_0xc46b('0x47')](function(_0x2e18bc){logger[_0xc46b('0x24')](_0xc46b('0x58'),_0x2e18bc);});}return _0x57c547;});})[_0xc46b('0x1f')](respondWithResult(_0x3b9f69,0xc9))[_0xc46b('0x47')](handleError(_0x3b9f69,null));};exports[_0xc46b('0x20')]=function(_0x437f76,_0x5bded4,_0x4270d8){var _0xe94455;return db[_0xc46b('0x29')][_0xc46b('0x46')]({'where':{'id':_0x437f76[_0xc46b('0x43')]['id']}})[_0xc46b('0x1f')](function(_0xe2e902){if(_0xe2e902){return db['sequelize'][_0xc46b('0x59')](function(_0x31ed9b){return _0xe2e902[_0xc46b('0x20')]({'transaction':_0x31ed9b,'raw':!![]})[_0xc46b('0x1f')](function(_0x27ac95){if(_0x27ac95[_0xc46b('0x4d')]){fs[_0xc46b('0x5a')](_0x27ac95[_0xc46b('0x4d')])[_0xc46b('0x5b')](function(_0x3725f1){fs[_0xc46b('0x5c')](path[_0xc46b('0x5d')](_0x27ac95['directory'],_0x3725f1));});fs[_0xc46b('0x5e')](_0x27ac95[_0xc46b('0x4d')]);}return _0x27ac95;});})[_0xc46b('0x47')](function(_0x578133){throw new db[(_0xc46b('0x5f'))][(_0xc46b('0x60'))](_0x578133[_0xc46b('0x61')]);});}})['then'](handleEntityNotFound(_0x5bded4,null))['then'](removeEntity(_0x5bded4,null))[_0xc46b('0x47')](handleError(_0x5bded4,null));};exports['addSound']=function(_0x45598c,_0x3ad42b,_0x45ca47){return db['sequelize'][_0xc46b('0x59')](function(_0x587920){var _0x500000;return db[_0xc46b('0x29')][_0xc46b('0x46')]({'where':{'id':_0x45598c['params']['id']}})[_0xc46b('0x1f')](function(_0x22f449){if(_0x22f449){_0x500000=_0x22f449;return _0x22f449[_0xc46b('0x62')](_0x45598c[_0xc46b('0x48')]['id'],{'transaction':_0x587920});}})['then'](function(_0x4659c0){if(_0x4659c0){return db['Sound'][_0xc46b('0x63')]({'where':{'id':_0x45598c['body']['id']},'attributes':['id',_0xc46b('0x26'),_0xc46b('0x64'),'converted_format',_0xc46b('0x65')],'raw':!![]});}})[_0xc46b('0x1f')](function(_0x5e150e){if(_0x5e150e){var _0x4740b4=path[_0xc46b('0x5d')](config[_0xc46b('0x4e')],_0xc46b('0x66'),util['format'](_0xc46b('0x67'),path[_0xc46b('0x68')](_0x5e150e['save_name'],path[_0xc46b('0x69')](_0x5e150e['save_name'])),_0x5e150e[_0xc46b('0x6a')]));var _0x138337=path[_0xc46b('0x5d')](config[_0xc46b('0x4e')],'server/files/moh',_0x500000['name'],util[_0xc46b('0x6b')](_0xc46b('0x67'),_0x5e150e[_0xc46b('0x26')],_0x5e150e['converted_format']));fs[_0xc46b('0x6c')](_0x4740b4,_0x138337);return _0x5e150e;}})['catch'](function(_0x54fb5e){throw new db[(_0xc46b('0x5f'))][(_0xc46b('0x60'))](_0x54fb5e[_0xc46b('0x61')]);});})[_0xc46b('0x1f')](handleEntityNotFound(_0x3ad42b,null))[_0xc46b('0x1f')](respondWithResult(_0x3ad42b,0xc9))[_0xc46b('0x47')](handleError(_0x3ad42b,null));};exports[_0xc46b('0x6d')]=function(_0x317300,_0x5d9a1a,_0x8aa7b9){return db['sequelize'][_0xc46b('0x59')](function(_0x2a5ea3){var _0xd6d41b;return db[_0xc46b('0x29')][_0xc46b('0x63')]({'where':{'id':_0x317300[_0xc46b('0x43')]['id']}})[_0xc46b('0x1f')](handleEntityNotFound(_0x5d9a1a,null))['then'](function(_0x589703){if(_0x589703){_0xd6d41b=_0x589703;return _0x589703[_0xc46b('0x6d')](_0x317300[_0xc46b('0x43')][_0xc46b('0x6e')]);}})['then'](function(_0x467e1c){if(_0x467e1c){return db[_0xc46b('0x6f')][_0xc46b('0x63')]({'where':{'id':_0x317300[_0xc46b('0x43')][_0xc46b('0x6e')]},'attributes':['id','name','save_name',_0xc46b('0x6a'),_0xc46b('0x65')],'raw':!![]});}})[_0xc46b('0x1f')](function(_0x39b5eb){if(_0x39b5eb){fs[_0xc46b('0x5c')](path[_0xc46b('0x5d')](_0xd6d41b[_0xc46b('0x4d')],util['format'](_0xc46b('0x67'),_0x39b5eb[_0xc46b('0x26')],_0x39b5eb[_0xc46b('0x6a')])));return _0x39b5eb;}})[_0xc46b('0x47')](function(_0x1462f7){throw new db['Sequelize'][(_0xc46b('0x60'))](_0x1462f7['message']);});})[_0xc46b('0x1f')](handleEntityNotFound(_0x5d9a1a,null))['then'](respondWithStatusCode(_0x5d9a1a,0xcc))['catch'](handleError(_0x5d9a1a,null));};exports['getSounds']=function(_0x153a32,_0x29621e,_0x36fb54){var _0x585e9c={};var _0x2ce21d={};var _0x458548;var _0x588fda;return db[_0xc46b('0x29')]['findOne']({'where':{'id':_0x153a32[_0xc46b('0x43')]['id']}})[_0xc46b('0x1f')](handleEntityNotFound(_0x29621e,null))[_0xc46b('0x1f')](function(_0x11066a){if(_0x11066a){_0x458548=_0x11066a;_0x2ce21d[_0xc46b('0x2d')]=_[_0xc46b('0x2f')](db['Sound']['rawAttributes']);_0x2ce21d[_0xc46b('0x32')]=_[_0xc46b('0x2f')](_0x153a32[_0xc46b('0x32')]);_0x2ce21d[_0xc46b('0x30')]=_[_0xc46b('0x31')](_0x2ce21d[_0xc46b('0x2d')],_0x2ce21d[_0xc46b('0x32')]);_0x585e9c[_0xc46b('0x33')]=_[_0xc46b('0x31')](_0x2ce21d[_0xc46b('0x2d')],qs['fields'](_0x153a32['query'][_0xc46b('0x34')]));_0x585e9c[_0xc46b('0x33')]=_0x585e9c['attributes'][_0xc46b('0x44')]?_0x585e9c[_0xc46b('0x33')]:_0x2ce21d[_0xc46b('0x2d')];_0x585e9c[_0xc46b('0x37')]=qs[_0xc46b('0x38')](_0x153a32['query'][_0xc46b('0x38')]);_0x585e9c['where']=qs[_0xc46b('0x30')](_['pick'](_0x153a32[_0xc46b('0x32')],_0x2ce21d[_0xc46b('0x30')]));if(_0x153a32[_0xc46b('0x32')][_0xc46b('0x70')]){_0x585e9c[_0xc46b('0x39')]=_['merge'](_0x585e9c[_0xc46b('0x39')],{'$or':_[_0xc46b('0x2e')](_0x585e9c[_0xc46b('0x33')],function(_0x3043b0){var _0x189b9f={};_0x189b9f[_0x3043b0]={'$like':'%'+_0x153a32[_0xc46b('0x32')][_0xc46b('0x70')]+'%'};return _0x189b9f;})});}_0x585e9c=_[_0xc46b('0x3b')]({},_0x585e9c,_0x153a32[_0xc46b('0x3e')]);return _0x458548[_0xc46b('0x71')](_0x585e9c);}})['then'](function(_0x39bed6){if(_0x39bed6){_0x588fda=_0x39bed6['length'];if(!_0x153a32[_0xc46b('0x32')][_0xc46b('0x35')](_0xc46b('0x36'))){_0x585e9c[_0xc46b('0x18')]=qs[_0xc46b('0x18')](_0x153a32[_0xc46b('0x32')][_0xc46b('0x18')]);_0x585e9c[_0xc46b('0x17')]=qs[_0xc46b('0x17')](_0x153a32['query'][_0xc46b('0x17')]);}return _0x458548[_0xc46b('0x71')](_0x585e9c);}})[_0xc46b('0x1f')](function(_0x14f50a){if(_0x14f50a){return _0x14f50a?{'count':_0x588fda,'rows':_0x14f50a}:null;}})[_0xc46b('0x1f')](respondWithResult(_0x29621e,null))[_0xc46b('0x47')](handleError(_0x29621e,null));};
\ No newline at end of file
diff --git a/server/api/voiceMusicOnHold/voiceMusicOnHold.model.js b/server/api/voiceMusicOnHold/voiceMusicOnHold.model.js
index 4dced1d..5bb229d 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 _0x25e6=['./voiceMusicOnHold.attributes','exports','VoiceMusicOnHold','voice_musiconhold','lodash','util','../../config/logger','bluebird','request-promise','path','rimraf','../../config/environment'];(function(_0x435fa1,_0x58550a){var _0x845f9f=function(_0x89867e){while(--_0x89867e){_0x435fa1['push'](_0x435fa1['shift']());}};_0x845f9f(++_0x58550a);}(_0x25e6,0x1d8));var _0x625e=function(_0x4c6c67,_0x3c104a){_0x4c6c67=_0x4c6c67-0x0;var _0xbaf49d=_0x25e6[_0x4c6c67];return _0xbaf49d;};'use strict';var _=require(_0x625e('0x0'));var util=require(_0x625e('0x1'));var logger=require(_0x625e('0x2'))('api');var moment=require('moment');var BPromise=require(_0x625e('0x3'));var rp=require(_0x625e('0x4'));var fs=require('fs');var path=require(_0x625e('0x5'));var rimraf=require(_0x625e('0x6'));var config=require(_0x625e('0x7'));var attributes=require(_0x625e('0x8'));module[_0x625e('0x9')]=function(_0x3d012a,_0x1ed209){return _0x3d012a['define'](_0x625e('0xa'),attributes,{'tableName':_0x625e('0xb'),'paranoid':![],'indexes':[],'timestamps':!![]});};
\ No newline at end of file
+var _0x579f=['exports','define','voice_musiconhold','lodash','util','api','moment','bluebird','request-promise','path','../../config/environment'];(function(_0x2e06ab,_0x444394){var _0x6138d3=function(_0x26b147){while(--_0x26b147){_0x2e06ab['push'](_0x2e06ab['shift']());}};_0x6138d3(++_0x444394);}(_0x579f,0x10b));var _0xf579=function(_0x3b4324,_0x5a06cd){_0x3b4324=_0x3b4324-0x0;var _0x51bb2d=_0x579f[_0x3b4324];return _0x51bb2d;};'use strict';var _=require(_0xf579('0x0'));var util=require(_0xf579('0x1'));var logger=require('../../config/logger')(_0xf579('0x2'));var moment=require(_0xf579('0x3'));var BPromise=require(_0xf579('0x4'));var rp=require(_0xf579('0x5'));var fs=require('fs');var path=require(_0xf579('0x6'));var rimraf=require('rimraf');var config=require(_0xf579('0x7'));var attributes=require('./voiceMusicOnHold.attributes');module[_0xf579('0x8')]=function(_0x2e0d23,_0x4508bc){return _0x2e0d23[_0xf579('0x9')]('VoiceMusicOnHold',attributes,{'tableName':_0xf579('0xa'),'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 260cf19..2b83b06 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 _0xca9c=['request','then','info','VoiceMusicOnHold,\x20%s,\x20%s','debug','request\x20sent','stringify','error','code','message','result','lodash','util','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/logger','rpc','../../config/environment','jayson/promise','http'];(function(_0x286da3,_0x8f8258){var _0x24b4d3=function(_0x3b539a){while(--_0x3b539a){_0x286da3['push'](_0x286da3['shift']());}};_0x24b4d3(++_0x8f8258);}(_0xca9c,0x1c0));var _0xcca9=function(_0x20dc5,_0x240a13){_0x20dc5=_0x20dc5-0x0;var _0x5bc99e=_0xca9c[_0x20dc5];return _0x5bc99e;};'use strict';var _=require(_0xcca9('0x0'));var util=require(_0xcca9('0x1'));var moment=require(_0xcca9('0x2'));var BPromise=require(_0xcca9('0x3'));var rs=require(_0xcca9('0x4'));var fs=require('fs');var Redis=require(_0xcca9('0x5'));var db=require(_0xcca9('0x6'))['db'];var utils=require('../../config/utils');var logger=require(_0xcca9('0x7'))(_0xcca9('0x8'));var config=require(_0xcca9('0x9'));var jayson=require(_0xcca9('0xa'));var client=jayson['client'][_0xcca9('0xb')]({'port':0x232a});function respondWithRpcPromise(_0x4f509c,_0x3212f3,_0x237572){return new BPromise(function(_0x1acc0b,_0x1f4202){return client[_0xcca9('0xc')](_0x4f509c,_0x237572)[_0xcca9('0xd')](function(_0xecadc7){logger[_0xcca9('0xe')](_0xcca9('0xf'),_0x3212f3,'request\x20sent');logger[_0xcca9('0x10')]('VoiceMusicOnHold,\x20%s,\x20%s,\x20%s',_0x3212f3,_0xcca9('0x11'),JSON[_0xcca9('0x12')](_0xecadc7));if(_0xecadc7[_0xcca9('0x13')]){if(_0xecadc7[_0xcca9('0x13')][_0xcca9('0x14')]===0x1f4){logger[_0xcca9('0x13')]('VoiceMusicOnHold,\x20%s,\x20%s',_0x3212f3,_0xecadc7['error'][_0xcca9('0x15')]);return _0x1f4202(_0xecadc7[_0xcca9('0x13')][_0xcca9('0x15')]);}logger['error'](_0xcca9('0xf'),_0x3212f3,_0xecadc7[_0xcca9('0x13')][_0xcca9('0x15')]);return _0x1acc0b(_0xecadc7['error'][_0xcca9('0x15')]);}else{logger[_0xcca9('0xe')]('VoiceMusicOnHold,\x20%s,\x20%s',_0x3212f3,_0xcca9('0x11'));_0x1acc0b(_0xecadc7[_0xcca9('0x16')][_0xcca9('0x15')]);}})['catch'](function(_0x1c580a){logger['error']('VoiceMusicOnHold,\x20%s,\x20%s',_0x3212f3,_0x1c580a);_0x1f4202(_0x1c580a);});});}
\ No newline at end of file
+var _0x4f97=['bluebird','randomstring','ioredis','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','client','http','then','info','request\x20sent','error','VoiceMusicOnHold,\x20%s,\x20%s','message','util','moment'];(function(_0x1ac6ec,_0x1f81fc){var _0x48a489=function(_0xf38b04){while(--_0xf38b04){_0x1ac6ec['push'](_0x1ac6ec['shift']());}};_0x48a489(++_0x1f81fc);}(_0x4f97,0x1c0));var _0x74f9=function(_0x5e61b5,_0x51466c){_0x5e61b5=_0x5e61b5-0x0;var _0x3fb986=_0x4f97[_0x5e61b5];return _0x3fb986;};'use strict';var _=require('lodash');var util=require(_0x74f9('0x0'));var moment=require(_0x74f9('0x1'));var BPromise=require(_0x74f9('0x2'));var rs=require(_0x74f9('0x3'));var fs=require('fs');var Redis=require(_0x74f9('0x4'));var db=require('../../mysqldb')['db'];var utils=require(_0x74f9('0x5'));var logger=require(_0x74f9('0x6'))(_0x74f9('0x7'));var config=require(_0x74f9('0x8'));var jayson=require(_0x74f9('0x9'));var client=jayson[_0x74f9('0xa')][_0x74f9('0xb')]({'port':0x232a});function respondWithRpcPromise(_0x373c84,_0x33012c,_0x52abd9){return new BPromise(function(_0x30845b,_0xfe3df9){return client['request'](_0x373c84,_0x52abd9)[_0x74f9('0xc')](function(_0x31cae5){logger[_0x74f9('0xd')]('VoiceMusicOnHold,\x20%s,\x20%s',_0x33012c,_0x74f9('0xe'));logger['debug']('VoiceMusicOnHold,\x20%s,\x20%s,\x20%s',_0x33012c,'request\x20sent',JSON['stringify'](_0x31cae5));if(_0x31cae5[_0x74f9('0xf')]){if(_0x31cae5[_0x74f9('0xf')]['code']===0x1f4){logger[_0x74f9('0xf')](_0x74f9('0x10'),_0x33012c,_0x31cae5['error'][_0x74f9('0x11')]);return _0xfe3df9(_0x31cae5[_0x74f9('0xf')]['message']);}logger['error'](_0x74f9('0x10'),_0x33012c,_0x31cae5[_0x74f9('0xf')][_0x74f9('0x11')]);return _0x30845b(_0x31cae5[_0x74f9('0xf')][_0x74f9('0x11')]);}else{logger[_0x74f9('0xd')](_0x74f9('0x10'),_0x33012c,_0x74f9('0xe'));_0x30845b(_0x31cae5['result']['message']);}})['catch'](function(_0x2d7ce8){logger['error'](_0x74f9('0x10'),_0x33012c,_0x2d7ce8);_0xfe3df9(_0x2d7ce8);});});}
\ No newline at end of file
diff --git a/server/api/voicePrefix/index.js b/server/api/voicePrefix/index.js
index c8d4fb3..c96b25a 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 _0xd334=['destroy','removeAgents','exports','util','path','connect-timeout','express','../../components/auth/service','../../config/environment','./voicePrefix.controller','get','isAuthenticated','/describe','describe','show','/:id/users','getAgents','post','addAgents','put','/:id','update','delete'];(function(_0x15e574,_0x2265cc){var _0x2da97f=function(_0x2f207f){while(--_0x2f207f){_0x15e574['push'](_0x15e574['shift']());}};_0x2da97f(++_0x2265cc);}(_0xd334,0x1b8));var _0x4d33=function(_0x18ab2a,_0x4debcd){_0x18ab2a=_0x18ab2a-0x0;var _0x16dcee=_0xd334[_0x18ab2a];return _0x16dcee;};'use strict';var multer=require('multer');var util=require(_0x4d33('0x0'));var path=require(_0x4d33('0x1'));var timeout=require(_0x4d33('0x2'));var express=require(_0x4d33('0x3'));var router=express['Router']();var auth=require(_0x4d33('0x4'));var interaction=require('../../components/interaction/service');var config=require(_0x4d33('0x5'));var controller=require(_0x4d33('0x6'));router[_0x4d33('0x7')]('/',auth[_0x4d33('0x8')](),controller['index']);router['get'](_0x4d33('0x9'),auth[_0x4d33('0x8')](),controller[_0x4d33('0xa')]);router['get']('/:id',auth[_0x4d33('0x8')](),controller[_0x4d33('0xb')]);router[_0x4d33('0x7')](_0x4d33('0xc'),auth['isAuthenticated'](),controller[_0x4d33('0xd')]);router[_0x4d33('0xe')]('/',auth[_0x4d33('0x8')](),controller['create']);router[_0x4d33('0xe')]('/:id/users',auth[_0x4d33('0x8')](),controller[_0x4d33('0xf')]);router[_0x4d33('0x10')](_0x4d33('0x11'),auth['isAuthenticated'](),controller[_0x4d33('0x12')]);router[_0x4d33('0x13')]('/:id',auth[_0x4d33('0x8')](),controller[_0x4d33('0x14')]);router[_0x4d33('0x13')](_0x4d33('0xc'),auth['isAuthenticated'](),controller[_0x4d33('0x15')]);module[_0x4d33('0x16')]=router;
\ No newline at end of file
+var _0xb711=['post','create','addAgents','put','delete','destroy','removeAgents','multer','path','connect-timeout','express','Router','../../components/auth/service','../../components/interaction/service','./voicePrefix.controller','get','isAuthenticated','/describe','describe','/:id','show','/:id/users','getAgents'];(function(_0x369e78,_0x3f4329){var _0x41fad8=function(_0x5c9852){while(--_0x5c9852){_0x369e78['push'](_0x369e78['shift']());}};_0x41fad8(++_0x3f4329);}(_0xb711,0xed));var _0x1b71=function(_0x55a9a2,_0x50061f){_0x55a9a2=_0x55a9a2-0x0;var _0x48f783=_0xb711[_0x55a9a2];return _0x48f783;};'use strict';var multer=require(_0x1b71('0x0'));var util=require('util');var path=require(_0x1b71('0x1'));var timeout=require(_0x1b71('0x2'));var express=require(_0x1b71('0x3'));var router=express[_0x1b71('0x4')]();var auth=require(_0x1b71('0x5'));var interaction=require(_0x1b71('0x6'));var config=require('../../config/environment');var controller=require(_0x1b71('0x7'));router[_0x1b71('0x8')]('/',auth[_0x1b71('0x9')](),controller['index']);router['get'](_0x1b71('0xa'),auth[_0x1b71('0x9')](),controller[_0x1b71('0xb')]);router[_0x1b71('0x8')](_0x1b71('0xc'),auth['isAuthenticated'](),controller[_0x1b71('0xd')]);router[_0x1b71('0x8')](_0x1b71('0xe'),auth[_0x1b71('0x9')](),controller[_0x1b71('0xf')]);router[_0x1b71('0x10')]('/',auth[_0x1b71('0x9')](),controller[_0x1b71('0x11')]);router[_0x1b71('0x10')]('/:id/users',auth[_0x1b71('0x9')](),controller[_0x1b71('0x12')]);router[_0x1b71('0x13')](_0x1b71('0xc'),auth[_0x1b71('0x9')](),controller['update']);router[_0x1b71('0x14')]('/:id',auth[_0x1b71('0x9')](),controller[_0x1b71('0x15')]);router[_0x1b71('0x14')](_0x1b71('0xe'),auth[_0x1b71('0x9')](),controller[_0x1b71('0x16')]);module['exports']=router;
\ No newline at end of file
diff --git a/server/api/voicePrefix/voicePrefix.attributes.js b/server/api/voicePrefix/voicePrefix.attributes.js
index 00a4f4b..8b19c57 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 _0x20c6=['getDataValue','INTEGER','sequelize','exports','STRING','name','VIRTUAL'];(function(_0x5f0d60,_0x51ac51){var _0x2782f6=function(_0x15e2b6){while(--_0x15e2b6){_0x5f0d60['push'](_0x5f0d60['shift']());}};_0x2782f6(++_0x51ac51);}(_0x20c6,0xb8));var _0x620c=function(_0x12926a,_0xb3be90){_0x12926a=_0x12926a-0x0;var _0x2db765=_0x20c6[_0x12926a];return _0x2db765;};'use strict';var Sequelize=require(_0x620c('0x0'));module[_0x620c('0x1')]={'name':{'type':Sequelize[_0x620c('0x2')],'allowNull':![],'unique':_0x620c('0x3')},'prefix':{'type':Sequelize[_0x620c('0x4')],'get':function(_0x39a9af){return'system-'+this[_0x620c('0x5')](_0x620c('0x3'))+'-';}},'description':{'type':Sequelize['STRING']},'callerIdAll':{'type':Sequelize[_0x620c('0x2')]},'VoiceExtensionId':{'type':Sequelize[_0x620c('0x6')]}};
\ No newline at end of file
+var _0x86af=['VIRTUAL','getDataValue','name','exports','STRING'];(function(_0x35919b,_0x3a8cf1){var _0x1982e4=function(_0x365dba){while(--_0x365dba){_0x35919b['push'](_0x35919b['shift']());}};_0x1982e4(++_0x3a8cf1);}(_0x86af,0x152));var _0xf86a=function(_0x18c23c,_0x5d31df){_0x18c23c=_0x18c23c-0x0;var _0xa3b55=_0x86af[_0x18c23c];return _0xa3b55;};'use strict';var Sequelize=require('sequelize');module[_0xf86a('0x0')]={'name':{'type':Sequelize[_0xf86a('0x1')],'allowNull':![],'unique':'name'},'prefix':{'type':Sequelize[_0xf86a('0x2')],'get':function(_0x2aa06c){return'system-'+this[_0xf86a('0x3')](_0xf86a('0x4'))+'-';}},'description':{'type':Sequelize[_0xf86a('0x1')]},'callerIdAll':{'type':Sequelize[_0xf86a('0x1')]},'VoiceExtensionId':{'type':Sequelize['INTEGER']}};
\ No newline at end of file
diff --git a/server/api/voicePrefix/voicePrefix.controller.js b/server/api/voicePrefix/voicePrefix.controller.js
index c662946..3d154f0 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 _0xaf9f=['goto','${EXTEN:','charAt','system-','findById','addAgents','ids','userVoicePrefix:save','removeAgents','isArray','emit','userVoicePrefix:remove','getAgents','findOne','User','filter','nolimit','html-pdf','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','bluebird','util','sox','to-csv','lodash','squel','crypto','jsforce','papaparse','ioredis','../../components/auth/service','../../components/parsers/advancedSearch','../../config/logger','api','../../config/utils','../../config/environment','../../mysqldb','redis','defaults','localhost','./voicePrefix.socket','register','sendStatus','status','json','count','offset','limit','Content-Range','apply','save','update','destroy','then','get','VoicePrefixes','UserProfileResource','end','error','name','send','index','map','VoicePrefix','rawAttributes','fieldName','type','key','model','query','keys','filters','attributes','intersection','fields','length','hasOwnProperty','sort','where','pick','VIRTUAL','merge','options','findAll','includeAll','include','find','catch','params','describe','sequelize','transaction','create','body','VoiceExtensionId','user','Unable\x20to\x20retrieve\x20the\x20current\x20user','role','UserProfileSection','userProfileId','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','context','from-sip','exten','system','Voice\x20Prefix\x20Extension','prefix','NoOp','Voice\x20Prefix','VoicePrefixId','VoiceExtension','bulkCreate','Extensions\x20creation\x20failed','push','Set','CDR(prefix)=','callerIdAll','PREFIX-CALLERIDALL='];(function(_0x258919,_0x1754e6){var _0xfbd68b=function(_0x3bc3e9){while(--_0x3bc3e9){_0x258919['push'](_0x258919['shift']());}};_0xfbd68b(++_0x1754e6);}(_0xaf9f,0x17c));var _0xfaf9=function(_0x544072,_0xc41ee1){_0x544072=_0x544072-0x0;var _0x590bf6=_0xaf9f[_0x544072];return _0x590bf6;};'use strict';var pdf=require(_0xfaf9('0x0'));var emlformat=require(_0xfaf9('0x1'));var rimraf=require(_0xfaf9('0x2'));var zipdir=require(_0xfaf9('0x3'));var jsonpatch=require(_0xfaf9('0x4'));var rp=require(_0xfaf9('0x5'));var moment=require('moment');var BPromise=require(_0xfaf9('0x6'));var Mustache=require('mustache');var util=require(_0xfaf9('0x7'));var path=require('path');var sox=require(_0xfaf9('0x8'));var csv=require(_0xfaf9('0x9'));var ejs=require('ejs');var fs=require('fs');var _=require(_0xfaf9('0xa'));var squel=require(_0xfaf9('0xb'));var crypto=require(_0xfaf9('0xc'));var jsforce=require(_0xfaf9('0xd'));var deskjs=require('desk.js');var toCsv=require(_0xfaf9('0x9'));var querystring=require('querystring');var Papa=require(_0xfaf9('0xe'));var Redis=require(_0xfaf9('0xf'));var authService=require(_0xfaf9('0x10'));var qs=require('../../components/parsers/qs');var as=require(_0xfaf9('0x11'));var hardwareService=require('../../config/license/hardware');var logger=require(_0xfaf9('0x12'))(_0xfaf9('0x13'));var utils=require(_0xfaf9('0x14'));var config=require(_0xfaf9('0x15'));var db=require(_0xfaf9('0x16'))['db'];config[_0xfaf9('0x17')]=_[_0xfaf9('0x18')](config[_0xfaf9('0x17')],{'host':_0xfaf9('0x19'),'port':0x18eb});var socket=require('socket.io-emitter')(new Redis(config[_0xfaf9('0x17')]));require(_0xfaf9('0x1a'))[_0xfaf9('0x1b')](socket);function respondWithStatusCode(_0x5cd2b6,_0x5ec4b1){_0x5ec4b1=_0x5ec4b1||0xcc;return function(_0x465b02){if(_0x465b02){return _0x5cd2b6[_0xfaf9('0x1c')](_0x5ec4b1);}return _0x5cd2b6[_0xfaf9('0x1d')](_0x5ec4b1)['end']();};}function respondWithResult(_0xc02865,_0x3e45b7){_0x3e45b7=_0x3e45b7||0xc8;return function(_0x54c89a){if(_0x54c89a){return _0xc02865[_0xfaf9('0x1d')](_0x3e45b7)[_0xfaf9('0x1e')](_0x54c89a);}};}function respondWithFilteredResult(_0x40aa21,_0x2d12ef){return function(_0x27a4ce){if(_0x27a4ce){var _0x45ad8e=_0x27a4ce[_0xfaf9('0x1f')],_0x451d67=_0x2d12ef[_0xfaf9('0x20')],_0x3c76d1=_0x2d12ef[_0xfaf9('0x20')]+_0x2d12ef[_0xfaf9('0x21')],_0x918eda;if(_0x3c76d1>=_0x45ad8e){_0x3c76d1=_0x45ad8e;_0x918eda=0xc8;}else{_0x918eda=0xce;}_0x40aa21[_0xfaf9('0x1d')](_0x918eda);return _0x40aa21['set'](_0xfaf9('0x22'),_0x451d67+'-'+_0x3c76d1+'/'+_0x45ad8e)[_0xfaf9('0x1e')](_0x27a4ce);}return null;};}function patchUpdates(_0x162869){return function(_0x4a8eae){try{jsonpatch[_0xfaf9('0x23')](_0x4a8eae,_0x162869,!![]);}catch(_0x56e9d2){return BPromise['reject'](_0x56e9d2);}return _0x4a8eae[_0xfaf9('0x24')]();};}function saveUpdates(_0x501d21,_0xb4a99b){return function(_0x57d6ef){if(_0x57d6ef){return _0x57d6ef[_0xfaf9('0x25')](_0x501d21)['then'](function(_0x4e7c44){return _0x4e7c44;});}return null;};}function removeEntity(_0x2ba48c,_0x160273){return function(_0x398475){if(_0x398475){return _0x398475[_0xfaf9('0x26')]()[_0xfaf9('0x27')](function(){var _0x5ef8cf=_0x398475[_0xfaf9('0x28')]({'plain':!![]});var _0x27a6c2=_0xfaf9('0x29');return db[_0xfaf9('0x2a')]['destroy']({'where':{'type':_0x27a6c2,'resourceId':_0x5ef8cf['id']}})[_0xfaf9('0x27')](function(){return _0x398475;});})[_0xfaf9('0x27')](function(){_0x2ba48c['status'](0xcc)[_0xfaf9('0x2b')]();});}};}function handleEntityNotFound(_0x17f3d5,_0x1153d0){return function(_0x545242){if(!_0x545242){_0x17f3d5[_0xfaf9('0x1c')](0x194);}return _0x545242;};}function handleError(_0x278bbb,_0x2e6906){_0x2e6906=_0x2e6906||0x1f4;return function(_0x444872){logger[_0xfaf9('0x2c')](_0x444872['stack']);if(_0x444872[_0xfaf9('0x2d')]){delete _0x444872[_0xfaf9('0x2d')];}_0x278bbb[_0xfaf9('0x1d')](_0x2e6906)[_0xfaf9('0x2e')](_0x444872);};}exports[_0xfaf9('0x2f')]=function(_0x321d9c,_0x32ec9d){var _0x503e54={},_0x587459={},_0x10f0e9={'count':0x0,'rows':[]};var _0x1bb229=_[_0xfaf9('0x30')](db[_0xfaf9('0x31')][_0xfaf9('0x32')],function(_0xa43bcb){return{'name':_0xa43bcb[_0xfaf9('0x33')],'type':_0xa43bcb[_0xfaf9('0x34')][_0xfaf9('0x35')]};});_0x587459[_0xfaf9('0x36')]=_[_0xfaf9('0x30')](_0x1bb229,'name');_0x587459[_0xfaf9('0x37')]=_[_0xfaf9('0x38')](_0x321d9c['query']);_0x587459[_0xfaf9('0x39')]=_['intersection'](_0x587459[_0xfaf9('0x36')],_0x587459['query']);_0x503e54[_0xfaf9('0x3a')]=_[_0xfaf9('0x3b')](_0x587459[_0xfaf9('0x36')],qs[_0xfaf9('0x3c')](_0x321d9c['query']['fields']));_0x503e54[_0xfaf9('0x3a')]=_0x503e54[_0xfaf9('0x3a')][_0xfaf9('0x3d')]?_0x503e54[_0xfaf9('0x3a')]:_0x587459[_0xfaf9('0x36')];if(!_0x321d9c[_0xfaf9('0x37')][_0xfaf9('0x3e')]('nolimit')){_0x503e54[_0xfaf9('0x21')]=qs['limit'](_0x321d9c[_0xfaf9('0x37')]['limit']);_0x503e54[_0xfaf9('0x20')]=qs[_0xfaf9('0x20')](_0x321d9c['query'][_0xfaf9('0x20')]);}_0x503e54['order']=qs[_0xfaf9('0x3f')](_0x321d9c[_0xfaf9('0x37')]['sort']);_0x503e54[_0xfaf9('0x40')]=qs['filters'](_[_0xfaf9('0x41')](_0x321d9c[_0xfaf9('0x37')],_0x587459[_0xfaf9('0x39')]));if(_0x321d9c[_0xfaf9('0x37')]['filter']){_0x503e54[_0xfaf9('0x40')]=_['merge'](_0x503e54['where'],{'$or':_[_0xfaf9('0x30')](_0x1bb229,function(_0x2583e8){if(_0x2583e8[_0xfaf9('0x34')]!==_0xfaf9('0x42')){var _0xb84494={};_0xb84494[_0x2583e8[_0xfaf9('0x2d')]]={'$like':'%'+_0x321d9c[_0xfaf9('0x37')]['filter']+'%'};return _0xb84494;}})});}_0x503e54=_[_0xfaf9('0x43')]({},_0x503e54,_0x321d9c[_0xfaf9('0x44')]);var _0x2a5ac6={'where':_0x503e54[_0xfaf9('0x40')]};return db['VoicePrefix']['count'](_0x2a5ac6)[_0xfaf9('0x27')](function(_0x44bf82){_0x10f0e9[_0xfaf9('0x1f')]=_0x44bf82;if(_0x321d9c[_0xfaf9('0x37')]['includeAll']){_0x503e54['include']=[{'all':!![]}];}return db['VoicePrefix'][_0xfaf9('0x45')](_0x503e54);})['then'](function(_0x3a9f47){_0x10f0e9['rows']=_0x3a9f47;return _0x10f0e9;})[_0xfaf9('0x27')](respondWithFilteredResult(_0x32ec9d,_0x503e54))['catch'](handleError(_0x32ec9d,null));};exports['show']=function(_0xb2f910,_0x406f37){var _0x5aedb0={'raw':![],'where':{'id':_0xb2f910['params']['id']}},_0x7808ba={};_0x7808ba[_0xfaf9('0x36')]=_[_0xfaf9('0x38')](db[_0xfaf9('0x31')][_0xfaf9('0x32')]);_0x7808ba[_0xfaf9('0x37')]=_[_0xfaf9('0x38')](_0xb2f910[_0xfaf9('0x37')]);_0x7808ba[_0xfaf9('0x39')]=_[_0xfaf9('0x3b')](_0x7808ba[_0xfaf9('0x36')],_0x7808ba[_0xfaf9('0x37')]);_0x5aedb0[_0xfaf9('0x3a')]=_[_0xfaf9('0x3b')](_0x7808ba[_0xfaf9('0x36')],qs['fields'](_0xb2f910[_0xfaf9('0x37')][_0xfaf9('0x3c')]));_0x5aedb0[_0xfaf9('0x3a')]=_0x5aedb0[_0xfaf9('0x3a')][_0xfaf9('0x3d')]?_0x5aedb0[_0xfaf9('0x3a')]:_0x7808ba[_0xfaf9('0x36')];if(_0xb2f910[_0xfaf9('0x37')][_0xfaf9('0x46')]){_0x5aedb0[_0xfaf9('0x47')]=[{'all':!![]}];}_0x5aedb0=_['merge']({},_0x5aedb0,_0xb2f910['options']);return db[_0xfaf9('0x31')][_0xfaf9('0x48')](_0x5aedb0)[_0xfaf9('0x27')](handleEntityNotFound(_0x406f37,null))[_0xfaf9('0x27')](respondWithResult(_0x406f37,null))[_0xfaf9('0x49')](handleError(_0x406f37,null));};exports['destroy']=function(_0x1cf42f,_0x128f3f){return db[_0xfaf9('0x31')][_0xfaf9('0x48')]({'where':{'id':_0x1cf42f[_0xfaf9('0x4a')]['id']}})[_0xfaf9('0x27')](handleEntityNotFound(_0x128f3f,null))[_0xfaf9('0x27')](removeEntity(_0x128f3f,null))['catch'](handleError(_0x128f3f,null));};exports[_0xfaf9('0x4b')]=function(_0xe0d958,_0x43ee48){return db['VoicePrefix'][_0xfaf9('0x4b')]()[_0xfaf9('0x27')](respondWithResult(_0x43ee48,null))['catch'](handleError(_0x43ee48,null));};exports['create']=function(_0x4199a8,_0x26368d){var _0x6aea14;return db[_0xfaf9('0x4c')][_0xfaf9('0x4d')](function(_0x402037){return db[_0xfaf9('0x31')][_0xfaf9('0x4e')](_0x4199a8[_0xfaf9('0x4f')],{'transaction':_0x402037})[_0xfaf9('0x27')](function(_0xfc979d){_0x6aea14=_0xfc979d[_0xfaf9('0x28')]({'plain':!![]});return db['VoiceExtension'][_0xfaf9('0x48')]({'where':{'id':_0x6aea14[_0xfaf9('0x50')]},'raw':!![]})[_0xfaf9('0x27')](function(_0x10fb01){return createVoicePrefixExtensions(_0x6aea14,_0x10fb01,_0x402037);});});})[_0xfaf9('0x27')](function(){var _0x3a3e93=_0x4199a8[_0xfaf9('0x51')]['get']({'plain':!![]});if(!_0x3a3e93)throw new Error(_0xfaf9('0x52'));if(_0x3a3e93[_0xfaf9('0x53')]===_0xfaf9('0x51')){var _0x314b06=_0x6aea14;return db[_0xfaf9('0x54')]['find']({'where':{'name':_0xfaf9('0x29'),'userProfileId':_0x3a3e93[_0xfaf9('0x55')]},'raw':!![]})[_0xfaf9('0x27')](function(_0x2f75b9){if(_0x2f75b9&&_0x2f75b9['autoAssociation']===0x0){return db['UserProfileResource']['create']({'name':_0x314b06[_0xfaf9('0x2d')],'resourceId':_0x314b06['id'],'type':_0x2f75b9[_0xfaf9('0x2d')],'sectionId':_0x2f75b9['id']},{})[_0xfaf9('0x27')](function(){return _0x6aea14;});}else{return _0x6aea14;}})[_0xfaf9('0x49')](function(_0x50d6ec){logger['error'](_0xfaf9('0x56'),_0x50d6ec);throw _0x50d6ec;});}return _0x6aea14;})[_0xfaf9('0x27')](respondWithResult(_0x26368d,null))[_0xfaf9('0x49')](handleError(_0x26368d,null));};function Extension(_0x2dfb4c,_0x4eb83e,_0x3692a7,_0xffde9d){this[_0xfaf9('0x57')]=_0xfaf9('0x58');this[_0xfaf9('0x59')]=_0x2dfb4c;this['app']=_0x3692a7;this['type']=_0xfaf9('0x5a');this['description']=_0xfaf9('0x5b');this['priority']=_0x4eb83e;this['appdata']=_0xffde9d;}function createVoicePrefixExtensions(_0x5e5491,_0x106f55,_0x11d51d){return new BPromise(function(_0x28825c,_0x5adf03){var _0x292590=new Extension(formatPrefixName(_0x5e5491[_0xfaf9('0x5c')]),0x1,_0xfaf9('0x5d'),_0xfaf9('0x5e'));_0x292590[_0xfaf9('0x5f')]=_0x5e5491['id'];return db[_0xfaf9('0x60')][_0xfaf9('0x4e')](_0x292590,{'transaction':_0x11d51d})[_0xfaf9('0x27')](function(_0x5eaced){var _0x26728e=_0x5eaced[_0xfaf9('0x28')]({'plain':!![]});var _0x13a0fd=_[_0xfaf9('0x30')](addVoicePrefixExtensions(_0x5e5491,_0x106f55),function(_0x5c54ef){_0x5c54ef[_0xfaf9('0x50')]=_0x26728e['id'];_0x5c54ef[_0xfaf9('0x5f')]=_0x5e5491['id'];return _0x5c54ef;});return db['VoiceExtension'][_0xfaf9('0x61')](_0x13a0fd,{'transaction':_0x11d51d})[_0xfaf9('0x27')](function(_0x17ec53){if(!_0x17ec53){return _0x5adf03(_0xfaf9('0x62'));}else{return _0x28825c(_0x17ec53);}})[_0xfaf9('0x49')](function(_0x433342){return _0x5adf03(_0x433342);});});;});};function addVoicePrefixExtensions(_0x3aedce,_0x42ade0){var _0x4c500=[];var _0x52934c=formatPrefixName(_0x3aedce[_0xfaf9('0x5c')]);_0x4c500[_0xfaf9('0x63')](new Extension(_0x52934c,0x2,_0xfaf9('0x64'),_0xfaf9('0x65')+_0x3aedce[_0xfaf9('0x2d')]));if(_0x3aedce[_0xfaf9('0x66')]){_0x4c500[_0xfaf9('0x63')](new Extension(_0x52934c,0x3,'Set',_0xfaf9('0x67')+_0x3aedce[_0xfaf9('0x66')]));}else{_0x4c500[_0xfaf9('0x63')](new Extension(_0x52934c,0x3,_0xfaf9('0x5d'),'No\x20callerid\x20available'));}_0x4c500['push'](new Extension(_0x52934c,0x4,_0xfaf9('0x68'),_0x42ade0['context']+','+_0xfaf9('0x69')+(0x8+_0x3aedce[_0xfaf9('0x2d')][_0xfaf9('0x3d')])+'}'+','+0x1));return _0x4c500;}function formatPrefixName(_0x958b43){var _0x431df9='_';for(var _0x255e9c=0x0;_0x255e9c<_0x958b43[_0xfaf9('0x3d')];_0x255e9c++){if(_0x958b43[_0xfaf9('0x6a')](_0x255e9c)=='-'){_0x431df9+=_0x958b43[_0xfaf9('0x6a')](_0x255e9c);}else{_0x431df9+='['+_0x958b43[_0xfaf9('0x6a')](_0x255e9c)+']';}}_0x431df9+='.';return _0x431df9;}exports['update']=function(_0x40feb5,_0x24e0e0,_0x3d0fd5){var _0x3c47a8=_0x40feb5[_0xfaf9('0x4f')];_0x3c47a8['prefix']=_0xfaf9('0x6b')+_0x3c47a8[_0xfaf9('0x2d')]+'-';return db[_0xfaf9('0x4c')][_0xfaf9('0x4d')](function(_0x7124e5){return db[_0xfaf9('0x31')][_0xfaf9('0x25')](_0x3c47a8,{'where':{'id':_0x3c47a8['id']},'transaction':_0x7124e5})[_0xfaf9('0x27')](function(){return db[_0xfaf9('0x60')][_0xfaf9('0x26')]({'where':{'VoicePrefixId':_0x3c47a8['id']},'transaction':_0x7124e5})[_0xfaf9('0x27')](function(){return db[_0xfaf9('0x60')][_0xfaf9('0x48')]({'where':{'id':_0x3c47a8['VoiceExtensionId']},'raw':!![]})['then'](function(_0x25fd2d){return createVoicePrefixExtensions(_0x3c47a8,_0x25fd2d,_0x7124e5);});});});})[_0xfaf9('0x27')](function(){return db[_0xfaf9('0x31')][_0xfaf9('0x6c')](_0x3c47a8['id']);})['then'](respondWithResult(_0x24e0e0,null))['catch'](handleError(_0x24e0e0,null));};exports[_0xfaf9('0x6d')]=function(_0x24fd25,_0x72bfe,_0x551354){return db[_0xfaf9('0x31')][_0xfaf9('0x48')]({'where':{'id':_0x24fd25['params']['id']}})[_0xfaf9('0x27')](handleEntityNotFound(_0x72bfe,null))['then'](function(_0x26c9d0){if(_0x26c9d0){return _0x26c9d0[_0xfaf9('0x6d')](_0x24fd25[_0xfaf9('0x4f')]['ids'],_['omit'](_0x24fd25['body'],['ids','id'])||{})['spread'](function(_0x142267){for(var _0x5e8cc4=0x0;_0x5e8cc4<_0x24fd25[_0xfaf9('0x4f')][_0xfaf9('0x6e')][_0xfaf9('0x3d')];_0x5e8cc4+=0x1){socket['emit'](_0xfaf9('0x6f'),{'UserId':_0x24fd25[_0xfaf9('0x4f')]['ids'][_0x5e8cc4],'VoicePrefixId':_0x24fd25[_0xfaf9('0x4a')]['id']});}return _0x142267;});}})['then'](respondWithResult(_0x72bfe,null))[_0xfaf9('0x49')](handleError(_0x72bfe,null));};exports[_0xfaf9('0x70')]=function(_0x14deb1,_0x599e78,_0x4ea5aa){return db[_0xfaf9('0x31')]['find']({'where':{'id':_0x14deb1[_0xfaf9('0x4a')]['id']}})[_0xfaf9('0x27')](handleEntityNotFound(_0x599e78,null))[_0xfaf9('0x27')](function(_0x1db72d){if(_0x1db72d){return _0x1db72d[_0xfaf9('0x70')](_0x14deb1['query'][_0xfaf9('0x6e')])[_0xfaf9('0x27')](function(){if(_[_0xfaf9('0x71')](_0x14deb1[_0xfaf9('0x37')][_0xfaf9('0x6e')])){for(var _0x61ab2=0x0;_0x61ab2<_0x14deb1['query']['ids'][_0xfaf9('0x3d')];_0x61ab2+=0x1){socket[_0xfaf9('0x72')]('userVoicePrefix:remove',{'UserId':Number(_0x14deb1[_0xfaf9('0x37')][_0xfaf9('0x6e')][_0x61ab2]),'VoicePrefixId':Number(_0x14deb1['params']['id'])});}}else{socket[_0xfaf9('0x72')](_0xfaf9('0x73'),{'UserId':Number(_0x14deb1['query'][_0xfaf9('0x6e')]),'VoicePrefixId':Number(_0x14deb1[_0xfaf9('0x4a')]['id'])});}});}})[_0xfaf9('0x27')](respondWithStatusCode(_0x599e78,null))[_0xfaf9('0x49')](handleError(_0x599e78,null));};exports[_0xfaf9('0x74')]=function(_0xcbcbeb,_0x782b65,_0x5ecc23){var _0x4a63ee={};var _0x15ba3e={};var _0x3eeebc;var _0x481d76;return db[_0xfaf9('0x31')][_0xfaf9('0x75')]({'where':{'id':_0xcbcbeb['params']['id']}})[_0xfaf9('0x27')](handleEntityNotFound(_0x782b65,null))[_0xfaf9('0x27')](function(_0x1dae3f){if(_0x1dae3f){_0x3eeebc=_0x1dae3f;_0x15ba3e[_0xfaf9('0x36')]=_['keys'](db[_0xfaf9('0x76')][_0xfaf9('0x32')]);_0x15ba3e[_0xfaf9('0x37')]=_['keys'](_0xcbcbeb['query']);_0x15ba3e[_0xfaf9('0x39')]=_[_0xfaf9('0x3b')](_0x15ba3e['model'],_0x15ba3e[_0xfaf9('0x37')]);_0x4a63ee[_0xfaf9('0x3a')]=_[_0xfaf9('0x3b')](_0x15ba3e[_0xfaf9('0x36')],qs[_0xfaf9('0x3c')](_0xcbcbeb[_0xfaf9('0x37')][_0xfaf9('0x3c')]));_0x4a63ee[_0xfaf9('0x3a')]=_0x4a63ee[_0xfaf9('0x3a')]['length']?_0x4a63ee[_0xfaf9('0x3a')]:_0x15ba3e[_0xfaf9('0x36')];_0x4a63ee['order']=qs[_0xfaf9('0x3f')](_0xcbcbeb[_0xfaf9('0x37')]['sort']);_0x4a63ee[_0xfaf9('0x40')]=qs[_0xfaf9('0x39')](_[_0xfaf9('0x41')](_0xcbcbeb[_0xfaf9('0x37')],_0x15ba3e[_0xfaf9('0x39')]));if(_0xcbcbeb['query'][_0xfaf9('0x77')]){_0x4a63ee[_0xfaf9('0x40')]=_[_0xfaf9('0x43')](_0x4a63ee[_0xfaf9('0x40')],{'$or':_['map'](_0x4a63ee[_0xfaf9('0x3a')],function(_0xb0789){var _0x12cb20={};_0x12cb20[_0xb0789]={'$like':'%'+_0xcbcbeb[_0xfaf9('0x37')]['filter']+'%'};return _0x12cb20;})});}_0x4a63ee=_['merge']({},_0x4a63ee,_0xcbcbeb[_0xfaf9('0x44')]);return _0x3eeebc[_0xfaf9('0x74')](_0x4a63ee);}})[_0xfaf9('0x27')](function(_0x5595e4){if(_0x5595e4){_0x481d76=_0x5595e4['length'];if(!_0xcbcbeb[_0xfaf9('0x37')][_0xfaf9('0x3e')](_0xfaf9('0x78'))){_0x4a63ee[_0xfaf9('0x21')]=qs[_0xfaf9('0x21')](_0xcbcbeb[_0xfaf9('0x37')]['limit']);_0x4a63ee[_0xfaf9('0x20')]=qs['offset'](_0xcbcbeb['query'][_0xfaf9('0x20')]);}return _0x3eeebc[_0xfaf9('0x74')](_0x4a63ee);}})['then'](function(_0xac68b1){if(_0xac68b1){return _0xac68b1?{'count':_0x481d76,'rows':_0xac68b1}:null;}})[_0xfaf9('0x27')](respondWithResult(_0x782b65,null))[_0xfaf9('0x49')](handleError(_0x782b65,null));};
\ No newline at end of file
+var _0x92ea=['then','error','stack','name','index','map','VoicePrefix','rawAttributes','type','keys','query','filters','intersection','model','fields','attributes','length','hasOwnProperty','order','sort','where','pick','filter','VIRTUAL','merge','options','includeAll','rows','show','params','include','find','catch','describe','create','transaction','body','VoiceExtension','VoiceExtensionId','user','Unable\x20to\x20retrieve\x20the\x20current\x20user','role','UserProfileSection','userProfileId','autoAssociation','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','from-sip','exten','app','system','Voice\x20Prefix\x20Extension','priority','appdata','prefix','Voice\x20Prefix','VoicePrefixId','bulkCreate','Extensions\x20creation\x20failed','Set','CDR(prefix)=','PREFIX-CALLERIDALL=','callerIdAll','push','No\x20callerid\x20available','goto','context','${EXTEN:','charAt','system-','sequelize','addAgents','ids','omit','emit','userVoicePrefix:save','removeAgents','isArray','userVoicePrefix:remove','getAgents','findOne','nolimit','html-pdf','eml-format','rimraf','zip-dir','fast-json-patch','moment','mustache','util','path','to-csv','squel','crypto','desk.js','querystring','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','api','../../config/environment','../../mysqldb','redis','defaults','localhost','socket.io-emitter','./voicePrefix.socket','register','status','end','count','offset','limit','set','Content-Range','reject','save','update','get','VoicePrefixes','UserProfileResource','destroy'];(function(_0x4295fd,_0x1f2573){var _0x96f34e=function(_0x32bf59){while(--_0x32bf59){_0x4295fd['push'](_0x4295fd['shift']());}};_0x96f34e(++_0x1f2573);}(_0x92ea,0x1c2));var _0xa92e=function(_0xb63fce,_0x195630){_0xb63fce=_0xb63fce-0x0;var _0x42c1ed=_0x92ea[_0xb63fce];return _0x42c1ed;};'use strict';var pdf=require(_0xa92e('0x0'));var emlformat=require(_0xa92e('0x1'));var rimraf=require(_0xa92e('0x2'));var zipdir=require(_0xa92e('0x3'));var jsonpatch=require(_0xa92e('0x4'));var rp=require('request-promise');var moment=require(_0xa92e('0x5'));var BPromise=require('bluebird');var Mustache=require(_0xa92e('0x6'));var util=require(_0xa92e('0x7'));var path=require(_0xa92e('0x8'));var sox=require('sox');var csv=require(_0xa92e('0x9'));var ejs=require('ejs');var fs=require('fs');var _=require('lodash');var squel=require(_0xa92e('0xa'));var crypto=require(_0xa92e('0xb'));var jsforce=require('jsforce');var deskjs=require(_0xa92e('0xc'));var toCsv=require(_0xa92e('0x9'));var querystring=require(_0xa92e('0xd'));var Papa=require('papaparse');var Redis=require(_0xa92e('0xe'));var authService=require(_0xa92e('0xf'));var qs=require(_0xa92e('0x10'));var as=require(_0xa92e('0x11'));var hardwareService=require(_0xa92e('0x12'));var logger=require('../../config/logger')(_0xa92e('0x13'));var utils=require('../../config/utils');var config=require(_0xa92e('0x14'));var db=require(_0xa92e('0x15'))['db'];config[_0xa92e('0x16')]=_[_0xa92e('0x17')](config[_0xa92e('0x16')],{'host':_0xa92e('0x18'),'port':0x18eb});var socket=require(_0xa92e('0x19'))(new Redis(config['redis']));require(_0xa92e('0x1a'))[_0xa92e('0x1b')](socket);function respondWithStatusCode(_0x1dbb1b,_0xd8fa97){_0xd8fa97=_0xd8fa97||0xcc;return function(_0x4503f5){if(_0x4503f5){return _0x1dbb1b['sendStatus'](_0xd8fa97);}return _0x1dbb1b[_0xa92e('0x1c')](_0xd8fa97)[_0xa92e('0x1d')]();};}function respondWithResult(_0xd014c8,_0x387cb3){_0x387cb3=_0x387cb3||0xc8;return function(_0x4056b0){if(_0x4056b0){return _0xd014c8[_0xa92e('0x1c')](_0x387cb3)['json'](_0x4056b0);}};}function respondWithFilteredResult(_0xed442c,_0x3c03d6){return function(_0x1e6c01){if(_0x1e6c01){var _0x41ef69=_0x1e6c01[_0xa92e('0x1e')],_0x282736=_0x3c03d6[_0xa92e('0x1f')],_0x5e5958=_0x3c03d6['offset']+_0x3c03d6[_0xa92e('0x20')],_0x369a15;if(_0x5e5958>=_0x41ef69){_0x5e5958=_0x41ef69;_0x369a15=0xc8;}else{_0x369a15=0xce;}_0xed442c['status'](_0x369a15);return _0xed442c[_0xa92e('0x21')](_0xa92e('0x22'),_0x282736+'-'+_0x5e5958+'/'+_0x41ef69)['json'](_0x1e6c01);}return null;};}function patchUpdates(_0x5f544e){return function(_0x175699){try{jsonpatch['apply'](_0x175699,_0x5f544e,!![]);}catch(_0x5a8c17){return BPromise[_0xa92e('0x23')](_0x5a8c17);}return _0x175699[_0xa92e('0x24')]();};}function saveUpdates(_0x490bfb,_0x23985e){return function(_0x3878c8){if(_0x3878c8){return _0x3878c8[_0xa92e('0x25')](_0x490bfb)['then'](function(_0x2c2d5f){return _0x2c2d5f;});}return null;};}function removeEntity(_0x336f86,_0x3bc772){return function(_0x41af0e){if(_0x41af0e){return _0x41af0e['destroy']()['then'](function(){var _0x38d02b=_0x41af0e[_0xa92e('0x26')]({'plain':!![]});var _0x4a49b4=_0xa92e('0x27');return db[_0xa92e('0x28')][_0xa92e('0x29')]({'where':{'type':_0x4a49b4,'resourceId':_0x38d02b['id']}})[_0xa92e('0x2a')](function(){return _0x41af0e;});})[_0xa92e('0x2a')](function(){_0x336f86[_0xa92e('0x1c')](0xcc)[_0xa92e('0x1d')]();});}};}function handleEntityNotFound(_0x22d0d2,_0x5b870d){return function(_0x58af47){if(!_0x58af47){_0x22d0d2['sendStatus'](0x194);}return _0x58af47;};}function handleError(_0x3457fc,_0x58b010){_0x58b010=_0x58b010||0x1f4;return function(_0x55c802){logger[_0xa92e('0x2b')](_0x55c802[_0xa92e('0x2c')]);if(_0x55c802['name']){delete _0x55c802[_0xa92e('0x2d')];}_0x3457fc['status'](_0x58b010)['send'](_0x55c802);};}exports[_0xa92e('0x2e')]=function(_0x3b722e,_0x20dd6e){var _0x2ff1b6={},_0x53af62={},_0x1b371d={'count':0x0,'rows':[]};var _0x4c530d=_[_0xa92e('0x2f')](db[_0xa92e('0x30')][_0xa92e('0x31')],function(_0x537b7d){return{'name':_0x537b7d['fieldName'],'type':_0x537b7d[_0xa92e('0x32')]['key']};});_0x53af62['model']=_['map'](_0x4c530d,_0xa92e('0x2d'));_0x53af62['query']=_[_0xa92e('0x33')](_0x3b722e[_0xa92e('0x34')]);_0x53af62[_0xa92e('0x35')]=_[_0xa92e('0x36')](_0x53af62[_0xa92e('0x37')],_0x53af62[_0xa92e('0x34')]);_0x2ff1b6['attributes']=_[_0xa92e('0x36')](_0x53af62['model'],qs['fields'](_0x3b722e['query'][_0xa92e('0x38')]));_0x2ff1b6[_0xa92e('0x39')]=_0x2ff1b6[_0xa92e('0x39')][_0xa92e('0x3a')]?_0x2ff1b6[_0xa92e('0x39')]:_0x53af62['model'];if(!_0x3b722e[_0xa92e('0x34')][_0xa92e('0x3b')]('nolimit')){_0x2ff1b6[_0xa92e('0x20')]=qs[_0xa92e('0x20')](_0x3b722e['query'][_0xa92e('0x20')]);_0x2ff1b6[_0xa92e('0x1f')]=qs['offset'](_0x3b722e[_0xa92e('0x34')][_0xa92e('0x1f')]);}_0x2ff1b6[_0xa92e('0x3c')]=qs[_0xa92e('0x3d')](_0x3b722e[_0xa92e('0x34')][_0xa92e('0x3d')]);_0x2ff1b6[_0xa92e('0x3e')]=qs[_0xa92e('0x35')](_[_0xa92e('0x3f')](_0x3b722e[_0xa92e('0x34')],_0x53af62['filters']));if(_0x3b722e['query'][_0xa92e('0x40')]){_0x2ff1b6[_0xa92e('0x3e')]=_['merge'](_0x2ff1b6[_0xa92e('0x3e')],{'$or':_['map'](_0x4c530d,function(_0x449131){if(_0x449131[_0xa92e('0x32')]!==_0xa92e('0x41')){var _0xe1b033={};_0xe1b033[_0x449131[_0xa92e('0x2d')]]={'$like':'%'+_0x3b722e[_0xa92e('0x34')][_0xa92e('0x40')]+'%'};return _0xe1b033;}})});}_0x2ff1b6=_[_0xa92e('0x42')]({},_0x2ff1b6,_0x3b722e[_0xa92e('0x43')]);var _0x236de4={'where':_0x2ff1b6[_0xa92e('0x3e')]};return db[_0xa92e('0x30')][_0xa92e('0x1e')](_0x236de4)[_0xa92e('0x2a')](function(_0x46f49f){_0x1b371d[_0xa92e('0x1e')]=_0x46f49f;if(_0x3b722e[_0xa92e('0x34')][_0xa92e('0x44')]){_0x2ff1b6['include']=[{'all':!![]}];}return db[_0xa92e('0x30')]['findAll'](_0x2ff1b6);})[_0xa92e('0x2a')](function(_0x27e9b3){_0x1b371d[_0xa92e('0x45')]=_0x27e9b3;return _0x1b371d;})[_0xa92e('0x2a')](respondWithFilteredResult(_0x20dd6e,_0x2ff1b6))['catch'](handleError(_0x20dd6e,null));};exports[_0xa92e('0x46')]=function(_0x18a289,_0x5ba0da){var _0x3f4991={'raw':![],'where':{'id':_0x18a289[_0xa92e('0x47')]['id']}},_0x193b32={};_0x193b32['model']=_['keys'](db[_0xa92e('0x30')]['rawAttributes']);_0x193b32['query']=_[_0xa92e('0x33')](_0x18a289[_0xa92e('0x34')]);_0x193b32[_0xa92e('0x35')]=_[_0xa92e('0x36')](_0x193b32['model'],_0x193b32[_0xa92e('0x34')]);_0x3f4991[_0xa92e('0x39')]=_['intersection'](_0x193b32[_0xa92e('0x37')],qs[_0xa92e('0x38')](_0x18a289['query']['fields']));_0x3f4991[_0xa92e('0x39')]=_0x3f4991[_0xa92e('0x39')][_0xa92e('0x3a')]?_0x3f4991[_0xa92e('0x39')]:_0x193b32['model'];if(_0x18a289[_0xa92e('0x34')]['includeAll']){_0x3f4991[_0xa92e('0x48')]=[{'all':!![]}];}_0x3f4991=_['merge']({},_0x3f4991,_0x18a289[_0xa92e('0x43')]);return db['VoicePrefix'][_0xa92e('0x49')](_0x3f4991)['then'](handleEntityNotFound(_0x5ba0da,null))[_0xa92e('0x2a')](respondWithResult(_0x5ba0da,null))[_0xa92e('0x4a')](handleError(_0x5ba0da,null));};exports[_0xa92e('0x29')]=function(_0x304090,_0x4bfb32){return db[_0xa92e('0x30')]['find']({'where':{'id':_0x304090[_0xa92e('0x47')]['id']}})[_0xa92e('0x2a')](handleEntityNotFound(_0x4bfb32,null))[_0xa92e('0x2a')](removeEntity(_0x4bfb32,null))[_0xa92e('0x4a')](handleError(_0x4bfb32,null));};exports[_0xa92e('0x4b')]=function(_0x250aba,_0x52b1cc){return db[_0xa92e('0x30')][_0xa92e('0x4b')]()['then'](respondWithResult(_0x52b1cc,null))[_0xa92e('0x4a')](handleError(_0x52b1cc,null));};exports[_0xa92e('0x4c')]=function(_0xdf4ba5,_0x140137){var _0x429732;return db['sequelize'][_0xa92e('0x4d')](function(_0x10db02){return db[_0xa92e('0x30')][_0xa92e('0x4c')](_0xdf4ba5[_0xa92e('0x4e')],{'transaction':_0x10db02})[_0xa92e('0x2a')](function(_0x445b59){_0x429732=_0x445b59['get']({'plain':!![]});return db[_0xa92e('0x4f')]['find']({'where':{'id':_0x429732[_0xa92e('0x50')]},'raw':!![]})[_0xa92e('0x2a')](function(_0x5824d1){return createVoicePrefixExtensions(_0x429732,_0x5824d1,_0x10db02);});});})[_0xa92e('0x2a')](function(){var _0x5dede0=_0xdf4ba5[_0xa92e('0x51')][_0xa92e('0x26')]({'plain':!![]});if(!_0x5dede0)throw new Error(_0xa92e('0x52'));if(_0x5dede0[_0xa92e('0x53')]===_0xa92e('0x51')){var _0x524f86=_0x429732;return db[_0xa92e('0x54')][_0xa92e('0x49')]({'where':{'name':_0xa92e('0x27'),'userProfileId':_0x5dede0[_0xa92e('0x55')]},'raw':!![]})[_0xa92e('0x2a')](function(_0x552c3c){if(_0x552c3c&&_0x552c3c[_0xa92e('0x56')]===0x0){return db[_0xa92e('0x28')][_0xa92e('0x4c')]({'name':_0x524f86[_0xa92e('0x2d')],'resourceId':_0x524f86['id'],'type':_0x552c3c[_0xa92e('0x2d')],'sectionId':_0x552c3c['id']},{})['then'](function(){return _0x429732;});}else{return _0x429732;}})[_0xa92e('0x4a')](function(_0x458be4){logger['error'](_0xa92e('0x57'),_0x458be4);throw _0x458be4;});}return _0x429732;})[_0xa92e('0x2a')](respondWithResult(_0x140137,null))[_0xa92e('0x4a')](handleError(_0x140137,null));};function Extension(_0x39072d,_0x47a9be,_0x5b0845,_0x4613d6){this['context']=_0xa92e('0x58');this[_0xa92e('0x59')]=_0x39072d;this[_0xa92e('0x5a')]=_0x5b0845;this[_0xa92e('0x32')]=_0xa92e('0x5b');this['description']=_0xa92e('0x5c');this[_0xa92e('0x5d')]=_0x47a9be;this[_0xa92e('0x5e')]=_0x4613d6;}function createVoicePrefixExtensions(_0x2cb36c,_0x309131,_0x3780a9){return new BPromise(function(_0x10c2e5,_0xb2ed89){var _0x12748e=new Extension(formatPrefixName(_0x2cb36c[_0xa92e('0x5f')]),0x1,'NoOp',_0xa92e('0x60'));_0x12748e['VoicePrefixId']=_0x2cb36c['id'];return db['VoiceExtension'][_0xa92e('0x4c')](_0x12748e,{'transaction':_0x3780a9})[_0xa92e('0x2a')](function(_0x2831bb){var _0x4981d8=_0x2831bb[_0xa92e('0x26')]({'plain':!![]});var _0x598505=_[_0xa92e('0x2f')](addVoicePrefixExtensions(_0x2cb36c,_0x309131),function(_0x446e43){_0x446e43[_0xa92e('0x50')]=_0x4981d8['id'];_0x446e43[_0xa92e('0x61')]=_0x2cb36c['id'];return _0x446e43;});return db[_0xa92e('0x4f')][_0xa92e('0x62')](_0x598505,{'transaction':_0x3780a9})[_0xa92e('0x2a')](function(_0x340b3c){if(!_0x340b3c){return _0xb2ed89(_0xa92e('0x63'));}else{return _0x10c2e5(_0x340b3c);}})[_0xa92e('0x4a')](function(_0x235994){return _0xb2ed89(_0x235994);});});;});};function addVoicePrefixExtensions(_0xa94570,_0x3cb496){var _0x482683=[];var _0x1e21ba=formatPrefixName(_0xa94570[_0xa92e('0x5f')]);_0x482683['push'](new Extension(_0x1e21ba,0x2,_0xa92e('0x64'),_0xa92e('0x65')+_0xa94570['name']));if(_0xa94570['callerIdAll']){_0x482683['push'](new Extension(_0x1e21ba,0x3,'Set',_0xa92e('0x66')+_0xa94570[_0xa92e('0x67')]));}else{_0x482683[_0xa92e('0x68')](new Extension(_0x1e21ba,0x3,'NoOp',_0xa92e('0x69')));}_0x482683['push'](new Extension(_0x1e21ba,0x4,_0xa92e('0x6a'),_0x3cb496[_0xa92e('0x6b')]+','+_0xa92e('0x6c')+(0x8+_0xa94570[_0xa92e('0x2d')][_0xa92e('0x3a')])+'}'+','+0x1));return _0x482683;}function formatPrefixName(_0x3efe79){var _0x3b6324='_';for(var _0x2ad42b=0x0;_0x2ad42b<_0x3efe79['length'];_0x2ad42b++){if(_0x3efe79[_0xa92e('0x6d')](_0x2ad42b)=='-'){_0x3b6324+=_0x3efe79[_0xa92e('0x6d')](_0x2ad42b);}else{_0x3b6324+='['+_0x3efe79[_0xa92e('0x6d')](_0x2ad42b)+']';}}_0x3b6324+='.';return _0x3b6324;}exports[_0xa92e('0x25')]=function(_0x2d21bd,_0x4c8487,_0x19d424){var _0x196a30=_0x2d21bd['body'];_0x196a30[_0xa92e('0x5f')]=_0xa92e('0x6e')+_0x196a30[_0xa92e('0x2d')]+'-';return db[_0xa92e('0x6f')][_0xa92e('0x4d')](function(_0xa9b7a8){return db[_0xa92e('0x30')][_0xa92e('0x25')](_0x196a30,{'where':{'id':_0x196a30['id']},'transaction':_0xa9b7a8})[_0xa92e('0x2a')](function(){return db[_0xa92e('0x4f')][_0xa92e('0x29')]({'where':{'VoicePrefixId':_0x196a30['id']},'transaction':_0xa9b7a8})[_0xa92e('0x2a')](function(){return db[_0xa92e('0x4f')]['find']({'where':{'id':_0x196a30[_0xa92e('0x50')]},'raw':!![]})[_0xa92e('0x2a')](function(_0x3c723b){return createVoicePrefixExtensions(_0x196a30,_0x3c723b,_0xa9b7a8);});});});})[_0xa92e('0x2a')](function(){return db[_0xa92e('0x30')]['findById'](_0x196a30['id']);})[_0xa92e('0x2a')](respondWithResult(_0x4c8487,null))[_0xa92e('0x4a')](handleError(_0x4c8487,null));};exports[_0xa92e('0x70')]=function(_0x58d1cd,_0x1b49db,_0x305e67){return db[_0xa92e('0x30')][_0xa92e('0x49')]({'where':{'id':_0x58d1cd[_0xa92e('0x47')]['id']}})[_0xa92e('0x2a')](handleEntityNotFound(_0x1b49db,null))[_0xa92e('0x2a')](function(_0x46f917){if(_0x46f917){return _0x46f917[_0xa92e('0x70')](_0x58d1cd['body'][_0xa92e('0x71')],_[_0xa92e('0x72')](_0x58d1cd[_0xa92e('0x4e')],[_0xa92e('0x71'),'id'])||{})['spread'](function(_0x58b39a){for(var _0x12a92e=0x0;_0x12a92e<_0x58d1cd[_0xa92e('0x4e')][_0xa92e('0x71')]['length'];_0x12a92e+=0x1){socket[_0xa92e('0x73')](_0xa92e('0x74'),{'UserId':_0x58d1cd[_0xa92e('0x4e')]['ids'][_0x12a92e],'VoicePrefixId':_0x58d1cd[_0xa92e('0x47')]['id']});}return _0x58b39a;});}})[_0xa92e('0x2a')](respondWithResult(_0x1b49db,null))[_0xa92e('0x4a')](handleError(_0x1b49db,null));};exports[_0xa92e('0x75')]=function(_0x2f5620,_0x4fbba4,_0x3868e2){return db[_0xa92e('0x30')][_0xa92e('0x49')]({'where':{'id':_0x2f5620[_0xa92e('0x47')]['id']}})[_0xa92e('0x2a')](handleEntityNotFound(_0x4fbba4,null))[_0xa92e('0x2a')](function(_0x25a509){if(_0x25a509){return _0x25a509[_0xa92e('0x75')](_0x2f5620[_0xa92e('0x34')][_0xa92e('0x71')])[_0xa92e('0x2a')](function(){if(_[_0xa92e('0x76')](_0x2f5620['query'][_0xa92e('0x71')])){for(var _0x568bdc=0x0;_0x568bdc<_0x2f5620['query'][_0xa92e('0x71')][_0xa92e('0x3a')];_0x568bdc+=0x1){socket[_0xa92e('0x73')](_0xa92e('0x77'),{'UserId':Number(_0x2f5620[_0xa92e('0x34')][_0xa92e('0x71')][_0x568bdc]),'VoicePrefixId':Number(_0x2f5620['params']['id'])});}}else{socket['emit'](_0xa92e('0x77'),{'UserId':Number(_0x2f5620[_0xa92e('0x34')][_0xa92e('0x71')]),'VoicePrefixId':Number(_0x2f5620[_0xa92e('0x47')]['id'])});}});}})['then'](respondWithStatusCode(_0x4fbba4,null))[_0xa92e('0x4a')](handleError(_0x4fbba4,null));};exports[_0xa92e('0x78')]=function(_0x4499bc,_0x47bed4,_0x2d69f7){var _0xc202c0={};var _0x42f637={};var _0x5453c2;var _0x531241;return db[_0xa92e('0x30')][_0xa92e('0x79')]({'where':{'id':_0x4499bc[_0xa92e('0x47')]['id']}})['then'](handleEntityNotFound(_0x47bed4,null))['then'](function(_0x2cf5a2){if(_0x2cf5a2){_0x5453c2=_0x2cf5a2;_0x42f637['model']=_[_0xa92e('0x33')](db['User'][_0xa92e('0x31')]);_0x42f637[_0xa92e('0x34')]=_[_0xa92e('0x33')](_0x4499bc[_0xa92e('0x34')]);_0x42f637[_0xa92e('0x35')]=_['intersection'](_0x42f637['model'],_0x42f637['query']);_0xc202c0[_0xa92e('0x39')]=_[_0xa92e('0x36')](_0x42f637[_0xa92e('0x37')],qs[_0xa92e('0x38')](_0x4499bc[_0xa92e('0x34')][_0xa92e('0x38')]));_0xc202c0[_0xa92e('0x39')]=_0xc202c0['attributes'][_0xa92e('0x3a')]?_0xc202c0[_0xa92e('0x39')]:_0x42f637[_0xa92e('0x37')];_0xc202c0[_0xa92e('0x3c')]=qs[_0xa92e('0x3d')](_0x4499bc[_0xa92e('0x34')][_0xa92e('0x3d')]);_0xc202c0[_0xa92e('0x3e')]=qs[_0xa92e('0x35')](_['pick'](_0x4499bc[_0xa92e('0x34')],_0x42f637[_0xa92e('0x35')]));if(_0x4499bc[_0xa92e('0x34')]['filter']){_0xc202c0[_0xa92e('0x3e')]=_[_0xa92e('0x42')](_0xc202c0[_0xa92e('0x3e')],{'$or':_[_0xa92e('0x2f')](_0xc202c0['attributes'],function(_0x534951){var _0x276298={};_0x276298[_0x534951]={'$like':'%'+_0x4499bc[_0xa92e('0x34')][_0xa92e('0x40')]+'%'};return _0x276298;})});}_0xc202c0=_[_0xa92e('0x42')]({},_0xc202c0,_0x4499bc['options']);return _0x5453c2['getAgents'](_0xc202c0);}})[_0xa92e('0x2a')](function(_0x5c848b){if(_0x5c848b){_0x531241=_0x5c848b[_0xa92e('0x3a')];if(!_0x4499bc[_0xa92e('0x34')][_0xa92e('0x3b')](_0xa92e('0x7a'))){_0xc202c0[_0xa92e('0x20')]=qs[_0xa92e('0x20')](_0x4499bc[_0xa92e('0x34')]['limit']);_0xc202c0[_0xa92e('0x1f')]=qs[_0xa92e('0x1f')](_0x4499bc[_0xa92e('0x34')]['offset']);}return _0x5453c2[_0xa92e('0x78')](_0xc202c0);}})[_0xa92e('0x2a')](function(_0x20479f){if(_0x20479f){return _0x20479f?{'count':_0x531241,'rows':_0x20479f}:null;}})[_0xa92e('0x2a')](respondWithResult(_0x47bed4,null))[_0xa92e('0x4a')](handleError(_0x47bed4,null));};
\ No newline at end of file
diff --git a/server/api/voicePrefix/voicePrefix.events.js b/server/api/voicePrefix/voicePrefix.events.js
index d1f644a..dfc970a 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 _0x9c44=['save','update','remove','emit','hasOwnProperty','hook','exports','VoicePrefix','setMaxListeners'];(function(_0x2fbcf1,_0x325f14){var _0x5e9914=function(_0x70992){while(--_0x70992){_0x2fbcf1['push'](_0x2fbcf1['shift']());}};_0x5e9914(++_0x325f14);}(_0x9c44,0x178));var _0x49c4=function(_0x273c39,_0x1052e6){_0x273c39=_0x273c39-0x0;var _0x46d6b5=_0x9c44[_0x273c39];return _0x46d6b5;};'use strict';var EventEmitter=require('events');var VoicePrefix=require('../../mysqldb')['db'][_0x49c4('0x0')];var VoicePrefixEvents=new EventEmitter();VoicePrefixEvents[_0x49c4('0x1')](0x0);var events={'afterCreate':_0x49c4('0x2'),'afterUpdate':_0x49c4('0x3'),'afterDestroy':_0x49c4('0x4')};function emitEvent(_0x2ad237){return function(_0x4e0313,_0x4941f1,_0x41a183){VoicePrefixEvents['emit'](_0x2ad237+':'+_0x4e0313['id'],_0x4e0313);VoicePrefixEvents[_0x49c4('0x5')](_0x2ad237,_0x4e0313);_0x41a183(null);};}for(var e in events){if(events[_0x49c4('0x6')](e)){var event=events[e];VoicePrefix[_0x49c4('0x7')](e,emitEvent(event));}}module[_0x49c4('0x8')]=VoicePrefixEvents;
\ No newline at end of file
+var _0x008c=['save','remove','emit','hasOwnProperty','hook','events','../../mysqldb','VoicePrefix','setMaxListeners'];(function(_0x4c50d8,_0x3c4a5c){var _0xf00948=function(_0x4a1cb5){while(--_0x4a1cb5){_0x4c50d8['push'](_0x4c50d8['shift']());}};_0xf00948(++_0x3c4a5c);}(_0x008c,0x188));var _0xc008=function(_0x11f0a6,_0x1ce59d){_0x11f0a6=_0x11f0a6-0x0;var _0xa5ab4b=_0x008c[_0x11f0a6];return _0xa5ab4b;};'use strict';var EventEmitter=require(_0xc008('0x0'));var VoicePrefix=require(_0xc008('0x1'))['db'][_0xc008('0x2')];var VoicePrefixEvents=new EventEmitter();VoicePrefixEvents[_0xc008('0x3')](0x0);var events={'afterCreate':_0xc008('0x4'),'afterUpdate':'update','afterDestroy':_0xc008('0x5')};function emitEvent(_0x47063f){return function(_0x10b33c,_0x163bd9,_0x1cbe76){VoicePrefixEvents[_0xc008('0x6')](_0x47063f+':'+_0x10b33c['id'],_0x10b33c);VoicePrefixEvents[_0xc008('0x6')](_0x47063f,_0x10b33c);_0x1cbe76(null);};}for(var e in events){if(events[_0xc008('0x7')](e)){var event=events[e];VoicePrefix[_0xc008('0x8')](e,emitEvent(event));}}module['exports']=VoicePrefixEvents;
\ No newline at end of file
diff --git a/server/api/voicePrefix/voicePrefix.model.js b/server/api/voicePrefix/voicePrefix.model.js
index 2e38f3c..32d7846 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 _0x3723=['moment','request-promise','path','../../config/environment','./voicePrefix.attributes','define','voice_prefixes','../../config/logger'];(function(_0x4552ad,_0xb1a6e4){var _0xe9700b=function(_0x29a723){while(--_0x29a723){_0x4552ad['push'](_0x4552ad['shift']());}};_0xe9700b(++_0xb1a6e4);}(_0x3723,0x87));var _0x3372=function(_0x308a4c,_0x2bf41e){_0x308a4c=_0x308a4c-0x0;var _0x26a229=_0x3723[_0x308a4c];return _0x26a229;};'use strict';var _=require('lodash');var util=require('util');var logger=require(_0x3372('0x0'))('api');var moment=require(_0x3372('0x1'));var BPromise=require('bluebird');var rp=require(_0x3372('0x2'));var fs=require('fs');var path=require(_0x3372('0x3'));var rimraf=require('rimraf');var config=require(_0x3372('0x4'));var attributes=require(_0x3372('0x5'));module['exports']=function(_0x4ef50a,_0x103524){return _0x4ef50a[_0x3372('0x6')]('VoicePrefix',attributes,{'tableName':_0x3372('0x7'),'paranoid':![],'indexes':[],'timestamps':!![]});};
\ No newline at end of file
+var _0x39e3=['rimraf','define','VoicePrefix','voice_prefixes','lodash','util','../../config/logger','api','moment','bluebird','request-promise','path'];(function(_0xf34895,_0x21fb70){var _0x143f44=function(_0x2e7730){while(--_0x2e7730){_0xf34895['push'](_0xf34895['shift']());}};_0x143f44(++_0x21fb70);}(_0x39e3,0xac));var _0x339e=function(_0x555b91,_0x9d2643){_0x555b91=_0x555b91-0x0;var _0x7dd227=_0x39e3[_0x555b91];return _0x7dd227;};'use strict';var _=require(_0x339e('0x0'));var util=require(_0x339e('0x1'));var logger=require(_0x339e('0x2'))(_0x339e('0x3'));var moment=require(_0x339e('0x4'));var BPromise=require(_0x339e('0x5'));var rp=require(_0x339e('0x6'));var fs=require('fs');var path=require(_0x339e('0x7'));var rimraf=require(_0x339e('0x8'));var config=require('../../config/environment');var attributes=require('./voicePrefix.attributes');module['exports']=function(_0x1f83ca,_0x5c2657){return _0x1f83ca[_0x339e('0x9')](_0x339e('0xa'),attributes,{'tableName':_0x339e('0xb'),'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 c234da1..94d80ff 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 _0xbc37=['ioredis','../../mysqldb','../../config/logger','rpc','../../config/environment','jayson/promise','http','defaults','redis','localhost','./voicePrefix.socket','register','request','then','info','VoicePrefix,\x20%s,\x20%s','VoicePrefix,\x20%s,\x20%s,\x20%s','request\x20sent','stringify','error','message','catch','lodash','util','bluebird','randomstring'];(function(_0xf30dc1,_0x3d9e6e){var _0xd16165=function(_0x1649ba){while(--_0x1649ba){_0xf30dc1['push'](_0xf30dc1['shift']());}};_0xd16165(++_0x3d9e6e);}(_0xbc37,0x11a));var _0x7bc3=function(_0x36d00e,_0x5b4769){_0x36d00e=_0x36d00e-0x0;var _0x5603f8=_0xbc37[_0x36d00e];return _0x5603f8;};'use strict';var _=require(_0x7bc3('0x0'));var util=require(_0x7bc3('0x1'));var moment=require('moment');var BPromise=require(_0x7bc3('0x2'));var rs=require(_0x7bc3('0x3'));var fs=require('fs');var Redis=require(_0x7bc3('0x4'));var db=require(_0x7bc3('0x5'))['db'];var utils=require('../../config/utils');var logger=require(_0x7bc3('0x6'))(_0x7bc3('0x7'));var config=require(_0x7bc3('0x8'));var jayson=require(_0x7bc3('0x9'));var client=jayson['client'][_0x7bc3('0xa')]({'port':0x232a});config['redis']=_[_0x7bc3('0xb')](config[_0x7bc3('0xc')],{'host':_0x7bc3('0xd'),'port':0x18eb});var socket=require('socket.io-emitter')(new Redis(config[_0x7bc3('0xc')]));require(_0x7bc3('0xe'))[_0x7bc3('0xf')](socket);function respondWithRpcPromise(_0x399883,_0x5bc8cd,_0x508dc0){return new BPromise(function(_0xf68a4,_0x1f4b40){return client[_0x7bc3('0x10')](_0x399883,_0x508dc0)[_0x7bc3('0x11')](function(_0x20c4a3){logger[_0x7bc3('0x12')](_0x7bc3('0x13'),_0x5bc8cd,'request\x20sent');logger['debug'](_0x7bc3('0x14'),_0x5bc8cd,_0x7bc3('0x15'),JSON[_0x7bc3('0x16')](_0x20c4a3));if(_0x20c4a3[_0x7bc3('0x17')]){if(_0x20c4a3[_0x7bc3('0x17')]['code']===0x1f4){logger[_0x7bc3('0x17')](_0x7bc3('0x13'),_0x5bc8cd,_0x20c4a3[_0x7bc3('0x17')][_0x7bc3('0x18')]);return _0x1f4b40(_0x20c4a3[_0x7bc3('0x17')][_0x7bc3('0x18')]);}logger['error'](_0x7bc3('0x13'),_0x5bc8cd,_0x20c4a3[_0x7bc3('0x17')][_0x7bc3('0x18')]);return _0xf68a4(_0x20c4a3[_0x7bc3('0x17')]['message']);}else{logger[_0x7bc3('0x12')](_0x7bc3('0x13'),_0x5bc8cd,_0x7bc3('0x15'));_0xf68a4(_0x20c4a3['result'][_0x7bc3('0x18')]);}})[_0x7bc3('0x19')](function(_0xf5ebe6){logger[_0x7bc3('0x17')]('VoicePrefix,\x20%s,\x20%s',_0x5bc8cd,_0xf5ebe6);_0x1f4b40(_0xf5ebe6);});});}
\ No newline at end of file
+var _0x89af=['VoicePrefix,\x20%s,\x20%s,\x20%s','stringify','error','message','info','lodash','moment','../../mysqldb','../../config/utils','rpc','jayson/promise','http','defaults','redis','socket.io-emitter','./voicePrefix.socket','register','request','then','VoicePrefix,\x20%s,\x20%s','request\x20sent','debug'];(function(_0xf89181,_0x2b1f87){var _0x4803f3=function(_0x59ac01){while(--_0x59ac01){_0xf89181['push'](_0xf89181['shift']());}};_0x4803f3(++_0x2b1f87);}(_0x89af,0x1e9));var _0xf89a=function(_0x3ed5c5,_0x503ce7){_0x3ed5c5=_0x3ed5c5-0x0;var _0xf35105=_0x89af[_0x3ed5c5];return _0xf35105;};'use strict';var _=require(_0xf89a('0x0'));var util=require('util');var moment=require(_0xf89a('0x1'));var BPromise=require('bluebird');var rs=require('randomstring');var fs=require('fs');var Redis=require('ioredis');var db=require(_0xf89a('0x2'))['db'];var utils=require(_0xf89a('0x3'));var logger=require('../../config/logger')(_0xf89a('0x4'));var config=require('../../config/environment');var jayson=require(_0xf89a('0x5'));var client=jayson['client'][_0xf89a('0x6')]({'port':0x232a});config['redis']=_[_0xf89a('0x7')](config[_0xf89a('0x8')],{'host':'localhost','port':0x18eb});var socket=require(_0xf89a('0x9'))(new Redis(config[_0xf89a('0x8')]));require(_0xf89a('0xa'))[_0xf89a('0xb')](socket);function respondWithRpcPromise(_0x4ea538,_0x36e22a,_0x3ca036){return new BPromise(function(_0x51e845,_0x5cebd6){return client[_0xf89a('0xc')](_0x4ea538,_0x3ca036)[_0xf89a('0xd')](function(_0x4b488f){logger['info'](_0xf89a('0xe'),_0x36e22a,_0xf89a('0xf'));logger[_0xf89a('0x10')](_0xf89a('0x11'),_0x36e22a,_0xf89a('0xf'),JSON[_0xf89a('0x12')](_0x4b488f));if(_0x4b488f['error']){if(_0x4b488f[_0xf89a('0x13')]['code']===0x1f4){logger['error'](_0xf89a('0xe'),_0x36e22a,_0x4b488f[_0xf89a('0x13')][_0xf89a('0x14')]);return _0x5cebd6(_0x4b488f[_0xf89a('0x13')]['message']);}logger[_0xf89a('0x13')]('VoicePrefix,\x20%s,\x20%s',_0x36e22a,_0x4b488f['error'][_0xf89a('0x14')]);return _0x51e845(_0x4b488f[_0xf89a('0x13')][_0xf89a('0x14')]);}else{logger[_0xf89a('0x15')](_0xf89a('0xe'),_0x36e22a,_0xf89a('0xf'));_0x51e845(_0x4b488f['result']['message']);}})['catch'](function(_0x20eaf6){logger[_0xf89a('0x13')](_0xf89a('0xe'),_0x36e22a,_0x20eaf6);_0x5cebd6(_0x20eaf6);});});}
\ No newline at end of file
diff --git a/server/api/voicePrefix/voicePrefix.socket.js b/server/api/voicePrefix/voicePrefix.socket.js
index 0e53350..7aa15c2 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 _0xa877=['removeListener','voicePrefix:','./voicePrefix.events','save','remove','update','emit'];(function(_0x5d4dd3,_0x4d2feb){var _0x23f8a1=function(_0x59252a){while(--_0x59252a){_0x5d4dd3['push'](_0x5d4dd3['shift']());}};_0x23f8a1(++_0x4d2feb);}(_0xa877,0xe9));var _0x7a87=function(_0x42cae2,_0x284ef8){_0x42cae2=_0x42cae2-0x0;var _0x5f256f=_0xa877[_0x42cae2];return _0x5f256f;};'use strict';var VoicePrefixEvents=require(_0x7a87('0x0'));var events=[_0x7a87('0x1'),_0x7a87('0x2'),_0x7a87('0x3')];function createListener(_0x1e2804,_0x31d3be){return function(_0x51b6fb){_0x31d3be[_0x7a87('0x4')](_0x1e2804,_0x51b6fb);};}function removeListener(_0x2f7f95,_0x1528f3){return function(){VoicePrefixEvents[_0x7a87('0x5')](_0x2f7f95,_0x1528f3);};}exports['register']=function(_0x1a1782){for(var _0x3887a1=0x0,_0xddf3f4=events['length'];_0x3887a1<_0xddf3f4;_0x3887a1++){var _0x485c66=events[_0x3887a1];var _0x525ee3=createListener(_0x7a87('0x6')+_0x485c66,_0x1a1782);VoicePrefixEvents['on'](_0x485c66,_0x525ee3);}};
\ No newline at end of file
+var _0x4c70=['./voicePrefix.events','save','remove','update','removeListener','register','length','voicePrefix:'];(function(_0x3ff085,_0x27c92e){var _0x2b68c3=function(_0x37811e){while(--_0x37811e){_0x3ff085['push'](_0x3ff085['shift']());}};_0x2b68c3(++_0x27c92e);}(_0x4c70,0xa0));var _0x04c7=function(_0xab0515,_0x4b8ab2){_0xab0515=_0xab0515-0x0;var _0x443d59=_0x4c70[_0xab0515];return _0x443d59;};'use strict';var VoicePrefixEvents=require(_0x04c7('0x0'));var events=[_0x04c7('0x1'),_0x04c7('0x2'),_0x04c7('0x3')];function createListener(_0x516196,_0x1b4561){return function(_0x557649){_0x1b4561['emit'](_0x516196,_0x557649);};}function removeListener(_0x2f44e1,_0x2d53b4){return function(){VoicePrefixEvents[_0x04c7('0x4')](_0x2f44e1,_0x2d53b4);};}exports[_0x04c7('0x5')]=function(_0x3875ca){for(var _0x43e223=0x0,_0x19fec2=events[_0x04c7('0x6')];_0x43e223<_0x19fec2;_0x43e223++){var _0x5b3263=events[_0x43e223];var _0x4d30c0=createListener(_0x04c7('0x7')+_0x5b3263,_0x3875ca);VoicePrefixEvents['on'](_0x5b3263,_0x4d30c0);}};
\ No newline at end of file
diff --git a/server/api/voiceQueue/index.js b/server/api/voiceQueue/index.js
index dd734bd..72a7c8c 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 _0x95bd=['addBlackLists','put','destroy','delete','removeAgents','removeLists','removeBlackLists','exports','util','path','connect-timeout','express','Router','../../components/auth/service','../../components/interaction/service','get','isAuthenticated','index','/:id','/:id/hoppers','/:id/hopper_histories','getHopperHistories','/:id/hopper_finals','getHopperFinals','/:id/hopper_black','getHopperBlacks','/:id/teams','getTeams','/:id/users','/:id/members','getMembers','/:id/lists','getLists','post','/:id/clone','clone','addAgents','addLists','/:id/blacklists'];(function(_0x1cef12,_0x2ac5b6){var _0x40391d=function(_0x466741){while(--_0x466741){_0x1cef12['push'](_0x1cef12['shift']());}};_0x40391d(++_0x2ac5b6);}(_0x95bd,0x1dc));var _0xd95b=function(_0x20a584,_0xe384a5){_0x20a584=_0x20a584-0x0;var _0x4b41a8=_0x95bd[_0x20a584];return _0x4b41a8;};'use strict';var multer=require('multer');var util=require(_0xd95b('0x0'));var path=require(_0xd95b('0x1'));var timeout=require(_0xd95b('0x2'));var express=require(_0xd95b('0x3'));var router=express[_0xd95b('0x4')]();var auth=require(_0xd95b('0x5'));var interaction=require(_0xd95b('0x6'));var config=require('../../config/environment');var controller=require('./voiceQueue.controller');router[_0xd95b('0x7')]('/',auth[_0xd95b('0x8')](),controller[_0xd95b('0x9')]);router[_0xd95b('0x7')](_0xd95b('0xa'),auth['isAuthenticated'](),controller['show']);router[_0xd95b('0x7')](_0xd95b('0xb'),auth[_0xd95b('0x8')](),controller['getHoppers']);router[_0xd95b('0x7')](_0xd95b('0xc'),auth['isAuthenticated'](),controller[_0xd95b('0xd')]);router['get'](_0xd95b('0xe'),auth[_0xd95b('0x8')](),controller[_0xd95b('0xf')]);router[_0xd95b('0x7')](_0xd95b('0x10'),auth['isAuthenticated'](),controller[_0xd95b('0x11')]);router[_0xd95b('0x7')](_0xd95b('0x12'),auth[_0xd95b('0x8')](),controller[_0xd95b('0x13')]);router[_0xd95b('0x7')](_0xd95b('0x14'),auth[_0xd95b('0x8')](),controller['getAgents']);router[_0xd95b('0x7')](_0xd95b('0x15'),auth[_0xd95b('0x8')](),controller[_0xd95b('0x16')]);router['get'](_0xd95b('0x17'),auth[_0xd95b('0x8')](),controller[_0xd95b('0x18')]);router[_0xd95b('0x7')]('/:id/blacklists',auth['isAuthenticated'](),controller['getBlackLists']);router[_0xd95b('0x19')]('/',auth['isAuthenticated'](),controller['create']);router[_0xd95b('0x19')](_0xd95b('0x1a'),auth[_0xd95b('0x8')](),controller[_0xd95b('0x1b')]);router[_0xd95b('0x19')]('/:id/teams',auth[_0xd95b('0x8')](),controller['addTeams']);router[_0xd95b('0x19')](_0xd95b('0x14'),auth[_0xd95b('0x8')](),controller[_0xd95b('0x1c')]);router['post'](_0xd95b('0x17'),auth[_0xd95b('0x8')](),controller[_0xd95b('0x1d')]);router[_0xd95b('0x19')](_0xd95b('0x1e'),auth[_0xd95b('0x8')](),controller[_0xd95b('0x1f')]);router[_0xd95b('0x20')]('/:id',auth[_0xd95b('0x8')](),controller['update']);router['delete'](_0xd95b('0xa'),auth[_0xd95b('0x8')](),controller[_0xd95b('0x21')]);router[_0xd95b('0x22')](_0xd95b('0x12'),auth[_0xd95b('0x8')](),controller['removeTeams']);router['delete']('/:id/users',auth[_0xd95b('0x8')](),controller[_0xd95b('0x23')]);router[_0xd95b('0x22')]('/:id/lists',auth[_0xd95b('0x8')](),controller[_0xd95b('0x24')]);router['delete']('/:id/blacklists',auth['isAuthenticated'](),controller[_0xd95b('0x25')]);module[_0xd95b('0x26')]=router;
\ No newline at end of file
+var _0x7da7=['getHopperBlacks','/:id/teams','/:id/users','getAgents','/:id/members','getMembers','/:id/lists','getLists','/:id/blacklists','create','post','addTeams','addAgents','addLists','update','delete','destroy','removeTeams','removeLists','exports','multer','util','Router','../../components/auth/service','./voiceQueue.controller','get','isAuthenticated','index','/:id','show','getHoppers','/:id/hopper_histories','getHopperHistories','/:id/hopper_finals','getHopperFinals','/:id/hopper_black'];(function(_0x15835c,_0x5428d4){var _0x427050=function(_0xba08fa){while(--_0xba08fa){_0x15835c['push'](_0x15835c['shift']());}};_0x427050(++_0x5428d4);}(_0x7da7,0x158));var _0x77da=function(_0x217ff6,_0x36f75d){_0x217ff6=_0x217ff6-0x0;var _0x417c93=_0x7da7[_0x217ff6];return _0x417c93;};'use strict';var multer=require(_0x77da('0x0'));var util=require(_0x77da('0x1'));var path=require('path');var timeout=require('connect-timeout');var express=require('express');var router=express[_0x77da('0x2')]();var auth=require(_0x77da('0x3'));var interaction=require('../../components/interaction/service');var config=require('../../config/environment');var controller=require(_0x77da('0x4'));router[_0x77da('0x5')]('/',auth[_0x77da('0x6')](),controller[_0x77da('0x7')]);router[_0x77da('0x5')](_0x77da('0x8'),auth[_0x77da('0x6')](),controller[_0x77da('0x9')]);router[_0x77da('0x5')]('/:id/hoppers',auth['isAuthenticated'](),controller[_0x77da('0xa')]);router[_0x77da('0x5')](_0x77da('0xb'),auth[_0x77da('0x6')](),controller[_0x77da('0xc')]);router['get'](_0x77da('0xd'),auth[_0x77da('0x6')](),controller[_0x77da('0xe')]);router[_0x77da('0x5')](_0x77da('0xf'),auth[_0x77da('0x6')](),controller[_0x77da('0x10')]);router[_0x77da('0x5')](_0x77da('0x11'),auth[_0x77da('0x6')](),controller['getTeams']);router['get'](_0x77da('0x12'),auth[_0x77da('0x6')](),controller[_0x77da('0x13')]);router[_0x77da('0x5')](_0x77da('0x14'),auth[_0x77da('0x6')](),controller[_0x77da('0x15')]);router[_0x77da('0x5')](_0x77da('0x16'),auth[_0x77da('0x6')](),controller[_0x77da('0x17')]);router[_0x77da('0x5')](_0x77da('0x18'),auth[_0x77da('0x6')](),controller['getBlackLists']);router['post']('/',auth[_0x77da('0x6')](),controller[_0x77da('0x19')]);router[_0x77da('0x1a')]('/:id/clone',auth[_0x77da('0x6')](),controller['clone']);router[_0x77da('0x1a')](_0x77da('0x11'),auth[_0x77da('0x6')](),controller[_0x77da('0x1b')]);router[_0x77da('0x1a')](_0x77da('0x12'),auth['isAuthenticated'](),controller[_0x77da('0x1c')]);router[_0x77da('0x1a')]('/:id/lists',auth[_0x77da('0x6')](),controller[_0x77da('0x1d')]);router[_0x77da('0x1a')]('/:id/blacklists',auth['isAuthenticated'](),controller['addBlackLists']);router['put']('/:id',auth['isAuthenticated'](),controller[_0x77da('0x1e')]);router[_0x77da('0x1f')]('/:id',auth[_0x77da('0x6')](),controller[_0x77da('0x20')]);router[_0x77da('0x1f')](_0x77da('0x11'),auth[_0x77da('0x6')](),controller[_0x77da('0x21')]);router['delete']('/:id/users',auth['isAuthenticated'](),controller['removeAgents']);router[_0x77da('0x1f')](_0x77da('0x16'),auth['isAuthenticated'](),controller[_0x77da('0x22')]);router['delete']('/:id/blacklists',auth[_0x77da('0x6')](),controller['removeBlackLists']);module[_0x77da('0x23')]=router;
\ No newline at end of file
diff --git a/server/api/voiceQueue/voiceQueue.attributes.js b/server/api/voiceQueue/voiceQueue.attributes.js
index 090b2bb..b813b50 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(_0x25e995,_0x143cdc){var _0x446a58=function(_0x545ebc){while(--_0x545ebc){_0x25e995['push'](_0x25e995['shift']());}};_0x446a58(++_0x143cdc);}(_0xa9e0,0x123));var _0x0a9e=function(_0x138f59,_0x1b53fb){_0x138f59=_0x138f59-0x0;var _0x3d114d=_0xa9e0[_0x138f59];return _0x3d114d;};'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(_0x3044e3,_0x255336){var _0x389181=function(_0x4aac71){while(--_0x4aac71){_0x3044e3['push'](_0x3044e3['shift']());}};_0x389181(++_0x255336);}(_0xa9e0,0x123));var _0x0a9e=function(_0x2763f2,_0x416af8){_0x2763f2=_0x2763f2-0x0;var _0x3ef471=_0xa9e0[_0x2763f2];return _0x3ef471;};'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 703e1a6..984a5fc 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 _0x2cae=['eml-format','fast-json-patch','request-promise','bluebird','mustache','util','path','to-csv','ejs','squel','jsforce','desk.js','querystring','../../components/parsers/advancedSearch','../../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','Content-Range','apply','reject','save','update','then','destroy','get','VoiceQueues','inbound','filter','ignore','map','value','includes','type','name','UserProfileResource','error','stack','send','rawAttributes','key','model','query','keys','filters','intersection','fields','attributes','length','hasOwnProperty','order','sort','pick','where','merge','VIRTUAL','options','VoiceQueue','includeAll','include','findAll','rows','catch','show','find','create','user','Unable\x20to\x20retrieve\x20the\x20current\x20user','role','QueueCampaigns','outbound','UserProfileSection','autoAssociation','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','clone','omit','createdAt','updatedAt','body','userProfileId','params','CmHopper','nolimit','VoiceQueueId','getHopperHistories','findOne','CmHopperHistory','getHopperFinals','CmHopperFinal','getHopperBlacks','CmHopperBlack','getTeams','Team','teams','User','Agents','voicePause','interface','forEach','penalty','sequelize','transaction','each','UserVoiceQueue','findOrCreate','UserVoiceQueueRt','upsert','isNil','emit','userVoiceQueue:save','ids','field','tq.TeamId','join','user_has_teams','ut.TeamId\x20=\x20tq.TeamId','VoiceQueueId\x20=\x20?','ut.UserId\x20=\x20?','push','toString','SELECT','every','TeamId','all','union','isEmpty','removeAgents','addAgents','spread','online','format','SIP/%s','isArray','userVoiceQueue:remove','getAgents','getMembers','getLists','CmList','addLists','dialCheckDuplicateType','always','insert','into','cm_hopper','fromQuery','phone','scheduledAt','ContactId','ListId','select','NOW()','CmListId','from','cm_contacts','deletedAt\x20IS\x20NULL','ListId\x20=\x20?','phone\x20NOT\x20IN\x20(?)','COALESCE(calleridnum,\x27\x27)','cm_hopper_final','COALESCE(phone,\x27\x27)','onlyIfOpen','phone\x20IS\x20NOT\x20NULL','removeLists','getBlackLists','addBlackLists','cm_hopper_black','removeBlackLists','html-pdf'];(function(_0x1d64c9,_0x23b469){var _0x51bc66=function(_0x50df12){while(--_0x50df12){_0x1d64c9['push'](_0x1d64c9['shift']());}};_0x51bc66(++_0x23b469);}(_0x2cae,0x16b));var _0xe2ca=function(_0x1f8053,_0x111077){_0x1f8053=_0x1f8053-0x0;var _0x174fd8=_0x2cae[_0x1f8053];return _0x174fd8;};'use strict';var pdf=require(_0xe2ca('0x0'));var emlformat=require(_0xe2ca('0x1'));var rimraf=require('rimraf');var zipdir=require('zip-dir');var jsonpatch=require(_0xe2ca('0x2'));var rp=require(_0xe2ca('0x3'));var moment=require('moment');var BPromise=require(_0xe2ca('0x4'));var Mustache=require(_0xe2ca('0x5'));var util=require(_0xe2ca('0x6'));var path=require(_0xe2ca('0x7'));var sox=require('sox');var csv=require(_0xe2ca('0x8'));var ejs=require(_0xe2ca('0x9'));var fs=require('fs');var _=require('lodash');var squel=require(_0xe2ca('0xa'));var crypto=require('crypto');var jsforce=require(_0xe2ca('0xb'));var deskjs=require(_0xe2ca('0xc'));var toCsv=require(_0xe2ca('0x8'));var querystring=require(_0xe2ca('0xd'));var Papa=require('papaparse');var Redis=require('ioredis');var authService=require('../../components/auth/service');var qs=require('../../components/parsers/qs');var as=require(_0xe2ca('0xe'));var hardwareService=require(_0xe2ca('0xf'));var logger=require(_0xe2ca('0x10'))(_0xe2ca('0x11'));var utils=require(_0xe2ca('0x12'));var config=require(_0xe2ca('0x13'));var db=require(_0xe2ca('0x14'))['db'];config['redis']=_[_0xe2ca('0x15')](config[_0xe2ca('0x16')],{'host':_0xe2ca('0x17'),'port':0x18eb});var socket=require(_0xe2ca('0x18'))(new Redis(config[_0xe2ca('0x16')]));require('./voiceQueue.socket')[_0xe2ca('0x19')](socket);function respondWithStatusCode(_0x3cfcc9,_0x27c3ad){_0x27c3ad=_0x27c3ad||0xcc;return function(_0x1c7155){if(_0x1c7155){return _0x3cfcc9[_0xe2ca('0x1a')](_0x27c3ad);}return _0x3cfcc9[_0xe2ca('0x1b')](_0x27c3ad)[_0xe2ca('0x1c')]();};}function respondWithResult(_0x29cdcf,_0x326340){_0x326340=_0x326340||0xc8;return function(_0x10def0){if(_0x10def0){return _0x29cdcf['status'](_0x326340)[_0xe2ca('0x1d')](_0x10def0);}};}function respondWithFilteredResult(_0x4c7cc6,_0x4ca8fd){return function(_0x2d5fda){if(_0x2d5fda){var _0x18cd42=_0x2d5fda[_0xe2ca('0x1e')],_0x5d9135=_0x4ca8fd['offset'],_0x393c23=_0x4ca8fd[_0xe2ca('0x1f')]+_0x4ca8fd[_0xe2ca('0x20')],_0x20cb34;if(_0x393c23>=_0x18cd42){_0x393c23=_0x18cd42;_0x20cb34=0xc8;}else{_0x20cb34=0xce;}_0x4c7cc6[_0xe2ca('0x1b')](_0x20cb34);return _0x4c7cc6['set'](_0xe2ca('0x21'),_0x5d9135+'-'+_0x393c23+'/'+_0x18cd42)['json'](_0x2d5fda);}return null;};}function patchUpdates(_0x16f418){return function(_0x32c900){try{jsonpatch[_0xe2ca('0x22')](_0x32c900,_0x16f418,!![]);}catch(_0x391084){return BPromise[_0xe2ca('0x23')](_0x391084);}return _0x32c900[_0xe2ca('0x24')]();};}function saveUpdates(_0x50af69,_0x1a1522){return function(_0x23e797){if(_0x23e797){return _0x23e797[_0xe2ca('0x25')](_0x50af69)[_0xe2ca('0x26')](function(_0x18a6c6){return _0x18a6c6;});}return null;};}function removeEntity(_0x2772b5,_0xa1fa2b){return function(_0x221f80){if(_0x221f80){return _0x221f80[_0xe2ca('0x27')]()['then'](function(){var _0xf6e52a=_0x221f80[_0xe2ca('0x28')]({'plain':!![]});var _0x3f3d6e=[{'name':_0xe2ca('0x29'),'value':_0xe2ca('0x2a'),'ignore':![]},{'name':'QueueCampaigns','value':'outbound','ignore':![]}];var _0x20ac37=_(_0x3f3d6e)[_0xe2ca('0x2b')](_0xe2ca('0x2c'))[_0xe2ca('0x2d')](_0xe2ca('0x2e'))[_0xe2ca('0x2e')]();if(_[_0xe2ca('0x2f')](_0x20ac37,_0xf6e52a[_0xe2ca('0x30')])){return;}var _0x565e9b=_['find'](_0x3f3d6e,[_0xe2ca('0x2e'),_0xf6e52a[_0xe2ca('0x30')]])[_0xe2ca('0x31')];return db[_0xe2ca('0x32')][_0xe2ca('0x27')]({'where':{'type':_0x565e9b,'resourceId':_0xf6e52a['id']}})[_0xe2ca('0x26')](function(){return _0x221f80;});})[_0xe2ca('0x26')](function(){_0x2772b5[_0xe2ca('0x1b')](0xcc)[_0xe2ca('0x1c')]();});}};}function handleEntityNotFound(_0x21a460,_0x303166){return function(_0x9ff1e2){if(!_0x9ff1e2){_0x21a460[_0xe2ca('0x1a')](0x194);}return _0x9ff1e2;};}function handleError(_0x3ae982,_0x4ada58){_0x4ada58=_0x4ada58||0x1f4;return function(_0x406594){logger[_0xe2ca('0x33')](_0x406594[_0xe2ca('0x34')]);if(_0x406594[_0xe2ca('0x31')]){delete _0x406594[_0xe2ca('0x31')];}_0x3ae982[_0xe2ca('0x1b')](_0x4ada58)[_0xe2ca('0x35')](_0x406594);};}exports['index']=function(_0x589f7f,_0x536296){var _0x30b9e4={},_0x179262={},_0xd6e534={'count':0x0,'rows':[]};var _0x19bbfe=_[_0xe2ca('0x2d')](db['VoiceQueue'][_0xe2ca('0x36')],function(_0x713af0){return{'name':_0x713af0['fieldName'],'type':_0x713af0[_0xe2ca('0x30')][_0xe2ca('0x37')]};});_0x179262[_0xe2ca('0x38')]=_['map'](_0x19bbfe,_0xe2ca('0x31'));_0x179262[_0xe2ca('0x39')]=_[_0xe2ca('0x3a')](_0x589f7f['query']);_0x179262[_0xe2ca('0x3b')]=_['intersection'](_0x179262[_0xe2ca('0x38')],_0x179262['query']);_0x30b9e4['attributes']=_[_0xe2ca('0x3c')](_0x179262[_0xe2ca('0x38')],qs[_0xe2ca('0x3d')](_0x589f7f['query'][_0xe2ca('0x3d')]));_0x30b9e4[_0xe2ca('0x3e')]=_0x30b9e4[_0xe2ca('0x3e')][_0xe2ca('0x3f')]?_0x30b9e4['attributes']:_0x179262['model'];if(!_0x589f7f[_0xe2ca('0x39')][_0xe2ca('0x40')]('nolimit')){_0x30b9e4[_0xe2ca('0x20')]=qs[_0xe2ca('0x20')](_0x589f7f['query']['limit']);_0x30b9e4['offset']=qs['offset'](_0x589f7f[_0xe2ca('0x39')]['offset']);}_0x30b9e4[_0xe2ca('0x41')]=qs[_0xe2ca('0x42')](_0x589f7f[_0xe2ca('0x39')]['sort']);_0x30b9e4['where']=qs[_0xe2ca('0x3b')](_[_0xe2ca('0x43')](_0x589f7f[_0xe2ca('0x39')],_0x179262['filters']));if(_0x589f7f[_0xe2ca('0x39')][_0xe2ca('0x2b')]){_0x30b9e4[_0xe2ca('0x44')]=_[_0xe2ca('0x45')](_0x30b9e4['where'],{'$or':_['map'](_0x19bbfe,function(_0x5655dd){if(_0x5655dd[_0xe2ca('0x30')]!==_0xe2ca('0x46')){var _0x3a776c={};_0x3a776c[_0x5655dd[_0xe2ca('0x31')]]={'$like':'%'+_0x589f7f['query'][_0xe2ca('0x2b')]+'%'};return _0x3a776c;}})});}_0x30b9e4=_[_0xe2ca('0x45')]({},_0x30b9e4,_0x589f7f[_0xe2ca('0x47')]);var _0x516fa4={'where':_0x30b9e4[_0xe2ca('0x44')]};return db[_0xe2ca('0x48')][_0xe2ca('0x1e')](_0x516fa4)[_0xe2ca('0x26')](function(_0x285883){_0xd6e534[_0xe2ca('0x1e')]=_0x285883;if(_0x589f7f[_0xe2ca('0x39')][_0xe2ca('0x49')]){_0x30b9e4[_0xe2ca('0x4a')]=[{'all':!![]}];}return db[_0xe2ca('0x48')][_0xe2ca('0x4b')](_0x30b9e4);})[_0xe2ca('0x26')](function(_0x4fbe1b){_0xd6e534[_0xe2ca('0x4c')]=_0x4fbe1b;return _0xd6e534;})[_0xe2ca('0x26')](respondWithFilteredResult(_0x536296,_0x30b9e4))[_0xe2ca('0x4d')](handleError(_0x536296,null));};exports[_0xe2ca('0x4e')]=function(_0x5b3abd,_0x3d4caa){var _0x16bab5={'raw':![],'where':{'id':_0x5b3abd['params']['id']}},_0x2c80cc={};_0x2c80cc[_0xe2ca('0x38')]=_[_0xe2ca('0x3a')](db[_0xe2ca('0x48')][_0xe2ca('0x36')]);_0x2c80cc[_0xe2ca('0x39')]=_[_0xe2ca('0x3a')](_0x5b3abd[_0xe2ca('0x39')]);_0x2c80cc['filters']=_[_0xe2ca('0x3c')](_0x2c80cc[_0xe2ca('0x38')],_0x2c80cc[_0xe2ca('0x39')]);_0x16bab5[_0xe2ca('0x3e')]=_[_0xe2ca('0x3c')](_0x2c80cc['model'],qs[_0xe2ca('0x3d')](_0x5b3abd['query'][_0xe2ca('0x3d')]));_0x16bab5[_0xe2ca('0x3e')]=_0x16bab5[_0xe2ca('0x3e')][_0xe2ca('0x3f')]?_0x16bab5[_0xe2ca('0x3e')]:_0x2c80cc[_0xe2ca('0x38')];if(_0x5b3abd[_0xe2ca('0x39')][_0xe2ca('0x49')]){_0x16bab5[_0xe2ca('0x4a')]=[{'all':!![]}];}_0x16bab5=_[_0xe2ca('0x45')]({},_0x16bab5,_0x5b3abd[_0xe2ca('0x47')]);return db[_0xe2ca('0x48')][_0xe2ca('0x4f')](_0x16bab5)['then'](handleEntityNotFound(_0x3d4caa,null))[_0xe2ca('0x26')](respondWithResult(_0x3d4caa,null))[_0xe2ca('0x4d')](handleError(_0x3d4caa,null));};exports['create']=function(_0x489384,_0x38196d){return db[_0xe2ca('0x48')][_0xe2ca('0x50')](_0x489384['body'],{})[_0xe2ca('0x26')](function(_0x32cc82){var _0x25595e=_0x489384[_0xe2ca('0x51')]['get']({'plain':!![]});if(!_0x25595e)throw new Error(_0xe2ca('0x52'));if(_0x25595e[_0xe2ca('0x53')]==='user'){var _0x1ce81b=_0x32cc82[_0xe2ca('0x28')]({'plain':!![]});var _0x3c34c9=[{'name':_0xe2ca('0x29'),'value':'inbound'},{'name':_0xe2ca('0x54'),'value':_0xe2ca('0x55')}];var _0x244e61=_[_0xe2ca('0x4f')](_0x3c34c9,[_0xe2ca('0x2e'),_0x1ce81b['type']])[_0xe2ca('0x31')];return db[_0xe2ca('0x56')][_0xe2ca('0x4f')]({'where':{'name':_0x244e61,'userProfileId':_0x25595e['userProfileId']},'raw':!![]})[_0xe2ca('0x26')](function(_0x22b330){if(_0x22b330&&_0x22b330[_0xe2ca('0x57')]===0x0){return db[_0xe2ca('0x32')][_0xe2ca('0x50')]({'name':_0x1ce81b[_0xe2ca('0x31')],'resourceId':_0x1ce81b['id'],'type':_0x22b330[_0xe2ca('0x31')],'sectionId':_0x22b330['id']},{})['then'](function(){return _0x32cc82;});}else{return _0x32cc82;}})['catch'](function(_0x5b7e14){logger[_0xe2ca('0x33')](_0xe2ca('0x58'),_0x5b7e14);throw _0x5b7e14;});}return _0x32cc82;})[_0xe2ca('0x26')](respondWithResult(_0x38196d,0xc9))[_0xe2ca('0x4d')](handleError(_0x38196d,null));};exports[_0xe2ca('0x59')]=function(_0x408443,_0x39149e){var _0x532ac8={'where':{'id':_0x408443['params']['id']}},_0x15e541={};_0x15e541['model']=_[_0xe2ca('0x3a')](db[_0xe2ca('0x48')]['rawAttributes']);_0x532ac8['attributes']=_[_0xe2ca('0x3c')](_0x15e541[_0xe2ca('0x38')],qs[_0xe2ca('0x3d')](_0x408443['query'][_0xe2ca('0x3d')]));_0x532ac8[_0xe2ca('0x3e')]=_0x532ac8[_0xe2ca('0x3e')][_0xe2ca('0x3f')]?_0x532ac8[_0xe2ca('0x3e')]:_0x15e541['model'];if(_0x408443['query'][_0xe2ca('0x49')]){_0x532ac8[_0xe2ca('0x4a')]=[{'all':!![]}];}_0x532ac8=_['merge']({},_0x532ac8,_0x408443[_0xe2ca('0x47')]);return db[_0xe2ca('0x48')][_0xe2ca('0x4f')](_0x532ac8)['then'](handleEntityNotFound(_0x39149e,null))['then'](function(_0x342d00){if(_0x342d00){var _0x27e600=_0x342d00[_0xe2ca('0x28')]({'plain':!![]});_0x27e600=qs[_0xe2ca('0x5a')](_0x27e600,['id',_0xe2ca('0x5b'),_0xe2ca('0x5c')]);_0x408443[_0xe2ca('0x5d')]=_[_0xe2ca('0x5a')](_0x408443[_0xe2ca('0x5d')],['id',_0xe2ca('0x5b'),'updatedAt']);return db[_0xe2ca('0x48')]['create'](_[_0xe2ca('0x45')](_0x27e600,_0x408443[_0xe2ca('0x5d')]),{'include':_0x408443[_0xe2ca('0x39')]['includeAll']?[{'all':!![]}]:undefined})[_0xe2ca('0x26')](function(_0x20cb2d){var _0x3fef50=_0x408443['user'][_0xe2ca('0x28')]({'plain':!![]});if(!_0x3fef50)throw new Error(_0xe2ca('0x52'));if(_0x3fef50[_0xe2ca('0x53')]==='user'){var _0x3322b6=_0x20cb2d['get']({'plain':!![]});var _0x565452=[{'name':_0xe2ca('0x29'),'value':_0xe2ca('0x2a')},{'name':_0xe2ca('0x54'),'value':'outbound'}];var _0x53a167=_[_0xe2ca('0x4f')](_0x565452,['value',_0x3322b6[_0xe2ca('0x30')]])['name'];return db[_0xe2ca('0x56')][_0xe2ca('0x4f')]({'where':{'name':_0x53a167,'userProfileId':_0x3fef50[_0xe2ca('0x5e')]},'raw':!![]})[_0xe2ca('0x26')](function(_0x376570){if(_0x376570&&_0x376570[_0xe2ca('0x57')]===0x0){return db[_0xe2ca('0x32')][_0xe2ca('0x50')]({'name':_0x3322b6[_0xe2ca('0x31')],'resourceId':_0x3322b6['id'],'type':_0x376570['name'],'sectionId':_0x376570['id']},{})['then'](function(){return _0x20cb2d;});}else{return _0x20cb2d;}})[_0xe2ca('0x4d')](function(_0x53614b){logger[_0xe2ca('0x33')](_0xe2ca('0x58'),_0x53614b);throw _0x53614b;});}return _0x20cb2d;});}})[_0xe2ca('0x26')](respondWithResult(_0x39149e,0xc9))['catch'](handleError(_0x39149e,null));};exports[_0xe2ca('0x25')]=function(_0x3f31fa,_0x38a228){if(_0x3f31fa[_0xe2ca('0x5d')]['id']){delete _0x3f31fa[_0xe2ca('0x5d')]['id'];}return db['VoiceQueue'][_0xe2ca('0x4f')]({'where':{'id':_0x3f31fa[_0xe2ca('0x5f')]['id']}})[_0xe2ca('0x26')](handleEntityNotFound(_0x38a228,null))[_0xe2ca('0x26')](saveUpdates(_0x3f31fa[_0xe2ca('0x5d')],null))[_0xe2ca('0x26')](respondWithResult(_0x38a228,null))[_0xe2ca('0x4d')](handleError(_0x38a228,null));};exports['destroy']=function(_0x196c62,_0x3f005a){return db[_0xe2ca('0x48')][_0xe2ca('0x4f')]({'where':{'id':_0x196c62[_0xe2ca('0x5f')]['id']}})['then'](handleEntityNotFound(_0x3f005a,null))['then'](removeEntity(_0x3f005a,null))[_0xe2ca('0x4d')](handleError(_0x3f005a,null));};exports['getHoppers']=function(_0x1bd196,_0x4e88f0,_0x2831ca){var _0x34c424={'raw':![],'where':{}};var _0x4bedcf={};var _0x33b4e9={'count':0x0,'rows':[]};return db[_0xe2ca('0x48')]['findOne']({'where':{'id':_0x1bd196['params']['id']}})[_0xe2ca('0x26')](handleEntityNotFound(_0x4e88f0,null))[_0xe2ca('0x26')](function(_0x3d87c4){if(_0x3d87c4){_0x4bedcf['model']=_[_0xe2ca('0x3a')](db[_0xe2ca('0x60')][_0xe2ca('0x36')]);_0x4bedcf[_0xe2ca('0x39')]=_[_0xe2ca('0x3a')](_0x1bd196['query']);_0x4bedcf[_0xe2ca('0x3b')]=_[_0xe2ca('0x3c')](_0x4bedcf['model'],_0x4bedcf['query']);_0x34c424['attributes']=_[_0xe2ca('0x3c')](_0x4bedcf[_0xe2ca('0x38')],qs[_0xe2ca('0x3d')](_0x1bd196[_0xe2ca('0x39')][_0xe2ca('0x3d')]));_0x34c424['attributes']=_0x34c424[_0xe2ca('0x3e')][_0xe2ca('0x3f')]?_0x34c424[_0xe2ca('0x3e')]:_0x4bedcf[_0xe2ca('0x38')];if(!_0x1bd196[_0xe2ca('0x39')][_0xe2ca('0x40')](_0xe2ca('0x61'))){_0x34c424[_0xe2ca('0x20')]=qs['limit'](_0x1bd196[_0xe2ca('0x39')][_0xe2ca('0x20')]);_0x34c424[_0xe2ca('0x1f')]=qs[_0xe2ca('0x1f')](_0x1bd196['query']['offset']);}_0x34c424['order']=qs[_0xe2ca('0x42')](_0x1bd196[_0xe2ca('0x39')]['sort']);_0x34c424['where']=qs[_0xe2ca('0x3b')](_[_0xe2ca('0x43')](_0x1bd196['query'],_0x4bedcf[_0xe2ca('0x3b')]));_0x34c424[_0xe2ca('0x44')][_0xe2ca('0x62')]=_0x3d87c4['id'];if(_0x1bd196[_0xe2ca('0x39')][_0xe2ca('0x2b')]){_0x34c424[_0xe2ca('0x44')]=_[_0xe2ca('0x45')](_0x34c424[_0xe2ca('0x44')],{'$or':_[_0xe2ca('0x2d')](_0x34c424[_0xe2ca('0x3e')],function(_0x31c11e){var _0xda6ea4={};_0xda6ea4[_0x31c11e]={'$like':'%'+_0x1bd196[_0xe2ca('0x39')][_0xe2ca('0x2b')]+'%'};return _0xda6ea4;})});}_0x34c424=_[_0xe2ca('0x45')]({},_0x34c424,_0x1bd196[_0xe2ca('0x47')]);return db[_0xe2ca('0x60')][_0xe2ca('0x1e')]({'where':_0x34c424[_0xe2ca('0x44')]})[_0xe2ca('0x26')](function(_0x3ed63d){_0x33b4e9[_0xe2ca('0x1e')]=_0x3ed63d;if(_0x1bd196[_0xe2ca('0x39')][_0xe2ca('0x49')]){_0x34c424[_0xe2ca('0x4a')]=[{'all':!![]}];}return db[_0xe2ca('0x60')][_0xe2ca('0x4b')](_0x34c424);})[_0xe2ca('0x26')](function(_0x193b45){_0x33b4e9[_0xe2ca('0x4c')]=_0x193b45;return _0x33b4e9;});}})[_0xe2ca('0x26')](respondWithFilteredResult(_0x4e88f0,_0x34c424))[_0xe2ca('0x4d')](handleError(_0x4e88f0,null));};exports[_0xe2ca('0x63')]=function(_0x513414,_0x395e2a,_0x247783){var _0x4e9eb8={'raw':!![],'where':{}};var _0x1ef5f3={};var _0x4e4976={'count':0x0,'rows':[]};return db['VoiceQueue'][_0xe2ca('0x64')]({'where':{'id':_0x513414[_0xe2ca('0x5f')]['id']}})['then'](handleEntityNotFound(_0x395e2a,null))[_0xe2ca('0x26')](function(_0x7ca130){if(_0x7ca130){_0x1ef5f3[_0xe2ca('0x38')]=_[_0xe2ca('0x3a')](db[_0xe2ca('0x65')][_0xe2ca('0x36')]);_0x1ef5f3[_0xe2ca('0x39')]=_[_0xe2ca('0x3a')](_0x513414[_0xe2ca('0x39')]);_0x1ef5f3[_0xe2ca('0x3b')]=_['intersection'](_0x1ef5f3[_0xe2ca('0x38')],_0x1ef5f3[_0xe2ca('0x39')]);_0x4e9eb8[_0xe2ca('0x3e')]=_[_0xe2ca('0x3c')](_0x1ef5f3[_0xe2ca('0x38')],qs[_0xe2ca('0x3d')](_0x513414[_0xe2ca('0x39')]['fields']));_0x4e9eb8[_0xe2ca('0x3e')]=_0x4e9eb8[_0xe2ca('0x3e')][_0xe2ca('0x3f')]?_0x4e9eb8[_0xe2ca('0x3e')]:_0x1ef5f3[_0xe2ca('0x38')];if(!_0x513414['query'][_0xe2ca('0x40')](_0xe2ca('0x61'))){_0x4e9eb8['limit']=qs[_0xe2ca('0x20')](_0x513414[_0xe2ca('0x39')][_0xe2ca('0x20')]);_0x4e9eb8['offset']=qs[_0xe2ca('0x1f')](_0x513414[_0xe2ca('0x39')][_0xe2ca('0x1f')]);}_0x4e9eb8[_0xe2ca('0x41')]=qs['sort'](_0x513414[_0xe2ca('0x39')][_0xe2ca('0x42')]);_0x4e9eb8['where']=qs[_0xe2ca('0x3b')](_[_0xe2ca('0x43')](_0x513414[_0xe2ca('0x39')],_0x1ef5f3[_0xe2ca('0x3b')]));_0x4e9eb8['where'][_0xe2ca('0x62')]=_0x7ca130['id'];if(_0x513414[_0xe2ca('0x39')][_0xe2ca('0x2b')]){_0x4e9eb8[_0xe2ca('0x44')]=_[_0xe2ca('0x45')](_0x4e9eb8[_0xe2ca('0x44')],{'$or':_[_0xe2ca('0x2d')](_0x4e9eb8[_0xe2ca('0x3e')],function(_0x4bfc5f){var _0x712cd5={};_0x712cd5[_0x4bfc5f]={'$like':'%'+_0x513414[_0xe2ca('0x39')]['filter']+'%'};return _0x712cd5;})});}_0x4e9eb8=_[_0xe2ca('0x45')]({},_0x4e9eb8,_0x513414[_0xe2ca('0x47')]);return db['CmHopperHistory'][_0xe2ca('0x1e')]({'where':_0x4e9eb8[_0xe2ca('0x44')]})[_0xe2ca('0x26')](function(_0x8794d3){_0x4e4976['count']=_0x8794d3;if(_0x513414['query']['includeAll']){_0x4e9eb8[_0xe2ca('0x4a')]=[{'all':!![]}];}return db[_0xe2ca('0x65')]['findAll'](_0x4e9eb8);})['then'](function(_0x47e09c){_0x4e4976[_0xe2ca('0x4c')]=_0x47e09c;return _0x4e4976;});}})['then'](respondWithFilteredResult(_0x395e2a,_0x4e9eb8))[_0xe2ca('0x4d')](handleError(_0x395e2a,null));};exports[_0xe2ca('0x66')]=function(_0xbf85a5,_0x2acaed,_0x2cc2a8){var _0x23f9b2={'raw':!![],'where':{}};var _0x54d578={};var _0x390293={'count':0x0,'rows':[]};return db[_0xe2ca('0x48')][_0xe2ca('0x64')]({'where':{'id':_0xbf85a5['params']['id']}})[_0xe2ca('0x26')](handleEntityNotFound(_0x2acaed,null))[_0xe2ca('0x26')](function(_0x29d27f){if(_0x29d27f){_0x54d578[_0xe2ca('0x38')]=_[_0xe2ca('0x3a')](db[_0xe2ca('0x67')][_0xe2ca('0x36')]);_0x54d578[_0xe2ca('0x39')]=_[_0xe2ca('0x3a')](_0xbf85a5[_0xe2ca('0x39')]);_0x54d578[_0xe2ca('0x3b')]=_['intersection'](_0x54d578[_0xe2ca('0x38')],_0x54d578[_0xe2ca('0x39')]);_0x23f9b2[_0xe2ca('0x3e')]=_[_0xe2ca('0x3c')](_0x54d578[_0xe2ca('0x38')],qs[_0xe2ca('0x3d')](_0xbf85a5['query'][_0xe2ca('0x3d')]));_0x23f9b2[_0xe2ca('0x3e')]=_0x23f9b2[_0xe2ca('0x3e')][_0xe2ca('0x3f')]?_0x23f9b2[_0xe2ca('0x3e')]:_0x54d578['model'];if(!_0xbf85a5[_0xe2ca('0x39')][_0xe2ca('0x40')](_0xe2ca('0x61'))){_0x23f9b2[_0xe2ca('0x20')]=qs[_0xe2ca('0x20')](_0xbf85a5['query'][_0xe2ca('0x20')]);_0x23f9b2[_0xe2ca('0x1f')]=qs[_0xe2ca('0x1f')](_0xbf85a5[_0xe2ca('0x39')]['offset']);}_0x23f9b2[_0xe2ca('0x41')]=qs[_0xe2ca('0x42')](_0xbf85a5[_0xe2ca('0x39')][_0xe2ca('0x42')]);_0x23f9b2[_0xe2ca('0x44')]=qs[_0xe2ca('0x3b')](_[_0xe2ca('0x43')](_0xbf85a5['query'],_0x54d578['filters']));_0x23f9b2[_0xe2ca('0x44')][_0xe2ca('0x62')]=_0x29d27f['id'];if(_0xbf85a5[_0xe2ca('0x39')][_0xe2ca('0x2b')]){_0x23f9b2[_0xe2ca('0x44')]=_[_0xe2ca('0x45')](_0x23f9b2[_0xe2ca('0x44')],{'$or':_['map'](_0x23f9b2[_0xe2ca('0x3e')],function(_0x19fa2f){var _0x2dd2c9={};_0x2dd2c9[_0x19fa2f]={'$like':'%'+_0xbf85a5[_0xe2ca('0x39')][_0xe2ca('0x2b')]+'%'};return _0x2dd2c9;})});}_0x23f9b2=_[_0xe2ca('0x45')]({},_0x23f9b2,_0xbf85a5['options']);return db[_0xe2ca('0x67')][_0xe2ca('0x1e')]({'where':_0x23f9b2[_0xe2ca('0x44')]})[_0xe2ca('0x26')](function(_0x270a3b){_0x390293['count']=_0x270a3b;if(_0xbf85a5[_0xe2ca('0x39')][_0xe2ca('0x49')]){_0x23f9b2['include']=[{'all':!![]}];}return db[_0xe2ca('0x67')]['findAll'](_0x23f9b2);})['then'](function(_0x5ccb3e){_0x390293[_0xe2ca('0x4c')]=_0x5ccb3e;return _0x390293;});}})[_0xe2ca('0x26')](respondWithFilteredResult(_0x2acaed,_0x23f9b2))['catch'](handleError(_0x2acaed,null));};exports[_0xe2ca('0x68')]=function(_0x299d6b,_0x2df2d4,_0x3580e1){var _0x4c6bcf={'raw':!![],'where':{}};var _0x3cc62d={};var _0x47ae17={'count':0x0,'rows':[]};return db['VoiceQueue'][_0xe2ca('0x64')]({'where':{'id':_0x299d6b['params']['id']}})['then'](handleEntityNotFound(_0x2df2d4,null))['then'](function(_0x2cce40){if(_0x2cce40){_0x3cc62d[_0xe2ca('0x38')]=_[_0xe2ca('0x3a')](db[_0xe2ca('0x69')][_0xe2ca('0x36')]);_0x3cc62d[_0xe2ca('0x39')]=_[_0xe2ca('0x3a')](_0x299d6b[_0xe2ca('0x39')]);_0x3cc62d['filters']=_[_0xe2ca('0x3c')](_0x3cc62d[_0xe2ca('0x38')],_0x3cc62d[_0xe2ca('0x39')]);_0x4c6bcf[_0xe2ca('0x3e')]=_[_0xe2ca('0x3c')](_0x3cc62d['model'],qs[_0xe2ca('0x3d')](_0x299d6b[_0xe2ca('0x39')][_0xe2ca('0x3d')]));_0x4c6bcf['attributes']=_0x4c6bcf[_0xe2ca('0x3e')]['length']?_0x4c6bcf[_0xe2ca('0x3e')]:_0x3cc62d['model'];if(!_0x299d6b[_0xe2ca('0x39')][_0xe2ca('0x40')](_0xe2ca('0x61'))){_0x4c6bcf['limit']=qs[_0xe2ca('0x20')](_0x299d6b[_0xe2ca('0x39')][_0xe2ca('0x20')]);_0x4c6bcf[_0xe2ca('0x1f')]=qs[_0xe2ca('0x1f')](_0x299d6b[_0xe2ca('0x39')][_0xe2ca('0x1f')]);}_0x4c6bcf[_0xe2ca('0x41')]=qs['sort'](_0x299d6b[_0xe2ca('0x39')][_0xe2ca('0x42')]);_0x4c6bcf[_0xe2ca('0x44')]=qs['filters'](_[_0xe2ca('0x43')](_0x299d6b['query'],_0x3cc62d[_0xe2ca('0x3b')]));_0x4c6bcf[_0xe2ca('0x44')][_0xe2ca('0x62')]=_0x2cce40['id'];if(_0x299d6b[_0xe2ca('0x39')]['filter']){_0x4c6bcf[_0xe2ca('0x44')]=_['merge'](_0x4c6bcf['where'],{'$or':_[_0xe2ca('0x2d')](_0x4c6bcf[_0xe2ca('0x3e')],function(_0x246760){var _0x6e684={};_0x6e684[_0x246760]={'$like':'%'+_0x299d6b['query']['filter']+'%'};return _0x6e684;})});}_0x4c6bcf=_[_0xe2ca('0x45')]({},_0x4c6bcf,_0x299d6b[_0xe2ca('0x47')]);return db[_0xe2ca('0x69')][_0xe2ca('0x1e')]({'where':_0x4c6bcf['where']})['then'](function(_0x3243ab){_0x47ae17[_0xe2ca('0x1e')]=_0x3243ab;if(_0x299d6b['query'][_0xe2ca('0x49')]){_0x4c6bcf['include']=[{'all':!![]}];}return db[_0xe2ca('0x69')][_0xe2ca('0x4b')](_0x4c6bcf);})['then'](function(_0x57b0c5){_0x47ae17[_0xe2ca('0x4c')]=_0x57b0c5;return _0x47ae17;});}})[_0xe2ca('0x26')](respondWithFilteredResult(_0x2df2d4,_0x4c6bcf))[_0xe2ca('0x4d')](handleError(_0x2df2d4,null));};exports[_0xe2ca('0x6a')]=function(_0x11ffa2,_0x25dd0f,_0x2dbe8d){var _0xdd1ed7={};var _0x5cc7e7={};var _0x13b5ab;var _0x2526ac;return db[_0xe2ca('0x48')]['findOne']({'where':{'id':_0x11ffa2[_0xe2ca('0x5f')]['id']}})[_0xe2ca('0x26')](handleEntityNotFound(_0x25dd0f,null))[_0xe2ca('0x26')](function(_0x3d3aca){if(_0x3d3aca){_0x13b5ab=_0x3d3aca;_0x5cc7e7[_0xe2ca('0x38')]=_[_0xe2ca('0x3a')](db[_0xe2ca('0x6b')][_0xe2ca('0x36')]);_0x5cc7e7[_0xe2ca('0x39')]=_[_0xe2ca('0x3a')](_0x11ffa2['query']);_0x5cc7e7[_0xe2ca('0x3b')]=_['intersection'](_0x5cc7e7[_0xe2ca('0x38')],_0x5cc7e7[_0xe2ca('0x39')]);_0xdd1ed7['attributes']=_[_0xe2ca('0x3c')](_0x5cc7e7[_0xe2ca('0x38')],qs[_0xe2ca('0x3d')](_0x11ffa2['query'][_0xe2ca('0x3d')]));_0xdd1ed7['attributes']=_0xdd1ed7[_0xe2ca('0x3e')][_0xe2ca('0x3f')]?_0xdd1ed7[_0xe2ca('0x3e')]:_0x5cc7e7[_0xe2ca('0x38')];_0xdd1ed7[_0xe2ca('0x41')]=qs[_0xe2ca('0x42')](_0x11ffa2[_0xe2ca('0x39')]['sort']);_0xdd1ed7[_0xe2ca('0x44')]=qs[_0xe2ca('0x3b')](_[_0xe2ca('0x43')](_0x11ffa2[_0xe2ca('0x39')],_0x5cc7e7[_0xe2ca('0x3b')]));if(_0x11ffa2['query'][_0xe2ca('0x2b')]){_0xdd1ed7[_0xe2ca('0x44')]=_['merge'](_0xdd1ed7[_0xe2ca('0x44')],{'$or':_['map'](_0xdd1ed7[_0xe2ca('0x3e')],function(_0x24122a){var _0x392706={};_0x392706[_0x24122a]={'$like':'%'+_0x11ffa2[_0xe2ca('0x39')][_0xe2ca('0x2b')]+'%'};return _0x392706;})});}_0xdd1ed7=_[_0xe2ca('0x45')]({},_0xdd1ed7,_0x11ffa2[_0xe2ca('0x47')]);return _0x13b5ab['getTeams'](_0xdd1ed7);}})[_0xe2ca('0x26')](function(_0x4f97e7){if(_0x4f97e7){_0x2526ac=_0x4f97e7[_0xe2ca('0x3f')];if(!_0x11ffa2['query'][_0xe2ca('0x40')](_0xe2ca('0x61'))){_0xdd1ed7['limit']=qs['limit'](_0x11ffa2[_0xe2ca('0x39')][_0xe2ca('0x20')]);_0xdd1ed7[_0xe2ca('0x1f')]=qs['offset'](_0x11ffa2[_0xe2ca('0x39')][_0xe2ca('0x1f')]);}return _0x13b5ab[_0xe2ca('0x6a')](_0xdd1ed7);}})[_0xe2ca('0x26')](function(_0x26b6d8){if(_0x26b6d8){return _0x26b6d8?{'count':_0x2526ac,'rows':_0x26b6d8}:null;}})['then'](respondWithResult(_0x25dd0f,null))[_0xe2ca('0x4d')](handleError(_0x25dd0f,null));};exports['addTeams']=function(_0x3971eb,_0x38ac13,_0x12cb95){var _0x105c25=_0x3971eb[_0xe2ca('0x5d')][_0xe2ca('0x6c')];var _0x45b265=_[_0xe2ca('0x2d')](_0x105c25,'id');return db[_0xe2ca('0x6b')][_0xe2ca('0x4b')]({'where':{'id':_0x45b265},'attributes':['id'],'include':[{'model':db[_0xe2ca('0x6d')],'as':_0xe2ca('0x6e'),'attributes':['id',_0xe2ca('0x31'),'online',_0xe2ca('0x6f'),_0xe2ca('0x70')],'raw':!![]}]})[_0xe2ca('0x26')](function(_0x4fe5ed){if(_0x4fe5ed){var _0x1de7a0=_['flatMap'](_0x4fe5ed,function(_0x3d78f0){var _0x4cce3a=_0x3d78f0[_0xe2ca('0x28')]({'plain':!![]});_0x4cce3a[_0xe2ca('0x6e')][_0xe2ca('0x71')](function(_0x48528d){_0x48528d[_0xe2ca('0x72')]=_[_0xe2ca('0x4f')](_0x105c25,{'id':_0x4cce3a['id']})[_0xe2ca('0x72')];});return _0x4cce3a['Agents'];});return db[_0xe2ca('0x48')][_0xe2ca('0x4f')]({'where':{'id':_0x3971eb['params']['id']}})[_0xe2ca('0x26')](function(_0x5d1709){return db[_0xe2ca('0x73')][_0xe2ca('0x74')](function(_0x2edbf6){return _0x5d1709['addTeams'](_0x45b265,{'transaction':_0x2edbf6})[_0xe2ca('0x26')](function(){return BPromise[_0xe2ca('0x75')](_0x1de7a0,function(_0x48cbdd){return db[_0xe2ca('0x76')][_0xe2ca('0x77')]({'where':{'UserId':_0x48cbdd['id'],'VoiceQueueId':_0x3971eb[_0xe2ca('0x5f')]['id']},'defaults':{'penalty':_0x48cbdd[_0xe2ca('0x72')]},'transaction':_0x2edbf6});});})['then'](function(){return BPromise[_0xe2ca('0x75')](_[_0xe2ca('0x2b')](_0x1de7a0,{'online':!![]}),function(_0x9740b9){return db[_0xe2ca('0x78')][_0xe2ca('0x79')]({'membername':_0x9740b9[_0xe2ca('0x31')],'UserId':_0x9740b9['id'],'queue_name':_0x5d1709[_0xe2ca('0x31')],'VoiceQueueId':_0x5d1709['id'],'interface':_[_0xe2ca('0x7a')](_0x9740b9['interface'])?util['format']('SIP/%s',_0x9740b9[_0xe2ca('0x31')]):_0x9740b9[_0xe2ca('0x70')],'paused':_0x9740b9['voicePause']||![],'penalty':_0x9740b9['penalty']},{'transaction':_0x2edbf6});});})[_0xe2ca('0x26')](function(){_0x1de7a0[_0xe2ca('0x71')](function(_0x5752d2){socket[_0xe2ca('0x7b')](_0xe2ca('0x7c'),{'UserId':_0x5752d2['id'],'VoiceQueueId':_0x5d1709['id']});});});});});}})['then'](respondWithStatusCode(_0x38ac13,null))['catch'](handleError(_0x38ac13,null));};exports['removeTeams']=function(_0x5c04fc,_0x4f3317,_0x3c13df){return db[_0xe2ca('0x6b')][_0xe2ca('0x4b')]({'where':{'id':_0x5c04fc[_0xe2ca('0x39')][_0xe2ca('0x7d')]},'attributes':['id'],'include':[{'model':db['User'],'as':'Agents','attributes':['id'],'raw':!![]}]})['then'](handleEntityNotFound(_0x4f3317,null))['then'](function(_0x3a3c8e){var _0x2aadeb=_[_0xe2ca('0x2d')](_0x3a3c8e,'id');var _0x1400e9=[];var _0x14f44b=[];var _0x4c7461=squel['select']();_0x4c7461[_0xe2ca('0x7e')](_0xe2ca('0x7f'))['from']('team_has_voice_queues','tq')[_0xe2ca('0x80')](_0xe2ca('0x81'),'ut',_0xe2ca('0x82'))[_0xe2ca('0x44')](_0xe2ca('0x83'),_0x5c04fc[_0xe2ca('0x5f')]['id']);for(var _0x385c8d=0x0;_0x385c8d<_0x3a3c8e[_0xe2ca('0x3f')];_0x385c8d+=0x1){let _0x514382=_0x3a3c8e[_0x385c8d];for(var _0x2eb712=0x0;_0x2eb712<_0x514382['Agents']['length'];_0x2eb712+=0x1){let _0x5b5da8=_0x514382[_0xe2ca('0x6e')][_0x2eb712];var _0x220cd8=_0x4c7461[_0xe2ca('0x59')]();_0x220cd8[_0xe2ca('0x44')](_0xe2ca('0x84'),_0x5b5da8['id']);_0x14f44b[_0xe2ca('0x85')](db[_0xe2ca('0x73')][_0xe2ca('0x39')](_0x220cd8[_0xe2ca('0x86')](),{'type':db[_0xe2ca('0x73')]['QueryTypes'][_0xe2ca('0x87')]})['then'](function(_0x13806b){if(_0x13806b[_0xe2ca('0x3f')]===0x1){return _0x5b5da8['id'];}else{var _0x4bc332=_[_0xe2ca('0x88')](_['map'](_0x13806b,_0xe2ca('0x89')),function(_0x38e68d){return _[_0xe2ca('0x2f')](_0x2aadeb,_0x38e68d);});if(_0x4bc332){return _0x5b5da8['id'];}}}));}}return BPromise[_0xe2ca('0x8a')](_0x14f44b)[_0xe2ca('0x26')](function(_0x426849){_0x1400e9=_(_0x1400e9)[_0xe2ca('0x8b')](_0x426849)['compact']()['value']();return db[_0xe2ca('0x48')]['find']({'where':{'id':_0x5c04fc['params']['id']}})[_0xe2ca('0x26')](function(_0x247ead){return db[_0xe2ca('0x73')][_0xe2ca('0x74')](function(_0x4f05cc){return _0x247ead['removeTeams'](_0x5c04fc['query'][_0xe2ca('0x7d')],{'transaction':_0x4f05cc})['then'](function(){if(!_[_0xe2ca('0x8c')](_0x1400e9)){return _0x247ead[_0xe2ca('0x8d')](_0x1400e9,{'transaction':_0x4f05cc})[_0xe2ca('0x26')](function(){return db['UserVoiceQueueRt'][_0xe2ca('0x27')]({'where':{'VoiceQueueId':_0x5c04fc['params']['id'],'UserId':_0x1400e9},'transaction':_0x4f05cc});});}})['then'](function(){_0x1400e9[_0xe2ca('0x71')](function(_0x1801b0){socket[_0xe2ca('0x7b')]('userVoiceQueue:remove',{'UserId':_0x1801b0,'VoiceQueueId':_0x247ead['id']});});});});});});})[_0xe2ca('0x26')](respondWithStatusCode(_0x4f3317,null))[_0xe2ca('0x4d')](handleError(_0x4f3317,null));};exports[_0xe2ca('0x8e')]=function(_0x423399,_0x225508,_0x1f806e){var _0x5996a3,_0x1fc196;return db['VoiceQueue'][_0xe2ca('0x4f')]({'where':{'id':_0x423399['params']['id']}})['then'](handleEntityNotFound(_0x225508,null))[_0xe2ca('0x26')](function(_0x2f7153){if(_0x2f7153){_0x1fc196=_0x2f7153;return _0x2f7153['addAgents'](_0x423399[_0xe2ca('0x5d')]['ids'],_[_0xe2ca('0x5a')](_0x423399[_0xe2ca('0x5d')],['ids','id'])||{})[_0xe2ca('0x8f')](function(_0x244ff2){for(var _0x973059=0x0;_0x973059<_0x423399[_0xe2ca('0x5d')]['ids'][_0xe2ca('0x3f')];_0x973059+=0x1){socket[_0xe2ca('0x7b')](_0xe2ca('0x7c'),{'UserId':_0x423399[_0xe2ca('0x5d')]['ids'][_0x973059],'VoiceQueueId':_0x423399[_0xe2ca('0x5f')]['id']});}return _0x244ff2;});}})['then'](function(_0xaf81ce){_0x5996a3=_0xaf81ce||[];if(_0x1fc196){return db['User'][_0xe2ca('0x4b')]({'where':{'id':_0x423399[_0xe2ca('0x5d')][_0xe2ca('0x7d')]},'attributes':['id',_0xe2ca('0x31'),_0xe2ca('0x90'),'voicePause',_0xe2ca('0x70')],'raw':!![]});}})[_0xe2ca('0x26')](function(_0x2a6849){if(!_[_0xe2ca('0x8c')](_0x2a6849)){var _0x2bda55=[];for(var _0x27d494=0x0;_0x27d494<_0x2a6849['length'];_0x27d494++){if(_0x2a6849[_0x27d494]['online']){_0x2bda55[_0xe2ca('0x85')](db['UserVoiceQueueRt']['upsert']({'membername':_0x2a6849[_0x27d494][_0xe2ca('0x31')],'UserId':_0x2a6849[_0x27d494]['id'],'queue_name':_0x1fc196[_0xe2ca('0x31')],'VoiceQueueId':_0x1fc196['id'],'interface':_[_0xe2ca('0x7a')](_0x2a6849[_0x27d494][_0xe2ca('0x70')])?util[_0xe2ca('0x91')](_0xe2ca('0x92'),_0x2a6849[_0x27d494][_0xe2ca('0x31')]):_0x2a6849[_0x27d494]['interface'],'paused':_0x2a6849[_0x27d494][_0xe2ca('0x6f')]||![],'penalty':_0x423399[_0xe2ca('0x5d')][_0xe2ca('0x72')]||0x0}));}}return BPromise[_0xe2ca('0x8a')](_0x2bda55);}})['then'](function(){return _0x5996a3;})[_0xe2ca('0x26')](respondWithResult(_0x225508,null))[_0xe2ca('0x4d')](handleError(_0x225508,null));};exports['removeAgents']=function(_0x1479cb,_0xf6ec99,_0x1dc665){return db[_0xe2ca('0x48')][_0xe2ca('0x4f')]({'where':{'id':_0x1479cb['params']['id']}})[_0xe2ca('0x26')](handleEntityNotFound(_0xf6ec99,null))[_0xe2ca('0x26')](function(_0x5c1205){if(_0x5c1205){return _0x5c1205[_0xe2ca('0x8d')](_0x1479cb[_0xe2ca('0x39')]['ids'])[_0xe2ca('0x26')](function(){if(_[_0xe2ca('0x93')](_0x1479cb['query'][_0xe2ca('0x7d')])){for(var _0x2c7d41=0x0;_0x2c7d41<_0x1479cb['query']['ids']['length'];_0x2c7d41+=0x1){socket[_0xe2ca('0x7b')](_0xe2ca('0x94'),{'UserId':Number(_0x1479cb['query']['ids'][_0x2c7d41]),'VoiceQueueId':Number(_0x1479cb[_0xe2ca('0x5f')]['id'])});}}else{socket['emit'](_0xe2ca('0x94'),{'UserId':Number(_0x1479cb[_0xe2ca('0x39')]['ids']),'VoiceQueueId':Number(_0x1479cb['params']['id'])});}});}})[_0xe2ca('0x26')](function(_0xecea4a){return db[_0xe2ca('0x78')][_0xe2ca('0x27')]({'where':{'VoiceQueueId':_0x1479cb[_0xe2ca('0x5f')]['id'],'UserId':_0x1479cb['query']['ids']}})[_0xe2ca('0x26')](function(){return _0xecea4a;});})[_0xe2ca('0x26')](respondWithStatusCode(_0xf6ec99,null))[_0xe2ca('0x4d')](handleError(_0xf6ec99,null));};exports['getAgents']=function(_0x810aa6,_0x42254d,_0x16c5a7){var _0x191d8b={};var _0x1c52e7={};var _0x1f265a;var _0x44f97f;return db[_0xe2ca('0x48')]['findOne']({'where':{'id':_0x810aa6[_0xe2ca('0x5f')]['id']}})[_0xe2ca('0x26')](handleEntityNotFound(_0x42254d,null))['then'](function(_0x2ea04a){if(_0x2ea04a){_0x1f265a=_0x2ea04a;_0x1c52e7['model']=_['keys'](db['User'][_0xe2ca('0x36')]);_0x1c52e7[_0xe2ca('0x39')]=_[_0xe2ca('0x3a')](_0x810aa6['query']);_0x1c52e7[_0xe2ca('0x3b')]=_['intersection'](_0x1c52e7[_0xe2ca('0x38')],_0x1c52e7[_0xe2ca('0x39')]);_0x191d8b['attributes']=_[_0xe2ca('0x3c')](_0x1c52e7[_0xe2ca('0x38')],qs[_0xe2ca('0x3d')](_0x810aa6[_0xe2ca('0x39')][_0xe2ca('0x3d')]));_0x191d8b[_0xe2ca('0x3e')]=_0x191d8b[_0xe2ca('0x3e')][_0xe2ca('0x3f')]?_0x191d8b[_0xe2ca('0x3e')]:_0x1c52e7['model'];_0x191d8b[_0xe2ca('0x41')]=qs[_0xe2ca('0x42')](_0x810aa6[_0xe2ca('0x39')][_0xe2ca('0x42')]);_0x191d8b['where']=qs[_0xe2ca('0x3b')](_[_0xe2ca('0x43')](_0x810aa6[_0xe2ca('0x39')],_0x1c52e7[_0xe2ca('0x3b')]));if(_0x810aa6[_0xe2ca('0x39')][_0xe2ca('0x2b')]){_0x191d8b[_0xe2ca('0x44')]=_['merge'](_0x191d8b[_0xe2ca('0x44')],{'$or':_['map'](_0x191d8b['attributes'],function(_0x58f295){var _0x1b8e52={};_0x1b8e52[_0x58f295]={'$like':'%'+_0x810aa6['query'][_0xe2ca('0x2b')]+'%'};return _0x1b8e52;})});}_0x191d8b=_[_0xe2ca('0x45')]({},_0x191d8b,_0x810aa6[_0xe2ca('0x47')]);return _0x1f265a[_0xe2ca('0x95')](_0x191d8b);}})[_0xe2ca('0x26')](function(_0x18b851){if(_0x18b851){_0x44f97f=_0x18b851[_0xe2ca('0x3f')];if(!_0x810aa6[_0xe2ca('0x39')][_0xe2ca('0x40')](_0xe2ca('0x61'))){_0x191d8b[_0xe2ca('0x20')]=qs[_0xe2ca('0x20')](_0x810aa6['query'][_0xe2ca('0x20')]);_0x191d8b[_0xe2ca('0x1f')]=qs['offset'](_0x810aa6['query'][_0xe2ca('0x1f')]);}return _0x1f265a['getAgents'](_0x191d8b);}})['then'](function(_0x1f4c09){if(_0x1f4c09){return _0x1f4c09?{'count':_0x44f97f,'rows':_0x1f4c09}:null;}})[_0xe2ca('0x26')](respondWithResult(_0x42254d,null))[_0xe2ca('0x4d')](handleError(_0x42254d,null));};exports[_0xe2ca('0x96')]=function(_0x44e8eb,_0x5b4e63,_0x41c0cd){var _0x498adf={};var _0x2eb2a0={};var _0x574e96;var _0x1ce248;return db[_0xe2ca('0x48')]['findOne']({'where':{'id':_0x44e8eb[_0xe2ca('0x5f')]['id']}})['then'](handleEntityNotFound(_0x5b4e63,null))['then'](function(_0x435fad){if(_0x435fad){_0x574e96=_0x435fad;_0x2eb2a0[_0xe2ca('0x38')]=_[_0xe2ca('0x3a')](db['UserVoiceQueueRt'][_0xe2ca('0x36')]);_0x2eb2a0[_0xe2ca('0x39')]=_[_0xe2ca('0x3a')](_0x44e8eb['query']);_0x2eb2a0[_0xe2ca('0x3b')]=_[_0xe2ca('0x3c')](_0x2eb2a0[_0xe2ca('0x38')],_0x2eb2a0[_0xe2ca('0x39')]);_0x498adf[_0xe2ca('0x3e')]=_[_0xe2ca('0x3c')](_0x2eb2a0[_0xe2ca('0x38')],qs[_0xe2ca('0x3d')](_0x44e8eb[_0xe2ca('0x39')][_0xe2ca('0x3d')]));_0x498adf[_0xe2ca('0x3e')]=_0x498adf[_0xe2ca('0x3e')][_0xe2ca('0x3f')]?_0x498adf[_0xe2ca('0x3e')]:_0x2eb2a0[_0xe2ca('0x38')];_0x498adf[_0xe2ca('0x41')]=qs['sort'](_0x44e8eb[_0xe2ca('0x39')][_0xe2ca('0x42')]);_0x498adf[_0xe2ca('0x44')]=qs[_0xe2ca('0x3b')](_[_0xe2ca('0x43')](_0x44e8eb[_0xe2ca('0x39')],_0x2eb2a0[_0xe2ca('0x3b')]));if(_0x44e8eb[_0xe2ca('0x39')][_0xe2ca('0x2b')]){_0x498adf['where']=_['merge'](_0x498adf[_0xe2ca('0x44')],{'$or':_['map'](_0x498adf[_0xe2ca('0x3e')],function(_0x59acdf){var _0x5a136e={};_0x5a136e[_0x59acdf]={'$like':'%'+_0x44e8eb[_0xe2ca('0x39')][_0xe2ca('0x2b')]+'%'};return _0x5a136e;})});}_0x498adf=_[_0xe2ca('0x45')]({},_0x498adf,_0x44e8eb[_0xe2ca('0x47')]);return _0x574e96[_0xe2ca('0x96')](_0x498adf);}})['then'](function(_0xe649a8){if(_0xe649a8){_0x1ce248=_0xe649a8[_0xe2ca('0x3f')];if(!_0x44e8eb[_0xe2ca('0x39')][_0xe2ca('0x40')](_0xe2ca('0x61'))){_0x498adf[_0xe2ca('0x20')]=qs[_0xe2ca('0x20')](_0x44e8eb[_0xe2ca('0x39')]['limit']);_0x498adf[_0xe2ca('0x1f')]=qs[_0xe2ca('0x1f')](_0x44e8eb[_0xe2ca('0x39')][_0xe2ca('0x1f')]);}return _0x574e96['getMembers'](_0x498adf);}})['then'](function(_0x496c27){return _0x496c27?{'count':_0x1ce248,'rows':_0x496c27}:null;})[_0xe2ca('0x26')](respondWithResult(_0x5b4e63,null))[_0xe2ca('0x4d')](handleError(_0x5b4e63,null));};exports[_0xe2ca('0x97')]=function(_0x2662bb,_0x5047d6,_0x493251){var _0x417746={};var _0x43c143={};var _0xbf6b1a;var _0x573209;return db[_0xe2ca('0x48')][_0xe2ca('0x64')]({'where':{'id':_0x2662bb['params']['id']}})[_0xe2ca('0x26')](handleEntityNotFound(_0x5047d6,null))['then'](function(_0x5d8bdc){if(_0x5d8bdc){_0xbf6b1a=_0x5d8bdc;_0x43c143[_0xe2ca('0x38')]=_[_0xe2ca('0x3a')](db[_0xe2ca('0x98')]['rawAttributes']);_0x43c143[_0xe2ca('0x39')]=_[_0xe2ca('0x3a')](_0x2662bb[_0xe2ca('0x39')]);_0x43c143['filters']=_['intersection'](_0x43c143[_0xe2ca('0x38')],_0x43c143[_0xe2ca('0x39')]);_0x417746[_0xe2ca('0x3e')]=_['intersection'](_0x43c143[_0xe2ca('0x38')],qs[_0xe2ca('0x3d')](_0x2662bb['query'][_0xe2ca('0x3d')]));_0x417746[_0xe2ca('0x3e')]=_0x417746[_0xe2ca('0x3e')][_0xe2ca('0x3f')]?_0x417746['attributes']:_0x43c143[_0xe2ca('0x38')];_0x417746[_0xe2ca('0x41')]=qs[_0xe2ca('0x42')](_0x2662bb[_0xe2ca('0x39')][_0xe2ca('0x42')]);_0x417746[_0xe2ca('0x44')]=qs[_0xe2ca('0x3b')](_[_0xe2ca('0x43')](_0x2662bb[_0xe2ca('0x39')],_0x43c143[_0xe2ca('0x3b')]));if(_0x2662bb[_0xe2ca('0x39')][_0xe2ca('0x2b')]){_0x417746[_0xe2ca('0x44')]=_[_0xe2ca('0x45')](_0x417746[_0xe2ca('0x44')],{'$or':_[_0xe2ca('0x2d')](_0x417746[_0xe2ca('0x3e')],function(_0x2c0ec5){var _0x18b97f={};_0x18b97f[_0x2c0ec5]={'$like':'%'+_0x2662bb['query']['filter']+'%'};return _0x18b97f;})});}_0x417746=_[_0xe2ca('0x45')]({},_0x417746,_0x2662bb[_0xe2ca('0x47')]);return _0xbf6b1a[_0xe2ca('0x97')](_0x417746);}})[_0xe2ca('0x26')](function(_0x195a1b){if(_0x195a1b){_0x573209=_0x195a1b['length'];if(!_0x2662bb[_0xe2ca('0x39')][_0xe2ca('0x40')]('nolimit')){_0x417746[_0xe2ca('0x20')]=qs[_0xe2ca('0x20')](_0x2662bb[_0xe2ca('0x39')]['limit']);_0x417746[_0xe2ca('0x1f')]=qs[_0xe2ca('0x1f')](_0x2662bb[_0xe2ca('0x39')]['offset']);}return _0xbf6b1a[_0xe2ca('0x97')](_0x417746);}})['then'](function(_0x4c8950){if(_0x4c8950){return _0x4c8950?{'count':_0x573209,'rows':_0x4c8950}:null;}})[_0xe2ca('0x26')](respondWithResult(_0x5047d6,null))[_0xe2ca('0x4d')](handleError(_0x5047d6,null));};exports[_0xe2ca('0x99')]=function(_0x326ae1,_0x1953d0,_0x5b24b9){var _0x2ab1ed,_0x28d711;return db[_0xe2ca('0x48')][_0xe2ca('0x4f')]({'where':{'id':_0x326ae1[_0xe2ca('0x5f')]['id']}})[_0xe2ca('0x26')](handleEntityNotFound(_0x1953d0,null))[_0xe2ca('0x26')](function(_0x179a08){if(_0x179a08){_0x28d711=_0x179a08;return _0x179a08[_0xe2ca('0x99')](_0x326ae1[_0xe2ca('0x5d')][_0xe2ca('0x7d')],_[_0xe2ca('0x5a')](_0x326ae1[_0xe2ca('0x5d')],[_0xe2ca('0x7d'),'id'])||{});}return null;})['spread'](function(_0xb0459d){var _0x2bcb86;_0x2ab1ed=_0xb0459d||[];var _0x5682d0=[];if(_0xb0459d){for(var _0x2b326e=0x0;_0x2b326e<_0xb0459d[_0xe2ca('0x3f')];_0x2b326e+=0x1){var _0x1a3291=_0xb0459d[_0x2b326e][_0xe2ca('0x28')]({'plain':!![]});_0x28d711[_0xe2ca('0x9a')]=_0x326ae1[_0xe2ca('0x5d')]['dialCheckDuplicateType']?_0x326ae1['body'][_0xe2ca('0x9a')]:_0x28d711[_0xe2ca('0x9a')];switch(_0x28d711[_0xe2ca('0x9a')]){case _0xe2ca('0x9b'):_0x2bcb86=squel[_0xe2ca('0x9c')]()[_0xe2ca('0x9d')](_0xe2ca('0x9e'))[_0xe2ca('0x9f')]([_0xe2ca('0xa0'),_0xe2ca('0xa1'),_0xe2ca('0xa2'),_0xe2ca('0xa3'),_0xe2ca('0x62'),'createdAt',_0xe2ca('0x5c')],squel[_0xe2ca('0xa4')]()[_0xe2ca('0x7e')](_0xe2ca('0xa0'),_0xe2ca('0xa0'))[_0xe2ca('0x7e')](_0xe2ca('0xa5'),_0xe2ca('0xa1'))[_0xe2ca('0x7e')]('id',_0xe2ca('0xa2'))[_0xe2ca('0x7e')](_0x1a3291[_0xe2ca('0xa6')]['toString'](),'ListId')[_0xe2ca('0x7e')](_0x326ae1[_0xe2ca('0x5f')]['id'][_0xe2ca('0x86')](),_0xe2ca('0x62'))[_0xe2ca('0x7e')](_0xe2ca('0xa5'),'createdAt')[_0xe2ca('0x7e')]('NOW()',_0xe2ca('0x5c'))[_0xe2ca('0xa7')](_0xe2ca('0xa8'))[_0xe2ca('0x44')](_0xe2ca('0xa9'))['where'](_0xe2ca('0xaa'),_0x1a3291[_0xe2ca('0xa6')][_0xe2ca('0x86')]())[_0xe2ca('0x44')]('phone\x20IS\x20NOT\x20NULL')[_0xe2ca('0x44')](_0xe2ca('0xab'),squel['select']()['field'](_0xe2ca('0xac'))[_0xe2ca('0xa7')](_0xe2ca('0xad'))[_0xe2ca('0x44')](_0xe2ca('0x83'),_0x326ae1['params']['id'][_0xe2ca('0x86')]()))[_0xe2ca('0x44')](_0xe2ca('0xab'),squel[_0xe2ca('0xa4')]()[_0xe2ca('0x7e')](_0xe2ca('0xae'))[_0xe2ca('0xa7')](_0xe2ca('0x9e'))['where'](_0xe2ca('0x83'),_0x326ae1[_0xe2ca('0x5f')]['id']['toString']())))[_0xe2ca('0x86')]();break;case _0xe2ca('0xaf'):_0x2bcb86=squel[_0xe2ca('0x9c')]()['into']('cm_hopper')[_0xe2ca('0x9f')]([_0xe2ca('0xa0'),_0xe2ca('0xa1'),_0xe2ca('0xa2'),_0xe2ca('0xa3'),_0xe2ca('0x62'),_0xe2ca('0x5b'),_0xe2ca('0x5c')],squel[_0xe2ca('0xa4')]()[_0xe2ca('0x7e')](_0xe2ca('0xa0'),_0xe2ca('0xa0'))[_0xe2ca('0x7e')](_0xe2ca('0xa5'),_0xe2ca('0xa1'))[_0xe2ca('0x7e')]('id',_0xe2ca('0xa2'))['field'](_0x1a3291[_0xe2ca('0xa6')][_0xe2ca('0x86')](),_0xe2ca('0xa3'))['field'](_0x326ae1[_0xe2ca('0x5f')]['id'][_0xe2ca('0x86')](),'VoiceQueueId')[_0xe2ca('0x7e')]('NOW()',_0xe2ca('0x5b'))[_0xe2ca('0x7e')](_0xe2ca('0xa5'),_0xe2ca('0x5c'))[_0xe2ca('0xa7')]('cm_contacts')[_0xe2ca('0x44')]('deletedAt\x20IS\x20NULL')[_0xe2ca('0x44')](_0xe2ca('0xaa'),_0x1a3291['CmListId'][_0xe2ca('0x86')]())[_0xe2ca('0x44')](_0xe2ca('0xb0'))[_0xe2ca('0x44')](_0xe2ca('0xab'),squel['select']()[_0xe2ca('0x7e')]('COALESCE(phone,\x27\x27)')[_0xe2ca('0xa7')](_0xe2ca('0x9e'))[_0xe2ca('0x44')](_0xe2ca('0x83'),_0x326ae1['params']['id'][_0xe2ca('0x86')]())))[_0xe2ca('0x86')]();break;default:_0x2bcb86=squel[_0xe2ca('0x9c')]()[_0xe2ca('0x9d')](_0xe2ca('0x9e'))[_0xe2ca('0x9f')]([_0xe2ca('0xa0'),'scheduledAt','ContactId',_0xe2ca('0xa3'),_0xe2ca('0x62'),_0xe2ca('0x5b'),_0xe2ca('0x5c')],squel['select']()[_0xe2ca('0x7e')](_0xe2ca('0xa0'),_0xe2ca('0xa0'))[_0xe2ca('0x7e')]('NOW()',_0xe2ca('0xa1'))['field']('id',_0xe2ca('0xa2'))[_0xe2ca('0x7e')](_0x1a3291[_0xe2ca('0xa6')][_0xe2ca('0x86')](),_0xe2ca('0xa3'))[_0xe2ca('0x7e')](_0x326ae1[_0xe2ca('0x5f')]['id'][_0xe2ca('0x86')](),'VoiceQueueId')['field'](_0xe2ca('0xa5'),_0xe2ca('0x5b'))[_0xe2ca('0x7e')]('NOW()',_0xe2ca('0x5c'))[_0xe2ca('0xa7')]('cm_contacts')[_0xe2ca('0x44')]('deletedAt\x20IS\x20NULL')[_0xe2ca('0x44')](_0xe2ca('0xaa'),_0x1a3291[_0xe2ca('0xa6')]['toString']())['where'](_0xe2ca('0xb0')))[_0xe2ca('0x86')]();}_0x5682d0['push'](db[_0xe2ca('0x73')][_0xe2ca('0x39')](_0x2bcb86));}return BPromise[_0xe2ca('0x8a')](_0x5682d0);}})['then'](function(){return _0x2ab1ed;})[_0xe2ca('0x26')](respondWithResult(_0x1953d0,null))[_0xe2ca('0x4d')](handleError(_0x1953d0,null));};exports[_0xe2ca('0xb1')]=function(_0xec98a3,_0x1e8017,_0xa3aac9){return db[_0xe2ca('0x48')][_0xe2ca('0x4f')]({'where':{'id':_0xec98a3[_0xe2ca('0x5f')]['id']}})[_0xe2ca('0x26')](handleEntityNotFound(_0x1e8017,null))['then'](function(_0x2b8c99){if(_0x2b8c99){return _0x2b8c99[_0xe2ca('0xb1')](_0xec98a3[_0xe2ca('0x39')]['ids']);}})[_0xe2ca('0x26')](function(_0x163e27){if(_0x163e27){return db[_0xe2ca('0x60')][_0xe2ca('0x27')]({'where':{'ListId':_0xec98a3[_0xe2ca('0x39')][_0xe2ca('0x7d')],'VoiceQueueId':_0xec98a3[_0xe2ca('0x5f')]['id']}})[_0xe2ca('0x26')](function(){return _0x163e27;});}})[_0xe2ca('0x26')](respondWithStatusCode(_0x1e8017,null))[_0xe2ca('0x4d')](handleError(_0x1e8017,null));};exports[_0xe2ca('0xb2')]=function(_0x3a07f5,_0x3596c7,_0x157f01){var _0x4ca70d={};var _0x45cc66={};var _0x1570a8;var _0x359347;return db[_0xe2ca('0x48')][_0xe2ca('0x64')]({'where':{'id':_0x3a07f5[_0xe2ca('0x5f')]['id']}})[_0xe2ca('0x26')](handleEntityNotFound(_0x3596c7,null))[_0xe2ca('0x26')](function(_0x3c038c){if(_0x3c038c){_0x1570a8=_0x3c038c;_0x45cc66['model']=_[_0xe2ca('0x3a')](db[_0xe2ca('0x98')]['rawAttributes']);_0x45cc66[_0xe2ca('0x39')]=_[_0xe2ca('0x3a')](_0x3a07f5[_0xe2ca('0x39')]);_0x45cc66[_0xe2ca('0x3b')]=_['intersection'](_0x45cc66[_0xe2ca('0x38')],_0x45cc66[_0xe2ca('0x39')]);_0x4ca70d[_0xe2ca('0x3e')]=_['intersection'](_0x45cc66['model'],qs[_0xe2ca('0x3d')](_0x3a07f5[_0xe2ca('0x39')][_0xe2ca('0x3d')]));_0x4ca70d[_0xe2ca('0x3e')]=_0x4ca70d[_0xe2ca('0x3e')][_0xe2ca('0x3f')]?_0x4ca70d['attributes']:_0x45cc66[_0xe2ca('0x38')];_0x4ca70d[_0xe2ca('0x41')]=qs[_0xe2ca('0x42')](_0x3a07f5[_0xe2ca('0x39')]['sort']);_0x4ca70d[_0xe2ca('0x44')]=qs['filters'](_['pick'](_0x3a07f5[_0xe2ca('0x39')],_0x45cc66['filters']));if(_0x3a07f5[_0xe2ca('0x39')][_0xe2ca('0x2b')]){_0x4ca70d[_0xe2ca('0x44')]=_[_0xe2ca('0x45')](_0x4ca70d[_0xe2ca('0x44')],{'$or':_[_0xe2ca('0x2d')](_0x4ca70d[_0xe2ca('0x3e')],function(_0x2093df){var _0x1b72de={};_0x1b72de[_0x2093df]={'$like':'%'+_0x3a07f5[_0xe2ca('0x39')][_0xe2ca('0x2b')]+'%'};return _0x1b72de;})});}_0x4ca70d=_[_0xe2ca('0x45')]({},_0x4ca70d,_0x3a07f5['options']);return _0x1570a8[_0xe2ca('0xb2')](_0x4ca70d);}})[_0xe2ca('0x26')](function(_0x978ae8){if(_0x978ae8){_0x359347=_0x978ae8[_0xe2ca('0x3f')];if(!_0x3a07f5[_0xe2ca('0x39')][_0xe2ca('0x40')](_0xe2ca('0x61'))){_0x4ca70d['limit']=qs[_0xe2ca('0x20')](_0x3a07f5[_0xe2ca('0x39')]['limit']);_0x4ca70d[_0xe2ca('0x1f')]=qs[_0xe2ca('0x1f')](_0x3a07f5[_0xe2ca('0x39')][_0xe2ca('0x1f')]);}return _0x1570a8[_0xe2ca('0xb2')](_0x4ca70d);}})['then'](function(_0x30f1a8){if(_0x30f1a8){return _0x30f1a8?{'count':_0x359347,'rows':_0x30f1a8}:null;}})[_0xe2ca('0x26')](respondWithResult(_0x3596c7,null))['catch'](handleError(_0x3596c7,null));};exports[_0xe2ca('0xb3')]=function(_0x20f39f,_0x4e93c0,_0x5d638b){var _0x462ef9,_0xca4123;return db[_0xe2ca('0x48')]['find']({'where':{'id':_0x20f39f[_0xe2ca('0x5f')]['id']}})[_0xe2ca('0x26')](handleEntityNotFound(_0x4e93c0,null))['then'](function(_0x2485fb){if(_0x2485fb){_0xca4123=_0x2485fb;return _0x2485fb[_0xe2ca('0xb3')](_0x20f39f[_0xe2ca('0x5d')]['ids'],_['omit'](_0x20f39f[_0xe2ca('0x5d')],[_0xe2ca('0x7d'),'id'])||{});}return null;})['spread'](function(_0xfd83e8){var _0x17a394;_0x462ef9=_0xfd83e8||[];var _0x3d7553=[];if(_0xfd83e8){for(var _0x118b1d=0x0;_0x118b1d<_0xfd83e8['length'];_0x118b1d+=0x1){var _0x1bf6d5=_0xfd83e8[_0x118b1d][_0xe2ca('0x28')]({'plain':!![]});_0x17a394=squel[_0xe2ca('0x9c')]()[_0xe2ca('0x9d')](_0xe2ca('0xb4'))['fromQuery']([_0xe2ca('0xa0'),_0xe2ca('0xa2'),_0xe2ca('0xa3'),_0xe2ca('0x62'),'createdAt',_0xe2ca('0x5c')],squel[_0xe2ca('0xa4')]()[_0xe2ca('0x7e')](_0xe2ca('0xa0'),'phone')['field']('id','ContactId')[_0xe2ca('0x7e')](_0x1bf6d5[_0xe2ca('0xa6')][_0xe2ca('0x86')](),_0xe2ca('0xa3'))[_0xe2ca('0x7e')](_0x20f39f['params']['id'][_0xe2ca('0x86')](),_0xe2ca('0x62'))[_0xe2ca('0x7e')]('NOW()',_0xe2ca('0x5b'))[_0xe2ca('0x7e')](_0xe2ca('0xa5'),'updatedAt')[_0xe2ca('0xa7')](_0xe2ca('0xa8'))[_0xe2ca('0x44')](_0xe2ca('0xa9'))[_0xe2ca('0x44')](_0xe2ca('0xaa'),_0x1bf6d5[_0xe2ca('0xa6')][_0xe2ca('0x86')]())[_0xe2ca('0x44')](_0xe2ca('0xb0')))[_0xe2ca('0x86')]();_0x3d7553[_0xe2ca('0x85')](db['sequelize']['query'](_0x17a394));}return BPromise['all'](_0x3d7553);}})[_0xe2ca('0x26')](function(){return _0x462ef9;})['then'](respondWithResult(_0x4e93c0,null))[_0xe2ca('0x4d')](handleError(_0x4e93c0,null));};exports[_0xe2ca('0xb5')]=function(_0x183e9e,_0x4c1b59,_0x567504){return db[_0xe2ca('0x48')][_0xe2ca('0x4f')]({'where':{'id':_0x183e9e[_0xe2ca('0x5f')]['id']}})['then'](handleEntityNotFound(_0x4c1b59,null))[_0xe2ca('0x26')](function(_0x484252){if(_0x484252){return _0x484252[_0xe2ca('0xb5')](_0x183e9e[_0xe2ca('0x39')]['ids']);}})[_0xe2ca('0x26')](function(_0x1978b7){if(_0x1978b7){return db[_0xe2ca('0x69')][_0xe2ca('0x27')]({'where':{'ListId':_0x183e9e[_0xe2ca('0x39')][_0xe2ca('0x7d')],'VoiceQueueId':_0x183e9e[_0xe2ca('0x5f')]['id']}})[_0xe2ca('0x26')](function(){return _0x1978b7;});}})[_0xe2ca('0x26')](respondWithStatusCode(_0x4c1b59,null))[_0xe2ca('0x4d')](handleError(_0x4c1b59,null));};
\ No newline at end of file
+var _0xb982=['redis','localhost','socket.io-emitter','./voiceQueue.socket','sendStatus','status','end','offset','set','Content-Range','json','apply','reject','save','update','then','destroy','get','VoiceQueues','inbound','outbound','ignore','value','includes','find','type','name','error','stack','send','index','map','VoiceQueue','rawAttributes','fieldName','model','query','keys','filters','intersection','fields','attributes','hasOwnProperty','nolimit','limit','order','where','filter','merge','VIRTUAL','options','count','includeAll','include','catch','params','create','user','Unable\x20to\x20retrieve\x20the\x20current\x20user','role','userProfileId','autoAssociation','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','clone','length','omit','createdAt','body','updatedAt','QueueCampaigns','UserProfileSection','UserProfileResource','getHoppers','findOne','CmHopper','sort','pick','VoiceQueueId','findAll','rows','getHopperHistories','CmHopperHistory','getHopperFinals','CmHopperFinal','getHopperBlacks','CmHopperBlack','getTeams','addTeams','teams','Team','Agents','online','voicePause','interface','flatMap','forEach','penalty','transaction','UserVoiceQueue','each','UserVoiceQueueRt','upsert','isNil','format','SIP/%s','emit','userVoiceQueue:save','removeTeams','ids','User','select','field','tq.TeamId','from','team_has_voice_queues','join','user_has_teams','ut.TeamId\x20=\x20tq.TeamId','VoiceQueueId\x20=\x20?','ut.UserId\x20=\x20?','push','sequelize','toString','QueryTypes','every','TeamId','all','union','compact','removeAgents','userVoiceQueue:remove','addAgents','spread','isEmpty','getAgents','getMembers','CmList','getLists','addLists','dialCheckDuplicateType','into','cm_hopper','fromQuery','phone','scheduledAt','ContactId','ListId','CmListId','NOW()','cm_contacts','ListId\x20=\x20?','phone\x20IS\x20NOT\x20NULL','phone\x20NOT\x20IN\x20(?)','cm_hopper_final','COALESCE(phone,\x27\x27)','onlyIfOpen','deletedAt\x20IS\x20NULL','insert','removeLists','addBlackLists','cm_hopper_black','removeBlackLists','rimraf','zip-dir','fast-json-patch','request-promise','moment','bluebird','mustache','util','path','sox','ejs','lodash','squel','crypto','jsforce','desk.js','querystring','papaparse','../../components/auth/service','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/utils','../../mysqldb','defaults'];(function(_0x20a584,_0xe384a5){var _0x4b41a8=function(_0x2127c6){while(--_0x2127c6){_0x20a584['push'](_0x20a584['shift']());}};_0x4b41a8(++_0xe384a5);}(_0xb982,0x15e));var _0x2b98=function(_0x321bb2,_0x202794){_0x321bb2=_0x321bb2-0x0;var _0x9c12ed=_0xb982[_0x321bb2];return _0x9c12ed;};'use strict';var pdf=require('html-pdf');var emlformat=require('eml-format');var rimraf=require(_0x2b98('0x0'));var zipdir=require(_0x2b98('0x1'));var jsonpatch=require(_0x2b98('0x2'));var rp=require(_0x2b98('0x3'));var moment=require(_0x2b98('0x4'));var BPromise=require(_0x2b98('0x5'));var Mustache=require(_0x2b98('0x6'));var util=require(_0x2b98('0x7'));var path=require(_0x2b98('0x8'));var sox=require(_0x2b98('0x9'));var csv=require('to-csv');var ejs=require(_0x2b98('0xa'));var fs=require('fs');var _=require(_0x2b98('0xb'));var squel=require(_0x2b98('0xc'));var crypto=require(_0x2b98('0xd'));var jsforce=require(_0x2b98('0xe'));var deskjs=require(_0x2b98('0xf'));var toCsv=require('to-csv');var querystring=require(_0x2b98('0x10'));var Papa=require(_0x2b98('0x11'));var Redis=require('ioredis');var authService=require(_0x2b98('0x12'));var qs=require('../../components/parsers/qs');var as=require(_0x2b98('0x13'));var hardwareService=require(_0x2b98('0x14'));var logger=require(_0x2b98('0x15'))(_0x2b98('0x16'));var utils=require(_0x2b98('0x17'));var config=require('../../config/environment');var db=require(_0x2b98('0x18'))['db'];config['redis']=_[_0x2b98('0x19')](config[_0x2b98('0x1a')],{'host':_0x2b98('0x1b'),'port':0x18eb});var socket=require(_0x2b98('0x1c'))(new Redis(config[_0x2b98('0x1a')]));require(_0x2b98('0x1d'))['register'](socket);function respondWithStatusCode(_0x29c259,_0x268fc3){_0x268fc3=_0x268fc3||0xcc;return function(_0x13d46d){if(_0x13d46d){return _0x29c259[_0x2b98('0x1e')](_0x268fc3);}return _0x29c259[_0x2b98('0x1f')](_0x268fc3)[_0x2b98('0x20')]();};}function respondWithResult(_0x15e5c9,_0x4eab53){_0x4eab53=_0x4eab53||0xc8;return function(_0xc2478a){if(_0xc2478a){return _0x15e5c9[_0x2b98('0x1f')](_0x4eab53)['json'](_0xc2478a);}};}function respondWithFilteredResult(_0x33614e,_0x54d425){return function(_0x4461d2){if(_0x4461d2){var _0x40426c=_0x4461d2['count'],_0x2641fa=_0x54d425[_0x2b98('0x21')],_0x50b886=_0x54d425[_0x2b98('0x21')]+_0x54d425['limit'],_0x5828b5;if(_0x50b886>=_0x40426c){_0x50b886=_0x40426c;_0x5828b5=0xc8;}else{_0x5828b5=0xce;}_0x33614e['status'](_0x5828b5);return _0x33614e[_0x2b98('0x22')](_0x2b98('0x23'),_0x2641fa+'-'+_0x50b886+'/'+_0x40426c)[_0x2b98('0x24')](_0x4461d2);}return null;};}function patchUpdates(_0x5b75de){return function(_0x1878f4){try{jsonpatch[_0x2b98('0x25')](_0x1878f4,_0x5b75de,!![]);}catch(_0x1e5979){return BPromise[_0x2b98('0x26')](_0x1e5979);}return _0x1878f4[_0x2b98('0x27')]();};}function saveUpdates(_0x349a8d,_0x51db51){return function(_0x543a20){if(_0x543a20){return _0x543a20[_0x2b98('0x28')](_0x349a8d)[_0x2b98('0x29')](function(_0x373e34){return _0x373e34;});}return null;};}function removeEntity(_0x10e803,_0x3bdfa3){return function(_0x404a3c){if(_0x404a3c){return _0x404a3c[_0x2b98('0x2a')]()[_0x2b98('0x29')](function(){var _0x40c613=_0x404a3c[_0x2b98('0x2b')]({'plain':!![]});var _0x154f06=[{'name':_0x2b98('0x2c'),'value':_0x2b98('0x2d'),'ignore':![]},{'name':'QueueCampaigns','value':_0x2b98('0x2e'),'ignore':![]}];var _0x54b0c3=_(_0x154f06)['filter'](_0x2b98('0x2f'))['map'](_0x2b98('0x30'))[_0x2b98('0x30')]();if(_[_0x2b98('0x31')](_0x54b0c3,_0x40c613['type'])){return;}var _0x5467a4=_[_0x2b98('0x32')](_0x154f06,[_0x2b98('0x30'),_0x40c613[_0x2b98('0x33')]])[_0x2b98('0x34')];return db['UserProfileResource']['destroy']({'where':{'type':_0x5467a4,'resourceId':_0x40c613['id']}})[_0x2b98('0x29')](function(){return _0x404a3c;});})['then'](function(){_0x10e803[_0x2b98('0x1f')](0xcc)['end']();});}};}function handleEntityNotFound(_0x53be37,_0x3962ce){return function(_0x406df1){if(!_0x406df1){_0x53be37[_0x2b98('0x1e')](0x194);}return _0x406df1;};}function handleError(_0x3befe2,_0x4fef06){_0x4fef06=_0x4fef06||0x1f4;return function(_0x5ef881){logger[_0x2b98('0x35')](_0x5ef881[_0x2b98('0x36')]);if(_0x5ef881[_0x2b98('0x34')]){delete _0x5ef881[_0x2b98('0x34')];}_0x3befe2[_0x2b98('0x1f')](_0x4fef06)[_0x2b98('0x37')](_0x5ef881);};}exports[_0x2b98('0x38')]=function(_0x2eaa8e,_0x350f52){var _0x1d9d07={},_0x4894cb={},_0xa56232={'count':0x0,'rows':[]};var _0x56e233=_[_0x2b98('0x39')](db[_0x2b98('0x3a')][_0x2b98('0x3b')],function(_0x32cc92){return{'name':_0x32cc92[_0x2b98('0x3c')],'type':_0x32cc92[_0x2b98('0x33')]['key']};});_0x4894cb[_0x2b98('0x3d')]=_['map'](_0x56e233,_0x2b98('0x34'));_0x4894cb[_0x2b98('0x3e')]=_[_0x2b98('0x3f')](_0x2eaa8e[_0x2b98('0x3e')]);_0x4894cb[_0x2b98('0x40')]=_[_0x2b98('0x41')](_0x4894cb[_0x2b98('0x3d')],_0x4894cb[_0x2b98('0x3e')]);_0x1d9d07['attributes']=_['intersection'](_0x4894cb[_0x2b98('0x3d')],qs[_0x2b98('0x42')](_0x2eaa8e[_0x2b98('0x3e')][_0x2b98('0x42')]));_0x1d9d07[_0x2b98('0x43')]=_0x1d9d07[_0x2b98('0x43')]['length']?_0x1d9d07[_0x2b98('0x43')]:_0x4894cb[_0x2b98('0x3d')];if(!_0x2eaa8e[_0x2b98('0x3e')][_0x2b98('0x44')](_0x2b98('0x45'))){_0x1d9d07['limit']=qs[_0x2b98('0x46')](_0x2eaa8e[_0x2b98('0x3e')][_0x2b98('0x46')]);_0x1d9d07['offset']=qs[_0x2b98('0x21')](_0x2eaa8e[_0x2b98('0x3e')][_0x2b98('0x21')]);}_0x1d9d07[_0x2b98('0x47')]=qs['sort'](_0x2eaa8e[_0x2b98('0x3e')]['sort']);_0x1d9d07[_0x2b98('0x48')]=qs[_0x2b98('0x40')](_['pick'](_0x2eaa8e['query'],_0x4894cb[_0x2b98('0x40')]));if(_0x2eaa8e[_0x2b98('0x3e')][_0x2b98('0x49')]){_0x1d9d07[_0x2b98('0x48')]=_[_0x2b98('0x4a')](_0x1d9d07[_0x2b98('0x48')],{'$or':_[_0x2b98('0x39')](_0x56e233,function(_0x54b044){if(_0x54b044[_0x2b98('0x33')]!==_0x2b98('0x4b')){var _0x569fc4={};_0x569fc4[_0x54b044['name']]={'$like':'%'+_0x2eaa8e[_0x2b98('0x3e')][_0x2b98('0x49')]+'%'};return _0x569fc4;}})});}_0x1d9d07=_['merge']({},_0x1d9d07,_0x2eaa8e[_0x2b98('0x4c')]);var _0x1ae7e7={'where':_0x1d9d07[_0x2b98('0x48')]};return db[_0x2b98('0x3a')]['count'](_0x1ae7e7)[_0x2b98('0x29')](function(_0x1ccc11){_0xa56232[_0x2b98('0x4d')]=_0x1ccc11;if(_0x2eaa8e[_0x2b98('0x3e')][_0x2b98('0x4e')]){_0x1d9d07[_0x2b98('0x4f')]=[{'all':!![]}];}return db[_0x2b98('0x3a')]['findAll'](_0x1d9d07);})[_0x2b98('0x29')](function(_0x19c05c){_0xa56232['rows']=_0x19c05c;return _0xa56232;})[_0x2b98('0x29')](respondWithFilteredResult(_0x350f52,_0x1d9d07))[_0x2b98('0x50')](handleError(_0x350f52,null));};exports['show']=function(_0x2707cc,_0x549e96){var _0x4f879b={'raw':![],'where':{'id':_0x2707cc[_0x2b98('0x51')]['id']}},_0x203bc1={};_0x203bc1[_0x2b98('0x3d')]=_[_0x2b98('0x3f')](db['VoiceQueue'][_0x2b98('0x3b')]);_0x203bc1['query']=_[_0x2b98('0x3f')](_0x2707cc[_0x2b98('0x3e')]);_0x203bc1[_0x2b98('0x40')]=_[_0x2b98('0x41')](_0x203bc1[_0x2b98('0x3d')],_0x203bc1[_0x2b98('0x3e')]);_0x4f879b[_0x2b98('0x43')]=_[_0x2b98('0x41')](_0x203bc1[_0x2b98('0x3d')],qs[_0x2b98('0x42')](_0x2707cc[_0x2b98('0x3e')][_0x2b98('0x42')]));_0x4f879b[_0x2b98('0x43')]=_0x4f879b['attributes']['length']?_0x4f879b[_0x2b98('0x43')]:_0x203bc1[_0x2b98('0x3d')];if(_0x2707cc[_0x2b98('0x3e')]['includeAll']){_0x4f879b[_0x2b98('0x4f')]=[{'all':!![]}];}_0x4f879b=_[_0x2b98('0x4a')]({},_0x4f879b,_0x2707cc[_0x2b98('0x4c')]);return db[_0x2b98('0x3a')][_0x2b98('0x32')](_0x4f879b)[_0x2b98('0x29')](handleEntityNotFound(_0x549e96,null))['then'](respondWithResult(_0x549e96,null))['catch'](handleError(_0x549e96,null));};exports[_0x2b98('0x52')]=function(_0x11ee2e,_0x3203b5){return db[_0x2b98('0x3a')][_0x2b98('0x52')](_0x11ee2e['body'],{})[_0x2b98('0x29')](function(_0x10d2af){var _0x2a158e=_0x11ee2e[_0x2b98('0x53')][_0x2b98('0x2b')]({'plain':!![]});if(!_0x2a158e)throw new Error(_0x2b98('0x54'));if(_0x2a158e[_0x2b98('0x55')]==='user'){var _0x4d1cfa=_0x10d2af[_0x2b98('0x2b')]({'plain':!![]});var _0x5e9b51=[{'name':_0x2b98('0x2c'),'value':'inbound'},{'name':'QueueCampaigns','value':'outbound'}];var _0x4b7df9=_[_0x2b98('0x32')](_0x5e9b51,[_0x2b98('0x30'),_0x4d1cfa[_0x2b98('0x33')]])['name'];return db['UserProfileSection'][_0x2b98('0x32')]({'where':{'name':_0x4b7df9,'userProfileId':_0x2a158e[_0x2b98('0x56')]},'raw':!![]})[_0x2b98('0x29')](function(_0x3c6021){if(_0x3c6021&&_0x3c6021[_0x2b98('0x57')]===0x0){return db['UserProfileResource']['create']({'name':_0x4d1cfa[_0x2b98('0x34')],'resourceId':_0x4d1cfa['id'],'type':_0x3c6021[_0x2b98('0x34')],'sectionId':_0x3c6021['id']},{})['then'](function(){return _0x10d2af;});}else{return _0x10d2af;}})[_0x2b98('0x50')](function(_0x25f17e){logger[_0x2b98('0x35')](_0x2b98('0x58'),_0x25f17e);throw _0x25f17e;});}return _0x10d2af;})['then'](respondWithResult(_0x3203b5,0xc9))[_0x2b98('0x50')](handleError(_0x3203b5,null));};exports[_0x2b98('0x59')]=function(_0xceaf82,_0x275360){var _0x20e130={'where':{'id':_0xceaf82[_0x2b98('0x51')]['id']}},_0x4bb606={};_0x4bb606[_0x2b98('0x3d')]=_[_0x2b98('0x3f')](db['VoiceQueue'][_0x2b98('0x3b')]);_0x20e130[_0x2b98('0x43')]=_['intersection'](_0x4bb606['model'],qs[_0x2b98('0x42')](_0xceaf82['query'][_0x2b98('0x42')]));_0x20e130[_0x2b98('0x43')]=_0x20e130['attributes'][_0x2b98('0x5a')]?_0x20e130[_0x2b98('0x43')]:_0x4bb606[_0x2b98('0x3d')];if(_0xceaf82[_0x2b98('0x3e')]['includeAll']){_0x20e130['include']=[{'all':!![]}];}_0x20e130=_['merge']({},_0x20e130,_0xceaf82[_0x2b98('0x4c')]);return db['VoiceQueue'][_0x2b98('0x32')](_0x20e130)['then'](handleEntityNotFound(_0x275360,null))[_0x2b98('0x29')](function(_0x2440c9){if(_0x2440c9){var _0x228822=_0x2440c9[_0x2b98('0x2b')]({'plain':!![]});_0x228822=qs[_0x2b98('0x5b')](_0x228822,['id',_0x2b98('0x5c'),'updatedAt']);_0xceaf82[_0x2b98('0x5d')]=_[_0x2b98('0x5b')](_0xceaf82[_0x2b98('0x5d')],['id',_0x2b98('0x5c'),_0x2b98('0x5e')]);return db[_0x2b98('0x3a')]['create'](_[_0x2b98('0x4a')](_0x228822,_0xceaf82[_0x2b98('0x5d')]),{'include':_0xceaf82[_0x2b98('0x3e')]['includeAll']?[{'all':!![]}]:undefined})[_0x2b98('0x29')](function(_0x571b63){var _0x3e116f=_0xceaf82['user']['get']({'plain':!![]});if(!_0x3e116f)throw new Error(_0x2b98('0x54'));if(_0x3e116f[_0x2b98('0x55')]===_0x2b98('0x53')){var _0xe87e1d=_0x571b63[_0x2b98('0x2b')]({'plain':!![]});var _0x24225e=[{'name':_0x2b98('0x2c'),'value':'inbound'},{'name':_0x2b98('0x5f'),'value':_0x2b98('0x2e')}];var _0x25679c=_[_0x2b98('0x32')](_0x24225e,['value',_0xe87e1d['type']])[_0x2b98('0x34')];return db[_0x2b98('0x60')]['find']({'where':{'name':_0x25679c,'userProfileId':_0x3e116f['userProfileId']},'raw':!![]})[_0x2b98('0x29')](function(_0x43d091){if(_0x43d091&&_0x43d091[_0x2b98('0x57')]===0x0){return db[_0x2b98('0x61')][_0x2b98('0x52')]({'name':_0xe87e1d[_0x2b98('0x34')],'resourceId':_0xe87e1d['id'],'type':_0x43d091[_0x2b98('0x34')],'sectionId':_0x43d091['id']},{})[_0x2b98('0x29')](function(){return _0x571b63;});}else{return _0x571b63;}})[_0x2b98('0x50')](function(_0x501f8c){logger[_0x2b98('0x35')]('Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s',_0x501f8c);throw _0x501f8c;});}return _0x571b63;});}})[_0x2b98('0x29')](respondWithResult(_0x275360,0xc9))[_0x2b98('0x50')](handleError(_0x275360,null));};exports[_0x2b98('0x28')]=function(_0x30f140,_0x5461a8){if(_0x30f140['body']['id']){delete _0x30f140[_0x2b98('0x5d')]['id'];}return db[_0x2b98('0x3a')][_0x2b98('0x32')]({'where':{'id':_0x30f140[_0x2b98('0x51')]['id']}})[_0x2b98('0x29')](handleEntityNotFound(_0x5461a8,null))['then'](saveUpdates(_0x30f140[_0x2b98('0x5d')],null))[_0x2b98('0x29')](respondWithResult(_0x5461a8,null))[_0x2b98('0x50')](handleError(_0x5461a8,null));};exports['destroy']=function(_0x4d4542,_0x4f0bf7){return db['VoiceQueue']['find']({'where':{'id':_0x4d4542['params']['id']}})[_0x2b98('0x29')](handleEntityNotFound(_0x4f0bf7,null))['then'](removeEntity(_0x4f0bf7,null))[_0x2b98('0x50')](handleError(_0x4f0bf7,null));};exports[_0x2b98('0x62')]=function(_0x108d61,_0x298551,_0x15191b){var _0x3d8263={'raw':![],'where':{}};var _0x528b73={};var _0x55fe32={'count':0x0,'rows':[]};return db[_0x2b98('0x3a')][_0x2b98('0x63')]({'where':{'id':_0x108d61[_0x2b98('0x51')]['id']}})[_0x2b98('0x29')](handleEntityNotFound(_0x298551,null))[_0x2b98('0x29')](function(_0x466137){if(_0x466137){_0x528b73[_0x2b98('0x3d')]=_['keys'](db[_0x2b98('0x64')][_0x2b98('0x3b')]);_0x528b73[_0x2b98('0x3e')]=_[_0x2b98('0x3f')](_0x108d61[_0x2b98('0x3e')]);_0x528b73[_0x2b98('0x40')]=_[_0x2b98('0x41')](_0x528b73[_0x2b98('0x3d')],_0x528b73[_0x2b98('0x3e')]);_0x3d8263[_0x2b98('0x43')]=_[_0x2b98('0x41')](_0x528b73['model'],qs[_0x2b98('0x42')](_0x108d61[_0x2b98('0x3e')][_0x2b98('0x42')]));_0x3d8263[_0x2b98('0x43')]=_0x3d8263[_0x2b98('0x43')]['length']?_0x3d8263[_0x2b98('0x43')]:_0x528b73[_0x2b98('0x3d')];if(!_0x108d61[_0x2b98('0x3e')][_0x2b98('0x44')](_0x2b98('0x45'))){_0x3d8263[_0x2b98('0x46')]=qs[_0x2b98('0x46')](_0x108d61['query'][_0x2b98('0x46')]);_0x3d8263[_0x2b98('0x21')]=qs[_0x2b98('0x21')](_0x108d61['query'][_0x2b98('0x21')]);}_0x3d8263['order']=qs['sort'](_0x108d61['query'][_0x2b98('0x65')]);_0x3d8263[_0x2b98('0x48')]=qs[_0x2b98('0x40')](_[_0x2b98('0x66')](_0x108d61['query'],_0x528b73['filters']));_0x3d8263[_0x2b98('0x48')][_0x2b98('0x67')]=_0x466137['id'];if(_0x108d61[_0x2b98('0x3e')][_0x2b98('0x49')]){_0x3d8263[_0x2b98('0x48')]=_[_0x2b98('0x4a')](_0x3d8263[_0x2b98('0x48')],{'$or':_[_0x2b98('0x39')](_0x3d8263[_0x2b98('0x43')],function(_0xe91f5){var _0x28675c={};_0x28675c[_0xe91f5]={'$like':'%'+_0x108d61['query']['filter']+'%'};return _0x28675c;})});}_0x3d8263=_['merge']({},_0x3d8263,_0x108d61[_0x2b98('0x4c')]);return db['CmHopper'][_0x2b98('0x4d')]({'where':_0x3d8263[_0x2b98('0x48')]})['then'](function(_0x3396f0){_0x55fe32[_0x2b98('0x4d')]=_0x3396f0;if(_0x108d61[_0x2b98('0x3e')][_0x2b98('0x4e')]){_0x3d8263[_0x2b98('0x4f')]=[{'all':!![]}];}return db[_0x2b98('0x64')][_0x2b98('0x68')](_0x3d8263);})['then'](function(_0x5cf1f8){_0x55fe32[_0x2b98('0x69')]=_0x5cf1f8;return _0x55fe32;});}})[_0x2b98('0x29')](respondWithFilteredResult(_0x298551,_0x3d8263))[_0x2b98('0x50')](handleError(_0x298551,null));};exports[_0x2b98('0x6a')]=function(_0x155d01,_0x3b7f26,_0x38b769){var _0x24a572={'raw':!![],'where':{}};var _0x52d07d={};var _0x3481da={'count':0x0,'rows':[]};return db[_0x2b98('0x3a')]['findOne']({'where':{'id':_0x155d01[_0x2b98('0x51')]['id']}})[_0x2b98('0x29')](handleEntityNotFound(_0x3b7f26,null))[_0x2b98('0x29')](function(_0x2b3602){if(_0x2b3602){_0x52d07d['model']=_[_0x2b98('0x3f')](db[_0x2b98('0x6b')][_0x2b98('0x3b')]);_0x52d07d['query']=_[_0x2b98('0x3f')](_0x155d01[_0x2b98('0x3e')]);_0x52d07d[_0x2b98('0x40')]=_[_0x2b98('0x41')](_0x52d07d[_0x2b98('0x3d')],_0x52d07d[_0x2b98('0x3e')]);_0x24a572[_0x2b98('0x43')]=_[_0x2b98('0x41')](_0x52d07d[_0x2b98('0x3d')],qs[_0x2b98('0x42')](_0x155d01[_0x2b98('0x3e')][_0x2b98('0x42')]));_0x24a572[_0x2b98('0x43')]=_0x24a572['attributes'][_0x2b98('0x5a')]?_0x24a572[_0x2b98('0x43')]:_0x52d07d[_0x2b98('0x3d')];if(!_0x155d01[_0x2b98('0x3e')][_0x2b98('0x44')]('nolimit')){_0x24a572[_0x2b98('0x46')]=qs['limit'](_0x155d01['query'][_0x2b98('0x46')]);_0x24a572[_0x2b98('0x21')]=qs[_0x2b98('0x21')](_0x155d01['query'][_0x2b98('0x21')]);}_0x24a572['order']=qs[_0x2b98('0x65')](_0x155d01[_0x2b98('0x3e')][_0x2b98('0x65')]);_0x24a572[_0x2b98('0x48')]=qs['filters'](_[_0x2b98('0x66')](_0x155d01[_0x2b98('0x3e')],_0x52d07d[_0x2b98('0x40')]));_0x24a572[_0x2b98('0x48')][_0x2b98('0x67')]=_0x2b3602['id'];if(_0x155d01[_0x2b98('0x3e')][_0x2b98('0x49')]){_0x24a572[_0x2b98('0x48')]=_[_0x2b98('0x4a')](_0x24a572[_0x2b98('0x48')],{'$or':_[_0x2b98('0x39')](_0x24a572[_0x2b98('0x43')],function(_0x3958cd){var _0x273fec={};_0x273fec[_0x3958cd]={'$like':'%'+_0x155d01[_0x2b98('0x3e')][_0x2b98('0x49')]+'%'};return _0x273fec;})});}_0x24a572=_[_0x2b98('0x4a')]({},_0x24a572,_0x155d01[_0x2b98('0x4c')]);return db[_0x2b98('0x6b')]['count']({'where':_0x24a572[_0x2b98('0x48')]})[_0x2b98('0x29')](function(_0x392173){_0x3481da['count']=_0x392173;if(_0x155d01[_0x2b98('0x3e')]['includeAll']){_0x24a572[_0x2b98('0x4f')]=[{'all':!![]}];}return db[_0x2b98('0x6b')][_0x2b98('0x68')](_0x24a572);})[_0x2b98('0x29')](function(_0x606589){_0x3481da['rows']=_0x606589;return _0x3481da;});}})[_0x2b98('0x29')](respondWithFilteredResult(_0x3b7f26,_0x24a572))[_0x2b98('0x50')](handleError(_0x3b7f26,null));};exports[_0x2b98('0x6c')]=function(_0x37fef7,_0x5f1195,_0x41e25e){var _0x1165c7={'raw':!![],'where':{}};var _0xedc964={};var _0x595a48={'count':0x0,'rows':[]};return db[_0x2b98('0x3a')]['findOne']({'where':{'id':_0x37fef7[_0x2b98('0x51')]['id']}})[_0x2b98('0x29')](handleEntityNotFound(_0x5f1195,null))[_0x2b98('0x29')](function(_0x1a4f60){if(_0x1a4f60){_0xedc964[_0x2b98('0x3d')]=_['keys'](db[_0x2b98('0x6d')][_0x2b98('0x3b')]);_0xedc964['query']=_['keys'](_0x37fef7[_0x2b98('0x3e')]);_0xedc964[_0x2b98('0x40')]=_[_0x2b98('0x41')](_0xedc964['model'],_0xedc964[_0x2b98('0x3e')]);_0x1165c7[_0x2b98('0x43')]=_['intersection'](_0xedc964[_0x2b98('0x3d')],qs['fields'](_0x37fef7[_0x2b98('0x3e')]['fields']));_0x1165c7[_0x2b98('0x43')]=_0x1165c7[_0x2b98('0x43')][_0x2b98('0x5a')]?_0x1165c7[_0x2b98('0x43')]:_0xedc964[_0x2b98('0x3d')];if(!_0x37fef7['query'][_0x2b98('0x44')](_0x2b98('0x45'))){_0x1165c7[_0x2b98('0x46')]=qs[_0x2b98('0x46')](_0x37fef7[_0x2b98('0x3e')][_0x2b98('0x46')]);_0x1165c7[_0x2b98('0x21')]=qs[_0x2b98('0x21')](_0x37fef7[_0x2b98('0x3e')][_0x2b98('0x21')]);}_0x1165c7['order']=qs[_0x2b98('0x65')](_0x37fef7[_0x2b98('0x3e')][_0x2b98('0x65')]);_0x1165c7['where']=qs[_0x2b98('0x40')](_[_0x2b98('0x66')](_0x37fef7[_0x2b98('0x3e')],_0xedc964['filters']));_0x1165c7['where'][_0x2b98('0x67')]=_0x1a4f60['id'];if(_0x37fef7[_0x2b98('0x3e')][_0x2b98('0x49')]){_0x1165c7[_0x2b98('0x48')]=_['merge'](_0x1165c7[_0x2b98('0x48')],{'$or':_['map'](_0x1165c7[_0x2b98('0x43')],function(_0x51c885){var _0xb4addf={};_0xb4addf[_0x51c885]={'$like':'%'+_0x37fef7[_0x2b98('0x3e')][_0x2b98('0x49')]+'%'};return _0xb4addf;})});}_0x1165c7=_[_0x2b98('0x4a')]({},_0x1165c7,_0x37fef7[_0x2b98('0x4c')]);return db[_0x2b98('0x6d')][_0x2b98('0x4d')]({'where':_0x1165c7['where']})['then'](function(_0x3967de){_0x595a48[_0x2b98('0x4d')]=_0x3967de;if(_0x37fef7['query']['includeAll']){_0x1165c7[_0x2b98('0x4f')]=[{'all':!![]}];}return db[_0x2b98('0x6d')][_0x2b98('0x68')](_0x1165c7);})[_0x2b98('0x29')](function(_0x1cdfb7){_0x595a48[_0x2b98('0x69')]=_0x1cdfb7;return _0x595a48;});}})[_0x2b98('0x29')](respondWithFilteredResult(_0x5f1195,_0x1165c7))[_0x2b98('0x50')](handleError(_0x5f1195,null));};exports[_0x2b98('0x6e')]=function(_0x55da7b,_0x7e4fac,_0x4a123c){var _0x45e5ab={'raw':!![],'where':{}};var _0x56aa42={};var _0x3f81d8={'count':0x0,'rows':[]};return db['VoiceQueue'][_0x2b98('0x63')]({'where':{'id':_0x55da7b[_0x2b98('0x51')]['id']}})[_0x2b98('0x29')](handleEntityNotFound(_0x7e4fac,null))[_0x2b98('0x29')](function(_0x3487fb){if(_0x3487fb){_0x56aa42[_0x2b98('0x3d')]=_[_0x2b98('0x3f')](db['CmHopperBlack'][_0x2b98('0x3b')]);_0x56aa42['query']=_[_0x2b98('0x3f')](_0x55da7b[_0x2b98('0x3e')]);_0x56aa42[_0x2b98('0x40')]=_[_0x2b98('0x41')](_0x56aa42[_0x2b98('0x3d')],_0x56aa42[_0x2b98('0x3e')]);_0x45e5ab['attributes']=_[_0x2b98('0x41')](_0x56aa42['model'],qs[_0x2b98('0x42')](_0x55da7b['query']['fields']));_0x45e5ab[_0x2b98('0x43')]=_0x45e5ab['attributes'][_0x2b98('0x5a')]?_0x45e5ab[_0x2b98('0x43')]:_0x56aa42[_0x2b98('0x3d')];if(!_0x55da7b[_0x2b98('0x3e')][_0x2b98('0x44')](_0x2b98('0x45'))){_0x45e5ab[_0x2b98('0x46')]=qs[_0x2b98('0x46')](_0x55da7b[_0x2b98('0x3e')][_0x2b98('0x46')]);_0x45e5ab[_0x2b98('0x21')]=qs['offset'](_0x55da7b['query'][_0x2b98('0x21')]);}_0x45e5ab[_0x2b98('0x47')]=qs[_0x2b98('0x65')](_0x55da7b[_0x2b98('0x3e')][_0x2b98('0x65')]);_0x45e5ab['where']=qs[_0x2b98('0x40')](_['pick'](_0x55da7b[_0x2b98('0x3e')],_0x56aa42[_0x2b98('0x40')]));_0x45e5ab[_0x2b98('0x48')][_0x2b98('0x67')]=_0x3487fb['id'];if(_0x55da7b[_0x2b98('0x3e')]['filter']){_0x45e5ab[_0x2b98('0x48')]=_[_0x2b98('0x4a')](_0x45e5ab['where'],{'$or':_['map'](_0x45e5ab[_0x2b98('0x43')],function(_0x29794e){var _0x354e4d={};_0x354e4d[_0x29794e]={'$like':'%'+_0x55da7b[_0x2b98('0x3e')][_0x2b98('0x49')]+'%'};return _0x354e4d;})});}_0x45e5ab=_['merge']({},_0x45e5ab,_0x55da7b[_0x2b98('0x4c')]);return db[_0x2b98('0x6f')][_0x2b98('0x4d')]({'where':_0x45e5ab[_0x2b98('0x48')]})[_0x2b98('0x29')](function(_0x4b0511){_0x3f81d8[_0x2b98('0x4d')]=_0x4b0511;if(_0x55da7b['query'][_0x2b98('0x4e')]){_0x45e5ab[_0x2b98('0x4f')]=[{'all':!![]}];}return db[_0x2b98('0x6f')][_0x2b98('0x68')](_0x45e5ab);})[_0x2b98('0x29')](function(_0x21902d){_0x3f81d8['rows']=_0x21902d;return _0x3f81d8;});}})['then'](respondWithFilteredResult(_0x7e4fac,_0x45e5ab))[_0x2b98('0x50')](handleError(_0x7e4fac,null));};exports[_0x2b98('0x70')]=function(_0x2d5592,_0x2c6e5b,_0xc52da8){var _0x3a3cbe={};var _0x1576cc={};var _0x12aa6e;var _0x64ee9f;return db[_0x2b98('0x3a')][_0x2b98('0x63')]({'where':{'id':_0x2d5592['params']['id']}})['then'](handleEntityNotFound(_0x2c6e5b,null))[_0x2b98('0x29')](function(_0x16bb30){if(_0x16bb30){_0x12aa6e=_0x16bb30;_0x1576cc[_0x2b98('0x3d')]=_['keys'](db['Team']['rawAttributes']);_0x1576cc[_0x2b98('0x3e')]=_[_0x2b98('0x3f')](_0x2d5592[_0x2b98('0x3e')]);_0x1576cc[_0x2b98('0x40')]=_['intersection'](_0x1576cc[_0x2b98('0x3d')],_0x1576cc[_0x2b98('0x3e')]);_0x3a3cbe['attributes']=_['intersection'](_0x1576cc[_0x2b98('0x3d')],qs[_0x2b98('0x42')](_0x2d5592[_0x2b98('0x3e')]['fields']));_0x3a3cbe[_0x2b98('0x43')]=_0x3a3cbe[_0x2b98('0x43')][_0x2b98('0x5a')]?_0x3a3cbe[_0x2b98('0x43')]:_0x1576cc[_0x2b98('0x3d')];_0x3a3cbe[_0x2b98('0x47')]=qs[_0x2b98('0x65')](_0x2d5592['query'][_0x2b98('0x65')]);_0x3a3cbe['where']=qs[_0x2b98('0x40')](_['pick'](_0x2d5592[_0x2b98('0x3e')],_0x1576cc[_0x2b98('0x40')]));if(_0x2d5592[_0x2b98('0x3e')]['filter']){_0x3a3cbe[_0x2b98('0x48')]=_[_0x2b98('0x4a')](_0x3a3cbe['where'],{'$or':_[_0x2b98('0x39')](_0x3a3cbe[_0x2b98('0x43')],function(_0x441646){var _0x8e1c3b={};_0x8e1c3b[_0x441646]={'$like':'%'+_0x2d5592[_0x2b98('0x3e')][_0x2b98('0x49')]+'%'};return _0x8e1c3b;})});}_0x3a3cbe=_[_0x2b98('0x4a')]({},_0x3a3cbe,_0x2d5592[_0x2b98('0x4c')]);return _0x12aa6e[_0x2b98('0x70')](_0x3a3cbe);}})['then'](function(_0x5c9403){if(_0x5c9403){_0x64ee9f=_0x5c9403[_0x2b98('0x5a')];if(!_0x2d5592[_0x2b98('0x3e')][_0x2b98('0x44')](_0x2b98('0x45'))){_0x3a3cbe['limit']=qs[_0x2b98('0x46')](_0x2d5592[_0x2b98('0x3e')][_0x2b98('0x46')]);_0x3a3cbe[_0x2b98('0x21')]=qs[_0x2b98('0x21')](_0x2d5592['query']['offset']);}return _0x12aa6e[_0x2b98('0x70')](_0x3a3cbe);}})[_0x2b98('0x29')](function(_0x4da9e7){if(_0x4da9e7){return _0x4da9e7?{'count':_0x64ee9f,'rows':_0x4da9e7}:null;}})['then'](respondWithResult(_0x2c6e5b,null))[_0x2b98('0x50')](handleError(_0x2c6e5b,null));};exports[_0x2b98('0x71')]=function(_0x2676b1,_0x5cab32,_0x238f22){var _0x359c61=_0x2676b1['body'][_0x2b98('0x72')];var _0x304872=_['map'](_0x359c61,'id');return db[_0x2b98('0x73')][_0x2b98('0x68')]({'where':{'id':_0x304872},'attributes':['id'],'include':[{'model':db['User'],'as':_0x2b98('0x74'),'attributes':['id','name',_0x2b98('0x75'),_0x2b98('0x76'),_0x2b98('0x77')],'raw':!![]}]})[_0x2b98('0x29')](function(_0x46bd7a){if(_0x46bd7a){var _0x2f057a=_[_0x2b98('0x78')](_0x46bd7a,function(_0x5bb932){var _0x533726=_0x5bb932[_0x2b98('0x2b')]({'plain':!![]});_0x533726[_0x2b98('0x74')][_0x2b98('0x79')](function(_0x1bd03d){_0x1bd03d['penalty']=_[_0x2b98('0x32')](_0x359c61,{'id':_0x533726['id']})[_0x2b98('0x7a')];});return _0x533726[_0x2b98('0x74')];});return db[_0x2b98('0x3a')][_0x2b98('0x32')]({'where':{'id':_0x2676b1[_0x2b98('0x51')]['id']}})[_0x2b98('0x29')](function(_0x2befb1){return db['sequelize'][_0x2b98('0x7b')](function(_0x367536){return _0x2befb1[_0x2b98('0x71')](_0x304872,{'transaction':_0x367536})[_0x2b98('0x29')](function(){return BPromise['each'](_0x2f057a,function(_0x12cb9d){return db[_0x2b98('0x7c')]['findOrCreate']({'where':{'UserId':_0x12cb9d['id'],'VoiceQueueId':_0x2676b1[_0x2b98('0x51')]['id']},'defaults':{'penalty':_0x12cb9d[_0x2b98('0x7a')]},'transaction':_0x367536});});})[_0x2b98('0x29')](function(){return BPromise[_0x2b98('0x7d')](_['filter'](_0x2f057a,{'online':!![]}),function(_0x11510b){return db[_0x2b98('0x7e')][_0x2b98('0x7f')]({'membername':_0x11510b[_0x2b98('0x34')],'UserId':_0x11510b['id'],'queue_name':_0x2befb1[_0x2b98('0x34')],'VoiceQueueId':_0x2befb1['id'],'interface':_[_0x2b98('0x80')](_0x11510b[_0x2b98('0x77')])?util[_0x2b98('0x81')](_0x2b98('0x82'),_0x11510b[_0x2b98('0x34')]):_0x11510b[_0x2b98('0x77')],'paused':_0x11510b[_0x2b98('0x76')]||![],'penalty':_0x11510b[_0x2b98('0x7a')]},{'transaction':_0x367536});});})['then'](function(){_0x2f057a['forEach'](function(_0xafed48){socket[_0x2b98('0x83')](_0x2b98('0x84'),{'UserId':_0xafed48['id'],'VoiceQueueId':_0x2befb1['id']});});});});});}})['then'](respondWithStatusCode(_0x5cab32,null))['catch'](handleError(_0x5cab32,null));};exports[_0x2b98('0x85')]=function(_0x5ca260,_0x2877bf,_0x58b62d){return db[_0x2b98('0x73')][_0x2b98('0x68')]({'where':{'id':_0x5ca260[_0x2b98('0x3e')][_0x2b98('0x86')]},'attributes':['id'],'include':[{'model':db[_0x2b98('0x87')],'as':_0x2b98('0x74'),'attributes':['id'],'raw':!![]}]})[_0x2b98('0x29')](handleEntityNotFound(_0x2877bf,null))['then'](function(_0x3be788){var _0x11f282=_['map'](_0x3be788,'id');var _0x3d4805=[];var _0x5c9c98=[];var _0x5ed2c1=squel[_0x2b98('0x88')]();_0x5ed2c1[_0x2b98('0x89')](_0x2b98('0x8a'))[_0x2b98('0x8b')](_0x2b98('0x8c'),'tq')[_0x2b98('0x8d')](_0x2b98('0x8e'),'ut',_0x2b98('0x8f'))['where'](_0x2b98('0x90'),_0x5ca260[_0x2b98('0x51')]['id']);for(var _0x2ffc4d=0x0;_0x2ffc4d<_0x3be788[_0x2b98('0x5a')];_0x2ffc4d+=0x1){let _0xddaf0b=_0x3be788[_0x2ffc4d];for(var _0x2fcd67=0x0;_0x2fcd67<_0xddaf0b[_0x2b98('0x74')]['length'];_0x2fcd67+=0x1){let _0x3de396=_0xddaf0b['Agents'][_0x2fcd67];var _0x309e93=_0x5ed2c1[_0x2b98('0x59')]();_0x309e93[_0x2b98('0x48')](_0x2b98('0x91'),_0x3de396['id']);_0x5c9c98[_0x2b98('0x92')](db[_0x2b98('0x93')][_0x2b98('0x3e')](_0x309e93[_0x2b98('0x94')](),{'type':db[_0x2b98('0x93')][_0x2b98('0x95')]['SELECT']})[_0x2b98('0x29')](function(_0x267978){if(_0x267978[_0x2b98('0x5a')]===0x1){return _0x3de396['id'];}else{var _0x287795=_[_0x2b98('0x96')](_['map'](_0x267978,_0x2b98('0x97')),function(_0x39404a){return _['includes'](_0x11f282,_0x39404a);});if(_0x287795){return _0x3de396['id'];}}}));}}return BPromise[_0x2b98('0x98')](_0x5c9c98)[_0x2b98('0x29')](function(_0x468e76){_0x3d4805=_(_0x3d4805)[_0x2b98('0x99')](_0x468e76)[_0x2b98('0x9a')]()[_0x2b98('0x30')]();return db[_0x2b98('0x3a')][_0x2b98('0x32')]({'where':{'id':_0x5ca260['params']['id']}})[_0x2b98('0x29')](function(_0x19ec1a){return db['sequelize'][_0x2b98('0x7b')](function(_0x194aba){return _0x19ec1a['removeTeams'](_0x5ca260['query'][_0x2b98('0x86')],{'transaction':_0x194aba})[_0x2b98('0x29')](function(){if(!_['isEmpty'](_0x3d4805)){return _0x19ec1a[_0x2b98('0x9b')](_0x3d4805,{'transaction':_0x194aba})[_0x2b98('0x29')](function(){return db[_0x2b98('0x7e')][_0x2b98('0x2a')]({'where':{'VoiceQueueId':_0x5ca260[_0x2b98('0x51')]['id'],'UserId':_0x3d4805},'transaction':_0x194aba});});}})[_0x2b98('0x29')](function(){_0x3d4805[_0x2b98('0x79')](function(_0x371a39){socket[_0x2b98('0x83')](_0x2b98('0x9c'),{'UserId':_0x371a39,'VoiceQueueId':_0x19ec1a['id']});});});});});});})['then'](respondWithStatusCode(_0x2877bf,null))[_0x2b98('0x50')](handleError(_0x2877bf,null));};exports[_0x2b98('0x9d')]=function(_0x527a63,_0x4015d3,_0x2e24bd){var _0x5d7fa3,_0x4172f6;return db['VoiceQueue'][_0x2b98('0x32')]({'where':{'id':_0x527a63[_0x2b98('0x51')]['id']}})[_0x2b98('0x29')](handleEntityNotFound(_0x4015d3,null))[_0x2b98('0x29')](function(_0x53f472){if(_0x53f472){_0x4172f6=_0x53f472;return _0x53f472[_0x2b98('0x9d')](_0x527a63[_0x2b98('0x5d')][_0x2b98('0x86')],_[_0x2b98('0x5b')](_0x527a63['body'],[_0x2b98('0x86'),'id'])||{})[_0x2b98('0x9e')](function(_0x5f0f84){for(var _0x39dfde=0x0;_0x39dfde<_0x527a63[_0x2b98('0x5d')]['ids'][_0x2b98('0x5a')];_0x39dfde+=0x1){socket[_0x2b98('0x83')](_0x2b98('0x84'),{'UserId':_0x527a63[_0x2b98('0x5d')]['ids'][_0x39dfde],'VoiceQueueId':_0x527a63[_0x2b98('0x51')]['id']});}return _0x5f0f84;});}})['then'](function(_0x5232ae){_0x5d7fa3=_0x5232ae||[];if(_0x4172f6){return db[_0x2b98('0x87')][_0x2b98('0x68')]({'where':{'id':_0x527a63[_0x2b98('0x5d')][_0x2b98('0x86')]},'attributes':['id',_0x2b98('0x34'),_0x2b98('0x75'),_0x2b98('0x76'),_0x2b98('0x77')],'raw':!![]});}})[_0x2b98('0x29')](function(_0x33c8fa){if(!_[_0x2b98('0x9f')](_0x33c8fa)){var _0x19ef84=[];for(var _0x39eae1=0x0;_0x39eae1<_0x33c8fa[_0x2b98('0x5a')];_0x39eae1++){if(_0x33c8fa[_0x39eae1]['online']){_0x19ef84[_0x2b98('0x92')](db[_0x2b98('0x7e')][_0x2b98('0x7f')]({'membername':_0x33c8fa[_0x39eae1][_0x2b98('0x34')],'UserId':_0x33c8fa[_0x39eae1]['id'],'queue_name':_0x4172f6[_0x2b98('0x34')],'VoiceQueueId':_0x4172f6['id'],'interface':_[_0x2b98('0x80')](_0x33c8fa[_0x39eae1][_0x2b98('0x77')])?util[_0x2b98('0x81')](_0x2b98('0x82'),_0x33c8fa[_0x39eae1][_0x2b98('0x34')]):_0x33c8fa[_0x39eae1][_0x2b98('0x77')],'paused':_0x33c8fa[_0x39eae1][_0x2b98('0x76')]||![],'penalty':_0x527a63[_0x2b98('0x5d')][_0x2b98('0x7a')]||0x0}));}}return BPromise['all'](_0x19ef84);}})[_0x2b98('0x29')](function(){return _0x5d7fa3;})[_0x2b98('0x29')](respondWithResult(_0x4015d3,null))[_0x2b98('0x50')](handleError(_0x4015d3,null));};exports[_0x2b98('0x9b')]=function(_0x31977a,_0x277143,_0x50bd41){return db['VoiceQueue'][_0x2b98('0x32')]({'where':{'id':_0x31977a[_0x2b98('0x51')]['id']}})[_0x2b98('0x29')](handleEntityNotFound(_0x277143,null))[_0x2b98('0x29')](function(_0x4cef45){if(_0x4cef45){return _0x4cef45[_0x2b98('0x9b')](_0x31977a['query'][_0x2b98('0x86')])[_0x2b98('0x29')](function(){if(_['isArray'](_0x31977a[_0x2b98('0x3e')]['ids'])){for(var _0x555980=0x0;_0x555980<_0x31977a[_0x2b98('0x3e')][_0x2b98('0x86')][_0x2b98('0x5a')];_0x555980+=0x1){socket['emit']('userVoiceQueue:remove',{'UserId':Number(_0x31977a[_0x2b98('0x3e')][_0x2b98('0x86')][_0x555980]),'VoiceQueueId':Number(_0x31977a[_0x2b98('0x51')]['id'])});}}else{socket[_0x2b98('0x83')](_0x2b98('0x9c'),{'UserId':Number(_0x31977a[_0x2b98('0x3e')][_0x2b98('0x86')]),'VoiceQueueId':Number(_0x31977a[_0x2b98('0x51')]['id'])});}});}})[_0x2b98('0x29')](function(_0x140ac2){return db['UserVoiceQueueRt']['destroy']({'where':{'VoiceQueueId':_0x31977a[_0x2b98('0x51')]['id'],'UserId':_0x31977a['query'][_0x2b98('0x86')]}})[_0x2b98('0x29')](function(){return _0x140ac2;});})[_0x2b98('0x29')](respondWithStatusCode(_0x277143,null))[_0x2b98('0x50')](handleError(_0x277143,null));};exports[_0x2b98('0xa0')]=function(_0x3af9f2,_0x119c2a,_0x3f8f13){var _0x13cc85={};var _0x56319a={};var _0x14b6f9;var _0x44309a;return db[_0x2b98('0x3a')][_0x2b98('0x63')]({'where':{'id':_0x3af9f2[_0x2b98('0x51')]['id']}})[_0x2b98('0x29')](handleEntityNotFound(_0x119c2a,null))['then'](function(_0x324bee){if(_0x324bee){_0x14b6f9=_0x324bee;_0x56319a[_0x2b98('0x3d')]=_[_0x2b98('0x3f')](db[_0x2b98('0x87')][_0x2b98('0x3b')]);_0x56319a['query']=_[_0x2b98('0x3f')](_0x3af9f2[_0x2b98('0x3e')]);_0x56319a[_0x2b98('0x40')]=_[_0x2b98('0x41')](_0x56319a[_0x2b98('0x3d')],_0x56319a['query']);_0x13cc85['attributes']=_[_0x2b98('0x41')](_0x56319a['model'],qs[_0x2b98('0x42')](_0x3af9f2[_0x2b98('0x3e')][_0x2b98('0x42')]));_0x13cc85['attributes']=_0x13cc85[_0x2b98('0x43')][_0x2b98('0x5a')]?_0x13cc85[_0x2b98('0x43')]:_0x56319a[_0x2b98('0x3d')];_0x13cc85[_0x2b98('0x47')]=qs[_0x2b98('0x65')](_0x3af9f2['query']['sort']);_0x13cc85['where']=qs[_0x2b98('0x40')](_[_0x2b98('0x66')](_0x3af9f2[_0x2b98('0x3e')],_0x56319a[_0x2b98('0x40')]));if(_0x3af9f2[_0x2b98('0x3e')][_0x2b98('0x49')]){_0x13cc85[_0x2b98('0x48')]=_[_0x2b98('0x4a')](_0x13cc85[_0x2b98('0x48')],{'$or':_['map'](_0x13cc85[_0x2b98('0x43')],function(_0x2857f1){var _0x530cc0={};_0x530cc0[_0x2857f1]={'$like':'%'+_0x3af9f2[_0x2b98('0x3e')][_0x2b98('0x49')]+'%'};return _0x530cc0;})});}_0x13cc85=_['merge']({},_0x13cc85,_0x3af9f2[_0x2b98('0x4c')]);return _0x14b6f9[_0x2b98('0xa0')](_0x13cc85);}})[_0x2b98('0x29')](function(_0x5502c7){if(_0x5502c7){_0x44309a=_0x5502c7[_0x2b98('0x5a')];if(!_0x3af9f2[_0x2b98('0x3e')][_0x2b98('0x44')](_0x2b98('0x45'))){_0x13cc85[_0x2b98('0x46')]=qs[_0x2b98('0x46')](_0x3af9f2[_0x2b98('0x3e')][_0x2b98('0x46')]);_0x13cc85['offset']=qs[_0x2b98('0x21')](_0x3af9f2[_0x2b98('0x3e')][_0x2b98('0x21')]);}return _0x14b6f9[_0x2b98('0xa0')](_0x13cc85);}})[_0x2b98('0x29')](function(_0x2f6cf3){if(_0x2f6cf3){return _0x2f6cf3?{'count':_0x44309a,'rows':_0x2f6cf3}:null;}})[_0x2b98('0x29')](respondWithResult(_0x119c2a,null))[_0x2b98('0x50')](handleError(_0x119c2a,null));};exports['getMembers']=function(_0x3afc30,_0x1e1ad9,_0x199d49){var _0x11c0ab={};var _0x5972eb={};var _0x227b4c;var _0x48ff54;return db[_0x2b98('0x3a')][_0x2b98('0x63')]({'where':{'id':_0x3afc30[_0x2b98('0x51')]['id']}})['then'](handleEntityNotFound(_0x1e1ad9,null))['then'](function(_0xff04e4){if(_0xff04e4){_0x227b4c=_0xff04e4;_0x5972eb[_0x2b98('0x3d')]=_[_0x2b98('0x3f')](db[_0x2b98('0x7e')][_0x2b98('0x3b')]);_0x5972eb[_0x2b98('0x3e')]=_[_0x2b98('0x3f')](_0x3afc30[_0x2b98('0x3e')]);_0x5972eb[_0x2b98('0x40')]=_[_0x2b98('0x41')](_0x5972eb[_0x2b98('0x3d')],_0x5972eb[_0x2b98('0x3e')]);_0x11c0ab['attributes']=_['intersection'](_0x5972eb['model'],qs[_0x2b98('0x42')](_0x3afc30[_0x2b98('0x3e')][_0x2b98('0x42')]));_0x11c0ab[_0x2b98('0x43')]=_0x11c0ab[_0x2b98('0x43')][_0x2b98('0x5a')]?_0x11c0ab['attributes']:_0x5972eb[_0x2b98('0x3d')];_0x11c0ab[_0x2b98('0x47')]=qs[_0x2b98('0x65')](_0x3afc30[_0x2b98('0x3e')]['sort']);_0x11c0ab['where']=qs[_0x2b98('0x40')](_['pick'](_0x3afc30[_0x2b98('0x3e')],_0x5972eb['filters']));if(_0x3afc30[_0x2b98('0x3e')]['filter']){_0x11c0ab['where']=_['merge'](_0x11c0ab[_0x2b98('0x48')],{'$or':_[_0x2b98('0x39')](_0x11c0ab[_0x2b98('0x43')],function(_0x29e061){var _0x639279={};_0x639279[_0x29e061]={'$like':'%'+_0x3afc30[_0x2b98('0x3e')][_0x2b98('0x49')]+'%'};return _0x639279;})});}_0x11c0ab=_['merge']({},_0x11c0ab,_0x3afc30[_0x2b98('0x4c')]);return _0x227b4c[_0x2b98('0xa1')](_0x11c0ab);}})[_0x2b98('0x29')](function(_0x54137d){if(_0x54137d){_0x48ff54=_0x54137d[_0x2b98('0x5a')];if(!_0x3afc30[_0x2b98('0x3e')][_0x2b98('0x44')](_0x2b98('0x45'))){_0x11c0ab['limit']=qs[_0x2b98('0x46')](_0x3afc30[_0x2b98('0x3e')][_0x2b98('0x46')]);_0x11c0ab['offset']=qs[_0x2b98('0x21')](_0x3afc30[_0x2b98('0x3e')][_0x2b98('0x21')]);}return _0x227b4c[_0x2b98('0xa1')](_0x11c0ab);}})[_0x2b98('0x29')](function(_0x53347f){return _0x53347f?{'count':_0x48ff54,'rows':_0x53347f}:null;})[_0x2b98('0x29')](respondWithResult(_0x1e1ad9,null))['catch'](handleError(_0x1e1ad9,null));};exports['getLists']=function(_0x5423af,_0x190bdf,_0x425038){var _0x529707={};var _0x440111={};var _0x1c7d6c;var _0x4c43d3;return db[_0x2b98('0x3a')][_0x2b98('0x63')]({'where':{'id':_0x5423af[_0x2b98('0x51')]['id']}})[_0x2b98('0x29')](handleEntityNotFound(_0x190bdf,null))['then'](function(_0xd3220f){if(_0xd3220f){_0x1c7d6c=_0xd3220f;_0x440111[_0x2b98('0x3d')]=_[_0x2b98('0x3f')](db[_0x2b98('0xa2')][_0x2b98('0x3b')]);_0x440111[_0x2b98('0x3e')]=_['keys'](_0x5423af[_0x2b98('0x3e')]);_0x440111[_0x2b98('0x40')]=_['intersection'](_0x440111['model'],_0x440111[_0x2b98('0x3e')]);_0x529707[_0x2b98('0x43')]=_['intersection'](_0x440111[_0x2b98('0x3d')],qs[_0x2b98('0x42')](_0x5423af['query'][_0x2b98('0x42')]));_0x529707[_0x2b98('0x43')]=_0x529707[_0x2b98('0x43')][_0x2b98('0x5a')]?_0x529707[_0x2b98('0x43')]:_0x440111['model'];_0x529707[_0x2b98('0x47')]=qs['sort'](_0x5423af['query']['sort']);_0x529707[_0x2b98('0x48')]=qs[_0x2b98('0x40')](_[_0x2b98('0x66')](_0x5423af[_0x2b98('0x3e')],_0x440111[_0x2b98('0x40')]));if(_0x5423af['query'][_0x2b98('0x49')]){_0x529707[_0x2b98('0x48')]=_[_0x2b98('0x4a')](_0x529707['where'],{'$or':_[_0x2b98('0x39')](_0x529707['attributes'],function(_0x3a992f){var _0x3521e5={};_0x3521e5[_0x3a992f]={'$like':'%'+_0x5423af[_0x2b98('0x3e')]['filter']+'%'};return _0x3521e5;})});}_0x529707=_[_0x2b98('0x4a')]({},_0x529707,_0x5423af['options']);return _0x1c7d6c[_0x2b98('0xa3')](_0x529707);}})[_0x2b98('0x29')](function(_0x543887){if(_0x543887){_0x4c43d3=_0x543887[_0x2b98('0x5a')];if(!_0x5423af[_0x2b98('0x3e')][_0x2b98('0x44')]('nolimit')){_0x529707['limit']=qs[_0x2b98('0x46')](_0x5423af[_0x2b98('0x3e')][_0x2b98('0x46')]);_0x529707['offset']=qs[_0x2b98('0x21')](_0x5423af['query'][_0x2b98('0x21')]);}return _0x1c7d6c[_0x2b98('0xa3')](_0x529707);}})[_0x2b98('0x29')](function(_0x127f75){if(_0x127f75){return _0x127f75?{'count':_0x4c43d3,'rows':_0x127f75}:null;}})[_0x2b98('0x29')](respondWithResult(_0x190bdf,null))['catch'](handleError(_0x190bdf,null));};exports[_0x2b98('0xa4')]=function(_0x1ae4fa,_0x2687c6,_0x4e30b9){var _0x5d8b30,_0x2ea7ca;return db['VoiceQueue'][_0x2b98('0x32')]({'where':{'id':_0x1ae4fa[_0x2b98('0x51')]['id']}})[_0x2b98('0x29')](handleEntityNotFound(_0x2687c6,null))['then'](function(_0x307564){if(_0x307564){_0x2ea7ca=_0x307564;return _0x307564[_0x2b98('0xa4')](_0x1ae4fa['body'][_0x2b98('0x86')],_[_0x2b98('0x5b')](_0x1ae4fa['body'],[_0x2b98('0x86'),'id'])||{});}return null;})[_0x2b98('0x9e')](function(_0x3779c1){var _0x397e5d;_0x5d8b30=_0x3779c1||[];var _0x4c76d6=[];if(_0x3779c1){for(var _0x49ddaf=0x0;_0x49ddaf<_0x3779c1['length'];_0x49ddaf+=0x1){var _0xa44e54=_0x3779c1[_0x49ddaf]['get']({'plain':!![]});_0x2ea7ca[_0x2b98('0xa5')]=_0x1ae4fa[_0x2b98('0x5d')][_0x2b98('0xa5')]?_0x1ae4fa[_0x2b98('0x5d')]['dialCheckDuplicateType']:_0x2ea7ca[_0x2b98('0xa5')];switch(_0x2ea7ca['dialCheckDuplicateType']){case'always':_0x397e5d=squel['insert']()[_0x2b98('0xa6')](_0x2b98('0xa7'))[_0x2b98('0xa8')]([_0x2b98('0xa9'),_0x2b98('0xaa'),_0x2b98('0xab'),_0x2b98('0xac'),'VoiceQueueId',_0x2b98('0x5c'),_0x2b98('0x5e')],squel[_0x2b98('0x88')]()[_0x2b98('0x89')](_0x2b98('0xa9'),_0x2b98('0xa9'))['field']('NOW()',_0x2b98('0xaa'))[_0x2b98('0x89')]('id','ContactId')[_0x2b98('0x89')](_0xa44e54[_0x2b98('0xad')]['toString'](),'ListId')[_0x2b98('0x89')](_0x1ae4fa['params']['id'][_0x2b98('0x94')](),'VoiceQueueId')['field'](_0x2b98('0xae'),_0x2b98('0x5c'))[_0x2b98('0x89')](_0x2b98('0xae'),'updatedAt')[_0x2b98('0x8b')](_0x2b98('0xaf'))[_0x2b98('0x48')]('deletedAt\x20IS\x20NULL')[_0x2b98('0x48')](_0x2b98('0xb0'),_0xa44e54[_0x2b98('0xad')][_0x2b98('0x94')]())[_0x2b98('0x48')](_0x2b98('0xb1'))[_0x2b98('0x48')](_0x2b98('0xb2'),squel[_0x2b98('0x88')]()[_0x2b98('0x89')]('COALESCE(calleridnum,\x27\x27)')[_0x2b98('0x8b')](_0x2b98('0xb3'))['where'](_0x2b98('0x90'),_0x1ae4fa[_0x2b98('0x51')]['id'][_0x2b98('0x94')]()))['where'](_0x2b98('0xb2'),squel[_0x2b98('0x88')]()['field'](_0x2b98('0xb4'))[_0x2b98('0x8b')](_0x2b98('0xa7'))[_0x2b98('0x48')](_0x2b98('0x90'),_0x1ae4fa[_0x2b98('0x51')]['id'][_0x2b98('0x94')]())))[_0x2b98('0x94')]();break;case _0x2b98('0xb5'):_0x397e5d=squel['insert']()[_0x2b98('0xa6')](_0x2b98('0xa7'))['fromQuery']([_0x2b98('0xa9'),'scheduledAt',_0x2b98('0xab'),_0x2b98('0xac'),'VoiceQueueId','createdAt',_0x2b98('0x5e')],squel['select']()[_0x2b98('0x89')](_0x2b98('0xa9'),_0x2b98('0xa9'))[_0x2b98('0x89')]('NOW()',_0x2b98('0xaa'))[_0x2b98('0x89')]('id',_0x2b98('0xab'))[_0x2b98('0x89')](_0xa44e54[_0x2b98('0xad')]['toString'](),_0x2b98('0xac'))[_0x2b98('0x89')](_0x1ae4fa[_0x2b98('0x51')]['id']['toString'](),_0x2b98('0x67'))[_0x2b98('0x89')](_0x2b98('0xae'),_0x2b98('0x5c'))[_0x2b98('0x89')](_0x2b98('0xae'),_0x2b98('0x5e'))[_0x2b98('0x8b')]('cm_contacts')['where'](_0x2b98('0xb6'))['where'](_0x2b98('0xb0'),_0xa44e54[_0x2b98('0xad')]['toString']())[_0x2b98('0x48')]('phone\x20IS\x20NOT\x20NULL')[_0x2b98('0x48')](_0x2b98('0xb2'),squel[_0x2b98('0x88')]()[_0x2b98('0x89')](_0x2b98('0xb4'))[_0x2b98('0x8b')](_0x2b98('0xa7'))[_0x2b98('0x48')](_0x2b98('0x90'),_0x1ae4fa[_0x2b98('0x51')]['id'][_0x2b98('0x94')]())))[_0x2b98('0x94')]();break;default:_0x397e5d=squel[_0x2b98('0xb7')]()[_0x2b98('0xa6')](_0x2b98('0xa7'))[_0x2b98('0xa8')]([_0x2b98('0xa9'),'scheduledAt',_0x2b98('0xab'),'ListId',_0x2b98('0x67'),_0x2b98('0x5c'),'updatedAt'],squel[_0x2b98('0x88')]()[_0x2b98('0x89')](_0x2b98('0xa9'),'phone')['field'](_0x2b98('0xae'),_0x2b98('0xaa'))[_0x2b98('0x89')]('id',_0x2b98('0xab'))[_0x2b98('0x89')](_0xa44e54[_0x2b98('0xad')][_0x2b98('0x94')](),_0x2b98('0xac'))[_0x2b98('0x89')](_0x1ae4fa[_0x2b98('0x51')]['id'][_0x2b98('0x94')](),'VoiceQueueId')[_0x2b98('0x89')](_0x2b98('0xae'),_0x2b98('0x5c'))[_0x2b98('0x89')](_0x2b98('0xae'),_0x2b98('0x5e'))['from']('cm_contacts')[_0x2b98('0x48')](_0x2b98('0xb6'))['where'](_0x2b98('0xb0'),_0xa44e54[_0x2b98('0xad')][_0x2b98('0x94')]())['where']('phone\x20IS\x20NOT\x20NULL'))[_0x2b98('0x94')]();}_0x4c76d6[_0x2b98('0x92')](db[_0x2b98('0x93')][_0x2b98('0x3e')](_0x397e5d));}return BPromise['all'](_0x4c76d6);}})[_0x2b98('0x29')](function(){return _0x5d8b30;})[_0x2b98('0x29')](respondWithResult(_0x2687c6,null))[_0x2b98('0x50')](handleError(_0x2687c6,null));};exports[_0x2b98('0xb8')]=function(_0x434727,_0x44b856,_0x45b24f){return db[_0x2b98('0x3a')][_0x2b98('0x32')]({'where':{'id':_0x434727[_0x2b98('0x51')]['id']}})[_0x2b98('0x29')](handleEntityNotFound(_0x44b856,null))[_0x2b98('0x29')](function(_0x2e1a2c){if(_0x2e1a2c){return _0x2e1a2c['removeLists'](_0x434727[_0x2b98('0x3e')][_0x2b98('0x86')]);}})['then'](function(_0x186912){if(_0x186912){return db[_0x2b98('0x64')]['destroy']({'where':{'ListId':_0x434727['query']['ids'],'VoiceQueueId':_0x434727['params']['id']}})[_0x2b98('0x29')](function(){return _0x186912;});}})['then'](respondWithStatusCode(_0x44b856,null))[_0x2b98('0x50')](handleError(_0x44b856,null));};exports['getBlackLists']=function(_0x109743,_0x418abe,_0x2442ee){var _0x399003={};var _0x28eadc={};var _0x1ec990;var _0x27ef7b;return db[_0x2b98('0x3a')][_0x2b98('0x63')]({'where':{'id':_0x109743[_0x2b98('0x51')]['id']}})[_0x2b98('0x29')](handleEntityNotFound(_0x418abe,null))['then'](function(_0xe2a17c){if(_0xe2a17c){_0x1ec990=_0xe2a17c;_0x28eadc[_0x2b98('0x3d')]=_['keys'](db[_0x2b98('0xa2')]['rawAttributes']);_0x28eadc['query']=_[_0x2b98('0x3f')](_0x109743[_0x2b98('0x3e')]);_0x28eadc['filters']=_['intersection'](_0x28eadc[_0x2b98('0x3d')],_0x28eadc['query']);_0x399003[_0x2b98('0x43')]=_[_0x2b98('0x41')](_0x28eadc[_0x2b98('0x3d')],qs[_0x2b98('0x42')](_0x109743[_0x2b98('0x3e')][_0x2b98('0x42')]));_0x399003[_0x2b98('0x43')]=_0x399003[_0x2b98('0x43')][_0x2b98('0x5a')]?_0x399003[_0x2b98('0x43')]:_0x28eadc[_0x2b98('0x3d')];_0x399003[_0x2b98('0x47')]=qs[_0x2b98('0x65')](_0x109743[_0x2b98('0x3e')][_0x2b98('0x65')]);_0x399003[_0x2b98('0x48')]=qs[_0x2b98('0x40')](_[_0x2b98('0x66')](_0x109743['query'],_0x28eadc[_0x2b98('0x40')]));if(_0x109743[_0x2b98('0x3e')]['filter']){_0x399003[_0x2b98('0x48')]=_[_0x2b98('0x4a')](_0x399003['where'],{'$or':_[_0x2b98('0x39')](_0x399003[_0x2b98('0x43')],function(_0x2744b9){var _0x566d74={};_0x566d74[_0x2744b9]={'$like':'%'+_0x109743[_0x2b98('0x3e')]['filter']+'%'};return _0x566d74;})});}_0x399003=_['merge']({},_0x399003,_0x109743[_0x2b98('0x4c')]);return _0x1ec990['getBlackLists'](_0x399003);}})[_0x2b98('0x29')](function(_0x31b4b1){if(_0x31b4b1){_0x27ef7b=_0x31b4b1[_0x2b98('0x5a')];if(!_0x109743['query'][_0x2b98('0x44')](_0x2b98('0x45'))){_0x399003[_0x2b98('0x46')]=qs['limit'](_0x109743['query'][_0x2b98('0x46')]);_0x399003[_0x2b98('0x21')]=qs['offset'](_0x109743[_0x2b98('0x3e')][_0x2b98('0x21')]);}return _0x1ec990['getBlackLists'](_0x399003);}})[_0x2b98('0x29')](function(_0x5af338){if(_0x5af338){return _0x5af338?{'count':_0x27ef7b,'rows':_0x5af338}:null;}})[_0x2b98('0x29')](respondWithResult(_0x418abe,null))[_0x2b98('0x50')](handleError(_0x418abe,null));};exports[_0x2b98('0xb9')]=function(_0x1a1caf,_0x2cb269,_0x2ec0ab){var _0x2aa996,_0x15b1b7;return db[_0x2b98('0x3a')]['find']({'where':{'id':_0x1a1caf[_0x2b98('0x51')]['id']}})[_0x2b98('0x29')](handleEntityNotFound(_0x2cb269,null))[_0x2b98('0x29')](function(_0x335c25){if(_0x335c25){_0x15b1b7=_0x335c25;return _0x335c25['addBlackLists'](_0x1a1caf[_0x2b98('0x5d')][_0x2b98('0x86')],_['omit'](_0x1a1caf[_0x2b98('0x5d')],[_0x2b98('0x86'),'id'])||{});}return null;})[_0x2b98('0x9e')](function(_0x5dc0ed){var _0x4a370b;_0x2aa996=_0x5dc0ed||[];var _0x29bf31=[];if(_0x5dc0ed){for(var _0x2f8fc5=0x0;_0x2f8fc5<_0x5dc0ed['length'];_0x2f8fc5+=0x1){var _0x16f03e=_0x5dc0ed[_0x2f8fc5][_0x2b98('0x2b')]({'plain':!![]});_0x4a370b=squel[_0x2b98('0xb7')]()['into'](_0x2b98('0xba'))[_0x2b98('0xa8')](['phone',_0x2b98('0xab'),_0x2b98('0xac'),'VoiceQueueId','createdAt',_0x2b98('0x5e')],squel['select']()[_0x2b98('0x89')](_0x2b98('0xa9'),_0x2b98('0xa9'))['field']('id',_0x2b98('0xab'))[_0x2b98('0x89')](_0x16f03e[_0x2b98('0xad')][_0x2b98('0x94')](),_0x2b98('0xac'))[_0x2b98('0x89')](_0x1a1caf['params']['id'][_0x2b98('0x94')](),_0x2b98('0x67'))['field'](_0x2b98('0xae'),_0x2b98('0x5c'))[_0x2b98('0x89')](_0x2b98('0xae'),'updatedAt')[_0x2b98('0x8b')](_0x2b98('0xaf'))[_0x2b98('0x48')](_0x2b98('0xb6'))[_0x2b98('0x48')]('ListId\x20=\x20?',_0x16f03e[_0x2b98('0xad')][_0x2b98('0x94')]())[_0x2b98('0x48')](_0x2b98('0xb1')))[_0x2b98('0x94')]();_0x29bf31[_0x2b98('0x92')](db['sequelize'][_0x2b98('0x3e')](_0x4a370b));}return BPromise['all'](_0x29bf31);}})[_0x2b98('0x29')](function(){return _0x2aa996;})[_0x2b98('0x29')](respondWithResult(_0x2cb269,null))['catch'](handleError(_0x2cb269,null));};exports[_0x2b98('0xbb')]=function(_0x1f5104,_0x155d36,_0x262c6c){return db[_0x2b98('0x3a')]['find']({'where':{'id':_0x1f5104[_0x2b98('0x51')]['id']}})[_0x2b98('0x29')](handleEntityNotFound(_0x155d36,null))[_0x2b98('0x29')](function(_0x5032b3){if(_0x5032b3){return _0x5032b3['removeBlackLists'](_0x1f5104[_0x2b98('0x3e')][_0x2b98('0x86')]);}})[_0x2b98('0x29')](function(_0x489ebd){if(_0x489ebd){return db['CmHopperBlack'][_0x2b98('0x2a')]({'where':{'ListId':_0x1f5104['query'][_0x2b98('0x86')],'VoiceQueueId':_0x1f5104['params']['id']}})['then'](function(){return _0x489ebd;});}})[_0x2b98('0x29')](respondWithStatusCode(_0x155d36,null))[_0x2b98('0x50')](handleError(_0x155d36,null));};
\ No newline at end of file
diff --git a/server/api/voiceQueue/voiceQueue.events.js b/server/api/voiceQueue/voiceQueue.events.js
index b1eae3a..af6f3d4 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 _0x4bcf=['remove','emit','hook','exports','events','VoiceQueue','setMaxListeners','save','update'];(function(_0x595e53,_0x3926c9){var _0x289582=function(_0x60ed59){while(--_0x60ed59){_0x595e53['push'](_0x595e53['shift']());}};_0x289582(++_0x3926c9);}(_0x4bcf,0x1bd));var _0xf4bc=function(_0x572165,_0x6a45cc){_0x572165=_0x572165-0x0;var _0x8c8709=_0x4bcf[_0x572165];return _0x8c8709;};'use strict';var EventEmitter=require(_0xf4bc('0x0'));var VoiceQueue=require('../../mysqldb')['db'][_0xf4bc('0x1')];var VoiceQueueEvents=new EventEmitter();VoiceQueueEvents[_0xf4bc('0x2')](0x0);var events={'afterCreate':_0xf4bc('0x3'),'afterUpdate':_0xf4bc('0x4'),'afterDestroy':_0xf4bc('0x5')};function emitEvent(_0x35981c){return function(_0x4f0da1,_0xf7d412,_0x23c11b){VoiceQueueEvents[_0xf4bc('0x6')](_0x35981c+':'+_0x4f0da1['id'],_0x4f0da1);VoiceQueueEvents[_0xf4bc('0x6')](_0x35981c,_0x4f0da1);_0x23c11b(null);};}for(var e in events){if(events['hasOwnProperty'](e)){var event=events[e];VoiceQueue[_0xf4bc('0x7')](e,emitEvent(event));}}module[_0xf4bc('0x8')]=VoiceQueueEvents;
\ No newline at end of file
+var _0xe7c8=['hook','exports','events','../../mysqldb','save','emit','hasOwnProperty'];(function(_0x1d0f0c,_0x215829){var _0x1c66e8=function(_0x27635c){while(--_0x27635c){_0x1d0f0c['push'](_0x1d0f0c['shift']());}};_0x1c66e8(++_0x215829);}(_0xe7c8,0x8e));var _0x8e7c=function(_0x25db26,_0x48f45f){_0x25db26=_0x25db26-0x0;var _0x748fa6=_0xe7c8[_0x25db26];return _0x748fa6;};'use strict';var EventEmitter=require(_0x8e7c('0x0'));var VoiceQueue=require(_0x8e7c('0x1'))['db']['VoiceQueue'];var VoiceQueueEvents=new EventEmitter();VoiceQueueEvents['setMaxListeners'](0x0);var events={'afterCreate':_0x8e7c('0x2'),'afterUpdate':'update','afterDestroy':'remove'};function emitEvent(_0xc51c94){return function(_0x172297,_0x434434,_0x231da3){VoiceQueueEvents[_0x8e7c('0x3')](_0xc51c94+':'+_0x172297['id'],_0x172297);VoiceQueueEvents[_0x8e7c('0x3')](_0xc51c94,_0x172297);_0x231da3(null);};}for(var e in events){if(events[_0x8e7c('0x4')](e)){var event=events[e];VoiceQueue[_0x8e7c('0x5')](e,emitEvent(event));}}module[_0x8e7c('0x6')]=VoiceQueueEvents;
\ No newline at end of file
diff --git a/server/api/voiceQueue/voiceQueue.model.js b/server/api/voiceQueue/voiceQueue.model.js
index 5a39ae5..da04cdc 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 _0xd3af=['exports','voice_queues','util','../../config/logger','api','moment','bluebird','request-promise','path','rimraf','../../config/environment','./voiceQueue.attributes'];(function(_0x19e35c,_0x29cd1e){var _0x3e1fe8=function(_0x17258b){while(--_0x17258b){_0x19e35c['push'](_0x19e35c['shift']());}};_0x3e1fe8(++_0x29cd1e);}(_0xd3af,0xb6));var _0xfd3a=function(_0x501510,_0x61caa9){_0x501510=_0x501510-0x0;var _0x1e6ee5=_0xd3af[_0x501510];return _0x1e6ee5;};'use strict';var _=require('lodash');var util=require(_0xfd3a('0x0'));var logger=require(_0xfd3a('0x1'))(_0xfd3a('0x2'));var moment=require(_0xfd3a('0x3'));var BPromise=require(_0xfd3a('0x4'));var rp=require(_0xfd3a('0x5'));var fs=require('fs');var path=require(_0xfd3a('0x6'));var rimraf=require(_0xfd3a('0x7'));var config=require(_0xfd3a('0x8'));var attributes=require(_0xfd3a('0x9'));module[_0xfd3a('0xa')]=function(_0x27dadd,_0x1188f9){return _0x27dadd['define']('VoiceQueue',attributes,{'tableName':_0xfd3a('0xb'),'paranoid':![],'indexes':[],'timestamps':!![]});};
\ No newline at end of file
+var _0x2726=['path','rimraf','./voiceQueue.attributes','VoiceQueue','util','api','moment','bluebird','request-promise'];(function(_0x3a7a89,_0x159336){var _0x2b5e68=function(_0x5f0f14){while(--_0x5f0f14){_0x3a7a89['push'](_0x3a7a89['shift']());}};_0x2b5e68(++_0x159336);}(_0x2726,0xa6));var _0x6272=function(_0x2bcd1f,_0x4f1972){_0x2bcd1f=_0x2bcd1f-0x0;var _0x2381ca=_0x2726[_0x2bcd1f];return _0x2381ca;};'use strict';var _=require('lodash');var util=require(_0x6272('0x0'));var logger=require('../../config/logger')(_0x6272('0x1'));var moment=require(_0x6272('0x2'));var BPromise=require(_0x6272('0x3'));var rp=require(_0x6272('0x4'));var fs=require('fs');var path=require(_0x6272('0x5'));var rimraf=require(_0x6272('0x6'));var config=require('../../config/environment');var attributes=require(_0x6272('0x7'));module['exports']=function(_0x4a235a,_0x5e25c4){return _0x4a235a['define'](_0x6272('0x8'),attributes,{'tableName':'voice_queues','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 641182a..78c2d22 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 _0xaf04=['attributes','map','include','info','stringify','catch','ShowVoiceQueue','find','where','bluebird','randomstring','../../mysqldb','../../config/logger','rpc','../../config/environment','client','http','redis','localhost','socket.io-emitter','./voiceQueue.socket','register','then','VoiceQueue,\x20%s,\x20%s','request\x20sent','debug','VoiceQueue,\x20%s,\x20%s,\x20%s','error','code','message','result','GetVoiceQueue','VoiceQueue','findAll','options','raw','model'];(function(_0x2234d5,_0x3f6368){var _0x4e4500=function(_0x2f5423){while(--_0x2f5423){_0x2234d5['push'](_0x2234d5['shift']());}};_0x4e4500(++_0x3f6368);}(_0xaf04,0x9d));var _0x4af0=function(_0x3fbb30,_0x30ef03){_0x3fbb30=_0x3fbb30-0x0;var _0x52c441=_0xaf04[_0x3fbb30];return _0x52c441;};'use strict';var _=require('lodash');var util=require('util');var moment=require('moment');var BPromise=require(_0x4af0('0x0'));var rs=require(_0x4af0('0x1'));var fs=require('fs');var Redis=require('ioredis');var db=require(_0x4af0('0x2'))['db'];var utils=require('../../config/utils');var logger=require(_0x4af0('0x3'))(_0x4af0('0x4'));var config=require(_0x4af0('0x5'));var jayson=require('jayson/promise');var client=jayson[_0x4af0('0x6')][_0x4af0('0x7')]({'port':0x232a});config[_0x4af0('0x8')]=_['defaults'](config['redis'],{'host':_0x4af0('0x9'),'port':0x18eb});var socket=require(_0x4af0('0xa'))(new Redis(config[_0x4af0('0x8')]));require(_0x4af0('0xb'))[_0x4af0('0xc')](socket);function respondWithRpcPromise(_0x3ec78a,_0x51537c,_0x1892d2){return new BPromise(function(_0x1d8ae1,_0x21c891){return client['request'](_0x3ec78a,_0x1892d2)[_0x4af0('0xd')](function(_0x56e84d){logger['info'](_0x4af0('0xe'),_0x51537c,_0x4af0('0xf'));logger[_0x4af0('0x10')](_0x4af0('0x11'),_0x51537c,'request\x20sent',JSON['stringify'](_0x56e84d));if(_0x56e84d['error']){if(_0x56e84d[_0x4af0('0x12')][_0x4af0('0x13')]===0x1f4){logger[_0x4af0('0x12')](_0x4af0('0xe'),_0x51537c,_0x56e84d[_0x4af0('0x12')][_0x4af0('0x14')]);return _0x21c891(_0x56e84d[_0x4af0('0x12')][_0x4af0('0x14')]);}logger[_0x4af0('0x12')]('VoiceQueue,\x20%s,\x20%s',_0x51537c,_0x56e84d[_0x4af0('0x12')][_0x4af0('0x14')]);return _0x1d8ae1(_0x56e84d[_0x4af0('0x12')][_0x4af0('0x14')]);}else{logger['info'](_0x4af0('0xe'),_0x51537c,_0x4af0('0xf'));_0x1d8ae1(_0x56e84d[_0x4af0('0x15')][_0x4af0('0x14')]);}})['catch'](function(_0x675f60){logger['error'](_0x4af0('0xe'),_0x51537c,_0x675f60);_0x21c891(_0x675f60);});});}exports[_0x4af0('0x16')]=function(_0x5d0309){var _0x55748e=this;return new Promise(function(_0x236e87,_0x2cfc8d){return db[_0x4af0('0x17')][_0x4af0('0x18')]({'raw':_0x5d0309['options']?_0x5d0309[_0x4af0('0x19')][_0x4af0('0x1a')]===undefined?!![]:![]:!![],'where':_0x5d0309[_0x4af0('0x19')]?_0x5d0309[_0x4af0('0x19')]['where']||null:null,'attributes':_0x5d0309[_0x4af0('0x19')]?_0x5d0309[_0x4af0('0x19')]['attributes']||null:null,'limit':_0x5d0309[_0x4af0('0x19')]?_0x5d0309[_0x4af0('0x19')]['limit']||null:null,'include':_0x5d0309[_0x4af0('0x19')]?_0x5d0309[_0x4af0('0x19')]['include']?_['map'](_0x5d0309[_0x4af0('0x19')]['include'],function(_0x2d2278){return{'model':db[_0x2d2278[_0x4af0('0x1b')]],'as':_0x2d2278['as'],'attributes':_0x2d2278[_0x4af0('0x1c')],'include':_0x2d2278['include']?_[_0x4af0('0x1d')](_0x2d2278[_0x4af0('0x1e')],function(_0x277e81){return{'model':db[_0x277e81[_0x4af0('0x1b')]],'as':_0x277e81['as'],'attributes':_0x277e81[_0x4af0('0x1c')],'include':_0x277e81[_0x4af0('0x1e')]?_[_0x4af0('0x1d')](_0x277e81[_0x4af0('0x1e')],function(_0x54e2d1){return{'model':db[_0x54e2d1[_0x4af0('0x1b')]],'as':_0x54e2d1['as'],'attributes':_0x54e2d1[_0x4af0('0x1c')]};}):[]};}):[]};}):[]:[]})['then'](function(_0x177786){logger[_0x4af0('0x1f')](_0x4af0('0x16'),_0x5d0309);logger[_0x4af0('0x10')]('GetVoiceQueue',_0x5d0309,JSON[_0x4af0('0x20')](_0x177786));_0x236e87(_0x177786);})[_0x4af0('0x21')](function(_0xa636e5){logger['error'](_0x4af0('0x16'),_0xa636e5[_0x4af0('0x14')],_0x5d0309);_0x2cfc8d(_0x55748e['error'](0x1f4,_0xa636e5[_0x4af0('0x14')]));});});};exports[_0x4af0('0x22')]=function(_0x6982f){var _0x24a2ec=this;return new Promise(function(_0x103f22,_0x5c6fba){return db[_0x4af0('0x17')][_0x4af0('0x23')]({'raw':_0x6982f[_0x4af0('0x19')]?_0x6982f[_0x4af0('0x19')][_0x4af0('0x1a')]===undefined?!![]:![]:!![],'where':_0x6982f[_0x4af0('0x19')]?_0x6982f['options'][_0x4af0('0x24')]||null:null,'attributes':_0x6982f['options']?_0x6982f[_0x4af0('0x19')][_0x4af0('0x1c')]||null:null,'include':_0x6982f['options']?_0x6982f[_0x4af0('0x19')][_0x4af0('0x1e')]?_[_0x4af0('0x1d')](_0x6982f[_0x4af0('0x19')][_0x4af0('0x1e')],function(_0x5ac337){return{'model':db[_0x5ac337[_0x4af0('0x1b')]],'as':_0x5ac337['as'],'attributes':_0x5ac337['attributes'],'include':_0x5ac337[_0x4af0('0x1e')]?_[_0x4af0('0x1d')](_0x5ac337[_0x4af0('0x1e')],function(_0xad0980){return{'model':db[_0xad0980[_0x4af0('0x1b')]],'as':_0xad0980['as'],'attributes':_0xad0980[_0x4af0('0x1c')],'include':_0xad0980[_0x4af0('0x1e')]?_[_0x4af0('0x1d')](_0xad0980['include'],function(_0x76daa0){return{'model':db[_0x76daa0[_0x4af0('0x1b')]],'as':_0x76daa0['as'],'attributes':_0x76daa0['attributes']};}):[]};}):[]};}):[]:[]})[_0x4af0('0xd')](function(_0x56242f){logger[_0x4af0('0x1f')](_0x4af0('0x22'),_0x6982f);logger['debug'](_0x4af0('0x22'),_0x6982f,JSON[_0x4af0('0x20')](_0x56242f));_0x103f22(_0x56242f);})['catch'](function(_0x9d6cd5){logger[_0x4af0('0x12')](_0x4af0('0x22'),_0x9d6cd5[_0x4af0('0x14')],_0x6982f);_0x5c6fba(_0x24a2ec['error'](0x1f4,_0x9d6cd5[_0x4af0('0x14')]));});});};
\ No newline at end of file
+var _0x064a=['find','util','randomstring','ioredis','../../mysqldb','../../config/logger','../../config/environment','http','redis','localhost','socket.io-emitter','./voiceQueue.socket','register','request','then','info','VoiceQueue,\x20%s,\x20%s','request\x20sent','debug','VoiceQueue,\x20%s,\x20%s,\x20%s','error','code','message','result','catch','GetVoiceQueue','findAll','options','where','attributes','limit','include','map','model','stringify','ShowVoiceQueue','VoiceQueue'];(function(_0x5d06e8,_0x146c15){var _0x2994de=function(_0x136a62){while(--_0x136a62){_0x5d06e8['push'](_0x5d06e8['shift']());}};_0x2994de(++_0x146c15);}(_0x064a,0xba));var _0xa064=function(_0x14add3,_0x13ce8d){_0x14add3=_0x14add3-0x0;var _0x4a174f=_0x064a[_0x14add3];return _0x4a174f;};'use strict';var _=require('lodash');var util=require(_0xa064('0x0'));var moment=require('moment');var BPromise=require('bluebird');var rs=require(_0xa064('0x1'));var fs=require('fs');var Redis=require(_0xa064('0x2'));var db=require(_0xa064('0x3'))['db'];var utils=require('../../config/utils');var logger=require(_0xa064('0x4'))('rpc');var config=require(_0xa064('0x5'));var jayson=require('jayson/promise');var client=jayson['client'][_0xa064('0x6')]({'port':0x232a});config[_0xa064('0x7')]=_['defaults'](config['redis'],{'host':_0xa064('0x8'),'port':0x18eb});var socket=require(_0xa064('0x9'))(new Redis(config[_0xa064('0x7')]));require(_0xa064('0xa'))[_0xa064('0xb')](socket);function respondWithRpcPromise(_0x26eae9,_0x4a4f4b,_0x189b02){return new BPromise(function(_0x1d270c,_0x35907b){return client[_0xa064('0xc')](_0x26eae9,_0x189b02)[_0xa064('0xd')](function(_0x3e8494){logger[_0xa064('0xe')](_0xa064('0xf'),_0x4a4f4b,_0xa064('0x10'));logger[_0xa064('0x11')](_0xa064('0x12'),_0x4a4f4b,_0xa064('0x10'),JSON['stringify'](_0x3e8494));if(_0x3e8494[_0xa064('0x13')]){if(_0x3e8494['error'][_0xa064('0x14')]===0x1f4){logger[_0xa064('0x13')](_0xa064('0xf'),_0x4a4f4b,_0x3e8494[_0xa064('0x13')][_0xa064('0x15')]);return _0x35907b(_0x3e8494[_0xa064('0x13')]['message']);}logger[_0xa064('0x13')](_0xa064('0xf'),_0x4a4f4b,_0x3e8494[_0xa064('0x13')][_0xa064('0x15')]);return _0x1d270c(_0x3e8494[_0xa064('0x13')][_0xa064('0x15')]);}else{logger['info'](_0xa064('0xf'),_0x4a4f4b,_0xa064('0x10'));_0x1d270c(_0x3e8494[_0xa064('0x16')][_0xa064('0x15')]);}})[_0xa064('0x17')](function(_0x1cfcef){logger[_0xa064('0x13')](_0xa064('0xf'),_0x4a4f4b,_0x1cfcef);_0x35907b(_0x1cfcef);});});}exports[_0xa064('0x18')]=function(_0x1a9e53){var _0x2cca34=this;return new Promise(function(_0x148e66,_0x115bba){return db['VoiceQueue'][_0xa064('0x19')]({'raw':_0x1a9e53[_0xa064('0x1a')]?_0x1a9e53[_0xa064('0x1a')]['raw']===undefined?!![]:![]:!![],'where':_0x1a9e53[_0xa064('0x1a')]?_0x1a9e53[_0xa064('0x1a')][_0xa064('0x1b')]||null:null,'attributes':_0x1a9e53[_0xa064('0x1a')]?_0x1a9e53[_0xa064('0x1a')][_0xa064('0x1c')]||null:null,'limit':_0x1a9e53[_0xa064('0x1a')]?_0x1a9e53[_0xa064('0x1a')][_0xa064('0x1d')]||null:null,'include':_0x1a9e53['options']?_0x1a9e53['options'][_0xa064('0x1e')]?_[_0xa064('0x1f')](_0x1a9e53[_0xa064('0x1a')]['include'],function(_0x268b6e){return{'model':db[_0x268b6e[_0xa064('0x20')]],'as':_0x268b6e['as'],'attributes':_0x268b6e[_0xa064('0x1c')],'include':_0x268b6e[_0xa064('0x1e')]?_[_0xa064('0x1f')](_0x268b6e[_0xa064('0x1e')],function(_0x1154ec){return{'model':db[_0x1154ec[_0xa064('0x20')]],'as':_0x1154ec['as'],'attributes':_0x1154ec['attributes'],'include':_0x1154ec[_0xa064('0x1e')]?_[_0xa064('0x1f')](_0x1154ec[_0xa064('0x1e')],function(_0x35765d){return{'model':db[_0x35765d['model']],'as':_0x35765d['as'],'attributes':_0x35765d[_0xa064('0x1c')]};}):[]};}):[]};}):[]:[]})[_0xa064('0xd')](function(_0x1cbd4e){logger['info'](_0xa064('0x18'),_0x1a9e53);logger[_0xa064('0x11')](_0xa064('0x18'),_0x1a9e53,JSON[_0xa064('0x21')](_0x1cbd4e));_0x148e66(_0x1cbd4e);})['catch'](function(_0x165098){logger[_0xa064('0x13')](_0xa064('0x18'),_0x165098['message'],_0x1a9e53);_0x115bba(_0x2cca34['error'](0x1f4,_0x165098['message']));});});};exports[_0xa064('0x22')]=function(_0x1f623a){var _0x9c051=this;return new Promise(function(_0x2bf3ad,_0x328b8a){return db[_0xa064('0x23')][_0xa064('0x24')]({'raw':_0x1f623a[_0xa064('0x1a')]?_0x1f623a[_0xa064('0x1a')]['raw']===undefined?!![]:![]:!![],'where':_0x1f623a[_0xa064('0x1a')]?_0x1f623a[_0xa064('0x1a')][_0xa064('0x1b')]||null:null,'attributes':_0x1f623a[_0xa064('0x1a')]?_0x1f623a[_0xa064('0x1a')][_0xa064('0x1c')]||null:null,'include':_0x1f623a[_0xa064('0x1a')]?_0x1f623a[_0xa064('0x1a')]['include']?_[_0xa064('0x1f')](_0x1f623a['options']['include'],function(_0x15d4c8){return{'model':db[_0x15d4c8[_0xa064('0x20')]],'as':_0x15d4c8['as'],'attributes':_0x15d4c8[_0xa064('0x1c')],'include':_0x15d4c8[_0xa064('0x1e')]?_[_0xa064('0x1f')](_0x15d4c8[_0xa064('0x1e')],function(_0x412e63){return{'model':db[_0x412e63[_0xa064('0x20')]],'as':_0x412e63['as'],'attributes':_0x412e63[_0xa064('0x1c')],'include':_0x412e63[_0xa064('0x1e')]?_[_0xa064('0x1f')](_0x412e63[_0xa064('0x1e')],function(_0x49f521){return{'model':db[_0x49f521[_0xa064('0x20')]],'as':_0x49f521['as'],'attributes':_0x49f521[_0xa064('0x1c')]};}):[]};}):[]};}):[]:[]})[_0xa064('0xd')](function(_0x50fc58){logger[_0xa064('0xe')](_0xa064('0x22'),_0x1f623a);logger[_0xa064('0x11')](_0xa064('0x22'),_0x1f623a,JSON[_0xa064('0x21')](_0x50fc58));_0x2bf3ad(_0x50fc58);})[_0xa064('0x17')](function(_0x20f363){logger[_0xa064('0x13')](_0xa064('0x22'),_0x20f363[_0xa064('0x15')],_0x1f623a);_0x328b8a(_0x9c051['error'](0x1f4,_0x20f363[_0xa064('0x15')]));});});};
\ No newline at end of file
diff --git a/server/api/voiceQueue/voiceQueue.socket.js b/server/api/voiceQueue/voiceQueue.socket.js
index 2dd5eb5..d5f0a21 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 _0x4bb0=['removeListener','length','voiceQueue:','./voiceQueue.events','save','remove','update','emit'];(function(_0x1c1166,_0x4ab029){var _0x3a5a67=function(_0xd33136){while(--_0xd33136){_0x1c1166['push'](_0x1c1166['shift']());}};_0x3a5a67(++_0x4ab029);}(_0x4bb0,0x73));var _0x04bb=function(_0x53abe5,_0x33a9e5){_0x53abe5=_0x53abe5-0x0;var _0xc1c37e=_0x4bb0[_0x53abe5];return _0xc1c37e;};'use strict';var VoiceQueueEvents=require(_0x04bb('0x0'));var events=[_0x04bb('0x1'),_0x04bb('0x2'),_0x04bb('0x3')];function createListener(_0x1651ef,_0x92f6b0){return function(_0x1aaabf){_0x92f6b0[_0x04bb('0x4')](_0x1651ef,_0x1aaabf);};}function removeListener(_0x58a60,_0x196fc4){return function(){VoiceQueueEvents[_0x04bb('0x5')](_0x58a60,_0x196fc4);};}exports['register']=function(_0x2eae0e){for(var _0x579bb4=0x0,_0x453fde=events[_0x04bb('0x6')];_0x579bb4<_0x453fde;_0x579bb4++){var _0x152da4=events[_0x579bb4];var _0x1b6fbd=createListener(_0x04bb('0x7')+_0x152da4,_0x2eae0e);VoiceQueueEvents['on'](_0x152da4,_0x1b6fbd);}};
\ No newline at end of file
+var _0x9c13=['voiceQueue:','./voiceQueue.events','save','remove','update','emit','removeListener'];(function(_0x3dd15e,_0x1f0015){var _0x231fd0=function(_0x4f680a){while(--_0x4f680a){_0x3dd15e['push'](_0x3dd15e['shift']());}};_0x231fd0(++_0x1f0015);}(_0x9c13,0x127));var _0x39c1=function(_0x590b63,_0x14debb){_0x590b63=_0x590b63-0x0;var _0x3c9380=_0x9c13[_0x590b63];return _0x3c9380;};'use strict';var VoiceQueueEvents=require(_0x39c1('0x0'));var events=[_0x39c1('0x1'),_0x39c1('0x2'),_0x39c1('0x3')];function createListener(_0x3bac13,_0x4b6d42){return function(_0x48b7c2){_0x4b6d42[_0x39c1('0x4')](_0x3bac13,_0x48b7c2);};}function removeListener(_0x28e250,_0x1ecf8e){return function(){VoiceQueueEvents[_0x39c1('0x5')](_0x28e250,_0x1ecf8e);};}exports['register']=function(_0x26ec94){for(var _0x1e98e4=0x0,_0x4bd4ef=events['length'];_0x1e98e4<_0x4bd4ef;_0x1e98e4++){var _0x16c4c5=events[_0x1e98e4];var _0x63e648=createListener(_0x39c1('0x6')+_0x16c4c5,_0x26ec94);VoiceQueueEvents['on'](_0x16c4c5,_0x63e648);}};
\ No newline at end of file
diff --git a/server/api/voiceQueueReport/index.js b/server/api/voiceQueueReport/index.js
index 349d8a8..ae454f0 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 _0x5d58=['../../components/auth/service','../../config/environment','./voiceQueueReport.controller','isAuthenticated','index','get','/describe','describe','/:id','create','put','update','delete','Router'];(function(_0x120657,_0xa9e710){var _0x229d60=function(_0x25ab4c){while(--_0x25ab4c){_0x120657['push'](_0x120657['shift']());}};_0x229d60(++_0xa9e710);}(_0x5d58,0x187));var _0x85d5=function(_0x45005e,_0x320dc4){_0x45005e=_0x45005e-0x0;var _0x10dcd8=_0x5d58[_0x45005e];return _0x10dcd8;};'use strict';var multer=require('multer');var util=require('util');var path=require('path');var timeout=require('connect-timeout');var express=require('express');var router=express[_0x85d5('0x0')]();var auth=require(_0x85d5('0x1'));var interaction=require('../../components/interaction/service');var config=require(_0x85d5('0x2'));var controller=require(_0x85d5('0x3'));router['get']('/',auth[_0x85d5('0x4')](),controller[_0x85d5('0x5')]);router[_0x85d5('0x6')](_0x85d5('0x7'),auth['isAuthenticated'](),controller[_0x85d5('0x8')]);router[_0x85d5('0x6')]('/index',auth[_0x85d5('0x4')](),controller['getVoiceQueuesReport']);router[_0x85d5('0x6')](_0x85d5('0x9'),auth[_0x85d5('0x4')](),controller['show']);router['post']('/',auth['isAuthenticated'](),controller[_0x85d5('0xa')]);router[_0x85d5('0xb')](_0x85d5('0x9'),auth[_0x85d5('0x4')](),controller[_0x85d5('0xc')]);router[_0x85d5('0xd')](_0x85d5('0x9'),auth['isAuthenticated'](),controller['destroy']);module['exports']=router;
\ No newline at end of file
+var _0xd046=['Router','../../config/environment','get','/describe','/index','isAuthenticated','create','put','/:id','delete','destroy','exports','util','path','connect-timeout'];(function(_0x36958,_0x28eaa6){var _0x401eec=function(_0x42e71e){while(--_0x42e71e){_0x36958['push'](_0x36958['shift']());}};_0x401eec(++_0x28eaa6);}(_0xd046,0x129));var _0x6d04=function(_0x1d7f41,_0x78db44){_0x1d7f41=_0x1d7f41-0x0;var _0x464066=_0xd046[_0x1d7f41];return _0x464066;};'use strict';var multer=require('multer');var util=require(_0x6d04('0x0'));var path=require(_0x6d04('0x1'));var timeout=require(_0x6d04('0x2'));var express=require('express');var router=express[_0x6d04('0x3')]();var auth=require('../../components/auth/service');var interaction=require('../../components/interaction/service');var config=require(_0x6d04('0x4'));var controller=require('./voiceQueueReport.controller');router[_0x6d04('0x5')]('/',auth['isAuthenticated'](),controller['index']);router[_0x6d04('0x5')](_0x6d04('0x6'),auth['isAuthenticated'](),controller['describe']);router[_0x6d04('0x5')](_0x6d04('0x7'),auth['isAuthenticated'](),controller['getVoiceQueuesReport']);router[_0x6d04('0x5')]('/:id',auth[_0x6d04('0x8')](),controller['show']);router['post']('/',auth['isAuthenticated'](),controller[_0x6d04('0x9')]);router[_0x6d04('0xa')](_0x6d04('0xb'),auth[_0x6d04('0x8')](),controller['update']);router[_0x6d04('0xc')](_0x6d04('0xb'),auth[_0x6d04('0x8')](),controller[_0x6d04('0xd')]);module[_0x6d04('0xe')]=router;
\ No newline at end of file
diff --git a/server/api/voiceQueueReport/voiceQueueReport.attributes.js b/server/api/voiceQueueReport/voiceQueueReport.attributes.js
index 3ee09d7..f4baaab 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 _0xc60d=['queuecallerjoinAt','format','YYYY-MM-DD\x20HH:mm:ss','diff','setDataValue','queuecallerleaveAt','holdtime','INTEGER','BOOLEAN','COMPLETEDBYCALLER,\x20COMPLETEDBYAGENT,\x20FORWARDTRANFER,\x20BLINDTRANSFER,\x20ATTENDEDTRANSFER,\x20EXITWITHKEY,\x20TIMEOUT','FORWARD,\x20BLIND,\x20ATTENDED','sequelize','moment','STRING','DATE','getDataValue'];(function(_0x14747f,_0xa5413a){var _0x2c5e1f=function(_0x4b9ae7){while(--_0x4b9ae7){_0x14747f['push'](_0x14747f['shift']());}};_0x2c5e1f(++_0xa5413a);}(_0xc60d,0x10b));var _0xdc60=function(_0x26394d,_0x547eea){_0x26394d=_0x26394d-0x0;var _0x5c7861=_0xc60d[_0x26394d];return _0x5c7861;};'use strict';var Sequelize=require(_0xdc60('0x0'));var moment=require(_0xdc60('0x1'));module['exports']={'type':{'type':Sequelize[_0xdc60('0x2')]},'uniqueid':{'type':Sequelize[_0xdc60('0x2')]},'calleridnum':{'type':Sequelize[_0xdc60('0x2')]},'calleridname':{'type':Sequelize['STRING']},'queue':{'type':Sequelize['STRING']},'queuecallerjoinAt':{'type':Sequelize[_0xdc60('0x3')]},'queuecallerleaveAt':{'type':Sequelize[_0xdc60('0x3')],'set':function(_0x254cd6){var _0x4a53bb=moment(_0x254cd6);var _0x5895c3=moment(this[_0xdc60('0x4')](_0xdc60('0x5')))[_0xdc60('0x6')](_0xdc60('0x7'));var _0x5bf312=_0x4a53bb[_0xdc60('0x8')](_0x5895c3,'seconds');this[_0xdc60('0x9')](_0xdc60('0xa'),_0x254cd6);this[_0xdc60('0x9')](_0xdc60('0xb'),_0x5bf312||null);}},'position':{'type':Sequelize[_0xdc60('0xc')]},'count':{'type':Sequelize[_0xdc60('0xc')]},'queuecallerabandon':{'type':Sequelize[_0xdc60('0xd')],'defaultValue':![]},'queuecallerabandonAt':{'type':Sequelize[_0xdc60('0x3')]},'queuecallercomplete':{'type':Sequelize[_0xdc60('0xd')],'defaultValue':![]},'queuecallercompleteAt':{'type':Sequelize[_0xdc60('0x3')]},'queuecallerexit':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'queuecallerexitAt':{'type':Sequelize[_0xdc60('0x3')]},'queuecallerexitreason':{'type':Sequelize[_0xdc60('0x2')],'comment':_0xdc60('0xe')},'originalposition':{'type':Sequelize['INTEGER']},'channel':{'type':Sequelize['STRING']},'connectedlinenum':{'type':Sequelize[_0xdc60('0x2')]},'connectedlinename':{'type':Sequelize[_0xdc60('0x2')]},'accountcode':{'type':Sequelize[_0xdc60('0x2')]},'context':{'type':Sequelize[_0xdc60('0x2')]},'exten':{'type':Sequelize['STRING']},'priority':{'type':Sequelize[_0xdc60('0x2')]},'holdtime':{'type':Sequelize[_0xdc60('0xc')]},'mohtime':{'type':Sequelize['INTEGER'],'defaultValue':0x0},'assigned':{'type':Sequelize[_0xdc60('0xd')],'defaultValue':![]},'lastAssignedTo':{'type':Sequelize[_0xdc60('0x2')]},'transfer':{'type':Sequelize[_0xdc60('0xd')],'defaultValue':![]},'transfertype':{'type':Sequelize[_0xdc60('0x2')],'comment':_0xdc60('0xf')},'transferexten':{'type':Sequelize[_0xdc60('0x2')]},'transferuniqueid':{'type':Sequelize[_0xdc60('0x2')]},'disposition':{'type':Sequelize[_0xdc60('0x2')]},'queuecallerenterreason':{'type':Sequelize['INTEGER'],'defaultValue':0x0}};
\ No newline at end of file
+var _0x10fa=['format','diff','seconds','queuecallerleaveAt','setDataValue','holdtime','INTEGER','BOOLEAN','COMPLETEDBYCALLER,\x20COMPLETEDBYAGENT,\x20FORWARDTRANFER,\x20BLINDTRANSFER,\x20ATTENDEDTRANSFER,\x20EXITWITHKEY,\x20TIMEOUT','sequelize','moment','exports','STRING','DATE','getDataValue'];(function(_0x5a16a6,_0x13eaa0){var _0x48e7b8=function(_0x4f0b7a){while(--_0x4f0b7a){_0x5a16a6['push'](_0x5a16a6['shift']());}};_0x48e7b8(++_0x13eaa0);}(_0x10fa,0x144));var _0xa10f=function(_0x594596,_0x2633f4){_0x594596=_0x594596-0x0;var _0x58a0e9=_0x10fa[_0x594596];return _0x58a0e9;};'use strict';var Sequelize=require(_0xa10f('0x0'));var moment=require(_0xa10f('0x1'));module[_0xa10f('0x2')]={'type':{'type':Sequelize[_0xa10f('0x3')]},'uniqueid':{'type':Sequelize['STRING']},'calleridnum':{'type':Sequelize[_0xa10f('0x3')]},'calleridname':{'type':Sequelize[_0xa10f('0x3')]},'queue':{'type':Sequelize[_0xa10f('0x3')]},'queuecallerjoinAt':{'type':Sequelize['DATE']},'queuecallerleaveAt':{'type':Sequelize[_0xa10f('0x4')],'set':function(_0x654b0a){var _0x2a3bbf=moment(_0x654b0a);var _0x127957=moment(this[_0xa10f('0x5')]('queuecallerjoinAt'))[_0xa10f('0x6')]('YYYY-MM-DD\x20HH:mm:ss');var _0x50c681=_0x2a3bbf[_0xa10f('0x7')](_0x127957,_0xa10f('0x8'));this['setDataValue'](_0xa10f('0x9'),_0x654b0a);this[_0xa10f('0xa')](_0xa10f('0xb'),_0x50c681||null);}},'position':{'type':Sequelize[_0xa10f('0xc')]},'count':{'type':Sequelize[_0xa10f('0xc')]},'queuecallerabandon':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'queuecallerabandonAt':{'type':Sequelize[_0xa10f('0x4')]},'queuecallercomplete':{'type':Sequelize[_0xa10f('0xd')],'defaultValue':![]},'queuecallercompleteAt':{'type':Sequelize[_0xa10f('0x4')]},'queuecallerexit':{'type':Sequelize[_0xa10f('0xd')],'defaultValue':![]},'queuecallerexitAt':{'type':Sequelize[_0xa10f('0x4')]},'queuecallerexitreason':{'type':Sequelize[_0xa10f('0x3')],'comment':_0xa10f('0xe')},'originalposition':{'type':Sequelize['INTEGER']},'channel':{'type':Sequelize['STRING']},'connectedlinenum':{'type':Sequelize[_0xa10f('0x3')]},'connectedlinename':{'type':Sequelize[_0xa10f('0x3')]},'accountcode':{'type':Sequelize['STRING']},'context':{'type':Sequelize[_0xa10f('0x3')]},'exten':{'type':Sequelize[_0xa10f('0x3')]},'priority':{'type':Sequelize[_0xa10f('0x3')]},'holdtime':{'type':Sequelize['INTEGER']},'mohtime':{'type':Sequelize[_0xa10f('0xc')],'defaultValue':0x0},'assigned':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'lastAssignedTo':{'type':Sequelize['STRING']},'transfer':{'type':Sequelize[_0xa10f('0xd')],'defaultValue':![]},'transfertype':{'type':Sequelize['STRING'],'comment':'FORWARD,\x20BLIND,\x20ATTENDED'},'transferexten':{'type':Sequelize[_0xa10f('0x3')]},'transferuniqueid':{'type':Sequelize[_0xa10f('0x3')]},'disposition':{'type':Sequelize[_0xa10f('0x3')]},'queuecallerenterreason':{'type':Sequelize['INTEGER'],'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 d2c0fb4..2d08f46 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 _0xc4aa=['fieldName','type','key','model','keys','filters','intersection','query','attributes','fields','length','hasOwnProperty','limit','sort','where','pick','filter','merge','options','VoiceQueueReport','includeAll','rows','catch','show','rawAttributes','include','find','body','params','describe','getVoiceQueuesReport','nolimit','order','findAll','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','./voiceQueueReport.socket','register','sendStatus','status','end','json','count','offset','set','Content-Range','apply','save','update','then','destroy','error','stack','name','send','index','map'];(function(_0x13db6c,_0xc0cc2e){var _0x2705d3=function(_0x2bae32){while(--_0x2bae32){_0x13db6c['push'](_0x13db6c['shift']());}};_0x2705d3(++_0xc0cc2e);}(_0xc4aa,0x1b7));var _0xac4a=function(_0x2235bf,_0x3a06a7){_0x2235bf=_0x2235bf-0x0;var _0x4c3a64=_0xc4aa[_0x2235bf];return _0x4c3a64;};'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);};}exports[_0xac4a('0x2d')]=function(_0x2772fe,_0x116700){var _0x4a5a9e={},_0x47f49c={},_0xdb7e={'count':0x0,'rows':[]};var _0x7a948b=_[_0xac4a('0x2e')](db['VoiceQueueReport']['rawAttributes'],function(_0x355755){return{'name':_0x355755[_0xac4a('0x2f')],'type':_0x355755[_0xac4a('0x30')][_0xac4a('0x31')]};});_0x47f49c[_0xac4a('0x32')]=_['map'](_0x7a948b,_0xac4a('0x2b'));_0x47f49c['query']=_[_0xac4a('0x33')](_0x2772fe['query']);_0x47f49c[_0xac4a('0x34')]=_[_0xac4a('0x35')](_0x47f49c[_0xac4a('0x32')],_0x47f49c[_0xac4a('0x36')]);_0x4a5a9e[_0xac4a('0x37')]=_[_0xac4a('0x35')](_0x47f49c[_0xac4a('0x32')],qs[_0xac4a('0x38')](_0x2772fe[_0xac4a('0x36')][_0xac4a('0x38')]));_0x4a5a9e[_0xac4a('0x37')]=_0x4a5a9e[_0xac4a('0x37')][_0xac4a('0x39')]?_0x4a5a9e[_0xac4a('0x37')]:_0x47f49c['model'];if(!_0x2772fe[_0xac4a('0x36')][_0xac4a('0x3a')]('nolimit')){_0x4a5a9e[_0xac4a('0x3b')]=qs[_0xac4a('0x3b')](_0x2772fe['query']['limit']);_0x4a5a9e[_0xac4a('0x21')]=qs[_0xac4a('0x21')](_0x2772fe[_0xac4a('0x36')][_0xac4a('0x21')]);}_0x4a5a9e['order']=qs[_0xac4a('0x3c')](_0x2772fe[_0xac4a('0x36')]['sort']);_0x4a5a9e[_0xac4a('0x3d')]=qs[_0xac4a('0x34')](_[_0xac4a('0x3e')](_0x2772fe['query'],_0x47f49c[_0xac4a('0x34')]));if(_0x2772fe[_0xac4a('0x36')][_0xac4a('0x3f')]){_0x4a5a9e['where']=_[_0xac4a('0x40')](_0x4a5a9e[_0xac4a('0x3d')],{'$or':_['map'](_0x7a948b,function(_0x59bebf){if(_0x59bebf[_0xac4a('0x30')]!=='VIRTUAL'){var _0x50e03e={};_0x50e03e[_0x59bebf['name']]={'$like':'%'+_0x2772fe['query'][_0xac4a('0x3f')]+'%'};return _0x50e03e;}})});}_0x4a5a9e=_[_0xac4a('0x40')]({},_0x4a5a9e,_0x2772fe[_0xac4a('0x41')]);var _0x472484={'where':_0x4a5a9e[_0xac4a('0x3d')]};return db[_0xac4a('0x42')][_0xac4a('0x20')](_0x472484)[_0xac4a('0x27')](function(_0x28292c){_0xdb7e[_0xac4a('0x20')]=_0x28292c;if(_0x2772fe[_0xac4a('0x36')][_0xac4a('0x43')]){_0x4a5a9e['include']=[{'all':!![]}];}return db['VoiceQueueReport']['findAll'](_0x4a5a9e);})[_0xac4a('0x27')](function(_0x5c46a){_0xdb7e[_0xac4a('0x44')]=_0x5c46a;return _0xdb7e;})[_0xac4a('0x27')](respondWithFilteredResult(_0x116700,_0x4a5a9e))[_0xac4a('0x45')](handleError(_0x116700,null));};exports[_0xac4a('0x46')]=function(_0x8febf0,_0x3441f2){var _0x3e9973={'raw':![],'where':{'id':_0x8febf0['params']['id']}},_0x3edb19={};_0x3edb19[_0xac4a('0x32')]=_[_0xac4a('0x33')](db[_0xac4a('0x42')][_0xac4a('0x47')]);_0x3edb19[_0xac4a('0x36')]=_['keys'](_0x8febf0[_0xac4a('0x36')]);_0x3edb19[_0xac4a('0x34')]=_['intersection'](_0x3edb19[_0xac4a('0x32')],_0x3edb19['query']);_0x3e9973[_0xac4a('0x37')]=_[_0xac4a('0x35')](_0x3edb19[_0xac4a('0x32')],qs[_0xac4a('0x38')](_0x8febf0[_0xac4a('0x36')][_0xac4a('0x38')]));_0x3e9973[_0xac4a('0x37')]=_0x3e9973[_0xac4a('0x37')][_0xac4a('0x39')]?_0x3e9973[_0xac4a('0x37')]:_0x3edb19[_0xac4a('0x32')];if(_0x8febf0[_0xac4a('0x36')]['includeAll']){_0x3e9973[_0xac4a('0x48')]=[{'all':!![]}];}_0x3e9973=_[_0xac4a('0x40')]({},_0x3e9973,_0x8febf0[_0xac4a('0x41')]);return db['VoiceQueueReport'][_0xac4a('0x49')](_0x3e9973)[_0xac4a('0x27')](handleEntityNotFound(_0x3441f2,null))['then'](respondWithResult(_0x3441f2,null))[_0xac4a('0x45')](handleError(_0x3441f2,null));};exports['create']=function(_0x244950,_0xe620f6){return db[_0xac4a('0x42')]['create'](_0x244950['body'],{})[_0xac4a('0x27')](respondWithResult(_0xe620f6,0xc9))['catch'](handleError(_0xe620f6,null));};exports[_0xac4a('0x26')]=function(_0x566258,_0x3d2aaf){if(_0x566258['body']['id']){delete _0x566258[_0xac4a('0x4a')]['id'];}return db[_0xac4a('0x42')][_0xac4a('0x49')]({'where':{'id':_0x566258[_0xac4a('0x4b')]['id']}})['then'](handleEntityNotFound(_0x3d2aaf,null))[_0xac4a('0x27')](saveUpdates(_0x566258[_0xac4a('0x4a')],null))[_0xac4a('0x27')](respondWithResult(_0x3d2aaf,null))[_0xac4a('0x45')](handleError(_0x3d2aaf,null));};exports[_0xac4a('0x28')]=function(_0x138876,_0x187306){return db['VoiceQueueReport'][_0xac4a('0x49')]({'where':{'id':_0x138876[_0xac4a('0x4b')]['id']}})['then'](handleEntityNotFound(_0x187306,null))[_0xac4a('0x27')](removeEntity(_0x187306,null))[_0xac4a('0x45')](handleError(_0x187306,null));};exports[_0xac4a('0x4c')]=function(_0x3ac36e,_0x4bb2fb){return db[_0xac4a('0x42')][_0xac4a('0x4c')]()[_0xac4a('0x27')](respondWithResult(_0x4bb2fb,null))[_0xac4a('0x45')](handleError(_0x4bb2fb,null));};exports[_0xac4a('0x4d')]=function(_0x49fbc3,_0x179373){var _0x564b10={},_0x307441={},_0x2c04af={'count':0x0,'rows':[]};_0x307441['model']=_['keys'](db[_0xac4a('0x42')][_0xac4a('0x47')]);_0x307441['query']=_[_0xac4a('0x33')](_0x49fbc3[_0xac4a('0x36')]);_0x307441[_0xac4a('0x34')]=_[_0xac4a('0x35')](_0x307441['model'],_0x307441[_0xac4a('0x36')]);_0x564b10[_0xac4a('0x37')]=_[_0xac4a('0x35')](_0x307441[_0xac4a('0x32')],qs[_0xac4a('0x38')](_0x49fbc3[_0xac4a('0x36')][_0xac4a('0x38')]));_0x564b10['attributes']=_0x564b10[_0xac4a('0x37')][_0xac4a('0x39')]?_0x564b10[_0xac4a('0x37')]:_0x307441[_0xac4a('0x32')];if(!_0x49fbc3[_0xac4a('0x36')][_0xac4a('0x3a')](_0xac4a('0x4e'))){_0x564b10[_0xac4a('0x3b')]=qs[_0xac4a('0x3b')](_0x49fbc3[_0xac4a('0x36')][_0xac4a('0x3b')]);_0x564b10[_0xac4a('0x21')]=qs[_0xac4a('0x21')](_0x49fbc3[_0xac4a('0x36')][_0xac4a('0x21')]);}_0x564b10[_0xac4a('0x4f')]=qs['sort'](_0x49fbc3[_0xac4a('0x36')]['sort']);_0x564b10[_0xac4a('0x3d')]=qs['filters'](_[_0xac4a('0x3e')](_0x49fbc3['query'],_0x307441[_0xac4a('0x34')]));if(_0x49fbc3['query']['filter']){_0x564b10[_0xac4a('0x3d')]=_[_0xac4a('0x40')](_0x564b10[_0xac4a('0x3d')],{'$or':_[_0xac4a('0x2e')](_0x564b10[_0xac4a('0x37')],function(_0xb7b884){var _0x592a4b={};_0x592a4b[_0xb7b884]={'$like':'%'+_0x49fbc3[_0xac4a('0x36')]['filter']+'%'};return _0x592a4b;})});}_0x564b10=_[_0xac4a('0x40')]({},_0x564b10,_0x49fbc3['options']);var _0x347880={'where':_0x564b10[_0xac4a('0x3d')]};return db[_0xac4a('0x42')][_0xac4a('0x20')](_0x347880)[_0xac4a('0x27')](function(_0x2bc39a){_0x2c04af[_0xac4a('0x20')]=_0x2bc39a;if(_0x49fbc3[_0xac4a('0x36')][_0xac4a('0x43')]){_0x564b10[_0xac4a('0x48')]=[{'all':!![]}];}return db[_0xac4a('0x42')][_0xac4a('0x50')](_0x564b10);})[_0xac4a('0x27')](function(_0x2cc410){_0x2c04af[_0xac4a('0x44')]=_0x2cc410;return _0x2c04af;})[_0xac4a('0x27')](respondWithFilteredResult(_0x179373,_0x564b10,_0xac4a('0x4d')))['catch'](handleError(_0x179373,null,_0xac4a('0x4d')));};
\ No newline at end of file
+var _0x2ef3=['intersection','attributes','length','order','sort','where','filters','pick','filter','map','VIRTUAL','merge','options','includeAll','include','findAll','catch','show','fields','find','create','body','update','params','destroy','describe','getVoiceQueuesReport','hasOwnProperty','html-pdf','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','bluebird','mustache','path','sox','lodash','squel','crypto','jsforce','desk.js','to-csv','querystring','papaparse','ioredis','../../components/auth/service','../../config/license/hardware','../../config/logger','api','../../config/utils','../../mysqldb','defaults','localhost','socket.io-emitter','register','sendStatus','status','json','count','offset','limit','set','Content-Range','reject','then','error','stack','name','index','VoiceQueueReport','rawAttributes','fieldName','type','key','model','keys','query'];(function(_0x19865b,_0x279613){var _0x186b3a=function(_0xe8278a){while(--_0xe8278a){_0x19865b['push'](_0x19865b['shift']());}};_0x186b3a(++_0x279613);}(_0x2ef3,0xba));var _0x32ef=function(_0x46bacb,_0x5a1297){_0x46bacb=_0x46bacb-0x0;var _0x5d65da=_0x2ef3[_0x46bacb];return _0x5d65da;};'use strict';var pdf=require(_0x32ef('0x0'));var emlformat=require(_0x32ef('0x1'));var rimraf=require(_0x32ef('0x2'));var zipdir=require(_0x32ef('0x3'));var jsonpatch=require(_0x32ef('0x4'));var rp=require(_0x32ef('0x5'));var moment=require('moment');var BPromise=require(_0x32ef('0x6'));var Mustache=require(_0x32ef('0x7'));var util=require('util');var path=require(_0x32ef('0x8'));var sox=require(_0x32ef('0x9'));var csv=require('to-csv');var ejs=require('ejs');var fs=require('fs');var _=require(_0x32ef('0xa'));var squel=require(_0x32ef('0xb'));var crypto=require(_0x32ef('0xc'));var jsforce=require(_0x32ef('0xd'));var deskjs=require(_0x32ef('0xe'));var toCsv=require(_0x32ef('0xf'));var querystring=require(_0x32ef('0x10'));var Papa=require(_0x32ef('0x11'));var Redis=require(_0x32ef('0x12'));var authService=require(_0x32ef('0x13'));var qs=require('../../components/parsers/qs');var as=require('../../components/parsers/advancedSearch');var hardwareService=require(_0x32ef('0x14'));var logger=require(_0x32ef('0x15'))(_0x32ef('0x16'));var utils=require(_0x32ef('0x17'));var config=require('../../config/environment');var db=require(_0x32ef('0x18'))['db'];config['redis']=_[_0x32ef('0x19')](config['redis'],{'host':_0x32ef('0x1a'),'port':0x18eb});var socket=require(_0x32ef('0x1b'))(new Redis(config['redis']));require('./voiceQueueReport.socket')[_0x32ef('0x1c')](socket);function respondWithStatusCode(_0x4d8009,_0x326fce){_0x326fce=_0x326fce||0xcc;return function(_0x40a6e6){if(_0x40a6e6){return _0x4d8009[_0x32ef('0x1d')](_0x326fce);}return _0x4d8009[_0x32ef('0x1e')](_0x326fce)['end']();};}function respondWithResult(_0x55bf0b,_0x531e30){_0x531e30=_0x531e30||0xc8;return function(_0x13db1a){if(_0x13db1a){return _0x55bf0b[_0x32ef('0x1e')](_0x531e30)[_0x32ef('0x1f')](_0x13db1a);}};}function respondWithFilteredResult(_0x53a5ca,_0x5d559b){return function(_0x1eb468){if(_0x1eb468){var _0x1a9476=_0x1eb468[_0x32ef('0x20')],_0x286bfb=_0x5d559b['offset'],_0x57863c=_0x5d559b[_0x32ef('0x21')]+_0x5d559b[_0x32ef('0x22')],_0xbe37f6;if(_0x57863c>=_0x1a9476){_0x57863c=_0x1a9476;_0xbe37f6=0xc8;}else{_0xbe37f6=0xce;}_0x53a5ca[_0x32ef('0x1e')](_0xbe37f6);return _0x53a5ca[_0x32ef('0x23')](_0x32ef('0x24'),_0x286bfb+'-'+_0x57863c+'/'+_0x1a9476)[_0x32ef('0x1f')](_0x1eb468);}return null;};}function patchUpdates(_0x4de441){return function(_0x3c5b78){try{jsonpatch['apply'](_0x3c5b78,_0x4de441,!![]);}catch(_0x309866){return BPromise[_0x32ef('0x25')](_0x309866);}return _0x3c5b78['save']();};}function saveUpdates(_0x1af371,_0x97780){return function(_0x5e8898){if(_0x5e8898){return _0x5e8898['update'](_0x1af371)['then'](function(_0x22f2d7){return _0x22f2d7;});}return null;};}function removeEntity(_0xb30fab,_0x225feb){return function(_0x478bef){if(_0x478bef){return _0x478bef['destroy']()[_0x32ef('0x26')](function(){_0xb30fab['status'](0xcc)['end']();});}};}function handleEntityNotFound(_0x278495,_0x14d4b3){return function(_0x371540){if(!_0x371540){_0x278495[_0x32ef('0x1d')](0x194);}return _0x371540;};}function handleError(_0x15ce54,_0x234175){_0x234175=_0x234175||0x1f4;return function(_0x1874ea){logger[_0x32ef('0x27')](_0x1874ea[_0x32ef('0x28')]);if(_0x1874ea[_0x32ef('0x29')]){delete _0x1874ea[_0x32ef('0x29')];}_0x15ce54[_0x32ef('0x1e')](_0x234175)['send'](_0x1874ea);};}exports[_0x32ef('0x2a')]=function(_0x2f5d06,_0x5a04cd){var _0x12de1a={},_0x3c569d={},_0x30b250={'count':0x0,'rows':[]};var _0x26e207=_['map'](db[_0x32ef('0x2b')][_0x32ef('0x2c')],function(_0x31dbc3){return{'name':_0x31dbc3[_0x32ef('0x2d')],'type':_0x31dbc3[_0x32ef('0x2e')][_0x32ef('0x2f')]};});_0x3c569d[_0x32ef('0x30')]=_['map'](_0x26e207,_0x32ef('0x29'));_0x3c569d['query']=_[_0x32ef('0x31')](_0x2f5d06[_0x32ef('0x32')]);_0x3c569d['filters']=_[_0x32ef('0x33')](_0x3c569d[_0x32ef('0x30')],_0x3c569d[_0x32ef('0x32')]);_0x12de1a[_0x32ef('0x34')]=_[_0x32ef('0x33')](_0x3c569d['model'],qs['fields'](_0x2f5d06[_0x32ef('0x32')]['fields']));_0x12de1a[_0x32ef('0x34')]=_0x12de1a[_0x32ef('0x34')][_0x32ef('0x35')]?_0x12de1a[_0x32ef('0x34')]:_0x3c569d[_0x32ef('0x30')];if(!_0x2f5d06[_0x32ef('0x32')]['hasOwnProperty']('nolimit')){_0x12de1a['limit']=qs[_0x32ef('0x22')](_0x2f5d06[_0x32ef('0x32')][_0x32ef('0x22')]);_0x12de1a['offset']=qs['offset'](_0x2f5d06[_0x32ef('0x32')][_0x32ef('0x21')]);}_0x12de1a[_0x32ef('0x36')]=qs['sort'](_0x2f5d06['query'][_0x32ef('0x37')]);_0x12de1a[_0x32ef('0x38')]=qs[_0x32ef('0x39')](_[_0x32ef('0x3a')](_0x2f5d06[_0x32ef('0x32')],_0x3c569d[_0x32ef('0x39')]));if(_0x2f5d06[_0x32ef('0x32')][_0x32ef('0x3b')]){_0x12de1a[_0x32ef('0x38')]=_['merge'](_0x12de1a[_0x32ef('0x38')],{'$or':_[_0x32ef('0x3c')](_0x26e207,function(_0x14b54f){if(_0x14b54f['type']!==_0x32ef('0x3d')){var _0x17e489={};_0x17e489[_0x14b54f[_0x32ef('0x29')]]={'$like':'%'+_0x2f5d06[_0x32ef('0x32')][_0x32ef('0x3b')]+'%'};return _0x17e489;}})});}_0x12de1a=_[_0x32ef('0x3e')]({},_0x12de1a,_0x2f5d06[_0x32ef('0x3f')]);var _0x1cebed={'where':_0x12de1a[_0x32ef('0x38')]};return db[_0x32ef('0x2b')][_0x32ef('0x20')](_0x1cebed)[_0x32ef('0x26')](function(_0x48e071){_0x30b250[_0x32ef('0x20')]=_0x48e071;if(_0x2f5d06[_0x32ef('0x32')][_0x32ef('0x40')]){_0x12de1a[_0x32ef('0x41')]=[{'all':!![]}];}return db[_0x32ef('0x2b')][_0x32ef('0x42')](_0x12de1a);})[_0x32ef('0x26')](function(_0x596d5a){_0x30b250['rows']=_0x596d5a;return _0x30b250;})[_0x32ef('0x26')](respondWithFilteredResult(_0x5a04cd,_0x12de1a))[_0x32ef('0x43')](handleError(_0x5a04cd,null));};exports[_0x32ef('0x44')]=function(_0x765c63,_0x5dca14){var _0x2901a1={'raw':![],'where':{'id':_0x765c63['params']['id']}},_0x1f323a={};_0x1f323a[_0x32ef('0x30')]=_['keys'](db[_0x32ef('0x2b')][_0x32ef('0x2c')]);_0x1f323a[_0x32ef('0x32')]=_[_0x32ef('0x31')](_0x765c63[_0x32ef('0x32')]);_0x1f323a[_0x32ef('0x39')]=_[_0x32ef('0x33')](_0x1f323a[_0x32ef('0x30')],_0x1f323a[_0x32ef('0x32')]);_0x2901a1[_0x32ef('0x34')]=_['intersection'](_0x1f323a[_0x32ef('0x30')],qs['fields'](_0x765c63[_0x32ef('0x32')][_0x32ef('0x45')]));_0x2901a1[_0x32ef('0x34')]=_0x2901a1['attributes'][_0x32ef('0x35')]?_0x2901a1[_0x32ef('0x34')]:_0x1f323a[_0x32ef('0x30')];if(_0x765c63[_0x32ef('0x32')][_0x32ef('0x40')]){_0x2901a1[_0x32ef('0x41')]=[{'all':!![]}];}_0x2901a1=_[_0x32ef('0x3e')]({},_0x2901a1,_0x765c63['options']);return db['VoiceQueueReport'][_0x32ef('0x46')](_0x2901a1)[_0x32ef('0x26')](handleEntityNotFound(_0x5dca14,null))[_0x32ef('0x26')](respondWithResult(_0x5dca14,null))[_0x32ef('0x43')](handleError(_0x5dca14,null));};exports[_0x32ef('0x47')]=function(_0xd67dc9,_0x44ad11){return db[_0x32ef('0x2b')][_0x32ef('0x47')](_0xd67dc9[_0x32ef('0x48')],{})[_0x32ef('0x26')](respondWithResult(_0x44ad11,0xc9))[_0x32ef('0x43')](handleError(_0x44ad11,null));};exports[_0x32ef('0x49')]=function(_0x4c2534,_0x420f00){if(_0x4c2534[_0x32ef('0x48')]['id']){delete _0x4c2534[_0x32ef('0x48')]['id'];}return db[_0x32ef('0x2b')][_0x32ef('0x46')]({'where':{'id':_0x4c2534[_0x32ef('0x4a')]['id']}})[_0x32ef('0x26')](handleEntityNotFound(_0x420f00,null))[_0x32ef('0x26')](saveUpdates(_0x4c2534[_0x32ef('0x48')],null))[_0x32ef('0x26')](respondWithResult(_0x420f00,null))[_0x32ef('0x43')](handleError(_0x420f00,null));};exports[_0x32ef('0x4b')]=function(_0x272377,_0x326445){return db[_0x32ef('0x2b')][_0x32ef('0x46')]({'where':{'id':_0x272377[_0x32ef('0x4a')]['id']}})[_0x32ef('0x26')](handleEntityNotFound(_0x326445,null))['then'](removeEntity(_0x326445,null))['catch'](handleError(_0x326445,null));};exports[_0x32ef('0x4c')]=function(_0x259c32,_0xa9bf19){return db[_0x32ef('0x2b')][_0x32ef('0x4c')]()[_0x32ef('0x26')](respondWithResult(_0xa9bf19,null))[_0x32ef('0x43')](handleError(_0xa9bf19,null));};exports[_0x32ef('0x4d')]=function(_0x15b640,_0x368bf1){var _0x3697a7={},_0x4a6fd2={},_0x21216d={'count':0x0,'rows':[]};_0x4a6fd2[_0x32ef('0x30')]=_[_0x32ef('0x31')](db[_0x32ef('0x2b')][_0x32ef('0x2c')]);_0x4a6fd2[_0x32ef('0x32')]=_['keys'](_0x15b640[_0x32ef('0x32')]);_0x4a6fd2[_0x32ef('0x39')]=_[_0x32ef('0x33')](_0x4a6fd2['model'],_0x4a6fd2[_0x32ef('0x32')]);_0x3697a7['attributes']=_[_0x32ef('0x33')](_0x4a6fd2[_0x32ef('0x30')],qs['fields'](_0x15b640[_0x32ef('0x32')]['fields']));_0x3697a7[_0x32ef('0x34')]=_0x3697a7[_0x32ef('0x34')][_0x32ef('0x35')]?_0x3697a7[_0x32ef('0x34')]:_0x4a6fd2[_0x32ef('0x30')];if(!_0x15b640[_0x32ef('0x32')][_0x32ef('0x4e')]('nolimit')){_0x3697a7['limit']=qs[_0x32ef('0x22')](_0x15b640['query']['limit']);_0x3697a7[_0x32ef('0x21')]=qs[_0x32ef('0x21')](_0x15b640[_0x32ef('0x32')][_0x32ef('0x21')]);}_0x3697a7[_0x32ef('0x36')]=qs[_0x32ef('0x37')](_0x15b640[_0x32ef('0x32')][_0x32ef('0x37')]);_0x3697a7[_0x32ef('0x38')]=qs[_0x32ef('0x39')](_['pick'](_0x15b640['query'],_0x4a6fd2[_0x32ef('0x39')]));if(_0x15b640[_0x32ef('0x32')]['filter']){_0x3697a7[_0x32ef('0x38')]=_[_0x32ef('0x3e')](_0x3697a7[_0x32ef('0x38')],{'$or':_['map'](_0x3697a7[_0x32ef('0x34')],function(_0x3c31d0){var _0x20dcc5={};_0x20dcc5[_0x3c31d0]={'$like':'%'+_0x15b640['query']['filter']+'%'};return _0x20dcc5;})});}_0x3697a7=_[_0x32ef('0x3e')]({},_0x3697a7,_0x15b640['options']);var _0x17f447={'where':_0x3697a7['where']};return db['VoiceQueueReport'][_0x32ef('0x20')](_0x17f447)[_0x32ef('0x26')](function(_0x10cb37){_0x21216d['count']=_0x10cb37;if(_0x15b640[_0x32ef('0x32')][_0x32ef('0x40')]){_0x3697a7[_0x32ef('0x41')]=[{'all':!![]}];}return db['VoiceQueueReport'][_0x32ef('0x42')](_0x3697a7);})[_0x32ef('0x26')](function(_0x4c3bab){_0x21216d['rows']=_0x4c3bab;return _0x21216d;})[_0x32ef('0x26')](respondWithFilteredResult(_0x368bf1,_0x3697a7,_0x32ef('0x4d')))[_0x32ef('0x43')](handleError(_0x368bf1,null,_0x32ef('0x4d')));};
\ No newline at end of file
diff --git a/server/api/voiceQueueReport/voiceQueueReport.events.js b/server/api/voiceQueueReport/voiceQueueReport.events.js
index 95f8097..2513bd0 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 _0xafaa=['setMaxListeners','save','update','remove','emit','hasOwnProperty','hook','exports','events','../../mysqldb','VoiceQueueReport'];(function(_0x2fb8d3,_0x2ec153){var _0x278bec=function(_0x2bfd19){while(--_0x2bfd19){_0x2fb8d3['push'](_0x2fb8d3['shift']());}};_0x278bec(++_0x2ec153);}(_0xafaa,0x76));var _0xaafa=function(_0x68c4d9,_0x419b3c){_0x68c4d9=_0x68c4d9-0x0;var _0x62da93=_0xafaa[_0x68c4d9];return _0x62da93;};'use strict';var EventEmitter=require(_0xaafa('0x0'));var VoiceQueueReport=require(_0xaafa('0x1'))['db'][_0xaafa('0x2')];var VoiceQueueReportEvents=new EventEmitter();VoiceQueueReportEvents[_0xaafa('0x3')](0x0);var events={'afterCreate':_0xaafa('0x4'),'afterUpdate':_0xaafa('0x5'),'afterDestroy':_0xaafa('0x6')};function emitEvent(_0x29f558){return function(_0x1d493d,_0x275731,_0x5a9db3){VoiceQueueReportEvents[_0xaafa('0x7')](_0x29f558+':'+_0x1d493d['id'],_0x1d493d);VoiceQueueReportEvents['emit'](_0x29f558,_0x1d493d);_0x5a9db3(null);};}for(var e in events){if(events[_0xaafa('0x8')](e)){var event=events[e];VoiceQueueReport[_0xaafa('0x9')](e,emitEvent(event));}}module[_0xaafa('0xa')]=VoiceQueueReportEvents;
\ No newline at end of file
+var _0x3397=['hasOwnProperty','hook','../../mysqldb','VoiceQueueReport','setMaxListeners','update','remove','emit'];(function(_0x534a1f,_0x3e6c67){var _0x18c7fc=function(_0x4a9fd0){while(--_0x4a9fd0){_0x534a1f['push'](_0x534a1f['shift']());}};_0x18c7fc(++_0x3e6c67);}(_0x3397,0x6a));var _0x7339=function(_0x473ee7,_0x4dd754){_0x473ee7=_0x473ee7-0x0;var _0x30f0d4=_0x3397[_0x473ee7];return _0x30f0d4;};'use strict';var EventEmitter=require('events');var VoiceQueueReport=require(_0x7339('0x0'))['db'][_0x7339('0x1')];var VoiceQueueReportEvents=new EventEmitter();VoiceQueueReportEvents[_0x7339('0x2')](0x0);var events={'afterCreate':'save','afterUpdate':_0x7339('0x3'),'afterDestroy':_0x7339('0x4')};function emitEvent(_0x373c38){return function(_0x271d95,_0x170e10,_0x3e69f2){VoiceQueueReportEvents['emit'](_0x373c38+':'+_0x271d95['id'],_0x271d95);VoiceQueueReportEvents[_0x7339('0x5')](_0x373c38,_0x271d95);_0x3e69f2(null);};}for(var e in events){if(events[_0x7339('0x6')](e)){var event=events[e];VoiceQueueReport[_0x7339('0x7')](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 9892853..610bffc 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 _0x5f66=['request-promise','path','../../config/environment','exports','VoiceQueueReport','report_queue','uniqueid','calleridnum','util','api','moment','bluebird'];(function(_0x31c43b,_0x4e5590){var _0x53f062=function(_0x3e3e7d){while(--_0x3e3e7d){_0x31c43b['push'](_0x31c43b['shift']());}};_0x53f062(++_0x4e5590);}(_0x5f66,0x1a0));var _0x65f6=function(_0x36eaaa,_0x326732){_0x36eaaa=_0x36eaaa-0x0;var _0x461349=_0x5f66[_0x36eaaa];return _0x461349;};'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('./voiceQueueReport.attributes');module[_0x65f6('0x7')]=function(_0x22b017,_0x4ec221){return _0x22b017['define'](_0x65f6('0x8'),attributes,{'tableName':_0x65f6('0x9'),'paranoid':![],'indexes':[{'fields':[_0x65f6('0xa')]},{'fields':[_0x65f6('0xb')]}],'timestamps':!![]});};
\ No newline at end of file
+var _0xbaf0=['define','VoiceQueueReport','report_queue','calleridnum','util','../../config/logger','api','moment','bluebird','request-promise','rimraf','../../config/environment','./voiceQueueReport.attributes','exports'];(function(_0x37783e,_0x12c836){var _0xb12a76=function(_0x43f66c){while(--_0x43f66c){_0x37783e['push'](_0x37783e['shift']());}};_0xb12a76(++_0x12c836);}(_0xbaf0,0x12a));var _0x0baf=function(_0xa464c9,_0x7c86d8){_0xa464c9=_0xa464c9-0x0;var _0x3d73c4=_0xbaf0[_0xa464c9];return _0x3d73c4;};'use strict';var _=require('lodash');var util=require(_0x0baf('0x0'));var logger=require(_0x0baf('0x1'))(_0x0baf('0x2'));var moment=require(_0x0baf('0x3'));var BPromise=require(_0x0baf('0x4'));var rp=require(_0x0baf('0x5'));var fs=require('fs');var path=require('path');var rimraf=require(_0x0baf('0x6'));var config=require(_0x0baf('0x7'));var attributes=require(_0x0baf('0x8'));module[_0x0baf('0x9')]=function(_0xe4c3c4,_0x335e24){return _0xe4c3c4[_0x0baf('0xa')](_0x0baf('0xb'),attributes,{'tableName':_0x0baf('0xc'),'paranoid':![],'indexes':[{'fields':['uniqueid']},{'fields':[_0x0baf('0xd')]}],'timestamps':!![]});};
\ No newline at end of file
diff --git a/server/api/voiceQueueReport/voiceQueueReport.rpc.js b/server/api/voiceQueueReport/voiceQueueReport.rpc.js
index 208d9ec..325875f 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 _0xb373=['VoiceQueueReport,\x20%s,\x20%s,\x20%s','stringify','error','VoiceQueueReport,\x20%s,\x20%s','message','result','VoiceQueueReport','findAll','options','raw','where','attributes','limit','include','model','map','then','GetVoiceQueueReport','catch','CreateVoiceQueueReport','create','UpdateVoiceQueueReport','body','lodash','moment','bluebird','randomstring','ioredis','rpc','../../config/environment','jayson/promise','client','http','redis','localhost','socket.io-emitter','./voiceQueueReport.socket','register','info','request\x20sent'];(function(_0x42598d,_0xfcca35){var _0x31da07=function(_0x5c5ca9){while(--_0x5c5ca9){_0x42598d['push'](_0x42598d['shift']());}};_0x31da07(++_0xfcca35);}(_0xb373,0x17f));var _0x3b37=function(_0x4fa59d,_0x44cdfe){_0x4fa59d=_0x4fa59d-0x0;var _0x2b2e2e=_0xb373[_0x4fa59d];return _0x2b2e2e;};'use strict';var _=require(_0x3b37('0x0'));var util=require('util');var moment=require(_0x3b37('0x1'));var BPromise=require(_0x3b37('0x2'));var rs=require(_0x3b37('0x3'));var fs=require('fs');var Redis=require(_0x3b37('0x4'));var db=require('../../mysqldb')['db'];var utils=require('../../config/utils');var logger=require('../../config/logger')(_0x3b37('0x5'));var config=require(_0x3b37('0x6'));var jayson=require(_0x3b37('0x7'));var client=jayson[_0x3b37('0x8')][_0x3b37('0x9')]({'port':0x232a});config[_0x3b37('0xa')]=_['defaults'](config[_0x3b37('0xa')],{'host':_0x3b37('0xb'),'port':0x18eb});var socket=require(_0x3b37('0xc'))(new Redis(config['redis']));require(_0x3b37('0xd'))[_0x3b37('0xe')](socket);function respondWithRpcPromise(_0x395c61,_0x18a893,_0x5b6ec5){return new BPromise(function(_0x4e040b,_0x4fd603){return client['request'](_0x395c61,_0x5b6ec5)['then'](function(_0x186cbd){logger[_0x3b37('0xf')]('VoiceQueueReport,\x20%s,\x20%s',_0x18a893,_0x3b37('0x10'));logger['debug'](_0x3b37('0x11'),_0x18a893,_0x3b37('0x10'),JSON[_0x3b37('0x12')](_0x186cbd));if(_0x186cbd[_0x3b37('0x13')]){if(_0x186cbd[_0x3b37('0x13')]['code']===0x1f4){logger[_0x3b37('0x13')](_0x3b37('0x14'),_0x18a893,_0x186cbd['error']['message']);return _0x4fd603(_0x186cbd[_0x3b37('0x13')][_0x3b37('0x15')]);}logger[_0x3b37('0x13')](_0x3b37('0x14'),_0x18a893,_0x186cbd[_0x3b37('0x13')][_0x3b37('0x15')]);return _0x4e040b(_0x186cbd['error'][_0x3b37('0x15')]);}else{logger['info'](_0x3b37('0x14'),_0x18a893,'request\x20sent');_0x4e040b(_0x186cbd[_0x3b37('0x16')][_0x3b37('0x15')]);}})['catch'](function(_0x46fcc2){logger[_0x3b37('0x13')](_0x3b37('0x14'),_0x18a893,_0x46fcc2);_0x4fd603(_0x46fcc2);});});}exports['GetVoiceQueueReport']=function(_0x112549){var _0x2ac819=this;return new Promise(function(_0x5c8219,_0x10c7ad){return db[_0x3b37('0x17')][_0x3b37('0x18')]({'raw':_0x112549[_0x3b37('0x19')]?_0x112549[_0x3b37('0x19')][_0x3b37('0x1a')]===undefined?!![]:![]:!![],'where':_0x112549[_0x3b37('0x19')]?_0x112549[_0x3b37('0x19')][_0x3b37('0x1b')]||null:null,'attributes':_0x112549[_0x3b37('0x19')]?_0x112549[_0x3b37('0x19')][_0x3b37('0x1c')]||null:null,'limit':_0x112549[_0x3b37('0x19')]?_0x112549[_0x3b37('0x19')][_0x3b37('0x1d')]||null:null,'include':_0x112549[_0x3b37('0x19')]?_0x112549['options'][_0x3b37('0x1e')]?_['map'](_0x112549[_0x3b37('0x19')][_0x3b37('0x1e')],function(_0x2bc466){return{'model':db[_0x2bc466[_0x3b37('0x1f')]],'as':_0x2bc466['as'],'attributes':_0x2bc466['attributes'],'include':_0x2bc466[_0x3b37('0x1e')]?_['map'](_0x2bc466[_0x3b37('0x1e')],function(_0x3d7cb5){return{'model':db[_0x3d7cb5[_0x3b37('0x1f')]],'as':_0x3d7cb5['as'],'attributes':_0x3d7cb5[_0x3b37('0x1c')],'include':_0x3d7cb5['include']?_[_0x3b37('0x20')](_0x3d7cb5[_0x3b37('0x1e')],function(_0x1666fc){return{'model':db[_0x1666fc[_0x3b37('0x1f')]],'as':_0x1666fc['as'],'attributes':_0x1666fc['attributes']};}):[]};}):[]};}):[]:[]})[_0x3b37('0x21')](function(_0x3d443b){logger['info'](_0x3b37('0x22'),_0x112549);logger['debug'](_0x3b37('0x22'),_0x112549,JSON[_0x3b37('0x12')](_0x3d443b));_0x5c8219(_0x3d443b);})[_0x3b37('0x23')](function(_0xed81ea){logger['error'](_0x3b37('0x22'),_0xed81ea['message'],_0x112549);_0x10c7ad(_0x2ac819[_0x3b37('0x13')](0x1f4,_0xed81ea[_0x3b37('0x15')]));});});};exports[_0x3b37('0x24')]=function(_0x5cc1c3){var _0x2aa52a=this;return new Promise(function(_0x16ca12,_0x5e8074){return db['VoiceQueueReport'][_0x3b37('0x25')](_0x5cc1c3['body'],{'raw':_0x5cc1c3[_0x3b37('0x19')]?_0x5cc1c3[_0x3b37('0x19')][_0x3b37('0x1a')]===undefined?!![]:![]:!![]})[_0x3b37('0x21')](function(_0x32b988){logger[_0x3b37('0xf')](_0x3b37('0x24'),_0x5cc1c3);logger['debug'](_0x3b37('0x24'),_0x5cc1c3,JSON[_0x3b37('0x12')](_0x32b988));_0x16ca12(_0x32b988);})[_0x3b37('0x23')](function(_0x3d7caf){logger[_0x3b37('0x13')](_0x3b37('0x24'),_0x3d7caf['message'],_0x5cc1c3);_0x5e8074(_0x2aa52a[_0x3b37('0x13')](0x1f4,_0x3d7caf['message']));});});};exports[_0x3b37('0x26')]=function(_0x3f31d3){var _0x33057b=this;return new Promise(function(_0x564a76,_0x230ed3){return db[_0x3b37('0x17')]['update'](_0x3f31d3[_0x3b37('0x27')],{'raw':_0x3f31d3['options']?_0x3f31d3['options'][_0x3b37('0x1a')]===undefined?!![]:![]:!![],'individualHooks':!![],'where':_0x3f31d3['options']?_0x3f31d3[_0x3b37('0x19')]['where']||null:null,'attributes':_0x3f31d3[_0x3b37('0x19')]?_0x3f31d3[_0x3b37('0x19')][_0x3b37('0x1c')]||null:null,'limit':_0x3f31d3['options']?_0x3f31d3[_0x3b37('0x19')]['limit']||null:null})[_0x3b37('0x21')](function(_0xc89dfa){logger[_0x3b37('0xf')](_0x3b37('0x26'),_0x3f31d3);logger['debug']('UpdateVoiceQueueReport',_0x3f31d3,JSON[_0x3b37('0x12')](_0xc89dfa));_0x564a76(_0xc89dfa);})[_0x3b37('0x23')](function(_0x4496d6){logger[_0x3b37('0x13')]('UpdateVoiceQueueReport',_0x4496d6[_0x3b37('0x15')],_0x3f31d3);_0x230ed3(_0x33057b['error'](0x1f4,_0x4496d6[_0x3b37('0x15')]));});});};
\ No newline at end of file
+var _0x7a1b=['then','CreateVoiceQueueReport','create','body','UpdateVoiceQueueReport','update','lodash','util','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','jayson/promise','http','redis','localhost','request','info','VoiceQueueReport,\x20%s,\x20%s','request\x20sent','debug','VoiceQueueReport,\x20%s,\x20%s,\x20%s','stringify','error','code','message','result','catch','GetVoiceQueueReport','VoiceQueueReport','findAll','options','raw','where','attributes','limit','include','model','map'];(function(_0x4e2964,_0x1bf262){var _0x57d48f=function(_0x285c51){while(--_0x285c51){_0x4e2964['push'](_0x4e2964['shift']());}};_0x57d48f(++_0x1bf262);}(_0x7a1b,0x81));var _0xb7a1=function(_0x4aa391,_0x473a14){_0x4aa391=_0x4aa391-0x0;var _0x50dc8c=_0x7a1b[_0x4aa391];return _0x50dc8c;};'use strict';var _=require(_0xb7a1('0x0'));var util=require(_0xb7a1('0x1'));var moment=require(_0xb7a1('0x2'));var BPromise=require(_0xb7a1('0x3'));var rs=require(_0xb7a1('0x4'));var fs=require('fs');var Redis=require(_0xb7a1('0x5'));var db=require(_0xb7a1('0x6'))['db'];var utils=require(_0xb7a1('0x7'));var logger=require('../../config/logger')('rpc');var config=require('../../config/environment');var jayson=require(_0xb7a1('0x8'));var client=jayson['client'][_0xb7a1('0x9')]({'port':0x232a});config[_0xb7a1('0xa')]=_['defaults'](config['redis'],{'host':_0xb7a1('0xb'),'port':0x18eb});var socket=require('socket.io-emitter')(new Redis(config['redis']));require('./voiceQueueReport.socket')['register'](socket);function respondWithRpcPromise(_0x290e9b,_0x4b9a41,_0x35bfa1){return new BPromise(function(_0x23afd4,_0x4aad2f){return client[_0xb7a1('0xc')](_0x290e9b,_0x35bfa1)['then'](function(_0x5db9f2){logger[_0xb7a1('0xd')](_0xb7a1('0xe'),_0x4b9a41,_0xb7a1('0xf'));logger[_0xb7a1('0x10')](_0xb7a1('0x11'),_0x4b9a41,_0xb7a1('0xf'),JSON[_0xb7a1('0x12')](_0x5db9f2));if(_0x5db9f2[_0xb7a1('0x13')]){if(_0x5db9f2[_0xb7a1('0x13')][_0xb7a1('0x14')]===0x1f4){logger['error']('VoiceQueueReport,\x20%s,\x20%s',_0x4b9a41,_0x5db9f2['error'][_0xb7a1('0x15')]);return _0x4aad2f(_0x5db9f2['error'][_0xb7a1('0x15')]);}logger['error'](_0xb7a1('0xe'),_0x4b9a41,_0x5db9f2[_0xb7a1('0x13')][_0xb7a1('0x15')]);return _0x23afd4(_0x5db9f2['error']['message']);}else{logger['info'](_0xb7a1('0xe'),_0x4b9a41,'request\x20sent');_0x23afd4(_0x5db9f2[_0xb7a1('0x16')][_0xb7a1('0x15')]);}})[_0xb7a1('0x17')](function(_0x5ad3dd){logger[_0xb7a1('0x13')](_0xb7a1('0xe'),_0x4b9a41,_0x5ad3dd);_0x4aad2f(_0x5ad3dd);});});}exports[_0xb7a1('0x18')]=function(_0x53428e){var _0x5eba06=this;return new Promise(function(_0x82c955,_0x5a9324){return db[_0xb7a1('0x19')][_0xb7a1('0x1a')]({'raw':_0x53428e[_0xb7a1('0x1b')]?_0x53428e[_0xb7a1('0x1b')][_0xb7a1('0x1c')]===undefined?!![]:![]:!![],'where':_0x53428e[_0xb7a1('0x1b')]?_0x53428e['options'][_0xb7a1('0x1d')]||null:null,'attributes':_0x53428e[_0xb7a1('0x1b')]?_0x53428e[_0xb7a1('0x1b')][_0xb7a1('0x1e')]||null:null,'limit':_0x53428e[_0xb7a1('0x1b')]?_0x53428e[_0xb7a1('0x1b')][_0xb7a1('0x1f')]||null:null,'include':_0x53428e[_0xb7a1('0x1b')]?_0x53428e[_0xb7a1('0x1b')][_0xb7a1('0x20')]?_['map'](_0x53428e[_0xb7a1('0x1b')]['include'],function(_0x3f12ff){return{'model':db[_0x3f12ff[_0xb7a1('0x21')]],'as':_0x3f12ff['as'],'attributes':_0x3f12ff[_0xb7a1('0x1e')],'include':_0x3f12ff['include']?_['map'](_0x3f12ff[_0xb7a1('0x20')],function(_0x16f9fe){return{'model':db[_0x16f9fe[_0xb7a1('0x21')]],'as':_0x16f9fe['as'],'attributes':_0x16f9fe[_0xb7a1('0x1e')],'include':_0x16f9fe[_0xb7a1('0x20')]?_[_0xb7a1('0x22')](_0x16f9fe[_0xb7a1('0x20')],function(_0x2b38d2){return{'model':db[_0x2b38d2[_0xb7a1('0x21')]],'as':_0x2b38d2['as'],'attributes':_0x2b38d2[_0xb7a1('0x1e')]};}):[]};}):[]};}):[]:[]})[_0xb7a1('0x23')](function(_0x2d435c){logger['info'](_0xb7a1('0x18'),_0x53428e);logger[_0xb7a1('0x10')](_0xb7a1('0x18'),_0x53428e,JSON[_0xb7a1('0x12')](_0x2d435c));_0x82c955(_0x2d435c);})[_0xb7a1('0x17')](function(_0x545298){logger['error'](_0xb7a1('0x18'),_0x545298['message'],_0x53428e);_0x5a9324(_0x5eba06[_0xb7a1('0x13')](0x1f4,_0x545298[_0xb7a1('0x15')]));});});};exports[_0xb7a1('0x24')]=function(_0x4a268a){var _0x4ee1ef=this;return new Promise(function(_0x40c929,_0x4c08f3){return db[_0xb7a1('0x19')][_0xb7a1('0x25')](_0x4a268a[_0xb7a1('0x26')],{'raw':_0x4a268a[_0xb7a1('0x1b')]?_0x4a268a['options'][_0xb7a1('0x1c')]===undefined?!![]:![]:!![]})[_0xb7a1('0x23')](function(_0x43432a){logger['info'](_0xb7a1('0x24'),_0x4a268a);logger[_0xb7a1('0x10')](_0xb7a1('0x24'),_0x4a268a,JSON[_0xb7a1('0x12')](_0x43432a));_0x40c929(_0x43432a);})[_0xb7a1('0x17')](function(_0x45f0b2){logger['error'](_0xb7a1('0x24'),_0x45f0b2['message'],_0x4a268a);_0x4c08f3(_0x4ee1ef[_0xb7a1('0x13')](0x1f4,_0x45f0b2[_0xb7a1('0x15')]));});});};exports[_0xb7a1('0x27')]=function(_0x3256a0){var _0x2ac800=this;return new Promise(function(_0x2b07b6,_0xc636ce){return db['VoiceQueueReport'][_0xb7a1('0x28')](_0x3256a0[_0xb7a1('0x26')],{'raw':_0x3256a0[_0xb7a1('0x1b')]?_0x3256a0[_0xb7a1('0x1b')][_0xb7a1('0x1c')]===undefined?!![]:![]:!![],'individualHooks':!![],'where':_0x3256a0[_0xb7a1('0x1b')]?_0x3256a0[_0xb7a1('0x1b')][_0xb7a1('0x1d')]||null:null,'attributes':_0x3256a0[_0xb7a1('0x1b')]?_0x3256a0[_0xb7a1('0x1b')]['attributes']||null:null,'limit':_0x3256a0[_0xb7a1('0x1b')]?_0x3256a0[_0xb7a1('0x1b')]['limit']||null:null})[_0xb7a1('0x23')](function(_0x5f4dd7){logger[_0xb7a1('0xd')](_0xb7a1('0x27'),_0x3256a0);logger[_0xb7a1('0x10')](_0xb7a1('0x27'),_0x3256a0,JSON[_0xb7a1('0x12')](_0x5f4dd7));_0x2b07b6(_0x5f4dd7);})[_0xb7a1('0x17')](function(_0x5a8416){logger[_0xb7a1('0x13')](_0xb7a1('0x27'),_0x5a8416['message'],_0x3256a0);_0xc636ce(_0x2ac800[_0xb7a1('0x13')](0x1f4,_0x5a8416[_0xb7a1('0x15')]));});});};
\ No newline at end of file
diff --git a/server/api/voiceQueueReport/voiceQueueReport.socket.js b/server/api/voiceQueueReport/voiceQueueReport.socket.js
index 67e9446..09973e2 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 _0x1198=['removeListener','register','length','voiceQueueReport:','./voiceQueueReport.events','remove','update','emit'];(function(_0x552b08,_0x48d9b7){var _0x36629c=function(_0x380cca){while(--_0x380cca){_0x552b08['push'](_0x552b08['shift']());}};_0x36629c(++_0x48d9b7);}(_0x1198,0x1b4));var _0x8119=function(_0x39ff1c,_0x50cad2){_0x39ff1c=_0x39ff1c-0x0;var _0x3e8eb0=_0x1198[_0x39ff1c];return _0x3e8eb0;};'use strict';var VoiceQueueReportEvents=require(_0x8119('0x0'));var events=['save',_0x8119('0x1'),_0x8119('0x2')];function createListener(_0x5e75cb,_0x3dc0f5){return function(_0x2b1b5c){_0x3dc0f5[_0x8119('0x3')](_0x5e75cb,_0x2b1b5c);};}function removeListener(_0x337957,_0x49b8bf){return function(){VoiceQueueReportEvents[_0x8119('0x4')](_0x337957,_0x49b8bf);};}exports[_0x8119('0x5')]=function(_0x173542){for(var _0x34ba6f=0x0,_0x2ff29e=events[_0x8119('0x6')];_0x34ba6f<_0x2ff29e;_0x34ba6f++){var _0x3079a4=events[_0x34ba6f];var _0x3b8581=createListener(_0x8119('0x7')+_0x3079a4,_0x173542);VoiceQueueReportEvents['on'](_0x3079a4,_0x3b8581);}};
\ No newline at end of file
+var _0xccbd=['voiceQueueReport:','save','remove','emit','removeListener','length'];(function(_0xda4cb2,_0x21d68c){var _0x2a6cae=function(_0x1f2c1e){while(--_0x1f2c1e){_0xda4cb2['push'](_0xda4cb2['shift']());}};_0x2a6cae(++_0x21d68c);}(_0xccbd,0xe5));var _0xdccb=function(_0x8c43de,_0x90ff31){_0x8c43de=_0x8c43de-0x0;var _0xa6591b=_0xccbd[_0x8c43de];return _0xa6591b;};'use strict';var VoiceQueueReportEvents=require('./voiceQueueReport.events');var events=[_0xdccb('0x0'),_0xdccb('0x1'),'update'];function createListener(_0x2376f0,_0x5e7185){return function(_0x5ec833){_0x5e7185[_0xdccb('0x2')](_0x2376f0,_0x5ec833);};}function removeListener(_0x2fc6c8,_0x409cf3){return function(){VoiceQueueReportEvents[_0xdccb('0x3')](_0x2fc6c8,_0x409cf3);};}exports['register']=function(_0x8c6ae6){for(var _0x16bdef=0x0,_0x2bd497=events[_0xdccb('0x4')];_0x16bdef<_0x2bd497;_0x16bdef++){var _0xc9bc31=events[_0x16bdef];var _0x38d9c1=createListener(_0xdccb('0x5')+_0xc9bc31,_0x8c6ae6);VoiceQueueReportEvents['on'](_0xc9bc31,_0x38d9c1);}};
\ No newline at end of file
diff --git a/server/api/voiceQueuesLog/index.js b/server/api/voiceQueuesLog/index.js
index 17f874d..e0c45ce 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 _0xb813=['post','create','put','update','delete','destroy','multer','util','express','Router','../../components/auth/service','../../components/interaction/service','../../config/environment','./voiceQueuesLog.controller','get','isAuthenticated','index','/:id','show'];(function(_0x48a601,_0x52e934){var _0x3e2d09=function(_0x508466){while(--_0x508466){_0x48a601['push'](_0x48a601['shift']());}};_0x3e2d09(++_0x52e934);}(_0xb813,0x15c));var _0x3b81=function(_0x291dd6,_0x219c6a){_0x291dd6=_0x291dd6-0x0;var _0x247f03=_0xb813[_0x291dd6];return _0x247f03;};'use strict';var multer=require(_0x3b81('0x0'));var util=require(_0x3b81('0x1'));var path=require('path');var timeout=require('connect-timeout');var express=require(_0x3b81('0x2'));var router=express[_0x3b81('0x3')]();var auth=require(_0x3b81('0x4'));var interaction=require(_0x3b81('0x5'));var config=require(_0x3b81('0x6'));var controller=require(_0x3b81('0x7'));router[_0x3b81('0x8')]('/',auth[_0x3b81('0x9')](),controller[_0x3b81('0xa')]);router[_0x3b81('0x8')](_0x3b81('0xb'),auth['isAuthenticated'](),controller[_0x3b81('0xc')]);router[_0x3b81('0xd')]('/',auth[_0x3b81('0x9')](),controller[_0x3b81('0xe')]);router[_0x3b81('0xf')]('/:id',auth[_0x3b81('0x9')](),controller[_0x3b81('0x10')]);router[_0x3b81('0x11')]('/:id',auth[_0x3b81('0x9')](),controller[_0x3b81('0x12')]);module['exports']=router;
\ No newline at end of file
+var _0x5d50=['isAuthenticated','index','/:id','show','post','create','put','update','delete','destroy','exports','multer','connect-timeout','express','../../components/auth/service','../../components/interaction/service','./voiceQueuesLog.controller','get'];(function(_0x29df9a,_0x42aff3){var _0x3a8e96=function(_0x70fbe7){while(--_0x70fbe7){_0x29df9a['push'](_0x29df9a['shift']());}};_0x3a8e96(++_0x42aff3);}(_0x5d50,0xad));var _0x05d5=function(_0x3dd15e,_0x1f0015){_0x3dd15e=_0x3dd15e-0x0;var _0x231fd0=_0x5d50[_0x3dd15e];return _0x231fd0;};'use strict';var multer=require(_0x05d5('0x0'));var util=require('util');var path=require('path');var timeout=require(_0x05d5('0x1'));var express=require(_0x05d5('0x2'));var router=express['Router']();var auth=require(_0x05d5('0x3'));var interaction=require(_0x05d5('0x4'));var config=require('../../config/environment');var controller=require(_0x05d5('0x5'));router[_0x05d5('0x6')]('/',auth[_0x05d5('0x7')](),controller[_0x05d5('0x8')]);router[_0x05d5('0x6')](_0x05d5('0x9'),auth['isAuthenticated'](),controller[_0x05d5('0xa')]);router[_0x05d5('0xb')]('/',auth['isAuthenticated'](),controller[_0x05d5('0xc')]);router[_0x05d5('0xd')](_0x05d5('0x9'),auth[_0x05d5('0x7')](),controller[_0x05d5('0xe')]);router[_0x05d5('0xf')](_0x05d5('0x9'),auth[_0x05d5('0x7')](),controller[_0x05d5('0x10')]);module[_0x05d5('0x11')]=router;
\ No newline at end of file
diff --git a/server/api/voiceQueuesLog/voiceQueuesLog.attributes.js b/server/api/voiceQueuesLog/voiceQueuesLog.attributes.js
index d08d441..65f6d70 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 _0xf114=['moment','exports','STRING','DATE','format','YYYY-MM-DD\x20HH:mm:ss'];(function(_0x4d8f44,_0x58cb03){var _0x5cbd8f=function(_0xb04c60){while(--_0xb04c60){_0x4d8f44['push'](_0x4d8f44['shift']());}};_0x5cbd8f(++_0x58cb03);}(_0xf114,0xfc));var _0x4f11=function(_0x11db9c,_0x4b406c){_0x11db9c=_0x11db9c-0x0;var _0x2c6f54=_0xf114[_0x11db9c];return _0x2c6f54;};'use strict';var Sequelize=require('sequelize');var moment=require(_0x4f11('0x0'));module[_0x4f11('0x1')]={'time':{'type':Sequelize[_0x4f11('0x2')]},'callid':{'type':Sequelize[_0x4f11('0x2')],'allowNull':![],'defaultValue':''},'queuename':{'type':Sequelize[_0x4f11('0x2')],'allowNull':![],'defaultValue':''},'agent':{'type':Sequelize[_0x4f11('0x2')],'allowNull':![],'defaultValue':''},'event':{'type':Sequelize[_0x4f11('0x2')],'allowNull':![],'defaultValue':''},'data':{'type':Sequelize['STRING'],'allowNull':![],'defaultValue':''},'data1':{'type':Sequelize[_0x4f11('0x2')],'allowNull':![],'defaultValue':''},'data2':{'type':Sequelize[_0x4f11('0x2')],'allowNull':![],'defaultValue':''},'data3':{'type':Sequelize[_0x4f11('0x2')],'allowNull':![],'defaultValue':''},'data4':{'type':Sequelize['STRING'],'allowNull':![],'defaultValue':''},'data5':{'type':Sequelize[_0x4f11('0x2')],'allowNull':![],'defaultValue':''},'dtm':{'type':Sequelize[_0x4f11('0x3')],'allowNull':![],'defaultValue':moment()[_0x4f11('0x4')](_0x4f11('0x5'))}};
\ No newline at end of file
+var _0x742d=['sequelize','moment','exports','STRING','DATE','format'];(function(_0x4c9278,_0x324a88){var _0x7844a9=function(_0x24e5dc){while(--_0x24e5dc){_0x4c9278['push'](_0x4c9278['shift']());}};_0x7844a9(++_0x324a88);}(_0x742d,0x66));var _0xd742=function(_0x278d9f,_0x1122d9){_0x278d9f=_0x278d9f-0x0;var _0x5c8889=_0x742d[_0x278d9f];return _0x5c8889;};'use strict';var Sequelize=require(_0xd742('0x0'));var moment=require(_0xd742('0x1'));module[_0xd742('0x2')]={'time':{'type':Sequelize[_0xd742('0x3')]},'callid':{'type':Sequelize[_0xd742('0x3')],'allowNull':![],'defaultValue':''},'queuename':{'type':Sequelize[_0xd742('0x3')],'allowNull':![],'defaultValue':''},'agent':{'type':Sequelize['STRING'],'allowNull':![],'defaultValue':''},'event':{'type':Sequelize[_0xd742('0x3')],'allowNull':![],'defaultValue':''},'data':{'type':Sequelize[_0xd742('0x3')],'allowNull':![],'defaultValue':''},'data1':{'type':Sequelize['STRING'],'allowNull':![],'defaultValue':''},'data2':{'type':Sequelize['STRING'],'allowNull':![],'defaultValue':''},'data3':{'type':Sequelize[_0xd742('0x3')],'allowNull':![],'defaultValue':''},'data4':{'type':Sequelize[_0xd742('0x3')],'allowNull':![],'defaultValue':''},'data5':{'type':Sequelize[_0xd742('0x3')],'allowNull':![],'defaultValue':''},'dtm':{'type':Sequelize[_0xd742('0x4')],'allowNull':![],'defaultValue':moment()[_0xd742('0x5')]('YYYY-MM-DD\x20HH:mm:ss')}};
\ No newline at end of file
diff --git a/server/api/voiceQueuesLog/voiceQueuesLog.controller.js b/server/api/voiceQueuesLog/voiceQueuesLog.controller.js
index d2052ee..f0d815e 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 _0xb429=['findAll','rows','catch','include','merge','find','create','body','params','destroy','eml-format','rimraf','zip-dir','request-promise','bluebird','mustache','util','path','sox','to-csv','lodash','jsforce','desk.js','querystring','papaparse','../../components/auth/service','../../components/parsers/qs','../../config/logger','api','../../config/environment','../../mysqldb','sendStatus','status','end','json','count','offset','limit','Content-Range','apply','reject','save','update','then','error','name','map','rawAttributes','fieldName','type','model','query','keys','filters','attributes','intersection','fields','length','hasOwnProperty','order','sort','pick','filter','where','options','VoiceQueuesLog','includeAll'];(function(_0x4de26d,_0x52e33d){var _0x4278dd=function(_0x5a73d3){while(--_0x5a73d3){_0x4de26d['push'](_0x4de26d['shift']());}};_0x4278dd(++_0x52e33d);}(_0xb429,0x159));var _0x9b42=function(_0x4ea69d,_0x290f53){_0x4ea69d=_0x4ea69d-0x0;var _0x5318e0=_0xb429[_0x4ea69d];return _0x5318e0;};'use strict';var pdf=require('html-pdf');var emlformat=require(_0x9b42('0x0'));var rimraf=require(_0x9b42('0x1'));var zipdir=require(_0x9b42('0x2'));var jsonpatch=require('fast-json-patch');var rp=require(_0x9b42('0x3'));var moment=require('moment');var BPromise=require(_0x9b42('0x4'));var Mustache=require(_0x9b42('0x5'));var util=require(_0x9b42('0x6'));var path=require(_0x9b42('0x7'));var sox=require(_0x9b42('0x8'));var csv=require(_0x9b42('0x9'));var ejs=require('ejs');var fs=require('fs');var _=require(_0x9b42('0xa'));var squel=require('squel');var crypto=require('crypto');var jsforce=require(_0x9b42('0xb'));var deskjs=require(_0x9b42('0xc'));var toCsv=require(_0x9b42('0x9'));var querystring=require(_0x9b42('0xd'));var Papa=require(_0x9b42('0xe'));var Redis=require('ioredis');var authService=require(_0x9b42('0xf'));var qs=require(_0x9b42('0x10'));var as=require('../../components/parsers/advancedSearch');var hardwareService=require('../../config/license/hardware');var logger=require(_0x9b42('0x11'))(_0x9b42('0x12'));var utils=require('../../config/utils');var config=require(_0x9b42('0x13'));var db=require(_0x9b42('0x14'))['db'];function respondWithStatusCode(_0x57b2ca,_0x33dd44){_0x33dd44=_0x33dd44||0xcc;return function(_0x1ad1f0){if(_0x1ad1f0){return _0x57b2ca[_0x9b42('0x15')](_0x33dd44);}return _0x57b2ca[_0x9b42('0x16')](_0x33dd44)[_0x9b42('0x17')]();};}function respondWithResult(_0x400816,_0x2d3108){_0x2d3108=_0x2d3108||0xc8;return function(_0x1da991){if(_0x1da991){return _0x400816[_0x9b42('0x16')](_0x2d3108)[_0x9b42('0x18')](_0x1da991);}};}function respondWithFilteredResult(_0x24a16f,_0x2dc892){return function(_0x416799){if(_0x416799){var _0x31b4b1=_0x416799[_0x9b42('0x19')],_0x2bcd15=_0x2dc892['offset'],_0x359cdb=_0x2dc892[_0x9b42('0x1a')]+_0x2dc892[_0x9b42('0x1b')],_0x2fd12f;if(_0x359cdb>=_0x31b4b1){_0x359cdb=_0x31b4b1;_0x2fd12f=0xc8;}else{_0x2fd12f=0xce;}_0x24a16f['status'](_0x2fd12f);return _0x24a16f['set'](_0x9b42('0x1c'),_0x2bcd15+'-'+_0x359cdb+'/'+_0x31b4b1)[_0x9b42('0x18')](_0x416799);}return null;};}function patchUpdates(_0x10bf3d){return function(_0x5de8b3){try{jsonpatch[_0x9b42('0x1d')](_0x5de8b3,_0x10bf3d,!![]);}catch(_0x3d0a98){return BPromise[_0x9b42('0x1e')](_0x3d0a98);}return _0x5de8b3[_0x9b42('0x1f')]();};}function saveUpdates(_0x494c57,_0x590c98){return function(_0x2ad9b4){if(_0x2ad9b4){return _0x2ad9b4[_0x9b42('0x20')](_0x494c57)[_0x9b42('0x21')](function(_0x16767f){return _0x16767f;});}return null;};}function removeEntity(_0x1a4f28,_0x425cb2){return function(_0x4f4fc2){if(_0x4f4fc2){return _0x4f4fc2['destroy']()[_0x9b42('0x21')](function(){_0x1a4f28[_0x9b42('0x16')](0xcc)[_0x9b42('0x17')]();});}};}function handleEntityNotFound(_0x32d7e0,_0x1a25d1){return function(_0x123b7d){if(!_0x123b7d){_0x32d7e0[_0x9b42('0x15')](0x194);}return _0x123b7d;};}function handleError(_0x24b3a9,_0x5ebd16){_0x5ebd16=_0x5ebd16||0x1f4;return function(_0x309f6b){logger[_0x9b42('0x22')](_0x309f6b['stack']);if(_0x309f6b[_0x9b42('0x23')]){delete _0x309f6b[_0x9b42('0x23')];}_0x24b3a9['status'](_0x5ebd16)['send'](_0x309f6b);};}exports['index']=function(_0x5b10e5,_0x4d4909){var _0x250e6b={},_0x160dfc={},_0x12c4d8={'count':0x0,'rows':[]};var _0x54e966=_[_0x9b42('0x24')](db['VoiceQueuesLog'][_0x9b42('0x25')],function(_0x4fc0df){return{'name':_0x4fc0df[_0x9b42('0x26')],'type':_0x4fc0df[_0x9b42('0x27')]['key']};});_0x160dfc[_0x9b42('0x28')]=_[_0x9b42('0x24')](_0x54e966,_0x9b42('0x23'));_0x160dfc[_0x9b42('0x29')]=_[_0x9b42('0x2a')](_0x5b10e5[_0x9b42('0x29')]);_0x160dfc[_0x9b42('0x2b')]=_['intersection'](_0x160dfc[_0x9b42('0x28')],_0x160dfc[_0x9b42('0x29')]);_0x250e6b[_0x9b42('0x2c')]=_[_0x9b42('0x2d')](_0x160dfc[_0x9b42('0x28')],qs[_0x9b42('0x2e')](_0x5b10e5[_0x9b42('0x29')][_0x9b42('0x2e')]));_0x250e6b['attributes']=_0x250e6b[_0x9b42('0x2c')][_0x9b42('0x2f')]?_0x250e6b[_0x9b42('0x2c')]:_0x160dfc[_0x9b42('0x28')];if(!_0x5b10e5[_0x9b42('0x29')][_0x9b42('0x30')]('nolimit')){_0x250e6b[_0x9b42('0x1b')]=qs[_0x9b42('0x1b')](_0x5b10e5[_0x9b42('0x29')][_0x9b42('0x1b')]);_0x250e6b[_0x9b42('0x1a')]=qs[_0x9b42('0x1a')](_0x5b10e5[_0x9b42('0x29')]['offset']);}_0x250e6b[_0x9b42('0x31')]=qs[_0x9b42('0x32')](_0x5b10e5[_0x9b42('0x29')]['sort']);_0x250e6b['where']=qs[_0x9b42('0x2b')](_[_0x9b42('0x33')](_0x5b10e5[_0x9b42('0x29')],_0x160dfc['filters']));if(_0x5b10e5[_0x9b42('0x29')][_0x9b42('0x34')]){_0x250e6b[_0x9b42('0x35')]=_['merge'](_0x250e6b[_0x9b42('0x35')],{'$or':_[_0x9b42('0x24')](_0x54e966,function(_0x3a38a1){if(_0x3a38a1[_0x9b42('0x27')]!=='VIRTUAL'){var _0x4f6bf0={};_0x4f6bf0[_0x3a38a1[_0x9b42('0x23')]]={'$like':'%'+_0x5b10e5[_0x9b42('0x29')]['filter']+'%'};return _0x4f6bf0;}})});}_0x250e6b=_['merge']({},_0x250e6b,_0x5b10e5[_0x9b42('0x36')]);var _0x17b379={'where':_0x250e6b['where']};return db[_0x9b42('0x37')][_0x9b42('0x19')](_0x17b379)[_0x9b42('0x21')](function(_0x268332){_0x12c4d8['count']=_0x268332;if(_0x5b10e5[_0x9b42('0x29')][_0x9b42('0x38')]){_0x250e6b['include']=[{'all':!![]}];}return db[_0x9b42('0x37')][_0x9b42('0x39')](_0x250e6b);})[_0x9b42('0x21')](function(_0x11e8a2){_0x12c4d8[_0x9b42('0x3a')]=_0x11e8a2;return _0x12c4d8;})[_0x9b42('0x21')](respondWithFilteredResult(_0x4d4909,_0x250e6b))[_0x9b42('0x3b')](handleError(_0x4d4909,null));};exports['show']=function(_0x1366ca,_0x550f66){var _0x5880c7={'raw':!![],'where':{'id':_0x1366ca['params']['id']}},_0x1c237b={};_0x1c237b['model']=_[_0x9b42('0x2a')](db['VoiceQueuesLog'][_0x9b42('0x25')]);_0x1c237b[_0x9b42('0x29')]=_[_0x9b42('0x2a')](_0x1366ca[_0x9b42('0x29')]);_0x1c237b[_0x9b42('0x2b')]=_[_0x9b42('0x2d')](_0x1c237b[_0x9b42('0x28')],_0x1c237b[_0x9b42('0x29')]);_0x5880c7['attributes']=_['intersection'](_0x1c237b[_0x9b42('0x28')],qs[_0x9b42('0x2e')](_0x1366ca[_0x9b42('0x29')][_0x9b42('0x2e')]));_0x5880c7['attributes']=_0x5880c7['attributes'][_0x9b42('0x2f')]?_0x5880c7[_0x9b42('0x2c')]:_0x1c237b[_0x9b42('0x28')];if(_0x1366ca[_0x9b42('0x29')]['includeAll']){_0x5880c7[_0x9b42('0x3c')]=[{'all':!![]}];}_0x5880c7=_[_0x9b42('0x3d')]({},_0x5880c7,_0x1366ca[_0x9b42('0x36')]);return db['VoiceQueuesLog'][_0x9b42('0x3e')](_0x5880c7)[_0x9b42('0x21')](handleEntityNotFound(_0x550f66,null))[_0x9b42('0x21')](respondWithResult(_0x550f66,null))[_0x9b42('0x3b')](handleError(_0x550f66,null));};exports[_0x9b42('0x3f')]=function(_0x5a8308,_0x314f2a){return db[_0x9b42('0x37')][_0x9b42('0x3f')](_0x5a8308[_0x9b42('0x40')],{})[_0x9b42('0x21')](respondWithResult(_0x314f2a,0xc9))['catch'](handleError(_0x314f2a,null));};exports[_0x9b42('0x20')]=function(_0x20fe95,_0x49cc66){if(_0x20fe95[_0x9b42('0x40')]['id']){delete _0x20fe95[_0x9b42('0x40')]['id'];}return db[_0x9b42('0x37')][_0x9b42('0x3e')]({'where':{'id':_0x20fe95[_0x9b42('0x41')]['id']}})[_0x9b42('0x21')](handleEntityNotFound(_0x49cc66,null))[_0x9b42('0x21')](saveUpdates(_0x20fe95[_0x9b42('0x40')],null))['then'](respondWithResult(_0x49cc66,null))['catch'](handleError(_0x49cc66,null));};exports[_0x9b42('0x42')]=function(_0x29180d,_0x243f3c){return db[_0x9b42('0x37')][_0x9b42('0x3e')]({'where':{'id':_0x29180d[_0x9b42('0x41')]['id']}})[_0x9b42('0x21')](handleEntityNotFound(_0x243f3c,null))[_0x9b42('0x21')](removeEntity(_0x243f3c,null))[_0x9b42('0x3b')](handleError(_0x243f3c,null));};
\ No newline at end of file
+var _0x7e19=['desk.js','to-csv','querystring','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','sendStatus','status','end','json','count','offset','limit','set','Content-Range','apply','reject','save','update','then','destroy','stack','name','send','map','fieldName','type','key','model','query','keys','intersection','attributes','fields','length','hasOwnProperty','nolimit','sort','where','filters','pick','filter','merge','VIRTUAL','includeAll','catch','include','options','find','body','VoiceQueuesLog','params','html-pdf','rimraf','zip-dir','fast-json-patch','moment','bluebird','util','path','sox','ejs','lodash'];(function(_0x1c1ce0,_0x18d3ed){var _0x431b43=function(_0x3b409d){while(--_0x3b409d){_0x1c1ce0['push'](_0x1c1ce0['shift']());}};_0x431b43(++_0x18d3ed);}(_0x7e19,0xbb));var _0x97e1=function(_0xbc2fda,_0x1cf03d){_0xbc2fda=_0xbc2fda-0x0;var _0x3a8f3e=_0x7e19[_0xbc2fda];return _0x3a8f3e;};'use strict';var pdf=require(_0x97e1('0x0'));var emlformat=require('eml-format');var rimraf=require(_0x97e1('0x1'));var zipdir=require(_0x97e1('0x2'));var jsonpatch=require(_0x97e1('0x3'));var rp=require('request-promise');var moment=require(_0x97e1('0x4'));var BPromise=require(_0x97e1('0x5'));var Mustache=require('mustache');var util=require(_0x97e1('0x6'));var path=require(_0x97e1('0x7'));var sox=require(_0x97e1('0x8'));var csv=require('to-csv');var ejs=require(_0x97e1('0x9'));var fs=require('fs');var _=require(_0x97e1('0xa'));var squel=require('squel');var crypto=require('crypto');var jsforce=require('jsforce');var deskjs=require(_0x97e1('0xb'));var toCsv=require(_0x97e1('0xc'));var querystring=require(_0x97e1('0xd'));var Papa=require('papaparse');var Redis=require('ioredis');var authService=require(_0x97e1('0xe'));var qs=require(_0x97e1('0xf'));var as=require(_0x97e1('0x10'));var hardwareService=require(_0x97e1('0x11'));var logger=require(_0x97e1('0x12'))(_0x97e1('0x13'));var utils=require('../../config/utils');var config=require('../../config/environment');var db=require('../../mysqldb')['db'];function respondWithStatusCode(_0xfec0ad,_0xddaf32){_0xddaf32=_0xddaf32||0xcc;return function(_0x221b94){if(_0x221b94){return _0xfec0ad[_0x97e1('0x14')](_0xddaf32);}return _0xfec0ad[_0x97e1('0x15')](_0xddaf32)[_0x97e1('0x16')]();};}function respondWithResult(_0x3280bc,_0x2be9e7){_0x2be9e7=_0x2be9e7||0xc8;return function(_0x665e83){if(_0x665e83){return _0x3280bc[_0x97e1('0x15')](_0x2be9e7)[_0x97e1('0x17')](_0x665e83);}};}function respondWithFilteredResult(_0x36903a,_0x248644){return function(_0x221da4){if(_0x221da4){var _0x3cad8a=_0x221da4[_0x97e1('0x18')],_0x3b355b=_0x248644[_0x97e1('0x19')],_0x257ab2=_0x248644[_0x97e1('0x19')]+_0x248644[_0x97e1('0x1a')],_0x1cfa77;if(_0x257ab2>=_0x3cad8a){_0x257ab2=_0x3cad8a;_0x1cfa77=0xc8;}else{_0x1cfa77=0xce;}_0x36903a[_0x97e1('0x15')](_0x1cfa77);return _0x36903a[_0x97e1('0x1b')](_0x97e1('0x1c'),_0x3b355b+'-'+_0x257ab2+'/'+_0x3cad8a)['json'](_0x221da4);}return null;};}function patchUpdates(_0x58e9aa){return function(_0x5d698e){try{jsonpatch[_0x97e1('0x1d')](_0x5d698e,_0x58e9aa,!![]);}catch(_0x1f751b){return BPromise[_0x97e1('0x1e')](_0x1f751b);}return _0x5d698e[_0x97e1('0x1f')]();};}function saveUpdates(_0x4a8ade,_0x344d9d){return function(_0x119336){if(_0x119336){return _0x119336[_0x97e1('0x20')](_0x4a8ade)[_0x97e1('0x21')](function(_0x15153d){return _0x15153d;});}return null;};}function removeEntity(_0x6a91f4,_0x146df6){return function(_0x2dfe13){if(_0x2dfe13){return _0x2dfe13[_0x97e1('0x22')]()[_0x97e1('0x21')](function(){_0x6a91f4[_0x97e1('0x15')](0xcc)[_0x97e1('0x16')]();});}};}function handleEntityNotFound(_0x3abdd0,_0x1a9a7d){return function(_0x283df4){if(!_0x283df4){_0x3abdd0['sendStatus'](0x194);}return _0x283df4;};}function handleError(_0x442046,_0x74231b){_0x74231b=_0x74231b||0x1f4;return function(_0x1148be){logger['error'](_0x1148be[_0x97e1('0x23')]);if(_0x1148be[_0x97e1('0x24')]){delete _0x1148be[_0x97e1('0x24')];}_0x442046[_0x97e1('0x15')](_0x74231b)[_0x97e1('0x25')](_0x1148be);};}exports['index']=function(_0x1fc885,_0x4d2a7c){var _0x5d8aa4={},_0x52ba4c={},_0x377a4f={'count':0x0,'rows':[]};var _0xe01129=_[_0x97e1('0x26')](db['VoiceQueuesLog']['rawAttributes'],function(_0x2ef3b5){return{'name':_0x2ef3b5[_0x97e1('0x27')],'type':_0x2ef3b5[_0x97e1('0x28')][_0x97e1('0x29')]};});_0x52ba4c[_0x97e1('0x2a')]=_[_0x97e1('0x26')](_0xe01129,_0x97e1('0x24'));_0x52ba4c[_0x97e1('0x2b')]=_[_0x97e1('0x2c')](_0x1fc885[_0x97e1('0x2b')]);_0x52ba4c['filters']=_[_0x97e1('0x2d')](_0x52ba4c[_0x97e1('0x2a')],_0x52ba4c[_0x97e1('0x2b')]);_0x5d8aa4[_0x97e1('0x2e')]=_[_0x97e1('0x2d')](_0x52ba4c[_0x97e1('0x2a')],qs[_0x97e1('0x2f')](_0x1fc885['query']['fields']));_0x5d8aa4['attributes']=_0x5d8aa4[_0x97e1('0x2e')][_0x97e1('0x30')]?_0x5d8aa4['attributes']:_0x52ba4c[_0x97e1('0x2a')];if(!_0x1fc885[_0x97e1('0x2b')][_0x97e1('0x31')](_0x97e1('0x32'))){_0x5d8aa4['limit']=qs['limit'](_0x1fc885[_0x97e1('0x2b')][_0x97e1('0x1a')]);_0x5d8aa4['offset']=qs[_0x97e1('0x19')](_0x1fc885[_0x97e1('0x2b')][_0x97e1('0x19')]);}_0x5d8aa4['order']=qs['sort'](_0x1fc885[_0x97e1('0x2b')][_0x97e1('0x33')]);_0x5d8aa4[_0x97e1('0x34')]=qs[_0x97e1('0x35')](_[_0x97e1('0x36')](_0x1fc885['query'],_0x52ba4c[_0x97e1('0x35')]));if(_0x1fc885[_0x97e1('0x2b')][_0x97e1('0x37')]){_0x5d8aa4[_0x97e1('0x34')]=_[_0x97e1('0x38')](_0x5d8aa4[_0x97e1('0x34')],{'$or':_[_0x97e1('0x26')](_0xe01129,function(_0x2e6737){if(_0x2e6737[_0x97e1('0x28')]!==_0x97e1('0x39')){var _0x2c6862={};_0x2c6862[_0x2e6737[_0x97e1('0x24')]]={'$like':'%'+_0x1fc885[_0x97e1('0x2b')][_0x97e1('0x37')]+'%'};return _0x2c6862;}})});}_0x5d8aa4=_[_0x97e1('0x38')]({},_0x5d8aa4,_0x1fc885['options']);var _0x13d7e7={'where':_0x5d8aa4[_0x97e1('0x34')]};return db['VoiceQueuesLog'][_0x97e1('0x18')](_0x13d7e7)[_0x97e1('0x21')](function(_0xf8891a){_0x377a4f[_0x97e1('0x18')]=_0xf8891a;if(_0x1fc885[_0x97e1('0x2b')][_0x97e1('0x3a')]){_0x5d8aa4['include']=[{'all':!![]}];}return db['VoiceQueuesLog']['findAll'](_0x5d8aa4);})[_0x97e1('0x21')](function(_0x594a21){_0x377a4f['rows']=_0x594a21;return _0x377a4f;})[_0x97e1('0x21')](respondWithFilteredResult(_0x4d2a7c,_0x5d8aa4))[_0x97e1('0x3b')](handleError(_0x4d2a7c,null));};exports['show']=function(_0xa3fe9f,_0x34f823){var _0x50968f={'raw':!![],'where':{'id':_0xa3fe9f['params']['id']}},_0x4a4df3={};_0x4a4df3[_0x97e1('0x2a')]=_[_0x97e1('0x2c')](db['VoiceQueuesLog']['rawAttributes']);_0x4a4df3[_0x97e1('0x2b')]=_['keys'](_0xa3fe9f[_0x97e1('0x2b')]);_0x4a4df3['filters']=_['intersection'](_0x4a4df3[_0x97e1('0x2a')],_0x4a4df3['query']);_0x50968f[_0x97e1('0x2e')]=_['intersection'](_0x4a4df3['model'],qs['fields'](_0xa3fe9f['query'][_0x97e1('0x2f')]));_0x50968f[_0x97e1('0x2e')]=_0x50968f['attributes']['length']?_0x50968f[_0x97e1('0x2e')]:_0x4a4df3[_0x97e1('0x2a')];if(_0xa3fe9f[_0x97e1('0x2b')]['includeAll']){_0x50968f[_0x97e1('0x3c')]=[{'all':!![]}];}_0x50968f=_[_0x97e1('0x38')]({},_0x50968f,_0xa3fe9f[_0x97e1('0x3d')]);return db['VoiceQueuesLog'][_0x97e1('0x3e')](_0x50968f)['then'](handleEntityNotFound(_0x34f823,null))['then'](respondWithResult(_0x34f823,null))[_0x97e1('0x3b')](handleError(_0x34f823,null));};exports['create']=function(_0x35610c,_0xd47785){return db['VoiceQueuesLog']['create'](_0x35610c['body'],{})[_0x97e1('0x21')](respondWithResult(_0xd47785,0xc9))[_0x97e1('0x3b')](handleError(_0xd47785,null));};exports[_0x97e1('0x20')]=function(_0x56513f,_0x180aca){if(_0x56513f[_0x97e1('0x3f')]['id']){delete _0x56513f[_0x97e1('0x3f')]['id'];}return db[_0x97e1('0x40')]['find']({'where':{'id':_0x56513f[_0x97e1('0x41')]['id']}})[_0x97e1('0x21')](handleEntityNotFound(_0x180aca,null))[_0x97e1('0x21')](saveUpdates(_0x56513f['body'],null))[_0x97e1('0x21')](respondWithResult(_0x180aca,null))[_0x97e1('0x3b')](handleError(_0x180aca,null));};exports[_0x97e1('0x22')]=function(_0x1f8a89,_0x575e81){return db[_0x97e1('0x40')][_0x97e1('0x3e')]({'where':{'id':_0x1f8a89[_0x97e1('0x41')]['id']}})['then'](handleEntityNotFound(_0x575e81,null))[_0x97e1('0x21')](removeEntity(_0x575e81,null))[_0x97e1('0x3b')](handleError(_0x575e81,null));};
\ No newline at end of file
diff --git a/server/api/voiceQueuesLog/voiceQueuesLog.model.js b/server/api/voiceQueuesLog/voiceQueuesLog.model.js
index 0e63040..07ac022 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 _0x2452=['bluebird','path','rimraf','../../config/environment','./voiceQueuesLog.attributes','exports','define','VoiceQueuesLog','voice_queues_log','event_dtm','event','dtm','lodash','util','../../config/logger','moment'];(function(_0x35a140,_0x3aeac6){var _0x30ab82=function(_0x15a7c3){while(--_0x15a7c3){_0x35a140['push'](_0x35a140['shift']());}};_0x30ab82(++_0x3aeac6);}(_0x2452,0xac));var _0x2245=function(_0x46763f,_0x473c32){_0x46763f=_0x46763f-0x0;var _0x22d8d4=_0x2452[_0x46763f];return _0x22d8d4;};'use strict';var _=require(_0x2245('0x0'));var util=require(_0x2245('0x1'));var logger=require(_0x2245('0x2'))('api');var moment=require(_0x2245('0x3'));var BPromise=require(_0x2245('0x4'));var rp=require('request-promise');var fs=require('fs');var path=require(_0x2245('0x5'));var rimraf=require(_0x2245('0x6'));var config=require(_0x2245('0x7'));var attributes=require(_0x2245('0x8'));module[_0x2245('0x9')]=function(_0x5c6223,_0xdd9d06){return _0x5c6223[_0x2245('0xa')](_0x2245('0xb'),attributes,{'tableName':_0x2245('0xc'),'paranoid':![],'indexes':[{'name':_0x2245('0xd'),'fields':[_0x2245('0xe'),_0x2245('0xf')]}],'timestamps':![]});};
\ No newline at end of file
+var _0x562e=['moment','bluebird','request-promise','path','rimraf','../../config/environment','./voiceQueuesLog.attributes','exports','voice_queues_log','event_dtm','dtm','lodash','util','api'];(function(_0x21a9d9,_0x4d5ac8){var _0x46adce=function(_0xfdd336){while(--_0xfdd336){_0x21a9d9['push'](_0x21a9d9['shift']());}};_0x46adce(++_0x4d5ac8);}(_0x562e,0x1af));var _0xe562=function(_0x1be93c,_0x5ba741){_0x1be93c=_0x1be93c-0x0;var _0xf1abe0=_0x562e[_0x1be93c];return _0xf1abe0;};'use strict';var _=require(_0xe562('0x0'));var util=require(_0xe562('0x1'));var logger=require('../../config/logger')(_0xe562('0x2'));var moment=require(_0xe562('0x3'));var BPromise=require(_0xe562('0x4'));var rp=require(_0xe562('0x5'));var fs=require('fs');var path=require(_0xe562('0x6'));var rimraf=require(_0xe562('0x7'));var config=require(_0xe562('0x8'));var attributes=require(_0xe562('0x9'));module[_0xe562('0xa')]=function(_0x276719,_0x4520ef){return _0x276719['define']('VoiceQueuesLog',attributes,{'tableName':_0xe562('0xb'),'paranoid':![],'indexes':[{'name':_0xe562('0xc'),'fields':['event',_0xe562('0xd')]}],'timestamps':![]});};
\ No newline at end of file
diff --git a/server/api/voiceQueuesLog/voiceQueuesLog.rpc.js b/server/api/voiceQueuesLog/voiceQueuesLog.rpc.js
index ba94682..6580002 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 _0x5ba3=['ioredis','../../mysqldb','../../config/utils','rpc','../../config/environment','jayson/promise','then','info','VoiceQueuesLog,\x20%s,\x20%s','debug','error','code','message','request\x20sent','result','catch','lodash','moment','bluebird'];(function(_0x122ef9,_0x451d2a){var _0x42fba0=function(_0x17c9d3){while(--_0x17c9d3){_0x122ef9['push'](_0x122ef9['shift']());}};_0x42fba0(++_0x451d2a);}(_0x5ba3,0x140));var _0x35ba=function(_0x1ae720,_0x2653c9){_0x1ae720=_0x1ae720-0x0;var _0x3d7469=_0x5ba3[_0x1ae720];return _0x3d7469;};'use strict';var _=require(_0x35ba('0x0'));var util=require('util');var moment=require(_0x35ba('0x1'));var BPromise=require(_0x35ba('0x2'));var rs=require('randomstring');var fs=require('fs');var Redis=require(_0x35ba('0x3'));var db=require(_0x35ba('0x4'))['db'];var utils=require(_0x35ba('0x5'));var logger=require('../../config/logger')(_0x35ba('0x6'));var config=require(_0x35ba('0x7'));var jayson=require(_0x35ba('0x8'));var client=jayson['client']['http']({'port':0x232a});function respondWithRpcPromise(_0x20cd5f,_0x3264d3,_0x380ffb){return new BPromise(function(_0x4c55f3,_0x22bed8){return client['request'](_0x20cd5f,_0x380ffb)[_0x35ba('0x9')](function(_0x366ddc){logger[_0x35ba('0xa')](_0x35ba('0xb'),_0x3264d3,'request\x20sent');logger[_0x35ba('0xc')]('VoiceQueuesLog,\x20%s,\x20%s,\x20%s',_0x3264d3,'request\x20sent',JSON['stringify'](_0x366ddc));if(_0x366ddc[_0x35ba('0xd')]){if(_0x366ddc[_0x35ba('0xd')][_0x35ba('0xe')]===0x1f4){logger[_0x35ba('0xd')](_0x35ba('0xb'),_0x3264d3,_0x366ddc[_0x35ba('0xd')][_0x35ba('0xf')]);return _0x22bed8(_0x366ddc[_0x35ba('0xd')]['message']);}logger[_0x35ba('0xd')](_0x35ba('0xb'),_0x3264d3,_0x366ddc[_0x35ba('0xd')][_0x35ba('0xf')]);return _0x4c55f3(_0x366ddc['error'][_0x35ba('0xf')]);}else{logger['info']('VoiceQueuesLog,\x20%s,\x20%s',_0x3264d3,_0x35ba('0x10'));_0x4c55f3(_0x366ddc[_0x35ba('0x11')]['message']);}})[_0x35ba('0x12')](function(_0x2b6b71){logger[_0x35ba('0xd')](_0x35ba('0xb'),_0x3264d3,_0x2b6b71);_0x22bed8(_0x2b6b71);});});}
\ No newline at end of file
+var _0xac4a=['VoiceQueuesLog,\x20%s,\x20%s','message','result','catch','lodash','util','moment','bluebird','randomstring','ioredis','../../config/logger','rpc','../../config/environment','client','then','info','debug','VoiceQueuesLog,\x20%s,\x20%s,\x20%s','request\x20sent','stringify','error'];(function(_0x167cc1,_0x56ef5a){var _0x10bc4b=function(_0xd6a255){while(--_0xd6a255){_0x167cc1['push'](_0x167cc1['shift']());}};_0x10bc4b(++_0x56ef5a);}(_0xac4a,0x13f));var _0xaac4=function(_0x314730,_0x5f5585){_0x314730=_0x314730-0x0;var _0x3f9c60=_0xac4a[_0x314730];return _0x3f9c60;};'use strict';var _=require(_0xaac4('0x0'));var util=require(_0xaac4('0x1'));var moment=require(_0xaac4('0x2'));var BPromise=require(_0xaac4('0x3'));var rs=require(_0xaac4('0x4'));var fs=require('fs');var Redis=require(_0xaac4('0x5'));var db=require('../../mysqldb')['db'];var utils=require('../../config/utils');var logger=require(_0xaac4('0x6'))(_0xaac4('0x7'));var config=require(_0xaac4('0x8'));var jayson=require('jayson/promise');var client=jayson[_0xaac4('0x9')]['http']({'port':0x232a});function respondWithRpcPromise(_0x1cdfc5,_0x5870e8,_0x1e4283){return new BPromise(function(_0x27354c,_0x567295){return client['request'](_0x1cdfc5,_0x1e4283)[_0xaac4('0xa')](function(_0x50d114){logger[_0xaac4('0xb')]('VoiceQueuesLog,\x20%s,\x20%s',_0x5870e8,'request\x20sent');logger[_0xaac4('0xc')](_0xaac4('0xd'),_0x5870e8,_0xaac4('0xe'),JSON[_0xaac4('0xf')](_0x50d114));if(_0x50d114[_0xaac4('0x10')]){if(_0x50d114['error']['code']===0x1f4){logger[_0xaac4('0x10')](_0xaac4('0x11'),_0x5870e8,_0x50d114[_0xaac4('0x10')]['message']);return _0x567295(_0x50d114[_0xaac4('0x10')][_0xaac4('0x12')]);}logger['error'](_0xaac4('0x11'),_0x5870e8,_0x50d114[_0xaac4('0x10')][_0xaac4('0x12')]);return _0x27354c(_0x50d114[_0xaac4('0x10')][_0xaac4('0x12')]);}else{logger[_0xaac4('0xb')](_0xaac4('0x11'),_0x5870e8,_0xaac4('0xe'));_0x27354c(_0x50d114[_0xaac4('0x13')][_0xaac4('0x12')]);}})[_0xaac4('0x14')](function(_0x1766c2){logger[_0xaac4('0x10')]('VoiceQueuesLog,\x20%s,\x20%s',_0x5870e8,_0x1766c2);_0x567295(_0x1766c2);});});}
\ No newline at end of file
diff --git a/server/api/voiceRecording/index.js b/server/api/voiceRecording/index.js
index 3bc8ee1..9a28be7 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 _0xb82f=['../../components/interaction/service','../../config/environment','isAuthenticated','/describe','describe','get','/:id','show','/:id/download','download','/:id/downloads','post','create','put','update','delete','destroy','exports','multer','path','connect-timeout','express','Router'];(function(_0x493e57,_0x39c97e){var _0x4553d0=function(_0x2455c6){while(--_0x2455c6){_0x493e57['push'](_0x493e57['shift']());}};_0x4553d0(++_0x39c97e);}(_0xb82f,0x13d));var _0xfb82=function(_0x5cc2fe,_0x394ea5){_0x5cc2fe=_0x5cc2fe-0x0;var _0x5e0c9a=_0xb82f[_0x5cc2fe];return _0x5e0c9a;};'use strict';var multer=require(_0xfb82('0x0'));var util=require('util');var path=require(_0xfb82('0x1'));var timeout=require(_0xfb82('0x2'));var express=require(_0xfb82('0x3'));var router=express[_0xfb82('0x4')]();var auth=require('../../components/auth/service');var interaction=require(_0xfb82('0x5'));var config=require(_0xfb82('0x6'));var controller=require('./voiceRecording.controller');router['get']('/',auth[_0xfb82('0x7')](),controller['index']);router['get'](_0xfb82('0x8'),auth['isAuthenticated'](),controller[_0xfb82('0x9')]);router[_0xfb82('0xa')](_0xfb82('0xb'),auth['isAuthenticated'](),controller[_0xfb82('0xc')]);router[_0xfb82('0xa')](_0xfb82('0xd'),auth['isAuthenticated'](),controller[_0xfb82('0xe')]);router[_0xfb82('0xa')](_0xfb82('0xf'),controller['downloads']);router[_0xfb82('0x10')]('/',auth[_0xfb82('0x7')](),controller[_0xfb82('0x11')]);router[_0xfb82('0x12')](_0xfb82('0xb'),auth[_0xfb82('0x7')](),controller[_0xfb82('0x13')]);router[_0xfb82('0x14')](_0xfb82('0xb'),auth[_0xfb82('0x7')](),controller[_0xfb82('0x15')]);module[_0xfb82('0x16')]=router;
\ No newline at end of file
+var _0xce97=['get','isAuthenticated','index','/describe','/:id/download','downloads','update','delete','/:id','destroy','exports','multer','util','path','connect-timeout','express','Router','../../components/auth/service','../../components/interaction/service','../../config/environment','./voiceRecording.controller'];(function(_0xa42d2,_0x212a45){var _0x5db68b=function(_0x348dd8){while(--_0x348dd8){_0xa42d2['push'](_0xa42d2['shift']());}};_0x5db68b(++_0x212a45);}(_0xce97,0x131));var _0x7ce9=function(_0x4abd82,_0x209993){_0x4abd82=_0x4abd82-0x0;var _0x9c15c3=_0xce97[_0x4abd82];return _0x9c15c3;};'use strict';var multer=require(_0x7ce9('0x0'));var util=require(_0x7ce9('0x1'));var path=require(_0x7ce9('0x2'));var timeout=require(_0x7ce9('0x3'));var express=require(_0x7ce9('0x4'));var router=express[_0x7ce9('0x5')]();var auth=require(_0x7ce9('0x6'));var interaction=require(_0x7ce9('0x7'));var config=require(_0x7ce9('0x8'));var controller=require(_0x7ce9('0x9'));router[_0x7ce9('0xa')]('/',auth[_0x7ce9('0xb')](),controller[_0x7ce9('0xc')]);router[_0x7ce9('0xa')](_0x7ce9('0xd'),auth[_0x7ce9('0xb')](),controller['describe']);router[_0x7ce9('0xa')]('/:id',auth[_0x7ce9('0xb')](),controller['show']);router['get'](_0x7ce9('0xe'),auth[_0x7ce9('0xb')](),controller['download']);router['get']('/:id/downloads',controller[_0x7ce9('0xf')]);router['post']('/',auth[_0x7ce9('0xb')](),controller['create']);router['put']('/:id',auth[_0x7ce9('0xb')](),controller[_0x7ce9('0x10')]);router[_0x7ce9('0x11')](_0x7ce9('0x12'),auth[_0x7ce9('0xb')](),controller[_0x7ce9('0x13')]);module[_0x7ce9('0x14')]=router;
\ No newline at end of file
diff --git a/server/api/voiceRecording/voiceRecording.attributes.js b/server/api/voiceRecording/voiceRecording.attributes.js
index f674733..c6231ca 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 _0xa465=['STRING','setDataValue','split','INTEGER','DATE','createdAt','toString','updatedAt','MM-DD-YYYY\x20HH:mm','sequelize','moment','path','exports','VIRTUAL','getDataValue','value','extname'];(function(_0xf3ee1a,_0x493c65){var _0x166465=function(_0x751efa){while(--_0x751efa){_0xf3ee1a['push'](_0xf3ee1a['shift']());}};_0x166465(++_0x493c65);}(_0xa465,0x12a));var _0x5a46=function(_0x5a18c3,_0x5c6928){_0x5a18c3=_0x5a18c3-0x0;var _0x3e22e7=_0xa465[_0x5a18c3];return _0x3e22e7;};'use strict';var Sequelize=require(_0x5a46('0x0'));var moment=require(_0x5a46('0x1'));var path=require(_0x5a46('0x2'));module[_0x5a46('0x3')]={'format':{'type':Sequelize[_0x5a46('0x4')],'get':function(){return this[_0x5a46('0x5')](_0x5a46('0x6'))?path[_0x5a46('0x7')](this[_0x5a46('0x5')](_0x5a46('0x6'))):undefined;}},'uniqueid':{'type':Sequelize[_0x5a46('0x8')]},'channel':{'type':Sequelize[_0x5a46('0x8')],'set':function(_0x2058e4){if(_0x2058e4){this[_0x5a46('0x9')]('channel',_0x2058e4);this['setDataValue']('membername',_0x2058e4[_0x5a46('0xa')](/\/|-/)[0x1]);}}},'membername':{'type':Sequelize[_0x5a46('0x8')]},'calleridnum':{'type':Sequelize[_0x5a46('0x8')]},'calleridname':{'type':Sequelize[_0x5a46('0x8')]},'connectedlinenum':{'type':Sequelize[_0x5a46('0x8')]},'connectedlinename':{'type':Sequelize['STRING']},'accountcode':{'type':Sequelize['STRING']},'context':{'type':Sequelize[_0x5a46('0x8')]},'exten':{'type':Sequelize['STRING']},'value':{'type':Sequelize[_0x5a46('0x8')]},'type':{'type':Sequelize[_0x5a46('0x8')]},'rating':{'type':Sequelize[_0x5a46('0xb')],'validate':{'max':0x5,'min':0x0}},'queue':{'type':Sequelize[_0x5a46('0x8')]},'userDisposition':{'type':Sequelize[_0x5a46('0x8')]},'createdAt':{'type':Sequelize[_0x5a46('0xc')],'get':function(){return moment(this[_0x5a46('0x5')](_0x5a46('0xd')))['format']('MM-DD-YYYY\x20HH:mm')[_0x5a46('0xe')]();}},'updatedAt':{'type':Sequelize[_0x5a46('0xc')],'get':function(){return moment(this[_0x5a46('0x5')](_0x5a46('0xf')))['format'](_0x5a46('0x10'))[_0x5a46('0xe')]();}}};
\ No newline at end of file
+var _0x8e61=['path','exports','VIRTUAL','getDataValue','extname','STRING','setDataValue','channel','membername','DATE','createdAt','MM-DD-YYYY\x20HH:mm','toString','updatedAt','format','sequelize'];(function(_0x2603fc,_0x25cc88){var _0x1342bf=function(_0x48637c){while(--_0x48637c){_0x2603fc['push'](_0x2603fc['shift']());}};_0x1342bf(++_0x25cc88);}(_0x8e61,0x1ef));var _0x18e6=function(_0x33032e,_0x31411a){_0x33032e=_0x33032e-0x0;var _0x13316b=_0x8e61[_0x33032e];return _0x13316b;};'use strict';var Sequelize=require(_0x18e6('0x0'));var moment=require('moment');var path=require(_0x18e6('0x1'));module[_0x18e6('0x2')]={'format':{'type':Sequelize[_0x18e6('0x3')],'get':function(){return this[_0x18e6('0x4')]('value')?path[_0x18e6('0x5')](this[_0x18e6('0x4')]('value')):undefined;}},'uniqueid':{'type':Sequelize[_0x18e6('0x6')]},'channel':{'type':Sequelize[_0x18e6('0x6')],'set':function(_0x55d97b){if(_0x55d97b){this[_0x18e6('0x7')](_0x18e6('0x8'),_0x55d97b);this[_0x18e6('0x7')](_0x18e6('0x9'),_0x55d97b['split'](/\/|-/)[0x1]);}}},'membername':{'type':Sequelize['STRING']},'calleridnum':{'type':Sequelize['STRING']},'calleridname':{'type':Sequelize['STRING']},'connectedlinenum':{'type':Sequelize['STRING']},'connectedlinename':{'type':Sequelize[_0x18e6('0x6')]},'accountcode':{'type':Sequelize['STRING']},'context':{'type':Sequelize[_0x18e6('0x6')]},'exten':{'type':Sequelize[_0x18e6('0x6')]},'value':{'type':Sequelize[_0x18e6('0x6')]},'type':{'type':Sequelize[_0x18e6('0x6')]},'rating':{'type':Sequelize['INTEGER'],'validate':{'max':0x5,'min':0x0}},'queue':{'type':Sequelize[_0x18e6('0x6')]},'userDisposition':{'type':Sequelize[_0x18e6('0x6')]},'createdAt':{'type':Sequelize[_0x18e6('0xa')],'get':function(){return moment(this['getDataValue'](_0x18e6('0xb')))['format'](_0x18e6('0xc'))[_0x18e6('0xd')]();}},'updatedAt':{'type':Sequelize[_0x18e6('0xa')],'get':function(){return moment(this[_0x18e6('0x4')](_0x18e6('0xe')))[_0x18e6('0xf')](_0x18e6('0xc'))['toString']();}}};
\ No newline at end of file
diff --git a/server/api/voiceRecording/voiceRecording.controller.js b/server/api/voiceRecording/voiceRecording.controller.js
index 6a7292e..6b2659f 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 _0x05b7=['fieldName','type','key','format','query','keys','filters','intersection','model','attributes','fields','length','hasOwnProperty','nolimit','offset','sort','pick','filter','where','merge','VIRTUAL','include','findAll','rows','catch','includeAll','options','find','create','body','params','describe','download','../../components/encryptor','uniqueid','value','%s.cypher','existsSync','decryptFile','secrets','recording','Sequelize','ValidationError','VoiceRecording\x20not\x20found','filename','extname','unlink','message','Not\x20found','sequelize','MD5','col','token','$and','push','Entity\x20not\x20found','cancellazione\x20fisica\x20documento\x20%s','isNil','info','File:\x20\x22','unlinkSync','\x22\x20trovato\x20eseguo\x20la\x20cancellazione','destroy','html-pdf','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','moment','bluebird','util','sox','to-csv','ejs','lodash','squel','crypto','jsforce','desk.js','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/logger','api','../../config/utils','../../config/environment','../../mysqldb','sendStatus','end','status','json','count','limit','set','Content-Range','apply','save','update','then','stack','name','index','map','VoiceRecording','rawAttributes'];(function(_0x525069,_0x2c2fe8){var _0x21a499=function(_0x21f513){while(--_0x21f513){_0x525069['push'](_0x525069['shift']());}};_0x21a499(++_0x2c2fe8);}(_0x05b7,0x1f3));var _0x705b=function(_0x4709c0,_0x3396c7){_0x4709c0=_0x4709c0-0x0;var _0x13348b=_0x05b7[_0x4709c0];return _0x13348b;};'use strict';var pdf=require(_0x705b('0x0'));var emlformat=require(_0x705b('0x1'));var rimraf=require(_0x705b('0x2'));var zipdir=require(_0x705b('0x3'));var jsonpatch=require(_0x705b('0x4'));var rp=require(_0x705b('0x5'));var moment=require(_0x705b('0x6'));var BPromise=require(_0x705b('0x7'));var Mustache=require('mustache');var util=require(_0x705b('0x8'));var path=require('path');var sox=require(_0x705b('0x9'));var csv=require(_0x705b('0xa'));var ejs=require(_0x705b('0xb'));var fs=require('fs');var _=require(_0x705b('0xc'));var squel=require(_0x705b('0xd'));var crypto=require(_0x705b('0xe'));var jsforce=require(_0x705b('0xf'));var deskjs=require(_0x705b('0x10'));var toCsv=require('to-csv');var querystring=require(_0x705b('0x11'));var Papa=require(_0x705b('0x12'));var Redis=require(_0x705b('0x13'));var authService=require(_0x705b('0x14'));var qs=require(_0x705b('0x15'));var as=require(_0x705b('0x16'));var hardwareService=require('../../config/license/hardware');var logger=require(_0x705b('0x17'))(_0x705b('0x18'));var utils=require(_0x705b('0x19'));var config=require(_0x705b('0x1a'));var db=require(_0x705b('0x1b'))['db'];function respondWithStatusCode(_0x440f80,_0x1cdc19){_0x1cdc19=_0x1cdc19||0xcc;return function(_0x3a79ae){if(_0x3a79ae){return _0x440f80[_0x705b('0x1c')](_0x1cdc19);}return _0x440f80['status'](_0x1cdc19)[_0x705b('0x1d')]();};}function respondWithResult(_0x27ac94,_0x20075b){_0x20075b=_0x20075b||0xc8;return function(_0xcc6bd0){if(_0xcc6bd0){return _0x27ac94[_0x705b('0x1e')](_0x20075b)[_0x705b('0x1f')](_0xcc6bd0);}};}function respondWithFilteredResult(_0x83d054,_0x556d54){return function(_0x456411){if(_0x456411){var _0x143e20=_0x456411[_0x705b('0x20')],_0x7b3a46=_0x556d54['offset'],_0x558b14=_0x556d54['offset']+_0x556d54[_0x705b('0x21')],_0x200d51;if(_0x558b14>=_0x143e20){_0x558b14=_0x143e20;_0x200d51=0xc8;}else{_0x200d51=0xce;}_0x83d054[_0x705b('0x1e')](_0x200d51);return _0x83d054[_0x705b('0x22')](_0x705b('0x23'),_0x7b3a46+'-'+_0x558b14+'/'+_0x143e20)['json'](_0x456411);}return null;};}function patchUpdates(_0x2c8194){return function(_0x5ba755){try{jsonpatch[_0x705b('0x24')](_0x5ba755,_0x2c8194,!![]);}catch(_0x5ddd3f){return BPromise['reject'](_0x5ddd3f);}return _0x5ba755[_0x705b('0x25')]();};}function saveUpdates(_0xd646c,_0x357427){return function(_0x24b469){if(_0x24b469){return _0x24b469[_0x705b('0x26')](_0xd646c)[_0x705b('0x27')](function(_0x5d7d48){return _0x5d7d48;});}return null;};}function removeEntity(_0x3c7b77,_0x5934f8){return function(_0x20ab76){if(_0x20ab76){return _0x20ab76['destroy']()[_0x705b('0x27')](function(){_0x3c7b77['status'](0xcc)[_0x705b('0x1d')]();});}};}function handleEntityNotFound(_0x3683c9,_0x5de9df){return function(_0x55e9ee){if(!_0x55e9ee){_0x3683c9[_0x705b('0x1c')](0x194);}return _0x55e9ee;};}function handleError(_0x480eb1,_0x193d2f){_0x193d2f=_0x193d2f||0x1f4;return function(_0x1ad3e7){logger['error'](_0x1ad3e7[_0x705b('0x28')]);if(_0x1ad3e7[_0x705b('0x29')]){delete _0x1ad3e7[_0x705b('0x29')];}_0x480eb1[_0x705b('0x1e')](_0x193d2f)['send'](_0x1ad3e7);};}exports[_0x705b('0x2a')]=function(_0x34ed74,_0x3c3bae){var _0x133b41={},_0x3b1bfd={},_0x1b109f={'count':0x0,'rows':[]};var _0x10ac02=_[_0x705b('0x2b')](db[_0x705b('0x2c')][_0x705b('0x2d')],function(_0x54e5aa){return{'name':_0x54e5aa[_0x705b('0x2e')],'type':_0x54e5aa[_0x705b('0x2f')][_0x705b('0x30')]};});_0x3b1bfd['model']=_['differenceBy'](_[_0x705b('0x2b')](_0x10ac02,'name'),[_0x705b('0x31')]);_0x3b1bfd[_0x705b('0x32')]=_[_0x705b('0x33')](_0x34ed74[_0x705b('0x32')]);_0x3b1bfd[_0x705b('0x34')]=_[_0x705b('0x35')](_0x3b1bfd[_0x705b('0x36')],_0x3b1bfd[_0x705b('0x32')]);_0x133b41[_0x705b('0x37')]=_[_0x705b('0x35')](_0x3b1bfd['model'],qs[_0x705b('0x38')](_0x34ed74[_0x705b('0x32')][_0x705b('0x38')]));_0x133b41['attributes']=_0x133b41[_0x705b('0x37')][_0x705b('0x39')]?_0x133b41[_0x705b('0x37')]:_0x3b1bfd[_0x705b('0x36')];if(!_0x34ed74[_0x705b('0x32')][_0x705b('0x3a')](_0x705b('0x3b'))){_0x133b41[_0x705b('0x21')]=qs['limit'](_0x34ed74[_0x705b('0x32')][_0x705b('0x21')]);_0x133b41[_0x705b('0x3c')]=qs[_0x705b('0x3c')](_0x34ed74['query'][_0x705b('0x3c')]);}_0x133b41['order']=qs[_0x705b('0x3d')](_0x34ed74[_0x705b('0x32')][_0x705b('0x3d')]);_0x133b41['where']=qs['filters'](_[_0x705b('0x3e')](_0x34ed74[_0x705b('0x32')],_0x3b1bfd['filters']));if(_0x34ed74[_0x705b('0x32')][_0x705b('0x3f')]){_0x133b41[_0x705b('0x40')]=_[_0x705b('0x41')](_0x133b41[_0x705b('0x40')],{'$or':_[_0x705b('0x2b')](_0x10ac02,function(_0x316734){if(_0x316734[_0x705b('0x2f')]!==_0x705b('0x42')){var _0x2754fe={};_0x2754fe[_0x316734[_0x705b('0x29')]]={'$like':'%'+_0x34ed74[_0x705b('0x32')][_0x705b('0x3f')]+'%'};return _0x2754fe;}})});}_0x133b41=_['merge']({},_0x133b41,_0x34ed74['options']);var _0x3a1195={'where':_0x133b41[_0x705b('0x40')]};return db[_0x705b('0x2c')][_0x705b('0x20')](_0x3a1195)[_0x705b('0x27')](function(_0x583847){_0x1b109f[_0x705b('0x20')]=_0x583847;if(_0x34ed74[_0x705b('0x32')]['includeAll']){_0x133b41[_0x705b('0x43')]=[{'all':!![]}];}return db[_0x705b('0x2c')][_0x705b('0x44')](_0x133b41);})[_0x705b('0x27')](function(_0x5c4933){_0x1b109f[_0x705b('0x45')]=_0x5c4933;return _0x1b109f;})[_0x705b('0x27')](respondWithFilteredResult(_0x3c3bae,_0x133b41))[_0x705b('0x46')](handleError(_0x3c3bae,null));};exports['show']=function(_0x5d8fad,_0x217310){var _0x3af173={'raw':![],'where':{'id':_0x5d8fad['params']['id']}},_0x3eb5e2={};_0x3eb5e2[_0x705b('0x36')]=_[_0x705b('0x33')](db[_0x705b('0x2c')][_0x705b('0x2d')]);_0x3eb5e2[_0x705b('0x32')]=_['keys'](_0x5d8fad['query']);_0x3eb5e2['filters']=_[_0x705b('0x35')](_0x3eb5e2[_0x705b('0x36')],_0x3eb5e2[_0x705b('0x32')]);_0x3af173['attributes']=_[_0x705b('0x35')](_0x3eb5e2[_0x705b('0x36')],qs[_0x705b('0x38')](_0x5d8fad['query']['fields']));_0x3af173['attributes']=_0x3af173[_0x705b('0x37')][_0x705b('0x39')]?_0x3af173['attributes']:_0x3eb5e2[_0x705b('0x36')];if(_0x5d8fad[_0x705b('0x32')][_0x705b('0x47')]){_0x3af173[_0x705b('0x43')]=[{'all':!![]}];}_0x3af173=_[_0x705b('0x41')]({},_0x3af173,_0x5d8fad[_0x705b('0x48')]);return db[_0x705b('0x2c')][_0x705b('0x49')](_0x3af173)[_0x705b('0x27')](handleEntityNotFound(_0x217310,null))[_0x705b('0x27')](respondWithResult(_0x217310,null))[_0x705b('0x46')](handleError(_0x217310,null));};exports[_0x705b('0x4a')]=function(_0x2829cf,_0x8b0c5e){return db[_0x705b('0x2c')]['create'](_0x2829cf['body'],{})[_0x705b('0x27')](respondWithResult(_0x8b0c5e,0xc9))[_0x705b('0x46')](handleError(_0x8b0c5e,null));};exports['update']=function(_0x2ed585,_0xe5306b){if(_0x2ed585['body']['id']){delete _0x2ed585[_0x705b('0x4b')]['id'];}return db[_0x705b('0x2c')]['find']({'where':{'id':_0x2ed585[_0x705b('0x4c')]['id']}})[_0x705b('0x27')](handleEntityNotFound(_0xe5306b,null))[_0x705b('0x27')](saveUpdates(_0x2ed585[_0x705b('0x4b')],null))[_0x705b('0x27')](respondWithResult(_0xe5306b,null))[_0x705b('0x46')](handleError(_0xe5306b,null));};exports[_0x705b('0x4d')]=function(_0x4b9196,_0x41e92d){return db[_0x705b('0x2c')][_0x705b('0x4d')]()['then'](respondWithResult(_0x41e92d,null))[_0x705b('0x46')](handleError(_0x41e92d,null));};exports[_0x705b('0x4e')]=function(_0x34ccf8,_0x368e61,_0x4a436d){var _0x30d858=require(_0x705b('0x4f'));var _0x50a45d=![];var _0x4ca59c={};if(_0x34ccf8[_0x705b('0x32')]['type']&&_0x34ccf8[_0x705b('0x32')]['type']==='uniqueid'){_0x4ca59c[_0x705b('0x50')]=_0x34ccf8[_0x705b('0x4c')]['id'];}else{_0x4ca59c['id']=_0x34ccf8[_0x705b('0x4c')]['id'];}return db[_0x705b('0x2c')][_0x705b('0x49')]({'where':_0x4ca59c,'attributes':['id','value'],'raw':!![]})['then'](handleEntityNotFound(_0x368e61,null))[_0x705b('0x27')](function(_0xd0ce94){if(_0xd0ce94){var _0x3764f6=_0xd0ce94[_0x705b('0x51')];var _0x40bede=util[_0x705b('0x31')](_0x705b('0x52'),_0x3764f6);if(fs[_0x705b('0x53')](_0x40bede)){_0x50a45d=!![];return _0x30d858[_0x705b('0x54')](_0x40bede,_0x3764f6,config[_0x705b('0x55')][_0x705b('0x56')])[_0x705b('0x27')](function(){return _0xd0ce94;});}return _0xd0ce94;}})['then'](function(_0x59e084){if(_0x59e084){var _0x486b2c=_0x59e084[_0x705b('0x51')];if(!fs[_0x705b('0x53')](_0x486b2c)){throw new db[(_0x705b('0x57'))][(_0x705b('0x58'))](_0x705b('0x59'));}if(_0x59e084[_0x705b('0x5a')]){return _0x368e61[_0x705b('0x4e')](_0x486b2c,_0x59e084[_0x705b('0x5a')]+path[_0x705b('0x5b')](_0x486b2c),function(){if(_0x50a45d){fs[_0x705b('0x5c')](_0x486b2c);}});}else{return _0x368e61[_0x705b('0x4e')](_0x486b2c,function(_0x20b0d9){if(_0x50a45d){fs['unlink'](_0x486b2c);}});}}})['catch'](function(_0x234f64){if(_0x234f64[_0x705b('0x5d')]==='VoiceRecording\x20not\x20found'){_0x368e61[_0x705b('0x1e')](0x194)['send'](_0x705b('0x5e'));}else{return handleError(_0x368e61,null);}});};exports['downloads']=function(_0x124a47,_0x1e1d67,_0x55768a){var _0x5d2d07=require(_0x705b('0x4f'));var _0x262d4e=![];var _0x46d578={'$and':[db[_0x705b('0x5f')][_0x705b('0x40')](db[_0x705b('0x5f')]['fn'](_0x705b('0x60'),db[_0x705b('0x5f')][_0x705b('0x61')](_0x705b('0x50'))),_0x124a47[_0x705b('0x32')][_0x705b('0x62')])]};if(_0x124a47[_0x705b('0x32')][_0x705b('0x2f')]&&_0x124a47[_0x705b('0x32')][_0x705b('0x2f')]===_0x705b('0x50')){_0x46d578[_0x705b('0x63')][_0x705b('0x64')]({'uniqueid':_0x124a47[_0x705b('0x4c')]['id']});}else{_0x46d578[_0x705b('0x63')][_0x705b('0x64')]({'id':_0x124a47[_0x705b('0x4c')]['id']});}return db[_0x705b('0x2c')][_0x705b('0x49')]({'where':_0x46d578,'attributes':['id',_0x705b('0x51')],'raw':!![]})[_0x705b('0x27')](handleEntityNotFound(_0x1e1d67,null))[_0x705b('0x27')](function(_0x2850e1){if(_0x2850e1){var _0x54114c=util[_0x705b('0x31')](_0x705b('0x52'),_0x2850e1[_0x705b('0x51')]);if(fs[_0x705b('0x53')](_0x54114c)){_0x262d4e=!![];return _0x5d2d07[_0x705b('0x54')](_0x54114c,_0x2850e1[_0x705b('0x51')],config[_0x705b('0x55')][_0x705b('0x56')])['then'](function(){return _0x2850e1;});}return _0x2850e1;}})[_0x705b('0x27')](function(_0x55c833){if(_0x55c833){if(!fs[_0x705b('0x53')](_0x55c833[_0x705b('0x51')])){throw new db[(_0x705b('0x57'))][(_0x705b('0x58'))]('VoiceRecording\x20not\x20found');}if(_0x55c833[_0x705b('0x5a')]){return _0x1e1d67['download'](_0x55c833[_0x705b('0x51')],_0x55c833[_0x705b('0x5a')]+path[_0x705b('0x5b')](_0x55c833[_0x705b('0x51')]),function(){if(_0x262d4e){fs[_0x705b('0x5c')](_0x55c833['value']);}});}else{return _0x1e1d67[_0x705b('0x4e')](_0x55c833[_0x705b('0x51')],function(_0x21c2f6){if(_0x262d4e){fs[_0x705b('0x5c')](_0x55c833[_0x705b('0x51')]);}});}}})[_0x705b('0x46')](handleError(_0x1e1d67,null));};exports['destroy']=function(_0x28d892,_0x4aa437){return db[_0x705b('0x2c')][_0x705b('0x49')]({'where':{'id':_0x28d892[_0x705b('0x4c')]['id']}})[_0x705b('0x27')](function(_0x19012e){if(!_0x19012e)throw new ReferenceError(_0x705b('0x65'));return _0x19012e;})['then'](function(_0x1cdea5){var _0x3cb675=_0x1cdea5[_0x705b('0x51')];logger['info'](_0x705b('0x66'),_0x3cb675);if(!_[_0x705b('0x67')](_0x1cdea5[_0x705b('0x51')])&&fs[_0x705b('0x53')](_0x3cb675)){logger[_0x705b('0x68')](_0x705b('0x69')+_0x3cb675+'\x22\x20trovato\x20eseguo\x20la\x20cancellazione');fs[_0x705b('0x6a')](_0x3cb675);}_0x3cb675=_0x3cb675+'.cypher';if(!_[_0x705b('0x67')](_0x1cdea5[_0x705b('0x51')])&&fs[_0x705b('0x53')](_0x3cb675)){logger[_0x705b('0x68')](_0x705b('0x69')+_0x3cb675+_0x705b('0x6b'));fs[_0x705b('0x6a')](_0x3cb675);}return _0x1cdea5;})[_0x705b('0x27')](function(_0x5883f7){if(!_0x5883f7)throw new InternalError();return _0x5883f7[_0x705b('0x6c')]();})[_0x705b('0x27')](function(){_0x4aa437['status'](0xcc)[_0x705b('0x1d')]();})[_0x705b('0x46')](handleError(_0x4aa437,null));};
\ No newline at end of file
+var _0x8ccd=['apply','update','then','destroy','sendStatus','error','stack','name','send','index','VoiceRecording','fieldName','type','key','model','differenceBy','map','format','keys','query','filters','intersection','attributes','fields','hasOwnProperty','nolimit','order','sort','where','pick','filter','merge','VIRTUAL','options','includeAll','findAll','rows','catch','show','params','rawAttributes','length','find','create','body','describe','download','uniqueid','value','%s.cypher','existsSync','secrets','recording','ValidationError','filename','unlink','message','VoiceRecording\x20not\x20found','Not\x20found','downloads','sequelize','col','token','$and','decryptFile','Entity\x20not\x20found','info','isNil','File:\x20\x22','\x22\x20trovato\x20eseguo\x20la\x20cancellazione','unlinkSync','html-pdf','rimraf','fast-json-patch','request-promise','bluebird','mustache','sox','to-csv','squel','crypto','jsforce','desk.js','papaparse','ioredis','../../components/auth/service','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/utils','../../mysqldb','end','status','json','count','offset','limit','set','Content-Range'];(function(_0x38cb73,_0x283829){var _0x332884=function(_0x574a09){while(--_0x574a09){_0x38cb73['push'](_0x38cb73['shift']());}};_0x332884(++_0x283829);}(_0x8ccd,0x173));var _0xd8cc=function(_0x1f9f37,_0x18776e){_0x1f9f37=_0x1f9f37-0x0;var _0x21c080=_0x8ccd[_0x1f9f37];return _0x21c080;};'use strict';var pdf=require(_0xd8cc('0x0'));var emlformat=require('eml-format');var rimraf=require(_0xd8cc('0x1'));var zipdir=require('zip-dir');var jsonpatch=require(_0xd8cc('0x2'));var rp=require(_0xd8cc('0x3'));var moment=require('moment');var BPromise=require(_0xd8cc('0x4'));var Mustache=require(_0xd8cc('0x5'));var util=require('util');var path=require('path');var sox=require(_0xd8cc('0x6'));var csv=require(_0xd8cc('0x7'));var ejs=require('ejs');var fs=require('fs');var _=require('lodash');var squel=require(_0xd8cc('0x8'));var crypto=require(_0xd8cc('0x9'));var jsforce=require(_0xd8cc('0xa'));var deskjs=require(_0xd8cc('0xb'));var toCsv=require(_0xd8cc('0x7'));var querystring=require('querystring');var Papa=require(_0xd8cc('0xc'));var Redis=require(_0xd8cc('0xd'));var authService=require(_0xd8cc('0xe'));var qs=require('../../components/parsers/qs');var as=require(_0xd8cc('0xf'));var hardwareService=require(_0xd8cc('0x10'));var logger=require(_0xd8cc('0x11'))(_0xd8cc('0x12'));var utils=require(_0xd8cc('0x13'));var config=require('../../config/environment');var db=require(_0xd8cc('0x14'))['db'];function respondWithStatusCode(_0x1b612e,_0x162217){_0x162217=_0x162217||0xcc;return function(_0x5ccd02){if(_0x5ccd02){return _0x1b612e['sendStatus'](_0x162217);}return _0x1b612e['status'](_0x162217)[_0xd8cc('0x15')]();};}function respondWithResult(_0x4c255a,_0xfd3138){_0xfd3138=_0xfd3138||0xc8;return function(_0x5d9805){if(_0x5d9805){return _0x4c255a[_0xd8cc('0x16')](_0xfd3138)[_0xd8cc('0x17')](_0x5d9805);}};}function respondWithFilteredResult(_0x2ffbb6,_0x57f15d){return function(_0x1e43aa){if(_0x1e43aa){var _0x3601f5=_0x1e43aa[_0xd8cc('0x18')],_0x18b508=_0x57f15d[_0xd8cc('0x19')],_0x5b0185=_0x57f15d[_0xd8cc('0x19')]+_0x57f15d[_0xd8cc('0x1a')],_0x27d099;if(_0x5b0185>=_0x3601f5){_0x5b0185=_0x3601f5;_0x27d099=0xc8;}else{_0x27d099=0xce;}_0x2ffbb6[_0xd8cc('0x16')](_0x27d099);return _0x2ffbb6[_0xd8cc('0x1b')](_0xd8cc('0x1c'),_0x18b508+'-'+_0x5b0185+'/'+_0x3601f5)[_0xd8cc('0x17')](_0x1e43aa);}return null;};}function patchUpdates(_0x3e0638){return function(_0x158f54){try{jsonpatch[_0xd8cc('0x1d')](_0x158f54,_0x3e0638,!![]);}catch(_0x5238c9){return BPromise['reject'](_0x5238c9);}return _0x158f54['save']();};}function saveUpdates(_0x53c4a9,_0x524387){return function(_0x28cb55){if(_0x28cb55){return _0x28cb55[_0xd8cc('0x1e')](_0x53c4a9)[_0xd8cc('0x1f')](function(_0x496d92){return _0x496d92;});}return null;};}function removeEntity(_0x140e10,_0x20b5f1){return function(_0x621404){if(_0x621404){return _0x621404[_0xd8cc('0x20')]()['then'](function(){_0x140e10['status'](0xcc)[_0xd8cc('0x15')]();});}};}function handleEntityNotFound(_0x3c21d5,_0x48015f){return function(_0x3d4894){if(!_0x3d4894){_0x3c21d5[_0xd8cc('0x21')](0x194);}return _0x3d4894;};}function handleError(_0x1c3f3f,_0x4b6bf9){_0x4b6bf9=_0x4b6bf9||0x1f4;return function(_0xbefcb4){logger[_0xd8cc('0x22')](_0xbefcb4[_0xd8cc('0x23')]);if(_0xbefcb4[_0xd8cc('0x24')]){delete _0xbefcb4['name'];}_0x1c3f3f[_0xd8cc('0x16')](_0x4b6bf9)[_0xd8cc('0x25')](_0xbefcb4);};}exports[_0xd8cc('0x26')]=function(_0x4b3f54,_0x26191e){var _0x540923={},_0x3d8fb9={},_0x5c0eed={'count':0x0,'rows':[]};var _0x18f8b8=_['map'](db[_0xd8cc('0x27')]['rawAttributes'],function(_0x99c16e){return{'name':_0x99c16e[_0xd8cc('0x28')],'type':_0x99c16e[_0xd8cc('0x29')][_0xd8cc('0x2a')]};});_0x3d8fb9[_0xd8cc('0x2b')]=_[_0xd8cc('0x2c')](_[_0xd8cc('0x2d')](_0x18f8b8,_0xd8cc('0x24')),[_0xd8cc('0x2e')]);_0x3d8fb9['query']=_[_0xd8cc('0x2f')](_0x4b3f54[_0xd8cc('0x30')]);_0x3d8fb9[_0xd8cc('0x31')]=_[_0xd8cc('0x32')](_0x3d8fb9['model'],_0x3d8fb9['query']);_0x540923[_0xd8cc('0x33')]=_[_0xd8cc('0x32')](_0x3d8fb9['model'],qs[_0xd8cc('0x34')](_0x4b3f54[_0xd8cc('0x30')][_0xd8cc('0x34')]));_0x540923[_0xd8cc('0x33')]=_0x540923[_0xd8cc('0x33')]['length']?_0x540923['attributes']:_0x3d8fb9['model'];if(!_0x4b3f54['query'][_0xd8cc('0x35')](_0xd8cc('0x36'))){_0x540923['limit']=qs[_0xd8cc('0x1a')](_0x4b3f54[_0xd8cc('0x30')][_0xd8cc('0x1a')]);_0x540923[_0xd8cc('0x19')]=qs[_0xd8cc('0x19')](_0x4b3f54[_0xd8cc('0x30')][_0xd8cc('0x19')]);}_0x540923[_0xd8cc('0x37')]=qs['sort'](_0x4b3f54[_0xd8cc('0x30')][_0xd8cc('0x38')]);_0x540923[_0xd8cc('0x39')]=qs[_0xd8cc('0x31')](_[_0xd8cc('0x3a')](_0x4b3f54[_0xd8cc('0x30')],_0x3d8fb9[_0xd8cc('0x31')]));if(_0x4b3f54['query'][_0xd8cc('0x3b')]){_0x540923['where']=_[_0xd8cc('0x3c')](_0x540923['where'],{'$or':_[_0xd8cc('0x2d')](_0x18f8b8,function(_0x4e956b){if(_0x4e956b['type']!==_0xd8cc('0x3d')){var _0x6d888c={};_0x6d888c[_0x4e956b[_0xd8cc('0x24')]]={'$like':'%'+_0x4b3f54[_0xd8cc('0x30')]['filter']+'%'};return _0x6d888c;}})});}_0x540923=_[_0xd8cc('0x3c')]({},_0x540923,_0x4b3f54[_0xd8cc('0x3e')]);var _0x1371cc={'where':_0x540923[_0xd8cc('0x39')]};return db[_0xd8cc('0x27')][_0xd8cc('0x18')](_0x1371cc)['then'](function(_0x1bb579){_0x5c0eed['count']=_0x1bb579;if(_0x4b3f54[_0xd8cc('0x30')][_0xd8cc('0x3f')]){_0x540923['include']=[{'all':!![]}];}return db[_0xd8cc('0x27')][_0xd8cc('0x40')](_0x540923);})[_0xd8cc('0x1f')](function(_0x5b1d8c){_0x5c0eed[_0xd8cc('0x41')]=_0x5b1d8c;return _0x5c0eed;})['then'](respondWithFilteredResult(_0x26191e,_0x540923))[_0xd8cc('0x42')](handleError(_0x26191e,null));};exports[_0xd8cc('0x43')]=function(_0x3a7d16,_0x1636ca){var _0x2942ef={'raw':![],'where':{'id':_0x3a7d16[_0xd8cc('0x44')]['id']}},_0x5e5a03={};_0x5e5a03['model']=_[_0xd8cc('0x2f')](db[_0xd8cc('0x27')][_0xd8cc('0x45')]);_0x5e5a03[_0xd8cc('0x30')]=_['keys'](_0x3a7d16['query']);_0x5e5a03['filters']=_[_0xd8cc('0x32')](_0x5e5a03['model'],_0x5e5a03['query']);_0x2942ef[_0xd8cc('0x33')]=_[_0xd8cc('0x32')](_0x5e5a03['model'],qs[_0xd8cc('0x34')](_0x3a7d16[_0xd8cc('0x30')]['fields']));_0x2942ef[_0xd8cc('0x33')]=_0x2942ef[_0xd8cc('0x33')][_0xd8cc('0x46')]?_0x2942ef[_0xd8cc('0x33')]:_0x5e5a03[_0xd8cc('0x2b')];if(_0x3a7d16['query'][_0xd8cc('0x3f')]){_0x2942ef['include']=[{'all':!![]}];}_0x2942ef=_['merge']({},_0x2942ef,_0x3a7d16[_0xd8cc('0x3e')]);return db['VoiceRecording'][_0xd8cc('0x47')](_0x2942ef)[_0xd8cc('0x1f')](handleEntityNotFound(_0x1636ca,null))[_0xd8cc('0x1f')](respondWithResult(_0x1636ca,null))['catch'](handleError(_0x1636ca,null));};exports[_0xd8cc('0x48')]=function(_0x1086df,_0x66ecce){return db[_0xd8cc('0x27')][_0xd8cc('0x48')](_0x1086df[_0xd8cc('0x49')],{})[_0xd8cc('0x1f')](respondWithResult(_0x66ecce,0xc9))[_0xd8cc('0x42')](handleError(_0x66ecce,null));};exports[_0xd8cc('0x1e')]=function(_0x4d7d7b,_0x34f421){if(_0x4d7d7b[_0xd8cc('0x49')]['id']){delete _0x4d7d7b[_0xd8cc('0x49')]['id'];}return db[_0xd8cc('0x27')][_0xd8cc('0x47')]({'where':{'id':_0x4d7d7b['params']['id']}})[_0xd8cc('0x1f')](handleEntityNotFound(_0x34f421,null))['then'](saveUpdates(_0x4d7d7b[_0xd8cc('0x49')],null))[_0xd8cc('0x1f')](respondWithResult(_0x34f421,null))['catch'](handleError(_0x34f421,null));};exports[_0xd8cc('0x4a')]=function(_0x138bf3,_0x2ad1ea){return db[_0xd8cc('0x27')][_0xd8cc('0x4a')]()['then'](respondWithResult(_0x2ad1ea,null))['catch'](handleError(_0x2ad1ea,null));};exports[_0xd8cc('0x4b')]=function(_0x18d1e1,_0xf3b8b7,_0x1bd450){var _0xb4541a=require('../../components/encryptor');var _0x3227cf=![];var _0x1aa165={};if(_0x18d1e1['query'][_0xd8cc('0x29')]&&_0x18d1e1[_0xd8cc('0x30')]['type']===_0xd8cc('0x4c')){_0x1aa165['uniqueid']=_0x18d1e1[_0xd8cc('0x44')]['id'];}else{_0x1aa165['id']=_0x18d1e1[_0xd8cc('0x44')]['id'];}return db['VoiceRecording'][_0xd8cc('0x47')]({'where':_0x1aa165,'attributes':['id',_0xd8cc('0x4d')],'raw':!![]})[_0xd8cc('0x1f')](handleEntityNotFound(_0xf3b8b7,null))[_0xd8cc('0x1f')](function(_0x2e94e1){if(_0x2e94e1){var _0x5d221e=_0x2e94e1[_0xd8cc('0x4d')];var _0x143ad0=util[_0xd8cc('0x2e')](_0xd8cc('0x4e'),_0x5d221e);if(fs[_0xd8cc('0x4f')](_0x143ad0)){_0x3227cf=!![];return _0xb4541a['decryptFile'](_0x143ad0,_0x5d221e,config[_0xd8cc('0x50')][_0xd8cc('0x51')])[_0xd8cc('0x1f')](function(){return _0x2e94e1;});}return _0x2e94e1;}})['then'](function(_0x2f42ac){if(_0x2f42ac){var _0x33c476=_0x2f42ac[_0xd8cc('0x4d')];if(!fs[_0xd8cc('0x4f')](_0x33c476)){throw new db['Sequelize'][(_0xd8cc('0x52'))]('VoiceRecording\x20not\x20found');}if(_0x2f42ac[_0xd8cc('0x53')]){return _0xf3b8b7[_0xd8cc('0x4b')](_0x33c476,_0x2f42ac['filename']+path['extname'](_0x33c476),function(){if(_0x3227cf){fs[_0xd8cc('0x54')](_0x33c476);}});}else{return _0xf3b8b7[_0xd8cc('0x4b')](_0x33c476,function(_0x3db546){if(_0x3227cf){fs[_0xd8cc('0x54')](_0x33c476);}});}}})[_0xd8cc('0x42')](function(_0x152181){if(_0x152181[_0xd8cc('0x55')]===_0xd8cc('0x56')){_0xf3b8b7['status'](0x194)[_0xd8cc('0x25')](_0xd8cc('0x57'));}else{return handleError(_0xf3b8b7,null);}});};exports[_0xd8cc('0x58')]=function(_0x2b3a1d,_0x290842,_0x430de3){var _0x1918c5=require('../../components/encryptor');var _0x3d3467=![];var _0x2d9b83={'$and':[db[_0xd8cc('0x59')][_0xd8cc('0x39')](db[_0xd8cc('0x59')]['fn']('MD5',db[_0xd8cc('0x59')][_0xd8cc('0x5a')](_0xd8cc('0x4c'))),_0x2b3a1d['query'][_0xd8cc('0x5b')])]};if(_0x2b3a1d[_0xd8cc('0x30')][_0xd8cc('0x29')]&&_0x2b3a1d[_0xd8cc('0x30')]['type']===_0xd8cc('0x4c')){_0x2d9b83[_0xd8cc('0x5c')]['push']({'uniqueid':_0x2b3a1d[_0xd8cc('0x44')]['id']});}else{_0x2d9b83[_0xd8cc('0x5c')]['push']({'id':_0x2b3a1d[_0xd8cc('0x44')]['id']});}return db[_0xd8cc('0x27')][_0xd8cc('0x47')]({'where':_0x2d9b83,'attributes':['id',_0xd8cc('0x4d')],'raw':!![]})[_0xd8cc('0x1f')](handleEntityNotFound(_0x290842,null))['then'](function(_0x475ff2){if(_0x475ff2){var _0x3ca811=util[_0xd8cc('0x2e')](_0xd8cc('0x4e'),_0x475ff2[_0xd8cc('0x4d')]);if(fs[_0xd8cc('0x4f')](_0x3ca811)){_0x3d3467=!![];return _0x1918c5[_0xd8cc('0x5d')](_0x3ca811,_0x475ff2[_0xd8cc('0x4d')],config[_0xd8cc('0x50')][_0xd8cc('0x51')])[_0xd8cc('0x1f')](function(){return _0x475ff2;});}return _0x475ff2;}})[_0xd8cc('0x1f')](function(_0x1401c5){if(_0x1401c5){if(!fs[_0xd8cc('0x4f')](_0x1401c5[_0xd8cc('0x4d')])){throw new db['Sequelize']['ValidationError'](_0xd8cc('0x56'));}if(_0x1401c5[_0xd8cc('0x53')]){return _0x290842['download'](_0x1401c5[_0xd8cc('0x4d')],_0x1401c5[_0xd8cc('0x53')]+path['extname'](_0x1401c5[_0xd8cc('0x4d')]),function(){if(_0x3d3467){fs['unlink'](_0x1401c5[_0xd8cc('0x4d')]);}});}else{return _0x290842[_0xd8cc('0x4b')](_0x1401c5['value'],function(_0x1b27fe){if(_0x3d3467){fs['unlink'](_0x1401c5[_0xd8cc('0x4d')]);}});}}})[_0xd8cc('0x42')](handleError(_0x290842,null));};exports['destroy']=function(_0x2c3da1,_0x12c4b9){return db['VoiceRecording']['find']({'where':{'id':_0x2c3da1['params']['id']}})[_0xd8cc('0x1f')](function(_0x3b228c){if(!_0x3b228c)throw new ReferenceError(_0xd8cc('0x5e'));return _0x3b228c;})[_0xd8cc('0x1f')](function(_0xbb79fe){var _0x5d9f57=_0xbb79fe[_0xd8cc('0x4d')];logger[_0xd8cc('0x5f')]('cancellazione\x20fisica\x20documento\x20%s',_0x5d9f57);if(!_['isNil'](_0xbb79fe[_0xd8cc('0x4d')])&&fs[_0xd8cc('0x4f')](_0x5d9f57)){logger[_0xd8cc('0x5f')]('File:\x20\x22'+_0x5d9f57+'\x22\x20trovato\x20eseguo\x20la\x20cancellazione');fs['unlinkSync'](_0x5d9f57);}_0x5d9f57=_0x5d9f57+'.cypher';if(!_[_0xd8cc('0x60')](_0xbb79fe['value'])&&fs[_0xd8cc('0x4f')](_0x5d9f57)){logger[_0xd8cc('0x5f')](_0xd8cc('0x61')+_0x5d9f57+_0xd8cc('0x62'));fs[_0xd8cc('0x63')](_0x5d9f57);}return _0xbb79fe;})[_0xd8cc('0x1f')](function(_0x47ae02){if(!_0x47ae02)throw new InternalError();return _0x47ae02['destroy']();})['then'](function(){_0x12c4b9['status'](0xcc)[_0xd8cc('0x15')]();})[_0xd8cc('0x42')](handleError(_0x12c4b9,null));};
\ No newline at end of file
diff --git a/server/api/voiceRecording/voiceRecording.model.js b/server/api/voiceRecording/voiceRecording.model.js
index 2889504..50003ad 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 _0x8583=['path','rimraf','../../config/environment','./voiceRecording.attributes','exports','VoiceRecording','uniqueid','lodash','../../config/logger','api','moment','bluebird','request-promise'];(function(_0x3dd15e,_0x1f0015){var _0x231fd0=function(_0x4f680a){while(--_0x4f680a){_0x3dd15e['push'](_0x3dd15e['shift']());}};_0x231fd0(++_0x1f0015);}(_0x8583,0xbd));var _0x3858=function(_0x321bb2,_0x202794){_0x321bb2=_0x321bb2-0x0;var _0x9c12ed=_0x8583[_0x321bb2];return _0x9c12ed;};'use strict';var _=require(_0x3858('0x0'));var util=require('util');var logger=require(_0x3858('0x1'))(_0x3858('0x2'));var moment=require(_0x3858('0x3'));var BPromise=require(_0x3858('0x4'));var rp=require(_0x3858('0x5'));var fs=require('fs');var path=require(_0x3858('0x6'));var rimraf=require(_0x3858('0x7'));var config=require(_0x3858('0x8'));var attributes=require(_0x3858('0x9'));module[_0x3858('0xa')]=function(_0x331691,_0x23a579){return _0x331691['define'](_0x3858('0xb'),attributes,{'tableName':'voice_recordings','paranoid':![],'indexes':[{'name':'uniqueid','fields':[_0x3858('0xc')]}],'timestamps':!![]});};
\ No newline at end of file
+var _0x6686=['voice_recordings','uniqueid','lodash','../../config/logger','api','moment','path','rimraf','../../config/environment','./voiceRecording.attributes','define','VoiceRecording'];(function(_0x3f0b30,_0x159bc8){var _0x2748a5=function(_0x3b42cc){while(--_0x3b42cc){_0x3f0b30['push'](_0x3f0b30['shift']());}};_0x2748a5(++_0x159bc8);}(_0x6686,0x122));var _0x6668=function(_0x4c9d1f,_0x273d59){_0x4c9d1f=_0x4c9d1f-0x0;var _0x24fe45=_0x6686[_0x4c9d1f];return _0x24fe45;};'use strict';var _=require(_0x6668('0x0'));var util=require('util');var logger=require(_0x6668('0x1'))(_0x6668('0x2'));var moment=require(_0x6668('0x3'));var BPromise=require('bluebird');var rp=require('request-promise');var fs=require('fs');var path=require(_0x6668('0x4'));var rimraf=require(_0x6668('0x5'));var config=require(_0x6668('0x6'));var attributes=require(_0x6668('0x7'));module['exports']=function(_0x348f3a,_0x431f95){return _0x348f3a[_0x6668('0x8')](_0x6668('0x9'),attributes,{'tableName':_0x6668('0xa'),'paranoid':![],'indexes':[{'name':'uniqueid','fields':[_0x6668('0xb')]}],'timestamps':!![]});};
\ No newline at end of file
diff --git a/server/api/voiceRecording/voiceRecording.rpc.js b/server/api/voiceRecording/voiceRecording.rpc.js
index c63f3bc..2a1feb4 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(_0x3176d6,_0x27ef13){var _0x4ec505=function(_0x5d743c){while(--_0x5d743c){_0x3176d6['push'](_0x3176d6['shift']());}};_0x4ec505(++_0x27ef13);}(_0xa9e0,0x123));var _0x0a9e=function(_0x3a6efd,_0x2a5102){_0x3a6efd=_0x3a6efd-0x0;var _0x487b9a=_0xa9e0[_0x3a6efd];return _0x487b9a;};'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(_0x21b99d,_0x46fbc9){var _0x31335a=function(_0x3985a8){while(--_0x3985a8){_0x21b99d['push'](_0x21b99d['shift']());}};_0x31335a(++_0x46fbc9);}(_0xa9e0,0x123));var _0x0a9e=function(_0x5c351c,_0x2046d8){_0x5c351c=_0x5c351c-0x0;var _0x26f3b3=_0xa9e0[_0x5c351c];return _0x26f3b3;};'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 1127678..f46f5c2 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 _0xeda8=['isAuthenticated','index','/:id','show','post','create','delete','exports','multer','util','connect-timeout','express','Router','../../components/auth/service','../../components/interaction/service','../../config/environment','./voiceTransferReport.controller','get'];(function(_0x2f724d,_0x513f00){var _0x118309=function(_0x52539e){while(--_0x52539e){_0x2f724d['push'](_0x2f724d['shift']());}};_0x118309(++_0x513f00);}(_0xeda8,0x104));var _0x8eda=function(_0x56e147,_0x4679ed){_0x56e147=_0x56e147-0x0;var _0x578fe0=_0xeda8[_0x56e147];return _0x578fe0;};'use strict';var multer=require(_0x8eda('0x0'));var util=require(_0x8eda('0x1'));var path=require('path');var timeout=require(_0x8eda('0x2'));var express=require(_0x8eda('0x3'));var router=express[_0x8eda('0x4')]();var auth=require(_0x8eda('0x5'));var interaction=require(_0x8eda('0x6'));var config=require(_0x8eda('0x7'));var controller=require(_0x8eda('0x8'));router[_0x8eda('0x9')]('/',auth[_0x8eda('0xa')](),controller[_0x8eda('0xb')]);router[_0x8eda('0x9')](_0x8eda('0xc'),auth['isAuthenticated'](),controller[_0x8eda('0xd')]);router[_0x8eda('0xe')]('/',auth[_0x8eda('0xa')](),controller[_0x8eda('0xf')]);router['put']('/:id',auth['isAuthenticated'](),controller['update']);router[_0x8eda('0x10')](_0x8eda('0xc'),auth[_0x8eda('0xa')](),controller['destroy']);module[_0x8eda('0x11')]=router;
\ No newline at end of file
+var _0x0295=['delete','exports','multer','connect-timeout','../../components/auth/service','../../components/interaction/service','../../config/environment','./voiceTransferReport.controller','get','isAuthenticated','index','/:id','put'];(function(_0x5cdae9,_0x5e30a9){var _0x417701=function(_0x3e0142){while(--_0x3e0142){_0x5cdae9['push'](_0x5cdae9['shift']());}};_0x417701(++_0x5e30a9);}(_0x0295,0x1f0));var _0x5029=function(_0x2f52d1,_0x36e3b1){_0x2f52d1=_0x2f52d1-0x0;var _0x3f9871=_0x0295[_0x2f52d1];return _0x3f9871;};'use strict';var multer=require(_0x5029('0x0'));var util=require('util');var path=require('path');var timeout=require(_0x5029('0x1'));var express=require('express');var router=express['Router']();var auth=require(_0x5029('0x2'));var interaction=require(_0x5029('0x3'));var config=require(_0x5029('0x4'));var controller=require(_0x5029('0x5'));router[_0x5029('0x6')]('/',auth[_0x5029('0x7')](),controller[_0x5029('0x8')]);router[_0x5029('0x6')](_0x5029('0x9'),auth['isAuthenticated'](),controller['show']);router['post']('/',auth[_0x5029('0x7')](),controller['create']);router[_0x5029('0xa')]('/:id',auth[_0x5029('0x7')](),controller['update']);router[_0x5029('0xb')](_0x5029('0x9'),auth[_0x5029('0x7')](),controller['destroy']);module[_0x5029('0xc')]=router;
\ No newline at end of file
diff --git a/server/api/voiceTransferReport/voiceTransferReport.attributes.js b/server/api/voiceTransferReport/voiceTransferReport.attributes.js
index 12c2760..83831ca 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 _0x70ec=['ENUM','blind','attended','STRING','Yes','sequelize','moment','exports'];(function(_0xf3b525,_0x419b48){var _0x1f98b3=function(_0x1050c9){while(--_0x1050c9){_0xf3b525['push'](_0xf3b525['shift']());}};_0x1f98b3(++_0x419b48);}(_0x70ec,0x125));var _0xc70e=function(_0x502c7d,_0x2f1285){_0x502c7d=_0x502c7d-0x0;var _0x30b7ed=_0x70ec[_0x502c7d];return _0x30b7ed;};'use strict';var Sequelize=require(_0xc70e('0x0'));var moment=require(_0xc70e('0x1'));module[_0xc70e('0x2')]={'type':{'type':Sequelize[_0xc70e('0x3')](_0xc70e('0x4'),_0xc70e('0x5'))},'result':{'type':Sequelize[_0xc70e('0x6')]},'transfererchannel':{'type':Sequelize[_0xc70e('0x6')]},'transferercalleridnum':{'type':Sequelize[_0xc70e('0x6')]},'transferercalleridname':{'type':Sequelize['STRING']},'transfererconnectedlinenum':{'type':Sequelize[_0xc70e('0x6')]},'transfererconnectedlinename':{'type':Sequelize['STRING']},'transfereraccountcode':{'type':Sequelize[_0xc70e('0x6')]},'transferercontext':{'type':Sequelize[_0xc70e('0x6')]},'transfererexten':{'type':Sequelize['STRING']},'transfererlinkedid':{'type':Sequelize[_0xc70e('0x6')]},'transfereechannel':{'type':Sequelize[_0xc70e('0x6')]},'transfereecalleridnum':{'type':Sequelize[_0xc70e('0x6')]},'transfereecalleridname':{'type':Sequelize[_0xc70e('0x6')]},'transfereeconnectedlinenum':{'type':Sequelize[_0xc70e('0x6')]},'transfereeconnectedlinename':{'type':Sequelize[_0xc70e('0x6')]},'transfereeaccountcode':{'type':Sequelize[_0xc70e('0x6')]},'transfereecontext':{'type':Sequelize['STRING']},'transfereeexten':{'type':Sequelize[_0xc70e('0x6')]},'transfereelinkedid':{'type':Sequelize[_0xc70e('0x6')]},'isexternal':{'type':Sequelize['ENUM'](_0xc70e('0x7'),'No')},'context':{'type':Sequelize[_0xc70e('0x6')]},'extension':{'type':Sequelize[_0xc70e('0x6')]}};
\ No newline at end of file
+var _0xff4d=['STRING','exports','ENUM','attended'];(function(_0xd446fa,_0x596d33){var _0x5561f8=function(_0x3a0dd2){while(--_0x3a0dd2){_0xd446fa['push'](_0xd446fa['shift']());}};_0x5561f8(++_0x596d33);}(_0xff4d,0xd1));var _0xdff4=function(_0x575d0,_0x45eb69){_0x575d0=_0x575d0-0x0;var _0x1a6e7b=_0xff4d[_0x575d0];return _0x1a6e7b;};'use strict';var Sequelize=require('sequelize');var moment=require('moment');module[_0xdff4('0x0')]={'type':{'type':Sequelize[_0xdff4('0x1')]('blind',_0xdff4('0x2'))},'result':{'type':Sequelize[_0xdff4('0x3')]},'transfererchannel':{'type':Sequelize[_0xdff4('0x3')]},'transferercalleridnum':{'type':Sequelize[_0xdff4('0x3')]},'transferercalleridname':{'type':Sequelize[_0xdff4('0x3')]},'transfererconnectedlinenum':{'type':Sequelize[_0xdff4('0x3')]},'transfererconnectedlinename':{'type':Sequelize[_0xdff4('0x3')]},'transfereraccountcode':{'type':Sequelize['STRING']},'transferercontext':{'type':Sequelize[_0xdff4('0x3')]},'transfererexten':{'type':Sequelize[_0xdff4('0x3')]},'transfererlinkedid':{'type':Sequelize[_0xdff4('0x3')]},'transfereechannel':{'type':Sequelize['STRING']},'transfereecalleridnum':{'type':Sequelize[_0xdff4('0x3')]},'transfereecalleridname':{'type':Sequelize[_0xdff4('0x3')]},'transfereeconnectedlinenum':{'type':Sequelize[_0xdff4('0x3')]},'transfereeconnectedlinename':{'type':Sequelize[_0xdff4('0x3')]},'transfereeaccountcode':{'type':Sequelize[_0xdff4('0x3')]},'transfereecontext':{'type':Sequelize[_0xdff4('0x3')]},'transfereeexten':{'type':Sequelize['STRING']},'transfereelinkedid':{'type':Sequelize[_0xdff4('0x3')]},'isexternal':{'type':Sequelize[_0xdff4('0x1')]('Yes','No')},'context':{'type':Sequelize[_0xdff4('0x3')]},'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 f368c74..e1ebf20 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 _0xb688=['../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','../../config/utils','../../config/environment','../../mysqldb','sendStatus','status','end','json','count','offset','set','apply','save','update','then','destroy','error','stack','send','index','VoiceTransferReport','rawAttributes','type','key','model','map','name','query','keys','filters','intersection','fields','attributes','length','hasOwnProperty','nolimit','limit','order','sort','where','filter','merge','VIRTUAL','options','includeAll','findAll','rows','params','include','find','catch','create','body','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','moment','mustache','util','path','sox','ejs','squel','crypto','jsforce','desk.js','to-csv','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs'];(function(_0x18193f,_0x50a2b0){var _0x5c776f=function(_0x2d43dc){while(--_0x2d43dc){_0x18193f['push'](_0x18193f['shift']());}};_0x5c776f(++_0x50a2b0);}(_0xb688,0xcf));var _0x8b68=function(_0x59d4ca,_0x3a340f){_0x59d4ca=_0x59d4ca-0x0;var _0x457c48=_0xb688[_0x59d4ca];return _0x457c48;};'use strict';var pdf=require('html-pdf');var emlformat=require(_0x8b68('0x0'));var rimraf=require(_0x8b68('0x1'));var zipdir=require(_0x8b68('0x2'));var jsonpatch=require(_0x8b68('0x3'));var rp=require(_0x8b68('0x4'));var moment=require(_0x8b68('0x5'));var BPromise=require('bluebird');var Mustache=require(_0x8b68('0x6'));var util=require(_0x8b68('0x7'));var path=require(_0x8b68('0x8'));var sox=require(_0x8b68('0x9'));var csv=require('to-csv');var ejs=require(_0x8b68('0xa'));var fs=require('fs');var _=require('lodash');var squel=require(_0x8b68('0xb'));var crypto=require(_0x8b68('0xc'));var jsforce=require(_0x8b68('0xd'));var deskjs=require(_0x8b68('0xe'));var toCsv=require(_0x8b68('0xf'));var querystring=require(_0x8b68('0x10'));var Papa=require(_0x8b68('0x11'));var Redis=require(_0x8b68('0x12'));var authService=require(_0x8b68('0x13'));var qs=require(_0x8b68('0x14'));var as=require(_0x8b68('0x15'));var hardwareService=require(_0x8b68('0x16'));var logger=require(_0x8b68('0x17'))('api');var utils=require(_0x8b68('0x18'));var config=require(_0x8b68('0x19'));var db=require(_0x8b68('0x1a'))['db'];function respondWithStatusCode(_0x2d8472,_0x1965cf){_0x1965cf=_0x1965cf||0xcc;return function(_0x2f3af4){if(_0x2f3af4){return _0x2d8472[_0x8b68('0x1b')](_0x1965cf);}return _0x2d8472[_0x8b68('0x1c')](_0x1965cf)[_0x8b68('0x1d')]();};}function respondWithResult(_0x5b4364,_0xb2df35){_0xb2df35=_0xb2df35||0xc8;return function(_0x509033){if(_0x509033){return _0x5b4364['status'](_0xb2df35)[_0x8b68('0x1e')](_0x509033);}};}function respondWithFilteredResult(_0x1554d6,_0x27d717){return function(_0x5d3468){if(_0x5d3468){var _0x5c8d0e=_0x5d3468[_0x8b68('0x1f')],_0x23bd52=_0x27d717[_0x8b68('0x20')],_0x5c1e44=_0x27d717[_0x8b68('0x20')]+_0x27d717['limit'],_0x136f1b;if(_0x5c1e44>=_0x5c8d0e){_0x5c1e44=_0x5c8d0e;_0x136f1b=0xc8;}else{_0x136f1b=0xce;}_0x1554d6[_0x8b68('0x1c')](_0x136f1b);return _0x1554d6[_0x8b68('0x21')]('Content-Range',_0x23bd52+'-'+_0x5c1e44+'/'+_0x5c8d0e)[_0x8b68('0x1e')](_0x5d3468);}return null;};}function patchUpdates(_0x3c7e5a){return function(_0x3cf3bd){try{jsonpatch[_0x8b68('0x22')](_0x3cf3bd,_0x3c7e5a,!![]);}catch(_0x38b7a7){return BPromise['reject'](_0x38b7a7);}return _0x3cf3bd[_0x8b68('0x23')]();};}function saveUpdates(_0x4b4b0f,_0x59e9b1){return function(_0x1a9788){if(_0x1a9788){return _0x1a9788[_0x8b68('0x24')](_0x4b4b0f)[_0x8b68('0x25')](function(_0x5603d4){return _0x5603d4;});}return null;};}function removeEntity(_0x571adf,_0x23edc1){return function(_0x59cb26){if(_0x59cb26){return _0x59cb26[_0x8b68('0x26')]()[_0x8b68('0x25')](function(){_0x571adf[_0x8b68('0x1c')](0xcc)[_0x8b68('0x1d')]();});}};}function handleEntityNotFound(_0x32ddc5,_0x173524){return function(_0x59bb8a){if(!_0x59bb8a){_0x32ddc5[_0x8b68('0x1b')](0x194);}return _0x59bb8a;};}function handleError(_0x46e827,_0x4ca77d){_0x4ca77d=_0x4ca77d||0x1f4;return function(_0x1c5808){logger[_0x8b68('0x27')](_0x1c5808[_0x8b68('0x28')]);if(_0x1c5808['name']){delete _0x1c5808['name'];}_0x46e827['status'](_0x4ca77d)[_0x8b68('0x29')](_0x1c5808);};}exports[_0x8b68('0x2a')]=function(_0x2ba2a3,_0x583476){var _0x3311c7={},_0x53aaa2={},_0x4cf89d={'count':0x0,'rows':[]};var _0x3865ea=_['map'](db[_0x8b68('0x2b')][_0x8b68('0x2c')],function(_0x48e2c8){return{'name':_0x48e2c8['fieldName'],'type':_0x48e2c8[_0x8b68('0x2d')][_0x8b68('0x2e')]};});_0x53aaa2[_0x8b68('0x2f')]=_[_0x8b68('0x30')](_0x3865ea,_0x8b68('0x31'));_0x53aaa2[_0x8b68('0x32')]=_[_0x8b68('0x33')](_0x2ba2a3['query']);_0x53aaa2[_0x8b68('0x34')]=_['intersection'](_0x53aaa2[_0x8b68('0x2f')],_0x53aaa2[_0x8b68('0x32')]);_0x3311c7['attributes']=_[_0x8b68('0x35')](_0x53aaa2[_0x8b68('0x2f')],qs[_0x8b68('0x36')](_0x2ba2a3['query']['fields']));_0x3311c7[_0x8b68('0x37')]=_0x3311c7[_0x8b68('0x37')][_0x8b68('0x38')]?_0x3311c7[_0x8b68('0x37')]:_0x53aaa2[_0x8b68('0x2f')];if(!_0x2ba2a3[_0x8b68('0x32')][_0x8b68('0x39')](_0x8b68('0x3a'))){_0x3311c7[_0x8b68('0x3b')]=qs[_0x8b68('0x3b')](_0x2ba2a3[_0x8b68('0x32')][_0x8b68('0x3b')]);_0x3311c7[_0x8b68('0x20')]=qs[_0x8b68('0x20')](_0x2ba2a3[_0x8b68('0x32')][_0x8b68('0x20')]);}_0x3311c7[_0x8b68('0x3c')]=qs[_0x8b68('0x3d')](_0x2ba2a3[_0x8b68('0x32')][_0x8b68('0x3d')]);_0x3311c7[_0x8b68('0x3e')]=qs[_0x8b68('0x34')](_['pick'](_0x2ba2a3['query'],_0x53aaa2[_0x8b68('0x34')]));if(_0x2ba2a3[_0x8b68('0x32')][_0x8b68('0x3f')]){_0x3311c7[_0x8b68('0x3e')]=_[_0x8b68('0x40')](_0x3311c7[_0x8b68('0x3e')],{'$or':_[_0x8b68('0x30')](_0x3865ea,function(_0x43feb3){if(_0x43feb3['type']!==_0x8b68('0x41')){var _0x2c94d0={};_0x2c94d0[_0x43feb3[_0x8b68('0x31')]]={'$like':'%'+_0x2ba2a3[_0x8b68('0x32')][_0x8b68('0x3f')]+'%'};return _0x2c94d0;}})});}_0x3311c7=_[_0x8b68('0x40')]({},_0x3311c7,_0x2ba2a3[_0x8b68('0x42')]);var _0x2dd264={'where':_0x3311c7['where']};return db[_0x8b68('0x2b')][_0x8b68('0x1f')](_0x2dd264)[_0x8b68('0x25')](function(_0x374a7c){_0x4cf89d[_0x8b68('0x1f')]=_0x374a7c;if(_0x2ba2a3[_0x8b68('0x32')][_0x8b68('0x43')]){_0x3311c7['include']=[{'all':!![]}];}return db[_0x8b68('0x2b')][_0x8b68('0x44')](_0x3311c7);})['then'](function(_0x14ec40){_0x4cf89d[_0x8b68('0x45')]=_0x14ec40;return _0x4cf89d;})['then'](respondWithFilteredResult(_0x583476,_0x3311c7))['catch'](handleError(_0x583476,null));};exports['show']=function(_0x4a093e,_0x423194){var _0x23d24a={'raw':!![],'where':{'id':_0x4a093e[_0x8b68('0x46')]['id']}},_0x515815={};_0x515815['model']=_[_0x8b68('0x33')](db[_0x8b68('0x2b')]['rawAttributes']);_0x515815[_0x8b68('0x32')]=_['keys'](_0x4a093e['query']);_0x515815['filters']=_[_0x8b68('0x35')](_0x515815[_0x8b68('0x2f')],_0x515815[_0x8b68('0x32')]);_0x23d24a[_0x8b68('0x37')]=_['intersection'](_0x515815[_0x8b68('0x2f')],qs['fields'](_0x4a093e[_0x8b68('0x32')][_0x8b68('0x36')]));_0x23d24a['attributes']=_0x23d24a[_0x8b68('0x37')][_0x8b68('0x38')]?_0x23d24a[_0x8b68('0x37')]:_0x515815[_0x8b68('0x2f')];if(_0x4a093e['query'][_0x8b68('0x43')]){_0x23d24a[_0x8b68('0x47')]=[{'all':!![]}];}_0x23d24a=_[_0x8b68('0x40')]({},_0x23d24a,_0x4a093e[_0x8b68('0x42')]);return db[_0x8b68('0x2b')][_0x8b68('0x48')](_0x23d24a)[_0x8b68('0x25')](handleEntityNotFound(_0x423194,null))[_0x8b68('0x25')](respondWithResult(_0x423194,null))[_0x8b68('0x49')](handleError(_0x423194,null));};exports[_0x8b68('0x4a')]=function(_0x1ec2c4,_0x2a2a99){return db[_0x8b68('0x2b')][_0x8b68('0x4a')](_0x1ec2c4[_0x8b68('0x4b')],{})[_0x8b68('0x25')](respondWithResult(_0x2a2a99,0xc9))['catch'](handleError(_0x2a2a99,null));};exports[_0x8b68('0x24')]=function(_0x20681a,_0x5dd099){if(_0x20681a[_0x8b68('0x4b')]['id']){delete _0x20681a['body']['id'];}return db['VoiceTransferReport']['find']({'where':{'id':_0x20681a[_0x8b68('0x46')]['id']}})[_0x8b68('0x25')](handleEntityNotFound(_0x5dd099,null))[_0x8b68('0x25')](saveUpdates(_0x20681a[_0x8b68('0x4b')],null))['then'](respondWithResult(_0x5dd099,null))['catch'](handleError(_0x5dd099,null));};exports[_0x8b68('0x26')]=function(_0x163fd5,_0x1e900f){return db['VoiceTransferReport'][_0x8b68('0x48')]({'where':{'id':_0x163fd5[_0x8b68('0x46')]['id']}})['then'](handleEntityNotFound(_0x1e900f,null))[_0x8b68('0x25')](removeEntity(_0x1e900f,null))[_0x8b68('0x49')](handleError(_0x1e900f,null));};
\ No newline at end of file
+var _0xbdb7=['filters','intersection','attributes','length','hasOwnProperty','order','sort','where','filter','merge','includeAll','include','findAll','rows','show','params','fields','options','find','catch','create','body','html-pdf','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','moment','bluebird','mustache','path','ejs','lodash','jsforce','desk.js','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','sendStatus','count','offset','limit','status','set','json','apply','reject','save','update','then','destroy','end','name','send','index','map','VoiceTransferReport','rawAttributes','fieldName','type','key','model','query','keys'];(function(_0x434008,_0x1c4e31){var _0x5cc937=function(_0xea5dad){while(--_0xea5dad){_0x434008['push'](_0x434008['shift']());}};_0x5cc937(++_0x1c4e31);}(_0xbdb7,0x12e));var _0x7bdb=function(_0x340fc7,_0x12a901){_0x340fc7=_0x340fc7-0x0;var _0x586c93=_0xbdb7[_0x340fc7];return _0x586c93;};'use strict';var pdf=require(_0x7bdb('0x0'));var emlformat=require(_0x7bdb('0x1'));var rimraf=require(_0x7bdb('0x2'));var zipdir=require(_0x7bdb('0x3'));var jsonpatch=require(_0x7bdb('0x4'));var rp=require(_0x7bdb('0x5'));var moment=require(_0x7bdb('0x6'));var BPromise=require(_0x7bdb('0x7'));var Mustache=require(_0x7bdb('0x8'));var util=require('util');var path=require(_0x7bdb('0x9'));var sox=require('sox');var csv=require('to-csv');var ejs=require(_0x7bdb('0xa'));var fs=require('fs');var _=require(_0x7bdb('0xb'));var squel=require('squel');var crypto=require('crypto');var jsforce=require(_0x7bdb('0xc'));var deskjs=require(_0x7bdb('0xd'));var toCsv=require('to-csv');var querystring=require('querystring');var Papa=require(_0x7bdb('0xe'));var Redis=require(_0x7bdb('0xf'));var authService=require(_0x7bdb('0x10'));var qs=require(_0x7bdb('0x11'));var as=require(_0x7bdb('0x12'));var hardwareService=require(_0x7bdb('0x13'));var logger=require(_0x7bdb('0x14'))(_0x7bdb('0x15'));var utils=require('../../config/utils');var config=require('../../config/environment');var db=require('../../mysqldb')['db'];function respondWithStatusCode(_0x3053d0,_0x25e3cb){_0x25e3cb=_0x25e3cb||0xcc;return function(_0x496613){if(_0x496613){return _0x3053d0[_0x7bdb('0x16')](_0x25e3cb);}return _0x3053d0['status'](_0x25e3cb)['end']();};}function respondWithResult(_0x2abca6,_0x46dd4a){_0x46dd4a=_0x46dd4a||0xc8;return function(_0x4fd91a){if(_0x4fd91a){return _0x2abca6['status'](_0x46dd4a)['json'](_0x4fd91a);}};}function respondWithFilteredResult(_0x4476ff,_0x195b2e){return function(_0xe9919f){if(_0xe9919f){var _0x25d417=_0xe9919f[_0x7bdb('0x17')],_0x31c909=_0x195b2e['offset'],_0xbde12a=_0x195b2e[_0x7bdb('0x18')]+_0x195b2e[_0x7bdb('0x19')],_0x3e96ac;if(_0xbde12a>=_0x25d417){_0xbde12a=_0x25d417;_0x3e96ac=0xc8;}else{_0x3e96ac=0xce;}_0x4476ff[_0x7bdb('0x1a')](_0x3e96ac);return _0x4476ff[_0x7bdb('0x1b')]('Content-Range',_0x31c909+'-'+_0xbde12a+'/'+_0x25d417)[_0x7bdb('0x1c')](_0xe9919f);}return null;};}function patchUpdates(_0x23e9eb){return function(_0x5b8481){try{jsonpatch[_0x7bdb('0x1d')](_0x5b8481,_0x23e9eb,!![]);}catch(_0x31f78e){return BPromise[_0x7bdb('0x1e')](_0x31f78e);}return _0x5b8481[_0x7bdb('0x1f')]();};}function saveUpdates(_0x112793,_0x5bfc35){return function(_0x49f353){if(_0x49f353){return _0x49f353[_0x7bdb('0x20')](_0x112793)[_0x7bdb('0x21')](function(_0x5daea4){return _0x5daea4;});}return null;};}function removeEntity(_0x341fe4,_0x118ea1){return function(_0x346c72){if(_0x346c72){return _0x346c72[_0x7bdb('0x22')]()[_0x7bdb('0x21')](function(){_0x341fe4['status'](0xcc)[_0x7bdb('0x23')]();});}};}function handleEntityNotFound(_0xdad53d,_0x40c447){return function(_0x3a456f){if(!_0x3a456f){_0xdad53d['sendStatus'](0x194);}return _0x3a456f;};}function handleError(_0x4d6e44,_0x3c423f){_0x3c423f=_0x3c423f||0x1f4;return function(_0x5eface){logger['error'](_0x5eface['stack']);if(_0x5eface[_0x7bdb('0x24')]){delete _0x5eface['name'];}_0x4d6e44[_0x7bdb('0x1a')](_0x3c423f)[_0x7bdb('0x25')](_0x5eface);};}exports[_0x7bdb('0x26')]=function(_0x7c09cf,_0x2a494e){var _0x523869={},_0x10e818={},_0x32242d={'count':0x0,'rows':[]};var _0x399b62=_[_0x7bdb('0x27')](db[_0x7bdb('0x28')][_0x7bdb('0x29')],function(_0x1e9996){return{'name':_0x1e9996[_0x7bdb('0x2a')],'type':_0x1e9996[_0x7bdb('0x2b')][_0x7bdb('0x2c')]};});_0x10e818[_0x7bdb('0x2d')]=_[_0x7bdb('0x27')](_0x399b62,'name');_0x10e818[_0x7bdb('0x2e')]=_[_0x7bdb('0x2f')](_0x7c09cf[_0x7bdb('0x2e')]);_0x10e818[_0x7bdb('0x30')]=_[_0x7bdb('0x31')](_0x10e818['model'],_0x10e818[_0x7bdb('0x2e')]);_0x523869[_0x7bdb('0x32')]=_[_0x7bdb('0x31')](_0x10e818[_0x7bdb('0x2d')],qs['fields'](_0x7c09cf['query']['fields']));_0x523869[_0x7bdb('0x32')]=_0x523869['attributes'][_0x7bdb('0x33')]?_0x523869['attributes']:_0x10e818[_0x7bdb('0x2d')];if(!_0x7c09cf[_0x7bdb('0x2e')][_0x7bdb('0x34')]('nolimit')){_0x523869[_0x7bdb('0x19')]=qs['limit'](_0x7c09cf['query'][_0x7bdb('0x19')]);_0x523869['offset']=qs[_0x7bdb('0x18')](_0x7c09cf['query']['offset']);}_0x523869[_0x7bdb('0x35')]=qs[_0x7bdb('0x36')](_0x7c09cf[_0x7bdb('0x2e')][_0x7bdb('0x36')]);_0x523869[_0x7bdb('0x37')]=qs[_0x7bdb('0x30')](_['pick'](_0x7c09cf[_0x7bdb('0x2e')],_0x10e818[_0x7bdb('0x30')]));if(_0x7c09cf[_0x7bdb('0x2e')][_0x7bdb('0x38')]){_0x523869[_0x7bdb('0x37')]=_[_0x7bdb('0x39')](_0x523869[_0x7bdb('0x37')],{'$or':_[_0x7bdb('0x27')](_0x399b62,function(_0xde82a0){if(_0xde82a0['type']!=='VIRTUAL'){var _0x19c237={};_0x19c237[_0xde82a0[_0x7bdb('0x24')]]={'$like':'%'+_0x7c09cf[_0x7bdb('0x2e')][_0x7bdb('0x38')]+'%'};return _0x19c237;}})});}_0x523869=_[_0x7bdb('0x39')]({},_0x523869,_0x7c09cf['options']);var _0x55f020={'where':_0x523869[_0x7bdb('0x37')]};return db['VoiceTransferReport'][_0x7bdb('0x17')](_0x55f020)['then'](function(_0x212b50){_0x32242d['count']=_0x212b50;if(_0x7c09cf['query'][_0x7bdb('0x3a')]){_0x523869[_0x7bdb('0x3b')]=[{'all':!![]}];}return db[_0x7bdb('0x28')][_0x7bdb('0x3c')](_0x523869);})[_0x7bdb('0x21')](function(_0x2b4829){_0x32242d[_0x7bdb('0x3d')]=_0x2b4829;return _0x32242d;})['then'](respondWithFilteredResult(_0x2a494e,_0x523869))['catch'](handleError(_0x2a494e,null));};exports[_0x7bdb('0x3e')]=function(_0x206888,_0x2dbb43){var _0x3509e4={'raw':!![],'where':{'id':_0x206888[_0x7bdb('0x3f')]['id']}},_0x39fbca={};_0x39fbca[_0x7bdb('0x2d')]=_['keys'](db['VoiceTransferReport'][_0x7bdb('0x29')]);_0x39fbca[_0x7bdb('0x2e')]=_[_0x7bdb('0x2f')](_0x206888[_0x7bdb('0x2e')]);_0x39fbca['filters']=_[_0x7bdb('0x31')](_0x39fbca['model'],_0x39fbca[_0x7bdb('0x2e')]);_0x3509e4[_0x7bdb('0x32')]=_[_0x7bdb('0x31')](_0x39fbca[_0x7bdb('0x2d')],qs[_0x7bdb('0x40')](_0x206888[_0x7bdb('0x2e')][_0x7bdb('0x40')]));_0x3509e4[_0x7bdb('0x32')]=_0x3509e4[_0x7bdb('0x32')]['length']?_0x3509e4[_0x7bdb('0x32')]:_0x39fbca[_0x7bdb('0x2d')];if(_0x206888['query'][_0x7bdb('0x3a')]){_0x3509e4['include']=[{'all':!![]}];}_0x3509e4=_[_0x7bdb('0x39')]({},_0x3509e4,_0x206888[_0x7bdb('0x41')]);return db[_0x7bdb('0x28')][_0x7bdb('0x42')](_0x3509e4)[_0x7bdb('0x21')](handleEntityNotFound(_0x2dbb43,null))['then'](respondWithResult(_0x2dbb43,null))[_0x7bdb('0x43')](handleError(_0x2dbb43,null));};exports[_0x7bdb('0x44')]=function(_0x12d889,_0x3eda2e){return db[_0x7bdb('0x28')]['create'](_0x12d889[_0x7bdb('0x45')],{})[_0x7bdb('0x21')](respondWithResult(_0x3eda2e,0xc9))[_0x7bdb('0x43')](handleError(_0x3eda2e,null));};exports[_0x7bdb('0x20')]=function(_0x259007,_0x25c534){if(_0x259007[_0x7bdb('0x45')]['id']){delete _0x259007[_0x7bdb('0x45')]['id'];}return db[_0x7bdb('0x28')][_0x7bdb('0x42')]({'where':{'id':_0x259007['params']['id']}})[_0x7bdb('0x21')](handleEntityNotFound(_0x25c534,null))['then'](saveUpdates(_0x259007['body'],null))[_0x7bdb('0x21')](respondWithResult(_0x25c534,null))[_0x7bdb('0x43')](handleError(_0x25c534,null));};exports['destroy']=function(_0x37780a,_0x186809){return db['VoiceTransferReport']['find']({'where':{'id':_0x37780a['params']['id']}})[_0x7bdb('0x21')](handleEntityNotFound(_0x186809,null))[_0x7bdb('0x21')](removeEntity(_0x186809,null))[_0x7bdb('0x43')](handleError(_0x186809,null));};
\ No newline at end of file
diff --git a/server/api/voiceTransferReport/voiceTransferReport.model.js b/server/api/voiceTransferReport/voiceTransferReport.model.js
index fdae107..390ae10 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 _0x1849=['../../config/logger','api','moment','bluebird','request-promise','path','rimraf','../../config/environment','exports','VoiceTransferReport','report_call_transfer','lodash','util'];(function(_0x4687df,_0x12099c){var _0x32eaef=function(_0x2387db){while(--_0x2387db){_0x4687df['push'](_0x4687df['shift']());}};_0x32eaef(++_0x12099c);}(_0x1849,0x19e));var _0x9184=function(_0x1facfa,_0x1acf7d){_0x1facfa=_0x1facfa-0x0;var _0x9ec701=_0x1849[_0x1facfa];return _0x9ec701;};'use strict';var _=require(_0x9184('0x0'));var util=require(_0x9184('0x1'));var logger=require(_0x9184('0x2'))(_0x9184('0x3'));var moment=require(_0x9184('0x4'));var BPromise=require(_0x9184('0x5'));var rp=require(_0x9184('0x6'));var fs=require('fs');var path=require(_0x9184('0x7'));var rimraf=require(_0x9184('0x8'));var config=require(_0x9184('0x9'));var attributes=require('./voiceTransferReport.attributes');module[_0x9184('0xa')]=function(_0x167492,_0x46e346){return _0x167492['define'](_0x9184('0xb'),attributes,{'tableName':_0x9184('0xc'),'paranoid':![],'indexes':[],'timestamps':!![]});};
\ No newline at end of file
+var _0xd8a2=['moment','bluebird','request-promise','rimraf','../../config/environment','exports','VoiceTransferReport','report_call_transfer','lodash','util','../../config/logger','api'];(function(_0x211308,_0x55e902){var _0x3384bf=function(_0xa5afe8){while(--_0xa5afe8){_0x211308['push'](_0x211308['shift']());}};_0x3384bf(++_0x55e902);}(_0xd8a2,0x128));var _0x2d8a=function(_0x383c09,_0x367c2b){_0x383c09=_0x383c09-0x0;var _0x3175e6=_0xd8a2[_0x383c09];return _0x3175e6;};'use strict';var _=require(_0x2d8a('0x0'));var util=require(_0x2d8a('0x1'));var logger=require(_0x2d8a('0x2'))(_0x2d8a('0x3'));var moment=require(_0x2d8a('0x4'));var BPromise=require(_0x2d8a('0x5'));var rp=require(_0x2d8a('0x6'));var fs=require('fs');var path=require('path');var rimraf=require(_0x2d8a('0x7'));var config=require(_0x2d8a('0x8'));var attributes=require('./voiceTransferReport.attributes');module[_0x2d8a('0x9')]=function(_0x564381,_0x2c0854){return _0x564381['define'](_0x2d8a('0xa'),attributes,{'tableName':_0x2d8a('0xb'),'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 40d0359..33f6a8e 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 _0x7ec0=['util','moment','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','http','request','then','info','request\x20sent','debug','VoiceTransferReport,\x20%s,\x20%s,\x20%s','stringify','error','message','VoiceTransferReport,\x20%s,\x20%s','result','CreateVoiceTransferReport','VoiceTransferReport','body','options','raw','catch'];(function(_0x341e0f,_0x4a09d0){var _0x59555a=function(_0x4343a8){while(--_0x4343a8){_0x341e0f['push'](_0x341e0f['shift']());}};_0x59555a(++_0x4a09d0);}(_0x7ec0,0x1a4));var _0x07ec=function(_0x2b5bc8,_0x2c3ac0){_0x2b5bc8=_0x2b5bc8-0x0;var _0x17f7c9=_0x7ec0[_0x2b5bc8];return _0x17f7c9;};'use strict';var _=require('lodash');var util=require(_0x07ec('0x0'));var moment=require(_0x07ec('0x1'));var BPromise=require('bluebird');var rs=require(_0x07ec('0x2'));var fs=require('fs');var Redis=require(_0x07ec('0x3'));var db=require(_0x07ec('0x4'))['db'];var utils=require(_0x07ec('0x5'));var logger=require(_0x07ec('0x6'))(_0x07ec('0x7'));var config=require(_0x07ec('0x8'));var jayson=require(_0x07ec('0x9'));var client=jayson['client'][_0x07ec('0xa')]({'port':0x232a});function respondWithRpcPromise(_0xc7e1ca,_0x5c3fb5,_0x317658){return new BPromise(function(_0x344d2b,_0x10eed9){return client[_0x07ec('0xb')](_0xc7e1ca,_0x317658)[_0x07ec('0xc')](function(_0x2c65a9){logger[_0x07ec('0xd')]('VoiceTransferReport,\x20%s,\x20%s',_0x5c3fb5,_0x07ec('0xe'));logger[_0x07ec('0xf')](_0x07ec('0x10'),_0x5c3fb5,_0x07ec('0xe'),JSON[_0x07ec('0x11')](_0x2c65a9));if(_0x2c65a9[_0x07ec('0x12')]){if(_0x2c65a9[_0x07ec('0x12')]['code']===0x1f4){logger[_0x07ec('0x12')]('VoiceTransferReport,\x20%s,\x20%s',_0x5c3fb5,_0x2c65a9[_0x07ec('0x12')][_0x07ec('0x13')]);return _0x10eed9(_0x2c65a9[_0x07ec('0x12')]['message']);}logger[_0x07ec('0x12')](_0x07ec('0x14'),_0x5c3fb5,_0x2c65a9[_0x07ec('0x12')]['message']);return _0x344d2b(_0x2c65a9[_0x07ec('0x12')][_0x07ec('0x13')]);}else{logger[_0x07ec('0xd')](_0x07ec('0x14'),_0x5c3fb5,_0x07ec('0xe'));_0x344d2b(_0x2c65a9[_0x07ec('0x15')][_0x07ec('0x13')]);}})['catch'](function(_0x4908be){logger[_0x07ec('0x12')](_0x07ec('0x14'),_0x5c3fb5,_0x4908be);_0x10eed9(_0x4908be);});});}exports[_0x07ec('0x16')]=function(_0x29096c){var _0x3c720e=this;return new Promise(function(_0xec7d68,_0x1740fa){return db[_0x07ec('0x17')]['create'](_0x29096c[_0x07ec('0x18')],{'raw':_0x29096c[_0x07ec('0x19')]?_0x29096c['options'][_0x07ec('0x1a')]===undefined?!![]:![]:!![]})[_0x07ec('0xc')](function(_0x1d30e7){logger[_0x07ec('0xd')](_0x07ec('0x16'),_0x29096c);logger[_0x07ec('0xf')](_0x07ec('0x16'),_0x29096c,JSON[_0x07ec('0x11')](_0x1d30e7));_0xec7d68(_0x1d30e7);})[_0x07ec('0x1b')](function(_0x253cc3){logger[_0x07ec('0x12')](_0x07ec('0x16'),_0x253cc3['message'],_0x29096c);_0x1740fa(_0x3c720e[_0x07ec('0x12')](0x1f4,_0x253cc3[_0x07ec('0x13')]));});});};
\ No newline at end of file
+var _0xc35c=['request','then','info','VoiceTransferReport,\x20%s,\x20%s','request\x20sent','debug','VoiceTransferReport,\x20%s,\x20%s,\x20%s','stringify','error','code','message','result','catch','CreateVoiceTransferReport','VoiceTransferReport','body','raw','lodash','util','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','client','http'];(function(_0x597543,_0xec533b){var _0x42b2aa=function(_0x487272){while(--_0x487272){_0x597543['push'](_0x597543['shift']());}};_0x42b2aa(++_0xec533b);}(_0xc35c,0x101));var _0xcc35=function(_0x293eeb,_0x287065){_0x293eeb=_0x293eeb-0x0;var _0x2fed88=_0xc35c[_0x293eeb];return _0x2fed88;};'use strict';var _=require(_0xcc35('0x0'));var util=require(_0xcc35('0x1'));var moment=require('moment');var BPromise=require(_0xcc35('0x2'));var rs=require(_0xcc35('0x3'));var fs=require('fs');var Redis=require(_0xcc35('0x4'));var db=require(_0xcc35('0x5'))['db'];var utils=require(_0xcc35('0x6'));var logger=require(_0xcc35('0x7'))(_0xcc35('0x8'));var config=require(_0xcc35('0x9'));var jayson=require(_0xcc35('0xa'));var client=jayson[_0xcc35('0xb')][_0xcc35('0xc')]({'port':0x232a});function respondWithRpcPromise(_0x22396b,_0x5b9705,_0xe563ed){return new BPromise(function(_0x223085,_0xc4abae){return client[_0xcc35('0xd')](_0x22396b,_0xe563ed)[_0xcc35('0xe')](function(_0x368668){logger[_0xcc35('0xf')](_0xcc35('0x10'),_0x5b9705,_0xcc35('0x11'));logger[_0xcc35('0x12')](_0xcc35('0x13'),_0x5b9705,_0xcc35('0x11'),JSON[_0xcc35('0x14')](_0x368668));if(_0x368668[_0xcc35('0x15')]){if(_0x368668[_0xcc35('0x15')][_0xcc35('0x16')]===0x1f4){logger[_0xcc35('0x15')](_0xcc35('0x10'),_0x5b9705,_0x368668[_0xcc35('0x15')][_0xcc35('0x17')]);return _0xc4abae(_0x368668[_0xcc35('0x15')]['message']);}logger[_0xcc35('0x15')]('VoiceTransferReport,\x20%s,\x20%s',_0x5b9705,_0x368668[_0xcc35('0x15')][_0xcc35('0x17')]);return _0x223085(_0x368668[_0xcc35('0x15')][_0xcc35('0x17')]);}else{logger['info'](_0xcc35('0x10'),_0x5b9705,'request\x20sent');_0x223085(_0x368668[_0xcc35('0x18')][_0xcc35('0x17')]);}})[_0xcc35('0x19')](function(_0x4a4877){logger[_0xcc35('0x15')]('VoiceTransferReport,\x20%s,\x20%s',_0x5b9705,_0x4a4877);_0xc4abae(_0x4a4877);});});}exports[_0xcc35('0x1a')]=function(_0x4fefec){var _0x5c91fb=this;return new Promise(function(_0x2ae498,_0x192cfd){return db[_0xcc35('0x1b')]['create'](_0x4fefec[_0xcc35('0x1c')],{'raw':_0x4fefec['options']?_0x4fefec['options'][_0xcc35('0x1d')]===undefined?!![]:![]:!![]})[_0xcc35('0xe')](function(_0x21773f){logger[_0xcc35('0xf')](_0xcc35('0x1a'),_0x4fefec);logger[_0xcc35('0x12')](_0xcc35('0x1a'),_0x4fefec,JSON[_0xcc35('0x14')](_0x21773f));_0x2ae498(_0x21773f);})['catch'](function(_0x280743){logger[_0xcc35('0x15')](_0xcc35('0x1a'),_0x280743[_0xcc35('0x17')],_0x4fefec);_0x192cfd(_0x5c91fb[_0xcc35('0x15')](0x1f4,_0x280743[_0xcc35('0x17')]));});});};
\ No newline at end of file
diff --git a/server/app.js b/server/app.js
index 9715ccc..afc9355 100644
--- a/server/app.js
+++ b/server/app.js
@@ -15,4 +15,4 @@
// * treaties. The SOFTWARE PRODUCT is licensed, not sold. *
// * *
// *************************************************************************
-var _0x6253=['./config/license','default','Server\x20failed\x20to\x20start\x20due\x20to\x20error:\x20%s','lodash','./mysqldb','./rpc','./config/logger','./config/pm2','./config/pm2/config','./config/schedule','sync','then','listen','info','start','online','name','join','map','status','None','seedDB','./config/seedDB'];(function(_0xf8d4e2,_0x33d2a2){var _0x2f909f=function(_0x5a2fc3){while(--_0x5a2fc3){_0xf8d4e2['push'](_0xf8d4e2['shift']());}};_0x2f909f(++_0x33d2a2);}(_0x6253,0x100));var _0x3625=function(_0x2a3631,_0x388fcc){_0x2a3631=_0x2a3631-0x0;var _0x17de23=_0x6253[_0x2a3631];return _0x17de23;};'use strict';var _=require(_0x3625('0x0'));var mysqldb=require(_0x3625('0x1'));var rpc=require(_0x3625('0x2'));var config=require('./config/environment');var logger=require(_0x3625('0x3'))('app');var pm2=require(_0x3625('0x4'));var pm2Config=require(_0x3625('0x5'));var schedule=require(_0x3625('0x6'));var chat=require('./config/schedule/chat');function main(){return mysqldb['db']['sequelize'][_0x3625('0x7')]()[_0x3625('0x8')](function(){return rpc[_0x3625('0x9')]();})[_0x3625('0x8')](function(_0x5b6b7d){logger[_0x3625('0xa')](_0x5b6b7d);return chat[_0x3625('0xb')]();})['then'](function(){return schedule[_0x3625('0xb')]();})[_0x3625('0x8')](function(_0x1a7346){logger[_0x3625('0xa')](_0x1a7346);return pm2[_0x3625('0xb')](pm2Config);})[_0x3625('0x8')](function(_0x562a80){logger[_0x3625('0xa')]('Online\x20apps:',_['map'](_['filter'](_0x562a80,{'status':_0x3625('0xc')}),_0x3625('0xd'))[_0x3625('0xe')]());logger[_0x3625('0xa')]('Offline\x20apps:',_[_0x3625('0xf')](_['filter'](_0x562a80,function(_0x108224){return _0x108224[_0x3625('0x10')]!==_0x3625('0xc');}),_0x3625('0xd'))[_0x3625('0xe')]()||_0x3625('0x11'));config[_0x3625('0x12')]&&require(_0x3625('0x13'))['default']();require(_0x3625('0x14'))[_0x3625('0x15')]();})['catch'](function(_0x42dd36){logger['error'](_0x3625('0x16'),_0x42dd36);process['exit'](0x1);});}main();
\ No newline at end of file
+var _0xbf2c=['./config/pm2','./config/pm2/config','./config/schedule','./config/schedule/chat','sequelize','then','info','start','map','filter','online','name','join','None','seedDB','./config/seedDB','default','./config/license','catch','error','Server\x20failed\x20to\x20start\x20due\x20to\x20error:\x20%s','exit','./mysqldb','./rpc','./config/environment','./config/logger'];(function(_0x2ec38d,_0x392bc2){var _0x2f4ccd=function(_0x21a706){while(--_0x21a706){_0x2ec38d['push'](_0x2ec38d['shift']());}};_0x2f4ccd(++_0x392bc2);}(_0xbf2c,0x1b6));var _0xcbf2=function(_0x2b68e4,_0x156d43){_0x2b68e4=_0x2b68e4-0x0;var _0x423c29=_0xbf2c[_0x2b68e4];return _0x423c29;};'use strict';var _=require('lodash');var mysqldb=require(_0xcbf2('0x0'));var rpc=require(_0xcbf2('0x1'));var config=require(_0xcbf2('0x2'));var logger=require(_0xcbf2('0x3'))('app');var pm2=require(_0xcbf2('0x4'));var pm2Config=require(_0xcbf2('0x5'));var schedule=require(_0xcbf2('0x6'));var chat=require(_0xcbf2('0x7'));function main(){return mysqldb['db'][_0xcbf2('0x8')]['sync']()[_0xcbf2('0x9')](function(){return rpc['listen']();})[_0xcbf2('0x9')](function(_0x55f37c){logger[_0xcbf2('0xa')](_0x55f37c);return chat['start']();})[_0xcbf2('0x9')](function(){return schedule[_0xcbf2('0xb')]();})[_0xcbf2('0x9')](function(_0x437bb2){logger['info'](_0x437bb2);return pm2[_0xcbf2('0xb')](pm2Config);})['then'](function(_0x315f77){logger[_0xcbf2('0xa')]('Online\x20apps:',_[_0xcbf2('0xc')](_[_0xcbf2('0xd')](_0x315f77,{'status':_0xcbf2('0xe')}),'name')['join']());logger['info']('Offline\x20apps:',_[_0xcbf2('0xc')](_[_0xcbf2('0xd')](_0x315f77,function(_0x4aa7bf){return _0x4aa7bf['status']!==_0xcbf2('0xe');}),_0xcbf2('0xf'))[_0xcbf2('0x10')]()||_0xcbf2('0x11'));config[_0xcbf2('0x12')]&&require(_0xcbf2('0x13'))[_0xcbf2('0x14')]();require(_0xcbf2('0x15'))[_0xcbf2('0x14')]();})[_0xcbf2('0x16')](function(_0x2355e6){logger[_0xcbf2('0x17')](_0xcbf2('0x18'),_0x2355e6);process[_0xcbf2('0x19')](0x1);});}main();
\ No newline at end of file
diff --git a/server/components/auth/service.js b/server/components/auth/service.js
index b99b99b..de414f1 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 _0xc2c7=['retrieveApiKey','isNil','apiKeyIat','Please\x20use\x20the\x20previous\x20API\x20access\x20key\x20to\x20generate\x20a\x20new\x20one','promisify','secret','secrets','payload','options','verify','hex','now','toString','HS512','../../config/environment','../../config/license/hardware','lodash','jsonwebtoken','express-jwt','composable-middleware','basic-auth','crypto','session','role','fullname','userpic','permissions','md5secret','voicePause','chatPause','faxPause','smsPause','openchannelPause','pauseType','showWebBar','lastLoginAt','lastPauseAt','crudPermissions','allowmessenger','passwordResetAt','alias','phoneBarAutoAnswer','phoneBarAutoAnswerDelay','phoneBarEnableRecording','phoneBarEnableDtmfTone','phoneBarEnableSettings','phoneBarRemoteControl','phoneBarRemoteControlPort','hotdesk','userProfileId','isChatInteractionAuthorized','use','user','ChatInteraction','findOne','params','closed','disposition','then','status','unmanaged','Forbidden.','catch','isAuthenticated','authorization','headers','Basic','find','name','authenticate','pass','Wrong\x20credentials.','startsWith','Bearer','Unknown\x20authorization\x20format','query','apikey','getUuid','User','isEqual','apiKeyNonce','nonce','API\x20access\x20key\x20is\x20not\x20valid\x20anymore','json','Invalid\x20API\x20access\x20key','User\x20object\x20not\x20found.','canUpdate','../../config/license/util','getLicense','Forbidden','isMiddleware','signToken','setTokenCookie','It\x20looks\x20like\x20you\x20aren\x27t\x20logged\x20in,\x20please\x20try\x20again.','cookie','motion.token','/dashboards/general','send'];(function(_0x3b1296,_0x1616ea){var _0x2c520f=function(_0x2d896f){while(--_0x2d896f){_0x3b1296['push'](_0x3b1296['shift']());}};_0x2c520f(++_0x1616ea);}(_0xc2c7,0x134));var _0x7c2c=function(_0x410228,_0x48dec0){_0x410228=_0x410228-0x0;var _0x22cf87=_0xc2c7[_0x410228];return _0x22cf87;};'use strict';var db=require('../../mysqldb')['db'];var config=require(_0x7c2c('0x0'));var hardwareConf=require(_0x7c2c('0x1'));var _=require(_0x7c2c('0x2'));var jwt=require(_0x7c2c('0x3'));var expressJwt=require(_0x7c2c('0x4'));var compose=require(_0x7c2c('0x5'));var basicAuth=require(_0x7c2c('0x6'));var crypto=require(_0x7c2c('0x7'));var BPromise=require('bluebird');var validateJwt=expressJwt({'secret':config['secrets'][_0x7c2c('0x8')]});var userAttributes=['id',_0x7c2c('0x9'),_0x7c2c('0xa'),'name','internal','email',_0x7c2c('0xb'),_0x7c2c('0xc'),_0x7c2c('0xd'),_0x7c2c('0xe'),_0x7c2c('0xf'),'mailPause',_0x7c2c('0x10'),_0x7c2c('0x11'),_0x7c2c('0x12'),_0x7c2c('0x13'),_0x7c2c('0x14'),_0x7c2c('0x15'),_0x7c2c('0x16'),_0x7c2c('0x17'),_0x7c2c('0x18'),_0x7c2c('0x19'),_0x7c2c('0x1a'),_0x7c2c('0x1b'),_0x7c2c('0x1c'),_0x7c2c('0x1d'),_0x7c2c('0x1e'),_0x7c2c('0x1f'),'phoneBarExpires','phoneBarPrefixRequired',_0x7c2c('0x20'),_0x7c2c('0x21'),_0x7c2c('0x22'),'interface',_0x7c2c('0x23')];exports[_0x7c2c('0x24')]=function(){return this['isAuthenticated'](!![])[_0x7c2c('0x25')](function(_0x5a5fe2,_0x1aa355,_0x51b73c){if(_0x5a5fe2[_0x7c2c('0x26')]){_0x51b73c();}else{return db[_0x7c2c('0x27')][_0x7c2c('0x28')]({'where':{'id':_0x5a5fe2[_0x7c2c('0x29')]['id']},'attributes':['id',_0x7c2c('0x2a'),_0x7c2c('0x2b')],'raw':!![]})[_0x7c2c('0x2c')](function(_0x1ce7e1){if(_0x1ce7e1&&_0x1ce7e1[_0x7c2c('0x2a')]){return _0x1aa355[_0x7c2c('0x2d')](_0x1ce7e1[_0x7c2c('0x2b')]===_0x7c2c('0x2e')?0x195:0x193)['json']({'message':_0x1ce7e1[_0x7c2c('0x2b')]==='unmanaged'?'Unmanaged.':_0x7c2c('0x2f')});}else{_0x51b73c();}})[_0x7c2c('0x30')](function(_0x2a9ae2){_0x51b73c(_0x2a9ae2);});}});};exports[_0x7c2c('0x31')]=function isAuthenticated(_0x41552f){return compose()[_0x7c2c('0x25')](function(_0xa84620,_0x541368,_0x10c356){if(_0xa84620['headers'][_0x7c2c('0x32')]){if(_['startsWith'](_0xa84620[_0x7c2c('0x33')][_0x7c2c('0x32')],_0x7c2c('0x34'))){var _0x481867=basicAuth(_0xa84620);db['User'][_0x7c2c('0x35')]({'where':{'name':_0x481867[_0x7c2c('0x36')]}})[_0x7c2c('0x2c')](function(_0x150690){if(!_0x150690||!_0x150690[_0x7c2c('0x37')](_0x481867[_0x7c2c('0x38')])){return _0x541368[_0x7c2c('0x2d')](0x191)['json']({'message':_0x7c2c('0x39')});}_0xa84620[_0x7c2c('0x26')]={'id':_0x150690['id']};_0x10c356();})[_0x7c2c('0x30')](function(_0x22d03f){_0x10c356(_0x22d03f);});}else if(_[_0x7c2c('0x3a')](_0xa84620[_0x7c2c('0x33')][_0x7c2c('0x32')],_0x7c2c('0x3b'))){validateJwt(_0xa84620,_0x541368,_0x10c356);}else{if(_0x41552f){_0x10c356();}else{return _0x541368[_0x7c2c('0x2d')](0x193)['json']({'message':_0x7c2c('0x3c')});}}}else if(_0xa84620[_0x7c2c('0x3d')][_0x7c2c('0x3e')]){try{var _0x720667={'audience':hardwareConf['getUuid'](),'issuer':hardwareConf[_0x7c2c('0x3f')]()};verifyJwt(_0xa84620[_0x7c2c('0x3d')][_0x7c2c('0x3e')],_0x720667)[_0x7c2c('0x2c')](function(_0x1859c2){return db[_0x7c2c('0x40')][_0x7c2c('0x35')]({'where':{'id':_0x1859c2['sub']}})[_0x7c2c('0x2c')](function(_0x1acf75){if(!_0x1acf75||!_[_0x7c2c('0x41')](_0x1acf75[_0x7c2c('0x42')],_0x1859c2[_0x7c2c('0x43')])){return _0x541368['status'](0x191)['json']({'message':_0x7c2c('0x44')});}_0xa84620['user']={'id':_0x1acf75['id']};_0x10c356();});})['catch'](function(){return _0x541368[_0x7c2c('0x2d')](0x191)[_0x7c2c('0x45')]({'message':_0x7c2c('0x46')});});}catch(_0x156c03){_0x10c356(_0x156c03);}}else if(_0x41552f){_0x10c356();}else{return _0x541368['status'](0x193)[_0x7c2c('0x45')]({'message':_0x7c2c('0x3c')});}})[_0x7c2c('0x25')](function(_0x19783d,_0x204968,_0x6ef8c4){if(_0x19783d[_0x7c2c('0x26')]){db[_0x7c2c('0x40')][_0x7c2c('0x35')]({'where':{'id':_0x19783d[_0x7c2c('0x26')]['id']},'attributes':userAttributes})[_0x7c2c('0x2c')](function(_0x442510){if(!_0x442510){return _0x204968[_0x7c2c('0x2d')](0x194)['json']({'message':'User\x20not\x20found.'});}_0x19783d[_0x7c2c('0x26')]=_0x442510;_0x6ef8c4();})['catch'](function(_0x4c421c){_0x6ef8c4(_0x4c421c);});}else if(_0x41552f){_0x6ef8c4();}else{return _0x204968['status'](0x194)[_0x7c2c('0x45')]({'message':_0x7c2c('0x47')});}});};exports[_0x7c2c('0x48')]=function canUpdate(){return compose()[_0x7c2c('0x25')](function(_0x1cf51e,_0x151eb2,_0x1f8d75){return require(_0x7c2c('0x49'))[_0x7c2c('0x4a')]()[_0x7c2c('0x2c')](function(_0x6a9b35){if(_0x6a9b35['update']){_0x1f8d75();}else{return _0x151eb2['status'](0x193)[_0x7c2c('0x45')]({'message':_0x7c2c('0x4b')});}})[_0x7c2c('0x30')](function(_0x57bead){_0x1f8d75(_0x57bead);});});};exports['isMiddleware']=function(_0x10512a,_0x19c3fb,_0x93e2a8){_0x10512a[_0x7c2c('0x4c')]=!![];return _0x93e2a8();};exports[_0x7c2c('0x4d')]=function signToken(_0x8b0dc9){return signJwt(_0x8b0dc9);};exports[_0x7c2c('0x4e')]=function(_0x2e4093,_0xe55c39){if(!_0x2e4093['user']){return _0xe55c39[_0x7c2c('0x2d')](0x194)['json']({'message':_0x7c2c('0x4f')});}var _0x322704={'payload':{'id':_0x2e4093['user']['id'],'role':_0x2e4093[_0x7c2c('0x26')]['role']},'options':{'expiresIn':0x15180}};return signJwt(_0x322704)[_0x7c2c('0x2c')](function(_0x33b2be){_0xe55c39[_0x7c2c('0x50')](_0x7c2c('0x51'),_0x33b2be);_0xe55c39['redirect'](_0x7c2c('0x52'));})['catch'](function(_0x5235c0){return _0xe55c39[_0x7c2c('0x2d')](0x1f4)[_0x7c2c('0x53')](_0x5235c0);});};exports[_0x7c2c('0x54')]=function(_0x4c239b){if(_[_0x7c2c('0x55')](_0x4c239b[_0x7c2c('0x42')])||_['isNil'](_0x4c239b[_0x7c2c('0x56')])){return null;}else{return createJwt(_0x4c239b);}};exports['generateApiKey']=function(_0xf739a8){_0xf739a8[_0x7c2c('0x42')]=generateNonce();_0xf739a8['apiKeyIat']=generateIssuedAt();return createJwt(_0xf739a8);};exports['regenerateApiKey']=function(_0x41413a,_0x1c7c2b){var _0x578b7b=_0x41413a[_0x7c2c('0x3d')]['apikey'];if(_0x578b7b){var _0x51e3b7={'nonce':_0x1c7c2b[_0x7c2c('0x42')],'iat':_0x1c7c2b[_0x7c2c('0x56')],'audience':hardwareConf[_0x7c2c('0x3f')](),'issuer':hardwareConf[_0x7c2c('0x3f')]()};return verifyJwt(_0x578b7b,_0x51e3b7)[_0x7c2c('0x2c')](function(){return generateApiKey(_0x1c7c2b);});}else{throw{'message':_0x7c2c('0x57')};}};function signJwt(_0x2b0781){var _0x20f7d9=BPromise[_0x7c2c('0x58')](jwt['sign'],{'context':jwt});var _0x57eaf8=_0x2b0781[_0x7c2c('0x59')]||config[_0x7c2c('0x5a')][_0x7c2c('0x8')];return new BPromise(function(_0x4f95a1,_0x59bdc7){_0x20f7d9(_0x2b0781[_0x7c2c('0x5b')],_0x57eaf8,_0x2b0781[_0x7c2c('0x5c')])[_0x7c2c('0x2c')](function(_0x2b79d5){_0x4f95a1(_0x2b79d5);})['catch'](function(_0x4f958d){_0x59bdc7(_0x4f958d);});});}function verifyJwt(_0x587667,_0xd71ef8,_0x36184a){var _0x1d0140=BPromise[_0x7c2c('0x58')](jwt[_0x7c2c('0x5d')],{'context':jwt});var _0x563913=_0x36184a||config[_0x7c2c('0x5a')][_0x7c2c('0x8')];return new BPromise(function(_0x50663c,_0x19621a){_0x1d0140(_0x587667,_0x563913,_0xd71ef8)['then'](function(_0xfba6a7){_0x50663c(_0xfba6a7);})[_0x7c2c('0x30')](function(_0x3427fc){_0x19621a(_0x3427fc);});});}function generateNonce(){return crypto['randomBytes'](0x10)['toString'](_0x7c2c('0x5e'));}function generateIssuedAt(){return Math['floor'](Date[_0x7c2c('0x5f')]()/0x3e8)[_0x7c2c('0x60')]();}function createJwt(_0x5a8d98){var _0x101205={'payload':{'iat':_0x5a8d98[_0x7c2c('0x56')],'nonce':_0x5a8d98['apiKeyNonce']},'options':{'algorithm':_0x7c2c('0x61'),'subject':_0x5a8d98['id'][_0x7c2c('0x60')](),'issuer':hardwareConf['getUuid'](),'audience':hardwareConf[_0x7c2c('0x3f')]()}};return signJwt(_0x101205)[_0x7c2c('0x2c')](function(_0x2901a5){return{'iat':_0x5a8d98['apiKeyIat'],'nonce':_0x5a8d98[_0x7c2c('0x42')],'token':_0x2901a5};});}
\ No newline at end of file
+var _0xdd4f=['fullname','name','internal','userpic','md5secret','voicePause','chatPause','faxPause','openchannelPause','pauseType','showWebBar','lastLoginAt','lastPauseAt','crudPermissions','allowmessenger','passwordResetAt','alias','phoneBarAutoAnswer','phoneBarAutoAnswerDelay','phoneBarEnableDtmfTone','phoneBarEnableSettings','phoneBarExpires','phoneBarRemoteControl','hotdesk','interface','userProfileId','isChatInteractionAuthorized','isAuthenticated','user','ChatInteraction','findOne','params','closed','disposition','then','status','unmanaged','json','Unmanaged.','Forbidden.','use','headers','startsWith','authorization','User','find','authenticate','pass','Wrong\x20credentials.','catch','Bearer','query','apikey','getUuid','nonce','Invalid\x20API\x20access\x20key','Unknown\x20authorization\x20format','User\x20not\x20found.','User\x20object\x20not\x20found.','canUpdate','getLicense','update','isMiddleware','signToken','setTokenCookie','cookie','motion.token','redirect','/dashboards/general','retrieveApiKey','isNil','apiKeyNonce','apiKeyIat','regenerateApiKey','Please\x20use\x20the\x20previous\x20API\x20access\x20key\x20to\x20generate\x20a\x20new\x20one','promisify','sign','secret','secrets','payload','options','randomBytes','toString','hex','floor','HS512','../../mysqldb','jsonwebtoken','express-jwt','basic-auth','crypto','bluebird','session','role'];(function(_0x29af6a,_0x5028db){var _0x3698a=function(_0x53eab1){while(--_0x53eab1){_0x29af6a['push'](_0x29af6a['shift']());}};_0x3698a(++_0x5028db);}(_0xdd4f,0x1ce));var _0xfdd4=function(_0x2911ba,_0xd8d18c){_0x2911ba=_0x2911ba-0x0;var _0x186453=_0xdd4f[_0x2911ba];return _0x186453;};'use strict';var db=require(_0xfdd4('0x0'))['db'];var config=require('../../config/environment');var hardwareConf=require('../../config/license/hardware');var _=require('lodash');var jwt=require(_0xfdd4('0x1'));var expressJwt=require(_0xfdd4('0x2'));var compose=require('composable-middleware');var basicAuth=require(_0xfdd4('0x3'));var crypto=require(_0xfdd4('0x4'));var BPromise=require(_0xfdd4('0x5'));var validateJwt=expressJwt({'secret':config['secrets'][_0xfdd4('0x6')]});var userAttributes=['id',_0xfdd4('0x7'),_0xfdd4('0x8'),_0xfdd4('0x9'),_0xfdd4('0xa'),'email',_0xfdd4('0xb'),'permissions',_0xfdd4('0xc'),_0xfdd4('0xd'),_0xfdd4('0xe'),'mailPause',_0xfdd4('0xf'),'smsPause',_0xfdd4('0x10'),_0xfdd4('0x11'),_0xfdd4('0x12'),_0xfdd4('0x13'),_0xfdd4('0x14'),_0xfdd4('0x15'),_0xfdd4('0x16'),_0xfdd4('0x17'),_0xfdd4('0x18'),_0xfdd4('0x19'),_0xfdd4('0x1a'),'phoneBarEnableRecording',_0xfdd4('0x1b'),_0xfdd4('0x1c'),_0xfdd4('0x1d'),'phoneBarPrefixRequired',_0xfdd4('0x1e'),'phoneBarRemoteControlPort',_0xfdd4('0x1f'),_0xfdd4('0x20'),_0xfdd4('0x21')];exports[_0xfdd4('0x22')]=function(){return this[_0xfdd4('0x23')](!![])['use'](function(_0x47ed1d,_0x559c77,_0x3a966d){if(_0x47ed1d[_0xfdd4('0x24')]){_0x3a966d();}else{return db[_0xfdd4('0x25')][_0xfdd4('0x26')]({'where':{'id':_0x47ed1d[_0xfdd4('0x27')]['id']},'attributes':['id',_0xfdd4('0x28'),_0xfdd4('0x29')],'raw':!![]})[_0xfdd4('0x2a')](function(_0x32e00d){if(_0x32e00d&&_0x32e00d['closed']){return _0x559c77[_0xfdd4('0x2b')](_0x32e00d[_0xfdd4('0x29')]===_0xfdd4('0x2c')?0x195:0x193)[_0xfdd4('0x2d')]({'message':_0x32e00d[_0xfdd4('0x29')]===_0xfdd4('0x2c')?_0xfdd4('0x2e'):_0xfdd4('0x2f')});}else{_0x3a966d();}})['catch'](function(_0x2147e6){_0x3a966d(_0x2147e6);});}});};exports[_0xfdd4('0x23')]=function isAuthenticated(_0x2a24e8){return compose()[_0xfdd4('0x30')](function(_0xb7856d,_0x144acd,_0x451767){if(_0xb7856d[_0xfdd4('0x31')]['authorization']){if(_[_0xfdd4('0x32')](_0xb7856d[_0xfdd4('0x31')][_0xfdd4('0x33')],'Basic')){var _0x58fe0d=basicAuth(_0xb7856d);db[_0xfdd4('0x34')][_0xfdd4('0x35')]({'where':{'name':_0x58fe0d[_0xfdd4('0x9')]}})[_0xfdd4('0x2a')](function(_0x4a8790){if(!_0x4a8790||!_0x4a8790[_0xfdd4('0x36')](_0x58fe0d[_0xfdd4('0x37')])){return _0x144acd[_0xfdd4('0x2b')](0x191)[_0xfdd4('0x2d')]({'message':_0xfdd4('0x38')});}_0xb7856d[_0xfdd4('0x24')]={'id':_0x4a8790['id']};_0x451767();})[_0xfdd4('0x39')](function(_0x37b7a2){_0x451767(_0x37b7a2);});}else if(_['startsWith'](_0xb7856d[_0xfdd4('0x31')][_0xfdd4('0x33')],_0xfdd4('0x3a'))){validateJwt(_0xb7856d,_0x144acd,_0x451767);}else{if(_0x2a24e8){_0x451767();}else{return _0x144acd[_0xfdd4('0x2b')](0x193)[_0xfdd4('0x2d')]({'message':'Unknown\x20authorization\x20format'});}}}else if(_0xb7856d[_0xfdd4('0x3b')][_0xfdd4('0x3c')]){try{var _0xbf38b4={'audience':hardwareConf[_0xfdd4('0x3d')](),'issuer':hardwareConf[_0xfdd4('0x3d')]()};verifyJwt(_0xb7856d['query'][_0xfdd4('0x3c')],_0xbf38b4)[_0xfdd4('0x2a')](function(_0x2ab99e){return db['User'][_0xfdd4('0x35')]({'where':{'id':_0x2ab99e['sub']}})[_0xfdd4('0x2a')](function(_0x2b22f9){if(!_0x2b22f9||!_['isEqual'](_0x2b22f9['apiKeyNonce'],_0x2ab99e[_0xfdd4('0x3e')])){return _0x144acd[_0xfdd4('0x2b')](0x191)['json']({'message':'API\x20access\x20key\x20is\x20not\x20valid\x20anymore'});}_0xb7856d[_0xfdd4('0x24')]={'id':_0x2b22f9['id']};_0x451767();});})[_0xfdd4('0x39')](function(){return _0x144acd[_0xfdd4('0x2b')](0x191)[_0xfdd4('0x2d')]({'message':_0xfdd4('0x3f')});});}catch(_0x265cab){_0x451767(_0x265cab);}}else if(_0x2a24e8){_0x451767();}else{return _0x144acd[_0xfdd4('0x2b')](0x193)[_0xfdd4('0x2d')]({'message':_0xfdd4('0x40')});}})[_0xfdd4('0x30')](function(_0x6ffe30,_0x12b8b1,_0xa5c90e){if(_0x6ffe30[_0xfdd4('0x24')]){db[_0xfdd4('0x34')][_0xfdd4('0x35')]({'where':{'id':_0x6ffe30[_0xfdd4('0x24')]['id']},'attributes':userAttributes})[_0xfdd4('0x2a')](function(_0x2abe77){if(!_0x2abe77){return _0x12b8b1[_0xfdd4('0x2b')](0x194)[_0xfdd4('0x2d')]({'message':_0xfdd4('0x41')});}_0x6ffe30[_0xfdd4('0x24')]=_0x2abe77;_0xa5c90e();})[_0xfdd4('0x39')](function(_0x301824){_0xa5c90e(_0x301824);});}else if(_0x2a24e8){_0xa5c90e();}else{return _0x12b8b1[_0xfdd4('0x2b')](0x194)['json']({'message':_0xfdd4('0x42')});}});};exports[_0xfdd4('0x43')]=function canUpdate(){return compose()[_0xfdd4('0x30')](function(_0x439389,_0x2850f5,_0x5842f1){return require('../../config/license/util')[_0xfdd4('0x44')]()['then'](function(_0xeca9d){if(_0xeca9d[_0xfdd4('0x45')]){_0x5842f1();}else{return _0x2850f5[_0xfdd4('0x2b')](0x193)[_0xfdd4('0x2d')]({'message':'Forbidden'});}})[_0xfdd4('0x39')](function(_0x3feb36){_0x5842f1(_0x3feb36);});});};exports[_0xfdd4('0x46')]=function(_0x2ee857,_0x35b719,_0x7e171){_0x2ee857[_0xfdd4('0x46')]=!![];return _0x7e171();};exports[_0xfdd4('0x47')]=function signToken(_0xe65944){return signJwt(_0xe65944);};exports[_0xfdd4('0x48')]=function(_0x5bcbc8,_0xa7d254){if(!_0x5bcbc8[_0xfdd4('0x24')]){return _0xa7d254[_0xfdd4('0x2b')](0x194)[_0xfdd4('0x2d')]({'message':'It\x20looks\x20like\x20you\x20aren\x27t\x20logged\x20in,\x20please\x20try\x20again.'});}var _0x3e2bda={'payload':{'id':_0x5bcbc8[_0xfdd4('0x24')]['id'],'role':_0x5bcbc8[_0xfdd4('0x24')][_0xfdd4('0x7')]},'options':{'expiresIn':0x15180}};return signJwt(_0x3e2bda)[_0xfdd4('0x2a')](function(_0x496747){_0xa7d254[_0xfdd4('0x49')](_0xfdd4('0x4a'),_0x496747);_0xa7d254[_0xfdd4('0x4b')](_0xfdd4('0x4c'));})[_0xfdd4('0x39')](function(_0x1fc778){return _0xa7d254[_0xfdd4('0x2b')](0x1f4)['send'](_0x1fc778);});};exports[_0xfdd4('0x4d')]=function(_0x586713){if(_[_0xfdd4('0x4e')](_0x586713[_0xfdd4('0x4f')])||_[_0xfdd4('0x4e')](_0x586713[_0xfdd4('0x50')])){return null;}else{return createJwt(_0x586713);}};exports['generateApiKey']=function(_0x419578){_0x419578[_0xfdd4('0x4f')]=generateNonce();_0x419578['apiKeyIat']=generateIssuedAt();return createJwt(_0x419578);};exports[_0xfdd4('0x51')]=function(_0xbfaa53,_0x48d422){var _0x218ca5=_0xbfaa53['query']['apikey'];if(_0x218ca5){var _0x4c3dbf={'nonce':_0x48d422[_0xfdd4('0x4f')],'iat':_0x48d422[_0xfdd4('0x50')],'audience':hardwareConf[_0xfdd4('0x3d')](),'issuer':hardwareConf['getUuid']()};return verifyJwt(_0x218ca5,_0x4c3dbf)[_0xfdd4('0x2a')](function(){return generateApiKey(_0x48d422);});}else{throw{'message':_0xfdd4('0x52')};}};function signJwt(_0x4d11d1){var _0x25e3c9=BPromise[_0xfdd4('0x53')](jwt[_0xfdd4('0x54')],{'context':jwt});var _0x2bb94a=_0x4d11d1[_0xfdd4('0x55')]||config[_0xfdd4('0x56')][_0xfdd4('0x6')];return new BPromise(function(_0x2bec0c,_0x393c11){_0x25e3c9(_0x4d11d1[_0xfdd4('0x57')],_0x2bb94a,_0x4d11d1[_0xfdd4('0x58')])[_0xfdd4('0x2a')](function(_0x300965){_0x2bec0c(_0x300965);})[_0xfdd4('0x39')](function(_0x55065e){_0x393c11(_0x55065e);});});}function verifyJwt(_0x4dd1a2,_0x43e631,_0x222902){var _0x1296e6=BPromise[_0xfdd4('0x53')](jwt['verify'],{'context':jwt});var _0x3c6828=_0x222902||config[_0xfdd4('0x56')]['session'];return new BPromise(function(_0x58cdab,_0x53c66d){_0x1296e6(_0x4dd1a2,_0x3c6828,_0x43e631)['then'](function(_0x557cb3){_0x58cdab(_0x557cb3);})[_0xfdd4('0x39')](function(_0x88e9ef){_0x53c66d(_0x88e9ef);});});}function generateNonce(){return crypto[_0xfdd4('0x59')](0x10)[_0xfdd4('0x5a')](_0xfdd4('0x5b'));}function generateIssuedAt(){return Math[_0xfdd4('0x5c')](Date['now']()/0x3e8)[_0xfdd4('0x5a')]();}function createJwt(_0x1f521a){var _0x1dd417={'payload':{'iat':_0x1f521a[_0xfdd4('0x50')],'nonce':_0x1f521a['apiKeyNonce']},'options':{'algorithm':_0xfdd4('0x5d'),'subject':_0x1f521a['id'][_0xfdd4('0x5a')](),'issuer':hardwareConf['getUuid'](),'audience':hardwareConf[_0xfdd4('0x3d')]()}};return signJwt(_0x1dd417)[_0xfdd4('0x2a')](function(_0x555e50){return{'iat':_0x1f521a['apiKeyIat'],'nonce':_0x1f521a[_0xfdd4('0x4f')],'token':_0x555e50};});}
\ No newline at end of file
diff --git a/server/components/encryptor/index.js b/server/components/encryptor/index.js
index 5f00805..c1bd188 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 _0xe706=['unlink','crypto','bluebird','aes192','hasOwnProperty','encryptFile','createReadStream','createWriteStream','createCipher','algorithm','data','update','end','final','binary','write','close','createDecipher'];(function(_0xb7b878,_0x5c3b92){var _0x3c84b9=function(_0x21d5a2){while(--_0x21d5a2){_0xb7b878['push'](_0xb7b878['shift']());}};_0x3c84b9(++_0x5c3b92);}(_0xe706,0xa3));var _0x6e70=function(_0x5c8736,_0x2a2a03){_0x5c8736=_0x5c8736-0x0;var _0x142bdb=_0xe706[_0x5c8736];return _0x142bdb;};'use strict';var crypto=require(_0x6e70('0x0'));var fs=require('fs');var BPromise=require(_0x6e70('0x1'));var defaultOptions={'algorithm':_0x6e70('0x2')};function combineOptions(_0x5e8446){var _0x2cae77={};for(var _0x315629 in defaultOptions){if(defaultOptions[_0x6e70('0x3')](_0x315629)){_0x2cae77[_0x315629]=defaultOptions[_0x315629];}}if(_0x5e8446){for(var _0x7dfbc3 in _0x5e8446){if(_0x5e8446[_0x6e70('0x3')](_0x7dfbc3)){_0x2cae77[_0x7dfbc3]=_0x5e8446[_0x7dfbc3];}}}return _0x2cae77;}exports[_0x6e70('0x4')]=function(_0x376a8d,_0x506db9,_0x1b0389,_0x4381d1){return new BPromise(function(_0x36357b,_0x293ce7){_0x4381d1=combineOptions(_0x4381d1);var _0x45a2d4=new Buffer(_0x1b0389);var _0x188ed3=fs[_0x6e70('0x5')](_0x376a8d);var _0x449b48=fs[_0x6e70('0x6')](_0x506db9);var _0x25e61c=crypto[_0x6e70('0x7')](_0x4381d1[_0x6e70('0x8')],_0x45a2d4);_0x188ed3['on'](_0x6e70('0x9'),function(_0x3f474a){var _0x37b3e0=new Buffer(_0x25e61c[_0x6e70('0xa')](_0x3f474a),'binary');_0x449b48['write'](_0x37b3e0);});_0x188ed3['on'](_0x6e70('0xb'),function(){try{var _0x15a1a5=new Buffer(_0x25e61c[_0x6e70('0xc')](_0x6e70('0xd')),_0x6e70('0xd'));_0x449b48[_0x6e70('0xe')](_0x15a1a5);_0x449b48[_0x6e70('0xb')]();_0x449b48['on'](_0x6e70('0xf'),function(){return _0x36357b(_0x506db9);});}catch(_0x5dfbaa){fs['unlink'](_0x506db9);return _0x293ce7(_0x5dfbaa);}});});};exports['decryptFile']=function(_0x257e81,_0x5a37a6,_0x53aed0,_0x304716){return new BPromise(function(_0x22c50c,_0x5d9263){_0x304716=combineOptions(_0x304716);var _0x24f3ac=new Buffer(_0x53aed0);var _0x5c3fe7=fs[_0x6e70('0x5')](_0x257e81);var _0x161f23=fs['createWriteStream'](_0x5a37a6);var _0x49029f=crypto[_0x6e70('0x10')](_0x304716['algorithm'],_0x24f3ac);_0x5c3fe7['on'](_0x6e70('0x9'),function(_0x173afe){var _0x53acdc=new Buffer(_0x49029f['update'](_0x173afe),_0x6e70('0xd'));_0x161f23[_0x6e70('0xe')](_0x53acdc);});_0x5c3fe7['on'](_0x6e70('0xb'),function(){try{var _0x3a9978=new Buffer(_0x49029f[_0x6e70('0xc')](_0x6e70('0xd')),_0x6e70('0xd'));_0x161f23[_0x6e70('0xe')](_0x3a9978);_0x161f23[_0x6e70('0xb')]();_0x161f23['on'](_0x6e70('0xf'),function(){return _0x22c50c(_0x5a37a6);});}catch(_0x4a0cfe){fs[_0x6e70('0x11')](_0x5a37a6);return _0x5d9263(_0x4a0cfe);}});});};
\ No newline at end of file
+var _0xe706=['unlink','crypto','bluebird','aes192','hasOwnProperty','encryptFile','createReadStream','createWriteStream','createCipher','algorithm','data','update','end','final','binary','write','close','createDecipher'];(function(_0x590a0c,_0xab1f66){var _0x32add4=function(_0x8e9352){while(--_0x8e9352){_0x590a0c['push'](_0x590a0c['shift']());}};_0x32add4(++_0xab1f66);}(_0xe706,0xa3));var _0x6e70=function(_0x5d7747,_0x55c074){_0x5d7747=_0x5d7747-0x0;var _0x291142=_0xe706[_0x5d7747];return _0x291142;};'use strict';var crypto=require(_0x6e70('0x0'));var fs=require('fs');var BPromise=require(_0x6e70('0x1'));var defaultOptions={'algorithm':_0x6e70('0x2')};function combineOptions(_0x5e8446){var _0x2cae77={};for(var _0x315629 in defaultOptions){if(defaultOptions[_0x6e70('0x3')](_0x315629)){_0x2cae77[_0x315629]=defaultOptions[_0x315629];}}if(_0x5e8446){for(var _0x7dfbc3 in _0x5e8446){if(_0x5e8446[_0x6e70('0x3')](_0x7dfbc3)){_0x2cae77[_0x7dfbc3]=_0x5e8446[_0x7dfbc3];}}}return _0x2cae77;}exports[_0x6e70('0x4')]=function(_0x376a8d,_0x506db9,_0x1b0389,_0x4381d1){return new BPromise(function(_0x36357b,_0x293ce7){_0x4381d1=combineOptions(_0x4381d1);var _0x45a2d4=new Buffer(_0x1b0389);var _0x188ed3=fs[_0x6e70('0x5')](_0x376a8d);var _0x449b48=fs[_0x6e70('0x6')](_0x506db9);var _0x25e61c=crypto[_0x6e70('0x7')](_0x4381d1[_0x6e70('0x8')],_0x45a2d4);_0x188ed3['on'](_0x6e70('0x9'),function(_0x3f474a){var _0x37b3e0=new Buffer(_0x25e61c[_0x6e70('0xa')](_0x3f474a),'binary');_0x449b48['write'](_0x37b3e0);});_0x188ed3['on'](_0x6e70('0xb'),function(){try{var _0x15a1a5=new Buffer(_0x25e61c[_0x6e70('0xc')](_0x6e70('0xd')),_0x6e70('0xd'));_0x449b48[_0x6e70('0xe')](_0x15a1a5);_0x449b48[_0x6e70('0xb')]();_0x449b48['on'](_0x6e70('0xf'),function(){return _0x36357b(_0x506db9);});}catch(_0x5dfbaa){fs['unlink'](_0x506db9);return _0x293ce7(_0x5dfbaa);}});});};exports['decryptFile']=function(_0x257e81,_0x5a37a6,_0x53aed0,_0x304716){return new BPromise(function(_0x22c50c,_0x5d9263){_0x304716=combineOptions(_0x304716);var _0x24f3ac=new Buffer(_0x53aed0);var _0x5c3fe7=fs[_0x6e70('0x5')](_0x257e81);var _0x161f23=fs['createWriteStream'](_0x5a37a6);var _0x49029f=crypto[_0x6e70('0x10')](_0x304716['algorithm'],_0x24f3ac);_0x5c3fe7['on'](_0x6e70('0x9'),function(_0x173afe){var _0x53acdc=new Buffer(_0x49029f['update'](_0x173afe),_0x6e70('0xd'));_0x161f23[_0x6e70('0xe')](_0x53acdc);});_0x5c3fe7['on'](_0x6e70('0xb'),function(){try{var _0x3a9978=new Buffer(_0x49029f[_0x6e70('0xc')](_0x6e70('0xd')),_0x6e70('0xd'));_0x161f23[_0x6e70('0xe')](_0x3a9978);_0x161f23[_0x6e70('0xb')]();_0x161f23['on'](_0x6e70('0xf'),function(){return _0x22c50c(_0x5a37a6);});}catch(_0x4a0cfe){fs[_0x6e70('0x11')](_0x5a37a6);return _0x5d9263(_0x4a0cfe);}});});};
\ No newline at end of file
diff --git a/server/components/export/csv.js b/server/components/export/csv.js
index 3616282..e817123 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 _0xd2ea=['analytics','argv','savename','update','info','format','Start\x20extraction\x20report\x20with\x20id\x20%d\x20in\x20%s\x20format','Setting','split','splitSizeCsv','then','query','SELECT','num','Empty','length','push','sequelize','QueryTypes','dirname','basename','.csv','existsSync','mkdirSync','join','each','%s%d.%s','csv','%s.%s','writeFileSync','zip','Extraction\x20report\x20with\x20id\x20%d\x20in\x20%s\x20format\x20completed','CSV','Completed','catch','inspect','util','path','lodash','to-csv','bluebird','rimraf','../../mysqldb','dbH','../../config/logger'];(function(_0x4a5089,_0xb53c00){var _0xd24ff1=function(_0x3a30eb){while(--_0x3a30eb){_0x4a5089['push'](_0x4a5089['shift']());}};_0xd24ff1(++_0xb53c00);}(_0xd2ea,0x15f));var _0xad2e=function(_0x1dcf1d,_0x54688a){_0x1dcf1d=_0x1dcf1d-0x0;var _0x2bfb56=_0xd2ea[_0x1dcf1d];return _0x2bfb56;};'use strict';var util=require(_0xad2e('0x0'));var path=require(_0xad2e('0x1'));var _=require(_0xad2e('0x2'));var csv=require(_0xad2e('0x3'));var fs=require('fs');var BPromise=require(_0xad2e('0x4'));var zipdir=require('zip-dir');var rimraf=require(_0xad2e('0x5'));var db=require(_0xad2e('0x6'))['db'];var dbH=require(_0xad2e('0x6'))[_0xad2e('0x7')];var logger=require(_0xad2e('0x8'))(_0xad2e('0x9'));var EXTRACTED_REPORT_ID=Number(process[_0xad2e('0xa')][0x2]);var QUERY=process['argv'][0x3];var PATH=process[_0xad2e('0xa')][0x4];function analyticExtractedReport(_0x3e3d1f,_0x2ff7b2){var _0x5710ac={'status':_0x3e3d1f};var _0x1e0e9e={'where':{'id':EXTRACTED_REPORT_ID}};if(_0x2ff7b2){_0x5710ac[_0xad2e('0xb')]=_0x2ff7b2;}return db['AnalyticExtractedReport'][_0xad2e('0xc')](_0x5710ac,_0x1e0e9e);}function main(){var _0x51f575=0x1388;var _0x430443;logger[_0xad2e('0xd')](util[_0xad2e('0xe')](_0xad2e('0xf'),EXTRACTED_REPORT_ID,'CSV'));return db[_0xad2e('0x10')]['find']({'where':{'id':0x1},'raw':!![],'attributes':['id',_0xad2e('0x11'),_0xad2e('0x12')]})[_0xad2e('0x13')](function(_0x42e2f2){if(_0x42e2f2){_0x430443=_0x42e2f2;_0x51f575=_0x430443['splitSizeCsv']||0x1388;}})[_0xad2e('0x13')](function(){return dbH['sequelize'][_0xad2e('0x14')](util['format']('SELECT\x20count(*)\x20as\x20num\x20FROM\x20(%s)\x20t',QUERY),{'type':dbH['sequelize']['QueryTypes'][_0xad2e('0x15')]});})[_0xad2e('0x13')](function(_0x1646d5){if(!_0x1646d5[0x0][_0xad2e('0x16')]){return analyticExtractedReport(_0xad2e('0x17'));}var _0x4180aa=[];var _0x2546e2=0x0;var _0x5941c5=!![];if(_0x1646d5&&_0x1646d5[_0xad2e('0x18')]){var _0xbc6df0=_0x1646d5[0x0][_0xad2e('0x16')]%(_0x2546e2+_0x51f575);if(_0x430443[_0xad2e('0x11')]){for(;_0x5941c5;_0x2546e2+=_0x51f575,_0xbc6df0=_0x1646d5[0x0][_0xad2e('0x16')]%(_0x2546e2+_0x51f575)){if(_0xbc6df0==0x0||_0xbc6df0==_0x1646d5[0x0][_0xad2e('0x16')]){_0x5941c5=![];}_0x4180aa[_0xad2e('0x19')](dbH['sequelize'][_0xad2e('0x14')](util[_0xad2e('0xe')]('%s\x20limit\x20%d\x20OFFSET\x20%d',QUERY,_0x51f575,_0x2546e2),{'type':dbH['sequelize']['QueryTypes']['SELECT']}));}}else{_0x4180aa[_0xad2e('0x19')](dbH[_0xad2e('0x1a')][_0xad2e('0x14')](QUERY,{'type':dbH[_0xad2e('0x1a')][_0xad2e('0x1b')][_0xad2e('0x15')]}));}}var _0x29dc4f=path[_0xad2e('0x1c')](PATH);var _0x102169=path[_0xad2e('0x1d')](PATH,_0xad2e('0x1e'));var _0x142631=_0x430443[_0xad2e('0x11')]&&_0x4180aa[_0xad2e('0x18')]>0x1;var _0x207517=[];if(!fs[_0xad2e('0x1f')](path['join'](_0x29dc4f,_0x102169))&&_0x142631){fs[_0xad2e('0x20')](path[_0xad2e('0x21')](_0x29dc4f,_0x102169));}return BPromise[_0xad2e('0x22')](_0x4180aa,function(_0x350c66){_0x207517[_0xad2e('0x19')](_0x350c66);})[_0xad2e('0x13')](function(){for(var _0x1161d5=0x0;_0x1161d5<_0x207517[_0xad2e('0x18')];_0x1161d5+=0x1){var _0xfd90a4;var _0x50d446=_0x207517[_0x1161d5];if(_0x142631){_0xfd90a4=path[_0xad2e('0x21')](_0x29dc4f,_0x102169,util['format'](_0xad2e('0x23'),_0x102169,_0x1161d5,_0xad2e('0x24')));}else{_0xfd90a4=path[_0xad2e('0x21')](_0x29dc4f,util[_0xad2e('0xe')](_0xad2e('0x25'),_0x102169,_0xad2e('0x24')));}fs[_0xad2e('0x26')](_0xfd90a4,csv(_0x50d446));}})[_0xad2e('0x13')](function(){if(_0x142631){zipdir(path[_0xad2e('0x21')](_0x29dc4f,_0x102169),{'saveTo':path[_0xad2e('0x21')](_0x29dc4f,util['format'](_0xad2e('0x25'),_0x102169,_0xad2e('0x27')))},function(_0x2a0dc7,_0x4379f4){});rimraf(path[_0xad2e('0x21')](_0x29dc4f,_0x102169),function(){});}})[_0xad2e('0x13')](function(){logger[_0xad2e('0xd')](util[_0xad2e('0xe')](_0xad2e('0x28'),EXTRACTED_REPORT_ID,_0xad2e('0x29')));return analyticExtractedReport(_0xad2e('0x2a'),_0x142631?util['format'](_0xad2e('0x25'),_0x102169,_0x142631?'zip':_0xad2e('0x24')):null);});})[_0xad2e('0x2b')](function(_0x5ac436){logger[_0xad2e('0xd')](util[_0xad2e('0xe')]('Error\x20during\x20extraction\x20report\x20with\x20id\x20%d\x20in\x20%s\x20format',EXTRACTED_REPORT_ID,_0xad2e('0x29')),util[_0xad2e('0x2c')](_0x5ac436,{'showHidden':![],'depth':null}));return analyticExtractedReport('Failed');});}main();
\ No newline at end of file
+var _0xcb91=['splitSizeCsv','then','sequelize','query','SELECT\x20count(*)\x20as\x20num\x20FROM\x20(%s)\x20t','QueryTypes','SELECT','num','length','%s\x20limit\x20%d\x20OFFSET\x20%d','basename','.csv','join','each','push','%s%d.%s','csv','%s.%s','writeFileSync','CSV','Completed','zip','catch','Error\x20during\x20extraction\x20report\x20with\x20id\x20%d\x20in\x20%s\x20format','Failed','lodash','to-csv','bluebird','zip-dir','../../mysqldb','../../config/logger','analytics','argv','savename','info','format','Start\x20extraction\x20report\x20with\x20id\x20%d\x20in\x20%s\x20format','Setting','find','split'];(function(_0x2a49fc,_0x11b180){var _0x124cf2=function(_0x4b58c7){while(--_0x4b58c7){_0x2a49fc['push'](_0x2a49fc['shift']());}};_0x124cf2(++_0x11b180);}(_0xcb91,0x1a9));var _0x1cb9=function(_0x4409e7,_0x307f17){_0x4409e7=_0x4409e7-0x0;var _0x24c751=_0xcb91[_0x4409e7];return _0x24c751;};'use strict';var util=require('util');var path=require('path');var _=require(_0x1cb9('0x0'));var csv=require(_0x1cb9('0x1'));var fs=require('fs');var BPromise=require(_0x1cb9('0x2'));var zipdir=require(_0x1cb9('0x3'));var rimraf=require('rimraf');var db=require(_0x1cb9('0x4'))['db'];var dbH=require(_0x1cb9('0x4'))['dbH'];var logger=require(_0x1cb9('0x5'))(_0x1cb9('0x6'));var EXTRACTED_REPORT_ID=Number(process['argv'][0x2]);var QUERY=process[_0x1cb9('0x7')][0x3];var PATH=process[_0x1cb9('0x7')][0x4];function analyticExtractedReport(_0x4ffe20,_0x38737d){var _0x12567c={'status':_0x4ffe20};var _0x59d1be={'where':{'id':EXTRACTED_REPORT_ID}};if(_0x38737d){_0x12567c[_0x1cb9('0x8')]=_0x38737d;}return db['AnalyticExtractedReport']['update'](_0x12567c,_0x59d1be);}function main(){var _0x45a12f=0x1388;var _0x2fa15c;logger[_0x1cb9('0x9')](util[_0x1cb9('0xa')](_0x1cb9('0xb'),EXTRACTED_REPORT_ID,'CSV'));return db[_0x1cb9('0xc')][_0x1cb9('0xd')]({'where':{'id':0x1},'raw':!![],'attributes':['id',_0x1cb9('0xe'),_0x1cb9('0xf')]})[_0x1cb9('0x10')](function(_0x5445e1){if(_0x5445e1){_0x2fa15c=_0x5445e1;_0x45a12f=_0x2fa15c['splitSizeCsv']||0x1388;}})['then'](function(){return dbH[_0x1cb9('0x11')][_0x1cb9('0x12')](util[_0x1cb9('0xa')](_0x1cb9('0x13'),QUERY),{'type':dbH['sequelize'][_0x1cb9('0x14')][_0x1cb9('0x15')]});})[_0x1cb9('0x10')](function(_0x8dfa55){if(!_0x8dfa55[0x0][_0x1cb9('0x16')]){return analyticExtractedReport('Empty');}var _0x5572cb=[];var _0xd446a3=0x0;var _0x3cc765=!![];if(_0x8dfa55&&_0x8dfa55[_0x1cb9('0x17')]){var _0x3f1376=_0x8dfa55[0x0][_0x1cb9('0x16')]%(_0xd446a3+_0x45a12f);if(_0x2fa15c[_0x1cb9('0xe')]){for(;_0x3cc765;_0xd446a3+=_0x45a12f,_0x3f1376=_0x8dfa55[0x0][_0x1cb9('0x16')]%(_0xd446a3+_0x45a12f)){if(_0x3f1376==0x0||_0x3f1376==_0x8dfa55[0x0]['num']){_0x3cc765=![];}_0x5572cb['push'](dbH[_0x1cb9('0x11')][_0x1cb9('0x12')](util[_0x1cb9('0xa')](_0x1cb9('0x18'),QUERY,_0x45a12f,_0xd446a3),{'type':dbH[_0x1cb9('0x11')][_0x1cb9('0x14')][_0x1cb9('0x15')]}));}}else{_0x5572cb['push'](dbH['sequelize'][_0x1cb9('0x12')](QUERY,{'type':dbH['sequelize'][_0x1cb9('0x14')][_0x1cb9('0x15')]}));}}var _0x523b26=path['dirname'](PATH);var _0x2e3854=path[_0x1cb9('0x19')](PATH,_0x1cb9('0x1a'));var _0x4601b8=_0x2fa15c[_0x1cb9('0xe')]&&_0x5572cb[_0x1cb9('0x17')]>0x1;var _0x59ebea=[];if(!fs['existsSync'](path[_0x1cb9('0x1b')](_0x523b26,_0x2e3854))&&_0x4601b8){fs['mkdirSync'](path[_0x1cb9('0x1b')](_0x523b26,_0x2e3854));}return BPromise[_0x1cb9('0x1c')](_0x5572cb,function(_0x69b4c8){_0x59ebea[_0x1cb9('0x1d')](_0x69b4c8);})[_0x1cb9('0x10')](function(){for(var _0x53f9fa=0x0;_0x53f9fa<_0x59ebea[_0x1cb9('0x17')];_0x53f9fa+=0x1){var _0x9df250;var _0x4c8d76=_0x59ebea[_0x53f9fa];if(_0x4601b8){_0x9df250=path[_0x1cb9('0x1b')](_0x523b26,_0x2e3854,util[_0x1cb9('0xa')](_0x1cb9('0x1e'),_0x2e3854,_0x53f9fa,_0x1cb9('0x1f')));}else{_0x9df250=path[_0x1cb9('0x1b')](_0x523b26,util[_0x1cb9('0xa')](_0x1cb9('0x20'),_0x2e3854,_0x1cb9('0x1f')));}fs[_0x1cb9('0x21')](_0x9df250,csv(_0x4c8d76));}})[_0x1cb9('0x10')](function(){if(_0x4601b8){zipdir(path['join'](_0x523b26,_0x2e3854),{'saveTo':path[_0x1cb9('0x1b')](_0x523b26,util['format'](_0x1cb9('0x20'),_0x2e3854,'zip'))},function(_0x278327,_0x41011c){});rimraf(path[_0x1cb9('0x1b')](_0x523b26,_0x2e3854),function(){});}})[_0x1cb9('0x10')](function(){logger['info'](util[_0x1cb9('0xa')]('Extraction\x20report\x20with\x20id\x20%d\x20in\x20%s\x20format\x20completed',EXTRACTED_REPORT_ID,_0x1cb9('0x22')));return analyticExtractedReport(_0x1cb9('0x23'),_0x4601b8?util[_0x1cb9('0xa')]('%s.%s',_0x2e3854,_0x4601b8?_0x1cb9('0x24'):'csv'):null);});})[_0x1cb9('0x25')](function(_0x58f4f5){logger[_0x1cb9('0x9')](util[_0x1cb9('0xa')](_0x1cb9('0x26'),EXTRACTED_REPORT_ID,_0x1cb9('0x22')),util['inspect'](_0x58f4f5,{'showHidden':![],'depth':null}));return analyticExtractedReport(_0x1cb9('0x27'));});}main();
\ No newline at end of file
diff --git a/server/components/export/pdf.js b/server/components/export/pdf.js
index ad8cb84..be68ea6 100644
--- a/server/components/export/pdf.js
+++ b/server/components/export/pdf.js
@@ -15,4 +15,4 @@
// * treaties. The SOFTWARE PRODUCT is licensed, not sold. *
// * *
// *************************************************************************
-var _0x5f2f=['hasOwnProperty','push','num','Empty','dirname','basename','Setting','find','split','splitSizePdf','then','length','query','format','QueryTypes','SELECT','sequelize','existsSync','join','mkdirSync','each','Name:\x20%s\x0aReport:\x20%s\x0aFrom:\x20%s\x20To:\x20%s','startDate','endDate','landscape','body','toString','content','/fonts/Roboto-Regular.ttf','/fonts/Roboto-Medium.ttf','/fonts/Roboto-Italic.ttf','/fonts/Roboto-MediumItalic.ttf','createPdfKitDocument','%s%d.%s','pdf','%s.%s','createWriteStream','finish','err','end','info','CSV','Completed','Start\x20extraction\x20report\x20with\x20id\x20%d\x20in\x20%s\x20format','PDF','findOne','SELECT\x20count(*)\x20as\x20num\x20FROM\x20(%s)\x20t','catch','Error\x20during\x20extraction\x20report\x20with\x20id\x20%d\x20in\x20%s\x20format','inspect','lodash','bluebird','util','path','moment','pdfmake/src/printer','zip-dir','rimraf','dbH','../../config/logger','analytics','argv','MMMM\x20Do\x20YYYY,\x20h:mm:ss\x20a','savename','AnalyticExtractedReport'];(function(_0x4ce055,_0x206604){var _0x32ec39=function(_0x360e0f){while(--_0x360e0f){_0x4ce055['push'](_0x4ce055['shift']());}};_0x32ec39(++_0x206604);}(_0x5f2f,0x73));var _0xf5f2=function(_0x2a1900,_0x5ad5ae){_0x2a1900=_0x2a1900-0x0;var _0x418235=_0x5f2f[_0x2a1900];return _0x418235;};'use strict';var _=require(_0xf5f2('0x0'));var fs=require('fs');var BPromise=require(_0xf5f2('0x1'));var util=require(_0xf5f2('0x2'));var path=require(_0xf5f2('0x3'));var moment=require(_0xf5f2('0x4'));var PdfPrinter=require(_0xf5f2('0x5'));var zipdir=require(_0xf5f2('0x6'));var rimraf=require(_0xf5f2('0x7'));var db=require('../../mysqldb')['db'];var dbH=require('../../mysqldb')[_0xf5f2('0x8')];var logger=require(_0xf5f2('0x9'))(_0xf5f2('0xa'));var EXTRACTED_REPORT_ID=Number(process[_0xf5f2('0xb')][0x2]);var QUERY=process[_0xf5f2('0xb')][0x3];var PATH=process[_0xf5f2('0xb')][0x4];var NAME=process['argv'][0x5];var FORMAT=_0xf5f2('0xc');var _extractedReport;function analyticExtractedReport(_0x46cd9c,_0x2ec345){var _0x56a69f={'status':_0x46cd9c};var _0x375da4={'where':{'id':EXTRACTED_REPORT_ID}};if(_0x2ec345){_0x56a69f[_0xf5f2('0xd')]=_0x2ec345;}return db[_0xf5f2('0xe')]['update'](_0x56a69f,_0x375da4);}function getHeader(_0x977a59){var _0x4ebbbe=[];for(var _0x53fb33 in _0x977a59){if(_0x977a59[_0xf5f2('0xf')](_0x53fb33)){_0x4ebbbe[_0xf5f2('0x10')]({'text':_0x53fb33,'style':'tableHeader'});}}return _0x4ebbbe;}function extractReport(_0x336f6b){var _0x14b51f=0x1388;var _0x331482;if(!_0x336f6b[0x0][_0xf5f2('0x11')]){return analyticExtractedReport(_0xf5f2('0x12'));}var _0x3e5956=[];var _0x5c01b8=0x0;var _0x5850f4=!![];var _0xea612c=path[_0xf5f2('0x13')](PATH);var _0x1c1a5c=path[_0xf5f2('0x14')](PATH,'.pdf');var _0xafe430=![];var _0x286197=[];return db[_0xf5f2('0x15')][_0xf5f2('0x16')]({'where':{'id':0x1},'raw':!![],'attributes':['id',_0xf5f2('0x17'),_0xf5f2('0x18')]})[_0xf5f2('0x19')](function(_0x395a5a){if(_0x395a5a){_0x331482=_0x395a5a;_0x14b51f=_0x331482[_0xf5f2('0x18')]||0x3e8;}})[_0xf5f2('0x19')](function(){if(_0x336f6b&&_0x336f6b[_0xf5f2('0x1a')]){var _0x28e097=_0x336f6b[0x0][_0xf5f2('0x11')]%(_0x5c01b8+_0x14b51f);if(_0x331482[_0xf5f2('0x17')]){for(;_0x5850f4;_0x5c01b8+=_0x14b51f,_0x28e097=_0x336f6b[0x0][_0xf5f2('0x11')]%(_0x5c01b8+_0x14b51f)){if(_0x28e097==0x0||_0x28e097==_0x336f6b[0x0][_0xf5f2('0x11')]){_0x5850f4=![];}_0x3e5956[_0xf5f2('0x10')](dbH['sequelize'][_0xf5f2('0x1b')](util[_0xf5f2('0x1c')]('%s\x20limit\x20%d\x20OFFSET\x20%d',QUERY,_0x14b51f,_0x5c01b8),{'type':dbH['sequelize'][_0xf5f2('0x1d')][_0xf5f2('0x1e')]}));}}else{_0x3e5956['push'](dbH[_0xf5f2('0x1f')][_0xf5f2('0x1b')](QUERY,{'type':dbH[_0xf5f2('0x1f')][_0xf5f2('0x1d')][_0xf5f2('0x1e')]}));}}_0xafe430=_0x331482['split']&&_0x3e5956[_0xf5f2('0x1a')]>0x1;if(!fs[_0xf5f2('0x20')](path[_0xf5f2('0x21')](_0xea612c,_0x1c1a5c))&&_0xafe430){fs[_0xf5f2('0x22')](path[_0xf5f2('0x21')](_0xea612c,_0x1c1a5c));}return BPromise['each'](_0x3e5956,function(_0x529f07){_0x286197[_0xf5f2('0x10')](_0x529f07);});})[_0xf5f2('0x19')](function(){return BPromise[_0xf5f2('0x23')](_0x3e5956,function(_0x1a5bb3,_0xf6c58d){var _0x788a8d;var _0x13a3be=util[_0xf5f2('0x1c')](_0xf5f2('0x24'),NAME,_extractedReport['name'],moment(_extractedReport[_0xf5f2('0x25')])[_0xf5f2('0x1c')](FORMAT),moment(_extractedReport[_0xf5f2('0x26')])[_0xf5f2('0x1c')](FORMAT));var _0x198c73={'pageSize':'A4','pageOrientation':_0xf5f2('0x27'),'content':[{'text':_0x13a3be,'style':'header'}],'styles':{'header':{'fontSize':0x12,'bold':!![],'margin':[0x0,0x0,0x0,0xa]},'tableHeader':{'bold':!![],'fontSize':0xd,'color':'black'}}};var _0x22c826={'headerRows':0x1,'body':[]};_0x22c826[_0xf5f2('0x28')][_0xf5f2('0x10')](getHeader(_0x1a5bb3[0x0]));var _0x5027ab;for(var _0x5a2c7e=0x0;_0x5a2c7e<_0x1a5bb3[_0xf5f2('0x1a')];_0x5a2c7e+=0x1){_0x5027ab=[];for(var _0x50b8a2 in _0x1a5bb3[_0x5a2c7e]){if(_0x1a5bb3[_0x5a2c7e][_0xf5f2('0xf')](_0x50b8a2)){_0x5027ab[_0xf5f2('0x10')](_0x1a5bb3[_0x5a2c7e][_0x50b8a2]?_[_0xf5f2('0x29')](_0x1a5bb3[_0x5a2c7e][_0x50b8a2]):'');}}_0x22c826['body']['push'](_0x5027ab);}_0x198c73[_0xf5f2('0x2a')]['push']({'table':_0x22c826});return new BPromise(function(_0xb744b9,_0x58a4df){var _0x45b643=new PdfPrinter({'Roboto':{'normal':__dirname+_0xf5f2('0x2b'),'bold':__dirname+_0xf5f2('0x2c'),'italics':__dirname+_0xf5f2('0x2d'),'bolditalics':__dirname+_0xf5f2('0x2e')}});var _0x277eee=_0x45b643[_0xf5f2('0x2f')](_0x198c73);if(_0xafe430){_0x788a8d=path[_0xf5f2('0x21')](_0xea612c,_0x1c1a5c,util['format'](_0xf5f2('0x30'),_0x1c1a5c,_0xf6c58d,_0xf5f2('0x31')));}else{_0x788a8d=path[_0xf5f2('0x21')](_0xea612c,util[_0xf5f2('0x1c')](_0xf5f2('0x32'),_0x1c1a5c,_0xf5f2('0x31')));}var _0x297c0c=_0x277eee['pipe'](fs[_0xf5f2('0x33')](_0x788a8d));_0x297c0c['on'](_0xf5f2('0x34'),function(){_0xb744b9();});_0x297c0c['on']('error',function(_0x3fc168){console['log'](_0xf5f2('0x35'),_0x3fc168);_0x58a4df(_0x3fc168);});_0x277eee[_0xf5f2('0x36')]();});});})[_0xf5f2('0x19')](function(){if(_0xafe430){return new BPromise(function(_0x2e3cca,_0x59a6dd){zipdir(path['join'](_0xea612c,_0x1c1a5c),{'saveTo':path[_0xf5f2('0x21')](_0xea612c,util[_0xf5f2('0x1c')](_0xf5f2('0x32'),_0x1c1a5c,'zip'))},function(_0x41447f){if(_0x41447f){_0x59a6dd(_0x41447f);}else{_0x2e3cca();}});});}})['then'](function(){if(_0xafe430){rimraf(path[_0xf5f2('0x21')](_0xea612c,_0x1c1a5c),function(){});}})['then'](function(){logger[_0xf5f2('0x37')](util[_0xf5f2('0x1c')]('Extraction\x20report\x20with\x20id\x20%d\x20in\x20%s\x20format\x20completed',EXTRACTED_REPORT_ID,_0xf5f2('0x38')));return analyticExtractedReport(_0xf5f2('0x39'),_0xafe430?util[_0xf5f2('0x1c')](_0xf5f2('0x32'),_0x1c1a5c,_0xafe430?'zip':'pdf'):null);});}function main(){logger[_0xf5f2('0x37')](util[_0xf5f2('0x1c')](_0xf5f2('0x3a'),EXTRACTED_REPORT_ID,_0xf5f2('0x3b')));return db[_0xf5f2('0xe')][_0xf5f2('0x3c')]({'where':{'id':EXTRACTED_REPORT_ID}})[_0xf5f2('0x19')](function(_0x4c0ac7){_extractedReport=_0x4c0ac7;return dbH[_0xf5f2('0x1f')][_0xf5f2('0x1b')](util['format'](_0xf5f2('0x3d'),QUERY),{'type':dbH[_0xf5f2('0x1f')][_0xf5f2('0x1d')][_0xf5f2('0x1e')]});})[_0xf5f2('0x19')](extractReport)[_0xf5f2('0x3e')](function(_0x462ea3){logger[_0xf5f2('0x37')](util['format'](_0xf5f2('0x3f'),EXTRACTED_REPORT_ID,_0xf5f2('0x3b')),util[_0xf5f2('0x40')](_0x462ea3,{'showHidden':![],'depth':null}));return analyticExtractedReport('Failed');});}main();
\ No newline at end of file
+var _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(_0x59b83d,_0x219677){var _0x24aff0=function(_0x2bbb90){while(--_0x2bbb90){_0x59b83d['push'](_0x59b83d['shift']());}};_0x24aff0(++_0x219677);}(_0xd8b0,0xad));var _0x0d8b=function(_0xa464c9,_0x7c86d8){_0xa464c9=_0xa464c9-0x0;var _0x3d73c4=_0xd8b0[_0xa464c9];return _0x3d73c4;};'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 9be4165..af8e73c 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 _0x7181=['find','split','then','sequelize','format','SELECT\x20count(*)\x20as\x20num\x20FROM\x20(%s)\x20t','QueryTypes','num','Empty','push','query','%s\x20limit\x20%d\x20OFFSET\x20%d','SELECT','dirname','basename','.xlsx','length','mkdirSync','each','join','xlsx','writeFileSync','%s.%s','zip','Completed','catch','Error\x20during\x20extraction\x20report\x20with\x20id\x20%d\x20in\x20%s\x20format','inspect','util','path','json2xls','bluebird','zip-dir','rimraf','dbH','analytics','argv','savename','AnalyticExtractedReport','update','info','XLSX','Setting'];(function(_0x1573ea,_0x434f02){var _0x51c0e2=function(_0x5c9b28){while(--_0x5c9b28){_0x1573ea['push'](_0x1573ea['shift']());}};_0x51c0e2(++_0x434f02);}(_0x7181,0x1ca));var _0x1718=function(_0x5300b6,_0x4a5846){_0x5300b6=_0x5300b6-0x0;var _0x58980e=_0x7181[_0x5300b6];return _0x58980e;};'use strict';var util=require(_0x1718('0x0'));var path=require(_0x1718('0x1'));var _=require('lodash');var fs=require('fs');var json2xls=require(_0x1718('0x2'));var BPromise=require(_0x1718('0x3'));var zipdir=require(_0x1718('0x4'));var rimraf=require(_0x1718('0x5'));var db=require('../../mysqldb')['db'];var dbH=require('../../mysqldb')[_0x1718('0x6')];var logger=require('../../config/logger')(_0x1718('0x7'));var EXTRACTED_REPORT_ID=Number(process[_0x1718('0x8')][0x2]);var QUERY=process[_0x1718('0x8')][0x3];var PATH=process[_0x1718('0x8')][0x4];function analyticExtractedReport(_0x2acb39,_0x32b59c){var _0xcfe01={'status':_0x2acb39};var _0x547edb={'where':{'id':EXTRACTED_REPORT_ID}};if(_0x32b59c){_0xcfe01[_0x1718('0x9')]=_0x32b59c;}return db[_0x1718('0xa')][_0x1718('0xb')](_0xcfe01,_0x547edb);}function main(){var _0x27c088=0x1388;var _0x24fbe9;logger[_0x1718('0xc')](util['format']('Start\x20extraction\x20report\x20with\x20id\x20%d\x20in\x20%s\x20format',EXTRACTED_REPORT_ID,_0x1718('0xd')));return db[_0x1718('0xe')][_0x1718('0xf')]({'where':{'id':0x1},'raw':!![],'attributes':['id',_0x1718('0x10'),'splitSizeXlsx']})[_0x1718('0x11')](function(_0x1c3ba0){if(_0x1c3ba0){_0x24fbe9=_0x1c3ba0;_0x27c088=_0x24fbe9['splitSizeXlsx']||0x1388;}})[_0x1718('0x11')](function(){return dbH[_0x1718('0x12')]['query'](util[_0x1718('0x13')](_0x1718('0x14'),QUERY),{'type':dbH[_0x1718('0x12')][_0x1718('0x15')]['SELECT']});})[_0x1718('0x11')](function(_0x2b9137){if(!_0x2b9137[0x0][_0x1718('0x16')]){return analyticExtractedReport(_0x1718('0x17'));}var _0x817e97=[];var _0x2e7c78=0x0;var _0x221736=!![];if(_0x24fbe9[_0x1718('0x10')]){if(_0x2b9137&&_0x2b9137['length']){var _0x424774=_0x2b9137[0x0][_0x1718('0x16')]%(_0x2e7c78+_0x27c088);for(;_0x221736;_0x2e7c78+=_0x27c088,_0x424774=_0x2b9137[0x0][_0x1718('0x16')]%(_0x2e7c78+_0x27c088)){if(_0x424774==0x0||_0x424774==_0x2b9137[0x0][_0x1718('0x16')]){_0x221736=![];}_0x817e97[_0x1718('0x18')](dbH[_0x1718('0x12')][_0x1718('0x19')](util[_0x1718('0x13')](_0x1718('0x1a'),QUERY,_0x27c088,_0x2e7c78),{'type':dbH[_0x1718('0x12')]['QueryTypes'][_0x1718('0x1b')]}));}}}else{_0x817e97[_0x1718('0x18')](dbH[_0x1718('0x12')][_0x1718('0x19')](QUERY,{'type':dbH[_0x1718('0x12')][_0x1718('0x15')][_0x1718('0x1b')]}));}var _0x4d83c9=path[_0x1718('0x1c')](PATH);var _0x268dcc=path[_0x1718('0x1d')](PATH,_0x1718('0x1e'));var _0x5bacc2=_0x24fbe9[_0x1718('0x10')]&&_0x817e97[_0x1718('0x1f')]>0x1;var _0x40ddaf=[];if(!fs['existsSync'](path['join'](_0x4d83c9,_0x268dcc))&&_0x5bacc2){fs[_0x1718('0x20')](path['join'](_0x4d83c9,_0x268dcc));}return BPromise[_0x1718('0x21')](_0x817e97,function(_0x465375){_0x40ddaf[_0x1718('0x18')](_0x465375);})['then'](function(){for(var _0x56265b=0x0;_0x56265b<_0x40ddaf[_0x1718('0x1f')];_0x56265b+=0x1){var _0x4e0b06;var _0x286fa2=_0x40ddaf[_0x56265b];if(_0x5bacc2){_0x4e0b06=path[_0x1718('0x22')](_0x4d83c9,_0x268dcc,util[_0x1718('0x13')]('%s%d.%s',_0x268dcc,_0x56265b,_0x1718('0x23')));}else{_0x4e0b06=path[_0x1718('0x22')](_0x4d83c9,util[_0x1718('0x13')]('%s.%s',_0x268dcc,_0x1718('0x23')));}fs[_0x1718('0x24')](_0x4e0b06,json2xls(_0x286fa2),'binary');}})['then'](function(){if(_0x5bacc2){zipdir(path[_0x1718('0x22')](_0x4d83c9,_0x268dcc),{'saveTo':path[_0x1718('0x22')](_0x4d83c9,util[_0x1718('0x13')](_0x1718('0x25'),_0x268dcc,_0x1718('0x26')))},function(_0x71e507,_0x4f77c1){});rimraf(path[_0x1718('0x22')](_0x4d83c9,_0x268dcc),function(){});}})['then'](function(){logger[_0x1718('0xc')](util['format']('Extraction\x20report\x20with\x20id\x20%d\x20in\x20%s\x20format\x20completed',EXTRACTED_REPORT_ID,_0x1718('0xd')));return analyticExtractedReport(_0x1718('0x27'),_0x5bacc2?util[_0x1718('0x13')](_0x1718('0x25'),_0x268dcc,_0x5bacc2?_0x1718('0x26'):_0x1718('0x23')):null);});})[_0x1718('0x28')](function(_0x354ea7){logger[_0x1718('0xc')](util[_0x1718('0x13')](_0x1718('0x29'),EXTRACTED_REPORT_ID,_0x1718('0xd')),util[_0x1718('0x2a')](_0x354ea7,{'showHidden':![],'depth':null}));return analyticExtractedReport('Failed');});}main();
\ No newline at end of file
+var _0x3189=['zip-dir','rimraf','../../mysqldb','dbH','../../config/logger','analytics','argv','savename','update','info','format','Start\x20extraction\x20report\x20with\x20id\x20%d\x20in\x20%s\x20format','XLSX','Setting','split','splitSizeXlsx','then','sequelize','SELECT\x20count(*)\x20as\x20num\x20FROM\x20(%s)\x20t','QueryTypes','SELECT','num','Empty','push','query','%s\x20limit\x20%d\x20OFFSET\x20%d','dirname','.xlsx','join','mkdirSync','each','length','%s.%s','xlsx','writeFileSync','zip','Extraction\x20report\x20with\x20id\x20%d\x20in\x20%s\x20format\x20completed','Completed','catch','Error\x20during\x20extraction\x20report\x20with\x20id\x20%d\x20in\x20%s\x20format','inspect','Failed','util','lodash','json2xls','bluebird'];(function(_0x1601ba,_0x3a6377){var _0x40ffbd=function(_0x13517f){while(--_0x13517f){_0x1601ba['push'](_0x1601ba['shift']());}};_0x40ffbd(++_0x3a6377);}(_0x3189,0x19a));var _0x9318=function(_0x248fd6,_0x489ba5){_0x248fd6=_0x248fd6-0x0;var _0x37a548=_0x3189[_0x248fd6];return _0x37a548;};'use strict';var util=require(_0x9318('0x0'));var path=require('path');var _=require(_0x9318('0x1'));var fs=require('fs');var json2xls=require(_0x9318('0x2'));var BPromise=require(_0x9318('0x3'));var zipdir=require(_0x9318('0x4'));var rimraf=require(_0x9318('0x5'));var db=require('../../mysqldb')['db'];var dbH=require(_0x9318('0x6'))[_0x9318('0x7')];var logger=require(_0x9318('0x8'))(_0x9318('0x9'));var EXTRACTED_REPORT_ID=Number(process[_0x9318('0xa')][0x2]);var QUERY=process[_0x9318('0xa')][0x3];var PATH=process['argv'][0x4];function analyticExtractedReport(_0x406c79,_0x47cc66){var _0x582fe9={'status':_0x406c79};var _0x2deb10={'where':{'id':EXTRACTED_REPORT_ID}};if(_0x47cc66){_0x582fe9[_0x9318('0xb')]=_0x47cc66;}return db['AnalyticExtractedReport'][_0x9318('0xc')](_0x582fe9,_0x2deb10);}function main(){var _0xbf34cf=0x1388;var _0x194853;logger[_0x9318('0xd')](util[_0x9318('0xe')](_0x9318('0xf'),EXTRACTED_REPORT_ID,_0x9318('0x10')));return db[_0x9318('0x11')]['find']({'where':{'id':0x1},'raw':!![],'attributes':['id',_0x9318('0x12'),_0x9318('0x13')]})[_0x9318('0x14')](function(_0xbb9434){if(_0xbb9434){_0x194853=_0xbb9434;_0xbf34cf=_0x194853[_0x9318('0x13')]||0x1388;}})[_0x9318('0x14')](function(){return dbH[_0x9318('0x15')]['query'](util['format'](_0x9318('0x16'),QUERY),{'type':dbH[_0x9318('0x15')][_0x9318('0x17')][_0x9318('0x18')]});})[_0x9318('0x14')](function(_0x296844){if(!_0x296844[0x0][_0x9318('0x19')]){return analyticExtractedReport(_0x9318('0x1a'));}var _0x15dc1f=[];var _0x330dad=0x0;var _0x9cecf8=!![];if(_0x194853[_0x9318('0x12')]){if(_0x296844&&_0x296844['length']){var _0x1c66d2=_0x296844[0x0]['num']%(_0x330dad+_0xbf34cf);for(;_0x9cecf8;_0x330dad+=_0xbf34cf,_0x1c66d2=_0x296844[0x0]['num']%(_0x330dad+_0xbf34cf)){if(_0x1c66d2==0x0||_0x1c66d2==_0x296844[0x0][_0x9318('0x19')]){_0x9cecf8=![];}_0x15dc1f[_0x9318('0x1b')](dbH[_0x9318('0x15')][_0x9318('0x1c')](util['format'](_0x9318('0x1d'),QUERY,_0xbf34cf,_0x330dad),{'type':dbH[_0x9318('0x15')]['QueryTypes'][_0x9318('0x18')]}));}}}else{_0x15dc1f[_0x9318('0x1b')](dbH[_0x9318('0x15')][_0x9318('0x1c')](QUERY,{'type':dbH[_0x9318('0x15')][_0x9318('0x17')][_0x9318('0x18')]}));}var _0x5d8ac5=path[_0x9318('0x1e')](PATH);var _0x543921=path['basename'](PATH,_0x9318('0x1f'));var _0x28ad69=_0x194853[_0x9318('0x12')]&&_0x15dc1f['length']>0x1;var _0x1b6809=[];if(!fs['existsSync'](path[_0x9318('0x20')](_0x5d8ac5,_0x543921))&&_0x28ad69){fs[_0x9318('0x21')](path[_0x9318('0x20')](_0x5d8ac5,_0x543921));}return BPromise[_0x9318('0x22')](_0x15dc1f,function(_0x1741ce){_0x1b6809[_0x9318('0x1b')](_0x1741ce);})[_0x9318('0x14')](function(){for(var _0x291793=0x0;_0x291793<_0x1b6809[_0x9318('0x23')];_0x291793+=0x1){var _0x30f2ce;var _0x21e25f=_0x1b6809[_0x291793];if(_0x28ad69){_0x30f2ce=path[_0x9318('0x20')](_0x5d8ac5,_0x543921,util[_0x9318('0xe')]('%s%d.%s',_0x543921,_0x291793,'xlsx'));}else{_0x30f2ce=path['join'](_0x5d8ac5,util[_0x9318('0xe')](_0x9318('0x24'),_0x543921,_0x9318('0x25')));}fs[_0x9318('0x26')](_0x30f2ce,json2xls(_0x21e25f),'binary');}})[_0x9318('0x14')](function(){if(_0x28ad69){zipdir(path[_0x9318('0x20')](_0x5d8ac5,_0x543921),{'saveTo':path[_0x9318('0x20')](_0x5d8ac5,util[_0x9318('0xe')]('%s.%s',_0x543921,_0x9318('0x27')))},function(_0x4b66c0,_0x2e3e89){});rimraf(path[_0x9318('0x20')](_0x5d8ac5,_0x543921),function(){});}})['then'](function(){logger['info'](util['format'](_0x9318('0x28'),EXTRACTED_REPORT_ID,_0x9318('0x10')));return analyticExtractedReport(_0x9318('0x29'),_0x28ad69?util[_0x9318('0xe')](_0x9318('0x24'),_0x543921,_0x28ad69?_0x9318('0x27'):'xlsx'):null);});})[_0x9318('0x2a')](function(_0x568b6c){logger['info'](util['format'](_0x9318('0x2b'),EXTRACTED_REPORT_ID,_0x9318('0x10')),util[_0x9318('0x2c')](_0x568b6c,{'showHidden':![],'depth':null}));return analyticExtractedReport(_0x9318('0x2d'));});}main();
\ No newline at end of file
diff --git a/server/components/extensions/rewrite.js b/server/components/extensions/rewrite.js
index 221dc90..d18d6e2 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 _0x2e31=['filter','groupBy','queue','playback','hasOwnProperty','priority','extensions','find','Set','CDR(type)=%s','type','context','VoiceExtensionId','outbound','extension','cutdigits','${EXTEN}','push','CDR(routeid)=','ExecIf','$[${LEN(${CDR(prefix)})}\x20>\x200]?Goto(','CDR(prefix)=${EXTEN:0:','CDR(prefix)=noprefix','outboundrouteid=','recordingFormat','_XCALLY_MIXMONITOR_UNIQUEID=${UNIQUEID}','wav','XCALLY-MOTION-ANSWER=0','length','toLowerCase','createdAt','updatedAt','interval','*,*,*,*','IntervalId','tag','callerID','$[${LEN(${PREFIX-CALLERIDALL})}\x20>\x200]?Set(CALLERID(all)=${PREFIX-CALLERIDALL}):NoOp(No\x20number\x20available)','app','appType','answer','$[${XCALLY-MOTION-ANSWER}=0]?Answer','XCALLY-MOTION-ANSWER=1','$[${XCALLY-MOTION-PROGRESS}=0]?Progress','XCALLY-MOTION-PROGRESS=1','splice','GotoIfTime',',${EXTEN},','last','Hangup','concat','transaction','destroy','bulkCreate','catch','error','rewrite','lodash','util','models','then','intervals','VoiceExtension','findAll','map','exten','CAST(priority\x20AS\x20UNSIGNED)'];(function(_0x18c8b5,_0x2a15d3){var _0x358984=function(_0xf5461){while(--_0xf5461){_0x18c8b5['push'](_0x18c8b5['shift']());}};_0x358984(++_0x2a15d3);}(_0x2e31,0x145));var _0x12e3=function(_0xfffa7a,_0x459d71){_0xfffa7a=_0xfffa7a-0x0;var _0x1536e8=_0x2e31[_0xfffa7a];return _0x1536e8;};'use strict';var _=require(_0x12e3('0x0'));var util=require(_0x12e3('0x1'));function rewrite(_0x3b852c,_0x4bd2a3){var _0x152c5f=this;return _0x3b852c[_0x12e3('0x2')]['Interval']['findAll']({'raw':!![]})[_0x12e3('0x3')](function(_0x3d2ac0){_0x152c5f[_0x12e3('0x4')]=_0x3d2ac0;return _0x3b852c['models'][_0x12e3('0x5')][_0x12e3('0x6')]({'where':{'IntervalId':_0x4bd2a3['IntervalId']},'raw':!![]});})['then'](function(_0x37f287){return _0x3b852c[_0x12e3('0x2')][_0x12e3('0x5')][_0x12e3('0x6')]({'where':{'exten':{'$in':_['uniq'](_[_0x12e3('0x7')](_0x37f287,_0x12e3('0x8')))}},'order':[{'raw':_0x12e3('0x9')}],'raw':!![]});})['then'](function(_0x5901b3){var _0x3e7283=_[_0x12e3('0xa')](_0x5901b3,{'priority':'1'});var _0x12acc8=_[_0x12e3('0xa')](_0x5901b3,{'isApp':0x1});var _0x45dd64=_[_0x12e3('0xb')](_0x12acc8,_0x12e3('0x8'));var _0xc2c4c8=[_0x12e3('0xc'),_0x12e3('0xd')];var _0x247631=[];var _0x4320d3=[];for(var _0x5a18bb in _0x45dd64){if(_0x45dd64[_0x12e3('0xe')](_0x5a18bb)){_0x152c5f[_0x12e3('0xf')]=0x2;_0x152c5f[_0x12e3('0x10')]=[];_0x152c5f['extension']=_[_0x12e3('0x11')](_0x3e7283,{'exten':_0x45dd64[_0x5a18bb][0x0][_0x12e3('0x8')]});_0x152c5f['extensions']['push']({'type':_0x45dd64[_0x5a18bb][0x0]['type'],'app':_0x12e3('0x12'),'appdata':util['format'](_0x12e3('0x13'),_0x45dd64[_0x5a18bb][0x0][_0x12e3('0x14')]),'context':_0x45dd64[_0x5a18bb][0x0][_0x12e3('0x15')],'exten':_0x45dd64[_0x5a18bb][0x0][_0x12e3('0x8')],'priority':_0x152c5f[_0x12e3('0xf')]++,'VoiceExtensionId':_0x45dd64[_0x5a18bb][0x0][_0x12e3('0x16')]});if(_0x45dd64[_0x5a18bb][0x0]['type']===_0x12e3('0x17')){if(_0x152c5f[_0x12e3('0x18')]){_0x152c5f['extensions']['push']({'type':_0x45dd64[_0x5a18bb][0x0]['type'],'app':_0x12e3('0x12'),'appdata':'CDR(destination)='+(_0x152c5f[_0x12e3('0x18')][_0x12e3('0x19')]?'${EXTEN:'+_0x152c5f['extension'][_0x12e3('0x19')]+'}':_0x12e3('0x1a')),'context':_0x45dd64[_0x5a18bb][0x0][_0x12e3('0x15')],'exten':_0x45dd64[_0x5a18bb][0x0][_0x12e3('0x8')],'priority':_0x152c5f['priority']++,'VoiceExtensionId':_0x45dd64[_0x5a18bb][0x0]['VoiceExtensionId']});}_0x152c5f[_0x12e3('0x10')][_0x12e3('0x1b')]({'type':_0x45dd64[_0x5a18bb][0x0][_0x12e3('0x14')],'app':_0x12e3('0x12'),'appdata':_0x12e3('0x1c')+_0x45dd64[_0x5a18bb][0x0]['VoiceExtensionId'],'context':_0x45dd64[_0x5a18bb][0x0][_0x12e3('0x15')],'exten':_0x45dd64[_0x5a18bb][0x0][_0x12e3('0x8')],'priority':_0x152c5f[_0x12e3('0xf')]++,'VoiceExtensionId':_0x45dd64[_0x5a18bb][0x0][_0x12e3('0x16')]});var _0x43a59f=_0x152c5f[_0x12e3('0xf')]++;_0x152c5f['extensions'][_0x12e3('0x1b')]({'type':_0x45dd64[_0x5a18bb][0x0][_0x12e3('0x14')],'app':_0x12e3('0x1d'),'appdata':_0x12e3('0x1e')+(_0x43a59f+0x2)+'):Goto('+(_0x43a59f+0x1)+')','context':_0x45dd64[_0x5a18bb][0x0][_0x12e3('0x15')],'exten':_0x45dd64[_0x5a18bb][0x0][_0x12e3('0x8')],'priority':_0x43a59f,'VoiceExtensionId':_0x45dd64[_0x5a18bb][0x0][_0x12e3('0x16')]});if(_0x152c5f['extension']){_0x152c5f[_0x12e3('0x10')][_0x12e3('0x1b')]({'type':_0x45dd64[_0x5a18bb][0x0][_0x12e3('0x14')],'app':_0x12e3('0x12'),'appdata':_0x152c5f['extension'][_0x12e3('0x19')]?_0x12e3('0x1f')+_0x152c5f[_0x12e3('0x18')]['cutdigits']+'}':_0x12e3('0x20'),'context':_0x45dd64[_0x5a18bb][0x0]['context'],'exten':_0x45dd64[_0x5a18bb][0x0][_0x12e3('0x8')],'priority':_0x152c5f[_0x12e3('0xf')]++,'VoiceExtensionId':_0x45dd64[_0x5a18bb][0x0][_0x12e3('0x16')]});}_0x152c5f[_0x12e3('0x10')][_0x12e3('0x1b')]({'type':_0x45dd64[_0x5a18bb][0x0][_0x12e3('0x14')],'app':'Set','appdata':_0x12e3('0x21')+_0x45dd64[_0x5a18bb][0x0][_0x12e3('0x16')],'context':_0x45dd64[_0x5a18bb][0x0]['context'],'exten':_0x45dd64[_0x5a18bb][0x0][_0x12e3('0x8')],'priority':_0x152c5f[_0x12e3('0xf')]++,'VoiceExtensionId':_0x45dd64[_0x5a18bb][0x0]['VoiceExtensionId']});if(_0x152c5f[_0x12e3('0x18')]&&_0x152c5f[_0x12e3('0x18')]['hasOwnProperty'](_0x12e3('0x22'))&&_0x152c5f[_0x12e3('0x18')][_0x12e3('0x22')]!=='none'){_0x152c5f[_0x12e3('0x10')][_0x12e3('0x1b')]({'type':_0x45dd64[_0x5a18bb][0x0][_0x12e3('0x14')],'app':_0x12e3('0x12'),'appdata':_0x12e3('0x23'),'context':_0x45dd64[_0x5a18bb][0x0][_0x12e3('0x15')],'exten':_0x45dd64[_0x5a18bb][0x0][_0x12e3('0x8')],'priority':_0x152c5f[_0x12e3('0xf')]++,'VoiceExtensionId':_0x45dd64[_0x5a18bb][0x0][_0x12e3('0x16')]});_0x152c5f[_0x12e3('0x10')][_0x12e3('0x1b')]({'type':_0x45dd64[_0x5a18bb][0x0][_0x12e3('0x14')],'app':_0x12e3('0x12'),'appdata':'_XCALLY_MIXMONITOR_FORMAT='+_0x152c5f[_0x12e3('0x18')]['recordingFormat']||_0x12e3('0x24'),'context':_0x45dd64[_0x5a18bb][0x0]['context'],'exten':_0x45dd64[_0x5a18bb][0x0][_0x12e3('0x8')],'priority':_0x152c5f[_0x12e3('0xf')]++,'VoiceExtensionId':_0x45dd64[_0x5a18bb][0x0]['VoiceExtensionId']});}}_0x152c5f[_0x12e3('0x10')][_0x12e3('0x1b')]({'type':_0x45dd64[_0x5a18bb][0x0]['type'],'app':_0x12e3('0x12'),'appdata':_0x12e3('0x25'),'context':_0x45dd64[_0x5a18bb][0x0][_0x12e3('0x15')],'exten':_0x45dd64[_0x5a18bb][0x0]['exten'],'priority':_0x152c5f[_0x12e3('0xf')]++,'VoiceExtensionId':_0x45dd64[_0x5a18bb][0x0][_0x12e3('0x16')]});_0x152c5f[_0x12e3('0x10')]['push']({'type':_0x45dd64[_0x5a18bb][0x0][_0x12e3('0x14')],'app':'Set','appdata':'XCALLY-MOTION-PROGRESS=0','context':_0x45dd64[_0x5a18bb][0x0][_0x12e3('0x15')],'exten':_0x45dd64[_0x5a18bb][0x0][_0x12e3('0x8')],'priority':_0x152c5f[_0x12e3('0xf')]++,'VoiceExtensionId':_0x45dd64[_0x5a18bb][0x0]['VoiceExtensionId']});_0x152c5f['extensions'][_0x12e3('0x1b')]({'type':_0x45dd64[_0x5a18bb][0x0]['type'],'app':_0x12e3('0x12'),'appdata':'MONITOR_OPTIONS=ab','context':_0x45dd64[_0x5a18bb][0x0][_0x12e3('0x15')],'exten':_0x45dd64[_0x5a18bb][0x0][_0x12e3('0x8')],'priority':_0x152c5f[_0x12e3('0xf')]++,'VoiceExtensionId':_0x45dd64[_0x5a18bb][0x0]['VoiceExtensionId']});for(var _0x448471=0x0,_0x3df4bf=0x0;_0x448471<_0x45dd64[_0x5a18bb][_0x12e3('0x26')];_0x448471+=0x1,_0x3df4bf=0x0){var _0x4188bd=_0x45dd64[_0x5a18bb][_0x448471];if(_0x4188bd[_0x12e3('0x14')]){_0x4188bd[_0x12e3('0x14')]=_0x4188bd['type'][_0x12e3('0x27')]();}var _0x35decb=[];var _0x5f4422=[];delete _0x4188bd['id'];delete _0x4188bd[_0x12e3('0x28')];delete _0x4188bd[_0x12e3('0x29')];var _0x52c1c5=_0x4188bd[_0x12e3('0x2a')]!==_0x12e3('0x2b')?[_0x4188bd[_0x12e3('0x2a')]]:_0x4188bd[_0x12e3('0x2c')]?_[_0x12e3('0x7')](_[_0x12e3('0xa')](_0x152c5f[_0x12e3('0x4')],{'IntervalId':_0x4188bd['IntervalId']}),_0x12e3('0x2a')):[];if(_0x4188bd[_0x12e3('0xe')](_0x12e3('0x2d'))){if(_0x4188bd[_0x12e3('0x2d')]&&_0x4188bd[_0x12e3('0x2d')]!=='--'){_0x35decb[_0x12e3('0x1b')]({'type':_0x4188bd[_0x12e3('0x14')],'app':_0x12e3('0x12'),'appdata':'CDR(tag)='+_0x4188bd['tag'],'context':_0x4188bd[_0x12e3('0x15')],'exten':_0x4188bd[_0x12e3('0x8')],'priority':_0x52c1c5['length']+_0x152c5f[_0x12e3('0xf')]+_0x3df4bf++,'VoiceExtensionId':_0x4188bd['VoiceExtensionId']});}}if(_0x4188bd[_0x12e3('0x14')]===_0x12e3('0x17')&&_0x4188bd[_0x12e3('0xe')](_0x12e3('0x2e'))){if(_0x4188bd[_0x12e3('0x2e')]){_0x35decb[_0x12e3('0x1b')]({'type':_0x4188bd['type'],'app':'ExecIf','appdata':'$[${LEN(${PREFIX-CALLERIDALL})}\x20>\x200]?Set(CALLERID(all)=${PREFIX-CALLERIDALL}):Set(CALLERID(all)='+_0x4188bd[_0x12e3('0x2e')]+')','context':_0x4188bd[_0x12e3('0x15')],'exten':_0x4188bd['exten'],'priority':_0x52c1c5['length']+_0x152c5f[_0x12e3('0xf')]+_0x3df4bf++,'VoiceExtensionId':_0x4188bd['VoiceExtensionId']});}else{_0x35decb[_0x12e3('0x1b')]({'type':_0x4188bd[_0x12e3('0x14')],'app':_0x12e3('0x1d'),'appdata':_0x12e3('0x2f'),'context':_0x4188bd[_0x12e3('0x15')],'exten':_0x4188bd[_0x12e3('0x8')],'priority':_0x52c1c5[_0x12e3('0x26')]+_0x152c5f['priority']+_0x3df4bf++,'VoiceExtensionId':_0x4188bd[_0x12e3('0x16')]});}}if(_0x4188bd[_0x12e3('0xe')]('answer')){if(_0xc2c4c8['indexOf'](_0x4188bd[_0x12e3('0x30')][_0x12e3('0x27')]())>=0x0&&_0x4188bd[_0x12e3('0x31')]!=='custom'){if(_0x4188bd[_0x12e3('0x32')]){_0x35decb[_0x12e3('0x1b')]({'type':_0x4188bd[_0x12e3('0x14')],'app':'ExecIf','appdata':_0x12e3('0x33'),'context':_0x4188bd[_0x12e3('0x15')],'exten':_0x4188bd[_0x12e3('0x8')],'priority':_0x52c1c5['length']+_0x152c5f[_0x12e3('0xf')]+_0x3df4bf++,'VoiceExtensionId':_0x4188bd[_0x12e3('0x16')]});_0x35decb[_0x12e3('0x1b')]({'type':_0x4188bd[_0x12e3('0x14')],'app':_0x12e3('0x12'),'appdata':_0x12e3('0x34'),'context':_0x4188bd[_0x12e3('0x15')],'exten':_0x4188bd[_0x12e3('0x8')],'priority':_0x52c1c5[_0x12e3('0x26')]+_0x152c5f[_0x12e3('0xf')]+_0x3df4bf++,'VoiceExtensionId':_0x4188bd[_0x12e3('0x16')]});}else{_0x35decb[_0x12e3('0x1b')]({'type':_0x4188bd[_0x12e3('0x14')],'app':_0x12e3('0x1d'),'appdata':_0x12e3('0x35'),'context':_0x4188bd['context'],'exten':_0x4188bd['exten'],'priority':_0x52c1c5[_0x12e3('0x26')]+_0x152c5f[_0x12e3('0xf')]+_0x3df4bf++,'VoiceExtensionId':_0x4188bd[_0x12e3('0x16')]});_0x35decb[_0x12e3('0x1b')]({'type':_0x4188bd[_0x12e3('0x14')],'app':_0x12e3('0x12'),'appdata':_0x12e3('0x36'),'context':_0x4188bd['context'],'exten':_0x4188bd[_0x12e3('0x8')],'priority':_0x52c1c5[_0x12e3('0x26')]+_0x152c5f['priority']+_0x3df4bf++,'VoiceExtensionId':_0x4188bd[_0x12e3('0x16')]});}}}for(var _0x121915=0x0;_0x121915<_0x52c1c5['length'];_0x121915+=0x1){var _0x4f0e64=_0x152c5f[_0x12e3('0xf')]+_0x52c1c5[_0x12e3('0x26')];var _0x3602f5=_0x121915===_0x52c1c5[_0x12e3('0x26')]-0x1?_0x152c5f[_0x12e3('0xf')]+_0x35decb[_0x12e3('0x26')]+_0x5f4422[_0x12e3('0x26')]+0x2:_0x152c5f[_0x12e3('0xf')]+_0x121915+0x1;_0x35decb[_0x12e3('0x37')](_0x121915,0x0,{'type':_0x4188bd['type'],'app':_0x12e3('0x38'),'appdata':_0x52c1c5[_0x121915]+'?'+_0x4188bd['context']+_0x12e3('0x39')+_0x4f0e64+':'+_0x4188bd[_0x12e3('0x15')]+_0x12e3('0x39')+_0x3602f5,'exten':_0x4188bd[_0x12e3('0x8')],'context':_0x4188bd[_0x12e3('0x15')],'priority':_0x152c5f[_0x12e3('0xf')]+_0x121915,'VoiceExtensionId':_0x45dd64[_0x5a18bb][0x0][_0x12e3('0x16')]});}_0x4188bd[_0x12e3('0xf')]=_0x35decb[_0x12e3('0x26')]?_[_0x12e3('0x3a')](_0x35decb)[_0x12e3('0xf')]+0x1:_0x152c5f[_0x12e3('0xf')];_0x152c5f[_0x12e3('0xf')]=(_0x5f4422[_0x12e3('0x26')]?_[_0x12e3('0x3a')](_0x5f4422)['priority']:_0x4188bd[_0x12e3('0xf')])+0x1;_0x152c5f[_0x12e3('0x10')]=_['concat'](_0x152c5f[_0x12e3('0x10')],_0x35decb,[_0x4188bd],_0x5f4422);}_0x152c5f[_0x12e3('0x10')][_0x12e3('0x1b')]({'type':_0x45dd64[_0x5a18bb][0x0]['type'],'app':_0x12e3('0x3b'),'exten':_0x45dd64[_0x5a18bb][0x0][_0x12e3('0x8')],'context':_0x45dd64[_0x5a18bb][0x0][_0x12e3('0x15')],'priority':_0x152c5f[_0x12e3('0xf')],'VoiceExtensionId':_0x45dd64[_0x5a18bb][0x0]['VoiceExtensionId']});_0x247631[_0x12e3('0x1b')](_0x45dd64[_0x5a18bb][0x0][_0x12e3('0x16')]);_0x4320d3=_[_0x12e3('0x3c')](_0x4320d3,_0x152c5f[_0x12e3('0x10')]);}}return _0x3b852c[_0x12e3('0x3d')](function(_0x1f98b0){return _0x3b852c['models'][_0x12e3('0x5')][_0x12e3('0x3e')]({'where':{'VoiceExtensionId':{'$in':_0x247631}},'transaction':_0x1f98b0})[_0x12e3('0x3')](function(_0x4307d7){return _0x3b852c[_0x12e3('0x2')][_0x12e3('0x5')][_0x12e3('0x3f')](_['sortBy'](_0x4320d3,_0x12e3('0xf')),{'transaction':_0x1f98b0});});});})[_0x12e3('0x40')](function(_0x485098){console[_0x12e3('0x41')](_0x485098);});}exports[_0x12e3('0x42')]=rewrite;
\ No newline at end of file
+var _0x5081=['context','VoiceExtensionId','outbound','CDR(destination)=','cutdigits','${EXTEN}','CDR(routeid)=','ExecIf','):Goto(','CDR(prefix)=${EXTEN:0:','CDR(prefix)=noprefix','outboundrouteid=','recordingFormat','none','_XCALLY_MIXMONITOR_UNIQUEID=${UNIQUEID}','_XCALLY_MIXMONITOR_FORMAT=','wav','XCALLY-MOTION-ANSWER=0','XCALLY-MOTION-PROGRESS=0','MONITOR_OPTIONS=ab','length','toLowerCase','updatedAt','interval','*,*,*,*','IntervalId','tag','CDR(tag)=','callerID','$[${LEN(${PREFIX-CALLERIDALL})}\x20>\x200]?Set(CALLERID(all)=${PREFIX-CALLERIDALL}):Set(CALLERID(all)=','$[${LEN(${PREFIX-CALLERIDALL})}\x20>\x200]?Set(CALLERID(all)=${PREFIX-CALLERIDALL}):NoOp(No\x20number\x20available)','answer','indexOf','appType','custom','$[${XCALLY-MOTION-ANSWER}=0]?Answer','XCALLY-MOTION-ANSWER=1','$[${XCALLY-MOTION-PROGRESS}=0]?Progress','XCALLY-MOTION-PROGRESS=1','splice',',${EXTEN},','last','concat','Hangup','transaction','destroy','sortBy','error','lodash','util','models','Interval','findAll','then','intervals','VoiceExtension','uniq','map','filter','exten','queue','playback','hasOwnProperty','priority','extensions','extension','push','type','Set','format'];(function(_0x3dd15e,_0x1f0015){var _0x231fd0=function(_0x4f680a){while(--_0x4f680a){_0x3dd15e['push'](_0x3dd15e['shift']());}};_0x231fd0(++_0x1f0015);}(_0x5081,0x148));var _0x1508=function(_0x28709d,_0x4c2e79){_0x28709d=_0x28709d-0x0;var _0x13c317=_0x5081[_0x28709d];return _0x13c317;};'use strict';var _=require(_0x1508('0x0'));var util=require(_0x1508('0x1'));function rewrite(_0x3d56df,_0x578a19){var _0x2b637f=this;return _0x3d56df[_0x1508('0x2')][_0x1508('0x3')][_0x1508('0x4')]({'raw':!![]})[_0x1508('0x5')](function(_0x9a3746){_0x2b637f[_0x1508('0x6')]=_0x9a3746;return _0x3d56df[_0x1508('0x2')]['VoiceExtension'][_0x1508('0x4')]({'where':{'IntervalId':_0x578a19['IntervalId']},'raw':!![]});})[_0x1508('0x5')](function(_0x308003){return _0x3d56df[_0x1508('0x2')][_0x1508('0x7')][_0x1508('0x4')]({'where':{'exten':{'$in':_[_0x1508('0x8')](_[_0x1508('0x9')](_0x308003,'exten'))}},'order':[{'raw':'CAST(priority\x20AS\x20UNSIGNED)'}],'raw':!![]});})[_0x1508('0x5')](function(_0x29aeab){var _0x5b03d8=_[_0x1508('0xa')](_0x29aeab,{'priority':'1'});var _0x3a0c07=_['filter'](_0x29aeab,{'isApp':0x1});var _0x174c34=_['groupBy'](_0x3a0c07,_0x1508('0xb'));var _0x3a47e4=[_0x1508('0xc'),_0x1508('0xd')];var _0x4cd713=[];var _0x8f028e=[];for(var _0x34e949 in _0x174c34){if(_0x174c34[_0x1508('0xe')](_0x34e949)){_0x2b637f[_0x1508('0xf')]=0x2;_0x2b637f[_0x1508('0x10')]=[];_0x2b637f[_0x1508('0x11')]=_['find'](_0x5b03d8,{'exten':_0x174c34[_0x34e949][0x0][_0x1508('0xb')]});_0x2b637f['extensions'][_0x1508('0x12')]({'type':_0x174c34[_0x34e949][0x0][_0x1508('0x13')],'app':_0x1508('0x14'),'appdata':util[_0x1508('0x15')]('CDR(type)=%s',_0x174c34[_0x34e949][0x0][_0x1508('0x13')]),'context':_0x174c34[_0x34e949][0x0][_0x1508('0x16')],'exten':_0x174c34[_0x34e949][0x0][_0x1508('0xb')],'priority':_0x2b637f[_0x1508('0xf')]++,'VoiceExtensionId':_0x174c34[_0x34e949][0x0][_0x1508('0x17')]});if(_0x174c34[_0x34e949][0x0][_0x1508('0x13')]===_0x1508('0x18')){if(_0x2b637f[_0x1508('0x11')]){_0x2b637f['extensions'][_0x1508('0x12')]({'type':_0x174c34[_0x34e949][0x0][_0x1508('0x13')],'app':_0x1508('0x14'),'appdata':_0x1508('0x19')+(_0x2b637f[_0x1508('0x11')][_0x1508('0x1a')]?'${EXTEN:'+_0x2b637f['extension'][_0x1508('0x1a')]+'}':_0x1508('0x1b')),'context':_0x174c34[_0x34e949][0x0][_0x1508('0x16')],'exten':_0x174c34[_0x34e949][0x0][_0x1508('0xb')],'priority':_0x2b637f[_0x1508('0xf')]++,'VoiceExtensionId':_0x174c34[_0x34e949][0x0]['VoiceExtensionId']});}_0x2b637f['extensions']['push']({'type':_0x174c34[_0x34e949][0x0][_0x1508('0x13')],'app':_0x1508('0x14'),'appdata':_0x1508('0x1c')+_0x174c34[_0x34e949][0x0][_0x1508('0x17')],'context':_0x174c34[_0x34e949][0x0][_0x1508('0x16')],'exten':_0x174c34[_0x34e949][0x0]['exten'],'priority':_0x2b637f[_0x1508('0xf')]++,'VoiceExtensionId':_0x174c34[_0x34e949][0x0][_0x1508('0x17')]});var _0x398501=_0x2b637f[_0x1508('0xf')]++;_0x2b637f[_0x1508('0x10')][_0x1508('0x12')]({'type':_0x174c34[_0x34e949][0x0]['type'],'app':_0x1508('0x1d'),'appdata':'$[${LEN(${CDR(prefix)})}\x20>\x200]?Goto('+(_0x398501+0x2)+_0x1508('0x1e')+(_0x398501+0x1)+')','context':_0x174c34[_0x34e949][0x0][_0x1508('0x16')],'exten':_0x174c34[_0x34e949][0x0][_0x1508('0xb')],'priority':_0x398501,'VoiceExtensionId':_0x174c34[_0x34e949][0x0][_0x1508('0x17')]});if(_0x2b637f[_0x1508('0x11')]){_0x2b637f[_0x1508('0x10')][_0x1508('0x12')]({'type':_0x174c34[_0x34e949][0x0][_0x1508('0x13')],'app':_0x1508('0x14'),'appdata':_0x2b637f[_0x1508('0x11')]['cutdigits']?_0x1508('0x1f')+_0x2b637f[_0x1508('0x11')]['cutdigits']+'}':_0x1508('0x20'),'context':_0x174c34[_0x34e949][0x0][_0x1508('0x16')],'exten':_0x174c34[_0x34e949][0x0]['exten'],'priority':_0x2b637f[_0x1508('0xf')]++,'VoiceExtensionId':_0x174c34[_0x34e949][0x0][_0x1508('0x17')]});}_0x2b637f[_0x1508('0x10')][_0x1508('0x12')]({'type':_0x174c34[_0x34e949][0x0]['type'],'app':'Set','appdata':_0x1508('0x21')+_0x174c34[_0x34e949][0x0][_0x1508('0x17')],'context':_0x174c34[_0x34e949][0x0][_0x1508('0x16')],'exten':_0x174c34[_0x34e949][0x0][_0x1508('0xb')],'priority':_0x2b637f['priority']++,'VoiceExtensionId':_0x174c34[_0x34e949][0x0][_0x1508('0x17')]});if(_0x2b637f[_0x1508('0x11')]&&_0x2b637f[_0x1508('0x11')][_0x1508('0xe')](_0x1508('0x22'))&&_0x2b637f[_0x1508('0x11')]['recordingFormat']!==_0x1508('0x23')){_0x2b637f[_0x1508('0x10')][_0x1508('0x12')]({'type':_0x174c34[_0x34e949][0x0]['type'],'app':_0x1508('0x14'),'appdata':_0x1508('0x24'),'context':_0x174c34[_0x34e949][0x0][_0x1508('0x16')],'exten':_0x174c34[_0x34e949][0x0][_0x1508('0xb')],'priority':_0x2b637f['priority']++,'VoiceExtensionId':_0x174c34[_0x34e949][0x0]['VoiceExtensionId']});_0x2b637f[_0x1508('0x10')][_0x1508('0x12')]({'type':_0x174c34[_0x34e949][0x0][_0x1508('0x13')],'app':_0x1508('0x14'),'appdata':_0x1508('0x25')+_0x2b637f[_0x1508('0x11')][_0x1508('0x22')]||_0x1508('0x26'),'context':_0x174c34[_0x34e949][0x0]['context'],'exten':_0x174c34[_0x34e949][0x0][_0x1508('0xb')],'priority':_0x2b637f[_0x1508('0xf')]++,'VoiceExtensionId':_0x174c34[_0x34e949][0x0][_0x1508('0x17')]});}}_0x2b637f[_0x1508('0x10')]['push']({'type':_0x174c34[_0x34e949][0x0][_0x1508('0x13')],'app':_0x1508('0x14'),'appdata':_0x1508('0x27'),'context':_0x174c34[_0x34e949][0x0][_0x1508('0x16')],'exten':_0x174c34[_0x34e949][0x0][_0x1508('0xb')],'priority':_0x2b637f['priority']++,'VoiceExtensionId':_0x174c34[_0x34e949][0x0][_0x1508('0x17')]});_0x2b637f['extensions'][_0x1508('0x12')]({'type':_0x174c34[_0x34e949][0x0][_0x1508('0x13')],'app':_0x1508('0x14'),'appdata':_0x1508('0x28'),'context':_0x174c34[_0x34e949][0x0][_0x1508('0x16')],'exten':_0x174c34[_0x34e949][0x0]['exten'],'priority':_0x2b637f[_0x1508('0xf')]++,'VoiceExtensionId':_0x174c34[_0x34e949][0x0][_0x1508('0x17')]});_0x2b637f[_0x1508('0x10')][_0x1508('0x12')]({'type':_0x174c34[_0x34e949][0x0][_0x1508('0x13')],'app':_0x1508('0x14'),'appdata':_0x1508('0x29'),'context':_0x174c34[_0x34e949][0x0]['context'],'exten':_0x174c34[_0x34e949][0x0][_0x1508('0xb')],'priority':_0x2b637f[_0x1508('0xf')]++,'VoiceExtensionId':_0x174c34[_0x34e949][0x0][_0x1508('0x17')]});for(var _0x5a3c89=0x0,_0x1dbf41=0x0;_0x5a3c89<_0x174c34[_0x34e949][_0x1508('0x2a')];_0x5a3c89+=0x1,_0x1dbf41=0x0){var _0x5a2527=_0x174c34[_0x34e949][_0x5a3c89];if(_0x5a2527[_0x1508('0x13')]){_0x5a2527[_0x1508('0x13')]=_0x5a2527[_0x1508('0x13')][_0x1508('0x2b')]();}var _0x195ec6=[];var _0x5bc063=[];delete _0x5a2527['id'];delete _0x5a2527['createdAt'];delete _0x5a2527[_0x1508('0x2c')];var _0xae9be7=_0x5a2527[_0x1508('0x2d')]!==_0x1508('0x2e')?[_0x5a2527[_0x1508('0x2d')]]:_0x5a2527[_0x1508('0x2f')]?_[_0x1508('0x9')](_[_0x1508('0xa')](_0x2b637f[_0x1508('0x6')],{'IntervalId':_0x5a2527[_0x1508('0x2f')]}),_0x1508('0x2d')):[];if(_0x5a2527[_0x1508('0xe')](_0x1508('0x30'))){if(_0x5a2527[_0x1508('0x30')]&&_0x5a2527['tag']!=='--'){_0x195ec6[_0x1508('0x12')]({'type':_0x5a2527['type'],'app':'Set','appdata':_0x1508('0x31')+_0x5a2527['tag'],'context':_0x5a2527[_0x1508('0x16')],'exten':_0x5a2527['exten'],'priority':_0xae9be7[_0x1508('0x2a')]+_0x2b637f[_0x1508('0xf')]+_0x1dbf41++,'VoiceExtensionId':_0x5a2527['VoiceExtensionId']});}}if(_0x5a2527[_0x1508('0x13')]===_0x1508('0x18')&&_0x5a2527[_0x1508('0xe')](_0x1508('0x32'))){if(_0x5a2527[_0x1508('0x32')]){_0x195ec6[_0x1508('0x12')]({'type':_0x5a2527[_0x1508('0x13')],'app':_0x1508('0x1d'),'appdata':_0x1508('0x33')+_0x5a2527[_0x1508('0x32')]+')','context':_0x5a2527['context'],'exten':_0x5a2527[_0x1508('0xb')],'priority':_0xae9be7[_0x1508('0x2a')]+_0x2b637f[_0x1508('0xf')]+_0x1dbf41++,'VoiceExtensionId':_0x5a2527[_0x1508('0x17')]});}else{_0x195ec6[_0x1508('0x12')]({'type':_0x5a2527['type'],'app':_0x1508('0x1d'),'appdata':_0x1508('0x34'),'context':_0x5a2527[_0x1508('0x16')],'exten':_0x5a2527[_0x1508('0xb')],'priority':_0xae9be7[_0x1508('0x2a')]+_0x2b637f[_0x1508('0xf')]+_0x1dbf41++,'VoiceExtensionId':_0x5a2527['VoiceExtensionId']});}}if(_0x5a2527[_0x1508('0xe')](_0x1508('0x35'))){if(_0x3a47e4[_0x1508('0x36')](_0x5a2527['app']['toLowerCase']())>=0x0&&_0x5a2527[_0x1508('0x37')]!==_0x1508('0x38')){if(_0x5a2527['answer']){_0x195ec6[_0x1508('0x12')]({'type':_0x5a2527[_0x1508('0x13')],'app':_0x1508('0x1d'),'appdata':_0x1508('0x39'),'context':_0x5a2527['context'],'exten':_0x5a2527['exten'],'priority':_0xae9be7['length']+_0x2b637f[_0x1508('0xf')]+_0x1dbf41++,'VoiceExtensionId':_0x5a2527[_0x1508('0x17')]});_0x195ec6[_0x1508('0x12')]({'type':_0x5a2527[_0x1508('0x13')],'app':_0x1508('0x14'),'appdata':_0x1508('0x3a'),'context':_0x5a2527[_0x1508('0x16')],'exten':_0x5a2527['exten'],'priority':_0xae9be7[_0x1508('0x2a')]+_0x2b637f[_0x1508('0xf')]+_0x1dbf41++,'VoiceExtensionId':_0x5a2527[_0x1508('0x17')]});}else{_0x195ec6[_0x1508('0x12')]({'type':_0x5a2527[_0x1508('0x13')],'app':_0x1508('0x1d'),'appdata':_0x1508('0x3b'),'context':_0x5a2527['context'],'exten':_0x5a2527[_0x1508('0xb')],'priority':_0xae9be7[_0x1508('0x2a')]+_0x2b637f['priority']+_0x1dbf41++,'VoiceExtensionId':_0x5a2527[_0x1508('0x17')]});_0x195ec6[_0x1508('0x12')]({'type':_0x5a2527[_0x1508('0x13')],'app':_0x1508('0x14'),'appdata':_0x1508('0x3c'),'context':_0x5a2527[_0x1508('0x16')],'exten':_0x5a2527[_0x1508('0xb')],'priority':_0xae9be7[_0x1508('0x2a')]+_0x2b637f[_0x1508('0xf')]+_0x1dbf41++,'VoiceExtensionId':_0x5a2527[_0x1508('0x17')]});}}}for(var _0x52e813=0x0;_0x52e813<_0xae9be7['length'];_0x52e813+=0x1){var _0x594384=_0x2b637f[_0x1508('0xf')]+_0xae9be7[_0x1508('0x2a')];var _0xb97752=_0x52e813===_0xae9be7[_0x1508('0x2a')]-0x1?_0x2b637f[_0x1508('0xf')]+_0x195ec6[_0x1508('0x2a')]+_0x5bc063[_0x1508('0x2a')]+0x2:_0x2b637f[_0x1508('0xf')]+_0x52e813+0x1;_0x195ec6[_0x1508('0x3d')](_0x52e813,0x0,{'type':_0x5a2527[_0x1508('0x13')],'app':'GotoIfTime','appdata':_0xae9be7[_0x52e813]+'?'+_0x5a2527[_0x1508('0x16')]+_0x1508('0x3e')+_0x594384+':'+_0x5a2527[_0x1508('0x16')]+',${EXTEN},'+_0xb97752,'exten':_0x5a2527[_0x1508('0xb')],'context':_0x5a2527[_0x1508('0x16')],'priority':_0x2b637f[_0x1508('0xf')]+_0x52e813,'VoiceExtensionId':_0x174c34[_0x34e949][0x0][_0x1508('0x17')]});}_0x5a2527[_0x1508('0xf')]=_0x195ec6[_0x1508('0x2a')]?_[_0x1508('0x3f')](_0x195ec6)[_0x1508('0xf')]+0x1:_0x2b637f[_0x1508('0xf')];_0x2b637f[_0x1508('0xf')]=(_0x5bc063[_0x1508('0x2a')]?_[_0x1508('0x3f')](_0x5bc063)[_0x1508('0xf')]:_0x5a2527[_0x1508('0xf')])+0x1;_0x2b637f[_0x1508('0x10')]=_[_0x1508('0x40')](_0x2b637f[_0x1508('0x10')],_0x195ec6,[_0x5a2527],_0x5bc063);}_0x2b637f[_0x1508('0x10')][_0x1508('0x12')]({'type':_0x174c34[_0x34e949][0x0][_0x1508('0x13')],'app':_0x1508('0x41'),'exten':_0x174c34[_0x34e949][0x0][_0x1508('0xb')],'context':_0x174c34[_0x34e949][0x0][_0x1508('0x16')],'priority':_0x2b637f[_0x1508('0xf')],'VoiceExtensionId':_0x174c34[_0x34e949][0x0][_0x1508('0x17')]});_0x4cd713[_0x1508('0x12')](_0x174c34[_0x34e949][0x0]['VoiceExtensionId']);_0x8f028e=_[_0x1508('0x40')](_0x8f028e,_0x2b637f[_0x1508('0x10')]);}}return _0x3d56df[_0x1508('0x42')](function(_0x54a7bc){return _0x3d56df[_0x1508('0x2')][_0x1508('0x7')][_0x1508('0x43')]({'where':{'VoiceExtensionId':{'$in':_0x4cd713}},'transaction':_0x54a7bc})[_0x1508('0x5')](function(_0x1c4d56){return _0x3d56df[_0x1508('0x2')]['VoiceExtension']['bulkCreate'](_[_0x1508('0x44')](_0x8f028e,_0x1508('0xf')),{'transaction':_0x54a7bc});});});})['catch'](function(_0x1e4ad7){console[_0x1508('0x45')](_0x1e4ad7);});}exports['rewrite']=rewrite;
\ No newline at end of file
diff --git a/server/components/import/cm/csv.js b/server/components/import/cm/csv.js
index 6fbf704..0b1355d 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 _0xcb91=['generalCheckHopper','Error\x20processing\x20rows\x20block:','resolve','emit','contact:csv_','unlinkSync','exit','SIGINT','CSV\x20import\x20process\x20stopped!','createReadStream','CSV\x20parsed\x20correctly!','CSV\x20parse\x20error','Error\x20executing\x20contact\x20csv\x20import:','lodash','squel','papaparse','ioredis','../../../config/environment','../../../config/logger','redis','defaults','localhost','socket.io-emitter','../../../api/cmContact/cmContact.socket','register','argv','null','Missing\x20filepath\x20parameter!','undefined','zipObject','split','error','contact','index','test','isNil','The\x20row\x20is\x20empty\x20or\x20the\x20number\x20of\x20parameters\x20does\x20not\x20match\x20the\x20columns!','errors','length','message','join','hasOwnProperty','data','firstName','firstName\x20not\x20specified!','birthDate','YYYY-MM-DD','email','ListId','duplicate','Duplicate\x20Contact','CmContact','create','keys','then','push','pick','catch','stringify','cmContact','checkHopper','inspect','insert','cm_hopper','phone','ContactId','createdAt','updatedAt','select','field','NOW()','scheduledAt','toString','from','cm_contacts','deletedAt\x20IS\x20NULL','ListId\x20=\x20?','where','\x20=\x20?','into','fromQuery','id\x20IN\x20?','str','phone\x20IS\x20NOT\x20NULL','calleridnum','cm_hopper_final','phone\x20NOT\x20IN\x20(?)','findAll','outbound','dialCheckDuplicateType','CmList','Lists','always','sequelize','query','VoiceQueueId','all','VoiceQueue','BlackLists','get','CampaignId','onlyIfOpen','cmContact,\x20%s,\x20%s'];(function(_0x117fbe,_0x3ffc68){var _0x42ce34=function(_0x2ddb7f){while(--_0x2ddb7f){_0x117fbe['push'](_0x117fbe['shift']());}};_0x42ce34(++_0x3ffc68);}(_0xcb91,0x1a9));var _0x1cb9=function(_0x13187a,_0x2fcec4){_0x13187a=_0x13187a-0x0;var _0x65b85f=_0xcb91[_0x13187a];return _0x65b85f;};'use strict';var BPromise=require('bluebird');var util=require('util');var _=require(_0x1cb9('0x0'));var fs=require('fs');var squel=require(_0x1cb9('0x1'));var Papa=require(_0x1cb9('0x2'));var Redis=require(_0x1cb9('0x3'));var db=require('../../../mysqldb')['db'];var config=require(_0x1cb9('0x4'));var logger=require(_0x1cb9('0x5'))('api');config[_0x1cb9('0x6')]=_[_0x1cb9('0x7')](config['redis'],{'host':_0x1cb9('0x8'),'port':0x18eb});var socket=require(_0x1cb9('0x9'))(new Redis(config['redis']));require(_0x1cb9('0xa'))[_0x1cb9('0xb')](socket);try{if(!process['argv'][0x2]||process[_0x1cb9('0xc')][0x2]==='undefined'||process['argv'][0x2]===_0x1cb9('0xd')){throw new Error(_0x1cb9('0xe'));}var FILEPATH=process[_0x1cb9('0xc')][0x2];if(!process[_0x1cb9('0xc')][0x3]||process[_0x1cb9('0xc')][0x3]==='undefined'||process[_0x1cb9('0xc')][0x3]===_0x1cb9('0xd')||!process[_0x1cb9('0xc')][0x4]||process[_0x1cb9('0xc')][0x4]===_0x1cb9('0xf')||process['argv'][0x4]==='null'){throw new Error('Missing\x20binding\x20parameters!');}var FIELDS=_[_0x1cb9('0x10')](process[_0x1cb9('0xc')][0x3][_0x1cb9('0x11')](','),process[_0x1cb9('0xc')][0x4]['split'](','));if(!process[_0x1cb9('0xc')][0x5]||process[_0x1cb9('0xc')][0x5]===_0x1cb9('0xf')||process[_0x1cb9('0xc')][0x5]===_0x1cb9('0xd')){throw new Error('Missing\x20ListId\x20parameter!');}var LISTID=process['argv'][0x5];var COMPANYID=process[_0x1cb9('0xc')][0x6]&&process[_0x1cb9('0xc')][0x6]!==_0x1cb9('0xf')&&process[_0x1cb9('0xc')][0x6]!==_0x1cb9('0xd')?process[_0x1cb9('0xc')][0x6]:null;var DUPLICATES=process[_0x1cb9('0xc')][0x7]&&process['argv'][0x7]!=='undefined'&&process[_0x1cb9('0xc')][0x7]!==_0x1cb9('0xd')?process[_0x1cb9('0xc')][0x7]:null;if(!process[_0x1cb9('0xc')][0x8]||process[_0x1cb9('0xc')][0x8]===_0x1cb9('0xf')||process[_0x1cb9('0xc')][0x8]==='null'){throw new Error('Missing\x20socket_timestamp\x20parameter!');}var SOCKET_TIMESTAMP=process[_0x1cb9('0xc')][0x8];}catch(_0x5dbfae){logger[_0x1cb9('0x12')](_0x5dbfae);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(_0x2265ea,_0x523b26,_0x599275,_0x2e3854){var _0x325637={'message':_0x523b26};_0x325637[_0x2265ea]=!![];if(_0x599275){_0x325637[_0x1cb9('0x13')]=_0x599275;}if(_0x2e3854){_0x325637[_0x1cb9('0x14')]=_0x2e3854;}return _0x325637;}function isEmail(_0x45b8d3){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))*$/[_0x1cb9('0x15')](_0x45b8d3);}function checkRow(_0x59ebea,_0x55b232,_0x6c6f61){return new BPromise(function(_0x557199,_0x10a419){if(_[_0x1cb9('0x16')](_0x59ebea)){return _0x10a419(handleCheckRowError(_0x1cb9('0x12'),_0x1cb9('0x17'),null,_0x6c6f61));}if(_0x59ebea[_0x1cb9('0x18')]&&_0x59ebea['errors'][_0x1cb9('0x19')]){var _0x9df250=_['map'](_0x59ebea[_0x1cb9('0x18')],_0x1cb9('0x1a'))[_0x1cb9('0x1b')](';');return _0x10a419(handleCheckRowError(_0x1cb9('0x12'),_0x9df250,null,_0x6c6f61));}var _0x406821={};for(var _0x21d6f5 in FIELDS){if(FIELDS[_0x1cb9('0x1c')](_0x21d6f5)&&FIELDS[_0x21d6f5]){_0x406821[_0x21d6f5]=_0x59ebea[_0x1cb9('0x1d')][0x0][FIELDS[_0x21d6f5]]||_0x59ebea[_0x1cb9('0x1d')][0x0]['\ufeff'+FIELDS[_0x21d6f5]];}}if(!_0x406821[_0x1cb9('0x1e')]){return _0x10a419(handleCheckRowError('error',_0x1cb9('0x1f'),null,_0x6c6f61));}if(!_0x406821['phone']){return _0x10a419(handleCheckRowError(_0x1cb9('0x12'),'phone\x20not\x20specified!',null,_0x6c6f61));}if(_0x406821[_0x1cb9('0x20')]){var _0x41011c=moment(_0x406821[_0x1cb9('0x20')],_0x1cb9('0x21'));if(!_0x41011c['isValid']()){return _0x10a419(handleCheckRowError(_0x1cb9('0x12'),'birthDate\x20format\x20is\x20invalid,\x20YYYY-MM-DD\x20format\x20is\x20supported!',null,_0x6c6f61));}}if(_0x406821[_0x1cb9('0x22')]){if(!isEmail(_0x406821[_0x1cb9('0x22')])){return _0x10a419(handleCheckRowError(_0x1cb9('0x12'),'email\x20format\x20is\x20not\x20valid!',null,_0x6c6f61));}}_0x406821[_0x1cb9('0x23')]=LISTID;_0x406821['CompanyId']=COMPANYID||undefined;if(DUPLICATES&&DUPLICATES[_0x1cb9('0x19')]&&_0x55b232){var _0x58f4f5={};for(var _0x2164e3=0x0,_0x42a688=DUPLICATES[_0x1cb9('0x19')];_0x2164e3<_0x42a688;_0x2164e3+=0x1){_0x58f4f5[DUPLICATES[_0x2164e3]]=_0x406821[DUPLICATES[_0x2164e3]];}var _0xae910=_['find'](_0x55b232,_0x58f4f5);if(_0xae910){return _0x10a419(handleCheckRowError(_0x1cb9('0x24'),_0x1cb9('0x25'),_0xae910,_0x6c6f61));}}return db[_0x1cb9('0x26')][_0x1cb9('0x27')](_0x406821,{'raw':!![],'hooks':![],'fields':_[_0x1cb9('0x28')](_0x406821)})[_0x1cb9('0x29')](function(_0xc6d5fd){if(DUPLICATES&&DUPLICATES[_0x1cb9('0x19')]&&_0x55b232){_0x55b232[_0x1cb9('0x2a')](_[_0x1cb9('0x2b')](_0x406821,DUPLICATES));}hopperContacts+=(hopperContacts?',':'')+_0xc6d5fd['id'];return _0x557199();})[_0x1cb9('0x2c')](function(_0x26b950){return _0x10a419(handleCheckRowError(_0x1cb9('0x12'),'Error\x20while\x20creating\x20contact:\x20'+(_0x26b950['message']||JSON[_0x1cb9('0x2d')](_0x26b950)),null,_0x6c6f61));});});}function checkHopper(){function _0x30f7e4(){return function(_0x91c937){logger[_0x1cb9('0x12')](_0x1cb9('0x2e'),_0x1cb9('0x2f'),util[_0x1cb9('0x30')](_0x91c937,{'showHidden':![],'depth':null}));};}var _0x3f5637=function(_0x4d3e39,_0x2aa59b){var _0x1482c4=squel[_0x1cb9('0x31')]()['into'](_0x1cb9('0x32'))['fromQuery']([_0x1cb9('0x33'),'scheduledAt',_0x1cb9('0x34'),_0x1cb9('0x23'),_0x2aa59b,_0x1cb9('0x35'),_0x1cb9('0x36')],squel[_0x1cb9('0x37')]()[_0x1cb9('0x38')](_0x1cb9('0x33'),'phone')['field'](_0x1cb9('0x39'),_0x1cb9('0x3a'))[_0x1cb9('0x38')]('id',_0x1cb9('0x34'))[_0x1cb9('0x38')](LISTID[_0x1cb9('0x3b')](),_0x1cb9('0x23'))['field'](_0x4d3e39['id'][_0x1cb9('0x3b')](),_0x2aa59b)['field']('NOW()','createdAt')[_0x1cb9('0x38')](_0x1cb9('0x39'),_0x1cb9('0x36'))[_0x1cb9('0x3c')](_0x1cb9('0x3d'))['where'](_0x1cb9('0x3e'))['where'](_0x1cb9('0x3f'),LISTID[_0x1cb9('0x3b')]())[_0x1cb9('0x40')]('phone\x20IS\x20NOT\x20NULL')[_0x1cb9('0x40')]('phone\x20NOT\x20IN\x20(?)',squel[_0x1cb9('0x37')]()[_0x1cb9('0x38')]('phone')['from'](_0x1cb9('0x32'))[_0x1cb9('0x40')](_0x2aa59b+_0x1cb9('0x41'),_0x4d3e39['id'][_0x1cb9('0x3b')]())))[_0x1cb9('0x3b')]();return _0x1482c4;};var _0x58832e=function(_0x11d877,_0x5594fc){var _0x4c59e7=squel['insert']()[_0x1cb9('0x42')](_0x1cb9('0x32'))[_0x1cb9('0x43')]([_0x1cb9('0x33'),_0x1cb9('0x3a'),_0x1cb9('0x34'),_0x1cb9('0x23'),_0x5594fc,_0x1cb9('0x35'),_0x1cb9('0x36')],squel[_0x1cb9('0x37')]()[_0x1cb9('0x38')]('phone',_0x1cb9('0x33'))[_0x1cb9('0x38')](_0x1cb9('0x39'),'scheduledAt')[_0x1cb9('0x38')]('id',_0x1cb9('0x34'))[_0x1cb9('0x38')](LISTID[_0x1cb9('0x3b')](),_0x1cb9('0x23'))['field'](_0x11d877['id'][_0x1cb9('0x3b')](),_0x5594fc)['field'](_0x1cb9('0x39'),'createdAt')[_0x1cb9('0x38')](_0x1cb9('0x39'),_0x1cb9('0x36'))[_0x1cb9('0x3c')]('cm_contacts')[_0x1cb9('0x40')](_0x1cb9('0x3e'))[_0x1cb9('0x40')](_0x1cb9('0x3f'),LISTID[_0x1cb9('0x3b')]())[_0x1cb9('0x40')](_0x1cb9('0x44'),squel[_0x1cb9('0x45')](hopperContacts))[_0x1cb9('0x40')](_0x1cb9('0x46'))['where']('phone\x20NOT\x20IN\x20(?)',squel[_0x1cb9('0x37')]()[_0x1cb9('0x38')](_0x1cb9('0x47'))[_0x1cb9('0x3c')](_0x1cb9('0x48'))[_0x1cb9('0x40')](_0x5594fc+_0x1cb9('0x41'),_0x11d877['id'][_0x1cb9('0x3b')]()))[_0x1cb9('0x40')](_0x1cb9('0x49'),squel['select']()[_0x1cb9('0x38')]('phone')[_0x1cb9('0x3c')]('cm_hopper')[_0x1cb9('0x40')](_0x5594fc+'\x20=\x20?',_0x11d877['id']['toString']())))[_0x1cb9('0x3b')]();return _0x4c59e7;};function _0x3b0c2e(_0x303da3,_0x4bce54){var _0x3c157f=squel[_0x1cb9('0x31')]()['into']('cm_hopper')[_0x1cb9('0x43')]([_0x1cb9('0x33'),_0x1cb9('0x3a'),_0x1cb9('0x34'),_0x1cb9('0x23'),_0x4bce54,_0x1cb9('0x35'),_0x1cb9('0x36')],squel['select']()[_0x1cb9('0x38')](_0x1cb9('0x33'),_0x1cb9('0x33'))['field'](_0x1cb9('0x39'),_0x1cb9('0x3a'))[_0x1cb9('0x38')]('id',_0x1cb9('0x34'))[_0x1cb9('0x38')](LISTID[_0x1cb9('0x3b')](),'ListId')[_0x1cb9('0x38')](_0x303da3['id'][_0x1cb9('0x3b')](),_0x4bce54)[_0x1cb9('0x38')](_0x1cb9('0x39'),_0x1cb9('0x35'))[_0x1cb9('0x38')](_0x1cb9('0x39'),_0x1cb9('0x36'))[_0x1cb9('0x3c')](_0x1cb9('0x3d'))[_0x1cb9('0x40')]('deletedAt\x20IS\x20NULL')[_0x1cb9('0x40')](_0x1cb9('0x3f'),LISTID[_0x1cb9('0x3b')]())[_0x1cb9('0x40')]('id\x20IN\x20?',squel['str'](hopperContacts))[_0x1cb9('0x40')](_0x1cb9('0x46')))[_0x1cb9('0x3b')]();return _0x3c157f;}function _0x173db5(_0x3c2f9c,_0x75c734){var _0xc515a6=squel[_0x1cb9('0x31')]()['into']('cm_hopper_black')[_0x1cb9('0x43')](['phone','ContactId','ListId',_0x75c734,'createdAt','updatedAt'],squel[_0x1cb9('0x37')]()[_0x1cb9('0x38')](_0x1cb9('0x33'),_0x1cb9('0x33'))[_0x1cb9('0x38')]('id',_0x1cb9('0x34'))['field'](LISTID[_0x1cb9('0x3b')](),_0x1cb9('0x23'))['field'](_0x3c2f9c['id']['toString'](),_0x75c734)[_0x1cb9('0x38')](_0x1cb9('0x39'),_0x1cb9('0x35'))[_0x1cb9('0x38')](_0x1cb9('0x39'),'updatedAt')['from']('cm_contacts')[_0x1cb9('0x40')](_0x1cb9('0x3e'))[_0x1cb9('0x40')](_0x1cb9('0x3f'),LISTID[_0x1cb9('0x3b')]())['where'](_0x1cb9('0x44'),squel[_0x1cb9('0x45')](hopperContacts))['where']('phone\x20IS\x20NOT\x20NULL'))[_0x1cb9('0x3b')]();return _0xc515a6;}return db['VoiceQueue'][_0x1cb9('0x4a')]({'where':{'type':_0x1cb9('0x4b')},'attributes':['id',_0x1cb9('0x4c')],'include':[{'model':db[_0x1cb9('0x4d')],'as':_0x1cb9('0x4e'),'where':{'id':LISTID}}]})[_0x1cb9('0x29')](function(_0x4aeeff){var _0xde0d93=[];if(_0x4aeeff){var _0x15fc04;for(var _0x330fc1=0x0,_0x17c361;_0x330fc1<_0x4aeeff['length'];_0x330fc1+=0x1){_0x17c361=_0x4aeeff[_0x330fc1]['get']({'plain':!![]});switch(_0x17c361[_0x1cb9('0x4c')]){case _0x1cb9('0x4f'):_0xde0d93[_0x1cb9('0x2a')](db[_0x1cb9('0x50')][_0x1cb9('0x51')](_0x58832e(_0x17c361,_0x1cb9('0x52')))['then'](function(){})[_0x1cb9('0x2c')](_0x30f7e4()));break;case'onlyIfOpen':_0xde0d93[_0x1cb9('0x2a')](db[_0x1cb9('0x50')]['query'](_0x3f5637(_0x17c361,_0x1cb9('0x52')))[_0x1cb9('0x29')](function(){})[_0x1cb9('0x2c')](_0x30f7e4()));break;default:_0xde0d93['push'](db[_0x1cb9('0x50')][_0x1cb9('0x51')](_0x3b0c2e(_0x17c361,_0x1cb9('0x52')))[_0x1cb9('0x29')](function(){})[_0x1cb9('0x2c')](_0x30f7e4()));}}}return _0xde0d93;})[_0x1cb9('0x53')]()['then'](function(){return db[_0x1cb9('0x54')][_0x1cb9('0x4a')]({'where':{'type':_0x1cb9('0x4b')},'attributes':['id'],'include':[{'model':db[_0x1cb9('0x4d')],'as':_0x1cb9('0x55'),'where':{'id':LISTID}}]})[_0x1cb9('0x29')](function(_0x128a41){var _0x37bcd9=[];if(_0x128a41){var _0x4cd544;for(var _0x28bac2=0x0,_0x78e9c;_0x28bac2<_0x128a41['length'];_0x28bac2+=0x1){_0x78e9c=_0x128a41[_0x28bac2][_0x1cb9('0x56')]({'plain':!![]});_0x37bcd9['push'](db[_0x1cb9('0x50')]['query'](_0x173db5(_0x78e9c,'VoiceQueueId'))[_0x1cb9('0x29')](function(){})[_0x1cb9('0x2c')](_0x30f7e4()));}}return _0x37bcd9;})['all']();})[_0x1cb9('0x29')](function(){return db['Campaign'][_0x1cb9('0x4a')]({'attributes':['id',_0x1cb9('0x4c')],'include':[{'model':db[_0x1cb9('0x4d')],'as':_0x1cb9('0x4e'),'where':{'id':LISTID}}]})['then'](function(_0x45ca54){var _0x3d25a3=[];if(_0x45ca54){for(var _0x2a157d=0x0,_0x27cc3c;_0x2a157d<_0x45ca54[_0x1cb9('0x19')];_0x2a157d+=0x1){_0x27cc3c=_0x45ca54[_0x2a157d][_0x1cb9('0x56')]({'plain':!![]});switch(_0x27cc3c['dialCheckDuplicateType']){case _0x1cb9('0x4f'):_0x3d25a3[_0x1cb9('0x2a')](db[_0x1cb9('0x50')][_0x1cb9('0x51')](_0x58832e(_0x27cc3c,_0x1cb9('0x57')))[_0x1cb9('0x29')](function(){})['catch'](_0x30f7e4()));break;case _0x1cb9('0x58'):_0x3d25a3[_0x1cb9('0x2a')](db['sequelize'][_0x1cb9('0x51')](_0x3f5637(_0x27cc3c,_0x1cb9('0x57')))[_0x1cb9('0x29')](function(){})[_0x1cb9('0x2c')](_0x30f7e4()));break;default:_0x3d25a3[_0x1cb9('0x2a')](db[_0x1cb9('0x50')][_0x1cb9('0x51')](_0x3b0c2e(_0x27cc3c,'CampaignId'))[_0x1cb9('0x29')](function(){})['catch'](_0x30f7e4()));}}}return _0x3d25a3;})[_0x1cb9('0x53')]();})[_0x1cb9('0x29')](function(){return db['Campaign'][_0x1cb9('0x4a')]({'attributes':['id'],'include':[{'model':db[_0x1cb9('0x4d')],'as':_0x1cb9('0x55'),'where':{'id':LISTID}}]})[_0x1cb9('0x29')](function(_0x56f23d){var _0x113367=[];if(_0x56f23d){for(var _0x39b0cb=0x0,_0x429371;_0x39b0cb<_0x56f23d['length'];_0x39b0cb+=0x1){_0x429371=_0x56f23d[_0x39b0cb][_0x1cb9('0x56')]({'plain':!![]});_0x113367[_0x1cb9('0x2a')](db[_0x1cb9('0x50')][_0x1cb9('0x51')](_0x173db5(_0x429371,_0x1cb9('0x57')))[_0x1cb9('0x29')](function(){})[_0x1cb9('0x2c')](_0x30f7e4()));}}return _0x113367;})['all']();})[_0x1cb9('0x2c')](function(_0x4b15a4){logger[_0x1cb9('0x12')](_0x1cb9('0x59'),_0x1cb9('0x5a'),_0x4b15a4[_0x1cb9('0x1a')]);});}var processPromises=function(_0x4bdbd2){return BPromise[_0x1cb9('0x53')](promises)[_0x1cb9('0x29')](function(_0x5e68a1){})[_0x1cb9('0x2c')](function(_0x416508){logger[_0x1cb9('0x12')](_0x1cb9('0x5b'),JSON[_0x1cb9('0x2d')](_0x416508));})['finally'](function(){socket['emit']('contact:csv_'+SOCKET_TIMESTAMP,{'success':success,'errors':errors,'duplicates':duplicates,'rows':rows});promises=[];success=0x0;errors=0x0;duplicates=0x0;rows=[];if(_0x4bdbd2){return _0x4bdbd2['resume']();}});};var endCsv=function(){return BPromise[_0x1cb9('0x5c')]()[_0x1cb9('0x29')](function(){if(hopperContacts){return checkHopper();}})[_0x1cb9('0x29')](function(){socket[_0x1cb9('0x5d')](_0x1cb9('0x5e')+SOCKET_TIMESTAMP,{'finished':!![],'success':success,'errors':errors,'duplicates':duplicates,'rows':rows});try{fs[_0x1cb9('0x5f')](FILEPATH);}catch(_0x1e6402){logger[_0x1cb9('0x12')]('Unable\x20to\x20delete\x20temp\x20file:',JSON[_0x1cb9('0x2d')](_0x1e6402));}finally{process[_0x1cb9('0x60')](0x0);}});};process['on'](_0x1cb9('0x61'),function(){logger['info'](_0x1cb9('0x62'));endCsv();});function main(){return BPromise[_0x1cb9('0x5c')]()['then'](function(){if(DUPLICATES){DUPLICATES=DUPLICATES[_0x1cb9('0x11')](',');return db[_0x1cb9('0x26')][_0x1cb9('0x4a')]({'where':{'ListId':LISTID},'attributes':DUPLICATES,'raw':!![]});}})[_0x1cb9('0x29')](function(_0x5cb5e5){var _0x2c0416=fs[_0x1cb9('0x63')](FILEPATH,{'highWaterMark':0xf*0x400*0x400});Papa['parse'](_0x2c0416,{'header':!![],'skipEmptyLines':!![],'step':function(_0x5bd78d,_0x1f2d69){total+=0x1;var _0x3ba0a5=total;promises['push'](checkRow(_0x5bd78d,_0x5cb5e5,_0x3ba0a5)['then'](function(){success+=0x1;})[_0x1cb9('0x2c')](function(_0x3486e5){if(_0x3486e5['error']){errors+=0x1;delete _0x3486e5['error'];}else if(_0x3486e5[_0x1cb9('0x24')]){duplicates+=0x1;delete _0x3486e5['duplicate'];}rows['push'](_0x3486e5);}));if(total%0xc8===0x0){_0x1f2d69['pause']();return processPromises(_0x1f2d69);}},'complete':function(){return processPromises()[_0x1cb9('0x29')](function(){logger['info'](_0x1cb9('0x64'));endCsv();});},'error':function(_0x3c717b,_0x33ec43){logger['info'](_0x1cb9('0x65'),JSON[_0x1cb9('0x2d')](_0x3c717b));endCsv();}});})[_0x1cb9('0x2c')](function(_0x4c54b5){logger[_0x1cb9('0x12')](_0x1cb9('0x66'),JSON[_0x1cb9('0x2d')](_0x4c54b5));});}main();
\ No newline at end of file
+var _0xcb91=['generalCheckHopper','Error\x20processing\x20rows\x20block:','resolve','emit','contact:csv_','unlinkSync','exit','SIGINT','CSV\x20import\x20process\x20stopped!','createReadStream','CSV\x20parsed\x20correctly!','CSV\x20parse\x20error','Error\x20executing\x20contact\x20csv\x20import:','lodash','squel','papaparse','ioredis','../../../config/environment','../../../config/logger','redis','defaults','localhost','socket.io-emitter','../../../api/cmContact/cmContact.socket','register','argv','null','Missing\x20filepath\x20parameter!','undefined','zipObject','split','error','contact','index','test','isNil','The\x20row\x20is\x20empty\x20or\x20the\x20number\x20of\x20parameters\x20does\x20not\x20match\x20the\x20columns!','errors','length','message','join','hasOwnProperty','data','firstName','firstName\x20not\x20specified!','birthDate','YYYY-MM-DD','email','ListId','duplicate','Duplicate\x20Contact','CmContact','create','keys','then','push','pick','catch','stringify','cmContact','checkHopper','inspect','insert','cm_hopper','phone','ContactId','createdAt','updatedAt','select','field','NOW()','scheduledAt','toString','from','cm_contacts','deletedAt\x20IS\x20NULL','ListId\x20=\x20?','where','\x20=\x20?','into','fromQuery','id\x20IN\x20?','str','phone\x20IS\x20NOT\x20NULL','calleridnum','cm_hopper_final','phone\x20NOT\x20IN\x20(?)','findAll','outbound','dialCheckDuplicateType','CmList','Lists','always','sequelize','query','VoiceQueueId','all','VoiceQueue','BlackLists','get','CampaignId','onlyIfOpen','cmContact,\x20%s,\x20%s'];(function(_0x2cf76d,_0xad89c9){var _0x4e5b25=function(_0x22a838){while(--_0x22a838){_0x2cf76d['push'](_0x2cf76d['shift']());}};_0x4e5b25(++_0xad89c9);}(_0xcb91,0x1a9));var _0x1cb9=function(_0x3ce2c4,_0x4544c1){_0x3ce2c4=_0x3ce2c4-0x0;var _0x4047c1=_0xcb91[_0x3ce2c4];return _0x4047c1;};'use strict';var BPromise=require('bluebird');var util=require('util');var _=require(_0x1cb9('0x0'));var fs=require('fs');var squel=require(_0x1cb9('0x1'));var Papa=require(_0x1cb9('0x2'));var Redis=require(_0x1cb9('0x3'));var db=require('../../../mysqldb')['db'];var config=require(_0x1cb9('0x4'));var logger=require(_0x1cb9('0x5'))('api');config[_0x1cb9('0x6')]=_[_0x1cb9('0x7')](config['redis'],{'host':_0x1cb9('0x8'),'port':0x18eb});var socket=require(_0x1cb9('0x9'))(new Redis(config['redis']));require(_0x1cb9('0xa'))[_0x1cb9('0xb')](socket);try{if(!process['argv'][0x2]||process[_0x1cb9('0xc')][0x2]==='undefined'||process['argv'][0x2]===_0x1cb9('0xd')){throw new Error(_0x1cb9('0xe'));}var FILEPATH=process[_0x1cb9('0xc')][0x2];if(!process[_0x1cb9('0xc')][0x3]||process[_0x1cb9('0xc')][0x3]==='undefined'||process[_0x1cb9('0xc')][0x3]===_0x1cb9('0xd')||!process[_0x1cb9('0xc')][0x4]||process[_0x1cb9('0xc')][0x4]===_0x1cb9('0xf')||process['argv'][0x4]==='null'){throw new Error('Missing\x20binding\x20parameters!');}var FIELDS=_[_0x1cb9('0x10')](process[_0x1cb9('0xc')][0x3][_0x1cb9('0x11')](','),process[_0x1cb9('0xc')][0x4]['split'](','));if(!process[_0x1cb9('0xc')][0x5]||process[_0x1cb9('0xc')][0x5]===_0x1cb9('0xf')||process[_0x1cb9('0xc')][0x5]===_0x1cb9('0xd')){throw new Error('Missing\x20ListId\x20parameter!');}var LISTID=process['argv'][0x5];var COMPANYID=process[_0x1cb9('0xc')][0x6]&&process[_0x1cb9('0xc')][0x6]!==_0x1cb9('0xf')&&process[_0x1cb9('0xc')][0x6]!==_0x1cb9('0xd')?process[_0x1cb9('0xc')][0x6]:null;var DUPLICATES=process[_0x1cb9('0xc')][0x7]&&process['argv'][0x7]!=='undefined'&&process[_0x1cb9('0xc')][0x7]!==_0x1cb9('0xd')?process[_0x1cb9('0xc')][0x7]:null;if(!process[_0x1cb9('0xc')][0x8]||process[_0x1cb9('0xc')][0x8]===_0x1cb9('0xf')||process[_0x1cb9('0xc')][0x8]==='null'){throw new Error('Missing\x20socket_timestamp\x20parameter!');}var SOCKET_TIMESTAMP=process[_0x1cb9('0xc')][0x8];}catch(_0x5dbfae){logger[_0x1cb9('0x12')](_0x5dbfae);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(_0x2265ea,_0x523b26,_0x599275,_0x2e3854){var _0x325637={'message':_0x523b26};_0x325637[_0x2265ea]=!![];if(_0x599275){_0x325637[_0x1cb9('0x13')]=_0x599275;}if(_0x2e3854){_0x325637[_0x1cb9('0x14')]=_0x2e3854;}return _0x325637;}function isEmail(_0x45b8d3){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))*$/[_0x1cb9('0x15')](_0x45b8d3);}function checkRow(_0x59ebea,_0x55b232,_0x6c6f61){return new BPromise(function(_0x557199,_0x10a419){if(_[_0x1cb9('0x16')](_0x59ebea)){return _0x10a419(handleCheckRowError(_0x1cb9('0x12'),_0x1cb9('0x17'),null,_0x6c6f61));}if(_0x59ebea[_0x1cb9('0x18')]&&_0x59ebea['errors'][_0x1cb9('0x19')]){var _0x9df250=_['map'](_0x59ebea[_0x1cb9('0x18')],_0x1cb9('0x1a'))[_0x1cb9('0x1b')](';');return _0x10a419(handleCheckRowError(_0x1cb9('0x12'),_0x9df250,null,_0x6c6f61));}var _0x406821={};for(var _0x21d6f5 in FIELDS){if(FIELDS[_0x1cb9('0x1c')](_0x21d6f5)&&FIELDS[_0x21d6f5]){_0x406821[_0x21d6f5]=_0x59ebea[_0x1cb9('0x1d')][0x0][FIELDS[_0x21d6f5]]||_0x59ebea[_0x1cb9('0x1d')][0x0]['\ufeff'+FIELDS[_0x21d6f5]];}}if(!_0x406821[_0x1cb9('0x1e')]){return _0x10a419(handleCheckRowError('error',_0x1cb9('0x1f'),null,_0x6c6f61));}if(!_0x406821['phone']){return _0x10a419(handleCheckRowError(_0x1cb9('0x12'),'phone\x20not\x20specified!',null,_0x6c6f61));}if(_0x406821[_0x1cb9('0x20')]){var _0x41011c=moment(_0x406821[_0x1cb9('0x20')],_0x1cb9('0x21'));if(!_0x41011c['isValid']()){return _0x10a419(handleCheckRowError(_0x1cb9('0x12'),'birthDate\x20format\x20is\x20invalid,\x20YYYY-MM-DD\x20format\x20is\x20supported!',null,_0x6c6f61));}}if(_0x406821[_0x1cb9('0x22')]){if(!isEmail(_0x406821[_0x1cb9('0x22')])){return _0x10a419(handleCheckRowError(_0x1cb9('0x12'),'email\x20format\x20is\x20not\x20valid!',null,_0x6c6f61));}}_0x406821[_0x1cb9('0x23')]=LISTID;_0x406821['CompanyId']=COMPANYID||undefined;if(DUPLICATES&&DUPLICATES[_0x1cb9('0x19')]&&_0x55b232){var _0x58f4f5={};for(var _0x2164e3=0x0,_0x42a688=DUPLICATES[_0x1cb9('0x19')];_0x2164e3<_0x42a688;_0x2164e3+=0x1){_0x58f4f5[DUPLICATES[_0x2164e3]]=_0x406821[DUPLICATES[_0x2164e3]];}var _0xae910=_['find'](_0x55b232,_0x58f4f5);if(_0xae910){return _0x10a419(handleCheckRowError(_0x1cb9('0x24'),_0x1cb9('0x25'),_0xae910,_0x6c6f61));}}return db[_0x1cb9('0x26')][_0x1cb9('0x27')](_0x406821,{'raw':!![],'hooks':![],'fields':_[_0x1cb9('0x28')](_0x406821)})[_0x1cb9('0x29')](function(_0xc6d5fd){if(DUPLICATES&&DUPLICATES[_0x1cb9('0x19')]&&_0x55b232){_0x55b232[_0x1cb9('0x2a')](_[_0x1cb9('0x2b')](_0x406821,DUPLICATES));}hopperContacts+=(hopperContacts?',':'')+_0xc6d5fd['id'];return _0x557199();})[_0x1cb9('0x2c')](function(_0x26b950){return _0x10a419(handleCheckRowError(_0x1cb9('0x12'),'Error\x20while\x20creating\x20contact:\x20'+(_0x26b950['message']||JSON[_0x1cb9('0x2d')](_0x26b950)),null,_0x6c6f61));});});}function checkHopper(){function _0x30f7e4(){return function(_0x91c937){logger[_0x1cb9('0x12')](_0x1cb9('0x2e'),_0x1cb9('0x2f'),util[_0x1cb9('0x30')](_0x91c937,{'showHidden':![],'depth':null}));};}var _0x3f5637=function(_0x4d3e39,_0x2aa59b){var _0x1482c4=squel[_0x1cb9('0x31')]()['into'](_0x1cb9('0x32'))['fromQuery']([_0x1cb9('0x33'),'scheduledAt',_0x1cb9('0x34'),_0x1cb9('0x23'),_0x2aa59b,_0x1cb9('0x35'),_0x1cb9('0x36')],squel[_0x1cb9('0x37')]()[_0x1cb9('0x38')](_0x1cb9('0x33'),'phone')['field'](_0x1cb9('0x39'),_0x1cb9('0x3a'))[_0x1cb9('0x38')]('id',_0x1cb9('0x34'))[_0x1cb9('0x38')](LISTID[_0x1cb9('0x3b')](),_0x1cb9('0x23'))['field'](_0x4d3e39['id'][_0x1cb9('0x3b')](),_0x2aa59b)['field']('NOW()','createdAt')[_0x1cb9('0x38')](_0x1cb9('0x39'),_0x1cb9('0x36'))[_0x1cb9('0x3c')](_0x1cb9('0x3d'))['where'](_0x1cb9('0x3e'))['where'](_0x1cb9('0x3f'),LISTID[_0x1cb9('0x3b')]())[_0x1cb9('0x40')]('phone\x20IS\x20NOT\x20NULL')[_0x1cb9('0x40')]('phone\x20NOT\x20IN\x20(?)',squel[_0x1cb9('0x37')]()[_0x1cb9('0x38')]('phone')['from'](_0x1cb9('0x32'))[_0x1cb9('0x40')](_0x2aa59b+_0x1cb9('0x41'),_0x4d3e39['id'][_0x1cb9('0x3b')]())))[_0x1cb9('0x3b')]();return _0x1482c4;};var _0x58832e=function(_0x11d877,_0x5594fc){var _0x4c59e7=squel['insert']()[_0x1cb9('0x42')](_0x1cb9('0x32'))[_0x1cb9('0x43')]([_0x1cb9('0x33'),_0x1cb9('0x3a'),_0x1cb9('0x34'),_0x1cb9('0x23'),_0x5594fc,_0x1cb9('0x35'),_0x1cb9('0x36')],squel[_0x1cb9('0x37')]()[_0x1cb9('0x38')]('phone',_0x1cb9('0x33'))[_0x1cb9('0x38')](_0x1cb9('0x39'),'scheduledAt')[_0x1cb9('0x38')]('id',_0x1cb9('0x34'))[_0x1cb9('0x38')](LISTID[_0x1cb9('0x3b')](),_0x1cb9('0x23'))['field'](_0x11d877['id'][_0x1cb9('0x3b')](),_0x5594fc)['field'](_0x1cb9('0x39'),'createdAt')[_0x1cb9('0x38')](_0x1cb9('0x39'),_0x1cb9('0x36'))[_0x1cb9('0x3c')]('cm_contacts')[_0x1cb9('0x40')](_0x1cb9('0x3e'))[_0x1cb9('0x40')](_0x1cb9('0x3f'),LISTID[_0x1cb9('0x3b')]())[_0x1cb9('0x40')](_0x1cb9('0x44'),squel[_0x1cb9('0x45')](hopperContacts))[_0x1cb9('0x40')](_0x1cb9('0x46'))['where']('phone\x20NOT\x20IN\x20(?)',squel[_0x1cb9('0x37')]()[_0x1cb9('0x38')](_0x1cb9('0x47'))[_0x1cb9('0x3c')](_0x1cb9('0x48'))[_0x1cb9('0x40')](_0x5594fc+_0x1cb9('0x41'),_0x11d877['id'][_0x1cb9('0x3b')]()))[_0x1cb9('0x40')](_0x1cb9('0x49'),squel['select']()[_0x1cb9('0x38')]('phone')[_0x1cb9('0x3c')]('cm_hopper')[_0x1cb9('0x40')](_0x5594fc+'\x20=\x20?',_0x11d877['id']['toString']())))[_0x1cb9('0x3b')]();return _0x4c59e7;};function _0x3b0c2e(_0x303da3,_0x4bce54){var _0x3c157f=squel[_0x1cb9('0x31')]()['into']('cm_hopper')[_0x1cb9('0x43')]([_0x1cb9('0x33'),_0x1cb9('0x3a'),_0x1cb9('0x34'),_0x1cb9('0x23'),_0x4bce54,_0x1cb9('0x35'),_0x1cb9('0x36')],squel['select']()[_0x1cb9('0x38')](_0x1cb9('0x33'),_0x1cb9('0x33'))['field'](_0x1cb9('0x39'),_0x1cb9('0x3a'))[_0x1cb9('0x38')]('id',_0x1cb9('0x34'))[_0x1cb9('0x38')](LISTID[_0x1cb9('0x3b')](),'ListId')[_0x1cb9('0x38')](_0x303da3['id'][_0x1cb9('0x3b')](),_0x4bce54)[_0x1cb9('0x38')](_0x1cb9('0x39'),_0x1cb9('0x35'))[_0x1cb9('0x38')](_0x1cb9('0x39'),_0x1cb9('0x36'))[_0x1cb9('0x3c')](_0x1cb9('0x3d'))[_0x1cb9('0x40')]('deletedAt\x20IS\x20NULL')[_0x1cb9('0x40')](_0x1cb9('0x3f'),LISTID[_0x1cb9('0x3b')]())[_0x1cb9('0x40')]('id\x20IN\x20?',squel['str'](hopperContacts))[_0x1cb9('0x40')](_0x1cb9('0x46')))[_0x1cb9('0x3b')]();return _0x3c157f;}function _0x173db5(_0x3c2f9c,_0x75c734){var _0xc515a6=squel[_0x1cb9('0x31')]()['into']('cm_hopper_black')[_0x1cb9('0x43')](['phone','ContactId','ListId',_0x75c734,'createdAt','updatedAt'],squel[_0x1cb9('0x37')]()[_0x1cb9('0x38')](_0x1cb9('0x33'),_0x1cb9('0x33'))[_0x1cb9('0x38')]('id',_0x1cb9('0x34'))['field'](LISTID[_0x1cb9('0x3b')](),_0x1cb9('0x23'))['field'](_0x3c2f9c['id']['toString'](),_0x75c734)[_0x1cb9('0x38')](_0x1cb9('0x39'),_0x1cb9('0x35'))[_0x1cb9('0x38')](_0x1cb9('0x39'),'updatedAt')['from']('cm_contacts')[_0x1cb9('0x40')](_0x1cb9('0x3e'))[_0x1cb9('0x40')](_0x1cb9('0x3f'),LISTID[_0x1cb9('0x3b')]())['where'](_0x1cb9('0x44'),squel[_0x1cb9('0x45')](hopperContacts))['where']('phone\x20IS\x20NOT\x20NULL'))[_0x1cb9('0x3b')]();return _0xc515a6;}return db['VoiceQueue'][_0x1cb9('0x4a')]({'where':{'type':_0x1cb9('0x4b')},'attributes':['id',_0x1cb9('0x4c')],'include':[{'model':db[_0x1cb9('0x4d')],'as':_0x1cb9('0x4e'),'where':{'id':LISTID}}]})[_0x1cb9('0x29')](function(_0x4aeeff){var _0xde0d93=[];if(_0x4aeeff){var _0x15fc04;for(var _0x330fc1=0x0,_0x17c361;_0x330fc1<_0x4aeeff['length'];_0x330fc1+=0x1){_0x17c361=_0x4aeeff[_0x330fc1]['get']({'plain':!![]});switch(_0x17c361[_0x1cb9('0x4c')]){case _0x1cb9('0x4f'):_0xde0d93[_0x1cb9('0x2a')](db[_0x1cb9('0x50')][_0x1cb9('0x51')](_0x58832e(_0x17c361,_0x1cb9('0x52')))['then'](function(){})[_0x1cb9('0x2c')](_0x30f7e4()));break;case'onlyIfOpen':_0xde0d93[_0x1cb9('0x2a')](db[_0x1cb9('0x50')]['query'](_0x3f5637(_0x17c361,_0x1cb9('0x52')))[_0x1cb9('0x29')](function(){})[_0x1cb9('0x2c')](_0x30f7e4()));break;default:_0xde0d93['push'](db[_0x1cb9('0x50')][_0x1cb9('0x51')](_0x3b0c2e(_0x17c361,_0x1cb9('0x52')))[_0x1cb9('0x29')](function(){})[_0x1cb9('0x2c')](_0x30f7e4()));}}}return _0xde0d93;})[_0x1cb9('0x53')]()['then'](function(){return db[_0x1cb9('0x54')][_0x1cb9('0x4a')]({'where':{'type':_0x1cb9('0x4b')},'attributes':['id'],'include':[{'model':db[_0x1cb9('0x4d')],'as':_0x1cb9('0x55'),'where':{'id':LISTID}}]})[_0x1cb9('0x29')](function(_0x128a41){var _0x37bcd9=[];if(_0x128a41){var _0x4cd544;for(var _0x28bac2=0x0,_0x78e9c;_0x28bac2<_0x128a41['length'];_0x28bac2+=0x1){_0x78e9c=_0x128a41[_0x28bac2][_0x1cb9('0x56')]({'plain':!![]});_0x37bcd9['push'](db[_0x1cb9('0x50')]['query'](_0x173db5(_0x78e9c,'VoiceQueueId'))[_0x1cb9('0x29')](function(){})[_0x1cb9('0x2c')](_0x30f7e4()));}}return _0x37bcd9;})['all']();})[_0x1cb9('0x29')](function(){return db['Campaign'][_0x1cb9('0x4a')]({'attributes':['id',_0x1cb9('0x4c')],'include':[{'model':db[_0x1cb9('0x4d')],'as':_0x1cb9('0x4e'),'where':{'id':LISTID}}]})['then'](function(_0x45ca54){var _0x3d25a3=[];if(_0x45ca54){for(var _0x2a157d=0x0,_0x27cc3c;_0x2a157d<_0x45ca54[_0x1cb9('0x19')];_0x2a157d+=0x1){_0x27cc3c=_0x45ca54[_0x2a157d][_0x1cb9('0x56')]({'plain':!![]});switch(_0x27cc3c['dialCheckDuplicateType']){case _0x1cb9('0x4f'):_0x3d25a3[_0x1cb9('0x2a')](db[_0x1cb9('0x50')][_0x1cb9('0x51')](_0x58832e(_0x27cc3c,_0x1cb9('0x57')))[_0x1cb9('0x29')](function(){})['catch'](_0x30f7e4()));break;case _0x1cb9('0x58'):_0x3d25a3[_0x1cb9('0x2a')](db['sequelize'][_0x1cb9('0x51')](_0x3f5637(_0x27cc3c,_0x1cb9('0x57')))[_0x1cb9('0x29')](function(){})[_0x1cb9('0x2c')](_0x30f7e4()));break;default:_0x3d25a3[_0x1cb9('0x2a')](db[_0x1cb9('0x50')][_0x1cb9('0x51')](_0x3b0c2e(_0x27cc3c,'CampaignId'))[_0x1cb9('0x29')](function(){})['catch'](_0x30f7e4()));}}}return _0x3d25a3;})[_0x1cb9('0x53')]();})[_0x1cb9('0x29')](function(){return db['Campaign'][_0x1cb9('0x4a')]({'attributes':['id'],'include':[{'model':db[_0x1cb9('0x4d')],'as':_0x1cb9('0x55'),'where':{'id':LISTID}}]})[_0x1cb9('0x29')](function(_0x56f23d){var _0x113367=[];if(_0x56f23d){for(var _0x39b0cb=0x0,_0x429371;_0x39b0cb<_0x56f23d['length'];_0x39b0cb+=0x1){_0x429371=_0x56f23d[_0x39b0cb][_0x1cb9('0x56')]({'plain':!![]});_0x113367[_0x1cb9('0x2a')](db[_0x1cb9('0x50')][_0x1cb9('0x51')](_0x173db5(_0x429371,_0x1cb9('0x57')))[_0x1cb9('0x29')](function(){})[_0x1cb9('0x2c')](_0x30f7e4()));}}return _0x113367;})['all']();})[_0x1cb9('0x2c')](function(_0x4b15a4){logger[_0x1cb9('0x12')](_0x1cb9('0x59'),_0x1cb9('0x5a'),_0x4b15a4[_0x1cb9('0x1a')]);});}var processPromises=function(_0x4bdbd2){return BPromise[_0x1cb9('0x53')](promises)[_0x1cb9('0x29')](function(_0x5e68a1){})[_0x1cb9('0x2c')](function(_0x416508){logger[_0x1cb9('0x12')](_0x1cb9('0x5b'),JSON[_0x1cb9('0x2d')](_0x416508));})['finally'](function(){socket['emit']('contact:csv_'+SOCKET_TIMESTAMP,{'success':success,'errors':errors,'duplicates':duplicates,'rows':rows});promises=[];success=0x0;errors=0x0;duplicates=0x0;rows=[];if(_0x4bdbd2){return _0x4bdbd2['resume']();}});};var endCsv=function(){return BPromise[_0x1cb9('0x5c')]()[_0x1cb9('0x29')](function(){if(hopperContacts){return checkHopper();}})[_0x1cb9('0x29')](function(){socket[_0x1cb9('0x5d')](_0x1cb9('0x5e')+SOCKET_TIMESTAMP,{'finished':!![],'success':success,'errors':errors,'duplicates':duplicates,'rows':rows});try{fs[_0x1cb9('0x5f')](FILEPATH);}catch(_0x1e6402){logger[_0x1cb9('0x12')]('Unable\x20to\x20delete\x20temp\x20file:',JSON[_0x1cb9('0x2d')](_0x1e6402));}finally{process[_0x1cb9('0x60')](0x0);}});};process['on'](_0x1cb9('0x61'),function(){logger['info'](_0x1cb9('0x62'));endCsv();});function main(){return BPromise[_0x1cb9('0x5c')]()['then'](function(){if(DUPLICATES){DUPLICATES=DUPLICATES[_0x1cb9('0x11')](',');return db[_0x1cb9('0x26')][_0x1cb9('0x4a')]({'where':{'ListId':LISTID},'attributes':DUPLICATES,'raw':!![]});}})[_0x1cb9('0x29')](function(_0x5cb5e5){var _0x2c0416=fs[_0x1cb9('0x63')](FILEPATH,{'highWaterMark':0xf*0x400*0x400});Papa['parse'](_0x2c0416,{'header':!![],'skipEmptyLines':!![],'step':function(_0x5bd78d,_0x1f2d69){total+=0x1;var _0x3ba0a5=total;promises['push'](checkRow(_0x5bd78d,_0x5cb5e5,_0x3ba0a5)['then'](function(){success+=0x1;})[_0x1cb9('0x2c')](function(_0x3486e5){if(_0x3486e5['error']){errors+=0x1;delete _0x3486e5['error'];}else if(_0x3486e5[_0x1cb9('0x24')]){duplicates+=0x1;delete _0x3486e5['duplicate'];}rows['push'](_0x3486e5);}));if(total%0xc8===0x0){_0x1f2d69['pause']();return processPromises(_0x1f2d69);}},'complete':function(){return processPromises()[_0x1cb9('0x29')](function(){logger['info'](_0x1cb9('0x64'));endCsv();});},'error':function(_0x3c717b,_0x33ec43){logger['info'](_0x1cb9('0x65'),JSON[_0x1cb9('0x2d')](_0x3c717b));endCsv();}});})[_0x1cb9('0x2c')](function(_0x4c54b5){logger[_0x1cb9('0x12')](_0x1cb9('0x66'),JSON[_0x1cb9('0x2d')](_0x4c54b5));});}main();
\ No newline at end of file
diff --git a/server/components/import/cm/csv2.js b/server/components/import/cm/csv2.js
index 9f2159a..a4a0d8b 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 _0x2401=['length','SystemRow','appendFileSync','emit','contact:import:','Abort\x20parser','abort','step','duplicates','cm_contacts_','CREATE\x20TABLE\x20','\x20LIKE\x20cm_contacts;','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','isNil','DROP\x20TABLE\x20','voice_queues_has_cm_lists','voice_queues_has_cm_blacklists','voice_queues','VoiceQueueId','campaigns_has_cm_lists','CampaignId','campaigns_has_cm_blacklists','campaigns','each','then','finish','affectedRows','unlink','complete','argv','existsSync','binding\x20doesn\x27t\x20exists','phone\x20is\x20mandatory','firstName\x20is\x20mandatory','map','No\x20agent\x20available','uncaughtException','path','papaparse','util','bluebird','moment','ioredis','../../../mysqldb','../../../config/environment','../../../config/logger','redis','defaults','localhost','socket.io-emitter','format','YYYY-MM-DD\x20HH:mm:ss','test','phone','from','.id\x20=\x20','\x20=\x20','join','cm_contacts.scheduledat','cm_contacts.ListId','cm_contacts.updatedAt','cm_contacts.priority','cm_contacts.UserId','insert','into','cm_hopper','fromQuery','scheduledat','ContactId','ListId','updatedAt','priority','UserId','recallme','select','fields','cm_contacts','cm_contacts.ListId\x20=\x20','.CmListId','where','.CmListId\x20=\x20?','cm_contacts.createdAt\x20=\x20?','cm_contacts.phone\x20NOT\x20IN\x20(?)','\x22always\x22','\x22onlyIfOpen\x22','toString','cm_contacts.createdAt','cm_hopper_black','createdAt','field','ListId\x20=\x20?','\x20=\x20?','concat','keys','CompanyId',')\x20NOT\x20IN\x20?','deletedAt\x20IS\x20NULL','MIN(id)','group','Received\x20SIGINT','exit','errors','push','code','info','sequelize','query','spread','error','message','main','start','binding','root','server/files/tmp','header','writeFileSync','parse','data','rows','trim','replace','isValid','scheduledat\x20wrong\x20format\x20(YYYY-MM-DD\x20HH:mm:ss)','isNumber','agent\x20not\x20exists','email','email\x20wrong\x20format','dateOfBirth','YYYY-MM-DD','dateOfBirth\x20wrong\x20format\x20(YYYY-MM-DD)','\x20not\x20specified'];(function(_0x4369ef,_0x55cfbc){var _0x5b6913=function(_0x7a7436){while(--_0x7a7436){_0x4369ef['push'](_0x4369ef['shift']());}};_0x5b6913(++_0x55cfbc);}(_0x2401,0x12d));var _0x1240=function(_0x3dd15e,_0x1f0015){_0x3dd15e=_0x3dd15e-0x0;var _0x231fd0=_0x2401[_0x3dd15e];return _0x231fd0;};'use strict';var fs=require('fs');var path=require(_0x1240('0x0'));var _=require('lodash');var Papa=require(_0x1240('0x1'));var util=require(_0x1240('0x2'));var BPromise=require(_0x1240('0x3'));var moment=require(_0x1240('0x4'));var squel=require('squel');var Redis=require(_0x1240('0x5'));var db=require(_0x1240('0x6'))['db'];var config=require(_0x1240('0x7'));var logger=require(_0x1240('0x8'))('import');config[_0x1240('0x9')]=_[_0x1240('0xa')](config[_0x1240('0x9')],{'host':_0x1240('0xb'),'port':0x18eb});var socket=require(_0x1240('0xc'))(new Redis(config[_0x1240('0x9')]));var stats={'finish':![],'errors':[],'rows':0x0,'affectedRows':0x0};var results=[];var stopped=![];var NOW=moment()[_0x1240('0xd')](_0x1240('0xe'));function isEmail(_0x1e4514){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))*$/[_0x1240('0xf')](_0x1e4514);}function selectNotIn(_0xdad7cb,_0x23d565,_0x190294,_0x4efbe0,_0x6aba6f){return squel['select']()['field'](_0x1240('0x10'))[_0x1240('0x11')](_0x4efbe0)['join'](_0x23d565,null,_0x23d565+_0x1240('0x12')+_0x4efbe0+'.'+_0x190294)['where'](_0x4efbe0+'.'+_0x190294+_0x1240('0x13')+_0xdad7cb+'.'+_0x190294)['where'](_0x23d565+'.dialCheckDuplicateType\x20IN\x20('+_0x6aba6f[_0x1240('0x14')]()+')');}function insertCmHopper(_0x4211a2,_0x46ce8b,_0x4c22f8,_0x127ff6,_0xd93623){var _0x17eec0=['cm_contacts.phone',_0x1240('0x15'),'cm_contacts.id',_0x1240('0x16'),_0x46ce8b+'.'+_0x127ff6,'cm_contacts.createdAt',_0x1240('0x17'),_0x1240('0x18'),_0x1240('0x19'),'\x22'+_0xd93623+'\x22'];return squel[_0x1240('0x1a')]()[_0x1240('0x1b')](_0x1240('0x1c'))[_0x1240('0x1d')]([_0x1240('0x10'),_0x1240('0x1e'),_0x1240('0x1f'),_0x1240('0x20'),_0x127ff6,'createdAt',_0x1240('0x21'),_0x1240('0x22'),_0x1240('0x23'),_0x1240('0x24')],squel[_0x1240('0x25')]()[_0x1240('0x26')](_0x17eec0)['from'](_0x46ce8b)[_0x1240('0x14')](_0x1240('0x27'),null,_0x1240('0x28')+_0x46ce8b+_0x1240('0x29'))['join'](_0x4c22f8,null,_0x4c22f8+'.id\x20=\x20'+_0x46ce8b+'.'+_0x127ff6)[_0x1240('0x2a')](_0x46ce8b+_0x1240('0x2b'),_0x4211a2)[_0x1240('0x2a')](_0x1240('0x2c'),NOW)[_0x1240('0x2a')](_0x1240('0x2d'),selectNotIn(_0x46ce8b,_0x4c22f8,_0x127ff6,_0x1240('0x1c'),[_0x1240('0x2e'),_0x1240('0x2f')]))['where'](_0x1240('0x2d'),selectNotIn(_0x46ce8b,_0x4c22f8,_0x127ff6,_0x1240('0x1c'),[_0x1240('0x2e')])))[_0x1240('0x30')]();}function insertCmHopperBlack(_0x1ab171,_0x4d4163,_0x59f4a0,_0x5b9b39){var _0x1dc9f6=['cm_contacts.phone','cm_contacts.id',_0x1240('0x16'),_0x4d4163+'.'+_0x5b9b39,_0x1240('0x31'),'cm_contacts.updatedAt'];return squel[_0x1240('0x1a')]()[_0x1240('0x1b')](_0x1240('0x32'))['fromQuery'](['phone',_0x1240('0x1f'),'ListId',_0x5b9b39,_0x1240('0x33'),_0x1240('0x21')],squel[_0x1240('0x25')]()[_0x1240('0x26')](_0x1dc9f6)[_0x1240('0x11')](_0x4d4163)[_0x1240('0x14')]('cm_contacts',null,_0x1240('0x28')+_0x4d4163+_0x1240('0x29'))['join'](_0x59f4a0,null,_0x59f4a0+_0x1240('0x12')+_0x4d4163+'.'+_0x5b9b39)[_0x1240('0x2a')](_0x4d4163+_0x1240('0x2b'),_0x1ab171)['where'](_0x1240('0x2c'),NOW)['where'](_0x1240('0x2d'),squel[_0x1240('0x25')]()[_0x1240('0x34')](_0x1240('0x10'))[_0x1240('0x11')]('cm_hopper_black')[_0x1240('0x2a')](_0x1240('0x35'),_0x1ab171)[_0x1240('0x2a')](_0x5b9b39+_0x1240('0x36'),_0x4d4163+'.'+_0x5b9b39)))[_0x1240('0x30')]();}function insertCmContact(_0x883a15,_0x29fd14,_0x30eae7,_0x4416ba){var _0x54a1a9=_[_0x1240('0x37')](_[_0x1240('0x38')](_0x4416ba),[_0x1240('0x20'),_0x1240('0x39'),_0x1240('0x33'),_0x1240('0x21')]);return squel[_0x1240('0x1a')]()[_0x1240('0x1b')](_0x1240('0x27'))[_0x1240('0x1d')](_0x54a1a9,squel[_0x1240('0x25')]()[_0x1240('0x26')](_0x54a1a9)[_0x1240('0x11')](_0x29fd14)[_0x1240('0x2a')]('('+_0x30eae7[_0x1240('0x14')](',')+_0x1240('0x3a'),squel[_0x1240('0x25')]()['fields'](_0x30eae7)[_0x1240('0x11')](_0x1240('0x27'))['where'](_0x1240('0x35'),_0x883a15)[_0x1240('0x2a')](_0x1240('0x3b')))[_0x1240('0x2a')]('id\x20IN\x20?',squel[_0x1240('0x25')]()['field'](_0x1240('0x3c'),'min_id')[_0x1240('0x11')](_0x29fd14)[_0x1240('0x3d')](_0x30eae7[_0x1240('0x14')](','))))[_0x1240('0x30')]();}function handleStop(){logger['info'](_0x1240('0x3e'));stopped=!![];}function handleUncaughtException(_0x2e632b){logger['error'](_0x2e632b['message']);process[_0x1240('0x3f')](0x1);}function handleError(_0x4f5a54,_0x27f033){stats[_0x1240('0x40')][_0x1240('0x41')]({'name':_0x27f033[_0x1240('0x42')],'message':_0x27f033['message'],'row':_0x4f5a54});}function handleQuery(_0x2b3863){logger[_0x1240('0x43')](_0x2b3863);return db[_0x1240('0x44')][_0x1240('0x45')](_0x2b3863)[_0x1240('0x46')](function(_0x4a64b6){results[_0x1240('0x41')](_0x4a64b6);})['catch'](function(_0x50e1ce){logger[_0x1240('0x47')](_0x50e1ce[_0x1240('0x48')]);});}function main(_0x349504,_0x39a75f,_0x308523,_0x2a4c43){logger[_0x1240('0x43')](_0x1240('0x49'),_0x349504,JSON['stringify'](_0x39a75f));process['send'](_0x1240('0x4a'));var _0x484a4c=_0x39a75f[_0x1240('0x4b')];var _0x4bc25c=_0x39a75f['socket_timestamp'];var _0x21d648=path[_0x1240('0x14')](config[_0x1240('0x4c')],_0x1240('0x4d'),_0x4bc25c+'.csv');var _0x7df9e4=_['keys'](_0x484a4c)[_0x1240('0x14')]();logger[_0x1240('0x43')](_0x1240('0x4e'),_0x7df9e4);fs[_0x1240('0x4f')](_0x21d648,_0x7df9e4+'\x0a');Papa[_0x1240('0x50')](fs['createReadStream'](_0x349504),{'header':!![],'skipEmptyLines':!![],'step':function(_0x3f5ef6,_0x151637){try{for(var _0x5645da=0x0,_0x31e9c8=[];_0x5645da<_0x3f5ef6[_0x1240('0x51')]['length'];_0x5645da++){stats[_0x1240('0x52')]+=0x1;if(_0x3f5ef6['errors'][_0x5645da]){handleError(_0x3f5ef6[_0x1240('0x51')][_0x5645da],_0x3f5ef6[_0x1240('0x40')][_0x5645da]);}else{var _0x5866cd=[];for(var _0x1e6420 in _0x484a4c){if(_0x484a4c['hasOwnProperty'](_0x1e6420)){if(_0x3f5ef6[_0x1240('0x51')][_0x5645da][_0x484a4c[_0x1e6420]]){var _0x38de9a=_[_0x1240('0x53')](_0x3f5ef6[_0x1240('0x51')][_0x5645da][_0x484a4c[_0x1e6420]][_0x1240('0x54')](/"/g,'\x27'));switch(_0x1e6420){case'scheduledat':var _0x3da771=moment(_0x38de9a,_0x1240('0xe'),!![]);if(_0x3da771[_0x1240('0x55')]()){_0x31e9c8[_0x1240('0x41')]('\x22'+_0x38de9a+'\x22');}else{_0x5866cd['push'](_0x1240('0x56'));}break;case _0x1240('0x22'):var _0x4e545b=parseInt(_0x38de9a);_0x38de9a=_['isNaN'](_0x4e545b)||_0x4e545b<0x0||_0x4e545b>0x4?_0x2a4c43?0x3:0x2:_0x4e545b;_0x31e9c8[_0x1240('0x41')]('\x22'+_0x38de9a+'\x22');break;case _0x1240('0x23'):var _0x33b8aa=parseInt(_0x38de9a);if(_[_0x1240('0x57')](_0x33b8aa)&&_['includes'](_0x308523,_0x33b8aa)){_0x31e9c8[_0x1240('0x41')]('\x22'+_0x33b8aa+'\x22');}else{_0x5866cd[_0x1240('0x41')](_0x1240('0x58'));}break;case _0x1240('0x59'):if(isEmail(_0x38de9a)){_0x31e9c8[_0x1240('0x41')]('\x22'+_0x38de9a+'\x22');}else{_0x5866cd['push'](_0x1240('0x5a'));}break;case _0x1240('0x5b'):var _0x4b6cd2=moment(_0x38de9a,_0x1240('0x5c'),!![]);if(_0x4b6cd2[_0x1240('0x55')]()){_0x31e9c8[_0x1240('0x41')]('\x22'+_0x38de9a+'\x22');}else{_0x5866cd[_0x1240('0x41')](_0x1240('0x5d'));}break;default:_0x31e9c8[_0x1240('0x41')]('\x22'+_0x38de9a+'\x22');}}else{switch(_0x1e6420){case'firstName':case _0x1240('0x10'):_0x5866cd[_0x1240('0x41')](_0x1e6420+_0x1240('0x5e'));break;default:_0x31e9c8[_0x1240('0x41')]('\x22\x22');}}}}if(_0x5866cd[_0x1240('0x5f')]){handleError(_0x3f5ef6['data'][_0x5645da],{'code':_0x1240('0x60'),'message':_0x5866cd[_0x1240('0x14')]()});}else{fs[_0x1240('0x61')](_0x21d648,_0x31e9c8['join']()+'\x0a');}_0x31e9c8=[];}if(!(stats['rows']%0xc8)){socket[_0x1240('0x62')](_0x1240('0x63')+_0x4bc25c,stats);stats[_0x1240('0x40')]=[];}}if(stopped){logger['info'](_0x1240('0x64'));_0x151637[_0x1240('0x65')]();}}catch(_0x23994b){handleError(_0x3f5ef6[_0x1240('0x51')][_0x5645da],{'code':'SystemError','message':_0x23994b[_0x1240('0x48')]});logger['error'](_0x1240('0x66'),_0x23994b[_0x1240('0x48')]);}},'complete':function(){try{var _0x4214d3=[];var _0x598512='cm_contacts';if(_0x39a75f[_0x1240('0x67')]&&_0x39a75f['duplicates']['length']){_0x598512=_0x1240('0x68')+_0x4bc25c;_0x4214d3[_0x1240('0x41')](_0x1240('0x69')+_0x598512+_0x1240('0x6a'));}var _0x48f902=util[_0x1240('0xd')](_0x1240('0x6b'),_0x21d648,_0x598512,_0x7df9e4,_0x39a75f['ListId'],_0x39a75f[_0x1240('0x39')]||null,NOW,NOW);if(_[_0x1240('0x6c')](_0x484a4c[_0x1240('0x1e')])){_0x48f902+=',\x20scheduledAt\x20=\x20NOW()';}_0x4214d3[_0x1240('0x41')](_0x48f902);if(_0x39a75f[_0x1240('0x67')]&&_0x39a75f[_0x1240('0x67')][_0x1240('0x5f')]){_0x4214d3[_0x1240('0x41')](insertCmContact(_0x39a75f[_0x1240('0x20')],_0x598512,_0x39a75f[_0x1240('0x67')],_0x484a4c));_0x4214d3[_0x1240('0x41')](_0x1240('0x6d')+_0x598512+';');}_0x4214d3[_0x1240('0x41')](insertCmHopper(_0x39a75f[_0x1240('0x20')],_0x1240('0x6e'),'voice_queues','VoiceQueueId',_0x2a4c43));_0x4214d3[_0x1240('0x41')](insertCmHopperBlack(_0x39a75f[_0x1240('0x20')],_0x1240('0x6f'),_0x1240('0x70'),_0x1240('0x71')));_0x4214d3['push'](insertCmHopper(_0x39a75f[_0x1240('0x20')],_0x1240('0x72'),'campaigns',_0x1240('0x73'),_0x2a4c43));_0x4214d3[_0x1240('0x41')](insertCmHopperBlack(_0x39a75f[_0x1240('0x20')],_0x1240('0x74'),_0x1240('0x75'),_0x1240('0x73')));BPromise[_0x1240('0x76')](_0x4214d3,handleQuery)[_0x1240('0x77')](function(_0x4e471f){stats[_0x1240('0x78')]=!![];stats['affectedRows']=_0x39a75f[_0x1240('0x67')]&&_0x39a75f['duplicates'][_0x1240('0x5f')]?results[0x2][_0x1240('0x79')]:results[0x0]['affectedRows'];socket[_0x1240('0x62')](_0x1240('0x63')+_0x4bc25c,stats);fs[_0x1240('0x7a')](_0x349504);fs['unlink'](_0x21d648);process[_0x1240('0x3f')](0x0);})['catch'](function(_0x4ff53f){logger[_0x1240('0x47')](_0x4ff53f[_0x1240('0x48')]);process[_0x1240('0x3f')](0x1);});}catch(_0x48d015){logger[_0x1240('0x47')](_0x1240('0x7b'),_0x48d015[_0x1240('0x48')]);process[_0x1240('0x3f')](0x1);}},'error':function(_0x2aa4a3,_0x5a4876,_0x3ca677,_0x62035e){throw new Error(_0x62035e);}});}function validate(){if(process[_0x1240('0x7c')]&&process[_0x1240('0x7c')][_0x1240('0x5f')]<0x4){throw new Error('arguments\x20\x20\x20');}var _0x3e7300=path[_0x1240('0x14')](config[_0x1240('0x4c')],_0x1240('0x4d'),process['argv'][0x2]);if(!fs[_0x1240('0x7d')](_0x3e7300)){throw new Error('file\x20doesn\x27t\x20exists');}var _0x332fc8={};try{_0x332fc8=JSON['parse'](process[_0x1240('0x7c')][0x3]);if(!_0x332fc8[_0x1240('0x4b')]){throw new Error(_0x1240('0x7e'));}if(!_0x332fc8[_0x1240('0x4b')][_0x1240('0x10')]){throw new Error(_0x1240('0x7f'));}if(!_0x332fc8['binding']['firstName']){throw new Error(_0x1240('0x80'));}var _0x516c5a=0x0;if(_0x332fc8['binding'][_0x1240('0x23')]){_0x516c5a=0x1;}if(!_0x332fc8[_0x1240('0x20')]){throw new Error('ListId\x20is\x20mandatory');}}catch(_0x32fea9){throw new Error('body\x20id\x20mandatory');}var _0x42400b=[];try{_0x42400b=_[_0x1240('0x81')](JSON[_0x1240('0x50')](process[_0x1240('0x7c')][0x4]),'id');}catch(_0x2b7afa){logger['info'](_0x1240('0x82'));}main(_0x3e7300,_0x332fc8,_0x42400b,_0x516c5a);}validate();process['on']('SIGINT',handleStop);process['on'](_0x1240('0x83'),handleUncaughtException);
\ No newline at end of file
+var _0x5332=['.dialCheckDuplicateType\x20IN\x20(','cm_contacts.phone','cm_contacts.scheduledat','cm_contacts.createdAt','cm_contacts.updatedAt','cm_contacts.priority','cm_contacts.UserId','insert','into','fromQuery','scheduledat','ContactId','ListId','createdAt','updatedAt','UserId','recallme','cm_contacts','cm_contacts.ListId\x20=\x20','.CmListId','cm_contacts.createdAt\x20=\x20?','\x22always\x22','\x22onlyIfOpen\x22','cm_contacts.phone\x20NOT\x20IN\x20(?)','cm_hopper','toString','cm_contacts.ListId','field','cm_hopper_black','ListId\x20=\x20?','\x20=\x20?','concat','keys','CompanyId','fields',')\x20NOT\x20IN\x20?','id\x20IN\x20?','min_id','group','info','Received\x20SIGINT','message','exit','errors','code','sequelize','query','push','catch','error','main','stringify','send','binding','socket_timestamp','root','server/files/tmp','header','writeFileSync','parse','createReadStream','data','hasOwnProperty','trim','replace','YYYY-MM-DD\x20HH:mm:ss','isValid','scheduledat\x20wrong\x20format\x20(YYYY-MM-DD\x20HH:mm:ss)','priority','isNaN','includes','agent\x20not\x20exists','email\x20wrong\x20format','dateOfBirth','YYYY-MM-DD','firstName','\x20not\x20specified','length','SystemRow','appendFileSync','rows','Abort\x20parser','abort','SystemError','step','duplicates','cm_contacts_','CREATE\x20TABLE\x20','\x20LIKE\x20cm_contacts;','isNil',',\x20scheduledAt\x20=\x20NOW()','DROP\x20TABLE\x20','voice_queues_has_cm_lists','VoiceQueueId','voice_queues_has_cm_blacklists','voice_queues','campaigns_has_cm_lists','campaigns','CampaignId','campaigns_has_cm_blacklists','each','then','affectedRows','emit','contact:import:','unlink','complete','argv','arguments\x20\x20\x20','file\x20doesn\x27t\x20exists','binding\x20doesn\x27t\x20exists','phone\x20is\x20mandatory','firstName\x20is\x20mandatory','ListId\x20is\x20mandatory','body\x20id\x20mandatory','map','No\x20agent\x20available','SIGINT','uncaughtException','path','papaparse','util','bluebird','moment','squel','../../../mysqldb','../../../config/environment','import','redis','localhost','socket.io-emitter','format','test','select','phone','from','join','.id\x20=\x20','where','\x20=\x20'];(function(_0x3a0d2e,_0x4dc328){var _0x193e69=function(_0x33fd86){while(--_0x33fd86){_0x3a0d2e['push'](_0x3a0d2e['shift']());}};_0x193e69(++_0x4dc328);}(_0x5332,0x103));var _0x2533=function(_0x2403cb,_0x486689){_0x2403cb=_0x2403cb-0x0;var _0x4ed02c=_0x5332[_0x2403cb];return _0x4ed02c;};'use strict';var fs=require('fs');var path=require(_0x2533('0x0'));var _=require('lodash');var Papa=require(_0x2533('0x1'));var util=require(_0x2533('0x2'));var BPromise=require(_0x2533('0x3'));var moment=require(_0x2533('0x4'));var squel=require(_0x2533('0x5'));var Redis=require('ioredis');var db=require(_0x2533('0x6'))['db'];var config=require(_0x2533('0x7'));var logger=require('../../../config/logger')(_0x2533('0x8'));config[_0x2533('0x9')]=_['defaults'](config[_0x2533('0x9')],{'host':_0x2533('0xa'),'port':0x18eb});var socket=require(_0x2533('0xb'))(new Redis(config[_0x2533('0x9')]));var stats={'finish':![],'errors':[],'rows':0x0,'affectedRows':0x0};var results=[];var stopped=![];var NOW=moment()[_0x2533('0xc')]('YYYY-MM-DD\x20HH:mm:ss');function isEmail(_0x59caa5){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))*$/[_0x2533('0xd')](_0x59caa5);}function selectNotIn(_0x28c756,_0x27a124,_0x1dd408,_0x38741a,_0x18f1ff){return squel[_0x2533('0xe')]()['field'](_0x2533('0xf'))[_0x2533('0x10')](_0x38741a)[_0x2533('0x11')](_0x27a124,null,_0x27a124+_0x2533('0x12')+_0x38741a+'.'+_0x1dd408)[_0x2533('0x13')](_0x38741a+'.'+_0x1dd408+_0x2533('0x14')+_0x28c756+'.'+_0x1dd408)[_0x2533('0x13')](_0x27a124+_0x2533('0x15')+_0x18f1ff[_0x2533('0x11')]()+')');}function insertCmHopper(_0x4ac1ea,_0x5e458e,_0x470c43,_0x54bf4e,_0x13de38){var _0x3beb6b=[_0x2533('0x16'),_0x2533('0x17'),'cm_contacts.id','cm_contacts.ListId',_0x5e458e+'.'+_0x54bf4e,_0x2533('0x18'),_0x2533('0x19'),_0x2533('0x1a'),_0x2533('0x1b'),'\x22'+_0x13de38+'\x22'];return squel[_0x2533('0x1c')]()[_0x2533('0x1d')]('cm_hopper')[_0x2533('0x1e')]([_0x2533('0xf'),_0x2533('0x1f'),_0x2533('0x20'),_0x2533('0x21'),_0x54bf4e,_0x2533('0x22'),_0x2533('0x23'),'priority',_0x2533('0x24'),_0x2533('0x25')],squel['select']()['fields'](_0x3beb6b)[_0x2533('0x10')](_0x5e458e)[_0x2533('0x11')](_0x2533('0x26'),null,_0x2533('0x27')+_0x5e458e+_0x2533('0x28'))[_0x2533('0x11')](_0x470c43,null,_0x470c43+_0x2533('0x12')+_0x5e458e+'.'+_0x54bf4e)[_0x2533('0x13')](_0x5e458e+'.CmListId\x20=\x20?',_0x4ac1ea)[_0x2533('0x13')](_0x2533('0x29'),NOW)['where']('cm_contacts.phone\x20NOT\x20IN\x20(?)',selectNotIn(_0x5e458e,_0x470c43,_0x54bf4e,'cm_hopper',[_0x2533('0x2a'),_0x2533('0x2b')]))['where'](_0x2533('0x2c'),selectNotIn(_0x5e458e,_0x470c43,_0x54bf4e,_0x2533('0x2d'),[_0x2533('0x2a')])))[_0x2533('0x2e')]();}function insertCmHopperBlack(_0x542a47,_0x4a1f4a,_0x43c278,_0x254efb){var _0x2577d7=[_0x2533('0x16'),'cm_contacts.id',_0x2533('0x2f'),_0x4a1f4a+'.'+_0x254efb,_0x2533('0x18'),_0x2533('0x19')];return squel[_0x2533('0x1c')]()[_0x2533('0x1d')]('cm_hopper_black')[_0x2533('0x1e')]([_0x2533('0xf'),_0x2533('0x20'),'ListId',_0x254efb,'createdAt',_0x2533('0x23')],squel[_0x2533('0xe')]()['fields'](_0x2577d7)[_0x2533('0x10')](_0x4a1f4a)[_0x2533('0x11')](_0x2533('0x26'),null,_0x2533('0x27')+_0x4a1f4a+_0x2533('0x28'))[_0x2533('0x11')](_0x43c278,null,_0x43c278+'.id\x20=\x20'+_0x4a1f4a+'.'+_0x254efb)[_0x2533('0x13')](_0x4a1f4a+'.CmListId\x20=\x20?',_0x542a47)['where'](_0x2533('0x29'),NOW)[_0x2533('0x13')]('cm_contacts.phone\x20NOT\x20IN\x20(?)',squel[_0x2533('0xe')]()[_0x2533('0x30')](_0x2533('0xf'))[_0x2533('0x10')](_0x2533('0x31'))[_0x2533('0x13')](_0x2533('0x32'),_0x542a47)[_0x2533('0x13')](_0x254efb+_0x2533('0x33'),_0x4a1f4a+'.'+_0x254efb)))[_0x2533('0x2e')]();}function insertCmContact(_0xcb9d58,_0x29eded,_0x1eef63,_0x17d50d){var _0x5e03ca=_[_0x2533('0x34')](_[_0x2533('0x35')](_0x17d50d),[_0x2533('0x21'),_0x2533('0x36'),'createdAt','updatedAt']);return squel[_0x2533('0x1c')]()['into'](_0x2533('0x26'))[_0x2533('0x1e')](_0x5e03ca,squel[_0x2533('0xe')]()[_0x2533('0x37')](_0x5e03ca)[_0x2533('0x10')](_0x29eded)[_0x2533('0x13')]('('+_0x1eef63[_0x2533('0x11')](',')+_0x2533('0x38'),squel[_0x2533('0xe')]()[_0x2533('0x37')](_0x1eef63)['from'](_0x2533('0x26'))[_0x2533('0x13')](_0x2533('0x32'),_0xcb9d58)[_0x2533('0x13')]('deletedAt\x20IS\x20NULL'))['where'](_0x2533('0x39'),squel[_0x2533('0xe')]()[_0x2533('0x30')]('MIN(id)',_0x2533('0x3a'))['from'](_0x29eded)[_0x2533('0x3b')](_0x1eef63[_0x2533('0x11')](','))))['toString']();}function handleStop(){logger[_0x2533('0x3c')](_0x2533('0x3d'));stopped=!![];}function handleUncaughtException(_0x32ff3e){logger['error'](_0x32ff3e[_0x2533('0x3e')]);process[_0x2533('0x3f')](0x1);}function handleError(_0x51ea5d,_0xe673af){stats[_0x2533('0x40')]['push']({'name':_0xe673af[_0x2533('0x41')],'message':_0xe673af[_0x2533('0x3e')],'row':_0x51ea5d});}function handleQuery(_0x27b785){logger[_0x2533('0x3c')](_0x27b785);return db[_0x2533('0x42')][_0x2533('0x43')](_0x27b785)['spread'](function(_0x4f72f5){results[_0x2533('0x44')](_0x4f72f5);})[_0x2533('0x45')](function(_0x3130b0){logger[_0x2533('0x46')](_0x3130b0[_0x2533('0x3e')]);});}function main(_0x552126,_0x208e87,_0x3b015a,_0x45219a){logger[_0x2533('0x3c')](_0x2533('0x47'),_0x552126,JSON[_0x2533('0x48')](_0x208e87));process[_0x2533('0x49')]('start');var _0x50c781=_0x208e87[_0x2533('0x4a')];var _0x33ce75=_0x208e87[_0x2533('0x4b')];var _0x5c3771=path['join'](config[_0x2533('0x4c')],_0x2533('0x4d'),_0x33ce75+'.csv');var _0x2861b9=_[_0x2533('0x35')](_0x50c781)[_0x2533('0x11')]();logger['info'](_0x2533('0x4e'),_0x2861b9);fs[_0x2533('0x4f')](_0x5c3771,_0x2861b9+'\x0a');Papa[_0x2533('0x50')](fs[_0x2533('0x51')](_0x552126),{'header':!![],'skipEmptyLines':!![],'step':function(_0x5e787b,_0x1be7b9){try{for(var _0x2a4d2b=0x0,_0x54cdcd=[];_0x2a4d2b<_0x5e787b[_0x2533('0x52')]['length'];_0x2a4d2b++){stats['rows']+=0x1;if(_0x5e787b[_0x2533('0x40')][_0x2a4d2b]){handleError(_0x5e787b['data'][_0x2a4d2b],_0x5e787b[_0x2533('0x40')][_0x2a4d2b]);}else{var _0x3f5a38=[];for(var _0x51134a in _0x50c781){if(_0x50c781[_0x2533('0x53')](_0x51134a)){if(_0x5e787b[_0x2533('0x52')][_0x2a4d2b][_0x50c781[_0x51134a]]){var _0x22e685=_[_0x2533('0x54')](_0x5e787b['data'][_0x2a4d2b][_0x50c781[_0x51134a]][_0x2533('0x55')](/"/g,'\x27'));switch(_0x51134a){case _0x2533('0x1f'):var _0x26b041=moment(_0x22e685,_0x2533('0x56'),!![]);if(_0x26b041[_0x2533('0x57')]()){_0x54cdcd[_0x2533('0x44')]('\x22'+_0x22e685+'\x22');}else{_0x3f5a38[_0x2533('0x44')](_0x2533('0x58'));}break;case _0x2533('0x59'):var _0xd22252=parseInt(_0x22e685);_0x22e685=_[_0x2533('0x5a')](_0xd22252)||_0xd22252<0x0||_0xd22252>0x4?_0x45219a?0x3:0x2:_0xd22252;_0x54cdcd[_0x2533('0x44')]('\x22'+_0x22e685+'\x22');break;case _0x2533('0x24'):var _0x133605=parseInt(_0x22e685);if(_['isNumber'](_0x133605)&&_[_0x2533('0x5b')](_0x3b015a,_0x133605)){_0x54cdcd[_0x2533('0x44')]('\x22'+_0x133605+'\x22');}else{_0x3f5a38[_0x2533('0x44')](_0x2533('0x5c'));}break;case'email':if(isEmail(_0x22e685)){_0x54cdcd['push']('\x22'+_0x22e685+'\x22');}else{_0x3f5a38[_0x2533('0x44')](_0x2533('0x5d'));}break;case _0x2533('0x5e'):var _0x1d6584=moment(_0x22e685,_0x2533('0x5f'),!![]);if(_0x1d6584[_0x2533('0x57')]()){_0x54cdcd[_0x2533('0x44')]('\x22'+_0x22e685+'\x22');}else{_0x3f5a38[_0x2533('0x44')]('dateOfBirth\x20wrong\x20format\x20(YYYY-MM-DD)');}break;default:_0x54cdcd[_0x2533('0x44')]('\x22'+_0x22e685+'\x22');}}else{switch(_0x51134a){case _0x2533('0x60'):case _0x2533('0xf'):_0x3f5a38[_0x2533('0x44')](_0x51134a+_0x2533('0x61'));break;default:_0x54cdcd['push']('\x22\x22');}}}}if(_0x3f5a38[_0x2533('0x62')]){handleError(_0x5e787b[_0x2533('0x52')][_0x2a4d2b],{'code':_0x2533('0x63'),'message':_0x3f5a38[_0x2533('0x11')]()});}else{fs[_0x2533('0x64')](_0x5c3771,_0x54cdcd[_0x2533('0x11')]()+'\x0a');}_0x54cdcd=[];}if(!(stats[_0x2533('0x65')]%0xc8)){socket['emit']('contact:import:'+_0x33ce75,stats);stats[_0x2533('0x40')]=[];}}if(stopped){logger[_0x2533('0x3c')](_0x2533('0x66'));_0x1be7b9[_0x2533('0x67')]();}}catch(_0x5498da){handleError(_0x5e787b[_0x2533('0x52')][_0x2a4d2b],{'code':_0x2533('0x68'),'message':_0x5498da[_0x2533('0x3e')]});logger[_0x2533('0x46')](_0x2533('0x69'),_0x5498da[_0x2533('0x3e')]);}},'complete':function(){try{var _0x28fc67=[];var _0x344088='cm_contacts';if(_0x208e87[_0x2533('0x6a')]&&_0x208e87['duplicates']['length']){_0x344088=_0x2533('0x6b')+_0x33ce75;_0x28fc67[_0x2533('0x44')](_0x2533('0x6c')+_0x344088+_0x2533('0x6d'));}var _0x3d08ac=util[_0x2533('0xc')]('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',_0x5c3771,_0x344088,_0x2861b9,_0x208e87[_0x2533('0x21')],_0x208e87[_0x2533('0x36')]||null,NOW,NOW);if(_[_0x2533('0x6e')](_0x50c781[_0x2533('0x1f')])){_0x3d08ac+=_0x2533('0x6f');}_0x28fc67[_0x2533('0x44')](_0x3d08ac);if(_0x208e87['duplicates']&&_0x208e87[_0x2533('0x6a')]['length']){_0x28fc67[_0x2533('0x44')](insertCmContact(_0x208e87[_0x2533('0x21')],_0x344088,_0x208e87[_0x2533('0x6a')],_0x50c781));_0x28fc67[_0x2533('0x44')](_0x2533('0x70')+_0x344088+';');}_0x28fc67['push'](insertCmHopper(_0x208e87[_0x2533('0x21')],_0x2533('0x71'),'voice_queues',_0x2533('0x72'),_0x45219a));_0x28fc67['push'](insertCmHopperBlack(_0x208e87[_0x2533('0x21')],_0x2533('0x73'),_0x2533('0x74'),_0x2533('0x72')));_0x28fc67[_0x2533('0x44')](insertCmHopper(_0x208e87[_0x2533('0x21')],_0x2533('0x75'),_0x2533('0x76'),_0x2533('0x77'),_0x45219a));_0x28fc67[_0x2533('0x44')](insertCmHopperBlack(_0x208e87['ListId'],_0x2533('0x78'),'campaigns','CampaignId'));BPromise[_0x2533('0x79')](_0x28fc67,handleQuery)[_0x2533('0x7a')](function(_0x45e581){stats['finish']=!![];stats[_0x2533('0x7b')]=_0x208e87[_0x2533('0x6a')]&&_0x208e87[_0x2533('0x6a')][_0x2533('0x62')]?results[0x2][_0x2533('0x7b')]:results[0x0][_0x2533('0x7b')];socket[_0x2533('0x7c')](_0x2533('0x7d')+_0x33ce75,stats);fs[_0x2533('0x7e')](_0x552126);fs['unlink'](_0x5c3771);process[_0x2533('0x3f')](0x0);})[_0x2533('0x45')](function(_0x2929ff){logger['error'](_0x2929ff[_0x2533('0x3e')]);process[_0x2533('0x3f')](0x1);});}catch(_0x2e181c){logger['error'](_0x2533('0x7f'),_0x2e181c[_0x2533('0x3e')]);process[_0x2533('0x3f')](0x1);}},'error':function(_0x1ffb81,_0x594639,_0x3df18d,_0x147847){throw new Error(_0x147847);}});}function validate(){if(process[_0x2533('0x80')]&&process[_0x2533('0x80')][_0x2533('0x62')]<0x4){throw new Error(_0x2533('0x81'));}var _0x26f006=path[_0x2533('0x11')](config[_0x2533('0x4c')],_0x2533('0x4d'),process[_0x2533('0x80')][0x2]);if(!fs['existsSync'](_0x26f006)){throw new Error(_0x2533('0x82'));}var _0x5c8837={};try{_0x5c8837=JSON[_0x2533('0x50')](process[_0x2533('0x80')][0x3]);if(!_0x5c8837['binding']){throw new Error(_0x2533('0x83'));}if(!_0x5c8837[_0x2533('0x4a')][_0x2533('0xf')]){throw new Error(_0x2533('0x84'));}if(!_0x5c8837[_0x2533('0x4a')][_0x2533('0x60')]){throw new Error(_0x2533('0x85'));}var _0x528366=0x0;if(_0x5c8837[_0x2533('0x4a')][_0x2533('0x24')]){_0x528366=0x1;}if(!_0x5c8837['ListId']){throw new Error(_0x2533('0x86'));}}catch(_0x114e2f){throw new Error(_0x2533('0x87'));}var _0x617a54=[];try{_0x617a54=_[_0x2533('0x88')](JSON[_0x2533('0x50')](process[_0x2533('0x80')][0x4]),'id');}catch(_0x4ff201){logger[_0x2533('0x3c')](_0x2533('0x89'));}main(_0x26f006,_0x5c8837,_0x617a54,_0x528366);}validate();process['on'](_0x2533('0x8a'),handleStop);process['on'](_0x2533('0x8b'),handleUncaughtException);
\ No newline at end of file
diff --git a/server/components/integrations/configuration.js b/server/components/integrations/configuration.js
index d7cadce..7e59be3 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 _0xb10b=['Complete\x20Time','Duration','duration','Billable\x20Time','getSubjects','string','toLowerCase','voice','inbound','push','variable','outbound','Outbound\x20Call','destcalleridnum','getDescriptions','***\x20Call\x20Info\x20***','keyValue','Caller\x20Number','calleridnum','calleridname','Call\x20To','destexten','Queue','queue','UniqueId','uniqueid','Date','agentcalledAt','***\x20Agent\x20Info\x20***','destcalleridname','Agent\x20Number','***\x20Time\x20Info\x20***','Agent\x20Connect','agentconnectAt','Agent\x20Complete','agentcompleteAt','Hold\x20Time','talktime','Called\x20Number','Member\x20Name','membername','Answer\x20Time'];(function(_0x4d052d,_0x48bae9){var _0x70467b=function(_0x238a8c){while(--_0x238a8c){_0x4d052d['push'](_0x4d052d['shift']());}};_0x70467b(++_0x48bae9);}(_0xb10b,0x12a));var _0xbb10=function(_0x3653c7,_0xadb356){_0x3653c7=_0x3653c7-0x0;var _0x58a021=_0xb10b[_0x3653c7];return _0x58a021;};'use strict';exports[_0xbb10('0x0')]=function(_0x4bb7bb,_0x390ae2){var _0x35bc5f=[{'type':_0xbb10('0x1'),'content':'[xCALLY\x20Ticket]','variableName':null}];switch(_0x4bb7bb[_0xbb10('0x2')]()){case _0xbb10('0x3'):switch(_0x390ae2[_0xbb10('0x2')]()){case _0xbb10('0x4'):_0x35bc5f[_0xbb10('0x5')]({'type':_0xbb10('0x6'),'content':'','variableName':'queue'});_0x35bc5f[_0xbb10('0x5')]({'type':_0xbb10('0x6'),'content':'','variableName':'calleridnum'});break;case _0xbb10('0x7'):_0x35bc5f[_0xbb10('0x5')]({'type':_0xbb10('0x1'),'content':_0xbb10('0x8'),'variableName':null});_0x35bc5f[_0xbb10('0x5')]({'type':_0xbb10('0x6'),'content':'','variableName':_0xbb10('0x9')});break;}}return _0x35bc5f;};exports[_0xbb10('0xa')]=function(_0x5ab04a,_0x4e47f8){var _0x20bd61=[];switch(_0x5ab04a[_0xbb10('0x2')]()){case _0xbb10('0x3'):switch(_0x4e47f8['toLowerCase']()){case _0xbb10('0x4'):_0x20bd61=[{'type':'string','content':_0xbb10('0xb'),'key':null,'keyType':null,'variableName':null},{'type':_0xbb10('0xc'),'content':'','key':_0xbb10('0xd'),'keyType':_0xbb10('0x6'),'variableName':_0xbb10('0xe')},{'type':_0xbb10('0xc'),'content':'','key':'Caller\x20Name','keyType':_0xbb10('0x6'),'variableName':_0xbb10('0xf')},{'type':_0xbb10('0xc'),'content':'','key':_0xbb10('0x10'),'keyType':_0xbb10('0x6'),'variableName':_0xbb10('0x11')},{'type':_0xbb10('0xc'),'content':'','key':_0xbb10('0x12'),'keyType':_0xbb10('0x6'),'variableName':_0xbb10('0x13')},{'type':'keyValue','content':'','key':_0xbb10('0x14'),'keyType':_0xbb10('0x6'),'variableName':_0xbb10('0x15')},{'type':_0xbb10('0xc'),'content':'','key':_0xbb10('0x16'),'keyType':_0xbb10('0x6'),'variableName':_0xbb10('0x17')},{'type':_0xbb10('0x1'),'content':_0xbb10('0x18'),'key':null,'keyType':null,'variableName':null},{'type':_0xbb10('0xc'),'content':'','key':'Agent\x20Name','keyType':_0xbb10('0x6'),'variableName':_0xbb10('0x19')},{'type':_0xbb10('0xc'),'content':'','key':_0xbb10('0x1a'),'keyType':_0xbb10('0x6'),'variableName':_0xbb10('0x9')},{'type':'string','content':_0xbb10('0x1b'),'key':null,'keyType':null,'variableName':null},{'type':_0xbb10('0xc'),'content':'','key':'Agent\x20Ring','keyType':'variable','variableName':_0xbb10('0x17')},{'type':_0xbb10('0xc'),'content':'','key':_0xbb10('0x1c'),'keyType':_0xbb10('0x6'),'variableName':_0xbb10('0x1d')},{'type':_0xbb10('0xc'),'content':'','key':_0xbb10('0x1e'),'keyType':_0xbb10('0x6'),'variableName':_0xbb10('0x1f')},{'type':_0xbb10('0xc'),'content':'','key':_0xbb10('0x20'),'keyType':_0xbb10('0x6'),'variableName':'holdtime'},{'type':'keyValue','content':'','key':'Talk\x20Time','keyType':_0xbb10('0x6'),'variableName':_0xbb10('0x21')}];break;case _0xbb10('0x7'):_0x20bd61=[{'type':'string','content':_0xbb10('0xb'),'variableName':null},{'type':_0xbb10('0xc'),'content':'','key':_0xbb10('0x22'),'keyType':_0xbb10('0x6'),'keyContent':'','variableName':_0xbb10('0x9')},{'type':_0xbb10('0xc'),'content':'','key':_0xbb10('0x23'),'keyType':'variable','keyContent':'','variableName':_0xbb10('0x24')},{'type':_0xbb10('0xc'),'content':'','key':_0xbb10('0x14'),'keyType':_0xbb10('0x6'),'keyContent':'','variableName':_0xbb10('0x15')},{'type':_0xbb10('0xc'),'content':'','key':'Date','keyType':_0xbb10('0x6'),'keyContent':'','variableName':'starttime'},{'type':_0xbb10('0x1'),'content':'***\x20Time\x20Info\x20***'},{'type':_0xbb10('0xc'),'content':'','key':_0xbb10('0x25'),'keyType':_0xbb10('0x6'),'keyContent':'','variableName':'answertime'},{'type':'keyValue','content':'','key':_0xbb10('0x26'),'keyType':_0xbb10('0x6'),'keyContent':'','variableName':'endtime'},{'type':_0xbb10('0xc'),'content':'','key':_0xbb10('0x27'),'keyType':_0xbb10('0x6'),'keyContent':'','variableName':_0xbb10('0x28')},{'type':_0xbb10('0xc'),'content':'','key':_0xbb10('0x29'),'keyType':_0xbb10('0x6'),'keyContent':'','variableName':'billableseconds'}];break;}}return _0x20bd61;};
\ No newline at end of file
+var _0xd4a2=['Agent\x20Number','***\x20Time\x20Info\x20***','Agent\x20Ring','agentcalledAt','Agent\x20Connect','agentconnectAt','Agent\x20Complete','agentcompleteAt','Hold\x20Time','Called\x20Number','starttime','Answer\x20Time','answertime','Complete\x20Time','endtime','Duration','duration','Billable\x20Time','billableseconds','getSubjects','[xCALLY\x20Ticket]','voice','inbound','push','variable','queue','calleridnum','outbound','string','Outbound\x20Call','destcalleridnum','getDescriptions','toLowerCase','***\x20Call\x20Info\x20***','keyValue','Caller\x20Number','Caller\x20Name','destexten','Queue','UniqueId','uniqueid','Date','Agent\x20Name','destcalleridname'];(function(_0x3074f3,_0x4f2c03){var _0x53f112=function(_0x4a17af){while(--_0x4a17af){_0x3074f3['push'](_0x3074f3['shift']());}};_0x53f112(++_0x4f2c03);}(_0xd4a2,0x173));var _0x2d4a=function(_0x34c4bc,_0x2eda5e){_0x34c4bc=_0x34c4bc-0x0;var _0x293a40=_0xd4a2[_0x34c4bc];return _0x293a40;};'use strict';exports[_0x2d4a('0x0')]=function(_0x5d70e1,_0x4e88a9){var _0xfba415=[{'type':'string','content':_0x2d4a('0x1'),'variableName':null}];switch(_0x5d70e1['toLowerCase']()){case _0x2d4a('0x2'):switch(_0x4e88a9['toLowerCase']()){case _0x2d4a('0x3'):_0xfba415[_0x2d4a('0x4')]({'type':_0x2d4a('0x5'),'content':'','variableName':_0x2d4a('0x6')});_0xfba415[_0x2d4a('0x4')]({'type':'variable','content':'','variableName':_0x2d4a('0x7')});break;case _0x2d4a('0x8'):_0xfba415[_0x2d4a('0x4')]({'type':_0x2d4a('0x9'),'content':_0x2d4a('0xa'),'variableName':null});_0xfba415[_0x2d4a('0x4')]({'type':_0x2d4a('0x5'),'content':'','variableName':_0x2d4a('0xb')});break;}}return _0xfba415;};exports[_0x2d4a('0xc')]=function(_0x4738dc,_0x3abbbd){var _0xce6af6=[];switch(_0x4738dc['toLowerCase']()){case'voice':switch(_0x3abbbd[_0x2d4a('0xd')]()){case'inbound':_0xce6af6=[{'type':_0x2d4a('0x9'),'content':_0x2d4a('0xe'),'key':null,'keyType':null,'variableName':null},{'type':_0x2d4a('0xf'),'content':'','key':_0x2d4a('0x10'),'keyType':_0x2d4a('0x5'),'variableName':_0x2d4a('0x7')},{'type':_0x2d4a('0xf'),'content':'','key':_0x2d4a('0x11'),'keyType':'variable','variableName':'calleridname'},{'type':_0x2d4a('0xf'),'content':'','key':'Call\x20To','keyType':_0x2d4a('0x5'),'variableName':_0x2d4a('0x12')},{'type':_0x2d4a('0xf'),'content':'','key':_0x2d4a('0x13'),'keyType':'variable','variableName':_0x2d4a('0x6')},{'type':'keyValue','content':'','key':_0x2d4a('0x14'),'keyType':'variable','variableName':_0x2d4a('0x15')},{'type':_0x2d4a('0xf'),'content':'','key':_0x2d4a('0x16'),'keyType':_0x2d4a('0x5'),'variableName':'agentcalledAt'},{'type':'string','content':'***\x20Agent\x20Info\x20***','key':null,'keyType':null,'variableName':null},{'type':_0x2d4a('0xf'),'content':'','key':_0x2d4a('0x17'),'keyType':_0x2d4a('0x5'),'variableName':_0x2d4a('0x18')},{'type':_0x2d4a('0xf'),'content':'','key':_0x2d4a('0x19'),'keyType':'variable','variableName':'destcalleridnum'},{'type':_0x2d4a('0x9'),'content':_0x2d4a('0x1a'),'key':null,'keyType':null,'variableName':null},{'type':_0x2d4a('0xf'),'content':'','key':_0x2d4a('0x1b'),'keyType':_0x2d4a('0x5'),'variableName':_0x2d4a('0x1c')},{'type':_0x2d4a('0xf'),'content':'','key':_0x2d4a('0x1d'),'keyType':'variable','variableName':_0x2d4a('0x1e')},{'type':_0x2d4a('0xf'),'content':'','key':_0x2d4a('0x1f'),'keyType':_0x2d4a('0x5'),'variableName':_0x2d4a('0x20')},{'type':_0x2d4a('0xf'),'content':'','key':_0x2d4a('0x21'),'keyType':_0x2d4a('0x5'),'variableName':'holdtime'},{'type':'keyValue','content':'','key':'Talk\x20Time','keyType':_0x2d4a('0x5'),'variableName':'talktime'}];break;case _0x2d4a('0x8'):_0xce6af6=[{'type':_0x2d4a('0x9'),'content':_0x2d4a('0xe'),'variableName':null},{'type':_0x2d4a('0xf'),'content':'','key':_0x2d4a('0x22'),'keyType':_0x2d4a('0x5'),'keyContent':'','variableName':_0x2d4a('0xb')},{'type':_0x2d4a('0xf'),'content':'','key':'Member\x20Name','keyType':_0x2d4a('0x5'),'keyContent':'','variableName':'membername'},{'type':_0x2d4a('0xf'),'content':'','key':_0x2d4a('0x14'),'keyType':_0x2d4a('0x5'),'keyContent':'','variableName':_0x2d4a('0x15')},{'type':_0x2d4a('0xf'),'content':'','key':_0x2d4a('0x16'),'keyType':_0x2d4a('0x5'),'keyContent':'','variableName':_0x2d4a('0x23')},{'type':'string','content':_0x2d4a('0x1a')},{'type':_0x2d4a('0xf'),'content':'','key':_0x2d4a('0x24'),'keyType':_0x2d4a('0x5'),'keyContent':'','variableName':_0x2d4a('0x25')},{'type':'keyValue','content':'','key':_0x2d4a('0x26'),'keyType':_0x2d4a('0x5'),'keyContent':'','variableName':_0x2d4a('0x27')},{'type':_0x2d4a('0xf'),'content':'','key':_0x2d4a('0x28'),'keyType':'variable','keyContent':'','variableName':_0x2d4a('0x29')},{'type':_0x2d4a('0xf'),'content':'','key':_0x2d4a('0x2a'),'keyType':_0x2d4a('0x5'),'keyContent':'','variableName':_0x2d4a('0x2b')}];break;}}return _0xce6af6;};
\ No newline at end of file
diff --git a/server/components/interaction/service.js b/server/components/interaction/service.js
index 092d01b..9439d87 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 _0xcf88=['body','omit','html','phone','fax','mobile','lodash','../../mysqldb','../../config/logger','openchannel-interactions','mail-interactions','sms-interactions','InteractionId','upperFirst','unknown','toLowerCase','[%s]\x20id=%s\x20name=%s\x20role=%s\x20interaction=%s\x20body=%s','toUpperCase','name','role','stringify','null','findOne','then','update','info','catch','error','user','clone'];(function(_0x25b4a4,_0x2e081b){var _0x707267=function(_0x440123){while(--_0x440123){_0x25b4a4['push'](_0x25b4a4['shift']());}};_0x707267(++_0x2e081b);}(_0xcf88,0x150));var _0x8cf8=function(_0x3b380d,_0x4bf247){_0x3b380d=_0x3b380d-0x0;var _0x54502b=_0xcf88[_0x3b380d];return _0x54502b;};'use strict';var _=require(_0x8cf8('0x0'));var db=require(_0x8cf8('0x1'))['db'];var loggers={'openchannel':require(_0x8cf8('0x2'))(_0x8cf8('0x3')),'mail':require(_0x8cf8('0x2'))(_0x8cf8('0x4')),'fax':require(_0x8cf8('0x2'))('fax-interactions'),'sms':require(_0x8cf8('0x2'))(_0x8cf8('0x5')),'chat':require('../../config/logger')('chat-interactions')};function getInteractionId(_0x13c111,_0x35adbb,_0x1676dd){if(_0x13c111&&_0x13c111[_['upperFirst'](_0x1676dd)+_0x8cf8('0x6')]){return _0x13c111[_[_0x8cf8('0x7')](_0x1676dd)+'InteractionId'];}else if(_0x13c111&&_0x13c111['id']){return _0x13c111['id'];}else if(_0x35adbb&&_0x35adbb['id']){return _0x35adbb['id'];}else{return _0x8cf8('0x8');}}function log(_0x40fb62,_0xfd3ec8,_0x319f49,_0x199f77,_0x173c36,_0x56015){loggers[_0x173c36[_0x8cf8('0x9')]()][_0x40fb62](_0x8cf8('0xa'),_0x56015[_0x8cf8('0xb')](),_0xfd3ec8?_0xfd3ec8['id']:null,_0xfd3ec8?_0xfd3ec8[_0x8cf8('0xc')]:null,_0xfd3ec8?_0xfd3ec8[_0x8cf8('0xd')]:null,getInteractionId(_0x319f49,_0x199f77,_0x173c36),_0x319f49?JSON[_0x8cf8('0xe')](_0x319f49):_0x8cf8('0xf'));}function updateUser(_0x53ec3b,_0x24fb3c,_0x4d086c,_0x4868c0,_0x9c1145){db[_[_0x8cf8('0x7')](_0x4868c0)+'Interaction'][_0x8cf8('0x10')]({'where':{'id':getInteractionId(_0x24fb3c,_0x4d086c,_0x4868c0)}})[_0x8cf8('0x11')](function(_0x2015aa){if(_0x2015aa){return _0x2015aa[_0x8cf8('0x12')]({'UserId':_0x53ec3b?_0x53ec3b['id']:null});}})['then'](function(_0x1d25c4){if(_0x1d25c4){log(_0x8cf8('0x13'),_0x53ec3b,_0x24fb3c,_0x4d086c,_0x4868c0,_0x9c1145);}})[_0x8cf8('0x14')](function(){log(_0x8cf8('0x15'),_0x53ec3b,_0x24fb3c,_0x4d086c,_0x4868c0,_0x9c1145);});}exports['tracked']=function(_0x33d588,_0x119043){return function(_0x29b62d,_0x15c7f3,_0x4a2584){var _0x593cc4=_0x29b62d[_0x8cf8('0x16')];var _0x2b6566={};var _0x5b5957=_0x29b62d['query'];if(_0x2b6566){_0x2b6566=_[_0x8cf8('0x17')](_0x29b62d[_0x8cf8('0x18')]);_0x2b6566=_[_0x8cf8('0x19')](_0x2b6566,[_0x8cf8('0x18'),_0x8cf8('0x1a'),_0x8cf8('0x1b'),_0x8cf8('0x1c'),_0x8cf8('0x1d')]);}updateUser(_0x593cc4,_0x2b6566,_0x5b5957,_0x33d588,_0x119043);_0x4a2584(null);};};
\ No newline at end of file
+var _0x5fa2=['mail-interactions','upperFirst','InteractionId','unknown','toLowerCase','toUpperCase','name','stringify','null','findOne','then','update','info','catch','error','user','query','clone','omit','body','phone','fax','mobile','../../config/logger','openchannel-interactions'];(function(_0x5ddce4,_0x44cbe4){var _0x39676f=function(_0x10526f){while(--_0x10526f){_0x5ddce4['push'](_0x5ddce4['shift']());}};_0x39676f(++_0x44cbe4);}(_0x5fa2,0x18e));var _0x25fa=function(_0x2bff01,_0x1d1396){_0x2bff01=_0x2bff01-0x0;var _0x9e6bef=_0x5fa2[_0x2bff01];return _0x9e6bef;};'use strict';var _=require('lodash');var db=require('../../mysqldb')['db'];var loggers={'openchannel':require(_0x25fa('0x0'))(_0x25fa('0x1')),'mail':require(_0x25fa('0x0'))(_0x25fa('0x2')),'fax':require(_0x25fa('0x0'))('fax-interactions'),'sms':require(_0x25fa('0x0'))('sms-interactions'),'chat':require(_0x25fa('0x0'))('chat-interactions')};function getInteractionId(_0x4ff2f6,_0x596e41,_0x4cbc0c){if(_0x4ff2f6&&_0x4ff2f6[_[_0x25fa('0x3')](_0x4cbc0c)+_0x25fa('0x4')]){return _0x4ff2f6[_[_0x25fa('0x3')](_0x4cbc0c)+_0x25fa('0x4')];}else if(_0x4ff2f6&&_0x4ff2f6['id']){return _0x4ff2f6['id'];}else if(_0x596e41&&_0x596e41['id']){return _0x596e41['id'];}else{return _0x25fa('0x5');}}function log(_0x349231,_0x4f64be,_0x1631f5,_0x2295e6,_0x36a0d5,_0x307b0a){loggers[_0x36a0d5[_0x25fa('0x6')]()][_0x349231]('[%s]\x20id=%s\x20name=%s\x20role=%s\x20interaction=%s\x20body=%s',_0x307b0a[_0x25fa('0x7')](),_0x4f64be?_0x4f64be['id']:null,_0x4f64be?_0x4f64be[_0x25fa('0x8')]:null,_0x4f64be?_0x4f64be['role']:null,getInteractionId(_0x1631f5,_0x2295e6,_0x36a0d5),_0x1631f5?JSON[_0x25fa('0x9')](_0x1631f5):_0x25fa('0xa'));}function updateUser(_0x14e344,_0x2f535e,_0x50ab8c,_0x40d169,_0x3706f1){db[_['upperFirst'](_0x40d169)+'Interaction'][_0x25fa('0xb')]({'where':{'id':getInteractionId(_0x2f535e,_0x50ab8c,_0x40d169)}})[_0x25fa('0xc')](function(_0x2246f7){if(_0x2246f7){return _0x2246f7[_0x25fa('0xd')]({'UserId':_0x14e344?_0x14e344['id']:null});}})[_0x25fa('0xc')](function(_0x43ba7d){if(_0x43ba7d){log(_0x25fa('0xe'),_0x14e344,_0x2f535e,_0x50ab8c,_0x40d169,_0x3706f1);}})[_0x25fa('0xf')](function(){log(_0x25fa('0x10'),_0x14e344,_0x2f535e,_0x50ab8c,_0x40d169,_0x3706f1);});}exports['tracked']=function(_0x26d622,_0x507c52){return function(_0x3410da,_0x3b4880,_0x5017ab){var _0x40e05d=_0x3410da[_0x25fa('0x11')];var _0x15eaa4={};var _0x3b675b=_0x3410da[_0x25fa('0x12')];if(_0x15eaa4){_0x15eaa4=_[_0x25fa('0x13')](_0x3410da['body']);_0x15eaa4=_[_0x25fa('0x14')](_0x15eaa4,[_0x25fa('0x15'),'html',_0x25fa('0x16'),_0x25fa('0x17'),_0x25fa('0x18')]);}updateUser(_0x40e05d,_0x15eaa4,_0x3b675b,_0x26d622,_0x507c52);_0x5017ab(null);};};
\ No newline at end of file
diff --git a/server/components/license/service.js b/server/components/license/service.js
index b6bcfa5..48b6a18 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 _0xd06f=['then','status','json','Maximum\x20%s\x20limit\x20have\x20been\x20reached','catch','users','admin','user','isUserLimit','crypto','util','composable-middleware','../../mysqldb','../../config/environment','data1','license','split','aes-256-ctr','%s:%s:%s','base64','utf8','final','parse','hasOwnProperty','use','License'];(function(_0x42277f,_0x497b8c){var _0x20cf00=function(_0x542680){while(--_0x542680){_0x42277f['push'](_0x42277f['shift']());}};_0x20cf00(++_0x497b8c);}(_0xd06f,0x71));var _0xfd06=function(_0x3a4639,_0x42370a){_0x3a4639=_0x3a4639-0x0;var _0x17f851=_0xd06f[_0x3a4639];return _0x17f851;};'use strict';var crypto=require(_0xfd06('0x0'));var util=require(_0xfd06('0x1'));var compose=require(_0xfd06('0x2'));var db=require(_0xfd06('0x3'))['db'];var config=require(_0xfd06('0x4'));function getValueFromLicense(_0x429978,_0x1d58c0){if(_0x429978&&_0x1d58c0){if(_0x1d58c0[_0xfd06('0x5')]&&_0x1d58c0[_0xfd06('0x6')]){var _0x48481a=_0x1d58c0[_0xfd06('0x5')];var _0x408b59=_0x1d58c0[_0xfd06('0x6')];var _0x431280=_0x48481a[_0xfd06('0x7')]('-')[0x4];var _0x1b4fdf=_0x48481a[_0xfd06('0x7')]('-')[0x0];var _0xa7943b=crypto['createDecipher'](_0xfd06('0x8'),util['format'](_0xfd06('0x9'),_0x431280,_0x48481a,_0x1b4fdf));var _0x1f91e4=_0xa7943b['update'](_0x408b59,_0xfd06('0xa'),_0xfd06('0xb'));_0x1f91e4+=_0xa7943b[_0xfd06('0xc')](_0xfd06('0xb'));var _0x1bbe5e=JSON[_0xfd06('0xd')](_0x1f91e4);return _0x1bbe5e[_0xfd06('0xe')](_0x429978)?_0x1bbe5e[_0x429978]:null;}}return null;}function isLimit(_0x4f1c6d,_0xeb96a1,_0x42753e,_0x96b59){var _0x3abaaa=_0xeb96a1;return compose()[_0xfd06('0xf')](function(_0x407481,_0x128f0f,_0x152f10){return db[_0xfd06('0x10')]['findOne']({'where':{'id':0x1},'raw':!![]})[_0xfd06('0x11')](function(_0x321786){var _0x293274=getValueFromLicense(_0x4f1c6d,_0x321786);return _0x293274?_0x293274:_0x3abaaa;})[_0xfd06('0x11')](function(_0x4e6dc4){_0x3abaaa=_0x4e6dc4;return _0x42753e['count'](_0x96b59);})['then'](function(_0x31c0d0){if(_0x31c0d0>=_0x3abaaa){return _0x128f0f[_0xfd06('0x12')](0x193)[_0xfd06('0x13')]({'message':util['format'](_0xfd06('0x14'),_0x4f1c6d)});}_0x152f10();})[_0xfd06('0x15')](function(_0x2b8842){_0x152f10(_0x2b8842);});});}function isUserLimit(){return isLimit(_0xfd06('0x16'),0x1,db['User'],{'where':{'$or':[{'role':_0xfd06('0x17')},{'role':_0xfd06('0x18')}]}});}exports[_0xfd06('0x19')]=isUserLimit;
\ No newline at end of file
+var _0x2e8e=['utf8','parse','hasOwnProperty','use','License','findOne','then','count','status','json','Maximum\x20%s\x20limit\x20have\x20been\x20reached','catch','users','User','admin','user','isUserLimit','crypto','composable-middleware','../../mysqldb','data1','license','split','createDecipher','format','%s:%s:%s','update','base64','final'];(function(_0x3011b7,_0x56b4b0){var _0x304ca2=function(_0x5832be){while(--_0x5832be){_0x3011b7['push'](_0x3011b7['shift']());}};_0x304ca2(++_0x56b4b0);}(_0x2e8e,0x133));var _0xe2e8=function(_0x52f159,_0x419d8a){_0x52f159=_0x52f159-0x0;var _0x156799=_0x2e8e[_0x52f159];return _0x156799;};'use strict';var crypto=require(_0xe2e8('0x0'));var util=require('util');var compose=require(_0xe2e8('0x1'));var db=require(_0xe2e8('0x2'))['db'];var config=require('../../config/environment');function getValueFromLicense(_0x19649a,_0x5e15d8){if(_0x19649a&&_0x5e15d8){if(_0x5e15d8[_0xe2e8('0x3')]&&_0x5e15d8[_0xe2e8('0x4')]){var _0x56857d=_0x5e15d8['data1'];var _0x570a83=_0x5e15d8['license'];var _0x35bbe3=_0x56857d[_0xe2e8('0x5')]('-')[0x4];var _0x32b59a=_0x56857d[_0xe2e8('0x5')]('-')[0x0];var _0x1ff48f=crypto[_0xe2e8('0x6')]('aes-256-ctr',util[_0xe2e8('0x7')](_0xe2e8('0x8'),_0x35bbe3,_0x56857d,_0x32b59a));var _0xd8e75b=_0x1ff48f[_0xe2e8('0x9')](_0x570a83,_0xe2e8('0xa'),'utf8');_0xd8e75b+=_0x1ff48f[_0xe2e8('0xb')](_0xe2e8('0xc'));var _0xadfd95=JSON[_0xe2e8('0xd')](_0xd8e75b);return _0xadfd95[_0xe2e8('0xe')](_0x19649a)?_0xadfd95[_0x19649a]:null;}}return null;}function isLimit(_0x163282,_0x10a439,_0x3312d0,_0x50ed6c){var _0x2903b5=_0x10a439;return compose()[_0xe2e8('0xf')](function(_0xeaf36b,_0x4a2243,_0xbfdce4){return db[_0xe2e8('0x10')][_0xe2e8('0x11')]({'where':{'id':0x1},'raw':!![]})[_0xe2e8('0x12')](function(_0xcee2ff){var _0xea33=getValueFromLicense(_0x163282,_0xcee2ff);return _0xea33?_0xea33:_0x2903b5;})[_0xe2e8('0x12')](function(_0x33216d){_0x2903b5=_0x33216d;return _0x3312d0[_0xe2e8('0x13')](_0x50ed6c);})['then'](function(_0x30080c){if(_0x30080c>=_0x2903b5){return _0x4a2243[_0xe2e8('0x14')](0x193)[_0xe2e8('0x15')]({'message':util[_0xe2e8('0x7')](_0xe2e8('0x16'),_0x163282)});}_0xbfdce4();})[_0xe2e8('0x17')](function(_0x1c885d){_0xbfdce4(_0x1c885d);});});}function isUserLimit(){return isLimit(_0xe2e8('0x18'),0x1,db[_0xe2e8('0x19')],{'where':{'$or':[{'role':_0xe2e8('0x1a')},{'role':_0xe2e8('0x1b')}]}});}exports[_0xe2e8('0x1c')]=isUserLimit;
\ No newline at end of file
diff --git a/server/components/parsers/advancedSearch.js b/server/components/parsers/advancedSearch.js
index 6a0d43b..b4944bc 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 _0x0f78=['buildExpression','DATE','operator','$between','value','$lte','add','days','format','YYYY-MM-DD','castTo','text','CAST(','field','\x20AS\x20','includes','$ne','$notIn','\x20OR\x20','\x20IS\x20NULL)','$in','IN\x20?','NOT\x20IN\x20?','$eq','=\x20?','<>\x20?','$startsWith','LIKE\x20?','<\x20?','<=\x20?','>=\x20?','BETWEEN\x20?\x20AND\x20?','$substring','start','$endsWith','pop','utcOffset','hours','seconds','parseSearch','sqlOperator','startsWith','[$or]','[$and]','replace','split','length','slice','match','forEach','filter','conditions','push'];(function(_0x288b4c,_0x28b0c7){var _0x9367bf=function(_0x325631){while(--_0x325631){_0x288b4c['push'](_0x288b4c['shift']());}};_0x9367bf(++_0x28b0c7);}(_0x0f78,0x1cf));var _0x80f7=function(_0x333907,_0x1e0f6a){_0x333907=_0x333907-0x0;var _0x5c30c0=_0x0f78[_0x333907];return _0x5c30c0;};'use strict';var _=require('lodash');var moment=require('moment');exports[_0x80f7('0x0')]=function(_0x580c43){var _0x4c99ab={'conditions':[]};_0x4c99ab[_0x80f7('0x1')]=_[_0x80f7('0x2')](_0x580c43,_0x80f7('0x3'))?'or':'and';var _0x5615f7=_0x580c43['replace'](_0x80f7('0x4'),'')[_0x80f7('0x5')](_0x80f7('0x3'),'')[_0x80f7('0x6')]('||');for(var _0x30ae4c=0x0;_0x30ae4c<_0x5615f7[_0x80f7('0x7')];_0x30ae4c++){var _0x2451a7=_0x5615f7[_0x30ae4c][_0x80f7('0x6')](':=');var _0x210314=_0x2451a7[0x0];var _0x3ca276=_0x2451a7[_0x80f7('0x8')](0x1);_0x3ca276['forEach'](function(_0x2314be){var _0x4b68b2=_0x2314be['split']('[')['shift']();var _0xb78073=_0x2314be[_0x80f7('0x9')](/\[(.*?)\]/g);_0xb78073[_0x80f7('0xa')](function(_0x1409dc){var _0x4b09a5=_0x1409dc[_0x80f7('0x6')]('[')[_0x80f7('0xb')](function(_0x3e3d3c){return _0x3e3d3c['indexOf'](']')>-0x1;})['map'](function(_0x3e14df){return _0x3e14df['split'](']')[0x0];})[0x0];_0x4c99ab[_0x80f7('0xc')][_0x80f7('0xd')]({'field':_0x210314,'operator':_0x4b68b2,'value':_0x4b09a5});});});}return _0x4c99ab;};exports[_0x80f7('0xe')]=function(_0x4fc9aa,_0x375f47,_0x1671cd){var _0x134e68={};if(_0x375f47===_0x80f7('0xf')){if(_0x1671cd[_0x80f7('0x10')]==='$eq'){_0x1671cd[_0x80f7('0x10')]=_0x80f7('0x11');_0x1671cd['value']+=','+_0x1671cd[_0x80f7('0x12')];}else if(_['includes'](['$gt',_0x80f7('0x13')],_0x1671cd[_0x80f7('0x10')])){_0x1671cd['value']=moment(_0x1671cd[_0x80f7('0x12')])[_0x80f7('0x14')](0x1,_0x80f7('0x15'))[_0x80f7('0x16')](_0x80f7('0x17'));}}if(_0x1671cd[_0x80f7('0x18')]){_0x375f47=_0x1671cd[_0x80f7('0x18')];_0x134e68[_0x80f7('0x19')]=_0x80f7('0x1a')+_0x4fc9aa+'.'+_0x1671cd[_0x80f7('0x1b')]+_0x80f7('0x1c')+_0x1671cd['castTo']+')\x20'+parseOperator(_0x1671cd[_0x80f7('0x10')]);}else{_0x134e68['text']=_0x4fc9aa+'.'+_0x1671cd[_0x80f7('0x1b')]+'\x20'+parseOperator(_0x1671cd[_0x80f7('0x10')]);}if(_[_0x80f7('0x1d')]([_0x80f7('0x1e'),_0x80f7('0x1f')],_0x1671cd[_0x80f7('0x10')]))_0x134e68[_0x80f7('0x19')]='('+_0x134e68['text']+_0x80f7('0x20')+_0x4fc9aa+'.'+_0x1671cd['field']+_0x80f7('0x21');_0x134e68['value']=parseValue(_0x375f47,_0x1671cd[_0x80f7('0x10')],_0x1671cd[_0x80f7('0x12')]);return _0x134e68;};function parseOperator(_0x2cc29f){var _0x55cfe7;switch(_0x2cc29f){case _0x80f7('0x22'):_0x55cfe7=_0x80f7('0x23');break;case'$notIn':_0x55cfe7=_0x80f7('0x24');break;case _0x80f7('0x25'):_0x55cfe7=_0x80f7('0x26');break;case _0x80f7('0x1e'):_0x55cfe7=_0x80f7('0x27');break;case'$substring':case _0x80f7('0x28'):case'$endsWith':_0x55cfe7=_0x80f7('0x29');break;case'$lt':_0x55cfe7=_0x80f7('0x2a');break;case'$gt':_0x55cfe7='>\x20?';break;case _0x80f7('0x13'):_0x55cfe7=_0x80f7('0x2b');break;case'$gte':_0x55cfe7=_0x80f7('0x2c');break;case _0x80f7('0x11'):_0x55cfe7=_0x80f7('0x2d');break;}return _0x55cfe7;}function parseValue(_0x1005f5,_0x27ca5a,_0x2d05de){var _0x42af00={'start':undefined,'end':undefined};switch(_0x27ca5a){case _0x80f7('0x22'):case _0x80f7('0x1f'):_0x42af00['start']=_0x2d05de[_0x80f7('0x6')](',');break;case _0x80f7('0x2e'):_0x42af00['start']='%'+_0x2d05de+'%';break;case _0x80f7('0x28'):_0x42af00[_0x80f7('0x2f')]=_0x2d05de+'%';break;case _0x80f7('0x30'):_0x42af00[_0x80f7('0x2f')]='%'+_0x2d05de;break;case _0x80f7('0x11'):var _0x358f92=_0x2d05de[_0x80f7('0x6')](',');var _0x2d05de=_0x358f92['shift']();var _0x2c96cb=_0x358f92[_0x80f7('0x31')]();if(_0x1005f5===_0x80f7('0xf')){_0x2d05de=moment(_0x2d05de)['utcOffset'](0x0,!![])['format']();_0x2c96cb=moment(_0x2c96cb)[_0x80f7('0x32')](0x0,!![])[_0x80f7('0x14')](0x17,_0x80f7('0x33'))[_0x80f7('0x14')](0x3b,'minutes')['add'](0x3b,_0x80f7('0x34'))[_0x80f7('0x16')]();}_0x42af00={'start':_0x2d05de,'end':_0x2c96cb};break;default:_0x42af00[_0x80f7('0x2f')]=_0x2d05de;break;}return _0x42af00;}
\ No newline at end of file
+var _0xa8d8=['$in','NOT\x20IN\x20?','=\x20?','<>\x20?','$substring','$startsWith','$endsWith','$lt','>\x20?','<=\x20?','$gte','>=\x20?','start','pop','utcOffset','format','add','minutes','seconds','lodash','moment','sqlOperator','startsWith','and','[$and]','replace','[$or]','length','split','slice','shift','match','forEach','indexOf','map','conditions','DATE','$eq','operator','$between','value','includes','$gt','$lte','days','YYYY-MM-DD','castTo','text','CAST(','\x20AS\x20','$ne','$notIn','\x20OR\x20','field'];(function(_0x20fd05,_0x28be1c){var _0x3e474b=function(_0x3af475){while(--_0x3af475){_0x20fd05['push'](_0x20fd05['shift']());}};_0x3e474b(++_0x28be1c);}(_0xa8d8,0x7f));var _0x8a8d=function(_0x4934aa,_0x55d2a3){_0x4934aa=_0x4934aa-0x0;var _0x59dd38=_0xa8d8[_0x4934aa];return _0x59dd38;};'use strict';var _=require(_0x8a8d('0x0'));var moment=require(_0x8a8d('0x1'));exports['parseSearch']=function(_0x2e6558){var _0x99d764={'conditions':[]};_0x99d764[_0x8a8d('0x2')]=_[_0x8a8d('0x3')](_0x2e6558,'[$or]')?'or':_0x8a8d('0x4');var _0x2aea8a=_0x2e6558['replace'](_0x8a8d('0x5'),'')[_0x8a8d('0x6')](_0x8a8d('0x7'),'')['split']('||');for(var _0x24a96e=0x0;_0x24a96e<_0x2aea8a[_0x8a8d('0x8')];_0x24a96e++){var _0x3737d2=_0x2aea8a[_0x24a96e][_0x8a8d('0x9')](':=');var _0x78b801=_0x3737d2[0x0];var _0x2f4527=_0x3737d2[_0x8a8d('0xa')](0x1);_0x2f4527['forEach'](function(_0x4c9742){var _0x4b952b=_0x4c9742[_0x8a8d('0x9')]('[')[_0x8a8d('0xb')]();var _0x4da04f=_0x4c9742[_0x8a8d('0xc')](/\[(.*?)\]/g);_0x4da04f[_0x8a8d('0xd')](function(_0x50f746){var _0x3fe631=_0x50f746['split']('[')['filter'](function(_0x3b4100){return _0x3b4100[_0x8a8d('0xe')](']')>-0x1;})[_0x8a8d('0xf')](function(_0x5b3771){return _0x5b3771[_0x8a8d('0x9')](']')[0x0];})[0x0];_0x99d764[_0x8a8d('0x10')]['push']({'field':_0x78b801,'operator':_0x4b952b,'value':_0x3fe631});});});}return _0x99d764;};exports['buildExpression']=function(_0x44a777,_0xd0da67,_0x36c608){var _0x4b1c71={};if(_0xd0da67===_0x8a8d('0x11')){if(_0x36c608['operator']===_0x8a8d('0x12')){_0x36c608[_0x8a8d('0x13')]=_0x8a8d('0x14');_0x36c608[_0x8a8d('0x15')]+=','+_0x36c608[_0x8a8d('0x15')];}else if(_[_0x8a8d('0x16')]([_0x8a8d('0x17'),_0x8a8d('0x18')],_0x36c608[_0x8a8d('0x13')])){_0x36c608[_0x8a8d('0x15')]=moment(_0x36c608['value'])['add'](0x1,_0x8a8d('0x19'))['format'](_0x8a8d('0x1a'));}}if(_0x36c608[_0x8a8d('0x1b')]){_0xd0da67=_0x36c608[_0x8a8d('0x1b')];_0x4b1c71[_0x8a8d('0x1c')]=_0x8a8d('0x1d')+_0x44a777+'.'+_0x36c608['field']+_0x8a8d('0x1e')+_0x36c608[_0x8a8d('0x1b')]+')\x20'+parseOperator(_0x36c608[_0x8a8d('0x13')]);}else{_0x4b1c71[_0x8a8d('0x1c')]=_0x44a777+'.'+_0x36c608['field']+'\x20'+parseOperator(_0x36c608[_0x8a8d('0x13')]);}if(_[_0x8a8d('0x16')]([_0x8a8d('0x1f'),_0x8a8d('0x20')],_0x36c608['operator']))_0x4b1c71[_0x8a8d('0x1c')]='('+_0x4b1c71['text']+_0x8a8d('0x21')+_0x44a777+'.'+_0x36c608[_0x8a8d('0x22')]+'\x20IS\x20NULL)';_0x4b1c71['value']=parseValue(_0xd0da67,_0x36c608['operator'],_0x36c608['value']);return _0x4b1c71;};function parseOperator(_0xf8fdd9){var _0x36d0f9;switch(_0xf8fdd9){case _0x8a8d('0x23'):_0x36d0f9='IN\x20?';break;case _0x8a8d('0x20'):_0x36d0f9=_0x8a8d('0x24');break;case _0x8a8d('0x12'):_0x36d0f9=_0x8a8d('0x25');break;case'$ne':_0x36d0f9=_0x8a8d('0x26');break;case _0x8a8d('0x27'):case _0x8a8d('0x28'):case _0x8a8d('0x29'):_0x36d0f9='LIKE\x20?';break;case _0x8a8d('0x2a'):_0x36d0f9='<\x20?';break;case _0x8a8d('0x17'):_0x36d0f9=_0x8a8d('0x2b');break;case _0x8a8d('0x18'):_0x36d0f9=_0x8a8d('0x2c');break;case _0x8a8d('0x2d'):_0x36d0f9=_0x8a8d('0x2e');break;case _0x8a8d('0x14'):_0x36d0f9='BETWEEN\x20?\x20AND\x20?';break;}return _0x36d0f9;}function parseValue(_0x3e109e,_0x53824c,_0x1731a7){var _0x393ba9={'start':undefined,'end':undefined};switch(_0x53824c){case _0x8a8d('0x23'):case'$notIn':_0x393ba9[_0x8a8d('0x2f')]=_0x1731a7[_0x8a8d('0x9')](',');break;case'$substring':_0x393ba9[_0x8a8d('0x2f')]='%'+_0x1731a7+'%';break;case'$startsWith':_0x393ba9[_0x8a8d('0x2f')]=_0x1731a7+'%';break;case _0x8a8d('0x29'):_0x393ba9[_0x8a8d('0x2f')]='%'+_0x1731a7;break;case _0x8a8d('0x14'):var _0x2e6b22=_0x1731a7['split'](',');var _0x1731a7=_0x2e6b22[_0x8a8d('0xb')]();var _0x56cd02=_0x2e6b22[_0x8a8d('0x30')]();if(_0x3e109e===_0x8a8d('0x11')){_0x1731a7=moment(_0x1731a7)[_0x8a8d('0x31')](0x0,!![])[_0x8a8d('0x32')]();_0x56cd02=moment(_0x56cd02)[_0x8a8d('0x31')](0x0,!![])[_0x8a8d('0x33')](0x17,'hours')[_0x8a8d('0x33')](0x3b,_0x8a8d('0x34'))[_0x8a8d('0x33')](0x3b,_0x8a8d('0x35'))[_0x8a8d('0x32')]();}_0x393ba9={'start':_0x1731a7,'end':_0x56cd02};break;default:_0x393ba9[_0x8a8d('0x2f')]=_0x1731a7;break;}return _0x393ba9;}
\ No newline at end of file
diff --git a/server/components/parsers/qs.js b/server/components/parsers/qs.js
index c2a4242..9213042 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 _0x9f9b=['indexOf','cast','col','priority','unsigned','substr','ASC','length','omit','isObject','isString','hasOwnProperty','isNumeric','^[0-9]*$','match','forEach','push','toString','join','sequelize','fields','split','filters','isEmpty','forOwn','isArray','parse','offset','sort','map'];(function(_0x33fab6,_0x532a04){var _0x314e60=function(_0x56e5d6){while(--_0x56e5d6){_0x33fab6['push'](_0x33fab6['shift']());}};_0x314e60(++_0x532a04);}(_0x9f9b,0x15d));var _0xb9f9=function(_0x5bc24f,_0x1ff138){_0x5bc24f=_0x5bc24f-0x0;var _0x23e1fe=_0x9f9b[_0x5bc24f];return _0x23e1fe;};'use strict';var _=require('lodash');var sequelize=require(_0xb9f9('0x0'));var LIMIT_VALUE=0xfa;exports[_0xb9f9('0x1')]=function(_0x435b03){var _0x51333d=null;if(_0x435b03){_0x51333d=_0x435b03[_0xb9f9('0x2')](',');}return _0x51333d;};exports[_0xb9f9('0x3')]=function(_0x15b6ae){var _0x5bcdec={};if(!_[_0xb9f9('0x4')](_0x15b6ae)){_0x5bcdec={};_[_0xb9f9('0x5')](_0x15b6ae,function(_0x4bedf4,_0x16dbd6){try{_0x5bcdec[_0x16dbd6]=_[_0xb9f9('0x6')](_0x4bedf4)?_0x4bedf4:JSON[_0xb9f9('0x7')](_0x4bedf4);}catch(_0x518642){_0x5bcdec[_0x16dbd6]=_0x4bedf4['split'](',');}});}return _0x5bcdec;};exports['limit']=function(_0x517cd9){_0x517cd9=parseInt(_0x517cd9,0xa);if(!_0x517cd9||_0x517cd9<0x0){_0x517cd9=LIMIT_VALUE;}return _0x517cd9;};exports[_0xb9f9('0x8')]=function(_0x1866c4){_0x1866c4=parseInt(_0x1866c4,0xa);if(!_0x1866c4||_0x1866c4<0x0){_0x1866c4=0x0;}return _0x1866c4;};exports[_0xb9f9('0x9')]=function(_0x264b94){var _0x4622db,_0x4b3b82=null;if(_0x264b94){_0x4622db=_0x264b94['split'](',');_0x4b3b82=_[_0xb9f9('0xa')](_0x4622db,function(_0x14940e){if(_0x14940e[_0xb9f9('0xb')]('-')===0x0){return[_0x14940e==='priority'?sequelize[_0xb9f9('0xc')](sequelize[_0xb9f9('0xd')](_0xb9f9('0xe')),_0xb9f9('0xf')):_0x14940e[_0xb9f9('0x10')](0x1),'DESC'];}else{return[_0x14940e===_0xb9f9('0xe')?sequelize[_0xb9f9('0xc')](sequelize[_0xb9f9('0xd')](_0xb9f9('0xe')),_0xb9f9('0xf')):_0x14940e,_0xb9f9('0x11')];}});}return _0x4b3b82;};exports['omit']=function(_0x40de64,_0x2b8874){if(_[_0xb9f9('0x4')](_0x40de64)){return _0x40de64;}if(_['isArray'](_0x40de64)){for(var _0x387d84=0x0;_0x387d84<_0x40de64[_0xb9f9('0x12')];_0x387d84+=0x1){_0x40de64[_0x387d84]=this[_0xb9f9('0x13')](_0x40de64[_0x387d84],_0x2b8874);}return _0x40de64;}if(!_[_0xb9f9('0x14')](_0x40de64)){return _0x40de64;}if(_[_0xb9f9('0x15')](_0x2b8874)){_0x2b8874=[_0x2b8874];}if(!_['isArray'](_0x2b8874)){return _0x40de64;}for(var _0x53127e=0x0;_0x53127e<_0x2b8874[_0xb9f9('0x12')];_0x53127e+=0x1){_['unset'](_0x40de64,_0x2b8874[_0x53127e]);}for(var _0x2864fc in _0x40de64){if(_0x40de64[_0xb9f9('0x16')](_0x2864fc)){_0x40de64[_0x2864fc]=this['omit'](_0x40de64[_0x2864fc],_0x2b8874);}}return _0x40de64;};exports[_0xb9f9('0x17')]=function(_0x54247c){return _0x54247c['match'](RegExp(_0xb9f9('0x18')))?!![]:![];};exports['isEmail']=function(_0x587e4d){return _0x587e4d[_0xb9f9('0x19')](/^\S+@\S+$/)?!![]:![];};exports['getFullTextValue']=function(_0x55328c){var _0x3dd3f8=[];_0x55328c[_0xb9f9('0x2')]('\x20')[_0xb9f9('0x1a')](function(_0x701435){_0x3dd3f8[_0xb9f9('0x1b')]('+'+_0x701435[_0xb9f9('0x1c')]()+'*');});return _0x3dd3f8[_0xb9f9('0x1d')]('\x20');};
\ No newline at end of file
+var _0x7d9c=['sort','map','indexOf','priority','col','unsigned','DESC','cast','ASC','omit','length','isString','hasOwnProperty','match','^[0-9]*$','isEmail','forEach','push','toString','lodash','split','filters','isEmpty','isArray','parse','limit','offset'];(function(_0x4f0f76,_0x421046){var _0x243d18=function(_0x3c3a8d){while(--_0x3c3a8d){_0x4f0f76['push'](_0x4f0f76['shift']());}};_0x243d18(++_0x421046);}(_0x7d9c,0x13c));var _0xc7d9=function(_0x15063b,_0x157045){_0x15063b=_0x15063b-0x0;var _0x381de5=_0x7d9c[_0x15063b];return _0x381de5;};'use strict';var _=require(_0xc7d9('0x0'));var sequelize=require('sequelize');var LIMIT_VALUE=0xfa;exports['fields']=function(_0x4a7bc4){var _0x562a94=null;if(_0x4a7bc4){_0x562a94=_0x4a7bc4[_0xc7d9('0x1')](',');}return _0x562a94;};exports[_0xc7d9('0x2')]=function(_0x241878){var _0x178983={};if(!_[_0xc7d9('0x3')](_0x241878)){_0x178983={};_['forOwn'](_0x241878,function(_0x1680d6,_0x45ab3c){try{_0x178983[_0x45ab3c]=_[_0xc7d9('0x4')](_0x1680d6)?_0x1680d6:JSON[_0xc7d9('0x5')](_0x1680d6);}catch(_0x34db03){_0x178983[_0x45ab3c]=_0x1680d6['split'](',');}});}return _0x178983;};exports[_0xc7d9('0x6')]=function(_0x8e800d){_0x8e800d=parseInt(_0x8e800d,0xa);if(!_0x8e800d||_0x8e800d<0x0){_0x8e800d=LIMIT_VALUE;}return _0x8e800d;};exports[_0xc7d9('0x7')]=function(_0xa8c8d5){_0xa8c8d5=parseInt(_0xa8c8d5,0xa);if(!_0xa8c8d5||_0xa8c8d5<0x0){_0xa8c8d5=0x0;}return _0xa8c8d5;};exports[_0xc7d9('0x8')]=function(_0x5eb907){var _0x3387f8,_0x9cf69b=null;if(_0x5eb907){_0x3387f8=_0x5eb907[_0xc7d9('0x1')](',');_0x9cf69b=_[_0xc7d9('0x9')](_0x3387f8,function(_0x2ea84b){if(_0x2ea84b[_0xc7d9('0xa')]('-')===0x0){return[_0x2ea84b===_0xc7d9('0xb')?sequelize['cast'](sequelize[_0xc7d9('0xc')](_0xc7d9('0xb')),_0xc7d9('0xd')):_0x2ea84b['substr'](0x1),_0xc7d9('0xe')];}else{return[_0x2ea84b===_0xc7d9('0xb')?sequelize[_0xc7d9('0xf')](sequelize[_0xc7d9('0xc')](_0xc7d9('0xb')),_0xc7d9('0xd')):_0x2ea84b,_0xc7d9('0x10')];}});}return _0x9cf69b;};exports[_0xc7d9('0x11')]=function(_0xa6685e,_0x248634){if(_[_0xc7d9('0x3')](_0xa6685e)){return _0xa6685e;}if(_[_0xc7d9('0x4')](_0xa6685e)){for(var _0x1ad8ea=0x0;_0x1ad8ea<_0xa6685e[_0xc7d9('0x12')];_0x1ad8ea+=0x1){_0xa6685e[_0x1ad8ea]=this[_0xc7d9('0x11')](_0xa6685e[_0x1ad8ea],_0x248634);}return _0xa6685e;}if(!_['isObject'](_0xa6685e)){return _0xa6685e;}if(_[_0xc7d9('0x13')](_0x248634)){_0x248634=[_0x248634];}if(!_[_0xc7d9('0x4')](_0x248634)){return _0xa6685e;}for(var _0x58ec22=0x0;_0x58ec22<_0x248634[_0xc7d9('0x12')];_0x58ec22+=0x1){_['unset'](_0xa6685e,_0x248634[_0x58ec22]);}for(var _0x3aa1ed in _0xa6685e){if(_0xa6685e[_0xc7d9('0x14')](_0x3aa1ed)){_0xa6685e[_0x3aa1ed]=this['omit'](_0xa6685e[_0x3aa1ed],_0x248634);}}return _0xa6685e;};exports['isNumeric']=function(_0x3e1a52){return _0x3e1a52[_0xc7d9('0x15')](RegExp(_0xc7d9('0x16')))?!![]:![];};exports[_0xc7d9('0x17')]=function(_0x2186b0){return _0x2186b0[_0xc7d9('0x15')](/^\S+@\S+$/)?!![]:![];};exports['getFullTextValue']=function(_0x3f9e1f){var _0x66c368=[];_0x3f9e1f[_0xc7d9('0x1')]('\x20')[_0xc7d9('0x18')](function(_0x2e9d8b){_0x66c368[_0xc7d9('0x19')]('+'+_0x2e9d8b[_0xc7d9('0x1a')]()+'*');});return _0x66c368['join']('\x20');};
\ No newline at end of file
diff --git a/server/config/express.js b/server/config/express.js
index 3f5963d..849da88 100644
--- a/server/config/express.js
+++ b/server/config/express.js
@@ -15,4 +15,4 @@
// * treaties. The SOFTWARE PRODUCT is licensed, not sold. *
// * *
// *************************************************************************
-var _0xcf8b=['development','client','use','json\x20replacer','split','/server/views','engine','html','ejs','view\x20engine','urlencoded','50mb','json','initialize','serve-favicon','body-parser','method-override','cookie-parser','errorhandler','passport','cors','moment','./environment','../mysqldb','default','get','env','production','set','appPath','join','root'];(function(_0x5b9cf3,_0x3ec786){var _0xbbdae7=function(_0x465ddb){while(--_0x465ddb){_0x5b9cf3['push'](_0x5b9cf3['shift']());}};_0xbbdae7(++_0x3ec786);}(_0xcf8b,0x1ae));var _0xbcf8=function(_0x3dd15e,_0x1f0015){_0x3dd15e=_0x3dd15e-0x0;var _0x231fd0=_0xcf8b[_0x3dd15e];return _0x231fd0;};'use strict';var express=require('express');var favicon=require(_0xbcf8('0x0'));var bodyParser=require(_0xbcf8('0x1'));var methodOverride=require(_0xbcf8('0x2'));var cookieParser=require(_0xbcf8('0x3'));var errorHandler=require(_0xbcf8('0x4'));var path=require('path');var passport=require(_0xbcf8('0x5'));var cors=require(_0xbcf8('0x6'));var moment=require(_0xbcf8('0x7'));var config=require(_0xbcf8('0x8'));var db=require(_0xbcf8('0x9'))['db'];exports[_0xbcf8('0xa')]=function(_0x5c4895){var _0x356cae=_0x5c4895[_0xbcf8('0xb')](_0xbcf8('0xc'));if(_0x356cae===_0xbcf8('0xd')){_0x5c4895[_0xbcf8('0xe')](_0xbcf8('0xf'),path[_0xbcf8('0x10')](config[_0xbcf8('0x11')],'public'));}if(_0x356cae===_0xbcf8('0x12')||_0x356cae==='test'){_0x5c4895[_0xbcf8('0xe')](_0xbcf8('0xf'),path['join'](config[_0xbcf8('0x11')],_0xbcf8('0x13')));_0x5c4895[_0xbcf8('0x14')](errorHandler());}_0x5c4895[_0xbcf8('0xe')](_0xbcf8('0x15'),function(_0x103616,_0x5a1c6c){if(this[_0x103616]instanceof Date){_0x5a1c6c=this[_0x103616]['toISOString']()[_0xbcf8('0x16')]('.')[0x0]+'Z';}return _0x5a1c6c;});_0x5c4895[_0xbcf8('0x14')](express['static'](_0x5c4895['get'](_0xbcf8('0xf'))));_0x5c4895['set']('views',config[_0xbcf8('0x11')]+_0xbcf8('0x17'));_0x5c4895[_0xbcf8('0x18')](_0xbcf8('0x19'),require(_0xbcf8('0x1a'))['renderFile']);_0x5c4895['set'](_0xbcf8('0x1b'),'html');_0x5c4895['use'](bodyParser[_0xbcf8('0x1c')]({'limit':_0xbcf8('0x1d'),'extended':!![]}));_0x5c4895['use'](bodyParser[_0xbcf8('0x1e')]({'limit':_0xbcf8('0x1d')}));_0x5c4895[_0xbcf8('0x14')](cors());_0x5c4895[_0xbcf8('0x14')](methodOverride());_0x5c4895[_0xbcf8('0x14')](cookieParser());_0x5c4895[_0xbcf8('0x14')](passport[_0xbcf8('0x1f')]());};
\ No newline at end of file
+var _0x4228=['appPath','join','root','public','development','test','client','json\x20replacer','toISOString','split','use','static','views','html','ejs','view\x20engine','urlencoded','json','50mb','express','serve-favicon','body-parser','method-override','cookie-parser','errorhandler','path','passport','cors','moment','./environment','default','get','env','production','set'];(function(_0x5eebe0,_0x13e01d){var _0x3c07e1=function(_0x2266c8){while(--_0x2266c8){_0x5eebe0['push'](_0x5eebe0['shift']());}};_0x3c07e1(++_0x13e01d);}(_0x4228,0x194));var _0x8422=function(_0x3dd15e,_0x1f0015){_0x3dd15e=_0x3dd15e-0x0;var _0x231fd0=_0x4228[_0x3dd15e];return _0x231fd0;};'use strict';var express=require(_0x8422('0x0'));var favicon=require(_0x8422('0x1'));var bodyParser=require(_0x8422('0x2'));var methodOverride=require(_0x8422('0x3'));var cookieParser=require(_0x8422('0x4'));var errorHandler=require(_0x8422('0x5'));var path=require(_0x8422('0x6'));var passport=require(_0x8422('0x7'));var cors=require(_0x8422('0x8'));var moment=require(_0x8422('0x9'));var config=require(_0x8422('0xa'));var db=require('../mysqldb')['db'];exports[_0x8422('0xb')]=function(_0x10e13f){var _0x2174fa=_0x10e13f[_0x8422('0xc')](_0x8422('0xd'));if(_0x2174fa===_0x8422('0xe')){_0x10e13f[_0x8422('0xf')](_0x8422('0x10'),path[_0x8422('0x11')](config[_0x8422('0x12')],_0x8422('0x13')));}if(_0x2174fa===_0x8422('0x14')||_0x2174fa===_0x8422('0x15')){_0x10e13f[_0x8422('0xf')]('appPath',path['join'](config[_0x8422('0x12')],_0x8422('0x16')));_0x10e13f['use'](errorHandler());}_0x10e13f[_0x8422('0xf')](_0x8422('0x17'),function(_0x1fc471,_0x52655a){if(this[_0x1fc471]instanceof Date){_0x52655a=this[_0x1fc471][_0x8422('0x18')]()[_0x8422('0x19')]('.')[0x0]+'Z';}return _0x52655a;});_0x10e13f[_0x8422('0x1a')](express[_0x8422('0x1b')](_0x10e13f[_0x8422('0xc')]('appPath')));_0x10e13f[_0x8422('0xf')](_0x8422('0x1c'),config[_0x8422('0x12')]+'/server/views');_0x10e13f['engine'](_0x8422('0x1d'),require(_0x8422('0x1e'))['renderFile']);_0x10e13f[_0x8422('0xf')](_0x8422('0x1f'),_0x8422('0x1d'));_0x10e13f[_0x8422('0x1a')](bodyParser[_0x8422('0x20')]({'limit':'50mb','extended':!![]}));_0x10e13f['use'](bodyParser[_0x8422('0x21')]({'limit':_0x8422('0x22')}));_0x10e13f[_0x8422('0x1a')](cors());_0x10e13f[_0x8422('0x1a')](methodOverride());_0x10e13f[_0x8422('0x1a')](cookieParser());_0x10e13f[_0x8422('0x1a')](passport['initialize']());};
\ No newline at end of file
diff --git a/server/config/license/hardware.js b/server/config/license/hardware.js
index de8da0c..6e01b0a 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 _0x1561=['orderBy','keys','family','IPv4','internal','concat','head','00:00:00:00:00:00','address','127.0.0.1','cpus','map','join','md5','update','getUuid','platform','win32','replace','hostname','macAddress','ipAddress','createHash','hex','substring','bimedia-machine-uuid','child_process','execSync'];(function(_0x40ac5e,_0x2de228){var _0x2839d6=function(_0x123d47){while(--_0x123d47){_0x40ac5e['push'](_0x40ac5e['shift']());}};_0x2839d6(++_0x2de228);}(_0x1561,0x1bd));var _0x1156=function(_0x3641a1,_0x3ee2a4){_0x3641a1=_0x3641a1-0x0;var _0x5d1066=_0x1561[_0x3641a1];return _0x5d1066;};'use strict';var _=require('lodash');var os=require('os');var crypto=require('crypto');var machine=require(_0x1156('0x0'));var exec=require(_0x1156('0x1'))[_0x1156('0x2')];function getInterfaces(){var _0x1ce4ca=[];var _0x1f66f7=os['networkInterfaces']();var _0x1be639=_[_0x1156('0x3')](_[_0x1156('0x4')](_0x1f66f7));for(var _0x161b74=0x0;_0x161b74<_0x1be639['length'];_0x161b74++){var _0xb0dab7=_0x1f66f7[_0x1be639[_0x161b74]]['filter'](function(_0x372fe0){return _0x372fe0[_0x1156('0x5')]===_0x1156('0x6')&&_0x372fe0[_0x1156('0x7')]===![];});_0x1ce4ca=_0x1ce4ca[_0x1156('0x8')](_0xb0dab7);}return _0x1ce4ca;}function getFirstInterface(){var _0x564b49=_[_0x1156('0x9')](getInterfaces());return{'macAddress':_0x564b49&&_0x564b49['mac']?_0x564b49['mac']:_0x1156('0xa'),'ipAddress':_0x564b49&&_0x564b49[_0x1156('0xb')]?_0x564b49['address']:_0x1156('0xc')};}exports['getFirstInterface']=getFirstInterface;function getCPUhash(){var _0x340673=_['orderBy'](os[_0x1156('0xd')]()[_0x1156('0xe')](function(_0x505c89){return _0x505c89['model'];}))[_0x1156('0xf')](':');return crypto['createHash'](_0x1156('0x10'))[_0x1156('0x11')](_0x340673)['digest']('hex');}exports[_0x1156('0x12')]=function(){switch(os[_0x1156('0x13')]()){case _0x1156('0x14'):return exec('dmidecode\x20--string\x20system-uuid',{'encoding':'utf8'})[_0x1156('0x15')]('\x0d\x0a','');default:var _0x236d32=getFirstInterface();var _0x3c244d=getCPUhash();var _0x399417=_0x3c244d+'|'+os[_0x1156('0x16')]()+'|'+_0x236d32[_0x1156('0x17')]+'|'+_0x236d32[_0x1156('0x18')];var _0x6dd20=crypto[_0x1156('0x19')](_0x1156('0x10'))[_0x1156('0x11')](_0x399417)['digest'](_0x1156('0x1a'));return _0x6dd20[_0x1156('0x1b')](0x0,0x8)+'-'+_0x6dd20[_0x1156('0x1b')](0x8,0xc)+'-'+_0x6dd20['substring'](0xc,0x10)+'-'+_0x6dd20[_0x1156('0x1b')](0x10,0x14)+'-'+_0x6dd20[_0x1156('0x1b')](0x14);}};
\ No newline at end of file
+var _0xd67b=['getUuid','platform','win32','dmidecode\x20--string\x20system-uuid','utf8','replace','macAddress','ipAddress','update','substring','crypto','child_process','execSync','networkInterfaces','orderBy','length','filter','family','IPv4','internal','concat','head','mac','address','getFirstInterface','cpus','map','model','join','createHash','md5','digest','hex'];(function(_0x5c8a11,_0x10805f){var _0x116b22=function(_0x10a697){while(--_0x10a697){_0x5c8a11['push'](_0x5c8a11['shift']());}};_0x116b22(++_0x10805f);}(_0xd67b,0x133));var _0xbd67=function(_0x46252a,_0x37c865){_0x46252a=_0x46252a-0x0;var _0x410388=_0xd67b[_0x46252a];return _0x410388;};'use strict';var _=require('lodash');var os=require('os');var crypto=require(_0xbd67('0x0'));var machine=require('bimedia-machine-uuid');var exec=require(_0xbd67('0x1'))[_0xbd67('0x2')];function getInterfaces(){var _0x317e33=[];var _0x5e967b=os[_0xbd67('0x3')]();var _0x50da5a=_[_0xbd67('0x4')](_['keys'](_0x5e967b));for(var _0x309962=0x0;_0x309962<_0x50da5a[_0xbd67('0x5')];_0x309962++){var _0x2ad142=_0x5e967b[_0x50da5a[_0x309962]][_0xbd67('0x6')](function(_0x1860c9){return _0x1860c9[_0xbd67('0x7')]===_0xbd67('0x8')&&_0x1860c9[_0xbd67('0x9')]===![];});_0x317e33=_0x317e33[_0xbd67('0xa')](_0x2ad142);}return _0x317e33;}function getFirstInterface(){var _0x461231=_[_0xbd67('0xb')](getInterfaces());return{'macAddress':_0x461231&&_0x461231[_0xbd67('0xc')]?_0x461231[_0xbd67('0xc')]:'00:00:00:00:00:00','ipAddress':_0x461231&&_0x461231['address']?_0x461231[_0xbd67('0xd')]:'127.0.0.1'};}exports[_0xbd67('0xe')]=getFirstInterface;function getCPUhash(){var _0xb6b4b5=_[_0xbd67('0x4')](os[_0xbd67('0xf')]()[_0xbd67('0x10')](function(_0xb05237){return _0xb05237[_0xbd67('0x11')];}))[_0xbd67('0x12')](':');return crypto[_0xbd67('0x13')](_0xbd67('0x14'))['update'](_0xb6b4b5)[_0xbd67('0x15')](_0xbd67('0x16'));}exports[_0xbd67('0x17')]=function(){switch(os[_0xbd67('0x18')]()){case _0xbd67('0x19'):return exec(_0xbd67('0x1a'),{'encoding':_0xbd67('0x1b')})[_0xbd67('0x1c')]('\x0d\x0a','');default:var _0xa45c76=getFirstInterface();var _0x140df9=getCPUhash();var _0x591de9=_0x140df9+'|'+os['hostname']()+'|'+_0xa45c76[_0xbd67('0x1d')]+'|'+_0xa45c76[_0xbd67('0x1e')];var _0xff31b=crypto['createHash'](_0xbd67('0x14'))[_0xbd67('0x1f')](_0x591de9)[_0xbd67('0x15')]('hex');return _0xff31b[_0xbd67('0x20')](0x0,0x8)+'-'+_0xff31b['substring'](0x8,0xc)+'-'+_0xff31b[_0xbd67('0x20')](0xc,0x10)+'-'+_0xff31b[_0xbd67('0x20')](0x10,0x14)+'-'+_0xff31b[_0xbd67('0x20')](0x14);}};
\ No newline at end of file
diff --git a/server/config/license/index.js b/server/config/license/index.js
index 3dcd234..c920b38 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 _0x6d0c=['Motion\x20License\x20Alert','Alert','get','license','info','THE\x20LICENSE\x20HAS\x20BEEN\x20ENABLED','data2','THE\x20LICENSE\x20HAS\x20BEEN\x20UPDATED','data1','THE\x20LICENSE\x20HAS\x20BEEN\x20DISABLED','Changed','NEW\x20UUID\x20DETECTED:\x20FROM\x20%s\x20TO\x20%s','uuid','toUpperCase','YYYY-MM-DD\x20HH:mm','days','getUuid','spread','SERVICE\x20LICENSE\x20STARTED\x20%s','error','message','default','util','crypto','moment','request-promise','bluebird','pkginfo','../../mysqldb','../logger','https://www.xcallymotion.com','format','%s/api/servers/%s/check?version=%s','exports','version','%s/api/servers/%s/check?version=%s&oldtoken=%s','GET','then','catch','createCipher','aes-256-ctr','session','update','final','base64','createDecipher','secrets','||FIELD||VALUE||\x0a','admin','fullname','email','|reason|','|uuid|','|machineUuid|','|email|','getFirstInterface','ipAddress','openIssue','MOTLICENSE'];(function(_0x28076b,_0x2d0259){var _0x2f61e7=function(_0x239b23){while(--_0x239b23){_0x28076b['push'](_0x28076b['shift']());}};_0x2f61e7(++_0x2d0259);}(_0x6d0c,0x8c));var _0xc6d0=function(_0x3173f2,_0x5d4f2f){_0x3173f2=_0x3173f2-0x0;var _0x488bb6=_0x6d0c[_0x3173f2];return _0x488bb6;};'use strict';var util=require(_0xc6d0('0x0'));var crypto=require(_0xc6d0('0x1'));var moment=require(_0xc6d0('0x2'));var rp=require(_0xc6d0('0x3'));var BPromise=require(_0xc6d0('0x4'));var pkginfo=require(_0xc6d0('0x5'))(module,'version');var db=require(_0xc6d0('0x6'))['db'];var config=require('../environment');var hardware=require('./hardware');var logger=require(_0xc6d0('0x7'))('license');var jira=require('../../api/jira/jira.controller');var HOST=_0xc6d0('0x8');var TIME=0x3c*0x1388;var DAYS=0x7;var GRAY_PERIOD_REASON;var ADMIN;var oldToken;function httpRequest(_0x40ba33){return new BPromise(function(_0xf1bb4f,_0x39e8be){var _0xbd2213=util[_0xc6d0('0x9')](_0xc6d0('0xa'),HOST,_0x40ba33,module[_0xc6d0('0xb')][_0xc6d0('0xc')]);if(oldToken){_0xbd2213=util[_0xc6d0('0x9')](_0xc6d0('0xd'),HOST,_0x40ba33,module[_0xc6d0('0xb')][_0xc6d0('0xc')],oldToken);}var _0x395085={'uri':_0xbd2213,'method':_0xc6d0('0xe'),'timeout':0xea60,'json':!![]};return rp(_0x395085)[_0xc6d0('0xf')](function(_0x12f0db){_0xf1bb4f(_0x12f0db);})[_0xc6d0('0x10')](function(_0x13ea49){_0x39e8be(_0x13ea49);});});}function encryptDate(_0x510cda){var _0x562ae9=crypto[_0xc6d0('0x11')](_0xc6d0('0x12'),config['secrets'][_0xc6d0('0x13')]);var _0xf5984d=_0x562ae9[_0xc6d0('0x14')](_0x510cda,'utf8','base64');_0xf5984d+=_0x562ae9[_0xc6d0('0x15')](_0xc6d0('0x16'));return _0xf5984d;}function decryptDate(_0x17afb5){var _0x501260=crypto[_0xc6d0('0x17')]('aes-256-ctr',config[_0xc6d0('0x18')][_0xc6d0('0x13')]);var _0x34ea2f=_0x501260[_0xc6d0('0x14')](_0x17afb5,_0xc6d0('0x16'),'utf8');_0x34ea2f+=_0x501260['final']('utf8');return _0x34ea2f;}function sendJiraAlert(_0x1fa160,_0x375642,_0x1dd9e8){var _0x4bb6d1=_0xc6d0('0x19');return db['User']['findOne']({'where':{'role':_0xc6d0('0x1a')},'attributes':[_0xc6d0('0x1b'),_0xc6d0('0x1c')],'raw':!![]})[_0xc6d0('0xf')](function(_0x3ffa8f){ADMIN=_0x3ffa8f;_0x4bb6d1+=_0xc6d0('0x1d')+_0x1dd9e8+'|\x0a';_0x4bb6d1+=_0xc6d0('0x1e')+_0x1fa160+'|\x0a';_0x4bb6d1+=_0xc6d0('0x1f')+_0x375642+'|\x0a';_0x4bb6d1+='|name|'+ADMIN[_0xc6d0('0x1b')]+'|\x0a';_0x4bb6d1+=_0xc6d0('0x20')+ADMIN[_0xc6d0('0x1c')]+'|\x0a';return _0x4bb6d1;})[_0xc6d0('0xf')](function(_0x4b48f3){var _0x5e7a68=hardware[_0xc6d0('0x21')]()[_0xc6d0('0x22')];return jira[_0xc6d0('0x23')]({'key':_0xc6d0('0x24'),'summary':_0xc6d0('0x25'),'description':_0x4b48f3,'issuetype':_0xc6d0('0x26'),'oldToken':_0x1fa160,'newToken':_0x375642,'email':ADMIN[_0xc6d0('0x1c')],'name':ADMIN[_0xc6d0('0x1b')],'reason':GRAY_PERIOD_REASON,'ip':_0x5e7a68});});}function manageLicense(_0x420cf4,_0x2b95ba){var _0x345c58=_0x2b95ba[_0xc6d0('0x27')]({'plain':!![]});httpRequest(_0x420cf4)[_0xc6d0('0xf')](function(_0x56ccc3){if(oldToken){oldToken=undefined;}if(_0x56ccc3['active']){if(!_0x345c58[_0xc6d0('0x28')]&&_0x345c58[_0xc6d0('0x28')]!=_0x56ccc3[_0xc6d0('0x28')]||_0x345c58[_0xc6d0('0x28')]&&_0x345c58['data2']){logger[_0xc6d0('0x29')](_0xc6d0('0x2a'));}if(_0x345c58[_0xc6d0('0x28')]&&!_0x345c58[_0xc6d0('0x2b')]&&_0x345c58[_0xc6d0('0x28')]!=_0x56ccc3['license']){logger[_0xc6d0('0x29')](_0xc6d0('0x2c'));}if(_0x345c58[_0xc6d0('0x28')]&&!_0x345c58[_0xc6d0('0x2b')]&&_0x345c58[_0xc6d0('0x28')]==_0x56ccc3[_0xc6d0('0x28')]){return _0x2b95ba;}return _0x2b95ba['update']({'data1':_0x420cf4,'data2':null,'license':_0x56ccc3[_0xc6d0('0x28')]});}else{if(_0x56ccc3[_0xc6d0('0x28')]||_0x345c58[_0xc6d0('0x28')]){if(!_0x345c58[_0xc6d0('0x2b')]){if(_0x345c58[_0xc6d0('0x2d')]==_0x420cf4){GRAY_PERIOD_REASON='Disabled';logger['info'](_0xc6d0('0x2e'));}else{GRAY_PERIOD_REASON=_0xc6d0('0x2f');oldToken=_0x345c58['data1'];logger[_0xc6d0('0x29')](_0xc6d0('0x30'),_0x345c58[_0xc6d0('0x2d')],_0x420cf4);}sendJiraAlert(_0x345c58[_0xc6d0('0x2d')],_0x56ccc3[_0xc6d0('0x31')],GRAY_PERIOD_REASON);logger[_0xc6d0('0x29')]('%s\x20-\x20GRAY\x20PERIOD\x20STARTED\x20AT\x20%s',GRAY_PERIOD_REASON[_0xc6d0('0x32')](),moment()['format']('YYYY-MM-DD\x20HH:mm'));return _0x2b95ba[_0xc6d0('0x14')]({'data2':encryptDate(moment()[_0xc6d0('0x9')](_0xc6d0('0x33')))});}else{if(moment()['diff'](decryptDate(_0x345c58['data2']),_0xc6d0('0x34'))>DAYS){logger[_0xc6d0('0x29')]('DEMO\x20START\x20AT\x20%s',moment()['format'](_0xc6d0('0x33')));return _0x2b95ba[_0xc6d0('0x14')]({'data1':_0x420cf4,'data2':null,'license':null});}}}else{if(_0x345c58['data1']!=_0x420cf4){logger[_0xc6d0('0x29')](_0xc6d0('0x30'),_0x345c58[_0xc6d0('0x2d')],_0x420cf4);return _0x2b95ba['update']({'data1':_0x420cf4,'data2':null,'license':null});}}}return _0x2b95ba;})['then'](function(_0x274de3){_0x2b95ba=_0x274de3;})[_0xc6d0('0x10')](function(_0x374037){logger['error'](_0x374037['message']);})['finally'](function(){setTimeout(function(){manageLicense(hardware[_0xc6d0('0x35')](),_0x2b95ba);},TIME);});}function defaultLicense(){var _0x22b31f=hardware[_0xc6d0('0x35')]();if(_0x22b31f){return db['License']['findOrCreate']({'where':{'id':0x1},'defaults':{'data1':_0x22b31f}})[_0xc6d0('0x36')](function(_0x69d9dd,_0xcd19fa){logger['info'](_0xc6d0('0x37'),_0x22b31f);manageLicense(_0x22b31f,_0x69d9dd);})[_0xc6d0('0x10')](function(_0x552126){logger[_0xc6d0('0x38')](_0x552126[_0xc6d0('0x39')]);});}}exports[_0xc6d0('0x3a')]=defaultLicense;
\ No newline at end of file
+var _0xb6a6=['exports','%s/api/servers/%s/check?version=%s&oldtoken=%s','GET','then','createCipher','aes-256-ctr','session','utf8','base64','final','createDecipher','secrets','update','||FIELD||VALUE||\x0a','User','findOne','admin','fullname','email','|reason|','|name|','|email|','getFirstInterface','ipAddress','openIssue','get','data2','THE\x20LICENSE\x20HAS\x20BEEN\x20ENABLED','info','THE\x20LICENSE\x20HAS\x20BEEN\x20UPDATED','data1','Disabled','THE\x20LICENSE\x20HAS\x20BEEN\x20DISABLED','Changed','NEW\x20UUID\x20DETECTED:\x20FROM\x20%s\x20TO\x20%s','%s\x20-\x20GRAY\x20PERIOD\x20STARTED\x20AT\x20%s','toUpperCase','YYYY-MM-DD\x20HH:mm','diff','DEMO\x20START\x20AT\x20%s','catch','error','message','finally','getUuid','License','findOrCreate','spread','SERVICE\x20LICENSE\x20STARTED\x20%s','default','util','crypto','bluebird','pkginfo','version','../../mysqldb','../environment','../logger','license','../../api/jira/jira.controller','format'];(function(_0x1edb0f,_0x184554){var _0x5bb45b=function(_0x425c95){while(--_0x425c95){_0x1edb0f['push'](_0x1edb0f['shift']());}};_0x5bb45b(++_0x184554);}(_0xb6a6,0x1a0));var _0x6b6a=function(_0x94c1fe,_0x2b71a1){_0x94c1fe=_0x94c1fe-0x0;var _0x171613=_0xb6a6[_0x94c1fe];return _0x171613;};'use strict';var util=require(_0x6b6a('0x0'));var crypto=require(_0x6b6a('0x1'));var moment=require('moment');var rp=require('request-promise');var BPromise=require(_0x6b6a('0x2'));var pkginfo=require(_0x6b6a('0x3'))(module,_0x6b6a('0x4'));var db=require(_0x6b6a('0x5'))['db'];var config=require(_0x6b6a('0x6'));var hardware=require('./hardware');var logger=require(_0x6b6a('0x7'))(_0x6b6a('0x8'));var jira=require(_0x6b6a('0x9'));var HOST='https://www.xcallymotion.com';var TIME=0x3c*0x1388;var DAYS=0x7;var GRAY_PERIOD_REASON;var ADMIN;var oldToken;function httpRequest(_0x3ad201){return new BPromise(function(_0x1895f7,_0x59e90c){var _0x43f878=util[_0x6b6a('0xa')]('%s/api/servers/%s/check?version=%s',HOST,_0x3ad201,module[_0x6b6a('0xb')]['version']);if(oldToken){_0x43f878=util[_0x6b6a('0xa')](_0x6b6a('0xc'),HOST,_0x3ad201,module[_0x6b6a('0xb')]['version'],oldToken);}var _0x519b68={'uri':_0x43f878,'method':_0x6b6a('0xd'),'timeout':0xea60,'json':!![]};return rp(_0x519b68)[_0x6b6a('0xe')](function(_0x47c2dd){_0x1895f7(_0x47c2dd);})['catch'](function(_0x2f4f5c){_0x59e90c(_0x2f4f5c);});});}function encryptDate(_0x44758d){var _0x51aad7=crypto[_0x6b6a('0xf')](_0x6b6a('0x10'),config['secrets'][_0x6b6a('0x11')]);var _0x3d74e7=_0x51aad7['update'](_0x44758d,_0x6b6a('0x12'),_0x6b6a('0x13'));_0x3d74e7+=_0x51aad7[_0x6b6a('0x14')](_0x6b6a('0x13'));return _0x3d74e7;}function decryptDate(_0x56dc6a){var _0x6155e8=crypto[_0x6b6a('0x15')]('aes-256-ctr',config[_0x6b6a('0x16')][_0x6b6a('0x11')]);var _0x126189=_0x6155e8[_0x6b6a('0x17')](_0x56dc6a,_0x6b6a('0x13'),'utf8');_0x126189+=_0x6155e8[_0x6b6a('0x14')](_0x6b6a('0x12'));return _0x126189;}function sendJiraAlert(_0x3b7181,_0x580d86,_0x2a577c){var _0x4fd022=_0x6b6a('0x18');return db[_0x6b6a('0x19')][_0x6b6a('0x1a')]({'where':{'role':_0x6b6a('0x1b')},'attributes':[_0x6b6a('0x1c'),_0x6b6a('0x1d')],'raw':!![]})['then'](function(_0x4d6373){ADMIN=_0x4d6373;_0x4fd022+=_0x6b6a('0x1e')+_0x2a577c+'|\x0a';_0x4fd022+='|uuid|'+_0x3b7181+'|\x0a';_0x4fd022+='|machineUuid|'+_0x580d86+'|\x0a';_0x4fd022+=_0x6b6a('0x1f')+ADMIN['fullname']+'|\x0a';_0x4fd022+=_0x6b6a('0x20')+ADMIN[_0x6b6a('0x1d')]+'|\x0a';return _0x4fd022;})[_0x6b6a('0xe')](function(_0x26e9a3){var _0x37a295=hardware[_0x6b6a('0x21')]()[_0x6b6a('0x22')];return jira[_0x6b6a('0x23')]({'key':'MOTLICENSE','summary':'Motion\x20License\x20Alert','description':_0x26e9a3,'issuetype':'Alert','oldToken':_0x3b7181,'newToken':_0x580d86,'email':ADMIN[_0x6b6a('0x1d')],'name':ADMIN['fullname'],'reason':GRAY_PERIOD_REASON,'ip':_0x37a295});});}function manageLicense(_0x1807ee,_0x4c4ca5){var _0x56f08f=_0x4c4ca5[_0x6b6a('0x24')]({'plain':!![]});httpRequest(_0x1807ee)['then'](function(_0x13b237){if(oldToken){oldToken=undefined;}if(_0x13b237['active']){if(!_0x56f08f['license']&&_0x56f08f['license']!=_0x13b237[_0x6b6a('0x8')]||_0x56f08f[_0x6b6a('0x8')]&&_0x56f08f[_0x6b6a('0x25')]){logger['info'](_0x6b6a('0x26'));}if(_0x56f08f['license']&&!_0x56f08f[_0x6b6a('0x25')]&&_0x56f08f[_0x6b6a('0x8')]!=_0x13b237[_0x6b6a('0x8')]){logger[_0x6b6a('0x27')](_0x6b6a('0x28'));}if(_0x56f08f[_0x6b6a('0x8')]&&!_0x56f08f['data2']&&_0x56f08f['license']==_0x13b237[_0x6b6a('0x8')]){return _0x4c4ca5;}return _0x4c4ca5['update']({'data1':_0x1807ee,'data2':null,'license':_0x13b237['license']});}else{if(_0x13b237['license']||_0x56f08f[_0x6b6a('0x8')]){if(!_0x56f08f[_0x6b6a('0x25')]){if(_0x56f08f[_0x6b6a('0x29')]==_0x1807ee){GRAY_PERIOD_REASON=_0x6b6a('0x2a');logger[_0x6b6a('0x27')](_0x6b6a('0x2b'));}else{GRAY_PERIOD_REASON=_0x6b6a('0x2c');oldToken=_0x56f08f[_0x6b6a('0x29')];logger[_0x6b6a('0x27')](_0x6b6a('0x2d'),_0x56f08f[_0x6b6a('0x29')],_0x1807ee);}sendJiraAlert(_0x56f08f[_0x6b6a('0x29')],_0x13b237['uuid'],GRAY_PERIOD_REASON);logger[_0x6b6a('0x27')](_0x6b6a('0x2e'),GRAY_PERIOD_REASON[_0x6b6a('0x2f')](),moment()[_0x6b6a('0xa')](_0x6b6a('0x30')));return _0x4c4ca5[_0x6b6a('0x17')]({'data2':encryptDate(moment()['format'](_0x6b6a('0x30')))});}else{if(moment()[_0x6b6a('0x31')](decryptDate(_0x56f08f[_0x6b6a('0x25')]),'days')>DAYS){logger[_0x6b6a('0x27')](_0x6b6a('0x32'),moment()[_0x6b6a('0xa')](_0x6b6a('0x30')));return _0x4c4ca5[_0x6b6a('0x17')]({'data1':_0x1807ee,'data2':null,'license':null});}}}else{if(_0x56f08f['data1']!=_0x1807ee){logger[_0x6b6a('0x27')]('NEW\x20UUID\x20DETECTED:\x20FROM\x20%s\x20TO\x20%s',_0x56f08f[_0x6b6a('0x29')],_0x1807ee);return _0x4c4ca5[_0x6b6a('0x17')]({'data1':_0x1807ee,'data2':null,'license':null});}}}return _0x4c4ca5;})[_0x6b6a('0xe')](function(_0x98d6e5){_0x4c4ca5=_0x98d6e5;})[_0x6b6a('0x33')](function(_0x2dbde3){logger[_0x6b6a('0x34')](_0x2dbde3[_0x6b6a('0x35')]);})[_0x6b6a('0x36')](function(){setTimeout(function(){manageLicense(hardware['getUuid'](),_0x4c4ca5);},TIME);});}function defaultLicense(){var _0x31782f=hardware[_0x6b6a('0x37')]();if(_0x31782f){return db[_0x6b6a('0x38')][_0x6b6a('0x39')]({'where':{'id':0x1},'defaults':{'data1':_0x31782f}})[_0x6b6a('0x3a')](function(_0x3e0f6b,_0x2a7425){logger[_0x6b6a('0x27')](_0x6b6a('0x3b'),_0x31782f);manageLicense(_0x31782f,_0x3e0f6b);})[_0x6b6a('0x33')](function(_0x13cceb){logger[_0x6b6a('0x34')](_0x13cceb[_0x6b6a('0x35')]);});}}exports[_0x6b6a('0x3c')]=defaultLicense;
\ No newline at end of file
diff --git a/server/config/license/util.js b/server/config/license/util.js
index 9e5db83..a7aeed1 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 _0x67e2=['lodash','moment','./hardware','../../mysqldb','license','License\x20key\x20value\x20not\x20found','data1','data2','split','createDecipher','aes-256-ctr','%s:%s:%s','base64','utf8','final','parse','uuid','machineUuid','getUuid','secrets','session','update','gray','deadline','days','format','changed','disabled','2027-01-01T00:00:00.000Z','message','Demo\x20license','getLicense','License','find','defaults','crypto','util'];(function(_0x37c219,_0x16d29c){var _0x52b594=function(_0x5d64eb){while(--_0x5d64eb){_0x37c219['push'](_0x37c219['shift']());}};_0x52b594(++_0x16d29c);}(_0x67e2,0x6d));var _0x267e=function(_0x848300,_0xd6f38a){_0x848300=_0x848300-0x0;var _0x50ace4=_0x67e2[_0x848300];return _0x50ace4;};'use strict';var crypto=require(_0x267e('0x0'));var util=require(_0x267e('0x1'));var _=require(_0x267e('0x2'));var moment=require(_0x267e('0x3'));var hardware=require(_0x267e('0x4'));var config=require('../environment');var db=require(_0x267e('0x5'))['db'];function checkLicense(_0x10a118,_0x3db85f){if(_0x10a118){try{var _0x399169=_0x3db85f||_0x10a118[_0x267e('0x6')];if(_['isEmpty'](_0x399169)){throw new Error(_0x267e('0x7'));}var _0x4916b3=_0x10a118[_0x267e('0x8')];var _0x4aae72=_0x10a118[_0x267e('0x9')];var _0x293621=_0x4916b3['split']('-')[0x4];var _0x34b715=_0x4916b3[_0x267e('0xa')]('-')[0x0];var _0x220456=crypto[_0x267e('0xb')](_0x267e('0xc'),util['format'](_0x267e('0xd'),_0x293621,_0x4916b3,_0x34b715));var _0x3f40bb=_0x220456['update'](_0x399169,_0x267e('0xe'),_0x267e('0xf'));_0x3f40bb+=_0x220456[_0x267e('0x10')]('utf8');var _0xf2f9b=JSON[_0x267e('0x11')](_0x3f40bb);_0xf2f9b['demo']=![];_0xf2f9b[_0x267e('0x12')]=_0x4916b3;_0xf2f9b[_0x267e('0x13')]=hardware[_0x267e('0x14')]();if(_0x4aae72){var _0x23a868=crypto[_0x267e('0xb')]('aes-256-ctr',config[_0x267e('0x15')][_0x267e('0x16')]);var _0x2e3bc7=_0x23a868[_0x267e('0x17')](_0x4aae72,_0x267e('0xe'),_0x267e('0xf'));_0x2e3bc7+=_0x23a868[_0x267e('0x10')](_0x267e('0xf'));_0xf2f9b[_0x267e('0x18')]=_0x2e3bc7;_0xf2f9b[_0x267e('0x19')]=moment(_0x2e3bc7)['add'](0x7,_0x267e('0x1a'))[_0x267e('0x1b')]();_0xf2f9b['grayReason']=_0xf2f9b[_0x267e('0x12')]!=_0xf2f9b[_0x267e('0x13')]?_0x267e('0x1c'):_0x267e('0x1d');}return _0xf2f9b;}catch(_0xf654c0){return{'breaking':!![],'demo':!![],'agents':0x2,'telephones':0x0,'users':0x1,'expiration':_0x267e('0x1e'),'chat':![],'mail':![],'fax':![],'messaging':![],'cm':![],'dialer':![],'jscripty':![],'openchannel':![],'callysquare':0x2,'webrtc':![],'jaws':![],'custom':![],'update':![],'description':'Breaking\x20license','uuid':_0x10a118['data1'],'machineUuid':hardware[_0x267e('0x14')](),'message':_0xf654c0[_0x267e('0x1f')],'virtual':0x0,'voice':!![],'screenrecording':![],'preferred':![]};}}return{'demo':!![],'agents':0x2,'telephones':0x0,'users':0x1,'expiration':_0x267e('0x1e'),'chat':![],'mail':![],'fax':![],'messaging':![],'cm':![],'dialer':![],'jscripty':![],'openchannel':![],'callysquare':0x2,'webrtc':![],'jaws':![],'custom':![],'description':_0x267e('0x20'),'uuid':_0x10a118[_0x267e('0x8')],'machineUuid':hardware['getUuid'](),'virtual':0x0,'voice':!![],'screenrecording':![],'preferred':![]};}exports[_0x267e('0x21')]=function(_0x4963bf){return db[_0x267e('0x22')][_0x267e('0x23')](_[_0x267e('0x24')](_0x4963bf,{'raw':!![],'where':{'id':0x1}}))['then'](function(_0x111391){return checkLicense(_0x111391,null);});};exports['checkLicense']=checkLicense;
\ No newline at end of file
+var _0xdd4f=['%s:%s:%s','base64','utf8','parse','uuid','machineUuid','getUuid','secrets','update','final','deadline','add','days','grayReason','changed','2027-01-01T00:00:00.000Z','message','Demo\x20license','getLicense','License','find','checkLicense','crypto','util','lodash','moment','./hardware','../../mysqldb','license','isEmpty','data1','data2','split','createDecipher','aes-256-ctr','format'];(function(_0x3980d3,_0x1af200){var _0x5b95ab=function(_0x1c9f1b){while(--_0x1c9f1b){_0x3980d3['push'](_0x3980d3['shift']());}};_0x5b95ab(++_0x1af200);}(_0xdd4f,0x1ea));var _0xfdd4=function(_0x56cd0e,_0x42adec){_0x56cd0e=_0x56cd0e-0x0;var _0x19a2a5=_0xdd4f[_0x56cd0e];return _0x19a2a5;};'use strict';var crypto=require(_0xfdd4('0x0'));var util=require(_0xfdd4('0x1'));var _=require(_0xfdd4('0x2'));var moment=require(_0xfdd4('0x3'));var hardware=require(_0xfdd4('0x4'));var config=require('../environment');var db=require(_0xfdd4('0x5'))['db'];function checkLicense(_0x239d56,_0xd14730){if(_0x239d56){try{var _0x5c9861=_0xd14730||_0x239d56[_0xfdd4('0x6')];if(_[_0xfdd4('0x7')](_0x5c9861)){throw new Error('License\x20key\x20value\x20not\x20found');}var _0x517e25=_0x239d56[_0xfdd4('0x8')];var _0x176b6a=_0x239d56[_0xfdd4('0x9')];var _0xbb95c7=_0x517e25[_0xfdd4('0xa')]('-')[0x4];var _0x21f7ba=_0x517e25[_0xfdd4('0xa')]('-')[0x0];var _0x153a41=crypto[_0xfdd4('0xb')](_0xfdd4('0xc'),util[_0xfdd4('0xd')](_0xfdd4('0xe'),_0xbb95c7,_0x517e25,_0x21f7ba));var _0x27c34d=_0x153a41['update'](_0x5c9861,_0xfdd4('0xf'),'utf8');_0x27c34d+=_0x153a41['final'](_0xfdd4('0x10'));var _0x2ca35c=JSON[_0xfdd4('0x11')](_0x27c34d);_0x2ca35c['demo']=![];_0x2ca35c[_0xfdd4('0x12')]=_0x517e25;_0x2ca35c[_0xfdd4('0x13')]=hardware[_0xfdd4('0x14')]();if(_0x176b6a){var _0x362036=crypto['createDecipher'](_0xfdd4('0xc'),config[_0xfdd4('0x15')]['session']);var _0x9488e7=_0x362036[_0xfdd4('0x16')](_0x176b6a,_0xfdd4('0xf'),'utf8');_0x9488e7+=_0x362036[_0xfdd4('0x17')](_0xfdd4('0x10'));_0x2ca35c['gray']=_0x9488e7;_0x2ca35c[_0xfdd4('0x18')]=moment(_0x9488e7)[_0xfdd4('0x19')](0x7,_0xfdd4('0x1a'))['format']();_0x2ca35c[_0xfdd4('0x1b')]=_0x2ca35c[_0xfdd4('0x12')]!=_0x2ca35c[_0xfdd4('0x13')]?_0xfdd4('0x1c'):'disabled';}return _0x2ca35c;}catch(_0x482e95){return{'breaking':!![],'demo':!![],'agents':0x2,'telephones':0x0,'users':0x1,'expiration':_0xfdd4('0x1d'),'chat':![],'mail':![],'fax':![],'messaging':![],'cm':![],'dialer':![],'jscripty':![],'openchannel':![],'callysquare':0x2,'webrtc':![],'jaws':![],'custom':![],'update':![],'description':'Breaking\x20license','uuid':_0x239d56['data1'],'machineUuid':hardware[_0xfdd4('0x14')](),'message':_0x482e95[_0xfdd4('0x1e')],'virtual':0x0,'voice':!![],'screenrecording':![],'preferred':![]};}}return{'demo':!![],'agents':0x2,'telephones':0x0,'users':0x1,'expiration':'2027-01-01T00:00:00.000Z','chat':![],'mail':![],'fax':![],'messaging':![],'cm':![],'dialer':![],'jscripty':![],'openchannel':![],'callysquare':0x2,'webrtc':![],'jaws':![],'custom':![],'description':_0xfdd4('0x1f'),'uuid':_0x239d56[_0xfdd4('0x8')],'machineUuid':hardware[_0xfdd4('0x14')](),'virtual':0x0,'voice':!![],'screenrecording':![],'preferred':![]};}exports[_0xfdd4('0x20')]=function(_0x1638a9){return db[_0xfdd4('0x21')][_0xfdd4('0x22')](_['defaults'](_0x1638a9,{'raw':!![],'where':{'id':0x1}}))['then'](function(_0x2cd10a){return checkLicense(_0x2cd10a,null);});};exports[_0xfdd4('0x23')]=checkLicense;
\ No newline at end of file
diff --git a/server/config/local.env.js b/server/config/local.env.js
index 7dabff9..91608d3 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 _0x0852=['app-id','exports','myappanuglar-secret'];(function(_0x114001,_0x5aac2f){var _0x39a687=function(_0x2c4d38){while(--_0x2c4d38){_0x114001['push'](_0x114001['shift']());}};_0x39a687(++_0x5aac2f);}(_0x0852,0xe5));var _0x2085=function(_0x243b59,_0x3f9495){_0x243b59=_0x243b59-0x0;var _0x3e1676=_0x0852[_0x243b59];return _0x3e1676;};'use strict';module[_0x2085('0x0')]={'DOMAIN':'http://localhost:9000','SESSION_SECRET':_0x2085('0x1'),'GOOGLE_ID':_0x2085('0x2'),'GOOGLE_SECRET':'secret','DEBUG':''};
\ No newline at end of file
+var _0x370e=['secret','exports','http://localhost:9000','myappanuglar-secret','app-id'];(function(_0x57b4f3,_0x3aec3d){var _0x542345=function(_0x2bbf07){while(--_0x2bbf07){_0x57b4f3['push'](_0x57b4f3['shift']());}};_0x542345(++_0x3aec3d);}(_0x370e,0xab));var _0xe370=function(_0x3391f8,_0x2ac058){_0x3391f8=_0x3391f8-0x0;var _0x406c1e=_0x370e[_0x3391f8];return _0x406c1e;};'use strict';module[_0xe370('0x0')]={'DOMAIN':_0xe370('0x1'),'SESSION_SECRET':_0xe370('0x2'),'GOOGLE_ID':_0xe370('0x3'),'GOOGLE_SECRET':_0xe370('0x4'),'DEBUG':''};
\ No newline at end of file
diff --git a/server/config/logger.js b/server/config/logger.js
index ea45584..b085aa1 100644
--- a/server/config/logger.js
+++ b/server/config/logger.js
@@ -15,4 +15,4 @@
// * treaties. The SOFTWARE PRODUCT is licensed, not sold. *
// * *
// *************************************************************************
-var _0x6764=['Logger','transports','File','%s-%s','error','info','env','winston','util','path','INFO','log','xcally','%s-%s.log','[%s]\x20[%s]\x20%s\x20-\x20%s','format','level','toUpperCase','message'];(function(_0x519c88,_0xb84103){var _0x4668d7=function(_0x596c2c){while(--_0x596c2c){_0x519c88['push'](_0x519c88['shift']());}};_0x4668d7(++_0xb84103);}(_0x6764,0xc5));var _0x4676=function(_0x397e5f,_0x454c8f){_0x397e5f=_0x397e5f-0x0;var _0x5302b8=_0x6764[_0x397e5f];return _0x5302b8;};'use strict';var moment=require('moment');var winston=require(_0x4676('0x0'));var util=require(_0x4676('0x1'));var path=require(_0x4676('0x2'));var debugLevel=_0x4676('0x3');function filename(_0x411ffd,_0x224cd3){return path['join']('/var',_0x4676('0x4'),_0x4676('0x5'),util['format'](_0x4676('0x6'),_0x411ffd,_0x224cd3));}function formatter(_0x446cfe,_0x552bb0){return util['format'](_0x4676('0x7'),moment()[_0x4676('0x8')]('YYYY-MM-DD\x20HH:mm:ss'),_0x552bb0[_0x4676('0x9')][_0x4676('0xa')](),_0x446cfe,_0x552bb0[_0x4676('0xb')]);}module['exports']=function(_0x270d66){return new winston[(_0x4676('0xc'))]({'transports':[new winston[(_0x4676('0xd'))][(_0x4676('0xe'))]({'name':util['format'](_0x4676('0xf'),_0x270d66,'error'),'filename':filename(_0x270d66,'error'),'level':_0x4676('0x10'),'json':![],'maxsize':0xa00000,'maxFiles':0xa,'tailable':!![],'formatter':function(_0x467f20){return formatter(_0x270d66,_0x467f20);}}),new winston[(_0x4676('0xd'))][(_0x4676('0xe'))]({'name':util[_0x4676('0x8')](_0x4676('0xf'),_0x270d66,_0x4676('0x11')),'filename':filename(_0x270d66,'info'),'level':_0x4676('0x11'),'json':![],'maxsize':0xa00000,'maxFiles':0xa,'tailable':!![],'formatter':function(_0x2e62a0){return formatter(_0x270d66,_0x2e62a0);}}),new winston['transports']['Console']({'level':process[_0x4676('0x12')]['debugLevel']||debugLevel,'json':![],'formatter':function(_0x443e53){return formatter(_0x270d66,_0x443e53);}})]});};
\ No newline at end of file
+var _0x4504=['moment','util','path','INFO','/var','log','format','%s-%s.log','[%s]\x20[%s]\x20%s\x20-\x20%s','YYYY-MM-DD\x20HH:mm:ss','toUpperCase','exports','Logger','transports','%s-%s','info','Console','env'];(function(_0x237c10,_0x4ddf14){var _0x4db781=function(_0x44661d){while(--_0x44661d){_0x237c10['push'](_0x237c10['shift']());}};_0x4db781(++_0x4ddf14);}(_0x4504,0xc6));var _0x4450=function(_0x19379b,_0x1190d3){_0x19379b=_0x19379b-0x0;var _0x7510e4=_0x4504[_0x19379b];return _0x7510e4;};'use strict';var moment=require(_0x4450('0x0'));var winston=require('winston');var util=require(_0x4450('0x1'));var path=require(_0x4450('0x2'));var debugLevel=_0x4450('0x3');function filename(_0x5e23d9,_0x1f4e96){return path['join'](_0x4450('0x4'),_0x4450('0x5'),'xcally',util[_0x4450('0x6')](_0x4450('0x7'),_0x5e23d9,_0x1f4e96));}function formatter(_0x43c1db,_0x472939){return util['format'](_0x4450('0x8'),moment()[_0x4450('0x6')](_0x4450('0x9')),_0x472939['level'][_0x4450('0xa')](),_0x43c1db,_0x472939['message']);}module[_0x4450('0xb')]=function(_0x10bb83){return new winston[(_0x4450('0xc'))]({'transports':[new winston[(_0x4450('0xd'))]['File']({'name':util['format'](_0x4450('0xe'),_0x10bb83,'error'),'filename':filename(_0x10bb83,'error'),'level':'error','json':![],'maxsize':0xa00000,'maxFiles':0xa,'tailable':!![],'formatter':function(_0x12a010){return formatter(_0x10bb83,_0x12a010);}}),new winston['transports']['File']({'name':util[_0x4450('0x6')]('%s-%s',_0x10bb83,_0x4450('0xf')),'filename':filename(_0x10bb83,_0x4450('0xf')),'level':'info','json':![],'maxsize':0xa00000,'maxFiles':0xa,'tailable':!![],'formatter':function(_0x2ea3f9){return formatter(_0x10bb83,_0x2ea3f9);}}),new winston[(_0x4450('0xd'))][(_0x4450('0x10'))]({'level':process[_0x4450('0x11')]['debugLevel']||debugLevel,'json':![],'formatter':function(_0x7fe1b4){return formatter(_0x10bb83,_0x7fe1b4);}})]});};
\ No newline at end of file
diff --git a/server/config/pm2/config.js b/server/config/pm2/config.js
index a95f8e6..571559e 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 _0xe444=['ami','../../services/ami/index.js','agi','../../services/email/index.js','routing','exports','express','join','../../services/express/index.js'];(function(_0x584848,_0x5a453f){var _0x145708=function(_0x5749f9){while(--_0x5749f9){_0x584848['push'](_0x584848['shift']());}};_0x145708(++_0x5a453f);}(_0xe444,0x1bf));var _0x4e44=function(_0x1ee2cc,_0x5e6c13){_0x1ee2cc=_0x1ee2cc-0x0;var _0x20686a=_0xe444[_0x1ee2cc];return _0x20686a;};'use strict';var path=require('path');var os=require('os');var config={'apps':[{'name':_0x4e44('0x0'),'script':path[_0x4e44('0x1')](__dirname,_0x4e44('0x2'))},{'name':_0x4e44('0x3'),'script':path[_0x4e44('0x1')](__dirname,_0x4e44('0x4'))},{'name':_0x4e44('0x5'),'script':path[_0x4e44('0x1')](__dirname,'../../services/agi/index.js')},{'name':'email','script':path[_0x4e44('0x1')](__dirname,_0x4e44('0x6'))},{'name':_0x4e44('0x7'),'script':path[_0x4e44('0x1')](__dirname,'../../services/routing/index.js')},{'name':'xdr','script':path['join'](__dirname,'../../services/xdr/index.js')}]};module[_0x4e44('0x8')]=config;
\ No newline at end of file
+var _0xc9b4=['../../services/email/index.js','routing','../../services/routing/index.js','xdr','../../services/xdr/index.js','exports','path','express','join','ami','../../services/ami/index.js','../../services/agi/index.js','email'];(function(_0x457759,_0x51c94d){var _0x48a949=function(_0x56cd20){while(--_0x56cd20){_0x457759['push'](_0x457759['shift']());}};_0x48a949(++_0x51c94d);}(_0xc9b4,0xa2));var _0x4c9b=function(_0x1cfa0d,_0x4391f2){_0x1cfa0d=_0x1cfa0d-0x0;var _0xe33279=_0xc9b4[_0x1cfa0d];return _0xe33279;};'use strict';var path=require(_0x4c9b('0x0'));var os=require('os');var config={'apps':[{'name':_0x4c9b('0x1'),'script':path[_0x4c9b('0x2')](__dirname,'../../services/express/index.js')},{'name':_0x4c9b('0x3'),'script':path[_0x4c9b('0x2')](__dirname,_0x4c9b('0x4'))},{'name':'agi','script':path[_0x4c9b('0x2')](__dirname,_0x4c9b('0x5'))},{'name':_0x4c9b('0x6'),'script':path[_0x4c9b('0x2')](__dirname,_0x4c9b('0x7'))},{'name':_0x4c9b('0x8'),'script':path[_0x4c9b('0x2')](__dirname,_0x4c9b('0x9'))},{'name':_0x4c9b('0xa'),'script':path[_0x4c9b('0x2')](__dirname,_0x4c9b('0xb'))}]};module[_0x4c9b('0xc')]=config;
\ No newline at end of file
diff --git a/server/config/pm2/index.js b/server/config/pm2/index.js
index 6223252..8655d0f 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 _0x2e88=['bluebird','./config','connect','connected','start','then','disconnect','stop','restart','list','describe','delete','dump','saved','pm2'];(function(_0x321bb2,_0x202794){var _0x9c12ed=function(_0x263dd3){while(--_0x263dd3){_0x321bb2['push'](_0x321bb2['shift']());}};_0x9c12ed(++_0x202794);}(_0x2e88,0x95));var _0x82e8=function(_0x5eaa0b,_0x433b2f){_0x5eaa0b=_0x5eaa0b-0x0;var _0x28b295=_0x2e88[_0x5eaa0b];return _0x28b295;};'use strict';var pm2=require(_0x82e8('0x0'));var BPromise=require(_0x82e8('0x1'));var config=require(_0x82e8('0x2'));function connect(){return new BPromise(function(_0x2ef18d,_0x9dd860){return pm2[_0x82e8('0x3')](function(_0x552153){if(_0x552153){return _0x9dd860(_0x552153);}return _0x2ef18d(_0x82e8('0x4'));});});};exports[_0x82e8('0x5')]=function(_0x576435){return connect()[_0x82e8('0x6')](function(){return new BPromise(function(_0x63aedb,_0x4e909a){return pm2[_0x82e8('0x5')](_0x576435,function(_0x1e2496,_0x3db496){if(_0x1e2496){return _0x4e909a(_0x1e2496);}pm2[_0x82e8('0x7')]();return _0x63aedb(_0x3db496);});});});};exports[_0x82e8('0x8')]=function(_0x1ecc8f){return connect()[_0x82e8('0x6')](function(){return new BPromise(function(_0x23d5ef,_0x80019f){return pm2[_0x82e8('0x8')](_0x1ecc8f,function(_0xfef25b,_0x4c6e6a){if(_0xfef25b){return _0x80019f(_0xfef25b);}pm2[_0x82e8('0x7')]();return _0x23d5ef(_0x4c6e6a);});});});};exports[_0x82e8('0x9')]=function(_0x14eebe){return connect()[_0x82e8('0x6')](function(){return new BPromise(function(_0x474125,_0x256938){return pm2[_0x82e8('0x9')](_0x14eebe,function(_0x57d216,_0x253a36){if(_0x57d216){return _0x256938(_0x57d216);}pm2[_0x82e8('0x7')]();return _0x474125(_0x253a36);});});});};exports[_0x82e8('0xa')]=function(){return connect()[_0x82e8('0x6')](function(){return new BPromise(function(_0x192914,_0x5eb2ca){return pm2[_0x82e8('0xa')](function(_0x2c9569,_0xad6055){if(_0x2c9569){return _0x5eb2ca(_0x2c9569);}pm2[_0x82e8('0x7')]();return _0x192914(_0xad6055);});});});};exports['describe']=function(_0x25b60e){return connect()[_0x82e8('0x6')](function(){return new BPromise(function(_0x3253d2,_0xf53214){return pm2[_0x82e8('0xb')](_0x25b60e,function(_0x541c58,_0x39e7bc){if(_0x541c58){return _0xf53214(_0x541c58);}pm2[_0x82e8('0x7')]();return _0x3253d2(_0x39e7bc);});});});};exports['delete']=function(_0x1a776d){return connect()[_0x82e8('0x6')](function(){return new BPromise(function(_0x16cb41,_0x380f44){return pm2[_0x82e8('0xc')](_0x1a776d,function(_0x2b79c9,_0xd42771){if(_0x2b79c9){return _0x380f44(_0x2b79c9);}pm2['disconnect']();return _0x16cb41(_0xd42771);});});});};exports[_0x82e8('0xd')]=function(){return connect()[_0x82e8('0x6')](function(){return new BPromise(function(_0x3bafdd,_0x25d153){return pm2[_0x82e8('0xd')](function(_0x5db337){if(_0x5db337){return _0x25d153(_0x5db337);}return _0x3bafdd(_0x82e8('0xe'));});});});};
\ No newline at end of file
+var _0xee87=['bluebird','connect','connected','then','start','disconnect','stop','restart','list','describe','delete','dump','saved'];(function(_0x3530a0,_0xbfa8dc){var _0x210774=function(_0x46a671){while(--_0x46a671){_0x3530a0['push'](_0x3530a0['shift']());}};_0x210774(++_0xbfa8dc);}(_0xee87,0x193));var _0x7ee8=function(_0x42dce4,_0x1dce20){_0x42dce4=_0x42dce4-0x0;var _0x197857=_0xee87[_0x42dce4];return _0x197857;};'use strict';var pm2=require('pm2');var BPromise=require(_0x7ee8('0x0'));var config=require('./config');function connect(){return new BPromise(function(_0x4de157,_0x4d7a1d){return pm2[_0x7ee8('0x1')](function(_0xe4d376){if(_0xe4d376){return _0x4d7a1d(_0xe4d376);}return _0x4de157(_0x7ee8('0x2'));});});};exports['start']=function(_0x375133){return connect()[_0x7ee8('0x3')](function(){return new BPromise(function(_0x5b530b,_0x34ee4a){return pm2[_0x7ee8('0x4')](_0x375133,function(_0x2fe0fb,_0x3ac05f){if(_0x2fe0fb){return _0x34ee4a(_0x2fe0fb);}pm2[_0x7ee8('0x5')]();return _0x5b530b(_0x3ac05f);});});});};exports[_0x7ee8('0x6')]=function(_0x2d26bd){return connect()[_0x7ee8('0x3')](function(){return new BPromise(function(_0x17f8db,_0x4d193a){return pm2[_0x7ee8('0x6')](_0x2d26bd,function(_0x21c346,_0x25b94d){if(_0x21c346){return _0x4d193a(_0x21c346);}pm2['disconnect']();return _0x17f8db(_0x25b94d);});});});};exports[_0x7ee8('0x7')]=function(_0x283388){return connect()[_0x7ee8('0x3')](function(){return new BPromise(function(_0x2aecd4,_0x5cf98b){return pm2[_0x7ee8('0x7')](_0x283388,function(_0xcc032,_0x322707){if(_0xcc032){return _0x5cf98b(_0xcc032);}pm2[_0x7ee8('0x5')]();return _0x2aecd4(_0x322707);});});});};exports[_0x7ee8('0x8')]=function(){return connect()[_0x7ee8('0x3')](function(){return new BPromise(function(_0x3971ff,_0x179a75){return pm2[_0x7ee8('0x8')](function(_0x170d84,_0x24d5e8){if(_0x170d84){return _0x179a75(_0x170d84);}pm2[_0x7ee8('0x5')]();return _0x3971ff(_0x24d5e8);});});});};exports[_0x7ee8('0x9')]=function(_0x3ff469){return connect()[_0x7ee8('0x3')](function(){return new BPromise(function(_0xd275fb,_0x1ddb6a){return pm2[_0x7ee8('0x9')](_0x3ff469,function(_0x154272,_0x3b2c7e){if(_0x154272){return _0x1ddb6a(_0x154272);}pm2['disconnect']();return _0xd275fb(_0x3b2c7e);});});});};exports[_0x7ee8('0xa')]=function(_0x6e4192){return connect()[_0x7ee8('0x3')](function(){return new BPromise(function(_0x155790,_0x2ef79f){return pm2[_0x7ee8('0xa')](_0x6e4192,function(_0x13ee8e,_0x4a8125){if(_0x13ee8e){return _0x2ef79f(_0x13ee8e);}pm2[_0x7ee8('0x5')]();return _0x155790(_0x4a8125);});});});};exports['dump']=function(){return connect()[_0x7ee8('0x3')](function(){return new BPromise(function(_0x48bd15,_0x2d668a){return pm2[_0x7ee8('0xb')](function(_0x37ca34){if(_0x37ca34){return _0x2d668a(_0x37ca34);}return _0x48bd15(_0x7ee8('0xc'));});});});};
\ No newline at end of file
diff --git a/server/config/schedule/chat.js b/server/config/schedule/chat.js
index f671da6..837d2b5 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 _0x9a31=['../../config/environment','defaults','localhost','redis','Setting','then','chatTimeout','ChatInteraction','findAll','lastMsgAt','subtract','minutes','system','format','YYYY-MM-DD\x20HH:mm:ss','map','emit','chatInteraction:update','catch','lodash','ioredis','../../mysqldb'];(function(_0x55aabf,_0x5ed293){var _0x80c792=function(_0x58fded){while(--_0x58fded){_0x55aabf['push'](_0x55aabf['shift']());}};_0x80c792(++_0x5ed293);}(_0x9a31,0x1b5));var _0x19a3=function(_0x1f0679,_0x53d43c){_0x1f0679=_0x1f0679-0x0;var _0x3dc3a4=_0x9a31[_0x1f0679];return _0x3dc3a4;};'use strict';var _=require(_0x19a3('0x0'));var moment=require('moment');var Redis=require(_0x19a3('0x1'));var db=require(_0x19a3('0x2'))['db'];var config=require(_0x19a3('0x3'));config['redis']=_[_0x19a3('0x4')](config['redis'],{'host':_0x19a3('0x5'),'port':0x18eb});var io=require('socket.io-emitter')(new Redis(config[_0x19a3('0x6')]));function closeInteractions(){var _0x4c4264=0x0;var _0x273589=[];return db[_0x19a3('0x7')]['find']({'raw':!![],'attributes':['id','chatTimeout'],'where':{'id':0x1}})[_0x19a3('0x8')](function(_0x5d6c6d){_0x4c4264=_0x5d6c6d[_0x19a3('0x9')];if(_0x4c4264){return db[_0x19a3('0xa')][_0x19a3('0xb')]({'raw':!![],'attributes':['id',_0x19a3('0xc')],'where':{'closed':![],'lastMsgAt':{'$lt':moment()[_0x19a3('0xd')](_0x5d6c6d[_0x19a3('0x9')],_0x19a3('0xe'))}}});}else{return[];}})[_0x19a3('0x8')](function(_0x1fc91d){_0x273589=_0x1fc91d;if(_0x4c4264){return db[_0x19a3('0xa')]['update']({'closeReason':_0x19a3('0xf'),'disposition':'timeout','closed':!![],'closedAt':moment()[_0x19a3('0x10')](_0x19a3('0x11'))},{'where':{'id':_[_0x19a3('0x12')](_0x273589||[],'id')}});}})[_0x19a3('0x8')](function(_0x5a1e39){for(var _0xee3dda=0x0;_0xee3dda<_0x273589['length'];_0xee3dda++){io[_0x19a3('0x13')](_0x19a3('0x14'),{'id':_0x273589[_0xee3dda]['id'],'closed':!![]});}})[_0x19a3('0x15')](function(_0xf2f95a){console['error'](_0xf2f95a);});}exports['start']=function(){setInterval(function(){return closeInteractions();},0x3c*0x3e8);return closeInteractions();};
\ No newline at end of file
+var _0x97e7=['minutes','then','ChatInteraction','system','timeout','format','YYYY-MM-DD\x20HH:mm:ss','emit','chatInteraction:update','catch','error','start','lodash','../../config/environment','defaults','redis','localhost','Setting','find','chatTimeout','findAll','lastMsgAt'];(function(_0x13137e,_0x29c0f3){var _0x346261=function(_0x8c7d4f){while(--_0x8c7d4f){_0x13137e['push'](_0x13137e['shift']());}};_0x346261(++_0x29c0f3);}(_0x97e7,0x1ae));var _0x797e=function(_0x23df7b,_0x47a8db){_0x23df7b=_0x23df7b-0x0;var _0x249fb=_0x97e7[_0x23df7b];return _0x249fb;};'use strict';var _=require(_0x797e('0x0'));var moment=require('moment');var Redis=require('ioredis');var db=require('../../mysqldb')['db'];var config=require(_0x797e('0x1'));config['redis']=_[_0x797e('0x2')](config[_0x797e('0x3')],{'host':_0x797e('0x4'),'port':0x18eb});var io=require('socket.io-emitter')(new Redis(config['redis']));function closeInteractions(){var _0x5baf19=0x0;var _0x3a092c=[];return db[_0x797e('0x5')][_0x797e('0x6')]({'raw':!![],'attributes':['id','chatTimeout'],'where':{'id':0x1}})['then'](function(_0x246eaf){_0x5baf19=_0x246eaf[_0x797e('0x7')];if(_0x5baf19){return db['ChatInteraction'][_0x797e('0x8')]({'raw':!![],'attributes':['id',_0x797e('0x9')],'where':{'closed':![],'lastMsgAt':{'$lt':moment()['subtract'](_0x246eaf[_0x797e('0x7')],_0x797e('0xa'))}}});}else{return[];}})[_0x797e('0xb')](function(_0x55a6e1){_0x3a092c=_0x55a6e1;if(_0x5baf19){return db[_0x797e('0xc')]['update']({'closeReason':_0x797e('0xd'),'disposition':_0x797e('0xe'),'closed':!![],'closedAt':moment()[_0x797e('0xf')](_0x797e('0x10'))},{'where':{'id':_['map'](_0x3a092c||[],'id')}});}})[_0x797e('0xb')](function(_0x23885f){for(var _0x35e1e2=0x0;_0x35e1e2<_0x3a092c['length'];_0x35e1e2++){io[_0x797e('0x11')](_0x797e('0x12'),{'id':_0x3a092c[_0x35e1e2]['id'],'closed':!![]});}})[_0x797e('0x13')](function(_0x405632){console[_0x797e('0x14')](_0x405632);});}exports[_0x797e('0x15')]=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 1f34046..04c9a5a 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 _0xd493=['update','update\x20cron','deleteJob','run','util','path','moment','cron-job-manager','jayson/promise','bluebird','../logger','schedule','../../mysqldb','../../api/analyticCustomReport/analyticCustomReport.controller','../../api/analyticDefaultReport/analyticDefaultReport.controller','client','http','info','Try\x20to\x20send\x20a\x20mail\x20to','MailAccount','Smtp','service','host','port','secure','auth','user','pass','format','\x22%s\x22\x20<%s>','name','email','bcc','Report\x20%s\x20last\x20%s\x20%s','subtractNumber','subtractUnit','../../files/reports','basename','savename','zip','join','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','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','error','error\x20mail','stringify','email\x20sent','catch','data','isNil','subtractNumber\x20null\x20or\x20undefined','subtractUnit\x20null\x20or\x20undefined','subtract','YYYY-MM-DD\x20HH:mm:ss','output','exec\x20defaul\x20report\x20id:%s','DefaultReportId','runReport','exec\x20custom\x20report\x20id:%s','CustomReportId','Schedule','MailServerOut','then','keys','jobs','toString','keyBy','difference','intersection','exists','delete\x20cron','toRun','length','index','resolve','cron','active','isBetween','startAt','endAt','start','add\x20cron','stop','stop\x20cron'];(function(_0x16d10f,_0x2ba2d5){var _0x50c823=function(_0x44e43f){while(--_0x44e43f){_0x16d10f['push'](_0x16d10f['shift']());}};_0x50c823(++_0x2ba2d5);}(_0xd493,0x174));var _0x3d49=function(_0x4be267,_0x53b2cb){_0x4be267=_0x4be267-0x0;var _0x37cbbf=_0xd493[_0x4be267];return _0x37cbbf;};'use strict';var fs=require('fs');var util=require(_0x3d49('0x0'));var path=require(_0x3d49('0x1'));var _=require('lodash');var moment=require(_0x3d49('0x2'));var CronJobManager=require(_0x3d49('0x3'));var jayson=require(_0x3d49('0x4'));var BPromise=require(_0x3d49('0x5'));var logger=require(_0x3d49('0x6'))(_0x3d49('0x7'));var db=require(_0x3d49('0x8'))['db'];var analyticCustomReportController=require(_0x3d49('0x9'));var analyticDefaultReportController=require(_0x3d49('0xa'));var client=jayson[_0x3d49('0xb')][_0x3d49('0xc')]({'port':0x232b});var manager=new CronJobManager();function handleSendEmail(_0x1ca2f7,_0x39f436){return function(){logger[_0x3d49('0xd')](_0x3d49('0xe'),_0x1ca2f7['email']);var _0x22f655=!![];var _0x2dfcf0={'tls':{'rejectUnauthorized':![]}};if(_0x1ca2f7[_0x3d49('0xf')][_0x3d49('0x10')]['service']){_0x2dfcf0[_0x3d49('0x11')]=_0x1ca2f7[_0x3d49('0xf')]['Smtp'][_0x3d49('0x11')];}else{_0x2dfcf0[_0x3d49('0x12')]=_0x1ca2f7[_0x3d49('0xf')][_0x3d49('0x10')][_0x3d49('0x12')];_0x2dfcf0[_0x3d49('0x13')]=_0x1ca2f7[_0x3d49('0xf')]['Smtp'][_0x3d49('0x13')];_0x2dfcf0[_0x3d49('0x14')]=_0x1ca2f7[_0x3d49('0xf')][_0x3d49('0x10')][_0x3d49('0x14')];}if(_0x1ca2f7[_0x3d49('0xf')][_0x3d49('0x10')]['authentication']){_0x2dfcf0[_0x3d49('0x15')]={'user':_0x1ca2f7[_0x3d49('0xf')][_0x3d49('0x10')][_0x3d49('0x16')],'pass':_0x1ca2f7['MailAccount']['Smtp'][_0x3d49('0x17')]};}var _0x7f2d47={'account':_0x2dfcf0,'message':{'from':util[_0x3d49('0x18')](_0x3d49('0x19'),_0x1ca2f7[_0x3d49('0xf')][_0x3d49('0x1a')],_0x1ca2f7[_0x3d49('0xf')][_0x3d49('0x1b')]||_0x1ca2f7[_0x3d49('0xf')][_0x3d49('0x10')][_0x3d49('0x16')]),'to':_0x1ca2f7[_0x3d49('0x1b')],'cc':_0x1ca2f7['cc'],'bcc':_0x1ca2f7[_0x3d49('0x1c')],'subject':util[_0x3d49('0x18')](_0x3d49('0x1d'),_0x39f436[_0x3d49('0x1a')],_0x1ca2f7[_0x3d49('0x1e')],_0x1ca2f7[_0x3d49('0x1f')])}};var _0x1b9232=path['join'](__dirname,_0x3d49('0x20'));var _0x1c2446=_0x39f436['savename'];var _0x5ebf8f=util[_0x3d49('0x18')]('%s.%s',path[_0x3d49('0x21')](_0x39f436['savename'],path['extname'](_0x39f436[_0x3d49('0x22')])),_0x3d49('0x23'));var _0xe99e8a=path['join'](_0x1b9232,_0x1c2446);var _0x329b21=path[_0x3d49('0x24')](_0x1b9232,_0x5ebf8f);if(fs['existsSync'](_0xe99e8a)){_0x39f436[_0x3d49('0x25')]=_0x3d49('0x26');_0x7f2d47[_0x3d49('0x27')]['attachments']=[{'filename':_0x1c2446,'path':_0xe99e8a}];_0x7f2d47[_0x3d49('0x27')][_0x3d49('0x28')]=util[_0x3d49('0x18')](_0x3d49('0x29'),JSON['stringify'](_0x39f436,null,0x2));}else if(fs['existsSync'](_0x329b21)){_0x39f436[_0x3d49('0x25')]=_0x3d49('0x26');_0x7f2d47[_0x3d49('0x27')][_0x3d49('0x2a')]=[{'filename':_0x5ebf8f,'path':_0x329b21}];}else{_0x7f2d47[_0x3d49('0x27')][_0x3d49('0x28')]=_0x3d49('0x2b');if(!_0x1ca2f7[_0x3d49('0x2c')]){_0x22f655=![];logger[_0x3d49('0xd')](_0x3d49('0x2d'));}}if(_0x22f655){return client[_0x3d49('0x2e')]('SendMail',_0x7f2d47)['then'](function(_0x9e84c4){if(_0x9e84c4[_0x3d49('0x2f')]){return logger[_0x3d49('0x2f')](_0x3d49('0x30'),JSON[_0x3d49('0x31')](_0x9e84c4));}return logger[_0x3d49('0xd')](_0x3d49('0x32'));})[_0x3d49('0x33')](function(_0x4d8e66){return logger[_0x3d49('0x2f')](_0x3d49('0x30'),JSON['stringify'](_0x4d8e66));});}};}function handleError(){return function(_0x27d079){return logger[_0x3d49('0x2f')](JSON[_0x3d49('0x31')](_0x27d079));};}function handleResult(_0x128714){return function(_0x27b254){logger[_0x3d49('0xd')](_0x3d49('0x34'),JSON['stringify'](_0x27b254));if(_0x128714[_0x3d49('0xf')]&&_0x128714[_0x3d49('0xf')]['Smtp']&&!_[_0x3d49('0x35')](_0x128714[_0x3d49('0x1b')])){setTimeout(handleSendEmail(_0x128714,_0x27b254),0x3c*0x3e8);}};}function handleJob(_0x551a8f){return function(){try{if(_['isNil'](_0x551a8f['subtractNumber'])){return logger[_0x3d49('0xd')](_0x3d49('0x36'));}if(_[_0x3d49('0x35')](_0x551a8f[_0x3d49('0x1f')])){return logger['info'](_0x3d49('0x37'));}var _0x4d0373={'startDate':moment()[_0x3d49('0x38')](_0x551a8f[_0x3d49('0x1e')],_0x551a8f[_0x3d49('0x1f')])[_0x3d49('0x18')](_0x3d49('0x39')),'endDate':moment()[_0x3d49('0x18')](_0x3d49('0x39')),'type':'scheduled','output':_0x551a8f[_0x3d49('0x3a')],'name':_0x551a8f[_0x3d49('0x1a')]};if(!_[_0x3d49('0x35')](_0x551a8f['DefaultReportId'])){logger[_0x3d49('0xd')](_0x3d49('0x3b'),_0x551a8f[_0x3d49('0x3c')]);return analyticDefaultReportController[_0x3d49('0x3d')]({'id':_0x551a8f['DefaultReportId']},_0x4d0373)['then'](handleResult(_0x551a8f))[_0x3d49('0x33')](handleError());}if(!_[_0x3d49('0x35')](_0x551a8f['CustomReportId'])){logger['info'](_0x3d49('0x3e'),_0x551a8f[_0x3d49('0x3f')]);return analyticCustomReportController['runReport']({'id':_0x551a8f[_0x3d49('0x3f')]},_0x4d0373)['then'](handleResult(_0x551a8f))['catch'](handleError());}}catch(_0x67f16e){logger[_0x3d49('0x2f')](JSON[_0x3d49('0x31')](_0x67f16e));}return logger['info']('no\x20report\x20id');};}function getJobs(_0x2ed06e){var _0x4e29e={};if(_0x2ed06e){_0x4e29e['id']=_0x2ed06e;}return db[_0x3d49('0x40')]['findAll']({'where':_0x4e29e,'include':[{'model':db[_0x3d49('0xf')],'attributes':['id',_0x3d49('0x1a'),'email'],'include':[{'model':db[_0x3d49('0x41')],'as':_0x3d49('0x10')}]}]})[_0x3d49('0x42')](function(_0x198fd6){var _0x53ddc2=_[_0x3d49('0x43')](manager[_0x3d49('0x44')]);var _0x5b7afe=_['map'](_0x198fd6,function(_0x2e21ac){return _0x2e21ac['id'][_0x3d49('0x45')]();});var _0x9f62d8=_[_0x3d49('0x46')](_0x198fd6,function(_0xe604e9){return _0xe604e9['id']['toString']();});var _0x4a64ad=_0x2ed06e?_0x5b7afe:_[_0x3d49('0x47')](_0x5b7afe,_0x53ddc2);var _0x564e42=_[_0x3d49('0x48')](_0x5b7afe,_0x53ddc2);var _0x521a05=_[_0x3d49('0x47')](_0x53ddc2,_0x5b7afe);var _0x56305c;var _0x230da7;for(_0x56305c=0x0;_0x56305c<_0x521a05['length']&&!_0x2ed06e;_0x56305c+=0x1){_0x230da7=_0x521a05[_0x56305c][_0x3d49('0x45')]();if(manager[_0x3d49('0x49')](_0x230da7)){manager['stop'](_0x230da7);manager['deleteJob'](_0x230da7);logger[_0x3d49('0xd')](_0x3d49('0x4a'),_0x230da7);}}logger[_0x3d49('0xd')](_0x3d49('0x4b'),JSON['stringify'](_0x4a64ad));for(_0x56305c=0x0;_0x56305c<_0x4a64ad[_0x3d49('0x4c')];_0x56305c+=0x1){_0x230da7=_0x4a64ad[_0x56305c][_0x3d49('0x45')]();logger[_0x3d49('0xd')](_0x3d49('0x4d'),_0x230da7);if(_0x2ed06e){logger[_0x3d49('0xd')]('my\x20id',_0x2ed06e);logger['info'](JSON[_0x3d49('0x31')](_0x9f62d8[_0x230da7]));BPromise[_0x3d49('0x4e')]()[_0x3d49('0x42')](handleJob(_0x9f62d8[_0x230da7]));logger[_0x3d49('0xd')]('run\x20job',_0x9f62d8[_0x230da7][_0x3d49('0x1a')],_0x9f62d8[_0x230da7]['cron']);}else if(_0x9f62d8[_0x230da7][_0x3d49('0x4f')]&&_0x9f62d8[_0x230da7][_0x3d49('0x50')]&&moment()[_0x3d49('0x51')](_0x9f62d8[_0x230da7][_0x3d49('0x52')],_0x9f62d8[_0x230da7][_0x3d49('0x53')])){manager['add'](_0x230da7,_0x9f62d8[_0x230da7][_0x3d49('0x4f')],handleJob(_0x9f62d8[_0x230da7]));manager[_0x3d49('0x54')](_0x230da7);logger['info'](_0x3d49('0x55'),_0x9f62d8[_0x230da7][_0x3d49('0x1a')],_0x9f62d8[_0x230da7][_0x3d49('0x4f')]);}else if(manager[_0x3d49('0x49')](_0x230da7)){manager[_0x3d49('0x56')](_0x230da7);manager['deleteJob'](_0x230da7);logger[_0x3d49('0xd')](_0x3d49('0x57'),_0x9f62d8[_0x230da7][_0x3d49('0x1a')],_0x9f62d8[_0x230da7]['cron']);}}for(_0x56305c=0x0,_0x230da7;_0x56305c<_0x564e42[_0x3d49('0x4c')]&&!_0x2ed06e;_0x56305c+=0x1){_0x230da7=_0x564e42[_0x56305c][_0x3d49('0x45')]();if(manager[_0x3d49('0x49')](_0x230da7)){if(_0x9f62d8[_0x230da7][_0x3d49('0x4f')]&&_0x9f62d8[_0x230da7][_0x3d49('0x50')]&&moment()['isBetween'](_0x9f62d8[_0x230da7]['startAt'],_0x9f62d8[_0x230da7][_0x3d49('0x53')])){manager[_0x3d49('0x58')](_0x230da7,_0x9f62d8[_0x230da7][_0x3d49('0x4f')],handleJob(_0x9f62d8[_0x230da7]));logger['info'](_0x3d49('0x59'),_0x9f62d8[_0x230da7]['name'],_0x9f62d8[_0x230da7][_0x3d49('0x4f')]);}else{manager[_0x3d49('0x56')](_0x230da7);manager[_0x3d49('0x5a')](_0x230da7);logger[_0x3d49('0xd')](_0x3d49('0x57'),_0x9f62d8[_0x230da7][_0x3d49('0x1a')],_0x9f62d8[_0x230da7][_0x3d49('0x4f')]);}}}})[_0x3d49('0x33')](function(_0xf3a87a){logger[_0x3d49('0x2f')](JSON['stringify'](_0xf3a87a));});}exports[_0x3d49('0x5b')]=function(_0x18c8fa){return getJobs(_0x18c8fa);};exports[_0x3d49('0x54')]=function(){setInterval(function(){return getJobs();},0x3c*0x3e8);return getJobs();};
\ No newline at end of file
+var _0x0e18=['no\x20report\x20id','Schedule','MailServerOut','jobs','map','toString','keyBy','difference','length','exists','stop','deleteJob','delete\x20cron','toRun','index','my\x20id','resolve','run\x20job','cron','active','isBetween','endAt','add','start','add\x20cron','stop\x20cron','startAt','update\x20cron','run','util','lodash','moment','jayson/promise','../logger','schedule','../../mysqldb','../../api/analyticCustomReport/analyticCustomReport.controller','../../api/analyticDefaultReport/analyticDefaultReport.controller','client','http','info','Try\x20to\x20send\x20a\x20mail\x20to','email','Smtp','service','MailAccount','host','port','authentication','auth','user','pass','\x22%s\x22\x20<%s>','name','bcc','format','Report\x20%s\x20last\x20%s\x20%s','subtractUnit','join','savename','%s.%s','basename','extname','zip','existsSync','message','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','Sent','Report\x20empty\x0aThis\x20is\x20an\x20automatically\x20generated\x20email\x20–\x20please\x20do\x20not\x20reply\x20to\x20this\x20email.\x0a\x0a','empty\x20file,\x20email\x20not\x20sent','request','SendMail','error','email\x20sent','catch','data','isNil','subtractUnit\x20null\x20or\x20undefined','subtract','subtractNumber','YYYY-MM-DD\x20HH:mm:ss','scheduled','output','DefaultReportId','exec\x20defaul\x20report\x20id:%s','runReport','CustomReportId','exec\x20custom\x20report\x20id:%s','then'];(function(_0x641f18,_0x2919e8){var _0x16eefe=function(_0x578a89){while(--_0x578a89){_0x641f18['push'](_0x641f18['shift']());}};_0x16eefe(++_0x2919e8);}(_0x0e18,0x79));var _0x80e1=function(_0x9d9e88,_0x17bde6){_0x9d9e88=_0x9d9e88-0x0;var _0x25bbd7=_0x0e18[_0x9d9e88];return _0x25bbd7;};'use strict';var fs=require('fs');var util=require(_0x80e1('0x0'));var path=require('path');var _=require(_0x80e1('0x1'));var moment=require(_0x80e1('0x2'));var CronJobManager=require('cron-job-manager');var jayson=require(_0x80e1('0x3'));var BPromise=require('bluebird');var logger=require(_0x80e1('0x4'))(_0x80e1('0x5'));var db=require(_0x80e1('0x6'))['db'];var analyticCustomReportController=require(_0x80e1('0x7'));var analyticDefaultReportController=require(_0x80e1('0x8'));var client=jayson[_0x80e1('0x9')][_0x80e1('0xa')]({'port':0x232b});var manager=new CronJobManager();function handleSendEmail(_0x2958d2,_0x20281a){return function(){logger[_0x80e1('0xb')](_0x80e1('0xc'),_0x2958d2[_0x80e1('0xd')]);var _0x5914c1=!![];var _0x4198b3={'tls':{'rejectUnauthorized':![]}};if(_0x2958d2['MailAccount'][_0x80e1('0xe')][_0x80e1('0xf')]){_0x4198b3[_0x80e1('0xf')]=_0x2958d2[_0x80e1('0x10')][_0x80e1('0xe')][_0x80e1('0xf')];}else{_0x4198b3['host']=_0x2958d2[_0x80e1('0x10')][_0x80e1('0xe')][_0x80e1('0x11')];_0x4198b3[_0x80e1('0x12')]=_0x2958d2[_0x80e1('0x10')]['Smtp'][_0x80e1('0x12')];_0x4198b3['secure']=_0x2958d2['MailAccount'][_0x80e1('0xe')]['secure'];}if(_0x2958d2['MailAccount']['Smtp'][_0x80e1('0x13')]){_0x4198b3[_0x80e1('0x14')]={'user':_0x2958d2[_0x80e1('0x10')][_0x80e1('0xe')][_0x80e1('0x15')],'pass':_0x2958d2[_0x80e1('0x10')][_0x80e1('0xe')][_0x80e1('0x16')]};}var _0xe1449b={'account':_0x4198b3,'message':{'from':util['format'](_0x80e1('0x17'),_0x2958d2['MailAccount'][_0x80e1('0x18')],_0x2958d2[_0x80e1('0x10')][_0x80e1('0xd')]||_0x2958d2['MailAccount'][_0x80e1('0xe')]['user']),'to':_0x2958d2[_0x80e1('0xd')],'cc':_0x2958d2['cc'],'bcc':_0x2958d2[_0x80e1('0x19')],'subject':util[_0x80e1('0x1a')](_0x80e1('0x1b'),_0x20281a[_0x80e1('0x18')],_0x2958d2['subtractNumber'],_0x2958d2[_0x80e1('0x1c')])}};var _0x20c29f=path[_0x80e1('0x1d')](__dirname,'../../files/reports');var _0x11169a=_0x20281a[_0x80e1('0x1e')];var _0x34057f=util[_0x80e1('0x1a')](_0x80e1('0x1f'),path[_0x80e1('0x20')](_0x20281a[_0x80e1('0x1e')],path[_0x80e1('0x21')](_0x20281a[_0x80e1('0x1e')])),_0x80e1('0x22'));var _0x43f2a6=path[_0x80e1('0x1d')](_0x20c29f,_0x11169a);var _0x43e707=path[_0x80e1('0x1d')](_0x20c29f,_0x34057f);if(fs[_0x80e1('0x23')](_0x43f2a6)){_0x20281a['status']='Sent';_0xe1449b[_0x80e1('0x24')][_0x80e1('0x25')]=[{'filename':_0x11169a,'path':_0x43f2a6}];_0xe1449b[_0x80e1('0x24')][_0x80e1('0x26')]=util['format'](_0x80e1('0x27'),JSON[_0x80e1('0x28')](_0x20281a,null,0x2));}else if(fs[_0x80e1('0x23')](_0x43e707)){_0x20281a['status']=_0x80e1('0x29');_0xe1449b[_0x80e1('0x24')][_0x80e1('0x25')]=[{'filename':_0x34057f,'path':_0x43e707}];}else{_0xe1449b[_0x80e1('0x24')][_0x80e1('0x26')]=_0x80e1('0x2a');if(!_0x2958d2['sendIfEmpty']){_0x5914c1=![];logger[_0x80e1('0xb')](_0x80e1('0x2b'));}}if(_0x5914c1){return client[_0x80e1('0x2c')](_0x80e1('0x2d'),_0xe1449b)['then'](function(_0xdc8dfa){if(_0xdc8dfa[_0x80e1('0x2e')]){return logger[_0x80e1('0x2e')]('error\x20mail',JSON[_0x80e1('0x28')](_0xdc8dfa));}return logger[_0x80e1('0xb')](_0x80e1('0x2f'));})[_0x80e1('0x30')](function(_0x13b5e2){return logger['error']('error\x20mail',JSON[_0x80e1('0x28')](_0x13b5e2));});}};}function handleError(){return function(_0x48ad6e){return logger['error'](JSON[_0x80e1('0x28')](_0x48ad6e));};}function handleResult(_0x3fa58f){return function(_0x2fb25d){logger[_0x80e1('0xb')](_0x80e1('0x31'),JSON[_0x80e1('0x28')](_0x2fb25d));if(_0x3fa58f[_0x80e1('0x10')]&&_0x3fa58f[_0x80e1('0x10')][_0x80e1('0xe')]&&!_[_0x80e1('0x32')](_0x3fa58f[_0x80e1('0xd')])){setTimeout(handleSendEmail(_0x3fa58f,_0x2fb25d),0x3c*0x3e8);}};}function handleJob(_0x41b6a9){return function(){try{if(_['isNil'](_0x41b6a9['subtractNumber'])){return logger[_0x80e1('0xb')]('subtractNumber\x20null\x20or\x20undefined');}if(_['isNil'](_0x41b6a9[_0x80e1('0x1c')])){return logger[_0x80e1('0xb')](_0x80e1('0x33'));}var _0x23552a={'startDate':moment()[_0x80e1('0x34')](_0x41b6a9[_0x80e1('0x35')],_0x41b6a9[_0x80e1('0x1c')])[_0x80e1('0x1a')](_0x80e1('0x36')),'endDate':moment()[_0x80e1('0x1a')]('YYYY-MM-DD\x20HH:mm:ss'),'type':_0x80e1('0x37'),'output':_0x41b6a9[_0x80e1('0x38')],'name':_0x41b6a9[_0x80e1('0x18')]};if(!_[_0x80e1('0x32')](_0x41b6a9[_0x80e1('0x39')])){logger[_0x80e1('0xb')](_0x80e1('0x3a'),_0x41b6a9[_0x80e1('0x39')]);return analyticDefaultReportController[_0x80e1('0x3b')]({'id':_0x41b6a9['DefaultReportId']},_0x23552a)['then'](handleResult(_0x41b6a9))[_0x80e1('0x30')](handleError());}if(!_['isNil'](_0x41b6a9[_0x80e1('0x3c')])){logger[_0x80e1('0xb')](_0x80e1('0x3d'),_0x41b6a9[_0x80e1('0x3c')]);return analyticCustomReportController[_0x80e1('0x3b')]({'id':_0x41b6a9['CustomReportId']},_0x23552a)[_0x80e1('0x3e')](handleResult(_0x41b6a9))[_0x80e1('0x30')](handleError());}}catch(_0x1f5b14){logger[_0x80e1('0x2e')](JSON[_0x80e1('0x28')](_0x1f5b14));}return logger[_0x80e1('0xb')](_0x80e1('0x3f'));};}function getJobs(_0x5b1618){var _0x2a5ad2={};if(_0x5b1618){_0x2a5ad2['id']=_0x5b1618;}return db[_0x80e1('0x40')]['findAll']({'where':_0x2a5ad2,'include':[{'model':db[_0x80e1('0x10')],'attributes':['id',_0x80e1('0x18'),'email'],'include':[{'model':db[_0x80e1('0x41')],'as':_0x80e1('0xe')}]}]})[_0x80e1('0x3e')](function(_0x4c7cfc){var _0x575f88=_['keys'](manager[_0x80e1('0x42')]);var _0xa0da35=_[_0x80e1('0x43')](_0x4c7cfc,function(_0x3394bc){return _0x3394bc['id'][_0x80e1('0x44')]();});var _0x4d7dcf=_[_0x80e1('0x45')](_0x4c7cfc,function(_0x48a624){return _0x48a624['id'][_0x80e1('0x44')]();});var _0x484482=_0x5b1618?_0xa0da35:_[_0x80e1('0x46')](_0xa0da35,_0x575f88);var _0x5de66a=_['intersection'](_0xa0da35,_0x575f88);var _0x5b7c8d=_[_0x80e1('0x46')](_0x575f88,_0xa0da35);var _0x4187fd;var _0xdf6353;for(_0x4187fd=0x0;_0x4187fd<_0x5b7c8d[_0x80e1('0x47')]&&!_0x5b1618;_0x4187fd+=0x1){_0xdf6353=_0x5b7c8d[_0x4187fd][_0x80e1('0x44')]();if(manager[_0x80e1('0x48')](_0xdf6353)){manager[_0x80e1('0x49')](_0xdf6353);manager[_0x80e1('0x4a')](_0xdf6353);logger['info'](_0x80e1('0x4b'),_0xdf6353);}}logger[_0x80e1('0xb')](_0x80e1('0x4c'),JSON[_0x80e1('0x28')](_0x484482));for(_0x4187fd=0x0;_0x4187fd<_0x484482[_0x80e1('0x47')];_0x4187fd+=0x1){_0xdf6353=_0x484482[_0x4187fd][_0x80e1('0x44')]();logger['info'](_0x80e1('0x4d'),_0xdf6353);if(_0x5b1618){logger[_0x80e1('0xb')](_0x80e1('0x4e'),_0x5b1618);logger[_0x80e1('0xb')](JSON['stringify'](_0x4d7dcf[_0xdf6353]));BPromise[_0x80e1('0x4f')]()[_0x80e1('0x3e')](handleJob(_0x4d7dcf[_0xdf6353]));logger[_0x80e1('0xb')](_0x80e1('0x50'),_0x4d7dcf[_0xdf6353]['name'],_0x4d7dcf[_0xdf6353][_0x80e1('0x51')]);}else if(_0x4d7dcf[_0xdf6353][_0x80e1('0x51')]&&_0x4d7dcf[_0xdf6353][_0x80e1('0x52')]&&moment()[_0x80e1('0x53')](_0x4d7dcf[_0xdf6353]['startAt'],_0x4d7dcf[_0xdf6353][_0x80e1('0x54')])){manager[_0x80e1('0x55')](_0xdf6353,_0x4d7dcf[_0xdf6353][_0x80e1('0x51')],handleJob(_0x4d7dcf[_0xdf6353]));manager[_0x80e1('0x56')](_0xdf6353);logger[_0x80e1('0xb')](_0x80e1('0x57'),_0x4d7dcf[_0xdf6353][_0x80e1('0x18')],_0x4d7dcf[_0xdf6353][_0x80e1('0x51')]);}else if(manager[_0x80e1('0x48')](_0xdf6353)){manager[_0x80e1('0x49')](_0xdf6353);manager['deleteJob'](_0xdf6353);logger[_0x80e1('0xb')](_0x80e1('0x58'),_0x4d7dcf[_0xdf6353][_0x80e1('0x18')],_0x4d7dcf[_0xdf6353]['cron']);}}for(_0x4187fd=0x0,_0xdf6353;_0x4187fd<_0x5de66a['length']&&!_0x5b1618;_0x4187fd+=0x1){_0xdf6353=_0x5de66a[_0x4187fd][_0x80e1('0x44')]();if(manager[_0x80e1('0x48')](_0xdf6353)){if(_0x4d7dcf[_0xdf6353]['cron']&&_0x4d7dcf[_0xdf6353][_0x80e1('0x52')]&&moment()[_0x80e1('0x53')](_0x4d7dcf[_0xdf6353][_0x80e1('0x59')],_0x4d7dcf[_0xdf6353][_0x80e1('0x54')])){manager['update'](_0xdf6353,_0x4d7dcf[_0xdf6353]['cron'],handleJob(_0x4d7dcf[_0xdf6353]));logger[_0x80e1('0xb')](_0x80e1('0x5a'),_0x4d7dcf[_0xdf6353]['name'],_0x4d7dcf[_0xdf6353][_0x80e1('0x51')]);}else{manager['stop'](_0xdf6353);manager[_0x80e1('0x4a')](_0xdf6353);logger[_0x80e1('0xb')](_0x80e1('0x58'),_0x4d7dcf[_0xdf6353]['name'],_0x4d7dcf[_0xdf6353][_0x80e1('0x51')]);}}}})[_0x80e1('0x30')](function(_0x57ea26){logger[_0x80e1('0x2e')](JSON[_0x80e1('0x28')](_0x57ea26));});}exports[_0x80e1('0x5b')]=function(_0x4c5066){return getJobs(_0x4c5066);};exports['start']=function(){setInterval(function(){return getJobs();},0x3c*0x3e8);return getJobs();};
\ No newline at end of file
diff --git a/server/config/seedContact.js b/server/config/seedContact.js
index 3b9e117..a56cc0c 100644
--- a/server/config/seedContact.js
+++ b/server/config/seedContact.js
@@ -15,4 +15,4 @@
// * treaties. The SOFTWARE PRODUCT is licensed, not sold. *
// * *
// *************************************************************************
-var _0xff1a=['hopper1','finished\x20populating','contacts2','hopper2','../mysqldb','push','Innocenzo','innocenzo.biondo','now','@xcally.com','CmContact','bulkCreate','then','log','CmHopper','destroy'];(function(_0x3abe19,_0x5a8632){var _0xf9ab3f=function(_0x4a7f93){while(--_0x4a7f93){_0x3abe19['push'](_0x3abe19['shift']());}};_0xf9ab3f(++_0x5a8632);}(_0xff1a,0x144));var _0xaff1=function(_0x34efaf,_0x54d85f){_0x34efaf=_0x34efaf-0x0;var _0xf17a17=_0xff1a[_0x34efaf];return _0xf17a17;};'use strict';var util=require('util');var db=require(_0xaff1('0x0'))['db'];var contacts=[];var hopper=[];var contacts2=[];var hopper2=[];for(var i=0x1;i<=0x4b0;i+=0x1){contacts[_0xaff1('0x1')]({'id':i,'firstName':_0xaff1('0x2')+i,'lastName':'Biondo'+i,'phone':0xf879fb460+i,'email':_0xaff1('0x3')+i+'@xcally.com'});}for(var i=0x1;i<=0x4b0;i+=0x1){hopper[_0xaff1('0x1')]({'id':i,'active':![],'scheduledat':Date[_0xaff1('0x4')](),'countbusyretry':0x0,'countcongestionretry':0x0,'countnoanswerretry':0x0,'ContactId':i,'ListId':0x1,'UserId':0x1,'VoiceQueueId':0x3fd,'createdAt':Date[_0xaff1('0x4')](),'updatedAt':Date['now']()});}for(var i=0x4b1;i<=0x960;i+=0x1){contacts2[_0xaff1('0x1')]({'id':i,'firstName':_0xaff1('0x2')+i,'lastName':'Biondo'+i,'phone':0xf879fb460+i,'email':_0xaff1('0x3')+i+_0xaff1('0x5')});}for(var i=0x4b1;i<=0x960;i+=0x1){hopper2[_0xaff1('0x1')]({'id':i,'active':![],'scheduledat':Date[_0xaff1('0x4')](),'countbusyretry':0x0,'countcongestionretry':0x0,'countnoanswerretry':0x0,'ContactId':i,'ListId':0x1,'UserId':0x1,'VoiceQueueId':0x3fd,'createdAt':Date[_0xaff1('0x4')](),'updatedAt':Date[_0xaff1('0x4')]()});}db[_0xaff1('0x6')]['destroy']({'where':{}})['then'](function(){return db[_0xaff1('0x6')][_0xaff1('0x7')](contacts);})[_0xaff1('0x8')](function(){console[_0xaff1('0x9')]('finished\x20populating','contacts1');return db[_0xaff1('0xa')][_0xaff1('0xb')]({'where':{}});})[_0xaff1('0x8')](function(){return db['CmHopper'][_0xaff1('0x7')](hopper);})[_0xaff1('0x8')](function(){console[_0xaff1('0x9')]('finished\x20populating',_0xaff1('0xc'));return db[_0xaff1('0x6')][_0xaff1('0x7')](contacts2);})[_0xaff1('0x8')](function(){console[_0xaff1('0x9')](_0xaff1('0xd'),_0xaff1('0xe'));return db[_0xaff1('0xa')][_0xaff1('0x7')](hopper2);})['then'](function(){console[_0xaff1('0x9')](_0xaff1('0xd'),_0xaff1('0xf'));})['catch'](function(_0x3fab79){console['log'](_0x3fab79);});
\ No newline at end of file
+var _0x6519=['util','../mysqldb','push','Innocenzo','Biondo','innocenzo.biondo','@xcally.com','now','destroy','then','log','finished\x20populating','contacts1','CmHopper','CmContact','catch'];(function(_0x117eb2,_0x39a648){var _0x1ee6f0=function(_0x58735f){while(--_0x58735f){_0x117eb2['push'](_0x117eb2['shift']());}};_0x1ee6f0(++_0x39a648);}(_0x6519,0x70));var _0x9651=function(_0x11090e,_0x2f1226){_0x11090e=_0x11090e-0x0;var _0x103e19=_0x6519[_0x11090e];return _0x103e19;};'use strict';var util=require(_0x9651('0x0'));var db=require(_0x9651('0x1'))['db'];var contacts=[];var hopper=[];var contacts2=[];var hopper2=[];for(var i=0x1;i<=0x4b0;i+=0x1){contacts[_0x9651('0x2')]({'id':i,'firstName':_0x9651('0x3')+i,'lastName':_0x9651('0x4')+i,'phone':0xf879fb460+i,'email':_0x9651('0x5')+i+'@xcally.com'});}for(var i=0x1;i<=0x4b0;i+=0x1){hopper['push']({'id':i,'active':![],'scheduledat':Date['now'](),'countbusyretry':0x0,'countcongestionretry':0x0,'countnoanswerretry':0x0,'ContactId':i,'ListId':0x1,'UserId':0x1,'VoiceQueueId':0x3fd,'createdAt':Date['now'](),'updatedAt':Date['now']()});}for(var i=0x4b1;i<=0x960;i+=0x1){contacts2[_0x9651('0x2')]({'id':i,'firstName':_0x9651('0x3')+i,'lastName':'Biondo'+i,'phone':0xf879fb460+i,'email':_0x9651('0x5')+i+_0x9651('0x6')});}for(var i=0x4b1;i<=0x960;i+=0x1){hopper2[_0x9651('0x2')]({'id':i,'active':![],'scheduledat':Date[_0x9651('0x7')](),'countbusyretry':0x0,'countcongestionretry':0x0,'countnoanswerretry':0x0,'ContactId':i,'ListId':0x1,'UserId':0x1,'VoiceQueueId':0x3fd,'createdAt':Date[_0x9651('0x7')](),'updatedAt':Date[_0x9651('0x7')]()});}db['CmContact'][_0x9651('0x8')]({'where':{}})[_0x9651('0x9')](function(){return db['CmContact']['bulkCreate'](contacts);})[_0x9651('0x9')](function(){console[_0x9651('0xa')](_0x9651('0xb'),_0x9651('0xc'));return db[_0x9651('0xd')][_0x9651('0x8')]({'where':{}});})[_0x9651('0x9')](function(){return db[_0x9651('0xd')]['bulkCreate'](hopper);})[_0x9651('0x9')](function(){console['log']('finished\x20populating','hopper1');return db[_0x9651('0xe')]['bulkCreate'](contacts2);})['then'](function(){console[_0x9651('0xa')](_0x9651('0xb'),'contacts2');return db['CmHopper']['bulkCreate'](hopper2);})['then'](function(){console[_0x9651('0xa')](_0x9651('0xb'),'hopper2');})[_0x9651('0xf')](function(_0x4bb663){console[_0x9651('0xa')](_0x4bb663);});
\ No newline at end of file
diff --git a/server/config/seedUsers.js b/server/config/seedUsers.js
index 8c4700b..98ab663 100644
--- a/server/config/seedUsers.js
+++ b/server/config/seedUsers.js
@@ -15,4 +15,4 @@
// * treaties. The SOFTWARE PRODUCT is licensed, not sold. *
// * *
// *************************************************************************
-var _0x6059=['agent','%s%s@xcally.com','password','friend','wss','all','yes','/etc/pki/tls/certs/motion.crt','/etc/pki/tls/private/motion.key','\x22%s\x22\x20<%s>','User','then','log','add\x20user','catch','util','../mysqldb','push','format','%s%s'];(function(_0x110c3d,_0x12ee06){var _0x226d67=function(_0x1fb6e1){while(--_0x1fb6e1){_0x110c3d['push'](_0x110c3d['shift']());}};_0x226d67(++_0x12ee06);}(_0x6059,0xff));var _0x9605=function(_0x16e9b5,_0x192142){_0x16e9b5=_0x16e9b5-0x0;var _0x206df0=_0x6059[_0x16e9b5];return _0x206df0;};'use strict';var util=require(_0x9605('0x0'));var db=require(_0x9605('0x1'))['db'];var users=[];for(var i=0x1;i<=0xc8;i+=0x1){users[_0x9605('0x2')]({'name':util['format']('%s%s','agent',i),'fullname':util[_0x9605('0x3')](_0x9605('0x4'),_0x9605('0x5'),i),'email':util['format'](_0x9605('0x6'),_0x9605('0x5'),i),'role':_0x9605('0x5'),'password':_0x9605('0x7'),'internal':0xfa0+i,'type':_0x9605('0x8'),'transport':['udp','ws',_0x9605('0x9')],'disallow':[_0x9605('0xa')],'allow':['ulaw'],'defaultuser':util['format'](_0x9605('0x4'),_0x9605('0x5'),i),'encryption':_0x9605('0xb'),'avpf':_0x9605('0xb'),'force_avp':_0x9605('0xb'),'icesupport':'yes','dtlsenable':_0x9605('0xb'),'dtlsverify':'no','dtlscertfile':_0x9605('0xc'),'dtlsprivatekey':_0x9605('0xd'),'dtlssetup':'actpass','callerid':util[_0x9605('0x3')](_0x9605('0xe'),util[_0x9605('0x3')](_0x9605('0x4'),_0x9605('0x5'),i),0xfa0+i)});}db[_0x9605('0xf')]['bulkCreate'](users)[_0x9605('0x10')](function(){console[_0x9605('0x11')](_0x9605('0x12'));})[_0x9605('0x13')](function(_0x26a9ae){console[_0x9605('0x11')](_0x26a9ae);});
\ No newline at end of file
+var _0x7a9e=['ulaw','yes','/etc/pki/tls/certs/motion.crt','/etc/pki/tls/private/motion.key','actpass','\x22%s\x22\x20<%s>','User','then','log','add\x20user','catch','util','../mysqldb','push','format','%s%s','agent','friend','udp','all'];(function(_0x3dd15e,_0x1f0015){var _0x231fd0=function(_0x4f680a){while(--_0x4f680a){_0x3dd15e['push'](_0x3dd15e['shift']());}};_0x231fd0(++_0x1f0015);}(_0x7a9e,0x1eb));var _0xe7a9=function(_0x4a9fb1,_0x273043){_0x4a9fb1=_0x4a9fb1-0x0;var _0x348672=_0x7a9e[_0x4a9fb1];return _0x348672;};'use strict';var util=require(_0xe7a9('0x0'));var db=require(_0xe7a9('0x1'))['db'];var users=[];for(var i=0x1;i<=0xc8;i+=0x1){users[_0xe7a9('0x2')]({'name':util[_0xe7a9('0x3')](_0xe7a9('0x4'),_0xe7a9('0x5'),i),'fullname':util['format']('%s%s',_0xe7a9('0x5'),i),'email':util[_0xe7a9('0x3')]('%s%s@xcally.com',_0xe7a9('0x5'),i),'role':_0xe7a9('0x5'),'password':'password','internal':0xfa0+i,'type':_0xe7a9('0x6'),'transport':[_0xe7a9('0x7'),'ws','wss'],'disallow':[_0xe7a9('0x8')],'allow':[_0xe7a9('0x9')],'defaultuser':util[_0xe7a9('0x3')](_0xe7a9('0x4'),_0xe7a9('0x5'),i),'encryption':_0xe7a9('0xa'),'avpf':_0xe7a9('0xa'),'force_avp':_0xe7a9('0xa'),'icesupport':_0xe7a9('0xa'),'dtlsenable':'yes','dtlsverify':'no','dtlscertfile':_0xe7a9('0xb'),'dtlsprivatekey':_0xe7a9('0xc'),'dtlssetup':_0xe7a9('0xd'),'callerid':util['format'](_0xe7a9('0xe'),util[_0xe7a9('0x3')](_0xe7a9('0x4'),_0xe7a9('0x5'),i),0xfa0+i)});}db[_0xe7a9('0xf')]['bulkCreate'](users)[_0xe7a9('0x10')](function(){console[_0xe7a9('0x11')](_0xe7a9('0x12'));})[_0xe7a9('0x13')](function(_0x1072f9){console[_0xe7a9('0x11')](_0x1072f9);});
\ No newline at end of file
diff --git a/server/config/socketio.js b/server/config/socketio.js
index 6999c02..22086e8 100644
--- a/server/config/socketio.js
+++ b/server/config/socketio.js
@@ -15,4 +15,4 @@
// * treaties. The SOFTWARE PRODUCT is licensed, not sold. *
// * *
// *************************************************************************
-var _0x6c93=['bluebird','./environment','name','Agents','User','role','agent','telephone','type','ivr','UserProfileSection','then','autoAssociation','FaxQueues','SmsQueues','findAll','Telephones','Trunks','resourceId','map','Campaign','format','%s:queue:%s','length','user:%s','handshake','query','find','userProfileId','ChatInteraction','ChatInteractions','MailInteraction','MailInteractions','FaxInteraction','FaxInteractions','SmsInteraction','OpenchannelInteraction','OpenchannelInteractions','voice:inbound','voice:outbound','hasOwnProperty','include','push','VoiceQueue','SmsQueue','MailQueue','Trunk','user','ChatQueues','ChatQueue','FaxQueue','MailQueues','OpenchannelQueue','IvrCampaigns','getVoiceQueues','getFaxQueues','getSmsQueues','getMailQueues','getOpenchannelQueues','all','voice','fax','sms','openchannel','telephone:%s','campaign:%s:%s','leave','user_has_chat_interactions:remove','removeMailInteractions','emit','removeFaxInteractions','user_has_fax_interactions:remove','SmsInteractions','removeSmsInteractions','user_has_sms_interactions:remove','catch','log','join','default','connection','setMaxListeners','address','remoteAddress','remotePort','connectedAt','nsp','disconnect','CONNECTED','lodash'];(function(_0x3fbd48,_0x389edb){var _0x2989b4=function(_0x35cad3){while(--_0x35cad3){_0x3fbd48['push'](_0x3fbd48['shift']());}};_0x2989b4(++_0x389edb);}(_0x6c93,0x163));var _0x36c9=function(_0x459879,_0x16b25d){_0x459879=_0x459879-0x0;var _0xa84228=_0x6c93[_0x459879];return _0xa84228;};'use strict';var _=require(_0x36c9('0x0'));var util=require('util');var BPromise=require(_0x36c9('0x1'));var db=require('../mysqldb')['db'];var config=require(_0x36c9('0x2'));var queryQueues={'attributes':['id',_0x36c9('0x3')],'include':[{'as':_0x36c9('0x4'),'model':db[_0x36c9('0x5')],'attributes':['id',_0x36c9('0x3'),_0x36c9('0x6')],'raw':!![],'where':{'role':_0x36c9('0x7')},'required':![]}]};var queryTelephones={'raw':!![],'attributes':['id',_0x36c9('0x3')],'where':{'role':_0x36c9('0x8')}};var queryTrunks={'raw':!![],'attributes':['id',_0x36c9('0x3')]};var queryAgents={'raw':!![],'attributes':['id',_0x36c9('0x3')],'where':{'role':_0x36c9('0x7')}};var queryCampaigns={'raw':!![],'attributes':['id',_0x36c9('0x3'),_0x36c9('0x9')],'where':{'type':_0x36c9('0xa')}};function getAssociatedResources(_0x32ef58,_0x376050,_0x1e5530){return db[_0x36c9('0xb')]['findOne']({'where':{'name':_0x32ef58,'userProfileId':_0x376050},'raw':!![]})[_0x36c9('0xc')](function(_0x4c1f33){if(_0x4c1f33){if(_0x4c1f33[_0x36c9('0xd')]){switch(_0x32ef58){case'VoiceQueues':case'ChatQueues':case _0x36c9('0xe'):case _0x36c9('0xf'):case'MailQueues':case'OpenchannelQueues':return db[_0x1e5530][_0x36c9('0x10')](queryQueues);case _0x36c9('0x11'):return db[_0x1e5530]['findAll'](queryTelephones);case _0x36c9('0x12'):return db[_0x1e5530]['findAll'](queryTrunks);case'IvrCampaigns':return db[_0x1e5530][_0x36c9('0x10')](queryCampaigns);}}else{return db['UserProfileResource']['findAll']({'attributes':[_0x36c9('0x13')],'where':{'sectionId':_0x4c1f33['id']},'raw':!![]})[_0x36c9('0xc')](function(_0x1b4469){if(_0x1b4469){var _0x5c45f0={'where':{'id':_[_0x36c9('0x14')](_0x1b4469,'resourceId')},'raw':!![]};switch(_0x1e5530){case _0x36c9('0x5'):_0x5c45f0['where'][_0x36c9('0x6')]=_0x36c9('0x8');break;case _0x36c9('0x15'):_0x5c45f0['where'][_0x36c9('0x9')]=_0x36c9('0xa');break;}return db[_0x1e5530]['findAll'](_0x5c45f0);}else{return[];}});}}else{return[];}})[_0x36c9('0xc')](function(_0x5e9644){return _0x5e9644;});}function joinOrLeaveQueues(_0x29b9e1,_0x4cfcac,_0x48f1d5,_0x485535){_0x29b9e1[_0x4cfcac](util[_0x36c9('0x16')](_0x36c9('0x17'),_0x48f1d5,_0x485535[_0x36c9('0x3')]));if(_0x485535[_0x36c9('0x4')]){for(var _0xe04f10=0x0;_0xe04f10<_0x485535[_0x36c9('0x4')][_0x36c9('0x18')];_0xe04f10+=0x1){_0x29b9e1[_0x4cfcac](util['format'](_0x36c9('0x19'),_0x485535[_0x36c9('0x4')][_0xe04f10]['name']));}}}function joinOrLeave(_0x567366,_0x273716,_0x52fdf0){var _0x4171f6;if(_0x567366[_0x36c9('0x1a')][_0x36c9('0x1b')]['id']){db[_0x36c9('0x5')][_0x36c9('0x1c')]({'attributes':['id',_0x36c9('0x3'),'role',_0x36c9('0x1d')],'where':{'id':_0x567366[_0x36c9('0x1a')][_0x36c9('0x1b')]['id']},'include':[{'model':db[_0x36c9('0x1e')],'as':_0x36c9('0x1f'),'attributes':['id'],'raw':!![]},{'model':db[_0x36c9('0x20')],'as':_0x36c9('0x21'),'attributes':['id'],'raw':!![]},{'model':db[_0x36c9('0x22')],'as':_0x36c9('0x23'),'attributes':['id'],'raw':!![]},{'model':db[_0x36c9('0x24')],'as':'SmsInteractions','attributes':['id'],'raw':!![]},{'model':db[_0x36c9('0x25')],'as':_0x36c9('0x26'),'attributes':['id'],'raw':!![]}]})['then'](function(_0x3cb73e){if(_0x3cb73e){_0x4171f6=_0x3cb73e;_0x567366[_0x273716](util[_0x36c9('0x16')](_0x36c9('0x19'),_0x3cb73e['name']));var _0x2f3627=[];switch(_0x3cb73e['role']){case'admin':_0x567366[_0x273716](_0x36c9('0x27'));_0x567366[_0x273716](_0x36c9('0x28'));if(queryQueues[_0x36c9('0x29')]('include')){delete queryQueues[_0x36c9('0x2a')];}_0x2f3627[_0x36c9('0x2b')](db[_0x36c9('0x2c')][_0x36c9('0x10')](queryQueues));_0x2f3627[_0x36c9('0x2b')](db['ChatQueue']['findAll'](queryQueues));_0x2f3627[_0x36c9('0x2b')](db['FaxQueue'][_0x36c9('0x10')](queryQueues));_0x2f3627['push'](db[_0x36c9('0x2d')][_0x36c9('0x10')](queryQueues));_0x2f3627['push'](db[_0x36c9('0x2e')][_0x36c9('0x10')](queryQueues));_0x2f3627[_0x36c9('0x2b')](db['OpenchannelQueue'][_0x36c9('0x10')](queryQueues));_0x2f3627['push'](db[_0x36c9('0x5')][_0x36c9('0x10')](queryTelephones));_0x2f3627['push'](db[_0x36c9('0x2f')][_0x36c9('0x10')](queryTrunks));_0x2f3627[_0x36c9('0x2b')](db[_0x36c9('0x15')][_0x36c9('0x10')](queryCampaigns));_0x2f3627[_0x36c9('0x2b')](db[_0x36c9('0x5')][_0x36c9('0x10')](queryAgents));break;case _0x36c9('0x30'):_0x567366[_0x273716](_0x36c9('0x27'));_0x567366[_0x273716](_0x36c9('0x28'));_0x2f3627[_0x36c9('0x2b')](getAssociatedResources('VoiceQueues',_0x3cb73e['userProfileId'],'VoiceQueue'));_0x2f3627[_0x36c9('0x2b')](getAssociatedResources(_0x36c9('0x31'),_0x3cb73e[_0x36c9('0x1d')],_0x36c9('0x32')));_0x2f3627[_0x36c9('0x2b')](getAssociatedResources(_0x36c9('0xe'),_0x3cb73e[_0x36c9('0x1d')],_0x36c9('0x33')));_0x2f3627[_0x36c9('0x2b')](getAssociatedResources(_0x36c9('0xf'),_0x3cb73e['userProfileId'],_0x36c9('0x2d')));_0x2f3627[_0x36c9('0x2b')](getAssociatedResources(_0x36c9('0x34'),_0x3cb73e['userProfileId'],'MailQueue'));_0x2f3627[_0x36c9('0x2b')](getAssociatedResources('OpenchannelQueues',_0x3cb73e['userProfileId'],_0x36c9('0x35')));_0x2f3627[_0x36c9('0x2b')](getAssociatedResources(_0x36c9('0x11'),_0x3cb73e['userProfileId'],_0x36c9('0x5')));_0x2f3627[_0x36c9('0x2b')](getAssociatedResources('Trunks',_0x3cb73e[_0x36c9('0x1d')],_0x36c9('0x2f')));_0x2f3627[_0x36c9('0x2b')](getAssociatedResources(_0x36c9('0x36'),_0x3cb73e['userProfileId'],_0x36c9('0x15')));_0x2f3627['push'](db[_0x36c9('0x5')][_0x36c9('0x10')](queryAgents));break;case _0x36c9('0x7'):_0x567366[_0x273716](_0x36c9('0x27'));_0x567366[_0x273716]('voice:outbound');_0x2f3627[_0x36c9('0x2b')](_0x3cb73e[_0x36c9('0x37')]({'attributes':['id',_0x36c9('0x3')]}));_0x2f3627[_0x36c9('0x2b')](_0x3cb73e['getChatQueues']({'attributes':['id',_0x36c9('0x3')]}));_0x2f3627[_0x36c9('0x2b')](_0x3cb73e[_0x36c9('0x38')]({'attributes':['id',_0x36c9('0x3')]}));_0x2f3627[_0x36c9('0x2b')](_0x3cb73e[_0x36c9('0x39')]({'attributes':['id',_0x36c9('0x3')]}));_0x2f3627['push'](_0x3cb73e[_0x36c9('0x3a')]({'attributes':['id',_0x36c9('0x3')]}));_0x2f3627['push'](_0x3cb73e[_0x36c9('0x3b')]({'attributes':['id','name']}));break;}return BPromise[_0x36c9('0x3c')](_0x2f3627);}})['then'](function(_0x37e2fe){if(_0x37e2fe&&_0x37e2fe[_0x36c9('0x18')]){for(var _0x4bbdd9=0x0;_0x4bbdd9<_0x37e2fe[_0x36c9('0x18')];_0x4bbdd9+=0x1){for(var _0x5b6aa4=0x0;_0x5b6aa4<_0x37e2fe[_0x4bbdd9][_0x36c9('0x18')];_0x5b6aa4+=0x1){switch(_0x4bbdd9){case 0x0:joinOrLeaveQueues(_0x567366,_0x273716,_0x36c9('0x3d'),_0x37e2fe[_0x4bbdd9][_0x5b6aa4]);break;case 0x1:joinOrLeaveQueues(_0x567366,_0x273716,'chat',_0x37e2fe[_0x4bbdd9][_0x5b6aa4]);break;case 0x2:joinOrLeaveQueues(_0x567366,_0x273716,_0x36c9('0x3e'),_0x37e2fe[_0x4bbdd9][_0x5b6aa4]);break;case 0x3:joinOrLeaveQueues(_0x567366,_0x273716,_0x36c9('0x3f'),_0x37e2fe[_0x4bbdd9][_0x5b6aa4]);break;case 0x4:joinOrLeaveQueues(_0x567366,_0x273716,'mail',_0x37e2fe[_0x4bbdd9][_0x5b6aa4]);break;case 0x5:joinOrLeaveQueues(_0x567366,_0x273716,_0x36c9('0x40'),_0x37e2fe[_0x4bbdd9][_0x5b6aa4]);break;case 0x6:_0x567366[_0x273716](util[_0x36c9('0x16')](_0x36c9('0x41'),_0x37e2fe[_0x4bbdd9][_0x5b6aa4][_0x36c9('0x3')]));break;case 0x7:_0x567366[_0x273716](util['format']('trunk:%s',_0x37e2fe[_0x4bbdd9][_0x5b6aa4][_0x36c9('0x3')]));break;case 0x8:_0x567366[_0x273716](util['format'](_0x36c9('0x42'),_0x37e2fe[_0x4bbdd9][_0x5b6aa4][_0x36c9('0x9')],_0x37e2fe[_0x4bbdd9][_0x5b6aa4]['name']));break;case 0x9:_0x567366[_0x273716](util[_0x36c9('0x16')]('user:%s',_0x37e2fe[_0x4bbdd9][_0x5b6aa4][_0x36c9('0x3')]));break;}}}}})[_0x36c9('0xc')](function(){if(_0x273716===_0x36c9('0x43')){var _0x40abc2=_[_0x36c9('0x14')](_0x4171f6[_0x36c9('0x1f')],'id');return _0x4171f6['removeChatInteractions'](_0x40abc2)['then'](function(){for(var _0x2c5d9e=0x0;_0x2c5d9e<_0x40abc2[_0x36c9('0x18')];_0x2c5d9e+=0x1){_0x52fdf0['emit'](_0x36c9('0x44'),{'ChatInteractionId':Number(_0x40abc2[_0x2c5d9e]),'UserId':Number(_0x4171f6['id'])});}});}})[_0x36c9('0xc')](function(){if(_0x273716===_0x36c9('0x43')){var _0x4d8ca3=_[_0x36c9('0x14')](_0x4171f6['MailInteractions'],'id');return _0x4171f6[_0x36c9('0x45')](_0x4d8ca3)[_0x36c9('0xc')](function(){for(var _0x198a63=0x0;_0x198a63<_0x4d8ca3[_0x36c9('0x18')];_0x198a63+=0x1){_0x52fdf0[_0x36c9('0x46')]('user_has_mail_interactions:remove',{'MailInteractionId':Number(_0x4d8ca3[_0x198a63]),'UserId':Number(_0x4171f6['id'])});}});}})[_0x36c9('0xc')](function(){if(_0x273716==='leave'){var _0x455ec4=_[_0x36c9('0x14')](_0x4171f6[_0x36c9('0x23')],'id');return _0x4171f6[_0x36c9('0x47')](_0x455ec4)[_0x36c9('0xc')](function(){for(var _0x8860ac=0x0;_0x8860ac<_0x455ec4[_0x36c9('0x18')];_0x8860ac+=0x1){_0x52fdf0[_0x36c9('0x46')](_0x36c9('0x48'),{'FaxInteractionId':Number(_0x455ec4[_0x8860ac]),'UserId':Number(_0x4171f6['id'])});}});}})[_0x36c9('0xc')](function(){if(_0x273716===_0x36c9('0x43')){var _0x3b37f4=_[_0x36c9('0x14')](_0x4171f6[_0x36c9('0x49')],'id');return _0x4171f6[_0x36c9('0x4a')](_0x3b37f4)[_0x36c9('0xc')](function(){for(var _0xb7f6c3=0x0;_0xb7f6c3<_0x3b37f4[_0x36c9('0x18')];_0xb7f6c3+=0x1){_0x52fdf0['emit'](_0x36c9('0x4b'),{'SmsInteractionId':Number(_0x3b37f4[_0xb7f6c3]),'UserId':Number(_0x4171f6['id'])});}});}})[_0x36c9('0xc')](function(){if(_0x273716===_0x36c9('0x43')){var _0x5827ce=_[_0x36c9('0x14')](_0x4171f6[_0x36c9('0x26')],'id');return _0x4171f6['removeOpenchannelInteractions'](_0x5827ce)['then'](function(){for(var _0x2ee4a8=0x0;_0x2ee4a8<_0x5827ce['length'];_0x2ee4a8+=0x1){_0x52fdf0[_0x36c9('0x46')]('user_has_openchannel_interactions:remove',{'OpenchannelInteractionId':Number(_0x5827ce[_0x2ee4a8]),'UserId':Number(_0x4171f6['id'])});}});}})[_0x36c9('0x4c')](function(_0x54bfd6){_0x567366[_0x36c9('0x4d')](_0x54bfd6);});}}function onDisconnect(_0x34ddee,_0x5daabb){joinOrLeave(_0x34ddee,'leave',_0x5daabb);}function onConnect(_0x22fce2){joinOrLeave(_0x22fce2,_0x36c9('0x4e'));}exports[_0x36c9('0x4f')]=function(_0x2184ab){_0x2184ab['on'](_0x36c9('0x50'),function(_0x53991a){_0x53991a[_0x36c9('0x51')](0x0);_0x53991a[_0x36c9('0x52')]=_0x53991a['request'][_0x36c9('0x50')][_0x36c9('0x53')]+':'+_0x53991a['request'][_0x36c9('0x50')][_0x36c9('0x54')];_0x53991a[_0x36c9('0x55')]=new Date();_0x53991a[_0x36c9('0x4d')]=function(_0xdbd4df){console[_0x36c9('0x4d')]('SocketIO\x20'+_0x53991a[_0x36c9('0x56')][_0x36c9('0x3')]+'['+_0x53991a[_0x36c9('0x52')]+']',_0xdbd4df);};_0x53991a['on'](_0x36c9('0x57'),function(){onDisconnect(_0x53991a,_0x2184ab);_0x53991a[_0x36c9('0x4d')]('DISCONNECTED');});onConnect(_0x53991a);_0x53991a[_0x36c9('0x4d')](_0x36c9('0x58'));});};
\ No newline at end of file
+var _0xbd9f=['default','connection','setMaxListeners','address','request','remoteAddress','remotePort','connectedAt','SocketIO\x20','nsp','disconnect','DISCONNECTED','CONNECTED','lodash','bluebird','name','User','agent','telephone','type','findOne','then','FaxQueues','SmsQueues','MailQueues','OpenchannelQueues','findAll','Telephones','IvrCampaigns','UserProfileResource','resourceId','map','where','Campaign','ivr','format','%s:queue:%s','Agents','length','user:%s','query','find','role','userProfileId','handshake','ChatInteraction','ChatInteractions','MailInteractions','FaxInteraction','FaxInteractions','SmsInteraction','SmsInteractions','OpenchannelInteraction','OpenchannelInteractions','admin','voice:inbound','include','push','VoiceQueue','ChatQueue','SmsQueue','MailQueue','Trunk','user','voice:outbound','VoiceQueues','ChatQueues','FaxQueue','Trunks','getVoiceQueues','getChatQueues','getFaxQueues','getSmsQueues','getMailQueues','all','voice','chat','sms','mail','openchannel','telephone:%s','trunk:%s','leave','removeChatInteractions','emit','user_has_chat_interactions:remove','user_has_mail_interactions:remove','removeSmsInteractions','user_has_sms_interactions:remove','removeOpenchannelInteractions','user_has_openchannel_interactions:remove','catch','log','join'];(function(_0x50d5ad,_0x61a6f){var _0x9f6ffc=function(_0x5764d5){while(--_0x5764d5){_0x50d5ad['push'](_0x50d5ad['shift']());}};_0x9f6ffc(++_0x61a6f);}(_0xbd9f,0x1e3));var _0xfbd9=function(_0x31ce0d,_0x3588fe){_0x31ce0d=_0x31ce0d-0x0;var _0x328b03=_0xbd9f[_0x31ce0d];return _0x328b03;};'use strict';var _=require(_0xfbd9('0x0'));var util=require('util');var BPromise=require(_0xfbd9('0x1'));var db=require('../mysqldb')['db'];var config=require('./environment');var queryQueues={'attributes':['id',_0xfbd9('0x2')],'include':[{'as':'Agents','model':db[_0xfbd9('0x3')],'attributes':['id',_0xfbd9('0x2'),'role'],'raw':!![],'where':{'role':_0xfbd9('0x4')},'required':![]}]};var queryTelephones={'raw':!![],'attributes':['id',_0xfbd9('0x2')],'where':{'role':_0xfbd9('0x5')}};var queryTrunks={'raw':!![],'attributes':['id','name']};var queryAgents={'raw':!![],'attributes':['id',_0xfbd9('0x2')],'where':{'role':_0xfbd9('0x4')}};var queryCampaigns={'raw':!![],'attributes':['id',_0xfbd9('0x2'),_0xfbd9('0x6')],'where':{'type':'ivr'}};function getAssociatedResources(_0x4b1543,_0x2b78f3,_0x13e0da){return db['UserProfileSection'][_0xfbd9('0x7')]({'where':{'name':_0x4b1543,'userProfileId':_0x2b78f3},'raw':!![]})[_0xfbd9('0x8')](function(_0xb9105){if(_0xb9105){if(_0xb9105['autoAssociation']){switch(_0x4b1543){case'VoiceQueues':case'ChatQueues':case _0xfbd9('0x9'):case _0xfbd9('0xa'):case _0xfbd9('0xb'):case _0xfbd9('0xc'):return db[_0x13e0da][_0xfbd9('0xd')](queryQueues);case _0xfbd9('0xe'):return db[_0x13e0da]['findAll'](queryTelephones);case'Trunks':return db[_0x13e0da][_0xfbd9('0xd')](queryTrunks);case _0xfbd9('0xf'):return db[_0x13e0da]['findAll'](queryCampaigns);}}else{return db[_0xfbd9('0x10')][_0xfbd9('0xd')]({'attributes':[_0xfbd9('0x11')],'where':{'sectionId':_0xb9105['id']},'raw':!![]})[_0xfbd9('0x8')](function(_0x14ed03){if(_0x14ed03){var _0xa92db3={'where':{'id':_[_0xfbd9('0x12')](_0x14ed03,_0xfbd9('0x11'))},'raw':!![]};switch(_0x13e0da){case _0xfbd9('0x3'):_0xa92db3[_0xfbd9('0x13')]['role']='telephone';break;case _0xfbd9('0x14'):_0xa92db3[_0xfbd9('0x13')][_0xfbd9('0x6')]=_0xfbd9('0x15');break;}return db[_0x13e0da][_0xfbd9('0xd')](_0xa92db3);}else{return[];}});}}else{return[];}})[_0xfbd9('0x8')](function(_0x214a5b){return _0x214a5b;});}function joinOrLeaveQueues(_0x1e5cc5,_0x53e8eb,_0x27dcc3,_0x4f7cb0){_0x1e5cc5[_0x53e8eb](util[_0xfbd9('0x16')](_0xfbd9('0x17'),_0x27dcc3,_0x4f7cb0[_0xfbd9('0x2')]));if(_0x4f7cb0[_0xfbd9('0x18')]){for(var _0x22149d=0x0;_0x22149d<_0x4f7cb0[_0xfbd9('0x18')][_0xfbd9('0x19')];_0x22149d+=0x1){_0x1e5cc5[_0x53e8eb](util['format'](_0xfbd9('0x1a'),_0x4f7cb0[_0xfbd9('0x18')][_0x22149d][_0xfbd9('0x2')]));}}}function joinOrLeave(_0x3bc70a,_0x1905d1,_0xf44bda){var _0x4ae481;if(_0x3bc70a['handshake'][_0xfbd9('0x1b')]['id']){db[_0xfbd9('0x3')][_0xfbd9('0x1c')]({'attributes':['id',_0xfbd9('0x2'),_0xfbd9('0x1d'),_0xfbd9('0x1e')],'where':{'id':_0x3bc70a[_0xfbd9('0x1f')][_0xfbd9('0x1b')]['id']},'include':[{'model':db[_0xfbd9('0x20')],'as':_0xfbd9('0x21'),'attributes':['id'],'raw':!![]},{'model':db['MailInteraction'],'as':_0xfbd9('0x22'),'attributes':['id'],'raw':!![]},{'model':db[_0xfbd9('0x23')],'as':_0xfbd9('0x24'),'attributes':['id'],'raw':!![]},{'model':db[_0xfbd9('0x25')],'as':_0xfbd9('0x26'),'attributes':['id'],'raw':!![]},{'model':db[_0xfbd9('0x27')],'as':_0xfbd9('0x28'),'attributes':['id'],'raw':!![]}]})[_0xfbd9('0x8')](function(_0x31670b){if(_0x31670b){_0x4ae481=_0x31670b;_0x3bc70a[_0x1905d1](util[_0xfbd9('0x16')]('user:%s',_0x31670b[_0xfbd9('0x2')]));var _0x1ff650=[];switch(_0x31670b[_0xfbd9('0x1d')]){case _0xfbd9('0x29'):_0x3bc70a[_0x1905d1](_0xfbd9('0x2a'));_0x3bc70a[_0x1905d1]('voice:outbound');if(queryQueues['hasOwnProperty'](_0xfbd9('0x2b'))){delete queryQueues['include'];}_0x1ff650[_0xfbd9('0x2c')](db[_0xfbd9('0x2d')][_0xfbd9('0xd')](queryQueues));_0x1ff650[_0xfbd9('0x2c')](db[_0xfbd9('0x2e')]['findAll'](queryQueues));_0x1ff650[_0xfbd9('0x2c')](db['FaxQueue'][_0xfbd9('0xd')](queryQueues));_0x1ff650['push'](db[_0xfbd9('0x2f')]['findAll'](queryQueues));_0x1ff650[_0xfbd9('0x2c')](db[_0xfbd9('0x30')][_0xfbd9('0xd')](queryQueues));_0x1ff650[_0xfbd9('0x2c')](db['OpenchannelQueue'][_0xfbd9('0xd')](queryQueues));_0x1ff650[_0xfbd9('0x2c')](db['User']['findAll'](queryTelephones));_0x1ff650[_0xfbd9('0x2c')](db[_0xfbd9('0x31')][_0xfbd9('0xd')](queryTrunks));_0x1ff650[_0xfbd9('0x2c')](db[_0xfbd9('0x14')][_0xfbd9('0xd')](queryCampaigns));_0x1ff650[_0xfbd9('0x2c')](db[_0xfbd9('0x3')]['findAll'](queryAgents));break;case _0xfbd9('0x32'):_0x3bc70a[_0x1905d1](_0xfbd9('0x2a'));_0x3bc70a[_0x1905d1](_0xfbd9('0x33'));_0x1ff650[_0xfbd9('0x2c')](getAssociatedResources(_0xfbd9('0x34'),_0x31670b[_0xfbd9('0x1e')],_0xfbd9('0x2d')));_0x1ff650[_0xfbd9('0x2c')](getAssociatedResources(_0xfbd9('0x35'),_0x31670b['userProfileId'],'ChatQueue'));_0x1ff650['push'](getAssociatedResources(_0xfbd9('0x9'),_0x31670b[_0xfbd9('0x1e')],_0xfbd9('0x36')));_0x1ff650[_0xfbd9('0x2c')](getAssociatedResources(_0xfbd9('0xa'),_0x31670b[_0xfbd9('0x1e')],_0xfbd9('0x2f')));_0x1ff650['push'](getAssociatedResources(_0xfbd9('0xb'),_0x31670b[_0xfbd9('0x1e')],_0xfbd9('0x30')));_0x1ff650[_0xfbd9('0x2c')](getAssociatedResources(_0xfbd9('0xc'),_0x31670b[_0xfbd9('0x1e')],'OpenchannelQueue'));_0x1ff650[_0xfbd9('0x2c')](getAssociatedResources(_0xfbd9('0xe'),_0x31670b['userProfileId'],_0xfbd9('0x3')));_0x1ff650[_0xfbd9('0x2c')](getAssociatedResources(_0xfbd9('0x37'),_0x31670b[_0xfbd9('0x1e')],_0xfbd9('0x31')));_0x1ff650[_0xfbd9('0x2c')](getAssociatedResources('IvrCampaigns',_0x31670b[_0xfbd9('0x1e')],_0xfbd9('0x14')));_0x1ff650[_0xfbd9('0x2c')](db[_0xfbd9('0x3')][_0xfbd9('0xd')](queryAgents));break;case _0xfbd9('0x4'):_0x3bc70a[_0x1905d1](_0xfbd9('0x2a'));_0x3bc70a[_0x1905d1]('voice:outbound');_0x1ff650[_0xfbd9('0x2c')](_0x31670b[_0xfbd9('0x38')]({'attributes':['id','name']}));_0x1ff650[_0xfbd9('0x2c')](_0x31670b[_0xfbd9('0x39')]({'attributes':['id',_0xfbd9('0x2')]}));_0x1ff650[_0xfbd9('0x2c')](_0x31670b[_0xfbd9('0x3a')]({'attributes':['id',_0xfbd9('0x2')]}));_0x1ff650[_0xfbd9('0x2c')](_0x31670b[_0xfbd9('0x3b')]({'attributes':['id','name']}));_0x1ff650['push'](_0x31670b[_0xfbd9('0x3c')]({'attributes':['id',_0xfbd9('0x2')]}));_0x1ff650[_0xfbd9('0x2c')](_0x31670b['getOpenchannelQueues']({'attributes':['id',_0xfbd9('0x2')]}));break;}return BPromise[_0xfbd9('0x3d')](_0x1ff650);}})[_0xfbd9('0x8')](function(_0x1f4e96){if(_0x1f4e96&&_0x1f4e96[_0xfbd9('0x19')]){for(var _0x4a51a8=0x0;_0x4a51a8<_0x1f4e96[_0xfbd9('0x19')];_0x4a51a8+=0x1){for(var _0x2e1f3b=0x0;_0x2e1f3b<_0x1f4e96[_0x4a51a8][_0xfbd9('0x19')];_0x2e1f3b+=0x1){switch(_0x4a51a8){case 0x0:joinOrLeaveQueues(_0x3bc70a,_0x1905d1,_0xfbd9('0x3e'),_0x1f4e96[_0x4a51a8][_0x2e1f3b]);break;case 0x1:joinOrLeaveQueues(_0x3bc70a,_0x1905d1,_0xfbd9('0x3f'),_0x1f4e96[_0x4a51a8][_0x2e1f3b]);break;case 0x2:joinOrLeaveQueues(_0x3bc70a,_0x1905d1,'fax',_0x1f4e96[_0x4a51a8][_0x2e1f3b]);break;case 0x3:joinOrLeaveQueues(_0x3bc70a,_0x1905d1,_0xfbd9('0x40'),_0x1f4e96[_0x4a51a8][_0x2e1f3b]);break;case 0x4:joinOrLeaveQueues(_0x3bc70a,_0x1905d1,_0xfbd9('0x41'),_0x1f4e96[_0x4a51a8][_0x2e1f3b]);break;case 0x5:joinOrLeaveQueues(_0x3bc70a,_0x1905d1,_0xfbd9('0x42'),_0x1f4e96[_0x4a51a8][_0x2e1f3b]);break;case 0x6:_0x3bc70a[_0x1905d1](util[_0xfbd9('0x16')](_0xfbd9('0x43'),_0x1f4e96[_0x4a51a8][_0x2e1f3b][_0xfbd9('0x2')]));break;case 0x7:_0x3bc70a[_0x1905d1](util[_0xfbd9('0x16')](_0xfbd9('0x44'),_0x1f4e96[_0x4a51a8][_0x2e1f3b][_0xfbd9('0x2')]));break;case 0x8:_0x3bc70a[_0x1905d1](util[_0xfbd9('0x16')]('campaign:%s:%s',_0x1f4e96[_0x4a51a8][_0x2e1f3b][_0xfbd9('0x6')],_0x1f4e96[_0x4a51a8][_0x2e1f3b][_0xfbd9('0x2')]));break;case 0x9:_0x3bc70a[_0x1905d1](util[_0xfbd9('0x16')]('user:%s',_0x1f4e96[_0x4a51a8][_0x2e1f3b][_0xfbd9('0x2')]));break;}}}}})[_0xfbd9('0x8')](function(){if(_0x1905d1===_0xfbd9('0x45')){var _0x351f88=_[_0xfbd9('0x12')](_0x4ae481[_0xfbd9('0x21')],'id');return _0x4ae481[_0xfbd9('0x46')](_0x351f88)[_0xfbd9('0x8')](function(){for(var _0x562b8d=0x0;_0x562b8d<_0x351f88[_0xfbd9('0x19')];_0x562b8d+=0x1){_0xf44bda[_0xfbd9('0x47')](_0xfbd9('0x48'),{'ChatInteractionId':Number(_0x351f88[_0x562b8d]),'UserId':Number(_0x4ae481['id'])});}});}})[_0xfbd9('0x8')](function(){if(_0x1905d1==='leave'){var _0x162cb8=_[_0xfbd9('0x12')](_0x4ae481[_0xfbd9('0x22')],'id');return _0x4ae481['removeMailInteractions'](_0x162cb8)[_0xfbd9('0x8')](function(){for(var _0x2908f5=0x0;_0x2908f5<_0x162cb8[_0xfbd9('0x19')];_0x2908f5+=0x1){_0xf44bda[_0xfbd9('0x47')](_0xfbd9('0x49'),{'MailInteractionId':Number(_0x162cb8[_0x2908f5]),'UserId':Number(_0x4ae481['id'])});}});}})[_0xfbd9('0x8')](function(){if(_0x1905d1==='leave'){var _0x533849=_[_0xfbd9('0x12')](_0x4ae481[_0xfbd9('0x24')],'id');return _0x4ae481['removeFaxInteractions'](_0x533849)[_0xfbd9('0x8')](function(){for(var _0x267e41=0x0;_0x267e41<_0x533849['length'];_0x267e41+=0x1){_0xf44bda[_0xfbd9('0x47')]('user_has_fax_interactions:remove',{'FaxInteractionId':Number(_0x533849[_0x267e41]),'UserId':Number(_0x4ae481['id'])});}});}})[_0xfbd9('0x8')](function(){if(_0x1905d1===_0xfbd9('0x45')){var _0x4c13d4=_[_0xfbd9('0x12')](_0x4ae481[_0xfbd9('0x26')],'id');return _0x4ae481[_0xfbd9('0x4a')](_0x4c13d4)[_0xfbd9('0x8')](function(){for(var _0x5a3a05=0x0;_0x5a3a05<_0x4c13d4[_0xfbd9('0x19')];_0x5a3a05+=0x1){_0xf44bda[_0xfbd9('0x47')](_0xfbd9('0x4b'),{'SmsInteractionId':Number(_0x4c13d4[_0x5a3a05]),'UserId':Number(_0x4ae481['id'])});}});}})[_0xfbd9('0x8')](function(){if(_0x1905d1==='leave'){var _0x2342c9=_['map'](_0x4ae481[_0xfbd9('0x28')],'id');return _0x4ae481[_0xfbd9('0x4c')](_0x2342c9)[_0xfbd9('0x8')](function(){for(var _0x39829f=0x0;_0x39829f<_0x2342c9['length'];_0x39829f+=0x1){_0xf44bda[_0xfbd9('0x47')](_0xfbd9('0x4d'),{'OpenchannelInteractionId':Number(_0x2342c9[_0x39829f]),'UserId':Number(_0x4ae481['id'])});}});}})[_0xfbd9('0x4e')](function(_0x472d49){_0x3bc70a[_0xfbd9('0x4f')](_0x472d49);});}}function onDisconnect(_0x13bf2b,_0x2d9446){joinOrLeave(_0x13bf2b,_0xfbd9('0x45'),_0x2d9446);}function onConnect(_0x59b77d){joinOrLeave(_0x59b77d,_0xfbd9('0x50'));}exports[_0xfbd9('0x51')]=function(_0x3a6cf0){_0x3a6cf0['on'](_0xfbd9('0x52'),function(_0x51e334){_0x51e334[_0xfbd9('0x53')](0x0);_0x51e334[_0xfbd9('0x54')]=_0x51e334[_0xfbd9('0x55')][_0xfbd9('0x52')][_0xfbd9('0x56')]+':'+_0x51e334[_0xfbd9('0x55')]['connection'][_0xfbd9('0x57')];_0x51e334[_0xfbd9('0x58')]=new Date();_0x51e334[_0xfbd9('0x4f')]=function(_0xe731fa){console[_0xfbd9('0x4f')](_0xfbd9('0x59')+_0x51e334[_0xfbd9('0x5a')][_0xfbd9('0x2')]+'['+_0x51e334['address']+']',_0xe731fa);};_0x51e334['on'](_0xfbd9('0x5b'),function(){onDisconnect(_0x51e334,_0x3a6cf0);_0x51e334['log'](_0xfbd9('0x5c'));});onConnect(_0x51e334);_0x51e334[_0xfbd9('0x4f')](_0xfbd9('0x5d'));});};
\ No newline at end of file
diff --git a/server/config/triggers/index.js b/server/config/triggers/index.js
index 0340fa2..81f826c 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 _0x049d=['error','code','Trigger,\x20%s','channel','event','UserId','User','find','format','SIP/%s','name','incomingmessage','outgoingmessage','get','changed','closed','catch','default','length','model','hook','callback','toLowerCase','condition','util','../../mysqldb','jayson/promise','../logger','triggers','client','http','ChatInteraction','afterCreate','closedinteraction','Chat','ChatMessage','newmessage','Sms','SmsInteraction','newinteraction','afterUpdate','FaxInteraction','Fax','FaxMessage','Mail','MailInteraction','Openchannel','OpenchannelInteraction','OpenchannelMessage','request','EventManager','then','info'];(function(_0x96b721,_0x3bf5dd){var _0x5bfea1=function(_0x467d98){while(--_0x467d98){_0x96b721['push'](_0x96b721['shift']());}};_0x5bfea1(++_0x3bf5dd);}(_0x049d,0x82));var _0xd049=function(_0x20a584,_0xe384a5){_0x20a584=_0x20a584-0x0;var _0x4b41a8=_0x049d[_0x20a584];return _0x4b41a8;};'use strict';var util=require(_0xd049('0x0'));var db=require(_0xd049('0x1'))['db'];var jayson=require(_0xd049('0x2'));var logger=require(_0xd049('0x3'))(_0xd049('0x4'));var client=jayson[_0xd049('0x5')][_0xd049('0x6')]({'port':0x232a});var triggers=[{'channel':'Chat','model':_0xd049('0x7'),'event':_0xd049('0x8'),'condition':'newinteraction','callback':afterCreate},{'channel':'Chat','model':_0xd049('0x7'),'event':'afterUpdate','condition':_0xd049('0x9'),'callback':afterUpdate},{'channel':_0xd049('0xa'),'model':_0xd049('0xb'),'event':'afterCreate','condition':_0xd049('0xc'),'callback':afterCreateMessage},{'channel':_0xd049('0xd'),'model':_0xd049('0xe'),'event':_0xd049('0x8'),'condition':_0xd049('0xf'),'callback':afterCreate},{'channel':_0xd049('0xd'),'model':_0xd049('0xe'),'event':_0xd049('0x10'),'condition':_0xd049('0x9'),'callback':afterUpdate},{'channel':_0xd049('0xd'),'model':'SmsMessage','event':_0xd049('0x8'),'condition':_0xd049('0xc'),'callback':afterCreateMessage},{'channel':'Fax','model':_0xd049('0x11'),'event':_0xd049('0x8'),'condition':_0xd049('0xf'),'callback':afterCreate},{'channel':'Fax','model':_0xd049('0x11'),'event':_0xd049('0x10'),'condition':_0xd049('0x9'),'callback':afterUpdate},{'channel':_0xd049('0x12'),'model':_0xd049('0x13'),'event':'afterCreate','condition':_0xd049('0xc'),'callback':afterCreateMessage},{'channel':'Mail','model':'MailInteraction','event':_0xd049('0x8'),'condition':_0xd049('0xf'),'callback':afterCreate},{'channel':_0xd049('0x14'),'model':_0xd049('0x15'),'event':'afterUpdate','condition':'closedinteraction','callback':afterUpdate},{'channel':_0xd049('0x14'),'model':'MailMessage','event':_0xd049('0x8'),'condition':_0xd049('0xc'),'callback':afterCreateMessage},{'channel':_0xd049('0x16'),'model':_0xd049('0x17'),'event':_0xd049('0x8'),'condition':_0xd049('0xf'),'callback':afterCreate},{'channel':_0xd049('0x16'),'model':_0xd049('0x17'),'event':_0xd049('0x10'),'condition':_0xd049('0x9'),'callback':afterUpdate},{'channel':'Openchannel','model':_0xd049('0x18'),'event':'afterCreate','condition':'newmessage','callback':afterCreateMessage}];function request(_0x1f95d3){return client[_0xd049('0x19')](_0xd049('0x1a'),_0x1f95d3)[_0xd049('0x1b')](function(_0x519a68){logger[_0xd049('0x1c')]('Trigger,\x20%s',_0xd049('0x1a'),_0x519a68);if(_0x519a68[_0xd049('0x1d')]){if(_0x519a68[_0xd049('0x1d')][_0xd049('0x1e')]===0x1f4){logger['error']('Trigger,\x20%s',_0xd049('0x1a'),_0x519a68['error']);}}})['catch'](function(_0x467f49){logger[_0xd049('0x1d')](_0xd049('0x1f'),_0xd049('0x1a'),_0x467f49);});}function afterCreateMessage(_0x1397b4,_0xc56c3c){return function(_0x486001,_0x1a39bd){_0x486001=_0x486001['get']({'plain':!![]});_0x486001[_0xd049('0x20')]=_0x1397b4;_0x486001[_0xd049('0x21')]=_0x486001['direction'];if(_0x486001[_0xd049('0x22')]){return db[_0xd049('0x23')][_0xd049('0x24')]({'where':{'id':_0x486001[_0xd049('0x22')]},'attributes':['id','name'],'raw':!![]})[_0xd049('0x1b')](function(_0x4b228a){_0x486001['interface']=util[_0xd049('0x25')](_0xd049('0x26'),_0x4b228a[_0xd049('0x27')]);_0x486001[_0xd049('0x20')]=_0x1397b4;return request({'event':_0xd049('0x28'),'message':_0x486001});})['catch'](function(_0x544a00){console[_0xd049('0x1d')](_0x544a00);});}else{return request({'event':_0xd049('0x29'),'message':_0x486001});}};}function afterCreate(_0x3ab626,_0xfa1fe7){return function(_0x35368c,_0x1f2ecd){_0x35368c=_0x35368c[_0xd049('0x2a')]({'plain':!![]});_0x35368c['channel']=_0x3ab626;_0x35368c[_0xd049('0x21')]='opened';return request({'event':_0xfa1fe7,'message':_0x35368c});};}function afterUpdate(_0x1e960d,_0x5e0aea){return function(_0x41b9d7,_0x26e69a){if(_0x41b9d7[_0xd049('0x2b')](_0xd049('0x2c'))&&_0x41b9d7['closed']){_0x41b9d7=_0x41b9d7[_0xd049('0x2a')]({'plain':!![]});_0x41b9d7['channel']=_0x1e960d;_0x41b9d7[_0xd049('0x21')]=_0xd049('0x2c');if(_0x41b9d7['UserId']){return db['User'][_0xd049('0x24')]({'where':{'id':_0x41b9d7[_0xd049('0x22')]},'attributes':['id',_0xd049('0x27')],'raw':!![]})[_0xd049('0x1b')](function(_0x24e40d){_0x41b9d7['interface']=util[_0xd049('0x25')](_0xd049('0x26'),_0x24e40d[_0xd049('0x27')]);return request({'event':_0x5e0aea,'message':_0x41b9d7});})[_0xd049('0x2d')](function(_0xcf3248){console[_0xd049('0x1d')](_0xcf3248);});}else{return request({'event':_0x5e0aea,'message':_0x41b9d7});}}};}exports[_0xd049('0x2e')]=function(){for(var _0x52df72=0x0;_0x52df72=_0x24a624[_0xaec5('0x16')]){throw Error(_0xaec5('0x17'));}_0x2a89a5(_0x581581);})[_0xaec5('0x18')](function(_0x1d30ee){_0x1646cd(_0x1d30ee);});});};
\ No newline at end of file
+var _0x8319=['count','then','agents','catch','bluebird','../mysqldb','./license/util','voice','chat','fax','sms','openchannel','getChannels','isValidChannel','toLowerCase','clearBlockUser','isUndefined','blockedAt','updateAttributes','getLicense','agent','User'];(function(_0x8a969d,_0x339d9f){var _0x1d8dc7=function(_0x283ec0){while(--_0x283ec0){_0x8a969d['push'](_0x8a969d['shift']());}};_0x1d8dc7(++_0x339d9f);}(_0x8319,0xca));var _0x9831=function(_0x451baa,_0x3d605d){_0x451baa=_0x451baa-0x0;var _0xeae1d4=_0x8319[_0x451baa];return _0xeae1d4;};'use strict';var _=require('lodash');var BPromise=require(_0x9831('0x0'));var db=require(_0x9831('0x1'))['db'];var util=require(_0x9831('0x2'));var channels=[_0x9831('0x3'),'mail',_0x9831('0x4'),_0x9831('0x5'),_0x9831('0x6'),_0x9831('0x7')];exports[_0x9831('0x8')]=function(){return channels;};exports[_0x9831('0x9')]=function(_0x56d655){_0x56d655=_0x56d655[_0x9831('0xa')]();return _['includes'](channels,_0x56d655);};exports[_0x9831('0xb')]=function(_0x505b3d,_0x3bcc39,_0xd62de,_0x147f2d){var _0x1de570={'loginAttempts':_0x3bcc39,'blocked':_0xd62de};if(!_[_0x9831('0xc')](_0x147f2d)){_0x1de570[_0x9831('0xd')]=_0x147f2d;}return _0x505b3d[_0x9831('0xe')](_0x1de570);};exports[_0x9831('0xf')]=function(_0x3a4422){return new BPromise(function(_0x1fe155,_0x5464fc){var _0x3aa4ea=0x0;if(_0x3a4422['role']!==_0x9831('0x10')){_0x1fe155(_0x3a4422);}db[_0x9831('0x11')][_0x9831('0x12')]({'where':{'role':_0x9831('0x10'),'online':!![],'id':{'$ne':_0x3a4422['id']}}})['then'](function(_0x4111dc){_0x3aa4ea=_0x4111dc;return util[_0x9831('0xf')]();})[_0x9831('0x13')](function(_0x51fd76){if(_0x51fd76&&_0x51fd76['agents']&&_0x3aa4ea>=_0x51fd76[_0x9831('0x14')]){throw Error('Maximum\x20login\x20has\x20been\x20reached');}_0x1fe155(_0x3a4422);})[_0x9831('0x15')](function(_0x334284){_0x5464fc(_0x334284);});});};
\ No newline at end of file
diff --git a/server/errors/index.js b/server/errors/index.js
index a37fa2b..d6711b2 100644
--- a/server/errors/index.js
+++ b/server/errors/index.js
@@ -15,4 +15,4 @@
// * treaties. The SOFTWARE PRODUCT is licensed, not sold. *
// * *
// *************************************************************************
-var _0x971f=['send','exports','404','status','render','json'];(function(_0x236a8b,_0x57e028){var _0xccf470=function(_0x387ebb){while(--_0x387ebb){_0x236a8b['push'](_0x236a8b['shift']());}};_0xccf470(++_0x57e028);}(_0x971f,0x1cf));var _0xf971=function(_0x5cfa59,_0xa6d95f){_0x5cfa59=_0x5cfa59-0x0;var _0x9cb464=_0x971f[_0x5cfa59];return _0x9cb464;};'use strict';module[_0xf971('0x0')][0x194]=function pageNotFound(_0x4df71f,_0x57461b){var _0x1d9c23=_0xf971('0x1');var _0x539e21=0x194;var _0x56c818={'status':_0x539e21};_0x57461b[_0xf971('0x2')](_0x56c818[_0xf971('0x2')]);_0x57461b[_0xf971('0x3')](_0x1d9c23,{},function(_0x4fde29,_0x12631f){if(_0x4fde29){return _0x57461b[_0xf971('0x2')](_0x56c818[_0xf971('0x2')])[_0xf971('0x4')](_0x56c818);}_0x57461b[_0xf971('0x5')](_0x12631f);});};
\ No newline at end of file
+var _0x60f8=['render','json','send','404','status'];(function(_0x184268,_0x5572bd){var _0x2e6086=function(_0x3c62f9){while(--_0x3c62f9){_0x184268['push'](_0x184268['shift']());}};_0x2e6086(++_0x5572bd);}(_0x60f8,0x148));var _0x860f=function(_0x48b2cb,_0x5da5e7){_0x48b2cb=_0x48b2cb-0x0;var _0x3ad90f=_0x60f8[_0x48b2cb];return _0x3ad90f;};'use strict';module['exports'][0x194]=function pageNotFound(_0x34a06c,_0xda1832){var _0x17a9b8=_0x860f('0x0');var _0x18d19f=0x194;var _0x103920={'status':_0x18d19f};_0xda1832[_0x860f('0x1')](_0x103920[_0x860f('0x1')]);_0xda1832[_0x860f('0x2')](_0x17a9b8,{},function(_0x41d0bb,_0xe202f6){if(_0x41d0bb){return _0xda1832[_0x860f('0x1')](_0x103920['status'])[_0x860f('0x3')](_0x103920);}_0xda1832[_0x860f('0x4')](_0xe202f6);});};
\ No newline at end of file
diff --git a/server/mysqldb/index.js b/server/mysqldb/index.js
index 87bdd5c..027d655 100644
--- a/server/mysqldb/index.js
+++ b/server/mysqldb/index.js
@@ -15,4 +15,4 @@
// * treaties. The SOFTWARE PRODUCT is licensed, not sold. *
// * *
// *************************************************************************
-var _0xe049=['ToMailQueueId','ToQueue','ToMailAccountId','FromChatWebsiteId','FromAccount','ToUserId','ToChatQueueId','ToChatWebsiteId','FromFaxAccountId','FromUserId','ToAgent','ToFaxQueueId','ToFaxAccountId','OpenchannelTransferReport','FromOpenchannelAccountId','ToOpenchannelQueueId','ToAccount','SmsTransferReport','ToSmsQueueId','ToSmsAccountId','CustomFields','HopperHistory','Queues','cm_user_has_lists','UserProfileSections','exports','path','../config/environment','sequelize','lodash','jstz','determine','defaultsDeep','motion2','xC@LL1234','127.0.0.1','utf8mb4','name','utf8','utf8_general_ci','sequelizeHistory','mysql','database','password','options','User','import','../api/user/user.model','VoiceChanSpy','VoiceContext','../api/voiceExtension/voiceExtension.model','../api/voiceMusicOnHold/voiceMusicOnHold.model','VoiceQueue','../api/voiceQueue/voiceQueue.model','VoiceRecording','ScreenRecording','VoiceMail','VoiceMailMessage','../api/voiceMailMessage/voiceMailMessage.model','VoiceCallReport','../api/voiceCallReport/voiceCallReport.model','VoiceDialReport','../api/voiceDialReport/voiceDialReport.model','VoiceAgentReport','../api/voiceAgentReport/voiceAgentReport.model','VoiceQueueReport','../api/voiceQueueReport/voiceQueueReport.model','MemberReport','../api/memberReport/memberReport.model','Trunk','../api/trunk/trunk.model','../api/voiceTransferReport/voiceTransferReport.model','UserVoiceQueueRt','UserVoiceQueue','../api/userVoiceQueue/userVoiceQueue.model','UserChatQueue','../api/userChatQueue/userChatQueue.model','UserMailQueue','../api/userMailQueue/userMailQueue.model','UserFaxQueue','../api/userFaxQueue/userFaxQueue.model','../api/userSmsQueue/userSmsQueue.model','UserOpenchannelQueue','../api/userOpenchannelQueue/userOpenchannelQueue.model','MailServerIn','../api/mailServerIn/mailServerIn.model','MailServerOut','../api/mailServerOut/mailServerOut.model','MailAccount','MailQueue','MailSubstatus','../api/mailSubstatus/mailSubstatus.model','MailInteraction','../api/mailInteraction/mailInteraction.model','MailMessage','../api/mailMessage/mailMessage.model','MailApplication','../api/mailApplication/mailApplication.model','../api/mailQueueReport/mailQueueReport.model','Dashboard','../api/dashboard/dashboard.model','DashboardItem','FaxAccount','../api/faxAccount/faxAccount.model','../api/faxApplication/faxApplication.model','FaxInteraction','../api/faxInteraction/faxInteraction.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','../api/smsQueue/smsQueue.model','../api/openchannelAccount/openchannelAccount.model','../api/openchannelApplication/openchannelApplication.model','OpenchannelInteraction','OpenchannelMessage','../api/openchannelQueue/openchannelQueue.model','OpenchannelQueueReport','../api/openchannelQueueReport/openchannelQueueReport.model','ChatApplication','ChatInteraction','../api/chatInteraction/chatInteraction.model','ChatMessage','../api/chatMessage/chatMessage.model','../api/chatOfflineMessage/chatOfflineMessage.model','ChatQueue','../api/chatQueue/chatQueue.model','ChatProactiveAction','../api/chatProactiveAction/chatProactiveAction.model','../api/cmCompany/cmCompany.model','../api/cmContact/cmContact.model','../api/cmHopper/cmHopper.model','../api/cmHopperBlack/cmHopperBlack.model','CmHopperFinal','ReportAgentPreview','CmCustomField','../api/cmCustomField/cmCustomField.model','Action','../api/action/action.model','Automation','CannedAnswer','../api/cannedAnswer/cannedAnswer.model','Disposition','../api/disposition/disposition.model','Condition','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','Sound','../api/sound/sound.model','../api/tag/tag.model','Template','Trigger','../api/trigger/trigger.model','../api/variable/variable.model','Integration','../api/integration/integration.model','../api/integrationReport/integrationReport.model','AnalyticCustomReport','../api/analyticCustomReport/analyticCustomReport.model','AnalyticExtractedReport','../api/analyticExtractedReport/analyticExtractedReport.model','AnalyticMetric','../api/analyticMetric/analyticMetric.model','../api/analyticTreeReport/analyticTreeReport.model','SalesforceAccount','../api/intSalesforceAccount/intSalesforceAccount.model','SalesforceConfiguration','../api/intSalesforceConfiguration/intSalesforceConfiguration.model','SalesforceField','../api/intSalesforceField/intSalesforceField.model','SugarcrmAccount','../api/intSugarcrmAccount/intSugarcrmAccount.model','SugarcrmConfiguration','../api/intSugarcrmConfiguration/intSugarcrmConfiguration.model','SugarcrmField','../api/intSugarcrmField/intSugarcrmField.model','DeskAccount','../api/intDeskAccount/intDeskAccount.model','DeskConfiguration','../api/intDeskConfiguration/intDeskConfiguration.model','DeskField','../api/intDeskField/intDeskField.model','ZohoAccount','../api/intZohoAccount/intZohoAccount.model','ZohoConfiguration','../api/intZohoConfiguration/intZohoConfiguration.model','../api/intZohoField/intZohoField.model','ZendeskAccount','../api/intZendeskAccount/intZendeskAccount.model','ZendeskConfiguration','../api/intZendeskConfiguration/intZendeskConfiguration.model','FreshdeskAccount','../api/intFreshdeskAccount/intFreshdeskAccount.model','FreshdeskConfiguration','../api/intFreshdeskConfiguration/intFreshdeskConfiguration.model','../api/intFreshdeskField/intFreshdeskField.model','VtigerAccount','VtigerConfiguration','VtigerField','../api/intVtigerField/intVtigerField.model','ServicenowAccount','../api/intServicenowAccount/intServicenowAccount.model','../api/intServicenowConfiguration/intServicenowConfiguration.model','../api/intServicenowField/intServicenowField.model','Dynamics365Account','../api/intDynamics365Account/intDynamics365Account.model','Dynamics365Configuration','../api/intDynamics365Configuration/intDynamics365Configuration.model','Dynamics365Field','../api/intDynamics365Field/intDynamics365Field.model','FreshsalesAccount','../api/intFreshsalesAccount/intFreshsalesAccount.model','FreshsalesConfiguration','FreshsalesField','../api/network/network.model','../api/chatQueueReport/chatQueueReport.model','ChatInternalMessage','JscriptyAnswerReport','../api/jscriptyAnswerReport/jscriptyAnswerReport.model','JscriptyQuestionReport','../api/jscriptyQuestionReport/jscriptyQuestionReport.model','JscriptySessionReport','../api/jscriptySessionReport/jscriptySessionReport.model','../api/smsQueueReport/smsQueueReport.model','SquareReport','../api/squareReport/squareReport.model','SquareDetailsReport','../api/squareReportDetail/squareReportDetail.model','../api/jscriptyProject/jscriptyProject.model','Setting','../api/setting/setting.model','SquareOdbc','../api/squareOdbc/squareOdbc.model','SquareProject','SquareRecording','../api/squareRecording/squareRecording.model','../api/squareMessage/squareMessage.model','../api/team/team.model','License','Campaign','../api/campaign/campaign.model','../api/migration/migration.model','../api/attachment/attachment.model','Plugin','../api/plugin/plugin.model','ChatTransferReport','../api/chatTransferReport/chatTransferReport.model','FaxTransferReport','../api/faxTransferReport/faxTransferReport.model','VoicePrefix','../api/voicePrefix/voicePrefix.model','UserProfile','../api/userProfile/userProfile.model','UserProfileSection','../api/userProfileSection/userProfileSection.model','UserProfileResource','../api/userProfileResource/userProfileResource.model','hasOne','cascade','UserId','Recordings','hasMany','VoiceQueuesRt','VoiceExtension','HopperFinals','CmHopperHistory','OpenchannelInteractions','ChatInteractions','SmsInteraction','FaxInteractions','userProfileId','belongsToMany','ChatGroup','chat_group_has_users','CmContact','Contacts','cm_user_has_contacts','Team','user_has_teams','MailInteractions','user_has_fax_interactions','user_has_sms_interactions','VoiceQueues','MailQueues','ChatQueues','FaxQueues','SmsQueues','UserSmsQueue','OpenchannelQueue','CmList','VoicePrefixes','user_has_voice_prefixes','ChatWebsite','ChatWebsites','user_has_chat_websites','FaxAccounts','MailAccounts','user_has_mail_accounts','OpenchannelAccount','OpenchannelAccounts','user_has_openchannel_accounts','SmsAccounts','user_has_sms_accounts','SquareProjects','user_has_square_projects','SpiedAgents','ChanSpyId','moh_has_sounds','Members','VoiceQueueId','CmHopper','Hoppers','HopperHistories','CmHopperBlack','HopperBlacks','JscriptySessions','belongsTo','TrunkId','TrunkBackupId','mandatoryDispositionPause','Lists','voice_queues_has_cm_lists','team_has_voice_queues','BlackLists','voice_queues_has_cm_blacklists','Messages','mailbox','mailboxuser','QueueCalls','AgentReports','uniqueid','MailAccountId','Imap','Smtp','Dispositions','Interactions','Applications','ListId','Agents','Teams','Account','Contact','ContactId','Owner','Tag','Tags','mail_interaction_has_tags','Users','user_has_mail_interactions','MailInteractionId','Attachment','Attachments','Interaction','restrict','IntervalId','TagId','MailQueueReport','List','Items','FaxAccountId','Answers','FaxApplication','Exntensions','mandatoryDispositionPauseId','user_has_fax_accounts','FaxInteractionId','fax_interaction_has_tags','team_has_fax_queues','SmsAccount','SmsAccountId','sms_interaction_has_tags','SmsInteractionId','OpenchannelAccountId','OpenchannelApplication','OpenchannelQueueId','OpenchannelInteractionId','openchannel_interaction_has_tags','ThroughTags','user_has_openchannel_interactions','AttachmentId','team_has_openchannel_queues','ChatWebsiteId','Agent','ChatQueueId','ChatInteractionId','chat_interaction_has_tags','user_has_chat_interactions','ChatOfflineMessage','team_has_chat_queues','ChatGroupId','CmCompany','CompanyId','SmsInteractions','Company','cm_contact_has_tags','OwnerId','Queue','All','OneAll','AutomationAllId','Any','OneAny','AutomationAnyId','Actions','AutomationId','Intervals','Extensions','FaxApplications','AnalyticDefaultReport','DefaultReportId','CustomReportId','AllConditions','AllCondition','TriggerAllId','AnyConditions','AnyCondition','TriggerAnyId','TriggerId','AnalyticFieldReport','Fields','MetricId','Configurations','AccountId','SubjectId','Descriptions','DescriptionId','FieldId','Subject','Description','Field','Subjects','VariableId','int_desk_configuration_has_tags','Variable','ZohoField','ZendeskField','FreshdeskField','ServicenowConfiguration','ServicenowField','ChatQueueReport','FromId','ToId','SessionId','SmsQueueReport','JscriptyProject','ProjectId','team_has_mail_queues','team_has_sms_queues','OpenchannelQueues','CampaignId','TrunkBackup','campaigns_has_cm_lists','MailTransferReport','FromAgent'];(function(_0x3dd15e,_0x1f0015){var _0x231fd0=function(_0x4f680a){while(--_0x4f680a){_0x3dd15e['push'](_0x3dd15e['shift']());}};_0x231fd0(++_0x1f0015);}(_0xe049,0x1f1));var _0x9e04=function(_0x413feb,_0x10477f){_0x413feb=_0x413feb-0x0;var _0x40ee88=_0xe049[_0x413feb];return _0x40ee88;};'use strict';var path=require(_0x9e04('0x0'));var config=require(_0x9e04('0x1'));var Sequelize=require(_0x9e04('0x2'));var _=require(_0x9e04('0x3'));var jstz=require(_0x9e04('0x4'));var timezone=jstz[_0x9e04('0x5')]();config[_0x9e04('0x2')]=_[_0x9e04('0x6')](config[_0x9e04('0x2')],{'database':_0x9e04('0x7'),'username':'xcall','password':_0x9e04('0x8'),'options':{'host':_0x9e04('0x9'),'port':0xcea,'dialect':'mysql','dialectOptions':{'charset':_0x9e04('0xa')},'logging':![],'timezone':timezone[_0x9e04('0xb')](),'define':{'charset':_0x9e04('0xc'),'collate':_0x9e04('0xd')}}});config[_0x9e04('0xe')]=_[_0x9e04('0x6')](config[_0x9e04('0xe')],{'database':_0x9e04('0x7'),'username':'xcall','password':_0x9e04('0x8'),'options':{'host':'127.0.0.1','port':0xcea,'dialect':_0x9e04('0xf'),'dialectOptions':{'charset':_0x9e04('0xa')},'logging':![],'timezone':timezone[_0x9e04('0xb')](),'define':{'charset':_0x9e04('0xc'),'collate':_0x9e04('0xd')}}});var db={'Sequelize':Sequelize,'sequelize':new Sequelize(config['sequelize'][_0x9e04('0x10')],config[_0x9e04('0x2')]['username'],config[_0x9e04('0x2')][_0x9e04('0x11')],config[_0x9e04('0x2')][_0x9e04('0x12')])};var dbH={'Sequelize':Sequelize,'sequelize':new Sequelize(config['sequelizeHistory']['database'],config[_0x9e04('0xe')]['username'],config['sequelizeHistory'][_0x9e04('0x11')],config[_0x9e04('0xe')][_0x9e04('0x12')])};db[_0x9e04('0x13')]=db[_0x9e04('0x2')][_0x9e04('0x14')](_0x9e04('0x15'));db[_0x9e04('0x16')]=db[_0x9e04('0x2')][_0x9e04('0x14')]('../api/voiceChanSpy/voiceChanSpy.model');db[_0x9e04('0x17')]=db[_0x9e04('0x2')][_0x9e04('0x14')]('../api/voiceContext/voiceContext.model');db['VoiceExtension']=db['sequelize'][_0x9e04('0x14')](_0x9e04('0x18'));db['VoiceMusicOnHold']=db[_0x9e04('0x2')][_0x9e04('0x14')](_0x9e04('0x19'));db[_0x9e04('0x1a')]=db[_0x9e04('0x2')]['import'](_0x9e04('0x1b'));db[_0x9e04('0x1c')]=db['sequelize']['import']('../api/voiceRecording/voiceRecording.model');db[_0x9e04('0x1d')]=db[_0x9e04('0x2')][_0x9e04('0x14')]('../api/screenRecording/screenRecording.model');db[_0x9e04('0x1e')]=db[_0x9e04('0x2')][_0x9e04('0x14')]('../api/voiceMail/voiceMail.model');db[_0x9e04('0x1f')]=db[_0x9e04('0x2')][_0x9e04('0x14')](_0x9e04('0x20'));db[_0x9e04('0x21')]=db['sequelize'][_0x9e04('0x14')](_0x9e04('0x22'));db[_0x9e04('0x23')]=db[_0x9e04('0x2')][_0x9e04('0x14')](_0x9e04('0x24'));db[_0x9e04('0x25')]=db[_0x9e04('0x2')][_0x9e04('0x14')](_0x9e04('0x26'));db[_0x9e04('0x27')]=db[_0x9e04('0x2')][_0x9e04('0x14')](_0x9e04('0x28'));db[_0x9e04('0x29')]=db[_0x9e04('0x2')][_0x9e04('0x14')](_0x9e04('0x2a'));db[_0x9e04('0x2b')]=db['sequelize'][_0x9e04('0x14')](_0x9e04('0x2c'));db['VoiceTransferReport']=db[_0x9e04('0x2')][_0x9e04('0x14')](_0x9e04('0x2d'));db[_0x9e04('0x2e')]=db[_0x9e04('0x2')][_0x9e04('0x14')]('../api/userVoiceQueueRt/userVoiceQueueRt.model');db[_0x9e04('0x2f')]=db[_0x9e04('0x2')][_0x9e04('0x14')](_0x9e04('0x30'));db[_0x9e04('0x31')]=db['sequelize'][_0x9e04('0x14')](_0x9e04('0x32'));db[_0x9e04('0x33')]=db[_0x9e04('0x2')]['import'](_0x9e04('0x34'));db[_0x9e04('0x35')]=db['sequelize'][_0x9e04('0x14')](_0x9e04('0x36'));db['UserSmsQueue']=db[_0x9e04('0x2')][_0x9e04('0x14')](_0x9e04('0x37'));db[_0x9e04('0x38')]=db[_0x9e04('0x2')]['import'](_0x9e04('0x39'));db[_0x9e04('0x3a')]=db['sequelize'][_0x9e04('0x14')](_0x9e04('0x3b'));db[_0x9e04('0x3c')]=db['sequelize']['import'](_0x9e04('0x3d'));db[_0x9e04('0x3e')]=db['sequelize'][_0x9e04('0x14')]('../api/mailAccount/mailAccount.model');db[_0x9e04('0x3f')]=db[_0x9e04('0x2')][_0x9e04('0x14')]('../api/mailQueue/mailQueue.model');db[_0x9e04('0x40')]=db[_0x9e04('0x2')][_0x9e04('0x14')](_0x9e04('0x41'));db[_0x9e04('0x42')]=db['sequelize']['import'](_0x9e04('0x43'));db[_0x9e04('0x44')]=db[_0x9e04('0x2')][_0x9e04('0x14')](_0x9e04('0x45'));db[_0x9e04('0x46')]=db[_0x9e04('0x2')][_0x9e04('0x14')](_0x9e04('0x47'));db['MailQueueReport']=db[_0x9e04('0x2')]['import'](_0x9e04('0x48'));db[_0x9e04('0x49')]=db[_0x9e04('0x2')]['import'](_0x9e04('0x4a'));db[_0x9e04('0x4b')]=db[_0x9e04('0x2')]['import']('../api/dashboardItem/dashboardItem.model');db[_0x9e04('0x4c')]=db['sequelize'][_0x9e04('0x14')](_0x9e04('0x4d'));db['FaxApplication']=db[_0x9e04('0x2')][_0x9e04('0x14')](_0x9e04('0x4e'));db[_0x9e04('0x4f')]=db[_0x9e04('0x2')][_0x9e04('0x14')](_0x9e04('0x50'));db[_0x9e04('0x51')]=db[_0x9e04('0x2')][_0x9e04('0x14')](_0x9e04('0x52'));db[_0x9e04('0x53')]=db['sequelize'][_0x9e04('0x14')](_0x9e04('0x54'));db[_0x9e04('0x55')]=db[_0x9e04('0x2')][_0x9e04('0x14')](_0x9e04('0x56'));db['SmsAccount']=db[_0x9e04('0x2')][_0x9e04('0x14')](_0x9e04('0x57'));db[_0x9e04('0x58')]=db[_0x9e04('0x2')][_0x9e04('0x14')](_0x9e04('0x59'));db['SmsInteraction']=db[_0x9e04('0x2')][_0x9e04('0x14')](_0x9e04('0x5a'));db[_0x9e04('0x5b')]=db['sequelize']['import'](_0x9e04('0x5c'));db[_0x9e04('0x5d')]=db[_0x9e04('0x2')][_0x9e04('0x14')](_0x9e04('0x5e'));db['OpenchannelAccount']=db[_0x9e04('0x2')][_0x9e04('0x14')](_0x9e04('0x5f'));db['OpenchannelApplication']=db[_0x9e04('0x2')][_0x9e04('0x14')](_0x9e04('0x60'));db[_0x9e04('0x61')]=db[_0x9e04('0x2')]['import']('../api/openchannelInteraction/openchannelInteraction.model');db[_0x9e04('0x62')]=db[_0x9e04('0x2')][_0x9e04('0x14')]('../api/openchannelMessage/openchannelMessage.model');db['OpenchannelQueue']=db[_0x9e04('0x2')][_0x9e04('0x14')](_0x9e04('0x63'));db['ChatWebsite']=db['sequelize'][_0x9e04('0x14')]('../api/chatWebsite/chatWebsite.model');db[_0x9e04('0x64')]=db[_0x9e04('0x2')][_0x9e04('0x14')](_0x9e04('0x65'));db[_0x9e04('0x66')]=db[_0x9e04('0x2')][_0x9e04('0x14')]('../api/chatApplication/chatApplication.model');db[_0x9e04('0x67')]=db[_0x9e04('0x2')][_0x9e04('0x14')](_0x9e04('0x68'));db[_0x9e04('0x69')]=db['sequelize'][_0x9e04('0x14')](_0x9e04('0x6a'));db['ChatOfflineMessage']=db['sequelize'][_0x9e04('0x14')](_0x9e04('0x6b'));db[_0x9e04('0x6c')]=db[_0x9e04('0x2')]['import'](_0x9e04('0x6d'));db['ChatGroup']=db['sequelize'][_0x9e04('0x14')]('../api/chatGroup/chatGroup.model');db[_0x9e04('0x6e')]=db[_0x9e04('0x2')][_0x9e04('0x14')](_0x9e04('0x6f'));db['CmCompany']=db[_0x9e04('0x2')][_0x9e04('0x14')](_0x9e04('0x70'));db['CmContact']=db[_0x9e04('0x2')][_0x9e04('0x14')](_0x9e04('0x71'));db['CmHopper']=db[_0x9e04('0x2')][_0x9e04('0x14')](_0x9e04('0x72'));db['CmHopperBlack']=db['sequelize']['import'](_0x9e04('0x73'));db[_0x9e04('0x74')]=db['sequelize'][_0x9e04('0x14')]('../api/cmHopperFinal/cmHopperFinal.model');db['CmHopperHistory']=db[_0x9e04('0x2')][_0x9e04('0x14')]('../api/cmHopperHistory/cmHopperHistory.model');db[_0x9e04('0x75')]=db['sequelize'][_0x9e04('0x14')]('../api/reportAgentPreview/reportAgentPreview.model');db[_0x9e04('0x76')]=db[_0x9e04('0x2')][_0x9e04('0x14')](_0x9e04('0x77'));db[_0x9e04('0x78')]=db[_0x9e04('0x2')][_0x9e04('0x14')](_0x9e04('0x79'));db[_0x9e04('0x7a')]=db['sequelize'][_0x9e04('0x14')]('../api/automation/automation.model');db[_0x9e04('0x7b')]=db[_0x9e04('0x2')][_0x9e04('0x14')](_0x9e04('0x7c'));db[_0x9e04('0x7d')]=db[_0x9e04('0x2')][_0x9e04('0x14')](_0x9e04('0x7e'));db[_0x9e04('0x7f')]=db[_0x9e04('0x2')]['import']('../api/condition/condition.model');db[_0x9e04('0x80')]=db[_0x9e04('0x2')][_0x9e04('0x14')](_0x9e04('0x81'));db[_0x9e04('0x82')]=db['sequelize']['import'](_0x9e04('0x83'));db[_0x9e04('0x84')]=db[_0x9e04('0x2')][_0x9e04('0x14')](_0x9e04('0x85'));db[_0x9e04('0x86')]=db[_0x9e04('0x2')][_0x9e04('0x14')](_0x9e04('0x87'));db[_0x9e04('0x88')]=db['sequelize'][_0x9e04('0x14')](_0x9e04('0x89'));db[_0x9e04('0x8a')]=db[_0x9e04('0x2')]['import'](_0x9e04('0x8b'));db['Tag']=db[_0x9e04('0x2')]['import'](_0x9e04('0x8c'));db[_0x9e04('0x8d')]=db['sequelize'][_0x9e04('0x14')]('../api/template/template.model');db[_0x9e04('0x8e')]=db['sequelize'][_0x9e04('0x14')](_0x9e04('0x8f'));db['Variable']=db[_0x9e04('0x2')][_0x9e04('0x14')](_0x9e04('0x90'));db[_0x9e04('0x91')]=db['sequelize']['import'](_0x9e04('0x92'));db['IntegrationReport']=db[_0x9e04('0x2')][_0x9e04('0x14')](_0x9e04('0x93'));db[_0x9e04('0x94')]=db['sequelize']['import'](_0x9e04('0x95'));db['AnalyticDefaultReport']=db[_0x9e04('0x2')][_0x9e04('0x14')]('../api/analyticDefaultReport/analyticDefaultReport.model');db[_0x9e04('0x96')]=db[_0x9e04('0x2')]['import'](_0x9e04('0x97'));db[_0x9e04('0x98')]=db[_0x9e04('0x2')][_0x9e04('0x14')](_0x9e04('0x99'));db['AnalyticFieldReport']=db[_0x9e04('0x2')][_0x9e04('0x14')]('../api/analyticFieldReport/analyticFieldReport.model');db['AnalyticTreeReport']=db['sequelize']['import'](_0x9e04('0x9a'));db[_0x9e04('0x9b')]=db[_0x9e04('0x2')][_0x9e04('0x14')](_0x9e04('0x9c'));db[_0x9e04('0x9d')]=db[_0x9e04('0x2')][_0x9e04('0x14')](_0x9e04('0x9e'));db[_0x9e04('0x9f')]=db[_0x9e04('0x2')]['import'](_0x9e04('0xa0'));db[_0x9e04('0xa1')]=db[_0x9e04('0x2')][_0x9e04('0x14')](_0x9e04('0xa2'));db[_0x9e04('0xa3')]=db['sequelize'][_0x9e04('0x14')](_0x9e04('0xa4'));db[_0x9e04('0xa5')]=db[_0x9e04('0x2')][_0x9e04('0x14')](_0x9e04('0xa6'));db[_0x9e04('0xa7')]=db[_0x9e04('0x2')][_0x9e04('0x14')](_0x9e04('0xa8'));db[_0x9e04('0xa9')]=db[_0x9e04('0x2')][_0x9e04('0x14')](_0x9e04('0xaa'));db[_0x9e04('0xab')]=db['sequelize'][_0x9e04('0x14')](_0x9e04('0xac'));db[_0x9e04('0xad')]=db[_0x9e04('0x2')]['import'](_0x9e04('0xae'));db[_0x9e04('0xaf')]=db[_0x9e04('0x2')][_0x9e04('0x14')](_0x9e04('0xb0'));db['ZohoField']=db[_0x9e04('0x2')]['import'](_0x9e04('0xb1'));db[_0x9e04('0xb2')]=db['sequelize'][_0x9e04('0x14')](_0x9e04('0xb3'));db[_0x9e04('0xb4')]=db['sequelize']['import'](_0x9e04('0xb5'));db['ZendeskField']=db[_0x9e04('0x2')]['import']('../api/intZendeskField/intZendeskField.model');db[_0x9e04('0xb6')]=db['sequelize'][_0x9e04('0x14')](_0x9e04('0xb7'));db[_0x9e04('0xb8')]=db[_0x9e04('0x2')][_0x9e04('0x14')](_0x9e04('0xb9'));db['FreshdeskField']=db[_0x9e04('0x2')][_0x9e04('0x14')](_0x9e04('0xba'));db[_0x9e04('0xbb')]=db['sequelize'][_0x9e04('0x14')]('../api/intVtigerAccount/intVtigerAccount.model');db[_0x9e04('0xbc')]=db[_0x9e04('0x2')]['import']('../api/intVtigerConfiguration/intVtigerConfiguration.model');db[_0x9e04('0xbd')]=db[_0x9e04('0x2')][_0x9e04('0x14')](_0x9e04('0xbe'));db[_0x9e04('0xbf')]=db[_0x9e04('0x2')][_0x9e04('0x14')](_0x9e04('0xc0'));db['ServicenowConfiguration']=db[_0x9e04('0x2')][_0x9e04('0x14')](_0x9e04('0xc1'));db['ServicenowField']=db[_0x9e04('0x2')][_0x9e04('0x14')](_0x9e04('0xc2'));db[_0x9e04('0xc3')]=db[_0x9e04('0x2')]['import'](_0x9e04('0xc4'));db[_0x9e04('0xc5')]=db['sequelize'][_0x9e04('0x14')](_0x9e04('0xc6'));db[_0x9e04('0xc7')]=db[_0x9e04('0x2')][_0x9e04('0x14')](_0x9e04('0xc8'));db[_0x9e04('0xc9')]=db[_0x9e04('0x2')][_0x9e04('0x14')](_0x9e04('0xca'));db[_0x9e04('0xcb')]=db[_0x9e04('0x2')][_0x9e04('0x14')]('../api/intFreshsalesConfiguration/intFreshsalesConfiguration.model');db[_0x9e04('0xcc')]=db[_0x9e04('0x2')][_0x9e04('0x14')]('../api/intFreshsalesField/intFreshsalesField.model');db[_0x9e04('0x91')]=db[_0x9e04('0x2')][_0x9e04('0x14')]('../api/integration/integration.model');db['Network']=db[_0x9e04('0x2')][_0x9e04('0x14')](_0x9e04('0xcd'));db['ChatQueueReport']=db[_0x9e04('0x2')][_0x9e04('0x14')](_0x9e04('0xce'));db[_0x9e04('0xcf')]=db[_0x9e04('0x2')]['import']('../api/chatInternalMessage/chatInternalMessage.model');db[_0x9e04('0xd0')]=db[_0x9e04('0x2')][_0x9e04('0x14')](_0x9e04('0xd1'));db[_0x9e04('0xd2')]=db[_0x9e04('0x2')][_0x9e04('0x14')](_0x9e04('0xd3'));db[_0x9e04('0xd4')]=db[_0x9e04('0x2')][_0x9e04('0x14')](_0x9e04('0xd5'));db['SmsQueueReport']=db[_0x9e04('0x2')][_0x9e04('0x14')](_0x9e04('0xd6'));db[_0x9e04('0xd7')]=db[_0x9e04('0x2')][_0x9e04('0x14')](_0x9e04('0xd8'));db[_0x9e04('0xd9')]=db[_0x9e04('0x2')][_0x9e04('0x14')](_0x9e04('0xda'));db['JscriptyProject']=db[_0x9e04('0x2')][_0x9e04('0x14')](_0x9e04('0xdb'));db[_0x9e04('0xdc')]=db[_0x9e04('0x2')]['import'](_0x9e04('0xdd'));db[_0x9e04('0xde')]=db[_0x9e04('0x2')][_0x9e04('0x14')](_0x9e04('0xdf'));db[_0x9e04('0xe0')]=db[_0x9e04('0x2')]['import']('../api/squareProject/squareProject.model');db[_0x9e04('0xe1')]=db[_0x9e04('0x2')][_0x9e04('0x14')](_0x9e04('0xe2'));db['SquareMessage']=db[_0x9e04('0x2')][_0x9e04('0x14')](_0x9e04('0xe3'));db['Team']=db[_0x9e04('0x2')][_0x9e04('0x14')](_0x9e04('0xe4'));db[_0x9e04('0xe5')]=db[_0x9e04('0x2')][_0x9e04('0x14')]('../api/license/license.model');db[_0x9e04('0xe6')]=db['sequelize']['import'](_0x9e04('0xe7'));db['Migration']=db['sequelize']['import'](_0x9e04('0xe8'));db['Attachment']=db[_0x9e04('0x2')]['import'](_0x9e04('0xe9'));db[_0x9e04('0xea')]=db[_0x9e04('0x2')][_0x9e04('0x14')](_0x9e04('0xeb'));db['MailTransferReport']=db[_0x9e04('0x2')][_0x9e04('0x14')]('../api/mailTransferReport/mailTransferReport.model');db[_0x9e04('0xec')]=db['sequelize'][_0x9e04('0x14')](_0x9e04('0xed'));db[_0x9e04('0xee')]=db[_0x9e04('0x2')][_0x9e04('0x14')](_0x9e04('0xef'));db['OpenchannelTransferReport']=db[_0x9e04('0x2')][_0x9e04('0x14')]('../api/openchannelTransferReport/openchannelTransferReport.model');db['SmsTransferReport']=db[_0x9e04('0x2')][_0x9e04('0x14')]('../api/smsTransferReport/smsTransferReport.model');db['CmList']=db[_0x9e04('0x2')][_0x9e04('0x14')]('../api/cmList/cmList.model');db[_0x9e04('0xf0')]=db['sequelize'][_0x9e04('0x14')](_0x9e04('0xf1'));db[_0x9e04('0xf2')]=db['sequelize'][_0x9e04('0x14')](_0x9e04('0xf3'));db[_0x9e04('0xf4')]=db[_0x9e04('0x2')][_0x9e04('0x14')](_0x9e04('0xf5'));db[_0x9e04('0xf6')]=db[_0x9e04('0x2')][_0x9e04('0x14')](_0x9e04('0xf7'));db['User'][_0x9e04('0xf8')](db[_0x9e04('0x1e')],{'as':_0x9e04('0x1e'),'onDelete':_0x9e04('0xf9'),'foreignKey':_0x9e04('0xfa')});db[_0x9e04('0x13')]['hasMany'](db[_0x9e04('0x1c')],{'as':_0x9e04('0xfb'),'foreignKey':_0x9e04('0xfa')});db[_0x9e04('0x13')][_0x9e04('0xfc')](db[_0x9e04('0x2e')],{'as':_0x9e04('0xfd'),'foreignKey':'UserId'});db[_0x9e04('0x13')][_0x9e04('0xfc')](db[_0x9e04('0xfe')],{'as':'Extensions','onDelete':_0x9e04('0xf9'),'hooks':!![]});db['User'][_0x9e04('0xfc')](db[_0x9e04('0x74')],{'as':_0x9e04('0xff'),'foreignKey':_0x9e04('0xfa')});db[_0x9e04('0x13')][_0x9e04('0xfc')](db[_0x9e04('0x100')],{'as':'HopperHistory','foreignKey':'UserId'});db[_0x9e04('0x13')][_0x9e04('0xfc')](db[_0x9e04('0x75')],{'as':_0x9e04('0x75'),'foreignKey':_0x9e04('0xfa')});db[_0x9e04('0x13')][_0x9e04('0xfc')](db[_0x9e04('0x61')],{'as':_0x9e04('0x101'),'foreignKey':_0x9e04('0xfa')});db['User'][_0x9e04('0xfc')](db['ChatInteraction'],{'as':_0x9e04('0x102'),'foreignKey':_0x9e04('0xfa')});db[_0x9e04('0x13')][_0x9e04('0xfc')](db[_0x9e04('0x103')],{'as':'SmsInteractions','foreignKey':_0x9e04('0xfa')});db[_0x9e04('0x13')][_0x9e04('0xfc')](db[_0x9e04('0x4f')],{'as':_0x9e04('0x104'),'foreignKey':_0x9e04('0xfa')});db['User']['hasMany'](db[_0x9e04('0x42')],{'as':'MailInteractions','foreignKey':_0x9e04('0xfa')});db[_0x9e04('0x13')]['belongsTo'](db[_0x9e04('0xf2')],{'as':_0x9e04('0xf2'),'foreignKey':_0x9e04('0x105')});db[_0x9e04('0x13')][_0x9e04('0x106')](db[_0x9e04('0x107')],{'as':'Groups','through':_0x9e04('0x108')});db[_0x9e04('0x13')][_0x9e04('0x106')](db[_0x9e04('0x109')],{'as':_0x9e04('0x10a'),'through':_0x9e04('0x10b')});db[_0x9e04('0x13')][_0x9e04('0x106')](db['CmList'],{'as':'Lists','through':'cm_user_has_lists'});db['User'][_0x9e04('0x106')](db[_0x9e04('0x10c')],{'through':_0x9e04('0x10d')});db[_0x9e04('0x13')][_0x9e04('0x106')](db['MailInteraction'],{'as':_0x9e04('0x10e'),'through':'user_has_mail_interactions'});db['User'][_0x9e04('0x106')](db[_0x9e04('0x67')],{'as':_0x9e04('0x102'),'through':'user_has_chat_interactions'});db[_0x9e04('0x13')][_0x9e04('0x106')](db[_0x9e04('0x4f')],{'as':_0x9e04('0x104'),'through':_0x9e04('0x10f')});db['User'][_0x9e04('0x106')](db[_0x9e04('0x103')],{'as':'SmsInteractions','through':_0x9e04('0x110')});db['User'][_0x9e04('0x106')](db[_0x9e04('0x61')],{'as':'OpenchannelInteractions','through':'user_has_openchannel_interactions'});db[_0x9e04('0x13')]['belongsToMany'](db['VoiceQueue'],{'as':_0x9e04('0x111'),'through':'UserVoiceQueue','required':![]});db[_0x9e04('0x13')][_0x9e04('0x106')](db[_0x9e04('0x3f')],{'as':_0x9e04('0x112'),'through':_0x9e04('0x33'),'required':![]});db[_0x9e04('0x13')][_0x9e04('0x106')](db['ChatQueue'],{'as':_0x9e04('0x113'),'through':_0x9e04('0x31'),'required':![],'hooks':!![]});db[_0x9e04('0x13')][_0x9e04('0x106')](db['FaxQueue'],{'as':_0x9e04('0x114'),'through':_0x9e04('0x35'),'required':![]});db[_0x9e04('0x13')][_0x9e04('0x106')](db[_0x9e04('0x5d')],{'as':_0x9e04('0x115'),'through':_0x9e04('0x116'),'required':![]});db[_0x9e04('0x13')][_0x9e04('0x106')](db[_0x9e04('0x117')],{'as':'OpenchannelQueues','through':_0x9e04('0x38'),'required':![]});db[_0x9e04('0x13')][_0x9e04('0x106')](db[_0x9e04('0x118')],{'through':'cm_user_has_lists'});db['User'][_0x9e04('0x106')](db[_0x9e04('0xf0')],{'as':_0x9e04('0x119'),'through':_0x9e04('0x11a'),'required':![]});db[_0x9e04('0x13')][_0x9e04('0x106')](db[_0x9e04('0x11b')],{'as':_0x9e04('0x11c'),'through':_0x9e04('0x11d')});db[_0x9e04('0x13')][_0x9e04('0x106')](db['FaxAccount'],{'as':_0x9e04('0x11e'),'through':'user_has_fax_accounts'});db[_0x9e04('0x13')]['belongsToMany'](db['MailAccount'],{'as':_0x9e04('0x11f'),'through':_0x9e04('0x120')});db[_0x9e04('0x13')][_0x9e04('0x106')](db[_0x9e04('0x121')],{'as':_0x9e04('0x122'),'through':_0x9e04('0x123')});db['User']['belongsToMany'](db['SmsAccount'],{'as':_0x9e04('0x124'),'through':_0x9e04('0x125')});db[_0x9e04('0x13')]['belongsToMany'](db[_0x9e04('0xe0')],{'as':_0x9e04('0x126'),'through':_0x9e04('0x127')});db[_0x9e04('0x16')]['hasMany'](db[_0x9e04('0xfe')],{'as':_0x9e04('0x128'),'onDelete':_0x9e04('0xf9'),'foreignKey':_0x9e04('0x129')});db[_0x9e04('0x17')]['hasMany'](db['VoiceExtension'],{'onDelete':'cascade'});db[_0x9e04('0xfe')]['hasMany'](db[_0x9e04('0xfe')],{'as':'Applications','onDelete':_0x9e04('0xf9')});db['VoiceMusicOnHold'][_0x9e04('0x106')](db[_0x9e04('0x8a')],{'as':'Sounds','through':_0x9e04('0x12a')});db[_0x9e04('0x1a')][_0x9e04('0xfc')](db['UserVoiceQueueRt'],{'as':_0x9e04('0x12b'),'foreignKey':_0x9e04('0x12c')});db[_0x9e04('0x1a')][_0x9e04('0xfc')](db[_0x9e04('0x12d')],{'as':_0x9e04('0x12e'),'foreignKey':_0x9e04('0x12c')});db['VoiceQueue'][_0x9e04('0xfc')](db[_0x9e04('0x74')],{'as':_0x9e04('0xff'),'foreignKey':_0x9e04('0x12c')});db['VoiceQueue'][_0x9e04('0xfc')](db[_0x9e04('0x100')],{'as':_0x9e04('0x12f'),'foreignKey':_0x9e04('0x12c')});db['VoiceQueue'][_0x9e04('0xfc')](db[_0x9e04('0x75')],{'as':'ReportAgentPreview','foreignKey':'VoiceQueueId'});db[_0x9e04('0x1a')]['hasMany'](db[_0x9e04('0x130')],{'as':_0x9e04('0x131'),'foreignKey':_0x9e04('0x12c')});db[_0x9e04('0x1a')][_0x9e04('0xfc')](db[_0x9e04('0xd4')],{'as':_0x9e04('0x132'),'foreignKey':'VoiceQueueId'});db['VoiceQueue'][_0x9e04('0x133')](db[_0x9e04('0x2b')],{'as':_0x9e04('0x2b'),'foreignKey':_0x9e04('0x134')});db[_0x9e04('0x1a')][_0x9e04('0x133')](db[_0x9e04('0x2b')],{'as':'TrunkBackup','foreignKey':_0x9e04('0x135')});db[_0x9e04('0x1a')][_0x9e04('0x133')](db['Interval'],{'as':_0x9e04('0x80'),'foreignKey':'IntervalId'});db[_0x9e04('0x1a')][_0x9e04('0x133')](db['Pause'],{'as':_0x9e04('0x136'),'foreignKey':'mandatoryDispositionPauseId'});db['VoiceQueue']['belongsToMany'](db['CmList'],{'as':_0x9e04('0x137'),'through':_0x9e04('0x138')});db[_0x9e04('0x1a')][_0x9e04('0x106')](db[_0x9e04('0x13')],{'as':'Agents','through':_0x9e04('0x2f')});db['VoiceQueue']['belongsToMany'](db[_0x9e04('0x10c')],{'as':'Teams','through':_0x9e04('0x139')});db[_0x9e04('0x1a')][_0x9e04('0x106')](db[_0x9e04('0x118')],{'as':_0x9e04('0x13a'),'through':_0x9e04('0x13b')});db[_0x9e04('0x1c')][_0x9e04('0x133')](db[_0x9e04('0x13')],{'as':'User','foreignKey':_0x9e04('0xfa')});db[_0x9e04('0x1d')][_0x9e04('0x133')](db[_0x9e04('0x13')],{'as':_0x9e04('0x13'),'foreignKey':_0x9e04('0xfa')});db[_0x9e04('0x1e')]['hasMany'](db['VoiceMailMessage'],{'as':_0x9e04('0x13c'),'onDelete':_0x9e04('0xf9'),'foreignKey':'mailboxuser','sourceKey':_0x9e04('0x13d')});db[_0x9e04('0x1f')]['belongsTo'](db[_0x9e04('0x1e')],{'foreignKey':_0x9e04('0x13e'),'targetKey':_0x9e04('0x13d')});db[_0x9e04('0x21')]['hasMany'](db['VoiceQueueReport'],{'as':_0x9e04('0x13f'),'foreignKey':'uniqueid','constraints':![]});db[_0x9e04('0x21')][_0x9e04('0xfc')](db[_0x9e04('0x25')],{'as':_0x9e04('0x140'),'foreignKey':_0x9e04('0x141'),'constraints':![]});db[_0x9e04('0x21')][_0x9e04('0x133')](db['User'],{'as':_0x9e04('0x13'),'foreignKey':_0x9e04('0xfa')});db['VoiceCallReport']['belongsTo'](db[_0x9e04('0x109')],{'as':'Contact','foreignKey':'ContactId'});db['MailServerIn']['belongsTo'](db[_0x9e04('0x3e')],{'as':_0x9e04('0x3e'),'foreignKey':'MailAccountId'});db['MailServerOut'][_0x9e04('0x133')](db[_0x9e04('0x3e')],{'as':_0x9e04('0x3e'),'foreignKey':_0x9e04('0x142')});db[_0x9e04('0x3e')]['hasOne'](db[_0x9e04('0x3a')],{'as':_0x9e04('0x143'),'onDelete':_0x9e04('0xf9')});db[_0x9e04('0x3e')][_0x9e04('0xf8')](db[_0x9e04('0x3c')],{'as':_0x9e04('0x144'),'onDelete':_0x9e04('0xf9')});db['MailAccount']['hasMany'](db['Disposition'],{'as':_0x9e04('0x145'),'foreignKey':'MailAccountId'});db['MailAccount']['hasMany'](db['CannedAnswer'],{'as':'Answers','foreignKey':_0x9e04('0x142')});db[_0x9e04('0x3e')][_0x9e04('0xfc')](db[_0x9e04('0x44')],{'as':_0x9e04('0x13c'),'foreignKey':_0x9e04('0x142')});db[_0x9e04('0x3e')][_0x9e04('0xfc')](db['MailInteraction'],{'as':_0x9e04('0x146')});db[_0x9e04('0x3e')][_0x9e04('0xfc')](db[_0x9e04('0x46')],{'as':_0x9e04('0x147')});db[_0x9e04('0x3e')][_0x9e04('0x133')](db[_0x9e04('0x118')],{'as':'List','foreignKey':_0x9e04('0x148')});db[_0x9e04('0x3e')][_0x9e04('0x133')](db[_0x9e04('0x8d')],{'as':_0x9e04('0x8d'),'foreignKey':'TemplateId'});db[_0x9e04('0x3e')][_0x9e04('0x133')](db[_0x9e04('0x82')],{'as':_0x9e04('0x136'),'foreignKey':'mandatoryDispositionPauseId'});db[_0x9e04('0x3e')]['belongsToMany'](db[_0x9e04('0x13')],{'as':_0x9e04('0x149'),'through':_0x9e04('0x120')});db[_0x9e04('0x3f')]['belongsToMany'](db[_0x9e04('0x13')],{'as':_0x9e04('0x149'),'through':'UserMailQueue'});db['MailQueue'][_0x9e04('0x106')](db[_0x9e04('0x10c')],{'through':'team_has_mail_queues','as':_0x9e04('0x14a')});db['MailInteraction'][_0x9e04('0xfc')](db[_0x9e04('0x44')],{'as':_0x9e04('0x13c'),'onDelete':_0x9e04('0xf9'),'foreignKey':'MailInteractionId'});db['MailInteraction'][_0x9e04('0x133')](db[_0x9e04('0x3e')],{'as':_0x9e04('0x14b'),'foreignKey':_0x9e04('0x142')});db[_0x9e04('0x42')][_0x9e04('0x133')](db[_0x9e04('0x109')],{'as':_0x9e04('0x14c'),'foreignKey':_0x9e04('0x14d')});db[_0x9e04('0x42')][_0x9e04('0x133')](db[_0x9e04('0x13')],{'as':_0x9e04('0x14e'),'foreignKey':_0x9e04('0xfa')});db[_0x9e04('0x42')][_0x9e04('0x106')](db[_0x9e04('0x14f')],{'through':'mail_interaction_has_tags','as':_0x9e04('0x150')});db[_0x9e04('0x42')][_0x9e04('0x106')](db[_0x9e04('0x14f')],{'through':_0x9e04('0x151'),'as':'ThroughTags'});db['MailInteraction'][_0x9e04('0x106')](db[_0x9e04('0x13')],{'as':_0x9e04('0x152'),'through':_0x9e04('0x153'),'foreignKey':_0x9e04('0x154')});db[_0x9e04('0x44')][_0x9e04('0xfc')](db[_0x9e04('0x155')],{'as':_0x9e04('0x156'),'onDelete':_0x9e04('0xf9')});db['MailMessage'][_0x9e04('0x133')](db['User'],{'as':_0x9e04('0x13')});db[_0x9e04('0x44')][_0x9e04('0x133')](db[_0x9e04('0x109')],{'onDelete':_0x9e04('0xf9'),'as':'Contact'});db[_0x9e04('0x44')][_0x9e04('0x133')](db[_0x9e04('0x42')],{'as':_0x9e04('0x157'),'foreignKey':_0x9e04('0x154')});db[_0x9e04('0x44')][_0x9e04('0x133')](db['MailAccount'],{'as':_0x9e04('0x14b'),'foreignKey':_0x9e04('0x142')});db[_0x9e04('0x46')][_0x9e04('0x133')](db['User'],{'onDelete':_0x9e04('0x158')});db['MailApplication'][_0x9e04('0x133')](db['MailQueue'],{'onDelete':_0x9e04('0x158')});db[_0x9e04('0x46')][_0x9e04('0x133')](db[_0x9e04('0x3e')],{'onDelete':_0x9e04('0x158')});db[_0x9e04('0x46')][_0x9e04('0x133')](db[_0x9e04('0x80')],{'onDelete':'restrict','foreignKey':_0x9e04('0x159')});db[_0x9e04('0x46')][_0x9e04('0x133')](db[_0x9e04('0x14f')],{'onDelete':'restrict','foreignKey':_0x9e04('0x15a')});db['MailQueueReport']['belongsTo'](db[_0x9e04('0x3e')],{});db[_0x9e04('0x15b')][_0x9e04('0x133')](db[_0x9e04('0x118')],{'as':_0x9e04('0x15c'),'foreignKey':_0x9e04('0x148')});db[_0x9e04('0x15b')][_0x9e04('0x133')](db['CmContact'],{'as':'Contact','foreignKey':_0x9e04('0x14d')});db[_0x9e04('0x15b')]['belongsTo'](db['MailInteraction'],{});db[_0x9e04('0x15b')][_0x9e04('0x133')](db[_0x9e04('0x44')],{});db[_0x9e04('0x15b')]['belongsTo'](db[_0x9e04('0x13')],{});db[_0x9e04('0x15b')]['belongsTo'](db[_0x9e04('0x3f')],{});db[_0x9e04('0x49')][_0x9e04('0xfc')](db[_0x9e04('0x4b')],{'as':_0x9e04('0x15d'),'onDelete':_0x9e04('0xf9')});db[_0x9e04('0x4c')][_0x9e04('0xfc')](db['Disposition'],{'as':_0x9e04('0x145'),'foreignKey':_0x9e04('0x15e')});db[_0x9e04('0x4c')][_0x9e04('0xfc')](db[_0x9e04('0x7b')],{'as':_0x9e04('0x15f'),'foreignKey':'FaxAccountId'});db[_0x9e04('0x4c')][_0x9e04('0xfc')](db[_0x9e04('0x4f')],{'as':_0x9e04('0x146')});db['FaxAccount'][_0x9e04('0xfc')](db[_0x9e04('0x160')],{'as':_0x9e04('0x147')});db[_0x9e04('0x4c')][_0x9e04('0xfc')](db['VoiceExtension'],{'as':_0x9e04('0x161'),'onDelete':'cascade'});db[_0x9e04('0x4c')][_0x9e04('0xfc')](db[_0x9e04('0x51')],{'as':_0x9e04('0x13c')});db['FaxAccount'][_0x9e04('0x133')](db[_0x9e04('0x2b')],{'as':'Trunk'});db[_0x9e04('0x4c')][_0x9e04('0x133')](db[_0x9e04('0x118')],{'as':_0x9e04('0x15c'),'foreignKey':_0x9e04('0x148')});db[_0x9e04('0x4c')]['belongsTo'](db[_0x9e04('0x82')],{'as':'mandatoryDispositionPause','foreignKey':_0x9e04('0x162')});db[_0x9e04('0x4c')][_0x9e04('0x106')](db[_0x9e04('0x13')],{'as':_0x9e04('0x149'),'through':_0x9e04('0x163')});db['FaxApplication'][_0x9e04('0x133')](db['User'],{'onDelete':'restrict'});db[_0x9e04('0x160')][_0x9e04('0x133')](db['FaxQueue'],{'onDelete':_0x9e04('0x158')});db[_0x9e04('0x160')]['belongsTo'](db['FaxAccount'],{'onDelete':_0x9e04('0x158')});db[_0x9e04('0x160')][_0x9e04('0x133')](db[_0x9e04('0x14f')],{'onDelete':_0x9e04('0x158'),'foreignKey':'TagId'});db[_0x9e04('0x4f')][_0x9e04('0xfc')](db['FaxMessage'],{'as':_0x9e04('0x13c'),'onDelete':_0x9e04('0xf9'),'foreignKey':_0x9e04('0x164')});db['FaxInteraction']['belongsTo'](db[_0x9e04('0x4c')],{'as':_0x9e04('0x14b'),'foreignKey':_0x9e04('0x15e')});db['FaxInteraction'][_0x9e04('0x133')](db[_0x9e04('0x109')],{'as':_0x9e04('0x14c'),'foreignKey':_0x9e04('0x14d')});db[_0x9e04('0x4f')][_0x9e04('0x133')](db['User'],{'as':_0x9e04('0x14e'),'foreignKey':'UserId'});db[_0x9e04('0x4f')][_0x9e04('0x106')](db[_0x9e04('0x14f')],{'through':'fax_interaction_has_tags','as':'Tags'});db[_0x9e04('0x4f')][_0x9e04('0x106')](db[_0x9e04('0x14f')],{'through':_0x9e04('0x165'),'as':'ThroughTags'});db[_0x9e04('0x4f')]['belongsToMany'](db[_0x9e04('0x13')],{'as':_0x9e04('0x152'),'through':_0x9e04('0x10f'),'foreignKey':_0x9e04('0x164')});db[_0x9e04('0x51')][_0x9e04('0x133')](db[_0x9e04('0x13')],{'onDelete':'cascade','as':_0x9e04('0x13')});db[_0x9e04('0x51')][_0x9e04('0x133')](db[_0x9e04('0x4f')],{'as':'Interaction','foreignKey':_0x9e04('0x164')});db[_0x9e04('0x51')][_0x9e04('0x133')](db[_0x9e04('0x109')],{'onDelete':_0x9e04('0xf9'),'as':_0x9e04('0x14c')});db[_0x9e04('0x51')][_0x9e04('0x133')](db['Attachment'],{'as':_0x9e04('0x155'),'foreignKey':'AttachmentId'});db['FaxMessage']['belongsTo'](db[_0x9e04('0x4c')],{'as':'Account','foreignKey':_0x9e04('0x15e')});db['FaxQueue'][_0x9e04('0x106')](db[_0x9e04('0x13')],{'as':_0x9e04('0x149'),'through':'UserFaxQueue'});db[_0x9e04('0x53')][_0x9e04('0x106')](db[_0x9e04('0x10c')],{'through':_0x9e04('0x166'),'as':_0x9e04('0x14a')});db[_0x9e04('0x55')][_0x9e04('0x133')](db[_0x9e04('0x4c')],{});db[_0x9e04('0x55')][_0x9e04('0x133')](db[_0x9e04('0x118')],{'as':_0x9e04('0x15c'),'foreignKey':_0x9e04('0x148')});db[_0x9e04('0x55')][_0x9e04('0x133')](db[_0x9e04('0x109')],{'as':_0x9e04('0x14c'),'foreignKey':_0x9e04('0x14d')});db['FaxQueueReport'][_0x9e04('0x133')](db['FaxInteraction'],{});db[_0x9e04('0x55')][_0x9e04('0x133')](db[_0x9e04('0x51')],{});db[_0x9e04('0x55')][_0x9e04('0x133')](db[_0x9e04('0x13')],{});db[_0x9e04('0x55')]['belongsTo'](db[_0x9e04('0x53')],{});db[_0x9e04('0x167')]['hasMany'](db[_0x9e04('0x7d')],{'as':_0x9e04('0x145'),'foreignKey':_0x9e04('0x168')});db[_0x9e04('0x167')][_0x9e04('0xfc')](db[_0x9e04('0x7b')],{'as':_0x9e04('0x15f'),'foreignKey':'SmsAccountId'});db[_0x9e04('0x167')][_0x9e04('0xfc')](db[_0x9e04('0x5b')],{'as':'Messages','foreignKey':_0x9e04('0x168')});db['SmsAccount']['hasMany'](db['SmsInteraction'],{'as':_0x9e04('0x146')});db[_0x9e04('0x167')][_0x9e04('0xfc')](db['SmsApplication'],{'as':_0x9e04('0x147')});db[_0x9e04('0x167')][_0x9e04('0x133')](db[_0x9e04('0x118')],{'as':'List','foreignKey':'ListId'});db[_0x9e04('0x167')][_0x9e04('0x133')](db['Pause'],{'as':_0x9e04('0x136'),'foreignKey':_0x9e04('0x162')});db[_0x9e04('0x167')][_0x9e04('0x106')](db[_0x9e04('0x13')],{'as':'Agents','through':_0x9e04('0x125')});db[_0x9e04('0x58')]['belongsTo'](db[_0x9e04('0x13')],{'onDelete':_0x9e04('0x158')});db[_0x9e04('0x58')][_0x9e04('0x133')](db[_0x9e04('0x5d')],{'onDelete':'restrict'});db[_0x9e04('0x58')][_0x9e04('0x133')](db['SmsAccount'],{'onDelete':_0x9e04('0x158')});db[_0x9e04('0x58')][_0x9e04('0x133')](db[_0x9e04('0x80')],{'onDelete':_0x9e04('0x158'),'foreignKey':_0x9e04('0x159')});db[_0x9e04('0x58')]['belongsTo'](db[_0x9e04('0x14f')],{'onDelete':_0x9e04('0x158'),'foreignKey':_0x9e04('0x15a')});db[_0x9e04('0x103')][_0x9e04('0xfc')](db[_0x9e04('0x5b')],{'as':_0x9e04('0x13c'),'onDelete':_0x9e04('0xf9'),'foreignKey':'SmsInteractionId'});db['SmsInteraction'][_0x9e04('0x133')](db[_0x9e04('0x167')],{'as':_0x9e04('0x14b'),'foreignKey':'SmsAccountId'});db[_0x9e04('0x103')][_0x9e04('0x133')](db[_0x9e04('0x109')],{'as':'Contact','foreignKey':_0x9e04('0x14d')});db[_0x9e04('0x103')]['belongsTo'](db[_0x9e04('0x13')],{'as':_0x9e04('0x14e'),'foreignKey':_0x9e04('0xfa')});db[_0x9e04('0x103')][_0x9e04('0x106')](db['Tag'],{'through':_0x9e04('0x169'),'as':'Tags'});db['SmsInteraction']['belongsToMany'](db['Tag'],{'through':'sms_interaction_has_tags','as':'ThroughTags'});db[_0x9e04('0x103')][_0x9e04('0x106')](db['User'],{'as':_0x9e04('0x152'),'through':_0x9e04('0x110'),'foreignKey':_0x9e04('0x16a')});db[_0x9e04('0x5b')][_0x9e04('0x133')](db[_0x9e04('0x13')],{'as':_0x9e04('0x13')});db['SmsMessage'][_0x9e04('0x133')](db[_0x9e04('0x109')],{'onDelete':_0x9e04('0xf9'),'as':'Contact'});db[_0x9e04('0x5b')][_0x9e04('0x133')](db[_0x9e04('0x103')],{'onDelete':_0x9e04('0xf9'),'as':_0x9e04('0x157'),'foreignKey':_0x9e04('0x16a')});db[_0x9e04('0x5b')][_0x9e04('0x133')](db[_0x9e04('0x167')],{'as':_0x9e04('0x14b'),'foreignKey':'SmsAccountId'});db[_0x9e04('0x5d')][_0x9e04('0x106')](db[_0x9e04('0x13')],{'as':_0x9e04('0x149'),'through':_0x9e04('0x116'),'foreignKey':'SmsQueueId'});db[_0x9e04('0x5d')][_0x9e04('0x106')](db['Team'],{'through':'team_has_sms_queues','as':'Teams'});db[_0x9e04('0x121')][_0x9e04('0xfc')](db['Disposition'],{'as':_0x9e04('0x145'),'foreignKey':'OpenchannelAccountId'});db[_0x9e04('0x121')][_0x9e04('0xfc')](db[_0x9e04('0x7b')],{'as':_0x9e04('0x15f'),'foreignKey':_0x9e04('0x16b')});db[_0x9e04('0x121')][_0x9e04('0xfc')](db['OpenchannelInteraction'],{'as':_0x9e04('0x146'),'foreignKey':_0x9e04('0x16b')});db['OpenchannelAccount'][_0x9e04('0xfc')](db[_0x9e04('0x62')],{'as':_0x9e04('0x13c'),'foreignKey':_0x9e04('0x16b')});db[_0x9e04('0x121')][_0x9e04('0xfc')](db[_0x9e04('0x16c')],{'as':_0x9e04('0x147'),'foreignKey':_0x9e04('0x16b')});db[_0x9e04('0x121')][_0x9e04('0x133')](db[_0x9e04('0x118')],{'as':_0x9e04('0x15c'),'foreignKey':_0x9e04('0x148')});db['OpenchannelAccount'][_0x9e04('0x133')](db[_0x9e04('0x82')],{'as':_0x9e04('0x136'),'foreignKey':_0x9e04('0x162')});db['OpenchannelAccount']['belongsToMany'](db[_0x9e04('0x13')],{'as':_0x9e04('0x149'),'through':_0x9e04('0x123')});db[_0x9e04('0x16c')][_0x9e04('0x133')](db[_0x9e04('0x13')],{'onDelete':_0x9e04('0x158')});db[_0x9e04('0x16c')]['belongsTo'](db['OpenchannelQueue'],{'onDelete':_0x9e04('0x158'),'foreignKey':_0x9e04('0x16d')});db[_0x9e04('0x16c')]['belongsTo'](db[_0x9e04('0x121')],{'onDelete':_0x9e04('0x158'),'foreignKey':_0x9e04('0x16b')});db['OpenchannelApplication'][_0x9e04('0x133')](db['Interval'],{'onDelete':_0x9e04('0x158'),'foreignKey':_0x9e04('0x159')});db[_0x9e04('0x16c')][_0x9e04('0x133')](db[_0x9e04('0x14f')],{'onDelete':'restrict','foreignKey':_0x9e04('0x15a')});db[_0x9e04('0x61')][_0x9e04('0xfc')](db['OpenchannelMessage'],{'as':_0x9e04('0x13c'),'onDelete':_0x9e04('0xf9'),'foreignKey':_0x9e04('0x16e')});db[_0x9e04('0x61')][_0x9e04('0x133')](db[_0x9e04('0x121')],{'as':_0x9e04('0x14b'),'foreignKey':_0x9e04('0x16b')});db[_0x9e04('0x61')]['belongsTo'](db[_0x9e04('0x109')],{'as':_0x9e04('0x14c'),'foreignKey':'ContactId'});db[_0x9e04('0x61')][_0x9e04('0x133')](db[_0x9e04('0x13')],{'as':'Owner','foreignKey':_0x9e04('0xfa')});db[_0x9e04('0x61')][_0x9e04('0x106')](db[_0x9e04('0x14f')],{'through':_0x9e04('0x16f'),'as':_0x9e04('0x150')});db['OpenchannelInteraction'][_0x9e04('0x106')](db[_0x9e04('0x14f')],{'through':'openchannel_interaction_has_tags','as':_0x9e04('0x170')});db[_0x9e04('0x61')][_0x9e04('0x106')](db[_0x9e04('0x13')],{'as':'Users','through':_0x9e04('0x171'),'foreignKey':_0x9e04('0x16e')});db[_0x9e04('0x62')][_0x9e04('0x133')](db[_0x9e04('0x13')],{'onDelete':_0x9e04('0xf9'),'as':_0x9e04('0x13')});db[_0x9e04('0x62')][_0x9e04('0x133')](db[_0x9e04('0x109')],{'onDelete':_0x9e04('0xf9'),'as':'Contact'});db['OpenchannelMessage'][_0x9e04('0x133')](db['OpenchannelInteraction'],{'onDelete':'cascade','as':_0x9e04('0x157'),'foreignKey':_0x9e04('0x16e')});db[_0x9e04('0x62')]['belongsTo'](db[_0x9e04('0x155')],{'as':_0x9e04('0x155'),'foreignKey':_0x9e04('0x172')});db[_0x9e04('0x62')][_0x9e04('0x133')](db[_0x9e04('0x121')],{'as':_0x9e04('0x14b'),'foreignKey':_0x9e04('0x16b')});db[_0x9e04('0x117')][_0x9e04('0x106')](db[_0x9e04('0x13')],{'as':_0x9e04('0x149'),'through':_0x9e04('0x38'),'foreignKey':_0x9e04('0x16d')});db[_0x9e04('0x117')]['belongsToMany'](db[_0x9e04('0x10c')],{'through':_0x9e04('0x173'),'as':'Teams'});db[_0x9e04('0x11b')][_0x9e04('0xfc')](db[_0x9e04('0x7d')],{'as':_0x9e04('0x145'),'foreignKey':_0x9e04('0x174')});db[_0x9e04('0x11b')][_0x9e04('0xfc')](db[_0x9e04('0x7b')],{'as':_0x9e04('0x15f'),'foreignKey':_0x9e04('0x174')});db['ChatWebsite']['hasMany'](db[_0x9e04('0x6e')],{'as':'ProactiveActions'});db[_0x9e04('0x11b')][_0x9e04('0xfc')](db[_0x9e04('0x67')],{'as':_0x9e04('0x146')});db[_0x9e04('0x11b')]['hasMany'](db[_0x9e04('0x66')],{'as':_0x9e04('0x147')});db['ChatWebsite'][_0x9e04('0xfc')](db[_0x9e04('0x69')],{'as':_0x9e04('0x13c')});db[_0x9e04('0x11b')][_0x9e04('0x133')](db['CmList'],{'as':'List','foreignKey':_0x9e04('0x148')});db['ChatWebsite'][_0x9e04('0x133')](db[_0x9e04('0x80')],{'as':_0x9e04('0x80'),'foreignKey':_0x9e04('0x159')});db[_0x9e04('0x11b')][_0x9e04('0x133')](db[_0x9e04('0x82')],{'as':_0x9e04('0x136'),'foreignKey':_0x9e04('0x162')});db['ChatWebsite']['belongsToMany'](db['User'],{'as':_0x9e04('0x149'),'through':'user_has_chat_websites'});db[_0x9e04('0x64')][_0x9e04('0x133')](db[_0x9e04('0x121')],{});db[_0x9e04('0x64')][_0x9e04('0x133')](db[_0x9e04('0x118')],{'as':'List','foreignKey':_0x9e04('0x148')});db[_0x9e04('0x64')][_0x9e04('0x133')](db[_0x9e04('0x109')],{'as':'Contact','foreignKey':_0x9e04('0x14d')});db[_0x9e04('0x64')]['belongsTo'](db[_0x9e04('0x61')],{});db[_0x9e04('0x64')][_0x9e04('0x133')](db[_0x9e04('0x62')],{});db[_0x9e04('0x64')][_0x9e04('0x133')](db[_0x9e04('0x13')],{});db[_0x9e04('0x64')][_0x9e04('0x133')](db['OpenchannelQueue'],{});db[_0x9e04('0x66')][_0x9e04('0x133')](db[_0x9e04('0x13')],{'as':_0x9e04('0x175'),'foreignKey':_0x9e04('0xfa'),'onDelete':_0x9e04('0x158')});db[_0x9e04('0x66')][_0x9e04('0x133')](db[_0x9e04('0x6c')],{'as':'Queue','foreignKey':_0x9e04('0x176'),'onDelete':_0x9e04('0x158')});db[_0x9e04('0x66')][_0x9e04('0x133')](db['ChatWebsite'],{'as':'Website','foreignKey':_0x9e04('0x174'),'onDelete':'restrict'});db[_0x9e04('0x66')][_0x9e04('0x133')](db[_0x9e04('0x14f')],{'onDelete':'restrict','foreignKey':'TagId'});db[_0x9e04('0x67')][_0x9e04('0xfc')](db[_0x9e04('0x69')],{'as':_0x9e04('0x13c'),'onDelete':_0x9e04('0xf9'),'foreignKey':_0x9e04('0x177')});db[_0x9e04('0x67')][_0x9e04('0x133')](db[_0x9e04('0x11b')],{'as':_0x9e04('0x14b'),'foreignKey':_0x9e04('0x174')});db['ChatInteraction'][_0x9e04('0x133')](db[_0x9e04('0x109')],{'as':_0x9e04('0x14c'),'foreignKey':_0x9e04('0x14d')});db[_0x9e04('0x67')][_0x9e04('0x133')](db[_0x9e04('0x13')],{'as':_0x9e04('0x14e'),'foreignKey':_0x9e04('0xfa')});db[_0x9e04('0x67')][_0x9e04('0x106')](db[_0x9e04('0x14f')],{'through':_0x9e04('0x178'),'as':_0x9e04('0x150')});db[_0x9e04('0x67')][_0x9e04('0x106')](db[_0x9e04('0x14f')],{'through':'chat_interaction_has_tags','as':_0x9e04('0x170')});db[_0x9e04('0x67')][_0x9e04('0x106')](db['User'],{'as':_0x9e04('0x152'),'through':_0x9e04('0x179'),'foreignKey':'ChatInteractionId'});db['ChatMessage'][_0x9e04('0x133')](db[_0x9e04('0x13')],{'onDelete':_0x9e04('0xf9'),'as':_0x9e04('0x13')});db[_0x9e04('0x69')][_0x9e04('0x133')](db[_0x9e04('0x109')],{'onDelete':_0x9e04('0xf9'),'as':_0x9e04('0x14c'),'foreignKey':_0x9e04('0x14d')});db[_0x9e04('0x69')][_0x9e04('0x133')](db[_0x9e04('0x67')],{'onDelete':_0x9e04('0xf9'),'as':_0x9e04('0x157'),'foreignKey':'ChatInteractionId'});db[_0x9e04('0x69')]['belongsTo'](db[_0x9e04('0x155')],{'as':_0x9e04('0x155'),'foreignKey':_0x9e04('0x172')});db['ChatMessage'][_0x9e04('0x133')](db['ChatWebsite'],{'as':'Account','foreignKey':_0x9e04('0x174')});db[_0x9e04('0x17a')][_0x9e04('0x133')](db['CmContact'],{'onDelete':_0x9e04('0xf9'),'as':_0x9e04('0x14c'),'foreignKey':_0x9e04('0x14d')});db[_0x9e04('0x17a')][_0x9e04('0x133')](db[_0x9e04('0x11b')],{'as':_0x9e04('0x14b'),'foreignKey':_0x9e04('0x174')});db[_0x9e04('0x6c')][_0x9e04('0x106')](db[_0x9e04('0x13')],{'as':_0x9e04('0x149'),'through':_0x9e04('0x31'),'hooks':!![]});db[_0x9e04('0x6c')][_0x9e04('0x106')](db['Team'],{'through':_0x9e04('0x17b'),'as':_0x9e04('0x14a')});db[_0x9e04('0x107')][_0x9e04('0xfc')](db[_0x9e04('0xcf')],{'as':_0x9e04('0x13c'),'foreignKey':_0x9e04('0x17c'),'onDelete':_0x9e04('0xf9')});db[_0x9e04('0x107')][_0x9e04('0x106')](db[_0x9e04('0x13')],{'as':_0x9e04('0x12b'),'through':_0x9e04('0x108')});db[_0x9e04('0x6e')][_0x9e04('0x133')](db[_0x9e04('0x11b')],{'as':'Website','foreignKey':_0x9e04('0x174')});db[_0x9e04('0x17d')][_0x9e04('0xfc')](db[_0x9e04('0x109')],{'as':_0x9e04('0x10a'),'foreignKey':_0x9e04('0x17e')});db[_0x9e04('0x109')][_0x9e04('0xfc')](db[_0x9e04('0x12d')],{'as':_0x9e04('0x12e'),'foreignKey':'ContactId'});db[_0x9e04('0x109')][_0x9e04('0xfc')](db[_0x9e04('0x74')],{'as':_0x9e04('0xff'),'foreignKey':_0x9e04('0x14d')});db[_0x9e04('0x109')][_0x9e04('0xfc')](db[_0x9e04('0x100')],{'as':_0x9e04('0x12f'),'foreignKey':_0x9e04('0x14d')});db[_0x9e04('0x109')][_0x9e04('0xfc')](db['ReportAgentPreview'],{'as':_0x9e04('0x75'),'foreignKey':_0x9e04('0x14d')});db[_0x9e04('0x109')][_0x9e04('0xfc')](db[_0x9e04('0xd4')],{'as':_0x9e04('0x132'),'foreignKey':_0x9e04('0x14d')});db[_0x9e04('0x109')][_0x9e04('0xfc')](db[_0x9e04('0x61')],{'as':_0x9e04('0x101'),'foreignKey':_0x9e04('0x14d'),'onDelete':'restrict'});db[_0x9e04('0x109')]['hasMany'](db['ChatInteraction'],{'as':_0x9e04('0x102'),'foreignKey':_0x9e04('0x14d'),'onDelete':_0x9e04('0x158')});db['CmContact'][_0x9e04('0xfc')](db[_0x9e04('0x103')],{'as':_0x9e04('0x17f'),'foreignKey':_0x9e04('0x14d'),'onDelete':_0x9e04('0x158')});db[_0x9e04('0x109')][_0x9e04('0xfc')](db['FaxInteraction'],{'as':_0x9e04('0x104'),'foreignKey':'ContactId','onDelete':_0x9e04('0x158')});db[_0x9e04('0x109')][_0x9e04('0xfc')](db[_0x9e04('0x42')],{'as':_0x9e04('0x10e'),'foreignKey':'ContactId','onDelete':_0x9e04('0x158')});db['CmContact'][_0x9e04('0x133')](db['CmCompany'],{'as':_0x9e04('0x180'),'foreignKey':_0x9e04('0x17e')});db[_0x9e04('0x109')]['belongsTo'](db['CmList'],{'as':_0x9e04('0x15c'),'foreignKey':_0x9e04('0x148'),'onDelete':_0x9e04('0xf9')});db[_0x9e04('0x109')]['belongsToMany'](db[_0x9e04('0x13')],{'as':_0x9e04('0x152'),'through':_0x9e04('0x10b')});db[_0x9e04('0x109')][_0x9e04('0x106')](db['Tag'],{'as':_0x9e04('0x150'),'through':_0x9e04('0x181')});db[_0x9e04('0x109')][_0x9e04('0x106')](db[_0x9e04('0x14f')],{'through':_0x9e04('0x181'),'as':_0x9e04('0x170')});db['CmHopper'][_0x9e04('0x133')](db[_0x9e04('0x109')],{'as':'Contact','foreignKey':_0x9e04('0x14d'),'onDelete':_0x9e04('0xf9')});db['CmHopper'][_0x9e04('0x133')](db[_0x9e04('0x118')],{'as':_0x9e04('0x15c'),'foreignKey':_0x9e04('0x148'),'onDelete':'cascade'});db[_0x9e04('0x12d')][_0x9e04('0x133')](db[_0x9e04('0x13')],{'as':_0x9e04('0x175'),'foreignKey':_0x9e04('0xfa')});db[_0x9e04('0x12d')][_0x9e04('0x133')](db[_0x9e04('0x1a')],{'as':'Queue','foreignKey':_0x9e04('0x12c'),'onDelete':_0x9e04('0xf9')});db[_0x9e04('0x12d')]['belongsTo'](db[_0x9e04('0xe6')],{'as':_0x9e04('0xe6'),'foreignKey':'CampaignId','onDelete':'cascade'});db['CmHopper'][_0x9e04('0x133')](db[_0x9e04('0x13')],{'as':'Owner','foreignKey':_0x9e04('0x182')});db[_0x9e04('0x130')][_0x9e04('0x133')](db['CmContact'],{'as':'Contact','foreignKey':_0x9e04('0x14d'),'onDelete':_0x9e04('0xf9')});db[_0x9e04('0x130')][_0x9e04('0x133')](db[_0x9e04('0x118')],{'as':_0x9e04('0x15c'),'foreignKey':_0x9e04('0x148'),'onDelete':'cascade'});db[_0x9e04('0x130')]['belongsTo'](db[_0x9e04('0x1a')],{'as':_0x9e04('0x183'),'foreignKey':_0x9e04('0x12c'),'onDelete':_0x9e04('0xf9')});db[_0x9e04('0x130')][_0x9e04('0x133')](db[_0x9e04('0xe6')],{'as':_0x9e04('0xe6'),'foreignKey':'CampaignId','onDelete':'cascade'});db['Automation'][_0x9e04('0xfc')](db[_0x9e04('0x7f')],{'as':{'plural':_0x9e04('0x184'),'singular':_0x9e04('0x185')},'foreignKey':_0x9e04('0x186'),'onDelete':_0x9e04('0xf9'),'hooks':!![]});db[_0x9e04('0x7a')][_0x9e04('0xfc')](db['Condition'],{'as':{'plural':_0x9e04('0x187'),'singular':_0x9e04('0x188')},'foreignKey':_0x9e04('0x189'),'onDelete':_0x9e04('0xf9'),'hooks':!![]});db['Automation'][_0x9e04('0xfc')](db[_0x9e04('0x78')],{'as':_0x9e04('0x18a'),'foreignKey':_0x9e04('0x18b'),'onDelete':_0x9e04('0xf9'),'hooks':!![]});db[_0x9e04('0x80')][_0x9e04('0xfc')](db['Interval'],{'as':_0x9e04('0x18c'),'foreignKey':'IntervalId','onDelete':_0x9e04('0xf9'),'hooks':!![],'required':![]});db[_0x9e04('0x80')]['hasMany'](db[_0x9e04('0xfe')],{'as':_0x9e04('0x18d'),'foreignKey':_0x9e04('0x159'),'onDelete':_0x9e04('0x158')});db[_0x9e04('0x80')]['hasMany'](db[_0x9e04('0x46')],{'as':'MailApplications','foreignKey':_0x9e04('0x159')});db[_0x9e04('0x80')]['hasMany'](db[_0x9e04('0x66')],{'as':'ChatApplications','foreignKey':_0x9e04('0x159')});db[_0x9e04('0x80')][_0x9e04('0xfc')](db[_0x9e04('0x160')],{'as':_0x9e04('0x18e'),'foreignKey':_0x9e04('0x159')});db[_0x9e04('0x80')][_0x9e04('0xfc')](db[_0x9e04('0x58')],{'as':'SmsApplications','foreignKey':_0x9e04('0x159')});db[_0x9e04('0x88')][_0x9e04('0x133')](db[_0x9e04('0x3e')],{});db['Schedule'][_0x9e04('0x133')](db[_0x9e04('0x18f')],{'foreignKey':_0x9e04('0x190')});db['Schedule'][_0x9e04('0x133')](db[_0x9e04('0x94')],{'foreignKey':_0x9e04('0x191')});db[_0x9e04('0x8a')][_0x9e04('0x106')](db['VoiceMusicOnHold'],{'as':'Mohs','through':_0x9e04('0x12a'),'onDelete':'restrict'});db[_0x9e04('0x14f')]['belongsToMany'](db[_0x9e04('0x109')],{'through':_0x9e04('0x181')});db[_0x9e04('0x14f')][_0x9e04('0x106')](db[_0x9e04('0x67')],{'through':_0x9e04('0x178')});db[_0x9e04('0x14f')][_0x9e04('0x106')](db[_0x9e04('0x42')],{'through':_0x9e04('0x151')});db[_0x9e04('0x14f')]['belongsToMany'](db['SmsInteraction'],{'through':_0x9e04('0x169')});db[_0x9e04('0x14f')][_0x9e04('0x106')](db[_0x9e04('0x4f')],{'through':_0x9e04('0x165')});db[_0x9e04('0x14f')][_0x9e04('0x106')](db[_0x9e04('0x61')],{'through':_0x9e04('0x16f')});db[_0x9e04('0x8e')][_0x9e04('0xfc')](db[_0x9e04('0x7f')],{'as':{'plural':_0x9e04('0x192'),'singular':_0x9e04('0x193')},'foreignKey':_0x9e04('0x194'),'onDelete':'cascade','hooks':!![]});db[_0x9e04('0x8e')]['hasMany'](db[_0x9e04('0x7f')],{'as':{'plural':_0x9e04('0x195'),'singular':_0x9e04('0x196')},'foreignKey':_0x9e04('0x197'),'onDelete':_0x9e04('0xf9'),'hooks':!![]});db[_0x9e04('0x8e')][_0x9e04('0xfc')](db[_0x9e04('0x78')],{'as':_0x9e04('0x18a'),'foreignKey':_0x9e04('0x198'),'onDelete':_0x9e04('0xf9'),'hooks':!![]});db[_0x9e04('0x94')][_0x9e04('0xfc')](db[_0x9e04('0x199')],{'as':'Fields','onDelete':_0x9e04('0xf9'),'foreignKey':'CustomReportId','hooks':!![]});db[_0x9e04('0x18f')][_0x9e04('0xfc')](db['AnalyticFieldReport'],{'as':_0x9e04('0x19a'),'onDelete':_0x9e04('0xf9'),'foreignKey':_0x9e04('0x190')});db['AnalyticMetric'][_0x9e04('0xfc')](db[_0x9e04('0x199')],{'as':_0x9e04('0x19a'),'onDelete':_0x9e04('0xf9'),'foreignKey':'MetricId'});db[_0x9e04('0x199')][_0x9e04('0x133')](db[_0x9e04('0x98')],{'foreignKey':_0x9e04('0x19b')});db['SalesforceAccount']['hasMany'](db[_0x9e04('0x9d')],{'as':_0x9e04('0x19c'),'onDelete':_0x9e04('0xf9'),'foreignKey':_0x9e04('0x19d')});db[_0x9e04('0x9d')][_0x9e04('0xfc')](db[_0x9e04('0x9f')],{'as':'Subjects','onDelete':'cascade','foreignKey':_0x9e04('0x19e')});db[_0x9e04('0x9d')][_0x9e04('0xfc')](db[_0x9e04('0x9f')],{'as':_0x9e04('0x19f'),'onDelete':'cascade','foreignKey':_0x9e04('0x1a0')});db['SalesforceConfiguration']['hasMany'](db[_0x9e04('0x9f')],{'as':_0x9e04('0x19a'),'onDelete':'cascade','foreignKey':_0x9e04('0x1a1')});db[_0x9e04('0x9d')]['belongsTo'](db[_0x9e04('0x9b')],{'as':_0x9e04('0x14b'),'foreignKey':'AccountId'});db['SalesforceField']['hasMany'](db[_0x9e04('0x9f')],{'as':_0x9e04('0x1a2'),'foreignKey':_0x9e04('0x19e')});db[_0x9e04('0x9f')]['hasMany'](db['SalesforceField'],{'as':_0x9e04('0x1a3'),'foreignKey':_0x9e04('0x1a0')});db[_0x9e04('0x9f')][_0x9e04('0xfc')](db[_0x9e04('0x9f')],{'as':_0x9e04('0x1a4'),'foreignKey':'FieldId'});db[_0x9e04('0x9f')]['belongsTo'](db['Variable'],{'as':'Variable','foreignKey':'VariableId'});db[_0x9e04('0xa1')][_0x9e04('0xfc')](db['SugarcrmConfiguration'],{'as':'Configurations','onDelete':'cascade','foreignKey':_0x9e04('0x19d')});db[_0x9e04('0xa3')][_0x9e04('0xfc')](db['SugarcrmField'],{'as':_0x9e04('0x1a5'),'onDelete':_0x9e04('0xf9'),'foreignKey':_0x9e04('0x19e')});db[_0x9e04('0xa3')][_0x9e04('0xfc')](db[_0x9e04('0xa5')],{'as':'Descriptions','onDelete':_0x9e04('0xf9'),'foreignKey':_0x9e04('0x1a0')});db[_0x9e04('0xa3')]['hasMany'](db[_0x9e04('0xa5')],{'as':_0x9e04('0x19a'),'onDelete':_0x9e04('0xf9'),'foreignKey':_0x9e04('0x1a1')});db[_0x9e04('0xa3')]['belongsTo'](db[_0x9e04('0xa1')],{'as':_0x9e04('0x14b'),'foreignKey':_0x9e04('0x19d')});db['SugarcrmField'][_0x9e04('0xfc')](db[_0x9e04('0xa5')],{'as':_0x9e04('0x1a2'),'foreignKey':_0x9e04('0x19e')});db[_0x9e04('0xa5')]['hasMany'](db[_0x9e04('0xa5')],{'as':'Description','foreignKey':_0x9e04('0x1a0')});db[_0x9e04('0xa5')][_0x9e04('0xfc')](db[_0x9e04('0xa5')],{'as':'Field','foreignKey':'FieldId'});db[_0x9e04('0xa5')][_0x9e04('0x133')](db['Variable'],{'as':'Variable','foreignKey':_0x9e04('0x1a6')});db[_0x9e04('0xa7')][_0x9e04('0xfc')](db[_0x9e04('0xa9')],{'as':_0x9e04('0x19c'),'onDelete':_0x9e04('0xf9'),'foreignKey':_0x9e04('0x19d')});db[_0x9e04('0xa9')][_0x9e04('0xfc')](db[_0x9e04('0xab')],{'as':'Subjects','onDelete':'cascade','foreignKey':_0x9e04('0x19e')});db[_0x9e04('0xa9')]['hasMany'](db[_0x9e04('0xab')],{'as':_0x9e04('0x19f'),'onDelete':'cascade','foreignKey':_0x9e04('0x1a0')});db[_0x9e04('0xa9')][_0x9e04('0xfc')](db[_0x9e04('0xab')],{'as':_0x9e04('0x19a'),'onDelete':_0x9e04('0xf9'),'foreignKey':_0x9e04('0x1a1')});db[_0x9e04('0xa9')][_0x9e04('0x133')](db[_0x9e04('0xa7')],{'as':_0x9e04('0x14b'),'foreignKey':_0x9e04('0x19d')});db[_0x9e04('0xa9')][_0x9e04('0x106')](db[_0x9e04('0x14f')],{'through':_0x9e04('0x1a7')});db[_0x9e04('0xab')]['hasMany'](db['DeskField'],{'as':'Subject','foreignKey':'SubjectId'});db[_0x9e04('0xab')][_0x9e04('0xfc')](db[_0x9e04('0xab')],{'as':_0x9e04('0x1a3'),'foreignKey':'DescriptionId'});db[_0x9e04('0xab')][_0x9e04('0xfc')](db['DeskField'],{'as':'Field','foreignKey':'FieldId'});db['DeskField']['belongsTo'](db[_0x9e04('0x1a8')],{'as':'Variable','foreignKey':_0x9e04('0x1a6')});db[_0x9e04('0xad')][_0x9e04('0xfc')](db[_0x9e04('0xaf')],{'as':_0x9e04('0x19c'),'onDelete':_0x9e04('0xf9'),'foreignKey':_0x9e04('0x19d')});db[_0x9e04('0xaf')][_0x9e04('0xfc')](db[_0x9e04('0x1a9')],{'as':'Subjects','onDelete':_0x9e04('0xf9'),'foreignKey':_0x9e04('0x19e')});db['ZohoConfiguration'][_0x9e04('0xfc')](db[_0x9e04('0x1a9')],{'as':'Descriptions','onDelete':_0x9e04('0xf9'),'foreignKey':_0x9e04('0x1a0')});db['ZohoConfiguration'][_0x9e04('0xfc')](db[_0x9e04('0x1a9')],{'as':_0x9e04('0x19a'),'onDelete':'cascade','foreignKey':'FieldId'});db['ZohoConfiguration'][_0x9e04('0x133')](db['ZohoAccount'],{'as':_0x9e04('0x14b'),'foreignKey':_0x9e04('0x19d')});db[_0x9e04('0x1a9')][_0x9e04('0xfc')](db[_0x9e04('0x1a9')],{'as':_0x9e04('0x1a2'),'foreignKey':'SubjectId'});db[_0x9e04('0x1a9')][_0x9e04('0xfc')](db[_0x9e04('0x1a9')],{'as':_0x9e04('0x1a3'),'foreignKey':_0x9e04('0x1a0')});db[_0x9e04('0x1a9')][_0x9e04('0xfc')](db[_0x9e04('0x1a9')],{'as':_0x9e04('0x1a4'),'foreignKey':_0x9e04('0x1a1')});db[_0x9e04('0x1a9')][_0x9e04('0x133')](db[_0x9e04('0x1a8')],{'as':'Variable','foreignKey':_0x9e04('0x1a6')});db[_0x9e04('0xb2')][_0x9e04('0xfc')](db[_0x9e04('0xb4')],{'as':_0x9e04('0x19c'),'onDelete':_0x9e04('0xf9'),'foreignKey':_0x9e04('0x19d')});db[_0x9e04('0xb4')][_0x9e04('0xfc')](db[_0x9e04('0x1aa')],{'as':'Subjects','foreignKey':_0x9e04('0x19e')});db[_0x9e04('0xb4')][_0x9e04('0xfc')](db[_0x9e04('0x1aa')],{'as':_0x9e04('0x19f'),'foreignKey':'DescriptionId'});db['ZendeskConfiguration'][_0x9e04('0xfc')](db[_0x9e04('0x1aa')],{'as':_0x9e04('0x19a'),'foreignKey':_0x9e04('0x1a1')});db[_0x9e04('0xb4')][_0x9e04('0x133')](db[_0x9e04('0xb2')],{'as':_0x9e04('0x14b'),'foreignKey':'AccountId'});db[_0x9e04('0xb4')][_0x9e04('0x106')](db[_0x9e04('0x14f')],{'through':'int_zendesk_configuration_has_tags'});db[_0x9e04('0x1aa')][_0x9e04('0xfc')](db['ZendeskField'],{'as':_0x9e04('0x1a2'),'foreignKey':_0x9e04('0x19e')});db[_0x9e04('0x1aa')][_0x9e04('0xfc')](db['ZendeskField'],{'as':_0x9e04('0x1a3'),'foreignKey':_0x9e04('0x1a0')});db[_0x9e04('0x1aa')][_0x9e04('0xfc')](db[_0x9e04('0x1aa')],{'as':_0x9e04('0x1a4'),'foreignKey':_0x9e04('0x1a1')});db[_0x9e04('0x1aa')][_0x9e04('0x133')](db['Variable'],{'as':_0x9e04('0x1a8'),'foreignKey':_0x9e04('0x1a6')});db[_0x9e04('0xb6')]['hasMany'](db[_0x9e04('0xb8')],{'as':_0x9e04('0x19c'),'onDelete':_0x9e04('0xf9'),'foreignKey':_0x9e04('0x19d')});db[_0x9e04('0xb8')][_0x9e04('0xfc')](db[_0x9e04('0x1ab')],{'as':_0x9e04('0x1a5'),'onDelete':_0x9e04('0xf9'),'foreignKey':_0x9e04('0x19e')});db[_0x9e04('0xb8')][_0x9e04('0xfc')](db[_0x9e04('0x1ab')],{'as':_0x9e04('0x19f'),'onDelete':_0x9e04('0xf9'),'foreignKey':_0x9e04('0x1a0')});db[_0x9e04('0xb8')]['hasMany'](db[_0x9e04('0x1ab')],{'as':_0x9e04('0x19a'),'onDelete':_0x9e04('0xf9'),'foreignKey':_0x9e04('0x1a1')});db[_0x9e04('0xb8')][_0x9e04('0x133')](db['FreshdeskAccount'],{'as':'Account','foreignKey':_0x9e04('0x19d')});db[_0x9e04('0xb8')][_0x9e04('0x106')](db[_0x9e04('0x14f')],{'through':'int_freshdesk_configuration_has_tags'});db[_0x9e04('0x1ab')]['hasMany'](db[_0x9e04('0x1ab')],{'as':'Subject','foreignKey':_0x9e04('0x19e')});db[_0x9e04('0x1ab')]['hasMany'](db[_0x9e04('0x1ab')],{'as':_0x9e04('0x1a3'),'foreignKey':_0x9e04('0x1a0')});db[_0x9e04('0x1ab')][_0x9e04('0xfc')](db['FreshdeskField'],{'as':_0x9e04('0x1a4'),'foreignKey':'FieldId'});db[_0x9e04('0x1ab')][_0x9e04('0x133')](db[_0x9e04('0x1a8')],{'as':'Variable','foreignKey':_0x9e04('0x1a6')});db[_0x9e04('0xbb')][_0x9e04('0xfc')](db[_0x9e04('0xbc')],{'as':_0x9e04('0x19c'),'onDelete':_0x9e04('0xf9'),'foreignKey':_0x9e04('0x19d')});db[_0x9e04('0xbc')][_0x9e04('0xfc')](db['VtigerField'],{'as':_0x9e04('0x1a5'),'foreignKey':_0x9e04('0x19e')});db[_0x9e04('0xbc')][_0x9e04('0xfc')](db[_0x9e04('0xbd')],{'as':_0x9e04('0x19f'),'foreignKey':'DescriptionId'});db[_0x9e04('0xbc')][_0x9e04('0xfc')](db[_0x9e04('0xbd')],{'as':_0x9e04('0x19a'),'foreignKey':_0x9e04('0x1a1')});db[_0x9e04('0xbc')]['belongsTo'](db[_0x9e04('0xbb')],{'as':_0x9e04('0x14b'),'foreignKey':_0x9e04('0x19d')});db[_0x9e04('0xbd')][_0x9e04('0xfc')](db[_0x9e04('0xbd')],{'as':_0x9e04('0x1a2'),'foreignKey':_0x9e04('0x19e')});db[_0x9e04('0xbd')][_0x9e04('0xfc')](db[_0x9e04('0xbd')],{'as':'Description','foreignKey':_0x9e04('0x1a0')});db[_0x9e04('0xbd')]['hasMany'](db[_0x9e04('0xbd')],{'as':_0x9e04('0x1a4'),'foreignKey':'FieldId'});db['VtigerField'][_0x9e04('0x133')](db[_0x9e04('0x1a8')],{'as':_0x9e04('0x1a8'),'foreignKey':_0x9e04('0x1a6')});db['ServicenowAccount']['hasMany'](db['ServicenowConfiguration'],{'as':_0x9e04('0x19c'),'onDelete':_0x9e04('0xf9'),'foreignKey':'AccountId'});db[_0x9e04('0x1ac')][_0x9e04('0xfc')](db[_0x9e04('0x1ad')],{'as':_0x9e04('0x1a5'),'foreignKey':_0x9e04('0x19e')});db[_0x9e04('0x1ac')][_0x9e04('0xfc')](db[_0x9e04('0x1ad')],{'as':'Descriptions','foreignKey':_0x9e04('0x1a0')});db['ServicenowConfiguration'][_0x9e04('0xfc')](db[_0x9e04('0x1ad')],{'as':_0x9e04('0x19a'),'foreignKey':_0x9e04('0x1a1')});db[_0x9e04('0x1ac')][_0x9e04('0x133')](db[_0x9e04('0xbf')],{'as':'Account','foreignKey':_0x9e04('0x19d')});db[_0x9e04('0x1ad')]['hasMany'](db[_0x9e04('0x1ad')],{'as':'Subject','foreignKey':'SubjectId'});db[_0x9e04('0x1ad')]['hasMany'](db[_0x9e04('0x1ad')],{'as':_0x9e04('0x1a3'),'foreignKey':_0x9e04('0x1a0')});db['ServicenowField']['hasMany'](db[_0x9e04('0x1ad')],{'as':'Field','foreignKey':_0x9e04('0x1a1')});db[_0x9e04('0x1ad')][_0x9e04('0x133')](db[_0x9e04('0x1a8')],{'as':_0x9e04('0x1a8'),'foreignKey':_0x9e04('0x1a6')});db[_0x9e04('0xc3')][_0x9e04('0xfc')](db[_0x9e04('0xc5')],{'as':_0x9e04('0x19c'),'onDelete':_0x9e04('0xf9'),'foreignKey':'AccountId'});db[_0x9e04('0xc5')][_0x9e04('0xfc')](db['Dynamics365Field'],{'as':_0x9e04('0x1a5'),'onDelete':'cascade','foreignKey':'SubjectId'});db[_0x9e04('0xc5')]['hasMany'](db[_0x9e04('0xc7')],{'as':_0x9e04('0x19f'),'onDelete':_0x9e04('0xf9'),'foreignKey':_0x9e04('0x1a0')});db['Dynamics365Configuration'][_0x9e04('0xfc')](db['Dynamics365Field'],{'as':_0x9e04('0x19a'),'onDelete':_0x9e04('0xf9'),'foreignKey':_0x9e04('0x1a1')});db[_0x9e04('0xc5')][_0x9e04('0x133')](db[_0x9e04('0xc3')],{'as':_0x9e04('0x14b'),'foreignKey':_0x9e04('0x19d')});db['Dynamics365Field'][_0x9e04('0xfc')](db[_0x9e04('0xc7')],{'as':_0x9e04('0x1a2'),'foreignKey':'SubjectId'});db[_0x9e04('0xc7')][_0x9e04('0xfc')](db[_0x9e04('0xc7')],{'as':_0x9e04('0x1a3'),'foreignKey':_0x9e04('0x1a0')});db[_0x9e04('0xc7')]['hasMany'](db['Dynamics365Field'],{'as':'Field','foreignKey':_0x9e04('0x1a1')});db[_0x9e04('0xc7')][_0x9e04('0x133')](db[_0x9e04('0x1a8')],{'as':_0x9e04('0x1a8'),'foreignKey':'VariableId'});db[_0x9e04('0xc9')][_0x9e04('0xfc')](db[_0x9e04('0xcb')],{'as':'Configurations','onDelete':_0x9e04('0xf9'),'foreignKey':_0x9e04('0x19d')});db['FreshsalesConfiguration']['hasMany'](db[_0x9e04('0xcc')],{'as':'Subjects','foreignKey':_0x9e04('0x19e')});db['FreshsalesConfiguration'][_0x9e04('0xfc')](db[_0x9e04('0xcc')],{'as':_0x9e04('0x19f'),'foreignKey':_0x9e04('0x1a0')});db[_0x9e04('0xcb')][_0x9e04('0xfc')](db['FreshsalesField'],{'as':_0x9e04('0x19a'),'foreignKey':_0x9e04('0x1a1')});db[_0x9e04('0xcb')][_0x9e04('0x133')](db[_0x9e04('0xc9')],{'as':_0x9e04('0x14b'),'foreignKey':_0x9e04('0x19d')});db[_0x9e04('0xcc')][_0x9e04('0xfc')](db[_0x9e04('0xcc')],{'as':_0x9e04('0x1a2'),'foreignKey':_0x9e04('0x19e')});db[_0x9e04('0xcc')][_0x9e04('0xfc')](db['FreshsalesField'],{'as':_0x9e04('0x1a3'),'foreignKey':_0x9e04('0x1a0')});db[_0x9e04('0xcc')][_0x9e04('0xfc')](db['FreshsalesField'],{'as':_0x9e04('0x1a4'),'foreignKey':_0x9e04('0x1a1')});db[_0x9e04('0xcc')][_0x9e04('0x133')](db[_0x9e04('0x1a8')],{'as':'Variable','foreignKey':'VariableId'});db[_0x9e04('0x1ae')][_0x9e04('0x133')](db[_0x9e04('0x11b')],{});db[_0x9e04('0x1ae')][_0x9e04('0x133')](db[_0x9e04('0x118')],{'as':_0x9e04('0x15c'),'foreignKey':_0x9e04('0x148')});db[_0x9e04('0x1ae')]['belongsTo'](db['CmContact'],{'as':_0x9e04('0x14c'),'foreignKey':_0x9e04('0x14d')});db['ChatQueueReport']['belongsTo'](db['ChatInteraction'],{});db[_0x9e04('0x1ae')]['belongsTo'](db[_0x9e04('0x69')],{});db[_0x9e04('0x1ae')][_0x9e04('0x133')](db[_0x9e04('0x13')],{});db[_0x9e04('0x1ae')][_0x9e04('0x133')](db['ChatQueue'],{});db[_0x9e04('0xcf')]['belongsTo'](db[_0x9e04('0x13')],{'onDelete':_0x9e04('0xf9'),'foreignKey':_0x9e04('0x1af')});db[_0x9e04('0xcf')][_0x9e04('0x133')](db['User'],{'onDelete':_0x9e04('0xf9'),'foreignKey':_0x9e04('0x1b0')});db[_0x9e04('0xd4')][_0x9e04('0xfc')](db[_0x9e04('0xd2')],{'foreignKey':_0x9e04('0x1b1'),'onDelete':_0x9e04('0xf9')});db['JscriptySessionReport'][_0x9e04('0xfc')](db[_0x9e04('0xd0')],{'foreignKey':_0x9e04('0x1b1'),'onDelete':_0x9e04('0xf9')});db[_0x9e04('0x1b2')][_0x9e04('0x133')](db[_0x9e04('0x167')],{});db[_0x9e04('0x1b2')][_0x9e04('0x133')](db[_0x9e04('0x118')],{'as':'List','foreignKey':'ListId'});db[_0x9e04('0x1b2')][_0x9e04('0x133')](db[_0x9e04('0x109')],{'as':_0x9e04('0x14c'),'foreignKey':_0x9e04('0x14d')});db[_0x9e04('0x1b2')]['belongsTo'](db[_0x9e04('0x103')],{});db[_0x9e04('0x1b2')][_0x9e04('0x133')](db['SmsMessage'],{});db[_0x9e04('0x1b2')][_0x9e04('0x133')](db[_0x9e04('0x13')],{});db[_0x9e04('0x1b2')]['belongsTo'](db[_0x9e04('0x5d')],{});db[_0x9e04('0x1b3')][_0x9e04('0xfc')](db[_0x9e04('0xd4')],{'foreignKey':_0x9e04('0x1b4')});db[_0x9e04('0x1b3')]['hasMany'](db['JscriptyQuestionReport'],{'foreignKey':_0x9e04('0x1b4')});db[_0x9e04('0x1b3')][_0x9e04('0xfc')](db[_0x9e04('0xd0')],{'foreignKey':_0x9e04('0x1b4')});db[_0x9e04('0xe0')]['belongsToMany'](db[_0x9e04('0x13')],{'as':_0x9e04('0x152'),'through':'user_has_square_projects'});db['Team'][_0x9e04('0x106')](db['User'],{'as':'Agents','through':_0x9e04('0x10d')});db['Team'][_0x9e04('0x106')](db[_0x9e04('0x1a')],{'through':_0x9e04('0x139'),'as':_0x9e04('0x111')});db[_0x9e04('0x10c')][_0x9e04('0x106')](db[_0x9e04('0x3f')],{'through':_0x9e04('0x1b5'),'as':'MailQueues'});db[_0x9e04('0x10c')]['belongsToMany'](db[_0x9e04('0x6c')],{'through':_0x9e04('0x17b'),'as':_0x9e04('0x113')});db[_0x9e04('0x10c')][_0x9e04('0x106')](db[_0x9e04('0x53')],{'through':_0x9e04('0x166'),'as':_0x9e04('0x114')});db[_0x9e04('0x10c')][_0x9e04('0x106')](db[_0x9e04('0x5d')],{'through':_0x9e04('0x1b6'),'as':_0x9e04('0x115')});db[_0x9e04('0x10c')][_0x9e04('0x106')](db['OpenchannelQueue'],{'through':_0x9e04('0x173'),'as':_0x9e04('0x1b7')});db[_0x9e04('0xe6')][_0x9e04('0xfc')](db['CmHopper'],{'as':_0x9e04('0x12e'),'foreignKey':_0x9e04('0x1b8')});db['Campaign']['hasMany'](db[_0x9e04('0x74')],{'as':'HopperFinals','foreignKey':_0x9e04('0x1b8')});db[_0x9e04('0xe6')][_0x9e04('0xfc')](db[_0x9e04('0x100')],{'as':_0x9e04('0x12f'),'foreignKey':_0x9e04('0x1b8')});db[_0x9e04('0xe6')][_0x9e04('0xfc')](db[_0x9e04('0x130')],{'as':_0x9e04('0x131'),'foreignKey':_0x9e04('0x1b8')});db[_0x9e04('0xe6')]['belongsTo'](db[_0x9e04('0x2b')],{'as':'Trunk','foreignKey':_0x9e04('0x134')});db[_0x9e04('0xe6')][_0x9e04('0x133')](db['Trunk'],{'as':_0x9e04('0x1b9'),'foreignKey':_0x9e04('0x135')});db[_0x9e04('0xe6')]['belongsTo'](db[_0x9e04('0x80')],{'as':'Interval','foreignKey':_0x9e04('0x159')});db[_0x9e04('0xe6')][_0x9e04('0x133')](db['SquareProject'],{'as':_0x9e04('0xe0'),'foreignKey':'SquareProjectId'});db[_0x9e04('0xe6')][_0x9e04('0x106')](db[_0x9e04('0x118')],{'as':'Lists','through':_0x9e04('0x1ba')});db['Campaign'][_0x9e04('0x106')](db[_0x9e04('0x118')],{'as':_0x9e04('0x13a'),'through':'campaigns_has_cm_blacklists'});db['MailTransferReport'][_0x9e04('0x133')](db['MailMessage'],{});db[_0x9e04('0x1bb')][_0x9e04('0x133')](db[_0x9e04('0x42')],{});db['MailTransferReport'][_0x9e04('0x133')](db[_0x9e04('0x3e')],{'foreignKey':'FromMailAccountId','as':'FromAccount'});db[_0x9e04('0x1bb')]['belongsTo'](db['User'],{'foreignKey':'FromUserId','as':_0x9e04('0x1bc')});db['MailTransferReport'][_0x9e04('0x133')](db[_0x9e04('0x13')],{'foreignKey':'ToUserId','as':'ToAgent'});db[_0x9e04('0x1bb')]['belongsTo'](db['MailQueue'],{'foreignKey':_0x9e04('0x1bd'),'as':_0x9e04('0x1be')});db[_0x9e04('0x1bb')]['belongsTo'](db[_0x9e04('0x3e')],{'foreignKey':_0x9e04('0x1bf'),'as':'ToAccount'});db[_0x9e04('0xec')][_0x9e04('0x133')](db[_0x9e04('0x69')],{});db['ChatTransferReport'][_0x9e04('0x133')](db[_0x9e04('0x67')],{});db[_0x9e04('0xec')]['belongsTo'](db[_0x9e04('0x11b')],{'foreignKey':_0x9e04('0x1c0'),'as':_0x9e04('0x1c1')});db[_0x9e04('0xec')]['belongsTo'](db[_0x9e04('0x13')],{'foreignKey':'FromUserId','as':_0x9e04('0x1bc')});db['ChatTransferReport'][_0x9e04('0x133')](db[_0x9e04('0x13')],{'foreignKey':_0x9e04('0x1c2'),'as':'ToAgent'});db[_0x9e04('0xec')][_0x9e04('0x133')](db['ChatQueue'],{'foreignKey':_0x9e04('0x1c3'),'as':_0x9e04('0x1be')});db['ChatTransferReport']['belongsTo'](db[_0x9e04('0x11b')],{'foreignKey':_0x9e04('0x1c4'),'as':'ToAccount'});db[_0x9e04('0xee')][_0x9e04('0x133')](db[_0x9e04('0x51')],{});db[_0x9e04('0xee')][_0x9e04('0x133')](db[_0x9e04('0x4f')],{});db['FaxTransferReport'][_0x9e04('0x133')](db[_0x9e04('0x4c')],{'foreignKey':_0x9e04('0x1c5'),'as':_0x9e04('0x1c1')});db['FaxTransferReport']['belongsTo'](db[_0x9e04('0x13')],{'foreignKey':_0x9e04('0x1c6'),'as':_0x9e04('0x1bc')});db[_0x9e04('0xee')][_0x9e04('0x133')](db['User'],{'foreignKey':_0x9e04('0x1c2'),'as':_0x9e04('0x1c7')});db[_0x9e04('0xee')][_0x9e04('0x133')](db[_0x9e04('0x53')],{'foreignKey':_0x9e04('0x1c8'),'as':_0x9e04('0x1be')});db[_0x9e04('0xee')][_0x9e04('0x133')](db[_0x9e04('0x4c')],{'foreignKey':_0x9e04('0x1c9'),'as':'ToAccount'});db[_0x9e04('0x1ca')][_0x9e04('0x133')](db[_0x9e04('0x62')],{});db[_0x9e04('0x1ca')]['belongsTo'](db[_0x9e04('0x61')],{});db[_0x9e04('0x1ca')][_0x9e04('0x133')](db['OpenchannelAccount'],{'foreignKey':_0x9e04('0x1cb'),'as':'FromAccount'});db[_0x9e04('0x1ca')][_0x9e04('0x133')](db[_0x9e04('0x13')],{'foreignKey':_0x9e04('0x1c6'),'as':_0x9e04('0x1bc')});db[_0x9e04('0x1ca')]['belongsTo'](db[_0x9e04('0x13')],{'foreignKey':_0x9e04('0x1c2'),'as':_0x9e04('0x1c7')});db[_0x9e04('0x1ca')][_0x9e04('0x133')](db['OpenchannelQueue'],{'foreignKey':_0x9e04('0x1cc'),'as':'ToQueue'});db[_0x9e04('0x1ca')][_0x9e04('0x133')](db['OpenchannelAccount'],{'foreignKey':'ToOpenchannelAccountId','as':_0x9e04('0x1cd')});db[_0x9e04('0x1ce')][_0x9e04('0x133')](db['SmsMessage'],{});db[_0x9e04('0x1ce')][_0x9e04('0x133')](db[_0x9e04('0x103')],{});db['SmsTransferReport'][_0x9e04('0x133')](db[_0x9e04('0x167')],{'foreignKey':'FromSmsAccountId','as':_0x9e04('0x1c1')});db[_0x9e04('0x1ce')]['belongsTo'](db[_0x9e04('0x13')],{'foreignKey':_0x9e04('0x1c6'),'as':_0x9e04('0x1bc')});db['SmsTransferReport'][_0x9e04('0x133')](db[_0x9e04('0x13')],{'foreignKey':'ToUserId','as':_0x9e04('0x1c7')});db['SmsTransferReport'][_0x9e04('0x133')](db[_0x9e04('0x5d')],{'foreignKey':_0x9e04('0x1cf'),'as':_0x9e04('0x1be')});db[_0x9e04('0x1ce')]['belongsTo'](db[_0x9e04('0x167')],{'foreignKey':_0x9e04('0x1d0'),'as':'ToAccount'});db['CmList'][_0x9e04('0xfc')](db['Disposition'],{'as':'Dispositions','foreignKey':_0x9e04('0x148')});db[_0x9e04('0x118')]['hasMany'](db['CmCustomField'],{'as':_0x9e04('0x1d1'),'foreignKey':_0x9e04('0x148')});db[_0x9e04('0x118')][_0x9e04('0xfc')](db[_0x9e04('0x109')],{'as':_0x9e04('0x10a'),'onDelete':'cascade','foreignKey':_0x9e04('0x148')});db['CmList'][_0x9e04('0xfc')](db[_0x9e04('0x74')],{'as':_0x9e04('0xff'),'foreignKey':_0x9e04('0x148')});db['CmList']['hasMany'](db['CmHopperHistory'],{'as':_0x9e04('0x1d2'),'foreignKey':_0x9e04('0x148')});db[_0x9e04('0x118')][_0x9e04('0xfc')](db[_0x9e04('0x75')],{'as':_0x9e04('0x75'),'foreignKey':_0x9e04('0x148')});db[_0x9e04('0x118')][_0x9e04('0x106')](db[_0x9e04('0x1a')],{'as':_0x9e04('0x1d3'),'through':_0x9e04('0x138')});db[_0x9e04('0x118')][_0x9e04('0x106')](db[_0x9e04('0x13')],{'as':_0x9e04('0x149'),'through':_0x9e04('0x1d4')});db[_0x9e04('0xf0')][_0x9e04('0xfc')](db['VoiceExtension'],{'as':_0x9e04('0x18d'),'onDelete':'restrict'});db[_0x9e04('0xf0')]['belongsToMany'](db[_0x9e04('0x13')],{'as':_0x9e04('0x149'),'through':_0x9e04('0x11a')});db[_0x9e04('0xf2')][_0x9e04('0xfc')](db['User'],{'as':'Users','foreignKey':_0x9e04('0x105')});db[_0x9e04('0xf2')][_0x9e04('0xfc')](db[_0x9e04('0xf4')],{'as':_0x9e04('0x1d5'),'foreignKey':_0x9e04('0x105'),'onDelete':_0x9e04('0xf9')});db[_0x9e04('0xf4')]['hasMany'](db[_0x9e04('0xf6')],{'as':'Resources','foreignKey':'sectionId','onDelete':_0x9e04('0xf9')});module[_0x9e04('0x1d6')]={'db':db,'dbH':dbH};
\ No newline at end of file
+var _0x0eff=['ChatTransferReport','../api/chatTransferReport/chatTransferReport.model','FaxTransferReport','../api/faxTransferReport/faxTransferReport.model','OpenchannelTransferReport','../api/openchannelTransferReport/openchannelTransferReport.model','SmsTransferReport','../api/cmList/cmList.model','VoicePrefix','../api/voicePrefix/voicePrefix.model','UserProfile','../api/userProfileSection/userProfileSection.model','UserProfileResource','../api/userProfileResource/userProfileResource.model','hasOne','VoiceMail','hasMany','Recordings','UserId','VoiceQueuesRt','cascade','HopperFinals','HopperHistory','OpenchannelInteraction','OpenchannelInteractions','ChatInteractions','SmsInteraction','SmsInteractions','FaxInteractions','MailInteractions','belongsToMany','Contacts','cm_user_has_contacts','CmList','Lists','user_has_teams','user_has_chat_interactions','user_has_fax_interactions','user_has_sms_interactions','VoiceQueues','MailQueues','ChatQueues','FaxQueue','FaxQueues','cm_user_has_lists','VoicePrefixes','user_has_voice_prefixes','ChatWebsites','user_has_chat_websites','user_has_fax_accounts','MailAccounts','user_has_mail_accounts','OpenchannelAccount','user_has_openchannel_accounts','SmsAccounts','SquareProjects','user_has_square_projects','VoiceChanSpy','Applications','Sounds','moh_has_sounds','Members','VoiceQueueId','Hoppers','HopperHistories','CmHopperBlack','HopperBlacks','belongsTo','Trunk','TrunkId','TrunkBackup','Interval','IntervalId','mandatoryDispositionPause','mandatoryDispositionPauseId','voice_queues_has_cm_lists','Agents','Teams','team_has_voice_queues','BlackLists','voice_queues_has_cm_blacklists','Messages','mailboxuser','mailbox','QueueCalls','uniqueid','VoiceAgentReport','Contact','ContactId','MailServerIn','MailAccountId','Imap','Smtp','Dispositions','Answers','Interactions','ListId','TemplateId','team_has_mail_queues','MailInteractionId','Owner','Tag','mail_interaction_has_tags','ThroughTags','Users','user_has_mail_interactions','MailMessage','Attachments','Interaction','MailApplication','restrict','TagId','List','Items','FaxAccountId','Account','Tags','fax_interaction_has_tags','FaxInteractionId','SmsAccountId','user_has_sms_accounts','SmsInteractionId','sms_interaction_has_tags','team_has_sms_queues','OpenchannelAccountId','OpenchannelQueueId','OpenchannelInteractionId','openchannel_interaction_has_tags','user_has_openchannel_interactions','AttachmentId','team_has_openchannel_queues','ChatWebsiteId','ProactiveActions','OpenchannelQueueReport','Agent','Queue','ChatMessage','ChatInteractionId','chat_interaction_has_tags','team_has_chat_queues','chat_group_has_users','ChatProactiveAction','Website','CompanyId','JscriptySessions','Company','cm_contact_has_tags','Campaign','CampaignId','Automation','All','OneAll','AutomationAllId','Any','OneAny','AutomationAnyId','Actions','AutomationId','Extensions','MailApplications','ChatApplications','FaxApplications','SmsApplications','DefaultReportId','CustomReportId','Mohs','Trigger','AllConditions','AllCondition','AnyConditions','AnyCondition','TriggerAnyId','TriggerId','Fields','MetricId','Configurations','Subjects','SubjectId','Descriptions','DescriptionId','FieldId','AccountId','Subject','Description','Field','VariableId','DeskAccount','DeskConfiguration','int_desk_configuration_has_tags','ZohoAccount','ZohoConfiguration','int_zendesk_configuration_has_tags','int_freshdesk_configuration_has_tags','VtigerField','Dynamics365Account','FreshsalesAccount','FreshsalesConfiguration','FreshsalesField','FromId','ToId','SessionId','ProjectId','team_has_fax_queues','SmsQueues','OpenchannelQueues','TrunkBackupId','SquareProjectId','campaigns_has_cm_lists','campaigns_has_cm_blacklists','FromMailAccountId','FromAccount','FromUserId','FromAgent','ToMailQueueId','ToQueue','ToMailAccountId','ToUserId','ToChatQueueId','ToChatWebsiteId','FromFaxAccountId','ToAccount','FromOpenchannelAccountId','ToAgent','ToOpenchannelQueueId','ToOpenchannelAccountId','FromSmsAccountId','ToSmsAccountId','CustomFields','Queues','userProfileId','UserProfileSection','UserProfileSections','Resources','sectionId','exports','path','../config/environment','jstz','determine','sequelize','defaultsDeep','xcall','xC@LL1234','mysql','utf8mb4','name','utf8','utf8_general_ci','sequelizeHistory','motion2','127.0.0.1','database','username','password','options','User','import','../api/user/user.model','../api/voiceChanSpy/voiceChanSpy.model','VoiceContext','../api/voiceContext/voiceContext.model','VoiceExtension','VoiceMusicOnHold','../api/voiceMusicOnHold/voiceMusicOnHold.model','VoiceQueue','../api/voiceQueue/voiceQueue.model','VoiceRecording','../api/voiceRecording/voiceRecording.model','ScreenRecording','../api/screenRecording/screenRecording.model','../api/voiceMail/voiceMail.model','VoiceMailMessage','VoiceCallReport','../api/voiceCallReport/voiceCallReport.model','VoiceDialReport','../api/voiceDialReport/voiceDialReport.model','../api/voiceAgentReport/voiceAgentReport.model','VoiceQueueReport','../api/voiceQueueReport/voiceQueueReport.model','MemberReport','../api/trunk/trunk.model','VoiceTransferReport','../api/voiceTransferReport/voiceTransferReport.model','UserVoiceQueueRt','../api/userVoiceQueueRt/userVoiceQueueRt.model','UserVoiceQueue','UserChatQueue','../api/userChatQueue/userChatQueue.model','UserMailQueue','../api/userMailQueue/userMailQueue.model','UserFaxQueue','../api/userFaxQueue/userFaxQueue.model','UserSmsQueue','../api/userSmsQueue/userSmsQueue.model','UserOpenchannelQueue','../api/userOpenchannelQueue/userOpenchannelQueue.model','../api/mailServerIn/mailServerIn.model','MailServerOut','../api/mailServerOut/mailServerOut.model','MailAccount','../api/mailAccount/mailAccount.model','MailQueue','MailSubstatus','../api/mailSubstatus/mailSubstatus.model','MailInteraction','../api/mailApplication/mailApplication.model','MailQueueReport','../api/mailQueueReport/mailQueueReport.model','Dashboard','../api/dashboard/dashboard.model','DashboardItem','FaxAccount','../api/faxAccount/faxAccount.model','FaxApplication','FaxInteraction','../api/faxInteraction/faxInteraction.model','FaxMessage','../api/faxMessage/faxMessage.model','../api/faxQueue/faxQueue.model','FaxQueueReport','../api/faxQueueReport/faxQueueReport.model','SmsAccount','../api/smsAccount/smsAccount.model','SmsApplication','../api/smsApplication/smsApplication.model','../api/smsInteraction/smsInteraction.model','SmsMessage','../api/smsMessage/smsMessage.model','SmsQueue','../api/smsQueue/smsQueue.model','../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','../api/chatApplication/chatApplication.model','ChatInteraction','../api/chatInteraction/chatInteraction.model','ChatOfflineMessage','../api/chatOfflineMessage/chatOfflineMessage.model','ChatQueue','../api/chatQueue/chatQueue.model','ChatGroup','../api/chatGroup/chatGroup.model','../api/chatProactiveAction/chatProactiveAction.model','CmCompany','../api/cmCompany/cmCompany.model','CmContact','../api/cmContact/cmContact.model','CmHopper','../api/cmHopper/cmHopper.model','CmHopperFinal','../api/cmHopperFinal/cmHopperFinal.model','CmHopperHistory','../api/cmHopperHistory/cmHopperHistory.model','ReportAgentPreview','../api/reportAgentPreview/reportAgentPreview.model','CmCustomField','../api/cmCustomField/cmCustomField.model','Action','../api/action/action.model','../api/automation/automation.model','CannedAnswer','../api/cannedAnswer/cannedAnswer.model','Disposition','../api/disposition/disposition.model','Condition','../api/interval/interval.model','Pause','../api/pause/pause.model','Cdr','VoiceQueuesLog','Schedule','../api/schedule/schedule.model','Sound','../api/sound/sound.model','Template','../api/template/template.model','../api/trigger/trigger.model','Variable','../api/variable/variable.model','Integration','../api/integration/integration.model','IntegrationReport','../api/integrationReport/integrationReport.model','AnalyticCustomReport','AnalyticDefaultReport','AnalyticExtractedReport','../api/analyticExtractedReport/analyticExtractedReport.model','AnalyticMetric','../api/analyticMetric/analyticMetric.model','AnalyticFieldReport','../api/analyticFieldReport/analyticFieldReport.model','AnalyticTreeReport','../api/analyticTreeReport/analyticTreeReport.model','SalesforceAccount','SalesforceConfiguration','SalesforceField','../api/intSalesforceField/intSalesforceField.model','SugarcrmAccount','../api/intSugarcrmAccount/intSugarcrmAccount.model','SugarcrmConfiguration','SugarcrmField','../api/intSugarcrmField/intSugarcrmField.model','../api/intDeskAccount/intDeskAccount.model','../api/intDeskConfiguration/intDeskConfiguration.model','DeskField','../api/intZohoAccount/intZohoAccount.model','../api/intZohoConfiguration/intZohoConfiguration.model','ZohoField','../api/intZohoField/intZohoField.model','ZendeskAccount','../api/intZendeskAccount/intZendeskAccount.model','ZendeskConfiguration','ZendeskField','FreshdeskAccount','../api/intFreshdeskAccount/intFreshdeskAccount.model','FreshdeskConfiguration','../api/intFreshdeskConfiguration/intFreshdeskConfiguration.model','FreshdeskField','VtigerAccount','VtigerConfiguration','../api/intVtigerConfiguration/intVtigerConfiguration.model','ServicenowAccount','../api/intServicenowAccount/intServicenowAccount.model','ServicenowConfiguration','../api/intServicenowConfiguration/intServicenowConfiguration.model','ServicenowField','../api/intServicenowField/intServicenowField.model','../api/intDynamics365Account/intDynamics365Account.model','Dynamics365Configuration','../api/intDynamics365Configuration/intDynamics365Configuration.model','Dynamics365Field','../api/intDynamics365Field/intDynamics365Field.model','../api/intFreshsalesAccount/intFreshsalesAccount.model','../api/intFreshsalesConfiguration/intFreshsalesConfiguration.model','../api/intFreshsalesField/intFreshsalesField.model','Network','ChatQueueReport','../api/chatQueueReport/chatQueueReport.model','ChatInternalMessage','../api/chatInternalMessage/chatInternalMessage.model','JscriptyAnswerReport','../api/jscriptyAnswerReport/jscriptyAnswerReport.model','JscriptyQuestionReport','../api/jscriptyQuestionReport/jscriptyQuestionReport.model','JscriptySessionReport','../api/jscriptySessionReport/jscriptySessionReport.model','SmsQueueReport','../api/smsQueueReport/smsQueueReport.model','../api/squareReport/squareReport.model','../api/squareReportDetail/squareReportDetail.model','JscriptyProject','../api/setting/setting.model','../api/squareOdbc/squareOdbc.model','SquareProject','../api/squareProject/squareProject.model','SquareRecording','../api/squareRecording/squareRecording.model','SquareMessage','../api/squareMessage/squareMessage.model','Team','../api/team/team.model','../api/license/license.model','../api/campaign/campaign.model','Attachment','../api/attachment/attachment.model','Plugin','../api/plugin/plugin.model','MailTransferReport','../api/mailTransferReport/mailTransferReport.model'];(function(_0x1ceaa3,_0x4974b9){var _0x146d3b=function(_0x1f7312){while(--_0x1f7312){_0x1ceaa3['push'](_0x1ceaa3['shift']());}};_0x146d3b(++_0x4974b9);}(_0x0eff,0xeb));var _0xf0ef=function(_0x8e8ca7,_0x5a5e07){_0x8e8ca7=_0x8e8ca7-0x0;var _0x561381=_0x0eff[_0x8e8ca7];return _0x561381;};'use strict';var path=require(_0xf0ef('0x0'));var config=require(_0xf0ef('0x1'));var Sequelize=require('sequelize');var _=require('lodash');var jstz=require(_0xf0ef('0x2'));var timezone=jstz[_0xf0ef('0x3')]();config[_0xf0ef('0x4')]=_[_0xf0ef('0x5')](config[_0xf0ef('0x4')],{'database':'motion2','username':_0xf0ef('0x6'),'password':_0xf0ef('0x7'),'options':{'host':'127.0.0.1','port':0xcea,'dialect':_0xf0ef('0x8'),'dialectOptions':{'charset':_0xf0ef('0x9')},'logging':![],'timezone':timezone[_0xf0ef('0xa')](),'define':{'charset':_0xf0ef('0xb'),'collate':_0xf0ef('0xc')}}});config[_0xf0ef('0xd')]=_[_0xf0ef('0x5')](config[_0xf0ef('0xd')],{'database':_0xf0ef('0xe'),'username':_0xf0ef('0x6'),'password':_0xf0ef('0x7'),'options':{'host':_0xf0ef('0xf'),'port':0xcea,'dialect':_0xf0ef('0x8'),'dialectOptions':{'charset':_0xf0ef('0x9')},'logging':![],'timezone':timezone[_0xf0ef('0xa')](),'define':{'charset':'utf8','collate':_0xf0ef('0xc')}}});var db={'Sequelize':Sequelize,'sequelize':new Sequelize(config[_0xf0ef('0x4')][_0xf0ef('0x10')],config[_0xf0ef('0x4')][_0xf0ef('0x11')],config[_0xf0ef('0x4')][_0xf0ef('0x12')],config[_0xf0ef('0x4')][_0xf0ef('0x13')])};var dbH={'Sequelize':Sequelize,'sequelize':new Sequelize(config[_0xf0ef('0xd')][_0xf0ef('0x10')],config[_0xf0ef('0xd')][_0xf0ef('0x11')],config[_0xf0ef('0xd')][_0xf0ef('0x12')],config['sequelizeHistory'][_0xf0ef('0x13')])};db[_0xf0ef('0x14')]=db[_0xf0ef('0x4')][_0xf0ef('0x15')](_0xf0ef('0x16'));db['VoiceChanSpy']=db[_0xf0ef('0x4')][_0xf0ef('0x15')](_0xf0ef('0x17'));db[_0xf0ef('0x18')]=db['sequelize']['import'](_0xf0ef('0x19'));db[_0xf0ef('0x1a')]=db[_0xf0ef('0x4')][_0xf0ef('0x15')]('../api/voiceExtension/voiceExtension.model');db[_0xf0ef('0x1b')]=db[_0xf0ef('0x4')][_0xf0ef('0x15')](_0xf0ef('0x1c'));db[_0xf0ef('0x1d')]=db[_0xf0ef('0x4')]['import'](_0xf0ef('0x1e'));db[_0xf0ef('0x1f')]=db[_0xf0ef('0x4')]['import'](_0xf0ef('0x20'));db[_0xf0ef('0x21')]=db[_0xf0ef('0x4')][_0xf0ef('0x15')](_0xf0ef('0x22'));db['VoiceMail']=db[_0xf0ef('0x4')][_0xf0ef('0x15')](_0xf0ef('0x23'));db[_0xf0ef('0x24')]=db[_0xf0ef('0x4')][_0xf0ef('0x15')]('../api/voiceMailMessage/voiceMailMessage.model');db[_0xf0ef('0x25')]=db['sequelize'][_0xf0ef('0x15')](_0xf0ef('0x26'));db[_0xf0ef('0x27')]=db[_0xf0ef('0x4')][_0xf0ef('0x15')](_0xf0ef('0x28'));db['VoiceAgentReport']=db['sequelize']['import'](_0xf0ef('0x29'));db[_0xf0ef('0x2a')]=db[_0xf0ef('0x4')][_0xf0ef('0x15')](_0xf0ef('0x2b'));db[_0xf0ef('0x2c')]=db[_0xf0ef('0x4')]['import']('../api/memberReport/memberReport.model');db['Trunk']=db['sequelize'][_0xf0ef('0x15')](_0xf0ef('0x2d'));db[_0xf0ef('0x2e')]=db[_0xf0ef('0x4')][_0xf0ef('0x15')](_0xf0ef('0x2f'));db[_0xf0ef('0x30')]=db['sequelize'][_0xf0ef('0x15')](_0xf0ef('0x31'));db[_0xf0ef('0x32')]=db[_0xf0ef('0x4')][_0xf0ef('0x15')]('../api/userVoiceQueue/userVoiceQueue.model');db[_0xf0ef('0x33')]=db['sequelize'][_0xf0ef('0x15')](_0xf0ef('0x34'));db[_0xf0ef('0x35')]=db[_0xf0ef('0x4')][_0xf0ef('0x15')](_0xf0ef('0x36'));db[_0xf0ef('0x37')]=db[_0xf0ef('0x4')][_0xf0ef('0x15')](_0xf0ef('0x38'));db[_0xf0ef('0x39')]=db['sequelize'][_0xf0ef('0x15')](_0xf0ef('0x3a'));db[_0xf0ef('0x3b')]=db[_0xf0ef('0x4')][_0xf0ef('0x15')](_0xf0ef('0x3c'));db['MailServerIn']=db[_0xf0ef('0x4')]['import'](_0xf0ef('0x3d'));db[_0xf0ef('0x3e')]=db[_0xf0ef('0x4')]['import'](_0xf0ef('0x3f'));db[_0xf0ef('0x40')]=db[_0xf0ef('0x4')]['import'](_0xf0ef('0x41'));db[_0xf0ef('0x42')]=db[_0xf0ef('0x4')]['import']('../api/mailQueue/mailQueue.model');db[_0xf0ef('0x43')]=db[_0xf0ef('0x4')][_0xf0ef('0x15')](_0xf0ef('0x44'));db[_0xf0ef('0x45')]=db['sequelize'][_0xf0ef('0x15')]('../api/mailInteraction/mailInteraction.model');db['MailMessage']=db[_0xf0ef('0x4')]['import']('../api/mailMessage/mailMessage.model');db['MailApplication']=db['sequelize'][_0xf0ef('0x15')](_0xf0ef('0x46'));db[_0xf0ef('0x47')]=db['sequelize'][_0xf0ef('0x15')](_0xf0ef('0x48'));db[_0xf0ef('0x49')]=db[_0xf0ef('0x4')]['import'](_0xf0ef('0x4a'));db[_0xf0ef('0x4b')]=db[_0xf0ef('0x4')][_0xf0ef('0x15')]('../api/dashboardItem/dashboardItem.model');db[_0xf0ef('0x4c')]=db[_0xf0ef('0x4')][_0xf0ef('0x15')](_0xf0ef('0x4d'));db[_0xf0ef('0x4e')]=db[_0xf0ef('0x4')][_0xf0ef('0x15')]('../api/faxApplication/faxApplication.model');db[_0xf0ef('0x4f')]=db[_0xf0ef('0x4')]['import'](_0xf0ef('0x50'));db[_0xf0ef('0x51')]=db[_0xf0ef('0x4')][_0xf0ef('0x15')](_0xf0ef('0x52'));db['FaxQueue']=db[_0xf0ef('0x4')][_0xf0ef('0x15')](_0xf0ef('0x53'));db[_0xf0ef('0x54')]=db[_0xf0ef('0x4')][_0xf0ef('0x15')](_0xf0ef('0x55'));db[_0xf0ef('0x56')]=db[_0xf0ef('0x4')][_0xf0ef('0x15')](_0xf0ef('0x57'));db[_0xf0ef('0x58')]=db[_0xf0ef('0x4')][_0xf0ef('0x15')](_0xf0ef('0x59'));db['SmsInteraction']=db[_0xf0ef('0x4')]['import'](_0xf0ef('0x5a'));db[_0xf0ef('0x5b')]=db['sequelize'][_0xf0ef('0x15')](_0xf0ef('0x5c'));db[_0xf0ef('0x5d')]=db[_0xf0ef('0x4')]['import'](_0xf0ef('0x5e'));db['OpenchannelAccount']=db[_0xf0ef('0x4')]['import'](_0xf0ef('0x5f'));db[_0xf0ef('0x60')]=db['sequelize'][_0xf0ef('0x15')](_0xf0ef('0x61'));db['OpenchannelInteraction']=db['sequelize']['import'](_0xf0ef('0x62'));db[_0xf0ef('0x63')]=db['sequelize'][_0xf0ef('0x15')](_0xf0ef('0x64'));db[_0xf0ef('0x65')]=db[_0xf0ef('0x4')][_0xf0ef('0x15')]('../api/openchannelQueue/openchannelQueue.model');db[_0xf0ef('0x66')]=db['sequelize']['import']('../api/chatWebsite/chatWebsite.model');db['OpenchannelQueueReport']=db[_0xf0ef('0x4')][_0xf0ef('0x15')](_0xf0ef('0x67'));db[_0xf0ef('0x68')]=db[_0xf0ef('0x4')][_0xf0ef('0x15')](_0xf0ef('0x69'));db[_0xf0ef('0x6a')]=db[_0xf0ef('0x4')]['import'](_0xf0ef('0x6b'));db['ChatMessage']=db['sequelize'][_0xf0ef('0x15')]('../api/chatMessage/chatMessage.model');db[_0xf0ef('0x6c')]=db['sequelize'][_0xf0ef('0x15')](_0xf0ef('0x6d'));db[_0xf0ef('0x6e')]=db['sequelize'][_0xf0ef('0x15')](_0xf0ef('0x6f'));db[_0xf0ef('0x70')]=db[_0xf0ef('0x4')][_0xf0ef('0x15')](_0xf0ef('0x71'));db['ChatProactiveAction']=db[_0xf0ef('0x4')][_0xf0ef('0x15')](_0xf0ef('0x72'));db[_0xf0ef('0x73')]=db['sequelize'][_0xf0ef('0x15')](_0xf0ef('0x74'));db[_0xf0ef('0x75')]=db[_0xf0ef('0x4')]['import'](_0xf0ef('0x76'));db[_0xf0ef('0x77')]=db[_0xf0ef('0x4')]['import'](_0xf0ef('0x78'));db['CmHopperBlack']=db['sequelize'][_0xf0ef('0x15')]('../api/cmHopperBlack/cmHopperBlack.model');db[_0xf0ef('0x79')]=db[_0xf0ef('0x4')][_0xf0ef('0x15')](_0xf0ef('0x7a'));db[_0xf0ef('0x7b')]=db[_0xf0ef('0x4')][_0xf0ef('0x15')](_0xf0ef('0x7c'));db[_0xf0ef('0x7d')]=db[_0xf0ef('0x4')][_0xf0ef('0x15')](_0xf0ef('0x7e'));db[_0xf0ef('0x7f')]=db[_0xf0ef('0x4')][_0xf0ef('0x15')](_0xf0ef('0x80'));db[_0xf0ef('0x81')]=db['sequelize'][_0xf0ef('0x15')](_0xf0ef('0x82'));db['Automation']=db['sequelize'][_0xf0ef('0x15')](_0xf0ef('0x83'));db[_0xf0ef('0x84')]=db[_0xf0ef('0x4')][_0xf0ef('0x15')](_0xf0ef('0x85'));db[_0xf0ef('0x86')]=db[_0xf0ef('0x4')][_0xf0ef('0x15')](_0xf0ef('0x87'));db[_0xf0ef('0x88')]=db[_0xf0ef('0x4')]['import']('../api/condition/condition.model');db['Interval']=db[_0xf0ef('0x4')][_0xf0ef('0x15')](_0xf0ef('0x89'));db[_0xf0ef('0x8a')]=db['sequelize']['import'](_0xf0ef('0x8b'));db[_0xf0ef('0x8c')]=db['sequelize']['import']('../api/cdr/cdr.model');db[_0xf0ef('0x8d')]=db[_0xf0ef('0x4')][_0xf0ef('0x15')]('../api/voiceQueuesLog/voiceQueuesLog.model');db[_0xf0ef('0x8e')]=db[_0xf0ef('0x4')]['import'](_0xf0ef('0x8f'));db[_0xf0ef('0x90')]=db[_0xf0ef('0x4')]['import'](_0xf0ef('0x91'));db['Tag']=db[_0xf0ef('0x4')][_0xf0ef('0x15')]('../api/tag/tag.model');db[_0xf0ef('0x92')]=db['sequelize'][_0xf0ef('0x15')](_0xf0ef('0x93'));db['Trigger']=db['sequelize']['import'](_0xf0ef('0x94'));db[_0xf0ef('0x95')]=db[_0xf0ef('0x4')]['import'](_0xf0ef('0x96'));db[_0xf0ef('0x97')]=db[_0xf0ef('0x4')][_0xf0ef('0x15')](_0xf0ef('0x98'));db[_0xf0ef('0x99')]=db[_0xf0ef('0x4')]['import'](_0xf0ef('0x9a'));db[_0xf0ef('0x9b')]=db[_0xf0ef('0x4')][_0xf0ef('0x15')]('../api/analyticCustomReport/analyticCustomReport.model');db[_0xf0ef('0x9c')]=db[_0xf0ef('0x4')][_0xf0ef('0x15')]('../api/analyticDefaultReport/analyticDefaultReport.model');db[_0xf0ef('0x9d')]=db[_0xf0ef('0x4')]['import'](_0xf0ef('0x9e'));db[_0xf0ef('0x9f')]=db[_0xf0ef('0x4')][_0xf0ef('0x15')](_0xf0ef('0xa0'));db[_0xf0ef('0xa1')]=db['sequelize']['import'](_0xf0ef('0xa2'));db[_0xf0ef('0xa3')]=db[_0xf0ef('0x4')][_0xf0ef('0x15')](_0xf0ef('0xa4'));db[_0xf0ef('0xa5')]=db[_0xf0ef('0x4')][_0xf0ef('0x15')]('../api/intSalesforceAccount/intSalesforceAccount.model');db[_0xf0ef('0xa6')]=db[_0xf0ef('0x4')][_0xf0ef('0x15')]('../api/intSalesforceConfiguration/intSalesforceConfiguration.model');db[_0xf0ef('0xa7')]=db[_0xf0ef('0x4')][_0xf0ef('0x15')](_0xf0ef('0xa8'));db[_0xf0ef('0xa9')]=db[_0xf0ef('0x4')][_0xf0ef('0x15')](_0xf0ef('0xaa'));db[_0xf0ef('0xab')]=db[_0xf0ef('0x4')]['import']('../api/intSugarcrmConfiguration/intSugarcrmConfiguration.model');db[_0xf0ef('0xac')]=db[_0xf0ef('0x4')][_0xf0ef('0x15')](_0xf0ef('0xad'));db['DeskAccount']=db[_0xf0ef('0x4')][_0xf0ef('0x15')](_0xf0ef('0xae'));db['DeskConfiguration']=db[_0xf0ef('0x4')][_0xf0ef('0x15')](_0xf0ef('0xaf'));db[_0xf0ef('0xb0')]=db['sequelize'][_0xf0ef('0x15')]('../api/intDeskField/intDeskField.model');db['ZohoAccount']=db[_0xf0ef('0x4')]['import'](_0xf0ef('0xb1'));db['ZohoConfiguration']=db['sequelize'][_0xf0ef('0x15')](_0xf0ef('0xb2'));db[_0xf0ef('0xb3')]=db[_0xf0ef('0x4')][_0xf0ef('0x15')](_0xf0ef('0xb4'));db[_0xf0ef('0xb5')]=db[_0xf0ef('0x4')][_0xf0ef('0x15')](_0xf0ef('0xb6'));db[_0xf0ef('0xb7')]=db[_0xf0ef('0x4')][_0xf0ef('0x15')]('../api/intZendeskConfiguration/intZendeskConfiguration.model');db[_0xf0ef('0xb8')]=db[_0xf0ef('0x4')][_0xf0ef('0x15')]('../api/intZendeskField/intZendeskField.model');db[_0xf0ef('0xb9')]=db[_0xf0ef('0x4')][_0xf0ef('0x15')](_0xf0ef('0xba'));db[_0xf0ef('0xbb')]=db['sequelize'][_0xf0ef('0x15')](_0xf0ef('0xbc'));db[_0xf0ef('0xbd')]=db['sequelize'][_0xf0ef('0x15')]('../api/intFreshdeskField/intFreshdeskField.model');db[_0xf0ef('0xbe')]=db[_0xf0ef('0x4')][_0xf0ef('0x15')]('../api/intVtigerAccount/intVtigerAccount.model');db[_0xf0ef('0xbf')]=db[_0xf0ef('0x4')][_0xf0ef('0x15')](_0xf0ef('0xc0'));db['VtigerField']=db['sequelize']['import']('../api/intVtigerField/intVtigerField.model');db[_0xf0ef('0xc1')]=db[_0xf0ef('0x4')][_0xf0ef('0x15')](_0xf0ef('0xc2'));db[_0xf0ef('0xc3')]=db[_0xf0ef('0x4')]['import'](_0xf0ef('0xc4'));db[_0xf0ef('0xc5')]=db[_0xf0ef('0x4')][_0xf0ef('0x15')](_0xf0ef('0xc6'));db['Dynamics365Account']=db[_0xf0ef('0x4')][_0xf0ef('0x15')](_0xf0ef('0xc7'));db[_0xf0ef('0xc8')]=db[_0xf0ef('0x4')][_0xf0ef('0x15')](_0xf0ef('0xc9'));db[_0xf0ef('0xca')]=db['sequelize'][_0xf0ef('0x15')](_0xf0ef('0xcb'));db['FreshsalesAccount']=db['sequelize'][_0xf0ef('0x15')](_0xf0ef('0xcc'));db['FreshsalesConfiguration']=db[_0xf0ef('0x4')][_0xf0ef('0x15')](_0xf0ef('0xcd'));db['FreshsalesField']=db[_0xf0ef('0x4')][_0xf0ef('0x15')](_0xf0ef('0xce'));db[_0xf0ef('0x97')]=db[_0xf0ef('0x4')][_0xf0ef('0x15')](_0xf0ef('0x98'));db[_0xf0ef('0xcf')]=db[_0xf0ef('0x4')]['import']('../api/network/network.model');db[_0xf0ef('0xd0')]=db[_0xf0ef('0x4')][_0xf0ef('0x15')](_0xf0ef('0xd1'));db[_0xf0ef('0xd2')]=db['sequelize'][_0xf0ef('0x15')](_0xf0ef('0xd3'));db[_0xf0ef('0xd4')]=db[_0xf0ef('0x4')]['import'](_0xf0ef('0xd5'));db[_0xf0ef('0xd6')]=db['sequelize'][_0xf0ef('0x15')](_0xf0ef('0xd7'));db[_0xf0ef('0xd8')]=db['sequelize'][_0xf0ef('0x15')](_0xf0ef('0xd9'));db[_0xf0ef('0xda')]=db[_0xf0ef('0x4')][_0xf0ef('0x15')](_0xf0ef('0xdb'));db['SquareReport']=db['sequelize'][_0xf0ef('0x15')](_0xf0ef('0xdc'));db['SquareDetailsReport']=db[_0xf0ef('0x4')][_0xf0ef('0x15')](_0xf0ef('0xdd'));db[_0xf0ef('0xde')]=db[_0xf0ef('0x4')][_0xf0ef('0x15')]('../api/jscriptyProject/jscriptyProject.model');db['Setting']=db[_0xf0ef('0x4')][_0xf0ef('0x15')](_0xf0ef('0xdf'));db['SquareOdbc']=db[_0xf0ef('0x4')][_0xf0ef('0x15')](_0xf0ef('0xe0'));db[_0xf0ef('0xe1')]=db[_0xf0ef('0x4')][_0xf0ef('0x15')](_0xf0ef('0xe2'));db[_0xf0ef('0xe3')]=db[_0xf0ef('0x4')][_0xf0ef('0x15')](_0xf0ef('0xe4'));db[_0xf0ef('0xe5')]=db[_0xf0ef('0x4')][_0xf0ef('0x15')](_0xf0ef('0xe6'));db[_0xf0ef('0xe7')]=db[_0xf0ef('0x4')]['import'](_0xf0ef('0xe8'));db['License']=db['sequelize'][_0xf0ef('0x15')](_0xf0ef('0xe9'));db['Campaign']=db[_0xf0ef('0x4')][_0xf0ef('0x15')](_0xf0ef('0xea'));db['Migration']=db['sequelize'][_0xf0ef('0x15')]('../api/migration/migration.model');db[_0xf0ef('0xeb')]=db['sequelize']['import'](_0xf0ef('0xec'));db[_0xf0ef('0xed')]=db[_0xf0ef('0x4')]['import'](_0xf0ef('0xee'));db[_0xf0ef('0xef')]=db[_0xf0ef('0x4')]['import'](_0xf0ef('0xf0'));db[_0xf0ef('0xf1')]=db[_0xf0ef('0x4')]['import'](_0xf0ef('0xf2'));db[_0xf0ef('0xf3')]=db[_0xf0ef('0x4')][_0xf0ef('0x15')](_0xf0ef('0xf4'));db[_0xf0ef('0xf5')]=db[_0xf0ef('0x4')][_0xf0ef('0x15')](_0xf0ef('0xf6'));db[_0xf0ef('0xf7')]=db[_0xf0ef('0x4')][_0xf0ef('0x15')]('../api/smsTransferReport/smsTransferReport.model');db['CmList']=db[_0xf0ef('0x4')][_0xf0ef('0x15')](_0xf0ef('0xf8'));db[_0xf0ef('0xf9')]=db[_0xf0ef('0x4')][_0xf0ef('0x15')](_0xf0ef('0xfa'));db[_0xf0ef('0xfb')]=db['sequelize'][_0xf0ef('0x15')]('../api/userProfile/userProfile.model');db['UserProfileSection']=db[_0xf0ef('0x4')][_0xf0ef('0x15')](_0xf0ef('0xfc'));db[_0xf0ef('0xfd')]=db['sequelize'][_0xf0ef('0x15')](_0xf0ef('0xfe'));db[_0xf0ef('0x14')][_0xf0ef('0xff')](db[_0xf0ef('0x100')],{'as':_0xf0ef('0x100'),'onDelete':'cascade','foreignKey':'UserId'});db['User'][_0xf0ef('0x101')](db['VoiceRecording'],{'as':_0xf0ef('0x102'),'foreignKey':_0xf0ef('0x103')});db[_0xf0ef('0x14')]['hasMany'](db[_0xf0ef('0x30')],{'as':_0xf0ef('0x104'),'foreignKey':_0xf0ef('0x103')});db[_0xf0ef('0x14')]['hasMany'](db[_0xf0ef('0x1a')],{'as':'Extensions','onDelete':_0xf0ef('0x105'),'hooks':!![]});db[_0xf0ef('0x14')][_0xf0ef('0x101')](db['CmHopperFinal'],{'as':_0xf0ef('0x106'),'foreignKey':_0xf0ef('0x103')});db['User'][_0xf0ef('0x101')](db[_0xf0ef('0x7b')],{'as':_0xf0ef('0x107'),'foreignKey':_0xf0ef('0x103')});db[_0xf0ef('0x14')]['hasMany'](db[_0xf0ef('0x7d')],{'as':_0xf0ef('0x7d'),'foreignKey':'UserId'});db[_0xf0ef('0x14')][_0xf0ef('0x101')](db[_0xf0ef('0x108')],{'as':_0xf0ef('0x109'),'foreignKey':'UserId'});db[_0xf0ef('0x14')][_0xf0ef('0x101')](db[_0xf0ef('0x6a')],{'as':_0xf0ef('0x10a'),'foreignKey':_0xf0ef('0x103')});db[_0xf0ef('0x14')][_0xf0ef('0x101')](db[_0xf0ef('0x10b')],{'as':_0xf0ef('0x10c'),'foreignKey':_0xf0ef('0x103')});db[_0xf0ef('0x14')]['hasMany'](db['FaxInteraction'],{'as':_0xf0ef('0x10d'),'foreignKey':_0xf0ef('0x103')});db[_0xf0ef('0x14')][_0xf0ef('0x101')](db[_0xf0ef('0x45')],{'as':_0xf0ef('0x10e'),'foreignKey':_0xf0ef('0x103')});db[_0xf0ef('0x14')]['belongsTo'](db['UserProfile'],{'as':_0xf0ef('0xfb'),'foreignKey':'userProfileId'});db[_0xf0ef('0x14')]['belongsToMany'](db['ChatGroup'],{'as':'Groups','through':'chat_group_has_users'});db[_0xf0ef('0x14')][_0xf0ef('0x10f')](db[_0xf0ef('0x75')],{'as':_0xf0ef('0x110'),'through':_0xf0ef('0x111')});db['User']['belongsToMany'](db[_0xf0ef('0x112')],{'as':_0xf0ef('0x113'),'through':'cm_user_has_lists'});db[_0xf0ef('0x14')][_0xf0ef('0x10f')](db[_0xf0ef('0xe7')],{'through':_0xf0ef('0x114')});db[_0xf0ef('0x14')][_0xf0ef('0x10f')](db[_0xf0ef('0x45')],{'as':'MailInteractions','through':'user_has_mail_interactions'});db['User'][_0xf0ef('0x10f')](db['ChatInteraction'],{'as':_0xf0ef('0x10a'),'through':_0xf0ef('0x115')});db['User']['belongsToMany'](db[_0xf0ef('0x4f')],{'as':'FaxInteractions','through':_0xf0ef('0x116')});db[_0xf0ef('0x14')][_0xf0ef('0x10f')](db['SmsInteraction'],{'as':'SmsInteractions','through':_0xf0ef('0x117')});db[_0xf0ef('0x14')][_0xf0ef('0x10f')](db['OpenchannelInteraction'],{'as':_0xf0ef('0x109'),'through':'user_has_openchannel_interactions'});db[_0xf0ef('0x14')][_0xf0ef('0x10f')](db[_0xf0ef('0x1d')],{'as':_0xf0ef('0x118'),'through':_0xf0ef('0x32'),'required':![]});db[_0xf0ef('0x14')][_0xf0ef('0x10f')](db[_0xf0ef('0x42')],{'as':_0xf0ef('0x119'),'through':_0xf0ef('0x35'),'required':![]});db[_0xf0ef('0x14')]['belongsToMany'](db[_0xf0ef('0x6e')],{'as':_0xf0ef('0x11a'),'through':_0xf0ef('0x33'),'required':![],'hooks':!![]});db[_0xf0ef('0x14')][_0xf0ef('0x10f')](db[_0xf0ef('0x11b')],{'as':_0xf0ef('0x11c'),'through':'UserFaxQueue','required':![]});db[_0xf0ef('0x14')]['belongsToMany'](db[_0xf0ef('0x5d')],{'as':'SmsQueues','through':_0xf0ef('0x39'),'required':![]});db[_0xf0ef('0x14')][_0xf0ef('0x10f')](db[_0xf0ef('0x65')],{'as':'OpenchannelQueues','through':'UserOpenchannelQueue','required':![]});db[_0xf0ef('0x14')][_0xf0ef('0x10f')](db[_0xf0ef('0x112')],{'through':_0xf0ef('0x11d')});db['User']['belongsToMany'](db['VoicePrefix'],{'as':_0xf0ef('0x11e'),'through':_0xf0ef('0x11f'),'required':![]});db[_0xf0ef('0x14')][_0xf0ef('0x10f')](db[_0xf0ef('0x66')],{'as':_0xf0ef('0x120'),'through':_0xf0ef('0x121')});db[_0xf0ef('0x14')]['belongsToMany'](db[_0xf0ef('0x4c')],{'as':'FaxAccounts','through':_0xf0ef('0x122')});db[_0xf0ef('0x14')]['belongsToMany'](db['MailAccount'],{'as':_0xf0ef('0x123'),'through':_0xf0ef('0x124')});db[_0xf0ef('0x14')][_0xf0ef('0x10f')](db[_0xf0ef('0x125')],{'as':'OpenchannelAccounts','through':_0xf0ef('0x126')});db[_0xf0ef('0x14')]['belongsToMany'](db[_0xf0ef('0x56')],{'as':_0xf0ef('0x127'),'through':'user_has_sms_accounts'});db['User'][_0xf0ef('0x10f')](db[_0xf0ef('0xe1')],{'as':_0xf0ef('0x128'),'through':_0xf0ef('0x129')});db[_0xf0ef('0x12a')][_0xf0ef('0x101')](db[_0xf0ef('0x1a')],{'as':'SpiedAgents','onDelete':_0xf0ef('0x105'),'foreignKey':'ChanSpyId'});db['VoiceContext'][_0xf0ef('0x101')](db[_0xf0ef('0x1a')],{'onDelete':_0xf0ef('0x105')});db['VoiceExtension'][_0xf0ef('0x101')](db['VoiceExtension'],{'as':_0xf0ef('0x12b'),'onDelete':_0xf0ef('0x105')});db[_0xf0ef('0x1b')][_0xf0ef('0x10f')](db[_0xf0ef('0x90')],{'as':_0xf0ef('0x12c'),'through':_0xf0ef('0x12d')});db[_0xf0ef('0x1d')][_0xf0ef('0x101')](db[_0xf0ef('0x30')],{'as':_0xf0ef('0x12e'),'foreignKey':_0xf0ef('0x12f')});db[_0xf0ef('0x1d')][_0xf0ef('0x101')](db[_0xf0ef('0x77')],{'as':_0xf0ef('0x130'),'foreignKey':_0xf0ef('0x12f')});db[_0xf0ef('0x1d')][_0xf0ef('0x101')](db['CmHopperFinal'],{'as':_0xf0ef('0x106'),'foreignKey':'VoiceQueueId'});db['VoiceQueue'][_0xf0ef('0x101')](db[_0xf0ef('0x7b')],{'as':_0xf0ef('0x131'),'foreignKey':_0xf0ef('0x12f')});db[_0xf0ef('0x1d')][_0xf0ef('0x101')](db[_0xf0ef('0x7d')],{'as':'ReportAgentPreview','foreignKey':_0xf0ef('0x12f')});db[_0xf0ef('0x1d')][_0xf0ef('0x101')](db[_0xf0ef('0x132')],{'as':_0xf0ef('0x133'),'foreignKey':'VoiceQueueId'});db['VoiceQueue'][_0xf0ef('0x101')](db[_0xf0ef('0xd8')],{'as':'JscriptySessions','foreignKey':_0xf0ef('0x12f')});db[_0xf0ef('0x1d')][_0xf0ef('0x134')](db[_0xf0ef('0x135')],{'as':'Trunk','foreignKey':_0xf0ef('0x136')});db[_0xf0ef('0x1d')][_0xf0ef('0x134')](db[_0xf0ef('0x135')],{'as':_0xf0ef('0x137'),'foreignKey':'TrunkBackupId'});db[_0xf0ef('0x1d')][_0xf0ef('0x134')](db[_0xf0ef('0x138')],{'as':'Interval','foreignKey':_0xf0ef('0x139')});db[_0xf0ef('0x1d')]['belongsTo'](db['Pause'],{'as':_0xf0ef('0x13a'),'foreignKey':_0xf0ef('0x13b')});db[_0xf0ef('0x1d')][_0xf0ef('0x10f')](db['CmList'],{'as':_0xf0ef('0x113'),'through':_0xf0ef('0x13c')});db[_0xf0ef('0x1d')][_0xf0ef('0x10f')](db[_0xf0ef('0x14')],{'as':_0xf0ef('0x13d'),'through':_0xf0ef('0x32')});db[_0xf0ef('0x1d')][_0xf0ef('0x10f')](db[_0xf0ef('0xe7')],{'as':_0xf0ef('0x13e'),'through':_0xf0ef('0x13f')});db[_0xf0ef('0x1d')][_0xf0ef('0x10f')](db[_0xf0ef('0x112')],{'as':_0xf0ef('0x140'),'through':_0xf0ef('0x141')});db[_0xf0ef('0x1f')]['belongsTo'](db[_0xf0ef('0x14')],{'as':'User','foreignKey':_0xf0ef('0x103')});db[_0xf0ef('0x21')][_0xf0ef('0x134')](db[_0xf0ef('0x14')],{'as':'User','foreignKey':_0xf0ef('0x103')});db[_0xf0ef('0x100')][_0xf0ef('0x101')](db[_0xf0ef('0x24')],{'as':_0xf0ef('0x142'),'onDelete':_0xf0ef('0x105'),'foreignKey':_0xf0ef('0x143'),'sourceKey':_0xf0ef('0x144')});db[_0xf0ef('0x24')][_0xf0ef('0x134')](db[_0xf0ef('0x100')],{'foreignKey':_0xf0ef('0x143'),'targetKey':_0xf0ef('0x144')});db[_0xf0ef('0x25')][_0xf0ef('0x101')](db['VoiceQueueReport'],{'as':_0xf0ef('0x145'),'foreignKey':_0xf0ef('0x146'),'constraints':![]});db[_0xf0ef('0x25')][_0xf0ef('0x101')](db[_0xf0ef('0x147')],{'as':'AgentReports','foreignKey':_0xf0ef('0x146'),'constraints':![]});db[_0xf0ef('0x25')][_0xf0ef('0x134')](db[_0xf0ef('0x14')],{'as':_0xf0ef('0x14'),'foreignKey':'UserId'});db[_0xf0ef('0x25')][_0xf0ef('0x134')](db[_0xf0ef('0x75')],{'as':_0xf0ef('0x148'),'foreignKey':_0xf0ef('0x149')});db[_0xf0ef('0x14a')][_0xf0ef('0x134')](db['MailAccount'],{'as':'MailAccount','foreignKey':_0xf0ef('0x14b')});db[_0xf0ef('0x3e')][_0xf0ef('0x134')](db['MailAccount'],{'as':'MailAccount','foreignKey':_0xf0ef('0x14b')});db[_0xf0ef('0x40')]['hasOne'](db['MailServerIn'],{'as':_0xf0ef('0x14c'),'onDelete':_0xf0ef('0x105')});db[_0xf0ef('0x40')][_0xf0ef('0xff')](db['MailServerOut'],{'as':_0xf0ef('0x14d'),'onDelete':_0xf0ef('0x105')});db[_0xf0ef('0x40')][_0xf0ef('0x101')](db[_0xf0ef('0x86')],{'as':_0xf0ef('0x14e'),'foreignKey':_0xf0ef('0x14b')});db[_0xf0ef('0x40')][_0xf0ef('0x101')](db[_0xf0ef('0x84')],{'as':_0xf0ef('0x14f'),'foreignKey':_0xf0ef('0x14b')});db[_0xf0ef('0x40')][_0xf0ef('0x101')](db['MailMessage'],{'as':_0xf0ef('0x142'),'foreignKey':_0xf0ef('0x14b')});db['MailAccount'][_0xf0ef('0x101')](db[_0xf0ef('0x45')],{'as':_0xf0ef('0x150')});db[_0xf0ef('0x40')][_0xf0ef('0x101')](db['MailApplication'],{'as':_0xf0ef('0x12b')});db[_0xf0ef('0x40')][_0xf0ef('0x134')](db['CmList'],{'as':'List','foreignKey':_0xf0ef('0x151')});db[_0xf0ef('0x40')][_0xf0ef('0x134')](db['Template'],{'as':_0xf0ef('0x92'),'foreignKey':_0xf0ef('0x152')});db[_0xf0ef('0x40')][_0xf0ef('0x134')](db[_0xf0ef('0x8a')],{'as':_0xf0ef('0x13a'),'foreignKey':_0xf0ef('0x13b')});db[_0xf0ef('0x40')]['belongsToMany'](db[_0xf0ef('0x14')],{'as':_0xf0ef('0x13d'),'through':_0xf0ef('0x124')});db[_0xf0ef('0x42')][_0xf0ef('0x10f')](db[_0xf0ef('0x14')],{'as':_0xf0ef('0x13d'),'through':_0xf0ef('0x35')});db[_0xf0ef('0x42')]['belongsToMany'](db[_0xf0ef('0xe7')],{'through':_0xf0ef('0x153'),'as':_0xf0ef('0x13e')});db[_0xf0ef('0x45')][_0xf0ef('0x101')](db['MailMessage'],{'as':'Messages','onDelete':'cascade','foreignKey':_0xf0ef('0x154')});db[_0xf0ef('0x45')]['belongsTo'](db[_0xf0ef('0x40')],{'as':'Account','foreignKey':_0xf0ef('0x14b')});db[_0xf0ef('0x45')][_0xf0ef('0x134')](db[_0xf0ef('0x75')],{'as':'Contact','foreignKey':_0xf0ef('0x149')});db[_0xf0ef('0x45')]['belongsTo'](db[_0xf0ef('0x14')],{'as':_0xf0ef('0x155'),'foreignKey':_0xf0ef('0x103')});db[_0xf0ef('0x45')][_0xf0ef('0x10f')](db[_0xf0ef('0x156')],{'through':'mail_interaction_has_tags','as':'Tags'});db[_0xf0ef('0x45')]['belongsToMany'](db['Tag'],{'through':_0xf0ef('0x157'),'as':_0xf0ef('0x158')});db[_0xf0ef('0x45')][_0xf0ef('0x10f')](db[_0xf0ef('0x14')],{'as':_0xf0ef('0x159'),'through':_0xf0ef('0x15a'),'foreignKey':_0xf0ef('0x154')});db[_0xf0ef('0x15b')]['hasMany'](db[_0xf0ef('0xeb')],{'as':_0xf0ef('0x15c'),'onDelete':_0xf0ef('0x105')});db['MailMessage'][_0xf0ef('0x134')](db[_0xf0ef('0x14')],{'as':_0xf0ef('0x14')});db['MailMessage'][_0xf0ef('0x134')](db[_0xf0ef('0x75')],{'onDelete':'cascade','as':_0xf0ef('0x148')});db[_0xf0ef('0x15b')][_0xf0ef('0x134')](db['MailInteraction'],{'as':_0xf0ef('0x15d'),'foreignKey':_0xf0ef('0x154')});db[_0xf0ef('0x15b')]['belongsTo'](db['MailAccount'],{'as':'Account','foreignKey':_0xf0ef('0x14b')});db[_0xf0ef('0x15e')]['belongsTo'](db[_0xf0ef('0x14')],{'onDelete':'restrict'});db[_0xf0ef('0x15e')][_0xf0ef('0x134')](db[_0xf0ef('0x42')],{'onDelete':_0xf0ef('0x15f')});db[_0xf0ef('0x15e')][_0xf0ef('0x134')](db[_0xf0ef('0x40')],{'onDelete':_0xf0ef('0x15f')});db[_0xf0ef('0x15e')]['belongsTo'](db[_0xf0ef('0x138')],{'onDelete':'restrict','foreignKey':_0xf0ef('0x139')});db[_0xf0ef('0x15e')][_0xf0ef('0x134')](db[_0xf0ef('0x156')],{'onDelete':_0xf0ef('0x15f'),'foreignKey':_0xf0ef('0x160')});db['MailQueueReport']['belongsTo'](db[_0xf0ef('0x40')],{});db[_0xf0ef('0x47')][_0xf0ef('0x134')](db[_0xf0ef('0x112')],{'as':_0xf0ef('0x161'),'foreignKey':_0xf0ef('0x151')});db[_0xf0ef('0x47')][_0xf0ef('0x134')](db[_0xf0ef('0x75')],{'as':'Contact','foreignKey':_0xf0ef('0x149')});db[_0xf0ef('0x47')][_0xf0ef('0x134')](db[_0xf0ef('0x45')],{});db[_0xf0ef('0x47')][_0xf0ef('0x134')](db[_0xf0ef('0x15b')],{});db[_0xf0ef('0x47')][_0xf0ef('0x134')](db['User'],{});db[_0xf0ef('0x47')][_0xf0ef('0x134')](db[_0xf0ef('0x42')],{});db[_0xf0ef('0x49')]['hasMany'](db[_0xf0ef('0x4b')],{'as':_0xf0ef('0x162'),'onDelete':'cascade'});db['FaxAccount'][_0xf0ef('0x101')](db['Disposition'],{'as':'Dispositions','foreignKey':_0xf0ef('0x163')});db[_0xf0ef('0x4c')][_0xf0ef('0x101')](db['CannedAnswer'],{'as':_0xf0ef('0x14f'),'foreignKey':_0xf0ef('0x163')});db[_0xf0ef('0x4c')][_0xf0ef('0x101')](db[_0xf0ef('0x4f')],{'as':_0xf0ef('0x150')});db[_0xf0ef('0x4c')][_0xf0ef('0x101')](db['FaxApplication'],{'as':'Applications'});db[_0xf0ef('0x4c')][_0xf0ef('0x101')](db['VoiceExtension'],{'as':'Exntensions','onDelete':_0xf0ef('0x105')});db['FaxAccount'][_0xf0ef('0x101')](db[_0xf0ef('0x51')],{'as':_0xf0ef('0x142')});db[_0xf0ef('0x4c')]['belongsTo'](db[_0xf0ef('0x135')],{'as':_0xf0ef('0x135')});db[_0xf0ef('0x4c')][_0xf0ef('0x134')](db['CmList'],{'as':_0xf0ef('0x161'),'foreignKey':_0xf0ef('0x151')});db['FaxAccount'][_0xf0ef('0x134')](db[_0xf0ef('0x8a')],{'as':_0xf0ef('0x13a'),'foreignKey':_0xf0ef('0x13b')});db[_0xf0ef('0x4c')][_0xf0ef('0x10f')](db['User'],{'as':_0xf0ef('0x13d'),'through':'user_has_fax_accounts'});db['FaxApplication'][_0xf0ef('0x134')](db[_0xf0ef('0x14')],{'onDelete':'restrict'});db['FaxApplication'][_0xf0ef('0x134')](db[_0xf0ef('0x11b')],{'onDelete':'restrict'});db[_0xf0ef('0x4e')][_0xf0ef('0x134')](db['FaxAccount'],{'onDelete':_0xf0ef('0x15f')});db[_0xf0ef('0x4e')][_0xf0ef('0x134')](db['Tag'],{'onDelete':'restrict','foreignKey':_0xf0ef('0x160')});db[_0xf0ef('0x4f')][_0xf0ef('0x101')](db[_0xf0ef('0x51')],{'as':_0xf0ef('0x142'),'onDelete':_0xf0ef('0x105'),'foreignKey':'FaxInteractionId'});db['FaxInteraction'][_0xf0ef('0x134')](db['FaxAccount'],{'as':_0xf0ef('0x164'),'foreignKey':'FaxAccountId'});db[_0xf0ef('0x4f')][_0xf0ef('0x134')](db[_0xf0ef('0x75')],{'as':_0xf0ef('0x148'),'foreignKey':_0xf0ef('0x149')});db[_0xf0ef('0x4f')]['belongsTo'](db['User'],{'as':_0xf0ef('0x155'),'foreignKey':_0xf0ef('0x103')});db['FaxInteraction'][_0xf0ef('0x10f')](db[_0xf0ef('0x156')],{'through':'fax_interaction_has_tags','as':_0xf0ef('0x165')});db[_0xf0ef('0x4f')][_0xf0ef('0x10f')](db['Tag'],{'through':_0xf0ef('0x166'),'as':'ThroughTags'});db['FaxInteraction'][_0xf0ef('0x10f')](db['User'],{'as':'Users','through':_0xf0ef('0x116'),'foreignKey':_0xf0ef('0x167')});db[_0xf0ef('0x51')][_0xf0ef('0x134')](db[_0xf0ef('0x14')],{'onDelete':_0xf0ef('0x105'),'as':_0xf0ef('0x14')});db[_0xf0ef('0x51')][_0xf0ef('0x134')](db[_0xf0ef('0x4f')],{'as':_0xf0ef('0x15d'),'foreignKey':_0xf0ef('0x167')});db['FaxMessage'][_0xf0ef('0x134')](db[_0xf0ef('0x75')],{'onDelete':'cascade','as':_0xf0ef('0x148')});db[_0xf0ef('0x51')][_0xf0ef('0x134')](db[_0xf0ef('0xeb')],{'as':_0xf0ef('0xeb'),'foreignKey':'AttachmentId'});db[_0xf0ef('0x51')]['belongsTo'](db[_0xf0ef('0x4c')],{'as':_0xf0ef('0x164'),'foreignKey':_0xf0ef('0x163')});db['FaxQueue'][_0xf0ef('0x10f')](db[_0xf0ef('0x14')],{'as':'Agents','through':_0xf0ef('0x37')});db[_0xf0ef('0x11b')]['belongsToMany'](db[_0xf0ef('0xe7')],{'through':'team_has_fax_queues','as':_0xf0ef('0x13e')});db[_0xf0ef('0x54')]['belongsTo'](db['FaxAccount'],{});db['FaxQueueReport'][_0xf0ef('0x134')](db[_0xf0ef('0x112')],{'as':_0xf0ef('0x161'),'foreignKey':_0xf0ef('0x151')});db[_0xf0ef('0x54')][_0xf0ef('0x134')](db[_0xf0ef('0x75')],{'as':_0xf0ef('0x148'),'foreignKey':_0xf0ef('0x149')});db[_0xf0ef('0x54')][_0xf0ef('0x134')](db[_0xf0ef('0x4f')],{});db[_0xf0ef('0x54')]['belongsTo'](db[_0xf0ef('0x51')],{});db[_0xf0ef('0x54')][_0xf0ef('0x134')](db[_0xf0ef('0x14')],{});db[_0xf0ef('0x54')][_0xf0ef('0x134')](db['FaxQueue'],{});db[_0xf0ef('0x56')][_0xf0ef('0x101')](db[_0xf0ef('0x86')],{'as':_0xf0ef('0x14e'),'foreignKey':_0xf0ef('0x168')});db[_0xf0ef('0x56')][_0xf0ef('0x101')](db['CannedAnswer'],{'as':_0xf0ef('0x14f'),'foreignKey':_0xf0ef('0x168')});db['SmsAccount']['hasMany'](db[_0xf0ef('0x5b')],{'as':_0xf0ef('0x142'),'foreignKey':'SmsAccountId'});db[_0xf0ef('0x56')][_0xf0ef('0x101')](db['SmsInteraction'],{'as':_0xf0ef('0x150')});db['SmsAccount'][_0xf0ef('0x101')](db[_0xf0ef('0x58')],{'as':_0xf0ef('0x12b')});db['SmsAccount'][_0xf0ef('0x134')](db[_0xf0ef('0x112')],{'as':_0xf0ef('0x161'),'foreignKey':_0xf0ef('0x151')});db['SmsAccount'][_0xf0ef('0x134')](db[_0xf0ef('0x8a')],{'as':_0xf0ef('0x13a'),'foreignKey':_0xf0ef('0x13b')});db[_0xf0ef('0x56')][_0xf0ef('0x10f')](db['User'],{'as':_0xf0ef('0x13d'),'through':_0xf0ef('0x169')});db[_0xf0ef('0x58')][_0xf0ef('0x134')](db[_0xf0ef('0x14')],{'onDelete':'restrict'});db[_0xf0ef('0x58')][_0xf0ef('0x134')](db[_0xf0ef('0x5d')],{'onDelete':_0xf0ef('0x15f')});db[_0xf0ef('0x58')]['belongsTo'](db['SmsAccount'],{'onDelete':'restrict'});db['SmsApplication'][_0xf0ef('0x134')](db['Interval'],{'onDelete':_0xf0ef('0x15f'),'foreignKey':_0xf0ef('0x139')});db[_0xf0ef('0x58')][_0xf0ef('0x134')](db[_0xf0ef('0x156')],{'onDelete':_0xf0ef('0x15f'),'foreignKey':_0xf0ef('0x160')});db['SmsInteraction'][_0xf0ef('0x101')](db[_0xf0ef('0x5b')],{'as':_0xf0ef('0x142'),'onDelete':'cascade','foreignKey':_0xf0ef('0x16a')});db[_0xf0ef('0x10b')][_0xf0ef('0x134')](db[_0xf0ef('0x56')],{'as':_0xf0ef('0x164'),'foreignKey':_0xf0ef('0x168')});db[_0xf0ef('0x10b')][_0xf0ef('0x134')](db[_0xf0ef('0x75')],{'as':_0xf0ef('0x148'),'foreignKey':_0xf0ef('0x149')});db[_0xf0ef('0x10b')]['belongsTo'](db[_0xf0ef('0x14')],{'as':_0xf0ef('0x155'),'foreignKey':'UserId'});db[_0xf0ef('0x10b')][_0xf0ef('0x10f')](db[_0xf0ef('0x156')],{'through':_0xf0ef('0x16b'),'as':_0xf0ef('0x165')});db['SmsInteraction']['belongsToMany'](db[_0xf0ef('0x156')],{'through':_0xf0ef('0x16b'),'as':_0xf0ef('0x158')});db[_0xf0ef('0x10b')]['belongsToMany'](db[_0xf0ef('0x14')],{'as':_0xf0ef('0x159'),'through':_0xf0ef('0x117'),'foreignKey':_0xf0ef('0x16a')});db[_0xf0ef('0x5b')]['belongsTo'](db[_0xf0ef('0x14')],{'as':_0xf0ef('0x14')});db[_0xf0ef('0x5b')][_0xf0ef('0x134')](db['CmContact'],{'onDelete':_0xf0ef('0x105'),'as':_0xf0ef('0x148')});db['SmsMessage'][_0xf0ef('0x134')](db[_0xf0ef('0x10b')],{'onDelete':_0xf0ef('0x105'),'as':_0xf0ef('0x15d'),'foreignKey':_0xf0ef('0x16a')});db[_0xf0ef('0x5b')][_0xf0ef('0x134')](db['SmsAccount'],{'as':_0xf0ef('0x164'),'foreignKey':_0xf0ef('0x168')});db[_0xf0ef('0x5d')][_0xf0ef('0x10f')](db[_0xf0ef('0x14')],{'as':_0xf0ef('0x13d'),'through':'UserSmsQueue','foreignKey':'SmsQueueId'});db[_0xf0ef('0x5d')][_0xf0ef('0x10f')](db[_0xf0ef('0xe7')],{'through':_0xf0ef('0x16c'),'as':_0xf0ef('0x13e')});db[_0xf0ef('0x125')][_0xf0ef('0x101')](db['Disposition'],{'as':_0xf0ef('0x14e'),'foreignKey':_0xf0ef('0x16d')});db[_0xf0ef('0x125')][_0xf0ef('0x101')](db[_0xf0ef('0x84')],{'as':_0xf0ef('0x14f'),'foreignKey':_0xf0ef('0x16d')});db[_0xf0ef('0x125')][_0xf0ef('0x101')](db['OpenchannelInteraction'],{'as':_0xf0ef('0x150'),'foreignKey':_0xf0ef('0x16d')});db[_0xf0ef('0x125')]['hasMany'](db['OpenchannelMessage'],{'as':_0xf0ef('0x142'),'foreignKey':_0xf0ef('0x16d')});db[_0xf0ef('0x125')][_0xf0ef('0x101')](db[_0xf0ef('0x60')],{'as':_0xf0ef('0x12b'),'foreignKey':_0xf0ef('0x16d')});db[_0xf0ef('0x125')][_0xf0ef('0x134')](db['CmList'],{'as':_0xf0ef('0x161'),'foreignKey':'ListId'});db['OpenchannelAccount'][_0xf0ef('0x134')](db['Pause'],{'as':_0xf0ef('0x13a'),'foreignKey':_0xf0ef('0x13b')});db[_0xf0ef('0x125')][_0xf0ef('0x10f')](db[_0xf0ef('0x14')],{'as':_0xf0ef('0x13d'),'through':_0xf0ef('0x126')});db[_0xf0ef('0x60')][_0xf0ef('0x134')](db[_0xf0ef('0x14')],{'onDelete':_0xf0ef('0x15f')});db[_0xf0ef('0x60')][_0xf0ef('0x134')](db[_0xf0ef('0x65')],{'onDelete':_0xf0ef('0x15f'),'foreignKey':_0xf0ef('0x16e')});db[_0xf0ef('0x60')]['belongsTo'](db[_0xf0ef('0x125')],{'onDelete':_0xf0ef('0x15f'),'foreignKey':_0xf0ef('0x16d')});db[_0xf0ef('0x60')][_0xf0ef('0x134')](db[_0xf0ef('0x138')],{'onDelete':_0xf0ef('0x15f'),'foreignKey':_0xf0ef('0x139')});db[_0xf0ef('0x60')]['belongsTo'](db[_0xf0ef('0x156')],{'onDelete':'restrict','foreignKey':_0xf0ef('0x160')});db[_0xf0ef('0x108')][_0xf0ef('0x101')](db['OpenchannelMessage'],{'as':_0xf0ef('0x142'),'onDelete':_0xf0ef('0x105'),'foreignKey':_0xf0ef('0x16f')});db[_0xf0ef('0x108')][_0xf0ef('0x134')](db[_0xf0ef('0x125')],{'as':_0xf0ef('0x164'),'foreignKey':_0xf0ef('0x16d')});db[_0xf0ef('0x108')][_0xf0ef('0x134')](db['CmContact'],{'as':'Contact','foreignKey':'ContactId'});db['OpenchannelInteraction'][_0xf0ef('0x134')](db[_0xf0ef('0x14')],{'as':_0xf0ef('0x155'),'foreignKey':_0xf0ef('0x103')});db[_0xf0ef('0x108')][_0xf0ef('0x10f')](db[_0xf0ef('0x156')],{'through':_0xf0ef('0x170'),'as':_0xf0ef('0x165')});db['OpenchannelInteraction'][_0xf0ef('0x10f')](db['Tag'],{'through':_0xf0ef('0x170'),'as':'ThroughTags'});db[_0xf0ef('0x108')]['belongsToMany'](db[_0xf0ef('0x14')],{'as':_0xf0ef('0x159'),'through':_0xf0ef('0x171'),'foreignKey':_0xf0ef('0x16f')});db[_0xf0ef('0x63')][_0xf0ef('0x134')](db[_0xf0ef('0x14')],{'onDelete':_0xf0ef('0x105'),'as':_0xf0ef('0x14')});db[_0xf0ef('0x63')][_0xf0ef('0x134')](db[_0xf0ef('0x75')],{'onDelete':_0xf0ef('0x105'),'as':_0xf0ef('0x148')});db[_0xf0ef('0x63')][_0xf0ef('0x134')](db[_0xf0ef('0x108')],{'onDelete':'cascade','as':_0xf0ef('0x15d'),'foreignKey':_0xf0ef('0x16f')});db[_0xf0ef('0x63')][_0xf0ef('0x134')](db[_0xf0ef('0xeb')],{'as':_0xf0ef('0xeb'),'foreignKey':_0xf0ef('0x172')});db[_0xf0ef('0x63')][_0xf0ef('0x134')](db['OpenchannelAccount'],{'as':_0xf0ef('0x164'),'foreignKey':_0xf0ef('0x16d')});db[_0xf0ef('0x65')][_0xf0ef('0x10f')](db[_0xf0ef('0x14')],{'as':_0xf0ef('0x13d'),'through':_0xf0ef('0x3b'),'foreignKey':_0xf0ef('0x16e')});db[_0xf0ef('0x65')][_0xf0ef('0x10f')](db[_0xf0ef('0xe7')],{'through':_0xf0ef('0x173'),'as':_0xf0ef('0x13e')});db[_0xf0ef('0x66')][_0xf0ef('0x101')](db[_0xf0ef('0x86')],{'as':_0xf0ef('0x14e'),'foreignKey':'ChatWebsiteId'});db[_0xf0ef('0x66')][_0xf0ef('0x101')](db[_0xf0ef('0x84')],{'as':_0xf0ef('0x14f'),'foreignKey':_0xf0ef('0x174')});db[_0xf0ef('0x66')][_0xf0ef('0x101')](db['ChatProactiveAction'],{'as':_0xf0ef('0x175')});db[_0xf0ef('0x66')][_0xf0ef('0x101')](db[_0xf0ef('0x6a')],{'as':_0xf0ef('0x150')});db[_0xf0ef('0x66')][_0xf0ef('0x101')](db[_0xf0ef('0x68')],{'as':'Applications'});db[_0xf0ef('0x66')][_0xf0ef('0x101')](db['ChatMessage'],{'as':'Messages'});db['ChatWebsite'][_0xf0ef('0x134')](db[_0xf0ef('0x112')],{'as':_0xf0ef('0x161'),'foreignKey':_0xf0ef('0x151')});db[_0xf0ef('0x66')][_0xf0ef('0x134')](db[_0xf0ef('0x138')],{'as':'Interval','foreignKey':_0xf0ef('0x139')});db[_0xf0ef('0x66')][_0xf0ef('0x134')](db['Pause'],{'as':_0xf0ef('0x13a'),'foreignKey':_0xf0ef('0x13b')});db[_0xf0ef('0x66')][_0xf0ef('0x10f')](db[_0xf0ef('0x14')],{'as':_0xf0ef('0x13d'),'through':_0xf0ef('0x121')});db[_0xf0ef('0x176')][_0xf0ef('0x134')](db[_0xf0ef('0x125')],{});db[_0xf0ef('0x176')][_0xf0ef('0x134')](db[_0xf0ef('0x112')],{'as':_0xf0ef('0x161'),'foreignKey':_0xf0ef('0x151')});db[_0xf0ef('0x176')][_0xf0ef('0x134')](db['CmContact'],{'as':'Contact','foreignKey':_0xf0ef('0x149')});db[_0xf0ef('0x176')][_0xf0ef('0x134')](db[_0xf0ef('0x108')],{});db[_0xf0ef('0x176')][_0xf0ef('0x134')](db[_0xf0ef('0x63')],{});db[_0xf0ef('0x176')][_0xf0ef('0x134')](db[_0xf0ef('0x14')],{});db[_0xf0ef('0x176')]['belongsTo'](db[_0xf0ef('0x65')],{});db[_0xf0ef('0x68')]['belongsTo'](db[_0xf0ef('0x14')],{'as':_0xf0ef('0x177'),'foreignKey':_0xf0ef('0x103'),'onDelete':_0xf0ef('0x15f')});db[_0xf0ef('0x68')][_0xf0ef('0x134')](db['ChatQueue'],{'as':_0xf0ef('0x178'),'foreignKey':'ChatQueueId','onDelete':_0xf0ef('0x15f')});db[_0xf0ef('0x68')][_0xf0ef('0x134')](db[_0xf0ef('0x66')],{'as':'Website','foreignKey':_0xf0ef('0x174'),'onDelete':'restrict'});db[_0xf0ef('0x68')]['belongsTo'](db[_0xf0ef('0x156')],{'onDelete':_0xf0ef('0x15f'),'foreignKey':'TagId'});db['ChatInteraction'][_0xf0ef('0x101')](db[_0xf0ef('0x179')],{'as':_0xf0ef('0x142'),'onDelete':'cascade','foreignKey':_0xf0ef('0x17a')});db['ChatInteraction'][_0xf0ef('0x134')](db[_0xf0ef('0x66')],{'as':_0xf0ef('0x164'),'foreignKey':'ChatWebsiteId'});db[_0xf0ef('0x6a')]['belongsTo'](db[_0xf0ef('0x75')],{'as':_0xf0ef('0x148'),'foreignKey':_0xf0ef('0x149')});db['ChatInteraction'][_0xf0ef('0x134')](db[_0xf0ef('0x14')],{'as':_0xf0ef('0x155'),'foreignKey':_0xf0ef('0x103')});db[_0xf0ef('0x6a')]['belongsToMany'](db['Tag'],{'through':_0xf0ef('0x17b'),'as':'Tags'});db[_0xf0ef('0x6a')]['belongsToMany'](db[_0xf0ef('0x156')],{'through':_0xf0ef('0x17b'),'as':_0xf0ef('0x158')});db['ChatInteraction']['belongsToMany'](db[_0xf0ef('0x14')],{'as':_0xf0ef('0x159'),'through':_0xf0ef('0x115'),'foreignKey':_0xf0ef('0x17a')});db[_0xf0ef('0x179')][_0xf0ef('0x134')](db[_0xf0ef('0x14')],{'onDelete':_0xf0ef('0x105'),'as':_0xf0ef('0x14')});db[_0xf0ef('0x179')][_0xf0ef('0x134')](db[_0xf0ef('0x75')],{'onDelete':_0xf0ef('0x105'),'as':_0xf0ef('0x148'),'foreignKey':_0xf0ef('0x149')});db[_0xf0ef('0x179')]['belongsTo'](db[_0xf0ef('0x6a')],{'onDelete':_0xf0ef('0x105'),'as':'Interaction','foreignKey':_0xf0ef('0x17a')});db['ChatMessage'][_0xf0ef('0x134')](db[_0xf0ef('0xeb')],{'as':_0xf0ef('0xeb'),'foreignKey':'AttachmentId'});db['ChatMessage'][_0xf0ef('0x134')](db[_0xf0ef('0x66')],{'as':'Account','foreignKey':'ChatWebsiteId'});db[_0xf0ef('0x6c')][_0xf0ef('0x134')](db[_0xf0ef('0x75')],{'onDelete':'cascade','as':_0xf0ef('0x148'),'foreignKey':_0xf0ef('0x149')});db[_0xf0ef('0x6c')][_0xf0ef('0x134')](db[_0xf0ef('0x66')],{'as':'Account','foreignKey':_0xf0ef('0x174')});db['ChatQueue'][_0xf0ef('0x10f')](db['User'],{'as':'Agents','through':_0xf0ef('0x33'),'hooks':!![]});db[_0xf0ef('0x6e')][_0xf0ef('0x10f')](db['Team'],{'through':_0xf0ef('0x17c'),'as':'Teams'});db[_0xf0ef('0x70')][_0xf0ef('0x101')](db[_0xf0ef('0xd2')],{'as':'Messages','foreignKey':'ChatGroupId','onDelete':_0xf0ef('0x105')});db[_0xf0ef('0x70')]['belongsToMany'](db[_0xf0ef('0x14')],{'as':_0xf0ef('0x12e'),'through':_0xf0ef('0x17d')});db[_0xf0ef('0x17e')][_0xf0ef('0x134')](db[_0xf0ef('0x66')],{'as':_0xf0ef('0x17f'),'foreignKey':_0xf0ef('0x174')});db[_0xf0ef('0x73')][_0xf0ef('0x101')](db[_0xf0ef('0x75')],{'as':_0xf0ef('0x110'),'foreignKey':_0xf0ef('0x180')});db[_0xf0ef('0x75')][_0xf0ef('0x101')](db['CmHopper'],{'as':_0xf0ef('0x130'),'foreignKey':_0xf0ef('0x149')});db[_0xf0ef('0x75')][_0xf0ef('0x101')](db[_0xf0ef('0x79')],{'as':'HopperFinals','foreignKey':_0xf0ef('0x149')});db[_0xf0ef('0x75')][_0xf0ef('0x101')](db[_0xf0ef('0x7b')],{'as':_0xf0ef('0x131'),'foreignKey':_0xf0ef('0x149')});db[_0xf0ef('0x75')][_0xf0ef('0x101')](db[_0xf0ef('0x7d')],{'as':_0xf0ef('0x7d'),'foreignKey':_0xf0ef('0x149')});db[_0xf0ef('0x75')][_0xf0ef('0x101')](db[_0xf0ef('0xd8')],{'as':_0xf0ef('0x181'),'foreignKey':_0xf0ef('0x149')});db[_0xf0ef('0x75')][_0xf0ef('0x101')](db[_0xf0ef('0x108')],{'as':_0xf0ef('0x109'),'foreignKey':_0xf0ef('0x149'),'onDelete':_0xf0ef('0x15f')});db[_0xf0ef('0x75')]['hasMany'](db[_0xf0ef('0x6a')],{'as':'ChatInteractions','foreignKey':_0xf0ef('0x149'),'onDelete':'restrict'});db[_0xf0ef('0x75')][_0xf0ef('0x101')](db[_0xf0ef('0x10b')],{'as':_0xf0ef('0x10c'),'foreignKey':_0xf0ef('0x149'),'onDelete':'restrict'});db[_0xf0ef('0x75')]['hasMany'](db['FaxInteraction'],{'as':_0xf0ef('0x10d'),'foreignKey':_0xf0ef('0x149'),'onDelete':_0xf0ef('0x15f')});db[_0xf0ef('0x75')][_0xf0ef('0x101')](db['MailInteraction'],{'as':_0xf0ef('0x10e'),'foreignKey':_0xf0ef('0x149'),'onDelete':_0xf0ef('0x15f')});db[_0xf0ef('0x75')][_0xf0ef('0x134')](db['CmCompany'],{'as':_0xf0ef('0x182'),'foreignKey':_0xf0ef('0x180')});db[_0xf0ef('0x75')][_0xf0ef('0x134')](db['CmList'],{'as':'List','foreignKey':_0xf0ef('0x151'),'onDelete':_0xf0ef('0x105')});db[_0xf0ef('0x75')][_0xf0ef('0x10f')](db[_0xf0ef('0x14')],{'as':_0xf0ef('0x159'),'through':'cm_user_has_contacts'});db[_0xf0ef('0x75')][_0xf0ef('0x10f')](db['Tag'],{'as':_0xf0ef('0x165'),'through':_0xf0ef('0x183')});db['CmContact'][_0xf0ef('0x10f')](db[_0xf0ef('0x156')],{'through':_0xf0ef('0x183'),'as':_0xf0ef('0x158')});db[_0xf0ef('0x77')][_0xf0ef('0x134')](db[_0xf0ef('0x75')],{'as':'Contact','foreignKey':_0xf0ef('0x149'),'onDelete':_0xf0ef('0x105')});db[_0xf0ef('0x77')][_0xf0ef('0x134')](db[_0xf0ef('0x112')],{'as':_0xf0ef('0x161'),'foreignKey':_0xf0ef('0x151'),'onDelete':_0xf0ef('0x105')});db[_0xf0ef('0x77')][_0xf0ef('0x134')](db[_0xf0ef('0x14')],{'as':'Agent','foreignKey':'UserId'});db[_0xf0ef('0x77')][_0xf0ef('0x134')](db[_0xf0ef('0x1d')],{'as':_0xf0ef('0x178'),'foreignKey':'VoiceQueueId','onDelete':_0xf0ef('0x105')});db['CmHopper'][_0xf0ef('0x134')](db[_0xf0ef('0x184')],{'as':_0xf0ef('0x184'),'foreignKey':'CampaignId','onDelete':_0xf0ef('0x105')});db[_0xf0ef('0x77')][_0xf0ef('0x134')](db[_0xf0ef('0x14')],{'as':_0xf0ef('0x155'),'foreignKey':'OwnerId'});db[_0xf0ef('0x132')][_0xf0ef('0x134')](db[_0xf0ef('0x75')],{'as':_0xf0ef('0x148'),'foreignKey':_0xf0ef('0x149'),'onDelete':_0xf0ef('0x105')});db[_0xf0ef('0x132')][_0xf0ef('0x134')](db[_0xf0ef('0x112')],{'as':_0xf0ef('0x161'),'foreignKey':_0xf0ef('0x151'),'onDelete':_0xf0ef('0x105')});db[_0xf0ef('0x132')]['belongsTo'](db[_0xf0ef('0x1d')],{'as':_0xf0ef('0x178'),'foreignKey':'VoiceQueueId','onDelete':_0xf0ef('0x105')});db[_0xf0ef('0x132')][_0xf0ef('0x134')](db[_0xf0ef('0x184')],{'as':_0xf0ef('0x184'),'foreignKey':_0xf0ef('0x185'),'onDelete':_0xf0ef('0x105')});db[_0xf0ef('0x186')][_0xf0ef('0x101')](db[_0xf0ef('0x88')],{'as':{'plural':_0xf0ef('0x187'),'singular':_0xf0ef('0x188')},'foreignKey':_0xf0ef('0x189'),'onDelete':'cascade','hooks':!![]});db['Automation'][_0xf0ef('0x101')](db[_0xf0ef('0x88')],{'as':{'plural':_0xf0ef('0x18a'),'singular':_0xf0ef('0x18b')},'foreignKey':_0xf0ef('0x18c'),'onDelete':_0xf0ef('0x105'),'hooks':!![]});db[_0xf0ef('0x186')][_0xf0ef('0x101')](db[_0xf0ef('0x81')],{'as':_0xf0ef('0x18d'),'foreignKey':_0xf0ef('0x18e'),'onDelete':_0xf0ef('0x105'),'hooks':!![]});db['Interval'][_0xf0ef('0x101')](db[_0xf0ef('0x138')],{'as':'Intervals','foreignKey':'IntervalId','onDelete':_0xf0ef('0x105'),'hooks':!![],'required':![]});db[_0xf0ef('0x138')]['hasMany'](db[_0xf0ef('0x1a')],{'as':_0xf0ef('0x18f'),'foreignKey':_0xf0ef('0x139'),'onDelete':_0xf0ef('0x15f')});db[_0xf0ef('0x138')][_0xf0ef('0x101')](db[_0xf0ef('0x15e')],{'as':_0xf0ef('0x190'),'foreignKey':_0xf0ef('0x139')});db[_0xf0ef('0x138')][_0xf0ef('0x101')](db[_0xf0ef('0x68')],{'as':_0xf0ef('0x191'),'foreignKey':_0xf0ef('0x139')});db[_0xf0ef('0x138')]['hasMany'](db[_0xf0ef('0x4e')],{'as':_0xf0ef('0x192'),'foreignKey':'IntervalId'});db[_0xf0ef('0x138')][_0xf0ef('0x101')](db['SmsApplication'],{'as':_0xf0ef('0x193'),'foreignKey':'IntervalId'});db['Schedule'][_0xf0ef('0x134')](db[_0xf0ef('0x40')],{});db[_0xf0ef('0x8e')][_0xf0ef('0x134')](db['AnalyticDefaultReport'],{'foreignKey':_0xf0ef('0x194')});db[_0xf0ef('0x8e')][_0xf0ef('0x134')](db[_0xf0ef('0x9b')],{'foreignKey':_0xf0ef('0x195')});db['Sound'][_0xf0ef('0x10f')](db[_0xf0ef('0x1b')],{'as':_0xf0ef('0x196'),'through':_0xf0ef('0x12d'),'onDelete':'restrict'});db[_0xf0ef('0x156')]['belongsToMany'](db['CmContact'],{'through':'cm_contact_has_tags'});db['Tag']['belongsToMany'](db[_0xf0ef('0x6a')],{'through':_0xf0ef('0x17b')});db['Tag'][_0xf0ef('0x10f')](db[_0xf0ef('0x45')],{'through':_0xf0ef('0x157')});db['Tag'][_0xf0ef('0x10f')](db[_0xf0ef('0x10b')],{'through':_0xf0ef('0x16b')});db[_0xf0ef('0x156')][_0xf0ef('0x10f')](db['FaxInteraction'],{'through':'fax_interaction_has_tags'});db[_0xf0ef('0x156')][_0xf0ef('0x10f')](db[_0xf0ef('0x108')],{'through':_0xf0ef('0x170')});db[_0xf0ef('0x197')][_0xf0ef('0x101')](db['Condition'],{'as':{'plural':_0xf0ef('0x198'),'singular':_0xf0ef('0x199')},'foreignKey':'TriggerAllId','onDelete':'cascade','hooks':!![]});db[_0xf0ef('0x197')][_0xf0ef('0x101')](db[_0xf0ef('0x88')],{'as':{'plural':_0xf0ef('0x19a'),'singular':_0xf0ef('0x19b')},'foreignKey':_0xf0ef('0x19c'),'onDelete':_0xf0ef('0x105'),'hooks':!![]});db[_0xf0ef('0x197')][_0xf0ef('0x101')](db[_0xf0ef('0x81')],{'as':_0xf0ef('0x18d'),'foreignKey':_0xf0ef('0x19d'),'onDelete':_0xf0ef('0x105'),'hooks':!![]});db[_0xf0ef('0x9b')][_0xf0ef('0x101')](db[_0xf0ef('0xa1')],{'as':_0xf0ef('0x19e'),'onDelete':'cascade','foreignKey':_0xf0ef('0x195'),'hooks':!![]});db[_0xf0ef('0x9c')]['hasMany'](db[_0xf0ef('0xa1')],{'as':_0xf0ef('0x19e'),'onDelete':_0xf0ef('0x105'),'foreignKey':_0xf0ef('0x194')});db[_0xf0ef('0x9f')][_0xf0ef('0x101')](db[_0xf0ef('0xa1')],{'as':_0xf0ef('0x19e'),'onDelete':_0xf0ef('0x105'),'foreignKey':_0xf0ef('0x19f')});db[_0xf0ef('0xa1')][_0xf0ef('0x134')](db['AnalyticMetric'],{'foreignKey':_0xf0ef('0x19f')});db[_0xf0ef('0xa5')][_0xf0ef('0x101')](db['SalesforceConfiguration'],{'as':_0xf0ef('0x1a0'),'onDelete':_0xf0ef('0x105'),'foreignKey':'AccountId'});db['SalesforceConfiguration'][_0xf0ef('0x101')](db[_0xf0ef('0xa7')],{'as':_0xf0ef('0x1a1'),'onDelete':'cascade','foreignKey':_0xf0ef('0x1a2')});db[_0xf0ef('0xa6')][_0xf0ef('0x101')](db[_0xf0ef('0xa7')],{'as':_0xf0ef('0x1a3'),'onDelete':'cascade','foreignKey':_0xf0ef('0x1a4')});db[_0xf0ef('0xa6')]['hasMany'](db['SalesforceField'],{'as':'Fields','onDelete':_0xf0ef('0x105'),'foreignKey':_0xf0ef('0x1a5')});db[_0xf0ef('0xa6')]['belongsTo'](db[_0xf0ef('0xa5')],{'as':_0xf0ef('0x164'),'foreignKey':_0xf0ef('0x1a6')});db[_0xf0ef('0xa7')][_0xf0ef('0x101')](db['SalesforceField'],{'as':_0xf0ef('0x1a7'),'foreignKey':_0xf0ef('0x1a2')});db[_0xf0ef('0xa7')][_0xf0ef('0x101')](db['SalesforceField'],{'as':_0xf0ef('0x1a8'),'foreignKey':'DescriptionId'});db['SalesforceField'][_0xf0ef('0x101')](db[_0xf0ef('0xa7')],{'as':_0xf0ef('0x1a9'),'foreignKey':_0xf0ef('0x1a5')});db[_0xf0ef('0xa7')][_0xf0ef('0x134')](db[_0xf0ef('0x95')],{'as':_0xf0ef('0x95'),'foreignKey':_0xf0ef('0x1aa')});db[_0xf0ef('0xa9')]['hasMany'](db[_0xf0ef('0xab')],{'as':_0xf0ef('0x1a0'),'onDelete':'cascade','foreignKey':_0xf0ef('0x1a6')});db[_0xf0ef('0xab')][_0xf0ef('0x101')](db[_0xf0ef('0xac')],{'as':_0xf0ef('0x1a1'),'onDelete':_0xf0ef('0x105'),'foreignKey':_0xf0ef('0x1a2')});db[_0xf0ef('0xab')][_0xf0ef('0x101')](db['SugarcrmField'],{'as':_0xf0ef('0x1a3'),'onDelete':_0xf0ef('0x105'),'foreignKey':_0xf0ef('0x1a4')});db[_0xf0ef('0xab')][_0xf0ef('0x101')](db[_0xf0ef('0xac')],{'as':_0xf0ef('0x19e'),'onDelete':'cascade','foreignKey':_0xf0ef('0x1a5')});db[_0xf0ef('0xab')][_0xf0ef('0x134')](db[_0xf0ef('0xa9')],{'as':'Account','foreignKey':'AccountId'});db['SugarcrmField'][_0xf0ef('0x101')](db[_0xf0ef('0xac')],{'as':_0xf0ef('0x1a7'),'foreignKey':'SubjectId'});db[_0xf0ef('0xac')]['hasMany'](db['SugarcrmField'],{'as':_0xf0ef('0x1a8'),'foreignKey':_0xf0ef('0x1a4')});db[_0xf0ef('0xac')][_0xf0ef('0x101')](db[_0xf0ef('0xac')],{'as':'Field','foreignKey':_0xf0ef('0x1a5')});db[_0xf0ef('0xac')][_0xf0ef('0x134')](db[_0xf0ef('0x95')],{'as':_0xf0ef('0x95'),'foreignKey':'VariableId'});db[_0xf0ef('0x1ab')]['hasMany'](db[_0xf0ef('0x1ac')],{'as':_0xf0ef('0x1a0'),'onDelete':'cascade','foreignKey':_0xf0ef('0x1a6')});db[_0xf0ef('0x1ac')][_0xf0ef('0x101')](db[_0xf0ef('0xb0')],{'as':_0xf0ef('0x1a1'),'onDelete':_0xf0ef('0x105'),'foreignKey':_0xf0ef('0x1a2')});db[_0xf0ef('0x1ac')]['hasMany'](db['DeskField'],{'as':_0xf0ef('0x1a3'),'onDelete':_0xf0ef('0x105'),'foreignKey':'DescriptionId'});db['DeskConfiguration'][_0xf0ef('0x101')](db[_0xf0ef('0xb0')],{'as':_0xf0ef('0x19e'),'onDelete':_0xf0ef('0x105'),'foreignKey':_0xf0ef('0x1a5')});db[_0xf0ef('0x1ac')][_0xf0ef('0x134')](db[_0xf0ef('0x1ab')],{'as':_0xf0ef('0x164'),'foreignKey':_0xf0ef('0x1a6')});db['DeskConfiguration'][_0xf0ef('0x10f')](db[_0xf0ef('0x156')],{'through':_0xf0ef('0x1ad')});db[_0xf0ef('0xb0')][_0xf0ef('0x101')](db[_0xf0ef('0xb0')],{'as':_0xf0ef('0x1a7'),'foreignKey':_0xf0ef('0x1a2')});db['DeskField']['hasMany'](db[_0xf0ef('0xb0')],{'as':_0xf0ef('0x1a8'),'foreignKey':_0xf0ef('0x1a4')});db['DeskField'][_0xf0ef('0x101')](db[_0xf0ef('0xb0')],{'as':_0xf0ef('0x1a9'),'foreignKey':_0xf0ef('0x1a5')});db['DeskField'][_0xf0ef('0x134')](db[_0xf0ef('0x95')],{'as':'Variable','foreignKey':_0xf0ef('0x1aa')});db[_0xf0ef('0x1ae')][_0xf0ef('0x101')](db[_0xf0ef('0x1af')],{'as':_0xf0ef('0x1a0'),'onDelete':_0xf0ef('0x105'),'foreignKey':_0xf0ef('0x1a6')});db[_0xf0ef('0x1af')][_0xf0ef('0x101')](db['ZohoField'],{'as':_0xf0ef('0x1a1'),'onDelete':_0xf0ef('0x105'),'foreignKey':_0xf0ef('0x1a2')});db['ZohoConfiguration'][_0xf0ef('0x101')](db['ZohoField'],{'as':_0xf0ef('0x1a3'),'onDelete':_0xf0ef('0x105'),'foreignKey':_0xf0ef('0x1a4')});db[_0xf0ef('0x1af')][_0xf0ef('0x101')](db[_0xf0ef('0xb3')],{'as':_0xf0ef('0x19e'),'onDelete':'cascade','foreignKey':'FieldId'});db[_0xf0ef('0x1af')][_0xf0ef('0x134')](db[_0xf0ef('0x1ae')],{'as':_0xf0ef('0x164'),'foreignKey':_0xf0ef('0x1a6')});db[_0xf0ef('0xb3')][_0xf0ef('0x101')](db[_0xf0ef('0xb3')],{'as':_0xf0ef('0x1a7'),'foreignKey':'SubjectId'});db[_0xf0ef('0xb3')][_0xf0ef('0x101')](db[_0xf0ef('0xb3')],{'as':_0xf0ef('0x1a8'),'foreignKey':_0xf0ef('0x1a4')});db[_0xf0ef('0xb3')]['hasMany'](db[_0xf0ef('0xb3')],{'as':_0xf0ef('0x1a9'),'foreignKey':_0xf0ef('0x1a5')});db[_0xf0ef('0xb3')][_0xf0ef('0x134')](db[_0xf0ef('0x95')],{'as':_0xf0ef('0x95'),'foreignKey':'VariableId'});db[_0xf0ef('0xb5')][_0xf0ef('0x101')](db[_0xf0ef('0xb7')],{'as':'Configurations','onDelete':'cascade','foreignKey':_0xf0ef('0x1a6')});db[_0xf0ef('0xb7')][_0xf0ef('0x101')](db['ZendeskField'],{'as':'Subjects','foreignKey':'SubjectId'});db['ZendeskConfiguration'][_0xf0ef('0x101')](db[_0xf0ef('0xb8')],{'as':_0xf0ef('0x1a3'),'foreignKey':'DescriptionId'});db[_0xf0ef('0xb7')][_0xf0ef('0x101')](db[_0xf0ef('0xb8')],{'as':'Fields','foreignKey':_0xf0ef('0x1a5')});db[_0xf0ef('0xb7')][_0xf0ef('0x134')](db[_0xf0ef('0xb5')],{'as':_0xf0ef('0x164'),'foreignKey':'AccountId'});db['ZendeskConfiguration'][_0xf0ef('0x10f')](db[_0xf0ef('0x156')],{'through':_0xf0ef('0x1b0')});db[_0xf0ef('0xb8')][_0xf0ef('0x101')](db['ZendeskField'],{'as':'Subject','foreignKey':_0xf0ef('0x1a2')});db[_0xf0ef('0xb8')][_0xf0ef('0x101')](db[_0xf0ef('0xb8')],{'as':_0xf0ef('0x1a8'),'foreignKey':'DescriptionId'});db[_0xf0ef('0xb8')]['hasMany'](db[_0xf0ef('0xb8')],{'as':_0xf0ef('0x1a9'),'foreignKey':_0xf0ef('0x1a5')});db['ZendeskField'][_0xf0ef('0x134')](db[_0xf0ef('0x95')],{'as':_0xf0ef('0x95'),'foreignKey':'VariableId'});db[_0xf0ef('0xb9')]['hasMany'](db[_0xf0ef('0xbb')],{'as':_0xf0ef('0x1a0'),'onDelete':_0xf0ef('0x105'),'foreignKey':_0xf0ef('0x1a6')});db[_0xf0ef('0xbb')][_0xf0ef('0x101')](db[_0xf0ef('0xbd')],{'as':'Subjects','onDelete':_0xf0ef('0x105'),'foreignKey':'SubjectId'});db[_0xf0ef('0xbb')][_0xf0ef('0x101')](db[_0xf0ef('0xbd')],{'as':'Descriptions','onDelete':_0xf0ef('0x105'),'foreignKey':_0xf0ef('0x1a4')});db[_0xf0ef('0xbb')][_0xf0ef('0x101')](db[_0xf0ef('0xbd')],{'as':_0xf0ef('0x19e'),'onDelete':_0xf0ef('0x105'),'foreignKey':_0xf0ef('0x1a5')});db[_0xf0ef('0xbb')][_0xf0ef('0x134')](db[_0xf0ef('0xb9')],{'as':_0xf0ef('0x164'),'foreignKey':_0xf0ef('0x1a6')});db[_0xf0ef('0xbb')][_0xf0ef('0x10f')](db[_0xf0ef('0x156')],{'through':_0xf0ef('0x1b1')});db[_0xf0ef('0xbd')][_0xf0ef('0x101')](db[_0xf0ef('0xbd')],{'as':_0xf0ef('0x1a7'),'foreignKey':_0xf0ef('0x1a2')});db[_0xf0ef('0xbd')][_0xf0ef('0x101')](db['FreshdeskField'],{'as':_0xf0ef('0x1a8'),'foreignKey':_0xf0ef('0x1a4')});db[_0xf0ef('0xbd')]['hasMany'](db['FreshdeskField'],{'as':_0xf0ef('0x1a9'),'foreignKey':_0xf0ef('0x1a5')});db[_0xf0ef('0xbd')][_0xf0ef('0x134')](db[_0xf0ef('0x95')],{'as':_0xf0ef('0x95'),'foreignKey':'VariableId'});db[_0xf0ef('0xbe')][_0xf0ef('0x101')](db[_0xf0ef('0xbf')],{'as':_0xf0ef('0x1a0'),'onDelete':_0xf0ef('0x105'),'foreignKey':_0xf0ef('0x1a6')});db[_0xf0ef('0xbf')][_0xf0ef('0x101')](db[_0xf0ef('0x1b2')],{'as':_0xf0ef('0x1a1'),'foreignKey':'SubjectId'});db['VtigerConfiguration']['hasMany'](db[_0xf0ef('0x1b2')],{'as':_0xf0ef('0x1a3'),'foreignKey':_0xf0ef('0x1a4')});db['VtigerConfiguration'][_0xf0ef('0x101')](db[_0xf0ef('0x1b2')],{'as':_0xf0ef('0x19e'),'foreignKey':_0xf0ef('0x1a5')});db['VtigerConfiguration'][_0xf0ef('0x134')](db[_0xf0ef('0xbe')],{'as':'Account','foreignKey':_0xf0ef('0x1a6')});db[_0xf0ef('0x1b2')][_0xf0ef('0x101')](db[_0xf0ef('0x1b2')],{'as':_0xf0ef('0x1a7'),'foreignKey':_0xf0ef('0x1a2')});db[_0xf0ef('0x1b2')][_0xf0ef('0x101')](db[_0xf0ef('0x1b2')],{'as':_0xf0ef('0x1a8'),'foreignKey':'DescriptionId'});db[_0xf0ef('0x1b2')][_0xf0ef('0x101')](db['VtigerField'],{'as':_0xf0ef('0x1a9'),'foreignKey':_0xf0ef('0x1a5')});db[_0xf0ef('0x1b2')][_0xf0ef('0x134')](db[_0xf0ef('0x95')],{'as':_0xf0ef('0x95'),'foreignKey':_0xf0ef('0x1aa')});db[_0xf0ef('0xc1')][_0xf0ef('0x101')](db[_0xf0ef('0xc3')],{'as':_0xf0ef('0x1a0'),'onDelete':_0xf0ef('0x105'),'foreignKey':'AccountId'});db[_0xf0ef('0xc3')][_0xf0ef('0x101')](db[_0xf0ef('0xc5')],{'as':'Subjects','foreignKey':_0xf0ef('0x1a2')});db['ServicenowConfiguration'][_0xf0ef('0x101')](db[_0xf0ef('0xc5')],{'as':'Descriptions','foreignKey':_0xf0ef('0x1a4')});db['ServicenowConfiguration'][_0xf0ef('0x101')](db['ServicenowField'],{'as':_0xf0ef('0x19e'),'foreignKey':'FieldId'});db['ServicenowConfiguration'][_0xf0ef('0x134')](db[_0xf0ef('0xc1')],{'as':_0xf0ef('0x164'),'foreignKey':'AccountId'});db[_0xf0ef('0xc5')]['hasMany'](db['ServicenowField'],{'as':_0xf0ef('0x1a7'),'foreignKey':_0xf0ef('0x1a2')});db[_0xf0ef('0xc5')][_0xf0ef('0x101')](db[_0xf0ef('0xc5')],{'as':_0xf0ef('0x1a8'),'foreignKey':_0xf0ef('0x1a4')});db['ServicenowField'][_0xf0ef('0x101')](db[_0xf0ef('0xc5')],{'as':_0xf0ef('0x1a9'),'foreignKey':_0xf0ef('0x1a5')});db[_0xf0ef('0xc5')][_0xf0ef('0x134')](db[_0xf0ef('0x95')],{'as':_0xf0ef('0x95'),'foreignKey':'VariableId'});db[_0xf0ef('0x1b3')][_0xf0ef('0x101')](db[_0xf0ef('0xc8')],{'as':_0xf0ef('0x1a0'),'onDelete':_0xf0ef('0x105'),'foreignKey':'AccountId'});db[_0xf0ef('0xc8')][_0xf0ef('0x101')](db['Dynamics365Field'],{'as':_0xf0ef('0x1a1'),'onDelete':'cascade','foreignKey':_0xf0ef('0x1a2')});db[_0xf0ef('0xc8')][_0xf0ef('0x101')](db[_0xf0ef('0xca')],{'as':_0xf0ef('0x1a3'),'onDelete':'cascade','foreignKey':_0xf0ef('0x1a4')});db[_0xf0ef('0xc8')][_0xf0ef('0x101')](db['Dynamics365Field'],{'as':'Fields','onDelete':_0xf0ef('0x105'),'foreignKey':_0xf0ef('0x1a5')});db['Dynamics365Configuration'][_0xf0ef('0x134')](db[_0xf0ef('0x1b3')],{'as':'Account','foreignKey':'AccountId'});db['Dynamics365Field'][_0xf0ef('0x101')](db[_0xf0ef('0xca')],{'as':_0xf0ef('0x1a7'),'foreignKey':_0xf0ef('0x1a2')});db[_0xf0ef('0xca')][_0xf0ef('0x101')](db['Dynamics365Field'],{'as':_0xf0ef('0x1a8'),'foreignKey':_0xf0ef('0x1a4')});db[_0xf0ef('0xca')][_0xf0ef('0x101')](db[_0xf0ef('0xca')],{'as':'Field','foreignKey':_0xf0ef('0x1a5')});db[_0xf0ef('0xca')][_0xf0ef('0x134')](db[_0xf0ef('0x95')],{'as':'Variable','foreignKey':_0xf0ef('0x1aa')});db[_0xf0ef('0x1b4')][_0xf0ef('0x101')](db[_0xf0ef('0x1b5')],{'as':'Configurations','onDelete':_0xf0ef('0x105'),'foreignKey':_0xf0ef('0x1a6')});db[_0xf0ef('0x1b5')][_0xf0ef('0x101')](db[_0xf0ef('0x1b6')],{'as':_0xf0ef('0x1a1'),'foreignKey':'SubjectId'});db[_0xf0ef('0x1b5')][_0xf0ef('0x101')](db['FreshsalesField'],{'as':_0xf0ef('0x1a3'),'foreignKey':_0xf0ef('0x1a4')});db[_0xf0ef('0x1b5')][_0xf0ef('0x101')](db[_0xf0ef('0x1b6')],{'as':'Fields','foreignKey':'FieldId'});db[_0xf0ef('0x1b5')]['belongsTo'](db[_0xf0ef('0x1b4')],{'as':_0xf0ef('0x164'),'foreignKey':_0xf0ef('0x1a6')});db[_0xf0ef('0x1b6')]['hasMany'](db[_0xf0ef('0x1b6')],{'as':_0xf0ef('0x1a7'),'foreignKey':'SubjectId'});db[_0xf0ef('0x1b6')][_0xf0ef('0x101')](db[_0xf0ef('0x1b6')],{'as':_0xf0ef('0x1a8'),'foreignKey':_0xf0ef('0x1a4')});db[_0xf0ef('0x1b6')][_0xf0ef('0x101')](db[_0xf0ef('0x1b6')],{'as':_0xf0ef('0x1a9'),'foreignKey':_0xf0ef('0x1a5')});db[_0xf0ef('0x1b6')][_0xf0ef('0x134')](db[_0xf0ef('0x95')],{'as':'Variable','foreignKey':_0xf0ef('0x1aa')});db['ChatQueueReport'][_0xf0ef('0x134')](db[_0xf0ef('0x66')],{});db['ChatQueueReport']['belongsTo'](db[_0xf0ef('0x112')],{'as':_0xf0ef('0x161'),'foreignKey':_0xf0ef('0x151')});db[_0xf0ef('0xd0')][_0xf0ef('0x134')](db[_0xf0ef('0x75')],{'as':_0xf0ef('0x148'),'foreignKey':_0xf0ef('0x149')});db[_0xf0ef('0xd0')][_0xf0ef('0x134')](db['ChatInteraction'],{});db[_0xf0ef('0xd0')][_0xf0ef('0x134')](db[_0xf0ef('0x179')],{});db['ChatQueueReport'][_0xf0ef('0x134')](db[_0xf0ef('0x14')],{});db[_0xf0ef('0xd0')][_0xf0ef('0x134')](db[_0xf0ef('0x6e')],{});db['ChatInternalMessage'][_0xf0ef('0x134')](db[_0xf0ef('0x14')],{'onDelete':_0xf0ef('0x105'),'foreignKey':_0xf0ef('0x1b7')});db[_0xf0ef('0xd2')][_0xf0ef('0x134')](db[_0xf0ef('0x14')],{'onDelete':_0xf0ef('0x105'),'foreignKey':_0xf0ef('0x1b8')});db[_0xf0ef('0xd8')]['hasMany'](db[_0xf0ef('0xd6')],{'foreignKey':_0xf0ef('0x1b9'),'onDelete':_0xf0ef('0x105')});db[_0xf0ef('0xd8')]['hasMany'](db[_0xf0ef('0xd4')],{'foreignKey':'SessionId','onDelete':_0xf0ef('0x105')});db['SmsQueueReport'][_0xf0ef('0x134')](db[_0xf0ef('0x56')],{});db[_0xf0ef('0xda')][_0xf0ef('0x134')](db[_0xf0ef('0x112')],{'as':_0xf0ef('0x161'),'foreignKey':_0xf0ef('0x151')});db['SmsQueueReport'][_0xf0ef('0x134')](db[_0xf0ef('0x75')],{'as':'Contact','foreignKey':_0xf0ef('0x149')});db[_0xf0ef('0xda')][_0xf0ef('0x134')](db[_0xf0ef('0x10b')],{});db[_0xf0ef('0xda')]['belongsTo'](db[_0xf0ef('0x5b')],{});db[_0xf0ef('0xda')]['belongsTo'](db['User'],{});db[_0xf0ef('0xda')][_0xf0ef('0x134')](db['SmsQueue'],{});db[_0xf0ef('0xde')][_0xf0ef('0x101')](db[_0xf0ef('0xd8')],{'foreignKey':_0xf0ef('0x1ba')});db[_0xf0ef('0xde')][_0xf0ef('0x101')](db[_0xf0ef('0xd6')],{'foreignKey':_0xf0ef('0x1ba')});db[_0xf0ef('0xde')][_0xf0ef('0x101')](db[_0xf0ef('0xd4')],{'foreignKey':_0xf0ef('0x1ba')});db[_0xf0ef('0xe1')][_0xf0ef('0x10f')](db[_0xf0ef('0x14')],{'as':'Users','through':_0xf0ef('0x129')});db[_0xf0ef('0xe7')]['belongsToMany'](db[_0xf0ef('0x14')],{'as':_0xf0ef('0x13d'),'through':_0xf0ef('0x114')});db['Team']['belongsToMany'](db[_0xf0ef('0x1d')],{'through':_0xf0ef('0x13f'),'as':_0xf0ef('0x118')});db[_0xf0ef('0xe7')]['belongsToMany'](db[_0xf0ef('0x42')],{'through':_0xf0ef('0x153'),'as':_0xf0ef('0x119')});db[_0xf0ef('0xe7')][_0xf0ef('0x10f')](db[_0xf0ef('0x6e')],{'through':_0xf0ef('0x17c'),'as':_0xf0ef('0x11a')});db[_0xf0ef('0xe7')][_0xf0ef('0x10f')](db[_0xf0ef('0x11b')],{'through':_0xf0ef('0x1bb'),'as':'FaxQueues'});db[_0xf0ef('0xe7')]['belongsToMany'](db['SmsQueue'],{'through':_0xf0ef('0x16c'),'as':_0xf0ef('0x1bc')});db[_0xf0ef('0xe7')][_0xf0ef('0x10f')](db[_0xf0ef('0x65')],{'through':_0xf0ef('0x173'),'as':_0xf0ef('0x1bd')});db['Campaign'][_0xf0ef('0x101')](db[_0xf0ef('0x77')],{'as':'Hoppers','foreignKey':_0xf0ef('0x185')});db['Campaign'][_0xf0ef('0x101')](db[_0xf0ef('0x79')],{'as':'HopperFinals','foreignKey':_0xf0ef('0x185')});db[_0xf0ef('0x184')][_0xf0ef('0x101')](db[_0xf0ef('0x7b')],{'as':_0xf0ef('0x131'),'foreignKey':'CampaignId'});db['Campaign'][_0xf0ef('0x101')](db[_0xf0ef('0x132')],{'as':'HopperBlacks','foreignKey':'CampaignId'});db[_0xf0ef('0x184')][_0xf0ef('0x134')](db['Trunk'],{'as':_0xf0ef('0x135'),'foreignKey':_0xf0ef('0x136')});db[_0xf0ef('0x184')]['belongsTo'](db[_0xf0ef('0x135')],{'as':_0xf0ef('0x137'),'foreignKey':_0xf0ef('0x1be')});db[_0xf0ef('0x184')][_0xf0ef('0x134')](db[_0xf0ef('0x138')],{'as':_0xf0ef('0x138'),'foreignKey':_0xf0ef('0x139')});db[_0xf0ef('0x184')]['belongsTo'](db['SquareProject'],{'as':'SquareProject','foreignKey':_0xf0ef('0x1bf')});db[_0xf0ef('0x184')][_0xf0ef('0x10f')](db[_0xf0ef('0x112')],{'as':_0xf0ef('0x113'),'through':_0xf0ef('0x1c0')});db[_0xf0ef('0x184')][_0xf0ef('0x10f')](db['CmList'],{'as':_0xf0ef('0x140'),'through':_0xf0ef('0x1c1')});db[_0xf0ef('0xef')]['belongsTo'](db[_0xf0ef('0x15b')],{});db[_0xf0ef('0xef')][_0xf0ef('0x134')](db['MailInteraction'],{});db[_0xf0ef('0xef')]['belongsTo'](db['MailAccount'],{'foreignKey':_0xf0ef('0x1c2'),'as':_0xf0ef('0x1c3')});db['MailTransferReport'][_0xf0ef('0x134')](db[_0xf0ef('0x14')],{'foreignKey':_0xf0ef('0x1c4'),'as':_0xf0ef('0x1c5')});db['MailTransferReport'][_0xf0ef('0x134')](db['User'],{'foreignKey':'ToUserId','as':'ToAgent'});db[_0xf0ef('0xef')][_0xf0ef('0x134')](db[_0xf0ef('0x42')],{'foreignKey':_0xf0ef('0x1c6'),'as':_0xf0ef('0x1c7')});db['MailTransferReport']['belongsTo'](db[_0xf0ef('0x40')],{'foreignKey':_0xf0ef('0x1c8'),'as':'ToAccount'});db['ChatTransferReport'][_0xf0ef('0x134')](db[_0xf0ef('0x179')],{});db[_0xf0ef('0xf1')][_0xf0ef('0x134')](db['ChatInteraction'],{});db[_0xf0ef('0xf1')][_0xf0ef('0x134')](db[_0xf0ef('0x66')],{'foreignKey':'FromChatWebsiteId','as':'FromAccount'});db[_0xf0ef('0xf1')]['belongsTo'](db['User'],{'foreignKey':_0xf0ef('0x1c4'),'as':_0xf0ef('0x1c5')});db[_0xf0ef('0xf1')][_0xf0ef('0x134')](db[_0xf0ef('0x14')],{'foreignKey':_0xf0ef('0x1c9'),'as':'ToAgent'});db[_0xf0ef('0xf1')]['belongsTo'](db[_0xf0ef('0x6e')],{'foreignKey':_0xf0ef('0x1ca'),'as':'ToQueue'});db[_0xf0ef('0xf1')]['belongsTo'](db[_0xf0ef('0x66')],{'foreignKey':_0xf0ef('0x1cb'),'as':'ToAccount'});db[_0xf0ef('0xf3')][_0xf0ef('0x134')](db[_0xf0ef('0x51')],{});db[_0xf0ef('0xf3')]['belongsTo'](db[_0xf0ef('0x4f')],{});db['FaxTransferReport'][_0xf0ef('0x134')](db[_0xf0ef('0x4c')],{'foreignKey':_0xf0ef('0x1cc'),'as':_0xf0ef('0x1c3')});db[_0xf0ef('0xf3')][_0xf0ef('0x134')](db[_0xf0ef('0x14')],{'foreignKey':_0xf0ef('0x1c4'),'as':_0xf0ef('0x1c5')});db[_0xf0ef('0xf3')][_0xf0ef('0x134')](db[_0xf0ef('0x14')],{'foreignKey':'ToUserId','as':'ToAgent'});db[_0xf0ef('0xf3')]['belongsTo'](db[_0xf0ef('0x11b')],{'foreignKey':'ToFaxQueueId','as':_0xf0ef('0x1c7')});db['FaxTransferReport'][_0xf0ef('0x134')](db[_0xf0ef('0x4c')],{'foreignKey':'ToFaxAccountId','as':_0xf0ef('0x1cd')});db[_0xf0ef('0xf5')][_0xf0ef('0x134')](db[_0xf0ef('0x63')],{});db['OpenchannelTransferReport'][_0xf0ef('0x134')](db[_0xf0ef('0x108')],{});db[_0xf0ef('0xf5')][_0xf0ef('0x134')](db[_0xf0ef('0x125')],{'foreignKey':_0xf0ef('0x1ce'),'as':_0xf0ef('0x1c3')});db[_0xf0ef('0xf5')][_0xf0ef('0x134')](db[_0xf0ef('0x14')],{'foreignKey':'FromUserId','as':'FromAgent'});db['OpenchannelTransferReport'][_0xf0ef('0x134')](db['User'],{'foreignKey':'ToUserId','as':_0xf0ef('0x1cf')});db['OpenchannelTransferReport']['belongsTo'](db['OpenchannelQueue'],{'foreignKey':_0xf0ef('0x1d0'),'as':_0xf0ef('0x1c7')});db[_0xf0ef('0xf5')][_0xf0ef('0x134')](db['OpenchannelAccount'],{'foreignKey':_0xf0ef('0x1d1'),'as':_0xf0ef('0x1cd')});db['SmsTransferReport']['belongsTo'](db[_0xf0ef('0x5b')],{});db['SmsTransferReport'][_0xf0ef('0x134')](db[_0xf0ef('0x10b')],{});db['SmsTransferReport'][_0xf0ef('0x134')](db[_0xf0ef('0x56')],{'foreignKey':_0xf0ef('0x1d2'),'as':_0xf0ef('0x1c3')});db[_0xf0ef('0xf7')][_0xf0ef('0x134')](db[_0xf0ef('0x14')],{'foreignKey':_0xf0ef('0x1c4'),'as':'FromAgent'});db[_0xf0ef('0xf7')]['belongsTo'](db[_0xf0ef('0x14')],{'foreignKey':_0xf0ef('0x1c9'),'as':_0xf0ef('0x1cf')});db[_0xf0ef('0xf7')]['belongsTo'](db[_0xf0ef('0x5d')],{'foreignKey':'ToSmsQueueId','as':_0xf0ef('0x1c7')});db['SmsTransferReport'][_0xf0ef('0x134')](db[_0xf0ef('0x56')],{'foreignKey':_0xf0ef('0x1d3'),'as':_0xf0ef('0x1cd')});db[_0xf0ef('0x112')][_0xf0ef('0x101')](db[_0xf0ef('0x86')],{'as':_0xf0ef('0x14e'),'foreignKey':_0xf0ef('0x151')});db[_0xf0ef('0x112')][_0xf0ef('0x101')](db[_0xf0ef('0x7f')],{'as':_0xf0ef('0x1d4'),'foreignKey':'ListId'});db[_0xf0ef('0x112')][_0xf0ef('0x101')](db[_0xf0ef('0x75')],{'as':_0xf0ef('0x110'),'onDelete':_0xf0ef('0x105'),'foreignKey':_0xf0ef('0x151')});db[_0xf0ef('0x112')][_0xf0ef('0x101')](db['CmHopperFinal'],{'as':_0xf0ef('0x106'),'foreignKey':_0xf0ef('0x151')});db[_0xf0ef('0x112')][_0xf0ef('0x101')](db['CmHopperHistory'],{'as':_0xf0ef('0x107'),'foreignKey':_0xf0ef('0x151')});db[_0xf0ef('0x112')][_0xf0ef('0x101')](db[_0xf0ef('0x7d')],{'as':_0xf0ef('0x7d'),'foreignKey':_0xf0ef('0x151')});db[_0xf0ef('0x112')]['belongsToMany'](db['VoiceQueue'],{'as':_0xf0ef('0x1d5'),'through':_0xf0ef('0x13c')});db['CmList']['belongsToMany'](db[_0xf0ef('0x14')],{'as':_0xf0ef('0x13d'),'through':_0xf0ef('0x11d')});db[_0xf0ef('0xf9')][_0xf0ef('0x101')](db[_0xf0ef('0x1a')],{'as':_0xf0ef('0x18f'),'onDelete':'restrict'});db['VoicePrefix'][_0xf0ef('0x10f')](db[_0xf0ef('0x14')],{'as':_0xf0ef('0x13d'),'through':_0xf0ef('0x11f')});db[_0xf0ef('0xfb')]['hasMany'](db[_0xf0ef('0x14')],{'as':_0xf0ef('0x159'),'foreignKey':_0xf0ef('0x1d6')});db['UserProfile']['hasMany'](db[_0xf0ef('0x1d7')],{'as':_0xf0ef('0x1d8'),'foreignKey':_0xf0ef('0x1d6'),'onDelete':'cascade'});db[_0xf0ef('0x1d7')][_0xf0ef('0x101')](db[_0xf0ef('0xfd')],{'as':_0xf0ef('0x1d9'),'foreignKey':_0xf0ef('0x1da'),'onDelete':_0xf0ef('0x105')});module[_0xf0ef('0x1db')]={'db':db,'dbH':dbH};
\ No newline at end of file
diff --git a/server/routes.js b/server/routes.js
index b46815b..18ff3b8 100644
--- a/server/routes.js
+++ b/server/routes.js
@@ -15,4 +15,4 @@
// * treaties. The SOFTWARE PRODUCT is licensed, not sold. *
// * *
// *************************************************************************
-var _0x364f=['./api/chatOfflineMessage','./api/chatQueue','/api/chat/groups','./api/chatGroup','/api/chat/proactive_actions','/api/cm/companies','/api/cm/contacts','/api/cm/hopper','./api/cmHopper','/api/cm/hopper_black','./api/cmHopperBlack','/api/cm/hopper_final','./api/cmHopperFinal','/api/cm/hopper_history','/api/cm/custom_fields','/api/actions','./api/action','./api/automation','/api/canned_answers','/api/dispositions','./api/disposition','/api/conditions','./api/condition','/api/intervals','/api/pauses','./api/pause','./api/cdr','/api/voiceQueuesLog','./api/voiceQueuesLog','./api/schedule','/api/tags','./api/template','/api/triggers','./api/trigger','/api/variables','./api/variable','./api/integration','/api/integrations/reports','./api/analyticCustomReport','/api/analytics/default_reports','./api/analyticDefaultReport','/api/analytics/extracted_reports','./api/analyticExtractedReport','/api/analytics/metrics','./api/analyticMetric','/api/analytics/field_reports','./api/analyticFieldReport','./api/intSalesforceAccount','/api/integrations/salesforce/configurations','./api/intSalesforceConfiguration','/api/integrations/sugarcrm/accounts','./api/intSugarcrmAccount','/api/integrations/sugarcrm/configurations','/api/integrations/sugarcrm/fields','./api/intSugarcrmField','/api/integrations/desk/accounts','./api/intDeskAccount','/api/integrations/desk/configurations','./api/intDeskConfiguration','/api/integrations/desk/fields','./api/intDeskField','/api/integrations/zoho/accounts','/api/integrations/zoho/configurations','./api/intZohoConfiguration','/api/integrations/zoho/fields','/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/integrations/freshdesk/fields','./api/intFreshdeskField','/api/integrations/vtiger/accounts','./api/intVtigerAccount','/api/integrations/vtiger/configurations','./api/intVtigerConfiguration','/api/integrations/vtiger/fields','/api/integrations/servicenow/accounts','./api/intServicenowAccount','/api/integrations/servicenow/configurations','./api/intServicenowConfiguration','/api/integrations/servicenow/fields','/api/integrations/dynamics365/accounts','./api/intDynamics365Configuration','/api/integrations/dynamics365/fields','./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/chatInternalMessage','/api/jscripty/answers/reports','./api/jscriptyAnswerReport','./api/jscriptyQuestionReport','./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/squareOdbc','/api/square/projects','./api/squareProject','./api/squareRecording','/api/teams','./api/team','/api/license','/api/campaigns','./api/campaign','/api/migrations','/api/attachments','/api/plugins','./api/plugin','/api/mail/reports/transfer','./api/mailTransferReport','/api/chat/reports/transfer','./api/chatTransferReport','/api/openchannel/reports/transfer','./api/openchannelTransferReport','./api/cmList','/api/voice/prefixes','/api/userProfiles','./api/userProfile','/api/userProfile/sections','./api/userProfileSection','/api/userProfile/resources','/api/auth/local','./api/authLocal','/api/auth/google','./api/authGoogle','/api/jira','./api/jira','/api/rpc','./api/rpc','/api/version','/api/system','/api/pm2','/apidoc','static','join','root','/www','/demo','/snippet','/plugins','/server/files/plugins','/:url(api|auth|components|app|bower_components|assets)/*','get','sendFile','resolve','appPath','/index.html','path','express','express-winston','util','./errors','./config/environment','./config/logger','auth','default','logger','%s\x20%s\x20%s\x20%s\x20%sms\x20id=%s\x20name=%s\x20role=%s','method','headers','x-forwarded-for','connection','remoteAddress','url','statusCode','responseTime','user','role','use','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)','name','test','/api/users','/api/voice/chanspy','./api/voiceChanSpy','/api/voice/contexts','./api/voiceContext','/api/voice/extensions','/api/voice/mohs','./api/voiceMusicOnHold','/api/voice/queues','./api/voiceQueue','/api/voice/recordings','./api/voiceRecording','./api/screenRecording','/api/voice/mails','./api/voiceMail','/api/voice/mails/messages','./api/voiceMailMessage','./api/voiceCallReport','/api/voice/dials/reports','/api/voice/agents/reports','./api/voiceAgentReport','/api/trunks','./api/trunk','./api/voiceTransferReport','/api/mail/out_servers','./api/mailServerOut','/api/mail/accounts','./api/mailAccount','/api/mail/queues','./api/mailQueue','./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/fax/accounts','./api/faxApplication','/api/fax/interactions','/api/fax/messages','./api/faxMessage','./api/faxQueue','./api/faxQueueReport','./api/smsAccount','/api/sms/applications','./api/smsApplication','/api/sms/messages','./api/smsMessage','./api/smsQueue','./api/openchannelAccount','/api/openchannel/applications','./api/openchannelApplication','/api/openchannel/interactions','/api/openchannel/messages','./api/openchannelMessage','/api/openchannel/queues','./api/openchannelQueue','/api/chat/websites','./api/chatWebsite','./api/openchannelQueueReport','/api/chat/applications','./api/chatApplication','./api/chatInteraction','/api/chat/messages','./api/chatMessage','/api/chat/offline_messages'];(function(_0x32c90e,_0x29c8ab){var _0x383f2e=function(_0x2d629c){while(--_0x2d629c){_0x32c90e['push'](_0x32c90e['shift']());}};_0x383f2e(++_0x29c8ab);}(_0x364f,0xa5));var _0xf364=function(_0x4fdc46,_0x2a3759){_0x4fdc46=_0x4fdc46-0x0;var _0x2c178a=_0x364f[_0x4fdc46];return _0x2c178a;};'use strict';var path=require(_0xf364('0x0'));var express=require(_0xf364('0x1'));var ewinston=require(_0xf364('0x2'));var util=require(_0xf364('0x3'));var errors=require(_0xf364('0x4'));var config=require(_0xf364('0x5'));var logger=require(_0xf364('0x6'))('api');var authLogger=require('./config/logger')(_0xf364('0x7'));exports[_0xf364('0x8')]=function(_0x46110c){_0x46110c['use'](ewinston[_0xf364('0x9')]({'winstonInstance':logger,'meta':![],'statusLevels':!![],'msg':function(_0x30c95c,_0x253f85){return util['format'](_0xf364('0xa'),_0x30c95c[_0xf364('0xb')],_0x30c95c[_0xf364('0xc')][_0xf364('0xd')]?_0x30c95c[_0xf364('0xc')][_0xf364('0xd')]:_0x30c95c[_0xf364('0xe')][_0xf364('0xf')]||_0x30c95c['ip'],_0x30c95c[_0xf364('0x10')],_0x253f85[_0xf364('0x11')],_0x253f85[_0xf364('0x12')],_0x30c95c[_0xf364('0x13')]?_0x30c95c[_0xf364('0x13')]['id']:null,_0x30c95c['user']?_0x30c95c[_0xf364('0x13')]['name']:null,_0x30c95c[_0xf364('0x13')]?_0x30c95c['user'][_0xf364('0x14')]:null);}}));_0x46110c[_0xf364('0x15')](ewinston[_0xf364('0x9')]({'winstonInstance':authLogger,'meta':![],'statusLevels':!![],'msg':function(_0x18be72,_0x54f84d){var _0x1d4866='%s\x20%s\x20%s\x20%s\x20%sms\x20id=%s\x20name=%s\x20role=%s\x20device=%s';if(_0x18be72['body']&&_0x18be72[_0xf364('0x16')][_0xf364('0x17')]&&_0x18be72[_0xf364('0x16')][_0xf364('0x18')]){_0x1d4866=_0xf364('0x19');}return util['format'](_0x1d4866,_0x18be72[_0xf364('0xb')],_0x18be72['headers'][_0xf364('0xd')]?_0x18be72[_0xf364('0xc')][_0xf364('0xd')]:_0x18be72['connection'][_0xf364('0xf')]||_0x18be72['ip'],_0x18be72[_0xf364('0x10')],_0x54f84d[_0xf364('0x11')],_0x54f84d[_0xf364('0x12')],_0x18be72['user']?_0x18be72[_0xf364('0x13')]['id']:null,_0x18be72[_0xf364('0x13')]?_0x18be72[_0xf364('0x13')][_0xf364('0x1a')]:null,_0x18be72[_0xf364('0x13')]?_0x18be72[_0xf364('0x13')][_0xf364('0x14')]:null,_0x18be72[_0xf364('0x16')]&&_0x18be72[_0xf364('0x16')]['device']?_0x18be72[_0xf364('0x16')][_0xf364('0x17')]:'other',_0x18be72[_0xf364('0x16')]&&_0x18be72[_0xf364('0x16')][_0xf364('0x18')]?_0x18be72[_0xf364('0x16')]['agent_id']:'',_0x18be72[_0xf364('0x16')]&&_0x18be72['body']['agent_name']?_0x18be72[_0xf364('0x16')]['agent_name']:'');},'ignoreRoute':function(_0xab92aa){var _0x1dbd60=/\/api\/users\/[0-9]+\/(login|logout)/gi;return!_0x1dbd60[_0xf364('0x1b')](_0xab92aa['url']);}}));_0x46110c['use'](_0xf364('0x1c'),require('./api/user'));_0x46110c[_0xf364('0x15')](_0xf364('0x1d'),require(_0xf364('0x1e')));_0x46110c[_0xf364('0x15')](_0xf364('0x1f'),require(_0xf364('0x20')));_0x46110c['use'](_0xf364('0x21'),require('./api/voiceExtension'));_0x46110c['use'](_0xf364('0x22'),require(_0xf364('0x23')));_0x46110c[_0xf364('0x15')](_0xf364('0x24'),require(_0xf364('0x25')));_0x46110c[_0xf364('0x15')](_0xf364('0x26'),require(_0xf364('0x27')));_0x46110c[_0xf364('0x15')]('/api/screen/recordings',require(_0xf364('0x28')));_0x46110c[_0xf364('0x15')](_0xf364('0x29'),require(_0xf364('0x2a')));_0x46110c[_0xf364('0x15')](_0xf364('0x2b'),require(_0xf364('0x2c')));_0x46110c['use']('/api/voice/calls/reports',require(_0xf364('0x2d')));_0x46110c[_0xf364('0x15')](_0xf364('0x2e'),require('./api/voiceDialReport'));_0x46110c['use'](_0xf364('0x2f'),require(_0xf364('0x30')));_0x46110c[_0xf364('0x15')]('/api/voice/queues/reports',require('./api/voiceQueueReport'));_0x46110c[_0xf364('0x15')]('/api/members/reports',require('./api/memberReport'));_0x46110c['use'](_0xf364('0x31'),require(_0xf364('0x32')));_0x46110c[_0xf364('0x15')]('/api/voice/transfers/reports',require(_0xf364('0x33')));_0x46110c[_0xf364('0x15')](_0xf364('0x34'),require(_0xf364('0x35')));_0x46110c[_0xf364('0x15')](_0xf364('0x36'),require(_0xf364('0x37')));_0x46110c['use'](_0xf364('0x38'),require(_0xf364('0x39')));_0x46110c['use']('/api/mail/substatuses',require(_0xf364('0x3a')));_0x46110c[_0xf364('0x15')]('/api/mail/interactions',require(_0xf364('0x3b')));_0x46110c[_0xf364('0x15')](_0xf364('0x3c'),require(_0xf364('0x3d')));_0x46110c['use']('/api/mail/applications',require(_0xf364('0x3e')));_0x46110c[_0xf364('0x15')](_0xf364('0x3f'),require(_0xf364('0x40')));_0x46110c[_0xf364('0x15')](_0xf364('0x41'),require(_0xf364('0x42')));_0x46110c[_0xf364('0x15')](_0xf364('0x43'),require(_0xf364('0x44')));_0x46110c[_0xf364('0x15')](_0xf364('0x45'),require('./api/faxAccount'));_0x46110c[_0xf364('0x15')]('/api/fax/applications',require(_0xf364('0x46')));_0x46110c['use'](_0xf364('0x47'),require('./api/faxInteraction'));_0x46110c[_0xf364('0x15')](_0xf364('0x48'),require(_0xf364('0x49')));_0x46110c[_0xf364('0x15')]('/api/fax/queues',require(_0xf364('0x4a')));_0x46110c[_0xf364('0x15')]('/api/fax/reports/queue',require(_0xf364('0x4b')));_0x46110c['use']('/api/sms/accounts',require(_0xf364('0x4c')));_0x46110c[_0xf364('0x15')](_0xf364('0x4d'),require(_0xf364('0x4e')));_0x46110c['use']('/api/sms/interactions',require('./api/smsInteraction'));_0x46110c['use'](_0xf364('0x4f'),require(_0xf364('0x50')));_0x46110c['use']('/api/sms/queues',require(_0xf364('0x51')));_0x46110c[_0xf364('0x15')]('/api/openchannel/accounts',require(_0xf364('0x52')));_0x46110c['use'](_0xf364('0x53'),require(_0xf364('0x54')));_0x46110c['use'](_0xf364('0x55'),require('./api/openchannelInteraction'));_0x46110c[_0xf364('0x15')](_0xf364('0x56'),require(_0xf364('0x57')));_0x46110c[_0xf364('0x15')](_0xf364('0x58'),require(_0xf364('0x59')));_0x46110c['use'](_0xf364('0x5a'),require(_0xf364('0x5b')));_0x46110c[_0xf364('0x15')]('/api/openchannel/reports/queue',require(_0xf364('0x5c')));_0x46110c[_0xf364('0x15')](_0xf364('0x5d'),require(_0xf364('0x5e')));_0x46110c[_0xf364('0x15')]('/api/chat/interactions',require(_0xf364('0x5f')));_0x46110c['use'](_0xf364('0x60'),require(_0xf364('0x61')));_0x46110c['use'](_0xf364('0x62'),require(_0xf364('0x63')));_0x46110c[_0xf364('0x15')]('/api/chat/queues',require(_0xf364('0x64')));_0x46110c[_0xf364('0x15')](_0xf364('0x65'),require(_0xf364('0x66')));_0x46110c[_0xf364('0x15')](_0xf364('0x67'),require('./api/chatProactiveAction'));_0x46110c[_0xf364('0x15')](_0xf364('0x68'),require('./api/cmCompany'));_0x46110c[_0xf364('0x15')](_0xf364('0x69'),require('./api/cmContact'));_0x46110c[_0xf364('0x15')](_0xf364('0x6a'),require(_0xf364('0x6b')));_0x46110c[_0xf364('0x15')](_0xf364('0x6c'),require(_0xf364('0x6d')));_0x46110c[_0xf364('0x15')](_0xf364('0x6e'),require(_0xf364('0x6f')));_0x46110c[_0xf364('0x15')](_0xf364('0x70'),require('./api/cmHopperHistory'));_0x46110c['use'](_0xf364('0x71'),require('./api/cmCustomField'));_0x46110c[_0xf364('0x15')](_0xf364('0x72'),require(_0xf364('0x73')));_0x46110c['use']('/api/automations',require(_0xf364('0x74')));_0x46110c[_0xf364('0x15')](_0xf364('0x75'),require('./api/cannedAnswer'));_0x46110c[_0xf364('0x15')](_0xf364('0x76'),require(_0xf364('0x77')));_0x46110c[_0xf364('0x15')](_0xf364('0x78'),require(_0xf364('0x79')));_0x46110c['use'](_0xf364('0x7a'),require('./api/interval'));_0x46110c[_0xf364('0x15')](_0xf364('0x7b'),require(_0xf364('0x7c')));_0x46110c[_0xf364('0x15')]('/api/cdr',require(_0xf364('0x7d')));_0x46110c[_0xf364('0x15')](_0xf364('0x7e'),require(_0xf364('0x7f')));_0x46110c[_0xf364('0x15')]('/api/schedules',require(_0xf364('0x80')));_0x46110c['use']('/api/sounds',require('./api/sound'));_0x46110c['use'](_0xf364('0x81'),require('./api/tag'));_0x46110c[_0xf364('0x15')]('/api/templates',require(_0xf364('0x82')));_0x46110c['use'](_0xf364('0x83'),require(_0xf364('0x84')));_0x46110c[_0xf364('0x15')](_0xf364('0x85'),require(_0xf364('0x86')));_0x46110c[_0xf364('0x15')]('/api/integrations',require(_0xf364('0x87')));_0x46110c[_0xf364('0x15')](_0xf364('0x88'),require('./api/integrationReport'));_0x46110c[_0xf364('0x15')]('/api/analytics/custom_reports',require(_0xf364('0x89')));_0x46110c[_0xf364('0x15')](_0xf364('0x8a'),require(_0xf364('0x8b')));_0x46110c['use'](_0xf364('0x8c'),require(_0xf364('0x8d')));_0x46110c[_0xf364('0x15')](_0xf364('0x8e'),require(_0xf364('0x8f')));_0x46110c[_0xf364('0x15')](_0xf364('0x90'),require(_0xf364('0x91')));_0x46110c[_0xf364('0x15')]('/api/analytics/tree_reports',require('./api/analyticTreeReport'));_0x46110c[_0xf364('0x15')]('/api/integrations/salesforce/accounts',require(_0xf364('0x92')));_0x46110c[_0xf364('0x15')](_0xf364('0x93'),require(_0xf364('0x94')));_0x46110c['use']('/api/integrations/salesforce/fields',require('./api/intSalesforceField'));_0x46110c['use'](_0xf364('0x95'),require(_0xf364('0x96')));_0x46110c[_0xf364('0x15')](_0xf364('0x97'),require('./api/intSugarcrmConfiguration'));_0x46110c[_0xf364('0x15')](_0xf364('0x98'),require(_0xf364('0x99')));_0x46110c[_0xf364('0x15')](_0xf364('0x9a'),require(_0xf364('0x9b')));_0x46110c[_0xf364('0x15')](_0xf364('0x9c'),require(_0xf364('0x9d')));_0x46110c[_0xf364('0x15')](_0xf364('0x9e'),require(_0xf364('0x9f')));_0x46110c['use'](_0xf364('0xa0'),require('./api/intZohoAccount'));_0x46110c[_0xf364('0x15')](_0xf364('0xa1'),require(_0xf364('0xa2')));_0x46110c['use'](_0xf364('0xa3'),require('./api/intZohoField'));_0x46110c['use'](_0xf364('0xa4'),require(_0xf364('0xa5')));_0x46110c['use'](_0xf364('0xa6'),require('./api/intZendeskConfiguration'));_0x46110c[_0xf364('0x15')](_0xf364('0xa7'),require(_0xf364('0xa8')));_0x46110c[_0xf364('0x15')](_0xf364('0xa9'),require(_0xf364('0xaa')));_0x46110c[_0xf364('0x15')](_0xf364('0xab'),require(_0xf364('0xac')));_0x46110c[_0xf364('0x15')](_0xf364('0xad'),require(_0xf364('0xae')));_0x46110c['use'](_0xf364('0xaf'),require(_0xf364('0xb0')));_0x46110c['use'](_0xf364('0xb1'),require(_0xf364('0xb2')));_0x46110c['use'](_0xf364('0xb3'),require('./api/intVtigerField'));_0x46110c['use'](_0xf364('0xb4'),require(_0xf364('0xb5')));_0x46110c['use'](_0xf364('0xb6'),require(_0xf364('0xb7')));_0x46110c['use'](_0xf364('0xb8'),require('./api/intServicenowField'));_0x46110c[_0xf364('0x15')](_0xf364('0xb9'),require('./api/intDynamics365Account'));_0x46110c[_0xf364('0x15')]('/api/integrations/dynamics365/configurations',require(_0xf364('0xba')));_0x46110c[_0xf364('0x15')](_0xf364('0xbb'),require('./api/intDynamics365Field'));_0x46110c[_0xf364('0x15')]('/api/integrations/freshsales/accounts',require(_0xf364('0xbc')));_0x46110c['use'](_0xf364('0xbd'),require(_0xf364('0xbe')));_0x46110c[_0xf364('0x15')](_0xf364('0xbf'),require(_0xf364('0xc0')));_0x46110c['use'](_0xf364('0xc1'),require(_0xf364('0xc2')));_0x46110c[_0xf364('0x15')](_0xf364('0xc3'),require(_0xf364('0xc4')));_0x46110c[_0xf364('0x15')]('/api/chat/internal/messages',require(_0xf364('0xc5')));_0x46110c[_0xf364('0x15')](_0xf364('0xc6'),require(_0xf364('0xc7')));_0x46110c[_0xf364('0x15')]('/api/jscripty/questions/reports',require(_0xf364('0xc8')));_0x46110c[_0xf364('0x15')]('/api/jscripty/sessions/reports',require(_0xf364('0xc9')));_0x46110c['use'](_0xf364('0xca'),require(_0xf364('0xcb')));_0x46110c[_0xf364('0x15')](_0xf364('0xcc'),require(_0xf364('0xcd')));_0x46110c['use'](_0xf364('0xce'),require(_0xf364('0xcf')));_0x46110c['use'](_0xf364('0xd0'),require(_0xf364('0xd1')));_0x46110c[_0xf364('0x15')](_0xf364('0xd2'),require(_0xf364('0xd3')));_0x46110c[_0xf364('0x15')]('/api/square/odbc',require(_0xf364('0xd4')));_0x46110c[_0xf364('0x15')](_0xf364('0xd5'),require(_0xf364('0xd6')));_0x46110c[_0xf364('0x15')]('/api/square/recordings',require(_0xf364('0xd7')));_0x46110c['use']('/api/square/messages',require('./api/squareMessage'));_0x46110c[_0xf364('0x15')](_0xf364('0xd8'),require(_0xf364('0xd9')));_0x46110c[_0xf364('0x15')](_0xf364('0xda'),require('./api/license'));_0x46110c[_0xf364('0x15')](_0xf364('0xdb'),require(_0xf364('0xdc')));_0x46110c[_0xf364('0x15')](_0xf364('0xdd'),require('./api/migration'));_0x46110c['use'](_0xf364('0xde'),require('./api/attachment'));_0x46110c[_0xf364('0x15')](_0xf364('0xdf'),require(_0xf364('0xe0')));_0x46110c['use'](_0xf364('0xe1'),require(_0xf364('0xe2')));_0x46110c['use'](_0xf364('0xe3'),require(_0xf364('0xe4')));_0x46110c[_0xf364('0x15')]('/api/fax/reports/transfer',require('./api/faxTransferReport'));_0x46110c['use'](_0xf364('0xe5'),require(_0xf364('0xe6')));_0x46110c['use']('/api/sms/reports/transfer',require('./api/smsTransferReport'));_0x46110c[_0xf364('0x15')]('/api/cm/lists',require(_0xf364('0xe7')));_0x46110c[_0xf364('0x15')](_0xf364('0xe8'),require('./api/voicePrefix'));_0x46110c[_0xf364('0x15')](_0xf364('0xe9'),require(_0xf364('0xea')));_0x46110c[_0xf364('0x15')](_0xf364('0xeb'),require(_0xf364('0xec')));_0x46110c[_0xf364('0x15')](_0xf364('0xed'),require('./api/userProfileResource'));_0x46110c[_0xf364('0x15')](_0xf364('0xee'),require(_0xf364('0xef')));_0x46110c[_0xf364('0x15')](_0xf364('0xf0'),require(_0xf364('0xf1')));_0x46110c[_0xf364('0x15')](_0xf364('0xf2'),require(_0xf364('0xf3')));_0x46110c[_0xf364('0x15')](_0xf364('0xf4'),require(_0xf364('0xf5')));_0x46110c[_0xf364('0x15')](_0xf364('0xf6'),require('./api/version'));_0x46110c[_0xf364('0x15')](_0xf364('0xf7'),require('./api/system'));_0x46110c['use'](_0xf364('0xf8'),require('./api/pm2'));_0x46110c[_0xf364('0x15')](_0xf364('0xf9'),express[_0xf364('0xfa')](path[_0xf364('0xfb')](config[_0xf364('0xfc')],_0xf364('0xf9'))));_0x46110c[_0xf364('0x15')](_0xf364('0xfd'),express[_0xf364('0xfa')](path[_0xf364('0xfb')](config['root'],_0xf364('0xfd'))));_0x46110c[_0xf364('0x15')]('/demo',express[_0xf364('0xfa')](path[_0xf364('0xfb')](config['root'],_0xf364('0xfe'))));_0x46110c['use'](_0xf364('0xff'),express['static'](path['join'](config[_0xf364('0xfc')],'snippet','1.0.16')));_0x46110c[_0xf364('0x15')](_0xf364('0x100'),express[_0xf364('0xfa')](path[_0xf364('0xfb')](config[_0xf364('0xfc')],_0xf364('0x101'))));_0x46110c['route'](_0xf364('0x102'))[_0xf364('0x103')](errors[0x194]);_0x46110c['route']('/*')[_0xf364('0x103')](function(_0x1b97af,_0x1008c4){_0x1008c4[_0xf364('0x104')](path[_0xf364('0x105')](_0x46110c['get'](_0xf364('0x106'))+_0xf364('0x107')));});};
\ No newline at end of file
+var _0xb3da=['./api/openchannelApplication','/api/openchannel/interactions','./api/openchannelQueue','./api/openchannelQueueReport','/api/chat/applications','/api/chat/interactions','./api/chatInteraction','/api/chat/messages','./api/chatMessage','/api/chat/offline_messages','./api/chatOfflineMessage','./api/chatQueue','/api/chat/groups','/api/cm/companies','./api/cmCompany','/api/cm/contacts','/api/cm/hopper','./api/cmHopper','/api/cm/hopper_black','./api/cmHopperBlack','./api/cmHopperFinal','./api/cmHopperHistory','/api/cm/custom_fields','./api/cmCustomField','./api/action','/api/automations','/api/canned_answers','./api/cannedAnswer','/api/dispositions','./api/disposition','/api/conditions','./api/condition','./api/interval','/api/pauses','./api/pause','/api/cdr','./api/cdr','./api/voiceQueuesLog','/api/schedules','./api/schedule','/api/sounds','./api/sound','./api/tag','/api/templates','./api/template','/api/triggers','./api/trigger','/api/variables','./api/variable','/api/integrations','./api/integration','/api/integrations/reports','./api/integrationReport','/api/analytics/custom_reports','./api/analyticCustomReport','./api/analyticDefaultReport','/api/analytics/extracted_reports','./api/analyticMetric','/api/analytics/field_reports','./api/analyticFieldReport','/api/analytics/tree_reports','./api/analyticTreeReport','/api/integrations/salesforce/accounts','./api/intSalesforceAccount','/api/integrations/salesforce/configurations','./api/intSalesforceField','/api/integrations/sugarcrm/accounts','./api/intSugarcrmAccount','/api/integrations/sugarcrm/configurations','./api/intSugarcrmConfiguration','/api/integrations/sugarcrm/fields','./api/intSugarcrmField','./api/intDeskAccount','/api/integrations/desk/configurations','./api/intDeskField','/api/integrations/zoho/accounts','./api/intZohoAccount','./api/intZohoConfiguration','/api/integrations/zoho/fields','/api/integrations/zendesk/accounts','./api/intZendeskAccount','./api/intZendeskConfiguration','/api/integrations/freshdesk/configurations','./api/intFreshdeskConfiguration','/api/integrations/freshdesk/fields','./api/intFreshdeskField','./api/intVtigerAccount','./api/intVtigerConfiguration','/api/integrations/vtiger/fields','./api/intVtigerField','/api/integrations/servicenow/accounts','./api/intServicenowAccount','/api/integrations/servicenow/configurations','./api/intServicenowConfiguration','/api/integrations/servicenow/fields','./api/intDynamics365Account','./api/intDynamics365Configuration','./api/intDynamics365Field','/api/integrations/freshsales/accounts','/api/integrations/freshsales/configurations','/api/integrations/freshsales/fields','./api/intFreshsalesField','/api/networks','./api/network','./api/chatQueueReport','/api/chat/internal/messages','./api/chatInternalMessage','/api/jscripty/answers/reports','/api/jscripty/questions/reports','./api/jscriptyQuestionReport','./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/square/odbc','./api/squareOdbc','/api/square/recordings','/api/square/messages','./api/team','/api/license','./api/license','/api/campaigns','./api/campaign','./api/migration','/api/plugins','./api/plugin','/api/mail/reports/transfer','/api/chat/reports/transfer','./api/chatTransferReport','/api/fax/reports/transfer','./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/userProfiles','./api/userProfile','/api/userProfile/sections','./api/userProfileSection','/api/userProfile/resources','./api/userProfileResource','/api/auth/local','./api/authLocal','/api/auth/google','./api/authGoogle','/api/jira','./api/jira','./api/rpc','/api/version','./api/system','/api/pm2','./api/pm2','join','root','/apidoc','static','/www','/demo','snippet','1.0.16','/plugins','/server/files/plugins','/:url(api|auth|components|app|bower_components|assets)/*','get','route','sendFile','resolve','appPath','/index.html','path','express-winston','./errors','./config/logger','api','auth','logger','format','%s\x20%s\x20%s\x20%s\x20%sms\x20id=%s\x20name=%s\x20role=%s','method','headers','x-forwarded-for','connection','remoteAddress','responseTime','user','role','%s\x20%s\x20%s\x20%s\x20%sms\x20id=%s\x20name=%s\x20role=%s\x20device=%s','body','device','agent_id','url','statusCode','name','other','agent_name','test','use','./api/user','/api/voice/chanspy','./api/voiceChanSpy','/api/voice/contexts','./api/voiceExtension','/api/voice/mohs','./api/voiceMusicOnHold','/api/voice/queues','/api/screen/recordings','./api/screenRecording','/api/voice/mails','./api/voiceMail','./api/voiceMailMessage','/api/voice/calls/reports','/api/voice/dials/reports','./api/voiceDialReport','/api/voice/agents/reports','./api/voiceAgentReport','/api/voice/queues/reports','./api/voiceQueueReport','./api/memberReport','/api/trunks','/api/voice/transfers/reports','/api/mail/out_servers','./api/mailServerOut','./api/mailAccount','./api/mailQueue','./api/mailSubstatus','/api/mail/interactions','/api/mail/messages','/api/mail/applications','./api/mailApplication','/api/mail/reports/queue','./api/mailQueueReport','/api/dashboards','./api/dashboardItem','./api/faxAccount','/api/fax/applications','./api/faxApplication','/api/fax/interactions','./api/faxInteraction','/api/fax/messages','./api/faxMessage','/api/fax/queues','./api/faxQueue','/api/fax/reports/queue','./api/faxQueueReport','/api/sms/accounts','/api/sms/applications','./api/smsApplication','/api/sms/interactions','./api/smsInteraction','/api/sms/queues','/api/openchannel/accounts','./api/openchannelAccount','/api/openchannel/applications'];(function(_0x178e48,_0x3c9509){var _0x440d7e=function(_0xc2f8a0){while(--_0xc2f8a0){_0x178e48['push'](_0x178e48['shift']());}};_0x440d7e(++_0x3c9509);}(_0xb3da,0xb3));var _0xab3d=function(_0x13fee9,_0x53a287){_0x13fee9=_0x13fee9-0x0;var _0x423626=_0xb3da[_0x13fee9];return _0x423626;};'use strict';var path=require(_0xab3d('0x0'));var express=require('express');var ewinston=require(_0xab3d('0x1'));var util=require('util');var errors=require(_0xab3d('0x2'));var config=require('./config/environment');var logger=require(_0xab3d('0x3'))(_0xab3d('0x4'));var authLogger=require(_0xab3d('0x3'))(_0xab3d('0x5'));exports['default']=function(_0x529bb4){_0x529bb4['use'](ewinston[_0xab3d('0x6')]({'winstonInstance':logger,'meta':![],'statusLevels':!![],'msg':function(_0x357530,_0x2c656f){return util[_0xab3d('0x7')](_0xab3d('0x8'),_0x357530[_0xab3d('0x9')],_0x357530[_0xab3d('0xa')]['x-forwarded-for']?_0x357530[_0xab3d('0xa')][_0xab3d('0xb')]:_0x357530[_0xab3d('0xc')][_0xab3d('0xd')]||_0x357530['ip'],_0x357530['url'],_0x2c656f['statusCode'],_0x2c656f[_0xab3d('0xe')],_0x357530[_0xab3d('0xf')]?_0x357530[_0xab3d('0xf')]['id']:null,_0x357530[_0xab3d('0xf')]?_0x357530[_0xab3d('0xf')]['name']:null,_0x357530[_0xab3d('0xf')]?_0x357530['user'][_0xab3d('0x10')]:null);}}));_0x529bb4['use'](ewinston[_0xab3d('0x6')]({'winstonInstance':authLogger,'meta':![],'statusLevels':!![],'msg':function(_0x5bddac,_0x1b067b){var _0x285759=_0xab3d('0x11');if(_0x5bddac['body']&&_0x5bddac[_0xab3d('0x12')][_0xab3d('0x13')]&&_0x5bddac[_0xab3d('0x12')][_0xab3d('0x14')]){_0x285759='%s\x20%s\x20%s\x20%s\x20%sms\x20id=%s\x20name=%s\x20role=%s\x20device=%s\x20(id=%s\x20name=%s)';}return util[_0xab3d('0x7')](_0x285759,_0x5bddac[_0xab3d('0x9')],_0x5bddac['headers'][_0xab3d('0xb')]?_0x5bddac['headers'][_0xab3d('0xb')]:_0x5bddac[_0xab3d('0xc')][_0xab3d('0xd')]||_0x5bddac['ip'],_0x5bddac[_0xab3d('0x15')],_0x1b067b[_0xab3d('0x16')],_0x1b067b[_0xab3d('0xe')],_0x5bddac[_0xab3d('0xf')]?_0x5bddac[_0xab3d('0xf')]['id']:null,_0x5bddac[_0xab3d('0xf')]?_0x5bddac['user'][_0xab3d('0x17')]:null,_0x5bddac['user']?_0x5bddac[_0xab3d('0xf')]['role']:null,_0x5bddac[_0xab3d('0x12')]&&_0x5bddac[_0xab3d('0x12')][_0xab3d('0x13')]?_0x5bddac[_0xab3d('0x12')][_0xab3d('0x13')]:_0xab3d('0x18'),_0x5bddac[_0xab3d('0x12')]&&_0x5bddac[_0xab3d('0x12')][_0xab3d('0x14')]?_0x5bddac[_0xab3d('0x12')][_0xab3d('0x14')]:'',_0x5bddac['body']&&_0x5bddac[_0xab3d('0x12')][_0xab3d('0x19')]?_0x5bddac[_0xab3d('0x12')][_0xab3d('0x19')]:'');},'ignoreRoute':function(_0x3e5111){var _0x11c8b0=/\/api\/users\/[0-9]+\/(login|logout)/gi;return!_0x11c8b0[_0xab3d('0x1a')](_0x3e5111[_0xab3d('0x15')]);}}));_0x529bb4[_0xab3d('0x1b')]('/api/users',require(_0xab3d('0x1c')));_0x529bb4[_0xab3d('0x1b')](_0xab3d('0x1d'),require(_0xab3d('0x1e')));_0x529bb4[_0xab3d('0x1b')](_0xab3d('0x1f'),require('./api/voiceContext'));_0x529bb4[_0xab3d('0x1b')]('/api/voice/extensions',require(_0xab3d('0x20')));_0x529bb4['use'](_0xab3d('0x21'),require(_0xab3d('0x22')));_0x529bb4[_0xab3d('0x1b')](_0xab3d('0x23'),require('./api/voiceQueue'));_0x529bb4['use']('/api/voice/recordings',require('./api/voiceRecording'));_0x529bb4[_0xab3d('0x1b')](_0xab3d('0x24'),require(_0xab3d('0x25')));_0x529bb4[_0xab3d('0x1b')](_0xab3d('0x26'),require(_0xab3d('0x27')));_0x529bb4[_0xab3d('0x1b')]('/api/voice/mails/messages',require(_0xab3d('0x28')));_0x529bb4[_0xab3d('0x1b')](_0xab3d('0x29'),require('./api/voiceCallReport'));_0x529bb4[_0xab3d('0x1b')](_0xab3d('0x2a'),require(_0xab3d('0x2b')));_0x529bb4[_0xab3d('0x1b')](_0xab3d('0x2c'),require(_0xab3d('0x2d')));_0x529bb4[_0xab3d('0x1b')](_0xab3d('0x2e'),require(_0xab3d('0x2f')));_0x529bb4[_0xab3d('0x1b')]('/api/members/reports',require(_0xab3d('0x30')));_0x529bb4['use'](_0xab3d('0x31'),require('./api/trunk'));_0x529bb4['use'](_0xab3d('0x32'),require('./api/voiceTransferReport'));_0x529bb4[_0xab3d('0x1b')](_0xab3d('0x33'),require(_0xab3d('0x34')));_0x529bb4['use']('/api/mail/accounts',require(_0xab3d('0x35')));_0x529bb4[_0xab3d('0x1b')]('/api/mail/queues',require(_0xab3d('0x36')));_0x529bb4[_0xab3d('0x1b')]('/api/mail/substatuses',require(_0xab3d('0x37')));_0x529bb4[_0xab3d('0x1b')](_0xab3d('0x38'),require('./api/mailInteraction'));_0x529bb4[_0xab3d('0x1b')](_0xab3d('0x39'),require('./api/mailMessage'));_0x529bb4['use'](_0xab3d('0x3a'),require(_0xab3d('0x3b')));_0x529bb4[_0xab3d('0x1b')](_0xab3d('0x3c'),require(_0xab3d('0x3d')));_0x529bb4[_0xab3d('0x1b')](_0xab3d('0x3e'),require('./api/dashboard'));_0x529bb4[_0xab3d('0x1b')]('/api/dashboards/items',require(_0xab3d('0x3f')));_0x529bb4[_0xab3d('0x1b')]('/api/fax/accounts',require(_0xab3d('0x40')));_0x529bb4[_0xab3d('0x1b')](_0xab3d('0x41'),require(_0xab3d('0x42')));_0x529bb4[_0xab3d('0x1b')](_0xab3d('0x43'),require(_0xab3d('0x44')));_0x529bb4['use'](_0xab3d('0x45'),require(_0xab3d('0x46')));_0x529bb4['use'](_0xab3d('0x47'),require(_0xab3d('0x48')));_0x529bb4[_0xab3d('0x1b')](_0xab3d('0x49'),require(_0xab3d('0x4a')));_0x529bb4[_0xab3d('0x1b')](_0xab3d('0x4b'),require('./api/smsAccount'));_0x529bb4['use'](_0xab3d('0x4c'),require(_0xab3d('0x4d')));_0x529bb4[_0xab3d('0x1b')](_0xab3d('0x4e'),require(_0xab3d('0x4f')));_0x529bb4[_0xab3d('0x1b')]('/api/sms/messages',require('./api/smsMessage'));_0x529bb4[_0xab3d('0x1b')](_0xab3d('0x50'),require('./api/smsQueue'));_0x529bb4[_0xab3d('0x1b')](_0xab3d('0x51'),require(_0xab3d('0x52')));_0x529bb4[_0xab3d('0x1b')](_0xab3d('0x53'),require(_0xab3d('0x54')));_0x529bb4['use'](_0xab3d('0x55'),require('./api/openchannelInteraction'));_0x529bb4[_0xab3d('0x1b')]('/api/openchannel/messages',require('./api/openchannelMessage'));_0x529bb4[_0xab3d('0x1b')]('/api/openchannel/queues',require(_0xab3d('0x56')));_0x529bb4[_0xab3d('0x1b')]('/api/chat/websites',require('./api/chatWebsite'));_0x529bb4[_0xab3d('0x1b')]('/api/openchannel/reports/queue',require(_0xab3d('0x57')));_0x529bb4[_0xab3d('0x1b')](_0xab3d('0x58'),require('./api/chatApplication'));_0x529bb4['use'](_0xab3d('0x59'),require(_0xab3d('0x5a')));_0x529bb4[_0xab3d('0x1b')](_0xab3d('0x5b'),require(_0xab3d('0x5c')));_0x529bb4[_0xab3d('0x1b')](_0xab3d('0x5d'),require(_0xab3d('0x5e')));_0x529bb4[_0xab3d('0x1b')]('/api/chat/queues',require(_0xab3d('0x5f')));_0x529bb4[_0xab3d('0x1b')](_0xab3d('0x60'),require('./api/chatGroup'));_0x529bb4[_0xab3d('0x1b')]('/api/chat/proactive_actions',require('./api/chatProactiveAction'));_0x529bb4[_0xab3d('0x1b')](_0xab3d('0x61'),require(_0xab3d('0x62')));_0x529bb4[_0xab3d('0x1b')](_0xab3d('0x63'),require('./api/cmContact'));_0x529bb4[_0xab3d('0x1b')](_0xab3d('0x64'),require(_0xab3d('0x65')));_0x529bb4[_0xab3d('0x1b')](_0xab3d('0x66'),require(_0xab3d('0x67')));_0x529bb4['use']('/api/cm/hopper_final',require(_0xab3d('0x68')));_0x529bb4[_0xab3d('0x1b')]('/api/cm/hopper_history',require(_0xab3d('0x69')));_0x529bb4[_0xab3d('0x1b')](_0xab3d('0x6a'),require(_0xab3d('0x6b')));_0x529bb4[_0xab3d('0x1b')]('/api/actions',require(_0xab3d('0x6c')));_0x529bb4[_0xab3d('0x1b')](_0xab3d('0x6d'),require('./api/automation'));_0x529bb4['use'](_0xab3d('0x6e'),require(_0xab3d('0x6f')));_0x529bb4[_0xab3d('0x1b')](_0xab3d('0x70'),require(_0xab3d('0x71')));_0x529bb4['use'](_0xab3d('0x72'),require(_0xab3d('0x73')));_0x529bb4['use']('/api/intervals',require(_0xab3d('0x74')));_0x529bb4[_0xab3d('0x1b')](_0xab3d('0x75'),require(_0xab3d('0x76')));_0x529bb4[_0xab3d('0x1b')](_0xab3d('0x77'),require(_0xab3d('0x78')));_0x529bb4[_0xab3d('0x1b')]('/api/voiceQueuesLog',require(_0xab3d('0x79')));_0x529bb4[_0xab3d('0x1b')](_0xab3d('0x7a'),require(_0xab3d('0x7b')));_0x529bb4[_0xab3d('0x1b')](_0xab3d('0x7c'),require(_0xab3d('0x7d')));_0x529bb4[_0xab3d('0x1b')]('/api/tags',require(_0xab3d('0x7e')));_0x529bb4[_0xab3d('0x1b')](_0xab3d('0x7f'),require(_0xab3d('0x80')));_0x529bb4[_0xab3d('0x1b')](_0xab3d('0x81'),require(_0xab3d('0x82')));_0x529bb4[_0xab3d('0x1b')](_0xab3d('0x83'),require(_0xab3d('0x84')));_0x529bb4[_0xab3d('0x1b')](_0xab3d('0x85'),require(_0xab3d('0x86')));_0x529bb4[_0xab3d('0x1b')](_0xab3d('0x87'),require(_0xab3d('0x88')));_0x529bb4[_0xab3d('0x1b')](_0xab3d('0x89'),require(_0xab3d('0x8a')));_0x529bb4['use']('/api/analytics/default_reports',require(_0xab3d('0x8b')));_0x529bb4[_0xab3d('0x1b')](_0xab3d('0x8c'),require('./api/analyticExtractedReport'));_0x529bb4['use']('/api/analytics/metrics',require(_0xab3d('0x8d')));_0x529bb4['use'](_0xab3d('0x8e'),require(_0xab3d('0x8f')));_0x529bb4['use'](_0xab3d('0x90'),require(_0xab3d('0x91')));_0x529bb4[_0xab3d('0x1b')](_0xab3d('0x92'),require(_0xab3d('0x93')));_0x529bb4['use'](_0xab3d('0x94'),require('./api/intSalesforceConfiguration'));_0x529bb4[_0xab3d('0x1b')]('/api/integrations/salesforce/fields',require(_0xab3d('0x95')));_0x529bb4[_0xab3d('0x1b')](_0xab3d('0x96'),require(_0xab3d('0x97')));_0x529bb4[_0xab3d('0x1b')](_0xab3d('0x98'),require(_0xab3d('0x99')));_0x529bb4[_0xab3d('0x1b')](_0xab3d('0x9a'),require(_0xab3d('0x9b')));_0x529bb4['use']('/api/integrations/desk/accounts',require(_0xab3d('0x9c')));_0x529bb4['use'](_0xab3d('0x9d'),require('./api/intDeskConfiguration'));_0x529bb4[_0xab3d('0x1b')]('/api/integrations/desk/fields',require(_0xab3d('0x9e')));_0x529bb4[_0xab3d('0x1b')](_0xab3d('0x9f'),require(_0xab3d('0xa0')));_0x529bb4[_0xab3d('0x1b')]('/api/integrations/zoho/configurations',require(_0xab3d('0xa1')));_0x529bb4[_0xab3d('0x1b')](_0xab3d('0xa2'),require('./api/intZohoField'));_0x529bb4[_0xab3d('0x1b')](_0xab3d('0xa3'),require(_0xab3d('0xa4')));_0x529bb4[_0xab3d('0x1b')]('/api/integrations/zendesk/configurations',require(_0xab3d('0xa5')));_0x529bb4['use']('/api/integrations/zendesk/fields',require('./api/intZendeskField'));_0x529bb4[_0xab3d('0x1b')]('/api/integrations/freshdesk/accounts',require('./api/intFreshdeskAccount'));_0x529bb4['use'](_0xab3d('0xa6'),require(_0xab3d('0xa7')));_0x529bb4[_0xab3d('0x1b')](_0xab3d('0xa8'),require(_0xab3d('0xa9')));_0x529bb4[_0xab3d('0x1b')]('/api/integrations/vtiger/accounts',require(_0xab3d('0xaa')));_0x529bb4['use']('/api/integrations/vtiger/configurations',require(_0xab3d('0xab')));_0x529bb4[_0xab3d('0x1b')](_0xab3d('0xac'),require(_0xab3d('0xad')));_0x529bb4[_0xab3d('0x1b')](_0xab3d('0xae'),require(_0xab3d('0xaf')));_0x529bb4[_0xab3d('0x1b')](_0xab3d('0xb0'),require(_0xab3d('0xb1')));_0x529bb4[_0xab3d('0x1b')](_0xab3d('0xb2'),require('./api/intServicenowField'));_0x529bb4[_0xab3d('0x1b')]('/api/integrations/dynamics365/accounts',require(_0xab3d('0xb3')));_0x529bb4[_0xab3d('0x1b')]('/api/integrations/dynamics365/configurations',require(_0xab3d('0xb4')));_0x529bb4[_0xab3d('0x1b')]('/api/integrations/dynamics365/fields',require(_0xab3d('0xb5')));_0x529bb4['use'](_0xab3d('0xb6'),require('./api/intFreshsalesAccount'));_0x529bb4[_0xab3d('0x1b')](_0xab3d('0xb7'),require('./api/intFreshsalesConfiguration'));_0x529bb4[_0xab3d('0x1b')](_0xab3d('0xb8'),require(_0xab3d('0xb9')));_0x529bb4['use'](_0xab3d('0xba'),require(_0xab3d('0xbb')));_0x529bb4[_0xab3d('0x1b')]('/api/chat/reports/queue',require(_0xab3d('0xbc')));_0x529bb4[_0xab3d('0x1b')](_0xab3d('0xbd'),require(_0xab3d('0xbe')));_0x529bb4[_0xab3d('0x1b')](_0xab3d('0xbf'),require('./api/jscriptyAnswerReport'));_0x529bb4['use'](_0xab3d('0xc0'),require(_0xab3d('0xc1')));_0x529bb4[_0xab3d('0x1b')]('/api/jscripty/sessions/reports',require(_0xab3d('0xc2')));_0x529bb4[_0xab3d('0x1b')](_0xab3d('0xc3'),require(_0xab3d('0xc4')));_0x529bb4[_0xab3d('0x1b')](_0xab3d('0xc5'),require(_0xab3d('0xc6')));_0x529bb4[_0xab3d('0x1b')](_0xab3d('0xc7'),require(_0xab3d('0xc8')));_0x529bb4[_0xab3d('0x1b')](_0xab3d('0xc9'),require(_0xab3d('0xca')));_0x529bb4[_0xab3d('0x1b')](_0xab3d('0xcb'),require('./api/setting'));_0x529bb4[_0xab3d('0x1b')](_0xab3d('0xcc'),require(_0xab3d('0xcd')));_0x529bb4[_0xab3d('0x1b')]('/api/square/projects',require('./api/squareProject'));_0x529bb4[_0xab3d('0x1b')](_0xab3d('0xce'),require('./api/squareRecording'));_0x529bb4[_0xab3d('0x1b')](_0xab3d('0xcf'),require('./api/squareMessage'));_0x529bb4[_0xab3d('0x1b')]('/api/teams',require(_0xab3d('0xd0')));_0x529bb4[_0xab3d('0x1b')](_0xab3d('0xd1'),require(_0xab3d('0xd2')));_0x529bb4[_0xab3d('0x1b')](_0xab3d('0xd3'),require(_0xab3d('0xd4')));_0x529bb4[_0xab3d('0x1b')]('/api/migrations',require(_0xab3d('0xd5')));_0x529bb4['use']('/api/attachments',require('./api/attachment'));_0x529bb4[_0xab3d('0x1b')](_0xab3d('0xd6'),require(_0xab3d('0xd7')));_0x529bb4[_0xab3d('0x1b')](_0xab3d('0xd8'),require('./api/mailTransferReport'));_0x529bb4[_0xab3d('0x1b')](_0xab3d('0xd9'),require(_0xab3d('0xda')));_0x529bb4[_0xab3d('0x1b')](_0xab3d('0xdb'),require(_0xab3d('0xdc')));_0x529bb4['use'](_0xab3d('0xdd'),require(_0xab3d('0xde')));_0x529bb4['use'](_0xab3d('0xdf'),require(_0xab3d('0xe0')));_0x529bb4[_0xab3d('0x1b')](_0xab3d('0xe1'),require(_0xab3d('0xe2')));_0x529bb4[_0xab3d('0x1b')](_0xab3d('0xe3'),require(_0xab3d('0xe4')));_0x529bb4[_0xab3d('0x1b')](_0xab3d('0xe5'),require(_0xab3d('0xe6')));_0x529bb4['use'](_0xab3d('0xe7'),require(_0xab3d('0xe8')));_0x529bb4[_0xab3d('0x1b')](_0xab3d('0xe9'),require(_0xab3d('0xea')));_0x529bb4[_0xab3d('0x1b')](_0xab3d('0xeb'),require(_0xab3d('0xec')));_0x529bb4[_0xab3d('0x1b')](_0xab3d('0xed'),require(_0xab3d('0xee')));_0x529bb4['use'](_0xab3d('0xef'),require(_0xab3d('0xf0')));_0x529bb4['use']('/api/rpc',require(_0xab3d('0xf1')));_0x529bb4[_0xab3d('0x1b')](_0xab3d('0xf2'),require('./api/version'));_0x529bb4[_0xab3d('0x1b')]('/api/system',require(_0xab3d('0xf3')));_0x529bb4['use'](_0xab3d('0xf4'),require(_0xab3d('0xf5')));_0x529bb4[_0xab3d('0x1b')]('/apidoc',express['static'](path[_0xab3d('0xf6')](config[_0xab3d('0xf7')],_0xab3d('0xf8'))));_0x529bb4[_0xab3d('0x1b')]('/www',express[_0xab3d('0xf9')](path[_0xab3d('0xf6')](config[_0xab3d('0xf7')],_0xab3d('0xfa'))));_0x529bb4['use']('/demo',express[_0xab3d('0xf9')](path['join'](config[_0xab3d('0xf7')],_0xab3d('0xfb'))));_0x529bb4[_0xab3d('0x1b')]('/snippet',express[_0xab3d('0xf9')](path[_0xab3d('0xf6')](config['root'],_0xab3d('0xfc'),_0xab3d('0xfd'))));_0x529bb4[_0xab3d('0x1b')](_0xab3d('0xfe'),express[_0xab3d('0xf9')](path[_0xab3d('0xf6')](config[_0xab3d('0xf7')],_0xab3d('0xff'))));_0x529bb4['route'](_0xab3d('0x100'))[_0xab3d('0x101')](errors[0x194]);_0x529bb4[_0xab3d('0x102')]('/*')[_0xab3d('0x101')](function(_0x472c22,_0x5ada4a){_0x5ada4a[_0xab3d('0x103')](path[_0xab3d('0x104')](_0x529bb4[_0xab3d('0x101')](_0xab3d('0x105'))+_0xab3d('0x106')));});};
\ No newline at end of file
diff --git a/server/rpc/index.js b/server/rpc/index.js
index 43e5de3..4bf31be 100644
--- a/server/rpc/index.js
+++ b/server/rpc/index.js
@@ -15,4 +15,4 @@
// * treaties. The SOFTWARE PRODUCT is licensed, not sold. *
// * *
// *************************************************************************
-var _0x08e7=['../api/plugin/plugin.rpc','rpc','localhost','log','Express\x20RPC\x20server\x20listening\x20on\x20%s:%d!','default','RPC\x20listening\x20on\x20','bluebird','lodash','../config/environment','listen','merge','../api/user/user.rpc','../api/voiceExtension/voiceExtension.rpc','../api/voiceRecording/voiceRecording.rpc','../api/voiceCallReport/voiceCallReport.rpc','../api/voiceDialReport/voiceDialReport.rpc','../api/voiceAgentReport/voiceAgentReport.rpc','../api/voiceQueueReport/voiceQueueReport.rpc','../api/voiceTransferReport/voiceTransferReport.rpc','../api/userVoiceQueueRt/userVoiceQueueRt.rpc','../api/mailServerIn/mailServerIn.rpc','../api/mailAccount/mailAccount.rpc','../api/mailQueue/mailQueue.rpc','../api/mailMessage/mailMessage.rpc','../api/mailApplication/mailApplication.rpc','../api/mailQueueReport/mailQueueReport.rpc','../api/faxAccount/faxAccount.rpc','../api/faxInteraction/faxInteraction.rpc','../api/faxMessage/faxMessage.rpc','../api/faxQueue/faxQueue.rpc','../api/faxQueueReport/faxQueueReport.rpc','../api/smsAccount/smsAccount.rpc','../api/smsInteraction/smsInteraction.rpc','../api/smsMessage/smsMessage.rpc','../api/smsQueue/smsQueue.rpc','../api/openchannelApplication/openchannelApplication.rpc','../api/openchannelInteraction/openchannelInteraction.rpc','../api/openchannelMessage/openchannelMessage.rpc','../api/openchannelQueue/openchannelQueue.rpc','../api/openchannelQueueReport/openchannelQueueReport.rpc','../api/chatInteraction/chatInteraction.rpc','../api/chatMessage/chatMessage.rpc','../api/chatQueue/chatQueue.rpc','../api/cmHopper/cmHopper.rpc','../api/cmHopperBlack/cmHopperBlack.rpc','../api/cmHopperHistory/cmHopperHistory.rpc','../api/reportAgentPreview/reportAgentPreview.rpc','../api/interval/interval.rpc','../api/sound/sound.rpc','../api/template/template.rpc','../api/intSugarcrmAccount/intSugarcrmAccount.rpc','../api/intZohoAccount/intZohoAccount.rpc','../api/intZendeskAccount/intZendeskAccount.rpc','../api/intFreshdeskAccount/intFreshdeskAccount.rpc','../api/intVtigerAccount/intVtigerAccount.rpc','../api/intServicenowAccount/intServicenowAccount.rpc','../api/chatQueueReport/chatQueueReport.rpc','../api/smsQueueReport/smsQueueReport.rpc','../api/squareReport/squareReport.rpc','../api/squareProject/squareProject.rpc','../api/attachment/attachment.rpc'];(function(_0x5ef35e,_0x329db7){var _0x4cdc0c=function(_0x20bda0){while(--_0x20bda0){_0x5ef35e['push'](_0x5ef35e['shift']());}};_0x4cdc0c(++_0x329db7);}(_0x08e7,0x17b));var _0x708e=function(_0x512aa3,_0x49e141){_0x512aa3=_0x512aa3-0x0;var _0x3693bd=_0x08e7[_0x512aa3];return _0x3693bd;};'use strict';var jayson=require('jayson/promise');var BPromise=require(_0x708e('0x0'));var _=require(_0x708e('0x1'));var config=require(_0x708e('0x2'));exports[_0x708e('0x3')]=function(){return new BPromise(function(_0x3e070c,_0x47f4dc){var _0xed5ca3={};_0xed5ca3=_[_0x708e('0x4')](_0xed5ca3,require(_0x708e('0x5')));_0xed5ca3=_[_0x708e('0x4')](_0xed5ca3,require(_0x708e('0x6')));_0xed5ca3=_['merge'](_0xed5ca3,require('../api/voiceQueue/voiceQueue.rpc'));_0xed5ca3=_[_0x708e('0x4')](_0xed5ca3,require(_0x708e('0x7')));_0xed5ca3=_[_0x708e('0x4')](_0xed5ca3,require(_0x708e('0x8')));_0xed5ca3=_['merge'](_0xed5ca3,require(_0x708e('0x9')));_0xed5ca3=_['merge'](_0xed5ca3,require(_0x708e('0xa')));_0xed5ca3=_['merge'](_0xed5ca3,require(_0x708e('0xb')));_0xed5ca3=_[_0x708e('0x4')](_0xed5ca3,require('../api/memberReport/memberReport.rpc'));_0xed5ca3=_['merge'](_0xed5ca3,require('../api/trunk/trunk.rpc'));_0xed5ca3=_[_0x708e('0x4')](_0xed5ca3,require(_0x708e('0xc')));_0xed5ca3=_[_0x708e('0x4')](_0xed5ca3,require(_0x708e('0xd')));_0xed5ca3=_[_0x708e('0x4')](_0xed5ca3,require(_0x708e('0xe')));_0xed5ca3=_['merge'](_0xed5ca3,require(_0x708e('0xf')));_0xed5ca3=_[_0x708e('0x4')](_0xed5ca3,require(_0x708e('0x10')));_0xed5ca3=_[_0x708e('0x4')](_0xed5ca3,require('../api/mailInteraction/mailInteraction.rpc'));_0xed5ca3=_['merge'](_0xed5ca3,require(_0x708e('0x11')));_0xed5ca3=_['merge'](_0xed5ca3,require(_0x708e('0x12')));_0xed5ca3=_[_0x708e('0x4')](_0xed5ca3,require(_0x708e('0x13')));_0xed5ca3=_[_0x708e('0x4')](_0xed5ca3,require(_0x708e('0x14')));_0xed5ca3=_['merge'](_0xed5ca3,require('../api/faxApplication/faxApplication.rpc'));_0xed5ca3=_[_0x708e('0x4')](_0xed5ca3,require(_0x708e('0x15')));_0xed5ca3=_[_0x708e('0x4')](_0xed5ca3,require(_0x708e('0x16')));_0xed5ca3=_[_0x708e('0x4')](_0xed5ca3,require(_0x708e('0x17')));_0xed5ca3=_[_0x708e('0x4')](_0xed5ca3,require(_0x708e('0x18')));_0xed5ca3=_[_0x708e('0x4')](_0xed5ca3,require(_0x708e('0x19')));_0xed5ca3=_[_0x708e('0x4')](_0xed5ca3,require(_0x708e('0x1a')));_0xed5ca3=_['merge'](_0xed5ca3,require(_0x708e('0x1b')));_0xed5ca3=_[_0x708e('0x4')](_0xed5ca3,require(_0x708e('0x1c')));_0xed5ca3=_[_0x708e('0x4')](_0xed5ca3,require(_0x708e('0x1d')));_0xed5ca3=_['merge'](_0xed5ca3,require(_0x708e('0x1e')));_0xed5ca3=_[_0x708e('0x4')](_0xed5ca3,require(_0x708e('0x1f')));_0xed5ca3=_[_0x708e('0x4')](_0xed5ca3,require(_0x708e('0x20')));_0xed5ca3=_[_0x708e('0x4')](_0xed5ca3,require(_0x708e('0x21')));_0xed5ca3=_[_0x708e('0x4')](_0xed5ca3,require(_0x708e('0x22')));_0xed5ca3=_[_0x708e('0x4')](_0xed5ca3,require(_0x708e('0x23')));_0xed5ca3=_[_0x708e('0x4')](_0xed5ca3,require(_0x708e('0x24')));_0xed5ca3=_[_0x708e('0x4')](_0xed5ca3,require('../api/cmContact/cmContact.rpc'));_0xed5ca3=_[_0x708e('0x4')](_0xed5ca3,require(_0x708e('0x25')));_0xed5ca3=_[_0x708e('0x4')](_0xed5ca3,require(_0x708e('0x26')));_0xed5ca3=_[_0x708e('0x4')](_0xed5ca3,require('../api/cmHopperFinal/cmHopperFinal.rpc'));_0xed5ca3=_[_0x708e('0x4')](_0xed5ca3,require(_0x708e('0x27')));_0xed5ca3=_[_0x708e('0x4')](_0xed5ca3,require(_0x708e('0x28')));_0xed5ca3=_[_0x708e('0x4')](_0xed5ca3,require(_0x708e('0x29')));_0xed5ca3=_[_0x708e('0x4')](_0xed5ca3,require('../api/pause/pause.rpc'));_0xed5ca3=_['merge'](_0xed5ca3,require(_0x708e('0x2a')));_0xed5ca3=_['merge'](_0xed5ca3,require(_0x708e('0x2b')));_0xed5ca3=_['merge'](_0xed5ca3,require('../api/trigger/trigger.rpc'));_0xed5ca3=_['merge'](_0xed5ca3,require('../api/variable/variable.rpc'));_0xed5ca3=_['merge'](_0xed5ca3,require('../api/intSalesforceAccount/intSalesforceAccount.rpc'));_0xed5ca3=_[_0x708e('0x4')](_0xed5ca3,require(_0x708e('0x2c')));_0xed5ca3=_[_0x708e('0x4')](_0xed5ca3,require('../api/intDeskAccount/intDeskAccount.rpc'));_0xed5ca3=_['merge'](_0xed5ca3,require(_0x708e('0x2d')));_0xed5ca3=_['merge'](_0xed5ca3,require(_0x708e('0x2e')));_0xed5ca3=_['merge'](_0xed5ca3,require(_0x708e('0x2f')));_0xed5ca3=_[_0x708e('0x4')](_0xed5ca3,require(_0x708e('0x30')));_0xed5ca3=_[_0x708e('0x4')](_0xed5ca3,require(_0x708e('0x31')));_0xed5ca3=_[_0x708e('0x4')](_0xed5ca3,require('../api/intDynamics365Account/intDynamics365Account.rpc'));_0xed5ca3=_[_0x708e('0x4')](_0xed5ca3,require('../api/intFreshsalesAccount/intFreshsalesAccount.rpc'));_0xed5ca3=_[_0x708e('0x4')](_0xed5ca3,require(_0x708e('0x32')));_0xed5ca3=_[_0x708e('0x4')](_0xed5ca3,require(_0x708e('0x33')));_0xed5ca3=_[_0x708e('0x4')](_0xed5ca3,require(_0x708e('0x34')));_0xed5ca3=_[_0x708e('0x4')](_0xed5ca3,require('../api/squareReportDetail/squareReportDetail.rpc'));_0xed5ca3=_['merge'](_0xed5ca3,require('../api/squareOdbc/squareOdbc.rpc'));_0xed5ca3=_['merge'](_0xed5ca3,require(_0x708e('0x35')));_0xed5ca3=_[_0x708e('0x4')](_0xed5ca3,require('../api/squareRecording/squareRecording.rpc'));_0xed5ca3=_[_0x708e('0x4')](_0xed5ca3,require('../api/squareMessage/squareMessage.rpc'));_0xed5ca3=_['merge'](_0xed5ca3,require('../api/campaign/campaign.rpc'));_0xed5ca3=_[_0x708e('0x4')](_0xed5ca3,require(_0x708e('0x36')));_0xed5ca3=_['merge'](_0xed5ca3,require(_0x708e('0x37')));var _0xb8c727=jayson['server'](_0xed5ca3)['http']();var _0x26c966=config['rpc']['port']||config['port']+0x1;var _0x3a25c2=config[_0x708e('0x38')]['ip']||_0x708e('0x39');_0xb8c727['on']('error',function(_0x265224){return _0x47f4dc(_0x265224);});_0xb8c727['listen'](_0x26c966,_0x3a25c2,function(){console[_0x708e('0x3a')](_0x708e('0x3b'),_0x3a25c2,_0x26c966);require('../config/triggers')[_0x708e('0x3c')]();return _0x3e070c(_0x708e('0x3d')+_0x3a25c2+':'+_0x26c966);});});};
\ No newline at end of file
+var _0xa937=['../api/cmHopper/cmHopper.rpc','../api/cmHopperBlack/cmHopperBlack.rpc','../api/cmHopperFinal/cmHopperFinal.rpc','../api/cmHopperHistory/cmHopperHistory.rpc','../api/interval/interval.rpc','../api/sound/sound.rpc','../api/template/template.rpc','../api/trigger/trigger.rpc','../api/intSugarcrmAccount/intSugarcrmAccount.rpc','../api/intDeskAccount/intDeskAccount.rpc','../api/intZohoAccount/intZohoAccount.rpc','../api/intZendeskAccount/intZendeskAccount.rpc','../api/intFreshdeskAccount/intFreshdeskAccount.rpc','../api/intVtigerAccount/intVtigerAccount.rpc','../api/intServicenowAccount/intServicenowAccount.rpc','../api/intDynamics365Account/intDynamics365Account.rpc','../api/intFreshsalesAccount/intFreshsalesAccount.rpc','../api/chatQueueReport/chatQueueReport.rpc','../api/smsQueueReport/smsQueueReport.rpc','../api/squareReport/squareReport.rpc','../api/squareOdbc/squareOdbc.rpc','../api/squareProject/squareProject.rpc','../api/squareRecording/squareRecording.rpc','../api/attachment/attachment.rpc','../api/plugin/plugin.rpc','rpc','port','localhost','error','listen','log','../config/triggers','default','RPC\x20listening\x20on\x20','jayson/promise','../config/environment','merge','../api/voiceExtension/voiceExtension.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/mailAccount/mailAccount.rpc','../api/mailQueue/mailQueue.rpc','../api/mailMessage/mailMessage.rpc','../api/mailApplication/mailApplication.rpc','../api/faxAccount/faxAccount.rpc','../api/faxInteraction/faxInteraction.rpc','../api/faxMessage/faxMessage.rpc','../api/faxQueue/faxQueue.rpc','../api/faxQueueReport/faxQueueReport.rpc','../api/smsAccount/smsAccount.rpc','../api/smsMessage/smsMessage.rpc','../api/smsQueue/smsQueue.rpc','../api/openchannelApplication/openchannelApplication.rpc','../api/openchannelInteraction/openchannelInteraction.rpc','../api/openchannelMessage/openchannelMessage.rpc','../api/openchannelQueue/openchannelQueue.rpc','../api/openchannelQueueReport/openchannelQueueReport.rpc','../api/chatInteraction/chatInteraction.rpc','../api/chatMessage/chatMessage.rpc','../api/cmContact/cmContact.rpc'];(function(_0x1cd674,_0x8d3638){var _0x27928f=function(_0x5e3c70){while(--_0x5e3c70){_0x1cd674['push'](_0x1cd674['shift']());}};_0x27928f(++_0x8d3638);}(_0xa937,0xa8));var _0x7a93=function(_0x4ac8a3,_0xfd9cc0){_0x4ac8a3=_0x4ac8a3-0x0;var _0x1e2dd0=_0xa937[_0x4ac8a3];return _0x1e2dd0;};'use strict';var jayson=require(_0x7a93('0x0'));var BPromise=require('bluebird');var _=require('lodash');var config=require(_0x7a93('0x1'));exports['listen']=function(){return new BPromise(function(_0x5daf18,_0xcaa84b){var _0x51e8c8={};_0x51e8c8=_['merge'](_0x51e8c8,require('../api/user/user.rpc'));_0x51e8c8=_[_0x7a93('0x2')](_0x51e8c8,require(_0x7a93('0x3')));_0x51e8c8=_[_0x7a93('0x2')](_0x51e8c8,require('../api/voiceQueue/voiceQueue.rpc'));_0x51e8c8=_[_0x7a93('0x2')](_0x51e8c8,require(_0x7a93('0x4')));_0x51e8c8=_['merge'](_0x51e8c8,require(_0x7a93('0x5')));_0x51e8c8=_[_0x7a93('0x2')](_0x51e8c8,require(_0x7a93('0x6')));_0x51e8c8=_[_0x7a93('0x2')](_0x51e8c8,require(_0x7a93('0x7')));_0x51e8c8=_['merge'](_0x51e8c8,require(_0x7a93('0x8')));_0x51e8c8=_['merge'](_0x51e8c8,require(_0x7a93('0x9')));_0x51e8c8=_[_0x7a93('0x2')](_0x51e8c8,require(_0x7a93('0xa')));_0x51e8c8=_[_0x7a93('0x2')](_0x51e8c8,require(_0x7a93('0xb')));_0x51e8c8=_[_0x7a93('0x2')](_0x51e8c8,require(_0x7a93('0xc')));_0x51e8c8=_['merge'](_0x51e8c8,require('../api/mailServerIn/mailServerIn.rpc'));_0x51e8c8=_[_0x7a93('0x2')](_0x51e8c8,require(_0x7a93('0xd')));_0x51e8c8=_[_0x7a93('0x2')](_0x51e8c8,require(_0x7a93('0xe')));_0x51e8c8=_[_0x7a93('0x2')](_0x51e8c8,require('../api/mailInteraction/mailInteraction.rpc'));_0x51e8c8=_[_0x7a93('0x2')](_0x51e8c8,require(_0x7a93('0xf')));_0x51e8c8=_[_0x7a93('0x2')](_0x51e8c8,require(_0x7a93('0x10')));_0x51e8c8=_['merge'](_0x51e8c8,require('../api/mailQueueReport/mailQueueReport.rpc'));_0x51e8c8=_[_0x7a93('0x2')](_0x51e8c8,require(_0x7a93('0x11')));_0x51e8c8=_['merge'](_0x51e8c8,require('../api/faxApplication/faxApplication.rpc'));_0x51e8c8=_['merge'](_0x51e8c8,require(_0x7a93('0x12')));_0x51e8c8=_[_0x7a93('0x2')](_0x51e8c8,require(_0x7a93('0x13')));_0x51e8c8=_['merge'](_0x51e8c8,require(_0x7a93('0x14')));_0x51e8c8=_[_0x7a93('0x2')](_0x51e8c8,require(_0x7a93('0x15')));_0x51e8c8=_['merge'](_0x51e8c8,require(_0x7a93('0x16')));_0x51e8c8=_[_0x7a93('0x2')](_0x51e8c8,require('../api/smsInteraction/smsInteraction.rpc'));_0x51e8c8=_[_0x7a93('0x2')](_0x51e8c8,require(_0x7a93('0x17')));_0x51e8c8=_[_0x7a93('0x2')](_0x51e8c8,require(_0x7a93('0x18')));_0x51e8c8=_['merge'](_0x51e8c8,require(_0x7a93('0x19')));_0x51e8c8=_[_0x7a93('0x2')](_0x51e8c8,require(_0x7a93('0x1a')));_0x51e8c8=_['merge'](_0x51e8c8,require(_0x7a93('0x1b')));_0x51e8c8=_['merge'](_0x51e8c8,require(_0x7a93('0x1c')));_0x51e8c8=_['merge'](_0x51e8c8,require(_0x7a93('0x1d')));_0x51e8c8=_[_0x7a93('0x2')](_0x51e8c8,require(_0x7a93('0x1e')));_0x51e8c8=_[_0x7a93('0x2')](_0x51e8c8,require(_0x7a93('0x1f')));_0x51e8c8=_[_0x7a93('0x2')](_0x51e8c8,require('../api/chatQueue/chatQueue.rpc'));_0x51e8c8=_[_0x7a93('0x2')](_0x51e8c8,require(_0x7a93('0x20')));_0x51e8c8=_[_0x7a93('0x2')](_0x51e8c8,require(_0x7a93('0x21')));_0x51e8c8=_['merge'](_0x51e8c8,require(_0x7a93('0x22')));_0x51e8c8=_['merge'](_0x51e8c8,require(_0x7a93('0x23')));_0x51e8c8=_[_0x7a93('0x2')](_0x51e8c8,require(_0x7a93('0x24')));_0x51e8c8=_[_0x7a93('0x2')](_0x51e8c8,require('../api/reportAgentPreview/reportAgentPreview.rpc'));_0x51e8c8=_['merge'](_0x51e8c8,require(_0x7a93('0x25')));_0x51e8c8=_[_0x7a93('0x2')](_0x51e8c8,require('../api/pause/pause.rpc'));_0x51e8c8=_[_0x7a93('0x2')](_0x51e8c8,require(_0x7a93('0x26')));_0x51e8c8=_[_0x7a93('0x2')](_0x51e8c8,require(_0x7a93('0x27')));_0x51e8c8=_[_0x7a93('0x2')](_0x51e8c8,require(_0x7a93('0x28')));_0x51e8c8=_[_0x7a93('0x2')](_0x51e8c8,require('../api/variable/variable.rpc'));_0x51e8c8=_['merge'](_0x51e8c8,require('../api/intSalesforceAccount/intSalesforceAccount.rpc'));_0x51e8c8=_[_0x7a93('0x2')](_0x51e8c8,require(_0x7a93('0x29')));_0x51e8c8=_[_0x7a93('0x2')](_0x51e8c8,require(_0x7a93('0x2a')));_0x51e8c8=_[_0x7a93('0x2')](_0x51e8c8,require(_0x7a93('0x2b')));_0x51e8c8=_[_0x7a93('0x2')](_0x51e8c8,require(_0x7a93('0x2c')));_0x51e8c8=_[_0x7a93('0x2')](_0x51e8c8,require(_0x7a93('0x2d')));_0x51e8c8=_[_0x7a93('0x2')](_0x51e8c8,require(_0x7a93('0x2e')));_0x51e8c8=_[_0x7a93('0x2')](_0x51e8c8,require(_0x7a93('0x2f')));_0x51e8c8=_[_0x7a93('0x2')](_0x51e8c8,require(_0x7a93('0x30')));_0x51e8c8=_[_0x7a93('0x2')](_0x51e8c8,require(_0x7a93('0x31')));_0x51e8c8=_[_0x7a93('0x2')](_0x51e8c8,require(_0x7a93('0x32')));_0x51e8c8=_[_0x7a93('0x2')](_0x51e8c8,require(_0x7a93('0x33')));_0x51e8c8=_[_0x7a93('0x2')](_0x51e8c8,require(_0x7a93('0x34')));_0x51e8c8=_[_0x7a93('0x2')](_0x51e8c8,require('../api/squareReportDetail/squareReportDetail.rpc'));_0x51e8c8=_[_0x7a93('0x2')](_0x51e8c8,require(_0x7a93('0x35')));_0x51e8c8=_['merge'](_0x51e8c8,require(_0x7a93('0x36')));_0x51e8c8=_['merge'](_0x51e8c8,require(_0x7a93('0x37')));_0x51e8c8=_['merge'](_0x51e8c8,require('../api/squareMessage/squareMessage.rpc'));_0x51e8c8=_[_0x7a93('0x2')](_0x51e8c8,require('../api/campaign/campaign.rpc'));_0x51e8c8=_['merge'](_0x51e8c8,require(_0x7a93('0x38')));_0x51e8c8=_['merge'](_0x51e8c8,require(_0x7a93('0x39')));var _0x1a4b4d=jayson['server'](_0x51e8c8)['http']();var _0x34f193=config[_0x7a93('0x3a')][_0x7a93('0x3b')]||config['port']+0x1;var _0x5c343b=config['rpc']['ip']||_0x7a93('0x3c');_0x1a4b4d['on'](_0x7a93('0x3d'),function(_0x9ea057){return _0xcaa84b(_0x9ea057);});_0x1a4b4d[_0x7a93('0x3e')](_0x34f193,_0x5c343b,function(){console[_0x7a93('0x3f')]('Express\x20RPC\x20server\x20listening\x20on\x20%s:%d!',_0x5c343b,_0x34f193);require(_0x7a93('0x40'))[_0x7a93('0x41')]();return _0x5daf18(_0x7a93('0x42')+_0x5c343b+':'+_0x34f193);});});};
\ No newline at end of file
diff --git a/server/services/agi/channel.js b/server/services/agi/channel.js
index 1d70e00..9f42eb5 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 _0x9c44=['no\x20code','replace','result=','indexOf','substr','startsWith','length','match','error','E_AGI_SOCKET_ERROR','code','E_AGI_SOCKET_CLOSE','timeout','E_AGI_SOCKET_TIMEOUT','destroy','pipe','command','inherits','prototype','sendRequest','sync','ANSWER','getData','format','GET\x20DATA\x20\x22%s\x22\x20%s\x20%s','NO\x20MESSAGE','VERBOSE\x20\x22%s\x22','exec','isArray','EXEC\x20%s\x20%s','setContext','SET\x20CONTEXT\x20%s','SET\x20EXTENSION\x20%s','setPriority','SET\x20PRIORITY\x20%s','HANGUP','setVariable','isBoolean','isNumber','SET\x20VARIABLE\x20%s\x20\x22%s\x22','toString','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','noop','GOTO\x20%s\x20%s\x20%s','getVariable','GET\x20VARIABLE\x20\x22%s\x22','wav','BEEP','RECORD\x20FILE\x20\x22%s\x22\x20\x22%s\x22\x20\x22%s\x22\x20%s\x20%s\x20%s','streamFile','agi','AGI','wait','WAIT','ID:%s\x20-\x20LABEL:\x20%s\x20-\x20MSG:\x20%s','label','exports','events','EventEmitter','./reply','./error','setEncoding','utf8','setTimeout','emit','ready','toLowerCase','hangup','substring','520\x20End\x20of\x20proper','function'];(function(_0x3f6b1b,_0x58d3d6){var _0x4a3d2b=function(_0x5648f0){while(--_0x5648f0){_0x3f6b1b['push'](_0x3f6b1b['shift']());}};_0x4a3d2b(++_0x58d3d6);}(_0x9c44,0x178));var _0x49c4=function(_0x5608a3,_0x5b33c5){_0x5608a3=_0x5608a3-0x0;var _0x1ed50a=_0x9c44[_0x5608a3];return _0x1ed50a;};'use strict';var util=require('util');var _=require('lodash');var EventEmitter=require(_0x49c4('0x0'))[_0x49c4('0x1')];var AGIReply=require(_0x49c4('0x2'));var AGIError=require(_0x49c4('0x3'));function AGIChannel(_0x455700){var _0x2ad237=this,_0x4e0313=new AGIReply(),_0x4941f1=![],_0x41a183={};EventEmitter['call'](_0x2ad237);_0x455700[_0x49c4('0x4')](_0x49c4('0x5'));_0x455700[_0x49c4('0x6')](0x8*0x3c*0x3c*0x3e8);_0x4e0313[_0x49c4('0x4')](_0x49c4('0x5'));_0x4e0313['on']('headers',function(_0x11c586){for(var _0x42e4f8 in _0x11c586){_0x2ad237[_0x42e4f8]=_0x11c586[_0x42e4f8];}_0x2ad237[_0x49c4('0x7')](_0x49c4('0x8'));});_0x4e0313['on']('line',function(_0x5ab4a3){if(_0x5ab4a3[_0x49c4('0x9')]()==_0x49c4('0xa')){_0x2ad237['emit'](_0x49c4('0xa'));return;}if(_0x5ab4a3[_0x49c4('0xb')](0x0,0xb)=='520-Invalid'){_0x4941f1=!![];}if(_0x4941f1){_0x41a183['rx']+=_0x5ab4a3+'\x0a';if(_0x5ab4a3['search'](_0x49c4('0xc'))!=-0x1){_0x4941f1=![];}}else{_0x41a183['rx']=_0x5ab4a3;}if(_0x4941f1){return;}if(typeof _0x41a183['cb']==_0x49c4('0xd')){var _0x5487cd=_0x41a183['rx']['substring'](0x0,0x3),_0x7df3a9=null,_0x403bfb=null;_0x5487cd=parseInt(_0x5487cd);if(isNaN(_0x5487cd)){_0x41a183['cb'](null,{'code':0x1f4,'result':-0x1,'extra':_0x49c4('0xe')});return;}if(_0x5487cd!=0xc8){_0x41a183['cb'](null,{'code':_0x5487cd,'result':-0x1,'extra':'KO'});return;}_0x7df3a9=_0x41a183['rx'][_0x49c4('0xb')](0x4)[_0x49c4('0xf')](_0x49c4('0x10'),'');if(_0x7df3a9[_0x49c4('0x11')]('\x20')!=-0x1){_0x7df3a9=_0x7df3a9[_0x49c4('0x12')](0x0,_0x7df3a9[_0x49c4('0x11')]('\x20'));}if(_[_0x49c4('0x13')](_0x7df3a9,'-1')){_0x7df3a9=parseInt(_0x7df3a9);}_0x403bfb=_0x41a183['rx']['split']('\x20');if(_0x403bfb[_0x49c4('0x14')]==0x3){_0x403bfb=_0x403bfb[0x2][_0x49c4('0xb')](0x1,_0x403bfb[0x2][_0x49c4('0x14')]-0x1);}else if(_0x403bfb[_0x49c4('0x14')]>0x3){var _0x2abc78=/\((.+)\)/;var _0x53e3a2=_0x41a183['rx'][_0x49c4('0x15')](_0x2abc78);if(_0x53e3a2){_0x403bfb=_0x53e3a2[0x1];}else{_0x403bfb=null;}}else{_0x403bfb=null;}_0x41a183['cb'](null,{'code':_0x5487cd,'result':_0x7df3a9,'extra':_0x403bfb});}});_0x455700['on'](_0x49c4('0x16'),function(_0x4c3253){_0x2ad237['emit'](_0x49c4('0x16'),new AGIError(_0x49c4('0x17'),_0x4c3253[_0x49c4('0x18')]));});_0x455700['on']('close',function(){_0x2ad237[_0x49c4('0x7')]('close',new AGIError(_0x49c4('0x19')));});_0x455700['on'](_0x49c4('0x1a'),function(){_0x2ad237[_0x49c4('0x7')](_0x49c4('0x1a'),new AGIError(_0x49c4('0x1b')));_0x455700[_0x49c4('0x1c')]();});_0x455700[_0x49c4('0x1d')](_0x4e0313);this[_0x49c4('0x1e')]=function(_0x2197d2,_0x578447){var _0x2197d2=_0x2197d2||'',_0x578447=typeof _0x578447==_0x49c4('0xd')?_0x578447:new Function();_0x41a183={'tx':_0x2197d2,'rx':'','cb':_0x578447};_0x455700['write'](_0x2197d2+'\x0a');},this['close']=function(){_0x455700[_0x49c4('0x1c')]();};}util[_0x49c4('0x1f')](AGIChannel,EventEmitter);AGIChannel[_0x49c4('0x20')][_0x49c4('0x21')]=function(_0x4811c4){return this['command'][_0x49c4('0x22')](this,_0x4811c4);};AGIChannel[_0x49c4('0x20')]['answer']=function(){return this[_0x49c4('0x21')](_0x49c4('0x23'));};AGIChannel[_0x49c4('0x20')][_0x49c4('0x24')]=function(_0x531d92,_0x543ea2,_0x449960){_0x531d92=_0x531d92===undefined?'beep':_0x531d92;_0x543ea2=_0x543ea2===undefined?'5':_0x543ea2;_0x449960=_0x449960===undefined?'1':_0x449960;return this[_0x49c4('0x21')](util[_0x49c4('0x25')](_0x49c4('0x26'),_0x531d92,_0x543ea2*0x3e8,_0x449960));};AGIChannel[_0x49c4('0x20')]['noop']=function(_0x889909){_0x889909=_0x889909||_0x49c4('0x27');return this[_0x49c4('0x21')](util[_0x49c4('0x25')](_0x49c4('0x28'),_0x889909));};AGIChannel[_0x49c4('0x20')][_0x49c4('0x29')]=function(_0x427b26,_0x17b50f){if(_[_0x49c4('0x2a')](_0x17b50f)){return this[_0x49c4('0x21')](util['format']('EXEC\x20%s\x20%s',_0x427b26,_0x17b50f['join'](',')));}return this[_0x49c4('0x21')](util[_0x49c4('0x25')](_0x49c4('0x2b'),_0x427b26,_0x17b50f));};AGIChannel[_0x49c4('0x20')][_0x49c4('0x2c')]=function(_0x574fd3){return this[_0x49c4('0x21')](util[_0x49c4('0x25')](_0x49c4('0x2d'),_0x574fd3));};AGIChannel[_0x49c4('0x20')]['setExtension']=function(_0x57a29c){return this[_0x49c4('0x21')](util[_0x49c4('0x25')](_0x49c4('0x2e'),_0x57a29c));};AGIChannel[_0x49c4('0x20')][_0x49c4('0x2f')]=function(_0x4a0c7a){return this[_0x49c4('0x21')](util[_0x49c4('0x25')](_0x49c4('0x30'),_0x4a0c7a));};AGIChannel['prototype']['hangup']=function(){return this[_0x49c4('0x21')](_0x49c4('0x31'));};AGIChannel[_0x49c4('0x20')][_0x49c4('0x32')]=function(_0x2b45a1,_0x2cf897){var _0x1d1557=_[_0x49c4('0x33')](_0x2cf897)||_[_0x49c4('0x34')](_0x2cf897)?_0x2cf897['toString']():_0x2cf897;return this[_0x49c4('0x21')](util['format'](_0x49c4('0x35'),_0x2b45a1,_0x1d1557?_0x1d1557[_0x49c4('0x36')]()[_0x49c4('0xf')](/(\r\n|\n|\r)/gm,'\x20'):''));};AGIChannel[_0x49c4('0x20')]['sayNumber']=function(_0x335f0c,_0x31f3ff){return this[_0x49c4('0x21')](util['format'](_0x49c4('0x37'),_0x335f0c,_0x31f3ff));};AGIChannel[_0x49c4('0x20')][_0x49c4('0x38')]=function(_0x5e5366,_0x1ba7a0){return this[_0x49c4('0x21')](util[_0x49c4('0x25')](_0x49c4('0x39'),_0x5e5366,_0x1ba7a0));};AGIChannel[_0x49c4('0x20')][_0x49c4('0x3a')]=function(_0x1e506a,_0x4e0663){return this[_0x49c4('0x21')](util[_0x49c4('0x25')](_0x49c4('0x3b'),_0x1e506a,_0x4e0663));};AGIChannel[_0x49c4('0x20')][_0x49c4('0x3c')]=function(_0x29dd5d,_0x1be62d,_0xc9722b){_0x1be62d=_0x1be62d||this[_0x49c4('0x3d')];_0xc9722b=_0xc9722b||0x1;this[_0x49c4('0x2c')](_0x29dd5d);this[_0x49c4('0x3e')](_0x1be62d);this[_0x49c4('0x2f')](_0xc9722b);return this[_0x49c4('0x3f')](util['format'](_0x49c4('0x40'),_0x29dd5d,_0x1be62d,_0xc9722b));};AGIChannel['prototype'][_0x49c4('0x41')]=function(_0x4915bc){return this[_0x49c4('0x21')](util[_0x49c4('0x25')](_0x49c4('0x42'),_0x4915bc));};AGIChannel[_0x49c4('0x20')]['recordFile']=function(_0x4d628a,_0x20490b,_0x1e7bdc,_0x38349b,_0x117151,_0x490823){_0x20490b=_0x20490b||_0x49c4('0x43');_0x1e7bdc=_0x1e7bdc||'';_0x38349b=_0x38349b===undefined?-0x1:_0x38349b==='-1'?-0x1:_0x38349b*0x3e8;_0x117151=_0x117151===undefined?'':'s='+_0x117151;_0x490823=_0x490823?_0x49c4('0x44'):'';return this[_0x49c4('0x21')](util[_0x49c4('0x25')](_0x49c4('0x45'),_0x4d628a,_0x20490b,_0x1e7bdc,_0x38349b,_0x490823,_0x117151));};AGIChannel[_0x49c4('0x20')][_0x49c4('0x46')]=function(_0x3351c1,_0x3c4a1d){_0x3c4a1d=_0x3c4a1d||'';return this['sendRequest'](util[_0x49c4('0x25')]('STREAM\x20FILE\x20\x22%s\x22\x20\x22%s\x22',_0x3351c1,_0x3c4a1d));};AGIChannel[_0x49c4('0x20')][_0x49c4('0x47')]=function(_0x301def){return this[_0x49c4('0x29')](_0x49c4('0x48'),_0x301def);};AGIChannel['prototype'][_0x49c4('0x49')]=function(_0x15b674){return this[_0x49c4('0x29')](_0x49c4('0x4a'),_0x15b674);};AGIChannel[_0x49c4('0x20')][_0x49c4('0x16')]=function(_0x9779ef,_0x4d89e0){this[_0x49c4('0x3f')](util['format'](_0x49c4('0x4b'),_0x9779ef['id'],_0x9779ef[_0x49c4('0x4c')],_0x4d89e0));return{'code':0x1f4,'result':'-1','extra':''};};module[_0x49c4('0x4d')]=AGIChannel;
\ No newline at end of file
+var _0x70e0=['format','GET\x20DATA\x20\x22%s\x22\x20%s\x20%s','noop','NO\x20MESSAGE','VERBOSE\x20\x22%s\x22','exec','isArray','join','EXEC\x20%s\x20%s','setExtension','SET\x20EXTENSION\x20%s','SET\x20PRIORITY\x20%s','HANGUP','setVariable','isBoolean','isNumber','sayNumber','SAY\x20NUMBER\x20%s\x20%s','sayDigits','sayPhonetic','SAY\x20PHONETIC\x20\x22%s\x22\x20%s','continueAt','setPriority','GOTO\x20%s\x20%s\x20%s','getVariable','wav','RECORD\x20FILE\x20\x22%s\x22\x20\x22%s\x22\x20\x22%s\x22\x20%s\x20%s\x20%s','STREAM\x20FILE\x20\x22%s\x22\x20\x22%s\x22','agi','wait','WAIT','ID:%s\x20-\x20LABEL:\x20%s\x20-\x20MSG:\x20%s','label','exports','util','lodash','events','./error','setEncoding','utf8','headers','emit','ready','line','hangup','substring','520-Invalid','search','520\x20End\x20of\x20proper','function','substr','indexOf','length','match','error','code','close','E_AGI_SOCKET_CLOSE','E_AGI_SOCKET_TIMEOUT','destroy','pipe','write','inherits','prototype','command','sync','answer','getData','sendRequest'];(function(_0x1fe62f,_0x6355f7){var _0x10e913=function(_0x1acbe8){while(--_0x1acbe8){_0x1fe62f['push'](_0x1fe62f['shift']());}};_0x10e913(++_0x6355f7);}(_0x70e0,0x17b));var _0x070e=function(_0x544c53,_0x332882){_0x544c53=_0x544c53-0x0;var _0x272e16=_0x70e0[_0x544c53];return _0x272e16;};'use strict';var util=require(_0x070e('0x0'));var _=require(_0x070e('0x1'));var EventEmitter=require(_0x070e('0x2'))['EventEmitter'];var AGIReply=require('./reply');var AGIError=require(_0x070e('0x3'));function AGIChannel(_0xee173){var _0x277d32=this,_0x2593e5=new AGIReply(),_0x5c90fc=![],_0x7bce9b={};EventEmitter['call'](_0x277d32);_0xee173[_0x070e('0x4')]('utf8');_0xee173['setTimeout'](0x8*0x3c*0x3c*0x3e8);_0x2593e5['setEncoding'](_0x070e('0x5'));_0x2593e5['on'](_0x070e('0x6'),function(_0x604664){for(var _0x2611e6 in _0x604664){_0x277d32[_0x2611e6]=_0x604664[_0x2611e6];}_0x277d32[_0x070e('0x7')](_0x070e('0x8'));});_0x2593e5['on'](_0x070e('0x9'),function(_0x4e99e6){if(_0x4e99e6['toLowerCase']()==_0x070e('0xa')){_0x277d32[_0x070e('0x7')](_0x070e('0xa'));return;}if(_0x4e99e6[_0x070e('0xb')](0x0,0xb)==_0x070e('0xc')){_0x5c90fc=!![];}if(_0x5c90fc){_0x7bce9b['rx']+=_0x4e99e6+'\x0a';if(_0x4e99e6[_0x070e('0xd')](_0x070e('0xe'))!=-0x1){_0x5c90fc=![];}}else{_0x7bce9b['rx']=_0x4e99e6;}if(_0x5c90fc){return;}if(typeof _0x7bce9b['cb']==_0x070e('0xf')){var _0x39d2b9=_0x7bce9b['rx']['substring'](0x0,0x3),_0x5bf079=null,_0x2930b8=null;_0x39d2b9=parseInt(_0x39d2b9);if(isNaN(_0x39d2b9)){_0x7bce9b['cb'](null,{'code':0x1f4,'result':-0x1,'extra':'no\x20code'});return;}if(_0x39d2b9!=0xc8){_0x7bce9b['cb'](null,{'code':_0x39d2b9,'result':-0x1,'extra':'KO'});return;}_0x5bf079=_0x7bce9b['rx'][_0x070e('0xb')](0x4)['replace']('result=','');if(_0x5bf079['indexOf']('\x20')!=-0x1){_0x5bf079=_0x5bf079[_0x070e('0x10')](0x0,_0x5bf079[_0x070e('0x11')]('\x20'));}if(_['startsWith'](_0x5bf079,'-1')){_0x5bf079=parseInt(_0x5bf079);}_0x2930b8=_0x7bce9b['rx']['split']('\x20');if(_0x2930b8[_0x070e('0x12')]==0x3){_0x2930b8=_0x2930b8[0x2][_0x070e('0xb')](0x1,_0x2930b8[0x2][_0x070e('0x12')]-0x1);}else if(_0x2930b8[_0x070e('0x12')]>0x3){var _0x5bc71e=/\((.+)\)/;var _0x49861b=_0x7bce9b['rx'][_0x070e('0x13')](_0x5bc71e);if(_0x49861b){_0x2930b8=_0x49861b[0x1];}else{_0x2930b8=null;}}else{_0x2930b8=null;}_0x7bce9b['cb'](null,{'code':_0x39d2b9,'result':_0x5bf079,'extra':_0x2930b8});}});_0xee173['on'](_0x070e('0x14'),function(_0x38f6e6){_0x277d32[_0x070e('0x7')](_0x070e('0x14'),new AGIError('E_AGI_SOCKET_ERROR',_0x38f6e6[_0x070e('0x15')]));});_0xee173['on'](_0x070e('0x16'),function(){_0x277d32[_0x070e('0x7')](_0x070e('0x16'),new AGIError(_0x070e('0x17')));});_0xee173['on']('timeout',function(){_0x277d32['emit']('timeout',new AGIError(_0x070e('0x18')));_0xee173[_0x070e('0x19')]();});_0xee173[_0x070e('0x1a')](_0x2593e5);this['command']=function(_0x5b184,_0x5dc5d2){var _0x5b184=_0x5b184||'',_0x5dc5d2=typeof _0x5dc5d2==_0x070e('0xf')?_0x5dc5d2:new Function();_0x7bce9b={'tx':_0x5b184,'rx':'','cb':_0x5dc5d2};_0xee173[_0x070e('0x1b')](_0x5b184+'\x0a');},this[_0x070e('0x16')]=function(){_0xee173[_0x070e('0x19')]();};}util[_0x070e('0x1c')](AGIChannel,EventEmitter);AGIChannel[_0x070e('0x1d')]['sendRequest']=function(_0x2f8055){return this[_0x070e('0x1e')][_0x070e('0x1f')](this,_0x2f8055);};AGIChannel['prototype'][_0x070e('0x20')]=function(){return this['sendRequest']('ANSWER');};AGIChannel[_0x070e('0x1d')][_0x070e('0x21')]=function(_0x41deb1,_0x1743cc,_0x4763c6){_0x41deb1=_0x41deb1===undefined?'beep':_0x41deb1;_0x1743cc=_0x1743cc===undefined?'5':_0x1743cc;_0x4763c6=_0x4763c6===undefined?'1':_0x4763c6;return this[_0x070e('0x22')](util[_0x070e('0x23')](_0x070e('0x24'),_0x41deb1,_0x1743cc*0x3e8,_0x4763c6));};AGIChannel[_0x070e('0x1d')][_0x070e('0x25')]=function(_0x28d7f2){_0x28d7f2=_0x28d7f2||_0x070e('0x26');return this[_0x070e('0x22')](util['format'](_0x070e('0x27'),_0x28d7f2));};AGIChannel[_0x070e('0x1d')][_0x070e('0x28')]=function(_0x56fc12,_0x5c5f0d){if(_[_0x070e('0x29')](_0x5c5f0d)){return this[_0x070e('0x22')](util[_0x070e('0x23')]('EXEC\x20%s\x20%s',_0x56fc12,_0x5c5f0d[_0x070e('0x2a')](',')));}return this[_0x070e('0x22')](util[_0x070e('0x23')](_0x070e('0x2b'),_0x56fc12,_0x5c5f0d));};AGIChannel['prototype']['setContext']=function(_0x523b75){return this['sendRequest'](util[_0x070e('0x23')]('SET\x20CONTEXT\x20%s',_0x523b75));};AGIChannel[_0x070e('0x1d')][_0x070e('0x2c')]=function(_0x4f8130){return this['sendRequest'](util[_0x070e('0x23')](_0x070e('0x2d'),_0x4f8130));};AGIChannel['prototype']['setPriority']=function(_0x41ade4){return this[_0x070e('0x22')](util[_0x070e('0x23')](_0x070e('0x2e'),_0x41ade4));};AGIChannel[_0x070e('0x1d')]['hangup']=function(){return this['sendRequest'](_0x070e('0x2f'));};AGIChannel[_0x070e('0x1d')][_0x070e('0x30')]=function(_0xf57ed,_0xf11439){var _0x4deaf8=_[_0x070e('0x31')](_0xf11439)||_[_0x070e('0x32')](_0xf11439)?_0xf11439['toString']():_0xf11439;return this[_0x070e('0x22')](util[_0x070e('0x23')]('SET\x20VARIABLE\x20%s\x20\x22%s\x22',_0xf57ed,_0x4deaf8?_0x4deaf8['toString']()['replace'](/(\r\n|\n|\r)/gm,'\x20'):''));};AGIChannel[_0x070e('0x1d')][_0x070e('0x33')]=function(_0x39dfaa,_0x334733){return this[_0x070e('0x22')](util['format'](_0x070e('0x34'),_0x39dfaa,_0x334733));};AGIChannel[_0x070e('0x1d')][_0x070e('0x35')]=function(_0x487276,_0x268c5d){return this[_0x070e('0x22')](util[_0x070e('0x23')]('SAY\x20DIGITS\x20%s\x20%s',_0x487276,_0x268c5d));};AGIChannel[_0x070e('0x1d')][_0x070e('0x36')]=function(_0x4800a9,_0x173602){return this['sendRequest'](util[_0x070e('0x23')](_0x070e('0x37'),_0x4800a9,_0x173602));};AGIChannel[_0x070e('0x1d')][_0x070e('0x38')]=function(_0xd03404,_0x47b929,_0xd18220){_0x47b929=_0x47b929||this['extension'];_0xd18220=_0xd18220||0x1;this['setContext'](_0xd03404);this[_0x070e('0x2c')](_0x47b929);this[_0x070e('0x39')](_0xd18220);return this[_0x070e('0x25')](util['format'](_0x070e('0x3a'),_0xd03404,_0x47b929,_0xd18220));};AGIChannel[_0x070e('0x1d')][_0x070e('0x3b')]=function(_0x7dc240){return this['sendRequest'](util[_0x070e('0x23')]('GET\x20VARIABLE\x20\x22%s\x22',_0x7dc240));};AGIChannel['prototype']['recordFile']=function(_0x3feb83,_0x926533,_0x26b3e2,_0x29dccd,_0x34f23e,_0x562aa4){_0x926533=_0x926533||_0x070e('0x3c');_0x26b3e2=_0x26b3e2||'';_0x29dccd=_0x29dccd===undefined?-0x1:_0x29dccd==='-1'?-0x1:_0x29dccd*0x3e8;_0x34f23e=_0x34f23e===undefined?'':'s='+_0x34f23e;_0x562aa4=_0x562aa4?'BEEP':'';return this[_0x070e('0x22')](util[_0x070e('0x23')](_0x070e('0x3d'),_0x3feb83,_0x926533,_0x26b3e2,_0x29dccd,_0x562aa4,_0x34f23e));};AGIChannel['prototype']['streamFile']=function(_0x261a27,_0x5ee4b8){_0x5ee4b8=_0x5ee4b8||'';return this[_0x070e('0x22')](util[_0x070e('0x23')](_0x070e('0x3e'),_0x261a27,_0x5ee4b8));};AGIChannel['prototype'][_0x070e('0x3f')]=function(_0x20a1ee){return this['exec']('AGI',_0x20a1ee);};AGIChannel[_0x070e('0x1d')][_0x070e('0x40')]=function(_0x2d43ce){return this[_0x070e('0x28')](_0x070e('0x41'),_0x2d43ce);};AGIChannel['prototype'][_0x070e('0x14')]=function(_0x3f6c64,_0x427fa7){this[_0x070e('0x25')](util[_0x070e('0x23')](_0x070e('0x42'),_0x3f6c64['id'],_0x3f6c64[_0x070e('0x43')],_0x427fa7));return{'code':0x1f4,'result':'-1','extra':''};};module[_0x070e('0x44')]=AGIChannel;
\ No newline at end of file
diff --git a/server/services/agi/error.js b/server/services/agi/error.js
index b1dbdfd..509ce73 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 _0x4ff6=['push','apply','message','name','exports','Undefined\x20error.','Argument\x20\x27port\x27\x20missing\x20in\x20function\x20call.','Server\x20error.\x20Code:\x20%s.','Server\x20closed.','[LICENSE]\x20Server\x20max\x20connection.\x20Count:\x20%s.','Socket\x20error.\x20Code:\x20%s.','Socket\x20closed.','Socket\x20timeout.','Empty\x20command.','Missing\x20\x27ivr.agi_network_script\x27.','Missing\x20\x27ivr.entry\x27\x20menu.'];(function(_0x4ab528,_0x5711da){var _0x5d6025=function(_0x54ee79){while(--_0x54ee79){_0x4ab528['push'](_0x4ab528['shift']());}};_0x5d6025(++_0x5711da);}(_0x4ff6,0xd5));var _0x64ff=function(_0x26e7c2,_0x274cdb){_0x26e7c2=_0x26e7c2-0x0;var _0x419cd0=_0x4ff6[_0x26e7c2];return _0x419cd0;};'use strict';var util=require('util');var error={'E_AGI_UNDEFINED':_0x64ff('0x0'),'E_AGI_ARGUMENT_PORT':_0x64ff('0x1'),'E_AGI_SERVER_ERROR':_0x64ff('0x2'),'E_AGI_SERVER_CLOSE':_0x64ff('0x3'),'E_AGI_SERVER_MAXCONNECTION':_0x64ff('0x4'),'E_AGI_SERVER_VOICE_DISABLED':'[LICENSE\x20VOICE]\x20Server\x20license\x20voice\x20disabled.','E_AGI_SOCKET_ERROR':_0x64ff('0x5'),'E_AGI_SOCKET_CLOSE':_0x64ff('0x6'),'E_AGI_SOCKET_TIMEOUT':_0x64ff('0x7'),'E_AGI_COMMAND_EMPTY':_0x64ff('0x8'),'E_AGI_IVR_AGI_NETWORK_SCRIPT':_0x64ff('0x9'),'E_AGI_IVR_ENTRY':_0x64ff('0xa')};function AGIError(_0x37ad86){var _0x37ad86=_0x37ad86||null,_0x42691b=_0x42691b||[],_0x2f8e5e=0x1,_0x2ac7da='';if(!error[_0x37ad86]){_0x37ad86='E_AGI_UNDEFINED';}_0x42691b[_0x64ff('0xb')](error[_0x37ad86]);while(arguments[_0x2f8e5e]){_0x42691b['push'](arguments[_0x2f8e5e]);_0x2f8e5e++;}_0x2ac7da=util['format'][_0x64ff('0xc')](util,_0x42691b);this[_0x64ff('0xd')]=_0x2ac7da;this[_0x64ff('0xe')]=_0x37ad86;}module[_0x64ff('0xf')]=AGIError;
\ No newline at end of file
+var _0x1629=['format','apply','message','name','util','Undefined\x20error.','Argument\x20\x27port\x27\x20missing\x20in\x20function\x20call.','Server\x20error.\x20Code:\x20%s.','[LICENSE]\x20Server\x20max\x20connection.\x20Count:\x20%s.','Socket\x20closed.','Socket\x20timeout.','Missing\x20\x27ivr.entry\x27\x20menu.'];(function(_0x5254d4,_0x50ea9e){var _0x2b4046=function(_0x41513d){while(--_0x41513d){_0x5254d4['push'](_0x5254d4['shift']());}};_0x2b4046(++_0x50ea9e);}(_0x1629,0x1d8));var _0x9162=function(_0x36b16a,_0x3a2de4){_0x36b16a=_0x36b16a-0x0;var _0x3f2dc9=_0x1629[_0x36b16a];return _0x3f2dc9;};'use strict';var util=require(_0x9162('0x0'));var error={'E_AGI_UNDEFINED':_0x9162('0x1'),'E_AGI_ARGUMENT_PORT':_0x9162('0x2'),'E_AGI_SERVER_ERROR':_0x9162('0x3'),'E_AGI_SERVER_CLOSE':'Server\x20closed.','E_AGI_SERVER_MAXCONNECTION':_0x9162('0x4'),'E_AGI_SERVER_VOICE_DISABLED':'[LICENSE\x20VOICE]\x20Server\x20license\x20voice\x20disabled.','E_AGI_SOCKET_ERROR':'Socket\x20error.\x20Code:\x20%s.','E_AGI_SOCKET_CLOSE':_0x9162('0x5'),'E_AGI_SOCKET_TIMEOUT':_0x9162('0x6'),'E_AGI_COMMAND_EMPTY':'Empty\x20command.','E_AGI_IVR_AGI_NETWORK_SCRIPT':'Missing\x20\x27ivr.agi_network_script\x27.','E_AGI_IVR_ENTRY':_0x9162('0x7')};function AGIError(_0x1defdd){var _0x1defdd=_0x1defdd||null,_0xc579ed=_0xc579ed||[],_0x11d90b=0x1,_0x168267='';if(!error[_0x1defdd]){_0x1defdd='E_AGI_UNDEFINED';}_0xc579ed['push'](error[_0x1defdd]);while(arguments[_0x11d90b]){_0xc579ed['push'](arguments[_0x11d90b]);_0x11d90b++;}_0x168267=util[_0x9162('0x8')][_0x9162('0x9')](util,_0xc579ed);this[_0x9162('0xa')]=_0x168267;this[_0x9162('0xb')]=_0x1defdd;}module['exports']=AGIError;
\ No newline at end of file
diff --git a/server/services/agi/graph/index.js b/server/services/agi/graph/index.js
index 309ef4c..0dfb92a 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 _0x9348=['../../../config/logger','agi','menu','getdigits','vertices','edges','prototype','addVertex','size','relations','numberOfEdges','getVertex','traverseBFS','info','no\x20vertex\x20found','stop\x20traverse','length','no\x20edge/s\x20available','condition','agicommand','vswitch','target','default','invalid','default\x20on\x20switch\x20not\x20found','includes','max\x20retry\x20reach','condition\x20not\x20found','exports','lodash'];(function(_0x12d6c3,_0x416e6b){var _0x517601=function(_0x54c603){while(--_0x54c603){_0x12d6c3['push'](_0x12d6c3['shift']());}};_0x517601(++_0x416e6b);}(_0x9348,0x10d));var _0x8934=function(_0xd1db4c,_0x3fe349){_0xd1db4c=_0xd1db4c-0x0;var _0x18d46a=_0x9348[_0xd1db4c];return _0x18d46a;};'use strict';var _=require(_0x8934('0x0'));var logger=require(_0x8934('0x1'))(_0x8934('0x2'));var verticesWithRetry=[_0x8934('0x3'),_0x8934('0x4'),'getsecretdigits'];var Graph=function(){this[_0x8934('0x5')]={};this[_0x8934('0x6')]={};this['numberOfEdges']=0x0;};Graph[_0x8934('0x7')][_0x8934('0x8')]=function(_0xefbef9){this[_0x8934('0x5')][_0xefbef9['id']]=_0xefbef9;this[_0x8934('0x6')][_0xefbef9['id']]=[];};Graph[_0x8934('0x7')]['addEdge']=function(_0x284a62,_0x3734c5,_0x1c7f03){this['edges'][_0x284a62]['push']({'target':_0x3734c5,'condition':_0x1c7f03});this['numberOfEdges']+=0x1;};Graph['prototype'][_0x8934('0x9')]=function(){return _['size'](this[_0x8934('0x5')]);};Graph[_0x8934('0x7')][_0x8934('0xa')]=function(){return this[_0x8934('0xb')];};Graph[_0x8934('0x7')][_0x8934('0xc')]=function(_0x41909f){return this[_0x8934('0x5')][_0x41909f];};Graph['prototype'][_0x8934('0xd')]=function(_0x108eab,_0x46bca5){if(!this[_0x8934('0x5')][_0x108eab]){return logger[_0x8934('0xe')](_0x8934('0xf'));}var _0x5b560f=_0x46bca5(this[_0x8934('0x5')][_0x108eab]);if(!_0x5b560f){return logger[_0x8934('0xe')](_0x8934('0x10'));}if(this[_0x8934('0x6')][_0x108eab][_0x8934('0x11')]===0x0){return logger[_0x8934('0xe')](_0x8934('0x12'));}for(var _0x357cf8=0x0,_0x52de6a=[],_0xb86bc9=![];_0x357cf8\x20to\x20extension\x20%s\x20with\x20uniqueid\x20%s','[HANGUP]\x20%s\x20project:\x20from\x20\x22%s\x22\x20<%s>\x20to\x20extension\x20%s\x20with\x20uniqueid\x20%s','evtHangup','mxGraphModel','root','agicommand','retry','maxRetry','hasOwnProperty','length','source','target','addEdge','value','then','catch','substring','inspect','debug','stringify','[START]\x20%s\x20project:\x20from\x20\x22%s\x22\x20<%s>\x20to\x20extension\x20%s\x20with\x20uniqueid\x20%s','hangup','sync','production','start','joinAt','YYYY-MM-DD\x20HH:mm:ss','omit','mxCell','[START\x20TRAVERSE]\x20%s\x20project:\x20from\x20\x22%s\x22\x20<%s>\x20to\x20extension\x20%s\x20with\x20uniqueid\x20%s','traverseBFS','clear','context','extension','priority','response','isUndefined','result','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','[GOTO]\x20context:\x20%s\x20extension:\x20%s\x20priority:\x20%s','Project\x20%s\x20not\x20published','continueAt','close','Project\x20%s\x20not\x20found','voice','callysquare','[LICENSE]\x20CHANNELS:\x20%s','[LICENSE]\x20CHANNELS:\x20UNLIMITED','[LICENSE]','./server','listening','connection','xml2json','lodash','syncho','moment','../../config/logger','agi','./rpc','./mailRpc','./graph','./vertices','defaults','nextTick','error','stack','Cally\x20Square\x20server\x20listening\x20on\x20port\x20%d!','port','info','format','[LISTENING]\x20Cally\x20Square\x20listening\x20%s:%d','message','[%s]\x20%s','name','[ERROR]\x20%s','[CLOSE]\x20%s\x20project:\x20from\x20\x22%s\x22\x20<%s>\x20to\x20extension\x20%s\x20with\x20uniqueid\x20%s','arg_1','calleridname','callerid','dnid','uniqueid'];(function(_0x11fb47,_0x50fbf8){var _0xa0d270=function(_0x2d6c3e){while(--_0x2d6c3e){_0x11fb47['push'](_0x11fb47['shift']());}};_0xa0d270(++_0x50fbf8);}(_0xdc97,0x13b));var _0x7dc9=function(_0x586117,_0x3eee78){_0x586117=_0x586117-0x0;var _0x33b463=_0xdc97[_0x586117];return _0x33b463;};'use strict';var parser=require(_0x7dc9('0x0'));var _=require(_0x7dc9('0x1'));var syncho=require(_0x7dc9('0x2'));var util=require('util');var moment=require(_0x7dc9('0x3'));var config=require('../../config/environment');var logger=require(_0x7dc9('0x4'))(_0x7dc9('0x5'));var utilLicense=require('../../config/license/util');var rpc=require(_0x7dc9('0x6'));var mailRpc=require(_0x7dc9('0x7'));var Graph=require(_0x7dc9('0x8'));var Vertices=require(_0x7dc9('0x9'));var AGI_CODE_SUCCESS=0xc8;var AGI_RESULT_ERROR=-0x1;config['agi']=_[_0x7dc9('0xa')](config['agi'],{'ip':'127.0.0.1','port':0x11dd});function connectionHandler(_0x2ff923){process[_0x7dc9('0xb')](function(){syncho(function(){try{setChannelVariables(_0x2ff923);agiHandler(_0x2ff923);}catch(_0x3318ea){logger[_0x7dc9('0xc')](_0x3318ea[_0x7dc9('0xd')]);}});});}function listeningHandler(){console['log'](_0x7dc9('0xe'),config[_0x7dc9('0x5')][_0x7dc9('0xf')]);logger[_0x7dc9('0x10')](util[_0x7dc9('0x11')](_0x7dc9('0x12'),config[_0x7dc9('0x5')]['ip'],config['agi']['port']));}function errorHandler(_0x4be1c8){if(_0x4be1c8&&_0x4be1c8['name']&&_0x4be1c8[_0x7dc9('0x13')]){logger[_0x7dc9('0xc')](util['format'](_0x7dc9('0x14'),_0x4be1c8[_0x7dc9('0x15')],_0x4be1c8[_0x7dc9('0x13')]));}else{logger[_0x7dc9('0xc')](util[_0x7dc9('0x11')](_0x7dc9('0x16'),_0x4be1c8['stack']));}}function closeHandler(){logger[_0x7dc9('0x10')](util[_0x7dc9('0x11')](_0x7dc9('0x17'),this[_0x7dc9('0x18')],this[_0x7dc9('0x19')],this[_0x7dc9('0x1a')],this[_0x7dc9('0x1b')],this[_0x7dc9('0x1c')]));try{createSquareReport(this);}catch(_0x4778d5){logger['error'](_0x4778d5[_0x7dc9('0xd')]);}}function timeoutHandler(){logger['info'](util[_0x7dc9('0x11')](_0x7dc9('0x1d'),this['arg_1'],this[_0x7dc9('0x19')],this[_0x7dc9('0x1a')],this[_0x7dc9('0x1b')],this[_0x7dc9('0x1c')]));}function hangupHandler(){logger[_0x7dc9('0x10')](util[_0x7dc9('0x11')](_0x7dc9('0x1e'),this[_0x7dc9('0x18')],this[_0x7dc9('0x19')],this[_0x7dc9('0x1a')],this['dnid'],this['uniqueid']));this[_0x7dc9('0x1f')]=!![];}function getRoot(_0x5981e2){return parser['toJson'](_0x5981e2,{'object':!![]})[_0x7dc9('0x20')][_0x7dc9('0x21')];}function addVertex(_0x5e9525,_0xffc080,_0x43d31f){_0xffc080[_0x7dc9('0x22')]=_0x43d31f;if(_0xffc080['hasOwnProperty'](_0x7dc9('0x23'))){_0xffc080[_0x7dc9('0x24')]=parseInt(_0xffc080[_0x7dc9('0x23')],0xa);}_0x5e9525['addVertex'](_['omit'](_0xffc080,'mxCell'));}function initGraph(_0x25b383,_0x32d032){var _0x5843bf=new Graph();for(var _0x585eef in _0x25b383){if(_0x25b383[_0x7dc9('0x25')](_0x585eef)){if(_['isArray'](_0x25b383[_0x585eef])){for(var _0x2d22eb=0x0;_0x2d22eb<_0x25b383[_0x585eef][_0x7dc9('0x26')];_0x2d22eb+=0x1){addVertex(_0x5843bf,_0x25b383[_0x585eef][_0x2d22eb],_0x585eef);}}else{addVertex(_0x5843bf,_0x25b383[_0x585eef],_0x585eef);}}}for(var _0x3a74a0=0x0;_0x3a74a0<_0x32d032[_0x7dc9('0x26')];_0x3a74a0+=0x1){if(_0x32d032[_0x3a74a0][_0x7dc9('0x27')]&&_0x32d032[_0x3a74a0][_0x7dc9('0x28')]){_0x5843bf[_0x7dc9('0x29')](_0x32d032[_0x3a74a0][_0x7dc9('0x27')],_0x32d032[_0x3a74a0][_0x7dc9('0x28')],_0x32d032[_0x3a74a0][_0x7dc9('0x2a')]);}}return _0x5843bf;}function getSquareProject(_0x14083d,_0x2a456c){rpc['getSquareProject'](_0x14083d)['then'](function(_0x513dd6){_0x2a456c(null,_0x513dd6);})['catch'](function(_0x4a68f0){_0x2a456c(null,_0x4a68f0);});}function createSquareReport(_0x553a03,_0x58c4e8){rpc['createSquareReport'](_0x553a03)[_0x7dc9('0x2b')](function(_0x21c4c2){if(_0x58c4e8){_0x58c4e8(null,_0x21c4c2);}})[_0x7dc9('0x2c')](function(_0x225410){if(_0x58c4e8){_0x58c4e8(null,_0x225410);}});}function setChannelVariables(_0x3300ff){for(var _0x154e22 in _0x3300ff){if(_0x3300ff['hasOwnProperty'](_0x154e22)){if(_0x154e22['indexOf']('agi_')===0x0){_0x3300ff[_0x154e22[_0x7dc9('0x2d')](0x4)]=_0x3300ff[_0x154e22];delete _0x3300ff[_0x154e22];}}}}function getLogFromObject(_0x49ed97){return util[_0x7dc9('0x2e')](_0x49ed97,{'showHidden':![],'depth':null});}function agiHandler(_0x448e46){var _0x1298f9,_0x213066,_0x109c66,_0x165882,_0xbb11e1;logger[_0x7dc9('0x2f')]('variables',JSON[_0x7dc9('0x30')](_0x448e46,null,0x2));logger['info'](util[_0x7dc9('0x11')](_0x7dc9('0x31'),_0x448e46[_0x7dc9('0x18')],_0x448e46[_0x7dc9('0x19')],_0x448e46['callerid'],_0x448e46[_0x7dc9('0x1b')],_0x448e46['uniqueid']));_0x448e46['on'](_0x7dc9('0xc'),errorHandler);_0x448e46['on']('close',closeHandler);_0x448e46['on']('timeout',timeoutHandler);_0x448e46[_0x7dc9('0x1f')]=![];_0x448e46['on'](_0x7dc9('0x32'),hangupHandler);var _0x21e036=getSquareProject[_0x7dc9('0x33')](null,_0x448e46['arg_1']);if(_0x21e036){if(_0x21e036[_0x7dc9('0x34')]){_0x1298f9=getRoot(_0x21e036[_0x7dc9('0x34')]);if(_0x1298f9&&_0x1298f9[_0x7dc9('0x35')]){logger[_0x7dc9('0x2f')](_0x7dc9('0x21'),JSON[_0x7dc9('0x30')](_0x1298f9,null,0x2));_0x448e46[_0x7dc9('0x36')]=moment()[_0x7dc9('0x11')](_0x7dc9('0x37'));_0x213066=initGraph(_[_0x7dc9('0x38')](_0x1298f9,_0x7dc9('0x39')),_0x1298f9[_0x7dc9('0x39')]);_0x109c66=new Vertices(_0x448e46,rpc,mailRpc);logger['info'](util[_0x7dc9('0x11')](_0x7dc9('0x3a'),_0x448e46[_0x7dc9('0x18')],_0x448e46[_0x7dc9('0x19')],_0x448e46['callerid'],_0x448e46[_0x7dc9('0x1b')],_0x448e46[_0x7dc9('0x1c')]));_0x213066[_0x7dc9('0x3b')](_0x1298f9[_0x7dc9('0x35')]['id'],function(_0x295853){try{_0x295853=_0x109c66[_0x7dc9('0x3c')](_0x295853);logger['debug']('vertex',JSON[_0x7dc9('0x30')](_0x295853,null,0x2));if(_0x295853[_0x7dc9('0x22')]==='gotoc'){logger[_0x7dc9('0x10')]('gotoc\x20block\x20stop\x20traverse\x20BFS');_0x448e46[_0x7dc9('0x3d')]=_0x295853[_0x7dc9('0x3d')]||_0x448e46[_0x7dc9('0x3d')];_0x448e46['extension']=_0x295853[_0x7dc9('0x3e')];_0x448e46[_0x7dc9('0x3f')]=_0x295853[_0x7dc9('0x3f')]?_0x295853[_0x7dc9('0x3f')]-0x1:0x1;return null;}else if(_0x295853&&_0x109c66[_0x295853[_0x7dc9('0x22')]]){_0xbb11e1=_0x109c66[_0x295853[_0x7dc9('0x22')]](_0x295853);logger[_0x7dc9('0x10')]('response',JSON[_0x7dc9('0x30')](_0xbb11e1,null,0x2));if(_0xbb11e1&&_0xbb11e1['code']===AGI_CODE_SUCCESS&&_0xbb11e1['result']!==AGI_RESULT_ERROR&&!_0x448e46[_0x7dc9('0x1f')]){logger[_0x7dc9('0x2f')](_0x7dc9('0x40'),getLogFromObject(_0xbb11e1));return _[_0x7dc9('0x41')](_0xbb11e1[_0x7dc9('0x42')])?null:_0xbb11e1[_0x7dc9('0x42')][_0x7dc9('0x43')]();}else{logger[_0x7dc9('0xc')](_0x7dc9('0x40'),getLogFromObject(_0xbb11e1));return null;}}else{logger['error'](_0x7dc9('0x44'));return null;}}catch(_0x1971c7){logger[_0x7dc9('0xc')](_0x1971c7[_0x7dc9('0xd')]);return null;}});if(_0x1298f9[_0x7dc9('0x45')]){logger[_0x7dc9('0x10')](util['format'](_0x7dc9('0x46'),_0x448e46[_0x7dc9('0x18')],_0x448e46['calleridname'],_0x448e46[_0x7dc9('0x1a')],_0x448e46[_0x7dc9('0x1b')],_0x448e46[_0x7dc9('0x1c')]));_0x213066['traverseBFS'](_0x1298f9[_0x7dc9('0x45')]['id'],function(_0x5b3895){try{_0x5b3895=_0x109c66['clear'](_0x5b3895);logger[_0x7dc9('0x2f')](_0x7dc9('0x47'),JSON[_0x7dc9('0x30')](_0x5b3895,null,0x2));if(_0x5b3895&&_0x109c66[_0x5b3895['agicommand']]){_0xbb11e1=_0x109c66[_0x5b3895['agicommand']](_0x5b3895);if(_0xbb11e1){logger[_0x7dc9('0x2f')]('response',getLogFromObject(_0xbb11e1));return _[_0x7dc9('0x41')](_0xbb11e1[_0x7dc9('0x42')])?null:_0xbb11e1['result'][_0x7dc9('0x43')]();}else{logger[_0x7dc9('0xc')](_0x7dc9('0x40'),getLogFromObject(_0xbb11e1));return null;}}else{logger[_0x7dc9('0xc')](_0x7dc9('0x44'));return null;}}catch(_0x113087){logger[_0x7dc9('0xc')](_0x113087[_0x7dc9('0xd')]);return null;}});}logger[_0x7dc9('0x10')](util[_0x7dc9('0x11')](_0x7dc9('0x48'),_0x448e46[_0x7dc9('0x18')],_0x448e46[_0x7dc9('0x19')],_0x448e46['callerid'],_0x448e46[_0x7dc9('0x1b')],_0x448e46['uniqueid']));logger['info'](util[_0x7dc9('0x11')](_0x7dc9('0x49'),_0x448e46[_0x7dc9('0x3d')],_0x448e46[_0x7dc9('0x3e')],parseInt(_0x448e46[_0x7dc9('0x3f')],0xa)+0x1));_0x448e46['continueAt'](_0x448e46[_0x7dc9('0x3d')],_0x448e46[_0x7dc9('0x3e')],parseInt(_0x448e46[_0x7dc9('0x3f')],0xa)+0x1);_0x448e46['close']();}}else{logger[_0x7dc9('0xc')](util[_0x7dc9('0x11')](_0x7dc9('0x4a'),_0x448e46[_0x7dc9('0x18')]));_0x448e46[_0x7dc9('0x4b')](_0x448e46[_0x7dc9('0x3d')],_0x448e46['extension'],parseInt(_0x448e46[_0x7dc9('0x3f')],0xa)+0x1);_0x448e46[_0x7dc9('0x4c')]();}}else{logger[_0x7dc9('0xc')](util[_0x7dc9('0x11')](_0x7dc9('0x4d'),_0x448e46[_0x7dc9('0x18')]));_0x448e46[_0x7dc9('0x4b')](_0x448e46[_0x7dc9('0x3d')],_0x448e46[_0x7dc9('0x3e')],parseInt(_0x448e46[_0x7dc9('0x3f')],0xa)+0x1);_0x448e46[_0x7dc9('0x4c')]();}}function main(){var _0x3819e5;return utilLicense['getLicense']()[_0x7dc9('0x2b')](function(_0x39be46){if(_0x39be46){if(_0x39be46[_0x7dc9('0x4e')]){if(_0x39be46[_0x7dc9('0x4f')]&&_0x39be46[_0x7dc9('0x4f')]>0x0){logger['info'](util[_0x7dc9('0x11')](_0x7dc9('0x50'),_0x39be46[_0x7dc9('0x4f')]));_0x3819e5=_0x39be46[_0x7dc9('0x4f')];}else{logger[_0x7dc9('0x10')](_0x7dc9('0x51'));}}else{logger['info']('[LICENSE]\x20VOICE\x20IS\x20DISABLED');_0x3819e5=-0x1;}}})['catch'](function(_0x25bdee){logger[_0x7dc9('0xc')](_0x7dc9('0x52'),_0x25bdee[_0x7dc9('0xd')]);})['finally'](function(){var _0x5a6cfe=require(_0x7dc9('0x53'))(config[_0x7dc9('0x5')][_0x7dc9('0xf')],config[_0x7dc9('0x5')]['ip'],_0x3819e5);_0x5a6cfe['on'](_0x7dc9('0xc'),errorHandler);_0x5a6cfe['on'](_0x7dc9('0x54'),listeningHandler);_0x5a6cfe['on'](_0x7dc9('0x55'),connectionHandler);_0x5a6cfe['on']('close',closeHandler);});}main();
\ No newline at end of file
+var _0xed1f=['[GOTO]\x20context:\x20%s\x20extension:\x20%s\x20priority:\x20%s','continueAt','Project\x20%s\x20not\x20published','close','getLicense','voice','callysquare','[LICENSE]\x20CHANNELS:\x20%s','[LICENSE]\x20CHANNELS:\x20UNLIMITED','[LICENSE]\x20VOICE\x20IS\x20DISABLED','[LICENSE]','./server','listening','xml2json','lodash','syncho','util','moment','../../config/environment','../../config/logger','agi','../../config/license/util','./rpc','./mailRpc','./graph','./vertices','defaults','127.0.0.1','error','log','Cally\x20Square\x20server\x20listening\x20on\x20port\x20%d!','port','format','[LISTENING]\x20Cally\x20Square\x20listening\x20%s:%d','message','[%s]\x20%s','name','stack','info','[CLOSE]\x20%s\x20project:\x20from\x20\x22%s\x22\x20<%s>\x20to\x20extension\x20%s\x20with\x20uniqueid\x20%s','calleridname','dnid','uniqueid','arg_1','callerid','evtHangup','toJson','mxGraphModel','root','agicommand','hasOwnProperty','retry','maxRetry','addVertex','mxCell','isArray','length','target','value','getSquareProject','then','catch','createSquareReport','indexOf','substring','inspect','debug','variables','stringify','[START]\x20%s\x20project:\x20from\x20\x22%s\x22\x20<%s>\x20to\x20extension\x20%s\x20with\x20uniqueid\x20%s','hangup','sync','production','start','joinAt','YYYY-MM-DD\x20HH:mm:ss','omit','[START\x20TRAVERSE]\x20%s\x20project:\x20from\x20\x22%s\x22\x20<%s>\x20to\x20extension\x20%s\x20with\x20uniqueid\x20%s','traverseBFS','gotoc','gotoc\x20block\x20stop\x20traverse\x20BFS','context','extension','priority','response','code','result','toString','agicommand\x20not\x20found','finally','clear','isUndefined','[END]\x20%s\x20project:\x20from\x20\x22%s\x22\x20<%s>\x20to\x20extension\x20%s\x20with\x20uniqueid\x20%s'];(function(_0x39690b,_0x41a11b){var _0x133a33=function(_0x56106a){while(--_0x56106a){_0x39690b['push'](_0x39690b['shift']());}};_0x133a33(++_0x41a11b);}(_0xed1f,0x6a));var _0xfed1=function(_0x3fba9f,_0x3b7b9b){_0x3fba9f=_0x3fba9f-0x0;var _0x192cf1=_0xed1f[_0x3fba9f];return _0x192cf1;};'use strict';var parser=require(_0xfed1('0x0'));var _=require(_0xfed1('0x1'));var syncho=require(_0xfed1('0x2'));var util=require(_0xfed1('0x3'));var moment=require(_0xfed1('0x4'));var config=require(_0xfed1('0x5'));var logger=require(_0xfed1('0x6'))(_0xfed1('0x7'));var utilLicense=require(_0xfed1('0x8'));var rpc=require(_0xfed1('0x9'));var mailRpc=require(_0xfed1('0xa'));var Graph=require(_0xfed1('0xb'));var Vertices=require(_0xfed1('0xc'));var AGI_CODE_SUCCESS=0xc8;var AGI_RESULT_ERROR=-0x1;config[_0xfed1('0x7')]=_[_0xfed1('0xd')](config[_0xfed1('0x7')],{'ip':_0xfed1('0xe'),'port':0x11dd});function connectionHandler(_0x2967ef){process['nextTick'](function(){syncho(function(){try{setChannelVariables(_0x2967ef);agiHandler(_0x2967ef);}catch(_0x42dd5c){logger[_0xfed1('0xf')](_0x42dd5c['stack']);}});});}function listeningHandler(){console[_0xfed1('0x10')](_0xfed1('0x11'),config['agi'][_0xfed1('0x12')]);logger['info'](util[_0xfed1('0x13')](_0xfed1('0x14'),config['agi']['ip'],config['agi'][_0xfed1('0x12')]));}function errorHandler(_0xe84ba6){if(_0xe84ba6&&_0xe84ba6['name']&&_0xe84ba6[_0xfed1('0x15')]){logger['error'](util['format'](_0xfed1('0x16'),_0xe84ba6[_0xfed1('0x17')],_0xe84ba6['message']));}else{logger[_0xfed1('0xf')](util['format']('[ERROR]\x20%s',_0xe84ba6[_0xfed1('0x18')]));}}function closeHandler(){logger[_0xfed1('0x19')](util[_0xfed1('0x13')](_0xfed1('0x1a'),this['arg_1'],this[_0xfed1('0x1b')],this['callerid'],this[_0xfed1('0x1c')],this[_0xfed1('0x1d')]));try{createSquareReport(this);}catch(_0x489a0f){logger[_0xfed1('0xf')](_0x489a0f[_0xfed1('0x18')]);}}function timeoutHandler(){logger['info'](util['format']('[TIMEOUT]\x20%s\x20project:\x20from\x20\x22%s\x22\x20<%s>\x20to\x20extension\x20%s\x20with\x20uniqueid\x20%s',this[_0xfed1('0x1e')],this['calleridname'],this[_0xfed1('0x1f')],this[_0xfed1('0x1c')],this['uniqueid']));}function hangupHandler(){logger[_0xfed1('0x19')](util[_0xfed1('0x13')]('[HANGUP]\x20%s\x20project:\x20from\x20\x22%s\x22\x20<%s>\x20to\x20extension\x20%s\x20with\x20uniqueid\x20%s',this[_0xfed1('0x1e')],this[_0xfed1('0x1b')],this[_0xfed1('0x1f')],this[_0xfed1('0x1c')],this['uniqueid']));this[_0xfed1('0x20')]=!![];}function getRoot(_0x59333e){return parser[_0xfed1('0x21')](_0x59333e,{'object':!![]})[_0xfed1('0x22')][_0xfed1('0x23')];}function addVertex(_0x532ec2,_0x41d22c,_0x594917){_0x41d22c[_0xfed1('0x24')]=_0x594917;if(_0x41d22c[_0xfed1('0x25')](_0xfed1('0x26'))){_0x41d22c[_0xfed1('0x27')]=parseInt(_0x41d22c[_0xfed1('0x26')],0xa);}_0x532ec2[_0xfed1('0x28')](_['omit'](_0x41d22c,_0xfed1('0x29')));}function initGraph(_0xcb1cdc,_0x49072b){var _0x1d6c72=new Graph();for(var _0x2b9dd2 in _0xcb1cdc){if(_0xcb1cdc[_0xfed1('0x25')](_0x2b9dd2)){if(_[_0xfed1('0x2a')](_0xcb1cdc[_0x2b9dd2])){for(var _0x3b9122=0x0;_0x3b9122<_0xcb1cdc[_0x2b9dd2][_0xfed1('0x2b')];_0x3b9122+=0x1){addVertex(_0x1d6c72,_0xcb1cdc[_0x2b9dd2][_0x3b9122],_0x2b9dd2);}}else{addVertex(_0x1d6c72,_0xcb1cdc[_0x2b9dd2],_0x2b9dd2);}}}for(var _0x583953=0x0;_0x583953<_0x49072b[_0xfed1('0x2b')];_0x583953+=0x1){if(_0x49072b[_0x583953]['source']&&_0x49072b[_0x583953][_0xfed1('0x2c')]){_0x1d6c72['addEdge'](_0x49072b[_0x583953]['source'],_0x49072b[_0x583953][_0xfed1('0x2c')],_0x49072b[_0x583953][_0xfed1('0x2d')]);}}return _0x1d6c72;}function getSquareProject(_0x2d334e,_0x599c23){rpc[_0xfed1('0x2e')](_0x2d334e)[_0xfed1('0x2f')](function(_0x13f414){_0x599c23(null,_0x13f414);})[_0xfed1('0x30')](function(_0x12399f){_0x599c23(null,_0x12399f);});}function createSquareReport(_0x30272b,_0x5ccc3a){rpc[_0xfed1('0x31')](_0x30272b)[_0xfed1('0x2f')](function(_0x4fc309){if(_0x5ccc3a){_0x5ccc3a(null,_0x4fc309);}})['catch'](function(_0x28bd98){if(_0x5ccc3a){_0x5ccc3a(null,_0x28bd98);}});}function setChannelVariables(_0x2d10f5){for(var _0x2def09 in _0x2d10f5){if(_0x2d10f5[_0xfed1('0x25')](_0x2def09)){if(_0x2def09[_0xfed1('0x32')]('agi_')===0x0){_0x2d10f5[_0x2def09[_0xfed1('0x33')](0x4)]=_0x2d10f5[_0x2def09];delete _0x2d10f5[_0x2def09];}}}}function getLogFromObject(_0x21b292){return util[_0xfed1('0x34')](_0x21b292,{'showHidden':![],'depth':null});}function agiHandler(_0x349de1){var _0xa4c53c,_0x4fde94,_0x1da4b7,_0x4a81be,_0x11c5bd;logger[_0xfed1('0x35')](_0xfed1('0x36'),JSON[_0xfed1('0x37')](_0x349de1,null,0x2));logger[_0xfed1('0x19')](util[_0xfed1('0x13')](_0xfed1('0x38'),_0x349de1[_0xfed1('0x1e')],_0x349de1['calleridname'],_0x349de1[_0xfed1('0x1f')],_0x349de1[_0xfed1('0x1c')],_0x349de1[_0xfed1('0x1d')]));_0x349de1['on'](_0xfed1('0xf'),errorHandler);_0x349de1['on']('close',closeHandler);_0x349de1['on']('timeout',timeoutHandler);_0x349de1[_0xfed1('0x20')]=![];_0x349de1['on'](_0xfed1('0x39'),hangupHandler);var _0x1d06af=getSquareProject[_0xfed1('0x3a')](null,_0x349de1[_0xfed1('0x1e')]);if(_0x1d06af){if(_0x1d06af[_0xfed1('0x3b')]){_0xa4c53c=getRoot(_0x1d06af[_0xfed1('0x3b')]);if(_0xa4c53c&&_0xa4c53c[_0xfed1('0x3c')]){logger['debug']('root',JSON[_0xfed1('0x37')](_0xa4c53c,null,0x2));_0x349de1[_0xfed1('0x3d')]=moment()['format'](_0xfed1('0x3e'));_0x4fde94=initGraph(_[_0xfed1('0x3f')](_0xa4c53c,_0xfed1('0x29')),_0xa4c53c[_0xfed1('0x29')]);_0x1da4b7=new Vertices(_0x349de1,rpc,mailRpc);logger[_0xfed1('0x19')](util[_0xfed1('0x13')](_0xfed1('0x40'),_0x349de1[_0xfed1('0x1e')],_0x349de1[_0xfed1('0x1b')],_0x349de1['callerid'],_0x349de1['dnid'],_0x349de1['uniqueid']));_0x4fde94[_0xfed1('0x41')](_0xa4c53c[_0xfed1('0x3c')]['id'],function(_0x2f8f08){try{_0x2f8f08=_0x1da4b7['clear'](_0x2f8f08);logger[_0xfed1('0x35')]('vertex',JSON[_0xfed1('0x37')](_0x2f8f08,null,0x2));if(_0x2f8f08[_0xfed1('0x24')]===_0xfed1('0x42')){logger['info'](_0xfed1('0x43'));_0x349de1[_0xfed1('0x44')]=_0x2f8f08[_0xfed1('0x44')]||_0x349de1['context'];_0x349de1[_0xfed1('0x45')]=_0x2f8f08['extension'];_0x349de1[_0xfed1('0x46')]=_0x2f8f08[_0xfed1('0x46')]?_0x2f8f08[_0xfed1('0x46')]-0x1:0x1;return null;}else if(_0x2f8f08&&_0x1da4b7[_0x2f8f08[_0xfed1('0x24')]]){_0x11c5bd=_0x1da4b7[_0x2f8f08[_0xfed1('0x24')]](_0x2f8f08);logger[_0xfed1('0x19')](_0xfed1('0x47'),JSON[_0xfed1('0x37')](_0x11c5bd,null,0x2));if(_0x11c5bd&&_0x11c5bd[_0xfed1('0x48')]===AGI_CODE_SUCCESS&&_0x11c5bd['result']!==AGI_RESULT_ERROR&&!_0x349de1[_0xfed1('0x20')]){logger[_0xfed1('0x35')](_0xfed1('0x47'),getLogFromObject(_0x11c5bd));return _['isUndefined'](_0x11c5bd['result'])?null:_0x11c5bd[_0xfed1('0x49')][_0xfed1('0x4a')]();}else{logger[_0xfed1('0xf')](_0xfed1('0x47'),getLogFromObject(_0x11c5bd));return null;}}else{logger[_0xfed1('0xf')](_0xfed1('0x4b'));return null;}}catch(_0x2547ee){logger[_0xfed1('0xf')](_0x2547ee[_0xfed1('0x18')]);return null;}});if(_0xa4c53c[_0xfed1('0x4c')]){logger[_0xfed1('0x19')](util[_0xfed1('0x13')]('[FINALLY\x20TRAVERSE]\x20%s\x20project:\x20from\x20\x22%s\x22\x20<%s>\x20to\x20extension\x20%s\x20with\x20uniqueid\x20%s',_0x349de1[_0xfed1('0x1e')],_0x349de1[_0xfed1('0x1b')],_0x349de1[_0xfed1('0x1f')],_0x349de1[_0xfed1('0x1c')],_0x349de1[_0xfed1('0x1d')]));_0x4fde94[_0xfed1('0x41')](_0xa4c53c['finally']['id'],function(_0x1dd879){try{_0x1dd879=_0x1da4b7[_0xfed1('0x4d')](_0x1dd879);logger[_0xfed1('0x35')]('vertex',JSON[_0xfed1('0x37')](_0x1dd879,null,0x2));if(_0x1dd879&&_0x1da4b7[_0x1dd879[_0xfed1('0x24')]]){_0x11c5bd=_0x1da4b7[_0x1dd879[_0xfed1('0x24')]](_0x1dd879);if(_0x11c5bd){logger[_0xfed1('0x35')]('response',getLogFromObject(_0x11c5bd));return _[_0xfed1('0x4e')](_0x11c5bd[_0xfed1('0x49')])?null:_0x11c5bd[_0xfed1('0x49')][_0xfed1('0x4a')]();}else{logger[_0xfed1('0xf')](_0xfed1('0x47'),getLogFromObject(_0x11c5bd));return null;}}else{logger[_0xfed1('0xf')](_0xfed1('0x4b'));return null;}}catch(_0x2365db){logger[_0xfed1('0xf')](_0x2365db[_0xfed1('0x18')]);return null;}});}logger[_0xfed1('0x19')](util[_0xfed1('0x13')](_0xfed1('0x4f'),_0x349de1[_0xfed1('0x1e')],_0x349de1[_0xfed1('0x1b')],_0x349de1[_0xfed1('0x1f')],_0x349de1[_0xfed1('0x1c')],_0x349de1['uniqueid']));logger['info'](util[_0xfed1('0x13')](_0xfed1('0x50'),_0x349de1[_0xfed1('0x44')],_0x349de1[_0xfed1('0x45')],parseInt(_0x349de1['priority'],0xa)+0x1));_0x349de1[_0xfed1('0x51')](_0x349de1[_0xfed1('0x44')],_0x349de1['extension'],parseInt(_0x349de1['priority'],0xa)+0x1);_0x349de1['close']();}}else{logger[_0xfed1('0xf')](util[_0xfed1('0x13')](_0xfed1('0x52'),_0x349de1[_0xfed1('0x1e')]));_0x349de1[_0xfed1('0x51')](_0x349de1[_0xfed1('0x44')],_0x349de1[_0xfed1('0x45')],parseInt(_0x349de1[_0xfed1('0x46')],0xa)+0x1);_0x349de1[_0xfed1('0x53')]();}}else{logger[_0xfed1('0xf')](util['format']('Project\x20%s\x20not\x20found',_0x349de1[_0xfed1('0x1e')]));_0x349de1[_0xfed1('0x51')](_0x349de1[_0xfed1('0x44')],_0x349de1[_0xfed1('0x45')],parseInt(_0x349de1[_0xfed1('0x46')],0xa)+0x1);_0x349de1[_0xfed1('0x53')]();}}function main(){var _0x122702;return utilLicense[_0xfed1('0x54')]()[_0xfed1('0x2f')](function(_0x427fa6){if(_0x427fa6){if(_0x427fa6[_0xfed1('0x55')]){if(_0x427fa6[_0xfed1('0x56')]&&_0x427fa6[_0xfed1('0x56')]>0x0){logger[_0xfed1('0x19')](util[_0xfed1('0x13')](_0xfed1('0x57'),_0x427fa6[_0xfed1('0x56')]));_0x122702=_0x427fa6['callysquare'];}else{logger['info'](_0xfed1('0x58'));}}else{logger[_0xfed1('0x19')](_0xfed1('0x59'));_0x122702=-0x1;}}})[_0xfed1('0x30')](function(_0x23a4f0){logger[_0xfed1('0xf')](_0xfed1('0x5a'),_0x23a4f0[_0xfed1('0x18')]);})[_0xfed1('0x4c')](function(){var _0x1f2250=require(_0xfed1('0x5b'))(config[_0xfed1('0x7')][_0xfed1('0x12')],config[_0xfed1('0x7')]['ip'],_0x122702);_0x1f2250['on']('error',errorHandler);_0x1f2250['on'](_0xfed1('0x5c'),listeningHandler);_0x1f2250['on']('connection',connectionHandler);_0x1f2250['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 2c54d3b..0d44f5e 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 _0x9957=['result','catch','sendMailMessage','SendMail','bluebird','jayson/promise','client','http','request','error','message'];(function(_0x382157,_0x3c9d8a){var _0x1f0568=function(_0x2faef2){while(--_0x2faef2){_0x382157['push'](_0x382157['shift']());}};_0x1f0568(++_0x3c9d8a);}(_0x9957,0x93));var _0x7995=function(_0x5ddb1c,_0x5ea4df){_0x5ddb1c=_0x5ddb1c-0x0;var _0x354adc=_0x9957[_0x5ddb1c];return _0x354adc;};'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
+var _0x814b=['bluebird','jayson/promise','client','http','request','then','error','result','catch','sendMailMessage','SendMail'];(function(_0x287ecf,_0x2afd02){var _0x5514f3=function(_0xaf56c0){while(--_0xaf56c0){_0x287ecf['push'](_0x287ecf['shift']());}};_0x5514f3(++_0x2afd02);}(_0x814b,0x1a2));var _0xb814=function(_0x173441,_0x26b0d9){_0x173441=_0x173441-0x0;var _0x2423a8=_0x814b[_0x173441];return _0x2423a8;};'use strict';var BPromise=require(_0xb814('0x0'));var jayson=require(_0xb814('0x1'));var client=jayson[_0xb814('0x2')][_0xb814('0x3')]({'port':0x232b});function request(_0xfbb64b,_0x477725){return new BPromise(function(_0x4a98af,_0x38c21a){return client[_0xb814('0x4')](_0xfbb64b,_0x477725)[_0xb814('0x5')](function(_0x4237bc){if(_0x4237bc[_0xb814('0x6')]){return _0x38c21a(_0x4237bc[_0xb814('0x6')]['message']);}else{return _0x4a98af(_0x4237bc[_0xb814('0x7')]);}})[_0xb814('0x8')](function(_0x5c8539){return _0x38c21a(_0x5c8539);});});}exports[_0xb814('0x9')]=function(_0x2913a6,_0x186d5a){return request(_0xb814('0xa'),{'account':_0x2913a6,'message':_0x186d5a});};
\ No newline at end of file
diff --git a/server/services/agi/reply.js b/server/services/agi/reply.js
index 50bbcb3..ec11e3a 100644
--- a/server/services/agi/reply.js
+++ b/server/services/agi/reply.js
@@ -15,4 +15,4 @@
// * treaties. The SOFTWARE PRODUCT is licensed, not sold. *
// * *
// *************************************************************************
-var _0x7a54=['substring','length','split','indexOf','slice','trim','emit','util','stream','Transform','call','_localBuffer','inherits','prototype','_transform','toString','_inBody'];(function(_0x583033,_0x37f452){var _0x4f94da=function(_0x14fd08){while(--_0x14fd08){_0x583033['push'](_0x583033['shift']());}};_0x4f94da(++_0x37f452);}(_0x7a54,0x106));var _0x47a5=function(_0x359b10,_0x542706){_0x359b10=_0x359b10-0x0;var _0x31ad6b=_0x7a54[_0x359b10];return _0x31ad6b;};'use strict';var util=require(_0x47a5('0x0'));var Transform=require(_0x47a5('0x1'))[_0x47a5('0x2')];function AGIReply(_0x58157c){Transform[_0x47a5('0x3')](this,_0x58157c);this[_0x47a5('0x4')]='';this['_inBody']=![];}util[_0x47a5('0x5')](AGIReply,Transform);AGIReply[_0x47a5('0x6')][_0x47a5('0x7')]=function(_0x3717e1,_0xfdf934,_0x545a97){var _0x3d5629='\x0a',_0x59199c=['\x0a\x0a','\x0d\x0a\x0d\x0a'],_0x343372=-0x1,_0x30e405=-0x1,_0x506eda='',_0x194fb0=0x0,_0x5077f3='',_0x5d90b3='';this[_0x47a5('0x4')]+=_0x3717e1[_0x47a5('0x8')]();_0x5077f3=this['_localBuffer'];if(!this[_0x47a5('0x9')]){_0x194fb0=0x0;while(_0x59199c[_0x194fb0]){while((_0x30e405=_0x5077f3['indexOf'](_0x59199c[_0x194fb0]))!=-0x1){_0x506eda=_0x59199c[_0x194fb0];_0x5d90b3=_0x5077f3['substring'](0x0,_0x30e405);_0x5077f3=_0x5077f3[_0x47a5('0xa')](_0x30e405+_0x506eda[_0x47a5('0xb')]);var _0x2f399b=_0x5d90b3[_0x47a5('0xc')](_0x3d5629),_0x250fad=0x0,_0xd612dd={},_0xd308b8='',_0x1eae59='',_0x5beb89=-0x1;while(_0x2f399b[_0x250fad]){_0x5beb89=_0x2f399b[_0x250fad][_0x47a5('0xd')](':');if(_0x5beb89!=-0x1){_0xd308b8=_0x2f399b[_0x250fad][_0x47a5('0xe')](0x0,_0x5beb89)[_0x47a5('0xf')]();_0x1eae59=_0x2f399b[_0x250fad][_0x47a5('0xe')](_0x5beb89+0x1)[_0x47a5('0xf')]();if(_0xd308b8[_0x47a5('0xb')]>0x0){_0xd612dd[_0xd308b8]=_0x1eae59;}}else{}_0x250fad++;}this[_0x47a5('0x10')]('headers',_0xd612dd);this[_0x47a5('0x9')]=!![];}_0x194fb0++;}this[_0x47a5('0x4')]=_0x5077f3;}else{while((_0x343372=_0x5077f3[_0x47a5('0xd')](_0x3d5629))!=-0x1){_0x5d90b3=_0x5077f3[_0x47a5('0xa')](0x0,_0x343372);this[_0x47a5('0x10')]('line',_0x5d90b3);_0x5077f3=_0x5077f3['substring'](_0x343372+_0x3d5629[_0x47a5('0xb')]);}this['_localBuffer']=_0x5077f3;}_0x545a97();};module['exports']=AGIReply;
\ No newline at end of file
+var _0x5f2f=['exports','util','stream','Transform','call','_localBuffer','_inBody','inherits','\x0d\x0a\x0d\x0a','toString','substring','length','split','slice','trim','headers','indexOf','emit','line'];(function(_0x4370f0,_0x1331f7){var _0x21c39e=function(_0x5dba63){while(--_0x5dba63){_0x4370f0['push'](_0x4370f0['shift']());}};_0x21c39e(++_0x1331f7);}(_0x5f2f,0x73));var _0xf5f2=function(_0x521500,_0x4cc29f){_0x521500=_0x521500-0x0;var _0x4c0a73=_0x5f2f[_0x521500];return _0x4c0a73;};'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 7c281da..47ba7aa 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 _0xc25d=['LoginUser','PauseUser','agentUnpause','UnpauseUser','util','jayson/promise','http','then','error','message','result','ShowSquareProject','production','getMailAccountById','MailServerOut','name','getSquareProjectById','getVoiceQueueById','ShowVoiceQueue','getVariableById','ShowVariable','getSquareOdbcById','ShowUser','ShowSound','save_name','getIntervalById','ShowInterval','Intervals','getSmsAccountById','ShowSmsAccount','createSmsMessage','CreateSmsMessage','CreateSquareDetailsReport','createSquareReport','CreateSquareReport','arg_1','arg_2','format','YYYY-MM-DD\x20HH:mm:ss','createSquareRecording','CreateSquareRecording','createSquareMessage','createCmContact','ShowCmHopper','phone','CreateCmContact','getPauseById','ShowPause','agentLogin'];(function(_0x10f78f,_0x6467c5){var _0x1857a7=function(_0x186857){while(--_0x186857){_0x10f78f['push'](_0x10f78f['shift']());}};_0x1857a7(++_0x6467c5);}(_0xc25d,0x1ee));var _0xdc25=function(_0x4e170e,_0x207e58){_0x4e170e=_0x4e170e-0x0;var _0x338291=_0xc25d[_0x4e170e];return _0x338291;};'use strict';var BPromise=require('bluebird');var moment=require('moment');var _=require('lodash');var util=require(_0xdc25('0x0'));var jayson=require(_0xdc25('0x1'));var client=jayson['client'][_0xdc25('0x2')]({'port':0x2329});function request(_0x5ecfae,_0x284c81){return new BPromise(function(_0x599a0b,_0x5305d5){return client['request'](_0x5ecfae,_0x284c81)[_0xdc25('0x3')](function(_0xb06b60){if(_0xb06b60[_0xdc25('0x4')]){return _0x5305d5(_0xb06b60[_0xdc25('0x4')][_0xdc25('0x5')]);}else{return _0x599a0b(_0xb06b60[_0xdc25('0x6')]);}})['catch'](function(_0x3ad709){return _0x5305d5(_0x3ad709);});});}exports['getSquareProject']=function(_0x5c6931){return request(_0xdc25('0x7'),{'options':{'raw':![],'where':{'name':_0x5c6931},'attributes':[_0xdc25('0x8')]}});};exports[_0xdc25('0x9')]=function(_0x3b7b1b){return request('ShowMailAccount',{'options':{'raw':![],'where':{'id':_0x3b7b1b},'include':[{'model':_0xdc25('0xa'),'as':'Smtp'}],'attributes':['id',_0xdc25('0xb'),'email']}});};exports[_0xdc25('0xc')]=function(_0x1f379b){return request(_0xdc25('0x7'),{'options':{'where':{'id':_0x1f379b},'attributes':[_0xdc25('0xb')]}});};exports[_0xdc25('0xd')]=function(_0x27d478){return request(_0xdc25('0xe'),{'options':{'where':{'id':_0x27d478},'attributes':[_0xdc25('0xb')]}});};exports[_0xdc25('0xf')]=function(_0x1c20aa){return request(_0xdc25('0x10'),{'options':{'where':{'id':_0x1c20aa},'attributes':[_0xdc25('0xb')]}});};exports[_0xdc25('0x11')]=function(_0x9b5078){return request('ShowSquareOdbc',{'options':{'where':{'id':_0x9b5078},'attributes':['dsn']}});};exports['getUserById']=function(_0x1a796b){return request(_0xdc25('0x12'),{'options':{'where':{'id':_0x1a796b},'attributes':['name']}});};exports['getTrunkById']=function(_0x5f218d){return request('ShowTrunk',{'options':{'where':{'id':_0x5f218d},'attributes':['name']}});};exports['getSoundById']=function(_0x5b3faa){return request(_0xdc25('0x13'),{'options':{'where':{'id':_0x5b3faa},'attributes':[_0xdc25('0x14')]}});};exports[_0xdc25('0x15')]=function(_0xfa55fa){return request(_0xdc25('0x16'),{'options':{'raw':![],'where':{'id':_0xfa55fa},'include':[{'model':'Interval','as':_0xdc25('0x17')}]}});};exports[_0xdc25('0x18')]=function(_0x79aed4){return request(_0xdc25('0x19'),{'options':{'where':{'id':_0x79aed4},'attributes':['id',_0xdc25('0xb')]}});};exports[_0xdc25('0x1a')]=function(_0x513591){return request(_0xdc25('0x1b'),{'body':_0x513591});};exports['createSquareDetailsReport']=function(_0x191497){return request(_0xdc25('0x1c'),{'body':_0x191497});};exports[_0xdc25('0x1d')]=function(_0x2030f6){return request(_0xdc25('0x1e'),{'body':_['merge'](_0x2030f6,{'project_name':_0x2030f6[_0xdc25('0x1f')],'prev_project_name':_0x2030f6[_0xdc25('0x20')]||'','is_subproject':_0x2030f6[_0xdc25('0x20')]?!![]:![],'leaveAt':moment()[_0xdc25('0x21')](_0xdc25('0x22'))})});};exports[_0xdc25('0x23')]=function(_0x5150cc){return request(_0xdc25('0x24'),{'body':_0x5150cc});};exports[_0xdc25('0x25')]=function(_0x3ce867){return request('CreateSquareMessage',{'body':_0x3ce867});};exports[_0xdc25('0x26')]=function(_0x28be18){return request(_0xdc25('0x27'),{'options':{'raw':![],'where':{'phone':_0x28be18[_0xdc25('0x28')],'ListId':_0x28be18['ListId']}}})[_0xdc25('0x3')](function(_0x43dcb1){if(_0x43dcb1){return _0x43dcb1;}return request(_0xdc25('0x29'),{'body':_0x28be18});});};exports[_0xdc25('0x2a')]=function(_0x287a40){return request(_0xdc25('0x2b'),{'options':{'where':{'id':_0x287a40},'attributes':[_0xdc25('0xb')]}});};exports[_0xdc25('0x2c')]=function(_0x3fe3a5,_0x472d5f){return request(_0xdc25('0x2d'),{'body':{'interface':_0x472d5f},'options':{'where':_0x3fe3a5}});};exports['agentPause']=function(_0x3d8608,_0x558f89,_0x6cbdf8){return request(_0xdc25('0x2e'),{'body':{'type':_0x558f89,'uniqueid':_0x6cbdf8},'options':{'where':_0x3d8608}});};exports[_0xdc25('0x2f')]=function(_0x534356){return request(_0xdc25('0x30'),{'body':{},'options':{'where':_0x534356}});};exports['agentLogout']=function(_0x1aab43){return request('LogoutUser',{'body':{},'options':{'where':_0x1aab43}});};
\ No newline at end of file
+var _0x4c7a=['ShowInterval','getSmsAccountById','CreateSmsMessage','createSquareDetailsReport','CreateSquareDetailsReport','createSquareReport','CreateSquareReport','merge','arg_1','arg_2','CreateSquareRecording','createSquareMessage','CreateSquareMessage','createCmContact','ListId','then','CreateCmContact','getPauseById','agentLogin','PauseUser','agentUnpause','agentLogout','LogoutUser','bluebird','moment','lodash','util','jayson/promise','client','http','request','error','message','result','getSquareProject','ShowSquareProject','production','getMailAccountById','ShowMailAccount','MailServerOut','name','email','getSquareProjectById','getVoiceQueueById','ShowVoiceQueue','ShowVariable','getSquareOdbcById','ShowSquareOdbc','dsn','getUserById','ShowUser','ShowTrunk','getSoundById','save_name'];(function(_0x2da3b9,_0x34705d){var _0x42eb65=function(_0x1c4d12){while(--_0x1c4d12){_0x2da3b9['push'](_0x2da3b9['shift']());}};_0x42eb65(++_0x34705d);}(_0x4c7a,0x125));var _0xa4c7=function(_0x25e4a0,_0x5c7774){_0x25e4a0=_0x25e4a0-0x0;var _0x470799=_0x4c7a[_0x25e4a0];return _0x470799;};'use strict';var BPromise=require(_0xa4c7('0x0'));var moment=require(_0xa4c7('0x1'));var _=require(_0xa4c7('0x2'));var util=require(_0xa4c7('0x3'));var jayson=require(_0xa4c7('0x4'));var client=jayson[_0xa4c7('0x5')][_0xa4c7('0x6')]({'port':0x2329});function request(_0x18761f,_0x4e4a11){return new BPromise(function(_0x35b6f5,_0x3c6825){return client[_0xa4c7('0x7')](_0x18761f,_0x4e4a11)['then'](function(_0x450e60){if(_0x450e60[_0xa4c7('0x8')]){return _0x3c6825(_0x450e60[_0xa4c7('0x8')][_0xa4c7('0x9')]);}else{return _0x35b6f5(_0x450e60[_0xa4c7('0xa')]);}})['catch'](function(_0x35db6e){return _0x3c6825(_0x35db6e);});});}exports[_0xa4c7('0xb')]=function(_0x20cc5d){return request(_0xa4c7('0xc'),{'options':{'raw':![],'where':{'name':_0x20cc5d},'attributes':[_0xa4c7('0xd')]}});};exports[_0xa4c7('0xe')]=function(_0x112fbc){return request(_0xa4c7('0xf'),{'options':{'raw':![],'where':{'id':_0x112fbc},'include':[{'model':_0xa4c7('0x10'),'as':'Smtp'}],'attributes':['id',_0xa4c7('0x11'),_0xa4c7('0x12')]}});};exports[_0xa4c7('0x13')]=function(_0x2fb9ed){return request(_0xa4c7('0xc'),{'options':{'where':{'id':_0x2fb9ed},'attributes':[_0xa4c7('0x11')]}});};exports[_0xa4c7('0x14')]=function(_0xc22791){return request(_0xa4c7('0x15'),{'options':{'where':{'id':_0xc22791},'attributes':[_0xa4c7('0x11')]}});};exports['getVariableById']=function(_0x51834f){return request(_0xa4c7('0x16'),{'options':{'where':{'id':_0x51834f},'attributes':[_0xa4c7('0x11')]}});};exports[_0xa4c7('0x17')]=function(_0x3523e8){return request(_0xa4c7('0x18'),{'options':{'where':{'id':_0x3523e8},'attributes':[_0xa4c7('0x19')]}});};exports[_0xa4c7('0x1a')]=function(_0x52ec3b){return request(_0xa4c7('0x1b'),{'options':{'where':{'id':_0x52ec3b},'attributes':[_0xa4c7('0x11')]}});};exports['getTrunkById']=function(_0x31c1c3){return request(_0xa4c7('0x1c'),{'options':{'where':{'id':_0x31c1c3},'attributes':[_0xa4c7('0x11')]}});};exports[_0xa4c7('0x1d')]=function(_0x1c4d4a){return request('ShowSound',{'options':{'where':{'id':_0x1c4d4a},'attributes':[_0xa4c7('0x1e')]}});};exports['getIntervalById']=function(_0x47608f){return request(_0xa4c7('0x1f'),{'options':{'raw':![],'where':{'id':_0x47608f},'include':[{'model':'Interval','as':'Intervals'}]}});};exports[_0xa4c7('0x20')]=function(_0x2c020c){return request('ShowSmsAccount',{'options':{'where':{'id':_0x2c020c},'attributes':['id','name']}});};exports['createSmsMessage']=function(_0x2a3ccb){return request(_0xa4c7('0x21'),{'body':_0x2a3ccb});};exports[_0xa4c7('0x22')]=function(_0x3e133b){return request(_0xa4c7('0x23'),{'body':_0x3e133b});};exports[_0xa4c7('0x24')]=function(_0x6386ca){return request(_0xa4c7('0x25'),{'body':_[_0xa4c7('0x26')](_0x6386ca,{'project_name':_0x6386ca[_0xa4c7('0x27')],'prev_project_name':_0x6386ca['arg_2']||'','is_subproject':_0x6386ca[_0xa4c7('0x28')]?!![]:![],'leaveAt':moment()['format']('YYYY-MM-DD\x20HH:mm:ss')})});};exports['createSquareRecording']=function(_0x29bd41){return request(_0xa4c7('0x29'),{'body':_0x29bd41});};exports[_0xa4c7('0x2a')]=function(_0x41c1d1){return request(_0xa4c7('0x2b'),{'body':_0x41c1d1});};exports[_0xa4c7('0x2c')]=function(_0x232362){return request('ShowCmHopper',{'options':{'raw':![],'where':{'phone':_0x232362['phone'],'ListId':_0x232362[_0xa4c7('0x2d')]}}})[_0xa4c7('0x2e')](function(_0x64468d){if(_0x64468d){return _0x64468d;}return request(_0xa4c7('0x2f'),{'body':_0x232362});});};exports[_0xa4c7('0x30')]=function(_0x56ad81){return request('ShowPause',{'options':{'where':{'id':_0x56ad81},'attributes':[_0xa4c7('0x11')]}});};exports[_0xa4c7('0x31')]=function(_0x782118,_0x4889f8){return request('LoginUser',{'body':{'interface':_0x4889f8},'options':{'where':_0x782118}});};exports['agentPause']=function(_0x343934,_0x5bc48f,_0x4572be){return request(_0xa4c7('0x32'),{'body':{'type':_0x5bc48f,'uniqueid':_0x4572be},'options':{'where':_0x343934}});};exports[_0xa4c7('0x33')]=function(_0x559add){return request('UnpauseUser',{'body':{},'options':{'where':_0x559add}});};exports[_0xa4c7('0x34')]=function(_0x1bf12a){return request(_0xa4c7('0x35'),{'body':{},'options':{'where':_0x1bf12a}});};
\ 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 7911cd6..a80910b 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 _0x5c12=['./lex','exports'];(function(_0x4a5e37,_0x271eff){var _0x31dc7a=function(_0x2662a5){while(--_0x2662a5){_0x4a5e37['push'](_0x4a5e37['shift']());}};_0x31dc7a(++_0x271eff);}(_0x5c12,0x188));var _0x25c1=function(_0x15a8fa,_0x4652b2){_0x15a8fa=_0x15a8fa-0x0;var _0x1355c2=_0x5c12[_0x15a8fa];return _0x1355c2;};var polly=require('./polly');var lex=require(_0x25c1('0x0'));module[_0x25c1('0x1')]={'polly':polly,'lex':lex};
\ No newline at end of file
+var _0xadb8=['exports'];(function(_0x2cd809,_0x4cdedd){var _0x5a1519=function(_0x510aaa){while(--_0x510aaa){_0x2cd809['push'](_0x2cd809['shift']());}};_0x5a1519(++_0x4cdedd);}(_0xadb8,0x1d0));var _0x8adb=function(_0x548200,_0x3241b8){_0x548200=_0x548200-0x0;var _0x1a6d74=_0xadb8[_0x548200];return _0x1a6d74;};var polly=require('./polly');var lex=require('./lex');module[_0x8adb('0x0')]={'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 a502a79..9c2fee2 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 _0x5044=['exports'];(function(_0x27121d,_0x3921c5){var _0x36684a=function(_0x5d8fb6){while(--_0x5d8fb6){_0x27121d['push'](_0x27121d['shift']());}};_0x36684a(++_0x3921c5);}(_0x5044,0xc8));var _0x4504=function(_0x3ab32d,_0x633793){_0x3ab32d=_0x3ab32d-0x0;var _0x2cfab5=_0x5044[_0x3ab32d];return _0x2cfab5;};'use strict';var lex=require('./lib/api');module[_0x4504('0x0')]=function(_0x5a60e3,_0x42508e,_0x55be59,_0x2e8da7,_0x4da79c,_0x254de4){return lex(_0x5a60e3,_0x42508e,_0x55be59,_0x2e8da7,_0x4da79c,_0x254de4);};
\ No newline at end of file
+var _0x2e35=['./lib/api','exports'];(function(_0x3dd570,_0x317dd9){var _0x472b8a=function(_0x17ec39){while(--_0x17ec39){_0x3dd570['push'](_0x3dd570['shift']());}};_0x472b8a(++_0x317dd9);}(_0x2e35,0x1d0));var _0x52e3=function(_0x3efe11,_0xbf5471){_0x3efe11=_0x3efe11-0x0;var _0x6be032=_0x2e35[_0x3efe11];return _0x6be032;};'use strict';var lex=require(_0x52e3('0x0'));module[_0x52e3('0x1')]=function(_0x1dc2a2,_0x5b86c0,_0x145ad0,_0xcbe6c5,_0x16d807,_0x3dc244){return lex(_0x1dc2a2,_0x5b86c0,_0x145ad0,_0xcbe6c5,_0x16d807,_0x3dc244);};
\ 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 833b08e..f8a0a95 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 _0x9c06=['$LATEST','bluebird','postText','slots','hasOwnProperty','exports','LexRuntime'];(function(_0x146f8f,_0x55b5de){var _0x17374f=function(_0x3f2d32){while(--_0x3f2d32){_0x146f8f['push'](_0x146f8f['shift']());}};_0x17374f(++_0x55b5de);}(_0x9c06,0x7f));var _0x69c0=function(_0x4a4699,_0x4323aa){_0x4a4699=_0x4a4699-0x0;var _0x3c6c4a=_0x9c06[_0x4a4699];return _0x3c6c4a;};'use strict';var BPromise=require(_0x69c0('0x0'));var AWS=require('aws-sdk');function lexResult(_0xf9445b,_0x12df4f){return new BPromise(function(_0xe4c25a,_0x2e637a){_0xf9445b[_0x69c0('0x1')](_0x12df4f,function(_0x7dc724,_0x28337b){if(_0x7dc724){_0x2e637a(_0x7dc724);}if(_0x28337b['slots']){for(const _0x18e80d in _0x28337b[_0x69c0('0x2')]){if(_0x28337b[_0x69c0('0x2')][_0x69c0('0x3')](_0x18e80d)){var _0x40a1c8=_0x28337b['slots'][_0x18e80d];_0x28337b['slot_'+_0x18e80d]=_0x40a1c8;}}}_0xe4c25a(_0x28337b);});});}module[_0x69c0('0x4')]=function(_0x527acc,_0xe9ec3,_0x328a8b,_0x17a104,_0x4b1622,_0x99f1b7){var _0x2dff1a=new AWS[(_0x69c0('0x5'))]({'accessKeyId':_0xe9ec3,'secretAccessKey':_0x328a8b,'region':_0x17a104});var _0x1c0422={'botAlias':_0x69c0('0x6'),'botName':_0x99f1b7,'inputText':_0x4b1622,'userId':_0x527acc};return lexResult(_0x2dff1a,_0x1c0422);};
\ No newline at end of file
+var _0x5f4c=['hasOwnProperty','slot_','exports','$LATEST','bluebird','aws-sdk','postText','slots'];(function(_0xbd3b52,_0x48ffdb){var _0x895a50=function(_0x4ff71e){while(--_0x4ff71e){_0xbd3b52['push'](_0xbd3b52['shift']());}};_0x895a50(++_0x48ffdb);}(_0x5f4c,0x1bc));var _0xc5f4=function(_0x465028,_0x4570ac){_0x465028=_0x465028-0x0;var _0xb783d4=_0x5f4c[_0x465028];return _0xb783d4;};'use strict';var BPromise=require(_0xc5f4('0x0'));var AWS=require(_0xc5f4('0x1'));function lexResult(_0x25f5b0,_0x30b001){return new BPromise(function(_0x2e2f35,_0x3a8182){_0x25f5b0[_0xc5f4('0x2')](_0x30b001,function(_0x422f56,_0x3886b3){if(_0x422f56){_0x3a8182(_0x422f56);}if(_0x3886b3[_0xc5f4('0x3')]){for(const _0xb1669b in _0x3886b3[_0xc5f4('0x3')]){if(_0x3886b3[_0xc5f4('0x3')][_0xc5f4('0x4')](_0xb1669b)){var _0x3f457f=_0x3886b3[_0xc5f4('0x3')][_0xb1669b];_0x3886b3[_0xc5f4('0x5')+_0xb1669b]=_0x3f457f;}}}_0x2e2f35(_0x3886b3);});});}module[_0xc5f4('0x6')]=function(_0x115417,_0x431b39,_0xd4b731,_0x254b23,_0x365bcb,_0x217f4b){var _0x5d9212=new AWS['LexRuntime']({'accessKeyId':_0x431b39,'secretAccessKey':_0xd4b731,'region':_0x254b23});var _0x586633={'botAlias':_0xc5f4('0x7'),'botName':_0x217f4b,'inputText':_0x365bcb,'userId':_0x115417};return lexResult(_0x5d9212,_0x586633);};
\ 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 c995fd9..d2900ae 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. *
// * *
// *************************************************************************
-'use strict';var polly=require('./lib/api');module['exports']=function(_0x24c3a9,_0x9e087e,_0x332f9d,_0x233663,_0x3bb42f,_0x261c23,_0x1754eb){return polly(_0x24c3a9,_0x9e087e,_0x332f9d,_0x233663,_0x3bb42f,_0x261c23,_0x1754eb);};
\ No newline at end of file
+var _0x16e1=['./lib/api'];(function(_0x58c2ac,_0x58c01b){var _0x10cb51=function(_0x57d85d){while(--_0x57d85d){_0x58c2ac['push'](_0x58c2ac['shift']());}};_0x10cb51(++_0x58c01b);}(_0x16e1,0x1ea));var _0x116e=function(_0x273c39,_0x1052e6){_0x273c39=_0x273c39-0x0;var _0x46d6b5=_0x16e1[_0x273c39];return _0x46d6b5;};'use strict';var polly=require(_0x116e('0x0'));module['exports']=function(_0x44fc39,_0x1f5e0f,_0x1718f0,_0x24cb92,_0x4405e8,_0x304b3d,_0x34eac8){return polly(_0x44fc39,_0x1f5e0f,_0x1718f0,_0x24cb92,_0x4405e8,_0x304b3d,_0x34eac8);};
\ 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 4d4c23c..48b4a1c 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 _0x2004=['mp3','bluebird','randomstring','synthesizeSpeech','AudioStream','writeFile','No\x20data\x20response\x20from\x20aws\x20Polly!','Polly'];(function(_0x5a8aa3,_0x2294d5){var _0x5d0458=function(_0x62d096){while(--_0x62d096){_0x5a8aa3['push'](_0x5a8aa3['shift']());}};_0x5d0458(++_0x2294d5);}(_0x2004,0x111));var _0x4200=function(_0x416ad,_0x3797e5){_0x416ad=_0x416ad-0x0;var _0x160983=_0x2004[_0x416ad];return _0x160983;};'use strict';var fs=require('fs');var path=require('path');var BPromise=require(_0x4200('0x0'));var rs=require(_0x4200('0x1'));var AWS=require('aws-sdk');function pollyResult(_0x4819e8,_0x77780c,_0x29cab3){return new BPromise(function(_0xa746bd,_0x36e551){_0x4819e8[_0x4200('0x2')](_0x77780c,function(_0x498d28,_0x448fdd){if(_0x498d28){_0x36e551(_0x498d28);}else if(_0x448fdd){if(_0x448fdd[_0x4200('0x3')]instanceof Buffer){fs[_0x4200('0x4')](_0x29cab3,_0x448fdd[_0x4200('0x3')],function(_0x535531){if(_0x535531){_0x36e551(_0x535531);}else{_0xa746bd();}});}else{_0x36e551(new Error('Invalid\x20data\x20response\x20from\x20aws\x20Polly!'));}}else{_0x36e551(new Error(_0x4200('0x5')));}});});}module['exports']=function(_0x5f266a,_0x42dfe9,_0x1d5f3e,_0x5a4925,_0x3da35b,_0x4d7d35,_0x4517e4){var _0x48db0d=new AWS[(_0x4200('0x6'))]({'accessKeyId':_0x5f266a,'secretAccessKey':_0x42dfe9,'region':_0x1d5f3e});var _0x177dcc={'Text':_0x3da35b,'TextType':_0x4d7d35||'text','OutputFormat':_0x4200('0x7'),'VoiceId':_0x5a4925};return pollyResult(_0x48db0d,_0x177dcc,_0x4517e4);};
\ No newline at end of file
+var _0x2f2b=['exports','text','randomstring','aws-sdk','synthesizeSpeech','AudioStream','Invalid\x20data\x20response\x20from\x20aws\x20Polly!','No\x20data\x20response\x20from\x20aws\x20Polly!'];(function(_0x264b16,_0x1de7a6){var _0x5606d4=function(_0x14e1c9){while(--_0x14e1c9){_0x264b16['push'](_0x264b16['shift']());}};_0x5606d4(++_0x1de7a6);}(_0x2f2b,0xb2));var _0xb2f2=function(_0xfd7388,_0x5c64c7){_0xfd7388=_0xfd7388-0x0;var _0x39edf4=_0x2f2b[_0xfd7388];return _0x39edf4;};'use strict';var fs=require('fs');var path=require('path');var BPromise=require('bluebird');var rs=require(_0xb2f2('0x0'));var AWS=require(_0xb2f2('0x1'));function pollyResult(_0x1aff0d,_0xdb44dc,_0xd075c8){return new BPromise(function(_0x53a678,_0x1d604c){_0x1aff0d[_0xb2f2('0x2')](_0xdb44dc,function(_0x569675,_0x30517d){if(_0x569675){_0x1d604c(_0x569675);}else if(_0x30517d){if(_0x30517d[_0xb2f2('0x3')]instanceof Buffer){fs['writeFile'](_0xd075c8,_0x30517d[_0xb2f2('0x3')],function(_0x1ce6c6){if(_0x1ce6c6){_0x1d604c(_0x1ce6c6);}else{_0x53a678();}});}else{_0x1d604c(new Error(_0xb2f2('0x4')));}}else{_0x1d604c(new Error(_0xb2f2('0x5')));}});});}module[_0xb2f2('0x6')]=function(_0x4f98e9,_0x49566d,_0x345548,_0x548813,_0x5b0277,_0x55bf67,_0x4edf96){var _0x2c9c14=new AWS['Polly']({'accessKeyId':_0x4f98e9,'secretAccessKey':_0x49566d,'region':_0x345548});var _0x41cedb={'Text':_0x5b0277,'TextType':_0x55bf67||_0xb2f2('0x7'),'OutputFormat':'mp3','VoiceId':_0x548813};return pollyResult(_0x2c9c14,_0x41cedb,_0x4edf96);};
\ 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 bd70b88..20903b7 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 _0x4c07=['./lib/api'];(function(_0x150bfc,_0x27c71d){var _0x3429d4=function(_0xb897f){while(--_0xb897f){_0x150bfc['push'](_0x150bfc['shift']());}};_0x3429d4(++_0x27c71d);}(_0x4c07,0x1dc));var _0x74c0=function(_0x29c261,_0x3af39a){_0x29c261=_0x29c261-0x0;var _0x1a9335=_0x4c07[_0x29c261];return _0x1a9335;};'use strict';var asr=require(_0x74c0('0x0'));module['exports']=function(_0x2bd104,_0x2a8486,_0x25391a,_0x106768){return asr(_0x2bd104,_0x2a8486,_0x25391a);};
\ No newline at end of file
+var _0x154e=['./lib/api'];(function(_0x17a245,_0x6cc8b7){var _0x30e0ce=function(_0x3f3226){while(--_0x3f3226){_0x17a245['push'](_0x17a245['shift']());}};_0x30e0ce(++_0x6cc8b7);}(_0x154e,0xec));var _0xe154=function(_0x530b56,_0x22c9d9){_0x530b56=_0x530b56-0x0;var _0x59c652=_0x154e[_0x530b56];return _0x59c652;};'use strict';var asr=require(_0xe154('0x0'));module['exports']=function(_0x4c5e14,_0x1eec45,_0x5030e2,_0x106764){return asr(_0x4c5e14,_0x1eec45,_0x5030e2);};
\ 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 95d9c55..e1beba8 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 _0xc455=['8000','bluebird','https://speech.googleapis.com','string','length','filepath\x20should\x20be\x20a\x20string','key\x20should\x20be\x20a\x20string','lang\x20should\x20be\x20a\x20string','toString','base64','POST','/v1/speech:recognize?key=','LINEAR16'];(function(_0x1c969c,_0x2c0fbf){var _0x421d03=function(_0x2f4b4e){while(--_0x2f4b4e){_0x1c969c['push'](_0x1c969c['shift']());}};_0x421d03(++_0x2c0fbf);}(_0xc455,0x11f));var _0x5c45=function(_0x5ddccd,_0x43addb){_0x5ddccd=_0x5ddccd-0x0;var _0x5b6391=_0xc455[_0x5ddccd];return _0x5b6391;};'use strict';var url=require('url');var BPromise=require(_0x5c45('0x0'));var fs=require('fs');var host=_0x5c45('0x1');module['exports']=function(_0x4507b5,_0x11c825,_0xa31613){return new BPromise(function(_0x1fa8bf,_0xbc760b){var _0x2b04d3;if(typeof _0x4507b5!==_0x5c45('0x2')||_0x4507b5[_0x5c45('0x3')]===0x0){return _0xbc760b(_0x5c45('0x4'));}if(typeof _0x11c825!==_0x5c45('0x2')||_0x11c825[_0x5c45('0x3')]===0x0){return _0xbc760b(_0x5c45('0x5'));}if(typeof _0xa31613!=='undefined'&&(typeof _0xa31613!==_0x5c45('0x2')||_0xa31613[_0x5c45('0x3')]===0x0)){return _0xbc760b(_0x5c45('0x6'));}try{_0x2b04d3=fs['readFileSync'](_0x4507b5)[_0x5c45('0x7')](_0x5c45('0x8'));}catch(_0x2265cc){return _0xbc760b(_0x2265cc);}return _0x1fa8bf({'method':_0x5c45('0x9'),'uri':host+_0x5c45('0xa')+_0x11c825,'body':{'config':{'encoding':_0x5c45('0xb'),'sampleRateHertz':_0x5c45('0xc'),'languageCode':_0xa31613},'audio':{'content':_0x2b04d3}},'json':!![]});});};
\ No newline at end of file
+var _0xf518=['8000','url','bluebird','https://speech.googleapis.com','exports','length','string','undefined','lang\x20should\x20be\x20a\x20string','readFileSync','toString','base64','POST','LINEAR16'];(function(_0x5d6456,_0x58ecc7){var _0x4d66c1=function(_0x4335e3){while(--_0x4335e3){_0x5d6456['push'](_0x5d6456['shift']());}};_0x4d66c1(++_0x58ecc7);}(_0xf518,0x127));var _0x8f51=function(_0x146837,_0x2aa6a2){_0x146837=_0x146837-0x0;var _0x3d7e60=_0xf518[_0x146837];return _0x3d7e60;};'use strict';var url=require(_0x8f51('0x0'));var BPromise=require(_0x8f51('0x1'));var fs=require('fs');var host=_0x8f51('0x2');module[_0x8f51('0x3')]=function(_0x3314e6,_0xe06733,_0x264d33){return new BPromise(function(_0x5cded3,_0x539555){var _0x5b8dbe;if(typeof _0x3314e6!=='string'||_0x3314e6[_0x8f51('0x4')]===0x0){return _0x539555('filepath\x20should\x20be\x20a\x20string');}if(typeof _0xe06733!==_0x8f51('0x5')||_0xe06733[_0x8f51('0x4')]===0x0){return _0x539555('key\x20should\x20be\x20a\x20string');}if(typeof _0x264d33!==_0x8f51('0x6')&&(typeof _0x264d33!==_0x8f51('0x5')||_0x264d33[_0x8f51('0x4')]===0x0)){return _0x539555(_0x8f51('0x7'));}try{_0x5b8dbe=fs[_0x8f51('0x8')](_0x3314e6)[_0x8f51('0x9')](_0x8f51('0xa'));}catch(_0x54412d){return _0x539555(_0x54412d);}return _0x5cded3({'method':_0x8f51('0xb'),'uri':host+'/v1/speech:recognize?key='+_0xe06733,'body':{'config':{'encoding':_0x8f51('0xc'),'sampleRateHertz':_0x8f51('0xd'),'languageCode':_0x264d33},'audio':{'content':_0x5b8dbe}},'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 2104228..2dcbe1e 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 _0x882c=['./asr','exports'];(function(_0x39bd06,_0x370e6e){var _0x534bec=function(_0x17194c){while(--_0x17194c){_0x39bd06['push'](_0x39bd06['shift']());}};_0x534bec(++_0x370e6e);}(_0x882c,0x6c));var _0xc882=function(_0x3509d8,_0x5074b5){_0x3509d8=_0x3509d8-0x0;var _0x4dcedb=_0x882c[_0x3509d8];return _0x4dcedb;};var asr=require(_0xc882('0x0'));module[_0xc882('0x1')]={'asr':asr};
\ No newline at end of file
+var _0x288a=['exports'];(function(_0xa9dd88,_0x358002){var _0x33678d=function(_0x13b817){while(--_0x13b817){_0xa9dd88['push'](_0xa9dd88['shift']());}};_0x33678d(++_0x358002);}(_0x288a,0x188));var _0xa288=function(_0x1cba08,_0x21b768){_0x1cba08=_0x1cba08-0x0;var _0x2d6e52=_0x288a[_0x1cba08];return _0x2d6e52;};var asr=require('./asr');module[_0xa288('0x0')]={'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 f2fac1d..775b2b4 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 _0x1745=['?key=','ssml','input','audioConfig','text:synthesize','POST','tmp','from','audioContent','base64','writeFile','777','.mp3','goggleTTS\x20path','asr','uri','map','alternatives','join','confidence','googleASR\x20transcription','googleASR\x20confidence','message','googleDialogflow','textRequest','stringify','result','source','resolvedQuery','action','fulfillment','speech','score','code','metadata','endConversation','isFallbackIntent','tildeASR','Tilde\x20ASR\x20transcription','transcript','Tilde\x20ASR\x20confidence','awsPolly','polly','awsLex','lex','ispeechTTS','format','ispeechASR','%s?apikey=%s&action=recognize&locale=%s&content-type=audio/x-wav&audio=%s&%s','model=%s','nda','channelData','CustomAction','CustomActionData','AudioFromTts','Data','audiofile','http','https','url','parse','bluebird','randomstring','request-promise','util','querystring','google-tts-api','apiai-promise','md5','./google','./aws','./tilde','./sestek','../../../config/logger','agi','https://api.ispeech.org/api/rest','https:','path','WHAT_EVER','get','statusCode','error','request\x20to\x20','\x20failed,\x20status\x20code\x20=\x20','statusMessage','finish','info','finish\x20download\x20file','unlink','download\x20error','pipe','end','protocol','host','data','error\x20convert','start','resolve','generate','.wav','writeFileSync','then','chmodSync','split','readFileSync','googleCloudTTS'];(function(_0x39e84d,_0x11931d){var _0x1991bc=function(_0xc81e32){while(--_0xc81e32){_0x39e84d['push'](_0x39e84d['shift']());}};_0x1991bc(++_0x11931d);}(_0x1745,0x177));var _0x5174=function(_0x1ac595,_0x5d2081){_0x1ac595=_0x1ac595-0x0;var _0x455fff=_0x1745[_0x1ac595];return _0x455fff;};'use strict';var fs=require('fs');var path=require('path');var http=require(_0x5174('0x0'));var https=require(_0x5174('0x1'));var urlParse=require(_0x5174('0x2'))[_0x5174('0x3')];var BPromise=require(_0x5174('0x4'));var rs=require(_0x5174('0x5'));var sox=require('sox');var rp=require(_0x5174('0x6'));var util=require(_0x5174('0x7'));var querystring=require(_0x5174('0x8'));var tts=require(_0x5174('0x9'));var apiai=require(_0x5174('0xa'));var md5=require(_0x5174('0xb'));var google=require(_0x5174('0xc'));var aws=require(_0x5174('0xd'));var tilde=require(_0x5174('0xe'));var sestek=require(_0x5174('0xf'));var logger=require(_0x5174('0x10'))(_0x5174('0x11'));var ISPEECH_API=_0x5174('0x12');function downloadFile(_0x2a3d65,_0x1c5eff){return new BPromise(function(_0xebb3e6,_0x3c5541){var _0x52e5b7=urlParse(_0x2a3d65);var _0x470c4c=_0x52e5b7['protocol']===_0x5174('0x13')?https:http;var _0x52c4d8={'host':_0x52e5b7['host'],'path':_0x52e5b7[_0x5174('0x14')],'headers':{'user-agent':_0x5174('0x15')}};_0x470c4c[_0x5174('0x16')](_0x52c4d8,function(_0x2292e8){if(_0x2292e8[_0x5174('0x17')]!==0xc8){logger[_0x5174('0x18')](_0x5174('0x19')+_0x2a3d65+_0x5174('0x1a')+_0x2292e8[_0x5174('0x17')]+'\x20('+_0x2292e8['statusMessage']+')');_0x3c5541(new Error('request\x20to\x20'+_0x2a3d65+_0x5174('0x1a')+_0x2292e8[_0x5174('0x17')]+'\x20('+_0x2292e8[_0x5174('0x1b')]+')'));return;}var _0x1de872=fs['createWriteStream'](_0x1c5eff);_0x1de872['on'](_0x5174('0x1c'),function(){logger[_0x5174('0x1d')](_0x5174('0x1e'));_0x1de872['close'](_0xebb3e6);});_0x1de872['on'](_0x5174('0x18'),function(_0x37b500){fs[_0x5174('0x1f')](_0x1c5eff);logger[_0x5174('0x18')](_0x5174('0x20'),_0x37b500);_0x3c5541(_0x37b500);});_0x2292e8[_0x5174('0x21')](_0x1de872);})['on'](_0x5174('0x18'),function(_0x142f56){logger['error'](_0x142f56);_0x3c5541(_0x142f56);})[_0x5174('0x22')]();});}function uploadFile(_0x3157b5){return new BPromise(function(_0x11f053,_0x211a5){var _0x1aa214=urlParse(_0x3157b5);var _0xeb77ae=_0x1aa214[_0x5174('0x23')]===_0x5174('0x13')?https:http;var _0x17b8df={'host':_0x1aa214[_0x5174('0x24')],'path':_0x1aa214[_0x5174('0x14')],'headers':{'user-agent':_0x5174('0x15')}};_0xeb77ae[_0x5174('0x16')](_0x17b8df,function(_0x1a3e49){if(_0x1a3e49[_0x5174('0x17')]!==0xc8){_0x211a5(new Error(_0x5174('0x19')+_0x3157b5+_0x5174('0x1a')+_0x1a3e49[_0x5174('0x17')]+'\x20('+_0x1a3e49[_0x5174('0x1b')]+')'));return;}var _0x3a0639='';_0x1a3e49['on'](_0x5174('0x25'),function(_0x519397){_0x3a0639+=_0x519397;});_0x1a3e49['on'](_0x5174('0x22'),function(){_0x11f053(_0x3a0639);});})['on'](_0x5174('0x18'),function(_0x521ef2){_0x211a5(_0x521ef2);})[_0x5174('0x22')]();});}function convertFile(_0x15f1fc,_0x4c0a49){return new BPromise(function(_0x36f319,_0x1ace6a){var _0x5be224=sox['transcode'](_0x15f1fc,_0x4c0a49,{'sampleRate':0x1f40,'format':'wav','channelCount':0x1,'bitRate':0xc0*0x400,'compressionQuality':0x5});_0x5be224['on'](_0x5174('0x18'),function(_0x3087bb){logger[_0x5174('0x18')](_0x5174('0x26'),_0x3087bb);_0x1ace6a(_0x3087bb);});_0x5be224['on'](_0x5174('0x22'),function(){logger[_0x5174('0x1d')]('finish\x20to\x20convert');_0x36f319();});_0x5be224[_0x5174('0x27')]();});}function base64Decode(_0x377dc6,_0x523a74){var _0x102636=path[_0x5174('0x28')](__dirname,'tmp',rs[_0x5174('0x29')](0x4)+_0x5174('0x2a'));fs[_0x5174('0x2b')](_0x102636,_0x377dc6,'base64');return convertFile(_0x102636,_0x523a74)[_0x5174('0x2c')](function(){try{fs[_0x5174('0x1f')](_0x102636);fs[_0x5174('0x2d')](_0x523a74,'777');}catch(_0x2da01e){logger[_0x5174('0x18')](_0x2da01e);}return _0x523a74[_0x5174('0x2e')]('.')[0x0];});}function base64Encode(_0x13a9b0){var _0x14cd9a=fs[_0x5174('0x2f')](_0x13a9b0);return new Buffer(_0x14cd9a)['toString']('base64');}exports[_0x5174('0x30')]=function(_0x4ee09e,_0x39f4bc,_0x134b02,_0x490fab,_0x22bff9,_0x54806d){var _0x5d88a7,_0xcf2c7c;var _0x477518='https://texttospeech.googleapis.com/v1/';var _0x232e51=_0x5174('0x31')+_0x4ee09e;var _0x123ab0={};if(_0x39f4bc===_0x5174('0x32')){_0x123ab0[_0x5174('0x33')]={'ssml':_0x134b02};}else{_0x123ab0['input']={'text':_0x134b02};};_0x123ab0['voice']={'languageCode':_0x490fab,'ssmlGender':_0x22bff9};_0x123ab0[_0x5174('0x34')]={'audioEncoding':'MP3','sampleRateHertz':0x1f40};var _0x25647e={'url':_0x477518+_0x5174('0x35')+_0x232e51,'method':_0x5174('0x36'),'json':!![],'body':_0x123ab0};return rp(_0x25647e)[_0x5174('0x2c')](function(_0x21dac6){return new BPromise(function(_0x1b4fe9,_0xf27522){_0x5d88a7=path[_0x5174('0x28')](__dirname,_0x5174('0x37'),rs[_0x5174('0x29')](0x4)+'.mp3');var _0x436f0b=Buffer[_0x5174('0x38')](_0x21dac6[_0x5174('0x39')],_0x5174('0x3a'));return fs[_0x5174('0x3b')](_0x5d88a7,_0x436f0b,function(_0x4b9929){_0xf27522(_0x4b9929);},function(_0x34aac0){fs[_0x5174('0x2d')](_0x5d88a7,_0x5174('0x3c'));_0x1b4fe9(_0x34aac0);});});})[_0x5174('0x2c')](function(_0x449be1){_0xcf2c7c=path[_0x5174('0x28')](__dirname,_0x5174('0x37'),rs[_0x5174('0x29')](0x4)+_0x5174('0x2a'));return convertFile(_0x5d88a7,_0xcf2c7c);})[_0x5174('0x2c')](function(){try{fs['unlink'](_0x5d88a7);fs['chmodSync'](_0xcf2c7c,_0x5174('0x3c'));}catch(_0x41732a){logger[_0x5174('0x18')](_0x41732a);}logger['info']('googleCloudTTS\x20path',_0xcf2c7c['split']('.')[0x0]);return _0xcf2c7c['split']('.')[0x0];});};exports['googleTTS']=function(_0x4d146a,_0x2c4a9d){var _0x41f85a,_0x39ceb2;return tts(_0x4d146a,_0x2c4a9d||'en',0x1)[_0x5174('0x2c')](function(_0x1273c8){logger[_0x5174('0x1d')](_0x1273c8);_0x41f85a=path[_0x5174('0x28')](__dirname,_0x5174('0x37'),rs[_0x5174('0x29')](0x4)+_0x5174('0x3d'));return downloadFile(_0x1273c8,_0x41f85a);})[_0x5174('0x2c')](function(){_0x39ceb2=path[_0x5174('0x28')](__dirname,_0x5174('0x37'),rs['generate'](0x4)+_0x5174('0x2a'));return convertFile(_0x41f85a,_0x39ceb2);})[_0x5174('0x2c')](function(){try{fs['unlink'](_0x41f85a);fs['chmodSync'](_0x39ceb2,_0x5174('0x3c'));}catch(_0x29a39c){logger[_0x5174('0x18')](_0x29a39c);}logger[_0x5174('0x1d')](_0x5174('0x3e'),_0x39ceb2[_0x5174('0x2e')]('.')[0x0]);return _0x39ceb2[_0x5174('0x2e')]('.')[0x0];});};exports['googleASR']=function(_0x1b2469,_0x2ac8ed,_0x14452d){return google[_0x5174('0x3f')](_0x1b2469,_0x2ac8ed,_0x14452d)[_0x5174('0x2c')](function(_0x2e7832){logger[_0x5174('0x1d')](_0x2e7832[_0x5174('0x40')]);return rp(_0x2e7832);})[_0x5174('0x2c')](function(_0xc20230){var _0x49f6b2='';var _0x17703f=0x0;try{fs[_0x5174('0x1f')](_0x1b2469);}catch(_0x4e5888){logger[_0x5174('0x18')](_0x4e5888);}if(_0xc20230&&_0xc20230['results']){_0x49f6b2=_0xc20230['results'][_0x5174('0x41')](function(_0x4c8786){return _0x4c8786&&_0x4c8786[_0x5174('0x42')][0x0]&&_0x4c8786[_0x5174('0x42')][0x0]['transcript']?_0x4c8786['alternatives'][0x0]['transcript']:'';})[_0x5174('0x43')]('\x0a');_0x17703f=_0xc20230['results'][_0x5174('0x41')](function(_0x4cdaa6){return _0x4cdaa6&&_0x4cdaa6[_0x5174('0x42')][0x0]&&_0x4cdaa6['alternatives'][0x0][_0x5174('0x44')]?_0x4cdaa6[_0x5174('0x42')][0x0][_0x5174('0x44')]:0x0;})[_0x5174('0x43')]('\x0a');}logger[_0x5174('0x1d')](_0x5174('0x45'),_0x49f6b2);logger[_0x5174('0x1d')](_0x5174('0x46'),_0x17703f);return{'transcript':_0x49f6b2,'confidence':_0x17703f};})['catch'](function(_0x4c3aad){logger[_0x5174('0x18')]('[%s]\x20%s:%s',_0x4c3aad[_0x5174('0x17')],_0x4c3aad['name'],_0x4c3aad[_0x5174('0x47')]);});};exports[_0x5174('0x48')]=function(_0x317f5a,_0x4727a3,_0x5e9b8b,_0x5f3b0f){var _0x2f1288=apiai(_0x4727a3,{'language':_0x5f3b0f||'en'});return _0x2f1288[_0x5174('0x49')](_0x5e9b8b,{'sessionId':md5(_0x317f5a)})['then'](function(_0x2c63f0){logger[_0x5174('0x1d')](JSON[_0x5174('0x4a')](_0x2c63f0));return{'source':_0x2c63f0[_0x5174('0x4b')][_0x5174('0x4c')],'resolvedQuery':_0x2c63f0[_0x5174('0x4b')][_0x5174('0x4d')],'action':_0x2c63f0[_0x5174('0x4b')][_0x5174('0x4e')],'actionIncomplete':_0x2c63f0[_0x5174('0x4b')]['actionIncomplete'],'speech':_0x2c63f0[_0x5174('0x4b')][_0x5174('0x4f')][_0x5174('0x50')],'score':_0x2c63f0[_0x5174('0x4b')][_0x5174('0x51')],'statusCode':_0x2c63f0['status'][_0x5174('0x52')],'endConversation':_0x2c63f0[_0x5174('0x4b')][_0x5174('0x53')][_0x5174('0x54')]||![],'isFallbackIntent':_0x2c63f0[_0x5174('0x4b')][_0x5174('0x53')][_0x5174('0x55')]};});};exports[_0x5174('0x56')]=function(_0x2bd16c,_0x2c2114,_0x5e30c6,_0x5a22d6){return tilde[_0x5174('0x3f')](_0x2bd16c,_0x2c2114,_0x5e30c6,_0x5a22d6)[_0x5174('0x2c')](function(_0x40daa6){try{fs[_0x5174('0x1f')](_0x2bd16c);}catch(_0x660e01){logger[_0x5174('0x18')](_0x660e01);}logger[_0x5174('0x1d')](_0x5174('0x57'),_0x40daa6[_0x5174('0x58')]);logger[_0x5174('0x1d')](_0x5174('0x59'),_0x40daa6['confidence']);return _0x40daa6;});};exports[_0x5174('0x5a')]=function(_0x515bb0,_0x22b008,_0x1f6fc3,_0x5622ee,_0x8891c3,_0x30075d){var _0x3cac63=path[_0x5174('0x28')](__dirname,_0x5174('0x37'),rs[_0x5174('0x29')](0x4)+_0x5174('0x3d'));var _0x3e43b3;return aws[_0x5174('0x5b')](_0x515bb0,_0x22b008,_0x1f6fc3,_0x5622ee,_0x8891c3,_0x30075d,_0x3cac63)['then'](function(){_0x3e43b3=path[_0x5174('0x28')](__dirname,_0x5174('0x37'),rs['generate'](0x4)+_0x5174('0x2a'));return convertFile(_0x3cac63,_0x3e43b3);})[_0x5174('0x2c')](function(){try{fs['unlink'](_0x3cac63);fs[_0x5174('0x2d')](_0x3e43b3,_0x5174('0x3c'));}catch(_0x23af7f){logger[_0x5174('0x18')](_0x23af7f);}return _0x3e43b3[_0x5174('0x2e')]('.')[0x0];});};exports[_0x5174('0x5c')]=function(_0x27f42c,_0x2705b5,_0x1fb817,_0xd91eae,_0x5e1e45,_0x4ca3a8){return aws[_0x5174('0x5d')](_0x27f42c,_0x2705b5,_0x1fb817,_0xd91eae,_0x5e1e45,_0x4ca3a8)[_0x5174('0x2c')](function(_0x26a699){logger[_0x5174('0x1d')](JSON['stringify'](_0x26a699));return _0x26a699;});};exports[_0x5174('0x5e')]=function(_0x38ef90,_0x127475,_0x3f4163,_0x460fd2){var _0x5201aa=util[_0x5174('0x5f')]('%s?apikey=%s&action=convert&text=%s&voice=%s&speed=%s&format=mp3',ISPEECH_API,_0x38ef90,encodeURIComponent(_0x127475),_0x3f4163,_0x460fd2);var _0x484650=path['resolve'](__dirname,'tmp',rs['generate'](0x4)+_0x5174('0x3d'));var _0x5c4de;return downloadFile(_0x5201aa,_0x484650)['then'](function(){_0x5c4de=path['resolve'](__dirname,_0x5174('0x37'),rs[_0x5174('0x29')](0x4)+'.wav');return convertFile(_0x484650,_0x5c4de);})['then'](function(){try{fs[_0x5174('0x1f')](_0x484650);fs[_0x5174('0x2d')](_0x5c4de,_0x5174('0x3c'));}catch(_0x3db720){logger[_0x5174('0x18')](_0x3db720);}return _0x5c4de[_0x5174('0x2e')]('.')[0x0];});};exports[_0x5174('0x60')]=function(_0x43a8bf,_0x2e653d,_0x1cccb1,_0x1ce6c1){var _0xd0cfe8=util[_0x5174('0x5f')](_0x5174('0x61'),ISPEECH_API,_0x2e653d,_0x1cccb1,base64Encode(_0x43a8bf),_0x1ce6c1?util[_0x5174('0x5f')](_0x5174('0x62'),encodeURIComponent(_0x1ce6c1)):'freeform=3');return uploadFile(_0xd0cfe8)[_0x5174('0x2c')](function(_0x1a50cd){return querystring[_0x5174('0x3')](_0x1a50cd);});};exports['sestekNDA']=function(_0x15e09e,_0x2a99c8){return sestek[_0x5174('0x63')](_0x15e09e,_0x2a99c8)['then'](function(_0x310196){logger[_0x5174('0x1d')](JSON[_0x5174('0x4a')](_0x310196));var _0x3de1d9={'speech':_0x310196['text'],'action':_0x310196[_0x5174('0x64')]?_0x310196[_0x5174('0x64')][_0x5174('0x65')]:undefined,'actiondata':_0x310196[_0x5174('0x64')]?_0x310196[_0x5174('0x64')][_0x5174('0x66')]:undefined};if(_0x310196[_0x5174('0x64')]&&_0x310196[_0x5174('0x64')][_0x5174('0x67')]){return base64Decode(_0x310196[_0x5174('0x64')][_0x5174('0x67')][_0x5174('0x68')],path[_0x5174('0x28')](__dirname,_0x5174('0x37'),rs[_0x5174('0x29')](0x4)+'.wav'))['then'](function(_0x1fa45d){_0x3de1d9[_0x5174('0x69')]=_0x1fa45d;return _0x3de1d9;});}return _0x3de1d9;});};exports['dirName']=function(){return __dirname;};
\ No newline at end of file
+var _0x85b6=['result','source','resolvedQuery','action','actionIncomplete','fulfillment','score','status','code','metadata','isFallbackIntent','Tilde\x20ASR\x20confidence','awsPolly','polly','awsLex','lex','ispeechTTS','format','%s?apikey=%s&action=convert&text=%s&voice=%s&speed=%s&format=mp3','ispeechASR','%s?apikey=%s&action=recognize&locale=%s&content-type=audio/x-wav&audio=%s&%s','sestekNDA','nda','text','channelData','CustomAction','CustomActionData','AudioFromTts','Data','audiofile','dirName','path','http','url','parse','bluebird','randomstring','sox','request-promise','util','querystring','google-tts-api','apiai-promise','./google','./aws','./tilde','./sestek','../../../config/logger','agi','protocol','https:','host','WHAT_EVER','get','statusCode','error','request\x20to\x20','\x20failed,\x20status\x20code\x20=\x20','statusMessage','createWriteStream','finish','info','finish\x20download\x20file','close','download\x20error','pipe','end','data','transcode','error\x20convert','finish\x20to\x20convert','start','resolve','tmp','generate','.wav','base64','then','chmodSync','777','readFileSync','googleCloudTTS','?key=','ssml','input','voice','MP3','text:synthesize','POST','.mp3','from','audioContent','writeFile','unlink','split','goggleTTS\x20path','googleASR','asr','uri','results','map','alternatives','transcript','join','confidence','googleASR\x20transcription','googleASR\x20confidence','catch','[%s]\x20%s:%s','name','message','googleDialogflow','textRequest','stringify'];(function(_0x3b9437,_0x31b422){var _0x2ed95d=function(_0x2b332e){while(--_0x2b332e){_0x3b9437['push'](_0x3b9437['shift']());}};_0x2ed95d(++_0x31b422);}(_0x85b6,0x91));var _0x685b=function(_0x5ec688,_0x115f65){_0x5ec688=_0x5ec688-0x0;var _0x557ef0=_0x85b6[_0x5ec688];return _0x557ef0;};'use strict';var fs=require('fs');var path=require(_0x685b('0x0'));var http=require(_0x685b('0x1'));var https=require('https');var urlParse=require(_0x685b('0x2'))[_0x685b('0x3')];var BPromise=require(_0x685b('0x4'));var rs=require(_0x685b('0x5'));var sox=require(_0x685b('0x6'));var rp=require(_0x685b('0x7'));var util=require(_0x685b('0x8'));var querystring=require(_0x685b('0x9'));var tts=require(_0x685b('0xa'));var apiai=require(_0x685b('0xb'));var md5=require('md5');var google=require(_0x685b('0xc'));var aws=require(_0x685b('0xd'));var tilde=require(_0x685b('0xe'));var sestek=require(_0x685b('0xf'));var logger=require(_0x685b('0x10'))(_0x685b('0x11'));var ISPEECH_API='https://api.ispeech.org/api/rest';function downloadFile(_0x353732,_0x171dc7){return new BPromise(function(_0x445497,_0x296bf1){var _0x2d5243=urlParse(_0x353732);var _0x213551=_0x2d5243[_0x685b('0x12')]===_0x685b('0x13')?https:http;var _0x56cd09={'host':_0x2d5243[_0x685b('0x14')],'path':_0x2d5243[_0x685b('0x0')],'headers':{'user-agent':_0x685b('0x15')}};_0x213551[_0x685b('0x16')](_0x56cd09,function(_0x296832){if(_0x296832[_0x685b('0x17')]!==0xc8){logger[_0x685b('0x18')](_0x685b('0x19')+_0x353732+_0x685b('0x1a')+_0x296832['statusCode']+'\x20('+_0x296832[_0x685b('0x1b')]+')');_0x296bf1(new Error(_0x685b('0x19')+_0x353732+_0x685b('0x1a')+_0x296832[_0x685b('0x17')]+'\x20('+_0x296832['statusMessage']+')'));return;}var _0x1ce9f8=fs[_0x685b('0x1c')](_0x171dc7);_0x1ce9f8['on'](_0x685b('0x1d'),function(){logger[_0x685b('0x1e')](_0x685b('0x1f'));_0x1ce9f8[_0x685b('0x20')](_0x445497);});_0x1ce9f8['on'](_0x685b('0x18'),function(_0x12b21f){fs['unlink'](_0x171dc7);logger[_0x685b('0x18')](_0x685b('0x21'),_0x12b21f);_0x296bf1(_0x12b21f);});_0x296832[_0x685b('0x22')](_0x1ce9f8);})['on']('error',function(_0xd1b6e7){logger[_0x685b('0x18')](_0xd1b6e7);_0x296bf1(_0xd1b6e7);})[_0x685b('0x23')]();});}function uploadFile(_0x2202b6){return new BPromise(function(_0x59a9ca,_0x54b9c9){var _0x4138f4=urlParse(_0x2202b6);var _0x38c87b=_0x4138f4[_0x685b('0x12')]===_0x685b('0x13')?https:http;var _0x3fe325={'host':_0x4138f4[_0x685b('0x14')],'path':_0x4138f4[_0x685b('0x0')],'headers':{'user-agent':'WHAT_EVER'}};_0x38c87b['get'](_0x3fe325,function(_0x569b1b){if(_0x569b1b[_0x685b('0x17')]!==0xc8){_0x54b9c9(new Error(_0x685b('0x19')+_0x2202b6+_0x685b('0x1a')+_0x569b1b[_0x685b('0x17')]+'\x20('+_0x569b1b[_0x685b('0x1b')]+')'));return;}var _0x2d5111='';_0x569b1b['on'](_0x685b('0x24'),function(_0x342bc5){_0x2d5111+=_0x342bc5;});_0x569b1b['on'](_0x685b('0x23'),function(){_0x59a9ca(_0x2d5111);});})['on'](_0x685b('0x18'),function(_0xedd1a2){_0x54b9c9(_0xedd1a2);})[_0x685b('0x23')]();});}function convertFile(_0x548ec4,_0x5dda9f){return new BPromise(function(_0xc659fc,_0x2d3ec5){var _0x34916e=sox[_0x685b('0x25')](_0x548ec4,_0x5dda9f,{'sampleRate':0x1f40,'format':'wav','channelCount':0x1,'bitRate':0xc0*0x400,'compressionQuality':0x5});_0x34916e['on'](_0x685b('0x18'),function(_0x55963e){logger[_0x685b('0x18')](_0x685b('0x26'),_0x55963e);_0x2d3ec5(_0x55963e);});_0x34916e['on']('end',function(){logger[_0x685b('0x1e')](_0x685b('0x27'));_0xc659fc();});_0x34916e[_0x685b('0x28')]();});}function base64Decode(_0x40dd25,_0x3cdb25){var _0x437991=path[_0x685b('0x29')](__dirname,_0x685b('0x2a'),rs[_0x685b('0x2b')](0x4)+_0x685b('0x2c'));fs['writeFileSync'](_0x437991,_0x40dd25,_0x685b('0x2d'));return convertFile(_0x437991,_0x3cdb25)[_0x685b('0x2e')](function(){try{fs['unlink'](_0x437991);fs[_0x685b('0x2f')](_0x3cdb25,_0x685b('0x30'));}catch(_0xa92829){logger['error'](_0xa92829);}return _0x3cdb25['split']('.')[0x0];});}function base64Encode(_0x95cf01){var _0x235687=fs[_0x685b('0x31')](_0x95cf01);return new Buffer(_0x235687)['toString']('base64');}exports[_0x685b('0x32')]=function(_0x5ed218,_0x2df873,_0x5b7f75,_0x5f02af,_0x419a1a,_0x3d3358){var _0x3e8f40,_0x189144;var _0x3b9249='https://texttospeech.googleapis.com/v1/';var _0x5b4e6d=_0x685b('0x33')+_0x5ed218;var _0x5f3fda={};if(_0x2df873===_0x685b('0x34')){_0x5f3fda['input']={'ssml':_0x5b7f75};}else{_0x5f3fda[_0x685b('0x35')]={'text':_0x5b7f75};};_0x5f3fda[_0x685b('0x36')]={'languageCode':_0x5f02af,'ssmlGender':_0x419a1a};_0x5f3fda['audioConfig']={'audioEncoding':_0x685b('0x37'),'sampleRateHertz':0x1f40};var _0x4b910e={'url':_0x3b9249+_0x685b('0x38')+_0x5b4e6d,'method':_0x685b('0x39'),'json':!![],'body':_0x5f3fda};return rp(_0x4b910e)[_0x685b('0x2e')](function(_0x4b4ff9){return new BPromise(function(_0x572e87,_0x28f2f8){_0x3e8f40=path[_0x685b('0x29')](__dirname,_0x685b('0x2a'),rs[_0x685b('0x2b')](0x4)+_0x685b('0x3a'));var _0x17a46d=Buffer[_0x685b('0x3b')](_0x4b4ff9[_0x685b('0x3c')],_0x685b('0x2d'));return fs[_0x685b('0x3d')](_0x3e8f40,_0x17a46d,function(_0x277dd9){_0x28f2f8(_0x277dd9);},function(_0x6c8861){fs[_0x685b('0x2f')](_0x3e8f40,'777');_0x572e87(_0x6c8861);});});})[_0x685b('0x2e')](function(_0x44799a){_0x189144=path[_0x685b('0x29')](__dirname,_0x685b('0x2a'),rs[_0x685b('0x2b')](0x4)+'.wav');return convertFile(_0x3e8f40,_0x189144);})['then'](function(){try{fs[_0x685b('0x3e')](_0x3e8f40);fs[_0x685b('0x2f')](_0x189144,_0x685b('0x30'));}catch(_0x497114){logger[_0x685b('0x18')](_0x497114);}logger['info']('googleCloudTTS\x20path',_0x189144[_0x685b('0x3f')]('.')[0x0]);return _0x189144[_0x685b('0x3f')]('.')[0x0];});};exports['googleTTS']=function(_0x4ce504,_0xf9d913){var _0x50f02a,_0x2f7f73;return tts(_0x4ce504,_0xf9d913||'en',0x1)['then'](function(_0x5bd4f3){logger[_0x685b('0x1e')](_0x5bd4f3);_0x50f02a=path[_0x685b('0x29')](__dirname,'tmp',rs[_0x685b('0x2b')](0x4)+'.mp3');return downloadFile(_0x5bd4f3,_0x50f02a);})[_0x685b('0x2e')](function(){_0x2f7f73=path['resolve'](__dirname,_0x685b('0x2a'),rs[_0x685b('0x2b')](0x4)+_0x685b('0x2c'));return convertFile(_0x50f02a,_0x2f7f73);})[_0x685b('0x2e')](function(){try{fs[_0x685b('0x3e')](_0x50f02a);fs['chmodSync'](_0x2f7f73,_0x685b('0x30'));}catch(_0xe27097){logger[_0x685b('0x18')](_0xe27097);}logger[_0x685b('0x1e')](_0x685b('0x40'),_0x2f7f73[_0x685b('0x3f')]('.')[0x0]);return _0x2f7f73[_0x685b('0x3f')]('.')[0x0];});};exports[_0x685b('0x41')]=function(_0x185245,_0x358f7a,_0x515d48){return google[_0x685b('0x42')](_0x185245,_0x358f7a,_0x515d48)[_0x685b('0x2e')](function(_0x20481b){logger[_0x685b('0x1e')](_0x20481b[_0x685b('0x43')]);return rp(_0x20481b);})[_0x685b('0x2e')](function(_0x2dba44){var _0xba2915='';var _0x34b8b6=0x0;try{fs['unlink'](_0x185245);}catch(_0x2b3187){logger[_0x685b('0x18')](_0x2b3187);}if(_0x2dba44&&_0x2dba44[_0x685b('0x44')]){_0xba2915=_0x2dba44[_0x685b('0x44')][_0x685b('0x45')](function(_0x20946f){return _0x20946f&&_0x20946f[_0x685b('0x46')][0x0]&&_0x20946f[_0x685b('0x46')][0x0]['transcript']?_0x20946f[_0x685b('0x46')][0x0][_0x685b('0x47')]:'';})[_0x685b('0x48')]('\x0a');_0x34b8b6=_0x2dba44['results']['map'](function(_0x406f69){return _0x406f69&&_0x406f69[_0x685b('0x46')][0x0]&&_0x406f69[_0x685b('0x46')][0x0][_0x685b('0x49')]?_0x406f69['alternatives'][0x0][_0x685b('0x49')]:0x0;})['join']('\x0a');}logger[_0x685b('0x1e')](_0x685b('0x4a'),_0xba2915);logger['info'](_0x685b('0x4b'),_0x34b8b6);return{'transcript':_0xba2915,'confidence':_0x34b8b6};})[_0x685b('0x4c')](function(_0x3f0407){logger[_0x685b('0x18')](_0x685b('0x4d'),_0x3f0407[_0x685b('0x17')],_0x3f0407[_0x685b('0x4e')],_0x3f0407[_0x685b('0x4f')]);});};exports[_0x685b('0x50')]=function(_0x103934,_0x2ca085,_0x5a340e,_0x3f3ffe){var _0xf0a58e=apiai(_0x2ca085,{'language':_0x3f3ffe||'en'});return _0xf0a58e[_0x685b('0x51')](_0x5a340e,{'sessionId':md5(_0x103934)})[_0x685b('0x2e')](function(_0x487ba3){logger[_0x685b('0x1e')](JSON[_0x685b('0x52')](_0x487ba3));return{'source':_0x487ba3[_0x685b('0x53')][_0x685b('0x54')],'resolvedQuery':_0x487ba3[_0x685b('0x53')][_0x685b('0x55')],'action':_0x487ba3[_0x685b('0x53')][_0x685b('0x56')],'actionIncomplete':_0x487ba3[_0x685b('0x53')][_0x685b('0x57')],'speech':_0x487ba3[_0x685b('0x53')][_0x685b('0x58')]['speech'],'score':_0x487ba3['result'][_0x685b('0x59')],'statusCode':_0x487ba3[_0x685b('0x5a')][_0x685b('0x5b')],'endConversation':_0x487ba3[_0x685b('0x53')][_0x685b('0x5c')]['endConversation']||![],'isFallbackIntent':_0x487ba3['result'][_0x685b('0x5c')][_0x685b('0x5d')]};});};exports['tildeASR']=function(_0x2c0dc9,_0x1d1d13,_0x42a202,_0x4d8cd3){return tilde[_0x685b('0x42')](_0x2c0dc9,_0x1d1d13,_0x42a202,_0x4d8cd3)['then'](function(_0x3a6da3){try{fs[_0x685b('0x3e')](_0x2c0dc9);}catch(_0x22d79c){logger[_0x685b('0x18')](_0x22d79c);}logger['info']('Tilde\x20ASR\x20transcription',_0x3a6da3['transcript']);logger[_0x685b('0x1e')](_0x685b('0x5e'),_0x3a6da3[_0x685b('0x49')]);return _0x3a6da3;});};exports[_0x685b('0x5f')]=function(_0x588e87,_0x4eedd0,_0x1eae90,_0x134953,_0x39de13,_0x4e5293){var _0x5d96de=path[_0x685b('0x29')](__dirname,_0x685b('0x2a'),rs[_0x685b('0x2b')](0x4)+_0x685b('0x3a'));var _0x6d26e0;return aws[_0x685b('0x60')](_0x588e87,_0x4eedd0,_0x1eae90,_0x134953,_0x39de13,_0x4e5293,_0x5d96de)[_0x685b('0x2e')](function(){_0x6d26e0=path['resolve'](__dirname,_0x685b('0x2a'),rs[_0x685b('0x2b')](0x4)+_0x685b('0x2c'));return convertFile(_0x5d96de,_0x6d26e0);})['then'](function(){try{fs[_0x685b('0x3e')](_0x5d96de);fs['chmodSync'](_0x6d26e0,'777');}catch(_0x26c1d1){logger[_0x685b('0x18')](_0x26c1d1);}return _0x6d26e0[_0x685b('0x3f')]('.')[0x0];});};exports[_0x685b('0x61')]=function(_0x480bf4,_0x14435a,_0x500cae,_0x23465b,_0xe9bc31,_0x5ad534){return aws[_0x685b('0x62')](_0x480bf4,_0x14435a,_0x500cae,_0x23465b,_0xe9bc31,_0x5ad534)[_0x685b('0x2e')](function(_0x37977c){logger[_0x685b('0x1e')](JSON[_0x685b('0x52')](_0x37977c));return _0x37977c;});};exports[_0x685b('0x63')]=function(_0x41aaee,_0x423868,_0xf224a9,_0x68bf76){var _0x34fc68=util[_0x685b('0x64')](_0x685b('0x65'),ISPEECH_API,_0x41aaee,encodeURIComponent(_0x423868),_0xf224a9,_0x68bf76);var _0x28c2ad=path['resolve'](__dirname,_0x685b('0x2a'),rs['generate'](0x4)+'.mp3');var _0x1ff53a;return downloadFile(_0x34fc68,_0x28c2ad)['then'](function(){_0x1ff53a=path[_0x685b('0x29')](__dirname,_0x685b('0x2a'),rs['generate'](0x4)+_0x685b('0x2c'));return convertFile(_0x28c2ad,_0x1ff53a);})[_0x685b('0x2e')](function(){try{fs['unlink'](_0x28c2ad);fs[_0x685b('0x2f')](_0x1ff53a,_0x685b('0x30'));}catch(_0x5e7a4a){logger[_0x685b('0x18')](_0x5e7a4a);}return _0x1ff53a[_0x685b('0x3f')]('.')[0x0];});};exports[_0x685b('0x66')]=function(_0x3905ff,_0x1fe9e2,_0x5a6aea,_0x55d4c5){var _0x47d96e=util[_0x685b('0x64')](_0x685b('0x67'),ISPEECH_API,_0x1fe9e2,_0x5a6aea,base64Encode(_0x3905ff),_0x55d4c5?util[_0x685b('0x64')]('model=%s',encodeURIComponent(_0x55d4c5)):'freeform=3');return uploadFile(_0x47d96e)[_0x685b('0x2e')](function(_0x266d37){return querystring[_0x685b('0x3')](_0x266d37);});};exports[_0x685b('0x68')]=function(_0x55b218,_0x37c4f8){return sestek[_0x685b('0x69')](_0x55b218,_0x37c4f8)[_0x685b('0x2e')](function(_0x5961b6){logger[_0x685b('0x1e')](JSON[_0x685b('0x52')](_0x5961b6));var _0x6a5277={'speech':_0x5961b6[_0x685b('0x6a')],'action':_0x5961b6['channelData']?_0x5961b6[_0x685b('0x6b')][_0x685b('0x6c')]:undefined,'actiondata':_0x5961b6[_0x685b('0x6b')]?_0x5961b6[_0x685b('0x6b')][_0x685b('0x6d')]:undefined};if(_0x5961b6[_0x685b('0x6b')]&&_0x5961b6[_0x685b('0x6b')]['AudioFromTts']){return base64Decode(_0x5961b6[_0x685b('0x6b')][_0x685b('0x6e')][_0x685b('0x6f')],path[_0x685b('0x29')](__dirname,_0x685b('0x2a'),rs[_0x685b('0x2b')](0x4)+_0x685b('0x2c')))[_0x685b('0x2e')](function(_0x416533){_0x6a5277[_0x685b('0x70')]=_0x416533;return _0x6a5277;});}return _0x6a5277;});};exports[_0x685b('0x71')]=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 6601e53..b371639 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 _0x19ac=['exports','./nda'];(function(_0x531d16,_0x550515){var _0x57ef41=function(_0x3db013){while(--_0x3db013){_0x531d16['push'](_0x531d16['shift']());}};_0x57ef41(++_0x550515);}(_0x19ac,0x91));var _0xc19a=function(_0x725b8e,_0xc22b48){_0x725b8e=_0x725b8e-0x0;var _0x43ac45=_0x19ac[_0x725b8e];return _0x43ac45;};var nda=require(_0xc19a('0x0'));module[_0xc19a('0x1')]={'nda':nda};
\ No newline at end of file
+var _0xaf9a=['exports','./nda'];(function(_0x56d04c,_0x3762c4){var _0x278a10=function(_0x420def){while(--_0x420def){_0x56d04c['push'](_0x56d04c['shift']());}};_0x278a10(++_0x3762c4);}(_0xaf9a,0x1bd));var _0xaaf9=function(_0x4ca7bc,_0x279008){_0x4ca7bc=_0x4ca7bc-0x0;var _0x55cf12=_0xaf9a[_0x4ca7bc];return _0x55cf12;};var nda=require(_0xaaf9('0x0'));module[_0xaaf9('0x1')]={'nda':nda};
\ No newline at end of file
diff --git a/server/services/agi/scripts/sestek/nda/index.js b/server/services/agi/scripts/sestek/nda/index.js
index 5a4c9fd..a0abff7 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 _0x368c=['body','channelData','project','AudioOutputSettings','audio/wav','custom_action','CustomAction','CustomActionData','custom_action_data','info','request-promise','url','../../../../../config/logger','agi','exports','POST','resolve','/token','password','username','then','/api/NaturalDialogAssistant/v1/Run','ndaactivity_type','message','Nda','uniqueid','callerid','calleridname','dnid','Bearer\x20'];(function(_0x5d3014,_0x1e45b1){var _0x233311=function(_0x2ded35){while(--_0x2ded35){_0x5d3014['push'](_0x5d3014['shift']());}};_0x233311(++_0x1e45b1);}(_0x368c,0x64));var _0xc368=function(_0x560752,_0x3a49c4){_0x560752=_0x560752-0x0;var _0x260304=_0x368c[_0x560752];return _0x260304;};'use strict';var rp=require(_0xc368('0x0'));var url=require(_0xc368('0x1'));var logger=require(_0xc368('0x2'))(_0xc368('0x3'));module[_0xc368('0x4')]=function(_0x7eab34,_0x4189e3){var _0x56231e={'method':_0xc368('0x5'),'uri':url[_0xc368('0x6')](_0x4189e3['ndauth_url'],_0xc368('0x7')),'form':{'grant_type':_0xc368('0x8'),'username':_0x4189e3[_0xc368('0x9')],'password':_0x4189e3['password']},'json':!![]};return rp(_0x56231e)[_0xc368('0xa')](function(_0x58dce7){var _0x68ae88={'method':'POST','uri':url[_0xc368('0x6')](_0x4189e3['ndassistant_url'],_0xc368('0xb')),'body':{'type':_0x4189e3[_0xc368('0xc')]||_0xc368('0xd'),'channelId':_0xc368('0xe'),'conversation':{'id':_0x7eab34[_0xc368('0xf')]},'from':{'id':_0x7eab34[_0xc368('0x10')],'name':_0x7eab34[_0xc368('0x11')]},'recipient':{'id':_0x7eab34[_0xc368('0x12')],'name':_0x7eab34['extension']},'text':_0x4189e3['text'],'channelData':{}},'headers':{'Authorization':_0xc368('0x13')+_0x58dce7['access_token']},'json':!![]};if(_0x4189e3['project']){_0x68ae88[_0xc368('0x14')][_0xc368('0x15')]['ProjectName']=_0x4189e3[_0xc368('0x16')];}if(_0x4189e3['ndagenerate_audio']=='1'){_0x68ae88['body'][_0xc368('0x15')][_0xc368('0x17')]={'Generate':!![],'PutInStructuredPart':![],'ExpectedFormat':_0xc368('0x18')};}if(_0x4189e3[_0xc368('0x19')]){_0x68ae88[_0xc368('0x14')]['channelData'][_0xc368('0x1a')]=_0x4189e3['custom_action'];if(_0x4189e3['custom_action_data']){_0x68ae88[_0xc368('0x14')]['channelData'][_0xc368('0x1b')]=_0x4189e3[_0xc368('0x1c')];}}logger[_0xc368('0x1d')](JSON['stringify'](_0x68ae88));return rp(_0x68ae88);});};
\ No newline at end of file
+var _0xfa98=['resolve','ndauth_url','/token','username','password','/api/NaturalDialogAssistant/v1/Run','ndaactivity_type','message','Nda','uniqueid','callerid','calleridname','dnid','text','Bearer\x20','project','body','channelData','ProjectName','ndagenerate_audio','audio/wav','custom_action','custom_action_data','CustomActionData','info','stringify','request-promise','url','exports'];(function(_0x25e934,_0x4757dd){var _0x162c25=function(_0x5c8c4e){while(--_0x5c8c4e){_0x25e934['push'](_0x25e934['shift']());}};_0x162c25(++_0x4757dd);}(_0xfa98,0x193));var _0x8fa9=function(_0x11e92e,_0x2125b4){_0x11e92e=_0x11e92e-0x0;var _0x4b235d=_0xfa98[_0x11e92e];return _0x4b235d;};'use strict';var rp=require(_0x8fa9('0x0'));var url=require(_0x8fa9('0x1'));var logger=require('../../../../../config/logger')('agi');module[_0x8fa9('0x2')]=function(_0x3682a5,_0x191994){var _0x4c181a={'method':'POST','uri':url[_0x8fa9('0x3')](_0x191994[_0x8fa9('0x4')],_0x8fa9('0x5')),'form':{'grant_type':'password','username':_0x191994[_0x8fa9('0x6')],'password':_0x191994[_0x8fa9('0x7')]},'json':!![]};return rp(_0x4c181a)['then'](function(_0x537d9b){var _0x35e721={'method':'POST','uri':url[_0x8fa9('0x3')](_0x191994['ndassistant_url'],_0x8fa9('0x8')),'body':{'type':_0x191994[_0x8fa9('0x9')]||_0x8fa9('0xa'),'channelId':_0x8fa9('0xb'),'conversation':{'id':_0x3682a5[_0x8fa9('0xc')]},'from':{'id':_0x3682a5[_0x8fa9('0xd')],'name':_0x3682a5[_0x8fa9('0xe')]},'recipient':{'id':_0x3682a5[_0x8fa9('0xf')],'name':_0x3682a5['extension']},'text':_0x191994[_0x8fa9('0x10')],'channelData':{}},'headers':{'Authorization':_0x8fa9('0x11')+_0x537d9b['access_token']},'json':!![]};if(_0x191994[_0x8fa9('0x12')]){_0x35e721[_0x8fa9('0x13')][_0x8fa9('0x14')][_0x8fa9('0x15')]=_0x191994[_0x8fa9('0x12')];}if(_0x191994[_0x8fa9('0x16')]=='1'){_0x35e721[_0x8fa9('0x13')][_0x8fa9('0x14')]['AudioOutputSettings']={'Generate':!![],'PutInStructuredPart':![],'ExpectedFormat':_0x8fa9('0x17')};}if(_0x191994[_0x8fa9('0x18')]){_0x35e721[_0x8fa9('0x13')][_0x8fa9('0x14')]['CustomAction']=_0x191994['custom_action'];if(_0x191994[_0x8fa9('0x19')]){_0x35e721[_0x8fa9('0x13')][_0x8fa9('0x14')][_0x8fa9('0x1a')]=_0x191994[_0x8fa9('0x19')];}}logger[_0x8fa9('0x1b')](JSON[_0x8fa9('0x1c')](_0x35e721));return rp(_0x35e721);});};
\ 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 a6a7ace..3b2d731 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 _0xf195=['./lib/api','exports'];(function(_0x385215,_0x2d1218){var _0x4a22fb=function(_0x244531){while(--_0x244531){_0x385215['push'](_0x385215['shift']());}};_0x4a22fb(++_0x2d1218);}(_0xf195,0xc8));var _0x5f19=function(_0x3826ad,_0x49a30d){_0x3826ad=_0x3826ad-0x0;var _0x17b900=_0xf195[_0x3826ad];return _0x17b900;};'use strict';var asr=require(_0x5f19('0x0'));module[_0x5f19('0x1')]=function(_0x101a0a,_0x1c640f,_0x53677c,_0x3f916b){return asr(_0x101a0a,_0x1c640f,_0x53677c,_0x3f916b);};
\ No newline at end of file
+var _0x4e06=['exports','./lib/api'];(function(_0x29f557,_0xec2fdf){var _0x95cf83=function(_0x3eb587){while(--_0x3eb587){_0x29f557['push'](_0x29f557['shift']());}};_0x95cf83(++_0xec2fdf);}(_0x4e06,0xad));var _0x64e0=function(_0x50d1c6,_0x40051c){_0x50d1c6=_0x50d1c6-0x0;var _0x3cd375=_0x4e06[_0x50d1c6];return _0x3cd375;};'use strict';var asr=require(_0x64e0('0x0'));module[_0x64e0('0x1')]=function(_0x4d0909,_0x32cb55,_0x157548,_0x96efa6){return asr(_0x4d0909,_0x32cb55,_0x157548,_0x96efa6);};
\ 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 1d0c362..2a03d1c 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 _0x9a98=['digest','hex','unix','send','stringify','createReadStream','data','EOS','error','Tilde\x20ASR\x20send\x20error','parse','status','result','final','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','terminate','Close\x20Tilde\x20ASR\x20socket','Error\x20Tilde\x20ASR\x20socket','isObject','open','message','close','bluebird','lodash','moment','crypto','agi','info','Tilde\x20URI','wss://runa.tilde.lv/client/ws/speech/LVASR-ONLINE','No\x20speech.\x20Sent\x20when\x20the\x20incoming\x20audio\x20contains\x20a\x20large\x20portion\x20of\x20silence\x20or\x20non-speech'];(function(_0x3dd15e,_0x1f0015){var _0x231fd0=function(_0x4f680a){while(--_0x4f680a){_0x3dd15e['push'](_0x3dd15e['shift']());}};_0x231fd0(++_0x1f0015);}(_0x9a98,0xba));var _0x89a9=function(_0x548c00,_0x151cb0){_0x548c00=_0x548c00-0x0;var _0x40ccb9=_0x9a98[_0x548c00];return _0x40ccb9;};'use strict';var BPromise=require(_0x89a9('0x0'));var _=require(_0x89a9('0x1'));var fs=require('fs');var WebSocket=require('ws');var moment=require(_0x89a9('0x2'));var crypto=require(_0x89a9('0x3'));var logger=require('../../../../../../config/logger')(_0x89a9('0x4'));module['exports']=function(_0x3ad126,_0x4bd76b,_0x5209da,_0x4faad1){return new BPromise(function(_0x38715c,_0x163924){logger[_0x89a9('0x5')](_0x89a9('0x6'),_0x4faad1||_0x89a9('0x7'));var _0x21ccb5=new WebSocket(_0x4faad1||_0x89a9('0x7'),{'perMessageDeflate':![]});var _0x535650='';var _0x2d74f1='0';var _0x113b92='1';var _0x4810ab=_0x89a9('0x8');function _0x214e4c(_0x4f33ce){var _0x4ef41b=crypto['createHash']('sha1');_0x4ef41b['update'](_0x4f33ce);return _0x4ef41b[_0x89a9('0x9')](_0x89a9('0xa'));}function _0x279f18(){try{logger[_0x89a9('0x5')]('Open\x20Tilde\x20ASR\x20socket');var _0x22eb60=moment()[_0x89a9('0xb')]();var _0x182790=_0x214e4c(_0x22eb60+_0x4bd76b+_0x5209da);_0x21ccb5[_0x89a9('0xc')](JSON[_0x89a9('0xd')]({'appID':_0x4bd76b,'timestamp':_0x22eb60,'appKey':_0x182790}));var _0x4d74e5=fs[_0x89a9('0xe')](_0x3ad126);_0x4d74e5['on'](_0x89a9('0xf'),function(_0x498016){_0x21ccb5['send'](_0x498016);});_0x4d74e5['on']('close',function(){_0x21ccb5[_0x89a9('0xc')](_0x89a9('0x10'));});}catch(_0x52d9eb){logger[_0x89a9('0x11')](_0x89a9('0x12'),JSON['stringify'](_0x52d9eb));_0x21ccb5['terminate']();}}function _0x507a57(_0x5094e6){try{if(_0x5094e6){var _0x41e3ec=JSON[_0x89a9('0x13')](_0x5094e6);switch(_0x41e3ec[_0x89a9('0x14')]){case 0x0:if(_0x41e3ec[_0x89a9('0x15')]){if(_0x41e3ec[_0x89a9('0x15')][_0x89a9('0x16')]){logger[_0x89a9('0x5')](_0x89a9('0x17'),JSON[_0x89a9('0xd')](_0x41e3ec[_0x89a9('0x15')][_0x89a9('0x18')]));_0x535650=_0x41e3ec[_0x89a9('0x15')]['hypotheses'][0x0][_0x89a9('0x19')];_0x2d74f1=_0x41e3ec[_0x89a9('0x15')][_0x89a9('0x18')][0x0][_0x89a9('0x1a')];_0x113b92='0';_0x4810ab='Success.';_0x21ccb5['terminate']();}}break;case 0x1:logger[_0x89a9('0x5')]('No\x20speech.\x20Sent\x20when\x20the\x20incoming\x20audio\x20contains\x20a\x20large\x20portion\x20of\x20silence\x20or\x20non-speech');_0x113b92='1';_0x4810ab=_0x89a9('0x8');break;case 0x2:logger[_0x89a9('0x5')](_0x89a9('0x1b'));_0x113b92='2';_0x4810ab=_0x89a9('0x1b');break;case 0x9:logger['info'](_0x89a9('0x1c'));_0x113b92='9';_0x4810ab='Not\x20available.\x20Max\x20load\x20limit\x20reached.';break;case 0xa:logger['info'](_0x89a9('0x1d'));_0x113b92='10';_0x4810ab='Authentication\x20failed.';break;case 0xb:logger[_0x89a9('0x5')](_0x89a9('0x1e'));_0x113b92='11';_0x4810ab='All\x20recognition\x20workers\x20are\x20currently\x20in\x20use\x20and\x20real-time\x20recognition\x20is\x20not\x20possible.';}}}catch(_0x328b3a){logger[_0x89a9('0x11')](_0x89a9('0x1f'),JSON[_0x89a9('0xd')](_0x328b3a));_0x21ccb5[_0x89a9('0x20')]();}}function _0xbe4409(){logger['info'](_0x89a9('0x21'));_0x38715c({'transcript':_0x535650,'confidence':_0x2d74f1,'status':_0x113b92,'status_message':_0x4810ab});}function _0xe766d7(_0x5eb847){logger[_0x89a9('0x11')](_0x89a9('0x22'));if(!_['isNil'](_0x5eb847)){logger[_0x89a9('0x11')](_[_0x89a9('0x23')](_0x5eb847)?JSON[_0x89a9('0xd')](_0x5eb847):_0x5eb847);}}_0x21ccb5['on'](_0x89a9('0x24'),_0x279f18);_0x21ccb5['on'](_0x89a9('0x25'),_0x507a57);_0x21ccb5['on'](_0x89a9('0x26'),_0xbe4409);_0x21ccb5['on']('error',_0xe766d7);});};
\ No newline at end of file
+var _0xdb87=['close','EOS','error','Tilde\x20ASR\x20send\x20error','terminate','parse','status','result','final','info','Tilde\x20ASR\x20hypoteses','transcript','hypotheses','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','Error\x20Tilde\x20ASR\x20socket','isNil','isObject','open','message','bluebird','lodash','moment','../../../../../../config/logger','exports','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','digest','Open\x20Tilde\x20ASR\x20socket','stringify','send'];(function(_0x206487,_0x28eec1){var _0x2714c7=function(_0x298179){while(--_0x298179){_0x206487['push'](_0x206487['shift']());}};_0x2714c7(++_0x28eec1);}(_0xdb87,0x1af));var _0x7db8=function(_0x6dcbd0,_0x344a04){_0x6dcbd0=_0x6dcbd0-0x0;var _0x4c2c2a=_0xdb87[_0x6dcbd0];return _0x4c2c2a;};'use strict';var BPromise=require(_0x7db8('0x0'));var _=require(_0x7db8('0x1'));var fs=require('fs');var WebSocket=require('ws');var moment=require(_0x7db8('0x2'));var crypto=require('crypto');var logger=require(_0x7db8('0x3'))('agi');module[_0x7db8('0x4')]=function(_0x1e0b53,_0x26fb20,_0x25e783,_0x2b877b){return new BPromise(function(_0x596239,_0x1f242b){logger['info']('Tilde\x20URI',_0x2b877b||_0x7db8('0x5'));var _0x33870d=new WebSocket(_0x2b877b||_0x7db8('0x5'),{'perMessageDeflate':![]});var _0x3dea4c='';var _0xe01055='0';var _0x2f6558='1';var _0x21c582=_0x7db8('0x6');function _0xd2dd62(_0xa3a3df){var _0x4c8838=crypto[_0x7db8('0x7')](_0x7db8('0x8'));_0x4c8838['update'](_0xa3a3df);return _0x4c8838[_0x7db8('0x9')]('hex');}function _0xdbb5e0(){try{logger['info'](_0x7db8('0xa'));var _0x24c1dc=moment()['unix']();var _0x4c1235=_0xd2dd62(_0x24c1dc+_0x26fb20+_0x25e783);_0x33870d['send'](JSON[_0x7db8('0xb')]({'appID':_0x26fb20,'timestamp':_0x24c1dc,'appKey':_0x4c1235}));var _0x21bdcb=fs['createReadStream'](_0x1e0b53);_0x21bdcb['on']('data',function(_0x4749ee){_0x33870d[_0x7db8('0xc')](_0x4749ee);});_0x21bdcb['on'](_0x7db8('0xd'),function(){_0x33870d[_0x7db8('0xc')](_0x7db8('0xe'));});}catch(_0x480dfd){logger[_0x7db8('0xf')](_0x7db8('0x10'),JSON[_0x7db8('0xb')](_0x480dfd));_0x33870d[_0x7db8('0x11')]();}}function _0x5b6118(_0x5c0df5){try{if(_0x5c0df5){var _0x79bcf1=JSON[_0x7db8('0x12')](_0x5c0df5);switch(_0x79bcf1[_0x7db8('0x13')]){case 0x0:if(_0x79bcf1['result']){if(_0x79bcf1[_0x7db8('0x14')][_0x7db8('0x15')]){logger[_0x7db8('0x16')](_0x7db8('0x17'),JSON[_0x7db8('0xb')](_0x79bcf1[_0x7db8('0x14')]['hypotheses']));_0x3dea4c=_0x79bcf1[_0x7db8('0x14')]['hypotheses'][0x0][_0x7db8('0x18')];_0xe01055=_0x79bcf1[_0x7db8('0x14')][_0x7db8('0x19')][0x0][_0x7db8('0x1a')];_0x2f6558='0';_0x21c582='Success.';_0x33870d[_0x7db8('0x11')]();}}break;case 0x1:logger[_0x7db8('0x16')]('No\x20speech.\x20Sent\x20when\x20the\x20incoming\x20audio\x20contains\x20a\x20large\x20portion\x20of\x20silence\x20or\x20non-speech');_0x2f6558='1';_0x21c582='No\x20speech.\x20Sent\x20when\x20the\x20incoming\x20audio\x20contains\x20a\x20large\x20portion\x20of\x20silence\x20or\x20non-speech';break;case 0x2:logger[_0x7db8('0x16')]('Aborted.\x20Recognition\x20was\x20aborted\x20for\x20some\x20reason.');_0x2f6558='2';_0x21c582=_0x7db8('0x1b');break;case 0x9:logger[_0x7db8('0x16')](_0x7db8('0x1c'));_0x2f6558='9';_0x21c582=_0x7db8('0x1c');break;case 0xa:logger['info']('Authentication\x20failed.');_0x2f6558='10';_0x21c582=_0x7db8('0x1d');break;case 0xb:logger[_0x7db8('0x16')](_0x7db8('0x1e'));_0x2f6558='11';_0x21c582=_0x7db8('0x1e');}}}catch(_0x5e6ce7){logger[_0x7db8('0xf')](_0x7db8('0x1f'),JSON[_0x7db8('0xb')](_0x5e6ce7));_0x33870d[_0x7db8('0x11')]();}}function _0x3d8b07(){logger[_0x7db8('0x16')]('Close\x20Tilde\x20ASR\x20socket');_0x596239({'transcript':_0x3dea4c,'confidence':_0xe01055,'status':_0x2f6558,'status_message':_0x21c582});}function _0x3b02ba(_0x3c3f1e){logger[_0x7db8('0xf')](_0x7db8('0x20'));if(!_[_0x7db8('0x21')](_0x3c3f1e)){logger['error'](_[_0x7db8('0x22')](_0x3c3f1e)?JSON[_0x7db8('0xb')](_0x3c3f1e):_0x3c3f1e);}}_0x33870d['on'](_0x7db8('0x23'),_0xdbb5e0);_0x33870d['on'](_0x7db8('0x24'),_0x5b6118);_0x33870d['on'](_0x7db8('0xd'),_0x3d8b07);_0x33870d['on'](_0x7db8('0xf'),_0x3b02ba);});};
\ 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 31f430c..865d752 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 _0x9bc7=['exports','./asr'];(function(_0xa464c9,_0x7c86d8){var _0x3d73c4=function(_0x5c2056){while(--_0x5c2056){_0xa464c9['push'](_0xa464c9['shift']());}};_0x3d73c4(++_0x7c86d8);}(_0x9bc7,0x1cd));var _0x79bc=function(_0x397e5f,_0x454c8f){_0x397e5f=_0x397e5f-0x0;var _0x5302b8=_0x9bc7[_0x397e5f];return _0x5302b8;};var asr=require(_0x79bc('0x0'));module[_0x79bc('0x1')]={'asr':asr};
\ No newline at end of file
+var _0xde80=['exports','./asr'];(function(_0x5e9d62,_0x2ab24b){var _0xc1cfdb=function(_0x34dc7e){while(--_0x34dc7e){_0x5e9d62['push'](_0x5e9d62['shift']());}};_0xc1cfdb(++_0x2ab24b);}(_0xde80,0x1d1));var _0x0de8=function(_0x845f8f,_0x29564a){_0x845f8f=_0x845f8f-0x0;var _0x3a2bd9=_0xde80[_0x845f8f];return _0x3a2bd9;};var asr=require(_0x0de8('0x0'));module[_0x0de8('0x1')]={'asr':asr};
\ No newline at end of file
diff --git a/server/services/agi/server.js b/server/services/agi/server.js
index 10d8859..0c0713e 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 _0x7e16=['net','events','EventEmitter','127.0.0.1','call','E_AGI_ARGUMENT_PORT','createServer','listen','listening','connection','getConnections','error','E_AGI_SERVER_VOICE_DISABLED','destroy','emit','E_AGI_SERVER_MAXCONNECTION','E_AGI_SERVER_ERROR','code','close','E_AGI_SERVER_CLOSE','nextTick','inherits','util'];(function(_0xf91065,_0x1cb6d3){var _0x545c69=function(_0x49d78f){while(--_0x49d78f){_0xf91065['push'](_0xf91065['shift']());}};_0x545c69(++_0x1cb6d3);}(_0x7e16,0x16f));var _0x67e1=function(_0xdd7e69,_0x103a05){_0xdd7e69=_0xdd7e69-0x0;var _0x4b4a8e=_0x7e16[_0xdd7e69];return _0x4b4a8e;};'use strict';var util=require(_0x67e1('0x0'));var net=require(_0x67e1('0x1'));var EventEmitter=require(_0x67e1('0x2'))[_0x67e1('0x3')];var AGIError=require('./error');var AGIChannel=require('./channel');var AGIServer=function(_0x190359,_0x53bbdf,_0x268f07){var _0x25d798=this,_0x190359=_0x190359||0x11dd,_0x53bbdf=_0x53bbdf||_0x67e1('0x4'),_0x3b5769=null,_0x2e0cb9=0x0;EventEmitter[_0x67e1('0x5')](_0x25d798);function _0x5736e2(){if(!_0x190359){_0x25d798['emit']('error',new AGIError(_0x67e1('0x6')));return![];}_0x3b5769=net[_0x67e1('0x7')]();_0x3b5769[_0x67e1('0x8')](_0x190359,_0x53bbdf);_0x3b5769['on'](_0x67e1('0x9'),function(){_0x25d798['emit'](_0x67e1('0x9'));});_0x3b5769['on'](_0x67e1('0xa'),function(_0x24c2e4){_0x3b5769[_0x67e1('0xb')](function(_0x488e0c,_0x245030){if(_0x488e0c){_0x25d798['emit'](_0x67e1('0xc'),new AGIError('E_AGI_SERVER_ERROR',_0x488e0c));}else if(_0x268f07&&_0x268f07<0x0){_0x25d798['emit'](_0x67e1('0xc'),new AGIError(_0x67e1('0xd')));_0x24c2e4[_0x67e1('0xe')]();}else if(_0x268f07&&_0x268f07>0x0&&_0x268f07<_0x245030){_0x2e0cb9+=0x1;_0x25d798[_0x67e1('0xf')]('error',new AGIError(_0x67e1('0x10'),_0x2e0cb9));_0x24c2e4[_0x67e1('0xe')]();}else{var _0x13564c=new AGIChannel(_0x24c2e4);_0x13564c['on']('ready',function(){_0x25d798[_0x67e1('0xf')](_0x67e1('0xa'),_0x13564c);});}});});_0x3b5769['on'](_0x67e1('0xc'),function(_0x1fd37c){_0x25d798[_0x67e1('0xf')](_0x67e1('0xc'),new AGIError(_0x67e1('0x11'),_0x1fd37c[_0x67e1('0x12')]));});_0x3b5769['on'](_0x67e1('0x13'),function(){_0x25d798[_0x67e1('0xf')]('close',new AGIError(_0x67e1('0x14')));});}process[_0x67e1('0x15')](function(){_0x5736e2();});};util[_0x67e1('0x16')](AGIServer,EventEmitter);module['exports']=function(_0x525b3d,_0x52eac5,_0x3ee9e3){return new AGIServer(_0x525b3d,_0x52eac5,_0x3ee9e3);};
\ No newline at end of file
+var _0xadec=['EventEmitter','./error','call','emit','createServer','listen','listening','connection','getConnections','error','E_AGI_SERVER_ERROR','E_AGI_SERVER_VOICE_DISABLED','destroy','E_AGI_SERVER_MAXCONNECTION','code','close','E_AGI_SERVER_CLOSE','nextTick','inherits','exports','util','net','events'];(function(_0x1fa649,_0x44ed31){var _0x5f167c=function(_0x2d1256){while(--_0x2d1256){_0x1fa649['push'](_0x1fa649['shift']());}};_0x5f167c(++_0x44ed31);}(_0xadec,0x156));var _0xcade=function(_0x3ac326,_0x2a22de){_0x3ac326=_0x3ac326-0x0;var _0x9ddf0a=_0xadec[_0x3ac326];return _0x9ddf0a;};'use strict';var util=require(_0xcade('0x0'));var net=require(_0xcade('0x1'));var EventEmitter=require(_0xcade('0x2'))[_0xcade('0x3')];var AGIError=require(_0xcade('0x4'));var AGIChannel=require('./channel');var AGIServer=function(_0x55ad3c,_0x570d9c,_0x475533){var _0x875b81=this,_0x55ad3c=_0x55ad3c||0x11dd,_0x570d9c=_0x570d9c||'127.0.0.1',_0x4da887=null,_0x5c8b77=0x0;EventEmitter[_0xcade('0x5')](_0x875b81);function _0x4c36e8(){if(!_0x55ad3c){_0x875b81[_0xcade('0x6')]('error',new AGIError('E_AGI_ARGUMENT_PORT'));return![];}_0x4da887=net[_0xcade('0x7')]();_0x4da887[_0xcade('0x8')](_0x55ad3c,_0x570d9c);_0x4da887['on'](_0xcade('0x9'),function(){_0x875b81['emit'](_0xcade('0x9'));});_0x4da887['on'](_0xcade('0xa'),function(_0x1339b6){_0x4da887[_0xcade('0xb')](function(_0x15f6f8,_0x2ad733){if(_0x15f6f8){_0x875b81[_0xcade('0x6')](_0xcade('0xc'),new AGIError(_0xcade('0xd'),_0x15f6f8));}else if(_0x475533&&_0x475533<0x0){_0x875b81[_0xcade('0x6')](_0xcade('0xc'),new AGIError(_0xcade('0xe')));_0x1339b6[_0xcade('0xf')]();}else if(_0x475533&&_0x475533>0x0&&_0x475533<_0x2ad733){_0x5c8b77+=0x1;_0x875b81[_0xcade('0x6')]('error',new AGIError(_0xcade('0x10'),_0x5c8b77));_0x1339b6[_0xcade('0xf')]();}else{var _0x2c5976=new AGIChannel(_0x1339b6);_0x2c5976['on']('ready',function(){_0x875b81[_0xcade('0x6')](_0xcade('0xa'),_0x2c5976);});}});});_0x4da887['on']('error',function(_0x135fb7){_0x875b81[_0xcade('0x6')](_0xcade('0xc'),new AGIError('E_AGI_SERVER_ERROR',_0x135fb7[_0xcade('0x11')]));});_0x4da887['on'](_0xcade('0x12'),function(){_0x875b81[_0xcade('0x6')]('close',new AGIError(_0xcade('0x13')));});}process[_0xcade('0x14')](function(){_0x4c36e8();});};util[_0xcade('0x15')](AGIServer,EventEmitter);module[_0xcade('0x16')]=function(_0x42bb52,_0x137534,_0x1e0ead){return new AGIServer(_0x42bb52,_0x137534,_0x1e0ead);};
\ No newline at end of file
diff --git a/server/services/agi/vertices.js b/server/services/agi/vertices.js
index c825528..4fcf9e6 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 _0x124b=['request-promise','../../config/logger','agi','../../config/environment','./scripts','/var/opt/motion2/server/files','rawBody','menu','getdigits','getsecretdigits','rpc','mailRpc','prototype','getVariable','getVariableById','then','name','catch','getVoiceQueue','getVoiceQueueById','getSquareProject','getSquareProjectById','getSquareOdbc','getSquareOdbcById','getUser','getTrunk','getTrunkById','getSoundById','getSoundPath','save_name','getMailAccount','getMailAccountById','sendMailMessage','getIntervals','IntervalId','interval','map','Intervals','format','%s/sounds/converted/%s','getQueryOdbc','open','error','Error\x20getting\x20ODBC\x20connection\x20%s','query','info','Error\x20executing\x20query\x20%s','Query\x20executed\x20correctly\x20%s','close','getSmsAccountById','createSmsMessage','createSquareDetailsReport','channel','uniqueid','arg_1','createSquareRecording','callerid','context','extension','accountcode','createSquareMessage','createCmContact','isEmpty','isNil','callback_','lastName','phone','list_id','callback','toString','callback_priority','getPause','getPauseById','agentPause','agentUnpause','agent','agentLogout','agentLogin','internal','%s/%s@from-sip/n','LOCAL','trim','googleCloudTTS','apiKey','google_cloud_tts_text_type','text','languageCode','en-US','ssmlGender','MALE','audioEncoding','MP3','googleTTS','google_tts_language','url','method','timeout','number','includes','An\x20incorrect\x20formatted\x20json\x20body\x20has\x20been\x20passed\x20to\x20the\x20function','headers','rawHeaders','An\x20incorrect\x20formatted\x20json\x20headers\x20has\x20been\x20passed\x20to\x20the\x20function','computedVariables','uri','render','parse','stringify','body','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','ispeech_asr_language','isConfigured','model','awsPolly','aws_access_key_id','aws_secret_access_key','aws_polly_voice','Amy','aws_text_type','awsLex','aws_lex_region','aws_bot_name','googleASR','google_asr_language','tildeASR','appid','clear','agicommand','clone','hasOwnProperty','isString','replaceObjectAllVariables','replaceAllVariables','recursiveNodeIndex','isPlainObject','isArray','length','saveRestApiResult','%s.%s','setVariable','split','extra','getAndSetVariable','result','The\x20\x22%s\x22\x20variable\x20value\x20is:\x20%s','maxRetry','sync','Enter\x20in\x20AGI\x20(%s)\x20block','label','command','args','answer','Enter\x20in\x20ANSWER\x20(%s)\x20block','Wait\x20%s\x20seconds\x20before\x20answer','wait','Enter\x20in\x20CALLBACK\x20(%s)\x20block','no\x20list\x20selected','scheduledAt','delay','minutes','noop','CALLBACK\x20added\x20phone:\x20%s\x20on\x20list:\x20%s\x20at\x20%s','custom_app','Enter\x20in\x20CUSTOM\x20APP\x20(%s)\x20block','exec','application','Executed\x20command\x20%s\x20%s','Enter\x20in\x20LUMENVOXTTS\x20(%s)\x20block','no\x20text\x20configured','Executed\x20command\x20MRCPSynth\x20%s','sestektts','Enter\x20in\x20SESTEKTTS\x20(%s)\x20block','MRCPSynth','lumenvoxasr','grammar','no\x20grammar\x20configured','RECOG_CONFIDENCE()','LUMENVOX_ASR_CONFIDENCE','RECOG_INPUT()','LUMENVOX_ASR_TRANSCRIPT','RECOG_INSTANCE()','LUMENVOX_ASR_INSTANCE','Executed\x20command\x20MRCPRecog\x20%s','MRCPRecog','SESTEK_ASR_INSTANCE','database','Enter\x20in\x20DATABASE\x20(%s)\x20block','odbc_id','no\x20database\x20selected','no\x20odbc\x20database\x20found','no\x20query\x20configured','variable_id','no\x20variable\x20selected\x20for\x20the\x20result','no\x20variable\x20found','forEach','keys','%s[%s][%s]','%s_ROWS_COUNT','dial','debug','Enter\x20in\x20DIAL\x20(%s)\x20block','sip_id','no\x20user\x20selected','DIAL','SIP/%s','opts','dialogflow','Enter\x20in\x20DIALOGFLOW\x20(%s)\x20block','no\x20key\x20configured','Trying\x20Dialogflow:\x20%s','speech','Dialogflow\x20Result\x20%s','Dialogflow\x20is\x20unreachable','sesteknda','ndauth_url','no\x20ndauth\x20url\x20configured','no\x20username\x20configured','no\x20password\x20configured','ndassistant_url','Trying\x20SestekNDA:\x20%s','SESTEK_NDA_%s','toUpperCase','audiofile','streamFile','unlink','SestekNDA\x20is\x20unreachable','Enter\x20in\x20END\x20(%s)\x20block','end','ext_dial','trunk_id','no\x20trunk\x20found','trunk_name','no\x20trunk\x20selected','SIP/%s/%s','Executed\x20command\x20%s','finally','Enter\x20in\x20GETDIGITS\x20(%s)\x20block','file_id','no\x20file\x20audio\x20selected','getSound','no\x20file\x20audio\x20found','getData','maxdigit','mindigit','hiddendigitsnum','generate','hiddendigitspos','first','substr','Enter\x20in\x20GETSECRETDIGITS\x20(%s)\x20block','goal','Enter\x20in\x20GOAL\x20(%s)\x20block','GOAL\x20%s','awspolly','[AGI]\x20Enter\x20in\x20AWSPOLLY\x20(%s)\x20block','no\x20valid\x20credentials\x20configured','Trying\x20aws\x20Polly\x20%s','aws\x20Polly\x20%s\x20file\x20created','.wav','aws\x20Polly\x20is\x20unreachable','Enter\x20in\x20Amazon\x20Lex\x20(%s)\x20block','no\x20bot\x20name\x20configured','bot','Trying\x20Amazon\x20Lex:\x20%s','AWS_LEX_%s','Amazon\x20Lex\x20ready\x20for\x20fulfillment','out','Amazon\x20Lex\x20is\x20unreachable','wav','%s/recordings/%s','beep','NOBEEP','recordFile','google\x20%s\x20file\x20created','GOOGLE_ASR_%s','GoogleASR\x20Result\x20%s','Enter\x20in\x20TILDEASR\x20(%s)\x20block','no\x20appid\x20configured','appsecret','no\x20appsecret\x20configured','intKey','tilde\x20%s\x20file\x20created','TILDE_ASR_%s','TildeASR\x20Result\x20%s','gotoc','Enter\x20in\x20GOTO\x20(%s)\x20block','continueAt','Enter\x20in\x20GOTOIF\x20(%s)\x20block','condition','no\x20condition\x20configured','false','EVAL\x20CONDITION\x20%s\x20%s','gotoiftime','Enter\x20in\x20GOTOIFTIME\x20(%s)\x20block','interval_id','no\x20intervals\x20found','IFTIME(%s?true:false)','IFTIME\x20%s\x20%s','true','hangup','Enter\x20in\x20HANGUP\x20(%s)\x20block','ispeechasr','ispeechASR','ISPEECH_ASR_%s','IspeechASR\x20Result\x20%s','ispeechtts','Enter\x20in\x20ISPEECHTTS\x20(%s)\x20block','Trying\x20ispeech\x20TTS\x20%s','ispeech\x20%s\x20file\x20created','login','no\x20find\x20by\x20configured','FIND\x20AGENT\x20%s\x20BY\x20%s','findBy','AGENT\x20%s\x20FOUND\x20BY','success','AGENT\x20%s\x20NOT\x20FOUND\x20BY','failure','logout','math','Enter\x20in\x20MATH\x20(%s)\x20block','operation','no\x20operation\x20configured','%s[%s]','variable\x20%s[key]\x20set','Enter\x20in\x20MENU\x20(%s)\x20block','retry','response','digit','Enter\x20in\x20NOOP\x20(%s)\x20block','output','pause','pause_id','playback','Enter\x20in\x20PLAYBACK\x20(%s)\x20block','PLAYBACK','queue','queue_id','no\x20queue\x20selected','no\x20queue\x20found','indexOf','XMCS-QUEUE','QUEUE','macro','gosub','record','Enter\x20in\x20RECORD\x20(%s)\x20block','%s_%s','RECORDING_SAVENAME','Recording\x20%s\x20%s\x20%s\x20%s','restapi','Enter\x20in\x20RESTAPI\x20(%s)\x20block','no\x20url\x20configured','restAPI','Response:','inspect','%s_STATUS_CODE','200','%s_STATUS_MESSAGE','Unable\x20to\x20set\x20result\x20in\x20variable\x20%s','saydigits','Enter\x20in\x20SAYDIGITS\x20(%s)\x20block','digits','saynumber','Enter\x20in\x20SAYNUMBER\x20(%s)\x20block','sayNumber','escape_digits','sayPhonetic','Enter\x20in\x20SENDMAIL\x20(%s)\x20block','account_id','no\x20mail\x20account\x20found','email','Smtp','user','bcc','subject','service','host','port','secure','auth','pass','template_id','Mail\x20message\x20added\x20to\x20outgoing\x20process','sendFax','Enter\x20in\x20SENDFAX\x20(%s)\x20block','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','set','start','START\x20CALLY\x20SQUARE','yes','Answer','Skipped\x20Answer','subproject','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','system','Enter\x20in\x20SYSTEM\x20(%s)\x20block','shellCommand','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','Trying\x20Google\x20Cloud\x20TTS\x20%s','Google\x20Cloud\x20TTS\x20is\x20unreachable','Enter\x20in\x20GOOGLETTS\x20(%s)\x20block','Trying\x20Google\x20TTS\x20%s','Google\x20TTS\x20is\x20unreachable','unpause','Enter\x20in\x20UNPAUSE\x20(%s)\x20block','VOICEMAIL','mailbox','vswitch','no\x20variable\x20selected','replaceAll','path','lodash','shelljs','odbc','mustache'];(function(_0x4c98b9,_0x1ad11b){var _0x3a257a=function(_0x147857){while(--_0x147857){_0x4c98b9['push'](_0x4c98b9['shift']());}};_0x3a257a(++_0x1ad11b);}(_0x124b,0x1b5));var _0xb124=function(_0x4a8ace,_0x108871){_0x4a8ace=_0x4a8ace-0x0;var _0x586554=_0x124b[_0x4a8ace];return _0x586554;};'use strict';var fs=require('fs');var path=require(_0xb124('0x0'));var util=require('util');var _=require(_0xb124('0x1'));var sh=require(_0xb124('0x2'));var odbc=require(_0xb124('0x3'))();var rs=require('randomstring');var moment=require('moment');var Mustache=require(_0xb124('0x4'));var rp=require(_0xb124('0x5'));var logger=require(_0xb124('0x6'))(_0xb124('0x7'));var config=require(_0xb124('0x8'));var scripts=require(_0xb124('0x9'));var FILES_PATH=_0xb124('0xa');var recursiveMapAttributes=['rawHeaders',_0xb124('0xb')];var verticesWithRetry=[_0xb124('0xc'),_0xb124('0xd'),_0xb124('0xe')];var AGIVertices=function(_0x2c1feb,_0x4a9039,_0x198154){this['channel']=_0x2c1feb;this[_0xb124('0xf')]=_0x4a9039;this[_0xb124('0x10')]=_0x198154;};AGIVertices[_0xb124('0x11')][_0xb124('0x12')]=function(_0x52de0c,_0x394970){this[_0xb124('0xf')][_0xb124('0x13')](_0x52de0c)[_0xb124('0x14')](function(_0x44f854){_0x394970(null,_0x44f854?_0x44f854[_0xb124('0x15')]:![]);})[_0xb124('0x16')](function(_0x2db81f){_0x394970(_0x2db81f);});};AGIVertices[_0xb124('0x11')][_0xb124('0x17')]=function(_0x3a68c9,_0x110d90){this[_0xb124('0xf')][_0xb124('0x18')](_0x3a68c9)[_0xb124('0x14')](function(_0xd6002d){_0x110d90(null,_0xd6002d?_0xd6002d['name']:![]);})[_0xb124('0x16')](function(_0x437926){_0x110d90(_0x437926);});};AGIVertices[_0xb124('0x11')][_0xb124('0x19')]=function(_0x28b0fc,_0x593172){this[_0xb124('0xf')][_0xb124('0x1a')](_0x28b0fc)[_0xb124('0x14')](function(_0x3691be){_0x593172(null,_0x3691be?_0x3691be['name']:![]);})[_0xb124('0x16')](function(_0x42daf0){_0x593172(_0x42daf0);});};AGIVertices[_0xb124('0x11')][_0xb124('0x1b')]=function(_0x41b027,_0x15a8d8){this[_0xb124('0xf')][_0xb124('0x1c')](_0x41b027)[_0xb124('0x14')](function(_0x27e8ef){_0x15a8d8(null,_0x27e8ef?_0x27e8ef['dsn']:![]);})[_0xb124('0x16')](function(_0x3e5051){_0x15a8d8(_0x3e5051);});};AGIVertices[_0xb124('0x11')][_0xb124('0x1d')]=function(_0x4fdad9,_0x4e6bda){this['rpc']['getUserById'](_0x4fdad9)['then'](function(_0x3bc919){_0x4e6bda(null,_0x3bc919?_0x3bc919[_0xb124('0x15')]:![]);})['catch'](function(_0xc2282){_0x4e6bda(_0xc2282);});};AGIVertices[_0xb124('0x11')][_0xb124('0x1e')]=function(_0x95fda7,_0x14892d){this[_0xb124('0xf')][_0xb124('0x1f')](_0x95fda7)['then'](function(_0x126067){_0x14892d(null,_0x126067?_0x126067[_0xb124('0x15')]:![]);})[_0xb124('0x16')](function(_0x4e2864){_0x14892d(_0x4e2864);});};AGIVertices['prototype']['getSound']=function(_0x3884ae,_0x51f134){var _0x49c462=this;this[_0xb124('0xf')][_0xb124('0x20')](_0x3884ae)['then'](function(_0x59185a){_0x51f134(null,_0x59185a?_0x49c462[_0xb124('0x21')](_0x59185a[_0xb124('0x22')]):![]);})[_0xb124('0x16')](function(_0x1d2bc8){_0x51f134(_0x1d2bc8);});};AGIVertices[_0xb124('0x11')][_0xb124('0x23')]=function(_0x31b3c7,_0x328546){this[_0xb124('0xf')][_0xb124('0x24')](_0x31b3c7)[_0xb124('0x14')](function(_0x2e968b){_0x328546(null,_0x2e968b?_0x2e968b:![]);})['catch'](function(_0x240d6a){_0x328546(_0x240d6a);});};AGIVertices[_0xb124('0x11')][_0xb124('0x25')]=function(_0x4f8fb5,_0x4b959f,_0x23fa39){this[_0xb124('0x10')][_0xb124('0x25')](_0x4f8fb5,_0x4b959f)[_0xb124('0x14')](function(){_0x23fa39(null);})[_0xb124('0x16')](function(_0x22ed97){_0x23fa39(_0x22ed97);});};AGIVertices[_0xb124('0x11')][_0xb124('0x26')]=function(_0x5d6a8a,_0x376786){this[_0xb124('0xf')]['getIntervalById'](_0x5d6a8a)[_0xb124('0x14')](function(_0x458384){if(_0x458384){if(_0x458384[_0xb124('0x27')]){_0x376786(null,[_0x458384[_0xb124('0x28')]]);}else{_0x376786(null,_[_0xb124('0x29')](_0x458384[_0xb124('0x2a')],_0xb124('0x28')));}}else{_0x376786(null,![]);}})['catch'](function(_0x16938a){_0x376786(_0x16938a);});};AGIVertices[_0xb124('0x11')][_0xb124('0x21')]=function(_0x5a24b0){return util[_0xb124('0x2b')](_0xb124('0x2c'),FILES_PATH,_0x5a24b0);};AGIVertices[_0xb124('0x11')][_0xb124('0x2d')]=function(_0x4b8700,_0x15f62d,_0x366361){odbc[_0xb124('0x2e')](_0x4b8700,function(_0x21b573){if(_0x21b573){logger[_0xb124('0x2f')](_0xb124('0x30'),_0x21b573);_0x366361(_0x21b573);}else{logger['info']('ODBC\x20connection\x20successfully');odbc[_0xb124('0x31')](_0x15f62d,function(_0x56a802,_0x5cbee3){if(_0x56a802){logger[_0xb124('0x32')](_0xb124('0x33'),_0x15f62d);_0x366361(_0x56a802);}else{logger[_0xb124('0x32')](_0xb124('0x34'),_0x15f62d);odbc[_0xb124('0x35')](function(_0xc548a5){if(_0xc548a5){logger[_0xb124('0x2f')]('Error\x20closing\x20connection\x20to\x20odbc\x20%s',_0xc548a5);}_0x366361(null,_0x5cbee3);});}});}});};AGIVertices[_0xb124('0x11')]['getSmsAccount']=function(_0x5dae15,_0x124d31){this[_0xb124('0xf')][_0xb124('0x36')](_0x5dae15)[_0xb124('0x14')](function(_0x2a9a2d){_0x124d31(null,_0x2a9a2d?_0x2a9a2d:![]);})[_0xb124('0x16')](function(_0x309517){_0x124d31(_0x309517);});};AGIVertices[_0xb124('0x11')]['createSmsMessage']=function(_0x2b76b0,_0x1a3906){this[_0xb124('0xf')][_0xb124('0x37')](_0x2b76b0)[_0xb124('0x14')](function(_0x5c68fe){_0x1a3906(null,_0x5c68fe);})[_0xb124('0x16')](function(_0xbcf36){_0x1a3906(_0xbcf36);});};AGIVertices[_0xb124('0x11')]['createSquareDetailsReport']=function(_0x1ad2db,_0x595c78,_0x34f058){this[_0xb124('0xf')][_0xb124('0x38')]({'uniqueid':this[_0xb124('0x39')][_0xb124('0x3a')],'node':_0x1ad2db['label'],'application':_0x1ad2db['agicommand'],'data':_0x595c78||null,'project_name':this['channel'][_0xb124('0x3b')],'callerid':this['channel']['callerid']})[_0xb124('0x14')](function(_0x15e1f3){if(_0x34f058){_0x34f058(null,_0x15e1f3);}})[_0xb124('0x16')](function(_0x2cb813){if(_0x34f058){_0x34f058(_0x2cb813);}});};AGIVertices[_0xb124('0x11')]['createSquareRecording']=function(_0x2e1d66,_0x2175d0,_0x3c097b,_0x23ca1e){this[_0xb124('0xf')][_0xb124('0x3c')]({'uniqueid':this[_0xb124('0x39')][_0xb124('0x3a')],'callerid':this[_0xb124('0x39')][_0xb124('0x3d')],'calleridname':this[_0xb124('0x39')]['calleridname'],'context':this[_0xb124('0x39')][_0xb124('0x3e')],'extension':this[_0xb124('0x39')][_0xb124('0x3f')],'priority':this[_0xb124('0x39')]['priority'],'accountcode':this[_0xb124('0x39')][_0xb124('0x40')],'dnid':this[_0xb124('0x39')]['dnid'],'projectName':this[_0xb124('0x39')][_0xb124('0x3b')],'saveName':_0x2175d0,'filename':_0x2e1d66['file']||_0x2175d0,'savePath':_0x3c097b})[_0xb124('0x14')](function(_0x25e0fd){_0x23ca1e(null,_0x25e0fd);})[_0xb124('0x16')](function(_0x589250){_0x23ca1e(_0x589250);});};AGIVertices[_0xb124('0x11')][_0xb124('0x41')]=function(_0x88c911,_0x195c5b,_0x3ba5a0){this['rpc'][_0xb124('0x41')]({'uniqueid':this[_0xb124('0x39')][_0xb124('0x3a')],'body':_0x88c911,'direction':_0x195c5b})[_0xb124('0x14')](function(_0x4e9915){if(_0x3ba5a0){_0x3ba5a0(null,_0x4e9915);}})[_0xb124('0x16')](function(_0x42911c){if(_0x3ba5a0){_0x3ba5a0(_0x42911c);}});};AGIVertices[_0xb124('0x11')][_0xb124('0x42')]=function(_0x2167ab,_0x35d6a0){this[_0xb124('0xf')][_0xb124('0x42')]({'firstName':_[_0xb124('0x43')](_0x2167ab['name'])||_[_0xb124('0x44')](_0x2167ab[_0xb124('0x15')])?_0xb124('0x45')+Math['random']():_0x2167ab[_0xb124('0x15')],'lastName':_[_0xb124('0x43')](_0x2167ab['lastName'])||_[_0xb124('0x44')](_0x2167ab['lastName'])?null:_0x2167ab[_0xb124('0x46')],'phone':_0x2167ab[_0xb124('0x47')],'ListId':_0x2167ab[_0xb124('0x48')],'scheduledat':_0x2167ab['scheduledAt'],'callbackUniqueid':this[_0xb124('0x39')]['uniqueid'],'tags':_0xb124('0x49'),'description':'Callback\x20scheduled\x20at\x20'+_0x2167ab['scheduledAt'][_0xb124('0x4a')](),'priority':_0x2167ab[_0xb124('0x4b')]})[_0xb124('0x14')](function(_0x83e177){_0x35d6a0(null,_0x83e177);})[_0xb124('0x16')](function(_0x57773a){_0x35d6a0(_0x57773a);});};AGIVertices[_0xb124('0x11')][_0xb124('0x4c')]=function(_0x1ed99a,_0x1288f9){this[_0xb124('0xf')][_0xb124('0x4d')](_0x1ed99a)[_0xb124('0x14')](function(_0x38df6b){_0x1288f9(null,_0x38df6b?_0x38df6b[_0xb124('0x15')]:![]);})[_0xb124('0x16')](function(_0x579b5){_0x1288f9(_0x579b5);});};AGIVertices['prototype'][_0xb124('0x4e')]=function(_0x401118,_0x369e20,_0x99af34){var _0x430f43={'role':'agent'};_0x430f43[_0x401118]=this[_0xb124('0x39')][_0xb124('0x3d')];this[_0xb124('0xf')]['agentPause'](_0x430f43,_0x369e20,this[_0xb124('0x39')][_0xb124('0x3a')])[_0xb124('0x14')](function(_0x36d082){_0x99af34(null,_['isNil'](_0x36d082)?![]:!![]);})[_0xb124('0x16')](function(_0xa5a9bf){logger[_0xb124('0x2f')](_0xa5a9bf);_0x99af34(null,![]);});};AGIVertices[_0xb124('0x11')][_0xb124('0x4f')]=function(_0x566150,_0x381fa9){var _0x52a7f5={'role':_0xb124('0x50')};_0x52a7f5[_0x566150]=this[_0xb124('0x39')][_0xb124('0x3d')];this[_0xb124('0xf')][_0xb124('0x4f')](_0x52a7f5)[_0xb124('0x14')](function(_0x53b276){_0x381fa9(null,_[_0xb124('0x44')](_0x53b276)?![]:!![]);})['catch'](function(_0x2e6226){logger[_0xb124('0x2f')](_0x2e6226);_0x381fa9(null,![]);});};AGIVertices[_0xb124('0x11')][_0xb124('0x51')]=function(_0x2f59e0,_0x51d53f){var _0x477326={'role':_0xb124('0x50')};_0x477326[_0x2f59e0]=this['channel']['callerid'];this[_0xb124('0xf')][_0xb124('0x51')](_0x477326)['then'](function(_0x4bce81){_0x51d53f(null,_[_0xb124('0x44')](_0x4bce81)?![]:!![]);})[_0xb124('0x16')](function(_0x5be65d){logger['error'](_0x5be65d);_0x51d53f(null,![]);});};AGIVertices[_0xb124('0x11')][_0xb124('0x52')]=function(_0x4b243f,_0x11cbfa){var _0x5e2dc8={'role':'agent'};_0x5e2dc8[_0x4b243f]=this[_0xb124('0x39')][_0xb124('0x3d')];var _0x3f8854=_0x4b243f!=_0xb124('0x53')?util['format'](_0xb124('0x54'),_0xb124('0x55'),this[_0xb124('0x39')][_0xb124('0x3d')]):undefined;this[_0xb124('0xf')][_0xb124('0x52')](_0x5e2dc8,_0x3f8854)[_0xb124('0x14')](function(_0x35e390){_0x11cbfa(null,_[_0xb124('0x44')](_0x35e390)?![]:!![]);})[_0xb124('0x16')](function(_0x28d9cc){logger['error'](_0x28d9cc);_0x11cbfa(null,![]);});};AGIVertices[_0xb124('0x11')]['shellCommand']=function(_0x557445,_0xd5b03f){sh['exec'](_[_0xb124('0x56')](_0x557445),function(_0x645b42,_0xb15a61){var _0x354549=_0xb15a61['replace'](/(\r\n|\n|\r)/gm,'');_0xd5b03f(null,_0x354549);});};AGIVertices[_0xb124('0x11')][_0xb124('0x57')]=function(_0x5417fa,_0x5d0c10){scripts[_0xb124('0x57')](_0x5417fa[_0xb124('0x58')],_0x5417fa[_0xb124('0x59')]||'text',_0x5417fa[_0xb124('0x5a')],_0x5417fa[_0xb124('0x5b')]||_0xb124('0x5c'),_0x5417fa[_0xb124('0x5d')]||_0xb124('0x5e'),_0x5417fa[_0xb124('0x5f')]||_0xb124('0x60'))['then'](function(_0x4bbf44){_0x5d0c10(null,_0x4bbf44);})[_0xb124('0x16')](function(_0x3ee0a0){_0x5d0c10(_0x3ee0a0);});};AGIVertices['prototype'][_0xb124('0x61')]=function(_0x44d384,_0xf45fbe){scripts[_0xb124('0x61')](_0x44d384['text'],_0x44d384[_0xb124('0x62')]||'en',0x1)[_0xb124('0x14')](function(_0x18e0e4){_0xf45fbe(null,_0x18e0e4);})[_0xb124('0x16')](function(_0xe8b42c){_0xf45fbe(_0xe8b42c);});};AGIVertices[_0xb124('0x11')]['restAPI']=function(_0x391601,_0xce9d7d){var _0x39ab68={'uri':_0x391601[_0xb124('0x63')],'method':_0x391601[_0xb124('0x64')],'json':!![],'resolveWithFullResponse':!![],'timeout':typeof parseInt(_0x391601[_0xb124('0x65')])===_0xb124('0x66')&&parseInt(_0x391601[_0xb124('0x65')])>=0x1?parseInt(_0x391601[_0xb124('0x65')])*0x3e8:0x5*0x3e8};if(_[_0xb124('0x67')](['POST','PUT'],_0x39ab68[_0xb124('0x64')]['toUpperCase']())){try{_0x39ab68['body']=_0x391601[_0xb124('0xb')]?JSON['parse'](_0x391601['rawBody']):{};}catch(_0x1072ff){logger['error'](_0xb124('0x68'),_0x1072ff);}}try{_0x39ab68[_0xb124('0x69')]=_0x391601['rawHeaders']?JSON['parse'](_0x391601[_0xb124('0x6a')]):{};}catch(_0x24cfb1){logger['error'](_0xb124('0x6b'),_0x24cfb1);}if(_0x391601[_0xb124('0x6c')]){try{var _0x1bc1d4=require(_0x391601['computedVariables'])['sync'](this,_0x39ab68);_0x39ab68[_0xb124('0x6d')]=Mustache[_0xb124('0x6e')](_0x391601['url'],_0x1bc1d4,{},['$$','$$']);if(_0x39ab68[_0xb124('0x69')]){_0x39ab68[_0xb124('0x69')]=JSON[_0xb124('0x6f')](Mustache[_0xb124('0x6e')](JSON[_0xb124('0x70')](_0x39ab68[_0xb124('0x69')]),_0x1bc1d4,{},['$$','$$']));}if(_0x39ab68[_0xb124('0x71')]){_0x39ab68[_0xb124('0x71')]=JSON[_0xb124('0x6f')](Mustache[_0xb124('0x6e')](JSON[_0xb124('0x70')](_0x39ab68[_0xb124('0x71')]),_0x1bc1d4,{},['$$','$$']));}}catch(_0x2c741a){logger[_0xb124('0x2f')](_0xb124('0x72'),_0x2c741a);}}rp(_0x39ab68)[_0xb124('0x14')](function(_0x978e1c){var _0x15bfcc={'statusCode':_0x978e1c[_0xb124('0x73')]||0xc8,'statusMessage':_0x978e1c[_0xb124('0x74')]||'OK','headers':_0x978e1c[_0xb124('0x69')]||{},'body':_0x978e1c['body']||{}};_0xce9d7d(null,_0x15bfcc);})[_0xb124('0x16')](function(_0x3c7ed1){var _0x55c31e={'statusCode':_0x3c7ed1['statusCode']||0x1f4,'statusMessage':_0x3c7ed1[_0xb124('0x75')]||_0xb124('0x76'),'headers':_0x3c7ed1[_0xb124('0x77')][_0xb124('0x69')]||{},'body':_0x3c7ed1[_0xb124('0x77')][_0xb124('0x71')]||{}};_0xce9d7d(null,_0x55c31e);});};AGIVertices['prototype'][_0xb124('0x78')]=function(_0x458c6f,_0x2d77ab){scripts['googleDialogflow'](this[_0xb124('0x39')]['uniqueid'],_0x458c6f[_0xb124('0x79')],_0x458c6f[_0xb124('0x5a')],_0x458c6f[_0xb124('0x7a')]||'en')[_0xb124('0x14')](function(_0x4587bc){_0x2d77ab(null,_0x4587bc);})[_0xb124('0x16')](function(_0x507275){_0x2d77ab(_0x507275);});};AGIVertices[_0xb124('0x11')][_0xb124('0x7b')]=function(_0x44668a,_0x1761fc){scripts[_0xb124('0x7b')](this[_0xb124('0x39')],_0x44668a)['then'](function(_0x310c44){_0x1761fc(null,_0x310c44);})[_0xb124('0x16')](function(_0x1c0985){_0x1761fc(_0x1c0985);});};AGIVertices[_0xb124('0x11')][_0xb124('0x7c')]=function(_0x30bec9,_0x365ee2){scripts[_0xb124('0x7c')](_0x30bec9[_0xb124('0x79')],_0x30bec9[_0xb124('0x5a')],_0x30bec9[_0xb124('0x7d')]||_0xb124('0x5c'),_0x30bec9[_0xb124('0x7e')])['then'](function(_0x2c336d){_0x365ee2(null,_0x2c336d);})[_0xb124('0x16')](function(_0x4c5842){_0x365ee2(_0x4c5842);});};AGIVertices[_0xb124('0x11')]['ispeechASR']=function(_0xfdf8ab,_0x37e008,_0x5558b8){scripts['ispeechASR'](_0x37e008,_0xfdf8ab[_0xb124('0x79')],_0xfdf8ab[_0xb124('0x7f')]||_0xb124('0x5c'),this[_0xb124('0x80')](_0xfdf8ab[_0xb124('0x81')])?_0xfdf8ab[_0xb124('0x81')]:undefined)['then'](function(_0x7a338e){_0x5558b8(null,_0x7a338e);})[_0xb124('0x16')](function(_0x11f072){_0x5558b8(_0x11f072);});};AGIVertices[_0xb124('0x11')]['awsPolly']=function(_0x3b6127,_0x5c7c5b){scripts[_0xb124('0x82')](_0x3b6127[_0xb124('0x83')],_0x3b6127[_0xb124('0x84')],_0x3b6127['aws_polly_region'],_0x3b6127[_0xb124('0x85')]||_0xb124('0x86'),_0x3b6127[_0xb124('0x5a')],_0x3b6127[_0xb124('0x87')]||_0xb124('0x5a'))[_0xb124('0x14')](function(_0x4ffd0a){_0x5c7c5b(null,_0x4ffd0a);})['catch'](function(_0x43de27){_0x5c7c5b(_0x43de27);});};AGIVertices[_0xb124('0x11')]['awsLex']=function(_0x2dcbf6,_0x373629){scripts[_0xb124('0x88')](this[_0xb124('0x39')][_0xb124('0x3a')],_0x2dcbf6[_0xb124('0x83')],_0x2dcbf6[_0xb124('0x84')],_0x2dcbf6[_0xb124('0x89')],_0x2dcbf6[_0xb124('0x5a')],_0x2dcbf6[_0xb124('0x8a')])['then'](function(_0x2789b3){_0x373629(null,_0x2789b3);})[_0xb124('0x16')](function(_0x4400a7){_0x373629(_0x4400a7);});};AGIVertices[_0xb124('0x11')]['googleASR']=function(_0x50e4d1,_0x3a456f,_0x501157){scripts[_0xb124('0x8b')](_0x3a456f,_0x50e4d1[_0xb124('0x79')],_0x50e4d1[_0xb124('0x8c')]||_0xb124('0x5c'))[_0xb124('0x14')](function(_0x32c48c){_0x501157(null,_0x32c48c);})['catch'](function(_0x5bdeeb){_0x501157(_0x5bdeeb);});};AGIVertices[_0xb124('0x11')][_0xb124('0x8d')]=function(_0x3eab96,_0x214386,_0x456fd5){scripts['tildeASR'](_0x214386,_0x3eab96[_0xb124('0x8e')],_0x3eab96['appsecret'],_0x3eab96[_0xb124('0x6d')])['then'](function(_0x4215e6){_0x456fd5(null,_0x4215e6);})[_0xb124('0x16')](function(_0x512ead){_0x456fd5(_0x512ead);});};AGIVertices[_0xb124('0x11')][_0xb124('0x8f')]=function(_0x3f16da){var _0x24f567=_[_0xb124('0x67')](verticesWithRetry,_0x3f16da[_0xb124('0x90')])?_0x3f16da:_[_0xb124('0x91')](_0x3f16da);for(var _0x2aacc4 in _0x24f567){if(_0x24f567[_0xb124('0x92')](_0x2aacc4)){if(_0x24f567[_0x2aacc4]&&_[_0xb124('0x93')](_0x24f567[_0x2aacc4])){if(_['includes'](recursiveMapAttributes,_0x2aacc4)){_0x24f567[_0x2aacc4]=this[_0xb124('0x94')](_0x24f567[_0x2aacc4]);}else{_0x24f567[_0x2aacc4]=this[_0xb124('0x95')](_0x24f567[_0x2aacc4]);}}}}return _0x24f567;};AGIVertices['prototype'][_0xb124('0x96')]=function(_0x2333c4){for(var _0xcfb44f in _0x2333c4){if(_0x2333c4['hasOwnProperty'](_0xcfb44f)){if(_[_0xb124('0x97')](_0x2333c4[_0xcfb44f])){this[_0xb124('0x96')](_0x2333c4[_0xcfb44f]);}else if(_[_0xb124('0x98')](_0x2333c4[_0xcfb44f])){for(var _0x179eec=0x0;_0x179eec<_0x2333c4[_0xcfb44f][_0xb124('0x99')];_0x179eec++){this['recursiveNodeIndex'](_0x2333c4[_0xcfb44f][_0x179eec]);}}else if(_[_0xb124('0x93')](_0x2333c4[_0xcfb44f])){_0x2333c4[_0xcfb44f]=this['replaceAllVariables'](_0x2333c4[_0xcfb44f]);}}}};AGIVertices[_0xb124('0x11')][_0xb124('0x9a')]=function(_0x50328e,_0x4932ec){for(var _0xf383bd in _0x50328e){if(_0x50328e[_0xb124('0x92')](_0xf383bd)){if(_[_0xb124('0x97')](_0x50328e[_0xf383bd])){if(!_['isEmpty'](_0x50328e[_0xf383bd])){this[_0xb124('0x9a')](_0x50328e[_0xf383bd],util[_0xb124('0x2b')]('%s.%s',_0x4932ec,_0xf383bd));}}else if(_['isArray'](_0x50328e[_0xf383bd])){for(var _0x5afd80=0x0;_0x5afd80<_0x50328e[_0xf383bd]['length'];_0x5afd80++){this[_0xb124('0x9a')](_0x50328e[_0xf383bd][_0x5afd80],util[_0xb124('0x2b')](_0xb124('0x9b'),_0x4932ec,_0xf383bd+'['+_0x5afd80+']'));}}else{if(!_[_0xb124('0x44')](_0x50328e[_0xf383bd])){this[_0xb124('0x39')][_0xb124('0x9c')](util['format'](_0xb124('0x9b'),_0x4932ec,_0xf383bd),_0x50328e[_0xf383bd]);}}}}};AGIVertices[_0xb124('0x11')]['replaceObjectAllVariables']=function(_0x484692){try{var _0x5a6704=JSON[_0xb124('0x6f')](_0x484692);this['recursiveNodeIndex'](_0x5a6704);return JSON[_0xb124('0x70')](_0x5a6704);}catch(_0x1ff69e){return this['replaceAllVariables'](_0x484692);}};AGIVertices[_0xb124('0x11')][_0xb124('0x95')]=function(_0x943e10){var _0x34aeb1=_0x943e10[_0xb124('0x9d')]('{');for(var _0x46cd92=0x1;_0x46cd92<_0x34aeb1['length'];_0x46cd92+=0x1){var _0x796a6c=_0x34aeb1[_0x46cd92][_0xb124('0x9d')]('}');if(_0x796a6c[_0xb124('0x99')]>0x1){_0x943e10=_0x943e10['replaceAll']('{'+_0x796a6c[0x0]+'}',this[_0xb124('0x39')][_0xb124('0x12')](_0x796a6c[0x0])[_0xb124('0x9e')]||_0x796a6c[0x0]);}}if(_0x34aeb1[_0xb124('0x99')]===0x1){return _0x943e10[_0xb124('0x4a')]();}return this[_0xb124('0x95')](_0x943e10);};AGIVertices['prototype'][_0xb124('0x9f')]=function(_0x44efcf,_0x169176){var _0x205a92=this[_0xb124('0x39')]['getVariable'](_0x44efcf);if(_0x205a92[_0xb124('0xa0')]===-0x1){return _0x205a92;}logger[_0xb124('0x32')](util['format'](_0xb124('0xa1'),_0x169176,_0x205a92[_0xb124('0x9e')]));return this[_0xb124('0x39')][_0xb124('0x9c')](_0x169176,_0x205a92[_0xb124('0x9e')]);};AGIVertices[_0xb124('0x11')][_0xb124('0x80')]=function(_0x2f1e7c){return _0x2f1e7c&&_0x2f1e7c!=='0'&&_0x2f1e7c!=='-1'&&_0x2f1e7c!=='';};AGIVertices['prototype'][_0xb124('0xa2')]=function(_0xe4ad08){this[_0xb124('0x38')][_0xb124('0xa3')](this,_0xe4ad08,'-');_0xe4ad08['retry']=_0xe4ad08['maxRetry'];return{'code':0xc8,'result':'-'};};AGIVertices[_0xb124('0x11')][_0xb124('0x7')]=function(_0x56baad){logger['info'](util[_0xb124('0x2b')](_0xb124('0xa4'),_0x56baad[_0xb124('0xa5')]));return this['channel'][_0xb124('0x7')]([_0x56baad[_0xb124('0xa6')],_0x56baad[_0xb124('0xa7')]]);};AGIVertices[_0xb124('0x11')][_0xb124('0xa8')]=function(_0x49d2b0){logger[_0xb124('0x32')](util['format'](_0xb124('0xa9'),_0x49d2b0[_0xb124('0xa5')]));if(this[_0xb124('0x80')](_0x49d2b0[_0xb124('0x65')])){logger[_0xb124('0x32')](util[_0xb124('0x2b')](_0xb124('0xaa'),_0x49d2b0[_0xb124('0x65')]));var _0x58bfb7=this['channel'][_0xb124('0xab')](_0x49d2b0['timeout']);if(_0x58bfb7[_0xb124('0xa0')]===-0x1){return _0x58bfb7;}}return this[_0xb124('0x39')][_0xb124('0xa8')]();};AGIVertices[_0xb124('0x11')][_0xb124('0x49')]=function(_0x30496c){logger['info'](util[_0xb124('0x2b')](_0xb124('0xac'),_0x30496c[_0xb124('0xa5')]));if(!this[_0xb124('0x80')](_0x30496c[_0xb124('0x48')])){return this['channel'][_0xb124('0x2f')](_0x30496c,_0xb124('0xad'));}_0x30496c[_0xb124('0xae')]=moment();if(this[_0xb124('0x80')](_0x30496c[_0xb124('0xaf')])){_0x30496c[_0xb124('0xae')]=moment()['add'](_0x30496c[_0xb124('0xaf')],_0xb124('0xb0'));}if(!this[_0xb124('0x80')](_0x30496c['callback_priority'])){_0x30496c['callback_priority']=0x2;}this[_0xb124('0x42')]['sync'](this,_0x30496c);return this[_0xb124('0x39')][_0xb124('0xb1')](util[_0xb124('0x2b')](_0xb124('0xb2'),_0x30496c[_0xb124('0x47')],_0x30496c['list_id'],_0x30496c[_0xb124('0xae')]));};AGIVertices['prototype'][_0xb124('0xb3')]=function(_0x347102){logger[_0xb124('0x32')](util[_0xb124('0x2b')](_0xb124('0xb4'),_0x347102[_0xb124('0xa5')]));var _0x46d729=this[_0xb124('0x39')][_0xb124('0xb5')](_0x347102[_0xb124('0xb6')],_0x347102[_0xb124('0x77')]);if(_0x46d729['result']===-0x1){return _0x46d729;}return this[_0xb124('0x39')]['noop'](util[_0xb124('0x2b')](_0xb124('0xb7'),_0x347102[_0xb124('0xb6')],_0x347102[_0xb124('0x77')]));};AGIVertices[_0xb124('0x11')]['lumenvoxtts']=function(_0x36a310){logger['info'](util[_0xb124('0x2b')](_0xb124('0xb8'),_0x36a310[_0xb124('0xa5')]));if(!this[_0xb124('0x80')](_0x36a310[_0xb124('0x5a')])){return this[_0xb124('0x39')][_0xb124('0xb1')](_0xb124('0xb9'));}var _0x500480='\x22'+_0x36a310['text']+'\x22';if(this[_0xb124('0x80')](_0x36a310[_0xb124('0x77')])){_0x500480+=','+_0x36a310[_0xb124('0x77')];}var _0x2efd97=this[_0xb124('0x39')]['exec']('MRCPSynth',_0x500480);if(_0x2efd97[_0xb124('0xa0')]===-0x1){return _0x2efd97;}return this[_0xb124('0x39')][_0xb124('0xb1')](util[_0xb124('0x2b')](_0xb124('0xba'),_0x500480));};AGIVertices[_0xb124('0x11')][_0xb124('0xbb')]=function(_0x36336d){logger[_0xb124('0x32')](util[_0xb124('0x2b')](_0xb124('0xbc'),_0x36336d[_0xb124('0xa5')]));if(!this['isConfigured'](_0x36336d[_0xb124('0x5a')])){return this[_0xb124('0x39')][_0xb124('0xb1')](_0xb124('0xb9'));}var _0x22fc1a='\x22'+_0x36336d[_0xb124('0x5a')]+'\x22';if(this[_0xb124('0x80')](_0x36336d[_0xb124('0x77')])){_0x22fc1a+=','+_0x36336d[_0xb124('0x77')];}var _0x42d62c=this[_0xb124('0x39')][_0xb124('0xb5')](_0xb124('0xbd'),_0x22fc1a);if(_0x42d62c[_0xb124('0xa0')]===-0x1){return _0x42d62c;}return this[_0xb124('0x39')][_0xb124('0xb1')](util[_0xb124('0x2b')](_0xb124('0xba'),_0x22fc1a));};AGIVertices['prototype'][_0xb124('0xbe')]=function(_0x48549c){logger[_0xb124('0x32')](util[_0xb124('0x2b')]('Enter\x20in\x20LUMENVOXASR\x20(%s)\x20block',_0x48549c[_0xb124('0xa5')]));if(!this[_0xb124('0x80')](_0x48549c[_0xb124('0xbf')])){return this[_0xb124('0x39')][_0xb124('0xb1')](_0xb124('0xc0'));}var _0x82119e=_0x48549c['grammar'];if(this[_0xb124('0x80')](_0x48549c[_0xb124('0x77')])){_0x82119e+=','+_0x48549c['options'];}var _0x2c9ae7=this[_0xb124('0x39')][_0xb124('0xb5')]('MRCPRecog',_0x82119e);if(_0x2c9ae7[_0xb124('0xa0')]===-0x1){return _0x2c9ae7;}var _0x353d90=this[_0xb124('0x9f')](_0xb124('0xc1'),_0xb124('0xc2'));if(_0x353d90[_0xb124('0xa0')]===-0x1){return _0x353d90;}var _0x245254=this[_0xb124('0x9f')](_0xb124('0xc3'),_0xb124('0xc4'));if(_0x245254[_0xb124('0xa0')]===-0x1){return _0x245254;}var _0x1c943d=this[_0xb124('0x9f')](_0xb124('0xc5'),_0xb124('0xc6'));if(_0x1c943d[_0xb124('0xa0')]===-0x1){return _0x1c943d;}return this[_0xb124('0x39')][_0xb124('0xb1')](util[_0xb124('0x2b')](_0xb124('0xc7'),_0x82119e));};AGIVertices[_0xb124('0x11')]['sestekasr']=function(_0x2ddff3){logger[_0xb124('0x32')](util[_0xb124('0x2b')]('Enter\x20in\x20SESTEKASR\x20(%s)\x20block',_0x2ddff3[_0xb124('0xa5')]));if(!this[_0xb124('0x80')](_0x2ddff3[_0xb124('0xbf')])){return this['channel']['noop'](_0xb124('0xc0'));}var _0x5e2b26=_0x2ddff3[_0xb124('0xbf')];if(this[_0xb124('0x80')](_0x2ddff3['options'])){_0x5e2b26+=','+_0x2ddff3[_0xb124('0x77')];}var _0x1afd61=this[_0xb124('0x39')]['exec'](_0xb124('0xc8'),_0x5e2b26);if(_0x1afd61['result']===-0x1){return _0x1afd61;}var _0x41ade8=this[_0xb124('0x9f')](_0xb124('0xc1'),'SESTEK_ASR_CONFIDENCE');if(_0x41ade8[_0xb124('0xa0')]===-0x1){return _0x41ade8;}var _0x21bd97=this['getAndSetVariable'](_0xb124('0xc3'),'SESTEK_ASR_TRANSCRIPT');if(_0x21bd97[_0xb124('0xa0')]===-0x1){return _0x21bd97;}var _0x10776c=this[_0xb124('0x9f')](_0xb124('0xc5'),_0xb124('0xc9'));if(_0x10776c['result']===-0x1){return _0x10776c;}return this[_0xb124('0x39')][_0xb124('0xb1')](util[_0xb124('0x2b')](_0xb124('0xc7'),_0x5e2b26));};AGIVertices[_0xb124('0x11')][_0xb124('0xca')]=function(_0x480304){logger[_0xb124('0x32')](util[_0xb124('0x2b')](_0xb124('0xcb'),_0x480304[_0xb124('0xa5')]));if(!this[_0xb124('0x80')](_0x480304[_0xb124('0xcc')])){return this[_0xb124('0x39')]['error'](_0x480304,_0xb124('0xcd'));}var _0x53a1f7=this['getSquareOdbc']['sync'](this,_0x480304['odbc_id']);if(!_0x53a1f7){return this[_0xb124('0x39')][_0xb124('0x2f')](_0x480304,_0xb124('0xce'));}if(!this['isConfigured'](_0x480304[_0xb124('0x31')])){return this[_0xb124('0x39')][_0xb124('0x2f')](_0x480304,_0xb124('0xcf'));}var _0x4f9e0c=_0x480304[_0xb124('0x31')]['replace'](/(\r\n|\n|\r)/gm,'\x20');this[_0xb124('0x39')][_0xb124('0xb1')](util['format']('query:\x20%s',_0x4f9e0c));var _0x1471ac=this[_0xb124('0x2d')][_0xb124('0xa3')](this,_0x53a1f7,_0x4f9e0c);this[_0xb124('0x38')][_0xb124('0xa3')](this,_0x480304,_0x4f9e0c);if(!this[_0xb124('0x80')](_0x480304[_0xb124('0xd0')])){return this[_0xb124('0x39')][_0xb124('0xb1')](_0xb124('0xd1'));}var _0x4021e9=this[_0xb124('0x12')][_0xb124('0xa3')](this,_0x480304[_0xb124('0xd0')]);if(!_0x4021e9){return this[_0xb124('0x39')][_0xb124('0x2f')](_0x480304,_0xb124('0xd2'));}var _0x5aea1b=this;_0x1471ac[_0xb124('0xd3')](function(_0x1333a6,_0x5f51ee){Object[_0xb124('0xd4')](_0x1333a6)[_0xb124('0xd3')](function(_0x26ec63){_0x5aea1b['channel'][_0xb124('0x9c')](util[_0xb124('0x2b')](_0xb124('0xd5'),_0x4021e9,_0x5f51ee,_0x26ec63),_0x1333a6[_0x26ec63]);});});this[_0xb124('0x39')][_0xb124('0x9c')](util['format'](_0xb124('0xd6'),_0x4021e9),_0x1471ac[_0xb124('0x99')]);return this['channel'][_0xb124('0xb1')](util['format']('variable\x20%s\x20set',_0x4021e9));};AGIVertices[_0xb124('0x11')][_0xb124('0xd7')]=function(_0x33a7b7){logger[_0xb124('0xd8')](util[_0xb124('0x2b')](_0xb124('0xd9'),_0x33a7b7['label']));if(!this['isConfigured'](_0x33a7b7[_0xb124('0xda')])){return this[_0xb124('0x39')][_0xb124('0x2f')](_0x33a7b7,_0xb124('0xdb'));}var _0x4c0821=this[_0xb124('0x1d')]['sync'](this,_0x33a7b7[_0xb124('0xda')]);if(!_0x4c0821){return this[_0xb124('0x39')][_0xb124('0x2f')](_0x33a7b7,'no\x20user\x20found');}var _0x50f363=this[_0xb124('0x39')]['exec'](_0xb124('0xdc'),[util[_0xb124('0x2b')](_0xb124('0xdd'),_0x4c0821),_0x33a7b7[_0xb124('0x65')],_0x33a7b7[_0xb124('0xde')],_0x33a7b7[_0xb124('0x63')]]);if(_0x50f363[_0xb124('0xa0')]===-0x1){return _0x50f363;}return this[_0xb124('0x39')][_0xb124('0xb1')](util[_0xb124('0x2b')]('Executed\x20command\x20%s','DIAL'));};AGIVertices[_0xb124('0x11')][_0xb124('0xdf')]=function(_0x1870bf){logger[_0xb124('0x32')](util['format'](_0xb124('0xe0'),_0x1870bf[_0xb124('0xa5')]));if(!this[_0xb124('0x80')](_0x1870bf[_0xb124('0x79')])){return this[_0xb124('0x39')]['noop'](_0xb124('0xe1'));}if(!this[_0xb124('0x80')](_0x1870bf['text'])){return this['channel']['noop'](_0xb124('0xb9'));}this[_0xb124('0x39')]['bot']=!![];this[_0xb124('0x38')](_0x1870bf);this['createSquareMessage'](_0x1870bf[_0xb124('0x5a')],'in');this[_0xb124('0x39')][_0xb124('0xb1')](util[_0xb124('0x2b')](_0xb124('0xe2'),_0x1870bf[_0xb124('0x5a')]));var _0x9dae1=this[_0xb124('0x78')][_0xb124('0xa3')](this,_0x1870bf);if(_0x9dae1){for(var _0x3f63d3 in _0x9dae1){if(_0x9dae1[_0xb124('0x92')](_0x3f63d3)){this[_0xb124('0x39')][_0xb124('0x9c')](util[_0xb124('0x2b')]('DIALOGFLOW_%s',_0x3f63d3['toUpperCase']()),_0x9dae1[_0x3f63d3]);}}this[_0xb124('0x41')](_0x9dae1[_0xb124('0xe3')],'out');return this[_0xb124('0x39')][_0xb124('0xb1')](util[_0xb124('0x2b')](_0xb124('0xe4'),_0x9dae1[_0xb124('0xe3')]));}return this[_0xb124('0x39')][_0xb124('0x2f')](_0x1870bf,_0xb124('0xe5'));};AGIVertices[_0xb124('0x11')][_0xb124('0xe6')]=function(_0xb7179b){logger[_0xb124('0x32')](util[_0xb124('0x2b')]('Enter\x20in\x20SESTEKNDA\x20(%s)\x20block',_0xb7179b['label']));if(!this['isConfigured'](_0xb7179b[_0xb124('0xe7')])){return this['channel'][_0xb124('0xb1')](_0xb124('0xe8'));}if(!this[_0xb124('0x80')](_0xb7179b['username'])){return this[_0xb124('0x39')][_0xb124('0xb1')](_0xb124('0xe9'));}if(!this[_0xb124('0x80')](_0xb7179b['password'])){return this[_0xb124('0x39')][_0xb124('0xb1')](_0xb124('0xea'));}if(!this[_0xb124('0x80')](_0xb7179b[_0xb124('0xeb')])){return this[_0xb124('0x39')][_0xb124('0xb1')]('no\x20text\x20configured');}this[_0xb124('0x39')]['bot']=!![];this[_0xb124('0x38')](_0xb7179b);this[_0xb124('0x41')](_0xb7179b['text'],'in');this[_0xb124('0x39')][_0xb124('0xb1')](util['format'](_0xb124('0xec'),_0xb7179b[_0xb124('0x5a')]));var _0x25d1a3=this['sestekNDA'][_0xb124('0xa3')](this,_0xb7179b);if(_0x25d1a3){for(var _0x4e6a37 in _0x25d1a3){if(_0x25d1a3[_0xb124('0x92')](_0x4e6a37)){this[_0xb124('0x39')]['setVariable'](util['format'](_0xb124('0xed'),_0x4e6a37[_0xb124('0xee')]()),_0x25d1a3[_0x4e6a37]);}}this[_0xb124('0x41')](_0x25d1a3[_0xb124('0xe3')],'out');if(_0x25d1a3[_0xb124('0xef')]){this[_0xb124('0x39')][_0xb124('0xb1')](util[_0xb124('0x2b')]('Sestek\x20NDA\x20%s\x20file\x20created',_0x25d1a3[_0xb124('0xef')]));var _0x17220d=this['channel'][_0xb124('0xf0')](_0x25d1a3[_0xb124('0xef')]);try{fs[_0xb124('0xf1')](_0x25d1a3[_0xb124('0xef')]+'.wav');}catch(_0x3940bd){logger[_0xb124('0x2f')](_0x3940bd);}return _0x17220d;}else{return this[_0xb124('0x39')]['noop'](util[_0xb124('0x2b')]('SestekNDA\x20Result\x20%s',_0x25d1a3[_0xb124('0xe3')]));}}return this['channel']['error'](_0xb7179b,_0xb124('0xf2'));};AGIVertices['prototype']['end']=function(_0x38ba46){logger['info'](util[_0xb124('0x2b')](_0xb124('0xf3'),_0x38ba46[_0xb124('0xa5')]));return this[_0xb124('0x39')]['noop'](_0xb124('0xf4'));};AGIVertices[_0xb124('0x11')][_0xb124('0xf5')]=function(_0x544590){logger[_0xb124('0x32')](util[_0xb124('0x2b')]('Enter\x20in\x20EXTERNAL\x20DIAL\x20(%s)\x20block',_0x544590['label']));var _0x58dba9='';if(_0x544590[_0xb124('0xf6')]){if(!this[_0xb124('0x80')](_0x544590[_0xb124('0xf6')])){return this[_0xb124('0x39')][_0xb124('0x2f')](_0x544590,'no\x20trunk\x20selected');}else{var _0x460295=parseInt(_0x544590[_0xb124('0xf6')],0xa);if(isNaN(_0x460295)){_0x58dba9=_0x544590[_0xb124('0xf6')];}else{_0x58dba9=this[_0xb124('0x1e')][_0xb124('0xa3')](this,_0x544590[_0xb124('0xf6')]);if(!_0x58dba9){return this['channel']['error'](_0x544590,_0xb124('0xf7'));}}}}else if(_0x544590[_0xb124('0xf8')]){_0x58dba9=_0x544590[_0xb124('0xf8')];}else{return this[_0xb124('0x39')][_0xb124('0x2f')](_0x544590,_0xb124('0xf9'));}var _0x41ccf3=this[_0xb124('0x39')]['exec'](_0xb124('0xdc'),[util[_0xb124('0x2b')](_0xb124('0xfa'),_0x58dba9,_0x544590[_0xb124('0x47')]),_0x544590[_0xb124('0x65')],_0x544590[_0xb124('0xde')],_0x544590[_0xb124('0x63')]]);if(_0x41ccf3['result']===-0x1){return _0x41ccf3;}return this[_0xb124('0x39')][_0xb124('0xb1')](util[_0xb124('0x2b')](_0xb124('0xfb'),_0xb124('0xdc')));};AGIVertices[_0xb124('0x11')][_0xb124('0xfc')]=function(_0x231a33){logger['info'](util[_0xb124('0x2b')]('Enter\x20in\x20FINALLY\x20(%s)\x20block',_0x231a33[_0xb124('0xa5')]));return this[_0xb124('0x39')][_0xb124('0xb1')](_0xb124('0xfc'));};AGIVertices[_0xb124('0x11')][_0xb124('0xd')]=function(_0x4dd84c){logger[_0xb124('0x32')](util[_0xb124('0x2b')](_0xb124('0xfd'),_0x4dd84c[_0xb124('0xa5')]));if(_0x4dd84c['retry']===0x0){return this['maxRetry'](_0x4dd84c);}_0x4dd84c['retry']-=0x1;if(!this[_0xb124('0x80')](_0x4dd84c[_0xb124('0xfe')])){return this['channel']['error'](_0x4dd84c,_0xb124('0xff'));}var _0x5c31fb=this[_0xb124('0x100')][_0xb124('0xa3')](this,_0x4dd84c[_0xb124('0xfe')]);if(!_0x5c31fb){return this[_0xb124('0x39')][_0xb124('0x2f')](_0x4dd84c,_0xb124('0x101'));}if(!this[_0xb124('0x80')](_0x4dd84c['variable_id'])){return this[_0xb124('0x39')]['error'](_0xb124('0xd1'));}var _0x29e62d=this[_0xb124('0x39')][_0xb124('0x102')](_0x5c31fb,_0x4dd84c['response'],_0x4dd84c[_0xb124('0x103')]);var _0x3163bf=_0x29e62d[_0xb124('0xa0')]?_0x29e62d[_0xb124('0xa0')]['toString']():'';logger[_0xb124('0x32')]('test',JSON[_0xb124('0x70')](_0x29e62d));if(_0x29e62d[_0xb124('0xa0')]===-0x1){this['createSquareDetailsReport'][_0xb124('0xa3')](this,_0x4dd84c,_0x3163bf);return _0x29e62d;}else if(_0x29e62d['extra']===_0xb124('0x65')){_0x29e62d[_0xb124('0xa0')]=_0x3163bf['length']>=parseInt(_0x4dd84c[_0xb124('0x104')])?'x':'i';}else{_0x29e62d[_0xb124('0xa0')]=_0x3163bf[_0xb124('0x99')]>=parseInt(_0x4dd84c[_0xb124('0x104')])&&_0x3163bf[_0xb124('0x99')]<=parseInt(_0x4dd84c[_0xb124('0x103')])?'x':'i';}var _0x2002d0=this[_0xb124('0x12')]['sync'](this,_0x4dd84c[_0xb124('0xd0')]);if(!_0x2002d0){return this[_0xb124('0x39')][_0xb124('0x2f')](_0x4dd84c,_0xb124('0xd2'));}this[_0xb124('0x39')][_0xb124('0x9c')](_0x2002d0,_0x3163bf);if(this['isConfigured'](_0x4dd84c['hiddendigitsnum'])){var _0x4579ff=parseInt(_0x4dd84c[_0xb124('0x105')],0xa);var _0x1e2740=rs[_0xb124('0x106')]({'charset':'*','length':_0x4579ff});var _0x4371b0=_0x3163bf[_0xb124('0x99')];if(_0x4371b0>0x0){if(_0x4371b0>_0x4579ff){this[_0xb124('0x38')]['sync'](this,_0x4dd84c,_0x4dd84c[_0xb124('0x107')]===_0xb124('0x108')?_0x1e2740+_0x3163bf[_0xb124('0x109')](_0x4579ff):_0x3163bf['substr'](0x0,_0x4371b0-_0x4579ff)+_0x1e2740);}else{this[_0xb124('0x38')][_0xb124('0xa3')](this,_0x4dd84c,rs[_0xb124('0x106')]({'charset':'*','length':_0x4371b0}));}}else{this[_0xb124('0x38')][_0xb124('0xa3')](this,_0x4dd84c,'');}}else{this['createSquareDetailsReport'][_0xb124('0xa3')](this,_0x4dd84c,_0x3163bf);}return _0x29e62d;};AGIVertices['prototype'][_0xb124('0xe')]=function(_0x1bd0b8){logger[_0xb124('0x32')](util['format'](_0xb124('0x10a'),_0x1bd0b8[_0xb124('0xa5')]));return this[_0xb124('0xd')](_0x1bd0b8);};AGIVertices[_0xb124('0x11')][_0xb124('0x10b')]=function(_0x1b0f8f){logger['info'](util[_0xb124('0x2b')](_0xb124('0x10c'),_0x1b0f8f['label']));this['createSquareDetailsReport'][_0xb124('0xa3')](this,_0x1b0f8f,_0x1b0f8f['goalname']);return this['channel']['noop'](util[_0xb124('0x2b')](_0xb124('0x10d'),_0x1b0f8f['goalname']));};AGIVertices['prototype'][_0xb124('0x10e')]=function(_0x43a2af){logger[_0xb124('0x32')](util[_0xb124('0x2b')](_0xb124('0x10f'),_0x43a2af[_0xb124('0xa5')]));if(!this[_0xb124('0x80')](_0x43a2af[_0xb124('0x83')])||!this['isConfigured'](_0x43a2af[_0xb124('0x84')])){return this[_0xb124('0x39')]['noop'](_0xb124('0x110'));}if(!this[_0xb124('0x80')](_0x43a2af[_0xb124('0x5a')])){return this[_0xb124('0x39')]['noop'](_0xb124('0xb9'));}this[_0xb124('0x39')][_0xb124('0xb1')](util[_0xb124('0x2b')](_0xb124('0x111'),_0x43a2af[_0xb124('0x5a')]));var _0x520c24=this[_0xb124('0x82')][_0xb124('0xa3')](this,_0x43a2af);if(_0x520c24){this[_0xb124('0x39')][_0xb124('0xb1')](util[_0xb124('0x2b')](_0xb124('0x112'),_0x520c24));var _0x2ce990=this[_0xb124('0x39')][_0xb124('0xf0')](_0x520c24);try{fs[_0xb124('0xf1')](_0x520c24+_0xb124('0x113'));}catch(_0x276cf8){logger[_0xb124('0x2f')](_0x276cf8);}return _0x2ce990;}return this[_0xb124('0x39')][_0xb124('0x2f')](_0x43a2af,_0xb124('0x114'));};AGIVertices['prototype']['awslex']=function(_0x1edabb){logger[_0xb124('0x32')](util[_0xb124('0x2b')](_0xb124('0x115'),_0x1edabb[_0xb124('0xa5')]));if(!this['isConfigured'](_0x1edabb[_0xb124('0x83')])||!this[_0xb124('0x80')](_0x1edabb['aws_secret_access_key'])){return this[_0xb124('0x39')]['noop'](_0xb124('0x110'));}if(!this[_0xb124('0x80')](_0x1edabb[_0xb124('0x8a')])){return this[_0xb124('0x39')][_0xb124('0xb1')](_0xb124('0x116'));}if(!this[_0xb124('0x80')](_0x1edabb[_0xb124('0x5a')])){return this[_0xb124('0x39')][_0xb124('0xb1')](_0xb124('0xb9'));}this[_0xb124('0x39')][_0xb124('0x117')]=!![];this[_0xb124('0x38')](_0x1edabb);this[_0xb124('0x41')](_0x1edabb[_0xb124('0x5a')],'in');this[_0xb124('0x39')][_0xb124('0xb1')](util[_0xb124('0x2b')](_0xb124('0x118'),_0x1edabb[_0xb124('0x5a')]));var _0x51357d=this[_0xb124('0x88')][_0xb124('0xa3')](this,_0x1edabb);if(_0x51357d){for(var _0x133b0e in _0x51357d){if(_0x51357d[_0xb124('0x92')](_0x133b0e)&&_[_0xb124('0x93')](_0x51357d[_0x133b0e])){this[_0xb124('0x39')][_0xb124('0x9c')](util[_0xb124('0x2b')](_0xb124('0x119'),_0x133b0e['toUpperCase']()),_0x51357d[_0x133b0e]);}}if(_[_0xb124('0x44')](_0x51357d[_0xb124('0x75')])){return this[_0xb124('0x39')]['noop'](_0xb124('0x11a'));}else{this['createSquareMessage'](_0x51357d[_0xb124('0x75')],_0xb124('0x11b'));return this[_0xb124('0x39')][_0xb124('0xb1')](util[_0xb124('0x2b')]('Amazon\x20Lex\x20Result\x20%s',_0x51357d['message']));}}return this[_0xb124('0x39')]['error'](_0x1edabb,_0xb124('0x11c'));};AGIVertices[_0xb124('0x11')]['googleasr']=function(_0x5c88f7){logger[_0xb124('0x32')](util[_0xb124('0x2b')]('Enter\x20in\x20GOOGLEASR\x20(%s)\x20block\x20%s',_0x5c88f7[_0xb124('0xa5')],_0x5c88f7[_0xb124('0x65')]));if(!this[_0xb124('0x80')](_0x5c88f7[_0xb124('0x79')])){return this['channel'][_0xb124('0xb1')]('no\x20key\x20configured');}var _0x274285=_0xb124('0x11d');var _0x1fcb92=util[_0xb124('0x2b')](_0xb124('0x11e'),FILES_PATH,rs['generate'](0x4));var _0x287d84=util['format'](_0xb124('0x9b'),_0x1fcb92,_0x274285);var _0x22db9d=!![];if(_0x5c88f7[_0xb124('0x11f')]===_0xb124('0x120')){_0x22db9d=![];}var _0x3f365d=this[_0xb124('0x39')][_0xb124('0x121')](_0x1fcb92,_0x274285,_0x5c88f7['intKey'],_0x5c88f7[_0xb124('0x65')],undefined,_0x22db9d);if(_0x3f365d['result']!==-0x1){this[_0xb124('0x39')][_0xb124('0xb1')](util[_0xb124('0x2b')](_0xb124('0x122'),_0x287d84));var _0x868a9=this[_0xb124('0x8b')][_0xb124('0xa3')](this,_0x5c88f7,_0x287d84);if(_0x868a9){for(var _0x2da522 in _0x868a9){if(_0x868a9[_0xb124('0x92')](_0x2da522)){this[_0xb124('0x39')][_0xb124('0x9c')](util[_0xb124('0x2b')](_0xb124('0x123'),_0x2da522[_0xb124('0xee')]()),_0x868a9[_0x2da522]);}}return this[_0xb124('0x39')][_0xb124('0xb1')](util['format'](_0xb124('0x124'),JSON[_0xb124('0x70')](_0x868a9)));}}return _0x3f365d;};AGIVertices[_0xb124('0x11')]['tildeasr']=function(_0x184f11){logger[_0xb124('0x32')](util['format'](_0xb124('0x125'),_0x184f11[_0xb124('0xa5')]));if(!this[_0xb124('0x80')](_0x184f11[_0xb124('0x8e')])){return this['channel'][_0xb124('0xb1')](_0xb124('0x126'));}if(!this[_0xb124('0x80')](_0x184f11[_0xb124('0x127')])){return this['channel'][_0xb124('0xb1')](_0xb124('0x128'));}var _0x585c4f='wav';var _0x222bb4=util[_0xb124('0x2b')]('%s/recordings/%s',FILES_PATH,rs['generate'](0x4));var _0x2e2d38=util[_0xb124('0x2b')](_0xb124('0x9b'),_0x222bb4,_0x585c4f);var _0x69d7ec=!![];if(_0x184f11[_0xb124('0x11f')]===_0xb124('0x120')){_0x69d7ec=![];}var _0x1bb7ac=this['channel'][_0xb124('0x121')](_0x222bb4,_0x585c4f,_0x184f11[_0xb124('0x129')],_0x184f11['timeout'],undefined,_0x69d7ec);if(_0x1bb7ac['result']!==-0x1){this[_0xb124('0x39')][_0xb124('0xb1')](util[_0xb124('0x2b')](_0xb124('0x12a'),_0x2e2d38));var _0x242945=this[_0xb124('0x8d')][_0xb124('0xa3')](this,_0x184f11,_0x2e2d38);if(_0x242945){for(var _0x44d7d2 in _0x242945){if(_0x242945[_0xb124('0x92')](_0x44d7d2)){this[_0xb124('0x39')][_0xb124('0x9c')](util['format'](_0xb124('0x12b'),_0x44d7d2['toUpperCase']()),_0x242945[_0x44d7d2]);}}return this['channel'][_0xb124('0xb1')](util['format'](_0xb124('0x12c'),JSON[_0xb124('0x70')](_0x242945)));}}return _0x1bb7ac;};AGIVertices['prototype'][_0xb124('0x12d')]=function(_0x1924ac){logger['info'](util[_0xb124('0x2b')](_0xb124('0x12e'),_0x1924ac[_0xb124('0xa5')]));return this[_0xb124('0x39')][_0xb124('0x12f')](_0x1924ac[_0xb124('0x3e')],_0x1924ac[_0xb124('0x3f')],_0x1924ac['priority']);};AGIVertices['prototype']['gotoif']=function(_0x1cc1b9){logger[_0xb124('0x32')](util['format'](_0xb124('0x130'),_0x1cc1b9[_0xb124('0xa5')]));if(!this[_0xb124('0x80')](_0x1cc1b9[_0xb124('0x131')])){return this['channel']['error'](_0x1cc1b9,_0xb124('0x132'));}try{var _0x1d76a5=eval(_0x1cc1b9['condition'])?'true':_0xb124('0x133');this[_0xb124('0x39')][_0xb124('0xb1')](util[_0xb124('0x2b')](_0xb124('0x134'),_0x1cc1b9[_0xb124('0x131')],_0x1d76a5));return{'code':0xc8,'result':_0x1d76a5};}catch(_0x713c88){return{'code':0xc8,'result':_0xb124('0x133')};}};AGIVertices['prototype'][_0xb124('0x135')]=function(_0x4621dd){logger[_0xb124('0x32')](util[_0xb124('0x2b')](_0xb124('0x136'),_0x4621dd['label']));if(!this['isConfigured'](_0x4621dd[_0xb124('0x137')])){return this[_0xb124('0x39')][_0xb124('0x2f')](_0x4621dd,'no\x20interval\x20configured');}var _0x472bd9=this['getIntervals'][_0xb124('0xa3')](this,_0x4621dd[_0xb124('0x137')]);if(!_0x472bd9){return this['channel'][_0xb124('0x2f')](_0x4621dd,_0xb124('0x138'));}for(var _0x14dc44=0x0;_0x14dc44<_0x472bd9[_0xb124('0x99')];_0x14dc44+=0x1){var _0x1acf21=this['channel'][_0xb124('0x12')](util[_0xb124('0x2b')](_0xb124('0x139'),_0x472bd9[_0x14dc44]));if(_0x1acf21[_0xb124('0xa0')]===-0x1){return _0x1acf21;}logger[_0xb124('0x32')](util[_0xb124('0x2b')](_0xb124('0x13a'),_0x472bd9[_0x14dc44],_0x1acf21[_0xb124('0x9e')]));if(_0x1acf21[_0xb124('0x9e')]===_0xb124('0x13b')){logger[_0xb124('0x32')](util[_0xb124('0x2b')]('IFTIME\x20%s\x20%s',_0x472bd9[_0x14dc44],_0xb124('0x13b')));this['channel'][_0xb124('0xb1')](util['format'](_0xb124('0x13a'),_0x472bd9[_0x14dc44],'true'));return{'code':0xc8,'result':_0xb124('0x13b')};}else{logger['info'](util[_0xb124('0x2b')](_0xb124('0x13a'),_0x472bd9[_0x14dc44],_0xb124('0x133')));this['channel']['noop'](util[_0xb124('0x2b')]('IFTIME\x20%s\x20%s',_0x472bd9[_0x14dc44],'false'));}}return{'code':0xc8,'result':_0xb124('0x133')};};AGIVertices[_0xb124('0x11')][_0xb124('0x13c')]=function(_0xafd2d5){logger[_0xb124('0x32')](util['format'](_0xb124('0x13d'),_0xafd2d5[_0xb124('0xa5')]));return this[_0xb124('0x39')][_0xb124('0x13c')]();};AGIVertices[_0xb124('0x11')][_0xb124('0x13e')]=function(_0x384250){logger[_0xb124('0x32')](util[_0xb124('0x2b')]('Enter\x20in\x20ISPEECHASR\x20(%s)\x20block',_0x384250[_0xb124('0xa5')]));if(!this[_0xb124('0x80')](_0x384250['key'])){return this[_0xb124('0x39')][_0xb124('0xb1')](_0xb124('0xe1'));}var _0x1d342f=_0xb124('0x11d');var _0x22288f=util['format'](_0xb124('0x11e'),FILES_PATH,rs[_0xb124('0x106')](0x4));var _0x3e4474=util['format'](_0xb124('0x9b'),_0x22288f,_0x1d342f);var _0xc297ce=!![];if(_0x384250[_0xb124('0x11f')]==='NOBEEP'){_0xc297ce=![];}var _0x3548c0=this[_0xb124('0x39')][_0xb124('0x121')](_0x22288f,_0x1d342f,_0x384250[_0xb124('0x129')],_0x384250['timeout'],undefined,_0xc297ce);if(_0x3548c0[_0xb124('0xa0')]!==-0x1){this['channel']['noop'](util['format']('ispeech\x20%s\x20file\x20created',_0x3e4474));var _0x2c87d3=this[_0xb124('0x13f')]['sync'](this,_0x384250,_0x3e4474);if(_0x2c87d3){for(var _0x3de67e in _0x2c87d3){if(_0x2c87d3[_0xb124('0x92')](_0x3de67e)){this[_0xb124('0x39')][_0xb124('0x9c')](util[_0xb124('0x2b')](_0xb124('0x140'),_0x3de67e[_0xb124('0xee')]()),_0x2c87d3[_0x3de67e]);}}return this[_0xb124('0x39')][_0xb124('0xb1')](util['format'](_0xb124('0x141'),JSON[_0xb124('0x70')](_0x2c87d3)));}}return _0x3548c0;};AGIVertices[_0xb124('0x11')][_0xb124('0x142')]=function(_0x218423){logger['info'](util[_0xb124('0x2b')](_0xb124('0x143'),_0x218423[_0xb124('0xa5')]));if(!this[_0xb124('0x80')](_0x218423[_0xb124('0x79')])){return this[_0xb124('0x39')][_0xb124('0xb1')](_0xb124('0xe1'));}if(!this[_0xb124('0x80')](_0x218423['text'])){return this[_0xb124('0x39')][_0xb124('0xb1')](_0xb124('0xb9'));}this[_0xb124('0x39')][_0xb124('0xb1')](util[_0xb124('0x2b')](_0xb124('0x144'),_0x218423[_0xb124('0x5a')]));var _0x35afb5=this[_0xb124('0x7c')][_0xb124('0xa3')](this,_0x218423);if(_0x35afb5){this[_0xb124('0x39')][_0xb124('0xb1')](util['format'](_0xb124('0x145'),_0x35afb5));var _0x4bf2f7=this[_0xb124('0x39')]['streamFile'](_0x35afb5,_0x218423['intKey']);try{fs['unlink'](_0x35afb5+_0xb124('0x113'));}catch(_0x25554f){logger[_0xb124('0x2f')](_0x25554f);}return _0x4bf2f7;}return this[_0xb124('0x39')][_0xb124('0x2f')](_0x218423,'ispeech\x20TTS\x20is\x20unreachable');};AGIVertices['prototype'][_0xb124('0x146')]=function(_0x166055){logger[_0xb124('0x32')](util[_0xb124('0x2b')]('Enter\x20in\x20LOGIN\x20(%s)\x20block',_0x166055['label']));if(!this[_0xb124('0x80')](_0x166055['findBy'])){return this[_0xb124('0x39')][_0xb124('0x2f')](_0x166055,_0xb124('0x147'));}logger['info'](util[_0xb124('0x2b')](_0xb124('0x148'),this[_0xb124('0x39')][_0xb124('0x3d')],_0x166055[_0xb124('0x149')]));var _0x44cbe9=this['agentLogin'][_0xb124('0xa3')](this,_0x166055[_0xb124('0x149')]);if(_0x44cbe9){logger[_0xb124('0x32')](util['format']('AGENT\x20%s\x20FOUND\x20BY',this[_0xb124('0x39')][_0xb124('0x3d')],_0x166055[_0xb124('0x149')]));this[_0xb124('0x39')][_0xb124('0xb1')](util[_0xb124('0x2b')](_0xb124('0x14a'),this[_0xb124('0x39')][_0xb124('0x3d')],_0x166055[_0xb124('0x149')]));return{'code':0xc8,'result':_0xb124('0x14b')};}else{logger[_0xb124('0x32')](util[_0xb124('0x2b')](_0xb124('0x14c'),this[_0xb124('0x39')][_0xb124('0x3d')],_0x166055[_0xb124('0x149')]));this[_0xb124('0x39')][_0xb124('0xb1')](util[_0xb124('0x2b')](_0xb124('0x14c'),this[_0xb124('0x39')]['callerid'],_0x166055[_0xb124('0x149')]));return{'code':0xc8,'result':_0xb124('0x14d')};}};AGIVertices[_0xb124('0x11')][_0xb124('0x14e')]=function(_0x788db1){logger['info'](util[_0xb124('0x2b')]('Enter\x20in\x20LOGOUT\x20(%s)\x20block',_0x788db1[_0xb124('0xa5')]));if(!this[_0xb124('0x80')](_0x788db1[_0xb124('0x149')])){return this[_0xb124('0x39')][_0xb124('0x2f')](_0x788db1,'no\x20find\x20by\x20configured');}logger['info'](util['format']('FIND\x20AGENT\x20%s\x20BY\x20%s',this[_0xb124('0x39')][_0xb124('0x3d')],_0x788db1['findBy']));var _0x509a80=this['agentLogout'][_0xb124('0xa3')](this,_0x788db1['findBy']);if(_0x509a80){logger['info'](util[_0xb124('0x2b')](_0xb124('0x14a'),this[_0xb124('0x39')][_0xb124('0x3d')],_0x788db1[_0xb124('0x149')]));this['channel']['noop'](util[_0xb124('0x2b')](_0xb124('0x14a'),this[_0xb124('0x39')][_0xb124('0x3d')],_0x788db1[_0xb124('0x149')]));return{'code':0xc8,'result':'success'};}else{logger[_0xb124('0x32')](util[_0xb124('0x2b')](_0xb124('0x14c'),this[_0xb124('0x39')][_0xb124('0x3d')],_0x788db1[_0xb124('0x149')]));this[_0xb124('0x39')][_0xb124('0xb1')](util[_0xb124('0x2b')](_0xb124('0x14c'),this[_0xb124('0x39')]['callerid'],_0x788db1['findBy']));return{'code':0xc8,'result':_0xb124('0x14d')};}};AGIVertices['prototype'][_0xb124('0x14f')]=function(_0x4f4a6d){logger[_0xb124('0x32')](util[_0xb124('0x2b')](_0xb124('0x150'),_0x4f4a6d[_0xb124('0xa5')]));if(!this['isConfigured'](_0x4f4a6d[_0xb124('0x151')])){return this[_0xb124('0x39')][_0xb124('0x2f')](_0x4f4a6d,_0xb124('0x152'));}this[_0xb124('0x39')][_0xb124('0xb1')](util[_0xb124('0x2b')]('math\x20%s',_0x4f4a6d[_0xb124('0x151')]));var _0x2c2b19=eval(_0x4f4a6d[_0xb124('0x151')]);if(!this[_0xb124('0x80')](_0x4f4a6d[_0xb124('0xd0')])){return this['channel'][_0xb124('0xb1')](_0xb124('0xd1'));}var _0x5933d6=this[_0xb124('0x12')][_0xb124('0xa3')](this,_0x4f4a6d['variable_id']);if(!_0x5933d6){return this[_0xb124('0x39')][_0xb124('0x2f')](_0x4f4a6d,'no\x20variable\x20found');}if(_[_0xb124('0x98')](_0x2c2b19)){var _0x8a7214=this;_0x2c2b19[_0xb124('0xd3')](function(_0x518cf7,_0x1a9a0d){_0x8a7214[_0xb124('0x39')][_0xb124('0x9c')](util['format'](_0xb124('0x153'),_0x5933d6,_0x1a9a0d),_0x518cf7);});return this['channel']['noop'](util[_0xb124('0x2b')](_0xb124('0x154'),_0x5933d6));}else{return this[_0xb124('0x39')][_0xb124('0x9c')](_0x5933d6,_0x2c2b19);}};AGIVertices['prototype'][_0xb124('0xc')]=function(_0x55d2e0){logger['info'](util[_0xb124('0x2b')](_0xb124('0x155'),_0x55d2e0['label']));if(_0x55d2e0[_0xb124('0x156')]===0x0){return this[_0xb124('0xa2')](_0x55d2e0);}_0x55d2e0[_0xb124('0x156')]-=0x1;if(!this[_0xb124('0x80')](_0x55d2e0[_0xb124('0xfe')])){return this[_0xb124('0x39')][_0xb124('0x2f')](_0x55d2e0,_0xb124('0xff'));}var _0x4288aa=this[_0xb124('0x100')][_0xb124('0xa3')](this,_0x55d2e0[_0xb124('0xfe')]);if(!_0x4288aa){return this[_0xb124('0x39')][_0xb124('0x2f')](_0x55d2e0,'no\x20file\x20audio\x20found');}var _0x3bffe1=this['channel'][_0xb124('0x102')](_0x4288aa,_0x55d2e0[_0xb124('0x157')],_0x55d2e0[_0xb124('0x158')]);var _0x3e58ea=_0x3bffe1['result'];if(_0x3bffe1[_0xb124('0xa0')]===-0x1){this['createSquareDetailsReport'][_0xb124('0xa3')](this,_0x55d2e0,'-1');return _0x3bffe1;}else if(_0x3bffe1[_0xb124('0x9e')]===_0xb124('0x65')){_0x3bffe1[_0xb124('0xa0')]=_0x3bffe1[_0xb124('0xa0')][_0xb124('0x99')]>0x0?_0x3bffe1[_0xb124('0xa0')]:'t';}else if(_[_0xb124('0x43')](_0x3bffe1[_0xb124('0xa0')])){_0x3bffe1[_0xb124('0xa0')]='#';_0x3e58ea='#';}if(!this['isConfigured'](_0x55d2e0[_0xb124('0xd0')])){this[_0xb124('0x39')][_0xb124('0xb1')](_0xb124('0xd1'));}else{var _0x572c75=this[_0xb124('0x12')][_0xb124('0xa3')](this,_0x55d2e0[_0xb124('0xd0')]);if(!_0x572c75){return this[_0xb124('0x39')]['error'](_0x55d2e0,_0xb124('0xd2'));}this[_0xb124('0x39')][_0xb124('0x9c')](_0x572c75,_0x3e58ea);}this[_0xb124('0x38')]['sync'](this,_0x55d2e0,_0x3e58ea);return _0x3bffe1;};AGIVertices[_0xb124('0x11')][_0xb124('0xb1')]=function(_0x14cffa){logger['info'](util['format'](_0xb124('0x159'),_0x14cffa['label']));return this[_0xb124('0x39')][_0xb124('0xb1')](_0x14cffa[_0xb124('0x15a')]||_0x14cffa[_0xb124('0xa5')]);};AGIVertices[_0xb124('0x11')][_0xb124('0x15b')]=function(_0x1ef040){logger[_0xb124('0x32')](util[_0xb124('0x2b')]('Enter\x20in\x20PAUSE\x20(%s)\x20block',_0x1ef040['label']));if(!this['isConfigured'](_0x1ef040[_0xb124('0x149')])){return this[_0xb124('0x39')][_0xb124('0x2f')](_0x1ef040,_0xb124('0x147'));}logger[_0xb124('0x32')](util['format'](_0xb124('0x148'),this[_0xb124('0x39')]['callerid'],_0x1ef040[_0xb124('0x149')]));var _0x4aa6aa=this[_0xb124('0x4c')][_0xb124('0xa3')](this,_0x1ef040[_0xb124('0x15c')]);var _0x3d9547=this['agentPause'][_0xb124('0xa3')](this,_0x1ef040[_0xb124('0x149')],_0x4aa6aa);if(_0x3d9547){logger['info'](util[_0xb124('0x2b')](_0xb124('0x14a'),this[_0xb124('0x39')]['callerid'],_0x1ef040[_0xb124('0x149')]));this['channel'][_0xb124('0xb1')](util[_0xb124('0x2b')](_0xb124('0x14a'),this[_0xb124('0x39')]['callerid'],_0x1ef040[_0xb124('0x149')]));return{'code':0xc8,'result':_0xb124('0x14b')};}else{logger[_0xb124('0x32')](util[_0xb124('0x2b')](_0xb124('0x14c'),this[_0xb124('0x39')][_0xb124('0x3d')],_0x1ef040['findBy']));this['channel'][_0xb124('0xb1')](util[_0xb124('0x2b')](_0xb124('0x14a'),this[_0xb124('0x39')][_0xb124('0x3d')],_0x1ef040['findBy']));return{'code':0xc8,'result':_0xb124('0x14d')};}};AGIVertices[_0xb124('0x11')][_0xb124('0x15d')]=function(_0x1ad0bd){logger[_0xb124('0x32')](util[_0xb124('0x2b')](_0xb124('0x15e'),_0x1ad0bd['label']));if(!this[_0xb124('0x80')](_0x1ad0bd[_0xb124('0xfe')])){return this['channel'][_0xb124('0x2f')](_0x1ad0bd,'no\x20file\x20audio\x20selected');}var _0x1e338f=this[_0xb124('0x100')]['sync'](this,_0x1ad0bd[_0xb124('0xfe')]);if(!_0x1e338f){return this['channel'][_0xb124('0x2f')](_0x1ad0bd,'no\x20file\x20audio\x20found');}var _0x1a6707=this[_0xb124('0x39')]['exec'](_0xb124('0x15f'),[_0x1e338f,_0x1ad0bd[_0xb124('0xde')]]);if(_0x1a6707[_0xb124('0xa0')]===-0x1){return _0x1a6707;}return this['channel']['noop'](util[_0xb124('0x2b')](_0xb124('0xb7'),'PLAYBACK',_0x1e338f));};AGIVertices[_0xb124('0x11')][_0xb124('0x160')]=function(_0x56a8b8){logger['info'](util[_0xb124('0x2b')]('Enter\x20in\x20QUEUE\x20(%s)\x20block',_0x56a8b8[_0xb124('0xa5')]));if(!this['isConfigured'](_0x56a8b8[_0xb124('0x161')])){return this[_0xb124('0x39')][_0xb124('0x2f')](_0x56a8b8,_0xb124('0x162'));}var _0x42ab0e='';var _0x354bca=parseInt(_0x56a8b8[_0xb124('0x161')],0xa);if(isNaN(_0x354bca)){_0x42ab0e=_0x56a8b8[_0xb124('0x161')];}else{_0x42ab0e=this[_0xb124('0x17')][_0xb124('0xa3')](this,_0x56a8b8[_0xb124('0x161')]);if(!_0x42ab0e){return this['channel'][_0xb124('0x2f')](_0x56a8b8,_0xb124('0x163'));}}var _0x325583='';if(this[_0xb124('0x80')](_0x56a8b8['file_id'])){var _0x6205b9=this[_0xb124('0x100')][_0xb124('0xa3')](this,_0x56a8b8['file_id']);if(_0x6205b9){_0x325583=_0x6205b9;}}this[_0xb124('0x38')][_0xb124('0xa3')](this,_0x56a8b8,_0x42ab0e);if(_0x56a8b8[_0xb124('0xde')][_0xb124('0x164')]('x')<0x0){_0x56a8b8[_0xb124('0xde')]+='x';}if(_0x56a8b8[_0xb124('0xde')][_0xb124('0x164')]('X')<0x0){_0x56a8b8[_0xb124('0xde')]+='X';}this['channel'][_0xb124('0x9c')](_0xb124('0x165'),_0x42ab0e?_0x42ab0e['toLowerCase']():'');var _0x25d0cf=this[_0xb124('0x39')][_0xb124('0xb5')](_0xb124('0x166'),[_0x42ab0e,_0x56a8b8[_0xb124('0xde')],_0x56a8b8['url'],_0x325583,_0x56a8b8[_0xb124('0x65')],_0x56a8b8[_0xb124('0x7')],_0x56a8b8[_0xb124('0x167')],_0x56a8b8[_0xb124('0x168')],'',_0x56a8b8['position']]);if(_0x25d0cf[_0xb124('0xa0')]===-0x1){return _0x25d0cf;}return this[_0xb124('0x39')][_0xb124('0xb1')](util[_0xb124('0x2b')]('Executed\x20command\x20%s\x20%s','QUEUE',_0x42ab0e));};AGIVertices[_0xb124('0x11')][_0xb124('0x169')]=function(_0x4a0a19){logger['info'](util['format'](_0xb124('0x16a'),_0x4a0a19[_0xb124('0xa5')]));var _0x14c579=_0x4a0a19['recordingFormat']||'wav';var _0xa12688=util[_0xb124('0x2b')](_0xb124('0x16b'),this[_0xb124('0x39')][_0xb124('0x3a')],rs[_0xb124('0x106')](0x5));var _0x43a17e=util[_0xb124('0x2b')]('%s/recordings/%s.%s',FILES_PATH,_0xa12688,_0x14c579);var _0xe0ccaa=util[_0xb124('0x2b')]('%s/recordings/%s',FILES_PATH,_0xa12688);this[_0xb124('0x3c')]['sync'](this,_0x4a0a19,_0xa12688,_0x43a17e);this[_0xb124('0x39')][_0xb124('0x9c')](_0xb124('0x16c'),_0xa12688);logger[_0xb124('0x32')](_0xb124('0x16d'),_0xe0ccaa,_0x14c579,_0x4a0a19['escape_digits'],_0x4a0a19['timeout']);return this['channel'][_0xb124('0x121')](_0xe0ccaa,_0x14c579,_0x4a0a19['escape_digits'],_0x4a0a19[_0xb124('0x65')],undefined,!![]);};AGIVertices[_0xb124('0x11')][_0xb124('0x16e')]=function(_0xb47857){logger[_0xb124('0x32')](util[_0xb124('0x2b')](_0xb124('0x16f'),_0xb47857['label']));if(!this[_0xb124('0x80')](_0xb47857[_0xb124('0x63')])){return this['channel'][_0xb124('0xb1')](_0xb124('0x170'));}var _0x57e7d0=this[_0xb124('0x171')]['sync'](this,_0xb47857);logger[_0xb124('0x32')](util[_0xb124('0x2b')](_0xb124('0x172'),util[_0xb124('0x173')](_0x57e7d0,{'showHidden':![],'depth':null})));if(!this['isConfigured'](_0xb47857[_0xb124('0xd0')])){return this[_0xb124('0x39')][_0xb124('0xb1')]('no\x20variable\x20selected\x20for\x20the\x20response');}var _0x35e192=this[_0xb124('0x12')][_0xb124('0xa3')](this,_0xb47857[_0xb124('0xd0')]);if(!_0x35e192){return this[_0xb124('0x39')][_0xb124('0x2f')](_0xb47857,_0xb124('0xd2'));}this[_0xb124('0x39')][_0xb124('0x9c')](util[_0xb124('0x2b')](_0xb124('0x174'),_0x35e192),_0x57e7d0['statusCode']?_0x57e7d0[_0xb124('0x73')]:_0xb124('0x175'));this[_0xb124('0x39')][_0xb124('0x9c')](util[_0xb124('0x2b')](_0xb124('0x176'),_0x35e192),_0x57e7d0[_0xb124('0x74')]?_0x57e7d0[_0xb124('0x74')]:'OK');if(_0x57e7d0[_0xb124('0x71')]){try{this['saveRestApiResult'](_0x57e7d0[_0xb124('0x71')],_0x35e192);}catch(_0x27b1f3){logger['error'](util[_0xb124('0x2b')](_0xb124('0x177'),_0x35e192));}}return this[_0xb124('0x39')][_0xb124('0xb1')](util['format']('variable\x20%s\x20set',_0x35e192));};AGIVertices[_0xb124('0x11')][_0xb124('0x178')]=function(_0x2826b0){logger[_0xb124('0x32')](util[_0xb124('0x2b')](_0xb124('0x179'),_0x2826b0[_0xb124('0xa5')]));return this[_0xb124('0x39')]['sayDigits'](_0x2826b0[_0xb124('0x17a')]['replace'](/\s+/g,''),_0x2826b0['escape_digits']);};AGIVertices[_0xb124('0x11')][_0xb124('0x17b')]=function(_0x116e8f){logger['info'](util[_0xb124('0x2b')](_0xb124('0x17c'),_0x116e8f[_0xb124('0xa5')]));return this['channel'][_0xb124('0x17d')](_0x116e8f[_0xb124('0x66')]['replace'](/\s+/g,''),_0x116e8f[_0xb124('0x17e')]);};AGIVertices[_0xb124('0x11')]['sayphonetic']=function(_0x8cefd7){logger[_0xb124('0x32')](util[_0xb124('0x2b')]('Enter\x20in\x20SAYPHONETIC\x20(%s)\x20block',_0x8cefd7[_0xb124('0xa5')]));return this['channel'][_0xb124('0x17f')](_0x8cefd7[_0xb124('0x5a')],_0x8cefd7[_0xb124('0x17e')]);};AGIVertices[_0xb124('0x11')]['sendMail']=function(_0x164572){logger['info'](util[_0xb124('0x2b')](_0xb124('0x180'),_0x164572[_0xb124('0xa5')]));if(!this[_0xb124('0x80')](_0x164572[_0xb124('0x181')])){return this[_0xb124('0x39')]['noop']('no\x20mail\x20account\x20configured');}var _0x300182=this[_0xb124('0x23')][_0xb124('0xa3')](this,_0x164572[_0xb124('0x181')]);if(!_0x300182||!_0x300182['Smtp']){return this[_0xb124('0x39')][_0xb124('0x2f')](_0x164572,_0xb124('0x182'));}var _0x589afd={'from':util[_0xb124('0x2b')]('\x22%s\x22\x20<%s>',_0x300182[_0xb124('0x15')],_0x300182[_0xb124('0x183')]||_0x300182[_0xb124('0x184')][_0xb124('0x185')]),'to':_0x164572['to']||'','cc':_0x164572['cc']||'','bcc':_0x164572[_0xb124('0x186')]||'','subject':_0x164572[_0xb124('0x187')],'html':_0x164572['text'],'text':_0x164572[_0xb124('0x5a')]};var _0x1cff46={'tls':{'rejectUnauthorized':![]}};if(_0x300182['Smtp'][_0xb124('0x188')]){_0x1cff46[_0xb124('0x188')]=_0x300182['Smtp'][_0xb124('0x188')];}else{_0x1cff46[_0xb124('0x189')]=_0x300182[_0xb124('0x184')]['host'];_0x1cff46[_0xb124('0x18a')]=_0x300182[_0xb124('0x184')][_0xb124('0x18a')];_0x1cff46[_0xb124('0x18b')]=_0x300182[_0xb124('0x184')][_0xb124('0x18b')];}if(_0x300182['Smtp']['authentication']){_0x1cff46[_0xb124('0x18c')]={'user':_0x300182[_0xb124('0x184')]['user'],'pass':_0x300182['Smtp'][_0xb124('0x18d')]};}if(this[_0xb124('0x80')](_0x164572[_0xb124('0x18e')])){}logger[_0xb124('0xd8')]('sendMail\x20message',JSON[_0xb124('0x70')](_0x589afd));this[_0xb124('0x38')][_0xb124('0xa3')](this,_0x164572,_0x164572[_0xb124('0x181')]);this[_0xb124('0x39')][_0xb124('0xb1')](util[_0xb124('0x2b')]('Trying\x20SendMail\x20with\x20account\x20%s',_0x300182['name']));this[_0xb124('0x25')][_0xb124('0xa3')](this,_0x1cff46,_0x589afd);return this['channel'][_0xb124('0xb1')](_0xb124('0x18f'));};AGIVertices[_0xb124('0x11')][_0xb124('0x190')]=function(_0x36a63c){logger[_0xb124('0x32')](util['format'](_0xb124('0x191'),_0x36a63c[_0xb124('0xa5')]));return this[_0xb124('0x39')][_0xb124('0xb1')]('SENDFAX\x20block\x20not\x20implemented');};AGIVertices[_0xb124('0x11')][_0xb124('0x192')]=function(_0x506c5e){logger['info'](util[_0xb124('0x2b')](_0xb124('0x193'),_0x506c5e[_0xb124('0xa5')]));if(!this[_0xb124('0x80')](_0x506c5e[_0xb124('0x194')])){return this['channel'][_0xb124('0xb1')]('no\x20sms\x20account\x20configured');}var _0x38c2f4=this[_0xb124('0x195')][_0xb124('0xa3')](this,_0x506c5e[_0xb124('0x194')]);if(!_0x38c2f4){return this[_0xb124('0x39')]['error'](_0x506c5e,_0xb124('0x196'));}var _0x546ff4={'body':_0x506c5e['sms_text'],'phone':_0x506c5e['to']||'','SmsAccountId':_0x38c2f4['id']};logger[_0xb124('0xd8')](_0xb124('0x197'),JSON[_0xb124('0x70')](_0x546ff4));this[_0xb124('0x38')][_0xb124('0xa3')](this,_0x506c5e,_0x506c5e[_0xb124('0x194')]);this[_0xb124('0x39')][_0xb124('0xb1')](util[_0xb124('0x2b')](_0xb124('0x198'),_0x38c2f4[_0xb124('0x15')]));this['createSmsMessage']['sync'](this,_0x546ff4);return this[_0xb124('0x39')][_0xb124('0xb1')](_0xb124('0x199'));};AGIVertices[_0xb124('0x11')][_0xb124('0x19a')]=function(_0x4d2dbe){logger['info'](util['format']('Enter\x20in\x20SET\x20(%s)\x20block',_0x4d2dbe['label']));if(!this['isConfigured'](_0x4d2dbe['variable_id'])){return this['channel'][_0xb124('0x2f')](_0x4d2dbe,'no\x20variable\x20selected');}var _0x476e4f=this['getVariable'][_0xb124('0xa3')](this,_0x4d2dbe[_0xb124('0xd0')]);if(!_0x476e4f){return this[_0xb124('0x39')][_0xb124('0x2f')](_0x4d2dbe,'no\x20variable\x20found');}return this[_0xb124('0x39')]['setVariable'](_0x476e4f,_0x4d2dbe['variable_value']);};AGIVertices[_0xb124('0x11')][_0xb124('0x19b')]=function(_0x5a6300){logger[_0xb124('0x32')](util['format']('Enter\x20in\x20START\x20(%s)\x20block',_0x5a6300['label']));this[_0xb124('0x39')][_0xb124('0xb1')](_0xb124('0x19c'));if(_0x5a6300[_0xb124('0xa8')]===_0xb124('0x19d')){this[_0xb124('0x39')][_0xb124('0xb1')](_0xb124('0x19e'));return this['channel']['answer']();}return this['channel'][_0xb124('0xb1')](_0xb124('0x19f'));};AGIVertices[_0xb124('0x11')][_0xb124('0x1a0')]=function(_0x2edc81){logger[_0xb124('0x32')](util[_0xb124('0x2b')]('Enter\x20in\x20SUBPROJECT\x20(%s)\x20block',_0x2edc81[_0xb124('0xa5')]));if(!this[_0xb124('0x80')](_0x2edc81[_0xb124('0x1a1')])){return this[_0xb124('0x39')][_0xb124('0x2f')](_0x2edc81,_0xb124('0x1a2'));}var _0x32ba7a=this[_0xb124('0x19')][_0xb124('0xa3')](this,_0x2edc81['project_id']);if(!this['isConfigured'](_0x32ba7a)){return this['channel'][_0xb124('0x2f')](_0x2edc81,util[_0xb124('0x2b')](_0xb124('0x1a3'),_0x2edc81[_0xb124('0x1a1')]));}if(_0x32ba7a===this['channel'][_0xb124('0x3b')]){return this['channel']['error'](_0x2edc81,_0xb124('0x1a4'));}this[_0xb124('0x38')][_0xb124('0xa3')](this,_0x2edc81,_0x32ba7a);var _0xb9e788=this[_0xb124('0x39')][_0xb124('0xb5')](_0xb124('0x1a5'),util[_0xb124('0x2b')](_0xb124('0x1a6'),config[_0xb124('0x7')]['host']||'127.0.0.1',_0x32ba7a,this[_0xb124('0x39')][_0xb124('0x3b')]));if(_0xb9e788[_0xb124('0xa0')]===-0x1){return _0xb9e788;}return this[_0xb124('0x39')][_0xb124('0xb1')](util[_0xb124('0x2b')]('Executed\x20command\x20%s\x20%s',_0xb124('0x1a5'),_0x32ba7a));};AGIVertices[_0xb124('0x11')][_0xb124('0x1a7')]=function(_0x5f2610){logger[_0xb124('0x32')](util[_0xb124('0x2b')](_0xb124('0x1a8'),_0x5f2610[_0xb124('0xa5')]));var _0x298f0c=this[_0xb124('0x1a9')][_0xb124('0xa3')](this,_0x5f2610[_0xb124('0xa6')]);this['createSquareDetailsReport']['sync'](this,_0x5f2610,_0x5f2610['command']);if(this[_0xb124('0x80')](_0x5f2610[_0xb124('0xd0')])){var _0x1e7ed7=this['getVariable'][_0xb124('0xa3')](this,_0x5f2610[_0xb124('0xd0')]);if(_0x1e7ed7){this['channel'][_0xb124('0x9c')](_0x1e7ed7,_0x298f0c);return this[_0xb124('0x39')][_0xb124('0xb1')](util[_0xb124('0x2b')](_0xb124('0x1aa'),_0x5f2610[_0xb124('0xa6')],_0x1e7ed7));}}return this[_0xb124('0x39')][_0xb124('0xb1')](util['format'](_0xb124('0x1ab'),_0x5f2610[_0xb124('0xa6')]));};AGIVertices[_0xb124('0x11')][_0xb124('0x1ac')]=function(_0x209674){logger[_0xb124('0x32')](util['format'](_0xb124('0x1ad'),_0x209674['label']));if(!this[_0xb124('0x80')](_0x209674[_0xb124('0x58')])){return this[_0xb124('0x39')]['noop']('no\x20apiKey\x20configured');}if(!this[_0xb124('0x80')](_0x209674['text'])){return this[_0xb124('0x39')][_0xb124('0xb1')](_0xb124('0xb9'));}this[_0xb124('0x39')][_0xb124('0xb1')](util['format'](_0xb124('0x1ae'),_0x209674[_0xb124('0x5a')]));var _0xb24256=this[_0xb124('0x57')][_0xb124('0xa3')](this,_0x209674);if(_0xb24256){this[_0xb124('0x39')]['noop'](util[_0xb124('0x2b')]('Google\x20Cloud\x20TTS\x20%s\x20file\x20created',_0xb24256));var _0x184686=this[_0xb124('0x39')][_0xb124('0xf0')](_0xb24256);try{fs[_0xb124('0xf1')](_0xb24256+'.wav');}catch(_0x847d7d){logger[_0xb124('0x2f')](_0x847d7d);}return _0x184686;}return this['channel'][_0xb124('0x2f')](_0x209674,_0xb124('0x1af'));};AGIVertices[_0xb124('0x11')]['tts']=function(_0x26bc93){logger[_0xb124('0x32')](util[_0xb124('0x2b')](_0xb124('0x1b0'),_0x26bc93[_0xb124('0xa5')]));if(!this[_0xb124('0x80')](_0x26bc93[_0xb124('0x5a')])){return this['channel'][_0xb124('0xb1')]('no\x20text\x20configured');}this[_0xb124('0x39')][_0xb124('0xb1')](util['format'](_0xb124('0x1b1'),_0x26bc93[_0xb124('0x5a')]));var _0x5371f2=this[_0xb124('0x61')]['sync'](this,_0x26bc93);if(_0x5371f2){this[_0xb124('0x39')][_0xb124('0xb1')](util[_0xb124('0x2b')]('Google\x20TTS\x20%s\x20file\x20created',_0x5371f2));var _0xe1f725=this[_0xb124('0x39')][_0xb124('0xf0')](_0x5371f2);try{fs[_0xb124('0xf1')](_0x5371f2+_0xb124('0x113'));}catch(_0x4f63a4){logger[_0xb124('0x2f')](_0x4f63a4);}return _0xe1f725;}return this['channel']['error'](_0x26bc93,_0xb124('0x1b2'));};AGIVertices[_0xb124('0x11')][_0xb124('0x1b3')]=function(_0x39b923){logger[_0xb124('0x32')](util[_0xb124('0x2b')](_0xb124('0x1b4'),_0x39b923[_0xb124('0xa5')]));if(!this[_0xb124('0x80')](_0x39b923['findBy'])){return this['channel'][_0xb124('0x2f')](_0x39b923,_0xb124('0x147'));}logger[_0xb124('0x32')](util['format'](_0xb124('0x148'),this[_0xb124('0x39')][_0xb124('0x3d')],_0x39b923[_0xb124('0x149')]));var _0x5d0f01=this[_0xb124('0x4f')][_0xb124('0xa3')](this,_0x39b923[_0xb124('0x149')]);if(_0x5d0f01){logger[_0xb124('0x32')](util[_0xb124('0x2b')](_0xb124('0x14a'),this[_0xb124('0x39')][_0xb124('0x3d')],_0x39b923[_0xb124('0x149')]));this[_0xb124('0x39')][_0xb124('0xb1')](util[_0xb124('0x2b')](_0xb124('0x14a'),this[_0xb124('0x39')][_0xb124('0x3d')],_0x39b923[_0xb124('0x149')]));return{'code':0xc8,'result':'success'};}else{logger[_0xb124('0x32')](util['format']('AGENT\x20%s\x20NOT\x20FOUND\x20BY',this[_0xb124('0x39')][_0xb124('0x3d')],_0x39b923[_0xb124('0x149')]));this[_0xb124('0x39')][_0xb124('0xb1')](util['format'](_0xb124('0x14c'),this['channel'][_0xb124('0x3d')],_0x39b923['findBy']));return{'code':0xc8,'result':_0xb124('0x14d')};}};AGIVertices[_0xb124('0x11')]['voicemail']=function(_0x443751){logger[_0xb124('0x32')](util[_0xb124('0x2b')]('Enter\x20in\x20VOICEMAIL\x20(%s)\x20block',_0x443751[_0xb124('0xa5')]));var _0x38814b=this['channel'][_0xb124('0xb5')]('VOICEMAIL',[_0x443751['mailbox'],_0x443751[_0xb124('0x77')]]);if(_0x38814b[_0xb124('0xa0')]===-0x1){return _0x38814b;}return this[_0xb124('0x39')][_0xb124('0xb1')](util[_0xb124('0x2b')](_0xb124('0xb7'),_0xb124('0x1b5'),_0x443751[_0xb124('0x1b6')]));};AGIVertices[_0xb124('0x11')][_0xb124('0x1b7')]=function(_0x3d593b){logger[_0xb124('0x32')](util['format']('Enter\x20in\x20SWITCH\x20(%s)\x20block',_0x3d593b[_0xb124('0xa5')]));if(!this[_0xb124('0x80')](_0x3d593b['variable_id'])){return this[_0xb124('0x39')]['error'](_0x3d593b,_0xb124('0x1b8'));}var _0x23f480=this[_0xb124('0x12')][_0xb124('0xa3')](this,_0x3d593b[_0xb124('0xd0')]);if(!_0x23f480){return this[_0xb124('0x39')][_0xb124('0x2f')](_0x3d593b,_0xb124('0xd2'));}var _0x447275=this['channel'][_0xb124('0x12')](_0x23f480);return{'code':0xc8,'result':_0x447275['extra']?_0x447275[_0xb124('0x9e')]:'-'};};String[_0xb124('0x11')][_0xb124('0x1b9')]=function(_0x1ac8ba,_0xf35ce4){return this['split'](_0x1ac8ba)['join'](_0xf35ce4);};module['exports']=AGIVertices;
\ No newline at end of file
+var _0x2519=['sms_account_id','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','Enter\x20in\x20START\x20(%s)\x20block','START\x20CALLY\x20SQUARE','yes','Answer','subproject','project_id','no\x20subproject\x20selected','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','host','127.0.0.1','system','Enter\x20in\x20SYSTEM\x20(%s)\x20block','command','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','Trying\x20Google\x20Cloud\x20TTS\x20%s','Enter\x20in\x20GOOGLETTS\x20(%s)\x20block','Trying\x20Google\x20TTS\x20%s','Google\x20TTS\x20is\x20unreachable','unpause','Enter\x20in\x20UNPAUSE\x20(%s)\x20block','voicemail','Enter\x20in\x20VOICEMAIL\x20(%s)\x20block','VOICEMAIL','mailbox','Enter\x20in\x20SWITCH\x20(%s)\x20block','replaceAll','join','exports','path','util','lodash','shelljs','odbc','moment','mustache','../../config/logger','agi','menu','getdigits','getsecretdigits','channel','getVariable','getVariableById','then','name','catch','prototype','rpc','getVoiceQueueById','getSquareProject','getSquareOdbc','dsn','getUser','getUserById','getTrunkById','getSoundById','getSoundPath','save_name','getMailAccount','sendMailMessage','getIntervals','IntervalId','interval','map','Intervals','format','getQueryOdbc','open','error','Error\x20getting\x20ODBC\x20connection\x20%s','info','ODBC\x20connection\x20successfully','query','Query\x20executed\x20correctly\x20%s','Error\x20closing\x20connection\x20to\x20odbc\x20%s','getSmsAccount','createSmsMessage','createSquareDetailsReport','uniqueid','label','agicommand','arg_1','callerid','createSquareRecording','calleridname','extension','priority','accountcode','dnid','file','createSquareMessage','createCmContact','isEmpty','isNil','callback_','random','lastName','phone','list_id','scheduledAt','callback','callback_priority','getPause','agentPause','agent','agentUnpause','agentLogout','%s/%s@from-sip/n','LOCAL','agentLogin','shellCommand','exec','trim','replace','googleCloudTTS','apiKey','google_cloud_tts_text_type','text','languageCode','en-US','MALE','audioEncoding','MP3','googleTTS','google_tts_language','restAPI','url','method','timeout','number','includes','POST','PUT','toUpperCase','body','rawBody','An\x20incorrect\x20formatted\x20json\x20body\x20has\x20been\x20passed\x20to\x20the\x20function','headers','rawHeaders','An\x20incorrect\x20formatted\x20json\x20headers\x20has\x20been\x20passed\x20to\x20the\x20function','computedVariables','sync','render','parse','stringify','An\x20incorrect\x20formatted\x20json\x20has\x20been\x20passed\x20to\x20the\x20function','statusCode','message','500\x20-\x20Internal\x20Server\x20Error','options','googleDialogflow','ispeechTTS','key','ispeech_tts_language','speed','ispeechASR','ispeech_asr_language','isConfigured','model','aws_access_key_id','aws_polly_region','aws_polly_voice','Amy','aws_text_type','awsLex','aws_secret_access_key','aws_bot_name','googleASR','tildeASR','appid','appsecret','clear','hasOwnProperty','isString','replaceObjectAllVariables','recursiveNodeIndex','isPlainObject','isArray','saveRestApiResult','length','%s.%s','replaceAllVariables','split','extra','toString','getAndSetVariable','result','setVariable','maxRetry','Enter\x20in\x20AGI\x20(%s)\x20block','args','answer','Enter\x20in\x20ANSWER\x20(%s)\x20block','Wait\x20%s\x20seconds\x20before\x20answer','wait','no\x20list\x20selected','add','CALLBACK\x20added\x20phone:\x20%s\x20on\x20list:\x20%s\x20at\x20%s','application','noop','lumenvoxtts','Enter\x20in\x20LUMENVOXTTS\x20(%s)\x20block','MRCPSynth','Executed\x20command\x20MRCPSynth\x20%s','sestektts','Enter\x20in\x20SESTEKTTS\x20(%s)\x20block','no\x20text\x20configured','Enter\x20in\x20LUMENVOXASR\x20(%s)\x20block','grammar','no\x20grammar\x20configured','MRCPRecog','RECOG_CONFIDENCE()','RECOG_INPUT()','LUMENVOX_ASR_TRANSCRIPT','RECOG_INSTANCE()','LUMENVOX_ASR_INSTANCE','Executed\x20command\x20MRCPRecog\x20%s','SESTEK_ASR_CONFIDENCE','SESTEK_ASR_TRANSCRIPT','SESTEK_ASR_INSTANCE','database','odbc_id','no\x20database\x20selected','no\x20odbc\x20database\x20found','query:\x20%s','variable_id','no\x20variable\x20selected\x20for\x20the\x20result','no\x20variable\x20found','forEach','keys','%s[%s][%s]','%s_ROWS_COUNT','variable\x20%s\x20set','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','no\x20key\x20configured','bot','Trying\x20Dialogflow:\x20%s','DIALOGFLOW_%s','speech','out','Dialogflow\x20is\x20unreachable','sesteknda','Enter\x20in\x20SESTEKNDA\x20(%s)\x20block','no\x20ndauth\x20url\x20configured','password','sestekNDA','audiofile','Sestek\x20NDA\x20%s\x20file\x20created','streamFile','unlink','.wav','SestekNDA\x20Result\x20%s','SestekNDA\x20is\x20unreachable','end','ext_dial','Enter\x20in\x20EXTERNAL\x20DIAL\x20(%s)\x20block','trunk_id','getTrunk','no\x20trunk\x20found','trunk_name','SIP/%s/%s','finally','Enter\x20in\x20GETDIGITS\x20(%s)\x20block','getSound','file_id','no\x20file\x20audio\x20found','getData','response','test','mindigit','maxdigit','generate','hiddendigitspos','substr','Enter\x20in\x20GETSECRETDIGITS\x20(%s)\x20block','goal','goalname','awspolly','[AGI]\x20Enter\x20in\x20AWSPOLLY\x20(%s)\x20block','no\x20valid\x20credentials\x20configured','awsPolly','aws\x20Polly\x20%s\x20file\x20created','Enter\x20in\x20Amazon\x20Lex\x20(%s)\x20block','Trying\x20Amazon\x20Lex:\x20%s','Amazon\x20Lex\x20ready\x20for\x20fulfillment','Amazon\x20Lex\x20Result\x20%s','Amazon\x20Lex\x20is\x20unreachable','beep','NOBEEP','recordFile','intKey','GoogleASR\x20Result\x20%s','tildeasr','Enter\x20in\x20TILDEASR\x20(%s)\x20block','no\x20appid\x20configured','no\x20appsecret\x20configured','%s/recordings/%s','tilde\x20%s\x20file\x20created','TILDE_ASR_%s','TildeASR\x20Result\x20%s','Enter\x20in\x20GOTO\x20(%s)\x20block','continueAt','context','Enter\x20in\x20GOTOIF\x20(%s)\x20block','condition','false','EVAL\x20CONDITION\x20%s\x20%s','gotoiftime','interval_id','no\x20interval\x20configured','no\x20intervals\x20found','IFTIME(%s?true:false)','IFTIME\x20%s\x20%s','true','hangup','ispeechasr','Enter\x20in\x20ISPEECHASR\x20(%s)\x20block','wav','ispeech\x20%s\x20file\x20created','ISPEECH_ASR_%s','IspeechASR\x20Result\x20%s','Enter\x20in\x20ISPEECHTTS\x20(%s)\x20block','Trying\x20ispeech\x20TTS\x20%s','login','Enter\x20in\x20LOGIN\x20(%s)\x20block','findBy','no\x20find\x20by\x20configured','FIND\x20AGENT\x20%s\x20BY\x20%s','AGENT\x20%s\x20FOUND\x20BY','success','AGENT\x20%s\x20NOT\x20FOUND\x20BY','failure','logout','Enter\x20in\x20LOGOUT\x20(%s)\x20block','Enter\x20in\x20MATH\x20(%s)\x20block','math\x20%s','operation','%s[%s]','variable\x20%s[key]\x20set','retry','digit','Enter\x20in\x20NOOP\x20(%s)\x20block','output','pause','Enter\x20in\x20PAUSE\x20(%s)\x20block','pause_id','playback','Enter\x20in\x20PLAYBACK\x20(%s)\x20block','no\x20file\x20audio\x20selected','Executed\x20command\x20%s\x20%s','queue','Enter\x20in\x20QUEUE\x20(%s)\x20block','queue_id','no\x20queue\x20found','indexOf','XMCS-QUEUE','toLowerCase','QUEUE','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','no\x20variable\x20selected\x20for\x20the\x20response','%s_STATUS_MESSAGE','saydigits','Enter\x20in\x20SAYDIGITS\x20(%s)\x20block','digits','Enter\x20in\x20SAYNUMBER\x20(%s)\x20block','sayNumber','sayphonetic','sayPhonetic','Enter\x20in\x20SENDMAIL\x20(%s)\x20block','account_id','Smtp','no\x20mail\x20account\x20found','\x22%s\x22\x20<%s>','user','bcc','subject','service','port','secure','authentication','auth','pass','debug','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','Enter\x20in\x20SENDSMS\x20(%s)\x20block'];(function(_0x307d86,_0x9264f2){var _0x361745=function(_0x1b64e1){while(--_0x1b64e1){_0x307d86['push'](_0x307d86['shift']());}};_0x361745(++_0x9264f2);}(_0x2519,0x1cf));var _0x9251=function(_0x321bb2,_0x202794){_0x321bb2=_0x321bb2-0x0;var _0x9c12ed=_0x2519[_0x321bb2];return _0x9c12ed;};'use strict';var fs=require('fs');var path=require(_0x9251('0x0'));var util=require(_0x9251('0x1'));var _=require(_0x9251('0x2'));var sh=require(_0x9251('0x3'));var odbc=require(_0x9251('0x4'))();var rs=require('randomstring');var moment=require(_0x9251('0x5'));var Mustache=require(_0x9251('0x6'));var rp=require('request-promise');var logger=require(_0x9251('0x7'))(_0x9251('0x8'));var config=require('../../config/environment');var scripts=require('./scripts');var FILES_PATH='/var/opt/motion2/server/files';var recursiveMapAttributes=['rawHeaders','rawBody'];var verticesWithRetry=[_0x9251('0x9'),_0x9251('0xa'),_0x9251('0xb')];var AGIVertices=function(_0x1678c7,_0x4dad39,_0x5e399d){this[_0x9251('0xc')]=_0x1678c7;this['rpc']=_0x4dad39;this['mailRpc']=_0x5e399d;};AGIVertices['prototype'][_0x9251('0xd')]=function(_0x47f3e9,_0x5a7eee){this['rpc'][_0x9251('0xe')](_0x47f3e9)[_0x9251('0xf')](function(_0x414392){_0x5a7eee(null,_0x414392?_0x414392[_0x9251('0x10')]:![]);})[_0x9251('0x11')](function(_0x3997dc){_0x5a7eee(_0x3997dc);});};AGIVertices[_0x9251('0x12')]['getVoiceQueue']=function(_0x51a9a1,_0x2a9995){this[_0x9251('0x13')][_0x9251('0x14')](_0x51a9a1)[_0x9251('0xf')](function(_0x822a60){_0x2a9995(null,_0x822a60?_0x822a60[_0x9251('0x10')]:![]);})[_0x9251('0x11')](function(_0x5977f3){_0x2a9995(_0x5977f3);});};AGIVertices['prototype'][_0x9251('0x15')]=function(_0x1cc625,_0x108dae){this[_0x9251('0x13')]['getSquareProjectById'](_0x1cc625)[_0x9251('0xf')](function(_0x562c63){_0x108dae(null,_0x562c63?_0x562c63[_0x9251('0x10')]:![]);})[_0x9251('0x11')](function(_0x355aa8){_0x108dae(_0x355aa8);});};AGIVertices['prototype'][_0x9251('0x16')]=function(_0x27ce1c,_0x1b7c5f){this[_0x9251('0x13')]['getSquareOdbcById'](_0x27ce1c)[_0x9251('0xf')](function(_0x4948a0){_0x1b7c5f(null,_0x4948a0?_0x4948a0[_0x9251('0x17')]:![]);})[_0x9251('0x11')](function(_0x3e2af5){_0x1b7c5f(_0x3e2af5);});};AGIVertices[_0x9251('0x12')][_0x9251('0x18')]=function(_0x3a37df,_0x184ce0){this['rpc'][_0x9251('0x19')](_0x3a37df)[_0x9251('0xf')](function(_0x5535a0){_0x184ce0(null,_0x5535a0?_0x5535a0['name']:![]);})['catch'](function(_0x6c7fcb){_0x184ce0(_0x6c7fcb);});};AGIVertices[_0x9251('0x12')]['getTrunk']=function(_0x295687,_0x1d1fa5){this[_0x9251('0x13')][_0x9251('0x1a')](_0x295687)[_0x9251('0xf')](function(_0xd6def1){_0x1d1fa5(null,_0xd6def1?_0xd6def1[_0x9251('0x10')]:![]);})['catch'](function(_0x350b46){_0x1d1fa5(_0x350b46);});};AGIVertices['prototype']['getSound']=function(_0x5ef58d,_0x439379){var _0xc6b972=this;this['rpc'][_0x9251('0x1b')](_0x5ef58d)[_0x9251('0xf')](function(_0x377839){_0x439379(null,_0x377839?_0xc6b972[_0x9251('0x1c')](_0x377839[_0x9251('0x1d')]):![]);})[_0x9251('0x11')](function(_0x1b5fe2){_0x439379(_0x1b5fe2);});};AGIVertices['prototype'][_0x9251('0x1e')]=function(_0x1907a7,_0x5b4154){this[_0x9251('0x13')]['getMailAccountById'](_0x1907a7)[_0x9251('0xf')](function(_0x25173e){_0x5b4154(null,_0x25173e?_0x25173e:![]);})[_0x9251('0x11')](function(_0x1ec10a){_0x5b4154(_0x1ec10a);});};AGIVertices[_0x9251('0x12')][_0x9251('0x1f')]=function(_0x322178,_0x1b1bf2,_0xc65338){this['mailRpc'][_0x9251('0x1f')](_0x322178,_0x1b1bf2)['then'](function(){_0xc65338(null);})[_0x9251('0x11')](function(_0x3e50c1){_0xc65338(_0x3e50c1);});};AGIVertices['prototype'][_0x9251('0x20')]=function(_0x1c4f4f,_0x3d0618){this[_0x9251('0x13')]['getIntervalById'](_0x1c4f4f)[_0x9251('0xf')](function(_0x348b1b){if(_0x348b1b){if(_0x348b1b[_0x9251('0x21')]){_0x3d0618(null,[_0x348b1b[_0x9251('0x22')]]);}else{_0x3d0618(null,_[_0x9251('0x23')](_0x348b1b[_0x9251('0x24')],_0x9251('0x22')));}}else{_0x3d0618(null,![]);}})[_0x9251('0x11')](function(_0x4f7a5e){_0x3d0618(_0x4f7a5e);});};AGIVertices['prototype']['getSoundPath']=function(_0x1c5a32){return util[_0x9251('0x25')]('%s/sounds/converted/%s',FILES_PATH,_0x1c5a32);};AGIVertices['prototype'][_0x9251('0x26')]=function(_0x4df389,_0x364648,_0x3659c0){odbc[_0x9251('0x27')](_0x4df389,function(_0x3197f3){if(_0x3197f3){logger[_0x9251('0x28')](_0x9251('0x29'),_0x3197f3);_0x3659c0(_0x3197f3);}else{logger[_0x9251('0x2a')](_0x9251('0x2b'));odbc[_0x9251('0x2c')](_0x364648,function(_0x48d4fb,_0x81d1e2){if(_0x48d4fb){logger['info']('Error\x20executing\x20query\x20%s',_0x364648);_0x3659c0(_0x48d4fb);}else{logger[_0x9251('0x2a')](_0x9251('0x2d'),_0x364648);odbc['close'](function(_0x5136ce){if(_0x5136ce){logger['error'](_0x9251('0x2e'),_0x5136ce);}_0x3659c0(null,_0x81d1e2);});}});}});};AGIVertices['prototype'][_0x9251('0x2f')]=function(_0x24d7c4,_0x3d2a10){this[_0x9251('0x13')]['getSmsAccountById'](_0x24d7c4)[_0x9251('0xf')](function(_0x25dcd5){_0x3d2a10(null,_0x25dcd5?_0x25dcd5:![]);})[_0x9251('0x11')](function(_0x372acf){_0x3d2a10(_0x372acf);});};AGIVertices[_0x9251('0x12')][_0x9251('0x30')]=function(_0x961997,_0x1de7b3){this[_0x9251('0x13')][_0x9251('0x30')](_0x961997)[_0x9251('0xf')](function(_0x1614d1){_0x1de7b3(null,_0x1614d1);})['catch'](function(_0xd76563){_0x1de7b3(_0xd76563);});};AGIVertices[_0x9251('0x12')][_0x9251('0x31')]=function(_0x1801f5,_0x4e8807,_0xbcc9c8){this[_0x9251('0x13')]['createSquareDetailsReport']({'uniqueid':this['channel'][_0x9251('0x32')],'node':_0x1801f5[_0x9251('0x33')],'application':_0x1801f5[_0x9251('0x34')],'data':_0x4e8807||null,'project_name':this['channel'][_0x9251('0x35')],'callerid':this[_0x9251('0xc')][_0x9251('0x36')]})[_0x9251('0xf')](function(_0x113a3){if(_0xbcc9c8){_0xbcc9c8(null,_0x113a3);}})[_0x9251('0x11')](function(_0x32578f){if(_0xbcc9c8){_0xbcc9c8(_0x32578f);}});};AGIVertices[_0x9251('0x12')]['createSquareRecording']=function(_0x5a10ca,_0x374969,_0x28f8fb,_0x5397a1){this[_0x9251('0x13')][_0x9251('0x37')]({'uniqueid':this[_0x9251('0xc')]['uniqueid'],'callerid':this[_0x9251('0xc')]['callerid'],'calleridname':this[_0x9251('0xc')][_0x9251('0x38')],'context':this[_0x9251('0xc')]['context'],'extension':this[_0x9251('0xc')][_0x9251('0x39')],'priority':this[_0x9251('0xc')][_0x9251('0x3a')],'accountcode':this[_0x9251('0xc')][_0x9251('0x3b')],'dnid':this['channel'][_0x9251('0x3c')],'projectName':this[_0x9251('0xc')]['arg_1'],'saveName':_0x374969,'filename':_0x5a10ca[_0x9251('0x3d')]||_0x374969,'savePath':_0x28f8fb})['then'](function(_0x499f48){_0x5397a1(null,_0x499f48);})['catch'](function(_0x276d36){_0x5397a1(_0x276d36);});};AGIVertices[_0x9251('0x12')]['createSquareMessage']=function(_0x125946,_0x5edd5b,_0x2900c5){this[_0x9251('0x13')][_0x9251('0x3e')]({'uniqueid':this[_0x9251('0xc')][_0x9251('0x32')],'body':_0x125946,'direction':_0x5edd5b})[_0x9251('0xf')](function(_0x379078){if(_0x2900c5){_0x2900c5(null,_0x379078);}})[_0x9251('0x11')](function(_0x36402b){if(_0x2900c5){_0x2900c5(_0x36402b);}});};AGIVertices[_0x9251('0x12')][_0x9251('0x3f')]=function(_0x3a82b1,_0x15eb4e){this[_0x9251('0x13')][_0x9251('0x3f')]({'firstName':_[_0x9251('0x40')](_0x3a82b1[_0x9251('0x10')])||_[_0x9251('0x41')](_0x3a82b1[_0x9251('0x10')])?_0x9251('0x42')+Math[_0x9251('0x43')]():_0x3a82b1[_0x9251('0x10')],'lastName':_[_0x9251('0x40')](_0x3a82b1[_0x9251('0x44')])||_[_0x9251('0x41')](_0x3a82b1['lastName'])?null:_0x3a82b1[_0x9251('0x44')],'phone':_0x3a82b1[_0x9251('0x45')],'ListId':_0x3a82b1[_0x9251('0x46')],'scheduledat':_0x3a82b1[_0x9251('0x47')],'callbackUniqueid':this['channel']['uniqueid'],'tags':_0x9251('0x48'),'description':'Callback\x20scheduled\x20at\x20'+_0x3a82b1[_0x9251('0x47')]['toString'](),'priority':_0x3a82b1[_0x9251('0x49')]})[_0x9251('0xf')](function(_0x1cab1b){_0x15eb4e(null,_0x1cab1b);})[_0x9251('0x11')](function(_0x8e72bc){_0x15eb4e(_0x8e72bc);});};AGIVertices[_0x9251('0x12')][_0x9251('0x4a')]=function(_0x7c1ff9,_0x37e06b){this[_0x9251('0x13')]['getPauseById'](_0x7c1ff9)[_0x9251('0xf')](function(_0x45fe36){_0x37e06b(null,_0x45fe36?_0x45fe36[_0x9251('0x10')]:![]);})['catch'](function(_0x4deba8){_0x37e06b(_0x4deba8);});};AGIVertices['prototype'][_0x9251('0x4b')]=function(_0x91f94,_0x5d1cea,_0x25bf6c){var _0x4702e9={'role':_0x9251('0x4c')};_0x4702e9[_0x91f94]=this['channel'][_0x9251('0x36')];this[_0x9251('0x13')][_0x9251('0x4b')](_0x4702e9,_0x5d1cea,this['channel']['uniqueid'])[_0x9251('0xf')](function(_0x518303){_0x25bf6c(null,_[_0x9251('0x41')](_0x518303)?![]:!![]);})['catch'](function(_0x13e56c){logger[_0x9251('0x28')](_0x13e56c);_0x25bf6c(null,![]);});};AGIVertices[_0x9251('0x12')][_0x9251('0x4d')]=function(_0x3f4de6,_0x453985){var _0x1881c6={'role':_0x9251('0x4c')};_0x1881c6[_0x3f4de6]=this[_0x9251('0xc')][_0x9251('0x36')];this['rpc'][_0x9251('0x4d')](_0x1881c6)[_0x9251('0xf')](function(_0x5cae26){_0x453985(null,_[_0x9251('0x41')](_0x5cae26)?![]:!![]);})[_0x9251('0x11')](function(_0x541f7c){logger[_0x9251('0x28')](_0x541f7c);_0x453985(null,![]);});};AGIVertices['prototype']['agentLogout']=function(_0x529833,_0x1d952b){var _0x1d94ab={'role':_0x9251('0x4c')};_0x1d94ab[_0x529833]=this[_0x9251('0xc')][_0x9251('0x36')];this[_0x9251('0x13')][_0x9251('0x4e')](_0x1d94ab)[_0x9251('0xf')](function(_0x2c1419){_0x1d952b(null,_[_0x9251('0x41')](_0x2c1419)?![]:!![]);})[_0x9251('0x11')](function(_0x55f825){logger[_0x9251('0x28')](_0x55f825);_0x1d952b(null,![]);});};AGIVertices[_0x9251('0x12')]['agentLogin']=function(_0x14da51,_0x415439){var _0x51cf26={'role':'agent'};_0x51cf26[_0x14da51]=this[_0x9251('0xc')][_0x9251('0x36')];var _0x77c7e7=_0x14da51!='internal'?util[_0x9251('0x25')](_0x9251('0x4f'),_0x9251('0x50'),this[_0x9251('0xc')]['callerid']):undefined;this[_0x9251('0x13')][_0x9251('0x51')](_0x51cf26,_0x77c7e7)['then'](function(_0x1eb19d){_0x415439(null,_[_0x9251('0x41')](_0x1eb19d)?![]:!![]);})['catch'](function(_0x5351ee){logger[_0x9251('0x28')](_0x5351ee);_0x415439(null,![]);});};AGIVertices[_0x9251('0x12')][_0x9251('0x52')]=function(_0x5ba7d6,_0xcc3bcd){sh[_0x9251('0x53')](_[_0x9251('0x54')](_0x5ba7d6),function(_0x314ed4,_0x36e9d9){var _0x2a01e3=_0x36e9d9[_0x9251('0x55')](/(\r\n|\n|\r)/gm,'');_0xcc3bcd(null,_0x2a01e3);});};AGIVertices[_0x9251('0x12')][_0x9251('0x56')]=function(_0x1c79e8,_0x2c7d66){scripts[_0x9251('0x56')](_0x1c79e8[_0x9251('0x57')],_0x1c79e8[_0x9251('0x58')]||_0x9251('0x59'),_0x1c79e8[_0x9251('0x59')],_0x1c79e8[_0x9251('0x5a')]||_0x9251('0x5b'),_0x1c79e8['ssmlGender']||_0x9251('0x5c'),_0x1c79e8[_0x9251('0x5d')]||_0x9251('0x5e'))['then'](function(_0x305448){_0x2c7d66(null,_0x305448);})[_0x9251('0x11')](function(_0x30c48c){_0x2c7d66(_0x30c48c);});};AGIVertices['prototype'][_0x9251('0x5f')]=function(_0x476707,_0x1328dc){scripts[_0x9251('0x5f')](_0x476707[_0x9251('0x59')],_0x476707[_0x9251('0x60')]||'en',0x1)[_0x9251('0xf')](function(_0x1c4589){_0x1328dc(null,_0x1c4589);})[_0x9251('0x11')](function(_0x521e8b){_0x1328dc(_0x521e8b);});};AGIVertices[_0x9251('0x12')][_0x9251('0x61')]=function(_0x1ec019,_0x13f4c2){var _0x5830ae={'uri':_0x1ec019[_0x9251('0x62')],'method':_0x1ec019[_0x9251('0x63')],'json':!![],'resolveWithFullResponse':!![],'timeout':typeof parseInt(_0x1ec019[_0x9251('0x64')])===_0x9251('0x65')&&parseInt(_0x1ec019[_0x9251('0x64')])>=0x1?parseInt(_0x1ec019['timeout'])*0x3e8:0x5*0x3e8};if(_[_0x9251('0x66')]([_0x9251('0x67'),_0x9251('0x68')],_0x5830ae[_0x9251('0x63')][_0x9251('0x69')]())){try{_0x5830ae[_0x9251('0x6a')]=_0x1ec019['rawBody']?JSON['parse'](_0x1ec019[_0x9251('0x6b')]):{};}catch(_0x40040d){logger[_0x9251('0x28')](_0x9251('0x6c'),_0x40040d);}}try{_0x5830ae[_0x9251('0x6d')]=_0x1ec019[_0x9251('0x6e')]?JSON['parse'](_0x1ec019[_0x9251('0x6e')]):{};}catch(_0x485c2d){logger[_0x9251('0x28')](_0x9251('0x6f'),_0x485c2d);}if(_0x1ec019[_0x9251('0x70')]){try{var _0x13ae5e=require(_0x1ec019['computedVariables'])[_0x9251('0x71')](this,_0x5830ae);_0x5830ae['uri']=Mustache[_0x9251('0x72')](_0x1ec019[_0x9251('0x62')],_0x13ae5e,{},['$$','$$']);if(_0x5830ae[_0x9251('0x6d')]){_0x5830ae['headers']=JSON[_0x9251('0x73')](Mustache[_0x9251('0x72')](JSON[_0x9251('0x74')](_0x5830ae[_0x9251('0x6d')]),_0x13ae5e,{},['$$','$$']));}if(_0x5830ae[_0x9251('0x6a')]){_0x5830ae[_0x9251('0x6a')]=JSON[_0x9251('0x73')](Mustache[_0x9251('0x72')](JSON[_0x9251('0x74')](_0x5830ae[_0x9251('0x6a')]),_0x13ae5e,{},['$$','$$']));}}catch(_0x49c589){logger[_0x9251('0x28')](_0x9251('0x75'),_0x49c589);}}rp(_0x5830ae)[_0x9251('0xf')](function(_0x412d8e){var _0x4ef5b5={'statusCode':_0x412d8e[_0x9251('0x76')]||0xc8,'statusMessage':_0x412d8e['statusMessage']||'OK','headers':_0x412d8e[_0x9251('0x6d')]||{},'body':_0x412d8e['body']||{}};_0x13f4c2(null,_0x4ef5b5);})[_0x9251('0x11')](function(_0x225568){var _0x368cfe={'statusCode':_0x225568[_0x9251('0x76')]||0x1f4,'statusMessage':_0x225568[_0x9251('0x77')]||_0x9251('0x78'),'headers':_0x225568[_0x9251('0x79')][_0x9251('0x6d')]||{},'body':_0x225568[_0x9251('0x79')][_0x9251('0x6a')]||{}};_0x13f4c2(null,_0x368cfe);});};AGIVertices[_0x9251('0x12')]['googleDialogflow']=function(_0x304af5,_0x14054a){scripts[_0x9251('0x7a')](this[_0x9251('0xc')]['uniqueid'],_0x304af5['key'],_0x304af5[_0x9251('0x59')],_0x304af5['dialogflow_language']||'en')['then'](function(_0x3c9886){_0x14054a(null,_0x3c9886);})[_0x9251('0x11')](function(_0x1384ef){_0x14054a(_0x1384ef);});};AGIVertices['prototype']['sestekNDA']=function(_0x1312e0,_0x17048a){scripts['sestekNDA'](this[_0x9251('0xc')],_0x1312e0)[_0x9251('0xf')](function(_0x38bc03){_0x17048a(null,_0x38bc03);})[_0x9251('0x11')](function(_0x5e3cbb){_0x17048a(_0x5e3cbb);});};AGIVertices[_0x9251('0x12')][_0x9251('0x7b')]=function(_0x3c60d7,_0x59ecf3){scripts[_0x9251('0x7b')](_0x3c60d7[_0x9251('0x7c')],_0x3c60d7[_0x9251('0x59')],_0x3c60d7[_0x9251('0x7d')]||_0x9251('0x5b'),_0x3c60d7[_0x9251('0x7e')])[_0x9251('0xf')](function(_0xaab177){_0x59ecf3(null,_0xaab177);})[_0x9251('0x11')](function(_0x461145){_0x59ecf3(_0x461145);});};AGIVertices[_0x9251('0x12')][_0x9251('0x7f')]=function(_0x5e4349,_0x3944e5,_0x5a5074){scripts[_0x9251('0x7f')](_0x3944e5,_0x5e4349[_0x9251('0x7c')],_0x5e4349[_0x9251('0x80')]||_0x9251('0x5b'),this[_0x9251('0x81')](_0x5e4349[_0x9251('0x82')])?_0x5e4349[_0x9251('0x82')]:undefined)['then'](function(_0x369933){_0x5a5074(null,_0x369933);})[_0x9251('0x11')](function(_0x1d9651){_0x5a5074(_0x1d9651);});};AGIVertices['prototype']['awsPolly']=function(_0x9b83be,_0x10d00e){scripts['awsPolly'](_0x9b83be[_0x9251('0x83')],_0x9b83be['aws_secret_access_key'],_0x9b83be[_0x9251('0x84')],_0x9b83be[_0x9251('0x85')]||_0x9251('0x86'),_0x9b83be[_0x9251('0x59')],_0x9b83be[_0x9251('0x87')]||'text')['then'](function(_0x2340c5){_0x10d00e(null,_0x2340c5);})[_0x9251('0x11')](function(_0x3b62ac){_0x10d00e(_0x3b62ac);});};AGIVertices[_0x9251('0x12')]['awsLex']=function(_0x5cf1e3,_0x4ffd2b){scripts[_0x9251('0x88')](this[_0x9251('0xc')][_0x9251('0x32')],_0x5cf1e3[_0x9251('0x83')],_0x5cf1e3[_0x9251('0x89')],_0x5cf1e3['aws_lex_region'],_0x5cf1e3['text'],_0x5cf1e3[_0x9251('0x8a')])['then'](function(_0x1e547b){_0x4ffd2b(null,_0x1e547b);})['catch'](function(_0xa72ab9){_0x4ffd2b(_0xa72ab9);});};AGIVertices[_0x9251('0x12')]['googleASR']=function(_0x205d31,_0xdd785d,_0x5ed975){scripts[_0x9251('0x8b')](_0xdd785d,_0x205d31['key'],_0x205d31['google_asr_language']||_0x9251('0x5b'))[_0x9251('0xf')](function(_0x4ff54f){_0x5ed975(null,_0x4ff54f);})[_0x9251('0x11')](function(_0x2079a2){_0x5ed975(_0x2079a2);});};AGIVertices[_0x9251('0x12')][_0x9251('0x8c')]=function(_0x4e087f,_0x20a8bd,_0x553825){scripts['tildeASR'](_0x20a8bd,_0x4e087f[_0x9251('0x8d')],_0x4e087f[_0x9251('0x8e')],_0x4e087f['uri'])[_0x9251('0xf')](function(_0x3d364f){_0x553825(null,_0x3d364f);})[_0x9251('0x11')](function(_0x48544d){_0x553825(_0x48544d);});};AGIVertices[_0x9251('0x12')][_0x9251('0x8f')]=function(_0xa45441){var _0xcb61be=_[_0x9251('0x66')](verticesWithRetry,_0xa45441[_0x9251('0x34')])?_0xa45441:_['clone'](_0xa45441);for(var _0x2af032 in _0xcb61be){if(_0xcb61be[_0x9251('0x90')](_0x2af032)){if(_0xcb61be[_0x2af032]&&_[_0x9251('0x91')](_0xcb61be[_0x2af032])){if(_[_0x9251('0x66')](recursiveMapAttributes,_0x2af032)){_0xcb61be[_0x2af032]=this[_0x9251('0x92')](_0xcb61be[_0x2af032]);}else{_0xcb61be[_0x2af032]=this['replaceAllVariables'](_0xcb61be[_0x2af032]);}}}}return _0xcb61be;};AGIVertices[_0x9251('0x12')][_0x9251('0x93')]=function(_0x1657c){for(var _0x50aa8d in _0x1657c){if(_0x1657c[_0x9251('0x90')](_0x50aa8d)){if(_[_0x9251('0x94')](_0x1657c[_0x50aa8d])){this[_0x9251('0x93')](_0x1657c[_0x50aa8d]);}else if(_[_0x9251('0x95')](_0x1657c[_0x50aa8d])){for(var _0x4db582=0x0;_0x4db582<_0x1657c[_0x50aa8d]['length'];_0x4db582++){this[_0x9251('0x93')](_0x1657c[_0x50aa8d][_0x4db582]);}}else if(_[_0x9251('0x91')](_0x1657c[_0x50aa8d])){_0x1657c[_0x50aa8d]=this['replaceAllVariables'](_0x1657c[_0x50aa8d]);}}}};AGIVertices[_0x9251('0x12')][_0x9251('0x96')]=function(_0x6b3dd5,_0x330f48){for(var _0x4f90c3 in _0x6b3dd5){if(_0x6b3dd5[_0x9251('0x90')](_0x4f90c3)){if(_['isPlainObject'](_0x6b3dd5[_0x4f90c3])){if(!_[_0x9251('0x40')](_0x6b3dd5[_0x4f90c3])){this[_0x9251('0x96')](_0x6b3dd5[_0x4f90c3],util[_0x9251('0x25')]('%s.%s',_0x330f48,_0x4f90c3));}}else if(_['isArray'](_0x6b3dd5[_0x4f90c3])){for(var _0x5c7bb6=0x0;_0x5c7bb6<_0x6b3dd5[_0x4f90c3][_0x9251('0x97')];_0x5c7bb6++){this[_0x9251('0x96')](_0x6b3dd5[_0x4f90c3][_0x5c7bb6],util[_0x9251('0x25')](_0x9251('0x98'),_0x330f48,_0x4f90c3+'['+_0x5c7bb6+']'));}}else{if(!_['isNil'](_0x6b3dd5[_0x4f90c3])){this['channel']['setVariable'](util[_0x9251('0x25')](_0x9251('0x98'),_0x330f48,_0x4f90c3),_0x6b3dd5[_0x4f90c3]);}}}}};AGIVertices[_0x9251('0x12')]['replaceObjectAllVariables']=function(_0x4d463c){try{var _0x77b483=JSON[_0x9251('0x73')](_0x4d463c);this[_0x9251('0x93')](_0x77b483);return JSON[_0x9251('0x74')](_0x77b483);}catch(_0x4501fd){return this[_0x9251('0x99')](_0x4d463c);}};AGIVertices['prototype'][_0x9251('0x99')]=function(_0x4c73f1){var _0x333494=_0x4c73f1[_0x9251('0x9a')]('{');for(var _0xe668e1=0x1;_0xe668e1<_0x333494['length'];_0xe668e1+=0x1){var _0xe1d5bf=_0x333494[_0xe668e1][_0x9251('0x9a')]('}');if(_0xe1d5bf['length']>0x1){_0x4c73f1=_0x4c73f1['replaceAll']('{'+_0xe1d5bf[0x0]+'}',this[_0x9251('0xc')][_0x9251('0xd')](_0xe1d5bf[0x0])[_0x9251('0x9b')]||_0xe1d5bf[0x0]);}}if(_0x333494[_0x9251('0x97')]===0x1){return _0x4c73f1[_0x9251('0x9c')]();}return this['replaceAllVariables'](_0x4c73f1);};AGIVertices['prototype'][_0x9251('0x9d')]=function(_0x4f9100,_0x5c5cef){var _0x5c1378=this['channel'][_0x9251('0xd')](_0x4f9100);if(_0x5c1378[_0x9251('0x9e')]===-0x1){return _0x5c1378;}logger[_0x9251('0x2a')](util[_0x9251('0x25')]('The\x20\x22%s\x22\x20variable\x20value\x20is:\x20%s',_0x5c5cef,_0x5c1378['extra']));return this['channel'][_0x9251('0x9f')](_0x5c5cef,_0x5c1378[_0x9251('0x9b')]);};AGIVertices[_0x9251('0x12')][_0x9251('0x81')]=function(_0x193709){return _0x193709&&_0x193709!=='0'&&_0x193709!=='-1'&&_0x193709!=='';};AGIVertices[_0x9251('0x12')][_0x9251('0xa0')]=function(_0x13aefb){this[_0x9251('0x31')][_0x9251('0x71')](this,_0x13aefb,'-');_0x13aefb['retry']=_0x13aefb[_0x9251('0xa0')];return{'code':0xc8,'result':'-'};};AGIVertices[_0x9251('0x12')][_0x9251('0x8')]=function(_0x15e0b1){logger[_0x9251('0x2a')](util[_0x9251('0x25')](_0x9251('0xa1'),_0x15e0b1[_0x9251('0x33')]));return this[_0x9251('0xc')][_0x9251('0x8')]([_0x15e0b1['command'],_0x15e0b1[_0x9251('0xa2')]]);};AGIVertices[_0x9251('0x12')][_0x9251('0xa3')]=function(_0x4e9d05){logger[_0x9251('0x2a')](util[_0x9251('0x25')](_0x9251('0xa4'),_0x4e9d05[_0x9251('0x33')]));if(this['isConfigured'](_0x4e9d05[_0x9251('0x64')])){logger[_0x9251('0x2a')](util[_0x9251('0x25')](_0x9251('0xa5'),_0x4e9d05[_0x9251('0x64')]));var _0x425c14=this[_0x9251('0xc')][_0x9251('0xa6')](_0x4e9d05[_0x9251('0x64')]);if(_0x425c14['result']===-0x1){return _0x425c14;}}return this[_0x9251('0xc')][_0x9251('0xa3')]();};AGIVertices[_0x9251('0x12')]['callback']=function(_0x5c8d5f){logger[_0x9251('0x2a')](util[_0x9251('0x25')]('Enter\x20in\x20CALLBACK\x20(%s)\x20block',_0x5c8d5f[_0x9251('0x33')]));if(!this[_0x9251('0x81')](_0x5c8d5f[_0x9251('0x46')])){return this[_0x9251('0xc')][_0x9251('0x28')](_0x5c8d5f,_0x9251('0xa7'));}_0x5c8d5f[_0x9251('0x47')]=moment();if(this['isConfigured'](_0x5c8d5f['delay'])){_0x5c8d5f['scheduledAt']=moment()[_0x9251('0xa8')](_0x5c8d5f['delay'],'minutes');}if(!this['isConfigured'](_0x5c8d5f[_0x9251('0x49')])){_0x5c8d5f['callback_priority']=0x2;}this['createCmContact'][_0x9251('0x71')](this,_0x5c8d5f);return this['channel']['noop'](util[_0x9251('0x25')](_0x9251('0xa9'),_0x5c8d5f['phone'],_0x5c8d5f['list_id'],_0x5c8d5f[_0x9251('0x47')]));};AGIVertices[_0x9251('0x12')]['custom_app']=function(_0x209b79){logger[_0x9251('0x2a')](util[_0x9251('0x25')]('Enter\x20in\x20CUSTOM\x20APP\x20(%s)\x20block',_0x209b79[_0x9251('0x33')]));var _0x47c235=this[_0x9251('0xc')]['exec'](_0x209b79[_0x9251('0xaa')],_0x209b79[_0x9251('0x79')]);if(_0x47c235[_0x9251('0x9e')]===-0x1){return _0x47c235;}return this[_0x9251('0xc')][_0x9251('0xab')](util[_0x9251('0x25')]('Executed\x20command\x20%s\x20%s',_0x209b79['application'],_0x209b79['options']));};AGIVertices[_0x9251('0x12')][_0x9251('0xac')]=function(_0x5a2052){logger[_0x9251('0x2a')](util[_0x9251('0x25')](_0x9251('0xad'),_0x5a2052['label']));if(!this[_0x9251('0x81')](_0x5a2052['text'])){return this[_0x9251('0xc')]['noop']('no\x20text\x20configured');}var _0xf83339='\x22'+_0x5a2052[_0x9251('0x59')]+'\x22';if(this[_0x9251('0x81')](_0x5a2052[_0x9251('0x79')])){_0xf83339+=','+_0x5a2052[_0x9251('0x79')];}var _0x5ee8ff=this[_0x9251('0xc')][_0x9251('0x53')](_0x9251('0xae'),_0xf83339);if(_0x5ee8ff[_0x9251('0x9e')]===-0x1){return _0x5ee8ff;}return this[_0x9251('0xc')]['noop'](util['format'](_0x9251('0xaf'),_0xf83339));};AGIVertices[_0x9251('0x12')][_0x9251('0xb0')]=function(_0x1fe9c8){logger[_0x9251('0x2a')](util[_0x9251('0x25')](_0x9251('0xb1'),_0x1fe9c8[_0x9251('0x33')]));if(!this['isConfigured'](_0x1fe9c8[_0x9251('0x59')])){return this[_0x9251('0xc')][_0x9251('0xab')](_0x9251('0xb2'));}var _0x52abb1='\x22'+_0x1fe9c8['text']+'\x22';if(this[_0x9251('0x81')](_0x1fe9c8[_0x9251('0x79')])){_0x52abb1+=','+_0x1fe9c8['options'];}var _0x5af6a6=this[_0x9251('0xc')][_0x9251('0x53')]('MRCPSynth',_0x52abb1);if(_0x5af6a6[_0x9251('0x9e')]===-0x1){return _0x5af6a6;}return this[_0x9251('0xc')][_0x9251('0xab')](util['format'](_0x9251('0xaf'),_0x52abb1));};AGIVertices[_0x9251('0x12')]['lumenvoxasr']=function(_0xb02614){logger['info'](util[_0x9251('0x25')](_0x9251('0xb3'),_0xb02614[_0x9251('0x33')]));if(!this['isConfigured'](_0xb02614[_0x9251('0xb4')])){return this[_0x9251('0xc')]['noop'](_0x9251('0xb5'));}var _0x5368ce=_0xb02614[_0x9251('0xb4')];if(this[_0x9251('0x81')](_0xb02614[_0x9251('0x79')])){_0x5368ce+=','+_0xb02614[_0x9251('0x79')];}var _0x2c0ae8=this[_0x9251('0xc')][_0x9251('0x53')](_0x9251('0xb6'),_0x5368ce);if(_0x2c0ae8[_0x9251('0x9e')]===-0x1){return _0x2c0ae8;}var _0x184146=this[_0x9251('0x9d')](_0x9251('0xb7'),'LUMENVOX_ASR_CONFIDENCE');if(_0x184146[_0x9251('0x9e')]===-0x1){return _0x184146;}var _0x16057b=this[_0x9251('0x9d')](_0x9251('0xb8'),_0x9251('0xb9'));if(_0x16057b[_0x9251('0x9e')]===-0x1){return _0x16057b;}var _0x3a9292=this[_0x9251('0x9d')](_0x9251('0xba'),_0x9251('0xbb'));if(_0x3a9292[_0x9251('0x9e')]===-0x1){return _0x3a9292;}return this[_0x9251('0xc')][_0x9251('0xab')](util[_0x9251('0x25')](_0x9251('0xbc'),_0x5368ce));};AGIVertices[_0x9251('0x12')]['sestekasr']=function(_0x335a5e){logger[_0x9251('0x2a')](util[_0x9251('0x25')]('Enter\x20in\x20SESTEKASR\x20(%s)\x20block',_0x335a5e[_0x9251('0x33')]));if(!this[_0x9251('0x81')](_0x335a5e['grammar'])){return this[_0x9251('0xc')][_0x9251('0xab')](_0x9251('0xb5'));}var _0x562100=_0x335a5e[_0x9251('0xb4')];if(this['isConfigured'](_0x335a5e[_0x9251('0x79')])){_0x562100+=','+_0x335a5e['options'];}var _0x4a2de2=this[_0x9251('0xc')][_0x9251('0x53')](_0x9251('0xb6'),_0x562100);if(_0x4a2de2[_0x9251('0x9e')]===-0x1){return _0x4a2de2;}var _0x1c4b2a=this['getAndSetVariable']('RECOG_CONFIDENCE()',_0x9251('0xbd'));if(_0x1c4b2a['result']===-0x1){return _0x1c4b2a;}var _0x5a6e5e=this[_0x9251('0x9d')](_0x9251('0xb8'),_0x9251('0xbe'));if(_0x5a6e5e['result']===-0x1){return _0x5a6e5e;}var _0x249859=this[_0x9251('0x9d')]('RECOG_INSTANCE()',_0x9251('0xbf'));if(_0x249859[_0x9251('0x9e')]===-0x1){return _0x249859;}return this['channel']['noop'](util[_0x9251('0x25')](_0x9251('0xbc'),_0x562100));};AGIVertices[_0x9251('0x12')][_0x9251('0xc0')]=function(_0x27a646){logger[_0x9251('0x2a')](util['format']('Enter\x20in\x20DATABASE\x20(%s)\x20block',_0x27a646[_0x9251('0x33')]));if(!this[_0x9251('0x81')](_0x27a646[_0x9251('0xc1')])){return this[_0x9251('0xc')][_0x9251('0x28')](_0x27a646,_0x9251('0xc2'));}var _0x521936=this['getSquareOdbc'][_0x9251('0x71')](this,_0x27a646[_0x9251('0xc1')]);if(!_0x521936){return this['channel'][_0x9251('0x28')](_0x27a646,_0x9251('0xc3'));}if(!this['isConfigured'](_0x27a646['query'])){return this['channel'][_0x9251('0x28')](_0x27a646,'no\x20query\x20configured');}var _0x1d0957=_0x27a646['query'][_0x9251('0x55')](/(\r\n|\n|\r)/gm,'\x20');this[_0x9251('0xc')][_0x9251('0xab')](util[_0x9251('0x25')](_0x9251('0xc4'),_0x1d0957));var _0x329d09=this[_0x9251('0x26')]['sync'](this,_0x521936,_0x1d0957);this[_0x9251('0x31')][_0x9251('0x71')](this,_0x27a646,_0x1d0957);if(!this[_0x9251('0x81')](_0x27a646[_0x9251('0xc5')])){return this['channel'][_0x9251('0xab')](_0x9251('0xc6'));}var _0x45bf34=this[_0x9251('0xd')][_0x9251('0x71')](this,_0x27a646['variable_id']);if(!_0x45bf34){return this[_0x9251('0xc')][_0x9251('0x28')](_0x27a646,_0x9251('0xc7'));}var _0x612938=this;_0x329d09[_0x9251('0xc8')](function(_0x5d6ac9,_0x1878fb){Object[_0x9251('0xc9')](_0x5d6ac9)[_0x9251('0xc8')](function(_0x298a8b){_0x612938['channel']['setVariable'](util[_0x9251('0x25')](_0x9251('0xca'),_0x45bf34,_0x1878fb,_0x298a8b),_0x5d6ac9[_0x298a8b]);});});this['channel']['setVariable'](util[_0x9251('0x25')](_0x9251('0xcb'),_0x45bf34),_0x329d09[_0x9251('0x97')]);return this['channel'][_0x9251('0xab')](util['format'](_0x9251('0xcc'),_0x45bf34));};AGIVertices[_0x9251('0x12')]['dial']=function(_0x446091){logger['debug'](util[_0x9251('0x25')](_0x9251('0xcd'),_0x446091[_0x9251('0x33')]));if(!this[_0x9251('0x81')](_0x446091[_0x9251('0xce')])){return this['channel'][_0x9251('0x28')](_0x446091,'no\x20user\x20selected');}var _0x5b3c4a=this['getUser'][_0x9251('0x71')](this,_0x446091[_0x9251('0xce')]);if(!_0x5b3c4a){return this[_0x9251('0xc')][_0x9251('0x28')](_0x446091,_0x9251('0xcf'));}var _0x46e1d6=this[_0x9251('0xc')][_0x9251('0x53')](_0x9251('0xd0'),[util[_0x9251('0x25')](_0x9251('0xd1'),_0x5b3c4a),_0x446091[_0x9251('0x64')],_0x446091[_0x9251('0xd2')],_0x446091['url']]);if(_0x46e1d6[_0x9251('0x9e')]===-0x1){return _0x46e1d6;}return this['channel']['noop'](util[_0x9251('0x25')](_0x9251('0xd3'),_0x9251('0xd0')));};AGIVertices[_0x9251('0x12')][_0x9251('0xd4')]=function(_0x5d84ce){logger[_0x9251('0x2a')](util[_0x9251('0x25')](_0x9251('0xd5'),_0x5d84ce[_0x9251('0x33')]));if(!this[_0x9251('0x81')](_0x5d84ce[_0x9251('0x7c')])){return this['channel'][_0x9251('0xab')](_0x9251('0xd6'));}if(!this[_0x9251('0x81')](_0x5d84ce['text'])){return this[_0x9251('0xc')][_0x9251('0xab')](_0x9251('0xb2'));}this['channel'][_0x9251('0xd7')]=!![];this['createSquareDetailsReport'](_0x5d84ce);this[_0x9251('0x3e')](_0x5d84ce[_0x9251('0x59')],'in');this[_0x9251('0xc')]['noop'](util[_0x9251('0x25')](_0x9251('0xd8'),_0x5d84ce[_0x9251('0x59')]));var _0x28b88e=this['googleDialogflow']['sync'](this,_0x5d84ce);if(_0x28b88e){for(var _0x20a92b in _0x28b88e){if(_0x28b88e[_0x9251('0x90')](_0x20a92b)){this[_0x9251('0xc')][_0x9251('0x9f')](util[_0x9251('0x25')](_0x9251('0xd9'),_0x20a92b[_0x9251('0x69')]()),_0x28b88e[_0x20a92b]);}}this['createSquareMessage'](_0x28b88e[_0x9251('0xda')],_0x9251('0xdb'));return this['channel']['noop'](util['format']('Dialogflow\x20Result\x20%s',_0x28b88e[_0x9251('0xda')]));}return this[_0x9251('0xc')][_0x9251('0x28')](_0x5d84ce,_0x9251('0xdc'));};AGIVertices[_0x9251('0x12')][_0x9251('0xdd')]=function(_0x5c9c58){logger[_0x9251('0x2a')](util['format'](_0x9251('0xde'),_0x5c9c58[_0x9251('0x33')]));if(!this[_0x9251('0x81')](_0x5c9c58['ndauth_url'])){return this[_0x9251('0xc')]['noop'](_0x9251('0xdf'));}if(!this[_0x9251('0x81')](_0x5c9c58['username'])){return this['channel'][_0x9251('0xab')]('no\x20username\x20configured');}if(!this[_0x9251('0x81')](_0x5c9c58[_0x9251('0xe0')])){return this[_0x9251('0xc')][_0x9251('0xab')]('no\x20password\x20configured');}if(!this[_0x9251('0x81')](_0x5c9c58['ndassistant_url'])){return this[_0x9251('0xc')][_0x9251('0xab')](_0x9251('0xb2'));}this['channel'][_0x9251('0xd7')]=!![];this[_0x9251('0x31')](_0x5c9c58);this[_0x9251('0x3e')](_0x5c9c58[_0x9251('0x59')],'in');this['channel'][_0x9251('0xab')](util[_0x9251('0x25')]('Trying\x20SestekNDA:\x20%s',_0x5c9c58['text']));var _0x58cee9=this[_0x9251('0xe1')]['sync'](this,_0x5c9c58);if(_0x58cee9){for(var _0x3279f4 in _0x58cee9){if(_0x58cee9[_0x9251('0x90')](_0x3279f4)){this['channel'][_0x9251('0x9f')](util['format']('SESTEK_NDA_%s',_0x3279f4[_0x9251('0x69')]()),_0x58cee9[_0x3279f4]);}}this[_0x9251('0x3e')](_0x58cee9[_0x9251('0xda')],_0x9251('0xdb'));if(_0x58cee9[_0x9251('0xe2')]){this[_0x9251('0xc')][_0x9251('0xab')](util[_0x9251('0x25')](_0x9251('0xe3'),_0x58cee9[_0x9251('0xe2')]));var _0x18904f=this[_0x9251('0xc')][_0x9251('0xe4')](_0x58cee9[_0x9251('0xe2')]);try{fs[_0x9251('0xe5')](_0x58cee9[_0x9251('0xe2')]+_0x9251('0xe6'));}catch(_0x1d79e7){logger['error'](_0x1d79e7);}return _0x18904f;}else{return this[_0x9251('0xc')][_0x9251('0xab')](util[_0x9251('0x25')](_0x9251('0xe7'),_0x58cee9[_0x9251('0xda')]));}}return this[_0x9251('0xc')][_0x9251('0x28')](_0x5c9c58,_0x9251('0xe8'));};AGIVertices[_0x9251('0x12')][_0x9251('0xe9')]=function(_0x205276){logger[_0x9251('0x2a')](util['format']('Enter\x20in\x20END\x20(%s)\x20block',_0x205276[_0x9251('0x33')]));return this['channel']['noop']('end');};AGIVertices[_0x9251('0x12')][_0x9251('0xea')]=function(_0x33fa82){logger['info'](util[_0x9251('0x25')](_0x9251('0xeb'),_0x33fa82[_0x9251('0x33')]));var _0x34ab7a='';if(_0x33fa82[_0x9251('0xec')]){if(!this[_0x9251('0x81')](_0x33fa82['trunk_id'])){return this[_0x9251('0xc')][_0x9251('0x28')](_0x33fa82,'no\x20trunk\x20selected');}else{var _0x382d1e=parseInt(_0x33fa82[_0x9251('0xec')],0xa);if(isNaN(_0x382d1e)){_0x34ab7a=_0x33fa82[_0x9251('0xec')];}else{_0x34ab7a=this[_0x9251('0xed')][_0x9251('0x71')](this,_0x33fa82['trunk_id']);if(!_0x34ab7a){return this['channel'][_0x9251('0x28')](_0x33fa82,_0x9251('0xee'));}}}}else if(_0x33fa82[_0x9251('0xef')]){_0x34ab7a=_0x33fa82[_0x9251('0xef')];}else{return this[_0x9251('0xc')][_0x9251('0x28')](_0x33fa82,'no\x20trunk\x20selected');}var _0x3645f3=this['channel'][_0x9251('0x53')]('DIAL',[util['format'](_0x9251('0xf0'),_0x34ab7a,_0x33fa82['phone']),_0x33fa82[_0x9251('0x64')],_0x33fa82[_0x9251('0xd2')],_0x33fa82['url']]);if(_0x3645f3[_0x9251('0x9e')]===-0x1){return _0x3645f3;}return this['channel']['noop'](util[_0x9251('0x25')]('Executed\x20command\x20%s',_0x9251('0xd0')));};AGIVertices['prototype'][_0x9251('0xf1')]=function(_0x29c270){logger[_0x9251('0x2a')](util['format']('Enter\x20in\x20FINALLY\x20(%s)\x20block',_0x29c270['label']));return this[_0x9251('0xc')][_0x9251('0xab')](_0x9251('0xf1'));};AGIVertices[_0x9251('0x12')]['getdigits']=function(_0x19faa6){logger[_0x9251('0x2a')](util[_0x9251('0x25')](_0x9251('0xf2'),_0x19faa6['label']));if(_0x19faa6['retry']===0x0){return this[_0x9251('0xa0')](_0x19faa6);}_0x19faa6['retry']-=0x1;if(!this[_0x9251('0x81')](_0x19faa6['file_id'])){return this['channel'][_0x9251('0x28')](_0x19faa6,'no\x20file\x20audio\x20selected');}var _0x42ec7e=this[_0x9251('0xf3')][_0x9251('0x71')](this,_0x19faa6[_0x9251('0xf4')]);if(!_0x42ec7e){return this[_0x9251('0xc')]['error'](_0x19faa6,_0x9251('0xf5'));}if(!this[_0x9251('0x81')](_0x19faa6[_0x9251('0xc5')])){return this[_0x9251('0xc')]['error'](_0x9251('0xc6'));}var _0x359d0e=this['channel'][_0x9251('0xf6')](_0x42ec7e,_0x19faa6[_0x9251('0xf7')],_0x19faa6['maxdigit']);var _0x607120=_0x359d0e[_0x9251('0x9e')]?_0x359d0e[_0x9251('0x9e')][_0x9251('0x9c')]():'';logger[_0x9251('0x2a')](_0x9251('0xf8'),JSON[_0x9251('0x74')](_0x359d0e));if(_0x359d0e[_0x9251('0x9e')]===-0x1){this[_0x9251('0x31')][_0x9251('0x71')](this,_0x19faa6,_0x607120);return _0x359d0e;}else if(_0x359d0e[_0x9251('0x9b')]===_0x9251('0x64')){_0x359d0e[_0x9251('0x9e')]=_0x607120['length']>=parseInt(_0x19faa6[_0x9251('0xf9')])?'x':'i';}else{_0x359d0e[_0x9251('0x9e')]=_0x607120[_0x9251('0x97')]>=parseInt(_0x19faa6[_0x9251('0xf9')])&&_0x607120[_0x9251('0x97')]<=parseInt(_0x19faa6[_0x9251('0xfa')])?'x':'i';}var _0x1be9f6=this[_0x9251('0xd')][_0x9251('0x71')](this,_0x19faa6[_0x9251('0xc5')]);if(!_0x1be9f6){return this[_0x9251('0xc')][_0x9251('0x28')](_0x19faa6,'no\x20variable\x20found');}this[_0x9251('0xc')][_0x9251('0x9f')](_0x1be9f6,_0x607120);if(this['isConfigured'](_0x19faa6['hiddendigitsnum'])){var _0x2743d2=parseInt(_0x19faa6['hiddendigitsnum'],0xa);var _0x24d705=rs[_0x9251('0xfb')]({'charset':'*','length':_0x2743d2});var _0x2e0891=_0x607120[_0x9251('0x97')];if(_0x2e0891>0x0){if(_0x2e0891>_0x2743d2){this[_0x9251('0x31')]['sync'](this,_0x19faa6,_0x19faa6[_0x9251('0xfc')]==='first'?_0x24d705+_0x607120[_0x9251('0xfd')](_0x2743d2):_0x607120[_0x9251('0xfd')](0x0,_0x2e0891-_0x2743d2)+_0x24d705);}else{this['createSquareDetailsReport']['sync'](this,_0x19faa6,rs[_0x9251('0xfb')]({'charset':'*','length':_0x2e0891}));}}else{this[_0x9251('0x31')][_0x9251('0x71')](this,_0x19faa6,'');}}else{this[_0x9251('0x31')][_0x9251('0x71')](this,_0x19faa6,_0x607120);}return _0x359d0e;};AGIVertices[_0x9251('0x12')][_0x9251('0xb')]=function(_0x9d65fa){logger[_0x9251('0x2a')](util[_0x9251('0x25')](_0x9251('0xfe'),_0x9d65fa[_0x9251('0x33')]));return this[_0x9251('0xa')](_0x9d65fa);};AGIVertices[_0x9251('0x12')][_0x9251('0xff')]=function(_0x16eddd){logger[_0x9251('0x2a')](util['format']('Enter\x20in\x20GOAL\x20(%s)\x20block',_0x16eddd[_0x9251('0x33')]));this[_0x9251('0x31')][_0x9251('0x71')](this,_0x16eddd,_0x16eddd[_0x9251('0x100')]);return this[_0x9251('0xc')][_0x9251('0xab')](util[_0x9251('0x25')]('GOAL\x20%s',_0x16eddd[_0x9251('0x100')]));};AGIVertices[_0x9251('0x12')][_0x9251('0x101')]=function(_0x3e0979){logger['info'](util[_0x9251('0x25')](_0x9251('0x102'),_0x3e0979['label']));if(!this['isConfigured'](_0x3e0979[_0x9251('0x83')])||!this[_0x9251('0x81')](_0x3e0979[_0x9251('0x89')])){return this[_0x9251('0xc')][_0x9251('0xab')](_0x9251('0x103'));}if(!this['isConfigured'](_0x3e0979[_0x9251('0x59')])){return this[_0x9251('0xc')][_0x9251('0xab')](_0x9251('0xb2'));}this[_0x9251('0xc')]['noop'](util[_0x9251('0x25')]('Trying\x20aws\x20Polly\x20%s',_0x3e0979[_0x9251('0x59')]));var _0x3129c6=this[_0x9251('0x104')][_0x9251('0x71')](this,_0x3e0979);if(_0x3129c6){this[_0x9251('0xc')]['noop'](util[_0x9251('0x25')](_0x9251('0x105'),_0x3129c6));var _0x55e535=this[_0x9251('0xc')][_0x9251('0xe4')](_0x3129c6);try{fs[_0x9251('0xe5')](_0x3129c6+'.wav');}catch(_0x292ce5){logger['error'](_0x292ce5);}return _0x55e535;}return this['channel'][_0x9251('0x28')](_0x3e0979,'aws\x20Polly\x20is\x20unreachable');};AGIVertices[_0x9251('0x12')]['awslex']=function(_0x5d25e2){logger[_0x9251('0x2a')](util[_0x9251('0x25')](_0x9251('0x106'),_0x5d25e2[_0x9251('0x33')]));if(!this[_0x9251('0x81')](_0x5d25e2[_0x9251('0x83')])||!this[_0x9251('0x81')](_0x5d25e2[_0x9251('0x89')])){return this[_0x9251('0xc')][_0x9251('0xab')]('no\x20valid\x20credentials\x20configured');}if(!this[_0x9251('0x81')](_0x5d25e2[_0x9251('0x8a')])){return this[_0x9251('0xc')][_0x9251('0xab')]('no\x20bot\x20name\x20configured');}if(!this[_0x9251('0x81')](_0x5d25e2['text'])){return this[_0x9251('0xc')][_0x9251('0xab')](_0x9251('0xb2'));}this[_0x9251('0xc')][_0x9251('0xd7')]=!![];this['createSquareDetailsReport'](_0x5d25e2);this[_0x9251('0x3e')](_0x5d25e2['text'],'in');this[_0x9251('0xc')][_0x9251('0xab')](util[_0x9251('0x25')](_0x9251('0x107'),_0x5d25e2[_0x9251('0x59')]));var _0x211138=this['awsLex'][_0x9251('0x71')](this,_0x5d25e2);if(_0x211138){for(var _0x4d644d in _0x211138){if(_0x211138[_0x9251('0x90')](_0x4d644d)&&_[_0x9251('0x91')](_0x211138[_0x4d644d])){this[_0x9251('0xc')][_0x9251('0x9f')](util[_0x9251('0x25')]('AWS_LEX_%s',_0x4d644d[_0x9251('0x69')]()),_0x211138[_0x4d644d]);}}if(_[_0x9251('0x41')](_0x211138[_0x9251('0x77')])){return this[_0x9251('0xc')][_0x9251('0xab')](_0x9251('0x108'));}else{this[_0x9251('0x3e')](_0x211138[_0x9251('0x77')],'out');return this[_0x9251('0xc')][_0x9251('0xab')](util['format'](_0x9251('0x109'),_0x211138[_0x9251('0x77')]));}}return this['channel'][_0x9251('0x28')](_0x5d25e2,_0x9251('0x10a'));};AGIVertices['prototype']['googleasr']=function(_0x18cc95){logger['info'](util['format']('Enter\x20in\x20GOOGLEASR\x20(%s)\x20block\x20%s',_0x18cc95[_0x9251('0x33')],_0x18cc95[_0x9251('0x64')]));if(!this[_0x9251('0x81')](_0x18cc95['key'])){return this['channel'][_0x9251('0xab')]('no\x20key\x20configured');}var _0x5950e4='wav';var _0x3f0c62=util[_0x9251('0x25')]('%s/recordings/%s',FILES_PATH,rs['generate'](0x4));var _0x43bd45=util[_0x9251('0x25')](_0x9251('0x98'),_0x3f0c62,_0x5950e4);var _0x2b7cf3=!![];if(_0x18cc95[_0x9251('0x10b')]===_0x9251('0x10c')){_0x2b7cf3=![];}var _0x121aca=this['channel'][_0x9251('0x10d')](_0x3f0c62,_0x5950e4,_0x18cc95[_0x9251('0x10e')],_0x18cc95[_0x9251('0x64')],undefined,_0x2b7cf3);if(_0x121aca[_0x9251('0x9e')]!==-0x1){this[_0x9251('0xc')][_0x9251('0xab')](util['format']('google\x20%s\x20file\x20created',_0x43bd45));var _0x232e33=this[_0x9251('0x8b')][_0x9251('0x71')](this,_0x18cc95,_0x43bd45);if(_0x232e33){for(var _0x5e5e08 in _0x232e33){if(_0x232e33['hasOwnProperty'](_0x5e5e08)){this[_0x9251('0xc')][_0x9251('0x9f')](util[_0x9251('0x25')]('GOOGLE_ASR_%s',_0x5e5e08[_0x9251('0x69')]()),_0x232e33[_0x5e5e08]);}}return this['channel']['noop'](util[_0x9251('0x25')](_0x9251('0x10f'),JSON['stringify'](_0x232e33)));}}return _0x121aca;};AGIVertices['prototype'][_0x9251('0x110')]=function(_0x7d2e02){logger[_0x9251('0x2a')](util['format'](_0x9251('0x111'),_0x7d2e02[_0x9251('0x33')]));if(!this['isConfigured'](_0x7d2e02['appid'])){return this[_0x9251('0xc')]['noop'](_0x9251('0x112'));}if(!this[_0x9251('0x81')](_0x7d2e02[_0x9251('0x8e')])){return this['channel'][_0x9251('0xab')](_0x9251('0x113'));}var _0x2ba5a4='wav';var _0x5b4b67=util[_0x9251('0x25')](_0x9251('0x114'),FILES_PATH,rs[_0x9251('0xfb')](0x4));var _0x461187=util[_0x9251('0x25')](_0x9251('0x98'),_0x5b4b67,_0x2ba5a4);var _0x8bb25d=!![];if(_0x7d2e02['beep']===_0x9251('0x10c')){_0x8bb25d=![];}var _0x2538ad=this[_0x9251('0xc')]['recordFile'](_0x5b4b67,_0x2ba5a4,_0x7d2e02[_0x9251('0x10e')],_0x7d2e02['timeout'],undefined,_0x8bb25d);if(_0x2538ad[_0x9251('0x9e')]!==-0x1){this[_0x9251('0xc')]['noop'](util[_0x9251('0x25')](_0x9251('0x115'),_0x461187));var _0x36f4b5=this['tildeASR'][_0x9251('0x71')](this,_0x7d2e02,_0x461187);if(_0x36f4b5){for(var _0x41b9f9 in _0x36f4b5){if(_0x36f4b5[_0x9251('0x90')](_0x41b9f9)){this[_0x9251('0xc')]['setVariable'](util[_0x9251('0x25')](_0x9251('0x116'),_0x41b9f9[_0x9251('0x69')]()),_0x36f4b5[_0x41b9f9]);}}return this['channel'][_0x9251('0xab')](util[_0x9251('0x25')](_0x9251('0x117'),JSON['stringify'](_0x36f4b5)));}}return _0x2538ad;};AGIVertices[_0x9251('0x12')]['gotoc']=function(_0xa4e1a0){logger[_0x9251('0x2a')](util[_0x9251('0x25')](_0x9251('0x118'),_0xa4e1a0['label']));return this['channel'][_0x9251('0x119')](_0xa4e1a0[_0x9251('0x11a')],_0xa4e1a0[_0x9251('0x39')],_0xa4e1a0['priority']);};AGIVertices[_0x9251('0x12')]['gotoif']=function(_0x30be00){logger['info'](util[_0x9251('0x25')](_0x9251('0x11b'),_0x30be00[_0x9251('0x33')]));if(!this[_0x9251('0x81')](_0x30be00[_0x9251('0x11c')])){return this[_0x9251('0xc')][_0x9251('0x28')](_0x30be00,'no\x20condition\x20configured');}try{var _0x207449=eval(_0x30be00['condition'])?'true':_0x9251('0x11d');this[_0x9251('0xc')][_0x9251('0xab')](util['format'](_0x9251('0x11e'),_0x30be00[_0x9251('0x11c')],_0x207449));return{'code':0xc8,'result':_0x207449};}catch(_0x4c4d11){return{'code':0xc8,'result':_0x9251('0x11d')};}};AGIVertices[_0x9251('0x12')][_0x9251('0x11f')]=function(_0x543a47){logger['info'](util[_0x9251('0x25')]('Enter\x20in\x20GOTOIFTIME\x20(%s)\x20block',_0x543a47[_0x9251('0x33')]));if(!this[_0x9251('0x81')](_0x543a47[_0x9251('0x120')])){return this[_0x9251('0xc')][_0x9251('0x28')](_0x543a47,_0x9251('0x121'));}var _0x51193c=this[_0x9251('0x20')]['sync'](this,_0x543a47[_0x9251('0x120')]);if(!_0x51193c){return this['channel'][_0x9251('0x28')](_0x543a47,_0x9251('0x122'));}for(var _0x56dbc4=0x0;_0x56dbc4<_0x51193c[_0x9251('0x97')];_0x56dbc4+=0x1){var _0x4c0f3e=this[_0x9251('0xc')]['getVariable'](util[_0x9251('0x25')](_0x9251('0x123'),_0x51193c[_0x56dbc4]));if(_0x4c0f3e['result']===-0x1){return _0x4c0f3e;}logger[_0x9251('0x2a')](util[_0x9251('0x25')](_0x9251('0x124'),_0x51193c[_0x56dbc4],_0x4c0f3e[_0x9251('0x9b')]));if(_0x4c0f3e[_0x9251('0x9b')]===_0x9251('0x125')){logger[_0x9251('0x2a')](util[_0x9251('0x25')](_0x9251('0x124'),_0x51193c[_0x56dbc4],_0x9251('0x125')));this[_0x9251('0xc')][_0x9251('0xab')](util[_0x9251('0x25')](_0x9251('0x124'),_0x51193c[_0x56dbc4],_0x9251('0x125')));return{'code':0xc8,'result':_0x9251('0x125')};}else{logger[_0x9251('0x2a')](util[_0x9251('0x25')](_0x9251('0x124'),_0x51193c[_0x56dbc4],_0x9251('0x11d')));this[_0x9251('0xc')][_0x9251('0xab')](util['format']('IFTIME\x20%s\x20%s',_0x51193c[_0x56dbc4],_0x9251('0x11d')));}}return{'code':0xc8,'result':'false'};};AGIVertices[_0x9251('0x12')][_0x9251('0x126')]=function(_0x42f57a){logger['info'](util[_0x9251('0x25')]('Enter\x20in\x20HANGUP\x20(%s)\x20block',_0x42f57a[_0x9251('0x33')]));return this[_0x9251('0xc')]['hangup']();};AGIVertices[_0x9251('0x12')][_0x9251('0x127')]=function(_0x8814f){logger[_0x9251('0x2a')](util[_0x9251('0x25')](_0x9251('0x128'),_0x8814f[_0x9251('0x33')]));if(!this[_0x9251('0x81')](_0x8814f['key'])){return this['channel'][_0x9251('0xab')]('no\x20key\x20configured');}var _0x1b6745=_0x9251('0x129');var _0x10a067=util['format'](_0x9251('0x114'),FILES_PATH,rs['generate'](0x4));var _0x331828=util['format']('%s.%s',_0x10a067,_0x1b6745);var _0x2d977a=!![];if(_0x8814f[_0x9251('0x10b')]==='NOBEEP'){_0x2d977a=![];}var _0x32fb8a=this[_0x9251('0xc')][_0x9251('0x10d')](_0x10a067,_0x1b6745,_0x8814f[_0x9251('0x10e')],_0x8814f['timeout'],undefined,_0x2d977a);if(_0x32fb8a[_0x9251('0x9e')]!==-0x1){this[_0x9251('0xc')]['noop'](util[_0x9251('0x25')](_0x9251('0x12a'),_0x331828));var _0x107dac=this[_0x9251('0x7f')][_0x9251('0x71')](this,_0x8814f,_0x331828);if(_0x107dac){for(var _0x2a4deb in _0x107dac){if(_0x107dac[_0x9251('0x90')](_0x2a4deb)){this['channel'][_0x9251('0x9f')](util['format'](_0x9251('0x12b'),_0x2a4deb[_0x9251('0x69')]()),_0x107dac[_0x2a4deb]);}}return this[_0x9251('0xc')][_0x9251('0xab')](util['format'](_0x9251('0x12c'),JSON['stringify'](_0x107dac)));}}return _0x32fb8a;};AGIVertices[_0x9251('0x12')]['ispeechtts']=function(_0x5e23c9){logger[_0x9251('0x2a')](util[_0x9251('0x25')](_0x9251('0x12d'),_0x5e23c9[_0x9251('0x33')]));if(!this[_0x9251('0x81')](_0x5e23c9['key'])){return this[_0x9251('0xc')]['noop'](_0x9251('0xd6'));}if(!this[_0x9251('0x81')](_0x5e23c9[_0x9251('0x59')])){return this[_0x9251('0xc')][_0x9251('0xab')]('no\x20text\x20configured');}this['channel']['noop'](util[_0x9251('0x25')](_0x9251('0x12e'),_0x5e23c9[_0x9251('0x59')]));var _0x573c9e=this['ispeechTTS']['sync'](this,_0x5e23c9);if(_0x573c9e){this[_0x9251('0xc')][_0x9251('0xab')](util[_0x9251('0x25')](_0x9251('0x12a'),_0x573c9e));var _0x8a878b=this[_0x9251('0xc')][_0x9251('0xe4')](_0x573c9e,_0x5e23c9[_0x9251('0x10e')]);try{fs[_0x9251('0xe5')](_0x573c9e+'.wav');}catch(_0x5f13e1){logger[_0x9251('0x28')](_0x5f13e1);}return _0x8a878b;}return this[_0x9251('0xc')]['error'](_0x5e23c9,'ispeech\x20TTS\x20is\x20unreachable');};AGIVertices['prototype'][_0x9251('0x12f')]=function(_0x5cf5e4){logger[_0x9251('0x2a')](util[_0x9251('0x25')](_0x9251('0x130'),_0x5cf5e4[_0x9251('0x33')]));if(!this[_0x9251('0x81')](_0x5cf5e4[_0x9251('0x131')])){return this['channel']['error'](_0x5cf5e4,_0x9251('0x132'));}logger[_0x9251('0x2a')](util[_0x9251('0x25')](_0x9251('0x133'),this[_0x9251('0xc')][_0x9251('0x36')],_0x5cf5e4[_0x9251('0x131')]));var _0x1e802e=this[_0x9251('0x51')][_0x9251('0x71')](this,_0x5cf5e4[_0x9251('0x131')]);if(_0x1e802e){logger[_0x9251('0x2a')](util[_0x9251('0x25')](_0x9251('0x134'),this[_0x9251('0xc')][_0x9251('0x36')],_0x5cf5e4[_0x9251('0x131')]));this[_0x9251('0xc')]['noop'](util[_0x9251('0x25')](_0x9251('0x134'),this[_0x9251('0xc')][_0x9251('0x36')],_0x5cf5e4[_0x9251('0x131')]));return{'code':0xc8,'result':_0x9251('0x135')};}else{logger[_0x9251('0x2a')](util[_0x9251('0x25')](_0x9251('0x136'),this[_0x9251('0xc')][_0x9251('0x36')],_0x5cf5e4['findBy']));this['channel'][_0x9251('0xab')](util[_0x9251('0x25')](_0x9251('0x136'),this[_0x9251('0xc')][_0x9251('0x36')],_0x5cf5e4[_0x9251('0x131')]));return{'code':0xc8,'result':_0x9251('0x137')};}};AGIVertices[_0x9251('0x12')][_0x9251('0x138')]=function(_0x41fcf1){logger['info'](util['format'](_0x9251('0x139'),_0x41fcf1['label']));if(!this['isConfigured'](_0x41fcf1['findBy'])){return this[_0x9251('0xc')][_0x9251('0x28')](_0x41fcf1,_0x9251('0x132'));}logger[_0x9251('0x2a')](util[_0x9251('0x25')](_0x9251('0x133'),this[_0x9251('0xc')]['callerid'],_0x41fcf1['findBy']));var _0x112db6=this[_0x9251('0x4e')][_0x9251('0x71')](this,_0x41fcf1[_0x9251('0x131')]);if(_0x112db6){logger[_0x9251('0x2a')](util[_0x9251('0x25')](_0x9251('0x134'),this[_0x9251('0xc')]['callerid'],_0x41fcf1[_0x9251('0x131')]));this[_0x9251('0xc')][_0x9251('0xab')](util[_0x9251('0x25')](_0x9251('0x134'),this['channel'][_0x9251('0x36')],_0x41fcf1[_0x9251('0x131')]));return{'code':0xc8,'result':'success'};}else{logger['info'](util[_0x9251('0x25')](_0x9251('0x136'),this[_0x9251('0xc')][_0x9251('0x36')],_0x41fcf1[_0x9251('0x131')]));this[_0x9251('0xc')][_0x9251('0xab')](util['format'](_0x9251('0x136'),this[_0x9251('0xc')][_0x9251('0x36')],_0x41fcf1[_0x9251('0x131')]));return{'code':0xc8,'result':_0x9251('0x137')};}};AGIVertices[_0x9251('0x12')]['math']=function(_0x2f98d8){logger['info'](util[_0x9251('0x25')](_0x9251('0x13a'),_0x2f98d8[_0x9251('0x33')]));if(!this[_0x9251('0x81')](_0x2f98d8['operation'])){return this['channel']['error'](_0x2f98d8,'no\x20operation\x20configured');}this[_0x9251('0xc')]['noop'](util['format'](_0x9251('0x13b'),_0x2f98d8['operation']));var _0x126b9c=eval(_0x2f98d8[_0x9251('0x13c')]);if(!this[_0x9251('0x81')](_0x2f98d8[_0x9251('0xc5')])){return this['channel']['noop']('no\x20variable\x20selected\x20for\x20the\x20result');}var _0x2e2ccc=this[_0x9251('0xd')][_0x9251('0x71')](this,_0x2f98d8[_0x9251('0xc5')]);if(!_0x2e2ccc){return this[_0x9251('0xc')][_0x9251('0x28')](_0x2f98d8,_0x9251('0xc7'));}if(_[_0x9251('0x95')](_0x126b9c)){var _0x55e71d=this;_0x126b9c[_0x9251('0xc8')](function(_0x29903b,_0x439c58){_0x55e71d['channel']['setVariable'](util['format'](_0x9251('0x13d'),_0x2e2ccc,_0x439c58),_0x29903b);});return this[_0x9251('0xc')][_0x9251('0xab')](util[_0x9251('0x25')](_0x9251('0x13e'),_0x2e2ccc));}else{return this[_0x9251('0xc')]['setVariable'](_0x2e2ccc,_0x126b9c);}};AGIVertices[_0x9251('0x12')][_0x9251('0x9')]=function(_0x334c73){logger['info'](util['format']('Enter\x20in\x20MENU\x20(%s)\x20block',_0x334c73[_0x9251('0x33')]));if(_0x334c73[_0x9251('0x13f')]===0x0){return this['maxRetry'](_0x334c73);}_0x334c73[_0x9251('0x13f')]-=0x1;if(!this[_0x9251('0x81')](_0x334c73[_0x9251('0xf4')])){return this[_0x9251('0xc')]['error'](_0x334c73,'no\x20file\x20audio\x20selected');}var _0xd1428b=this[_0x9251('0xf3')][_0x9251('0x71')](this,_0x334c73[_0x9251('0xf4')]);if(!_0xd1428b){return this['channel'][_0x9251('0x28')](_0x334c73,_0x9251('0xf5'));}var _0x1e5258=this[_0x9251('0xc')][_0x9251('0xf6')](_0xd1428b,_0x334c73[_0x9251('0xf7')],_0x334c73[_0x9251('0x140')]);var _0x511f8d=_0x1e5258[_0x9251('0x9e')];if(_0x1e5258['result']===-0x1){this[_0x9251('0x31')]['sync'](this,_0x334c73,'-1');return _0x1e5258;}else if(_0x1e5258[_0x9251('0x9b')]==='timeout'){_0x1e5258[_0x9251('0x9e')]=_0x1e5258[_0x9251('0x9e')][_0x9251('0x97')]>0x0?_0x1e5258[_0x9251('0x9e')]:'t';}else if(_[_0x9251('0x40')](_0x1e5258[_0x9251('0x9e')])){_0x1e5258[_0x9251('0x9e')]='#';_0x511f8d='#';}if(!this[_0x9251('0x81')](_0x334c73[_0x9251('0xc5')])){this[_0x9251('0xc')][_0x9251('0xab')](_0x9251('0xc6'));}else{var _0x269d9a=this['getVariable']['sync'](this,_0x334c73[_0x9251('0xc5')]);if(!_0x269d9a){return this[_0x9251('0xc')][_0x9251('0x28')](_0x334c73,'no\x20variable\x20found');}this['channel'][_0x9251('0x9f')](_0x269d9a,_0x511f8d);}this['createSquareDetailsReport'][_0x9251('0x71')](this,_0x334c73,_0x511f8d);return _0x1e5258;};AGIVertices[_0x9251('0x12')]['noop']=function(_0x16fc1d){logger['info'](util[_0x9251('0x25')](_0x9251('0x141'),_0x16fc1d[_0x9251('0x33')]));return this[_0x9251('0xc')][_0x9251('0xab')](_0x16fc1d[_0x9251('0x142')]||_0x16fc1d['label']);};AGIVertices[_0x9251('0x12')][_0x9251('0x143')]=function(_0x4875ca){logger[_0x9251('0x2a')](util['format'](_0x9251('0x144'),_0x4875ca[_0x9251('0x33')]));if(!this[_0x9251('0x81')](_0x4875ca['findBy'])){return this[_0x9251('0xc')][_0x9251('0x28')](_0x4875ca,_0x9251('0x132'));}logger[_0x9251('0x2a')](util[_0x9251('0x25')]('FIND\x20AGENT\x20%s\x20BY\x20%s',this['channel'][_0x9251('0x36')],_0x4875ca['findBy']));var _0x4027a6=this[_0x9251('0x4a')]['sync'](this,_0x4875ca[_0x9251('0x145')]);var _0x11ad09=this[_0x9251('0x4b')]['sync'](this,_0x4875ca[_0x9251('0x131')],_0x4027a6);if(_0x11ad09){logger['info'](util['format'](_0x9251('0x134'),this[_0x9251('0xc')][_0x9251('0x36')],_0x4875ca['findBy']));this[_0x9251('0xc')][_0x9251('0xab')](util[_0x9251('0x25')]('AGENT\x20%s\x20FOUND\x20BY',this[_0x9251('0xc')][_0x9251('0x36')],_0x4875ca[_0x9251('0x131')]));return{'code':0xc8,'result':_0x9251('0x135')};}else{logger[_0x9251('0x2a')](util[_0x9251('0x25')](_0x9251('0x136'),this['channel']['callerid'],_0x4875ca[_0x9251('0x131')]));this[_0x9251('0xc')][_0x9251('0xab')](util[_0x9251('0x25')](_0x9251('0x134'),this[_0x9251('0xc')][_0x9251('0x36')],_0x4875ca[_0x9251('0x131')]));return{'code':0xc8,'result':_0x9251('0x137')};}};AGIVertices['prototype'][_0x9251('0x146')]=function(_0x49015b){logger['info'](util[_0x9251('0x25')](_0x9251('0x147'),_0x49015b[_0x9251('0x33')]));if(!this['isConfigured'](_0x49015b[_0x9251('0xf4')])){return this[_0x9251('0xc')][_0x9251('0x28')](_0x49015b,_0x9251('0x148'));}var _0x94d90c=this[_0x9251('0xf3')][_0x9251('0x71')](this,_0x49015b[_0x9251('0xf4')]);if(!_0x94d90c){return this[_0x9251('0xc')][_0x9251('0x28')](_0x49015b,'no\x20file\x20audio\x20found');}var _0x34a6a7=this[_0x9251('0xc')][_0x9251('0x53')]('PLAYBACK',[_0x94d90c,_0x49015b[_0x9251('0xd2')]]);if(_0x34a6a7[_0x9251('0x9e')]===-0x1){return _0x34a6a7;}return this['channel'][_0x9251('0xab')](util['format'](_0x9251('0x149'),'PLAYBACK',_0x94d90c));};AGIVertices['prototype'][_0x9251('0x14a')]=function(_0xbf50d7){logger[_0x9251('0x2a')](util['format'](_0x9251('0x14b'),_0xbf50d7[_0x9251('0x33')]));if(!this['isConfigured'](_0xbf50d7[_0x9251('0x14c')])){return this[_0x9251('0xc')][_0x9251('0x28')](_0xbf50d7,'no\x20queue\x20selected');}var _0x229cb8='';var _0x45674f=parseInt(_0xbf50d7[_0x9251('0x14c')],0xa);if(isNaN(_0x45674f)){_0x229cb8=_0xbf50d7[_0x9251('0x14c')];}else{_0x229cb8=this['getVoiceQueue'][_0x9251('0x71')](this,_0xbf50d7['queue_id']);if(!_0x229cb8){return this[_0x9251('0xc')][_0x9251('0x28')](_0xbf50d7,_0x9251('0x14d'));}}var _0x196e7c='';if(this['isConfigured'](_0xbf50d7[_0x9251('0xf4')])){var _0xfdd847=this[_0x9251('0xf3')][_0x9251('0x71')](this,_0xbf50d7[_0x9251('0xf4')]);if(_0xfdd847){_0x196e7c=_0xfdd847;}}this['createSquareDetailsReport'][_0x9251('0x71')](this,_0xbf50d7,_0x229cb8);if(_0xbf50d7[_0x9251('0xd2')][_0x9251('0x14e')]('x')<0x0){_0xbf50d7[_0x9251('0xd2')]+='x';}if(_0xbf50d7[_0x9251('0xd2')][_0x9251('0x14e')]('X')<0x0){_0xbf50d7[_0x9251('0xd2')]+='X';}this['channel'][_0x9251('0x9f')](_0x9251('0x14f'),_0x229cb8?_0x229cb8[_0x9251('0x150')]():'');var _0x55f8ba=this[_0x9251('0xc')][_0x9251('0x53')](_0x9251('0x151'),[_0x229cb8,_0xbf50d7[_0x9251('0xd2')],_0xbf50d7[_0x9251('0x62')],_0x196e7c,_0xbf50d7[_0x9251('0x64')],_0xbf50d7['agi'],_0xbf50d7['macro'],_0xbf50d7[_0x9251('0x152')],'',_0xbf50d7['position']]);if(_0x55f8ba[_0x9251('0x9e')]===-0x1){return _0x55f8ba;}return this[_0x9251('0xc')][_0x9251('0xab')](util['format'](_0x9251('0x149'),_0x9251('0x151'),_0x229cb8));};AGIVertices['prototype'][_0x9251('0x153')]=function(_0x55573d){logger['info'](util[_0x9251('0x25')](_0x9251('0x154'),_0x55573d[_0x9251('0x33')]));var _0xe3c8dc=_0x55573d[_0x9251('0x155')]||'wav';var _0x54687c=util[_0x9251('0x25')](_0x9251('0x156'),this['channel'][_0x9251('0x32')],rs[_0x9251('0xfb')](0x5));var _0x532046=util[_0x9251('0x25')](_0x9251('0x157'),FILES_PATH,_0x54687c,_0xe3c8dc);var _0x1fd232=util[_0x9251('0x25')](_0x9251('0x114'),FILES_PATH,_0x54687c);this['createSquareRecording'][_0x9251('0x71')](this,_0x55573d,_0x54687c,_0x532046);this['channel'][_0x9251('0x9f')](_0x9251('0x158'),_0x54687c);logger[_0x9251('0x2a')](_0x9251('0x159'),_0x1fd232,_0xe3c8dc,_0x55573d[_0x9251('0x15a')],_0x55573d[_0x9251('0x64')]);return this[_0x9251('0xc')]['recordFile'](_0x1fd232,_0xe3c8dc,_0x55573d[_0x9251('0x15a')],_0x55573d[_0x9251('0x64')],undefined,!![]);};AGIVertices[_0x9251('0x12')][_0x9251('0x15b')]=function(_0x5d40d3){logger[_0x9251('0x2a')](util[_0x9251('0x25')](_0x9251('0x15c'),_0x5d40d3[_0x9251('0x33')]));if(!this[_0x9251('0x81')](_0x5d40d3[_0x9251('0x62')])){return this['channel']['noop'](_0x9251('0x15d'));}var _0x5795ab=this[_0x9251('0x61')]['sync'](this,_0x5d40d3);logger[_0x9251('0x2a')](util[_0x9251('0x25')]('Response:',util['inspect'](_0x5795ab,{'showHidden':![],'depth':null})));if(!this[_0x9251('0x81')](_0x5d40d3[_0x9251('0xc5')])){return this['channel']['noop'](_0x9251('0x15e'));}var _0x119a41=this[_0x9251('0xd')][_0x9251('0x71')](this,_0x5d40d3[_0x9251('0xc5')]);if(!_0x119a41){return this[_0x9251('0xc')][_0x9251('0x28')](_0x5d40d3,_0x9251('0xc7'));}this['channel'][_0x9251('0x9f')](util[_0x9251('0x25')]('%s_STATUS_CODE',_0x119a41),_0x5795ab[_0x9251('0x76')]?_0x5795ab['statusCode']:'200');this[_0x9251('0xc')][_0x9251('0x9f')](util[_0x9251('0x25')](_0x9251('0x15f'),_0x119a41),_0x5795ab['statusMessage']?_0x5795ab['statusMessage']:'OK');if(_0x5795ab['body']){try{this[_0x9251('0x96')](_0x5795ab[_0x9251('0x6a')],_0x119a41);}catch(_0x249e76){logger['error'](util['format']('Unable\x20to\x20set\x20result\x20in\x20variable\x20%s',_0x119a41));}}return this['channel'][_0x9251('0xab')](util[_0x9251('0x25')]('variable\x20%s\x20set',_0x119a41));};AGIVertices['prototype'][_0x9251('0x160')]=function(_0x5f5574){logger[_0x9251('0x2a')](util[_0x9251('0x25')](_0x9251('0x161'),_0x5f5574[_0x9251('0x33')]));return this['channel']['sayDigits'](_0x5f5574[_0x9251('0x162')][_0x9251('0x55')](/\s+/g,''),_0x5f5574[_0x9251('0x15a')]);};AGIVertices[_0x9251('0x12')]['saynumber']=function(_0x142993){logger['info'](util[_0x9251('0x25')](_0x9251('0x163'),_0x142993[_0x9251('0x33')]));return this[_0x9251('0xc')][_0x9251('0x164')](_0x142993[_0x9251('0x65')][_0x9251('0x55')](/\s+/g,''),_0x142993[_0x9251('0x15a')]);};AGIVertices['prototype'][_0x9251('0x165')]=function(_0x239676){logger[_0x9251('0x2a')](util[_0x9251('0x25')]('Enter\x20in\x20SAYPHONETIC\x20(%s)\x20block',_0x239676['label']));return this[_0x9251('0xc')][_0x9251('0x166')](_0x239676[_0x9251('0x59')],_0x239676[_0x9251('0x15a')]);};AGIVertices[_0x9251('0x12')]['sendMail']=function(_0x5105c4){logger['info'](util['format'](_0x9251('0x167'),_0x5105c4[_0x9251('0x33')]));if(!this[_0x9251('0x81')](_0x5105c4['account_id'])){return this[_0x9251('0xc')][_0x9251('0xab')]('no\x20mail\x20account\x20configured');}var _0x49123c=this[_0x9251('0x1e')][_0x9251('0x71')](this,_0x5105c4[_0x9251('0x168')]);if(!_0x49123c||!_0x49123c[_0x9251('0x169')]){return this[_0x9251('0xc')][_0x9251('0x28')](_0x5105c4,_0x9251('0x16a'));}var _0x5cbbc8={'from':util[_0x9251('0x25')](_0x9251('0x16b'),_0x49123c[_0x9251('0x10')],_0x49123c['email']||_0x49123c[_0x9251('0x169')][_0x9251('0x16c')]),'to':_0x5105c4['to']||'','cc':_0x5105c4['cc']||'','bcc':_0x5105c4[_0x9251('0x16d')]||'','subject':_0x5105c4[_0x9251('0x16e')],'html':_0x5105c4[_0x9251('0x59')],'text':_0x5105c4[_0x9251('0x59')]};var _0x4b24df={'tls':{'rejectUnauthorized':![]}};if(_0x49123c[_0x9251('0x169')][_0x9251('0x16f')]){_0x4b24df[_0x9251('0x16f')]=_0x49123c[_0x9251('0x169')][_0x9251('0x16f')];}else{_0x4b24df['host']=_0x49123c[_0x9251('0x169')]['host'];_0x4b24df[_0x9251('0x170')]=_0x49123c[_0x9251('0x169')]['port'];_0x4b24df['secure']=_0x49123c[_0x9251('0x169')][_0x9251('0x171')];}if(_0x49123c[_0x9251('0x169')][_0x9251('0x172')]){_0x4b24df[_0x9251('0x173')]={'user':_0x49123c[_0x9251('0x169')]['user'],'pass':_0x49123c[_0x9251('0x169')][_0x9251('0x174')]};}if(this[_0x9251('0x81')](_0x5105c4['template_id'])){}logger[_0x9251('0x175')](_0x9251('0x176'),JSON['stringify'](_0x5cbbc8));this[_0x9251('0x31')][_0x9251('0x71')](this,_0x5105c4,_0x5105c4['account_id']);this[_0x9251('0xc')][_0x9251('0xab')](util[_0x9251('0x25')](_0x9251('0x177'),_0x49123c['name']));this[_0x9251('0x1f')][_0x9251('0x71')](this,_0x4b24df,_0x5cbbc8);return this[_0x9251('0xc')][_0x9251('0xab')](_0x9251('0x178'));};AGIVertices['prototype'][_0x9251('0x179')]=function(_0x50427b){logger[_0x9251('0x2a')](util[_0x9251('0x25')](_0x9251('0x17a'),_0x50427b[_0x9251('0x33')]));return this[_0x9251('0xc')][_0x9251('0xab')](_0x9251('0x17b'));};AGIVertices[_0x9251('0x12')]['sendSMS']=function(_0x2c6dc0){logger[_0x9251('0x2a')](util['format'](_0x9251('0x17c'),_0x2c6dc0[_0x9251('0x33')]));if(!this['isConfigured'](_0x2c6dc0[_0x9251('0x17d')])){return this[_0x9251('0xc')][_0x9251('0xab')]('no\x20sms\x20account\x20configured');}var _0x56200c=this[_0x9251('0x2f')]['sync'](this,_0x2c6dc0[_0x9251('0x17d')]);if(!_0x56200c){return this['channel'][_0x9251('0x28')](_0x2c6dc0,_0x9251('0x17e'));}var _0x43b86d={'body':_0x2c6dc0['sms_text'],'phone':_0x2c6dc0['to']||'','SmsAccountId':_0x56200c['id']};logger[_0x9251('0x175')](_0x9251('0x17f'),JSON['stringify'](_0x43b86d));this[_0x9251('0x31')][_0x9251('0x71')](this,_0x2c6dc0,_0x2c6dc0[_0x9251('0x17d')]);this['channel'][_0x9251('0xab')](util[_0x9251('0x25')](_0x9251('0x180'),_0x56200c[_0x9251('0x10')]));this[_0x9251('0x30')][_0x9251('0x71')](this,_0x43b86d);return this[_0x9251('0xc')][_0x9251('0xab')](_0x9251('0x181'));};AGIVertices['prototype']['set']=function(_0x5437e4){logger[_0x9251('0x2a')](util[_0x9251('0x25')](_0x9251('0x182'),_0x5437e4[_0x9251('0x33')]));if(!this[_0x9251('0x81')](_0x5437e4[_0x9251('0xc5')])){return this['channel'][_0x9251('0x28')](_0x5437e4,_0x9251('0x183'));}var _0x303721=this[_0x9251('0xd')][_0x9251('0x71')](this,_0x5437e4[_0x9251('0xc5')]);if(!_0x303721){return this[_0x9251('0xc')][_0x9251('0x28')](_0x5437e4,_0x9251('0xc7'));}return this[_0x9251('0xc')][_0x9251('0x9f')](_0x303721,_0x5437e4['variable_value']);};AGIVertices['prototype']['start']=function(_0x4c0881){logger['info'](util[_0x9251('0x25')](_0x9251('0x184'),_0x4c0881[_0x9251('0x33')]));this[_0x9251('0xc')][_0x9251('0xab')](_0x9251('0x185'));if(_0x4c0881[_0x9251('0xa3')]===_0x9251('0x186')){this['channel'][_0x9251('0xab')](_0x9251('0x187'));return this[_0x9251('0xc')][_0x9251('0xa3')]();}return this['channel'][_0x9251('0xab')]('Skipped\x20Answer');};AGIVertices[_0x9251('0x12')][_0x9251('0x188')]=function(_0x42ad0b){logger['info'](util[_0x9251('0x25')]('Enter\x20in\x20SUBPROJECT\x20(%s)\x20block',_0x42ad0b[_0x9251('0x33')]));if(!this['isConfigured'](_0x42ad0b[_0x9251('0x189')])){return this[_0x9251('0xc')][_0x9251('0x28')](_0x42ad0b,_0x9251('0x18a'));}var _0x21af37=this[_0x9251('0x15')][_0x9251('0x71')](this,_0x42ad0b['project_id']);if(!this[_0x9251('0x81')](_0x21af37)){return this[_0x9251('0xc')][_0x9251('0x28')](_0x42ad0b,util[_0x9251('0x25')](_0x9251('0x18b'),_0x42ad0b[_0x9251('0x189')]));}if(_0x21af37===this['channel'][_0x9251('0x35')]){return this[_0x9251('0xc')][_0x9251('0x28')](_0x42ad0b,_0x9251('0x18c'));}this[_0x9251('0x31')][_0x9251('0x71')](this,_0x42ad0b,_0x21af37);var _0xe86052=this['channel'][_0x9251('0x53')]('AGI',util['format'](_0x9251('0x18d'),config[_0x9251('0x8')][_0x9251('0x18e')]||_0x9251('0x18f'),_0x21af37,this[_0x9251('0xc')][_0x9251('0x35')]));if(_0xe86052[_0x9251('0x9e')]===-0x1){return _0xe86052;}return this[_0x9251('0xc')][_0x9251('0xab')](util[_0x9251('0x25')]('Executed\x20command\x20%s\x20%s','AGI',_0x21af37));};AGIVertices[_0x9251('0x12')][_0x9251('0x190')]=function(_0x569376){logger[_0x9251('0x2a')](util[_0x9251('0x25')](_0x9251('0x191'),_0x569376[_0x9251('0x33')]));var _0x3a8102=this[_0x9251('0x52')][_0x9251('0x71')](this,_0x569376['command']);this['createSquareDetailsReport']['sync'](this,_0x569376,_0x569376[_0x9251('0x192')]);if(this['isConfigured'](_0x569376[_0x9251('0xc5')])){var _0x5f416f=this['getVariable']['sync'](this,_0x569376[_0x9251('0xc5')]);if(_0x5f416f){this[_0x9251('0xc')][_0x9251('0x9f')](_0x5f416f,_0x3a8102);return this[_0x9251('0xc')][_0x9251('0xab')](util[_0x9251('0x25')](_0x9251('0x193'),_0x569376[_0x9251('0x192')],_0x5f416f));}}return this[_0x9251('0xc')][_0x9251('0xab')](util[_0x9251('0x25')](_0x9251('0x194'),_0x569376[_0x9251('0x192')]));};AGIVertices[_0x9251('0x12')][_0x9251('0x195')]=function(_0x411910){logger[_0x9251('0x2a')](util[_0x9251('0x25')](_0x9251('0x196'),_0x411910[_0x9251('0x33')]));if(!this[_0x9251('0x81')](_0x411910[_0x9251('0x57')])){return this[_0x9251('0xc')][_0x9251('0xab')](_0x9251('0x197'));}if(!this[_0x9251('0x81')](_0x411910[_0x9251('0x59')])){return this[_0x9251('0xc')][_0x9251('0xab')](_0x9251('0xb2'));}this[_0x9251('0xc')][_0x9251('0xab')](util[_0x9251('0x25')](_0x9251('0x198'),_0x411910[_0x9251('0x59')]));var _0x2608f3=this[_0x9251('0x56')][_0x9251('0x71')](this,_0x411910);if(_0x2608f3){this['channel'][_0x9251('0xab')](util[_0x9251('0x25')]('Google\x20Cloud\x20TTS\x20%s\x20file\x20created',_0x2608f3));var _0x49571e=this[_0x9251('0xc')][_0x9251('0xe4')](_0x2608f3);try{fs[_0x9251('0xe5')](_0x2608f3+_0x9251('0xe6'));}catch(_0xd87716){logger[_0x9251('0x28')](_0xd87716);}return _0x49571e;}return this[_0x9251('0xc')]['error'](_0x411910,'Google\x20Cloud\x20TTS\x20is\x20unreachable');};AGIVertices[_0x9251('0x12')]['tts']=function(_0x3e6318){logger[_0x9251('0x2a')](util[_0x9251('0x25')](_0x9251('0x199'),_0x3e6318[_0x9251('0x33')]));if(!this['isConfigured'](_0x3e6318[_0x9251('0x59')])){return this[_0x9251('0xc')]['noop']('no\x20text\x20configured');}this[_0x9251('0xc')]['noop'](util[_0x9251('0x25')](_0x9251('0x19a'),_0x3e6318[_0x9251('0x59')]));var _0x2beff3=this['googleTTS']['sync'](this,_0x3e6318);if(_0x2beff3){this[_0x9251('0xc')][_0x9251('0xab')](util['format']('Google\x20TTS\x20%s\x20file\x20created',_0x2beff3));var _0x15307c=this[_0x9251('0xc')][_0x9251('0xe4')](_0x2beff3);try{fs[_0x9251('0xe5')](_0x2beff3+_0x9251('0xe6'));}catch(_0x5c0434){logger[_0x9251('0x28')](_0x5c0434);}return _0x15307c;}return this[_0x9251('0xc')][_0x9251('0x28')](_0x3e6318,_0x9251('0x19b'));};AGIVertices[_0x9251('0x12')][_0x9251('0x19c')]=function(_0x2d41c7){logger[_0x9251('0x2a')](util[_0x9251('0x25')](_0x9251('0x19d'),_0x2d41c7[_0x9251('0x33')]));if(!this['isConfigured'](_0x2d41c7['findBy'])){return this[_0x9251('0xc')]['error'](_0x2d41c7,_0x9251('0x132'));}logger[_0x9251('0x2a')](util[_0x9251('0x25')]('FIND\x20AGENT\x20%s\x20BY\x20%s',this['channel'][_0x9251('0x36')],_0x2d41c7[_0x9251('0x131')]));var _0x3e0f46=this['agentUnpause'][_0x9251('0x71')](this,_0x2d41c7[_0x9251('0x131')]);if(_0x3e0f46){logger[_0x9251('0x2a')](util['format'](_0x9251('0x134'),this[_0x9251('0xc')]['callerid'],_0x2d41c7[_0x9251('0x131')]));this[_0x9251('0xc')][_0x9251('0xab')](util[_0x9251('0x25')](_0x9251('0x134'),this[_0x9251('0xc')][_0x9251('0x36')],_0x2d41c7[_0x9251('0x131')]));return{'code':0xc8,'result':_0x9251('0x135')};}else{logger[_0x9251('0x2a')](util[_0x9251('0x25')](_0x9251('0x136'),this[_0x9251('0xc')][_0x9251('0x36')],_0x2d41c7[_0x9251('0x131')]));this[_0x9251('0xc')][_0x9251('0xab')](util[_0x9251('0x25')](_0x9251('0x136'),this[_0x9251('0xc')][_0x9251('0x36')],_0x2d41c7['findBy']));return{'code':0xc8,'result':_0x9251('0x137')};}};AGIVertices['prototype'][_0x9251('0x19e')]=function(_0x2df775){logger[_0x9251('0x2a')](util[_0x9251('0x25')](_0x9251('0x19f'),_0x2df775['label']));var _0x585a7b=this[_0x9251('0xc')][_0x9251('0x53')](_0x9251('0x1a0'),[_0x2df775[_0x9251('0x1a1')],_0x2df775[_0x9251('0x79')]]);if(_0x585a7b[_0x9251('0x9e')]===-0x1){return _0x585a7b;}return this[_0x9251('0xc')][_0x9251('0xab')](util[_0x9251('0x25')](_0x9251('0x149'),_0x9251('0x1a0'),_0x2df775[_0x9251('0x1a1')]));};AGIVertices[_0x9251('0x12')]['vswitch']=function(_0x7f9062){logger['info'](util[_0x9251('0x25')](_0x9251('0x1a2'),_0x7f9062[_0x9251('0x33')]));if(!this['isConfigured'](_0x7f9062[_0x9251('0xc5')])){return this[_0x9251('0xc')][_0x9251('0x28')](_0x7f9062,'no\x20variable\x20selected');}var _0x5cdfde=this['getVariable'][_0x9251('0x71')](this,_0x7f9062[_0x9251('0xc5')]);if(!_0x5cdfde){return this[_0x9251('0xc')][_0x9251('0x28')](_0x7f9062,'no\x20variable\x20found');}var _0xcdce34=this[_0x9251('0xc')][_0x9251('0xd')](_0x5cdfde);return{'code':0xc8,'result':_0xcdce34[_0x9251('0x9b')]?_0xcdce34['extra']:'-'};};String[_0x9251('0x12')][_0x9251('0x1a3')]=function(_0x3e150d,_0x974114){return this[_0x9251('0x9a')](_0x3e150d)[_0x9251('0x1a4')](_0x974114);};module[_0x9251('0x1a5')]=AGIVertices;
\ No newline at end of file
diff --git a/server/services/ami/acw/index.js b/server/services/ami/acw/index.js
index fb950c6..d54e590 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 _0x00bb=['transfereeuniqueid','secondtransfereruniqueid','transfertargetuniqueid','origtransfereruniqueid','transfereruniqueid','[%s][BLINDTRANSFER:LINKEDID]','transfererlinkedid','[ACW][syncBlindTransfer]\x20%s','all','[ACW][syncAgentRingNoAnswer]\x20%s','util','lodash','moment','../../../config/logger','../rpc/user','../rpc/voiceAgentReport','voiceQueues','timers','channels','agentconnect','syncAgentConnect','bind','hanguprequest','hangup','syncHangup','agentringnoanswer','syncAgentRingNoAnswer','attendedtransfer','syncBlindTransfer','custom:agentConnectPreview','syncAgentConnectPreview','milliseconds','diff','seconds','interface','ACW','mandatoryDispositionPause','name','Action','then','agents','getAgent','voicePause','info','destlinkedid','savePause','timer','stopAcw','acwTimeout','format','uniqueid','updateAcw','lastPauseAt','catch','error','[%s][UPDATE][ERRORS:%s]','[%s][INPAUSE][AGENT:%s][QUEUE:%s]','finally','[ACW][START]\x20%s','message','prototype','queue','saveUnpause','update','[ACW][STOP]\x20Interface\x20%s\x20doesn\x27t\x20have\x20timer','stringify','mandatoryDisposition','acw','[ACW][syncAgentConnectPreview]\x20%s','linkedid','isUndefined','attended','startAcw','[ACW][syncHangupRequest]\x20%s','[%s][HANGUPATTENDEDTRANSFER:LINKEDID]','[ACW][syncHangup]\x20%s','isNil'];(function(_0x2658ca,_0x316b5d){var _0x53f405=function(_0x2b7ac1){while(--_0x2b7ac1){_0x2658ca['push'](_0x2658ca['shift']());}};_0x53f405(++_0x316b5d);}(_0x00bb,0x1d8));var _0xb00b=function(_0x397e5f,_0x454c8f){_0x397e5f=_0x397e5f-0x0;var _0x5302b8=_0x00bb[_0x397e5f];return _0x5302b8;};'use strict';var util=require(_0xb00b('0x0'));var _=require(_0xb00b('0x1'));var moment=require(_0xb00b('0x2'));var ami=require('../ami');var logger=require(_0xb00b('0x3'))('acw');var RpcUser=require(_0xb00b('0x4'));var RpcVoiceAgentReport=require(_0xb00b('0x5'));function Acw(_0x582ef9){this[_0xb00b('0x6')]=_0x582ef9[_0xb00b('0x6')];this['agents']=_0x582ef9['agents'];this['timers']=_0x582ef9[_0xb00b('0x7')];this[_0xb00b('0x8')]={};ami['on'](_0xb00b('0x9'),this[_0xb00b('0xa')][_0xb00b('0xb')](this));ami['on'](_0xb00b('0xc'),this['syncHangupRequest']['bind'](this));ami['on'](_0xb00b('0xd'),this[_0xb00b('0xe')][_0xb00b('0xb')](this));ami['on'](_0xb00b('0xf'),this[_0xb00b('0x10')]['bind'](this));ami['on'](_0xb00b('0x11'),this['syncAttendedTransfer']['bind'](this));ami['on']('blindtransfer',this[_0xb00b('0x12')][_0xb00b('0xb')](this));ami['on'](_0xb00b('0x13'),this[_0xb00b('0x14')][_0xb00b('0xb')](this));}function getDiff(_0x1f1c1d){var _0x4ada81=moment()[_0xb00b('0x15')](0x0);var _0xb0d42e=moment(_0x1f1c1d)['milliseconds'](0x0);return _0x4ada81[_0xb00b('0x16')](_0xb0d42e,_0xb00b('0x17'));}Acw['prototype']['startAcw']=function(_0x9b471e){try{var _0x4dcd45=this;var _0x51d136=this[_0xb00b('0x8')][_0x9b471e][_0xb00b('0x18')];var _0x387d97=this[_0xb00b('0x8')][_0x9b471e]['queue'];var _0x2a7231=this['voiceQueues'][_0x387d97];var _0x415f91=![];var _0x5aa9a0=_0xb00b('0x19');if(_0x2a7231['mandatoryDisposition']){if(_0x2a7231[_0xb00b('0x1a')][_0xb00b('0x1b')]){_0x415f91=!![];_0x5aa9a0=_0x2a7231['mandatoryDispositionPause']['name'];}}ami[_0xb00b('0x1c')]({'action':'QueuePause','interface':_0x51d136,'paused':!![],'reason':_0x5aa9a0})[_0xb00b('0x1d')](function(_0x43da66){if(_0x4dcd45[_0xb00b('0x1e')][_0x51d136]){return RpcUser[_0xb00b('0x1f')](_0x4dcd45['agents'][_0x51d136]['id'])[_0xb00b('0x1d')](function(_0x4df284){if(_0x4df284&&!_0x4df284[_0xb00b('0x20')]){logger[_0xb00b('0x21')]('[%s][START][AGENT:%s][QUEUE:%s]',_0x9b471e,_0x51d136,_0x387d97);var _0x231293=_0x4dcd45[_0xb00b('0x8')][_0x9b471e]['attended']&&_0x4dcd45[_0xb00b('0x8')][_0x9b471e][_0xb00b('0x22')]?_0x4dcd45['channels'][_0x9b471e][_0xb00b('0x22')]:_0x9b471e;return RpcUser[_0xb00b('0x23')](_0x4dcd45[_0xb00b('0x1e')][_0x51d136],_0x5aa9a0,_0x231293)[_0xb00b('0x1d')](function(_0x520e55){if(!_0x415f91){_0x4dcd45['timers'][_0x51d136]={};logger[_0xb00b('0x21')]('[%s][TIMER:%s][AGENT:%s][QUEUE:%s]',_0x9b471e,_0x4dcd45['voiceQueues'][_0x387d97]['acwTimeout'],_0x51d136,_0x387d97);_0x4dcd45[_0xb00b('0x7')][_0x51d136][_0xb00b('0x24')]=setTimeout(_0x4dcd45[_0xb00b('0x25')][_0xb00b('0xb')](_0x4dcd45,_0x51d136),_0x4dcd45[_0xb00b('0x6')][_0x387d97][_0xb00b('0x26')]*0x3e8);_0x4dcd45[_0xb00b('0x7')][_0x51d136]['lastPauseAt']=moment()[_0xb00b('0x27')]('YYYY-MM-DD\x20HH:mm:ss');_0x4dcd45[_0xb00b('0x7')][_0x51d136][_0xb00b('0x28')]=_0x9b471e;_0x4dcd45[_0xb00b('0x7')][_0x51d136]['queue']=_0x387d97;_0x4dcd45[_0xb00b('0x7')][_0x51d136][_0xb00b('0x29')]=function(){var _0x16fbd5=getDiff(_0x4dcd45[_0xb00b('0x7')][_0x51d136][_0xb00b('0x2a')]);clearTimeout(_0x4dcd45[_0xb00b('0x7')][_0x51d136][_0xb00b('0x24')]);_0x4dcd45[_0xb00b('0x7')][_0x51d136][_0xb00b('0x24')]=![];RpcVoiceAgentReport['update']({'acwtime':_0x16fbd5},_0x4dcd45[_0xb00b('0x7')][_0x51d136][_0xb00b('0x28')],_0x51d136)['then'](function(_0x593659){logger[_0xb00b('0x21')]('[%s][UPDATE][ACWTIME:%s]',_0x9b471e,_0x16fbd5,_0x593659);})[_0xb00b('0x2b')](function(_0x4d2ee5){logger[_0xb00b('0x2c')](_0xb00b('0x2d'),_0x9b471e,_0x4d2ee5);});delete _0x4dcd45[_0xb00b('0x7')][_0x51d136];};}});}else{logger[_0xb00b('0x21')](_0xb00b('0x2e'),_0x9b471e,_0x51d136,_0x387d97);}});}})[_0xb00b('0x2b')](function(_0x17f613){logger['error']('[%s][TIMER:%s][AGENT:%s][QUEUE:%s]',_0x9b471e,_0x4dcd45['voiceQueues'][_0x387d97][_0xb00b('0x26')],_0x51d136,_0x387d97);})[_0xb00b('0x2f')](function(){delete _0x4dcd45[_0xb00b('0x8')][_0x9b471e];});}catch(_0x2589cb){logger['error'](_0xb00b('0x30'),_0x2589cb[_0xb00b('0x31')]);}};Acw[_0xb00b('0x32')][_0xb00b('0x25')]=function(_0x261c80){try{var _0x39da49=this;if(_0x39da49[_0xb00b('0x7')][_0x261c80]){_0x39da49[_0xb00b('0x7')][_0x261c80]['timer']=![];var _0x55451e=_0x39da49[_0xb00b('0x7')][_0x261c80]['uniqueid'];var _0x1c8258=_0x39da49[_0xb00b('0x7')][_0x261c80][_0xb00b('0x33')];var _0x45ca74=_0x39da49[_0xb00b('0x6')][_0x1c8258][_0xb00b('0x26')];logger[_0xb00b('0x21')]('[TIMER][STOP][AGENT:%s]',_0x261c80);RpcUser[_0xb00b('0x34')](this[_0xb00b('0x1e')][_0x261c80]);RpcVoiceAgentReport[_0xb00b('0x35')]({'acwtime':_0x45ca74,'agentacw':!![]},_0x55451e,_0x261c80)[_0xb00b('0x1d')](function(_0x2496e2){logger[_0xb00b('0x21')]('[%s][UPDATE][ACWTIME:%s]',_0x55451e,_0x45ca74,_0x2496e2);})[_0xb00b('0x2b')](function(_0x3beb8f){logger['error'](_0xb00b('0x2d'),_0x55451e,_0x3beb8f);});}else{logger[_0xb00b('0x2c')](_0xb00b('0x36'),_0x261c80);if(_0x39da49[_0xb00b('0x7')]){logger[_0xb00b('0x21')]('[ACW][TIMERS]',JSON[_0xb00b('0x37')](_0x39da49[_0xb00b('0x7')]));}}}catch(_0xb76ede){logger[_0xb00b('0x2c')]('[ACW][STOP]\x20%s',_0xb76ede['message']);}};Acw[_0xb00b('0x32')][_0xb00b('0xa')]=function(_0x10a348){try{if(this[_0xb00b('0x6')][_0x10a348[_0xb00b('0x33')]]&&(this[_0xb00b('0x6')][_0x10a348[_0xb00b('0x33')]]['acw']||this[_0xb00b('0x6')][_0x10a348[_0xb00b('0x33')]][_0xb00b('0x38')])){if(this[_0xb00b('0x1e')][_0x10a348[_0xb00b('0x18')]]){this[_0xb00b('0x8')][_0x10a348[_0xb00b('0x28')]]={'queue':_0x10a348[_0xb00b('0x33')],'interface':_0x10a348[_0xb00b('0x18')],'destlinkedid':_0x10a348[_0xb00b('0x22')]};}}}catch(_0xc0dddd){logger[_0xb00b('0x2c')]('[ACW][syncAgentConnect]\x20%s',_0xc0dddd[_0xb00b('0x31')]);}};Acw[_0xb00b('0x32')][_0xb00b('0x14')]=function(_0x44afa0){try{if(this[_0xb00b('0x6')][_0x44afa0[_0xb00b('0x33')]]&&(this[_0xb00b('0x6')][_0x44afa0[_0xb00b('0x33')]][_0xb00b('0x39')]||this[_0xb00b('0x6')][_0x44afa0[_0xb00b('0x33')]][_0xb00b('0x38')])){if(this['agents'][_0x44afa0['interface']]){this['channels'][_0x44afa0[_0xb00b('0x28')]]={'queue':_0x44afa0[_0xb00b('0x33')],'interface':_0x44afa0['interface']};}}}catch(_0x31cee1){logger[_0xb00b('0x2c')](_0xb00b('0x3a'),_0x31cee1[_0xb00b('0x31')]);}};Acw['prototype']['syncHangupRequest']=function(_0x172729){try{if(this[_0xb00b('0x8')][_0x172729['uniqueid']]&&_['isUndefined'](this[_0xb00b('0x8')][_0x172729[_0xb00b('0x28')]]['attended'])){logger[_0xb00b('0x21')]('[%s][HANGUP:UNIQUEID]',_0x172729['uniqueid']);this['startAcw'](_0x172729[_0xb00b('0x28')]);}else if(this['channels'][_0x172729[_0xb00b('0x3b')]]&&_[_0xb00b('0x3c')](this[_0xb00b('0x8')][_0x172729[_0xb00b('0x3b')]][_0xb00b('0x3d')])){logger[_0xb00b('0x21')]('[%s][HANGUP:LINKEDID]',_0x172729['linkedid']);this[_0xb00b('0x3e')](_0x172729[_0xb00b('0x3b')]);}}catch(_0x559357){logger[_0xb00b('0x2c')](_0xb00b('0x3f'),_0x559357['message']);}};Acw[_0xb00b('0x32')][_0xb00b('0xe')]=function(_0x3b5d82){try{if(this['channels'][_0x3b5d82['uniqueid']]&&this[_0xb00b('0x8')][_0x3b5d82[_0xb00b('0x28')]][_0xb00b('0x3d')]){logger[_0xb00b('0x21')]('[%s][HANGUPATTENDEDTRANSFER:UNIQUEID]',_0x3b5d82[_0xb00b('0x28')]);this[_0xb00b('0x3e')](_0x3b5d82['uniqueid']);}else if(this['channels'][_0x3b5d82[_0xb00b('0x3b')]]&&this['channels'][_0x3b5d82[_0xb00b('0x3b')]][_0xb00b('0x3d')]){logger[_0xb00b('0x21')](_0xb00b('0x40'),_0x3b5d82[_0xb00b('0x3b')]);this[_0xb00b('0x3e')](_0x3b5d82['linkedid']);}}catch(_0x5d52a5){logger['error'](_0xb00b('0x41'),_0x5d52a5[_0xb00b('0x31')]);}};Acw[_0xb00b('0x32')]['syncAttendedTransfer']=function(_0x248335){try{if(!_[_0xb00b('0x42')](this[_0xb00b('0x8')][_0x248335['transfereeuniqueid']])){this[_0xb00b('0x3e')](_0x248335[_0xb00b('0x43')]);if(this[_0xb00b('0x8')][_0x248335[_0xb00b('0x44')]]){this[_0xb00b('0x8')][_0x248335[_0xb00b('0x44')]][_0xb00b('0x3d')]=!![];this[_0xb00b('0x8')][_0x248335['transfertargetuniqueid']]=this[_0xb00b('0x8')][_0x248335[_0xb00b('0x44')]];delete this[_0xb00b('0x8')][_0x248335['secondtransfereruniqueid']];}}else if(!_[_0xb00b('0x42')](this[_0xb00b('0x8')][_0x248335[_0xb00b('0x45')]])){this[_0xb00b('0x3e')](_0x248335[_0xb00b('0x45')]);if(this['channels'][_0x248335[_0xb00b('0x46')]]){this[_0xb00b('0x8')][_0x248335[_0xb00b('0x46')]][_0xb00b('0x3d')]=!![];this['channels'][_0x248335[_0xb00b('0x43')]]=this[_0xb00b('0x8')][_0x248335[_0xb00b('0x46')]];delete this[_0xb00b('0x8')][_0x248335[_0xb00b('0x46')]];}}}catch(_0x1e5ed8){logger[_0xb00b('0x2c')]('[ACW][syncAttendedTransfer]\x20%s',_0x1e5ed8[_0xb00b('0x31')]);}};Acw['prototype'][_0xb00b('0x12')]=function(_0x4c2186){try{if(this[_0xb00b('0x8')][_0x4c2186['transfereruniqueid']]){logger[_0xb00b('0x21')]('[%s][BLINDTRANSFER:UNIQUEID]',JSON[_0xb00b('0x37')](_0x4c2186[_0xb00b('0x47')]));this[_0xb00b('0x3e')](_0x4c2186['transfereruniqueid']);}else if(this['channels'][_0x4c2186['transfererlinkedid']]){logger[_0xb00b('0x21')](_0xb00b('0x48'),JSON[_0xb00b('0x37')](_0x4c2186['transfererlinkedid']));this[_0xb00b('0x3e')](_0x4c2186[_0xb00b('0x49')]);}}catch(_0xca87d4){logger[_0xb00b('0x2c')](_0xb00b('0x4a'),_0xca87d4['message']);}};Acw[_0xb00b('0x32')][_0xb00b('0x10')]=function(_0x5622a4){try{if(this[_0xb00b('0x6')][_0x5622a4[_0xb00b('0x33')]]&&this[_0xb00b('0x6')][_0x5622a4['queue']]['autopause']===_0xb00b('0x4b')){if(this[_0xb00b('0x1e')][_0x5622a4[_0xb00b('0x18')]]){logger['info']('[%s][AUTOPAUSE][AGENT:%s][QUEUE:%]',_0x5622a4['uniqueid'],_0x5622a4['interface'],_0x5622a4[_0xb00b('0x33')]);return RpcUser['savePause'](this[_0xb00b('0x1e')][_0x5622a4[_0xb00b('0x18')]],'Auto-Pause',_0x5622a4[_0xb00b('0x28')]);}}}catch(_0x1e7f3a){logger[_0xb00b('0x2c')](_0xb00b('0x4c'),_0x1e7f3a[_0xb00b('0x31')]);}};module['exports']=Acw;
\ No newline at end of file
+var _0xbec5=['syncAttendedTransfer','syncBlindTransfer','syncAgentConnectPreview','milliseconds','diff','seconds','prototype','startAcw','interface','queue','mandatoryDisposition','mandatoryDispositionPause','name','Action','then','getAgent','info','[%s][START][AGENT:%s][QUEUE:%s]','attended','destlinkedid','savePause','acwTimeout','stopAcw','YYYY-MM-DD\x20HH:mm:ss','uniqueid','lastPauseAt','timer','update','[%s][UPDATE][ACWTIME:%s]','catch','[%s][UPDATE][ERRORS:%s]','[%s][INPAUSE][AGENT:%s][QUEUE:%s]','error','[%s][TIMER:%s][AGENT:%s][QUEUE:%s]','[ACW][START]\x20%s','message','[TIMER][STOP][AGENT:%s]','saveUnpause','[ACW][STOP]\x20Interface\x20%s\x20doesn\x27t\x20have\x20timer','[ACW][TIMERS]','stringify','[ACW][syncAgentConnectPreview]\x20%s','isUndefined','linkedid','[ACW][syncHangupRequest]\x20%s','syncHangup','[%s][HANGUPATTENDEDTRANSFER:UNIQUEID]','[%s][HANGUPATTENDEDTRANSFER:LINKEDID]','[ACW][syncHangup]\x20%s','isNil','transfereeuniqueid','secondtransfereruniqueid','transfertargetuniqueid','origtransfereruniqueid','[ACW][syncAttendedTransfer]\x20%s','transfereruniqueid','[%s][BLINDTRANSFER:UNIQUEID]','transfererlinkedid','[%s][BLINDTRANSFER:LINKEDID]','[ACW][syncBlindTransfer]\x20%s','autopause','[%s][AUTOPAUSE][AGENT:%s][QUEUE:%]','Auto-Pause','util','lodash','../ami','../../../config/logger','acw','../rpc/user','../rpc/voiceAgentReport','voiceQueues','agents','timers','channels','agentconnect','syncAgentConnect','bind','hanguprequest','syncHangupRequest','hangup','agentringnoanswer','syncAgentRingNoAnswer','attendedtransfer'];(function(_0x456f0,_0x7a092e){var _0x520823=function(_0x536c56){while(--_0x536c56){_0x456f0['push'](_0x456f0['shift']());}};_0x520823(++_0x7a092e);}(_0xbec5,0xe5));var _0x5bec=function(_0x25a0b9,_0x86e28f){_0x25a0b9=_0x25a0b9-0x0;var _0x30b9ab=_0xbec5[_0x25a0b9];return _0x30b9ab;};'use strict';var util=require(_0x5bec('0x0'));var _=require(_0x5bec('0x1'));var moment=require('moment');var ami=require(_0x5bec('0x2'));var logger=require(_0x5bec('0x3'))(_0x5bec('0x4'));var RpcUser=require(_0x5bec('0x5'));var RpcVoiceAgentReport=require(_0x5bec('0x6'));function Acw(_0x4ee982){this[_0x5bec('0x7')]=_0x4ee982[_0x5bec('0x7')];this[_0x5bec('0x8')]=_0x4ee982['agents'];this[_0x5bec('0x9')]=_0x4ee982[_0x5bec('0x9')];this[_0x5bec('0xa')]={};ami['on'](_0x5bec('0xb'),this[_0x5bec('0xc')][_0x5bec('0xd')](this));ami['on'](_0x5bec('0xe'),this[_0x5bec('0xf')]['bind'](this));ami['on'](_0x5bec('0x10'),this['syncHangup'][_0x5bec('0xd')](this));ami['on'](_0x5bec('0x11'),this[_0x5bec('0x12')]['bind'](this));ami['on'](_0x5bec('0x13'),this[_0x5bec('0x14')][_0x5bec('0xd')](this));ami['on']('blindtransfer',this[_0x5bec('0x15')][_0x5bec('0xd')](this));ami['on']('custom:agentConnectPreview',this[_0x5bec('0x16')][_0x5bec('0xd')](this));}function getDiff(_0x35393a){var _0x6888a4=moment()[_0x5bec('0x17')](0x0);var _0xcd6d90=moment(_0x35393a)[_0x5bec('0x17')](0x0);return _0x6888a4[_0x5bec('0x18')](_0xcd6d90,_0x5bec('0x19'));}Acw[_0x5bec('0x1a')][_0x5bec('0x1b')]=function(_0x325daf){try{var _0x11fb8e=this;var _0x506639=this['channels'][_0x325daf][_0x5bec('0x1c')];var _0x773740=this[_0x5bec('0xa')][_0x325daf][_0x5bec('0x1d')];var _0x5cd7ae=this['voiceQueues'][_0x773740];var _0x3cd354=![];var _0x6c0d35='ACW';if(_0x5cd7ae[_0x5bec('0x1e')]){if(_0x5cd7ae[_0x5bec('0x1f')][_0x5bec('0x20')]){_0x3cd354=!![];_0x6c0d35=_0x5cd7ae[_0x5bec('0x1f')]['name'];}}ami[_0x5bec('0x21')]({'action':'QueuePause','interface':_0x506639,'paused':!![],'reason':_0x6c0d35})[_0x5bec('0x22')](function(_0x208d99){if(_0x11fb8e[_0x5bec('0x8')][_0x506639]){return RpcUser[_0x5bec('0x23')](_0x11fb8e[_0x5bec('0x8')][_0x506639]['id'])['then'](function(_0x232584){if(_0x232584&&!_0x232584['voicePause']){logger[_0x5bec('0x24')](_0x5bec('0x25'),_0x325daf,_0x506639,_0x773740);var _0x5b2636=_0x11fb8e[_0x5bec('0xa')][_0x325daf][_0x5bec('0x26')]&&_0x11fb8e['channels'][_0x325daf][_0x5bec('0x27')]?_0x11fb8e[_0x5bec('0xa')][_0x325daf][_0x5bec('0x27')]:_0x325daf;return RpcUser[_0x5bec('0x28')](_0x11fb8e[_0x5bec('0x8')][_0x506639],_0x6c0d35,_0x5b2636)[_0x5bec('0x22')](function(_0x2dc014){if(!_0x3cd354){_0x11fb8e['timers'][_0x506639]={};logger['info']('[%s][TIMER:%s][AGENT:%s][QUEUE:%s]',_0x325daf,_0x11fb8e[_0x5bec('0x7')][_0x773740][_0x5bec('0x29')],_0x506639,_0x773740);_0x11fb8e[_0x5bec('0x9')][_0x506639]['timer']=setTimeout(_0x11fb8e[_0x5bec('0x2a')][_0x5bec('0xd')](_0x11fb8e,_0x506639),_0x11fb8e['voiceQueues'][_0x773740][_0x5bec('0x29')]*0x3e8);_0x11fb8e[_0x5bec('0x9')][_0x506639]['lastPauseAt']=moment()['format'](_0x5bec('0x2b'));_0x11fb8e[_0x5bec('0x9')][_0x506639][_0x5bec('0x2c')]=_0x325daf;_0x11fb8e[_0x5bec('0x9')][_0x506639][_0x5bec('0x1d')]=_0x773740;_0x11fb8e[_0x5bec('0x9')][_0x506639]['updateAcw']=function(){var _0x2987ca=getDiff(_0x11fb8e['timers'][_0x506639][_0x5bec('0x2d')]);clearTimeout(_0x11fb8e[_0x5bec('0x9')][_0x506639][_0x5bec('0x2e')]);_0x11fb8e[_0x5bec('0x9')][_0x506639]['timer']=![];RpcVoiceAgentReport[_0x5bec('0x2f')]({'acwtime':_0x2987ca},_0x11fb8e[_0x5bec('0x9')][_0x506639][_0x5bec('0x2c')],_0x506639)['then'](function(_0xf6ae6b){logger['info'](_0x5bec('0x30'),_0x325daf,_0x2987ca,_0xf6ae6b);})[_0x5bec('0x31')](function(_0x29df14){logger['error'](_0x5bec('0x32'),_0x325daf,_0x29df14);});delete _0x11fb8e[_0x5bec('0x9')][_0x506639];};}});}else{logger['info'](_0x5bec('0x33'),_0x325daf,_0x506639,_0x773740);}});}})[_0x5bec('0x31')](function(_0x24aa2f){logger[_0x5bec('0x34')](_0x5bec('0x35'),_0x325daf,_0x11fb8e['voiceQueues'][_0x773740][_0x5bec('0x29')],_0x506639,_0x773740);})['finally'](function(){delete _0x11fb8e[_0x5bec('0xa')][_0x325daf];});}catch(_0x384f04){logger[_0x5bec('0x34')](_0x5bec('0x36'),_0x384f04[_0x5bec('0x37')]);}};Acw[_0x5bec('0x1a')]['stopAcw']=function(_0x1c6cc3){try{var _0xb515bb=this;if(_0xb515bb[_0x5bec('0x9')][_0x1c6cc3]){_0xb515bb['timers'][_0x1c6cc3][_0x5bec('0x2e')]=![];var _0x355707=_0xb515bb['timers'][_0x1c6cc3][_0x5bec('0x2c')];var _0x58c34e=_0xb515bb[_0x5bec('0x9')][_0x1c6cc3][_0x5bec('0x1d')];var _0x402e5d=_0xb515bb['voiceQueues'][_0x58c34e][_0x5bec('0x29')];logger[_0x5bec('0x24')](_0x5bec('0x38'),_0x1c6cc3);RpcUser[_0x5bec('0x39')](this[_0x5bec('0x8')][_0x1c6cc3]);RpcVoiceAgentReport[_0x5bec('0x2f')]({'acwtime':_0x402e5d,'agentacw':!![]},_0x355707,_0x1c6cc3)[_0x5bec('0x22')](function(_0x4a8b0b){logger[_0x5bec('0x24')](_0x5bec('0x30'),_0x355707,_0x402e5d,_0x4a8b0b);})[_0x5bec('0x31')](function(_0x414d59){logger['error'](_0x5bec('0x32'),_0x355707,_0x414d59);});}else{logger[_0x5bec('0x34')](_0x5bec('0x3a'),_0x1c6cc3);if(_0xb515bb['timers']){logger['info'](_0x5bec('0x3b'),JSON[_0x5bec('0x3c')](_0xb515bb[_0x5bec('0x9')]));}}}catch(_0x11f667){logger[_0x5bec('0x34')]('[ACW][STOP]\x20%s',_0x11f667['message']);}};Acw[_0x5bec('0x1a')]['syncAgentConnect']=function(_0x39597c){try{if(this[_0x5bec('0x7')][_0x39597c[_0x5bec('0x1d')]]&&(this['voiceQueues'][_0x39597c[_0x5bec('0x1d')]][_0x5bec('0x4')]||this['voiceQueues'][_0x39597c[_0x5bec('0x1d')]][_0x5bec('0x1e')])){if(this[_0x5bec('0x8')][_0x39597c[_0x5bec('0x1c')]]){this[_0x5bec('0xa')][_0x39597c[_0x5bec('0x2c')]]={'queue':_0x39597c[_0x5bec('0x1d')],'interface':_0x39597c['interface'],'destlinkedid':_0x39597c['destlinkedid']};}}}catch(_0x776912){logger['error']('[ACW][syncAgentConnect]\x20%s',_0x776912[_0x5bec('0x37')]);}};Acw['prototype']['syncAgentConnectPreview']=function(_0x48bff0){try{if(this[_0x5bec('0x7')][_0x48bff0[_0x5bec('0x1d')]]&&(this[_0x5bec('0x7')][_0x48bff0[_0x5bec('0x1d')]]['acw']||this[_0x5bec('0x7')][_0x48bff0[_0x5bec('0x1d')]][_0x5bec('0x1e')])){if(this[_0x5bec('0x8')][_0x48bff0['interface']]){this[_0x5bec('0xa')][_0x48bff0[_0x5bec('0x2c')]]={'queue':_0x48bff0[_0x5bec('0x1d')],'interface':_0x48bff0['interface']};}}}catch(_0x2752ba){logger['error'](_0x5bec('0x3d'),_0x2752ba[_0x5bec('0x37')]);}};Acw[_0x5bec('0x1a')][_0x5bec('0xf')]=function(_0x54b11a){try{if(this[_0x5bec('0xa')][_0x54b11a[_0x5bec('0x2c')]]&&_[_0x5bec('0x3e')](this[_0x5bec('0xa')][_0x54b11a[_0x5bec('0x2c')]][_0x5bec('0x26')])){logger[_0x5bec('0x24')]('[%s][HANGUP:UNIQUEID]',_0x54b11a[_0x5bec('0x2c')]);this[_0x5bec('0x1b')](_0x54b11a['uniqueid']);}else if(this[_0x5bec('0xa')][_0x54b11a[_0x5bec('0x3f')]]&&_[_0x5bec('0x3e')](this[_0x5bec('0xa')][_0x54b11a[_0x5bec('0x3f')]][_0x5bec('0x26')])){logger[_0x5bec('0x24')]('[%s][HANGUP:LINKEDID]',_0x54b11a[_0x5bec('0x3f')]);this['startAcw'](_0x54b11a[_0x5bec('0x3f')]);}}catch(_0x208c7b){logger[_0x5bec('0x34')](_0x5bec('0x40'),_0x208c7b[_0x5bec('0x37')]);}};Acw[_0x5bec('0x1a')][_0x5bec('0x41')]=function(_0x3bc0c9){try{if(this[_0x5bec('0xa')][_0x3bc0c9[_0x5bec('0x2c')]]&&this['channels'][_0x3bc0c9[_0x5bec('0x2c')]]['attended']){logger['info'](_0x5bec('0x42'),_0x3bc0c9['uniqueid']);this['startAcw'](_0x3bc0c9[_0x5bec('0x2c')]);}else if(this[_0x5bec('0xa')][_0x3bc0c9[_0x5bec('0x3f')]]&&this['channels'][_0x3bc0c9[_0x5bec('0x3f')]][_0x5bec('0x26')]){logger[_0x5bec('0x24')](_0x5bec('0x43'),_0x3bc0c9['linkedid']);this[_0x5bec('0x1b')](_0x3bc0c9[_0x5bec('0x3f')]);}}catch(_0x9cae50){logger[_0x5bec('0x34')](_0x5bec('0x44'),_0x9cae50[_0x5bec('0x37')]);}};Acw[_0x5bec('0x1a')]['syncAttendedTransfer']=function(_0x504dda){try{if(!_[_0x5bec('0x45')](this['channels'][_0x504dda[_0x5bec('0x46')]])){this[_0x5bec('0x1b')](_0x504dda['transfereeuniqueid']);if(this[_0x5bec('0xa')][_0x504dda['secondtransfereruniqueid']]){this[_0x5bec('0xa')][_0x504dda[_0x5bec('0x47')]][_0x5bec('0x26')]=!![];this[_0x5bec('0xa')][_0x504dda[_0x5bec('0x48')]]=this[_0x5bec('0xa')][_0x504dda[_0x5bec('0x47')]];delete this[_0x5bec('0xa')][_0x504dda[_0x5bec('0x47')]];}}else if(!_[_0x5bec('0x45')](this[_0x5bec('0xa')][_0x504dda[_0x5bec('0x48')]])){this[_0x5bec('0x1b')](_0x504dda[_0x5bec('0x48')]);if(this['channels'][_0x504dda[_0x5bec('0x49')]]){this[_0x5bec('0xa')][_0x504dda[_0x5bec('0x49')]]['attended']=!![];this[_0x5bec('0xa')][_0x504dda[_0x5bec('0x46')]]=this[_0x5bec('0xa')][_0x504dda[_0x5bec('0x49')]];delete this[_0x5bec('0xa')][_0x504dda['origtransfereruniqueid']];}}}catch(_0x3e3108){logger[_0x5bec('0x34')](_0x5bec('0x4a'),_0x3e3108[_0x5bec('0x37')]);}};Acw['prototype'][_0x5bec('0x15')]=function(_0x5dda24){try{if(this[_0x5bec('0xa')][_0x5dda24[_0x5bec('0x4b')]]){logger[_0x5bec('0x24')](_0x5bec('0x4c'),JSON['stringify'](_0x5dda24[_0x5bec('0x4b')]));this[_0x5bec('0x1b')](_0x5dda24[_0x5bec('0x4b')]);}else if(this[_0x5bec('0xa')][_0x5dda24[_0x5bec('0x4d')]]){logger[_0x5bec('0x24')](_0x5bec('0x4e'),JSON[_0x5bec('0x3c')](_0x5dda24[_0x5bec('0x4d')]));this[_0x5bec('0x1b')](_0x5dda24[_0x5bec('0x4d')]);}}catch(_0x42d4e4){logger[_0x5bec('0x34')](_0x5bec('0x4f'),_0x42d4e4[_0x5bec('0x37')]);}};Acw['prototype'][_0x5bec('0x12')]=function(_0x27c160){try{if(this['voiceQueues'][_0x27c160[_0x5bec('0x1d')]]&&this['voiceQueues'][_0x27c160[_0x5bec('0x1d')]][_0x5bec('0x50')]==='all'){if(this['agents'][_0x27c160[_0x5bec('0x1c')]]){logger[_0x5bec('0x24')](_0x5bec('0x51'),_0x27c160[_0x5bec('0x2c')],_0x27c160[_0x5bec('0x1c')],_0x27c160['queue']);return RpcUser[_0x5bec('0x28')](this[_0x5bec('0x8')][_0x27c160['interface']],_0x5bec('0x52'),_0x27c160[_0x5bec('0x2c')]);}}}catch(_0x44a945){logger[_0x5bec('0x34')]('[ACW][syncAgentRingNoAnswer]\x20%s',_0x44a945[_0x5bec('0x37')]);}};module['exports']=Acw;
\ No newline at end of file
diff --git a/server/services/ami/ami.js b/server/services/ami/ami.js
index 2093c30..8b54d1b 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 _0x5833=['ami','../../config/environment','asterisk','port','password','keepConnected','Action','action','error','format','username','Manager\x20\x22%s\x22\x20closed\x20to\x20%s:%s','actionSipShowRegistry','actionDeviceStateList','devicestatelist','actionSipPeerStatus','actionQueueSummary','queuesummary','actionCoreShowChannels','coreshowchannels','Manager\x20\x22%s\x22\x20logged\x20on\x20to\x20%s:%s','once','close','connect','shutdown','info','Shutdown\x20\x22%s\x22\x20to\x20%s:%s\x20with:\x0a%s','fullybooted','resolve','then','log','exports','asterisk-manager','bluebird','moment','util','lodash'];(function(_0x306e33,_0x1e7f30){var _0x304318=function(_0x4dcc52){while(--_0x4dcc52){_0x306e33['push'](_0x306e33['shift']());}};_0x304318(++_0x1e7f30);}(_0x5833,0xd9));var _0x3583=function(_0xbc87f4,_0x50ec86){_0xbc87f4=_0xbc87f4-0x0;var _0x71644=_0x5833[_0xbc87f4];return _0x71644;};'use strict';var Manager=require(_0x3583('0x0'));var BPromise=require(_0x3583('0x1'));var moment=require(_0x3583('0x2'));var util=require(_0x3583('0x3'));var _=require(_0x3583('0x4'));var logger=require('../../config/logger')(_0x3583('0x5'));var config=require(_0x3583('0x6'));var ami=new Manager(config[_0x3583('0x7')][_0x3583('0x8')],config['asterisk']['ip'],config[_0x3583('0x7')]['username'],config[_0x3583('0x7')][_0x3583('0x9')],!![]);ami[_0x3583('0xa')]();ami[_0x3583('0xb')]=BPromise['promisify'](ami[_0x3583('0xc')]);function error(_0x5bd737){logger[_0x3583('0xd')](util[_0x3583('0xe')]('Manager\x20\x22%s\x22\x20error\x20to\x20%s:%s\x20with:\x0a%s',config['asterisk'][_0x3583('0xf')],config[_0x3583('0x7')]['ip'],config[_0x3583('0x7')][_0x3583('0x8')],util['inspect'](_0x5bd737,![],null)));}function close(){logger[_0x3583('0xd')](util[_0x3583('0xe')](_0x3583('0x10'),config['asterisk'][_0x3583('0xf')],config['asterisk']['ip'],config[_0x3583('0x7')][_0x3583('0x8')]));}ami[_0x3583('0x11')]=function(){return function(){return ami[_0x3583('0xb')]({'action':'sipshowregistry'});};};ami[_0x3583('0x12')]=function(){return function(){return ami[_0x3583('0xb')]({'action':_0x3583('0x13')});};};ami[_0x3583('0x14')]=function(){return function(){return ami[_0x3583('0xb')]({'action':'sippeerstatus'});};};ami[_0x3583('0x15')]=function(){return function(){return ami['Action']({'action':_0x3583('0x16')});};};ami[_0x3583('0x17')]=function(){return function(){return ami[_0x3583('0xb')]({'action':_0x3583('0x18')});};};function connect(_0x26c8bc){logger['info'](util[_0x3583('0xe')](_0x3583('0x19'),config['asterisk'][_0x3583('0xf')],config[_0x3583('0x7')]['ip'],config['asterisk'][_0x3583('0x8')]));ami[_0x3583('0x1a')]('error',error);ami[_0x3583('0x1a')](_0x3583('0x1b'),close);}ami['on'](_0x3583('0x1c'),connect);ami['on'](_0x3583('0x1d'),function(_0x303573){logger[_0x3583('0x1e')](util['format'](_0x3583('0x1f'),config[_0x3583('0x7')][_0x3583('0xf')],config[_0x3583('0x7')]['ip'],config[_0x3583('0x7')]['port'],util['inspect'](_0x303573,![],null)));});ami['on'](_0x3583('0x20'),function(_0x429d97){logger[_0x3583('0x1e')](util[_0x3583('0xe')]('Fullybooted\x20\x22%s\x22\x20to\x20%s:%s',config[_0x3583('0x7')][_0x3583('0xf')],config[_0x3583('0x7')]['ip'],config['asterisk']['port']));return BPromise[_0x3583('0x21')]()[_0x3583('0x22')](ami[_0x3583('0x11')]())[_0x3583('0x22')](ami['actionDeviceStateList']())[_0x3583('0x22')](ami[_0x3583('0x14')]())[_0x3583('0x22')](ami['actionQueueSummary']())[_0x3583('0x22')](ami[_0x3583('0x17')]())['catch'](function(_0x3a3cc9){console[_0x3583('0x23')](_0x3a3cc9);});});ami[_0x3583('0x1a')](_0x3583('0xd'),error);ami[_0x3583('0x1a')](_0x3583('0x1b'),close);module[_0x3583('0x24')]=ami;
\ No newline at end of file
+var _0xbd18=['username','password','keepConnected','Action','action','error','format','inspect','Manager\x20\x22%s\x22\x20closed\x20to\x20%s:%s','actionSipShowRegistry','sipshowregistry','actionDeviceStateList','devicestatelist','actionSipPeerStatus','actionQueueSummary','queuesummary','actionCoreShowChannels','coreshowchannels','Manager\x20\x22%s\x22\x20logged\x20on\x20to\x20%s:%s','once','close','connect','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','catch','log','exports','bluebird','moment','util','lodash','../../config/logger','../../config/environment','asterisk','port'];(function(_0x2c7e03,_0x5b8cc3){var _0x310885=function(_0xdb0446){while(--_0xdb0446){_0x2c7e03['push'](_0x2c7e03['shift']());}};_0x310885(++_0x5b8cc3);}(_0xbd18,0xe2));var _0x8bd1=function(_0x42dfed,_0x26b1d7){_0x42dfed=_0x42dfed-0x0;var _0x22bdf7=_0xbd18[_0x42dfed];return _0x22bdf7;};'use strict';var Manager=require('asterisk-manager');var BPromise=require(_0x8bd1('0x0'));var moment=require(_0x8bd1('0x1'));var util=require(_0x8bd1('0x2'));var _=require(_0x8bd1('0x3'));var logger=require(_0x8bd1('0x4'))('ami');var config=require(_0x8bd1('0x5'));var ami=new Manager(config[_0x8bd1('0x6')][_0x8bd1('0x7')],config['asterisk']['ip'],config[_0x8bd1('0x6')][_0x8bd1('0x8')],config[_0x8bd1('0x6')][_0x8bd1('0x9')],!![]);ami[_0x8bd1('0xa')]();ami[_0x8bd1('0xb')]=BPromise['promisify'](ami[_0x8bd1('0xc')]);function error(_0x49583e){logger[_0x8bd1('0xd')](util[_0x8bd1('0xe')]('Manager\x20\x22%s\x22\x20error\x20to\x20%s:%s\x20with:\x0a%s',config[_0x8bd1('0x6')][_0x8bd1('0x8')],config[_0x8bd1('0x6')]['ip'],config[_0x8bd1('0x6')][_0x8bd1('0x7')],util[_0x8bd1('0xf')](_0x49583e,![],null)));}function close(){logger[_0x8bd1('0xd')](util[_0x8bd1('0xe')](_0x8bd1('0x10'),config['asterisk'][_0x8bd1('0x8')],config['asterisk']['ip'],config['asterisk'][_0x8bd1('0x7')]));}ami[_0x8bd1('0x11')]=function(){return function(){return ami['Action']({'action':_0x8bd1('0x12')});};};ami[_0x8bd1('0x13')]=function(){return function(){return ami[_0x8bd1('0xb')]({'action':_0x8bd1('0x14')});};};ami[_0x8bd1('0x15')]=function(){return function(){return ami[_0x8bd1('0xb')]({'action':'sippeerstatus'});};};ami[_0x8bd1('0x16')]=function(){return function(){return ami[_0x8bd1('0xb')]({'action':_0x8bd1('0x17')});};};ami[_0x8bd1('0x18')]=function(){return function(){return ami[_0x8bd1('0xb')]({'action':_0x8bd1('0x19')});};};function connect(_0x3e476d){logger['info'](util['format'](_0x8bd1('0x1a'),config[_0x8bd1('0x6')]['username'],config[_0x8bd1('0x6')]['ip'],config[_0x8bd1('0x6')][_0x8bd1('0x7')]));ami[_0x8bd1('0x1b')]('error',error);ami[_0x8bd1('0x1b')](_0x8bd1('0x1c'),close);}ami['on'](_0x8bd1('0x1d'),connect);ami['on']('shutdown',function(_0x5456c6){logger[_0x8bd1('0x1e')](util[_0x8bd1('0xe')](_0x8bd1('0x1f'),config[_0x8bd1('0x6')][_0x8bd1('0x8')],config[_0x8bd1('0x6')]['ip'],config['asterisk']['port'],util[_0x8bd1('0xf')](_0x5456c6,![],null)));});ami['on'](_0x8bd1('0x20'),function(_0x430d2b){logger['info'](util[_0x8bd1('0xe')](_0x8bd1('0x21'),config[_0x8bd1('0x6')][_0x8bd1('0x8')],config[_0x8bd1('0x6')]['ip'],config['asterisk'][_0x8bd1('0x7')]));return BPromise[_0x8bd1('0x22')]()[_0x8bd1('0x23')](ami[_0x8bd1('0x11')]())[_0x8bd1('0x23')](ami['actionDeviceStateList']())['then'](ami['actionSipPeerStatus']())[_0x8bd1('0x23')](ami[_0x8bd1('0x16')]())[_0x8bd1('0x23')](ami['actionCoreShowChannels']())[_0x8bd1('0x24')](function(_0x13405a){console[_0x8bd1('0x25')](_0x13405a);});});ami[_0x8bd1('0x1b')](_0x8bd1('0xd'),error);ami['once'](_0x8bd1('0x1c'),close);module[_0x8bd1('0x26')]=ami;
\ No newline at end of file
diff --git a/server/services/ami/client.js b/server/services/ami/client.js
index bc17aa8..b9e40aa 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 _0xcd8e=['error','message','result','catch','exports','jayson/promise','bluebird','../../config/logger','ami','client','http','Request','request','then','debug','rpc','memberReport'];(function(_0x3b5c2d,_0x330d14){var _0x107e2d=function(_0x5e7659){while(--_0x5e7659){_0x3b5c2d['push'](_0x3b5c2d['shift']());}};_0x107e2d(++_0x330d14);}(_0xcd8e,0x1e1));var _0xecd8=function(_0x501510,_0x61caa9){_0x501510=_0x501510-0x0;var _0x1e6ee5=_0xcd8e[_0x501510];return _0x1e6ee5;};'use strict';var jayson=require(_0xecd8('0x0'));var BPromise=require(_0xecd8('0x1'));var logger=require(_0xecd8('0x2'))(_0xecd8('0x3'));var client=jayson[_0xecd8('0x4')][_0xecd8('0x5')]({'port':0x2329});client[_0xecd8('0x6')]=function(_0x456b3c,_0x145165){return new BPromise(function(_0x3ff570,_0x39dbf8){return client[_0xecd8('0x7')](_0x456b3c,_0x145165)[_0xecd8('0x8')](function(_0x5eec00){logger[_0xecd8('0x9')](_0xecd8('0xa'),_0xecd8('0xb'),_0x456b3c,_0x145165,_0x5eec00);if(_0x5eec00[_0xecd8('0xc')]){logger['error']('rpc',_0xecd8('0xb'),_0x456b3c,_0x5eec00[_0xecd8('0xc')][_0xecd8('0xd')],_0x145165);return _0x39dbf8(_0x5eec00[_0xecd8('0xc')]['message']);}else{return _0x3ff570(_0x5eec00[_0xecd8('0xe')]);}})[_0xecd8('0xf')](function(_0x9bb5fb){logger['error']('rpc','memberReport',_0x456b3c,_0x9bb5fb,_0x145165);return _0x39dbf8(_0x9bb5fb);});});};module[_0xecd8('0x10')]=client;
\ No newline at end of file
+var _0xe9e1=['Request','request','then','memberReport','error','result','catch','rpc','exports','bluebird','../../config/logger','ami','client'];(function(_0x14add3,_0x13ce8d){var _0x4a174f=function(_0x2b3ed7){while(--_0x2b3ed7){_0x14add3['push'](_0x14add3['shift']());}};_0x4a174f(++_0x13ce8d);}(_0xe9e1,0x15b));var _0x1e9e=function(_0x450897,_0x3a7927){_0x450897=_0x450897-0x0;var _0x27902e=_0xe9e1[_0x450897];return _0x27902e;};'use strict';var jayson=require('jayson/promise');var BPromise=require(_0x1e9e('0x0'));var logger=require(_0x1e9e('0x1'))(_0x1e9e('0x2'));var client=jayson[_0x1e9e('0x3')]['http']({'port':0x2329});client[_0x1e9e('0x4')]=function(_0x1889ad,_0x29fb82){return new BPromise(function(_0x4a222c,_0x3c7078){return client[_0x1e9e('0x5')](_0x1889ad,_0x29fb82)[_0x1e9e('0x6')](function(_0x1930df){logger['debug']('rpc',_0x1e9e('0x7'),_0x1889ad,_0x29fb82,_0x1930df);if(_0x1930df['error']){logger[_0x1e9e('0x8')]('rpc',_0x1e9e('0x7'),_0x1889ad,_0x1930df[_0x1e9e('0x8')]['message'],_0x29fb82);return _0x3c7078(_0x1930df[_0x1e9e('0x8')]['message']);}else{return _0x4a222c(_0x1930df[_0x1e9e('0x9')]);}})[_0x1e9e('0xa')](function(_0x383865){logger['error'](_0x1e9e('0xb'),_0x1e9e('0x7'),_0x1889ad,_0x383865,_0x29fb82);return _0x3c7078(_0x383865);});});};module[_0x1e9e('0xc')]=client;
\ No newline at end of file
diff --git a/server/services/ami/dialer/action.js b/server/services/ami/dialer/action.js
index 6cdf1f7..8e75272 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 _0xbaa8=['countdropretry','countabandonedretry','countmachineretry','countagentrejectretry','ContactId','ListId','VoiceQueueId','CampaignId','idHopper','ContactFirstName','starttime','format','callback','callbackuniqueid','callbackat','recallme','originatecalleridnum','originatecalleridname','prototype','getCaller','\x22%s\x22\x20<%s>','dialCutDigit','substring','getQueue','queue','exports','util','lodash','moment','isNil','name','Contact','phone','firstName','lastName','number','active','type','dialQueueTimeout','scheduledat','countbusyretry','countcongestionretry','countnoanswerretry','countnosuchnumberretry'];(function(_0x148941,_0x88dbd7){var _0x22c39f=function(_0x3a7003){while(--_0x3a7003){_0x148941['push'](_0x148941['shift']());}};_0x22c39f(++_0x88dbd7);}(_0xbaa8,0x1d2));var _0x8baa=function(_0x3bdae7,_0x1f80ea){_0x3bdae7=_0x3bdae7-0x0;var _0x28786b=_0xbaa8[_0x3bdae7];return _0x28786b;};'use strict';var util=require(_0x8baa('0x0'));var _=require(_0x8baa('0x1'));var moment=require(_0x8baa('0x2'));function checkNameSurname(_0x195276,_0x403bae,_0x45e12e){var _0x4063cb='';if(!_['isNil'](_0x403bae)&&'string'===typeof _0x403bae){_0x4063cb+=_0x403bae;}if(!_[_0x8baa('0x3')](_0x45e12e)&&'string'===typeof _0x45e12e){_0x4063cb+='\x20'+_0x45e12e;}if(_0x4063cb!==''){return _0x4063cb;}return _0x195276;}function Action(_0x1bba78,_0x5535c3,_0x33ce59){this['voiceQueue']=_0x1bba78;this['uniqueid']=_0x33ce59||undefined;this[_0x8baa('0x4')]=checkNameSurname(_0x5535c3[_0x8baa('0x5')][_0x8baa('0x6')],_0x5535c3[_0x8baa('0x5')][_0x8baa('0x7')],_0x5535c3['Contact'][_0x8baa('0x8')]);this[_0x8baa('0x9')]=_0x5535c3[_0x8baa('0x5')]['phone'];this['queue']=_0x1bba78['name'];this[_0x8baa('0xa')]=_0x5535c3['active']||![];this[_0x8baa('0xb')]=_0x1bba78[_0x8baa('0xb')];this[_0x8baa('0xc')]=_0x1bba78['dialQueueTimeout']||0x3;this[_0x8baa('0xd')]=_0x5535c3[_0x8baa('0xd')];this[_0x8baa('0xe')]=_0x5535c3[_0x8baa('0xe')];this[_0x8baa('0xf')]=_0x5535c3[_0x8baa('0xf')];this['countnoanswerretry']=_0x5535c3[_0x8baa('0x10')];this[_0x8baa('0x11')]=_0x5535c3[_0x8baa('0x11')];this[_0x8baa('0x12')]=_0x5535c3[_0x8baa('0x12')];this[_0x8baa('0x13')]=_0x5535c3[_0x8baa('0x13')];this[_0x8baa('0x14')]=_0x5535c3[_0x8baa('0x14')];this[_0x8baa('0x15')]=_0x5535c3[_0x8baa('0x15')];this[_0x8baa('0x16')]=_0x5535c3[_0x8baa('0x16')];this[_0x8baa('0x17')]=_0x5535c3[_0x8baa('0x17')];this['UserId']=_0x5535c3['UserId'];this[_0x8baa('0x18')]=_0x5535c3['VoiceQueueId'];this['CampaignId']=_0x5535c3[_0x8baa('0x19')];this[_0x8baa('0x1a')]=_0x5535c3['id'];this[_0x8baa('0x1b')]=_0x5535c3[_0x8baa('0x5')][_0x8baa('0x7')]||'';this[_0x8baa('0x1c')]=moment()[_0x8baa('0x1d')]('YYYY-MM-DD\x20HH:mm:ss');this[_0x8baa('0x1e')]=_0x5535c3[_0x8baa('0x1e')];this['callbackuniqueid']=_0x5535c3[_0x8baa('0x1f')];this['callbackat']=_0x5535c3[_0x8baa('0x20')];this[_0x8baa('0x21')]=_0x5535c3[_0x8baa('0x21')];this[_0x8baa('0x22')]='';this[_0x8baa('0x23')]='';}Action[_0x8baa('0x24')][_0x8baa('0x25')]=function(){return util[_0x8baa('0x1d')](_0x8baa('0x26'),this[_0x8baa('0x4')],this['voiceQueue'][_0x8baa('0x27')]>0x0?this[_0x8baa('0x9')][_0x8baa('0x28')](this['voiceQueue'][_0x8baa('0x27')]):this['number']);};Action[_0x8baa('0x24')][_0x8baa('0x29')]=function(){return this[_0x8baa('0x2a')];};module[_0x8baa('0x2b')]=Action;
\ No newline at end of file
+var _0x0b41=['UserId','VoiceQueueId','CampaignId','idHopper','ContactFirstName','starttime','format','callback','callbackuniqueid','callbackat','recallme','originatecalleridname','prototype','getCaller','\x22%s\x22\x20<%s>','dialCutDigit','getQueue','exports','util','moment','isNil','string','voiceQueue','uniqueid','name','Contact','phone','firstName','lastName','number','queue','active','type','scheduledat','countbusyretry','countcongestionretry','countnoanswerretry','countnosuchnumberretry','countdropretry','countabandonedretry','countmachineretry','countagentrejectretry','ContactId','ListId'];(function(_0x1693e4,_0x465a6e){var _0xdae816=function(_0x52e01a){while(--_0x52e01a){_0x1693e4['push'](_0x1693e4['shift']());}};_0xdae816(++_0x465a6e);}(_0x0b41,0x6a));var _0x10b4=function(_0x342ff0,_0x58ccbf){_0x342ff0=_0x342ff0-0x0;var _0x4e95a1=_0x0b41[_0x342ff0];return _0x4e95a1;};'use strict';var util=require(_0x10b4('0x0'));var _=require('lodash');var moment=require(_0x10b4('0x1'));function checkNameSurname(_0x9189f7,_0x5f3552,_0x9abb2c){var _0x23f353='';if(!_[_0x10b4('0x2')](_0x5f3552)&&'string'===typeof _0x5f3552){_0x23f353+=_0x5f3552;}if(!_[_0x10b4('0x2')](_0x9abb2c)&&_0x10b4('0x3')===typeof _0x9abb2c){_0x23f353+='\x20'+_0x9abb2c;}if(_0x23f353!==''){return _0x23f353;}return _0x9189f7;}function Action(_0x1208dc,_0x277f6c,_0x22f6a1){this[_0x10b4('0x4')]=_0x1208dc;this[_0x10b4('0x5')]=_0x22f6a1||undefined;this[_0x10b4('0x6')]=checkNameSurname(_0x277f6c[_0x10b4('0x7')][_0x10b4('0x8')],_0x277f6c[_0x10b4('0x7')][_0x10b4('0x9')],_0x277f6c[_0x10b4('0x7')][_0x10b4('0xa')]);this[_0x10b4('0xb')]=_0x277f6c[_0x10b4('0x7')][_0x10b4('0x8')];this[_0x10b4('0xc')]=_0x1208dc['name'];this['active']=_0x277f6c[_0x10b4('0xd')]||![];this['type']=_0x1208dc[_0x10b4('0xe')];this['dialQueueTimeout']=_0x1208dc['dialQueueTimeout']||0x3;this[_0x10b4('0xf')]=_0x277f6c['scheduledat'];this[_0x10b4('0x10')]=_0x277f6c[_0x10b4('0x10')];this[_0x10b4('0x11')]=_0x277f6c[_0x10b4('0x11')];this[_0x10b4('0x12')]=_0x277f6c[_0x10b4('0x12')];this[_0x10b4('0x13')]=_0x277f6c[_0x10b4('0x13')];this[_0x10b4('0x14')]=_0x277f6c[_0x10b4('0x14')];this[_0x10b4('0x15')]=_0x277f6c['countabandonedretry'];this[_0x10b4('0x16')]=_0x277f6c['countmachineretry'];this[_0x10b4('0x17')]=_0x277f6c[_0x10b4('0x17')];this[_0x10b4('0x18')]=_0x277f6c[_0x10b4('0x18')];this[_0x10b4('0x19')]=_0x277f6c[_0x10b4('0x19')];this['UserId']=_0x277f6c[_0x10b4('0x1a')];this['VoiceQueueId']=_0x277f6c[_0x10b4('0x1b')];this[_0x10b4('0x1c')]=_0x277f6c[_0x10b4('0x1c')];this[_0x10b4('0x1d')]=_0x277f6c['id'];this[_0x10b4('0x1e')]=_0x277f6c[_0x10b4('0x7')]['firstName']||'';this[_0x10b4('0x1f')]=moment()[_0x10b4('0x20')]('YYYY-MM-DD\x20HH:mm:ss');this[_0x10b4('0x21')]=_0x277f6c[_0x10b4('0x21')];this['callbackuniqueid']=_0x277f6c[_0x10b4('0x22')];this[_0x10b4('0x23')]=_0x277f6c[_0x10b4('0x23')];this[_0x10b4('0x24')]=_0x277f6c['recallme'];this['originatecalleridnum']='';this[_0x10b4('0x25')]='';}Action[_0x10b4('0x26')][_0x10b4('0x27')]=function(){return util[_0x10b4('0x20')](_0x10b4('0x28'),this['name'],this[_0x10b4('0x4')][_0x10b4('0x29')]>0x0?this[_0x10b4('0xb')]['substring'](this[_0x10b4('0x4')][_0x10b4('0x29')]):this[_0x10b4('0xb')]);};Action[_0x10b4('0x26')][_0x10b4('0x2a')]=function(){return this[_0x10b4('0xc')];};module[_0x10b4('0x2b')]=Action;
\ No newline at end of file
diff --git a/server/services/ami/dialer/agentComplete.js b/server/services/ami/dialer/agentComplete.js
index 02e6b97..166e4e2 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 _0x442a=['answertime','endtime','YYYY-MM-DD\x20HH:mm:ss','ringtime','talktime','membername','reason','callback','callbackuniqueid','callbackat','recallme','ContactId','ListId','UserId','VoiceQueueId','CampaignId','originatecalleridnum','originatecalleridname','util','lodash','milliseconds','seconds','statedesc','Answer','scheduledat','campaigntype','type','outbound','queue','countcongestionretry','countnoanswerretry','countglobal','countbusyretry','countnosuchnumberretry','countabandonedretry','countmachineretry','countdropretry','countagentrejectretry','uniqueid','calleridname','name','calleridnum','number','starttime','responsetime'];(function(_0x3395bb,_0x35aedf){var _0x4deeaa=function(_0x2c1d9b){while(--_0x2c1d9b){_0x3395bb['push'](_0x3395bb['shift']());}};_0x4deeaa(++_0x35aedf);}(_0x442a,0x17a));var _0xa442=function(_0x202d24,_0x5e8641){_0x202d24=_0x202d24-0x0;var _0x2b3a8e=_0x442a[_0x202d24];return _0x2b3a8e;};'use strict';var util=require(_0xa442('0x0'));var _=require(_0xa442('0x1'));var moment=require('moment');function getSeconds(_0xb2992,_0x20d27a){var _0x375f3d=moment(_0xb2992)[_0xa442('0x2')](0x0);var _0x5499b7=moment(_0x20d27a)['milliseconds'](0x0);return _0x375f3d['diff'](_0x5499b7,_0xa442('0x3'));}function AgentComplete(_0x2df33b,_0x3e0460){this['state']=0x4;this[_0xa442('0x4')]=_0xa442('0x5');this[_0xa442('0x6')]=_0x2df33b['scheduledat'];this['type']=_0x2df33b['type'];this[_0xa442('0x7')]=_0x2df33b[_0xa442('0x8')]===_0xa442('0x9')?_0xa442('0xa'):_0x2df33b['type'];this['countbusyretry']=_0x2df33b['countbusyretry'];this[_0xa442('0xb')]=_0x2df33b[_0xa442('0xb')];this['countnoanswerretry']=_0x2df33b[_0xa442('0xc')];this[_0xa442('0xd')]=_0x2df33b[_0xa442('0xe')]+_0x2df33b[_0xa442('0xb')]+_0x2df33b[_0xa442('0xc')]+_0x2df33b[_0xa442('0xf')]+_0x2df33b['countdropretry']+_0x2df33b[_0xa442('0x10')]+_0x2df33b[_0xa442('0x11')]+_0x2df33b['countagentrejectretry'];this[_0xa442('0xf')]=_0x2df33b['countnosuchnumberretry'];this[_0xa442('0x12')]=_0x2df33b['countdropretry'];this['countabandonedretry']=_0x2df33b['countabandonedretry'];this[_0xa442('0x11')]=_0x2df33b['countmachineretry'];this[_0xa442('0x13')]=_0x2df33b['countagentrejectretry'];this[_0xa442('0x14')]=_0x3e0460[_0xa442('0x14')];this[_0xa442('0x15')]=_0x2df33b[_0xa442('0x16')];this[_0xa442('0x17')]=_0x2df33b[_0xa442('0x18')];this[_0xa442('0x19')]=_0x2df33b[_0xa442('0x19')];this[_0xa442('0x1a')]=_0x2df33b[_0xa442('0x1a')];this[_0xa442('0x1b')]=_0x2df33b[_0xa442('0x1b')];this[_0xa442('0x1c')]=moment()['format'](_0xa442('0x1d'));this[_0xa442('0x1e')]=getSeconds(_0x2df33b[_0xa442('0x1a')],_0x2df33b[_0xa442('0x19')]);this['holdtime']=getSeconds(_0x2df33b['answertime'],_0x2df33b['responsetime']);this[_0xa442('0x1f')]=getSeconds(this[_0xa442('0x1c')],_0x2df33b['answertime']);this[_0xa442('0xa')]=_0x3e0460[_0xa442('0xa')];this['membername']=_0x3e0460[_0xa442('0x20')];this['reason']=_0x3e0460[_0xa442('0x21')];this['callback']=_0x2df33b[_0xa442('0x22')];this[_0xa442('0x23')]=_0x2df33b['callbackuniqueid'];this[_0xa442('0x24')]=_0x2df33b[_0xa442('0x24')];this[_0xa442('0x25')]=_0x2df33b['recallme'];this[_0xa442('0x26')]=_0x2df33b[_0xa442('0x26')];this['ListId']=_0x2df33b[_0xa442('0x27')];this[_0xa442('0x28')]=_0x2df33b[_0xa442('0x28')];this[_0xa442('0x29')]=_0x2df33b['VoiceQueueId'];this[_0xa442('0x2a')]=_0x2df33b[_0xa442('0x2a')];this[_0xa442('0x2b')]=_0x2df33b[_0xa442('0x2b')]||'';this[_0xa442('0x2c')]=_0x2df33b[_0xa442('0x2c')]||'';}module['exports']=AgentComplete;
\ No newline at end of file
+var _0x68a9=['callbackat','recallme','ContactId','ListId','UserId','VoiceQueueId','CampaignId','originatecalleridnum','originatecalleridname','exports','lodash','milliseconds','diff','state','statedesc','Answer','scheduledat','type','campaigntype','outbound','queue','countbusyretry','countcongestionretry','countnoanswerretry','countglobal','countnosuchnumberretry','countabandonedretry','countmachineretry','countagentrejectretry','countdropretry','calleridname','name','number','responsetime','answertime','format','YYYY-MM-DD\x20HH:mm:ss','ringtime','starttime','talktime','membername','reason','callback','callbackuniqueid'];(function(_0x2e5cbf,_0x538abd){var _0xf5577b=function(_0x28b8e1){while(--_0x28b8e1){_0x2e5cbf['push'](_0x2e5cbf['shift']());}};_0xf5577b(++_0x538abd);}(_0x68a9,0x1c2));var _0x968a=function(_0x5447fd,_0x52a6b5){_0x5447fd=_0x5447fd-0x0;var _0x15b28a=_0x68a9[_0x5447fd];return _0x15b28a;};'use strict';var util=require('util');var _=require(_0x968a('0x0'));var moment=require('moment');function getSeconds(_0x59f3f8,_0x2c4dbf){var _0x39fb83=moment(_0x59f3f8)[_0x968a('0x1')](0x0);var _0x1e77e6=moment(_0x2c4dbf)[_0x968a('0x1')](0x0);return _0x39fb83[_0x968a('0x2')](_0x1e77e6,'seconds');}function AgentComplete(_0x487a8f,_0x57acac){this[_0x968a('0x3')]=0x4;this[_0x968a('0x4')]=_0x968a('0x5');this[_0x968a('0x6')]=_0x487a8f[_0x968a('0x6')];this['type']=_0x487a8f[_0x968a('0x7')];this[_0x968a('0x8')]=_0x487a8f[_0x968a('0x7')]===_0x968a('0x9')?_0x968a('0xa'):_0x487a8f['type'];this[_0x968a('0xb')]=_0x487a8f[_0x968a('0xb')];this[_0x968a('0xc')]=_0x487a8f[_0x968a('0xc')];this[_0x968a('0xd')]=_0x487a8f[_0x968a('0xd')];this[_0x968a('0xe')]=_0x487a8f[_0x968a('0xb')]+_0x487a8f[_0x968a('0xc')]+_0x487a8f[_0x968a('0xd')]+_0x487a8f[_0x968a('0xf')]+_0x487a8f['countdropretry']+_0x487a8f[_0x968a('0x10')]+_0x487a8f[_0x968a('0x11')]+_0x487a8f[_0x968a('0x12')];this[_0x968a('0xf')]=_0x487a8f[_0x968a('0xf')];this[_0x968a('0x13')]=_0x487a8f[_0x968a('0x13')];this['countabandonedretry']=_0x487a8f['countabandonedretry'];this['countmachineretry']=_0x487a8f[_0x968a('0x11')];this[_0x968a('0x12')]=_0x487a8f[_0x968a('0x12')];this['uniqueid']=_0x57acac['uniqueid'];this[_0x968a('0x14')]=_0x487a8f[_0x968a('0x15')];this['calleridnum']=_0x487a8f[_0x968a('0x16')];this['starttime']=_0x487a8f['starttime'];this['responsetime']=_0x487a8f[_0x968a('0x17')];this[_0x968a('0x18')]=_0x487a8f[_0x968a('0x18')];this['endtime']=moment()[_0x968a('0x19')](_0x968a('0x1a'));this[_0x968a('0x1b')]=getSeconds(_0x487a8f[_0x968a('0x17')],_0x487a8f[_0x968a('0x1c')]);this['holdtime']=getSeconds(_0x487a8f[_0x968a('0x18')],_0x487a8f['responsetime']);this[_0x968a('0x1d')]=getSeconds(this['endtime'],_0x487a8f['answertime']);this[_0x968a('0xa')]=_0x57acac[_0x968a('0xa')];this[_0x968a('0x1e')]=_0x57acac['membername'];this[_0x968a('0x1f')]=_0x57acac[_0x968a('0x1f')];this[_0x968a('0x20')]=_0x487a8f[_0x968a('0x20')];this[_0x968a('0x21')]=_0x487a8f[_0x968a('0x21')];this['callbackat']=_0x487a8f[_0x968a('0x22')];this[_0x968a('0x23')]=_0x487a8f[_0x968a('0x23')];this[_0x968a('0x24')]=_0x487a8f['ContactId'];this[_0x968a('0x25')]=_0x487a8f['ListId'];this[_0x968a('0x26')]=_0x487a8f[_0x968a('0x26')];this[_0x968a('0x27')]=_0x487a8f['VoiceQueueId'];this[_0x968a('0x28')]=_0x487a8f[_0x968a('0x28')];this[_0x968a('0x29')]=_0x487a8f[_0x968a('0x29')]||'';this[_0x968a('0x2a')]=_0x487a8f[_0x968a('0x2a')]||'';}module[_0x968a('0x2b')]=AgentComplete;
\ No newline at end of file
diff --git a/server/services/ami/dialer/final.js b/server/services/ami/dialer/final.js
index 89a6418..5c73216 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 _0xc13a=['starttime','responsetime','ringtime','holdtime','talktime','callbackuniqueid','callbackat','recallme','ContactId','UserId','VoiceQueueId','CampaignId','originatecalleridnum','originatecalleridname','lodash','moment','milliseconds','seconds','uniqueid','scheduledat','type','campaigntype','outbound','queue','countbusyretry','countcongestionretry','countglobal','countnosuchnumberretry','countdropretry','countabandonedretry','countagentrejectretry','countmachineretry','calleridname','calleridnum'];(function(_0x3f54d4,_0x402225){var _0x225c44=function(_0x3e4e31){while(--_0x3e4e31){_0x3f54d4['push'](_0x3f54d4['shift']());}};_0x225c44(++_0x402225);}(_0xc13a,0xb8));var _0xac13=function(_0x5e71fd,_0x4de172){_0x5e71fd=_0x5e71fd-0x0;var _0x2da71f=_0xc13a[_0x5e71fd];return _0x2da71f;};'use strict';var util=require('util');var _=require(_0xac13('0x0'));var moment=require(_0xac13('0x1'));function getSeconds(_0x2d06bc,_0x4e7b71){var _0xba9b31=moment(_0x2d06bc)['milliseconds'](0x0);var _0x5005f3=moment(_0x4e7b71)[_0xac13('0x2')](0x0);return _0xba9b31['diff'](_0x5005f3,_0xac13('0x3'));}function Final(_0x5c350a){this[_0xac13('0x4')]=_0x5c350a[_0xac13('0x4')];this['scheduledat']=_0x5c350a[_0xac13('0x5')];this['type']=_0x5c350a[_0xac13('0x6')];this[_0xac13('0x7')]=_0x5c350a[_0xac13('0x6')]===_0xac13('0x8')?_0xac13('0x9'):_0x5c350a[_0xac13('0x6')];this[_0xac13('0xa')]=_0x5c350a[_0xac13('0xa')];this[_0xac13('0xb')]=_0x5c350a[_0xac13('0xb')];this['countnoanswerretry']=_0x5c350a['countnoanswerretry'];this[_0xac13('0xc')]=_0x5c350a[_0xac13('0xa')]+_0x5c350a[_0xac13('0xb')]+_0x5c350a['countnoanswerretry']+_0x5c350a[_0xac13('0xd')]+_0x5c350a[_0xac13('0xe')]+_0x5c350a[_0xac13('0xf')]+_0x5c350a['countmachineretry']+_0x5c350a[_0xac13('0x10')];this[_0xac13('0xd')]=_0x5c350a[_0xac13('0xd')];this[_0xac13('0xe')]=_0x5c350a[_0xac13('0xe')];this[_0xac13('0xf')]=_0x5c350a['countabandonedretry'];this[_0xac13('0x11')]=_0x5c350a[_0xac13('0x11')];this[_0xac13('0x10')]=_0x5c350a['countagentrejectretry'];this[_0xac13('0x9')]=_0x5c350a[_0xac13('0x9')];this[_0xac13('0x12')]=_0x5c350a['calleridname'];this['calleridnum']=_0x5c350a[_0xac13('0x13')];this[_0xac13('0x14')]=_0x5c350a['starttime'];this[_0xac13('0x15')]=_0x5c350a[_0xac13('0x15')];this['endtime']=_0x5c350a[_0xac13('0x15')];this[_0xac13('0x16')]=_0x5c350a['ringtime']||0x0;this[_0xac13('0x17')]=_0x5c350a[_0xac13('0x17')]||0x0;this[_0xac13('0x18')]=_0x5c350a[_0xac13('0x18')]||0x0;this['callback']=_0x5c350a['callback'];this[_0xac13('0x19')]=_0x5c350a[_0xac13('0x19')];this[_0xac13('0x1a')]=_0x5c350a['callbackat'];this[_0xac13('0x1b')]=_0x5c350a['recallme'];this['ContactId']=_0x5c350a[_0xac13('0x1c')];this['ListId']=_0x5c350a['ListId'];this['UserId']=_0x5c350a[_0xac13('0x1d')];this['VoiceQueueId']=_0x5c350a[_0xac13('0x1e')];this['CampaignId']=_0x5c350a[_0xac13('0x1f')];this['originatecalleridnum']=_0x5c350a[_0xac13('0x20')]||'';this[_0xac13('0x21')]=_0x5c350a[_0xac13('0x21')]||'';}module['exports']=Final;
\ No newline at end of file
+var _0x8f8c=['endtime','ringtime','holdtime','talktime','callback','callbackuniqueid','callbackat','recallme','ContactId','UserId','VoiceQueueId','CampaignId','originatecalleridnum','originatecalleridname','exports','milliseconds','seconds','uniqueid','scheduledat','type','campaigntype','outbound','queue','countbusyretry','countcongestionretry','countnoanswerretry','countglobal','countnosuchnumberretry','countdropretry','countabandonedretry','countmachineretry','countagentrejectretry','calleridname','calleridnum','responsetime'];(function(_0xc64d26,_0x5d235c){var _0x59e9f8=function(_0x1036b7){while(--_0x1036b7){_0xc64d26['push'](_0xc64d26['shift']());}};_0x59e9f8(++_0x5d235c);}(_0x8f8c,0x16d));var _0xc8f8=function(_0x3ab51d,_0x2fa01d){_0x3ab51d=_0x3ab51d-0x0;var _0x29a04e=_0x8f8c[_0x3ab51d];return _0x29a04e;};'use strict';var util=require('util');var _=require('lodash');var moment=require('moment');function getSeconds(_0x20011c,_0x2e0480){var _0x33807e=moment(_0x20011c)[_0xc8f8('0x0')](0x0);var _0x58dc7e=moment(_0x2e0480)[_0xc8f8('0x0')](0x0);return _0x33807e['diff'](_0x58dc7e,_0xc8f8('0x1'));}function Final(_0x15dace){this[_0xc8f8('0x2')]=_0x15dace['uniqueid'];this[_0xc8f8('0x3')]=_0x15dace[_0xc8f8('0x3')];this[_0xc8f8('0x4')]=_0x15dace[_0xc8f8('0x4')];this[_0xc8f8('0x5')]=_0x15dace['type']===_0xc8f8('0x6')?_0xc8f8('0x7'):_0x15dace[_0xc8f8('0x4')];this[_0xc8f8('0x8')]=_0x15dace[_0xc8f8('0x8')];this['countcongestionretry']=_0x15dace[_0xc8f8('0x9')];this['countnoanswerretry']=_0x15dace[_0xc8f8('0xa')];this[_0xc8f8('0xb')]=_0x15dace[_0xc8f8('0x8')]+_0x15dace['countcongestionretry']+_0x15dace['countnoanswerretry']+_0x15dace[_0xc8f8('0xc')]+_0x15dace[_0xc8f8('0xd')]+_0x15dace[_0xc8f8('0xe')]+_0x15dace['countmachineretry']+_0x15dace['countagentrejectretry'];this[_0xc8f8('0xc')]=_0x15dace['countnosuchnumberretry'];this[_0xc8f8('0xd')]=_0x15dace['countdropretry'];this[_0xc8f8('0xe')]=_0x15dace[_0xc8f8('0xe')];this['countmachineretry']=_0x15dace[_0xc8f8('0xf')];this[_0xc8f8('0x10')]=_0x15dace[_0xc8f8('0x10')];this[_0xc8f8('0x7')]=_0x15dace[_0xc8f8('0x7')];this[_0xc8f8('0x11')]=_0x15dace[_0xc8f8('0x11')];this[_0xc8f8('0x12')]=_0x15dace[_0xc8f8('0x12')];this['starttime']=_0x15dace['starttime'];this[_0xc8f8('0x13')]=_0x15dace[_0xc8f8('0x13')];this[_0xc8f8('0x14')]=_0x15dace[_0xc8f8('0x13')];this[_0xc8f8('0x15')]=_0x15dace[_0xc8f8('0x15')]||0x0;this[_0xc8f8('0x16')]=_0x15dace[_0xc8f8('0x16')]||0x0;this[_0xc8f8('0x17')]=_0x15dace[_0xc8f8('0x17')]||0x0;this[_0xc8f8('0x18')]=_0x15dace[_0xc8f8('0x18')];this[_0xc8f8('0x19')]=_0x15dace[_0xc8f8('0x19')];this[_0xc8f8('0x1a')]=_0x15dace[_0xc8f8('0x1a')];this[_0xc8f8('0x1b')]=_0x15dace[_0xc8f8('0x1b')];this['ContactId']=_0x15dace[_0xc8f8('0x1c')];this['ListId']=_0x15dace['ListId'];this[_0xc8f8('0x1d')]=_0x15dace[_0xc8f8('0x1d')];this[_0xc8f8('0x1e')]=_0x15dace[_0xc8f8('0x1e')];this['CampaignId']=_0x15dace[_0xc8f8('0x1f')];this['originatecalleridnum']=_0x15dace[_0xc8f8('0x20')]||'';this[_0xc8f8('0x21')]=_0x15dace[_0xc8f8('0x21')]||'';}module[_0xc8f8('0x22')]=Final;
\ No newline at end of file
diff --git a/server/services/ami/dialer/hangup.js b/server/services/ami/dialer/hangup.js
index e71fce9..7bc11b8 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 _0x9e0a=['talktime','membername','IVR','reason','cause-txt','callback','callbackuniqueid','callbackat','recallme','ContactId','ListId','UserId','VoiceQueueId','CampaignId','util','lodash','moment','milliseconds','diff','seconds','state','Answer','scheduledat','type','campaigntype','outbound','queue','countbusyretry','countcongestionretry','countnoanswerretry','countglobal','countnosuchnumberretry','countdropretry','countabandonedretry','countmachineretry','countagentrejectretry','uniqueid','calleridname','name','calleridnum','number','starttime','responsetime','endtime','format','YYYY-MM-DD\x20HH:mm:ss','ringtime','holdtime'];(function(_0xce54ff,_0x494d55){var _0xf01ad2=function(_0x36e897){while(--_0x36e897){_0xce54ff['push'](_0xce54ff['shift']());}};_0xf01ad2(++_0x494d55);}(_0x9e0a,0x18e));var _0xa9e0=function(_0x14add3,_0x13ce8d){_0x14add3=_0x14add3-0x0;var _0x4a174f=_0x9e0a[_0x14add3];return _0x4a174f;};'use strict';var util=require(_0xa9e0('0x0'));var _=require(_0xa9e0('0x1'));var moment=require(_0xa9e0('0x2'));function getSeconds(_0x3ef416,_0x105054){var _0x5ddda1=moment(_0x3ef416)[_0xa9e0('0x3')](0x0);var _0x119ce1=moment(_0x105054)[_0xa9e0('0x3')](0x0);return _0x5ddda1[_0xa9e0('0x4')](_0x119ce1,_0xa9e0('0x5'));}function Hangup(_0x41ee67,_0x2409ef){this[_0xa9e0('0x6')]=0x4;this['statedesc']=_0xa9e0('0x7');this[_0xa9e0('0x8')]=_0x41ee67['scheduledat'];this['type']=_0x41ee67[_0xa9e0('0x9')];this[_0xa9e0('0xa')]=_0x41ee67[_0xa9e0('0x9')]===_0xa9e0('0xb')?_0xa9e0('0xc'):_0x41ee67[_0xa9e0('0x9')];this[_0xa9e0('0xd')]=_0x41ee67[_0xa9e0('0xd')];this[_0xa9e0('0xe')]=_0x41ee67[_0xa9e0('0xe')];this['countnoanswerretry']=_0x41ee67[_0xa9e0('0xf')];this[_0xa9e0('0x10')]=_0x41ee67[_0xa9e0('0xd')]+_0x41ee67['countcongestionretry']+_0x41ee67[_0xa9e0('0xf')]+_0x41ee67[_0xa9e0('0x11')]+_0x41ee67[_0xa9e0('0x12')]+_0x41ee67[_0xa9e0('0x13')]+_0x41ee67['countmachineretry']+_0x41ee67['countagentrejectretry'];this[_0xa9e0('0x11')]=_0x41ee67[_0xa9e0('0x11')];this[_0xa9e0('0x12')]=_0x41ee67[_0xa9e0('0x12')];this[_0xa9e0('0x13')]=_0x41ee67[_0xa9e0('0x13')];this[_0xa9e0('0x14')]=_0x41ee67[_0xa9e0('0x14')];this[_0xa9e0('0x15')]=_0x41ee67['countagentrejectretry'];this[_0xa9e0('0x16')]=_0x2409ef[_0xa9e0('0x16')];this[_0xa9e0('0x17')]=_0x41ee67[_0xa9e0('0x18')];this[_0xa9e0('0x19')]=_0x41ee67[_0xa9e0('0x1a')];this[_0xa9e0('0x1b')]=_0x41ee67[_0xa9e0('0x1b')];this['responsetime']=_0x41ee67[_0xa9e0('0x1c')];this[_0xa9e0('0x1d')]=moment()[_0xa9e0('0x1e')](_0xa9e0('0x1f'));this[_0xa9e0('0x20')]=getSeconds(_0x41ee67['responsetime'],_0x41ee67[_0xa9e0('0x1b')]);this[_0xa9e0('0x21')]=0x0;this[_0xa9e0('0x22')]=getSeconds(this[_0xa9e0('0x1d')],_0x41ee67[_0xa9e0('0x1c')]);this['queue']=_0x41ee67[_0xa9e0('0xc')];this[_0xa9e0('0x23')]=_0xa9e0('0x24');this[_0xa9e0('0x25')]=_0x2409ef[_0xa9e0('0x26')];this[_0xa9e0('0x27')]=_0x41ee67['callback'];this[_0xa9e0('0x28')]=_0x41ee67['callbackuniqueid'];this[_0xa9e0('0x29')]=_0x41ee67[_0xa9e0('0x29')];this[_0xa9e0('0x2a')]=_0x41ee67['recallme'];this[_0xa9e0('0x2b')]=_0x41ee67[_0xa9e0('0x2b')];this['ListId']=_0x41ee67[_0xa9e0('0x2c')];this[_0xa9e0('0x2d')]=_0x41ee67[_0xa9e0('0x2d')];this[_0xa9e0('0x2e')]=_0x41ee67['VoiceQueueId'];this[_0xa9e0('0x2f')]=_0x41ee67[_0xa9e0('0x2f')];}module['exports']=Hangup;
\ No newline at end of file
+var _0xa426=['countmachineretry','countnosuchnumberretry','countdropretry','countagentrejectretry','uniqueid','calleridname','name','number','starttime','responsetime','endtime','format','YYYY-MM-DD\x20HH:mm:ss','ringtime','membername','reason','cause-txt','callback','callbackuniqueid','callbackat','recallme','ContactId','ListId','UserId','VoiceQueueId','CampaignId','exports','util','moment','milliseconds','diff','seconds','state','statedesc','Answer','scheduledat','type','campaigntype','outbound','queue','countbusyretry','countcongestionretry','countnoanswerretry','countabandonedretry'];(function(_0x2fd54f,_0x5c652d){var _0x1d9f20=function(_0x33e523){while(--_0x33e523){_0x2fd54f['push'](_0x2fd54f['shift']());}};_0x1d9f20(++_0x5c652d);}(_0xa426,0x1d3));var _0x6a42=function(_0x4f9b18,_0x2cb5ca){_0x4f9b18=_0x4f9b18-0x0;var _0x29f20c=_0xa426[_0x4f9b18];return _0x29f20c;};'use strict';var util=require(_0x6a42('0x0'));var _=require('lodash');var moment=require(_0x6a42('0x1'));function getSeconds(_0x221fb7,_0x13873f){var _0x124f48=moment(_0x221fb7)[_0x6a42('0x2')](0x0);var _0x4a474d=moment(_0x13873f)['milliseconds'](0x0);return _0x124f48[_0x6a42('0x3')](_0x4a474d,_0x6a42('0x4'));}function Hangup(_0x2f7608,_0x51e391){this[_0x6a42('0x5')]=0x4;this[_0x6a42('0x6')]=_0x6a42('0x7');this[_0x6a42('0x8')]=_0x2f7608[_0x6a42('0x8')];this[_0x6a42('0x9')]=_0x2f7608['type'];this[_0x6a42('0xa')]=_0x2f7608[_0x6a42('0x9')]===_0x6a42('0xb')?_0x6a42('0xc'):_0x2f7608[_0x6a42('0x9')];this['countbusyretry']=_0x2f7608[_0x6a42('0xd')];this[_0x6a42('0xe')]=_0x2f7608[_0x6a42('0xe')];this['countnoanswerretry']=_0x2f7608[_0x6a42('0xf')];this['countglobal']=_0x2f7608[_0x6a42('0xd')]+_0x2f7608[_0x6a42('0xe')]+_0x2f7608['countnoanswerretry']+_0x2f7608['countnosuchnumberretry']+_0x2f7608['countdropretry']+_0x2f7608[_0x6a42('0x10')]+_0x2f7608[_0x6a42('0x11')]+_0x2f7608['countagentrejectretry'];this['countnosuchnumberretry']=_0x2f7608[_0x6a42('0x12')];this[_0x6a42('0x13')]=_0x2f7608[_0x6a42('0x13')];this[_0x6a42('0x10')]=_0x2f7608[_0x6a42('0x10')];this[_0x6a42('0x11')]=_0x2f7608['countmachineretry'];this[_0x6a42('0x14')]=_0x2f7608['countagentrejectretry'];this[_0x6a42('0x15')]=_0x51e391['uniqueid'];this[_0x6a42('0x16')]=_0x2f7608[_0x6a42('0x17')];this['calleridnum']=_0x2f7608[_0x6a42('0x18')];this['starttime']=_0x2f7608[_0x6a42('0x19')];this[_0x6a42('0x1a')]=_0x2f7608['responsetime'];this[_0x6a42('0x1b')]=moment()[_0x6a42('0x1c')](_0x6a42('0x1d'));this[_0x6a42('0x1e')]=getSeconds(_0x2f7608[_0x6a42('0x1a')],_0x2f7608[_0x6a42('0x19')]);this['holdtime']=0x0;this['talktime']=getSeconds(this['endtime'],_0x2f7608[_0x6a42('0x1a')]);this[_0x6a42('0xc')]=_0x2f7608[_0x6a42('0xc')];this[_0x6a42('0x1f')]='IVR';this[_0x6a42('0x20')]=_0x51e391[_0x6a42('0x21')];this['callback']=_0x2f7608[_0x6a42('0x22')];this[_0x6a42('0x23')]=_0x2f7608[_0x6a42('0x23')];this[_0x6a42('0x24')]=_0x2f7608[_0x6a42('0x24')];this[_0x6a42('0x25')]=_0x2f7608['recallme'];this[_0x6a42('0x26')]=_0x2f7608['ContactId'];this['ListId']=_0x2f7608[_0x6a42('0x27')];this['UserId']=_0x2f7608[_0x6a42('0x28')];this[_0x6a42('0x29')]=_0x2f7608['VoiceQueueId'];this[_0x6a42('0x2a')]=_0x2f7608[_0x6a42('0x2a')];}module[_0x6a42('0x2b')]=Hangup;
\ No newline at end of file
diff --git a/server/services/ami/dialer/history.js b/server/services/ami/dialer/history.js
index 474a974..548fc2e 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 _0x4c76=['countmachineretry','countagentrejectretry','calleridname','name','number','starttime','responsetime','holdtime','talktime','callback','callbackuniqueid','callbackat','recallme','ContactId','ListId','UserId','VoiceQueueId','CampaignId','originatecalleridnum','originatecalleridname','lodash','milliseconds','diff','seconds','uniqueid','scheduledat','type','campaigntype','outbound','queue','countbusyretry','countnoanswerretry','countcongestionretry','countnosuchnumberretry','countdropretry','countabandonedretry'];(function(_0x20228d,_0x5b9aa6){var _0x80cc57=function(_0x4e334c){while(--_0x4e334c){_0x20228d['push'](_0x20228d['shift']());}};_0x80cc57(++_0x5b9aa6);}(_0x4c76,0x80));var _0x64c7=function(_0x3dd15e,_0x1f0015){_0x3dd15e=_0x3dd15e-0x0;var _0x231fd0=_0x4c76[_0x3dd15e];return _0x231fd0;};'use strict';var util=require('util');var _=require(_0x64c7('0x0'));var moment=require('moment');function getSeconds(_0x23c811,_0x47551f){var _0x3ff8b0=moment(_0x23c811)['milliseconds'](0x0);var _0x42b6d9=moment(_0x47551f)[_0x64c7('0x1')](0x0);return _0x3ff8b0[_0x64c7('0x2')](_0x42b6d9,_0x64c7('0x3'));}function History(_0x578a1e){this[_0x64c7('0x4')]=_0x578a1e[_0x64c7('0x4')];this[_0x64c7('0x5')]=_0x578a1e[_0x64c7('0x5')]||undefined;this[_0x64c7('0x6')]=_0x578a1e[_0x64c7('0x6')];this[_0x64c7('0x7')]=_0x578a1e['type']===_0x64c7('0x8')?_0x64c7('0x9'):_0x578a1e[_0x64c7('0x6')];this[_0x64c7('0xa')]=_0x578a1e[_0x64c7('0xa')];this['countcongestionretry']=_0x578a1e['countcongestionretry'];this[_0x64c7('0xb')]=_0x578a1e[_0x64c7('0xb')];this['countglobal']=_0x578a1e[_0x64c7('0xa')]+_0x578a1e[_0x64c7('0xc')]+_0x578a1e[_0x64c7('0xb')]+_0x578a1e[_0x64c7('0xd')]+_0x578a1e[_0x64c7('0xe')]+_0x578a1e[_0x64c7('0xf')]+_0x578a1e[_0x64c7('0x10')]+_0x578a1e[_0x64c7('0x11')];this['countnosuchnumberretry']=_0x578a1e[_0x64c7('0xd')];this[_0x64c7('0xe')]=_0x578a1e['countdropretry'];this[_0x64c7('0xf')]=_0x578a1e['countabandonedretry'];this['countmachineretry']=_0x578a1e[_0x64c7('0x10')];this['countagentrejectretry']=_0x578a1e[_0x64c7('0x11')];this[_0x64c7('0x9')]=_0x578a1e[_0x64c7('0x9')];this[_0x64c7('0x12')]=_0x578a1e[_0x64c7('0x13')];this['calleridnum']=_0x578a1e[_0x64c7('0x14')];this[_0x64c7('0x15')]=_0x578a1e[_0x64c7('0x15')];this[_0x64c7('0x16')]=_0x578a1e[_0x64c7('0x16')];this['endtime']=_0x578a1e[_0x64c7('0x16')];this['ringtime']=getSeconds(_0x578a1e['responsetime'],_0x578a1e[_0x64c7('0x15')]);this[_0x64c7('0x17')]=0x0;this[_0x64c7('0x18')]=0x0;this[_0x64c7('0x19')]=_0x578a1e[_0x64c7('0x19')];this[_0x64c7('0x1a')]=_0x578a1e[_0x64c7('0x1a')];this[_0x64c7('0x1b')]=_0x578a1e['callbackat'];this['recallme']=_0x578a1e[_0x64c7('0x1c')];this[_0x64c7('0x1d')]=_0x578a1e['ContactId'];this[_0x64c7('0x1e')]=_0x578a1e[_0x64c7('0x1e')];this['UserId']=_0x578a1e[_0x64c7('0x1f')];this[_0x64c7('0x20')]=_0x578a1e[_0x64c7('0x20')];this[_0x64c7('0x21')]=_0x578a1e[_0x64c7('0x21')];this[_0x64c7('0x22')]=_0x578a1e[_0x64c7('0x22')]||'';this[_0x64c7('0x23')]=_0x578a1e[_0x64c7('0x23')]||'';}module['exports']=History;
\ No newline at end of file
+var _0xa72e=['countcongestionretry','countnosuchnumberretry','countdropretry','countmachineretry','countagentrejectretry','countabandonedretry','calleridname','name','calleridnum','starttime','responsetime','endtime','ringtime','callback','callbackuniqueid','callbackat','recallme','ContactId','ListId','UserId','VoiceQueueId','CampaignId','originatecalleridnum','originatecalleridname','util','lodash','milliseconds','diff','seconds','uniqueid','scheduledat','type','campaigntype','queue','countbusyretry'];(function(_0x119b3e,_0x588d50){var _0x1169ae=function(_0x377422){while(--_0x377422){_0x119b3e['push'](_0x119b3e['shift']());}};_0x1169ae(++_0x588d50);}(_0xa72e,0xa4));var _0xea72=function(_0x309f3f,_0x3a133d){_0x309f3f=_0x309f3f-0x0;var _0x2b3ec4=_0xa72e[_0x309f3f];return _0x2b3ec4;};'use strict';var util=require(_0xea72('0x0'));var _=require(_0xea72('0x1'));var moment=require('moment');function getSeconds(_0x13256a,_0x1af3a4){var _0x2030e2=moment(_0x13256a)[_0xea72('0x2')](0x0);var _0x2d62ac=moment(_0x1af3a4)['milliseconds'](0x0);return _0x2030e2[_0xea72('0x3')](_0x2d62ac,_0xea72('0x4'));}function History(_0x2cb61d){this[_0xea72('0x5')]=_0x2cb61d[_0xea72('0x5')];this[_0xea72('0x6')]=_0x2cb61d['scheduledat']||undefined;this[_0xea72('0x7')]=_0x2cb61d[_0xea72('0x7')];this[_0xea72('0x8')]=_0x2cb61d['type']==='outbound'?_0xea72('0x9'):_0x2cb61d['type'];this[_0xea72('0xa')]=_0x2cb61d[_0xea72('0xa')];this[_0xea72('0xb')]=_0x2cb61d[_0xea72('0xb')];this['countnoanswerretry']=_0x2cb61d['countnoanswerretry'];this['countglobal']=_0x2cb61d[_0xea72('0xa')]+_0x2cb61d[_0xea72('0xb')]+_0x2cb61d['countnoanswerretry']+_0x2cb61d[_0xea72('0xc')]+_0x2cb61d[_0xea72('0xd')]+_0x2cb61d['countabandonedretry']+_0x2cb61d[_0xea72('0xe')]+_0x2cb61d[_0xea72('0xf')];this[_0xea72('0xc')]=_0x2cb61d[_0xea72('0xc')];this['countdropretry']=_0x2cb61d[_0xea72('0xd')];this[_0xea72('0x10')]=_0x2cb61d[_0xea72('0x10')];this[_0xea72('0xe')]=_0x2cb61d[_0xea72('0xe')];this['countagentrejectretry']=_0x2cb61d[_0xea72('0xf')];this[_0xea72('0x9')]=_0x2cb61d[_0xea72('0x9')];this[_0xea72('0x11')]=_0x2cb61d[_0xea72('0x12')];this[_0xea72('0x13')]=_0x2cb61d['number'];this[_0xea72('0x14')]=_0x2cb61d['starttime'];this[_0xea72('0x15')]=_0x2cb61d[_0xea72('0x15')];this[_0xea72('0x16')]=_0x2cb61d['responsetime'];this[_0xea72('0x17')]=getSeconds(_0x2cb61d[_0xea72('0x15')],_0x2cb61d[_0xea72('0x14')]);this['holdtime']=0x0;this['talktime']=0x0;this[_0xea72('0x18')]=_0x2cb61d['callback'];this[_0xea72('0x19')]=_0x2cb61d[_0xea72('0x19')];this['callbackat']=_0x2cb61d[_0xea72('0x1a')];this[_0xea72('0x1b')]=_0x2cb61d[_0xea72('0x1b')];this[_0xea72('0x1c')]=_0x2cb61d[_0xea72('0x1c')];this['ListId']=_0x2cb61d[_0xea72('0x1d')];this[_0xea72('0x1e')]=_0x2cb61d[_0xea72('0x1e')];this['VoiceQueueId']=_0x2cb61d[_0xea72('0x1f')];this[_0xea72('0x20')]=_0x2cb61d[_0xea72('0x20')];this[_0xea72('0x21')]=_0x2cb61d[_0xea72('0x21')]||'';this['originatecalleridname']=_0x2cb61d[_0xea72('0x22')]||'';}module['exports']=History;
\ No newline at end of file
diff --git a/server/services/ami/dialer/index.js b/server/services/ami/dialer/index.js
index 91bd787..b7ed22c 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 _0xe8e5=['[getContactDialer2][ReScheduled]','contacts','[getContactDialer2][Empty]','sendMessageOneNotActive','is\x20not\x20active','is\x20disactive','NOT_ACTIVE','[syncQueueSummary]\x20Campaign\x20Ivr:\x20','IS_DISACTIVED','state','statedesc','endtime','starttime','clearZombieChannels','uniqueId','[uniqueid]','actions','isNil','Action','channel','catch','No\x20such\x20channel','updateOriginated','queue','[Dialer][checkChannel]','type','countReScheduled','resolve','then','[countReScheduled]\x20','checkIsBlackList','[checkIsBlackList]\x20','checkIsBlackListIvr','[checkIsBlackListIvr]\x20','averageHandleTime','avgHandleTime','rescheduleContact','unlockContact','[unlockContact]\x20','getContactDialer','[getContactDialer]\x20','getContactDialerIvr','getVoiceQueueRtPauses','[getVoiceQueueRtPauses]\x20','moveContactManagedDialer','createHistory','[updateOriginated]\x20object\x20originated\x20is\x20negative','[updateOriginated]\x20is\x20null\x20or\x20undefined','loggerHandler','emptyContact','notFound','saveInDb','ListId','UserId','[emptyContact][createHistory]','[emptyContact]','isSuccess','Success','isTrunkReachable','SIP/%s','status','unmonitored','uniqueid','variable','amdstatus','exten','xcally-motion-dialer','dialAMDActive','value','HANGUP','outboundAnswerCallsDay','HangupInAMD','[syncHangupInAMD][createHistory]','[syncHangupInAMD]','outboundAnswerAgiCallsDay','Machine','membername','AMD','[syncMachine][createHistory]','[syncMachine]','[syncHangupInAMDIvr][createHistory]','[syncHangupInAMDIvr]','MACHINE','[syncMachineIvr][createHistory]','[syncMachineIvr]','syncHangup','[syncHangupIvr][createHistory]','[syncHangupIvr]','dialQueueProject','AnswerAGI','AGI','cause-txt','Unknow','syncAgentComplete','reason','dialQueueProject2','dialAgiAfterHangupAgent','[syncAgentComplete]','syncAgentConnect','answertime','[syncAgentComplete][createHistory]','[syncQueueCallerAbandon]\x20[Drop]','droptime','YYYY-MM-DD\x20HH:mm:ss','dialQueueTimeout','Drop','dropreason','TIMEOUT','agiafterat','countdropretry','dialDropMaxRetry','queueCallerAbandonCreateState','add','dialDropRetryFrequency','minutes','ContactId','VoiceQueueId','[rescheduleContact][Drop]','Abandoned','CALLEREXIT','countabandonedretry','dialAbandonedMaxRetry','dialAbandonedRetryFrequency','CampaignId','syncNewExten','syncQueueMember','actionid','locked','stateinterface','rrmemory','push','pick','paused','queueStatusComplete','[unlockQueueStatus][undefined]','[booked][unlockQueueStatus]','run','idHopper','[Catch][Preview][syncQueueStatusComplete]','_rr','unlockRR','[booked][RR]','Agent:\x20','contactAgent-idHopper:\x20','[booked][RR][finaly]','[booked][unlock]','[unlock][syncQueueStatusComplete]','[booked][unlock3]','[unlock3][syncQueueStatusComplete]','syncCampaigns','TRUNK_IS_NOT_REACHABLE','\x20trunk\x20is\x20not\x20reachable','checkIfTime','ifTime','checkIfTimeIntervals','Failure','\x20Intervals\x20is\x20null\x20','\x20Intervals\x20is\x20empty\x20','timezones','TIMEZONE_UNKNOW','isArray','command','iftime\x20%s,%s','content','true','indexOf','all','some','GLOBAL_INTERVAL_IS_OVERTIME','INTERVAL_IS_OVERTIME','[ifTime][promiseAll]','\x20Interval\x20is\x20overtime:\x20','Timezone:\x20','checkDialMethod','dialMethod','progressive','handlePower','power','dialPowerLevel','predictive','Queue','launchHandleIvr','dialActive','dialGlobalInterval','dialTimezone','[syncQueueSummary]','checkIsTrunkReachable','[syncCampaigns]','\x5cw{0,','pow','replace','random','match','object','originate','voiceQueue\x20is\x20undefine','Contact','phone','getCaller','\x22agi://%s/square,%s\x22','NONE','dialQueueOptions','ACTIVE','XMD-AMDINITIALSILENCE','XMD-AMDAFTERGREETINGSILENCE','dialAMDAfterGreetingSilence','XMD-AMDTOTALANALYSISTIME','dialAMDTotalAnalysisTime','XMD-AMDMINWORDLENGTH','dialAMDMinWordLength','XMD-AMDBETWEENWORDSSILENCE','dialAMDBetweenWordsSilence','XMD-AMDMAXIMUMNUMBEROFWORDS','XMD-AMDSILENCETHRESHOLD','XMD-AMDMAXIMUMWORDLENGTH','dialAMDMaximumWordLength','XMD-VOICEQUEUEID','XMD-CAMPAIGNID','tags','createdAt','updatedAt','%s%s','XMD-','dialOriginateCallerIdName','dialRandomLastDigitCallerIdNumber','TrunkBackup','originatecalleridname','XMD-ORIGINATECALLERIDNUM','originatecalleridnum','trim','dialCutDigit','substring','SIP/%s/%s%s','from-sip','outboundOriginateFailureCallsDay','OriginateError','[originate][error]','originate\x20action\x20Error','responsetime','getQueue','callProgressDetecting','[callProgressDetecting]\x20','countbusyretry','countcongestionretry','countnosuchnumberretry','countmachineretry','countagentrejectretry','dialGlobalMaxRetry','dialNoAnswerMaxRetry','countnoanswerretry','[rescheduleContact][NoAnswer]','dialBusyRetryFrequency','[rescheduleContact]\x20[Busy]','dialCongestionMaxRetry','dialCongestionRetryFrequency','[rescheduleContact]\x20[Congestion]','dialNoSuchNumberMaxRetry','[rescheduleContact][NoSuchNumber]','[rescheduleContact][Abandoned]','dialMachineRetryFrequency','[rescheduleContact][Machine]','dialAgentRejectMaxRetry','dialAgentRejectRetryFrequency','[callProgressDetecting]','entity\x20is\x20undefine','evt\x20is\x20undefine','NoSuchNumber','[syncAgentComplete][createHistory][0]','stateGlobal','reason\x200\x20no\x20such\x20number....','createStateFinal','outboundNoAnswerCallsDay','countglobal','[syncAgentComplete][createHistory][3]','checkRetriveMax','reason\x203\x20ringing\x20no\x20answer','Busy','[syncAgentComplete][createHistory][5]','dialBusyMaxRetry','reason\x205\x20busy','outboundCongestionCallsDay','[syncAgentComplete][createHistory][8]','reason\x208\x20congestion','outboundAbandonedCallsDay','[syncAgentComplete][createHistory][11]','reason\x2011\x20abandoned','outboundRejectCallsDay','AgentReject','reason\x2020\x20agentreject','[syncAgentComplete][createHistory][?]','Global','[moveContactManagedDialer][0]','dialPredictiveOptimizationPercentage','outboundDropCallsDayTimeout','round','predictiveIntervalAvailable','predictiveIntervalMinThreshold','floor','[startMethodPredictive][StartProgressive]','check\x20predictive\x20is\x20not\x20undefine','collection\x20data\x20in\x20progressive\x20at','dialPredictiveInterval','[startMethodPredictive][StartProgressive][Loop]','dialPredictiveOptimization','[stopMethodPredictive][ReStartProgressive][ExceededDropDay]','Dropped\x20calls\x20day','dropRate','Max\x20Drop\x20','started\x20in\x20predictive\x20at','recalculate\x20predictive\x20at','getDataPredictive','startMethodPredictive','Predictive\x20for\x20every\x20interval','switch\x20in\x20progressive\x20because\x20available\x20agents\x20(',')\x20are\x20less\x20than\x20threshold\x20(',')\x20are\x20more\x20than\x20threshold\x20(','predictiveIntervalAnsweredCalls','abandonmentRate','agentBusyFactor','busyFactor','[getDataPredictive]','Unknown\x20Predictive','check\x20failure','getDataPredictiveOld','outboundQueuePauses','[CatchErlangB]','[handlePredictive]','fail\x20to\x20scheduled\x20calls','checkContactBlack','recallme','[booked][checkContactBlack]','queueStatusComplete:\x20','[unlockOriginate][syncQueueStatusComplete]','[booked][checkContactBlack][else]','Queue:\x20','actionOriginate','scheduledat','dialRecallMeTimeout','Agent','log','Contact\x20updated','dialRecallInQueue','[rescheduleContact][dialRecallInQueue]','RECALLINQUEUE','[Originate][HistoryDialRecallInQueue][historyCatch]','RECALLFAILEDTIMEOUT','RecallFailedTimeout','[Originate][HistoryRecallClose][historyCatch]','[Originate][HistoryRecallClose]','BLACKLIST','[Originate][historyBlacklist]','[Originate][MoveBlacklist]','inBlackList','handleIvr','limitCalls','temp','AVAILABLE_CONTACTS_FINISHED','[getContactCampaign2][Empty]','RUNNING','length','ivrTotalCallsDays','[actionOriginate]\x20','Contact.phone','dialLimitQueue','reachable','dialOrderByScheduledAt','[getContactDialer2]','[handlePredictive][limitChannel]','tryOriginatePredictive','[actionOriginatePredictive]\x20','[getContactDialerPredictive]','--------\x20Drop\x20Rate\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]','Ts\x20=\x20','p\x20=\x20','Amax\x20=\x20','----\x20Agent\x20Busy\x20Factor\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','Umin:\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20','[busyFactor]','Umin\x20=\x20','exports','util','lodash','uuid','moment','md5','ioredis','../../../config/logger','dialer','booked','predictiveCalls','syncQueueSummary','../ami','redis','defaults','localhost','socket.io-emitter','../rpc/cmHopper','../rpc/cmHopperHistory','../rpc/cmHopperBlack','./action','./history','./final','./agentComplete','./queueCallerAbandon','./hangup','env','XCALLY_IP_AGI','127.0.0.1','roundrobin','prototype','enqueue','finally','sequence','preview','voiceQueues','campaigns','agents','trunks','maxNumberOriginate','channels','optionPredictive','startPredictive','startProgressive','ivrOriginated','queueBooked','queueBookedRR','agentconnect','queuecallerabandon','syncQueueCallerAbandon','bind','originateresponse','syncOriginateResponse','custom:queuesummary','newexten','syncVarSet','queuemember','queuestatuscomplete','syncQueueStatusComplete','loopCampaigns','loopClearZombieChannels','isUndefined','AGENTS_NOT_LOGGED','name','message','\x20NOT\x20Active','Interval','INTERVAL_IS_NULL','\x20INTERVAL_IS_NULL','Intervals','[ifTime][Action]','Error','stringify','milliseconds','diff','emit','outbound','strategy','answered','available','loggedIn','pTalking','sumBillable','sumDuration','sumHoldTime','talking','total','abandoned','waiting','dialOriginateCallerIdNumber','dialOriginateTimeout','dialPrefix','outboundBlacklistCallsDay','outboundBusyCallsDay','outboundDropCallsDayCallersExit','outboundNoSuchCallsDay','outboundReCallsDay','outboundUnknownCallsDay','predictiveIntervalAvgTalktime','predictiveIntervalDroppedCallsCallersExit','predictiveIntervalErlangCalls','predictiveIntervalErlangCallsDroppedCalls','predictiveIntervalHitRate','predictiveIntervalMultiplicativeFactor','predictiveIntervalPauses','originated','erlangCalls','erlangCallToSecond','erlangAbandonmentRate','erlangBusyFactor','Trunk','active','callerid','format','voice_queue:save','ivr','-----\x20Stats\x20Predictive\x20---','info','Total\x20Calls:\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20','predictiveIntervalTotalCalls','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','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\x20Hold\x20Time\x20is\x20not\x20enough\x20for\x20predictive','Total\x20Calls\x20are\x20not\x20enough\x20for\x20predictive','History\x20information\x20are\x20empty','---------\x20ErlangB\x20---------','Scheduled\x20Calls:\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20','One\x20call\x20every:\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20','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','merge','seconds','clearing\x20variable\x20start\x20progressive','clearing\x20variable\x20start\x20predictive','handlePredictive','clearing\x20variable\x20handle\x20predictive','string','isEmpty','\x22%s\x22\x20<%s>','error','inspect','stack','hasOwnProperty','[decremetOriginate]\x20object\x20originated\x20is\x20negative','[decremetOriginate]\x20is\x20null\x20or\x20undefined','contactsRescheduled'];(function(_0x51020b,_0x38c2c7){var _0x371e47=function(_0x2a538f){while(--_0x2a538f){_0x51020b['push'](_0x51020b['shift']());}};_0x371e47(++_0x38c2c7);}(_0xe8e5,0x183));var _0x5e8e=function(_0x4d678b,_0xae47f8){_0x4d678b=_0x4d678b-0x0;var _0x3fbd74=_0xe8e5[_0x4d678b];return _0x3fbd74;};'use strict';var util=require(_0x5e8e('0x0'));var _=require(_0x5e8e('0x1'));var BPromise=require('bluebird');var uuid=require(_0x5e8e('0x2'));var moment=require(_0x5e8e('0x3'));var rr=require('rr');var md5=require(_0x5e8e('0x4'));var Redis=require(_0x5e8e('0x5'));var config=require('../../../config/environment/');var logger=require(_0x5e8e('0x6'))(_0x5e8e('0x7'));var loggerBooked=require(_0x5e8e('0x6'))(_0x5e8e('0x8'));var loggerPredictive=require(_0x5e8e('0x6'))('predictive');var loggerPredictiveCalls=require('../../../config/logger')(_0x5e8e('0x9'));var loggerSyncQueueSummary=require(_0x5e8e('0x6'))(_0x5e8e('0xa'));var ami=require(_0x5e8e('0xb'));config[_0x5e8e('0xc')]=_[_0x5e8e('0xd')](config[_0x5e8e('0xc')],{'host':_0x5e8e('0xe'),'port':0x18eb});var io=require(_0x5e8e('0xf'))(new Redis(config[_0x5e8e('0xc')]));var cmHopper=require(_0x5e8e('0x10'));var cmHopperFinal=require('../rpc/cmHopperFinal');var cmHopperHistory=require(_0x5e8e('0x11'));var cmHopperBlack=require(_0x5e8e('0x12'));var voiceQueueRt=require('../rpc/voiceQueueRt');var Action=require(_0x5e8e('0x13'));var History=require(_0x5e8e('0x14'));var Final=require(_0x5e8e('0x15'));var AgentComplete=require(_0x5e8e('0x16'));var QueueCallerAbandon=require(_0x5e8e('0x17'));var Hangup=require(_0x5e8e('0x18'));var ipAgi=process[_0x5e8e('0x19')][_0x5e8e('0x1a')]||_0x5e8e('0x1b');var strategy={'rrmemory':'rrmemory','roundrobin':_0x5e8e('0x1c')};var Sequence=function(){};Sequence[_0x5e8e('0x1d')][_0x5e8e('0x1e')]=function(_0x52ff4c){this['tail']=this['tail']?this['tail'][_0x5e8e('0x1f')](_0x52ff4c):_0x52ff4c();};function Dialer(_0xc4395c,_0x4e40b6){this[_0x5e8e('0x20')]=new Sequence();this[_0x5e8e('0x21')]=_0x4e40b6;this[_0x5e8e('0x22')]=_0xc4395c[_0x5e8e('0x22')];this['campaigns']=_0xc4395c[_0x5e8e('0x23')];this[_0x5e8e('0x24')]=_0xc4395c[_0x5e8e('0x24')];this[_0x5e8e('0x25')]=_0xc4395c[_0x5e8e('0x25')];this['maxNumberOriginate']=config[_0x5e8e('0x26')]||0x2;this[_0x5e8e('0x27')]={};this['actions']={};this['contactsId']={};this['uniqueId']={};this[_0x5e8e('0x28')]={};this[_0x5e8e('0x29')]={};this[_0x5e8e('0x2a')]={};this[_0x5e8e('0x2b')]={};this[_0x5e8e('0x2c')]={};this[_0x5e8e('0x2d')]={};ami['on'](_0x5e8e('0x2e'),this['syncAgentConnect']['bind'](this));ami['on'](_0x5e8e('0x2f'),this[_0x5e8e('0x30')][_0x5e8e('0x31')](this));ami['on'](_0x5e8e('0x32'),this[_0x5e8e('0x33')]['bind'](this));ami['on']('agentcomplete',this['syncAgentComplete']['bind'](this));ami['on'](_0x5e8e('0x34'),this['syncQueueSummary'][_0x5e8e('0x31')](this));ami['on']('hangup',this['syncHangup'][_0x5e8e('0x31')](this));ami['on'](_0x5e8e('0x35'),this['syncNewExten'][_0x5e8e('0x31')](this));ami['on']('varset',this[_0x5e8e('0x36')][_0x5e8e('0x31')](this));ami['on'](_0x5e8e('0x37'),this['syncQueueMember'][_0x5e8e('0x31')](this));ami['on'](_0x5e8e('0x38'),this[_0x5e8e('0x39')][_0x5e8e('0x31')](this));this[_0x5e8e('0x3a')]();this[_0x5e8e('0x3b')]();}function isNotNull(_0x5663b9){return _0x5663b9!==null&&!_[_0x5e8e('0x3c')](_0x5663b9);}function checkIsLoggedIn(_0x17c9c8,_0x3a0973){return function(){if(_0x3a0973<=0x0){_0x17c9c8['message']=_0x5e8e('0x3d');throw _0x17c9c8[_0x5e8e('0x3e')]+'\x20AGENTS\x20NOT\x20LOGGED';}};}function isActive(_0x95b6ea){return _0x95b6ea;}function checkIsActive(_0x128a8e,_0x5615b8){return function(){if(!isActive(_0x5615b8)){_0x128a8e[_0x5e8e('0x3f')]='NOT_ACTIVE';throw _0x128a8e[_0x5e8e('0x3e')]+_0x5e8e('0x40');}};}function checkInterval(_0x460237){return function(){if(!isNotNull(_0x460237[_0x5e8e('0x41')])){_0x460237[_0x5e8e('0x3f')]=_0x5e8e('0x42');throw _0x460237[_0x5e8e('0x3e')]+_0x5e8e('0x43');}if(!isNotNull(_0x460237[_0x5e8e('0x41')]['Intervals'])){_0x460237['message']=_0x5e8e('0x42');throw _0x460237[_0x5e8e('0x3e')]+_0x5e8e('0x43');}if(!isNotNull(_['isEmpty'](_0x460237[_0x5e8e('0x41')][_0x5e8e('0x44')]))){_0x460237[_0x5e8e('0x3f')]=_0x5e8e('0x42');throw _0x460237[_0x5e8e('0x3e')]+_0x5e8e('0x43');}};}function msgResponse(_0x1ddac7,_0x352060,_0x2a3ecb){return{'action':_0x1ddac7,'response':_0x352060,'message':_0x2a3ecb,'stack':_0x2a3ecb};}function myreject(_0x1e1ec2){return function(_0x18ed9e){return _0x1e1ec2(msgResponse(_0x5e8e('0x45'),_0x5e8e('0x46'),JSON[_0x5e8e('0x47')](_0x18ed9e)));};}function getSeconds(_0x60eca,_0x533bdc){var _0x26886b=moment(_0x60eca)[_0x5e8e('0x48')](0x0);var _0x280a88=moment(_0x533bdc)[_0x5e8e('0x48')](0x0);return _0x26886b[_0x5e8e('0x49')](_0x280a88,'seconds');}function emit(_0x33d5ed,_0x1fdc13,_0x1dfbed){io['to'](_0x33d5ed)[_0x5e8e('0x4a')](_0x1fdc13,_0x1dfbed);}function emitVoiceQueueSummary(_0x4d490f){if(_0x4d490f['type']===_0x5e8e('0x4b')){var _0xc2d23={'id':_0x4d490f['id'],'name':_0x4d490f[_0x5e8e('0x3e')],'strategy':_0x4d490f[_0x5e8e('0x4c')],'answered':_0x4d490f[_0x5e8e('0x4d')],'available':_0x4d490f[_0x5e8e('0x4e')],'loggedIn':_0x4d490f[_0x5e8e('0x4f')],'pTalking':_0x4d490f[_0x5e8e('0x50')],'sumBillable':_0x4d490f[_0x5e8e('0x51')],'sumDuration':_0x4d490f[_0x5e8e('0x52')],'sumHoldTime':_0x4d490f[_0x5e8e('0x53')]||0x0,'talking':_0x4d490f[_0x5e8e('0x54')],'total':_0x4d490f[_0x5e8e('0x55')],'type':_0x4d490f['type'],'unmanaged':_0x4d490f['unmanaged'],'abandoned':_0x4d490f[_0x5e8e('0x56')],'waiting':_0x4d490f[_0x5e8e('0x57')],'loggedInDb':_0x4d490f['loggedInDb'],'dialActive':_0x4d490f['dialActive'],'dialMethod':_0x4d490f['dialMethod'],'dialOriginateCallerIdName':_0x4d490f['dialOriginateCallerIdName'],'dialOriginateCallerIdNumber':_0x4d490f[_0x5e8e('0x58')],'dialOriginateTimeout':_0x4d490f[_0x5e8e('0x59')],'dialPrefix':_0x4d490f[_0x5e8e('0x5a')],'outboundAnswerAgiCallsDay':_0x4d490f['outboundAnswerAgiCallsDay'],'outboundAnswerCallsDay':_0x4d490f['outboundAnswerCallsDay'],'outboundBlacklistCallsDay':_0x4d490f[_0x5e8e('0x5b')],'outboundBusyCallsDay':_0x4d490f[_0x5e8e('0x5c')],'outboundCongestionCallsDay':_0x4d490f['outboundCongestionCallsDay'],'outboundDropCallsDayACS':_0x4d490f['outboundDropCallsDayACS'],'outboundDropCallsDayCallersExit':_0x4d490f[_0x5e8e('0x5d')],'outboundDropCallsDayTimeout':_0x4d490f['outboundDropCallsDayTimeout'],'outboundNoAnswerCallsDay':_0x4d490f['outboundNoAnswerCallsDay'],'outboundNoSuchCallsDay':_0x4d490f[_0x5e8e('0x5e')],'outboundOriginateFailureCallsDay':_0x4d490f['outboundOriginateFailureCallsDay'],'outboundReCallsDay':_0x4d490f[_0x5e8e('0x5f')],'outboundRejectCallsDay':_0x4d490f['outboundRejectCallsDay'],'outboundUnknownCallsDay':_0x4d490f[_0x5e8e('0x60')],'predictiveIntervalAnsweredCalls':_0x4d490f['predictiveIntervalAnsweredCalls'],'predictiveIntervalAvgHoldtime':_0x4d490f['predictiveIntervalAvgHoldtime'],'predictiveIntervalAvgTalktime':_0x4d490f[_0x5e8e('0x61')],'predictiveIntervalDroppedCallsCallersExit':_0x4d490f[_0x5e8e('0x62')],'predictiveIntervalDroppedCallsTimeout':_0x4d490f['predictiveIntervalDroppedCallsTimeout'],'predictiveIntervalErlangCalls':_0x4d490f[_0x5e8e('0x63')],'predictiveIntervalErlangCallsDroppedCalls':_0x4d490f[_0x5e8e('0x64')],'predictiveIntervalHitRate':_0x4d490f[_0x5e8e('0x65')],'predictiveIntervalMultiplicativeFactor':_0x4d490f[_0x5e8e('0x66')],'predictiveIntervalPauses':_0x4d490f[_0x5e8e('0x67')],'predictiveIntervalAvailable':_0x4d490f['predictiveIntervalAvailable'],'predictiveIntervalTotalCalls':_0x4d490f['predictiveIntervalTotalCalls'],'message':_0x4d490f[_0x5e8e('0x3f')],'originated':_0x4d490f[_0x5e8e('0x68')],'erlangCalls':_0x4d490f[_0x5e8e('0x69')],'erlangCallToSecond':_0x4d490f[_0x5e8e('0x6a')],'erlangAbandonmentRate':_0x4d490f[_0x5e8e('0x6b')],'erlangBusyFactor':_0x4d490f[_0x5e8e('0x6c')],'startPredictive':_0x4d490f['startPredictive'],'startProgressive':_0x4d490f['startProgressive']};if(_0x4d490f['Trunk']){_0xc2d23[_0x5e8e('0x6d')]={'id':_0x4d490f[_0x5e8e('0x6d')]['id'],'name':_0x4d490f[_0x5e8e('0x6d')]['name'],'active':_0x4d490f['Trunk'][_0x5e8e('0x6e')],'callerid':_0x4d490f['Trunk'][_0x5e8e('0x6f')]};}if(_0x4d490f['Interval']){_0xc2d23['Interval']={'id':_0x4d490f[_0x5e8e('0x41')]['id'],'name':_0x4d490f['Interval'][_0x5e8e('0x3e')]};}var _0x54d4a8=md5(JSON[_0x5e8e('0x47')](_0xc2d23));if(_0x4d490f[_0x5e8e('0x4')]!==_0x54d4a8){_0x4d490f[_0x5e8e('0x4')]=_0x54d4a8;emit(util[_0x5e8e('0x70')]('voice:queue:%s',_0xc2d23['name']),_0x5e8e('0x71'),_0xc2d23);}}}function emitCampaignSummary(_0x50fec0){if(_0x50fec0['type']===_0x5e8e('0x72')){emit(util[_0x5e8e('0x70')]('campaign:ivr:%s',_0x50fec0[_0x5e8e('0x3e')]),'campaign:save',_0x50fec0);}}function checkGetDataPredictive(_0x13df4a){if(isNotNull(_0x13df4a)){if(!_['isEmpty'](_0x13df4a)){loggerPredictive['info'](_0x5e8e('0x73'));loggerPredictive[_0x5e8e('0x74')](_0x5e8e('0x75'),_0x13df4a[_0x5e8e('0x76')]);loggerPredictive['info'](_0x5e8e('0x77'),_0x13df4a['predictiveIntervalAnsweredCalls']);loggerPredictive[_0x5e8e('0x74')](_0x5e8e('0x78'),_0x13df4a[_0x5e8e('0x79')]);loggerPredictive[_0x5e8e('0x74')](_0x5e8e('0x7a'),_0x13df4a['predictiveIntervalDroppedCallsCallersExit']);loggerPredictive[_0x5e8e('0x74')](_0x5e8e('0x7b'),_0x13df4a[_0x5e8e('0x7c')]);loggerPredictive[_0x5e8e('0x74')](_0x5e8e('0x7d'),_0x13df4a[_0x5e8e('0x61')]);loggerPredictive[_0x5e8e('0x74')](_0x5e8e('0x7e'));if(_0x13df4a[_0x5e8e('0x76')]>0x0){if(!_['isUndefined'](_0x13df4a[_0x5e8e('0x61')])&&_0x13df4a['predictiveIntervalAvgTalktime']>0x0){return!![];}else{loggerPredictive[_0x5e8e('0x74')]('Avg\x20Talk\x20Time\x20is\x20not\x20enough\x20for\x20predictive');}if(!_[_0x5e8e('0x3c')](_0x13df4a['predictiveIntervalAvgHoldtime'])&&_0x13df4a[_0x5e8e('0x7c')]>0x0){return!![];}else{loggerPredictive[_0x5e8e('0x74')](_0x5e8e('0x7f'));}}else{loggerPredictive[_0x5e8e('0x74')](_0x5e8e('0x80'));}}else{loggerPredictive[_0x5e8e('0x74')](_0x5e8e('0x81'));}}else{loggerPredictive[_0x5e8e('0x74')](_0x5e8e('0x81'));}return![];}function mergeDataErlangB(_0x51c2ed){return function(_0x12ac33){loggerPredictive[_0x5e8e('0x74')](_0x5e8e('0x82'));loggerPredictive['info'](_0x5e8e('0x83'),_0x12ac33[_0x5e8e('0x69')]);loggerPredictive[_0x5e8e('0x74')](_0x5e8e('0x84'),_0x12ac33['erlangCallToSecond']);loggerPredictive['info'](_0x5e8e('0x85'),_0x12ac33[_0x5e8e('0x6b')]);loggerPredictive[_0x5e8e('0x74')](_0x5e8e('0x86'),_0x12ac33[_0x5e8e('0x6c')]);loggerPredictive[_0x5e8e('0x74')](_0x5e8e('0x85'),_0x12ac33[_0x5e8e('0x6b')]);loggerPredictive[_0x5e8e('0x74')](_0x5e8e('0x7e'));_[_0x5e8e('0x87')](_0x51c2ed,_0x12ac33);};}function getDiff(_0x267cd6){var _0x336a07=moment()['milliseconds'](0x0);var _0x1bf455=moment(_0x267cd6)[_0x5e8e('0x48')](0x0);return _0x336a07['diff'](_0x1bf455,_0x5e8e('0x88'));}function ifInterval(_0x52a3b3,_0x5acfa7){if(_[_0x5e8e('0x3c')](_0x5acfa7)){return![];}if(getDiff(_0x5acfa7)<_0x52a3b3*0x3c){return!![];}else{return![];}}function freeVariablesPredictive(_0x15f481){if(isNotNull(_0x15f481)){if(!_[_0x5e8e('0x3c')](_0x15f481[_0x5e8e('0x2a')])){_0x15f481['startProgressive']=undefined;loggerPredictive['info'](_0x15f481[_0x5e8e('0x3e')],_0x5e8e('0x89'));}if(!_['isUndefined'](_0x15f481[_0x5e8e('0x29')])){_0x15f481[_0x5e8e('0x29')]=undefined;loggerPredictive['info'](_0x15f481[_0x5e8e('0x3e')],_0x5e8e('0x8a'));}if(!_['isUndefined'](_0x15f481[_0x5e8e('0x8b')])){clearInterval(_0x15f481[_0x5e8e('0x8b')]);_0x15f481[_0x5e8e('0x8b')]=undefined;loggerPredictive[_0x5e8e('0x74')](_0x15f481[_0x5e8e('0x3e')],_0x5e8e('0x8c'));}}}function erlangb(_0xf252f8,_0x38f0b5){if(_0x38f0b5===0x0){return 0x0;}var _0x4fbfa2=0x1;for(var _0x3d11b5=0x1;_0x3d11b5<=_0x38f0b5;_0x3d11b5+=0x1){_0x4fbfa2=0x1+_0x4fbfa2*_0x3d11b5/_0xf252f8;}return 0x1/_0x4fbfa2;}function isVoiceQueueOutbound(_0x1741cd){return _0x1741cd===_0x5e8e('0x4b');}function isNotPreview(_0x64b107){return _0x64b107!=='preview';}function isCampaignIvr(_0x171c11){return _0x171c11===_0x5e8e('0x72');}function getCallerId(_0x11842e,_0x2a1b29,_0x481d80){if(!_[_0x5e8e('0x3c')](_0x481d80)&&_0x5e8e('0x8d')===typeof _0x481d80&&!_['isEmpty'](_0x481d80)){if(!_['isUndefined'](_0x2a1b29)&&'string'===typeof _0x2a1b29&&!_[_0x5e8e('0x8e')](_0x2a1b29)){return util[_0x5e8e('0x70')](_0x5e8e('0x8f'),_0x2a1b29,_0x481d80);}return util['format'](_0x5e8e('0x8f'),_0x481d80,_0x481d80);}if(!_[_0x5e8e('0x3c')](_0x11842e)&&_0x5e8e('0x8d')===typeof _0x11842e&&!_['isEmpty'](_0x11842e)){return _0x11842e;}return'\x22\x22\x20<>';}function loggerCatchQueueSummary(_0xf0b5b2,_0x4f130a){return function(_0x4b54e4){freeVariablesPredictive(_0x4f130a);emitVoiceQueueSummary(_0x4f130a);emitCampaignSummary(_0x4f130a);loggerSyncQueueSummary[_0x5e8e('0x90')](_0xf0b5b2,util[_0x5e8e('0x91')](_0x4b54e4,{'showHidden':![],'depth':null}));};}function loggerCatchPredictive(_0x1e880c,_0x3aa706){return function(_0x3ef52f){loggerPredictive['error'](_0x3aa706[_0x5e8e('0x3e')],_0x1e880c);loggerPredictive[_0x5e8e('0x90')](_0x3ef52f[_0x5e8e('0x92')]);freeVariablesPredictive(_0x3aa706);};}function loggerCatch(_0x146ee0){return function(_0x58cc81){logger['error'](_0x146ee0,util[_0x5e8e('0x91')](_0x58cc81,{'showHidden':![],'depth':null}));};}function checkContactEmpty(_0x6dd57c){return _0x6dd57c&&!_[_0x5e8e('0x3c')](_0x6dd57c)&&_0x6dd57c['length']>0x0;}function decremetOriginate(_0x52ff89){if(!_[_0x5e8e('0x3c')](_0x52ff89)&&_0x52ff89!==null){if(_0x52ff89[_0x5e8e('0x93')](_0x5e8e('0x68'))){if(_0x52ff89[_0x5e8e('0x68')]>0x0){_0x52ff89[_0x5e8e('0x68')]-=0x1;}else{logger[_0x5e8e('0x90')](_0x5e8e('0x94'));}}}else{logger[_0x5e8e('0x90')](_0x5e8e('0x95'));}}function checkContactLowerLimitOriginate(_0x1e64c8,_0x35d3d1,_0x80a813){if(_0x35d3d1>_0x80a813){for(var _0x102c67=0x0;_0x102c67<_0x35d3d1-_0x80a813;_0x102c67+=0x1){decremetOriginate(_0x1e64c8);}}}function loggerGetContactDialer(_0x371897,_0xba053e,_0x8c2065){return function(_0x1db088){checkContactLowerLimitOriginate(_0xba053e,_0x8c2065,0x0);logger['error'](_0x371897,util[_0x5e8e('0x91')](_0x1db088,{'showHidden':![],'depth':null}));};}function sendMessageReschedule(_0x19cf93){return function(_0x51ff97){if(isNotNull(_0x51ff97)&&isNotNull(_0x51ff97[0x0])){if(_0x51ff97[0x0][_0x5e8e('0x96')]>0x0){_0x19cf93[_0x5e8e('0x3f')]='RESCHEDULED_CONTACTS';logger[_0x5e8e('0x74')](_0x5e8e('0x97')+_0x19cf93[_0x5e8e('0x3e')],_0x51ff97[0x0][_0x5e8e('0x96')],_0x5e8e('0x98'));}else{_0x19cf93[_0x5e8e('0x3f')]='AVAILABLE_CONTACTS_FINISHED';logger[_0x5e8e('0x74')](_0x5e8e('0x99')+_0x19cf93[_0x5e8e('0x3e')]);}}};}function notSendMessagesQueue(_0x3ee45f){if(_0x3ee45f[_0x5e8e('0x9a')]){freeVariablesPredictive(_0x3ee45f);if(_0x3ee45f[_0x5e8e('0x68')]===0x0&&_0x3ee45f[_0x5e8e('0x54')]===0x0&&_0x3ee45f[_0x5e8e('0x57')]===0x0&&(_0x3ee45f['pTalking']||0x0)===0x0){_0x3ee45f[_0x5e8e('0x9a')]=![];_0x3ee45f['available']=0x0;_0x3ee45f[_0x5e8e('0x3f')]='NOT_ACTIVE';loggerSyncQueueSummary[_0x5e8e('0x90')]('[syncQueueSummary]\x20Campaign\x20Queue:\x20',_0x3ee45f['name'],_0x5e8e('0x9b'));}else{_0x3ee45f['message']='IS_DISACTIVED';loggerSyncQueueSummary[_0x5e8e('0x90')]('[syncQueueSummary]\x20Campaign\x20Queue:\x20',_0x3ee45f[_0x5e8e('0x3e')],_0x5e8e('0x9c'));}emitVoiceQueueSummary(_0x3ee45f);}}function notSendMessagesCampaign(_0xd48e49){if(_0xd48e49[_0x5e8e('0x9a')]){if(_0xd48e49[_0x5e8e('0x68')]===0x0){_0xd48e49[_0x5e8e('0x9a')]=![];_0xd48e49[_0x5e8e('0x3f')]=_0x5e8e('0x9d');loggerSyncQueueSummary[_0x5e8e('0x90')](_0x5e8e('0x9e'),_0xd48e49[_0x5e8e('0x3e')],_0x5e8e('0x9b'));}else{_0xd48e49[_0x5e8e('0x3f')]=_0x5e8e('0x9f');loggerSyncQueueSummary[_0x5e8e('0x90')]('[syncQueueSummary]\x20Campaign\x20Ivr:\x20',_0xd48e49[_0x5e8e('0x3e')],_0x5e8e('0x9c'));}emitCampaignSummary(_0xd48e49);}}function createObjHistory(_0x1b3f6d,_0x5d2875,_0x2f2f74,_0x1ce561,_0x560822){_0x1b3f6d[_0x5e8e('0x3f')]=_0x2f2f74;var _0x4be70b=new Action(_0x1b3f6d,_0x5d2875);var _0x1aeeee=new History(_0x4be70b);_0x1aeeee[_0x5e8e('0xa0')]=_0x1ce561;_0x1aeeee[_0x5e8e('0xa1')]=_0x560822;_0x1aeeee[_0x5e8e('0xa2')]=_0x4be70b[_0x5e8e('0xa3')];return _0x1aeeee;}Dialer['prototype'][_0x5e8e('0x3b')]=function(){var _0x43067b=this;setInterval(function(){_0x43067b[_0x5e8e('0xa4')](_0x43067b[_0x5e8e('0xa5')],_0x5e8e('0xa6'));_0x43067b['clearZombieChannels'](_0x43067b[_0x5e8e('0xa7')],'[actions]');},0x32c8);};Dialer[_0x5e8e('0x1d')][_0x5e8e('0xa4')]=function(_0xee4465,_0x1014d6){var _0xb70584=this;for(var _0x2c6b22 in _0xee4465){if(_0xee4465['hasOwnProperty'](_0x2c6b22)){this[_0x5e8e('0x20')][_0x5e8e('0x1e')](function(){if(!_[_0x5e8e('0xa8')](_0xee4465[_0x2c6b22])){return ami[_0x5e8e('0xa9')]({'action':'status','channel':_0xee4465[_0x2c6b22][_0x5e8e('0xaa')]})[_0x5e8e('0xab')](function(_0x590f5c){if(_0x590f5c[_0x5e8e('0x3f')]===_0x5e8e('0xac')){setTimeout(function(){if(_0xee4465[_0x2c6b22]&&_0xee4465[_0x2c6b22]['type']!==_0x5e8e('0x72')){_0xb70584[_0x5e8e('0xad')](_0xb70584[_0x5e8e('0x22')][_0xee4465[_0x2c6b22][_0x5e8e('0xae')]]);logger[_0x5e8e('0x90')](_0x5e8e('0xaf'),_0x1014d6,_0x2c6b22,_0xee4465[_0x2c6b22]['queue']);delete _0xee4465[_0x2c6b22];}if(_0xee4465[_0x2c6b22]&&_0xee4465[_0x2c6b22][_0x5e8e('0xb0')]===_0x5e8e('0x72')){_0xb70584[_0x5e8e('0xad')](_0xb70584['campaigns'][_0xee4465[_0x2c6b22][_0x5e8e('0xae')]]);logger['error']('[Dialer][checkChannel][ivr]',_0x1014d6,_0x2c6b22,_0xee4465[_0x2c6b22][_0x5e8e('0xae')]);delete _0xee4465[_0x2c6b22];}},0x2328);}});}});}}};Dialer[_0x5e8e('0x1d')][_0x5e8e('0xb1')]=function(_0xb5ca72){return BPromise[_0x5e8e('0xb2')]()[_0x5e8e('0xb3')](cmHopper[_0x5e8e('0xb1')](_0xb5ca72))['catch'](loggerCatch(_0x5e8e('0xb4')));};Dialer[_0x5e8e('0x1d')][_0x5e8e('0xb5')]=function(_0x4fc0e5){return BPromise[_0x5e8e('0xb2')]()['then'](cmHopperBlack[_0x5e8e('0xb5')](_0x4fc0e5))['catch'](loggerCatch(_0x5e8e('0xb6')));};Dialer[_0x5e8e('0x1d')][_0x5e8e('0xb7')]=function(_0x211b65){return BPromise[_0x5e8e('0xb2')]()[_0x5e8e('0xb3')](cmHopperBlack[_0x5e8e('0xb7')](_0x211b65))['catch'](loggerCatch(_0x5e8e('0xb8')));};Dialer[_0x5e8e('0x1d')][_0x5e8e('0xb9')]=function(_0x1cc7d3){return BPromise[_0x5e8e('0xb2')]()[_0x5e8e('0xb3')](cmHopperHistory[_0x5e8e('0xba')](_0x1cc7d3))[_0x5e8e('0xab')](loggerCatch('[averageHandleTime]\x20'));};Dialer['prototype'][_0x5e8e('0xbb')]=function(_0x59bc8f){return BPromise[_0x5e8e('0xb2')]()['then'](cmHopper['rescheduleContact'](_0x59bc8f))[_0x5e8e('0xab')](loggerCatch('[rescheduleContact]\x20'));};Dialer['prototype'][_0x5e8e('0xbc')]=function(_0x10f5d2,_0x39af1d,_0xed7124){return BPromise[_0x5e8e('0xb2')]()['then'](cmHopper[_0x5e8e('0xbc')](_0x10f5d2,_0x39af1d,_0xed7124))[_0x5e8e('0xab')](loggerCatch(_0x5e8e('0xbd')));};Dialer[_0x5e8e('0x1d')][_0x5e8e('0xbe')]=function(_0x2d671a,_0x35f045,_0x43a182,_0x3fce41){return BPromise['resolve']()['then'](cmHopper['getContactDialer'](_0x2d671a,_0x35f045,_0x43a182,_0x3fce41))[_0x5e8e('0xab')](loggerCatch(_0x5e8e('0xbf')));};Dialer[_0x5e8e('0x1d')][_0x5e8e('0xc0')]=function(_0x40e3c9,_0x5833f3,_0x298932){return BPromise[_0x5e8e('0xb2')]()[_0x5e8e('0xb3')](cmHopper[_0x5e8e('0xc0')](_0x40e3c9,_0x5833f3,_0x298932))[_0x5e8e('0xab')](loggerCatch(_0x5e8e('0xbf')));};Dialer[_0x5e8e('0x1d')]['getVoiceQueueRtPauses']=function(_0x12087d){return BPromise[_0x5e8e('0xb2')]()[_0x5e8e('0xb3')](voiceQueueRt[_0x5e8e('0xc1')](_0x12087d))[_0x5e8e('0xab')](loggerCatch(_0x5e8e('0xc2')));};Dialer[_0x5e8e('0x1d')][_0x5e8e('0xc3')]=function(_0x5c9b38){return BPromise[_0x5e8e('0xb2')]()[_0x5e8e('0xb3')](cmHopper[_0x5e8e('0xc3')](_0x5c9b38))[_0x5e8e('0xab')](loggerCatch('[moveContactManagedDialer]\x20'));};Dialer[_0x5e8e('0x1d')]['createHistory']=function(_0x3651a2){return BPromise[_0x5e8e('0xb2')]()['then'](cmHopperHistory[_0x5e8e('0xc4')](_0x3651a2))[_0x5e8e('0xab')](loggerCatch('[createHistory]\x20'));};Dialer['prototype'][_0x5e8e('0xad')]=function(_0x4b7b99){if(!_[_0x5e8e('0x3c')](_0x4b7b99)&&_0x4b7b99!==null){if(_0x4b7b99[_0x5e8e('0x93')]('originated')){if(_0x4b7b99[_0x5e8e('0x68')]>0x0){_0x4b7b99[_0x5e8e('0x68')]-=0x1;}else{logger[_0x5e8e('0x90')](_0x5e8e('0xc5'));}}}else{logger[_0x5e8e('0x90')](_0x5e8e('0xc6'));}};Dialer[_0x5e8e('0x1d')][_0x5e8e('0xc7')]=function(_0x354da4,_0x5d6aa0){var _0x56fd78=this;return function(_0x31eb11){_0x56fd78[_0x5e8e('0xad')](_0x5d6aa0);logger[_0x5e8e('0x90')](_0x354da4,util[_0x5e8e('0x91')](_0x31eb11,{'showHidden':![],'depth':null}));};};Dialer[_0x5e8e('0x1d')][_0x5e8e('0xc8')]=function(_0x4c0c7e,_0x2a75e2,_0x16c746){var _0x54e88d={'state':0x19,'statedesc':_0x5e8e('0xc9')};this[_0x5e8e('0xad')](_0x2a75e2);this[_0x5e8e('0xca')](_[_0x5e8e('0x87')](_0x54e88d,_['pick'](_0x16c746,['ContactId',_0x5e8e('0xcb'),_0x5e8e('0xcc'),'VoiceQueueId','CampaignId'])),_0x5e8e('0xcd'),_0x5e8e('0xce'));logger[_0x5e8e('0x90')](_0x4c0c7e);};Dialer['prototype'][_0x5e8e('0xcf')]=function(_0x1570a5){return _0x1570a5===_0x5e8e('0xd0');};Dialer[_0x5e8e('0x1d')][_0x5e8e('0xd1')]=function(_0x388bb0){return!_[_0x5e8e('0x3c')](_0x388bb0)&&_0x388bb0&&!_[_0x5e8e('0x3c')](_0x388bb0[_0x5e8e('0x3e')])&&!_[_0x5e8e('0x3c')](_0x388bb0['active'])&&_0x388bb0[_0x5e8e('0x6e')]&&(this[_0x5e8e('0x25')][util[_0x5e8e('0x70')](_0x5e8e('0xd2'),_0x388bb0['name'])][_0x5e8e('0xd3')]==='reachable'||this[_0x5e8e('0x25')][util[_0x5e8e('0x70')](_0x5e8e('0xd2'),_0x388bb0['name'])][_0x5e8e('0xd3')]===_0x5e8e('0xd4'));};Dialer[_0x5e8e('0x1d')][_0x5e8e('0xca')]=function(_0x36f373,_0x45bbde,_0x502df7){this[_0x5e8e('0xc4')](_0x36f373)[_0x5e8e('0xab')](loggerCatch(_0x45bbde));this[_0x5e8e('0xc3')](_0x36f373)[_0x5e8e('0xab')](loggerCatch(_0x502df7));};Dialer[_0x5e8e('0x1d')][_0x5e8e('0x36')]=function(_0x2314e2){var _0x269b0f=this[_0x5e8e('0xa5')][_0x2314e2[_0x5e8e('0xd5')]];var _0x231cfb;if(!_[_0x5e8e('0xa8')](_0x2314e2)&&!_[_0x5e8e('0xa8')](_0x2314e2['variable'])&&!_[_0x5e8e('0xa8')](_0x2314e2[_0x5e8e('0xd6')][_0x5e8e('0xd7')])&&_0x2314e2[_0x5e8e('0xd8')]===_0x5e8e('0xd9')&&_0x269b0f){if(_0x269b0f[_0x5e8e('0xb0')]!==_0x5e8e('0x72')&&this[_0x5e8e('0x22')][_0x269b0f[_0x5e8e('0xae')]][_0x5e8e('0xda')]&&_0x2314e2[_0x5e8e('0xdb')]===_0x5e8e('0xdc')){delete this['uniqueId'][_0x2314e2[_0x5e8e('0xd5')]];this[_0x5e8e('0xad')](this['voiceQueues'][_0x269b0f['queue']]);this[_0x5e8e('0x22')][_0x269b0f[_0x5e8e('0xae')]][_0x5e8e('0xdd')]+=0x1;this['voiceQueues'][_0x269b0f[_0x5e8e('0xae')]]['outboundAnswerAgiCallsDay']+=0x1;_0x231cfb=new Hangup(_0x269b0f,_0x2314e2);_0x231cfb[_0x5e8e('0xa0')]=0x12;_0x231cfb[_0x5e8e('0xa1')]=_0x5e8e('0xde');_0x231cfb['membername']='AMD';this['saveInDb'](_0x231cfb,_0x5e8e('0xdf'),_0x5e8e('0xe0'));}if(_0x269b0f[_0x5e8e('0xb0')]!==_0x5e8e('0x72')&&this[_0x5e8e('0x22')][_0x269b0f[_0x5e8e('0xae')]][_0x5e8e('0xda')]&&_0x2314e2[_0x5e8e('0xdb')]==='MACHINE'){delete this['uniqueId'][_0x2314e2[_0x5e8e('0xd5')]];this[_0x5e8e('0xad')](this[_0x5e8e('0x22')][_0x269b0f[_0x5e8e('0xae')]]);this[_0x5e8e('0x22')][_0x269b0f[_0x5e8e('0xae')]]['outboundAnswerCallsDay']+=0x1;this['voiceQueues'][_0x269b0f['queue']][_0x5e8e('0xe1')]+=0x1;_0x231cfb=new Hangup(_0x269b0f,_0x2314e2);_0x231cfb[_0x5e8e('0xa0')]=0x13;_0x231cfb[_0x5e8e('0xa1')]=_0x5e8e('0xe2');_0x231cfb[_0x5e8e('0xe3')]=_0x5e8e('0xe4');_0x231cfb['amd']=!![];this[_0x5e8e('0xca')](_0x231cfb,_0x5e8e('0xe5'),_0x5e8e('0xe6'));}if(_0x269b0f[_0x5e8e('0xb0')]===_0x5e8e('0x72')&&this[_0x5e8e('0x23')][_0x269b0f[_0x5e8e('0xae')]][_0x5e8e('0xda')]&&_0x2314e2['value']==='HANGUP'){delete this['uniqueId'][_0x2314e2[_0x5e8e('0xd5')]];this['updateOriginated'](this[_0x5e8e('0x23')][_0x269b0f[_0x5e8e('0xae')]]);_0x231cfb=new Hangup(_0x269b0f,_0x2314e2);_0x231cfb['state']=0x12;_0x231cfb[_0x5e8e('0xa1')]=_0x5e8e('0xde');_0x231cfb['membername']=_0x5e8e('0xe4');this[_0x5e8e('0xca')](_0x231cfb,_0x5e8e('0xe7'),_0x5e8e('0xe8'));}if(_0x269b0f[_0x5e8e('0xb0')]===_0x5e8e('0x72')&&this['campaigns'][_0x269b0f[_0x5e8e('0xae')]][_0x5e8e('0xda')]&&_0x2314e2[_0x5e8e('0xdb')]===_0x5e8e('0xe9')){delete this[_0x5e8e('0xa5')][_0x2314e2[_0x5e8e('0xd5')]];this['updateOriginated'](this[_0x5e8e('0x23')][_0x269b0f[_0x5e8e('0xae')]]);_0x231cfb=new Hangup(_0x269b0f,_0x2314e2);_0x231cfb[_0x5e8e('0xa0')]=0x13;_0x231cfb[_0x5e8e('0xa1')]=_0x5e8e('0xe2');_0x231cfb[_0x5e8e('0xe3')]=_0x5e8e('0xe4');_0x231cfb['amd']=!![];this[_0x5e8e('0xca')](_0x231cfb,_0x5e8e('0xea'),_0x5e8e('0xeb'));}}};Dialer['prototype'][_0x5e8e('0xec')]=function(_0x24aaed){var _0x18734a=this[_0x5e8e('0xa5')][_0x24aaed[_0x5e8e('0xd5')]];var _0x402595=this;var _0x19ee76;if(_0x18734a&&_0x18734a['type']===_0x5e8e('0x72')){delete this[_0x5e8e('0xa5')][_0x24aaed[_0x5e8e('0xd5')]];this[_0x5e8e('0xad')](this[_0x5e8e('0x23')][_0x18734a[_0x5e8e('0xae')]]);this[_0x5e8e('0x23')][_0x18734a[_0x5e8e('0xae')]]['ivrAnswerCallsDay']+=0x1;_0x19ee76=new Hangup(_0x18734a,_0x24aaed);this[_0x5e8e('0xc4')](_0x19ee76)[_0x5e8e('0xab')](loggerCatch(_0x5e8e('0xed')));this[_0x5e8e('0xc3')](_0x19ee76)[_0x5e8e('0xab')](loggerCatch(_0x5e8e('0xee')));}if(_0x18734a&&_0x18734a[_0x5e8e('0xb0')]!==_0x5e8e('0x72')&&isNotNull(this[_0x5e8e('0x22')][_0x18734a[_0x5e8e('0xae')]][_0x5e8e('0xef')])){delete this[_0x5e8e('0xa5')][_0x24aaed[_0x5e8e('0xd5')]];this[_0x5e8e('0xad')](this[_0x5e8e('0x22')][_0x18734a[_0x5e8e('0xae')]]);this[_0x5e8e('0x22')][_0x18734a[_0x5e8e('0xae')]]['outboundAnswerCallsDay']+=0x1;this[_0x5e8e('0x22')][_0x18734a[_0x5e8e('0xae')]][_0x5e8e('0xe1')]+=0x1;_0x19ee76=new Hangup(_0x18734a,_0x24aaed);_0x19ee76[_0x5e8e('0xa0')]=0x10;_0x19ee76[_0x5e8e('0xa1')]=_0x5e8e('0xf0');_0x19ee76[_0x5e8e('0xe3')]=_0x5e8e('0xf1');this[_0x5e8e('0xc4')](_0x19ee76)[_0x5e8e('0xab')](loggerCatch('[syncHangupIvr][createHistory]'));this[_0x5e8e('0xc3')](_0x19ee76)[_0x5e8e('0xab')](loggerCatch(_0x5e8e('0xee')));}if(_0x18734a&&_0x18734a[_0x5e8e('0xb0')]!==_0x5e8e('0x72')&&!isNotNull(this['voiceQueues'][_0x18734a[_0x5e8e('0xae')]][_0x5e8e('0xef')])){delete this[_0x5e8e('0xa5')][_0x24aaed[_0x5e8e('0xd5')]];this['updateOriginated'](this[_0x5e8e('0x22')][_0x18734a[_0x5e8e('0xae')]]);this[_0x5e8e('0x22')][_0x18734a[_0x5e8e('0xae')]]['outboundUnknownCallsDay']+=0x1;_0x19ee76=new Hangup(_0x18734a,_0x24aaed);_0x19ee76['state']=0xc;_0x19ee76[_0x5e8e('0xa1')]=_0x24aaed[_0x5e8e('0xf2')];_0x19ee76[_0x5e8e('0xe3')]=_0x5e8e('0xf3');this['createHistory'](_0x19ee76)[_0x5e8e('0xab')](loggerCatch(_0x5e8e('0xed')));this[_0x5e8e('0xc3')](_0x19ee76)[_0x5e8e('0xab')](loggerCatch(_0x5e8e('0xee')));}};Dialer[_0x5e8e('0x1d')][_0x5e8e('0xf4')]=function(_0x16b11b){var _0x694c85=this['uniqueId'][_0x16b11b[_0x5e8e('0xd5')]];var _0x13888e=this;if(this[_0x5e8e('0x22')][_0x16b11b[_0x5e8e('0xae')]]){if(_0x694c85&&_0x694c85[_0x5e8e('0xb0')]!==_0x5e8e('0x72')){delete this[_0x5e8e('0xa5')][_0x16b11b[_0x5e8e('0xd5')]];this[_0x5e8e('0x22')][_0x16b11b[_0x5e8e('0xae')]][_0x5e8e('0xdd')]+=0x1;var _0x531221=new AgentComplete(_0x694c85,_0x16b11b);if(_0x16b11b[_0x5e8e('0xf5')]==='agent'){_0x531221['agiafterat']=this[_0x5e8e('0x22')][_0x16b11b['queue']][_0x5e8e('0xf6')]&&this['voiceQueues'][_0x16b11b[_0x5e8e('0xae')]][_0x5e8e('0xf7')]?moment()['format']('YYYY-MM-DD\x20HH:mm:ss'):undefined;}this[_0x5e8e('0xc4')](_0x531221)[_0x5e8e('0xab')](loggerCatch('[syncAgentComplete][createHistory]'));this[_0x5e8e('0xc3')](_0x531221)['catch'](loggerCatch(_0x5e8e('0xf8')));}}};Dialer['prototype'][_0x5e8e('0xf9')]=function(_0x48772f){if(this[_0x5e8e('0x22')][_0x48772f[_0x5e8e('0xae')]]){if(this[_0x5e8e('0xa5')][_0x48772f['uniqueid']]&&this[_0x5e8e('0xa5')][_0x48772f[_0x5e8e('0xd5')]][_0x5e8e('0xb0')]!==_0x5e8e('0x72')){this[_0x5e8e('0xad')](this['voiceQueues'][_0x48772f[_0x5e8e('0xae')]]);this['uniqueId'][_0x48772f[_0x5e8e('0xd5')]][_0x5e8e('0xfa')]=moment()[_0x5e8e('0x70')]('YYYY-MM-DD\x20HH:mm:ss');}}};Dialer[_0x5e8e('0x1d')]['queueCallerAbandonCreateState']=function(_0xc01d5){this['createHistory'](_0xc01d5)[_0x5e8e('0xab')](loggerCatch(_0x5e8e('0xfb')));this['moveContactManagedDialer'](_0xc01d5)[_0x5e8e('0xab')](loggerCatch(_0x5e8e('0xfc')));};Dialer[_0x5e8e('0x1d')][_0x5e8e('0x30')]=function(_0x14a0ab){var _0x5b06c4=this['uniqueId'][_0x14a0ab['uniqueid']];var _0x311c7d=this;if(this[_0x5e8e('0x22')][_0x14a0ab[_0x5e8e('0xae')]]){if(_0x5b06c4&&_0x5b06c4[_0x5e8e('0xb0')]!==_0x5e8e('0x72')){delete this[_0x5e8e('0xa5')][_0x14a0ab['uniqueid']];this[_0x5e8e('0xad')](this[_0x5e8e('0x22')][_0x14a0ab[_0x5e8e('0xae')]]);_0x5b06c4[_0x5e8e('0xfd')]=moment()[_0x5e8e('0x70')](_0x5e8e('0xfe'));var _0x1d44af=new QueueCallerAbandon(_0x5b06c4,_0x14a0ab);if(getSeconds(_0x5b06c4[_0x5e8e('0xfd')],_0x5b06c4['responsetime'])>=_0x5b06c4[_0x5e8e('0xff')]){this[_0x5e8e('0x22')][_0x14a0ab[_0x5e8e('0xae')]][_0x5e8e('0x79')]+=0x1;this[_0x5e8e('0x22')][_0x14a0ab[_0x5e8e('0xae')]]['outboundDropCallsDayTimeout']+=0x1;this[_0x5e8e('0x22')][_0x14a0ab['queue']][_0x5e8e('0x64')]+=0x1;_0x1d44af[_0x5e8e('0xa0')]=0xa;_0x1d44af[_0x5e8e('0xa1')]=_0x5e8e('0x100');_0x1d44af[_0x5e8e('0x101')]=_0x5e8e('0x102');_0x1d44af[_0x5e8e('0x103')]=this[_0x5e8e('0x22')][_0x14a0ab[_0x5e8e('0xae')]][_0x5e8e('0xf6')]?moment()[_0x5e8e('0x70')](_0x5e8e('0xfe')):undefined;if(_0x1d44af[_0x5e8e('0x104')]>=this[_0x5e8e('0x22')][_0x14a0ab['queue']][_0x5e8e('0x105')]){this[_0x5e8e('0x106')](_0x1d44af);}else{this['rescheduleContact']({'active':![],'countdropretry':_0x1d44af[_0x5e8e('0x104')]+=0x1,'scheduledat':moment()[_0x5e8e('0x107')](this[_0x5e8e('0x22')][_0x14a0ab[_0x5e8e('0xae')]][_0x5e8e('0x108')],_0x5e8e('0x109'))['format'](_0x5e8e('0xfe')),'ContactId':_0x5b06c4[_0x5e8e('0x10a')],'ListId':_0x5b06c4['ListId'],'VoiceQueueId':_0x5b06c4[_0x5e8e('0x10b')]||undefined,'CampaignId':_0x5b06c4['CampaignId']||undefined})[_0x5e8e('0xab')](loggerCatch(_0x5e8e('0x10c')));}}else{this[_0x5e8e('0x22')][_0x14a0ab[_0x5e8e('0xae')]][_0x5e8e('0x62')]+=0x1;this[_0x5e8e('0x22')][_0x14a0ab[_0x5e8e('0xae')]]['outboundDropCallsDayCallersExit']+=0x1;_0x1d44af[_0x5e8e('0xa0')]=0xb;_0x1d44af[_0x5e8e('0xa1')]=_0x5e8e('0x10d');_0x1d44af['dropreason']=_0x5e8e('0x10e');if(_0x1d44af[_0x5e8e('0x10f')]>=this[_0x5e8e('0x22')][_0x14a0ab['queue']][_0x5e8e('0x110')]){this[_0x5e8e('0x106')](_0x1d44af);}else{this[_0x5e8e('0xbb')]({'active':![],'countabandonedretry':_0x1d44af[_0x5e8e('0x10f')]+=0x1,'scheduledat':moment()[_0x5e8e('0x107')](this[_0x5e8e('0x22')][_0x14a0ab[_0x5e8e('0xae')]][_0x5e8e('0x111')],_0x5e8e('0x109'))['format']('YYYY-MM-DD\x20HH:mm:ss'),'ContactId':_0x5b06c4[_0x5e8e('0x10a')],'ListId':_0x5b06c4[_0x5e8e('0xcb')],'VoiceQueueId':_0x5b06c4['VoiceQueueId']||undefined,'CampaignId':_0x5b06c4[_0x5e8e('0x112')]||undefined})[_0x5e8e('0xab')](loggerCatch('[rescheduleContact][Abandoned]'));}}}}};Dialer[_0x5e8e('0x1d')][_0x5e8e('0x113')]=function(_0x12e879){if(this[_0x5e8e('0xa7')][_0x12e879[_0x5e8e('0xd5')]]){this['actions'][_0x12e879[_0x5e8e('0xd5')]][_0x5e8e('0xaa')]=_0x12e879[_0x5e8e('0xaa')];}if(this['uniqueId'][_0x12e879['uniqueid']]){this[_0x5e8e('0xa5')][_0x12e879[_0x5e8e('0xd5')]][_0x5e8e('0xaa')]=_0x12e879[_0x5e8e('0xaa')];}};Dialer[_0x5e8e('0x1d')][_0x5e8e('0x114')]=function(_0x11ade5){if(strategy[this[_0x5e8e('0x22')][this[_0x5e8e('0xa7')][_0x11ade5['actionid']][_0x5e8e('0xae')]][_0x5e8e('0x4c')]]==='roundrobin'){if(this[_0x5e8e('0xa7')][_0x11ade5[_0x5e8e('0x115')]]&&_[_0x5e8e('0xa8')](this[_0x5e8e('0xa7')][_0x11ade5[_0x5e8e('0x115')]][_0x5e8e('0x116')])&&_0x11ade5[_0x5e8e('0xd3')]==='1'&&_0x11ade5['paused']==='0'){if(this[_0x5e8e('0x24')][_0x11ade5['stateinterface']]){if(!this[_0x5e8e('0x24')][_0x11ade5['stateinterface']][_0x5e8e('0x116')]){this[_0x5e8e('0x24')][_0x11ade5[_0x5e8e('0x117')]]['locked']=!![];this[_0x5e8e('0xa7')][_0x11ade5[_0x5e8e('0x115')]]['locked']=!![];this[_0x5e8e('0xa7')][_0x11ade5['actionid']][_0x5e8e('0x117')]=_0x11ade5[_0x5e8e('0x117')];}}}}else if((strategy[this[_0x5e8e('0x22')][this[_0x5e8e('0xa7')][_0x11ade5[_0x5e8e('0x115')]][_0x5e8e('0xae')]][_0x5e8e('0x4c')]]||_0x5e8e('0x118'))===_0x5e8e('0x118')){if(this[_0x5e8e('0xa7')][_0x11ade5[_0x5e8e('0x115')]]){if(this['agents'][_0x11ade5[_0x5e8e('0x117')]]){this[_0x5e8e('0xa7')][_0x11ade5[_0x5e8e('0x115')]][_0x5e8e('0x117')]=_0x11ade5['stateinterface'];if(_['isNil'](this['queueBooked'][this[_0x5e8e('0xa7')][_0x11ade5[_0x5e8e('0x115')]][_0x5e8e('0xae')]])){this[_0x5e8e('0x2c')][this[_0x5e8e('0xa7')][_0x11ade5[_0x5e8e('0x115')]][_0x5e8e('0xae')]]=[];}this[_0x5e8e('0x2c')][this[_0x5e8e('0xa7')][_0x11ade5[_0x5e8e('0x115')]][_0x5e8e('0xae')]][_0x5e8e('0x119')](_[_0x5e8e('0x87')](_[_0x5e8e('0x11a')](this[_0x5e8e('0xa7')][_0x11ade5[_0x5e8e('0x115')]],['idHopper',_0x5e8e('0x117')]),{'status':_0x11ade5[_0x5e8e('0xd3')],'paused':_0x11ade5[_0x5e8e('0x11b')]}));}}}};function unlockQueueStatus(_0x61b774,_0x37ee45){setTimeout(function(){if(_[_0x5e8e('0x3c')](_0x61b774[_0x5e8e('0x11c')])){loggerBooked[_0x5e8e('0x90')](_0x5e8e('0x11d'),_0x37ee45);}_0x61b774[_0x5e8e('0x11c')]=!![];loggerBooked[_0x5e8e('0x74')](_0x5e8e('0x11e'),_0x37ee45,JSON[_0x5e8e('0x47')](_[_0x5e8e('0x11a')](_0x61b774,[_0x5e8e('0x3e'),_0x5e8e('0x11c')])));},0x1f3);}Dialer[_0x5e8e('0x1d')][_0x5e8e('0x39')]=function(_0x3fcd8b){var _0x36e4bb=this;var _0x2212e7=_0x36e4bb[_0x5e8e('0x22')][_0x36e4bb[_0x5e8e('0xa7')][_0x3fcd8b[_0x5e8e('0x115')]]['queue']];if(strategy[this[_0x5e8e('0x22')][this[_0x5e8e('0xa7')][_0x3fcd8b[_0x5e8e('0x115')]][_0x5e8e('0xae')]][_0x5e8e('0x4c')]]===_0x5e8e('0x1c')){if(this['actions'][_0x3fcd8b[_0x5e8e('0x115')]]&&this[_0x5e8e('0xa7')][_0x3fcd8b[_0x5e8e('0x115')]][_0x5e8e('0x117')]){this['preview'][_0x5e8e('0x11f')](this['actions'][_0x3fcd8b['actionid']][_0x5e8e('0x120')],this[_0x5e8e('0xa7')][_0x3fcd8b[_0x5e8e('0x115')]]['stateinterface'])[_0x5e8e('0xab')](function(_0x4dd005){logger['error'](_0x5e8e('0x121'),util[_0x5e8e('0x91')](_0x4dd005,{'showHidden':![],'depth':null}));})['finally'](function(){_0x36e4bb['updateOriginated'](_0x36e4bb[_0x5e8e('0x22')][_0x36e4bb['actions'][_0x3fcd8b[_0x5e8e('0x115')]]['queue']]);_0x36e4bb[_0x5e8e('0x24')][_0x36e4bb[_0x5e8e('0xa7')][_0x3fcd8b['actionid']][_0x5e8e('0x117')]]['locked']=![];delete _0x36e4bb[_0x5e8e('0xa7')][_0x3fcd8b[_0x5e8e('0x115')]];unlockQueueStatus(_0x2212e7);});}else{this[_0x5e8e('0xad')](this[_0x5e8e('0x22')][this[_0x5e8e('0xa7')][_0x3fcd8b['actionid']][_0x5e8e('0xae')]]);this[_0x5e8e('0xbb')]({'active':![],'ContactId':this[_0x5e8e('0xa7')][_0x3fcd8b['actionid']][_0x5e8e('0x10a')],'ListId':this[_0x5e8e('0xa7')][_0x3fcd8b[_0x5e8e('0x115')]][_0x5e8e('0xcb')],'VoiceQueueId':this[_0x5e8e('0xa7')][_0x3fcd8b['actionid']][_0x5e8e('0x10b')]||undefined,'CampaignId':this['actions'][_0x3fcd8b[_0x5e8e('0x115')]][_0x5e8e('0x112')]||undefined})[_0x5e8e('0xab')](loggerCatch('[unlock][syncQueueStatusComplete]'));delete this[_0x5e8e('0xa7')][_0x3fcd8b[_0x5e8e('0x115')]];unlockQueueStatus(_0x2212e7);}}else if((strategy[this[_0x5e8e('0x22')][this[_0x5e8e('0xa7')][_0x3fcd8b[_0x5e8e('0x115')]][_0x5e8e('0xae')]][_0x5e8e('0x4c')]]||_0x5e8e('0x118'))===_0x5e8e('0x118')){var _0x4bbf89;if(this[_0x5e8e('0xa7')][_0x3fcd8b[_0x5e8e('0x115')]]&&!_['isEmpty'](this['queueBooked'][this[_0x5e8e('0xa7')][_0x3fcd8b['actionid']][_0x5e8e('0xae')]])){if(this['queueBookedRR'][_0x36e4bb[_0x5e8e('0xa7')][_0x3fcd8b[_0x5e8e('0x115')]][_0x5e8e('0xae')]]){this[_0x5e8e('0x2d')][_0x36e4bb[_0x5e8e('0xa7')][_0x3fcd8b[_0x5e8e('0x115')]][_0x5e8e('0xae')]]=this['queueBookedRR'][this[_0x5e8e('0xa7')][_0x3fcd8b['actionid']][_0x5e8e('0xae')]]?this['queueBookedRR'][this[_0x5e8e('0xa7')][_0x3fcd8b['actionid']][_0x5e8e('0xae')]]:this[_0x5e8e('0x2c')][this[_0x5e8e('0xa7')][_0x3fcd8b[_0x5e8e('0x115')]][_0x5e8e('0xae')]]?this[_0x5e8e('0x2c')][this[_0x5e8e('0xa7')][_0x3fcd8b[_0x5e8e('0x115')]][_0x5e8e('0xae')]][_0x5e8e('0x122')]||0x0:0x0;}this[_0x5e8e('0x2c')][this['actions'][_0x3fcd8b[_0x5e8e('0x115')]][_0x5e8e('0xae')]][_0x5e8e('0x122')]=this[_0x5e8e('0x2d')][this[_0x5e8e('0xa7')][_0x3fcd8b[_0x5e8e('0x115')]][_0x5e8e('0xae')]];for(var _0x276b79=0x0;_0x276b79=0x0?!![]:![];})[_0x5e8e('0xab')](myreject(_0x4836e3)));}}else{_0x1284d2[_0x5e8e('0x119')](ami[_0x5e8e('0xa9')]({'action':_0x5e8e('0x138'),'command':util[_0x5e8e('0x70')](_0x5e8e('0x139'),_0x5f204e,!_[_0x5e8e('0x3c')](config[_0x5e8e('0x135')][_0x511ed4])?_0x511ed4:'')})[_0x5e8e('0xb3')](function(_0x4dac20){return _0x4dac20[_0x5e8e('0x13a')][_0x5e8e('0x13c')](_0x5e8e('0x13b'))>=0x0?!![]:![];})['catch'](myreject(_0x4836e3)));}BPromise[_0x5e8e('0x13d')](_0x1284d2)[_0x5e8e('0xb3')](function(_0xbf7d80){var _0x37e8b4=_[_0x5e8e('0x13e')](_0xbf7d80);if(_0x37e8b4){return _0x56b710(_0x37e8b4);}else{_0x2009da[_0x5e8e('0x3f')]=_0xa8638d?_0x5e8e('0x13f'):_0x5e8e('0x140');return _0x4836e3(msgResponse(_0x5e8e('0x141'),_0x5e8e('0x132'),'Global:\x20'+_0xa8638d+'\x20'+_0x159a80+_0x5e8e('0x142')+util[_0x5e8e('0x91')](_0x5f204e,{'showHidden':![],'depth':null})+_0x5e8e('0x143')+_0x511ed4));}})[_0x5e8e('0xab')](function(_0xa168a){return _0x4836e3(msgResponse('ifTime',_0x5e8e('0x132'),JSON['stringify'](_0xa168a)));});});};Dialer[_0x5e8e('0x1d')][_0x5e8e('0x144')]=function(_0x3e863a){var _0x5f3f64=this;return function(){switch(_0x3e863a[_0x5e8e('0x145')]){case _0x5e8e('0x146'):freeVariablesPredictive(_0x3e863a);_0x5f3f64[_0x5e8e('0x147')](_0x3e863a,0x1);break;case _0x5e8e('0x148'):freeVariablesPredictive(_0x3e863a);_0x5f3f64[_0x5e8e('0x147')](_0x3e863a,_0x3e863a[_0x5e8e('0x149')]);break;case _0x5e8e('0x14a'):_0x5f3f64[_0x5e8e('0x14a')](_0x3e863a);break;case'booked':freeVariablesPredictive(_0x3e863a);_0x5f3f64['handlePower'](_0x3e863a,0x1);break;default:freeVariablesPredictive(_0x3e863a);logger['error'](_0x5e8e('0x14b'),_0x3e863a[_0x5e8e('0x3e')],'method\x20not\x20recognized');}};};Dialer[_0x5e8e('0x1d')][_0x5e8e('0x14c')]=function(_0x871db8){var _0x29de6a=this;return function(){_0x29de6a['handleIvr'](_0x871db8);};};Dialer['prototype']['syncQueueSummary']=function(_0x3522dd){var _0x406823=this;if(isNotPreview(_0x3522dd['dialMethod'])){if(isVoiceQueueOutbound(_0x3522dd[_0x5e8e('0xb0')])&&isActive(_0x3522dd['dialActive'])){_0x3522dd['sendMessageOneNotActive']=!![];BPromise[_0x5e8e('0xb2')]()['then'](checkIsLoggedIn(_0x3522dd,_0x3522dd[_0x5e8e('0x4f')]))[_0x5e8e('0xb3')](checkIsActive(_0x3522dd,_0x3522dd[_0x5e8e('0x14d')]))[_0x5e8e('0xb3')](checkInterval(_0x3522dd))[_0x5e8e('0xb3')](_0x406823['checkIsTrunkReachable'](_0x3522dd))['then'](_0x406823[_0x5e8e('0x12f')](_0x3522dd[_0x5e8e('0x14e')],_0x3522dd['dialTimezone'],_0x3522dd[_0x5e8e('0x3e')],_0x3522dd))['then'](_0x406823[_0x5e8e('0x131')](_0x3522dd[_0x5e8e('0x41')],_0x3522dd[_0x5e8e('0x14f')],_0x3522dd[_0x5e8e('0x3e')],_0x3522dd))[_0x5e8e('0xb3')](_0x406823[_0x5e8e('0x144')](_0x3522dd))['catch'](loggerCatchQueueSummary(_0x5e8e('0x150'),_0x3522dd));}else{notSendMessagesQueue(_0x3522dd);}}else{freeVariablesPredictive(_0x3522dd);}};Dialer[_0x5e8e('0x1d')][_0x5e8e('0x12c')]=function(){var _0x53af32=this;var _0x27ef6d;for(var _0x5d7b05 in this['campaigns']){if(this[_0x5e8e('0x23')]['hasOwnProperty'](_0x5d7b05)){_0x27ef6d=this['campaigns'][_0x5d7b05];if(isCampaignIvr(_0x27ef6d['type'])&&isActive(_0x27ef6d['active'])){_0x27ef6d[_0x5e8e('0x9a')]=!![];BPromise[_0x5e8e('0xb2')]()['then'](checkIsActive(_0x27ef6d,_0x27ef6d[_0x5e8e('0x6e')]))['then'](checkInterval(_0x27ef6d))[_0x5e8e('0xb3')](_0x53af32[_0x5e8e('0x151')](_0x27ef6d))[_0x5e8e('0xb3')](_0x53af32['checkIfTime'](_0x27ef6d[_0x5e8e('0x14e')],_0x27ef6d[_0x5e8e('0x14f')],_0x27ef6d[_0x5e8e('0x3e')],_0x27ef6d))[_0x5e8e('0xb3')](_0x53af32['checkIfTimeIntervals'](_0x27ef6d[_0x5e8e('0x41')],_0x27ef6d['dialTimezone'],_0x27ef6d[_0x5e8e('0x3e')],_0x27ef6d))[_0x5e8e('0xb3')](_0x53af32[_0x5e8e('0x14c')](_0x27ef6d))['catch'](loggerCatchQueueSummary(_0x5e8e('0x152'),_0x27ef6d));}else{notSendMessagesCampaign(_0x27ef6d);}}}};function getCallerIdRandom(_0x10419b,_0x384f3a){var _0x474545,_0x17ade5,_0x2097bd;if(_0x384f3a<=0x0){_0x384f3a=0x1;}_0x474545=new RegExp(_0x5e8e('0x153')+_0x384f3a+'}$');_0x17ade5=Math[_0x5e8e('0x154')](0xa,_0x384f3a-0x1);_0x2097bd=Math['pow'](0xa,_0x384f3a)-0x1;return util[_0x5e8e('0x70')]('%s',_[_0x5e8e('0x155')](_0x10419b,_0x474545,_[_0x5e8e('0x156')](_0x17ade5,_0x2097bd)));}function extractCalleridName(_0x579417){var _0x2c81a1=_0x579417[_0x5e8e('0x157')](/"(.*?)"/);return _0x2c81a1?_0x2c81a1[0x1]:_0x579417;}function extractCalleridNumber(_0x453ad3){var _0x3987dd=_0x453ad3['match'](/<(.*?)>/);return _0x3987dd?_0x3987dd[0x1]:_0x453ad3;}Dialer[_0x5e8e('0x1d')]['actionOriginate']=function(_0x3aba95,_0x290617){var _0x3b2f47=this;var _0x1ac4d8=uuid['v4']();this['actions'][_0x1ac4d8]=new Action(_0x3aba95,_0x290617,_0x1ac4d8);return new BPromise(function(_0x38c2e6,_0x45fcd0){if(_[_0x5e8e('0x3c')](_0x3aba95)&&_0x5e8e('0x158')!==typeof _0x3aba95){return _0x45fcd0(msgResponse(_0x5e8e('0x159'),'Failure',_0x5e8e('0x15a')));}if(_[_0x5e8e('0x3c')](_0x290617[_0x5e8e('0x15b')]['phone'])||_0x290617[_0x5e8e('0x15b')][_0x5e8e('0x15c')]===null){return _0x45fcd0(msgResponse(_0x5e8e('0x159'),'Failure','contact\x20is\x20undefine'));}var _0x277251={'XMD-CALLERID':_0x3b2f47[_0x5e8e('0xa7')][_0x1ac4d8][_0x5e8e('0x15d')](),'XMD-AGI':_0x3aba95[_0x5e8e('0xef')]?util['format'](_0x5e8e('0x15e'),ipAgi,_0x3aba95[_0x5e8e('0xef')]):_0x5e8e('0x15f'),'XMD-AGIAFTER':_0x3aba95[_0x5e8e('0xf6')]?util[_0x5e8e('0x70')](_0x5e8e('0x15e'),ipAgi,_0x3aba95[_0x5e8e('0xf6')]):_0x5e8e('0x15f'),'XMD-QUEUE':_0x3aba95[_0x5e8e('0xb0')]==='outbound'?util[_0x5e8e('0x70')]('\x22%s,%s%s,,,%s\x22',_0x3aba95[_0x5e8e('0x3e')],_0x3aba95[_0x5e8e('0x160')]||'',_0x3aba95[_0x5e8e('0xf7')]?'c':'',_0x3aba95[_0x5e8e('0xff')]||0x3):_0x5e8e('0x15f'),'XMD-CONTACTID':_0x290617[_0x5e8e('0x10a')],'XMD-CDRTYPE':'dialer','CALLERID(all)':_0x3b2f47['actions'][_0x1ac4d8][_0x5e8e('0x15d')](),'XMD-AMD':_0x3aba95[_0x5e8e('0xda')]?_0x5e8e('0x161'):_0x5e8e('0x15f'),'XMD-DESTINATION':_0x5e8e('0xd9')};if(_0x3aba95[_0x5e8e('0xda')]){_0x277251[_0x5e8e('0x162')]=_0x3aba95['dialAMDInitialSilence']||0x9c4;_0x277251['XMD-AMDGREETING']=_0x3aba95['dialAMDGreeting']||0x5dc;_0x277251[_0x5e8e('0x163')]=_0x3aba95[_0x5e8e('0x164')]||0x320;_0x277251[_0x5e8e('0x165')]=_0x3aba95[_0x5e8e('0x166')]||0x1388;_0x277251[_0x5e8e('0x167')]=_0x3aba95[_0x5e8e('0x168')]||0x64;_0x277251[_0x5e8e('0x169')]=_0x3aba95[_0x5e8e('0x16a')]||0x32;_0x277251[_0x5e8e('0x16b')]=_0x3aba95['dialAMDMaximumNumberOfWords']||0x3;_0x277251[_0x5e8e('0x16c')]=_0x3aba95['dialAMDSilenceThreshold']||0x100;_0x277251[_0x5e8e('0x16d')]=_0x3aba95[_0x5e8e('0x16e')]||0x1388;}if(_0x3aba95['type']===_0x5e8e('0x4b')){_0x277251[_0x5e8e('0x16f')]=_0x290617[_0x5e8e('0x10b')];}else{_0x277251[_0x5e8e('0x170')]=_0x290617['CampaignId'];}for(var _0xc7dd1f in _0x290617[_0x5e8e('0x15b')]){if(_0x290617[_0x5e8e('0x15b')][_0x5e8e('0x93')](_0xc7dd1f)){if(isNotNull(_0x290617[_0x5e8e('0x15b')][_0xc7dd1f])&&_0xc7dd1f!=='id'&&_0xc7dd1f!==_0x5e8e('0x171')&&_0xc7dd1f!==_0x5e8e('0x172')&&_0xc7dd1f!==_0x5e8e('0x173')){_0x277251[util[_0x5e8e('0x70')](_0x5e8e('0x174'),_0x5e8e('0x175'),_['toUpper'](_0xc7dd1f))]=_0x290617['Contact'][_0xc7dd1f];}}}var _0x1cd27f=_0x3b2f47[_0x5e8e('0xd1')](_0x3aba95[_0x5e8e('0x6d')])?getCallerId(_0x3aba95[_0x5e8e('0x6d')][_0x5e8e('0x6f')],_0x3aba95[_0x5e8e('0x176')],_0x3aba95[_0x5e8e('0x177')]>0x0?getCallerIdRandom(_0x3aba95[_0x5e8e('0x58')],_0x3aba95[_0x5e8e('0x177')]):_0x3aba95[_0x5e8e('0x58')]):getCallerId(_['isNil'](_0x3aba95[_0x5e8e('0x178')])?_0x3aba95[_0x5e8e('0x6d')]['callerid']:_0x3aba95['TrunkBackup'][_0x5e8e('0x6f')],_0x3aba95[_0x5e8e('0x176')],_0x3aba95[_0x5e8e('0x177')]>0x0?getCallerIdRandom(_0x3aba95[_0x5e8e('0x58')],_0x3aba95[_0x5e8e('0x177')]):_0x3aba95[_0x5e8e('0x58')]);if(_0x1cd27f){_0x277251['XMD-ORIGINATECALLERIDNAME']=_0x3b2f47[_0x5e8e('0xa7')][_0x1ac4d8][_0x5e8e('0x179')]=extractCalleridName(_0x1cd27f);_0x277251[_0x5e8e('0x17a')]=_0x3b2f47['actions'][_0x1ac4d8][_0x5e8e('0x17b')]=extractCalleridNumber(_0x1cd27f);}return ami[_0x5e8e('0xa9')]({'actionid':_0x1ac4d8,'action':'originate','channel':_0x3b2f47[_0x5e8e('0xd1')](_0x3aba95[_0x5e8e('0x6d')])?util[_0x5e8e('0x70')]('SIP/%s/%s%s',_0x3aba95[_0x5e8e('0x6d')][_0x5e8e('0x3e')],isNotNull(_0x3aba95[_0x5e8e('0x5a')])?_0x3aba95[_0x5e8e('0x5a')][_0x5e8e('0x17c')]()||'':'',_0x3aba95[_0x5e8e('0x17d')]>0x0?_0x290617[_0x5e8e('0x15b')][_0x5e8e('0x15c')][_0x5e8e('0x17e')](_0x3aba95['dialCutDigit']):_0x290617['Contact'][_0x5e8e('0x15c')]):util[_0x5e8e('0x70')](_0x5e8e('0x17f'),_['isNil'](_0x3aba95['TrunkBackup'])?_0x3aba95[_0x5e8e('0x6d')][_0x5e8e('0x3e')]:_0x3aba95[_0x5e8e('0x178')][_0x5e8e('0x3e')],isNotNull(_0x3aba95[_0x5e8e('0x5a')])?_0x3aba95[_0x5e8e('0x5a')]['trim']()||'':'',_0x3aba95[_0x5e8e('0x17d')]>0x0?_0x290617[_0x5e8e('0x15b')]['phone']['substring'](_0x3aba95['dialCutDigit']):_0x290617[_0x5e8e('0x15b')][_0x5e8e('0x15c')]),'callerid':_0x1cd27f,'Exten':'xcally-motion-dialer','Context':_0x5e8e('0x180'),'Priority':'1','variable':_0x277251,'timeout':(_0x3aba95[_0x5e8e('0x59')]||0x1e)*0x3e8,'async':!![],'channelid':_0x1ac4d8})[_0x5e8e('0xb3')](function(_0x3d3133){return _0x38c2e6(_0x3d3133);})[_0x5e8e('0xab')](function(_0x553d0b){_0x3aba95[_0x5e8e('0x181')]+=0x1;var _0x55715a=new History(_0x3b2f47[_0x5e8e('0xa7')][_0x1ac4d8]);logger[_0x5e8e('0x90')](util['format']('[originateError]:\x20%s',JSON[_0x5e8e('0x47')](_0x553d0b)));_0x55715a[_0x5e8e('0xa0')]=0xe;_0x55715a['statedesc']=_0x5e8e('0x182');_0x55715a[_0x5e8e('0xa3')]=moment()[_0x5e8e('0x70')](_0x5e8e('0xfe'));_0x55715a[_0x5e8e('0xa2')]=_0x55715a[_0x5e8e('0xa3')];_0x3b2f47[_0x5e8e('0xc4')](_0x55715a)[_0x5e8e('0xab')](loggerCatch(_0x5e8e('0x183')));_0x3b2f47[_0x5e8e('0xc3')](_0x55715a)[_0x5e8e('0xab')](loggerCatch('[originate][error]'))[_0x5e8e('0x1f')](function(){delete _0x3b2f47[_0x5e8e('0xa7')][_0x1ac4d8];return _0x45fcd0(msgResponse(_0x5e8e('0x159'),'Error',_0x5e8e('0x184')));});});});};Dialer[_0x5e8e('0x1d')]['syncOriginateResponse']=function(_0x34cae7){var _0xb8b04f=this[_0x5e8e('0xa7')][_0x34cae7[_0x5e8e('0x115')]];var _0x553c25=this;if(_0xb8b04f){delete this[_0x5e8e('0xa7')][_0x34cae7[_0x5e8e('0x115')]];_0xb8b04f[_0x5e8e('0x185')]=moment()['format']('YYYY-MM-DD\x20HH:mm:ss');var _0x1f83ea=_0xb8b04f[_0x5e8e('0xb0')]===_0x5e8e('0x72')?this[_0x5e8e('0x23')][_0xb8b04f['queue']]:this['voiceQueues'][_0xb8b04f[_0x5e8e('0x186')]()];if(!this[_0x5e8e('0xcf')](_0x34cae7['response'])){this['updateOriginated'](_0x1f83ea);return this[_0x5e8e('0x187')](_0xb8b04f,_0x1f83ea,_0x34cae7)[_0x5e8e('0xb3')](function(_0x3e4b40){})[_0x5e8e('0xab')](loggerCatch(_0x5e8e('0x188')));}else{this[_0x5e8e('0xa5')][_0x34cae7['uniqueid']]=_0xb8b04f;}}};Dialer[_0x5e8e('0x1d')]['checkRetriveMax']=function(_0x1bfa52,_0xb0d085,_0x21d1c7){var _0x125e73=new History(_0xb0d085);if(_0x125e73[_0x5e8e('0x189')]+_0x125e73[_0x5e8e('0x18a')]+_0x125e73['countnoanswerretry']+_0x125e73[_0x5e8e('0x18b')]+_0x125e73['countdropretry']+_0x125e73[_0x5e8e('0x10f')]+_0x125e73[_0x5e8e('0x18c')]+_0x125e73[_0x5e8e('0x18d')]>=_0x21d1c7[_0x5e8e('0x18e')]-0x1){return!![];}switch(_0x1bfa52){case 0x3:if(_0x125e73['countnoanswerretry']>=_0x21d1c7[_0x5e8e('0x18f')]-0x1){return!![];}else{this[_0x5e8e('0xbb')]({'active':![],'countnoanswerretry':_0x125e73[_0x5e8e('0x190')]+=0x1,'scheduledat':moment()[_0x5e8e('0x107')](_0x21d1c7['dialNoAnswerRetryFrequency'],_0x5e8e('0x109'))[_0x5e8e('0x70')]('YYYY-MM-DD\x20HH:mm:ss'),'ContactId':_0x125e73['ContactId'],'ListId':_0x125e73[_0x5e8e('0xcb')],'VoiceQueueId':_0x125e73[_0x5e8e('0x10b')]||undefined,'CampaignId':_0x125e73[_0x5e8e('0x112')]||undefined})[_0x5e8e('0xab')](loggerCatch(_0x5e8e('0x191')));}break;case 0x5:if(_0x125e73[_0x5e8e('0x189')]>=_0x21d1c7['dialBusyMaxRetry']-0x1){return!![];}else{this[_0x5e8e('0xbb')]({'active':![],'countbusyretry':_0x125e73[_0x5e8e('0x189')]+=0x1,'scheduledat':moment()[_0x5e8e('0x107')](_0x21d1c7[_0x5e8e('0x192')],'minutes')[_0x5e8e('0x70')]('YYYY-MM-DD\x20HH:mm:ss'),'ContactId':_0x125e73[_0x5e8e('0x10a')],'ListId':_0x125e73[_0x5e8e('0xcb')],'VoiceQueueId':_0x125e73[_0x5e8e('0x10b')]||undefined,'CampaignId':_0x125e73['CampaignId']||undefined})[_0x5e8e('0xab')](loggerCatch(_0x5e8e('0x193')));}break;case 0x8:if(_0x125e73[_0x5e8e('0x18a')]>=_0x21d1c7[_0x5e8e('0x194')]-0x1){return!![];}else{this[_0x5e8e('0xbb')]({'active':![],'countcongestionretry':_0x125e73[_0x5e8e('0x18a')]+=0x1,'scheduledat':moment()[_0x5e8e('0x107')](_0x21d1c7[_0x5e8e('0x195')],_0x5e8e('0x109'))['format'](_0x5e8e('0xfe')),'ContactId':_0x125e73[_0x5e8e('0x10a')],'ListId':_0x125e73[_0x5e8e('0xcb')],'VoiceQueueId':_0x125e73[_0x5e8e('0x10b')]||undefined,'CampaignId':_0x125e73['CampaignId']||undefined})['catch'](loggerCatch(_0x5e8e('0x196')));}break;case 0x0:if(_0x125e73[_0x5e8e('0x18b')]>=_0x21d1c7[_0x5e8e('0x197')]-0x1){return!![];}else{this['rescheduleContact']({'active':![],'countnosuchnumberretry':_0x125e73[_0x5e8e('0x18b')]+=0x1,'scheduledat':moment()[_0x5e8e('0x107')](_0x21d1c7['dialNoSuchNumberRetryFrequency'],_0x5e8e('0x109'))[_0x5e8e('0x70')](_0x5e8e('0xfe')),'ContactId':_0x125e73[_0x5e8e('0x10a')],'ListId':_0x125e73['ListId'],'VoiceQueueId':_0x125e73[_0x5e8e('0x10b')]||undefined,'CampaignId':_0x125e73[_0x5e8e('0x112')]||undefined})['catch'](loggerCatch(_0x5e8e('0x198')));}break;case 0xa:if(_0x125e73[_0x5e8e('0x104')]>=_0x21d1c7[_0x5e8e('0x105')]-0x1){return!![];}else{this[_0x5e8e('0xbb')]({'active':![],'countdropretry':_0x125e73[_0x5e8e('0x104')]+=0x1,'scheduledat':moment()[_0x5e8e('0x107')](_0x21d1c7[_0x5e8e('0x108')],'minutes')[_0x5e8e('0x70')](_0x5e8e('0xfe')),'ContactId':_0x125e73['ContactId'],'ListId':_0x125e73[_0x5e8e('0xcb')],'VoiceQueueId':_0x125e73[_0x5e8e('0x10b')]||undefined,'CampaignId':_0x125e73['CampaignId']||undefined})[_0x5e8e('0xab')](loggerCatch(_0x5e8e('0x10c')));}break;case 0xb:if(_0x125e73[_0x5e8e('0x10f')]>=_0x21d1c7[_0x5e8e('0x110')]-0x1){return!![];}else{this[_0x5e8e('0xbb')]({'active':![],'countabandonedretry':_0x125e73[_0x5e8e('0x10f')]+=0x1,'scheduledat':moment()[_0x5e8e('0x107')](_0x21d1c7[_0x5e8e('0x111')],_0x5e8e('0x109'))['format']('YYYY-MM-DD\x20HH:mm:ss'),'ContactId':_0x125e73['ContactId'],'ListId':_0x125e73[_0x5e8e('0xcb')],'VoiceQueueId':_0x125e73[_0x5e8e('0x10b')]||undefined,'CampaignId':_0x125e73['CampaignId']||undefined})[_0x5e8e('0xab')](loggerCatch(_0x5e8e('0x199')));}break;case 0x13:if(_0x125e73[_0x5e8e('0x18c')]>=_0x21d1c7['dialMachineMaxRetry']-0x1){return!![];}else{this['rescheduleContact']({'active':![],'countmachineretry':_0x125e73[_0x5e8e('0x18c')]+=0x1,'scheduledat':moment()[_0x5e8e('0x107')](_0x21d1c7[_0x5e8e('0x19a')],_0x5e8e('0x109'))[_0x5e8e('0x70')](_0x5e8e('0xfe')),'ContactId':_0x125e73['ContactId'],'ListId':_0x125e73[_0x5e8e('0xcb')],'VoiceQueueId':_0x125e73[_0x5e8e('0x10b')]||undefined,'CampaignId':_0x125e73['CampaignId']||undefined})[_0x5e8e('0xab')](loggerCatch(_0x5e8e('0x19b')));}break;case 0x14:if(_0x125e73['countagentrejectretry']>=_0x21d1c7[_0x5e8e('0x19c')]-0x1){return!![];}else{this[_0x5e8e('0xbb')]({'active':![],'countagentrejectretry':_0x125e73['countagentrejectretry']+=0x1,'scheduledat':moment()[_0x5e8e('0x107')](_0x21d1c7[_0x5e8e('0x19d')],'minutes')[_0x5e8e('0x70')](_0x5e8e('0xfe')),'ContactId':_0x125e73['ContactId'],'ListId':_0x125e73[_0x5e8e('0xcb')],'VoiceQueueId':_0x125e73[_0x5e8e('0x10b')]||undefined,'CampaignId':_0x125e73['CampaignId']||undefined})[_0x5e8e('0xab')](loggerCatch('[rescheduleContact][AgentReject]'));}break;default:return!![];}};Dialer[_0x5e8e('0x1d')][_0x5e8e('0x187')]=function(_0x3b0575,_0xf76154,_0x3368db){var _0x103d22=this;var _0x17c4fe=new History(_0x3b0575);return new BPromise(function(_0x39f4a6,_0x116929){if(_[_0x5e8e('0x3c')](_0xf76154)&&_0x5e8e('0x158')!==typeof _0xf76154){return _0x116929(msgResponse(_0x5e8e('0x19e'),_0x5e8e('0x132'),_0x5e8e('0x19f')));}if(_[_0x5e8e('0x3c')](_0x3368db)&&'object'!==typeof _0x3368db){return _0x116929(msgResponse('[callProgressDetecting]',_0x5e8e('0x132'),_0x5e8e('0x1a0')));}switch(_0x3368db['reason']){case'0':_0xf76154[_0x5e8e('0x5e')]+=0x1;_0x17c4fe[_0x5e8e('0xa0')]=0x0;_0x17c4fe[_0x5e8e('0xa1')]=_0x5e8e('0x1a1');_0x103d22[_0x5e8e('0xc4')](_0x17c4fe)[_0x5e8e('0xab')](loggerCatch(_0x5e8e('0x1a2')));if(_0x103d22['checkRetriveMax'](0x0,_0x3b0575,_0xf76154)){if(_0x17c4fe['countbusyretry']+_0x17c4fe[_0x5e8e('0x18a')]+_0x17c4fe[_0x5e8e('0x190')]+_0x17c4fe['countnosuchnumberretry']+_0x17c4fe['countdropretry']+_0x17c4fe[_0x5e8e('0x10f')]+_0x17c4fe[_0x5e8e('0x18c')]+_0x17c4fe['countagentrejectretry']>=_0xf76154['dialGlobalMaxRetry']){_0x103d22[_0x5e8e('0x1a3')](_0x17c4fe,_0x39f4a6,_0x116929,_0x5e8e('0x1a4'));}else{_0x103d22[_0x5e8e('0x1a5')](_0x17c4fe,_0x39f4a6,_0x116929,_0x5e8e('0x1a4'));}}break;case'3':_0xf76154[_0x5e8e('0x1a6')]+=0x1;_0x17c4fe[_0x5e8e('0xa0')]=0x3;_0x17c4fe[_0x5e8e('0xa1')]='NoAnswer';_0x17c4fe[_0x5e8e('0x190')]+=0x1;_0x17c4fe[_0x5e8e('0x1a7')]+=0x1;_0x103d22[_0x5e8e('0xc4')](_0x17c4fe)[_0x5e8e('0xab')](loggerCatch(_0x5e8e('0x1a8')));if(_0x103d22[_0x5e8e('0x1a9')](0x3,_0x3b0575,_0xf76154)){if(_0x17c4fe[_0x5e8e('0x190')]>=_0xf76154[_0x5e8e('0x18f')]){_0x103d22[_0x5e8e('0x1a5')](_0x17c4fe,_0x39f4a6,_0x116929,_0x5e8e('0x1aa'));}else{_0x103d22[_0x5e8e('0x1a3')](_0x17c4fe,_0x39f4a6,_0x116929,'reason\x203\x20ringing\x20no\x20answer');}}break;case'5':_0xf76154[_0x5e8e('0x5c')]+=0x1;_0x17c4fe[_0x5e8e('0xa0')]=0x5;_0x17c4fe['statedesc']=_0x5e8e('0x1ab');_0x17c4fe[_0x5e8e('0x189')]+=0x1;_0x17c4fe[_0x5e8e('0x1a7')]+=0x1;_0x103d22[_0x5e8e('0xc4')](_0x17c4fe)['catch'](loggerCatch(_0x5e8e('0x1ac')));if(_0x103d22[_0x5e8e('0x1a9')](0x5,_0x3b0575,_0xf76154)){if(_0x17c4fe[_0x5e8e('0x189')]>=_0xf76154[_0x5e8e('0x1ad')]){_0x103d22['createStateFinal'](_0x17c4fe,_0x39f4a6,_0x116929,_0x5e8e('0x1ae'));}else{_0x103d22[_0x5e8e('0x1a3')](_0x17c4fe,_0x39f4a6,_0x116929,_0x5e8e('0x1ae'));}}break;case'8':_0xf76154[_0x5e8e('0x1af')]+=0x1;_0x17c4fe[_0x5e8e('0xa0')]=0x8;_0x17c4fe['statedesc']='Congestion';_0x17c4fe[_0x5e8e('0x18a')]+=0x1;_0x17c4fe[_0x5e8e('0x1a7')]+=0x1;_0x103d22[_0x5e8e('0xc4')](_0x17c4fe)[_0x5e8e('0xab')](loggerCatch(_0x5e8e('0x1b0')));if(_0x103d22[_0x5e8e('0x1a9')](0x8,_0x3b0575,_0xf76154)){if(_0x17c4fe[_0x5e8e('0x18a')]>=_0xf76154['dialCongestionMaxRetry']){_0x103d22['createStateFinal'](_0x17c4fe,_0x39f4a6,_0x116929,_0x5e8e('0x1b1'));}else{_0x103d22['stateGlobal'](_0x17c4fe,_0x39f4a6,_0x116929,_0x5e8e('0x1b1'));}}break;case'11':_0xf76154[_0x5e8e('0x1b2')]+=0x1;_0x17c4fe[_0x5e8e('0xa0')]=0xb;_0x17c4fe[_0x5e8e('0xa1')]='Abandoned';_0x17c4fe['countabandonedretry']+=0x1;_0x17c4fe['countglobal']+=0x1;_0x103d22[_0x5e8e('0xc4')](_0x17c4fe)[_0x5e8e('0xab')](loggerCatch(_0x5e8e('0x1b3')));if(_0x103d22[_0x5e8e('0x1a9')](0xb,_0x3b0575,_0xf76154)){if(_0x17c4fe[_0x5e8e('0x10f')]>=_0xf76154[_0x5e8e('0x110')]){_0x103d22[_0x5e8e('0x1a5')](_0x17c4fe,_0x39f4a6,_0x116929,_0x5e8e('0x1b4'));}else{_0x103d22[_0x5e8e('0x1a3')](_0x17c4fe,_0x39f4a6,_0x116929,'reason\x2011\x20abandoned');}}break;case'20':_0xf76154[_0x5e8e('0x1b5')]+=0x1;_0x17c4fe[_0x5e8e('0xa0')]=0x14;_0x17c4fe['statedesc']=_0x5e8e('0x1b6');_0x17c4fe[_0x5e8e('0x18d')]+=0x1;_0x17c4fe[_0x5e8e('0x1a7')]+=0x1;_0x103d22[_0x5e8e('0xc4')](_0x17c4fe)[_0x5e8e('0xab')](loggerCatch('[syncAgentComplete][createHistory][20]'));if(_0x103d22[_0x5e8e('0x1a9')](0x14,_0x3b0575,_0xf76154)){if(_0x17c4fe[_0x5e8e('0x18d')]>=_0xf76154[_0x5e8e('0x19c')]){_0x103d22[_0x5e8e('0x1a5')](_0x17c4fe,_0x39f4a6,_0x116929,_0x5e8e('0x1b7'));}else{_0x103d22[_0x5e8e('0x1a3')](_0x17c4fe,_0x39f4a6,_0x116929,_0x5e8e('0x1b7'));}}break;default:_0xf76154[_0x5e8e('0x60')]+=0x1;_0x17c4fe['state']=0xc;_0x17c4fe[_0x5e8e('0xa1')]=_0x3368db[_0x5e8e('0xf5')];_0x103d22[_0x5e8e('0xc4')](_0x17c4fe)[_0x5e8e('0xab')](loggerCatch(_0x5e8e('0x1b8')));if(_0x103d22[_0x5e8e('0x1a9')](_0x3368db[_0x5e8e('0xf5')],_0x3b0575,_0xf76154)){if(_0x17c4fe[_0x5e8e('0x189')]+_0x17c4fe[_0x5e8e('0x18a')]+_0x17c4fe[_0x5e8e('0x190')]+_0x17c4fe['countnosuchnumberretry']+_0x17c4fe[_0x5e8e('0x104')]+_0x17c4fe[_0x5e8e('0x10f')]+_0x17c4fe['countmachineretry']+_0x17c4fe['countagentrejectretry']>=_0xf76154[_0x5e8e('0x18e')]){_0x103d22[_0x5e8e('0x1a3')](_0x17c4fe,_0x39f4a6,_0x116929,_0x3368db[_0x5e8e('0xf5')]);}else{_0x103d22['createStateFinal'](_0x17c4fe,_0x39f4a6,_0x116929,_0x3368db[_0x5e8e('0xf5')]);}}}});};Dialer[_0x5e8e('0x1d')][_0x5e8e('0x1a3')]=function(_0x400972,_0x681599,_0x250936,_0x33bb7f){var _0x524d86=new Final(_0x400972);_0x524d86['state']=0xf;_0x524d86['statedesc']=_0x5e8e('0x1b9');this[_0x5e8e('0x1a5')](_0x524d86,_0x681599,_0x250936,_0x33bb7f);};Dialer[_0x5e8e('0x1d')]['createStateFinal']=function(_0x11bf86,_0x38340f,_0x429205,_0x4b5bad){this[_0x5e8e('0xc3')](_0x11bf86)[_0x5e8e('0xb3')](function(_0x2eedff){return _0x38340f(msgResponse(_0x5e8e('0x19e'),'Success',_0x4b5bad));})[_0x5e8e('0xab')](function(_0x33c9c8){return _0x429205(msgResponse(_0x5e8e('0x1ba'),_0x5e8e('0x132'),'contact\x20not\x20moved'));});};Dialer[_0x5e8e('0x1d')][_0x5e8e('0x14a')]=function(_0x419b93){var _0xf4c3bc=this;var _0x1a93e2=_0x419b93[_0x5e8e('0x1bb')]/0x64;var _0x22f4fa=_0x419b93[_0x5e8e('0x1bc')]/(_0x419b93[_0x5e8e('0x1bc')]+_0x419b93[_0x5e8e('0xdd')]);var _0x4c7aa1=Math[_0x5e8e('0x1bd')](_0x419b93['predictiveIntervalAvailable']*(_0x419b93['predictiveIntervalMaxThreshold']/0x64));var _0x1909ac=Math['round'](_0x419b93[_0x5e8e('0x1be')]*(_0x419b93[_0x5e8e('0x1bf')]/0x64));var _0x15eeb9=_0x419b93[_0x5e8e('0x4e')]+_0x419b93['talking'];var _0x45da88=Math[_0x5e8e('0x1c0')](_0x419b93[_0x5e8e('0x69')]*_0x419b93[_0x5e8e('0x6b')]*_0x419b93[_0x5e8e('0x65')]*_0x419b93['predictiveIntervalMultiplicativeFactor']);if(_['isUndefined'](_0x419b93[_0x5e8e('0x2a')])){if(!_[_0x5e8e('0x3c')](_0x419b93['startPredictive'])){_0x419b93[_0x5e8e('0x29')]=undefined;loggerPredictive[_0x5e8e('0x90')](_0x5e8e('0x1c1'),_0x5e8e('0x1c2'));}if(!_[_0x5e8e('0x3c')](_0x419b93[_0x5e8e('0x8b')])){loggerPredictive['error'](_0x5e8e('0x1c1'),'check\x20handlePredictive\x20is\x20not\x20undefine');clearInterval(_0x419b93['handlePredictive']);_0x419b93[_0x5e8e('0x8b')]=undefined;}_0x419b93['startProgressive']=moment()[_0x5e8e('0x70')](_0x5e8e('0xfe'));loggerPredictive[_0x5e8e('0x74')](_0x419b93[_0x5e8e('0x3e')],_0x5e8e('0x1c3'),_0x419b93[_0x5e8e('0x2a')]);this[_0x5e8e('0x147')](_0x419b93,0x1);}else if(ifInterval(_0x419b93[_0x5e8e('0x1c4')],_0x419b93['startProgressive'])){this[_0x5e8e('0x147')](_0x419b93,0x1);loggerPredictiveCalls[_0x5e8e('0x74')](_0x5e8e('0x1c5'),_0x419b93[_0x5e8e('0x2a')],_0x419b93[_0x5e8e('0x3e')]);_0x419b93['erlangCalls']=0x0;_0x419b93[_0x5e8e('0x64')]=0x0;}else if(_0x1a93e2<_0x22f4fa&&_0x419b93[_0x5e8e('0x1c6')]==='dropRate'){freeVariablesPredictive(_0x419b93);loggerPredictive['info'](_0x5e8e('0x1c7'),_0x5e8e('0x1c8'),_0x22f4fa,_0x5e8e('0x2a'),_0x419b93[_0x5e8e('0x3e')]);}else if(_0x45da88<_0x419b93[_0x5e8e('0x64')]&&_0x419b93[_0x5e8e('0x1c6')]===_0x5e8e('0x1c9')){freeVariablesPredictive(_0x419b93);loggerPredictive['info']('[stopMethodPredictive][ReStartProgressive][ExceededDropInterval]',_0x5e8e('0x1ca'),_0x45da88,'Drop\x20in\x20this\x20interval',_0x419b93[_0x5e8e('0x64')],'startProgressive',_0x419b93[_0x5e8e('0x3e')]);}else if(!ifInterval(_0x419b93[_0x5e8e('0x1c4')],_0x419b93['startProgressive'])&&_[_0x5e8e('0x3c')](_0x419b93['startPredictive'])&&!_[_0x5e8e('0x3c')](_0x419b93['startProgressive'])){_0x419b93[_0x5e8e('0x29')]=moment()[_0x5e8e('0x70')](_0x5e8e('0xfe'));loggerPredictive[_0x5e8e('0x74')](_0x419b93[_0x5e8e('0x3e')],_0x5e8e('0x1cb'),_0x419b93[_0x5e8e('0x29')]);this[_0x5e8e('0xb9')](_0x419b93[_0x5e8e('0x1c4')])['then'](this['getDataPredictive'](_0x419b93))[_0x5e8e('0xb3')](mergeDataErlangB(_0x419b93))[_0x5e8e('0xb3')](this['startMethodPredictive'](_0x419b93))[_0x5e8e('0xab')](loggerCatchPredictive('Predictive\x20after\x20first\x20interval',_0x419b93));}else if(!ifInterval(_0x419b93['dialPredictiveInterval'],_0x419b93[_0x5e8e('0x29')])){_0x419b93['predictiveIntervalErlangCallsDroppedCalls']=0x0;_0x419b93[_0x5e8e('0x29')]=moment()[_0x5e8e('0x70')](_0x5e8e('0xfe'));loggerPredictive[_0x5e8e('0x74')](_0x419b93[_0x5e8e('0x3e')],_0x5e8e('0x1cc'),_0x419b93[_0x5e8e('0x29')]);clearInterval(_0x419b93[_0x5e8e('0x8b')]);_0x419b93[_0x5e8e('0x8b')]=undefined;this[_0x5e8e('0xb9')](_0x419b93[_0x5e8e('0x1c4')])[_0x5e8e('0xb3')](this[_0x5e8e('0x1cd')](_0x419b93))[_0x5e8e('0xb3')](mergeDataErlangB(_0x419b93))[_0x5e8e('0xb3')](this[_0x5e8e('0x1ce')](_0x419b93))[_0x5e8e('0xab')](loggerCatchPredictive(_0x5e8e('0x1cf'),_0x419b93));}else if(_0x419b93[_0x5e8e('0x1be')]&&_0x15eeb9<_0x419b93[_0x5e8e('0x1be')]-_0x1909ac){freeVariablesPredictive(_0x419b93);loggerPredictive[_0x5e8e('0x74')](_0x419b93[_0x5e8e('0x3e')],_0x5e8e('0x1d0'),_0x15eeb9,_0x5e8e('0x1d1'),_0x419b93[_0x5e8e('0x1be')],'-',_0x1909ac,'=',_0x419b93[_0x5e8e('0x1be')]-_0x1909ac,')');}else if(_0x419b93['predictiveIntervalAvailable']&&_0x15eeb9>_0x419b93[_0x5e8e('0x1be')]+_0x4c7aa1){freeVariablesPredictive(_0x419b93);loggerPredictive[_0x5e8e('0x74')](_0x419b93[_0x5e8e('0x3e')],'switch\x20in\x20progressive\x20because\x20available\x20agents\x20(',_0x15eeb9,_0x5e8e('0x1d2'),_0x419b93[_0x5e8e('0x1be')],'+',_0x4c7aa1,'=',_0x419b93[_0x5e8e('0x1be')]+_0x4c7aa1,')');}};Dialer['prototype'][_0x5e8e('0x1cd')]=function(_0x20421f){var _0x4e8078=this;return function(_0x2cf708){return new BPromise(function(_0x575224,_0x5a8200){_['merge'](_0x20421f,_0x2cf708[0x0]);if(checkGetDataPredictive(_0x2cf708[0x0])){var _0x34ee64=_0x20421f[_0x5e8e('0x1be')]=_0x20421f[_0x5e8e('0x54')]+_0x20421f[_0x5e8e('0x4e')];var _0x440745=_0x20421f[_0x5e8e('0x1c4')]*0x3c;var _0x730917=_0x2cf708[0x0][_0x5e8e('0x61')]+_0x2cf708[0x0][_0x5e8e('0x7c')];var _0xb9c7a9=(_0x2cf708[0x0][_0x5e8e('0x1d3')]+_0x2cf708[0x0]['predictiveIntervalDroppedCallsTimeout']+_0x2cf708[0x0][_0x5e8e('0x62')])/_0x2cf708[0x0][_0x5e8e('0x76')];_0x20421f[_0x5e8e('0x65')]=_0xb9c7a9>0x0?_0xb9c7a9:0x1;switch(_0x20421f[_0x5e8e('0x1c6')]){case'dropRate':var _0xbb9b7f=_0x20421f[_0x5e8e('0x1bb')]/0x64;return _0x4e8078[_0x5e8e('0x1d4')](_0x34ee64,_0x440745,_0x730917,_0xb9c7a9,_0xbb9b7f)[_0x5e8e('0xb3')](function(_0x1c6724){return _0x575224(_0x1c6724);});case _0x5e8e('0x1d5'):var _0x4a62dc=_0x20421f[_0x5e8e('0x1bb')]/0x64;return _0x4e8078[_0x5e8e('0x1d6')](_0x34ee64,_0x440745,_0x730917,_0xb9c7a9,_0x4a62dc)['then'](function(_0x23d884){return _0x575224(_0x23d884);});default:return _0x5a8200(msgResponse(_0x5e8e('0x1d7'),'Failure',_0x5e8e('0x1d8')));}}else{return _0x5a8200(msgResponse(_0x5e8e('0x1d7'),'Failure',_0x5e8e('0x1d9')));}});};};Dialer['prototype'][_0x5e8e('0x1da')]=function(_0x936a27){var _0x4b838f=this;return function(_0x12a0a2){return new BPromise(function(_0x2fd552,_0x1953d1){_['merge'](_0x936a27,_0x12a0a2[0x0]);if(checkGetDataPredictive(_0x12a0a2[0x0])){loggerPredictive[_0x5e8e('0x74')](JSON['stringify'](_0x12a0a2[0x0]));if(_0x936a27[_0x5e8e('0x1c6')]==='dropRate'){return _0x4b838f[_0x5e8e('0xc1')](_0x936a27['id'])[_0x5e8e('0xb3')](function(_0x48faca){var _0x595410=_0x936a27['loggedIn']-_0x48faca[0x0][_0x5e8e('0x1db')];var _0x193fe5=_0x936a27[_0x5e8e('0x1c4')]*0x3c;var _0x16db81=_0x12a0a2[0x0][_0x5e8e('0x61')]+_0x12a0a2[0x0][_0x5e8e('0x7c')];var _0x3c97de=(_0x12a0a2[0x0]['predictiveIntervalAnsweredCalls']+_0x12a0a2[0x0][_0x5e8e('0x79')]+_0x12a0a2[0x0]['predictiveIntervalDroppedCallsCallersExit'])/_0x12a0a2[0x0][_0x5e8e('0x76')];var _0x5223a8=_0x936a27[_0x5e8e('0x1bb')]/0x64;_0x936a27['predictiveIntervalPauses']=_0x48faca[0x0][_0x5e8e('0x1db')]||0x0;_0x936a27['predictiveIntervalHitRate']=_0x3c97de>0x0?_0x3c97de:0x1;return _0x4b838f['abandonmentRate'](_0x595410,_0x193fe5,_0x16db81,_0x3c97de,_0x5223a8);})[_0x5e8e('0xb3')](function(_0x6ea354){return _0x2fd552(_0x6ea354);})[_0x5e8e('0xab')](function(_0x327668){return _0x1953d1(msgResponse(_0x5e8e('0x1dc'),_0x5e8e('0x132'),JSON[_0x5e8e('0x47')](_0x327668)));});}if(_0x936a27[_0x5e8e('0x1c6')]===_0x5e8e('0x1d5')){return _0x4b838f[_0x5e8e('0xc1')](_0x936a27['id'])['then'](function(_0xf375eb){var _0x3a9884=_0x936a27[_0x5e8e('0x4f')]-_0xf375eb[0x0][_0x5e8e('0x1db')];var _0x33b9fd=_0x936a27[_0x5e8e('0x1c4')]*0x3c;var _0x1cee16=_0x12a0a2[0x0][_0x5e8e('0x61')]+_0x12a0a2[0x0][_0x5e8e('0x7c')];var _0x64a4d9=(_0x12a0a2[0x0][_0x5e8e('0x1d3')]+_0x12a0a2[0x0][_0x5e8e('0x79')]+_0x12a0a2[0x0]['predictiveIntervalDroppedCallsCallersExit'])/_0x12a0a2[0x0][_0x5e8e('0x76')];var _0x302341=_0x936a27[_0x5e8e('0x1bb')]/0x64;_0x936a27['predictiveIntervalPauses']=_0xf375eb[0x0][_0x5e8e('0x1db')]||0x0;_0x936a27[_0x5e8e('0x65')]=_0x64a4d9>0x0?_0x64a4d9:0x1;return _0x4b838f['busyFactor'](_0x3a9884,_0x33b9fd,_0x1cee16,_0x64a4d9,_0x302341);})[_0x5e8e('0xb3')](function(_0x1273ea){return _0x2fd552(_0x1273ea);})[_0x5e8e('0xab')](function(_0x154fcd){return _0x1953d1(msgResponse(_0x5e8e('0x1dc'),_0x5e8e('0x132'),JSON[_0x5e8e('0x47')](_0x154fcd)));});}}else{return _0x1953d1(msgResponse(_0x5e8e('0x1d7'),_0x5e8e('0x132'),_0x5e8e('0x1d9')));}});};};Dialer[_0x5e8e('0x1d')]['startMethodPredictive']=function(_0x47a027){var _0x2cf1e2=this;return function(){var _0x3e4e7e=0x0;var _0x379f58=Math['floor'](_0x47a027[_0x5e8e('0x6a')]*0x3e8);if(_0x379f58>0x0){_0x379f58=_0x379f58<0x64?0x64:_0x379f58;loggerPredictive[_0x5e8e('0x74')](_0x47a027[_0x5e8e('0x3e')],'one\x20call\x20every:',_0x379f58,'milliseconds');_0x47a027['handlePredictive']=setInterval(function(){_0x2cf1e2[_0x5e8e('0x8b')](_0x47a027);loggerPredictiveCalls[_0x5e8e('0x74')](_0x5e8e('0x1dd'),_0x3e4e7e+=0x1);},_0x379f58);}else{loggerPredictive[_0x5e8e('0x74')](_0x47a027[_0x5e8e('0x3e')],_0x5e8e('0x1de'));}};};Dialer[_0x5e8e('0x1d')][_0x5e8e('0x1df')]=function(_0x2a203e,_0x396e00){var _0xb998bf=this;return function(_0xbd8478){if(_[_0x5e8e('0x8e')](_0xbd8478)){if(_[_0x5e8e('0xa8')](_0x396e00['UserId'])||!_0x396e00[_0x5e8e('0x1e0')]){if(_0x2a203e[_0x5e8e('0x145')]===_0x5e8e('0x8')){_0x2a203e[_0x5e8e('0x11c')]=_[_0x5e8e('0x3c')](_0x2a203e[_0x5e8e('0x11c')])?!![]:_0x2a203e[_0x5e8e('0x11c')];var _0x12db76=uuid['v4']();_0xb998bf[_0x5e8e('0xa7')][_0x12db76]=new Action(_0x2a203e,_0x396e00,_0x12db76);loggerBooked[_0x5e8e('0x74')](_0x5e8e('0x1e1'),_0x12db76,_0x5e8e('0x1e2'),JSON[_0x5e8e('0x47')](_0x2a203e[_0x5e8e('0x11c')]),'Queue:\x20',_0x2a203e[_0x5e8e('0x3e')]);if(_0x2a203e[_0x5e8e('0x11c')]){_0x2a203e[_0x5e8e('0x11c')]=![];_0xb998bf[_0x5e8e('0x2c')][_0xb998bf[_0x5e8e('0xa7')][_0x12db76]['queue']]=[];ami[_0x5e8e('0xa9')]({'actionid':_0x12db76,'action':'queuestatus','queue':_0x2a203e[_0x5e8e('0x3e')]})[_0x5e8e('0xab')](function(_0x4d4dd7){_0xb998bf[_0x5e8e('0xad')](_0x2a203e);_0xb998bf[_0x5e8e('0xbb')]({'active':![],'ContactId':_0xb998bf['actions'][_0x12db76][_0x5e8e('0x10a')],'ListId':_0xb998bf[_0x5e8e('0xa7')][_0x12db76][_0x5e8e('0xcb')],'VoiceQueueId':_0xb998bf[_0x5e8e('0xa7')][_0x12db76][_0x5e8e('0x10b')]||undefined,'CampaignId':_0xb998bf[_0x5e8e('0xa7')][_0x12db76][_0x5e8e('0x112')]||undefined})['catch'](loggerCatch(_0x5e8e('0x1e3')));delete _0xb998bf['actions'][_0x12db76];});}else{loggerBooked[_0x5e8e('0x74')](_0x5e8e('0x1e4'),JSON[_0x5e8e('0x47')](_0x2a203e['queueStatusComplete']),_0x5e8e('0x1e5'),_0x2a203e[_0x5e8e('0x3e')]);_0xb998bf[_0x5e8e('0xad')](_0x2a203e);_0xb998bf[_0x5e8e('0xbb')]({'active':![],'ContactId':_0xb998bf[_0x5e8e('0xa7')][_0x12db76]['ContactId'],'ListId':_0xb998bf[_0x5e8e('0xa7')][_0x12db76][_0x5e8e('0xcb')],'VoiceQueueId':_0xb998bf[_0x5e8e('0xa7')][_0x12db76]['VoiceQueueId']||undefined,'CampaignId':_0xb998bf[_0x5e8e('0xa7')][_0x12db76][_0x5e8e('0x112')]||undefined})[_0x5e8e('0xab')](loggerCatch('[unlockOriginate][syncQueueStatusComplete]'));delete _0xb998bf[_0x5e8e('0xa7')][_0x12db76];}}else{return _0xb998bf[_0x5e8e('0x1e6')](_0x2a203e,_0x396e00);}}else{if(getDiff(_0x396e00[_0x5e8e('0x1e7')])<_0x2a203e[_0x5e8e('0x1e8')]*0x3c){if(_0x396e00[_0x5e8e('0x1e9')]&&!_0x396e00[_0x5e8e('0x1e9')]['voicePause']){_0xb998bf['preview'][_0x5e8e('0x11f')](_0x396e00['id'])[_0x5e8e('0x1f')](function(){_0xb998bf[_0x5e8e('0xad')](_0x2a203e);});}else{_0xb998bf['unlockContact']({'active':![]},_0x396e00['id'],0x1)[_0x5e8e('0x1f')](function(){console[_0x5e8e('0x1ea')](_0x5e8e('0x1eb'));_0xb998bf[_0x5e8e('0xad')](_0x2a203e);});}}else{_0x2a203e[_0x5e8e('0x5f')]+=0x1;_0xb998bf['updateOriginated'](_0x2a203e);if(_0x2a203e[_0x5e8e('0x1ec')]){_0xb998bf[_0x5e8e('0xbb')]({'active':![],'recallme':![],'UserId':null,'ContactId':_0x396e00[_0x5e8e('0x10a')],'ListId':_0x396e00['ListId'],'VoiceQueueId':_0x396e00[_0x5e8e('0x10b')]||undefined,'CampaignId':_0x396e00[_0x5e8e('0x112')]||undefined})[_0x5e8e('0xab')](loggerCatch(_0x5e8e('0x1ed')));_0xb998bf[_0x5e8e('0xc4')](createObjHistory(_0x2a203e,_0x396e00,_0x5e8e('0x1ee'),0x17,'RecallInQueue'))['catch'](loggerCatch(_0x5e8e('0x1ef')));}else{_0xb998bf[_0x5e8e('0xca')](createObjHistory(_0x2a203e,_0x396e00,_0x5e8e('0x1f0'),0x16,_0x5e8e('0x1f1')),_0x5e8e('0x1f2'),_0x5e8e('0x1f3'));}}}}else{_0x2a203e['outboundBlacklistCallsDay']+=0x1;_0xb998bf[_0x5e8e('0xca')](createObjHistory(_0x2a203e,_0x396e00,_0x5e8e('0x1f4'),0xd,'Blacklist'),_0x5e8e('0x1f5'),_0x5e8e('0x1f6'));throw _0x5e8e('0x1f7');}};};Dialer[_0x5e8e('0x1d')][_0x5e8e('0x1f8')]=function(_0xfa8035){var _0x46808b=this;var _0x260443=[];var _0x5453f9=_0xfa8035[_0x5e8e('0x1f9')]-_0xfa8035[_0x5e8e('0x68')]-_0xfa8035[_0x5e8e('0x1fa')];emitCampaignSummary(_0xfa8035);if(_0x5453f9>0x0){if(_0x5453f9>this['maxNumberOriginate']){_0x5453f9=this[_0x5e8e('0x26')];}_0xfa8035[_0x5e8e('0x1fa')]+=_0x5453f9;this[_0x5e8e('0xc0')](_0xfa8035['id'],_0x5453f9,_0xfa8035['dialOrderByScheduledAt'])[_0x5e8e('0xb3')](function(_0x7301b8){_0xfa8035[_0x5e8e('0x1fa')]-=_0x5453f9;_0xfa8035[_0x5e8e('0x1fa')]=_0xfa8035[_0x5e8e('0x1fa')]>0x0?_0xfa8035[_0x5e8e('0x1fa')]:0x0;if(!checkContactEmpty(_0x7301b8)){_0xfa8035[_0x5e8e('0x3f')]=_0x5e8e('0x1fb');logger[_0x5e8e('0x74')](_0x5e8e('0x1fc')+_0xfa8035[_0x5e8e('0x3e')]);}else{_0xfa8035[_0x5e8e('0x68')]+=_0x7301b8['length'];_0xfa8035[_0x5e8e('0x3f')]=_0x5e8e('0x1fd');for(var _0x408835=0x0;_0x408835<_0x7301b8[_0x5e8e('0x1fe')];_0x408835+=0x1){_0xfa8035[_0x5e8e('0x1ff')]+=0x1;if(_['isNil'](_0x7301b8[_0x408835])||_[_0x5e8e('0xa8')](_0x7301b8[_0x408835]['Contact'])||_[_0x5e8e('0xa8')](_0x7301b8[_0x408835]['Contact'][_0x5e8e('0x15c')])){_0x46808b[_0x5e8e('0xc8')](_0x5e8e('0x200'),_0xfa8035,_0x7301b8[_0x408835]);}else{_0x46808b[_0x5e8e('0xb7')](_[_0x5e8e('0x11a')](_0x7301b8[_0x408835],[_0x5e8e('0x112'),_0x5e8e('0x201')]))[_0x5e8e('0xb3')](_0x46808b['checkContactBlack'](_0xfa8035,_0x7301b8[_0x408835]))[_0x5e8e('0xab')](_0x46808b[_0x5e8e('0xc7')]('[actionOriginateIvr]\x20',_0xfa8035));}}}})[_0x5e8e('0xab')](loggerGetContactDialer('[getContactCampaign2]',_0xfa8035,_0x5453f9));}};Dialer[_0x5e8e('0x1d')]['handlePower']=function(_0x13dcc0,_0x563120){var _0x410523=this;var _0x432dae=[];var _0x44da12=_0x563120>=0x1?_0x563120:0x1;var _0x1135a3=[];if(_0x13dcc0[_0x5e8e('0x145')]===_0x5e8e('0x8')){_0x44da12=0x1;}var _0x13d514=Math[_0x5e8e('0x1c0')](_0x13dcc0[_0x5e8e('0x4e')]*_0x44da12)-_0x13dcc0[_0x5e8e('0x68')]-_0x13dcc0['temp'];emitVoiceQueueSummary(_0x13dcc0);if(_0x13dcc0[_0x5e8e('0x202')]>0x0){var _0x2c31e6=_0x13dcc0[_0x5e8e('0x202')]-_0x13dcc0[_0x5e8e('0x68')]-_0x13dcc0[_0x5e8e('0x54')]-_0x13dcc0['temp']-_0x13dcc0[_0x5e8e('0x50')];if(_0x13d514>_0x2c31e6){_0x13d514=_0x2c31e6;}}if(_0x13d514>0x0){if(_0x13dcc0['dialMethod']===_0x5e8e('0x8')){_0x13d514=0x1;}if(_0x13d514>this['maxNumberOriginate']){_0x13d514=this[_0x5e8e('0x26')];}_0x13dcc0[_0x5e8e('0x1fa')]+=_0x13d514;for(var _0x1c0c25 in this[_0x5e8e('0x24')]){if(this['agents']['hasOwnProperty'](_0x1c0c25)){if(this[_0x5e8e('0x24')][_0x1c0c25]['state']==='not_inuse'&&this[_0x5e8e('0x24')][_0x1c0c25][_0x5e8e('0xd3')]===_0x5e8e('0x203')){_0x432dae['push'](this['agents'][_0x1c0c25]['id']);}}}this[_0x5e8e('0xbe')](_0x13dcc0['id'],_0x432dae,_0x13d514,_0x13dcc0[_0x5e8e('0x204')])[_0x5e8e('0xb3')](function(_0x2d215e){_0x13dcc0['temp']-=_0x13d514;_0x13dcc0[_0x5e8e('0x1fa')]=_0x13dcc0[_0x5e8e('0x1fa')]>0x0?_0x13dcc0[_0x5e8e('0x1fa')]:0x0;if(!checkContactEmpty(_0x2d215e)){_0x410523[_0x5e8e('0xb1')](_0x13dcc0)[_0x5e8e('0xb3')](sendMessageReschedule(_0x13dcc0))[_0x5e8e('0xab')](loggerCatch(_0x5e8e('0xb4')));}else{_0x13dcc0[_0x5e8e('0x68')]+=_0x2d215e['length'];_0x13dcc0[_0x5e8e('0x3f')]=_0x13dcc0[_0x5e8e('0x145')]===_0x5e8e('0x8')?_0x5e8e('0x161'):_0x5e8e('0x1fd');for(var _0x313383=0x0;_0x313383<_0x2d215e['length'];_0x313383+=0x1){if(_['isNil'](_0x2d215e[_0x313383])||_['isNil'](_0x2d215e[_0x313383]['Contact'])||_[_0x5e8e('0xa8')](_0x2d215e[_0x313383][_0x5e8e('0x15b')][_0x5e8e('0x15c')])){_0x410523[_0x5e8e('0xc8')](_0x5e8e('0x200'),_0x13dcc0,_0x2d215e[_0x313383]);}else{_0x410523[_0x5e8e('0xb5')](_[_0x5e8e('0x11a')](_0x2d215e[_0x313383],[_0x5e8e('0x10b'),_0x5e8e('0x201')]))[_0x5e8e('0xb3')](_0x410523[_0x5e8e('0x1df')](_0x13dcc0,_0x2d215e[_0x313383]))['catch'](_0x410523[_0x5e8e('0xc7')](_0x5e8e('0x200'),_0x13dcc0));}}}})[_0x5e8e('0xab')](loggerGetContactDialer(_0x5e8e('0x205'),_0x13dcc0,_0x13d514));}};Dialer['prototype'][_0x5e8e('0x8b')]=function(_0x430513){var _0x5d0b89=this;if(_0x430513[_0x5e8e('0x202')]>0x0){var _0x30412a=_0x430513[_0x5e8e('0x202')]-_0x430513[_0x5e8e('0x68')]-_0x430513[_0x5e8e('0x54')];if(_0x30412a>0x0){this['tryOriginatePredictive'](_0x430513);}else{loggerPredictiveCalls[_0x5e8e('0x74')](_0x5e8e('0x206'));}}else{this[_0x5e8e('0x207')](_0x430513);}};Dialer[_0x5e8e('0x1d')][_0x5e8e('0x207')]=function(_0x4e6898){var _0x8fa6a7=this;var _0x197d98=[];_0x4e6898[_0x5e8e('0x68')]+=0x1;for(var _0x5d3a4f in this[_0x5e8e('0x24')]){if(this[_0x5e8e('0x24')][_0x5e8e('0x93')](_0x5d3a4f)){if(this[_0x5e8e('0x24')][_0x5d3a4f][_0x5e8e('0xa0')]==='not_inuse'&&this[_0x5e8e('0x24')][_0x5d3a4f]['status']===_0x5e8e('0x203')){_0x197d98['push'](this[_0x5e8e('0x24')][_0x5d3a4f]['id']);}}}this[_0x5e8e('0xbe')](_0x4e6898['id'],_0x197d98,0x1,_0x4e6898[_0x5e8e('0x204')])[_0x5e8e('0xb3')](function(_0x52ea83){if(!checkContactEmpty(_0x52ea83)){checkContactLowerLimitOriginate(_0x4e6898,0x1,0x0);_0x8fa6a7[_0x5e8e('0xb1')](_0x4e6898)[_0x5e8e('0xb3')](sendMessageReschedule(_0x4e6898))[_0x5e8e('0xab')](loggerCatch('[countReScheduled]\x20'));}else{_0x4e6898[_0x5e8e('0x3f')]=_0x5e8e('0x1fd');if(_[_0x5e8e('0xa8')](_0x52ea83[0x0])||_[_0x5e8e('0xa8')](_0x52ea83[0x0][_0x5e8e('0x15b')])||_[_0x5e8e('0xa8')](_0x52ea83[0x0][_0x5e8e('0x15b')][_0x5e8e('0x15c')])){_0x8fa6a7[_0x5e8e('0xc8')](_0x5e8e('0x200'),_0x4e6898,_0x52ea83[0x0]);}else{_0x8fa6a7[_0x5e8e('0xb5')](_[_0x5e8e('0x11a')](_0x52ea83[0x0],[_0x5e8e('0x10b'),_0x5e8e('0x201')]))[_0x5e8e('0xb3')](_0x8fa6a7[_0x5e8e('0x1df')](_0x4e6898,_0x52ea83[0x0]))[_0x5e8e('0xab')](_0x8fa6a7[_0x5e8e('0xc7')](_0x5e8e('0x208'),_0x4e6898));}}})['catch'](loggerGetContactDialer(_0x5e8e('0x209'),_0x4e6898,0x1));emitVoiceQueueSummary(_0x4e6898);};Dialer[_0x5e8e('0x1d')][_0x5e8e('0x1d4')]=function(_0x95cd2d,_0x153330,_0x1f1668,_0x11d981,_0x279000,_0x56fa52){loggerPredictive[_0x5e8e('0x74')](_0x5e8e('0x20a'));loggerPredictive['info']('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',_0x95cd2d);loggerPredictive[_0x5e8e('0x74')](_0x5e8e('0x20b'),_0x153330);loggerPredictive['info'](_0x5e8e('0x20c'),_0x1f1668);loggerPredictive[_0x5e8e('0x74')](_0x5e8e('0x20d'),_0x11d981);loggerPredictive['info'](_0x5e8e('0x20e'),_0x279000);loggerPredictive['info'](_0x5e8e('0x7e'));return new BPromise(function(_0x27fbd2,_0x3971c8){if(_0x95cd2d<=0x0||isNaN(_0x95cd2d)){return _0x3971c8(msgResponse('[abandonmentRate]',_0x5e8e('0x46'),_0x5e8e('0x20f')+_0x95cd2d));}if(_0x1f1668<=0x0||isNaN(_0x1f1668)){return _0x3971c8(msgResponse(_0x5e8e('0x210'),_0x5e8e('0x46'),_0x5e8e('0x211')+_0x1f1668));}if(_0x11d981<=0x0||isNaN(_0x11d981)){return _0x3971c8(msgResponse('[abandonmentRate]',_0x5e8e('0x46'),_0x5e8e('0x212')+_0x11d981));}if(_0x153330<=0x0||isNaN(_0x153330)){return _0x3971c8(msgResponse(_0x5e8e('0x210'),'Error','interval\x20=\x20'+_0x153330));}if(_0x279000<=0x0||isNaN(_0x279000)){return _0x3971c8(msgResponse('[abandonmentRate]',_0x5e8e('0x46'),_0x5e8e('0x213')+_0x279000));}_0x56fa52=_0x56fa52||0x0;var _0xdd7ae9=0x1/_0x1f1668;var _0x472bc3=0x0;var _0x5466a0=0x0;var _0x2fafd1=0x0;var _0x3d2da5=0x0;for(var _0x45b4ce=0x0;_0x2fafd1<_0x279000;_0x45b4ce+=0x1){_0x5466a0=_0x45b4ce/_0x153330;_0x472bc3=(_0x11d981*_0x5466a0+_0x56fa52)/_0xdd7ae9;_0x2fafd1=erlangb(_0x472bc3,_0x95cd2d);_0x3d2da5=_0x472bc3/_0x95cd2d*(0x1-erlangb(_0x472bc3,_0x95cd2d));}return _0x27fbd2({'erlangCalls':_0x45b4ce,'erlangCallToSecond':_0x153330/_0x45b4ce,'erlangAbandonmentRate':_0x2fafd1,'erlangBusyFactor':_0x3d2da5});});};Dialer[_0x5e8e('0x1d')][_0x5e8e('0x1d6')]=function(_0x331e31,_0x593937,_0x3e5c19,_0x27e8d1,_0x3ede4f,_0x4ccc33){loggerPredictive[_0x5e8e('0x74')](_0x5e8e('0x214'));loggerPredictive[_0x5e8e('0x74')](_0x5e8e('0x215'),_0x331e31);loggerPredictive['info'](_0x5e8e('0x20b'),_0x593937);loggerPredictive[_0x5e8e('0x74')](_0x5e8e('0x20c'),_0x3e5c19);loggerPredictive['info'](_0x5e8e('0x20d'),_0x27e8d1);loggerPredictive['info'](_0x5e8e('0x216'),_0x3ede4f);loggerPredictive[_0x5e8e('0x74')]('---------------------------');return new BPromise(function(_0x89dfa1,_0x147a8b){if(_0x331e31<=0x0||isNaN(_0x331e31)){return _0x147a8b(msgResponse(_0x5e8e('0x217'),_0x5e8e('0x46'),'m\x20=\x20'+_0x331e31));}if(_0x3e5c19<=0x0||isNaN(_0x3e5c19)){return _0x147a8b(msgResponse('[busyFactor]',_0x5e8e('0x46'),_0x5e8e('0x211')+_0x3e5c19));}if(_0x27e8d1<=0x0||isNaN(_0x27e8d1)){return _0x147a8b(msgResponse(_0x5e8e('0x217'),_0x5e8e('0x46'),_0x5e8e('0x212')+_0x27e8d1));}if(_0x593937<=0x0||isNaN(_0x593937)){return _0x147a8b(msgResponse(_0x5e8e('0x217'),_0x5e8e('0x46'),'interval\x20=\x20'+_0x593937));}if(_0x3ede4f<=0x0||isNaN(_0x3ede4f)){return _0x147a8b(msgResponse('[busyFactor]',_0x5e8e('0x46'),_0x5e8e('0x218')+_0x3ede4f));}_0x4ccc33=_0x4ccc33||0x0;var _0x397443=0x1/_0x3e5c19;var _0x5dd06f=0x0;var _0x2a8ea9=0x0;var _0x4ab4e2=0x0;var _0x198f28=0x0;for(var _0x4ea68e=0x0;_0x198f28<_0x3ede4f;_0x4ea68e+=0x1){_0x2a8ea9=_0x4ea68e/_0x593937;_0x5dd06f=(_0x27e8d1*_0x2a8ea9+_0x4ccc33)/_0x397443;_0x4ab4e2=erlangb(_0x5dd06f,_0x331e31);_0x198f28=_0x5dd06f/_0x331e31*(0x1-erlangb(_0x5dd06f,_0x331e31));}return _0x89dfa1({'erlangCalls':_0x4ea68e,'erlangCallToSecond':_0x593937/_0x4ea68e,'erlangAbandonmentRate':_0x4ab4e2,'erlangBusyFactor':_0x198f28});});};module[_0x5e8e('0x219')]=Dialer;
\ No newline at end of file
+var _0xd92b=['\x20Timezone\x20unknow\x20','isArray','Action','command','iftime\x20%s,%s','interval','timezones','content','indexOf','true','all','some','INTERVAL_IS_OVERTIME','Global:\x20','\x20Interval\x20is\x20overtime:\x20','Timezone:\x20','checkDialMethod','progressive','handlePower','dialPowerLevel','predictive','Queue','method\x20not\x20recognized','launchHandleIvr','handleIvr','dialActive','loggedIn','checkIsTrunkReachable','dialGlobalInterval','dialTimezone','checkIfTimeIntervals','pow','random','match','actionOriginate','originate','Contact','phone','contact\x20is\x20undefine','getCaller','\x22agi://%s/square,%s\x22','NONE','\x22%s,%s%s,,,%s\x22','dialQueueTimeout','ACTIVE','XMD-AMDINITIALSILENCE','dialAMDInitialSilence','XMD-AMDGREETING','dialAMDGreeting','XMD-AMDAFTERGREETINGSILENCE','dialAMDAfterGreetingSilence','XMD-AMDTOTALANALYSISTIME','dialAMDTotalAnalysisTime','XMD-AMDMINWORDLENGTH','dialAMDMinWordLength','XMD-AMDBETWEENWORDSSILENCE','dialAMDBetweenWordsSilence','XMD-AMDMAXIMUMNUMBEROFWORDS','dialAMDMaximumNumberOfWords','XMD-AMDSILENCETHRESHOLD','dialAMDSilenceThreshold','XMD-AMDMAXIMUMWORDLENGTH','dialAMDMaximumWordLength','XMD-VOICEQUEUEID','XMD-CAMPAIGNID','tags','createdAt','updatedAt','%s%s','XMD-','toUpper','dialRandomLastDigitCallerIdNumber','XMD-ORIGINATECALLERIDNAME','XMD-ORIGINATECALLERIDNUM','originatecalleridnum','SIP/%s/%s%s','dialCutDigit','substring','trim','from-sip','dialOriginateTimeout','outboundOriginateFailureCallsDay','[originateError]:\x20%s','OriginateError','[originate][error]','Error','originate\x20action\x20Error','getQueue','response','callProgressDetecting','[callProgressDetecting]\x20','checkRetriveMax','countcongestionretry','countnoanswerretry','countnosuchnumberretry','countmachineretry','dialGlobalMaxRetry','dialNoAnswerMaxRetry','[rescheduleContact][NoAnswer]','countbusyretry','dialCongestionMaxRetry','dialCongestionRetryFrequency','[rescheduleContact][NoSuchNumber]','dialAbandonedRetryFrequency','dialMachineMaxRetry','dialMachineRetryFrequency','[rescheduleContact][Machine]','countagentrejectretry','dialAgentRejectMaxRetry','dialAgentRejectRetryFrequency','[rescheduleContact][AgentReject]','object','[callProgressDetecting]','evt\x20is\x20undefine','reason','NoSuchNumber','[syncAgentComplete][createHistory][0]','reason\x200\x20no\x20such\x20number....','createStateFinal','outboundNoAnswerCallsDay','NoAnswer','countglobal','reason\x203\x20ringing\x20no\x20answer','stateGlobal','[syncAgentComplete][createHistory][5]','dialBusyMaxRetry','reason\x205\x20busy','Congestion','[syncAgentComplete][createHistory][8]','reason\x208\x20congestion','outboundAbandonedCallsDay','[syncAgentComplete][createHistory][11]','reason\x2011\x20abandoned','AgentReject','[syncAgentComplete][createHistory][20]','reason\x2020\x20agentreject','[syncAgentComplete][createHistory][?]','Success','contact\x20not\x20moved','dialPredictiveOptimizationPercentage','round','predictiveIntervalMaxThreshold','predictiveIntervalMinThreshold','[startMethodPredictive][StartProgressive]','check\x20predictive\x20is\x20not\x20undefine','check\x20handlePredictive\x20is\x20not\x20undefine','collection\x20data\x20in\x20progressive\x20at','dialPredictiveInterval','[startMethodPredictive][StartProgressive][Loop]','dialPredictiveOptimization','dropRate','[stopMethodPredictive][ReStartProgressive][ExceededDropDay]','[stopMethodPredictive][ReStartProgressive][ExceededDropInterval]','Max\x20Drop\x20','Drop\x20in\x20this\x20interval','getDataPredictive','startMethodPredictive','Predictive\x20after\x20first\x20interval','recalculate\x20predictive\x20at','Predictive\x20for\x20every\x20interval','switch\x20in\x20progressive\x20because\x20available\x20agents\x20(',')\x20are\x20less\x20than\x20threshold\x20(','agentBusyFactor','Unknown\x20Predictive','getDataPredictiveOld','outboundQueuePauses','[CatchErlangB]','predictiveIntervalAnsweredCalls','busyFactor','[getDataPredictive]','check\x20failure','floor','one\x20call\x20every:','[handlePredictive]','fail\x20to\x20scheduled\x20calls','checkContactBlack','recallme','[booked][checkContactBlack]','queueStatusComplete:\x20','queuestatus','[booked][checkContactBlack][else]','Queue:\x20','[unlockOriginate][syncQueueStatusComplete]','scheduledat','dialRecallMeTimeout','Agent','voicePause','log','Contact\x20updated','dialRecallInQueue','[rescheduleContact][dialRecallInQueue]','RecallInQueue','[Originate][HistoryDialRecallInQueue][historyCatch]','RECALLFAILEDTIMEOUT','RecallFailedTimeout','BLACKLIST','Blacklist','[Originate][historyBlacklist]','[Originate][MoveBlacklist]','limitCalls','temp','dialOrderByScheduledAt','[getContactCampaign2][Empty]','RUNNING','ivrTotalCallsDays','[actionOriginate]\x20','Contact.phone','[actionOriginateIvr]\x20','dialLimitQueue','not_inuse','tryOriginatePredictive','[actionOriginatePredictive]\x20','[getContactDialerPredictive]','abandonmentRate','--------\x20Drop\x20Rate\x20--------','M:\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20','Interval:\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20','P:\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20','Amax:\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20','[abandonmentRate]','m\x20=\x20','Ts\x20=\x20','p\x20=\x20','interval\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','[busyFactor]','Umin\x20=\x20','exports','util','lodash','uuid','moment','md5','ioredis','dialer','../../../config/logger','booked','predictiveCalls','syncQueueSummary','redis','defaults','localhost','../rpc/cmHopper','../rpc/cmHopperFinal','../rpc/voiceQueueRt','./history','./final','./agentComplete','./queueCallerAbandon','env','XCALLY_IP_AGI','127.0.0.1','rrmemory','roundrobin','prototype','tail','preview','voiceQueues','campaigns','agents','trunks','maxNumberOriginate','actions','contactsId','uniqueId','optionPredictive','startPredictive','startProgressive','ivrOriginated','queueBooked','queueBookedRR','agentconnect','bind','syncQueueCallerAbandon','syncOriginateResponse','agentcomplete','syncAgentComplete','custom:queuesummary','hangup','syncHangup','newexten','syncNewExten','varset','syncVarSet','queuemember','syncQueueMember','queuestatuscomplete','syncQueueStatusComplete','loopCampaigns','loopClearZombieChannels','isUndefined','message','AGENTS_NOT_LOGGED','\x20AGENTS\x20NOT\x20LOGGED','NOT_ACTIVE','\x20NOT\x20Active','Interval','INTERVAL_IS_NULL','\x20INTERVAL_IS_NULL','Intervals','name','isEmpty','[ifTime][Action]','stringify','milliseconds','seconds','emit','outbound','answered','available','pTalking','sumBillable','sumDuration','talking','total','type','waiting','loggedInDb','dialMethod','dialOriginateCallerIdName','dialOriginateCallerIdNumber','dialPrefix','outboundAnswerAgiCallsDay','outboundAnswerCallsDay','outboundBusyCallsDay','outboundCongestionCallsDay','outboundDropCallsDayACS','outboundDropCallsDayCallersExit','outboundDropCallsDayTimeout','outboundNoSuchCallsDay','outboundRejectCallsDay','outboundUnknownCallsDay','predictiveIntervalHitRate','predictiveIntervalMultiplicativeFactor','predictiveIntervalPauses','predictiveIntervalAvailable','predictiveIntervalTotalCalls','originated','erlangCalls','erlangCallToSecond','erlangAbandonmentRate','erlangBusyFactor','Trunk','active','callerid','voice:queue:%s','voice_queue:save','ivr','format','campaign:ivr:%s','info','-----\x20Stats\x20Predictive\x20---','Total\x20Calls:\x20\x20\x20\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','predictiveIntervalDroppedCallsCallersExit','AVG\x20Talk\x20Time:\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20','predictiveIntervalAvgTalktime','---------------------------','Avg\x20Talk\x20Time\x20is\x20not\x20enough\x20for\x20predictive','predictiveIntervalAvgHoldtime','Avg\x20Hold\x20Time\x20is\x20not\x20enough\x20for\x20predictive','Total\x20Calls\x20are\x20not\x20enough\x20for\x20predictive','History\x20information\x20are\x20empty','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','merge','diff','clearing\x20variable\x20start\x20progressive','clearing\x20variable\x20start\x20predictive','handlePredictive','string','\x22%s\x22\x20<%s>','\x22\x22\x20<>','error','inspect','stack','length','hasOwnProperty','[decremetOriginate]\x20is\x20null\x20or\x20undefined','RESCHEDULED_CONTACTS','[getContactDialer2][ReScheduled]','contactsRescheduled','contacts','AVAILABLE_CONTACTS_FINISHED','[getContactDialer2][Empty]','sendMessageOneNotActive','[syncQueueSummary]\x20Campaign\x20Queue:\x20','is\x20disactive','[syncQueueSummary]\x20Campaign\x20Ivr:\x20','is\x20not\x20active','IS_DISACTIVED','statedesc','endtime','starttime','clearZombieChannels','[uniqueid]','[actions]','sequence','enqueue','isNil','status','[Dialer][checkChannel]','queue','[Dialer][checkChannel][ivr]','countReScheduled','catch','[countReScheduled]\x20','resolve','then','checkIsBlackList','[checkIsBlackList]\x20','checkIsBlackListIvr','[checkIsBlackListIvr]\x20','averageHandleTime','rescheduleContact','[rescheduleContact]\x20','unlockContact','[unlockContact]\x20','getContactDialer','[getContactDialer]\x20','getContactDialerIvr','getVoiceQueueRtPauses','[getVoiceQueueRtPauses]\x20','[moveContactManagedDialer]\x20','updateOriginated','[updateOriginated]\x20is\x20null\x20or\x20undefined','loggerHandler','emptyContact','notFound','saveInDb','ContactId','ListId','UserId','VoiceQueueId','CampaignId','[emptyContact][createHistory]','isSuccess','SIP/%s','reachable','unmonitored','createHistory','variable','amdstatus','exten','xcally-motion-dialer','dialAMDActive','HANGUP','uniqueid','state','HangupInAMD','membername','AMD','[syncHangupInAMD][createHistory]','value','MACHINE','[syncMachine]','[syncHangupInAMDIvr][createHistory]','[syncHangupInAMDIvr]','[syncMachineIvr][createHistory]','[syncHangupIvr][createHistory]','moveContactManagedDialer','dialQueueProject','AnswerAGI','[syncHangupIvr]','Unknow','agent','agiafterat','dialQueueProject2','dialAgiAfterHangupAgent','YYYY-MM-DD\x20HH:mm:ss','[syncAgentComplete]','queueCallerAbandonCreateState','[syncAgentComplete][createHistory]','[syncQueueCallerAbandon]\x20[Drop]','responsetime','predictiveIntervalDroppedCallsTimeout','predictiveIntervalErlangCallsDroppedCalls','Drop','TIMEOUT','countdropretry','dialDropMaxRetry','add','dialDropRetryFrequency','minutes','[rescheduleContact][Drop]','Abandoned','dropreason','CALLEREXIT','countabandonedretry','dialAbandonedMaxRetry','[rescheduleContact][Abandoned]','channel','actionid','strategy','locked','paused','stateinterface','push','queueStatusComplete','[unlockQueueStatus][undefined]','[booked][unlockQueueStatus]','pick','run','idHopper','finally','[unlock][syncQueueStatusComplete]','_rr','unlockRR','[booked][RR]','Agent:\x20','contactAgent-idHopper:\x20','[Catch][Preview][syncQueueStatusComplete]','[booked][RR][finaly]','[booked][unlock2]','[booked][unlock3]','[unlock3][syncQueueStatusComplete]','syncCampaigns','isTrunkReachable','TrunkBackup','TRUNK_IS_NOT_REACHABLE','checkIfTime','ifTime','\x20Intervals\x20is\x20null\x20','INTERVAL_IS_EMPTY','Failure','\x20Intervals\x20is\x20empty\x20','TIMEZONE_UNKNOW'];(function(_0x370d7f,_0x275283){var _0x5b8e64=function(_0x493928){while(--_0x493928){_0x370d7f['push'](_0x370d7f['shift']());}};_0x5b8e64(++_0x275283);}(_0xd92b,0xe5));var _0xbd92=function(_0x451bb4,_0x15877e){_0x451bb4=_0x451bb4-0x0;var _0x2c53a9=_0xd92b[_0x451bb4];return _0x2c53a9;};'use strict';var util=require(_0xbd92('0x0'));var _=require(_0xbd92('0x1'));var BPromise=require('bluebird');var uuid=require(_0xbd92('0x2'));var moment=require(_0xbd92('0x3'));var rr=require('rr');var md5=require(_0xbd92('0x4'));var Redis=require(_0xbd92('0x5'));var config=require('../../../config/environment/');var logger=require('../../../config/logger')(_0xbd92('0x6'));var loggerBooked=require(_0xbd92('0x7'))(_0xbd92('0x8'));var loggerPredictive=require(_0xbd92('0x7'))('predictive');var loggerPredictiveCalls=require('../../../config/logger')(_0xbd92('0x9'));var loggerSyncQueueSummary=require(_0xbd92('0x7'))(_0xbd92('0xa'));var ami=require('../ami');config[_0xbd92('0xb')]=_[_0xbd92('0xc')](config['redis'],{'host':_0xbd92('0xd'),'port':0x18eb});var io=require('socket.io-emitter')(new Redis(config['redis']));var cmHopper=require(_0xbd92('0xe'));var cmHopperFinal=require(_0xbd92('0xf'));var cmHopperHistory=require('../rpc/cmHopperHistory');var cmHopperBlack=require('../rpc/cmHopperBlack');var voiceQueueRt=require(_0xbd92('0x10'));var Action=require('./action');var History=require(_0xbd92('0x11'));var Final=require(_0xbd92('0x12'));var AgentComplete=require(_0xbd92('0x13'));var QueueCallerAbandon=require(_0xbd92('0x14'));var Hangup=require('./hangup');var ipAgi=process[_0xbd92('0x15')][_0xbd92('0x16')]||_0xbd92('0x17');var strategy={'rrmemory':_0xbd92('0x18'),'roundrobin':_0xbd92('0x19')};var Sequence=function(){};Sequence[_0xbd92('0x1a')]['enqueue']=function(_0x2b259e){this['tail']=this[_0xbd92('0x1b')]?this[_0xbd92('0x1b')]['finally'](_0x2b259e):_0x2b259e();};function Dialer(_0xcaa1c2,_0x2729f4){this['sequence']=new Sequence();this[_0xbd92('0x1c')]=_0x2729f4;this[_0xbd92('0x1d')]=_0xcaa1c2[_0xbd92('0x1d')];this[_0xbd92('0x1e')]=_0xcaa1c2['campaigns'];this[_0xbd92('0x1f')]=_0xcaa1c2[_0xbd92('0x1f')];this[_0xbd92('0x20')]=_0xcaa1c2[_0xbd92('0x20')];this[_0xbd92('0x21')]=config[_0xbd92('0x21')]||0x2;this['channels']={};this[_0xbd92('0x22')]={};this[_0xbd92('0x23')]={};this[_0xbd92('0x24')]={};this[_0xbd92('0x25')]={};this[_0xbd92('0x26')]={};this[_0xbd92('0x27')]={};this[_0xbd92('0x28')]={};this[_0xbd92('0x29')]={};this[_0xbd92('0x2a')]={};ami['on'](_0xbd92('0x2b'),this['syncAgentConnect'][_0xbd92('0x2c')](this));ami['on']('queuecallerabandon',this[_0xbd92('0x2d')][_0xbd92('0x2c')](this));ami['on']('originateresponse',this[_0xbd92('0x2e')][_0xbd92('0x2c')](this));ami['on'](_0xbd92('0x2f'),this[_0xbd92('0x30')][_0xbd92('0x2c')](this));ami['on'](_0xbd92('0x31'),this[_0xbd92('0xa')]['bind'](this));ami['on'](_0xbd92('0x32'),this[_0xbd92('0x33')]['bind'](this));ami['on'](_0xbd92('0x34'),this[_0xbd92('0x35')][_0xbd92('0x2c')](this));ami['on'](_0xbd92('0x36'),this[_0xbd92('0x37')][_0xbd92('0x2c')](this));ami['on'](_0xbd92('0x38'),this[_0xbd92('0x39')][_0xbd92('0x2c')](this));ami['on'](_0xbd92('0x3a'),this[_0xbd92('0x3b')][_0xbd92('0x2c')](this));this[_0xbd92('0x3c')]();this[_0xbd92('0x3d')]();}function isNotNull(_0x5e6641){return _0x5e6641!==null&&!_[_0xbd92('0x3e')](_0x5e6641);}function checkIsLoggedIn(_0x1e0ae5,_0x596c09){return function(){if(_0x596c09<=0x0){_0x1e0ae5[_0xbd92('0x3f')]=_0xbd92('0x40');throw _0x1e0ae5['name']+_0xbd92('0x41');}};}function isActive(_0x2f9cae){return _0x2f9cae;}function checkIsActive(_0x130615,_0x47e918){return function(){if(!isActive(_0x47e918)){_0x130615[_0xbd92('0x3f')]=_0xbd92('0x42');throw _0x130615['name']+_0xbd92('0x43');}};}function checkInterval(_0x16c60a){return function(){if(!isNotNull(_0x16c60a[_0xbd92('0x44')])){_0x16c60a[_0xbd92('0x3f')]=_0xbd92('0x45');throw _0x16c60a['name']+_0xbd92('0x46');}if(!isNotNull(_0x16c60a[_0xbd92('0x44')][_0xbd92('0x47')])){_0x16c60a[_0xbd92('0x3f')]=_0xbd92('0x45');throw _0x16c60a[_0xbd92('0x48')]+_0xbd92('0x46');}if(!isNotNull(_[_0xbd92('0x49')](_0x16c60a[_0xbd92('0x44')][_0xbd92('0x47')]))){_0x16c60a['message']=_0xbd92('0x45');throw _0x16c60a[_0xbd92('0x48')]+'\x20INTERVAL_IS_NULL';}};}function msgResponse(_0x359c89,_0x312bb1,_0x46a914){return{'action':_0x359c89,'response':_0x312bb1,'message':_0x46a914,'stack':_0x46a914};}function myreject(_0x27a169){return function(_0x3380cc){return _0x27a169(msgResponse(_0xbd92('0x4a'),'Error',JSON[_0xbd92('0x4b')](_0x3380cc)));};}function getSeconds(_0x57a25b,_0x5e74df){var _0x296b85=moment(_0x57a25b)[_0xbd92('0x4c')](0x0);var _0x593616=moment(_0x5e74df)[_0xbd92('0x4c')](0x0);return _0x296b85['diff'](_0x593616,_0xbd92('0x4d'));}function emit(_0x5b0690,_0x2dd6db,_0x3a52a8){io['to'](_0x5b0690)[_0xbd92('0x4e')](_0x2dd6db,_0x3a52a8);}function emitVoiceQueueSummary(_0x104366){if(_0x104366['type']===_0xbd92('0x4f')){var _0x57f5e1={'id':_0x104366['id'],'name':_0x104366[_0xbd92('0x48')],'strategy':_0x104366['strategy'],'answered':_0x104366[_0xbd92('0x50')],'available':_0x104366[_0xbd92('0x51')],'loggedIn':_0x104366['loggedIn'],'pTalking':_0x104366[_0xbd92('0x52')],'sumBillable':_0x104366[_0xbd92('0x53')],'sumDuration':_0x104366[_0xbd92('0x54')],'sumHoldTime':_0x104366['sumHoldTime']||0x0,'talking':_0x104366[_0xbd92('0x55')],'total':_0x104366[_0xbd92('0x56')],'type':_0x104366[_0xbd92('0x57')],'unmanaged':_0x104366['unmanaged'],'abandoned':_0x104366['abandoned'],'waiting':_0x104366[_0xbd92('0x58')],'loggedInDb':_0x104366[_0xbd92('0x59')],'dialActive':_0x104366['dialActive'],'dialMethod':_0x104366[_0xbd92('0x5a')],'dialOriginateCallerIdName':_0x104366[_0xbd92('0x5b')],'dialOriginateCallerIdNumber':_0x104366[_0xbd92('0x5c')],'dialOriginateTimeout':_0x104366['dialOriginateTimeout'],'dialPrefix':_0x104366[_0xbd92('0x5d')],'outboundAnswerAgiCallsDay':_0x104366[_0xbd92('0x5e')],'outboundAnswerCallsDay':_0x104366[_0xbd92('0x5f')],'outboundBlacklistCallsDay':_0x104366['outboundBlacklistCallsDay'],'outboundBusyCallsDay':_0x104366[_0xbd92('0x60')],'outboundCongestionCallsDay':_0x104366[_0xbd92('0x61')],'outboundDropCallsDayACS':_0x104366[_0xbd92('0x62')],'outboundDropCallsDayCallersExit':_0x104366[_0xbd92('0x63')],'outboundDropCallsDayTimeout':_0x104366[_0xbd92('0x64')],'outboundNoAnswerCallsDay':_0x104366['outboundNoAnswerCallsDay'],'outboundNoSuchCallsDay':_0x104366[_0xbd92('0x65')],'outboundOriginateFailureCallsDay':_0x104366['outboundOriginateFailureCallsDay'],'outboundReCallsDay':_0x104366['outboundReCallsDay'],'outboundRejectCallsDay':_0x104366[_0xbd92('0x66')],'outboundUnknownCallsDay':_0x104366[_0xbd92('0x67')],'predictiveIntervalAnsweredCalls':_0x104366['predictiveIntervalAnsweredCalls'],'predictiveIntervalAvgHoldtime':_0x104366['predictiveIntervalAvgHoldtime'],'predictiveIntervalAvgTalktime':_0x104366['predictiveIntervalAvgTalktime'],'predictiveIntervalDroppedCallsCallersExit':_0x104366['predictiveIntervalDroppedCallsCallersExit'],'predictiveIntervalDroppedCallsTimeout':_0x104366['predictiveIntervalDroppedCallsTimeout'],'predictiveIntervalErlangCalls':_0x104366['predictiveIntervalErlangCalls'],'predictiveIntervalErlangCallsDroppedCalls':_0x104366['predictiveIntervalErlangCallsDroppedCalls'],'predictiveIntervalHitRate':_0x104366[_0xbd92('0x68')],'predictiveIntervalMultiplicativeFactor':_0x104366[_0xbd92('0x69')],'predictiveIntervalPauses':_0x104366[_0xbd92('0x6a')],'predictiveIntervalAvailable':_0x104366[_0xbd92('0x6b')],'predictiveIntervalTotalCalls':_0x104366[_0xbd92('0x6c')],'message':_0x104366[_0xbd92('0x3f')],'originated':_0x104366[_0xbd92('0x6d')],'erlangCalls':_0x104366[_0xbd92('0x6e')],'erlangCallToSecond':_0x104366[_0xbd92('0x6f')],'erlangAbandonmentRate':_0x104366[_0xbd92('0x70')],'erlangBusyFactor':_0x104366[_0xbd92('0x71')],'startPredictive':_0x104366[_0xbd92('0x26')],'startProgressive':_0x104366['startProgressive']};if(_0x104366[_0xbd92('0x72')]){_0x57f5e1['Trunk']={'id':_0x104366[_0xbd92('0x72')]['id'],'name':_0x104366[_0xbd92('0x72')][_0xbd92('0x48')],'active':_0x104366[_0xbd92('0x72')][_0xbd92('0x73')],'callerid':_0x104366['Trunk'][_0xbd92('0x74')]};}if(_0x104366[_0xbd92('0x44')]){_0x57f5e1['Interval']={'id':_0x104366[_0xbd92('0x44')]['id'],'name':_0x104366[_0xbd92('0x44')][_0xbd92('0x48')]};}var _0x4991cd=md5(JSON[_0xbd92('0x4b')](_0x57f5e1));if(_0x104366['md5']!==_0x4991cd){_0x104366[_0xbd92('0x4')]=_0x4991cd;emit(util['format'](_0xbd92('0x75'),_0x57f5e1[_0xbd92('0x48')]),_0xbd92('0x76'),_0x57f5e1);}}}function emitCampaignSummary(_0x3bff98){if(_0x3bff98[_0xbd92('0x57')]===_0xbd92('0x77')){emit(util[_0xbd92('0x78')](_0xbd92('0x79'),_0x3bff98['name']),'campaign:save',_0x3bff98);}}function checkGetDataPredictive(_0x10472e){if(isNotNull(_0x10472e)){if(!_[_0xbd92('0x49')](_0x10472e)){loggerPredictive[_0xbd92('0x7a')](_0xbd92('0x7b'));loggerPredictive[_0xbd92('0x7a')](_0xbd92('0x7c'),_0x10472e['predictiveIntervalTotalCalls']);loggerPredictive['info']('Answered\x20Calls:\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20',_0x10472e['predictiveIntervalAnsweredCalls']);loggerPredictive[_0xbd92('0x7a')](_0xbd92('0x7d'),_0x10472e['predictiveIntervalDroppedCallsTimeout']);loggerPredictive[_0xbd92('0x7a')](_0xbd92('0x7e'),_0x10472e[_0xbd92('0x7f')]);loggerPredictive['info']('AVG\x20Hold\x20Time:\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20',_0x10472e['predictiveIntervalAvgHoldtime']);loggerPredictive['info'](_0xbd92('0x80'),_0x10472e[_0xbd92('0x81')]);loggerPredictive[_0xbd92('0x7a')](_0xbd92('0x82'));if(_0x10472e[_0xbd92('0x6c')]>0x0){if(!_['isUndefined'](_0x10472e[_0xbd92('0x81')])&&_0x10472e['predictiveIntervalAvgTalktime']>0x0){return!![];}else{loggerPredictive['info'](_0xbd92('0x83'));}if(!_[_0xbd92('0x3e')](_0x10472e['predictiveIntervalAvgHoldtime'])&&_0x10472e[_0xbd92('0x84')]>0x0){return!![];}else{loggerPredictive[_0xbd92('0x7a')](_0xbd92('0x85'));}}else{loggerPredictive[_0xbd92('0x7a')](_0xbd92('0x86'));}}else{loggerPredictive[_0xbd92('0x7a')](_0xbd92('0x87'));}}else{loggerPredictive['info']('History\x20information\x20are\x20empty');}return![];}function mergeDataErlangB(_0x1763e6){return function(_0x5d2b80){loggerPredictive['info']('---------\x20ErlangB\x20---------');loggerPredictive[_0xbd92('0x7a')](_0xbd92('0x88'),_0x5d2b80[_0xbd92('0x6e')]);loggerPredictive[_0xbd92('0x7a')](_0xbd92('0x89'),_0x5d2b80[_0xbd92('0x6f')]);loggerPredictive[_0xbd92('0x7a')](_0xbd92('0x8a'),_0x5d2b80[_0xbd92('0x70')]);loggerPredictive[_0xbd92('0x7a')](_0xbd92('0x8b'),_0x5d2b80[_0xbd92('0x71')]);loggerPredictive[_0xbd92('0x7a')](_0xbd92('0x8a'),_0x5d2b80['erlangAbandonmentRate']);loggerPredictive['info']('---------------------------');_[_0xbd92('0x8c')](_0x1763e6,_0x5d2b80);};}function getDiff(_0x42002a){var _0x3eb04c=moment()[_0xbd92('0x4c')](0x0);var _0x1c7f30=moment(_0x42002a)['milliseconds'](0x0);return _0x3eb04c[_0xbd92('0x8d')](_0x1c7f30,_0xbd92('0x4d'));}function ifInterval(_0x16afff,_0xe89fd0){if(_['isUndefined'](_0xe89fd0)){return![];}if(getDiff(_0xe89fd0)<_0x16afff*0x3c){return!![];}else{return![];}}function freeVariablesPredictive(_0x224fc7){if(isNotNull(_0x224fc7)){if(!_[_0xbd92('0x3e')](_0x224fc7[_0xbd92('0x27')])){_0x224fc7[_0xbd92('0x27')]=undefined;loggerPredictive['info'](_0x224fc7[_0xbd92('0x48')],_0xbd92('0x8e'));}if(!_[_0xbd92('0x3e')](_0x224fc7[_0xbd92('0x26')])){_0x224fc7['startPredictive']=undefined;loggerPredictive[_0xbd92('0x7a')](_0x224fc7[_0xbd92('0x48')],_0xbd92('0x8f'));}if(!_[_0xbd92('0x3e')](_0x224fc7[_0xbd92('0x90')])){clearInterval(_0x224fc7[_0xbd92('0x90')]);_0x224fc7[_0xbd92('0x90')]=undefined;loggerPredictive[_0xbd92('0x7a')](_0x224fc7[_0xbd92('0x48')],'clearing\x20variable\x20handle\x20predictive');}}}function erlangb(_0x1917cb,_0x57e4b4){if(_0x57e4b4===0x0){return 0x0;}var _0x753ec6=0x1;for(var _0x574148=0x1;_0x574148<=_0x57e4b4;_0x574148+=0x1){_0x753ec6=0x1+_0x753ec6*_0x574148/_0x1917cb;}return 0x1/_0x753ec6;}function isVoiceQueueOutbound(_0x126291){return _0x126291===_0xbd92('0x4f');}function isNotPreview(_0x446090){return _0x446090!==_0xbd92('0x1c');}function isCampaignIvr(_0x3c10f4){return _0x3c10f4===_0xbd92('0x77');}function getCallerId(_0x42e5ff,_0xd65867,_0x2a3b1d){if(!_[_0xbd92('0x3e')](_0x2a3b1d)&&_0xbd92('0x91')===typeof _0x2a3b1d&&!_['isEmpty'](_0x2a3b1d)){if(!_[_0xbd92('0x3e')](_0xd65867)&&_0xbd92('0x91')===typeof _0xd65867&&!_[_0xbd92('0x49')](_0xd65867)){return util['format'](_0xbd92('0x92'),_0xd65867,_0x2a3b1d);}return util[_0xbd92('0x78')](_0xbd92('0x92'),_0x2a3b1d,_0x2a3b1d);}if(!_['isUndefined'](_0x42e5ff)&&_0xbd92('0x91')===typeof _0x42e5ff&&!_[_0xbd92('0x49')](_0x42e5ff)){return _0x42e5ff;}return _0xbd92('0x93');}function loggerCatchQueueSummary(_0x1b4b1c,_0x2494d8){return function(_0x37dec2){freeVariablesPredictive(_0x2494d8);emitVoiceQueueSummary(_0x2494d8);emitCampaignSummary(_0x2494d8);loggerSyncQueueSummary[_0xbd92('0x94')](_0x1b4b1c,util[_0xbd92('0x95')](_0x37dec2,{'showHidden':![],'depth':null}));};}function loggerCatchPredictive(_0x598c02,_0x971542){return function(_0x204f82){loggerPredictive[_0xbd92('0x94')](_0x971542[_0xbd92('0x48')],_0x598c02);loggerPredictive[_0xbd92('0x94')](_0x204f82[_0xbd92('0x96')]);freeVariablesPredictive(_0x971542);};}function loggerCatch(_0x18945a){return function(_0x399fb2){logger[_0xbd92('0x94')](_0x18945a,util[_0xbd92('0x95')](_0x399fb2,{'showHidden':![],'depth':null}));};}function checkContactEmpty(_0x5c7214){return _0x5c7214&&!_['isUndefined'](_0x5c7214)&&_0x5c7214[_0xbd92('0x97')]>0x0;}function decremetOriginate(_0x3ebf93){if(!_[_0xbd92('0x3e')](_0x3ebf93)&&_0x3ebf93!==null){if(_0x3ebf93[_0xbd92('0x98')](_0xbd92('0x6d'))){if(_0x3ebf93[_0xbd92('0x6d')]>0x0){_0x3ebf93[_0xbd92('0x6d')]-=0x1;}else{logger[_0xbd92('0x94')]('[decremetOriginate]\x20object\x20originated\x20is\x20negative');}}}else{logger[_0xbd92('0x94')](_0xbd92('0x99'));}}function checkContactLowerLimitOriginate(_0x2a4404,_0x3dcae1,_0x2ecbb7){if(_0x3dcae1>_0x2ecbb7){for(var _0x4d64e0=0x0;_0x4d64e0<_0x3dcae1-_0x2ecbb7;_0x4d64e0+=0x1){decremetOriginate(_0x2a4404);}}}function loggerGetContactDialer(_0x13ca79,_0x2d3819,_0x2c5f8b){return function(_0x510eef){checkContactLowerLimitOriginate(_0x2d3819,_0x2c5f8b,0x0);logger[_0xbd92('0x94')](_0x13ca79,util[_0xbd92('0x95')](_0x510eef,{'showHidden':![],'depth':null}));};}function sendMessageReschedule(_0x2593ea){return function(_0x13e34a){if(isNotNull(_0x13e34a)&&isNotNull(_0x13e34a[0x0])){if(_0x13e34a[0x0]['contactsRescheduled']>0x0){_0x2593ea[_0xbd92('0x3f')]=_0xbd92('0x9a');logger[_0xbd92('0x7a')](_0xbd92('0x9b')+_0x2593ea[_0xbd92('0x48')],_0x13e34a[0x0][_0xbd92('0x9c')],_0xbd92('0x9d'));}else{_0x2593ea[_0xbd92('0x3f')]=_0xbd92('0x9e');logger['info'](_0xbd92('0x9f')+_0x2593ea[_0xbd92('0x48')]);}}};}function notSendMessagesQueue(_0x322c8c){if(_0x322c8c[_0xbd92('0xa0')]){freeVariablesPredictive(_0x322c8c);if(_0x322c8c['originated']===0x0&&_0x322c8c[_0xbd92('0x55')]===0x0&&_0x322c8c[_0xbd92('0x58')]===0x0&&(_0x322c8c['pTalking']||0x0)===0x0){_0x322c8c[_0xbd92('0xa0')]=![];_0x322c8c[_0xbd92('0x51')]=0x0;_0x322c8c['message']=_0xbd92('0x42');loggerSyncQueueSummary[_0xbd92('0x94')]('[syncQueueSummary]\x20Campaign\x20Queue:\x20',_0x322c8c[_0xbd92('0x48')],'is\x20not\x20active');}else{_0x322c8c[_0xbd92('0x3f')]='IS_DISACTIVED';loggerSyncQueueSummary[_0xbd92('0x94')](_0xbd92('0xa1'),_0x322c8c[_0xbd92('0x48')],_0xbd92('0xa2'));}emitVoiceQueueSummary(_0x322c8c);}}function notSendMessagesCampaign(_0x5a7a74){if(_0x5a7a74[_0xbd92('0xa0')]){if(_0x5a7a74[_0xbd92('0x6d')]===0x0){_0x5a7a74['sendMessageOneNotActive']=![];_0x5a7a74['message']=_0xbd92('0x42');loggerSyncQueueSummary[_0xbd92('0x94')](_0xbd92('0xa3'),_0x5a7a74[_0xbd92('0x48')],_0xbd92('0xa4'));}else{_0x5a7a74[_0xbd92('0x3f')]=_0xbd92('0xa5');loggerSyncQueueSummary[_0xbd92('0x94')]('[syncQueueSummary]\x20Campaign\x20Ivr:\x20',_0x5a7a74[_0xbd92('0x48')],'is\x20disactive');}emitCampaignSummary(_0x5a7a74);}}function createObjHistory(_0x37cec2,_0x528f15,_0x317fee,_0x184d29,_0x2926c6){_0x37cec2[_0xbd92('0x3f')]=_0x317fee;var _0x540bbd=new Action(_0x37cec2,_0x528f15);var _0x491269=new History(_0x540bbd);_0x491269['state']=_0x184d29;_0x491269[_0xbd92('0xa6')]=_0x2926c6;_0x491269[_0xbd92('0xa7')]=_0x540bbd[_0xbd92('0xa8')];return _0x491269;}Dialer[_0xbd92('0x1a')]['loopClearZombieChannels']=function(){var _0x535e77=this;setInterval(function(){_0x535e77[_0xbd92('0xa9')](_0x535e77['uniqueId'],_0xbd92('0xaa'));_0x535e77[_0xbd92('0xa9')](_0x535e77['actions'],_0xbd92('0xab'));},0x32c8);};Dialer[_0xbd92('0x1a')]['clearZombieChannels']=function(_0x4d83a9,_0x1b5073){var _0x71b56b=this;for(var _0x47b716 in _0x4d83a9){if(_0x4d83a9[_0xbd92('0x98')](_0x47b716)){this[_0xbd92('0xac')][_0xbd92('0xad')](function(){if(!_[_0xbd92('0xae')](_0x4d83a9[_0x47b716])){return ami['Action']({'action':_0xbd92('0xaf'),'channel':_0x4d83a9[_0x47b716]['channel']})['catch'](function(_0x2fc919){if(_0x2fc919[_0xbd92('0x3f')]==='No\x20such\x20channel'){setTimeout(function(){if(_0x4d83a9[_0x47b716]&&_0x4d83a9[_0x47b716][_0xbd92('0x57')]!==_0xbd92('0x77')){_0x71b56b['updateOriginated'](_0x71b56b['voiceQueues'][_0x4d83a9[_0x47b716]['queue']]);logger[_0xbd92('0x94')](_0xbd92('0xb0'),_0x1b5073,_0x47b716,_0x4d83a9[_0x47b716][_0xbd92('0xb1')]);delete _0x4d83a9[_0x47b716];}if(_0x4d83a9[_0x47b716]&&_0x4d83a9[_0x47b716]['type']===_0xbd92('0x77')){_0x71b56b['updateOriginated'](_0x71b56b[_0xbd92('0x1e')][_0x4d83a9[_0x47b716][_0xbd92('0xb1')]]);logger[_0xbd92('0x94')](_0xbd92('0xb2'),_0x1b5073,_0x47b716,_0x4d83a9[_0x47b716]['queue']);delete _0x4d83a9[_0x47b716];}},0x2328);}});}});}}};Dialer['prototype'][_0xbd92('0xb3')]=function(_0x4ffc86){return BPromise['resolve']()['then'](cmHopper[_0xbd92('0xb3')](_0x4ffc86))[_0xbd92('0xb4')](loggerCatch(_0xbd92('0xb5')));};Dialer[_0xbd92('0x1a')]['checkIsBlackList']=function(_0x74adf4){return BPromise[_0xbd92('0xb6')]()[_0xbd92('0xb7')](cmHopperBlack[_0xbd92('0xb8')](_0x74adf4))[_0xbd92('0xb4')](loggerCatch(_0xbd92('0xb9')));};Dialer[_0xbd92('0x1a')]['checkIsBlackListIvr']=function(_0x3aed3f){return BPromise['resolve']()[_0xbd92('0xb7')](cmHopperBlack[_0xbd92('0xba')](_0x3aed3f))[_0xbd92('0xb4')](loggerCatch(_0xbd92('0xbb')));};Dialer[_0xbd92('0x1a')][_0xbd92('0xbc')]=function(_0x3fd2be){return BPromise[_0xbd92('0xb6')]()[_0xbd92('0xb7')](cmHopperHistory['avgHandleTime'](_0x3fd2be))['catch'](loggerCatch('[averageHandleTime]\x20'));};Dialer[_0xbd92('0x1a')][_0xbd92('0xbd')]=function(_0x6cfaa0){return BPromise[_0xbd92('0xb6')]()[_0xbd92('0xb7')](cmHopper['rescheduleContact'](_0x6cfaa0))[_0xbd92('0xb4')](loggerCatch(_0xbd92('0xbe')));};Dialer['prototype'][_0xbd92('0xbf')]=function(_0x384ca1,_0x444603,_0x3428ad){return BPromise[_0xbd92('0xb6')]()['then'](cmHopper[_0xbd92('0xbf')](_0x384ca1,_0x444603,_0x3428ad))[_0xbd92('0xb4')](loggerCatch(_0xbd92('0xc0')));};Dialer[_0xbd92('0x1a')][_0xbd92('0xc1')]=function(_0x14e141,_0x196ec6,_0x541929,_0x51e372){return BPromise[_0xbd92('0xb6')]()[_0xbd92('0xb7')](cmHopper[_0xbd92('0xc1')](_0x14e141,_0x196ec6,_0x541929,_0x51e372))['catch'](loggerCatch(_0xbd92('0xc2')));};Dialer[_0xbd92('0x1a')][_0xbd92('0xc3')]=function(_0x2ad713,_0x48d277,_0x5352a0){return BPromise[_0xbd92('0xb6')]()[_0xbd92('0xb7')](cmHopper[_0xbd92('0xc3')](_0x2ad713,_0x48d277,_0x5352a0))['catch'](loggerCatch(_0xbd92('0xc2')));};Dialer[_0xbd92('0x1a')][_0xbd92('0xc4')]=function(_0x54441e){return BPromise[_0xbd92('0xb6')]()[_0xbd92('0xb7')](voiceQueueRt[_0xbd92('0xc4')](_0x54441e))['catch'](loggerCatch(_0xbd92('0xc5')));};Dialer['prototype']['moveContactManagedDialer']=function(_0x1891e6){return BPromise[_0xbd92('0xb6')]()[_0xbd92('0xb7')](cmHopper['moveContactManagedDialer'](_0x1891e6))['catch'](loggerCatch(_0xbd92('0xc6')));};Dialer[_0xbd92('0x1a')]['createHistory']=function(_0x173994){return BPromise[_0xbd92('0xb6')]()[_0xbd92('0xb7')](cmHopperHistory['createHistory'](_0x173994))[_0xbd92('0xb4')](loggerCatch('[createHistory]\x20'));};Dialer[_0xbd92('0x1a')][_0xbd92('0xc7')]=function(_0x3c8a9f){if(!_[_0xbd92('0x3e')](_0x3c8a9f)&&_0x3c8a9f!==null){if(_0x3c8a9f[_0xbd92('0x98')](_0xbd92('0x6d'))){if(_0x3c8a9f[_0xbd92('0x6d')]>0x0){_0x3c8a9f[_0xbd92('0x6d')]-=0x1;}else{logger['error']('[updateOriginated]\x20object\x20originated\x20is\x20negative');}}}else{logger[_0xbd92('0x94')](_0xbd92('0xc8'));}};Dialer[_0xbd92('0x1a')][_0xbd92('0xc9')]=function(_0x21a1de,_0x287e92){var _0x572cdb=this;return function(_0x54edd9){_0x572cdb['updateOriginated'](_0x287e92);logger['error'](_0x21a1de,util[_0xbd92('0x95')](_0x54edd9,{'showHidden':![],'depth':null}));};};Dialer[_0xbd92('0x1a')][_0xbd92('0xca')]=function(_0x1b40e9,_0x468352,_0x19c805){var _0x401b67={'state':0x19,'statedesc':_0xbd92('0xcb')};this[_0xbd92('0xc7')](_0x468352);this[_0xbd92('0xcc')](_['merge'](_0x401b67,_['pick'](_0x19c805,[_0xbd92('0xcd'),_0xbd92('0xce'),_0xbd92('0xcf'),_0xbd92('0xd0'),_0xbd92('0xd1')])),_0xbd92('0xd2'),'[emptyContact]');logger[_0xbd92('0x94')](_0x1b40e9);};Dialer['prototype'][_0xbd92('0xd3')]=function(_0x4c4cec){return _0x4c4cec==='Success';};Dialer['prototype']['isTrunkReachable']=function(_0x5f243d){return!_['isUndefined'](_0x5f243d)&&_0x5f243d&&!_['isUndefined'](_0x5f243d[_0xbd92('0x48')])&&!_['isUndefined'](_0x5f243d[_0xbd92('0x73')])&&_0x5f243d[_0xbd92('0x73')]&&(this[_0xbd92('0x20')][util['format'](_0xbd92('0xd4'),_0x5f243d[_0xbd92('0x48')])]['status']===_0xbd92('0xd5')||this[_0xbd92('0x20')][util[_0xbd92('0x78')](_0xbd92('0xd4'),_0x5f243d[_0xbd92('0x48')])][_0xbd92('0xaf')]===_0xbd92('0xd6'));};Dialer[_0xbd92('0x1a')][_0xbd92('0xcc')]=function(_0x55059c,_0x557e36,_0xe51bcb){this[_0xbd92('0xd7')](_0x55059c)[_0xbd92('0xb4')](loggerCatch(_0x557e36));this['moveContactManagedDialer'](_0x55059c)[_0xbd92('0xb4')](loggerCatch(_0xe51bcb));};Dialer[_0xbd92('0x1a')]['syncVarSet']=function(_0x530a9e){var _0x57165e=this['uniqueId'][_0x530a9e['uniqueid']];var _0xdb2d4e;if(!_['isNil'](_0x530a9e)&&!_[_0xbd92('0xae')](_0x530a9e[_0xbd92('0xd8')])&&!_[_0xbd92('0xae')](_0x530a9e[_0xbd92('0xd8')][_0xbd92('0xd9')])&&_0x530a9e[_0xbd92('0xda')]===_0xbd92('0xdb')&&_0x57165e){if(_0x57165e[_0xbd92('0x57')]!==_0xbd92('0x77')&&this[_0xbd92('0x1d')][_0x57165e[_0xbd92('0xb1')]][_0xbd92('0xdc')]&&_0x530a9e['value']===_0xbd92('0xdd')){delete this[_0xbd92('0x24')][_0x530a9e[_0xbd92('0xde')]];this['updateOriginated'](this['voiceQueues'][_0x57165e['queue']]);this[_0xbd92('0x1d')][_0x57165e['queue']]['outboundAnswerCallsDay']+=0x1;this['voiceQueues'][_0x57165e['queue']][_0xbd92('0x5e')]+=0x1;_0xdb2d4e=new Hangup(_0x57165e,_0x530a9e);_0xdb2d4e[_0xbd92('0xdf')]=0x12;_0xdb2d4e[_0xbd92('0xa6')]=_0xbd92('0xe0');_0xdb2d4e[_0xbd92('0xe1')]=_0xbd92('0xe2');this['saveInDb'](_0xdb2d4e,_0xbd92('0xe3'),'[syncHangupInAMD]');}if(_0x57165e[_0xbd92('0x57')]!==_0xbd92('0x77')&&this[_0xbd92('0x1d')][_0x57165e['queue']][_0xbd92('0xdc')]&&_0x530a9e[_0xbd92('0xe4')]===_0xbd92('0xe5')){delete this[_0xbd92('0x24')][_0x530a9e[_0xbd92('0xde')]];this[_0xbd92('0xc7')](this[_0xbd92('0x1d')][_0x57165e[_0xbd92('0xb1')]]);this['voiceQueues'][_0x57165e[_0xbd92('0xb1')]][_0xbd92('0x5f')]+=0x1;this[_0xbd92('0x1d')][_0x57165e[_0xbd92('0xb1')]][_0xbd92('0x5e')]+=0x1;_0xdb2d4e=new Hangup(_0x57165e,_0x530a9e);_0xdb2d4e['state']=0x13;_0xdb2d4e['statedesc']='Machine';_0xdb2d4e[_0xbd92('0xe1')]='AMD';_0xdb2d4e['amd']=!![];this[_0xbd92('0xcc')](_0xdb2d4e,'[syncMachine][createHistory]',_0xbd92('0xe6'));}if(_0x57165e[_0xbd92('0x57')]===_0xbd92('0x77')&&this[_0xbd92('0x1e')][_0x57165e[_0xbd92('0xb1')]][_0xbd92('0xdc')]&&_0x530a9e['value']===_0xbd92('0xdd')){delete this[_0xbd92('0x24')][_0x530a9e['uniqueid']];this[_0xbd92('0xc7')](this[_0xbd92('0x1e')][_0x57165e[_0xbd92('0xb1')]]);_0xdb2d4e=new Hangup(_0x57165e,_0x530a9e);_0xdb2d4e[_0xbd92('0xdf')]=0x12;_0xdb2d4e[_0xbd92('0xa6')]=_0xbd92('0xe0');_0xdb2d4e['membername']=_0xbd92('0xe2');this[_0xbd92('0xcc')](_0xdb2d4e,_0xbd92('0xe7'),_0xbd92('0xe8'));}if(_0x57165e[_0xbd92('0x57')]===_0xbd92('0x77')&&this[_0xbd92('0x1e')][_0x57165e['queue']][_0xbd92('0xdc')]&&_0x530a9e[_0xbd92('0xe4')]===_0xbd92('0xe5')){delete this['uniqueId'][_0x530a9e[_0xbd92('0xde')]];this[_0xbd92('0xc7')](this[_0xbd92('0x1e')][_0x57165e[_0xbd92('0xb1')]]);_0xdb2d4e=new Hangup(_0x57165e,_0x530a9e);_0xdb2d4e[_0xbd92('0xdf')]=0x13;_0xdb2d4e['statedesc']='Machine';_0xdb2d4e[_0xbd92('0xe1')]=_0xbd92('0xe2');_0xdb2d4e['amd']=!![];this[_0xbd92('0xcc')](_0xdb2d4e,_0xbd92('0xe9'),'[syncMachineIvr]');}}};Dialer[_0xbd92('0x1a')][_0xbd92('0x33')]=function(_0x4c9d45){var _0x7a3ed7=this[_0xbd92('0x24')][_0x4c9d45[_0xbd92('0xde')]];var _0x74b886=this;var _0x15d9bb;if(_0x7a3ed7&&_0x7a3ed7[_0xbd92('0x57')]===_0xbd92('0x77')){delete this[_0xbd92('0x24')][_0x4c9d45[_0xbd92('0xde')]];this[_0xbd92('0xc7')](this[_0xbd92('0x1e')][_0x7a3ed7[_0xbd92('0xb1')]]);this[_0xbd92('0x1e')][_0x7a3ed7[_0xbd92('0xb1')]]['ivrAnswerCallsDay']+=0x1;_0x15d9bb=new Hangup(_0x7a3ed7,_0x4c9d45);this['createHistory'](_0x15d9bb)[_0xbd92('0xb4')](loggerCatch(_0xbd92('0xea')));this[_0xbd92('0xeb')](_0x15d9bb)['catch'](loggerCatch('[syncHangupIvr]'));}if(_0x7a3ed7&&_0x7a3ed7[_0xbd92('0x57')]!=='ivr'&&isNotNull(this[_0xbd92('0x1d')][_0x7a3ed7['queue']][_0xbd92('0xec')])){delete this[_0xbd92('0x24')][_0x4c9d45[_0xbd92('0xde')]];this[_0xbd92('0xc7')](this[_0xbd92('0x1d')][_0x7a3ed7[_0xbd92('0xb1')]]);this['voiceQueues'][_0x7a3ed7[_0xbd92('0xb1')]][_0xbd92('0x5f')]+=0x1;this[_0xbd92('0x1d')][_0x7a3ed7[_0xbd92('0xb1')]][_0xbd92('0x5e')]+=0x1;_0x15d9bb=new Hangup(_0x7a3ed7,_0x4c9d45);_0x15d9bb[_0xbd92('0xdf')]=0x10;_0x15d9bb[_0xbd92('0xa6')]=_0xbd92('0xed');_0x15d9bb[_0xbd92('0xe1')]='AGI';this[_0xbd92('0xd7')](_0x15d9bb)[_0xbd92('0xb4')](loggerCatch(_0xbd92('0xea')));this[_0xbd92('0xeb')](_0x15d9bb)[_0xbd92('0xb4')](loggerCatch(_0xbd92('0xee')));}if(_0x7a3ed7&&_0x7a3ed7[_0xbd92('0x57')]!==_0xbd92('0x77')&&!isNotNull(this[_0xbd92('0x1d')][_0x7a3ed7[_0xbd92('0xb1')]][_0xbd92('0xec')])){delete this[_0xbd92('0x24')][_0x4c9d45[_0xbd92('0xde')]];this[_0xbd92('0xc7')](this[_0xbd92('0x1d')][_0x7a3ed7[_0xbd92('0xb1')]]);this[_0xbd92('0x1d')][_0x7a3ed7['queue']][_0xbd92('0x67')]+=0x1;_0x15d9bb=new Hangup(_0x7a3ed7,_0x4c9d45);_0x15d9bb['state']=0xc;_0x15d9bb[_0xbd92('0xa6')]=_0x4c9d45['cause-txt'];_0x15d9bb['membername']=_0xbd92('0xef');this[_0xbd92('0xd7')](_0x15d9bb)['catch'](loggerCatch(_0xbd92('0xea')));this[_0xbd92('0xeb')](_0x15d9bb)[_0xbd92('0xb4')](loggerCatch(_0xbd92('0xee')));}};Dialer[_0xbd92('0x1a')][_0xbd92('0x30')]=function(_0x291dfc){var _0x4fdb53=this['uniqueId'][_0x291dfc['uniqueid']];var _0x459dd0=this;if(this[_0xbd92('0x1d')][_0x291dfc['queue']]){if(_0x4fdb53&&_0x4fdb53[_0xbd92('0x57')]!=='ivr'){delete this['uniqueId'][_0x291dfc['uniqueid']];this['voiceQueues'][_0x291dfc[_0xbd92('0xb1')]]['outboundAnswerCallsDay']+=0x1;var _0x57cb0a=new AgentComplete(_0x4fdb53,_0x291dfc);if(_0x291dfc['reason']===_0xbd92('0xf0')){_0x57cb0a[_0xbd92('0xf1')]=this[_0xbd92('0x1d')][_0x291dfc[_0xbd92('0xb1')]][_0xbd92('0xf2')]&&this['voiceQueues'][_0x291dfc[_0xbd92('0xb1')]][_0xbd92('0xf3')]?moment()[_0xbd92('0x78')](_0xbd92('0xf4')):undefined;}this[_0xbd92('0xd7')](_0x57cb0a)[_0xbd92('0xb4')](loggerCatch('[syncAgentComplete][createHistory]'));this[_0xbd92('0xeb')](_0x57cb0a)[_0xbd92('0xb4')](loggerCatch(_0xbd92('0xf5')));}}};Dialer['prototype']['syncAgentConnect']=function(_0x23a625){if(this[_0xbd92('0x1d')][_0x23a625[_0xbd92('0xb1')]]){if(this[_0xbd92('0x24')][_0x23a625[_0xbd92('0xde')]]&&this[_0xbd92('0x24')][_0x23a625[_0xbd92('0xde')]][_0xbd92('0x57')]!==_0xbd92('0x77')){this[_0xbd92('0xc7')](this[_0xbd92('0x1d')][_0x23a625['queue']]);this[_0xbd92('0x24')][_0x23a625[_0xbd92('0xde')]]['answertime']=moment()[_0xbd92('0x78')]('YYYY-MM-DD\x20HH:mm:ss');}}};Dialer[_0xbd92('0x1a')][_0xbd92('0xf6')]=function(_0x1dd7ff){this['createHistory'](_0x1dd7ff)[_0xbd92('0xb4')](loggerCatch(_0xbd92('0xf7')));this[_0xbd92('0xeb')](_0x1dd7ff)[_0xbd92('0xb4')](loggerCatch(_0xbd92('0xf8')));};Dialer[_0xbd92('0x1a')][_0xbd92('0x2d')]=function(_0x1c2227){var _0x413f1a=this[_0xbd92('0x24')][_0x1c2227[_0xbd92('0xde')]];var _0x2462fb=this;if(this['voiceQueues'][_0x1c2227[_0xbd92('0xb1')]]){if(_0x413f1a&&_0x413f1a[_0xbd92('0x57')]!==_0xbd92('0x77')){delete this[_0xbd92('0x24')][_0x1c2227[_0xbd92('0xde')]];this[_0xbd92('0xc7')](this[_0xbd92('0x1d')][_0x1c2227['queue']]);_0x413f1a['droptime']=moment()[_0xbd92('0x78')](_0xbd92('0xf4'));var _0x30b7b9=new QueueCallerAbandon(_0x413f1a,_0x1c2227);if(getSeconds(_0x413f1a['droptime'],_0x413f1a[_0xbd92('0xf9')])>=_0x413f1a['dialQueueTimeout']){this['voiceQueues'][_0x1c2227[_0xbd92('0xb1')]][_0xbd92('0xfa')]+=0x1;this[_0xbd92('0x1d')][_0x1c2227['queue']][_0xbd92('0x64')]+=0x1;this[_0xbd92('0x1d')][_0x1c2227[_0xbd92('0xb1')]][_0xbd92('0xfb')]+=0x1;_0x30b7b9['state']=0xa;_0x30b7b9[_0xbd92('0xa6')]=_0xbd92('0xfc');_0x30b7b9['dropreason']=_0xbd92('0xfd');_0x30b7b9[_0xbd92('0xf1')]=this[_0xbd92('0x1d')][_0x1c2227['queue']][_0xbd92('0xf2')]?moment()[_0xbd92('0x78')](_0xbd92('0xf4')):undefined;if(_0x30b7b9[_0xbd92('0xfe')]>=this[_0xbd92('0x1d')][_0x1c2227[_0xbd92('0xb1')]][_0xbd92('0xff')]){this[_0xbd92('0xf6')](_0x30b7b9);}else{this['rescheduleContact']({'active':![],'countdropretry':_0x30b7b9['countdropretry']+=0x1,'scheduledat':moment()[_0xbd92('0x100')](this[_0xbd92('0x1d')][_0x1c2227[_0xbd92('0xb1')]][_0xbd92('0x101')],_0xbd92('0x102'))[_0xbd92('0x78')](_0xbd92('0xf4')),'ContactId':_0x413f1a[_0xbd92('0xcd')],'ListId':_0x413f1a[_0xbd92('0xce')],'VoiceQueueId':_0x413f1a[_0xbd92('0xd0')]||undefined,'CampaignId':_0x413f1a[_0xbd92('0xd1')]||undefined})['catch'](loggerCatch(_0xbd92('0x103')));}}else{this[_0xbd92('0x1d')][_0x1c2227['queue']][_0xbd92('0x7f')]+=0x1;this['voiceQueues'][_0x1c2227[_0xbd92('0xb1')]]['outboundDropCallsDayCallersExit']+=0x1;_0x30b7b9['state']=0xb;_0x30b7b9[_0xbd92('0xa6')]=_0xbd92('0x104');_0x30b7b9[_0xbd92('0x105')]=_0xbd92('0x106');if(_0x30b7b9[_0xbd92('0x107')]>=this[_0xbd92('0x1d')][_0x1c2227['queue']][_0xbd92('0x108')]){this['queueCallerAbandonCreateState'](_0x30b7b9);}else{this['rescheduleContact']({'active':![],'countabandonedretry':_0x30b7b9[_0xbd92('0x107')]+=0x1,'scheduledat':moment()[_0xbd92('0x100')](this[_0xbd92('0x1d')][_0x1c2227[_0xbd92('0xb1')]]['dialAbandonedRetryFrequency'],'minutes')[_0xbd92('0x78')](_0xbd92('0xf4')),'ContactId':_0x413f1a[_0xbd92('0xcd')],'ListId':_0x413f1a['ListId'],'VoiceQueueId':_0x413f1a['VoiceQueueId']||undefined,'CampaignId':_0x413f1a[_0xbd92('0xd1')]||undefined})[_0xbd92('0xb4')](loggerCatch(_0xbd92('0x109')));}}}}};Dialer[_0xbd92('0x1a')][_0xbd92('0x35')]=function(_0x3a22ca){if(this[_0xbd92('0x22')][_0x3a22ca[_0xbd92('0xde')]]){this[_0xbd92('0x22')][_0x3a22ca[_0xbd92('0xde')]][_0xbd92('0x10a')]=_0x3a22ca[_0xbd92('0x10a')];}if(this[_0xbd92('0x24')][_0x3a22ca[_0xbd92('0xde')]]){this['uniqueId'][_0x3a22ca[_0xbd92('0xde')]][_0xbd92('0x10a')]=_0x3a22ca[_0xbd92('0x10a')];}};Dialer['prototype'][_0xbd92('0x39')]=function(_0x343026){if(strategy[this[_0xbd92('0x1d')][this[_0xbd92('0x22')][_0x343026[_0xbd92('0x10b')]][_0xbd92('0xb1')]][_0xbd92('0x10c')]]===_0xbd92('0x19')){if(this[_0xbd92('0x22')][_0x343026[_0xbd92('0x10b')]]&&_['isNil'](this[_0xbd92('0x22')][_0x343026[_0xbd92('0x10b')]][_0xbd92('0x10d')])&&_0x343026[_0xbd92('0xaf')]==='1'&&_0x343026[_0xbd92('0x10e')]==='0'){if(this['agents'][_0x343026[_0xbd92('0x10f')]]){if(!this[_0xbd92('0x1f')][_0x343026[_0xbd92('0x10f')]][_0xbd92('0x10d')]){this['agents'][_0x343026['stateinterface']][_0xbd92('0x10d')]=!![];this[_0xbd92('0x22')][_0x343026[_0xbd92('0x10b')]][_0xbd92('0x10d')]=!![];this[_0xbd92('0x22')][_0x343026[_0xbd92('0x10b')]][_0xbd92('0x10f')]=_0x343026[_0xbd92('0x10f')];}}}}else if((strategy[this[_0xbd92('0x1d')][this['actions'][_0x343026[_0xbd92('0x10b')]][_0xbd92('0xb1')]][_0xbd92('0x10c')]]||_0xbd92('0x18'))===_0xbd92('0x18')){if(this[_0xbd92('0x22')][_0x343026[_0xbd92('0x10b')]]){if(this[_0xbd92('0x1f')][_0x343026[_0xbd92('0x10f')]]){this[_0xbd92('0x22')][_0x343026[_0xbd92('0x10b')]][_0xbd92('0x10f')]=_0x343026[_0xbd92('0x10f')];if(_[_0xbd92('0xae')](this[_0xbd92('0x29')][this[_0xbd92('0x22')][_0x343026[_0xbd92('0x10b')]][_0xbd92('0xb1')]])){this[_0xbd92('0x29')][this[_0xbd92('0x22')][_0x343026['actionid']][_0xbd92('0xb1')]]=[];}this['queueBooked'][this[_0xbd92('0x22')][_0x343026[_0xbd92('0x10b')]][_0xbd92('0xb1')]][_0xbd92('0x110')](_['merge'](_['pick'](this[_0xbd92('0x22')][_0x343026[_0xbd92('0x10b')]],['idHopper',_0xbd92('0x10f')]),{'status':_0x343026[_0xbd92('0xaf')],'paused':_0x343026['paused']}));}}}};function unlockQueueStatus(_0x980a96,_0x38a5cb){setTimeout(function(){if(_[_0xbd92('0x3e')](_0x980a96[_0xbd92('0x111')])){loggerBooked[_0xbd92('0x94')](_0xbd92('0x112'),_0x38a5cb);}_0x980a96[_0xbd92('0x111')]=!![];loggerBooked[_0xbd92('0x7a')](_0xbd92('0x113'),_0x38a5cb,JSON[_0xbd92('0x4b')](_[_0xbd92('0x114')](_0x980a96,['name',_0xbd92('0x111')])));},0x1f3);}Dialer[_0xbd92('0x1a')]['syncQueueStatusComplete']=function(_0x51aa8f){var _0xb677f8=this;var _0x57c5a1=_0xb677f8['voiceQueues'][_0xb677f8[_0xbd92('0x22')][_0x51aa8f[_0xbd92('0x10b')]][_0xbd92('0xb1')]];if(strategy[this[_0xbd92('0x1d')][this[_0xbd92('0x22')][_0x51aa8f[_0xbd92('0x10b')]]['queue']][_0xbd92('0x10c')]]==='roundrobin'){if(this['actions'][_0x51aa8f[_0xbd92('0x10b')]]&&this[_0xbd92('0x22')][_0x51aa8f[_0xbd92('0x10b')]]['stateinterface']){this['preview'][_0xbd92('0x115')](this[_0xbd92('0x22')][_0x51aa8f[_0xbd92('0x10b')]][_0xbd92('0x116')],this['actions'][_0x51aa8f['actionid']]['stateinterface'])[_0xbd92('0xb4')](function(_0x589db4){logger[_0xbd92('0x94')]('[Catch][Preview][syncQueueStatusComplete]',util[_0xbd92('0x95')](_0x589db4,{'showHidden':![],'depth':null}));})[_0xbd92('0x117')](function(){_0xb677f8[_0xbd92('0xc7')](_0xb677f8[_0xbd92('0x1d')][_0xb677f8['actions'][_0x51aa8f[_0xbd92('0x10b')]]['queue']]);_0xb677f8[_0xbd92('0x1f')][_0xb677f8[_0xbd92('0x22')][_0x51aa8f[_0xbd92('0x10b')]][_0xbd92('0x10f')]][_0xbd92('0x10d')]=![];delete _0xb677f8[_0xbd92('0x22')][_0x51aa8f['actionid']];unlockQueueStatus(_0x57c5a1);});}else{this[_0xbd92('0xc7')](this[_0xbd92('0x1d')][this['actions'][_0x51aa8f[_0xbd92('0x10b')]][_0xbd92('0xb1')]]);this[_0xbd92('0xbd')]({'active':![],'ContactId':this['actions'][_0x51aa8f[_0xbd92('0x10b')]]['ContactId'],'ListId':this[_0xbd92('0x22')][_0x51aa8f[_0xbd92('0x10b')]][_0xbd92('0xce')],'VoiceQueueId':this['actions'][_0x51aa8f[_0xbd92('0x10b')]][_0xbd92('0xd0')]||undefined,'CampaignId':this[_0xbd92('0x22')][_0x51aa8f[_0xbd92('0x10b')]]['CampaignId']||undefined})['catch'](loggerCatch(_0xbd92('0x118')));delete this[_0xbd92('0x22')][_0x51aa8f[_0xbd92('0x10b')]];unlockQueueStatus(_0x57c5a1);}}else if((strategy[this[_0xbd92('0x1d')][this[_0xbd92('0x22')][_0x51aa8f['actionid']][_0xbd92('0xb1')]][_0xbd92('0x10c')]]||_0xbd92('0x18'))===_0xbd92('0x18')){var _0x30c9cb;if(this['actions'][_0x51aa8f[_0xbd92('0x10b')]]&&!_[_0xbd92('0x49')](this[_0xbd92('0x29')][this[_0xbd92('0x22')][_0x51aa8f['actionid']][_0xbd92('0xb1')]])){if(this[_0xbd92('0x2a')][_0xb677f8[_0xbd92('0x22')][_0x51aa8f[_0xbd92('0x10b')]][_0xbd92('0xb1')]]){this['queueBookedRR'][_0xb677f8[_0xbd92('0x22')][_0x51aa8f[_0xbd92('0x10b')]]['queue']]=this[_0xbd92('0x2a')][this['actions'][_0x51aa8f[_0xbd92('0x10b')]][_0xbd92('0xb1')]]?this[_0xbd92('0x2a')][this[_0xbd92('0x22')][_0x51aa8f[_0xbd92('0x10b')]][_0xbd92('0xb1')]]:this[_0xbd92('0x29')][this[_0xbd92('0x22')][_0x51aa8f[_0xbd92('0x10b')]][_0xbd92('0xb1')]]?this[_0xbd92('0x29')][this['actions'][_0x51aa8f[_0xbd92('0x10b')]][_0xbd92('0xb1')]][_0xbd92('0x119')]||0x0:0x0;}this[_0xbd92('0x29')][this[_0xbd92('0x22')][_0x51aa8f[_0xbd92('0x10b')]]['queue']][_0xbd92('0x119')]=this[_0xbd92('0x2a')][this[_0xbd92('0x22')][_0x51aa8f[_0xbd92('0x10b')]][_0xbd92('0xb1')]];for(var _0x13538e=0x0;_0x13538e=0x0?!![]:![];})[_0xbd92('0xb4')](myreject(_0x323ed0)));}}else{_0x472517[_0xbd92('0x110')](ami['Action']({'action':_0xbd92('0x131'),'command':util['format'](_0xbd92('0x132'),_0xdad01c,!_[_0xbd92('0x3e')](config[_0xbd92('0x134')][_0x26c9e6])?_0x26c9e6:'')})[_0xbd92('0xb7')](function(_0x25c815){return _0x25c815[_0xbd92('0x135')]['indexOf']('true')>=0x0?!![]:![];})[_0xbd92('0xb4')](myreject(_0x323ed0)));}BPromise[_0xbd92('0x138')](_0x472517)[_0xbd92('0xb7')](function(_0x358123){var _0x43b119=_[_0xbd92('0x139')](_0x358123);if(_0x43b119){return _0x15da91(_0x43b119);}else{_0x3182a8[_0xbd92('0x3f')]=_0x4f5fac?'GLOBAL_INTERVAL_IS_OVERTIME':_0xbd92('0x13a');return _0x323ed0(msgResponse('[ifTime][promiseAll]',_0xbd92('0x12b'),_0xbd92('0x13b')+_0x4f5fac+'\x20'+_0x37271b+_0xbd92('0x13c')+util[_0xbd92('0x95')](_0xdad01c,{'showHidden':![],'depth':null})+_0xbd92('0x13d')+_0x26c9e6));}})[_0xbd92('0xb4')](function(_0x4c12ff){return _0x323ed0(msgResponse('ifTime',_0xbd92('0x12b'),JSON[_0xbd92('0x4b')](_0x4c12ff)));});});};Dialer[_0xbd92('0x1a')][_0xbd92('0x13e')]=function(_0x3edc9b){var _0x12563c=this;return function(){switch(_0x3edc9b[_0xbd92('0x5a')]){case _0xbd92('0x13f'):freeVariablesPredictive(_0x3edc9b);_0x12563c[_0xbd92('0x140')](_0x3edc9b,0x1);break;case'power':freeVariablesPredictive(_0x3edc9b);_0x12563c[_0xbd92('0x140')](_0x3edc9b,_0x3edc9b[_0xbd92('0x141')]);break;case _0xbd92('0x142'):_0x12563c[_0xbd92('0x142')](_0x3edc9b);break;case _0xbd92('0x8'):freeVariablesPredictive(_0x3edc9b);_0x12563c[_0xbd92('0x140')](_0x3edc9b,0x1);break;default:freeVariablesPredictive(_0x3edc9b);logger[_0xbd92('0x94')](_0xbd92('0x143'),_0x3edc9b['name'],_0xbd92('0x144'));}};};Dialer[_0xbd92('0x1a')][_0xbd92('0x145')]=function(_0x24b057){var _0x32b269=this;return function(){_0x32b269[_0xbd92('0x146')](_0x24b057);};};Dialer['prototype'][_0xbd92('0xa')]=function(_0x4bf009){var _0x37a399=this;if(isNotPreview(_0x4bf009['dialMethod'])){if(isVoiceQueueOutbound(_0x4bf009[_0xbd92('0x57')])&&isActive(_0x4bf009[_0xbd92('0x147')])){_0x4bf009[_0xbd92('0xa0')]=!![];BPromise[_0xbd92('0xb6')]()[_0xbd92('0xb7')](checkIsLoggedIn(_0x4bf009,_0x4bf009[_0xbd92('0x148')]))[_0xbd92('0xb7')](checkIsActive(_0x4bf009,_0x4bf009['dialActive']))[_0xbd92('0xb7')](checkInterval(_0x4bf009))[_0xbd92('0xb7')](_0x37a399[_0xbd92('0x149')](_0x4bf009))[_0xbd92('0xb7')](_0x37a399[_0xbd92('0x127')](_0x4bf009[_0xbd92('0x14a')],_0x4bf009[_0xbd92('0x14b')],_0x4bf009['name'],_0x4bf009))['then'](_0x37a399[_0xbd92('0x14c')](_0x4bf009[_0xbd92('0x44')],_0x4bf009[_0xbd92('0x14b')],_0x4bf009['name'],_0x4bf009))['then'](_0x37a399[_0xbd92('0x13e')](_0x4bf009))['catch'](loggerCatchQueueSummary('[syncQueueSummary]',_0x4bf009));}else{notSendMessagesQueue(_0x4bf009);}}else{freeVariablesPredictive(_0x4bf009);}};Dialer[_0xbd92('0x1a')][_0xbd92('0x123')]=function(){var _0x1554fb=this;var _0x33be62;for(var _0x483f67 in this[_0xbd92('0x1e')]){if(this[_0xbd92('0x1e')][_0xbd92('0x98')](_0x483f67)){_0x33be62=this[_0xbd92('0x1e')][_0x483f67];if(isCampaignIvr(_0x33be62[_0xbd92('0x57')])&&isActive(_0x33be62['active'])){_0x33be62[_0xbd92('0xa0')]=!![];BPromise[_0xbd92('0xb6')]()[_0xbd92('0xb7')](checkIsActive(_0x33be62,_0x33be62['active']))['then'](checkInterval(_0x33be62))['then'](_0x1554fb['checkIsTrunkReachable'](_0x33be62))[_0xbd92('0xb7')](_0x1554fb[_0xbd92('0x127')](_0x33be62['dialGlobalInterval'],_0x33be62[_0xbd92('0x14b')],_0x33be62['name'],_0x33be62))[_0xbd92('0xb7')](_0x1554fb[_0xbd92('0x14c')](_0x33be62[_0xbd92('0x44')],_0x33be62[_0xbd92('0x14b')],_0x33be62[_0xbd92('0x48')],_0x33be62))[_0xbd92('0xb7')](_0x1554fb[_0xbd92('0x145')](_0x33be62))[_0xbd92('0xb4')](loggerCatchQueueSummary('[syncCampaigns]',_0x33be62));}else{notSendMessagesCampaign(_0x33be62);}}}};function getCallerIdRandom(_0x4c053c,_0x55422c){var _0x71feb1,_0x1a0c82,_0x50751f;if(_0x55422c<=0x0){_0x55422c=0x1;}_0x71feb1=new RegExp('\x5cw{0,'+_0x55422c+'}$');_0x1a0c82=Math[_0xbd92('0x14d')](0xa,_0x55422c-0x1);_0x50751f=Math['pow'](0xa,_0x55422c)-0x1;return util[_0xbd92('0x78')]('%s',_['replace'](_0x4c053c,_0x71feb1,_[_0xbd92('0x14e')](_0x1a0c82,_0x50751f)));}function extractCalleridName(_0x2444bf){var _0x3175b1=_0x2444bf[_0xbd92('0x14f')](/"(.*?)"/);return _0x3175b1?_0x3175b1[0x1]:_0x2444bf;}function extractCalleridNumber(_0xa0a9b8){var _0x2131df=_0xa0a9b8[_0xbd92('0x14f')](/<(.*?)>/);return _0x2131df?_0x2131df[0x1]:_0xa0a9b8;}Dialer[_0xbd92('0x1a')][_0xbd92('0x150')]=function(_0x440a7c,_0x18549e){var _0x2ca1d5=this;var _0x5059bc=uuid['v4']();this[_0xbd92('0x22')][_0x5059bc]=new Action(_0x440a7c,_0x18549e,_0x5059bc);return new BPromise(function(_0x11edfb,_0x4c400b){if(_[_0xbd92('0x3e')](_0x440a7c)&&'object'!==typeof _0x440a7c){return _0x4c400b(msgResponse(_0xbd92('0x151'),_0xbd92('0x12b'),'voiceQueue\x20is\x20undefine'));}if(_['isUndefined'](_0x18549e[_0xbd92('0x152')][_0xbd92('0x153')])||_0x18549e[_0xbd92('0x152')]['phone']===null){return _0x4c400b(msgResponse(_0xbd92('0x151'),_0xbd92('0x12b'),_0xbd92('0x154')));}var _0x5bc5cf={'XMD-CALLERID':_0x2ca1d5[_0xbd92('0x22')][_0x5059bc][_0xbd92('0x155')](),'XMD-AGI':_0x440a7c[_0xbd92('0xec')]?util[_0xbd92('0x78')]('\x22agi://%s/square,%s\x22',ipAgi,_0x440a7c[_0xbd92('0xec')]):'NONE','XMD-AGIAFTER':_0x440a7c[_0xbd92('0xf2')]?util[_0xbd92('0x78')](_0xbd92('0x156'),ipAgi,_0x440a7c[_0xbd92('0xf2')]):_0xbd92('0x157'),'XMD-QUEUE':_0x440a7c[_0xbd92('0x57')]==='outbound'?util[_0xbd92('0x78')](_0xbd92('0x158'),_0x440a7c[_0xbd92('0x48')],_0x440a7c['dialQueueOptions']||'',_0x440a7c[_0xbd92('0xf3')]?'c':'',_0x440a7c[_0xbd92('0x159')]||0x3):_0xbd92('0x157'),'XMD-CONTACTID':_0x18549e['ContactId'],'XMD-CDRTYPE':'dialer','CALLERID(all)':_0x2ca1d5[_0xbd92('0x22')][_0x5059bc][_0xbd92('0x155')](),'XMD-AMD':_0x440a7c[_0xbd92('0xdc')]?_0xbd92('0x15a'):_0xbd92('0x157'),'XMD-DESTINATION':_0xbd92('0xdb')};if(_0x440a7c['dialAMDActive']){_0x5bc5cf[_0xbd92('0x15b')]=_0x440a7c[_0xbd92('0x15c')]||0x9c4;_0x5bc5cf[_0xbd92('0x15d')]=_0x440a7c[_0xbd92('0x15e')]||0x5dc;_0x5bc5cf[_0xbd92('0x15f')]=_0x440a7c[_0xbd92('0x160')]||0x320;_0x5bc5cf[_0xbd92('0x161')]=_0x440a7c[_0xbd92('0x162')]||0x1388;_0x5bc5cf[_0xbd92('0x163')]=_0x440a7c[_0xbd92('0x164')]||0x64;_0x5bc5cf[_0xbd92('0x165')]=_0x440a7c[_0xbd92('0x166')]||0x32;_0x5bc5cf[_0xbd92('0x167')]=_0x440a7c[_0xbd92('0x168')]||0x3;_0x5bc5cf[_0xbd92('0x169')]=_0x440a7c[_0xbd92('0x16a')]||0x100;_0x5bc5cf[_0xbd92('0x16b')]=_0x440a7c[_0xbd92('0x16c')]||0x1388;}if(_0x440a7c[_0xbd92('0x57')]===_0xbd92('0x4f')){_0x5bc5cf[_0xbd92('0x16d')]=_0x18549e[_0xbd92('0xd0')];}else{_0x5bc5cf[_0xbd92('0x16e')]=_0x18549e['CampaignId'];}for(var _0x2dfa8c in _0x18549e[_0xbd92('0x152')]){if(_0x18549e[_0xbd92('0x152')][_0xbd92('0x98')](_0x2dfa8c)){if(isNotNull(_0x18549e[_0xbd92('0x152')][_0x2dfa8c])&&_0x2dfa8c!=='id'&&_0x2dfa8c!==_0xbd92('0x16f')&&_0x2dfa8c!==_0xbd92('0x170')&&_0x2dfa8c!==_0xbd92('0x171')){_0x5bc5cf[util['format'](_0xbd92('0x172'),_0xbd92('0x173'),_[_0xbd92('0x174')](_0x2dfa8c))]=_0x18549e[_0xbd92('0x152')][_0x2dfa8c];}}}var _0xeda24c=_0x2ca1d5[_0xbd92('0x124')](_0x440a7c[_0xbd92('0x72')])?getCallerId(_0x440a7c[_0xbd92('0x72')][_0xbd92('0x74')],_0x440a7c['dialOriginateCallerIdName'],_0x440a7c[_0xbd92('0x175')]>0x0?getCallerIdRandom(_0x440a7c['dialOriginateCallerIdNumber'],_0x440a7c[_0xbd92('0x175')]):_0x440a7c[_0xbd92('0x5c')]):getCallerId(_['isNil'](_0x440a7c[_0xbd92('0x125')])?_0x440a7c[_0xbd92('0x72')]['callerid']:_0x440a7c[_0xbd92('0x125')][_0xbd92('0x74')],_0x440a7c[_0xbd92('0x5b')],_0x440a7c[_0xbd92('0x175')]>0x0?getCallerIdRandom(_0x440a7c[_0xbd92('0x5c')],_0x440a7c[_0xbd92('0x175')]):_0x440a7c[_0xbd92('0x5c')]);if(_0xeda24c){_0x5bc5cf[_0xbd92('0x176')]=_0x2ca1d5[_0xbd92('0x22')][_0x5059bc]['originatecalleridname']=extractCalleridName(_0xeda24c);_0x5bc5cf[_0xbd92('0x177')]=_0x2ca1d5[_0xbd92('0x22')][_0x5059bc][_0xbd92('0x178')]=extractCalleridNumber(_0xeda24c);}return ami[_0xbd92('0x130')]({'actionid':_0x5059bc,'action':_0xbd92('0x151'),'channel':_0x2ca1d5[_0xbd92('0x124')](_0x440a7c[_0xbd92('0x72')])?util[_0xbd92('0x78')](_0xbd92('0x179'),_0x440a7c['Trunk'][_0xbd92('0x48')],isNotNull(_0x440a7c[_0xbd92('0x5d')])?_0x440a7c[_0xbd92('0x5d')]['trim']()||'':'',_0x440a7c[_0xbd92('0x17a')]>0x0?_0x18549e[_0xbd92('0x152')][_0xbd92('0x153')][_0xbd92('0x17b')](_0x440a7c[_0xbd92('0x17a')]):_0x18549e[_0xbd92('0x152')]['phone']):util[_0xbd92('0x78')](_0xbd92('0x179'),_[_0xbd92('0xae')](_0x440a7c[_0xbd92('0x125')])?_0x440a7c[_0xbd92('0x72')][_0xbd92('0x48')]:_0x440a7c[_0xbd92('0x125')]['name'],isNotNull(_0x440a7c[_0xbd92('0x5d')])?_0x440a7c[_0xbd92('0x5d')][_0xbd92('0x17c')]()||'':'',_0x440a7c[_0xbd92('0x17a')]>0x0?_0x18549e['Contact']['phone']['substring'](_0x440a7c[_0xbd92('0x17a')]):_0x18549e[_0xbd92('0x152')][_0xbd92('0x153')]),'callerid':_0xeda24c,'Exten':_0xbd92('0xdb'),'Context':_0xbd92('0x17d'),'Priority':'1','variable':_0x5bc5cf,'timeout':(_0x440a7c[_0xbd92('0x17e')]||0x1e)*0x3e8,'async':!![],'channelid':_0x5059bc})['then'](function(_0x281a4e){return _0x11edfb(_0x281a4e);})[_0xbd92('0xb4')](function(_0x22f96a){_0x440a7c[_0xbd92('0x17f')]+=0x1;var _0x4e6d2a=new History(_0x2ca1d5[_0xbd92('0x22')][_0x5059bc]);logger['error'](util[_0xbd92('0x78')](_0xbd92('0x180'),JSON[_0xbd92('0x4b')](_0x22f96a)));_0x4e6d2a[_0xbd92('0xdf')]=0xe;_0x4e6d2a[_0xbd92('0xa6')]=_0xbd92('0x181');_0x4e6d2a[_0xbd92('0xa8')]=moment()[_0xbd92('0x78')](_0xbd92('0xf4'));_0x4e6d2a[_0xbd92('0xa7')]=_0x4e6d2a[_0xbd92('0xa8')];_0x2ca1d5[_0xbd92('0xd7')](_0x4e6d2a)[_0xbd92('0xb4')](loggerCatch(_0xbd92('0x182')));_0x2ca1d5[_0xbd92('0xeb')](_0x4e6d2a)[_0xbd92('0xb4')](loggerCatch(_0xbd92('0x182')))[_0xbd92('0x117')](function(){delete _0x2ca1d5[_0xbd92('0x22')][_0x5059bc];return _0x4c400b(msgResponse(_0xbd92('0x151'),_0xbd92('0x183'),_0xbd92('0x184')));});});});};Dialer[_0xbd92('0x1a')][_0xbd92('0x2e')]=function(_0x267ed5){var _0x52d366=this[_0xbd92('0x22')][_0x267ed5[_0xbd92('0x10b')]];var _0x2d6cf5=this;if(_0x52d366){delete this[_0xbd92('0x22')][_0x267ed5[_0xbd92('0x10b')]];_0x52d366['responsetime']=moment()[_0xbd92('0x78')](_0xbd92('0xf4'));var _0x4380bc=_0x52d366[_0xbd92('0x57')]===_0xbd92('0x77')?this[_0xbd92('0x1e')][_0x52d366[_0xbd92('0xb1')]]:this['voiceQueues'][_0x52d366[_0xbd92('0x185')]()];if(!this[_0xbd92('0xd3')](_0x267ed5[_0xbd92('0x186')])){this[_0xbd92('0xc7')](_0x4380bc);return this[_0xbd92('0x187')](_0x52d366,_0x4380bc,_0x267ed5)[_0xbd92('0xb7')](function(_0x511fb4){})[_0xbd92('0xb4')](loggerCatch(_0xbd92('0x188')));}else{this[_0xbd92('0x24')][_0x267ed5['uniqueid']]=_0x52d366;}}};Dialer[_0xbd92('0x1a')][_0xbd92('0x189')]=function(_0x8a4dcf,_0x3b0806,_0x4f0daf){var _0x35b7ba=new History(_0x3b0806);if(_0x35b7ba['countbusyretry']+_0x35b7ba[_0xbd92('0x18a')]+_0x35b7ba[_0xbd92('0x18b')]+_0x35b7ba[_0xbd92('0x18c')]+_0x35b7ba['countdropretry']+_0x35b7ba[_0xbd92('0x107')]+_0x35b7ba[_0xbd92('0x18d')]+_0x35b7ba['countagentrejectretry']>=_0x4f0daf[_0xbd92('0x18e')]-0x1){return!![];}switch(_0x8a4dcf){case 0x3:if(_0x35b7ba[_0xbd92('0x18b')]>=_0x4f0daf[_0xbd92('0x18f')]-0x1){return!![];}else{this[_0xbd92('0xbd')]({'active':![],'countnoanswerretry':_0x35b7ba['countnoanswerretry']+=0x1,'scheduledat':moment()[_0xbd92('0x100')](_0x4f0daf['dialNoAnswerRetryFrequency'],_0xbd92('0x102'))[_0xbd92('0x78')](_0xbd92('0xf4')),'ContactId':_0x35b7ba[_0xbd92('0xcd')],'ListId':_0x35b7ba[_0xbd92('0xce')],'VoiceQueueId':_0x35b7ba[_0xbd92('0xd0')]||undefined,'CampaignId':_0x35b7ba[_0xbd92('0xd1')]||undefined})[_0xbd92('0xb4')](loggerCatch(_0xbd92('0x190')));}break;case 0x5:if(_0x35b7ba[_0xbd92('0x191')]>=_0x4f0daf['dialBusyMaxRetry']-0x1){return!![];}else{this[_0xbd92('0xbd')]({'active':![],'countbusyretry':_0x35b7ba['countbusyretry']+=0x1,'scheduledat':moment()[_0xbd92('0x100')](_0x4f0daf['dialBusyRetryFrequency'],_0xbd92('0x102'))[_0xbd92('0x78')](_0xbd92('0xf4')),'ContactId':_0x35b7ba[_0xbd92('0xcd')],'ListId':_0x35b7ba['ListId'],'VoiceQueueId':_0x35b7ba[_0xbd92('0xd0')]||undefined,'CampaignId':_0x35b7ba[_0xbd92('0xd1')]||undefined})['catch'](loggerCatch('[rescheduleContact]\x20[Busy]'));}break;case 0x8:if(_0x35b7ba[_0xbd92('0x18a')]>=_0x4f0daf[_0xbd92('0x192')]-0x1){return!![];}else{this[_0xbd92('0xbd')]({'active':![],'countcongestionretry':_0x35b7ba[_0xbd92('0x18a')]+=0x1,'scheduledat':moment()['add'](_0x4f0daf[_0xbd92('0x193')],_0xbd92('0x102'))['format'](_0xbd92('0xf4')),'ContactId':_0x35b7ba[_0xbd92('0xcd')],'ListId':_0x35b7ba[_0xbd92('0xce')],'VoiceQueueId':_0x35b7ba[_0xbd92('0xd0')]||undefined,'CampaignId':_0x35b7ba[_0xbd92('0xd1')]||undefined})[_0xbd92('0xb4')](loggerCatch('[rescheduleContact]\x20[Congestion]'));}break;case 0x0:if(_0x35b7ba['countnosuchnumberretry']>=_0x4f0daf['dialNoSuchNumberMaxRetry']-0x1){return!![];}else{this[_0xbd92('0xbd')]({'active':![],'countnosuchnumberretry':_0x35b7ba[_0xbd92('0x18c')]+=0x1,'scheduledat':moment()[_0xbd92('0x100')](_0x4f0daf['dialNoSuchNumberRetryFrequency'],_0xbd92('0x102'))[_0xbd92('0x78')]('YYYY-MM-DD\x20HH:mm:ss'),'ContactId':_0x35b7ba[_0xbd92('0xcd')],'ListId':_0x35b7ba['ListId'],'VoiceQueueId':_0x35b7ba['VoiceQueueId']||undefined,'CampaignId':_0x35b7ba[_0xbd92('0xd1')]||undefined})[_0xbd92('0xb4')](loggerCatch(_0xbd92('0x194')));}break;case 0xa:if(_0x35b7ba['countdropretry']>=_0x4f0daf[_0xbd92('0xff')]-0x1){return!![];}else{this[_0xbd92('0xbd')]({'active':![],'countdropretry':_0x35b7ba[_0xbd92('0xfe')]+=0x1,'scheduledat':moment()[_0xbd92('0x100')](_0x4f0daf[_0xbd92('0x101')],'minutes')['format'](_0xbd92('0xf4')),'ContactId':_0x35b7ba[_0xbd92('0xcd')],'ListId':_0x35b7ba[_0xbd92('0xce')],'VoiceQueueId':_0x35b7ba['VoiceQueueId']||undefined,'CampaignId':_0x35b7ba[_0xbd92('0xd1')]||undefined})[_0xbd92('0xb4')](loggerCatch('[rescheduleContact][Drop]'));}break;case 0xb:if(_0x35b7ba[_0xbd92('0x107')]>=_0x4f0daf[_0xbd92('0x108')]-0x1){return!![];}else{this[_0xbd92('0xbd')]({'active':![],'countabandonedretry':_0x35b7ba[_0xbd92('0x107')]+=0x1,'scheduledat':moment()[_0xbd92('0x100')](_0x4f0daf[_0xbd92('0x195')],'minutes')[_0xbd92('0x78')](_0xbd92('0xf4')),'ContactId':_0x35b7ba[_0xbd92('0xcd')],'ListId':_0x35b7ba['ListId'],'VoiceQueueId':_0x35b7ba[_0xbd92('0xd0')]||undefined,'CampaignId':_0x35b7ba[_0xbd92('0xd1')]||undefined})[_0xbd92('0xb4')](loggerCatch(_0xbd92('0x109')));}break;case 0x13:if(_0x35b7ba['countmachineretry']>=_0x4f0daf[_0xbd92('0x196')]-0x1){return!![];}else{this['rescheduleContact']({'active':![],'countmachineretry':_0x35b7ba[_0xbd92('0x18d')]+=0x1,'scheduledat':moment()[_0xbd92('0x100')](_0x4f0daf[_0xbd92('0x197')],_0xbd92('0x102'))[_0xbd92('0x78')]('YYYY-MM-DD\x20HH:mm:ss'),'ContactId':_0x35b7ba[_0xbd92('0xcd')],'ListId':_0x35b7ba[_0xbd92('0xce')],'VoiceQueueId':_0x35b7ba[_0xbd92('0xd0')]||undefined,'CampaignId':_0x35b7ba[_0xbd92('0xd1')]||undefined})[_0xbd92('0xb4')](loggerCatch(_0xbd92('0x198')));}break;case 0x14:if(_0x35b7ba[_0xbd92('0x199')]>=_0x4f0daf[_0xbd92('0x19a')]-0x1){return!![];}else{this[_0xbd92('0xbd')]({'active':![],'countagentrejectretry':_0x35b7ba[_0xbd92('0x199')]+=0x1,'scheduledat':moment()[_0xbd92('0x100')](_0x4f0daf[_0xbd92('0x19b')],_0xbd92('0x102'))[_0xbd92('0x78')](_0xbd92('0xf4')),'ContactId':_0x35b7ba[_0xbd92('0xcd')],'ListId':_0x35b7ba[_0xbd92('0xce')],'VoiceQueueId':_0x35b7ba[_0xbd92('0xd0')]||undefined,'CampaignId':_0x35b7ba[_0xbd92('0xd1')]||undefined})[_0xbd92('0xb4')](loggerCatch(_0xbd92('0x19c')));}break;default:return!![];}};Dialer['prototype'][_0xbd92('0x187')]=function(_0xa1060b,_0x19ac2d,_0x2bd6ad){var _0x41d515=this;var _0x4c4b91=new History(_0xa1060b);return new BPromise(function(_0xfbb965,_0x1b872a){if(_['isUndefined'](_0x19ac2d)&&_0xbd92('0x19d')!==typeof _0x19ac2d){return _0x1b872a(msgResponse(_0xbd92('0x19e'),'Failure','entity\x20is\x20undefine'));}if(_['isUndefined'](_0x2bd6ad)&&_0xbd92('0x19d')!==typeof _0x2bd6ad){return _0x1b872a(msgResponse(_0xbd92('0x19e'),_0xbd92('0x12b'),_0xbd92('0x19f')));}switch(_0x2bd6ad[_0xbd92('0x1a0')]){case'0':_0x19ac2d['outboundNoSuchCallsDay']+=0x1;_0x4c4b91[_0xbd92('0xdf')]=0x0;_0x4c4b91['statedesc']=_0xbd92('0x1a1');_0x41d515[_0xbd92('0xd7')](_0x4c4b91)[_0xbd92('0xb4')](loggerCatch(_0xbd92('0x1a2')));if(_0x41d515[_0xbd92('0x189')](0x0,_0xa1060b,_0x19ac2d)){if(_0x4c4b91[_0xbd92('0x191')]+_0x4c4b91[_0xbd92('0x18a')]+_0x4c4b91[_0xbd92('0x18b')]+_0x4c4b91[_0xbd92('0x18c')]+_0x4c4b91[_0xbd92('0xfe')]+_0x4c4b91[_0xbd92('0x107')]+_0x4c4b91[_0xbd92('0x18d')]+_0x4c4b91['countagentrejectretry']>=_0x19ac2d[_0xbd92('0x18e')]){_0x41d515['stateGlobal'](_0x4c4b91,_0xfbb965,_0x1b872a,_0xbd92('0x1a3'));}else{_0x41d515[_0xbd92('0x1a4')](_0x4c4b91,_0xfbb965,_0x1b872a,_0xbd92('0x1a3'));}}break;case'3':_0x19ac2d[_0xbd92('0x1a5')]+=0x1;_0x4c4b91[_0xbd92('0xdf')]=0x3;_0x4c4b91[_0xbd92('0xa6')]=_0xbd92('0x1a6');_0x4c4b91['countnoanswerretry']+=0x1;_0x4c4b91[_0xbd92('0x1a7')]+=0x1;_0x41d515[_0xbd92('0xd7')](_0x4c4b91)['catch'](loggerCatch('[syncAgentComplete][createHistory][3]'));if(_0x41d515['checkRetriveMax'](0x3,_0xa1060b,_0x19ac2d)){if(_0x4c4b91['countnoanswerretry']>=_0x19ac2d[_0xbd92('0x18f')]){_0x41d515['createStateFinal'](_0x4c4b91,_0xfbb965,_0x1b872a,_0xbd92('0x1a8'));}else{_0x41d515[_0xbd92('0x1a9')](_0x4c4b91,_0xfbb965,_0x1b872a,_0xbd92('0x1a8'));}}break;case'5':_0x19ac2d[_0xbd92('0x60')]+=0x1;_0x4c4b91['state']=0x5;_0x4c4b91[_0xbd92('0xa6')]='Busy';_0x4c4b91[_0xbd92('0x191')]+=0x1;_0x4c4b91[_0xbd92('0x1a7')]+=0x1;_0x41d515[_0xbd92('0xd7')](_0x4c4b91)['catch'](loggerCatch(_0xbd92('0x1aa')));if(_0x41d515[_0xbd92('0x189')](0x5,_0xa1060b,_0x19ac2d)){if(_0x4c4b91['countbusyretry']>=_0x19ac2d[_0xbd92('0x1ab')]){_0x41d515['createStateFinal'](_0x4c4b91,_0xfbb965,_0x1b872a,_0xbd92('0x1ac'));}else{_0x41d515['stateGlobal'](_0x4c4b91,_0xfbb965,_0x1b872a,_0xbd92('0x1ac'));}}break;case'8':_0x19ac2d['outboundCongestionCallsDay']+=0x1;_0x4c4b91[_0xbd92('0xdf')]=0x8;_0x4c4b91[_0xbd92('0xa6')]=_0xbd92('0x1ad');_0x4c4b91['countcongestionretry']+=0x1;_0x4c4b91['countglobal']+=0x1;_0x41d515['createHistory'](_0x4c4b91)[_0xbd92('0xb4')](loggerCatch(_0xbd92('0x1ae')));if(_0x41d515['checkRetriveMax'](0x8,_0xa1060b,_0x19ac2d)){if(_0x4c4b91[_0xbd92('0x18a')]>=_0x19ac2d[_0xbd92('0x192')]){_0x41d515[_0xbd92('0x1a4')](_0x4c4b91,_0xfbb965,_0x1b872a,_0xbd92('0x1af'));}else{_0x41d515[_0xbd92('0x1a9')](_0x4c4b91,_0xfbb965,_0x1b872a,_0xbd92('0x1af'));}}break;case'11':_0x19ac2d[_0xbd92('0x1b0')]+=0x1;_0x4c4b91['state']=0xb;_0x4c4b91[_0xbd92('0xa6')]=_0xbd92('0x104');_0x4c4b91[_0xbd92('0x107')]+=0x1;_0x4c4b91[_0xbd92('0x1a7')]+=0x1;_0x41d515[_0xbd92('0xd7')](_0x4c4b91)[_0xbd92('0xb4')](loggerCatch(_0xbd92('0x1b1')));if(_0x41d515[_0xbd92('0x189')](0xb,_0xa1060b,_0x19ac2d)){if(_0x4c4b91[_0xbd92('0x107')]>=_0x19ac2d[_0xbd92('0x108')]){_0x41d515[_0xbd92('0x1a4')](_0x4c4b91,_0xfbb965,_0x1b872a,_0xbd92('0x1b2'));}else{_0x41d515['stateGlobal'](_0x4c4b91,_0xfbb965,_0x1b872a,_0xbd92('0x1b2'));}}break;case'20':_0x19ac2d[_0xbd92('0x66')]+=0x1;_0x4c4b91['state']=0x14;_0x4c4b91[_0xbd92('0xa6')]=_0xbd92('0x1b3');_0x4c4b91[_0xbd92('0x199')]+=0x1;_0x4c4b91[_0xbd92('0x1a7')]+=0x1;_0x41d515[_0xbd92('0xd7')](_0x4c4b91)['catch'](loggerCatch(_0xbd92('0x1b4')));if(_0x41d515['checkRetriveMax'](0x14,_0xa1060b,_0x19ac2d)){if(_0x4c4b91[_0xbd92('0x199')]>=_0x19ac2d[_0xbd92('0x19a')]){_0x41d515[_0xbd92('0x1a4')](_0x4c4b91,_0xfbb965,_0x1b872a,_0xbd92('0x1b5'));}else{_0x41d515[_0xbd92('0x1a9')](_0x4c4b91,_0xfbb965,_0x1b872a,'reason\x2020\x20agentreject');}}break;default:_0x19ac2d[_0xbd92('0x67')]+=0x1;_0x4c4b91['state']=0xc;_0x4c4b91['statedesc']=_0x2bd6ad['reason'];_0x41d515[_0xbd92('0xd7')](_0x4c4b91)['catch'](loggerCatch(_0xbd92('0x1b6')));if(_0x41d515[_0xbd92('0x189')](_0x2bd6ad['reason'],_0xa1060b,_0x19ac2d)){if(_0x4c4b91['countbusyretry']+_0x4c4b91[_0xbd92('0x18a')]+_0x4c4b91['countnoanswerretry']+_0x4c4b91['countnosuchnumberretry']+_0x4c4b91[_0xbd92('0xfe')]+_0x4c4b91[_0xbd92('0x107')]+_0x4c4b91[_0xbd92('0x18d')]+_0x4c4b91['countagentrejectretry']>=_0x19ac2d[_0xbd92('0x18e')]){_0x41d515[_0xbd92('0x1a9')](_0x4c4b91,_0xfbb965,_0x1b872a,_0x2bd6ad['reason']);}else{_0x41d515[_0xbd92('0x1a4')](_0x4c4b91,_0xfbb965,_0x1b872a,_0x2bd6ad[_0xbd92('0x1a0')]);}}}});};Dialer['prototype'][_0xbd92('0x1a9')]=function(_0x581e79,_0x5eda9e,_0x3adc7c,_0x97b3ba){var _0x35e760=new Final(_0x581e79);_0x35e760[_0xbd92('0xdf')]=0xf;_0x35e760['statedesc']='Global';this[_0xbd92('0x1a4')](_0x35e760,_0x5eda9e,_0x3adc7c,_0x97b3ba);};Dialer[_0xbd92('0x1a')]['createStateFinal']=function(_0x1b337d,_0x51d601,_0x72d2a1,_0x2f2cb3){this[_0xbd92('0xeb')](_0x1b337d)[_0xbd92('0xb7')](function(_0x1f7666){return _0x51d601(msgResponse(_0xbd92('0x19e'),_0xbd92('0x1b7'),_0x2f2cb3));})[_0xbd92('0xb4')](function(_0x236b8d){return _0x72d2a1(msgResponse('[moveContactManagedDialer][0]',_0xbd92('0x12b'),_0xbd92('0x1b8')));});};Dialer[_0xbd92('0x1a')][_0xbd92('0x142')]=function(_0x5d2e93){var _0x1d9f37=this;var _0x4a2b72=_0x5d2e93[_0xbd92('0x1b9')]/0x64;var _0x2800a7=_0x5d2e93[_0xbd92('0x64')]/(_0x5d2e93['outboundDropCallsDayTimeout']+_0x5d2e93[_0xbd92('0x5f')]);var _0x287a97=Math[_0xbd92('0x1ba')](_0x5d2e93['predictiveIntervalAvailable']*(_0x5d2e93[_0xbd92('0x1bb')]/0x64));var _0x596781=Math[_0xbd92('0x1ba')](_0x5d2e93[_0xbd92('0x6b')]*(_0x5d2e93[_0xbd92('0x1bc')]/0x64));var _0x3ed6bf=_0x5d2e93[_0xbd92('0x51')]+_0x5d2e93[_0xbd92('0x55')];var _0x59da0f=Math['floor'](_0x5d2e93[_0xbd92('0x6e')]*_0x5d2e93[_0xbd92('0x70')]*_0x5d2e93['predictiveIntervalHitRate']*_0x5d2e93[_0xbd92('0x69')]);if(_['isUndefined'](_0x5d2e93[_0xbd92('0x27')])){if(!_[_0xbd92('0x3e')](_0x5d2e93[_0xbd92('0x26')])){_0x5d2e93[_0xbd92('0x26')]=undefined;loggerPredictive[_0xbd92('0x94')](_0xbd92('0x1bd'),_0xbd92('0x1be'));}if(!_[_0xbd92('0x3e')](_0x5d2e93['handlePredictive'])){loggerPredictive['error']('[startMethodPredictive][StartProgressive]',_0xbd92('0x1bf'));clearInterval(_0x5d2e93[_0xbd92('0x90')]);_0x5d2e93[_0xbd92('0x90')]=undefined;}_0x5d2e93[_0xbd92('0x27')]=moment()[_0xbd92('0x78')](_0xbd92('0xf4'));loggerPredictive['info'](_0x5d2e93[_0xbd92('0x48')],_0xbd92('0x1c0'),_0x5d2e93[_0xbd92('0x27')]);this[_0xbd92('0x140')](_0x5d2e93,0x1);}else if(ifInterval(_0x5d2e93[_0xbd92('0x1c1')],_0x5d2e93[_0xbd92('0x27')])){this[_0xbd92('0x140')](_0x5d2e93,0x1);loggerPredictiveCalls[_0xbd92('0x7a')](_0xbd92('0x1c2'),_0x5d2e93[_0xbd92('0x27')],_0x5d2e93[_0xbd92('0x48')]);_0x5d2e93['erlangCalls']=0x0;_0x5d2e93['predictiveIntervalErlangCallsDroppedCalls']=0x0;}else if(_0x4a2b72<_0x2800a7&&_0x5d2e93[_0xbd92('0x1c3')]===_0xbd92('0x1c4')){freeVariablesPredictive(_0x5d2e93);loggerPredictive[_0xbd92('0x7a')](_0xbd92('0x1c5'),'Dropped\x20calls\x20day',_0x2800a7,'startProgressive',_0x5d2e93[_0xbd92('0x48')]);}else if(_0x59da0f<_0x5d2e93['predictiveIntervalErlangCallsDroppedCalls']&&_0x5d2e93[_0xbd92('0x1c3')]===_0xbd92('0x1c4')){freeVariablesPredictive(_0x5d2e93);loggerPredictive[_0xbd92('0x7a')](_0xbd92('0x1c6'),_0xbd92('0x1c7'),_0x59da0f,_0xbd92('0x1c8'),_0x5d2e93[_0xbd92('0xfb')],_0xbd92('0x27'),_0x5d2e93[_0xbd92('0x48')]);}else if(!ifInterval(_0x5d2e93[_0xbd92('0x1c1')],_0x5d2e93[_0xbd92('0x27')])&&_['isUndefined'](_0x5d2e93[_0xbd92('0x26')])&&!_[_0xbd92('0x3e')](_0x5d2e93[_0xbd92('0x27')])){_0x5d2e93[_0xbd92('0x26')]=moment()['format'](_0xbd92('0xf4'));loggerPredictive[_0xbd92('0x7a')](_0x5d2e93[_0xbd92('0x48')],'started\x20in\x20predictive\x20at',_0x5d2e93[_0xbd92('0x26')]);this[_0xbd92('0xbc')](_0x5d2e93[_0xbd92('0x1c1')])[_0xbd92('0xb7')](this[_0xbd92('0x1c9')](_0x5d2e93))[_0xbd92('0xb7')](mergeDataErlangB(_0x5d2e93))[_0xbd92('0xb7')](this[_0xbd92('0x1ca')](_0x5d2e93))[_0xbd92('0xb4')](loggerCatchPredictive(_0xbd92('0x1cb'),_0x5d2e93));}else if(!ifInterval(_0x5d2e93[_0xbd92('0x1c1')],_0x5d2e93['startPredictive'])){_0x5d2e93[_0xbd92('0xfb')]=0x0;_0x5d2e93[_0xbd92('0x26')]=moment()[_0xbd92('0x78')]('YYYY-MM-DD\x20HH:mm:ss');loggerPredictive[_0xbd92('0x7a')](_0x5d2e93[_0xbd92('0x48')],_0xbd92('0x1cc'),_0x5d2e93[_0xbd92('0x26')]);clearInterval(_0x5d2e93[_0xbd92('0x90')]);_0x5d2e93['handlePredictive']=undefined;this[_0xbd92('0xbc')](_0x5d2e93[_0xbd92('0x1c1')])[_0xbd92('0xb7')](this[_0xbd92('0x1c9')](_0x5d2e93))['then'](mergeDataErlangB(_0x5d2e93))[_0xbd92('0xb7')](this[_0xbd92('0x1ca')](_0x5d2e93))['catch'](loggerCatchPredictive(_0xbd92('0x1cd'),_0x5d2e93));}else if(_0x5d2e93[_0xbd92('0x6b')]&&_0x3ed6bf<_0x5d2e93[_0xbd92('0x6b')]-_0x596781){freeVariablesPredictive(_0x5d2e93);loggerPredictive['info'](_0x5d2e93['name'],_0xbd92('0x1ce'),_0x3ed6bf,_0xbd92('0x1cf'),_0x5d2e93[_0xbd92('0x6b')],'-',_0x596781,'=',_0x5d2e93[_0xbd92('0x6b')]-_0x596781,')');}else if(_0x5d2e93[_0xbd92('0x6b')]&&_0x3ed6bf>_0x5d2e93[_0xbd92('0x6b')]+_0x287a97){freeVariablesPredictive(_0x5d2e93);loggerPredictive['info'](_0x5d2e93['name'],_0xbd92('0x1ce'),_0x3ed6bf,')\x20are\x20more\x20than\x20threshold\x20(',_0x5d2e93[_0xbd92('0x6b')],'+',_0x287a97,'=',_0x5d2e93[_0xbd92('0x6b')]+_0x287a97,')');}};Dialer['prototype'][_0xbd92('0x1c9')]=function(_0x2c161e){var _0x2b5801=this;return function(_0x363623){return new BPromise(function(_0x136606,_0x5c44d8){_[_0xbd92('0x8c')](_0x2c161e,_0x363623[0x0]);if(checkGetDataPredictive(_0x363623[0x0])){var _0x382dab=_0x2c161e[_0xbd92('0x6b')]=_0x2c161e['talking']+_0x2c161e[_0xbd92('0x51')];var _0x2a882a=_0x2c161e[_0xbd92('0x1c1')]*0x3c;var _0x413ca9=_0x363623[0x0][_0xbd92('0x81')]+_0x363623[0x0][_0xbd92('0x84')];var _0x5a64e3=(_0x363623[0x0]['predictiveIntervalAnsweredCalls']+_0x363623[0x0][_0xbd92('0xfa')]+_0x363623[0x0]['predictiveIntervalDroppedCallsCallersExit'])/_0x363623[0x0][_0xbd92('0x6c')];_0x2c161e[_0xbd92('0x68')]=_0x5a64e3>0x0?_0x5a64e3:0x1;switch(_0x2c161e[_0xbd92('0x1c3')]){case'dropRate':var _0x5368d3=_0x2c161e[_0xbd92('0x1b9')]/0x64;return _0x2b5801['abandonmentRate'](_0x382dab,_0x2a882a,_0x413ca9,_0x5a64e3,_0x5368d3)[_0xbd92('0xb7')](function(_0x4efa8d){return _0x136606(_0x4efa8d);});case _0xbd92('0x1d0'):var _0x3ba003=_0x2c161e['dialPredictiveOptimizationPercentage']/0x64;return _0x2b5801['busyFactor'](_0x382dab,_0x2a882a,_0x413ca9,_0x5a64e3,_0x3ba003)[_0xbd92('0xb7')](function(_0x32b08c){return _0x136606(_0x32b08c);});default:return _0x5c44d8(msgResponse('[getDataPredictive]','Failure',_0xbd92('0x1d1')));}}else{return _0x5c44d8(msgResponse('[getDataPredictive]',_0xbd92('0x12b'),'check\x20failure'));}});};};Dialer[_0xbd92('0x1a')][_0xbd92('0x1d2')]=function(_0x58c9b3){var _0x35bd89=this;return function(_0xad8b95){return new BPromise(function(_0x4be049,_0x400bb0){_[_0xbd92('0x8c')](_0x58c9b3,_0xad8b95[0x0]);if(checkGetDataPredictive(_0xad8b95[0x0])){loggerPredictive[_0xbd92('0x7a')](JSON[_0xbd92('0x4b')](_0xad8b95[0x0]));if(_0x58c9b3[_0xbd92('0x1c3')]===_0xbd92('0x1c4')){return _0x35bd89[_0xbd92('0xc4')](_0x58c9b3['id'])[_0xbd92('0xb7')](function(_0x580828){var _0x3c8f88=_0x58c9b3[_0xbd92('0x148')]-_0x580828[0x0][_0xbd92('0x1d3')];var _0x23bc03=_0x58c9b3[_0xbd92('0x1c1')]*0x3c;var _0x439d34=_0xad8b95[0x0]['predictiveIntervalAvgTalktime']+_0xad8b95[0x0][_0xbd92('0x84')];var _0x21d8ef=(_0xad8b95[0x0]['predictiveIntervalAnsweredCalls']+_0xad8b95[0x0]['predictiveIntervalDroppedCallsTimeout']+_0xad8b95[0x0][_0xbd92('0x7f')])/_0xad8b95[0x0][_0xbd92('0x6c')];var _0x4f8f32=_0x58c9b3['dialPredictiveOptimizationPercentage']/0x64;_0x58c9b3[_0xbd92('0x6a')]=_0x580828[0x0]['outboundQueuePauses']||0x0;_0x58c9b3[_0xbd92('0x68')]=_0x21d8ef>0x0?_0x21d8ef:0x1;return _0x35bd89['abandonmentRate'](_0x3c8f88,_0x23bc03,_0x439d34,_0x21d8ef,_0x4f8f32);})[_0xbd92('0xb7')](function(_0xe2b3eb){return _0x4be049(_0xe2b3eb);})[_0xbd92('0xb4')](function(_0x31f26d){return _0x400bb0(msgResponse(_0xbd92('0x1d4'),_0xbd92('0x12b'),JSON['stringify'](_0x31f26d)));});}if(_0x58c9b3[_0xbd92('0x1c3')]===_0xbd92('0x1d0')){return _0x35bd89[_0xbd92('0xc4')](_0x58c9b3['id'])['then'](function(_0x46f855){var _0x4f74ec=_0x58c9b3[_0xbd92('0x148')]-_0x46f855[0x0]['outboundQueuePauses'];var _0x5e430c=_0x58c9b3[_0xbd92('0x1c1')]*0x3c;var _0x3a7436=_0xad8b95[0x0]['predictiveIntervalAvgTalktime']+_0xad8b95[0x0]['predictiveIntervalAvgHoldtime'];var _0x1cd55c=(_0xad8b95[0x0][_0xbd92('0x1d5')]+_0xad8b95[0x0]['predictiveIntervalDroppedCallsTimeout']+_0xad8b95[0x0]['predictiveIntervalDroppedCallsCallersExit'])/_0xad8b95[0x0][_0xbd92('0x6c')];var _0x1ba644=_0x58c9b3[_0xbd92('0x1b9')]/0x64;_0x58c9b3[_0xbd92('0x6a')]=_0x46f855[0x0][_0xbd92('0x1d3')]||0x0;_0x58c9b3[_0xbd92('0x68')]=_0x1cd55c>0x0?_0x1cd55c:0x1;return _0x35bd89[_0xbd92('0x1d6')](_0x4f74ec,_0x5e430c,_0x3a7436,_0x1cd55c,_0x1ba644);})[_0xbd92('0xb7')](function(_0x15d93a){return _0x4be049(_0x15d93a);})[_0xbd92('0xb4')](function(_0xd08005){return _0x400bb0(msgResponse('[CatchErlangB]',_0xbd92('0x12b'),JSON['stringify'](_0xd08005)));});}}else{return _0x400bb0(msgResponse(_0xbd92('0x1d7'),_0xbd92('0x12b'),_0xbd92('0x1d8')));}});};};Dialer[_0xbd92('0x1a')][_0xbd92('0x1ca')]=function(_0x2a187c){var _0x11b550=this;return function(){var _0x1a960b=0x0;var _0xc3da93=Math[_0xbd92('0x1d9')](_0x2a187c['erlangCallToSecond']*0x3e8);if(_0xc3da93>0x0){_0xc3da93=_0xc3da93<0x64?0x64:_0xc3da93;loggerPredictive[_0xbd92('0x7a')](_0x2a187c[_0xbd92('0x48')],_0xbd92('0x1da'),_0xc3da93,_0xbd92('0x4c'));_0x2a187c[_0xbd92('0x90')]=setInterval(function(){_0x11b550['handlePredictive'](_0x2a187c);loggerPredictiveCalls[_0xbd92('0x7a')](_0xbd92('0x1db'),_0x1a960b+=0x1);},_0xc3da93);}else{loggerPredictive[_0xbd92('0x7a')](_0x2a187c[_0xbd92('0x48')],_0xbd92('0x1dc'));}};};Dialer[_0xbd92('0x1a')][_0xbd92('0x1dd')]=function(_0x3a3ee0,_0x28b383){var _0x5a4172=this;return function(_0x316bd2){if(_[_0xbd92('0x49')](_0x316bd2)){if(_[_0xbd92('0xae')](_0x28b383[_0xbd92('0xcf')])||!_0x28b383[_0xbd92('0x1de')]){if(_0x3a3ee0[_0xbd92('0x5a')]===_0xbd92('0x8')){_0x3a3ee0[_0xbd92('0x111')]=_[_0xbd92('0x3e')](_0x3a3ee0[_0xbd92('0x111')])?!![]:_0x3a3ee0[_0xbd92('0x111')];var _0x108b0c=uuid['v4']();_0x5a4172[_0xbd92('0x22')][_0x108b0c]=new Action(_0x3a3ee0,_0x28b383,_0x108b0c);loggerBooked[_0xbd92('0x7a')](_0xbd92('0x1df'),_0x108b0c,_0xbd92('0x1e0'),JSON[_0xbd92('0x4b')](_0x3a3ee0['queueStatusComplete']),'Queue:\x20',_0x3a3ee0[_0xbd92('0x48')]);if(_0x3a3ee0[_0xbd92('0x111')]){_0x3a3ee0[_0xbd92('0x111')]=![];_0x5a4172[_0xbd92('0x29')][_0x5a4172[_0xbd92('0x22')][_0x108b0c][_0xbd92('0xb1')]]=[];ami[_0xbd92('0x130')]({'actionid':_0x108b0c,'action':_0xbd92('0x1e1'),'queue':_0x3a3ee0[_0xbd92('0x48')]})[_0xbd92('0xb4')](function(_0x32d0c6){_0x5a4172['updateOriginated'](_0x3a3ee0);_0x5a4172[_0xbd92('0xbd')]({'active':![],'ContactId':_0x5a4172[_0xbd92('0x22')][_0x108b0c]['ContactId'],'ListId':_0x5a4172['actions'][_0x108b0c]['ListId'],'VoiceQueueId':_0x5a4172[_0xbd92('0x22')][_0x108b0c][_0xbd92('0xd0')]||undefined,'CampaignId':_0x5a4172[_0xbd92('0x22')][_0x108b0c][_0xbd92('0xd1')]||undefined})['catch'](loggerCatch('[unlockOriginate][syncQueueStatusComplete]'));delete _0x5a4172['actions'][_0x108b0c];});}else{loggerBooked[_0xbd92('0x7a')](_0xbd92('0x1e2'),JSON[_0xbd92('0x4b')](_0x3a3ee0['queueStatusComplete']),_0xbd92('0x1e3'),_0x3a3ee0['name']);_0x5a4172[_0xbd92('0xc7')](_0x3a3ee0);_0x5a4172[_0xbd92('0xbd')]({'active':![],'ContactId':_0x5a4172[_0xbd92('0x22')][_0x108b0c][_0xbd92('0xcd')],'ListId':_0x5a4172['actions'][_0x108b0c][_0xbd92('0xce')],'VoiceQueueId':_0x5a4172[_0xbd92('0x22')][_0x108b0c][_0xbd92('0xd0')]||undefined,'CampaignId':_0x5a4172[_0xbd92('0x22')][_0x108b0c][_0xbd92('0xd1')]||undefined})[_0xbd92('0xb4')](loggerCatch(_0xbd92('0x1e4')));delete _0x5a4172[_0xbd92('0x22')][_0x108b0c];}}else{return _0x5a4172['actionOriginate'](_0x3a3ee0,_0x28b383);}}else{if(getDiff(_0x28b383[_0xbd92('0x1e5')])<_0x3a3ee0[_0xbd92('0x1e6')]*0x3c){if(_0x28b383[_0xbd92('0x1e7')]&&!_0x28b383[_0xbd92('0x1e7')][_0xbd92('0x1e8')]){_0x5a4172[_0xbd92('0x1c')][_0xbd92('0x115')](_0x28b383['id'])[_0xbd92('0x117')](function(){_0x5a4172[_0xbd92('0xc7')](_0x3a3ee0);});}else{_0x5a4172['unlockContact']({'active':![]},_0x28b383['id'],0x1)[_0xbd92('0x117')](function(){console[_0xbd92('0x1e9')](_0xbd92('0x1ea'));_0x5a4172[_0xbd92('0xc7')](_0x3a3ee0);});}}else{_0x3a3ee0['outboundReCallsDay']+=0x1;_0x5a4172['updateOriginated'](_0x3a3ee0);if(_0x3a3ee0[_0xbd92('0x1eb')]){_0x5a4172[_0xbd92('0xbd')]({'active':![],'recallme':![],'UserId':null,'ContactId':_0x28b383['ContactId'],'ListId':_0x28b383['ListId'],'VoiceQueueId':_0x28b383[_0xbd92('0xd0')]||undefined,'CampaignId':_0x28b383[_0xbd92('0xd1')]||undefined})[_0xbd92('0xb4')](loggerCatch(_0xbd92('0x1ec')));_0x5a4172[_0xbd92('0xd7')](createObjHistory(_0x3a3ee0,_0x28b383,'RECALLINQUEUE',0x17,_0xbd92('0x1ed')))[_0xbd92('0xb4')](loggerCatch(_0xbd92('0x1ee')));}else{_0x5a4172[_0xbd92('0xcc')](createObjHistory(_0x3a3ee0,_0x28b383,_0xbd92('0x1ef'),0x16,_0xbd92('0x1f0')),'[Originate][HistoryRecallClose][historyCatch]','[Originate][HistoryRecallClose]');}}}}else{_0x3a3ee0['outboundBlacklistCallsDay']+=0x1;_0x5a4172[_0xbd92('0xcc')](createObjHistory(_0x3a3ee0,_0x28b383,_0xbd92('0x1f1'),0xd,_0xbd92('0x1f2')),_0xbd92('0x1f3'),_0xbd92('0x1f4'));throw'inBlackList';}};};Dialer[_0xbd92('0x1a')]['handleIvr']=function(_0x564a87){var _0xdd5c4a=this;var _0x259a75=[];var _0x3fe36a=_0x564a87[_0xbd92('0x1f5')]-_0x564a87[_0xbd92('0x6d')]-_0x564a87[_0xbd92('0x1f6')];emitCampaignSummary(_0x564a87);if(_0x3fe36a>0x0){if(_0x3fe36a>this['maxNumberOriginate']){_0x3fe36a=this[_0xbd92('0x21')];}_0x564a87[_0xbd92('0x1f6')]+=_0x3fe36a;this[_0xbd92('0xc3')](_0x564a87['id'],_0x3fe36a,_0x564a87[_0xbd92('0x1f7')])[_0xbd92('0xb7')](function(_0x114cdb){_0x564a87[_0xbd92('0x1f6')]-=_0x3fe36a;_0x564a87[_0xbd92('0x1f6')]=_0x564a87[_0xbd92('0x1f6')]>0x0?_0x564a87['temp']:0x0;if(!checkContactEmpty(_0x114cdb)){_0x564a87[_0xbd92('0x3f')]='AVAILABLE_CONTACTS_FINISHED';logger[_0xbd92('0x7a')](_0xbd92('0x1f8')+_0x564a87['name']);}else{_0x564a87['originated']+=_0x114cdb[_0xbd92('0x97')];_0x564a87[_0xbd92('0x3f')]=_0xbd92('0x1f9');for(var _0xbfc770=0x0;_0xbfc770<_0x114cdb[_0xbd92('0x97')];_0xbfc770+=0x1){_0x564a87[_0xbd92('0x1fa')]+=0x1;if(_[_0xbd92('0xae')](_0x114cdb[_0xbfc770])||_[_0xbd92('0xae')](_0x114cdb[_0xbfc770][_0xbd92('0x152')])||_[_0xbd92('0xae')](_0x114cdb[_0xbfc770]['Contact'][_0xbd92('0x153')])){_0xdd5c4a['emptyContact'](_0xbd92('0x1fb'),_0x564a87,_0x114cdb[_0xbfc770]);}else{_0xdd5c4a[_0xbd92('0xba')](_[_0xbd92('0x114')](_0x114cdb[_0xbfc770],[_0xbd92('0xd1'),_0xbd92('0x1fc')]))[_0xbd92('0xb7')](_0xdd5c4a[_0xbd92('0x1dd')](_0x564a87,_0x114cdb[_0xbfc770]))['catch'](_0xdd5c4a['loggerHandler'](_0xbd92('0x1fd'),_0x564a87));}}}})[_0xbd92('0xb4')](loggerGetContactDialer('[getContactCampaign2]',_0x564a87,_0x3fe36a));}};Dialer[_0xbd92('0x1a')][_0xbd92('0x140')]=function(_0x477a1f,_0x3aafdb){var _0x295c71=this;var _0x446a72=[];var _0x4653e7=_0x3aafdb>=0x1?_0x3aafdb:0x1;var _0x305bce=[];if(_0x477a1f[_0xbd92('0x5a')]===_0xbd92('0x8')){_0x4653e7=0x1;}var _0x45daba=Math[_0xbd92('0x1d9')](_0x477a1f['available']*_0x4653e7)-_0x477a1f[_0xbd92('0x6d')]-_0x477a1f[_0xbd92('0x1f6')];emitVoiceQueueSummary(_0x477a1f);if(_0x477a1f[_0xbd92('0x1fe')]>0x0){var _0x1fed04=_0x477a1f[_0xbd92('0x1fe')]-_0x477a1f['originated']-_0x477a1f[_0xbd92('0x55')]-_0x477a1f[_0xbd92('0x1f6')]-_0x477a1f[_0xbd92('0x52')];if(_0x45daba>_0x1fed04){_0x45daba=_0x1fed04;}}if(_0x45daba>0x0){if(_0x477a1f['dialMethod']===_0xbd92('0x8')){_0x45daba=0x1;}if(_0x45daba>this[_0xbd92('0x21')]){_0x45daba=this[_0xbd92('0x21')];}_0x477a1f[_0xbd92('0x1f6')]+=_0x45daba;for(var _0xb8eb58 in this[_0xbd92('0x1f')]){if(this['agents'][_0xbd92('0x98')](_0xb8eb58)){if(this[_0xbd92('0x1f')][_0xb8eb58]['state']===_0xbd92('0x1ff')&&this[_0xbd92('0x1f')][_0xb8eb58][_0xbd92('0xaf')]===_0xbd92('0xd5')){_0x446a72[_0xbd92('0x110')](this[_0xbd92('0x1f')][_0xb8eb58]['id']);}}}this['getContactDialer'](_0x477a1f['id'],_0x446a72,_0x45daba,_0x477a1f[_0xbd92('0x1f7')])[_0xbd92('0xb7')](function(_0x2c4d45){_0x477a1f[_0xbd92('0x1f6')]-=_0x45daba;_0x477a1f[_0xbd92('0x1f6')]=_0x477a1f[_0xbd92('0x1f6')]>0x0?_0x477a1f['temp']:0x0;if(!checkContactEmpty(_0x2c4d45)){_0x295c71[_0xbd92('0xb3')](_0x477a1f)[_0xbd92('0xb7')](sendMessageReschedule(_0x477a1f))['catch'](loggerCatch(_0xbd92('0xb5')));}else{_0x477a1f[_0xbd92('0x6d')]+=_0x2c4d45['length'];_0x477a1f[_0xbd92('0x3f')]=_0x477a1f[_0xbd92('0x5a')]===_0xbd92('0x8')?_0xbd92('0x15a'):_0xbd92('0x1f9');for(var _0x18fffc=0x0;_0x18fffc<_0x2c4d45[_0xbd92('0x97')];_0x18fffc+=0x1){if(_[_0xbd92('0xae')](_0x2c4d45[_0x18fffc])||_[_0xbd92('0xae')](_0x2c4d45[_0x18fffc]['Contact'])||_[_0xbd92('0xae')](_0x2c4d45[_0x18fffc][_0xbd92('0x152')][_0xbd92('0x153')])){_0x295c71['emptyContact'](_0xbd92('0x1fb'),_0x477a1f,_0x2c4d45[_0x18fffc]);}else{_0x295c71[_0xbd92('0xb8')](_['pick'](_0x2c4d45[_0x18fffc],[_0xbd92('0xd0'),_0xbd92('0x1fc')]))['then'](_0x295c71[_0xbd92('0x1dd')](_0x477a1f,_0x2c4d45[_0x18fffc]))['catch'](_0x295c71['loggerHandler'](_0xbd92('0x1fb'),_0x477a1f));}}}})[_0xbd92('0xb4')](loggerGetContactDialer('[getContactDialer2]',_0x477a1f,_0x45daba));}};Dialer['prototype'][_0xbd92('0x90')]=function(_0x2840fe){var _0x349464=this;if(_0x2840fe['dialLimitQueue']>0x0){var _0x51e1a6=_0x2840fe[_0xbd92('0x1fe')]-_0x2840fe['originated']-_0x2840fe[_0xbd92('0x55')];if(_0x51e1a6>0x0){this[_0xbd92('0x200')](_0x2840fe);}else{loggerPredictiveCalls[_0xbd92('0x7a')]('[handlePredictive][limitChannel]');}}else{this[_0xbd92('0x200')](_0x2840fe);}};Dialer[_0xbd92('0x1a')][_0xbd92('0x200')]=function(_0x24a071){var _0x39d477=this;var _0x37ece4=[];_0x24a071['originated']+=0x1;for(var _0x565eb4 in this['agents']){if(this['agents'][_0xbd92('0x98')](_0x565eb4)){if(this['agents'][_0x565eb4][_0xbd92('0xdf')]==='not_inuse'&&this['agents'][_0x565eb4][_0xbd92('0xaf')]===_0xbd92('0xd5')){_0x37ece4[_0xbd92('0x110')](this[_0xbd92('0x1f')][_0x565eb4]['id']);}}}this[_0xbd92('0xc1')](_0x24a071['id'],_0x37ece4,0x1,_0x24a071[_0xbd92('0x1f7')])['then'](function(_0xe25ae0){if(!checkContactEmpty(_0xe25ae0)){checkContactLowerLimitOriginate(_0x24a071,0x1,0x0);_0x39d477[_0xbd92('0xb3')](_0x24a071)['then'](sendMessageReschedule(_0x24a071))['catch'](loggerCatch(_0xbd92('0xb5')));}else{_0x24a071[_0xbd92('0x3f')]=_0xbd92('0x1f9');if(_[_0xbd92('0xae')](_0xe25ae0[0x0])||_[_0xbd92('0xae')](_0xe25ae0[0x0][_0xbd92('0x152')])||_[_0xbd92('0xae')](_0xe25ae0[0x0][_0xbd92('0x152')][_0xbd92('0x153')])){_0x39d477[_0xbd92('0xca')](_0xbd92('0x1fb'),_0x24a071,_0xe25ae0[0x0]);}else{_0x39d477[_0xbd92('0xb8')](_[_0xbd92('0x114')](_0xe25ae0[0x0],['VoiceQueueId','Contact.phone']))['then'](_0x39d477[_0xbd92('0x1dd')](_0x24a071,_0xe25ae0[0x0]))[_0xbd92('0xb4')](_0x39d477[_0xbd92('0xc9')](_0xbd92('0x201'),_0x24a071));}}})['catch'](loggerGetContactDialer(_0xbd92('0x202'),_0x24a071,0x1));emitVoiceQueueSummary(_0x24a071);};Dialer[_0xbd92('0x1a')][_0xbd92('0x203')]=function(_0x16f848,_0x4189ab,_0x5a2d4a,_0x4edb54,_0x16da49,_0xd9f027){loggerPredictive[_0xbd92('0x7a')](_0xbd92('0x204'));loggerPredictive[_0xbd92('0x7a')](_0xbd92('0x205'),_0x16f848);loggerPredictive[_0xbd92('0x7a')](_0xbd92('0x206'),_0x4189ab);loggerPredictive['info']('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',_0x5a2d4a);loggerPredictive['info'](_0xbd92('0x207'),_0x4edb54);loggerPredictive['info'](_0xbd92('0x208'),_0x16da49);loggerPredictive[_0xbd92('0x7a')]('---------------------------');return new BPromise(function(_0x3f6e54,_0x4110ff){if(_0x16f848<=0x0||isNaN(_0x16f848)){return _0x4110ff(msgResponse(_0xbd92('0x209'),_0xbd92('0x183'),_0xbd92('0x20a')+_0x16f848));}if(_0x5a2d4a<=0x0||isNaN(_0x5a2d4a)){return _0x4110ff(msgResponse(_0xbd92('0x209'),_0xbd92('0x183'),_0xbd92('0x20b')+_0x5a2d4a));}if(_0x4edb54<=0x0||isNaN(_0x4edb54)){return _0x4110ff(msgResponse(_0xbd92('0x209'),'Error',_0xbd92('0x20c')+_0x4edb54));}if(_0x4189ab<=0x0||isNaN(_0x4189ab)){return _0x4110ff(msgResponse(_0xbd92('0x209'),_0xbd92('0x183'),_0xbd92('0x20d')+_0x4189ab));}if(_0x16da49<=0x0||isNaN(_0x16da49)){return _0x4110ff(msgResponse(_0xbd92('0x209'),'Error','Amax\x20=\x20'+_0x16da49));}_0xd9f027=_0xd9f027||0x0;var _0x474395=0x1/_0x5a2d4a;var _0x3110f1=0x0;var _0x4e8520=0x0;var _0x6524a4=0x0;var _0x201f8c=0x0;for(var _0x52a337=0x0;_0x6524a4<_0x16da49;_0x52a337+=0x1){_0x4e8520=_0x52a337/_0x4189ab;_0x3110f1=(_0x4edb54*_0x4e8520+_0xd9f027)/_0x474395;_0x6524a4=erlangb(_0x3110f1,_0x16f848);_0x201f8c=_0x3110f1/_0x16f848*(0x1-erlangb(_0x3110f1,_0x16f848));}return _0x3f6e54({'erlangCalls':_0x52a337,'erlangCallToSecond':_0x4189ab/_0x52a337,'erlangAbandonmentRate':_0x6524a4,'erlangBusyFactor':_0x201f8c});});};Dialer['prototype']['busyFactor']=function(_0x4b32cd,_0xcf1208,_0x5e1294,_0x1fecea,_0x523cb0,_0xa3660a){loggerPredictive[_0xbd92('0x7a')](_0xbd92('0x20e'));loggerPredictive[_0xbd92('0x7a')](_0xbd92('0x205'),_0x4b32cd);loggerPredictive[_0xbd92('0x7a')](_0xbd92('0x206'),_0xcf1208);loggerPredictive[_0xbd92('0x7a')](_0xbd92('0x20f'),_0x5e1294);loggerPredictive['info'](_0xbd92('0x207'),_0x1fecea);loggerPredictive[_0xbd92('0x7a')]('Umin:\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20',_0x523cb0);loggerPredictive[_0xbd92('0x7a')](_0xbd92('0x82'));return new BPromise(function(_0x346a39,_0x3411f9){if(_0x4b32cd<=0x0||isNaN(_0x4b32cd)){return _0x3411f9(msgResponse(_0xbd92('0x210'),_0xbd92('0x183'),_0xbd92('0x20a')+_0x4b32cd));}if(_0x5e1294<=0x0||isNaN(_0x5e1294)){return _0x3411f9(msgResponse(_0xbd92('0x210'),'Error',_0xbd92('0x20b')+_0x5e1294));}if(_0x1fecea<=0x0||isNaN(_0x1fecea)){return _0x3411f9(msgResponse(_0xbd92('0x210'),_0xbd92('0x183'),_0xbd92('0x20c')+_0x1fecea));}if(_0xcf1208<=0x0||isNaN(_0xcf1208)){return _0x3411f9(msgResponse(_0xbd92('0x210'),_0xbd92('0x183'),'interval\x20=\x20'+_0xcf1208));}if(_0x523cb0<=0x0||isNaN(_0x523cb0)){return _0x3411f9(msgResponse('[busyFactor]',_0xbd92('0x183'),_0xbd92('0x211')+_0x523cb0));}_0xa3660a=_0xa3660a||0x0;var _0x1b5904=0x1/_0x5e1294;var _0x3901ed=0x0;var _0x5396f4=0x0;var _0x27a6e0=0x0;var _0x2a7365=0x0;for(var _0x370311=0x0;_0x2a7365<_0x523cb0;_0x370311+=0x1){_0x5396f4=_0x370311/_0xcf1208;_0x3901ed=(_0x1fecea*_0x5396f4+_0xa3660a)/_0x1b5904;_0x27a6e0=erlangb(_0x3901ed,_0x4b32cd);_0x2a7365=_0x3901ed/_0x4b32cd*(0x1-erlangb(_0x3901ed,_0x4b32cd));}return _0x346a39({'erlangCalls':_0x370311,'erlangCallToSecond':_0xcf1208/_0x370311,'erlangAbandonmentRate':_0x27a6e0,'erlangBusyFactor':_0x2a7365});});};module[_0xbd92('0x212')]=Dialer;
\ No newline at end of file
diff --git a/server/services/ami/dialer/queueCallerAbandon.js b/server/services/ami/dialer/queueCallerAbandon.js
index 2556604..967363e 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 _0x2b34=['VoiceQueueId','CampaignId','originatecalleridname','exports','util','lodash','moment','milliseconds','diff','scheduledat','type','outbound','countbusyretry','countcongestionretry','countnoanswerretry','countglobal','countnosuchnumberretry','countdropretry','countabandonedretry','countagentrejectretry','countmachineretry','uniqueid','name','number','starttime','responsetime','droptime','endtime','holdtime','talktime','queue','reason','callback','callbackuniqueid','callbackat','recallme','ContactId','ListId','UserId'];(function(_0x365460,_0x221c47){var _0x2c3d68=function(_0xed99ce){while(--_0xed99ce){_0x365460['push'](_0x365460['shift']());}};_0x2c3d68(++_0x221c47);}(_0x2b34,0xee));var _0x42b3=function(_0x93359d,_0xd47143){_0x93359d=_0x93359d-0x0;var _0x5b53b7=_0x2b34[_0x93359d];return _0x5b53b7;};'use strict';var util=require(_0x42b3('0x0'));var _=require(_0x42b3('0x1'));var moment=require(_0x42b3('0x2'));function getSeconds(_0x149351,_0x40fac8){var _0x4b56ba=moment(_0x149351)[_0x42b3('0x3')](0x0);var _0x100d40=moment(_0x40fac8)[_0x42b3('0x3')](0x0);return _0x4b56ba[_0x42b3('0x4')](_0x100d40,'seconds');}function QueueCallerAbandon(_0xcce591,_0x58341c){this[_0x42b3('0x5')]=_0xcce591[_0x42b3('0x5')];this[_0x42b3('0x6')]=_0xcce591['type'];this['campaigntype']=_0xcce591[_0x42b3('0x6')]===_0x42b3('0x7')?'queue':_0xcce591[_0x42b3('0x6')];this[_0x42b3('0x8')]=_0xcce591[_0x42b3('0x8')];this[_0x42b3('0x9')]=_0xcce591[_0x42b3('0x9')];this[_0x42b3('0xa')]=_0xcce591[_0x42b3('0xa')];this[_0x42b3('0xb')]=_0xcce591[_0x42b3('0x8')]+_0xcce591[_0x42b3('0x9')]+_0xcce591[_0x42b3('0xa')]+_0xcce591[_0x42b3('0xc')]+_0xcce591[_0x42b3('0xd')]+_0xcce591[_0x42b3('0xe')]+_0xcce591['countmachineretry']+_0xcce591[_0x42b3('0xf')];this['countnosuchnumberretry']=_0xcce591[_0x42b3('0xc')];this[_0x42b3('0xd')]=_0xcce591[_0x42b3('0xd')];this[_0x42b3('0xe')]=_0xcce591[_0x42b3('0xe')];this[_0x42b3('0x10')]=_0xcce591[_0x42b3('0x10')];this[_0x42b3('0xf')]=_0xcce591[_0x42b3('0xf')];this[_0x42b3('0x11')]=_0x58341c[_0x42b3('0x11')];this['calleridname']=_0xcce591[_0x42b3('0x12')];this['calleridnum']=_0xcce591[_0x42b3('0x13')];this[_0x42b3('0x14')]=_0xcce591[_0x42b3('0x14')];this[_0x42b3('0x15')]=_0xcce591[_0x42b3('0x15')];this[_0x42b3('0x16')]=_0xcce591['droptime'];this[_0x42b3('0x17')]=this['droptime'];this['ringtime']=getSeconds(_0xcce591[_0x42b3('0x15')],_0xcce591['starttime']);this[_0x42b3('0x18')]=getSeconds(this[_0x42b3('0x16')],_0xcce591[_0x42b3('0x15')]);this[_0x42b3('0x19')]=0x0;this[_0x42b3('0x1a')]=_0x58341c[_0x42b3('0x1a')];this['membername']=_0x58341c['connectedlinename'];this[_0x42b3('0x1b')]=_0x58341c[_0x42b3('0x1b')];this[_0x42b3('0x1c')]=_0xcce591[_0x42b3('0x1c')];this[_0x42b3('0x1d')]=_0xcce591[_0x42b3('0x1d')];this[_0x42b3('0x1e')]=_0xcce591[_0x42b3('0x1e')];this['recallme']=_0xcce591[_0x42b3('0x1f')];this[_0x42b3('0x20')]=_0xcce591[_0x42b3('0x20')];this[_0x42b3('0x21')]=_0xcce591[_0x42b3('0x21')];this['UserId']=_0xcce591[_0x42b3('0x22')];this[_0x42b3('0x23')]=_0xcce591[_0x42b3('0x23')];this[_0x42b3('0x24')]=_0xcce591[_0x42b3('0x24')];this['originatecalleridnum']=_0xcce591['originatecalleridnum']||'';this[_0x42b3('0x25')]=_0xcce591['originatecalleridname']||'';}module[_0x42b3('0x26')]=QueueCallerAbandon;
\ No newline at end of file
+var _0x5fcf=['UserId','VoiceQueueId','CampaignId','originatecalleridnum','originatecalleridname','exports','util','lodash','moment','milliseconds','seconds','scheduledat','type','campaigntype','outbound','queue','countbusyretry','countcongestionretry','countnoanswerretry','countglobal','countdropretry','countabandonedretry','countagentrejectretry','countnosuchnumberretry','countmachineretry','uniqueid','calleridnum','number','starttime','responsetime','droptime','endtime','ringtime','holdtime','talktime','membername','connectedlinename','reason','callback','callbackuniqueid','callbackat','recallme','ContactId','ListId'];(function(_0xe7bd04,_0x1fe665){var _0x40c965=function(_0x17e42f){while(--_0x17e42f){_0xe7bd04['push'](_0xe7bd04['shift']());}};_0x40c965(++_0x1fe665);}(_0x5fcf,0x192));var _0xf5fc=function(_0x4e5750,_0x2e6c39){_0x4e5750=_0x4e5750-0x0;var _0x44b411=_0x5fcf[_0x4e5750];return _0x44b411;};'use strict';var util=require(_0xf5fc('0x0'));var _=require(_0xf5fc('0x1'));var moment=require(_0xf5fc('0x2'));function getSeconds(_0xe6814a,_0x488753){var _0x5663d9=moment(_0xe6814a)[_0xf5fc('0x3')](0x0);var _0x3c5fc2=moment(_0x488753)[_0xf5fc('0x3')](0x0);return _0x5663d9['diff'](_0x3c5fc2,_0xf5fc('0x4'));}function QueueCallerAbandon(_0x1a2d3b,_0x501974){this[_0xf5fc('0x5')]=_0x1a2d3b['scheduledat'];this['type']=_0x1a2d3b[_0xf5fc('0x6')];this[_0xf5fc('0x7')]=_0x1a2d3b[_0xf5fc('0x6')]===_0xf5fc('0x8')?_0xf5fc('0x9'):_0x1a2d3b[_0xf5fc('0x6')];this[_0xf5fc('0xa')]=_0x1a2d3b[_0xf5fc('0xa')];this[_0xf5fc('0xb')]=_0x1a2d3b[_0xf5fc('0xb')];this[_0xf5fc('0xc')]=_0x1a2d3b[_0xf5fc('0xc')];this[_0xf5fc('0xd')]=_0x1a2d3b[_0xf5fc('0xa')]+_0x1a2d3b[_0xf5fc('0xb')]+_0x1a2d3b[_0xf5fc('0xc')]+_0x1a2d3b['countnosuchnumberretry']+_0x1a2d3b[_0xf5fc('0xe')]+_0x1a2d3b[_0xf5fc('0xf')]+_0x1a2d3b['countmachineretry']+_0x1a2d3b[_0xf5fc('0x10')];this[_0xf5fc('0x11')]=_0x1a2d3b[_0xf5fc('0x11')];this[_0xf5fc('0xe')]=_0x1a2d3b[_0xf5fc('0xe')];this[_0xf5fc('0xf')]=_0x1a2d3b['countabandonedretry'];this['countmachineretry']=_0x1a2d3b[_0xf5fc('0x12')];this[_0xf5fc('0x10')]=_0x1a2d3b[_0xf5fc('0x10')];this[_0xf5fc('0x13')]=_0x501974[_0xf5fc('0x13')];this['calleridname']=_0x1a2d3b['name'];this[_0xf5fc('0x14')]=_0x1a2d3b[_0xf5fc('0x15')];this[_0xf5fc('0x16')]=_0x1a2d3b['starttime'];this[_0xf5fc('0x17')]=_0x1a2d3b[_0xf5fc('0x17')];this[_0xf5fc('0x18')]=_0x1a2d3b[_0xf5fc('0x18')];this[_0xf5fc('0x19')]=this[_0xf5fc('0x18')];this[_0xf5fc('0x1a')]=getSeconds(_0x1a2d3b[_0xf5fc('0x17')],_0x1a2d3b[_0xf5fc('0x16')]);this[_0xf5fc('0x1b')]=getSeconds(this[_0xf5fc('0x18')],_0x1a2d3b['responsetime']);this[_0xf5fc('0x1c')]=0x0;this['queue']=_0x501974[_0xf5fc('0x9')];this[_0xf5fc('0x1d')]=_0x501974[_0xf5fc('0x1e')];this['reason']=_0x501974[_0xf5fc('0x1f')];this[_0xf5fc('0x20')]=_0x1a2d3b[_0xf5fc('0x20')];this[_0xf5fc('0x21')]=_0x1a2d3b[_0xf5fc('0x21')];this[_0xf5fc('0x22')]=_0x1a2d3b['callbackat'];this[_0xf5fc('0x23')]=_0x1a2d3b[_0xf5fc('0x23')];this[_0xf5fc('0x24')]=_0x1a2d3b[_0xf5fc('0x24')];this[_0xf5fc('0x25')]=_0x1a2d3b['ListId'];this[_0xf5fc('0x26')]=_0x1a2d3b['UserId'];this[_0xf5fc('0x27')]=_0x1a2d3b[_0xf5fc('0x27')];this[_0xf5fc('0x28')]=_0x1a2d3b['CampaignId'];this['originatecalleridnum']=_0x1a2d3b[_0xf5fc('0x29')]||'';this['originatecalleridname']=_0x1a2d3b[_0xf5fc('0x2a')]||'';}module[_0xf5fc('0x2b')]=QueueCallerAbandon;
\ No newline at end of file
diff --git a/server/services/ami/fax/action.js b/server/services/ami/fax/action.js
index 2aca834..218a584 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 _0x43ed=['AttachmentId','exports','util','lodash','uniqueid','format','%s/%s/%s','Trunk','name','localstationid','headerinfo','path'];(function(_0x413b4d,_0xa3459c){var _0x8b810a=function(_0x22d441){while(--_0x22d441){_0x413b4d['push'](_0x413b4d['shift']());}};_0x8b810a(++_0xa3459c);}(_0x43ed,0x10a));var _0xd43e=function(_0x4243a3,_0x447337){_0x4243a3=_0x4243a3-0x0;var _0x1b2a33=_0x43ed[_0x4243a3];return _0x1b2a33;};'use strict';var util=require(_0xd43e('0x0'));var _=require(_0xd43e('0x1'));var moment=require('moment');function Action(_0xcf51d6,_0x433a27,_0x49d069){this[_0xd43e('0x2')]=_0xcf51d6||undefined;this['channel']=util[_0xd43e('0x3')](_0xd43e('0x4'),_0x433a27['tech'],_0x433a27[_0xd43e('0x5')][_0xd43e('0x6')],_0x49d069['fax']);this['localstationid']=_0x433a27[_0xd43e('0x7')];this[_0xd43e('0x8')]=_0x433a27[_0xd43e('0x8')];this[_0xd43e('0x9')]=_0x49d069[_0xd43e('0x9')];this['AttachmentId']=_0x49d069[_0xd43e('0xa')];}module[_0xd43e('0xb')]=Action;
\ No newline at end of file
+var _0xd223=['localstationid','headerinfo','path','AttachmentId','exports','util','lodash','uniqueid','channel','%s/%s/%s','tech','Trunk','name','fax'];(function(_0x131e60,_0x5352ce){var _0x4bc497=function(_0x2a758e){while(--_0x2a758e){_0x131e60['push'](_0x131e60['shift']());}};_0x4bc497(++_0x5352ce);}(_0xd223,0xe5));var _0x3d22=function(_0x2843ee,_0x423d24){_0x2843ee=_0x2843ee-0x0;var _0x11295d=_0xd223[_0x2843ee];return _0x11295d;};'use strict';var util=require(_0x3d22('0x0'));var _=require(_0x3d22('0x1'));var moment=require('moment');function Action(_0x59c577,_0x115403,_0xbad4c6){this[_0x3d22('0x2')]=_0x59c577||undefined;this[_0x3d22('0x3')]=util['format'](_0x3d22('0x4'),_0x115403[_0x3d22('0x5')],_0x115403[_0x3d22('0x6')][_0x3d22('0x7')],_0xbad4c6[_0x3d22('0x8')]);this['localstationid']=_0x115403[_0x3d22('0x9')];this['headerinfo']=_0x115403[_0x3d22('0xa')];this[_0x3d22('0xb')]=_0xbad4c6[_0x3d22('0xb')];this['AttachmentId']=_0xbad4c6[_0x3d22('0xc')];}module[_0x3d22('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 9f74138..9102152 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 _0x646b=['variablesAction','execOriginate','addVariables','ext','isTrunkReachable','isNil','active','SIP/%s','reachable','[Fax][checkTrunk][Trunk\x20not\x20work]','\x20Trunk\x20is\x20not\x20active','Trunk\x20not\x20working','fax','[Fax][checkTrunk][Empty\x20path]','Empty\x20path','Is\x20Valid','exports','util','lodash','bluebird','moment','path','./util/gs','../../../config/logger','../ami','./rpcDb','./channel','./util/util','../rpc/faxAccount','../rpc/attachment','channels','faxAccounts','trunks','syncNewchannel','varset','bind','syncNewExten','faxstatus','syncFaxStatus','receivefax','syncHangup','originateresponse','syncOriginateResponse','prototype','from-voip-provider','hasOwnProperty','exten','uniqueid','channel','name','info','\x20syncNewchannel\x20','actions','variable','syncNewState','channelstate','channelstatedesc','value','operation','status','localstationid','filename','\x20syncFaxStatus\x20','syncReceiveFax','pagestransferred','resolution','transferrate','calleridnum','/var/opt/motion2/server/files/attachments/','\x20result\x20conversion\x20file\x20','message','create','parse','.pdf','application/pdf','then','notify','error','stringify','\x20receiveFax\x20','merge','response','reason','AttachmentId','logger','[Fax][Message][Error][Updated]','catch','[Fax][Message][Error][NoUpdate1]','[Fax][Message][Error][NoUpdate2]','updateStatus','update','[Fax][Message][Updated]','[Fax][Message][NoUpdate1]','finally','\x20hangup\x20faxRiceive\x20','SUCCESS','SENDING\x20FAILED:\x20','faxstatusstring','SENDING\x20FAILED','send','FaxAccountId','[Fax][execOriginate][success]','Fax\x20received','[Fax][execOriginate][failure]','checkTrunk','Trunk','isValid','Trunk\x20Reachable','format','gs\x20-q\x20-dNOPAUSE\x20-dBATCH\x20-sDEVICE=tiffg4\x20-sPAPERSIZE=letter\x20-sOutputFile=/var/opt/motion2/server/files/attachments/%s.tif\x20\x20%s\x20-c\x20quit','execute','%s/%s.tif','dir','Convert\x20pdf\x20to\x20tif','Action'];(function(_0x28fa89,_0x329aa1){var _0x30f808=function(_0x55e090){while(--_0x55e090){_0x28fa89['push'](_0x28fa89['shift']());}};_0x30f808(++_0x329aa1);}(_0x646b,0x84));var _0xb646=function(_0x12f59c,_0x13d956){_0x12f59c=_0x12f59c-0x0;var _0x2db43e=_0x646b[_0x12f59c];return _0x2db43e;};'use strict';var util=require(_0xb646('0x0'));var _=require(_0xb646('0x1'));var BPromise=require(_0xb646('0x2'));var uuid=require('uuid');var moment=require(_0xb646('0x3'));var path=require(_0xb646('0x4'));var tiff2pdf=require('tiff2pdf');var gs=require(_0xb646('0x5'));var logger=require(_0xb646('0x6'))('fax');var ami=require(_0xb646('0x7'));var rpcDb=require(_0xb646('0x8'));var Channel=require(_0xb646('0x9'));var ut=require(_0xb646('0xa'));var Action=require('./action');var faxAccount=require(_0xb646('0xb'));var attachment=require(_0xb646('0xc'));var faxMessage=require('../rpc/faxMessage');function Fax(_0x1bc148){this[_0xb646('0xd')]={};this['faxAccounts']=_0x1bc148[_0xb646('0xe')];this[_0xb646('0xf')]=_0x1bc148[_0xb646('0xf')];this['actions']={};ami['on']('newchannel',this[_0xb646('0x10')]['bind'](this));ami['on'](_0xb646('0x11'),this['syncVarSet'][_0xb646('0x12')](this));ami['on']('newstate',this['syncNewState'][_0xb646('0x12')](this));ami['on']('newexten',this[_0xb646('0x13')]['bind'](this));ami['on'](_0xb646('0x14'),this[_0xb646('0x15')]['bind'](this));ami['on'](_0xb646('0x16'),this['syncReceiveFax']['bind'](this));ami['on']('hangup',this[_0xb646('0x17')][_0xb646('0x12')](this));ami['on'](_0xb646('0x18'),this[_0xb646('0x19')][_0xb646('0x12')](this));}Fax[_0xb646('0x1a')][_0xb646('0x10')]=function(_0x2e3001){if(_0x2e3001['context']===_0xb646('0x1b')){for(var _0x45ca0c in this['faxAccounts']){if(this['faxAccounts'][_0xb646('0x1c')](_0x45ca0c)){if(_0x2e3001[_0xb646('0x1d')]===this[_0xb646('0xe')][_0x45ca0c]['localstationid']){this[_0xb646('0xd')][_0x2e3001[_0xb646('0x1e')]]={};this[_0xb646('0xd')][_0x2e3001[_0xb646('0x1e')]][_0xb646('0x1f')]=_0x2e3001[_0xb646('0x1f')];this[_0xb646('0xd')][_0x2e3001[_0xb646('0x1e')]]['id']=this[_0xb646('0xe')][_0x45ca0c]['id'];this[_0xb646('0xd')][_0x2e3001['uniqueid']][_0xb646('0x20')]=this[_0xb646('0xe')][_0x45ca0c]['name'];logger[_0xb646('0x21')](_0x2e3001[_0xb646('0x1e')],_0xb646('0x22'));}}}}if(this[_0xb646('0x23')][_0x2e3001[_0xb646('0x1e')]]){this[_0xb646('0xd')][_0x2e3001[_0xb646('0x1e')]]={};this['channels'][_0x2e3001[_0xb646('0x1e')]][_0xb646('0x1f')]=_0x2e3001[_0xb646('0x1f')];logger['info'](_0x2e3001['uniqueid'],_0xb646('0x22'));}};Fax[_0xb646('0x1a')]['syncVarSet']=function(_0x434c28){if(this['channels'][_0x434c28[_0xb646('0x1e')]]){for(var _0x4e5f25 in _0x434c28[_0xb646('0x24')]){if(_0x434c28['variable'][_0xb646('0x1c')](_0x4e5f25)){this[_0xb646('0xd')][_0x434c28['uniqueid']][_0x4e5f25]=_0x434c28['value'];}}}};Fax[_0xb646('0x1a')][_0xb646('0x25')]=function(_0x4ca2d4){if(this[_0xb646('0xd')][_0x4ca2d4['uniqueid']]){this[_0xb646('0xd')][_0x4ca2d4['uniqueid']][_0xb646('0x26')]=_0x4ca2d4[_0xb646('0x26')];this[_0xb646('0xd')][_0x4ca2d4[_0xb646('0x1e')]][_0xb646('0x27')]=_0x4ca2d4[_0xb646('0x27')];}};Fax['prototype'][_0xb646('0x13')]=function(_0x4b59d4){if(this[_0xb646('0xd')][_0x4b59d4[_0xb646('0x1e')]]){for(var _0x51079e in _0x4b59d4[_0xb646('0x24')]){if(_0x4b59d4[_0xb646('0x24')][_0xb646('0x1c')](_0x51079e)){this[_0xb646('0xd')][_0x4b59d4['uniqueid']][_0x51079e]=_0x4b59d4[_0xb646('0x28')];}}}};Fax[_0xb646('0x1a')][_0xb646('0x15')]=function(_0x2d5b61){if(this[_0xb646('0xd')][_0x2d5b61[_0xb646('0x1e')]]){this['channels'][_0x2d5b61['uniqueid']][_0xb646('0x29')]=_0x2d5b61[_0xb646('0x29')];this[_0xb646('0xd')][_0x2d5b61[_0xb646('0x1e')]][_0xb646('0x2a')]=_0x2d5b61['status'];this[_0xb646('0xd')][_0x2d5b61[_0xb646('0x1e')]][_0xb646('0x2b')]=_0x2d5b61['localstationid'];this[_0xb646('0xd')][_0x2d5b61[_0xb646('0x1e')]][_0xb646('0x2c')]=_0x2d5b61[_0xb646('0x2c')];logger['info'](_0x2d5b61[_0xb646('0x1e')],_0xb646('0x2d'));}};Fax[_0xb646('0x1a')][_0xb646('0x2e')]=function(_0x26067c){var _0x37715d=this;if(this[_0xb646('0xd')][_0x26067c['uniqueid']]){var _0x184727=this[_0xb646('0xd')][_0x26067c[_0xb646('0x1e')]]['id'];this[_0xb646('0xd')][_0x26067c[_0xb646('0x1e')]]['remotestationid']=_0x26067c['remotestationid'];this['channels'][_0x26067c[_0xb646('0x1e')]][_0xb646('0x2f')]=_0x26067c[_0xb646('0x2f')];this['channels'][_0x26067c[_0xb646('0x1e')]][_0xb646('0x2b')]=_0x26067c[_0xb646('0x2b')];this[_0xb646('0xd')][_0x26067c['uniqueid']]['resolution']=_0x26067c[_0xb646('0x30')];this[_0xb646('0xd')][_0x26067c[_0xb646('0x1e')]][_0xb646('0x31')]=_0x26067c[_0xb646('0x31')];this[_0xb646('0xd')][_0x26067c[_0xb646('0x1e')]]['filename']=_0x26067c[_0xb646('0x2c')];this[_0xb646('0xd')][_0x26067c[_0xb646('0x1e')]][_0xb646('0x32')]=_0x26067c[_0xb646('0x32')];if(this['channels'][_0x26067c[_0xb646('0x1e')]]['pagestransferred']>0x0){tiff2pdf(_0x26067c[_0xb646('0x2c')],_0xb646('0x33'),function(_0x3549f7){logger['info'](_0x26067c['uniqueid'],_0xb646('0x34'),_0x3549f7[_0xb646('0x35')]);attachment[_0xb646('0x36')]({'name':path[_0xb646('0x37')](_0x26067c[_0xb646('0x2c')])['name'],'basename':path[_0xb646('0x37')](_0x26067c[_0xb646('0x2c')])[_0xb646('0x20')]+_0xb646('0x38'),'type':_0xb646('0x39')})[_0xb646('0x3a')](function(_0x4b4e6d){faxAccount[_0xb646('0x3b')](_0x184727,{'from':_0x26067c['calleridnum'],'mapKey':'fax','body':path[_0xb646('0x37')](_0x26067c['filename'])[_0xb646('0x20')]+_0xb646('0x38'),'AttachmentId':_0x4b4e6d['id']})['catch'](function(_0x4cb0c5){logger[_0xb646('0x3c')](_0x26067c[_0xb646('0x1e')],'\x20notify\x20',JSON[_0xb646('0x3d')](_0x4cb0c5));});})['catch'](function(_0x39d3df){logger[_0xb646('0x3c')](_0x26067c['uniqueid'],_0xb646('0x3e'),JSON[_0xb646('0x3d')](_0x39d3df));});});}logger[_0xb646('0x21')](_0x26067c[_0xb646('0x1e')],_0xb646('0x3e'));}};Fax[_0xb646('0x1a')]['syncOriginateResponse']=function(_0x386f0d){if(this[_0xb646('0x23')][_0x386f0d['uniqueid']]){_[_0xb646('0x3f')](this['channels'][_0x386f0d[_0xb646('0x1e')]],_['pick'](_0x386f0d,[_0xb646('0x40'),_0xb646('0x41')]));}};function updateStatus(_0x23a961){if(_0x23a961[_0xb646('0x42')]){faxMessage['update'](_0x23a961[_0xb646('0x42')],{'failMessage':'SENDING\x20FAILED\x20'})[_0xb646('0x3a')](function(_0x29891e){ut[_0xb646('0x43')](_0xb646('0x44'),_0x29891e);})[_0xb646('0x45')](function(_0x5630c4){ut['logger'](_0xb646('0x46'),_0x5630c4);});}else{ut['logger'](_0xb646('0x47'));}}Fax[_0xb646('0x1a')][_0xb646('0x48')]=function(_0x2635d8,_0x1be914,_0x223914){var _0x420e9e=this;var _0xa7c936={};if(_0x1be914){_0xa7c936={'read':_0x1be914};}else{_0xa7c936={'failMessage':_0x223914};}if(this[_0xb646('0x23')][_0x2635d8]['AttachmentId']){faxMessage[_0xb646('0x49')](this[_0xb646('0x23')][_0x2635d8][_0xb646('0x42')],_0xa7c936)['then'](function(_0x5e3986){ut[_0xb646('0x43')](_0xb646('0x4a'),_0x5e3986);})[_0xb646('0x45')](function(_0x2d8f9b){ut[_0xb646('0x43')](_0xb646('0x4b'),_0x2d8f9b);})[_0xb646('0x4c')](function(){delete _0x420e9e[_0xb646('0xd')][_0x2635d8];delete _0x420e9e[_0xb646('0x23')][_0x2635d8];});}else{ut[_0xb646('0x43')]('[Fax][Message][NoUpdate2]');delete this[_0xb646('0xd')][_0x2635d8];delete this[_0xb646('0x23')][_0x2635d8];}};Fax['prototype']['syncHangup']=function(_0x3e7490){var _0x3c0ecc=this;if(this['channels'][_0x3e7490['uniqueid']]){if(this['actions'][_0x3e7490[_0xb646('0x1e')]]){this[_0xb646('0xd')][_0x3e7490[_0xb646('0x1e')]]['id']=this[_0xb646('0x23')][_0x3e7490[_0xb646('0x1e')]]['id'];this[_0xb646('0xd')][_0x3e7490['uniqueid']]['name']=this['actions'][_0x3e7490[_0xb646('0x1e')]]['name'];}logger['info'](_0x3e7490['uniqueid'],this[_0xb646('0x23')][_0x3e7490[_0xb646('0x1e')]]?'\x20hangup\x20sendFile\x20':_0xb646('0x4d'),JSON['stringify'](this['channels'][_0x3e7490[_0xb646('0x1e')]]));if(this[_0xb646('0x23')][_0x3e7490[_0xb646('0x1e')]]){if(this['channels'][_0x3e7490[_0xb646('0x1e')]]['faxpages']>0x0&&this[_0xb646('0xd')][_0x3e7490[_0xb646('0x1e')]][_0xb646('0x14')]===_0xb646('0x4e')){this[_0xb646('0x48')](_0x3e7490[_0xb646('0x1e')],!![]);}else{this[_0xb646('0x48')](_0x3e7490[_0xb646('0x1e')],![],this[_0xb646('0xd')][_0x3e7490['uniqueid']]['faxstatusstring']?_0xb646('0x4f')+this[_0xb646('0xd')][_0x3e7490[_0xb646('0x1e')]][_0xb646('0x50')]:_0xb646('0x51'));}}}};Fax[_0xb646('0x1a')][_0xb646('0x52')]=function(_0x42e2e9){var _0x142998=this;return new BPromise(function(_0x1b370d,_0x35c3bd){_0x142998['execOriginate'](_0x42e2e9,_0x142998[_0xb646('0xe')][_0x42e2e9[_0xb646('0x53')]])[_0xb646('0x3a')](function(_0x33b0af){ut[_0xb646('0x43')](_0xb646('0x54'),_0x33b0af);_0x1b370d(ut[_0xb646('0x35')](_0xb646('0x55')));})[_0xb646('0x45')](function(_0x4f63f2){ut['logger'](_0xb646('0x56'),_0x4f63f2);updateStatus(_0x42e2e9);_0x35c3bd(ut[_0xb646('0x35')]('Fax\x20failed'));});});};Fax['prototype']['checkAfterSend']=function(_0x5c7c5d){var _0x1cb3e8=this;return new BPromise(function(_0x5a60c2,_0x2e19ce){var _0x104b0c=_0x1cb3e8[_0xb646('0x57')](_0x1cb3e8['faxAccounts'][_0x5c7c5d[_0xb646('0x53')]][_0xb646('0x58')],_0x5c7c5d);if(_0x104b0c[_0xb646('0x59')]){_0x5a60c2(ut[_0xb646('0x35')](_0xb646('0x5a')));}else{_0x2e19ce(ut[_0xb646('0x35')](_0x104b0c['message']));}});};function originate(_0x51ebb5,_0x152bc2,_0xaec81e){return new BPromise(function(_0x323c84,_0x3e1511){if(_0xaec81e){var _0x4acf21=util[_0xb646('0x5b')](_0xb646('0x5c'),path['parse'](_0x51ebb5[_0xb646('0x4')])[_0xb646('0x20')],_0x51ebb5[_0xb646('0x4')]);gs[_0xb646('0x5d')](_0x4acf21)[_0xb646('0x3a')](function(){_0x51ebb5[_0xb646('0x4')]=util[_0xb646('0x5b')](_0xb646('0x5e'),path['parse'](_0x51ebb5['path'])[_0xb646('0x5f')],path['parse'](_0x51ebb5[_0xb646('0x4')])['name']);_0x152bc2['XMF-PATH']=_0x51ebb5[_0xb646('0x4')];ut[_0xb646('0x43')](_0xb646('0x60'),'');ami[_0xb646('0x61')](ut[_0xb646('0x62')](_0x51ebb5,_0x152bc2))[_0xb646('0x3a')](function(_0x2eb371){_0x323c84(_0x2eb371);})['catch'](function(_0x9cf5b3){_0x3e1511(_0x9cf5b3);});})[_0xb646('0x45')](function(_0x49da50){_0x3e1511(_0x49da50);});}else{ami[_0xb646('0x61')](ut[_0xb646('0x62')](_0x51ebb5,_0x152bc2))[_0xb646('0x3a')](function(_0x197b2a){_0x323c84(_0x197b2a);})['catch'](function(_0x5d30c5){_0x3e1511(_0x5d30c5);});}});}Fax[_0xb646('0x1a')][_0xb646('0x63')]=function(_0x50aad5,_0x3880ae){var _0x4d4dde=this;return new BPromise(function(_0x33e5b1,_0x57241f){var _0x1734f7=uuid['v4']();var _0x3268e=ut[_0xb646('0x64')](_0x50aad5,_0x3880ae);_0x4d4dde[_0xb646('0x23')][_0x1734f7]=new Action(_0x1734f7,_0x3880ae,_0x50aad5);var _0x202cb5=_0x4d4dde['actions'][_0x1734f7];if(path['parse'](_0x50aad5['path'])[_0xb646('0x65')]==='.pdf'){originate(_0x202cb5,_0x3268e,!![])[_0xb646('0x3a')](function(_0x2e0bc0){_0x33e5b1(_0x2e0bc0);})[_0xb646('0x45')](function(_0x545da7){_0x57241f(_0x545da7);});}else{originate(_0x202cb5,_0x3268e,![])[_0xb646('0x3a')](function(_0x264f82){_0x33e5b1(_0x264f82);})['catch'](function(_0x44fd65){_0x57241f(_0x44fd65);});}});};Fax['prototype'][_0xb646('0x66')]=function(_0x2b0161){return!_[_0xb646('0x67')](_0x2b0161)&&!_[_0xb646('0x67')](_0x2b0161['name'])&&!_[_0xb646('0x67')](_0x2b0161[_0xb646('0x68')])&&_0x2b0161[_0xb646('0x68')]&&!_[_0xb646('0x67')](this['trunks'][util[_0xb646('0x5b')](_0xb646('0x69'),_0x2b0161['name'])])&&!_[_0xb646('0x67')](this[_0xb646('0xf')][util[_0xb646('0x5b')]('SIP/%s',_0x2b0161['name'])][_0xb646('0x2a')])&&(this[_0xb646('0xf')][util['format']('SIP/%s',_0x2b0161[_0xb646('0x20')])][_0xb646('0x2a')]===_0xb646('0x6a')||this['trunks'][util[_0xb646('0x5b')](_0xb646('0x69'),_0x2b0161[_0xb646('0x20')])][_0xb646('0x2a')]==='unmonitored');};Fax[_0xb646('0x1a')][_0xb646('0x57')]=function(_0x15e98b,_0x835465){if(!this[_0xb646('0x66')](_0x15e98b)){ut['logger'](_0xb646('0x6b'),_[_0xb646('0x67')](_0x15e98b)?'':_0x15e98b[_0xb646('0x20')]+_0xb646('0x6c'));return{'isValid':![],'message':_0xb646('0x6d')};}if(_[_0xb646('0x67')](_0x835465[_0xb646('0x6e')])){ut['logger']('[Fax][checkTrunk][Empty\x20Fax]',JSON['stringify'](_0x835465));return{'isValid':![],'message':'Empty\x20Fax'};}if(_[_0xb646('0x67')](_0x835465[_0xb646('0x4')])){ut[_0xb646('0x43')](_0xb646('0x6f'),JSON[_0xb646('0x3d')](_0x835465));return{'isValid':![],'message':_0xb646('0x70')};}return{'isValid':!![],'message':_0xb646('0x71')};};module[_0xb646('0x72')]=Fax;
\ No newline at end of file
+var _0xbf6c=['syncNewchannel','context','from-voip-provider','exten','localstationid','uniqueid','channel','name','\x20syncNewchannel\x20','info','variable','hasOwnProperty','value','channelstatedesc','operation','status','filename','\x20syncFaxStatus\x20','remotestationid','pagestransferred','resolution','transferrate','calleridnum','\x20result\x20conversion\x20file\x20','message','create','parse','.pdf','application/pdf','notify','error','\x20notify\x20','stringify','catch','\x20receiveFax\x20','merge','pick','reason','update','SENDING\x20FAILED\x20','then','logger','[Fax][Message][Error][NoUpdate2]','[Fax][Message][NoUpdate1]','[Fax][Message][NoUpdate2]','\x20hangup\x20sendFile\x20','\x20hangup\x20faxRiceive\x20','faxpages','faxstatus','updateStatus','faxstatusstring','SENDING\x20FAILED:\x20','send','execOriginate','FaxAccountId','[Fax][execOriginate][success]','Fax\x20failed','checkAfterSend','checkTrunk','Trunk','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','format','dir','XMF-PATH','Convert\x20pdf\x20to\x20tif','variablesAction','Action','addVariables','isTrunkReachable','active','isNil','trunks','SIP/%s','reachable','[Fax][checkTrunk][Trunk\x20not\x20work]','\x20Trunk\x20is\x20not\x20active','Trunk\x20not\x20working','[Fax][checkTrunk][Empty\x20Fax]','Empty\x20Fax','[Fax][checkTrunk][Empty\x20path]','Empty\x20path','util','lodash','uuid','moment','path','tiff2pdf','./util/gs','../../../config/logger','fax','../ami','./action','../rpc/faxAccount','../rpc/attachment','../rpc/faxMessage','channels','faxAccounts','actions','newchannel','varset','syncVarSet','bind','syncNewState','newexten','syncNewExten','syncFaxStatus','receivefax','syncReceiveFax','hangup','originateresponse','prototype'];(function(_0xfbdff6,_0x2af690){var _0x4cb9be=function(_0x4022d8){while(--_0x4022d8){_0xfbdff6['push'](_0xfbdff6['shift']());}};_0x4cb9be(++_0x2af690);}(_0xbf6c,0x1a6));var _0xcbf6=function(_0x4f7196,_0x5371b){_0x4f7196=_0x4f7196-0x0;var _0xfc3c7b=_0xbf6c[_0x4f7196];return _0xfc3c7b;};'use strict';var util=require(_0xcbf6('0x0'));var _=require(_0xcbf6('0x1'));var BPromise=require('bluebird');var uuid=require(_0xcbf6('0x2'));var moment=require(_0xcbf6('0x3'));var path=require(_0xcbf6('0x4'));var tiff2pdf=require(_0xcbf6('0x5'));var gs=require(_0xcbf6('0x6'));var logger=require(_0xcbf6('0x7'))(_0xcbf6('0x8'));var ami=require(_0xcbf6('0x9'));var rpcDb=require('./rpcDb');var Channel=require('./channel');var ut=require('./util/util');var Action=require(_0xcbf6('0xa'));var faxAccount=require(_0xcbf6('0xb'));var attachment=require(_0xcbf6('0xc'));var faxMessage=require(_0xcbf6('0xd'));function Fax(_0x40d87b){this[_0xcbf6('0xe')]={};this['faxAccounts']=_0x40d87b[_0xcbf6('0xf')];this['trunks']=_0x40d87b['trunks'];this[_0xcbf6('0x10')]={};ami['on'](_0xcbf6('0x11'),this['syncNewchannel']['bind'](this));ami['on'](_0xcbf6('0x12'),this[_0xcbf6('0x13')][_0xcbf6('0x14')](this));ami['on']('newstate',this[_0xcbf6('0x15')]['bind'](this));ami['on'](_0xcbf6('0x16'),this[_0xcbf6('0x17')][_0xcbf6('0x14')](this));ami['on']('faxstatus',this[_0xcbf6('0x18')]['bind'](this));ami['on'](_0xcbf6('0x19'),this[_0xcbf6('0x1a')][_0xcbf6('0x14')](this));ami['on'](_0xcbf6('0x1b'),this['syncHangup'][_0xcbf6('0x14')](this));ami['on'](_0xcbf6('0x1c'),this['syncOriginateResponse']['bind'](this));}Fax[_0xcbf6('0x1d')][_0xcbf6('0x1e')]=function(_0x1e2181){if(_0x1e2181[_0xcbf6('0x1f')]===_0xcbf6('0x20')){for(var _0x4cc121 in this[_0xcbf6('0xf')]){if(this[_0xcbf6('0xf')]['hasOwnProperty'](_0x4cc121)){if(_0x1e2181[_0xcbf6('0x21')]===this[_0xcbf6('0xf')][_0x4cc121][_0xcbf6('0x22')]){this['channels'][_0x1e2181[_0xcbf6('0x23')]]={};this[_0xcbf6('0xe')][_0x1e2181[_0xcbf6('0x23')]][_0xcbf6('0x24')]=_0x1e2181[_0xcbf6('0x24')];this[_0xcbf6('0xe')][_0x1e2181[_0xcbf6('0x23')]]['id']=this[_0xcbf6('0xf')][_0x4cc121]['id'];this[_0xcbf6('0xe')][_0x1e2181[_0xcbf6('0x23')]]['name']=this['faxAccounts'][_0x4cc121][_0xcbf6('0x25')];logger['info'](_0x1e2181[_0xcbf6('0x23')],_0xcbf6('0x26'));}}}}if(this[_0xcbf6('0x10')][_0x1e2181['uniqueid']]){this['channels'][_0x1e2181[_0xcbf6('0x23')]]={};this['channels'][_0x1e2181[_0xcbf6('0x23')]][_0xcbf6('0x24')]=_0x1e2181[_0xcbf6('0x24')];logger[_0xcbf6('0x27')](_0x1e2181[_0xcbf6('0x23')],_0xcbf6('0x26'));}};Fax[_0xcbf6('0x1d')][_0xcbf6('0x13')]=function(_0x3c1716){if(this[_0xcbf6('0xe')][_0x3c1716[_0xcbf6('0x23')]]){for(var _0x6f8214 in _0x3c1716[_0xcbf6('0x28')]){if(_0x3c1716[_0xcbf6('0x28')][_0xcbf6('0x29')](_0x6f8214)){this[_0xcbf6('0xe')][_0x3c1716['uniqueid']][_0x6f8214]=_0x3c1716[_0xcbf6('0x2a')];}}}};Fax['prototype'][_0xcbf6('0x15')]=function(_0x32baa1){if(this['channels'][_0x32baa1[_0xcbf6('0x23')]]){this[_0xcbf6('0xe')][_0x32baa1[_0xcbf6('0x23')]]['channelstate']=_0x32baa1['channelstate'];this['channels'][_0x32baa1[_0xcbf6('0x23')]][_0xcbf6('0x2b')]=_0x32baa1['channelstatedesc'];}};Fax[_0xcbf6('0x1d')][_0xcbf6('0x17')]=function(_0x50d702){if(this[_0xcbf6('0xe')][_0x50d702['uniqueid']]){for(var _0x1a84cb in _0x50d702[_0xcbf6('0x28')]){if(_0x50d702['variable']['hasOwnProperty'](_0x1a84cb)){this[_0xcbf6('0xe')][_0x50d702[_0xcbf6('0x23')]][_0x1a84cb]=_0x50d702[_0xcbf6('0x2a')];}}}};Fax[_0xcbf6('0x1d')][_0xcbf6('0x18')]=function(_0xb7a7dc){if(this[_0xcbf6('0xe')][_0xb7a7dc['uniqueid']]){this[_0xcbf6('0xe')][_0xb7a7dc[_0xcbf6('0x23')]]['operation']=_0xb7a7dc[_0xcbf6('0x2c')];this['channels'][_0xb7a7dc[_0xcbf6('0x23')]][_0xcbf6('0x2d')]=_0xb7a7dc['status'];this[_0xcbf6('0xe')][_0xb7a7dc[_0xcbf6('0x23')]]['localstationid']=_0xb7a7dc[_0xcbf6('0x22')];this[_0xcbf6('0xe')][_0xb7a7dc['uniqueid']][_0xcbf6('0x2e')]=_0xb7a7dc['filename'];logger[_0xcbf6('0x27')](_0xb7a7dc[_0xcbf6('0x23')],_0xcbf6('0x2f'));}};Fax['prototype'][_0xcbf6('0x1a')]=function(_0x1445d8){var _0x6be4f0=this;if(this[_0xcbf6('0xe')][_0x1445d8['uniqueid']]){var _0x42e077=this[_0xcbf6('0xe')][_0x1445d8[_0xcbf6('0x23')]]['id'];this['channels'][_0x1445d8[_0xcbf6('0x23')]][_0xcbf6('0x30')]=_0x1445d8[_0xcbf6('0x30')];this[_0xcbf6('0xe')][_0x1445d8[_0xcbf6('0x23')]][_0xcbf6('0x31')]=_0x1445d8['pagestransferred'];this[_0xcbf6('0xe')][_0x1445d8[_0xcbf6('0x23')]][_0xcbf6('0x22')]=_0x1445d8[_0xcbf6('0x22')];this[_0xcbf6('0xe')][_0x1445d8['uniqueid']][_0xcbf6('0x32')]=_0x1445d8[_0xcbf6('0x32')];this[_0xcbf6('0xe')][_0x1445d8['uniqueid']][_0xcbf6('0x33')]=_0x1445d8[_0xcbf6('0x33')];this[_0xcbf6('0xe')][_0x1445d8[_0xcbf6('0x23')]][_0xcbf6('0x2e')]=_0x1445d8['filename'];this['channels'][_0x1445d8[_0xcbf6('0x23')]][_0xcbf6('0x34')]=_0x1445d8[_0xcbf6('0x34')];if(this[_0xcbf6('0xe')][_0x1445d8['uniqueid']][_0xcbf6('0x31')]>0x0){tiff2pdf(_0x1445d8[_0xcbf6('0x2e')],'/var/opt/motion2/server/files/attachments/',function(_0xedc089){logger[_0xcbf6('0x27')](_0x1445d8[_0xcbf6('0x23')],_0xcbf6('0x35'),_0xedc089[_0xcbf6('0x36')]);attachment[_0xcbf6('0x37')]({'name':path[_0xcbf6('0x38')](_0x1445d8['filename'])[_0xcbf6('0x25')],'basename':path[_0xcbf6('0x38')](_0x1445d8[_0xcbf6('0x2e')])[_0xcbf6('0x25')]+_0xcbf6('0x39'),'type':_0xcbf6('0x3a')})['then'](function(_0x5cd722){faxAccount[_0xcbf6('0x3b')](_0x42e077,{'from':_0x1445d8[_0xcbf6('0x34')],'mapKey':_0xcbf6('0x8'),'body':path[_0xcbf6('0x38')](_0x1445d8[_0xcbf6('0x2e')])[_0xcbf6('0x25')]+'.pdf','AttachmentId':_0x5cd722['id']})['catch'](function(_0x4fb7b2){logger[_0xcbf6('0x3c')](_0x1445d8[_0xcbf6('0x23')],_0xcbf6('0x3d'),JSON[_0xcbf6('0x3e')](_0x4fb7b2));});})[_0xcbf6('0x3f')](function(_0x4c610b){logger[_0xcbf6('0x3c')](_0x1445d8[_0xcbf6('0x23')],_0xcbf6('0x40'),JSON[_0xcbf6('0x3e')](_0x4c610b));});});}logger['info'](_0x1445d8[_0xcbf6('0x23')],_0xcbf6('0x40'));}};Fax[_0xcbf6('0x1d')]['syncOriginateResponse']=function(_0x2941d7){if(this['actions'][_0x2941d7[_0xcbf6('0x23')]]){_[_0xcbf6('0x41')](this['channels'][_0x2941d7[_0xcbf6('0x23')]],_[_0xcbf6('0x42')](_0x2941d7,['response',_0xcbf6('0x43')]));}};function updateStatus(_0x4671ae){if(_0x4671ae['AttachmentId']){faxMessage[_0xcbf6('0x44')](_0x4671ae['AttachmentId'],{'failMessage':_0xcbf6('0x45')})[_0xcbf6('0x46')](function(_0x4ba487){ut[_0xcbf6('0x47')]('[Fax][Message][Error][Updated]',_0x4ba487);})[_0xcbf6('0x3f')](function(_0x1394ff){ut[_0xcbf6('0x47')]('[Fax][Message][Error][NoUpdate1]',_0x1394ff);});}else{ut['logger'](_0xcbf6('0x48'));}}Fax[_0xcbf6('0x1d')]['updateStatus']=function(_0x1790bf,_0x5eb748,_0x34a51c){var _0x272ad2=this;var _0x55bc8c={};if(_0x5eb748){_0x55bc8c={'read':_0x5eb748};}else{_0x55bc8c={'failMessage':_0x34a51c};}if(this[_0xcbf6('0x10')][_0x1790bf]['AttachmentId']){faxMessage[_0xcbf6('0x44')](this[_0xcbf6('0x10')][_0x1790bf]['AttachmentId'],_0x55bc8c)['then'](function(_0x5050e0){ut[_0xcbf6('0x47')]('[Fax][Message][Updated]',_0x5050e0);})[_0xcbf6('0x3f')](function(_0x5df064){ut[_0xcbf6('0x47')](_0xcbf6('0x49'),_0x5df064);})['finally'](function(){delete _0x272ad2['channels'][_0x1790bf];delete _0x272ad2[_0xcbf6('0x10')][_0x1790bf];});}else{ut[_0xcbf6('0x47')](_0xcbf6('0x4a'));delete this[_0xcbf6('0xe')][_0x1790bf];delete this[_0xcbf6('0x10')][_0x1790bf];}};Fax[_0xcbf6('0x1d')]['syncHangup']=function(_0x8d52e3){var _0x4eb380=this;if(this[_0xcbf6('0xe')][_0x8d52e3[_0xcbf6('0x23')]]){if(this[_0xcbf6('0x10')][_0x8d52e3[_0xcbf6('0x23')]]){this[_0xcbf6('0xe')][_0x8d52e3[_0xcbf6('0x23')]]['id']=this['actions'][_0x8d52e3['uniqueid']]['id'];this[_0xcbf6('0xe')][_0x8d52e3[_0xcbf6('0x23')]][_0xcbf6('0x25')]=this['actions'][_0x8d52e3[_0xcbf6('0x23')]][_0xcbf6('0x25')];}logger['info'](_0x8d52e3[_0xcbf6('0x23')],this[_0xcbf6('0x10')][_0x8d52e3[_0xcbf6('0x23')]]?_0xcbf6('0x4b'):_0xcbf6('0x4c'),JSON[_0xcbf6('0x3e')](this[_0xcbf6('0xe')][_0x8d52e3[_0xcbf6('0x23')]]));if(this[_0xcbf6('0x10')][_0x8d52e3[_0xcbf6('0x23')]]){if(this[_0xcbf6('0xe')][_0x8d52e3[_0xcbf6('0x23')]][_0xcbf6('0x4d')]>0x0&&this[_0xcbf6('0xe')][_0x8d52e3[_0xcbf6('0x23')]][_0xcbf6('0x4e')]==='SUCCESS'){this[_0xcbf6('0x4f')](_0x8d52e3[_0xcbf6('0x23')],!![]);}else{this[_0xcbf6('0x4f')](_0x8d52e3['uniqueid'],![],this[_0xcbf6('0xe')][_0x8d52e3[_0xcbf6('0x23')]][_0xcbf6('0x50')]?_0xcbf6('0x51')+this[_0xcbf6('0xe')][_0x8d52e3['uniqueid']][_0xcbf6('0x50')]:'SENDING\x20FAILED');}}}};Fax[_0xcbf6('0x1d')][_0xcbf6('0x52')]=function(_0x4ccc75){var _0x551990=this;return new BPromise(function(_0x3454ab,_0x396739){_0x551990[_0xcbf6('0x53')](_0x4ccc75,_0x551990[_0xcbf6('0xf')][_0x4ccc75[_0xcbf6('0x54')]])[_0xcbf6('0x46')](function(_0x50056d){ut[_0xcbf6('0x47')](_0xcbf6('0x55'),_0x50056d);_0x3454ab(ut[_0xcbf6('0x36')]('Fax\x20received'));})['catch'](function(_0xa20a81){ut['logger']('[Fax][execOriginate][failure]',_0xa20a81);updateStatus(_0x4ccc75);_0x396739(ut['message'](_0xcbf6('0x56')));});});};Fax[_0xcbf6('0x1d')][_0xcbf6('0x57')]=function(_0x15a686){var _0x32d49a=this;return new BPromise(function(_0x4b119a,_0x2835ea){var _0x442e3f=_0x32d49a[_0xcbf6('0x58')](_0x32d49a[_0xcbf6('0xf')][_0x15a686[_0xcbf6('0x54')]][_0xcbf6('0x59')],_0x15a686);if(_0x442e3f['isValid']){_0x4b119a(ut['message'](_0xcbf6('0x5a')));}else{_0x2835ea(ut[_0xcbf6('0x36')](_0x442e3f[_0xcbf6('0x36')]));}});};function originate(_0x4333cf,_0x21eee0,_0x33cebe){return new BPromise(function(_0x4aa3f7,_0xfaed1d){if(_0x33cebe){var _0xf3bc61=util['format'](_0xcbf6('0x5b'),path[_0xcbf6('0x38')](_0x4333cf[_0xcbf6('0x4')])[_0xcbf6('0x25')],_0x4333cf[_0xcbf6('0x4')]);gs[_0xcbf6('0x5c')](_0xf3bc61)[_0xcbf6('0x46')](function(){_0x4333cf['path']=util[_0xcbf6('0x5d')]('%s/%s.tif',path[_0xcbf6('0x38')](_0x4333cf[_0xcbf6('0x4')])[_0xcbf6('0x5e')],path[_0xcbf6('0x38')](_0x4333cf['path'])['name']);_0x21eee0[_0xcbf6('0x5f')]=_0x4333cf[_0xcbf6('0x4')];ut[_0xcbf6('0x47')](_0xcbf6('0x60'),'');ami['Action'](ut[_0xcbf6('0x61')](_0x4333cf,_0x21eee0))[_0xcbf6('0x46')](function(_0x5bec98){_0x4aa3f7(_0x5bec98);})[_0xcbf6('0x3f')](function(_0x5713da){_0xfaed1d(_0x5713da);});})[_0xcbf6('0x3f')](function(_0x2ede64){_0xfaed1d(_0x2ede64);});}else{ami[_0xcbf6('0x62')](ut['variablesAction'](_0x4333cf,_0x21eee0))[_0xcbf6('0x46')](function(_0x5de403){_0x4aa3f7(_0x5de403);})[_0xcbf6('0x3f')](function(_0x1983c4){_0xfaed1d(_0x1983c4);});}});}Fax['prototype']['execOriginate']=function(_0x5ab6b0,_0x54eca7){var _0xe31ac7=this;return new BPromise(function(_0xb6c53e,_0x4efd8b){var _0x53bca6=uuid['v4']();var _0x519ab0=ut[_0xcbf6('0x63')](_0x5ab6b0,_0x54eca7);_0xe31ac7[_0xcbf6('0x10')][_0x53bca6]=new Action(_0x53bca6,_0x54eca7,_0x5ab6b0);var _0x396712=_0xe31ac7[_0xcbf6('0x10')][_0x53bca6];if(path['parse'](_0x5ab6b0[_0xcbf6('0x4')])['ext']===_0xcbf6('0x39')){originate(_0x396712,_0x519ab0,!![])[_0xcbf6('0x46')](function(_0x2b3044){_0xb6c53e(_0x2b3044);})['catch'](function(_0x4dc508){_0x4efd8b(_0x4dc508);});}else{originate(_0x396712,_0x519ab0,![])[_0xcbf6('0x46')](function(_0x1579ee){_0xb6c53e(_0x1579ee);})[_0xcbf6('0x3f')](function(_0x8a42da){_0x4efd8b(_0x8a42da);});}});};Fax[_0xcbf6('0x1d')][_0xcbf6('0x64')]=function(_0x364543){return!_['isNil'](_0x364543)&&!_['isNil'](_0x364543['name'])&&!_['isNil'](_0x364543[_0xcbf6('0x65')])&&_0x364543[_0xcbf6('0x65')]&&!_[_0xcbf6('0x66')](this[_0xcbf6('0x67')][util['format'](_0xcbf6('0x68'),_0x364543[_0xcbf6('0x25')])])&&!_[_0xcbf6('0x66')](this[_0xcbf6('0x67')][util[_0xcbf6('0x5d')](_0xcbf6('0x68'),_0x364543[_0xcbf6('0x25')])][_0xcbf6('0x2d')])&&(this[_0xcbf6('0x67')][util[_0xcbf6('0x5d')]('SIP/%s',_0x364543['name'])][_0xcbf6('0x2d')]===_0xcbf6('0x69')||this[_0xcbf6('0x67')][util[_0xcbf6('0x5d')](_0xcbf6('0x68'),_0x364543[_0xcbf6('0x25')])][_0xcbf6('0x2d')]==='unmonitored');};Fax['prototype'][_0xcbf6('0x58')]=function(_0x67e9e0,_0x15683b){if(!this[_0xcbf6('0x64')](_0x67e9e0)){ut[_0xcbf6('0x47')](_0xcbf6('0x6a'),_[_0xcbf6('0x66')](_0x67e9e0)?'':_0x67e9e0[_0xcbf6('0x25')]+_0xcbf6('0x6b'));return{'isValid':![],'message':_0xcbf6('0x6c')};}if(_[_0xcbf6('0x66')](_0x15683b[_0xcbf6('0x8')])){ut['logger'](_0xcbf6('0x6d'),JSON[_0xcbf6('0x3e')](_0x15683b));return{'isValid':![],'message':_0xcbf6('0x6e')};}if(_[_0xcbf6('0x66')](_0x15683b[_0xcbf6('0x4')])){ut[_0xcbf6('0x47')](_0xcbf6('0x6f'),JSON['stringify'](_0x15683b));return{'isValid':![],'message':_0xcbf6('0x70')};}return{'isValid':!![],'message':'Is\x20Valid'};};module['exports']=Fax;
\ No newline at end of file
diff --git a/server/services/ami/fax/rpcDb.js b/server/services/ami/fax/rpcDb.js
index 181f90d..31eed1f 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 _0xc3ce=['resolve','then','catch','[Notify]\x20','util','../../../config/logger','preview','lodash','../rpc/faxAccount','error','inspect','notify'];(function(_0x275c41,_0x54e9c3){var _0x4fd244=function(_0x89a032){while(--_0x89a032){_0x275c41['push'](_0x275c41['shift']());}};_0x4fd244(++_0x54e9c3);}(_0xc3ce,0xdc));var _0xec3c=function(_0x45f8a8,_0x5e9c35){_0x45f8a8=_0x45f8a8-0x0;var _0x52388f=_0xc3ce[_0x45f8a8];return _0x52388f;};'use strict';var util=require(_0xec3c('0x0'));var BPromise=require('bluebird');var logger=require(_0xec3c('0x1'))(_0xec3c('0x2'));var _=require(_0xec3c('0x3'));var faxAccount=require(_0xec3c('0x4'));function loggerCatch(_0x4100bb){return function(_0x1e7f73){logger[_0xec3c('0x5')](_0x4100bb,util[_0xec3c('0x6')](_0x1e7f73,{'showHidden':![],'depth':null}));};}exports[_0xec3c('0x7')]=function(_0x3fff53,_0x4685b3){return BPromise[_0xec3c('0x8')]()[_0xec3c('0x9')](faxAccount[_0xec3c('0x7')](_0x3fff53,_0x4685b3))[_0xec3c('0xa')](loggerCatch(_0xec3c('0xb')));};
\ No newline at end of file
+var _0xf878=['../../../config/logger','preview','lodash','../rpc/faxAccount','inspect','resolve','then','notify','[Notify]\x20','util','bluebird'];(function(_0xe63cd6,_0xee3ea8){var _0x2c418c=function(_0x16a004){while(--_0x16a004){_0xe63cd6['push'](_0xe63cd6['shift']());}};_0x2c418c(++_0xee3ea8);}(_0xf878,0x106));var _0x8f87=function(_0x54c4bf,_0xa4f756){_0x54c4bf=_0x54c4bf-0x0;var _0x59e060=_0xf878[_0x54c4bf];return _0x59e060;};'use strict';var util=require(_0x8f87('0x0'));var BPromise=require(_0x8f87('0x1'));var logger=require(_0x8f87('0x2'))(_0x8f87('0x3'));var _=require(_0x8f87('0x4'));var faxAccount=require(_0x8f87('0x5'));function loggerCatch(_0x30f3c0){return function(_0x288b98){logger['error'](_0x30f3c0,util[_0x8f87('0x6')](_0x288b98,{'showHidden':![],'depth':null}));};}exports['notify']=function(_0x4d47d2,_0x14e2a0){return BPromise[_0x8f87('0x7')]()[_0x8f87('0x8')](faxAccount[_0x8f87('0x9')](_0x4d47d2,_0x14e2a0))['catch'](loggerCatch(_0x8f87('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 92928f1..8703ca2 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 _0x871a=['Exec\x20gs','\x20Error\x20:','bluebird','child_process','exec','execute','info'];(function(_0x3485e5,_0x538eb5){var _0x6779f8=function(_0x3c7a1e){while(--_0x3c7a1e){_0x3485e5['push'](_0x3485e5['shift']());}};_0x6779f8(++_0x538eb5);}(_0x871a,0x144));var _0xa871=function(_0x5d60d1,_0x325ad0){_0x5d60d1=_0x5d60d1-0x0;var _0x5e94a7=_0x871a[_0x5d60d1];return _0x5e94a7;};'use strict';var util=require('util');var logger=require('../../../../config/logger')('fax');var BPromise=require(_0xa871('0x0'));var exec=require(_0xa871('0x1'))[_0xa871('0x2')];exports[_0xa871('0x3')]=function(_0x569020){return new BPromise(function(_0x4b1aef,_0x14a75e){exec(_0x569020,function(_0x4baed7,_0x59ac90,_0x3db785){logger[_0xa871('0x4')](_0xa871('0x5'),_0x59ac90);if(_0x4baed7){logger['info'](_0xa871('0x5'),_0xa871('0x6'),util['inspect'](_0x4baed7,{'showHidden':![],'depth':null}),_0x59ac90,_0x3db785);_0x14a75e(_0x4baed7);}_0x4b1aef(_0x59ac90);});});};
\ No newline at end of file
+var _0x475d=['execute','Exec\x20gs','inspect','util','bluebird','child_process'];(function(_0x21a9d9,_0x4d5ac8){var _0x46adce=function(_0xfdd336){while(--_0xfdd336){_0x21a9d9['push'](_0x21a9d9['shift']());}};_0x46adce(++_0x4d5ac8);}(_0x475d,0x1e9));var _0xd475=function(_0x11b1b3,_0xf3cc69){_0x11b1b3=_0x11b1b3-0x0;var _0x437029=_0x475d[_0x11b1b3];return _0x437029;};'use strict';var util=require(_0xd475('0x0'));var logger=require('../../../../config/logger')('fax');var BPromise=require(_0xd475('0x1'));var exec=require(_0xd475('0x2'))['exec'];exports[_0xd475('0x3')]=function(_0x2537e2){return new BPromise(function(_0x496332,_0x3d9f30){exec(_0x2537e2,function(_0x3db165,_0x135111,_0x5991fe){logger['info'](_0xd475('0x4'),_0x135111);if(_0x3db165){logger['info'](_0xd475('0x4'),'\x20Error\x20:',util[_0xd475('0x5')](_0x3db165,{'showHidden':![],'depth':null}),_0x135111,_0x5991fe);_0x3d9f30(_0x3db165);}_0x496332(_0x135111);});});};
\ 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 77f7d64..f5f9a48 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 _0xb7c8=['logger','info','inspect','addVariables','ecm','headerinfo','minrate','maxrate','format','modem','faxdetect','t38timeout','path','variablesAction','originate','channel','xcally-motion-fax','from-sip','\x22%s\x22\x20<%s>','localstationid','uniqueid','lodash','moment','../../../../config/logger','fax','message'];(function(_0x5775c4,_0x11631c){var _0xa2e3a1=function(_0x3c9a67){while(--_0x3c9a67){_0x5775c4['push'](_0x5775c4['shift']());}};_0xa2e3a1(++_0x11631c);}(_0xb7c8,0x119));var _0x8b7c=function(_0x296eec,_0x2f6c3a){_0x296eec=_0x296eec-0x0;var _0x181fcb=_0xb7c8[_0x296eec];return _0x181fcb;};'use strict';var util=require('util');var _=require(_0x8b7c('0x0'));var moment=require(_0x8b7c('0x1'));var logger=require(_0x8b7c('0x2'))(_0x8b7c('0x3'));exports[_0x8b7c('0x4')]=function(_0x31ad24){return{'message':_0x31ad24};};exports[_0x8b7c('0x5')]=function(_0x50113e,_0x38672b){logger[_0x8b7c('0x6')](_0x50113e,util[_0x8b7c('0x7')](_0x38672b,{'showHidden':![],'depth':null}));};exports[_0x8b7c('0x8')]=function(_0x107428,_0x12665c){var _0x7a3850={'XMF-ECM':_0x12665c[_0x8b7c('0x9')],'XMF-HEADERINFO':_0x12665c[_0x8b7c('0xa')],'XMF-MINRATE':_0x12665c[_0x8b7c('0xb')],'XMF-MAXRATE':_0x12665c[_0x8b7c('0xc')],'XMF-MODEM':util[_0x8b7c('0xd')]('\x22%s\x22',_0x12665c[_0x8b7c('0xe')]),'XMF-GATEWAY':_0x12665c['gateway'],'XMF-FAXDETECT':_0x12665c[_0x8b7c('0xf')],'XMF-T38TIMEOUT':_0x12665c[_0x8b7c('0x10')],'XMF-LOCALSTATIONID':_0x12665c['localstationid'],'XMF-PATH':_0x107428[_0x8b7c('0x11')]};return _0x7a3850;};exports[_0x8b7c('0x12')]=function(_0x3594b1,_0x586826){return{'actionid':_0x3594b1['uniqueid'],'action':_0x8b7c('0x13'),'channel':_0x3594b1[_0x8b7c('0x14')],'Exten':_0x8b7c('0x15'),'Context':_0x8b7c('0x16'),'Priority':'1','callerid':util[_0x8b7c('0xd')](_0x8b7c('0x17'),_0x3594b1[_0x8b7c('0xa')]?_0x3594b1['headerinfo']:'',_0x3594b1[_0x8b7c('0x18')]),'variable':_0x586826,'timeout':0x1e*0x3e8,'async':!![],'channelid':_0x3594b1[_0x8b7c('0x19')]};};
\ No newline at end of file
+var _0xb469=['util','lodash','moment','../../../../config/logger','fax','message','inspect','addVariables','headerinfo','maxrate','format','\x22%s\x22','gateway','t38timeout','path','originate','channel','from-sip','\x22%s\x22\x20<%s>','localstationid','uniqueid'];(function(_0x1f5877,_0x1fa3f8){var _0x7e26c7=function(_0x50f2f1){while(--_0x50f2f1){_0x1f5877['push'](_0x1f5877['shift']());}};_0x7e26c7(++_0x1fa3f8);}(_0xb469,0x13b));var _0x9b46=function(_0x4656df,_0x41a612){_0x4656df=_0x4656df-0x0;var _0x1ff404=_0xb469[_0x4656df];return _0x1ff404;};'use strict';var util=require(_0x9b46('0x0'));var _=require(_0x9b46('0x1'));var moment=require(_0x9b46('0x2'));var logger=require(_0x9b46('0x3'))(_0x9b46('0x4'));exports[_0x9b46('0x5')]=function(_0x9212ae){return{'message':_0x9212ae};};exports['logger']=function(_0x31f853,_0x45322f){logger['info'](_0x31f853,util[_0x9b46('0x6')](_0x45322f,{'showHidden':![],'depth':null}));};exports[_0x9b46('0x7')]=function(_0x50b49e,_0x1b2dd3){var _0x5bd834={'XMF-ECM':_0x1b2dd3['ecm'],'XMF-HEADERINFO':_0x1b2dd3[_0x9b46('0x8')],'XMF-MINRATE':_0x1b2dd3['minrate'],'XMF-MAXRATE':_0x1b2dd3[_0x9b46('0x9')],'XMF-MODEM':util[_0x9b46('0xa')](_0x9b46('0xb'),_0x1b2dd3['modem']),'XMF-GATEWAY':_0x1b2dd3[_0x9b46('0xc')],'XMF-FAXDETECT':_0x1b2dd3['faxdetect'],'XMF-T38TIMEOUT':_0x1b2dd3[_0x9b46('0xd')],'XMF-LOCALSTATIONID':_0x1b2dd3['localstationid'],'XMF-PATH':_0x50b49e[_0x9b46('0xe')]};return _0x5bd834;};exports['variablesAction']=function(_0x672157,_0x233b6b){return{'actionid':_0x672157['uniqueid'],'action':_0x9b46('0xf'),'channel':_0x672157[_0x9b46('0x10')],'Exten':'xcally-motion-fax','Context':_0x9b46('0x11'),'Priority':'1','callerid':util[_0x9b46('0xa')](_0x9b46('0x12'),_0x672157[_0x9b46('0x8')]?_0x672157[_0x9b46('0x8')]:'',_0x672157[_0x9b46('0x13')]),'variable':_0x233b6b,'timeout':0x1e*0x3e8,'async':!![],'channelid':_0x672157[_0x9b46('0x14')]};};
\ No newline at end of file
diff --git a/server/services/ami/index.js b/server/services/ami/index.js
index 3ec1be6..2c058cb 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 _0xe7a0=['./rpc/template','./rpc/integrations/zendesk','./rpc/integrations/salesforce','./rpc/integrations/sugarcrm','./rpc/integrations/freshdesk','./rpc/integrations/zoho','./rpc/integrations/vtiger','./rpc/integrations/freshsales','./rpc/integrations/dynamics365','get','hour','then','getAgents','initAgents','getTelephones','initTelephones','initTrunks','getVoiceQueues','initVoiceQueues','initTemplates','getZendeskAccounts','initZendeskAccounts','getSalesforceAccounts','initSalesforceAccounts','initSugarcrmAccounts','getFreshdeskAccounts','getDeskAccounts','initDeskAccounts','initZohoAccounts','getVtigerAccounts','initFreshsalesAccounts','getServicenowAccounts','getDynamics365Accounts','getCampaigns','initCampaigns','getVoiceExtensions','getFaxAccounts','resolve','getVoiceQueueReports','initVoiceQueueReports','getVoiceQueueHopperHistory','initVoiceQueueHopperHistory','getCampaignHopperHistory','initVoiceCallReports','catch','log','listen','sync','bluebird','util','moment','./server','./realtime','./report','./acw','./trigger','./dialer','./fax','./rpc/user','./rpc/voiceQueue','./rpc/voiceQueueReport','./rpc/trunk','./rpc/trigger'];(function(_0x42cae2,_0x284ef8){var _0x5f256f=function(_0x41abc8){while(--_0x41abc8){_0x42cae2['push'](_0x42cae2['shift']());}};_0x5f256f(++_0x284ef8);}(_0xe7a0,0x6f));var _0x0e7a=function(_0x541f83,_0x5d700d){_0x541f83=_0x541f83-0x0;var _0x386253=_0xe7a0[_0x541f83];return _0x386253;};'use strict';var BPromise=require(_0x0e7a('0x0'));var util=require(_0x0e7a('0x1'));var moment=require(_0x0e7a('0x2'));var server=require(_0x0e7a('0x3'));var Realtime=require(_0x0e7a('0x4'));var Report=require(_0x0e7a('0x5'));var Acw=require(_0x0e7a('0x6'));var Trigger=require(_0x0e7a('0x7'));var Dialer=require(_0x0e7a('0x8'));var Preview=require('./preview');var Fax=require(_0x0e7a('0x9'));var user=require(_0x0e7a('0xa'));var voiceQueue=require(_0x0e7a('0xb'));var voiceQueueReport=require(_0x0e7a('0xc'));var voiceCallReport=require('./rpc/voiceCallReport');var trunk=require(_0x0e7a('0xd'));var trigger=require(_0x0e7a('0xe'));var template=require(_0x0e7a('0xf'));var cmHopperHistory=require('./rpc/cmHopperHistory');var campaign=require('./rpc/campaign');var voiceExtension=require('./rpc/voiceExtension');var faxAccount=require('./rpc/faxAccount');var zendesk=require(_0x0e7a('0x10'));var salesforce=require(_0x0e7a('0x11'));var sugarcrm=require(_0x0e7a('0x12'));var freshdesk=require(_0x0e7a('0x13'));var desk=require('./rpc/integrations/desk');var zoho=require(_0x0e7a('0x14'));var vtiger=require(_0x0e7a('0x15'));var freshsales=require(_0x0e7a('0x16'));var servicenow=require('./rpc/integrations/servicenow');var dynamics365=require(_0x0e7a('0x17'));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()[_0x0e7a('0x18')](_0x0e7a('0x19'))===0x0&&initP){initP=![];isTrue=!![];initParams();}if(moment()[_0x0e7a('0x18')](_0x0e7a('0x19'))===0x1&&isTrue){isTrue=![];initP=!![];}}function initRealtime(){ifMidnight();return BPromise['resolve']()[_0x0e7a('0x1a')](user[_0x0e7a('0x1b')]())[_0x0e7a('0x1a')](realtime[_0x0e7a('0x1c')]())['then'](user[_0x0e7a('0x1d')]())[_0x0e7a('0x1a')](realtime[_0x0e7a('0x1e')]())['then'](trunk['getTrunks']())[_0x0e7a('0x1a')](realtime[_0x0e7a('0x1f')]())[_0x0e7a('0x1a')](voiceQueue[_0x0e7a('0x20')]())[_0x0e7a('0x1a')](realtime[_0x0e7a('0x21')]())[_0x0e7a('0x1a')](trigger['getTriggers']())['then'](realtime['initTriggers']())['then'](template['getTemplates']())[_0x0e7a('0x1a')](realtime[_0x0e7a('0x22')]())[_0x0e7a('0x1a')](zendesk[_0x0e7a('0x23')]())[_0x0e7a('0x1a')](realtime[_0x0e7a('0x24')]())['then'](salesforce[_0x0e7a('0x25')]())[_0x0e7a('0x1a')](realtime[_0x0e7a('0x26')]())[_0x0e7a('0x1a')](sugarcrm['getSugarcrmAccounts']())[_0x0e7a('0x1a')](realtime[_0x0e7a('0x27')]())[_0x0e7a('0x1a')](freshdesk[_0x0e7a('0x28')]())[_0x0e7a('0x1a')](realtime['initFreshdeskAccounts']())[_0x0e7a('0x1a')](desk[_0x0e7a('0x29')]())[_0x0e7a('0x1a')](realtime[_0x0e7a('0x2a')]())[_0x0e7a('0x1a')](zoho['getZohoAccounts']())['then'](realtime[_0x0e7a('0x2b')]())[_0x0e7a('0x1a')](vtiger[_0x0e7a('0x2c')]())['then'](realtime['initVtigerAccounts']())[_0x0e7a('0x1a')](freshsales['getFreshsalesAccounts']())[_0x0e7a('0x1a')](realtime[_0x0e7a('0x2d')]())['then'](servicenow[_0x0e7a('0x2e')]())[_0x0e7a('0x1a')](realtime['initServicenowAccounts']())['then'](dynamics365[_0x0e7a('0x2f')]())['then'](realtime['initDynamics365Accounts']())[_0x0e7a('0x1a')](campaign[_0x0e7a('0x30')]())[_0x0e7a('0x1a')](realtime[_0x0e7a('0x31')]())['then'](voiceExtension[_0x0e7a('0x32')]())[_0x0e7a('0x1a')](realtime['initVoiceExtensions']())[_0x0e7a('0x1a')](faxAccount[_0x0e7a('0x33')]())[_0x0e7a('0x1a')](realtime['initFaxAccounts']())[_0x0e7a('0x1a')](function(){return realtime;});}function initParams(){return BPromise[_0x0e7a('0x34')]()[_0x0e7a('0x1a')](voiceQueueReport[_0x0e7a('0x35')]())[_0x0e7a('0x1a')](realtime[_0x0e7a('0x36')]())['then'](cmHopperHistory[_0x0e7a('0x37')]())[_0x0e7a('0x1a')](realtime[_0x0e7a('0x38')]())[_0x0e7a('0x1a')](cmHopperHistory[_0x0e7a('0x39')]())[_0x0e7a('0x1a')](realtime['initCampaignHopperHistory']())[_0x0e7a('0x1a')](voiceCallReport['getVoiceCallReports']())[_0x0e7a('0x1a')](realtime[_0x0e7a('0x3a')]())[_0x0e7a('0x1a')](function(_0xfdbbb){})[_0x0e7a('0x3b')](function(_0x377336){console[_0x0e7a('0x3c')](_0x377336);});}function main(){return server[_0x0e7a('0x3d')](realtime,preview,fax)[_0x0e7a('0x1a')](function(_0x422514){return initRealtime();})['then'](function(){return initParams();})['then'](function(){report[_0x0e7a('0x3e')]();setInterval(initRealtime,0x1388);})['catch'](function(_0x39d2f7){console[_0x0e7a('0x3c')](_0x39d2f7);});}main();
\ No newline at end of file
+var _0x92b8=['then','getAgents','initAgents','getTelephones','initTelephones','getTrunks','initTrunks','getVoiceQueues','getTriggers','initTriggers','getTemplates','initTemplates','getZendeskAccounts','initZendeskAccounts','initSalesforceAccounts','getSugarcrmAccounts','initFreshdeskAccounts','getDeskAccounts','initDeskAccounts','getZohoAccounts','getVtigerAccounts','initVtigerAccounts','getFreshsalesAccounts','getServicenowAccounts','initServicenowAccounts','getDynamics365Accounts','initDynamics365Accounts','getCampaigns','initCampaigns','getVoiceExtensions','initVoiceExtensions','getVoiceQueueReports','initVoiceQueueReports','getVoiceQueueHopperHistory','initVoiceQueueHopperHistory','initVoiceCallReports','log','listen','sync','catch','moment','./server','./realtime','./acw','./trigger','./preview','./rpc/voiceQueueReport','./rpc/voiceCallReport','./rpc/trunk','./rpc/trigger','./rpc/template','./rpc/integrations/salesforce','./rpc/integrations/sugarcrm','./rpc/integrations/zoho','./rpc/integrations/vtiger','./rpc/integrations/freshsales','./rpc/integrations/servicenow','./rpc/integrations/dynamics365','get','hour','resolve'];(function(_0x3dd15e,_0x1f0015){var _0x231fd0=function(_0x4f680a){while(--_0x4f680a){_0x3dd15e['push'](_0x3dd15e['shift']());}};_0x231fd0(++_0x1f0015);}(_0x92b8,0xa2));var _0x892b=function(_0x569bcc,_0x33bbcf){_0x569bcc=_0x569bcc-0x0;var _0x4b020e=_0x92b8[_0x569bcc];return _0x4b020e;};'use strict';var BPromise=require('bluebird');var util=require('util');var moment=require(_0x892b('0x0'));var server=require(_0x892b('0x1'));var Realtime=require(_0x892b('0x2'));var Report=require('./report');var Acw=require(_0x892b('0x3'));var Trigger=require(_0x892b('0x4'));var Dialer=require('./dialer');var Preview=require(_0x892b('0x5'));var Fax=require('./fax');var user=require('./rpc/user');var voiceQueue=require('./rpc/voiceQueue');var voiceQueueReport=require(_0x892b('0x6'));var voiceCallReport=require(_0x892b('0x7'));var trunk=require(_0x892b('0x8'));var trigger=require(_0x892b('0x9'));var template=require(_0x892b('0xa'));var cmHopperHistory=require('./rpc/cmHopperHistory');var campaign=require('./rpc/campaign');var voiceExtension=require('./rpc/voiceExtension');var faxAccount=require('./rpc/faxAccount');var zendesk=require('./rpc/integrations/zendesk');var salesforce=require(_0x892b('0xb'));var sugarcrm=require(_0x892b('0xc'));var freshdesk=require('./rpc/integrations/freshdesk');var desk=require('./rpc/integrations/desk');var zoho=require(_0x892b('0xd'));var vtiger=require(_0x892b('0xe'));var freshsales=require(_0x892b('0xf'));var servicenow=require(_0x892b('0x10'));var dynamics365=require(_0x892b('0x11'));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()[_0x892b('0x12')](_0x892b('0x13'))===0x0&&initP){initP=![];isTrue=!![];initParams();}if(moment()['get'](_0x892b('0x13'))===0x1&&isTrue){isTrue=![];initP=!![];}}function initRealtime(){ifMidnight();return BPromise[_0x892b('0x14')]()[_0x892b('0x15')](user[_0x892b('0x16')]())[_0x892b('0x15')](realtime[_0x892b('0x17')]())[_0x892b('0x15')](user[_0x892b('0x18')]())['then'](realtime[_0x892b('0x19')]())[_0x892b('0x15')](trunk[_0x892b('0x1a')]())['then'](realtime[_0x892b('0x1b')]())[_0x892b('0x15')](voiceQueue[_0x892b('0x1c')]())[_0x892b('0x15')](realtime['initVoiceQueues']())['then'](trigger[_0x892b('0x1d')]())['then'](realtime[_0x892b('0x1e')]())[_0x892b('0x15')](template[_0x892b('0x1f')]())[_0x892b('0x15')](realtime[_0x892b('0x20')]())[_0x892b('0x15')](zendesk[_0x892b('0x21')]())['then'](realtime[_0x892b('0x22')]())[_0x892b('0x15')](salesforce['getSalesforceAccounts']())['then'](realtime[_0x892b('0x23')]())[_0x892b('0x15')](sugarcrm[_0x892b('0x24')]())[_0x892b('0x15')](realtime['initSugarcrmAccounts']())[_0x892b('0x15')](freshdesk['getFreshdeskAccounts']())[_0x892b('0x15')](realtime[_0x892b('0x25')]())[_0x892b('0x15')](desk[_0x892b('0x26')]())[_0x892b('0x15')](realtime[_0x892b('0x27')]())[_0x892b('0x15')](zoho[_0x892b('0x28')]())['then'](realtime['initZohoAccounts']())[_0x892b('0x15')](vtiger[_0x892b('0x29')]())[_0x892b('0x15')](realtime[_0x892b('0x2a')]())[_0x892b('0x15')](freshsales[_0x892b('0x2b')]())['then'](realtime['initFreshsalesAccounts']())[_0x892b('0x15')](servicenow[_0x892b('0x2c')]())[_0x892b('0x15')](realtime[_0x892b('0x2d')]())[_0x892b('0x15')](dynamics365[_0x892b('0x2e')]())[_0x892b('0x15')](realtime[_0x892b('0x2f')]())[_0x892b('0x15')](campaign[_0x892b('0x30')]())['then'](realtime[_0x892b('0x31')]())[_0x892b('0x15')](voiceExtension[_0x892b('0x32')]())[_0x892b('0x15')](realtime[_0x892b('0x33')]())[_0x892b('0x15')](faxAccount['getFaxAccounts']())[_0x892b('0x15')](realtime['initFaxAccounts']())[_0x892b('0x15')](function(){return realtime;});}function initParams(){return BPromise[_0x892b('0x14')]()[_0x892b('0x15')](voiceQueueReport[_0x892b('0x34')]())['then'](realtime[_0x892b('0x35')]())['then'](cmHopperHistory[_0x892b('0x36')]())['then'](realtime[_0x892b('0x37')]())[_0x892b('0x15')](cmHopperHistory['getCampaignHopperHistory']())[_0x892b('0x15')](realtime['initCampaignHopperHistory']())[_0x892b('0x15')](voiceCallReport['getVoiceCallReports']())[_0x892b('0x15')](realtime[_0x892b('0x38')]())[_0x892b('0x15')](function(_0x2ccd24){})['catch'](function(_0x1eed21){console[_0x892b('0x39')](_0x1eed21);});}function main(){return server[_0x892b('0x3a')](realtime,preview,fax)[_0x892b('0x15')](function(_0x22a02b){return initRealtime();})[_0x892b('0x15')](function(){return initParams();})['then'](function(){report[_0x892b('0x3b')]();setInterval(initRealtime,0x1388);})[_0x892b('0x3c')](function(_0x28b665){console[_0x892b('0x39')](_0x28b665);});}main();
\ No newline at end of file
diff --git a/server/services/ami/model/agent.js b/server/services/ami/model/agent.js
index f37ec6e..96cf7eb 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 _0x9c8d=['format','voiceStatusCallerIdNumber','user:%s','user:save','exports','lodash','util','moment','md5','ioredis','../../../config/environment','redis','localhost','socket.io-emitter','name','email','accountcode','fullname','state','unknown','stateTime','status','address','phone','interface','online','voiceStatus','voiceStatusTime','voiceStatusQueue','onhold','prototype','updateStatusRealtime','toLowerCase','not_inuse','talking','statePause','toNumber'];(function(_0x30b92d,_0x2e9acd){var _0x14b624=function(_0x43b6ce){while(--_0x43b6ce){_0x30b92d['push'](_0x30b92d['shift']());}};_0x14b624(++_0x2e9acd);}(_0x9c8d,0x177));var _0xd9c8=function(_0x5b721a,_0x5df815){_0x5b721a=_0x5b721a-0x0;var _0x3ebea7=_0x9c8d[_0x5b721a];return _0x3ebea7;};'use strict';var _=require(_0xd9c8('0x0'));var util=require(_0xd9c8('0x1'));var moment=require(_0xd9c8('0x2'));var md5=require(_0xd9c8('0x3'));var Redis=require(_0xd9c8('0x4'));var config=require(_0xd9c8('0x5'));config[_0xd9c8('0x6')]=_['defaults'](config[_0xd9c8('0x6')],{'host':_0xd9c8('0x7'),'port':0x18eb});var io=require(_0xd9c8('0x8'))(new Redis(config['redis']));function Agent(_0x45e998){this['id']=_0x45e998['id']||0x0;this[_0xd9c8('0x9')]=_0x45e998[_0xd9c8('0x9')]||'';this[_0xd9c8('0xa')]=_0x45e998[_0xd9c8('0xa')]||'';this['accountcode']=_0x45e998[_0xd9c8('0xb')]||'';this[_0xd9c8('0xc')]=_0x45e998['fullname']||'';this[_0xd9c8('0xd')]=_0xd9c8('0xe');this[_0xd9c8('0xf')]=0x0;this[_0xd9c8('0x10')]='unknown';this[_0xd9c8('0x11')]='';this[_0xd9c8('0x12')]='';this['mobile']='';this[_0xd9c8('0x13')]='';this['online']=_0x45e998[_0xd9c8('0x14')]||![];this[_0xd9c8('0x15')]=_0xd9c8('0xe');this[_0xd9c8('0x16')]=0x0;this['voiceStatusCallerIdNumber']='';this[_0xd9c8('0x17')]='';this[_0xd9c8('0x18')]=![];this['local']=![];this['md5']='';}Agent[_0xd9c8('0x19')][_0xd9c8('0x1a')]=function(_0x2e173e){var _0x3c275e;if(_0x2e173e&&_0x2e173e[_0xd9c8('0xd')]){_0x3c275e=_0x2e173e[_0xd9c8('0xd')][_0xd9c8('0x1b')]();switch(_0x3c275e){case _0xd9c8('0x1c'):_0x3c275e='idle';break;case'inuse':_0x3c275e=_0xd9c8('0x1d');break;}}if(_0x3c275e&&this[_0xd9c8('0x15')]!==_0x3c275e||_0x2e173e[_0xd9c8('0x1e')]){this[_0xd9c8('0x16')]=_[_0xd9c8('0x1f')](moment()[_0xd9c8('0x20')]('x'));}if(_0x3c275e){this[_0xd9c8('0x15')]=_0x3c275e;}var _0xad7723={'id':this['id'],'name':this[_0xd9c8('0x9')],'email':this[_0xd9c8('0xa')],'accountcode':this['accountcode'],'fullname':this[_0xd9c8('0xc')],'state':this['state'],'stateTime':this[_0xd9c8('0xf')],'status':this[_0xd9c8('0x10')],'address':this['address'],'online':this[_0xd9c8('0x14')],'voiceStatus':this[_0xd9c8('0x15')],'voiceStatusTime':this[_0xd9c8('0x16')],'voiceStatusCallerIdNumber':this[_0xd9c8('0x21')],'voiceStatusQueue':this[_0xd9c8('0x17')],'interface':this[_0xd9c8('0x13')],'onhold':this[_0xd9c8('0x18')]};var _0x38a28e=md5(JSON['stringify'](_0xad7723));if(this[_0xd9c8('0x3')]!==_0x38a28e){this['md5']=_0x38a28e;io['to'](util[_0xd9c8('0x20')](_0xd9c8('0x22'),_0xad7723[_0xd9c8('0x9')]))['emit'](_0xd9c8('0x23'),_0xad7723);}};module[_0xd9c8('0x24')]=Agent;
\ No newline at end of file
+var _0xa9fc=['emit','user:save','exports','lodash','util','moment','ioredis','defaults','localhost','socket.io-emitter','redis','name','email','fullname','unknown','stateTime','address','mobile','online','voiceStatus','voiceStatusTime','voiceStatusCallerIdNumber','voiceStatusQueue','onhold','local','updateStatusRealtime','state','toLowerCase','inuse','talking','statePause','toNumber','format','accountcode','status','stringify','md5','user:%s'];(function(_0xfc816d,_0x991e19){var _0x4adc22=function(_0x9b75d2){while(--_0x9b75d2){_0xfc816d['push'](_0xfc816d['shift']());}};_0x4adc22(++_0x991e19);}(_0xa9fc,0x1a5));var _0xca9f=function(_0x888385,_0x9cdc66){_0x888385=_0x888385-0x0;var _0x22d5c2=_0xa9fc[_0x888385];return _0x22d5c2;};'use strict';var _=require(_0xca9f('0x0'));var util=require(_0xca9f('0x1'));var moment=require(_0xca9f('0x2'));var md5=require('md5');var Redis=require(_0xca9f('0x3'));var config=require('../../../config/environment');config['redis']=_[_0xca9f('0x4')](config['redis'],{'host':_0xca9f('0x5'),'port':0x18eb});var io=require(_0xca9f('0x6'))(new Redis(config[_0xca9f('0x7')]));function Agent(_0x23a79c){this['id']=_0x23a79c['id']||0x0;this[_0xca9f('0x8')]=_0x23a79c[_0xca9f('0x8')]||'';this[_0xca9f('0x9')]=_0x23a79c[_0xca9f('0x9')]||'';this['accountcode']=_0x23a79c['accountcode']||'';this[_0xca9f('0xa')]=_0x23a79c[_0xca9f('0xa')]||'';this['state']=_0xca9f('0xb');this[_0xca9f('0xc')]=0x0;this['status']=_0xca9f('0xb');this[_0xca9f('0xd')]='';this['phone']='';this[_0xca9f('0xe')]='';this['interface']='';this[_0xca9f('0xf')]=_0x23a79c[_0xca9f('0xf')]||![];this[_0xca9f('0x10')]=_0xca9f('0xb');this[_0xca9f('0x11')]=0x0;this[_0xca9f('0x12')]='';this[_0xca9f('0x13')]='';this[_0xca9f('0x14')]=![];this[_0xca9f('0x15')]=![];this['md5']='';}Agent['prototype'][_0xca9f('0x16')]=function(_0x4c93b4){var _0x33b195;if(_0x4c93b4&&_0x4c93b4[_0xca9f('0x17')]){_0x33b195=_0x4c93b4[_0xca9f('0x17')][_0xca9f('0x18')]();switch(_0x33b195){case'not_inuse':_0x33b195='idle';break;case _0xca9f('0x19'):_0x33b195=_0xca9f('0x1a');break;}}if(_0x33b195&&this[_0xca9f('0x10')]!==_0x33b195||_0x4c93b4[_0xca9f('0x1b')]){this[_0xca9f('0x11')]=_[_0xca9f('0x1c')](moment()[_0xca9f('0x1d')]('x'));}if(_0x33b195){this[_0xca9f('0x10')]=_0x33b195;}var _0x16123d={'id':this['id'],'name':this['name'],'email':this['email'],'accountcode':this[_0xca9f('0x1e')],'fullname':this[_0xca9f('0xa')],'state':this[_0xca9f('0x17')],'stateTime':this[_0xca9f('0xc')],'status':this[_0xca9f('0x1f')],'address':this[_0xca9f('0xd')],'online':this[_0xca9f('0xf')],'voiceStatus':this['voiceStatus'],'voiceStatusTime':this['voiceStatusTime'],'voiceStatusCallerIdNumber':this[_0xca9f('0x12')],'voiceStatusQueue':this['voiceStatusQueue'],'interface':this['interface'],'onhold':this[_0xca9f('0x14')]};var _0x4c904c=md5(JSON[_0xca9f('0x20')](_0x16123d));if(this['md5']!==_0x4c904c){this[_0xca9f('0x21')]=_0x4c904c;io['to'](util['format'](_0xca9f('0x22'),_0x16123d[_0xca9f('0x8')]))[_0xca9f('0x23')](_0xca9f('0x24'),_0x16123d);}};module[_0xca9f('0x25')]=Agent;
\ No newline at end of file
diff --git a/server/services/ami/model/campaign.js b/server/services/ami/model/campaign.js
index 42d2b9d..bfba8df 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 _0x0713=['limitCalls','dialTimezone','dialGlobalInterval','dialOriginateCallerIdName','dialOriginateCallerIdNumber','dialOriginateTimeout','dialCongestionMaxRetry','dialCongestionRetryFrequency','dialBusyMaxRetry','dialNoAnswerMaxRetry','dialNoAnswerRetryFrequency','dialGlobalMaxRetry','dialOrderByScheduledAt','DESC','dialPrefix','dialRandomLastDigitCallerIdNumber','dialCutDigit','TrunkBackup','Trunk','Interval','SquareProject','dialQueueProject','dialAMDActive','dialAMDInitialSilence','dialAMDGreeting','dialAMDAfterGreetingSilence','dialAMDTotalAnalysisTime','dialAMDBetweenWordsSilence','dialAMDMaximumNumberOfWords','dialAMDSilenceThreshold','dialAMDMaximumWordLength','exports','name','type','campaign','originated','ivrAnswerCallsDay','ivrTotalCallsDays','message','sendMessageOneNotActive','active'];(function(_0x1c7be5,_0x404cee){var _0x245785=function(_0x583125){while(--_0x583125){_0x1c7be5['push'](_0x1c7be5['shift']());}};_0x245785(++_0x404cee);}(_0x0713,0x1ba));var _0x3071=function(_0x3dd15e,_0x1f0015){_0x3dd15e=_0x3dd15e-0x0;var _0x231fd0=_0x0713[_0x3dd15e];return _0x231fd0;};'use strict';function Campaign(_0x4bf247){this['id']=_0x4bf247['id']||0x0;this['name']=_0x4bf247[_0x3071('0x0')]||'';this[_0x3071('0x1')]=_0x4bf247[_0x3071('0x1')]||_0x3071('0x2');this[_0x3071('0x3')]=0x0;this['temp']=0x0;this[_0x3071('0x4')]=0x0;this[_0x3071('0x5')]=0x0;this[_0x3071('0x6')]='';this[_0x3071('0x7')]=!![];this[_0x3071('0x8')]=_0x4bf247[_0x3071('0x8')];this[_0x3071('0x9')]=_0x4bf247[_0x3071('0x9')];this[_0x3071('0xa')]=_0x4bf247[_0x3071('0xa')]||null;this[_0x3071('0xb')]=_0x4bf247[_0x3071('0xb')]?_0x4bf247[_0x3071('0xb')]:null;this['dialOriginateCallerIdName']=_0x4bf247[_0x3071('0xc')];this[_0x3071('0xd')]=_0x4bf247[_0x3071('0xd')];this[_0x3071('0xe')]=_0x4bf247[_0x3071('0xe')]||0x1e;this['dialCongestionMaxRetry']=_0x4bf247[_0x3071('0xf')];this[_0x3071('0x10')]=_0x4bf247[_0x3071('0x10')];this[_0x3071('0x11')]=_0x4bf247[_0x3071('0x11')];this['dialBusyRetryFrequency']=_0x4bf247['dialBusyRetryFrequency'];this[_0x3071('0x12')]=_0x4bf247['dialNoAnswerMaxRetry'];this[_0x3071('0x13')]=_0x4bf247[_0x3071('0x13')];this['dialGlobalMaxRetry']=_0x4bf247[_0x3071('0x14')];this['dialOrderByScheduledAt']=_0x4bf247[_0x3071('0x15')]||_0x3071('0x16');this[_0x3071('0x17')]=_0x4bf247[_0x3071('0x17')]||undefined;this[_0x3071('0x18')]=_0x4bf247[_0x3071('0x18')]||undefined;this[_0x3071('0x19')]=_0x4bf247[_0x3071('0x19')]||undefined;this[_0x3071('0x1a')]=_0x4bf247[_0x3071('0x1a')]?_0x4bf247['TrunkBackup']:undefined;this[_0x3071('0x1b')]=_0x4bf247[_0x3071('0x1b')]?_0x4bf247[_0x3071('0x1b')]:undefined;this[_0x3071('0x1c')]=_0x4bf247[_0x3071('0x1c')]?_0x4bf247[_0x3071('0x1c')]:undefined;this[_0x3071('0x1d')]=_0x4bf247[_0x3071('0x1d')]?_0x4bf247['SquareProject']:undefined;this[_0x3071('0x1e')]=_0x4bf247[_0x3071('0x1d')]?_0x4bf247[_0x3071('0x1d')]['name']:undefined;this[_0x3071('0x1f')]=_0x4bf247['dialAMDActive']||![];this[_0x3071('0x20')]=_0x4bf247[_0x3071('0x20')];this[_0x3071('0x21')]=_0x4bf247[_0x3071('0x21')];this[_0x3071('0x22')]=_0x4bf247[_0x3071('0x22')];this[_0x3071('0x23')]=_0x4bf247[_0x3071('0x23')];this['dialAMDMinWordLength']=_0x4bf247['dialAMDMinWordLength'];this[_0x3071('0x24')]=_0x4bf247[_0x3071('0x24')];this[_0x3071('0x25')]=_0x4bf247[_0x3071('0x25')];this[_0x3071('0x26')]=_0x4bf247[_0x3071('0x26')];this[_0x3071('0x27')]=_0x4bf247[_0x3071('0x27')];}module[_0x3071('0x28')]=Campaign;
\ No newline at end of file
+var _0xb10b=['dialOrderByScheduledAt','DESC','dialPrefix','dialRandomLastDigitCallerIdNumber','dialCutDigit','TrunkBackup','Trunk','Interval','SquareProject','dialQueueProject','dialAMDActive','dialAMDInitialSilence','dialAMDAfterGreetingSilence','dialAMDTotalAnalysisTime','dialAMDMinWordLength','dialAMDBetweenWordsSilence','dialAMDMaximumNumberOfWords','dialAMDSilenceThreshold','name','type','originated','temp','ivrAnswerCallsDay','ivrTotalCallsDays','message','sendMessageOneNotActive','active','limitCalls','dialTimezone','dialGlobalInterval','dialOriginateCallerIdName','dialOriginateCallerIdNumber','dialOriginateTimeout','dialCongestionMaxRetry','dialCongestionRetryFrequency','dialBusyMaxRetry','dialBusyRetryFrequency','dialNoAnswerMaxRetry','dialNoAnswerRetryFrequency','dialGlobalMaxRetry'];(function(_0x2ff6ce,_0x54e97e){var _0x4f18ec=function(_0x53e931){while(--_0x53e931){_0x2ff6ce['push'](_0x2ff6ce['shift']());}};_0x4f18ec(++_0x54e97e);}(_0xb10b,0x12a));var _0xbb10=function(_0x516a58,_0x55347f){_0x516a58=_0x516a58-0x0;var _0x3527f3=_0xb10b[_0x516a58];return _0x3527f3;};'use strict';function Campaign(_0x13ce8d){this['id']=_0x13ce8d['id']||0x0;this['name']=_0x13ce8d[_0xbb10('0x0')]||'';this[_0xbb10('0x1')]=_0x13ce8d[_0xbb10('0x1')]||'campaign';this[_0xbb10('0x2')]=0x0;this[_0xbb10('0x3')]=0x0;this[_0xbb10('0x4')]=0x0;this[_0xbb10('0x5')]=0x0;this[_0xbb10('0x6')]='';this[_0xbb10('0x7')]=!![];this['active']=_0x13ce8d[_0xbb10('0x8')];this[_0xbb10('0x9')]=_0x13ce8d['limitCalls'];this[_0xbb10('0xa')]=_0x13ce8d[_0xbb10('0xa')]||null;this[_0xbb10('0xb')]=_0x13ce8d[_0xbb10('0xb')]?_0x13ce8d[_0xbb10('0xb')]:null;this[_0xbb10('0xc')]=_0x13ce8d[_0xbb10('0xc')];this[_0xbb10('0xd')]=_0x13ce8d['dialOriginateCallerIdNumber'];this['dialOriginateTimeout']=_0x13ce8d[_0xbb10('0xe')]||0x1e;this[_0xbb10('0xf')]=_0x13ce8d[_0xbb10('0xf')];this['dialCongestionRetryFrequency']=_0x13ce8d[_0xbb10('0x10')];this['dialBusyMaxRetry']=_0x13ce8d[_0xbb10('0x11')];this[_0xbb10('0x12')]=_0x13ce8d[_0xbb10('0x12')];this[_0xbb10('0x13')]=_0x13ce8d[_0xbb10('0x13')];this[_0xbb10('0x14')]=_0x13ce8d['dialNoAnswerRetryFrequency'];this[_0xbb10('0x15')]=_0x13ce8d[_0xbb10('0x15')];this[_0xbb10('0x16')]=_0x13ce8d[_0xbb10('0x16')]||_0xbb10('0x17');this[_0xbb10('0x18')]=_0x13ce8d[_0xbb10('0x18')]||undefined;this[_0xbb10('0x19')]=_0x13ce8d[_0xbb10('0x19')]||undefined;this[_0xbb10('0x1a')]=_0x13ce8d['dialCutDigit']||undefined;this[_0xbb10('0x1b')]=_0x13ce8d[_0xbb10('0x1b')]?_0x13ce8d[_0xbb10('0x1b')]:undefined;this[_0xbb10('0x1c')]=_0x13ce8d[_0xbb10('0x1c')]?_0x13ce8d[_0xbb10('0x1c')]:undefined;this[_0xbb10('0x1d')]=_0x13ce8d[_0xbb10('0x1d')]?_0x13ce8d[_0xbb10('0x1d')]:undefined;this[_0xbb10('0x1e')]=_0x13ce8d['SquareProject']?_0x13ce8d[_0xbb10('0x1e')]:undefined;this[_0xbb10('0x1f')]=_0x13ce8d[_0xbb10('0x1e')]?_0x13ce8d[_0xbb10('0x1e')][_0xbb10('0x0')]:undefined;this[_0xbb10('0x20')]=_0x13ce8d['dialAMDActive']||![];this[_0xbb10('0x21')]=_0x13ce8d[_0xbb10('0x21')];this['dialAMDGreeting']=_0x13ce8d['dialAMDGreeting'];this[_0xbb10('0x22')]=_0x13ce8d[_0xbb10('0x22')];this[_0xbb10('0x23')]=_0x13ce8d[_0xbb10('0x23')];this[_0xbb10('0x24')]=_0x13ce8d[_0xbb10('0x24')];this[_0xbb10('0x25')]=_0x13ce8d[_0xbb10('0x25')];this[_0xbb10('0x26')]=_0x13ce8d[_0xbb10('0x26')];this[_0xbb10('0x27')]=_0x13ce8d[_0xbb10('0x27')];this['dialAMDMaximumWordLength']=_0x13ce8d['dialAMDMaximumWordLength'];}module['exports']=Campaign;
\ No newline at end of file
diff --git a/server/services/ami/model/channel.js b/server/services/ami/model/channel.js
index 2946f39..5073ff1 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 _0x2292=['endtime','abandoned','lastapplication','lastdata','billableseconds','holdtime','type','tag','disposition','monitor','monitorFilename','queue','monitors','transferconnectedlinenum','mohtime','exports','starttime','destinationchannel','calleridnum','calleridname','accountcode','context','uniqueid','linkedid','exten','answered','answertime'];(function(_0x37bda4,_0x451f93){var _0x37bfc9=function(_0x2c62c8){while(--_0x2c62c8){_0x37bda4['push'](_0x37bda4['shift']());}};_0x37bfc9(++_0x451f93);}(_0x2292,0x11e));var _0x2229=function(_0x18295b,_0x1c0aea){_0x18295b=_0x18295b-0x0;var _0x59890b=_0x2292[_0x18295b];return _0x59890b;};'use strict';function Channel(){this[_0x2229('0x0')]=null;this['channel']='';this[_0x2229('0x1')]='';this[_0x2229('0x2')]=0x0;this[_0x2229('0x3')]='';this['connectedlinenum']=undefined;this['connectedlinename']=undefined;this[_0x2229('0x4')]=0x0;this[_0x2229('0x5')]='';this[_0x2229('0x6')]=0x0;this[_0x2229('0x7')]=0x0;this[_0x2229('0x8')]=0x0;this[_0x2229('0x9')]=![];this[_0x2229('0xa')]=null;this[_0x2229('0xb')]=null;this['unmanaged']=![];this[_0x2229('0xc')]=![];this[_0x2229('0xd')]='';this[_0x2229('0xe')]='';this['duration']=0x0;this[_0x2229('0xf')]=0x0;this[_0x2229('0x10')]=0x0;this[_0x2229('0x11')]=null;this[_0x2229('0x12')]=null;this[_0x2229('0x13')]=null;this[_0x2229('0x14')]=![];this[_0x2229('0x15')]=null;this[_0x2229('0x16')]=null;this[_0x2229('0x17')]=[];this['transfercalleridnum']=undefined;this[_0x2229('0x18')]=undefined;this[_0x2229('0x19')]=0x0;}module[_0x2229('0x1a')]=Channel;
\ No newline at end of file
+var _0x3aee=['context','exten','answered','answertime','endtime','unmanaged','abandoned','lastdata','billableseconds','holdtime','type','monitorFilename','queue','monitors','transfercalleridnum','transferconnectedlinenum','mohtime','starttime','channel','calleridnum','calleridname','connectedlinenum','connectedlinename','accountcode'];(function(_0x46d137,_0x1321d8){var _0x3096f5=function(_0x56e735){while(--_0x56e735){_0x46d137['push'](_0x46d137['shift']());}};_0x3096f5(++_0x1321d8);}(_0x3aee,0x131));var _0xe3ae=function(_0x191154,_0x56f74c){_0x191154=_0x191154-0x0;var _0x3dcd73=_0x3aee[_0x191154];return _0x3dcd73;};'use strict';function Channel(){this[_0xe3ae('0x0')]=null;this[_0xe3ae('0x1')]='';this['destinationchannel']='';this[_0xe3ae('0x2')]=0x0;this[_0xe3ae('0x3')]='';this[_0xe3ae('0x4')]=undefined;this[_0xe3ae('0x5')]=undefined;this[_0xe3ae('0x6')]=0x0;this[_0xe3ae('0x7')]='';this['uniqueid']=0x0;this['linkedid']=0x0;this[_0xe3ae('0x8')]=0x0;this[_0xe3ae('0x9')]=![];this[_0xe3ae('0xa')]=null;this[_0xe3ae('0xb')]=null;this[_0xe3ae('0xc')]=![];this[_0xe3ae('0xd')]=![];this['lastapplication']='';this[_0xe3ae('0xe')]='';this['duration']=0x0;this[_0xe3ae('0xf')]=0x0;this[_0xe3ae('0x10')]=0x0;this[_0xe3ae('0x11')]=null;this['tag']=null;this['disposition']=null;this['monitor']=![];this[_0xe3ae('0x12')]=null;this[_0xe3ae('0x13')]=null;this[_0xe3ae('0x14')]=[];this[_0xe3ae('0x15')]=undefined;this[_0xe3ae('0x16')]=undefined;this[_0xe3ae('0x17')]=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 78f78ee..2245be3 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 _0x818f=['token','tokenSecret','type','serverUrl','Configurations','exports','name','username','remoteUri','authType','password','consumerKey','consumerSecret'];(function(_0x266f55,_0x2f15c2){var _0xd3ef6d=function(_0x49c418){while(--_0x49c418){_0x266f55['push'](_0x266f55['shift']());}};_0xd3ef6d(++_0x2f15c2);}(_0x818f,0x1da));var _0xf818=function(_0x8e7609,_0x2d3b40){_0x8e7609=_0x8e7609-0x0;var _0x2d2734=_0x818f[_0x8e7609];return _0x2d2734;};'use strict';function DeskAccount(_0x58d3d6){this['id']=_0x58d3d6['id']||0x0;this[_0xf818('0x0')]=_0x58d3d6[_0xf818('0x0')]||'';this[_0xf818('0x1')]=_0x58d3d6[_0xf818('0x1')]||'';this[_0xf818('0x2')]=_0x58d3d6['remoteUri']||'';this[_0xf818('0x3')]=_0x58d3d6[_0xf818('0x3')]||'';this[_0xf818('0x4')]=_0x58d3d6[_0xf818('0x4')]||'';this[_0xf818('0x5')]=_0x58d3d6[_0xf818('0x5')]||'';this[_0xf818('0x6')]=_0x58d3d6[_0xf818('0x6')]||'';this[_0xf818('0x7')]=_0x58d3d6['token']||'';this[_0xf818('0x8')]=_0x58d3d6[_0xf818('0x8')]||'';this[_0xf818('0x9')]=_0x58d3d6['type']||'';this['serverUrl']=_0x58d3d6[_0xf818('0xa')]||'';this[_0xf818('0xb')]=_0x58d3d6[_0xf818('0xb')]||{};}module[_0xf818('0xc')]=DeskAccount;
\ No newline at end of file
+var _0xa992=['token','tokenSecret','type','serverUrl','Configurations','exports','name','username','remoteUri','authType','password','consumerKey','consumerSecret'];(function(_0x3dd15e,_0x1f0015){var _0x231fd0=function(_0x4f680a){while(--_0x4f680a){_0x3dd15e['push'](_0x3dd15e['shift']());}};_0x231fd0(++_0x1f0015);}(_0xa992,0x18c));var _0x2a99=function(_0x491439,_0x50ce14){_0x491439=_0x491439-0x0;var _0x230aa7=_0xa992[_0x491439];return _0x230aa7;};'use strict';function DeskAccount(_0x90172){this['id']=_0x90172['id']||0x0;this[_0x2a99('0x0')]=_0x90172[_0x2a99('0x0')]||'';this[_0x2a99('0x1')]=_0x90172['username']||'';this[_0x2a99('0x2')]=_0x90172[_0x2a99('0x2')]||'';this[_0x2a99('0x3')]=_0x90172[_0x2a99('0x3')]||'';this[_0x2a99('0x4')]=_0x90172[_0x2a99('0x4')]||'';this[_0x2a99('0x5')]=_0x90172[_0x2a99('0x5')]||'';this[_0x2a99('0x6')]=_0x90172[_0x2a99('0x6')]||'';this['token']=_0x90172[_0x2a99('0x7')]||'';this[_0x2a99('0x8')]=_0x90172[_0x2a99('0x8')]||'';this[_0x2a99('0x9')]=_0x90172[_0x2a99('0x9')]||'';this[_0x2a99('0xa')]=_0x90172[_0x2a99('0xa')]||'';this[_0x2a99('0xb')]=_0x90172[_0x2a99('0xb')]||{};}module[_0x2a99('0xc')]=DeskAccount;
\ No newline at end of file
diff --git a/server/services/ami/model/dynamics365Account.js b/server/services/ami/model/dynamics365Account.js
index 24f2f62..4193054 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 _0xaa76=['remoteUri','tenantId','clientId','clientSecret','serverUrl','Configurations','exports','name','password'];(function(_0x16b936,_0x3ed763){var _0x12dace=function(_0x5f5ded){while(--_0x5f5ded){_0x16b936['push'](_0x16b936['shift']());}};_0x12dace(++_0x3ed763);}(_0xaa76,0x1ed));var _0x6aa7=function(_0xa6b59e,_0x474cd8){_0xa6b59e=_0xa6b59e-0x0;var _0x4a2fa3=_0xaa76[_0xa6b59e];return _0x4a2fa3;};'use strict';function Dynamics365Account(_0x4f102c){this['id']=_0x4f102c['id']||0x0;this[_0x6aa7('0x0')]=_0x4f102c[_0x6aa7('0x0')]||'';this['username']=_0x4f102c['username']||'';this[_0x6aa7('0x1')]=_0x4f102c['password']||'';this[_0x6aa7('0x2')]=_0x4f102c[_0x6aa7('0x2')]||'';this['tenantId']=_0x4f102c[_0x6aa7('0x3')]||'';this[_0x6aa7('0x4')]=_0x4f102c[_0x6aa7('0x4')]||'';this[_0x6aa7('0x5')]=_0x4f102c[_0x6aa7('0x5')]||{};this['serverUrl']=_0x4f102c[_0x6aa7('0x6')]||'';this[_0x6aa7('0x7')]=_0x4f102c[_0x6aa7('0x7')]||{};}module[_0x6aa7('0x8')]=Dynamics365Account;
\ No newline at end of file
+var _0x79df=['exports','name','username','password','remoteUri','tenantId','clientId','clientSecret','serverUrl','Configurations'];(function(_0x29ac27,_0x525d68){var _0x3d7230=function(_0x3d3a16){while(--_0x3d3a16){_0x29ac27['push'](_0x29ac27['shift']());}};_0x3d7230(++_0x525d68);}(_0x79df,0xc9));var _0xf79d=function(_0x295a9a,_0x2fd84c){_0x295a9a=_0x295a9a-0x0;var _0x3655d5=_0x79df[_0x295a9a];return _0x3655d5;};'use strict';function Dynamics365Account(_0xe8070){this['id']=_0xe8070['id']||0x0;this[_0xf79d('0x0')]=_0xe8070[_0xf79d('0x0')]||'';this[_0xf79d('0x1')]=_0xe8070['username']||'';this[_0xf79d('0x2')]=_0xe8070['password']||'';this[_0xf79d('0x3')]=_0xe8070['remoteUri']||'';this[_0xf79d('0x4')]=_0xe8070[_0xf79d('0x4')]||'';this[_0xf79d('0x5')]=_0xe8070[_0xf79d('0x5')]||'';this[_0xf79d('0x6')]=_0xe8070[_0xf79d('0x6')]||{};this[_0xf79d('0x7')]=_0xe8070[_0xf79d('0x7')]||'';this[_0xf79d('0x8')]=_0xe8070[_0xf79d('0x8')]||{};}module[_0xf79d('0x9')]=Dynamics365Account;
\ No newline at end of file
diff --git a/server/services/ami/model/faxAccount.js b/server/services/ami/model/faxAccount.js
index 74c696c..36e6cff 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 _0x8135=['ListId','key','exports','name','description','ecm','localstationid','minrate','maxrate','modem','gateway','faxdetect','t38timeout','tech','SIP','Trunk'];(function(_0x47ff3f,_0x6b1b2f){var _0x1fcd1a=function(_0x3af66a){while(--_0x3af66a){_0x47ff3f['push'](_0x47ff3f['shift']());}};_0x1fcd1a(++_0x6b1b2f);}(_0x8135,0x73));var _0x5813=function(_0x390316,_0xb5685b){_0x390316=_0x390316-0x0;var _0x2aca01=_0x8135[_0x390316];return _0x2aca01;};'use strict';function FaxAccount(_0x5c70fb){this['id']=_0x5c70fb['id']||0x0;this[_0x5813('0x0')]=_0x5c70fb['name']||'';this[_0x5813('0x1')]=_0x5c70fb[_0x5813('0x1')];this[_0x5813('0x2')]=_0x5c70fb[_0x5813('0x2')];this['headerinfo']=_0x5c70fb['headerinfo'];this[_0x5813('0x3')]=_0x5c70fb[_0x5813('0x3')];this[_0x5813('0x4')]=_0x5c70fb[_0x5813('0x4')]||0x960;this['maxrate']=_0x5c70fb[_0x5813('0x5')]||0x3840;this[_0x5813('0x6')]=_0x5c70fb[_0x5813('0x6')]||'v17,v27,v29';this[_0x5813('0x7')]=_0x5c70fb['gateway']||'no';this['faxdetect']=_0x5c70fb[_0x5813('0x8')]||'no';this[_0x5813('0x9')]=_0x5c70fb[_0x5813('0x9')]||0x1388;this[_0x5813('0xa')]=_0x5c70fb[_0x5813('0xa')]||_0x5813('0xb');this[_0x5813('0xc')]=_0x5c70fb['Trunk']?_0x5c70fb[_0x5813('0xc')]:undefined;this['ListId']=_0x5c70fb[_0x5813('0xd')];this[_0x5813('0xe')]=_0x5c70fb['key'];}module[_0x5813('0xf')]=FaxAccount;
\ No newline at end of file
+var _0x4f9a=['modem','v17,v27,v29','gateway','faxdetect','t38timeout','tech','SIP','Trunk','ListId','key','exports','name','description','ecm','headerinfo','localstationid','minrate','maxrate'];(function(_0x2642cb,_0x4b917f){var _0xe6e41=function(_0x281676){while(--_0x281676){_0x2642cb['push'](_0x2642cb['shift']());}};_0xe6e41(++_0x4b917f);}(_0x4f9a,0xd1));var _0xa4f9=function(_0x4cc89d,_0x5bc1cf){_0x4cc89d=_0x4cc89d-0x0;var _0x5764f6=_0x4f9a[_0x4cc89d];return _0x5764f6;};'use strict';function FaxAccount(_0x264f92){this['id']=_0x264f92['id']||0x0;this[_0xa4f9('0x0')]=_0x264f92[_0xa4f9('0x0')]||'';this[_0xa4f9('0x1')]=_0x264f92[_0xa4f9('0x1')];this['ecm']=_0x264f92[_0xa4f9('0x2')];this['headerinfo']=_0x264f92[_0xa4f9('0x3')];this[_0xa4f9('0x4')]=_0x264f92[_0xa4f9('0x4')];this[_0xa4f9('0x5')]=_0x264f92[_0xa4f9('0x5')]||0x960;this[_0xa4f9('0x6')]=_0x264f92[_0xa4f9('0x6')]||0x3840;this['modem']=_0x264f92[_0xa4f9('0x7')]||_0xa4f9('0x8');this[_0xa4f9('0x9')]=_0x264f92['gateway']||'no';this[_0xa4f9('0xa')]=_0x264f92[_0xa4f9('0xa')]||'no';this[_0xa4f9('0xb')]=_0x264f92[_0xa4f9('0xb')]||0x1388;this[_0xa4f9('0xc')]=_0x264f92[_0xa4f9('0xc')]||_0xa4f9('0xd');this[_0xa4f9('0xe')]=_0x264f92[_0xa4f9('0xe')]?_0x264f92[_0xa4f9('0xe')]:undefined;this[_0xa4f9('0xf')]=_0x264f92['ListId'];this[_0xa4f9('0x10')]=_0x264f92[_0xa4f9('0x10')];}module[_0xa4f9('0x11')]=FaxAccount;
\ No newline at end of file
diff --git a/server/services/ami/model/freshdeskAccount.js b/server/services/ami/model/freshdeskAccount.js
index e256f18..f85341e 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 _0x5dd0=['username','apiKey','token','remoteUri','Configurations','exports','name'];(function(_0x3aba7b,_0x1b71ad){var _0x412f91=function(_0x1529c7){while(--_0x1529c7){_0x3aba7b['push'](_0x3aba7b['shift']());}};_0x412f91(++_0x1b71ad);}(_0x5dd0,0x156));var _0x05dd=function(_0x57b54c,_0x54ce0d){_0x57b54c=_0x57b54c-0x0;var _0x59cc19=_0x5dd0[_0x57b54c];return _0x59cc19;};'use strict';function FreshdeskAccount(_0x44af5c){this['id']=_0x44af5c['id']||0x0;this['name']=_0x44af5c[_0x05dd('0x0')]||'';this[_0x05dd('0x1')]=_0x44af5c[_0x05dd('0x1')]||'';this[_0x05dd('0x2')]=_0x44af5c[_0x05dd('0x3')]||'';this['remoteUri']=_0x44af5c[_0x05dd('0x4')]||'';this['serverUrl']=_0x44af5c['serverUrl']||'';this[_0x05dd('0x5')]=_0x44af5c[_0x05dd('0x5')]||{};}module[_0x05dd('0x6')]=FreshdeskAccount;
\ No newline at end of file
+var _0xece5=['token','remoteUri','serverUrl','Configurations','name','username'];(function(_0x596712,_0x52a01e){var _0x164810=function(_0x19508b){while(--_0x19508b){_0x596712['push'](_0x596712['shift']());}};_0x164810(++_0x52a01e);}(_0xece5,0x1ea));var _0x5ece=function(_0x8c43de,_0x90ff31){_0x8c43de=_0x8c43de-0x0;var _0xa6591b=_0xece5[_0x8c43de];return _0xa6591b;};'use strict';function FreshdeskAccount(_0x35b585){this['id']=_0x35b585['id']||0x0;this['name']=_0x35b585[_0x5ece('0x0')]||'';this[_0x5ece('0x1')]=_0x35b585[_0x5ece('0x1')]||'';this['apiKey']=_0x35b585[_0x5ece('0x2')]||'';this[_0x5ece('0x3')]=_0x35b585[_0x5ece('0x3')]||'';this[_0x5ece('0x4')]=_0x35b585['serverUrl']||'';this[_0x5ece('0x5')]=_0x35b585['Configurations']||{};}module['exports']=FreshdeskAccount;
\ No newline at end of file
diff --git a/server/services/ami/model/freshsalesAccount.js b/server/services/ami/model/freshsalesAccount.js
index df6944e..2566223 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 _0x50bd=['serverUrl','Configurations','exports','name','username','apiKey','remoteUri'];(function(_0x7d578d,_0x34279f){var _0x1c2290=function(_0x116ec5){while(--_0x116ec5){_0x7d578d['push'](_0x7d578d['shift']());}};_0x1c2290(++_0x34279f);}(_0x50bd,0x1ed));var _0xd50b=function(_0x122142,_0x17ecc7){_0x122142=_0x122142-0x0;var _0x331697=_0x50bd[_0x122142];return _0x331697;};'use strict';function FreshsalesAccount(_0x42b68d){this['id']=_0x42b68d['id']||0x0;this[_0xd50b('0x0')]=_0x42b68d[_0xd50b('0x0')]||'';this[_0xd50b('0x1')]=_0x42b68d[_0xd50b('0x1')]||'';this[_0xd50b('0x2')]=_0x42b68d['token']||'';this[_0xd50b('0x3')]=_0x42b68d[_0xd50b('0x3')]||'';this['serverUrl']=_0x42b68d[_0xd50b('0x4')]||'';this[_0xd50b('0x5')]=_0x42b68d[_0xd50b('0x5')]||{};}module[_0xd50b('0x6')]=FreshsalesAccount;
\ No newline at end of file
+var _0xe3b7=['remoteUri','serverUrl','Configurations','exports','name','username','token'];(function(_0x34b7ef,_0x1a42f8){var _0x12f9b0=function(_0x2628f0){while(--_0x2628f0){_0x34b7ef['push'](_0x34b7ef['shift']());}};_0x12f9b0(++_0x1a42f8);}(_0xe3b7,0x17e));var _0x7e3b=function(_0x409353,_0xe9f04d){_0x409353=_0x409353-0x0;var _0x4f4b59=_0xe3b7[_0x409353];return _0x4f4b59;};'use strict';function FreshsalesAccount(_0x14ee77){this['id']=_0x14ee77['id']||0x0;this[_0x7e3b('0x0')]=_0x14ee77[_0x7e3b('0x0')]||'';this[_0x7e3b('0x1')]=_0x14ee77[_0x7e3b('0x1')]||'';this['apiKey']=_0x14ee77[_0x7e3b('0x2')]||'';this[_0x7e3b('0x3')]=_0x14ee77[_0x7e3b('0x3')]||'';this[_0x7e3b('0x4')]=_0x14ee77[_0x7e3b('0x4')]||'';this[_0x7e3b('0x5')]=_0x14ee77[_0x7e3b('0x5')]||{};}module[_0x7e3b('0x6')]=FreshsalesAccount;
\ No newline at end of file
diff --git a/server/services/ami/model/queueReport.js b/server/services/ami/model/queueReport.js
index 6f68643..8f8fd0a 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 _0xc809=['inbound','uniqueid','calleridnum','calleridname','queue','queuecallerleaveAt','position','queuecallerabandonAt','queuecallercomplete','queuecallercompleteAt','queuecallerexit','queuecallerexitAt','originalposition','connectedlinename','accountcode','context','exten','holdtime','assigned','lastAssignedTo','mohtime','variables','exports','type'];(function(_0x3a531d,_0x896bfd){var _0x28649e=function(_0x3a5d77){while(--_0x3a5d77){_0x3a531d['push'](_0x3a531d['shift']());}};_0x28649e(++_0x896bfd);}(_0xc809,0x107));var _0x9c80=function(_0x403faa,_0x2e0d7b){_0x403faa=_0x403faa-0x0;var _0x1bf60d=_0xc809[_0x403faa];return _0x1bf60d;};'use strict';function QueueReport(){this[_0x9c80('0x0')]=_0x9c80('0x1');this[_0x9c80('0x2')]='';this[_0x9c80('0x3')]='';this[_0x9c80('0x4')]='';this[_0x9c80('0x5')]='';this['queuecallerjoinAt']=null;this[_0x9c80('0x6')]=null;this[_0x9c80('0x7')]=0x1;this['count']=0x1;this['queuecallerabandon']=![];this[_0x9c80('0x8')]=null;this[_0x9c80('0x9')]=![];this[_0x9c80('0xa')]=null;this[_0x9c80('0xb')]=![];this[_0x9c80('0xc')]=null;this[_0x9c80('0xd')]=0x1;this['channel']='';this['connectedlinenum']='';this[_0x9c80('0xe')]='';this[_0x9c80('0xf')]='';this[_0x9c80('0x10')]='';this[_0x9c80('0x11')]='';this['priority']='';this[_0x9c80('0x12')]=0x0;this[_0x9c80('0x13')]=![];this[_0x9c80('0x14')]='';this[_0x9c80('0x15')]=0x0;this[_0x9c80('0x16')]={};}module[_0x9c80('0x17')]=QueueReport;
\ No newline at end of file
+var _0xeaab=['queuecallerleaveAt','position','count','queuecallerabandon','queuecallerabandonAt','queuecallercomplete','queuecallerexit','queuecallerexitAt','originalposition','channel','connectedlinenum','connectedlinename','accountcode','context','exten','priority','holdtime','assigned','lastAssignedTo','mohtime','exports','type','inbound','calleridnum','calleridname','queue'];(function(_0x4ad7f7,_0xf0d103){var _0x54bfee=function(_0x5d715c){while(--_0x5d715c){_0x4ad7f7['push'](_0x4ad7f7['shift']());}};_0x54bfee(++_0xf0d103);}(_0xeaab,0x14d));var _0xbeaa=function(_0xa464c9,_0x7c86d8){_0xa464c9=_0xa464c9-0x0;var _0x3d73c4=_0xeaab[_0xa464c9];return _0x3d73c4;};'use strict';function QueueReport(){this[_0xbeaa('0x0')]=_0xbeaa('0x1');this['uniqueid']='';this[_0xbeaa('0x2')]='';this[_0xbeaa('0x3')]='';this[_0xbeaa('0x4')]='';this['queuecallerjoinAt']=null;this[_0xbeaa('0x5')]=null;this[_0xbeaa('0x6')]=0x1;this[_0xbeaa('0x7')]=0x1;this[_0xbeaa('0x8')]=![];this[_0xbeaa('0x9')]=null;this[_0xbeaa('0xa')]=![];this['queuecallercompleteAt']=null;this[_0xbeaa('0xb')]=![];this[_0xbeaa('0xc')]=null;this[_0xbeaa('0xd')]=0x1;this[_0xbeaa('0xe')]='';this[_0xbeaa('0xf')]='';this[_0xbeaa('0x10')]='';this[_0xbeaa('0x11')]='';this[_0xbeaa('0x12')]='';this[_0xbeaa('0x13')]='';this[_0xbeaa('0x14')]='';this[_0xbeaa('0x15')]=0x0;this[_0xbeaa('0x16')]=![];this[_0xbeaa('0x17')]='';this[_0xbeaa('0x18')]=0x0;this['variables']={};}module[_0xbeaa('0x19')]=QueueReport;
\ No newline at end of file
diff --git a/server/services/ami/model/salesforceAccount.js b/server/services/ami/model/salesforceAccount.js
index 6997a29..add8fd9 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 _0xacb5=['integrationTab','serverUrl','exports','name','username','remoteUri','password','clientId','clientSecret','securityToken','type'];(function(_0x2e7698,_0x2d1bb8){var _0x438792=function(_0x1ebc69){while(--_0x1ebc69){_0x2e7698['push'](_0x2e7698['shift']());}};_0x438792(++_0x2d1bb8);}(_0xacb5,0x1d1));var _0x5acb=function(_0x5706fb,_0xacfe3c){_0x5706fb=_0x5706fb-0x0;var _0x21799d=_0xacb5[_0x5706fb];return _0x21799d;};'use strict';function SalesforceAccount(_0x3fa15e){this['id']=_0x3fa15e['id']||0x0;this[_0x5acb('0x0')]=_0x3fa15e[_0x5acb('0x0')]||'';this[_0x5acb('0x1')]=_0x3fa15e['username']||'';this[_0x5acb('0x2')]=_0x3fa15e[_0x5acb('0x2')]||'';this[_0x5acb('0x3')]=_0x3fa15e['password']||'';this[_0x5acb('0x4')]=_0x3fa15e[_0x5acb('0x4')]||'';this[_0x5acb('0x5')]=_0x3fa15e[_0x5acb('0x5')]||'';this[_0x5acb('0x6')]=_0x3fa15e['securityToken']||'';this[_0x5acb('0x7')]=_0x3fa15e[_0x5acb('0x7')]||_0x5acb('0x8');this[_0x5acb('0x9')]=_0x3fa15e['serverUrl']||'';this['Configurations']=_0x3fa15e['Configurations']||{};}module[_0x5acb('0xa')]=SalesforceAccount;
\ No newline at end of file
+var _0xefc9=['remoteUri','password','clientId','clientSecret','securityToken','type','serverUrl','Configurations','exports','name','username'];(function(_0x20a584,_0xe384a5){var _0x4b41a8=function(_0x2127c6){while(--_0x2127c6){_0x20a584['push'](_0x20a584['shift']());}};_0x4b41a8(++_0xe384a5);}(_0xefc9,0x1ed));var _0x9efc=function(_0x5c4e78,_0x240beb){_0x5c4e78=_0x5c4e78-0x0;var _0x1957a6=_0xefc9[_0x5c4e78];return _0x1957a6;};'use strict';function SalesforceAccount(_0x5ca4c9){this['id']=_0x5ca4c9['id']||0x0;this[_0x9efc('0x0')]=_0x5ca4c9[_0x9efc('0x0')]||'';this[_0x9efc('0x1')]=_0x5ca4c9[_0x9efc('0x1')]||'';this[_0x9efc('0x2')]=_0x5ca4c9[_0x9efc('0x2')]||'';this[_0x9efc('0x3')]=_0x5ca4c9[_0x9efc('0x3')]||'';this[_0x9efc('0x4')]=_0x5ca4c9[_0x9efc('0x4')]||'';this[_0x9efc('0x5')]=_0x5ca4c9[_0x9efc('0x5')]||'';this[_0x9efc('0x6')]=_0x5ca4c9[_0x9efc('0x6')]||'';this['type']=_0x5ca4c9[_0x9efc('0x7')]||'integrationTab';this[_0x9efc('0x8')]=_0x5ca4c9[_0x9efc('0x8')]||'';this[_0x9efc('0x9')]=_0x5ca4c9['Configurations']||{};}module[_0x9efc('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 fbad339..65f15df 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 _0x35dc=['password','remoteUri','serverUrl','Configurations','exports','name','username'];(function(_0x5d4607,_0x6b5e7b){var _0x5e4a86=function(_0x46891a){while(--_0x46891a){_0x5d4607['push'](_0x5d4607['shift']());}};_0x5e4a86(++_0x6b5e7b);}(_0x35dc,0x12b));var _0xc35d=function(_0x321bb2,_0x202794){_0x321bb2=_0x321bb2-0x0;var _0x9c12ed=_0x35dc[_0x321bb2];return _0x9c12ed;};'use strict';function ServicenowAccount(_0x2e4430){this['id']=_0x2e4430['id']||0x0;this[_0xc35d('0x0')]=_0x2e4430[_0xc35d('0x0')]||'';this['username']=_0x2e4430[_0xc35d('0x1')]||'';this['password']=_0x2e4430[_0xc35d('0x2')]||'';this[_0xc35d('0x3')]=_0x2e4430[_0xc35d('0x3')]||'';this[_0xc35d('0x4')]=_0x2e4430['serverUrl']||'';this[_0xc35d('0x5')]=_0x2e4430[_0xc35d('0x5')]||{};}module[_0xc35d('0x6')]=ServicenowAccount;
\ No newline at end of file
+var _0x61e0=['password','remoteUri','serverUrl','Configurations','exports','name','username'];(function(_0x1a18a2,_0x28e00d){var _0x598eb0=function(_0x2cd4b8){while(--_0x2cd4b8){_0x1a18a2['push'](_0x1a18a2['shift']());}};_0x598eb0(++_0x28e00d);}(_0x61e0,0xc2));var _0x061e=function(_0x29e8ff,_0x15353b){_0x29e8ff=_0x29e8ff-0x0;var _0x334fab=_0x61e0[_0x29e8ff];return _0x334fab;};'use strict';function ServicenowAccount(_0x8d5e8b){this['id']=_0x8d5e8b['id']||0x0;this[_0x061e('0x0')]=_0x8d5e8b[_0x061e('0x0')]||'';this[_0x061e('0x1')]=_0x8d5e8b[_0x061e('0x1')]||'';this[_0x061e('0x2')]=_0x8d5e8b['password']||'';this[_0x061e('0x3')]=_0x8d5e8b['remoteUri']||'';this[_0x061e('0x4')]=_0x8d5e8b[_0x061e('0x4')]||'';this[_0x061e('0x5')]=_0x8d5e8b[_0x061e('0x5')]||{};}module[_0x061e('0x6')]=ServicenowAccount;
\ No newline at end of file
diff --git a/server/services/ami/model/sugarcrmAccount.js b/server/services/ami/model/sugarcrmAccount.js
index 04dc6ae..2e5f5f7 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 _0xf3aa=['password','remoteUri','serverUrl','Configurations','name','username'];(function(_0x4001ad,_0x1e22dd){var _0x4c7ec2=function(_0x24cb8a){while(--_0x24cb8a){_0x4001ad['push'](_0x4001ad['shift']());}};_0x4c7ec2(++_0x1e22dd);}(_0xf3aa,0x1a8));var _0xaf3a=function(_0x22bee0,_0x412ecb){_0x22bee0=_0x22bee0-0x0;var _0x2d295b=_0xf3aa[_0x22bee0];return _0x2d295b;};'use strict';function SugarcrmAccount(_0x478fc5){this['id']=_0x478fc5['id']||0x0;this[_0xaf3a('0x0')]=_0x478fc5[_0xaf3a('0x0')]||'';this['username']=_0x478fc5[_0xaf3a('0x1')]||'';this['password']=_0x478fc5[_0xaf3a('0x2')]||'';this[_0xaf3a('0x3')]=_0x478fc5[_0xaf3a('0x3')]||'';this[_0xaf3a('0x4')]=_0x478fc5[_0xaf3a('0x4')]||'';this[_0xaf3a('0x5')]=_0x478fc5[_0xaf3a('0x5')]||{};}module['exports']=SugarcrmAccount;
\ No newline at end of file
+var _0x30bd=['username','remoteUri','serverUrl','Configurations','exports','name'];(function(_0x5effd0,_0x810199){var _0x2e3a15=function(_0x2190ea){while(--_0x2190ea){_0x5effd0['push'](_0x5effd0['shift']());}};_0x2e3a15(++_0x810199);}(_0x30bd,0x6b));var _0xd30b=function(_0x589573,_0x2f2a57){_0x589573=_0x589573-0x0;var _0x6b908b=_0x30bd[_0x589573];return _0x6b908b;};'use strict';function SugarcrmAccount(_0x5c6a44){this['id']=_0x5c6a44['id']||0x0;this[_0xd30b('0x0')]=_0x5c6a44[_0xd30b('0x0')]||'';this[_0xd30b('0x1')]=_0x5c6a44[_0xd30b('0x1')]||'';this['password']=_0x5c6a44['password']||'';this[_0xd30b('0x2')]=_0x5c6a44[_0xd30b('0x2')]||'';this[_0xd30b('0x3')]=_0x5c6a44[_0xd30b('0x3')]||'';this[_0xd30b('0x4')]=_0x5c6a44[_0xd30b('0x4')]||{};}module[_0xd30b('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 45db5aa..2f3fc54 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 _0x5598=['state','unknown','stateTime','address','name','accountcode'];(function(_0x189b3b,_0x484de8){var _0x7c4721=function(_0x1ca32b){while(--_0x1ca32b){_0x189b3b['push'](_0x189b3b['shift']());}};_0x7c4721(++_0x484de8);}(_0x5598,0x106));var _0x8559=function(_0x58e389,_0x3ab426){_0x58e389=_0x58e389-0x0;var _0x1437df=_0x5598[_0x58e389];return _0x1437df;};'use strict';function Telephone(_0x155840){this['id']=_0x155840['id']||0x0;this[_0x8559('0x0')]=_0x155840['name']||'';this[_0x8559('0x1')]=_0x155840[_0x8559('0x1')]||'';this[_0x8559('0x2')]=_0x8559('0x3');this[_0x8559('0x4')]=0x0;this['status']=_0x8559('0x3');this[_0x8559('0x5')]='';}module['exports']=Telephone;
\ No newline at end of file
+var _0xed19=['unknown','stateTime','status','address','name','accountcode','state'];(function(_0x4ba52c,_0x36da44){var _0x1cc213=function(_0x500f6e){while(--_0x500f6e){_0x4ba52c['push'](_0x4ba52c['shift']());}};_0x1cc213(++_0x36da44);}(_0xed19,0x13f));var _0x9ed1=function(_0x3688d5,_0x51d2b7){_0x3688d5=_0x3688d5-0x0;var _0x3013c4=_0xed19[_0x3688d5];return _0x3013c4;};'use strict';function Telephone(_0x4b3071){this['id']=_0x4b3071['id']||0x0;this[_0x9ed1('0x0')]=_0x4b3071['name']||'';this[_0x9ed1('0x1')]=_0x4b3071[_0x9ed1('0x1')]||'';this[_0x9ed1('0x2')]=_0x9ed1('0x3');this[_0x9ed1('0x4')]=0x0;this[_0x9ed1('0x5')]=_0x9ed1('0x3');this[_0x9ed1('0x6')]='';}module['exports']=Telephone;
\ No newline at end of file
diff --git a/server/services/ami/model/template.js b/server/services/ami/model/template.js
index 6cd2263..e3cdff8 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 _0xdf7b=['exports','name','html'];(function(_0x580647,_0x43d2c3){var _0x5f0792=function(_0x386cef){while(--_0x386cef){_0x580647['push'](_0x580647['shift']());}};_0x5f0792(++_0x43d2c3);}(_0xdf7b,0x9a));var _0xbdf7=function(_0xf67f45,_0x36e087){_0xf67f45=_0xf67f45-0x0;var _0xd9ab5=_0xdf7b[_0xf67f45];return _0xd9ab5;};'use strict';function template(_0x792683){this['id']=_0x792683['id']||0x0;this[_0xbdf7('0x0')]=_0x792683[_0xbdf7('0x0')]||'';this['html']=_0x792683[_0xbdf7('0x1')]||'';}module[_0xbdf7('0x2')]=template;
\ No newline at end of file
+var _0x2cca=['html','exports','name'];(function(_0x3d829d,_0x5af899){var _0x318701=function(_0x30e7cd){while(--_0x30e7cd){_0x3d829d['push'](_0x3d829d['shift']());}};_0x318701(++_0x5af899);}(_0x2cca,0xa4));var _0xa2cc=function(_0x2d616f,_0x1f7460){_0x2d616f=_0x2d616f-0x0;var _0x44ec34=_0x2cca[_0x2d616f];return _0x44ec34;};'use strict';function template(_0xd76f59){this['id']=_0xd76f59['id']||0x0;this['name']=_0xd76f59[_0xa2cc('0x0')]||'';this[_0xa2cc('0x1')]=_0xd76f59[_0xa2cc('0x1')]||'';}module[_0xa2cc('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 6f338b4..60b4a17 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 _0x54ef=['Actions','exports','name','channel','voice','status','AllConditions','AnyConditions'];(function(_0x421fbb,_0x399b60){var _0x99c037=function(_0x5689b7){while(--_0x5689b7){_0x421fbb['push'](_0x421fbb['shift']());}};_0x99c037(++_0x399b60);}(_0x54ef,0x112));var _0xf54e=function(_0x5c195b,_0x19d838){_0x5c195b=_0x5c195b-0x0;var _0x3d85a7=_0x54ef[_0x5c195b];return _0x3d85a7;};'use strict';function Trigger(_0x19d4d5){this['id']=_0x19d4d5['id']||0x0;this[_0xf54e('0x0')]=_0x19d4d5[_0xf54e('0x0')]||'';this['channel']=_0x19d4d5[_0xf54e('0x1')]||_0xf54e('0x2');this[_0xf54e('0x3')]=_0x19d4d5[_0xf54e('0x3')]||![];this[_0xf54e('0x4')]=_0x19d4d5[_0xf54e('0x4')]||[];this[_0xf54e('0x5')]=_0x19d4d5['AnyConditions']||[];this['Actions']=_0x19d4d5[_0xf54e('0x6')]||[];}module[_0xf54e('0x7')]=Trigger;
\ No newline at end of file
+var _0x00bb=['status','AllConditions','AnyConditions','exports','name','channel'];(function(_0x1cf317,_0x1cb57d){var _0x53412e=function(_0xfb3ca9){while(--_0xfb3ca9){_0x1cf317['push'](_0x1cf317['shift']());}};_0x53412e(++_0x1cb57d);}(_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 369736b..20ca665 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 _0xb83c=['host','port','domain','domainport','refresh','stateRegistry','registrationtime','address','active','name','unknown','stateTime','status','registry','indexOf'];(function(_0x33e4bd,_0x2e5ec2){var _0x512192=function(_0x3a783f){while(--_0x3a783f){_0x33e4bd['push'](_0x33e4bd['shift']());}};_0x512192(++_0x2e5ec2);}(_0xb83c,0x19d));var _0xcb83=function(_0x55adac,_0x2c4383){_0x55adac=_0x55adac-0x0;var _0x3ade31=_0xb83c[_0x55adac];return _0x3ade31;};'use strict';function Trunk(_0x251554){this['id']=_0x251554['id']||0x0;this[_0xcb83('0x0')]=_0x251554['active']||![];this[_0xcb83('0x1')]=_0x251554[_0xcb83('0x1')]||'';this['state']=_0xcb83('0x2');this[_0xcb83('0x3')]=0x0;this[_0xcb83('0x4')]='unknown';this['registry']=_0x251554[_0xcb83('0x5')]&&_0x251554['registry'][_0xcb83('0x6')](':')?_0x251554[_0xcb83('0x5')]['split'](':')[0x0]:'';this[_0xcb83('0x7')]='';this[_0xcb83('0x8')]='';this[_0xcb83('0x9')]='';this[_0xcb83('0xa')]='';this[_0xcb83('0xb')]='';this[_0xcb83('0xc')]=_0xcb83('0x2');this[_0xcb83('0xd')]='';this[_0xcb83('0xe')]='';}module['exports']=Trunk;
\ No newline at end of file
+var _0xc120=['domain','domainport','stateRegistry','registrationtime','active','name','stateTime','status','unknown','registry','indexOf','split','host','port'];(function(_0x404309,_0x1882cc){var _0xa4e7cf=function(_0x2e5f4c){while(--_0x2e5f4c){_0x404309['push'](_0x404309['shift']());}};_0xa4e7cf(++_0x1882cc);}(_0xc120,0xf2));var _0x0c12=function(_0xf50820,_0x56f041){_0xf50820=_0xf50820-0x0;var _0x2a9b10=_0xc120[_0xf50820];return _0x2a9b10;};'use strict';function Trunk(_0x559b0d){this['id']=_0x559b0d['id']||0x0;this[_0x0c12('0x0')]=_0x559b0d[_0x0c12('0x0')]||![];this[_0x0c12('0x1')]=_0x559b0d[_0x0c12('0x1')]||'';this['state']='unknown';this[_0x0c12('0x2')]=0x0;this[_0x0c12('0x3')]=_0x0c12('0x4');this['registry']=_0x559b0d[_0x0c12('0x5')]&&_0x559b0d['registry'][_0x0c12('0x6')](':')?_0x559b0d['registry'][_0x0c12('0x7')](':')[0x0]:'';this[_0x0c12('0x8')]='';this[_0x0c12('0x9')]='';this[_0x0c12('0xa')]='';this[_0x0c12('0xb')]='';this['refresh']='';this[_0x0c12('0xc')]=_0x0c12('0x4');this[_0x0c12('0xd')]='';this['address']='';}module['exports']=Trunk;
\ No newline at end of file
diff --git a/server/services/ami/model/voiceExtension.js b/server/services/ami/model/voiceExtension.js
index 6486082..e424342 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 _0xe763=['recordingFormat','none','mandatoryDisposition','exports','exten'];(function(_0x339c23,_0x541ff6){var _0x5bf134=function(_0x46c91d){while(--_0x46c91d){_0x339c23['push'](_0x339c23['shift']());}};_0x5bf134(++_0x541ff6);}(_0xe763,0x18f));var _0x3e76=function(_0x109371,_0x441c8e){_0x109371=_0x109371-0x0;var _0x4fd858=_0xe763[_0x109371];return _0x4fd858;};'use strict';function voiceExtension(_0x5c2b3e){this['id']=_0x5c2b3e['id']||0x0;this[_0x3e76('0x0')]=_0x5c2b3e['exten']||'';this[_0x3e76('0x1')]=_0x5c2b3e[_0x3e76('0x1')]||_0x3e76('0x2');this['mandatoryDisposition']=_0x5c2b3e[_0x3e76('0x3')]||![];}module[_0x3e76('0x4')]=voiceExtension;
\ No newline at end of file
+var _0x96f2=['mandatoryDisposition','exten','recordingFormat','none'];(function(_0x1ca095,_0x523467){var _0x50bbec=function(_0x219c24){while(--_0x219c24){_0x1ca095['push'](_0x1ca095['shift']());}};_0x50bbec(++_0x523467);}(_0x96f2,0x1b1));var _0x296f=function(_0xdbed59,_0x531e7a){_0xdbed59=_0xdbed59-0x0;var _0x2d1566=_0x96f2[_0xdbed59];return _0x2d1566;};'use strict';function voiceExtension(_0xe7ebfc){this['id']=_0xe7ebfc['id']||0x0;this[_0x296f('0x0')]=_0xe7ebfc[_0x296f('0x0')]||'';this[_0x296f('0x1')]=_0xe7ebfc[_0x296f('0x1')]||_0x296f('0x2');this[_0x296f('0x3')]=_0xe7ebfc['mandatoryDisposition']||![];}module['exports']=voiceExtension;
\ No newline at end of file
diff --git a/server/services/ami/model/voiceQueue.js b/server/services/ami/model/voiceQueue.js
index bbc0125..50ffeba 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 _0x1a66=['startProgressive','handlePredictive','predictiveIntervalMultiplicativeFactor','predictiveIntervalAnsweredCalls','predictiveIntervalDroppedCallsCallersExit','predictiveIntervalDroppedCallsTimeout','predictiveIntervalAvgHoldtime','predictiveIntervalPauses','predictiveIntervalMaxThreshold','dialPredictiveIntervalMaxThreshold','predictiveIntervalMinThreshold','predictiveIntervalErlangCalls','predictiveIntervalErlangCallsDroppedCalls','predictiveIntervalHitRate','erlangCalls','erlangCallToSecond','erlangBusyFactor','dialQueueProject2','dialAgiAfterHangupClient','mandatoryDisposition','mandatoryDispositionPause','exports','unknown','inuse','invalid','unavailable','ringinuse','onhold','wav','wav49','rrmemory','roundrobin','monitor_format','type','inbound','waiting','sumDuration','sumHoldTime','abandoned','loggedIn','available','acw','acwTimeout','autopause','sendMessageOneNotActive','message','originated','temp','dialTimezone','dialGlobalInterval','dialActive','dialMethod','dialLimitChannel','dialLimitQueue','dialPowerLevel','dialPredictiveOptimization','dropRate','dialPredictiveOptimizationPercentage','dialPredictiveInterval','dialOriginateCallerIdName','anonymous','dialOriginateCallerIdNumber','dialQueueOptions','dialQueueTimeout','dialQueueProject','dialCongestionMaxRetry','dialCongestionRetryFrequency','dialBusyMaxRetry','dialNoAnswerMaxRetry','dialNoAnswerRetryFrequency','dialNoSuchNumberMaxRetry','dialNoSuchNumberRetryFrequency','dialDropMaxRetry','dialAbandonedMaxRetry','dialAbandonedRetryFrequency','dialMachineMaxRetry','dialMachineRetryFrequency','dialAgentRejectMaxRetry','dialAgentRejectRetryFrequency','Trunk','TrunkBackup','dialPrefix','Interval','DESC','dialRandomLastDigitCallerIdNumber','dialCutDigit','strategy','queueStatusComplete','dialAMDActive','dialAMDInitialSilence','dialAMDGreeting','dialAMDAfterGreetingSilence','dialAMDTotalAnalysisTime','dialAMDMinWordLength','dialAMDBetweenWordsSilence','dialAMDMaximumNumberOfWords','dialAMDSilenceThreshold','dialAMDMaximumWordLength','outboundRejectCallsDay','pTalking','timeout','outboundAnswerAgiCallsDay','outboundBusyCallsDay','outboundCongestionCallsDay','outboundNoSuchCallsDay','outboundUnknownCallsDay','outboundBlacklistCallsDay','outboundOriginateFailureCallsDay','outboundDropCallsDayCallersExit','outboundReCallsDay'];(function(_0x21bd14,_0x5c57c1){var _0x11c487=function(_0x356b43){while(--_0x356b43){_0x21bd14['push'](_0x21bd14['shift']());}};_0x11c487(++_0x5c57c1);}(_0x1a66,0x84));var _0x61a6=function(_0x3af74c,_0x2e83da){_0x3af74c=_0x3af74c-0x0;var _0x56c4dd=_0x1a66[_0x3af74c];return _0x56c4dd;};'use strict';var statusDesc=[_0x61a6('0x0'),'not_inuse',_0x61a6('0x1'),'busy',_0x61a6('0x2'),_0x61a6('0x3'),'ringing',_0x61a6('0x4'),_0x61a6('0x5')];var monitorFormat={'wav':_0x61a6('0x6'),'wav49':_0x61a6('0x7'),'gsm':'gsm'};var strategy={'rrmemory':_0x61a6('0x8'),'roundrobin':_0x61a6('0x9')};function VoiceQueue(_0x9909f5){this['id']=_0x9909f5['id']||0x0;this['name']=_0x9909f5['name']||'';this[_0x61a6('0xa')]=_0x9909f5[_0x61a6('0xa')]||'';this['type']=_0x9909f5[_0x61a6('0xb')]||_0x61a6('0xc');this[_0x61a6('0xd')]=0x0;this['talking']=0x0;this['total']=0x0;this['answered']=0x0;this[_0x61a6('0xe')]=0x0;this[_0x61a6('0xf')]=0x0;this['sumBillable']=0x0;this['unmanaged']=0x0;this[_0x61a6('0x10')]=0x0;this[_0x61a6('0x11')]=0x0;this[_0x61a6('0x12')]=0x0;this[_0x61a6('0x13')]=_0x9909f5['acw']||![];this[_0x61a6('0x14')]=_0x9909f5[_0x61a6('0x14')]||0xa;this[_0x61a6('0x15')]=_0x9909f5[_0x61a6('0x15')]||'no';this[_0x61a6('0x16')]=!![];this[_0x61a6('0x17')]='';this[_0x61a6('0x18')]=0x0;this[_0x61a6('0x19')]=0x0;this[_0x61a6('0x1a')]=_0x9909f5[_0x61a6('0x1a')]||null;this[_0x61a6('0x1b')]=_0x9909f5[_0x61a6('0x1b')]?_0x9909f5[_0x61a6('0x1b')]:null;this[_0x61a6('0x1c')]=_0x9909f5[_0x61a6('0x1c')];this[_0x61a6('0x1d')]=_0x9909f5['dialMethod']||'progressive';this[_0x61a6('0x1e')]=_0x9909f5[_0x61a6('0x1e')]||0x0;this[_0x61a6('0x1f')]=_0x9909f5[_0x61a6('0x1f')]||0x0;this[_0x61a6('0x20')]=_0x9909f5[_0x61a6('0x20')]||0x1;this['dialPredictiveOptimization']=_0x9909f5[_0x61a6('0x21')]||_0x61a6('0x22');this[_0x61a6('0x23')]=_0x9909f5[_0x61a6('0x23')]||0.03;this['dialPredictiveInterval']=_0x9909f5[_0x61a6('0x24')]||0x258;this[_0x61a6('0x25')]=_0x9909f5[_0x61a6('0x25')]||_0x61a6('0x26');this[_0x61a6('0x27')]=_0x9909f5[_0x61a6('0x27')]||_0x61a6('0x26');this['dialOriginateTimeout']=_0x9909f5['dialOriginateTimeout']||0x1e;this[_0x61a6('0x28')]=_0x9909f5[_0x61a6('0x28')]||'tTxX';this[_0x61a6('0x29')]=_0x9909f5[_0x61a6('0x29')]||0x3;this[_0x61a6('0x2a')]=_0x9909f5[_0x61a6('0x2a')]||undefined;this[_0x61a6('0x2b')]=_0x9909f5[_0x61a6('0x2b')]||0x3;this['dialCongestionRetryFrequency']=_0x9909f5[_0x61a6('0x2c')]||0x96;this[_0x61a6('0x2d')]=_0x9909f5[_0x61a6('0x2d')]||0x3;this['dialBusyRetryFrequency']=_0x9909f5['dialBusyRetryFrequency']||0x96;this[_0x61a6('0x2e')]=_0x9909f5[_0x61a6('0x2e')]||0x3;this[_0x61a6('0x2f')]=_0x9909f5[_0x61a6('0x2f')]||0x96;this[_0x61a6('0x30')]=_0x9909f5[_0x61a6('0x30')]||0x3;this[_0x61a6('0x31')]=_0x9909f5[_0x61a6('0x31')]||0x96;this[_0x61a6('0x32')]=_0x9909f5[_0x61a6('0x32')]||0x3;this['dialDropRetryFrequency']=_0x9909f5['dialDropRetryFrequency']||0x96;this[_0x61a6('0x33')]=_0x9909f5['dialAbandonedMaxRetry']||0x3;this[_0x61a6('0x34')]=_0x9909f5['dialAbandonedRetryFrequency']||0x96;this[_0x61a6('0x35')]=_0x9909f5[_0x61a6('0x35')]||0x3;this[_0x61a6('0x36')]=_0x9909f5[_0x61a6('0x36')]||0x96;this[_0x61a6('0x37')]=_0x9909f5[_0x61a6('0x37')]||0x3;this[_0x61a6('0x38')]=_0x9909f5['dialAgentRejectRetryFrequency']||0x96;this['dialGlobalMaxRetry']=_0x9909f5['dialGlobalMaxRetry']||0x4;this[_0x61a6('0x39')]=_0x9909f5[_0x61a6('0x39')]?_0x9909f5[_0x61a6('0x39')]:undefined;this[_0x61a6('0x3a')]=_0x9909f5[_0x61a6('0x3a')]?_0x9909f5['TrunkBackup']:undefined;this[_0x61a6('0x3b')]=_0x9909f5[_0x61a6('0x3b')]||undefined;this[_0x61a6('0x3c')]=_0x9909f5['Interval']?_0x9909f5[_0x61a6('0x3c')]:undefined;this['dialOrderByScheduledAt']=_0x9909f5['dialOrderByScheduledAt']||_0x61a6('0x3d');this[_0x61a6('0x3e')]=_0x9909f5[_0x61a6('0x3e')]||undefined;this['dialCutDigit']=_0x9909f5[_0x61a6('0x3f')]||undefined;this['strategy']=strategy[_0x9909f5[_0x61a6('0x40')]]||_0x61a6('0x8');this[_0x61a6('0x41')]=!![];this[_0x61a6('0x42')]=_0x9909f5[_0x61a6('0x42')]||![];this[_0x61a6('0x43')]=_0x9909f5[_0x61a6('0x43')];this[_0x61a6('0x44')]=_0x9909f5[_0x61a6('0x44')];this[_0x61a6('0x45')]=_0x9909f5[_0x61a6('0x45')];this[_0x61a6('0x46')]=_0x9909f5[_0x61a6('0x46')];this[_0x61a6('0x47')]=_0x9909f5['dialAMDMinWordLength'];this['dialAMDBetweenWordsSilence']=_0x9909f5[_0x61a6('0x48')];this[_0x61a6('0x49')]=_0x9909f5[_0x61a6('0x49')];this['dialAMDSilenceThreshold']=_0x9909f5[_0x61a6('0x4a')];this[_0x61a6('0x4b')]=_0x9909f5['dialAMDMaximumWordLength'];this[_0x61a6('0x4c')]=0x0;this[_0x61a6('0x4d')]=0x0;this[_0x61a6('0x4e')]=_0x9909f5[_0x61a6('0x4e')];this['outboundAnswerCallsDay']=0x0;this[_0x61a6('0x4f')]=0x0;this['outboundNoAnswerCallsDay']=0x0;this[_0x61a6('0x50')]=0x0;this[_0x61a6('0x51')]=0x0;this[_0x61a6('0x52')]=0x0;this[_0x61a6('0x53')]=0x0;this[_0x61a6('0x54')]=0x0;this[_0x61a6('0x55')]=0x0;this[_0x61a6('0x56')]=0x0;this['outboundDropCallsDayTimeout']=0x0;this['outboundDropCallsDayACS']=0x0;this[_0x61a6('0x57')]=0x0;this['outboundAbandonedDay']=0x0;this[_0x61a6('0x58')]=undefined;this['startPredictive']=undefined;this[_0x61a6('0x59')]=undefined;this[_0x61a6('0x5a')]=1.05;this['predictiveIntervalTotalCalls']=0x0;this[_0x61a6('0x5b')]=0x0;this[_0x61a6('0x5c')]=0x0;this[_0x61a6('0x5d')]=0x0;this[_0x61a6('0x5e')]=0x0;this['predictiveIntervalAvgTalktime']=0x0;this[_0x61a6('0x5f')]=0x0;this['predictiveIntervalAvailable']=0x0;this[_0x61a6('0x60')]=_0x9909f5[_0x61a6('0x61')]||0x14;this[_0x61a6('0x62')]=_0x9909f5[_0x61a6('0x61')]||0xa;this[_0x61a6('0x63')]=0x0;this[_0x61a6('0x64')]=0x0;this[_0x61a6('0x65')]=0x1;this[_0x61a6('0x66')]=0x0;this[_0x61a6('0x67')]=0x0;this['erlangAbandonmentRate']=0x0;this[_0x61a6('0x68')]=0x0;this['dialRecallMeTimeout']=_0x9909f5['dialRecallMeTimeout']||0x1e;this['dialRecallInQueue']=_0x9909f5['dialRecallInQueue']||![];this['dialQueueProject2']=_0x9909f5[_0x61a6('0x69')]||undefined;this[_0x61a6('0x6a')]=_0x9909f5[_0x61a6('0x6a')]||![];this['dialAgiAfterHangupAgent']=_0x9909f5['dialAgiAfterHangupAgent']||![];this[_0x61a6('0xa')]=monitorFormat[_0x9909f5[_0x61a6('0xa')]]?monitorFormat[_0x9909f5[_0x61a6('0xa')]]:undefined;this[_0x61a6('0x6b')]=_0x9909f5[_0x61a6('0x6b')]||![];this[_0x61a6('0x6c')]=_0x9909f5[_0x61a6('0x6c')]?_0x9909f5['mandatoryDispositionPause']:undefined;}module[_0x61a6('0x6d')]=VoiceQueue;
\ No newline at end of file
+var _0x1cb5=['dialQueueProject2','dialAgiAfterHangupClient','dialAgiAfterHangupAgent','mandatoryDisposition','mandatoryDispositionPause','exports','busy','invalid','ringinuse','onhold','wav','wav49','gsm','rrmemory','roundrobin','name','monitor_format','type','talking','total','answered','sumDuration','sumHoldTime','sumBillable','unmanaged','abandoned','loggedIn','acw','acwTimeout','autopause','originated','temp','dialTimezone','dialGlobalInterval','dialActive','dialMethod','dialLimitChannel','dialLimitQueue','dialPowerLevel','dialPredictiveOptimization','dialPredictiveOptimizationPercentage','dialPredictiveInterval','dialOriginateCallerIdName','anonymous','dialOriginateCallerIdNumber','dialOriginateTimeout','dialQueueOptions','tTxX','dialQueueTimeout','dialQueueProject','dialCongestionMaxRetry','dialCongestionRetryFrequency','dialBusyMaxRetry','dialBusyRetryFrequency','dialNoAnswerMaxRetry','dialNoAnswerRetryFrequency','dialNoSuchNumberMaxRetry','dialNoSuchNumberRetryFrequency','dialDropMaxRetry','dialDropRetryFrequency','dialAbandonedMaxRetry','dialAbandonedRetryFrequency','dialMachineMaxRetry','dialMachineRetryFrequency','dialAgentRejectMaxRetry','dialAgentRejectRetryFrequency','dialGlobalMaxRetry','Trunk','TrunkBackup','dialPrefix','Interval','dialOrderByScheduledAt','DESC','dialRandomLastDigitCallerIdNumber','dialCutDigit','strategy','queueStatusComplete','dialAMDActive','dialAMDInitialSilence','dialAMDGreeting','dialAMDAfterGreetingSilence','dialAMDTotalAnalysisTime','dialAMDMinWordLength','dialAMDBetweenWordsSilence','dialAMDMaximumNumberOfWords','dialAMDSilenceThreshold','dialAMDMaximumWordLength','pTalking','timeout','outboundAnswerCallsDay','outboundAnswerAgiCallsDay','outboundNoAnswerCallsDay','outboundBusyCallsDay','outboundNoSuchCallsDay','outboundOriginateFailureCallsDay','outboundDropCallsDayACS','outboundReCallsDay','outboundAbandonedDay','startProgressive','startPredictive','handlePredictive','predictiveIntervalMultiplicativeFactor','predictiveIntervalTotalCalls','predictiveIntervalAnsweredCalls','predictiveIntervalAvgTalktime','predictiveIntervalAvailable','dialPredictiveIntervalMaxThreshold','predictiveIntervalErlangCalls','predictiveIntervalHitRate','erlangCalls','erlangBusyFactor','dialRecallMeTimeout','dialRecallInQueue'];(function(_0x4579fb,_0xc68e9a){var _0xa250a=function(_0x37104c){while(--_0x37104c){_0x4579fb['push'](_0x4579fb['shift']());}};_0xa250a(++_0xc68e9a);}(_0x1cb5,0x1ca));var _0x51cb=function(_0x106f46,_0x5ad31e){_0x106f46=_0x106f46-0x0;var _0x2d0b6d=_0x1cb5[_0x106f46];return _0x2d0b6d;};'use strict';var statusDesc=['unknown','not_inuse','inuse',_0x51cb('0x0'),_0x51cb('0x1'),'unavailable','ringing',_0x51cb('0x2'),_0x51cb('0x3')];var monitorFormat={'wav':_0x51cb('0x4'),'wav49':_0x51cb('0x5'),'gsm':_0x51cb('0x6')};var strategy={'rrmemory':_0x51cb('0x7'),'roundrobin':_0x51cb('0x8')};function VoiceQueue(_0x2c777d){this['id']=_0x2c777d['id']||0x0;this[_0x51cb('0x9')]=_0x2c777d['name']||'';this['monitor_format']=_0x2c777d[_0x51cb('0xa')]||'';this[_0x51cb('0xb')]=_0x2c777d[_0x51cb('0xb')]||'inbound';this['waiting']=0x0;this[_0x51cb('0xc')]=0x0;this[_0x51cb('0xd')]=0x0;this[_0x51cb('0xe')]=0x0;this[_0x51cb('0xf')]=0x0;this[_0x51cb('0x10')]=0x0;this[_0x51cb('0x11')]=0x0;this[_0x51cb('0x12')]=0x0;this[_0x51cb('0x13')]=0x0;this[_0x51cb('0x14')]=0x0;this['available']=0x0;this[_0x51cb('0x15')]=_0x2c777d[_0x51cb('0x15')]||![];this[_0x51cb('0x16')]=_0x2c777d['acwTimeout']||0xa;this[_0x51cb('0x17')]=_0x2c777d[_0x51cb('0x17')]||'no';this['sendMessageOneNotActive']=!![];this['message']='';this[_0x51cb('0x18')]=0x0;this[_0x51cb('0x19')]=0x0;this[_0x51cb('0x1a')]=_0x2c777d[_0x51cb('0x1a')]||null;this[_0x51cb('0x1b')]=_0x2c777d[_0x51cb('0x1b')]?_0x2c777d[_0x51cb('0x1b')]:null;this[_0x51cb('0x1c')]=_0x2c777d[_0x51cb('0x1c')];this[_0x51cb('0x1d')]=_0x2c777d[_0x51cb('0x1d')]||'progressive';this[_0x51cb('0x1e')]=_0x2c777d['dialLimitChannel']||0x0;this[_0x51cb('0x1f')]=_0x2c777d[_0x51cb('0x1f')]||0x0;this[_0x51cb('0x20')]=_0x2c777d[_0x51cb('0x20')]||0x1;this[_0x51cb('0x21')]=_0x2c777d[_0x51cb('0x21')]||'dropRate';this[_0x51cb('0x22')]=_0x2c777d[_0x51cb('0x22')]||0.03;this['dialPredictiveInterval']=_0x2c777d[_0x51cb('0x23')]||0x258;this[_0x51cb('0x24')]=_0x2c777d[_0x51cb('0x24')]||_0x51cb('0x25');this[_0x51cb('0x26')]=_0x2c777d[_0x51cb('0x26')]||'anonymous';this[_0x51cb('0x27')]=_0x2c777d['dialOriginateTimeout']||0x1e;this[_0x51cb('0x28')]=_0x2c777d[_0x51cb('0x28')]||_0x51cb('0x29');this[_0x51cb('0x2a')]=_0x2c777d[_0x51cb('0x2a')]||0x3;this[_0x51cb('0x2b')]=_0x2c777d[_0x51cb('0x2b')]||undefined;this[_0x51cb('0x2c')]=_0x2c777d[_0x51cb('0x2c')]||0x3;this[_0x51cb('0x2d')]=_0x2c777d[_0x51cb('0x2d')]||0x96;this['dialBusyMaxRetry']=_0x2c777d[_0x51cb('0x2e')]||0x3;this[_0x51cb('0x2f')]=_0x2c777d['dialBusyRetryFrequency']||0x96;this[_0x51cb('0x30')]=_0x2c777d[_0x51cb('0x30')]||0x3;this[_0x51cb('0x31')]=_0x2c777d[_0x51cb('0x31')]||0x96;this['dialNoSuchNumberMaxRetry']=_0x2c777d[_0x51cb('0x32')]||0x3;this['dialNoSuchNumberRetryFrequency']=_0x2c777d[_0x51cb('0x33')]||0x96;this[_0x51cb('0x34')]=_0x2c777d['dialDropMaxRetry']||0x3;this[_0x51cb('0x35')]=_0x2c777d[_0x51cb('0x35')]||0x96;this[_0x51cb('0x36')]=_0x2c777d[_0x51cb('0x36')]||0x3;this[_0x51cb('0x37')]=_0x2c777d['dialAbandonedRetryFrequency']||0x96;this['dialMachineMaxRetry']=_0x2c777d[_0x51cb('0x38')]||0x3;this[_0x51cb('0x39')]=_0x2c777d['dialMachineRetryFrequency']||0x96;this[_0x51cb('0x3a')]=_0x2c777d[_0x51cb('0x3a')]||0x3;this[_0x51cb('0x3b')]=_0x2c777d[_0x51cb('0x3b')]||0x96;this[_0x51cb('0x3c')]=_0x2c777d['dialGlobalMaxRetry']||0x4;this[_0x51cb('0x3d')]=_0x2c777d[_0x51cb('0x3d')]?_0x2c777d[_0x51cb('0x3d')]:undefined;this[_0x51cb('0x3e')]=_0x2c777d[_0x51cb('0x3e')]?_0x2c777d['TrunkBackup']:undefined;this[_0x51cb('0x3f')]=_0x2c777d[_0x51cb('0x3f')]||undefined;this[_0x51cb('0x40')]=_0x2c777d[_0x51cb('0x40')]?_0x2c777d['Interval']:undefined;this[_0x51cb('0x41')]=_0x2c777d[_0x51cb('0x41')]||_0x51cb('0x42');this[_0x51cb('0x43')]=_0x2c777d[_0x51cb('0x43')]||undefined;this[_0x51cb('0x44')]=_0x2c777d['dialCutDigit']||undefined;this[_0x51cb('0x45')]=strategy[_0x2c777d[_0x51cb('0x45')]]||_0x51cb('0x7');this[_0x51cb('0x46')]=!![];this[_0x51cb('0x47')]=_0x2c777d[_0x51cb('0x47')]||![];this['dialAMDInitialSilence']=_0x2c777d[_0x51cb('0x48')];this[_0x51cb('0x49')]=_0x2c777d['dialAMDGreeting'];this[_0x51cb('0x4a')]=_0x2c777d[_0x51cb('0x4a')];this[_0x51cb('0x4b')]=_0x2c777d[_0x51cb('0x4b')];this[_0x51cb('0x4c')]=_0x2c777d[_0x51cb('0x4c')];this[_0x51cb('0x4d')]=_0x2c777d[_0x51cb('0x4d')];this[_0x51cb('0x4e')]=_0x2c777d[_0x51cb('0x4e')];this['dialAMDSilenceThreshold']=_0x2c777d[_0x51cb('0x4f')];this[_0x51cb('0x50')]=_0x2c777d[_0x51cb('0x50')];this['outboundRejectCallsDay']=0x0;this[_0x51cb('0x51')]=0x0;this['timeout']=_0x2c777d[_0x51cb('0x52')];this[_0x51cb('0x53')]=0x0;this[_0x51cb('0x54')]=0x0;this[_0x51cb('0x55')]=0x0;this[_0x51cb('0x56')]=0x0;this['outboundCongestionCallsDay']=0x0;this[_0x51cb('0x57')]=0x0;this['outboundUnknownCallsDay']=0x0;this['outboundBlacklistCallsDay']=0x0;this[_0x51cb('0x58')]=0x0;this['outboundDropCallsDayCallersExit']=0x0;this['outboundDropCallsDayTimeout']=0x0;this[_0x51cb('0x59')]=0x0;this[_0x51cb('0x5a')]=0x0;this[_0x51cb('0x5b')]=0x0;this[_0x51cb('0x5c')]=undefined;this[_0x51cb('0x5d')]=undefined;this[_0x51cb('0x5e')]=undefined;this[_0x51cb('0x5f')]=1.05;this[_0x51cb('0x60')]=0x0;this[_0x51cb('0x61')]=0x0;this['predictiveIntervalDroppedCallsCallersExit']=0x0;this['predictiveIntervalDroppedCallsTimeout']=0x0;this['predictiveIntervalAvgHoldtime']=0x0;this[_0x51cb('0x62')]=0x0;this['predictiveIntervalPauses']=0x0;this[_0x51cb('0x63')]=0x0;this['predictiveIntervalMaxThreshold']=_0x2c777d[_0x51cb('0x64')]||0x14;this['predictiveIntervalMinThreshold']=_0x2c777d['dialPredictiveIntervalMaxThreshold']||0xa;this[_0x51cb('0x65')]=0x0;this['predictiveIntervalErlangCallsDroppedCalls']=0x0;this[_0x51cb('0x66')]=0x1;this[_0x51cb('0x67')]=0x0;this['erlangCallToSecond']=0x0;this['erlangAbandonmentRate']=0x0;this[_0x51cb('0x68')]=0x0;this[_0x51cb('0x69')]=_0x2c777d[_0x51cb('0x69')]||0x1e;this[_0x51cb('0x6a')]=_0x2c777d[_0x51cb('0x6a')]||![];this[_0x51cb('0x6b')]=_0x2c777d[_0x51cb('0x6b')]||undefined;this[_0x51cb('0x6c')]=_0x2c777d['dialAgiAfterHangupClient']||![];this[_0x51cb('0x6d')]=_0x2c777d['dialAgiAfterHangupAgent']||![];this[_0x51cb('0xa')]=monitorFormat[_0x2c777d[_0x51cb('0xa')]]?monitorFormat[_0x2c777d[_0x51cb('0xa')]]:undefined;this[_0x51cb('0x6e')]=_0x2c777d['mandatoryDisposition']||![];this['mandatoryDispositionPause']=_0x2c777d['mandatoryDispositionPause']?_0x2c777d[_0x51cb('0x6f')]:undefined;}module[_0x51cb('0x70')]=VoiceQueue;
\ No newline at end of file
diff --git a/server/services/ami/model/vtigerAccount.js b/server/services/ami/model/vtigerAccount.js
index 0349515..6ce7b33 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 _0x7184=['serverUrl','Configurations','name','username','accessKey','remoteUri'];(function(_0xaae7a5,_0x42931b){var _0x5ce491=function(_0x2a0aec){while(--_0x2a0aec){_0xaae7a5['push'](_0xaae7a5['shift']());}};_0x5ce491(++_0x42931b);}(_0x7184,0xa4));var _0x4718=function(_0x2e1051,_0x58b01d){_0x2e1051=_0x2e1051-0x0;var _0x5aa734=_0x7184[_0x2e1051];return _0x5aa734;};'use strict';function VtigerAccount(_0x586e31){this['id']=_0x586e31['id']||0x0;this[_0x4718('0x0')]=_0x586e31[_0x4718('0x0')]||'';this[_0x4718('0x1')]=_0x586e31[_0x4718('0x1')]||'';this['accessKey']=_0x586e31[_0x4718('0x2')]||'';this[_0x4718('0x3')]=_0x586e31['remoteUri']||'';this['serverUrl']=_0x586e31[_0x4718('0x4')]||'';this[_0x4718('0x5')]=_0x586e31[_0x4718('0x5')]||{};}module['exports']=VtigerAccount;
\ No newline at end of file
+var _0x6cd7=['Configurations','exports','name','username','accessKey','remoteUri','serverUrl'];(function(_0x57c10b,_0x47e0e7){var _0x2d4228=function(_0x4c8f0c){while(--_0x4c8f0c){_0x57c10b['push'](_0x57c10b['shift']());}};_0x2d4228(++_0x47e0e7);}(_0x6cd7,0xdb));var _0x76cd=function(_0x1c0b91,_0x691caf){_0x1c0b91=_0x1c0b91-0x0;var _0x3d1ab4=_0x6cd7[_0x1c0b91];return _0x3d1ab4;};'use strict';function VtigerAccount(_0x1e9204){this['id']=_0x1e9204['id']||0x0;this[_0x76cd('0x0')]=_0x1e9204[_0x76cd('0x0')]||'';this['username']=_0x1e9204[_0x76cd('0x1')]||'';this['accessKey']=_0x1e9204[_0x76cd('0x2')]||'';this[_0x76cd('0x3')]=_0x1e9204[_0x76cd('0x3')]||'';this[_0x76cd('0x4')]=_0x1e9204['serverUrl']||'';this[_0x76cd('0x5')]=_0x1e9204[_0x76cd('0x5')]||{};}module[_0x76cd('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 36ed637..3870b96 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 _0x5f66=['remoteUri','authType','integrationTab','serverUrl','Configurations','exports','name','username','password','token'];(function(_0xde76a9,_0xfd1578){var _0x203ad0=function(_0x277fa7){while(--_0x277fa7){_0xde76a9['push'](_0xde76a9['shift']());}};_0x203ad0(++_0xfd1578);}(_0x5f66,0x1a0));var _0x65f6=function(_0x138adb,_0x193fee){_0x138adb=_0x138adb-0x0;var _0x1b27f2=_0x5f66[_0x138adb];return _0x1b27f2;};'use strict';function ZendeskAccount(_0x253044){this['id']=_0x253044['id']||0x0;this[_0x65f6('0x0')]=_0x253044['name']||'';this[_0x65f6('0x1')]=_0x253044[_0x65f6('0x1')]||'';this[_0x65f6('0x2')]=_0x253044[_0x65f6('0x2')]||'';this[_0x65f6('0x3')]=_0x253044['token']||'';this[_0x65f6('0x4')]=_0x253044['remoteUri']||'';this[_0x65f6('0x5')]=_0x253044[_0x65f6('0x5')]||'';this['type']=_0x253044['type']||_0x65f6('0x6');this[_0x65f6('0x7')]=_0x253044[_0x65f6('0x7')]||'';this[_0x65f6('0x8')]=_0x253044[_0x65f6('0x8')]||{};}module[_0x65f6('0x9')]=ZendeskAccount;
\ No newline at end of file
+var _0x0b0e=['exports','name','username','password','token','remoteUri','authType','type','serverUrl','Configurations'];(function(_0x582274,_0x2cbd9c){var _0x8f14d3=function(_0x1cfe08){while(--_0x1cfe08){_0x582274['push'](_0x582274['shift']());}};_0x8f14d3(++_0x2cbd9c);}(_0x0b0e,0x187));var _0xe0b0=function(_0x37d0bc,_0x109b96){_0x37d0bc=_0x37d0bc-0x0;var _0x170e60=_0x0b0e[_0x37d0bc];return _0x170e60;};'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 db8bcca..e571a2b 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 _0xa149=['clientId','clientSecret','serverUrl','code','refreshToken','Configurations','name','description','host','zone'];(function(_0x483e3a,_0x568361){var _0x43fca9=function(_0x273d7e){while(--_0x273d7e){_0x483e3a['push'](_0x483e3a['shift']());}};_0x43fca9(++_0x568361);}(_0xa149,0x18c));var _0x9a14=function(_0xd177f9,_0x305935){_0xd177f9=_0xd177f9-0x0;var _0x1a5652=_0xa149[_0xd177f9];return _0x1a5652;};'use strict';function ZohoAccount(_0x264785){this['id']=_0x264785['id']||0x0;this[_0x9a14('0x0')]=_0x264785[_0x9a14('0x0')]||'';this[_0x9a14('0x1')]=_0x264785[_0x9a14('0x1')]||'';this[_0x9a14('0x2')]=_0x264785[_0x9a14('0x2')]||'';this[_0x9a14('0x3')]=_0x264785[_0x9a14('0x3')]||'';this['clientId']=_0x264785[_0x9a14('0x4')]||'';this[_0x9a14('0x5')]=_0x264785['clientSecret']||'';this[_0x9a14('0x6')]=_0x264785[_0x9a14('0x6')]||'';this[_0x9a14('0x7')]=_0x264785[_0x9a14('0x7')]||'';this[_0x9a14('0x8')]=_0x264785[_0x9a14('0x8')]||'';this['Configurations']=_0x264785[_0x9a14('0x9')]||{};}module['exports']=ZohoAccount;
\ No newline at end of file
+var _0x15f9=['serverUrl','code','refreshToken','Configurations','exports','name','description','host','zone','clientId','clientSecret'];(function(_0x223461,_0x2bca70){var _0x4dbe0a=function(_0x3c3cb6){while(--_0x3c3cb6){_0x223461['push'](_0x223461['shift']());}};_0x4dbe0a(++_0x2bca70);}(_0x15f9,0xf7));var _0x915f=function(_0x31c297,_0xce6ca4){_0x31c297=_0x31c297-0x0;var _0x3b14d3=_0x15f9[_0x31c297];return _0x3b14d3;};'use strict';function ZohoAccount(_0x4272c8){this['id']=_0x4272c8['id']||0x0;this[_0x915f('0x0')]=_0x4272c8[_0x915f('0x0')]||'';this[_0x915f('0x1')]=_0x4272c8[_0x915f('0x1')]||'';this[_0x915f('0x2')]=_0x4272c8[_0x915f('0x2')]||'';this[_0x915f('0x3')]=_0x4272c8[_0x915f('0x3')]||'';this['clientId']=_0x4272c8[_0x915f('0x4')]||'';this[_0x915f('0x5')]=_0x4272c8[_0x915f('0x5')]||'';this[_0x915f('0x6')]=_0x4272c8['serverUrl']||'';this[_0x915f('0x7')]=_0x4272c8[_0x915f('0x7')]||'';this[_0x915f('0x8')]=_0x4272c8[_0x915f('0x8')]||'';this['Configurations']=_0x4272c8[_0x915f('0x9')]||{};}module[_0x915f('0xa')]=ZohoAccount;
\ No newline at end of file
diff --git a/server/services/ami/preview/action.js b/server/services/ami/preview/action.js
index 52bc5bd..4926626 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 _0xdb19=['UserId','originatecalleridnum','originatecalleridname','prototype','getCaller','format','\x22%s\x22\x20<%s>','number','exports','util','lodash','moment','isNil','string','uniqueid','idContact','queue','type','campaigntype','dialAnswer','Agent','channelAgent','membername','SIP/%s','calleridname','Contact','firstName','lastName','active','calleridnum','phone','scheduledat','countcongestionretry','countbusyretry','countnosuchnumberretry','countdropretry','countabandonedretry','countmachineretry','countagentrejectretry','callback','callbackuniqueid','callbackat','recallme','ListId'];(function(_0x20ea26,_0x5512f8){var _0xcbc4d7=function(_0x160a5d){while(--_0x160a5d){_0x20ea26['push'](_0x20ea26['shift']());}};_0xcbc4d7(++_0x5512f8);}(_0xdb19,0x13d));var _0x9db1=function(_0x6b2d0a,_0x2d3d22){_0x6b2d0a=_0x6b2d0a-0x0;var _0x4d9454=_0xdb19[_0x6b2d0a];return _0x4d9454;};'use strict';var util=require(_0x9db1('0x0'));var _=require(_0x9db1('0x1'));var moment=require(_0x9db1('0x2'));function checkNameSurname(_0x395c9e,_0x3fbe95,_0x4ab718){var _0x1d04d6='';if(!_[_0x9db1('0x3')](_0x3fbe95)&&'string'===typeof _0x3fbe95){_0x1d04d6+=_0x3fbe95;}if(!_[_0x9db1('0x3')](_0x4ab718)&&_0x9db1('0x4')===typeof _0x4ab718){_0x1d04d6+='\x20'+_0x4ab718;}if(_0x1d04d6!==''){return _0x1d04d6;}return _0x395c9e;}function Action(_0x279725,_0x21bf3a,_0x2c73bb,_0xe64143,_0x3889c7){this[_0x9db1('0x5')]=_0x2c73bb||undefined;this[_0x9db1('0x6')]=_0x279725['id'];this[_0x9db1('0x7')]=_0x21bf3a['name'];this[_0x9db1('0x8')]=_0x21bf3a[_0x9db1('0x8')];this[_0x9db1('0x9')]='queue';this[_0x9db1('0xa')]=![];this['membername']=_[_0x9db1('0x3')](_0x279725[_0x9db1('0xb')])?undefined:_0x279725[_0x9db1('0xb')]['name'];this[_0x9db1('0xc')]=this[_0x9db1('0xd')]?util['format'](_0x9db1('0xe'),this[_0x9db1('0xd')]):_0xe64143||undefined;this[_0x9db1('0xf')]=checkNameSurname(_0x279725['Contact']['phone'],_0x279725[_0x9db1('0x10')][_0x9db1('0x11')],_0x279725[_0x9db1('0x10')][_0x9db1('0x12')]);this[_0x9db1('0x13')]=_0x279725[_0x9db1('0x13')]||![];this[_0x9db1('0x14')]=_0x279725[_0x9db1('0x10')][_0x9db1('0x15')];this[_0x9db1('0x16')]=_0x279725['scheduledat'];this['countbusyretry']=_0x279725['countbusyretry']||0x0;this[_0x9db1('0x17')]=_0x279725['countcongestionretry']||0x0;this['countnoanswerretry']=_0x279725['countnoanswerretry']||0x0;this['countglobal']=(_0x279725[_0x9db1('0x18')]||0x0)+(_0x279725[_0x9db1('0x17')]||0x0)+(_0x279725['countnoanswerretry']||0x0);this[_0x9db1('0x19')]=_0x279725[_0x9db1('0x19')]||0x0;this['countdropretry']=_0x279725[_0x9db1('0x1a')]||0x0;this[_0x9db1('0x1b')]=_0x279725[_0x9db1('0x1b')]||0x0;this[_0x9db1('0x1c')]=_0x279725[_0x9db1('0x1c')]||0x0;this['countagentrejectretry']=_0x279725[_0x9db1('0x1d')]||0x0;this['callback']=_0x279725[_0x9db1('0x1e')];this[_0x9db1('0x1f')]=_0x279725[_0x9db1('0x1f')];this[_0x9db1('0x20')]=_0x279725[_0x9db1('0x20')];this[_0x9db1('0x21')]=_0x279725[_0x9db1('0x21')];this['ContactId']=_0x279725['ContactId'];this[_0x9db1('0x22')]=_0x279725[_0x9db1('0x22')];this[_0x9db1('0x23')]=_[_0x9db1('0x3')](_0x279725['Agent'])?_0x279725[_0x9db1('0x23')]:_0x279725[_0x9db1('0xb')]['id'];this['VoiceQueueId']=_0x279725['VoiceQueueId'];this[_0x9db1('0x24')]='';this[_0x9db1('0x25')]='';}Action[_0x9db1('0x26')][_0x9db1('0x27')]=function(){return util[_0x9db1('0x28')](_0x9db1('0x29'),this[_0x9db1('0xf')],this[_0x9db1('0x2a')]);};module[_0x9db1('0x2b')]=Action;
\ No newline at end of file
+var _0x148a=['util','lodash','moment','string','isNil','uniqueid','idContact','queue','name','type','campaigntype','dialAnswer','membername','Agent','channelAgent','format','SIP/%s','calleridname','Contact','firstName','lastName','active','phone','scheduledat','countbusyretry','countcongestionretry','countnoanswerretry','countglobal','countnosuchnumberretry','countdropretry','countabandonedretry','countmachineretry','countagentrejectretry','callback','callbackuniqueid','callbackat','recallme','ContactId','ListId','VoiceQueueId','originatecalleridname','prototype','getCaller','number','exports'];(function(_0x1bdc3a,_0x587df1){var _0x5af657=function(_0x680323){while(--_0x680323){_0x1bdc3a['push'](_0x1bdc3a['shift']());}};_0x5af657(++_0x587df1);}(_0x148a,0x10e));var _0xa148=function(_0x58063b,_0x1a76a1){_0x58063b=_0x58063b-0x0;var _0x313a60=_0x148a[_0x58063b];return _0x313a60;};'use strict';var util=require(_0xa148('0x0'));var _=require(_0xa148('0x1'));var moment=require(_0xa148('0x2'));function checkNameSurname(_0x4357c4,_0x1bd28e,_0x191f8a){var _0x50143e='';if(!_['isNil'](_0x1bd28e)&&_0xa148('0x3')===typeof _0x1bd28e){_0x50143e+=_0x1bd28e;}if(!_[_0xa148('0x4')](_0x191f8a)&&_0xa148('0x3')===typeof _0x191f8a){_0x50143e+='\x20'+_0x191f8a;}if(_0x50143e!==''){return _0x50143e;}return _0x4357c4;}function Action(_0x50f775,_0x2b06a8,_0x49f653,_0x32bf07,_0x6d3c63){this[_0xa148('0x5')]=_0x49f653||undefined;this[_0xa148('0x6')]=_0x50f775['id'];this[_0xa148('0x7')]=_0x2b06a8[_0xa148('0x8')];this[_0xa148('0x9')]=_0x2b06a8[_0xa148('0x9')];this[_0xa148('0xa')]=_0xa148('0x7');this[_0xa148('0xb')]=![];this[_0xa148('0xc')]=_[_0xa148('0x4')](_0x50f775['Agent'])?undefined:_0x50f775[_0xa148('0xd')]['name'];this[_0xa148('0xe')]=this[_0xa148('0xc')]?util[_0xa148('0xf')](_0xa148('0x10'),this['membername']):_0x32bf07||undefined;this[_0xa148('0x11')]=checkNameSurname(_0x50f775[_0xa148('0x12')]['phone'],_0x50f775[_0xa148('0x12')][_0xa148('0x13')],_0x50f775[_0xa148('0x12')][_0xa148('0x14')]);this[_0xa148('0x15')]=_0x50f775[_0xa148('0x15')]||![];this['calleridnum']=_0x50f775['Contact'][_0xa148('0x16')];this['scheduledat']=_0x50f775[_0xa148('0x17')];this[_0xa148('0x18')]=_0x50f775[_0xa148('0x18')]||0x0;this[_0xa148('0x19')]=_0x50f775[_0xa148('0x19')]||0x0;this['countnoanswerretry']=_0x50f775[_0xa148('0x1a')]||0x0;this[_0xa148('0x1b')]=(_0x50f775[_0xa148('0x18')]||0x0)+(_0x50f775['countcongestionretry']||0x0)+(_0x50f775[_0xa148('0x1a')]||0x0);this[_0xa148('0x1c')]=_0x50f775[_0xa148('0x1c')]||0x0;this[_0xa148('0x1d')]=_0x50f775['countdropretry']||0x0;this[_0xa148('0x1e')]=_0x50f775[_0xa148('0x1e')]||0x0;this[_0xa148('0x1f')]=_0x50f775[_0xa148('0x1f')]||0x0;this['countagentrejectretry']=_0x50f775[_0xa148('0x20')]||0x0;this[_0xa148('0x21')]=_0x50f775['callback'];this[_0xa148('0x22')]=_0x50f775[_0xa148('0x22')];this[_0xa148('0x23')]=_0x50f775[_0xa148('0x23')];this[_0xa148('0x24')]=_0x50f775[_0xa148('0x24')];this['ContactId']=_0x50f775[_0xa148('0x25')];this[_0xa148('0x26')]=_0x50f775['ListId'];this['UserId']=_[_0xa148('0x4')](_0x50f775[_0xa148('0xd')])?_0x50f775['UserId']:_0x50f775[_0xa148('0xd')]['id'];this['VoiceQueueId']=_0x50f775[_0xa148('0x27')];this['originatecalleridnum']='';this[_0xa148('0x28')]='';}Action[_0xa148('0x29')][_0xa148('0x2a')]=function(){return util[_0xa148('0xf')]('\x22%s\x22\x20<%s>',this[_0xa148('0x11')],this[_0xa148('0x2b')]);};module[_0xa148('0x2c')]=Action;
\ No newline at end of file
diff --git a/server/services/ami/preview/index.js b/server/services/ami/preview/index.js
index b4c0de9..dbfc551 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 _0xc79b=['totalGlobal','cloneAction','Global','[callProgressDetectingCustomer][logNoSuchGlobal]','scheduledAt','countnosuchnumberretry','unlockAgent','activeContact','linkedid','ANSWER','responsetime','[syncHangup][talking][increment]','uniqueid','\x20Queue','custom:agentconnect','connect','custom:agentConnectPreview','custom:agentcomplete','buildObj','complete','outboundAnswerCallsDay','total','[16]','Answer','[callProgressDetectingCustomer][logAnswer]','crateCustomerReportQueue','sumDuration','talktime','sumBillable','[syncHangup][talking][decrement]','BUSY','Busy','[callProgressDetectingCustomer][logBusy]','[callProgressDetectingCustomer][logBusyGlobal]','dialBusyRetryFrequency','countnoanswerretry','NoAnswer','dialGlobalMaxRetry','dialNoAnswerMaxRetry','rescheduleContact','dialNoAnswerRetryFrequency','CONGESTION','Congestion','countcongestionretry','[callProgressDetectingCustomer][logCongestion]','CANCEL','AgentReject','[syncHangupRequest][logAgentReject]','unlockContact','idContact','ABANDONED','outboundAbandonedCallsDay','Abandoned','[callProgressDetectingCustomer][logAbandoned]','dialAbandonedMaxRety','countabandonedretry','dialAbandonedRetryFrequency','[default]','[Dialer][decrementTalkink][no\x20Hangup][Preview]','cause-txt','dialstatus','[callProgressDetectingCustomer][logUnknown]','[callProgressDetectingCustomer][logUnknownGlobal]','updateOriginated','[callProgressDetectingCustomer]','[originated][decrement][callProgressDetectingCustomer]','destlinkedid','callProgressDetectingAgent','isUndefined','object','reason','logAgent','NoSuchNumber','createAgentHistory','[callProgressDetectingAgent][logNoSuch]','[callProgressDetectingAgent][logNoAnswer]','[callProgressDetectingAgent][logBusy]','[callProgressDetectingAgent][logCongestion]','AnswerAGI','[callProgressDetectingAgent]','[originated][decrement][callProgressDetectingAgent]','checkInBlack','Contact','phone','Contact\x20is\x20undefined','lookAgent','isEmpty','execCall','[Preview][execCall][success]','Queue:\x20','\x20IdHopper:\x20','custom:agentcalled','called','Calling','[Preview][execCall][failure]','Call\x20failed','logBlacklist','createHistory','Contact\x20in\x20black\x20List','SIP/%s','reachable','unlock','execRun','getContactPreview','recallme','validateContact','Contact.phone','[Preview][checkIsBlackList]','Call\x20unsuccessful','[Preview][getContactPreview]','[Preview][validateContact][Empty\x20Contact]','[Preview][validateContact][Empty\x20Campaign]','Empty\x20Campaign','[Preview][validateContact][Trunk\x20not\x20work]','campaign\x20Name:\x20','\x20Trunk\x20is\x20not\x20active','Trunk\x20not\x20work','\x20Not\x20Active','SIP/%s/%s%s','trim','dialCutDigit','substring','getCallerId','getCallerIdRandom','dialOriginateCallerIdNumber','dialRandomLastDigitCallerIdNumber','extractCalleridName','addVariables','merge','toLowerVariables','starttime','variablesAction','[originateFailure][logOriginateFailure]','actionid','isFailure','response','custom:agentringnoanswer','rejected','[callProgressDetectingAgent][logAnswer]','[syncHangup][talking]','cause','statedesc','channelstate','transfer','[syncHangup][talking][transfer]','[syncHangup][talking][cause]','syncDialEnd','destuniqueid','variables','filterKey','keys','variable','value','error','[syncVarSet][Preview]','inspect','transfertargetlinkedid','syncBlindTransfer','transfererlinkedid','util','moment','md5','../../../config/environment','../../../config/logger','actionPreview','./action','./util/util','defaults','redis','localhost','socket.io-emitter','enqueue','tail','finally','sequence','campaignsPreview','trunks','actions','agents','clockClearZombieChannels','originateresponse','syncOriginateResponse','hangup','syncHangup','bind','syncHangupRequest','syncNewExten','varset','syncVarSet','attendedtransfer','syncAttendedTransfer','blindtransfer','loopCampaigns','emit','type','outbound','name','strategy','answered','available','loggedIn','pTalking','abandoned','loggedInDb','dialActive','dialMethod','dialOriginateCallerIdName','dialOriginateTimeout','dialPrefix','outboundAnswerAgiCallsDay','outboundBlacklistCallsDay','outboundBusyCallsDay','outboundCongestionCallsDay','outboundDropCallsDayACS','outboundDropCallsDayCallersExit','outboundNoAnswerCallsDay','outboundNoSuchCallsDay','outboundOriginateFailureCallsDay','outboundReCallsDay','outboundRejectCallsDay','outboundUnknownCallsDay','predictiveIntervalAvgHoldtime','predictiveIntervalAvgTalktime','predictiveIntervalErlangCalls','predictiveIntervalErlangCallsDroppedCalls','predictiveIntervalHitRate','predictiveIntervalMultiplicativeFactor','predictiveIntervalPauses','predictiveIntervalAvailable','predictiveIntervalTotalCalls','message','originated','erlangCalls','erlangCallToSecond','erlangBusyFactor','startPredictive','Trunk','active','callerid','Interval','voice:queue:%s','[DEBUG]\x20Emit\x20voice_queue_channel:remove\x20event','stringify','format','voice_queue_channel:remove','sendMessageOneNotActive','NOT_ACTIVE','logger','[CampaignPreview]\x20Campaign\x20Queue:\x20','\x20is\x20not\x20active','IS_DISACTIVED','\x20is\x20disactive','prototype','syncCampaigns','hasOwnProperty','clearZombieChannels','preview','setMessage','clearZombieChannel','isNil','info','[clearZombieChannels][talking]','Queue','queue','originated:\x20','pTalking:\x20','dialAnswer','pick','VoiceQueueId','ListId','Action','status','channel','catch','No\x20such\x20channel','[clearZombieChannel]','decrementTalkink','loggerError','[Dialer][checkChannel][pTalking][Preview]','[Dialer][checkChannel][Preview]','size','recallMe','agentReadyId','then','length','scheduledat','dialRecallMeTimeout','Agent','voicePause','run','logger2','[RecallMe]','disableContact','YYYY-MM-DD\x20HH:mm:ss','dialRecallInQueue','createBody','[HistoryDialRecallInQueue][historyCatch]','RecallFailedTimeout','createCustomerHistory','createCustomerFinal','[HistoryRecallClose]','[getContactRecallMe]','isActive','isTrunkReachable','TrunkBackup','TRUNK_IS_NOT_REACHABLE','callProgressDetectingCustomer','countglobal','logCustomer'];(function(_0x1c37a5,_0x59ee51){var _0x389d03=function(_0x51b4f4){while(--_0x51b4f4){_0x1c37a5['push'](_0x1c37a5['shift']());}};_0x389d03(++_0x59ee51);}(_0xc79b,0x9f));var _0xbc79=function(_0x448d58,_0x589775){_0x448d58=_0x448d58-0x0;var _0x1d7af4=_0xc79b[_0x448d58];return _0x1d7af4;};'use strict';var util=require(_0xbc79('0x0'));var _=require('lodash');var BPromise=require('bluebird');var uuid=require('uuid');var moment=require(_0xbc79('0x1'));var md5=require(_0xbc79('0x2'));var Redis=require('ioredis');var config=require(_0xbc79('0x3'));var logger=require(_0xbc79('0x4'))('preview');var loggerAction=require('../../../config/logger')(_0xbc79('0x5'));var ami=require('../ami');var rpcDb=require('./rpcDb');var Action=require(_0xbc79('0x6'));var ut=require(_0xbc79('0x7'));config['redis']=_[_0xbc79('0x8')](config[_0xbc79('0x9')],{'host':_0xbc79('0xa'),'port':0x18eb});var io=require(_0xbc79('0xb'))(new Redis(config[_0xbc79('0x9')]));var Sequence=function(){};Sequence['prototype'][_0xbc79('0xc')]=function(_0xbdad9f){this[_0xbc79('0xd')]=this[_0xbc79('0xd')]?this['tail'][_0xbc79('0xe')](_0xbdad9f):_0xbdad9f();};function Preview(_0x8f69b2){this[_0xbc79('0xf')]=new Sequence();this[_0xbc79('0x10')]=_0x8f69b2['voiceQueues'];this[_0xbc79('0x11')]=_0x8f69b2[_0xbc79('0x11')];this[_0xbc79('0x12')]={};this[_0xbc79('0x13')]=_0x8f69b2[_0xbc79('0x13')];this[_0xbc79('0x14')]=0x0;ami['on'](_0xbc79('0x15'),this[_0xbc79('0x16')]['bind'](this));ami['on'](_0xbc79('0x17'),this[_0xbc79('0x18')][_0xbc79('0x19')](this));ami['on']('hanguprequest',this[_0xbc79('0x1a')][_0xbc79('0x19')](this));ami['on']('dialend',this['syncDialEnd'][_0xbc79('0x19')](this));ami['on']('newexten',this[_0xbc79('0x1b')][_0xbc79('0x19')](this));ami['on'](_0xbc79('0x1c'),this[_0xbc79('0x1d')][_0xbc79('0x19')](this));ami['on'](_0xbc79('0x1e'),this[_0xbc79('0x1f')][_0xbc79('0x19')](this));ami['on'](_0xbc79('0x20'),this['syncBlindTransfer'][_0xbc79('0x19')](this));this[_0xbc79('0x21')](this[_0xbc79('0x10')]);}function emit(_0x487c74,_0x5a8bdf,_0x4a52d6){io['to'](_0x487c74)[_0xbc79('0x22')](_0x5a8bdf,_0x4a52d6);}function emitCampaignPreview(_0x2ed643){if(_0x2ed643[_0xbc79('0x23')]===_0xbc79('0x24')){var _0xb81265={'id':_0x2ed643['id'],'name':_0x2ed643[_0xbc79('0x25')],'strategy':_0x2ed643[_0xbc79('0x26')],'answered':_0x2ed643[_0xbc79('0x27')],'available':_0x2ed643[_0xbc79('0x28')],'loggedIn':_0x2ed643[_0xbc79('0x29')],'pTalking':_0x2ed643[_0xbc79('0x2a')],'sumBillable':_0x2ed643['sumBillable'],'sumDuration':_0x2ed643['sumDuration'],'sumHoldTime':_0x2ed643['sumHoldTime']||0x0,'talking':_0x2ed643['talking'],'total':_0x2ed643['total'],'type':_0x2ed643[_0xbc79('0x23')],'unmanaged':_0x2ed643['unmanaged'],'abandoned':_0x2ed643[_0xbc79('0x2b')],'waiting':_0x2ed643['waiting'],'loggedInDb':_0x2ed643[_0xbc79('0x2c')],'dialActive':_0x2ed643[_0xbc79('0x2d')],'dialMethod':_0x2ed643[_0xbc79('0x2e')],'dialOriginateCallerIdName':_0x2ed643[_0xbc79('0x2f')],'dialOriginateCallerIdNumber':_0x2ed643['dialOriginateCallerIdNumber'],'dialOriginateTimeout':_0x2ed643[_0xbc79('0x30')],'dialPrefix':_0x2ed643[_0xbc79('0x31')],'outboundAnswerAgiCallsDay':_0x2ed643[_0xbc79('0x32')],'outboundAnswerCallsDay':_0x2ed643['outboundAnswerCallsDay'],'outboundBlacklistCallsDay':_0x2ed643[_0xbc79('0x33')],'outboundBusyCallsDay':_0x2ed643[_0xbc79('0x34')],'outboundCongestionCallsDay':_0x2ed643[_0xbc79('0x35')],'outboundDropCallsDayACS':_0x2ed643[_0xbc79('0x36')],'outboundDropCallsDayCallersExit':_0x2ed643[_0xbc79('0x37')],'outboundDropCallsDayTimeout':_0x2ed643['outboundDropCallsDayTimeout'],'outboundNoAnswerCallsDay':_0x2ed643[_0xbc79('0x38')],'outboundNoSuchCallsDay':_0x2ed643[_0xbc79('0x39')],'outboundOriginateFailureCallsDay':_0x2ed643[_0xbc79('0x3a')],'outboundReCallsDay':_0x2ed643[_0xbc79('0x3b')],'outboundRejectCallsDay':_0x2ed643[_0xbc79('0x3c')],'outboundUnknownCallsDay':_0x2ed643[_0xbc79('0x3d')],'outboundAbandonedCallsDay':_0x2ed643['outboundAbandonedCallsDay'],'predictiveIntervalAnsweredCalls':_0x2ed643['predictiveIntervalAnsweredCalls'],'predictiveIntervalAvgHoldtime':_0x2ed643[_0xbc79('0x3e')],'predictiveIntervalAvgTalktime':_0x2ed643[_0xbc79('0x3f')],'predictiveIntervalDroppedCallsCallersExit':_0x2ed643['predictiveIntervalDroppedCallsCallersExit'],'predictiveIntervalDroppedCallsTimeout':_0x2ed643['predictiveIntervalDroppedCallsTimeout'],'predictiveIntervalErlangCalls':_0x2ed643[_0xbc79('0x40')],'predictiveIntervalErlangCallsDroppedCalls':_0x2ed643[_0xbc79('0x41')],'predictiveIntervalHitRate':_0x2ed643[_0xbc79('0x42')],'predictiveIntervalMultiplicativeFactor':_0x2ed643[_0xbc79('0x43')],'predictiveIntervalPauses':_0x2ed643[_0xbc79('0x44')],'predictiveIntervalAvailable':_0x2ed643[_0xbc79('0x45')],'predictiveIntervalTotalCalls':_0x2ed643[_0xbc79('0x46')],'message':_0x2ed643[_0xbc79('0x47')],'originated':_0x2ed643[_0xbc79('0x48')],'erlangCalls':_0x2ed643[_0xbc79('0x49')],'erlangCallToSecond':_0x2ed643[_0xbc79('0x4a')],'erlangAbandonmentRate':_0x2ed643['erlangAbandonmentRate'],'erlangBusyFactor':_0x2ed643[_0xbc79('0x4b')],'startPredictive':_0x2ed643[_0xbc79('0x4c')],'startProgressive':_0x2ed643['startProgressive']};if(_0x2ed643[_0xbc79('0x4d')]){_0xb81265[_0xbc79('0x4d')]={'id':_0x2ed643[_0xbc79('0x4d')]['id'],'name':_0x2ed643[_0xbc79('0x4d')][_0xbc79('0x25')],'active':_0x2ed643['Trunk'][_0xbc79('0x4e')],'callerid':_0x2ed643[_0xbc79('0x4d')][_0xbc79('0x4f')]};}if(_0x2ed643['Interval']){_0xb81265['Interval']={'id':_0x2ed643[_0xbc79('0x50')]['id'],'name':_0x2ed643['Interval'][_0xbc79('0x25')]};}var _0x53dbde=md5(JSON['stringify'](_0xb81265));if(_0x2ed643[_0xbc79('0x2')]!==_0x53dbde){_0x2ed643[_0xbc79('0x2')]=_0x53dbde;emit(util['format'](_0xbc79('0x51'),_0xb81265['name']),'voice_queue:save',_0xb81265);}}}function emitVoiceQueueChannelRemove(_0x2837da){logger['info'](_0xbc79('0x52'),JSON[_0xbc79('0x53')](_0x2837da));emit(util[_0xbc79('0x54')](_0xbc79('0x51'),_0x2837da[_0xbc79('0x25')]),_0xbc79('0x55'),_0x2837da);}function notSendMessagesQueue(_0x53c8d0){if(_0x53c8d0['sendMessageOneNotActive']){if(_0x53c8d0[_0xbc79('0x48')]===0x0&&_0x53c8d0['pTalking']===0x0){_0x53c8d0[_0xbc79('0x56')]=![];_0x53c8d0['available']=0x0;_0x53c8d0['paused']=0x0;_0x53c8d0[_0xbc79('0x47')]=_0xbc79('0x57');ut[_0xbc79('0x58')](_0xbc79('0x59'),_0x53c8d0[_0xbc79('0x25')]+_0xbc79('0x5a'));}else{_0x53c8d0[_0xbc79('0x47')]=_0xbc79('0x5b');ut[_0xbc79('0x58')]('[CampaignPreview]\x20Campaign\x20Queue:\x20',_0x53c8d0['name']+_0xbc79('0x5c'));}emitCampaignPreview(_0x53c8d0);}}Preview[_0xbc79('0x5d')][_0xbc79('0x21')]=function(){var _0x17afb1=this;setInterval(function(){_0x17afb1[_0xbc79('0x5e')]();},0x7cf);};Preview[_0xbc79('0x5d')][_0xbc79('0x5e')]=function(){var _0x196b04=this[_0xbc79('0x10')];this['clockClearZombieChannels']+=0x1;for(var _0x532a24 in _0x196b04){if(_0x196b04[_0xbc79('0x5f')](_0x532a24)&&(_0x196b04[_0x532a24][_0xbc79('0x2e')]==='preview'||_0x196b04[_0x532a24][_0xbc79('0x2e')]==='booked')&&_0x196b04[_0x532a24]['type']===_0xbc79('0x24')){if(this['clockClearZombieChannels']>0x7){this['clockClearZombieChannels']=0x0;this[_0xbc79('0x60')]();}}if(_0x196b04[_0xbc79('0x5f')](_0x532a24)&&_0x196b04[_0x532a24][_0xbc79('0x2e')]===_0xbc79('0x61')&&_0x196b04[_0x532a24][_0xbc79('0x23')]===_0xbc79('0x24')){if(_0x196b04[_0x532a24][_0xbc79('0x2d')]){this[_0xbc79('0x62')](_0x196b04[_0x532a24]);this['recallMe'](_0x196b04[_0x532a24]);}else{notSendMessagesQueue(_0x196b04[_0x532a24]);}}}};Preview['prototype'][_0xbc79('0x63')]=function(_0xb78d88){var _0x293dec=this;this[_0xbc79('0xf')]['enqueue'](function(){if(!_[_0xbc79('0x64')](_0x293dec[_0xbc79('0x12')][_0xb78d88])){loggerAction[_0xbc79('0x65')](_0xbc79('0x66'),_0xb78d88,_0xbc79('0x67'),_0x293dec[_0xbc79('0x12')][_0xb78d88][_0xbc79('0x68')],_0xbc79('0x69'),JSON[_0xbc79('0x53')](_0x293dec['campaignsPreview'][_0x293dec[_0xbc79('0x12')][_0xb78d88][_0xbc79('0x68')]][_0xbc79('0x48')]),_0xbc79('0x6a'),JSON[_0xbc79('0x53')](_0x293dec[_0xbc79('0x10')][_0x293dec[_0xbc79('0x12')][_0xb78d88][_0xbc79('0x68')]][_0xbc79('0x2a')]),JSON[_0xbc79('0x53')](_0x293dec[_0xbc79('0x12')][_0xb78d88][_0xbc79('0x6b')]),JSON[_0xbc79('0x53')](_[_0xbc79('0x6c')](_0x293dec[_0xbc79('0x12')][_0xb78d88],['contactId','UserId',_0xbc79('0x6d'),_0xbc79('0x6e')])));return ami[_0xbc79('0x6f')]({'action':_0xbc79('0x70'),'channel':_0x293dec[_0xbc79('0x12')][_0xb78d88][_0xbc79('0x71')]})[_0xbc79('0x72')](function(_0x113f45){if(_0x113f45[_0xbc79('0x47')]===_0xbc79('0x73')){setTimeout(function(){if(_0x293dec['actions'][_0xb78d88]){ut['updateOriginated'](_0x293dec[_0xbc79('0x10')][_0x293dec[_0xbc79('0x12')][_0xb78d88][_0xbc79('0x68')]],_0xbc79('0x74'));if(_0x293dec[_0xbc79('0x12')][_0xb78d88][_0xbc79('0x6b')]===!![]){ut[_0xbc79('0x75')](_0x293dec[_0xbc79('0x10')][_0x293dec['actions'][_0xb78d88][_0xbc79('0x68')]],_0xbc79('0x74'));ut[_0xbc79('0x76')](_0xbc79('0x77')+_0xb78d88,_0x293dec[_0xbc79('0x12')][_0xb78d88][_0xbc79('0x68')]);}ut[_0xbc79('0x76')](_0xbc79('0x78')+_0xb78d88,_0x293dec['actions'][_0xb78d88][_0xbc79('0x68')]);delete _0x293dec[_0xbc79('0x12')][_0xb78d88];}},0x2328);}});}});};Preview['prototype'][_0xbc79('0x60')]=function(){var _0x4737cc=this;loggerAction['info']('[action]',_[_0xbc79('0x79')](this[_0xbc79('0x12')]));for(var _0x370aa4 in this[_0xbc79('0x12')]){if(_0x4737cc[_0xbc79('0x12')]['hasOwnProperty'](_0x370aa4)){_0x4737cc[_0xbc79('0x63')](_0x370aa4);}}};Preview[_0xbc79('0x5d')][_0xbc79('0x7a')]=function(_0xeae9dd){var _0x1ad8a6=this;rpcDb['getContactRecallMe'](_0xeae9dd['id'],ut[_0xbc79('0x7b')](this[_0xbc79('0x13')]))[_0xbc79('0x7c')](function(_0x5c7c4b){if(!_[_0xbc79('0x64')](_0x5c7c4b)){for(var _0x495456=0x0;_0x495456<_0x5c7c4b[_0xbc79('0x7d')];_0x495456+=0x1){if(ut['getDiff'](_0x5c7c4b[_0x495456][_0xbc79('0x7e')])<_0xeae9dd[_0xbc79('0x7f')]*0x3c){if(_0x5c7c4b[_0x495456][_0xbc79('0x80')]&&!_0x5c7c4b[_0x495456][_0xbc79('0x80')][_0xbc79('0x81')]){_0x1ad8a6[_0xbc79('0x82')](_0x5c7c4b[_0x495456]['id'])[_0xbc79('0x7c')](ut[_0xbc79('0x83')]('[RecallMe]'))[_0xbc79('0x72')](ut[_0xbc79('0x83')](_0xbc79('0x84')));}else{rpcDb[_0xbc79('0x85')](_0x5c7c4b[_0x495456]['id']);}}else{var _0x1832a5=new Action(_0x5c7c4b[_0x495456],_0xeae9dd);_0x1832a5['starttime']=moment()['format'](_0xbc79('0x86'));_0xeae9dd['outboundReCallsDay']+=0x1;ut['logCustomer'](_0x1832a5,0x17,'RecallInQueue');if(_0xeae9dd[_0xbc79('0x87')]){rpcDb['rescheduleContactInQueue'](ut[_0xbc79('0x88')](_0x5c7c4b[_0x495456]));rpcDb['createCustomerHistory'](_0x1832a5,_0xbc79('0x89'));}else{ut['logCustomer'](_0x1832a5,0x16,_0xbc79('0x8a'));rpcDb[_0xbc79('0x8b')](_0x1832a5,'[HistoryRecallClose]');rpcDb[_0xbc79('0x8c')](_0x1832a5,_0xbc79('0x8d'));}}}}})[_0xbc79('0x72')](ut[_0xbc79('0x83')](_0xbc79('0x8e')));};Preview[_0xbc79('0x5d')][_0xbc79('0x62')]=function(_0x26419d){_0x26419d[_0xbc79('0x56')]=!![];if(ut['IsNotLoggedIn'](_0x26419d[_0xbc79('0x29')])){_0x26419d[_0xbc79('0x47')]='AGENTS_NOT_LOGGED';}else if(!ut[_0xbc79('0x8f')](_0x26419d[_0xbc79('0x2d')])){_0x26419d['message']='NOT_ACTIVE';}else if(!this[_0xbc79('0x90')](_0x26419d[_0xbc79('0x4d')])){if(!this[_0xbc79('0x90')](_0x26419d[_0xbc79('0x91')])){_0x26419d[_0xbc79('0x47')]=_0xbc79('0x92');}else{_0x26419d['message']='ACTIVE';}}else{_0x26419d[_0xbc79('0x47')]='ACTIVE';}emitCampaignPreview(_0x26419d);};Preview[_0xbc79('0x5d')][_0xbc79('0x93')]=function(_0x2f8098,_0x263b7e,_0x420e23){var _0x13afd5=this;var _0x2f88c0=this[_0xbc79('0x12')][_0x263b7e];var _0x427b44=this['campaignsPreview'][_0x2f88c0[_0xbc79('0x68')]];var _0x45e8f6;if(_0x427b44){switch(_0x420e23){case'1':_0x427b44['outboundNoSuchCallsDay']+=0x1;_0x2f88c0[_0xbc79('0x94')]=ut['totalGlobal'](_0x2f88c0);ut[_0xbc79('0x95')](_0x2f88c0,0x0,'NoSuchNumber');rpcDb['createCustomerHistory'](_0x2f88c0,'[callProgressDetectingCustomer][logNoSuch]');if(ut[_0xbc79('0x96')](_0x2f88c0)>=_0x427b44['dialGlobalMaxRetry']){_0x45e8f6=ut[_0xbc79('0x97')](_0x2f88c0,0xf,_0xbc79('0x98'));rpcDb[_0xbc79('0x8c')](_0x45e8f6,_0xbc79('0x99'));}else{if(_0x2f88c0['countnosuchnumberretry']>=_0x427b44['dialNoSuchNumberMaxRetry']){rpcDb[_0xbc79('0x8c')](_0x2f88c0,_0xbc79('0x99'));}else{rpcDb['rescheduleContact'](ut[_0xbc79('0x9a')](_0x2f88c0,_0xbc79('0x9b'),_0x427b44['dialNoSuchNumberRetryFrequency']),_0x2f88c0[_0xbc79('0x9c')],_0x2f88c0[_0xbc79('0x9d')]);}}delete this['actions'][_0x2f8098[_0xbc79('0x9e')]];break;case _0xbc79('0x9f'):var _0x5f4f32=moment()[_0xbc79('0x54')](_0xbc79('0x86'));_0x2f88c0[_0xbc79('0xa0')]=_0x5f4f32;_0x2f88c0['answertime']=_0x5f4f32;_0x2f88c0[_0xbc79('0x6b')]=!![];_0x427b44[_0xbc79('0x2a')]+=0x1;logger[_0xbc79('0x65')](_0xbc79('0xa1'),_0x2f88c0[_0xbc79('0xa2')],_0xbc79('0xa3'),_0x427b44['name'],_0xbc79('0x6a'),_0x427b44['pTalking']);ami[_0xbc79('0x22')](_0xbc79('0xa4'),ut['buildObj'](_0x2f88c0,_0xbc79('0xa5')));if(_0x427b44['acw']){ami[_0xbc79('0x22')](_0xbc79('0xa6'),ut['buildAcw'](_0x2f88c0));}break;case'16':ami[_0xbc79('0x22')](_0xbc79('0xa7'),ut[_0xbc79('0xa8')](_0x2f88c0,'complete'));emitVoiceQueueChannelRemove(ut[_0xbc79('0xa8')](_0x2f88c0,_0xbc79('0xa9')));_0x427b44[_0xbc79('0xaa')]+=0x1;_0x427b44[_0xbc79('0xab')]+=0x1;_0x427b44[_0xbc79('0x27')]+=0x1;ut[_0xbc79('0x75')](_0x427b44,_0xbc79('0xac'));_0x2f88c0[_0xbc79('0x94')]=ut[_0xbc79('0x96')](_0x2f88c0);ut['logCustomer'](_0x2f88c0,0x4,_0xbc79('0xad'));rpcDb[_0xbc79('0x8b')](_0x2f88c0,_0xbc79('0xae'));rpcDb[_0xbc79('0x8c')](_0x2f88c0,'[callProgressDetectingCustomer][logAnswerGlobal]');rpcDb[_0xbc79('0xaf')](_0x2f88c0);_0x427b44[_0xbc79('0xb0')]+=_0x2f88c0[_0xbc79('0xb1')];_0x427b44[_0xbc79('0xb2')]+=_0x2f88c0[_0xbc79('0xb1')];logger[_0xbc79('0x65')](_0xbc79('0xb3'),_0x2f88c0[_0xbc79('0xa2')],_0xbc79('0xa3'),_0x427b44['name'],_0xbc79('0x6a'),_0x427b44[_0xbc79('0x2a')]);delete this[_0xbc79('0x12')][_0x2f8098['linkedid']];break;case _0xbc79('0xb4'):_0x427b44[_0xbc79('0x34')]+=0x1;_0x2f88c0['countbusyretry']+=0x1;_0x2f88c0[_0xbc79('0x94')]=ut[_0xbc79('0x96')](_0x2f88c0);ut['logCustomer'](_0x2f88c0,0x5,_0xbc79('0xb5'));rpcDb[_0xbc79('0x8b')](_0x2f88c0,_0xbc79('0xb6'));if(ut['totalGlobal'](_0x2f88c0)>=_0x427b44['dialGlobalMaxRetry']){_0x45e8f6=ut['cloneAction'](_0x2f88c0,0xf,_0xbc79('0x98'));rpcDb['createCustomerFinal'](_0x45e8f6,_0xbc79('0xb7'));}else{if(_0x2f88c0['countbusyretry']>=_0x427b44['dialBusyMaxRetry']){rpcDb[_0xbc79('0x8c')](_0x2f88c0,_0xbc79('0xb6'));}else{rpcDb['rescheduleContact'](ut[_0xbc79('0x9a')](_0x2f88c0,'countbusyretry',_0x427b44[_0xbc79('0xb8')]),_0x2f88c0[_0xbc79('0x9c')],_0x2f88c0[_0xbc79('0x9d')]);}}break;case'NOANSWER':_0x427b44[_0xbc79('0x38')]+=0x1;_0x2f88c0[_0xbc79('0xb9')]+=0x1;_0x2f88c0[_0xbc79('0x94')]=ut[_0xbc79('0x96')](_0x2f88c0);ut[_0xbc79('0x95')](_0x2f88c0,0x3,_0xbc79('0xba'));rpcDb[_0xbc79('0x8b')](_0x2f88c0,'[callProgressDetectingCustomer][logNoAnswer]');if(ut['totalGlobal'](_0x2f88c0)>=_0x427b44[_0xbc79('0xbb')]){_0x45e8f6=ut[_0xbc79('0x97')](_0x2f88c0,0xf,'Global');rpcDb[_0xbc79('0x8c')](_0x45e8f6,'[callProgressDetectingCustomer][logNoAnswerGlobal]');}else{if(_0x2f88c0['countnoanswerretry']>=_0x427b44[_0xbc79('0xbc')]){rpcDb['createCustomerFinal'](_0x2f88c0,'[callProgressDetectingCustomer][logNoAnswer]');}else{rpcDb[_0xbc79('0xbd')](ut['scheduledAt'](_0x2f88c0,_0xbc79('0xb9'),_0x427b44[_0xbc79('0xbe')]),_0x2f88c0[_0xbc79('0x9c')],_0x2f88c0['activeContact']);}}break;case _0xbc79('0xbf'):_0x427b44[_0xbc79('0x35')]+=0x1;_0x2f88c0['countcongestionretry']+=0x1;_0x2f88c0[_0xbc79('0x94')]=ut[_0xbc79('0x96')](_0x2f88c0);ut[_0xbc79('0x95')](_0x2f88c0,0x8,_0xbc79('0xc0'));rpcDb['createCustomerHistory'](_0x2f88c0,'[callProgressDetectingCustomer][logCongestion]');if(ut[_0xbc79('0x96')](_0x2f88c0)>=_0x427b44[_0xbc79('0xbb')]){_0x45e8f6=ut[_0xbc79('0x97')](_0x2f88c0,0xf,'Global');rpcDb['createCustomerFinal'](_0x45e8f6,'[callProgressDetectingCustomer][logCongestionGlobal]');}else{if(_0x2f88c0[_0xbc79('0xc1')]>=_0x427b44['dialCongestionMaxRetry']){rpcDb[_0xbc79('0x8c')](_0x2f88c0,_0xbc79('0xc2'));}else{rpcDb[_0xbc79('0xbd')](ut[_0xbc79('0x9a')](_0x2f88c0,'countcongestionretry',_0x427b44[_0xbc79('0xb8')]),_0x2f88c0[_0xbc79('0x9c')],_0x2f88c0[_0xbc79('0x9d')]);}}break;case _0xbc79('0xc3'):_0x427b44[_0xbc79('0x3c')]+=0x1;_0x2f88c0[_0xbc79('0x94')]=ut['totalGlobal'](_0x2f88c0);ut[_0xbc79('0x95')](_0x2f88c0,0x14,_0xbc79('0xc4'));rpcDb[_0xbc79('0x8b')](_0x2f88c0,_0xbc79('0xc5'));if(_0x2f88c0[_0xbc79('0x9c')]){rpcDb[_0xbc79('0xc6')](_0x2f88c0[_0xbc79('0xc7')]);}if(_0x2f88c0[_0xbc79('0x9d')]){rpcDb[_0xbc79('0x85')](_0x2f88c0['idContact']);}break;case _0xbc79('0xc8'):_0x427b44[_0xbc79('0xc9')]+=0x1;_0x2f88c0['countabandonedretry']+=0x1;_0x2f88c0['countglobal']=ut[_0xbc79('0x96')](_0x2f88c0);ut[_0xbc79('0x95')](_0x2f88c0,0xb,_0xbc79('0xca'));rpcDb[_0xbc79('0x8b')](_0x2f88c0,_0xbc79('0xcb'));if(ut[_0xbc79('0x96')](_0x2f88c0)>=_0x427b44['dialGlobalMaxRetry']){_0x45e8f6=ut[_0xbc79('0x97')](_0x2f88c0,0xf,_0xbc79('0x98'));rpcDb[_0xbc79('0x8c')](_0x45e8f6,'[callProgressDetectingCustomer][logAbandoned]');}else{if(_0x2f88c0['countabandonedetry']>=_0x427b44[_0xbc79('0xcc')]){rpcDb[_0xbc79('0x8c')](_0x2f88c0,_0xbc79('0xcb'));}else{rpcDb[_0xbc79('0xbd')](ut[_0xbc79('0x9a')](_0x2f88c0,_0xbc79('0xcd'),_0x427b44[_0xbc79('0xce')]),_0x2f88c0[_0xbc79('0x9c')],_0x2f88c0[_0xbc79('0x9d')]);}}break;default:if(_0x2f88c0['dialAnswer']){ut[_0xbc79('0x75')](_0x427b44,_0xbc79('0xcf'));ut[_0xbc79('0x76')](_0xbc79('0xd0')+_0x427b44[_0xbc79('0x25')],_0x2f8098);}_0x427b44['outboundUnknownCallsDay']+=0x1;_0x2f88c0[_0xbc79('0x94')]=ut['totalGlobal'](_0x2f88c0);ut['logCustomer'](_0x2f88c0,0xc,_0x2f8098[_0xbc79('0xd1')]||_0x2f8098[_0xbc79('0xd2')]);rpcDb['createCustomerHistory'](_0x2f88c0,_0xbc79('0xd3'));if(ut[_0xbc79('0x96')](_0x2f88c0)>=_0x427b44[_0xbc79('0xbb')]){_0x45e8f6=ut[_0xbc79('0x97')](_0x2f88c0,0xf,_0xbc79('0x98'));rpcDb[_0xbc79('0x8c')](_0x45e8f6,_0xbc79('0xd4'));}else{rpcDb[_0xbc79('0x8c')](_0x2f88c0,'[callProgressDetectingCustomer][logUnknownGlobal]');}delete this[_0xbc79('0x12')][_0x2f8098[_0xbc79('0x9e')]];}if(!(_0x2f88c0[_0xbc79('0x6b')]&&_0x420e23==='16')){ut[_0xbc79('0xd5')](_0x427b44,_0xbc79('0xd6'));logger[_0xbc79('0x65')](_0xbc79('0xd7'),_0x2f88c0[_0xbc79('0xa2')],_0xbc79('0xa3'),_0x427b44[_0xbc79('0x25')],_0xbc79('0x69'),_0x427b44[_0xbc79('0x48')]);}if(_0x420e23!=='ANSWER'){delete this[_0xbc79('0x12')][_0x2f8098[_0xbc79('0x9e')]];delete this[_0xbc79('0x12')][_0x2f8098[_0xbc79('0xd8')]];}}};Preview[_0xbc79('0x5d')][_0xbc79('0xd9')]=function(_0x568671,_0x4766e8,_0x340b60){if(_[_0xbc79('0xda')](_0x4766e8)&&'object'!==typeof _0x4766e8){return;}if(_['isUndefined'](_0x340b60)&&_0xbc79('0xdb')!==typeof _0x340b60){return;}switch(_0x340b60[_0xbc79('0xdc')]){case'0':ut[_0xbc79('0xdd')](_0x568671,0x0,_0xbc79('0xde'));rpcDb[_0xbc79('0xdf')](_0x568671,_0xbc79('0xe0'));break;case'3':ut[_0xbc79('0xdd')](_0x568671,0x3,_0xbc79('0xba'));rpcDb['createAgentHistory'](_0x568671,_0xbc79('0xe1'));break;case'5':ut[_0xbc79('0xdd')](_0x568671,0x5,'Busy');rpcDb['createAgentHistory'](_0x568671,_0xbc79('0xe2'));break;case'8':ut[_0xbc79('0xdd')](_0x568671,0x8,_0xbc79('0xc0'));rpcDb[_0xbc79('0xdf')](_0x568671,_0xbc79('0xe3'));break;case'22':ut[_0xbc79('0xdd')](_0x568671,0x16,_0xbc79('0xe4'));rpcDb[_0xbc79('0xdf')](_0x568671,'[callProgressDetectingAgent][logAnswerAGI]');break;default:ut[_0xbc79('0xdd')](_0x568671,0xc,_0x340b60[_0xbc79('0xdc')]);rpcDb['createAgentHistory'](_0x568671,_0xbc79('0xe3'));}ut['updateOriginated'](_0x4766e8,_0xbc79('0xe5'));logger[_0xbc79('0x65')](_0xbc79('0xe6'),_0x568671[_0xbc79('0xa2')],_0xbc79('0xa3'),_0x4766e8[_0xbc79('0x25')],_0xbc79('0x69'),_0x4766e8[_0xbc79('0x48')]);delete this[_0xbc79('0x12')][_0x568671[_0xbc79('0xa2')]];};Preview['prototype'][_0xbc79('0xe7')]=function(_0x481637,_0x1ffc6b,_0x22de7c,_0x1e1cf9,_0x82c102){var _0x4f8b09=this;return new BPromise(function(_0x5e1a22,_0x1926cf){if(_[_0xbc79('0x64')](_0x1ffc6b)||_[_0xbc79('0x64')](_0x1ffc6b[_0xbc79('0xe8')])||_['isNil'](_0x1ffc6b[_0xbc79('0xe8')][_0xbc79('0xe9')])||_[_0xbc79('0x64')](_0x1ffc6b['VoiceQueueId'])){_0x1926cf(ut[_0xbc79('0x47')](_0xbc79('0xea'),_0x1e1cf9,_0x82c102));return;}var _0x3a31fd=uuid['v4']();var _0x512e37=_0x4f8b09['campaignsPreview'][_0x1ffc6b[_0xbc79('0x67')]['name']];var _0x2ab936=_0x22de7c?_0x4f8b09['agents'][_0x22de7c]['id']:undefined;_0x4f8b09['actions'][_0x3a31fd]=new Action(_0x1ffc6b,_0x512e37,_0x3a31fd,_0x22de7c,_0x2ab936);var _0x502e23=_0x4f8b09[_0xbc79('0x12')][_0x3a31fd];_0x502e23[_0xbc79('0x9c')]=_0x1e1cf9;_0x502e23['activeContact']=_0x82c102;_0x502e23[_0xbc79('0xeb')]=_0x22de7c;if(_[_0xbc79('0xec')](_0x481637)){_0x4f8b09[_0xbc79('0xed')](_0x502e23,_0x512e37,_0x1ffc6b,_0x22de7c)[_0xbc79('0x7c')](function(_0x52e2f7){logger['info'](_0xbc79('0xee'),_0xbc79('0xef')+_0x502e23[_0xbc79('0x68')]+_0xbc79('0xf0')+_0x502e23[_0xbc79('0xc7')],JSON[_0xbc79('0x53')](_0x52e2f7));ami[_0xbc79('0x22')](_0xbc79('0xf1'),ut[_0xbc79('0xa8')](_0x502e23,_0xbc79('0xf2')));_0x5e1a22(ut[_0xbc79('0x47')](_0xbc79('0xf3')));})[_0xbc79('0x72')](function(_0x3f5f44){ut[_0xbc79('0x58')](_0xbc79('0xf4'),_0x3f5f44);_0x1926cf(ut[_0xbc79('0x47')](_0xbc79('0xf5'),_0x1e1cf9,_0x82c102));});}else{_0x512e37[_0xbc79('0x33')]+=0x1;ut[_0xbc79('0xf6')](_0x502e23);rpcDb[_0xbc79('0xf7')](_0x502e23,'[Blacklist][error]');delete _0x4f8b09[_0xbc79('0x12')][_0x3a31fd];_0x1926cf(ut[_0xbc79('0x47')](_0xbc79('0xf8'),_0x1e1cf9,_0x82c102));}});};Preview[_0xbc79('0x5d')][_0xbc79('0x90')]=function(_0x24542d){return!_[_0xbc79('0x64')](_0x24542d)&&!_[_0xbc79('0x64')](_0x24542d[_0xbc79('0x25')])&&!_[_0xbc79('0x64')](_0x24542d['active'])&&_0x24542d[_0xbc79('0x4e')]&&!_[_0xbc79('0x64')](this['trunks'][util[_0xbc79('0x54')]('SIP/%s',_0x24542d[_0xbc79('0x25')])])&&!_['isNil'](this[_0xbc79('0x11')][util[_0xbc79('0x54')]('SIP/%s',_0x24542d[_0xbc79('0x25')])]['status'])&&(this[_0xbc79('0x11')][util[_0xbc79('0x54')](_0xbc79('0xf9'),_0x24542d[_0xbc79('0x25')])]['status']===_0xbc79('0xfa')||this[_0xbc79('0x11')][util['format'](_0xbc79('0xf9'),_0x24542d['name'])]['status']==='unmonitored');};Preview[_0xbc79('0x5d')][_0xbc79('0x82')]=function(_0x54b1b3,_0x13e11a){var _0x42cf64=this;return new BPromise(function(_0x1ccaeb,_0x1e9376){_0x42cf64['execRun'](_0x54b1b3,_0x13e11a)[_0xbc79('0x7c')](function(_0x471cb1){_0x1ccaeb(_[_0xbc79('0x6c')](_0x471cb1,[_0xbc79('0x47')]));})[_0xbc79('0x72')](function(_0x19b2e5){if(_0x19b2e5[_0xbc79('0xfb')]){rpcDb['unlockContact'](_0x54b1b3);}if(_0x19b2e5[_0xbc79('0x4e')]){rpcDb[_0xbc79('0x85')](_0x54b1b3);}_0x1e9376(_['pick'](_0x19b2e5,[_0xbc79('0x47')]));});});};Preview[_0xbc79('0x5d')][_0xbc79('0xfc')]=function(_0x30a96e,_0x46bc0c){var _0x5d15bb=this;return new BPromise(function(_0x25d48d,_0x4028be){var _0x3289a4,_0x3294b2;rpcDb[_0xbc79('0xfd')](_0x30a96e)[_0xbc79('0x7c')](function(_0x1011ae){if(!_['isNil'](_0x1011ae[0x0])){_0x3294b2=_0x1011ae[0x0][_0xbc79('0xfe')]?![]:!![];_0x3289a4=_0x1011ae[0x0][_0xbc79('0xfe')]?!![]:![];_0x3289a4=_0x46bc0c?!![]:_0x3289a4;}var _0x1243ba=_0x5d15bb[_0xbc79('0xff')](_0x1011ae);if(_0x1243ba['isValid']){rpcDb['checkIsBlackList'](_[_0xbc79('0x6c')](_0x1011ae[0x0],['VoiceQueueId',_0xbc79('0x100')]))[_0xbc79('0x7c')](function(_0x485e42){_0x5d15bb['checkInBlack'](_0x485e42,_0x1011ae[0x0],_0x46bc0c,_0x3294b2,_0x3289a4)['then'](function(_0x3b44b6){_0x25d48d(_0x3b44b6);})[_0xbc79('0x72')](function(_0x4389e4){_0x4028be(_0x4389e4);});})[_0xbc79('0x72')](function(_0x45a494){ut['logger'](_0xbc79('0x101'),_0x45a494);_0x4028be(ut[_0xbc79('0x47')](_0xbc79('0x102'),_0x3294b2,_0x3289a4));});}else{_0x4028be(ut[_0xbc79('0x47')](_0x1243ba[_0xbc79('0x47')],_0x3294b2,_0x3289a4));}})['catch'](function(_0x4f7634){ut[_0xbc79('0x58')](_0xbc79('0x103'),_0x4f7634);_0x4028be(ut[_0xbc79('0x47')](_0xbc79('0x102'),![],!![]));});});};Preview[_0xbc79('0x5d')][_0xbc79('0xff')]=function(_0x175168){if(_['isNil'](_0x175168)||_[_0xbc79('0xec')](_0x175168)||!_[_0xbc79('0x64')](_0x175168[0x0][_0xbc79('0x80')])&&_[_0xbc79('0x64')](_0x175168[0x0][_0xbc79('0x80')][_0xbc79('0x25')])){ut[_0xbc79('0x58')](_0xbc79('0x104'),_0x175168);return{'isValid':![],'message':'Empty\x20Contact'};}var _0x4613a8=this[_0xbc79('0x10')][_0x175168[0x0][_0xbc79('0x67')][_0xbc79('0x25')]];_0x4613a8['message']='ACTIVE';if(_[_0xbc79('0x64')](_0x4613a8)){ut['logger'](_0xbc79('0x105'),_0x4613a8);return{'isValid':![],'message':_0xbc79('0x106')};}if(!this[_0xbc79('0x90')](_0x4613a8[_0xbc79('0x4d')])){ut[_0xbc79('0x58')](_0xbc79('0x107'),_0xbc79('0x108')+_0x4613a8[_0xbc79('0x25')]+_0xbc79('0x109'));if(!this[_0xbc79('0x90')](_0x4613a8[_0xbc79('0x91')])){ut[_0xbc79('0x58')](_0xbc79('0x107'),_0x4613a8[_0xbc79('0x25')]+'\x20Trunk\x20Backup\x20is\x20not\x20active');return{'isValid':![],'message':_0xbc79('0x10a')};}}if(!ut['isActive'](_0x4613a8[_0xbc79('0x2d')])){ut[_0xbc79('0x58')]('[Preview][validateContact][Campaign\x20Active]',_0x4613a8['name']+'\x20Not\x20Active');return{'isValid':![],'message':_0xbc79('0x108')+_0x4613a8['name']+_0xbc79('0x10b')};}return{'isValid':!![],'message':'Is\x20Valid'};};Preview[_0xbc79('0x5d')][_0xbc79('0xed')]=function(_0xb95332,_0x21611c,_0x14fde9,_0x471973){var _0x2ce25c=this;return new BPromise(function(_0x1cd77c,_0x1f173f){var _0xbaa438=_0xb95332[_0xbc79('0xa2')];var _0x4bf11b=_0x2ce25c[_0xbc79('0x90')](_0x21611c[_0xbc79('0x4d')])?util[_0xbc79('0x54')](_0xbc79('0x10c'),_0x21611c['Trunk']['name'],_[_0xbc79('0x64')](_0x21611c[_0xbc79('0x31')])?'':_0x21611c[_0xbc79('0x31')][_0xbc79('0x10d')]()||'',_0x21611c[_0xbc79('0x10e')]>0x0?_0x14fde9['Contact'][_0xbc79('0xe9')][_0xbc79('0x10f')](_0x21611c[_0xbc79('0x10e')]):_0x14fde9[_0xbc79('0xe8')]['phone']):util[_0xbc79('0x54')](_0xbc79('0x10c'),_[_0xbc79('0x64')](_0x21611c['TrunkBackup'])?_0x21611c[_0xbc79('0x4d')][_0xbc79('0x25')]:_0x21611c[_0xbc79('0x91')][_0xbc79('0x25')],_[_0xbc79('0x64')](_0x21611c['dialPrefix'])?'':_0x21611c[_0xbc79('0x31')][_0xbc79('0x10d')]()||'',_0x21611c[_0xbc79('0x10e')]>0x0?_0x14fde9[_0xbc79('0xe8')][_0xbc79('0xe9')][_0xbc79('0x10f')](_0x21611c['dialCutDigit']):_0x14fde9[_0xbc79('0xe8')][_0xbc79('0xe9')]);var _0x3d1db3=_0x2ce25c[_0xbc79('0x90')](_0x21611c[_0xbc79('0x4d')])?ut[_0xbc79('0x110')](_0x21611c[_0xbc79('0x4d')][_0xbc79('0x4f')],_0x21611c[_0xbc79('0x2f')],_0x21611c['dialRandomLastDigitCallerIdNumber']>0x0?ut[_0xbc79('0x111')](_0x21611c[_0xbc79('0x112')],_0x21611c[_0xbc79('0x113')]):_0x21611c[_0xbc79('0x112')]):ut[_0xbc79('0x110')](_[_0xbc79('0x64')](_0x21611c[_0xbc79('0x91')])?_0x21611c[_0xbc79('0x4d')][_0xbc79('0x4f')]:_0x21611c[_0xbc79('0x91')]['callerid'],_0x21611c[_0xbc79('0x2f')],_0x21611c[_0xbc79('0x113')]>0x0?ut['getCallerIdRandom'](_0x21611c[_0xbc79('0x112')],_0x21611c[_0xbc79('0x113')]):_0x21611c['dialOriginateCallerIdNumber']);if(_0x3d1db3){_0xb95332['originatecalleridname']=ut[_0xbc79('0x114')](_0x3d1db3);_0xb95332['originatecalleridnum']=ut['extractCalleridNumber'](_0x3d1db3);}var _0x5619d8=ut[_0xbc79('0x115')](_0x21611c,_0x14fde9,_0x4bf11b,_0x3d1db3,_0xbaa438,_0xb95332);_[_0xbc79('0x116')](_0xb95332,ut[_0xbc79('0x117')](_0x5619d8));_0xb95332[_0xbc79('0x118')]=moment()[_0xbc79('0x54')](_0xbc79('0x86'));ami[_0xbc79('0x6f')](ut[_0xbc79('0x119')](_0xb95332,_0x21611c,_0x5619d8,_0xb95332['activeContact'],_0x471973))[_0xbc79('0x7c')](function(_0x2816df){_0x21611c['originated']+=0x1;logger[_0xbc79('0x65')]('[originated][increment]',_0xbaa438,_0xbc79('0xa3'),_0x21611c[_0xbc79('0x25')],_0xbc79('0x69'),_0x21611c[_0xbc79('0x48')]);_0x1cd77c(_0x2816df);})['catch'](function(_0x5df20e){ut[_0xbc79('0xdd')](_0xb95332,0xe,'OriginateError');rpcDb[_0xbc79('0xdf')](_0xb95332,_0xbc79('0x11a'));_0x1f173f(_0x5df20e);});});};Preview[_0xbc79('0x5d')][_0xbc79('0x1b')]=function(_0x57513c){if(this[_0xbc79('0x12')][_0x57513c[_0xbc79('0x9e')]]){this[_0xbc79('0x12')][_0x57513c[_0xbc79('0x9e')]][_0xbc79('0x71')]=_0x57513c[_0xbc79('0x71')];}};Preview[_0xbc79('0x5d')][_0xbc79('0x16')]=function(_0x9ee89f){var _0x243265=this;var _0x2f2b0b=this[_0xbc79('0x12')][_0x9ee89f[_0xbc79('0x11b')]];if(_0x2f2b0b){if(_0x2f2b0b['lookAgent']&&this[_0xbc79('0x13')][_0x2f2b0b[_0xbc79('0xeb')]]){ut['logLookAgent'](_0x2f2b0b,this[_0xbc79('0x13')][_0x2f2b0b[_0xbc79('0xeb')]]['name'],this['agents'][_0x2f2b0b['lookAgent']]['id']);}var _0x16daed=_['clone'](_0x2f2b0b);_0x16daed[_0xbc79('0xa0')]=moment()['format']('YYYY-MM-DD\x20HH:mm:ss');var _0x148d17=_0x243265['campaignsPreview'][_0x2f2b0b[_0xbc79('0x68')]];if(ut[_0xbc79('0x11c')](_0x9ee89f[_0xbc79('0x11d')])){if(_0x2f2b0b['unlockAgent']){rpcDb[_0xbc79('0xc6')](_0x2f2b0b[_0xbc79('0xc7')]);}if(_0x2f2b0b['activeContact']){rpcDb[_0xbc79('0x85')](_0x2f2b0b['idContact']);}ami[_0xbc79('0x22')](_0xbc79('0x11e'),ut[_0xbc79('0xa8')](_0x2f2b0b,_0xbc79('0x11f')));this['callProgressDetectingAgent'](_0x16daed,_0x148d17,_0x9ee89f);}else{_0x2f2b0b[_0xbc79('0x118')]=moment()[_0xbc79('0x54')](_0xbc79('0x86'));ut[_0xbc79('0xdd')](_0x16daed,0x4,_0xbc79('0xad'));rpcDb[_0xbc79('0xdf')](_0x16daed,_0xbc79('0x120'));}}};Preview[_0xbc79('0x5d')][_0xbc79('0x18')]=function(_0x1d1562){var _0x432fe5=this;var _0x272c16=this[_0xbc79('0x12')][_0x1d1562[_0xbc79('0x9e')]];var _0x372194;if(_0x272c16){_0x372194=this['campaignsPreview'][_0x272c16[_0xbc79('0x68')]];logger[_0xbc79('0x65')](_0xbc79('0x121'),_0x1d1562[_0xbc79('0x9e')],'\x20Queue',_0x372194[_0xbc79('0x25')],_0xbc79('0x6a'),_0x372194[_0xbc79('0x2a')]);}if(this[_0xbc79('0x12')][_0x1d1562[_0xbc79('0x9e')]]&&_0x1d1562['linkedid']!==_0x1d1562[_0xbc79('0xa2')]){if(_0x1d1562[_0xbc79('0x122')]==='16'&&this[_0xbc79('0x12')][_0x1d1562[_0xbc79('0x9e')]]['dialAnswer']){this['callProgressDetectingCustomer'](_0x1d1562,_0x1d1562['linkedid'],_0x1d1562[_0xbc79('0x122')]);}else if(this['actions'][_0x1d1562['linkedid']]['dialAnswer']){logger[_0xbc79('0x65')]('[syncHangup][talking][cause]',_0x1d1562[_0xbc79('0x9e')],_0x1d1562[_0xbc79('0x122')],_0xbc79('0xa3'),_0x372194[_0xbc79('0x25')],'pTalking:\x20',_0x372194[_0xbc79('0x2a')]);this[_0xbc79('0x93')](_0x1d1562,_0x1d1562[_0xbc79('0x9e')],_0x1d1562[_0xbc79('0x122')]);}}else if(_0x272c16&&_['isNil'](_0x272c16[_0xbc79('0x123')])&&_0x372194['dialQueueProject']&&_0x1d1562['linkedid']===_0x1d1562[_0xbc79('0xa2')]&&_[_0xbc79('0x64')](_0x1d1562['reason'])&&_0x1d1562['cause']==='16'&&_0x1d1562[_0xbc79('0x124')]==='6'&&_[_0xbc79('0xda')](_0x272c16[_0xbc79('0x125')])){if(_0x272c16[_0xbc79('0x9c')]){rpcDb[_0xbc79('0xc6')](_0x272c16[_0xbc79('0xc7')]);}if(_0x272c16[_0xbc79('0x9d')]){rpcDb[_0xbc79('0x85')](_0x272c16['idContact']);}_0x1d1562[_0xbc79('0xdc')]='22';this[_0xbc79('0xd9')](_0x272c16,_0x372194,_0x1d1562);}else if(_0x272c16&&_0x272c16['transfer']){if(_0x1d1562['cause']==='16'&&this[_0xbc79('0x12')][_0x1d1562[_0xbc79('0x9e')]][_0xbc79('0x6b')]){logger[_0xbc79('0x65')](_0xbc79('0x126'),_0x1d1562[_0xbc79('0x9e')],_0x1d1562['cause'],_0xbc79('0xa3'),_0x372194[_0xbc79('0x25')],_0xbc79('0x6a'),_0x372194[_0xbc79('0x2a')]);this[_0xbc79('0x93')](_0x1d1562,_0x1d1562[_0xbc79('0x9e')],_0x1d1562[_0xbc79('0x122')]);}else if(this[_0xbc79('0x12')][_0x1d1562['linkedid']][_0xbc79('0x6b')]){logger[_0xbc79('0x65')](_0xbc79('0x127'),_0x1d1562[_0xbc79('0x9e')],_0x1d1562[_0xbc79('0x122')],_0xbc79('0xa3'),_0x372194[_0xbc79('0x25')],_0xbc79('0x6a'),_0x372194[_0xbc79('0x2a')]);this['callProgressDetectingCustomer'](_0x1d1562,_0x1d1562[_0xbc79('0x9e')],_0x1d1562[_0xbc79('0x122')]);}}};Preview['prototype'][_0xbc79('0x128')]=function(_0x1e7abb){if(this[_0xbc79('0x12')][_0x1e7abb['destlinkedid']]&&_0x1e7abb[_0xbc79('0xd8')]!==_0x1e7abb[_0xbc79('0x129')]){this[_0xbc79('0x93')](_0x1e7abb,_0x1e7abb[_0xbc79('0xd8')],_0x1e7abb[_0xbc79('0xd2')]);}};Preview[_0xbc79('0x5d')][_0xbc79('0x1a')]=function(_0x1f22ff){if(this[_0xbc79('0x12')][_0x1f22ff[_0xbc79('0x9e')]]&&_0x1f22ff[_0xbc79('0x9e')]!==_0x1f22ff[_0xbc79('0xa2')]&&!this[_0xbc79('0x12')][_0x1f22ff['linkedid']][_0xbc79('0x6b')]){if(_0x1f22ff[_0xbc79('0x122')]==='1'){this['callProgressDetectingCustomer'](_0x1f22ff,_0x1f22ff[_0xbc79('0x9e')],_0x1f22ff[_0xbc79('0x122')]);}}};Preview['prototype']['addVariable']=function(_0x2e052f,_0x511c49,_0x2153e1){if(this[_0xbc79('0x12')][_0x2e052f]){if(_['isNil'](this['actions'][_0x2e052f]['variables'])){this[_0xbc79('0x12')][_0x2e052f][_0xbc79('0x12a')]={};}this[_0xbc79('0x12')][_0x2e052f][_0xbc79('0x12a')][_0x511c49]=_0x2153e1;}};Preview[_0xbc79('0x5d')][_0xbc79('0x1d')]=function(_0x3879d8){try{if(!_[_0xbc79('0x64')](_0x3879d8)){if(ut[_0xbc79('0x12b')](_[_0xbc79('0x12c')](_0x3879d8[_0xbc79('0x12d')])[0x0])){this['addVariable'](_0x3879d8[_0xbc79('0xa2')],_[_0xbc79('0x12c')](_0x3879d8['variable'])[0x0],_0x3879d8[_0xbc79('0x12e')]);}}}catch(_0x37638c){logger[_0xbc79('0x12f')](_0xbc79('0x130'),util[_0xbc79('0x131')](_0x37638c,{'showHidden':![],'depth':null}));}};Preview['prototype'][_0xbc79('0x1f')]=function(_0x274736){if(_0x274736){if(this[_0xbc79('0x12')][_0x274736[_0xbc79('0x132')]]){this[_0xbc79('0x12')][_0x274736[_0xbc79('0x132')]][_0xbc79('0x125')]=!![];}}};Preview[_0xbc79('0x5d')][_0xbc79('0x133')]=function(_0x22cddc){if(_0x22cddc){if(this[_0xbc79('0x12')][_0x22cddc[_0xbc79('0x134')]]){this[_0xbc79('0x12')][_0x22cddc[_0xbc79('0x134')]][_0xbc79('0x125')]=!![];}}};module['exports']=Preview;
\ No newline at end of file
+var _0xb6a0=['voice_queue:save','info','stringify','format','voice:queue:%s','voice_queue_channel:remove','sendMessageOneNotActive','NOT_ACTIVE','logger','[CampaignPreview]\x20Campaign\x20Queue:\x20','\x20is\x20not\x20active','IS_DISACTIVED','\x20is\x20disactive','prototype','clearZombieChannels','hasOwnProperty','recallMe','isNil','actions','originated:\x20','queue','pTalking:\x20','pTalking','dialAnswer','contactId','UserId','ListId','status','channel','No\x20such\x20channel','[clearZombieChannel]','loggerError','[Dialer][checkChannel][Preview]','[action]','size','getContactRecallMe','then','length','scheduledat','dialRecallMeTimeout','Agent','run','logger2','[RecallMe]','catch','starttime','YYYY-MM-DD\x20HH:mm:ss','logCustomer','RecallInQueue','dialRecallInQueue','rescheduleContactInQueue','createBody','[HistoryDialRecallInQueue][historyCatch]','RecallFailedTimeout','createCustomerHistory','[HistoryRecallClose]','createCustomerFinal','[getContactRecallMe]','IsNotLoggedIn','AGENTS_NOT_LOGGED','isTrunkReachable','TrunkBackup','TRUNK_IS_NOT_REACHABLE','callProgressDetectingCustomer','countglobal','totalGlobal','[callProgressDetectingCustomer][logNoSuch]','dialGlobalMaxRetry','cloneAction','[callProgressDetectingCustomer][logNoSuchGlobal]','countnosuchnumberretry','dialNoSuchNumberMaxRetry','scheduledAt','activeContact','linkedid','ANSWER','responsetime','answertime','uniqueid','\x20Queue','emit','custom:agentconnect','buildObj','connect','buildAcw','custom:agentcomplete','complete','decrementTalkink','[callProgressDetectingCustomer][logAnswer]','[callProgressDetectingCustomer][logAnswerGlobal]','crateCustomerReportQueue','talktime','[syncHangup][talking][decrement]','Busy','[callProgressDetectingCustomer][logBusy]','Global','countbusyretry','dialBusyMaxRetry','rescheduleContact','unlockAgent','NOANSWER','countnoanswerretry','NoAnswer','[callProgressDetectingCustomer][logNoAnswer]','dialNoAnswerMaxRetry','dialNoAnswerRetryFrequency','CONGESTION','countcongestionretry','Congestion','[callProgressDetectingCustomer][logCongestionGlobal]','[callProgressDetectingCustomer][logCongestion]','dialBusyRetryFrequency','CANCEL','outboundRejectCallsDay','[syncHangupRequest][logAgentReject]','unlockContact','idContact','disableContact','ABANDONED','countabandonedretry','Abandoned','[callProgressDetectingCustomer][logAbandoned]','countabandonedetry','dialAbandonedMaxRety','dialAbandonedRetryFrequency','[default]','[Dialer][decrementTalkink][no\x20Hangup][Preview]','cause-txt','dialstatus','[callProgressDetectingCustomer][logUnknown]','[callProgressDetectingCustomer][logUnknownGlobal]','[callProgressDetectingCustomer]','[originated][decrement][callProgressDetectingCustomer]','destlinkedid','isUndefined','object','reason','createAgentHistory','logAgent','[callProgressDetectingAgent][logNoAnswer]','[callProgressDetectingAgent][logBusy]','AnswerAGI','[callProgressDetectingAgent][logAnswerAGI]','updateOriginated','[callProgressDetectingAgent]','[originated][decrement][callProgressDetectingAgent]','checkInBlack','Contact','VoiceQueueId','Contact\x20is\x20undefined','Queue','lookAgent','isEmpty','execCall','Queue:\x20','\x20IdHopper:\x20','custom:agentcalled','Calling','[Preview][execCall][failure]','Call\x20failed','outboundBlacklistCallsDay','logBlacklist','createHistory','Contact\x20in\x20black\x20List','SIP/%s','reachable','pick','unlock','execRun','getContactPreview','recallme','validateContact','isValid','Contact.phone','[Preview][checkIsBlackList]','[Preview][getContactPreview]','Call\x20unsuccessful','[Preview][validateContact][Empty\x20Contact]','Empty\x20Contact','ACTIVE','[Preview][validateContact][Empty\x20Campaign]','Empty\x20Campaign','[Preview][validateContact][Trunk\x20not\x20work]','campaign\x20Name:\x20','\x20Trunk\x20Backup\x20is\x20not\x20active','Trunk\x20not\x20work','isActive','[Preview][validateContact][Campaign\x20Active]','\x20Not\x20Active','Is\x20Valid','SIP/%s/%s%s','trim','dialCutDigit','substring','phone','getCallerId','callerid','getCallerIdRandom','dialOriginateCallerIdNumber','dialRandomLastDigitCallerIdNumber','dialOriginateCallerIdName','extractCalleridName','originatecalleridnum','extractCalleridNumber','addVariables','Action','variablesAction','[originated][increment]','OriginateError','[originateFailure][logOriginateFailure]','logLookAgent','clone','isFailure','response','custom:agentringnoanswer','rejected','Answer','[callProgressDetectingAgent][logAnswer]','[syncHangup][talking]','cause','[syncHangup][talking][cause]','dialQueueProject','channelstate','transfer','callProgressDetectingAgent','syncHangupRequest','addVariable','variables','keys','variable','value','error','[syncVarSet][Preview]','inspect','syncAttendedTransfer','transfertargetlinkedid','syncBlindTransfer','transfererlinkedid','util','lodash','bluebird','uuid','moment','../../../config/environment','../../../config/logger','preview','actionPreview','../ami','./rpcDb','./action','./util/util','defaults','localhost','redis','enqueue','tail','finally','sequence','voiceQueues','trunks','agents','clockClearZombieChannels','originateresponse','bind','syncHangup','hanguprequest','dialend','syncDialEnd','newexten','syncNewExten','syncVarSet','attendedtransfer','blindtransfer','loopCampaigns','campaignsPreview','outbound','name','strategy','answered','loggedIn','sumBillable','sumHoldTime','talking','total','type','unmanaged','abandoned','loggedInDb','dialActive','dialMethod','dialOriginateTimeout','dialPrefix','outboundAnswerAgiCallsDay','outboundAnswerCallsDay','outboundCongestionCallsDay','outboundDropCallsDayACS','outboundDropCallsDayTimeout','outboundNoAnswerCallsDay','outboundNoSuchCallsDay','outboundOriginateFailureCallsDay','outboundReCallsDay','outboundUnknownCallsDay','outboundAbandonedCallsDay','predictiveIntervalAnsweredCalls','predictiveIntervalAvgTalktime','predictiveIntervalDroppedCallsTimeout','predictiveIntervalErlangCalls','predictiveIntervalErlangCallsDroppedCalls','predictiveIntervalHitRate','message','originated','erlangCallToSecond','erlangAbandonmentRate','erlangBusyFactor','startPredictive','startProgressive','Trunk','active','Interval','md5'];(function(_0x40aebe,_0x4f0548){var _0x32baa3=function(_0x34de7d){while(--_0x34de7d){_0x40aebe['push'](_0x40aebe['shift']());}};_0x32baa3(++_0x4f0548);}(_0xb6a0,0xee));var _0x0b6a=function(_0x81240d,_0x4f77c8){_0x81240d=_0x81240d-0x0;var _0x176e3e=_0xb6a0[_0x81240d];return _0x176e3e;};'use strict';var util=require(_0x0b6a('0x0'));var _=require(_0x0b6a('0x1'));var BPromise=require(_0x0b6a('0x2'));var uuid=require(_0x0b6a('0x3'));var moment=require(_0x0b6a('0x4'));var md5=require('md5');var Redis=require('ioredis');var config=require(_0x0b6a('0x5'));var logger=require(_0x0b6a('0x6'))(_0x0b6a('0x7'));var loggerAction=require(_0x0b6a('0x6'))(_0x0b6a('0x8'));var ami=require(_0x0b6a('0x9'));var rpcDb=require(_0x0b6a('0xa'));var Action=require(_0x0b6a('0xb'));var ut=require(_0x0b6a('0xc'));config['redis']=_[_0x0b6a('0xd')](config['redis'],{'host':_0x0b6a('0xe'),'port':0x18eb});var io=require('socket.io-emitter')(new Redis(config[_0x0b6a('0xf')]));var Sequence=function(){};Sequence['prototype'][_0x0b6a('0x10')]=function(_0x26ac7d){this[_0x0b6a('0x11')]=this[_0x0b6a('0x11')]?this['tail'][_0x0b6a('0x12')](_0x26ac7d):_0x26ac7d();};function Preview(_0x3598ee){this[_0x0b6a('0x13')]=new Sequence();this['campaignsPreview']=_0x3598ee[_0x0b6a('0x14')];this[_0x0b6a('0x15')]=_0x3598ee[_0x0b6a('0x15')];this['actions']={};this[_0x0b6a('0x16')]=_0x3598ee[_0x0b6a('0x16')];this[_0x0b6a('0x17')]=0x0;ami['on'](_0x0b6a('0x18'),this['syncOriginateResponse'][_0x0b6a('0x19')](this));ami['on']('hangup',this[_0x0b6a('0x1a')][_0x0b6a('0x19')](this));ami['on'](_0x0b6a('0x1b'),this['syncHangupRequest'][_0x0b6a('0x19')](this));ami['on'](_0x0b6a('0x1c'),this[_0x0b6a('0x1d')][_0x0b6a('0x19')](this));ami['on'](_0x0b6a('0x1e'),this[_0x0b6a('0x1f')][_0x0b6a('0x19')](this));ami['on']('varset',this[_0x0b6a('0x20')][_0x0b6a('0x19')](this));ami['on'](_0x0b6a('0x21'),this['syncAttendedTransfer']['bind'](this));ami['on'](_0x0b6a('0x22'),this['syncBlindTransfer'][_0x0b6a('0x19')](this));this[_0x0b6a('0x23')](this[_0x0b6a('0x24')]);}function emit(_0x4e40cd,_0x3ad8a9,_0xe9927c){io['to'](_0x4e40cd)['emit'](_0x3ad8a9,_0xe9927c);}function emitCampaignPreview(_0x26eac1){if(_0x26eac1['type']===_0x0b6a('0x25')){var _0x18b988={'id':_0x26eac1['id'],'name':_0x26eac1[_0x0b6a('0x26')],'strategy':_0x26eac1[_0x0b6a('0x27')],'answered':_0x26eac1[_0x0b6a('0x28')],'available':_0x26eac1['available'],'loggedIn':_0x26eac1[_0x0b6a('0x29')],'pTalking':_0x26eac1['pTalking'],'sumBillable':_0x26eac1[_0x0b6a('0x2a')],'sumDuration':_0x26eac1['sumDuration'],'sumHoldTime':_0x26eac1[_0x0b6a('0x2b')]||0x0,'talking':_0x26eac1[_0x0b6a('0x2c')],'total':_0x26eac1[_0x0b6a('0x2d')],'type':_0x26eac1[_0x0b6a('0x2e')],'unmanaged':_0x26eac1[_0x0b6a('0x2f')],'abandoned':_0x26eac1[_0x0b6a('0x30')],'waiting':_0x26eac1['waiting'],'loggedInDb':_0x26eac1[_0x0b6a('0x31')],'dialActive':_0x26eac1[_0x0b6a('0x32')],'dialMethod':_0x26eac1[_0x0b6a('0x33')],'dialOriginateCallerIdName':_0x26eac1['dialOriginateCallerIdName'],'dialOriginateCallerIdNumber':_0x26eac1['dialOriginateCallerIdNumber'],'dialOriginateTimeout':_0x26eac1[_0x0b6a('0x34')],'dialPrefix':_0x26eac1[_0x0b6a('0x35')],'outboundAnswerAgiCallsDay':_0x26eac1[_0x0b6a('0x36')],'outboundAnswerCallsDay':_0x26eac1[_0x0b6a('0x37')],'outboundBlacklistCallsDay':_0x26eac1['outboundBlacklistCallsDay'],'outboundBusyCallsDay':_0x26eac1['outboundBusyCallsDay'],'outboundCongestionCallsDay':_0x26eac1[_0x0b6a('0x38')],'outboundDropCallsDayACS':_0x26eac1[_0x0b6a('0x39')],'outboundDropCallsDayCallersExit':_0x26eac1['outboundDropCallsDayCallersExit'],'outboundDropCallsDayTimeout':_0x26eac1[_0x0b6a('0x3a')],'outboundNoAnswerCallsDay':_0x26eac1[_0x0b6a('0x3b')],'outboundNoSuchCallsDay':_0x26eac1[_0x0b6a('0x3c')],'outboundOriginateFailureCallsDay':_0x26eac1[_0x0b6a('0x3d')],'outboundReCallsDay':_0x26eac1[_0x0b6a('0x3e')],'outboundRejectCallsDay':_0x26eac1['outboundRejectCallsDay'],'outboundUnknownCallsDay':_0x26eac1[_0x0b6a('0x3f')],'outboundAbandonedCallsDay':_0x26eac1[_0x0b6a('0x40')],'predictiveIntervalAnsweredCalls':_0x26eac1[_0x0b6a('0x41')],'predictiveIntervalAvgHoldtime':_0x26eac1['predictiveIntervalAvgHoldtime'],'predictiveIntervalAvgTalktime':_0x26eac1[_0x0b6a('0x42')],'predictiveIntervalDroppedCallsCallersExit':_0x26eac1['predictiveIntervalDroppedCallsCallersExit'],'predictiveIntervalDroppedCallsTimeout':_0x26eac1[_0x0b6a('0x43')],'predictiveIntervalErlangCalls':_0x26eac1[_0x0b6a('0x44')],'predictiveIntervalErlangCallsDroppedCalls':_0x26eac1[_0x0b6a('0x45')],'predictiveIntervalHitRate':_0x26eac1[_0x0b6a('0x46')],'predictiveIntervalMultiplicativeFactor':_0x26eac1['predictiveIntervalMultiplicativeFactor'],'predictiveIntervalPauses':_0x26eac1['predictiveIntervalPauses'],'predictiveIntervalAvailable':_0x26eac1['predictiveIntervalAvailable'],'predictiveIntervalTotalCalls':_0x26eac1['predictiveIntervalTotalCalls'],'message':_0x26eac1[_0x0b6a('0x47')],'originated':_0x26eac1[_0x0b6a('0x48')],'erlangCalls':_0x26eac1['erlangCalls'],'erlangCallToSecond':_0x26eac1[_0x0b6a('0x49')],'erlangAbandonmentRate':_0x26eac1[_0x0b6a('0x4a')],'erlangBusyFactor':_0x26eac1[_0x0b6a('0x4b')],'startPredictive':_0x26eac1[_0x0b6a('0x4c')],'startProgressive':_0x26eac1[_0x0b6a('0x4d')]};if(_0x26eac1[_0x0b6a('0x4e')]){_0x18b988['Trunk']={'id':_0x26eac1[_0x0b6a('0x4e')]['id'],'name':_0x26eac1[_0x0b6a('0x4e')][_0x0b6a('0x26')],'active':_0x26eac1[_0x0b6a('0x4e')][_0x0b6a('0x4f')],'callerid':_0x26eac1[_0x0b6a('0x4e')]['callerid']};}if(_0x26eac1[_0x0b6a('0x50')]){_0x18b988[_0x0b6a('0x50')]={'id':_0x26eac1[_0x0b6a('0x50')]['id'],'name':_0x26eac1[_0x0b6a('0x50')]['name']};}var _0x42d899=md5(JSON['stringify'](_0x18b988));if(_0x26eac1[_0x0b6a('0x51')]!==_0x42d899){_0x26eac1[_0x0b6a('0x51')]=_0x42d899;emit(util['format']('voice:queue:%s',_0x18b988[_0x0b6a('0x26')]),_0x0b6a('0x52'),_0x18b988);}}}function emitVoiceQueueChannelRemove(_0x58771c){logger[_0x0b6a('0x53')]('[DEBUG]\x20Emit\x20voice_queue_channel:remove\x20event',JSON[_0x0b6a('0x54')](_0x58771c));emit(util[_0x0b6a('0x55')](_0x0b6a('0x56'),_0x58771c['name']),_0x0b6a('0x57'),_0x58771c);}function notSendMessagesQueue(_0x157864){if(_0x157864['sendMessageOneNotActive']){if(_0x157864['originated']===0x0&&_0x157864['pTalking']===0x0){_0x157864[_0x0b6a('0x58')]=![];_0x157864['available']=0x0;_0x157864['paused']=0x0;_0x157864['message']=_0x0b6a('0x59');ut[_0x0b6a('0x5a')](_0x0b6a('0x5b'),_0x157864[_0x0b6a('0x26')]+_0x0b6a('0x5c'));}else{_0x157864['message']=_0x0b6a('0x5d');ut[_0x0b6a('0x5a')](_0x0b6a('0x5b'),_0x157864[_0x0b6a('0x26')]+_0x0b6a('0x5e'));}emitCampaignPreview(_0x157864);}}Preview[_0x0b6a('0x5f')][_0x0b6a('0x23')]=function(){var _0x374de9=this;setInterval(function(){_0x374de9['syncCampaigns']();},0x7cf);};Preview['prototype']['syncCampaigns']=function(){var _0x206055=this[_0x0b6a('0x24')];this['clockClearZombieChannels']+=0x1;for(var _0x5e9d0a in _0x206055){if(_0x206055['hasOwnProperty'](_0x5e9d0a)&&(_0x206055[_0x5e9d0a][_0x0b6a('0x33')]===_0x0b6a('0x7')||_0x206055[_0x5e9d0a][_0x0b6a('0x33')]==='booked')&&_0x206055[_0x5e9d0a][_0x0b6a('0x2e')]==='outbound'){if(this[_0x0b6a('0x17')]>0x7){this['clockClearZombieChannels']=0x0;this[_0x0b6a('0x60')]();}}if(_0x206055[_0x0b6a('0x61')](_0x5e9d0a)&&_0x206055[_0x5e9d0a][_0x0b6a('0x33')]===_0x0b6a('0x7')&&_0x206055[_0x5e9d0a][_0x0b6a('0x2e')]===_0x0b6a('0x25')){if(_0x206055[_0x5e9d0a][_0x0b6a('0x32')]){this['setMessage'](_0x206055[_0x5e9d0a]);this[_0x0b6a('0x62')](_0x206055[_0x5e9d0a]);}else{notSendMessagesQueue(_0x206055[_0x5e9d0a]);}}}};Preview[_0x0b6a('0x5f')]['clearZombieChannel']=function(_0x2e66e1){var _0x2df9b0=this;this[_0x0b6a('0x13')][_0x0b6a('0x10')](function(){if(!_[_0x0b6a('0x63')](_0x2df9b0['actions'][_0x2e66e1])){loggerAction[_0x0b6a('0x53')]('[clearZombieChannels][talking]',_0x2e66e1,'Queue',_0x2df9b0[_0x0b6a('0x64')][_0x2e66e1]['queue'],_0x0b6a('0x65'),JSON[_0x0b6a('0x54')](_0x2df9b0['campaignsPreview'][_0x2df9b0['actions'][_0x2e66e1][_0x0b6a('0x66')]][_0x0b6a('0x48')]),_0x0b6a('0x67'),JSON[_0x0b6a('0x54')](_0x2df9b0[_0x0b6a('0x24')][_0x2df9b0[_0x0b6a('0x64')][_0x2e66e1]['queue']][_0x0b6a('0x68')]),JSON[_0x0b6a('0x54')](_0x2df9b0[_0x0b6a('0x64')][_0x2e66e1][_0x0b6a('0x69')]),JSON[_0x0b6a('0x54')](_['pick'](_0x2df9b0[_0x0b6a('0x64')][_0x2e66e1],[_0x0b6a('0x6a'),_0x0b6a('0x6b'),'VoiceQueueId',_0x0b6a('0x6c')])));return ami['Action']({'action':_0x0b6a('0x6d'),'channel':_0x2df9b0[_0x0b6a('0x64')][_0x2e66e1][_0x0b6a('0x6e')]})['catch'](function(_0x248d8a){if(_0x248d8a[_0x0b6a('0x47')]===_0x0b6a('0x6f')){setTimeout(function(){if(_0x2df9b0[_0x0b6a('0x64')][_0x2e66e1]){ut['updateOriginated'](_0x2df9b0[_0x0b6a('0x24')][_0x2df9b0[_0x0b6a('0x64')][_0x2e66e1][_0x0b6a('0x66')]],_0x0b6a('0x70'));if(_0x2df9b0[_0x0b6a('0x64')][_0x2e66e1][_0x0b6a('0x69')]===!![]){ut['decrementTalkink'](_0x2df9b0[_0x0b6a('0x24')][_0x2df9b0[_0x0b6a('0x64')][_0x2e66e1][_0x0b6a('0x66')]],_0x0b6a('0x70'));ut[_0x0b6a('0x71')]('[Dialer][checkChannel][pTalking][Preview]'+_0x2e66e1,_0x2df9b0[_0x0b6a('0x64')][_0x2e66e1][_0x0b6a('0x66')]);}ut[_0x0b6a('0x71')](_0x0b6a('0x72')+_0x2e66e1,_0x2df9b0['actions'][_0x2e66e1][_0x0b6a('0x66')]);delete _0x2df9b0[_0x0b6a('0x64')][_0x2e66e1];}},0x2328);}});}});};Preview[_0x0b6a('0x5f')][_0x0b6a('0x60')]=function(){var _0x1622f0=this;loggerAction[_0x0b6a('0x53')](_0x0b6a('0x73'),_[_0x0b6a('0x74')](this[_0x0b6a('0x64')]));for(var _0x2e3917 in this[_0x0b6a('0x64')]){if(_0x1622f0['actions'][_0x0b6a('0x61')](_0x2e3917)){_0x1622f0['clearZombieChannel'](_0x2e3917);}}};Preview[_0x0b6a('0x5f')][_0x0b6a('0x62')]=function(_0x2fd636){var _0x424d9e=this;rpcDb[_0x0b6a('0x75')](_0x2fd636['id'],ut['agentReadyId'](this[_0x0b6a('0x16')]))[_0x0b6a('0x76')](function(_0xb51901){if(!_[_0x0b6a('0x63')](_0xb51901)){for(var _0x148013=0x0;_0x148013<_0xb51901[_0x0b6a('0x77')];_0x148013+=0x1){if(ut['getDiff'](_0xb51901[_0x148013][_0x0b6a('0x78')])<_0x2fd636[_0x0b6a('0x79')]*0x3c){if(_0xb51901[_0x148013]['Agent']&&!_0xb51901[_0x148013][_0x0b6a('0x7a')]['voicePause']){_0x424d9e[_0x0b6a('0x7b')](_0xb51901[_0x148013]['id'])[_0x0b6a('0x76')](ut[_0x0b6a('0x7c')](_0x0b6a('0x7d')))[_0x0b6a('0x7e')](ut[_0x0b6a('0x7c')](_0x0b6a('0x7d')));}else{rpcDb['disableContact'](_0xb51901[_0x148013]['id']);}}else{var _0x5cfedf=new Action(_0xb51901[_0x148013],_0x2fd636);_0x5cfedf[_0x0b6a('0x7f')]=moment()[_0x0b6a('0x55')](_0x0b6a('0x80'));_0x2fd636[_0x0b6a('0x3e')]+=0x1;ut[_0x0b6a('0x81')](_0x5cfedf,0x17,_0x0b6a('0x82'));if(_0x2fd636[_0x0b6a('0x83')]){rpcDb[_0x0b6a('0x84')](ut[_0x0b6a('0x85')](_0xb51901[_0x148013]));rpcDb['createCustomerHistory'](_0x5cfedf,_0x0b6a('0x86'));}else{ut['logCustomer'](_0x5cfedf,0x16,_0x0b6a('0x87'));rpcDb[_0x0b6a('0x88')](_0x5cfedf,_0x0b6a('0x89'));rpcDb[_0x0b6a('0x8a')](_0x5cfedf,'[HistoryRecallClose]');}}}}})[_0x0b6a('0x7e')](ut['logger2'](_0x0b6a('0x8b')));};Preview[_0x0b6a('0x5f')]['setMessage']=function(_0x4f8679){_0x4f8679[_0x0b6a('0x58')]=!![];if(ut[_0x0b6a('0x8c')](_0x4f8679[_0x0b6a('0x29')])){_0x4f8679[_0x0b6a('0x47')]=_0x0b6a('0x8d');}else if(!ut['isActive'](_0x4f8679[_0x0b6a('0x32')])){_0x4f8679[_0x0b6a('0x47')]=_0x0b6a('0x59');}else if(!this[_0x0b6a('0x8e')](_0x4f8679[_0x0b6a('0x4e')])){if(!this[_0x0b6a('0x8e')](_0x4f8679[_0x0b6a('0x8f')])){_0x4f8679['message']=_0x0b6a('0x90');}else{_0x4f8679[_0x0b6a('0x47')]='ACTIVE';}}else{_0x4f8679['message']='ACTIVE';}emitCampaignPreview(_0x4f8679);};Preview[_0x0b6a('0x5f')][_0x0b6a('0x91')]=function(_0x263262,_0x5b7eef,_0x10f6f6){var _0x260c81=this;var _0x2f601b=this[_0x0b6a('0x64')][_0x5b7eef];var _0xecd5b=this['campaignsPreview'][_0x2f601b[_0x0b6a('0x66')]];var _0x69f9ea;if(_0xecd5b){switch(_0x10f6f6){case'1':_0xecd5b[_0x0b6a('0x3c')]+=0x1;_0x2f601b[_0x0b6a('0x92')]=ut[_0x0b6a('0x93')](_0x2f601b);ut[_0x0b6a('0x81')](_0x2f601b,0x0,'NoSuchNumber');rpcDb[_0x0b6a('0x88')](_0x2f601b,_0x0b6a('0x94'));if(ut[_0x0b6a('0x93')](_0x2f601b)>=_0xecd5b[_0x0b6a('0x95')]){_0x69f9ea=ut[_0x0b6a('0x96')](_0x2f601b,0xf,'Global');rpcDb[_0x0b6a('0x8a')](_0x69f9ea,_0x0b6a('0x97'));}else{if(_0x2f601b[_0x0b6a('0x98')]>=_0xecd5b[_0x0b6a('0x99')]){rpcDb[_0x0b6a('0x8a')](_0x2f601b,_0x0b6a('0x97'));}else{rpcDb['rescheduleContact'](ut[_0x0b6a('0x9a')](_0x2f601b,_0x0b6a('0x98'),_0xecd5b['dialNoSuchNumberRetryFrequency']),_0x2f601b['unlockAgent'],_0x2f601b[_0x0b6a('0x9b')]);}}delete this[_0x0b6a('0x64')][_0x263262[_0x0b6a('0x9c')]];break;case _0x0b6a('0x9d'):var _0x331c21=moment()[_0x0b6a('0x55')](_0x0b6a('0x80'));_0x2f601b[_0x0b6a('0x9e')]=_0x331c21;_0x2f601b[_0x0b6a('0x9f')]=_0x331c21;_0x2f601b[_0x0b6a('0x69')]=!![];_0xecd5b[_0x0b6a('0x68')]+=0x1;logger[_0x0b6a('0x53')]('[syncHangup][talking][increment]',_0x2f601b[_0x0b6a('0xa0')],_0x0b6a('0xa1'),_0xecd5b[_0x0b6a('0x26')],'pTalking:\x20',_0xecd5b[_0x0b6a('0x68')]);ami[_0x0b6a('0xa2')](_0x0b6a('0xa3'),ut[_0x0b6a('0xa4')](_0x2f601b,_0x0b6a('0xa5')));if(_0xecd5b['acw']){ami[_0x0b6a('0xa2')]('custom:agentConnectPreview',ut[_0x0b6a('0xa6')](_0x2f601b));}break;case'16':ami[_0x0b6a('0xa2')](_0x0b6a('0xa7'),ut[_0x0b6a('0xa4')](_0x2f601b,'complete'));emitVoiceQueueChannelRemove(ut[_0x0b6a('0xa4')](_0x2f601b,_0x0b6a('0xa8')));_0xecd5b[_0x0b6a('0x37')]+=0x1;_0xecd5b['total']+=0x1;_0xecd5b['answered']+=0x1;ut[_0x0b6a('0xa9')](_0xecd5b,'[16]');_0x2f601b['countglobal']=ut['totalGlobal'](_0x2f601b);ut[_0x0b6a('0x81')](_0x2f601b,0x4,'Answer');rpcDb[_0x0b6a('0x88')](_0x2f601b,_0x0b6a('0xaa'));rpcDb[_0x0b6a('0x8a')](_0x2f601b,_0x0b6a('0xab'));rpcDb[_0x0b6a('0xac')](_0x2f601b);_0xecd5b['sumDuration']+=_0x2f601b[_0x0b6a('0xad')];_0xecd5b['sumBillable']+=_0x2f601b['talktime'];logger['info'](_0x0b6a('0xae'),_0x2f601b[_0x0b6a('0xa0')],'\x20Queue',_0xecd5b[_0x0b6a('0x26')],'pTalking:\x20',_0xecd5b['pTalking']);delete this['actions'][_0x263262[_0x0b6a('0x9c')]];break;case'BUSY':_0xecd5b['outboundBusyCallsDay']+=0x1;_0x2f601b['countbusyretry']+=0x1;_0x2f601b[_0x0b6a('0x92')]=ut['totalGlobal'](_0x2f601b);ut['logCustomer'](_0x2f601b,0x5,_0x0b6a('0xaf'));rpcDb[_0x0b6a('0x88')](_0x2f601b,_0x0b6a('0xb0'));if(ut['totalGlobal'](_0x2f601b)>=_0xecd5b[_0x0b6a('0x95')]){_0x69f9ea=ut[_0x0b6a('0x96')](_0x2f601b,0xf,_0x0b6a('0xb1'));rpcDb['createCustomerFinal'](_0x69f9ea,'[callProgressDetectingCustomer][logBusyGlobal]');}else{if(_0x2f601b[_0x0b6a('0xb2')]>=_0xecd5b[_0x0b6a('0xb3')]){rpcDb[_0x0b6a('0x8a')](_0x2f601b,_0x0b6a('0xb0'));}else{rpcDb[_0x0b6a('0xb4')](ut[_0x0b6a('0x9a')](_0x2f601b,_0x0b6a('0xb2'),_0xecd5b['dialBusyRetryFrequency']),_0x2f601b[_0x0b6a('0xb5')],_0x2f601b['activeContact']);}}break;case _0x0b6a('0xb6'):_0xecd5b[_0x0b6a('0x3b')]+=0x1;_0x2f601b[_0x0b6a('0xb7')]+=0x1;_0x2f601b['countglobal']=ut['totalGlobal'](_0x2f601b);ut['logCustomer'](_0x2f601b,0x3,_0x0b6a('0xb8'));rpcDb[_0x0b6a('0x88')](_0x2f601b,_0x0b6a('0xb9'));if(ut['totalGlobal'](_0x2f601b)>=_0xecd5b[_0x0b6a('0x95')]){_0x69f9ea=ut[_0x0b6a('0x96')](_0x2f601b,0xf,_0x0b6a('0xb1'));rpcDb[_0x0b6a('0x8a')](_0x69f9ea,'[callProgressDetectingCustomer][logNoAnswerGlobal]');}else{if(_0x2f601b['countnoanswerretry']>=_0xecd5b[_0x0b6a('0xba')]){rpcDb[_0x0b6a('0x8a')](_0x2f601b,_0x0b6a('0xb9'));}else{rpcDb[_0x0b6a('0xb4')](ut[_0x0b6a('0x9a')](_0x2f601b,_0x0b6a('0xb7'),_0xecd5b[_0x0b6a('0xbb')]),_0x2f601b['unlockAgent'],_0x2f601b[_0x0b6a('0x9b')]);}}break;case _0x0b6a('0xbc'):_0xecd5b[_0x0b6a('0x38')]+=0x1;_0x2f601b[_0x0b6a('0xbd')]+=0x1;_0x2f601b['countglobal']=ut[_0x0b6a('0x93')](_0x2f601b);ut[_0x0b6a('0x81')](_0x2f601b,0x8,_0x0b6a('0xbe'));rpcDb['createCustomerHistory'](_0x2f601b,'[callProgressDetectingCustomer][logCongestion]');if(ut[_0x0b6a('0x93')](_0x2f601b)>=_0xecd5b[_0x0b6a('0x95')]){_0x69f9ea=ut[_0x0b6a('0x96')](_0x2f601b,0xf,_0x0b6a('0xb1'));rpcDb['createCustomerFinal'](_0x69f9ea,_0x0b6a('0xbf'));}else{if(_0x2f601b[_0x0b6a('0xbd')]>=_0xecd5b['dialCongestionMaxRetry']){rpcDb['createCustomerFinal'](_0x2f601b,_0x0b6a('0xc0'));}else{rpcDb[_0x0b6a('0xb4')](ut[_0x0b6a('0x9a')](_0x2f601b,_0x0b6a('0xbd'),_0xecd5b[_0x0b6a('0xc1')]),_0x2f601b[_0x0b6a('0xb5')],_0x2f601b[_0x0b6a('0x9b')]);}}break;case _0x0b6a('0xc2'):_0xecd5b[_0x0b6a('0xc3')]+=0x1;_0x2f601b['countglobal']=ut[_0x0b6a('0x93')](_0x2f601b);ut[_0x0b6a('0x81')](_0x2f601b,0x14,'AgentReject');rpcDb[_0x0b6a('0x88')](_0x2f601b,_0x0b6a('0xc4'));if(_0x2f601b['unlockAgent']){rpcDb[_0x0b6a('0xc5')](_0x2f601b[_0x0b6a('0xc6')]);}if(_0x2f601b[_0x0b6a('0x9b')]){rpcDb[_0x0b6a('0xc7')](_0x2f601b[_0x0b6a('0xc6')]);}break;case _0x0b6a('0xc8'):_0xecd5b[_0x0b6a('0x40')]+=0x1;_0x2f601b[_0x0b6a('0xc9')]+=0x1;_0x2f601b[_0x0b6a('0x92')]=ut[_0x0b6a('0x93')](_0x2f601b);ut['logCustomer'](_0x2f601b,0xb,_0x0b6a('0xca'));rpcDb['createCustomerHistory'](_0x2f601b,_0x0b6a('0xcb'));if(ut[_0x0b6a('0x93')](_0x2f601b)>=_0xecd5b[_0x0b6a('0x95')]){_0x69f9ea=ut[_0x0b6a('0x96')](_0x2f601b,0xf,_0x0b6a('0xb1'));rpcDb['createCustomerFinal'](_0x69f9ea,_0x0b6a('0xcb'));}else{if(_0x2f601b[_0x0b6a('0xcc')]>=_0xecd5b[_0x0b6a('0xcd')]){rpcDb[_0x0b6a('0x8a')](_0x2f601b,'[callProgressDetectingCustomer][logAbandoned]');}else{rpcDb[_0x0b6a('0xb4')](ut[_0x0b6a('0x9a')](_0x2f601b,_0x0b6a('0xc9'),_0xecd5b[_0x0b6a('0xce')]),_0x2f601b['unlockAgent'],_0x2f601b['activeContact']);}}break;default:if(_0x2f601b['dialAnswer']){ut[_0x0b6a('0xa9')](_0xecd5b,_0x0b6a('0xcf'));ut['loggerError'](_0x0b6a('0xd0')+_0xecd5b[_0x0b6a('0x26')],_0x263262);}_0xecd5b[_0x0b6a('0x3f')]+=0x1;_0x2f601b['countglobal']=ut[_0x0b6a('0x93')](_0x2f601b);ut['logCustomer'](_0x2f601b,0xc,_0x263262[_0x0b6a('0xd1')]||_0x263262[_0x0b6a('0xd2')]);rpcDb[_0x0b6a('0x88')](_0x2f601b,_0x0b6a('0xd3'));if(ut['totalGlobal'](_0x2f601b)>=_0xecd5b['dialGlobalMaxRetry']){_0x69f9ea=ut[_0x0b6a('0x96')](_0x2f601b,0xf,_0x0b6a('0xb1'));rpcDb[_0x0b6a('0x8a')](_0x69f9ea,'[callProgressDetectingCustomer][logUnknownGlobal]');}else{rpcDb['createCustomerFinal'](_0x2f601b,_0x0b6a('0xd4'));}delete this['actions'][_0x263262[_0x0b6a('0x9c')]];}if(!(_0x2f601b['dialAnswer']&&_0x10f6f6==='16')){ut['updateOriginated'](_0xecd5b,_0x0b6a('0xd5'));logger[_0x0b6a('0x53')](_0x0b6a('0xd6'),_0x2f601b['uniqueid'],_0x0b6a('0xa1'),_0xecd5b[_0x0b6a('0x26')],'originated:\x20',_0xecd5b[_0x0b6a('0x48')]);}if(_0x10f6f6!==_0x0b6a('0x9d')){delete this[_0x0b6a('0x64')][_0x263262[_0x0b6a('0x9c')]];delete this[_0x0b6a('0x64')][_0x263262[_0x0b6a('0xd7')]];}}};Preview[_0x0b6a('0x5f')]['callProgressDetectingAgent']=function(_0x443edf,_0x1085d4,_0x26191e){if(_[_0x0b6a('0xd8')](_0x1085d4)&&'object'!==typeof _0x1085d4){return;}if(_[_0x0b6a('0xd8')](_0x26191e)&&_0x0b6a('0xd9')!==typeof _0x26191e){return;}switch(_0x26191e[_0x0b6a('0xda')]){case'0':ut['logAgent'](_0x443edf,0x0,'NoSuchNumber');rpcDb[_0x0b6a('0xdb')](_0x443edf,'[callProgressDetectingAgent][logNoSuch]');break;case'3':ut[_0x0b6a('0xdc')](_0x443edf,0x3,_0x0b6a('0xb8'));rpcDb[_0x0b6a('0xdb')](_0x443edf,_0x0b6a('0xdd'));break;case'5':ut[_0x0b6a('0xdc')](_0x443edf,0x5,_0x0b6a('0xaf'));rpcDb[_0x0b6a('0xdb')](_0x443edf,_0x0b6a('0xde'));break;case'8':ut[_0x0b6a('0xdc')](_0x443edf,0x8,_0x0b6a('0xbe'));rpcDb[_0x0b6a('0xdb')](_0x443edf,'[callProgressDetectingAgent][logCongestion]');break;case'22':ut[_0x0b6a('0xdc')](_0x443edf,0x16,_0x0b6a('0xdf'));rpcDb[_0x0b6a('0xdb')](_0x443edf,_0x0b6a('0xe0'));break;default:ut[_0x0b6a('0xdc')](_0x443edf,0xc,_0x26191e['reason']);rpcDb['createAgentHistory'](_0x443edf,'[callProgressDetectingAgent][logCongestion]');}ut[_0x0b6a('0xe1')](_0x1085d4,_0x0b6a('0xe2'));logger[_0x0b6a('0x53')](_0x0b6a('0xe3'),_0x443edf[_0x0b6a('0xa0')],_0x0b6a('0xa1'),_0x1085d4['name'],'originated:\x20',_0x1085d4['originated']);delete this[_0x0b6a('0x64')][_0x443edf[_0x0b6a('0xa0')]];};Preview[_0x0b6a('0x5f')][_0x0b6a('0xe4')]=function(_0x3de4e4,_0x2c7bf4,_0x1d0efb,_0x23fe95,_0x1002a7){var _0x440c78=this;return new BPromise(function(_0x3e58be,_0xa00b82){if(_['isNil'](_0x2c7bf4)||_[_0x0b6a('0x63')](_0x2c7bf4[_0x0b6a('0xe5')])||_[_0x0b6a('0x63')](_0x2c7bf4[_0x0b6a('0xe5')]['phone'])||_['isNil'](_0x2c7bf4[_0x0b6a('0xe6')])){_0xa00b82(ut[_0x0b6a('0x47')](_0x0b6a('0xe7'),_0x23fe95,_0x1002a7));return;}var _0x360438=uuid['v4']();var _0x104168=_0x440c78[_0x0b6a('0x24')][_0x2c7bf4[_0x0b6a('0xe8')]['name']];var _0x46ba6f=_0x1d0efb?_0x440c78[_0x0b6a('0x16')][_0x1d0efb]['id']:undefined;_0x440c78[_0x0b6a('0x64')][_0x360438]=new Action(_0x2c7bf4,_0x104168,_0x360438,_0x1d0efb,_0x46ba6f);var _0x2f6a3c=_0x440c78[_0x0b6a('0x64')][_0x360438];_0x2f6a3c['unlockAgent']=_0x23fe95;_0x2f6a3c[_0x0b6a('0x9b')]=_0x1002a7;_0x2f6a3c[_0x0b6a('0xe9')]=_0x1d0efb;if(_[_0x0b6a('0xea')](_0x3de4e4)){_0x440c78[_0x0b6a('0xeb')](_0x2f6a3c,_0x104168,_0x2c7bf4,_0x1d0efb)[_0x0b6a('0x76')](function(_0x475e7a){logger[_0x0b6a('0x53')]('[Preview][execCall][success]',_0x0b6a('0xec')+_0x2f6a3c[_0x0b6a('0x66')]+_0x0b6a('0xed')+_0x2f6a3c[_0x0b6a('0xc6')],JSON[_0x0b6a('0x54')](_0x475e7a));ami[_0x0b6a('0xa2')](_0x0b6a('0xee'),ut[_0x0b6a('0xa4')](_0x2f6a3c,'called'));_0x3e58be(ut[_0x0b6a('0x47')](_0x0b6a('0xef')));})['catch'](function(_0x25e9fc){ut[_0x0b6a('0x5a')](_0x0b6a('0xf0'),_0x25e9fc);_0xa00b82(ut['message'](_0x0b6a('0xf1'),_0x23fe95,_0x1002a7));});}else{_0x104168[_0x0b6a('0xf2')]+=0x1;ut[_0x0b6a('0xf3')](_0x2f6a3c);rpcDb[_0x0b6a('0xf4')](_0x2f6a3c,'[Blacklist][error]');delete _0x440c78['actions'][_0x360438];_0xa00b82(ut[_0x0b6a('0x47')](_0x0b6a('0xf5'),_0x23fe95,_0x1002a7));}});};Preview[_0x0b6a('0x5f')][_0x0b6a('0x8e')]=function(_0xb84120){return!_[_0x0b6a('0x63')](_0xb84120)&&!_[_0x0b6a('0x63')](_0xb84120[_0x0b6a('0x26')])&&!_[_0x0b6a('0x63')](_0xb84120[_0x0b6a('0x4f')])&&_0xb84120[_0x0b6a('0x4f')]&&!_[_0x0b6a('0x63')](this[_0x0b6a('0x15')][util['format'](_0x0b6a('0xf6'),_0xb84120[_0x0b6a('0x26')])])&&!_[_0x0b6a('0x63')](this[_0x0b6a('0x15')][util['format']('SIP/%s',_0xb84120[_0x0b6a('0x26')])][_0x0b6a('0x6d')])&&(this['trunks'][util[_0x0b6a('0x55')]('SIP/%s',_0xb84120['name'])][_0x0b6a('0x6d')]===_0x0b6a('0xf7')||this[_0x0b6a('0x15')][util['format']('SIP/%s',_0xb84120['name'])][_0x0b6a('0x6d')]==='unmonitored');};Preview[_0x0b6a('0x5f')][_0x0b6a('0x7b')]=function(_0x1bdc8c,_0x32c99d){var _0x1f0b49=this;return new BPromise(function(_0x4041b3,_0x5c27bc){_0x1f0b49['execRun'](_0x1bdc8c,_0x32c99d)['then'](function(_0x456c56){_0x4041b3(_[_0x0b6a('0xf8')](_0x456c56,[_0x0b6a('0x47')]));})[_0x0b6a('0x7e')](function(_0x1d48c5){if(_0x1d48c5[_0x0b6a('0xf9')]){rpcDb[_0x0b6a('0xc5')](_0x1bdc8c);}if(_0x1d48c5['active']){rpcDb['disableContact'](_0x1bdc8c);}_0x5c27bc(_[_0x0b6a('0xf8')](_0x1d48c5,[_0x0b6a('0x47')]));});});};Preview[_0x0b6a('0x5f')][_0x0b6a('0xfa')]=function(_0x51b3f3,_0x551bf4){var _0xaacbfe=this;return new BPromise(function(_0x2f25cc,_0x134b29){var _0x3cc13d,_0x2058ea;rpcDb[_0x0b6a('0xfb')](_0x51b3f3)[_0x0b6a('0x76')](function(_0x41bab8){if(!_[_0x0b6a('0x63')](_0x41bab8[0x0])){_0x2058ea=_0x41bab8[0x0][_0x0b6a('0xfc')]?![]:!![];_0x3cc13d=_0x41bab8[0x0][_0x0b6a('0xfc')]?!![]:![];_0x3cc13d=_0x551bf4?!![]:_0x3cc13d;}var _0x19a298=_0xaacbfe[_0x0b6a('0xfd')](_0x41bab8);if(_0x19a298[_0x0b6a('0xfe')]){rpcDb['checkIsBlackList'](_[_0x0b6a('0xf8')](_0x41bab8[0x0],['VoiceQueueId',_0x0b6a('0xff')]))[_0x0b6a('0x76')](function(_0xbd930){_0xaacbfe[_0x0b6a('0xe4')](_0xbd930,_0x41bab8[0x0],_0x551bf4,_0x2058ea,_0x3cc13d)[_0x0b6a('0x76')](function(_0x17908e){_0x2f25cc(_0x17908e);})[_0x0b6a('0x7e')](function(_0x3863ac){_0x134b29(_0x3863ac);});})['catch'](function(_0x21abee){ut['logger'](_0x0b6a('0x100'),_0x21abee);_0x134b29(ut[_0x0b6a('0x47')]('Call\x20unsuccessful',_0x2058ea,_0x3cc13d));});}else{_0x134b29(ut[_0x0b6a('0x47')](_0x19a298[_0x0b6a('0x47')],_0x2058ea,_0x3cc13d));}})['catch'](function(_0x2120d4){ut[_0x0b6a('0x5a')](_0x0b6a('0x101'),_0x2120d4);_0x134b29(ut[_0x0b6a('0x47')](_0x0b6a('0x102'),![],!![]));});});};Preview[_0x0b6a('0x5f')]['validateContact']=function(_0x344e8f){if(_['isNil'](_0x344e8f)||_[_0x0b6a('0xea')](_0x344e8f)||!_[_0x0b6a('0x63')](_0x344e8f[0x0][_0x0b6a('0x7a')])&&_[_0x0b6a('0x63')](_0x344e8f[0x0][_0x0b6a('0x7a')][_0x0b6a('0x26')])){ut['logger'](_0x0b6a('0x103'),_0x344e8f);return{'isValid':![],'message':_0x0b6a('0x104')};}var _0x16ec6b=this[_0x0b6a('0x24')][_0x344e8f[0x0][_0x0b6a('0xe8')][_0x0b6a('0x26')]];_0x16ec6b['message']=_0x0b6a('0x105');if(_[_0x0b6a('0x63')](_0x16ec6b)){ut['logger'](_0x0b6a('0x106'),_0x16ec6b);return{'isValid':![],'message':_0x0b6a('0x107')};}if(!this[_0x0b6a('0x8e')](_0x16ec6b[_0x0b6a('0x4e')])){ut[_0x0b6a('0x5a')](_0x0b6a('0x108'),_0x0b6a('0x109')+_0x16ec6b['name']+'\x20Trunk\x20is\x20not\x20active');if(!this['isTrunkReachable'](_0x16ec6b[_0x0b6a('0x8f')])){ut['logger'](_0x0b6a('0x108'),_0x16ec6b[_0x0b6a('0x26')]+_0x0b6a('0x10a'));return{'isValid':![],'message':_0x0b6a('0x10b')};}}if(!ut[_0x0b6a('0x10c')](_0x16ec6b['dialActive'])){ut[_0x0b6a('0x5a')](_0x0b6a('0x10d'),_0x16ec6b[_0x0b6a('0x26')]+_0x0b6a('0x10e'));return{'isValid':![],'message':'campaign\x20Name:\x20'+_0x16ec6b[_0x0b6a('0x26')]+_0x0b6a('0x10e')};}return{'isValid':!![],'message':_0x0b6a('0x10f')};};Preview[_0x0b6a('0x5f')][_0x0b6a('0xeb')]=function(_0x83fbbc,_0x2f6dcb,_0x62f79b,_0x474cea){var _0x4c992e=this;return new BPromise(function(_0x55393f,_0x11a38b){var _0x5c2eaf=_0x83fbbc[_0x0b6a('0xa0')];var _0x184dd9=_0x4c992e[_0x0b6a('0x8e')](_0x2f6dcb['Trunk'])?util[_0x0b6a('0x55')](_0x0b6a('0x110'),_0x2f6dcb[_0x0b6a('0x4e')][_0x0b6a('0x26')],_[_0x0b6a('0x63')](_0x2f6dcb[_0x0b6a('0x35')])?'':_0x2f6dcb[_0x0b6a('0x35')][_0x0b6a('0x111')]()||'',_0x2f6dcb[_0x0b6a('0x112')]>0x0?_0x62f79b[_0x0b6a('0xe5')]['phone'][_0x0b6a('0x113')](_0x2f6dcb[_0x0b6a('0x112')]):_0x62f79b[_0x0b6a('0xe5')]['phone']):util[_0x0b6a('0x55')]('SIP/%s/%s%s',_['isNil'](_0x2f6dcb[_0x0b6a('0x8f')])?_0x2f6dcb[_0x0b6a('0x4e')]['name']:_0x2f6dcb[_0x0b6a('0x8f')][_0x0b6a('0x26')],_[_0x0b6a('0x63')](_0x2f6dcb[_0x0b6a('0x35')])?'':_0x2f6dcb[_0x0b6a('0x35')]['trim']()||'',_0x2f6dcb[_0x0b6a('0x112')]>0x0?_0x62f79b['Contact'][_0x0b6a('0x114')][_0x0b6a('0x113')](_0x2f6dcb['dialCutDigit']):_0x62f79b[_0x0b6a('0xe5')][_0x0b6a('0x114')]);var _0xc29881=_0x4c992e[_0x0b6a('0x8e')](_0x2f6dcb[_0x0b6a('0x4e')])?ut[_0x0b6a('0x115')](_0x2f6dcb[_0x0b6a('0x4e')][_0x0b6a('0x116')],_0x2f6dcb['dialOriginateCallerIdName'],_0x2f6dcb['dialRandomLastDigitCallerIdNumber']>0x0?ut[_0x0b6a('0x117')](_0x2f6dcb[_0x0b6a('0x118')],_0x2f6dcb[_0x0b6a('0x119')]):_0x2f6dcb[_0x0b6a('0x118')]):ut['getCallerId'](_[_0x0b6a('0x63')](_0x2f6dcb[_0x0b6a('0x8f')])?_0x2f6dcb['Trunk'][_0x0b6a('0x116')]:_0x2f6dcb[_0x0b6a('0x8f')][_0x0b6a('0x116')],_0x2f6dcb[_0x0b6a('0x11a')],_0x2f6dcb[_0x0b6a('0x119')]>0x0?ut[_0x0b6a('0x117')](_0x2f6dcb[_0x0b6a('0x118')],_0x2f6dcb[_0x0b6a('0x119')]):_0x2f6dcb['dialOriginateCallerIdNumber']);if(_0xc29881){_0x83fbbc['originatecalleridname']=ut[_0x0b6a('0x11b')](_0xc29881);_0x83fbbc[_0x0b6a('0x11c')]=ut[_0x0b6a('0x11d')](_0xc29881);}var _0x4be70e=ut[_0x0b6a('0x11e')](_0x2f6dcb,_0x62f79b,_0x184dd9,_0xc29881,_0x5c2eaf,_0x83fbbc);_['merge'](_0x83fbbc,ut['toLowerVariables'](_0x4be70e));_0x83fbbc[_0x0b6a('0x7f')]=moment()[_0x0b6a('0x55')](_0x0b6a('0x80'));ami[_0x0b6a('0x11f')](ut[_0x0b6a('0x120')](_0x83fbbc,_0x2f6dcb,_0x4be70e,_0x83fbbc[_0x0b6a('0x9b')],_0x474cea))[_0x0b6a('0x76')](function(_0x39c9c9){_0x2f6dcb[_0x0b6a('0x48')]+=0x1;logger[_0x0b6a('0x53')](_0x0b6a('0x121'),_0x5c2eaf,_0x0b6a('0xa1'),_0x2f6dcb[_0x0b6a('0x26')],_0x0b6a('0x65'),_0x2f6dcb['originated']);_0x55393f(_0x39c9c9);})[_0x0b6a('0x7e')](function(_0x29006f){ut[_0x0b6a('0xdc')](_0x83fbbc,0xe,_0x0b6a('0x122'));rpcDb['createAgentHistory'](_0x83fbbc,_0x0b6a('0x123'));_0x11a38b(_0x29006f);});});};Preview[_0x0b6a('0x5f')][_0x0b6a('0x1f')]=function(_0x11e3e1){if(this[_0x0b6a('0x64')][_0x11e3e1[_0x0b6a('0x9c')]]){this[_0x0b6a('0x64')][_0x11e3e1[_0x0b6a('0x9c')]][_0x0b6a('0x6e')]=_0x11e3e1[_0x0b6a('0x6e')];}};Preview[_0x0b6a('0x5f')]['syncOriginateResponse']=function(_0x4e5bc5){var _0x468fbd=this;var _0x2b13b5=this['actions'][_0x4e5bc5['actionid']];if(_0x2b13b5){if(_0x2b13b5[_0x0b6a('0xe9')]&&this['agents'][_0x2b13b5['lookAgent']]){ut[_0x0b6a('0x124')](_0x2b13b5,this[_0x0b6a('0x16')][_0x2b13b5[_0x0b6a('0xe9')]]['name'],this[_0x0b6a('0x16')][_0x2b13b5[_0x0b6a('0xe9')]]['id']);}var _0x18732a=_[_0x0b6a('0x125')](_0x2b13b5);_0x18732a[_0x0b6a('0x9e')]=moment()[_0x0b6a('0x55')]('YYYY-MM-DD\x20HH:mm:ss');var _0x5b1eff=_0x468fbd[_0x0b6a('0x24')][_0x2b13b5[_0x0b6a('0x66')]];if(ut[_0x0b6a('0x126')](_0x4e5bc5[_0x0b6a('0x127')])){if(_0x2b13b5['unlockAgent']){rpcDb[_0x0b6a('0xc5')](_0x2b13b5[_0x0b6a('0xc6')]);}if(_0x2b13b5[_0x0b6a('0x9b')]){rpcDb[_0x0b6a('0xc7')](_0x2b13b5[_0x0b6a('0xc6')]);}ami[_0x0b6a('0xa2')](_0x0b6a('0x128'),ut['buildObj'](_0x2b13b5,_0x0b6a('0x129')));this['callProgressDetectingAgent'](_0x18732a,_0x5b1eff,_0x4e5bc5);}else{_0x2b13b5[_0x0b6a('0x7f')]=moment()[_0x0b6a('0x55')](_0x0b6a('0x80'));ut['logAgent'](_0x18732a,0x4,_0x0b6a('0x12a'));rpcDb['createAgentHistory'](_0x18732a,_0x0b6a('0x12b'));}}};Preview['prototype'][_0x0b6a('0x1a')]=function(_0x4633e5){var _0x1d1c4e=this;var _0x42a450=this['actions'][_0x4633e5['linkedid']];var _0x113aed;if(_0x42a450){_0x113aed=this[_0x0b6a('0x24')][_0x42a450['queue']];logger[_0x0b6a('0x53')](_0x0b6a('0x12c'),_0x4633e5[_0x0b6a('0x9c')],_0x0b6a('0xa1'),_0x113aed['name'],_0x0b6a('0x67'),_0x113aed[_0x0b6a('0x68')]);}if(this['actions'][_0x4633e5[_0x0b6a('0x9c')]]&&_0x4633e5[_0x0b6a('0x9c')]!==_0x4633e5[_0x0b6a('0xa0')]){if(_0x4633e5[_0x0b6a('0x12d')]==='16'&&this[_0x0b6a('0x64')][_0x4633e5[_0x0b6a('0x9c')]][_0x0b6a('0x69')]){this[_0x0b6a('0x91')](_0x4633e5,_0x4633e5[_0x0b6a('0x9c')],_0x4633e5['cause']);}else if(this[_0x0b6a('0x64')][_0x4633e5[_0x0b6a('0x9c')]][_0x0b6a('0x69')]){logger[_0x0b6a('0x53')](_0x0b6a('0x12e'),_0x4633e5[_0x0b6a('0x9c')],_0x4633e5['cause'],_0x0b6a('0xa1'),_0x113aed[_0x0b6a('0x26')],_0x0b6a('0x67'),_0x113aed[_0x0b6a('0x68')]);this[_0x0b6a('0x91')](_0x4633e5,_0x4633e5['linkedid'],_0x4633e5[_0x0b6a('0x12d')]);}}else if(_0x42a450&&_['isNil'](_0x42a450['statedesc'])&&_0x113aed[_0x0b6a('0x12f')]&&_0x4633e5[_0x0b6a('0x9c')]===_0x4633e5[_0x0b6a('0xa0')]&&_[_0x0b6a('0x63')](_0x4633e5['reason'])&&_0x4633e5[_0x0b6a('0x12d')]==='16'&&_0x4633e5[_0x0b6a('0x130')]==='6'&&_[_0x0b6a('0xd8')](_0x42a450[_0x0b6a('0x131')])){if(_0x42a450[_0x0b6a('0xb5')]){rpcDb[_0x0b6a('0xc5')](_0x42a450['idContact']);}if(_0x42a450['activeContact']){rpcDb[_0x0b6a('0xc7')](_0x42a450[_0x0b6a('0xc6')]);}_0x4633e5['reason']='22';this[_0x0b6a('0x132')](_0x42a450,_0x113aed,_0x4633e5);}else if(_0x42a450&&_0x42a450[_0x0b6a('0x131')]){if(_0x4633e5[_0x0b6a('0x12d')]==='16'&&this['actions'][_0x4633e5['linkedid']][_0x0b6a('0x69')]){logger[_0x0b6a('0x53')]('[syncHangup][talking][transfer]',_0x4633e5['linkedid'],_0x4633e5[_0x0b6a('0x12d')],_0x0b6a('0xa1'),_0x113aed[_0x0b6a('0x26')],_0x0b6a('0x67'),_0x113aed[_0x0b6a('0x68')]);this[_0x0b6a('0x91')](_0x4633e5,_0x4633e5[_0x0b6a('0x9c')],_0x4633e5[_0x0b6a('0x12d')]);}else if(this[_0x0b6a('0x64')][_0x4633e5[_0x0b6a('0x9c')]]['dialAnswer']){logger[_0x0b6a('0x53')]('[syncHangup][talking][cause]',_0x4633e5[_0x0b6a('0x9c')],_0x4633e5[_0x0b6a('0x12d')],_0x0b6a('0xa1'),_0x113aed[_0x0b6a('0x26')],_0x0b6a('0x67'),_0x113aed[_0x0b6a('0x68')]);this[_0x0b6a('0x91')](_0x4633e5,_0x4633e5[_0x0b6a('0x9c')],_0x4633e5[_0x0b6a('0x12d')]);}}};Preview[_0x0b6a('0x5f')][_0x0b6a('0x1d')]=function(_0x5401a4){if(this[_0x0b6a('0x64')][_0x5401a4[_0x0b6a('0xd7')]]&&_0x5401a4[_0x0b6a('0xd7')]!==_0x5401a4['destuniqueid']){this[_0x0b6a('0x91')](_0x5401a4,_0x5401a4[_0x0b6a('0xd7')],_0x5401a4['dialstatus']);}};Preview[_0x0b6a('0x5f')][_0x0b6a('0x133')]=function(_0x59cc8c){if(this[_0x0b6a('0x64')][_0x59cc8c[_0x0b6a('0x9c')]]&&_0x59cc8c['linkedid']!==_0x59cc8c[_0x0b6a('0xa0')]&&!this[_0x0b6a('0x64')][_0x59cc8c[_0x0b6a('0x9c')]][_0x0b6a('0x69')]){if(_0x59cc8c[_0x0b6a('0x12d')]==='1'){this[_0x0b6a('0x91')](_0x59cc8c,_0x59cc8c['linkedid'],_0x59cc8c[_0x0b6a('0x12d')]);}}};Preview[_0x0b6a('0x5f')][_0x0b6a('0x134')]=function(_0x3a1d14,_0x2b28fc,_0x58a069){if(this[_0x0b6a('0x64')][_0x3a1d14]){if(_[_0x0b6a('0x63')](this[_0x0b6a('0x64')][_0x3a1d14]['variables'])){this[_0x0b6a('0x64')][_0x3a1d14][_0x0b6a('0x135')]={};}this[_0x0b6a('0x64')][_0x3a1d14][_0x0b6a('0x135')][_0x2b28fc]=_0x58a069;}};Preview['prototype'][_0x0b6a('0x20')]=function(_0x5b05cb){try{if(!_['isNil'](_0x5b05cb)){if(ut['filterKey'](_[_0x0b6a('0x136')](_0x5b05cb[_0x0b6a('0x137')])[0x0])){this[_0x0b6a('0x134')](_0x5b05cb[_0x0b6a('0xa0')],_[_0x0b6a('0x136')](_0x5b05cb['variable'])[0x0],_0x5b05cb[_0x0b6a('0x138')]);}}}catch(_0x487b3a){logger[_0x0b6a('0x139')](_0x0b6a('0x13a'),util[_0x0b6a('0x13b')](_0x487b3a,{'showHidden':![],'depth':null}));}};Preview[_0x0b6a('0x5f')][_0x0b6a('0x13c')]=function(_0x25895b){if(_0x25895b){if(this[_0x0b6a('0x64')][_0x25895b[_0x0b6a('0x13d')]]){this[_0x0b6a('0x64')][_0x25895b[_0x0b6a('0x13d')]][_0x0b6a('0x131')]=!![];}}};Preview[_0x0b6a('0x5f')][_0x0b6a('0x13e')]=function(_0x4719){if(_0x4719){if(this['actions'][_0x4719[_0x0b6a('0x13f')]]){this['actions'][_0x4719['transfererlinkedid']]['transfer']=!![];}}};module['exports']=Preview;
\ No newline at end of file
diff --git a/server/services/ami/preview/rpcDb.js b/server/services/ami/preview/rpcDb.js
index 3537a30..a79d798 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 _0xac9d=['../rpc/voiceQueueReport','error','inspect','then','catch','[createHistory]\x20','resolve','createHistory','moveContactManagedDialer','[moveContactManagedDialer]\x20','checkIsBlackList','getContactPreview','[getContactPreview]\x20','createCustomerHistory','rescheduleContact','UserId','active','[rescheduleContact]\x20','countReScheduled','[countReScheduled]\x20','unlockContact','[unlockContact]\x20','crateCustomerReportQueue','type','uniqueid','calleridnum','calleridname','queue','queuecallerjoinAt','answertime','queuecallerleaveAt','queuecallercomplete','queuecallercompleteAt','endtime','connectedlinename','membername','context','from-sip','exten','assigned','lastAssignedTo','queuecallerexitreason','COMPLETED','[voiceQueueReport]\x20','getContactRecallMe','[GetContactRecallMe]\x20','rescheduleContactInQueue','[rescheduleContactInQueue]\x20','util','bluebird','../../../config/logger','preview','lodash','../rpc/cmHopper','../rpc/cmHopperFinal','../rpc/cmHopperHistory','../rpc/voiceQueueRt'];(function(_0x1f4826,_0x5aa134){var _0x5c0b73=function(_0x21db8c){while(--_0x21db8c){_0x1f4826['push'](_0x1f4826['shift']());}};_0x5c0b73(++_0x5aa134);}(_0xac9d,0x14d));var _0xdac9=function(_0x5067db,_0xf8d2f2){_0x5067db=_0x5067db-0x0;var _0x2771e4=_0xac9d[_0x5067db];return _0x2771e4;};'use strict';var util=require(_0xdac9('0x0'));var BPromise=require(_0xdac9('0x1'));var logger=require(_0xdac9('0x2'))(_0xdac9('0x3'));var _=require(_0xdac9('0x4'));var cmHopper=require(_0xdac9('0x5'));var cmHopperFinal=require(_0xdac9('0x6'));var cmHopperHistory=require(_0xdac9('0x7'));var cmHopperBlack=require('../rpc/cmHopperBlack');var voiceQueueRt=require(_0xdac9('0x8'));var agentReportPreview=require('../rpc/agentReportPreview');var voiceQueueReport=require(_0xdac9('0x9'));function loggerCatch(_0x1f8ff3){return function(_0x1222bb){logger[_0xdac9('0xa')](_0x1f8ff3,util[_0xdac9('0xb')](_0x1222bb,{'showHidden':![],'depth':null}));};}function create(_0x39f560){return BPromise['resolve']()[_0xdac9('0xc')](cmHopperHistory['createHistory'](_0x39f560))[_0xdac9('0xd')](loggerCatch(_0xdac9('0xe')));}function createAgent(_0x39c92c){return BPromise[_0xdac9('0xf')]()[_0xdac9('0xc')](agentReportPreview[_0xdac9('0x10')](_0x39c92c))[_0xdac9('0xd')](loggerCatch(_0xdac9('0xe')));}function moveContact(_0xbb5615){return BPromise['resolve']()[_0xdac9('0xc')](cmHopper[_0xdac9('0x11')](_0xbb5615,!![]))['catch'](loggerCatch(_0xdac9('0x12')));}exports[_0xdac9('0x13')]=function(_0xbfe6d8){return BPromise['resolve']()[_0xdac9('0xc')](cmHopperBlack[_0xdac9('0x13')](_0xbfe6d8))[_0xdac9('0xd')](loggerCatch('[checkIsBlackList]\x20'));};exports['getContactPreview']=function(_0x52cbd4){return BPromise[_0xdac9('0xf')]()['then'](cmHopper[_0xdac9('0x14')](_0x52cbd4))[_0xdac9('0xd')](loggerCatch(_0xdac9('0x15')));};exports[_0xdac9('0x10')]=function(_0x2221f8,_0x393acc){create(_0x2221f8)[_0xdac9('0xd')](loggerCatch(_0x393acc));moveContact(_0x2221f8)[_0xdac9('0xd')](loggerCatch(_0x393acc));};exports['createAgentHistory']=function(_0x283343,_0x36b817){createAgent(_0x283343)['catch'](loggerCatch(_0x36b817));};exports[_0xdac9('0x16')]=function(_0xa57f2d,_0x171df1){create(_0xa57f2d)[_0xdac9('0xd')](loggerCatch(_0x171df1));};exports['createCustomerFinal']=function(_0x520369,_0x4029fc){moveContact(_0x520369)[_0xdac9('0xd')](loggerCatch(_0x4029fc));};exports[_0xdac9('0x17')]=function(_0x395ec7,_0x52fb18,_0x23ee5e){if(_0x52fb18){_0x395ec7[_0xdac9('0x18')]=null;}if(_0x23ee5e){_0x395ec7[_0xdac9('0x19')]=![];}return BPromise[_0xdac9('0xf')]()[_0xdac9('0xc')](cmHopper[_0xdac9('0x17')](_0x395ec7))[_0xdac9('0xd')](loggerCatch(_0xdac9('0x1a')));};exports[_0xdac9('0x1b')]=function(_0x33de5c){return BPromise['resolve']()[_0xdac9('0xc')](cmHopper[_0xdac9('0x1b')](_0x33de5c))[_0xdac9('0xd')](loggerCatch(_0xdac9('0x1c')));};exports['unlockContact']=function(_0x1e631a){return BPromise['resolve']()[_0xdac9('0xc')](cmHopper[_0xdac9('0x1d')]({'UserId':null},_0x1e631a,0x1))['catch'](loggerCatch(_0xdac9('0x1e')));};exports['disableContact']=function(_0x450f91){return BPromise[_0xdac9('0xf')]()[_0xdac9('0xc')](cmHopper[_0xdac9('0x1d')]({'active':![]},_0x450f91,0x1))['catch'](loggerCatch('[activeContact]\x20'));};exports[_0xdac9('0x1f')]=function(_0x170afd){var _0x4fe3bd={};_0x4fe3bd['type']=_0x170afd[_0xdac9('0x20')];_0x4fe3bd[_0xdac9('0x21')]=_0x170afd[_0xdac9('0x21')];_0x4fe3bd[_0xdac9('0x22')]=_0x170afd[_0xdac9('0x22')];_0x4fe3bd[_0xdac9('0x23')]=_0x170afd[_0xdac9('0x23')];_0x4fe3bd[_0xdac9('0x24')]=_0x170afd[_0xdac9('0x24')];_0x4fe3bd[_0xdac9('0x25')]=_0x170afd[_0xdac9('0x26')];_0x4fe3bd[_0xdac9('0x27')]=_0x170afd[_0xdac9('0x26')];_0x4fe3bd[_0xdac9('0x28')]=0x1;_0x4fe3bd[_0xdac9('0x29')]=_0x170afd[_0xdac9('0x2a')];_0x4fe3bd[_0xdac9('0x2b')]=_0x170afd[_0xdac9('0x2c')];_0x4fe3bd[_0xdac9('0x2d')]=_0xdac9('0x2e');_0x4fe3bd[_0xdac9('0x2f')]='xcally-motion-preview';_0x4fe3bd['holdtime']=0x0;_0x4fe3bd[_0xdac9('0x30')]=0x1;_0x4fe3bd[_0xdac9('0x31')]=_0x170afd[_0xdac9('0x2c')];_0x4fe3bd[_0xdac9('0x32')]=_0xdac9('0x33');return BPromise['resolve']()[_0xdac9('0xc')](voiceQueueReport['create'](_0x4fe3bd))[_0xdac9('0xd')](loggerCatch(_0xdac9('0x34')));};exports['getContactRecallMe']=function(_0x241674,_0x5222f8){return BPromise['resolve']()[_0xdac9('0xc')](cmHopper[_0xdac9('0x35')](_0x241674,_0x5222f8))[_0xdac9('0xd')](loggerCatch(_0xdac9('0x36')));};exports[_0xdac9('0x37')]=function(_0x363d93){return BPromise['resolve']()[_0xdac9('0xc')](cmHopper[_0xdac9('0x17')](_0x363d93,!![],!![]))['catch'](loggerCatch(_0xdac9('0x38')));};
\ No newline at end of file
+var _0x0fda=['UserId','active','[rescheduleContact]\x20','countReScheduled','[countReScheduled]\x20','unlockContact','[unlockContact]\x20','disableContact','crateCustomerReportQueue','type','uniqueid','calleridnum','calleridname','queue','queuecallerjoinAt','queuecallerleaveAt','answertime','connectedlinename','from-sip','xcally-motion-preview','holdtime','assigned','lastAssignedTo','membername','queuecallerexitreason','COMPLETED','create','[voiceQueueReport]\x20','getContactRecallMe','[GetContactRecallMe]\x20','[rescheduleContactInQueue]\x20','util','../../../config/logger','preview','lodash','../rpc/cmHopper','../rpc/cmHopperFinal','../rpc/cmHopperHistory','../rpc/cmHopperBlack','../rpc/voiceQueueReport','error','inspect','resolve','createHistory','catch','[createHistory]\x20','then','moveContactManagedDialer','checkIsBlackList','[checkIsBlackList]\x20','getContactPreview','[getContactPreview]\x20','createAgentHistory','createCustomerFinal','rescheduleContact'];(function(_0x1dace9,_0x1566ac){var _0xf44d3d=function(_0xd8cf7c){while(--_0xd8cf7c){_0x1dace9['push'](_0x1dace9['shift']());}};_0xf44d3d(++_0x1566ac);}(_0x0fda,0x1a0));var _0xa0fd=function(_0x19b138,_0x32cc07){_0x19b138=_0x19b138-0x0;var _0xfeddf4=_0x0fda[_0x19b138];return _0xfeddf4;};'use strict';var util=require(_0xa0fd('0x0'));var BPromise=require('bluebird');var logger=require(_0xa0fd('0x1'))(_0xa0fd('0x2'));var _=require(_0xa0fd('0x3'));var cmHopper=require(_0xa0fd('0x4'));var cmHopperFinal=require(_0xa0fd('0x5'));var cmHopperHistory=require(_0xa0fd('0x6'));var cmHopperBlack=require(_0xa0fd('0x7'));var voiceQueueRt=require('../rpc/voiceQueueRt');var agentReportPreview=require('../rpc/agentReportPreview');var voiceQueueReport=require(_0xa0fd('0x8'));function loggerCatch(_0x4aec58){return function(_0x49b3c1){logger[_0xa0fd('0x9')](_0x4aec58,util[_0xa0fd('0xa')](_0x49b3c1,{'showHidden':![],'depth':null}));};}function create(_0x1aab41){return BPromise[_0xa0fd('0xb')]()['then'](cmHopperHistory[_0xa0fd('0xc')](_0x1aab41))[_0xa0fd('0xd')](loggerCatch(_0xa0fd('0xe')));}function createAgent(_0x322a1a){return BPromise['resolve']()[_0xa0fd('0xf')](agentReportPreview[_0xa0fd('0xc')](_0x322a1a))[_0xa0fd('0xd')](loggerCatch('[createHistory]\x20'));}function moveContact(_0x4409e4){return BPromise[_0xa0fd('0xb')]()[_0xa0fd('0xf')](cmHopper[_0xa0fd('0x10')](_0x4409e4,!![]))[_0xa0fd('0xd')](loggerCatch('[moveContactManagedDialer]\x20'));}exports['checkIsBlackList']=function(_0x32dcee){return BPromise[_0xa0fd('0xb')]()['then'](cmHopperBlack[_0xa0fd('0x11')](_0x32dcee))[_0xa0fd('0xd')](loggerCatch(_0xa0fd('0x12')));};exports[_0xa0fd('0x13')]=function(_0x2b0993){return BPromise[_0xa0fd('0xb')]()[_0xa0fd('0xf')](cmHopper['getContactPreview'](_0x2b0993))[_0xa0fd('0xd')](loggerCatch(_0xa0fd('0x14')));};exports['createHistory']=function(_0x50aa6d,_0x205506){create(_0x50aa6d)[_0xa0fd('0xd')](loggerCatch(_0x205506));moveContact(_0x50aa6d)['catch'](loggerCatch(_0x205506));};exports[_0xa0fd('0x15')]=function(_0x22a876,_0x1cb027){createAgent(_0x22a876)['catch'](loggerCatch(_0x1cb027));};exports['createCustomerHistory']=function(_0x46e15a,_0x558109){create(_0x46e15a)[_0xa0fd('0xd')](loggerCatch(_0x558109));};exports[_0xa0fd('0x16')]=function(_0x10f64b,_0x2cf99d){moveContact(_0x10f64b)[_0xa0fd('0xd')](loggerCatch(_0x2cf99d));};exports[_0xa0fd('0x17')]=function(_0x113059,_0x515b0d,_0x166934){if(_0x515b0d){_0x113059[_0xa0fd('0x18')]=null;}if(_0x166934){_0x113059[_0xa0fd('0x19')]=![];}return BPromise[_0xa0fd('0xb')]()[_0xa0fd('0xf')](cmHopper[_0xa0fd('0x17')](_0x113059))[_0xa0fd('0xd')](loggerCatch(_0xa0fd('0x1a')));};exports[_0xa0fd('0x1b')]=function(_0x13fc62){return BPromise[_0xa0fd('0xb')]()[_0xa0fd('0xf')](cmHopper[_0xa0fd('0x1b')](_0x13fc62))['catch'](loggerCatch(_0xa0fd('0x1c')));};exports[_0xa0fd('0x1d')]=function(_0x541118){return BPromise[_0xa0fd('0xb')]()[_0xa0fd('0xf')](cmHopper['unlockContact']({'UserId':null},_0x541118,0x1))['catch'](loggerCatch(_0xa0fd('0x1e')));};exports[_0xa0fd('0x1f')]=function(_0x4d2c96){return BPromise['resolve']()['then'](cmHopper['unlockContact']({'active':![]},_0x4d2c96,0x1))[_0xa0fd('0xd')](loggerCatch('[activeContact]\x20'));};exports[_0xa0fd('0x20')]=function(_0x1db300){var _0x2f5b0d={};_0x2f5b0d['type']=_0x1db300[_0xa0fd('0x21')];_0x2f5b0d[_0xa0fd('0x22')]=_0x1db300[_0xa0fd('0x22')];_0x2f5b0d[_0xa0fd('0x23')]=_0x1db300[_0xa0fd('0x23')];_0x2f5b0d['calleridname']=_0x1db300[_0xa0fd('0x24')];_0x2f5b0d[_0xa0fd('0x25')]=_0x1db300[_0xa0fd('0x25')];_0x2f5b0d[_0xa0fd('0x26')]=_0x1db300['answertime'];_0x2f5b0d[_0xa0fd('0x27')]=_0x1db300[_0xa0fd('0x28')];_0x2f5b0d['queuecallercomplete']=0x1;_0x2f5b0d['queuecallercompleteAt']=_0x1db300['endtime'];_0x2f5b0d[_0xa0fd('0x29')]=_0x1db300['membername'];_0x2f5b0d['context']=_0xa0fd('0x2a');_0x2f5b0d['exten']=_0xa0fd('0x2b');_0x2f5b0d[_0xa0fd('0x2c')]=0x0;_0x2f5b0d[_0xa0fd('0x2d')]=0x1;_0x2f5b0d[_0xa0fd('0x2e')]=_0x1db300[_0xa0fd('0x2f')];_0x2f5b0d[_0xa0fd('0x30')]=_0xa0fd('0x31');return BPromise[_0xa0fd('0xb')]()['then'](voiceQueueReport[_0xa0fd('0x32')](_0x2f5b0d))['catch'](loggerCatch(_0xa0fd('0x33')));};exports['getContactRecallMe']=function(_0x5f4152,_0x33f24b){return BPromise['resolve']()[_0xa0fd('0xf')](cmHopper[_0xa0fd('0x34')](_0x5f4152,_0x33f24b))[_0xa0fd('0xd')](loggerCatch(_0xa0fd('0x35')));};exports['rescheduleContactInQueue']=function(_0x1e4faa){return BPromise[_0xa0fd('0xb')]()[_0xa0fd('0xf')](cmHopper[_0xa0fd('0x17')](_0x1e4faa,!![],!![]))[_0xa0fd('0xd')](loggerCatch(_0xa0fd('0x36')));};
\ 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 ba40cf6..f567029 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 _0x23f5=['rtpaudioqos','rtpaudioqosjitter','rtpaudioqosloss','rtpaudioqoslossbridged','rtpaudioqosrtt','rtpaudioqosrttbridged','rtpaudioqosbridged','bridgepvtcallid','getCallerIdRandom','\x5cw{0,','pow','replace','random','extractCalleridName','match','extractCalleridNumber','util','moment','preview','env','127.0.0.1','milliseconds','diff','seconds','loggerCatch','inspect','info','loggerError','logger2','message','getCallerId','isUndefined','string','isEmpty','format','\x22\x22\x20<>','isActive','isNil','Queue','calleridnum','ContactId','dialer','VoiceQueueId','dialOriginateTimeout','dialQueueProject2','monitor_format','dialQueueProject','\x22agi://%s/square,%s\x22','NONE','originatecalleridname','xcally-motion-preview','_XCALLY_MIXMONITOR_UNIQUEID','Contact','tags','updatedAt','%s%s','toLowerVariables','toLower','updateOriginated','hasOwnProperty','originated','error','[updateOriginated]\x20is\x20null\x20or\x20undefined','logBlacklist','YYYY-MM-DD\x20HH:mm:ss','state','statedesc','Blacklist','starttime','responsetime','endtime','logLookAgent','membername','UserId','logCustomer','ringtime','answertime','isFailure','Failure','variablesAction','RECALL','calleridname','BOOKED','uniqueid','originate','from-sip','totalGlobal','countbusyretry','countcongestionretry','clone','Global','scheduledAt','active','scheduledat','minutes','ListId','decrementTalkink','pTalking','[decrementTalkink]\x20object\x20talking\x20is\x20negative','[decrementTalkink]\x20is\x20null\x20or\x20undefined','IsNotLoggedIn','buildObj','name','queue','interface','channelAgent','buildAcw','push','getDiff','createBody','CampaignId','filterKey','idContact','type','campaigntype','dialAnswer','countnoanswerretry','countglobal','callbackuniqueid','callbackat','recallme','sipcallid','xmd-voicequeueid','xmd-phone','xmd-listid','xmd-dialurl','xmd-dialtimeout','xmd-dialoptions','xmd-dialid','xmd-contactid','xmd-cdrtype','xmd-callerid','xmd-agiafter'];(function(_0x321bb2,_0x202794){var _0x9c12ed=function(_0x263dd3){while(--_0x263dd3){_0x321bb2['push'](_0x321bb2['shift']());}};_0x9c12ed(++_0x202794);}(_0x23f5,0x95));var _0x523f=function(_0x19115e,_0x507bab){_0x19115e=_0x19115e-0x0;var _0x45bbd4=_0x23f5[_0x19115e];return _0x45bbd4;};'use strict';var util=require(_0x523f('0x0'));var _=require('lodash');var moment=require(_0x523f('0x1'));var logger=require('../../../../config/logger')(_0x523f('0x2'));var ipAgi=process[_0x523f('0x3')]['XCALLY_IP_AGI']||_0x523f('0x4');function getSeconds(_0x50be3e,_0x579420){var _0x31d03b=moment(_0x50be3e)['milliseconds'](0x0);var _0x5c21a1=moment(_0x579420)[_0x523f('0x5')](0x0);return _0x31d03b[_0x523f('0x6')](_0x5c21a1,_0x523f('0x7'));}exports[_0x523f('0x8')]=function(_0x5de91c){return function(_0x4104bc){logger['error'](_0x5de91c,util[_0x523f('0x9')](_0x4104bc,{'showHidden':![],'depth':null}));};};exports['logger']=function(_0x5502f0,_0x3af25e){logger[_0x523f('0xa')](_0x5502f0,util[_0x523f('0x9')](_0x3af25e,{'showHidden':![],'depth':null}));};exports[_0x523f('0xb')]=function(_0x3e2276,_0x804872){logger['error'](_0x3e2276,util[_0x523f('0x9')](_0x804872,{'showHidden':![],'depth':null}));};exports[_0x523f('0xc')]=function(_0x4de096){return function(_0x1e6679){logger['info'](_0x4de096,util[_0x523f('0x9')](_0x1e6679,{'showHidden':![],'depth':null}));};};exports[_0x523f('0xd')]=function(_0x26f695,_0x1a375d,_0x460c8b){return{'message':_0x26f695,'unlock':_0x1a375d,'active':_0x460c8b};};exports[_0x523f('0xe')]=function(_0x34eee3,_0x45fe7b,_0x5d19de){if(!_[_0x523f('0xf')](_0x5d19de)&&_0x523f('0x10')===typeof _0x5d19de&&!_[_0x523f('0x11')](_0x5d19de)){if(!_[_0x523f('0xf')](_0x45fe7b)&&_0x523f('0x10')===typeof _0x45fe7b&&!_[_0x523f('0x11')](_0x45fe7b)){return util[_0x523f('0x12')]('\x22%s\x22\x20<%s>',_0x45fe7b,_0x5d19de);}return util[_0x523f('0x12')]('\x22%s\x22\x20<%s>',_0x5d19de,_0x5d19de);}if(!_[_0x523f('0xf')](_0x34eee3)&&'string'===typeof _0x34eee3&&!_[_0x523f('0x11')](_0x34eee3)){return _0x34eee3;}return _0x523f('0x13');};exports[_0x523f('0x14')]=function(_0x39586d){if(_[_0x523f('0x15')](_0x39586d)){return![];}return _0x39586d;};exports['addVariables']=function(_0xaf5639,_0x577cef,_0x16db15,_0x3e07dd,_0x7c62db,_0x1b3274){var _0x163005={'XMD-QUEUE':_0x577cef[_0x523f('0x16')]?_0x577cef[_0x523f('0x16')]['name']:'','XMD-CALLERID':_0x3e07dd,'XMD-CALLERID-PREVIEW':_0x1b3274?util['format']('\x22%s\x22\x20<%s>',_0x1b3274['calleridname'],_0x1b3274[_0x523f('0x17')]):_0x3e07dd,'XMD-DIALID':_0x7c62db,'XMD-CONTACTID':_0x577cef[_0x523f('0x18')],'XMD-CDRTYPE':_0x523f('0x19'),'CALLERID(all)':_0x3e07dd,'XMD-VOICEQUEUEID':_0x577cef[_0x523f('0x1a')],'XMD-DIALCHANNEL':_0x16db15,'XMD-DIALTIMEOUT':_0xaf5639[_0x523f('0x1b')]||0x1e,'XMD-DIALOPTIONS':util[_0x523f('0x12')]('\x22rtTxX%s%s\x22',_0xaf5639[_0x523f('0x1c')]?'g':'',_[_0x523f('0x11')](_0xaf5639[_0x523f('0x1d')])?'':'U(xcally-mixmonitor-context)'),'XMD-DIALURL':_0xaf5639['dialPreviewUrl']||'','XMD-AGI':_0xaf5639[_0x523f('0x1e')]?util['format'](_0x523f('0x1f'),ipAgi,_0xaf5639[_0x523f('0x1e')]):_0x523f('0x20'),'XMD-AGIAFTER':_0xaf5639[_0x523f('0x1c')]?util['format']('\x22agi://%s/square,%s\x22',ipAgi,_0xaf5639['dialQueueProject2']):_0x523f('0x20'),'XMD-ORIGINATECALLERIDNUM':_0x1b3274?_0x1b3274['originatecalleridnum']:'','XMD-ORIGINATECALLERIDNAME':_0x1b3274?_0x1b3274[_0x523f('0x21')]:'','XMD-DESTINATION':_0x523f('0x22')};if(!_[_0x523f('0x11')](_0xaf5639[_0x523f('0x1d')])){_0x163005[util[_0x523f('0x12')]('%s','_XCALLY_MIXMONITOR_FORMAT')]=_0xaf5639[_0x523f('0x1d')];_0x163005[util[_0x523f('0x12')]('%s',_0x523f('0x23'))]=_0x7c62db;}if(_0x577cef&&_0x577cef[_0x523f('0x24')]){for(var _0x529cf3 in _0x577cef[_0x523f('0x24')]){if(_0x577cef[_0x523f('0x24')]['hasOwnProperty'](_0x529cf3)){if(!_[_0x523f('0x15')](_0x577cef[_0x523f('0x24')][_0x529cf3])&&_0x529cf3!=='id'&&_0x529cf3!==_0x523f('0x25')&&_0x529cf3!=='createdAt'&&_0x529cf3!==_0x523f('0x26')){_0x163005[util[_0x523f('0x12')](_0x523f('0x27'),'XMD-',_['toUpper'](_0x529cf3))]=_0x577cef[_0x523f('0x24')][_0x529cf3];}}}}return _0x163005;};exports[_0x523f('0x28')]=function(_0x334c35){var _0x30c770={};for(var _0x3e4cf4 in _0x334c35){if(_0x334c35['hasOwnProperty'](_0x3e4cf4)){_0x30c770[util[_0x523f('0x12')]('%s',_[_0x523f('0x29')](_0x3e4cf4))]=_0x334c35[_0x3e4cf4];}}return{'variables':_0x30c770};};exports[_0x523f('0x2a')]=function(_0x27c8b6,_0x432a29){if(!_['isNil'](_0x27c8b6)){if(_0x27c8b6[_0x523f('0x2b')](_0x523f('0x2c'))){if(_0x27c8b6[_0x523f('0x2c')]>0x0){_0x27c8b6[_0x523f('0x2c')]-=0x1;}else{logger[_0x523f('0x2d')]('[updateOriginated]\x20object\x20originated\x20is\x20negative',_0x432a29);}}}else{logger[_0x523f('0x2d')](_0x523f('0x2e'),_0x432a29);}};exports[_0x523f('0x2f')]=function(_0x4ed79f){var _0x4dbf67=moment()[_0x523f('0x12')](_0x523f('0x30'));_0x4ed79f[_0x523f('0x31')]=0xd;_0x4ed79f[_0x523f('0x32')]=_0x523f('0x33');_0x4ed79f[_0x523f('0x34')]=_0x4dbf67;_0x4ed79f[_0x523f('0x35')]=_0x4dbf67;_0x4ed79f[_0x523f('0x36')]=_0x4dbf67;};exports['logAgent']=function(_0x2b2935,_0x4db650,_0x46efe3){var _0x58246c=moment()[_0x523f('0x12')](_0x523f('0x30'));_0x2b2935['state']=_0x4db650;_0x2b2935['statedesc']=_0x46efe3;_0x2b2935[_0x523f('0x35')]=_0x58246c;_0x2b2935['ringtime']=getSeconds(_0x2b2935[_0x523f('0x35')],_0x2b2935[_0x523f('0x34')]);};exports[_0x523f('0x37')]=function(_0x5fba17,_0x236339,_0x4ecc92){_0x5fba17[_0x523f('0x38')]=_0x236339;_0x5fba17[_0x523f('0x39')]=_0x4ecc92;};exports[_0x523f('0x3a')]=function(_0x4be5b2,_0xaf7d31,_0x35c6fd){var _0x5d773f=moment()['format'](_0x523f('0x30'));_0x4be5b2[_0x523f('0x31')]=_0xaf7d31;_0x4be5b2[_0x523f('0x32')]=_0x35c6fd;_0x4be5b2[_0x523f('0x35')]=_0x4be5b2[_0x523f('0x35')]?_0x4be5b2[_0x523f('0x35')]:_0x5d773f;_0x4be5b2['endtime']=_0x4be5b2[_0x523f('0x36')]?_0x4be5b2[_0x523f('0x36')]:_0x5d773f;_0x4be5b2[_0x523f('0x3b')]=getSeconds(_0x4be5b2[_0x523f('0x35')]||0x0,_0x4be5b2[_0x523f('0x34')]||0x0);_0x4be5b2['talktime']=_0x4be5b2[_0x523f('0x3c')]?getSeconds(_0x4be5b2[_0x523f('0x36')],_0x4be5b2[_0x523f('0x3c')]):0x0;};exports[_0x523f('0x3d')]=function(_0x2ffe51){return _0x2ffe51===_0x523f('0x3e');};exports[_0x523f('0x3f')]=function(_0x360ace,_0x5e87f6,_0x2fc506,_0x4d5d9b,_0x1280f5){var _0x48b220=_0x4d5d9b?_0x523f('0x40'):_0x360ace[_0x523f('0x41')];_0x48b220=_0x1280f5?_0x523f('0x42'):_0x48b220;return{'actionid':_0x360ace[_0x523f('0x43')],'action':_0x523f('0x44'),'channel':_0x360ace['channelAgent'],'callerid':util['format']('\x22%s\x22\x20<%s>',_0x48b220,_0x360ace[_0x523f('0x17')]),'Exten':_0x523f('0x22'),'Context':_0x523f('0x45'),'Priority':'1','variable':_0x2fc506,'timeout':(_0x5e87f6['timeout']||0x1e)*0x3e8,'async':!![],'channelid':_0x360ace[_0x523f('0x43')]};};exports[_0x523f('0x46')]=function(_0x57fc86){return _0x57fc86[_0x523f('0x47')]+_0x57fc86[_0x523f('0x48')]+_0x57fc86['countnoanswerretry'];};exports['cloneAction']=function(_0x388959){var _0x15286a=_[_0x523f('0x49')](_0x388959);_0x15286a['state']=0xf;_0x15286a[_0x523f('0x32')]=_0x523f('0x4a');return _0x15286a;};exports[_0x523f('0x4b')]=function(_0xf0add3,_0x23eff1,_0x12bb77){var _0x18969a={};_0x18969a[_0x23eff1]=_0xf0add3[_0x23eff1];_0x18969a[_0x523f('0x4c')]=![];_0x18969a[_0x523f('0x4d')]=moment()['add'](_0x12bb77,_0x523f('0x4e'))[_0x523f('0x12')](_0x523f('0x30'));_0x18969a['ContactId']=_0xf0add3['ContactId'];_0x18969a[_0x523f('0x4f')]=_0xf0add3[_0x523f('0x4f')];_0x18969a['VoiceQueueId']=_0xf0add3[_0x523f('0x1a')]||undefined;return _0x18969a;};exports[_0x523f('0x50')]=function(_0x23fb95,_0x4bc05a){if(!_[_0x523f('0x15')](_0x23fb95)){if(_0x23fb95[_0x523f('0x51')]>0x0){_0x23fb95[_0x523f('0x51')]-=0x1;}else{logger[_0x523f('0x2d')](_0x4bc05a,_0x523f('0x52'));}}else{logger['error'](_0x4bc05a,_0x523f('0x53'));}};exports[_0x523f('0x54')]=function(_0x3dfa09){if(_0x3dfa09<=0x0){return!![];}return![];};exports[_0x523f('0x55')]=function(_0x40a5dd,_0x248ffe){_0x40a5dd['lastevent']=_0x248ffe;_0x40a5dd[_0x523f('0x56')]=_0x40a5dd[_0x523f('0x57')];_0x40a5dd[_0x523f('0x58')]=_0x40a5dd[_0x523f('0x59')];return _0x40a5dd;};exports[_0x523f('0x5a')]=function(_0x29c5aa){var _0x48b40d={};_0x48b40d[_0x523f('0x57')]=_0x29c5aa['queue'];_0x48b40d[_0x523f('0x58')]=_0x29c5aa['channelAgent'];_0x48b40d[_0x523f('0x43')]=_0x29c5aa['uniqueid'];return _0x48b40d;};exports['agentReadyId']=function(_0x11ddde){var _0x279c25=[];for(var _0x273294 in _0x11ddde){if(_0x11ddde[_0x523f('0x2b')](_0x273294)){if(!_[_0x523f('0x15')](_0x11ddde[_0x273294])&&_0x11ddde[_0x273294][_0x523f('0x31')]==='not_inuse'&&_0x11ddde[_0x273294]['status']==='reachable'){_0x279c25[_0x523f('0x5b')](_0x11ddde[_0x273294]['id']);}}}return _0x279c25;};exports[_0x523f('0x5c')]=function(_0xb31ef3){var _0x1989b3=moment()[_0x523f('0x5')](0x0);var _0x4f7e96=moment(_0xb31ef3)[_0x523f('0x5')](0x0);return _0x1989b3[_0x523f('0x6')](_0x4f7e96,_0x523f('0x7'));};exports[_0x523f('0x5d')]=function(_0x496cc9){return{'active':![],'recallme':![],'UserId':null,'ContactId':_0x496cc9['ContactId'],'ListId':_0x496cc9['ListId'],'VoiceQueueId':_0x496cc9['VoiceQueueId']||undefined,'CampaignId':_0x496cc9[_0x523f('0x5e')]||undefined};};exports[_0x523f('0x5f')]=function(_0x220536){if(_0x220536==='uniqueid'||_0x220536===_0x523f('0x60')||_0x220536===_0x523f('0x57')||_0x220536===_0x523f('0x61')||_0x220536===_0x523f('0x62')||_0x220536===_0x523f('0x63')||_0x220536===_0x523f('0x38')||_0x220536==='channelAgent'||_0x220536==='calleridname'||_0x220536===_0x523f('0x4c')||_0x220536===_0x523f('0x17')||_0x220536==='scheduledat'||_0x220536==='countbusyretry'||_0x220536===_0x523f('0x48')||_0x220536===_0x523f('0x64')||_0x220536===_0x523f('0x65')||_0x220536==='callback'||_0x220536===_0x523f('0x66')||_0x220536===_0x523f('0x67')||_0x220536===_0x523f('0x68')||_0x220536==='ContactId'||_0x220536===_0x523f('0x4f')||_0x220536===_0x523f('0x39')||_0x220536==='VoiceQueueId'||_0x220536===_0x523f('0x69')||_0x220536===_0x523f('0x6a')||_0x220536==='xmd-queue'||_0x220536===_0x523f('0x6b')||_0x220536===_0x523f('0x6c')||_0x220536===_0x523f('0x6d')||_0x220536===_0x523f('0x6e')||_0x220536===_0x523f('0x6f')||_0x220536===_0x523f('0x70')||_0x220536==='xmd-dialchannel'||_0x220536===_0x523f('0x71')||_0x220536===_0x523f('0x72')||_0x220536===_0x523f('0x73')||_0x220536===_0x523f('0x74')||_0x220536==='xmd-agi'||_0x220536===_0x523f('0x75')||_0x220536==='rtpaudioqosbridged'||_0x220536===_0x523f('0x76')||_0x220536==='rtpaudioqosjitterbridged'||_0x220536===_0x523f('0x77')||_0x220536===_0x523f('0x78')||_0x220536===_0x523f('0x79')||_0x220536===_0x523f('0x7a')||_0x220536===_0x523f('0x75')||_0x220536===_0x523f('0x7b')||_0x220536===_0x523f('0x76')||_0x220536==='rtpaudioqosjitterbridged'||_0x220536==='rtpaudioqosloss'||_0x220536==='rtpaudioqoslossbridged'||_0x220536==='rtpaudioqosrtt'||_0x220536===_0x523f('0x7a')||_0x220536==='bridgepeer'||_0x220536===_0x523f('0x7c')||_0x220536===_0x523f('0x31')||_0x220536===_0x523f('0x32')){return![];}return!![];};exports[_0x523f('0x7d')]=function(_0x1f601e,_0x3dc42d){var _0x3e5aa8,_0x42d365,_0x372805;if(_0x3dc42d<=0x0){_0x3dc42d=0x1;}_0x3e5aa8=new RegExp(_0x523f('0x7e')+_0x3dc42d+'}$');_0x42d365=Math['pow'](0xa,_0x3dc42d-0x1);_0x372805=Math[_0x523f('0x7f')](0xa,_0x3dc42d)-0x1;return util['format']('%s',_[_0x523f('0x80')](_0x1f601e,_0x3e5aa8,_[_0x523f('0x81')](_0x42d365,_0x372805)));};exports[_0x523f('0x82')]=function(_0x70c155){var _0x57dfa3=_0x70c155[_0x523f('0x83')](/"(.*?)"/);return _0x57dfa3?_0x57dfa3[0x1]:_0x70c155;};exports[_0x523f('0x84')]=function(_0x48056a){var _0x5a713c=_0x48056a['match'](/<(.*?)>/);return _0x5a713c?_0x5a713c[0x1]:_0x48056a;};
\ No newline at end of file
+var _0xebfb=['lodash','preview','env','XCALLY_IP_AGI','milliseconds','seconds','loggerCatch','error','inspect','logger','info','loggerError','message','isUndefined','isEmpty','string','format','isActive','isNil','addVariables','name','\x22%s\x22\x20<%s>','calleridname','calleridnum','ContactId','dialer','dialOriginateTimeout','\x22rtTxX%s%s\x22','dialQueueProject2','monitor_format','dialPreviewUrl','\x22agi://%s/square,%s\x22','NONE','originatecalleridname','xcally-motion-preview','_XCALLY_MIXMONITOR_FORMAT','_XCALLY_MIXMONITOR_UNIQUEID','Contact','hasOwnProperty','tags','createdAt','updatedAt','%s%s','XMD-','toUpper','toLowerVariables','toLower','updateOriginated','originated','[updateOriginated]\x20is\x20null\x20or\x20undefined','logBlacklist','state','statedesc','Blacklist','starttime','endtime','YYYY-MM-DD\x20HH:mm:ss','responsetime','ringtime','membername','logCustomer','talktime','answertime','isFailure','Failure','variablesAction','RECALL','BOOKED','channelAgent','from-sip','timeout','totalGlobal','countcongestionretry','clone','Global','scheduledAt','scheduledat','add','minutes','ListId','decrementTalkink','pTalking','[decrementTalkink]\x20object\x20talking\x20is\x20negative','[decrementTalkink]\x20is\x20null\x20or\x20undefined','IsNotLoggedIn','buildObj','lastevent','queue','interface','buildAcw','agentReadyId','not_inuse','status','push','getDiff','createBody','VoiceQueueId','CampaignId','idContact','campaigntype','active','countbusyretry','countnoanswerretry','countglobal','callback','callbackuniqueid','callbackat','sipcallid','xmd-voicequeueid','xmd-phone','xmd-listid','xmd-dialurl','xmd-dialtimeout','xmd-dialoptions','xmd-dialid','xmd-dialchannel','xmd-callerid','xmd-agiafter','xmd-agi','rtpaudioqos','rtpaudioqosjitter','rtpaudioqosjitterbridged','rtpaudioqoslossbridged','rtpaudioqosrtt','rtpaudioqosrttbridged','rtpaudioqosloss','bridgepeer','getCallerIdRandom','\x5cw{0,','pow','extractCalleridName','match','extractCalleridNumber'];(function(_0xd413a4,_0x3120fe){var _0x9170f4=function(_0x5aa567){while(--_0x5aa567){_0xd413a4['push'](_0xd413a4['shift']());}};_0x9170f4(++_0x3120fe);}(_0xebfb,0x10a));var _0xbebf=function(_0x12a4fa,_0x4b927e){_0x12a4fa=_0x12a4fa-0x0;var _0x5baea6=_0xebfb[_0x12a4fa];return _0x5baea6;};'use strict';var util=require('util');var _=require(_0xbebf('0x0'));var moment=require('moment');var logger=require('../../../../config/logger')(_0xbebf('0x1'));var ipAgi=process[_0xbebf('0x2')][_0xbebf('0x3')]||'127.0.0.1';function getSeconds(_0x3e68e2,_0x32e701){var _0x1fd9d3=moment(_0x3e68e2)[_0xbebf('0x4')](0x0);var _0x5c973b=moment(_0x32e701)[_0xbebf('0x4')](0x0);return _0x1fd9d3['diff'](_0x5c973b,_0xbebf('0x5'));}exports[_0xbebf('0x6')]=function(_0x26dd18){return function(_0x8aca07){logger[_0xbebf('0x7')](_0x26dd18,util[_0xbebf('0x8')](_0x8aca07,{'showHidden':![],'depth':null}));};};exports[_0xbebf('0x9')]=function(_0x371eff,_0x9ddba0){logger[_0xbebf('0xa')](_0x371eff,util[_0xbebf('0x8')](_0x9ddba0,{'showHidden':![],'depth':null}));};exports[_0xbebf('0xb')]=function(_0x21c343,_0x96e001){logger[_0xbebf('0x7')](_0x21c343,util[_0xbebf('0x8')](_0x96e001,{'showHidden':![],'depth':null}));};exports['logger2']=function(_0x57331b){return function(_0x3bd580){logger['info'](_0x57331b,util['inspect'](_0x3bd580,{'showHidden':![],'depth':null}));};};exports[_0xbebf('0xc')]=function(_0x3aabf4,_0x46849e,_0x1b6d6b){return{'message':_0x3aabf4,'unlock':_0x46849e,'active':_0x1b6d6b};};exports['getCallerId']=function(_0x2f4a44,_0x972504,_0x47225b){if(!_[_0xbebf('0xd')](_0x47225b)&&'string'===typeof _0x47225b&&!_[_0xbebf('0xe')](_0x47225b)){if(!_['isUndefined'](_0x972504)&&_0xbebf('0xf')===typeof _0x972504&&!_[_0xbebf('0xe')](_0x972504)){return util[_0xbebf('0x10')]('\x22%s\x22\x20<%s>',_0x972504,_0x47225b);}return util[_0xbebf('0x10')]('\x22%s\x22\x20<%s>',_0x47225b,_0x47225b);}if(!_[_0xbebf('0xd')](_0x2f4a44)&&_0xbebf('0xf')===typeof _0x2f4a44&&!_[_0xbebf('0xe')](_0x2f4a44)){return _0x2f4a44;}return'\x22\x22\x20<>';};exports[_0xbebf('0x11')]=function(_0x2d91ff){if(_[_0xbebf('0x12')](_0x2d91ff)){return![];}return _0x2d91ff;};exports[_0xbebf('0x13')]=function(_0x50f76a,_0x34f0c4,_0x95e1b3,_0x544c78,_0x1c41fd,_0x5051cb){var _0x2bf322={'XMD-QUEUE':_0x34f0c4['Queue']?_0x34f0c4['Queue'][_0xbebf('0x14')]:'','XMD-CALLERID':_0x544c78,'XMD-CALLERID-PREVIEW':_0x5051cb?util[_0xbebf('0x10')](_0xbebf('0x15'),_0x5051cb[_0xbebf('0x16')],_0x5051cb[_0xbebf('0x17')]):_0x544c78,'XMD-DIALID':_0x1c41fd,'XMD-CONTACTID':_0x34f0c4[_0xbebf('0x18')],'XMD-CDRTYPE':_0xbebf('0x19'),'CALLERID(all)':_0x544c78,'XMD-VOICEQUEUEID':_0x34f0c4['VoiceQueueId'],'XMD-DIALCHANNEL':_0x95e1b3,'XMD-DIALTIMEOUT':_0x50f76a[_0xbebf('0x1a')]||0x1e,'XMD-DIALOPTIONS':util[_0xbebf('0x10')](_0xbebf('0x1b'),_0x50f76a[_0xbebf('0x1c')]?'g':'',_[_0xbebf('0xe')](_0x50f76a[_0xbebf('0x1d')])?'':'U(xcally-mixmonitor-context)'),'XMD-DIALURL':_0x50f76a[_0xbebf('0x1e')]||'','XMD-AGI':_0x50f76a['dialQueueProject']?util['format'](_0xbebf('0x1f'),ipAgi,_0x50f76a['dialQueueProject']):_0xbebf('0x20'),'XMD-AGIAFTER':_0x50f76a[_0xbebf('0x1c')]?util[_0xbebf('0x10')]('\x22agi://%s/square,%s\x22',ipAgi,_0x50f76a[_0xbebf('0x1c')]):_0xbebf('0x20'),'XMD-ORIGINATECALLERIDNUM':_0x5051cb?_0x5051cb['originatecalleridnum']:'','XMD-ORIGINATECALLERIDNAME':_0x5051cb?_0x5051cb[_0xbebf('0x21')]:'','XMD-DESTINATION':_0xbebf('0x22')};if(!_[_0xbebf('0xe')](_0x50f76a[_0xbebf('0x1d')])){_0x2bf322[util[_0xbebf('0x10')]('%s',_0xbebf('0x23'))]=_0x50f76a['monitor_format'];_0x2bf322[util[_0xbebf('0x10')]('%s',_0xbebf('0x24'))]=_0x1c41fd;}if(_0x34f0c4&&_0x34f0c4[_0xbebf('0x25')]){for(var _0x51c5e4 in _0x34f0c4['Contact']){if(_0x34f0c4['Contact'][_0xbebf('0x26')](_0x51c5e4)){if(!_[_0xbebf('0x12')](_0x34f0c4[_0xbebf('0x25')][_0x51c5e4])&&_0x51c5e4!=='id'&&_0x51c5e4!==_0xbebf('0x27')&&_0x51c5e4!==_0xbebf('0x28')&&_0x51c5e4!==_0xbebf('0x29')){_0x2bf322[util[_0xbebf('0x10')](_0xbebf('0x2a'),_0xbebf('0x2b'),_[_0xbebf('0x2c')](_0x51c5e4))]=_0x34f0c4['Contact'][_0x51c5e4];}}}}return _0x2bf322;};exports[_0xbebf('0x2d')]=function(_0x30a1b0){var _0x4c2872={};for(var _0x28e3b0 in _0x30a1b0){if(_0x30a1b0[_0xbebf('0x26')](_0x28e3b0)){_0x4c2872[util[_0xbebf('0x10')]('%s',_[_0xbebf('0x2e')](_0x28e3b0))]=_0x30a1b0[_0x28e3b0];}}return{'variables':_0x4c2872};};exports[_0xbebf('0x2f')]=function(_0x5ecbb2,_0x534be8){if(!_[_0xbebf('0x12')](_0x5ecbb2)){if(_0x5ecbb2[_0xbebf('0x26')](_0xbebf('0x30'))){if(_0x5ecbb2['originated']>0x0){_0x5ecbb2[_0xbebf('0x30')]-=0x1;}else{logger[_0xbebf('0x7')]('[updateOriginated]\x20object\x20originated\x20is\x20negative',_0x534be8);}}}else{logger['error'](_0xbebf('0x31'),_0x534be8);}};exports[_0xbebf('0x32')]=function(_0x40d335){var _0x3e0875=moment()[_0xbebf('0x10')]('YYYY-MM-DD\x20HH:mm:ss');_0x40d335[_0xbebf('0x33')]=0xd;_0x40d335[_0xbebf('0x34')]=_0xbebf('0x35');_0x40d335[_0xbebf('0x36')]=_0x3e0875;_0x40d335['responsetime']=_0x3e0875;_0x40d335[_0xbebf('0x37')]=_0x3e0875;};exports['logAgent']=function(_0x4ee93d,_0x2b4628,_0x25e3e4){var _0x1de2d8=moment()[_0xbebf('0x10')](_0xbebf('0x38'));_0x4ee93d['state']=_0x2b4628;_0x4ee93d[_0xbebf('0x34')]=_0x25e3e4;_0x4ee93d[_0xbebf('0x39')]=_0x1de2d8;_0x4ee93d[_0xbebf('0x3a')]=getSeconds(_0x4ee93d[_0xbebf('0x39')],_0x4ee93d[_0xbebf('0x36')]);};exports['logLookAgent']=function(_0x367443,_0xaa2544,_0x311e36){_0x367443[_0xbebf('0x3b')]=_0xaa2544;_0x367443['UserId']=_0x311e36;};exports[_0xbebf('0x3c')]=function(_0x217ac8,_0x12c1bc,_0x1a4638){var _0x39acba=moment()[_0xbebf('0x10')]('YYYY-MM-DD\x20HH:mm:ss');_0x217ac8[_0xbebf('0x33')]=_0x12c1bc;_0x217ac8['statedesc']=_0x1a4638;_0x217ac8['responsetime']=_0x217ac8[_0xbebf('0x39')]?_0x217ac8[_0xbebf('0x39')]:_0x39acba;_0x217ac8[_0xbebf('0x37')]=_0x217ac8[_0xbebf('0x37')]?_0x217ac8[_0xbebf('0x37')]:_0x39acba;_0x217ac8[_0xbebf('0x3a')]=getSeconds(_0x217ac8[_0xbebf('0x39')]||0x0,_0x217ac8[_0xbebf('0x36')]||0x0);_0x217ac8[_0xbebf('0x3d')]=_0x217ac8[_0xbebf('0x3e')]?getSeconds(_0x217ac8[_0xbebf('0x37')],_0x217ac8[_0xbebf('0x3e')]):0x0;};exports[_0xbebf('0x3f')]=function(_0x239da1){return _0x239da1===_0xbebf('0x40');};exports[_0xbebf('0x41')]=function(_0xa8cd01,_0x39b07f,_0xb9cdf8,_0x437809,_0x43cf4e){var _0x30e4e5=_0x437809?_0xbebf('0x42'):_0xa8cd01['calleridname'];_0x30e4e5=_0x43cf4e?_0xbebf('0x43'):_0x30e4e5;return{'actionid':_0xa8cd01['uniqueid'],'action':'originate','channel':_0xa8cd01[_0xbebf('0x44')],'callerid':util['format'](_0xbebf('0x15'),_0x30e4e5,_0xa8cd01[_0xbebf('0x17')]),'Exten':_0xbebf('0x22'),'Context':_0xbebf('0x45'),'Priority':'1','variable':_0xb9cdf8,'timeout':(_0x39b07f[_0xbebf('0x46')]||0x1e)*0x3e8,'async':!![],'channelid':_0xa8cd01['uniqueid']};};exports[_0xbebf('0x47')]=function(_0xd3dd6d){return _0xd3dd6d['countbusyretry']+_0xd3dd6d[_0xbebf('0x48')]+_0xd3dd6d['countnoanswerretry'];};exports['cloneAction']=function(_0x2fccbd){var _0xd5d58a=_[_0xbebf('0x49')](_0x2fccbd);_0xd5d58a['state']=0xf;_0xd5d58a[_0xbebf('0x34')]=_0xbebf('0x4a');return _0xd5d58a;};exports[_0xbebf('0x4b')]=function(_0x4f7bd0,_0x461f88,_0x26eb7c){var _0x3347a9={};_0x3347a9[_0x461f88]=_0x4f7bd0[_0x461f88];_0x3347a9['active']=![];_0x3347a9[_0xbebf('0x4c')]=moment()[_0xbebf('0x4d')](_0x26eb7c,_0xbebf('0x4e'))[_0xbebf('0x10')]('YYYY-MM-DD\x20HH:mm:ss');_0x3347a9[_0xbebf('0x18')]=_0x4f7bd0[_0xbebf('0x18')];_0x3347a9[_0xbebf('0x4f')]=_0x4f7bd0[_0xbebf('0x4f')];_0x3347a9['VoiceQueueId']=_0x4f7bd0['VoiceQueueId']||undefined;return _0x3347a9;};exports[_0xbebf('0x50')]=function(_0x4db708,_0x4b6e61){if(!_[_0xbebf('0x12')](_0x4db708)){if(_0x4db708['pTalking']>0x0){_0x4db708[_0xbebf('0x51')]-=0x1;}else{logger[_0xbebf('0x7')](_0x4b6e61,_0xbebf('0x52'));}}else{logger[_0xbebf('0x7')](_0x4b6e61,_0xbebf('0x53'));}};exports[_0xbebf('0x54')]=function(_0x4fe9dd){if(_0x4fe9dd<=0x0){return!![];}return![];};exports[_0xbebf('0x55')]=function(_0x1dfb3e,_0x1eb085){_0x1dfb3e[_0xbebf('0x56')]=_0x1eb085;_0x1dfb3e[_0xbebf('0x14')]=_0x1dfb3e[_0xbebf('0x57')];_0x1dfb3e[_0xbebf('0x58')]=_0x1dfb3e[_0xbebf('0x44')];return _0x1dfb3e;};exports[_0xbebf('0x59')]=function(_0x301785){var _0x2ffedd={};_0x2ffedd[_0xbebf('0x57')]=_0x301785[_0xbebf('0x57')];_0x2ffedd[_0xbebf('0x58')]=_0x301785[_0xbebf('0x44')];_0x2ffedd['uniqueid']=_0x301785['uniqueid'];return _0x2ffedd;};exports[_0xbebf('0x5a')]=function(_0x219caa){var _0x3e5e7f=[];for(var _0x347e7c in _0x219caa){if(_0x219caa[_0xbebf('0x26')](_0x347e7c)){if(!_[_0xbebf('0x12')](_0x219caa[_0x347e7c])&&_0x219caa[_0x347e7c][_0xbebf('0x33')]===_0xbebf('0x5b')&&_0x219caa[_0x347e7c][_0xbebf('0x5c')]==='reachable'){_0x3e5e7f[_0xbebf('0x5d')](_0x219caa[_0x347e7c]['id']);}}}return _0x3e5e7f;};exports[_0xbebf('0x5e')]=function(_0x454d90){var _0x48177c=moment()[_0xbebf('0x4')](0x0);var _0x4200f3=moment(_0x454d90)[_0xbebf('0x4')](0x0);return _0x48177c['diff'](_0x4200f3,_0xbebf('0x5'));};exports[_0xbebf('0x5f')]=function(_0x541950){return{'active':![],'recallme':![],'UserId':null,'ContactId':_0x541950['ContactId'],'ListId':_0x541950['ListId'],'VoiceQueueId':_0x541950[_0xbebf('0x60')]||undefined,'CampaignId':_0x541950[_0xbebf('0x61')]||undefined};};exports['filterKey']=function(_0x56d1b5){if(_0x56d1b5==='uniqueid'||_0x56d1b5===_0xbebf('0x62')||_0x56d1b5===_0xbebf('0x57')||_0x56d1b5==='type'||_0x56d1b5===_0xbebf('0x63')||_0x56d1b5==='dialAnswer'||_0x56d1b5===_0xbebf('0x3b')||_0x56d1b5==='channelAgent'||_0x56d1b5==='calleridname'||_0x56d1b5===_0xbebf('0x64')||_0x56d1b5===_0xbebf('0x17')||_0x56d1b5===_0xbebf('0x4c')||_0x56d1b5===_0xbebf('0x65')||_0x56d1b5===_0xbebf('0x48')||_0x56d1b5===_0xbebf('0x66')||_0x56d1b5===_0xbebf('0x67')||_0x56d1b5===_0xbebf('0x68')||_0x56d1b5===_0xbebf('0x69')||_0x56d1b5===_0xbebf('0x6a')||_0x56d1b5==='recallme'||_0x56d1b5===_0xbebf('0x18')||_0x56d1b5===_0xbebf('0x4f')||_0x56d1b5==='UserId'||_0x56d1b5===_0xbebf('0x60')||_0x56d1b5===_0xbebf('0x6b')||_0x56d1b5===_0xbebf('0x6c')||_0x56d1b5==='xmd-queue'||_0x56d1b5===_0xbebf('0x6d')||_0x56d1b5===_0xbebf('0x6e')||_0x56d1b5===_0xbebf('0x6f')||_0x56d1b5===_0xbebf('0x70')||_0x56d1b5===_0xbebf('0x71')||_0x56d1b5===_0xbebf('0x72')||_0x56d1b5===_0xbebf('0x73')||_0x56d1b5==='xmd-contactid'||_0x56d1b5==='xmd-cdrtype'||_0x56d1b5===_0xbebf('0x74')||_0x56d1b5===_0xbebf('0x75')||_0x56d1b5===_0xbebf('0x76')||_0x56d1b5===_0xbebf('0x77')||_0x56d1b5==='rtpaudioqosbridged'||_0x56d1b5===_0xbebf('0x78')||_0x56d1b5===_0xbebf('0x79')||_0x56d1b5==='rtpaudioqosloss'||_0x56d1b5===_0xbebf('0x7a')||_0x56d1b5===_0xbebf('0x7b')||_0x56d1b5===_0xbebf('0x7c')||_0x56d1b5==='rtpaudioqos'||_0x56d1b5==='rtpaudioqosbridged'||_0x56d1b5===_0xbebf('0x78')||_0x56d1b5===_0xbebf('0x79')||_0x56d1b5===_0xbebf('0x7d')||_0x56d1b5===_0xbebf('0x7a')||_0x56d1b5===_0xbebf('0x7b')||_0x56d1b5===_0xbebf('0x7c')||_0x56d1b5===_0xbebf('0x7e')||_0x56d1b5==='bridgepvtcallid'||_0x56d1b5===_0xbebf('0x33')||_0x56d1b5===_0xbebf('0x34')){return![];}return!![];};exports[_0xbebf('0x7f')]=function(_0xfe6c31,_0x19b07f){var _0x25b26c,_0x30c785,_0x5b0a65;if(_0x19b07f<=0x0){_0x19b07f=0x1;}_0x25b26c=new RegExp(_0xbebf('0x80')+_0x19b07f+'}$');_0x30c785=Math['pow'](0xa,_0x19b07f-0x1);_0x5b0a65=Math[_0xbebf('0x81')](0xa,_0x19b07f)-0x1;return util['format']('%s',_['replace'](_0xfe6c31,_0x25b26c,_['random'](_0x30c785,_0x5b0a65)));};exports[_0xbebf('0x82')]=function(_0x43963e){var _0x257832=_0x43963e[_0xbebf('0x83')](/"(.*?)"/);return _0x257832?_0x257832[0x1]:_0x43963e;};exports[_0xbebf('0x84')]=function(_0x128118){var _0x52a1e3=_0x128118[_0xbebf('0x83')](/<(.*?)>/);return _0x52a1e3?_0x52a1e3[0x1]:_0x128118;};
\ No newline at end of file
diff --git a/server/services/ami/properties.js b/server/services/ami/properties.js
index c02583a..85c4571 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 _0x5f2f=['number','boolean','queueremove','reload','voicequeuechannel','voicechannel','voicequeuechannelhangup','queueadd','string'];(function(_0x5844ab,_0x1c0ce1){var _0x57449c=function(_0x5ecc0a){while(--_0x5ecc0a){_0x5844ab['push'](_0x5844ab['shift']());}};_0x57449c(++_0x1c0ce1);}(_0x5f2f,0x73));var _0xf5f2=function(_0x7999f0,_0x52f087){_0x7999f0=_0x7999f0-0x0;var _0x149382=_0x5f2f[_0x7999f0];return _0x149382;};'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
+var _0x5f2f=['number','boolean','queueremove','reload','voicequeuechannel','voicechannel','voicequeuechannelhangup','queueadd','string'];(function(_0x4bfcd2,_0x15ea90){var _0x40380d=function(_0xa1fc0c){while(--_0xa1fc0c){_0x4bfcd2['push'](_0x4bfcd2['shift']());}};_0x40380d(++_0x15ea90);}(_0x5f2f,0x73));var _0xf5f2=function(_0x1a82eb,_0x5d8426){_0x1a82eb=_0x1a82eb-0x0;var _0x5b894a=_0x5f2f[_0x1a82eb];return _0x5b894a;};'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 7cc9f18..3d2369d 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 _0x1e00=['../model/voiceExtension','../model/zendeskAccount','../model/salesforceAccount','../model/freshdeskAccount','../model/sugarcrmAccount','../model/zohoAccount','../model/deskAccount','../model/servicenowAccount','../model/freshsalesAccount','../model/faxAccount','trunks','voiceQueues','triggers','campaigns','outbound','voiceExtensions','channels','queueChannels','outboundChannels','timers','salesforceAccounts','sugarcrmAccounts','freshdeskAccounts','zohoAccounts','deskAccounts','vtigerAccounts','servicenowAccounts','dynamics365Accounts','freshsalesAccounts','mapKeys','hasOwnProperty','format','name','isNil','interface','SIP/%s','sumHoldTime','sumDuration','sumBillable','isEmpty','total','answered','unmanaged','outboundAnswerAgiCallsDay','outboundBusyCallsDay','outboundCongestionCallsDay','outboundNoSuchCallsDay','outboundDropCallsDayTimeout','outboundDropCallsDayCallersExit','outboundBlacklistCallsDay','outboundOriginateFailureCallsDay','outboundReCallsDay','outboundAnswerCallsDay','prototype','initAgents','agents','length','isUndefined','mergeFromDatabase','initTelephones','telephones','initTrunks','initVoiceQueues','initTriggers','templates','zendeskAccounts','initSalesforceAccounts','initFreshdeskAccounts','initZohoAccounts','initSugarcrmAccounts','initVtigerAccounts','initServicenowAccounts','initDynamics365Accounts','initFreshsalesAccounts','initVoiceQueueHopperHistory','merge','initVoiceQueueReports','groupBy','uniqueid','queue','queuecallerexit','queuecallerleaveAt','diff','queuecallerjoinAt','queuecallercompleteAt','queuecallerabandonAt','queuecallerexitAt','queuecallercomplete','seconds','initVoiceCallReports','ANSWERED','duration','billableseconds','initCampaigns','initVoiceExtensions','initCampaignHopperHistory','faxAccounts','exports','bluebird','util','lodash','moment','../model/agent','../model/telephone','../model/voiceQueue','../model/trigger','../model/template','../model/campaign'];(function(_0x3b523c,_0x162d45){var _0x1f4c9b=function(_0x2b32ef){while(--_0x2b32ef){_0x3b523c['push'](_0x3b523c['shift']());}};_0x1f4c9b(++_0x162d45);}(_0x1e00,0xce));var _0x01e0=function(_0x129e61,_0x43a5e9){_0x129e61=_0x129e61-0x0;var _0x3fdb1e=_0x1e00[_0x129e61];return _0x3fdb1e;};'use strict';var BPromise=require(_0x01e0('0x0'));var util=require(_0x01e0('0x1'));var _=require(_0x01e0('0x2'));var moment=require(_0x01e0('0x3'));var Agent=require(_0x01e0('0x4'));var Telephone=require(_0x01e0('0x5'));var Trunk=require('../model/trunk');var VoiceQueue=require(_0x01e0('0x6'));var Trigger=require(_0x01e0('0x7'));var Template=require(_0x01e0('0x8'));var Campaign=require(_0x01e0('0x9'));var VoiceExtension=require(_0x01e0('0xa'));var ZendeskAccount=require(_0x01e0('0xb'));var SalesforceAccount=require(_0x01e0('0xc'));var FreshdeskAccount=require(_0x01e0('0xd'));var SugarcrmAccount=require(_0x01e0('0xe'));var ZohoAccount=require(_0x01e0('0xf'));var DeskAccount=require(_0x01e0('0x10'));var VtigerAccount=require('../model/vtigerAccount');var ServicenowAccount=require(_0x01e0('0x11'));var Dynamics365Account=require('../model/dynamics365Account');var FreshsalesAccount=require(_0x01e0('0x12'));var FaxAccount=require(_0x01e0('0x13'));var Realtime=function(){this['agents']={};this['telephones']={};this[_0x01e0('0x14')]={};this[_0x01e0('0x15')]={};this[_0x01e0('0x16')]={};this[_0x01e0('0x17')]={};this['templates']={};this[_0x01e0('0x18')]={'total':0x0,'answered':0x0,'sumHoldTime':0x0,'sumDuration':0x0,'sumBillable':0x0};this[_0x01e0('0x19')]={};this[_0x01e0('0x1a')]={};this[_0x01e0('0x1b')]={};this[_0x01e0('0x1c')]={};this[_0x01e0('0x1d')]={};this['zendeskAccounts']={};this[_0x01e0('0x1e')]={};this[_0x01e0('0x1f')]={};this[_0x01e0('0x20')]={};this[_0x01e0('0x21')]={};this[_0x01e0('0x22')]={};this[_0x01e0('0x23')]={};this[_0x01e0('0x24')]={};this[_0x01e0('0x25')]={};this[_0x01e0('0x26')]={};this['faxAccounts']={};};function freeIsNotKey(_0x808d85,_0x2bd191,_0x47344b){var _0x58a238=_[_0x01e0('0x27')](_0x808d85,function(_0x21f959,_0x4a5d2a){return _0x21f959[_0x47344b];});for(var _0x3a768a in _0x2bd191){if(_0x2bd191[_0x01e0('0x28')](_0x3a768a)){if(!_0x58a238[_0x3a768a]){delete _0x2bd191[_0x3a768a];}}}}function freeIsNotKeySip(_0xcc199d,_0x33b2c7){var _0x2d0fb7=_[_0x01e0('0x27')](_0xcc199d,function(_0x19ee55,_0x6c056f){return util[_0x01e0('0x29')]('SIP/%s',_0x19ee55[_0x01e0('0x2a')]);});for(var _0x30b397 in _0x33b2c7){if(_0x33b2c7[_0x01e0('0x28')](_0x30b397)){if(!_0x2d0fb7[_0x30b397]){delete _0x33b2c7[_0x30b397];}}}}function freeIsNotKeyAgent(_0x4cab44,_0x52d4cb){var _0x22fe8b=_[_0x01e0('0x27')](_0x4cab44,function(_0x93cb73,_0x4379af){var _0x226b50=_[_0x01e0('0x2b')](_0x93cb73[_0x01e0('0x2c')])?util[_0x01e0('0x29')](_0x01e0('0x2d'),_0x93cb73[_0x01e0('0x2a')]):_0x93cb73['interface'];return _0x226b50;});for(var _0x17235b in _0x52d4cb){if(_0x52d4cb[_0x01e0('0x28')](_0x17235b)){if(!_0x22fe8b[_0x17235b]){delete _0x52d4cb[_0x17235b];}}}}function clearVoiceCallReports(_0x3fd2f8){_0x3fd2f8['total']=0x0;_0x3fd2f8['answered']=0x0;_0x3fd2f8[_0x01e0('0x2e')]=0x0;_0x3fd2f8[_0x01e0('0x2f')]=0x0;_0x3fd2f8[_0x01e0('0x30')]=0x0;}function clearCampaigns(_0x443b7c){if(!_[_0x01e0('0x31')](_0x443b7c)){for(var _0x3c1cdb in _0x443b7c){if(_0x443b7c[_0x01e0('0x28')](_0x3c1cdb)){_0x443b7c[_0x3c1cdb]['ivrTotalCallsDays']=0x0;_0x443b7c[_0x3c1cdb]['ivrAnswerCallsDay']=0x0;}}}}function clearVoiceQueues(_0x495c15){if(!_[_0x01e0('0x31')](_0x495c15)){for(var _0x4188d6 in _0x495c15){if(_0x495c15[_0x01e0('0x28')](_0x4188d6)){_0x495c15[_0x4188d6][_0x01e0('0x32')]=0x0;_0x495c15[_0x4188d6][_0x01e0('0x33')]=0x0;_0x495c15[_0x4188d6][_0x01e0('0x34')]=0x0;_0x495c15[_0x4188d6]['abandoned']=0x0;_0x495c15[_0x4188d6][_0x01e0('0x2e')]=0x0;_0x495c15[_0x4188d6][_0x01e0('0x2f')]=0x0;_0x495c15[_0x4188d6]['sumBillable']=0x0;_0x495c15[_0x4188d6][_0x01e0('0x35')]=0x0;_0x495c15[_0x4188d6]['outboundNoAnswerCallsDay']=0x0;_0x495c15[_0x4188d6][_0x01e0('0x36')]=0x0;_0x495c15[_0x4188d6][_0x01e0('0x37')]=0x0;_0x495c15[_0x4188d6][_0x01e0('0x38')]=0x0;_0x495c15[_0x4188d6]['outboundUnknownCallsDay']=0x0;_0x495c15[_0x4188d6][_0x01e0('0x39')]=0x0;_0x495c15[_0x4188d6][_0x01e0('0x3a')]=0x0;_0x495c15[_0x4188d6][_0x01e0('0x3b')]=0x0;_0x495c15[_0x4188d6][_0x01e0('0x3c')]=0x0;_0x495c15[_0x4188d6]['outboundRejectCallsDay']=0x0;_0x495c15[_0x4188d6][_0x01e0('0x3d')]=0x0;_0x495c15[_0x4188d6]['outboundAnswerAgiCallsDay']=0x0;_0x495c15[_0x4188d6][_0x01e0('0x3e')]=0x0;_0x495c15[_0x4188d6]['queueStatusComplete']=!![];}}}}Realtime[_0x01e0('0x3f')]['mergeFromDatabase']=function(_0x300fbd,_0x1c90d1){for(var _0x1b4655 in _0x1c90d1){if(_0x300fbd['hasOwnProperty'](_0x1b4655)){_0x300fbd[_0x1b4655]=_0x1c90d1[_0x1b4655];}}};Realtime[_0x01e0('0x3f')][_0x01e0('0x40')]=function(){var _0x390f12=this;return function(_0xc66aa2){if(_0xc66aa2){freeIsNotKeyAgent(_0xc66aa2,_0x390f12[_0x01e0('0x41')]);for(var _0x53b35c=0x0,_0xbea438={},_0x19800f={};_0x53b35c<_0xc66aa2[_0x01e0('0x42')];_0x53b35c+=0x1){_0xbea438=_0xc66aa2[_0x53b35c];var _0x265a5e=_[_0x01e0('0x2b')](_0xbea438[_0x01e0('0x2c')])?util[_0x01e0('0x29')](_0x01e0('0x2d'),_0xbea438[_0x01e0('0x2a')]):_0xbea438['interface'];if(_[_0x01e0('0x43')](_0x390f12[_0x01e0('0x41')][_0x265a5e])){_0x390f12[_0x01e0('0x41')][_0x265a5e]=new Agent(_0xbea438);}else{_0x390f12[_0x01e0('0x44')](_0x390f12[_0x01e0('0x41')][_0x265a5e],_0xbea438);}}}return _0x390f12[_0x01e0('0x41')];};};Realtime[_0x01e0('0x3f')][_0x01e0('0x45')]=function(){var _0x1cc96e=this;return function(_0x414b80){if(_0x414b80){freeIsNotKeySip(_0x414b80,_0x1cc96e[_0x01e0('0x46')]);for(var _0x35e208=0x0,_0x3c65d5={},_0x3dc34e={};_0x35e208<_0x414b80[_0x01e0('0x42')];_0x35e208+=0x1){_0x3c65d5=_0x414b80[_0x35e208];if(_[_0x01e0('0x43')](_0x1cc96e[_0x01e0('0x46')][util[_0x01e0('0x29')]('SIP/%s',_0x3c65d5['name'])])){_0x1cc96e[_0x01e0('0x46')][util[_0x01e0('0x29')](_0x01e0('0x2d'),_0x3c65d5[_0x01e0('0x2a')])]=new Telephone(_0x3c65d5);}else{_0x1cc96e[_0x01e0('0x44')](_0x1cc96e[_0x01e0('0x46')][util[_0x01e0('0x29')](_0x01e0('0x2d'),_0x3c65d5['name'])],_0x3c65d5);}}}return _0x1cc96e['telephones'];};};Realtime[_0x01e0('0x3f')][_0x01e0('0x47')]=function(){var _0x463f1a=this;return function(_0x479e1a){if(_0x479e1a){freeIsNotKeySip(_0x479e1a,_0x463f1a[_0x01e0('0x14')]);for(var _0x18b1fa=0x0,_0x4e9aea={},_0x2b8c21={};_0x18b1fa<_0x479e1a[_0x01e0('0x42')];_0x18b1fa+=0x1){_0x4e9aea=_0x479e1a[_0x18b1fa];if(_['isUndefined'](_0x463f1a[_0x01e0('0x14')][util[_0x01e0('0x29')](_0x01e0('0x2d'),_0x4e9aea[_0x01e0('0x2a')])])){_0x463f1a[_0x01e0('0x14')][util[_0x01e0('0x29')](_0x01e0('0x2d'),_0x4e9aea[_0x01e0('0x2a')])]=new Trunk(_0x4e9aea);}else{_0x463f1a[_0x01e0('0x44')](_0x463f1a['trunks'][util[_0x01e0('0x29')](_0x01e0('0x2d'),_0x4e9aea['name'])],_0x4e9aea);}}}return _0x463f1a[_0x01e0('0x14')];};};Realtime[_0x01e0('0x3f')][_0x01e0('0x48')]=function(){var _0x4f7bcb=this;return function(_0x2a1ee2){if(_0x2a1ee2){freeIsNotKey(_0x2a1ee2,_0x4f7bcb[_0x01e0('0x15')],_0x01e0('0x2a'));for(var _0xb87b86=0x0,_0x395807={},_0xfb0c54={};_0xb87b86<_0x2a1ee2['length'];_0xb87b86+=0x1){_0x395807=_0x2a1ee2[_0xb87b86];if(_['isUndefined'](_0x4f7bcb['voiceQueues'][_0x395807['name']])){_0x4f7bcb[_0x01e0('0x15')][_0x395807['name']]=new VoiceQueue(_0x395807);}else{_0x4f7bcb['mergeFromDatabase'](_0x4f7bcb[_0x01e0('0x15')][_0x395807[_0x01e0('0x2a')]],_0x395807);}}}return _0x4f7bcb['voiceQueues'];};};Realtime[_0x01e0('0x3f')][_0x01e0('0x49')]=function(){var _0x5030f3=this;return function(_0x533585){if(_0x533585){freeIsNotKey(_0x533585,_0x5030f3[_0x01e0('0x16')],'id');for(var _0x48713c=0x0,_0x425187={},_0xb729ce={};_0x48713c<_0x533585[_0x01e0('0x42')];_0x48713c+=0x1){_0x425187=_0x533585[_0x48713c];if(_[_0x01e0('0x43')](_0x5030f3[_0x01e0('0x16')][_0x425187['id']])){_0x5030f3[_0x01e0('0x16')][_0x425187['id']]=new Trigger(_0x425187);}else{_0x5030f3['mergeFromDatabase'](_0x5030f3['triggers'][_0x425187['id']],_0x425187);}}}return _0x5030f3['triggers'];};};Realtime[_0x01e0('0x3f')]['initTemplates']=function(){var _0x232cbd=this;return function(_0x311e0c){if(_0x311e0c){freeIsNotKey(_0x311e0c,_0x232cbd[_0x01e0('0x4a')],'id');for(var _0x26b693=0x0,_0x2ea804={},_0x2f7d2e={};_0x26b693<_0x311e0c['length'];_0x26b693+=0x1){_0x2ea804=_0x311e0c[_0x26b693];if(_['isUndefined'](_0x232cbd[_0x01e0('0x4a')][_0x2ea804['id']])){_0x232cbd['templates'][_0x2ea804['id']]=new Template(_0x2ea804);}else{_0x232cbd[_0x01e0('0x44')](_0x232cbd[_0x01e0('0x4a')][_0x2ea804['id']],_0x2ea804);}}}return _0x232cbd[_0x01e0('0x4a')];};};Realtime[_0x01e0('0x3f')]['initZendeskAccounts']=function(){var _0x2bcae1=this;return function(_0x34bd35){if(_0x34bd35){freeIsNotKey(_0x34bd35,_0x2bcae1[_0x01e0('0x4b')],'id');for(var _0x14766d=0x0,_0x1167a5={},_0x56f0d8={};_0x14766d<_0x34bd35[_0x01e0('0x42')];_0x14766d+=0x1){_0x1167a5=_0x34bd35[_0x14766d];if(_[_0x01e0('0x43')](_0x2bcae1[_0x01e0('0x4b')][_0x1167a5['id']])){_0x2bcae1[_0x01e0('0x4b')][_0x1167a5['id']]=new ZendeskAccount(_0x1167a5);}else{_0x2bcae1[_0x01e0('0x44')](_0x2bcae1['zendeskAccounts'][_0x1167a5['id']],_0x1167a5);}}}return _0x2bcae1['zendeskAccounts'];};};Realtime[_0x01e0('0x3f')][_0x01e0('0x4c')]=function(){var _0x427620=this;return function(_0x7eac72){if(_0x7eac72){freeIsNotKey(_0x7eac72,_0x427620[_0x01e0('0x1e')],'id');for(var _0x51cdd0=0x0,_0x10089a={},_0x3e6230={};_0x51cdd0<_0x7eac72[_0x01e0('0x42')];_0x51cdd0+=0x1){_0x10089a=_0x7eac72[_0x51cdd0];if(_[_0x01e0('0x43')](_0x427620['salesforceAccounts'][_0x10089a['id']])){_0x427620[_0x01e0('0x1e')][_0x10089a['id']]=new SalesforceAccount(_0x10089a);}else{_0x427620[_0x01e0('0x44')](_0x427620[_0x01e0('0x1e')][_0x10089a['id']],_0x10089a);}}}return _0x427620[_0x01e0('0x1e')];};};Realtime['prototype'][_0x01e0('0x4d')]=function(){var _0x97dc68=this;return function(_0x2c32d0){if(_0x2c32d0){freeIsNotKey(_0x2c32d0,_0x97dc68['freshdeskAccounts'],'id');for(var _0x1e07f9=0x0,_0xe249ab={},_0x1e975b={};_0x1e07f9<_0x2c32d0[_0x01e0('0x42')];_0x1e07f9+=0x1){_0xe249ab=_0x2c32d0[_0x1e07f9];if(_[_0x01e0('0x43')](_0x97dc68[_0x01e0('0x20')][_0xe249ab['id']])){_0x97dc68['freshdeskAccounts'][_0xe249ab['id']]=new FreshdeskAccount(_0xe249ab);}else{_0x97dc68['mergeFromDatabase'](_0x97dc68[_0x01e0('0x20')][_0xe249ab['id']],_0xe249ab);}}}return _0x97dc68[_0x01e0('0x20')];};};Realtime['prototype'][_0x01e0('0x4e')]=function(){var _0x2a6f32=this;return function(_0x3e98ef){if(_0x3e98ef){freeIsNotKey(_0x3e98ef,_0x2a6f32[_0x01e0('0x21')],'id');for(var _0x599c45=0x0,_0x1f95cd={},_0x2f419f={};_0x599c45<_0x3e98ef[_0x01e0('0x42')];_0x599c45+=0x1){_0x1f95cd=_0x3e98ef[_0x599c45];if(_[_0x01e0('0x43')](_0x2a6f32['zohoAccounts'][_0x1f95cd['id']])){_0x2a6f32[_0x01e0('0x21')][_0x1f95cd['id']]=new ZohoAccount(_0x1f95cd);}else{_0x2a6f32[_0x01e0('0x44')](_0x2a6f32['zohoAccounts'][_0x1f95cd['id']],_0x1f95cd);}}}return _0x2a6f32[_0x01e0('0x21')];};};Realtime[_0x01e0('0x3f')]['initDeskAccounts']=function(){var _0x172a5a=this;return function(_0x1ceba5){if(_0x1ceba5){freeIsNotKey(_0x1ceba5,_0x172a5a[_0x01e0('0x22')],'id');for(var _0x1c9a9f=0x0,_0x53cd36={},_0x1bf9c3={};_0x1c9a9f<_0x1ceba5[_0x01e0('0x42')];_0x1c9a9f+=0x1){_0x53cd36=_0x1ceba5[_0x1c9a9f];if(_[_0x01e0('0x43')](_0x172a5a[_0x01e0('0x22')][_0x53cd36['id']])){_0x172a5a['deskAccounts'][_0x53cd36['id']]=new DeskAccount(_0x53cd36);}else{_0x172a5a[_0x01e0('0x44')](_0x172a5a[_0x01e0('0x22')][_0x53cd36['id']],_0x53cd36);}}}return _0x172a5a[_0x01e0('0x22')];};};Realtime['prototype'][_0x01e0('0x4f')]=function(){var _0x5bd918=this;return function(_0x501fa7){if(_0x501fa7){freeIsNotKey(_0x501fa7,_0x5bd918[_0x01e0('0x1f')],'id');for(var _0x59f3da=0x0,_0x4cfb5f={},_0x55aca5={};_0x59f3da<_0x501fa7['length'];_0x59f3da+=0x1){_0x4cfb5f=_0x501fa7[_0x59f3da];if(_[_0x01e0('0x43')](_0x5bd918[_0x01e0('0x1f')][_0x4cfb5f['id']])){_0x5bd918['sugarcrmAccounts'][_0x4cfb5f['id']]=new SugarcrmAccount(_0x4cfb5f);}else{_0x5bd918[_0x01e0('0x44')](_0x5bd918[_0x01e0('0x1f')][_0x4cfb5f['id']],_0x4cfb5f);}}}return _0x5bd918['sugarcrmAccounts'];};};Realtime[_0x01e0('0x3f')][_0x01e0('0x50')]=function(){var _0x1bd255=this;return function(_0x56eb39){if(_0x56eb39){freeIsNotKey(_0x56eb39,_0x1bd255['vtigerAccounts'],'id');for(var _0xdc55ed=0x0,_0x4cc0e3={},_0x249205={};_0xdc55ed<_0x56eb39[_0x01e0('0x42')];_0xdc55ed+=0x1){_0x4cc0e3=_0x56eb39[_0xdc55ed];if(_[_0x01e0('0x43')](_0x1bd255[_0x01e0('0x23')][_0x4cc0e3['id']])){_0x1bd255[_0x01e0('0x23')][_0x4cc0e3['id']]=new VtigerAccount(_0x4cc0e3);}else{_0x1bd255[_0x01e0('0x44')](_0x1bd255[_0x01e0('0x23')][_0x4cc0e3['id']],_0x4cc0e3);}}}return _0x1bd255['vtigerAccounts'];};};Realtime[_0x01e0('0x3f')][_0x01e0('0x51')]=function(){var _0x2686ec=this;return function(_0x2c2d76){if(_0x2c2d76){freeIsNotKey(_0x2c2d76,_0x2686ec[_0x01e0('0x24')],'id');for(var _0x5e88a4=0x0,_0x197048={},_0xfa2d8a={};_0x5e88a4<_0x2c2d76[_0x01e0('0x42')];_0x5e88a4+=0x1){_0x197048=_0x2c2d76[_0x5e88a4];if(_[_0x01e0('0x43')](_0x2686ec[_0x01e0('0x24')][_0x197048['id']])){_0x2686ec['servicenowAccounts'][_0x197048['id']]=new ServicenowAccount(_0x197048);}else{_0x2686ec[_0x01e0('0x44')](_0x2686ec[_0x01e0('0x24')][_0x197048['id']],_0x197048);}}}return _0x2686ec[_0x01e0('0x24')];};};Realtime[_0x01e0('0x3f')][_0x01e0('0x52')]=function(){var _0x1a6278=this;return function(_0x4fc537){if(_0x4fc537){freeIsNotKey(_0x4fc537,_0x1a6278[_0x01e0('0x25')],'id');for(var _0x19eaf2=0x0,_0x3dc011={},_0x44ec13={};_0x19eaf2<_0x4fc537[_0x01e0('0x42')];_0x19eaf2+=0x1){_0x3dc011=_0x4fc537[_0x19eaf2];if(_[_0x01e0('0x43')](_0x1a6278[_0x01e0('0x25')][_0x3dc011['id']])){_0x1a6278[_0x01e0('0x25')][_0x3dc011['id']]=new Dynamics365Account(_0x3dc011);}else{_0x1a6278[_0x01e0('0x44')](_0x1a6278[_0x01e0('0x25')][_0x3dc011['id']],_0x3dc011);}}}return _0x1a6278[_0x01e0('0x25')];};};Realtime[_0x01e0('0x3f')][_0x01e0('0x53')]=function(){var _0x7d2f49=this;return function(_0x158256){if(_0x158256){freeIsNotKey(_0x158256,_0x7d2f49[_0x01e0('0x26')],'id');for(var _0x10ac84=0x0,_0x3f2ae3={},_0x2cd2b6={};_0x10ac84<_0x158256[_0x01e0('0x42')];_0x10ac84+=0x1){_0x3f2ae3=_0x158256[_0x10ac84];if(_[_0x01e0('0x43')](_0x7d2f49[_0x01e0('0x26')][_0x3f2ae3['id']])){_0x7d2f49[_0x01e0('0x26')][_0x3f2ae3['id']]=new FreshsalesAccount(_0x3f2ae3);}else{_0x7d2f49[_0x01e0('0x44')](_0x7d2f49[_0x01e0('0x26')][_0x3f2ae3['id']],_0x3f2ae3);}}}return _0x7d2f49['freshsalesAccounts'];};};Realtime['prototype'][_0x01e0('0x54')]=function(){var _0x4f8a00=this;return function(_0x3d013d){for(var _0x5b4555=0x0;_0x5b4555<_0x3d013d[_0x01e0('0x42')];_0x5b4555+=0x1){_[_0x01e0('0x55')](_0x4f8a00[_0x01e0('0x15')][_0x3d013d[_0x5b4555][_0x01e0('0x2a')]],_0x3d013d[_0x5b4555]);}return _0x4f8a00[_0x01e0('0x15')];};};Realtime['prototype'][_0x01e0('0x56')]=function(){var _0x16f646=this;return function(_0x34ed96){clearVoiceQueues(_0x16f646[_0x01e0('0x15')]);if(_0x34ed96){_0x34ed96=_[_0x01e0('0x57')](_0x34ed96,_0x01e0('0x58'));for(var _0x2c2450 in _0x34ed96){if(_0x34ed96[_0x01e0('0x28')](_0x2c2450)){var _0x1d67e0={};for(var _0x2009e3=0x0;_0x2009e3<_0x34ed96[_0x2c2450]['length'];_0x2009e3+=0x1){var _0x3e804f=_0x34ed96[_0x2c2450][_0x2009e3][_0x01e0('0x59')];if(_0x16f646[_0x01e0('0x15')][_0x3e804f]){if(_0x34ed96[_0x2c2450][_0x2009e3][_0x01e0('0x5a')]){_0x16f646[_0x01e0('0x15')][_0x3e804f][_0x01e0('0x34')]+=0x1;}if(_0x34ed96[_0x2c2450][_0x2009e3]['queuecallerabandon']){_0x16f646[_0x01e0('0x15')][_0x3e804f]['abandoned']+=0x1;}_0x16f646[_0x01e0('0x15')][_0x3e804f]['sumHoldTime']+=moment(_0x34ed96[_0x2c2450][_0x2009e3][_0x01e0('0x5b')])[_0x01e0('0x5c')](moment(_0x34ed96[_0x2c2450][_0x2009e3][_0x01e0('0x5d')]),'seconds')||0x0;if(_0x2009e3===_0x34ed96[_0x2c2450][_0x01e0('0x42')]-0x1){_0x16f646[_0x01e0('0x15')][_0x3e804f][_0x01e0('0x2f')]+=moment(_0x34ed96[_0x2c2450][_0x2009e3][_0x01e0('0x5e')]||_0x34ed96[_0x2c2450][_0x2009e3][_0x01e0('0x5f')]||_0x34ed96[_0x2c2450][_0x2009e3][_0x01e0('0x60')])['diff'](moment(_0x34ed96[_0x2c2450][_0x2009e3]['queuecallerjoinAt']),'seconds')||0x0;_0x16f646[_0x01e0('0x15')][_0x3e804f]['total']+=0x1;if(_0x34ed96[_0x2c2450][_0x2009e3][_0x01e0('0x61')]){_0x16f646[_0x01e0('0x15')][_0x3e804f]['answered']+=0x1;_0x16f646['voiceQueues'][_0x3e804f][_0x01e0('0x30')]+=moment(_0x34ed96[_0x2c2450][_0x2009e3][_0x01e0('0x5e')])['diff'](moment(_0x34ed96[_0x2c2450][_0x2009e3]['queuecallerleaveAt']),_0x01e0('0x62'))||0x0;}}else{_0x16f646[_0x01e0('0x15')][_0x3e804f][_0x01e0('0x2f')]+=_0x16f646[_0x01e0('0x15')][_0x3e804f][_0x01e0('0x2e')]||0x0;}}}}}}return _0x16f646[_0x01e0('0x15')];};};Realtime[_0x01e0('0x3f')][_0x01e0('0x63')]=function(){var _0x488588=this;return function(_0x43bdb3){clearVoiceCallReports(_0x488588['outbound']);if(_0x43bdb3){for(var _0x4ed4b0=0x0;_0x4ed4b0<_0x43bdb3['length'];_0x4ed4b0+=0x1){_0x488588['outbound']['total']+=0x1;_0x488588[_0x01e0('0x18')][_0x01e0('0x2f')]+=_0x43bdb3[_0x4ed4b0]['duration'];if(_0x43bdb3[_0x4ed4b0]['disposition']===_0x01e0('0x64')){_0x488588[_0x01e0('0x18')][_0x01e0('0x33')]+=0x1;_0x488588[_0x01e0('0x18')]['sumHoldTime']+=_0x43bdb3[_0x4ed4b0][_0x01e0('0x65')]-_0x43bdb3[_0x4ed4b0][_0x01e0('0x66')]||0x0;_0x488588[_0x01e0('0x18')][_0x01e0('0x30')]+=_0x43bdb3[_0x4ed4b0][_0x01e0('0x66')];}}}return _0x488588[_0x01e0('0x18')];};};Realtime[_0x01e0('0x3f')][_0x01e0('0x67')]=function(){var _0x34a1de=this;return function(_0x15bb66){if(_0x15bb66){freeIsNotKey(_0x15bb66,_0x34a1de[_0x01e0('0x17')],_0x01e0('0x2a'));for(var _0x2e7aed=0x0,_0x584e47={};_0x2e7aed<_0x15bb66[_0x01e0('0x42')];_0x2e7aed+=0x1){_0x584e47=_0x15bb66[_0x2e7aed];if(_['isUndefined'](_0x34a1de[_0x01e0('0x17')][_0x584e47[_0x01e0('0x2a')]])){_0x34a1de[_0x01e0('0x17')][_0x584e47[_0x01e0('0x2a')]]=new Campaign(_0x584e47);}else{_0x34a1de[_0x01e0('0x44')](_0x34a1de['campaigns'][_0x584e47[_0x01e0('0x2a')]],_0x584e47);}}}return _0x34a1de[_0x01e0('0x17')];};};Realtime[_0x01e0('0x3f')][_0x01e0('0x68')]=function(){var _0xe8d7ae=this;return function(_0x561b36){if(_0x561b36){freeIsNotKey(_0x561b36,_0xe8d7ae[_0x01e0('0x19')],'id');for(var _0x1ab2dd=0x0,_0x3eba31={};_0x1ab2dd<_0x561b36['length'];_0x1ab2dd+=0x1){_0x3eba31=_0x561b36[_0x1ab2dd];if(_[_0x01e0('0x43')](_0xe8d7ae[_0x01e0('0x19')][_0x3eba31['id']])){_0xe8d7ae[_0x01e0('0x19')][_0x3eba31['id']]=new VoiceExtension(_0x3eba31);}else{_0xe8d7ae[_0x01e0('0x44')](_0xe8d7ae['voiceExtensions'][_0x3eba31['id']],_0x3eba31);}}}return _0xe8d7ae[_0x01e0('0x19')];};};Realtime['prototype'][_0x01e0('0x69')]=function(){var _0x2fa3de=this;return function(_0x297bb5){clearCampaigns(_0x2fa3de[_0x01e0('0x17')]);for(var _0x25ad94=0x0;_0x25ad94<_0x297bb5[_0x01e0('0x42')];_0x25ad94+=0x1){_[_0x01e0('0x55')](_0x2fa3de[_0x01e0('0x17')][_0x297bb5[_0x25ad94][_0x01e0('0x2a')]],_0x297bb5[_0x25ad94]);}return _0x2fa3de[_0x01e0('0x17')];};};Realtime[_0x01e0('0x3f')]['initFaxAccounts']=function(){var _0x51b910=this;return function(_0x522719){if(_0x522719){freeIsNotKey(_0x522719,_0x51b910[_0x01e0('0x6a')],'id');for(var _0x449cae=0x0,_0x1728db={},_0x443cbf={};_0x449cae<_0x522719[_0x01e0('0x42')];_0x449cae+=0x1){_0x1728db=_0x522719[_0x449cae];if(_['isUndefined'](_0x51b910[_0x01e0('0x6a')][_0x1728db['id']])){_0x51b910[_0x01e0('0x6a')][_0x1728db['id']]=new FaxAccount(_0x1728db);}else{_0x51b910[_0x01e0('0x44')](_0x51b910[_0x01e0('0x6a')][_0x1728db['id']],_0x1728db);}}}return _0x51b910[_0x01e0('0x6a')];};};module[_0x01e0('0x6b')]=Realtime;
\ No newline at end of file
+var _0xba5d=['agents','telephones','trunks','voiceQueues','triggers','campaigns','templates','channels','queueChannels','outboundChannels','timers','zendeskAccounts','salesforceAccounts','sugarcrmAccounts','zohoAccounts','servicenowAccounts','dynamics365Accounts','freshsalesAccounts','faxAccounts','hasOwnProperty','mapKeys','format','SIP/%s','isNil','interface','name','answered','sumHoldTime','sumDuration','sumBillable','isEmpty','ivrAnswerCallsDay','unmanaged','abandoned','outboundAnswerAgiCallsDay','outboundBusyCallsDay','outboundCongestionCallsDay','outboundDropCallsDayCallersExit','outboundBlacklistCallsDay','outboundOriginateFailureCallsDay','outboundRejectCallsDay','outboundReCallsDay','queueStatusComplete','prototype','mergeFromDatabase','initAgents','length','isUndefined','initTelephones','initVoiceQueues','initTemplates','initZendeskAccounts','initFreshdeskAccounts','freshdeskAccounts','initZohoAccounts','initDeskAccounts','deskAccounts','vtigerAccounts','initServicenowAccounts','initDynamics365Accounts','initVoiceQueueReports','groupBy','uniqueid','queue','queuecallerexit','queuecallerabandon','queuecallerleaveAt','diff','queuecallerjoinAt','seconds','queuecallercompleteAt','queuecallerexitAt','total','queuecallercomplete','initVoiceCallReports','outbound','duration','disposition','ANSWERED','billableseconds','initCampaigns','initVoiceExtensions','voiceExtensions','merge','initFaxAccounts','exports','lodash','moment','../model/agent','../model/telephone','../model/trunk','../model/voiceQueue','../model/campaign','../model/voiceExtension','../model/salesforceAccount','../model/freshdeskAccount','../model/zohoAccount','../model/deskAccount','../model/vtigerAccount','../model/servicenowAccount','../model/dynamics365Account','../model/freshsalesAccount','../model/faxAccount'];(function(_0x1d830c,_0x13565f){var _0x4b638c=function(_0x4dce6){while(--_0x4dce6){_0x1d830c['push'](_0x1d830c['shift']());}};_0x4b638c(++_0x13565f);}(_0xba5d,0x18b));var _0xdba5=function(_0x3a9dd9,_0x93ae44){_0x3a9dd9=_0x3a9dd9-0x0;var _0x3ff267=_0xba5d[_0x3a9dd9];return _0x3ff267;};'use strict';var BPromise=require('bluebird');var util=require('util');var _=require(_0xdba5('0x0'));var moment=require(_0xdba5('0x1'));var Agent=require(_0xdba5('0x2'));var Telephone=require(_0xdba5('0x3'));var Trunk=require(_0xdba5('0x4'));var VoiceQueue=require(_0xdba5('0x5'));var Trigger=require('../model/trigger');var Template=require('../model/template');var Campaign=require(_0xdba5('0x6'));var VoiceExtension=require(_0xdba5('0x7'));var ZendeskAccount=require('../model/zendeskAccount');var SalesforceAccount=require(_0xdba5('0x8'));var FreshdeskAccount=require(_0xdba5('0x9'));var SugarcrmAccount=require('../model/sugarcrmAccount');var ZohoAccount=require(_0xdba5('0xa'));var DeskAccount=require(_0xdba5('0xb'));var VtigerAccount=require(_0xdba5('0xc'));var ServicenowAccount=require(_0xdba5('0xd'));var Dynamics365Account=require(_0xdba5('0xe'));var FreshsalesAccount=require(_0xdba5('0xf'));var FaxAccount=require(_0xdba5('0x10'));var Realtime=function(){this[_0xdba5('0x11')]={};this[_0xdba5('0x12')]={};this[_0xdba5('0x13')]={};this[_0xdba5('0x14')]={};this[_0xdba5('0x15')]={};this[_0xdba5('0x16')]={};this[_0xdba5('0x17')]={};this['outbound']={'total':0x0,'answered':0x0,'sumHoldTime':0x0,'sumDuration':0x0,'sumBillable':0x0};this['voiceExtensions']={};this[_0xdba5('0x18')]={};this[_0xdba5('0x19')]={};this[_0xdba5('0x1a')]={};this[_0xdba5('0x1b')]={};this[_0xdba5('0x1c')]={};this[_0xdba5('0x1d')]={};this[_0xdba5('0x1e')]={};this['freshdeskAccounts']={};this[_0xdba5('0x1f')]={};this['deskAccounts']={};this['vtigerAccounts']={};this[_0xdba5('0x20')]={};this[_0xdba5('0x21')]={};this[_0xdba5('0x22')]={};this[_0xdba5('0x23')]={};};function freeIsNotKey(_0x5756ea,_0x2eeda6,_0x2697d0){var _0x17a64f=_['mapKeys'](_0x5756ea,function(_0x282d18,_0x5b6769){return _0x282d18[_0x2697d0];});for(var _0x4aee98 in _0x2eeda6){if(_0x2eeda6[_0xdba5('0x24')](_0x4aee98)){if(!_0x17a64f[_0x4aee98]){delete _0x2eeda6[_0x4aee98];}}}}function freeIsNotKeySip(_0xb8b5bd,_0x450112){var _0x39797e=_[_0xdba5('0x25')](_0xb8b5bd,function(_0x516eef,_0x38d9ed){return util[_0xdba5('0x26')](_0xdba5('0x27'),_0x516eef['name']);});for(var _0x4e0d36 in _0x450112){if(_0x450112[_0xdba5('0x24')](_0x4e0d36)){if(!_0x39797e[_0x4e0d36]){delete _0x450112[_0x4e0d36];}}}}function freeIsNotKeyAgent(_0x4ead6f,_0x57fcef){var _0x4f8bba=_[_0xdba5('0x25')](_0x4ead6f,function(_0x843616,_0x24d166){var _0x10a1e8=_[_0xdba5('0x28')](_0x843616[_0xdba5('0x29')])?util[_0xdba5('0x26')](_0xdba5('0x27'),_0x843616[_0xdba5('0x2a')]):_0x843616[_0xdba5('0x29')];return _0x10a1e8;});for(var _0x332fbc in _0x57fcef){if(_0x57fcef[_0xdba5('0x24')](_0x332fbc)){if(!_0x4f8bba[_0x332fbc]){delete _0x57fcef[_0x332fbc];}}}}function clearVoiceCallReports(_0x433148){_0x433148['total']=0x0;_0x433148[_0xdba5('0x2b')]=0x0;_0x433148[_0xdba5('0x2c')]=0x0;_0x433148[_0xdba5('0x2d')]=0x0;_0x433148[_0xdba5('0x2e')]=0x0;}function clearCampaigns(_0x897001){if(!_[_0xdba5('0x2f')](_0x897001)){for(var _0x26fa4b in _0x897001){if(_0x897001[_0xdba5('0x24')](_0x26fa4b)){_0x897001[_0x26fa4b]['ivrTotalCallsDays']=0x0;_0x897001[_0x26fa4b][_0xdba5('0x30')]=0x0;}}}}function clearVoiceQueues(_0x3b5c69){if(!_[_0xdba5('0x2f')](_0x3b5c69)){for(var _0x4c7d92 in _0x3b5c69){if(_0x3b5c69[_0xdba5('0x24')](_0x4c7d92)){_0x3b5c69[_0x4c7d92]['total']=0x0;_0x3b5c69[_0x4c7d92][_0xdba5('0x2b')]=0x0;_0x3b5c69[_0x4c7d92][_0xdba5('0x31')]=0x0;_0x3b5c69[_0x4c7d92][_0xdba5('0x32')]=0x0;_0x3b5c69[_0x4c7d92][_0xdba5('0x2c')]=0x0;_0x3b5c69[_0x4c7d92][_0xdba5('0x2d')]=0x0;_0x3b5c69[_0x4c7d92][_0xdba5('0x2e')]=0x0;_0x3b5c69[_0x4c7d92][_0xdba5('0x33')]=0x0;_0x3b5c69[_0x4c7d92]['outboundNoAnswerCallsDay']=0x0;_0x3b5c69[_0x4c7d92][_0xdba5('0x34')]=0x0;_0x3b5c69[_0x4c7d92][_0xdba5('0x35')]=0x0;_0x3b5c69[_0x4c7d92]['outboundNoSuchCallsDay']=0x0;_0x3b5c69[_0x4c7d92]['outboundUnknownCallsDay']=0x0;_0x3b5c69[_0x4c7d92]['outboundDropCallsDayTimeout']=0x0;_0x3b5c69[_0x4c7d92][_0xdba5('0x36')]=0x0;_0x3b5c69[_0x4c7d92][_0xdba5('0x37')]=0x0;_0x3b5c69[_0x4c7d92][_0xdba5('0x38')]=0x0;_0x3b5c69[_0x4c7d92][_0xdba5('0x39')]=0x0;_0x3b5c69[_0x4c7d92][_0xdba5('0x3a')]=0x0;_0x3b5c69[_0x4c7d92][_0xdba5('0x33')]=0x0;_0x3b5c69[_0x4c7d92]['outboundAnswerCallsDay']=0x0;_0x3b5c69[_0x4c7d92][_0xdba5('0x3b')]=!![];}}}}Realtime[_0xdba5('0x3c')][_0xdba5('0x3d')]=function(_0x4e4ad5,_0x22f11e){for(var _0xdf3df9 in _0x22f11e){if(_0x4e4ad5['hasOwnProperty'](_0xdf3df9)){_0x4e4ad5[_0xdf3df9]=_0x22f11e[_0xdf3df9];}}};Realtime['prototype'][_0xdba5('0x3e')]=function(){var _0x199f4e=this;return function(_0xdc60e0){if(_0xdc60e0){freeIsNotKeyAgent(_0xdc60e0,_0x199f4e[_0xdba5('0x11')]);for(var _0x10e065=0x0,_0x18687c={},_0x118b88={};_0x10e065<_0xdc60e0[_0xdba5('0x3f')];_0x10e065+=0x1){_0x18687c=_0xdc60e0[_0x10e065];var _0xe08943=_['isNil'](_0x18687c['interface'])?util[_0xdba5('0x26')](_0xdba5('0x27'),_0x18687c[_0xdba5('0x2a')]):_0x18687c[_0xdba5('0x29')];if(_[_0xdba5('0x40')](_0x199f4e[_0xdba5('0x11')][_0xe08943])){_0x199f4e[_0xdba5('0x11')][_0xe08943]=new Agent(_0x18687c);}else{_0x199f4e[_0xdba5('0x3d')](_0x199f4e[_0xdba5('0x11')][_0xe08943],_0x18687c);}}}return _0x199f4e[_0xdba5('0x11')];};};Realtime['prototype'][_0xdba5('0x41')]=function(){var _0x30fed2=this;return function(_0x5e7484){if(_0x5e7484){freeIsNotKeySip(_0x5e7484,_0x30fed2[_0xdba5('0x12')]);for(var _0x1d4274=0x0,_0x4edb4c={},_0x1b5f2b={};_0x1d4274<_0x5e7484[_0xdba5('0x3f')];_0x1d4274+=0x1){_0x4edb4c=_0x5e7484[_0x1d4274];if(_['isUndefined'](_0x30fed2['telephones'][util['format'](_0xdba5('0x27'),_0x4edb4c[_0xdba5('0x2a')])])){_0x30fed2[_0xdba5('0x12')][util[_0xdba5('0x26')]('SIP/%s',_0x4edb4c[_0xdba5('0x2a')])]=new Telephone(_0x4edb4c);}else{_0x30fed2[_0xdba5('0x3d')](_0x30fed2['telephones'][util[_0xdba5('0x26')](_0xdba5('0x27'),_0x4edb4c['name'])],_0x4edb4c);}}}return _0x30fed2['telephones'];};};Realtime['prototype']['initTrunks']=function(){var _0x3b33dd=this;return function(_0x4b176d){if(_0x4b176d){freeIsNotKeySip(_0x4b176d,_0x3b33dd[_0xdba5('0x13')]);for(var _0x2999dd=0x0,_0x3e0758={},_0x444f50={};_0x2999dd<_0x4b176d[_0xdba5('0x3f')];_0x2999dd+=0x1){_0x3e0758=_0x4b176d[_0x2999dd];if(_[_0xdba5('0x40')](_0x3b33dd[_0xdba5('0x13')][util[_0xdba5('0x26')](_0xdba5('0x27'),_0x3e0758['name'])])){_0x3b33dd[_0xdba5('0x13')][util[_0xdba5('0x26')](_0xdba5('0x27'),_0x3e0758[_0xdba5('0x2a')])]=new Trunk(_0x3e0758);}else{_0x3b33dd[_0xdba5('0x3d')](_0x3b33dd[_0xdba5('0x13')][util['format'](_0xdba5('0x27'),_0x3e0758[_0xdba5('0x2a')])],_0x3e0758);}}}return _0x3b33dd['trunks'];};};Realtime[_0xdba5('0x3c')][_0xdba5('0x42')]=function(){var _0x3f3f62=this;return function(_0x15799e){if(_0x15799e){freeIsNotKey(_0x15799e,_0x3f3f62['voiceQueues'],_0xdba5('0x2a'));for(var _0x8d13c6=0x0,_0x34a2e5={},_0xb336c2={};_0x8d13c6<_0x15799e[_0xdba5('0x3f')];_0x8d13c6+=0x1){_0x34a2e5=_0x15799e[_0x8d13c6];if(_[_0xdba5('0x40')](_0x3f3f62[_0xdba5('0x14')][_0x34a2e5[_0xdba5('0x2a')]])){_0x3f3f62[_0xdba5('0x14')][_0x34a2e5[_0xdba5('0x2a')]]=new VoiceQueue(_0x34a2e5);}else{_0x3f3f62[_0xdba5('0x3d')](_0x3f3f62['voiceQueues'][_0x34a2e5[_0xdba5('0x2a')]],_0x34a2e5);}}}return _0x3f3f62['voiceQueues'];};};Realtime[_0xdba5('0x3c')]['initTriggers']=function(){var _0x267ecb=this;return function(_0x330677){if(_0x330677){freeIsNotKey(_0x330677,_0x267ecb[_0xdba5('0x15')],'id');for(var _0x495f5f=0x0,_0x143162={},_0x12d2d5={};_0x495f5f<_0x330677[_0xdba5('0x3f')];_0x495f5f+=0x1){_0x143162=_0x330677[_0x495f5f];if(_['isUndefined'](_0x267ecb['triggers'][_0x143162['id']])){_0x267ecb[_0xdba5('0x15')][_0x143162['id']]=new Trigger(_0x143162);}else{_0x267ecb[_0xdba5('0x3d')](_0x267ecb[_0xdba5('0x15')][_0x143162['id']],_0x143162);}}}return _0x267ecb[_0xdba5('0x15')];};};Realtime[_0xdba5('0x3c')][_0xdba5('0x43')]=function(){var _0x5ab6ac=this;return function(_0x1f9c99){if(_0x1f9c99){freeIsNotKey(_0x1f9c99,_0x5ab6ac[_0xdba5('0x17')],'id');for(var _0x4174bd=0x0,_0x255c40={},_0x24ac66={};_0x4174bd<_0x1f9c99[_0xdba5('0x3f')];_0x4174bd+=0x1){_0x255c40=_0x1f9c99[_0x4174bd];if(_[_0xdba5('0x40')](_0x5ab6ac[_0xdba5('0x17')][_0x255c40['id']])){_0x5ab6ac[_0xdba5('0x17')][_0x255c40['id']]=new Template(_0x255c40);}else{_0x5ab6ac[_0xdba5('0x3d')](_0x5ab6ac['templates'][_0x255c40['id']],_0x255c40);}}}return _0x5ab6ac[_0xdba5('0x17')];};};Realtime[_0xdba5('0x3c')][_0xdba5('0x44')]=function(){var _0xbf6350=this;return function(_0x4228f9){if(_0x4228f9){freeIsNotKey(_0x4228f9,_0xbf6350[_0xdba5('0x1c')],'id');for(var _0x34c263=0x0,_0x4be315={},_0x26c406={};_0x34c263<_0x4228f9[_0xdba5('0x3f')];_0x34c263+=0x1){_0x4be315=_0x4228f9[_0x34c263];if(_[_0xdba5('0x40')](_0xbf6350['zendeskAccounts'][_0x4be315['id']])){_0xbf6350[_0xdba5('0x1c')][_0x4be315['id']]=new ZendeskAccount(_0x4be315);}else{_0xbf6350[_0xdba5('0x3d')](_0xbf6350[_0xdba5('0x1c')][_0x4be315['id']],_0x4be315);}}}return _0xbf6350[_0xdba5('0x1c')];};};Realtime[_0xdba5('0x3c')]['initSalesforceAccounts']=function(){var _0x8d6e1d=this;return function(_0x4a1f4b){if(_0x4a1f4b){freeIsNotKey(_0x4a1f4b,_0x8d6e1d[_0xdba5('0x1d')],'id');for(var _0xe531e0=0x0,_0x3b10c3={},_0x4eb150={};_0xe531e0<_0x4a1f4b[_0xdba5('0x3f')];_0xe531e0+=0x1){_0x3b10c3=_0x4a1f4b[_0xe531e0];if(_[_0xdba5('0x40')](_0x8d6e1d[_0xdba5('0x1d')][_0x3b10c3['id']])){_0x8d6e1d[_0xdba5('0x1d')][_0x3b10c3['id']]=new SalesforceAccount(_0x3b10c3);}else{_0x8d6e1d[_0xdba5('0x3d')](_0x8d6e1d[_0xdba5('0x1d')][_0x3b10c3['id']],_0x3b10c3);}}}return _0x8d6e1d['salesforceAccounts'];};};Realtime['prototype'][_0xdba5('0x45')]=function(){var _0x5d30b7=this;return function(_0x2468b1){if(_0x2468b1){freeIsNotKey(_0x2468b1,_0x5d30b7['freshdeskAccounts'],'id');for(var _0x202efe=0x0,_0x2d982f={},_0x984dcb={};_0x202efe<_0x2468b1['length'];_0x202efe+=0x1){_0x2d982f=_0x2468b1[_0x202efe];if(_[_0xdba5('0x40')](_0x5d30b7[_0xdba5('0x46')][_0x2d982f['id']])){_0x5d30b7['freshdeskAccounts'][_0x2d982f['id']]=new FreshdeskAccount(_0x2d982f);}else{_0x5d30b7[_0xdba5('0x3d')](_0x5d30b7[_0xdba5('0x46')][_0x2d982f['id']],_0x2d982f);}}}return _0x5d30b7[_0xdba5('0x46')];};};Realtime[_0xdba5('0x3c')][_0xdba5('0x47')]=function(){var _0x50ff90=this;return function(_0x4fa5ee){if(_0x4fa5ee){freeIsNotKey(_0x4fa5ee,_0x50ff90[_0xdba5('0x1f')],'id');for(var _0x2ed736=0x0,_0x25b290={},_0x2ca38a={};_0x2ed736<_0x4fa5ee['length'];_0x2ed736+=0x1){_0x25b290=_0x4fa5ee[_0x2ed736];if(_['isUndefined'](_0x50ff90['zohoAccounts'][_0x25b290['id']])){_0x50ff90[_0xdba5('0x1f')][_0x25b290['id']]=new ZohoAccount(_0x25b290);}else{_0x50ff90[_0xdba5('0x3d')](_0x50ff90[_0xdba5('0x1f')][_0x25b290['id']],_0x25b290);}}}return _0x50ff90['zohoAccounts'];};};Realtime[_0xdba5('0x3c')][_0xdba5('0x48')]=function(){var _0x1bccd6=this;return function(_0x1a8816){if(_0x1a8816){freeIsNotKey(_0x1a8816,_0x1bccd6['deskAccounts'],'id');for(var _0xd3828a=0x0,_0x38c74c={},_0x2b8c45={};_0xd3828a<_0x1a8816[_0xdba5('0x3f')];_0xd3828a+=0x1){_0x38c74c=_0x1a8816[_0xd3828a];if(_[_0xdba5('0x40')](_0x1bccd6[_0xdba5('0x49')][_0x38c74c['id']])){_0x1bccd6[_0xdba5('0x49')][_0x38c74c['id']]=new DeskAccount(_0x38c74c);}else{_0x1bccd6['mergeFromDatabase'](_0x1bccd6[_0xdba5('0x49')][_0x38c74c['id']],_0x38c74c);}}}return _0x1bccd6[_0xdba5('0x49')];};};Realtime[_0xdba5('0x3c')]['initSugarcrmAccounts']=function(){var _0x1bf434=this;return function(_0xb7a1d9){if(_0xb7a1d9){freeIsNotKey(_0xb7a1d9,_0x1bf434[_0xdba5('0x1e')],'id');for(var _0x4519a5=0x0,_0x2ab349={},_0x47373f={};_0x4519a5<_0xb7a1d9['length'];_0x4519a5+=0x1){_0x2ab349=_0xb7a1d9[_0x4519a5];if(_[_0xdba5('0x40')](_0x1bf434[_0xdba5('0x1e')][_0x2ab349['id']])){_0x1bf434['sugarcrmAccounts'][_0x2ab349['id']]=new SugarcrmAccount(_0x2ab349);}else{_0x1bf434['mergeFromDatabase'](_0x1bf434['sugarcrmAccounts'][_0x2ab349['id']],_0x2ab349);}}}return _0x1bf434[_0xdba5('0x1e')];};};Realtime[_0xdba5('0x3c')]['initVtigerAccounts']=function(){var _0x4774b5=this;return function(_0xeae6c4){if(_0xeae6c4){freeIsNotKey(_0xeae6c4,_0x4774b5[_0xdba5('0x4a')],'id');for(var _0x494a6d=0x0,_0x1e4847={},_0x1f7731={};_0x494a6d<_0xeae6c4[_0xdba5('0x3f')];_0x494a6d+=0x1){_0x1e4847=_0xeae6c4[_0x494a6d];if(_['isUndefined'](_0x4774b5[_0xdba5('0x4a')][_0x1e4847['id']])){_0x4774b5['vtigerAccounts'][_0x1e4847['id']]=new VtigerAccount(_0x1e4847);}else{_0x4774b5[_0xdba5('0x3d')](_0x4774b5[_0xdba5('0x4a')][_0x1e4847['id']],_0x1e4847);}}}return _0x4774b5[_0xdba5('0x4a')];};};Realtime[_0xdba5('0x3c')][_0xdba5('0x4b')]=function(){var _0x3c842a=this;return function(_0xa65348){if(_0xa65348){freeIsNotKey(_0xa65348,_0x3c842a['servicenowAccounts'],'id');for(var _0x31894d=0x0,_0x23089a={},_0x2ecaba={};_0x31894d<_0xa65348[_0xdba5('0x3f')];_0x31894d+=0x1){_0x23089a=_0xa65348[_0x31894d];if(_['isUndefined'](_0x3c842a['servicenowAccounts'][_0x23089a['id']])){_0x3c842a[_0xdba5('0x20')][_0x23089a['id']]=new ServicenowAccount(_0x23089a);}else{_0x3c842a[_0xdba5('0x3d')](_0x3c842a[_0xdba5('0x20')][_0x23089a['id']],_0x23089a);}}}return _0x3c842a[_0xdba5('0x20')];};};Realtime[_0xdba5('0x3c')][_0xdba5('0x4c')]=function(){var _0x554a07=this;return function(_0x1f00e6){if(_0x1f00e6){freeIsNotKey(_0x1f00e6,_0x554a07['dynamics365Accounts'],'id');for(var _0xaaab96=0x0,_0x581880={},_0x40bd0a={};_0xaaab96<_0x1f00e6[_0xdba5('0x3f')];_0xaaab96+=0x1){_0x581880=_0x1f00e6[_0xaaab96];if(_[_0xdba5('0x40')](_0x554a07[_0xdba5('0x21')][_0x581880['id']])){_0x554a07[_0xdba5('0x21')][_0x581880['id']]=new Dynamics365Account(_0x581880);}else{_0x554a07[_0xdba5('0x3d')](_0x554a07[_0xdba5('0x21')][_0x581880['id']],_0x581880);}}}return _0x554a07[_0xdba5('0x21')];};};Realtime[_0xdba5('0x3c')]['initFreshsalesAccounts']=function(){var _0x5c1f6d=this;return function(_0x4f3089){if(_0x4f3089){freeIsNotKey(_0x4f3089,_0x5c1f6d[_0xdba5('0x22')],'id');for(var _0x1345ef=0x0,_0x12e457={},_0x4ae1b8={};_0x1345ef<_0x4f3089['length'];_0x1345ef+=0x1){_0x12e457=_0x4f3089[_0x1345ef];if(_[_0xdba5('0x40')](_0x5c1f6d[_0xdba5('0x22')][_0x12e457['id']])){_0x5c1f6d[_0xdba5('0x22')][_0x12e457['id']]=new FreshsalesAccount(_0x12e457);}else{_0x5c1f6d['mergeFromDatabase'](_0x5c1f6d[_0xdba5('0x22')][_0x12e457['id']],_0x12e457);}}}return _0x5c1f6d[_0xdba5('0x22')];};};Realtime[_0xdba5('0x3c')]['initVoiceQueueHopperHistory']=function(){var _0x22edbd=this;return function(_0x2fcb1b){for(var _0x406a30=0x0;_0x406a30<_0x2fcb1b[_0xdba5('0x3f')];_0x406a30+=0x1){_['merge'](_0x22edbd[_0xdba5('0x14')][_0x2fcb1b[_0x406a30]['name']],_0x2fcb1b[_0x406a30]);}return _0x22edbd[_0xdba5('0x14')];};};Realtime[_0xdba5('0x3c')][_0xdba5('0x4d')]=function(){var _0x372ba4=this;return function(_0x455985){clearVoiceQueues(_0x372ba4[_0xdba5('0x14')]);if(_0x455985){_0x455985=_[_0xdba5('0x4e')](_0x455985,_0xdba5('0x4f'));for(var _0x468888 in _0x455985){if(_0x455985[_0xdba5('0x24')](_0x468888)){var _0x91369d={};for(var _0x21e167=0x0;_0x21e167<_0x455985[_0x468888][_0xdba5('0x3f')];_0x21e167+=0x1){var _0x3e2adc=_0x455985[_0x468888][_0x21e167][_0xdba5('0x50')];if(_0x372ba4[_0xdba5('0x14')][_0x3e2adc]){if(_0x455985[_0x468888][_0x21e167][_0xdba5('0x51')]){_0x372ba4[_0xdba5('0x14')][_0x3e2adc][_0xdba5('0x31')]+=0x1;}if(_0x455985[_0x468888][_0x21e167][_0xdba5('0x52')]){_0x372ba4['voiceQueues'][_0x3e2adc]['abandoned']+=0x1;}_0x372ba4['voiceQueues'][_0x3e2adc]['sumHoldTime']+=moment(_0x455985[_0x468888][_0x21e167][_0xdba5('0x53')])[_0xdba5('0x54')](moment(_0x455985[_0x468888][_0x21e167][_0xdba5('0x55')]),_0xdba5('0x56'))||0x0;if(_0x21e167===_0x455985[_0x468888][_0xdba5('0x3f')]-0x1){_0x372ba4[_0xdba5('0x14')][_0x3e2adc][_0xdba5('0x2d')]+=moment(_0x455985[_0x468888][_0x21e167][_0xdba5('0x57')]||_0x455985[_0x468888][_0x21e167]['queuecallerabandonAt']||_0x455985[_0x468888][_0x21e167][_0xdba5('0x58')])[_0xdba5('0x54')](moment(_0x455985[_0x468888][_0x21e167]['queuecallerjoinAt']),_0xdba5('0x56'))||0x0;_0x372ba4[_0xdba5('0x14')][_0x3e2adc][_0xdba5('0x59')]+=0x1;if(_0x455985[_0x468888][_0x21e167][_0xdba5('0x5a')]){_0x372ba4['voiceQueues'][_0x3e2adc][_0xdba5('0x2b')]+=0x1;_0x372ba4[_0xdba5('0x14')][_0x3e2adc][_0xdba5('0x2e')]+=moment(_0x455985[_0x468888][_0x21e167][_0xdba5('0x57')])[_0xdba5('0x54')](moment(_0x455985[_0x468888][_0x21e167][_0xdba5('0x53')]),_0xdba5('0x56'))||0x0;}}else{_0x372ba4[_0xdba5('0x14')][_0x3e2adc][_0xdba5('0x2d')]+=_0x372ba4[_0xdba5('0x14')][_0x3e2adc][_0xdba5('0x2c')]||0x0;}}}}}}return _0x372ba4[_0xdba5('0x14')];};};Realtime[_0xdba5('0x3c')][_0xdba5('0x5b')]=function(){var _0x3158d9=this;return function(_0x4819d8){clearVoiceCallReports(_0x3158d9[_0xdba5('0x5c')]);if(_0x4819d8){for(var _0x4911b9=0x0;_0x4911b9<_0x4819d8[_0xdba5('0x3f')];_0x4911b9+=0x1){_0x3158d9[_0xdba5('0x5c')][_0xdba5('0x59')]+=0x1;_0x3158d9['outbound'][_0xdba5('0x2d')]+=_0x4819d8[_0x4911b9][_0xdba5('0x5d')];if(_0x4819d8[_0x4911b9][_0xdba5('0x5e')]===_0xdba5('0x5f')){_0x3158d9['outbound'][_0xdba5('0x2b')]+=0x1;_0x3158d9[_0xdba5('0x5c')][_0xdba5('0x2c')]+=_0x4819d8[_0x4911b9][_0xdba5('0x5d')]-_0x4819d8[_0x4911b9][_0xdba5('0x60')]||0x0;_0x3158d9['outbound'][_0xdba5('0x2e')]+=_0x4819d8[_0x4911b9][_0xdba5('0x60')];}}}return _0x3158d9[_0xdba5('0x5c')];};};Realtime['prototype'][_0xdba5('0x61')]=function(){var _0x3b00e9=this;return function(_0x383585){if(_0x383585){freeIsNotKey(_0x383585,_0x3b00e9[_0xdba5('0x16')],_0xdba5('0x2a'));for(var _0xf0ef0b=0x0,_0x4931e0={};_0xf0ef0b<_0x383585[_0xdba5('0x3f')];_0xf0ef0b+=0x1){_0x4931e0=_0x383585[_0xf0ef0b];if(_[_0xdba5('0x40')](_0x3b00e9[_0xdba5('0x16')][_0x4931e0[_0xdba5('0x2a')]])){_0x3b00e9[_0xdba5('0x16')][_0x4931e0[_0xdba5('0x2a')]]=new Campaign(_0x4931e0);}else{_0x3b00e9[_0xdba5('0x3d')](_0x3b00e9[_0xdba5('0x16')][_0x4931e0[_0xdba5('0x2a')]],_0x4931e0);}}}return _0x3b00e9['campaigns'];};};Realtime[_0xdba5('0x3c')][_0xdba5('0x62')]=function(){var _0x270ec4=this;return function(_0x5cd93a){if(_0x5cd93a){freeIsNotKey(_0x5cd93a,_0x270ec4['voiceExtensions'],'id');for(var _0x5c5b0c=0x0,_0x2f1c9d={};_0x5c5b0c<_0x5cd93a[_0xdba5('0x3f')];_0x5c5b0c+=0x1){_0x2f1c9d=_0x5cd93a[_0x5c5b0c];if(_['isUndefined'](_0x270ec4['voiceExtensions'][_0x2f1c9d['id']])){_0x270ec4[_0xdba5('0x63')][_0x2f1c9d['id']]=new VoiceExtension(_0x2f1c9d);}else{_0x270ec4['mergeFromDatabase'](_0x270ec4[_0xdba5('0x63')][_0x2f1c9d['id']],_0x2f1c9d);}}}return _0x270ec4['voiceExtensions'];};};Realtime['prototype']['initCampaignHopperHistory']=function(){var _0x1fb5ef=this;return function(_0x1420db){clearCampaigns(_0x1fb5ef[_0xdba5('0x16')]);for(var _0x52da28=0x0;_0x52da28<_0x1420db['length'];_0x52da28+=0x1){_[_0xdba5('0x64')](_0x1fb5ef[_0xdba5('0x16')][_0x1420db[_0x52da28][_0xdba5('0x2a')]],_0x1420db[_0x52da28]);}return _0x1fb5ef['campaigns'];};};Realtime[_0xdba5('0x3c')][_0xdba5('0x65')]=function(){var _0x4973ff=this;return function(_0x52b672){if(_0x52b672){freeIsNotKey(_0x52b672,_0x4973ff[_0xdba5('0x23')],'id');for(var _0x270b6f=0x0,_0x409fb1={},_0x2ef40a={};_0x270b6f<_0x52b672[_0xdba5('0x3f')];_0x270b6f+=0x1){_0x409fb1=_0x52b672[_0x270b6f];if(_[_0xdba5('0x40')](_0x4973ff[_0xdba5('0x23')][_0x409fb1['id']])){_0x4973ff[_0xdba5('0x23')][_0x409fb1['id']]=new FaxAccount(_0x409fb1);}else{_0x4973ff[_0xdba5('0x3d')](_0x4973ff[_0xdba5('0x23')][_0x409fb1['id']],_0x409fb1);}}}return _0x4973ff['faxAccounts'];};};module[_0xdba5('0x66')]=Realtime;
\ No newline at end of file
diff --git a/server/services/ami/report/index.js b/server/services/ami/report/index.js
index 8f847b5..5abd7ca 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 _0xd5e0=['indexOf','mobile','substring','lastIndexOf','exports','bluebird','lodash','util','../../../config/logger','ami','../ami','../rpc/voiceAgentReport','../rpc/voiceCallReport','../rpc/voiceDialReport','../rpc/voiceQueueReport','./voiceQueueReport','./voiceCallReport','./voiceDialReport','realtime','agents','telephones','xdr','disabled','custom:voiceQueueReport','bind','voiceCallReport','custom:voiceAgentReport','voiceAgentReport','custom:voiceDialReport','blindtransfer','blindTransfer','attendedtransfer','attendedTransfer','prototype','findAgent','accountcode','name','find','format','SIP/%s','voiceQueueReport','connectedlinenum','lastAssignedTo','isNil','interface','queuecallercomplete','queuecallercompleteAt','YYYY-MM-DD\x20HH:mm:ss','queuecallerexit','queuecallerexitAt','create','match','destination','exten','type','dialer','queue','lastdata','context','from-voip-provider','callerid','from-sip','xcally-motion-preview','calleridpreview','calleridnum','originatecalleridnum','destinationchannel','ANSWERED','\x22%s\x22\x20<%s>','monitor','monitors','monitorFilename','filename','createdAt','membername','xcally-motion-dialer','isArray','voiceDialReport','channel','startsWith','Local'];(function(_0xeadab,_0x51a11e){var _0x10b6fb=function(_0x401a33){while(--_0x401a33){_0xeadab['push'](_0xeadab['shift']());}};_0x10b6fb(++_0x51a11e);}(_0xd5e0,0x19a));var _0x0d5e=function(_0x96813e,_0x35c66c){_0x96813e=_0x96813e-0x0;var _0x1459f4=_0xd5e0[_0x96813e];return _0x1459f4;};'use strict';var BPromise=require(_0x0d5e('0x0'));var _=require(_0x0d5e('0x1'));var moment=require('moment');var util=require(_0x0d5e('0x2'));var config=require('../../../config/environment');var logger=require(_0x0d5e('0x3'))(_0x0d5e('0x4'));var ami=require(_0x0d5e('0x5'));var RpcVoiceAgentReport=require(_0x0d5e('0x6'));var RpcVoiceCallReport=require(_0x0d5e('0x7'));var RpcVoiceDialReport=require(_0x0d5e('0x8'));var RpcMemberReport=require('../rpc/memberReport');var RpcVoiceQueueReport=require(_0x0d5e('0x9'));var RpcVoiceRecording=require('../rpc/voiceRecording');var RpcVoiceTransferReport=require('../rpc/voiceTransferReport');var VoiceQueueReport=require(_0x0d5e('0xa'));var VoiceCallReport=require(_0x0d5e('0xb'));var VoiceAgentReport=require('./voiceAgentReport');var VoiceDialReport=require(_0x0d5e('0xc'));var UserReport=require('./userReport');function Report(_0x1df312){this[_0x0d5e('0xd')]=_0x1df312;this[_0x0d5e('0xe')]=_0x1df312[_0x0d5e('0xe')];this[_0x0d5e('0xf')]=_0x1df312[_0x0d5e('0xf')];}Report['prototype']['sync']=function(_0x2a77f5){var _0x3afb56=new VoiceQueueReport(this[_0x0d5e('0xd')]);var _0x309043=new VoiceAgentReport(this[_0x0d5e('0xd')]);var _0x410474=new VoiceDialReport(this[_0x0d5e('0xd')]);var _0x271792=new VoiceCallReport(this[_0x0d5e('0xd')]);var _0x19fcc2=new UserReport(this[_0x0d5e('0xd')]);if(config['xdr']&&config[_0x0d5e('0x10')][_0x0d5e('0x11')]){ami['on'](_0x0d5e('0x12'),this['voiceQueueReport'][_0x0d5e('0x13')](this));ami['on']('custom:voiceCallReport',this[_0x0d5e('0x14')]['bind'](this));ami['on'](_0x0d5e('0x15'),this[_0x0d5e('0x16')][_0x0d5e('0x13')](this));ami['on'](_0x0d5e('0x17'),this['voiceDialReport'][_0x0d5e('0x13')](this));ami['on'](_0x0d5e('0x18'),this[_0x0d5e('0x19')][_0x0d5e('0x13')](this));ami['on'](_0x0d5e('0x1a'),this[_0x0d5e('0x1b')][_0x0d5e('0x13')](this));}};Report[_0x0d5e('0x1c')][_0x0d5e('0x1d')]=function(_0xb3ac08){var _0x17a6e8=undefined;_0x17a6e8=_['find'](this[_0x0d5e('0xe')],function(_0x122382){return _0x122382[_0x0d5e('0x1e')]==_0xb3ac08||_0x122382[_0x0d5e('0x1f')]==_0xb3ac08;});if(_['isNil'](_0x17a6e8)){var _0x5c2e8f=_[_0x0d5e('0x20')](this[_0x0d5e('0xf')],function(_0x38fa1d){return _0x38fa1d[_0x0d5e('0x1e')]==_0xb3ac08||_0x38fa1d[_0x0d5e('0x1f')]==_0xb3ac08;});if(_0x5c2e8f){_0x17a6e8=_[_0x0d5e('0x20')](this['agents'],function(_0x3388a0){return _0x3388a0['interface']==util[_0x0d5e('0x21')](_0x0d5e('0x22'),_0x5c2e8f[_0x0d5e('0x1f')]);});}}return _0x17a6e8;};Report[_0x0d5e('0x1c')][_0x0d5e('0x23')]=function(_0x29a608){for(var _0xad8cea=0x0;_0xad8cea<_0x29a608['length'];_0xad8cea+=0x1){var _0x2acf42=this[_0x0d5e('0x1d')](_0x29a608[_0xad8cea][_0x0d5e('0x24')]);if(_0x2acf42){_0x29a608[_0xad8cea][_0x0d5e('0x1e')]=_0x2acf42[_0x0d5e('0x1e')];_0x29a608[_0xad8cea]['assigned']=!![];_0x29a608[_0xad8cea][_0x0d5e('0x25')]=_0x2acf42[_0x0d5e('0x1f')];_0x29a608[_0xad8cea]['interface']=_[_0x0d5e('0x26')](_0x2acf42[_0x0d5e('0x27')])?util[_0x0d5e('0x21')](_0x0d5e('0x22'),_0x2acf42[_0x0d5e('0x1f')]):_0x2acf42[_0x0d5e('0x27')];if(_0x29a608[_0xad8cea][_0x0d5e('0x28')]){_0x29a608[_0xad8cea][_0x0d5e('0x29')]=moment()[_0x0d5e('0x21')](_0x0d5e('0x2a'));}if(_0x29a608[_0xad8cea][_0x0d5e('0x2b')]){_0x29a608[_0xad8cea][_0x0d5e('0x2c')]=moment()[_0x0d5e('0x21')](_0x0d5e('0x2a'));}RpcMemberReport['voiceQueueReport'](_0x29a608[_0xad8cea]);}RpcVoiceQueueReport[_0x0d5e('0x2d')](_0x29a608[_0xad8cea]);}};function extractCalleridNumber(_0x49f183){var _0x19ceb6=_0x49f183[_0x0d5e('0x2e')](/<(.*?)>/);return _0x19ceb6?_0x19ceb6[0x1]:_0x49f183;}Report[_0x0d5e('0x1c')]['voiceCallReport']=function(_0x175308){_0x175308['destination']=_0x175308[_0x0d5e('0x2f')]||_0x175308[_0x0d5e('0x30')];if(_0x175308[_0x0d5e('0x31')]==_0x0d5e('0x32')){_0x175308['lastapplication']=_0x0d5e('0x33');_0x175308[_0x0d5e('0x34')]=_0x175308[_0x0d5e('0x33')];if(_0x175308[_0x0d5e('0x35')]==_0x0d5e('0x36')){_0x175308[_0x0d5e('0x1e')]='';_0x175308[_0x0d5e('0x2f')]=extractCalleridNumber(_0x175308[_0x0d5e('0x37')]);}else if(_0x175308[_0x0d5e('0x35')]==_0x0d5e('0x38')){if(_0x175308[_0x0d5e('0x2f')]==_0x0d5e('0x39')){_0x175308['destination']=extractCalleridNumber(_0x175308[_0x0d5e('0x3a')]);_0x175308[_0x0d5e('0x3b')]=_0x175308[_0x0d5e('0x3c')];_0x175308[_0x0d5e('0x3d')]=[_0x175308['channel'],_0x175308['channel']=_0x175308[_0x0d5e('0x3d')]][0x0];_0x175308[_0x0d5e('0x37')]=_0x175308[_0x0d5e('0x3a')];}else{_0x175308['destination']=_0x175308['calleridnum'];_0x175308[_0x0d5e('0x3b')]=_0x175308[_0x0d5e('0x3c')];if(_0x175308['disposition']==_0x0d5e('0x3e')){_0x175308[_0x0d5e('0x1e')]=_0x175308['connectedlinenum'];}else{_0x175308[_0x0d5e('0x1e')]='';}}}}else{_0x175308['callerid']=util[_0x0d5e('0x21')](_0x0d5e('0x3f'),_0x175308['calleridname'],_0x175308['calleridnum']);}RpcVoiceCallReport[_0x0d5e('0x2d')](_0x175308);if(_0x175308[_0x0d5e('0x40')]){for(var _0x1b4780=0x0;_0x1b4780<_0x175308[_0x0d5e('0x41')]['length'];_0x1b4780+=0x1){_0x175308[_0x0d5e('0x42')]=_0x175308[_0x0d5e('0x41')][_0x1b4780][_0x0d5e('0x43')];_0x175308['createdAt']=_0x175308[_0x0d5e('0x41')][_0x1b4780][_0x0d5e('0x44')];if(_0x175308[_0x0d5e('0x30')]==_0x0d5e('0x39')){_0x175308[_0x0d5e('0x3b')]=_0x175308[_0x0d5e('0x24')];_0x175308['calleridname']=_0x175308['connectedlinename'];_0x175308['connectedlinenum']=_0x175308[_0x0d5e('0x1e')];_0x175308['connectedlinename']=_0x175308[_0x0d5e('0x45')];_0x175308[_0x0d5e('0x30')]=_0x175308[_0x0d5e('0x3c')];}else if(_0x175308[_0x0d5e('0x30')]==_0x0d5e('0x46')){_0x175308[_0x0d5e('0x3b')]=_0x175308[_0x0d5e('0x2f')];_0x175308[_0x0d5e('0x30')]=_0x175308['originatecalleridnum'];}RpcVoiceRecording[_0x0d5e('0x2d')](_0x175308);}}};Report['prototype'][_0x0d5e('0x16')]=function(_0x4512eb){if(_[_0x0d5e('0x47')](_0x4512eb)){_0x4512eb['forEach'](function(_0x2ff4ef){RpcVoiceAgentReport[_0x0d5e('0x2d')](_0x2ff4ef);});}else{RpcVoiceAgentReport[_0x0d5e('0x2d')](_0x4512eb);}};Report[_0x0d5e('0x1c')][_0x0d5e('0x48')]=function(_0x2228b4){RpcVoiceDialReport[_0x0d5e('0x2d')](_0x2228b4);var _0x3f7348=undefined;var _0x2aac61=_0x2228b4[_0x0d5e('0x49')];if(_[_0x0d5e('0x4a')](_0x2aac61,_0x0d5e('0x4b'))){var _0x40daba=_0x2aac61['substring'](_0x2aac61['indexOf']('/')+0x1,_0x2aac61[_0x0d5e('0x4c')]('@'));_0x3f7348=_['find'](this[_0x0d5e('0xe')],function(_0x369ae9){return _0x369ae9[_0x0d5e('0x4d')]==_0x40daba||_0x369ae9['phone']==_0x40daba||_0x369ae9[_0x0d5e('0x1e')]==_0x40daba;});}else{var _0x40daba=_0x2aac61[_0x0d5e('0x4e')](_0x2aac61[_0x0d5e('0x4c')]('/')+0x1,_0x2aac61[_0x0d5e('0x4f')]('-'));_0x3f7348=this[_0x0d5e('0x1d')](_0x40daba);}if(_0x3f7348){_0x2228b4[_0x0d5e('0x27')]=_[_0x0d5e('0x26')](_0x3f7348[_0x0d5e('0x27')])?util['format']('SIP/%s',_0x3f7348[_0x0d5e('0x1f')]):_0x3f7348[_0x0d5e('0x27')];_0x2228b4['membername']=_0x3f7348[_0x0d5e('0x1f')];_0x2228b4[_0x0d5e('0x1e')]=_0x3f7348[_0x0d5e('0x1e')];RpcMemberReport[_0x0d5e('0x48')](_0x2228b4);}};Report['prototype'][_0x0d5e('0x19')]=function(_0x57fc8b){RpcVoiceTransferReport['blindTransfer'](_0x57fc8b);};Report[_0x0d5e('0x1c')]['attendedTransfer']=function(_0x6e7166){RpcVoiceTransferReport['attendedTransfer'](_0x6e7166);};module[_0x0d5e('0x50')]=Report;
\ No newline at end of file
+var _0xe270=['util','../../../config/logger','ami','../ami','../rpc/voiceCallReport','../rpc/voiceDialReport','../rpc/voiceQueueReport','../rpc/voiceRecording','../rpc/voiceTransferReport','./voiceCallReport','./voiceAgentReport','./voiceDialReport','./userReport','agents','telephones','prototype','sync','realtime','xdr','disabled','custom:voiceQueueReport','voiceCallReport','bind','custom:voiceAgentReport','voiceAgentReport','voiceDialReport','blindtransfer','blindTransfer','attendedtransfer','attendedTransfer','findAgent','find','accountcode','name','isNil','interface','format','SIP/%s','voiceQueueReport','connectedlinenum','lastAssignedTo','queuecallercomplete','YYYY-MM-DD\x20HH:mm:ss','queuecallerexit','queuecallerexitAt','create','match','destination','exten','type','dialer','lastapplication','queue','lastdata','context','callerid','from-sip','xcally-motion-preview','calleridpreview','originatecalleridnum','channel','calleridnum','disposition','ANSWERED','calleridname','monitor','monitors','length','monitorFilename','filename','createdAt','connectedlinename','membername','xcally-motion-dialer','isArray','startsWith','substring','mobile','phone','indexOf','exports','lodash','moment'];(function(_0x2d7f0e,_0x3e6fbd){var _0x110b07=function(_0x557b00){while(--_0x557b00){_0x2d7f0e['push'](_0x2d7f0e['shift']());}};_0x110b07(++_0x3e6fbd);}(_0xe270,0xa4));var _0x0e27=function(_0x5b89c7,_0x22994c){_0x5b89c7=_0x5b89c7-0x0;var _0x332b50=_0xe270[_0x5b89c7];return _0x332b50;};'use strict';var BPromise=require('bluebird');var _=require(_0x0e27('0x0'));var moment=require(_0x0e27('0x1'));var util=require(_0x0e27('0x2'));var config=require('../../../config/environment');var logger=require(_0x0e27('0x3'))(_0x0e27('0x4'));var ami=require(_0x0e27('0x5'));var RpcVoiceAgentReport=require('../rpc/voiceAgentReport');var RpcVoiceCallReport=require(_0x0e27('0x6'));var RpcVoiceDialReport=require(_0x0e27('0x7'));var RpcMemberReport=require('../rpc/memberReport');var RpcVoiceQueueReport=require(_0x0e27('0x8'));var RpcVoiceRecording=require(_0x0e27('0x9'));var RpcVoiceTransferReport=require(_0x0e27('0xa'));var VoiceQueueReport=require('./voiceQueueReport');var VoiceCallReport=require(_0x0e27('0xb'));var VoiceAgentReport=require(_0x0e27('0xc'));var VoiceDialReport=require(_0x0e27('0xd'));var UserReport=require(_0x0e27('0xe'));function Report(_0x3e5047){this['realtime']=_0x3e5047;this[_0x0e27('0xf')]=_0x3e5047[_0x0e27('0xf')];this[_0x0e27('0x10')]=_0x3e5047[_0x0e27('0x10')];}Report[_0x0e27('0x11')][_0x0e27('0x12')]=function(_0xcb7ef5){var _0x1f8ba7=new VoiceQueueReport(this[_0x0e27('0x13')]);var _0x2f7cff=new VoiceAgentReport(this['realtime']);var _0x142bfd=new VoiceDialReport(this[_0x0e27('0x13')]);var _0x4e7206=new VoiceCallReport(this[_0x0e27('0x13')]);var _0x2f162d=new UserReport(this[_0x0e27('0x13')]);if(config[_0x0e27('0x14')]&&config[_0x0e27('0x14')][_0x0e27('0x15')]){ami['on'](_0x0e27('0x16'),this['voiceQueueReport']['bind'](this));ami['on']('custom:voiceCallReport',this[_0x0e27('0x17')][_0x0e27('0x18')](this));ami['on'](_0x0e27('0x19'),this[_0x0e27('0x1a')][_0x0e27('0x18')](this));ami['on']('custom:voiceDialReport',this[_0x0e27('0x1b')][_0x0e27('0x18')](this));ami['on'](_0x0e27('0x1c'),this[_0x0e27('0x1d')][_0x0e27('0x18')](this));ami['on'](_0x0e27('0x1e'),this[_0x0e27('0x1f')][_0x0e27('0x18')](this));}};Report['prototype'][_0x0e27('0x20')]=function(_0x30766c){var _0x45d05f=undefined;_0x45d05f=_[_0x0e27('0x21')](this[_0x0e27('0xf')],function(_0x1cf80c){return _0x1cf80c[_0x0e27('0x22')]==_0x30766c||_0x1cf80c[_0x0e27('0x23')]==_0x30766c;});if(_[_0x0e27('0x24')](_0x45d05f)){var _0x1d37f2=_[_0x0e27('0x21')](this['telephones'],function(_0x544b31){return _0x544b31[_0x0e27('0x22')]==_0x30766c||_0x544b31['name']==_0x30766c;});if(_0x1d37f2){_0x45d05f=_[_0x0e27('0x21')](this[_0x0e27('0xf')],function(_0x53f48a){return _0x53f48a[_0x0e27('0x25')]==util[_0x0e27('0x26')](_0x0e27('0x27'),_0x1d37f2[_0x0e27('0x23')]);});}}return _0x45d05f;};Report[_0x0e27('0x11')][_0x0e27('0x28')]=function(_0x507722){for(var _0x41bdf5=0x0;_0x41bdf5<_0x507722['length'];_0x41bdf5+=0x1){var _0x1ebd15=this[_0x0e27('0x20')](_0x507722[_0x41bdf5][_0x0e27('0x29')]);if(_0x1ebd15){_0x507722[_0x41bdf5]['accountcode']=_0x1ebd15['accountcode'];_0x507722[_0x41bdf5]['assigned']=!![];_0x507722[_0x41bdf5][_0x0e27('0x2a')]=_0x1ebd15[_0x0e27('0x23')];_0x507722[_0x41bdf5][_0x0e27('0x25')]=_[_0x0e27('0x24')](_0x1ebd15[_0x0e27('0x25')])?util[_0x0e27('0x26')](_0x0e27('0x27'),_0x1ebd15[_0x0e27('0x23')]):_0x1ebd15[_0x0e27('0x25')];if(_0x507722[_0x41bdf5][_0x0e27('0x2b')]){_0x507722[_0x41bdf5]['queuecallercompleteAt']=moment()[_0x0e27('0x26')](_0x0e27('0x2c'));}if(_0x507722[_0x41bdf5][_0x0e27('0x2d')]){_0x507722[_0x41bdf5][_0x0e27('0x2e')]=moment()[_0x0e27('0x26')](_0x0e27('0x2c'));}RpcMemberReport['voiceQueueReport'](_0x507722[_0x41bdf5]);}RpcVoiceQueueReport[_0x0e27('0x2f')](_0x507722[_0x41bdf5]);}};function extractCalleridNumber(_0x425687){var _0x3f5188=_0x425687[_0x0e27('0x30')](/<(.*?)>/);return _0x3f5188?_0x3f5188[0x1]:_0x425687;}Report[_0x0e27('0x11')][_0x0e27('0x17')]=function(_0x2712c4){_0x2712c4[_0x0e27('0x31')]=_0x2712c4['destination']||_0x2712c4[_0x0e27('0x32')];if(_0x2712c4[_0x0e27('0x33')]==_0x0e27('0x34')){_0x2712c4[_0x0e27('0x35')]=_0x0e27('0x36');_0x2712c4[_0x0e27('0x37')]=_0x2712c4[_0x0e27('0x36')];if(_0x2712c4[_0x0e27('0x38')]=='from-voip-provider'){_0x2712c4['accountcode']='';_0x2712c4[_0x0e27('0x31')]=extractCalleridNumber(_0x2712c4[_0x0e27('0x39')]);}else if(_0x2712c4[_0x0e27('0x38')]==_0x0e27('0x3a')){if(_0x2712c4[_0x0e27('0x31')]==_0x0e27('0x3b')){_0x2712c4[_0x0e27('0x31')]=extractCalleridNumber(_0x2712c4[_0x0e27('0x3c')]);_0x2712c4['calleridnum']=_0x2712c4[_0x0e27('0x3d')];_0x2712c4['destinationchannel']=[_0x2712c4[_0x0e27('0x3e')],_0x2712c4[_0x0e27('0x3e')]=_0x2712c4['destinationchannel']][0x0];_0x2712c4[_0x0e27('0x39')]=_0x2712c4[_0x0e27('0x3c')];}else{_0x2712c4[_0x0e27('0x31')]=_0x2712c4[_0x0e27('0x3f')];_0x2712c4[_0x0e27('0x3f')]=_0x2712c4[_0x0e27('0x3d')];if(_0x2712c4[_0x0e27('0x40')]==_0x0e27('0x41')){_0x2712c4[_0x0e27('0x22')]=_0x2712c4[_0x0e27('0x29')];}else{_0x2712c4['accountcode']='';}}}}else{_0x2712c4[_0x0e27('0x39')]=util[_0x0e27('0x26')]('\x22%s\x22\x20<%s>',_0x2712c4[_0x0e27('0x42')],_0x2712c4[_0x0e27('0x3f')]);}RpcVoiceCallReport[_0x0e27('0x2f')](_0x2712c4);if(_0x2712c4[_0x0e27('0x43')]){for(var _0x8dca69=0x0;_0x8dca69<_0x2712c4[_0x0e27('0x44')][_0x0e27('0x45')];_0x8dca69+=0x1){_0x2712c4[_0x0e27('0x46')]=_0x2712c4[_0x0e27('0x44')][_0x8dca69][_0x0e27('0x47')];_0x2712c4[_0x0e27('0x48')]=_0x2712c4[_0x0e27('0x44')][_0x8dca69][_0x0e27('0x48')];if(_0x2712c4[_0x0e27('0x32')]==_0x0e27('0x3b')){_0x2712c4[_0x0e27('0x3f')]=_0x2712c4[_0x0e27('0x29')];_0x2712c4['calleridname']=_0x2712c4[_0x0e27('0x49')];_0x2712c4[_0x0e27('0x29')]=_0x2712c4[_0x0e27('0x22')];_0x2712c4[_0x0e27('0x49')]=_0x2712c4[_0x0e27('0x4a')];_0x2712c4[_0x0e27('0x32')]=_0x2712c4[_0x0e27('0x3d')];}else if(_0x2712c4[_0x0e27('0x32')]==_0x0e27('0x4b')){_0x2712c4['calleridnum']=_0x2712c4['destination'];_0x2712c4[_0x0e27('0x32')]=_0x2712c4['originatecalleridnum'];}RpcVoiceRecording[_0x0e27('0x2f')](_0x2712c4);}}};Report['prototype'][_0x0e27('0x1a')]=function(_0x3fa9f9){if(_[_0x0e27('0x4c')](_0x3fa9f9)){_0x3fa9f9['forEach'](function(_0x15af07){RpcVoiceAgentReport[_0x0e27('0x2f')](_0x15af07);});}else{RpcVoiceAgentReport['create'](_0x3fa9f9);}};Report[_0x0e27('0x11')]['voiceDialReport']=function(_0xe3d350){RpcVoiceDialReport[_0x0e27('0x2f')](_0xe3d350);var _0x5e67a7=undefined;var _0x5d15f4=_0xe3d350[_0x0e27('0x3e')];if(_[_0x0e27('0x4d')](_0x5d15f4,'Local')){var _0x2596f0=_0x5d15f4[_0x0e27('0x4e')](_0x5d15f4['indexOf']('/')+0x1,_0x5d15f4['indexOf']('@'));_0x5e67a7=_[_0x0e27('0x21')](this[_0x0e27('0xf')],function(_0x5bedf7){return _0x5bedf7[_0x0e27('0x4f')]==_0x2596f0||_0x5bedf7[_0x0e27('0x50')]==_0x2596f0||_0x5bedf7[_0x0e27('0x22')]==_0x2596f0;});}else{var _0x2596f0=_0x5d15f4['substring'](_0x5d15f4[_0x0e27('0x51')]('/')+0x1,_0x5d15f4['lastIndexOf']('-'));_0x5e67a7=this['findAgent'](_0x2596f0);}if(_0x5e67a7){_0xe3d350[_0x0e27('0x25')]=_['isNil'](_0x5e67a7['interface'])?util[_0x0e27('0x26')]('SIP/%s',_0x5e67a7[_0x0e27('0x23')]):_0x5e67a7['interface'];_0xe3d350[_0x0e27('0x4a')]=_0x5e67a7[_0x0e27('0x23')];_0xe3d350[_0x0e27('0x22')]=_0x5e67a7['accountcode'];RpcMemberReport[_0x0e27('0x1b')](_0xe3d350);}};Report[_0x0e27('0x11')][_0x0e27('0x1d')]=function(_0xcc234e){RpcVoiceTransferReport[_0x0e27('0x1d')](_0xcc234e);};Report['prototype'][_0x0e27('0x1f')]=function(_0x335a69){RpcVoiceTransferReport[_0x0e27('0x1f')](_0x335a69);};module[_0x0e27('0x52')]=Report;
\ No newline at end of file
diff --git a/server/services/ami/report/userReport.js b/server/services/ami/report/userReport.js
index 2a15655..7ecbba2 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 _0x6bfa=['isNotNull','isUndefined','find','username','stateRegistry','merge','omit','actionid','emit','trunk:%s','trunk:save','[syncRegistry][UserReport]','inspect','device','toLowerCase','inuse','state','stateTime','toNumber','format','updateStatusRealtime','telephone:%s','name','startsWith','substring','indexOf','mobile','phone','accountcode','local','[syncDeviceState][UserReport]','peer','registered','status','address','[syncPeerStatus][UserReport]','exports','lodash','moment','bluebird','util','ioredis','../../../config/environment','../../../config/logger','ami','../ami','redis','defaults','localhost','trunks','agents','telephones','syncRegistry','bind','registry','syncDeviceState','peerstatus','syncPeerStatus','loopSyncRealTimeShow','then','actionSipShowRegistry','actionSipPeerStatus','error','resolve','actionDeviceStateList','catch','[loopSyncRealTimeShow]','prototype'];(function(_0x469a3c,_0x5ebc10){var _0x968f4=function(_0x22403b){while(--_0x22403b){_0x469a3c['push'](_0x469a3c['shift']());}};_0x968f4(++_0x5ebc10);}(_0x6bfa,0xf1));var _0xa6bf=function(_0x34b02a,_0xc897da){_0x34b02a=_0x34b02a-0x0;var _0x393178=_0x6bfa[_0x34b02a];return _0x393178;};'use strict';var _=require(_0xa6bf('0x0'));var moment=require(_0xa6bf('0x1'));var BPromise=require(_0xa6bf('0x2'));var util=require(_0xa6bf('0x3'));var Redis=require(_0xa6bf('0x4'));var config=require(_0xa6bf('0x5'));var logger=require(_0xa6bf('0x6'))(_0xa6bf('0x7'));var ami=require(_0xa6bf('0x8'));config[_0xa6bf('0x9')]=_[_0xa6bf('0xa')](config['redis'],{'host':_0xa6bf('0xb'),'port':0x18eb});var io=require('socket.io-emitter')(new Redis(config[_0xa6bf('0x9')]));function UserReport(_0x1f2ba5){this[_0xa6bf('0xc')]=_0x1f2ba5[_0xa6bf('0xc')];this[_0xa6bf('0xd')]=_0x1f2ba5[_0xa6bf('0xd')];this[_0xa6bf('0xe')]=_0x1f2ba5[_0xa6bf('0xe')];ami['on']('registryentry',this[_0xa6bf('0xf')][_0xa6bf('0x10')](this));ami['on'](_0xa6bf('0x11'),this[_0xa6bf('0xf')][_0xa6bf('0x10')](this));ami['on']('devicestatechange',this[_0xa6bf('0x12')][_0xa6bf('0x10')](this));ami['on'](_0xa6bf('0x13'),this[_0xa6bf('0x14')][_0xa6bf('0x10')](this));this[_0xa6bf('0x15')]();return BPromise['resolve']()[_0xa6bf('0x16')](ami[_0xa6bf('0x17')]())[_0xa6bf('0x16')](ami['actionDeviceStateList']())[_0xa6bf('0x16')](ami[_0xa6bf('0x18')]())['catch'](loggerCatch('[loopSyncRealTimeShow]'));}function loggerCatch(_0x3cc3d2){return function(_0x4105a4){logger[_0xa6bf('0x19')](_0x3cc3d2,util['inspect'](_0x4105a4,{'showHidden':![],'depth':null}));};}UserReport['prototype'][_0xa6bf('0x15')]=function(){setInterval(function(){BPromise[_0xa6bf('0x1a')]()[_0xa6bf('0x16')](ami['actionSipShowRegistry']())['then'](ami[_0xa6bf('0x1b')]())[_0xa6bf('0x16')](ami['actionSipPeerStatus']())[_0xa6bf('0x1c')](loggerCatch(_0xa6bf('0x1d')));},0x32c8);};UserReport[_0xa6bf('0x1e')][_0xa6bf('0x1f')]=function(_0x5ed04f){return _0x5ed04f!==null&&!_[_0xa6bf('0x20')](_0x5ed04f);};UserReport[_0xa6bf('0x1e')]['emit']=function(_0x1935f1,_0xd1c738,_0x270147){io['to'](_0x1935f1)['emit'](_0xd1c738,_0x270147);};UserReport['prototype'][_0xa6bf('0xf')]=function(_0x34702d){try{if(this[_0xa6bf('0x1f')](_0x34702d)){var _0x27db1e=_[_0xa6bf('0x21')](this[_0xa6bf('0xc')],{'registry':_0x34702d[_0xa6bf('0x22')]});if(_0x27db1e){_0x34702d[_0xa6bf('0x23')]=_0x34702d['state'];_[_0xa6bf('0x24')](_0x27db1e,_[_0xa6bf('0x25')](_0x34702d,['event',_0xa6bf('0x26'),_0xa6bf('0x22'),'state']));this[_0xa6bf('0x27')](util['format'](_0xa6bf('0x28'),_0x27db1e['name']),_0xa6bf('0x29'),_0x27db1e);}}}catch(_0x5a3746){logger[_0xa6bf('0x19')](_0xa6bf('0x2a'),util[_0xa6bf('0x2b')](_0x5a3746,{'showHidden':![],'depth':null}));}};UserReport['prototype'][_0xa6bf('0x12')]=function(_0x3ece70){try{if(this[_0xa6bf('0x1f')](_0x3ece70)){if(this[_0xa6bf('0xd')][_0x3ece70[_0xa6bf('0x2c')]]){if(!this[_0xa6bf('0xd')][_0x3ece70[_0xa6bf('0x2c')]]['local']||_0x3ece70['state'][_0xa6bf('0x2d')]()==_0xa6bf('0x2e')){this['agents'][_0x3ece70['device']]['local']=![];if(this[_0xa6bf('0xd')][_0x3ece70[_0xa6bf('0x2c')]][_0xa6bf('0x2f')]!==_0x3ece70['state'][_0xa6bf('0x2d')]()){this[_0xa6bf('0xd')][_0x3ece70[_0xa6bf('0x2c')]][_0xa6bf('0x30')]=_[_0xa6bf('0x31')](moment()[_0xa6bf('0x32')]('x'));}this[_0xa6bf('0xd')][_0x3ece70['device']][_0xa6bf('0x2f')]=_0x3ece70['state'][_0xa6bf('0x2d')]();this[_0xa6bf('0xd')][_0x3ece70['device']][_0xa6bf('0x33')](_0x3ece70);}}else if(this[_0xa6bf('0xe')][_0x3ece70['device']]){if(this[_0xa6bf('0xe')][_0x3ece70[_0xa6bf('0x2c')]][_0xa6bf('0x2f')]!==_0x3ece70['state']['toLowerCase']()){this[_0xa6bf('0xe')][_0x3ece70[_0xa6bf('0x2c')]][_0xa6bf('0x30')]=_[_0xa6bf('0x31')](moment()[_0xa6bf('0x32')]('x'));}this[_0xa6bf('0xe')][_0x3ece70['device']]['state']=_0x3ece70[_0xa6bf('0x2f')][_0xa6bf('0x2d')]();this[_0xa6bf('0x27')](util[_0xa6bf('0x32')](_0xa6bf('0x34'),this[_0xa6bf('0xe')][_0x3ece70[_0xa6bf('0x2c')]][_0xa6bf('0x35')]),'telephone:save',this[_0xa6bf('0xe')][_0x3ece70[_0xa6bf('0x2c')]]);}else if(this[_0xa6bf('0xc')][_0x3ece70[_0xa6bf('0x2c')]]){if(this[_0xa6bf('0xc')][_0x3ece70['device']][_0xa6bf('0x2f')]!==_0x3ece70['state'][_0xa6bf('0x2d')]()){this[_0xa6bf('0xc')][_0x3ece70[_0xa6bf('0x2c')]][_0xa6bf('0x30')]=_[_0xa6bf('0x31')](moment()[_0xa6bf('0x32')]('x'));}this['trunks'][_0x3ece70[_0xa6bf('0x2c')]][_0xa6bf('0x2f')]=_0x3ece70['state'][_0xa6bf('0x2d')]();this[_0xa6bf('0x27')](util[_0xa6bf('0x32')](_0xa6bf('0x28'),this[_0xa6bf('0xc')][_0x3ece70[_0xa6bf('0x2c')]][_0xa6bf('0x35')]),_0xa6bf('0x29'),this[_0xa6bf('0xc')][_0x3ece70[_0xa6bf('0x2c')]]);}else if(_['startsWith'](_0x3ece70['device'],'Queue')){}else if(_[_0xa6bf('0x36')](_0x3ece70[_0xa6bf('0x2c')],'Local')){var _0x43f83a=_0x3ece70['device'];var _0x40e436=_0x43f83a[_0xa6bf('0x37')](_0x43f83a[_0xa6bf('0x38')]('/')+0x1,_0x43f83a[_0xa6bf('0x38')]('@'));var _0x5b3114=_[_0xa6bf('0x21')](this[_0xa6bf('0xd')],function(_0x1c5268){return _0x1c5268[_0xa6bf('0x39')]==_0x40e436||_0x1c5268[_0xa6bf('0x3a')]==_0x40e436||_0x1c5268[_0xa6bf('0x3b')]==_0x40e436;});if(_0x5b3114){if(_0x5b3114[_0xa6bf('0x2f')]!==_0x3ece70[_0xa6bf('0x2f')][_0xa6bf('0x2d')]()){_0x5b3114['stateTime']=_[_0xa6bf('0x31')](moment()[_0xa6bf('0x32')]('x'));}_0x5b3114[_0xa6bf('0x2f')]=_0x3ece70[_0xa6bf('0x2f')][_0xa6bf('0x2d')]();_0x5b3114[_0xa6bf('0x3c')]=!![];_0x5b3114[_0xa6bf('0x33')](_0x3ece70);}}else{}}}catch(_0x1f520d){logger[_0xa6bf('0x19')](_0xa6bf('0x3d'),util[_0xa6bf('0x2b')](_0x1f520d,{'showHidden':![],'depth':null}));}};UserReport['prototype'][_0xa6bf('0x14')]=function(_0x1577c4){try{if(this[_0xa6bf('0x1f')](_0x1577c4)&&this[_0xa6bf('0x1f')](_0x1577c4[_0xa6bf('0x13')])){if(this[_0xa6bf('0xd')][_0x1577c4[_0xa6bf('0x3e')]]){if(!this[_0xa6bf('0xd')][_0x1577c4[_0xa6bf('0x3e')]][_0xa6bf('0x3c')]||_0x1577c4[_0xa6bf('0x13')]['toLowerCase']()==_0xa6bf('0x3f')){this[_0xa6bf('0xd')][_0x1577c4[_0xa6bf('0x3e')]][_0xa6bf('0x3c')]=![];this['agents'][_0x1577c4[_0xa6bf('0x3e')]][_0xa6bf('0x40')]=_0x1577c4[_0xa6bf('0x13')]['toLowerCase']();this[_0xa6bf('0xd')][_0x1577c4[_0xa6bf('0x3e')]]['address']=_0x1577c4[_0xa6bf('0x41')];this[_0xa6bf('0xd')][_0x1577c4['peer']][_0xa6bf('0x33')](_0x1577c4);}}else if(this[_0xa6bf('0xe')][_0x1577c4['peer']]){this[_0xa6bf('0xe')][_0x1577c4[_0xa6bf('0x3e')]][_0xa6bf('0x40')]=_0x1577c4[_0xa6bf('0x13')][_0xa6bf('0x2d')]();this[_0xa6bf('0xe')][_0x1577c4[_0xa6bf('0x3e')]][_0xa6bf('0x41')]=_0x1577c4[_0xa6bf('0x41')];this[_0xa6bf('0x27')](util['format']('telephone:%s',this[_0xa6bf('0xe')][_0x1577c4[_0xa6bf('0x3e')]][_0xa6bf('0x35')]),'telephone:save',this[_0xa6bf('0xe')][_0x1577c4[_0xa6bf('0x3e')]]);}else if(this[_0xa6bf('0xc')][_0x1577c4[_0xa6bf('0x3e')]]){this['trunks'][_0x1577c4[_0xa6bf('0x3e')]][_0xa6bf('0x40')]=_0x1577c4[_0xa6bf('0x13')][_0xa6bf('0x2d')]();this['trunks'][_0x1577c4[_0xa6bf('0x3e')]]['address']=_0x1577c4[_0xa6bf('0x41')];this[_0xa6bf('0x27')](util[_0xa6bf('0x32')]('trunk:%s',this[_0xa6bf('0xc')][_0x1577c4[_0xa6bf('0x3e')]]['name']),_0xa6bf('0x29'),this[_0xa6bf('0xc')][_0x1577c4['peer']]);}else{}}}catch(_0x5ad06d){logger[_0xa6bf('0x19')](_0xa6bf('0x42'),util[_0xa6bf('0x2b')](_0x5ad06d,{'showHidden':![],'depth':null}));}};module[_0xa6bf('0x43')]=UserReport;
\ No newline at end of file
+var _0x31d6=['peerstatus','syncPeerStatus','then','actionDeviceStateList','actionSipPeerStatus','catch','error','inspect','prototype','resolve','[loopSyncRealTimeShow]','isNotNull','isUndefined','emit','find','trunks','username','stateRegistry','state','merge','omit','event','actionid','format','trunk:%s','trunk:save','[syncRegistry][UserReport]','syncDeviceState','device','local','toLowerCase','stateTime','updateStatusRealtime','toNumber','telephone:%s','name','telephone:save','startsWith','Queue','Local','substring','indexOf','mobile','phone','accountcode','[syncDeviceState][UserReport]','peer','registered','status','address','[syncPeerStatus][UserReport]','lodash','moment','bluebird','ioredis','../../../config/environment','ami','../ami','redis','defaults','localhost','socket.io-emitter','agents','telephones','registryentry','syncRegistry','bind','registry','devicestatechange'];(function(_0x14add3,_0x13ce8d){var _0x4a174f=function(_0x2b3ed7){while(--_0x2b3ed7){_0x14add3['push'](_0x14add3['shift']());}};_0x4a174f(++_0x13ce8d);}(_0x31d6,0x147));var _0x631d=function(_0x25cba8,_0x1d2d23){_0x25cba8=_0x25cba8-0x0;var _0x2e01a8=_0x31d6[_0x25cba8];return _0x2e01a8;};'use strict';var _=require(_0x631d('0x0'));var moment=require(_0x631d('0x1'));var BPromise=require(_0x631d('0x2'));var util=require('util');var Redis=require(_0x631d('0x3'));var config=require(_0x631d('0x4'));var logger=require('../../../config/logger')(_0x631d('0x5'));var ami=require(_0x631d('0x6'));config[_0x631d('0x7')]=_[_0x631d('0x8')](config[_0x631d('0x7')],{'host':_0x631d('0x9'),'port':0x18eb});var io=require(_0x631d('0xa'))(new Redis(config['redis']));function UserReport(_0x1a2bba){this['trunks']=_0x1a2bba['trunks'];this[_0x631d('0xb')]=_0x1a2bba[_0x631d('0xb')];this[_0x631d('0xc')]=_0x1a2bba[_0x631d('0xc')];ami['on'](_0x631d('0xd'),this[_0x631d('0xe')][_0x631d('0xf')](this));ami['on'](_0x631d('0x10'),this[_0x631d('0xe')][_0x631d('0xf')](this));ami['on'](_0x631d('0x11'),this['syncDeviceState'][_0x631d('0xf')](this));ami['on'](_0x631d('0x12'),this[_0x631d('0x13')]['bind'](this));this['loopSyncRealTimeShow']();return BPromise['resolve']()['then'](ami['actionSipShowRegistry']())[_0x631d('0x14')](ami[_0x631d('0x15')]())[_0x631d('0x14')](ami[_0x631d('0x16')]())[_0x631d('0x17')](loggerCatch('[loopSyncRealTimeShow]'));}function loggerCatch(_0x5acf1e){return function(_0x4980da){logger[_0x631d('0x18')](_0x5acf1e,util[_0x631d('0x19')](_0x4980da,{'showHidden':![],'depth':null}));};}UserReport[_0x631d('0x1a')]['loopSyncRealTimeShow']=function(){setInterval(function(){BPromise[_0x631d('0x1b')]()[_0x631d('0x14')](ami['actionSipShowRegistry']())[_0x631d('0x14')](ami[_0x631d('0x15')]())[_0x631d('0x14')](ami[_0x631d('0x16')]())[_0x631d('0x17')](loggerCatch(_0x631d('0x1c')));},0x32c8);};UserReport[_0x631d('0x1a')][_0x631d('0x1d')]=function(_0x39e69e){return _0x39e69e!==null&&!_[_0x631d('0x1e')](_0x39e69e);};UserReport[_0x631d('0x1a')]['emit']=function(_0x20326d,_0xfe7fc9,_0x2b4982){io['to'](_0x20326d)[_0x631d('0x1f')](_0xfe7fc9,_0x2b4982);};UserReport[_0x631d('0x1a')][_0x631d('0xe')]=function(_0x48934c){try{if(this[_0x631d('0x1d')](_0x48934c)){var _0x309904=_[_0x631d('0x20')](this[_0x631d('0x21')],{'registry':_0x48934c[_0x631d('0x22')]});if(_0x309904){_0x48934c[_0x631d('0x23')]=_0x48934c[_0x631d('0x24')];_[_0x631d('0x25')](_0x309904,_[_0x631d('0x26')](_0x48934c,[_0x631d('0x27'),_0x631d('0x28'),_0x631d('0x22'),_0x631d('0x24')]));this[_0x631d('0x1f')](util[_0x631d('0x29')](_0x631d('0x2a'),_0x309904['name']),_0x631d('0x2b'),_0x309904);}}}catch(_0x3a4ead){logger[_0x631d('0x18')](_0x631d('0x2c'),util[_0x631d('0x19')](_0x3a4ead,{'showHidden':![],'depth':null}));}};UserReport['prototype'][_0x631d('0x2d')]=function(_0x463f6a){try{if(this[_0x631d('0x1d')](_0x463f6a)){if(this[_0x631d('0xb')][_0x463f6a[_0x631d('0x2e')]]){if(!this[_0x631d('0xb')][_0x463f6a['device']][_0x631d('0x2f')]||_0x463f6a['state'][_0x631d('0x30')]()=='inuse'){this['agents'][_0x463f6a[_0x631d('0x2e')]]['local']=![];if(this[_0x631d('0xb')][_0x463f6a[_0x631d('0x2e')]][_0x631d('0x24')]!==_0x463f6a['state'][_0x631d('0x30')]()){this[_0x631d('0xb')][_0x463f6a[_0x631d('0x2e')]][_0x631d('0x31')]=_['toNumber'](moment()[_0x631d('0x29')]('x'));}this['agents'][_0x463f6a[_0x631d('0x2e')]][_0x631d('0x24')]=_0x463f6a[_0x631d('0x24')][_0x631d('0x30')]();this[_0x631d('0xb')][_0x463f6a['device']][_0x631d('0x32')](_0x463f6a);}}else if(this[_0x631d('0xc')][_0x463f6a[_0x631d('0x2e')]]){if(this[_0x631d('0xc')][_0x463f6a[_0x631d('0x2e')]][_0x631d('0x24')]!==_0x463f6a[_0x631d('0x24')][_0x631d('0x30')]()){this['telephones'][_0x463f6a[_0x631d('0x2e')]][_0x631d('0x31')]=_[_0x631d('0x33')](moment()['format']('x'));}this[_0x631d('0xc')][_0x463f6a[_0x631d('0x2e')]][_0x631d('0x24')]=_0x463f6a[_0x631d('0x24')]['toLowerCase']();this[_0x631d('0x1f')](util[_0x631d('0x29')](_0x631d('0x34'),this[_0x631d('0xc')][_0x463f6a[_0x631d('0x2e')]][_0x631d('0x35')]),_0x631d('0x36'),this['telephones'][_0x463f6a[_0x631d('0x2e')]]);}else if(this['trunks'][_0x463f6a[_0x631d('0x2e')]]){if(this[_0x631d('0x21')][_0x463f6a[_0x631d('0x2e')]][_0x631d('0x24')]!==_0x463f6a[_0x631d('0x24')][_0x631d('0x30')]()){this['trunks'][_0x463f6a[_0x631d('0x2e')]][_0x631d('0x31')]=_['toNumber'](moment()['format']('x'));}this['trunks'][_0x463f6a[_0x631d('0x2e')]][_0x631d('0x24')]=_0x463f6a[_0x631d('0x24')][_0x631d('0x30')]();this[_0x631d('0x1f')](util['format'](_0x631d('0x2a'),this[_0x631d('0x21')][_0x463f6a[_0x631d('0x2e')]][_0x631d('0x35')]),_0x631d('0x2b'),this[_0x631d('0x21')][_0x463f6a[_0x631d('0x2e')]]);}else if(_[_0x631d('0x37')](_0x463f6a[_0x631d('0x2e')],_0x631d('0x38'))){}else if(_[_0x631d('0x37')](_0x463f6a[_0x631d('0x2e')],_0x631d('0x39'))){var _0x2ca9c0=_0x463f6a[_0x631d('0x2e')];var _0x2ae5a8=_0x2ca9c0[_0x631d('0x3a')](_0x2ca9c0[_0x631d('0x3b')]('/')+0x1,_0x2ca9c0[_0x631d('0x3b')]('@'));var _0x39d807=_[_0x631d('0x20')](this[_0x631d('0xb')],function(_0xf51a91){return _0xf51a91[_0x631d('0x3c')]==_0x2ae5a8||_0xf51a91[_0x631d('0x3d')]==_0x2ae5a8||_0xf51a91[_0x631d('0x3e')]==_0x2ae5a8;});if(_0x39d807){if(_0x39d807[_0x631d('0x24')]!==_0x463f6a[_0x631d('0x24')][_0x631d('0x30')]()){_0x39d807['stateTime']=_[_0x631d('0x33')](moment()[_0x631d('0x29')]('x'));}_0x39d807[_0x631d('0x24')]=_0x463f6a[_0x631d('0x24')][_0x631d('0x30')]();_0x39d807[_0x631d('0x2f')]=!![];_0x39d807['updateStatusRealtime'](_0x463f6a);}}else{}}}catch(_0x5c7799){logger[_0x631d('0x18')](_0x631d('0x3f'),util['inspect'](_0x5c7799,{'showHidden':![],'depth':null}));}};UserReport[_0x631d('0x1a')][_0x631d('0x13')]=function(_0x27d627){try{if(this[_0x631d('0x1d')](_0x27d627)&&this['isNotNull'](_0x27d627[_0x631d('0x12')])){if(this['agents'][_0x27d627[_0x631d('0x40')]]){if(!this[_0x631d('0xb')][_0x27d627[_0x631d('0x40')]]['local']||_0x27d627['peerstatus'][_0x631d('0x30')]()==_0x631d('0x41')){this[_0x631d('0xb')][_0x27d627[_0x631d('0x40')]][_0x631d('0x2f')]=![];this[_0x631d('0xb')][_0x27d627[_0x631d('0x40')]][_0x631d('0x42')]=_0x27d627[_0x631d('0x12')][_0x631d('0x30')]();this[_0x631d('0xb')][_0x27d627[_0x631d('0x40')]][_0x631d('0x43')]=_0x27d627['address'];this[_0x631d('0xb')][_0x27d627[_0x631d('0x40')]][_0x631d('0x32')](_0x27d627);}}else if(this['telephones'][_0x27d627['peer']]){this['telephones'][_0x27d627[_0x631d('0x40')]][_0x631d('0x42')]=_0x27d627[_0x631d('0x12')][_0x631d('0x30')]();this[_0x631d('0xc')][_0x27d627[_0x631d('0x40')]][_0x631d('0x43')]=_0x27d627[_0x631d('0x43')];this[_0x631d('0x1f')](util['format'](_0x631d('0x34'),this[_0x631d('0xc')][_0x27d627[_0x631d('0x40')]]['name']),_0x631d('0x36'),this[_0x631d('0xc')][_0x27d627[_0x631d('0x40')]]);}else if(this[_0x631d('0x21')][_0x27d627[_0x631d('0x40')]]){this['trunks'][_0x27d627[_0x631d('0x40')]][_0x631d('0x42')]=_0x27d627[_0x631d('0x12')][_0x631d('0x30')]();this['trunks'][_0x27d627[_0x631d('0x40')]][_0x631d('0x43')]=_0x27d627[_0x631d('0x43')];this[_0x631d('0x1f')](util[_0x631d('0x29')](_0x631d('0x2a'),this[_0x631d('0x21')][_0x27d627[_0x631d('0x40')]][_0x631d('0x35')]),_0x631d('0x2b'),this[_0x631d('0x21')][_0x27d627['peer']]);}else{}}}catch(_0x438f62){logger[_0x631d('0x18')](_0x631d('0x44'),util[_0x631d('0x19')](_0x438f62,{'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 2445292..3efe42d 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 _0x963d=['origtransfereruniqueid','diff','seconds','secondtransfereruniqueid','[syncAttendedTransfer][VoiceAgentReport]','syncBlindTransfer','transfereruniqueid','[syncBlindTransfer][VoiceAgentReport]','channel','substring','lastIndexOf','onhold','[syncMusicOnHoldStart][VoiceAgentReport]','exports','moment','util','../../../config/logger','ami','../ami','redis','defaults','socket.io-emitter','channels','voiceQueues','agents','variables','syncAgentCalled','bind','agentconnect','syncAgentConnect','agentringnoanswer','queuecallerabandon','syncQueueCallerAbandon','agentcomplete','varset','syncVarSet','hangup','syncHangup','musiconholdstart','syncMusicOnHoldStart','musiconholdstop','syncMusicOnHoldStop','attendedtransfer','syncAttendedTransfer','blindtransfer','emit','prototype','isUndefined','isNotNull','uniqueid','destuniqueid','format','YYYY-MM-DD\x20HH:mm:ss','called','queue','type','inbound','merge','omit','event','privilege','user:%s','membername','user:called','error','[syncAgentCalled][VoiceAgentReport]','inspect','hasOwnProperty','agentconnectAt','lastevent','connect','holdtime','connectedlinenum','connectedlinename','destchannelstate','destchannelstatedesc','interface','pick','destconnectedlinenum','user:agentconnect','custom:agentconnect','agentringnoanswerAt','reason','answered_elsewhere','answeredelsewheredestinationuniqueid','answeredelsewheremembername','custom:agentansweredelsewhere','[syncAgentConnect][VoiceAgentReport]','syncAgentRingNoAnswer','rejected','custom:agentringnoanswer','[syncAgentRingNoAnswer][VoiceAgentReport]','abandoned','custom:agentqueuecallerabandon','[syncQueueCallerAbandon][VoiceAgentReport]','agentcompleteAt','complete','talktime','transfer','agentacw','acwTimeout','user:agentcomplete','[syncAgentComplete][VoiceAgentReport]','addVariable','keys','variable','value','[syncVarSet][VoiceAgentReport]','rtpaudioqosbridged','rtpaudioqosjitter','rtpaudioqosjitterbridged','rtpaudioqoslossbridged','sipcallid','sipuri','bridgepeer','bridgepvtcallid','membercalls','memberdynamic','memberinterface','memberlastcall','memberrealtime','isNil','includes','custom:voiceAgentReport','values','transfereeuniqueid'];(function(_0x14aaae,_0x1a261){var _0x5a1189=function(_0x7673ce){while(--_0x7673ce){_0x14aaae['push'](_0x14aaae['shift']());}};_0x5a1189(++_0x1a261);}(_0x963d,0x188));var _0xd963=function(_0xf886a0,_0xfd49e1){_0xf886a0=_0xf886a0-0x0;var _0xc5a6fa=_0x963d[_0xf886a0];return _0xc5a6fa;};'use strict';var _=require('lodash');var moment=require(_0xd963('0x0'));var util=require(_0xd963('0x1'));var Redis=require('ioredis');var config=require('../../../config/environment');var logger=require(_0xd963('0x2'))(_0xd963('0x3'));var ami=require(_0xd963('0x4'));config[_0xd963('0x5')]=_[_0xd963('0x6')](config[_0xd963('0x5')],{'host':'localhost','port':0x18eb});var io=require(_0xd963('0x7'))(new Redis(config[_0xd963('0x5')]));function VoiceAgentReport(_0x343f72){this[_0xd963('0x8')]={};this[_0xd963('0x9')]=_0x343f72[_0xd963('0x9')];this[_0xd963('0xa')]=_0x343f72[_0xd963('0xa')];this[_0xd963('0xb')]={};ami['on']('agentcalled',this[_0xd963('0xc')][_0xd963('0xd')](this));ami['on'](_0xd963('0xe'),this[_0xd963('0xf')][_0xd963('0xd')](this));ami['on'](_0xd963('0x10'),this['syncAgentRingNoAnswer'][_0xd963('0xd')](this));ami['on'](_0xd963('0x11'),this[_0xd963('0x12')][_0xd963('0xd')](this));ami['on'](_0xd963('0x13'),this['syncAgentComplete'][_0xd963('0xd')](this));ami['on'](_0xd963('0x14'),this[_0xd963('0x15')][_0xd963('0xd')](this));ami['on'](_0xd963('0x16'),this[_0xd963('0x17')]['bind'](this));ami['on'](_0xd963('0x18'),this[_0xd963('0x19')][_0xd963('0xd')](this));ami['on'](_0xd963('0x1a'),this[_0xd963('0x1b')][_0xd963('0xd')](this));ami['on'](_0xd963('0x1c'),this[_0xd963('0x1d')][_0xd963('0xd')](this));ami['on'](_0xd963('0x1e'),this['syncBlindTransfer'][_0xd963('0xd')](this));}VoiceAgentReport['prototype'][_0xd963('0x1f')]=function(_0x19414d,_0x1ea6a1,_0x47a529){io['to'](_0x19414d)[_0xd963('0x1f')](_0x1ea6a1,_0x47a529);};VoiceAgentReport[_0xd963('0x20')]['isNotNull']=function(_0x6fc065){return _0x6fc065!==null&&!_[_0xd963('0x21')](_0x6fc065);};VoiceAgentReport['prototype'][_0xd963('0xc')]=function(_0x516254){try{if(this[_0xd963('0x22')](_0x516254)){if(_['isUndefined'](this[_0xd963('0x8')][_0x516254[_0xd963('0x23')]])){this['channels'][_0x516254[_0xd963('0x23')]]={};}if(_[_0xd963('0x21')](this[_0xd963('0x8')][_0x516254[_0xd963('0x23')]][_0x516254['destuniqueid']])){this[_0xd963('0x8')][_0x516254[_0xd963('0x23')]][_0x516254[_0xd963('0x24')]]={'agentcalledAt':moment()[_0xd963('0x25')](_0xd963('0x26')),'lastevent':_0xd963('0x27'),'variables':this['variables'][_0x516254[_0xd963('0x23')]],'type':this[_0xd963('0x9')][_0x516254[_0xd963('0x28')]]?this['voiceQueues'][_0x516254[_0xd963('0x28')]][_0xd963('0x29')]||_0xd963('0x2a'):'inbound'};}_[_0xd963('0x2b')](this[_0xd963('0x8')][_0x516254[_0xd963('0x23')]][_0x516254[_0xd963('0x24')]],_[_0xd963('0x2c')](_0x516254,[_0xd963('0x2d'),_0xd963('0x2e')]));ami[_0xd963('0x1f')]('custom:agentcalled',this[_0xd963('0x8')][_0x516254[_0xd963('0x23')]][_0x516254['destuniqueid']]);this[_0xd963('0x1f')](util[_0xd963('0x25')](_0xd963('0x2f'),_0x516254[_0xd963('0x30')]),_0xd963('0x31'),this['channels'][_0x516254[_0xd963('0x23')]][_0x516254[_0xd963('0x24')]]);}}catch(_0x42f1b2){logger[_0xd963('0x32')](_0xd963('0x33'),util[_0xd963('0x34')](_0x42f1b2,{'showHidden':![],'depth':null}));}};VoiceAgentReport['prototype']['syncAgentConnect']=function(_0x2f91a5){try{if(this[_0xd963('0x22')](_0x2f91a5)){if(this[_0xd963('0x8')][_0x2f91a5[_0xd963('0x23')]]){for(var _0x2509d1 in this['channels'][_0x2f91a5['uniqueid']]){if(this['channels'][_0x2f91a5[_0xd963('0x23')]][_0xd963('0x35')](_0x2509d1)){if(_0x2f91a5['destuniqueid']===_0x2509d1){this[_0xd963('0x8')][_0x2f91a5[_0xd963('0x23')]][_0x2509d1][_0xd963('0x36')]=moment()['format']('YYYY-MM-DD\x20HH:mm:ss');this[_0xd963('0x8')][_0x2f91a5[_0xd963('0x23')]][_0x2509d1][_0xd963('0x37')]=_0xd963('0x38');this[_0xd963('0x8')][_0x2f91a5[_0xd963('0x23')]][_0x2509d1]['holdtime']=_0x2f91a5[_0xd963('0x39')];this['channels'][_0x2f91a5['uniqueid']][_0x2509d1][_0xd963('0x3a')]=_0x2f91a5['connectedlinenum'];this[_0xd963('0x8')][_0x2f91a5[_0xd963('0x23')]][_0x2509d1][_0xd963('0x3b')]=_0x2f91a5[_0xd963('0x3b')];this[_0xd963('0x8')][_0x2f91a5['uniqueid']][_0x2509d1][_0xd963('0x3c')]=_0x2f91a5[_0xd963('0x3c')];this[_0xd963('0x8')][_0x2f91a5['uniqueid']][_0x2509d1][_0xd963('0x3d')]=_0x2f91a5['destchannelstatedesc'];_[_0xd963('0x2b')](this['agents'][_0x2f91a5[_0xd963('0x3e')]],_[_0xd963('0x3f')](_0x2f91a5,['queue',_0xd963('0x40')]));this[_0xd963('0x1f')](util[_0xd963('0x25')](_0xd963('0x2f'),_0x2f91a5[_0xd963('0x30')]),_0xd963('0x41'),this[_0xd963('0x8')][_0x2f91a5[_0xd963('0x23')]][_0x2f91a5[_0xd963('0x24')]]);ami[_0xd963('0x1f')](_0xd963('0x42'),this['channels'][_0x2f91a5[_0xd963('0x23')]][_0x2509d1]);}else if(!this[_0xd963('0x8')][_0x2f91a5[_0xd963('0x23')]][_0x2509d1][_0xd963('0x10')]&&!this[_0xd963('0x8')][_0x2f91a5[_0xd963('0x23')]][_0x2509d1][_0xd963('0x13')]){this[_0xd963('0x8')][_0x2f91a5['uniqueid']][_0x2509d1][_0xd963('0x10')]=!![];this[_0xd963('0x8')][_0x2f91a5[_0xd963('0x23')]][_0x2509d1][_0xd963('0x43')]=moment()[_0xd963('0x25')](_0xd963('0x26'));this[_0xd963('0x8')][_0x2f91a5[_0xd963('0x23')]][_0x2509d1][_0xd963('0x44')]='answered_elsewhere';this['channels'][_0x2f91a5['uniqueid']][_0x2509d1][_0xd963('0x37')]=_0xd963('0x45');this['channels'][_0x2f91a5[_0xd963('0x23')]][_0x2509d1][_0xd963('0x46')]=_0x2f91a5[_0xd963('0x24')];this[_0xd963('0x8')][_0x2f91a5[_0xd963('0x23')]][_0x2509d1][_0xd963('0x47')]=_0x2f91a5[_0xd963('0x30')];ami['emit'](_0xd963('0x48'),this['channels'][_0x2f91a5['uniqueid']][_0x2509d1]);}}}}}}catch(_0x390997){logger[_0xd963('0x32')](_0xd963('0x49'),util[_0xd963('0x34')](_0x390997,{'showHidden':![],'depth':null}));}};VoiceAgentReport[_0xd963('0x20')][_0xd963('0x4a')]=function(_0x491852){try{if(this[_0xd963('0x22')](_0x491852)){if(this[_0xd963('0x8')][_0x491852['uniqueid']]&&this['channels'][_0x491852[_0xd963('0x23')]][_0x491852[_0xd963('0x24')]]){this[_0xd963('0x8')][_0x491852[_0xd963('0x23')]][_0x491852[_0xd963('0x24')]]['agentringnoanswer']=!![];this[_0xd963('0x8')][_0x491852[_0xd963('0x23')]][_0x491852[_0xd963('0x24')]][_0xd963('0x43')]=moment()[_0xd963('0x25')]('YYYY-MM-DD\x20HH:mm:ss');this[_0xd963('0x8')][_0x491852[_0xd963('0x23')]][_0x491852[_0xd963('0x24')]]['reason']=_0xd963('0x4b');this[_0xd963('0x8')][_0x491852[_0xd963('0x23')]][_0x491852['destuniqueid']][_0xd963('0x37')]=_0xd963('0x4b');ami[_0xd963('0x1f')](_0xd963('0x4c'),this['channels'][_0x491852['uniqueid']][_0x491852[_0xd963('0x24')]]);}}}catch(_0x1d4735){logger[_0xd963('0x32')](_0xd963('0x4d'),util[_0xd963('0x34')](_0x1d4735,{'showHidden':![],'depth':null}));}};VoiceAgentReport['prototype']['syncQueueCallerAbandon']=function(_0x5a0632){try{if(this[_0xd963('0x22')](_0x5a0632)){if(this[_0xd963('0x8')][_0x5a0632[_0xd963('0x23')]]){for(var _0x3209d3 in this['channels'][_0x5a0632['uniqueid']]){if(this[_0xd963('0x8')][_0x5a0632[_0xd963('0x23')]][_0xd963('0x35')](_0x3209d3)&&!this[_0xd963('0x8')][_0x5a0632[_0xd963('0x23')]][_0x3209d3]['agentringnoanswer']&&!this['channels'][_0x5a0632['uniqueid']][_0x3209d3][_0xd963('0x13')]){this[_0xd963('0x8')][_0x5a0632[_0xd963('0x23')]][_0x3209d3]['agentringnoanswer']=!![];this[_0xd963('0x8')][_0x5a0632[_0xd963('0x23')]][_0x3209d3][_0xd963('0x43')]=moment()[_0xd963('0x25')](_0xd963('0x26'));this['channels'][_0x5a0632[_0xd963('0x23')]][_0x3209d3][_0xd963('0x44')]=_0xd963('0x4e');this[_0xd963('0x8')][_0x5a0632[_0xd963('0x23')]][_0x3209d3][_0xd963('0x37')]=_0xd963('0x4e');ami['emit'](_0xd963('0x4f'),this[_0xd963('0x8')][_0x5a0632[_0xd963('0x23')]][_0x3209d3]);}}}}}catch(_0x265359){logger['error'](_0xd963('0x50'),util[_0xd963('0x34')](_0x265359,{'showHidden':![],'depth':null}));}};VoiceAgentReport[_0xd963('0x20')]['syncAgentComplete']=function(_0x535191){try{if(this['isNotNull'](_0x535191)){if(this[_0xd963('0x8')][_0x535191[_0xd963('0x23')]]){for(var _0x195f4e in this[_0xd963('0x8')][_0x535191[_0xd963('0x23')]]){if(this[_0xd963('0x8')][_0x535191[_0xd963('0x23')]][_0xd963('0x35')](_0x195f4e)){if(this['channels'][_0x535191[_0xd963('0x23')]][_0x195f4e][_0xd963('0x36')]&&!this[_0xd963('0x8')][_0x535191[_0xd963('0x23')]][_0x195f4e][_0xd963('0x13')]){this['channels'][_0x535191[_0xd963('0x23')]][_0x195f4e]['agentcomplete']=!![];this[_0xd963('0x8')][_0x535191['uniqueid']][_0x195f4e][_0xd963('0x51')]=moment()['format'](_0xd963('0x26'));this[_0xd963('0x8')][_0x535191['uniqueid']][_0x195f4e]['lastevent']=_0xd963('0x52');this[_0xd963('0x8')][_0x535191['uniqueid']][_0x195f4e]['talktime']=_0x535191[_0xd963('0x53')];this[_0xd963('0x8')][_0x535191[_0xd963('0x23')]][_0x195f4e][_0xd963('0x44')]=_0x535191[_0xd963('0x44')]==_0xd963('0x54')?'agent':_0x535191[_0xd963('0x44')];if(this['voiceQueues'][_0x535191['queue']]&&this[_0xd963('0x9')][_0x535191[_0xd963('0x28')]]['acw']){this[_0xd963('0x8')][_0x535191[_0xd963('0x23')]][_0x195f4e][_0xd963('0x55')]=!![];this['channels'][_0x535191[_0xd963('0x23')]][_0x195f4e]['acwtime']=this[_0xd963('0x9')][_0x535191[_0xd963('0x28')]][_0xd963('0x56')];}this[_0xd963('0xa')][_0x535191['interface']]=_['omit'](this['agents'][_0x535191[_0xd963('0x3e')]],[_0xd963('0x28'),_0xd963('0x40')]);this[_0xd963('0x1f')](util[_0xd963('0x25')](_0xd963('0x2f'),_0x535191['membername']),_0xd963('0x57'),this[_0xd963('0x8')][_0x535191[_0xd963('0x23')]][_0x195f4e]);ami['emit']('custom:agentcomplete',this[_0xd963('0x8')][_0x535191[_0xd963('0x23')]][_0x195f4e]);}}}}}}catch(_0x5e4bcb){logger[_0xd963('0x32')](_0xd963('0x58'),util[_0xd963('0x34')](_0x5e4bcb,{'showHidden':![],'depth':null}));}};VoiceAgentReport[_0xd963('0x20')]['syncVarSet']=function(_0x4c6930){try{if(this[_0xd963('0x22')](_0x4c6930)){this[_0xd963('0x59')](_0x4c6930['uniqueid'],_[_0xd963('0x5a')](_0x4c6930[_0xd963('0x5b')])[0x0],_0x4c6930[_0xd963('0x5c')]);if(this[_0xd963('0x8')][_0x4c6930[_0xd963('0x23')]]){for(var _0x380b38 in this[_0xd963('0x8')][_0x4c6930['uniqueid']]){if(this['channels'][_0x4c6930[_0xd963('0x23')]][_0xd963('0x35')](_0x380b38)){if(_[_0xd963('0x21')](this['channels'][_0x4c6930[_0xd963('0x23')]][_0x380b38]['variables'])){this[_0xd963('0x8')][_0x4c6930['uniqueid']][_0x380b38][_0xd963('0xb')]={};}this[_0xd963('0x8')][_0x4c6930[_0xd963('0x23')]][_0x380b38][_0xd963('0xb')]=this[_0xd963('0xb')][_0x4c6930[_0xd963('0x23')]];}}}}}catch(_0x4cf232){logger[_0xd963('0x32')](_0xd963('0x5d'),util[_0xd963('0x34')](_0x4cf232,{'showHidden':![],'depth':null}));}};VoiceAgentReport[_0xd963('0x20')]['addVariable']=function(_0x41f95f,_0x2e5c48,_0x198e3f){var _0x5e4f80=['rtpaudioqos',_0xd963('0x5e'),_0xd963('0x5f'),_0xd963('0x60'),'rtpaudioqosloss',_0xd963('0x61'),'rtpaudioqosrtt','rtpaudioqosrttbridged',_0xd963('0x62'),_0xd963('0x63'),_0xd963('0x64'),_0xd963('0x65'),_0xd963('0x66'),_0xd963('0x67'),_0xd963('0x68'),_0xd963('0x69'),'membername','memberpenalty',_0xd963('0x6a')];if(!_[_0xd963('0x6b')](_0x2e5c48)&&!_[_0xd963('0x6c')](_0x5e4f80,_0x2e5c48)){if(_[_0xd963('0x21')](this['variables'][_0x41f95f])){this['variables'][_0x41f95f]={};}this[_0xd963('0xb')][_0x41f95f][_0x2e5c48]=_0x198e3f;}};VoiceAgentReport[_0xd963('0x20')][_0xd963('0x17')]=function(_0x2a54bb){try{if(this[_0xd963('0x22')](_0x2a54bb)){if(this[_0xd963('0x8')][_0x2a54bb[_0xd963('0x23')]]){for(var _0x5ea500 in this[_0xd963('0x8')][_0x2a54bb[_0xd963('0x23')]]){if(this[_0xd963('0x8')][_0x2a54bb[_0xd963('0x23')]]['hasOwnProperty'](_0x5ea500)){if(this[_0xd963('0x8')][_0x2a54bb[_0xd963('0x23')]][_0x5ea500][_0xd963('0x44')]=='transfer'&&this[_0xd963('0x8')][_0x2a54bb[_0xd963('0x23')]][_0x5ea500][_0xd963('0x13')]){this[_0xd963('0x8')][_0x2a54bb[_0xd963('0x23')]][_0x5ea500][_0xd963('0x51')]=moment()[_0xd963('0x25')]('YYYY-MM-DD\x20HH:mm:ss');}}}ami[_0xd963('0x1f')](_0xd963('0x6d'),_[_0xd963('0x6e')](this['channels'][_0x2a54bb[_0xd963('0x23')]]));delete this[_0xd963('0x8')][_0x2a54bb[_0xd963('0x23')]];}if(this[_0xd963('0xb')][_0x2a54bb[_0xd963('0x23')]]){delete this[_0xd963('0xb')][_0x2a54bb[_0xd963('0x23')]];}}}catch(_0x8d0e94){logger[_0xd963('0x32')]('[syncHangup][VoiceAgentReport]',util[_0xd963('0x34')](_0x8d0e94,{'showHidden':![],'depth':null}));}};VoiceAgentReport['prototype'][_0xd963('0x1d')]=function(_0x4e5f59){try{if(this[_0xd963('0x22')](_0x4e5f59)){if(this[_0xd963('0x8')][_0x4e5f59[_0xd963('0x6f')]]){for(var _0xd79abf in this[_0xd963('0x8')][_0x4e5f59['transfereeuniqueid']]){if(this[_0xd963('0x8')][_0x4e5f59[_0xd963('0x6f')]][_0xd963('0x35')](_0xd79abf)){if(_0x4e5f59[_0xd963('0x70')]===_0xd79abf){var _0x2c7181=moment();this[_0xd963('0x8')][_0x4e5f59[_0xd963('0x6f')]][_0xd79abf][_0xd963('0x13')]=!![];this['channels'][_0x4e5f59['transfereeuniqueid']][_0xd79abf][_0xd963('0x51')]=moment()[_0xd963('0x25')](_0xd963('0x26'));this[_0xd963('0x8')][_0x4e5f59[_0xd963('0x6f')]][_0xd79abf][_0xd963('0x44')]=_0xd963('0x54');this[_0xd963('0x8')][_0x4e5f59[_0xd963('0x6f')]][_0xd79abf][_0xd963('0x37')]='complete';this['channels'][_0x4e5f59[_0xd963('0x6f')]][_0xd79abf]['talktime']=_0x2c7181[_0xd963('0x71')](this[_0xd963('0x8')][_0x4e5f59[_0xd963('0x6f')]][_0xd79abf]['agentconnectAt'],_0xd963('0x72'));}}}}if(this[_0xd963('0x8')][_0x4e5f59[_0xd963('0x73')]]){var _0x5d7602=this[_0xd963('0x8')][_0x4e5f59[_0xd963('0x73')]];this[_0xd963('0x8')][_0x4e5f59[_0xd963('0x73')]]=this['channels'][_0x4e5f59[_0xd963('0x6f')]];this[_0xd963('0x8')][_0x4e5f59[_0xd963('0x6f')]]=_0x5d7602;}}}catch(_0x267006){logger[_0xd963('0x32')](_0xd963('0x74'),util['inspect'](_0x267006,{'showHidden':![],'depth':null}));}};VoiceAgentReport[_0xd963('0x20')][_0xd963('0x75')]=function(_0xd9b9d1){try{if(this[_0xd963('0x22')](_0xd9b9d1)){if(this[_0xd963('0x8')][_0xd9b9d1['transfereeuniqueid']]){for(var _0x26aae6 in this[_0xd963('0x8')][_0xd9b9d1['transfereeuniqueid']]){if(this[_0xd963('0x8')][_0xd9b9d1[_0xd963('0x6f')]][_0xd963('0x35')](_0x26aae6)){if(_0xd9b9d1[_0xd963('0x76')]===_0x26aae6){var _0x3380d0=moment();this[_0xd963('0x8')][_0xd9b9d1[_0xd963('0x6f')]][_0x26aae6]['agentcomplete']=!![];this[_0xd963('0x8')][_0xd9b9d1[_0xd963('0x6f')]][_0x26aae6][_0xd963('0x51')]=_0x3380d0;this['channels'][_0xd9b9d1[_0xd963('0x6f')]][_0x26aae6][_0xd963('0x44')]=_0xd963('0x54');this[_0xd963('0x8')][_0xd9b9d1[_0xd963('0x6f')]][_0x26aae6][_0xd963('0x37')]=_0xd963('0x52');this['channels'][_0xd9b9d1[_0xd963('0x6f')]][_0x26aae6][_0xd963('0x53')]=_0x3380d0[_0xd963('0x71')](this[_0xd963('0x8')][_0xd9b9d1[_0xd963('0x6f')]][_0x26aae6]['agentconnectAt'],_0xd963('0x72'));}}}}}}catch(_0x53093f){logger['error'](_0xd963('0x77'),util[_0xd963('0x34')](_0x53093f,{'showHidden':![],'depth':null}));}};VoiceAgentReport[_0xd963('0x20')]['syncMusicOnHoldStart']=function(_0x4220eb){var _0x423ad2='';try{if(this[_0xd963('0x22')](_0x4220eb)){if(_0x4220eb[_0xd963('0x78')]){_0x423ad2=_0x4220eb['channel'][_0xd963('0x79')](0x0,_0x4220eb[_0xd963('0x78')][_0xd963('0x7a')]('-'));if(this['agents'][_0x423ad2]){this[_0xd963('0xa')][_0x423ad2][_0xd963('0x7b')]=!![];}}}}catch(_0x225b37){logger[_0xd963('0x32')](_0xd963('0x7c'),util[_0xd963('0x34')](_0x225b37,{'showHidden':![],'depth':null}));}};VoiceAgentReport[_0xd963('0x20')][_0xd963('0x1b')]=function(_0x430f7b){var _0x44c13c='';try{if(this[_0xd963('0x22')](_0x430f7b)){if(_0x430f7b['channel']){_0x44c13c=_0x430f7b[_0xd963('0x78')][_0xd963('0x79')](0x0,_0x430f7b[_0xd963('0x78')]['lastIndexOf']('-'));if(this[_0xd963('0xa')][_0x44c13c]){this[_0xd963('0xa')][_0x44c13c][_0xd963('0x7b')]=![];}}}}catch(_0x512bb4){logger[_0xd963('0x32')]('[syncMusicOnHoldStop][VoiceAgentReport]',util[_0xd963('0x34')](_0x512bb4,{'showHidden':![],'depth':null}));}};module[_0xd963('0x7d')]=VoiceAgentReport;
\ No newline at end of file
+var _0x6b98=['destchannelstatedesc','destconnectedlinenum','membername','user:agentconnect','custom:agentconnect','answered_elsewhere','answeredelsewheredestinationuniqueid','answeredelsewheremembername','custom:agentansweredelsewhere','[syncAgentConnect][VoiceAgentReport]','inspect','agentringnoanswerAt','reason','rejected','hasOwnProperty','abandoned','custom:agentqueuecallerabandon','[syncQueueCallerAbandon][VoiceAgentReport]','agentcompleteAt','talktime','transfer','agent','acw','acwtime','interface','user:agentcomplete','custom:agentcomplete','[syncAgentComplete][VoiceAgentReport]','syncVarSet','keys','variable','value','addVariable','rtpaudioqosbridged','rtpaudioqosjitterbridged','rtpaudioqosloss','rtpaudioqoslossbridged','rtpaudioqosrtt','rtpaudioqosrttbridged','sipuri','bridgepeer','bridgepvtcallid','membercalls','memberinterface','memberlastcall','memberrealtime','isNil','custom:voiceAgentReport','[syncHangup][VoiceAgentReport]','syncAttendedTransfer','transfereeuniqueid','origtransfereruniqueid','complete','seconds','secondtransfereruniqueid','[syncAttendedTransfer][VoiceAgentReport]','diff','[syncBlindTransfer][VoiceAgentReport]','syncMusicOnHoldStart','channel','substring','lastIndexOf','onhold','[syncMusicOnHoldStart][VoiceAgentReport]','[syncMusicOnHoldStop][VoiceAgentReport]','lodash','moment','util','../../../config/environment','../../../config/logger','../ami','redis','localhost','socket.io-emitter','voiceQueues','agents','agentcalled','syncAgentCalled','bind','agentconnect','syncAgentConnect','agentringnoanswer','syncAgentRingNoAnswer','queuecallerabandon','syncQueueCallerAbandon','agentcomplete','syncAgentComplete','syncHangup','musiconholdstart','musiconholdstop','syncMusicOnHoldStop','attendedtransfer','blindtransfer','syncBlindTransfer','prototype','emit','isNotNull','isUndefined','channels','uniqueid','destuniqueid','format','YYYY-MM-DD\x20HH:mm:ss','variables','queue','type','inbound','merge','omit','event','privilege','custom:agentcalled','user:%s','user:called','error','[syncAgentCalled][VoiceAgentReport]','agentconnectAt','lastevent','connect','connectedlinename','destchannelstate'];(function(_0x837141,_0x162172){var _0x27338e=function(_0x5889){while(--_0x5889){_0x837141['push'](_0x837141['shift']());}};_0x27338e(++_0x162172);}(_0x6b98,0x133));var _0x86b9=function(_0x32b79a,_0xd2538a){_0x32b79a=_0x32b79a-0x0;var _0x483450=_0x6b98[_0x32b79a];return _0x483450;};'use strict';var _=require(_0x86b9('0x0'));var moment=require(_0x86b9('0x1'));var util=require(_0x86b9('0x2'));var Redis=require('ioredis');var config=require(_0x86b9('0x3'));var logger=require(_0x86b9('0x4'))('ami');var ami=require(_0x86b9('0x5'));config['redis']=_['defaults'](config[_0x86b9('0x6')],{'host':_0x86b9('0x7'),'port':0x18eb});var io=require(_0x86b9('0x8'))(new Redis(config[_0x86b9('0x6')]));function VoiceAgentReport(_0x37e17a){this['channels']={};this[_0x86b9('0x9')]=_0x37e17a[_0x86b9('0x9')];this['agents']=_0x37e17a[_0x86b9('0xa')];this['variables']={};ami['on'](_0x86b9('0xb'),this[_0x86b9('0xc')][_0x86b9('0xd')](this));ami['on'](_0x86b9('0xe'),this[_0x86b9('0xf')][_0x86b9('0xd')](this));ami['on'](_0x86b9('0x10'),this[_0x86b9('0x11')][_0x86b9('0xd')](this));ami['on'](_0x86b9('0x12'),this[_0x86b9('0x13')][_0x86b9('0xd')](this));ami['on'](_0x86b9('0x14'),this[_0x86b9('0x15')][_0x86b9('0xd')](this));ami['on']('varset',this['syncVarSet'][_0x86b9('0xd')](this));ami['on']('hangup',this[_0x86b9('0x16')]['bind'](this));ami['on'](_0x86b9('0x17'),this['syncMusicOnHoldStart'][_0x86b9('0xd')](this));ami['on'](_0x86b9('0x18'),this[_0x86b9('0x19')][_0x86b9('0xd')](this));ami['on'](_0x86b9('0x1a'),this['syncAttendedTransfer'][_0x86b9('0xd')](this));ami['on'](_0x86b9('0x1b'),this[_0x86b9('0x1c')][_0x86b9('0xd')](this));}VoiceAgentReport[_0x86b9('0x1d')][_0x86b9('0x1e')]=function(_0x48e266,_0x25c50a,_0x978369){io['to'](_0x48e266)['emit'](_0x25c50a,_0x978369);};VoiceAgentReport[_0x86b9('0x1d')][_0x86b9('0x1f')]=function(_0xbc4a63){return _0xbc4a63!==null&&!_['isUndefined'](_0xbc4a63);};VoiceAgentReport['prototype'][_0x86b9('0xc')]=function(_0x1d9226){try{if(this[_0x86b9('0x1f')](_0x1d9226)){if(_[_0x86b9('0x20')](this[_0x86b9('0x21')][_0x1d9226['uniqueid']])){this['channels'][_0x1d9226[_0x86b9('0x22')]]={};}if(_[_0x86b9('0x20')](this[_0x86b9('0x21')][_0x1d9226[_0x86b9('0x22')]][_0x1d9226[_0x86b9('0x23')]])){this[_0x86b9('0x21')][_0x1d9226[_0x86b9('0x22')]][_0x1d9226[_0x86b9('0x23')]]={'agentcalledAt':moment()[_0x86b9('0x24')](_0x86b9('0x25')),'lastevent':'called','variables':this[_0x86b9('0x26')][_0x1d9226[_0x86b9('0x22')]],'type':this['voiceQueues'][_0x1d9226['queue']]?this[_0x86b9('0x9')][_0x1d9226[_0x86b9('0x27')]][_0x86b9('0x28')]||_0x86b9('0x29'):_0x86b9('0x29')};}_[_0x86b9('0x2a')](this[_0x86b9('0x21')][_0x1d9226['uniqueid']][_0x1d9226[_0x86b9('0x23')]],_[_0x86b9('0x2b')](_0x1d9226,[_0x86b9('0x2c'),_0x86b9('0x2d')]));ami[_0x86b9('0x1e')](_0x86b9('0x2e'),this[_0x86b9('0x21')][_0x1d9226['uniqueid']][_0x1d9226[_0x86b9('0x23')]]);this[_0x86b9('0x1e')](util[_0x86b9('0x24')](_0x86b9('0x2f'),_0x1d9226['membername']),_0x86b9('0x30'),this['channels'][_0x1d9226[_0x86b9('0x22')]][_0x1d9226['destuniqueid']]);}}catch(_0xb1707f){logger[_0x86b9('0x31')](_0x86b9('0x32'),util['inspect'](_0xb1707f,{'showHidden':![],'depth':null}));}};VoiceAgentReport[_0x86b9('0x1d')][_0x86b9('0xf')]=function(_0x8da56d){try{if(this[_0x86b9('0x1f')](_0x8da56d)){if(this['channels'][_0x8da56d['uniqueid']]){for(var _0x3807f2 in this['channels'][_0x8da56d['uniqueid']]){if(this[_0x86b9('0x21')][_0x8da56d[_0x86b9('0x22')]]['hasOwnProperty'](_0x3807f2)){if(_0x8da56d[_0x86b9('0x23')]===_0x3807f2){this[_0x86b9('0x21')][_0x8da56d[_0x86b9('0x22')]][_0x3807f2][_0x86b9('0x33')]=moment()[_0x86b9('0x24')](_0x86b9('0x25'));this[_0x86b9('0x21')][_0x8da56d['uniqueid']][_0x3807f2][_0x86b9('0x34')]=_0x86b9('0x35');this['channels'][_0x8da56d[_0x86b9('0x22')]][_0x3807f2]['holdtime']=_0x8da56d['holdtime'];this[_0x86b9('0x21')][_0x8da56d['uniqueid']][_0x3807f2]['connectedlinenum']=_0x8da56d['connectedlinenum'];this[_0x86b9('0x21')][_0x8da56d[_0x86b9('0x22')]][_0x3807f2][_0x86b9('0x36')]=_0x8da56d[_0x86b9('0x36')];this['channels'][_0x8da56d[_0x86b9('0x22')]][_0x3807f2][_0x86b9('0x37')]=_0x8da56d['destchannelstate'];this[_0x86b9('0x21')][_0x8da56d['uniqueid']][_0x3807f2][_0x86b9('0x38')]=_0x8da56d[_0x86b9('0x38')];_[_0x86b9('0x2a')](this[_0x86b9('0xa')][_0x8da56d['interface']],_['pick'](_0x8da56d,['queue',_0x86b9('0x39')]));this[_0x86b9('0x1e')](util[_0x86b9('0x24')]('user:%s',_0x8da56d[_0x86b9('0x3a')]),_0x86b9('0x3b'),this[_0x86b9('0x21')][_0x8da56d[_0x86b9('0x22')]][_0x8da56d['destuniqueid']]);ami[_0x86b9('0x1e')](_0x86b9('0x3c'),this['channels'][_0x8da56d[_0x86b9('0x22')]][_0x3807f2]);}else if(!this[_0x86b9('0x21')][_0x8da56d[_0x86b9('0x22')]][_0x3807f2]['agentringnoanswer']&&!this[_0x86b9('0x21')][_0x8da56d[_0x86b9('0x22')]][_0x3807f2]['agentcomplete']){this[_0x86b9('0x21')][_0x8da56d[_0x86b9('0x22')]][_0x3807f2]['agentringnoanswer']=!![];this[_0x86b9('0x21')][_0x8da56d[_0x86b9('0x22')]][_0x3807f2]['agentringnoanswerAt']=moment()[_0x86b9('0x24')](_0x86b9('0x25'));this[_0x86b9('0x21')][_0x8da56d[_0x86b9('0x22')]][_0x3807f2]['reason']='answered_elsewhere';this[_0x86b9('0x21')][_0x8da56d['uniqueid']][_0x3807f2][_0x86b9('0x34')]=_0x86b9('0x3d');this['channels'][_0x8da56d[_0x86b9('0x22')]][_0x3807f2][_0x86b9('0x3e')]=_0x8da56d[_0x86b9('0x23')];this[_0x86b9('0x21')][_0x8da56d[_0x86b9('0x22')]][_0x3807f2][_0x86b9('0x3f')]=_0x8da56d[_0x86b9('0x3a')];ami[_0x86b9('0x1e')](_0x86b9('0x40'),this[_0x86b9('0x21')][_0x8da56d[_0x86b9('0x22')]][_0x3807f2]);}}}}}}catch(_0x11de0c){logger[_0x86b9('0x31')](_0x86b9('0x41'),util[_0x86b9('0x42')](_0x11de0c,{'showHidden':![],'depth':null}));}};VoiceAgentReport['prototype'][_0x86b9('0x11')]=function(_0x2a6d23){try{if(this[_0x86b9('0x1f')](_0x2a6d23)){if(this['channels'][_0x2a6d23[_0x86b9('0x22')]]&&this[_0x86b9('0x21')][_0x2a6d23['uniqueid']][_0x2a6d23[_0x86b9('0x23')]]){this[_0x86b9('0x21')][_0x2a6d23[_0x86b9('0x22')]][_0x2a6d23['destuniqueid']]['agentringnoanswer']=!![];this['channels'][_0x2a6d23['uniqueid']][_0x2a6d23[_0x86b9('0x23')]][_0x86b9('0x43')]=moment()['format'](_0x86b9('0x25'));this['channels'][_0x2a6d23[_0x86b9('0x22')]][_0x2a6d23[_0x86b9('0x23')]][_0x86b9('0x44')]=_0x86b9('0x45');this[_0x86b9('0x21')][_0x2a6d23[_0x86b9('0x22')]][_0x2a6d23['destuniqueid']][_0x86b9('0x34')]=_0x86b9('0x45');ami[_0x86b9('0x1e')]('custom:agentringnoanswer',this[_0x86b9('0x21')][_0x2a6d23[_0x86b9('0x22')]][_0x2a6d23[_0x86b9('0x23')]]);}}}catch(_0x10362b){logger[_0x86b9('0x31')]('[syncAgentRingNoAnswer][VoiceAgentReport]',util[_0x86b9('0x42')](_0x10362b,{'showHidden':![],'depth':null}));}};VoiceAgentReport[_0x86b9('0x1d')][_0x86b9('0x13')]=function(_0x2a77f7){try{if(this[_0x86b9('0x1f')](_0x2a77f7)){if(this['channels'][_0x2a77f7['uniqueid']]){for(var _0x5c9a14 in this[_0x86b9('0x21')][_0x2a77f7[_0x86b9('0x22')]]){if(this['channels'][_0x2a77f7['uniqueid']][_0x86b9('0x46')](_0x5c9a14)&&!this['channels'][_0x2a77f7['uniqueid']][_0x5c9a14][_0x86b9('0x10')]&&!this['channels'][_0x2a77f7[_0x86b9('0x22')]][_0x5c9a14][_0x86b9('0x14')]){this[_0x86b9('0x21')][_0x2a77f7['uniqueid']][_0x5c9a14]['agentringnoanswer']=!![];this[_0x86b9('0x21')][_0x2a77f7[_0x86b9('0x22')]][_0x5c9a14][_0x86b9('0x43')]=moment()[_0x86b9('0x24')](_0x86b9('0x25'));this['channels'][_0x2a77f7['uniqueid']][_0x5c9a14][_0x86b9('0x44')]=_0x86b9('0x47');this[_0x86b9('0x21')][_0x2a77f7[_0x86b9('0x22')]][_0x5c9a14]['lastevent']=_0x86b9('0x47');ami[_0x86b9('0x1e')](_0x86b9('0x48'),this[_0x86b9('0x21')][_0x2a77f7[_0x86b9('0x22')]][_0x5c9a14]);}}}}}catch(_0x254f83){logger[_0x86b9('0x31')](_0x86b9('0x49'),util[_0x86b9('0x42')](_0x254f83,{'showHidden':![],'depth':null}));}};VoiceAgentReport[_0x86b9('0x1d')][_0x86b9('0x15')]=function(_0x49a4dd){try{if(this[_0x86b9('0x1f')](_0x49a4dd)){if(this[_0x86b9('0x21')][_0x49a4dd[_0x86b9('0x22')]]){for(var _0x580f9c in this['channels'][_0x49a4dd[_0x86b9('0x22')]]){if(this[_0x86b9('0x21')][_0x49a4dd[_0x86b9('0x22')]]['hasOwnProperty'](_0x580f9c)){if(this[_0x86b9('0x21')][_0x49a4dd[_0x86b9('0x22')]][_0x580f9c][_0x86b9('0x33')]&&!this[_0x86b9('0x21')][_0x49a4dd[_0x86b9('0x22')]][_0x580f9c][_0x86b9('0x14')]){this['channels'][_0x49a4dd[_0x86b9('0x22')]][_0x580f9c][_0x86b9('0x14')]=!![];this[_0x86b9('0x21')][_0x49a4dd[_0x86b9('0x22')]][_0x580f9c][_0x86b9('0x4a')]=moment()[_0x86b9('0x24')](_0x86b9('0x25'));this[_0x86b9('0x21')][_0x49a4dd[_0x86b9('0x22')]][_0x580f9c][_0x86b9('0x34')]='complete';this[_0x86b9('0x21')][_0x49a4dd['uniqueid']][_0x580f9c][_0x86b9('0x4b')]=_0x49a4dd['talktime'];this[_0x86b9('0x21')][_0x49a4dd['uniqueid']][_0x580f9c][_0x86b9('0x44')]=_0x49a4dd[_0x86b9('0x44')]==_0x86b9('0x4c')?_0x86b9('0x4d'):_0x49a4dd[_0x86b9('0x44')];if(this[_0x86b9('0x9')][_0x49a4dd[_0x86b9('0x27')]]&&this[_0x86b9('0x9')][_0x49a4dd[_0x86b9('0x27')]][_0x86b9('0x4e')]){this['channels'][_0x49a4dd[_0x86b9('0x22')]][_0x580f9c]['agentacw']=!![];this['channels'][_0x49a4dd[_0x86b9('0x22')]][_0x580f9c][_0x86b9('0x4f')]=this[_0x86b9('0x9')][_0x49a4dd[_0x86b9('0x27')]]['acwTimeout'];}this[_0x86b9('0xa')][_0x49a4dd[_0x86b9('0x50')]]=_[_0x86b9('0x2b')](this['agents'][_0x49a4dd[_0x86b9('0x50')]],[_0x86b9('0x27'),_0x86b9('0x39')]);this[_0x86b9('0x1e')](util[_0x86b9('0x24')](_0x86b9('0x2f'),_0x49a4dd['membername']),_0x86b9('0x51'),this[_0x86b9('0x21')][_0x49a4dd[_0x86b9('0x22')]][_0x580f9c]);ami[_0x86b9('0x1e')](_0x86b9('0x52'),this[_0x86b9('0x21')][_0x49a4dd[_0x86b9('0x22')]][_0x580f9c]);}}}}}}catch(_0x42ca41){logger[_0x86b9('0x31')](_0x86b9('0x53'),util[_0x86b9('0x42')](_0x42ca41,{'showHidden':![],'depth':null}));}};VoiceAgentReport[_0x86b9('0x1d')][_0x86b9('0x54')]=function(_0x4d016b){try{if(this['isNotNull'](_0x4d016b)){this['addVariable'](_0x4d016b['uniqueid'],_[_0x86b9('0x55')](_0x4d016b[_0x86b9('0x56')])[0x0],_0x4d016b[_0x86b9('0x57')]);if(this['channels'][_0x4d016b[_0x86b9('0x22')]]){for(var _0x4cc883 in this[_0x86b9('0x21')][_0x4d016b[_0x86b9('0x22')]]){if(this[_0x86b9('0x21')][_0x4d016b['uniqueid']]['hasOwnProperty'](_0x4cc883)){if(_['isUndefined'](this[_0x86b9('0x21')][_0x4d016b[_0x86b9('0x22')]][_0x4cc883][_0x86b9('0x26')])){this['channels'][_0x4d016b[_0x86b9('0x22')]][_0x4cc883][_0x86b9('0x26')]={};}this[_0x86b9('0x21')][_0x4d016b['uniqueid']][_0x4cc883]['variables']=this[_0x86b9('0x26')][_0x4d016b[_0x86b9('0x22')]];}}}}}catch(_0x2b3fce){logger[_0x86b9('0x31')]('[syncVarSet][VoiceAgentReport]',util['inspect'](_0x2b3fce,{'showHidden':![],'depth':null}));}};VoiceAgentReport[_0x86b9('0x1d')][_0x86b9('0x58')]=function(_0x2ad18a,_0x2921fb,_0xc410ab){var _0x3b4aee=['rtpaudioqos',_0x86b9('0x59'),'rtpaudioqosjitter',_0x86b9('0x5a'),_0x86b9('0x5b'),_0x86b9('0x5c'),_0x86b9('0x5d'),_0x86b9('0x5e'),'sipcallid',_0x86b9('0x5f'),_0x86b9('0x60'),_0x86b9('0x61'),_0x86b9('0x62'),'memberdynamic',_0x86b9('0x63'),_0x86b9('0x64'),'membername','memberpenalty',_0x86b9('0x65')];if(!_[_0x86b9('0x66')](_0x2921fb)&&!_['includes'](_0x3b4aee,_0x2921fb)){if(_[_0x86b9('0x20')](this[_0x86b9('0x26')][_0x2ad18a])){this[_0x86b9('0x26')][_0x2ad18a]={};}this[_0x86b9('0x26')][_0x2ad18a][_0x2921fb]=_0xc410ab;}};VoiceAgentReport[_0x86b9('0x1d')][_0x86b9('0x16')]=function(_0x1e5ab0){try{if(this['isNotNull'](_0x1e5ab0)){if(this[_0x86b9('0x21')][_0x1e5ab0[_0x86b9('0x22')]]){for(var _0x23778a in this[_0x86b9('0x21')][_0x1e5ab0[_0x86b9('0x22')]]){if(this[_0x86b9('0x21')][_0x1e5ab0['uniqueid']][_0x86b9('0x46')](_0x23778a)){if(this['channels'][_0x1e5ab0[_0x86b9('0x22')]][_0x23778a]['reason']==_0x86b9('0x4c')&&this[_0x86b9('0x21')][_0x1e5ab0[_0x86b9('0x22')]][_0x23778a]['agentcomplete']){this['channels'][_0x1e5ab0[_0x86b9('0x22')]][_0x23778a][_0x86b9('0x4a')]=moment()[_0x86b9('0x24')]('YYYY-MM-DD\x20HH:mm:ss');}}}ami[_0x86b9('0x1e')](_0x86b9('0x67'),_['values'](this['channels'][_0x1e5ab0[_0x86b9('0x22')]]));delete this[_0x86b9('0x21')][_0x1e5ab0['uniqueid']];}if(this[_0x86b9('0x26')][_0x1e5ab0['uniqueid']]){delete this[_0x86b9('0x26')][_0x1e5ab0['uniqueid']];}}}catch(_0x371a94){logger['error'](_0x86b9('0x68'),util[_0x86b9('0x42')](_0x371a94,{'showHidden':![],'depth':null}));}};VoiceAgentReport[_0x86b9('0x1d')][_0x86b9('0x69')]=function(_0x45cd35){try{if(this[_0x86b9('0x1f')](_0x45cd35)){if(this[_0x86b9('0x21')][_0x45cd35[_0x86b9('0x6a')]]){for(var _0x7011d1 in this[_0x86b9('0x21')][_0x45cd35[_0x86b9('0x6a')]]){if(this[_0x86b9('0x21')][_0x45cd35[_0x86b9('0x6a')]][_0x86b9('0x46')](_0x7011d1)){if(_0x45cd35[_0x86b9('0x6b')]===_0x7011d1){var _0x41d358=moment();this[_0x86b9('0x21')][_0x45cd35['transfereeuniqueid']][_0x7011d1][_0x86b9('0x14')]=!![];this['channels'][_0x45cd35[_0x86b9('0x6a')]][_0x7011d1]['agentcompleteAt']=moment()['format'](_0x86b9('0x25'));this['channels'][_0x45cd35[_0x86b9('0x6a')]][_0x7011d1]['reason']=_0x86b9('0x4c');this[_0x86b9('0x21')][_0x45cd35[_0x86b9('0x6a')]][_0x7011d1][_0x86b9('0x34')]=_0x86b9('0x6c');this['channels'][_0x45cd35[_0x86b9('0x6a')]][_0x7011d1][_0x86b9('0x4b')]=_0x41d358['diff'](this['channels'][_0x45cd35[_0x86b9('0x6a')]][_0x7011d1]['agentconnectAt'],_0x86b9('0x6d'));}}}}if(this[_0x86b9('0x21')][_0x45cd35[_0x86b9('0x6e')]]){var _0x319757=this[_0x86b9('0x21')][_0x45cd35[_0x86b9('0x6e')]];this[_0x86b9('0x21')][_0x45cd35[_0x86b9('0x6e')]]=this['channels'][_0x45cd35[_0x86b9('0x6a')]];this[_0x86b9('0x21')][_0x45cd35['transfereeuniqueid']]=_0x319757;}}}catch(_0x151330){logger['error'](_0x86b9('0x6f'),util[_0x86b9('0x42')](_0x151330,{'showHidden':![],'depth':null}));}};VoiceAgentReport[_0x86b9('0x1d')]['syncBlindTransfer']=function(_0x50b4dc){try{if(this[_0x86b9('0x1f')](_0x50b4dc)){if(this[_0x86b9('0x21')][_0x50b4dc[_0x86b9('0x6a')]]){for(var _0x24ea1d in this[_0x86b9('0x21')][_0x50b4dc[_0x86b9('0x6a')]]){if(this[_0x86b9('0x21')][_0x50b4dc[_0x86b9('0x6a')]][_0x86b9('0x46')](_0x24ea1d)){if(_0x50b4dc['transfereruniqueid']===_0x24ea1d){var _0x2153ac=moment();this[_0x86b9('0x21')][_0x50b4dc[_0x86b9('0x6a')]][_0x24ea1d]['agentcomplete']=!![];this[_0x86b9('0x21')][_0x50b4dc['transfereeuniqueid']][_0x24ea1d][_0x86b9('0x4a')]=_0x2153ac;this[_0x86b9('0x21')][_0x50b4dc[_0x86b9('0x6a')]][_0x24ea1d][_0x86b9('0x44')]=_0x86b9('0x4c');this[_0x86b9('0x21')][_0x50b4dc[_0x86b9('0x6a')]][_0x24ea1d][_0x86b9('0x34')]=_0x86b9('0x6c');this['channels'][_0x50b4dc['transfereeuniqueid']][_0x24ea1d][_0x86b9('0x4b')]=_0x2153ac[_0x86b9('0x70')](this[_0x86b9('0x21')][_0x50b4dc['transfereeuniqueid']][_0x24ea1d][_0x86b9('0x33')],_0x86b9('0x6d'));}}}}}}catch(_0x5b4c2f){logger[_0x86b9('0x31')](_0x86b9('0x71'),util['inspect'](_0x5b4c2f,{'showHidden':![],'depth':null}));}};VoiceAgentReport[_0x86b9('0x1d')][_0x86b9('0x72')]=function(_0xf6ff0c){var _0x254eb1='';try{if(this[_0x86b9('0x1f')](_0xf6ff0c)){if(_0xf6ff0c[_0x86b9('0x73')]){_0x254eb1=_0xf6ff0c[_0x86b9('0x73')][_0x86b9('0x74')](0x0,_0xf6ff0c[_0x86b9('0x73')][_0x86b9('0x75')]('-'));if(this[_0x86b9('0xa')][_0x254eb1]){this[_0x86b9('0xa')][_0x254eb1][_0x86b9('0x76')]=!![];}}}}catch(_0x40cfab){logger[_0x86b9('0x31')](_0x86b9('0x77'),util[_0x86b9('0x42')](_0x40cfab,{'showHidden':![],'depth':null}));}};VoiceAgentReport[_0x86b9('0x1d')][_0x86b9('0x19')]=function(_0x331d80){var _0x3de8f4='';try{if(this[_0x86b9('0x1f')](_0x331d80)){if(_0x331d80[_0x86b9('0x73')]){_0x3de8f4=_0x331d80[_0x86b9('0x73')][_0x86b9('0x74')](0x0,_0x331d80[_0x86b9('0x73')][_0x86b9('0x75')]('-'));if(this[_0x86b9('0xa')][_0x3de8f4]){this[_0x86b9('0xa')][_0x3de8f4][_0x86b9('0x76')]=![];}}}}catch(_0x3259f0){logger['error'](_0x86b9('0x78'),util['inspect'](_0x3259f0,{'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 16f28bb..4ca796d 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 _0xcd28=['merge','pick','[syncNewCallerId][VoiceCallReport]','channel','starttime','format','YYYY-MM-DD\x20HH:mm:ss','channelstate','context','from-sip','split','destconnectedlinenum','exten','user:agentconnect','accountcode','error','[syncNewChannel][VoiceCallReport]','inspect','OutgoingSpoolFailed','application','toLowerCase','applicationdata','appdata','duration','subtract','seconds','disposition','keys','includes','lastapplication','lastdata','cdr(','match','answered','holdtime','diff','calleridnum','connectedlinenum','connectedlinename','calleridname','toNumber','UserId','membername','name','[syncNewState][VoiceCallReport]','syncMixMonitorFilename','monitor','endsWith','.wav49','replace','.WAV','monitorFilename','find','isNil','monitors','push','variable','value','xmd-phone','xmd-cdrtype','type','xmd-queue','xmd-originatecalleridnum','xmcs-queue','sipcalluniqueid','mixmonitor_filename','parse','sipcallid','[syncVarSet][VoiceCallReport]','billableseconds','answertime','omit','user:agentcomplete','custom:voiceCallReport','[syncHangup][VoiceCallReport]','transfereeuniqueid','transfercalleridnum','transfertargetcalleridnum','secondtransfereruniqueid','transfertargetuniqueid','origtransferercalleridnum','transferconnectedlinenum','origtransfereruniqueid','[syncAttendedTransfer][VoiceCallReport]','transfereecalleridnum','extension','BlindTransfer','transfererchannel','[syncBlindTransfer][VoiceCallReport]','[syncMusicOnHoldStart][VoiceCallReport]','syncMusicOnHoldStop','mohstarttime','milliseconds','[syncMusicOnHoldStop][VoiceCallReport]','lodash','moment','util','path','ioredis','../../../config/environment','../../../config/logger','ami','../ami','../model/channel','unknown','not_inuse','inuse','invalid','unavailable','ringing','ringinuse','onhold','set','queue','agi','dial','playback','voicemail','NO\x20ANSWER','FAILED','ANSWERED','BUSY','redis','defaults','localhost','channels','agents','coreshowchannel','syncNewExten','bind','newexten','newchannel','syncNewChannel','syncNewState','syncVarSet','hangup','syncHangup','newcallerid','syncNewCallerId','syncAttendedTransfer','syncBlindTransfer','musiconholdstart','syncMusicOnHoldStart','musiconholdstop','catch','isNotNull','isUndefined','prototype','emit','uniqueid','linkedid'];(function(_0x174fe9,_0xb622a9){var _0x23c489=function(_0x256f8f){while(--_0x256f8f){_0x174fe9['push'](_0x174fe9['shift']());}};_0x23c489(++_0xb622a9);}(_0xcd28,0x18c));var _0x8cd2=function(_0x5b0594,_0x22c785){_0x5b0594=_0x5b0594-0x0;var _0x1e9575=_0xcd28[_0x5b0594];return _0x1e9575;};'use strict';var BPromise=require('bluebird');var _=require(_0x8cd2('0x0'));var moment=require(_0x8cd2('0x1'));var util=require(_0x8cd2('0x2'));var path=require(_0x8cd2('0x3'));var Redis=require(_0x8cd2('0x4'));var config=require(_0x8cd2('0x5'));var logger=require(_0x8cd2('0x6'))(_0x8cd2('0x7'));var ami=require(_0x8cd2('0x8'));var Channel=require(_0x8cd2('0x9'));var statusDesc=[_0x8cd2('0xa'),_0x8cd2('0xb'),_0x8cd2('0xc'),'busy',_0x8cd2('0xd'),_0x8cd2('0xe'),_0x8cd2('0xf'),_0x8cd2('0x10'),_0x8cd2('0x11')];var applications=[_0x8cd2('0x12'),_0x8cd2('0x13'),_0x8cd2('0x14'),_0x8cd2('0x15'),_0x8cd2('0x16'),_0x8cd2('0x17')];var dispositions=[_0x8cd2('0x18'),_0x8cd2('0x19'),_0x8cd2('0x19'),'NO\x20ANSWER',_0x8cd2('0x18'),_0x8cd2('0x18'),_0x8cd2('0x1a'),_0x8cd2('0x1b'),'FAILED',_0x8cd2('0x19'),_0x8cd2('0x19')];var actions={};config[_0x8cd2('0x1c')]=_[_0x8cd2('0x1d')](config[_0x8cd2('0x1c')],{'host':_0x8cd2('0x1e'),'port':0x18eb});var io=require('socket.io-emitter')(new Redis(config['redis']));function VoiceCallReport(_0x46add9){this['channels']=_0x46add9[_0x8cd2('0x1f')];this[_0x8cd2('0x20')]=_0x46add9[_0x8cd2('0x20')];ami['on'](_0x8cd2('0x21'),this[_0x8cd2('0x22')][_0x8cd2('0x23')](this));ami['on'](_0x8cd2('0x24'),this[_0x8cd2('0x22')][_0x8cd2('0x23')](this));ami['on'](_0x8cd2('0x25'),this[_0x8cd2('0x26')]['bind'](this));ami['on']('newstate',this[_0x8cd2('0x27')]['bind'](this));ami['on']('varset',this[_0x8cd2('0x28')][_0x8cd2('0x23')](this));ami['on'](_0x8cd2('0x29'),this[_0x8cd2('0x2a')][_0x8cd2('0x23')](this));ami['on'](_0x8cd2('0x2b'),this[_0x8cd2('0x2c')][_0x8cd2('0x23')](this));ami['on']('attendedtransfer',this[_0x8cd2('0x2d')][_0x8cd2('0x23')](this));ami['on']('blindtransfer',this[_0x8cd2('0x2e')]['bind'](this));ami['on'](_0x8cd2('0x2f'),this[_0x8cd2('0x30')][_0x8cd2('0x23')](this));ami['on'](_0x8cd2('0x31'),this['syncMusicOnHoldStop']['bind'](this));return BPromise['resolve']()['then'](ami['actionCoreShowChannels']())[_0x8cd2('0x32')](function(_0x5cb33d){console['log'](_0x5cb33d);});}VoiceCallReport['prototype'][_0x8cd2('0x33')]=function(_0x684d7){return _0x684d7!==null&&!_[_0x8cd2('0x34')](_0x684d7);};VoiceCallReport[_0x8cd2('0x35')][_0x8cd2('0x36')]=function(_0x56e64d,_0x16cef7,_0x595ceb){io['to'](_0x56e64d)['emit'](_0x16cef7,_0x595ceb);};VoiceCallReport[_0x8cd2('0x35')][_0x8cd2('0x2c')]=function(_0x52caee){try{if(this['isNotNull'](_0x52caee)){if(_0x52caee[_0x8cd2('0x37')]===_0x52caee[_0x8cd2('0x38')]){if(!_[_0x8cd2('0x34')](this[_0x8cd2('0x1f')][_0x52caee['uniqueid']])){_[_0x8cd2('0x39')](this[_0x8cd2('0x1f')][_0x52caee[_0x8cd2('0x37')]],_[_0x8cd2('0x3a')](_0x52caee,_['keys'](this['channels'][_0x52caee[_0x8cd2('0x37')]])));}}}}catch(_0x104fbc){logger['error'](_0x8cd2('0x3b'),util['inspect'](_0x104fbc,{'showHidden':![],'depth':null}));}};VoiceCallReport[_0x8cd2('0x35')][_0x8cd2('0x26')]=function(_0x153c48){try{if(this[_0x8cd2('0x33')](_0x153c48)){if(_0x153c48['uniqueid']===_0x153c48[_0x8cd2('0x38')]&&_0x153c48[_0x8cd2('0x3c')]!='OutgoingSpoolFailed'){if(_[_0x8cd2('0x34')](this[_0x8cd2('0x1f')][_0x153c48[_0x8cd2('0x37')]])){this[_0x8cd2('0x1f')][_0x153c48[_0x8cd2('0x37')]]=new Channel();this[_0x8cd2('0x1f')][_0x153c48['uniqueid']][_0x8cd2('0x3d')]=moment()[_0x8cd2('0x3e')](_0x8cd2('0x3f'));this[_0x8cd2('0x1f')][_0x153c48[_0x8cd2('0x37')]]['disposition']=dispositions[_['toNumber'](_0x153c48[_0x8cd2('0x40')])];_[_0x8cd2('0x39')](this[_0x8cd2('0x1f')][_0x153c48[_0x8cd2('0x37')]],_[_0x8cd2('0x3a')](_0x153c48,_['keys'](this[_0x8cd2('0x1f')][_0x153c48[_0x8cd2('0x37')]])));if(_0x153c48[_0x8cd2('0x41')]===_0x8cd2('0x42')){if(this['agents'][_0x153c48['channel'][_0x8cd2('0x43')]('-')[0x0]]){this['agents'][_0x153c48['channel'][_0x8cd2('0x43')]('-')[0x0]][_0x8cd2('0x44')]=_0x153c48[_0x8cd2('0x45')];this['emit'](util[_0x8cd2('0x3e')]('user:%s',this['agents'][_0x153c48['channel'][_0x8cd2('0x43')]('-')[0x0]]['name']),_0x8cd2('0x46'),{'destaccountcode':this[_0x8cd2('0x20')][_0x153c48[_0x8cd2('0x3c')][_0x8cd2('0x43')]('-')[0x0]][_0x8cd2('0x47')],'destconnectedlinenum':_0x153c48[_0x8cd2('0x45')]});}}}}}}catch(_0x1133dd){logger[_0x8cd2('0x48')](_0x8cd2('0x49'),util[_0x8cd2('0x4a')](_0x1133dd,{'showHidden':![],'depth':null}));}};VoiceCallReport['prototype'][_0x8cd2('0x22')]=function(_0x44471f){try{if(this[_0x8cd2('0x33')](_0x44471f)){if(_0x44471f[_0x8cd2('0x37')]===_0x44471f[_0x8cd2('0x38')]&&_0x44471f[_0x8cd2('0x45')]!='h'&&_0x44471f[_0x8cd2('0x3c')]!=_0x8cd2('0x4b')){_0x44471f[_0x8cd2('0x4c')]=_0x44471f[_0x8cd2('0x4c')][_0x8cd2('0x4d')]();_0x44471f[_0x8cd2('0x4e')]=(_0x44471f[_0x8cd2('0x4f')]||_0x44471f[_0x8cd2('0x4e')])[_0x8cd2('0x4d')]();if(_['isUndefined'](this[_0x8cd2('0x1f')][_0x44471f[_0x8cd2('0x37')]])){this[_0x8cd2('0x1f')][_0x44471f[_0x8cd2('0x37')]]=new Channel();this[_0x8cd2('0x1f')][_0x44471f[_0x8cd2('0x37')]]['starttime']=_0x44471f[_0x8cd2('0x50')]?moment()[_0x8cd2('0x51')](moment[_0x8cd2('0x50')](_0x44471f[_0x8cd2('0x50')])['seconds'](),_0x8cd2('0x52'))[_0x8cd2('0x3e')](_0x8cd2('0x3f')):moment()['format'](_0x8cd2('0x3f'));this[_0x8cd2('0x1f')][_0x44471f['uniqueid']][_0x8cd2('0x53')]=_0x8cd2('0x18');}_['merge'](this[_0x8cd2('0x1f')][_0x44471f[_0x8cd2('0x37')]],_['pick'](_0x44471f,_[_0x8cd2('0x54')](this[_0x8cd2('0x1f')][_0x44471f[_0x8cd2('0x37')]])));if(_[_0x8cd2('0x55')](applications,_0x44471f[_0x8cd2('0x4c')])){this[_0x8cd2('0x1f')][_0x44471f[_0x8cd2('0x37')]][_0x8cd2('0x56')]=_0x44471f[_0x8cd2('0x4c')];this[_0x8cd2('0x1f')][_0x44471f[_0x8cd2('0x37')]][_0x8cd2('0x57')]=_0x44471f['applicationdata'];if(_0x44471f['application']===_0x8cd2('0x12')&&_['startsWith'](_0x44471f['applicationdata'],_0x8cd2('0x58'))){var _0x52ebb3=_0x44471f[_0x8cd2('0x4e')][_0x8cd2('0x43')]('=');var _0x239718=_0x52ebb3[0x0][_0x8cd2('0x59')](/cdr\((.*)\)/);if(_0x239718){this[_0x8cd2('0x1f')][_0x44471f['uniqueid']][_0x239718[0x1]]=_0x52ebb3[0x1];}}else if(_0x44471f['application']===_0x8cd2('0x13')){this[_0x8cd2('0x1f')][_0x44471f['uniqueid']]['queue']=_0x44471f[_0x8cd2('0x4e')][_0x8cd2('0x43')](',')[0x0];}}}}}catch(_0x286d19){logger['error']('[syncNewExten][VoiceCallReport]',util['inspect'](_0x286d19,{'showHidden':![],'depth':null}));}};VoiceCallReport[_0x8cd2('0x35')][_0x8cd2('0x27')]=function(_0x26618a){try{if(this[_0x8cd2('0x33')](_0x26618a)){if(_0x26618a[_0x8cd2('0x37')]!==_0x26618a[_0x8cd2('0x38')]){if(this['channels'][_0x26618a[_0x8cd2('0x38')]]){if(_0x26618a[_0x8cd2('0x40')]==='6'){if(!this[_0x8cd2('0x1f')][_0x26618a[_0x8cd2('0x38')]]['answered']){var _0x16b5df=moment();this[_0x8cd2('0x1f')][_0x26618a['linkedid']][_0x8cd2('0x5a')]=!![];this[_0x8cd2('0x1f')][_0x26618a[_0x8cd2('0x38')]]['answertime']=_0x16b5df[_0x8cd2('0x3e')]('YYYY-MM-DD\x20HH:mm:ss');if(this[_0x8cd2('0x1f')][_0x26618a[_0x8cd2('0x38')]][_0x8cd2('0x3d')]){this[_0x8cd2('0x1f')][_0x26618a[_0x8cd2('0x38')]][_0x8cd2('0x5b')]=_0x16b5df[_0x8cd2('0x5c')](this[_0x8cd2('0x1f')][_0x26618a[_0x8cd2('0x38')]]['starttime'],_0x8cd2('0x52'));}}this[_0x8cd2('0x1f')][_0x26618a[_0x8cd2('0x38')]][_0x8cd2('0x38')]=_0x26618a[_0x8cd2('0x37')];if(_0x26618a[_0x8cd2('0x5d')]!=='xcally-motion-preview'){this[_0x8cd2('0x1f')][_0x26618a[_0x8cd2('0x38')]][_0x8cd2('0x5e')]=_0x26618a[_0x8cd2('0x5d')];}this[_0x8cd2('0x1f')][_0x26618a[_0x8cd2('0x38')]][_0x8cd2('0x5f')]=_0x26618a[_0x8cd2('0x60')];this['channels'][_0x26618a[_0x8cd2('0x38')]]['destinationchannel']=_0x26618a[_0x8cd2('0x3c')];this['channels'][_0x26618a[_0x8cd2('0x38')]][_0x8cd2('0x53')]=dispositions[_[_0x8cd2('0x61')](_0x26618a[_0x8cd2('0x40')])];if(this[_0x8cd2('0x20')][_0x26618a['channel'][_0x8cd2('0x43')]('-')[0x0]]){this[_0x8cd2('0x1f')][_0x26618a[_0x8cd2('0x38')]][_0x8cd2('0x62')]=this[_0x8cd2('0x20')][_0x26618a[_0x8cd2('0x3c')][_0x8cd2('0x43')]('-')[0x0]]['id'];this['channels'][_0x26618a[_0x8cd2('0x38')]]['membername']=this[_0x8cd2('0x20')][_0x26618a[_0x8cd2('0x3c')][_0x8cd2('0x43')]('-')[0x0]]['name'];}}}}else{if(this[_0x8cd2('0x1f')][_0x26618a['uniqueid']]){if(_0x26618a['channelstate']==='6'){if(this['agents'][_0x26618a[_0x8cd2('0x3c')]['split']('-')[0x0]]){this[_0x8cd2('0x1f')][_0x26618a['uniqueid']]['UserId']=this['agents'][_0x26618a[_0x8cd2('0x3c')]['split']('-')[0x0]]['id'];this['channels'][_0x26618a[_0x8cd2('0x37')]][_0x8cd2('0x63')]=this[_0x8cd2('0x20')][_0x26618a[_0x8cd2('0x3c')][_0x8cd2('0x43')]('-')[0x0]][_0x8cd2('0x64')];}}}}}}catch(_0x22c727){logger[_0x8cd2('0x48')](_0x8cd2('0x65'),util[_0x8cd2('0x4a')](_0x22c727,{'showHidden':![],'depth':null}));}};VoiceCallReport['prototype'][_0x8cd2('0x66')]=function(_0x1e81a0,_0x41a0ff){if(this[_0x8cd2('0x1f')][_0x1e81a0]){this[_0x8cd2('0x1f')][_0x1e81a0][_0x8cd2('0x67')]=!![];if(_[_0x8cd2('0x68')](_0x41a0ff,_0x8cd2('0x69'))){_0x41a0ff=_0x41a0ff[_0x8cd2('0x6a')]('.wav49',_0x8cd2('0x6b'));}this[_0x8cd2('0x1f')][_0x1e81a0][_0x8cd2('0x6c')]=_0x41a0ff;var _0x4f2ae=_[_0x8cd2('0x6d')](this[_0x8cd2('0x1f')][_0x1e81a0]['monitors'],{'filename':_0x41a0ff});if(_[_0x8cd2('0x6e')](_0x4f2ae)){this['channels'][_0x1e81a0][_0x8cd2('0x6f')][_0x8cd2('0x70')]({'filename':_0x41a0ff,'createdAt':moment()['format'](_0x8cd2('0x3f')),'mixmonitorid':'','status':'rec'});}}};VoiceCallReport[_0x8cd2('0x35')][_0x8cd2('0x28')]=function(_0x151496){try{if(this[_0x8cd2('0x33')](_0x151496)){if(this['channels'][_0x151496[_0x8cd2('0x37')]]&&_0x151496[_0x8cd2('0x3c')]!=_0x8cd2('0x4b')){if(this['isNotNull'](_0x151496['variable'])){if(this['isNotNull'](_0x151496[_0x8cd2('0x71')]['mixmonitor_filename'])){this[_0x8cd2('0x66')](_0x151496[_0x8cd2('0x37')],_0x151496[_0x8cd2('0x72')]);}else if(this[_0x8cd2('0x33')](_0x151496[_0x8cd2('0x71')][_0x8cd2('0x73')])){this[_0x8cd2('0x1f')][_0x151496[_0x8cd2('0x37')]]['calleridnum']=_0x151496[_0x8cd2('0x72')];}else if(this[_0x8cd2('0x33')](_0x151496[_0x8cd2('0x71')]['xmd-callerid'])){this[_0x8cd2('0x1f')][_0x151496[_0x8cd2('0x37')]]['callerid']=_0x151496[_0x8cd2('0x72')];}else if(this[_0x8cd2('0x33')](_0x151496[_0x8cd2('0x71')][_0x8cd2('0x74')])){this[_0x8cd2('0x1f')][_0x151496[_0x8cd2('0x37')]][_0x8cd2('0x75')]=_0x151496[_0x8cd2('0x72')];}else if(this[_0x8cd2('0x33')](_0x151496[_0x8cd2('0x71')][_0x8cd2('0x76')])){this[_0x8cd2('0x1f')][_0x151496[_0x8cd2('0x37')]][_0x8cd2('0x13')]=_0x151496[_0x8cd2('0x72')][_0x8cd2('0x43')](',')[0x0];}else if(this[_0x8cd2('0x33')](_0x151496['variable'][_0x8cd2('0x77')])){this[_0x8cd2('0x1f')][_0x151496[_0x8cd2('0x37')]]['originatecalleridnum']=_0x151496['value'];}else if(this['isNotNull'](_0x151496[_0x8cd2('0x71')]['xmd-destination'])){this[_0x8cd2('0x1f')][_0x151496[_0x8cd2('0x37')]]['destination']=_0x151496[_0x8cd2('0x72')];}else if(this[_0x8cd2('0x33')](_0x151496[_0x8cd2('0x71')]['xmd-callerid-preview'])){this[_0x8cd2('0x1f')][_0x151496[_0x8cd2('0x37')]]['calleridpreview']=_0x151496['value'];}else if(this[_0x8cd2('0x33')](_0x151496[_0x8cd2('0x71')][_0x8cd2('0x78')])){this[_0x8cd2('0x1f')][_0x151496[_0x8cd2('0x37')]][_0x8cd2('0x13')]=_0x151496['value'];}else if(this[_0x8cd2('0x33')](_0x151496[_0x8cd2('0x71')]['sipcallid'])){this['channels'][_0x151496['uniqueid']][_0x8cd2('0x79')]=_0x151496[_0x8cd2('0x72')];}}}else if(this[_0x8cd2('0x33')](_0x151496['variable'][_0x8cd2('0x7a')])){if(_0x151496['value']){var _0x3c44f7=path[_0x8cd2('0x7b')](_0x151496[_0x8cd2('0x72')])[_0x8cd2('0x64')];this['syncMixMonitorFilename'](_0x3c44f7,_0x151496['value']);}}else if(this[_0x8cd2('0x1f')][_0x151496[_0x8cd2('0x38')]]){if(this[_0x8cd2('0x33')](_0x151496[_0x8cd2('0x71')])){if(this[_0x8cd2('0x33')](_0x151496['variable'][_0x8cd2('0x7c')])){this[_0x8cd2('0x1f')][_0x151496['linkedid']]['sipcalllinkedid']=_0x151496[_0x8cd2('0x72')];}}}}}catch(_0x27c0bb){logger[_0x8cd2('0x48')](_0x8cd2('0x7d'),util[_0x8cd2('0x4a')](_0x27c0bb,{'showHidden':![],'depth':null}));}};VoiceCallReport[_0x8cd2('0x35')]['syncHangup']=function(_0x3cabd4){try{if(this[_0x8cd2('0x33')](_0x3cabd4)){if(this[_0x8cd2('0x1f')][_0x3cabd4[_0x8cd2('0x37')]]){var _0x36954c=moment();this[_0x8cd2('0x1f')][_0x3cabd4[_0x8cd2('0x37')]]['endtime']=_0x36954c['format']('YYYY-MM-DD\x20HH:mm:ss');this[_0x8cd2('0x1f')][_0x3cabd4[_0x8cd2('0x37')]][_0x8cd2('0x50')]=_0x36954c[_0x8cd2('0x5c')](this['channels'][_0x3cabd4[_0x8cd2('0x37')]][_0x8cd2('0x3d')],_0x8cd2('0x52'));if(this['channels'][_0x3cabd4[_0x8cd2('0x37')]]['answered']){this[_0x8cd2('0x1f')][_0x3cabd4[_0x8cd2('0x37')]][_0x8cd2('0x7e')]=_0x36954c[_0x8cd2('0x5c')](this[_0x8cd2('0x1f')][_0x3cabd4['uniqueid']][_0x8cd2('0x7f')],_0x8cd2('0x52'));this[_0x8cd2('0x1f')][_0x3cabd4[_0x8cd2('0x37')]][_0x8cd2('0x5b')]=this[_0x8cd2('0x1f')][_0x3cabd4[_0x8cd2('0x37')]][_0x8cd2('0x50')]-this[_0x8cd2('0x1f')][_0x3cabd4['uniqueid']][_0x8cd2('0x7e')];}if(_0x3cabd4[_0x8cd2('0x41')]===_0x8cd2('0x42')){if(this[_0x8cd2('0x20')][_0x3cabd4[_0x8cd2('0x3c')]['split']('-')[0x0]]){this[_0x8cd2('0x20')][_0x3cabd4['channel'][_0x8cd2('0x43')]('-')[0x0]]=_[_0x8cd2('0x80')](this['agents'][_0x3cabd4[_0x8cd2('0x3c')][_0x8cd2('0x43')]('-')[0x0]],[_0x8cd2('0x44')]);this[_0x8cd2('0x36')](util[_0x8cd2('0x3e')]('user:%s',this['agents'][_0x3cabd4[_0x8cd2('0x3c')][_0x8cd2('0x43')]('-')[0x0]][_0x8cd2('0x64')]),_0x8cd2('0x81'),{'destaccountcode':this[_0x8cd2('0x20')][_0x3cabd4['channel']['split']('-')[0x0]][_0x8cd2('0x47')]});}}ami[_0x8cd2('0x36')](_0x8cd2('0x82'),this[_0x8cd2('0x1f')][_0x3cabd4['uniqueid']]);delete this[_0x8cd2('0x1f')][_0x3cabd4['uniqueid']];}}}catch(_0x58d025){logger['error'](_0x8cd2('0x83'),util[_0x8cd2('0x4a')](_0x58d025,{'showHidden':![],'depth':null}));}};VoiceCallReport[_0x8cd2('0x35')][_0x8cd2('0x2d')]=function(_0x5d135c){try{if(this['isNotNull'](_0x5d135c)){if(this[_0x8cd2('0x1f')][_0x5d135c[_0x8cd2('0x84')]]){this[_0x8cd2('0x1f')][_0x5d135c[_0x8cd2('0x84')]][_0x8cd2('0x85')]=_0x5d135c['origtransferercalleridnum'];this[_0x8cd2('0x1f')][_0x5d135c[_0x8cd2('0x84')]]['transferconnectedlinenum']=_0x5d135c[_0x8cd2('0x86')];if(this[_0x8cd2('0x1f')][_0x5d135c['secondtransfereruniqueid']]){var _0x236239=this[_0x8cd2('0x1f')][_0x5d135c[_0x8cd2('0x87')]];this[_0x8cd2('0x1f')][_0x5d135c[_0x8cd2('0x87')]]=this['channels'][_0x5d135c[_0x8cd2('0x84')]];this[_0x8cd2('0x1f')][_0x5d135c['transfereeuniqueid']]=_0x236239;}}else if(this[_0x8cd2('0x1f')][_0x5d135c[_0x8cd2('0x88')]]){this[_0x8cd2('0x1f')][_0x5d135c[_0x8cd2('0x88')]]['transfercalleridnum']=_0x5d135c[_0x8cd2('0x89')];this[_0x8cd2('0x1f')][_0x5d135c[_0x8cd2('0x88')]][_0x8cd2('0x8a')]=_0x5d135c[_0x8cd2('0x86')];if(this[_0x8cd2('0x1f')][_0x5d135c['origtransfereruniqueid']]){var _0x236239=this['channels'][_0x5d135c[_0x8cd2('0x8b')]];this[_0x8cd2('0x1f')][_0x5d135c[_0x8cd2('0x8b')]]=this[_0x8cd2('0x1f')][_0x5d135c['transfertargetuniqueid']];this['channels'][_0x5d135c[_0x8cd2('0x88')]]=_0x236239;}}}}catch(_0x57d8b0){logger[_0x8cd2('0x48')](_0x8cd2('0x8c'),util['inspect'](_0x57d8b0,{'showHidden':![],'depth':null}));}};VoiceCallReport[_0x8cd2('0x35')][_0x8cd2('0x2e')]=function(_0x4c2a5c){try{if(this[_0x8cd2('0x33')](_0x4c2a5c)){if(this[_0x8cd2('0x1f')][_0x4c2a5c[_0x8cd2('0x84')]]){this[_0x8cd2('0x1f')][_0x4c2a5c[_0x8cd2('0x84')]][_0x8cd2('0x85')]=_0x4c2a5c[_0x8cd2('0x8d')];this['channels'][_0x4c2a5c['transfereeuniqueid']][_0x8cd2('0x8a')]=_0x4c2a5c[_0x8cd2('0x8e')];this['syncHangup']({'event':_0x8cd2('0x8f'),'uniqueid':_0x4c2a5c[_0x8cd2('0x84')],'context':_0x4c2a5c[_0x8cd2('0x41')],'channel':_0x4c2a5c[_0x8cd2('0x90')]});}}}catch(_0x4bd607){logger[_0x8cd2('0x48')](_0x8cd2('0x91'),util[_0x8cd2('0x4a')](_0x4bd607,{'showHidden':![],'depth':null}));}};VoiceCallReport[_0x8cd2('0x35')][_0x8cd2('0x30')]=function(_0x2d7eea){try{if(this[_0x8cd2('0x33')](_0x2d7eea)){if(this[_0x8cd2('0x1f')][_0x2d7eea['uniqueid']]){if(!_[_0x8cd2('0x6e')](this[_0x8cd2('0x1f')][_0x2d7eea['uniqueid']][_0x8cd2('0x7f')])){this[_0x8cd2('0x1f')][_0x2d7eea[_0x8cd2('0x37')]]['mohstarttime']=moment()[_0x8cd2('0x3e')](_0x8cd2('0x3f'));}}}}catch(_0x8e3f1c){logger[_0x8cd2('0x48')](_0x8cd2('0x92'),util[_0x8cd2('0x4a')](_0x8e3f1c,{'showHidden':![],'depth':null}));}};VoiceCallReport[_0x8cd2('0x35')][_0x8cd2('0x93')]=function(_0x51a91a){try{if(this[_0x8cd2('0x33')](_0x51a91a)){if(this['channels'][_0x51a91a[_0x8cd2('0x37')]]){if(!_[_0x8cd2('0x6e')](this[_0x8cd2('0x1f')][_0x51a91a[_0x8cd2('0x37')]][_0x8cd2('0x94')])){this[_0x8cd2('0x1f')][_0x51a91a[_0x8cd2('0x37')]]['mohtime']+=moment()[_0x8cd2('0x95')](0x0)[_0x8cd2('0x5c')](this[_0x8cd2('0x1f')][_0x51a91a[_0x8cd2('0x37')]][_0x8cd2('0x94')],_0x8cd2('0x52'));delete this[_0x8cd2('0x1f')][_0x51a91a['uniqueid']][_0x8cd2('0x94')];}}}}catch(_0x2a4075){logger[_0x8cd2('0x48')](_0x8cd2('0x96'),util[_0x8cd2('0x4a')](_0x2a4075,{'showHidden':![],'depth':null}));}};module['exports']=VoiceCallReport;
\ No newline at end of file
+var _0x6f54=['holdtime','diff','calleridnum','xcally-motion-preview','connectedlinenum','calleridname','destinationchannel','UserId','membername','syncMixMonitorFilename','monitor','endsWith','.wav49','replace','monitorFilename','find','monitors','rec','value','variable','xmd-callerid','xmd-cdrtype','type','xmd-originatecalleridnum','xmd-destination','destination','calleridpreview','sipcalluniqueid','mixmonitor_filename','parse','sipcallid','sipcalllinkedid','[syncVarSet][VoiceCallReport]','endtime','billableseconds','context','omit','user:agentcomplete','[syncHangup][VoiceCallReport]','transfereeuniqueid','origtransferercalleridnum','transfertargetcalleridnum','secondtransfereruniqueid','transfertargetuniqueid','transfercalleridnum','transferconnectedlinenum','origtransfereruniqueid','transfereecalleridnum','extension','BlindTransfer','isNil','mohstarttime','mohtime','milliseconds','exports','bluebird','lodash','moment','util','path','ioredis','../../../config/logger','ami','not_inuse','inuse','invalid','unavailable','ringing','ringinuse','onhold','queue','agi','voicemail','NO\x20ANSWER','FAILED','BUSY','redis','defaults','localhost','socket.io-emitter','channels','agents','coreshowchannel','syncNewExten','bind','newexten','syncNewState','syncVarSet','hangup','syncHangup','syncNewCallerId','syncAttendedTransfer','syncBlindTransfer','musiconholdstart','syncMusicOnHoldStart','resolve','then','actionCoreShowChannels','catch','log','prototype','isNotNull','isUndefined','emit','linkedid','merge','uniqueid','pick','error','inspect','syncNewChannel','channel','OutgoingSpoolFailed','starttime','format','YYYY-MM-DD\x20HH:mm:ss','disposition','toNumber','channelstate','keys','from-sip','split','destconnectedlinenum','exten','user:%s','name','user:agentconnect','accountcode','application','applicationdata','appdata','toLowerCase','subtract','duration','seconds','includes','lastapplication','set','startsWith','cdr(','match','answered','answertime'];(function(_0x4cae40,_0x42683a){var _0x215770=function(_0x119f25){while(--_0x119f25){_0x4cae40['push'](_0x4cae40['shift']());}};_0x215770(++_0x42683a);}(_0x6f54,0xc6));var _0x46f5=function(_0xe3b89c,_0xa2b63){_0xe3b89c=_0xe3b89c-0x0;var _0xebe0e7=_0x6f54[_0xe3b89c];return _0xebe0e7;};'use strict';var BPromise=require(_0x46f5('0x0'));var _=require(_0x46f5('0x1'));var moment=require(_0x46f5('0x2'));var util=require(_0x46f5('0x3'));var path=require(_0x46f5('0x4'));var Redis=require(_0x46f5('0x5'));var config=require('../../../config/environment');var logger=require(_0x46f5('0x6'))(_0x46f5('0x7'));var ami=require('../ami');var Channel=require('../model/channel');var statusDesc=['unknown',_0x46f5('0x8'),_0x46f5('0x9'),'busy',_0x46f5('0xa'),_0x46f5('0xb'),_0x46f5('0xc'),_0x46f5('0xd'),_0x46f5('0xe')];var applications=['set',_0x46f5('0xf'),_0x46f5('0x10'),'dial','playback',_0x46f5('0x11')];var dispositions=[_0x46f5('0x12'),_0x46f5('0x13'),_0x46f5('0x13'),'NO\x20ANSWER','NO\x20ANSWER',_0x46f5('0x12'),'ANSWERED',_0x46f5('0x14'),_0x46f5('0x13'),_0x46f5('0x13'),_0x46f5('0x13')];var actions={};config[_0x46f5('0x15')]=_[_0x46f5('0x16')](config[_0x46f5('0x15')],{'host':_0x46f5('0x17'),'port':0x18eb});var io=require(_0x46f5('0x18'))(new Redis(config[_0x46f5('0x15')]));function VoiceCallReport(_0x3f49f6){this[_0x46f5('0x19')]=_0x3f49f6[_0x46f5('0x19')];this[_0x46f5('0x1a')]=_0x3f49f6[_0x46f5('0x1a')];ami['on'](_0x46f5('0x1b'),this[_0x46f5('0x1c')][_0x46f5('0x1d')](this));ami['on'](_0x46f5('0x1e'),this['syncNewExten'][_0x46f5('0x1d')](this));ami['on']('newchannel',this['syncNewChannel'][_0x46f5('0x1d')](this));ami['on']('newstate',this[_0x46f5('0x1f')][_0x46f5('0x1d')](this));ami['on']('varset',this[_0x46f5('0x20')][_0x46f5('0x1d')](this));ami['on'](_0x46f5('0x21'),this[_0x46f5('0x22')]['bind'](this));ami['on']('newcallerid',this[_0x46f5('0x23')][_0x46f5('0x1d')](this));ami['on']('attendedtransfer',this[_0x46f5('0x24')][_0x46f5('0x1d')](this));ami['on']('blindtransfer',this[_0x46f5('0x25')]['bind'](this));ami['on'](_0x46f5('0x26'),this[_0x46f5('0x27')][_0x46f5('0x1d')](this));ami['on']('musiconholdstop',this['syncMusicOnHoldStop'][_0x46f5('0x1d')](this));return BPromise[_0x46f5('0x28')]()[_0x46f5('0x29')](ami[_0x46f5('0x2a')]())[_0x46f5('0x2b')](function(_0x2d8e70){console[_0x46f5('0x2c')](_0x2d8e70);});}VoiceCallReport[_0x46f5('0x2d')][_0x46f5('0x2e')]=function(_0xdff732){return _0xdff732!==null&&!_[_0x46f5('0x2f')](_0xdff732);};VoiceCallReport['prototype'][_0x46f5('0x30')]=function(_0x140d87,_0x50b3c0,_0x1ce46e){io['to'](_0x140d87)[_0x46f5('0x30')](_0x50b3c0,_0x1ce46e);};VoiceCallReport[_0x46f5('0x2d')][_0x46f5('0x23')]=function(_0x1a88c6){try{if(this[_0x46f5('0x2e')](_0x1a88c6)){if(_0x1a88c6['uniqueid']===_0x1a88c6[_0x46f5('0x31')]){if(!_[_0x46f5('0x2f')](this['channels'][_0x1a88c6['uniqueid']])){_[_0x46f5('0x32')](this['channels'][_0x1a88c6[_0x46f5('0x33')]],_[_0x46f5('0x34')](_0x1a88c6,_['keys'](this[_0x46f5('0x19')][_0x1a88c6[_0x46f5('0x33')]])));}}}}catch(_0x66898b){logger[_0x46f5('0x35')]('[syncNewCallerId][VoiceCallReport]',util[_0x46f5('0x36')](_0x66898b,{'showHidden':![],'depth':null}));}};VoiceCallReport['prototype'][_0x46f5('0x37')]=function(_0xf3d512){try{if(this[_0x46f5('0x2e')](_0xf3d512)){if(_0xf3d512[_0x46f5('0x33')]===_0xf3d512[_0x46f5('0x31')]&&_0xf3d512[_0x46f5('0x38')]!=_0x46f5('0x39')){if(_['isUndefined'](this[_0x46f5('0x19')][_0xf3d512[_0x46f5('0x33')]])){this['channels'][_0xf3d512[_0x46f5('0x33')]]=new Channel();this[_0x46f5('0x19')][_0xf3d512['uniqueid']][_0x46f5('0x3a')]=moment()[_0x46f5('0x3b')](_0x46f5('0x3c'));this['channels'][_0xf3d512[_0x46f5('0x33')]][_0x46f5('0x3d')]=dispositions[_[_0x46f5('0x3e')](_0xf3d512[_0x46f5('0x3f')])];_[_0x46f5('0x32')](this[_0x46f5('0x19')][_0xf3d512[_0x46f5('0x33')]],_['pick'](_0xf3d512,_[_0x46f5('0x40')](this[_0x46f5('0x19')][_0xf3d512[_0x46f5('0x33')]])));if(_0xf3d512['context']===_0x46f5('0x41')){if(this[_0x46f5('0x1a')][_0xf3d512['channel'][_0x46f5('0x42')]('-')[0x0]]){this[_0x46f5('0x1a')][_0xf3d512[_0x46f5('0x38')][_0x46f5('0x42')]('-')[0x0]][_0x46f5('0x43')]=_0xf3d512[_0x46f5('0x44')];this[_0x46f5('0x30')](util[_0x46f5('0x3b')](_0x46f5('0x45'),this['agents'][_0xf3d512[_0x46f5('0x38')][_0x46f5('0x42')]('-')[0x0]][_0x46f5('0x46')]),_0x46f5('0x47'),{'destaccountcode':this[_0x46f5('0x1a')][_0xf3d512['channel'][_0x46f5('0x42')]('-')[0x0]][_0x46f5('0x48')],'destconnectedlinenum':_0xf3d512[_0x46f5('0x44')]});}}}}}}catch(_0x3d7398){logger['error']('[syncNewChannel][VoiceCallReport]',util[_0x46f5('0x36')](_0x3d7398,{'showHidden':![],'depth':null}));}};VoiceCallReport[_0x46f5('0x2d')][_0x46f5('0x1c')]=function(_0x3a6f68){try{if(this['isNotNull'](_0x3a6f68)){if(_0x3a6f68[_0x46f5('0x33')]===_0x3a6f68[_0x46f5('0x31')]&&_0x3a6f68[_0x46f5('0x44')]!='h'&&_0x3a6f68[_0x46f5('0x38')]!=_0x46f5('0x39')){_0x3a6f68[_0x46f5('0x49')]=_0x3a6f68[_0x46f5('0x49')]['toLowerCase']();_0x3a6f68[_0x46f5('0x4a')]=(_0x3a6f68[_0x46f5('0x4b')]||_0x3a6f68[_0x46f5('0x4a')])[_0x46f5('0x4c')]();if(_[_0x46f5('0x2f')](this[_0x46f5('0x19')][_0x3a6f68[_0x46f5('0x33')]])){this[_0x46f5('0x19')][_0x3a6f68['uniqueid']]=new Channel();this[_0x46f5('0x19')][_0x3a6f68[_0x46f5('0x33')]][_0x46f5('0x3a')]=_0x3a6f68['duration']?moment()[_0x46f5('0x4d')](moment['duration'](_0x3a6f68[_0x46f5('0x4e')])[_0x46f5('0x4f')](),'seconds')[_0x46f5('0x3b')]('YYYY-MM-DD\x20HH:mm:ss'):moment()[_0x46f5('0x3b')](_0x46f5('0x3c'));this['channels'][_0x3a6f68['uniqueid']][_0x46f5('0x3d')]=_0x46f5('0x12');}_[_0x46f5('0x32')](this[_0x46f5('0x19')][_0x3a6f68[_0x46f5('0x33')]],_[_0x46f5('0x34')](_0x3a6f68,_[_0x46f5('0x40')](this[_0x46f5('0x19')][_0x3a6f68['uniqueid']])));if(_[_0x46f5('0x50')](applications,_0x3a6f68[_0x46f5('0x49')])){this['channels'][_0x3a6f68[_0x46f5('0x33')]][_0x46f5('0x51')]=_0x3a6f68['application'];this['channels'][_0x3a6f68[_0x46f5('0x33')]]['lastdata']=_0x3a6f68[_0x46f5('0x4a')];if(_0x3a6f68[_0x46f5('0x49')]===_0x46f5('0x52')&&_[_0x46f5('0x53')](_0x3a6f68['applicationdata'],_0x46f5('0x54'))){var _0x3251a4=_0x3a6f68['applicationdata'][_0x46f5('0x42')]('=');var _0x1f5729=_0x3251a4[0x0][_0x46f5('0x55')](/cdr\((.*)\)/);if(_0x1f5729){this[_0x46f5('0x19')][_0x3a6f68['uniqueid']][_0x1f5729[0x1]]=_0x3251a4[0x1];}}else if(_0x3a6f68['application']==='queue'){this[_0x46f5('0x19')][_0x3a6f68[_0x46f5('0x33')]][_0x46f5('0xf')]=_0x3a6f68['applicationdata'][_0x46f5('0x42')](',')[0x0];}}}}}catch(_0x102e3d){logger[_0x46f5('0x35')]('[syncNewExten][VoiceCallReport]',util[_0x46f5('0x36')](_0x102e3d,{'showHidden':![],'depth':null}));}};VoiceCallReport[_0x46f5('0x2d')][_0x46f5('0x1f')]=function(_0x4b0535){try{if(this[_0x46f5('0x2e')](_0x4b0535)){if(_0x4b0535[_0x46f5('0x33')]!==_0x4b0535[_0x46f5('0x31')]){if(this[_0x46f5('0x19')][_0x4b0535[_0x46f5('0x31')]]){if(_0x4b0535['channelstate']==='6'){if(!this['channels'][_0x4b0535[_0x46f5('0x31')]][_0x46f5('0x56')]){var _0x5bde8e=moment();this[_0x46f5('0x19')][_0x4b0535[_0x46f5('0x31')]][_0x46f5('0x56')]=!![];this[_0x46f5('0x19')][_0x4b0535[_0x46f5('0x31')]][_0x46f5('0x57')]=_0x5bde8e[_0x46f5('0x3b')](_0x46f5('0x3c'));if(this['channels'][_0x4b0535['linkedid']][_0x46f5('0x3a')]){this[_0x46f5('0x19')][_0x4b0535[_0x46f5('0x31')]][_0x46f5('0x58')]=_0x5bde8e[_0x46f5('0x59')](this['channels'][_0x4b0535[_0x46f5('0x31')]][_0x46f5('0x3a')],_0x46f5('0x4f'));}}this[_0x46f5('0x19')][_0x4b0535[_0x46f5('0x31')]][_0x46f5('0x31')]=_0x4b0535[_0x46f5('0x33')];if(_0x4b0535[_0x46f5('0x5a')]!==_0x46f5('0x5b')){this['channels'][_0x4b0535[_0x46f5('0x31')]][_0x46f5('0x5c')]=_0x4b0535[_0x46f5('0x5a')];}this[_0x46f5('0x19')][_0x4b0535[_0x46f5('0x31')]]['connectedlinename']=_0x4b0535[_0x46f5('0x5d')];this['channels'][_0x4b0535[_0x46f5('0x31')]][_0x46f5('0x5e')]=_0x4b0535[_0x46f5('0x38')];this[_0x46f5('0x19')][_0x4b0535[_0x46f5('0x31')]][_0x46f5('0x3d')]=dispositions[_[_0x46f5('0x3e')](_0x4b0535['channelstate'])];if(this['agents'][_0x4b0535['channel']['split']('-')[0x0]]){this[_0x46f5('0x19')][_0x4b0535[_0x46f5('0x31')]][_0x46f5('0x5f')]=this[_0x46f5('0x1a')][_0x4b0535[_0x46f5('0x38')][_0x46f5('0x42')]('-')[0x0]]['id'];this[_0x46f5('0x19')][_0x4b0535[_0x46f5('0x31')]][_0x46f5('0x60')]=this[_0x46f5('0x1a')][_0x4b0535['channel'][_0x46f5('0x42')]('-')[0x0]][_0x46f5('0x46')];}}}}else{if(this[_0x46f5('0x19')][_0x4b0535[_0x46f5('0x33')]]){if(_0x4b0535[_0x46f5('0x3f')]==='6'){if(this['agents'][_0x4b0535[_0x46f5('0x38')][_0x46f5('0x42')]('-')[0x0]]){this[_0x46f5('0x19')][_0x4b0535[_0x46f5('0x33')]]['UserId']=this[_0x46f5('0x1a')][_0x4b0535['channel'][_0x46f5('0x42')]('-')[0x0]]['id'];this[_0x46f5('0x19')][_0x4b0535[_0x46f5('0x33')]][_0x46f5('0x60')]=this[_0x46f5('0x1a')][_0x4b0535[_0x46f5('0x38')][_0x46f5('0x42')]('-')[0x0]]['name'];}}}}}}catch(_0xe973dc){logger[_0x46f5('0x35')]('[syncNewState][VoiceCallReport]',util[_0x46f5('0x36')](_0xe973dc,{'showHidden':![],'depth':null}));}};VoiceCallReport[_0x46f5('0x2d')][_0x46f5('0x61')]=function(_0x4f780a,_0x3a2498){if(this[_0x46f5('0x19')][_0x4f780a]){this[_0x46f5('0x19')][_0x4f780a][_0x46f5('0x62')]=!![];if(_[_0x46f5('0x63')](_0x3a2498,_0x46f5('0x64'))){_0x3a2498=_0x3a2498[_0x46f5('0x65')](_0x46f5('0x64'),'.WAV');}this['channels'][_0x4f780a][_0x46f5('0x66')]=_0x3a2498;var _0x38b334=_[_0x46f5('0x67')](this[_0x46f5('0x19')][_0x4f780a][_0x46f5('0x68')],{'filename':_0x3a2498});if(_['isNil'](_0x38b334)){this['channels'][_0x4f780a][_0x46f5('0x68')]['push']({'filename':_0x3a2498,'createdAt':moment()['format'](_0x46f5('0x3c')),'mixmonitorid':'','status':_0x46f5('0x69')});}}};VoiceCallReport['prototype'][_0x46f5('0x20')]=function(_0x2d1814){try{if(this[_0x46f5('0x2e')](_0x2d1814)){if(this[_0x46f5('0x19')][_0x2d1814[_0x46f5('0x33')]]&&_0x2d1814[_0x46f5('0x38')]!='OutgoingSpoolFailed'){if(this['isNotNull'](_0x2d1814['variable'])){if(this[_0x46f5('0x2e')](_0x2d1814['variable']['mixmonitor_filename'])){this['syncMixMonitorFilename'](_0x2d1814[_0x46f5('0x33')],_0x2d1814[_0x46f5('0x6a')]);}else if(this[_0x46f5('0x2e')](_0x2d1814[_0x46f5('0x6b')]['xmd-phone'])){this[_0x46f5('0x19')][_0x2d1814['uniqueid']][_0x46f5('0x5a')]=_0x2d1814[_0x46f5('0x6a')];}else if(this[_0x46f5('0x2e')](_0x2d1814['variable'][_0x46f5('0x6c')])){this[_0x46f5('0x19')][_0x2d1814[_0x46f5('0x33')]]['callerid']=_0x2d1814[_0x46f5('0x6a')];}else if(this['isNotNull'](_0x2d1814[_0x46f5('0x6b')][_0x46f5('0x6d')])){this[_0x46f5('0x19')][_0x2d1814[_0x46f5('0x33')]][_0x46f5('0x6e')]=_0x2d1814[_0x46f5('0x6a')];}else if(this[_0x46f5('0x2e')](_0x2d1814[_0x46f5('0x6b')]['xmd-queue'])){this[_0x46f5('0x19')][_0x2d1814['uniqueid']]['queue']=_0x2d1814['value']['split'](',')[0x0];}else if(this[_0x46f5('0x2e')](_0x2d1814[_0x46f5('0x6b')][_0x46f5('0x6f')])){this[_0x46f5('0x19')][_0x2d1814[_0x46f5('0x33')]]['originatecalleridnum']=_0x2d1814['value'];}else if(this[_0x46f5('0x2e')](_0x2d1814[_0x46f5('0x6b')][_0x46f5('0x70')])){this[_0x46f5('0x19')][_0x2d1814[_0x46f5('0x33')]][_0x46f5('0x71')]=_0x2d1814[_0x46f5('0x6a')];}else if(this[_0x46f5('0x2e')](_0x2d1814[_0x46f5('0x6b')]['xmd-callerid-preview'])){this[_0x46f5('0x19')][_0x2d1814[_0x46f5('0x33')]][_0x46f5('0x72')]=_0x2d1814[_0x46f5('0x6a')];}else if(this[_0x46f5('0x2e')](_0x2d1814['variable']['xmcs-queue'])){this[_0x46f5('0x19')][_0x2d1814['uniqueid']][_0x46f5('0xf')]=_0x2d1814[_0x46f5('0x6a')];}else if(this[_0x46f5('0x2e')](_0x2d1814[_0x46f5('0x6b')]['sipcallid'])){this['channels'][_0x2d1814[_0x46f5('0x33')]][_0x46f5('0x73')]=_0x2d1814[_0x46f5('0x6a')];}}}else if(this[_0x46f5('0x2e')](_0x2d1814[_0x46f5('0x6b')][_0x46f5('0x74')])){if(_0x2d1814[_0x46f5('0x6a')]){var _0x37d336=path[_0x46f5('0x75')](_0x2d1814[_0x46f5('0x6a')])[_0x46f5('0x46')];this[_0x46f5('0x61')](_0x37d336,_0x2d1814[_0x46f5('0x6a')]);}}else if(this[_0x46f5('0x19')][_0x2d1814[_0x46f5('0x31')]]){if(this[_0x46f5('0x2e')](_0x2d1814[_0x46f5('0x6b')])){if(this[_0x46f5('0x2e')](_0x2d1814[_0x46f5('0x6b')][_0x46f5('0x76')])){this[_0x46f5('0x19')][_0x2d1814[_0x46f5('0x31')]][_0x46f5('0x77')]=_0x2d1814[_0x46f5('0x6a')];}}}}}catch(_0x463ff0){logger[_0x46f5('0x35')](_0x46f5('0x78'),util[_0x46f5('0x36')](_0x463ff0,{'showHidden':![],'depth':null}));}};VoiceCallReport['prototype'][_0x46f5('0x22')]=function(_0x37fd92){try{if(this[_0x46f5('0x2e')](_0x37fd92)){if(this[_0x46f5('0x19')][_0x37fd92[_0x46f5('0x33')]]){var _0x53599c=moment();this[_0x46f5('0x19')][_0x37fd92[_0x46f5('0x33')]][_0x46f5('0x79')]=_0x53599c[_0x46f5('0x3b')](_0x46f5('0x3c'));this['channels'][_0x37fd92['uniqueid']][_0x46f5('0x4e')]=_0x53599c[_0x46f5('0x59')](this[_0x46f5('0x19')][_0x37fd92['uniqueid']][_0x46f5('0x3a')],'seconds');if(this[_0x46f5('0x19')][_0x37fd92[_0x46f5('0x33')]][_0x46f5('0x56')]){this[_0x46f5('0x19')][_0x37fd92[_0x46f5('0x33')]][_0x46f5('0x7a')]=_0x53599c[_0x46f5('0x59')](this[_0x46f5('0x19')][_0x37fd92[_0x46f5('0x33')]]['answertime'],_0x46f5('0x4f'));this[_0x46f5('0x19')][_0x37fd92[_0x46f5('0x33')]][_0x46f5('0x58')]=this[_0x46f5('0x19')][_0x37fd92['uniqueid']][_0x46f5('0x4e')]-this[_0x46f5('0x19')][_0x37fd92[_0x46f5('0x33')]]['billableseconds'];}if(_0x37fd92[_0x46f5('0x7b')]===_0x46f5('0x41')){if(this[_0x46f5('0x1a')][_0x37fd92[_0x46f5('0x38')][_0x46f5('0x42')]('-')[0x0]]){this[_0x46f5('0x1a')][_0x37fd92[_0x46f5('0x38')]['split']('-')[0x0]]=_[_0x46f5('0x7c')](this[_0x46f5('0x1a')][_0x37fd92['channel'][_0x46f5('0x42')]('-')[0x0]],[_0x46f5('0x43')]);this[_0x46f5('0x30')](util[_0x46f5('0x3b')](_0x46f5('0x45'),this['agents'][_0x37fd92[_0x46f5('0x38')][_0x46f5('0x42')]('-')[0x0]][_0x46f5('0x46')]),_0x46f5('0x7d'),{'destaccountcode':this[_0x46f5('0x1a')][_0x37fd92[_0x46f5('0x38')]['split']('-')[0x0]]['accountcode']});}}ami['emit']('custom:voiceCallReport',this['channels'][_0x37fd92[_0x46f5('0x33')]]);delete this[_0x46f5('0x19')][_0x37fd92[_0x46f5('0x33')]];}}}catch(_0x5a77ec){logger[_0x46f5('0x35')](_0x46f5('0x7e'),util['inspect'](_0x5a77ec,{'showHidden':![],'depth':null}));}};VoiceCallReport['prototype'][_0x46f5('0x24')]=function(_0x561170){try{if(this[_0x46f5('0x2e')](_0x561170)){if(this['channels'][_0x561170[_0x46f5('0x7f')]]){this[_0x46f5('0x19')][_0x561170[_0x46f5('0x7f')]]['transfercalleridnum']=_0x561170[_0x46f5('0x80')];this[_0x46f5('0x19')][_0x561170[_0x46f5('0x7f')]]['transferconnectedlinenum']=_0x561170[_0x46f5('0x81')];if(this[_0x46f5('0x19')][_0x561170[_0x46f5('0x82')]]){var _0x1377c2=this['channels'][_0x561170[_0x46f5('0x82')]];this['channels'][_0x561170[_0x46f5('0x82')]]=this[_0x46f5('0x19')][_0x561170[_0x46f5('0x7f')]];this[_0x46f5('0x19')][_0x561170[_0x46f5('0x7f')]]=_0x1377c2;}}else if(this[_0x46f5('0x19')][_0x561170[_0x46f5('0x83')]]){this['channels'][_0x561170[_0x46f5('0x83')]][_0x46f5('0x84')]=_0x561170[_0x46f5('0x80')];this[_0x46f5('0x19')][_0x561170['transfertargetuniqueid']][_0x46f5('0x85')]=_0x561170[_0x46f5('0x81')];if(this[_0x46f5('0x19')][_0x561170[_0x46f5('0x86')]]){var _0x1377c2=this['channels'][_0x561170[_0x46f5('0x86')]];this['channels'][_0x561170['origtransfereruniqueid']]=this[_0x46f5('0x19')][_0x561170[_0x46f5('0x83')]];this['channels'][_0x561170[_0x46f5('0x83')]]=_0x1377c2;}}}}catch(_0x25527f){logger[_0x46f5('0x35')]('[syncAttendedTransfer][VoiceCallReport]',util[_0x46f5('0x36')](_0x25527f,{'showHidden':![],'depth':null}));}};VoiceCallReport['prototype'][_0x46f5('0x25')]=function(_0x5e4f1e){try{if(this[_0x46f5('0x2e')](_0x5e4f1e)){if(this[_0x46f5('0x19')][_0x5e4f1e[_0x46f5('0x7f')]]){this['channels'][_0x5e4f1e['transfereeuniqueid']][_0x46f5('0x84')]=_0x5e4f1e[_0x46f5('0x87')];this['channels'][_0x5e4f1e[_0x46f5('0x7f')]][_0x46f5('0x85')]=_0x5e4f1e[_0x46f5('0x88')];this['syncHangup']({'event':_0x46f5('0x89'),'uniqueid':_0x5e4f1e[_0x46f5('0x7f')],'context':_0x5e4f1e['context'],'channel':_0x5e4f1e['transfererchannel']});}}}catch(_0x43a368){logger[_0x46f5('0x35')]('[syncBlindTransfer][VoiceCallReport]',util[_0x46f5('0x36')](_0x43a368,{'showHidden':![],'depth':null}));}};VoiceCallReport['prototype'][_0x46f5('0x27')]=function(_0x51bc0f){try{if(this[_0x46f5('0x2e')](_0x51bc0f)){if(this[_0x46f5('0x19')][_0x51bc0f[_0x46f5('0x33')]]){if(!_[_0x46f5('0x8a')](this['channels'][_0x51bc0f[_0x46f5('0x33')]][_0x46f5('0x57')])){this[_0x46f5('0x19')][_0x51bc0f[_0x46f5('0x33')]][_0x46f5('0x8b')]=moment()[_0x46f5('0x3b')](_0x46f5('0x3c'));}}}}catch(_0x181b0c){logger['error']('[syncMusicOnHoldStart][VoiceCallReport]',util[_0x46f5('0x36')](_0x181b0c,{'showHidden':![],'depth':null}));}};VoiceCallReport['prototype']['syncMusicOnHoldStop']=function(_0x245013){try{if(this[_0x46f5('0x2e')](_0x245013)){if(this['channels'][_0x245013['uniqueid']]){if(!_[_0x46f5('0x8a')](this['channels'][_0x245013[_0x46f5('0x33')]][_0x46f5('0x8b')])){this[_0x46f5('0x19')][_0x245013[_0x46f5('0x33')]][_0x46f5('0x8c')]+=moment()[_0x46f5('0x8d')](0x0)[_0x46f5('0x59')](this[_0x46f5('0x19')][_0x245013[_0x46f5('0x33')]][_0x46f5('0x8b')],_0x46f5('0x4f'));delete this['channels'][_0x245013[_0x46f5('0x33')]]['mohstarttime'];}}}}catch(_0x121844){logger['error']('[syncMusicOnHoldStop][VoiceCallReport]',util[_0x46f5('0x36')](_0x121844,{'showHidden':![],'depth':null}));}};module[_0x46f5('0x8e')]=VoiceCallReport;
\ No newline at end of file
diff --git a/server/services/ami/report/voiceDialReport.js b/server/services/ami/report/voiceDialReport.js
index 9637a55..afd3f99 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 _0x89fd=['inspect','dialstatus','connectedlinenum','connectedlinename','answertime','lastevent','custom:dialconnect','addVariable','variable','value','outboundrouteid','[syncVarSet][VoiceDialReport]','rtpaudioqos','rtpaudioqosbridged','rtpaudioqosjitter','rtpaudioqosjitterbridged','rtpaudioqosloss','rtpaudioqosrttbridged','bridgepeer','bridgepvtcallid','memberdynamic','memberlastcall','membername','memberpenalty','memberrealtime','isNil','includes','endtime','duration','diff','seconds','complete','total','answered','holdtime','billableseconds','sumHoldTime','sumBillable','custom:voiceDialReport','info','[DEBUG]\x20Emit\x20voice_outbound_channel:remove\x20event','stringify','[syncHangup][VoiceDialReport]','exports','moment','util','ioredis','../../../config/environment','../../../config/logger','ami','../ami','redis','defaults','socket.io-emitter','channels','outbound','variables','dialbegin','syncDialBegin','bind','dialend','syncDialEnd','varset','syncVarSet','hangup','syncHangup','isUndefined','prototype','emit','isNotNull','uniqueid','merge','format','YYYY-MM-DD\x20HH:mm:ss','channel','substring','lastIndexOf','omit','privilege','voice:outbound','voice_outbound_channel:save','error','[syncDialBegin][VoiceDialReport]'];(function(_0x697a85,_0x238db2){var _0x4a6ba9=function(_0x4e70b7){while(--_0x4e70b7){_0x697a85['push'](_0x697a85['shift']());}};_0x4a6ba9(++_0x238db2);}(_0x89fd,0x7f));var _0xd89f=function(_0x18f417,_0x4b3efc){_0x18f417=_0x18f417-0x0;var _0x13484c=_0x89fd[_0x18f417];return _0x13484c;};'use strict';var _=require('lodash');var moment=require(_0xd89f('0x0'));var util=require(_0xd89f('0x1'));var Redis=require(_0xd89f('0x2'));var config=require(_0xd89f('0x3'));var logger=require(_0xd89f('0x4'))(_0xd89f('0x5'));var ami=require(_0xd89f('0x6'));config[_0xd89f('0x7')]=_[_0xd89f('0x8')](config[_0xd89f('0x7')],{'host':'localhost','port':0x18eb});var io=require(_0xd89f('0x9'))(new Redis(config[_0xd89f('0x7')]));function VoiceDialReport(_0x71c6d1){this[_0xd89f('0xa')]=_0x71c6d1['outboundChannels'];this['outbound']=_0x71c6d1[_0xd89f('0xb')];this[_0xd89f('0xc')]={};ami['on'](_0xd89f('0xd'),this[_0xd89f('0xe')][_0xd89f('0xf')](this));ami['on'](_0xd89f('0x10'),this[_0xd89f('0x11')][_0xd89f('0xf')](this));ami['on'](_0xd89f('0x12'),this[_0xd89f('0x13')][_0xd89f('0xf')](this));ami['on'](_0xd89f('0x14'),this[_0xd89f('0x15')][_0xd89f('0xf')](this));}VoiceDialReport['prototype']['isNotNull']=function(_0x1561ff){return _0x1561ff!==null&&!_[_0xd89f('0x16')](_0x1561ff);};VoiceDialReport[_0xd89f('0x17')][_0xd89f('0x18')]=function(_0x4da49c,_0x2d5f03,_0x37d793){io['to'](_0x4da49c)['emit'](_0x2d5f03,_0x37d793);};VoiceDialReport[_0xd89f('0x17')]['syncDialBegin']=function(_0x72c0dc){try{if(this[_0xd89f('0x19')](_0x72c0dc)){if(this[_0xd89f('0xa')][_0x72c0dc[_0xd89f('0x1a')]]){_[_0xd89f('0x1b')](this['channels'][_0x72c0dc['uniqueid']],{'starttime':moment()[_0xd89f('0x1c')](_0xd89f('0x1d')),'lastevent':'called','interface':_0x72c0dc[_0xd89f('0x1e')][_0xd89f('0x1f')](0x0,_0x72c0dc[_0xd89f('0x1e')]['lastIndexOf']('-')),'membername':_0x72c0dc[_0xd89f('0x1e')]['substring'](_0x72c0dc[_0xd89f('0x1e')][_0xd89f('0x20')]('/')+0x1,_0x72c0dc[_0xd89f('0x1e')][_0xd89f('0x20')]('-'))},_[_0xd89f('0x21')](_0x72c0dc,['event',_0xd89f('0x22')]));this[_0xd89f('0x18')](_0xd89f('0x23'),_0xd89f('0x24'),this[_0xd89f('0xa')][_0x72c0dc[_0xd89f('0x1a')]]);ami[_0xd89f('0x18')]('custom:dialbegin',this[_0xd89f('0xa')][_0x72c0dc['uniqueid']]);}}}catch(_0xa5874f){logger[_0xd89f('0x25')](_0xd89f('0x26'),util[_0xd89f('0x27')](_0xa5874f,{'showHidden':![],'depth':null}));}};VoiceDialReport[_0xd89f('0x17')][_0xd89f('0x11')]=function(_0x2f408c){try{if(this[_0xd89f('0x19')](_0x2f408c)){if(this[_0xd89f('0xa')][_0x2f408c[_0xd89f('0x1a')]]){this['channels'][_0x2f408c[_0xd89f('0x1a')]]['dialstatus']=_0x2f408c['dialstatus'];if(_0x2f408c[_0xd89f('0x28')]==='ANSWER'){this[_0xd89f('0xa')][_0x2f408c[_0xd89f('0x1a')]][_0xd89f('0x29')]=_0x2f408c[_0xd89f('0x29')];this[_0xd89f('0xa')][_0x2f408c['uniqueid']][_0xd89f('0x2a')]=_0x2f408c[_0xd89f('0x2a')];this[_0xd89f('0xa')][_0x2f408c[_0xd89f('0x1a')]][_0xd89f('0x2b')]=moment()[_0xd89f('0x1c')]('YYYY-MM-DD\x20HH:mm:ss');this[_0xd89f('0xa')][_0x2f408c['uniqueid']][_0xd89f('0x2c')]='connect';ami[_0xd89f('0x18')](_0xd89f('0x2d'),this[_0xd89f('0xa')][_0x2f408c[_0xd89f('0x1a')]]);}this[_0xd89f('0x18')](_0xd89f('0x23'),_0xd89f('0x24'),this[_0xd89f('0xa')][_0x2f408c['uniqueid']]);}}}catch(_0x57f154){logger['error']('[syncDialEnd][VoiceDialReport]',util[_0xd89f('0x27')](_0x57f154,{'showHidden':![],'depth':null}));}};VoiceDialReport[_0xd89f('0x17')][_0xd89f('0x13')]=function(_0x1e4c3f){try{if(this[_0xd89f('0x19')](_0x1e4c3f)){this[_0xd89f('0x2e')](_0x1e4c3f[_0xd89f('0x1a')],_['keys'](_0x1e4c3f[_0xd89f('0x2f')])[0x0],_0x1e4c3f[_0xd89f('0x30')]);if(this[_0xd89f('0x19')](_0x1e4c3f['variable'])&&this[_0xd89f('0x19')](_0x1e4c3f[_0xd89f('0x2f')][_0xd89f('0x31')])){if(_[_0xd89f('0x16')](this[_0xd89f('0xa')][_0x1e4c3f['uniqueid']])){this[_0xd89f('0xa')][_0x1e4c3f[_0xd89f('0x1a')]]={'routeId':_0x1e4c3f[_0xd89f('0x30')],'variables':this[_0xd89f('0xc')][_0x1e4c3f[_0xd89f('0x1a')]]};this[_0xd89f('0x18')](_0xd89f('0x23'),_0xd89f('0x24'),this[_0xd89f('0xa')][_0x1e4c3f[_0xd89f('0x1a')]]);}}}}catch(_0x2447d2){logger[_0xd89f('0x25')](_0xd89f('0x32'),util[_0xd89f('0x27')](_0x2447d2,{'showHidden':![],'depth':null}));}};VoiceDialReport[_0xd89f('0x17')][_0xd89f('0x2e')]=function(_0x3d7734,_0x5b2f15,_0xb98a4f){var _0x40fe0d=[_0xd89f('0x33'),_0xd89f('0x34'),_0xd89f('0x35'),_0xd89f('0x36'),_0xd89f('0x37'),'rtpaudioqoslossbridged','rtpaudioqosrtt',_0xd89f('0x38'),'sipcallid','sipuri',_0xd89f('0x39'),_0xd89f('0x3a'),'membercalls',_0xd89f('0x3b'),'memberinterface',_0xd89f('0x3c'),_0xd89f('0x3d'),_0xd89f('0x3e'),_0xd89f('0x3f')];if(!_[_0xd89f('0x40')](_0x5b2f15)&&!_[_0xd89f('0x41')](_0x40fe0d,_0x5b2f15)){if(_[_0xd89f('0x16')](this[_0xd89f('0xc')][_0x3d7734])){this['variables'][_0x3d7734]={};}this[_0xd89f('0xc')][_0x3d7734][_0x5b2f15]=_0xb98a4f;}};VoiceDialReport[_0xd89f('0x17')][_0xd89f('0x15')]=function(_0x50461d){try{if(this[_0xd89f('0x19')](_0x50461d)){if(this['channels'][_0x50461d[_0xd89f('0x1a')]]){this['channels'][_0x50461d[_0xd89f('0x1a')]][_0xd89f('0x42')]=moment()[_0xd89f('0x1c')]('YYYY-MM-DD\x20HH:mm:ss');this[_0xd89f('0xa')][_0x50461d[_0xd89f('0x1a')]][_0xd89f('0x43')]=moment(this[_0xd89f('0xa')][_0x50461d[_0xd89f('0x1a')]]['endtime'])[_0xd89f('0x44')](this['channels'][_0x50461d[_0xd89f('0x1a')]]['starttime'],_0xd89f('0x45'));this[_0xd89f('0xa')][_0x50461d[_0xd89f('0x1a')]][_0xd89f('0x2c')]=_0xd89f('0x46');this[_0xd89f('0xb')][_0xd89f('0x47')]+=0x1;if(this[_0xd89f('0xa')][_0x50461d[_0xd89f('0x1a')]][_0xd89f('0x2b')]){this['outbound'][_0xd89f('0x48')]+=0x1;this[_0xd89f('0xa')][_0x50461d[_0xd89f('0x1a')]][_0xd89f('0x49')]=moment(this['channels'][_0x50461d[_0xd89f('0x1a')]][_0xd89f('0x2b')])['diff'](this[_0xd89f('0xa')][_0x50461d['uniqueid']]['starttime'],_0xd89f('0x45'));this[_0xd89f('0xa')][_0x50461d[_0xd89f('0x1a')]][_0xd89f('0x4a')]=moment(this[_0xd89f('0xa')][_0x50461d[_0xd89f('0x1a')]]['endtime'])[_0xd89f('0x44')](this[_0xd89f('0xa')][_0x50461d[_0xd89f('0x1a')]][_0xd89f('0x2b')],'seconds');this['outbound'][_0xd89f('0x4b')]+=this[_0xd89f('0xa')][_0x50461d[_0xd89f('0x1a')]]['holdtime']||0x0;this['outbound'][_0xd89f('0x4c')]+=this[_0xd89f('0xa')][_0x50461d['uniqueid']]['billableseconds'];}this[_0xd89f('0xb')]['sumDuration']+=this[_0xd89f('0xa')][_0x50461d[_0xd89f('0x1a')]]['duration'];ami[_0xd89f('0x18')](_0xd89f('0x4d'),this[_0xd89f('0xa')][_0x50461d[_0xd89f('0x1a')]]);ami['emit']('custom:dialend',this['channels'][_0x50461d['uniqueid']]);this[_0xd89f('0x18')](_0xd89f('0x23'),'voice_outbound:save',this[_0xd89f('0xb')]);logger[_0xd89f('0x4e')](_0xd89f('0x4f'),JSON[_0xd89f('0x50')](this['channels'][_0x50461d[_0xd89f('0x1a')]]));this['emit']('voice:outbound','voice_outbound_channel:remove',this['channels'][_0x50461d[_0xd89f('0x1a')]]);delete this[_0xd89f('0xa')][_0x50461d['uniqueid']];}if(this[_0xd89f('0xc')][_0x50461d[_0xd89f('0x1a')]]){delete this[_0xd89f('0xc')][_0x50461d[_0xd89f('0x1a')]];}}}catch(_0x2b388d){logger['error'](_0xd89f('0x51'),util[_0xd89f('0x27')](_0x2b388d,{'showHidden':![],'depth':null}));}};module[_0xd89f('0x52')]=VoiceDialReport;
\ No newline at end of file
+var _0x6709=['rtpaudioqoslossbridged','rtpaudioqosrtt','rtpaudioqosrttbridged','sipcallid','sipuri','bridgepeer','bridgepvtcallid','membercalls','memberdynamic','memberlastcall','membername','memberpenalty','memberrealtime','isNil','includes','endtime','duration','starttime','lastevent','complete','total','answertime','answered','holdtime','seconds','billableseconds','diff','sumHoldTime','sumDuration','custom:voiceDialReport','custom:dialend','voice_outbound:save','info','stringify','[syncHangup][VoiceDialReport]','exports','moment','util','ioredis','../../../config/environment','../../../config/logger','ami','../ami','defaults','redis','localhost','socket.io-emitter','channels','outboundChannels','outbound','variables','dialbegin','bind','syncDialEnd','varset','hangup','syncHangup','prototype','isNotNull','emit','syncDialBegin','uniqueid','merge','format','YYYY-MM-DD\x20HH:mm:ss','called','channel','substring','lastIndexOf','omit','event','voice:outbound','custom:dialbegin','dialstatus','ANSWER','connectedlinenum','connectedlinename','connect','voice_outbound_channel:save','error','inspect','addVariable','keys','variable','isUndefined','value','[syncVarSet][VoiceDialReport]','rtpaudioqos','rtpaudioqosjitterbridged'];(function(_0x9d461e,_0x55f1b8){var _0x5ee9cd=function(_0x3554f6){while(--_0x3554f6){_0x9d461e['push'](_0x9d461e['shift']());}};_0x5ee9cd(++_0x55f1b8);}(_0x6709,0x12f));var _0x9670=function(_0x5d2803,_0xf375bd){_0x5d2803=_0x5d2803-0x0;var _0xdcad2c=_0x6709[_0x5d2803];return _0xdcad2c;};'use strict';var _=require('lodash');var moment=require(_0x9670('0x0'));var util=require(_0x9670('0x1'));var Redis=require(_0x9670('0x2'));var config=require(_0x9670('0x3'));var logger=require(_0x9670('0x4'))(_0x9670('0x5'));var ami=require(_0x9670('0x6'));config['redis']=_[_0x9670('0x7')](config[_0x9670('0x8')],{'host':_0x9670('0x9'),'port':0x18eb});var io=require(_0x9670('0xa'))(new Redis(config[_0x9670('0x8')]));function VoiceDialReport(_0x1832f1){this[_0x9670('0xb')]=_0x1832f1[_0x9670('0xc')];this['outbound']=_0x1832f1[_0x9670('0xd')];this[_0x9670('0xe')]={};ami['on'](_0x9670('0xf'),this['syncDialBegin'][_0x9670('0x10')](this));ami['on']('dialend',this[_0x9670('0x11')]['bind'](this));ami['on'](_0x9670('0x12'),this['syncVarSet']['bind'](this));ami['on'](_0x9670('0x13'),this[_0x9670('0x14')][_0x9670('0x10')](this));}VoiceDialReport[_0x9670('0x15')][_0x9670('0x16')]=function(_0x3cd232){return _0x3cd232!==null&&!_['isUndefined'](_0x3cd232);};VoiceDialReport['prototype'][_0x9670('0x17')]=function(_0x3323ef,_0x1ddf10,_0x17b703){io['to'](_0x3323ef)[_0x9670('0x17')](_0x1ddf10,_0x17b703);};VoiceDialReport[_0x9670('0x15')][_0x9670('0x18')]=function(_0x55da91){try{if(this['isNotNull'](_0x55da91)){if(this[_0x9670('0xb')][_0x55da91[_0x9670('0x19')]]){_[_0x9670('0x1a')](this[_0x9670('0xb')][_0x55da91[_0x9670('0x19')]],{'starttime':moment()[_0x9670('0x1b')](_0x9670('0x1c')),'lastevent':_0x9670('0x1d'),'interface':_0x55da91[_0x9670('0x1e')][_0x9670('0x1f')](0x0,_0x55da91['channel'][_0x9670('0x20')]('-')),'membername':_0x55da91['channel']['substring'](_0x55da91[_0x9670('0x1e')][_0x9670('0x20')]('/')+0x1,_0x55da91['channel']['lastIndexOf']('-'))},_[_0x9670('0x21')](_0x55da91,[_0x9670('0x22'),'privilege']));this[_0x9670('0x17')](_0x9670('0x23'),'voice_outbound_channel:save',this[_0x9670('0xb')][_0x55da91[_0x9670('0x19')]]);ami[_0x9670('0x17')](_0x9670('0x24'),this['channels'][_0x55da91[_0x9670('0x19')]]);}}}catch(_0x314f07){logger['error']('[syncDialBegin][VoiceDialReport]',util['inspect'](_0x314f07,{'showHidden':![],'depth':null}));}};VoiceDialReport[_0x9670('0x15')][_0x9670('0x11')]=function(_0x6a8cc7){try{if(this[_0x9670('0x16')](_0x6a8cc7)){if(this[_0x9670('0xb')][_0x6a8cc7['uniqueid']]){this['channels'][_0x6a8cc7[_0x9670('0x19')]]['dialstatus']=_0x6a8cc7['dialstatus'];if(_0x6a8cc7[_0x9670('0x25')]===_0x9670('0x26')){this[_0x9670('0xb')][_0x6a8cc7[_0x9670('0x19')]][_0x9670('0x27')]=_0x6a8cc7[_0x9670('0x27')];this[_0x9670('0xb')][_0x6a8cc7[_0x9670('0x19')]][_0x9670('0x28')]=_0x6a8cc7[_0x9670('0x28')];this[_0x9670('0xb')][_0x6a8cc7[_0x9670('0x19')]]['answertime']=moment()['format'](_0x9670('0x1c'));this['channels'][_0x6a8cc7[_0x9670('0x19')]]['lastevent']=_0x9670('0x29');ami[_0x9670('0x17')]('custom:dialconnect',this[_0x9670('0xb')][_0x6a8cc7['uniqueid']]);}this[_0x9670('0x17')](_0x9670('0x23'),_0x9670('0x2a'),this[_0x9670('0xb')][_0x6a8cc7[_0x9670('0x19')]]);}}}catch(_0x44652d){logger[_0x9670('0x2b')]('[syncDialEnd][VoiceDialReport]',util[_0x9670('0x2c')](_0x44652d,{'showHidden':![],'depth':null}));}};VoiceDialReport['prototype']['syncVarSet']=function(_0x4ac23e){try{if(this[_0x9670('0x16')](_0x4ac23e)){this[_0x9670('0x2d')](_0x4ac23e[_0x9670('0x19')],_[_0x9670('0x2e')](_0x4ac23e[_0x9670('0x2f')])[0x0],_0x4ac23e['value']);if(this[_0x9670('0x16')](_0x4ac23e['variable'])&&this[_0x9670('0x16')](_0x4ac23e['variable']['outboundrouteid'])){if(_[_0x9670('0x30')](this[_0x9670('0xb')][_0x4ac23e[_0x9670('0x19')]])){this['channels'][_0x4ac23e[_0x9670('0x19')]]={'routeId':_0x4ac23e[_0x9670('0x31')],'variables':this[_0x9670('0xe')][_0x4ac23e[_0x9670('0x19')]]};this[_0x9670('0x17')](_0x9670('0x23'),_0x9670('0x2a'),this[_0x9670('0xb')][_0x4ac23e['uniqueid']]);}}}}catch(_0x328216){logger[_0x9670('0x2b')](_0x9670('0x32'),util[_0x9670('0x2c')](_0x328216,{'showHidden':![],'depth':null}));}};VoiceDialReport[_0x9670('0x15')]['addVariable']=function(_0x30de56,_0x1a6374,_0x22f039){var _0x5f3a45=[_0x9670('0x33'),'rtpaudioqosbridged','rtpaudioqosjitter',_0x9670('0x34'),'rtpaudioqosloss',_0x9670('0x35'),_0x9670('0x36'),_0x9670('0x37'),_0x9670('0x38'),_0x9670('0x39'),_0x9670('0x3a'),_0x9670('0x3b'),_0x9670('0x3c'),_0x9670('0x3d'),'memberinterface',_0x9670('0x3e'),_0x9670('0x3f'),_0x9670('0x40'),_0x9670('0x41')];if(!_[_0x9670('0x42')](_0x1a6374)&&!_[_0x9670('0x43')](_0x5f3a45,_0x1a6374)){if(_[_0x9670('0x30')](this[_0x9670('0xe')][_0x30de56])){this[_0x9670('0xe')][_0x30de56]={};}this[_0x9670('0xe')][_0x30de56][_0x1a6374]=_0x22f039;}};VoiceDialReport[_0x9670('0x15')][_0x9670('0x14')]=function(_0x5a15ff){try{if(this[_0x9670('0x16')](_0x5a15ff)){if(this[_0x9670('0xb')][_0x5a15ff[_0x9670('0x19')]]){this[_0x9670('0xb')][_0x5a15ff['uniqueid']][_0x9670('0x44')]=moment()[_0x9670('0x1b')](_0x9670('0x1c'));this[_0x9670('0xb')][_0x5a15ff[_0x9670('0x19')]][_0x9670('0x45')]=moment(this[_0x9670('0xb')][_0x5a15ff[_0x9670('0x19')]][_0x9670('0x44')])['diff'](this[_0x9670('0xb')][_0x5a15ff[_0x9670('0x19')]][_0x9670('0x46')],'seconds');this[_0x9670('0xb')][_0x5a15ff['uniqueid']][_0x9670('0x47')]=_0x9670('0x48');this[_0x9670('0xd')][_0x9670('0x49')]+=0x1;if(this[_0x9670('0xb')][_0x5a15ff[_0x9670('0x19')]][_0x9670('0x4a')]){this['outbound'][_0x9670('0x4b')]+=0x1;this[_0x9670('0xb')][_0x5a15ff[_0x9670('0x19')]][_0x9670('0x4c')]=moment(this[_0x9670('0xb')][_0x5a15ff[_0x9670('0x19')]][_0x9670('0x4a')])['diff'](this[_0x9670('0xb')][_0x5a15ff[_0x9670('0x19')]][_0x9670('0x46')],_0x9670('0x4d'));this['channels'][_0x5a15ff['uniqueid']][_0x9670('0x4e')]=moment(this[_0x9670('0xb')][_0x5a15ff[_0x9670('0x19')]][_0x9670('0x44')])[_0x9670('0x4f')](this['channels'][_0x5a15ff[_0x9670('0x19')]]['answertime'],_0x9670('0x4d'));this[_0x9670('0xd')][_0x9670('0x50')]+=this[_0x9670('0xb')][_0x5a15ff['uniqueid']][_0x9670('0x4c')]||0x0;this['outbound']['sumBillable']+=this['channels'][_0x5a15ff[_0x9670('0x19')]][_0x9670('0x4e')];}this[_0x9670('0xd')][_0x9670('0x51')]+=this['channels'][_0x5a15ff['uniqueid']][_0x9670('0x45')];ami[_0x9670('0x17')](_0x9670('0x52'),this[_0x9670('0xb')][_0x5a15ff[_0x9670('0x19')]]);ami[_0x9670('0x17')](_0x9670('0x53'),this[_0x9670('0xb')][_0x5a15ff[_0x9670('0x19')]]);this[_0x9670('0x17')]('voice:outbound',_0x9670('0x54'),this[_0x9670('0xd')]);logger[_0x9670('0x55')]('[DEBUG]\x20Emit\x20voice_outbound_channel:remove\x20event',JSON[_0x9670('0x56')](this[_0x9670('0xb')][_0x5a15ff[_0x9670('0x19')]]));this[_0x9670('0x17')](_0x9670('0x23'),'voice_outbound_channel:remove',this[_0x9670('0xb')][_0x5a15ff[_0x9670('0x19')]]);delete this[_0x9670('0xb')][_0x5a15ff[_0x9670('0x19')]];}if(this[_0x9670('0xe')][_0x5a15ff[_0x9670('0x19')]]){delete this['variables'][_0x5a15ff['uniqueid']];}}}catch(_0x49c187){logger[_0x9670('0x2b')](_0x9670('0x57'),util[_0x9670('0x2c')](_0x49c187,{'showHidden':![],'depth':null}));}};module[_0x9670('0x58')]=VoiceDialReport;
\ No newline at end of file
diff --git a/server/services/ami/report/voiceQueueReport.js b/server/services/ami/report/voiceQueueReport.js
index d3bd8f6..e4fd1b0 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 _0x462e=['util','md5','ioredis','../../../config/environment','../../../config/logger','ami','redis','defaults','localhost','tail','finally','sequence','queueReports','agents','queueChannels','voiceQueues','campaigns','variables','queuesummary','syncQueueSummary','bind','syncQueueSummaryComplete','queuecallerjoin','syncQueueCallerJoin','queuecallerabandon','syncQueueCallerAbandon','queuecallerleave','agentcomplete','syncAgentComplete','syncAgentConnect','varset','syncVarSet','syncHangup','fullybooted','musiconholdstart','syncMusicOnHoldStart','musiconholdstop','syncMusicOnHoldStop','attendedtransfer','syncAttendedTransfer','blindtransfer','syncBlindTransfer','loopQueueSummary','isUndefined','isEmpty','hasOwnProperty','originated','talking','waiting','queueStatusComplete','unlockRR','prototype','clearZombieChannels','channels','switch','isNil','Action','status','channel','catch','No\x20such\x20channel','error','[voiceQueueReport][checkChannel]','[voiceQueueReport][checkVariables]','[FullyBooted]\x20clear\x20realtime','clearQueueReport','inspect','emit','emitVoiceQueueChannelSave','voice_queue_channel:save','emitVoiceQueueChannelRemove','[DEBUG]\x20Emit\x20voice_queue_channel:remove\x20event','stringify','format','voice:queue:%s','name','type','inbound','strategy','answered','available','sumBillable','sumDuration','sumHoldTime','total','Trunk','active','callerid','Interval','voice_queue:save','then','[queuesummary]','isNotNull','queue','countBy','callers','toNumber','loggedIn','loggedin','emitVoiceQueueSummary','[syncQueueSummary][VoiceQueueReport]','flagQueueSummary','syncNewExten','uniqueid','queuecallerjoinAt','position','count','merge','keys','push','[syncQueueCallerJoin][VoiceQueueReport]','last','queuecallercomplete','queuecallercompleteAt','holdtime','originalposition','YYYY-MM-DD\x20HH:mm:ss','queuecallerexitreason','ABANDONED','lastAssignedTo','[syncQueueCallerAbandon][VoiceQueueReport]','syncQueueCallerLeave','queuecallerleaveAt','connectedlinenum','connectedlinename','COMPLETEDBYAGENT','[syncAgentConnect][VoiceQueueReport]','assigned','membername','reason','transfer','COMPLETED','startsWith','toLowerCase','local/','linkedid','queuecallerexit','queuecallerexitAt','seconds','FORWARDTRANSFER','transfertype','FORWARD','transferexten','destexten','transferuniqueid','COMPLETEDBY','toUpperCase','[syncAgentComplete][VoiceQueueReport]','addVariable','variable','value','CONTINUE','queueposition','EXITWITHKEY','[syncVarSet][VoiceQueueReport]','rtpaudioqos','rtpaudioqosjitter','rtpaudioqosjitterbridged','rtpaudioqoslossbridged','rtpaudioqosrtt','rtpaudioqosrttbridged','sipcallid','sipuri','bridgepeer','membercalls','memberdynamic','memberpenalty','memberrealtime','includes','length','unmanaged','abandoned','milliseconds','diff','custom:queuecallerunmanaged','custom:queuecallerabandon','custom:voiceQueueReport','[syncHangup][VoiceQueueReport]','transfereeuniqueid','secondtransfererexten','ATTENDEDTRANSFER','secondtransfereruniqueid','transfertargetuniqueid','origtransfererexten','origtransfereruniqueid','ATTENDED','[syncAttendedTransfer][VoiceQueueReport]','BLINDTRANSFER','extension','BlindTransfer','transfererchannel','[syncBlindTransfer][VoiceQueueReport]','mohstarttime','mohtime','[syncMusicOnHoldStop][VoiceQueueReport]','exports','lodash','moment'];(function(_0x20a584,_0xe384a5){var _0x4b41a8=function(_0x2127c6){while(--_0x2127c6){_0x20a584['push'](_0x20a584['shift']());}};_0x4b41a8(++_0xe384a5);}(_0x462e,0x18a));var _0xe462=function(_0x291de4,_0x2e174a){_0x291de4=_0x291de4-0x0;var _0x5b1e67=_0x462e[_0x291de4];return _0x5b1e67;};'use strict';var _=require(_0xe462('0x0'));var moment=require(_0xe462('0x1'));var BPromise=require('bluebird');var util=require(_0xe462('0x2'));var md5=require(_0xe462('0x3'));var Redis=require(_0xe462('0x4'));var config=require(_0xe462('0x5'));var logger=require(_0xe462('0x6'))(_0xe462('0x7'));var ami=require('../ami');var QueueReport=require('../model/queueReport');config[_0xe462('0x8')]=_[_0xe462('0x9')](config[_0xe462('0x8')],{'host':_0xe462('0xa'),'port':0x18eb});var io=require('socket.io-emitter')(new Redis(config[_0xe462('0x8')]));var Sequence=function(){};Sequence['prototype']['enqueue']=function(_0x37beb4){this[_0xe462('0xb')]=this[_0xe462('0xb')]?this['tail'][_0xe462('0xc')](_0x37beb4):_0x37beb4();};function VoiceQueueReport(_0x3bc9f3){this[_0xe462('0xd')]=new Sequence();this[_0xe462('0xe')]={};this[_0xe462('0xf')]=_0x3bc9f3[_0xe462('0xf')];this['channels']=_0x3bc9f3[_0xe462('0x10')];this['voiceQueues']=_0x3bc9f3[_0xe462('0x11')];this['flagQueueSummary']=!![];this[_0xe462('0x12')]=_0x3bc9f3[_0xe462('0x12')];this[_0xe462('0x13')]={};ami['on'](_0xe462('0x14'),this[_0xe462('0x15')][_0xe462('0x16')](this));ami['on']('queuesummarycomplete',this[_0xe462('0x17')]['bind'](this));ami['on'](_0xe462('0x18'),this[_0xe462('0x19')][_0xe462('0x16')](this));ami['on'](_0xe462('0x1a'),this[_0xe462('0x1b')]['bind'](this));ami['on'](_0xe462('0x1c'),this['syncQueueCallerLeave'][_0xe462('0x16')](this));ami['on'](_0xe462('0x1d'),this[_0xe462('0x1e')]['bind'](this));ami['on']('agentconnect',this[_0xe462('0x1f')][_0xe462('0x16')](this));ami['on'](_0xe462('0x20'),this[_0xe462('0x21')][_0xe462('0x16')](this));ami['on']('hangup',this[_0xe462('0x22')][_0xe462('0x16')](this));ami['on'](_0xe462('0x23'),this['syncFullyBooted'][_0xe462('0x16')](this));ami['on'](_0xe462('0x24'),this[_0xe462('0x25')][_0xe462('0x16')](this));ami['on'](_0xe462('0x26'),this[_0xe462('0x27')]['bind'](this));ami['on'](_0xe462('0x28'),this[_0xe462('0x29')][_0xe462('0x16')](this));ami['on'](_0xe462('0x2a'),this[_0xe462('0x2b')]['bind'](this));this[_0xe462('0x2c')]();this['loopQueueShow']();}function isNotNull(_0x545bf3){return _0x545bf3!==null&&!_[_0xe462('0x2d')](_0x545bf3);}function clearChannels(_0x4d4cc9){if(!_[_0xe462('0x2e')](_0x4d4cc9)){for(var _0x35fdae in _0x4d4cc9){if(_0x4d4cc9[_0xe462('0x2f')](_0x35fdae)){delete _0x4d4cc9[_0x35fdae];}}}}function clearCampaigns(_0x28b362){if(!_['isEmpty'](_0x28b362)){for(var _0x534f10 in _0x28b362){if(_0x28b362['hasOwnProperty'](_0x534f10)){_0x28b362[_0x534f10][_0xe462('0x30')]=0x0;}}}}function clearVoiceQueues(_0x4c6f54){if(!_[_0xe462('0x2e')](_0x4c6f54)){for(var _0x4822c3 in _0x4c6f54){if(_0x4c6f54[_0xe462('0x2f')](_0x4822c3)){_0x4c6f54[_0x4822c3][_0xe462('0x30')]=0x0;_0x4c6f54[_0x4822c3][_0xe462('0x31')]=0x0;_0x4c6f54[_0x4822c3]['pTalking']=0x0;_0x4c6f54[_0x4822c3][_0xe462('0x32')]=0x0;_0x4c6f54[_0x4822c3][_0xe462('0x33')]=!![];}}}}function clearAgentBooked(_0xd6dc75){if(!_['isEmpty'](_0xd6dc75)){for(var _0xbc5e13 in _0xd6dc75){if(_0xd6dc75[_0xe462('0x2f')](_0xbc5e13)){_0xd6dc75[_0xbc5e13][_0xe462('0x34')]=!![];}}}}VoiceQueueReport[_0xe462('0x35')][_0xe462('0x36')]=function(){var _0x331c4c=this;for(var _0x8816d9 in this[_0xe462('0x37')]){if(this[_0xe462('0x37')][_0xe462('0x2f')](_0x8816d9)&&!this[_0xe462('0x37')][_0x8816d9][_0xe462('0x38')]){this[_0xe462('0xd')]['enqueue'](function(){if(!_[_0xe462('0x39')](_0x331c4c['channels'][_0x8816d9])){return ami[_0xe462('0x3a')]({'action':_0xe462('0x3b'),'channel':_0x331c4c[_0xe462('0x37')][_0x8816d9][_0xe462('0x3c')]})[_0xe462('0x3d')](function(_0x3361c1){if(_0x3361c1['message']===_0xe462('0x3e')){setTimeout(function(){if(_0x331c4c[_0xe462('0x37')][_0x8816d9]){delete _0x331c4c[_0xe462('0x37')][_0x8816d9];logger[_0xe462('0x3f')](_0xe462('0x40'),_0x8816d9);}if(_0x331c4c[_0xe462('0xe')][_0x8816d9]){delete _0x331c4c[_0xe462('0xe')][_0x8816d9];logger[_0xe462('0x3f')]('[voiceQueueReport][checkQueueReport]',_0x8816d9);}if(_0x331c4c[_0xe462('0x13')][_0x8816d9]){delete _0x331c4c[_0xe462('0x13')][_0x8816d9];logger[_0xe462('0x3f')](_0xe462('0x41'),_0x8816d9);}},0x1f40);}});}});}}};VoiceQueueReport[_0xe462('0x35')]['syncFullyBooted']=function(){logger[_0xe462('0x3f')](_0xe462('0x42'));clearChannels(this[_0xe462('0x37')]);this[_0xe462('0x43')](this[_0xe462('0xe')]);clearAgentBooked(this['agents']);clearVoiceQueues(this[_0xe462('0x11')]);clearCampaigns(this[_0xe462('0x12')]);};VoiceQueueReport[_0xe462('0x35')][_0xe462('0x43')]=function(_0x36a7c5){var _0x3cc1a9=this;if(!_[_0xe462('0x2e')](_0x36a7c5)){for(var _0xf5c492 in _0x36a7c5){if(_0x36a7c5[_0xe462('0x2f')](_0xf5c492)){_0x3cc1a9['emitVoiceQueueChannelRemove'](_0x36a7c5[_0xf5c492]);delete _0x36a7c5[_0xf5c492];}}}};function loggerCatch(_0x104b68){return function(_0x2c48a3){logger[_0xe462('0x3f')](_0x104b68,util[_0xe462('0x44')](_0x2c48a3,{'showHidden':![],'depth':null}));};}VoiceQueueReport[_0xe462('0x35')][_0xe462('0x45')]=function(_0x1b74eb,_0x2bf663,_0x37111a){io['to'](_0x1b74eb)['emit'](_0x2bf663,_0x37111a);};VoiceQueueReport['prototype'][_0xe462('0x46')]=function(_0x10d7e8){this[_0xe462('0x45')](util['format']('voice:queue:%s',_0x10d7e8['name']),_0xe462('0x47'),_0x10d7e8);};VoiceQueueReport[_0xe462('0x35')][_0xe462('0x48')]=function(_0x546386){logger['info'](_0xe462('0x49'),JSON[_0xe462('0x4a')](_0x546386));this[_0xe462('0x45')](util[_0xe462('0x4b')](_0xe462('0x4c'),_0x546386[_0xe462('0x4d')]),'voice_queue_channel:remove',_0x546386);};VoiceQueueReport[_0xe462('0x35')]['emitVoiceQueueSummary']=function(_0x1d047b){if(_0x1d047b[_0xe462('0x4e')]===_0xe462('0x4f')){var _0xdda8fa={'id':_0x1d047b['id'],'name':_0x1d047b['name'],'strategy':_0x1d047b[_0xe462('0x50')],'answered':_0x1d047b[_0xe462('0x51')],'available':_0x1d047b[_0xe462('0x52')],'loggedIn':_0x1d047b['loggedIn'],'pTalking':_0x1d047b['pTalking'],'sumBillable':_0x1d047b[_0xe462('0x53')],'sumDuration':_0x1d047b[_0xe462('0x54')],'sumHoldTime':_0x1d047b[_0xe462('0x55')]||0x0,'talking':_0x1d047b[_0xe462('0x31')],'total':_0x1d047b[_0xe462('0x56')],'type':_0x1d047b[_0xe462('0x4e')],'unmanaged':_0x1d047b['unmanaged'],'abandoned':_0x1d047b['abandoned'],'waiting':_0x1d047b[_0xe462('0x32')]};if(_0x1d047b['Trunk']){_0xdda8fa[_0xe462('0x57')]={'id':_0x1d047b[_0xe462('0x57')]['id'],'name':_0x1d047b[_0xe462('0x57')]['name'],'active':_0x1d047b[_0xe462('0x57')][_0xe462('0x58')],'callerid':_0x1d047b[_0xe462('0x57')][_0xe462('0x59')]};}if(_0x1d047b[_0xe462('0x5a')]){_0xdda8fa[_0xe462('0x5a')]={'id':_0x1d047b[_0xe462('0x5a')]['id'],'name':_0x1d047b['Interval'][_0xe462('0x4d')]};}var _0x54caab=md5(JSON[_0xe462('0x4a')](_0xdda8fa));if(_0x1d047b[_0xe462('0x3')]!==_0x54caab){_0x1d047b[_0xe462('0x3')]=_0x54caab;this[_0xe462('0x45')](util[_0xe462('0x4b')]('voice:queue:%s',_0xdda8fa[_0xe462('0x4d')]),_0xe462('0x5b'),_0xdda8fa);}}};VoiceQueueReport[_0xe462('0x35')]['isNotNull']=function(_0x2812bb){return _0x2812bb!==null&&!_[_0xe462('0x2d')](_0x2812bb);};VoiceQueueReport['prototype']['loopQueueShow']=function(){var _0x2ec27e=this;setInterval(function(){_0x2ec27e[_0xe462('0x36')]();ami[_0xe462('0x3a')]({'action':'queues'})[_0xe462('0x3d')](loggerCatch('[queues]'));},0x2710);};VoiceQueueReport[_0xe462('0x35')][_0xe462('0x2c')]=function(){var _0x43aae1=this;setInterval(function(){if(_0x43aae1['flagQueueSummary']){return ami['Action']({'action':_0xe462('0x14')})[_0xe462('0x5c')](function(_0x5bb218){_0x43aae1['flagQueueSummary']=![];})['catch'](loggerCatch(_0xe462('0x5d')));}},0x3e8);};VoiceQueueReport['prototype'][_0xe462('0x15')]=function(_0x33a249){try{if(this['isNotNull'](_0x33a249)&&this[_0xe462('0x5e')](_0x33a249['queue'])){if(this[_0xe462('0x11')][_0x33a249[_0xe462('0x5f')]]){var _0x5cfcaa=_[_0xe462('0x60')](this['channels'],_0xe462('0x5f'))[_0x33a249['queue']]||0x0;var _0x51004c=_0x5cfcaa-_0x33a249[_0xe462('0x61')];if(this[_0xe462('0x11')][_0x33a249[_0xe462('0x5f')]][_0xe462('0x32')]!==_[_0xe462('0x62')](_0x33a249[_0xe462('0x61')])||this[_0xe462('0x11')][_0x33a249[_0xe462('0x5f')]][_0xe462('0x63')]!==_[_0xe462('0x62')](_0x33a249[_0xe462('0x64')])||this['voiceQueues'][_0x33a249[_0xe462('0x5f')]][_0xe462('0x52')]!==_[_0xe462('0x62')](_0x33a249[_0xe462('0x52')])||this['voiceQueues'][_0x33a249[_0xe462('0x5f')]][_0xe462('0x31')]!==_0x51004c){this[_0xe462('0x11')][_0x33a249[_0xe462('0x5f')]][_0xe462('0x32')]=_['toNumber'](_0x33a249['callers']);this[_0xe462('0x11')][_0x33a249[_0xe462('0x5f')]][_0xe462('0x63')]=_[_0xe462('0x62')](_0x33a249[_0xe462('0x64')]);this['voiceQueues'][_0x33a249[_0xe462('0x5f')]][_0xe462('0x52')]=_['toNumber'](_0x33a249[_0xe462('0x52')]);this[_0xe462('0x11')][_0x33a249[_0xe462('0x5f')]][_0xe462('0x31')]=_0x51004c>0x0?_0x51004c:0x0;this['voiceQueues'][_0x33a249['queue']][_0xe462('0x31')]=this[_0xe462('0x11')][_0x33a249[_0xe462('0x5f')]]['talking']>_[_0xe462('0x62')](_0x33a249[_0xe462('0x64')])?_[_0xe462('0x62')](_0x33a249[_0xe462('0x64')]):this[_0xe462('0x11')][_0x33a249[_0xe462('0x5f')]][_0xe462('0x31')];this[_0xe462('0x65')](this[_0xe462('0x11')][_0x33a249[_0xe462('0x5f')]]);}ami[_0xe462('0x45')]('custom:queuesummary',this[_0xe462('0x11')][_0x33a249[_0xe462('0x5f')]]);}}}catch(_0x192081){logger[_0xe462('0x3f')](_0xe462('0x66'),util[_0xe462('0x44')](_0x192081,{'showHidden':![],'depth':null}));}};VoiceQueueReport[_0xe462('0x35')][_0xe462('0x17')]=function(_0x4abc52){this[_0xe462('0x67')]=!![];};VoiceQueueReport[_0xe462('0x35')][_0xe462('0x68')]=function(_0x58dbde){};VoiceQueueReport[_0xe462('0x35')][_0xe462('0x19')]=function(_0x24f564){try{if(this[_0xe462('0x5e')](_0x24f564)){if(_[_0xe462('0x2d')](this[_0xe462('0xe')][_0x24f564['uniqueid']])){this[_0xe462('0xe')][_0x24f564[_0xe462('0x69')]]=[];this[_0xe462('0x37')][_0x24f564[_0xe462('0x69')]]={};}var _0x3d9da4=new QueueReport();_0x3d9da4[_0xe462('0x4d')]=_0x24f564[_0xe462('0x5f')];_0x3d9da4[_0xe462('0x4e')]=this['voiceQueues'][_0x3d9da4[_0xe462('0x4d')]]&&this['voiceQueues'][_0x3d9da4[_0xe462('0x4d')]]['type']?this['voiceQueues'][_0x3d9da4[_0xe462('0x4d')]]['type']||_0xe462('0x4f'):'inbound';_0x3d9da4['queue']=_0x24f564[_0xe462('0x5f')];_0x3d9da4[_0xe462('0x6a')]=moment()[_0xe462('0x4b')]('YYYY-MM-DD\x20HH:mm:ss');_0x3d9da4[_0xe462('0x6b')]=_0x24f564[_0xe462('0x6b')];_0x3d9da4[_0xe462('0x6c')]=_0x24f564['count'];_[_0xe462('0x6d')](_0x3d9da4,_['pick'](_0x24f564,_[_0xe462('0x6e')](_0x3d9da4)));this['queueReports'][_0x24f564[_0xe462('0x69')]][_0xe462('0x6f')](_0x3d9da4);this[_0xe462('0x37')][_0x24f564[_0xe462('0x69')]]=_0x3d9da4;this[_0xe462('0x46')](_0x3d9da4);}}catch(_0xf374a0){logger[_0xe462('0x3f')](_0xe462('0x70'),util[_0xe462('0x44')](_0xf374a0,{'showHidden':![],'depth':null}));}};VoiceQueueReport['prototype'][_0xe462('0x1b')]=function(_0x2c6c40){try{if(this[_0xe462('0x5e')](_0x2c6c40)){if(this[_0xe462('0xe')][_0x2c6c40['uniqueid']]){var _0x338806=_[_0xe462('0x71')](this['queueReports'][_0x2c6c40[_0xe462('0x69')]]);_0x338806[_0xe462('0x72')]=![];_0x338806[_0xe462('0x73')]=null;_0x338806['holdtime']=_0x2c6c40[_0xe462('0x74')];_0x338806[_0xe462('0x75')]=_0x2c6c40[_0xe462('0x75')];_0x338806[_0xe462('0x1a')]=!![];_0x338806['queuecallerabandonAt']=moment()[_0xe462('0x4b')](_0xe462('0x76'));_0x338806[_0xe462('0x77')]=_0xe462('0x78');_0x338806[_0xe462('0x79')]=null;this[_0xe462('0x37')][_0x2c6c40[_0xe462('0x69')]]=_0x338806;this['emitVoiceQueueChannelRemove'](_0x338806);}}}catch(_0x59be29){logger[_0xe462('0x3f')](_0xe462('0x7a'),util[_0xe462('0x44')](_0x59be29,{'showHidden':![],'depth':null}));}};VoiceQueueReport[_0xe462('0x35')][_0xe462('0x7b')]=function(_0x29ed3e){try{if(this[_0xe462('0x5e')](_0x29ed3e)){if(this[_0xe462('0xe')][_0x29ed3e[_0xe462('0x69')]]){var _0x1c719d=_['last'](this[_0xe462('0xe')][_0x29ed3e[_0xe462('0x69')]]);_0x1c719d[_0xe462('0x7c')]=moment()[_0xe462('0x4b')](_0xe462('0x76'));_0x1c719d[_0xe462('0x7d')]=_0x29ed3e['connectedlinenum'];_0x1c719d[_0xe462('0x7e')]=_0x29ed3e['connectedlinename'];this[_0xe462('0x37')][_0x29ed3e[_0xe462('0x69')]]=_0x1c719d;this['emitVoiceQueueChannelSave'](_0x1c719d);}}}catch(_0x4cff28){logger[_0xe462('0x3f')]('[syncQueueCallerLeave][VoiceQueueReport]',util['inspect'](_0x4cff28,{'showHidden':![],'depth':null}));}};VoiceQueueReport[_0xe462('0x35')][_0xe462('0x1f')]=function(_0x46a08b){try{if(this[_0xe462('0x5e')](_0x46a08b)){if(this['queueReports'][_0x46a08b[_0xe462('0x69')]]){var _0x5bf48e=_[_0xe462('0x71')](this[_0xe462('0xe')][_0x46a08b[_0xe462('0x69')]]);_0x5bf48e[_0xe462('0x72')]=!![];_0x5bf48e[_0xe462('0x77')]=_0xe462('0x7f');}}}catch(_0x26a162){logger['error'](_0xe462('0x80'),util[_0xe462('0x44')](_0x26a162,{'showHidden':![],'depth':null}));}};VoiceQueueReport[_0xe462('0x35')][_0xe462('0x1e')]=function(_0xc49d8){try{if(this[_0xe462('0x5e')](_0xc49d8)){if(this[_0xe462('0xe')][_0xc49d8[_0xe462('0x69')]]){var _0x524e15=_['last'](this[_0xe462('0xe')][_0xc49d8['uniqueid']]);_0x524e15['queuecallerabandon']=![];_0x524e15['queuecallerabandonAt']=null;_0x524e15[_0xe462('0x81')]=!![];_0x524e15[_0xe462('0x79')]=_0xc49d8[_0xe462('0x82')];_0x524e15[_0xe462('0x74')]=_0xc49d8['holdtime'];_0x524e15[_0xe462('0x72')]=!![];_0x524e15['queuecallerexit']=![];_0x524e15['queuecallerexitAt']=null;if(!_0x524e15['transfer']){if(_0xc49d8[_0xe462('0x83')]==_0xe462('0x84')){_0x524e15[_0xe462('0x77')]=_0xe462('0x85');}else{if(_[_0xe462('0x86')](_0xc49d8[_0xe462('0x3c')][_0xe462('0x87')](),_0xe462('0x88'))){if(this[_0xe462('0xe')][_0xc49d8[_0xe462('0x89')]]){var _0x45ecb5=_['last'](this[_0xe462('0xe')][_0xc49d8[_0xe462('0x89')]]);_0x45ecb5[_0xe462('0x72')]=![];_0x45ecb5[_0xe462('0x8a')]=!![];_0x45ecb5[_0xe462('0x8b')]=moment(_0x524e15['queuecallerjoinAt'])['add'](_0xc49d8['holdtime'],_0xe462('0x8c'))[_0xe462('0x4b')]('YYYY-MM-DD\x20HH:mm:ss');_0x45ecb5[_0xe462('0x77')]=_0xe462('0x8d');_0x45ecb5[_0xe462('0x84')]=!![];_0x45ecb5[_0xe462('0x8e')]=_0xe462('0x8f');_0x45ecb5[_0xe462('0x90')]=_0xc49d8[_0xe462('0x91')];_0x45ecb5[_0xe462('0x92')]=_0xc49d8[_0xe462('0x69')];var _0x4d3365=this[_0xe462('0xe')][_0xc49d8[_0xe462('0x89')]];this[_0xe462('0xe')][_0xc49d8[_0xe462('0x89')]]=this['queueReports'][_0xc49d8[_0xe462('0x69')]];this['queueReports'][_0xc49d8[_0xe462('0x69')]]=_0x4d3365;}}else{_0x524e15[_0xe462('0x77')]=_0xe462('0x93')+_0xc49d8[_0xe462('0x83')][_0xe462('0x94')]();}}}this['channels'][_0xc49d8[_0xe462('0x69')]]=_0x524e15;this['emitVoiceQueueChannelRemove'](_0x524e15);}}}catch(_0x1cd4a6){logger[_0xe462('0x3f')](_0xe462('0x95'),util[_0xe462('0x44')](_0x1cd4a6,{'showHidden':![],'depth':null}));}};VoiceQueueReport[_0xe462('0x35')][_0xe462('0x21')]=function(_0x2de72e){try{if(this[_0xe462('0x5e')](_0x2de72e)){this[_0xe462('0x96')](_0x2de72e[_0xe462('0x69')],_[_0xe462('0x6e')](_0x2de72e[_0xe462('0x97')])[0x0],_0x2de72e['value']);if(this[_0xe462('0xe')][_0x2de72e[_0xe462('0x69')]]){var _0x9188a8=_[_0xe462('0x71')](this['queueReports'][_0x2de72e['uniqueid']]);if(_0x9188a8){if(this[_0xe462('0x5e')](_0x2de72e[_0xe462('0x97')])&&this[_0xe462('0x5e')](_0x2de72e[_0xe462('0x97')]['queuestatus'])){switch(_0x2de72e[_0xe462('0x98')]){case _0xe462('0x99'):_0x9188a8[_0xe462('0x8a')]=![];_0x9188a8['queuecallerexitAt']=null;break;default:_0x9188a8[_0xe462('0x8a')]=!![];_0x9188a8['queuecallerexitAt']=moment()[_0xe462('0x4b')](_0xe462('0x76'));_0x9188a8[_0xe462('0x7c')]=moment()[_0xe462('0x4b')](_0xe462('0x76'));}_0x9188a8[_0xe462('0x1a')]=![];_0x9188a8['queuecallerabandonAt']=null;_0x9188a8[_0xe462('0x77')]=_0x2de72e['value'];this[_0xe462('0x37')][_0x2de72e['uniqueid']]=_0x9188a8;this[_0xe462('0x48')](_0x9188a8);}else if(this['isNotNull'](_0x2de72e['variable'])&&this['isNotNull'](_0x2de72e[_0xe462('0x97')][_0xe462('0x9a')])){if(!_0x9188a8[_0xe462('0x1a')]){_0x9188a8[_0xe462('0x8a')]=!![];_0x9188a8[_0xe462('0x8b')]=moment()[_0xe462('0x4b')](_0xe462('0x76'));_0x9188a8[_0xe462('0x77')]=_0xe462('0x9b');_0x9188a8[_0xe462('0x7c')]=moment()[_0xe462('0x4b')](_0xe462('0x76'));this[_0xe462('0x37')][_0x2de72e['uniqueid']]=_0x9188a8;}}_0x9188a8[_0xe462('0x13')]=this[_0xe462('0x13')][_0x2de72e['uniqueid']];}}}}catch(_0x1ab211){logger[_0xe462('0x3f')](_0xe462('0x9c'),util[_0xe462('0x44')](_0x1ab211,{'showHidden':![],'depth':null}));}};VoiceQueueReport[_0xe462('0x35')][_0xe462('0x96')]=function(_0x1dbe53,_0x17392c,_0x400a45){var _0x5efb1a=[_0xe462('0x9d'),'rtpaudioqosbridged',_0xe462('0x9e'),_0xe462('0x9f'),'rtpaudioqosloss',_0xe462('0xa0'),_0xe462('0xa1'),_0xe462('0xa2'),_0xe462('0xa3'),_0xe462('0xa4'),_0xe462('0xa5'),'bridgepvtcallid',_0xe462('0xa6'),_0xe462('0xa7'),'memberinterface','memberlastcall',_0xe462('0x82'),_0xe462('0xa8'),_0xe462('0xa9')];if(!_['isNil'](_0x17392c)&&!_[_0xe462('0xaa')](_0x5efb1a,_0x17392c)){if(_[_0xe462('0x2d')](this[_0xe462('0x13')][_0x1dbe53])){this[_0xe462('0x13')][_0x1dbe53]={};}this[_0xe462('0x13')][_0x1dbe53][_0x17392c]=_0x400a45;}};VoiceQueueReport[_0xe462('0x35')]['syncHangup']=function(_0x3e0e45){try{if(this[_0xe462('0x5e')](_0x3e0e45)){if(this[_0xe462('0xe')][_0x3e0e45[_0xe462('0x69')]]){for(var _0x14e7ef=0x0,_0x3ab75d={};_0x14e7ef0x0?_0x3820ce:0x0;this[_0xb47c('0x13')][_0x34b148[_0xb47c('0x60')]][_0xb47c('0x66')]=this[_0xb47c('0x13')][_0x34b148[_0xb47c('0x60')]][_0xb47c('0x66')]>_['toNumber'](_0x34b148['loggedin'])?_['toNumber'](_0x34b148['loggedin']):this['voiceQueues'][_0x34b148[_0xb47c('0x60')]]['talking'];this[_0xb47c('0x4c')](this[_0xb47c('0x13')][_0x34b148['queue']]);}ami['emit'](_0xb47c('0x67'),this[_0xb47c('0x13')][_0x34b148[_0xb47c('0x60')]]);}}}catch(_0x10452a){logger[_0xb47c('0x3f')]('[syncQueueSummary][VoiceQueueReport]',util[_0xb47c('0x42')](_0x10452a,{'showHidden':![],'depth':null}));}};VoiceQueueReport[_0xb47c('0xc')][_0xb47c('0x68')]=function(_0x361fa4){this['flagQueueSummary']=!![];};VoiceQueueReport['prototype']['syncNewExten']=function(_0x591303){};VoiceQueueReport[_0xb47c('0xc')][_0xb47c('0x1b')]=function(_0x3fdc33){try{if(this[_0xb47c('0x5a')](_0x3fdc33)){if(_['isUndefined'](this[_0xb47c('0x3d')][_0x3fdc33[_0xb47c('0x69')]])){this[_0xb47c('0x3d')][_0x3fdc33[_0xb47c('0x69')]]=[];this[_0xb47c('0x11')][_0x3fdc33[_0xb47c('0x69')]]={};}var _0x4fb112=new QueueReport();_0x4fb112[_0xb47c('0x45')]=_0x3fdc33[_0xb47c('0x60')];_0x4fb112['type']=this['voiceQueues'][_0x4fb112[_0xb47c('0x45')]]&&this[_0xb47c('0x13')][_0x4fb112[_0xb47c('0x45')]][_0xb47c('0x4d')]?this[_0xb47c('0x13')][_0x4fb112[_0xb47c('0x45')]]['type']||_0xb47c('0x4e'):_0xb47c('0x4e');_0x4fb112[_0xb47c('0x60')]=_0x3fdc33[_0xb47c('0x60')];_0x4fb112[_0xb47c('0x6a')]=moment()[_0xb47c('0x4a')](_0xb47c('0x6b'));_0x4fb112[_0xb47c('0x6c')]=_0x3fdc33[_0xb47c('0x6c')];_0x4fb112[_0xb47c('0x6d')]=_0x3fdc33[_0xb47c('0x6d')];_['merge'](_0x4fb112,_[_0xb47c('0x6e')](_0x3fdc33,_[_0xb47c('0x6f')](_0x4fb112)));this['queueReports'][_0x3fdc33['uniqueid']][_0xb47c('0x70')](_0x4fb112);this[_0xb47c('0x11')][_0x3fdc33['uniqueid']]=_0x4fb112;this['emitVoiceQueueChannelSave'](_0x4fb112);}}catch(_0x39ccdc){logger[_0xb47c('0x3f')]('[syncQueueCallerJoin][VoiceQueueReport]',util[_0xb47c('0x42')](_0x39ccdc,{'showHidden':![],'depth':null}));}};VoiceQueueReport[_0xb47c('0xc')][_0xb47c('0x1d')]=function(_0x362d78){try{if(this[_0xb47c('0x5a')](_0x362d78)){if(this['queueReports'][_0x362d78['uniqueid']]){var _0x55209d=_[_0xb47c('0x71')](this[_0xb47c('0x3d')][_0x362d78[_0xb47c('0x69')]]);_0x55209d[_0xb47c('0x72')]=![];_0x55209d['queuecallercompleteAt']=null;_0x55209d[_0xb47c('0x73')]=_0x362d78['holdtime'];_0x55209d[_0xb47c('0x74')]=_0x362d78[_0xb47c('0x74')];_0x55209d['queuecallerabandon']=!![];_0x55209d[_0xb47c('0x75')]=moment()[_0xb47c('0x4a')](_0xb47c('0x6b'));_0x55209d[_0xb47c('0x76')]=_0xb47c('0x77');_0x55209d[_0xb47c('0x78')]=null;this['channels'][_0x362d78[_0xb47c('0x69')]]=_0x55209d;this[_0xb47c('0x47')](_0x55209d);}}}catch(_0x1124a3){logger[_0xb47c('0x3f')](_0xb47c('0x79'),util[_0xb47c('0x42')](_0x1124a3,{'showHidden':![],'depth':null}));}};VoiceQueueReport[_0xb47c('0xc')][_0xb47c('0x1e')]=function(_0x3c1af4){try{if(this[_0xb47c('0x5a')](_0x3c1af4)){if(this[_0xb47c('0x3d')][_0x3c1af4[_0xb47c('0x69')]]){var _0x24b0c6=_[_0xb47c('0x71')](this[_0xb47c('0x3d')][_0x3c1af4[_0xb47c('0x69')]]);_0x24b0c6['queuecallerleaveAt']=moment()[_0xb47c('0x4a')](_0xb47c('0x6b'));_0x24b0c6[_0xb47c('0x7a')]=_0x3c1af4['connectedlinenum'];_0x24b0c6[_0xb47c('0x7b')]=_0x3c1af4[_0xb47c('0x7b')];this[_0xb47c('0x11')][_0x3c1af4['uniqueid']]=_0x24b0c6;this['emitVoiceQueueChannelSave'](_0x24b0c6);}}}catch(_0x60ba40){logger['error']('[syncQueueCallerLeave][VoiceQueueReport]',util['inspect'](_0x60ba40,{'showHidden':![],'depth':null}));}};VoiceQueueReport[_0xb47c('0xc')]['syncAgentConnect']=function(_0x511d91){try{if(this[_0xb47c('0x5a')](_0x511d91)){if(this[_0xb47c('0x3d')][_0x511d91[_0xb47c('0x69')]]){var _0x279ca6=_['last'](this[_0xb47c('0x3d')][_0x511d91[_0xb47c('0x69')]]);_0x279ca6[_0xb47c('0x72')]=!![];_0x279ca6['queuecallerexitreason']=_0xb47c('0x7c');}}}catch(_0x5b6610){logger[_0xb47c('0x3f')](_0xb47c('0x7d'),util['inspect'](_0x5b6610,{'showHidden':![],'depth':null}));}};VoiceQueueReport['prototype'][_0xb47c('0x20')]=function(_0x5f3d16){try{if(this['isNotNull'](_0x5f3d16)){if(this['queueReports'][_0x5f3d16[_0xb47c('0x69')]]){var _0x528bfe=_['last'](this['queueReports'][_0x5f3d16[_0xb47c('0x69')]]);_0x528bfe[_0xb47c('0x1c')]=![];_0x528bfe[_0xb47c('0x75')]=null;_0x528bfe[_0xb47c('0x7e')]=!![];_0x528bfe['lastAssignedTo']=_0x5f3d16['membername'];_0x528bfe[_0xb47c('0x73')]=_0x5f3d16['holdtime'];_0x528bfe[_0xb47c('0x72')]=!![];_0x528bfe[_0xb47c('0x7f')]=![];_0x528bfe[_0xb47c('0x80')]=null;if(!_0x528bfe[_0xb47c('0x81')]){if(_0x5f3d16[_0xb47c('0x82')]==_0xb47c('0x81')){_0x528bfe['queuecallerexitreason']=_0xb47c('0x83');}else{if(_[_0xb47c('0x84')](_0x5f3d16[_0xb47c('0x85')][_0xb47c('0x86')](),_0xb47c('0x87'))){if(this[_0xb47c('0x3d')][_0x5f3d16[_0xb47c('0x88')]]){var _0x49239f=_[_0xb47c('0x71')](this[_0xb47c('0x3d')][_0x5f3d16[_0xb47c('0x88')]]);_0x49239f['queuecallercomplete']=![];_0x49239f[_0xb47c('0x7f')]=!![];_0x49239f[_0xb47c('0x80')]=moment(_0x528bfe[_0xb47c('0x6a')])[_0xb47c('0x89')](_0x5f3d16['holdtime'],_0xb47c('0x8a'))[_0xb47c('0x4a')](_0xb47c('0x6b'));_0x49239f['queuecallerexitreason']=_0xb47c('0x8b');_0x49239f[_0xb47c('0x81')]=!![];_0x49239f[_0xb47c('0x8c')]=_0xb47c('0x8d');_0x49239f['transferexten']=_0x5f3d16[_0xb47c('0x8e')];_0x49239f['transferuniqueid']=_0x5f3d16[_0xb47c('0x69')];var _0x48d20b=this[_0xb47c('0x3d')][_0x5f3d16[_0xb47c('0x88')]];this[_0xb47c('0x3d')][_0x5f3d16[_0xb47c('0x88')]]=this[_0xb47c('0x3d')][_0x5f3d16[_0xb47c('0x69')]];this[_0xb47c('0x3d')][_0x5f3d16['uniqueid']]=_0x48d20b;}}else{_0x528bfe[_0xb47c('0x76')]=_0xb47c('0x8f')+_0x5f3d16[_0xb47c('0x82')][_0xb47c('0x90')]();}}}this[_0xb47c('0x11')][_0x5f3d16[_0xb47c('0x69')]]=_0x528bfe;this[_0xb47c('0x47')](_0x528bfe);}}}catch(_0x4fc0b9){logger[_0xb47c('0x3f')](_0xb47c('0x91'),util[_0xb47c('0x42')](_0x4fc0b9,{'showHidden':![],'depth':null}));}};VoiceQueueReport[_0xb47c('0xc')][_0xb47c('0x22')]=function(_0x5958a8){try{if(this[_0xb47c('0x5a')](_0x5958a8)){this[_0xb47c('0x92')](_0x5958a8[_0xb47c('0x69')],_['keys'](_0x5958a8[_0xb47c('0x93')])[0x0],_0x5958a8[_0xb47c('0x94')]);if(this['queueReports'][_0x5958a8[_0xb47c('0x69')]]){var _0x2724dc=_[_0xb47c('0x71')](this['queueReports'][_0x5958a8[_0xb47c('0x69')]]);if(_0x2724dc){if(this[_0xb47c('0x5a')](_0x5958a8[_0xb47c('0x93')])&&this[_0xb47c('0x5a')](_0x5958a8[_0xb47c('0x93')][_0xb47c('0x95')])){switch(_0x5958a8['value']){case _0xb47c('0x96'):_0x2724dc[_0xb47c('0x7f')]=![];_0x2724dc[_0xb47c('0x80')]=null;break;default:_0x2724dc['queuecallerexit']=!![];_0x2724dc[_0xb47c('0x80')]=moment()[_0xb47c('0x4a')](_0xb47c('0x6b'));_0x2724dc[_0xb47c('0x97')]=moment()[_0xb47c('0x4a')](_0xb47c('0x6b'));}_0x2724dc['queuecallerabandon']=![];_0x2724dc[_0xb47c('0x75')]=null;_0x2724dc[_0xb47c('0x76')]=_0x5958a8['value'];this[_0xb47c('0x11')][_0x5958a8[_0xb47c('0x69')]]=_0x2724dc;this[_0xb47c('0x47')](_0x2724dc);}else if(this[_0xb47c('0x5a')](_0x5958a8['variable'])&&this['isNotNull'](_0x5958a8[_0xb47c('0x93')]['queueposition'])){if(!_0x2724dc['queuecallerabandon']){_0x2724dc[_0xb47c('0x7f')]=!![];_0x2724dc[_0xb47c('0x80')]=moment()['format']('YYYY-MM-DD\x20HH:mm:ss');_0x2724dc[_0xb47c('0x76')]='EXITWITHKEY';_0x2724dc['queuecallerleaveAt']=moment()['format']('YYYY-MM-DD\x20HH:mm:ss');this['channels'][_0x5958a8['uniqueid']]=_0x2724dc;}}_0x2724dc[_0xb47c('0x16')]=this[_0xb47c('0x16')][_0x5958a8[_0xb47c('0x69')]];}}}}catch(_0x82acf4){logger[_0xb47c('0x3f')](_0xb47c('0x98'),util[_0xb47c('0x42')](_0x82acf4,{'showHidden':![],'depth':null}));}};VoiceQueueReport[_0xb47c('0xc')]['addVariable']=function(_0x37233d,_0x3de9df,_0x2c0207){var _0x4ccbf0=['rtpaudioqos',_0xb47c('0x99'),'rtpaudioqosjitter',_0xb47c('0x9a'),_0xb47c('0x9b'),'rtpaudioqoslossbridged',_0xb47c('0x9c'),_0xb47c('0x9d'),_0xb47c('0x9e'),'sipuri',_0xb47c('0x9f'),_0xb47c('0xa0'),_0xb47c('0xa1'),_0xb47c('0xa2'),_0xb47c('0xa3'),_0xb47c('0xa4'),_0xb47c('0xa5'),_0xb47c('0xa6'),'memberrealtime'];if(!_[_0xb47c('0x37')](_0x3de9df)&&!_[_0xb47c('0xa7')](_0x4ccbf0,_0x3de9df)){if(_['isUndefined'](this[_0xb47c('0x16')][_0x37233d])){this['variables'][_0x37233d]={};}this[_0xb47c('0x16')][_0x37233d][_0x3de9df]=_0x2c0207;}};VoiceQueueReport[_0xb47c('0xc')][_0xb47c('0x24')]=function(_0x352051){try{if(this[_0xb47c('0x5a')](_0x352051)){if(this[_0xb47c('0x3d')][_0x352051[_0xb47c('0x69')]]){for(var _0x515a28=0x0,_0x4dc7a4={};_0x515a28=0x0?moment(_0x4d3c31['endtime'])[_0x6780('0xc')](_0x4d3c31[_0x6780('0x15')],_0x6780('0xd')):null,'data1':_0x6780('0x17'),'data2':_0x4d3c31[_0x6780('0x11')],'data3':_0x4d3c31[_0x6780('0xf')],'data4':_0x4d3c31['dialstring']||null,'role':_0x6780('0x18'),'internal':_0x4d3c31['accountcode']?_['toNumber'](_0x4d3c31[_0x6780('0x11')]):undefined,'uniqueid':_0x4d3c31['uniqueid']},'log':_0x6780('0x13')});};
\ No newline at end of file
+var _0x4627=['queuecallerexitAt','Request','CreateMemberReport','voice','lastAssignedTo','isNil','interface','TALKING','queuecallerleaveAt','inbound','exten','queue','agent','accountcode','toNumber','uniqueid','voiceDialReport','starttime','endtime','seconds','diff','outbound','dialstring','moment','lodash','util','voiceQueueReport','queuecallercompleteAt'];(function(_0x506762,_0x5d8c45){var _0x4d5a45=function(_0x239875){while(--_0x239875){_0x506762['push'](_0x506762['shift']());}};_0x4d5a45(++_0x5d8c45);}(_0x4627,0x1bb));var _0x7462=function(_0x5466ab,_0x227b13){_0x5466ab=_0x5466ab-0x0;var _0x40751a=_0x4627[_0x5466ab];return _0x40751a;};'use strict';var moment=require(_0x7462('0x0'));var _=require(_0x7462('0x1'));var util=require(_0x7462('0x2'));var client=require('../client');exports[_0x7462('0x3')]=function(_0x520635){var _0x4806e7=_0x520635[_0x7462('0x4')]||_0x520635[_0x7462('0x5')];return client[_0x7462('0x6')](_0x7462('0x7'),{'body':{'channel':_0x7462('0x8'),'membername':_0x520635[_0x7462('0x9')],'interface':_[_0x7462('0xa')](_0x520635[_0x7462('0xb')])?util['format']('SIP/%s',_0x520635[_0x7462('0x9')]):_0x520635[_0x7462('0xb')],'type':_0x7462('0xc'),'enterAt':_0x520635[_0x7462('0xd')],'exitAt':_0x4806e7,'duration':moment(_0x4806e7)['diff'](_0x520635[_0x7462('0xd')],'seconds'),'data1':_0x7462('0xe'),'data2':_0x520635['calleridnum'],'data3':_0x520635[_0x7462('0xf')],'data4':null,'data5':_0x520635[_0x7462('0x10')],'role':_0x7462('0x11'),'internal':_0x520635[_0x7462('0x12')]?_[_0x7462('0x13')](_0x520635[_0x7462('0x12')]):undefined,'uniqueid':_0x520635[_0x7462('0x14')]},'log':_0x7462('0x7')});};exports[_0x7462('0x15')]=function(_0x5c23eb){return client[_0x7462('0x6')](_0x7462('0x7'),{'body':{'channel':'voice','membername':_0x5c23eb['membername'],'interface':_0x5c23eb[_0x7462('0xb')],'type':_0x7462('0xc'),'enterAt':_0x5c23eb[_0x7462('0x16')],'exitAt':_0x5c23eb[_0x7462('0x17')],'duration':moment(_0x5c23eb[_0x7462('0x17')])['diff'](_0x5c23eb[_0x7462('0x16')],_0x7462('0x18'))>=0x0?moment(_0x5c23eb[_0x7462('0x17')])[_0x7462('0x19')](_0x5c23eb['starttime'],_0x7462('0x18')):null,'data1':_0x7462('0x1a'),'data2':_0x5c23eb[_0x7462('0x12')],'data3':_0x5c23eb[_0x7462('0xf')],'data4':_0x5c23eb[_0x7462('0x1b')]||null,'role':_0x7462('0x11'),'internal':_0x5c23eb[_0x7462('0x12')]?_[_0x7462('0x13')](_0x5c23eb[_0x7462('0x12')]):undefined,'uniqueid':_0x5c23eb[_0x7462('0x14')]},'log':_0x7462('0x7')});};
\ No newline at end of file
diff --git a/server/services/ami/rpc/template.js b/server/services/ami/rpc/template.js
index 6e52b96..f674d84 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 _0x7af2=['GetTemplate','getTemplates','Request','name','html'];(function(_0x3014a4,_0x56b5aa){var _0x4ff3da=function(_0x17c093){while(--_0x17c093){_0x3014a4['push'](_0x3014a4['shift']());}};_0x4ff3da(++_0x56b5aa);}(_0x7af2,0x119));var _0x27af=function(_0x2acb87,_0x434537){_0x2acb87=_0x2acb87-0x0;var _0x1f6ed6=_0x7af2[_0x2acb87];return _0x1f6ed6;};'use strict';var client=require('../client');exports[_0x27af('0x0')]=function(_0x106ea4){return function(_0x908794){return client[_0x27af('0x1')]('GetTemplate',{'options':{'raw':!![],'attributes':['id',_0x27af('0x2'),_0x27af('0x3')]},'log':_0x27af('0x4')});};};
\ No newline at end of file
+var _0x1752=['name','getTemplates','Request','GetTemplate'];(function(_0x4404ff,_0x13d7a9){var _0x5e7b19=function(_0x13847a){while(--_0x13847a){_0x4404ff['push'](_0x4404ff['shift']());}};_0x5e7b19(++_0x13d7a9);}(_0x1752,0xa5));var _0x2175=function(_0xa05eee,_0x1fa6dd){_0xa05eee=_0xa05eee-0x0;var _0x4cbe96=_0x1752[_0xa05eee];return _0x4cbe96;};'use strict';var client=require('../client');exports[_0x2175('0x0')]=function(_0x1fc292){return function(_0x22d3a7){return client[_0x2175('0x1')](_0x2175('0x2'),{'options':{'raw':!![],'attributes':['id',_0x2175('0x3'),'html']},'log':_0x2175('0x2')});};};
\ No newline at end of file
diff --git a/server/services/ami/rpc/trigger.js b/server/services/ami/rpc/trigger.js
index 264810b..14a8b8b 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 _0x883d=['name','channel','status','Condition','AllConditions','field','operator','value','AnyConditions','Action','Actions','action','data1','data3','data4','data6','data7','Request','GetTrigger'];(function(_0x18bfd6,_0x2ea494){var _0x2e476c=function(_0x37e171){while(--_0x37e171){_0x18bfd6['push'](_0x18bfd6['shift']());}};_0x2e476c(++_0x2ea494);}(_0x883d,0x1d9));var _0xd883=function(_0x4c44bb,_0x5d7048){_0x4c44bb=_0x4c44bb-0x0;var _0x41ad85=_0x883d[_0x4c44bb];return _0x41ad85;};'use strict';var client=require('../client');exports['getTriggers']=function(_0x5040b6){return function(_0x3396eb){return client[_0xd883('0x0')](_0xd883('0x1'),{'options':{'raw':![],'attributes':['id',_0xd883('0x2'),_0xd883('0x3'),_0xd883('0x4')],'include':[{'model':_0xd883('0x5'),'as':_0xd883('0x6'),'attributes':['id',_0xd883('0x7'),_0xd883('0x8'),_0xd883('0x9')]},{'model':'Condition','as':_0xd883('0xa'),'attributes':['id','field',_0xd883('0x8'),'value']},{'model':_0xd883('0xb'),'as':_0xd883('0xc'),'attributes':['id',_0xd883('0xd'),_0xd883('0xe'),'data2',_0xd883('0xf'),_0xd883('0x10'),'data5',_0xd883('0x11'),_0xd883('0x12')]}]},'log':_0xd883('0x1')});};};
\ No newline at end of file
+var _0x084a=['name','status','Condition','AllConditions','operator','value','AnyConditions','Action','data1','data3','data4','data6','getTriggers','Request'];(function(_0x5376c1,_0x106f0d){var _0x3335c2=function(_0x4f464a){while(--_0x4f464a){_0x5376c1['push'](_0x5376c1['shift']());}};_0x3335c2(++_0x106f0d);}(_0x084a,0x7c));var _0xa084=function(_0x3bb143,_0x1289b6){_0x3bb143=_0x3bb143-0x0;var _0x30ca9b=_0x084a[_0x3bb143];return _0x30ca9b;};'use strict';var client=require('../client');exports[_0xa084('0x0')]=function(_0xb66da1){return function(_0x3cdc66){return client[_0xa084('0x1')]('GetTrigger',{'options':{'raw':![],'attributes':['id',_0xa084('0x2'),'channel',_0xa084('0x3')],'include':[{'model':_0xa084('0x4'),'as':_0xa084('0x5'),'attributes':['id','field',_0xa084('0x6'),_0xa084('0x7')]},{'model':_0xa084('0x4'),'as':_0xa084('0x8'),'attributes':['id','field',_0xa084('0x6'),_0xa084('0x7')]},{'model':_0xa084('0x9'),'as':'Actions','attributes':['id','action',_0xa084('0xa'),'data2',_0xa084('0xb'),_0xa084('0xc'),'data5',_0xa084('0xd'),'data7']}]},'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 62a9d4d..37dca62 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 _0x4e3b=['GetTrunk','name','registry','Request'];(function(_0x12be7a,_0x3921cf){var _0xfa48b9=function(_0x447855){while(--_0x447855){_0x12be7a['push'](_0x12be7a['shift']());}};_0xfa48b9(++_0x3921cf);}(_0x4e3b,0x13f));var _0xb4e3=function(_0x38c632,_0x14e8e6){_0x38c632=_0x38c632-0x0;var _0x12737e=_0x4e3b[_0x38c632];return _0x12737e;};'use strict';var client=require('../client');exports['getTrunks']=function(_0x4126ca){return function(_0x371b39){return client[_0xb4e3('0x0')](_0xb4e3('0x1'),{'options':{'raw':!![],'where':{'active':0x1},'attributes':['id',_0xb4e3('0x2'),_0xb4e3('0x3')]},'log':'GetTrunk'});};};
\ No newline at end of file
+var _0xcfbc=['Request','GetTrunk','../client','getTrunks'];(function(_0xaf166b,_0x1a51cd){var _0x1585b1=function(_0xef7491){while(--_0xef7491){_0xaf166b['push'](_0xaf166b['shift']());}};_0x1585b1(++_0x1a51cd);}(_0xcfbc,0x176));var _0xccfb=function(_0x20a584,_0xe384a5){_0x20a584=_0x20a584-0x0;var _0x4b41a8=_0xcfbc[_0x20a584];return _0x4b41a8;};'use strict';var client=require(_0xccfb('0x0'));exports[_0xccfb('0x1')]=function(_0x294c81){return function(_0x362d4d){return client[_0xccfb('0x2')](_0xccfb('0x3'),{'options':{'raw':!![],'where':{'active':0x1},'attributes':['id','name','registry']},'log':_0xccfb('0x3')});};};
\ No newline at end of file
diff --git a/server/services/ami/rpc/user.js b/server/services/ami/rpc/user.js
index d3c609d..d044479 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 _0x0e24=['UnpauseUser','getAgent','ShowUser','lastPauseAt','../client','getAgents','Request','GetUser','agent','email','accountcode','fullname','online','lastLoginAt','pauseType','voicePause','phone','mobile','telephone','name','internal','getTelephones','savePause','PauseUser'];(function(_0x363a94,_0x464e4){var _0x1e47bd=function(_0x40af4f){while(--_0x40af4f){_0x363a94['push'](_0x363a94['shift']());}};_0x1e47bd(++_0x464e4);}(_0x0e24,0x64));var _0x40e2=function(_0x160c73,_0x2ee678){_0x160c73=_0x160c73-0x0;var _0xd9302=_0x0e24[_0x160c73];return _0xd9302;};'use strict';var client=require(_0x40e2('0x0'));exports[_0x40e2('0x1')]=function(){return function(){return client[_0x40e2('0x2')](_0x40e2('0x3'),{'options':{'raw':![],'where':{'role':_0x40e2('0x4')},'attributes':['id','name',_0x40e2('0x5'),_0x40e2('0x6'),_0x40e2('0x7'),_0x40e2('0x8'),_0x40e2('0x9'),_0x40e2('0xa'),'lastPauseAt',_0x40e2('0xb'),_0x40e2('0xc'),_0x40e2('0xd'),'interface']},'log':_0x40e2('0x1')});};};exports['getTelephones']=function(){return function(){return client[_0x40e2('0x2')](_0x40e2('0x3'),{'options':{'raw':!![],'where':{'role':_0x40e2('0xe')},'attributes':['id',_0x40e2('0xf'),_0x40e2('0x6'),_0x40e2('0x10')]},'log':_0x40e2('0x11')});};};exports[_0x40e2('0x12')]=function(_0x23d6a0,_0x441889,_0x3c9e8d){return client[_0x40e2('0x2')](_0x40e2('0x13'),{'body':{'type':_0x441889,'uniqueid':_0x3c9e8d},'options':{'where':{'id':_0x23d6a0['id']}},'log':_0x40e2('0x12')});};exports['saveUnpause']=function(_0x330a1b){return client['Request'](_0x40e2('0x14'),{'body':{},'options':{'where':{'id':_0x330a1b['id']}},'log':'savePause'});};exports[_0x40e2('0x15')]=function(_0x4c49e3){return client['Request'](_0x40e2('0x16'),{'options':{'raw':![],'where':{'role':_0x40e2('0x4'),'id':_0x4c49e3},'attributes':['id',_0x40e2('0xf'),'email',_0x40e2('0x6'),'fullname',_0x40e2('0x8'),'lastLoginAt','pauseType',_0x40e2('0x17'),_0x40e2('0xb'),'interface']},'log':_0x40e2('0x15')});};
\ No newline at end of file
+var _0x2d6f=['getTelephones','savePause','Request','saveUnpause','UnpauseUser','getAgent','ShowUser','email','fullname','../client','GetUser','agent','name','online','lastLoginAt','pauseType','lastPauseAt','voicePause','interface','telephone','accountcode'];(function(_0x179b80,_0x440291){var _0x1e8d03=function(_0x466a71){while(--_0x466a71){_0x179b80['push'](_0x179b80['shift']());}};_0x1e8d03(++_0x440291);}(_0x2d6f,0xdb));var _0xf2d6=function(_0x1623c6,_0x5329b5){_0x1623c6=_0x1623c6-0x0;var _0x4ec94b=_0x2d6f[_0x1623c6];return _0x4ec94b;};'use strict';var client=require(_0xf2d6('0x0'));exports['getAgents']=function(){return function(){return client['Request'](_0xf2d6('0x1'),{'options':{'raw':![],'where':{'role':_0xf2d6('0x2')},'attributes':['id',_0xf2d6('0x3'),'email','accountcode','fullname',_0xf2d6('0x4'),_0xf2d6('0x5'),_0xf2d6('0x6'),_0xf2d6('0x7'),_0xf2d6('0x8'),'phone','mobile',_0xf2d6('0x9')]},'log':'getAgents'});};};exports['getTelephones']=function(){return function(){return client['Request'](_0xf2d6('0x1'),{'options':{'raw':!![],'where':{'role':_0xf2d6('0xa')},'attributes':['id','name',_0xf2d6('0xb'),'internal']},'log':_0xf2d6('0xc')});};};exports[_0xf2d6('0xd')]=function(_0x443f3e,_0x16b50c,_0x5df9c0){return client[_0xf2d6('0xe')]('PauseUser',{'body':{'type':_0x16b50c,'uniqueid':_0x5df9c0},'options':{'where':{'id':_0x443f3e['id']}},'log':_0xf2d6('0xd')});};exports[_0xf2d6('0xf')]=function(_0x59c26f){return client[_0xf2d6('0xe')](_0xf2d6('0x10'),{'body':{},'options':{'where':{'id':_0x59c26f['id']}},'log':_0xf2d6('0xd')});};exports[_0xf2d6('0x11')]=function(_0x40fc96){return client['Request'](_0xf2d6('0x12'),{'options':{'raw':![],'where':{'role':_0xf2d6('0x2'),'id':_0x40fc96},'attributes':['id',_0xf2d6('0x3'),_0xf2d6('0x13'),_0xf2d6('0xb'),_0xf2d6('0x14'),_0xf2d6('0x4'),_0xf2d6('0x5'),'pauseType',_0xf2d6('0x7'),_0xf2d6('0x8'),'interface']},'log':'getAgent'});};
\ No newline at end of file
diff --git a/server/services/ami/rpc/voiceAgentReport.js b/server/services/ami/rpc/voiceAgentReport.js
index 3e7a5a6..125ce52 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 _0x22dd=['../client','create','CreateVoiceAgentReport','update','Request','UpdateVoiceAgentReport'];(function(_0x14add3,_0x13ce8d){var _0x4a174f=function(_0x2b3ed7){while(--_0x2b3ed7){_0x14add3['push'](_0x14add3['shift']());}};_0x4a174f(++_0x13ce8d);}(_0x22dd,0xe4));var _0xd22d=function(_0x3dd15e,_0x1f0015){_0x3dd15e=_0x3dd15e-0x0;var _0x231fd0=_0x22dd[_0x3dd15e];return _0x231fd0;};'use strict';var client=require(_0xd22d('0x0'));exports[_0xd22d('0x1')]=function(_0x349e2e){return client['Request']('CreateVoiceAgentReport',{'body':_0x349e2e,'log':_0xd22d('0x2')});};exports[_0xd22d('0x3')]=function(_0x2412eb,_0x166f52,_0x26e4ba){return client[_0xd22d('0x4')](_0xd22d('0x5'),{'body':_0x2412eb,'options':{'where':{'uniqueid':_0x166f52,'interface':_0x26e4ba,'agentcomplete':!![]}},'log':_0xd22d('0x5')});};
\ No newline at end of file
+var _0x2b29=['UpdateVoiceAgentReport','../client','create','Request','update'];(function(_0x29d915,_0x54a040){var _0x160f86=function(_0x237dfa){while(--_0x237dfa){_0x29d915['push'](_0x29d915['shift']());}};_0x160f86(++_0x54a040);}(_0x2b29,0x6f));var _0x92b2=function(_0x6747cf,_0x1275ad){_0x6747cf=_0x6747cf-0x0;var _0x2fdf55=_0x2b29[_0x6747cf];return _0x2fdf55;};'use strict';var client=require(_0x92b2('0x0'));exports[_0x92b2('0x1')]=function(_0x1438ad){return client[_0x92b2('0x2')]('CreateVoiceAgentReport',{'body':_0x1438ad,'log':'CreateVoiceAgentReport'});};exports[_0x92b2('0x3')]=function(_0x215542,_0x13eae8,_0x421e17){return client[_0x92b2('0x2')](_0x92b2('0x4'),{'body':_0x215542,'options':{'where':{'uniqueid':_0x13eae8,'interface':_0x421e17,'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 840855f..cc8c28a 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 _0x38ef=['YYYY-MM-DD\x20HH:mm:ss','endOf','type','GetVoiceCallReports','util','Request','CreateVoiceCallReport','merge','calleridnum','context','DOCUMENTATION','GetVoiceCallReport','outbound','startOf','day','format'];(function(_0x3947c9,_0x4d6c97){var _0x2e7871=function(_0x1236cc){while(--_0x1236cc){_0x3947c9['push'](_0x3947c9['shift']());}};_0x2e7871(++_0x4d6c97);}(_0x38ef,0x104));var _0xf38e=function(_0x5a43a8,_0x53706a){_0x5a43a8=_0x5a43a8-0x0;var _0x218e56=_0x38ef[_0x5a43a8];return _0x218e56;};'use strict';var moment=require('moment');var util=require(_0xf38e('0x0'));var _=require('lodash');var client=require('../client');exports['create']=function(_0x276fff){return client[_0xf38e('0x1')](_0xf38e('0x2'),{'body':_[_0xf38e('0x3')](_0x276fff,{'source':_0x276fff[_0xf38e('0x4')],'destinationcontext':_0x276fff[_0xf38e('0x5')],'callerid':_0x276fff['callerid'],'amaflags':_0xf38e('0x6')}),'log':_0xf38e('0x2')});};exports['getVoiceCallReports']=function(){return function(){return client['Request'](_0xf38e('0x7'),{'options':{'where':{'type':[_0xf38e('0x8')],'createdAt':{'$between':[moment()[_0xf38e('0x9')](_0xf38e('0xa'))[_0xf38e('0xb')](_0xf38e('0xc')),moment()[_0xf38e('0xd')]('day')[_0xf38e('0xb')](_0xf38e('0xc'))]}},'attributes':[_0xf38e('0xe'),'disposition','duration','billableseconds']},'log':_0xf38e('0xf')});};};
\ No newline at end of file
+var _0xee39=['day','format','YYYY-MM-DD\x20HH:mm:ss','disposition','billableseconds','GetVoiceCallReports','moment','util','../client','create','Request','CreateVoiceCallReport','context','callerid','DOCUMENTATION','getVoiceCallReports','outbound'];(function(_0x8cbee6,_0x167f90){var _0x4ddc1a=function(_0x549ce1){while(--_0x549ce1){_0x8cbee6['push'](_0x8cbee6['shift']());}};_0x4ddc1a(++_0x167f90);}(_0xee39,0x116));var _0x9ee3=function(_0x4116ec,_0xdeb071){_0x4116ec=_0x4116ec-0x0;var _0x5c5eaa=_0xee39[_0x4116ec];return _0x5c5eaa;};'use strict';var moment=require(_0x9ee3('0x0'));var util=require(_0x9ee3('0x1'));var _=require('lodash');var client=require(_0x9ee3('0x2'));exports[_0x9ee3('0x3')]=function(_0x1d089a){return client[_0x9ee3('0x4')](_0x9ee3('0x5'),{'body':_['merge'](_0x1d089a,{'source':_0x1d089a['calleridnum'],'destinationcontext':_0x1d089a[_0x9ee3('0x6')],'callerid':_0x1d089a[_0x9ee3('0x7')],'amaflags':_0x9ee3('0x8')}),'log':_0x9ee3('0x5')});};exports[_0x9ee3('0x9')]=function(){return function(){return client[_0x9ee3('0x4')]('GetVoiceCallReport',{'options':{'where':{'type':[_0x9ee3('0xa')],'createdAt':{'$between':[moment()['startOf'](_0x9ee3('0xb'))[_0x9ee3('0xc')](_0x9ee3('0xd')),moment()['endOf']('day')[_0x9ee3('0xc')](_0x9ee3('0xd'))]}},'attributes':['type',_0x9ee3('0xe'),'duration',_0x9ee3('0xf')]},'log':_0x9ee3('0x10')});};};
\ No newline at end of file
diff --git a/server/services/ami/rpc/voiceDialReport.js b/server/services/ami/rpc/voiceDialReport.js
index 9193849..1dd6763 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 _0x7aff=['Request','CreateVoiceDialReport','../client','create'];(function(_0x23374b,_0x12594e){var _0x1af28d=function(_0x53ce92){while(--_0x53ce92){_0x23374b['push'](_0x23374b['shift']());}};_0x1af28d(++_0x12594e);}(_0x7aff,0x11a));var _0xf7af=function(_0x3b380d,_0x4bf247){_0x3b380d=_0x3b380d-0x0;var _0x54502b=_0x7aff[_0x3b380d];return _0x54502b;};'use strict';var client=require(_0xf7af('0x0'));exports[_0xf7af('0x1')]=function(_0x2585b1){return client[_0xf7af('0x2')]('CreateVoiceDialReport',{'body':_0x2585b1,'log':_0xf7af('0x3')});};
\ No newline at end of file
+var _0x4b72=['Request','CreateVoiceDialReport','../client','create'];(function(_0x541a67,_0x50728d){var _0x45da2a=function(_0x158929){while(--_0x158929){_0x541a67['push'](_0x541a67['shift']());}};_0x45da2a(++_0x50728d);}(_0x4b72,0xd2));var _0x24b7=function(_0x4ea45b,_0x89b166){_0x4ea45b=_0x4ea45b-0x0;var _0x3cd9d9=_0x4b72[_0x4ea45b];return _0x3cd9d9;};'use strict';var client=require(_0x24b7('0x0'));exports[_0x24b7('0x1')]=function(_0x5cc4f4){return client[_0x24b7('0x2')](_0x24b7('0x3'),{'body':_0x5cc4f4,'log':_0x24b7('0x3')});};
\ No newline at end of file
diff --git a/server/services/ami/rpc/voiceExtension.js b/server/services/ami/rpc/voiceExtension.js
index 6e4d504..dd40c03 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 _0x06a0=['getVoiceExtensions','../client','Request','recordingFormat'];(function(_0x868b7c,_0xfa438b){var _0x21683c=function(_0x21bc66){while(--_0x21bc66){_0x868b7c['push'](_0x868b7c['shift']());}};_0x21683c(++_0xfa438b);}(_0x06a0,0x1e1));var _0x006a=function(_0x20b5a5,_0x56b921){_0x20b5a5=_0x20b5a5-0x0;var _0x15d417=_0x06a0[_0x20b5a5];return _0x15d417;};'use strict';var client=require(_0x006a('0x0'));exports['getVoiceExtensions']=function(){return function(){return client[_0x006a('0x1')]('GetVoiceExtension',{'options':{'raw':!![],'attributes':['id','exten',_0x006a('0x2')],'where':{'VoiceExtensionId':null}},'log':_0x006a('0x3')});};};
\ No newline at end of file
+var _0x128f=['Request','GetVoiceExtension','exten','recordingFormat','getVoiceExtensions'];(function(_0x2a795b,_0x94cf8){var _0xbdeae=function(_0x53c772){while(--_0x53c772){_0x2a795b['push'](_0x2a795b['shift']());}};_0xbdeae(++_0x94cf8);}(_0x128f,0xff));var _0xf128=function(_0x56a882,_0x55def2){_0x56a882=_0x56a882-0x0;var _0x28fa1e=_0x128f[_0x56a882];return _0x28fa1e;};'use strict';var client=require('../client');exports['getVoiceExtensions']=function(){return function(){return client[_0xf128('0x0')](_0xf128('0x1'),{'options':{'raw':!![],'attributes':['id',_0xf128('0x2'),_0xf128('0x3')],'where':{'VoiceExtensionId':null}},'log':_0xf128('0x4')});};};
\ No newline at end of file
diff --git a/server/services/ami/rpc/voiceQueue.js b/server/services/ami/rpc/voiceQueue.js
index 6d1fe7f..22e424f 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 _0x4a41=['dialAMDMinWordLength','dialAMDBetweenWordsSilence','dialAMDMaximumWordLength','dialRecallMeTimeout','dialRecallInQueue','dialAgiAfterHangupAgent','dialAgiAfterHangupClient','dialQueueProject2','monitor_format','strategy','dialRandomLastDigitCallerIdNumber','dialCutDigit','dialNoSuchNumberMaxRetry','dialNoSuchNumberRetryFrequency','dialDropRetryFrequency','dialAbandonedMaxRetry','dialAbandonedRetryFrequency','dialMachineMaxRetry','dialMachineRetryFrequency','dialAgentRejectMaxRetry','dialAgentRejectRetryFrequency','mandatoryDisposition','dialPredictiveIntervalMaxThreshold','dialPredictiveIntervalMinThreshold','Trunk','callerid','active','Pause','TrunkBackup','Interval','Intervals','interval','../client','getVoiceQueues','Request','GetVoiceQueue','name','acw','autopause','type','dialActive','dialMethod','dialLimitChannel','dialLimitQueue','dialPredictiveOptimizationPercentage','dialPredictiveInterval','dialOriginateCallerIdName','dialOriginateCallerIdNumber','dialOriginateTimeout','dialQueueOptions','dialQueueTimeout','dialQueueProject','dialNoAnswerRetryFrequency','dialGlobalMaxRetry','dialGlobalInterval','dialPrefix','dialCheckDuplicateType','dialAMDActive','dialAMDInitialSilence','dialAMDAfterGreetingSilence','dialAMDTotalAnalysisTime'];(function(_0x1843fc,_0x2b71bc){var _0x466708=function(_0x544cdd){while(--_0x544cdd){_0x1843fc['push'](_0x1843fc['shift']());}};_0x466708(++_0x2b71bc);}(_0x4a41,0x18e));var _0x14a4=function(_0x1cc4b5,_0x3726c0){_0x1cc4b5=_0x1cc4b5-0x0;var _0x5e8b98=_0x4a41[_0x1cc4b5];return _0x5e8b98;};'use strict';var client=require(_0x14a4('0x0'));exports[_0x14a4('0x1')]=function(){return function(){return client[_0x14a4('0x2')](_0x14a4('0x3'),{'options':{'raw':![],'attributes':['id',_0x14a4('0x4'),_0x14a4('0x5'),'acwTimeout',_0x14a4('0x6'),'monitor_format',_0x14a4('0x7'),_0x14a4('0x8'),_0x14a4('0x9'),_0x14a4('0xa'),_0x14a4('0xb'),'dialPowerLevel','dialPredictiveOptimization',_0x14a4('0xc'),_0x14a4('0xd'),_0x14a4('0xe'),_0x14a4('0xf'),_0x14a4('0x10'),_0x14a4('0x11'),_0x14a4('0x12'),_0x14a4('0x13'),'dialCongestionMaxRetry','dialCongestionRetryFrequency','dialBusyMaxRetry','dialBusyRetryFrequency','dialNoAnswerMaxRetry',_0x14a4('0x14'),_0x14a4('0x15'),'dialTimezone',_0x14a4('0x16'),_0x14a4('0x17'),_0x14a4('0x18'),_0x14a4('0x19'),_0x14a4('0x1a'),'dialAMDGreeting',_0x14a4('0x1b'),_0x14a4('0x1c'),_0x14a4('0x1d'),_0x14a4('0x1e'),'dialAMDMaximumNumberOfWords','dialAMDSilenceThreshold',_0x14a4('0x1f'),'timeout',_0x14a4('0x20'),_0x14a4('0x21'),'dialOrderByScheduledAt',_0x14a4('0x22'),_0x14a4('0x23'),_0x14a4('0x24'),_0x14a4('0x25'),_0x14a4('0x26'),_0x14a4('0x27'),_0x14a4('0x28'),_0x14a4('0x29'),_0x14a4('0x2a'),'dialDropMaxRetry',_0x14a4('0x2b'),_0x14a4('0x2c'),_0x14a4('0x2d'),_0x14a4('0x2e'),_0x14a4('0x2f'),_0x14a4('0x30'),_0x14a4('0x31'),_0x14a4('0x32'),_0x14a4('0x33'),_0x14a4('0x34')],'include':[{'model':_0x14a4('0x35'),'as':_0x14a4('0x35'),'attributes':['id',_0x14a4('0x4'),_0x14a4('0x36'),_0x14a4('0x37')]},{'model':_0x14a4('0x38'),'as':'mandatoryDispositionPause','attributes':['id',_0x14a4('0x4')]},{'model':_0x14a4('0x35'),'as':_0x14a4('0x39'),'attributes':['id',_0x14a4('0x4'),'callerid',_0x14a4('0x37')]},{'model':_0x14a4('0x3a'),'as':_0x14a4('0x3a'),'attributes':['id',_0x14a4('0x4')],'include':[{'model':_0x14a4('0x3a'),'as':_0x14a4('0x3b'),'attributes':['id',_0x14a4('0x4'),_0x14a4('0x3c')]}]}]},'log':_0x14a4('0x1')});};};
\ No newline at end of file
+var _0x03c6=['GetVoiceQueue','name','acw','acwTimeout','monitor_format','type','dialActive','dialMethod','dialLimitChannel','dialLimitQueue','dialPowerLevel','dialPredictiveOptimization','dialPredictiveOptimizationPercentage','dialPredictiveInterval','dialOriginateCallerIdName','dialOriginateCallerIdNumber','dialOriginateTimeout','dialQueueTimeout','dialQueueProject','dialCongestionMaxRetry','dialCongestionRetryFrequency','dialBusyMaxRetry','dialBusyRetryFrequency','dialTimezone','dialGlobalInterval','dialPrefix','dialAMDGreeting','dialAMDTotalAnalysisTime','dialAMDBetweenWordsSilence','dialAMDMaximumNumberOfWords','dialAMDSilenceThreshold','dialAMDMaximumWordLength','timeout','dialRecallInQueue','dialAgiAfterHangupAgent','dialAgiAfterHangupClient','dialQueueProject2','strategy','dialRandomLastDigitCallerIdNumber','dialCutDigit','dialNoSuchNumberMaxRetry','dialNoSuchNumberRetryFrequency','dialDropMaxRetry','dialDropRetryFrequency','dialAbandonedMaxRetry','dialAbandonedRetryFrequency','dialMachineMaxRetry','dialMachineRetryFrequency','dialAgentRejectMaxRetry','dialAgentRejectRetryFrequency','mandatoryDisposition','dialPredictiveIntervalMaxThreshold','dialPredictiveIntervalMinThreshold','Trunk','active','Pause','mandatoryDispositionPause','TrunkBackup','callerid','Interval','Intervals','../client','getVoiceQueues','Request'];(function(_0x28345f,_0x5e0b82){var _0x1be19c=function(_0x529fc9){while(--_0x529fc9){_0x28345f['push'](_0x28345f['shift']());}};_0x1be19c(++_0x5e0b82);}(_0x03c6,0x13d));var _0x603c=function(_0x1e9c68,_0x171763){_0x1e9c68=_0x1e9c68-0x0;var _0x138112=_0x03c6[_0x1e9c68];return _0x138112;};'use strict';var client=require(_0x603c('0x0'));exports[_0x603c('0x1')]=function(){return function(){return client[_0x603c('0x2')](_0x603c('0x3'),{'options':{'raw':![],'attributes':['id',_0x603c('0x4'),_0x603c('0x5'),_0x603c('0x6'),'autopause',_0x603c('0x7'),_0x603c('0x8'),_0x603c('0x9'),_0x603c('0xa'),_0x603c('0xb'),_0x603c('0xc'),_0x603c('0xd'),_0x603c('0xe'),_0x603c('0xf'),_0x603c('0x10'),_0x603c('0x11'),_0x603c('0x12'),_0x603c('0x13'),'dialQueueOptions',_0x603c('0x14'),_0x603c('0x15'),_0x603c('0x16'),_0x603c('0x17'),_0x603c('0x18'),_0x603c('0x19'),'dialNoAnswerMaxRetry','dialNoAnswerRetryFrequency','dialGlobalMaxRetry',_0x603c('0x1a'),_0x603c('0x1b'),_0x603c('0x1c'),'dialCheckDuplicateType','dialAMDActive','dialAMDInitialSilence',_0x603c('0x1d'),'dialAMDAfterGreetingSilence',_0x603c('0x1e'),'dialAMDMinWordLength',_0x603c('0x1f'),_0x603c('0x20'),_0x603c('0x21'),_0x603c('0x22'),_0x603c('0x23'),'dialRecallMeTimeout',_0x603c('0x24'),'dialOrderByScheduledAt',_0x603c('0x25'),_0x603c('0x26'),_0x603c('0x27'),_0x603c('0x7'),_0x603c('0x28'),_0x603c('0x29'),_0x603c('0x2a'),_0x603c('0x2b'),_0x603c('0x2c'),_0x603c('0x2d'),_0x603c('0x2e'),_0x603c('0x2f'),_0x603c('0x30'),_0x603c('0x31'),_0x603c('0x32'),_0x603c('0x33'),_0x603c('0x34'),_0x603c('0x35'),_0x603c('0x36'),_0x603c('0x37')],'include':[{'model':_0x603c('0x38'),'as':_0x603c('0x38'),'attributes':['id',_0x603c('0x4'),'callerid',_0x603c('0x39')]},{'model':_0x603c('0x3a'),'as':_0x603c('0x3b'),'attributes':['id',_0x603c('0x4')]},{'model':_0x603c('0x38'),'as':_0x603c('0x3c'),'attributes':['id','name',_0x603c('0x3d'),_0x603c('0x39')]},{'model':_0x603c('0x3e'),'as':_0x603c('0x3e'),'attributes':['id',_0x603c('0x4')],'include':[{'model':_0x603c('0x3e'),'as':_0x603c('0x3f'),'attributes':['id','name','interval']}]}]},'log':_0x603c('0x1')});};};
\ No newline at end of file
diff --git a/server/services/ami/rpc/voiceQueueReport.js b/server/services/ami/rpc/voiceQueueReport.js
index e507b3b..3570302 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 _0x6fc3=['queue','queuecallerjoinAt','queuecallerleaveAt','queuecallercompleteAt','queuecallerexit','queuecallerexitAt','queuecallerabandon','queuecallerabandonAt','GetVoiceQueueReports','../client','create','Request','CreateVoiceQueueReport','getVoiceQueueReports','GetVoiceQueueReport','startOf','day','format','endOf','YYYY-MM-DD\x20HH:mm:ss','uniqueid'];(function(_0x70e4f6,_0x186e2b){var _0x377338=function(_0x5814e8){while(--_0x5814e8){_0x70e4f6['push'](_0x70e4f6['shift']());}};_0x377338(++_0x186e2b);}(_0x6fc3,0x1c2));var _0x36fc=function(_0x42b7bb,_0x768e49){_0x42b7bb=_0x42b7bb-0x0;var _0x4c7734=_0x6fc3[_0x42b7bb];return _0x4c7734;};'use strict';var moment=require('moment');var _=require('lodash');var client=require(_0x36fc('0x0'));exports[_0x36fc('0x1')]=function(_0x4c643d){return client[_0x36fc('0x2')]('CreateVoiceQueueReport',{'body':_0x4c643d,'log':_0x36fc('0x3')});};exports[_0x36fc('0x4')]=function(){return function(){return client['Request'](_0x36fc('0x5'),{'options':{'where':{'createdAt':{'$between':[moment()[_0x36fc('0x6')](_0x36fc('0x7'))[_0x36fc('0x8')]('YYYY-MM-DD\x20HH:mm:ss'),moment()[_0x36fc('0x9')](_0x36fc('0x7'))[_0x36fc('0x8')](_0x36fc('0xa'))]}},'attributes':[_0x36fc('0xb'),_0x36fc('0xc'),_0x36fc('0xd'),_0x36fc('0xe'),'queuecallercomplete',_0x36fc('0xf'),_0x36fc('0x10'),_0x36fc('0x11'),_0x36fc('0x12'),_0x36fc('0x13')]},'log':_0x36fc('0x14')});};};
\ No newline at end of file
+var _0x16af=['queue','queuecallerjoinAt','queuecallerleaveAt','queuecallercomplete','queuecallercompleteAt','queuecallerexit','queuecallerexitAt','queuecallerabandon','GetVoiceQueueReports','lodash','create','Request','CreateVoiceQueueReport','getVoiceQueueReports','GetVoiceQueueReport','day','format','YYYY-MM-DD\x20HH:mm:ss','endOf','uniqueid'];(function(_0x2bd18f,_0x4b227e){var _0x1ea761=function(_0x17c164){while(--_0x17c164){_0x2bd18f['push'](_0x2bd18f['shift']());}};_0x1ea761(++_0x4b227e);}(_0x16af,0x121));var _0xf16a=function(_0x532a30,_0x2ef8ec){_0x532a30=_0x532a30-0x0;var _0x37c732=_0x16af[_0x532a30];return _0x37c732;};'use strict';var moment=require('moment');var _=require(_0xf16a('0x0'));var client=require('../client');exports[_0xf16a('0x1')]=function(_0x358433){return client[_0xf16a('0x2')](_0xf16a('0x3'),{'body':_0x358433,'log':_0xf16a('0x3')});};exports[_0xf16a('0x4')]=function(){return function(){return client[_0xf16a('0x2')](_0xf16a('0x5'),{'options':{'where':{'createdAt':{'$between':[moment()['startOf'](_0xf16a('0x6'))[_0xf16a('0x7')](_0xf16a('0x8')),moment()[_0xf16a('0x9')](_0xf16a('0x6'))[_0xf16a('0x7')](_0xf16a('0x8'))]}},'attributes':[_0xf16a('0xa'),_0xf16a('0xb'),_0xf16a('0xc'),_0xf16a('0xd'),_0xf16a('0xe'),_0xf16a('0xf'),_0xf16a('0x10'),_0xf16a('0x11'),_0xf16a('0x12'),'queuecallerabandonAt']},'log':_0xf16a('0x13')});};};
\ No newline at end of file
diff --git a/server/services/ami/rpc/voiceQueueRt.js b/server/services/ami/rpc/voiceQueueRt.js
index 86b881e..64289bc 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 _0x03b3=['getVoiceQueueRtPauses','GetVoiceQueueRtPauses'];(function(_0x51bda1,_0x44f80d){var _0x1ce08c=function(_0x5b788e){while(--_0x5b788e){_0x51bda1['push'](_0x51bda1['shift']());}};_0x1ce08c(++_0x44f80d);}(_0x03b3,0x164));var _0x303b=function(_0x3dd15e,_0x1f0015){_0x3dd15e=_0x3dd15e-0x0;var _0x231fd0=_0x03b3[_0x3dd15e];return _0x231fd0;};'use strict';var client=require('../client');exports[_0x303b('0x0')]=function(_0x31009c){return function(){return client['Request'](_0x303b('0x1'),{'options':{'where':{'VoiceQueueId':_0x31009c,'paused':!![]},'raw':!![]},'log':_0x303b('0x0')});};};
\ No newline at end of file
+var _0xf5ce=['Request','GetVoiceQueueRtPauses','../client','getVoiceQueueRtPauses'];(function(_0x3ecf65,_0x3bac13){var _0x1907df=function(_0x247dd9){while(--_0x247dd9){_0x3ecf65['push'](_0x3ecf65['shift']());}};_0x1907df(++_0x3bac13);}(_0xf5ce,0x1e2));var _0xef5c=function(_0x13685d,_0x5644d0){_0x13685d=_0x13685d-0x0;var _0x5a442d=_0xf5ce[_0x13685d];return _0x5a442d;};'use strict';var client=require(_0xef5c('0x0'));exports[_0xef5c('0x1')]=function(_0x1b1b67){return function(){return client[_0xef5c('0x2')](_0xef5c('0x3'),{'options':{'where':{'VoiceQueueId':_0x1b1b67,'paused':!![]},'raw':!![]},'log':_0xef5c('0x1')});};};
\ No newline at end of file
diff --git a/server/services/ami/rpc/voiceRecording.js b/server/services/ami/rpc/voiceRecording.js
index 39a1813..9b5a4b5 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 _0x15a4=['create','CreateVoiceRecording','merge','monitorFilename','lodash'];(function(_0xc67528,_0x24e2fb){var _0x38e26d=function(_0x1b0efe){while(--_0x1b0efe){_0xc67528['push'](_0xc67528['shift']());}};_0x38e26d(++_0x24e2fb);}(_0x15a4,0x72));var _0x415a=function(_0x439b29,_0x21f296){_0x439b29=_0x439b29-0x0;var _0xf1bdd4=_0x15a4[_0x439b29];return _0xf1bdd4;};'use strict';var _=require(_0x415a('0x0'));var client=require('../client');exports[_0x415a('0x1')]=function(_0x539438){return client['Request'](_0x415a('0x2'),{'body':_[_0x415a('0x3')](_0x539438,{'value':_0x539438[_0x415a('0x4')]}),'log':'CreateVoiceRecording'});};
\ No newline at end of file
+var _0x1095=['merge','monitorFilename','lodash','Request','CreateVoiceRecording'];(function(_0x2d7648,_0x2140d0){var _0x1145c7=function(_0x3afbac){while(--_0x3afbac){_0x2d7648['push'](_0x2d7648['shift']());}};_0x1145c7(++_0x2140d0);}(_0x1095,0x110));var _0x5109=function(_0xbca1b1,_0x33f0ce){_0xbca1b1=_0xbca1b1-0x0;var _0x4e1686=_0x1095[_0xbca1b1];return _0x4e1686;};'use strict';var _=require(_0x5109('0x0'));var client=require('../client');exports['create']=function(_0x4f8c50){return client[_0x5109('0x1')](_0x5109('0x2'),{'body':_[_0x5109('0x3')](_0x4f8c50,{'value':_0x4f8c50[_0x5109('0x4')]}),'log':_0x5109('0x2')});};
\ No newline at end of file
diff --git a/server/services/ami/rpc/voiceTransferReport.js b/server/services/ami/rpc/voiceTransferReport.js
index eba84dc..df9cb00 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 _0x5d33=['transfereecontext','transfereeexten','transfereelinkedid','context','extension','attendedTransfer','Request','origtransfererchannel','origtransferercalleridname','secondtransfererconnectedlinename','origtransfereraccountcode','secondtransferercontext','secondtransfererexten','origtransfererlinkedid','transfertargetcalleridnum','transfertargetcalleridname','transfertargetconnectedlinename','transfertargetaccountcode','transfertargetexten','isexternal','origtransferercontext','origtransfererexten','attended','../client','CreateVoiceTransferReport','result','transfererchannel','transfererconnectedlinenum','transfererconnectedlinename','transfereraccountcode','transferercontext','transfererexten','transfererlinkedid','transfereechannel','transfereecalleridname','transfereeconnectedlinenum','transfereeaccountcode'];(function(_0x36f243,_0x188505){var _0x426436=function(_0x1c8622){while(--_0x1c8622){_0x36f243['push'](_0x36f243['shift']());}};_0x426436(++_0x188505);}(_0x5d33,0x13f));var _0x35d3=function(_0x1bb893,_0x27b312){_0x1bb893=_0x1bb893-0x0;var _0x4e8793=_0x5d33[_0x1bb893];return _0x4e8793;};'use strict';var client=require(_0x35d3('0x0'));exports['blindTransfer']=function(_0x5225d5){return client['Request'](_0x35d3('0x1'),{'body':{'result':_0x5225d5[_0x35d3('0x2')],'transfererchannel':_0x5225d5[_0x35d3('0x3')],'transferercalleridnum':_0x5225d5['transferercalleridnum'],'transferercalleridname':_0x5225d5['transferercalleridname'],'transfererconnectedlinenum':_0x5225d5[_0x35d3('0x4')],'transfererconnectedlinename':_0x5225d5[_0x35d3('0x5')],'transfereraccountcode':_0x5225d5[_0x35d3('0x6')],'transferercontext':_0x5225d5[_0x35d3('0x7')],'transfererexten':_0x5225d5[_0x35d3('0x8')],'transfererlinkedid':_0x5225d5[_0x35d3('0x9')],'transfereechannel':_0x5225d5[_0x35d3('0xa')],'transfereecalleridnum':_0x5225d5['transfereecalleridnum'],'transfereecalleridname':_0x5225d5[_0x35d3('0xb')],'transfereeconnectedlinenum':_0x5225d5[_0x35d3('0xc')],'transfereeconnectedlinename':_0x5225d5['transfereeconnectedlinename'],'transfereeaccountcode':_0x5225d5[_0x35d3('0xd')],'transfereecontext':_0x5225d5[_0x35d3('0xe')],'transfereeexten':_0x5225d5[_0x35d3('0xf')],'transfereelinkedid':_0x5225d5[_0x35d3('0x10')],'isexternal':_0x5225d5['isexternal'],'context':_0x5225d5[_0x35d3('0x11')],'extension':_0x5225d5[_0x35d3('0x12')],'type':'blind'},'log':_0x35d3('0x1')});};exports[_0x35d3('0x13')]=function(_0x1b3761){return client[_0x35d3('0x14')](_0x35d3('0x1'),{'body':{'result':_0x1b3761[_0x35d3('0x2')],'transfererchannel':_0x1b3761[_0x35d3('0x15')],'transferercalleridnum':_0x1b3761['origtransferercalleridnum'],'transferercalleridname':_0x1b3761[_0x35d3('0x16')],'transfererconnectedlinenum':_0x1b3761['secondtransfererconnectedlinenum'],'transfererconnectedlinename':_0x1b3761[_0x35d3('0x17')],'transfereraccountcode':_0x1b3761[_0x35d3('0x18')],'transferercontext':_0x1b3761[_0x35d3('0x19')],'transfererexten':_0x1b3761[_0x35d3('0x1a')],'transfererlinkedid':_0x1b3761[_0x35d3('0x1b')],'transfereechannel':_0x1b3761['transfertargetchannel'],'transfereecalleridnum':_0x1b3761[_0x35d3('0x1c')],'transfereecalleridname':_0x1b3761[_0x35d3('0x1d')],'transfereeconnectedlinenum':_0x1b3761['transfertargetconnectedlinenum'],'transfereeconnectedlinename':_0x1b3761[_0x35d3('0x1e')],'transfereeaccountcode':_0x1b3761[_0x35d3('0x1f')],'transfereecontext':_0x1b3761['transfertargetcontext'],'transfereeexten':_0x1b3761[_0x35d3('0x20')],'transfereelinkedid':_0x1b3761['transfertargetlinkedid'],'isexternal':_0x1b3761[_0x35d3('0x21')],'context':_0x1b3761[_0x35d3('0x22')],'extension':_0x1b3761[_0x35d3('0x23')],'type':_0x35d3('0x24')},'log':_0x35d3('0x1')});};
\ No newline at end of file
+var _0x8d87=['Request','result','transfererchannel','transferercalleridnum','transferercalleridname','transfererconnectedlinenum','transfererexten','transfererlinkedid','transfereechannel','transfereecalleridnum','transfereecalleridname','transfereeconnectedlinenum','transfereeconnectedlinename','transfereeaccountcode','transfereecontext','transfereeexten','isexternal','context','extension','CreateVoiceTransferReport','origtransfererchannel','origtransferercalleridnum','secondtransfererconnectedlinenum','origtransfereraccountcode','secondtransferercontext','secondtransfererexten','origtransfererlinkedid','transfertargetcalleridnum','transfertargetcalleridname','transfertargetconnectedlinenum','transfertargetconnectedlinename','transfertargetexten','transfertargetlinkedid','origtransferercontext','attended','../client','blindTransfer'];(function(_0x2459fd,_0x575d9b){var _0x364cd2=function(_0x4b22f6){while(--_0x4b22f6){_0x2459fd['push'](_0x2459fd['shift']());}};_0x364cd2(++_0x575d9b);}(_0x8d87,0x170));var _0x78d8=function(_0x4fc5df,_0x3acaab){_0x4fc5df=_0x4fc5df-0x0;var _0x4a18f5=_0x8d87[_0x4fc5df];return _0x4a18f5;};'use strict';var client=require(_0x78d8('0x0'));exports[_0x78d8('0x1')]=function(_0x599b0f){return client[_0x78d8('0x2')]('CreateVoiceTransferReport',{'body':{'result':_0x599b0f[_0x78d8('0x3')],'transfererchannel':_0x599b0f[_0x78d8('0x4')],'transferercalleridnum':_0x599b0f[_0x78d8('0x5')],'transferercalleridname':_0x599b0f[_0x78d8('0x6')],'transfererconnectedlinenum':_0x599b0f[_0x78d8('0x7')],'transfererconnectedlinename':_0x599b0f['transfererconnectedlinename'],'transfereraccountcode':_0x599b0f['transfereraccountcode'],'transferercontext':_0x599b0f['transferercontext'],'transfererexten':_0x599b0f[_0x78d8('0x8')],'transfererlinkedid':_0x599b0f[_0x78d8('0x9')],'transfereechannel':_0x599b0f[_0x78d8('0xa')],'transfereecalleridnum':_0x599b0f[_0x78d8('0xb')],'transfereecalleridname':_0x599b0f[_0x78d8('0xc')],'transfereeconnectedlinenum':_0x599b0f[_0x78d8('0xd')],'transfereeconnectedlinename':_0x599b0f[_0x78d8('0xe')],'transfereeaccountcode':_0x599b0f[_0x78d8('0xf')],'transfereecontext':_0x599b0f[_0x78d8('0x10')],'transfereeexten':_0x599b0f[_0x78d8('0x11')],'transfereelinkedid':_0x599b0f['transfereelinkedid'],'isexternal':_0x599b0f[_0x78d8('0x12')],'context':_0x599b0f[_0x78d8('0x13')],'extension':_0x599b0f[_0x78d8('0x14')],'type':'blind'},'log':_0x78d8('0x15')});};exports['attendedTransfer']=function(_0x3906ed){return client[_0x78d8('0x2')](_0x78d8('0x15'),{'body':{'result':_0x3906ed[_0x78d8('0x3')],'transfererchannel':_0x3906ed[_0x78d8('0x16')],'transferercalleridnum':_0x3906ed[_0x78d8('0x17')],'transferercalleridname':_0x3906ed['origtransferercalleridname'],'transfererconnectedlinenum':_0x3906ed[_0x78d8('0x18')],'transfererconnectedlinename':_0x3906ed['secondtransfererconnectedlinename'],'transfereraccountcode':_0x3906ed[_0x78d8('0x19')],'transferercontext':_0x3906ed[_0x78d8('0x1a')],'transfererexten':_0x3906ed[_0x78d8('0x1b')],'transfererlinkedid':_0x3906ed[_0x78d8('0x1c')],'transfereechannel':_0x3906ed['transfertargetchannel'],'transfereecalleridnum':_0x3906ed[_0x78d8('0x1d')],'transfereecalleridname':_0x3906ed[_0x78d8('0x1e')],'transfereeconnectedlinenum':_0x3906ed[_0x78d8('0x1f')],'transfereeconnectedlinename':_0x3906ed[_0x78d8('0x20')],'transfereeaccountcode':_0x3906ed['transfertargetaccountcode'],'transfereecontext':_0x3906ed['transfertargetcontext'],'transfereeexten':_0x3906ed[_0x78d8('0x21')],'transfereelinkedid':_0x3906ed[_0x78d8('0x22')],'isexternal':_0x3906ed[_0x78d8('0x12')],'context':_0x3906ed[_0x78d8('0x23')],'extension':_0x3906ed['origtransfererexten'],'type':_0x78d8('0x24')},'log':_0x78d8('0x15')});};
\ No newline at end of file
diff --git a/server/services/ami/server/index.js b/server/services/ami/server/index.js
index fc7b0e3..e1e688c 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 _0xc9ec=['loggedInDb','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','predictiveIntervalPauses','predictiveIntervalAvailable','predictiveIntervalTotalCalls','originated','erlangCalls','erlangCallToSecond','erlangAbandonmentRate','erlangBusyFactor','startPredictive','startProgressive','Trunk','active','callerid','Interval','push','length','channels','find','uniqueid','channel','format','filename','MixMonitor','ai(mixmonitorid)','monitors','/var/spool/asterisk/monitor/','isNil','toLowerCase','mixmonitorid','status','rec','MixMonitor\x20Success','Channel\x20doesn\x27t\x20exist','voicechannel','map','destinationchannel','StopMixMonitor','stop','%s.%s','StopMixMonitor\x20Success','values','queueChannels','voicequeuechannel','voicequeuechannelhangup','Hangup','voicequeuechannelredirect','exten','context','telephones','trunks','outboundChannels','outbound','campaigns','event','emit','custom:','faxAccounts','checkAfterSend','server','127.0.0.1','log','AMI\x20RPC\x20server\x20listening\x20on\x20127.0.0.1:%d!','lodash','util','jayson/promise','validate','bluebird','moment','../../../config/environment','../properties','../ami','listen','SIP','name','timers','timer','updateAcw','agents','updateStatusRealtime','pause','QueuePause','isConnected','error','asterisk','username','ami\x20disconnected','join','action','Reload','then','catch','message','pick','Command','Action','voiceQueues','strategy','available','loggedIn','pTalking','sumBillable','total','abandoned','waiting'];(function(_0xf90938,_0x42bfbb){var _0x2992cd=function(_0x26e315){while(--_0x26e315){_0xf90938['push'](_0xf90938['shift']());}};_0x2992cd(++_0x42bfbb);}(_0xc9ec,0x1ea));var _0xcc9e=function(_0xd21fe7,_0x225a39){_0xd21fe7=_0xd21fe7-0x0;var _0x14d570=_0xc9ec[_0xd21fe7];return _0x14d570;};'use strict';var _=require(_0xcc9e('0x0'));var util=require(_0xcc9e('0x1'));var jayson=require(_0xcc9e('0x2'));var schema=require(_0xcc9e('0x3'));var BPromise=require(_0xcc9e('0x4'));var moment=require(_0xcc9e('0x5'));var config=require(_0xcc9e('0x6'));var properties=require(_0xcc9e('0x7'));var ami=require(_0xcc9e('0x8'));exports[_0xcc9e('0x9')]=function(_0x2ed043,_0x21d6b2,_0x305202){return new BPromise(function(_0x234ff9,_0x50ed4a){var _0x4376f9={'QueuePause':function(_0x5acd86){return new Promise(function(_0x26ae58,_0x139185){var _0x41900c=util['format']('%s/%s',_0xcc9e('0xa'),_0x5acd86[_0xcc9e('0xb')]);if(_0x2ed043[_0xcc9e('0xc')]&&_0x2ed043['timers'][_0x41900c]&&_0x2ed043[_0xcc9e('0xc')][_0x41900c][_0xcc9e('0xd')]){_0x2ed043['timers'][_0x41900c][_0xcc9e('0xe')]();}if(_0x2ed043[_0xcc9e('0xf')][_0x41900c]){_0x2ed043['agents'][_0x41900c][_0xcc9e('0x10')]({'statePause':_0x5acd86[_0xcc9e('0x11')]?!![]:![]});}_0x26ae58({'code':0xc8,'message':_0xcc9e('0x12')});});},'Reload':function(_0x463e5a){var _0x44c240=this;return new Promise(function(_0x1a4653,_0xe98874){if(ami[_0xcc9e('0x13')]()==![]){return _0xe98874(_0x44c240[_0xcc9e('0x14')](0x1f4,[config[_0xcc9e('0x15')]['ip'],config[_0xcc9e('0x15')][_0xcc9e('0x16')],_0xcc9e('0x17')][_0xcc9e('0x18')]('\x20')));}_0x463e5a=_['pick'](_0x463e5a,_['keys'](properties['module']));_0x463e5a[_0xcc9e('0x19')]=_0xcc9e('0x1a');return ami['Action'](_0x463e5a)[_0xcc9e('0x1b')](function(_0x2313f2){_0x1a4653({'code':0xc8,'message':_0x2313f2['message']});})[_0xcc9e('0x1c')](function(_0x72b640){_0xe98874(_0x44c240[_0xcc9e('0x14')](0x1f5,_0x72b640[_0xcc9e('0x1d')]));});});},'Command':function(_0x47e6a7){var _0x5544d6=this;return new Promise(function(_0x466368,_0x247555){if(ami[_0xcc9e('0x13')]()==![]){return _0x247555(_0x5544d6['error'](0x1f4,[config[_0xcc9e('0x15')]['ip'],config[_0xcc9e('0x15')][_0xcc9e('0x16')],'ami\x20disconnected'][_0xcc9e('0x18')]('\x20')));}_0x47e6a7=_[_0xcc9e('0x1e')](_0x47e6a7,'command');_0x47e6a7[_0xcc9e('0x19')]=_0xcc9e('0x1f');return ami[_0xcc9e('0x20')](_0x47e6a7)[_0xcc9e('0x1b')](function(_0x4afbe3){_0x466368({'code':0xc8,'message':_0x4afbe3['content']});})['catch'](function(_0x486dda){_0x247555(_0x5544d6['error'](0x1f5,_0x486dda[_0xcc9e('0x1d')]));});});},'VoiceQueues':function(_0x165fee){return new Promise(function(_0x3d6f5e,_0x58f9d5){var _0x3e2dbd=[];for(var _0x523c6f in _0x2ed043[_0xcc9e('0x21')]){if(_0x2ed043['voiceQueues']['hasOwnProperty'](_0x523c6f)){var _0x383ce5=_0x2ed043[_0xcc9e('0x21')][_0x523c6f];var _0x908701={'id':_0x383ce5['id'],'name':_0x383ce5[_0xcc9e('0xb')],'strategy':_0x383ce5[_0xcc9e('0x22')],'answered':_0x383ce5['answered'],'available':_0x383ce5[_0xcc9e('0x23')],'loggedIn':_0x383ce5[_0xcc9e('0x24')],'pTalking':_0x383ce5[_0xcc9e('0x25')],'sumBillable':_0x383ce5[_0xcc9e('0x26')],'sumDuration':_0x383ce5['sumDuration'],'sumHoldTime':_0x383ce5['sumHoldTime']||0x0,'talking':_0x383ce5['talking'],'total':_0x383ce5[_0xcc9e('0x27')],'type':_0x383ce5['type'],'unmanaged':_0x383ce5['unmanaged'],'abandoned':_0x383ce5[_0xcc9e('0x28')],'waiting':_0x383ce5[_0xcc9e('0x29')],'loggedInDb':_0x383ce5[_0xcc9e('0x2a')]};if(_0x383ce5['type']==='outbound'){_0x908701['dialActive']=_0x383ce5[_0xcc9e('0x2b')];_0x908701['dialMethod']=_0x383ce5[_0xcc9e('0x2c')];_0x908701[_0xcc9e('0x2d')]=_0x383ce5[_0xcc9e('0x2d')];_0x908701[_0xcc9e('0x2e')]=_0x383ce5[_0xcc9e('0x2e')];_0x908701[_0xcc9e('0x2f')]=_0x383ce5['dialOriginateTimeout'];_0x908701[_0xcc9e('0x30')]=_0x383ce5[_0xcc9e('0x30')];_0x908701['outboundAnswerAgiCallsDay']=_0x383ce5[_0xcc9e('0x31')];_0x908701[_0xcc9e('0x32')]=_0x383ce5[_0xcc9e('0x32')];_0x908701[_0xcc9e('0x33')]=_0x383ce5['outboundBlacklistCallsDay'];_0x908701['outboundBusyCallsDay']=_0x383ce5[_0xcc9e('0x34')];_0x908701[_0xcc9e('0x35')]=_0x383ce5[_0xcc9e('0x35')];_0x908701[_0xcc9e('0x36')]=_0x383ce5['outboundDropCallsDayACS'];_0x908701[_0xcc9e('0x37')]=_0x383ce5[_0xcc9e('0x37')];_0x908701[_0xcc9e('0x38')]=_0x383ce5['outboundDropCallsDayTimeout'];_0x908701[_0xcc9e('0x39')]=_0x383ce5[_0xcc9e('0x39')];_0x908701[_0xcc9e('0x3a')]=_0x383ce5[_0xcc9e('0x3a')];_0x908701[_0xcc9e('0x3b')]=_0x383ce5['outboundOriginateFailureCallsDay'];_0x908701['outboundReCallsDay']=_0x383ce5[_0xcc9e('0x3c')];_0x908701[_0xcc9e('0x3d')]=_0x383ce5[_0xcc9e('0x3d')];_0x908701[_0xcc9e('0x3e')]=_0x383ce5[_0xcc9e('0x3e')];_0x908701[_0xcc9e('0x3f')]=_0x383ce5['predictiveIntervalAnsweredCalls'];_0x908701[_0xcc9e('0x40')]=_0x383ce5[_0xcc9e('0x40')];_0x908701[_0xcc9e('0x41')]=_0x383ce5[_0xcc9e('0x41')];_0x908701['predictiveIntervalDroppedCallsCallersExit']=_0x383ce5[_0xcc9e('0x42')];_0x908701[_0xcc9e('0x43')]=_0x383ce5[_0xcc9e('0x43')];_0x908701[_0xcc9e('0x44')]=_0x383ce5[_0xcc9e('0x44')];_0x908701[_0xcc9e('0x45')]=_0x383ce5['predictiveIntervalErlangCallsDroppedCalls'];_0x908701[_0xcc9e('0x46')]=_0x383ce5['predictiveIntervalHitRate'];_0x908701['predictiveIntervalMultiplicativeFactor']=_0x383ce5['predictiveIntervalMultiplicativeFactor'];_0x908701[_0xcc9e('0x47')]=_0x383ce5[_0xcc9e('0x47')];_0x908701[_0xcc9e('0x48')]=_0x383ce5[_0xcc9e('0x48')];_0x908701[_0xcc9e('0x49')]=_0x383ce5[_0xcc9e('0x49')];_0x908701[_0xcc9e('0x1d')]=_0x383ce5['message'];_0x908701[_0xcc9e('0x4a')]=_0x383ce5[_0xcc9e('0x4a')];_0x908701[_0xcc9e('0x4b')]=_0x383ce5[_0xcc9e('0x4b')];_0x908701[_0xcc9e('0x4c')]=_0x383ce5['erlangCallToSecond'];_0x908701[_0xcc9e('0x4d')]=_0x383ce5['erlangAbandonmentRate'];_0x908701['erlangBusyFactor']=_0x383ce5[_0xcc9e('0x4e')];_0x908701[_0xcc9e('0x4f')]=_0x383ce5[_0xcc9e('0x4f')];_0x908701['startProgressive']=_0x383ce5[_0xcc9e('0x50')];}if(_0x383ce5[_0xcc9e('0x51')]){_0x908701[_0xcc9e('0x51')]={'id':_0x383ce5[_0xcc9e('0x51')]['id'],'name':_0x383ce5['Trunk'][_0xcc9e('0xb')],'active':_0x383ce5[_0xcc9e('0x51')][_0xcc9e('0x52')],'callerid':_0x383ce5[_0xcc9e('0x51')][_0xcc9e('0x53')]};}if(_0x383ce5[_0xcc9e('0x54')]){_0x908701[_0xcc9e('0x54')]={'id':_0x383ce5['Interval']['id'],'name':_0x383ce5[_0xcc9e('0x54')][_0xcc9e('0xb')]};}_0x3e2dbd[_0xcc9e('0x55')](_0x908701);}}_0x3d6f5e({'count':_0x3e2dbd[_0xcc9e('0x56')],'rows':_0x3e2dbd});});},'VoiceChannels':function(_0x54734a){return new Promise(function(_0x173d81,_0x5723d2){var _0x1ef28a=_['values'](_0x2ed043[_0xcc9e('0x57')]);_0x173d81({'count':_0x1ef28a[_0xcc9e('0x56')],'rows':_0x1ef28a});});},'VoiceChannelMixMonitor':function(_0x50012d){var _0x1c20a3=this;return new Promise(function(_0x6fb729,_0x41f576){if(ami[_0xcc9e('0x13')]()==![]){return _0x41f576(_0x1c20a3[_0xcc9e('0x14')](0x1f4,[config[_0xcc9e('0x15')]['ip'],config[_0xcc9e('0x15')][_0xcc9e('0x16')],'ami\x20disconnected'][_0xcc9e('0x18')]('\x20')));}var _0x24d7f3=schema(properties['voicechannel'])[_0xcc9e('0x3')](_0x50012d);if(_0x24d7f3['length']>0x0){return _0x41f576(_0x1c20a3[_0xcc9e('0x14')](0x1f4,_['map'](_0x24d7f3,_0xcc9e('0x1d'))[_0xcc9e('0x18')](',\x20')));}var _0x1b4325=_[_0xcc9e('0x58')](_0x2ed043[_0xcc9e('0x57')],{'uniqueid':_0x50012d[_0xcc9e('0x59')]});if(_0x1b4325&&_0x1b4325[_0xcc9e('0x5a')]){var _0x2de0b0=util[_0xcc9e('0x5b')]('%s.%s',_0x50012d[_0xcc9e('0x5c')]||_0x50012d[_0xcc9e('0x59')],_0x50012d[_0xcc9e('0x5b')]||'wav');return ami['Action']({'action':_0xcc9e('0x5d'),'channel':_0x1b4325[_0xcc9e('0x5a')],'file':_0x2de0b0,'options':_0xcc9e('0x5e')})['then'](function(_0x8f4ac3){var _0x3b4395=_[_0xcc9e('0x58')](_0x1b4325[_0xcc9e('0x5f')],{'filename':_0xcc9e('0x60')+_0x2de0b0['toLowerCase']()});if(_[_0xcc9e('0x61')](_0x3b4395)){_0x1b4325[_0xcc9e('0x5f')][_0xcc9e('0x55')]({'filename':_0xcc9e('0x60')+_0x2de0b0[_0xcc9e('0x62')](),'createdAt':moment()['format']('YYYY-MM-DD\x20HH:mm:ss'),'mixmonitorid':_0x8f4ac3[_0xcc9e('0x63')],'status':'rec'});}else{_0x3b4395[_0xcc9e('0x63')]=_0x8f4ac3[_0xcc9e('0x63')];_0x3b4395[_0xcc9e('0x64')]=_0xcc9e('0x65');}_0x6fb729({'code':0xc8,'message':[_0x50012d[_0xcc9e('0x59')],_0xcc9e('0x66'),_0x8f4ac3['mixmonitorid']][_0xcc9e('0x18')]('\x20'),'mixmonitorid':_0x8f4ac3[_0xcc9e('0x63')]});})[_0xcc9e('0x1c')](function(_0x5b679d){_0x41f576(_0x1c20a3[_0xcc9e('0x14')](0x1f5,[_0x50012d[_0xcc9e('0x59')],_0x5b679d[_0xcc9e('0x1d')][_0xcc9e('0x62')]()][_0xcc9e('0x18')]('\x20')));});}else{return _0x41f576(_0x1c20a3[_0xcc9e('0x14')](0x1f5,_0xcc9e('0x67')));}});},'VoiceChannelStopMixMonitor':function(_0x16d8c0){var _0x481a64=this;return new Promise(function(_0x20fb02,_0x5940c0){if(ami[_0xcc9e('0x13')]()==![]){return _0x5940c0(_0x481a64['error'](0x1f4,[config[_0xcc9e('0x15')]['ip'],config[_0xcc9e('0x15')][_0xcc9e('0x16')],_0xcc9e('0x17')][_0xcc9e('0x18')]('\x20')));}var _0x3da69f=schema(properties[_0xcc9e('0x68')])[_0xcc9e('0x3')](_0x16d8c0);if(_0x3da69f['length']>0x0){return _0x5940c0(_0x481a64['error'](0x1f4,_[_0xcc9e('0x69')](_0x3da69f,_0xcc9e('0x1d'))['join'](',\x20')));}var _0x1334c3=_[_0xcc9e('0x58')](_0x2ed043[_0xcc9e('0x57')],{'uniqueid':_0x16d8c0['uniqueid']});if(_0x1334c3){return BPromise['resolve']()['then'](function(){if(_0x1334c3[_0xcc9e('0x5a')]){return ami[_0xcc9e('0x20')]({'action':'StopMixMonitor','channel':_0x1334c3[_0xcc9e('0x5a')],'mixmonitorid':_0x16d8c0[_0xcc9e('0x63')]})['catch'](function(_0x417649){});}})[_0xcc9e('0x1b')](function(){if(_0x1334c3[_0xcc9e('0x6a')]){return ami[_0xcc9e('0x20')]({'action':_0xcc9e('0x6b'),'channel':_0x1334c3[_0xcc9e('0x6a')],'mixmonitorid':_0x16d8c0[_0xcc9e('0x63')]})['catch'](function(_0x134bd0){});}})[_0xcc9e('0x1b')](function(_0x1f4776){var _0x58c227=_[_0xcc9e('0x58')](_0x1334c3[_0xcc9e('0x5f')],{'mixmonitorid':_0x16d8c0[_0xcc9e('0x63')]});if(_0x58c227){_0x58c227[_0xcc9e('0x64')]=_0xcc9e('0x6c');}})[_0xcc9e('0x1b')](function(){var _0x25358e=util[_0xcc9e('0x5b')](_0xcc9e('0x6d'),_0x16d8c0[_0xcc9e('0x5c')]||_0x16d8c0[_0xcc9e('0x59')],_0x16d8c0[_0xcc9e('0x5b')]||'wav');var _0x4bb9fc=_[_0xcc9e('0x58')](_0x1334c3[_0xcc9e('0x5f')],{'filename':'/var/spool/asterisk/monitor/'+_0x25358e[_0xcc9e('0x62')]()});if(_0x4bb9fc){_0x4bb9fc[_0xcc9e('0x64')]='stop';}})[_0xcc9e('0x1b')](function(){_0x20fb02({'code':0xc8,'message':[_0x16d8c0[_0xcc9e('0x59')],_0xcc9e('0x6e')][_0xcc9e('0x18')]('\x20')});})[_0xcc9e('0x1c')](function(_0x3f1780){_0x5940c0(_0x481a64[_0xcc9e('0x14')](0x1f5,[_0x16d8c0[_0xcc9e('0x59')],_0x3f1780[_0xcc9e('0x1d')]['toLowerCase']()][_0xcc9e('0x18')]('\x20')));});}else{return _0x5940c0(_0x481a64[_0xcc9e('0x14')](0x1f5,_0xcc9e('0x67')));}});},'VoiceQueuesChannels':function(_0x5da8d3){return new Promise(function(_0xa19112,_0x84778b){var _0x586b9e=_[_0xcc9e('0x6f')](_0x2ed043[_0xcc9e('0x70')]);_0xa19112({'count':_0x586b9e['length'],'rows':_0x586b9e});});},'VoiceQueuesChannel':function(_0x2d3a92){var _0x50dae4=this;return new Promise(function(_0x23c248,_0x562fbc){var _0x2811e5=schema(properties[_0xcc9e('0x71')])[_0xcc9e('0x3')](_0x2d3a92);if(_0x2811e5['length']>0x0){return _0x562fbc(_0x50dae4['error'](0x1f4,_[_0xcc9e('0x69')](_0x2811e5,_0xcc9e('0x1d'))[_0xcc9e('0x18')](',\x20')));}var _0x49e718=_[_0xcc9e('0x58')](_0x2ed043[_0xcc9e('0x70')],{'uniqueid':_0x2d3a92[_0xcc9e('0x59')]});if(_0x49e718){_0x23c248(_0x49e718);}else{return _0x562fbc(_0x50dae4[_0xcc9e('0x14')](0x1f5,_0xcc9e('0x67')));}});},'VoiceQueuesChannelHangup':function(_0x3b7cb6){var _0x2846fd=this;return new Promise(function(_0x317641,_0x224b1d){if(ami[_0xcc9e('0x13')]()==![]){return _0x224b1d(_0x2846fd[_0xcc9e('0x14')](0x1f4,[config[_0xcc9e('0x15')]['ip'],config[_0xcc9e('0x15')]['username'],_0xcc9e('0x17')]['join']('\x20')));}var _0x2a714c=schema(properties[_0xcc9e('0x72')])[_0xcc9e('0x3')](_0x3b7cb6);if(_0x2a714c['length']>0x0){return _0x224b1d(_0x2846fd[_0xcc9e('0x14')](0x1f4,_[_0xcc9e('0x69')](_0x2a714c,'message')[_0xcc9e('0x18')](',\x20')));}var _0x282459=_[_0xcc9e('0x58')](_0x2ed043[_0xcc9e('0x70')],{'uniqueid':_0x3b7cb6[_0xcc9e('0x59')]});if(_0x282459&&_0x282459['channel']){return ami[_0xcc9e('0x20')]({'action':_0xcc9e('0x73'),'channel':_0x282459['channel']})[_0xcc9e('0x1b')](function(_0x5f0839){_0x317641({'code':0xc8,'message':[_0x3b7cb6[_0xcc9e('0x59')],_0x5f0839[_0xcc9e('0x1d')][_0xcc9e('0x62')]()][_0xcc9e('0x18')]('\x20')});})[_0xcc9e('0x1c')](function(_0x5aba18){_0x224b1d(_0x2846fd[_0xcc9e('0x14')](0x1f5,[_0x3b7cb6[_0xcc9e('0x59')],_0x5aba18[_0xcc9e('0x1d')]['toLowerCase']()][_0xcc9e('0x18')]('\x20')));});}else{return _0x224b1d(_0x2846fd[_0xcc9e('0x14')](0x1f5,'Channel\x20doesn\x27t\x20exist'));}});},'VoiceQueuesChannelRedirect':function(_0x55d901){var _0x29cc25=this;return new Promise(function(_0x26f954,_0x4de606){if(ami[_0xcc9e('0x13')]()==![]){return _0x4de606(_0x29cc25[_0xcc9e('0x14')](0x1f4,[config[_0xcc9e('0x15')]['ip'],config[_0xcc9e('0x15')][_0xcc9e('0x16')],_0xcc9e('0x17')][_0xcc9e('0x18')]('\x20')));}var _0x584f4a=schema(properties[_0xcc9e('0x74')])[_0xcc9e('0x3')](_0x55d901);if(_0x584f4a[_0xcc9e('0x56')]>0x0){return _0x4de606(_0x29cc25['error'](0x1f4,_[_0xcc9e('0x69')](_0x584f4a,_0xcc9e('0x1d'))['join'](',\x20')));}var _0x2c5a25=_[_0xcc9e('0x58')](_0x2ed043[_0xcc9e('0x70')],{'uniqueid':_0x55d901[_0xcc9e('0x59')]});if(_0x2c5a25&&_0x2c5a25[_0xcc9e('0x5a')]){return ami[_0xcc9e('0x20')]({'action':'Redirect','channel':_0x2c5a25[_0xcc9e('0x5a')],'exten':_0x55d901[_0xcc9e('0x75')],'context':_0x55d901[_0xcc9e('0x76')]||_0x2c5a25[_0xcc9e('0x76')],'priority':0x1})[_0xcc9e('0x1b')](function(_0xd7ef1a){_0x26f954({'code':0xc8,'message':[_0x55d901['uniqueid'],_0xd7ef1a['message'][_0xcc9e('0x62')]()]['join']('\x20')});})[_0xcc9e('0x1c')](function(_0x4fdca3){_0x4de606(_0x29cc25[_0xcc9e('0x14')](0x1f5,[_0x55d901[_0xcc9e('0x59')],_0x4fdca3[_0xcc9e('0x1d')][_0xcc9e('0x62')]()][_0xcc9e('0x18')]('\x20')));});}else{return _0x4de606(_0x29cc25['error'](0x1f5,'Channel\x20doesn\x27t\x20exist'));}});},'Agents':function(_0x5ac0e3){return new Promise(function(_0x41094d,_0x1ef95c){var _0x5c3025=_[_0xcc9e('0x6f')](_0x2ed043[_0xcc9e('0xf')]);_0x41094d({'count':_0x5c3025[_0xcc9e('0x56')],'rows':_0x5c3025});});},'Telephones':function(_0xd4acf8){return new Promise(function(_0x517adc,_0x2cf168){var _0x30400a=_[_0xcc9e('0x6f')](_0x2ed043[_0xcc9e('0x77')]);_0x517adc({'count':_0x30400a['length'],'rows':_0x30400a});});},'Trunks':function(_0xc871fa){return new Promise(function(_0x1e6694,_0x40ebfc){var _0x103da5=_[_0xcc9e('0x6f')](_0x2ed043[_0xcc9e('0x78')]);_0x1e6694({'count':_0x103da5['length'],'rows':_0x103da5});});},'OutboundChannels':function(_0x1ca9b9){return new Promise(function(_0xdf2507,_0x10e53e){var _0x21ae89=_[_0xcc9e('0x6f')](_0x2ed043[_0xcc9e('0x79')]);_0xdf2507({'count':_0x21ae89[_0xcc9e('0x56')],'rows':_0x21ae89});});},'Outbound':function(_0x54fe33){return new Promise(function(_0x1160bf,_0x2734fe){_0x1160bf(_0x2ed043[_0xcc9e('0x7a')]);});},'Campaigns':function(_0x28f046){return new Promise(function(_0x23219c,_0x55f0b4){var _0x269882=_[_0xcc9e('0x6f')](_0x2ed043[_0xcc9e('0x7b')]);_0x23219c({'count':_0x269882[_0xcc9e('0x56')],'rows':_0x269882});});},'VoiceQueuesPreview':function(_0x4fe053){var _0xfc6a08=this;return new Promise(function(_0x2fa286,_0x27de61){_0x21d6b2['run'](_0x4fe053['id'])[_0xcc9e('0x1b')](function(_0x3a362a){_0x2fa286({'code':0xc8,'message':_0x3a362a[_0xcc9e('0x1d')]});})[_0xcc9e('0x1c')](function(_0x13804d){_0x27de61(_0xfc6a08[_0xcc9e('0x14')](0x1f4,_0x13804d[_0xcc9e('0x1d')]));});});},'EventManager':function(_0x1754b2){var _0x112704=this;return new Promise(function(_0x42e2a4,_0x41c208){if(!_0x1754b2[_0xcc9e('0x7c')]){return _0x41c208(_0x112704[_0xcc9e('0x14')](0x1f4,'Event\x20name\x20mandatory'));}ami[_0xcc9e('0x7d')](_0xcc9e('0x7e')+_0x1754b2[_0xcc9e('0x7c')],_0x1754b2[_0xcc9e('0x1d')]);_0x42e2a4({'code':0xc8,'message':_0x1754b2});});},'FaxAccounts':function(_0x407172){return new Promise(function(_0x2e4072,_0x2971f6){var _0x415035=_[_0xcc9e('0x6f')](_0x2ed043[_0xcc9e('0x7f')]);_0x2e4072({'count':_0x415035[_0xcc9e('0x56')],'rows':_0x415035});});},'SendFax':function(_0x108fce){var _0x568cc3=this;return new Promise(function(_0x320262,_0x44aee2){_0x305202['send'](_0x108fce)[_0xcc9e('0x1b')](function(_0x42521d){_0x320262({'code':0xc8,'message':_0x42521d[_0xcc9e('0x1d')]});})[_0xcc9e('0x1c')](function(_0xcce806){_0x44aee2(_0x568cc3['error'](0x1f4,_0xcce806['message']));});});},'CheckAfterSend':function(_0x3b445e){var _0x2447a0=this;return new Promise(function(_0x4cc70c,_0x4014d0){_0x305202[_0xcc9e('0x80')](_0x3b445e)[_0xcc9e('0x1b')](function(_0x2926b3){_0x4cc70c({'code':0xc8,'message':_0x2926b3[_0xcc9e('0x1d')]});})[_0xcc9e('0x1c')](function(_0x157ce3){_0x4014d0(_0x2447a0[_0xcc9e('0x14')](0x1f4,_0x157ce3['message']));});});}};var _0xf21221=jayson[_0xcc9e('0x81')](_0x4376f9)['http']();_0xf21221['on']('error',function(_0x52b667){return _0x50ed4a(_0x52b667);});_0xf21221['listen'](0x232a,_0xcc9e('0x82'),function(){console[_0xcc9e('0x83')](_0xcc9e('0x84'),0x232a);return _0x234ff9('RPC\x20listening\x20on\x20port:'+0x232a);});});};
\ No newline at end of file
+var _0x641a=['bluebird','moment','../../../config/environment','../properties','format','%s/%s','SIP','name','timers','timer','updateAcw','updateStatusRealtime','pause','QueuePause','isConnected','asterisk','username','ami\x20disconnected','join','pick','keys','module','action','Reload','Action','then','message','catch','error','command','Command','content','voiceQueues','answered','available','loggedIn','pTalking','sumDuration','sumHoldTime','talking','total','type','unmanaged','waiting','loggedInDb','outbound','dialActive','dialMethod','dialOriginateCallerIdName','dialOriginateCallerIdNumber','dialOriginateTimeout','outboundAnswerAgiCallsDay','outboundAnswerCallsDay','outboundBlacklistCallsDay','outboundBusyCallsDay','outboundDropCallsDayACS','outboundDropCallsDayCallersExit','outboundNoAnswerCallsDay','outboundNoSuchCallsDay','outboundOriginateFailureCallsDay','outboundReCallsDay','outboundRejectCallsDay','outboundUnknownCallsDay','predictiveIntervalAnsweredCalls','predictiveIntervalAvgTalktime','predictiveIntervalDroppedCallsCallersExit','predictiveIntervalDroppedCallsTimeout','predictiveIntervalErlangCalls','predictiveIntervalErlangCallsDroppedCalls','predictiveIntervalHitRate','predictiveIntervalMultiplicativeFactor','predictiveIntervalAvailable','predictiveIntervalTotalCalls','originated','erlangCallToSecond','erlangAbandonmentRate','erlangBusyFactor','startPredictive','startProgressive','Trunk','active','callerid','Interval','push','length','values','channels','voicechannel','map','find','uniqueid','channel','%s.%s','filename','MixMonitor','monitors','/var/spool/asterisk/monitor/','toLowerCase','YYYY-MM-DD\x20HH:mm:ss','mixmonitorid','rec','Channel\x20doesn\x27t\x20exist','resolve','StopMixMonitor','destinationchannel','status','wav','StopMixMonitor\x20Success','queueChannels','voicequeuechannelhangup','voicequeuechannelredirect','exten','context','agents','telephones','campaigns','Event\x20name\x20mandatory','custom:','faxAccounts','send','checkAfterSend','server','http','listen','127.0.0.1','log','RPC\x20listening\x20on\x20port:','lodash','jayson/promise','validate'];(function(_0x5ecadc,_0x1cf9f1){var _0x565037=function(_0x22908b){while(--_0x22908b){_0x5ecadc['push'](_0x5ecadc['shift']());}};_0x565037(++_0x1cf9f1);}(_0x641a,0x101));var _0xa641=function(_0x5b7786,_0xe47b5c){_0x5b7786=_0x5b7786-0x0;var _0x5882ab=_0x641a[_0x5b7786];return _0x5882ab;};'use strict';var _=require(_0xa641('0x0'));var util=require('util');var jayson=require(_0xa641('0x1'));var schema=require(_0xa641('0x2'));var BPromise=require(_0xa641('0x3'));var moment=require(_0xa641('0x4'));var config=require(_0xa641('0x5'));var properties=require(_0xa641('0x6'));var ami=require('../ami');exports['listen']=function(_0x174ff1,_0x1e02cb,_0x43f046){return new BPromise(function(_0x55847f,_0x2b1d41){var _0x17ea56={'QueuePause':function(_0x5b5676){return new Promise(function(_0x50fcd4,_0x2a5f24){var _0x31f589=util[_0xa641('0x7')](_0xa641('0x8'),_0xa641('0x9'),_0x5b5676[_0xa641('0xa')]);if(_0x174ff1[_0xa641('0xb')]&&_0x174ff1[_0xa641('0xb')][_0x31f589]&&_0x174ff1['timers'][_0x31f589][_0xa641('0xc')]){_0x174ff1[_0xa641('0xb')][_0x31f589][_0xa641('0xd')]();}if(_0x174ff1['agents'][_0x31f589]){_0x174ff1['agents'][_0x31f589][_0xa641('0xe')]({'statePause':_0x5b5676[_0xa641('0xf')]?!![]:![]});}_0x50fcd4({'code':0xc8,'message':_0xa641('0x10')});});},'Reload':function(_0x5d0d32){var _0x3354ff=this;return new Promise(function(_0x3631a2,_0x6e41a9){if(ami[_0xa641('0x11')]()==![]){return _0x6e41a9(_0x3354ff['error'](0x1f4,[config[_0xa641('0x12')]['ip'],config[_0xa641('0x12')][_0xa641('0x13')],_0xa641('0x14')][_0xa641('0x15')]('\x20')));}_0x5d0d32=_[_0xa641('0x16')](_0x5d0d32,_[_0xa641('0x17')](properties[_0xa641('0x18')]));_0x5d0d32[_0xa641('0x19')]=_0xa641('0x1a');return ami[_0xa641('0x1b')](_0x5d0d32)[_0xa641('0x1c')](function(_0x1221e3){_0x3631a2({'code':0xc8,'message':_0x1221e3[_0xa641('0x1d')]});})[_0xa641('0x1e')](function(_0x544050){_0x6e41a9(_0x3354ff[_0xa641('0x1f')](0x1f5,_0x544050['message']));});});},'Command':function(_0x6bec4a){var _0x4fdbdb=this;return new Promise(function(_0x26d1e8,_0x644765){if(ami[_0xa641('0x11')]()==![]){return _0x644765(_0x4fdbdb[_0xa641('0x1f')](0x1f4,[config[_0xa641('0x12')]['ip'],config[_0xa641('0x12')]['username'],_0xa641('0x14')][_0xa641('0x15')]('\x20')));}_0x6bec4a=_[_0xa641('0x16')](_0x6bec4a,_0xa641('0x20'));_0x6bec4a['action']=_0xa641('0x21');return ami[_0xa641('0x1b')](_0x6bec4a)[_0xa641('0x1c')](function(_0x5dd0ae){_0x26d1e8({'code':0xc8,'message':_0x5dd0ae[_0xa641('0x22')]});})[_0xa641('0x1e')](function(_0x403300){_0x644765(_0x4fdbdb[_0xa641('0x1f')](0x1f5,_0x403300['message']));});});},'VoiceQueues':function(_0x26eaca){return new Promise(function(_0x2f4f14,_0x24c021){var _0x35607b=[];for(var _0x17cf5b in _0x174ff1[_0xa641('0x23')]){if(_0x174ff1['voiceQueues']['hasOwnProperty'](_0x17cf5b)){var _0x30ec7b=_0x174ff1[_0xa641('0x23')][_0x17cf5b];var _0x289f58={'id':_0x30ec7b['id'],'name':_0x30ec7b[_0xa641('0xa')],'strategy':_0x30ec7b['strategy'],'answered':_0x30ec7b[_0xa641('0x24')],'available':_0x30ec7b[_0xa641('0x25')],'loggedIn':_0x30ec7b[_0xa641('0x26')],'pTalking':_0x30ec7b[_0xa641('0x27')],'sumBillable':_0x30ec7b['sumBillable'],'sumDuration':_0x30ec7b[_0xa641('0x28')],'sumHoldTime':_0x30ec7b[_0xa641('0x29')]||0x0,'talking':_0x30ec7b[_0xa641('0x2a')],'total':_0x30ec7b[_0xa641('0x2b')],'type':_0x30ec7b[_0xa641('0x2c')],'unmanaged':_0x30ec7b[_0xa641('0x2d')],'abandoned':_0x30ec7b['abandoned'],'waiting':_0x30ec7b[_0xa641('0x2e')],'loggedInDb':_0x30ec7b[_0xa641('0x2f')]};if(_0x30ec7b[_0xa641('0x2c')]===_0xa641('0x30')){_0x289f58[_0xa641('0x31')]=_0x30ec7b[_0xa641('0x31')];_0x289f58[_0xa641('0x32')]=_0x30ec7b[_0xa641('0x32')];_0x289f58[_0xa641('0x33')]=_0x30ec7b[_0xa641('0x33')];_0x289f58[_0xa641('0x34')]=_0x30ec7b['dialOriginateCallerIdNumber'];_0x289f58[_0xa641('0x35')]=_0x30ec7b[_0xa641('0x35')];_0x289f58['dialPrefix']=_0x30ec7b['dialPrefix'];_0x289f58['outboundAnswerAgiCallsDay']=_0x30ec7b[_0xa641('0x36')];_0x289f58[_0xa641('0x37')]=_0x30ec7b[_0xa641('0x37')];_0x289f58['outboundBlacklistCallsDay']=_0x30ec7b[_0xa641('0x38')];_0x289f58[_0xa641('0x39')]=_0x30ec7b[_0xa641('0x39')];_0x289f58['outboundCongestionCallsDay']=_0x30ec7b['outboundCongestionCallsDay'];_0x289f58[_0xa641('0x3a')]=_0x30ec7b[_0xa641('0x3a')];_0x289f58[_0xa641('0x3b')]=_0x30ec7b[_0xa641('0x3b')];_0x289f58['outboundDropCallsDayTimeout']=_0x30ec7b['outboundDropCallsDayTimeout'];_0x289f58[_0xa641('0x3c')]=_0x30ec7b['outboundNoAnswerCallsDay'];_0x289f58['outboundNoSuchCallsDay']=_0x30ec7b[_0xa641('0x3d')];_0x289f58['outboundOriginateFailureCallsDay']=_0x30ec7b[_0xa641('0x3e')];_0x289f58[_0xa641('0x3f')]=_0x30ec7b[_0xa641('0x3f')];_0x289f58['outboundRejectCallsDay']=_0x30ec7b[_0xa641('0x40')];_0x289f58[_0xa641('0x41')]=_0x30ec7b['outboundUnknownCallsDay'];_0x289f58[_0xa641('0x42')]=_0x30ec7b[_0xa641('0x42')];_0x289f58['predictiveIntervalAvgHoldtime']=_0x30ec7b['predictiveIntervalAvgHoldtime'];_0x289f58[_0xa641('0x43')]=_0x30ec7b[_0xa641('0x43')];_0x289f58[_0xa641('0x44')]=_0x30ec7b[_0xa641('0x44')];_0x289f58[_0xa641('0x45')]=_0x30ec7b['predictiveIntervalDroppedCallsTimeout'];_0x289f58[_0xa641('0x46')]=_0x30ec7b[_0xa641('0x46')];_0x289f58['predictiveIntervalErlangCallsDroppedCalls']=_0x30ec7b[_0xa641('0x47')];_0x289f58[_0xa641('0x48')]=_0x30ec7b[_0xa641('0x48')];_0x289f58[_0xa641('0x49')]=_0x30ec7b[_0xa641('0x49')];_0x289f58['predictiveIntervalPauses']=_0x30ec7b['predictiveIntervalPauses'];_0x289f58['predictiveIntervalAvailable']=_0x30ec7b[_0xa641('0x4a')];_0x289f58[_0xa641('0x4b')]=_0x30ec7b[_0xa641('0x4b')];_0x289f58['message']=_0x30ec7b[_0xa641('0x1d')];_0x289f58[_0xa641('0x4c')]=_0x30ec7b[_0xa641('0x4c')];_0x289f58['erlangCalls']=_0x30ec7b['erlangCalls'];_0x289f58[_0xa641('0x4d')]=_0x30ec7b[_0xa641('0x4d')];_0x289f58[_0xa641('0x4e')]=_0x30ec7b[_0xa641('0x4e')];_0x289f58[_0xa641('0x4f')]=_0x30ec7b[_0xa641('0x4f')];_0x289f58[_0xa641('0x50')]=_0x30ec7b['startPredictive'];_0x289f58['startProgressive']=_0x30ec7b[_0xa641('0x51')];}if(_0x30ec7b['Trunk']){_0x289f58[_0xa641('0x52')]={'id':_0x30ec7b['Trunk']['id'],'name':_0x30ec7b['Trunk']['name'],'active':_0x30ec7b['Trunk'][_0xa641('0x53')],'callerid':_0x30ec7b[_0xa641('0x52')][_0xa641('0x54')]};}if(_0x30ec7b[_0xa641('0x55')]){_0x289f58[_0xa641('0x55')]={'id':_0x30ec7b['Interval']['id'],'name':_0x30ec7b[_0xa641('0x55')][_0xa641('0xa')]};}_0x35607b[_0xa641('0x56')](_0x289f58);}}_0x2f4f14({'count':_0x35607b[_0xa641('0x57')],'rows':_0x35607b});});},'VoiceChannels':function(_0x598099){return new Promise(function(_0x411eaf,_0x5a782d){var _0x3352c9=_[_0xa641('0x58')](_0x174ff1[_0xa641('0x59')]);_0x411eaf({'count':_0x3352c9[_0xa641('0x57')],'rows':_0x3352c9});});},'VoiceChannelMixMonitor':function(_0x17b34a){var _0x4974af=this;return new Promise(function(_0x4da4b9,_0x348891){if(ami[_0xa641('0x11')]()==![]){return _0x348891(_0x4974af[_0xa641('0x1f')](0x1f4,[config[_0xa641('0x12')]['ip'],config[_0xa641('0x12')]['username'],_0xa641('0x14')]['join']('\x20')));}var _0x25543c=schema(properties[_0xa641('0x5a')])[_0xa641('0x2')](_0x17b34a);if(_0x25543c[_0xa641('0x57')]>0x0){return _0x348891(_0x4974af[_0xa641('0x1f')](0x1f4,_[_0xa641('0x5b')](_0x25543c,_0xa641('0x1d'))[_0xa641('0x15')](',\x20')));}var _0x28225f=_[_0xa641('0x5c')](_0x174ff1[_0xa641('0x59')],{'uniqueid':_0x17b34a[_0xa641('0x5d')]});if(_0x28225f&&_0x28225f[_0xa641('0x5e')]){var _0x4e8131=util[_0xa641('0x7')](_0xa641('0x5f'),_0x17b34a[_0xa641('0x60')]||_0x17b34a['uniqueid'],_0x17b34a['format']||'wav');return ami[_0xa641('0x1b')]({'action':_0xa641('0x61'),'channel':_0x28225f[_0xa641('0x5e')],'file':_0x4e8131,'options':'ai(mixmonitorid)'})[_0xa641('0x1c')](function(_0x29d987){var _0x2ffb7e=_[_0xa641('0x5c')](_0x28225f[_0xa641('0x62')],{'filename':_0xa641('0x63')+_0x4e8131['toLowerCase']()});if(_['isNil'](_0x2ffb7e)){_0x28225f[_0xa641('0x62')]['push']({'filename':_0xa641('0x63')+_0x4e8131[_0xa641('0x64')](),'createdAt':moment()[_0xa641('0x7')](_0xa641('0x65')),'mixmonitorid':_0x29d987[_0xa641('0x66')],'status':_0xa641('0x67')});}else{_0x2ffb7e[_0xa641('0x66')]=_0x29d987['mixmonitorid'];_0x2ffb7e['status']=_0xa641('0x67');}_0x4da4b9({'code':0xc8,'message':[_0x17b34a[_0xa641('0x5d')],'MixMonitor\x20Success',_0x29d987['mixmonitorid']]['join']('\x20'),'mixmonitorid':_0x29d987['mixmonitorid']});})[_0xa641('0x1e')](function(_0x3ab760){_0x348891(_0x4974af['error'](0x1f5,[_0x17b34a[_0xa641('0x5d')],_0x3ab760['message'][_0xa641('0x64')]()][_0xa641('0x15')]('\x20')));});}else{return _0x348891(_0x4974af[_0xa641('0x1f')](0x1f5,_0xa641('0x68')));}});},'VoiceChannelStopMixMonitor':function(_0x26f877){var _0x3a92c2=this;return new Promise(function(_0x378d41,_0x35de45){if(ami[_0xa641('0x11')]()==![]){return _0x35de45(_0x3a92c2['error'](0x1f4,[config[_0xa641('0x12')]['ip'],config[_0xa641('0x12')][_0xa641('0x13')],'ami\x20disconnected'][_0xa641('0x15')]('\x20')));}var _0x282c15=schema(properties[_0xa641('0x5a')])[_0xa641('0x2')](_0x26f877);if(_0x282c15['length']>0x0){return _0x35de45(_0x3a92c2[_0xa641('0x1f')](0x1f4,_[_0xa641('0x5b')](_0x282c15,'message')[_0xa641('0x15')](',\x20')));}var _0x58bbe4=_[_0xa641('0x5c')](_0x174ff1[_0xa641('0x59')],{'uniqueid':_0x26f877[_0xa641('0x5d')]});if(_0x58bbe4){return BPromise[_0xa641('0x69')]()[_0xa641('0x1c')](function(){if(_0x58bbe4[_0xa641('0x5e')]){return ami['Action']({'action':_0xa641('0x6a'),'channel':_0x58bbe4['channel'],'mixmonitorid':_0x26f877[_0xa641('0x66')]})[_0xa641('0x1e')](function(_0x59fe01){});}})[_0xa641('0x1c')](function(){if(_0x58bbe4['destinationchannel']){return ami[_0xa641('0x1b')]({'action':_0xa641('0x6a'),'channel':_0x58bbe4[_0xa641('0x6b')],'mixmonitorid':_0x26f877[_0xa641('0x66')]})['catch'](function(_0x412fd3){});}})[_0xa641('0x1c')](function(_0x2f4227){var _0x33c2ea=_[_0xa641('0x5c')](_0x58bbe4[_0xa641('0x62')],{'mixmonitorid':_0x26f877[_0xa641('0x66')]});if(_0x33c2ea){_0x33c2ea[_0xa641('0x6c')]='stop';}})[_0xa641('0x1c')](function(){var _0x2cbfda=util[_0xa641('0x7')](_0xa641('0x5f'),_0x26f877[_0xa641('0x60')]||_0x26f877[_0xa641('0x5d')],_0x26f877['format']||_0xa641('0x6d'));var _0x45d43a=_[_0xa641('0x5c')](_0x58bbe4[_0xa641('0x62')],{'filename':_0xa641('0x63')+_0x2cbfda['toLowerCase']()});if(_0x45d43a){_0x45d43a[_0xa641('0x6c')]='stop';}})['then'](function(){_0x378d41({'code':0xc8,'message':[_0x26f877[_0xa641('0x5d')],_0xa641('0x6e')]['join']('\x20')});})[_0xa641('0x1e')](function(_0x41fcf4){_0x35de45(_0x3a92c2[_0xa641('0x1f')](0x1f5,[_0x26f877[_0xa641('0x5d')],_0x41fcf4[_0xa641('0x1d')][_0xa641('0x64')]()][_0xa641('0x15')]('\x20')));});}else{return _0x35de45(_0x3a92c2[_0xa641('0x1f')](0x1f5,'Channel\x20doesn\x27t\x20exist'));}});},'VoiceQueuesChannels':function(_0x4e5fa6){return new Promise(function(_0x1e3ff7,_0x32a779){var _0x38ccea=_[_0xa641('0x58')](_0x174ff1[_0xa641('0x6f')]);_0x1e3ff7({'count':_0x38ccea['length'],'rows':_0x38ccea});});},'VoiceQueuesChannel':function(_0x43beb3){var _0x138bef=this;return new Promise(function(_0x4a76a1,_0x4f0b55){var _0x1b1b22=schema(properties['voicequeuechannel'])[_0xa641('0x2')](_0x43beb3);if(_0x1b1b22['length']>0x0){return _0x4f0b55(_0x138bef[_0xa641('0x1f')](0x1f4,_['map'](_0x1b1b22,_0xa641('0x1d'))['join'](',\x20')));}var _0xae26c3=_[_0xa641('0x5c')](_0x174ff1['queueChannels'],{'uniqueid':_0x43beb3[_0xa641('0x5d')]});if(_0xae26c3){_0x4a76a1(_0xae26c3);}else{return _0x4f0b55(_0x138bef[_0xa641('0x1f')](0x1f5,_0xa641('0x68')));}});},'VoiceQueuesChannelHangup':function(_0x38f180){var _0x1f0e83=this;return new Promise(function(_0x690af0,_0x35746f){if(ami['isConnected']()==![]){return _0x35746f(_0x1f0e83[_0xa641('0x1f')](0x1f4,[config[_0xa641('0x12')]['ip'],config[_0xa641('0x12')]['username'],_0xa641('0x14')][_0xa641('0x15')]('\x20')));}var _0x429304=schema(properties[_0xa641('0x70')])[_0xa641('0x2')](_0x38f180);if(_0x429304[_0xa641('0x57')]>0x0){return _0x35746f(_0x1f0e83[_0xa641('0x1f')](0x1f4,_['map'](_0x429304,'message')['join'](',\x20')));}var _0x11e80d=_[_0xa641('0x5c')](_0x174ff1[_0xa641('0x6f')],{'uniqueid':_0x38f180[_0xa641('0x5d')]});if(_0x11e80d&&_0x11e80d[_0xa641('0x5e')]){return ami[_0xa641('0x1b')]({'action':'Hangup','channel':_0x11e80d[_0xa641('0x5e')]})[_0xa641('0x1c')](function(_0x5bbe8b){_0x690af0({'code':0xc8,'message':[_0x38f180[_0xa641('0x5d')],_0x5bbe8b[_0xa641('0x1d')]['toLowerCase']()]['join']('\x20')});})[_0xa641('0x1e')](function(_0x257039){_0x35746f(_0x1f0e83[_0xa641('0x1f')](0x1f5,[_0x38f180['uniqueid'],_0x257039[_0xa641('0x1d')][_0xa641('0x64')]()][_0xa641('0x15')]('\x20')));});}else{return _0x35746f(_0x1f0e83[_0xa641('0x1f')](0x1f5,_0xa641('0x68')));}});},'VoiceQueuesChannelRedirect':function(_0x5091ba){var _0x404dd8=this;return new Promise(function(_0x25299a,_0x3c7d3c){if(ami[_0xa641('0x11')]()==![]){return _0x3c7d3c(_0x404dd8['error'](0x1f4,[config[_0xa641('0x12')]['ip'],config[_0xa641('0x12')][_0xa641('0x13')],_0xa641('0x14')][_0xa641('0x15')]('\x20')));}var _0x32575c=schema(properties[_0xa641('0x71')])[_0xa641('0x2')](_0x5091ba);if(_0x32575c[_0xa641('0x57')]>0x0){return _0x3c7d3c(_0x404dd8[_0xa641('0x1f')](0x1f4,_[_0xa641('0x5b')](_0x32575c,'message')[_0xa641('0x15')](',\x20')));}var _0x4ef31b=_['find'](_0x174ff1[_0xa641('0x6f')],{'uniqueid':_0x5091ba['uniqueid']});if(_0x4ef31b&&_0x4ef31b[_0xa641('0x5e')]){return ami[_0xa641('0x1b')]({'action':'Redirect','channel':_0x4ef31b[_0xa641('0x5e')],'exten':_0x5091ba[_0xa641('0x72')],'context':_0x5091ba[_0xa641('0x73')]||_0x4ef31b['context'],'priority':0x1})[_0xa641('0x1c')](function(_0x2d3496){_0x25299a({'code':0xc8,'message':[_0x5091ba[_0xa641('0x5d')],_0x2d3496[_0xa641('0x1d')][_0xa641('0x64')]()][_0xa641('0x15')]('\x20')});})[_0xa641('0x1e')](function(_0x1b09ee){_0x3c7d3c(_0x404dd8[_0xa641('0x1f')](0x1f5,[_0x5091ba[_0xa641('0x5d')],_0x1b09ee[_0xa641('0x1d')]['toLowerCase']()][_0xa641('0x15')]('\x20')));});}else{return _0x3c7d3c(_0x404dd8[_0xa641('0x1f')](0x1f5,_0xa641('0x68')));}});},'Agents':function(_0x6d7322){return new Promise(function(_0x4992d9,_0x25a7d5){var _0xe4bd0b=_[_0xa641('0x58')](_0x174ff1[_0xa641('0x74')]);_0x4992d9({'count':_0xe4bd0b[_0xa641('0x57')],'rows':_0xe4bd0b});});},'Telephones':function(_0x5911d8){return new Promise(function(_0x49f372,_0x5f1f55){var _0x3e68f5=_[_0xa641('0x58')](_0x174ff1[_0xa641('0x75')]);_0x49f372({'count':_0x3e68f5[_0xa641('0x57')],'rows':_0x3e68f5});});},'Trunks':function(_0x3e58b4){return new Promise(function(_0xd58ec5,_0x3c3fcb){var _0x291154=_[_0xa641('0x58')](_0x174ff1['trunks']);_0xd58ec5({'count':_0x291154[_0xa641('0x57')],'rows':_0x291154});});},'OutboundChannels':function(_0x5320a4){return new Promise(function(_0x217d50,_0x5f4636){var _0x4c0031=_[_0xa641('0x58')](_0x174ff1['outboundChannels']);_0x217d50({'count':_0x4c0031[_0xa641('0x57')],'rows':_0x4c0031});});},'Outbound':function(_0x442dad){return new Promise(function(_0x224637,_0x11cd52){_0x224637(_0x174ff1[_0xa641('0x30')]);});},'Campaigns':function(_0x1d5457){return new Promise(function(_0x4458b7,_0x3481ab){var _0x2b6c11=_[_0xa641('0x58')](_0x174ff1[_0xa641('0x76')]);_0x4458b7({'count':_0x2b6c11[_0xa641('0x57')],'rows':_0x2b6c11});});},'VoiceQueuesPreview':function(_0x3ff43d){var _0x317331=this;return new Promise(function(_0xcad486,_0x6720e7){_0x1e02cb['run'](_0x3ff43d['id'])['then'](function(_0x5c0187){_0xcad486({'code':0xc8,'message':_0x5c0187['message']});})[_0xa641('0x1e')](function(_0x1a548f){_0x6720e7(_0x317331['error'](0x1f4,_0x1a548f[_0xa641('0x1d')]));});});},'EventManager':function(_0x2de7f6){var _0x4b0c16=this;return new Promise(function(_0x3b0687,_0x29ac7c){if(!_0x2de7f6['event']){return _0x29ac7c(_0x4b0c16[_0xa641('0x1f')](0x1f4,_0xa641('0x77')));}ami['emit'](_0xa641('0x78')+_0x2de7f6['event'],_0x2de7f6[_0xa641('0x1d')]);_0x3b0687({'code':0xc8,'message':_0x2de7f6});});},'FaxAccounts':function(_0xd64c8a){return new Promise(function(_0x1b60d1,_0x59dcdd){var _0x527f67=_[_0xa641('0x58')](_0x174ff1[_0xa641('0x79')]);_0x1b60d1({'count':_0x527f67[_0xa641('0x57')],'rows':_0x527f67});});},'SendFax':function(_0x295aff){var _0x12bb10=this;return new Promise(function(_0x2eb7ff,_0x5efc8c){_0x43f046[_0xa641('0x7a')](_0x295aff)[_0xa641('0x1c')](function(_0x3e8992){_0x2eb7ff({'code':0xc8,'message':_0x3e8992['message']});})[_0xa641('0x1e')](function(_0x3705c2){_0x5efc8c(_0x12bb10[_0xa641('0x1f')](0x1f4,_0x3705c2[_0xa641('0x1d')]));});});},'CheckAfterSend':function(_0x55f15f){var _0x1aa13b=this;return new Promise(function(_0x466b51,_0x5c77b6){_0x43f046[_0xa641('0x7b')](_0x55f15f)[_0xa641('0x1c')](function(_0x23b1ca){_0x466b51({'code':0xc8,'message':_0x23b1ca[_0xa641('0x1d')]});})[_0xa641('0x1e')](function(_0x3ed29c){_0x5c77b6(_0x1aa13b[_0xa641('0x1f')](0x1f4,_0x3ed29c[_0xa641('0x1d')]));});});}};var _0x598471=jayson[_0xa641('0x7c')](_0x17ea56)[_0xa641('0x7d')]();_0x598471['on'](_0xa641('0x1f'),function(_0x3ec3f9){return _0x2b1d41(_0x3ec3f9);});_0x598471[_0xa641('0x7e')](0x232a,_0xa641('0x7f'),function(){console[_0xa641('0x80')]('AMI\x20RPC\x20server\x20listening\x20on\x20127.0.0.1:%d!',0x232a);return _0x55847f(_0xa641('0x81')+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 de04c2b..7b21f2a 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 _0x7cdc=['uniqueid','firstName','destcalleridname','phone','destcalleridnum','resolve','then','showContact','omit','xmd-contactid2','user:%s','name','format','trigger:%s','action','merge','toLowerCase','catch','error','stringify','util','lodash','../../../../config/environment','../../../../config/logger','trigger','redis','defaults','localhost','socket.io-emitter','info','emit','autoCreate','data2','data1','calleridnum','routeId','calleridname',''];(function(_0xb5eda1,_0x3dc402){var _0x18a364=function(_0x435c87){while(--_0x435c87){_0xb5eda1['push'](_0xb5eda1['shift']());}};_0x18a364(++_0x3dc402);}(_0x7cdc,0x190));var _0xc7cd=function(_0x5183f1,_0x1c9716){_0x5183f1=_0x5183f1-0x0;var _0x2bbe5a=_0x7cdc[_0x5183f1];return _0x2bbe5a;};'use strict';var BPromise=require('bluebird');var util=require(_0xc7cd('0x0'));var _=require(_0xc7cd('0x1'));var Redis=require('ioredis');var config=require(_0xc7cd('0x2'));var logger=require(_0xc7cd('0x3'))(_0xc7cd('0x4'));var cmContactRpc=require('../../rpc/cmContact');config[_0xc7cd('0x5')]=_[_0xc7cd('0x6')](config['redis'],{'host':_0xc7cd('0x7'),'port':0x18eb});var io=require(_0xc7cd('0x8'))(new Redis(config[_0xc7cd('0x5')]));function emit(_0x2c168c,_0x13ffeb,_0x30089e){logger[_0xc7cd('0x9')](_0x2c168c,_0x13ffeb,JSON['stringify'](_0x30089e));io['to'](_0x2c168c)[_0xc7cd('0xa')](_0x13ffeb,_0x30089e);}exports['exec']=function(_0x36d8b9,_0x439f02,_0x22f6a0){_0x22f6a0[_0xc7cd('0xb')]=0x0;if(_0x439f02['data2']&&parseInt(_0x439f02[_0xc7cd('0xc')],0xa)){var _0x4346ee={'ListId':parseInt(_0x439f02[_0xc7cd('0xd')],0xa),'phone':_0x22f6a0[_0xc7cd('0xe')]};if(_['isNil'](_0x22f6a0[_0xc7cd('0xf')])){_0x4346ee['firstName']=_0x22f6a0[_0xc7cd('0x10')]&&_0x22f6a0[_0xc7cd('0x10')]!==_0xc7cd('0x11')?_0x22f6a0[_0xc7cd('0x10')]:_0x22f6a0['calleridnum']||_0x22f6a0[_0xc7cd('0x12')];}else{_0x4346ee[_0xc7cd('0x13')]=_0x22f6a0['destcalleridname']&&_0x22f6a0[_0xc7cd('0x14')]!==''?_0x22f6a0[_0xc7cd('0x14')]:_0x22f6a0['destcalleridnum']||_0x22f6a0[_0xc7cd('0x12')];_0x4346ee[_0xc7cd('0x15')]=_0x22f6a0[_0xc7cd('0x14')]&&_0x22f6a0[_0xc7cd('0x14')]!==''?_0x22f6a0[_0xc7cd('0x14')]:_0x22f6a0[_0xc7cd('0x16')]||_0x22f6a0[_0xc7cd('0x12')];}BPromise[_0xc7cd('0x17')]()[_0xc7cd('0x18')](cmContactRpc[_0xc7cd('0x19')]({'where':_[_0xc7cd('0x1a')](_0x4346ee,[_0xc7cd('0x13')])}))[_0xc7cd('0x18')](function(_0x5303e4){if(_0x5303e4){_0x22f6a0[_0xc7cd('0x1b')]=_0x5303e4['id'];emit(util['format'](_0xc7cd('0x1c'),_0x36d8b9[_0xc7cd('0x1d')]),util[_0xc7cd('0x1e')](_0xc7cd('0x1f'),_0x439f02[_0xc7cd('0x20')]['toLowerCase']()),_[_0xc7cd('0x21')](_0x22f6a0,{'ListId':parseInt(_0x439f02[_0xc7cd('0xd')],0xa)}));return;}else{return BPromise[_0xc7cd('0x17')]()[_0xc7cd('0x18')](cmContactRpc['createContact'](_0x4346ee));}})[_0xc7cd('0x18')](function(_0x3bbe69){if(_0x3bbe69){_0x22f6a0[_0xc7cd('0x1b')]=_0x3bbe69['id'];emit(util[_0xc7cd('0x1e')]('user:%s',_0x36d8b9['name']),util['format'](_0xc7cd('0x1f'),_0x439f02['action'][_0xc7cd('0x22')]()),_[_0xc7cd('0x21')](_0x22f6a0,{'ListId':parseInt(_0x439f02[_0xc7cd('0xd')],0xa)}));}})[_0xc7cd('0x23')](function(_0x4450a5){logger[_0xc7cd('0x24')]('Error\x20creating\x20contact',JSON[_0xc7cd('0x25')](_0x4450a5));});}else{if(_0x36d8b9){emit(util[_0xc7cd('0x1e')](_0xc7cd('0x1c'),_0x36d8b9[_0xc7cd('0x1d')]),util['format'](_0xc7cd('0x1f'),_0x439f02[_0xc7cd('0x20')][_0xc7cd('0x22')]()),_[_0xc7cd('0x21')]({'ListId':parseInt(_0x439f02['data1'],0xa)},_0x22f6a0));}}};
\ No newline at end of file
+var _0xa6ce=['lodash','ioredis','../../../../config/logger','trigger','defaults','redis','localhost','socket.io-emitter','info','stringify','emit','exec','autoCreate','data2','data1','calleridnum','routeId','firstName','calleridname','','uniqueid','destcalleridname','destcalleridnum','resolve','then','showContact','omit','xmd-contactid2','format','user:%s','action','merge','createContact','trigger:%s','toLowerCase','catch','Error\x20creating\x20contact','name','bluebird'];(function(_0x2595ed,_0x4047f2){var _0x5ed73b=function(_0x109380){while(--_0x109380){_0x2595ed['push'](_0x2595ed['shift']());}};_0x5ed73b(++_0x4047f2);}(_0xa6ce,0x15e));var _0xea6c=function(_0x45d1fd,_0x463212){_0x45d1fd=_0x45d1fd-0x0;var _0xd0e542=_0xa6ce[_0x45d1fd];return _0xd0e542;};'use strict';var BPromise=require(_0xea6c('0x0'));var util=require('util');var _=require(_0xea6c('0x1'));var Redis=require(_0xea6c('0x2'));var config=require('../../../../config/environment');var logger=require(_0xea6c('0x3'))(_0xea6c('0x4'));var cmContactRpc=require('../../rpc/cmContact');config['redis']=_[_0xea6c('0x5')](config[_0xea6c('0x6')],{'host':_0xea6c('0x7'),'port':0x18eb});var io=require(_0xea6c('0x8'))(new Redis(config[_0xea6c('0x6')]));function emit(_0x8a751f,_0x5c3ba1,_0x2af078){logger[_0xea6c('0x9')](_0x8a751f,_0x5c3ba1,JSON[_0xea6c('0xa')](_0x2af078));io['to'](_0x8a751f)[_0xea6c('0xb')](_0x5c3ba1,_0x2af078);}exports[_0xea6c('0xc')]=function(_0x227f1c,_0x3bf4d2,_0x44a1ba){_0x44a1ba[_0xea6c('0xd')]=0x0;if(_0x3bf4d2[_0xea6c('0xe')]&&parseInt(_0x3bf4d2[_0xea6c('0xe')],0xa)){var _0xb1e8b5={'ListId':parseInt(_0x3bf4d2[_0xea6c('0xf')],0xa),'phone':_0x44a1ba[_0xea6c('0x10')]};if(_['isNil'](_0x44a1ba[_0xea6c('0x11')])){_0xb1e8b5[_0xea6c('0x12')]=_0x44a1ba[_0xea6c('0x13')]&&_0x44a1ba['calleridname']!==_0xea6c('0x14')?_0x44a1ba[_0xea6c('0x13')]:_0x44a1ba['calleridnum']||_0x44a1ba[_0xea6c('0x15')];}else{_0xb1e8b5[_0xea6c('0x12')]=_0x44a1ba[_0xea6c('0x16')]&&_0x44a1ba[_0xea6c('0x16')]!==_0xea6c('0x14')?_0x44a1ba[_0xea6c('0x16')]:_0x44a1ba['destcalleridnum']||_0x44a1ba[_0xea6c('0x15')];_0xb1e8b5['phone']=_0x44a1ba[_0xea6c('0x16')]&&_0x44a1ba[_0xea6c('0x16')]!==_0xea6c('0x14')?_0x44a1ba[_0xea6c('0x16')]:_0x44a1ba[_0xea6c('0x17')]||_0x44a1ba['uniqueid'];}BPromise[_0xea6c('0x18')]()[_0xea6c('0x19')](cmContactRpc[_0xea6c('0x1a')]({'where':_[_0xea6c('0x1b')](_0xb1e8b5,[_0xea6c('0x12')])}))[_0xea6c('0x19')](function(_0x43a03a){if(_0x43a03a){_0x44a1ba[_0xea6c('0x1c')]=_0x43a03a['id'];emit(util[_0xea6c('0x1d')](_0xea6c('0x1e'),_0x227f1c['name']),util[_0xea6c('0x1d')]('trigger:%s',_0x3bf4d2[_0xea6c('0x1f')]['toLowerCase']()),_[_0xea6c('0x20')](_0x44a1ba,{'ListId':parseInt(_0x3bf4d2[_0xea6c('0xf')],0xa)}));return;}else{return BPromise[_0xea6c('0x18')]()['then'](cmContactRpc[_0xea6c('0x21')](_0xb1e8b5));}})[_0xea6c('0x19')](function(_0x499ea6){if(_0x499ea6){_0x44a1ba['xmd-contactid2']=_0x499ea6['id'];emit(util[_0xea6c('0x1d')]('user:%s',_0x227f1c['name']),util[_0xea6c('0x1d')](_0xea6c('0x22'),_0x3bf4d2[_0xea6c('0x1f')][_0xea6c('0x23')]()),_[_0xea6c('0x20')](_0x44a1ba,{'ListId':parseInt(_0x3bf4d2['data1'],0xa)}));}})[_0xea6c('0x24')](function(_0x565358){logger['error'](_0xea6c('0x25'),JSON['stringify'](_0x565358));});}else{if(_0x227f1c){emit(util[_0xea6c('0x1d')](_0xea6c('0x1e'),_0x227f1c[_0xea6c('0x26')]),util[_0xea6c('0x1d')](_0xea6c('0x22'),_0x3bf4d2[_0xea6c('0x1f')][_0xea6c('0x23')]()),_[_0xea6c('0x20')]({'ListId':parseInt(_0x3bf4d2[_0xea6c('0xf')],0xa)},_0x44a1ba));}}};
\ No newline at end of file
diff --git a/server/services/ami/trigger/index.js b/server/services/ami/trigger/index.js
index 0b9b0ee..608dba7 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 _0x62c9=['AccountId','interaction','message','event','queue','agent','membername','lastevent','exports','util','lodash','url','mustache','ioredis','./integration','./cmContact','../rpc/cmContact','../../../config/environment','../../../config/logger','trigger','redis','defaults','localhost','socket.io-emitter','popup','winapp','triggers','agents','voiceQueues','templates','voiceExtensions','zendeskAccounts','freshdeskAccounts','salesforceAccounts','sugarcrmAccounts','zohoAccounts','deskAccounts','vtigerAccounts','servicenowAccounts','dynamics365Accounts','freshsalesAccounts','accounts','custom:agentcalled','syncCustomEvent','bind','custom:agentringnoanswer','custom:agentcomplete','custom:dialbegin','syncAgentDial','custom:dialconnect','custom:dialend','custom:newinteraction','custom:closedinteraction','custom:outgoingmessage','custom:acceptmessage','custom:rejectmessage','emit','prototype','checkTriggers','hasOwnProperty','status','merge','variables','Actions','interface','action','motionbar','TemplateId','html','render','template\x20not\x20found','data2','isNil','data3','data4','uriLocation','windowWidth','800','data5','windowHeight','data6','winApplication','winArguments','format','user:%s','name','toLowerCase','jscripty','trigger:%s','data1','exec','routeId','urlforward','script','parse','query','search','checkTrigger','length','every','AllConditions','checkConditions','channel','some','AnyConditions','field','chat','operator','value','ChatWebsiteId','upperFirst'];(function(_0x234b78,_0x42a581){var _0xd0c4df=function(_0x29ffde){while(--_0x29ffde){_0x234b78['push'](_0x234b78['shift']());}};_0xd0c4df(++_0x42a581);}(_0x62c9,0x78));var _0x962c=function(_0x20ecc6,_0x3aaa88){_0x20ecc6=_0x20ecc6-0x0;var _0x4f706a=_0x62c9[_0x20ecc6];return _0x4f706a;};'use strict';var util=require(_0x962c('0x0'));var _=require(_0x962c('0x1'));var url=require(_0x962c('0x2'));var Mustache=require(_0x962c('0x3'));var Redis=require(_0x962c('0x4'));var urlforward=require('./urlforward');var integration=require(_0x962c('0x5'));var cmContact=require(_0x962c('0x6'));var script=require('./script');var cmContactRpc=require(_0x962c('0x7'));var config=require(_0x962c('0x8'));var logger=require(_0x962c('0x9'))(_0x962c('0xa'));var ami=require('../ami');config[_0x962c('0xb')]=_[_0x962c('0xc')](config[_0x962c('0xb')],{'host':_0x962c('0xd'),'port':0x18eb});var io=require(_0x962c('0xe'))(new Redis(config[_0x962c('0xb')]));var operators={'equals':function(_0x365a46,_0x14f292){return _0x365a46==_0x14f292;},'not_equals':function(_0x252f76,_0x2b7683){return _0x252f76!=_0x2b7683;}};var barAndWebActions=[_0x962c('0xf'),_0x962c('0x2'),_0x962c('0x10')];function Trigger(_0x214d6f){this[_0x962c('0x11')]=_0x214d6f[_0x962c('0x11')];this[_0x962c('0x12')]=_0x214d6f[_0x962c('0x12')];this[_0x962c('0x13')]=_0x214d6f[_0x962c('0x13')];this['templates']=_0x214d6f[_0x962c('0x14')];this[_0x962c('0x15')]=_0x214d6f[_0x962c('0x15')];this[_0x962c('0x16')]=_0x214d6f['zendeskAccounts'];this['freshdeskAccounts']=_0x214d6f[_0x962c('0x17')];this[_0x962c('0x18')]=_0x214d6f[_0x962c('0x18')];this[_0x962c('0x19')]=_0x214d6f[_0x962c('0x19')];this[_0x962c('0x1a')]=_0x214d6f[_0x962c('0x1a')];this[_0x962c('0x1b')]=_0x214d6f[_0x962c('0x1b')];this[_0x962c('0x1c')]=_0x214d6f['vtigerAccounts'];this[_0x962c('0x1d')]=_0x214d6f[_0x962c('0x1d')];this[_0x962c('0x1e')]=_0x214d6f[_0x962c('0x1e')];this[_0x962c('0x1f')]=_0x214d6f['freshsalesAccounts'];this[_0x962c('0x20')]={'zendesk':this[_0x962c('0x16')],'salesforce':this[_0x962c('0x18')],'freshdesk':this['freshdeskAccounts'],'sugarcrm':this['sugarcrmAccounts'],'zoho':this['zohoAccounts'],'desk':this[_0x962c('0x1b')],'vtiger':this['vtigerAccounts'],'dynamics365':this['dynamics365Accounts'],'freshsales':this[_0x962c('0x1f')],'servicenow':this[_0x962c('0x1d')]};ami['on'](_0x962c('0x21'),this[_0x962c('0x22')]['bind'](this));ami['on']('custom:agentconnect',this['syncCustomEvent'][_0x962c('0x23')](this));ami['on'](_0x962c('0x24'),this[_0x962c('0x22')][_0x962c('0x23')](this));ami['on'](_0x962c('0x25'),this[_0x962c('0x22')][_0x962c('0x23')](this));ami['on']('custom:queuecallerabandon',this[_0x962c('0x22')]['bind'](this));ami['on'](_0x962c('0x26'),this[_0x962c('0x27')]['bind'](this));ami['on'](_0x962c('0x28'),this[_0x962c('0x27')][_0x962c('0x23')](this));ami['on'](_0x962c('0x29'),this[_0x962c('0x27')]['bind'](this));ami['on'](_0x962c('0x2a'),this[_0x962c('0x22')]['bind'](this));ami['on'](_0x962c('0x2b'),this['syncCustomEvent'][_0x962c('0x23')](this));ami['on']('custom:incomingmessage',this['syncCustomEvent'][_0x962c('0x23')](this));ami['on'](_0x962c('0x2c'),this[_0x962c('0x22')][_0x962c('0x23')](this));ami['on'](_0x962c('0x2d'),this['syncCustomEvent'][_0x962c('0x23')](this));ami['on'](_0x962c('0x2e'),this[_0x962c('0x22')]['bind'](this));}Trigger['prototype'][_0x962c('0x2f')]=function(_0x1efd72,_0x15b55f,_0x5add4b){logger['info'](_0x1efd72,_0x15b55f,JSON['stringify'](_0x5add4b));io['to'](_0x1efd72)[_0x962c('0x2f')](_0x15b55f,_0x5add4b);};Trigger[_0x962c('0x30')][_0x962c('0x22')]=function(_0x448a7f){var _0x265f05=_['clone'](_0x448a7f);this[_0x962c('0x31')](_0x265f05);};Trigger['prototype']['syncAgentDial']=function(_0x5d84ce){if(this[_0x962c('0x12')][_0x5d84ce['interface']]){this[_0x962c('0x22')](_0x5d84ce);}};Trigger['prototype']['checkTriggers']=function(_0x4bca82){var _0xaa3ae2;for(var _0x7f3655 in this[_0x962c('0x11')]){if(this['triggers'][_0x962c('0x32')](_0x7f3655)){if(this[_0x962c('0x11')][_0x7f3655][_0x962c('0x33')]){_0xaa3ae2=this['checkTrigger'](this['triggers'][_0x7f3655],_0x4bca82);if(_0xaa3ae2){_[_0x962c('0x34')](_0x4bca82,_0x4bca82[_0x962c('0x35')]);for(var _0x122390=0x0,_0x236957,_0x966378,_0x27e4d4;_0x1223900x0){_0x49dd24=_[_0x6791('0x28')](_0x5cbb79,_0x424b0e);}return _0x49dd24;}function getCustomFields(_0x551718,_0x2f56a2){var _0x34b006=[];var _0x483d6c={'custom_fields':{}};if(_0x551718[_0x6791('0x29')]>0x0){_[_0x6791('0x2a')](_0x551718,function(_0x234c5e){if(_0x234c5e[_0x6791('0x2b')]==='string'&&_0x234c5e['nameField']&&!_0x234c5e[_0x6791('0x2c')]){_0x483d6c[_0x234c5e['nameField'][_0x6791('0x2d')]()]=_0x234c5e[_0x6791('0x2e')][_0x6791('0x22')]();}else if(_0x234c5e[_0x6791('0x2b')]===_0x6791('0x2f')&&_0x234c5e[_0x6791('0x30')]&&_0x234c5e[_0x6791('0x2c')]){_0x483d6c[_0x6791('0x31')][_0x234c5e[_0x6791('0x30')]]=_0x234c5e[_0x6791('0x2e')]['toString']();}else if(_0x234c5e[_0x6791('0x2b')]===_0x6791('0x32')&&_0x234c5e[_0x6791('0x33')]&&_0x234c5e[_0x6791('0x30')]&&_0x234c5e[_0x6791('0x2c')]){_0x2f56a2[_0x234c5e[_0x6791('0x33')]]&&(_0x483d6c['custom_fields'][_0x234c5e['idField']]=_0x2f56a2[_0x234c5e['variableName']][_0x6791('0x22')]());}else if(_0x234c5e[_0x6791('0x2b')]===_0x6791('0x34')&&_0x234c5e['Variable']&&_0x234c5e['Variable'][_0x6791('0x35')]&&_0x234c5e[_0x6791('0x30')]&&_0x234c5e[_0x6791('0x2c')]){_0x2f56a2[_0x234c5e[_0x6791('0x36')]['name'][_0x6791('0x2d')]()]&&(_0x483d6c[_0x6791('0x31')][_0x234c5e[_0x6791('0x30')]]=_0x2f56a2[_0x234c5e['Variable'][_0x6791('0x35')]['toLowerCase']()]['toString']());}});}if(_0x483d6c[_0x6791('0x37')]){_0x483d6c[_0x6791('0x37')]=Number(_0x483d6c['priority']);}return _0x483d6c;}function getTicket(_0x764f15,_0x70b2b7,_0x407882,_0x333ad5,_0x3e5676){logger['info'](_0x6791('0x38'));var _0xc95516=_[_0x6791('0x39')]({'subject':intUtil['getString'](_0x333ad5[_0x6791('0x3a')],_0x3e5676,'\x20'),'type':_0x6791('0x3b'),'status':_0x6791('0x3c'),'labels':['xCALLY',_0x6791('0x3d'),_0x6791('0x3e')][_0x6791('0x3f')](getTags(_0x333ad5[_0x6791('0x40')],'name')),'description':intUtil[_0x6791('0x41')](_0x333ad5[_0x6791('0x42')],_0x3e5676,'\x0a'),'_links':{'assigned_user':{'href':util[_0x6791('0x1c')](_0x6791('0x43'),_0x70b2b7['id']),'class':_0x6791('0x44')}},'message':{'direction':'in','body':intUtil[_0x6791('0x41')](_0x333ad5[_0x6791('0x42')],_0x3e5676,'\x0a')}},getCustomFields(_0x333ad5[_0x6791('0x45')],_0x3e5676));return request({'uri':util[_0x6791('0x1c')]('%s/customers/%d/cases',_0x764f15['remoteUri'],_0x407882['id']),'method':_0x6791('0x46'),'body':_0xc95516});}exports[_0x6791('0x47')]=function(_0x5900b6,_0x39dcb7,_0x1c9913,_0x1c6803,_0x3edb86,_0x1a922e){var _0xec6e,_0x44e0ba;_0x1a922e['remoteUri']=intUtil[_0x6791('0x48')](_0x1a922e['remoteUri']);_0x1a922e[_0x6791('0x49')]=intUtil[_0x6791('0x48')](_0x1a922e[_0x6791('0x49')]);if(_0x3edb86&&_0x3edb86[_0x6791('0x4a')]){logger['info'](_0x6791('0x4b'),_0x6791('0x4c'));_0x39dcb7[_0x6791('0x4d')]=util[_0x6791('0x1c')](_0x6791('0x4e'),_0x1a922e[_0x6791('0x49')],_0x39dcb7[_0x6791('0x4f')],md5(_0x39dcb7[_0x6791('0x4f')]));}else{_0x39dcb7['recordingURL']='';}headers[_0x6791('0x50')]=getAuth(_0x1a922e);return getUser(_0x1a922e,_0x1c6803[_0x6791('0x51')])[_0x6791('0x10')](function(_0x328a13){_0xec6e=_0x328a13;logger['info'](_0x6791('0x52'),_0xec6e['id']);return getEndUser(_0x1a922e,_0x39dcb7[_0x6791('0x53')],_0x39dcb7['calleridnum']);})[_0x6791('0x10')](function(_0x54ef7b){_0x44e0ba=_0x54ef7b;logger[_0x6791('0xc')](_0x6791('0x54'),_0x44e0ba['id']);return getTicket(_0x1a922e,_0xec6e,_0x44e0ba,_0x1c9913,_0x39dcb7);})[_0x6791('0x10')](function(_0x3ddccc){if(_0x3ddccc){logger[_0x6791('0xc')](_0x6791('0x55'));logger[_0x6791('0xc')](_0x6791('0x56'),_0x3ddccc['id']);switch(_0x1a922e[_0x6791('0x2b')]){case'integrationTab':logger[_0x6791('0xc')]('[QUEUE]',_0x6791('0x57'));emit(util[_0x6791('0x1c')](_0x6791('0x58'),_0x1c6803[_0x6791('0x35')]),_0x6791('0x59'),{'recordId':_0x3ddccc['id']});break;case'newTab':logger[_0x6791('0xc')](_0x6791('0x4b'),_0x6791('0x5a'));emit(util[_0x6791('0x1c')](_0x6791('0x58'),_0x1c6803['name']),_0x6791('0x5b'),{'uri':util[_0x6791('0x1c')]('https://xcally.desk.com/web/agent/case/%d',_0x3ddccc['id'])});break;default:logger[_0x6791('0x5c')]('[QUEUE]',_0x6791('0x5d'));}}})[_0x6791('0x5e')](function(_0x12f926){console[_0x6791('0x5c')](_0x12f926);logger['error'](_0x6791('0x4b'),JSON[_0x6791('0x19')](_0x12f926));});};exports['outbound']=function(_0x189b22,_0x4370ab,_0x3a895b,_0x5df56e,_0x355e97,_0x166b9a,_0x54272c){var _0x302263,_0x2cec8d;_0x166b9a['remoteUri']=intUtil[_0x6791('0x48')](_0x166b9a[_0x6791('0xf')]);_0x166b9a[_0x6791('0x49')]=intUtil[_0x6791('0x48')](_0x166b9a['serverUrl']);if(_0x54272c&&_0x54272c[_0x6791('0x5f')]&&_0x54272c[_0x6791('0x5f')]!==_0x6791('0x60')){logger['info']('[OUTBOUND]',_0x6791('0x4c'));_0x4370ab[_0x6791('0x4d')]=util[_0x6791('0x1c')](_0x6791('0x4e'),_0x166b9a[_0x6791('0x49')],_0x4370ab['uniqueid'],md5(_0x4370ab['uniqueid']));}headers[_0x6791('0x50')]=getAuth(_0x166b9a);return getUser(_0x166b9a,_0x5df56e['email'])['then'](function(_0x8fc04b){_0x302263=_0x8fc04b;logger[_0x6791('0xc')](_0x6791('0x52'),_0x302263['id']);return getEndUser(_0x166b9a,_0x4370ab[_0x6791('0x61')],_0x4370ab[_0x6791('0x62')]);})[_0x6791('0x10')](function(_0x4c759e){_0x2cec8d=_0x4c759e;logger['info'](_0x6791('0x54'),_0x2cec8d['id']);return getTicket(_0x166b9a,_0x302263,_0x2cec8d,_0x3a895b,_0x4370ab);})[_0x6791('0x10')](function(_0x56e424){if(_0x56e424){logger[_0x6791('0xc')]('Ticket\x20created!');logger[_0x6791('0xc')](_0x6791('0x56'),_0x56e424['id']);switch(_0x166b9a['type']){case _0x6791('0x63'):logger[_0x6791('0xc')](_0x6791('0x4b'),'Displaying\x20ticket\x20to\x20agent...');emit(util[_0x6791('0x1c')](_0x6791('0x58'),_0x5df56e[_0x6791('0x35')]),_0x6791('0x59'),{'recordId':_0x56e424['id']});break;case _0x6791('0x64'):logger['info']('[QUEUE]',_0x6791('0x5a'));emit(util[_0x6791('0x1c')]('user:%s',_0x5df56e[_0x6791('0x35')]),_0x6791('0x5b'),{'uri':util[_0x6791('0x1c')](_0x6791('0x65'),_0x166b9a[_0x6791('0xf')],_0x56e424['id'])});break;default:logger[_0x6791('0x5c')](_0x6791('0x66'),_0x6791('0x5d'));}}})['catch'](function(_0x2c5f12){logger[_0x6791('0x5c')](_0x6791('0x66'),JSON[_0x6791('0x19')](_0x2c5f12));});};exports['abandoned']=function(_0x16dff7,_0x10c7f3,_0xa8a8dd,_0x5ca809,_0x205320,_0x1fcbb6){var _0x99d4ee,_0x11df6b;_0x1fcbb6['remoteUri']=intUtil[_0x6791('0x48')](_0x1fcbb6[_0x6791('0xf')]);_0x1fcbb6['serverUrl']=intUtil[_0x6791('0x48')](_0x1fcbb6[_0x6791('0x49')]);if(_0x205320&&_0x205320[_0x6791('0x4a')]){logger[_0x6791('0xc')](_0x6791('0x67'),_0x6791('0x4c'));_0x10c7f3['recordingURL']=util[_0x6791('0x1c')](_0x6791('0x4e'),_0x1fcbb6[_0x6791('0x49')],_0x10c7f3['uniqueid'],md5(_0x10c7f3[_0x6791('0x4f')]));}else{_0x10c7f3['recordingURL']='';}headers[_0x6791('0x50')]=getAuth(_0x1fcbb6);return getUser(_0x1fcbb6)[_0x6791('0x10')](function(_0xf0941a){_0x99d4ee=_0xf0941a;logger[_0x6791('0xc')](_0x6791('0x52'),_0x99d4ee['id']);return getEndUser(_0x1fcbb6,_0x10c7f3['calleridname'],_0x10c7f3[_0x6791('0x68')]);})[_0x6791('0x10')](function(_0x375062){_0x11df6b=_0x375062;logger[_0x6791('0xc')]('The\x20Enduser\x20ID\x20is:',_0x11df6b['id']);return getTicket(_0x1fcbb6,_0x99d4ee,_0x11df6b,_0xa8a8dd,_0x10c7f3);})[_0x6791('0x10')](function(_0x175808){if(_0x175808){logger['info'](_0x6791('0x55'));logger[_0x6791('0xc')]('The\x20Ticket\x20ID\x20is:',_0x175808['id']);}})[_0x6791('0x5e')](function(_0x23b9b4){logger[_0x6791('0x5c')](_0x6791('0x67'),JSON['stringify'](_0x23b9b4));});};
\ No newline at end of file
+var _0x97c1=['%s/agent/tickets/%s','[OUTBOUND]','catch','abandoned','[ABANDONED]','lodash','request-promise','util','../../../../config/environment','../../../../config/logger','desk','redis','defaults','socket.io-emitter','application/json','validateEmail','info','format','%s/users','remoteUri','then','find','_embedded','entries','Agent\x20found!','Agent\x20not\x20found,\x20using\x20the\x20admin\x20account!','%s/users/me','Invalid\x20email\x20format,\x20using\x20the\x20admin\x20account!','debug','[HTTP]','stringify','GET','authType','basic','%s:%s','password','token','%s/token:%s','username','Basic\x20%s','toString','base64','Searching\x20enduser\x20with\x20phone','%s/customers/search','total_entries','Enduser\x20found!','%s/customers','POST','work','length','map','string','nameField','content','type','idField','customField','custom_fields','variable','variableName','customVariable','name','Variable','toLowerCase','priority','Creating\x20new\x20ticket...','merge','getString','Subjects','phone','new','xCALLY','Motion','CTI','Tags','/api/v2/users/%d','user','Descriptions','%s/customers/%d/cases','queue','stripTrailingSlash','serverUrl','monitor_format','[QUEUE]','Recording\x20is\x20enabled!','uniqueid','Authorization','email','calleridname','calleridnum','The\x20Enduser\x20ID\x20is:','Ticket\x20created!','integrationTab','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','Desk\x20account\x20type\x20not\x20recognized','recordingFormat','none','recordingURL','%s/api/voice/recordings/%s/downloads?type=uniqueid&token=%s','The\x20User\x20ID\x20is:','destcalleridname','destcalleridnum','The\x20Ticket\x20ID\x20is:'];(function(_0x34e5e8,_0x5788cb){var _0x5adf0f=function(_0x19194e){while(--_0x19194e){_0x34e5e8['push'](_0x34e5e8['shift']());}};_0x5adf0f(++_0x5788cb);}(_0x97c1,0xdf));var _0x197c=function(_0x57b54c,_0x54ce0d){_0x57b54c=_0x57b54c-0x0;var _0x59cc19=_0x97c1[_0x57b54c];return _0x59cc19;};'use strict';var _=require(_0x197c('0x0'));var rp=require(_0x197c('0x1'));var md5=require('md5');var util=require(_0x197c('0x2'));var Redis=require('ioredis');var intUtil=require('./util');var config=require(_0x197c('0x3'));var logger=require(_0x197c('0x4'))(_0x197c('0x5'));config[_0x197c('0x6')]=_[_0x197c('0x7')](config['redis'],{'host':'localhost','port':0x18eb});var io=require(_0x197c('0x8'))(new Redis(config[_0x197c('0x6')]));function emit(_0x60fab2,_0xfcee35,_0x5cf5cb){io['to'](_0x60fab2)['emit'](_0xfcee35,_0x5cf5cb);}var headers={'Content-Type':_0x197c('0x9'),'Accept':'application/json'};function getUser(_0x339fab,_0x3e83e6){if(intUtil[_0x197c('0xa')](_0x3e83e6)===!![]){logger[_0x197c('0xb')]('Getting\x20agent\x20with\x20email',_0x3e83e6);return request({'uri':util[_0x197c('0xc')](_0x197c('0xd'),_0x339fab[_0x197c('0xe')])})[_0x197c('0xf')](function(_0x455f34){if(_0x455f34['total_entries']){return _[_0x197c('0x10')](_0x455f34[_0x197c('0x11')][_0x197c('0x12')],{'email':_0x3e83e6});}})[_0x197c('0xf')](function(_0x567658){if(_0x567658){logger[_0x197c('0xb')](_0x197c('0x13'));return _0x567658;}else{logger[_0x197c('0xb')](_0x197c('0x14'));return request({'uri':util[_0x197c('0xc')](_0x197c('0x15'),_0x339fab['remoteUri'])});}});}else{logger['info'](_0x197c('0x16'));return request({'uri':util[_0x197c('0xc')](_0x197c('0x15'),_0x339fab[_0x197c('0xe')])});}}function request(_0x33f8d3){logger[_0x197c('0x17')](_0x197c('0x18'),JSON[_0x197c('0x19')](_0x33f8d3));return rp(_['defaults'](_0x33f8d3,{'method':_0x197c('0x1a'),'headers':headers,'json':!![]}));}function getAuth(_0x47aaa9){var _0x50ac52;if(_0x47aaa9[_0x197c('0x1b')]===_0x197c('0x1c')){_0x50ac52=util[_0x197c('0xc')](_0x197c('0x1d'),_0x47aaa9['username'],_0x47aaa9[_0x197c('0x1e')]);}else if(_0x47aaa9[_0x197c('0x1b')]===_0x197c('0x1f')){_0x50ac52=util['format'](_0x197c('0x20'),_0x47aaa9[_0x197c('0x21')],_0x47aaa9[_0x197c('0x1f')]);}return util[_0x197c('0xc')](_0x197c('0x22'),new Buffer(_0x50ac52)[_0x197c('0x23')](_0x197c('0x24')));}function getEndUser(_0x2092a0,_0x8963fd,_0x3dfb7b){logger[_0x197c('0xb')](_0x197c('0x25'),_0x3dfb7b);return request({'uri':util[_0x197c('0xc')](_0x197c('0x26'),_0x2092a0[_0x197c('0xe')]),'qs':{'phone':_0x3dfb7b}})[_0x197c('0xf')](function(_0x5f4a02){if(_0x5f4a02[_0x197c('0x27')]){logger[_0x197c('0xb')](_0x197c('0x28'));return _0x5f4a02['_embedded'][_0x197c('0x12')][0x0];}else{logger[_0x197c('0xb')]('Enduser\x20not\x20found,\x20creating\x20a\x20new\x20enduser!');return request({'uri':util['format'](_0x197c('0x29'),_0x2092a0['remoteUri']),'method':_0x197c('0x2a'),'body':{'first_name':_0x8963fd,'title':_0x8963fd,'phone_numbers':[{'type':_0x197c('0x2b'),'value':_0x3dfb7b}]}});}});}function getTags(_0x4e9a06,_0x16e026){var _0x2f031c=[];if(_0x4e9a06&&_0x4e9a06[_0x197c('0x2c')]>0x0){_0x2f031c=_[_0x197c('0x2d')](_0x4e9a06,_0x16e026);}return _0x2f031c;}function getCustomFields(_0x215df1,_0x4422d1){var _0x5df39e=[];var _0x50dea3={'custom_fields':{}};if(_0x215df1['length']>0x0){_['forEach'](_0x215df1,function(_0x5f7425){if(_0x5f7425['type']===_0x197c('0x2e')&&_0x5f7425[_0x197c('0x2f')]&&!_0x5f7425['customField']){_0x50dea3[_0x5f7425[_0x197c('0x2f')]['toLowerCase']()]=_0x5f7425[_0x197c('0x30')][_0x197c('0x23')]();}else if(_0x5f7425[_0x197c('0x31')]===_0x197c('0x2e')&&_0x5f7425[_0x197c('0x32')]&&_0x5f7425[_0x197c('0x33')]){_0x50dea3[_0x197c('0x34')][_0x5f7425[_0x197c('0x32')]]=_0x5f7425[_0x197c('0x30')]['toString']();}else if(_0x5f7425['type']===_0x197c('0x35')&&_0x5f7425[_0x197c('0x36')]&&_0x5f7425[_0x197c('0x32')]&&_0x5f7425[_0x197c('0x33')]){_0x4422d1[_0x5f7425[_0x197c('0x36')]]&&(_0x50dea3[_0x197c('0x34')][_0x5f7425[_0x197c('0x32')]]=_0x4422d1[_0x5f7425['variableName']]['toString']());}else if(_0x5f7425[_0x197c('0x31')]===_0x197c('0x37')&&_0x5f7425['Variable']&&_0x5f7425['Variable'][_0x197c('0x38')]&&_0x5f7425[_0x197c('0x32')]&&_0x5f7425[_0x197c('0x33')]){_0x4422d1[_0x5f7425[_0x197c('0x39')][_0x197c('0x38')][_0x197c('0x3a')]()]&&(_0x50dea3[_0x197c('0x34')][_0x5f7425[_0x197c('0x32')]]=_0x4422d1[_0x5f7425[_0x197c('0x39')]['name'][_0x197c('0x3a')]()][_0x197c('0x23')]());}});}if(_0x50dea3[_0x197c('0x3b')]){_0x50dea3[_0x197c('0x3b')]=Number(_0x50dea3[_0x197c('0x3b')]);}return _0x50dea3;}function getTicket(_0x151e2f,_0x50ec25,_0x2b84a3,_0xfb5f3e,_0x2c6cbc){logger['info'](_0x197c('0x3c'));var _0x34dabc=_[_0x197c('0x3d')]({'subject':intUtil[_0x197c('0x3e')](_0xfb5f3e[_0x197c('0x3f')],_0x2c6cbc,'\x20'),'type':_0x197c('0x40'),'status':_0x197c('0x41'),'labels':[_0x197c('0x42'),_0x197c('0x43'),_0x197c('0x44')]['concat'](getTags(_0xfb5f3e[_0x197c('0x45')],_0x197c('0x38'))),'description':intUtil['getString'](_0xfb5f3e['Descriptions'],_0x2c6cbc,'\x0a'),'_links':{'assigned_user':{'href':util[_0x197c('0xc')](_0x197c('0x46'),_0x50ec25['id']),'class':_0x197c('0x47')}},'message':{'direction':'in','body':intUtil[_0x197c('0x3e')](_0xfb5f3e[_0x197c('0x48')],_0x2c6cbc,'\x0a')}},getCustomFields(_0xfb5f3e['Fields'],_0x2c6cbc));return request({'uri':util[_0x197c('0xc')](_0x197c('0x49'),_0x151e2f[_0x197c('0xe')],_0x2b84a3['id']),'method':_0x197c('0x2a'),'body':_0x34dabc});}exports[_0x197c('0x4a')]=function(_0x4b6901,_0x3e21bd,_0x37bb94,_0x6d7bda,_0x197b27,_0x2f3c4b){var _0x5c3660,_0x3054c2;_0x2f3c4b[_0x197c('0xe')]=intUtil[_0x197c('0x4b')](_0x2f3c4b[_0x197c('0xe')]);_0x2f3c4b[_0x197c('0x4c')]=intUtil[_0x197c('0x4b')](_0x2f3c4b[_0x197c('0x4c')]);if(_0x197b27&&_0x197b27[_0x197c('0x4d')]){logger[_0x197c('0xb')](_0x197c('0x4e'),_0x197c('0x4f'));_0x3e21bd['recordingURL']=util['format']('%s/api/voice/recordings/%s/downloads?type=uniqueid&token=%s',_0x2f3c4b['serverUrl'],_0x3e21bd[_0x197c('0x50')],md5(_0x3e21bd[_0x197c('0x50')]));}else{_0x3e21bd['recordingURL']='';}headers[_0x197c('0x51')]=getAuth(_0x2f3c4b);return getUser(_0x2f3c4b,_0x6d7bda[_0x197c('0x52')])['then'](function(_0x2016f2){_0x5c3660=_0x2016f2;logger[_0x197c('0xb')]('The\x20User\x20ID\x20is:',_0x5c3660['id']);return getEndUser(_0x2f3c4b,_0x3e21bd[_0x197c('0x53')],_0x3e21bd[_0x197c('0x54')]);})['then'](function(_0x3b24e2){_0x3054c2=_0x3b24e2;logger[_0x197c('0xb')](_0x197c('0x55'),_0x3054c2['id']);return getTicket(_0x2f3c4b,_0x5c3660,_0x3054c2,_0x37bb94,_0x3e21bd);})['then'](function(_0x3b36e5){if(_0x3b36e5){logger[_0x197c('0xb')](_0x197c('0x56'));logger[_0x197c('0xb')]('The\x20Ticket\x20ID\x20is:',_0x3b36e5['id']);switch(_0x2f3c4b[_0x197c('0x31')]){case _0x197c('0x57'):logger[_0x197c('0xb')]('[QUEUE]','Displaying\x20ticket\x20to\x20agent...');emit(util[_0x197c('0xc')](_0x197c('0x58'),_0x6d7bda[_0x197c('0x38')]),_0x197c('0x59'),{'recordId':_0x3b36e5['id']});break;case _0x197c('0x5a'):logger[_0x197c('0xb')]('[QUEUE]',_0x197c('0x5b'));emit(util['format'](_0x197c('0x58'),_0x6d7bda[_0x197c('0x38')]),_0x197c('0x5c'),{'uri':util[_0x197c('0xc')](_0x197c('0x5d'),_0x3b36e5['id'])});break;default:logger[_0x197c('0x5e')](_0x197c('0x4e'),_0x197c('0x5f'));}}})['catch'](function(_0xa9cfa1){console[_0x197c('0x5e')](_0xa9cfa1);logger[_0x197c('0x5e')]('[QUEUE]',JSON[_0x197c('0x19')](_0xa9cfa1));});};exports['outbound']=function(_0x204592,_0x1d2a5f,_0x1ec51a,_0x22a106,_0x1d7cdd,_0x304537,_0x360599){var _0x21d21f,_0x544bc5;_0x304537[_0x197c('0xe')]=intUtil[_0x197c('0x4b')](_0x304537[_0x197c('0xe')]);_0x304537['serverUrl']=intUtil[_0x197c('0x4b')](_0x304537[_0x197c('0x4c')]);if(_0x360599&&_0x360599[_0x197c('0x60')]&&_0x360599[_0x197c('0x60')]!==_0x197c('0x61')){logger['info']('[OUTBOUND]',_0x197c('0x4f'));_0x1d2a5f[_0x197c('0x62')]=util[_0x197c('0xc')](_0x197c('0x63'),_0x304537[_0x197c('0x4c')],_0x1d2a5f['uniqueid'],md5(_0x1d2a5f['uniqueid']));}headers[_0x197c('0x51')]=getAuth(_0x304537);return getUser(_0x304537,_0x22a106[_0x197c('0x52')])['then'](function(_0xb3747b){_0x21d21f=_0xb3747b;logger[_0x197c('0xb')](_0x197c('0x64'),_0x21d21f['id']);return getEndUser(_0x304537,_0x1d2a5f[_0x197c('0x65')],_0x1d2a5f[_0x197c('0x66')]);})[_0x197c('0xf')](function(_0x4e8c5b){_0x544bc5=_0x4e8c5b;logger[_0x197c('0xb')](_0x197c('0x55'),_0x544bc5['id']);return getTicket(_0x304537,_0x21d21f,_0x544bc5,_0x1ec51a,_0x1d2a5f);})['then'](function(_0x480cab){if(_0x480cab){logger[_0x197c('0xb')]('Ticket\x20created!');logger[_0x197c('0xb')](_0x197c('0x67'),_0x480cab['id']);switch(_0x304537[_0x197c('0x31')]){case'integrationTab':logger[_0x197c('0xb')](_0x197c('0x4e'),'Displaying\x20ticket\x20to\x20agent...');emit(util[_0x197c('0xc')](_0x197c('0x58'),_0x22a106[_0x197c('0x38')]),'trigger:desk:display',{'recordId':_0x480cab['id']});break;case _0x197c('0x5a'):logger[_0x197c('0xb')]('[QUEUE]','Displaying\x20ticket\x20to\x20agent\x20in\x20a\x20new\x20tab...');emit(util[_0x197c('0xc')](_0x197c('0x58'),_0x22a106[_0x197c('0x38')]),'trigger:browser:url',{'uri':util[_0x197c('0xc')](_0x197c('0x68'),_0x304537[_0x197c('0xe')],_0x480cab['id'])});break;default:logger['error'](_0x197c('0x69'),_0x197c('0x5f'));}}})[_0x197c('0x6a')](function(_0x1f0398){logger[_0x197c('0x5e')](_0x197c('0x69'),JSON[_0x197c('0x19')](_0x1f0398));});};exports[_0x197c('0x6b')]=function(_0x1d0bec,_0x42dd11,_0x5ef485,_0x1f7ad0,_0x572649,_0x491162){var _0x4a8e13,_0x500c8f;_0x491162[_0x197c('0xe')]=intUtil[_0x197c('0x4b')](_0x491162[_0x197c('0xe')]);_0x491162[_0x197c('0x4c')]=intUtil['stripTrailingSlash'](_0x491162[_0x197c('0x4c')]);if(_0x572649&&_0x572649['monitor_format']){logger[_0x197c('0xb')]('[ABANDONED]',_0x197c('0x4f'));_0x42dd11['recordingURL']=util[_0x197c('0xc')](_0x197c('0x63'),_0x491162[_0x197c('0x4c')],_0x42dd11[_0x197c('0x50')],md5(_0x42dd11['uniqueid']));}else{_0x42dd11[_0x197c('0x62')]='';}headers[_0x197c('0x51')]=getAuth(_0x491162);return getUser(_0x491162)[_0x197c('0xf')](function(_0x523a69){_0x4a8e13=_0x523a69;logger[_0x197c('0xb')](_0x197c('0x64'),_0x4a8e13['id']);return getEndUser(_0x491162,_0x42dd11[_0x197c('0x53')],_0x42dd11[_0x197c('0x54')]);})[_0x197c('0xf')](function(_0x3d1d6c){_0x500c8f=_0x3d1d6c;logger[_0x197c('0xb')](_0x197c('0x55'),_0x500c8f['id']);return getTicket(_0x491162,_0x4a8e13,_0x500c8f,_0x5ef485,_0x42dd11);})[_0x197c('0xf')](function(_0x1947bd){if(_0x1947bd){logger[_0x197c('0xb')](_0x197c('0x56'));logger[_0x197c('0xb')](_0x197c('0x67'),_0x1947bd['id']);}})[_0x197c('0x6a')](function(_0x18d530){logger[_0x197c('0x5e')](_0x197c('0x6c'),JSON['stringify'](_0x18d530));});};
\ 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 ac5e751..3674bd7 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 _0x2d9b=['systemuserid',']\x20Agent\x20not\x20found,\x20using\x20the\x20admin\x20account!','internalemailaddress','toLowerCase','destcalleridnum','contacts','/systemusers(','headers','odata-entityid','substring','lastIndexOf','enduserId','contacts?$select=telephone1','calleridnum','contactid',']\x20Enduser\x20created!',']\x20Enduser\x20Created!','forEach','type','string','nameField','idField','indexOf','ticketType','incident','incidents','assign','getString','Descriptions','/contacts(','Fields','4.0','phonecall','phonecalls','queue','callDirection','ticketId','format','%s/main.aspx?pagetype=entityrecord&etn=%s&id=%s','emit','trigger:browser:url','stripTrailingSlash','serverUrl','abandoned','https://login.microsoftonline.com/%s/oauth2/token','tenantId','uniqueid','monitor_format','Recording\x20is\x20enabled!','recordingURL','recordingFormat','none','[OUTBOUND]',']\x20The\x20User\x20ID\x20is:',']\x20The\x20User\x20email\x20is:',']\x20The\x20Enduser\x20ID\x20is:',']\x20The\x20%s\x20ID\x20is:\x20%s',']\x20Call\x20direction:\x20%s','Displaying\x20call\x20in\x20a\x20new\x20tab...','name',']\x20Error\x20running\x20Dynamics365\x20integration','bluebird','util','./util','md5','../../../../config/logger','dynamics365','../../../../config/environment','redis','defaults','localhost','socket.io-emitter','POST','remoteUri','username','password','access_token','catch','toUpperCase',']\x20Wrong\x20credentials!','message','then','GET','systemusers?$select=internalemailaddress,isdisabled,systemuserid','Bearer\x20','value','isNil','validateEmail','userEmail','email','length','info','userId'];(function(_0x4ae6ef,_0xc2af80){var _0x3cbb4e=function(_0x569ad5){while(--_0x569ad5){_0x4ae6ef['push'](_0x4ae6ef['shift']());}};_0x3cbb4e(++_0xc2af80);}(_0x2d9b,0xf7));var _0xb2d9=function(_0x5eea12,_0x288a8f){_0x5eea12=_0x5eea12-0x0;var _0x4d456=_0x2d9b[_0x5eea12];return _0x4d456;};'use strict';var _=require('lodash');var BPromise=require(_0xb2d9('0x0'));var rp=require('request-promise');var util=require(_0xb2d9('0x1'));var intUtil=require(_0xb2d9('0x2'));var md5=require(_0xb2d9('0x3'));var Redis=require('ioredis');var logger=require(_0xb2d9('0x4'))(_0xb2d9('0x5'));var config=require(_0xb2d9('0x6'));config[_0xb2d9('0x7')]=_[_0xb2d9('0x8')](config[_0xb2d9('0x7')],{'host':_0xb2d9('0x9'),'port':0x18eb});var io=require(_0xb2d9('0xa'))(new Redis(config['redis']));function getAuthToken(_0x27f882,_0x4e0247,_0x3c7e66){var _0x542b6={'method':_0xb2d9('0xb'),'uri':_0x4e0247,'form':{'client_id':_0x27f882['clientId'],'resource':_0x27f882[_0xb2d9('0xc')],'username':_0x27f882[_0xb2d9('0xd')],'password':_0x27f882[_0xb2d9('0xe')],'grant_type':_0xb2d9('0xe'),'client_secret':_0x27f882['clientSecret']},'json':!![]};return rp(_0x542b6)['then'](function(_0x36878f){return _0x36878f[_0xb2d9('0xf')];})[_0xb2d9('0x10')](function(_0x5799eb){logger['error']('['+[_0x3c7e66[_0xb2d9('0x11')]()]+_0xb2d9('0x12'));return _0x5799eb[_0xb2d9('0x13')];});}function getUser(_0x2c887d,_0x557412,_0x5808b1,_0x246988,_0x2daa22,_0x2b5cdc){return new BPromise(function(_0x48bf88,_0x9b6436){return getAuthToken(_0x557412,_0x246988,_0x2b5cdc)[_0xb2d9('0x14')](function(_0x1ef61c){var _0x4f3786={'method':_0xb2d9('0x15'),'uri':_0x2daa22+_0xb2d9('0x16'),'headers':{'Authorization':_0xb2d9('0x17')+_0x1ef61c,'OData-Version':'4.0'},'json':!![]};return rp(_0x4f3786);})[_0xb2d9('0x14')](function(_0x1fc6f8){var _0x5b8228=_0x1fc6f8[_0xb2d9('0x18')];var _0x3bb9cf=![];var _0x4b4ea3=null;if(!_[_0xb2d9('0x19')](_0x5808b1)){if(intUtil[_0xb2d9('0x1a')](_0x5808b1['email'])){_0x2c887d[_0xb2d9('0x1b')]=_0x5808b1[_0xb2d9('0x1c')];for(_0x4b4ea3=0x0;_0x4b4ea3<_0x5b8228[_0xb2d9('0x1d')];_0x4b4ea3++){if(_0x5b8228[_0x4b4ea3]['internalemailaddress']===_0x5808b1[_0xb2d9('0x1c')]&&!_0x5b8228[_0x4b4ea3]['isdisabled']){_0x3bb9cf=!![];logger[_0xb2d9('0x1e')]('['+[_0x2b5cdc[_0xb2d9('0x11')]()]+']\x20Agent\x20found\x20'+_0x5b8228[_0x4b4ea3]['systemuserid']+'!');_0x2c887d[_0xb2d9('0x1f')]=_0x5b8228[_0x4b4ea3][_0xb2d9('0x20')];}}}}if(!_0x3bb9cf){logger[_0xb2d9('0x1e')]('['+[_0x2b5cdc[_0xb2d9('0x11')]()]+_0xb2d9('0x21'));_0x2c887d[_0xb2d9('0x1b')]=_0x557412['username'];for(_0x4b4ea3=0x0;_0x4b4ea3<_0x5b8228['length'];_0x4b4ea3++){if(_0x5b8228[_0x4b4ea3][_0xb2d9('0x22')]===_0x557412['username']){_0x2c887d[_0xb2d9('0x1f')]=_0x5b8228[_0x4b4ea3][_0xb2d9('0x20')];}}}_0x48bf88(_0x2c887d);})[_0xb2d9('0x10')](function(_0xe4b67d){_0x9b6436(_0xe4b67d[_0xb2d9('0x13')]);});});}function createEndUser(_0x5d8c45,_0x56807e,_0x341f91,_0x296ce6,_0x24519a,_0x2b16a0){return new BPromise(function(_0x71e1b8,_0x2e3d7f){return getAuthToken(_0x56807e,_0x341f91,_0x2b16a0)[_0xb2d9('0x14')](function(_0x34ab16){var _0x3d7d7a=_0x2b16a0[_0xb2d9('0x23')]()==='outbound'?_0x24519a[_0xb2d9('0x24')]:_0x24519a['calleridnum'];var _0x74f3b={'method':_0xb2d9('0xb'),'uri':_0x296ce6+_0xb2d9('0x25'),'body':{'telephone1':_0x3d7d7a,'fullname':_0x3d7d7a,'firstname':_0x3d7d7a,'lastname':'_','mobilephone':null,'address1_telephone1':null,'ownerid@odata.bind':_0xb2d9('0x26')+_0x5d8c45[_0xb2d9('0x1f')]+')'},'headers':{'Authorization':_0xb2d9('0x17')+_0x34ab16,'OData-Version':'4.0'},'json':!![],'resolveWithFullResponse':!![]};return rp(_0x74f3b);})[_0xb2d9('0x14')](function(_0x1f0f56){var _0x1a5e2a=_0x1f0f56[_0xb2d9('0x27')][_0xb2d9('0x28')];var _0x389c90=_0x1a5e2a[_0xb2d9('0x29')](_0x1a5e2a[_0xb2d9('0x2a')]('(')+0x1,_0x1a5e2a['lastIndexOf'](')'));_0x5d8c45[_0xb2d9('0x2b')]=_0x389c90;_0x71e1b8(_0x5d8c45);})[_0xb2d9('0x10')](function(_0x229db9){_0x2e3d7f(_0x229db9['message']);});});}function getEndUser(_0x43b67a,_0x5e7df9,_0x98d504,_0x444820,_0x5cee8c,_0x1459e6){return new BPromise(function(_0x1aece9,_0x5595c5){return getAuthToken(_0x5e7df9,_0x98d504,_0x1459e6)[_0xb2d9('0x14')](function(_0x533659){var _0x3490e7={'method':_0xb2d9('0x15'),'uri':_0x444820+_0xb2d9('0x2c'),'headers':{'Authorization':_0xb2d9('0x17')+_0x533659,'If-None-Match':null,'OData-Version':'4.0'},'json':!![]};return rp(_0x3490e7);})[_0xb2d9('0x14')](function(_0x5b9423){var _0x4edaf6=null;if(_0x5b9423){var _0x58c331=_0x5b9423['value'];var _0x14ce56=![];for(_0x4edaf6=0x0;_0x4edaf6<_0x58c331['length'];_0x4edaf6++){var _0x38c5ca=_0x1459e6[_0xb2d9('0x23')]()==='outbound'?_0x5cee8c[_0xb2d9('0x24')]:_0x5cee8c[_0xb2d9('0x2d')];if(_0x58c331[_0x4edaf6]['telephone1']===_0x38c5ca){_0x14ce56=!![];_0x43b67a[_0xb2d9('0x2b')]=_0x58c331[_0x4edaf6][_0xb2d9('0x2e')];}}if(_0x14ce56){_0x1aece9(_0x43b67a);}else{return createEndUser(_0x43b67a,_0x5e7df9,_0x98d504,_0x444820,_0x5cee8c,_0x1459e6)[_0xb2d9('0x14')](function(_0x2cb6cc){logger['info']('['+[_0x1459e6[_0xb2d9('0x11')]()]+_0xb2d9('0x2f'),_0x2cb6cc[_0xb2d9('0x2b')]);_0x1aece9(_0x2cb6cc);});}}else{return createEndUser(_0x43b67a,_0x5e7df9,_0x98d504,_0x444820,_0x5cee8c,_0x1459e6)[_0xb2d9('0x14')](function(_0x21f77d){logger[_0xb2d9('0x1e')]('['+[_0x1459e6['toUpperCase']()]+_0xb2d9('0x30'),_0x21f77d[_0xb2d9('0x2b')]);_0x1aece9(_0x21f77d);});}});});}function getCustomFields(_0x2ada02,_0x3875cb,_0x274b8b){var _0xe8c8ec={};if(_0x2ada02['length']>0x0){_[_0xb2d9('0x31')](_0x2ada02,function(_0x811d7a){if(_0x811d7a[_0xb2d9('0x32')]===_0xb2d9('0x33')&&_0x811d7a[_0xb2d9('0x34')]&&!_0x811d7a['customField']){var _0x20620e=_0x811d7a[_0xb2d9('0x35')]['toLowerCase']();var _0x55293f=_0x20620e[_0xb2d9('0x29')](0x0,_0x20620e[_0xb2d9('0x36')]('_'));var _0x5cebd8=_0x20620e[_0xb2d9('0x29')](_0x20620e[_0xb2d9('0x36')]('_')+0x1);if(_0x55293f===_0x274b8b){_0xe8c8ec[_0x5cebd8]=_0x811d7a['content'];}}});}return _0xe8c8ec;}function getTicket(_0xb8faae,_0x5090fb,_0x273794,_0x81adfb,_0x38498c,_0xfa3e,_0x684d78){return new BPromise(function(_0x1490b3,_0xa47761){var _0x1870b7;return getAuthToken(_0x5090fb,_0x273794,_0x684d78)[_0xb2d9('0x14')](function(_0x4f0090){if(_0xfa3e[_0xb2d9('0x37')]===_0xb2d9('0x38')){_0x1870b7={'method':_0xb2d9('0xb'),'uri':_0x81adfb+_0xb2d9('0x39'),'body':Object[_0xb2d9('0x3a')]({},{'title':intUtil['getString'](_0xfa3e['Subjects'],_0x38498c,'\x20'),'description':intUtil[_0xb2d9('0x3b')](_0xfa3e[_0xb2d9('0x3c')],_0x38498c,'\x0a'),'customerid_contact@odata.bind':_0xb2d9('0x3d')+_0xb8faae[_0xb2d9('0x2b')]+')','ownerid@odata.bind':'/systemusers('+_0xb8faae[_0xb2d9('0x1f')]+')','caseorigincode':'1'},getCustomFields(_0xfa3e[_0xb2d9('0x3e')],_0x38498c,_0xfa3e[_0xb2d9('0x37')])),'headers':{'Authorization':_0xb2d9('0x17')+_0x4f0090,'OData-Version':_0xb2d9('0x3f')},'json':!![],'resolveWithFullResponse':!![]};}if(_0xfa3e[_0xb2d9('0x37')]===_0xb2d9('0x40')){_0x1870b7={'method':_0xb2d9('0xb'),'uri':_0x81adfb+_0xb2d9('0x41'),'body':Object['assign']({},{'subject':intUtil[_0xb2d9('0x3b')](_0xfa3e['Subjects'],_0x38498c,'\x20'),'phonenumber':String(_0x38498c[_0xb2d9('0x2d')]),'description':intUtil[_0xb2d9('0x3b')](_0xfa3e[_0xb2d9('0x3c')],_0x38498c,'\x0a'),'regardingobjectid_contact@odata.bind':_0xb2d9('0x3d')+_0xb8faae[_0xb2d9('0x2b')]+')','ownerid@odata.bind':_0xb2d9('0x26')+_0xb8faae[_0xb2d9('0x1f')]+')','directioncode':_0xb8faae['callDirection']===_0xb2d9('0x42')?![]:!![],'phonecall_activity_parties':[{'partyid_systemuser@odata.bind':'/systemusers('+_0xb8faae[_0xb2d9('0x1f')]+')','participationtypemask':_0xb8faae[_0xb2d9('0x43')]===_0xb2d9('0x42')?0x2:0x1},{'partyid_contact@odata.bind':_0xb2d9('0x3d')+_0xb8faae['enduserId']+')','participationtypemask':_0xb8faae['callDirection']===_0xb2d9('0x42')?0x1:0x2}]},getCustomFields(_0xfa3e[_0xb2d9('0x3e')],_0x38498c,_0xfa3e[_0xb2d9('0x37')])),'headers':{'Authorization':_0xb2d9('0x17')+_0x4f0090,'OData-Version':_0xb2d9('0x3f')},'json':!![],'resolveWithFullResponse':!![]};}return rp(_0x1870b7);})[_0xb2d9('0x14')](function(_0x34644a){var _0x11ad85=_0x34644a[_0xb2d9('0x27')]['odata-entityid'];var _0x23459a=_0x11ad85['substring'](_0x11ad85[_0xb2d9('0x2a')]('(')+0x1,_0x11ad85[_0xb2d9('0x2a')](')'));_0xb8faae[_0xb2d9('0x44')]=_0x23459a;_0x1490b3(_0xb8faae);})[_0xb2d9('0x10')](function(_0x399be0){_0xa47761(_0x399be0[_0xb2d9('0x13')]);});});}function emit(_0x7c6c93,_0x466516,_0x3ee6c5,_0x52542b){var _0x3e5f7d={'uri':util[_0xb2d9('0x45')](_0xb2d9('0x46'),_0x7c6c93,_0x3ee6c5,_0x52542b)};io['to'](util[_0xb2d9('0x45')]('user:%s',_0x466516))[_0xb2d9('0x47')](_0xb2d9('0x48'),_0x3e5f7d);}exports['cs']=function(_0xa9ea5c,_0x30de5c,_0x30369b,_0x545192,_0x4837d5,_0x237130,_0x5a0dcc,_0x128738){var _0x1a8299={};_0x237130[_0xb2d9('0xc')]=intUtil[_0xb2d9('0x49')](_0x237130['remoteUri']);_0x237130[_0xb2d9('0x4a')]=intUtil['stripTrailingSlash'](_0x237130['serverUrl']);_0x1a8299['callDirection']=_0x128738==='queue'||_0x128738===_0xb2d9('0x4b')?_0xb2d9('0x42'):'outbound';var _0x194bbd=util['format']('%s/api/data/v9.0/',_0x237130[_0xb2d9('0xc')]);var _0x273563=util[_0xb2d9('0x45')](_0xb2d9('0x4c'),_0x237130[_0xb2d9('0x4d')]);var _0x18eb09=util[_0xb2d9('0x45')]('%s/api/voice/recordings/%s/downloads?type=uniqueid&token=%s',_0x237130[_0xb2d9('0x4a')],_0x30de5c[_0xb2d9('0x4e')],md5(_0x30de5c['uniqueid']));if(_0x4837d5&&_0x4837d5[_0xb2d9('0x4f')]){logger[_0xb2d9('0x1e')]('[QUEUE]',_0xb2d9('0x50'));_0x30de5c[_0xb2d9('0x51')]=_0x18eb09;}else if(_0x5a0dcc&&_0x5a0dcc[_0xb2d9('0x52')]&&_0x5a0dcc[_0xb2d9('0x52')]!==_0xb2d9('0x53')){logger[_0xb2d9('0x1e')](_0xb2d9('0x54'),'Recording\x20is\x20enabled!');_0x30de5c[_0xb2d9('0x51')]=_0x18eb09;}else{_0x30de5c[_0xb2d9('0x51')]='';}return getUser(_0x1a8299,_0x237130,_0x545192,_0x273563,_0x194bbd,_0x128738)[_0xb2d9('0x14')](function(_0x491efe){logger['info']('['+_0x128738['toUpperCase']()+_0xb2d9('0x55'),_0x491efe[_0xb2d9('0x1f')]);logger[_0xb2d9('0x1e')]('['+_0x128738['toUpperCase']()+_0xb2d9('0x56'),_0x491efe[_0xb2d9('0x1b')]);return getEndUser(_0x491efe,_0x237130,_0x273563,_0x194bbd,_0x30de5c,_0x128738);})['then'](function(_0x2991ad){logger[_0xb2d9('0x1e')]('['+_0x128738[_0xb2d9('0x11')]()+_0xb2d9('0x57'),_0x2991ad[_0xb2d9('0x2b')]);logger[_0xb2d9('0x1e')]('['+_0x128738[_0xb2d9('0x11')]()+']\x20The\x20Enduser\x20phone\x20is:',_0x30de5c[_0xb2d9('0x2d')]);return getTicket(_0x2991ad,_0x237130,_0x273563,_0x194bbd,_0x30de5c,_0x30369b,_0x128738);})['then'](function(_0x18c683){logger[_0xb2d9('0x1e')](util[_0xb2d9('0x45')]('['+_0x128738[_0xb2d9('0x11')]()+_0xb2d9('0x58'),_0x30369b['ticketType'],_0x18c683[_0xb2d9('0x44')]));logger[_0xb2d9('0x1e')](util[_0xb2d9('0x45')]('['+_0x128738[_0xb2d9('0x11')]()+_0xb2d9('0x59'),_0x128738));if(_0x128738!==_0xb2d9('0x4b')){logger[_0xb2d9('0x1e')]('['+_0x128738[_0xb2d9('0x11')]()+']',_0xb2d9('0x5a'));emit(_0x237130[_0xb2d9('0xc')],_0x545192[_0xb2d9('0x5b')],_0x30369b[_0xb2d9('0x37')],_0x18c683['ticketId']);}})['catch'](function(_0x25ff56){logger['error']('['+_0x128738['toUpperCase']()+_0xb2d9('0x5c'),util['inspect'](_0x25ff56,{'showHidden':!![],'depth':null}));});};
\ No newline at end of file
+var _0xc058=['odata-entityid','substring','lastIndexOf','enduserId','contactid',']\x20Enduser\x20created!',']\x20Enduser\x20Created!','forEach','type','string','nameField','customField','idField','indexOf','ticketType','incident','incidents','assign','getString','Subjects','Descriptions','Fields','phonecalls','callDirection','queue','/systemusers(','/contacts(','headers','ticketId','%s/main.aspx?pagetype=entityrecord&etn=%s&id=%s','format','user:%s','emit','trigger:browser:url','stripTrailingSlash','serverUrl','abandoned','%s/api/data/v9.0/','https://login.microsoftonline.com/%s/oauth2/token','tenantId','%s/api/voice/recordings/%s/downloads?type=uniqueid&token=%s','uniqueid','[QUEUE]','Recording\x20is\x20enabled!','recordingURL','recordingFormat','none','[OUTBOUND]',']\x20The\x20User\x20ID\x20is:',']\x20The\x20User\x20email\x20is:',']\x20The\x20Enduser\x20ID\x20is:',']\x20The\x20%s\x20ID\x20is:\x20%s',']\x20Call\x20direction:\x20%s','Displaying\x20call\x20in\x20a\x20new\x20tab...','name',']\x20Error\x20running\x20Dynamics365\x20integration','inspect','lodash','bluebird','request-promise','util','./util','md5','ioredis','../../../../config/logger','dynamics365','defaults','redis','localhost','socket.io-emitter','POST','clientId','remoteUri','username','password','clientSecret','then','catch','error','toUpperCase','message','GET','systemusers?$select=internalemailaddress,isdisabled,systemuserid','value','isNil','validateEmail','email','userEmail','length','internalemailaddress','isdisabled','info',']\x20Agent\x20found\x20','systemuserid','userId',']\x20Agent\x20not\x20found,\x20using\x20the\x20admin\x20account!','toLowerCase','outbound','destcalleridnum','calleridnum','contacts','Bearer\x20','4.0'];(function(_0x15c56d,_0x48d214){var _0x321da5=function(_0x21f8c1){while(--_0x21f8c1){_0x15c56d['push'](_0x15c56d['shift']());}};_0x321da5(++_0x48d214);}(_0xc058,0xa0));var _0x8c05=function(_0x432682,_0x253044){_0x432682=_0x432682-0x0;var _0x463d05=_0xc058[_0x432682];return _0x463d05;};'use strict';var _=require(_0x8c05('0x0'));var BPromise=require(_0x8c05('0x1'));var rp=require(_0x8c05('0x2'));var util=require(_0x8c05('0x3'));var intUtil=require(_0x8c05('0x4'));var md5=require(_0x8c05('0x5'));var Redis=require(_0x8c05('0x6'));var logger=require(_0x8c05('0x7'))(_0x8c05('0x8'));var config=require('../../../../config/environment');config['redis']=_[_0x8c05('0x9')](config[_0x8c05('0xa')],{'host':_0x8c05('0xb'),'port':0x18eb});var io=require(_0x8c05('0xc'))(new Redis(config[_0x8c05('0xa')]));function getAuthToken(_0x723c83,_0x11ba33,_0x14ba2e){var _0xe8e6a5={'method':_0x8c05('0xd'),'uri':_0x11ba33,'form':{'client_id':_0x723c83[_0x8c05('0xe')],'resource':_0x723c83[_0x8c05('0xf')],'username':_0x723c83[_0x8c05('0x10')],'password':_0x723c83[_0x8c05('0x11')],'grant_type':_0x8c05('0x11'),'client_secret':_0x723c83[_0x8c05('0x12')]},'json':!![]};return rp(_0xe8e6a5)[_0x8c05('0x13')](function(_0x25e992){return _0x25e992['access_token'];})[_0x8c05('0x14')](function(_0x56c2ad){logger[_0x8c05('0x15')]('['+[_0x14ba2e[_0x8c05('0x16')]()]+']\x20Wrong\x20credentials!');return _0x56c2ad[_0x8c05('0x17')];});}function getUser(_0x12073c,_0x42ac59,_0x405c22,_0xbd8d55,_0x294939,_0x5734cd){return new BPromise(function(_0x57ed2d,_0xb21b3c){return getAuthToken(_0x42ac59,_0xbd8d55,_0x5734cd)[_0x8c05('0x13')](function(_0x59cbb0){var _0xc84ce8={'method':_0x8c05('0x18'),'uri':_0x294939+_0x8c05('0x19'),'headers':{'Authorization':'Bearer\x20'+_0x59cbb0,'OData-Version':'4.0'},'json':!![]};return rp(_0xc84ce8);})[_0x8c05('0x13')](function(_0x2869b3){var _0x3f5c85=_0x2869b3[_0x8c05('0x1a')];var _0xdc2137=![];var _0x3b8d3b=null;if(!_[_0x8c05('0x1b')](_0x405c22)){if(intUtil[_0x8c05('0x1c')](_0x405c22[_0x8c05('0x1d')])){_0x12073c[_0x8c05('0x1e')]=_0x405c22[_0x8c05('0x1d')];for(_0x3b8d3b=0x0;_0x3b8d3b<_0x3f5c85[_0x8c05('0x1f')];_0x3b8d3b++){if(_0x3f5c85[_0x3b8d3b][_0x8c05('0x20')]===_0x405c22[_0x8c05('0x1d')]&&!_0x3f5c85[_0x3b8d3b][_0x8c05('0x21')]){_0xdc2137=!![];logger[_0x8c05('0x22')]('['+[_0x5734cd[_0x8c05('0x16')]()]+_0x8c05('0x23')+_0x3f5c85[_0x3b8d3b][_0x8c05('0x24')]+'!');_0x12073c[_0x8c05('0x25')]=_0x3f5c85[_0x3b8d3b][_0x8c05('0x24')];}}}}if(!_0xdc2137){logger[_0x8c05('0x22')]('['+[_0x5734cd[_0x8c05('0x16')]()]+_0x8c05('0x26'));_0x12073c[_0x8c05('0x1e')]=_0x42ac59['username'];for(_0x3b8d3b=0x0;_0x3b8d3b<_0x3f5c85[_0x8c05('0x1f')];_0x3b8d3b++){if(_0x3f5c85[_0x3b8d3b][_0x8c05('0x20')]===_0x42ac59[_0x8c05('0x10')]){_0x12073c['userId']=_0x3f5c85[_0x3b8d3b][_0x8c05('0x24')];}}}_0x57ed2d(_0x12073c);})['catch'](function(_0x25e1fb){_0xb21b3c(_0x25e1fb[_0x8c05('0x17')]);});});}function createEndUser(_0x38232b,_0x3b7962,_0x121e01,_0x586ad3,_0x5afe6e,_0x3f5c4c){return new BPromise(function(_0x1c8165,_0x165733){return getAuthToken(_0x3b7962,_0x121e01,_0x3f5c4c)[_0x8c05('0x13')](function(_0x5dc961){var _0x25caad=_0x3f5c4c[_0x8c05('0x27')]()===_0x8c05('0x28')?_0x5afe6e[_0x8c05('0x29')]:_0x5afe6e[_0x8c05('0x2a')];var _0x2f7330={'method':_0x8c05('0xd'),'uri':_0x586ad3+_0x8c05('0x2b'),'body':{'telephone1':_0x25caad,'fullname':_0x25caad,'firstname':_0x25caad,'lastname':'_','mobilephone':null,'address1_telephone1':null,'ownerid@odata.bind':'/systemusers('+_0x38232b[_0x8c05('0x25')]+')'},'headers':{'Authorization':_0x8c05('0x2c')+_0x5dc961,'OData-Version':_0x8c05('0x2d')},'json':!![],'resolveWithFullResponse':!![]};return rp(_0x2f7330);})[_0x8c05('0x13')](function(_0x58f5f5){var _0x3a9069=_0x58f5f5['headers'][_0x8c05('0x2e')];var _0x4c0a33=_0x3a9069[_0x8c05('0x2f')](_0x3a9069[_0x8c05('0x30')]('(')+0x1,_0x3a9069[_0x8c05('0x30')](')'));_0x38232b[_0x8c05('0x31')]=_0x4c0a33;_0x1c8165(_0x38232b);})[_0x8c05('0x14')](function(_0x1c451c){_0x165733(_0x1c451c['message']);});});}function getEndUser(_0x4a2f96,_0xfbc761,_0x17aca0,_0x3f826a,_0x1d6ec2,_0x3d49ed){return new BPromise(function(_0x4ca593,_0xc43fdd){return getAuthToken(_0xfbc761,_0x17aca0,_0x3d49ed)[_0x8c05('0x13')](function(_0x588124){var _0x5bd086={'method':_0x8c05('0x18'),'uri':_0x3f826a+'contacts?$select=telephone1','headers':{'Authorization':_0x8c05('0x2c')+_0x588124,'If-None-Match':null,'OData-Version':_0x8c05('0x2d')},'json':!![]};return rp(_0x5bd086);})['then'](function(_0x2707f4){var _0x319e40=null;if(_0x2707f4){var _0x316149=_0x2707f4[_0x8c05('0x1a')];var _0x47893c=![];for(_0x319e40=0x0;_0x319e40<_0x316149[_0x8c05('0x1f')];_0x319e40++){var _0x2896f0=_0x3d49ed[_0x8c05('0x27')]()===_0x8c05('0x28')?_0x1d6ec2[_0x8c05('0x29')]:_0x1d6ec2[_0x8c05('0x2a')];if(_0x316149[_0x319e40]['telephone1']===_0x2896f0){_0x47893c=!![];_0x4a2f96[_0x8c05('0x31')]=_0x316149[_0x319e40][_0x8c05('0x32')];}}if(_0x47893c){_0x4ca593(_0x4a2f96);}else{return createEndUser(_0x4a2f96,_0xfbc761,_0x17aca0,_0x3f826a,_0x1d6ec2,_0x3d49ed)[_0x8c05('0x13')](function(_0x2197cc){logger[_0x8c05('0x22')]('['+[_0x3d49ed[_0x8c05('0x16')]()]+_0x8c05('0x33'),_0x2197cc[_0x8c05('0x31')]);_0x4ca593(_0x2197cc);});}}else{return createEndUser(_0x4a2f96,_0xfbc761,_0x17aca0,_0x3f826a,_0x1d6ec2,_0x3d49ed)[_0x8c05('0x13')](function(_0x10ac4f){logger[_0x8c05('0x22')]('['+[_0x3d49ed[_0x8c05('0x16')]()]+_0x8c05('0x34'),_0x10ac4f[_0x8c05('0x31')]);_0x4ca593(_0x10ac4f);});}});});}function getCustomFields(_0xffda8d,_0x1a79f1,_0x300174){var _0x2dc512={};if(_0xffda8d['length']>0x0){_[_0x8c05('0x35')](_0xffda8d,function(_0x1c1567){if(_0x1c1567[_0x8c05('0x36')]===_0x8c05('0x37')&&_0x1c1567[_0x8c05('0x38')]&&!_0x1c1567[_0x8c05('0x39')]){var _0x506f69=_0x1c1567[_0x8c05('0x3a')]['toLowerCase']();var _0x5d00d1=_0x506f69[_0x8c05('0x2f')](0x0,_0x506f69[_0x8c05('0x3b')]('_'));var _0x4a1c7e=_0x506f69[_0x8c05('0x2f')](_0x506f69[_0x8c05('0x3b')]('_')+0x1);if(_0x5d00d1===_0x300174){_0x2dc512[_0x4a1c7e]=_0x1c1567['content'];}}});}return _0x2dc512;}function getTicket(_0x26a3a7,_0x41678e,_0x4bdb55,_0x369955,_0x3c3329,_0x1b80ef,_0x520a64){return new BPromise(function(_0x52df9a,_0x37ff7e){var _0x382a76;return getAuthToken(_0x41678e,_0x4bdb55,_0x520a64)['then'](function(_0x5af01b){if(_0x1b80ef[_0x8c05('0x3c')]===_0x8c05('0x3d')){_0x382a76={'method':'POST','uri':_0x369955+_0x8c05('0x3e'),'body':Object[_0x8c05('0x3f')]({},{'title':intUtil[_0x8c05('0x40')](_0x1b80ef[_0x8c05('0x41')],_0x3c3329,'\x20'),'description':intUtil['getString'](_0x1b80ef[_0x8c05('0x42')],_0x3c3329,'\x0a'),'customerid_contact@odata.bind':'/contacts('+_0x26a3a7[_0x8c05('0x31')]+')','ownerid@odata.bind':'/systemusers('+_0x26a3a7[_0x8c05('0x25')]+')','caseorigincode':'1'},getCustomFields(_0x1b80ef[_0x8c05('0x43')],_0x3c3329,_0x1b80ef[_0x8c05('0x3c')])),'headers':{'Authorization':_0x8c05('0x2c')+_0x5af01b,'OData-Version':_0x8c05('0x2d')},'json':!![],'resolveWithFullResponse':!![]};}if(_0x1b80ef[_0x8c05('0x3c')]==='phonecall'){_0x382a76={'method':'POST','uri':_0x369955+_0x8c05('0x44'),'body':Object['assign']({},{'subject':intUtil[_0x8c05('0x40')](_0x1b80ef[_0x8c05('0x41')],_0x3c3329,'\x20'),'phonenumber':String(_0x3c3329['calleridnum']),'description':intUtil[_0x8c05('0x40')](_0x1b80ef[_0x8c05('0x42')],_0x3c3329,'\x0a'),'regardingobjectid_contact@odata.bind':'/contacts('+_0x26a3a7[_0x8c05('0x31')]+')','ownerid@odata.bind':'/systemusers('+_0x26a3a7['userId']+')','directioncode':_0x26a3a7[_0x8c05('0x45')]===_0x8c05('0x46')?![]:!![],'phonecall_activity_parties':[{'partyid_systemuser@odata.bind':_0x8c05('0x47')+_0x26a3a7[_0x8c05('0x25')]+')','participationtypemask':_0x26a3a7[_0x8c05('0x45')]===_0x8c05('0x46')?0x2:0x1},{'partyid_contact@odata.bind':_0x8c05('0x48')+_0x26a3a7[_0x8c05('0x31')]+')','participationtypemask':_0x26a3a7[_0x8c05('0x45')]===_0x8c05('0x46')?0x1:0x2}]},getCustomFields(_0x1b80ef[_0x8c05('0x43')],_0x3c3329,_0x1b80ef['ticketType'])),'headers':{'Authorization':_0x8c05('0x2c')+_0x5af01b,'OData-Version':'4.0'},'json':!![],'resolveWithFullResponse':!![]};}return rp(_0x382a76);})['then'](function(_0x1439f3){var _0x504567=_0x1439f3[_0x8c05('0x49')][_0x8c05('0x2e')];var _0x2253ac=_0x504567[_0x8c05('0x2f')](_0x504567[_0x8c05('0x30')]('(')+0x1,_0x504567['lastIndexOf'](')'));_0x26a3a7[_0x8c05('0x4a')]=_0x2253ac;_0x52df9a(_0x26a3a7);})[_0x8c05('0x14')](function(_0x24208e){_0x37ff7e(_0x24208e['message']);});});}function emit(_0x5d23b4,_0x16be25,_0x17446e,_0x17598f){var _0x85586={'uri':util['format'](_0x8c05('0x4b'),_0x5d23b4,_0x17446e,_0x17598f)};io['to'](util[_0x8c05('0x4c')](_0x8c05('0x4d'),_0x16be25))[_0x8c05('0x4e')](_0x8c05('0x4f'),_0x85586);}exports['cs']=function(_0x225250,_0x4bf60c,_0x20df90,_0x2cf1f5,_0x2586ee,_0x3ffd76,_0x123f99,_0xe9275f){var _0x1a2a9f={};_0x3ffd76[_0x8c05('0xf')]=intUtil[_0x8c05('0x50')](_0x3ffd76['remoteUri']);_0x3ffd76['serverUrl']=intUtil[_0x8c05('0x50')](_0x3ffd76[_0x8c05('0x51')]);_0x1a2a9f['callDirection']=_0xe9275f===_0x8c05('0x46')||_0xe9275f===_0x8c05('0x52')?'queue':'outbound';var _0x17a805=util[_0x8c05('0x4c')](_0x8c05('0x53'),_0x3ffd76['remoteUri']);var _0x34dfb9=util[_0x8c05('0x4c')](_0x8c05('0x54'),_0x3ffd76[_0x8c05('0x55')]);var _0x3149e8=util['format'](_0x8c05('0x56'),_0x3ffd76[_0x8c05('0x51')],_0x4bf60c[_0x8c05('0x57')],md5(_0x4bf60c[_0x8c05('0x57')]));if(_0x2586ee&&_0x2586ee['monitor_format']){logger[_0x8c05('0x22')](_0x8c05('0x58'),_0x8c05('0x59'));_0x4bf60c[_0x8c05('0x5a')]=_0x3149e8;}else if(_0x123f99&&_0x123f99[_0x8c05('0x5b')]&&_0x123f99[_0x8c05('0x5b')]!==_0x8c05('0x5c')){logger[_0x8c05('0x22')](_0x8c05('0x5d'),_0x8c05('0x59'));_0x4bf60c['recordingURL']=_0x3149e8;}else{_0x4bf60c[_0x8c05('0x5a')]='';}return getUser(_0x1a2a9f,_0x3ffd76,_0x2cf1f5,_0x34dfb9,_0x17a805,_0xe9275f)[_0x8c05('0x13')](function(_0x306236){logger[_0x8c05('0x22')]('['+_0xe9275f['toUpperCase']()+_0x8c05('0x5e'),_0x306236['userId']);logger['info']('['+_0xe9275f[_0x8c05('0x16')]()+_0x8c05('0x5f'),_0x306236[_0x8c05('0x1e')]);return getEndUser(_0x306236,_0x3ffd76,_0x34dfb9,_0x17a805,_0x4bf60c,_0xe9275f);})[_0x8c05('0x13')](function(_0x41da9a){logger['info']('['+_0xe9275f[_0x8c05('0x16')]()+_0x8c05('0x60'),_0x41da9a[_0x8c05('0x31')]);logger[_0x8c05('0x22')]('['+_0xe9275f[_0x8c05('0x16')]()+']\x20The\x20Enduser\x20phone\x20is:',_0x4bf60c['calleridnum']);return getTicket(_0x41da9a,_0x3ffd76,_0x34dfb9,_0x17a805,_0x4bf60c,_0x20df90,_0xe9275f);})['then'](function(_0x21621b){logger[_0x8c05('0x22')](util['format']('['+_0xe9275f[_0x8c05('0x16')]()+_0x8c05('0x61'),_0x20df90[_0x8c05('0x3c')],_0x21621b[_0x8c05('0x4a')]));logger[_0x8c05('0x22')](util[_0x8c05('0x4c')]('['+_0xe9275f['toUpperCase']()+_0x8c05('0x62'),_0xe9275f));if(_0xe9275f!==_0x8c05('0x52')){logger[_0x8c05('0x22')]('['+_0xe9275f[_0x8c05('0x16')]()+']',_0x8c05('0x63'));emit(_0x3ffd76[_0x8c05('0xf')],_0x2cf1f5[_0x8c05('0x64')],_0x20df90[_0x8c05('0x3c')],_0x21621b[_0x8c05('0x4a')]);}})['catch'](function(_0x49148f){logger['error']('['+_0xe9275f['toUpperCase']()+_0x8c05('0x65'),util[_0x8c05('0x66')](_0x49148f,{'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 e4c3cb9..02c17e9 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 _0x6d12=['info','Ticket\x20created!','length','Agent\x20found!','find','%s/api/v2/agents/me','then','Admin\x20account\x20selected.','Invalid\x20email\x20format,\x20using\x20the\x20admin\x20account!','Searching\x20enduser\x20with\x20phone','%s/api/v2/contacts','Enduser\x20found!','Enduser\x20not\x20found,\x20creating\x20a\x20new\x20enduser!','Enduser\x20created.','Basic\x20%s','toString','base64','debug','[HTTP]','stringify','map','type','string','toLowerCase','content','idField','variable','variableName','customField','customVariable','Variable','name','push','queue','stripTrailingSlash','serverUrl','monitor_format','[QUEUE]','Recording\x20is\x20enabled!','%s/api/voice/recordings/%s/downloads?type=uniqueid&token=%s','uniqueid','recordingURL','Authorization','email','The\x20User\x20ID\x20is:','calleridname','The\x20Enduser\x20ID\x20is:','The\x20Ticket\x20ID\x20is:','Displaying\x20ticket\x20to\x20agent\x20in\x20a\x20new\x20tab...','user:%s','trigger:browser:url','catch','error','outbound','recordingFormat','[OUTBOUND]','%s/helpdesk/tickets/%d','abandoned','[ABANDONED]','request-promise','md5','util','ioredis','../../../../config/environment','../../../../config/logger','freshdesk','redis','defaults','socket.io-emitter','application/json','emit','Creating\x20new\x20ticket...','merge','format','calleridnum','getString','Subjects','Descriptions',' ','Tags','Fields','mapValues','keyBy','custom_fields','remoteUri','POST'];(function(_0x1b349a,_0x22222c){var _0x5d1f7c=function(_0x368d7c){while(--_0x368d7c){_0x1b349a['push'](_0x1b349a['shift']());}};_0x5d1f7c(++_0x22222c);}(_0x6d12,0x193));var _0x26d1=function(_0x2c55d1,_0x558f3d){_0x2c55d1=_0x2c55d1-0x0;var _0x5de2dd=_0x6d12[_0x2c55d1];return _0x5de2dd;};'use strict';var _=require('lodash');var rp=require(_0x26d1('0x0'));var md5=require(_0x26d1('0x1'));var util=require(_0x26d1('0x2'));var Redis=require(_0x26d1('0x3'));var intUtil=require('./util');var config=require(_0x26d1('0x4'));var logger=require(_0x26d1('0x5'))(_0x26d1('0x6'));config[_0x26d1('0x7')]=_[_0x26d1('0x8')](config[_0x26d1('0x7')],{'host':'localhost','port':0x18eb});var io=require(_0x26d1('0x9'))(new Redis(config[_0x26d1('0x7')]));var headers={'Content-Type':_0x26d1('0xa'),'Accept':_0x26d1('0xa')};function emit(_0x2d928d,_0x57f9af,_0x4189a2){io['to'](_0x2d928d)[_0x26d1('0xb')](_0x57f9af,_0x4189a2);}function getTicket(_0x435931,_0x3f79f2,_0x1a6766,_0x43cbb3,_0x321f5a){logger['info'](_0x26d1('0xc'));var _0x5c1c3b=_[_0x26d1('0xd')]({'responder_id':_0x3f79f2['id'],'requester_id':_0x1a6766['id'],'name':util[_0x26d1('0xe')]('Caller\x20-\x20%s',_0x321f5a['calleridname']),'phone':_0x321f5a[_0x26d1('0xf')],'source':0x3,'priority':0x1,'status':0x2,'subject':intUtil[_0x26d1('0x10')](_0x43cbb3[_0x26d1('0x11')],_0x321f5a,'\x20'),'description':intUtil[_0x26d1('0x10')](_0x43cbb3[_0x26d1('0x12')],_0x321f5a,_0x26d1('0x13')),'tags':getTags(_0x43cbb3[_0x26d1('0x14')],'name')},getCustomFields(_0x43cbb3[_0x26d1('0x15')],_0x321f5a));_0x5c1c3b['custom_fields']=_[_0x26d1('0x16')](_[_0x26d1('0x17')](_0x5c1c3b[_0x26d1('0x18')],'id'),'value');return request({'uri':util[_0x26d1('0xe')]('%s/api/v2/tickets',_0x435931[_0x26d1('0x19')]),'method':_0x26d1('0x1a'),'body':_0x5c1c3b})['then'](function(_0x2fdefb){logger[_0x26d1('0x1b')](_0x26d1('0x1c'));return _0x2fdefb;});}function getUser(_0x3853dd,_0x16aeaf){if(intUtil['validateEmail'](_0x16aeaf)){return request({'uri':util[_0x26d1('0xe')]('%s/api/v2/agents',_0x3853dd[_0x26d1('0x19')]),'qs':{'email':_0x16aeaf}})['then'](function(_0x2bcc6a){if(_0x2bcc6a[_0x26d1('0x1d')]){logger[_0x26d1('0x1b')](_0x26d1('0x1e'));return _[_0x26d1('0x1f')](_0x2bcc6a,function(_0x56b28f){return _0x56b28f['contact']['email']===_0x16aeaf;});}else{logger[_0x26d1('0x1b')]('Agent\x20not\x20found,\x20using\x20the\x20admin\x20account!');return request({'uri':util[_0x26d1('0xe')](_0x26d1('0x20'),_0x3853dd['remoteUri'])})[_0x26d1('0x21')](function(_0x358a31){logger[_0x26d1('0x1b')](_0x26d1('0x22'));return _0x358a31;});}});}else{logger[_0x26d1('0x1b')](_0x26d1('0x23'));return request({'uri':util[_0x26d1('0xe')](_0x26d1('0x20'),_0x3853dd['remoteUri'])})[_0x26d1('0x21')](function(_0x2b2579){logger[_0x26d1('0x1b')](_0x26d1('0x22'));return _0x2b2579;});}}function getEndUser(_0xd14584,_0x52396b,_0x30bb6e){logger[_0x26d1('0x1b')](_0x26d1('0x24'),_0x30bb6e);return request({'uri':util['format'](_0x26d1('0x25'),_0xd14584[_0x26d1('0x19')]),'qs':{'phone':_0x30bb6e}})[_0x26d1('0x21')](function(_0x5efdda){if(_0x5efdda[_0x26d1('0x1d')]){logger['info'](_0x26d1('0x26'));return _[_0x26d1('0x1f')](_0x5efdda,{'phone':_0x30bb6e});}else{logger[_0x26d1('0x1b')](_0x26d1('0x27'));return request({'uri':util[_0x26d1('0xe')]('%s/api/v2/contacts',_0xd14584[_0x26d1('0x19')]),'method':_0x26d1('0x1a'),'body':{'name':_0x52396b,'phone':_0x30bb6e}})[_0x26d1('0x21')](function(_0x27d8e1){logger['info'](_0x26d1('0x28'));return _0x27d8e1;});}});}function getAuth(_0x33b562){return util[_0x26d1('0xe')](_0x26d1('0x29'),new Buffer(_0x33b562['apiKey']+':X')[_0x26d1('0x2a')](_0x26d1('0x2b')));}function request(_0x11b031){logger[_0x26d1('0x2c')](_0x26d1('0x2d'),JSON[_0x26d1('0x2e')](_0x11b031));return rp(_[_0x26d1('0x8')](_0x11b031,{'method':'GET','headers':headers,'json':!![]}));}function getTags(_0x97cd04,_0x302eb9){var _0x46d5f3=[];if(_0x97cd04&&_0x97cd04['length']>0x0){_0x46d5f3=_[_0x26d1('0x2f')](_0x97cd04,_0x302eb9);}return _0x46d5f3;}function getCustomFields(_0x317e1b,_0x30f388){var _0x232ec0=[];var _0x55e24f={'custom_fields':[]};if(_0x317e1b[_0x26d1('0x1d')]>0x0){_['forEach'](_0x317e1b,function(_0x442187){if(_0x442187[_0x26d1('0x30')]===_0x26d1('0x31')&&_0x442187['nameField']&&!_0x442187['customField']){_0x55e24f[_0x442187['nameField'][_0x26d1('0x32')]()]=_0x442187[_0x26d1('0x33')][_0x26d1('0x2a')]();}else if(_0x442187[_0x26d1('0x30')]===_0x26d1('0x31')&&_0x442187[_0x26d1('0x34')]&&_0x442187['customField']){_0x55e24f[_0x26d1('0x18')]['push']({'id':_0x442187[_0x26d1('0x34')],'value':_0x442187[_0x26d1('0x33')][_0x26d1('0x2a')]()});}else if(_0x442187['type']===_0x26d1('0x35')&&_0x442187[_0x26d1('0x36')]&&_0x442187[_0x26d1('0x34')]&&_0x442187[_0x26d1('0x37')]){_0x30f388[_0x442187[_0x26d1('0x36')]]&&_0x55e24f[_0x26d1('0x18')]['push']({'id':_0x442187[_0x26d1('0x34')],'value':_0x30f388[_0x442187['variableName']][_0x26d1('0x2a')]()});}else if(_0x442187[_0x26d1('0x30')]===_0x26d1('0x38')&&_0x442187[_0x26d1('0x39')]&&_0x442187[_0x26d1('0x39')][_0x26d1('0x3a')]&&_0x442187['idField']&&_0x442187[_0x26d1('0x37')]){_0x30f388[_0x442187[_0x26d1('0x39')][_0x26d1('0x3a')]['toLowerCase']()]&&_0x55e24f[_0x26d1('0x18')][_0x26d1('0x3b')]({'id':_0x442187[_0x26d1('0x34')],'value':_0x30f388[_0x442187[_0x26d1('0x39')][_0x26d1('0x3a')][_0x26d1('0x32')]()][_0x26d1('0x2a')]()});}});}return _0x55e24f;}exports[_0x26d1('0x3c')]=function(_0x153903,_0x5096bd,_0x47328a,_0x260975,_0x4f88ce,_0x23c0af){var _0x5eda26,_0x19f94b;_0x23c0af[_0x26d1('0x19')]=intUtil[_0x26d1('0x3d')](_0x23c0af[_0x26d1('0x19')]);_0x23c0af[_0x26d1('0x3e')]=intUtil['stripTrailingSlash'](_0x23c0af[_0x26d1('0x3e')]);if(_0x4f88ce&&_0x4f88ce[_0x26d1('0x3f')]){logger['info'](_0x26d1('0x40'),_0x26d1('0x41'));_0x5096bd['recordingURL']=util[_0x26d1('0xe')](_0x26d1('0x42'),_0x23c0af[_0x26d1('0x3e')],_0x5096bd[_0x26d1('0x43')],md5(_0x5096bd['uniqueid']));}else{_0x5096bd[_0x26d1('0x44')]='';}headers[_0x26d1('0x45')]=getAuth(_0x23c0af);return getUser(_0x23c0af,_0x260975[_0x26d1('0x46')])[_0x26d1('0x21')](function(_0x10165f){_0x5eda26=_0x10165f;logger['info'](_0x26d1('0x47'),_0x5eda26['id']);return getEndUser(_0x23c0af,_0x5096bd[_0x26d1('0x48')],_0x5096bd[_0x26d1('0xf')]);})[_0x26d1('0x21')](function(_0x457830){_0x19f94b=_0x457830;logger[_0x26d1('0x1b')](_0x26d1('0x49'),_0x19f94b['id']);return getTicket(_0x23c0af,_0x5eda26,_0x19f94b,_0x47328a,_0x5096bd);})[_0x26d1('0x21')](function(_0x182b33){if(_0x182b33&&_0x182b33['id']){logger[_0x26d1('0x1b')]('Ticket\x20created!');logger[_0x26d1('0x1b')](_0x26d1('0x4a'),_0x182b33['id']);logger['info'](_0x26d1('0x40'),_0x26d1('0x4b'));emit(util[_0x26d1('0xe')](_0x26d1('0x4c'),_0x260975['name']),_0x26d1('0x4d'),{'uri':util[_0x26d1('0xe')]('%s/helpdesk/tickets/%d',_0x23c0af[_0x26d1('0x19')],_0x182b33['id'])});}})[_0x26d1('0x4e')](function(_0x3f6866){logger[_0x26d1('0x4f')](_0x26d1('0x40'),JSON[_0x26d1('0x2e')](_0x3f6866));});};exports[_0x26d1('0x50')]=function(_0x29290a,_0x43aa6e,_0xd2698a,_0x3263bd,_0x242dac,_0x4095b1,_0x142581){var _0x50c763,_0x53ad44;_0x4095b1[_0x26d1('0x19')]=intUtil[_0x26d1('0x3d')](_0x4095b1['remoteUri']);_0x4095b1[_0x26d1('0x3e')]=intUtil['stripTrailingSlash'](_0x4095b1['serverUrl']);if(_0x142581&&_0x142581[_0x26d1('0x51')]&&_0x142581['recordingFormat']!=='none'){logger['info'](_0x26d1('0x52'),_0x26d1('0x41'));_0x43aa6e[_0x26d1('0x44')]=util['format']('%s/api/voice/recordings/%s/downloads?type=uniqueid&token=%s',_0x4095b1[_0x26d1('0x3e')],_0x43aa6e['uniqueid'],md5(_0x43aa6e[_0x26d1('0x43')]));}headers['Authorization']=getAuth(_0x4095b1);return getUser(_0x4095b1,_0x3263bd[_0x26d1('0x46')])[_0x26d1('0x21')](function(_0x44ea20){_0x50c763=_0x44ea20;logger[_0x26d1('0x1b')](_0x26d1('0x47'),_0x50c763['id']);return getEndUser(_0x4095b1,_0x43aa6e['destcalleridname'],_0x43aa6e['destcalleridnum']);})[_0x26d1('0x21')](function(_0x10fc4d){_0x53ad44=_0x10fc4d;logger[_0x26d1('0x1b')](_0x26d1('0x49'),_0x53ad44['id']);return getTicket(_0x4095b1,_0x50c763,_0x53ad44,_0xd2698a,_0x43aa6e);})[_0x26d1('0x21')](function(_0x2cb5d5){if(_0x2cb5d5&&_0x2cb5d5['id']){logger[_0x26d1('0x1b')](_0x26d1('0x1c'));logger[_0x26d1('0x1b')](_0x26d1('0x4a'),_0x2cb5d5['id']);logger[_0x26d1('0x1b')](_0x26d1('0x52'),_0x26d1('0x4b'));emit(util[_0x26d1('0xe')](_0x26d1('0x4c'),_0x3263bd[_0x26d1('0x3a')]),_0x26d1('0x4d'),{'uri':util[_0x26d1('0xe')](_0x26d1('0x53'),_0x4095b1[_0x26d1('0x19')],_0x2cb5d5['id'])});}})['catch'](function(_0x5d4231){logger['error'](_0x26d1('0x52'),JSON[_0x26d1('0x2e')](_0x5d4231));});};exports[_0x26d1('0x54')]=function(_0x1d8873,_0x1b809e,_0x2009de,_0xcffc4,_0x532a4a,_0x3543aa){var _0x566d42,_0x365013;_0x3543aa[_0x26d1('0x19')]=intUtil[_0x26d1('0x3d')](_0x3543aa['remoteUri']);_0x3543aa['serverUrl']=intUtil[_0x26d1('0x3d')](_0x3543aa[_0x26d1('0x3e')]);if(_0x532a4a&&_0x532a4a[_0x26d1('0x3f')]){logger[_0x26d1('0x1b')](_0x26d1('0x55'),_0x26d1('0x41'));_0x1b809e[_0x26d1('0x44')]=util['format']('%s/api/voice/recordings/%s/downloads?type=uniqueid&token=%s',_0x3543aa['serverUrl'],_0x1b809e[_0x26d1('0x43')],md5(_0x1b809e['uniqueid']));}else{_0x1b809e['recordingURL']='';}headers['Authorization']=getAuth(_0x3543aa);return getUser(_0x3543aa,'')[_0x26d1('0x21')](function(_0x2c538f){_0x566d42=_0x2c538f;logger[_0x26d1('0x1b')](_0x26d1('0x47'),_0x566d42['id']);return getEndUser(_0x3543aa,_0x1b809e[_0x26d1('0x48')],_0x1b809e[_0x26d1('0xf')]);})[_0x26d1('0x21')](function(_0x150a8b){_0x365013=_0x150a8b;logger[_0x26d1('0x1b')](_0x26d1('0x49'),_0x365013['id']);return getTicket(_0x3543aa,_0x566d42,_0x365013,_0x2009de,_0x1b809e);})[_0x26d1('0x21')](function(_0x22f305){if(_0x22f305){logger['info']('Ticket\x20created!');logger[_0x26d1('0x1b')](_0x26d1('0x4a'),_0x22f305['id']);}})[_0x26d1('0x4e')](function(_0x1c9ead){logger['error'](_0x26d1('0x55'),JSON[_0x26d1('0x2e')](_0x1c9ead));});};
\ No newline at end of file
+var _0xeb91=['Recording\x20is\x20enabled!','recordingURL','%s/api/voice/recordings/%s/downloads?type=uniqueid&token=%s','uniqueid','Authorization','calleridname','The\x20Enduser\x20ID\x20is:','Ticket\x20created!','Displaying\x20ticket\x20to\x20agent\x20in\x20a\x20new\x20tab...','trigger:browser:url','%s/helpdesk/tickets/%d','catch','outbound','recordingFormat','none','[OUTBOUND]','The\x20User\x20ID\x20is:','destcalleridname','destcalleridnum','The\x20Ticket\x20ID\x20is:','user:%s','abandoned','monitor_format','error','lodash','md5','util','ioredis','../../../../config/environment','../../../../config/logger','freshdesk','defaults','redis','localhost','socket.io-emitter','emit','info','Creating\x20new\x20ticket...','format','calleridnum','getString','Subjects','Descriptions',' ','Tags','name','Fields','mapValues','custom_fields','value','%s/api/v2/tickets','remoteUri','POST','then','%s/api/v2/agents','length','Agent\x20found!','find','email','Admin\x20account\x20selected.','Invalid\x20email\x20format,\x20using\x20the\x20admin\x20account!','%s/api/v2/contacts','Enduser\x20not\x20found,\x20creating\x20a\x20new\x20enduser!','Enduser\x20created.','toString','debug','[HTTP]','stringify','map','forEach','type','string','nameField','customField','content','idField','push','variable','variableName','Variable','queue','stripTrailingSlash','serverUrl','[QUEUE]'];(function(_0x571a2c,_0x55dbb0){var _0x1cc56a=function(_0x6d59d5){while(--_0x6d59d5){_0x571a2c['push'](_0x571a2c['shift']());}};_0x1cc56a(++_0x55dbb0);}(_0xeb91,0x6c));var _0x1eb9=function(_0x507b3b,_0x30c190){_0x507b3b=_0x507b3b-0x0;var _0xe1e48e=_0xeb91[_0x507b3b];return _0xe1e48e;};'use strict';var _=require(_0x1eb9('0x0'));var rp=require('request-promise');var md5=require(_0x1eb9('0x1'));var util=require(_0x1eb9('0x2'));var Redis=require(_0x1eb9('0x3'));var intUtil=require('./util');var config=require(_0x1eb9('0x4'));var logger=require(_0x1eb9('0x5'))(_0x1eb9('0x6'));config['redis']=_[_0x1eb9('0x7')](config[_0x1eb9('0x8')],{'host':_0x1eb9('0x9'),'port':0x18eb});var io=require(_0x1eb9('0xa'))(new Redis(config[_0x1eb9('0x8')]));var headers={'Content-Type':'application/json','Accept':'application/json'};function emit(_0x5a82ca,_0xd6eb6,_0x1c72c8){io['to'](_0x5a82ca)[_0x1eb9('0xb')](_0xd6eb6,_0x1c72c8);}function getTicket(_0x4fe22f,_0x9d9b8f,_0x14795f,_0xb9c6e7,_0x35aac8){logger[_0x1eb9('0xc')](_0x1eb9('0xd'));var _0x4434f4=_['merge']({'responder_id':_0x9d9b8f['id'],'requester_id':_0x14795f['id'],'name':util[_0x1eb9('0xe')]('Caller\x20-\x20%s',_0x35aac8['calleridname']),'phone':_0x35aac8[_0x1eb9('0xf')],'source':0x3,'priority':0x1,'status':0x2,'subject':intUtil[_0x1eb9('0x10')](_0xb9c6e7[_0x1eb9('0x11')],_0x35aac8,'\x20'),'description':intUtil[_0x1eb9('0x10')](_0xb9c6e7[_0x1eb9('0x12')],_0x35aac8,_0x1eb9('0x13')),'tags':getTags(_0xb9c6e7[_0x1eb9('0x14')],_0x1eb9('0x15'))},getCustomFields(_0xb9c6e7[_0x1eb9('0x16')],_0x35aac8));_0x4434f4['custom_fields']=_[_0x1eb9('0x17')](_['keyBy'](_0x4434f4[_0x1eb9('0x18')],'id'),_0x1eb9('0x19'));return request({'uri':util[_0x1eb9('0xe')](_0x1eb9('0x1a'),_0x4fe22f[_0x1eb9('0x1b')]),'method':_0x1eb9('0x1c'),'body':_0x4434f4})[_0x1eb9('0x1d')](function(_0x51cf30){logger[_0x1eb9('0xc')]('Ticket\x20created!');return _0x51cf30;});}function getUser(_0x43715a,_0x227abd){if(intUtil['validateEmail'](_0x227abd)){return request({'uri':util[_0x1eb9('0xe')](_0x1eb9('0x1e'),_0x43715a[_0x1eb9('0x1b')]),'qs':{'email':_0x227abd}})[_0x1eb9('0x1d')](function(_0x2e04bf){if(_0x2e04bf[_0x1eb9('0x1f')]){logger[_0x1eb9('0xc')](_0x1eb9('0x20'));return _[_0x1eb9('0x21')](_0x2e04bf,function(_0x42f846){return _0x42f846['contact'][_0x1eb9('0x22')]===_0x227abd;});}else{logger['info']('Agent\x20not\x20found,\x20using\x20the\x20admin\x20account!');return request({'uri':util[_0x1eb9('0xe')]('%s/api/v2/agents/me',_0x43715a['remoteUri'])})[_0x1eb9('0x1d')](function(_0x1b26c7){logger[_0x1eb9('0xc')](_0x1eb9('0x23'));return _0x1b26c7;});}});}else{logger[_0x1eb9('0xc')](_0x1eb9('0x24'));return request({'uri':util[_0x1eb9('0xe')]('%s/api/v2/agents/me',_0x43715a[_0x1eb9('0x1b')])})[_0x1eb9('0x1d')](function(_0x1a5377){logger[_0x1eb9('0xc')](_0x1eb9('0x23'));return _0x1a5377;});}}function getEndUser(_0x4b0237,_0x241500,_0x36e2cf){logger['info']('Searching\x20enduser\x20with\x20phone',_0x36e2cf);return request({'uri':util[_0x1eb9('0xe')](_0x1eb9('0x25'),_0x4b0237[_0x1eb9('0x1b')]),'qs':{'phone':_0x36e2cf}})[_0x1eb9('0x1d')](function(_0x3a274f){if(_0x3a274f[_0x1eb9('0x1f')]){logger[_0x1eb9('0xc')]('Enduser\x20found!');return _[_0x1eb9('0x21')](_0x3a274f,{'phone':_0x36e2cf});}else{logger[_0x1eb9('0xc')](_0x1eb9('0x26'));return request({'uri':util[_0x1eb9('0xe')](_0x1eb9('0x25'),_0x4b0237[_0x1eb9('0x1b')]),'method':_0x1eb9('0x1c'),'body':{'name':_0x241500,'phone':_0x36e2cf}})[_0x1eb9('0x1d')](function(_0x535a85){logger[_0x1eb9('0xc')](_0x1eb9('0x27'));return _0x535a85;});}});}function getAuth(_0x558c3a){return util[_0x1eb9('0xe')]('Basic\x20%s',new Buffer(_0x558c3a['apiKey']+':X')[_0x1eb9('0x28')]('base64'));}function request(_0x43844b){logger[_0x1eb9('0x29')](_0x1eb9('0x2a'),JSON[_0x1eb9('0x2b')](_0x43844b));return rp(_[_0x1eb9('0x7')](_0x43844b,{'method':'GET','headers':headers,'json':!![]}));}function getTags(_0x386486,_0x5388e6){var _0x4e8836=[];if(_0x386486&&_0x386486[_0x1eb9('0x1f')]>0x0){_0x4e8836=_[_0x1eb9('0x2c')](_0x386486,_0x5388e6);}return _0x4e8836;}function getCustomFields(_0x1cab61,_0x55b175){var _0xcf8780=[];var _0x234e8d={'custom_fields':[]};if(_0x1cab61[_0x1eb9('0x1f')]>0x0){_[_0x1eb9('0x2d')](_0x1cab61,function(_0x2234cb){if(_0x2234cb[_0x1eb9('0x2e')]===_0x1eb9('0x2f')&&_0x2234cb[_0x1eb9('0x30')]&&!_0x2234cb[_0x1eb9('0x31')]){_0x234e8d[_0x2234cb['nameField']['toLowerCase']()]=_0x2234cb[_0x1eb9('0x32')][_0x1eb9('0x28')]();}else if(_0x2234cb[_0x1eb9('0x2e')]===_0x1eb9('0x2f')&&_0x2234cb[_0x1eb9('0x33')]&&_0x2234cb['customField']){_0x234e8d['custom_fields'][_0x1eb9('0x34')]({'id':_0x2234cb[_0x1eb9('0x33')],'value':_0x2234cb['content'][_0x1eb9('0x28')]()});}else if(_0x2234cb[_0x1eb9('0x2e')]===_0x1eb9('0x35')&&_0x2234cb[_0x1eb9('0x36')]&&_0x2234cb['idField']&&_0x2234cb['customField']){_0x55b175[_0x2234cb['variableName']]&&_0x234e8d['custom_fields']['push']({'id':_0x2234cb[_0x1eb9('0x33')],'value':_0x55b175[_0x2234cb[_0x1eb9('0x36')]][_0x1eb9('0x28')]()});}else if(_0x2234cb[_0x1eb9('0x2e')]==='customVariable'&&_0x2234cb[_0x1eb9('0x37')]&&_0x2234cb[_0x1eb9('0x37')][_0x1eb9('0x15')]&&_0x2234cb['idField']&&_0x2234cb['customField']){_0x55b175[_0x2234cb['Variable'][_0x1eb9('0x15')]['toLowerCase']()]&&_0x234e8d[_0x1eb9('0x18')][_0x1eb9('0x34')]({'id':_0x2234cb[_0x1eb9('0x33')],'value':_0x55b175[_0x2234cb[_0x1eb9('0x37')][_0x1eb9('0x15')]['toLowerCase']()][_0x1eb9('0x28')]()});}});}return _0x234e8d;}exports[_0x1eb9('0x38')]=function(_0x4907f1,_0x4f6034,_0x1587fc,_0x248308,_0x31aabb,_0x3fa3ca){var _0x4d6acf,_0xdce671;_0x3fa3ca[_0x1eb9('0x1b')]=intUtil[_0x1eb9('0x39')](_0x3fa3ca[_0x1eb9('0x1b')]);_0x3fa3ca['serverUrl']=intUtil[_0x1eb9('0x39')](_0x3fa3ca[_0x1eb9('0x3a')]);if(_0x31aabb&&_0x31aabb['monitor_format']){logger[_0x1eb9('0xc')](_0x1eb9('0x3b'),_0x1eb9('0x3c'));_0x4f6034[_0x1eb9('0x3d')]=util[_0x1eb9('0xe')](_0x1eb9('0x3e'),_0x3fa3ca[_0x1eb9('0x3a')],_0x4f6034[_0x1eb9('0x3f')],md5(_0x4f6034[_0x1eb9('0x3f')]));}else{_0x4f6034[_0x1eb9('0x3d')]='';}headers[_0x1eb9('0x40')]=getAuth(_0x3fa3ca);return getUser(_0x3fa3ca,_0x248308[_0x1eb9('0x22')])[_0x1eb9('0x1d')](function(_0x31c643){_0x4d6acf=_0x31c643;logger[_0x1eb9('0xc')]('The\x20User\x20ID\x20is:',_0x4d6acf['id']);return getEndUser(_0x3fa3ca,_0x4f6034[_0x1eb9('0x41')],_0x4f6034['calleridnum']);})['then'](function(_0x53b269){_0xdce671=_0x53b269;logger[_0x1eb9('0xc')](_0x1eb9('0x42'),_0xdce671['id']);return getTicket(_0x3fa3ca,_0x4d6acf,_0xdce671,_0x1587fc,_0x4f6034);})['then'](function(_0x4193aa){if(_0x4193aa&&_0x4193aa['id']){logger['info'](_0x1eb9('0x43'));logger[_0x1eb9('0xc')]('The\x20Ticket\x20ID\x20is:',_0x4193aa['id']);logger[_0x1eb9('0xc')](_0x1eb9('0x3b'),_0x1eb9('0x44'));emit(util[_0x1eb9('0xe')]('user:%s',_0x248308[_0x1eb9('0x15')]),_0x1eb9('0x45'),{'uri':util[_0x1eb9('0xe')](_0x1eb9('0x46'),_0x3fa3ca[_0x1eb9('0x1b')],_0x4193aa['id'])});}})[_0x1eb9('0x47')](function(_0x1931fe){logger['error'](_0x1eb9('0x3b'),JSON[_0x1eb9('0x2b')](_0x1931fe));});};exports[_0x1eb9('0x48')]=function(_0x2fe8bd,_0x312200,_0x48dd35,_0xe9b9e9,_0x344788,_0x27f872,_0x53cf3b){var _0x5ed43a,_0x58bba0;_0x27f872[_0x1eb9('0x1b')]=intUtil[_0x1eb9('0x39')](_0x27f872['remoteUri']);_0x27f872['serverUrl']=intUtil[_0x1eb9('0x39')](_0x27f872[_0x1eb9('0x3a')]);if(_0x53cf3b&&_0x53cf3b[_0x1eb9('0x49')]&&_0x53cf3b['recordingFormat']!==_0x1eb9('0x4a')){logger[_0x1eb9('0xc')](_0x1eb9('0x4b'),_0x1eb9('0x3c'));_0x312200[_0x1eb9('0x3d')]=util[_0x1eb9('0xe')](_0x1eb9('0x3e'),_0x27f872[_0x1eb9('0x3a')],_0x312200['uniqueid'],md5(_0x312200[_0x1eb9('0x3f')]));}headers[_0x1eb9('0x40')]=getAuth(_0x27f872);return getUser(_0x27f872,_0xe9b9e9[_0x1eb9('0x22')])[_0x1eb9('0x1d')](function(_0x407b5b){_0x5ed43a=_0x407b5b;logger[_0x1eb9('0xc')](_0x1eb9('0x4c'),_0x5ed43a['id']);return getEndUser(_0x27f872,_0x312200[_0x1eb9('0x4d')],_0x312200[_0x1eb9('0x4e')]);})['then'](function(_0x259136){_0x58bba0=_0x259136;logger[_0x1eb9('0xc')](_0x1eb9('0x42'),_0x58bba0['id']);return getTicket(_0x27f872,_0x5ed43a,_0x58bba0,_0x48dd35,_0x312200);})[_0x1eb9('0x1d')](function(_0x50136f){if(_0x50136f&&_0x50136f['id']){logger[_0x1eb9('0xc')](_0x1eb9('0x43'));logger[_0x1eb9('0xc')](_0x1eb9('0x4f'),_0x50136f['id']);logger[_0x1eb9('0xc')](_0x1eb9('0x4b'),'Displaying\x20ticket\x20to\x20agent\x20in\x20a\x20new\x20tab...');emit(util[_0x1eb9('0xe')](_0x1eb9('0x50'),_0xe9b9e9[_0x1eb9('0x15')]),_0x1eb9('0x45'),{'uri':util[_0x1eb9('0xe')](_0x1eb9('0x46'),_0x27f872[_0x1eb9('0x1b')],_0x50136f['id'])});}})[_0x1eb9('0x47')](function(_0x43ce34){logger['error'](_0x1eb9('0x4b'),JSON[_0x1eb9('0x2b')](_0x43ce34));});};exports[_0x1eb9('0x51')]=function(_0xdb8ad,_0x5e92d2,_0x5f3386,_0x303c70,_0x70cd4f,_0x134a2e){var _0x2d4411,_0xc24c0a;_0x134a2e[_0x1eb9('0x1b')]=intUtil[_0x1eb9('0x39')](_0x134a2e[_0x1eb9('0x1b')]);_0x134a2e[_0x1eb9('0x3a')]=intUtil[_0x1eb9('0x39')](_0x134a2e[_0x1eb9('0x3a')]);if(_0x70cd4f&&_0x70cd4f[_0x1eb9('0x52')]){logger[_0x1eb9('0xc')]('[ABANDONED]',_0x1eb9('0x3c'));_0x5e92d2['recordingURL']=util['format']('%s/api/voice/recordings/%s/downloads?type=uniqueid&token=%s',_0x134a2e['serverUrl'],_0x5e92d2[_0x1eb9('0x3f')],md5(_0x5e92d2[_0x1eb9('0x3f')]));}else{_0x5e92d2[_0x1eb9('0x3d')]='';}headers[_0x1eb9('0x40')]=getAuth(_0x134a2e);return getUser(_0x134a2e,'')[_0x1eb9('0x1d')](function(_0x2fa2f6){_0x2d4411=_0x2fa2f6;logger[_0x1eb9('0xc')]('The\x20User\x20ID\x20is:',_0x2d4411['id']);return getEndUser(_0x134a2e,_0x5e92d2[_0x1eb9('0x41')],_0x5e92d2[_0x1eb9('0xf')]);})[_0x1eb9('0x1d')](function(_0x13229e){_0xc24c0a=_0x13229e;logger[_0x1eb9('0xc')](_0x1eb9('0x42'),_0xc24c0a['id']);return getTicket(_0x134a2e,_0x2d4411,_0xc24c0a,_0x5f3386,_0x5e92d2);})[_0x1eb9('0x1d')](function(_0x30e533){if(_0x30e533){logger[_0x1eb9('0xc')](_0x1eb9('0x43'));logger[_0x1eb9('0xc')](_0x1eb9('0x4f'),_0x30e533['id']);}})[_0x1eb9('0x47')](function(_0x2bdb53){logger[_0x1eb9('0x53')]('[ABANDONED]',JSON[_0x1eb9('0x2b')](_0x2bdb53));});};
\ 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 acb57dc..f934730 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 _0x69d9=['stripTrailingSlash','serverUrl','username','toLowerCase','destcalleridnum','callDirection','queue','outbound','%s/api/voice/recordings/%s/downloads?type=uniqueid&token=%s','uniqueid','monitor_format','Recording\x20is\x20enabled!','recordingURL','recordingFormat','none','[OUTBOUND]','The\x20ticket\x20ID\x20is:\x20%s','abandoned','Displaying\x20task\x20in\x20a\x20new\x20tab...','name',']\x20Error\x20running\x20Freshsales\x20integration','inspect','lodash','request-promise','md5','util','moment','bluebird','ioredis','./util','../../../../config/logger','freshsales','redis','defaults','localhost','GET','headers','Getting\x20admin\x20information','then','length','email','adminEmail','adminId','info','Admin\x20found:','Requested\x20Resource\x20not\x20Found','catch','message','/api/selector/owners','Getting\x20user\x20list','users','agentEmail','Getting\x20user\x20with\x20email','userEmail','userId','User\x20found:','Admin\x20selected','error','toUpperCase','/api/contacts/filters','Getting\x20contacts\x20filter','filters','forEach','All\x20Contacts','Getting\x20contact\x20list','/api/contacts/view/','Searching\x20contact\x20with\x20phone','contacts','find','work_number','mobile_number','contactNumber','endUserId','Contact\x20found:','Contact\x20created:','POST','/api/contacts','format','YYYY-MM-DDTHH:mm:ss','/api/tasks','getString','Subjects','Descriptions','add','ticketId','task','user:%s','Token\x20token=','apiKey','remoteUri'];(function(_0x1d2b17,_0x2ee296){var _0x36bc11=function(_0x13160a){while(--_0x13160a){_0x1d2b17['push'](_0x1d2b17['shift']());}};_0x36bc11(++_0x2ee296);}(_0x69d9,0x124));var _0x969d=function(_0x12a2a6,_0x374ff1){_0x12a2a6=_0x12a2a6-0x0;var _0x1754ae=_0x69d9[_0x12a2a6];return _0x1754ae;};'use strict';var _=require(_0x969d('0x0'));var rp=require(_0x969d('0x1'));var md5=require(_0x969d('0x2'));var util=require(_0x969d('0x3'));var moment=require(_0x969d('0x4'));var Promise=require(_0x969d('0x5'));var Redis=require(_0x969d('0x6'));var intUtil=require(_0x969d('0x7'));var config=require('../../../../config/environment');var logger=require(_0x969d('0x8'))(_0x969d('0x9'));config[_0x969d('0xa')]=_[_0x969d('0xb')](config[_0x969d('0xa')],{'host':_0x969d('0xc'),'port':0x18eb});var io=require('socket.io-emitter')(new Redis(config[_0x969d('0xa')]));function getAdminId(_0x4c49ba,_0x1e04fa,_0x4af55c,_0x14c770){return new Promise(function(_0xb6b5ae,_0x1b026a){var _0x1bc678=![];var _0x1c8a37={'method':_0x969d('0xd'),'uri':_0x14c770+'/api/selector/owners','json':!![]};_0x1c8a37[_0x969d('0xe')]=_0x4af55c;logger['info'](_0x969d('0xf'));return rp(_0x1c8a37)[_0x969d('0x10')](function(_0x595add){if(_0x595add){var _0x5dcef7=_0x595add['users'];var _0x12b9a0=null;for(_0x12b9a0=0x0;_0x12b9a0<_0x5dcef7[_0x969d('0x11')];_0x12b9a0++){if(_0x5dcef7[_0x12b9a0][_0x969d('0x12')]===_0x4c49ba[_0x969d('0x13')]){_0x4c49ba[_0x969d('0x14')]=_0x5dcef7[_0x12b9a0]['id'];_0x1bc678=!![];}}if(_0x1bc678){logger[_0x969d('0x15')](_0x969d('0x16'),_0x4c49ba[_0x969d('0x14')]);_0xb6b5ae(_0x4c49ba);}else{_0x1b026a({'statusCode':0x194,'message':_0x969d('0x17')});}}else{_0x1b026a({'statusCode':0x194,'message':_0x969d('0x17')});}})[_0x969d('0x18')](function(_0x36e981){logger['error']('['+[_0x1e04fa['toUpperCase']()]+']',_0x36e981[_0x969d('0x19')]);_0x1b026a(_0x36e981);});});}function getUser(_0x2652a1,_0x32d3ca,_0x4b48bd){return function(_0x35fa7d){return new Promise(function(_0x4327f5,_0x4ff00c){var _0x2d8264={'method':'GET','uri':_0x4b48bd+_0x969d('0x1a'),'json':!![]};_0x2d8264[_0x969d('0xe')]=_0x32d3ca;logger[_0x969d('0x15')](_0x969d('0x1b'));return rp(_0x2d8264)[_0x969d('0x10')](function(_0x55628e){if(_0x55628e){var _0x42d9a4=_0x55628e[_0x969d('0x1c')];var _0x5066d5=![];var _0x1684a3=null;if(_0x35fa7d[_0x969d('0x1d')]!==null){logger['info'](_0x969d('0x1e'),_0x35fa7d['agentEmail']);_0x35fa7d[_0x969d('0x1f')]=_0x35fa7d[_0x969d('0x1d')];for(_0x1684a3=0x0;_0x1684a3<_0x42d9a4[_0x969d('0x11')];_0x1684a3++){if(_0x42d9a4[_0x1684a3]['email']===_0x35fa7d[_0x969d('0x1d')]){_0x5066d5=!![];_0x35fa7d[_0x969d('0x20')]=_0x42d9a4[_0x1684a3]['id'];logger[_0x969d('0x15')](_0x969d('0x21'),_0x35fa7d[_0x969d('0x20')]);}}}if(!_0x5066d5){logger['info'](_0x969d('0x22'));_0x35fa7d['userEmail']=_0x35fa7d[_0x969d('0x13')];_0x35fa7d[_0x969d('0x20')]=_0x35fa7d['adminId'];_0x5066d5=!![];}if(_0x5066d5){_0x4327f5(_0x35fa7d);}else{_0x4ff00c({'statusCode':0x194,'message':'Requested\x20Resource\x20not\x20Found'});}}else{_0x4ff00c({'statusCode':0x194,'message':_0x969d('0x17')});}})['catch'](function(_0x3ac715){logger[_0x969d('0x23')]('['+[_0x2652a1[_0x969d('0x24')]()]+']',_0x3ac715[_0x969d('0x19')]);_0x4ff00c(_0x3ac715);});});};}function getEndUser(_0x576511,_0x495022,_0x3b7a57){return function(_0x336542){return new Promise(function(_0x142e6a,_0x47eb45){var _0x17449b=0x0;var _0x1905da={'method':'GET','uri':_0x3b7a57+_0x969d('0x25'),'json':!![]};_0x1905da['headers']=_0x495022;logger[_0x969d('0x15')](_0x969d('0x26'));return rp(_0x1905da)[_0x969d('0x10')](function(_0x3f8942){_0x3f8942[_0x969d('0x27')][_0x969d('0x28')](function(_0x4a035b){if(_0x4a035b['name']===_0x969d('0x29')){_0x17449b=_0x4a035b['id'];}});})[_0x969d('0x10')](function(){logger[_0x969d('0x15')](_0x969d('0x2a'));var _0x377ba8={'method':_0x969d('0xd'),'uri':_0x3b7a57+_0x969d('0x2b')+_0x17449b,'json':!![]};_0x377ba8[_0x969d('0xe')]=_0x495022;return rp(_0x377ba8);})['then'](function(_0x15b239){logger[_0x969d('0x15')](_0x969d('0x2c'),_0x336542['contactNumber']);if(_0x15b239[_0x969d('0x2d')][_0x969d('0x11')]>0x0){var _0x58d5c0=_[_0x969d('0x2e')](_0x15b239[_0x969d('0x2d')],function(_0x5bc971){if(_0x5bc971[_0x969d('0x2f')]===_0x336542['contactNumber']||_0x5bc971[_0x969d('0x30')]===_0x336542[_0x969d('0x31')]){return _0x5bc971;}});if(_0x58d5c0){_0x336542[_0x969d('0x32')]=_0x58d5c0['id'];logger[_0x969d('0x15')](_0x969d('0x33'),_0x336542['endUserId']);_0x142e6a(_0x336542);}else{return createEndUser(_0x336542,_0x576511,_0x495022,_0x3b7a57)[_0x969d('0x10')](function(_0x27491d){logger[_0x969d('0x15')](_0x969d('0x34'),_0x336542[_0x969d('0x32')]);_0x142e6a(_0x27491d);});}}else{return createEndUser(_0x336542,_0x576511,_0x495022,_0x3b7a57)[_0x969d('0x10')](function(_0x223c8b){logger[_0x969d('0x15')]('Contact\x20created:',_0x336542[_0x969d('0x32')]);_0x142e6a(_0x223c8b);});}})['catch'](function(_0x34da7d){throw new Error(_0x34da7d[_0x969d('0x19')]);});});};}function createEndUser(_0x2807fd,_0x1249e4,_0x4330c3,_0x4fe619){return new Promise(function(_0x2d3429,_0x3227d0){var _0x413664=moment();var _0x3afbdb={'method':_0x969d('0x35'),'uri':_0x4fe619+_0x969d('0x36'),'body':{'contact':{'last_name':_0x2807fd['contactNumber'],'work_number':_0x2807fd[_0x969d('0x31')],'mobile_number':_0x2807fd[_0x969d('0x31')],'owner_id':_0x2807fd[_0x969d('0x20')],'created_at':_0x413664[_0x969d('0x37')](_0x969d('0x38'))}},'json':!![]};_0x3afbdb['headers']=_0x4330c3;logger[_0x969d('0x15')]('Contact\x20not\x20found,\x20creating\x20a\x20new\x20contact');return rp(_0x3afbdb)[_0x969d('0x10')](function(_0x1a747f){_0x2807fd[_0x969d('0x32')]=_0x1a747f['contact']['id'];_0x2d3429(_0x2807fd);})['catch'](function(_0x3fa790){logger[_0x969d('0x23')]('['+[_0x1249e4[_0x969d('0x24')]()]+']',_0x3fa790[_0x969d('0x19')]);_0x3227d0(_0x3fa790[_0x969d('0x19')]);});});}function getTicket(_0x39611d,_0x416b8a,_0x2adc2d,_0x4bbee0,_0x1074d2){return function(_0x1da065){logger[_0x969d('0x15')]('Creating\x20new\x20task');return new Promise(function(_0x48ee60,_0x2ce9b7){var _0x41655b=moment();var _0x2b3e11={'method':_0x969d('0x35'),'uri':_0x2adc2d+_0x969d('0x39'),'body':{'title':intUtil[_0x969d('0x3a')](_0x4bbee0[_0x969d('0x3b')],_0x1074d2,'\x20'),'description':intUtil['getString'](_0x4bbee0[_0x969d('0x3c')],_0x1074d2,'\x0a'),'owner_id':_0x1da065[_0x969d('0x20')],'creater_id':_0x1da065[_0x969d('0x14')],'targetable_id':_0x1da065[_0x969d('0x32')],'targetable_type':'Contact','created_at':_0x41655b[_0x969d('0x37')]('YYYY-MM-DDTHH:mm:ss'),'due_date':_0x41655b[_0x969d('0x3d')](0x1e,'m')[_0x969d('0x37')](_0x969d('0x38'))},'json':!![]};_0x2b3e11[_0x969d('0xe')]=_0x416b8a;return rp(_0x2b3e11)['then'](function(_0x291035){_0x1da065[_0x969d('0x3e')]=_0x291035[_0x969d('0x3f')]['id'];logger[_0x969d('0x15')]('Task\x20created:',_0x1da065[_0x969d('0x3e')]);_0x48ee60(_0x1da065);})[_0x969d('0x18')](function(_0x325130){logger[_0x969d('0x23')]('['+[_0x39611d[_0x969d('0x24')]()]+']',_0x325130[_0x969d('0x19')]);_0x2ce9b7(_0x325130['message']);});});};}function emit(_0x58e0e5,_0x57df46,_0xf5dd87){var _0x126f00={'uri':_0x58e0e5+'/contacts/'+_0xf5dd87};io['to'](util[_0x969d('0x37')](_0x969d('0x40'),_0x57df46))['emit']('trigger:browser:url',_0x126f00);}exports['cs']=function(_0x8a4d2c,_0x12af5b,_0x370874,_0xdfce22,_0x3b2556,_0x3f161a,_0x2936e6,_0x3906ec){var _0x592d7b={};var _0x3a0750={'Authorization':_0x969d('0x41')+_0x3f161a[_0x969d('0x42')]};_0x3f161a[_0x969d('0x43')]=intUtil[_0x969d('0x44')](_0x3f161a['remoteUri']);_0x3f161a['serverUrl']=intUtil[_0x969d('0x44')](_0x3f161a[_0x969d('0x45')]);var _0x5965fa=_0x3f161a[_0x969d('0x43')];_0x592d7b['adminEmail']=_0x3f161a[_0x969d('0x46')];_0x592d7b[_0x969d('0x31')]=_0x3906ec[_0x969d('0x47')]()==='outbound'?_0x12af5b[_0x969d('0x48')]:_0x12af5b['calleridnum'];_0x592d7b[_0x969d('0x49')]=_0x3906ec===_0x969d('0x4a')||_0x3906ec==='abandoned'?_0x969d('0x4a'):_0x969d('0x4b');if(_0xdfce22){_0x592d7b['agentEmail']=_0xdfce22[_0x969d('0x12')];}var _0x39d5f8=util['format'](_0x969d('0x4c'),_0x3f161a['serverUrl'],_0x12af5b[_0x969d('0x4d')],md5(_0x12af5b[_0x969d('0x4d')]));if(_0x3b2556&&_0x3b2556[_0x969d('0x4e')]){logger[_0x969d('0x15')]('[QUEUE]',_0x969d('0x4f'));_0x12af5b[_0x969d('0x50')]=_0x39d5f8;}else if(_0x2936e6&&_0x2936e6['recordingFormat']&&_0x2936e6[_0x969d('0x51')]!==_0x969d('0x52')){logger[_0x969d('0x15')](_0x969d('0x53'),_0x969d('0x4f'));_0x12af5b['recordingURL']=_0x39d5f8;}else{_0x12af5b[_0x969d('0x50')]='';}return getAdminId(_0x592d7b,_0x3906ec,_0x3a0750,_0x5965fa)['then'](getUser(_0x3906ec,_0x3a0750,_0x5965fa))[_0x969d('0x10')](getEndUser(_0x3906ec,_0x3a0750,_0x5965fa))[_0x969d('0x10')](getTicket(_0x3906ec,_0x3a0750,_0x5965fa,_0x370874,_0x12af5b))[_0x969d('0x10')](function(_0x1ebdbe){logger[_0x969d('0x15')](util[_0x969d('0x37')](_0x969d('0x54'),_0x1ebdbe['ticketId']));if(_0x3906ec!==_0x969d('0x55')){logger[_0x969d('0x15')]('['+[_0x3906ec[_0x969d('0x24')]()]+']',_0x969d('0x56'));emit(_0x5965fa,_0xdfce22[_0x969d('0x57')],_0x1ebdbe[_0x969d('0x32')]);}})[_0x969d('0x18')](function(_0x144555){logger['error']('['+[_0x3906ec['toUpperCase']()]+_0x969d('0x58'),util[_0x969d('0x59')](_0x144555,{'showHidden':!![],'depth':null}));});};
\ No newline at end of file
+var _0x2760=[']\x20Error\x20running\x20Freshsales\x20integration','md5','util','moment','bluebird','ioredis','./util','../../../../config/environment','../../../../config/logger','redis','defaults','localhost','socket.io-emitter','headers','info','Getting\x20admin\x20information','then','users','length','email','adminEmail','adminId','Admin\x20found:','Requested\x20Resource\x20not\x20Found','catch','error','toUpperCase','GET','/api/selector/owners','Getting\x20user\x20list','agentEmail','userEmail','User\x20found:','userId','Admin\x20selected','message','/api/contacts/filters','filters','forEach','name','Getting\x20contact\x20list','/api/contacts/view/','Searching\x20contact\x20with\x20phone','find','contacts','contactNumber','mobile_number','endUserId','Contact\x20found:','Contact\x20created:','POST','/api/contacts','format','YYYY-MM-DDTHH:mm:ss','Contact\x20not\x20found,\x20creating\x20a\x20new\x20contact','contact','Creating\x20new\x20task','/api/tasks','getString','Subjects','Descriptions','Contact','add','ticketId','task','Task\x20created:','/contacts/','user:%s','trigger:browser:url','Token\x20token=','apiKey','remoteUri','serverUrl','stripTrailingSlash','username','outbound','destcalleridnum','calleridnum','queue','abandoned','%s/api/voice/recordings/%s/downloads?type=uniqueid&token=%s','monitor_format','[QUEUE]','recordingURL','recordingFormat','none','[OUTBOUND]'];(function(_0x189d12,_0x17aafc){var _0x39b0ad=function(_0x21a7de){while(--_0x21a7de){_0x189d12['push'](_0x189d12['shift']());}};_0x39b0ad(++_0x17aafc);}(_0x2760,0xaf));var _0x0276=function(_0x2ca9d4,_0x51d5c6){_0x2ca9d4=_0x2ca9d4-0x0;var _0x258956=_0x2760[_0x2ca9d4];return _0x258956;};'use strict';var _=require('lodash');var rp=require('request-promise');var md5=require(_0x0276('0x0'));var util=require(_0x0276('0x1'));var moment=require(_0x0276('0x2'));var Promise=require(_0x0276('0x3'));var Redis=require(_0x0276('0x4'));var intUtil=require(_0x0276('0x5'));var config=require(_0x0276('0x6'));var logger=require(_0x0276('0x7'))('freshsales');config[_0x0276('0x8')]=_[_0x0276('0x9')](config[_0x0276('0x8')],{'host':_0x0276('0xa'),'port':0x18eb});var io=require(_0x0276('0xb'))(new Redis(config['redis']));function getAdminId(_0x45365a,_0x42a300,_0x565a81,_0xf257bf){return new Promise(function(_0x5b2cdb,_0x3fb127){var _0x15ee18=![];var _0x44e44f={'method':'GET','uri':_0xf257bf+'/api/selector/owners','json':!![]};_0x44e44f[_0x0276('0xc')]=_0x565a81;logger[_0x0276('0xd')](_0x0276('0xe'));return rp(_0x44e44f)[_0x0276('0xf')](function(_0x1336f2){if(_0x1336f2){var _0x3d429e=_0x1336f2[_0x0276('0x10')];var _0x709883=null;for(_0x709883=0x0;_0x709883<_0x3d429e[_0x0276('0x11')];_0x709883++){if(_0x3d429e[_0x709883][_0x0276('0x12')]===_0x45365a[_0x0276('0x13')]){_0x45365a[_0x0276('0x14')]=_0x3d429e[_0x709883]['id'];_0x15ee18=!![];}}if(_0x15ee18){logger[_0x0276('0xd')](_0x0276('0x15'),_0x45365a[_0x0276('0x14')]);_0x5b2cdb(_0x45365a);}else{_0x3fb127({'statusCode':0x194,'message':'Requested\x20Resource\x20not\x20Found'});}}else{_0x3fb127({'statusCode':0x194,'message':_0x0276('0x16')});}})[_0x0276('0x17')](function(_0x5a7c40){logger[_0x0276('0x18')]('['+[_0x42a300[_0x0276('0x19')]()]+']',_0x5a7c40['message']);_0x3fb127(_0x5a7c40);});});}function getUser(_0x10285b,_0x2de2f5,_0x5e551f){return function(_0x34104e){return new Promise(function(_0xd64c6e,_0x31d619){var _0x2d03b4={'method':_0x0276('0x1a'),'uri':_0x5e551f+_0x0276('0x1b'),'json':!![]};_0x2d03b4[_0x0276('0xc')]=_0x2de2f5;logger[_0x0276('0xd')](_0x0276('0x1c'));return rp(_0x2d03b4)[_0x0276('0xf')](function(_0x5ebea9){if(_0x5ebea9){var _0xa3d5e6=_0x5ebea9['users'];var _0x27cd95=![];var _0x46bfc4=null;if(_0x34104e[_0x0276('0x1d')]!==null){logger[_0x0276('0xd')]('Getting\x20user\x20with\x20email',_0x34104e[_0x0276('0x1d')]);_0x34104e[_0x0276('0x1e')]=_0x34104e[_0x0276('0x1d')];for(_0x46bfc4=0x0;_0x46bfc4<_0xa3d5e6[_0x0276('0x11')];_0x46bfc4++){if(_0xa3d5e6[_0x46bfc4][_0x0276('0x12')]===_0x34104e[_0x0276('0x1d')]){_0x27cd95=!![];_0x34104e['userId']=_0xa3d5e6[_0x46bfc4]['id'];logger[_0x0276('0xd')](_0x0276('0x1f'),_0x34104e[_0x0276('0x20')]);}}}if(!_0x27cd95){logger[_0x0276('0xd')](_0x0276('0x21'));_0x34104e[_0x0276('0x1e')]=_0x34104e[_0x0276('0x13')];_0x34104e[_0x0276('0x20')]=_0x34104e[_0x0276('0x14')];_0x27cd95=!![];}if(_0x27cd95){_0xd64c6e(_0x34104e);}else{_0x31d619({'statusCode':0x194,'message':_0x0276('0x16')});}}else{_0x31d619({'statusCode':0x194,'message':_0x0276('0x16')});}})['catch'](function(_0x4c534f){logger[_0x0276('0x18')]('['+[_0x10285b[_0x0276('0x19')]()]+']',_0x4c534f[_0x0276('0x22')]);_0x31d619(_0x4c534f);});});};}function getEndUser(_0x10a2d0,_0x6cdbdb,_0x3fd250){return function(_0x7e5bfd){return new Promise(function(_0xfb61f6,_0x2289a0){var _0x5532e1=0x0;var _0x1316f8={'method':_0x0276('0x1a'),'uri':_0x3fd250+_0x0276('0x23'),'json':!![]};_0x1316f8[_0x0276('0xc')]=_0x6cdbdb;logger['info']('Getting\x20contacts\x20filter');return rp(_0x1316f8)['then'](function(_0x4c9b11){_0x4c9b11[_0x0276('0x24')][_0x0276('0x25')](function(_0x31ced2){if(_0x31ced2[_0x0276('0x26')]==='All\x20Contacts'){_0x5532e1=_0x31ced2['id'];}});})['then'](function(){logger['info'](_0x0276('0x27'));var _0x5665e6={'method':_0x0276('0x1a'),'uri':_0x3fd250+_0x0276('0x28')+_0x5532e1,'json':!![]};_0x5665e6['headers']=_0x6cdbdb;return rp(_0x5665e6);})['then'](function(_0x2eecb4){logger[_0x0276('0xd')](_0x0276('0x29'),_0x7e5bfd['contactNumber']);if(_0x2eecb4['contacts'][_0x0276('0x11')]>0x0){var _0x175844=_[_0x0276('0x2a')](_0x2eecb4[_0x0276('0x2b')],function(_0x273073){if(_0x273073['work_number']===_0x7e5bfd[_0x0276('0x2c')]||_0x273073[_0x0276('0x2d')]===_0x7e5bfd[_0x0276('0x2c')]){return _0x273073;}});if(_0x175844){_0x7e5bfd[_0x0276('0x2e')]=_0x175844['id'];logger[_0x0276('0xd')](_0x0276('0x2f'),_0x7e5bfd['endUserId']);_0xfb61f6(_0x7e5bfd);}else{return createEndUser(_0x7e5bfd,_0x10a2d0,_0x6cdbdb,_0x3fd250)[_0x0276('0xf')](function(_0x3cd844){logger[_0x0276('0xd')](_0x0276('0x30'),_0x7e5bfd[_0x0276('0x2e')]);_0xfb61f6(_0x3cd844);});}}else{return createEndUser(_0x7e5bfd,_0x10a2d0,_0x6cdbdb,_0x3fd250)[_0x0276('0xf')](function(_0x48e9b4){logger[_0x0276('0xd')](_0x0276('0x30'),_0x7e5bfd[_0x0276('0x2e')]);_0xfb61f6(_0x48e9b4);});}})[_0x0276('0x17')](function(_0x5717d3){throw new Error(_0x5717d3[_0x0276('0x22')]);});});};}function createEndUser(_0x2a33b0,_0x5c527b,_0x2ae801,_0x40fd31){return new Promise(function(_0x145a2d,_0x1089f0){var _0x106d2f=moment();var _0x3ea88b={'method':_0x0276('0x31'),'uri':_0x40fd31+_0x0276('0x32'),'body':{'contact':{'last_name':_0x2a33b0[_0x0276('0x2c')],'work_number':_0x2a33b0[_0x0276('0x2c')],'mobile_number':_0x2a33b0[_0x0276('0x2c')],'owner_id':_0x2a33b0[_0x0276('0x20')],'created_at':_0x106d2f[_0x0276('0x33')](_0x0276('0x34'))}},'json':!![]};_0x3ea88b[_0x0276('0xc')]=_0x2ae801;logger['info'](_0x0276('0x35'));return rp(_0x3ea88b)[_0x0276('0xf')](function(_0x1eb44f){_0x2a33b0[_0x0276('0x2e')]=_0x1eb44f[_0x0276('0x36')]['id'];_0x145a2d(_0x2a33b0);})['catch'](function(_0x1768ba){logger['error']('['+[_0x5c527b[_0x0276('0x19')]()]+']',_0x1768ba[_0x0276('0x22')]);_0x1089f0(_0x1768ba[_0x0276('0x22')]);});});}function getTicket(_0x5a32bd,_0x29ae17,_0x1593fd,_0x186a7d,_0x5da4f1){return function(_0x5cd5ca){logger[_0x0276('0xd')](_0x0276('0x37'));return new Promise(function(_0x3ae018,_0x373a72){var _0x3c9e45=moment();var _0x3e6da1={'method':_0x0276('0x31'),'uri':_0x1593fd+_0x0276('0x38'),'body':{'title':intUtil[_0x0276('0x39')](_0x186a7d[_0x0276('0x3a')],_0x5da4f1,'\x20'),'description':intUtil[_0x0276('0x39')](_0x186a7d[_0x0276('0x3b')],_0x5da4f1,'\x0a'),'owner_id':_0x5cd5ca['userId'],'creater_id':_0x5cd5ca[_0x0276('0x14')],'targetable_id':_0x5cd5ca['endUserId'],'targetable_type':_0x0276('0x3c'),'created_at':_0x3c9e45[_0x0276('0x33')](_0x0276('0x34')),'due_date':_0x3c9e45[_0x0276('0x3d')](0x1e,'m')[_0x0276('0x33')](_0x0276('0x34'))},'json':!![]};_0x3e6da1['headers']=_0x29ae17;return rp(_0x3e6da1)['then'](function(_0x4e2524){_0x5cd5ca[_0x0276('0x3e')]=_0x4e2524[_0x0276('0x3f')]['id'];logger['info'](_0x0276('0x40'),_0x5cd5ca['ticketId']);_0x3ae018(_0x5cd5ca);})[_0x0276('0x17')](function(_0x2ff84f){logger[_0x0276('0x18')]('['+[_0x5a32bd[_0x0276('0x19')]()]+']',_0x2ff84f[_0x0276('0x22')]);_0x373a72(_0x2ff84f[_0x0276('0x22')]);});});};}function emit(_0x5b10c7,_0x291984,_0x1ac991){var _0x47e446={'uri':_0x5b10c7+_0x0276('0x41')+_0x1ac991};io['to'](util[_0x0276('0x33')](_0x0276('0x42'),_0x291984))['emit'](_0x0276('0x43'),_0x47e446);}exports['cs']=function(_0x1b62c1,_0x5cd98a,_0x24e73e,_0x2bcf8a,_0x4f6a80,_0x1ef869,_0x710b09,_0x4fa12c){var _0x17cd1e={};var _0x392b7e={'Authorization':_0x0276('0x44')+_0x1ef869[_0x0276('0x45')]};_0x1ef869[_0x0276('0x46')]=intUtil['stripTrailingSlash'](_0x1ef869[_0x0276('0x46')]);_0x1ef869[_0x0276('0x47')]=intUtil[_0x0276('0x48')](_0x1ef869[_0x0276('0x47')]);var _0x4566a1=_0x1ef869[_0x0276('0x46')];_0x17cd1e[_0x0276('0x13')]=_0x1ef869[_0x0276('0x49')];_0x17cd1e[_0x0276('0x2c')]=_0x4fa12c['toLowerCase']()===_0x0276('0x4a')?_0x5cd98a[_0x0276('0x4b')]:_0x5cd98a[_0x0276('0x4c')];_0x17cd1e['callDirection']=_0x4fa12c===_0x0276('0x4d')||_0x4fa12c===_0x0276('0x4e')?_0x0276('0x4d'):'outbound';if(_0x2bcf8a){_0x17cd1e[_0x0276('0x1d')]=_0x2bcf8a[_0x0276('0x12')];}var _0x5ad338=util[_0x0276('0x33')](_0x0276('0x4f'),_0x1ef869[_0x0276('0x47')],_0x5cd98a['uniqueid'],md5(_0x5cd98a['uniqueid']));if(_0x4f6a80&&_0x4f6a80[_0x0276('0x50')]){logger[_0x0276('0xd')](_0x0276('0x51'),'Recording\x20is\x20enabled!');_0x5cd98a[_0x0276('0x52')]=_0x5ad338;}else if(_0x710b09&&_0x710b09['recordingFormat']&&_0x710b09[_0x0276('0x53')]!==_0x0276('0x54')){logger[_0x0276('0xd')](_0x0276('0x55'),'Recording\x20is\x20enabled!');_0x5cd98a[_0x0276('0x52')]=_0x5ad338;}else{_0x5cd98a[_0x0276('0x52')]='';}return getAdminId(_0x17cd1e,_0x4fa12c,_0x392b7e,_0x4566a1)['then'](getUser(_0x4fa12c,_0x392b7e,_0x4566a1))[_0x0276('0xf')](getEndUser(_0x4fa12c,_0x392b7e,_0x4566a1))['then'](getTicket(_0x4fa12c,_0x392b7e,_0x4566a1,_0x24e73e,_0x5cd98a))['then'](function(_0xc52085){logger['info'](util[_0x0276('0x33')]('The\x20ticket\x20ID\x20is:\x20%s',_0xc52085[_0x0276('0x3e')]));if(_0x4fa12c!==_0x0276('0x4e')){logger[_0x0276('0xd')]('['+[_0x4fa12c[_0x0276('0x19')]()]+']','Displaying\x20task\x20in\x20a\x20new\x20tab...');emit(_0x4566a1,_0x2bcf8a[_0x0276('0x26')],_0xc52085[_0x0276('0x2e')]);}})[_0x0276('0x17')](function(_0x220a89){logger['error']('['+[_0x4fa12c[_0x0276('0x19')]()]+_0x0276('0x56'),util['inspect'](_0x220a89,{'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 7d15182..2343eb3 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 _0xa9e0=['./vtiger','./servicenow','./dynamics365','./freshsales','salesforce','sugarcrm','freshdesk','vtiger','servicenow','exec','toLowerCase','data1','data2','find','Configurations','data3','queue','routeId','log','abandoned','zendesk','zoho','desk','freshsales','dynamics365','unknown\x20integration','../../../../config/logger','error','[EXEC]','%s\x20configuration\x20#%s\x20not\x20found','format','%s\x20account\x20#%s\x20not\x20found','lodash','util','./zendesk','./freshdesk','./desk'];(function(_0x41f449,_0x149775){var _0x42f471=function(_0x209156){while(--_0x209156){_0x41f449['push'](_0x41f449['shift']());}};_0x42f471(++_0x149775);}(_0xa9e0,0x123));var _0x0a9e=function(_0x40ac5e,_0x2de228){_0x40ac5e=_0x40ac5e-0x0;var _0x2839d6=_0xa9e0[_0x40ac5e];return _0x2839d6;};'use strict';var _=require(_0x0a9e('0x0'));var util=require(_0x0a9e('0x1'));var zendesk=require(_0x0a9e('0x2'));var salesforce=require('./salesforce');var sugarcrm=require('./sugarcrm');var freshdesk=require(_0x0a9e('0x3'));var zoho=require('./zoho');var desk=require(_0x0a9e('0x4'));var vtiger=require(_0x0a9e('0x5'));var servicenow=require(_0x0a9e('0x6'));var dynamics365=require(_0x0a9e('0x7'));var freshsales=require(_0x0a9e('0x8'));var integrations=['zendesk',_0x0a9e('0x9'),_0x0a9e('0xa'),_0x0a9e('0xb'),'zoho','desk',_0x0a9e('0xc'),'dynamics365','freshsales',_0x0a9e('0xd')];exports[_0x0a9e('0xe')]=function(_0x307b3e,_0x3ab53f,_0xfeb75b,_0xbd1168,_0x4a4c56,_0x50dfb2){if(_0xfeb75b){if(_['includes'](integrations,_0x307b3e['data1'][_0x0a9e('0xf')]())){try{var _0x36471c=null;var _0xd5b662='';var _0x26d672=_0xfeb75b[_0x307b3e[_0x0a9e('0x10')][_0x0a9e('0xf')]()];if(_0x26d672){var _0x5db4b0=_0x26d672[_0x307b3e[_0x0a9e('0x11')]];if(_0x5db4b0){var _0x239b12=_[_0x0a9e('0x12')](_0x5db4b0[_0x0a9e('0x13')],{'id':parseInt(_0x307b3e[_0x0a9e('0x14')],0xa)});if(_0x239b12){if(_0xbd1168){if(_0x4a4c56&&_0x3ab53f[_0x0a9e('0x15')]){_0xd5b662='queue';}else if(_0x3ab53f[_0x0a9e('0x16')]){_0xd5b662='outbound';}else{console[_0x0a9e('0x17')]('EVENT\x20UNKNOWN',_0x3ab53f);}}else{_0xd5b662=_0x0a9e('0x18');}switch(_0x307b3e[_0x0a9e('0x10')]['toLowerCase']()){case _0x0a9e('0x19'):zendesk[_0xd5b662](_0x307b3e,_0x3ab53f,_0x239b12,_0xbd1168,_0x4a4c56,_0x5db4b0,_0x50dfb2);break;case'salesforce':salesforce[_0xd5b662](_0x307b3e,_0x3ab53f,_0x239b12,_0xbd1168,_0x4a4c56,_0x5db4b0,_0x50dfb2);break;case _0x0a9e('0xa'):sugarcrm[_0xd5b662](_0x307b3e,_0x3ab53f,_0x239b12,_0xbd1168,_0x4a4c56,_0x5db4b0,_0x50dfb2);break;case _0x0a9e('0xb'):freshdesk[_0xd5b662](_0x307b3e,_0x3ab53f,_0x239b12,_0xbd1168,_0x4a4c56,_0x5db4b0,_0x50dfb2);break;case _0x0a9e('0x1a'):zoho[_0xd5b662](_0x307b3e,_0x3ab53f,_0x239b12,_0xbd1168,_0x4a4c56,_0x5db4b0,_0x50dfb2);break;case _0x0a9e('0x1b'):desk[_0xd5b662](_0x307b3e,_0x3ab53f,_0x239b12,_0xbd1168,_0x4a4c56,_0x5db4b0,_0x50dfb2);break;case _0x0a9e('0xc'):vtiger[_0xd5b662](_0x307b3e,_0x3ab53f,_0x239b12,_0xbd1168,_0x4a4c56,_0x5db4b0,_0x50dfb2);break;case _0x0a9e('0x1c'):freshsales['cs'](_0x307b3e,_0x3ab53f,_0x239b12,_0xbd1168,_0x4a4c56,_0x5db4b0,_0x50dfb2,_0xd5b662);case _0x0a9e('0xd'):servicenow['cs'](_0x307b3e,_0x3ab53f,_0x239b12,_0xbd1168,_0x4a4c56,_0x5db4b0,_0x50dfb2,_0xd5b662);break;case _0x0a9e('0x1d'):dynamics365['cs'](_0x307b3e,_0x3ab53f,_0x239b12,_0xbd1168,_0x4a4c56,_0x5db4b0,_0x50dfb2,_0xd5b662);break;default:console[_0x0a9e('0x17')](_0x0a9e('0x1e'));}}else{_0x36471c=require(_0x0a9e('0x1f'))(_0x307b3e[_0x0a9e('0x10')]['toLowerCase']());_0x36471c[_0x0a9e('0x20')](_0x0a9e('0x21'),util['format'](_0x0a9e('0x22'),_0x307b3e['data1']['toLowerCase'](),_0x307b3e[_0x0a9e('0x14')]));}}else{_0x36471c=require(_0x0a9e('0x1f'))(_0x307b3e[_0x0a9e('0x10')][_0x0a9e('0xf')]());_0x36471c['error'](_0x0a9e('0x21'),util[_0x0a9e('0x23')](_0x0a9e('0x24'),_0x307b3e[_0x0a9e('0x10')][_0x0a9e('0xf')](),_0x307b3e[_0x0a9e('0x11')]));}}else{}}catch(_0x16b1ca){console['error'](_0x16b1ca);}}}};
\ No newline at end of file
+var _0xa9e0=['./vtiger','./servicenow','./dynamics365','./freshsales','salesforce','sugarcrm','freshdesk','vtiger','servicenow','exec','toLowerCase','data1','data2','find','Configurations','data3','queue','routeId','log','abandoned','zendesk','zoho','desk','freshsales','dynamics365','unknown\x20integration','../../../../config/logger','error','[EXEC]','%s\x20configuration\x20#%s\x20not\x20found','format','%s\x20account\x20#%s\x20not\x20found','lodash','util','./zendesk','./freshdesk','./desk'];(function(_0x1b50ea,_0xe00575){var _0x1dc125=function(_0x313dd4){while(--_0x313dd4){_0x1b50ea['push'](_0x1b50ea['shift']());}};_0x1dc125(++_0xe00575);}(_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 zendesk=require(_0x0a9e('0x2'));var salesforce=require('./salesforce');var sugarcrm=require('./sugarcrm');var freshdesk=require(_0x0a9e('0x3'));var zoho=require('./zoho');var desk=require(_0x0a9e('0x4'));var vtiger=require(_0x0a9e('0x5'));var servicenow=require(_0x0a9e('0x6'));var dynamics365=require(_0x0a9e('0x7'));var freshsales=require(_0x0a9e('0x8'));var integrations=['zendesk',_0x0a9e('0x9'),_0x0a9e('0xa'),_0x0a9e('0xb'),'zoho','desk',_0x0a9e('0xc'),'dynamics365','freshsales',_0x0a9e('0xd')];exports[_0x0a9e('0xe')]=function(_0x307b3e,_0x3ab53f,_0xfeb75b,_0xbd1168,_0x4a4c56,_0x50dfb2){if(_0xfeb75b){if(_['includes'](integrations,_0x307b3e['data1'][_0x0a9e('0xf')]())){try{var _0x36471c=null;var _0xd5b662='';var _0x26d672=_0xfeb75b[_0x307b3e[_0x0a9e('0x10')][_0x0a9e('0xf')]()];if(_0x26d672){var _0x5db4b0=_0x26d672[_0x307b3e[_0x0a9e('0x11')]];if(_0x5db4b0){var _0x239b12=_[_0x0a9e('0x12')](_0x5db4b0[_0x0a9e('0x13')],{'id':parseInt(_0x307b3e[_0x0a9e('0x14')],0xa)});if(_0x239b12){if(_0xbd1168){if(_0x4a4c56&&_0x3ab53f[_0x0a9e('0x15')]){_0xd5b662='queue';}else if(_0x3ab53f[_0x0a9e('0x16')]){_0xd5b662='outbound';}else{console[_0x0a9e('0x17')]('EVENT\x20UNKNOWN',_0x3ab53f);}}else{_0xd5b662=_0x0a9e('0x18');}switch(_0x307b3e[_0x0a9e('0x10')]['toLowerCase']()){case _0x0a9e('0x19'):zendesk[_0xd5b662](_0x307b3e,_0x3ab53f,_0x239b12,_0xbd1168,_0x4a4c56,_0x5db4b0,_0x50dfb2);break;case'salesforce':salesforce[_0xd5b662](_0x307b3e,_0x3ab53f,_0x239b12,_0xbd1168,_0x4a4c56,_0x5db4b0,_0x50dfb2);break;case _0x0a9e('0xa'):sugarcrm[_0xd5b662](_0x307b3e,_0x3ab53f,_0x239b12,_0xbd1168,_0x4a4c56,_0x5db4b0,_0x50dfb2);break;case _0x0a9e('0xb'):freshdesk[_0xd5b662](_0x307b3e,_0x3ab53f,_0x239b12,_0xbd1168,_0x4a4c56,_0x5db4b0,_0x50dfb2);break;case _0x0a9e('0x1a'):zoho[_0xd5b662](_0x307b3e,_0x3ab53f,_0x239b12,_0xbd1168,_0x4a4c56,_0x5db4b0,_0x50dfb2);break;case _0x0a9e('0x1b'):desk[_0xd5b662](_0x307b3e,_0x3ab53f,_0x239b12,_0xbd1168,_0x4a4c56,_0x5db4b0,_0x50dfb2);break;case _0x0a9e('0xc'):vtiger[_0xd5b662](_0x307b3e,_0x3ab53f,_0x239b12,_0xbd1168,_0x4a4c56,_0x5db4b0,_0x50dfb2);break;case _0x0a9e('0x1c'):freshsales['cs'](_0x307b3e,_0x3ab53f,_0x239b12,_0xbd1168,_0x4a4c56,_0x5db4b0,_0x50dfb2,_0xd5b662);case _0x0a9e('0xd'):servicenow['cs'](_0x307b3e,_0x3ab53f,_0x239b12,_0xbd1168,_0x4a4c56,_0x5db4b0,_0x50dfb2,_0xd5b662);break;case _0x0a9e('0x1d'):dynamics365['cs'](_0x307b3e,_0x3ab53f,_0x239b12,_0xbd1168,_0x4a4c56,_0x5db4b0,_0x50dfb2,_0xd5b662);break;default:console[_0x0a9e('0x17')](_0x0a9e('0x1e'));}}else{_0x36471c=require(_0x0a9e('0x1f'))(_0x307b3e[_0x0a9e('0x10')]['toLowerCase']());_0x36471c[_0x0a9e('0x20')](_0x0a9e('0x21'),util['format'](_0x0a9e('0x22'),_0x307b3e['data1']['toLowerCase'](),_0x307b3e[_0x0a9e('0x14')]));}}else{_0x36471c=require(_0x0a9e('0x1f'))(_0x307b3e[_0x0a9e('0x10')][_0x0a9e('0xf')]());_0x36471c['error'](_0x0a9e('0x21'),util[_0x0a9e('0x23')](_0x0a9e('0x24'),_0x307b3e[_0x0a9e('0x10')][_0x0a9e('0xf')](),_0x307b3e[_0x0a9e('0x11')]));}}else{}}catch(_0x16b1ca){console['error'](_0x16b1ca);}}}};
\ 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 1f34694..bb5c25d 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 _0xac2c=['Recording\x20is\x20enabled!','email','destcalleridname','destcalleridnum','[OUTBOUND]\x20Displaying\x20ticket\x20%s\x20to\x20agent\x20%s.\x20Integration\x20account\x20type\x20%s.','user:%s','error','Salesforce\x20account\x20type\x20not\x20recognized','catch','abandoned','[ABANDONED]','calleridname','[ABANDONED]\x20Integration\x20account\x20type\x20%s.','lodash','request-promise','moment','bluebird','md5','jsforce','util','./util','salesforce','redis','defaults','localhost','emit','ticketType','Task','assign','utc','Subjects','getString','Descriptions','WhoId','Case','isNil','validateEmail','User','execute','then','length','find','Email','info','resolve','Name','Agent\x20%s\x20not\x20found.\x20Switch\x20to\x20the\x20admin\x20account.','user_id','display_name','identity','Searching\x20enduser\x20with\x20phone\x20%s.\x20Serching\x20method\x20used\x20%s.','moduleSearch','sobject','Contact','Lead','contact','lead','Phone','Enduser\x20with\x20phone\x20%s\x20found.','Enduser\x20with\x20phone\x20%s\x20not\x20found.','Caller\x20-\x20%s','moduleCreate','Enduser\x20with\x20phone\x20%s.\x20Creating\x20method\x20used\x20%s.','upperFirst','create','forEach','type','string','idField','toString','variable','variableName','customVariable','Variable','name','password','securityToken','remoteUri','clientId','clientSecret','Connection\x20established.','serverUrl','stripTrailingSlash','monitor_format','[QUEUE]','format','%s/api/voice/recordings/%s/downloads?type=uniqueid&token=%s','uniqueid','recordingURL','calleridnum','Fields','queue','[QUEUE]\x20Ticket\x20%s\x20created','integrationTab','trigger:salesforce:display','newTab','trigger:browser:url','%s/%s/e','instanceUrl','stringify','outbound','recordingFormat','none','[OUTBOUND]'];(function(_0x1400d6,_0x41598f){var _0x20c7c0=function(_0x540e5d){while(--_0x540e5d){_0x1400d6['push'](_0x1400d6['shift']());}};_0x20c7c0(++_0x41598f);}(_0xac2c,0x1ad));var _0xcac2=function(_0x407a3e,_0x15acb0){_0x407a3e=_0x407a3e-0x0;var _0x129fe3=_0xac2c[_0x407a3e];return _0x129fe3;};'use strict';var _=require(_0xcac2('0x0'));var rp=require(_0xcac2('0x1'));var moment=require(_0xcac2('0x2'));var BPromise=require(_0xcac2('0x3'));var md5=require(_0xcac2('0x4'));var jsforce=require(_0xcac2('0x5'));var util=require(_0xcac2('0x6'));var Redis=require('ioredis');var intUtil=require(_0xcac2('0x7'));var config=require('../../../../config/environment');var logger=require('../../../../config/logger')(_0xcac2('0x8'));config[_0xcac2('0x9')]=_[_0xcac2('0xa')](config['redis'],{'host':_0xcac2('0xb'),'port':0x18eb});var io=require('socket.io-emitter')(new Redis(config['redis']));function emit(_0x21c693,_0xa2b419,_0x33a59c){io['to'](_0x21c693)[_0xcac2('0xc')](_0xa2b419,_0x33a59c);}function getTicket(_0x42f4de,_0x345100,_0x3c39ea,_0x2d38f9,_0x51b3bb,_0x15887a,_0x6badd4,_0x11ba06){var _0x57b330={};if(_0x2d38f9[_0xcac2('0xd')]===_0xcac2('0xe')){_0x57b330=Object[_0xcac2('0xf')]({},{'OwnerId':_0x345100['id'],'ActivityDate':moment[_0xcac2('0x10')](),'IsReminderSet':![],'IsRecurrence':![],'Subject':intUtil['getString'](_0x2d38f9[_0xcac2('0x11')],_0x51b3bb,'\x20'),'Description':intUtil[_0xcac2('0x12')](_0x2d38f9[_0xcac2('0x13')],_0x51b3bb,'\x0a')},getCustomFields(_0x15887a,_0x51b3bb));if(_0x3c39ea){_0x57b330[_0xcac2('0x14')]=_0x3c39ea['id'];}}else if(_0x2d38f9[_0xcac2('0xd')]===_0xcac2('0x15')){_0x57b330=Object[_0xcac2('0xf')]({},{'OwnerId':_0x345100['id'],'Subject':intUtil['getString'](_0x2d38f9[_0xcac2('0x11')],_0x51b3bb,'\x20'),'Description':intUtil[_0xcac2('0x12')](_0x2d38f9[_0xcac2('0x13')],_0x51b3bb,'\x0a')},getCustomFields(_0x15887a,_0x51b3bb));if(_0x3c39ea){_0x57b330['ContactId']=_0x3c39ea['id'];}}return _0x6badd4['sobject'](_0x2d38f9[_0xcac2('0xd')])['create'](_0x57b330);}function getUser(_0x153238,_0x3dc489,_0x5d2e30){if(!_[_0xcac2('0x16')](_0x3dc489)&&intUtil[_0xcac2('0x17')](_0x3dc489)){var _0xaaf5e7={'Email':_0x3dc489};var _0x5c2b47={'Id':!![],'Username':!![],'Name':!![],'Email':!![]};return _0x5d2e30['sobject'](_0xcac2('0x18'))['find'](_0xaaf5e7,_0x5c2b47)[_0xcac2('0x19')]()[_0xcac2('0x1a')](function(_0x112d03){if(_0x112d03[_0xcac2('0x1b')]){var _0x3ebc5c=_[_0xcac2('0x1c')](_0x112d03,function(_0x1be2d6){return _0x1be2d6[_0xcac2('0x1d')]===_0x3dc489;});if(_0x3ebc5c){logger[_0xcac2('0x1e')]('Agent\x20%s\x20found.',_0x3dc489);return BPromise[_0xcac2('0x1f')]({'id':_0x3ebc5c['Id'],'name':_0x3ebc5c[_0xcac2('0x20')]});}}else{logger['info'](_0xcac2('0x21'),_0x3dc489);return _0x5d2e30['identity']()[_0xcac2('0x1a')](function(_0x4f9881){return BPromise['resolve']({'id':_0x4f9881[_0xcac2('0x22')],'name':_0x4f9881[_0xcac2('0x23')]});});}});}else{logger[_0xcac2('0x1e')]('Agent\x20%s\x20not\x20found.\x20Switch\x20to\x20the\x20admin\x20account.',_0x3dc489);return _0x5d2e30[_0xcac2('0x24')]()['then'](function(_0x3c5ba9){return BPromise[_0xcac2('0x1f')]({'id':_0x3c5ba9['user_id'],'name':_0x3c5ba9[_0xcac2('0x23')]});});}}function getEndUser(_0x354ac5,_0x3b333c,_0x4244e7,_0x443169,_0x4d5649){var _0x2e3bf5={'Phone':_0x443169};var _0x2be6fb={'Id':!![],'Name':!![],'Phone':!![]};return BPromise[_0xcac2('0x1f')]()[_0xcac2('0x1a')](function(){if(_0x3b333c[_0xcac2('0xd')]==='Task'){logger['info'](_0xcac2('0x25'),_0x443169,_0x3b333c['moduleSearch']);switch(_0x3b333c[_0xcac2('0x26')]){case'contact_lead':return _0x4d5649[_0xcac2('0x27')](_0xcac2('0x28'))[_0xcac2('0x1c')](_0x2e3bf5,_0x2be6fb)['execute']()[_0xcac2('0x1a')](function(_0x4c17d7){if(_0x4c17d7&&_0x4c17d7[_0xcac2('0x1b')]){return _0x4c17d7;}else{return _0x4d5649[_0xcac2('0x27')](_0xcac2('0x29'))[_0xcac2('0x1c')](_0x2e3bf5,_0x2be6fb);}});case _0xcac2('0x2a'):return _0x4d5649[_0xcac2('0x27')](_0xcac2('0x28'))[_0xcac2('0x1c')](_0x2e3bf5,_0x2be6fb)['execute']();case _0xcac2('0x2b'):return _0x4d5649[_0xcac2('0x27')](_0xcac2('0x29'))[_0xcac2('0x1c')](_0x2e3bf5,_0x2be6fb);default:return null;}}else if(_0x3b333c[_0xcac2('0xd')]==='Case'){logger[_0xcac2('0x1e')](_0xcac2('0x25'),_0x443169,_0xcac2('0x2a'));return _0x4d5649[_0xcac2('0x27')](_0xcac2('0x28'))[_0xcac2('0x1c')](_0x2e3bf5,_0x2be6fb)[_0xcac2('0x19')]();}})['then'](function(_0x869c21){if(_0x869c21&&_0x869c21[_0xcac2('0x1b')]){var _0xc47ee7=_[_0xcac2('0x1c')](_0x869c21,function(_0x1fd2ab){return _0x1fd2ab['Phone']===_0x443169;});if(_0xc47ee7){return BPromise[_0xcac2('0x1f')]({'id':_0xc47ee7['Id'],'name':_0xc47ee7['Name'],'phone':_0xc47ee7[_0xcac2('0x2c')]});}}})[_0xcac2('0x1a')](function(_0x1692b6){if(_0x1692b6){logger[_0xcac2('0x1e')](_0xcac2('0x2d'),_0x443169);return BPromise[_0xcac2('0x1f')](_0x1692b6);}else{logger[_0xcac2('0x1e')](_0xcac2('0x2e'),_0x443169);var _0x50e712={'LastName':_0x4244e7!==''?_0x4244e7:util['format'](_0xcac2('0x2f'),_0x443169),'Phone':_0x443169};if(_0x3b333c[_0xcac2('0x30')]){if(_0x3b333c[_0xcac2('0x30')]===_0xcac2('0x2a')){logger[_0xcac2('0x1e')](_0xcac2('0x31'),_0x443169,_0x3b333c[_0xcac2('0x30')]);}else if(_0x3b333c['moduleCreate']===_0xcac2('0x2b')&&_0x3b333c[_0xcac2('0xd')]===_0xcac2('0xe')){logger[_0xcac2('0x1e')](_0xcac2('0x31'),_0x443169,_0x3b333c[_0xcac2('0x30')]);_0x50e712['Company']='No\x20Company';}else{return null;}}return _0x4d5649['sobject'](_[_0xcac2('0x32')](_0x3b333c[_0xcac2('0x30')]))[_0xcac2('0x33')](_0x50e712);}});}function getCustomFields(_0x13221b,_0x4d6708){var _0x8245cc={};if(_0x13221b[_0xcac2('0x1b')]>0x0){_[_0xcac2('0x34')](_0x13221b,function(_0xfe2a27){if(_0xfe2a27[_0xcac2('0x35')]===_0xcac2('0x36')&&_0xfe2a27['idField']){_0x8245cc[_0xfe2a27[_0xcac2('0x37')]]=_0xfe2a27['content'][_0xcac2('0x38')]();}else if(_0xfe2a27['type']===_0xcac2('0x39')&&_0xfe2a27[_0xcac2('0x3a')]&&_0xfe2a27[_0xcac2('0x37')]){_0x4d6708[_0xfe2a27[_0xcac2('0x3a')]]&&(_0x8245cc[_0xfe2a27['idField']]=_0x4d6708[_0xfe2a27[_0xcac2('0x3a')]][_0xcac2('0x38')]());}else if(_0xfe2a27[_0xcac2('0x35')]===_0xcac2('0x3b')&&_0xfe2a27[_0xcac2('0x3c')]&&_0xfe2a27[_0xcac2('0x3c')][_0xcac2('0x3d')]&&_0xfe2a27[_0xcac2('0x37')]){_0x4d6708[_0xfe2a27[_0xcac2('0x3c')][_0xcac2('0x3d')]['toLowerCase']()]&&(_0x8245cc[_0xfe2a27[_0xcac2('0x37')]]=_0x4d6708[_0xfe2a27[_0xcac2('0x3c')][_0xcac2('0x3d')]['toLowerCase']()]['toString']());}});}return _0x8245cc;}function getConnection(_0x276926){var _0x583658=_0x276926[_0xcac2('0x3e')]['concat'](_0x276926[_0xcac2('0x3f')]);var _0x101509=new jsforce['Connection']({'oauth2':{'loginUrl':_0x276926[_0xcac2('0x40')]||'https://login.salesforce.com','clientId':_0x276926[_0xcac2('0x41')],'clientSecret':_0x276926[_0xcac2('0x42')]}});return _0x101509['login'](_0x276926['username'],_0x583658)[_0xcac2('0x1a')](function(){logger['info'](_0xcac2('0x43'));return _0x101509;});}exports['queue']=function(_0x598cd1,_0x48279b,_0x42f532,_0x2499fc,_0x4ea515,_0x4eca1e){var _0x3761a9,_0x41fa9f,_0x38113d,_0x52482f;_0x4eca1e[_0xcac2('0x44')]=intUtil[_0xcac2('0x45')](_0x4eca1e['serverUrl']);_0x4eca1e[_0xcac2('0x40')]=intUtil[_0xcac2('0x45')](_0x4eca1e[_0xcac2('0x40')]);if(_0x4ea515&&_0x4ea515[_0xcac2('0x46')]){logger[_0xcac2('0x1e')](_0xcac2('0x47'),'Recording\x20is\x20enabled!');_0x48279b['recordingURL']=util[_0xcac2('0x48')](_0xcac2('0x49'),_0x4eca1e[_0xcac2('0x44')],_0x48279b[_0xcac2('0x4a')],md5(_0x48279b[_0xcac2('0x4a')]));}else{_0x48279b[_0xcac2('0x4b')]='';}return getConnection(_0x4eca1e)['then'](function(_0x4bf55f){_0x52482f=_0x4bf55f;return getUser(_0x4eca1e,_0x2499fc['email'],_0x52482f);})[_0xcac2('0x1a')](function(_0xd429cf){_0x3761a9=_0xd429cf;return getEndUser(_0x4eca1e,_0x42f532,_0x48279b['calleridname'],_0x48279b[_0xcac2('0x4c')],_0x52482f);})['then'](function(_0x3240f1){_0x41fa9f=_0x3240f1;return getTicket(_0x4eca1e,_0x3761a9,_0x41fa9f,_0x42f532,_0x48279b,_0x42f532[_0xcac2('0x4d')],_0x52482f,_0xcac2('0x4e'));})['then'](function(_0x357f4d){_0x38113d=_0x357f4d;logger['info'](_0xcac2('0x4f'),_0x38113d['id']);logger[_0xcac2('0x1e')]('[QUEUE]\x20Displaying\x20ticket\x20%s\x20to\x20agent\x20%s.\x20Integration\x20account\x20type\x20%s.',_0x38113d['id'],_0x2499fc[_0xcac2('0x3d')],_0x4eca1e['type']);switch(_0x4eca1e['type']){case _0xcac2('0x50'):emit(util[_0xcac2('0x48')]('user:%s',_0x2499fc[_0xcac2('0x3d')]),_0xcac2('0x51'),{'recordId':_0x38113d['id']});break;case _0xcac2('0x52'):emit(util[_0xcac2('0x48')]('user:%s',_0x2499fc[_0xcac2('0x3d')]),_0xcac2('0x53'),{'uri':util[_0xcac2('0x48')](_0xcac2('0x54'),_0x52482f[_0xcac2('0x55')],_0x38113d['id'])});break;default:logger['error']('[QUEUE]\x20Salesforce\x20account\x20type\x20not\x20recognized.');}})['catch'](function(_0x3bd4bd){logger['error'](_0xcac2('0x47'),JSON[_0xcac2('0x56')](_0x3bd4bd));});};exports[_0xcac2('0x57')]=function(_0xccbea3,_0x43364c,_0xba2ea8,_0x2da2b6,_0x1d7a9e,_0xd5dcee,_0x14c36f){var _0x4c9769,_0x4d33f3,_0x579284,_0x3a5e23;_0xd5dcee[_0xcac2('0x44')]=intUtil[_0xcac2('0x45')](_0xd5dcee[_0xcac2('0x44')]);_0xd5dcee[_0xcac2('0x40')]=intUtil[_0xcac2('0x45')](_0xd5dcee[_0xcac2('0x40')]);if(_0x14c36f&&_0x14c36f[_0xcac2('0x58')]&&_0x14c36f[_0xcac2('0x58')]!==_0xcac2('0x59')){logger[_0xcac2('0x1e')](_0xcac2('0x5a'),_0xcac2('0x5b'));_0x43364c[_0xcac2('0x4b')]=util[_0xcac2('0x48')]('%s/api/voice/recordings/%s/downloads?type=uniqueid&token=%s',_0xd5dcee[_0xcac2('0x44')],_0x43364c[_0xcac2('0x4a')],md5(_0x43364c[_0xcac2('0x4a')]));}return getConnection(_0xd5dcee)['then'](function(_0x3b4e23){_0x3a5e23=_0x3b4e23;return getUser(_0xd5dcee,_0x2da2b6[_0xcac2('0x5c')],_0x3a5e23);})['then'](function(_0x4515ca){_0x4c9769=_0x4515ca;return getEndUser(_0xd5dcee,_0xba2ea8,_0x43364c[_0xcac2('0x5d')],_0x43364c[_0xcac2('0x5e')],_0x3a5e23);})['then'](function(_0x3126ae){_0x4d33f3=_0x3126ae;return getTicket(_0xd5dcee,_0x4c9769,_0x4d33f3,_0xba2ea8,_0x43364c,_0xba2ea8[_0xcac2('0x4d')],_0x3a5e23,_0xcac2('0x57'));})[_0xcac2('0x1a')](function(_0x5dd75e){_0x579284=_0x5dd75e;logger['info']('[OUTBOUND]\x20Ticket\x20%s\x20created.',_0x579284['id']);logger[_0xcac2('0x1e')](_0xcac2('0x5f'),_0x579284['id'],_0x2da2b6[_0xcac2('0x3d')],_0xd5dcee[_0xcac2('0x35')]);switch(_0xd5dcee['type']){case _0xcac2('0x50'):emit(util[_0xcac2('0x48')]('user:%s',_0x2da2b6[_0xcac2('0x3d')]),_0xcac2('0x51'),{'recordId':_0x579284['id']});break;case'newTab':emit(util[_0xcac2('0x48')](_0xcac2('0x60'),_0x2da2b6[_0xcac2('0x3d')]),'trigger:browser:url',{'uri':util[_0xcac2('0x48')](_0xcac2('0x54'),_0x3a5e23['instanceUrl'],_0x579284['id'])});break;default:logger[_0xcac2('0x61')]('[OUTBOUND]',_0xcac2('0x62'));}})[_0xcac2('0x63')](function(_0x2d0195){logger['error'](_0xcac2('0x5a'),JSON['stringify'](_0x2d0195));});};exports[_0xcac2('0x64')]=function(_0x606433,_0x33873d,_0x5a77f4,_0x25736d,_0x302ad3,_0x5972e4){var _0x549bd8,_0x2e60fc,_0xc1a2a7,_0x494161;_0x5972e4[_0xcac2('0x44')]=intUtil['stripTrailingSlash'](_0x5972e4['serverUrl']);_0x5972e4[_0xcac2('0x40')]=intUtil['stripTrailingSlash'](_0x5972e4['remoteUri']);if(_0x302ad3&&_0x302ad3[_0xcac2('0x46')]){logger[_0xcac2('0x1e')](_0xcac2('0x65'),_0xcac2('0x5b'));_0x33873d['recordingURL']=util[_0xcac2('0x48')](_0xcac2('0x49'),_0x5972e4[_0xcac2('0x44')],_0x33873d[_0xcac2('0x4a')],md5(_0x33873d[_0xcac2('0x4a')]));}else{_0x33873d[_0xcac2('0x4b')]='';}return getConnection(_0x5972e4)['then'](function(_0x33f5b1){_0x494161=_0x33f5b1;if(!_['isNil'](_0x25736d)){return getUser(_0x5972e4,_0x25736d['name'],_0x494161);}else{return getUser(_0x5972e4,null,_0x494161);}})[_0xcac2('0x1a')](function(_0xecccb9){_0x549bd8=_0xecccb9;return getEndUser(_0x5972e4,_0x5a77f4,_0x33873d[_0xcac2('0x66')],_0x33873d[_0xcac2('0x4c')],_0x494161);})[_0xcac2('0x1a')](function(_0x116bd6){_0x2e60fc=_0x116bd6;return getTicket(_0x5972e4,_0x549bd8,_0x2e60fc,_0x5a77f4,_0x33873d,_0x5a77f4[_0xcac2('0x4d')],_0x494161);})[_0xcac2('0x1a')](function(_0x4b0bb4){_0xc1a2a7=_0x4b0bb4;logger['info']('[ABANDONED]\x20Ticket\x20%s\x20created.',_0xc1a2a7['id']);logger[_0xcac2('0x1e')](_0xcac2('0x67'),_0x5972e4['type']);})['catch'](function(_0x345017){logger[_0xcac2('0x61')]('[ABANDONED]',JSON['stringify'](_0x345017));});};
\ No newline at end of file
+var _0x892d=['trigger:browser:url','%s/%s/e','error','outbound','none','[OUTBOUND]','%s/api/voice/recordings/%s/downloads?type=uniqueid&token=%s','destcalleridnum','Fields','[OUTBOUND]\x20Ticket\x20%s\x20created.','[OUTBOUND]\x20Displaying\x20ticket\x20%s\x20to\x20agent\x20%s.\x20Integration\x20account\x20type\x20%s.','instanceUrl','Salesforce\x20account\x20type\x20not\x20recognized','catch','abandoned','[ABANDONED]','isNil','[ABANDONED]\x20Ticket\x20%s\x20created.','[ABANDONED]\x20Integration\x20account\x20type\x20%s.','stringify','lodash','request-promise','moment','md5','jsforce','./util','../../../../config/environment','../../../../config/logger','salesforce','redis','localhost','socket.io-emitter','ticketType','Task','utc','getString','Subjects','Descriptions','WhoId','assign','ContactId','sobject','create','validateEmail','then','length','Email','info','Agent\x20%s\x20found.','resolve','Name','identity','user_id','display_name','Agent\x20%s\x20not\x20found.\x20Switch\x20to\x20the\x20admin\x20account.','Searching\x20enduser\x20with\x20phone\x20%s.\x20Serching\x20method\x20used\x20%s.','moduleSearch','contact_lead','Contact','execute','Lead','find','contact','lead','Case','Phone','Enduser\x20with\x20phone\x20%s\x20not\x20found.','','format','Caller\x20-\x20%s','moduleCreate','Enduser\x20with\x20phone\x20%s.\x20Creating\x20method\x20used\x20%s.','Company','No\x20Company','upperFirst','type','string','idField','content','toString','variable','variableName','customVariable','Variable','name','toLowerCase','concat','clientId','clientSecret','login','username','queue','stripTrailingSlash','serverUrl','remoteUri','[QUEUE]','Recording\x20is\x20enabled!','recordingURL','uniqueid','email','calleridname','calleridnum','[QUEUE]\x20Ticket\x20%s\x20created','integrationTab','trigger:salesforce:display','newTab','user:%s'];(function(_0x295e1d,_0x3d162){var _0x3e8464=function(_0x368242){while(--_0x368242){_0x295e1d['push'](_0x295e1d['shift']());}};_0x3e8464(++_0x3d162);}(_0x892d,0xea));var _0xd892=function(_0x2c9573,_0x39dd3e){_0x2c9573=_0x2c9573-0x0;var _0x52d08a=_0x892d[_0x2c9573];return _0x52d08a;};'use strict';var _=require(_0xd892('0x0'));var rp=require(_0xd892('0x1'));var moment=require(_0xd892('0x2'));var BPromise=require('bluebird');var md5=require(_0xd892('0x3'));var jsforce=require(_0xd892('0x4'));var util=require('util');var Redis=require('ioredis');var intUtil=require(_0xd892('0x5'));var config=require(_0xd892('0x6'));var logger=require(_0xd892('0x7'))(_0xd892('0x8'));config[_0xd892('0x9')]=_['defaults'](config[_0xd892('0x9')],{'host':_0xd892('0xa'),'port':0x18eb});var io=require(_0xd892('0xb'))(new Redis(config[_0xd892('0x9')]));function emit(_0x1ad52c,_0x1789d0,_0x4f0070){io['to'](_0x1ad52c)['emit'](_0x1789d0,_0x4f0070);}function getTicket(_0x1d46c7,_0x5e9e97,_0x544da5,_0x4f5a6b,_0x8eadc,_0xf6aad7,_0x4487c0,_0x4c7307){var _0x3655e1={};if(_0x4f5a6b[_0xd892('0xc')]===_0xd892('0xd')){_0x3655e1=Object['assign']({},{'OwnerId':_0x5e9e97['id'],'ActivityDate':moment[_0xd892('0xe')](),'IsReminderSet':![],'IsRecurrence':![],'Subject':intUtil[_0xd892('0xf')](_0x4f5a6b[_0xd892('0x10')],_0x8eadc,'\x20'),'Description':intUtil[_0xd892('0xf')](_0x4f5a6b[_0xd892('0x11')],_0x8eadc,'\x0a')},getCustomFields(_0xf6aad7,_0x8eadc));if(_0x544da5){_0x3655e1[_0xd892('0x12')]=_0x544da5['id'];}}else if(_0x4f5a6b[_0xd892('0xc')]==='Case'){_0x3655e1=Object[_0xd892('0x13')]({},{'OwnerId':_0x5e9e97['id'],'Subject':intUtil[_0xd892('0xf')](_0x4f5a6b['Subjects'],_0x8eadc,'\x20'),'Description':intUtil[_0xd892('0xf')](_0x4f5a6b[_0xd892('0x11')],_0x8eadc,'\x0a')},getCustomFields(_0xf6aad7,_0x8eadc));if(_0x544da5){_0x3655e1[_0xd892('0x14')]=_0x544da5['id'];}}return _0x4487c0[_0xd892('0x15')](_0x4f5a6b['ticketType'])[_0xd892('0x16')](_0x3655e1);}function getUser(_0x5cc0d5,_0x3cd8d6,_0x2c2d0c){if(!_['isNil'](_0x3cd8d6)&&intUtil[_0xd892('0x17')](_0x3cd8d6)){var _0x18f260={'Email':_0x3cd8d6};var _0x9183c3={'Id':!![],'Username':!![],'Name':!![],'Email':!![]};return _0x2c2d0c[_0xd892('0x15')]('User')['find'](_0x18f260,_0x9183c3)['execute']()[_0xd892('0x18')](function(_0x260f18){if(_0x260f18[_0xd892('0x19')]){var _0xf3242e=_['find'](_0x260f18,function(_0x341243){return _0x341243[_0xd892('0x1a')]===_0x3cd8d6;});if(_0xf3242e){logger[_0xd892('0x1b')](_0xd892('0x1c'),_0x3cd8d6);return BPromise[_0xd892('0x1d')]({'id':_0xf3242e['Id'],'name':_0xf3242e[_0xd892('0x1e')]});}}else{logger[_0xd892('0x1b')]('Agent\x20%s\x20not\x20found.\x20Switch\x20to\x20the\x20admin\x20account.',_0x3cd8d6);return _0x2c2d0c[_0xd892('0x1f')]()[_0xd892('0x18')](function(_0x385339){return BPromise[_0xd892('0x1d')]({'id':_0x385339[_0xd892('0x20')],'name':_0x385339[_0xd892('0x21')]});});}});}else{logger[_0xd892('0x1b')](_0xd892('0x22'),_0x3cd8d6);return _0x2c2d0c[_0xd892('0x1f')]()['then'](function(_0x4826a4){return BPromise[_0xd892('0x1d')]({'id':_0x4826a4[_0xd892('0x20')],'name':_0x4826a4[_0xd892('0x21')]});});}}function getEndUser(_0x5d5215,_0xfba956,_0x111f83,_0x4835a8,_0x16624a){var _0x41bee4={'Phone':_0x4835a8};var _0x2fcd9e={'Id':!![],'Name':!![],'Phone':!![]};return BPromise[_0xd892('0x1d')]()[_0xd892('0x18')](function(){if(_0xfba956[_0xd892('0xc')]==='Task'){logger['info'](_0xd892('0x23'),_0x4835a8,_0xfba956['moduleSearch']);switch(_0xfba956[_0xd892('0x24')]){case _0xd892('0x25'):return _0x16624a['sobject'](_0xd892('0x26'))['find'](_0x41bee4,_0x2fcd9e)[_0xd892('0x27')]()[_0xd892('0x18')](function(_0x2505d7){if(_0x2505d7&&_0x2505d7['length']){return _0x2505d7;}else{return _0x16624a[_0xd892('0x15')](_0xd892('0x28'))[_0xd892('0x29')](_0x41bee4,_0x2fcd9e);}});case _0xd892('0x2a'):return _0x16624a[_0xd892('0x15')]('Contact')[_0xd892('0x29')](_0x41bee4,_0x2fcd9e)['execute']();case _0xd892('0x2b'):return _0x16624a[_0xd892('0x15')]('Lead')[_0xd892('0x29')](_0x41bee4,_0x2fcd9e);default:return null;}}else if(_0xfba956[_0xd892('0xc')]===_0xd892('0x2c')){logger[_0xd892('0x1b')](_0xd892('0x23'),_0x4835a8,_0xd892('0x2a'));return _0x16624a[_0xd892('0x15')](_0xd892('0x26'))['find'](_0x41bee4,_0x2fcd9e)[_0xd892('0x27')]();}})[_0xd892('0x18')](function(_0x339d36){if(_0x339d36&&_0x339d36[_0xd892('0x19')]){var _0x482c1b=_['find'](_0x339d36,function(_0x57336b){return _0x57336b[_0xd892('0x2d')]===_0x4835a8;});if(_0x482c1b){return BPromise[_0xd892('0x1d')]({'id':_0x482c1b['Id'],'name':_0x482c1b[_0xd892('0x1e')],'phone':_0x482c1b['Phone']});}}})[_0xd892('0x18')](function(_0x55e04a){if(_0x55e04a){logger['info']('Enduser\x20with\x20phone\x20%s\x20found.',_0x4835a8);return BPromise[_0xd892('0x1d')](_0x55e04a);}else{logger[_0xd892('0x1b')](_0xd892('0x2e'),_0x4835a8);var _0x4b5b99={'LastName':_0x111f83!==_0xd892('0x2f')?_0x111f83:util[_0xd892('0x30')](_0xd892('0x31'),_0x4835a8),'Phone':_0x4835a8};if(_0xfba956[_0xd892('0x32')]){if(_0xfba956[_0xd892('0x32')]===_0xd892('0x2a')){logger[_0xd892('0x1b')](_0xd892('0x33'),_0x4835a8,_0xfba956[_0xd892('0x32')]);}else if(_0xfba956[_0xd892('0x32')]===_0xd892('0x2b')&&_0xfba956[_0xd892('0xc')]===_0xd892('0xd')){logger[_0xd892('0x1b')](_0xd892('0x33'),_0x4835a8,_0xfba956[_0xd892('0x32')]);_0x4b5b99[_0xd892('0x34')]=_0xd892('0x35');}else{return null;}}return _0x16624a[_0xd892('0x15')](_[_0xd892('0x36')](_0xfba956[_0xd892('0x32')]))['create'](_0x4b5b99);}});}function getCustomFields(_0xc51eba,_0x279a4b){var _0x42c6d6={};if(_0xc51eba[_0xd892('0x19')]>0x0){_['forEach'](_0xc51eba,function(_0x31081c){if(_0x31081c[_0xd892('0x37')]===_0xd892('0x38')&&_0x31081c[_0xd892('0x39')]){_0x42c6d6[_0x31081c[_0xd892('0x39')]]=_0x31081c[_0xd892('0x3a')][_0xd892('0x3b')]();}else if(_0x31081c[_0xd892('0x37')]===_0xd892('0x3c')&&_0x31081c[_0xd892('0x3d')]&&_0x31081c[_0xd892('0x39')]){_0x279a4b[_0x31081c['variableName']]&&(_0x42c6d6[_0x31081c[_0xd892('0x39')]]=_0x279a4b[_0x31081c[_0xd892('0x3d')]]['toString']());}else if(_0x31081c['type']===_0xd892('0x3e')&&_0x31081c[_0xd892('0x3f')]&&_0x31081c[_0xd892('0x3f')][_0xd892('0x40')]&&_0x31081c[_0xd892('0x39')]){_0x279a4b[_0x31081c[_0xd892('0x3f')][_0xd892('0x40')][_0xd892('0x41')]()]&&(_0x42c6d6[_0x31081c[_0xd892('0x39')]]=_0x279a4b[_0x31081c[_0xd892('0x3f')]['name'][_0xd892('0x41')]()][_0xd892('0x3b')]());}});}return _0x42c6d6;}function getConnection(_0x1f9c2b){var _0x345bac=_0x1f9c2b['password'][_0xd892('0x42')](_0x1f9c2b['securityToken']);var _0x2f7634=new jsforce['Connection']({'oauth2':{'loginUrl':_0x1f9c2b['remoteUri']||'https://login.salesforce.com','clientId':_0x1f9c2b[_0xd892('0x43')],'clientSecret':_0x1f9c2b[_0xd892('0x44')]}});return _0x2f7634[_0xd892('0x45')](_0x1f9c2b[_0xd892('0x46')],_0x345bac)[_0xd892('0x18')](function(){logger[_0xd892('0x1b')]('Connection\x20established.');return _0x2f7634;});}exports[_0xd892('0x47')]=function(_0x136359,_0x1ef78c,_0x2ba810,_0x5656d5,_0xdc1c45,_0x201a54){var _0x4dd3c0,_0x5d12db,_0x179a49,_0x584f9e;_0x201a54['serverUrl']=intUtil[_0xd892('0x48')](_0x201a54[_0xd892('0x49')]);_0x201a54[_0xd892('0x4a')]=intUtil[_0xd892('0x48')](_0x201a54[_0xd892('0x4a')]);if(_0xdc1c45&&_0xdc1c45['monitor_format']){logger[_0xd892('0x1b')](_0xd892('0x4b'),_0xd892('0x4c'));_0x1ef78c[_0xd892('0x4d')]=util[_0xd892('0x30')]('%s/api/voice/recordings/%s/downloads?type=uniqueid&token=%s',_0x201a54[_0xd892('0x49')],_0x1ef78c[_0xd892('0x4e')],md5(_0x1ef78c[_0xd892('0x4e')]));}else{_0x1ef78c[_0xd892('0x4d')]='';}return getConnection(_0x201a54)['then'](function(_0x2db8df){_0x584f9e=_0x2db8df;return getUser(_0x201a54,_0x5656d5[_0xd892('0x4f')],_0x584f9e);})['then'](function(_0x146c70){_0x4dd3c0=_0x146c70;return getEndUser(_0x201a54,_0x2ba810,_0x1ef78c[_0xd892('0x50')],_0x1ef78c[_0xd892('0x51')],_0x584f9e);})[_0xd892('0x18')](function(_0x114b8e){_0x5d12db=_0x114b8e;return getTicket(_0x201a54,_0x4dd3c0,_0x5d12db,_0x2ba810,_0x1ef78c,_0x2ba810['Fields'],_0x584f9e,'queue');})[_0xd892('0x18')](function(_0x3310f1){_0x179a49=_0x3310f1;logger[_0xd892('0x1b')](_0xd892('0x52'),_0x179a49['id']);logger['info']('[QUEUE]\x20Displaying\x20ticket\x20%s\x20to\x20agent\x20%s.\x20Integration\x20account\x20type\x20%s.',_0x179a49['id'],_0x5656d5[_0xd892('0x40')],_0x201a54[_0xd892('0x37')]);switch(_0x201a54[_0xd892('0x37')]){case _0xd892('0x53'):emit(util[_0xd892('0x30')]('user:%s',_0x5656d5[_0xd892('0x40')]),_0xd892('0x54'),{'recordId':_0x179a49['id']});break;case _0xd892('0x55'):emit(util[_0xd892('0x30')](_0xd892('0x56'),_0x5656d5[_0xd892('0x40')]),_0xd892('0x57'),{'uri':util[_0xd892('0x30')](_0xd892('0x58'),_0x584f9e['instanceUrl'],_0x179a49['id'])});break;default:logger[_0xd892('0x59')]('[QUEUE]\x20Salesforce\x20account\x20type\x20not\x20recognized.');}})['catch'](function(_0x1b01a6){logger[_0xd892('0x59')](_0xd892('0x4b'),JSON['stringify'](_0x1b01a6));});};exports[_0xd892('0x5a')]=function(_0xe142a3,_0x14a5d2,_0x3263aa,_0x3e4080,_0x11705d,_0x3984e1,_0x311766){var _0x309eb0,_0x29a3c6,_0x573962,_0x138232;_0x3984e1[_0xd892('0x49')]=intUtil['stripTrailingSlash'](_0x3984e1[_0xd892('0x49')]);_0x3984e1['remoteUri']=intUtil[_0xd892('0x48')](_0x3984e1[_0xd892('0x4a')]);if(_0x311766&&_0x311766['recordingFormat']&&_0x311766['recordingFormat']!==_0xd892('0x5b')){logger[_0xd892('0x1b')](_0xd892('0x5c'),_0xd892('0x4c'));_0x14a5d2[_0xd892('0x4d')]=util['format'](_0xd892('0x5d'),_0x3984e1[_0xd892('0x49')],_0x14a5d2['uniqueid'],md5(_0x14a5d2[_0xd892('0x4e')]));}return getConnection(_0x3984e1)[_0xd892('0x18')](function(_0x1355db){_0x138232=_0x1355db;return getUser(_0x3984e1,_0x3e4080[_0xd892('0x4f')],_0x138232);})[_0xd892('0x18')](function(_0xc1be10){_0x309eb0=_0xc1be10;return getEndUser(_0x3984e1,_0x3263aa,_0x14a5d2['destcalleridname'],_0x14a5d2[_0xd892('0x5e')],_0x138232);})[_0xd892('0x18')](function(_0x52ac12){_0x29a3c6=_0x52ac12;return getTicket(_0x3984e1,_0x309eb0,_0x29a3c6,_0x3263aa,_0x14a5d2,_0x3263aa[_0xd892('0x5f')],_0x138232,'outbound');})[_0xd892('0x18')](function(_0x36ebac){_0x573962=_0x36ebac;logger[_0xd892('0x1b')](_0xd892('0x60'),_0x573962['id']);logger[_0xd892('0x1b')](_0xd892('0x61'),_0x573962['id'],_0x3e4080[_0xd892('0x40')],_0x3984e1[_0xd892('0x37')]);switch(_0x3984e1['type']){case _0xd892('0x53'):emit(util[_0xd892('0x30')](_0xd892('0x56'),_0x3e4080[_0xd892('0x40')]),_0xd892('0x54'),{'recordId':_0x573962['id']});break;case _0xd892('0x55'):emit(util[_0xd892('0x30')](_0xd892('0x56'),_0x3e4080[_0xd892('0x40')]),_0xd892('0x57'),{'uri':util[_0xd892('0x30')](_0xd892('0x58'),_0x138232[_0xd892('0x62')],_0x573962['id'])});break;default:logger[_0xd892('0x59')](_0xd892('0x5c'),_0xd892('0x63'));}})[_0xd892('0x64')](function(_0x567cb7){logger[_0xd892('0x59')](_0xd892('0x5c'),JSON['stringify'](_0x567cb7));});};exports[_0xd892('0x65')]=function(_0x5f1cf8,_0x46616a,_0x22e243,_0x3b3480,_0x32347a,_0x5deec2){var _0x23403d,_0x46e295,_0x25e139,_0x21c3a7;_0x5deec2[_0xd892('0x49')]=intUtil['stripTrailingSlash'](_0x5deec2[_0xd892('0x49')]);_0x5deec2[_0xd892('0x4a')]=intUtil['stripTrailingSlash'](_0x5deec2[_0xd892('0x4a')]);if(_0x32347a&&_0x32347a['monitor_format']){logger['info'](_0xd892('0x66'),'Recording\x20is\x20enabled!');_0x46616a[_0xd892('0x4d')]=util['format'](_0xd892('0x5d'),_0x5deec2[_0xd892('0x49')],_0x46616a[_0xd892('0x4e')],md5(_0x46616a[_0xd892('0x4e')]));}else{_0x46616a['recordingURL']='';}return getConnection(_0x5deec2)[_0xd892('0x18')](function(_0x3e4aa0){_0x21c3a7=_0x3e4aa0;if(!_[_0xd892('0x67')](_0x3b3480)){return getUser(_0x5deec2,_0x3b3480[_0xd892('0x40')],_0x21c3a7);}else{return getUser(_0x5deec2,null,_0x21c3a7);}})[_0xd892('0x18')](function(_0x195c38){_0x23403d=_0x195c38;return getEndUser(_0x5deec2,_0x22e243,_0x46616a[_0xd892('0x50')],_0x46616a[_0xd892('0x51')],_0x21c3a7);})['then'](function(_0x10bfa9){_0x46e295=_0x10bfa9;return getTicket(_0x5deec2,_0x23403d,_0x46e295,_0x22e243,_0x46616a,_0x22e243[_0xd892('0x5f')],_0x21c3a7);})[_0xd892('0x18')](function(_0x45e6e5){_0x25e139=_0x45e6e5;logger[_0xd892('0x1b')](_0xd892('0x68'),_0x25e139['id']);logger[_0xd892('0x1b')](_0xd892('0x69'),_0x5deec2[_0xd892('0x37')]);})[_0xd892('0x64')](function(_0x5059de){logger[_0xd892('0x59')](_0xd892('0x66'),JSON[_0xd892('0x6a')](_0x5059de));});};
\ 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 1e4bbdf..9fd64b8 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 _0xa9e0=['validateEmail','userEmail','sys_user?sysparm_query=email%3D','],\x20getUser\x20rp\x20obj','then','],\x20getUser\x20entity','userId','adminEmail','],\x20getUser\x20crm','catch','],\x20createEndUser\x20input\x20crm','POST','sys_user?','user','endUserNumber','true','System','],\x20getEndUser\x20crm','],\x20createEndUser\x20crm','length','forEach','type','customField','idField','content','toString','toLowerCase','variable','variableName','Variable','name',']\x20getTicket\x20input\x20crm','outbound','incident','assign','getString','Descriptions','Fields',']\x20POST\x20incident\x20entity\x20schema',']\x20getTicket\x20crm','label','Incident','ticketId','Incident\x20-\x20','ticketNumber','push','all',']\x20arrayPromises:\x20IDs\x20in\x20table\x20label','Tags','map','%26sysparm_record_target%3Dincident','%26sysparm_record_row%3D1%26sysparm_record_rows%3D39','%26sysparm_record_list%3Dactive%253Dtrue','%255EORDERBYDESCnumber','/nav_to.do?uri=incident.do?sys_id%3D','format','user:%s','emit','trigger:browser:url','password','sysparm_limit=1','sysparm_display_value=true','serverUrl','stripTrailingSlash','%s/api/now/table/','remoteUri','email','destcalleridnum','calleridnum','queue','abandoned','%s/api/voice/recordings/%s/downloads?type=uniqueid&token=%s','uniqueid','monitor_format','[QUEUE]','Recording\x20is\x20enabled!','recordingFormat','none','[OUTBOUND]','recordingURL','The\x20ticket\x20ID\x20is:\x20%s','call\x20direction:\x20%s',']\x20Error\x20running\x20ServiceNow\x20integration','lodash','bluebird','request-promise','ioredis','../../../../config/environment','../../../../config/logger','servicenow','redis','defaults','localhost','socket.io-emitter','GET','sys_user?sysparm_query=user_name%3Dadmin','adminId','result','sys_id','info','toUpperCase','],\x20getAdminUser\x20crm','error','message'];(function(_0x47a7d0,_0x4e182d){var _0xb9bd08=function(_0x588ee2){while(--_0x588ee2){_0x47a7d0['push'](_0x47a7d0['shift']());}};_0xb9bd08(++_0x4e182d);}(_0xa9e0,0x123));var _0x0a9e=function(_0x1cfa0d,_0x4391f2){_0x1cfa0d=_0x1cfa0d-0x0;var _0xe33279=_0xa9e0[_0x1cfa0d];return _0xe33279;};'use strict';var _=require(_0x0a9e('0x0'));var Promise=require(_0x0a9e('0x1'));var rp=require(_0x0a9e('0x2'));var util=require('util');var md5=require('md5');var Redis=require(_0x0a9e('0x3'));var intUtil=require('./util');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 io=require(_0x0a9e('0xa'))(new Redis(config[_0x0a9e('0x7')]));function getAdminUser(_0x5f41ea,_0x503809,_0xe42b77,_0x56465b,_0x52cace,_0x39753a){return new Promise(function(_0xf81284,_0x307b3e){var _0x3ab53f={'method':_0x0a9e('0xb'),'uri':_0x56465b+_0x0a9e('0xc')+'&'+_0x52cace+'&'+_0x39753a,'auth':_0x503809,'json':!![]};return rp(_0x3ab53f)['then'](function(_0x50dfb2){if(_0x50dfb2['result']['length']>0x0){_0xe42b77[_0x0a9e('0xd')]=_0x50dfb2[_0x0a9e('0xe')][0x0][_0x0a9e('0xf')];}logger[_0x0a9e('0x10')]('['+[_0x5f41ea[_0x0a9e('0x11')]()]+_0x0a9e('0x12'),_0xe42b77);_0xf81284(_0xe42b77);})['catch'](function(_0x4283ce){logger[_0x0a9e('0x13')]('['+[_0x5f41ea[_0x0a9e('0x11')]()]+']',_0x4283ce[_0x0a9e('0x14')]);_0x307b3e(_0x4283ce[_0x0a9e('0x14')]);});});}function getUser(_0x4d5611,_0x52a03d,_0x22dccb,_0x5d0880,_0x1985b6){return function(_0x519dfd){logger[_0x0a9e('0x10')]('['+[_0x4d5611[_0x0a9e('0x11')]()]+'],\x20getUser\x20input\x20crm',_0x519dfd);return new Promise(function(_0x225616,_0x5a0a06){if(intUtil[_0x0a9e('0x15')](_0x519dfd[_0x0a9e('0x16')])){var _0x106033={'method':_0x0a9e('0xb'),'uri':_0x22dccb+_0x0a9e('0x17')+_0x519dfd[_0x0a9e('0x16')]+'&'+_0x5d0880+'&'+_0x1985b6,'auth':_0x52a03d,'json':!![]};logger[_0x0a9e('0x10')]('['+[_0x4d5611[_0x0a9e('0x11')]()]+_0x0a9e('0x18'),_0x106033);return rp(_0x106033)[_0x0a9e('0x19')](function(_0x1c696a){logger[_0x0a9e('0x10')]('['+[_0x4d5611['toUpperCase']()]+_0x0a9e('0x1a'),_0x1c696a);if(_0x1c696a[_0x0a9e('0xe')]['length']>0x0&&String(_0x1c696a[_0x0a9e('0xe')][0x0]['active'])==='true'){_0x519dfd[_0x0a9e('0x1b')]=_0x1c696a[_0x0a9e('0xe')][0x0][_0x0a9e('0xf')];}else{_0x519dfd[_0x0a9e('0x1b')]=_0x519dfd['adminId'];_0x519dfd[_0x0a9e('0x16')]=_0x519dfd[_0x0a9e('0x1c')];}logger[_0x0a9e('0x10')]('['+[_0x4d5611[_0x0a9e('0x11')]()]+_0x0a9e('0x1d'),_0x519dfd);_0x225616(_0x519dfd);})[_0x0a9e('0x1e')](function(_0x16b1ca){logger['error']('['+[_0x4d5611['toUpperCase']()]+']',_0x16b1ca[_0x0a9e('0x14')]);_0x5a0a06(_0x16b1ca[_0x0a9e('0x14')]);});}else{logger[_0x0a9e('0x10')]('['+[_0x4d5611[_0x0a9e('0x11')]()]+']\x20using\x20admin\x20profile');_0x519dfd[_0x0a9e('0x1b')]=_0x519dfd['adminId'];_0x519dfd[_0x0a9e('0x16')]=_0x519dfd['adminEmail'];_0x225616(_0x519dfd);}});};}function createEndUser(_0x1dc186,_0x34dc65,_0x25fba9,_0x14433c,_0x140511){logger[_0x0a9e('0x10')]('['+[_0x1dc186[_0x0a9e('0x11')]()]+_0x0a9e('0x1f'),_0x25fba9);return new Promise(function(_0x5a101a,_0x3652a7){var _0x468813={'method':_0x0a9e('0x20'),'uri':_0x14433c+_0x0a9e('0x21')+_0x140511,'body':{'user_name':_0x25fba9['endUserNumber'],'roles':_0x0a9e('0x22'),'first_name':_0x25fba9[_0x0a9e('0x23')],'active':_0x0a9e('0x24'),'date_format':_0x0a9e('0x25'),'phone':_0x25fba9[_0x0a9e('0x23')]},'auth':_0x34dc65,'json':!![]};return rp(_0x468813)[_0x0a9e('0x19')](function(_0x296f41){logger[_0x0a9e('0x10')]('['+[_0x1dc186[_0x0a9e('0x11')]()]+'],\x20EndUser\x20schema',_0x296f41[_0x0a9e('0xe')]);_0x25fba9['endUserId']=_0x296f41[_0x0a9e('0xe')][_0x0a9e('0xf')];_0x5a101a(_0x25fba9);})[_0x0a9e('0x1e')](function(_0x33bdb7){logger[_0x0a9e('0x13')]('['+[_0x1dc186['toUpperCase']()]+']',_0x33bdb7[_0x0a9e('0x14')]);_0x3652a7(_0x33bdb7[_0x0a9e('0x14')]);});});}function getEndUser(_0x40cb85,_0x2da5c0,_0x2b45ea,_0x409319,_0x332d35){return function(_0x39e565){logger['info']('['+[_0x40cb85[_0x0a9e('0x11')]()]+'],\x20getEndUser\x20input\x20crm',_0x39e565);return new Promise(function(_0x2cc7a0,_0x14b13f){var _0x2b7e7f={'method':_0x0a9e('0xb'),'uri':_0x2b45ea+'sys_user?sysparm_query=phone%3D'+_0x39e565[_0x0a9e('0x23')]+'&'+_0x409319+'&'+_0x332d35,'auth':_0x2da5c0,'json':!![]};return rp(_0x2b7e7f)[_0x0a9e('0x19')](function(_0x1fa90d){if(_0x1fa90d[_0x0a9e('0xe')]['length']>0x0){_0x39e565['endUserId']=_0x1fa90d[_0x0a9e('0xe')][0x0]['sys_id'];logger[_0x0a9e('0x10')]('['+[_0x40cb85[_0x0a9e('0x11')]()]+_0x0a9e('0x26'),_0x39e565);_0x2cc7a0(_0x39e565);}else{return createEndUser(_0x40cb85,_0x2da5c0,_0x39e565,_0x2b45ea,_0x409319)[_0x0a9e('0x19')](function(_0x4f41ae){logger[_0x0a9e('0x10')]('['+[_0x40cb85[_0x0a9e('0x11')]()]+_0x0a9e('0x27'),_0x4f41ae);_0x2cc7a0(_0x4f41ae);});}})['catch'](function(_0x1dbf74){logger[_0x0a9e('0x13')]('['+[_0x40cb85[_0x0a9e('0x11')]()]+']',_0x1dbf74['message']);_0x14b13f(_0x1dbf74['message']);});});};}function getCustomFields(_0x11b61d,_0x40d766){var _0x5adda1={};if(_0x11b61d[_0x0a9e('0x28')]>0x0){_[_0x0a9e('0x29')](_0x11b61d,function(_0x2e1b3a){if(_0x2e1b3a[_0x0a9e('0x2a')]==='string'&&_0x2e1b3a['nameField']&&!_0x2e1b3a[_0x0a9e('0x2b')]){_0x5adda1[_0x2e1b3a[_0x0a9e('0x2c')]['toLowerCase']()]=_0x2e1b3a[_0x0a9e('0x2d')][_0x0a9e('0x2e')]();}else if(_0x2e1b3a[_0x0a9e('0x2a')]==='string'&&_0x2e1b3a[_0x0a9e('0x2c')]&&_0x2e1b3a[_0x0a9e('0x2b')]){_0x5adda1[_0x2e1b3a[_0x0a9e('0x2c')][_0x0a9e('0x2f')]()]=_0x2e1b3a[_0x0a9e('0x2d')][_0x0a9e('0x2e')]();}else if(_0x2e1b3a[_0x0a9e('0x2a')]===_0x0a9e('0x30')&&_0x2e1b3a[_0x0a9e('0x31')]&&_0x2e1b3a[_0x0a9e('0x2c')]&&_0x2e1b3a[_0x0a9e('0x2b')]){_0x5adda1[_0x2e1b3a[_0x0a9e('0x2c')][_0x0a9e('0x2f')]()]=_0x40d766[_0x2e1b3a[_0x0a9e('0x31')]][_0x0a9e('0x2e')]();}else if(_0x2e1b3a['type']==='customVariable'&&_0x2e1b3a[_0x0a9e('0x32')]&&_0x2e1b3a[_0x0a9e('0x32')][_0x0a9e('0x33')]&&_0x2e1b3a[_0x0a9e('0x2c')]&&_0x2e1b3a[_0x0a9e('0x2b')]){_0x5adda1[_0x2e1b3a[_0x0a9e('0x2c')][_0x0a9e('0x2f')]()]=_0x40d766[_0x2e1b3a[_0x0a9e('0x32')][_0x0a9e('0x33')][_0x0a9e('0x2f')]()][_0x0a9e('0x2e')]();}});}return _0x5adda1;}function getTicket(_0x35ed4a,_0x5026aa,_0x117c99,_0x138b8b,_0xdd268f,_0xfbd5ad){return function(_0x2e8caf){logger[_0x0a9e('0x10')]('['+[_0x35ed4a[_0x0a9e('0x11')]()]+_0x0a9e('0x34'),_0x2e8caf);return new Promise(function(_0x59afe8,_0x2e9d90){var _0x48fd45=_0x35ed4a[_0x0a9e('0x2f')]()===_0x0a9e('0x35')?_0x2e8caf[_0x0a9e('0x1b')]:_0x2e8caf['endUserId'];var _0x14bec2={'method':_0x0a9e('0x20'),'uri':_0x117c99+_0x0a9e('0x36')+'?'+_0xfbd5ad,'body':Object[_0x0a9e('0x37')]({},{'active':_0x0a9e('0x24'),'caller_id':_0x48fd45,'assigned_to':_0x2e8caf[_0x0a9e('0x1b')],'short_description':intUtil[_0x0a9e('0x38')](_0x138b8b['Subjects'],_0xdd268f,'\x20'),'description':intUtil[_0x0a9e('0x38')](_0x138b8b[_0x0a9e('0x39')],_0xdd268f,'\x0a')},getCustomFields(_0x138b8b[_0x0a9e('0x3a')],_0xdd268f)),'auth':_0x5026aa,'json':!![]};return rp(_0x14bec2)[_0x0a9e('0x19')](function(_0x409789){logger[_0x0a9e('0x10')]('['+[_0x35ed4a[_0x0a9e('0x11')]()]+_0x0a9e('0x3b'),_0x409789[_0x0a9e('0xe')]);_0x2e8caf['ticketId']=_0x409789[_0x0a9e('0xe')][_0x0a9e('0xf')];_0x2e8caf['ticketNumber']=_0x409789['result']['number'];logger[_0x0a9e('0x10')]('['+[_0x35ed4a[_0x0a9e('0x11')]()]+_0x0a9e('0x3c'),_0x2e8caf);_0x59afe8(_0x2e8caf);})[_0x0a9e('0x1e')](function(_0x61bb17){logger[_0x0a9e('0x13')]('['+[_0x35ed4a[_0x0a9e('0x11')]()]+']',_0x61bb17[_0x0a9e('0x14')]);_0x2e9d90(_0x61bb17['message']);});});};}function createRemoteTag(_0x4b1b9f,_0x53975a,_0x39d77d,_0x204173){return new Promise(function(_0x14d602,_0x5bb3ed){var _0x2b69d9={'method':_0x0a9e('0x20'),'uri':_0x39d77d+'label'+'?'+_0x204173,'body':{'short_description':_0x4b1b9f,'global':!![],'active':!![],'name':_0x4b1b9f},'auth':_0x53975a,'json':!![]};return rp(_0x2b69d9)['then'](function(_0x2ef381){var _0x59c6ff=_0x2ef381[_0x0a9e('0xe')]['sys_id'];_0x14d602(_0x59c6ff);});});}function getRemoteTag(_0x2e5e62,_0x3c20b2,_0x439340,_0x53613a,_0x2f82da){return new Promise(function(_0x1bf38a,_0x508b47){var _0x50f687={'method':_0x0a9e('0xb'),'uri':_0x439340+_0x0a9e('0x3d')+'?sysparm_query=name%3D'+_0x2e5e62+'&'+_0x53613a,'auth':_0x3c20b2,'json':!![]};return rp(_0x50f687)[_0x0a9e('0x19')](function(_0x5ce9ac){if(_0x5ce9ac[_0x0a9e('0xe')]['length']>0x0){var _0xe22ccc=_0x5ce9ac['result'][0x0]['sys_id'];_0x1bf38a(_0xe22ccc);}else{return createRemoteTag(_0x2e5e62,_0x3c20b2,_0x439340,_0x53613a)['then'](function(_0x2da03c){_0x1bf38a(_0x2da03c);});}});});}function assignTagToIncident(_0x47de4c,_0x2f7092,_0x65432,_0x3cfd00,_0x19b4df){return new Promise(function(_0x232830,_0x272738){var _0xd10662={'method':_0x0a9e('0x20'),'uri':_0x65432+'label_entry'+'?'+_0x19b4df,'body':{'label':_0x47de4c,'table':_0x0a9e('0x36'),'id_type':_0x0a9e('0x3e'),'table_key':_0x3cfd00[_0x0a9e('0x3f')],'title':_0x0a9e('0x40')+_0x3cfd00[_0x0a9e('0x41')],'id_display':_0x3cfd00[_0x0a9e('0x41')]},'auth':_0x2f7092,'json':!![]};return rp(_0xd10662)['then'](function(_0x956fbe){_0x232830();})[_0x0a9e('0x1e')](function(){_0x232830();});});}function manageTags(_0x5239ef,_0x3649cc,_0x5cc8fb,_0x20c668,_0x5ba1f9,_0x4b3c1a,_0x5674ee){return new Promise(function(_0x273cb5,_0x49d231){var _0x2244d6=[];_0x3649cc[_0x0a9e('0x29')](function(_0x261adb){_0x2244d6[_0x0a9e('0x42')](getRemoteTag(_0x261adb,_0x5cc8fb,_0x20c668,_0x4b3c1a,_0x5674ee));});return Promise[_0x0a9e('0x43')](_0x2244d6)[_0x0a9e('0x19')](function(_0x49eed0){if(_0x49eed0[_0x0a9e('0x28')]){logger['info']('['+[_0x5239ef[_0x0a9e('0x11')]()]+_0x0a9e('0x44'),_0x49eed0);var _0x51aaf7=[];_0x49eed0['forEach'](function(_0x453360){_0x51aaf7[_0x0a9e('0x42')](assignTagToIncident(_0x453360,_0x5cc8fb,_0x20c668,_0x5ba1f9,_0x4b3c1a));});return Promise[_0x0a9e('0x43')](_0x51aaf7)[_0x0a9e('0x19')](function(){_0x273cb5();})['catch'](function(){_0x273cb5();});}else{_0x273cb5();}});});}function getTags(_0x1d0dc8,_0xe05a5a,_0x54327c,_0x797b45,_0x17e88c,_0x88dcbf){return function(_0x409b29){return new Promise(function(_0x401837,_0x4d4a35){var _0x176840=[];var _0x2937e0=_0x797b45[_0x0a9e('0x45')];if(_0x2937e0&&_0x2937e0['length']>0x0){_0x176840=_[_0x0a9e('0x46')](_0x2937e0,'name');}if(_0x176840['length']>0x0){return manageTags(_0x1d0dc8,_0x176840,_0xe05a5a,_0x54327c,_0x409b29,_0x17e88c,_0x88dcbf)[_0x0a9e('0x19')](function(){_0x401837(_0x409b29);});}else{_0x401837(_0x409b29);}});};}function emit(_0x4556c5,_0x9375fb,_0x19c995){var _0x186f39=_0x0a9e('0x47')+_0x0a9e('0x48')+_0x0a9e('0x49')+_0x0a9e('0x4a');var _0x1cc4f3={'uri':_0x4556c5+_0x0a9e('0x4b')+_0x19c995+_0x186f39};io['to'](util[_0x0a9e('0x4c')](_0x0a9e('0x4d'),_0x9375fb))[_0x0a9e('0x4e')](_0x0a9e('0x4f'),_0x1cc4f3);}exports['cs']=function(_0x412a72,_0x2a28c0,_0x4257c9,_0x5150a4,_0x1b0b98,_0x295763,_0x243d12,_0x4edbb0){var _0x1148a1={};var _0x30944e={'user':_0x295763['username'],'pass':_0x295763[_0x0a9e('0x50')]};var _0x56e31e=_0x0a9e('0x51');var _0x427946=_0x0a9e('0x52');_0x295763['remoteUri']=intUtil['stripTrailingSlash'](_0x295763['remoteUri']);_0x295763[_0x0a9e('0x53')]=intUtil[_0x0a9e('0x54')](_0x295763[_0x0a9e('0x53')]);var _0x23a7d3=util[_0x0a9e('0x4c')](_0x0a9e('0x55'),_0x295763[_0x0a9e('0x56')]);_0x1148a1[_0x0a9e('0x16')]=!_['isNil'](_0x5150a4)?_0x5150a4[_0x0a9e('0x57')]:null;_0x1148a1[_0x0a9e('0x1c')]=_0x295763[_0x0a9e('0x57')];_0x1148a1['endUserNumber']=_0x4edbb0[_0x0a9e('0x2f')]()==='outbound'?_0x2a28c0[_0x0a9e('0x58')]:_0x2a28c0[_0x0a9e('0x59')];_0x1148a1['callDirection']=_0x4edbb0===_0x0a9e('0x5a')||_0x4edbb0===_0x0a9e('0x5b')?_0x0a9e('0x5a'):_0x0a9e('0x35');var _0x542ece=util[_0x0a9e('0x4c')](_0x0a9e('0x5c'),_0x295763[_0x0a9e('0x53')],_0x2a28c0[_0x0a9e('0x5d')],md5(_0x2a28c0['uniqueid']));if(_0x1b0b98&&_0x1b0b98[_0x0a9e('0x5e')]){logger[_0x0a9e('0x10')](_0x0a9e('0x5f'),_0x0a9e('0x60'));_0x2a28c0['recordingURL']=_0x542ece;}else if(_0x243d12&&_0x243d12[_0x0a9e('0x61')]&&_0x243d12[_0x0a9e('0x61')]!==_0x0a9e('0x62')){logger[_0x0a9e('0x10')](_0x0a9e('0x63'),_0x0a9e('0x60'));_0x2a28c0[_0x0a9e('0x64')]=_0x542ece;}else{_0x2a28c0[_0x0a9e('0x64')]='';}return getAdminUser(_0x4edbb0,_0x30944e,_0x1148a1,_0x23a7d3,_0x427946,_0x56e31e)[_0x0a9e('0x19')](getUser(_0x4edbb0,_0x30944e,_0x23a7d3,_0x427946,_0x56e31e))[_0x0a9e('0x19')](getEndUser(_0x4edbb0,_0x30944e,_0x23a7d3,_0x427946,_0x56e31e))[_0x0a9e('0x19')](getTicket(_0x4edbb0,_0x30944e,_0x23a7d3,_0x4257c9,_0x2a28c0,_0x427946))[_0x0a9e('0x19')](function(_0x25744a){logger[_0x0a9e('0x10')](util['format'](_0x0a9e('0x65'),_0x25744a[_0x0a9e('0x3f')]));logger[_0x0a9e('0x10')](util['format'](_0x0a9e('0x66'),_0x4edbb0));if(_0x4edbb0!==_0x0a9e('0x5b')){logger[_0x0a9e('0x10')]('['+[_0x4edbb0[_0x0a9e('0x11')]()]+']','Displaying\x20call\x20in\x20a\x20new\x20tab...');emit(_0x295763['remoteUri'],_0x5150a4[_0x0a9e('0x33')],_0x25744a[_0x0a9e('0x3f')]);}})['catch'](function(_0x45108c){logger['error']('['+[_0x4edbb0[_0x0a9e('0x11')]()]+_0x0a9e('0x67'),util['inspect'](_0x45108c,{'showHidden':!![],'depth':null}));});};
\ No newline at end of file
+var _0xa9e0=['validateEmail','userEmail','sys_user?sysparm_query=email%3D','],\x20getUser\x20rp\x20obj','then','],\x20getUser\x20entity','userId','adminEmail','],\x20getUser\x20crm','catch','],\x20createEndUser\x20input\x20crm','POST','sys_user?','user','endUserNumber','true','System','],\x20getEndUser\x20crm','],\x20createEndUser\x20crm','length','forEach','type','customField','idField','content','toString','toLowerCase','variable','variableName','Variable','name',']\x20getTicket\x20input\x20crm','outbound','incident','assign','getString','Descriptions','Fields',']\x20POST\x20incident\x20entity\x20schema',']\x20getTicket\x20crm','label','Incident','ticketId','Incident\x20-\x20','ticketNumber','push','all',']\x20arrayPromises:\x20IDs\x20in\x20table\x20label','Tags','map','%26sysparm_record_target%3Dincident','%26sysparm_record_row%3D1%26sysparm_record_rows%3D39','%26sysparm_record_list%3Dactive%253Dtrue','%255EORDERBYDESCnumber','/nav_to.do?uri=incident.do?sys_id%3D','format','user:%s','emit','trigger:browser:url','password','sysparm_limit=1','sysparm_display_value=true','serverUrl','stripTrailingSlash','%s/api/now/table/','remoteUri','email','destcalleridnum','calleridnum','queue','abandoned','%s/api/voice/recordings/%s/downloads?type=uniqueid&token=%s','uniqueid','monitor_format','[QUEUE]','Recording\x20is\x20enabled!','recordingFormat','none','[OUTBOUND]','recordingURL','The\x20ticket\x20ID\x20is:\x20%s','call\x20direction:\x20%s',']\x20Error\x20running\x20ServiceNow\x20integration','lodash','bluebird','request-promise','ioredis','../../../../config/environment','../../../../config/logger','servicenow','redis','defaults','localhost','socket.io-emitter','GET','sys_user?sysparm_query=user_name%3Dadmin','adminId','result','sys_id','info','toUpperCase','],\x20getAdminUser\x20crm','error','message'];(function(_0x397e5f,_0x454c8f){var _0x5302b8=function(_0x1a29ef){while(--_0x1a29ef){_0x397e5f['push'](_0x397e5f['shift']());}};_0x5302b8(++_0x454c8f);}(_0xa9e0,0x123));var _0x0a9e=function(_0x6c993a,_0x5ea3ab){_0x6c993a=_0x6c993a-0x0;var _0x27f547=_0xa9e0[_0x6c993a];return _0x27f547;};'use strict';var _=require(_0x0a9e('0x0'));var Promise=require(_0x0a9e('0x1'));var rp=require(_0x0a9e('0x2'));var util=require('util');var md5=require('md5');var Redis=require(_0x0a9e('0x3'));var intUtil=require('./util');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 io=require(_0x0a9e('0xa'))(new Redis(config[_0x0a9e('0x7')]));function getAdminUser(_0x5f41ea,_0x503809,_0xe42b77,_0x56465b,_0x52cace,_0x39753a){return new Promise(function(_0xf81284,_0x307b3e){var _0x3ab53f={'method':_0x0a9e('0xb'),'uri':_0x56465b+_0x0a9e('0xc')+'&'+_0x52cace+'&'+_0x39753a,'auth':_0x503809,'json':!![]};return rp(_0x3ab53f)['then'](function(_0x50dfb2){if(_0x50dfb2['result']['length']>0x0){_0xe42b77[_0x0a9e('0xd')]=_0x50dfb2[_0x0a9e('0xe')][0x0][_0x0a9e('0xf')];}logger[_0x0a9e('0x10')]('['+[_0x5f41ea[_0x0a9e('0x11')]()]+_0x0a9e('0x12'),_0xe42b77);_0xf81284(_0xe42b77);})['catch'](function(_0x4283ce){logger[_0x0a9e('0x13')]('['+[_0x5f41ea[_0x0a9e('0x11')]()]+']',_0x4283ce[_0x0a9e('0x14')]);_0x307b3e(_0x4283ce[_0x0a9e('0x14')]);});});}function getUser(_0x4d5611,_0x52a03d,_0x22dccb,_0x5d0880,_0x1985b6){return function(_0x519dfd){logger[_0x0a9e('0x10')]('['+[_0x4d5611[_0x0a9e('0x11')]()]+'],\x20getUser\x20input\x20crm',_0x519dfd);return new Promise(function(_0x225616,_0x5a0a06){if(intUtil[_0x0a9e('0x15')](_0x519dfd[_0x0a9e('0x16')])){var _0x106033={'method':_0x0a9e('0xb'),'uri':_0x22dccb+_0x0a9e('0x17')+_0x519dfd[_0x0a9e('0x16')]+'&'+_0x5d0880+'&'+_0x1985b6,'auth':_0x52a03d,'json':!![]};logger[_0x0a9e('0x10')]('['+[_0x4d5611[_0x0a9e('0x11')]()]+_0x0a9e('0x18'),_0x106033);return rp(_0x106033)[_0x0a9e('0x19')](function(_0x1c696a){logger[_0x0a9e('0x10')]('['+[_0x4d5611['toUpperCase']()]+_0x0a9e('0x1a'),_0x1c696a);if(_0x1c696a[_0x0a9e('0xe')]['length']>0x0&&String(_0x1c696a[_0x0a9e('0xe')][0x0]['active'])==='true'){_0x519dfd[_0x0a9e('0x1b')]=_0x1c696a[_0x0a9e('0xe')][0x0][_0x0a9e('0xf')];}else{_0x519dfd[_0x0a9e('0x1b')]=_0x519dfd['adminId'];_0x519dfd[_0x0a9e('0x16')]=_0x519dfd[_0x0a9e('0x1c')];}logger[_0x0a9e('0x10')]('['+[_0x4d5611[_0x0a9e('0x11')]()]+_0x0a9e('0x1d'),_0x519dfd);_0x225616(_0x519dfd);})[_0x0a9e('0x1e')](function(_0x16b1ca){logger['error']('['+[_0x4d5611['toUpperCase']()]+']',_0x16b1ca[_0x0a9e('0x14')]);_0x5a0a06(_0x16b1ca[_0x0a9e('0x14')]);});}else{logger[_0x0a9e('0x10')]('['+[_0x4d5611[_0x0a9e('0x11')]()]+']\x20using\x20admin\x20profile');_0x519dfd[_0x0a9e('0x1b')]=_0x519dfd['adminId'];_0x519dfd[_0x0a9e('0x16')]=_0x519dfd['adminEmail'];_0x225616(_0x519dfd);}});};}function createEndUser(_0x1dc186,_0x34dc65,_0x25fba9,_0x14433c,_0x140511){logger[_0x0a9e('0x10')]('['+[_0x1dc186[_0x0a9e('0x11')]()]+_0x0a9e('0x1f'),_0x25fba9);return new Promise(function(_0x5a101a,_0x3652a7){var _0x468813={'method':_0x0a9e('0x20'),'uri':_0x14433c+_0x0a9e('0x21')+_0x140511,'body':{'user_name':_0x25fba9['endUserNumber'],'roles':_0x0a9e('0x22'),'first_name':_0x25fba9[_0x0a9e('0x23')],'active':_0x0a9e('0x24'),'date_format':_0x0a9e('0x25'),'phone':_0x25fba9[_0x0a9e('0x23')]},'auth':_0x34dc65,'json':!![]};return rp(_0x468813)[_0x0a9e('0x19')](function(_0x296f41){logger[_0x0a9e('0x10')]('['+[_0x1dc186[_0x0a9e('0x11')]()]+'],\x20EndUser\x20schema',_0x296f41[_0x0a9e('0xe')]);_0x25fba9['endUserId']=_0x296f41[_0x0a9e('0xe')][_0x0a9e('0xf')];_0x5a101a(_0x25fba9);})[_0x0a9e('0x1e')](function(_0x33bdb7){logger[_0x0a9e('0x13')]('['+[_0x1dc186['toUpperCase']()]+']',_0x33bdb7[_0x0a9e('0x14')]);_0x3652a7(_0x33bdb7[_0x0a9e('0x14')]);});});}function getEndUser(_0x40cb85,_0x2da5c0,_0x2b45ea,_0x409319,_0x332d35){return function(_0x39e565){logger['info']('['+[_0x40cb85[_0x0a9e('0x11')]()]+'],\x20getEndUser\x20input\x20crm',_0x39e565);return new Promise(function(_0x2cc7a0,_0x14b13f){var _0x2b7e7f={'method':_0x0a9e('0xb'),'uri':_0x2b45ea+'sys_user?sysparm_query=phone%3D'+_0x39e565[_0x0a9e('0x23')]+'&'+_0x409319+'&'+_0x332d35,'auth':_0x2da5c0,'json':!![]};return rp(_0x2b7e7f)[_0x0a9e('0x19')](function(_0x1fa90d){if(_0x1fa90d[_0x0a9e('0xe')]['length']>0x0){_0x39e565['endUserId']=_0x1fa90d[_0x0a9e('0xe')][0x0]['sys_id'];logger[_0x0a9e('0x10')]('['+[_0x40cb85[_0x0a9e('0x11')]()]+_0x0a9e('0x26'),_0x39e565);_0x2cc7a0(_0x39e565);}else{return createEndUser(_0x40cb85,_0x2da5c0,_0x39e565,_0x2b45ea,_0x409319)[_0x0a9e('0x19')](function(_0x4f41ae){logger[_0x0a9e('0x10')]('['+[_0x40cb85[_0x0a9e('0x11')]()]+_0x0a9e('0x27'),_0x4f41ae);_0x2cc7a0(_0x4f41ae);});}})['catch'](function(_0x1dbf74){logger[_0x0a9e('0x13')]('['+[_0x40cb85[_0x0a9e('0x11')]()]+']',_0x1dbf74['message']);_0x14b13f(_0x1dbf74['message']);});});};}function getCustomFields(_0x11b61d,_0x40d766){var _0x5adda1={};if(_0x11b61d[_0x0a9e('0x28')]>0x0){_[_0x0a9e('0x29')](_0x11b61d,function(_0x2e1b3a){if(_0x2e1b3a[_0x0a9e('0x2a')]==='string'&&_0x2e1b3a['nameField']&&!_0x2e1b3a[_0x0a9e('0x2b')]){_0x5adda1[_0x2e1b3a[_0x0a9e('0x2c')]['toLowerCase']()]=_0x2e1b3a[_0x0a9e('0x2d')][_0x0a9e('0x2e')]();}else if(_0x2e1b3a[_0x0a9e('0x2a')]==='string'&&_0x2e1b3a[_0x0a9e('0x2c')]&&_0x2e1b3a[_0x0a9e('0x2b')]){_0x5adda1[_0x2e1b3a[_0x0a9e('0x2c')][_0x0a9e('0x2f')]()]=_0x2e1b3a[_0x0a9e('0x2d')][_0x0a9e('0x2e')]();}else if(_0x2e1b3a[_0x0a9e('0x2a')]===_0x0a9e('0x30')&&_0x2e1b3a[_0x0a9e('0x31')]&&_0x2e1b3a[_0x0a9e('0x2c')]&&_0x2e1b3a[_0x0a9e('0x2b')]){_0x5adda1[_0x2e1b3a[_0x0a9e('0x2c')][_0x0a9e('0x2f')]()]=_0x40d766[_0x2e1b3a[_0x0a9e('0x31')]][_0x0a9e('0x2e')]();}else if(_0x2e1b3a['type']==='customVariable'&&_0x2e1b3a[_0x0a9e('0x32')]&&_0x2e1b3a[_0x0a9e('0x32')][_0x0a9e('0x33')]&&_0x2e1b3a[_0x0a9e('0x2c')]&&_0x2e1b3a[_0x0a9e('0x2b')]){_0x5adda1[_0x2e1b3a[_0x0a9e('0x2c')][_0x0a9e('0x2f')]()]=_0x40d766[_0x2e1b3a[_0x0a9e('0x32')][_0x0a9e('0x33')][_0x0a9e('0x2f')]()][_0x0a9e('0x2e')]();}});}return _0x5adda1;}function getTicket(_0x35ed4a,_0x5026aa,_0x117c99,_0x138b8b,_0xdd268f,_0xfbd5ad){return function(_0x2e8caf){logger[_0x0a9e('0x10')]('['+[_0x35ed4a[_0x0a9e('0x11')]()]+_0x0a9e('0x34'),_0x2e8caf);return new Promise(function(_0x59afe8,_0x2e9d90){var _0x48fd45=_0x35ed4a[_0x0a9e('0x2f')]()===_0x0a9e('0x35')?_0x2e8caf[_0x0a9e('0x1b')]:_0x2e8caf['endUserId'];var _0x14bec2={'method':_0x0a9e('0x20'),'uri':_0x117c99+_0x0a9e('0x36')+'?'+_0xfbd5ad,'body':Object[_0x0a9e('0x37')]({},{'active':_0x0a9e('0x24'),'caller_id':_0x48fd45,'assigned_to':_0x2e8caf[_0x0a9e('0x1b')],'short_description':intUtil[_0x0a9e('0x38')](_0x138b8b['Subjects'],_0xdd268f,'\x20'),'description':intUtil[_0x0a9e('0x38')](_0x138b8b[_0x0a9e('0x39')],_0xdd268f,'\x0a')},getCustomFields(_0x138b8b[_0x0a9e('0x3a')],_0xdd268f)),'auth':_0x5026aa,'json':!![]};return rp(_0x14bec2)[_0x0a9e('0x19')](function(_0x409789){logger[_0x0a9e('0x10')]('['+[_0x35ed4a[_0x0a9e('0x11')]()]+_0x0a9e('0x3b'),_0x409789[_0x0a9e('0xe')]);_0x2e8caf['ticketId']=_0x409789[_0x0a9e('0xe')][_0x0a9e('0xf')];_0x2e8caf['ticketNumber']=_0x409789['result']['number'];logger[_0x0a9e('0x10')]('['+[_0x35ed4a[_0x0a9e('0x11')]()]+_0x0a9e('0x3c'),_0x2e8caf);_0x59afe8(_0x2e8caf);})[_0x0a9e('0x1e')](function(_0x61bb17){logger[_0x0a9e('0x13')]('['+[_0x35ed4a[_0x0a9e('0x11')]()]+']',_0x61bb17[_0x0a9e('0x14')]);_0x2e9d90(_0x61bb17['message']);});});};}function createRemoteTag(_0x4b1b9f,_0x53975a,_0x39d77d,_0x204173){return new Promise(function(_0x14d602,_0x5bb3ed){var _0x2b69d9={'method':_0x0a9e('0x20'),'uri':_0x39d77d+'label'+'?'+_0x204173,'body':{'short_description':_0x4b1b9f,'global':!![],'active':!![],'name':_0x4b1b9f},'auth':_0x53975a,'json':!![]};return rp(_0x2b69d9)['then'](function(_0x2ef381){var _0x59c6ff=_0x2ef381[_0x0a9e('0xe')]['sys_id'];_0x14d602(_0x59c6ff);});});}function getRemoteTag(_0x2e5e62,_0x3c20b2,_0x439340,_0x53613a,_0x2f82da){return new Promise(function(_0x1bf38a,_0x508b47){var _0x50f687={'method':_0x0a9e('0xb'),'uri':_0x439340+_0x0a9e('0x3d')+'?sysparm_query=name%3D'+_0x2e5e62+'&'+_0x53613a,'auth':_0x3c20b2,'json':!![]};return rp(_0x50f687)[_0x0a9e('0x19')](function(_0x5ce9ac){if(_0x5ce9ac[_0x0a9e('0xe')]['length']>0x0){var _0xe22ccc=_0x5ce9ac['result'][0x0]['sys_id'];_0x1bf38a(_0xe22ccc);}else{return createRemoteTag(_0x2e5e62,_0x3c20b2,_0x439340,_0x53613a)['then'](function(_0x2da03c){_0x1bf38a(_0x2da03c);});}});});}function assignTagToIncident(_0x47de4c,_0x2f7092,_0x65432,_0x3cfd00,_0x19b4df){return new Promise(function(_0x232830,_0x272738){var _0xd10662={'method':_0x0a9e('0x20'),'uri':_0x65432+'label_entry'+'?'+_0x19b4df,'body':{'label':_0x47de4c,'table':_0x0a9e('0x36'),'id_type':_0x0a9e('0x3e'),'table_key':_0x3cfd00[_0x0a9e('0x3f')],'title':_0x0a9e('0x40')+_0x3cfd00[_0x0a9e('0x41')],'id_display':_0x3cfd00[_0x0a9e('0x41')]},'auth':_0x2f7092,'json':!![]};return rp(_0xd10662)['then'](function(_0x956fbe){_0x232830();})[_0x0a9e('0x1e')](function(){_0x232830();});});}function manageTags(_0x5239ef,_0x3649cc,_0x5cc8fb,_0x20c668,_0x5ba1f9,_0x4b3c1a,_0x5674ee){return new Promise(function(_0x273cb5,_0x49d231){var _0x2244d6=[];_0x3649cc[_0x0a9e('0x29')](function(_0x261adb){_0x2244d6[_0x0a9e('0x42')](getRemoteTag(_0x261adb,_0x5cc8fb,_0x20c668,_0x4b3c1a,_0x5674ee));});return Promise[_0x0a9e('0x43')](_0x2244d6)[_0x0a9e('0x19')](function(_0x49eed0){if(_0x49eed0[_0x0a9e('0x28')]){logger['info']('['+[_0x5239ef[_0x0a9e('0x11')]()]+_0x0a9e('0x44'),_0x49eed0);var _0x51aaf7=[];_0x49eed0['forEach'](function(_0x453360){_0x51aaf7[_0x0a9e('0x42')](assignTagToIncident(_0x453360,_0x5cc8fb,_0x20c668,_0x5ba1f9,_0x4b3c1a));});return Promise[_0x0a9e('0x43')](_0x51aaf7)[_0x0a9e('0x19')](function(){_0x273cb5();})['catch'](function(){_0x273cb5();});}else{_0x273cb5();}});});}function getTags(_0x1d0dc8,_0xe05a5a,_0x54327c,_0x797b45,_0x17e88c,_0x88dcbf){return function(_0x409b29){return new Promise(function(_0x401837,_0x4d4a35){var _0x176840=[];var _0x2937e0=_0x797b45[_0x0a9e('0x45')];if(_0x2937e0&&_0x2937e0['length']>0x0){_0x176840=_[_0x0a9e('0x46')](_0x2937e0,'name');}if(_0x176840['length']>0x0){return manageTags(_0x1d0dc8,_0x176840,_0xe05a5a,_0x54327c,_0x409b29,_0x17e88c,_0x88dcbf)[_0x0a9e('0x19')](function(){_0x401837(_0x409b29);});}else{_0x401837(_0x409b29);}});};}function emit(_0x4556c5,_0x9375fb,_0x19c995){var _0x186f39=_0x0a9e('0x47')+_0x0a9e('0x48')+_0x0a9e('0x49')+_0x0a9e('0x4a');var _0x1cc4f3={'uri':_0x4556c5+_0x0a9e('0x4b')+_0x19c995+_0x186f39};io['to'](util[_0x0a9e('0x4c')](_0x0a9e('0x4d'),_0x9375fb))[_0x0a9e('0x4e')](_0x0a9e('0x4f'),_0x1cc4f3);}exports['cs']=function(_0x412a72,_0x2a28c0,_0x4257c9,_0x5150a4,_0x1b0b98,_0x295763,_0x243d12,_0x4edbb0){var _0x1148a1={};var _0x30944e={'user':_0x295763['username'],'pass':_0x295763[_0x0a9e('0x50')]};var _0x56e31e=_0x0a9e('0x51');var _0x427946=_0x0a9e('0x52');_0x295763['remoteUri']=intUtil['stripTrailingSlash'](_0x295763['remoteUri']);_0x295763[_0x0a9e('0x53')]=intUtil[_0x0a9e('0x54')](_0x295763[_0x0a9e('0x53')]);var _0x23a7d3=util[_0x0a9e('0x4c')](_0x0a9e('0x55'),_0x295763[_0x0a9e('0x56')]);_0x1148a1[_0x0a9e('0x16')]=!_['isNil'](_0x5150a4)?_0x5150a4[_0x0a9e('0x57')]:null;_0x1148a1[_0x0a9e('0x1c')]=_0x295763[_0x0a9e('0x57')];_0x1148a1['endUserNumber']=_0x4edbb0[_0x0a9e('0x2f')]()==='outbound'?_0x2a28c0[_0x0a9e('0x58')]:_0x2a28c0[_0x0a9e('0x59')];_0x1148a1['callDirection']=_0x4edbb0===_0x0a9e('0x5a')||_0x4edbb0===_0x0a9e('0x5b')?_0x0a9e('0x5a'):_0x0a9e('0x35');var _0x542ece=util[_0x0a9e('0x4c')](_0x0a9e('0x5c'),_0x295763[_0x0a9e('0x53')],_0x2a28c0[_0x0a9e('0x5d')],md5(_0x2a28c0['uniqueid']));if(_0x1b0b98&&_0x1b0b98[_0x0a9e('0x5e')]){logger[_0x0a9e('0x10')](_0x0a9e('0x5f'),_0x0a9e('0x60'));_0x2a28c0['recordingURL']=_0x542ece;}else if(_0x243d12&&_0x243d12[_0x0a9e('0x61')]&&_0x243d12[_0x0a9e('0x61')]!==_0x0a9e('0x62')){logger[_0x0a9e('0x10')](_0x0a9e('0x63'),_0x0a9e('0x60'));_0x2a28c0[_0x0a9e('0x64')]=_0x542ece;}else{_0x2a28c0[_0x0a9e('0x64')]='';}return getAdminUser(_0x4edbb0,_0x30944e,_0x1148a1,_0x23a7d3,_0x427946,_0x56e31e)[_0x0a9e('0x19')](getUser(_0x4edbb0,_0x30944e,_0x23a7d3,_0x427946,_0x56e31e))[_0x0a9e('0x19')](getEndUser(_0x4edbb0,_0x30944e,_0x23a7d3,_0x427946,_0x56e31e))[_0x0a9e('0x19')](getTicket(_0x4edbb0,_0x30944e,_0x23a7d3,_0x4257c9,_0x2a28c0,_0x427946))[_0x0a9e('0x19')](function(_0x25744a){logger[_0x0a9e('0x10')](util['format'](_0x0a9e('0x65'),_0x25744a[_0x0a9e('0x3f')]));logger[_0x0a9e('0x10')](util['format'](_0x0a9e('0x66'),_0x4edbb0));if(_0x4edbb0!==_0x0a9e('0x5b')){logger[_0x0a9e('0x10')]('['+[_0x4edbb0[_0x0a9e('0x11')]()]+']','Displaying\x20call\x20in\x20a\x20new\x20tab...');emit(_0x295763['remoteUri'],_0x5150a4[_0x0a9e('0x33')],_0x25744a[_0x0a9e('0x3f')]);}})['catch'](function(_0x45108c){logger['error']('['+[_0x4edbb0[_0x0a9e('0x11')]()]+_0x0a9e('0x67'),util['inspect'](_0x45108c,{'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 4cb66ef..3e02285 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 _0x867f=['redis','localhost','socket.io-emitter','emit','info','name','getString','created_by','toISOString','slice','replace','duration_hours','duration_minutes','parent_id','parent_type','Contacts','parent_name','direction','forEach','push','set_entry','JSON','Calls','format','Basic\x20%s','apiKey','toString','base64','isNil','get_entry_list','stringify','Employees','INSTR\x20(\x20users.user_name,\x20\x22%s\x22)\x20>\x200','user_name','then','entry_list','length','find','name_value_list','value','Agent\x20found!','resolve','Agent\x20not\x20found,\x20using\x20the\x20admin\x20account!','user_id','Agent\x20not\x20available,\x20using\x20the\x20admin\x20account!','Searching\x20enduser\x20with\x20phone','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','type','string','nameField','customField','toLowerCase','idField','custom_fields','variable','variableName','customVariable','Variable','POST','login','xCALLY\x20Motion\x20integration','sessionID','Account\x20%d\x20is\x20not\x20valid','set_relationship','queue','remoteUri','stripTrailingSlash','serverUrl','%s/service/v4_1/rest.php','[QUEUE]','Recording\x20is\x20enabled!','recordingURL','uniqueid','calleridname','calleridnum','The\x20Enduser\x20ID\x20is:','Fields','Inbound','The\x20Ticket\x20ID\x20is:','users','contacts','version','charAt','user:%s','trigger:browser:url','catch','outbound','recordingFormat','none','[OUTBOUND]','The\x20User\x20ID\x20is:','destcalleridname','Outbound','Ticket\x20created!','%s/index.php?action=ajaxui#ajaxUILoc=index.php%3Fmodule%3DCalls%26action%3DEditView%26record%3D%s','Displaying\x20ticket\x20to\x20agent\x20in\x20a\x20new\x20tab...','error','abandoned','uri','monitor_format','%s/api/voice/recordings/%s/downloads?type=uniqueid&token=%s','lodash','request-promise','bluebird','md5','util','ioredis','./util','../../../../config/environment','../../../../config/logger','defaults'];(function(_0x263a74,_0xc31414){var _0x2aa86c=function(_0x382896){while(--_0x382896){_0x263a74['push'](_0x263a74['shift']());}};_0x2aa86c(++_0xc31414);}(_0x867f,0xe6));var _0xf867=function(_0x6b8e6,_0x5b5b8d){_0x6b8e6=_0x6b8e6-0x0;var _0x11e8d9=_0x867f[_0x6b8e6];return _0x11e8d9;};'use strict';var _=require(_0xf867('0x0'));var rp=require(_0xf867('0x1'));var BPromise=require(_0xf867('0x2'));var md5=require(_0xf867('0x3'));var util=require(_0xf867('0x4'));var Redis=require(_0xf867('0x5'));var intUtil=require(_0xf867('0x6'));var config=require(_0xf867('0x7'));var logger=require(_0xf867('0x8'))('sugarcrm');config['redis']=_[_0xf867('0x9')](config[_0xf867('0xa')],{'host':_0xf867('0xb'),'port':0x18eb});var io=require(_0xf867('0xc'))(new Redis(config[_0xf867('0xa')]));var def={'method':'POST','json':!![]};function emit(_0x583f87,_0x26cfba,_0x538ee9){io['to'](_0x583f87)[_0xf867('0xd')](_0x26cfba,_0x538ee9);}function getTicket(_0x2b1c12,_0x1cf341,_0xb26c33,_0x4a385d,_0x462870,_0x43eeb2,_0x3c9a3f,_0x4f59c2){logger[_0xf867('0xe')]('Creating\x20new\x20ticket...');var _0x4a1252=new Date();var _0x1711b0=[{'name':_0xf867('0xf'),'value':intUtil[_0xf867('0x10')](_0x4a385d['Subjects'],_0x462870,'\x20')},{'name':'assigned_user_id','value':_0x1cf341['id']},{'name':_0xf867('0x11'),'value':_0x1cf341['id']},{'name':'description','value':intUtil[_0xf867('0x10')](_0x4a385d['Descriptions'],_0x462870,'\x0a')},{'name':'date_start','value':_0x4a1252[_0xf867('0x12')]()[_0xf867('0x13')](0x0,0x13)[_0xf867('0x14')]('T','\x20')},{'name':_0xf867('0x15'),'value':'0'},{'name':_0xf867('0x16'),'value':'15'},{'name':_0xf867('0x17'),'value':_0xb26c33['id']},{'name':_0xf867('0x18'),'value':_0xf867('0x19')},{'name':_0xf867('0x1a'),'value':_0xb26c33['name']},{'name':_0xf867('0x1b'),'value':_0x4f59c2}];if(_0x43eeb2['length']){_[_0xf867('0x1c')](_0x43eeb2,function(_0x47dfa7){if(_0x462870[_0x47dfa7['variableName']]){_0x1711b0[_0xf867('0x1d')]({'name':_0x47dfa7['idField'],'value':_0x462870[_0x47dfa7['variableName']]});}});}return request({'form':{'method':_0xf867('0x1e'),'input_type':_0xf867('0x1f'),'response_type':'JSON','rest_data':JSON['stringify']({'session':_0x3c9a3f['id'],'module_name':_0xf867('0x20'),'name_value_list':_0x1711b0})}});}function getAuth(_0x23e7dd){return util[_0xf867('0x21')](_0xf867('0x22'),new Buffer(_0x23e7dd[_0xf867('0x23')]+':X')[_0xf867('0x24')](_0xf867('0x25')));}function getServerInfo(_0x34db74){return request({'form':{'method':'get_server_info','input_type':'JSON','response_type':_0xf867('0x1f'),'rest_data':JSON['stringify']({'session':_0x34db74['id']})}});}function getUser(_0x3072b7,_0x3fc971,_0x4da34b){if(!_[_0xf867('0x26')](_0x3fc971)){logger[_0xf867('0xe')]('Getting\x20agent\x20with\x20name',_0x3fc971);return request({'form':{'method':_0xf867('0x27'),'input_type':_0xf867('0x1f'),'response_type':_0xf867('0x1f'),'rest_data':JSON[_0xf867('0x28')]({'session':_0x4da34b['id'],'module_name':_0xf867('0x29'),'query':util[_0xf867('0x21')](_0xf867('0x2a'),_0x3fc971),'order_by':'','offset':'0','select_fields':['id',_0xf867('0xf'),_0xf867('0x2b')],'link_name_to_fields_array':[],'max_results':-0x1,'deleted':'0'})}})[_0xf867('0x2c')](function(_0x28b44a){if(_0x28b44a[_0xf867('0x2d')][_0xf867('0x2e')]){var _0x234fa0=_[_0xf867('0x2f')](_0x28b44a[_0xf867('0x2d')],function(_0x57bf28){return _0x57bf28[_0xf867('0x30')][_0xf867('0x2b')][_0xf867('0x31')]===_0x3fc971;});if(_0x234fa0){logger[_0xf867('0xe')](_0xf867('0x32'));return BPromise[_0xf867('0x33')]({'id':_0x234fa0[_0xf867('0x30')]['id']['value'],'name':_0x234fa0[_0xf867('0x30')][_0xf867('0xf')][_0xf867('0x31')]});}}logger[_0xf867('0xe')](_0xf867('0x34'));return BPromise[_0xf867('0x33')]({'id':_0x4da34b[_0xf867('0x30')][_0xf867('0x35')]['value'],'name':_0x4da34b[_0xf867('0x30')]['user_name'][_0xf867('0x31')]});});}else{logger['info'](_0xf867('0x36'));return BPromise[_0xf867('0x33')]({'id':_0x4da34b[_0xf867('0x30')]['user_id'][_0xf867('0x31')],'name':_0x4da34b[_0xf867('0x30')]['user_name']['value']});}}function getEndUser(_0xc1f9ce,_0x543697,_0x3020f2,_0x13e028){logger[_0xf867('0xe')](_0xf867('0x37'),_0x3020f2);return request({'form':{'method':'get_entry_list','input_type':'JSON','response_type':_0xf867('0x1f'),'rest_data':JSON[_0xf867('0x28')]({'session':_0x13e028['id'],'module_name':_0xf867('0x19'),'query':util['format'](_0xf867('0x38'),_0x3020f2),'order_by':'','offset':'0','select_fields':['id',_0xf867('0xf'),'phone_home'],'link_name_to_fields_array':[],'max_results':-0x1,'deleted':'0'})}})[_0xf867('0x2c')](function(_0x5e9234){if(_0x5e9234[_0xf867('0x2d')][_0xf867('0x2e')]){var _0x326abf=_['find'](_0x5e9234[_0xf867('0x2d')],function(_0x4db89e){return _0x4db89e[_0xf867('0x30')][_0xf867('0x39')][_0xf867('0x31')]===_0x3020f2;});if(_0x326abf){logger[_0xf867('0xe')](_0xf867('0x3a'));return BPromise[_0xf867('0x33')]({'id':_0x326abf[_0xf867('0x30')]['id'][_0xf867('0x31')],'name':_0x326abf['name_value_list']['name'][_0xf867('0x31')],'phone':_0x326abf[_0xf867('0x30')][_0xf867('0x39')][_0xf867('0x31')]});}}else{logger[_0xf867('0xe')](_0xf867('0x3b'));return request({'form':{'method':_0xf867('0x1e'),'input_type':'JSON','response_type':_0xf867('0x1f'),'rest_data':JSON[_0xf867('0x28')]({'session':_0x13e028['id'],'module_name':_0xf867('0x19'),'name_value_list':[{'name':_0xf867('0x3c'),'value':_0x543697!==_0xf867('0x3d')?_0x543697:util[_0xf867('0x21')](_0xf867('0x3e'),_0x3020f2)},{'name':_0xf867('0x39'),'value':_0x3020f2}]})}})[_0xf867('0x2c')](function(_0x5f216c){logger[_0xf867('0xe')]('Enduser\x20created.');return BPromise[_0xf867('0x33')]({'id':_0x5f216c['id'],'name':_0x5f216c[_0xf867('0x2d')][_0xf867('0x3c')]['value'],'phone':_0x5f216c[_0xf867('0x2d')][_0xf867('0x39')][_0xf867('0x31')]});});}});}function request(_0xed868d){logger[_0xf867('0x3f')](_0xf867('0x40'),JSON['stringify'](_0xed868d));return rp(_[_0xf867('0x41')](def,_0xed868d));}function getTags(_0x2d02f8,_0x1d5dad){var _0x20ec01=[];if(_0x2d02f8&&_0x2d02f8[_0xf867('0x2e')]>0x0){_0x20ec01=_['map'](_0x2d02f8,_0x1d5dad);}return _0x20ec01;}function getCustomFields(_0x1ce25a,_0x4cc8c6){var _0x2507aa=[];var _0xf1fddf={'custom_fields':[]};if(_0x1ce25a['length']>0x0){_[_0xf867('0x1c')](_0x1ce25a,function(_0x46102f){if(_0x46102f[_0xf867('0x42')]===_0xf867('0x43')&&_0x46102f[_0xf867('0x44')]&&!_0x46102f[_0xf867('0x45')]){_0xf1fddf[_0x46102f['nameField'][_0xf867('0x46')]()]=_0x46102f['content'][_0xf867('0x24')]();}else if(_0x46102f[_0xf867('0x42')]===_0xf867('0x43')&&_0x46102f[_0xf867('0x47')]&&_0x46102f[_0xf867('0x45')]){_0xf1fddf[_0xf867('0x48')][_0xf867('0x1d')]({'id':_0x46102f['idField'],'value':_0x46102f['content'][_0xf867('0x24')]()});}else if(_0x46102f[_0xf867('0x42')]===_0xf867('0x49')&&_0x46102f['variableName']&&_0x46102f[_0xf867('0x47')]&&_0x46102f[_0xf867('0x45')]){_0x4cc8c6[_0x46102f[_0xf867('0x4a')]]&&_0xf1fddf['custom_fields'][_0xf867('0x1d')]({'id':_0x46102f['idField'],'value':_0x4cc8c6[_0x46102f[_0xf867('0x4a')]][_0xf867('0x24')]()});}else if(_0x46102f[_0xf867('0x42')]===_0xf867('0x4b')&&_0x46102f[_0xf867('0x4c')]&&_0x46102f[_0xf867('0x4c')][_0xf867('0xf')]&&_0x46102f[_0xf867('0x47')]&&_0x46102f['customField']){_0x4cc8c6[_0x46102f['Variable'][_0xf867('0xf')][_0xf867('0x46')]()]&&_0xf1fddf[_0xf867('0x48')][_0xf867('0x1d')]({'id':_0x46102f[_0xf867('0x47')],'value':_0x4cc8c6[_0x46102f[_0xf867('0x4c')][_0xf867('0xf')]['toLowerCase']()][_0xf867('0x24')]()});}});}return _0xf1fddf;}function getConnection(_0x536442){return request({'method':_0xf867('0x4d'),'form':{'method':_0xf867('0x4e'),'input_type':'JSON','response_type':_0xf867('0x1f'),'rest_data':JSON[_0xf867('0x28')]({'user_auth':{'user_name':_0x536442['username'],'password':_0x536442['password'],'encryption':'PLAIN'},'application':_0xf867('0x4f')})}})[_0xf867('0x2c')](function(_0x5d281a){var _0x11ac96=_0x5d281a;if(_0x11ac96['id']){def[_0xf867('0x50')]=_0x11ac96['id'];return BPromise['resolve'](_0x11ac96);}else{throw new Error(util[_0xf867('0x21')](_0xf867('0x51'),_0x536442['id']));}});}function setRelationship(_0x59d460,_0x694574,_0x3e9ad0,_0x27f03a){return request({'form':{'method':_0xf867('0x52'),'input_type':_0xf867('0x1f'),'response_type':'JSON','rest_data':JSON['stringify']({'session':_0x59d460['id'],'module_name':_0xf867('0x20'),'module_id':_0x3e9ad0['id'],'link_field_name':_0x27f03a,'related_ids':[_0x694574['id']]})}});}exports[_0xf867('0x53')]=function(_0x29ac26,_0x626097,_0x3afdc9,_0x44229e,_0x5d2139,_0x3aa88e){var _0x4220e8,_0x66fe2d,_0x23c2d9,_0x3fe4a2;_0x3aa88e[_0xf867('0x54')]=intUtil[_0xf867('0x55')](_0x3aa88e[_0xf867('0x54')]);_0x3aa88e[_0xf867('0x56')]=intUtil[_0xf867('0x55')](_0x3aa88e[_0xf867('0x56')]);def['uri']=util[_0xf867('0x21')](_0xf867('0x57'),_0x3aa88e[_0xf867('0x54')]);if(_0x5d2139&&_0x5d2139['monitor_format']){logger[_0xf867('0xe')](_0xf867('0x58'),_0xf867('0x59'));_0x626097[_0xf867('0x5a')]=util['format']('%s/api/voice/recordings/%s/downloads?type=uniqueid&token=%s',_0x3aa88e[_0xf867('0x56')],_0x626097[_0xf867('0x5b')],md5(_0x626097[_0xf867('0x5b')]));}else{_0x626097[_0xf867('0x5a')]='';}return getConnection(_0x3aa88e)['then'](function(_0x2d9794){_0x3fe4a2=_0x2d9794;return getUser(_0x3aa88e,_0x44229e['name'],_0x3fe4a2);})[_0xf867('0x2c')](function(_0x36160e){_0x4220e8=_0x36160e;logger[_0xf867('0xe')]('The\x20User\x20ID\x20is:',_0x4220e8['id']);return getEndUser(_0x3aa88e,_0x626097[_0xf867('0x5c')],_0x626097[_0xf867('0x5d')],_0x3fe4a2);})['then'](function(_0x5ef100){_0x66fe2d=_0x5ef100;logger[_0xf867('0xe')](_0xf867('0x5e'),_0x66fe2d['id']);return getTicket(_0x3aa88e,_0x4220e8,_0x66fe2d,_0x3afdc9,_0x626097,_0x3afdc9[_0xf867('0x5f')],_0x3fe4a2,_0xf867('0x60'));})[_0xf867('0x2c')](function(_0x267d60){_0x23c2d9=_0x267d60;logger[_0xf867('0xe')]('Ticket\x20created!');logger[_0xf867('0xe')](_0xf867('0x61'),_0x23c2d9['id']);return setRelationship(_0x3fe4a2,_0x4220e8,_0x23c2d9,_0xf867('0x62'));})[_0xf867('0x2c')](function(){return setRelationship(_0x3fe4a2,_0x66fe2d,_0x23c2d9,_0xf867('0x63'));})[_0xf867('0x2c')](function(){return getServerInfo(_0x3fe4a2);})[_0xf867('0x2c')](function(_0x2c06ba){var _0x167611=parseInt(_0x2c06ba[_0xf867('0x64')][_0xf867('0x65')](0x0));var _0x191884=util[_0xf867('0x21')]('%s/index.php?action=ajaxui#ajaxUILoc=index.php%3Fmodule%3DCalls%26action%3DEditView%26record%3D%s',_0x3aa88e[_0xf867('0x54')],_0x23c2d9['id']);if(_0x167611>0x6){_0x191884=util[_0xf867('0x21')]('%s/#bwc/index.php?module=Calls&action=EditView&record=%s',_0x3aa88e[_0xf867('0x54')],_0x23c2d9['id']);}logger[_0xf867('0xe')](_0xf867('0x58'),'Displaying\x20ticket\x20to\x20agent\x20in\x20a\x20new\x20tab...');emit(util[_0xf867('0x21')](_0xf867('0x66'),_0x44229e['name']),_0xf867('0x67'),{'uri':_0x191884});})[_0xf867('0x68')](function(_0x60d795){logger['error'](_0xf867('0x58'),JSON[_0xf867('0x28')](_0x60d795));});};exports[_0xf867('0x69')]=function(_0x189484,_0x4334d1,_0x5e5108,_0x25c6ec,_0x4a3b61,_0x5ecb97,_0x2e7683){var _0x1600be,_0x36baa0,_0x54a779,_0x36a388;_0x5ecb97[_0xf867('0x54')]=intUtil[_0xf867('0x55')](_0x5ecb97[_0xf867('0x54')]);_0x5ecb97[_0xf867('0x56')]=intUtil[_0xf867('0x55')](_0x5ecb97[_0xf867('0x56')]);def['uri']=util[_0xf867('0x21')](_0xf867('0x57'),_0x5ecb97[_0xf867('0x54')]);if(_0x2e7683&&_0x2e7683[_0xf867('0x6a')]&&_0x2e7683['recordingFormat']!==_0xf867('0x6b')){logger['info'](_0xf867('0x6c'),'Recording\x20is\x20enabled!');_0x4334d1['recordingURL']=util[_0xf867('0x21')]('%s/api/voice/recordings/%s/downloads?type=uniqueid&token=%s',_0x5ecb97['serverUrl'],_0x4334d1[_0xf867('0x5b')],md5(_0x4334d1[_0xf867('0x5b')]));}return getConnection(_0x5ecb97)['then'](function(_0x54b960){_0x36a388=_0x54b960;return getUser(_0x5ecb97,_0x25c6ec[_0xf867('0xf')],_0x36a388);})[_0xf867('0x2c')](function(_0x4aaca5){_0x1600be=_0x4aaca5;logger[_0xf867('0xe')](_0xf867('0x6d'),_0x1600be['id']);return getEndUser(_0x5ecb97,_0x4334d1[_0xf867('0x6e')],_0x4334d1['destcalleridnum'],_0x36a388);})[_0xf867('0x2c')](function(_0x16c58e){_0x36baa0=_0x16c58e;logger['info']('The\x20Enduser\x20ID\x20is:',_0x36baa0['id']);return getTicket(_0x5ecb97,_0x1600be,_0x36baa0,_0x5e5108,_0x4334d1,_0x5e5108['Fields'],_0x36a388,_0xf867('0x6f'));})[_0xf867('0x2c')](function(_0x21fc98){_0x54a779=_0x21fc98;logger['info'](_0xf867('0x70'));logger['info'](_0xf867('0x61'),_0x54a779['id']);return setRelationship(_0x36a388,_0x1600be,_0x54a779,_0xf867('0x62'));})[_0xf867('0x2c')](function(){return setRelationship(_0x36a388,_0x36baa0,_0x54a779,'contacts');})[_0xf867('0x2c')](function(){return getServerInfo(_0x36a388);})[_0xf867('0x2c')](function(_0x439be5){var _0x1b53b7=parseInt(_0x439be5[_0xf867('0x64')]['charAt'](0x0));var _0x1947aa=util[_0xf867('0x21')](_0xf867('0x71'),_0x5ecb97[_0xf867('0x54')],_0x54a779['id']);if(_0x1b53b7>0x6){_0x1947aa=util[_0xf867('0x21')]('%s/#bwc/index.php?module=Calls&action=EditView&record=%s',_0x5ecb97[_0xf867('0x54')],_0x54a779['id']);}logger[_0xf867('0xe')]('[OUTBOUND]',_0xf867('0x72'));emit(util[_0xf867('0x21')]('user:%s',_0x25c6ec[_0xf867('0xf')]),_0xf867('0x67'),{'uri':_0x1947aa});})[_0xf867('0x68')](function(_0x29fd7d){logger[_0xf867('0x73')](_0xf867('0x6c'),JSON[_0xf867('0x28')](_0x29fd7d));});};exports[_0xf867('0x74')]=function(_0x5d5543,_0x23bc57,_0x2b9f38,_0x4dfed6,_0x18f8b3,_0x17b7e1){var _0x3a0be5,_0x455640,_0x344cf0,_0x38df4e;_0x17b7e1[_0xf867('0x54')]=intUtil[_0xf867('0x55')](_0x17b7e1[_0xf867('0x54')]);_0x17b7e1[_0xf867('0x56')]=intUtil['stripTrailingSlash'](_0x17b7e1['serverUrl']);def[_0xf867('0x75')]=util[_0xf867('0x21')](_0xf867('0x57'),_0x17b7e1[_0xf867('0x54')]);if(_0x18f8b3&&_0x18f8b3[_0xf867('0x76')]){logger[_0xf867('0xe')]('[ABANDONED]','Recording\x20is\x20enabled!');_0x23bc57[_0xf867('0x5a')]=util[_0xf867('0x21')](_0xf867('0x77'),_0x17b7e1['serverUrl'],_0x23bc57[_0xf867('0x5b')],md5(_0x23bc57[_0xf867('0x5b')]));}else{_0x23bc57[_0xf867('0x5a')]='';}return getConnection(_0x17b7e1)['then'](function(_0x4d02f2){_0x38df4e=_0x4d02f2;if(!_[_0xf867('0x26')](_0x4dfed6)){return getUser(_0x17b7e1,_0x4dfed6[_0xf867('0xf')],_0x38df4e);}else{return getUser(_0x17b7e1,null,_0x38df4e);}})[_0xf867('0x2c')](function(_0x477667){_0x3a0be5=_0x477667;logger[_0xf867('0xe')](_0xf867('0x6d'),_0x3a0be5['id']);return getEndUser(_0x17b7e1,_0x23bc57['calleridname'],_0x23bc57['calleridnum'],_0x38df4e);})['then'](function(_0x2fde83){_0x455640=_0x2fde83;logger['info']('The\x20Enduser\x20ID\x20is:',_0x455640['id']);return getTicket(_0x17b7e1,_0x3a0be5,_0x455640,_0x2b9f38,_0x23bc57,_0x2b9f38[_0xf867('0x5f')],_0x38df4e,_0xf867('0x60'));})['then'](function(_0x409799){_0x344cf0=_0x409799;logger['info'](_0xf867('0x70'));logger[_0xf867('0xe')](_0xf867('0x61'),_0x344cf0['id']);return setRelationship(_0x38df4e,_0x3a0be5,_0x344cf0,_0xf867('0x62'));})[_0xf867('0x2c')](function(){return setRelationship(_0x38df4e,_0x455640,_0x344cf0,_0xf867('0x63'));})[_0xf867('0x2c')](function(){return getServerInfo(_0x38df4e);})[_0xf867('0x68')](function(_0x8714a9){logger[_0xf867('0x73')]('[ABANDONED]',JSON[_0xf867('0x28')](_0x8714a9));});};
\ No newline at end of file
+var _0xc239=['Ticket\x20created!','The\x20Ticket\x20ID\x20is:','contacts','version','%s/index.php?action=ajaxui#ajaxUILoc=index.php%3Fmodule%3DCalls%26action%3DEditView%26record%3D%s','Displaying\x20ticket\x20to\x20agent\x20in\x20a\x20new\x20tab...','catch','outbound','%s/service/v4_1/rest.php','recordingFormat','none','The\x20User\x20ID\x20is:','destcalleridname','destcalleridnum','Outbound','users','charAt','%s/#bwc/index.php?module=Calls&action=EditView&record=%s','trigger:browser:url','[OUTBOUND]','[ABANDONED]','Recording\x20is\x20enabled!','calleridname','lodash','bluebird','md5','util','ioredis','./util','../../../../config/environment','sugarcrm','redis','defaults','POST','emit','info','Creating\x20new\x20ticket...','name','getString','assigned_user_id','created_by','description','Descriptions','date_start','toISOString','slice','replace','duration_hours','duration_minutes','parent_id','parent_type','Contacts','parent_name','length','forEach','push','idField','variableName','set_entry','JSON','Calls','format','Basic\x20%s','apiKey','base64','stringify','isNil','Getting\x20agent\x20with\x20name','get_entry_list','Employees','user_name','then','entry_list','find','name_value_list','value','Agent\x20found!','resolve','user_id','Searching\x20enduser\x20with\x20phone','contacts.phone_home\x20=\x20\x22%s\x22','phone_home','Enduser\x20found!','Enduser\x20not\x20found,\x20creating\x20a\x20new\x20enduser!','','Enduser\x20created.','debug','merge','map','type','string','nameField','customField','toLowerCase','toString','custom_fields','content','variable','customVariable','Variable','login','username','password','PLAIN','xCALLY\x20Motion\x20integration','sessionID','Account\x20%d\x20is\x20not\x20valid','set_relationship','queue','remoteUri','stripTrailingSlash','serverUrl','uri','monitor_format','[QUEUE]','uniqueid','recordingURL','calleridnum','The\x20Enduser\x20ID\x20is:','Fields','Inbound'];(function(_0x5df79a,_0x20d3be){var _0x3f4994=function(_0x250270){while(--_0x250270){_0x5df79a['push'](_0x5df79a['shift']());}};_0x3f4994(++_0x20d3be);}(_0xc239,0x182));var _0x9c23=function(_0x1cc8fe,_0x105328){_0x1cc8fe=_0x1cc8fe-0x0;var _0x230054=_0xc239[_0x1cc8fe];return _0x230054;};'use strict';var _=require(_0x9c23('0x0'));var rp=require('request-promise');var BPromise=require(_0x9c23('0x1'));var md5=require(_0x9c23('0x2'));var util=require(_0x9c23('0x3'));var Redis=require(_0x9c23('0x4'));var intUtil=require(_0x9c23('0x5'));var config=require(_0x9c23('0x6'));var logger=require('../../../../config/logger')(_0x9c23('0x7'));config[_0x9c23('0x8')]=_[_0x9c23('0x9')](config[_0x9c23('0x8')],{'host':'localhost','port':0x18eb});var io=require('socket.io-emitter')(new Redis(config[_0x9c23('0x8')]));var def={'method':_0x9c23('0xa'),'json':!![]};function emit(_0x3813d2,_0x3af5d2,_0x242634){io['to'](_0x3813d2)[_0x9c23('0xb')](_0x3af5d2,_0x242634);}function getTicket(_0x4aad16,_0x83aafc,_0x549919,_0x43b623,_0x319767,_0x28a6a7,_0x4d7a83,_0x6c5bfe){logger[_0x9c23('0xc')](_0x9c23('0xd'));var _0x5dd66a=new Date();var _0x13b10f=[{'name':_0x9c23('0xe'),'value':intUtil[_0x9c23('0xf')](_0x43b623['Subjects'],_0x319767,'\x20')},{'name':_0x9c23('0x10'),'value':_0x83aafc['id']},{'name':_0x9c23('0x11'),'value':_0x83aafc['id']},{'name':_0x9c23('0x12'),'value':intUtil[_0x9c23('0xf')](_0x43b623[_0x9c23('0x13')],_0x319767,'\x0a')},{'name':_0x9c23('0x14'),'value':_0x5dd66a[_0x9c23('0x15')]()[_0x9c23('0x16')](0x0,0x13)[_0x9c23('0x17')]('T','\x20')},{'name':_0x9c23('0x18'),'value':'0'},{'name':_0x9c23('0x19'),'value':'15'},{'name':_0x9c23('0x1a'),'value':_0x549919['id']},{'name':_0x9c23('0x1b'),'value':_0x9c23('0x1c')},{'name':_0x9c23('0x1d'),'value':_0x549919[_0x9c23('0xe')]},{'name':'direction','value':_0x6c5bfe}];if(_0x28a6a7[_0x9c23('0x1e')]){_[_0x9c23('0x1f')](_0x28a6a7,function(_0x331587){if(_0x319767[_0x331587['variableName']]){_0x13b10f[_0x9c23('0x20')]({'name':_0x331587[_0x9c23('0x21')],'value':_0x319767[_0x331587[_0x9c23('0x22')]]});}});}return request({'form':{'method':_0x9c23('0x23'),'input_type':_0x9c23('0x24'),'response_type':_0x9c23('0x24'),'rest_data':JSON['stringify']({'session':_0x4d7a83['id'],'module_name':_0x9c23('0x25'),'name_value_list':_0x13b10f})}});}function getAuth(_0x279bb7){return util[_0x9c23('0x26')](_0x9c23('0x27'),new Buffer(_0x279bb7[_0x9c23('0x28')]+':X')['toString'](_0x9c23('0x29')));}function getServerInfo(_0x197233){return request({'form':{'method':'get_server_info','input_type':_0x9c23('0x24'),'response_type':_0x9c23('0x24'),'rest_data':JSON[_0x9c23('0x2a')]({'session':_0x197233['id']})}});}function getUser(_0x3ae76b,_0xbfe603,_0x5dd23f){if(!_[_0x9c23('0x2b')](_0xbfe603)){logger[_0x9c23('0xc')](_0x9c23('0x2c'),_0xbfe603);return request({'form':{'method':_0x9c23('0x2d'),'input_type':_0x9c23('0x24'),'response_type':_0x9c23('0x24'),'rest_data':JSON['stringify']({'session':_0x5dd23f['id'],'module_name':_0x9c23('0x2e'),'query':util[_0x9c23('0x26')]('INSTR\x20(\x20users.user_name,\x20\x22%s\x22)\x20>\x200',_0xbfe603),'order_by':'','offset':'0','select_fields':['id','name',_0x9c23('0x2f')],'link_name_to_fields_array':[],'max_results':-0x1,'deleted':'0'})}})[_0x9c23('0x30')](function(_0x299283){if(_0x299283[_0x9c23('0x31')][_0x9c23('0x1e')]){var _0xee5a2a=_[_0x9c23('0x32')](_0x299283['entry_list'],function(_0x3fc681){return _0x3fc681[_0x9c23('0x33')][_0x9c23('0x2f')][_0x9c23('0x34')]===_0xbfe603;});if(_0xee5a2a){logger[_0x9c23('0xc')](_0x9c23('0x35'));return BPromise[_0x9c23('0x36')]({'id':_0xee5a2a[_0x9c23('0x33')]['id'][_0x9c23('0x34')],'name':_0xee5a2a[_0x9c23('0x33')][_0x9c23('0xe')][_0x9c23('0x34')]});}}logger['info']('Agent\x20not\x20found,\x20using\x20the\x20admin\x20account!');return BPromise[_0x9c23('0x36')]({'id':_0x5dd23f[_0x9c23('0x33')][_0x9c23('0x37')]['value'],'name':_0x5dd23f['name_value_list'][_0x9c23('0x2f')]['value']});});}else{logger[_0x9c23('0xc')]('Agent\x20not\x20available,\x20using\x20the\x20admin\x20account!');return BPromise[_0x9c23('0x36')]({'id':_0x5dd23f[_0x9c23('0x33')][_0x9c23('0x37')][_0x9c23('0x34')],'name':_0x5dd23f[_0x9c23('0x33')][_0x9c23('0x2f')]['value']});}}function getEndUser(_0x2c3c56,_0x1edcd,_0x418b2c,_0x4b48f9){logger[_0x9c23('0xc')](_0x9c23('0x38'),_0x418b2c);return request({'form':{'method':_0x9c23('0x2d'),'input_type':_0x9c23('0x24'),'response_type':_0x9c23('0x24'),'rest_data':JSON['stringify']({'session':_0x4b48f9['id'],'module_name':'Contacts','query':util['format'](_0x9c23('0x39'),_0x418b2c),'order_by':'','offset':'0','select_fields':['id',_0x9c23('0xe'),'phone_home'],'link_name_to_fields_array':[],'max_results':-0x1,'deleted':'0'})}})[_0x9c23('0x30')](function(_0xbc6b9f){if(_0xbc6b9f['entry_list'][_0x9c23('0x1e')]){var _0x14f14e=_['find'](_0xbc6b9f[_0x9c23('0x31')],function(_0x43c696){return _0x43c696[_0x9c23('0x33')][_0x9c23('0x3a')][_0x9c23('0x34')]===_0x418b2c;});if(_0x14f14e){logger['info'](_0x9c23('0x3b'));return BPromise['resolve']({'id':_0x14f14e[_0x9c23('0x33')]['id']['value'],'name':_0x14f14e[_0x9c23('0x33')][_0x9c23('0xe')][_0x9c23('0x34')],'phone':_0x14f14e[_0x9c23('0x33')]['phone_home'][_0x9c23('0x34')]});}}else{logger[_0x9c23('0xc')](_0x9c23('0x3c'));return request({'form':{'method':'set_entry','input_type':_0x9c23('0x24'),'response_type':_0x9c23('0x24'),'rest_data':JSON[_0x9c23('0x2a')]({'session':_0x4b48f9['id'],'module_name':'Contacts','name_value_list':[{'name':'first_name','value':_0x1edcd!==_0x9c23('0x3d')?_0x1edcd:util['format']('Caller\x20-\x20%s',_0x418b2c)},{'name':'phone_home','value':_0x418b2c}]})}})[_0x9c23('0x30')](function(_0x177de9){logger[_0x9c23('0xc')](_0x9c23('0x3e'));return BPromise[_0x9c23('0x36')]({'id':_0x177de9['id'],'name':_0x177de9[_0x9c23('0x31')]['first_name']['value'],'phone':_0x177de9[_0x9c23('0x31')][_0x9c23('0x3a')][_0x9c23('0x34')]});});}});}function request(_0x29cd45){logger[_0x9c23('0x3f')]('[HTTP]',JSON[_0x9c23('0x2a')](_0x29cd45));return rp(_[_0x9c23('0x40')](def,_0x29cd45));}function getTags(_0x397111,_0x75d8c8){var _0x297368=[];if(_0x397111&&_0x397111[_0x9c23('0x1e')]>0x0){_0x297368=_[_0x9c23('0x41')](_0x397111,_0x75d8c8);}return _0x297368;}function getCustomFields(_0x53cef2,_0x28cfe3){var _0x24be6a=[];var _0x32231a={'custom_fields':[]};if(_0x53cef2[_0x9c23('0x1e')]>0x0){_[_0x9c23('0x1f')](_0x53cef2,function(_0x5a8bbc){if(_0x5a8bbc[_0x9c23('0x42')]===_0x9c23('0x43')&&_0x5a8bbc[_0x9c23('0x44')]&&!_0x5a8bbc[_0x9c23('0x45')]){_0x32231a[_0x5a8bbc[_0x9c23('0x44')][_0x9c23('0x46')]()]=_0x5a8bbc['content'][_0x9c23('0x47')]();}else if(_0x5a8bbc[_0x9c23('0x42')]===_0x9c23('0x43')&&_0x5a8bbc[_0x9c23('0x21')]&&_0x5a8bbc[_0x9c23('0x45')]){_0x32231a[_0x9c23('0x48')][_0x9c23('0x20')]({'id':_0x5a8bbc[_0x9c23('0x21')],'value':_0x5a8bbc[_0x9c23('0x49')]['toString']()});}else if(_0x5a8bbc[_0x9c23('0x42')]===_0x9c23('0x4a')&&_0x5a8bbc[_0x9c23('0x22')]&&_0x5a8bbc[_0x9c23('0x21')]&&_0x5a8bbc[_0x9c23('0x45')]){_0x28cfe3[_0x5a8bbc[_0x9c23('0x22')]]&&_0x32231a[_0x9c23('0x48')][_0x9c23('0x20')]({'id':_0x5a8bbc['idField'],'value':_0x28cfe3[_0x5a8bbc['variableName']][_0x9c23('0x47')]()});}else if(_0x5a8bbc[_0x9c23('0x42')]===_0x9c23('0x4b')&&_0x5a8bbc['Variable']&&_0x5a8bbc[_0x9c23('0x4c')][_0x9c23('0xe')]&&_0x5a8bbc[_0x9c23('0x21')]&&_0x5a8bbc[_0x9c23('0x45')]){_0x28cfe3[_0x5a8bbc[_0x9c23('0x4c')]['name'][_0x9c23('0x46')]()]&&_0x32231a[_0x9c23('0x48')][_0x9c23('0x20')]({'id':_0x5a8bbc[_0x9c23('0x21')],'value':_0x28cfe3[_0x5a8bbc[_0x9c23('0x4c')][_0x9c23('0xe')][_0x9c23('0x46')]()]['toString']()});}});}return _0x32231a;}function getConnection(_0x3ca81b){return request({'method':'POST','form':{'method':_0x9c23('0x4d'),'input_type':_0x9c23('0x24'),'response_type':_0x9c23('0x24'),'rest_data':JSON['stringify']({'user_auth':{'user_name':_0x3ca81b[_0x9c23('0x4e')],'password':_0x3ca81b[_0x9c23('0x4f')],'encryption':_0x9c23('0x50')},'application':_0x9c23('0x51')})}})['then'](function(_0x5863ca){var _0xd5451a=_0x5863ca;if(_0xd5451a['id']){def[_0x9c23('0x52')]=_0xd5451a['id'];return BPromise[_0x9c23('0x36')](_0xd5451a);}else{throw new Error(util[_0x9c23('0x26')](_0x9c23('0x53'),_0x3ca81b['id']));}});}function setRelationship(_0x1081ab,_0x91f0dd,_0x4c8df2,_0x42de79){return request({'form':{'method':_0x9c23('0x54'),'input_type':_0x9c23('0x24'),'response_type':_0x9c23('0x24'),'rest_data':JSON[_0x9c23('0x2a')]({'session':_0x1081ab['id'],'module_name':_0x9c23('0x25'),'module_id':_0x4c8df2['id'],'link_field_name':_0x42de79,'related_ids':[_0x91f0dd['id']]})}});}exports[_0x9c23('0x55')]=function(_0x3cb214,_0x537799,_0x160379,_0x5af119,_0x19e6c6,_0x29f2a8){var _0x4d2012,_0x167704,_0x2ef153,_0x2f14a9;_0x29f2a8[_0x9c23('0x56')]=intUtil[_0x9c23('0x57')](_0x29f2a8[_0x9c23('0x56')]);_0x29f2a8[_0x9c23('0x58')]=intUtil['stripTrailingSlash'](_0x29f2a8[_0x9c23('0x58')]);def[_0x9c23('0x59')]=util[_0x9c23('0x26')]('%s/service/v4_1/rest.php',_0x29f2a8[_0x9c23('0x56')]);if(_0x19e6c6&&_0x19e6c6[_0x9c23('0x5a')]){logger[_0x9c23('0xc')](_0x9c23('0x5b'),'Recording\x20is\x20enabled!');_0x537799['recordingURL']=util[_0x9c23('0x26')]('%s/api/voice/recordings/%s/downloads?type=uniqueid&token=%s',_0x29f2a8[_0x9c23('0x58')],_0x537799[_0x9c23('0x5c')],md5(_0x537799[_0x9c23('0x5c')]));}else{_0x537799[_0x9c23('0x5d')]='';}return getConnection(_0x29f2a8)[_0x9c23('0x30')](function(_0xab1382){_0x2f14a9=_0xab1382;return getUser(_0x29f2a8,_0x5af119['name'],_0x2f14a9);})[_0x9c23('0x30')](function(_0x295bd2){_0x4d2012=_0x295bd2;logger[_0x9c23('0xc')]('The\x20User\x20ID\x20is:',_0x4d2012['id']);return getEndUser(_0x29f2a8,_0x537799['calleridname'],_0x537799[_0x9c23('0x5e')],_0x2f14a9);})[_0x9c23('0x30')](function(_0x2dcca6){_0x167704=_0x2dcca6;logger['info'](_0x9c23('0x5f'),_0x167704['id']);return getTicket(_0x29f2a8,_0x4d2012,_0x167704,_0x160379,_0x537799,_0x160379[_0x9c23('0x60')],_0x2f14a9,_0x9c23('0x61'));})[_0x9c23('0x30')](function(_0x6f4440){_0x2ef153=_0x6f4440;logger[_0x9c23('0xc')](_0x9c23('0x62'));logger[_0x9c23('0xc')](_0x9c23('0x63'),_0x2ef153['id']);return setRelationship(_0x2f14a9,_0x4d2012,_0x2ef153,'users');})[_0x9c23('0x30')](function(){return setRelationship(_0x2f14a9,_0x167704,_0x2ef153,_0x9c23('0x64'));})['then'](function(){return getServerInfo(_0x2f14a9);})[_0x9c23('0x30')](function(_0x5adc24){var _0x48e52c=parseInt(_0x5adc24[_0x9c23('0x65')]['charAt'](0x0));var _0xb9486a=util[_0x9c23('0x26')](_0x9c23('0x66'),_0x29f2a8[_0x9c23('0x56')],_0x2ef153['id']);if(_0x48e52c>0x6){_0xb9486a=util[_0x9c23('0x26')]('%s/#bwc/index.php?module=Calls&action=EditView&record=%s',_0x29f2a8[_0x9c23('0x56')],_0x2ef153['id']);}logger[_0x9c23('0xc')](_0x9c23('0x5b'),_0x9c23('0x67'));emit(util[_0x9c23('0x26')]('user:%s',_0x5af119[_0x9c23('0xe')]),'trigger:browser:url',{'uri':_0xb9486a});})[_0x9c23('0x68')](function(_0x3a7e88){logger['error'](_0x9c23('0x5b'),JSON[_0x9c23('0x2a')](_0x3a7e88));});};exports[_0x9c23('0x69')]=function(_0x4787f2,_0x564b23,_0x2bacfb,_0x1fd841,_0x1d4005,_0x4da48c,_0x4864d3){var _0x4208fd,_0x5f4aad,_0x28711f,_0x2bad21;_0x4da48c['remoteUri']=intUtil[_0x9c23('0x57')](_0x4da48c['remoteUri']);_0x4da48c[_0x9c23('0x58')]=intUtil[_0x9c23('0x57')](_0x4da48c[_0x9c23('0x58')]);def[_0x9c23('0x59')]=util[_0x9c23('0x26')](_0x9c23('0x6a'),_0x4da48c[_0x9c23('0x56')]);if(_0x4864d3&&_0x4864d3[_0x9c23('0x6b')]&&_0x4864d3['recordingFormat']!==_0x9c23('0x6c')){logger['info']('[OUTBOUND]','Recording\x20is\x20enabled!');_0x564b23[_0x9c23('0x5d')]=util[_0x9c23('0x26')]('%s/api/voice/recordings/%s/downloads?type=uniqueid&token=%s',_0x4da48c[_0x9c23('0x58')],_0x564b23['uniqueid'],md5(_0x564b23[_0x9c23('0x5c')]));}return getConnection(_0x4da48c)['then'](function(_0xbd6e5e){_0x2bad21=_0xbd6e5e;return getUser(_0x4da48c,_0x1fd841[_0x9c23('0xe')],_0x2bad21);})[_0x9c23('0x30')](function(_0x123f17){_0x4208fd=_0x123f17;logger[_0x9c23('0xc')](_0x9c23('0x6d'),_0x4208fd['id']);return getEndUser(_0x4da48c,_0x564b23[_0x9c23('0x6e')],_0x564b23[_0x9c23('0x6f')],_0x2bad21);})[_0x9c23('0x30')](function(_0x13ee5f){_0x5f4aad=_0x13ee5f;logger['info']('The\x20Enduser\x20ID\x20is:',_0x5f4aad['id']);return getTicket(_0x4da48c,_0x4208fd,_0x5f4aad,_0x2bacfb,_0x564b23,_0x2bacfb['Fields'],_0x2bad21,_0x9c23('0x70'));})[_0x9c23('0x30')](function(_0x451170){_0x28711f=_0x451170;logger['info']('Ticket\x20created!');logger[_0x9c23('0xc')]('The\x20Ticket\x20ID\x20is:',_0x28711f['id']);return setRelationship(_0x2bad21,_0x4208fd,_0x28711f,_0x9c23('0x71'));})[_0x9c23('0x30')](function(){return setRelationship(_0x2bad21,_0x5f4aad,_0x28711f,'contacts');})['then'](function(){return getServerInfo(_0x2bad21);})['then'](function(_0x5915a1){var _0x5b0b0c=parseInt(_0x5915a1[_0x9c23('0x65')][_0x9c23('0x72')](0x0));var _0x39dc78=util[_0x9c23('0x26')](_0x9c23('0x66'),_0x4da48c['remoteUri'],_0x28711f['id']);if(_0x5b0b0c>0x6){_0x39dc78=util['format'](_0x9c23('0x73'),_0x4da48c[_0x9c23('0x56')],_0x28711f['id']);}logger[_0x9c23('0xc')]('[OUTBOUND]','Displaying\x20ticket\x20to\x20agent\x20in\x20a\x20new\x20tab...');emit(util['format']('user:%s',_0x1fd841[_0x9c23('0xe')]),_0x9c23('0x74'),{'uri':_0x39dc78});})[_0x9c23('0x68')](function(_0x4201bf){logger['error'](_0x9c23('0x75'),JSON[_0x9c23('0x2a')](_0x4201bf));});};exports['abandoned']=function(_0xa948ef,_0x4335aa,_0x59c0cc,_0x2dd8d4,_0x29b756,_0x117d36){var _0x34beca,_0x3a843b,_0x223956,_0x587884;_0x117d36[_0x9c23('0x56')]=intUtil[_0x9c23('0x57')](_0x117d36[_0x9c23('0x56')]);_0x117d36['serverUrl']=intUtil['stripTrailingSlash'](_0x117d36['serverUrl']);def[_0x9c23('0x59')]=util['format'](_0x9c23('0x6a'),_0x117d36['remoteUri']);if(_0x29b756&&_0x29b756['monitor_format']){logger[_0x9c23('0xc')](_0x9c23('0x76'),_0x9c23('0x77'));_0x4335aa[_0x9c23('0x5d')]=util['format']('%s/api/voice/recordings/%s/downloads?type=uniqueid&token=%s',_0x117d36[_0x9c23('0x58')],_0x4335aa[_0x9c23('0x5c')],md5(_0x4335aa[_0x9c23('0x5c')]));}else{_0x4335aa[_0x9c23('0x5d')]='';}return getConnection(_0x117d36)[_0x9c23('0x30')](function(_0x1bb593){_0x587884=_0x1bb593;if(!_[_0x9c23('0x2b')](_0x2dd8d4)){return getUser(_0x117d36,_0x2dd8d4[_0x9c23('0xe')],_0x587884);}else{return getUser(_0x117d36,null,_0x587884);}})[_0x9c23('0x30')](function(_0x2662c2){_0x34beca=_0x2662c2;logger['info'](_0x9c23('0x6d'),_0x34beca['id']);return getEndUser(_0x117d36,_0x4335aa[_0x9c23('0x78')],_0x4335aa['calleridnum'],_0x587884);})[_0x9c23('0x30')](function(_0x24b0fe){_0x3a843b=_0x24b0fe;logger[_0x9c23('0xc')](_0x9c23('0x5f'),_0x3a843b['id']);return getTicket(_0x117d36,_0x34beca,_0x3a843b,_0x59c0cc,_0x4335aa,_0x59c0cc['Fields'],_0x587884,_0x9c23('0x61'));})[_0x9c23('0x30')](function(_0x5e6c5f){_0x223956=_0x5e6c5f;logger['info'](_0x9c23('0x62'));logger[_0x9c23('0xc')](_0x9c23('0x63'),_0x223956['id']);return setRelationship(_0x587884,_0x34beca,_0x223956,_0x9c23('0x71'));})[_0x9c23('0x30')](function(){return setRelationship(_0x587884,_0x3a843b,_0x223956,_0x9c23('0x64'));})[_0x9c23('0x30')](function(){return getServerInfo(_0x587884);})['catch'](function(_0x2c44c9){logger['error']('[ABANDONED]',JSON[_0x9c23('0x2a')](_0x2c44c9));});};
\ 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 cdac1c8..3fb68d8 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 _0xee11=['keyValue','key','keyContent','keyType','format','customVariable','%s:\x20%s','join','stripTrailingSlash','slice','substring','lastIndexOf','validateEmail','isNil','lodash','util','getString','sortBy','type','string','push','content','variableName','toString','Variable','name','toLowerCase'];(function(_0x2383b5,_0x3037c7){var _0x4077eb=function(_0x4724cd){while(--_0x4724cd){_0x2383b5['push'](_0x2383b5['shift']());}};_0x4077eb(++_0x3037c7);}(_0xee11,0x7a));var _0x1ee1=function(_0x12a66f,_0x30e98d){_0x12a66f=_0x12a66f-0x0;var _0x36a7d9=_0xee11[_0x12a66f];return _0x36a7d9;};'use strict';var _=require(_0x1ee1('0x0'));var util=require(_0x1ee1('0x1'));exports[_0x1ee1('0x2')]=function(_0x354d48,_0x329257,_0x4c8907){var _0x37277a=[];if(_0x354d48['length']>0x0){var _0x2281c9=_[_0x1ee1('0x3')](_0x354d48,['id']);for(var _0x892b46=0x0;_0x892b46<_0x2281c9['length'];_0x892b46++){var _0x4c7a62=_0x2281c9[_0x892b46];if(_0x4c7a62[_0x1ee1('0x4')]===_0x1ee1('0x5')){_0x37277a[_0x1ee1('0x6')](_0x4c7a62[_0x1ee1('0x7')]);}else if(_0x4c7a62['type']==='variable'&&_0x4c7a62[_0x1ee1('0x8')]){_0x329257[_0x4c7a62[_0x1ee1('0x8')]]&&_0x37277a[_0x1ee1('0x6')](_0x329257[_0x4c7a62[_0x1ee1('0x8')]][_0x1ee1('0x9')]());}else if(_0x4c7a62[_0x1ee1('0x4')]==='customVariable'&&_0x4c7a62[_0x1ee1('0xa')]&&_0x4c7a62[_0x1ee1('0xa')][_0x1ee1('0xb')]){_0x329257[_0x4c7a62[_0x1ee1('0xa')]['name']['toLowerCase']()]&&_0x37277a[_0x1ee1('0x6')](_0x329257[_0x4c7a62[_0x1ee1('0xa')][_0x1ee1('0xb')][_0x1ee1('0xc')]()][_0x1ee1('0x9')]());}else if(_0x4c7a62[_0x1ee1('0x4')]===_0x1ee1('0xd')){if(_0x4c7a62['keyType']===_0x1ee1('0x5')&&_0x4c7a62['key']){_0x37277a['push'](util['format']('%s:\x20%s',_0x4c7a62[_0x1ee1('0xe')],_0x4c7a62[_0x1ee1('0xf')]));}else if(_0x4c7a62[_0x1ee1('0x10')]==='variable'&&_0x4c7a62['variableName']&&_0x4c7a62[_0x1ee1('0xe')]){_0x329257[_0x4c7a62[_0x1ee1('0x8')]]&&_0x37277a['push'](util[_0x1ee1('0x11')]('%s:\x20%s',_0x4c7a62[_0x1ee1('0xe')],_0x329257[_0x4c7a62['variableName']]));}else if(_0x4c7a62[_0x1ee1('0x10')]===_0x1ee1('0x12')&&_0x4c7a62[_0x1ee1('0xa')]&&_0x4c7a62[_0x1ee1('0xa')][_0x1ee1('0xb')]&&_0x4c7a62[_0x1ee1('0xe')]){_0x329257[_0x4c7a62['Variable']['name'][_0x1ee1('0xc')]()]&&_0x37277a[_0x1ee1('0x6')](util['format'](_0x1ee1('0x13'),_0x4c7a62[_0x1ee1('0xe')],_0x329257[_0x4c7a62['Variable'][_0x1ee1('0xb')][_0x1ee1('0xc')]()]));}}}}return _0x37277a[_0x1ee1('0x14')](_0x4c8907);};exports[_0x1ee1('0x15')]=function(_0x3d4fa2){var _0x4acda2=_0x3d4fa2[_0x1ee1('0x16')](-0x1);if(_0x4acda2==='/'){_0x3d4fa2=_0x3d4fa2[_0x1ee1('0x17')](0x0,_0x3d4fa2[_0x1ee1('0x18')](_0x4acda2));}return _0x3d4fa2;};exports[_0x1ee1('0x19')]=function(_0x68154){if(!_[_0x1ee1('0x1a')](_0x68154)&&_0x68154!==''){var _0x321e99=/^(([^<>()\[\]\\.,;:\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 _0x321e99['test'](String(_0x68154)[_0x1ee1('0xc')]());}else{return![];}};
\ No newline at end of file
+var _0x367a=['key','format','keyContent','join','stripTrailingSlash','slice','substring','lastIndexOf','validateEmail','isNil','lodash','util','getString','length','sortBy','type','string','push','content','variable','variableName','toString','customVariable','Variable','name','toLowerCase','keyValue','keyType'];(function(_0x467ca8,_0x562379){var _0x268035=function(_0x30ef7a){while(--_0x30ef7a){_0x467ca8['push'](_0x467ca8['shift']());}};_0x268035(++_0x562379);}(_0x367a,0xea));var _0xa367=function(_0x3308a0,_0x5a71c4){_0x3308a0=_0x3308a0-0x0;var _0x3adbf3=_0x367a[_0x3308a0];return _0x3adbf3;};'use strict';var _=require(_0xa367('0x0'));var util=require(_0xa367('0x1'));exports[_0xa367('0x2')]=function(_0x3fc45e,_0x11cac8,_0x147615){var _0x512824=[];if(_0x3fc45e[_0xa367('0x3')]>0x0){var _0x2ac0b1=_[_0xa367('0x4')](_0x3fc45e,['id']);for(var _0x1faf4d=0x0;_0x1faf4d<_0x2ac0b1[_0xa367('0x3')];_0x1faf4d++){var _0x555f58=_0x2ac0b1[_0x1faf4d];if(_0x555f58[_0xa367('0x5')]===_0xa367('0x6')){_0x512824[_0xa367('0x7')](_0x555f58[_0xa367('0x8')]);}else if(_0x555f58['type']===_0xa367('0x9')&&_0x555f58['variableName']){_0x11cac8[_0x555f58[_0xa367('0xa')]]&&_0x512824[_0xa367('0x7')](_0x11cac8[_0x555f58[_0xa367('0xa')]][_0xa367('0xb')]());}else if(_0x555f58[_0xa367('0x5')]===_0xa367('0xc')&&_0x555f58[_0xa367('0xd')]&&_0x555f58['Variable'][_0xa367('0xe')]){_0x11cac8[_0x555f58[_0xa367('0xd')]['name'][_0xa367('0xf')]()]&&_0x512824[_0xa367('0x7')](_0x11cac8[_0x555f58['Variable'][_0xa367('0xe')]['toLowerCase']()][_0xa367('0xb')]());}else if(_0x555f58['type']===_0xa367('0x10')){if(_0x555f58[_0xa367('0x11')]===_0xa367('0x6')&&_0x555f58[_0xa367('0x12')]){_0x512824[_0xa367('0x7')](util[_0xa367('0x13')]('%s:\x20%s',_0x555f58[_0xa367('0x12')],_0x555f58[_0xa367('0x14')]));}else if(_0x555f58[_0xa367('0x11')]===_0xa367('0x9')&&_0x555f58[_0xa367('0xa')]&&_0x555f58[_0xa367('0x12')]){_0x11cac8[_0x555f58[_0xa367('0xa')]]&&_0x512824[_0xa367('0x7')](util[_0xa367('0x13')]('%s:\x20%s',_0x555f58['key'],_0x11cac8[_0x555f58['variableName']]));}else if(_0x555f58[_0xa367('0x11')]==='customVariable'&&_0x555f58[_0xa367('0xd')]&&_0x555f58[_0xa367('0xd')]['name']&&_0x555f58[_0xa367('0x12')]){_0x11cac8[_0x555f58[_0xa367('0xd')][_0xa367('0xe')][_0xa367('0xf')]()]&&_0x512824['push'](util['format']('%s:\x20%s',_0x555f58[_0xa367('0x12')],_0x11cac8[_0x555f58['Variable'][_0xa367('0xe')][_0xa367('0xf')]()]));}}}}return _0x512824[_0xa367('0x15')](_0x147615);};exports[_0xa367('0x16')]=function(_0x1e5ace){var _0x3f292f=_0x1e5ace[_0xa367('0x17')](-0x1);if(_0x3f292f==='/'){_0x1e5ace=_0x1e5ace[_0xa367('0x18')](0x0,_0x1e5ace[_0xa367('0x19')](_0x3f292f));}return _0x1e5ace;};exports[_0xa367('0x1a')]=function(_0x31e495){if(!_[_0xa367('0x1b')](_0x31e495)&&_0x31e495!==''){var _0x2c0bcb=/^(([^<>()\[\]\\.,;:\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 _0x2c0bcb['test'](String(_0x31e495)[_0xa367('0xf')]());}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 2d7cf2a..e9d3841 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 _0xedd9=['success','resolve','result','stringify','error','catch','[vTiger],\x20%s,\x20%s,\x20%s','createTicket','validateEmail','info','GET','%s/webservice.php','query','SELECT\x20first_name,\x20last_name,\x20email1\x20FROM\x20Users\x20WHERE\x20email1=\x27%s\x27;','length','first_name','last_name','Agent\x20not\x20found,\x20using\x20the\x20admin\x20account!','userId','admin','statusCode','getUser','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!','Contacts','Enduser\x20created.','getEndUser','accessKey','login','token','getConnection','[HTTP]','stripTrailingSlash','monitor_format','[QUEUE]','recordingURL','%s/api/voice/recordings/%s/downloads?type=uniqueid&token=%s','uniqueid','email','calleridnum','The\x20Enduser\x20ID\x20is:','Fields','Ticket\x20created!','The\x20Ticket\x20ID\x20is:','%s/index.php?module=HelpDesk&view=Detail&record=%s&app=SUPPORT','split','Displaying\x20ticket\x20to\x20agent\x20in\x20a\x20new\x20tab...','user:%s','trigger:browser:url','outbound','serverUrl','recordingFormat','[OUTBOUND]','Recording\x20is\x20enabled!','The\x20User\x20ID\x20is:','destcalleridname','abandoned','calleridname','request-promise','bluebird','md5','util','ioredis','./util','../../../../config/environment','../../../../config/logger','redis','defaults','localhost','emit','forEach','string','idField','content','toString','type','variable','variableName','customVariable','Variable','name','toLowerCase','Creating\x20new\x20ticket...','merge','getString','Subjects','POST','format','remoteUri','create','username','sessionName','HelpDesk','then'];(function(_0x3cb8ef,_0x56eaa1){var _0xf5df53=function(_0x31aaed){while(--_0x31aaed){_0x3cb8ef['push'](_0x3cb8ef['shift']());}};_0xf5df53(++_0x56eaa1);}(_0xedd9,0xfc));var _0x9edd=function(_0x28eff0,_0x22d0a0){_0x28eff0=_0x28eff0-0x0;var _0x172726=_0xedd9[_0x28eff0];return _0x172726;};'use strict';var _=require('lodash');var rp=require(_0x9edd('0x0'));var BPromise=require(_0x9edd('0x1'));var md5=require(_0x9edd('0x2'));var util=require(_0x9edd('0x3'));var Redis=require(_0x9edd('0x4'));var intUtil=require(_0x9edd('0x5'));var config=require(_0x9edd('0x6'));var logger=require(_0x9edd('0x7'))('vTiger');config[_0x9edd('0x8')]=_[_0x9edd('0x9')](config[_0x9edd('0x8')],{'host':_0x9edd('0xa'),'port':0x18eb});var io=require('socket.io-emitter')(new Redis(config[_0x9edd('0x8')]));function emit(_0x571af9,_0x172522,_0x190185){io['to'](_0x571af9)[_0x9edd('0xb')](_0x172522,_0x190185);}function getCustomFields(_0x3280fd,_0x49d5e3){var _0x494a24={};if(_0x3280fd['length']>0x0){_[_0x9edd('0xc')](_0x3280fd,function(_0x138767){if(_0x138767['type']===_0x9edd('0xd')&&_0x138767[_0x9edd('0xe')]){_0x494a24[_0x138767['idField']]=_0x138767[_0x9edd('0xf')][_0x9edd('0x10')]();}else if(_0x138767[_0x9edd('0x11')]===_0x9edd('0x12')&&_0x138767[_0x9edd('0x13')]&&_0x138767[_0x9edd('0xe')]&&_0x49d5e3[_0x138767[_0x9edd('0x13')]]){_0x494a24[_0x138767[_0x9edd('0xe')]]=_0x49d5e3[_0x138767['variableName']][_0x9edd('0x10')]();}else if(_0x138767[_0x9edd('0x11')]===_0x9edd('0x14')&&_0x138767[_0x9edd('0x15')]&&_0x138767[_0x9edd('0x15')][_0x9edd('0x16')]&&_0x138767[_0x9edd('0xe')]&&_0x49d5e3[_0x138767[_0x9edd('0x15')]['name'][_0x9edd('0x17')]()]){_0x494a24[_0x138767[_0x9edd('0xe')]]=_0x49d5e3[_0x138767[_0x9edd('0x15')]['name'][_0x9edd('0x17')]()][_0x9edd('0x10')]();}});}return _0x494a24;}function createTicket(_0x40ba32,_0x4d8f33,_0x43dc70,_0x5d879c,_0x2cdcef,_0x1083e4,_0x4bdb88){logger['info'](_0x9edd('0x18'));var _0x50338f=_[_0x9edd('0x19')]({'parent_id':'','assigned_user_id':_0x4d8f33['id'],'ticketpriorities':'Normal','ticketstatus':'Open','ticket_title':intUtil[_0x9edd('0x1a')](_0x5d879c[_0x9edd('0x1b')],_0x2cdcef,'\x20'),'description':intUtil['getString'](_0x5d879c['Descriptions'],_0x2cdcef,'\x0a'),'contact_id':_0x43dc70['id']},getCustomFields(_0x1083e4,_0x2cdcef));var _0x341d67={'method':_0x9edd('0x1c'),'uri':util[_0x9edd('0x1d')]('%s/webservice.php',_0x40ba32[_0x9edd('0x1e')]),'form':{'operation':_0x9edd('0x1f'),'username':_0x40ba32[_0x9edd('0x20')],'sessionName':_0x4bdb88[_0x9edd('0x21')],'elementType':_0x9edd('0x22'),'element':JSON['stringify'](_0x50338f)},'json':!![]};return request(_0x341d67)[_0x9edd('0x23')](function(_0xeaf55a){if(_0xeaf55a[_0x9edd('0x24')]){return BPromise[_0x9edd('0x25')]({'id':_0xeaf55a[_0x9edd('0x26')]['id']});}else{throw new Error(util['format']('Ticket\x20could\x20not\x20be\x20created\x20due\x20to:\x20%s',JSON[_0x9edd('0x27')](_0xeaf55a[_0x9edd('0x28')])));}})[_0x9edd('0x29')](function(_0x25e135){var _0x3c2227=_0x25e135['statusCode']||0x1f4;logger['error'](_0x9edd('0x2a'),_0x9edd('0x2b'),_0x3c2227,JSON[_0x9edd('0x27')](_0x25e135));});}function getUser(_0x52746a,_0x238b22,_0x28cfae){if(intUtil[_0x9edd('0x2c')](_0x238b22)){logger[_0x9edd('0x2d')]('Getting\x20agent\x20with\x20email',_0x238b22);return request({'method':_0x9edd('0x2e'),'uri':util[_0x9edd('0x1d')](_0x9edd('0x2f'),_0x52746a[_0x9edd('0x1e')]),'qs':{'operation':_0x9edd('0x30'),'username':_0x52746a[_0x9edd('0x20')],'sessionName':_0x28cfae[_0x9edd('0x21')],'query':util[_0x9edd('0x1d')](_0x9edd('0x31'),_0x238b22)},'json':!![]})[_0x9edd('0x23')](function(_0x4fd03f){if(_0x4fd03f[_0x9edd('0x24')]&&_0x4fd03f[_0x9edd('0x26')][_0x9edd('0x32')]){logger[_0x9edd('0x2d')]('Agent\x20found!');return BPromise[_0x9edd('0x25')]({'id':_0x4fd03f[_0x9edd('0x26')][0x0]['id'],'email':_0x4fd03f[_0x9edd('0x26')][0x0]['email1'],'name':_0x4fd03f[_0x9edd('0x26')][0x0][_0x9edd('0x33')]+'\x20'+_0x4fd03f[_0x9edd('0x26')][_0x9edd('0x34')]});}else{logger[_0x9edd('0x2d')](_0x9edd('0x35'));return BPromise[_0x9edd('0x25')]({'id':_0x28cfae[_0x9edd('0x36')],'email':_0x52746a[_0x9edd('0x20')],'name':_0x9edd('0x37')});}})[_0x9edd('0x29')](function(_0x42c1d9){var _0x27eb7e=_0x42c1d9[_0x9edd('0x38')]||0x1f4;logger['error'](_0x9edd('0x2a'),'getUser',_0x27eb7e,JSON[_0x9edd('0x27')](_0x42c1d9));});}else{logger[_0x9edd('0x2d')](_0x9edd('0x35'));return BPromise[_0x9edd('0x25')]({'id':_0x28cfae[_0x9edd('0x36')],'email':_0x52746a['username'],'name':_0x9edd('0x37')})[_0x9edd('0x29')](function(_0x2b3469){var _0x38e9be=_0x2b3469[_0x9edd('0x38')]||0x1f4;logger[_0x9edd('0x28')](_0x9edd('0x2a'),_0x9edd('0x39'),_0x38e9be,JSON[_0x9edd('0x27')](_0x2b3469));});}}function getEndUser(_0x35c16f,_0x51a54a,_0x231604,_0x56a228){logger[_0x9edd('0x2d')]('Searching\x20end\x20user\x20with\x20phone',_0x231604);return request({'method':_0x9edd('0x2e'),'uri':util[_0x9edd('0x1d')](_0x9edd('0x2f'),_0x35c16f['remoteUri']),'qs':{'operation':_0x9edd('0x30'),'username':_0x35c16f[_0x9edd('0x20')],'sessionName':_0x56a228[_0x9edd('0x21')],'query':util['format'](_0x9edd('0x3a'),_0x231604,_0x231604,_0x231604,_0x231604,_0x231604)},'json':!![]})['then'](function(_0x1fc4fb){if(_0x1fc4fb[_0x9edd('0x24')]&&_0x1fc4fb['result'][_0x9edd('0x32')]){logger[_0x9edd('0x2d')](_0x9edd('0x3b'));return BPromise[_0x9edd('0x25')]({'id':_0x1fc4fb['result'][0x0]['id'],'name':_0x1fc4fb[_0x9edd('0x26')][0x0]['firstname']+'\x20'+_0x1fc4fb[_0x9edd('0x26')][0x0][_0x9edd('0x3c')],'phone':_0x231604});}else{logger['info'](_0x9edd('0x3d'));return request({'method':'POST','uri':util['format'](_0x9edd('0x2f'),_0x35c16f[_0x9edd('0x1e')]),'form':{'operation':_0x9edd('0x1f'),'sessionName':_0x56a228[_0x9edd('0x21')],'elementType':_0x9edd('0x3e'),'element':JSON[_0x9edd('0x27')]({'lastname':_0x51a54a,'phone':_0x231604,'assigned_user_id':'\x20'})},'json':!![]})[_0x9edd('0x23')](function(_0x75efbe){logger[_0x9edd('0x2d')](_0x9edd('0x3f'));return BPromise[_0x9edd('0x25')]({'id':_0x75efbe[_0x9edd('0x26')]['id'],'name':_0x75efbe[_0x9edd('0x26')][_0x9edd('0x3c')],'phone':_0x75efbe[_0x9edd('0x26')]['phone']});})[_0x9edd('0x29')](function(_0x2570e3){var _0x2231c1=_0x2570e3[_0x9edd('0x38')]||0x1f4;logger[_0x9edd('0x28')](_0x9edd('0x2a'),_0x9edd('0x40'),_0x2231c1,JSON['stringify'](_0x2570e3));});}});}function getConnection(_0x4a4656){var _0x4bc7a1=_0x4a4656[_0x9edd('0x20')];var _0x58a1dd=_0x4a4656[_0x9edd('0x41')];return request({'method':_0x9edd('0x2e'),'uri':util[_0x9edd('0x1d')](_0x9edd('0x2f'),_0x4a4656[_0x9edd('0x1e')]),'qs':{'operation':'getchallenge','username':_0x4bc7a1},'json':!![]})[_0x9edd('0x23')](function(_0x35e63c){if(_0x35e63c[_0x9edd('0x24')]){return request({'method':'POST','uri':util[_0x9edd('0x1d')](_0x9edd('0x2f'),_0x4a4656[_0x9edd('0x1e')]),'form':{'operation':_0x9edd('0x42'),'username':_0x4bc7a1,'accessKey':md5(_0x35e63c[_0x9edd('0x26')][_0x9edd('0x43')]+_0x58a1dd)},'json':!![]});}})['then'](function(_0x441e4a){if(_0x441e4a[_0x9edd('0x24')]){return BPromise['resolve'](_0x441e4a[_0x9edd('0x26')]);}else{throw new Error(util[_0x9edd('0x1d')]('Account\x20%d\x20is\x20not\x20valid',_0x4a4656['id']));}})[_0x9edd('0x29')](function(_0x8134cd){var _0x468239=_0x8134cd['statusCode']||0x1f4;logger[_0x9edd('0x28')](_0x9edd('0x2a'),_0x9edd('0x44'),_0x468239,JSON[_0x9edd('0x27')](_0x8134cd));});}function request(_0x53f6e3){logger[_0x9edd('0x2d')](_0x9edd('0x45'),JSON[_0x9edd('0x27')](_0x53f6e3));return rp(_0x53f6e3);}exports['queue']=function(_0x16951a,_0x21f6ce,_0x57db43,_0x8e59bd,_0x4e2aaf,_0x336494){var _0xe6b20c,_0x24245f,_0x3fcdf5,_0x1e3c19;_0x336494[_0x9edd('0x1e')]=intUtil[_0x9edd('0x46')](_0x336494[_0x9edd('0x1e')]);if(_0x4e2aaf&&_0x4e2aaf[_0x9edd('0x47')]){logger[_0x9edd('0x2d')](_0x9edd('0x48'),'Recording\x20is\x20enabled!');_0x21f6ce[_0x9edd('0x49')]=util[_0x9edd('0x1d')](_0x9edd('0x4a'),_0x336494['serverUrl'],_0x21f6ce[_0x9edd('0x4b')],md5(_0x21f6ce['uniqueid']));}else{_0x21f6ce['recordingURL']='';}return getConnection(_0x336494)['then'](function(_0x1348a7){_0x1e3c19=_0x1348a7;return getUser(_0x336494,_0x8e59bd[_0x9edd('0x4c')],_0x1e3c19);})[_0x9edd('0x23')](function(_0x35ddb3){_0xe6b20c=_0x35ddb3;logger['info']('The\x20User\x20ID\x20is:',_0xe6b20c['id']);return getEndUser(_0x336494,_0x21f6ce['calleridname'],_0x21f6ce[_0x9edd('0x4d')],_0x1e3c19);})[_0x9edd('0x23')](function(_0xd5090a){_0x24245f=_0xd5090a;logger[_0x9edd('0x2d')](_0x9edd('0x4e'),_0x24245f['id']);return createTicket(_0x336494,_0xe6b20c,_0x24245f,_0x57db43,_0x21f6ce,_0x57db43[_0x9edd('0x4f')],_0x1e3c19);})[_0x9edd('0x23')](function(_0x1e3087){_0x3fcdf5=_0x1e3087;logger['info'](_0x9edd('0x50'));logger['info'](_0x9edd('0x51'),_0x3fcdf5['id']);var _0x6a1cfc=util['format'](_0x9edd('0x52'),_0x336494[_0x9edd('0x1e')],_[_0x9edd('0x53')](_0x3fcdf5['id'],'x')[0x1]);logger['info'](_0x9edd('0x48'),_0x9edd('0x54'));emit(util[_0x9edd('0x1d')](_0x9edd('0x55'),_0x8e59bd[_0x9edd('0x16')]),_0x9edd('0x56'),{'uri':_0x6a1cfc});})['catch'](function(_0x4aa337){logger[_0x9edd('0x28')]('[QUEUE]',JSON[_0x9edd('0x27')](_0x4aa337));});};exports[_0x9edd('0x57')]=function(_0x439083,_0x17d2f2,_0x5df1d7,_0x21ead2,_0x507cce,_0x3e5dca,_0x344692){var _0xc6bde6,_0x5ca123,_0x2651a2,_0x57da5b;_0x3e5dca[_0x9edd('0x1e')]=intUtil[_0x9edd('0x46')](_0x3e5dca['remoteUri']);_0x3e5dca[_0x9edd('0x58')]=intUtil['stripTrailingSlash'](_0x3e5dca[_0x9edd('0x58')]);if(_0x344692&&_0x344692[_0x9edd('0x59')]&&_0x344692[_0x9edd('0x59')]!=='none'){logger[_0x9edd('0x2d')](_0x9edd('0x5a'),_0x9edd('0x5b'));_0x17d2f2[_0x9edd('0x49')]=util[_0x9edd('0x1d')]('%s/api/voice/recordings/%s/downloads?type=uniqueid&token=%s',_0x3e5dca['serverUrl'],_0x17d2f2[_0x9edd('0x4b')],md5(_0x17d2f2[_0x9edd('0x4b')]));}return getConnection(_0x3e5dca)['then'](function(_0x5496e9){_0x57da5b=_0x5496e9;return getUser(_0x3e5dca,_0x21ead2['email'],_0x57da5b);})[_0x9edd('0x23')](function(_0x4e003a){_0xc6bde6=_0x4e003a;logger['info'](_0x9edd('0x5c'),_0xc6bde6['id']);return getEndUser(_0x3e5dca,_0x17d2f2[_0x9edd('0x5d')],_0x17d2f2['destcalleridnum'],_0x57da5b);})[_0x9edd('0x23')](function(_0x11e082){_0x5ca123=_0x11e082;logger[_0x9edd('0x2d')]('The\x20Enduser\x20ID\x20is:',_0x5ca123['id']);return createTicket(_0x3e5dca,_0xc6bde6,_0x5ca123,_0x5df1d7,_0x17d2f2,_0x5df1d7[_0x9edd('0x4f')],_0x57da5b);})['then'](function(_0x37b018){_0x2651a2=_0x37b018;logger[_0x9edd('0x2d')]('Ticket\x20created!');logger[_0x9edd('0x2d')](_0x9edd('0x51'),_0x2651a2['id']);var _0x5c1746=util[_0x9edd('0x1d')](_0x9edd('0x52'),_0x3e5dca[_0x9edd('0x1e')],_[_0x9edd('0x53')](_0x2651a2['id'],'x')[0x1]);logger['info'](_0x9edd('0x5a'),'Displaying\x20ticket\x20to\x20agent\x20in\x20a\x20new\x20tab...');emit(util[_0x9edd('0x1d')](_0x9edd('0x55'),_0x21ead2[_0x9edd('0x16')]),'trigger:browser:url',{'uri':_0x5c1746});})[_0x9edd('0x29')](function(_0x286593){logger[_0x9edd('0x28')](_0x9edd('0x5a'),JSON[_0x9edd('0x27')](_0x286593));});};exports[_0x9edd('0x5e')]=function(_0x3fa4a9,_0x512d3a,_0x5e29d0,_0x322165,_0x3c7874,_0x13254e){var _0x171403,_0x1e2126,_0x52f6f3,_0x2e40c8;_0x13254e[_0x9edd('0x1e')]=intUtil[_0x9edd('0x46')](_0x13254e['remoteUri']);_0x13254e[_0x9edd('0x58')]=intUtil[_0x9edd('0x46')](_0x13254e['serverUrl']);if(_0x3c7874&&_0x3c7874[_0x9edd('0x47')]){logger[_0x9edd('0x2d')]('[ABANDONED]',_0x9edd('0x5b'));_0x512d3a[_0x9edd('0x49')]=util['format'](_0x9edd('0x4a'),_0x13254e['serverUrl'],_0x512d3a['uniqueid'],md5(_0x512d3a[_0x9edd('0x4b')]));}else{_0x512d3a[_0x9edd('0x49')]='';}return getConnection(_0x13254e)[_0x9edd('0x23')](function(_0x5b56c7){_0x2e40c8=_0x5b56c7;return getUser(_0x13254e,'',_0x2e40c8);})[_0x9edd('0x23')](function(_0x286e47){_0x171403=_0x286e47;logger['info'](_0x9edd('0x5c'),_0x171403['id']);return getEndUser(_0x13254e,_0x512d3a[_0x9edd('0x5f')],_0x512d3a[_0x9edd('0x4d')],_0x2e40c8);})[_0x9edd('0x23')](function(_0x54ac71){_0x1e2126=_0x54ac71;logger['info'](_0x9edd('0x4e'),_0x1e2126['id']);return createTicket(_0x13254e,_0x171403,_0x1e2126,_0x5e29d0,_0x512d3a,_0x5e29d0['Fields'],_0x2e40c8);})[_0x9edd('0x23')](function(_0x2c71ce){_0x52f6f3=_0x2c71ce;logger[_0x9edd('0x2d')](_0x9edd('0x50'));logger[_0x9edd('0x2d')](_0x9edd('0x51'),_0x52f6f3['id']);})[_0x9edd('0x29')](function(_0x5a4d4b){logger[_0x9edd('0x28')]('[ABANDONED]',JSON[_0x9edd('0x27')](_0x5a4d4b));});};
\ No newline at end of file
+var _0x55ca=['email','destcalleridname','destcalleridnum','The\x20Enduser\x20ID\x20is:','abandoned','[ABANDONED]','lodash','request-promise','ioredis','./util','../../../../config/logger','vTiger','redis','defaults','localhost','socket.io-emitter','emit','length','forEach','type','string','idField','content','toString','customVariable','Variable','name','toLowerCase','info','merge','Normal','Open','Subjects','getString','POST','format','%s/webservice.php','remoteUri','username','then','success','resolve','result','Ticket\x20could\x20not\x20be\x20created\x20due\x20to:\x20%s','stringify','error','catch','statusCode','[vTiger],\x20%s,\x20%s,\x20%s','createTicket','validateEmail','Getting\x20agent\x20with\x20email','GET','sessionName','SELECT\x20first_name,\x20last_name,\x20email1\x20FROM\x20Users\x20WHERE\x20email1=\x27%s\x27;','Agent\x20found!','email1','last_name','userId','admin','Agent\x20not\x20found,\x20using\x20the\x20admin\x20account!','getUser','Searching\x20end\x20user\x20with\x20phone','SELECT\x20id,\x20firstname,\x20lastname,\x20email,\x20phone,\x20mobile,\x20homephone,\x20otherphone,\x20assistantphone\x20FROM\x20Contacts\x20WHERE\x20phone\x20=\x20\x27%s\x27\x20OR\x20mobile\x20=\x27%s\x27\x20OR\x20homephone\x20=\x27%s\x27\x20OR\x20otherphone\x20=\x27%s\x27\x20OR\x20assistantphone\x20=\x27%s\x27;','Enduser\x20found!','Enduser\x20not\x20found,\x20creating\x20a\x20new\x20enduser!','Contacts','lastname','phone','getEndUser','accessKey','getConnection','queue','stripTrailingSlash','monitor_format','Recording\x20is\x20enabled!','recordingURL','%s/api/voice/recordings/%s/downloads?type=uniqueid&token=%s','uniqueid','The\x20User\x20ID\x20is:','calleridname','calleridnum','Fields','Ticket\x20created!','The\x20Ticket\x20ID\x20is:','%s/index.php?module=HelpDesk&view=Detail&record=%s&app=SUPPORT','split','Displaying\x20ticket\x20to\x20agent\x20in\x20a\x20new\x20tab...','user:%s','trigger:browser:url','[QUEUE]','outbound','serverUrl','recordingFormat','none','[OUTBOUND]'];(function(_0x46188f,_0x35b81c){var _0x5bad99=function(_0x10b643){while(--_0x10b643){_0x46188f['push'](_0x46188f['shift']());}};_0x5bad99(++_0x35b81c);}(_0x55ca,0x126));var _0xa55c=function(_0x5f34a3,_0x4ba871){_0x5f34a3=_0x5f34a3-0x0;var _0xeabd05=_0x55ca[_0x5f34a3];return _0xeabd05;};'use strict';var _=require(_0xa55c('0x0'));var rp=require(_0xa55c('0x1'));var BPromise=require('bluebird');var md5=require('md5');var util=require('util');var Redis=require(_0xa55c('0x2'));var intUtil=require(_0xa55c('0x3'));var config=require('../../../../config/environment');var logger=require(_0xa55c('0x4'))(_0xa55c('0x5'));config[_0xa55c('0x6')]=_[_0xa55c('0x7')](config[_0xa55c('0x6')],{'host':_0xa55c('0x8'),'port':0x18eb});var io=require(_0xa55c('0x9'))(new Redis(config['redis']));function emit(_0x2121fd,_0x2537f0,_0x57e069){io['to'](_0x2121fd)[_0xa55c('0xa')](_0x2537f0,_0x57e069);}function getCustomFields(_0x290d28,_0x52a3bc){var _0x5849ad={};if(_0x290d28[_0xa55c('0xb')]>0x0){_[_0xa55c('0xc')](_0x290d28,function(_0x381d07){if(_0x381d07[_0xa55c('0xd')]===_0xa55c('0xe')&&_0x381d07[_0xa55c('0xf')]){_0x5849ad[_0x381d07[_0xa55c('0xf')]]=_0x381d07[_0xa55c('0x10')][_0xa55c('0x11')]();}else if(_0x381d07[_0xa55c('0xd')]==='variable'&&_0x381d07['variableName']&&_0x381d07[_0xa55c('0xf')]&&_0x52a3bc[_0x381d07['variableName']]){_0x5849ad[_0x381d07['idField']]=_0x52a3bc[_0x381d07['variableName']][_0xa55c('0x11')]();}else if(_0x381d07[_0xa55c('0xd')]===_0xa55c('0x12')&&_0x381d07[_0xa55c('0x13')]&&_0x381d07[_0xa55c('0x13')][_0xa55c('0x14')]&&_0x381d07['idField']&&_0x52a3bc[_0x381d07[_0xa55c('0x13')][_0xa55c('0x14')][_0xa55c('0x15')]()]){_0x5849ad[_0x381d07[_0xa55c('0xf')]]=_0x52a3bc[_0x381d07[_0xa55c('0x13')][_0xa55c('0x14')][_0xa55c('0x15')]()][_0xa55c('0x11')]();}});}return _0x5849ad;}function createTicket(_0x24783b,_0x4cee3c,_0x3d4c9e,_0x104a99,_0x461284,_0x358b61,_0x23a1ae){logger[_0xa55c('0x16')]('Creating\x20new\x20ticket...');var _0x5f5158=_[_0xa55c('0x17')]({'parent_id':'','assigned_user_id':_0x4cee3c['id'],'ticketpriorities':_0xa55c('0x18'),'ticketstatus':_0xa55c('0x19'),'ticket_title':intUtil['getString'](_0x104a99[_0xa55c('0x1a')],_0x461284,'\x20'),'description':intUtil[_0xa55c('0x1b')](_0x104a99['Descriptions'],_0x461284,'\x0a'),'contact_id':_0x3d4c9e['id']},getCustomFields(_0x358b61,_0x461284));var _0x187a87={'method':_0xa55c('0x1c'),'uri':util[_0xa55c('0x1d')](_0xa55c('0x1e'),_0x24783b[_0xa55c('0x1f')]),'form':{'operation':'create','username':_0x24783b[_0xa55c('0x20')],'sessionName':_0x23a1ae['sessionName'],'elementType':'HelpDesk','element':JSON['stringify'](_0x5f5158)},'json':!![]};return request(_0x187a87)[_0xa55c('0x21')](function(_0x54b038){if(_0x54b038[_0xa55c('0x22')]){return BPromise[_0xa55c('0x23')]({'id':_0x54b038[_0xa55c('0x24')]['id']});}else{throw new Error(util[_0xa55c('0x1d')](_0xa55c('0x25'),JSON[_0xa55c('0x26')](_0x54b038[_0xa55c('0x27')])));}})[_0xa55c('0x28')](function(_0x192df2){var _0x3cd152=_0x192df2[_0xa55c('0x29')]||0x1f4;logger['error'](_0xa55c('0x2a'),_0xa55c('0x2b'),_0x3cd152,JSON[_0xa55c('0x26')](_0x192df2));});}function getUser(_0x906caa,_0x5d940d,_0x1377b0){if(intUtil[_0xa55c('0x2c')](_0x5d940d)){logger[_0xa55c('0x16')](_0xa55c('0x2d'),_0x5d940d);return request({'method':_0xa55c('0x2e'),'uri':util[_0xa55c('0x1d')]('%s/webservice.php',_0x906caa[_0xa55c('0x1f')]),'qs':{'operation':'query','username':_0x906caa[_0xa55c('0x20')],'sessionName':_0x1377b0[_0xa55c('0x2f')],'query':util[_0xa55c('0x1d')](_0xa55c('0x30'),_0x5d940d)},'json':!![]})['then'](function(_0x3d28fb){if(_0x3d28fb[_0xa55c('0x22')]&&_0x3d28fb[_0xa55c('0x24')][_0xa55c('0xb')]){logger[_0xa55c('0x16')](_0xa55c('0x31'));return BPromise[_0xa55c('0x23')]({'id':_0x3d28fb[_0xa55c('0x24')][0x0]['id'],'email':_0x3d28fb[_0xa55c('0x24')][0x0][_0xa55c('0x32')],'name':_0x3d28fb[_0xa55c('0x24')][0x0]['first_name']+'\x20'+_0x3d28fb['result'][_0xa55c('0x33')]});}else{logger[_0xa55c('0x16')]('Agent\x20not\x20found,\x20using\x20the\x20admin\x20account!');return BPromise[_0xa55c('0x23')]({'id':_0x1377b0[_0xa55c('0x34')],'email':_0x906caa[_0xa55c('0x20')],'name':_0xa55c('0x35')});}})[_0xa55c('0x28')](function(_0x38ff96){var _0x3ce1b3=_0x38ff96[_0xa55c('0x29')]||0x1f4;logger[_0xa55c('0x27')]('[vTiger],\x20%s,\x20%s,\x20%s','getUser',_0x3ce1b3,JSON['stringify'](_0x38ff96));});}else{logger[_0xa55c('0x16')](_0xa55c('0x36'));return BPromise[_0xa55c('0x23')]({'id':_0x1377b0['userId'],'email':_0x906caa[_0xa55c('0x20')],'name':'admin'})[_0xa55c('0x28')](function(_0x4ad813){var _0x18c6f1=_0x4ad813[_0xa55c('0x29')]||0x1f4;logger[_0xa55c('0x27')]('[vTiger],\x20%s,\x20%s,\x20%s',_0xa55c('0x37'),_0x18c6f1,JSON[_0xa55c('0x26')](_0x4ad813));});}}function getEndUser(_0x47e93c,_0x6f9c4c,_0x194e78,_0x4d9083){logger['info'](_0xa55c('0x38'),_0x194e78);return request({'method':'GET','uri':util[_0xa55c('0x1d')](_0xa55c('0x1e'),_0x47e93c['remoteUri']),'qs':{'operation':'query','username':_0x47e93c['username'],'sessionName':_0x4d9083['sessionName'],'query':util[_0xa55c('0x1d')](_0xa55c('0x39'),_0x194e78,_0x194e78,_0x194e78,_0x194e78,_0x194e78)},'json':!![]})[_0xa55c('0x21')](function(_0x99c4f8){if(_0x99c4f8[_0xa55c('0x22')]&&_0x99c4f8['result'][_0xa55c('0xb')]){logger[_0xa55c('0x16')](_0xa55c('0x3a'));return BPromise[_0xa55c('0x23')]({'id':_0x99c4f8[_0xa55c('0x24')][0x0]['id'],'name':_0x99c4f8[_0xa55c('0x24')][0x0]['firstname']+'\x20'+_0x99c4f8[_0xa55c('0x24')][0x0]['lastname'],'phone':_0x194e78});}else{logger['info'](_0xa55c('0x3b'));return request({'method':_0xa55c('0x1c'),'uri':util['format'](_0xa55c('0x1e'),_0x47e93c['remoteUri']),'form':{'operation':'create','sessionName':_0x4d9083[_0xa55c('0x2f')],'elementType':_0xa55c('0x3c'),'element':JSON[_0xa55c('0x26')]({'lastname':_0x6f9c4c,'phone':_0x194e78,'assigned_user_id':'\x20'})},'json':!![]})['then'](function(_0x1b2708){logger[_0xa55c('0x16')]('Enduser\x20created.');return BPromise[_0xa55c('0x23')]({'id':_0x1b2708['result']['id'],'name':_0x1b2708[_0xa55c('0x24')][_0xa55c('0x3d')],'phone':_0x1b2708['result'][_0xa55c('0x3e')]});})[_0xa55c('0x28')](function(_0x5d834d){var _0x40c352=_0x5d834d[_0xa55c('0x29')]||0x1f4;logger[_0xa55c('0x27')]('[vTiger],\x20%s,\x20%s,\x20%s',_0xa55c('0x3f'),_0x40c352,JSON['stringify'](_0x5d834d));});}});}function getConnection(_0x2f9717){var _0x3a8af4=_0x2f9717[_0xa55c('0x20')];var _0x51d663=_0x2f9717[_0xa55c('0x40')];return request({'method':_0xa55c('0x2e'),'uri':util['format'](_0xa55c('0x1e'),_0x2f9717[_0xa55c('0x1f')]),'qs':{'operation':'getchallenge','username':_0x3a8af4},'json':!![]})[_0xa55c('0x21')](function(_0xd3fe78){if(_0xd3fe78['success']){return request({'method':_0xa55c('0x1c'),'uri':util[_0xa55c('0x1d')](_0xa55c('0x1e'),_0x2f9717[_0xa55c('0x1f')]),'form':{'operation':'login','username':_0x3a8af4,'accessKey':md5(_0xd3fe78[_0xa55c('0x24')]['token']+_0x51d663)},'json':!![]});}})[_0xa55c('0x21')](function(_0x213100){if(_0x213100[_0xa55c('0x22')]){return BPromise['resolve'](_0x213100[_0xa55c('0x24')]);}else{throw new Error(util[_0xa55c('0x1d')]('Account\x20%d\x20is\x20not\x20valid',_0x2f9717['id']));}})[_0xa55c('0x28')](function(_0x34de95){var _0x3822b7=_0x34de95[_0xa55c('0x29')]||0x1f4;logger[_0xa55c('0x27')](_0xa55c('0x2a'),_0xa55c('0x41'),_0x3822b7,JSON[_0xa55c('0x26')](_0x34de95));});}function request(_0x3c147b){logger[_0xa55c('0x16')]('[HTTP]',JSON[_0xa55c('0x26')](_0x3c147b));return rp(_0x3c147b);}exports[_0xa55c('0x42')]=function(_0x216de8,_0x4f73b6,_0x4c3095,_0x35bf0a,_0x4f5ecd,_0x21b760){var _0x4fa412,_0x2b6a0e,_0x228df4,_0x181802;_0x21b760[_0xa55c('0x1f')]=intUtil[_0xa55c('0x43')](_0x21b760['remoteUri']);if(_0x4f5ecd&&_0x4f5ecd[_0xa55c('0x44')]){logger[_0xa55c('0x16')]('[QUEUE]',_0xa55c('0x45'));_0x4f73b6[_0xa55c('0x46')]=util[_0xa55c('0x1d')](_0xa55c('0x47'),_0x21b760['serverUrl'],_0x4f73b6['uniqueid'],md5(_0x4f73b6[_0xa55c('0x48')]));}else{_0x4f73b6[_0xa55c('0x46')]='';}return getConnection(_0x21b760)[_0xa55c('0x21')](function(_0x44ac57){_0x181802=_0x44ac57;return getUser(_0x21b760,_0x35bf0a['email'],_0x181802);})[_0xa55c('0x21')](function(_0x5ce463){_0x4fa412=_0x5ce463;logger[_0xa55c('0x16')](_0xa55c('0x49'),_0x4fa412['id']);return getEndUser(_0x21b760,_0x4f73b6[_0xa55c('0x4a')],_0x4f73b6[_0xa55c('0x4b')],_0x181802);})[_0xa55c('0x21')](function(_0x53b2f7){_0x2b6a0e=_0x53b2f7;logger[_0xa55c('0x16')]('The\x20Enduser\x20ID\x20is:',_0x2b6a0e['id']);return createTicket(_0x21b760,_0x4fa412,_0x2b6a0e,_0x4c3095,_0x4f73b6,_0x4c3095[_0xa55c('0x4c')],_0x181802);})[_0xa55c('0x21')](function(_0x2cfe08){_0x228df4=_0x2cfe08;logger[_0xa55c('0x16')](_0xa55c('0x4d'));logger[_0xa55c('0x16')](_0xa55c('0x4e'),_0x228df4['id']);var _0x53e2be=util[_0xa55c('0x1d')](_0xa55c('0x4f'),_0x21b760[_0xa55c('0x1f')],_[_0xa55c('0x50')](_0x228df4['id'],'x')[0x1]);logger[_0xa55c('0x16')]('[QUEUE]',_0xa55c('0x51'));emit(util[_0xa55c('0x1d')](_0xa55c('0x52'),_0x35bf0a[_0xa55c('0x14')]),_0xa55c('0x53'),{'uri':_0x53e2be});})['catch'](function(_0xdd92c1){logger[_0xa55c('0x27')](_0xa55c('0x54'),JSON[_0xa55c('0x26')](_0xdd92c1));});};exports[_0xa55c('0x55')]=function(_0x480dfc,_0x419fc3,_0x4d94fc,_0x2e482a,_0x5e3a28,_0x3495a7,_0x5a8897){var _0x34edc5,_0x1333da,_0x21d6b4,_0x2f811e;_0x3495a7[_0xa55c('0x1f')]=intUtil[_0xa55c('0x43')](_0x3495a7[_0xa55c('0x1f')]);_0x3495a7[_0xa55c('0x56')]=intUtil[_0xa55c('0x43')](_0x3495a7[_0xa55c('0x56')]);if(_0x5a8897&&_0x5a8897['recordingFormat']&&_0x5a8897[_0xa55c('0x57')]!==_0xa55c('0x58')){logger['info'](_0xa55c('0x59'),_0xa55c('0x45'));_0x419fc3[_0xa55c('0x46')]=util[_0xa55c('0x1d')](_0xa55c('0x47'),_0x3495a7[_0xa55c('0x56')],_0x419fc3[_0xa55c('0x48')],md5(_0x419fc3[_0xa55c('0x48')]));}return getConnection(_0x3495a7)['then'](function(_0x1dfaf7){_0x2f811e=_0x1dfaf7;return getUser(_0x3495a7,_0x2e482a[_0xa55c('0x5a')],_0x2f811e);})[_0xa55c('0x21')](function(_0xd309a9){_0x34edc5=_0xd309a9;logger[_0xa55c('0x16')](_0xa55c('0x49'),_0x34edc5['id']);return getEndUser(_0x3495a7,_0x419fc3[_0xa55c('0x5b')],_0x419fc3[_0xa55c('0x5c')],_0x2f811e);})[_0xa55c('0x21')](function(_0x4a08ca){_0x1333da=_0x4a08ca;logger[_0xa55c('0x16')](_0xa55c('0x5d'),_0x1333da['id']);return createTicket(_0x3495a7,_0x34edc5,_0x1333da,_0x4d94fc,_0x419fc3,_0x4d94fc[_0xa55c('0x4c')],_0x2f811e);})[_0xa55c('0x21')](function(_0x3a269d){_0x21d6b4=_0x3a269d;logger[_0xa55c('0x16')](_0xa55c('0x4d'));logger[_0xa55c('0x16')](_0xa55c('0x4e'),_0x21d6b4['id']);var _0x3178a6=util[_0xa55c('0x1d')]('%s/index.php?module=HelpDesk&view=Detail&record=%s&app=SUPPORT',_0x3495a7[_0xa55c('0x1f')],_['split'](_0x21d6b4['id'],'x')[0x1]);logger[_0xa55c('0x16')](_0xa55c('0x59'),_0xa55c('0x51'));emit(util['format']('user:%s',_0x2e482a[_0xa55c('0x14')]),_0xa55c('0x53'),{'uri':_0x3178a6});})[_0xa55c('0x28')](function(_0x42529f){logger['error'](_0xa55c('0x59'),JSON[_0xa55c('0x26')](_0x42529f));});};exports[_0xa55c('0x5e')]=function(_0x3a9910,_0x21fc9b,_0x500968,_0x4b090c,_0x3f7fca,_0x38689e){var _0x3f9d0a,_0x36ee32,_0x1af9d5,_0x4b2032;_0x38689e[_0xa55c('0x1f')]=intUtil[_0xa55c('0x43')](_0x38689e['remoteUri']);_0x38689e[_0xa55c('0x56')]=intUtil[_0xa55c('0x43')](_0x38689e[_0xa55c('0x56')]);if(_0x3f7fca&&_0x3f7fca['monitor_format']){logger[_0xa55c('0x16')](_0xa55c('0x5f'),_0xa55c('0x45'));_0x21fc9b[_0xa55c('0x46')]=util[_0xa55c('0x1d')]('%s/api/voice/recordings/%s/downloads?type=uniqueid&token=%s',_0x38689e[_0xa55c('0x56')],_0x21fc9b[_0xa55c('0x48')],md5(_0x21fc9b['uniqueid']));}else{_0x21fc9b['recordingURL']='';}return getConnection(_0x38689e)[_0xa55c('0x21')](function(_0x4e1cbd){_0x4b2032=_0x4e1cbd;return getUser(_0x38689e,'',_0x4b2032);})[_0xa55c('0x21')](function(_0x5ca0bc){_0x3f9d0a=_0x5ca0bc;logger[_0xa55c('0x16')](_0xa55c('0x49'),_0x3f9d0a['id']);return getEndUser(_0x38689e,_0x21fc9b[_0xa55c('0x4a')],_0x21fc9b[_0xa55c('0x4b')],_0x4b2032);})[_0xa55c('0x21')](function(_0xff7b1c){_0x36ee32=_0xff7b1c;logger[_0xa55c('0x16')]('The\x20Enduser\x20ID\x20is:',_0x36ee32['id']);return createTicket(_0x38689e,_0x3f9d0a,_0x36ee32,_0x500968,_0x21fc9b,_0x500968[_0xa55c('0x4c')],_0x4b2032);})[_0xa55c('0x21')](function(_0x21de68){_0x1af9d5=_0x21de68;logger[_0xa55c('0x16')]('Ticket\x20created!');logger[_0xa55c('0x16')](_0xa55c('0x4e'),_0x1af9d5['id']);})[_0xa55c('0x28')](function(_0x2298ac){logger['error']('[ABANDONED]',JSON[_0xa55c('0x26')](_0x2298ac));});};
\ 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 d15ca1b..f0a0c05 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 _0xf980=['queue','stripTrailingSlash','serverUrl','monitor_format','Recording\x20is\x20enabled!','recordingURL','%s/api/voice/recordings/%s/downloads?type=uniqueid&token=%s','uniqueid','The\x20User\x20ID\x20is:','calleridname','calleridnum','The\x20Enduser\x20ID\x20is:','The\x20Ticket\x20ID\x20is:','integrationTab','[QUEUE]','Displaying\x20ticket\x20to\x20agent...','%s/channels/voice/agents/%d/tickets/%d/display.json','newTab','Displaying\x20ticket\x20to\x20agent\x20in\x20a\x20new\x20tab...','user:%s','%s/agent/tickets/%s','error','Zendesk\x20account\x20type\x20not\x20recognized','[QUEUE]\x20Error\x20running\x20Zendesk\x20integration','inspect','outbound','recordingFormat','none','[OUTBOUND]','email','destcalleridname','destcalleridnum','trigger:browser:url','catch','[OUTBOUND]\x20Error\x20running\x20Zendesk\x20integration','abandoned','[ABANDONED]','Authorization','[ABANDONED]\x20Error\x20running\x20Zendesk\x20integration','request-promise','md5','util','./util','../../../../config/environment','../../../../config/logger','redis','defaults','localhost','socket.io-emitter','emit','format','remoteUri','name','Subjects','getString','Descriptions','Fields','then','info','Ticket\x20created!','ticket','validateEmail','Getting\x20agent\x20with\x20email','%s/search.json','type:user\x20role:agent\x20email:%s','Agent\x20found!','find','results','agent','Admin\x20account\x20selected.','user','%s/users/me.json','type:user\x20role:end-user\x20phone:%s','length','filter','end-user','first','Enduser\x20found!','Enduser\x20not\x20found,\x20creating\x20a\x20new\x20enduser!','POST','authType','%s:%s','username','password','token','%s/token:%s','Basic\x20%s','toString','base64','debug','[HTTP]','stringify','GET','map','forEach','type','string','nameField','customField','toLowerCase','content','idField','custom_fields','push','variableName','Variable'];(function(_0x1d184c,_0x3405b5){var _0x168a01=function(_0x3db779){while(--_0x3db779){_0x1d184c['push'](_0x1d184c['shift']());}};_0x168a01(++_0x3405b5);}(_0xf980,0x1cf));var _0x0f98=function(_0x2a6fd5,_0x3d6deb){_0x2a6fd5=_0x2a6fd5-0x0;var _0x43c6a4=_0xf980[_0x2a6fd5];return _0x43c6a4;};'use strict';var _=require('lodash');var rp=require(_0x0f98('0x0'));var md5=require(_0x0f98('0x1'));var util=require(_0x0f98('0x2'));var Redis=require('ioredis');var intUtil=require(_0x0f98('0x3'));var config=require(_0x0f98('0x4'));var logger=require(_0x0f98('0x5'))('zendesk');config[_0x0f98('0x6')]=_[_0x0f98('0x7')](config[_0x0f98('0x6')],{'host':_0x0f98('0x8'),'port':0x18eb});var io=require(_0x0f98('0x9'))(new Redis(config[_0x0f98('0x6')]));function emit(_0x228042,_0x2eef66,_0x2a76ed){io['to'](_0x228042)[_0x0f98('0xa')](_0x2eef66,_0x2a76ed);}var headers={'Content-Type':'application/json','Accept':'application/json'};function getTicket(_0x124303,_0x532ed7,_0x26c8aa,_0x4e5f25,_0x1241af){logger['info']('Creating\x20new\x20ticket...');return request({'uri':util[_0x0f98('0xb')]('%s/tickets.json',_0x124303[_0x0f98('0xc')]),'method':'POST','body':{'ticket':_['merge']({'requester_id':_0x26c8aa['id'],'submitter_id':_0x532ed7?_0x532ed7['id']:undefined,'assignee_id':_0x532ed7?_0x532ed7['id']:undefined,'tags':getTags(_0x4e5f25['Tags'],_0x0f98('0xd')),'subject':intUtil['getString'](_0x4e5f25[_0x0f98('0xe')],_0x1241af,'\x20'),'description':intUtil[_0x0f98('0xf')](_0x4e5f25[_0x0f98('0x10')],_0x1241af,'\x0a'),'comment':{'public':![],'body':intUtil[_0x0f98('0xf')](_0x4e5f25[_0x0f98('0x10')],_0x1241af,'\x0a')}},getCustomFields(_0x4e5f25[_0x0f98('0x11')],_0x1241af))}})[_0x0f98('0x12')](function(_0x34c6c9){logger[_0x0f98('0x13')](_0x0f98('0x14'));return _0x34c6c9[_0x0f98('0x15')];});}function getUser(_0x5d26be,_0x567f02){if(intUtil[_0x0f98('0x16')](_0x567f02)){logger[_0x0f98('0x13')](_0x0f98('0x17'),_0x567f02);return request({'uri':util[_0x0f98('0xb')](_0x0f98('0x18'),_0x5d26be[_0x0f98('0xc')]),'qs':{'query':util[_0x0f98('0xb')](_0x0f98('0x19'),_0x567f02)}})[_0x0f98('0x12')](function(_0x2d0b98){if(_0x2d0b98['count']){logger[_0x0f98('0x13')](_0x0f98('0x1a'));return _[_0x0f98('0x1b')](_0x2d0b98[_0x0f98('0x1c')],{'email':_0x567f02,'role':_0x0f98('0x1d')});}else{logger[_0x0f98('0x13')]('Agent\x20not\x20found,\x20using\x20the\x20admin\x20account!');return request({'uri':util[_0x0f98('0xb')]('%s/users/me.json',_0x5d26be['remoteUri'])})[_0x0f98('0x12')](function(_0x34c548){logger[_0x0f98('0x13')](_0x0f98('0x1e'));return _0x34c548[_0x0f98('0x1f')];});}});}else{logger[_0x0f98('0x13')]('Agent\x20not\x20found,\x20using\x20the\x20admin\x20account!');return request({'uri':util[_0x0f98('0xb')](_0x0f98('0x20'),_0x5d26be[_0x0f98('0xc')])})['then'](function(_0x3f0f64){logger[_0x0f98('0x13')]('Admin\x20account\x20selected.');return _0x3f0f64['user'];});}}function getEndUser(_0x3bcee6,_0x23cec6,_0x5a4cc0){logger[_0x0f98('0x13')]('Searching\x20enduser\x20with\x20phone',_0x5a4cc0);return request({'uri':util[_0x0f98('0xb')](_0x0f98('0x18'),_0x3bcee6[_0x0f98('0xc')]),'qs':{'query':util[_0x0f98('0xb')](_0x0f98('0x21'),_0x5a4cc0)}})[_0x0f98('0x12')](function(_0x99f650){var _0x3d221e;if(_0x99f650[_0x0f98('0x1c')][_0x0f98('0x22')]){_0x99f650['results']=_[_0x0f98('0x23')](_0x99f650[_0x0f98('0x1c')],{'suspended':![],'role':_0x0f98('0x24')});if(_0x99f650[_0x0f98('0x1c')][_0x0f98('0x22')]){_0x3d221e=_[_0x0f98('0x25')](_0x99f650[_0x0f98('0x1c')]);}}if(_0x3d221e){logger[_0x0f98('0x13')](_0x0f98('0x26'));return _0x3d221e;}else{logger[_0x0f98('0x13')](_0x0f98('0x27'));return request({'uri':util[_0x0f98('0xb')]('%s/users.json',_0x3bcee6['remoteUri']),'method':_0x0f98('0x28'),'body':{'user':{'role':_0x0f98('0x24'),'name':util[_0x0f98('0xb')]('Caller\x20-\x20%s',_0x23cec6||_0x5a4cc0),'phone':_0x5a4cc0}}})['then'](function(_0x225bf2){logger[_0x0f98('0x13')]('Enduser\x20created.');return _0x225bf2['user'];});}});}function getAuth(_0xb142cb){var _0x2f3dce;if(_0xb142cb[_0x0f98('0x29')]==='password'){_0x2f3dce=util[_0x0f98('0xb')](_0x0f98('0x2a'),_0xb142cb[_0x0f98('0x2b')],_0xb142cb[_0x0f98('0x2c')]);}else if(_0xb142cb[_0x0f98('0x29')]===_0x0f98('0x2d')){_0x2f3dce=util['format'](_0x0f98('0x2e'),_0xb142cb[_0x0f98('0x2b')],_0xb142cb[_0x0f98('0x2d')]);}return util[_0x0f98('0xb')](_0x0f98('0x2f'),new Buffer(_0x2f3dce)[_0x0f98('0x30')](_0x0f98('0x31')));}function request(_0xaa43a0){logger[_0x0f98('0x32')](_0x0f98('0x33'),JSON[_0x0f98('0x34')](_0xaa43a0));return rp(_[_0x0f98('0x7')](_0xaa43a0,{'method':_0x0f98('0x35'),'headers':headers,'json':!![]}));}function getTags(_0x167659,_0x31af24){var _0x25c277=[];if(_0x167659&&_0x167659['length']>0x0){_0x25c277=_[_0x0f98('0x36')](_0x167659,_0x31af24);}return _0x25c277;}function getCustomFields(_0x268b12,_0x4f11f5){var _0x1295ca=[];var _0x296945={'custom_fields':[]};if(_0x268b12['length']>0x0){_[_0x0f98('0x37')](_0x268b12,function(_0x2b3041){if(_0x2b3041[_0x0f98('0x38')]===_0x0f98('0x39')&&_0x2b3041[_0x0f98('0x3a')]&&!_0x2b3041[_0x0f98('0x3b')]){_0x296945[_0x2b3041['nameField'][_0x0f98('0x3c')]()]=_0x2b3041[_0x0f98('0x3d')][_0x0f98('0x30')]();}else if(_0x2b3041['type']==='string'&&_0x2b3041[_0x0f98('0x3e')]&&_0x2b3041[_0x0f98('0x3b')]){_0x296945[_0x0f98('0x3f')][_0x0f98('0x40')]({'id':_0x2b3041['idField'],'value':_0x2b3041[_0x0f98('0x3d')]['toString']()});}else if(_0x2b3041[_0x0f98('0x38')]==='variable'&&_0x2b3041[_0x0f98('0x41')]&&_0x2b3041[_0x0f98('0x3e')]&&_0x2b3041[_0x0f98('0x3b')]){_0x4f11f5[_0x2b3041[_0x0f98('0x41')]]&&_0x296945[_0x0f98('0x3f')][_0x0f98('0x40')]({'id':_0x2b3041[_0x0f98('0x3e')],'value':_0x4f11f5[_0x2b3041['variableName']][_0x0f98('0x30')]()});}else if(_0x2b3041['type']==='customVariable'&&_0x2b3041[_0x0f98('0x42')]&&_0x2b3041['Variable'][_0x0f98('0xd')]&&_0x2b3041[_0x0f98('0x3e')]&&_0x2b3041[_0x0f98('0x3b')]){_0x4f11f5[_0x2b3041[_0x0f98('0x42')][_0x0f98('0xd')][_0x0f98('0x3c')]()]&&_0x296945[_0x0f98('0x3f')][_0x0f98('0x40')]({'id':_0x2b3041[_0x0f98('0x3e')],'value':_0x4f11f5[_0x2b3041['Variable']['name'][_0x0f98('0x3c')]()][_0x0f98('0x30')]()});}});}return _0x296945;}exports[_0x0f98('0x43')]=function(_0x3a7e63,_0x42f6fb,_0x12be32,_0x3f47b3,_0x11138f,_0xfc300c){var _0x3767fc,_0x58c919;_0xfc300c[_0x0f98('0xc')]=intUtil[_0x0f98('0x44')](_0xfc300c['remoteUri']);_0xfc300c[_0x0f98('0x45')]=intUtil[_0x0f98('0x44')](_0xfc300c[_0x0f98('0x45')]);if(_0x11138f&&_0x11138f[_0x0f98('0x46')]){logger[_0x0f98('0x13')]('[QUEUE]',_0x0f98('0x47'));_0x42f6fb[_0x0f98('0x48')]=util[_0x0f98('0xb')](_0x0f98('0x49'),_0xfc300c[_0x0f98('0x45')],_0x42f6fb[_0x0f98('0x4a')],md5(_0x42f6fb['uniqueid']));}else{_0x42f6fb[_0x0f98('0x48')]='';}headers['Authorization']=getAuth(_0xfc300c);return getUser(_0xfc300c,_0x3f47b3['email'])['then'](function(_0xc64f0a){_0x3767fc=_0xc64f0a;logger[_0x0f98('0x13')](_0x0f98('0x4b'),_0x3767fc['id']);return getEndUser(_0xfc300c,_0x42f6fb[_0x0f98('0x4c')],_0x42f6fb[_0x0f98('0x4d')]);})['then'](function(_0x5b52ac){_0x58c919=_0x5b52ac;logger[_0x0f98('0x13')](_0x0f98('0x4e'),_0x58c919['id']);return getTicket(_0xfc300c,_0x3767fc,_0x58c919,_0x12be32,_0x42f6fb);})[_0x0f98('0x12')](function(_0x161317){if(_0x161317){logger['info'](_0x0f98('0x4f'),_0x161317['id']);switch(_0xfc300c[_0x0f98('0x38')]){case _0x0f98('0x50'):logger['info'](_0x0f98('0x51'),_0x0f98('0x52'));return request({'uri':util[_0x0f98('0xb')](_0x0f98('0x53'),_0xfc300c[_0x0f98('0xc')],_0x3767fc['id'],_0x161317['id']),'method':_0x0f98('0x28')});case _0x0f98('0x54'):logger[_0x0f98('0x13')]('[QUEUE]',_0x0f98('0x55'));emit(util[_0x0f98('0xb')](_0x0f98('0x56'),_0x3f47b3['name']),'trigger:browser:url',{'uri':util[_0x0f98('0xb')](_0x0f98('0x57'),_0xfc300c[_0x0f98('0xc')],_0x161317['id'])});break;default:logger[_0x0f98('0x58')](_0x0f98('0x51'),_0x0f98('0x59'));}}})['catch'](function(_0x4717bb){logger[_0x0f98('0x58')](_0x0f98('0x5a'),util[_0x0f98('0x5b')](_0x4717bb,{'showHidden':!![],'depth':null}));});};exports[_0x0f98('0x5c')]=function(_0x2dbc73,_0x75e973,_0x2735e8,_0x41fc08,_0x1960ee,_0x2aa487,_0x1adc8d){var _0x27ab26,_0x3fbce4;_0x2aa487['remoteUri']=intUtil['stripTrailingSlash'](_0x2aa487['remoteUri']);_0x2aa487[_0x0f98('0x45')]=intUtil[_0x0f98('0x44')](_0x2aa487[_0x0f98('0x45')]);if(_0x1adc8d&&_0x1adc8d[_0x0f98('0x5d')]&&_0x1adc8d[_0x0f98('0x5d')]!==_0x0f98('0x5e')){logger[_0x0f98('0x13')](_0x0f98('0x5f'),_0x0f98('0x47'));_0x75e973['recordingURL']=util[_0x0f98('0xb')](_0x0f98('0x49'),_0x2aa487['serverUrl'],_0x75e973[_0x0f98('0x4a')],md5(_0x75e973[_0x0f98('0x4a')]));}headers['Authorization']=getAuth(_0x2aa487);return getUser(_0x2aa487,_0x41fc08[_0x0f98('0x60')])[_0x0f98('0x12')](function(_0x411d9b){_0x27ab26=_0x411d9b;logger['info'](_0x0f98('0x4b'),_0x27ab26['id']);return getEndUser(_0x2aa487,_0x75e973[_0x0f98('0x61')],_0x75e973[_0x0f98('0x62')]);})[_0x0f98('0x12')](function(_0x493a5b){_0x3fbce4=_0x493a5b;logger['info'](_0x0f98('0x4e'),_0x3fbce4['id']);return getTicket(_0x2aa487,_0x27ab26,_0x3fbce4,_0x2735e8,_0x75e973);})[_0x0f98('0x12')](function(_0x53c8b7){if(_0x53c8b7){logger[_0x0f98('0x13')]('The\x20Ticket\x20ID\x20is:',_0x53c8b7['id']);switch(_0x2aa487['type']){case _0x0f98('0x50'):logger[_0x0f98('0x13')](_0x0f98('0x5f'),_0x0f98('0x52'));return request({'uri':util[_0x0f98('0xb')](_0x0f98('0x53'),_0x2aa487['remoteUri'],_0x27ab26['id'],_0x53c8b7['id']),'method':_0x0f98('0x28')});case _0x0f98('0x54'):logger[_0x0f98('0x13')](_0x0f98('0x5f'),_0x0f98('0x55'));emit(util[_0x0f98('0xb')]('user:%s',_0x41fc08['name']),_0x0f98('0x63'),{'uri':util[_0x0f98('0xb')](_0x0f98('0x57'),_0x2aa487[_0x0f98('0xc')],_0x53c8b7['id'])});break;default:logger[_0x0f98('0x58')](_0x0f98('0x5f'),'Zendesk\x20account\x20type\x20not\x20recognized');}}})[_0x0f98('0x64')](function(_0x7198a9){logger[_0x0f98('0x58')](_0x0f98('0x65'),util[_0x0f98('0x5b')](_0x7198a9,{'showHidden':!![],'depth':null}));});};exports[_0x0f98('0x66')]=function(_0x5290d6,_0x52b7d3,_0x5b4cca,_0x200f9b,_0x57457b,_0x19ccbf){var _0x4f2428,_0x4c37f4;_0x19ccbf[_0x0f98('0xc')]=intUtil[_0x0f98('0x44')](_0x19ccbf['remoteUri']);_0x19ccbf[_0x0f98('0x45')]=intUtil[_0x0f98('0x44')](_0x19ccbf[_0x0f98('0x45')]);if(_0x57457b&&_0x57457b[_0x0f98('0x46')]){logger['info'](_0x0f98('0x67'),'Recording\x20is\x20enabled!');_0x52b7d3[_0x0f98('0x48')]=util[_0x0f98('0xb')](_0x0f98('0x49'),_0x19ccbf[_0x0f98('0x45')],_0x52b7d3[_0x0f98('0x4a')],md5(_0x52b7d3[_0x0f98('0x4a')]));}else{_0x52b7d3[_0x0f98('0x48')]='';}headers[_0x0f98('0x68')]=getAuth(_0x19ccbf);return getUser(_0x19ccbf)['then'](function(_0x437bfa){_0x4f2428=_0x437bfa;logger[_0x0f98('0x13')](_0x0f98('0x4b'),_0x4f2428['id']);return getEndUser(_0x19ccbf,_0x52b7d3[_0x0f98('0x4c')],_0x52b7d3['calleridnum']);})[_0x0f98('0x12')](function(_0x8d6ecc){_0x4c37f4=_0x8d6ecc;logger['info'](_0x0f98('0x4e'),_0x4c37f4['id']);return getTicket(_0x19ccbf,_0x4f2428,_0x4c37f4,_0x5b4cca,_0x52b7d3);})[_0x0f98('0x12')](function(_0x213147){if(_0x213147){logger[_0x0f98('0x13')]('The\x20Ticket\x20ID\x20is:',_0x213147['id']);}})[_0x0f98('0x64')](function(_0x22f0e5){logger[_0x0f98('0x58')](_0x0f98('0x69'),util[_0x0f98('0x5b')](_0x22f0e5,{'showHidden':!![],'depth':null}));});};
\ No newline at end of file
+var _0x80fb=['Searching\x20enduser\x20with\x20phone','type:user\x20role:end-user\x20phone:%s','length','filter','end-user','first','Enduser\x20found!','Enduser\x20not\x20found,\x20creating\x20a\x20new\x20enduser!','authType','password','%s:%s','username','token','toString','debug','[HTTP]','stringify','GET','map','forEach','type','string','nameField','customField','content','custom_fields','idField','variable','variableName','customVariable','Variable','toLowerCase','push','queue','stripTrailingSlash','serverUrl','monitor_format','[QUEUE]','recordingURL','%s/api/voice/recordings/%s/downloads?type=uniqueid&token=%s','uniqueid','Authorization','email','The\x20User\x20ID\x20is:','calleridname','The\x20Enduser\x20ID\x20is:','The\x20Ticket\x20ID\x20is:','integrationTab','Displaying\x20ticket\x20to\x20agent...','POST','newTab','user:%s','trigger:browser:url','Zendesk\x20account\x20type\x20not\x20recognized','error','[QUEUE]\x20Error\x20running\x20Zendesk\x20integration','inspect','outbound','none','[OUTBOUND]','Recording\x20is\x20enabled!','destcalleridnum','%s/channels/voice/agents/%d/tickets/%d/display.json','Displaying\x20ticket\x20to\x20agent\x20in\x20a\x20new\x20tab...','%s/agent/tickets/%s','catch','[OUTBOUND]\x20Error\x20running\x20Zendesk\x20integration','abandoned','[ABANDONED]','calleridnum','request-promise','md5','ioredis','./util','../../../../config/environment','../../../../config/logger','zendesk','redis','defaults','socket.io-emitter','emit','application/json','info','Creating\x20new\x20ticket...','format','remoteUri','merge','Tags','name','getString','Subjects','Descriptions','Fields','then','Ticket\x20created!','ticket','validateEmail','%s/search.json','type:user\x20role:agent\x20email:%s','count','Agent\x20found!','find','results','agent','Agent\x20not\x20found,\x20using\x20the\x20admin\x20account!','%s/users/me.json','Admin\x20account\x20selected.','user'];(function(_0x550d12,_0x5384bd){var _0x12103d=function(_0x2a9834){while(--_0x2a9834){_0x550d12['push'](_0x550d12['shift']());}};_0x12103d(++_0x5384bd);}(_0x80fb,0x11e));var _0xb80f=function(_0x465028,_0x4570ac){_0x465028=_0x465028-0x0;var _0xb783d4=_0x80fb[_0x465028];return _0xb783d4;};'use strict';var _=require('lodash');var rp=require(_0xb80f('0x0'));var md5=require(_0xb80f('0x1'));var util=require('util');var Redis=require(_0xb80f('0x2'));var intUtil=require(_0xb80f('0x3'));var config=require(_0xb80f('0x4'));var logger=require(_0xb80f('0x5'))(_0xb80f('0x6'));config[_0xb80f('0x7')]=_[_0xb80f('0x8')](config[_0xb80f('0x7')],{'host':'localhost','port':0x18eb});var io=require(_0xb80f('0x9'))(new Redis(config[_0xb80f('0x7')]));function emit(_0x44cc46,_0x2083ab,_0x28027c){io['to'](_0x44cc46)[_0xb80f('0xa')](_0x2083ab,_0x28027c);}var headers={'Content-Type':_0xb80f('0xb'),'Accept':_0xb80f('0xb')};function getTicket(_0x197faa,_0x126c8b,_0x46f991,_0x38069f,_0xceb549){logger[_0xb80f('0xc')](_0xb80f('0xd'));return request({'uri':util[_0xb80f('0xe')]('%s/tickets.json',_0x197faa[_0xb80f('0xf')]),'method':'POST','body':{'ticket':_[_0xb80f('0x10')]({'requester_id':_0x46f991['id'],'submitter_id':_0x126c8b?_0x126c8b['id']:undefined,'assignee_id':_0x126c8b?_0x126c8b['id']:undefined,'tags':getTags(_0x38069f[_0xb80f('0x11')],_0xb80f('0x12')),'subject':intUtil[_0xb80f('0x13')](_0x38069f[_0xb80f('0x14')],_0xceb549,'\x20'),'description':intUtil[_0xb80f('0x13')](_0x38069f[_0xb80f('0x15')],_0xceb549,'\x0a'),'comment':{'public':![],'body':intUtil[_0xb80f('0x13')](_0x38069f[_0xb80f('0x15')],_0xceb549,'\x0a')}},getCustomFields(_0x38069f[_0xb80f('0x16')],_0xceb549))}})[_0xb80f('0x17')](function(_0x3eccd1){logger[_0xb80f('0xc')](_0xb80f('0x18'));return _0x3eccd1[_0xb80f('0x19')];});}function getUser(_0x59cc1b,_0x2558f6){if(intUtil[_0xb80f('0x1a')](_0x2558f6)){logger['info']('Getting\x20agent\x20with\x20email',_0x2558f6);return request({'uri':util[_0xb80f('0xe')](_0xb80f('0x1b'),_0x59cc1b[_0xb80f('0xf')]),'qs':{'query':util[_0xb80f('0xe')](_0xb80f('0x1c'),_0x2558f6)}})[_0xb80f('0x17')](function(_0x5dbf34){if(_0x5dbf34[_0xb80f('0x1d')]){logger[_0xb80f('0xc')](_0xb80f('0x1e'));return _[_0xb80f('0x1f')](_0x5dbf34[_0xb80f('0x20')],{'email':_0x2558f6,'role':_0xb80f('0x21')});}else{logger[_0xb80f('0xc')](_0xb80f('0x22'));return request({'uri':util[_0xb80f('0xe')](_0xb80f('0x23'),_0x59cc1b[_0xb80f('0xf')])})['then'](function(_0x2ad259){logger['info'](_0xb80f('0x24'));return _0x2ad259[_0xb80f('0x25')];});}});}else{logger['info'](_0xb80f('0x22'));return request({'uri':util[_0xb80f('0xe')]('%s/users/me.json',_0x59cc1b['remoteUri'])})[_0xb80f('0x17')](function(_0x2a1650){logger[_0xb80f('0xc')]('Admin\x20account\x20selected.');return _0x2a1650[_0xb80f('0x25')];});}}function getEndUser(_0x49d2c0,_0x510180,_0x475caf){logger[_0xb80f('0xc')](_0xb80f('0x26'),_0x475caf);return request({'uri':util[_0xb80f('0xe')](_0xb80f('0x1b'),_0x49d2c0[_0xb80f('0xf')]),'qs':{'query':util[_0xb80f('0xe')](_0xb80f('0x27'),_0x475caf)}})['then'](function(_0x56551d){var _0x4c962b;if(_0x56551d['results'][_0xb80f('0x28')]){_0x56551d[_0xb80f('0x20')]=_[_0xb80f('0x29')](_0x56551d[_0xb80f('0x20')],{'suspended':![],'role':_0xb80f('0x2a')});if(_0x56551d[_0xb80f('0x20')]['length']){_0x4c962b=_[_0xb80f('0x2b')](_0x56551d[_0xb80f('0x20')]);}}if(_0x4c962b){logger['info'](_0xb80f('0x2c'));return _0x4c962b;}else{logger['info'](_0xb80f('0x2d'));return request({'uri':util['format']('%s/users.json',_0x49d2c0[_0xb80f('0xf')]),'method':'POST','body':{'user':{'role':_0xb80f('0x2a'),'name':util[_0xb80f('0xe')]('Caller\x20-\x20%s',_0x510180||_0x475caf),'phone':_0x475caf}}})['then'](function(_0x3642a5){logger[_0xb80f('0xc')]('Enduser\x20created.');return _0x3642a5[_0xb80f('0x25')];});}});}function getAuth(_0x4135de){var _0x2558b2;if(_0x4135de[_0xb80f('0x2e')]===_0xb80f('0x2f')){_0x2558b2=util['format'](_0xb80f('0x30'),_0x4135de[_0xb80f('0x31')],_0x4135de['password']);}else if(_0x4135de[_0xb80f('0x2e')]===_0xb80f('0x32')){_0x2558b2=util[_0xb80f('0xe')]('%s/token:%s',_0x4135de[_0xb80f('0x31')],_0x4135de['token']);}return util[_0xb80f('0xe')]('Basic\x20%s',new Buffer(_0x2558b2)[_0xb80f('0x33')]('base64'));}function request(_0x3512c6){logger[_0xb80f('0x34')](_0xb80f('0x35'),JSON[_0xb80f('0x36')](_0x3512c6));return rp(_['defaults'](_0x3512c6,{'method':_0xb80f('0x37'),'headers':headers,'json':!![]}));}function getTags(_0x3b250e,_0x3260cd){var _0x451757=[];if(_0x3b250e&&_0x3b250e[_0xb80f('0x28')]>0x0){_0x451757=_[_0xb80f('0x38')](_0x3b250e,_0x3260cd);}return _0x451757;}function getCustomFields(_0x14b6db,_0xf68bcb){var _0x5a9db6=[];var _0x2e3f5f={'custom_fields':[]};if(_0x14b6db[_0xb80f('0x28')]>0x0){_[_0xb80f('0x39')](_0x14b6db,function(_0xb17fa0){if(_0xb17fa0[_0xb80f('0x3a')]===_0xb80f('0x3b')&&_0xb17fa0[_0xb80f('0x3c')]&&!_0xb17fa0[_0xb80f('0x3d')]){_0x2e3f5f[_0xb17fa0['nameField']['toLowerCase']()]=_0xb17fa0[_0xb80f('0x3e')][_0xb80f('0x33')]();}else if(_0xb17fa0[_0xb80f('0x3a')]===_0xb80f('0x3b')&&_0xb17fa0['idField']&&_0xb17fa0['customField']){_0x2e3f5f[_0xb80f('0x3f')]['push']({'id':_0xb17fa0[_0xb80f('0x40')],'value':_0xb17fa0[_0xb80f('0x3e')][_0xb80f('0x33')]()});}else if(_0xb17fa0[_0xb80f('0x3a')]===_0xb80f('0x41')&&_0xb17fa0[_0xb80f('0x42')]&&_0xb17fa0[_0xb80f('0x40')]&&_0xb17fa0[_0xb80f('0x3d')]){_0xf68bcb[_0xb17fa0[_0xb80f('0x42')]]&&_0x2e3f5f[_0xb80f('0x3f')]['push']({'id':_0xb17fa0[_0xb80f('0x40')],'value':_0xf68bcb[_0xb17fa0[_0xb80f('0x42')]][_0xb80f('0x33')]()});}else if(_0xb17fa0[_0xb80f('0x3a')]===_0xb80f('0x43')&&_0xb17fa0['Variable']&&_0xb17fa0['Variable']['name']&&_0xb17fa0['idField']&&_0xb17fa0[_0xb80f('0x3d')]){_0xf68bcb[_0xb17fa0[_0xb80f('0x44')][_0xb80f('0x12')][_0xb80f('0x45')]()]&&_0x2e3f5f[_0xb80f('0x3f')][_0xb80f('0x46')]({'id':_0xb17fa0[_0xb80f('0x40')],'value':_0xf68bcb[_0xb17fa0[_0xb80f('0x44')]['name']['toLowerCase']()]['toString']()});}});}return _0x2e3f5f;}exports[_0xb80f('0x47')]=function(_0x5b6786,_0x134663,_0x345608,_0x1de8df,_0x10ee00,_0x58bd4b){var _0x14d315,_0x51e9a0;_0x58bd4b[_0xb80f('0xf')]=intUtil[_0xb80f('0x48')](_0x58bd4b['remoteUri']);_0x58bd4b['serverUrl']=intUtil[_0xb80f('0x48')](_0x58bd4b[_0xb80f('0x49')]);if(_0x10ee00&&_0x10ee00[_0xb80f('0x4a')]){logger[_0xb80f('0xc')](_0xb80f('0x4b'),'Recording\x20is\x20enabled!');_0x134663[_0xb80f('0x4c')]=util['format'](_0xb80f('0x4d'),_0x58bd4b[_0xb80f('0x49')],_0x134663[_0xb80f('0x4e')],md5(_0x134663[_0xb80f('0x4e')]));}else{_0x134663[_0xb80f('0x4c')]='';}headers[_0xb80f('0x4f')]=getAuth(_0x58bd4b);return getUser(_0x58bd4b,_0x1de8df[_0xb80f('0x50')])[_0xb80f('0x17')](function(_0xf3e2a){_0x14d315=_0xf3e2a;logger['info'](_0xb80f('0x51'),_0x14d315['id']);return getEndUser(_0x58bd4b,_0x134663[_0xb80f('0x52')],_0x134663['calleridnum']);})['then'](function(_0x439d84){_0x51e9a0=_0x439d84;logger[_0xb80f('0xc')](_0xb80f('0x53'),_0x51e9a0['id']);return getTicket(_0x58bd4b,_0x14d315,_0x51e9a0,_0x345608,_0x134663);})[_0xb80f('0x17')](function(_0x5ae0bb){if(_0x5ae0bb){logger[_0xb80f('0xc')](_0xb80f('0x54'),_0x5ae0bb['id']);switch(_0x58bd4b['type']){case _0xb80f('0x55'):logger['info'](_0xb80f('0x4b'),_0xb80f('0x56'));return request({'uri':util[_0xb80f('0xe')]('%s/channels/voice/agents/%d/tickets/%d/display.json',_0x58bd4b['remoteUri'],_0x14d315['id'],_0x5ae0bb['id']),'method':_0xb80f('0x57')});case _0xb80f('0x58'):logger[_0xb80f('0xc')](_0xb80f('0x4b'),'Displaying\x20ticket\x20to\x20agent\x20in\x20a\x20new\x20tab...');emit(util[_0xb80f('0xe')](_0xb80f('0x59'),_0x1de8df[_0xb80f('0x12')]),_0xb80f('0x5a'),{'uri':util[_0xb80f('0xe')]('%s/agent/tickets/%s',_0x58bd4b[_0xb80f('0xf')],_0x5ae0bb['id'])});break;default:logger['error']('[QUEUE]',_0xb80f('0x5b'));}}})['catch'](function(_0x1b25aa){logger[_0xb80f('0x5c')](_0xb80f('0x5d'),util[_0xb80f('0x5e')](_0x1b25aa,{'showHidden':!![],'depth':null}));});};exports[_0xb80f('0x5f')]=function(_0x1b26e3,_0x438a05,_0x1f23e5,_0x1a3fe4,_0x5553c9,_0x2bb579,_0x530b1b){var _0x5e1ccb,_0x552438;_0x2bb579['remoteUri']=intUtil[_0xb80f('0x48')](_0x2bb579['remoteUri']);_0x2bb579[_0xb80f('0x49')]=intUtil[_0xb80f('0x48')](_0x2bb579[_0xb80f('0x49')]);if(_0x530b1b&&_0x530b1b['recordingFormat']&&_0x530b1b['recordingFormat']!==_0xb80f('0x60')){logger[_0xb80f('0xc')](_0xb80f('0x61'),_0xb80f('0x62'));_0x438a05[_0xb80f('0x4c')]=util['format']('%s/api/voice/recordings/%s/downloads?type=uniqueid&token=%s',_0x2bb579[_0xb80f('0x49')],_0x438a05[_0xb80f('0x4e')],md5(_0x438a05[_0xb80f('0x4e')]));}headers['Authorization']=getAuth(_0x2bb579);return getUser(_0x2bb579,_0x1a3fe4['email'])[_0xb80f('0x17')](function(_0x207af5){_0x5e1ccb=_0x207af5;logger[_0xb80f('0xc')](_0xb80f('0x51'),_0x5e1ccb['id']);return getEndUser(_0x2bb579,_0x438a05['destcalleridname'],_0x438a05[_0xb80f('0x63')]);})[_0xb80f('0x17')](function(_0x4f350b){_0x552438=_0x4f350b;logger[_0xb80f('0xc')](_0xb80f('0x53'),_0x552438['id']);return getTicket(_0x2bb579,_0x5e1ccb,_0x552438,_0x1f23e5,_0x438a05);})[_0xb80f('0x17')](function(_0x15d913){if(_0x15d913){logger[_0xb80f('0xc')]('The\x20Ticket\x20ID\x20is:',_0x15d913['id']);switch(_0x2bb579[_0xb80f('0x3a')]){case'integrationTab':logger[_0xb80f('0xc')](_0xb80f('0x61'),_0xb80f('0x56'));return request({'uri':util[_0xb80f('0xe')](_0xb80f('0x64'),_0x2bb579[_0xb80f('0xf')],_0x5e1ccb['id'],_0x15d913['id']),'method':'POST'});case _0xb80f('0x58'):logger[_0xb80f('0xc')](_0xb80f('0x61'),_0xb80f('0x65'));emit(util[_0xb80f('0xe')](_0xb80f('0x59'),_0x1a3fe4[_0xb80f('0x12')]),_0xb80f('0x5a'),{'uri':util[_0xb80f('0xe')](_0xb80f('0x66'),_0x2bb579['remoteUri'],_0x15d913['id'])});break;default:logger['error'](_0xb80f('0x61'),_0xb80f('0x5b'));}}})[_0xb80f('0x67')](function(_0x111d55){logger[_0xb80f('0x5c')](_0xb80f('0x68'),util['inspect'](_0x111d55,{'showHidden':!![],'depth':null}));});};exports[_0xb80f('0x69')]=function(_0x5499f2,_0xfb3d8b,_0x2bdbe8,_0x2ec366,_0x5106cc,_0x3a3850){var _0x20c9d8,_0x231f8e;_0x3a3850['remoteUri']=intUtil[_0xb80f('0x48')](_0x3a3850[_0xb80f('0xf')]);_0x3a3850[_0xb80f('0x49')]=intUtil[_0xb80f('0x48')](_0x3a3850[_0xb80f('0x49')]);if(_0x5106cc&&_0x5106cc['monitor_format']){logger[_0xb80f('0xc')](_0xb80f('0x6a'),'Recording\x20is\x20enabled!');_0xfb3d8b[_0xb80f('0x4c')]=util[_0xb80f('0xe')](_0xb80f('0x4d'),_0x3a3850[_0xb80f('0x49')],_0xfb3d8b[_0xb80f('0x4e')],md5(_0xfb3d8b[_0xb80f('0x4e')]));}else{_0xfb3d8b['recordingURL']='';}headers['Authorization']=getAuth(_0x3a3850);return getUser(_0x3a3850)[_0xb80f('0x17')](function(_0x552ccf){_0x20c9d8=_0x552ccf;logger[_0xb80f('0xc')]('The\x20User\x20ID\x20is:',_0x20c9d8['id']);return getEndUser(_0x3a3850,_0xfb3d8b[_0xb80f('0x52')],_0xfb3d8b[_0xb80f('0x6b')]);})['then'](function(_0x5ce875){_0x231f8e=_0x5ce875;logger['info'](_0xb80f('0x53'),_0x231f8e['id']);return getTicket(_0x3a3850,_0x20c9d8,_0x231f8e,_0x2bdbe8,_0xfb3d8b);})[_0xb80f('0x17')](function(_0x2bbf8a){if(_0x2bbf8a){logger[_0xb80f('0xc')]('The\x20Ticket\x20ID\x20is:',_0x2bbf8a['id']);}})[_0xb80f('0x67')](function(_0x45ffc6){logger[_0xb80f('0x5c')]('[ABANDONED]\x20Error\x20running\x20Zendesk\x20integration',util['inspect'](_0x45ffc6,{'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 d8c0336..9a371e4 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 _0x5cc5=['then','seconds','catch','error','stack','info','Search\x20user','GET','format','https://www.zohoapis.%s/crm/v2/users','ActiveUsers','Zoho-oauthtoken\x20','users','isArrayLikeObject','findIndex','email','Agent\x20found!','Using\x20the\x20admin\x20account!','profile','Administrator','user','The\x20failing\x20result\x20is','stringify','Unable\x20to\x20retrieve\x20zoho\x20account\x20users:\x20','data','enduserType','POST','https://www.zohoapis.','/crm/v2/','moduleCreate','role','first_name','last_name','code','details','startCase','Error:\x20','log','CREATE\x20ERROR','contact_lead','Contacts','uri','/crm/v2/Leads/search?criteria=((Phone:equals:','contact','/crm/v2/Contacts/search?criteria=((Phone:equals:','nothing','lead','Leads','Creating\x20new\x20call...','administrator','Subject','Subjects','getString','Descriptions','Who_Id','Full_Name','First_Name','Last_Name','talktime','Call_Duration','utc','mm:ss','answertime','endtime','YYYY-MM-DDTHH:mm:ss','starttime','lastevent','called','connect','Call_Result','Answered','rejected','abandoned','Abandoned','outbound','agentcalledAt','Call_Type','Fields','/crm/v2/Calls','SUCCESS','Call\x20created!','err','queue','host','stripTrailingSlash','serverUrl','monitor_format','[QUEUE]','Recording\x20is\x20enabled!','recordingURL','/api/voice/recordings/','uniqueid','/downloads?type=uniqueid&token=','zoho.eu','com','calleridname','calleridnum','The\x20Call\x20ID\x20is:','Displaying\x20call\x20to\x20agent\x20in\x20a\x20new\x20tab...','user:%s','trigger:browser:url','/crm/EntityInfo.do?module=Calls&id=','recordingFormat','none','[OUTBOUND]','The\x20User\x20ID\x20is:','destcalleridnum','Outbound','https://crm.','Inbound','[ABANDONED]','lodash','request-promise','md5','util','./util','moment','ioredis','bluebird','../../../../config/logger','zoho','redis','defaults','localhost','socket.io-emitter','debug','[HTTP]','string','idField','content','type','variable','variableName','toString','customVariable','Variable','name','toLowerCase','indexOf','split','isNil','access_token','isBefore','expires_in','zone','https://accounts.zoho.com','https://accounts.zoho.com.au','https://accounts.zoho.eu','https://accounts.zoho.in','https://accounts.zoho.com.cn','/oauth/v2/token','refreshToken','clientId','refresh_token'];(function(_0x35d59c,_0x341ef9){var _0x18cd27=function(_0x16a9c4){while(--_0x16a9c4){_0x35d59c['push'](_0x35d59c['shift']());}};_0x18cd27(++_0x341ef9);}(_0x5cc5,0x6f));var _0x55cc=function(_0x4cbf20,_0x1bfa66){_0x4cbf20=_0x4cbf20-0x0;var _0x582ae4=_0x5cc5[_0x4cbf20];return _0x582ae4;};'use strict';var _=require(_0x55cc('0x0'));var rp=require(_0x55cc('0x1'));var md5=require(_0x55cc('0x2'));var util=require(_0x55cc('0x3'));var intUtil=require(_0x55cc('0x4'));var moment=require(_0x55cc('0x5'));var Redis=require(_0x55cc('0x6'));var BPromise=require(_0x55cc('0x7'));var config=require('../../../../config/environment');var logger=require(_0x55cc('0x8'))(_0x55cc('0x9'));config[_0x55cc('0xa')]=_[_0x55cc('0xb')](config[_0x55cc('0xa')],{'host':_0x55cc('0xc'),'port':0x18eb});var io=require(_0x55cc('0xd'))(new Redis(config[_0x55cc('0xa')]));function emit(_0x1213aa,_0x1b34f6,_0x1dafc9){io['to'](_0x1213aa)['emit'](_0x1b34f6,_0x1dafc9);}function request(_0x5d87e5){logger[_0x55cc('0xe')](_0x55cc('0xf'),JSON['stringify'](_0x5d87e5));return rp(_0x5d87e5);}function getCustomFields(_0x4853d0,_0x4badd5){var _0x38ab81={};if(_0x4853d0['length']>0x0){_['forEach'](_0x4853d0,function(_0x5b1464){if(_0x5b1464['type']===_0x55cc('0x10')&&_0x5b1464[_0x55cc('0x11')]){_0x38ab81[_0x5b1464['idField']]=_0x5b1464[_0x55cc('0x12')]['toString']();}else if(_0x5b1464[_0x55cc('0x13')]===_0x55cc('0x14')&&_0x5b1464['variableName']&&_0x5b1464[_0x55cc('0x11')]&&_0x4badd5[_0x5b1464[_0x55cc('0x15')]]){_0x38ab81[_0x5b1464[_0x55cc('0x11')]]=_0x4badd5[_0x5b1464[_0x55cc('0x15')]][_0x55cc('0x16')]();}else if(_0x5b1464[_0x55cc('0x13')]===_0x55cc('0x17')&&_0x5b1464['Variable']&&_0x5b1464[_0x55cc('0x18')][_0x55cc('0x19')]&&_0x5b1464[_0x55cc('0x11')]&&_0x4badd5[_0x5b1464[_0x55cc('0x18')][_0x55cc('0x19')][_0x55cc('0x1a')]()]){_0x38ab81[_0x5b1464[_0x55cc('0x11')]]=_0x4badd5[_0x5b1464[_0x55cc('0x18')][_0x55cc('0x19')]['toLowerCase']()][_0x55cc('0x16')]();}});}return _0x38ab81;}function getName(_0x33575a){if(_0x33575a[_0x55cc('0x1b')]('\x20')>0x0){var _0x4ba4dc=_0x33575a[_0x55cc('0x1c')](/ (.+)/);if(_0x4ba4dc[0x1]){return _0x4ba4dc;}}return[_0x33575a,_0x33575a];}var accountsTokens={};function getAccessToken(_0x246dfb){return new Promise(function(_0x35438d,_0xab2dee){if(!_[_0x55cc('0x1d')](accountsTokens[_0x246dfb['id']])&&!_[_0x55cc('0x1d')](accountsTokens[_0x246dfb['id']][_0x55cc('0x1e')])){if(moment()[_0x55cc('0x1f')](accountsTokens[_0x246dfb['id']][_0x55cc('0x20')])){_0x35438d(accountsTokens[_0x246dfb['id']][_0x55cc('0x1e')]);}}var _0x51a152;switch(_0x246dfb[_0x55cc('0x21')]){case'US':_0x51a152=_0x55cc('0x22');break;case'AU':_0x51a152=_0x55cc('0x23');break;case'EU':_0x51a152=_0x55cc('0x24');break;case'IN':_0x51a152=_0x55cc('0x25');break;case'CN':_0x51a152=_0x55cc('0x26');break;default:_0x51a152=_0x55cc('0x24');break;}var _0x12fc45={'method':'POST','uri':_0x51a152+_0x55cc('0x27'),'qs':{'refresh_token':_0x246dfb[_0x55cc('0x28')],'client_id':_0x246dfb[_0x55cc('0x29')],'client_secret':_0x246dfb['clientSecret'],'grant_type':_0x55cc('0x2a')},'json':!![]};return rp(_0x12fc45)[_0x55cc('0x2b')](function(_0x1c51be){accountsTokens[_0x246dfb['id']]={'access_token':_0x1c51be[_0x55cc('0x1e')],'expires_in':moment()['add'](_0x1c51be[_0x55cc('0x20')],_0x55cc('0x2c'))};_0x35438d(_0x1c51be[_0x55cc('0x1e')]);})[_0x55cc('0x2d')](function(_0x17b297){logger[_0x55cc('0x2e')]('Failing\x20creating\x20the\x20access_token',_0x17b297[_0x55cc('0x2f')]);_0xab2dee(_0x17b297);});});}function getUser(_0x44abc0,_0x162ecf,_0x2734f0,_0x527c4b){logger[_0x55cc('0x30')](_0x55cc('0x31'));return request({'method':_0x55cc('0x32'),'uri':util[_0x55cc('0x33')](_0x55cc('0x34'),_0x162ecf),'qs':{'type':_0x55cc('0x35')},'headers':{'Authorization':_0x55cc('0x36')+_0x44abc0},'json':!![]})[_0x55cc('0x2b')](function(_0x34d224){if(_0x34d224[_0x55cc('0x37')]){var _0x3aebe5=-0x1;if(_[_0x55cc('0x38')](_0x34d224[_0x55cc('0x37')])){if(!_[_0x55cc('0x1d')](_0x527c4b)){_0x3aebe5=_[_0x55cc('0x39')](_0x34d224[_0x55cc('0x37')],function(_0x43fa8b){return _0x43fa8b[_0x55cc('0x3a')]===_0x527c4b;});}if(_0x3aebe5>=0x0){logger[_0x55cc('0x30')](_0x55cc('0x3b'));}else{logger[_0x55cc('0x30')](_0x55cc('0x3c'));_0x3aebe5=_['findIndex'](_0x34d224[_0x55cc('0x37')],function(_0x48b66e){return _0x48b66e[_0x55cc('0x3d')][_0x55cc('0x19')]===_0x55cc('0x3e');});}return _0x34d224[_0x55cc('0x37')][_0x3aebe5];}else{if(_0x34d224[_0x55cc('0x3f')]['profile']['name']==='Administrator'){logger[_0x55cc('0x30')](_0x55cc('0x3c'));user=_0x34d224[_0x55cc('0x3f')];return user;}else{logger[_0x55cc('0x2e')](_0x55cc('0x40'),JSON[_0x55cc('0x41')](_0x34d224));throw new Error(_0x55cc('0x42')+JSON[_0x55cc('0x41')](_0x34d224));}}}else{logger[_0x55cc('0x2e')](_0x55cc('0x40'),JSON[_0x55cc('0x41')](_0x34d224));throw new Error(_0x55cc('0x42')+JSON[_0x55cc('0x41')](_0x34d224));}})[_0x55cc('0x2d')](function(_0x3de08e){console[_0x55cc('0x2e')](_0x3de08e);});}function getZohoUser(_0x58038e,_0x8fae6e){return new BPromise(function(_0x4085ed,_0x1d740b){request(_0x58038e)[_0x55cc('0x2b')](function(_0x564816){var _0x6bfe67=null;if(_0x564816){_0x6bfe67=_0x564816[_0x55cc('0x43')][0x0];_0x6bfe67[_0x55cc('0x44')]=_0x8fae6e;}_0x4085ed(_0x6bfe67);})['catch'](function(_0x137265){_0x1d740b(_0x137265);});});}function createEndUser(_0x4d9c76,_0x770b82,_0x195d44,_0x2f306e,_0x309822,_0x12fef1){var _0x195d44=getName(_0x195d44);return request({'method':_0x55cc('0x45'),'uri':_0x55cc('0x46')+_0x770b82+_0x55cc('0x47')+_['startCase'](_0x12fef1[_0x55cc('0x48')])+'s','body':{'data':[{'Last_Name':_0x195d44[0x1],'First_Name':_0x195d44[0x0],'Phone':_0x2f306e,'Owner':{'name':!_[_0x55cc('0x1d')](_0x309822[_0x55cc('0x49')][_0x55cc('0x19')])?_0x309822[_0x55cc('0x49')][_0x55cc('0x19')]:!_[_0x55cc('0x1d')](_0x309822[_0x55cc('0x4a')])?_0x309822[_0x55cc('0x4a')]+'\x20'+_0x309822[_0x55cc('0x4b')]:_0x309822[_0x55cc('0x4b')],'id':_0x309822['id']}}]},'headers':{'Authorization':_0x55cc('0x36')+_0x4d9c76},'json':!![]})['then'](function(_0x38ef21){if(_0x38ef21&&_0x38ef21[_0x55cc('0x43')][0x0][_0x55cc('0x4c')]==='SUCCESS'){var _0x331f44=_0x38ef21[_0x55cc('0x43')][0x0][_0x55cc('0x4d')];_0x331f44['enduserType']=_[_0x55cc('0x4e')](_0x12fef1[_0x55cc('0x48')])+'s';return _0x331f44;}logger[_0x55cc('0x2e')](_0x55cc('0x40'),JSON[_0x55cc('0x41')](data));throw new Error(_0x55cc('0x4f')+JSON['stringify'](data));})['catch'](function(_0x2fdc8b){console[_0x55cc('0x50')](_0x55cc('0x51'),_0x2fdc8b);});}function getEndUser(_0x5655e0,_0x378f00,_0x127fae,_0x4eb80b,_0x91129b,_0x262dca,_0x207917){var _0x440cbd={'method':_0x55cc('0x32'),'uri':'','headers':{'Authorization':_0x55cc('0x36')+_0x5655e0},'json':!![]};switch(_0x207917['moduleSearch']){case _0x55cc('0x52'):_0x440cbd['uri']=_0x55cc('0x46')+_0x378f00+'/crm/v2/Contacts/search?criteria=((Phone:equals:'+_0x91129b+'))';return getZohoUser(_0x440cbd,_0x55cc('0x53'))[_0x55cc('0x2b')](function(_0x304733){if(_0x304733)return _0x304733;_0x440cbd[_0x55cc('0x54')]='https://www.zohoapis.'+_0x378f00+_0x55cc('0x55')+_0x91129b+'))';return getZohoUser(_0x440cbd,'Leads')['then'](function(_0x20111b){if(_0x20111b)return _0x20111b;if(_0x207917[_0x55cc('0x48')]!='nothing'){return createEndUser(_0x5655e0,_0x378f00,_0x4eb80b,_0x91129b,_0x262dca,_0x207917);}else{return{};}});});break;case _0x55cc('0x56'):_0x440cbd[_0x55cc('0x54')]='https://www.zohoapis.'+_0x378f00+_0x55cc('0x57')+_0x91129b+'))';return getZohoUser(_0x440cbd,_0x55cc('0x53'))[_0x55cc('0x2b')](function(_0x2778de){if(_0x2778de)return _0x2778de;if(_0x207917[_0x55cc('0x48')]!=_0x55cc('0x58')){return createEndUser(_0x5655e0,_0x378f00,_0x4eb80b,_0x91129b,_0x262dca,_0x207917);}else{return{};}});break;case _0x55cc('0x59'):_0x440cbd[_0x55cc('0x54')]='https://www.zohoapis.'+_0x378f00+_0x55cc('0x55')+_0x91129b+'))';return getZohoUser(_0x440cbd,_0x55cc('0x5a'))['then'](function(_0x566667){if(_0x566667)return _0x566667;if(_0x207917[_0x55cc('0x48')]!=_0x55cc('0x58')){return createEndUser(_0x5655e0,_0x378f00,_0x4eb80b,_0x91129b,_0x262dca,_0x207917);}else{return{};}});break;}}function getCall(_0x3074ed,_0x400ac2,_0x441d5c,_0x10ae90,_0x341615,_0x23a8fb,_0x3cb87a,_0x40b65b){logger[_0x55cc('0x30')](_0x55cc('0x5b'));var _0x1a250d={};_0x1a250d['Owner']={'name':!_[_0x55cc('0x1d')](_0x10ae90[_0x55cc('0x49')][_0x55cc('0x19')])&&!_[_0x55cc('0x1d')](_0x10ae90['profile'][_0x55cc('0x19')])&&_0x10ae90[_0x55cc('0x3d')][_0x55cc('0x19')]===_0x55cc('0x5c')?_0x10ae90['role'][_0x55cc('0x19')]:!_['isNil'](_0x10ae90['first_name'])?_0x10ae90[_0x55cc('0x4a')]+'\x20'+_0x10ae90[_0x55cc('0x4b')]:_0x10ae90[_0x55cc('0x4b')],'id':_0x10ae90['id']};_0x1a250d[_0x55cc('0x5d')]=intUtil['getString'](_0x23a8fb[_0x55cc('0x5e')],_0x3cb87a,'\x20');_0x1a250d['Description']=intUtil[_0x55cc('0x5f')](_0x23a8fb[_0x55cc('0x60')],_0x3cb87a,'\x0a');if(_0x341615[_0x55cc('0x44')]===_0x55cc('0x53')){_0x1a250d[_0x55cc('0x61')]={'name':!_['isNil'](_0x341615['Full_Name'])?_0x341615[_0x55cc('0x62')]:!_[_0x55cc('0x1d')](_0x341615[_0x55cc('0x63')])?_0x341615['First_Name']+'\x20'+_0x341615[_0x55cc('0x64')]:_0x341615[_0x55cc('0x64')],'id':_0x341615['id']};}if(_0x341615[_0x55cc('0x44')]===_0x55cc('0x5a')){_0x1a250d['What_Id']={'name':!_['isNil'](_0x341615[_0x55cc('0x62')])?_0x341615[_0x55cc('0x62')]:!_[_0x55cc('0x1d')](_0x341615['First_Name'])?_0x341615[_0x55cc('0x63')]+'\x20'+_0x341615[_0x55cc('0x64')]:_0x341615[_0x55cc('0x64')],'id':_0x341615['id']};_0x1a250d['$se_module']=_[_0x55cc('0x4e')](_0x341615[_0x55cc('0x44')]);}if(_0x3cb87a[_0x55cc('0x65')]){_0x1a250d[_0x55cc('0x66')]=moment[_0x55cc('0x67')](parseInt(_0x3cb87a[_0x55cc('0x65')])*0x3e8)[_0x55cc('0x33')](_0x55cc('0x68'));}else if(_0x3cb87a[_0x55cc('0x69')]&&_0x3cb87a['endtime']){_0x1a250d[_0x55cc('0x66')]=moment[_0x55cc('0x67')](moment(_0x3cb87a[_0x55cc('0x6a')],_0x55cc('0x6b'))['diff'](moment(_0x3cb87a[_0x55cc('0x6c')],_0x55cc('0x6b'))))[_0x55cc('0x33')]('mm:ss');}switch(_0x3cb87a[_0x55cc('0x6d')]){case _0x55cc('0x6e'):_0x1a250d['Call_Result']='Called';break;case'complete':case _0x55cc('0x6f'):_0x1a250d[_0x55cc('0x70')]=_0x55cc('0x71');break;case _0x55cc('0x72'):_0x1a250d[_0x55cc('0x70')]='Rejected';break;case _0x55cc('0x73'):_0x1a250d['Call_Result']=_0x55cc('0x74');break;default:}_0x1a250d['Call_Start_Time']=(_0x40b65b===_0x55cc('0x75')?moment(_0x3cb87a['starttime'])[_0x55cc('0x33')](_0x55cc('0x6b')):moment(_0x3cb87a[_0x55cc('0x76')])[_0x55cc('0x33')](_0x55cc('0x6b')))||moment()['format'](_0x55cc('0x6b'));_0x1a250d[_0x55cc('0x77')]=_0x40b65b||'Inbound';_0x1a250d=_['merge'](_0x1a250d,getCustomFields(_0x23a8fb[_0x55cc('0x78')],_0x3cb87a));return request({'method':_0x55cc('0x45'),'uri':'https://www.zohoapis.'+_0x400ac2+_0x55cc('0x79'),'headers':{'Authorization':_0x55cc('0x36')+_0x3074ed},'body':{'data':[_0x1a250d]},'json':!![]})[_0x55cc('0x2b')](function(_0x2c47fa){if(_0x2c47fa&&_0x2c47fa[_0x55cc('0x43')][0x0]['code']===_0x55cc('0x7a')){logger[_0x55cc('0x30')](_0x55cc('0x7b'));return{'id':_0x2c47fa[_0x55cc('0x43')][0x0][_0x55cc('0x4d')]['id']};}})[_0x55cc('0x2d')](function(_0x381064){logger['info'](_0x55cc('0x7c'),_0x381064[_0x55cc('0x2f')]);console[_0x55cc('0x50')](_0x55cc('0x7c'),_0x381064);});}exports[_0x55cc('0x7d')]=function(_0x585ffb,_0x4d6d05,_0x49a18f,_0x5645e7,_0x551c33,_0x1e5496){var _0x275ddc,_0xe4b3ae,_0x496613;_0x1e5496[_0x55cc('0x7e')]=intUtil[_0x55cc('0x7f')](_0x1e5496['host']);_0x1e5496['serverUrl']=intUtil[_0x55cc('0x7f')](_0x1e5496[_0x55cc('0x80')]);if(_0x551c33&&_0x551c33[_0x55cc('0x81')]){logger[_0x55cc('0x30')](_0x55cc('0x82'),_0x55cc('0x83'));_0x4d6d05[_0x55cc('0x84')]=_0x1e5496[_0x55cc('0x80')]+_0x55cc('0x85')+_0x4d6d05[_0x55cc('0x86')]+_0x55cc('0x87')+md5(_0x4d6d05[_0x55cc('0x86')]);}else{_0x4d6d05[_0x55cc('0x84')]='';}var _0x476807=_0x1e5496[_0x55cc('0x7e')]===_0x55cc('0x88')?'eu':_0x55cc('0x89');return getAccessToken(_0x1e5496)[_0x55cc('0x2b')](function(_0x3a0475){_0x496613=_0x3a0475;return getUser(_0x496613,_0x476807,_0x1e5496,_0x5645e7[_0x55cc('0x3a')]);})[_0x55cc('0x2b')](function(_0x7603bb){_0x275ddc=_0x7603bb;logger['info']('The\x20User\x20ID\x20is:',_0x275ddc['id']);return getEndUser(_0x496613,_0x476807,_0x1e5496,_0x4d6d05[_0x55cc('0x8a')],_0x4d6d05[_0x55cc('0x8b')],_0x275ddc,_0x49a18f);})[_0x55cc('0x2b')](function(_0x4bf407){_0xe4b3ae=_0x4bf407;return getCall(_0x496613,_0x476807,_0x1e5496,_0x275ddc,_0xe4b3ae,_0x49a18f,_0x4d6d05,'Inbound');})[_0x55cc('0x2b')](function(_0x2f1cb5){if(_0x2f1cb5){logger['info'](_0x55cc('0x8c'),_0x2f1cb5['id']);logger[_0x55cc('0x30')](_0x55cc('0x82'),_0x55cc('0x8d'));emit(util[_0x55cc('0x33')](_0x55cc('0x8e'),_0x5645e7['name']),_0x55cc('0x8f'),{'uri':'https://crm.'+_0x1e5496[_0x55cc('0x7e')]+_0x55cc('0x90')+_0x2f1cb5['id']});}})['catch'](function(_0xe6476e){logger['error']('[QUEUE]',JSON[_0x55cc('0x41')](_0xe6476e));});};exports[_0x55cc('0x75')]=function(_0x43ae54,_0x2604fb,_0xd2c5d0,_0x132f0b,_0x20ca3d,_0xae4c54,_0x1f1912){var _0xf448c6,_0x470acf,_0x4c7bc2;_0xae4c54[_0x55cc('0x7e')]=intUtil[_0x55cc('0x7f')](_0xae4c54[_0x55cc('0x7e')]);_0xae4c54[_0x55cc('0x80')]=intUtil[_0x55cc('0x7f')](_0xae4c54[_0x55cc('0x80')]);if(_0x1f1912&&_0x1f1912[_0x55cc('0x91')]&&_0x1f1912[_0x55cc('0x91')]!==_0x55cc('0x92')){logger[_0x55cc('0x30')](_0x55cc('0x93'),'Recording\x20is\x20enabled!');_0x2604fb['recordingURL']=_0xae4c54[_0x55cc('0x80')]+_0x55cc('0x85')+_0x2604fb['uniqueid']+_0x55cc('0x87')+md5(_0x2604fb[_0x55cc('0x86')]);}var _0xcc34a4=_0xae4c54[_0x55cc('0x7e')]==='zoho.eu'?'eu':_0x55cc('0x89');return getAccessToken(_0xae4c54)[_0x55cc('0x2b')](function(_0x484b14){_0x4c7bc2=_0x484b14;return getUser(_0x4c7bc2,_0xcc34a4,_0xae4c54,_0x132f0b['email']);})[_0x55cc('0x2b')](function(_0x2baafa){_0xf448c6=_0x2baafa;logger[_0x55cc('0x30')](_0x55cc('0x94'),_0xf448c6['id']);return getEndUser(_0x4c7bc2,_0xcc34a4,_0xae4c54,_0x2604fb['destcalleridname'],_0x2604fb[_0x55cc('0x95')],_0xf448c6,_0xd2c5d0);})['then'](function(_0x1e89db){_0x470acf=_0x1e89db;return getCall(_0x4c7bc2,_0xcc34a4,_0xae4c54,_0xf448c6,_0x470acf,_0xd2c5d0,_0x2604fb,_0x55cc('0x96'));})[_0x55cc('0x2b')](function(_0x349ce7){if(_0x349ce7){logger[_0x55cc('0x30')]('The\x20Call\x20ID\x20is:',_0x349ce7['id']);logger[_0x55cc('0x30')](_0x55cc('0x93'),_0x55cc('0x8d'));emit(util[_0x55cc('0x33')](_0x55cc('0x8e'),_0x132f0b[_0x55cc('0x19')]),_0x55cc('0x8f'),{'uri':_0x55cc('0x97')+_0xae4c54[_0x55cc('0x7e')]+_0x55cc('0x90')+_0x349ce7['id']});}})[_0x55cc('0x2d')](function(_0x458f6e){logger[_0x55cc('0x2e')]('[OUTBOUND]',JSON['stringify'](_0x458f6e));});};exports['abandoned']=function(_0x18283a,_0x201ca7,_0x500234,_0x281992,_0x310617,_0x35b938){var _0x35ccc4,_0x51ab95,_0x16cb21;_0x35b938['host']=intUtil[_0x55cc('0x7f')](_0x35b938[_0x55cc('0x7e')]);_0x35b938[_0x55cc('0x80')]=intUtil[_0x55cc('0x7f')](_0x35b938[_0x55cc('0x80')]);if(_0x310617&&_0x310617['monitor_format']){logger[_0x55cc('0x30')]('[ABANDONED]',_0x55cc('0x83'));_0x201ca7['recordingURL']=_0x35b938[_0x55cc('0x80')]+_0x55cc('0x85')+_0x201ca7[_0x55cc('0x86')]+_0x55cc('0x87')+md5(_0x201ca7[_0x55cc('0x86')]);}else{_0x201ca7[_0x55cc('0x84')]='';}var _0xc5b07a=_0x35b938[_0x55cc('0x7e')]===_0x55cc('0x88')?'eu':'com';return getAccessToken(_0x35b938)[_0x55cc('0x2b')](function(_0x343b30){_0x16cb21=_0x343b30;return getUser(_0x16cb21,_0xc5b07a,_0x35b938);})[_0x55cc('0x2b')](function(_0x323ab2){_0x35ccc4=_0x323ab2;logger[_0x55cc('0x30')](_0x55cc('0x94'),_0x35ccc4['id']);return getEndUser(_0x16cb21,_0xc5b07a,_0x35b938,_0x201ca7[_0x55cc('0x8a')],_0x201ca7[_0x55cc('0x8b')],_0x35ccc4,_0x500234);})[_0x55cc('0x2b')](function(_0x37d633){_0x51ab95=_0x37d633;return getCall(_0x16cb21,_0xc5b07a,_0x35b938,_0x35ccc4,_0x51ab95,_0x500234,_0x201ca7,_0x55cc('0x98'));})['then'](function(_0x51b99b){if(_0x51b99b){logger[_0x55cc('0x30')](_0x55cc('0x8c'),_0x51b99b['id']);}})[_0x55cc('0x2d')](function(_0x107c56){logger[_0x55cc('0x2e')](_0x55cc('0x99'),JSON[_0x55cc('0x41')](_0x107c56));});};
\ No newline at end of file
+var _0xbfd2=['user:%s','trigger:browser:url','https://crm.','/crm/EntityInfo.do?module=Calls&id=','stripTrailingSlash','recordingFormat','[OUTBOUND]','uniqueid','zoho.eu','com','destcalleridname','destcalleridnum','/api/voice/recordings/','/downloads?type=uniqueid&token=','lodash','util','moment','ioredis','../../../../config/environment','../../../../config/logger','zoho','redis','defaults','localhost','emit','[HTTP]','stringify','forEach','idField','content','toString','type','variable','variableName','customVariable','Variable','name','toLowerCase','indexOf','split','isNil','access_token','expires_in','zone','https://accounts.zoho.com','https://accounts.zoho.com.au','https://accounts.zoho.eu','https://accounts.zoho.com.cn','POST','/oauth/v2/token','refreshToken','clientId','clientSecret','refresh_token','then','add','seconds','catch','error','stack','info','Search\x20user','GET','format','ActiveUsers','Zoho-oauthtoken\x20','users','isArrayLikeObject','findIndex','Using\x20the\x20admin\x20account!','user','profile','Administrator','Unable\x20to\x20retrieve\x20zoho\x20account\x20users:\x20','data','enduserType','https://www.zohoapis.','/crm/v2/','startCase','role','first_name','last_name','SUCCESS','details','moduleCreate','Error:\x20','log','CREATE\x20ERROR','moduleSearch','contact_lead','uri','Contacts','/crm/v2/Leads/search?criteria=((Phone:equals:','Leads','contact','/crm/v2/Contacts/search?criteria=((Phone:equals:','nothing','lead','Creating\x20new\x20call...','Owner','administrator','getString','Subjects','Who_Id','Full_Name','Last_Name','What_Id','First_Name','talktime','Call_Duration','utc','mm:ss','answertime','endtime','YYYY-MM-DDTHH:mm:ss','diff','lastevent','called','Call_Result','Called','complete','connect','Answered','rejected','Rejected','abandoned','Abandoned','outbound','starttime','agentcalledAt','Call_Type','Inbound','merge','/crm/v2/Calls','err','queue','serverUrl','monitor_format','[QUEUE]','Recording\x20is\x20enabled!','recordingURL','host','email','The\x20User\x20ID\x20is:','calleridname','calleridnum','The\x20Call\x20ID\x20is:','Displaying\x20call\x20to\x20agent\x20in\x20a\x20new\x20tab...'];(function(_0x410e31,_0x196cf5){var _0x4082ba=function(_0x57d0ff){while(--_0x57d0ff){_0x410e31['push'](_0x410e31['shift']());}};_0x4082ba(++_0x196cf5);}(_0xbfd2,0x1ca));var _0x2bfd=function(_0x23542f,_0x34055b){_0x23542f=_0x23542f-0x0;var _0x3585a9=_0xbfd2[_0x23542f];return _0x3585a9;};'use strict';var _=require(_0x2bfd('0x0'));var rp=require('request-promise');var md5=require('md5');var util=require(_0x2bfd('0x1'));var intUtil=require('./util');var moment=require(_0x2bfd('0x2'));var Redis=require(_0x2bfd('0x3'));var BPromise=require('bluebird');var config=require(_0x2bfd('0x4'));var logger=require(_0x2bfd('0x5'))(_0x2bfd('0x6'));config[_0x2bfd('0x7')]=_[_0x2bfd('0x8')](config[_0x2bfd('0x7')],{'host':_0x2bfd('0x9'),'port':0x18eb});var io=require('socket.io-emitter')(new Redis(config[_0x2bfd('0x7')]));function emit(_0x1ed470,_0x1b2705,_0x54f141){io['to'](_0x1ed470)[_0x2bfd('0xa')](_0x1b2705,_0x54f141);}function request(_0x4af857){logger['debug'](_0x2bfd('0xb'),JSON[_0x2bfd('0xc')](_0x4af857));return rp(_0x4af857);}function getCustomFields(_0x59e0c7,_0x346b51){var _0x51fa06={};if(_0x59e0c7['length']>0x0){_[_0x2bfd('0xd')](_0x59e0c7,function(_0xe1dd93){if(_0xe1dd93['type']==='string'&&_0xe1dd93[_0x2bfd('0xe')]){_0x51fa06[_0xe1dd93['idField']]=_0xe1dd93[_0x2bfd('0xf')][_0x2bfd('0x10')]();}else if(_0xe1dd93[_0x2bfd('0x11')]===_0x2bfd('0x12')&&_0xe1dd93[_0x2bfd('0x13')]&&_0xe1dd93['idField']&&_0x346b51[_0xe1dd93[_0x2bfd('0x13')]]){_0x51fa06[_0xe1dd93['idField']]=_0x346b51[_0xe1dd93[_0x2bfd('0x13')]]['toString']();}else if(_0xe1dd93[_0x2bfd('0x11')]===_0x2bfd('0x14')&&_0xe1dd93['Variable']&&_0xe1dd93[_0x2bfd('0x15')][_0x2bfd('0x16')]&&_0xe1dd93[_0x2bfd('0xe')]&&_0x346b51[_0xe1dd93[_0x2bfd('0x15')][_0x2bfd('0x16')][_0x2bfd('0x17')]()]){_0x51fa06[_0xe1dd93['idField']]=_0x346b51[_0xe1dd93[_0x2bfd('0x15')][_0x2bfd('0x16')][_0x2bfd('0x17')]()]['toString']();}});}return _0x51fa06;}function getName(_0x19ffcf){if(_0x19ffcf[_0x2bfd('0x18')]('\x20')>0x0){var _0x3c352b=_0x19ffcf[_0x2bfd('0x19')](/ (.+)/);if(_0x3c352b[0x1]){return _0x3c352b;}}return[_0x19ffcf,_0x19ffcf];}var accountsTokens={};function getAccessToken(_0x518217){return new Promise(function(_0x153943,_0xab1393){if(!_[_0x2bfd('0x1a')](accountsTokens[_0x518217['id']])&&!_[_0x2bfd('0x1a')](accountsTokens[_0x518217['id']][_0x2bfd('0x1b')])){if(moment()['isBefore'](accountsTokens[_0x518217['id']][_0x2bfd('0x1c')])){_0x153943(accountsTokens[_0x518217['id']]['access_token']);}}var _0x3d0729;switch(_0x518217[_0x2bfd('0x1d')]){case'US':_0x3d0729=_0x2bfd('0x1e');break;case'AU':_0x3d0729=_0x2bfd('0x1f');break;case'EU':_0x3d0729=_0x2bfd('0x20');break;case'IN':_0x3d0729='https://accounts.zoho.in';break;case'CN':_0x3d0729=_0x2bfd('0x21');break;default:_0x3d0729='https://accounts.zoho.eu';break;}var _0x309d17={'method':_0x2bfd('0x22'),'uri':_0x3d0729+_0x2bfd('0x23'),'qs':{'refresh_token':_0x518217[_0x2bfd('0x24')],'client_id':_0x518217[_0x2bfd('0x25')],'client_secret':_0x518217[_0x2bfd('0x26')],'grant_type':_0x2bfd('0x27')},'json':!![]};return rp(_0x309d17)[_0x2bfd('0x28')](function(_0x56b454){accountsTokens[_0x518217['id']]={'access_token':_0x56b454[_0x2bfd('0x1b')],'expires_in':moment()[_0x2bfd('0x29')](_0x56b454[_0x2bfd('0x1c')],_0x2bfd('0x2a'))};_0x153943(_0x56b454[_0x2bfd('0x1b')]);})[_0x2bfd('0x2b')](function(_0x698be8){logger[_0x2bfd('0x2c')]('Failing\x20creating\x20the\x20access_token',_0x698be8[_0x2bfd('0x2d')]);_0xab1393(_0x698be8);});});}function getUser(_0x3356c1,_0x7f7bd4,_0x58beb4,_0xe84c10){logger[_0x2bfd('0x2e')](_0x2bfd('0x2f'));return request({'method':_0x2bfd('0x30'),'uri':util[_0x2bfd('0x31')]('https://www.zohoapis.%s/crm/v2/users',_0x7f7bd4),'qs':{'type':_0x2bfd('0x32')},'headers':{'Authorization':_0x2bfd('0x33')+_0x3356c1},'json':!![]})[_0x2bfd('0x28')](function(_0x383977){if(_0x383977[_0x2bfd('0x34')]){var _0x5df282=-0x1;if(_[_0x2bfd('0x35')](_0x383977['users'])){if(!_[_0x2bfd('0x1a')](_0xe84c10)){_0x5df282=_[_0x2bfd('0x36')](_0x383977[_0x2bfd('0x34')],function(_0x59722d){return _0x59722d['email']===_0xe84c10;});}if(_0x5df282>=0x0){logger[_0x2bfd('0x2e')]('Agent\x20found!');}else{logger[_0x2bfd('0x2e')](_0x2bfd('0x37'));_0x5df282=_[_0x2bfd('0x36')](_0x383977[_0x2bfd('0x34')],function(_0x2ab379){return _0x2ab379['profile']['name']==='Administrator';});}return _0x383977[_0x2bfd('0x34')][_0x5df282];}else{if(_0x383977[_0x2bfd('0x38')][_0x2bfd('0x39')][_0x2bfd('0x16')]===_0x2bfd('0x3a')){logger[_0x2bfd('0x2e')](_0x2bfd('0x37'));user=_0x383977[_0x2bfd('0x38')];return user;}else{logger['error']('The\x20failing\x20result\x20is',JSON['stringify'](_0x383977));throw new Error('Unable\x20to\x20retrieve\x20zoho\x20account\x20users:\x20'+JSON['stringify'](_0x383977));}}}else{logger[_0x2bfd('0x2c')]('The\x20failing\x20result\x20is',JSON['stringify'](_0x383977));throw new Error(_0x2bfd('0x3b')+JSON[_0x2bfd('0xc')](_0x383977));}})[_0x2bfd('0x2b')](function(_0x2c4c70){console[_0x2bfd('0x2c')](_0x2c4c70);});}function getZohoUser(_0x3e7ad1,_0x361ec6){return new BPromise(function(_0x4cf152,_0x4a7925){request(_0x3e7ad1)[_0x2bfd('0x28')](function(_0x1f0756){var _0x43f4e6=null;if(_0x1f0756){_0x43f4e6=_0x1f0756[_0x2bfd('0x3c')][0x0];_0x43f4e6[_0x2bfd('0x3d')]=_0x361ec6;}_0x4cf152(_0x43f4e6);})['catch'](function(_0x50ad5a){_0x4a7925(_0x50ad5a);});});}function createEndUser(_0xaf4957,_0xc17e17,_0x159fb9,_0x36f554,_0x807f83,_0x181f25){var _0x159fb9=getName(_0x159fb9);return request({'method':_0x2bfd('0x22'),'uri':_0x2bfd('0x3e')+_0xc17e17+_0x2bfd('0x3f')+_[_0x2bfd('0x40')](_0x181f25['moduleCreate'])+'s','body':{'data':[{'Last_Name':_0x159fb9[0x1],'First_Name':_0x159fb9[0x0],'Phone':_0x36f554,'Owner':{'name':!_[_0x2bfd('0x1a')](_0x807f83['role'][_0x2bfd('0x16')])?_0x807f83[_0x2bfd('0x41')][_0x2bfd('0x16')]:!_[_0x2bfd('0x1a')](_0x807f83[_0x2bfd('0x42')])?_0x807f83[_0x2bfd('0x42')]+'\x20'+_0x807f83[_0x2bfd('0x43')]:_0x807f83[_0x2bfd('0x43')],'id':_0x807f83['id']}}]},'headers':{'Authorization':_0x2bfd('0x33')+_0xaf4957},'json':!![]})[_0x2bfd('0x28')](function(_0x443419){if(_0x443419&&_0x443419['data'][0x0]['code']===_0x2bfd('0x44')){var _0x3d722a=_0x443419[_0x2bfd('0x3c')][0x0][_0x2bfd('0x45')];_0x3d722a[_0x2bfd('0x3d')]=_['startCase'](_0x181f25[_0x2bfd('0x46')])+'s';return _0x3d722a;}logger[_0x2bfd('0x2c')]('The\x20failing\x20result\x20is',JSON[_0x2bfd('0xc')](data));throw new Error(_0x2bfd('0x47')+JSON[_0x2bfd('0xc')](data));})[_0x2bfd('0x2b')](function(_0x29f416){console[_0x2bfd('0x48')](_0x2bfd('0x49'),_0x29f416);});}function getEndUser(_0x2eb933,_0x10444f,_0x3014fd,_0xaa6d2b,_0x261b3d,_0xaea63a,_0x30ca33){var _0x29bd27={'method':'GET','uri':'','headers':{'Authorization':_0x2bfd('0x33')+_0x2eb933},'json':!![]};switch(_0x30ca33[_0x2bfd('0x4a')]){case _0x2bfd('0x4b'):_0x29bd27[_0x2bfd('0x4c')]=_0x2bfd('0x3e')+_0x10444f+'/crm/v2/Contacts/search?criteria=((Phone:equals:'+_0x261b3d+'))';return getZohoUser(_0x29bd27,_0x2bfd('0x4d'))['then'](function(_0x4de9c7){if(_0x4de9c7)return _0x4de9c7;_0x29bd27['uri']=_0x2bfd('0x3e')+_0x10444f+_0x2bfd('0x4e')+_0x261b3d+'))';return getZohoUser(_0x29bd27,_0x2bfd('0x4f'))[_0x2bfd('0x28')](function(_0x16c2d4){if(_0x16c2d4)return _0x16c2d4;if(_0x30ca33[_0x2bfd('0x46')]!='nothing'){return createEndUser(_0x2eb933,_0x10444f,_0xaa6d2b,_0x261b3d,_0xaea63a,_0x30ca33);}else{return{};}});});break;case _0x2bfd('0x50'):_0x29bd27[_0x2bfd('0x4c')]=_0x2bfd('0x3e')+_0x10444f+_0x2bfd('0x51')+_0x261b3d+'))';return getZohoUser(_0x29bd27,'Contacts')[_0x2bfd('0x28')](function(_0x2a788d){if(_0x2a788d)return _0x2a788d;if(_0x30ca33[_0x2bfd('0x46')]!=_0x2bfd('0x52')){return createEndUser(_0x2eb933,_0x10444f,_0xaa6d2b,_0x261b3d,_0xaea63a,_0x30ca33);}else{return{};}});break;case _0x2bfd('0x53'):_0x29bd27[_0x2bfd('0x4c')]=_0x2bfd('0x3e')+_0x10444f+'/crm/v2/Leads/search?criteria=((Phone:equals:'+_0x261b3d+'))';return getZohoUser(_0x29bd27,'Leads')[_0x2bfd('0x28')](function(_0x3a268b){if(_0x3a268b)return _0x3a268b;if(_0x30ca33['moduleCreate']!=_0x2bfd('0x52')){return createEndUser(_0x2eb933,_0x10444f,_0xaa6d2b,_0x261b3d,_0xaea63a,_0x30ca33);}else{return{};}});break;}}function getCall(_0x349ffb,_0x2c2b40,_0x4ee025,_0x2f6249,_0x585880,_0x59b75b,_0x2148ac,_0x107524){logger[_0x2bfd('0x2e')](_0x2bfd('0x54'));var _0x22c55e={};_0x22c55e[_0x2bfd('0x55')]={'name':!_[_0x2bfd('0x1a')](_0x2f6249[_0x2bfd('0x41')][_0x2bfd('0x16')])&&!_[_0x2bfd('0x1a')](_0x2f6249['profile'][_0x2bfd('0x16')])&&_0x2f6249['profile'][_0x2bfd('0x16')]===_0x2bfd('0x56')?_0x2f6249[_0x2bfd('0x41')][_0x2bfd('0x16')]:!_[_0x2bfd('0x1a')](_0x2f6249['first_name'])?_0x2f6249['first_name']+'\x20'+_0x2f6249[_0x2bfd('0x43')]:_0x2f6249['last_name'],'id':_0x2f6249['id']};_0x22c55e['Subject']=intUtil[_0x2bfd('0x57')](_0x59b75b[_0x2bfd('0x58')],_0x2148ac,'\x20');_0x22c55e['Description']=intUtil[_0x2bfd('0x57')](_0x59b75b['Descriptions'],_0x2148ac,'\x0a');if(_0x585880[_0x2bfd('0x3d')]==='Contacts'){_0x22c55e[_0x2bfd('0x59')]={'name':!_[_0x2bfd('0x1a')](_0x585880['Full_Name'])?_0x585880[_0x2bfd('0x5a')]:!_['isNil'](_0x585880['First_Name'])?_0x585880['First_Name']+'\x20'+_0x585880['Last_Name']:_0x585880[_0x2bfd('0x5b')],'id':_0x585880['id']};}if(_0x585880[_0x2bfd('0x3d')]===_0x2bfd('0x4f')){_0x22c55e[_0x2bfd('0x5c')]={'name':!_[_0x2bfd('0x1a')](_0x585880[_0x2bfd('0x5a')])?_0x585880['Full_Name']:!_[_0x2bfd('0x1a')](_0x585880[_0x2bfd('0x5d')])?_0x585880[_0x2bfd('0x5d')]+'\x20'+_0x585880[_0x2bfd('0x5b')]:_0x585880['Last_Name'],'id':_0x585880['id']};_0x22c55e['$se_module']=_[_0x2bfd('0x40')](_0x585880[_0x2bfd('0x3d')]);}if(_0x2148ac[_0x2bfd('0x5e')]){_0x22c55e[_0x2bfd('0x5f')]=moment[_0x2bfd('0x60')](parseInt(_0x2148ac['talktime'])*0x3e8)[_0x2bfd('0x31')](_0x2bfd('0x61'));}else if(_0x2148ac[_0x2bfd('0x62')]&&_0x2148ac['endtime']){_0x22c55e['Call_Duration']=moment[_0x2bfd('0x60')](moment(_0x2148ac[_0x2bfd('0x63')],_0x2bfd('0x64'))[_0x2bfd('0x65')](moment(_0x2148ac['starttime'],_0x2bfd('0x64'))))['format'](_0x2bfd('0x61'));}switch(_0x2148ac[_0x2bfd('0x66')]){case _0x2bfd('0x67'):_0x22c55e[_0x2bfd('0x68')]=_0x2bfd('0x69');break;case _0x2bfd('0x6a'):case _0x2bfd('0x6b'):_0x22c55e['Call_Result']=_0x2bfd('0x6c');break;case _0x2bfd('0x6d'):_0x22c55e[_0x2bfd('0x68')]=_0x2bfd('0x6e');break;case _0x2bfd('0x6f'):_0x22c55e[_0x2bfd('0x68')]=_0x2bfd('0x70');break;default:}_0x22c55e['Call_Start_Time']=(_0x107524===_0x2bfd('0x71')?moment(_0x2148ac[_0x2bfd('0x72')])['format']('YYYY-MM-DDTHH:mm:ss'):moment(_0x2148ac[_0x2bfd('0x73')])['format'](_0x2bfd('0x64')))||moment()[_0x2bfd('0x31')]('YYYY-MM-DDTHH:mm:ss');_0x22c55e[_0x2bfd('0x74')]=_0x107524||_0x2bfd('0x75');_0x22c55e=_[_0x2bfd('0x76')](_0x22c55e,getCustomFields(_0x59b75b['Fields'],_0x2148ac));return request({'method':_0x2bfd('0x22'),'uri':_0x2bfd('0x3e')+_0x2c2b40+_0x2bfd('0x77'),'headers':{'Authorization':_0x2bfd('0x33')+_0x349ffb},'body':{'data':[_0x22c55e]},'json':!![]})[_0x2bfd('0x28')](function(_0x237afe){if(_0x237afe&&_0x237afe[_0x2bfd('0x3c')][0x0]['code']===_0x2bfd('0x44')){logger[_0x2bfd('0x2e')]('Call\x20created!');return{'id':_0x237afe[_0x2bfd('0x3c')][0x0][_0x2bfd('0x45')]['id']};}})['catch'](function(_0xad8f57){logger[_0x2bfd('0x2e')](_0x2bfd('0x78'),_0xad8f57[_0x2bfd('0x2d')]);console['log']('err',_0xad8f57);});}exports[_0x2bfd('0x79')]=function(_0x417eca,_0xa09331,_0x1dfa7b,_0x4399b2,_0x5ec4ba,_0x51a4ae){var _0x481490,_0x922a2d,_0x181a15;_0x51a4ae['host']=intUtil['stripTrailingSlash'](_0x51a4ae['host']);_0x51a4ae[_0x2bfd('0x7a')]=intUtil['stripTrailingSlash'](_0x51a4ae['serverUrl']);if(_0x5ec4ba&&_0x5ec4ba[_0x2bfd('0x7b')]){logger[_0x2bfd('0x2e')](_0x2bfd('0x7c'),_0x2bfd('0x7d'));_0xa09331[_0x2bfd('0x7e')]=_0x51a4ae[_0x2bfd('0x7a')]+'/api/voice/recordings/'+_0xa09331['uniqueid']+'/downloads?type=uniqueid&token='+md5(_0xa09331['uniqueid']);}else{_0xa09331[_0x2bfd('0x7e')]='';}var _0x4ca201=_0x51a4ae[_0x2bfd('0x7f')]==='zoho.eu'?'eu':'com';return getAccessToken(_0x51a4ae)[_0x2bfd('0x28')](function(_0xa25249){_0x181a15=_0xa25249;return getUser(_0x181a15,_0x4ca201,_0x51a4ae,_0x4399b2[_0x2bfd('0x80')]);})[_0x2bfd('0x28')](function(_0x588873){_0x481490=_0x588873;logger[_0x2bfd('0x2e')](_0x2bfd('0x81'),_0x481490['id']);return getEndUser(_0x181a15,_0x4ca201,_0x51a4ae,_0xa09331[_0x2bfd('0x82')],_0xa09331[_0x2bfd('0x83')],_0x481490,_0x1dfa7b);})[_0x2bfd('0x28')](function(_0x214b25){_0x922a2d=_0x214b25;return getCall(_0x181a15,_0x4ca201,_0x51a4ae,_0x481490,_0x922a2d,_0x1dfa7b,_0xa09331,_0x2bfd('0x75'));})[_0x2bfd('0x28')](function(_0x1ec3ca){if(_0x1ec3ca){logger[_0x2bfd('0x2e')](_0x2bfd('0x84'),_0x1ec3ca['id']);logger[_0x2bfd('0x2e')]('[QUEUE]',_0x2bfd('0x85'));emit(util[_0x2bfd('0x31')](_0x2bfd('0x86'),_0x4399b2['name']),_0x2bfd('0x87'),{'uri':_0x2bfd('0x88')+_0x51a4ae[_0x2bfd('0x7f')]+_0x2bfd('0x89')+_0x1ec3ca['id']});}})[_0x2bfd('0x2b')](function(_0x63c0cc){logger['error'](_0x2bfd('0x7c'),JSON[_0x2bfd('0xc')](_0x63c0cc));});};exports['outbound']=function(_0x405b93,_0x32fa6d,_0x1759c0,_0x282716,_0x3a3509,_0x437856,_0x44efc7){var _0x3f7023,_0x3de707,_0x1b4d16;_0x437856[_0x2bfd('0x7f')]=intUtil[_0x2bfd('0x8a')](_0x437856[_0x2bfd('0x7f')]);_0x437856['serverUrl']=intUtil[_0x2bfd('0x8a')](_0x437856[_0x2bfd('0x7a')]);if(_0x44efc7&&_0x44efc7[_0x2bfd('0x8b')]&&_0x44efc7[_0x2bfd('0x8b')]!=='none'){logger[_0x2bfd('0x2e')](_0x2bfd('0x8c'),_0x2bfd('0x7d'));_0x32fa6d[_0x2bfd('0x7e')]=_0x437856[_0x2bfd('0x7a')]+'/api/voice/recordings/'+_0x32fa6d[_0x2bfd('0x8d')]+'/downloads?type=uniqueid&token='+md5(_0x32fa6d['uniqueid']);}var _0x2b4af0=_0x437856[_0x2bfd('0x7f')]===_0x2bfd('0x8e')?'eu':_0x2bfd('0x8f');return getAccessToken(_0x437856)['then'](function(_0x2306dd){_0x1b4d16=_0x2306dd;return getUser(_0x1b4d16,_0x2b4af0,_0x437856,_0x282716[_0x2bfd('0x80')]);})['then'](function(_0x5c9214){_0x3f7023=_0x5c9214;logger[_0x2bfd('0x2e')](_0x2bfd('0x81'),_0x3f7023['id']);return getEndUser(_0x1b4d16,_0x2b4af0,_0x437856,_0x32fa6d[_0x2bfd('0x90')],_0x32fa6d[_0x2bfd('0x91')],_0x3f7023,_0x1759c0);})[_0x2bfd('0x28')](function(_0x6de4cb){_0x3de707=_0x6de4cb;return getCall(_0x1b4d16,_0x2b4af0,_0x437856,_0x3f7023,_0x3de707,_0x1759c0,_0x32fa6d,'Outbound');})[_0x2bfd('0x28')](function(_0x2333dd){if(_0x2333dd){logger[_0x2bfd('0x2e')](_0x2bfd('0x84'),_0x2333dd['id']);logger[_0x2bfd('0x2e')](_0x2bfd('0x8c'),'Displaying\x20call\x20to\x20agent\x20in\x20a\x20new\x20tab...');emit(util['format'](_0x2bfd('0x86'),_0x282716[_0x2bfd('0x16')]),_0x2bfd('0x87'),{'uri':_0x2bfd('0x88')+_0x437856[_0x2bfd('0x7f')]+'/crm/EntityInfo.do?module=Calls&id='+_0x2333dd['id']});}})[_0x2bfd('0x2b')](function(_0x30b3b2){logger[_0x2bfd('0x2c')](_0x2bfd('0x8c'),JSON[_0x2bfd('0xc')](_0x30b3b2));});};exports[_0x2bfd('0x6f')]=function(_0x58678d,_0x2cc33e,_0x454e53,_0x362ab6,_0x1e064e,_0xdfcd6c){var _0x226e9f,_0x50e845,_0x43b6c8;_0xdfcd6c[_0x2bfd('0x7f')]=intUtil['stripTrailingSlash'](_0xdfcd6c[_0x2bfd('0x7f')]);_0xdfcd6c[_0x2bfd('0x7a')]=intUtil[_0x2bfd('0x8a')](_0xdfcd6c[_0x2bfd('0x7a')]);if(_0x1e064e&&_0x1e064e['monitor_format']){logger[_0x2bfd('0x2e')]('[ABANDONED]',_0x2bfd('0x7d'));_0x2cc33e[_0x2bfd('0x7e')]=_0xdfcd6c['serverUrl']+_0x2bfd('0x92')+_0x2cc33e[_0x2bfd('0x8d')]+_0x2bfd('0x93')+md5(_0x2cc33e[_0x2bfd('0x8d')]);}else{_0x2cc33e[_0x2bfd('0x7e')]='';}var _0xd0214a=_0xdfcd6c['host']==='zoho.eu'?'eu':'com';return getAccessToken(_0xdfcd6c)[_0x2bfd('0x28')](function(_0x586678){_0x43b6c8=_0x586678;return getUser(_0x43b6c8,_0xd0214a,_0xdfcd6c);})[_0x2bfd('0x28')](function(_0x5ce9a1){_0x226e9f=_0x5ce9a1;logger[_0x2bfd('0x2e')]('The\x20User\x20ID\x20is:',_0x226e9f['id']);return getEndUser(_0x43b6c8,_0xd0214a,_0xdfcd6c,_0x2cc33e[_0x2bfd('0x82')],_0x2cc33e[_0x2bfd('0x83')],_0x226e9f,_0x454e53);})[_0x2bfd('0x28')](function(_0x17dd5d){_0x50e845=_0x17dd5d;return getCall(_0x43b6c8,_0xd0214a,_0xdfcd6c,_0x226e9f,_0x50e845,_0x454e53,_0x2cc33e,'Inbound');})[_0x2bfd('0x28')](function(_0x5449e7){if(_0x5449e7){logger[_0x2bfd('0x2e')](_0x2bfd('0x84'),_0x5449e7['id']);}})[_0x2bfd('0x2b')](function(_0x56d27d){logger[_0x2bfd('0x2c')]('[ABANDONED]',JSON['stringify'](_0x56d27d));});};
\ 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 afaeca6..7dd2281 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(_0x1432ea,_0x3a88e5){var _0x1be74d=function(_0x5a967e){while(--_0x5a967e){_0x1432ea['push'](_0x1432ea['shift']());}};_0x1be74d(++_0x3a88e5);}(_0x7a54,0x106));var _0x47a5=function(_0x453817,_0x486e84){_0x453817=_0x453817-0x0;var _0x2169de=_0x7a54[_0x453817];return _0x2169de;};'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(_0x55400d,_0x3d6b3f){var _0x246535=function(_0xd9f0b1){while(--_0xd9f0b1){_0x55400d['push'](_0x55400d['shift']());}};_0x246535(++_0x3d6b3f);}(_0x7a54,0x106));var _0x47a5=function(_0x3757c8,_0x5c8dcb){_0x3757c8=_0x3757c8-0x0;var _0x285bbc=_0x7a54[_0x3757c8];return _0x285bbc;};'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 9d162d8..c8a4de5 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(_0x1906e8,_0x464058){var _0x39c63f=function(_0x209cb1){while(--_0x209cb1){_0x1906e8['push'](_0x1906e8['shift']());}};_0x39c63f(++_0x464058);}(_0x7a54,0x106));var _0x47a5=function(_0x13732c,_0x35a4f3){_0x13732c=_0x13732c-0x0;var _0xf83bef=_0x7a54[_0x13732c];return _0xf83bef;};'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 _0xb10b=['number','headers','data6','parse','error','stack','DELETE','POST','PUT','data7','body','body\x20has\x20been\x20passed\x20to\x20URLforward\x20in\x20a\x20wrong\x20format','info','format','%s\x20%s\x20sending\x20request\x20with\x20following\x20options:\x20%s','data2','stringify','then','isNil',',\x20request\x20body:\x20','object','%s\x20%s\x20succeeded\x20with\x20status:\x20%d\x20and\x20response:\x20%s','data1','statusCode','name','message','request-promise','lodash','mustache','../../../../config/logger','exec','toUpperCase','render','data5'];(function(_0x484e0f,_0x273fbb){var _0x4890f6=function(_0x17580a){while(--_0x17580a){_0x484e0f['push'](_0x484e0f['shift']());}};_0x4890f6(++_0x273fbb);}(_0xb10b,0x12a));var _0xbb10=function(_0x4792c8,_0x5158a1){_0x4792c8=_0x4792c8-0x0;var _0x35edb1=_0xb10b[_0x4792c8];return _0x35edb1;};'use strict';var rp=require(_0xbb10('0x0'));var util=require('util');var _=require(_0xbb10('0x1'));var Mustache=require(_0xbb10('0x2'));var logger=require(_0xbb10('0x3'))('trigger');exports[_0xbb10('0x4')]=function(_0x9bbed,_0x460981){var _0x22320e,_0x49baf4;var _0x312b72={'method':_0x9bbed['data1'][_0xbb10('0x5')](),'uri':Mustache[_0xbb10('0x6')](_0x9bbed['data2'],_0x460981),'json':!![],'resolveWithFullResponse':!![],'timeout':typeof parseInt(_0x9bbed[_0xbb10('0x7')])===_0xbb10('0x8')&&parseInt(_0x9bbed[_0xbb10('0x7')])>=0x1&&parseInt(_0x9bbed[_0xbb10('0x7')])<=0xa?parseInt(_0x9bbed[_0xbb10('0x7')])*0x3e8:0x5*0x3e8};try{_0x312b72[_0xbb10('0x9')]=_0x9bbed[_0xbb10('0xa')]?JSON[_0xbb10('0xb')](Mustache['render'](_0x9bbed['data6'],_0x460981)):{};}catch(_0x20bd61){logger[_0xbb10('0xc')](_0x20bd61[_0xbb10('0xd')]);}switch(_0x9bbed['data1'][_0xbb10('0x5')]()){case'GET':case _0xbb10('0xe'):_0x22320e=null;_0x312b72['qs']=_0x460981;break;case _0xbb10('0xf'):case _0xbb10('0x10'):if(_0x9bbed[_0xbb10('0x11')]){try{_0x22320e=JSON[_0xbb10('0xb')](Mustache[_0xbb10('0x6')](_0x9bbed['data7'],_0x460981));_0x312b72[_0xbb10('0x12')]=_0x22320e;}catch(_0x42d7e4){logger[_0xbb10('0xc')](_0x42d7e4[_0xbb10('0xd')]);logger[_0xbb10('0xc')](_0xbb10('0x13'));}}else{_0x22320e=_0x460981;_0x312b72[_0xbb10('0x12')]=_0x22320e;}break;}logger[_0xbb10('0x14')](util[_0xbb10('0x15')](_0xbb10('0x16'),_0x9bbed['data1'],_0x9bbed[_0xbb10('0x17')],JSON[_0xbb10('0x18')](_0x312b72)));rp(_0x312b72)[_0xbb10('0x19')](function(_0x42db98){_0x22320e=!_[_0xbb10('0x1a')](_0x22320e)?_0xbb10('0x1b')+_0x22320e:'';_0x49baf4=typeof _0x42db98[_0xbb10('0x12')]===_0xbb10('0x1c')?JSON[_0xbb10('0x18')](_0x42db98[_0xbb10('0x12')]):_0x42db98['body'];logger[_0xbb10('0x14')](util[_0xbb10('0x15')](_0xbb10('0x1d'),_0x9bbed[_0xbb10('0x1e')],_0x9bbed[_0xbb10('0x17')],_0x42db98[_0xbb10('0x1f')],_0x49baf4));})['catch'](function(_0x12f888){logger[_0xbb10('0xc')](util['format']('%s\x20%s\x20failed\x20with\x20status:\x20%d\x20and\x20error:\x20%s\x20%s',_0x9bbed[_0xbb10('0x1e')],_0x9bbed[_0xbb10('0x17')],_0x12f888[_0xbb10('0x1f')],_0x12f888[_0xbb10('0x20')],_0x12f888[_0xbb10('0x21')]));});};
\ No newline at end of file
diff --git a/server/services/email/client.js b/server/services/email/client.js
index 5c0aade..9539284 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 _0x88d5=['debug','error','rpc','message','result','exports','jayson/promise','bluebird','../../config/logger','routing','client','Request','request','then'];(function(_0x3ef45e,_0xe84f33){var _0x69e7c=function(_0x43ba11){while(--_0x43ba11){_0x3ef45e['push'](_0x3ef45e['shift']());}};_0x69e7c(++_0xe84f33);}(_0x88d5,0x76));var _0x588d=function(_0x3c9e47,_0x5c1342){_0x3c9e47=_0x3c9e47-0x0;var _0x38f4df=_0x88d5[_0x3c9e47];return _0x38f4df;};'use strict';var jayson=require(_0x588d('0x0'));var BPromise=require(_0x588d('0x1'));var logger=require(_0x588d('0x2'))(_0x588d('0x3'));var client=jayson[_0x588d('0x4')]['http']({'port':0x2329});client[_0x588d('0x5')]=function(_0x32c63d,_0x504b52){return new BPromise(function(_0x474e79,_0x34f4db){return client[_0x588d('0x6')](_0x32c63d,_0x504b52)[_0x588d('0x7')](function(_0xecfb11){logger[_0x588d('0x8')]('rpc','routing',_0x32c63d,_0x504b52,_0xecfb11);if(_0xecfb11[_0x588d('0x9')]){logger[_0x588d('0x9')](_0x588d('0xa'),_0x588d('0x3'),_0x32c63d,_0xecfb11['error'][_0x588d('0xb')],_0x504b52);return _0x34f4db(_0xecfb11['error'][_0x588d('0xb')]);}else{return _0x474e79(_0xecfb11[_0x588d('0xc')]);}})['catch'](function(_0x2b20f5){logger[_0x588d('0x9')](_0x588d('0xa'),'routing',_0x32c63d,_0x2b20f5,_0x504b52);return _0x34f4db(_0x2b20f5);});});};module[_0x588d('0xd')]=client;
\ No newline at end of file
+var _0x2208=['http','Request','then','debug','rpc','error','message','result','catch','exports','bluebird','routing'];(function(_0x19e35c,_0x29cd1e){var _0x3e1fe8=function(_0x17258b){while(--_0x17258b){_0x19e35c['push'](_0x19e35c['shift']());}};_0x3e1fe8(++_0x29cd1e);}(_0x2208,0x11e));var _0x8220=function(_0x254527,_0x5dc524){_0x254527=_0x254527-0x0;var _0x4888cf=_0x2208[_0x254527];return _0x4888cf;};'use strict';var jayson=require('jayson/promise');var BPromise=require(_0x8220('0x0'));var logger=require('../../config/logger')(_0x8220('0x1'));var client=jayson['client'][_0x8220('0x2')]({'port':0x2329});client[_0x8220('0x3')]=function(_0x3d2530,_0x231a4b){return new BPromise(function(_0x464d1c,_0x32703d){return client['request'](_0x3d2530,_0x231a4b)[_0x8220('0x4')](function(_0x4dd1a0){logger[_0x8220('0x5')](_0x8220('0x6'),_0x8220('0x1'),_0x3d2530,_0x231a4b,_0x4dd1a0);if(_0x4dd1a0[_0x8220('0x7')]){logger[_0x8220('0x7')](_0x8220('0x6'),'routing',_0x3d2530,_0x4dd1a0[_0x8220('0x7')][_0x8220('0x8')],_0x231a4b);return _0x32703d(_0x4dd1a0['error'][_0x8220('0x8')]);}else{return _0x464d1c(_0x4dd1a0[_0x8220('0x9')]);}})[_0x8220('0xa')](function(_0x282223){logger[_0x8220('0x7')]('rpc','routing',_0x3d2530,_0x282223,_0x231a4b);return _0x32703d(_0x282223);});});};module[_0x8220('0xb')]=client;
\ No newline at end of file
diff --git a/server/services/email/index.js b/server/services/email/index.js
index eba2b36..63eedf3 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 _0x446c=['mailAccounts','Setting','findOne','loginMailFrequency','catch','log','bluebird','./server','./realtime','./lib/email','../../mysqldb','resolve','then','refresh'];(function(_0x2f4e3e,_0x2be18f){var _0x3c853d=function(_0x5c0a66){while(--_0x5c0a66){_0x2f4e3e['push'](_0x2f4e3e['shift']());}};_0x3c853d(++_0x2be18f);}(_0x446c,0x156));var _0xc446=function(_0x12a2a6,_0x374ff1){_0x12a2a6=_0x12a2a6-0x0;var _0x1754ae=_0x446c[_0x12a2a6];return _0x1754ae;};'use strict';var BPromise=require(_0xc446('0x0'));var server=require(_0xc446('0x1'));var Realtime=require(_0xc446('0x2'));var EmailChannel=require(_0xc446('0x3'));var mailAccount=require('./rpc/mailAccount');var realtime=new Realtime();var email=new EmailChannel(realtime);var db=require(_0xc446('0x4'))['db'];function initRealtime(){return BPromise[_0xc446('0x5')]()[_0xc446('0x6')](mailAccount['getMailAccounts']())[_0xc446('0x6')](realtime['initMailAccounts']())['then'](function(){email[_0xc446('0x7')](realtime[_0xc446('0x8')]);return realtime;});}function main(){return server['listen'](realtime,email)['then'](function(_0x2eea75){return initRealtime();})[_0xc446('0x6')](function(_0x1ddeaf){return db[_0xc446('0x9')][_0xc446('0xa')]({'attributes':['id','loginMailFrequency'],'raw':!![]});})[_0xc446('0x6')](function(_0x5f2136){return setInterval(initRealtime,_0x5f2136[_0xc446('0xb')]*0x3e8);})[_0xc446('0xc')](function(_0x5e225d){console[_0xc446('0xd')](_0x5e225d);});}main();
\ No newline at end of file
+var _0x34f2=['listen','Setting','findOne','loginMailFrequency','catch','log','bluebird','./server','./lib/email','./rpc/mailAccount','../../mysqldb','resolve','then','getMailAccounts','initMailAccounts','refresh','mailAccounts'];(function(_0x3b7052,_0x980e05){var _0xfc8bd7=function(_0x2a97c9){while(--_0x2a97c9){_0x3b7052['push'](_0x3b7052['shift']());}};_0xfc8bd7(++_0x980e05);}(_0x34f2,0x15a));var _0x234f=function(_0xa6254,_0x4109dc){_0xa6254=_0xa6254-0x0;var _0x57961d=_0x34f2[_0xa6254];return _0x57961d;};'use strict';var BPromise=require(_0x234f('0x0'));var server=require(_0x234f('0x1'));var Realtime=require('./realtime');var EmailChannel=require(_0x234f('0x2'));var mailAccount=require(_0x234f('0x3'));var realtime=new Realtime();var email=new EmailChannel(realtime);var db=require(_0x234f('0x4'))['db'];function initRealtime(){return BPromise[_0x234f('0x5')]()[_0x234f('0x6')](mailAccount[_0x234f('0x7')]())[_0x234f('0x6')](realtime[_0x234f('0x8')]())[_0x234f('0x6')](function(){email[_0x234f('0x9')](realtime[_0x234f('0xa')]);return realtime;});}function main(){return server[_0x234f('0xb')](realtime,email)[_0x234f('0x6')](function(_0x477918){return initRealtime();})[_0x234f('0x6')](function(_0x514588){return db[_0x234f('0xc')][_0x234f('0xd')]({'attributes':['id','loginMailFrequency'],'raw':!![]});})['then'](function(_0x1c88df){return setInterval(initRealtime,_0x1c88df[_0x234f('0xe')]*0x3e8);})[_0x234f('0xf')](function(_0x362ec1){console[_0x234f('0x10')](_0x362ec1);});}main();
\ No newline at end of file
diff --git a/server/services/email/lib/email.js b/server/services/email/lib/email.js
index 8c1dc73..f888247 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 _0xbc26=['New\x20email\x20from\x20%s\x20%s\x20%s\x20to\x20%s','firstName','lastName','from','notify','Mail\x20accepted\x20from\x20routing','catch','Mail\x20not\x20accepted\x20from\x20routing\x20%s','stringify','sendMail','send','verifySmtp','Smtp','lastSync','verify','then','verified','exports','lodash','moment','bluebird','md5','ioredis','../../../config/environment','../../../config/logger','email','redis','defaults','localhost','socket.io-emitter','./imap','../rpc/mailAccount','info','start\x20email\x20channel','mailAccounts','imapAccounts','smtp','prototype','emit','name','key','active','Imap','status','messageStatus','total','isNil','mailAccount:update','refresh','hasOwnProperty','box','bind','handleImapEmail','end','handleImapEnd','error','handleImapError','disabled','handleImapBox','connected','messages'];(function(_0x17d9e3,_0x1f969c){var _0x14192d=function(_0x159745){while(--_0x159745){_0x17d9e3['push'](_0x17d9e3['shift']());}};_0x14192d(++_0x1f969c);}(_0xbc26,0xc9));var _0x6bc2=function(_0x437819,_0x522f69){_0x437819=_0x437819-0x0;var _0x2e95de=_0xbc26[_0x437819];return _0x2e95de;};'use strict';var _=require(_0x6bc2('0x0'));var moment=require(_0x6bc2('0x1'));var BPromise=require(_0x6bc2('0x2'));var md5=require(_0x6bc2('0x3'));var Redis=require(_0x6bc2('0x4'));var config=require(_0x6bc2('0x5'));var logger=require(_0x6bc2('0x6'))(_0x6bc2('0x7'));config[_0x6bc2('0x8')]=_[_0x6bc2('0x9')](config[_0x6bc2('0x8')],{'host':_0x6bc2('0xa'),'port':0x18eb});var io=require(_0x6bc2('0xb'))(new Redis(config[_0x6bc2('0x8')]));var EmailImap=require(_0x6bc2('0xc'));var EmailSmtp=require('./smtp');var mailAccount=require(_0x6bc2('0xd'));var md5Accounts={};function EmailChannel(_0x231e19){logger[_0x6bc2('0xe')](_0x6bc2('0xf'));this['mailAccounts']=_0x231e19[_0x6bc2('0x10')];this[_0x6bc2('0x11')]={};this[_0x6bc2('0x12')]=new EmailSmtp();}EmailChannel[_0x6bc2('0x13')][_0x6bc2('0x14')]=function(_0x37f84c){var _0xb52dbe=this[_0x6bc2('0x10')][_0x37f84c];var _0x184fff={'id':_0xb52dbe['id'],'name':_0xb52dbe[_0x6bc2('0x15')],'key':_0xb52dbe[_0x6bc2('0x16')],'active':_0xb52dbe[_0x6bc2('0x17')],'Imap':{'status':_0xb52dbe[_0x6bc2('0x18')][_0x6bc2('0x19')],'messageStatus':_0xb52dbe['Imap'][_0x6bc2('0x1a')],'total':_0xb52dbe[_0x6bc2('0x18')][_0x6bc2('0x1b')]}};if(_[_0x6bc2('0x1c')](md5Accounts[_0x37f84c])){md5Accounts[_0x37f84c]={};}var _0x591f06=md5(JSON['stringify'](_0x184fff));if(md5Accounts[_0x37f84c][_0x6bc2('0x3')]!==_0x591f06){md5Accounts[_0x37f84c][_0x6bc2('0x3')]=_0x591f06;io[_0x6bc2('0x14')](_0x6bc2('0x1d'),_0x184fff);}};EmailChannel[_0x6bc2('0x13')][_0x6bc2('0x1e')]=function(_0x11c4d1){for(var _0x2d36de in _0x11c4d1){if(_0x11c4d1[_0x6bc2('0x1f')](_0x2d36de)){if(_0x11c4d1[_0x2d36de]['Imap']&&_0x11c4d1[_0x2d36de][_0x6bc2('0x17')]){var _0x26c8f6=_0x11c4d1[_0x2d36de][_0x6bc2('0x18')];if(!this['imapAccounts'][_0x6bc2('0x1f')](_0x26c8f6['id'])){this[_0x6bc2('0x11')][_0x26c8f6['id']]=new EmailImap(_0x26c8f6,_0x11c4d1[_0x2d36de][_0x6bc2('0x7')]);this['imapAccounts'][_0x26c8f6['id']]['on'](_0x6bc2('0x20'),this['handleImapBox'][_0x6bc2('0x21')](this,_0x2d36de));this[_0x6bc2('0x11')][_0x26c8f6['id']]['on'](_0x6bc2('0x7'),this[_0x6bc2('0x22')]['bind'](this,_0x2d36de));this[_0x6bc2('0x11')][_0x26c8f6['id']]['on'](_0x6bc2('0x23'),this[_0x6bc2('0x24')][_0x6bc2('0x21')](this,_0x2d36de));this[_0x6bc2('0x11')][_0x26c8f6['id']]['on'](_0x6bc2('0x25'),this[_0x6bc2('0x26')][_0x6bc2('0x21')](this,_0x2d36de));}}else{if(_[_0x6bc2('0x1c')](this[_0x6bc2('0x10')][_0x2d36de][_0x6bc2('0x18')])){this[_0x6bc2('0x10')][_0x2d36de][_0x6bc2('0x18')]={};}this['mailAccounts'][_0x2d36de][_0x6bc2('0x18')][_0x6bc2('0x19')]=_0x6bc2('0x27');this['mailAccounts'][_0x2d36de][_0x6bc2('0x18')][_0x6bc2('0x1a')]='';this[_0x6bc2('0x14')](_0x2d36de);}}}};EmailChannel[_0x6bc2('0x13')][_0x6bc2('0x28')]=function(_0x44dfcf,_0x327aa1){if(this['mailAccounts'][_0x44dfcf]){this['mailAccounts'][_0x44dfcf][_0x6bc2('0x18')][_0x6bc2('0x19')]=_0x6bc2('0x29');this[_0x6bc2('0x10')][_0x44dfcf][_0x6bc2('0x18')][_0x6bc2('0x1a')]=_0x327aa1[_0x6bc2('0x15')];if(_0x327aa1[_0x6bc2('0x2a')]){this['mailAccounts'][_0x44dfcf][_0x6bc2('0x18')][_0x6bc2('0x1b')]=_0x327aa1[_0x6bc2('0x2a')][_0x6bc2('0x1b')];}return this['emit'](_0x44dfcf);}};EmailChannel[_0x6bc2('0x13')][_0x6bc2('0x22')]=function(_0x2d9a66,_0x258efb){logger[_0x6bc2('0xe')](_0x6bc2('0x2b'),_0x258efb[_0x6bc2('0x2c')],_0x258efb[_0x6bc2('0x2d')],_0x258efb[_0x6bc2('0x2e')],_0x2d9a66);if(this[_0x6bc2('0x10')][_0x2d9a66]){return mailAccount[_0x6bc2('0x2f')](_0x2d9a66,_0x258efb)['then'](function(_0x44abf4){if(_0x44abf4){logger[_0x6bc2('0xe')](_0x6bc2('0x30'));}})[_0x6bc2('0x31')](function(_0x165609){logger[_0x6bc2('0x25')](_0x6bc2('0x32'),JSON[_0x6bc2('0x33')](_0x165609));});}};EmailChannel[_0x6bc2('0x13')]['handleImapEnd']=function(_0x34d669){if(this[_0x6bc2('0x10')][_0x34d669]&&this[_0x6bc2('0x10')][_0x34d669][_0x6bc2('0x18')]){if(this['imapAccounts'][this[_0x6bc2('0x10')][_0x34d669][_0x6bc2('0x18')]['id']]){delete this[_0x6bc2('0x11')][this[_0x6bc2('0x10')][_0x34d669]['Imap']['id']];}this[_0x6bc2('0x10')][_0x34d669]['Imap']['lastSync']=moment();this['emit'](_0x34d669);}};EmailChannel[_0x6bc2('0x13')][_0x6bc2('0x26')]=function(_0x350950,_0x2fc231){if(this['mailAccounts'][_0x350950]){this['mailAccounts'][_0x350950]['Imap']['status']=_0x6bc2('0x25');this[_0x6bc2('0x10')][_0x350950][_0x6bc2('0x18')][_0x6bc2('0x1a')]=_0x2fc231;return this['emit'](_0x350950);}};EmailChannel[_0x6bc2('0x13')][_0x6bc2('0x34')]=function(_0x228bd3,_0x31c990){return this['smtp'][_0x6bc2('0x35')](_0x228bd3,_0x31c990);};EmailChannel['prototype'][_0x6bc2('0x36')]=function(_0x163f8b){var _0x2a3ed2=this;if(this[_0x6bc2('0x10')][_0x163f8b['id']]){if(_[_0x6bc2('0x1c')](this[_0x6bc2('0x10')][_0x163f8b['id']][_0x6bc2('0x37')])){this[_0x6bc2('0x10')][_0x163f8b['id']][_0x6bc2('0x37')]={};}this[_0x6bc2('0x10')][_0x163f8b['id']][_0x6bc2('0x37')][_0x6bc2('0x38')]=moment();return new BPromise(function(_0x486dc0,_0x1a89f4){return _0x2a3ed2[_0x6bc2('0x12')][_0x6bc2('0x39')](_0x163f8b)[_0x6bc2('0x3a')](function(_0x5e7ca3){_0x2a3ed2[_0x6bc2('0x10')][_0x163f8b['id']][_0x6bc2('0x37')][_0x6bc2('0x19')]=_0x6bc2('0x3b');_0x2a3ed2[_0x6bc2('0x10')][_0x163f8b['id']][_0x6bc2('0x37')][_0x6bc2('0x1a')]='';_0x2a3ed2[_0x6bc2('0x14')](_0x163f8b['id']);_0x486dc0(_0x5e7ca3);})[_0x6bc2('0x31')](function(_0x33ef92){_0x2a3ed2[_0x6bc2('0x10')][_0x163f8b['id']][_0x6bc2('0x37')][_0x6bc2('0x19')]=_0x6bc2('0x25');_0x2a3ed2[_0x6bc2('0x10')][_0x163f8b['id']][_0x6bc2('0x37')][_0x6bc2('0x1a')]=_0x33ef92;_0x2a3ed2[_0x6bc2('0x14')](_0x163f8b['id']);_0x1a89f4(_0x33ef92);});});}return this[_0x6bc2('0x12')]['verify'](_0x163f8b);};module[_0x6bc2('0x3c')]=EmailChannel;
\ No newline at end of file
+var _0x1344=['imapAccounts','smtp','prototype','emit','key','active','status','Imap','total','isNil','stringify','refresh','hasOwnProperty','handleImapBox','bind','handleImapEmail','end','error','handleImapError','connected','messageStatus','messages','info','New\x20email\x20from\x20%s\x20%s\x20%s\x20to\x20%s','firstName','notify','then','Mail\x20accepted\x20from\x20routing','handleImapEnd','lastSync','sendMail','send','verifySmtp','Smtp','verify','verified','catch','exports','moment','md5','ioredis','../../../config/environment','../../../config/logger','email','redis','defaults','socket.io-emitter','./smtp','start\x20email\x20channel','mailAccounts'];(function(_0x61326c,_0x102e54){var _0x285610=function(_0xc37353){while(--_0xc37353){_0x61326c['push'](_0x61326c['shift']());}};_0x285610(++_0x102e54);}(_0x1344,0x8a));var _0x4134=function(_0x458f09,_0xf2ee90){_0x458f09=_0x458f09-0x0;var _0x1ca565=_0x1344[_0x458f09];return _0x1ca565;};'use strict';var _=require('lodash');var moment=require(_0x4134('0x0'));var BPromise=require('bluebird');var md5=require(_0x4134('0x1'));var Redis=require(_0x4134('0x2'));var config=require(_0x4134('0x3'));var logger=require(_0x4134('0x4'))(_0x4134('0x5'));config[_0x4134('0x6')]=_[_0x4134('0x7')](config[_0x4134('0x6')],{'host':'localhost','port':0x18eb});var io=require(_0x4134('0x8'))(new Redis(config['redis']));var EmailImap=require('./imap');var EmailSmtp=require(_0x4134('0x9'));var mailAccount=require('../rpc/mailAccount');var md5Accounts={};function EmailChannel(_0x395477){logger['info'](_0x4134('0xa'));this[_0x4134('0xb')]=_0x395477[_0x4134('0xb')];this[_0x4134('0xc')]={};this[_0x4134('0xd')]=new EmailSmtp();}EmailChannel[_0x4134('0xe')][_0x4134('0xf')]=function(_0x1b8550){var _0x4469dd=this[_0x4134('0xb')][_0x1b8550];var _0x5ee2e2={'id':_0x4469dd['id'],'name':_0x4469dd['name'],'key':_0x4469dd[_0x4134('0x10')],'active':_0x4469dd[_0x4134('0x11')],'Imap':{'status':_0x4469dd['Imap'][_0x4134('0x12')],'messageStatus':_0x4469dd['Imap']['messageStatus'],'total':_0x4469dd[_0x4134('0x13')][_0x4134('0x14')]}};if(_[_0x4134('0x15')](md5Accounts[_0x1b8550])){md5Accounts[_0x1b8550]={};}var _0x33f1e8=md5(JSON[_0x4134('0x16')](_0x5ee2e2));if(md5Accounts[_0x1b8550][_0x4134('0x1')]!==_0x33f1e8){md5Accounts[_0x1b8550][_0x4134('0x1')]=_0x33f1e8;io['emit']('mailAccount:update',_0x5ee2e2);}};EmailChannel[_0x4134('0xe')][_0x4134('0x17')]=function(_0xd6c2e1){for(var _0x2ef887 in _0xd6c2e1){if(_0xd6c2e1['hasOwnProperty'](_0x2ef887)){if(_0xd6c2e1[_0x2ef887][_0x4134('0x13')]&&_0xd6c2e1[_0x2ef887][_0x4134('0x11')]){var _0x2f9f2c=_0xd6c2e1[_0x2ef887]['Imap'];if(!this['imapAccounts'][_0x4134('0x18')](_0x2f9f2c['id'])){this[_0x4134('0xc')][_0x2f9f2c['id']]=new EmailImap(_0x2f9f2c,_0xd6c2e1[_0x2ef887][_0x4134('0x5')]);this[_0x4134('0xc')][_0x2f9f2c['id']]['on']('box',this[_0x4134('0x19')][_0x4134('0x1a')](this,_0x2ef887));this['imapAccounts'][_0x2f9f2c['id']]['on'](_0x4134('0x5'),this[_0x4134('0x1b')][_0x4134('0x1a')](this,_0x2ef887));this['imapAccounts'][_0x2f9f2c['id']]['on'](_0x4134('0x1c'),this['handleImapEnd'][_0x4134('0x1a')](this,_0x2ef887));this['imapAccounts'][_0x2f9f2c['id']]['on'](_0x4134('0x1d'),this[_0x4134('0x1e')][_0x4134('0x1a')](this,_0x2ef887));}}else{if(_[_0x4134('0x15')](this['mailAccounts'][_0x2ef887][_0x4134('0x13')])){this[_0x4134('0xb')][_0x2ef887]['Imap']={};}this[_0x4134('0xb')][_0x2ef887][_0x4134('0x13')][_0x4134('0x12')]='disabled';this[_0x4134('0xb')][_0x2ef887][_0x4134('0x13')]['messageStatus']='';this['emit'](_0x2ef887);}}}};EmailChannel[_0x4134('0xe')][_0x4134('0x19')]=function(_0x36cd8e,_0x4e31d9){if(this['mailAccounts'][_0x36cd8e]){this[_0x4134('0xb')][_0x36cd8e][_0x4134('0x13')][_0x4134('0x12')]=_0x4134('0x1f');this[_0x4134('0xb')][_0x36cd8e][_0x4134('0x13')][_0x4134('0x20')]=_0x4e31d9['name'];if(_0x4e31d9[_0x4134('0x21')]){this[_0x4134('0xb')][_0x36cd8e][_0x4134('0x13')][_0x4134('0x14')]=_0x4e31d9[_0x4134('0x21')][_0x4134('0x14')];}return this[_0x4134('0xf')](_0x36cd8e);}};EmailChannel['prototype']['handleImapEmail']=function(_0x1085ba,_0x175e34){logger[_0x4134('0x22')](_0x4134('0x23'),_0x175e34[_0x4134('0x24')],_0x175e34['lastName'],_0x175e34['from'],_0x1085ba);if(this['mailAccounts'][_0x1085ba]){return mailAccount[_0x4134('0x25')](_0x1085ba,_0x175e34)[_0x4134('0x26')](function(_0x494b5a){if(_0x494b5a){logger['info'](_0x4134('0x27'));}})['catch'](function(_0x2ee218){logger[_0x4134('0x1d')]('Mail\x20not\x20accepted\x20from\x20routing\x20%s',JSON[_0x4134('0x16')](_0x2ee218));});}};EmailChannel[_0x4134('0xe')][_0x4134('0x28')]=function(_0x241c08){if(this[_0x4134('0xb')][_0x241c08]&&this['mailAccounts'][_0x241c08][_0x4134('0x13')]){if(this[_0x4134('0xc')][this[_0x4134('0xb')][_0x241c08]['Imap']['id']]){delete this[_0x4134('0xc')][this[_0x4134('0xb')][_0x241c08][_0x4134('0x13')]['id']];}this[_0x4134('0xb')][_0x241c08][_0x4134('0x13')][_0x4134('0x29')]=moment();this[_0x4134('0xf')](_0x241c08);}};EmailChannel[_0x4134('0xe')][_0x4134('0x1e')]=function(_0x4b7a48,_0x6841cc){if(this[_0x4134('0xb')][_0x4b7a48]){this[_0x4134('0xb')][_0x4b7a48][_0x4134('0x13')][_0x4134('0x12')]=_0x4134('0x1d');this['mailAccounts'][_0x4b7a48][_0x4134('0x13')][_0x4134('0x20')]=_0x6841cc;return this['emit'](_0x4b7a48);}};EmailChannel[_0x4134('0xe')][_0x4134('0x2a')]=function(_0x46e411,_0x1c5b44){return this[_0x4134('0xd')][_0x4134('0x2b')](_0x46e411,_0x1c5b44);};EmailChannel[_0x4134('0xe')][_0x4134('0x2c')]=function(_0x3d053d){var _0x187c9c=this;if(this[_0x4134('0xb')][_0x3d053d['id']]){if(_[_0x4134('0x15')](this[_0x4134('0xb')][_0x3d053d['id']][_0x4134('0x2d')])){this['mailAccounts'][_0x3d053d['id']][_0x4134('0x2d')]={};}this[_0x4134('0xb')][_0x3d053d['id']][_0x4134('0x2d')][_0x4134('0x29')]=moment();return new BPromise(function(_0x146544,_0x3ab4f){return _0x187c9c[_0x4134('0xd')][_0x4134('0x2e')](_0x3d053d)['then'](function(_0x488ac4){_0x187c9c[_0x4134('0xb')][_0x3d053d['id']][_0x4134('0x2d')][_0x4134('0x12')]=_0x4134('0x2f');_0x187c9c[_0x4134('0xb')][_0x3d053d['id']][_0x4134('0x2d')]['messageStatus']='';_0x187c9c[_0x4134('0xf')](_0x3d053d['id']);_0x146544(_0x488ac4);})[_0x4134('0x30')](function(_0x12b978){_0x187c9c['mailAccounts'][_0x3d053d['id']][_0x4134('0x2d')][_0x4134('0x12')]=_0x4134('0x1d');_0x187c9c[_0x4134('0xb')][_0x3d053d['id']][_0x4134('0x2d')][_0x4134('0x20')]=_0x12b978;_0x187c9c[_0x4134('0xf')](_0x3d053d['id']);_0x3ab4f(_0x12b978);});});}return this['smtp'][_0x4134('0x2e')](_0x3d053d);};module[_0x4134('0x31')]=EmailChannel;
\ No newline at end of file
diff --git a/server/services/email/lib/imap.js b/server/services/email/lib/imap.js
index 00014a6..a050f67 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 _0x6722=['prototype','connTimeout','authTimeout','service','authentication','user','password','host','port','tls','autotls','required','getHost','openBox','handleOpenBox','box','handleCloseBox','search','UNSEEN','handleReadUnseen','fetch','message','closeBox','handleFetchMessage','body','handleMessageBody','handleMessageAttributes','handleMessageEnd','handleSimpleParser','emit','handleFetchEnd','handleEnd','stringify','textCode','hasOwnProperty','upperFirst','exports','path','util','mailparser','simpleParser','iconv','Iconv','events','EventEmitter','./utils','../../../config/logger','email','mailbox','account','getAccount','imap','once','ready','handleReady','bind','end','error','handleError','connect','inherits'];(function(_0x5e9f06,_0x3dd75c){var _0x4c9dd5=function(_0x5dc2e1){while(--_0x5dc2e1){_0x5e9f06['push'](_0x5e9f06['shift']());}};_0x4c9dd5(++_0x3dd75c);}(_0x6722,0x1d0));var _0x2672=function(_0x51fe51,_0x50bb7a){_0x51fe51=_0x51fe51-0x0;var _0x37142b=_0x6722[_0x51fe51];return _0x37142b;};'use strict';var fs=require('fs');var path=require(_0x2672('0x0'));var util=require(_0x2672('0x1'));var Imap=require('imap');var _=require('lodash');var rs=require('randomstring');var simpleParser=require(_0x2672('0x2'))[_0x2672('0x3')];var Iconv=require(_0x2672('0x4'))[_0x2672('0x5')];var EventEmitter=require(_0x2672('0x6'))[_0x2672('0x7')];var utils=require(_0x2672('0x8'));var logger=require(_0x2672('0x9'))(_0x2672('0xa'));function EmailImap(_0x502baa,_0x4b5519){this[_0x2672('0xb')]='INBOX';this[_0x2672('0xc')]=this[_0x2672('0xd')](_0x502baa,_0x4b5519);this[_0x2672('0xe')]=new Imap(this[_0x2672('0xc')]);this[_0x2672('0xe')][_0x2672('0xf')](_0x2672('0x10'),this[_0x2672('0x11')][_0x2672('0x12')](this));this['imap'][_0x2672('0xf')](_0x2672('0x13'),this['handleEnd'][_0x2672('0x12')](this));this['imap']['on'](_0x2672('0x14'),this[_0x2672('0x15')]['bind'](this));this[_0x2672('0xe')][_0x2672('0x16')]();}util[_0x2672('0x17')](EmailImap,EventEmitter);EmailImap[_0x2672('0x18')]['getAccount']=function(_0x5baed0,_0x2c63f4){var _0x505960={'connTimeout':_0x5baed0[_0x2672('0x19')]?_0x5baed0[_0x2672('0x19')]*0x3e8:0x2710,'authTimeout':_0x5baed0[_0x2672('0x1a')]?_0x5baed0[_0x2672('0x1a')]*0x3e8:0x1388};if(_['isNil'](_0x5baed0[_0x2672('0x1b')])){if(_0x5baed0[_0x2672('0x1c')]){_0x505960[_0x2672('0x1d')]=_0x5baed0['user'];_0x505960[_0x2672('0x1e')]=_0x5baed0[_0x2672('0x1e')];}_0x505960['host']=_0x5baed0[_0x2672('0x1f')];_0x505960['port']=_0x5baed0[_0x2672('0x20')]||0x3e1;if(_0x5baed0[_0x2672('0x21')]){_0x505960[_0x2672('0x21')]=!![];}else{_0x505960[_0x2672('0x21')]=![];_0x505960[_0x2672('0x22')]=_0x2672('0x23');}}else{_0x505960[_0x2672('0x1d')]=_0x5baed0[_0x2672('0x1d')];_0x505960['password']=_0x5baed0[_0x2672('0x1e')];_0x505960[_0x2672('0x1f')]=utils[_0x2672('0x24')](_0x5baed0['service']);_0x505960[_0x2672('0x20')]=0x3e1;_0x505960[_0x2672('0x21')]=!![];}_0x505960[_0x2672('0xa')]=_0x2c63f4||_0x5baed0['user']||'anonymous@xcally.com';return _0x505960;};EmailImap['prototype'][_0x2672('0x11')]=function(){this['imap'][_0x2672('0x25')](this[_0x2672('0xb')],![],this[_0x2672('0x26')][_0x2672('0x12')](this));};EmailImap[_0x2672('0x18')][_0x2672('0x26')]=function(_0x4c1748,_0x3164ef){if(_0x4c1748){this[_0x2672('0x15')](_0x4c1748,!![]);}else{this['emit'](_0x2672('0x27'),_0x3164ef);this['readUnseen']();}};EmailImap['prototype'][_0x2672('0x28')]=function(_0x28cc3c){if(_0x28cc3c){this[_0x2672('0x15')](_0x28cc3c,!![]);}else{this['imap']['end']();}};EmailImap['prototype']['readUnseen']=function(){this[_0x2672('0xe')][_0x2672('0x29')]([_0x2672('0x2a')],this['handleReadUnseen'][_0x2672('0x12')](this));};EmailImap['prototype'][_0x2672('0x2b')]=function(_0x56f3fe,_0x522aad){if(_0x56f3fe){this['handleError'](_0x56f3fe,!![]);}else{if(_0x522aad['length']){try{var _0x5c5605=this[_0x2672('0xe')][_0x2672('0x2c')](_0x522aad,{'bodies':'','markSeen':!![]});_0x5c5605['on'](_0x2672('0x2d'),this['handleFetchMessage'][_0x2672('0x12')](this));_0x5c5605[_0x2672('0xf')](_0x2672('0x14'),this['handleFetchError'][_0x2672('0x12')](this));_0x5c5605[_0x2672('0xf')]('end',this['handleFetchEnd']['bind'](this));}catch(_0xcb975f){logger[_0x2672('0x14')](_0xcb975f);}}else{this['imap'][_0x2672('0x2e')](!![],this[_0x2672('0x28')][_0x2672('0x12')](this));}}};EmailImap[_0x2672('0x18')][_0x2672('0x2f')]=function(_0x5b8691,_0x38435d){_0x5b8691['on'](_0x2672('0x30'),this[_0x2672('0x31')]['bind'](this));_0x5b8691[_0x2672('0xf')]('attributes',this[_0x2672('0x32')]['bind'](this));_0x5b8691[_0x2672('0xf')](_0x2672('0x13'),this[_0x2672('0x33')]['bind'](this));};EmailImap[_0x2672('0x18')][_0x2672('0x31')]=function(_0x10c984,_0x202fe0){simpleParser(_0x10c984,{'Iconv':Iconv},this[_0x2672('0x34')][_0x2672('0x12')](this));};EmailImap[_0x2672('0x18')]['handleMessageAttributes']=function(_0x6ebf6f){};EmailImap['prototype'][_0x2672('0x33')]=function(){};EmailImap['prototype'][_0x2672('0x34')]=function(_0x13818f,_0x5c0211){if(_0x13818f){logger[_0x2672('0x14')](_0x13818f);}else{var _0x4c4dee=this;utils['parser'](this[_0x2672('0xc')],_0x5c0211,function(_0x3a21f3){_0x4c4dee[_0x2672('0x35')](_0x2672('0xa'),_0x3a21f3);});}};EmailImap[_0x2672('0x18')][_0x2672('0x36')]=function(){this['imap']['closeBox'](!![],this['handleCloseBox'][_0x2672('0x12')](this));};EmailImap[_0x2672('0x18')]['handleFetchError']=function(_0xf2df7f){this['handleError'](_0xf2df7f);this[_0x2672('0xe')]['closeBox'](!![],this[_0x2672('0x28')][_0x2672('0x12')](this));};EmailImap[_0x2672('0x18')][_0x2672('0x37')]=function(){this['emit'](_0x2672('0x13'));};EmailImap[_0x2672('0x18')][_0x2672('0x15')]=function(_0x30a639,_0x3300a5){logger['error'](_0x2672('0x15'),this['account']['email'],JSON[_0x2672('0x38')](_0x30a639));var _0x119ba5='';if(_0x30a639){if(_0x30a639[_0x2672('0x39')]){_0x119ba5=_0x30a639[_0x2672('0x39')];}else{for(var _0x4510ac in _0x30a639){if(_0x30a639[_0x2672('0x3a')](_0x4510ac)){_0x119ba5+=_[_0x2672('0x3b')](_0x4510ac)+':\x20'+_0x30a639[_0x4510ac]+'\x0a';}}}}if(_0x3300a5){this[_0x2672('0xe')][_0x2672('0x13')]();}else{this[_0x2672('0x35')](_0x2672('0x14'),_0x119ba5);this['emit'](_0x2672('0x13'));}};module[_0x2672('0x3c')]=EmailImap;
\ No newline at end of file
+var _0x2081=['autotls','required','getHost','anonymous@xcally.com','openBox','handleOpenBox','box','readUnseen','handleCloseBox','search','UNSEEN','handleReadUnseen','length','fetch','message','handleFetchMessage','handleFetchError','handleFetchEnd','closeBox','handleMessageBody','attributes','handleMessageEnd','handleSimpleParser','parser','emit','stringify','textCode','hasOwnProperty','upperFirst','exports','path','util','imap','lodash','randomstring','mailparser','iconv','Iconv','events','EventEmitter','./utils','../../../config/logger','email','account','once','ready','handleReady','bind','end','handleEnd','error','handleError','inherits','prototype','getAccount','connTimeout','authTimeout','isNil','service','authentication','user','password','host','port','tls'];(function(_0x4401ba,_0x42e6db){var _0x1f51bd=function(_0xbcead){while(--_0xbcead){_0x4401ba['push'](_0x4401ba['shift']());}};_0x1f51bd(++_0x42e6db);}(_0x2081,0x1e5));var _0x1208=function(_0x2c0be1,_0x1e88f2){_0x2c0be1=_0x2c0be1-0x0;var _0x3d4bd2=_0x2081[_0x2c0be1];return _0x3d4bd2;};'use strict';var fs=require('fs');var path=require(_0x1208('0x0'));var util=require(_0x1208('0x1'));var Imap=require(_0x1208('0x2'));var _=require(_0x1208('0x3'));var rs=require(_0x1208('0x4'));var simpleParser=require(_0x1208('0x5'))['simpleParser'];var Iconv=require(_0x1208('0x6'))[_0x1208('0x7')];var EventEmitter=require(_0x1208('0x8'))[_0x1208('0x9')];var utils=require(_0x1208('0xa'));var logger=require(_0x1208('0xb'))(_0x1208('0xc'));function EmailImap(_0x2ff2e,_0x5882ad){this['mailbox']='INBOX';this['account']=this['getAccount'](_0x2ff2e,_0x5882ad);this[_0x1208('0x2')]=new Imap(this[_0x1208('0xd')]);this[_0x1208('0x2')][_0x1208('0xe')](_0x1208('0xf'),this[_0x1208('0x10')][_0x1208('0x11')](this));this[_0x1208('0x2')][_0x1208('0xe')](_0x1208('0x12'),this[_0x1208('0x13')][_0x1208('0x11')](this));this[_0x1208('0x2')]['on'](_0x1208('0x14'),this[_0x1208('0x15')][_0x1208('0x11')](this));this[_0x1208('0x2')]['connect']();}util[_0x1208('0x16')](EmailImap,EventEmitter);EmailImap[_0x1208('0x17')][_0x1208('0x18')]=function(_0xd3b703,_0x26a5f4){var _0x570a5a={'connTimeout':_0xd3b703[_0x1208('0x19')]?_0xd3b703[_0x1208('0x19')]*0x3e8:0x2710,'authTimeout':_0xd3b703[_0x1208('0x1a')]?_0xd3b703[_0x1208('0x1a')]*0x3e8:0x1388};if(_[_0x1208('0x1b')](_0xd3b703[_0x1208('0x1c')])){if(_0xd3b703[_0x1208('0x1d')]){_0x570a5a[_0x1208('0x1e')]=_0xd3b703[_0x1208('0x1e')];_0x570a5a[_0x1208('0x1f')]=_0xd3b703[_0x1208('0x1f')];}_0x570a5a['host']=_0xd3b703[_0x1208('0x20')];_0x570a5a['port']=_0xd3b703[_0x1208('0x21')]||0x3e1;if(_0xd3b703[_0x1208('0x22')]){_0x570a5a[_0x1208('0x22')]=!![];}else{_0x570a5a[_0x1208('0x22')]=![];_0x570a5a[_0x1208('0x23')]=_0x1208('0x24');}}else{_0x570a5a[_0x1208('0x1e')]=_0xd3b703['user'];_0x570a5a['password']=_0xd3b703['password'];_0x570a5a['host']=utils[_0x1208('0x25')](_0xd3b703[_0x1208('0x1c')]);_0x570a5a[_0x1208('0x21')]=0x3e1;_0x570a5a[_0x1208('0x22')]=!![];}_0x570a5a['email']=_0x26a5f4||_0xd3b703[_0x1208('0x1e')]||_0x1208('0x26');return _0x570a5a;};EmailImap[_0x1208('0x17')][_0x1208('0x10')]=function(){this[_0x1208('0x2')][_0x1208('0x27')](this['mailbox'],![],this[_0x1208('0x28')][_0x1208('0x11')](this));};EmailImap[_0x1208('0x17')][_0x1208('0x28')]=function(_0x59fed1,_0x1e491f){if(_0x59fed1){this[_0x1208('0x15')](_0x59fed1,!![]);}else{this['emit'](_0x1208('0x29'),_0x1e491f);this[_0x1208('0x2a')]();}};EmailImap[_0x1208('0x17')][_0x1208('0x2b')]=function(_0x46b95a){if(_0x46b95a){this[_0x1208('0x15')](_0x46b95a,!![]);}else{this[_0x1208('0x2')][_0x1208('0x12')]();}};EmailImap[_0x1208('0x17')][_0x1208('0x2a')]=function(){this[_0x1208('0x2')][_0x1208('0x2c')]([_0x1208('0x2d')],this[_0x1208('0x2e')]['bind'](this));};EmailImap[_0x1208('0x17')]['handleReadUnseen']=function(_0x2f3a2f,_0x44a73d){if(_0x2f3a2f){this[_0x1208('0x15')](_0x2f3a2f,!![]);}else{if(_0x44a73d[_0x1208('0x2f')]){try{var _0x5e76b7=this[_0x1208('0x2')][_0x1208('0x30')](_0x44a73d,{'bodies':'','markSeen':!![]});_0x5e76b7['on'](_0x1208('0x31'),this[_0x1208('0x32')][_0x1208('0x11')](this));_0x5e76b7[_0x1208('0xe')](_0x1208('0x14'),this[_0x1208('0x33')]['bind'](this));_0x5e76b7[_0x1208('0xe')]('end',this[_0x1208('0x34')]['bind'](this));}catch(_0x2f027a){logger[_0x1208('0x14')](_0x2f027a);}}else{this[_0x1208('0x2')][_0x1208('0x35')](!![],this[_0x1208('0x2b')][_0x1208('0x11')](this));}}};EmailImap[_0x1208('0x17')][_0x1208('0x32')]=function(_0x511701,_0x4500ad){_0x511701['on']('body',this[_0x1208('0x36')]['bind'](this));_0x511701[_0x1208('0xe')](_0x1208('0x37'),this['handleMessageAttributes'][_0x1208('0x11')](this));_0x511701[_0x1208('0xe')](_0x1208('0x12'),this[_0x1208('0x38')][_0x1208('0x11')](this));};EmailImap[_0x1208('0x17')][_0x1208('0x36')]=function(_0x379290,_0x5f0eb5){simpleParser(_0x379290,{'Iconv':Iconv},this['handleSimpleParser'][_0x1208('0x11')](this));};EmailImap[_0x1208('0x17')]['handleMessageAttributes']=function(_0x8e0274){};EmailImap[_0x1208('0x17')][_0x1208('0x38')]=function(){};EmailImap[_0x1208('0x17')][_0x1208('0x39')]=function(_0x429591,_0x382f87){if(_0x429591){logger[_0x1208('0x14')](_0x429591);}else{var _0x43b1ee=this;utils[_0x1208('0x3a')](this[_0x1208('0xd')],_0x382f87,function(_0x1cbfc4){_0x43b1ee[_0x1208('0x3b')](_0x1208('0xc'),_0x1cbfc4);});}};EmailImap['prototype'][_0x1208('0x34')]=function(){this[_0x1208('0x2')]['closeBox'](!![],this[_0x1208('0x2b')][_0x1208('0x11')](this));};EmailImap[_0x1208('0x17')][_0x1208('0x33')]=function(_0x499ca2){this[_0x1208('0x15')](_0x499ca2);this[_0x1208('0x2')]['closeBox'](!![],this[_0x1208('0x2b')][_0x1208('0x11')](this));};EmailImap['prototype'][_0x1208('0x13')]=function(){this['emit'](_0x1208('0x12'));};EmailImap[_0x1208('0x17')]['handleError']=function(_0x148a59,_0x4ca6bd){logger[_0x1208('0x14')]('handleError',this[_0x1208('0xd')]['email'],JSON[_0x1208('0x3c')](_0x148a59));var _0xa10842='';if(_0x148a59){if(_0x148a59[_0x1208('0x3d')]){_0xa10842=_0x148a59['textCode'];}else{for(var _0x369f2e in _0x148a59){if(_0x148a59[_0x1208('0x3e')](_0x369f2e)){_0xa10842+=_[_0x1208('0x3f')](_0x369f2e)+':\x20'+_0x148a59[_0x369f2e]+'\x0a';}}}}if(_0x4ca6bd){this[_0x1208('0x2')]['end']();}else{this[_0x1208('0x3b')](_0x1208('0x14'),_0xa10842);this['emit'](_0x1208('0x12'));}};module[_0x1208('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 40e211c..091a128 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 _0x60a9=['nodemailer-plugin-inline-base64','prototype','send','createTransport','use','compile','sendMail','toString','verify','exports','nodemailer','bluebird'];(function(_0x44c683,_0x435b3e){var _0x310fef=function(_0x3ee169){while(--_0x3ee169){_0x44c683['push'](_0x44c683['shift']());}};_0x310fef(++_0x435b3e);}(_0x60a9,0x1a2));var _0x960a=function(_0x54f79d,_0x33bd24){_0x54f79d=_0x54f79d-0x0;var _0x2f577f=_0x60a9[_0x54f79d];return _0x2f577f;};'use strict';var nodemailer=require(_0x960a('0x0'));var BPromise=require(_0x960a('0x1'));var inlineBase64=require(_0x960a('0x2'));function EmailSmtp(){}EmailSmtp[_0x960a('0x3')][_0x960a('0x4')]=function(_0x5867a5,_0x4a9779){return new BPromise(function(_0x3ae983,_0x25e06d){var _0x31bc54=nodemailer[_0x960a('0x5')](_0x5867a5);_0x31bc54[_0x960a('0x6')](_0x960a('0x7'),inlineBase64());_0x31bc54[_0x960a('0x8')](_0x4a9779,function(_0x1561dc,_0x4a39ef){if(_0x1561dc){_0x25e06d(_0x1561dc[_0x960a('0x9')]());}else{_0x3ae983(_0x4a39ef);}});});};EmailSmtp[_0x960a('0x3')]['verify']=function(_0x1a8bb8){return new BPromise(function(_0x5e4579,_0x1c9733){var _0x3da050=nodemailer[_0x960a('0x5')](_0x1a8bb8);_0x3da050[_0x960a('0xa')](function(_0x4dd4d2,_0x47c01c){if(_0x4dd4d2){_0x1c9733(_0x4dd4d2[_0x960a('0x9')]());}else{if(_0x47c01c){_0x5e4579(_0x47c01c);}else{_0x1c9733('Not\x20verifired');}}});});};module[_0x960a('0xb')]=EmailSmtp;
\ No newline at end of file
+var _0x0275=['nodemailer-plugin-inline-base64','prototype','send','compile','sendMail','toString','verify','Not\x20verifired','exports','bluebird'];(function(_0x549565,_0x54bdb0){var _0x23c3cd=function(_0x3a81e7){while(--_0x3a81e7){_0x549565['push'](_0x549565['shift']());}};_0x23c3cd(++_0x54bdb0);}(_0x0275,0x1b7));var _0x5027=function(_0x1296ec,_0x18c4b6){_0x1296ec=_0x1296ec-0x0;var _0x49c5ae=_0x0275[_0x1296ec];return _0x49c5ae;};'use strict';var nodemailer=require('nodemailer');var BPromise=require(_0x5027('0x0'));var inlineBase64=require(_0x5027('0x1'));function EmailSmtp(){}EmailSmtp[_0x5027('0x2')][_0x5027('0x3')]=function(_0x12c49e,_0x325cfb){return new BPromise(function(_0x36d16a,_0x7db0aa){var _0x5753c5=nodemailer['createTransport'](_0x12c49e);_0x5753c5['use'](_0x5027('0x4'),inlineBase64());_0x5753c5[_0x5027('0x5')](_0x325cfb,function(_0x45fc35,_0x4f0298){if(_0x45fc35){_0x7db0aa(_0x45fc35[_0x5027('0x6')]());}else{_0x36d16a(_0x4f0298);}});});};EmailSmtp[_0x5027('0x2')][_0x5027('0x7')]=function(_0x160448){return new BPromise(function(_0x3dee64,_0x1e045f){var _0x21c3fb=nodemailer['createTransport'](_0x160448);_0x21c3fb[_0x5027('0x7')](function(_0x37538f,_0x2cf7c7){if(_0x37538f){_0x1e045f(_0x37538f[_0x5027('0x6')]());}else{if(_0x2cf7c7){_0x3dee64(_0x2cf7c7);}else{_0x1e045f(_0x5027('0x8'));}}});});};module[_0x5027('0x9')]=EmailSmtp;
\ No newline at end of file
diff --git a/server/services/email/lib/utils.js b/server/services/email/lib/utils.js
index 91b8102..fc0cdb3 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 _0x21a3=['outlook.office365.com','randomstring','path','util','node-tnef','../../../config/logger','email','../../../config/environment','value','address','anonymous','generate','head','name','split','length','slice','join','Anonymous','isEmpty','@xcally.com','html','test','replace','body','textAsHtml','Empty\x20message ','Attachments','Title','getHost','gmail','imap.gmail.com','yahoo','imap.mail.yahoo.com','hotmail','imap-mail.outlook.com','outlook365'];(function(_0x230c9d,_0x5e484a){var _0x158570=function(_0x308edf){while(--_0x308edf){_0x230c9d['push'](_0x230c9d['shift']());}};_0x158570(++_0x5e484a);}(_0x21a3,0x109));var _0x321a=function(_0x100682,_0x11afec){_0x100682=_0x100682-0x0;var _0xcb6e87=_0x21a3[_0x100682];return _0xcb6e87;};'use strict';var _=require('lodash');var moment=require('moment');var random=require(_0x321a('0x0'));var fs=require('fs');var path=require(_0x321a('0x1'));var util=require(_0x321a('0x2'));var tnef=require(_0x321a('0x3'));var logger=require(_0x321a('0x4'))(_0x321a('0x5'));var config=require(_0x321a('0x6'));function getAddress(_0x3a9b0d){var _0x4b9b46=_['head'](_0x3a9b0d[_0x321a('0x7')]);return _0x4b9b46&&_0x4b9b46[_0x321a('0x8')]?_0x4b9b46['address']:_0x321a('0x9')+random[_0x321a('0xa')](0x6)+'@xcally.com';}function getFirstName(_0x2da0f7){var _0x497a68=_[_0x321a('0xb')](_0x2da0f7[_0x321a('0x7')]);if(_0x497a68&&_0x497a68[_0x321a('0xc')]){var _0x4493e2=_0x497a68[_0x321a('0xc')][_0x321a('0xd')](/\s+/);return _0x4493e2[_0x321a('0xe')]?_0x4493e2[_0x321a('0xf')](0x0,-0x1)[_0x321a('0x10')]('\x20'):_0x497a68['name'];}return _0x321a('0x11');}function getLastName(_0x290c78){var _0x21037a=_[_0x321a('0xb')](_0x290c78[_0x321a('0x7')]);if(_0x21037a&&_0x21037a['name']){var _0x4406f1=_0x21037a[_0x321a('0xc')]['split'](/\s+/);return _0x4406f1[_0x321a('0xe')]>0x1?_0x4406f1['pop']():'';}return'';}function getMails(_0x14931f,_0x16cb76){var _0x1a24f9='';for(var _0x5be3e2=0x0;_0x5be3e2<_0x16cb76[_0x321a('0x7')][_0x321a('0xe')];_0x5be3e2+=0x1){if(_0x16cb76['value'][_0x5be3e2]['address']!==_0x14931f){if(!_[_0x321a('0x12')](_0x1a24f9)){_0x1a24f9+=',';}_0x1a24f9+=_0x16cb76[_0x321a('0x7')][_0x5be3e2]['name']||_0x16cb76[_0x321a('0x7')][_0x5be3e2][_0x321a('0x8')]||'';_0x1a24f9+='\x20<';_0x1a24f9+=_0x16cb76[_0x321a('0x7')][_0x5be3e2][_0x321a('0x8')]?_0x16cb76[_0x321a('0x7')][_0x5be3e2][_0x321a('0x8')]:'anonymous'+random['generate'](0x6)+_0x321a('0x13');_0x1a24f9+='>';}}return _0x1a24f9;}function parseEmail(_0x4ff2c3,_0x59a9f9,_0x542b3b){if(_0x59a9f9[_0x321a('0x14')]){var _0x18a844=/